From 16150c52ac3db5d0f09443a16ae5bb51ff2e5fb9 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Wed, 9 Feb 2022 09:00:58 +0100 Subject: [PATCH] Built motion from commit b9adbb98.|2.6.1 --- 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 +- 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/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/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/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.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/index.js | 2 +- 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/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.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/action.js | 2 +- server/services/ami/dialer/additionalPhone.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.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/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/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/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/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1187 files changed, 1187 insertions(+), 1187 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 84d3856..6909d6e 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-02-08T14:59:52.266Z", + "time": "2022-02-09T07:52:27.516Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9a4ed1d..3b630fb 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-02-08T14:59:52.266Z", + "time": "2022-02-09T07:52:27.516Z", "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 0b6c574..b085bf9 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 _0x9fa8=['contactManager','integration','motionbar','jscripty','urlForward','browser','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)]','STRING','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','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x9fa8,0x12b));var _0x89fa=function(_0x4ef354,_0x23e5a0){_0x4ef354=_0x4ef354-0x0;var _0x24a46e=_0x9fa8[_0x4ef354];return _0x24a46e;};'use strict';var Sequelize=require(_0x89fa('0x0'));module[_0x89fa('0x1')]={'name':{'type':Sequelize[_0x89fa('0x2')],'get':function(_0x147ebd){return this[_0x89fa('0x3')](_0x89fa('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x89fa('0x5'),_0x89fa('0x6'),_0x89fa('0x7'),_0x89fa('0x8'),_0x89fa('0x9'),_0x89fa('0xa'),'bot','script']],'msg':_0x89fa('0xb')}},'comment':_0x89fa('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x89fa('0xc')},'data2':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comment':_0x89fa('0xe')},'data3':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comment':_0x89fa('0xf')},'data4':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comments':_0x89fa('0x10')},'data5':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x89fa('0xd')],'comments':_0x89fa('0x11')},'data7':{'type':Sequelize[_0x89fa('0x12')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x45f7=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]'];(function(_0x4fdd3f,_0x2d3d16){var _0x3e2348=function(_0x37f10a){while(--_0x37f10a){_0x4fdd3f['push'](_0x4fdd3f['shift']());}};_0x3e2348(++_0x2d3d16);}(_0x45f7,0x148));var _0x745f=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x45f7[_0x454e6d];return _0x4bc294;};'use strict';var Sequelize=require('sequelize');module[_0x745f('0x0')]={'name':{'type':Sequelize[_0x745f('0x1')],'get':function(_0x43b766){return this[_0x745f('0x2')](_0x745f('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x745f('0x4'),_0x745f('0x5'),'urlForward',_0x745f('0x6'),'bot',_0x745f('0x7')]],'msg':_0x745f('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x745f('0x9')](0x1000),'comment':_0x745f('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x745f('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x745f('0xc')},'data4':{'type':Sequelize[_0x745f('0x9')](0x1000),'comments':_0x745f('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x745f('0xe')},'data6':{'type':Sequelize[_0x745f('0x9')],'comments':_0x745f('0xf')},'data7':{'type':Sequelize[_0x745f('0x10')],'comments':_0x745f('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 8b29f2c..6ce76e4 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 _0x7555=['reject','save','update','then','stack','name','body','find','params','catch','Action','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit'];(function(_0xef42a3,_0x50805d){var _0x42d1d3=function(_0x198383){while(--_0x198383){_0xef42a3['push'](_0xef42a3['shift']());}};_0x42d1d3(++_0x50805d);}(_0x7555,0x65));var _0x5755=function(_0x302ff9,_0x1a8faf){_0x302ff9=_0x302ff9-0x0;var _0x39cbf0=_0x7555[_0x302ff9];return _0x39cbf0;};'use strict';var emlformat=require(_0x5755('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5755('0x1'));var jsonpatch=require(_0x5755('0x2'));var rp=require(_0x5755('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5755('0x4'));var util=require(_0x5755('0x5'));var path=require(_0x5755('0x6'));var sox=require(_0x5755('0x7'));var csv=require(_0x5755('0x8'));var ejs=require(_0x5755('0x9'));var fs=require('fs');var fs_extra=require(_0x5755('0xa'));var _=require(_0x5755('0xb'));var squel=require(_0x5755('0xc'));var crypto=require(_0x5755('0xd'));var jsforce=require(_0x5755('0xe'));var deskjs=require(_0x5755('0xf'));var toCsv=require(_0x5755('0x8'));var querystring=require('querystring');var Papa=require(_0x5755('0x10'));var Redis=require(_0x5755('0x11'));var authService=require(_0x5755('0x12'));var qs=require(_0x5755('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5755('0x14'));var logger=require(_0x5755('0x15'))('api');var utils=require(_0x5755('0x16'));var config=require(_0x5755('0x17'));var licenseUtil=require(_0x5755('0x18'));var db=require(_0x5755('0x19'))['db'];function respondWithStatusCode(_0x578d7d,_0x5b73df){_0x5b73df=_0x5b73df||0xcc;return function(_0xd15a0a){if(_0xd15a0a){return _0x578d7d[_0x5755('0x1a')](_0x5b73df);}return _0x578d7d[_0x5755('0x1b')](_0x5b73df)[_0x5755('0x1c')]();};}function respondWithResult(_0x56b05c,_0x324c82){_0x324c82=_0x324c82||0xc8;return function(_0x12edeb){if(_0x12edeb){return _0x56b05c[_0x5755('0x1b')](_0x324c82)[_0x5755('0x1d')](_0x12edeb);}};}function respondWithFilteredResult(_0x13b95d,_0x6a5b65){return function(_0x412902){if(_0x412902){var _0x1c4403=typeof _0x6a5b65['offset']===_0x5755('0x1e')&&typeof _0x6a5b65['limit']===_0x5755('0x1e');var _0x97f22=_0x412902[_0x5755('0x1f')];var _0x489b25=_0x1c4403?0x0:_0x6a5b65[_0x5755('0x20')];var _0x36365f=_0x1c4403?_0x412902[_0x5755('0x1f')]:_0x6a5b65[_0x5755('0x20')]+_0x6a5b65[_0x5755('0x21')];var _0x2c92b4;if(_0x36365f>=_0x97f22){_0x36365f=_0x97f22;_0x2c92b4=0xc8;}else{_0x2c92b4=0xce;}_0x13b95d[_0x5755('0x1b')](_0x2c92b4);return _0x13b95d['set']('Content-Range',_0x489b25+'-'+_0x36365f+'/'+_0x97f22)[_0x5755('0x1d')](_0x412902);}return null;};}function patchUpdates(_0x2f73c3){return function(_0x1887fd){try{jsonpatch['apply'](_0x1887fd,_0x2f73c3,!![]);}catch(_0x3d9cfa){return BPromise[_0x5755('0x22')](_0x3d9cfa);}return _0x1887fd[_0x5755('0x23')]();};}function saveUpdates(_0x11dc58,_0x4565e7){return function(_0x57fc72){if(_0x57fc72){return _0x57fc72[_0x5755('0x24')](_0x11dc58)['then'](function(_0x52152c){return _0x52152c;});}return null;};}function removeEntity(_0x437624,_0x5748fa){return function(_0x25f19b){if(_0x25f19b){return _0x25f19b['destroy']()[_0x5755('0x25')](function(){_0x437624[_0x5755('0x1b')](0xcc)[_0x5755('0x1c')]();});}};}function handleEntityNotFound(_0x3f0a33,_0x1258bc){return function(_0x566391){if(!_0x566391){_0x3f0a33['sendStatus'](0x194);}return _0x566391;};}function handleError(_0x426043,_0x5a8e48){_0x5a8e48=_0x5a8e48||0x1f4;return function(_0xbf9144){logger['error'](_0xbf9144[_0x5755('0x26')]);if(_0xbf9144[_0x5755('0x27')]){delete _0xbf9144[_0x5755('0x27')];}_0x426043['status'](_0x5a8e48)['send'](_0xbf9144);};}exports[_0x5755('0x24')]=function(_0x29a82f,_0x3d09bb){if(_0x29a82f[_0x5755('0x28')]['id']){delete _0x29a82f['body']['id'];}return db['Action'][_0x5755('0x29')]({'where':{'id':_0x29a82f[_0x5755('0x2a')]['id']}})[_0x5755('0x25')](handleEntityNotFound(_0x3d09bb,null))[_0x5755('0x25')](saveUpdates(_0x29a82f['body'],null))['then'](respondWithResult(_0x3d09bb,null))[_0x5755('0x2b')](handleError(_0x3d09bb,null));};exports['destroy']=function(_0x466913,_0x2e65b4){return db[_0x5755('0x2c')]['find']({'where':{'id':_0x466913[_0x5755('0x2a')]['id']}})[_0x5755('0x25')](handleEntityNotFound(_0x2e65b4,null))[_0x5755('0x25')](removeEntity(_0x2e65b4,null))[_0x5755('0x2b')](handleError(_0x2e65b4,null));}; \ No newline at end of file +var _0x5518=['find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action'];(function(_0x144863,_0x4e6697){var _0x557a96=function(_0x1d4244){while(--_0x1d4244){_0x144863['push'](_0x144863['shift']());}};_0x557a96(++_0x4e6697);}(_0x5518,0x1b3));var _0x8551=function(_0x10c6ef,_0x5534fe){_0x10c6ef=_0x10c6ef-0x0;var _0x160322=_0x5518[_0x10c6ef];return _0x160322;};'use strict';var emlformat=require(_0x8551('0x0'));var rimraf=require(_0x8551('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8551('0x2'));var rp=require(_0x8551('0x3'));var moment=require(_0x8551('0x4'));var BPromise=require(_0x8551('0x5'));var Mustache=require(_0x8551('0x6'));var util=require(_0x8551('0x7'));var path=require(_0x8551('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8551('0x9'));var fs=require('fs');var fs_extra=require(_0x8551('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8551('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8551('0xc'));var querystring=require(_0x8551('0xd'));var Papa=require(_0x8551('0xe'));var Redis=require(_0x8551('0xf'));var authService=require(_0x8551('0x10'));var qs=require(_0x8551('0x11'));var as=require(_0x8551('0x12'));var hardwareService=require(_0x8551('0x13'));var logger=require(_0x8551('0x14'))('api');var utils=require(_0x8551('0x15'));var config=require(_0x8551('0x16'));var licenseUtil=require(_0x8551('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aa976,_0x53974f){_0x53974f=_0x53974f||0xcc;return function(_0x314d9d){if(_0x314d9d){return _0x1aa976['sendStatus'](_0x53974f);}return _0x1aa976[_0x8551('0x18')](_0x53974f)[_0x8551('0x19')]();};}function respondWithResult(_0x5a739e,_0x17c5a3){_0x17c5a3=_0x17c5a3||0xc8;return function(_0x5babc8){if(_0x5babc8){return _0x5a739e[_0x8551('0x18')](_0x17c5a3)[_0x8551('0x1a')](_0x5babc8);}};}function respondWithFilteredResult(_0x33921d,_0x2ab5e6){return function(_0x28ecba){if(_0x28ecba){var _0x1c5083=typeof _0x2ab5e6['offset']===_0x8551('0x1b')&&typeof _0x2ab5e6[_0x8551('0x1c')]===_0x8551('0x1b');var _0x4fc2aa=_0x28ecba[_0x8551('0x1d')];var _0x39f5bb=_0x1c5083?0x0:_0x2ab5e6['offset'];var _0x11b7c0=_0x1c5083?_0x28ecba[_0x8551('0x1d')]:_0x2ab5e6['offset']+_0x2ab5e6[_0x8551('0x1c')];var _0x16e9dc;if(_0x11b7c0>=_0x4fc2aa){_0x11b7c0=_0x4fc2aa;_0x16e9dc=0xc8;}else{_0x16e9dc=0xce;}_0x33921d['status'](_0x16e9dc);return _0x33921d[_0x8551('0x1e')](_0x8551('0x1f'),_0x39f5bb+'-'+_0x11b7c0+'/'+_0x4fc2aa)[_0x8551('0x1a')](_0x28ecba);}return null;};}function patchUpdates(_0x2df243){return function(_0x5515a3){try{jsonpatch[_0x8551('0x20')](_0x5515a3,_0x2df243,!![]);}catch(_0x54e803){return BPromise[_0x8551('0x21')](_0x54e803);}return _0x5515a3[_0x8551('0x22')]();};}function saveUpdates(_0x4350dc,_0x5cd9b7){return function(_0x3e358b){if(_0x3e358b){return _0x3e358b[_0x8551('0x23')](_0x4350dc)[_0x8551('0x24')](function(_0x26ecda){return _0x26ecda;});}return null;};}function removeEntity(_0x266bbd,_0x58cbb7){return function(_0x8fefd4){if(_0x8fefd4){return _0x8fefd4[_0x8551('0x25')]()[_0x8551('0x24')](function(){_0x266bbd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e5a94,_0x46112e){return function(_0x3e6e03){if(!_0x3e6e03){_0x4e5a94[_0x8551('0x26')](0x194);}return _0x3e6e03;};}function handleError(_0x518dd6,_0x43ec1c){_0x43ec1c=_0x43ec1c||0x1f4;return function(_0x2047c1){logger[_0x8551('0x27')](_0x2047c1[_0x8551('0x28')]);if(_0x2047c1[_0x8551('0x29')]){delete _0x2047c1[_0x8551('0x29')];}_0x518dd6[_0x8551('0x18')](_0x43ec1c)[_0x8551('0x2a')](_0x2047c1);};}exports[_0x8551('0x23')]=function(_0x1fe741,_0x563634){if(_0x1fe741[_0x8551('0x2b')]['id']){delete _0x1fe741[_0x8551('0x2b')]['id'];}return db[_0x8551('0x2c')][_0x8551('0x2d')]({'where':{'id':_0x1fe741[_0x8551('0x2e')]['id']}})['then'](handleEntityNotFound(_0x563634,null))[_0x8551('0x24')](saveUpdates(_0x1fe741[_0x8551('0x2b')],null))[_0x8551('0x24')](respondWithResult(_0x563634,null))[_0x8551('0x2f')](handleError(_0x563634,null));};exports[_0x8551('0x25')]=function(_0x54a88f,_0x29b7e6){return db[_0x8551('0x2c')][_0x8551('0x2d')]({'where':{'id':_0x54a88f[_0x8551('0x2e')]['id']}})[_0x8551('0x24')](handleEntityNotFound(_0x29b7e6,null))[_0x8551('0x24')](removeEntity(_0x29b7e6,null))[_0x8551('0x2f')](handleError(_0x29b7e6,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 93e8e36..55ae4dc 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 _0x5a4d=['bluebird','request-promise','path','rimraf','./action.attributes','Action','tools_actions','lodash','../../config/logger','moment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5a4d,0x18d));var _0xd5a4=function(_0x1985a6,_0xf5988a){_0x1985a6=_0x1985a6-0x0;var _0x130395=_0x5a4d[_0x1985a6];return _0x130395;};'use strict';var _=require(_0xd5a4('0x0'));var util=require('util');var logger=require(_0xd5a4('0x1'))('api');var moment=require(_0xd5a4('0x2'));var BPromise=require(_0xd5a4('0x3'));var rp=require(_0xd5a4('0x4'));var fs=require('fs');var path=require(_0xd5a4('0x5'));var rimraf=require(_0xd5a4('0x6'));var config=require('../../config/environment');var attributes=require(_0xd5a4('0x7'));module['exports']=function(_0x431b4b,_0x4d5ff9){return _0x431b4b['define'](_0xd5a4('0x8'),attributes,{'tableName':_0xd5a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1ef=['Action','tools_actions','lodash','../../config/logger','api','bluebird','path','rimraf','./action.attributes'];(function(_0xa25b20,_0x2c8254){var _0x387ba4=function(_0xddf94d){while(--_0xddf94d){_0xa25b20['push'](_0xa25b20['shift']());}};_0x387ba4(++_0x2c8254);}(_0xb1ef,0x146));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfb1e('0x0'));var util=require('util');var logger=require(_0xfb1e('0x1'))(_0xfb1e('0x2'));var moment=require('moment');var BPromise=require(_0xfb1e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb1e('0x4'));var rimraf=require(_0xfb1e('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb1e('0x6'));module['exports']=function(_0x33b9ca,_0x4a44e2){return _0x33b9ca['define'](_0xfb1e('0x7'),attributes,{'tableName':_0xfb1e('0x8'),'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 7aa9d8a..9de24c1 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2332ac,_0x318329){var _0x1ed7a7=function(_0x44f10a){while(--_0x44f10a){_0x2332ac['push'](_0x2332ac['shift']());}};_0x1ed7a7(++_0x318329);}(_0x5fc3,0xa8));var _0x35fc=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0x5fc3[_0x41bdd4];return _0x5c03a6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x290d20,_0x3d2b74){var _0x4b5056=function(_0x5e91bb){while(--_0x5e91bb){_0x290d20['push'](_0x290d20['shift']());}};_0x4b5056(++_0x3d2b74);}(_0x1261,0x144));var _0x1126=function(_0x2c3458,_0x1f7efd){_0x2c3458=_0x2c3458-0x0;var _0x3f7e02=_0x1261[_0x2c3458];return _0x3f7e02;};'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')]('Action,\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/action/index.js b/server/api/action/index.js index 4cf3930..a322f7d 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 _0x3edf=['exports','multer','path','express','fs-extra','../../config/environment','put','delete','isAuthenticated'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x3edf,0x1e7));var _0xf3ed=function(_0x1654ab,_0x41a7fb){_0x1654ab=_0x1654ab-0x0;var _0x113be2=_0x3edf[_0x1654ab];return _0x113be2;};'use strict';var multer=require(_0xf3ed('0x0'));var util=require('util');var path=require(_0xf3ed('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3ed('0x2'));var router=express['Router']();var fs_extra=require(_0xf3ed('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf3ed('0x4'));var controller=require('./action.controller');router[_0xf3ed('0x5')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf3ed('0x6')]('/:id',auth[_0xf3ed('0x7')](),controller['destroy']);module[_0xf3ed('0x8')]=router; \ No newline at end of file +var _0x3a74=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update'];(function(_0x1c7152,_0x3a94f1){var _0x17747a=function(_0x2e9f87){while(--_0x2e9f87){_0x1c7152['push'](_0x1c7152['shift']());}};_0x17747a(++_0x3a94f1);}(_0x3a74,0x93));var _0x43a7=function(_0x1e7be1,_0x161891){_0x1e7be1=_0x1e7be1-0x0;var _0x5c9c54=_0x3a74[_0x1e7be1];return _0x5c9c54;};'use strict';var multer=require(_0x43a7('0x0'));var util=require(_0x43a7('0x1'));var path=require(_0x43a7('0x2'));var timeout=require(_0x43a7('0x3'));var express=require(_0x43a7('0x4'));var router=express['Router']();var fs_extra=require(_0x43a7('0x5'));var auth=require(_0x43a7('0x6'));var interaction=require(_0x43a7('0x7'));var config=require(_0x43a7('0x8'));var controller=require(_0x43a7('0x9'));router['put'](_0x43a7('0xa'),auth[_0x43a7('0xb')](),controller[_0x43a7('0xc')]);router[_0x43a7('0xd')](_0x43a7('0xa'),auth['isAuthenticated'](),controller[_0x43a7('0xe')]);module[_0x43a7('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d1c1ded..0b81e3d 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x253c60,_0x2b47ef){var _0x4b7ca1=function(_0x37d0da){while(--_0x37d0da){_0x253c60['push'](_0x253c60['shift']());}};_0x4b7ca1(++_0x2b47ef);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3012f5,_0x3ed0bf){_0x3012f5=_0x3012f5-0x0;var _0x5395db=_0x9c5a[_0x3012f5];return _0x5395db;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','TEXT'];(function(_0x292c18,_0x5ac463){var _0x5b1235=function(_0x37dce3){while(--_0x37dce3){_0x292c18['push'](_0x292c18['shift']());}};_0x5b1235(++_0x5ac463);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index ee1a523..ddd4849 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 _0xe77e=['right_join','value','Sequelize','ValidationErrorItem','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','destroy','then','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','AnalyticCustomReport','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','debug','toString','sequelize','QueryTypes'];(function(_0x2c3def,_0x34b7c2){var _0x55b215=function(_0x3904f3){while(--_0x3904f3){_0x2c3def['push'](_0x2c3def['shift']());}};_0x55b215(++_0x34b7c2);}(_0xe77e,0xc4));var _0xee77=function(_0x4d9428,_0x1a7508){_0x4d9428=_0x4d9428-0x0;var _0x1d49f3=_0xe77e[_0x4d9428];return _0x1d49f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee77('0x0'));var zipdir=require(_0xee77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee77('0x2'));var moment=require(_0xee77('0x3'));var BPromise=require(_0xee77('0x4'));var Mustache=require(_0xee77('0x5'));var util=require(_0xee77('0x6'));var path=require(_0xee77('0x7'));var sox=require(_0xee77('0x8'));var csv=require(_0xee77('0x9'));var ejs=require(_0xee77('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xee77('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xee77('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee77('0xd'));var Redis=require(_0xee77('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xee77('0xf'));var as=require(_0xee77('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee77('0x11'))(_0xee77('0x12'));var utils=require(_0xee77('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xee77('0x14'));var db=require(_0xee77('0x15'))['db'];var dbH=require('../../mysqldb')[_0xee77('0x16')];function respondWithStatusCode(_0x3bf2b9,_0x35f147){_0x35f147=_0x35f147||0xcc;return function(_0x2f7beb){if(_0x2f7beb){return _0x3bf2b9['sendStatus'](_0x35f147);}return _0x3bf2b9[_0xee77('0x17')](_0x35f147)[_0xee77('0x18')]();};}function respondWithResult(_0x2373b2,_0x3e1412){_0x3e1412=_0x3e1412||0xc8;return function(_0x35fc40){if(_0x35fc40){return _0x2373b2[_0xee77('0x17')](_0x3e1412)['json'](_0x35fc40);}};}function respondWithFilteredResult(_0x117e06,_0x384c00){return function(_0x28d55a){if(_0x28d55a){var _0x455dca=typeof _0x384c00[_0xee77('0x19')]==='undefined'&&typeof _0x384c00[_0xee77('0x1a')]===_0xee77('0x1b');var _0x39bbd2=_0x28d55a[_0xee77('0x1c')];var _0x10f837=_0x455dca?0x0:_0x384c00['offset'];var _0xda448b=_0x455dca?_0x28d55a[_0xee77('0x1c')]:_0x384c00[_0xee77('0x19')]+_0x384c00['limit'];var _0x1513e8;if(_0xda448b>=_0x39bbd2){_0xda448b=_0x39bbd2;_0x1513e8=0xc8;}else{_0x1513e8=0xce;}_0x117e06[_0xee77('0x17')](_0x1513e8);return _0x117e06[_0xee77('0x1d')](_0xee77('0x1e'),_0x10f837+'-'+_0xda448b+'/'+_0x39bbd2)[_0xee77('0x1f')](_0x28d55a);}return null;};}function patchUpdates(_0x26c880){return function(_0x1ab640){try{jsonpatch[_0xee77('0x20')](_0x1ab640,_0x26c880,!![]);}catch(_0x1ce343){return BPromise['reject'](_0x1ce343);}return _0x1ab640[_0xee77('0x21')]();};}function saveUpdates(_0xc0ea04,_0x3c2f23){return function(_0x31bd8b){if(_0x31bd8b){return _0x31bd8b['update'](_0xc0ea04)['then'](function(_0xa40dad){return _0xa40dad;});}return null;};}function removeEntity(_0x1ba5f0,_0x15e9c1){return function(_0x290052){if(_0x290052){return _0x290052[_0xee77('0x22')]()[_0xee77('0x23')](function(){var _0x39248b=_0x290052['get']({'plain':!![]});var _0x4bf852=_0xee77('0x24');return db[_0xee77('0x25')][_0xee77('0x22')]({'where':{'type':_0x4bf852,'resourceId':_0x39248b['id']}})[_0xee77('0x23')](function(){return _0x290052;});})[_0xee77('0x23')](function(){_0x1ba5f0['status'](0xcc)[_0xee77('0x18')]();});}};}function handleEntityNotFound(_0x219fa7,_0x25d942){return function(_0x49bd05){if(!_0x49bd05){_0x219fa7[_0xee77('0x26')](0x194);}return _0x49bd05;};}function handleError(_0x1a8256,_0x737f40){_0x737f40=_0x737f40||0x1f4;return function(_0x2ec5d3){logger[_0xee77('0x27')](_0x2ec5d3[_0xee77('0x28')]);if(_0x2ec5d3[_0xee77('0x29')]){delete _0x2ec5d3['name'];}_0x1a8256['status'](_0x737f40)[_0xee77('0x2a')](_0x2ec5d3);};}exports[_0xee77('0x2b')]=function(_0x35fee7,_0x1dff09){var _0x63c197={},_0x3f3834={},_0x239895={'count':0x0,'rows':[]};var _0x2b4499=_['map'](db[_0xee77('0x2c')]['rawAttributes'],function(_0x1bf213){return{'name':_0x1bf213['fieldName'],'type':_0x1bf213[_0xee77('0x2d')][_0xee77('0x2e')]};});_0x3f3834[_0xee77('0x2f')]=_[_0xee77('0x30')](_0x2b4499,_0xee77('0x29'));_0x3f3834[_0xee77('0x31')]=_[_0xee77('0x32')](_0x35fee7['query']);_0x3f3834['filters']=_['intersection'](_0x3f3834[_0xee77('0x2f')],_0x3f3834[_0xee77('0x31')]);_0x63c197[_0xee77('0x33')]=_['intersection'](_0x3f3834[_0xee77('0x2f')],qs[_0xee77('0x34')](_0x35fee7[_0xee77('0x31')][_0xee77('0x34')]));_0x63c197[_0xee77('0x33')]=_0x63c197['attributes'][_0xee77('0x35')]?_0x63c197[_0xee77('0x33')]:_0x3f3834[_0xee77('0x2f')];if(!_0x35fee7[_0xee77('0x31')][_0xee77('0x36')](_0xee77('0x37'))){_0x63c197[_0xee77('0x1a')]=qs[_0xee77('0x1a')](_0x35fee7[_0xee77('0x31')][_0xee77('0x1a')]);_0x63c197[_0xee77('0x19')]=qs['offset'](_0x35fee7['query'][_0xee77('0x19')]);}_0x63c197[_0xee77('0x38')]=qs[_0xee77('0x39')](_0x35fee7[_0xee77('0x31')][_0xee77('0x39')]);_0x63c197[_0xee77('0x3a')]=qs[_0xee77('0x3b')](_['pick'](_0x35fee7[_0xee77('0x31')],_0x3f3834['filters']),_0x2b4499);if(_0x35fee7[_0xee77('0x31')]['filter']){_0x63c197[_0xee77('0x3a')]=_[_0xee77('0x3c')](_0x63c197['where'],{'$or':_['map'](_0x2b4499,function(_0x31a2e0){if(_0x31a2e0[_0xee77('0x2d')]!==_0xee77('0x3d')){var _0x49118d={};_0x49118d[_0x31a2e0['name']]={'$like':'%'+_0x35fee7[_0xee77('0x31')][_0xee77('0x3e')]+'%'};return _0x49118d;}})});}_0x63c197=_[_0xee77('0x3c')]({},_0x63c197,_0x35fee7[_0xee77('0x3f')]);var _0x3e21a7={'where':_0x63c197[_0xee77('0x3a')]};return db[_0xee77('0x2c')][_0xee77('0x1c')](_0x3e21a7)[_0xee77('0x23')](function(_0x2373e7){_0x239895[_0xee77('0x1c')]=_0x2373e7;if(_0x35fee7['query'][_0xee77('0x40')]){_0x63c197['include']=[{'all':!![]}];}return db[_0xee77('0x2c')][_0xee77('0x41')](_0x63c197);})[_0xee77('0x23')](function(_0x10f6cb){_0x239895[_0xee77('0x42')]=_0x10f6cb;return _0x239895;})['then'](respondWithFilteredResult(_0x1dff09,_0x63c197))[_0xee77('0x43')](handleError(_0x1dff09,null));};exports[_0xee77('0x44')]=function(_0x5d494e,_0x2ab15b){var _0x1f7c83={'raw':![],'where':{'id':_0x5d494e[_0xee77('0x45')]['id']}},_0x35fe82={};_0x35fe82[_0xee77('0x2f')]=_[_0xee77('0x32')](db[_0xee77('0x2c')][_0xee77('0x46')]);_0x35fe82['query']=_[_0xee77('0x32')](_0x5d494e[_0xee77('0x31')]);_0x35fe82[_0xee77('0x3b')]=_[_0xee77('0x47')](_0x35fe82[_0xee77('0x2f')],_0x35fe82[_0xee77('0x31')]);_0x1f7c83[_0xee77('0x33')]=_[_0xee77('0x47')](_0x35fe82['model'],qs[_0xee77('0x34')](_0x5d494e[_0xee77('0x31')][_0xee77('0x34')]));_0x1f7c83[_0xee77('0x33')]=_0x1f7c83[_0xee77('0x33')][_0xee77('0x35')]?_0x1f7c83[_0xee77('0x33')]:_0x35fe82[_0xee77('0x2f')];if(_0x5d494e[_0xee77('0x31')][_0xee77('0x40')]){_0x1f7c83[_0xee77('0x48')]=[{'all':!![]}];}_0x1f7c83=_[_0xee77('0x3c')]({},_0x1f7c83,_0x5d494e[_0xee77('0x3f')]);return db[_0xee77('0x2c')][_0xee77('0x49')](_0x1f7c83)[_0xee77('0x23')](handleEntityNotFound(_0x2ab15b,null))[_0xee77('0x23')](respondWithResult(_0x2ab15b,null))['catch'](handleError(_0x2ab15b,null));};exports[_0xee77('0x4a')]=function(_0x3b912c,_0x3b3a48){return db[_0xee77('0x2c')][_0xee77('0x4a')](_0x3b912c[_0xee77('0x4b')],{})['then'](function(_0x2f3587){var _0x2bf4ef=_0x3b912c[_0xee77('0x4c')][_0xee77('0x4d')]({'plain':!![]});if(!_0x2bf4ef)throw new Error(_0xee77('0x4e'));if(_0x2bf4ef[_0xee77('0x4f')]==='user'){var _0x590daf=_0x2f3587['get']({'plain':!![]});var _0x4ef38e=_0xee77('0x50');return db[_0xee77('0x51')][_0xee77('0x49')]({'where':{'name':_0x4ef38e,'userProfileId':_0x2bf4ef[_0xee77('0x52')]},'raw':!![]})['then'](function(_0x528050){if(_0x528050&&_0x528050[_0xee77('0x53')]===0x0){return db[_0xee77('0x25')]['create']({'name':_0x590daf[_0xee77('0x29')],'resourceId':_0x590daf['id'],'type':'CustomReports','sectionId':_0x528050['id']},{})[_0xee77('0x23')](function(){return _0x2f3587;});}else{return _0x2f3587;}})[_0xee77('0x43')](function(_0x36b779){logger[_0xee77('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36b779);throw _0x36b779;});}return _0x2f3587;})[_0xee77('0x23')](respondWithResult(_0x3b3a48,0xc9))[_0xee77('0x43')](handleError(_0x3b3a48,null));};exports[_0xee77('0x54')]=function(_0x13b024,_0x422818){if(_0x13b024[_0xee77('0x4b')]['id']){delete _0x13b024[_0xee77('0x4b')]['id'];}return db[_0xee77('0x2c')][_0xee77('0x49')]({'where':{'id':_0x13b024['params']['id']}})[_0xee77('0x23')](handleEntityNotFound(_0x422818,null))[_0xee77('0x23')](saveUpdates(_0x13b024['body'],null))[_0xee77('0x23')](respondWithResult(_0x422818,null))[_0xee77('0x43')](handleError(_0x422818,null));};exports[_0xee77('0x22')]=function(_0x1ac75d,_0x50ab26){return db[_0xee77('0x2c')][_0xee77('0x49')]({'where':{'id':_0x1ac75d[_0xee77('0x45')]['id']}})[_0xee77('0x23')](handleEntityNotFound(_0x50ab26,null))[_0xee77('0x23')](removeEntity(_0x50ab26,null))[_0xee77('0x43')](handleError(_0x50ab26,null));};exports[_0xee77('0x55')]=function(_0x4de8ed,_0x3479ad){var _0x5a50c7=0xa;var _0x282c46=[_0xee77('0x56'),_0xee77('0x57'),'right_join',_0xee77('0x58')];var _0x28a549={'SUM':_0xee77('0x59'),'COUNT':_0xee77('0x5a'),'COUNT DISTINCT':_0xee77('0x5b'),'MAX':_0xee77('0x5c'),'MIN':_0xee77('0x5d'),'AVG':_0xee77('0x5e'),'GROUP_CONCAT':_0xee77('0x5f'),'GROUP_CONCAT ASC':_0xee77('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e0118={'SEC_TO_TIME':_0xee77('0x61'),'DATE':_0xee77('0x62'),'HOUR':_0xee77('0x63'),'ROUND':_0xee77('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4cae28=function(_0xf19782){return!_[_0xee77('0x65')]([_0xee77('0x66'),_0xee77('0x67'),_0xee77('0x68'),_0xee77('0x69')],_0xf19782);};var _0x5b5aea=function(_0x57c525){if(!_0x57c525||!_0x57c525['rules'][_0xee77('0x35')]){return'';}for(var _0x986d21='(',_0x3361c9=0x0;_0x3361c9<_0x57c525[_0xee77('0x6a')][_0xee77('0x35')];_0x3361c9+=0x1){_0x3361c9>0x0&&(_0x986d21+='\x20'+_0x57c525[_0xee77('0x6b')]+'\x20');_0x986d21+=_0x57c525[_0xee77('0x6a')][_0x3361c9][_0xee77('0x6c')]?_0x5b5aea(_0x57c525['rules'][_0x3361c9]['group']):_0x57c525[_0xee77('0x6a')][_0x3361c9][_0xee77('0x6d')]+'\x20'+_0x57c525['rules'][_0x3361c9][_0xee77('0x6e')]+(_0x4cae28(_0x57c525[_0xee77('0x6a')][_0x3361c9]['condition'])?'\x20'+_0x57c525[_0xee77('0x6a')][_0x3361c9]['value']:'');}return _0x986d21+')';};var _0x522e5a={'where':{'id':_0x4de8ed['params']['id']}},_0x22716b,_0x5b88cf,_0x3d7cf5,_0xbe8cc4,_0x5eb255;_0x522e5a=_[_0xee77('0x3c')]({},_0x522e5a,_0x4de8ed[_0xee77('0x3f')]);return db['AnalyticCustomReport']['find'](_0x522e5a)[_0xee77('0x23')](function(_0x141356){if(_0x141356){_0x22716b=_0x141356;return _0x141356[_0xee77('0x6f')]();}return null;})[_0xee77('0x23')](function(_0x58157d){if(_0x58157d){if(!_0x58157d[_0xee77('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xee77('0x70'),0x193);}_0x5b88cf=_0x58157d;return db[_0xee77('0x71')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x53913c){if(_0x53913c){_0x3d7cf5=_[_0xee77('0x72')](_0x53913c,'id');var _0x1a42e9;var _0x2e9038=squel[_0xee77('0x73')]();_0x2e9038[_0xee77('0x74')](_0x22716b[_0xee77('0x75')]);for(var _0x382b85=0x0;_0x382b85<_0x5b88cf[_0xee77('0x35')];_0x382b85+=0x1){_0x1a42e9=_0x5b88cf[_0x382b85][_0xee77('0x76')]?_0x3d7cf5[_0x5b88cf[_0x382b85]['MetricId']][_0xee77('0x77')]:_0x5b88cf[_0x382b85]['field'];_0x1a42e9=_0x5b88cf[_0x382b85][_0xee77('0x78')]?_['replace'](_0x28a549[_0x5b88cf[_0x382b85][_0xee77('0x78')]],'%s',_0x1a42e9):_0x1a42e9;_0x1a42e9=_0x5b88cf[_0x382b85][_0xee77('0x79')]?_[_0xee77('0x7a')](_0x2e0118[_0x5b88cf[_0x382b85][_0xee77('0x79')]],'%s',_0x1a42e9):_0x1a42e9;if(_0x5b88cf[_0x382b85][_0xee77('0x7b')]){_0x2e9038[_0xee77('0x6c')](_0x1a42e9);}_0x5b88cf[_0x382b85]['orderBy']&&_0x2e9038[_0xee77('0x38')](_0x1a42e9,_0x5b88cf[_0x382b85][_0xee77('0x7c')]===_0xee77('0x7d')?![]:!![]);_0x2e9038['field'](_0x1a42e9,_0x5b88cf[_0x382b85][_0xee77('0x7e')]||_0x1a42e9);}if(_0x22716b[_0xee77('0x7f')]){_0x22716b[_0xee77('0x7f')]=JSON[_0xee77('0x80')](_0x22716b['joins']);for(var _0xb576f9=0x0;_0xb576f9<_0x22716b[_0xee77('0x7f')]['length'];_0xb576f9+=0x1){if(_0x22716b['joins'][_0xb576f9][_0xee77('0x2d')]&&_[_0xee77('0x65')](_0x282c46,_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x2d')])&&_0x22716b['joins'][_0xb576f9][_0xee77('0x81')]&&_0x22716b['joins'][_0xb576f9]['foreignTable']&&_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x82')]){_0x2e9038[_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x2d')]](_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x83')],null,util[_0xee77('0x79')]('%s.%s\x20=\x20%s.%s',_0x22716b['table'],_0x22716b[_0xee77('0x7f')][_0xb576f9]['parentKey'],_0x22716b['joins'][_0xb576f9][_0xee77('0x83')],_0x22716b['joins'][_0xb576f9]['foreignKey']));}}}if(_0x22716b[_0xee77('0x84')]){_0x22716b['conditions']=JSON[_0xee77('0x80')](_0x22716b['conditions']);_0x2e9038[_0xee77('0x3a')](_0x5b5aea(_0x22716b[_0xee77('0x84')][_0xee77('0x6c')]));}_0x5eb255=_0x2e9038[_0xee77('0x85')]();_0x2e9038[_0xee77('0x1a')](_0x5a50c7);_0x2e9038[_0xee77('0x19')](0x0);logger[_0xee77('0x86')]('Limited\x20Query:',_0x2e9038[_0xee77('0x87')]());return dbH[_0xee77('0x88')][_0xee77('0x31')](_0x2e9038[_0xee77('0x87')](),{'type':dbH[_0xee77('0x88')][_0xee77('0x89')]['SELECT']});}})['then'](respondWithResult(_0x3479ad,null))[_0xee77('0x43')](handleError(_0x3479ad,null));};function runReport(_0x5dfcf1,_0x3d987d,_0x2d4453){var _0x330392=_0x3d987d[_0xee77('0x29')];var _0x35621d=0xa;var _0x4557cb=[_0xee77('0x56'),'left_join',_0xee77('0x8a'),_0xee77('0x58')];var _0x255297={'SUM':_0xee77('0x59'),'COUNT':_0xee77('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee77('0x5c'),'MIN':_0xee77('0x5d'),'AVG':_0xee77('0x5e'),'GROUP_CONCAT':_0xee77('0x5f'),'GROUP_CONCAT ASC':_0xee77('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25c3c6={'SEC_TO_TIME':_0xee77('0x61'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x33f407=function(_0x3f293a){return!_['includes']([_0xee77('0x66'),'IS\x20NOT\x20NULL',_0xee77('0x68'),'IS\x20NOT\x20EMPTY'],_0x3f293a);};var _0x2d86db=function(_0x1c978c){if(!_0x1c978c||!_0x1c978c['rules'][_0xee77('0x35')]){return'';}for(var _0x161391='(',_0x4cc36b=0x0;_0x4cc36b<_0x1c978c[_0xee77('0x6a')][_0xee77('0x35')];_0x4cc36b+=0x1){_0x4cc36b>0x0&&(_0x161391+='\x20'+_0x1c978c['operator']+'\x20');_0x161391+=_0x1c978c[_0xee77('0x6a')][_0x4cc36b][_0xee77('0x6c')]?_0x2d86db(_0x1c978c[_0xee77('0x6a')][_0x4cc36b][_0xee77('0x6c')]):_0x1c978c['rules'][_0x4cc36b]['field']+'\x20'+_0x1c978c['rules'][_0x4cc36b]['condition']+(_0x33f407(_0x1c978c[_0xee77('0x6a')][_0x4cc36b][_0xee77('0x6e')])?'\x20'+_0x1c978c['rules'][_0x4cc36b][_0xee77('0x8b')]:'');}return _0x161391+')';};var _0x581f8d={'where':{'id':_0x5dfcf1['id']}},_0x5997a8,_0x50322e,_0x26ba12,_0x415ca7,_0xc5f1d7;_0x581f8d=_[_0xee77('0x3c')]({},_0x581f8d,_0x2d4453);return db[_0xee77('0x2c')][_0xee77('0x49')](_0x581f8d)['then'](function(_0x57c89d){if(_0x57c89d){_0x5997a8=_0x57c89d;return _0x57c89d[_0xee77('0x6f')]();}return null;})['then'](function(_0x25a658){if(_0x25a658){if(!_0x25a658['length']){throw new db[(_0xee77('0x8c'))][(_0xee77('0x8d'))](_0xee77('0x70'),0x193);}_0x50322e=_0x25a658;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xee77('0x23')](function(_0x56ce6c){if(_0x56ce6c){_0x26ba12=_[_0xee77('0x72')](_0x56ce6c,'id');var _0x33948a;var _0xdb8692=squel[_0xee77('0x73')]();_0xdb8692['from'](_0x5997a8[_0xee77('0x75')]);for(var _0x27d7b2=0x0;_0x27d7b2<_0x50322e[_0xee77('0x35')];_0x27d7b2+=0x1){_0x33948a=_0x50322e[_0x27d7b2]['MetricId']?_0x26ba12[_0x50322e[_0x27d7b2][_0xee77('0x76')]][_0xee77('0x77')]:_0x50322e[_0x27d7b2][_0xee77('0x6d')];_0x33948a=_0x50322e[_0x27d7b2]['function']?_[_0xee77('0x7a')](_0x255297[_0x50322e[_0x27d7b2][_0xee77('0x78')]],'%s',_0x33948a):_0x33948a;_0x33948a=_0x50322e[_0x27d7b2][_0xee77('0x79')]?_[_0xee77('0x7a')](_0x25c3c6[_0x50322e[_0x27d7b2][_0xee77('0x79')]],'%s',_0x33948a):_0x33948a;if(_0x50322e[_0x27d7b2][_0xee77('0x7b')]){_0xdb8692[_0xee77('0x6c')](_0x33948a);}_0x50322e[_0x27d7b2][_0xee77('0x7c')]&&_0xdb8692[_0xee77('0x38')](_0x33948a,_0x50322e[_0x27d7b2]['orderBy']===_0xee77('0x7d')?![]:!![]);_0xdb8692['field'](_0x33948a,_0x50322e[_0x27d7b2][_0xee77('0x7e')]||_0x33948a);}if(_0x5997a8[_0xee77('0x7f')]){_0x5997a8[_0xee77('0x7f')]=JSON[_0xee77('0x80')](_0x5997a8[_0xee77('0x7f')]);for(var _0x3ccbb3=0x0;_0x3ccbb3<_0x5997a8[_0xee77('0x7f')]['length'];_0x3ccbb3+=0x1){if(_0x5997a8[_0xee77('0x7f')][_0x3ccbb3]['type']&&_[_0xee77('0x65')](_0x4557cb,_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x2d')])&&_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x81')]&&_0x5997a8['joins'][_0x3ccbb3][_0xee77('0x83')]&&_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x82')]){_0xdb8692[_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x2d')]](_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x83')],null,util[_0xee77('0x79')](_0xee77('0x8e'),_0x5997a8[_0xee77('0x75')],_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x81')],_0x5997a8['joins'][_0x3ccbb3][_0xee77('0x83')],_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x82')]));}}}if(_0x5997a8['conditions']){_0x5997a8['conditions']=JSON[_0xee77('0x80')](_0x5997a8[_0xee77('0x84')]);_0xdb8692[_0xee77('0x3a')](_0x2d86db(_0x5997a8[_0xee77('0x84')][_0xee77('0x6c')]));}_0xc5f1d7=_0xdb8692[_0xee77('0x85')]();_0xdb8692[_0xee77('0x1a')](_0x35621d);_0xdb8692[_0xee77('0x19')](0x0);return;}})[_0xee77('0x23')](function(){if(_0x3d987d[_0xee77('0x8f')]===_0xee77('0x90')){return null;}var _0x2345cd=_[_0xee77('0x3c')](_0x3d987d,{'name':_0x3d987d[_0xee77('0x91')]||_0x3d987d[_0xee77('0x29')]||_0x5997a8['name'],'basename':_0x330392,'savename':util[_0xee77('0x79')](_0xee77('0x92'),_0x3d987d[_0xee77('0x29')]||_0x5997a8[_0xee77('0x29')],require('randomstring')['generate'](0x4),_0x3d987d[_0xee77('0x8f')]||_0xee77('0x93')),'reportId':_0x5997a8['id'],'reportType':_0xee77('0x94')});return db[_0xee77('0x95')][_0xee77('0x4a')](_0x2345cd,{'raw':!![]});})['then'](function(_0x4b62ed){if(_0x5997a8[_0xee77('0x75')]===_0xee77('0x96')){_0xc5f1d7['where'](_0x5997a8[_0xee77('0x75')]+_0xee77('0x97'),_0x3d987d[_0xee77('0x98')],_0x3d987d[_0xee77('0x99')]);}else{_0xc5f1d7['where'](_0x5997a8[_0xee77('0x75')]+_0xee77('0x9a'),_0x3d987d['startDate'],_0x3d987d[_0xee77('0x99')]);}if(_0x4b62ed){logger[_0xee77('0x9b')](_0xee77('0x9c'),_0xc5f1d7[_0xee77('0x87')]());require('child_process')[_0xee77('0x9d')](path['join'](__dirname,_0xee77('0x9e'),_0x4b62ed[_0xee77('0x8f')]),[_0x4b62ed['id'],_0xc5f1d7['toString'](),path[_0xee77('0x56')](__dirname,_0xee77('0x9f'),_0x4b62ed[_0xee77('0xa0')]),_0x330392]);return _0x4b62ed;}else{var _0x469916=squel[_0xee77('0x73')]();_0x469916['from']('('+_0xc5f1d7[_0xee77('0x87')]()+')',_0xee77('0xa1'));_0x469916[_0xee77('0x6d')](_0xee77('0xa2'),_0xee77('0x1c'));_0xc5f1d7['limit'](_0x3d987d['limit']||_0x35621d);_0xc5f1d7[_0xee77('0x19')](_0x3d987d['offset']||0x0);return dbH[_0xee77('0x88')][_0xee77('0x31')](_0x469916[_0xee77('0x87')](),{'type':dbH['sequelize'][_0xee77('0x89')][_0xee77('0xa3')]})[_0xee77('0x23')](function(_0x701c80){if(!_0x701c80[_0xee77('0x35')]){_0x415ca7=0x0;}else{_0x415ca7=_0x701c80[0x0][_0xee77('0x1c')]||0x0;}return dbH[_0xee77('0x88')]['query'](_0xc5f1d7[_0xee77('0x87')](),{'type':dbH['sequelize'][_0xee77('0x89')][_0xee77('0xa3')]});})[_0xee77('0x23')](function(_0x389cce){return{'rows':_0x389cce||[],'count':_0x415ca7};});}});}exports[_0xee77('0xa4')]=function(_0x3f3319,_0x456347){return runReport(_0x3f3319[_0xee77('0x45')],_0x3f3319[_0xee77('0x31')],_0x3f3319['options'])[_0xee77('0x23')](respondWithResult(_0x456347,null))[_0xee77('0x43')](handleError(_0x456347,null));};exports['runReport']=runReport;exports[_0xee77('0x31')]=function(_0x2ff181,_0xbc9112){var _0x3f6994=0xa;var _0x191e22=[_0xee77('0x56'),_0xee77('0x57'),_0xee77('0x8a'),'cross_join'];var _0x41c018={'SUM':_0xee77('0x59'),'COUNT':_0xee77('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xee77('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xee77('0x60'),'GROUP_CONCAT DESC':_0xee77('0xa5')};var _0xb553eb={'SEC_TO_TIME':_0xee77('0x61'),'DATE':_0xee77('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee77('0xa6')};var _0x4d29b7=function(_0x589995){return!_['includes']([_0xee77('0x66'),_0xee77('0x67'),_0xee77('0x68'),'IS\x20NOT\x20EMPTY'],_0x589995);};var _0x50e338=function(_0x402a5c){if(!_0x402a5c||!_0x402a5c[_0xee77('0x6a')][_0xee77('0x35')]){return'';}for(var _0x518a42='(',_0x35e2ba=0x0;_0x35e2ba<_0x402a5c['rules'][_0xee77('0x35')];_0x35e2ba+=0x1){_0x35e2ba>0x0&&(_0x518a42+='\x20'+_0x402a5c['operator']+'\x20');_0x518a42+=_0x402a5c['rules'][_0x35e2ba][_0xee77('0x6c')]?_0x50e338(_0x402a5c[_0xee77('0x6a')][_0x35e2ba][_0xee77('0x6c')]):_0x402a5c[_0xee77('0x6a')][_0x35e2ba]['field']+'\x20'+_0x402a5c[_0xee77('0x6a')][_0x35e2ba]['condition']+(_0x4d29b7(_0x402a5c[_0xee77('0x6a')][_0x35e2ba][_0xee77('0x6e')])?'\x20'+_0x402a5c[_0xee77('0x6a')][_0x35e2ba][_0xee77('0x8b')]:'');}return _0x518a42+')';};var _0xfeebdc={'where':{'id':_0x2ff181[_0xee77('0x45')]['id']}},_0xfc5c44,_0x5d43ec,_0xa5456f,_0x158975,_0x5484fb;_0xfeebdc=_[_0xee77('0x3c')]({},_0xfeebdc,_0x2ff181[_0xee77('0x3f')]);return db['AnalyticCustomReport'][_0xee77('0x49')](_0xfeebdc)[_0xee77('0x23')](function(_0x3a76c8){if(_0x3a76c8){_0xfc5c44=_0x3a76c8;return _0x3a76c8['getFields']();}return null;})['then'](function(_0x230c5c){if(_0x230c5c){if(!_0x230c5c[_0xee77('0x35')]){throw new db[(_0xee77('0x8c'))][(_0xee77('0x8d'))](_0xee77('0x70'),0x193);}_0x5d43ec=_0x230c5c;return db[_0xee77('0x71')]['findAll']({'raw':!![]});}return null;})[_0xee77('0x23')](function(_0x47d051){if(_0x47d051){_0xa5456f=_[_0xee77('0x72')](_0x47d051,'id');var _0x4bec93;var _0x2c7b06=squel[_0xee77('0x73')]();_0x2c7b06[_0xee77('0x74')](_0xfc5c44[_0xee77('0x75')]);for(var _0xf4006=0x0;_0xf4006<_0x5d43ec[_0xee77('0x35')];_0xf4006+=0x1){_0x4bec93=_0x5d43ec[_0xf4006][_0xee77('0x76')]?_0xa5456f[_0x5d43ec[_0xf4006][_0xee77('0x76')]][_0xee77('0x77')]:_0x5d43ec[_0xf4006][_0xee77('0x6d')];_0x4bec93=_0x5d43ec[_0xf4006][_0xee77('0x78')]?_['replace'](_0x41c018[_0x5d43ec[_0xf4006][_0xee77('0x78')]],'%s',_0x4bec93):_0x4bec93;_0x4bec93=_0x5d43ec[_0xf4006][_0xee77('0x79')]?_['replace'](_0xb553eb[_0x5d43ec[_0xf4006][_0xee77('0x79')]],'%s',_0x4bec93):_0x4bec93;if(_0x5d43ec[_0xf4006][_0xee77('0x7b')]){_0x2c7b06[_0xee77('0x6c')](_0x4bec93);}_0x5d43ec[_0xf4006][_0xee77('0x7c')]&&_0x2c7b06[_0xee77('0x38')](_0x4bec93,_0x5d43ec[_0xf4006][_0xee77('0x7c')]==='DESC'?![]:!![]);_0x2c7b06['field'](_0x4bec93,_0x5d43ec[_0xf4006][_0xee77('0x7e')]||_0x4bec93);}if(_0xfc5c44['joins']){_0xfc5c44[_0xee77('0x7f')]=JSON[_0xee77('0x80')](_0xfc5c44[_0xee77('0x7f')]);for(var _0x2b8c84=0x0;_0x2b8c84<_0xfc5c44['joins'][_0xee77('0x35')];_0x2b8c84+=0x1){if(_0xfc5c44[_0xee77('0x7f')][_0x2b8c84]['type']&&_[_0xee77('0x65')](_0x191e22,_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x2d')])&&_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x81')]&&_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x83')]&&_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x82')]){_0x2c7b06[_0xfc5c44['joins'][_0x2b8c84][_0xee77('0x2d')]](_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x83')],null,util[_0xee77('0x79')](_0xee77('0x8e'),_0xfc5c44[_0xee77('0x75')],_0xfc5c44['joins'][_0x2b8c84]['parentKey'],_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x83')],_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x82')]));}}}if(_0xfc5c44[_0xee77('0x84')]){_0xfc5c44[_0xee77('0x84')]=JSON[_0xee77('0x80')](_0xfc5c44[_0xee77('0x84')]);_0x2c7b06[_0xee77('0x3a')](_0x50e338(_0xfc5c44[_0xee77('0x84')]['group']));}_0x5484fb=_0x2c7b06[_0xee77('0x85')]();_0x2c7b06[_0xee77('0x1a')](_0x3f6994);_0x2c7b06[_0xee77('0x19')](0x0);logger['debug']('Limited\x20Query:',_0x2c7b06['toString']());return dbH[_0xee77('0x88')][_0xee77('0x31')](_0x2c7b06['toString'](),{'type':dbH['sequelize'][_0xee77('0x89')][_0xee77('0xa3')]});}})[_0xee77('0x23')](function(){return{'sql':_0x5484fb['toString']()};})[_0xee77('0x23')](respondWithResult(_0xbc9112,null))[_0xee77('0x43')](handleError(_0xbc9112,null));}; \ No newline at end of file +var _0x8091=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','catch','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','MetricId','metric','function','replace','format','orderBy','DESC','joins','parentKey','foreignKey','foreignTable','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','IS\x20EMPTY','ValidationErrorItem','from','table','groupBy','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','HOUR(%s)','operator','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x4ba248,_0xb5f0cd){var _0x7fea04=function(_0x586ea4){while(--_0x586ea4){_0x4ba248['push'](_0x4ba248['shift']());}};_0x7fea04(++_0xb5f0cd);}(_0x8091,0x124));var _0x1809=function(_0x55f4df,_0xd5b609){_0x55f4df=_0x55f4df-0x0;var _0x5db630=_0x8091[_0x55f4df];return _0x5db630;};'use strict';var emlformat=require(_0x1809('0x0'));var rimraf=require(_0x1809('0x1'));var zipdir=require(_0x1809('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1809('0x3'));var BPromise=require(_0x1809('0x4'));var Mustache=require(_0x1809('0x5'));var util=require(_0x1809('0x6'));var path=require(_0x1809('0x7'));var sox=require(_0x1809('0x8'));var csv=require('to-csv');var ejs=require(_0x1809('0x9'));var fs=require('fs');var fs_extra=require(_0x1809('0xa'));var _=require(_0x1809('0xb'));var squel=require(_0x1809('0xc'));var crypto=require(_0x1809('0xd'));var jsforce=require(_0x1809('0xe'));var deskjs=require(_0x1809('0xf'));var toCsv=require(_0x1809('0x10'));var querystring=require('querystring');var Papa=require(_0x1809('0x11'));var Redis=require(_0x1809('0x12'));var authService=require(_0x1809('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1809('0x14'));var hardwareService=require(_0x1809('0x15'));var logger=require(_0x1809('0x16'))(_0x1809('0x17'));var utils=require(_0x1809('0x18'));var config=require(_0x1809('0x19'));var licenseUtil=require(_0x1809('0x1a'));var db=require(_0x1809('0x1b'))['db'];var dbH=require(_0x1809('0x1b'))['dbH'];function respondWithStatusCode(_0x142b90,_0x140e09){_0x140e09=_0x140e09||0xcc;return function(_0x1d85bf){if(_0x1d85bf){return _0x142b90['sendStatus'](_0x140e09);}return _0x142b90['status'](_0x140e09)['end']();};}function respondWithResult(_0x2d67ac,_0x4fb600){_0x4fb600=_0x4fb600||0xc8;return function(_0x2275c8){if(_0x2275c8){return _0x2d67ac['status'](_0x4fb600)['json'](_0x2275c8);}};}function respondWithFilteredResult(_0x13df4a,_0x19aae6){return function(_0x2cd365){if(_0x2cd365){var _0x2a2b2d=typeof _0x19aae6[_0x1809('0x1c')]===_0x1809('0x1d')&&typeof _0x19aae6['limit']==='undefined';var _0x8a8a41=_0x2cd365['count'];var _0x5ceef8=_0x2a2b2d?0x0:_0x19aae6[_0x1809('0x1c')];var _0x3fcd4a=_0x2a2b2d?_0x2cd365[_0x1809('0x1e')]:_0x19aae6[_0x1809('0x1c')]+_0x19aae6['limit'];var _0x47f3c1;if(_0x3fcd4a>=_0x8a8a41){_0x3fcd4a=_0x8a8a41;_0x47f3c1=0xc8;}else{_0x47f3c1=0xce;}_0x13df4a[_0x1809('0x1f')](_0x47f3c1);return _0x13df4a[_0x1809('0x20')](_0x1809('0x21'),_0x5ceef8+'-'+_0x3fcd4a+'/'+_0x8a8a41)['json'](_0x2cd365);}return null;};}function patchUpdates(_0x4b82c3){return function(_0x32dfb9){try{jsonpatch[_0x1809('0x22')](_0x32dfb9,_0x4b82c3,!![]);}catch(_0x25f5e2){return BPromise[_0x1809('0x23')](_0x25f5e2);}return _0x32dfb9[_0x1809('0x24')]();};}function saveUpdates(_0x317abb,_0x464934){return function(_0x5eee4b){if(_0x5eee4b){return _0x5eee4b[_0x1809('0x25')](_0x317abb)[_0x1809('0x26')](function(_0xde93c3){return _0xde93c3;});}return null;};}function removeEntity(_0x47c032,_0x2b2107){return function(_0xff7dfe){if(_0xff7dfe){return _0xff7dfe[_0x1809('0x27')]()[_0x1809('0x26')](function(){var _0x81b24d=_0xff7dfe[_0x1809('0x28')]({'plain':!![]});var _0x6c44fb=_0x1809('0x29');return db[_0x1809('0x2a')]['destroy']({'where':{'type':_0x6c44fb,'resourceId':_0x81b24d['id']}})['then'](function(){return _0xff7dfe;});})[_0x1809('0x26')](function(){_0x47c032['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb725a,_0x377a0c){return function(_0x31e0a1){if(!_0x31e0a1){_0xb725a[_0x1809('0x2b')](0x194);}return _0x31e0a1;};}function handleError(_0x599f7c,_0x5a609e){_0x5a609e=_0x5a609e||0x1f4;return function(_0x38b86c){logger[_0x1809('0x2c')](_0x38b86c['stack']);if(_0x38b86c['name']){delete _0x38b86c[_0x1809('0x2d')];}_0x599f7c[_0x1809('0x1f')](_0x5a609e)['send'](_0x38b86c);};}exports['index']=function(_0x21ddab,_0x3b62e4){var _0x51e4a6={},_0x146bc5={},_0x505d34={'count':0x0,'rows':[]};var _0x2bbe46=_[_0x1809('0x2e')](db[_0x1809('0x2f')][_0x1809('0x30')],function(_0x1667bb){return{'name':_0x1667bb[_0x1809('0x31')],'type':_0x1667bb[_0x1809('0x32')][_0x1809('0x33')]};});_0x146bc5[_0x1809('0x34')]=_[_0x1809('0x2e')](_0x2bbe46,_0x1809('0x2d'));_0x146bc5[_0x1809('0x35')]=_[_0x1809('0x36')](_0x21ddab[_0x1809('0x35')]);_0x146bc5['filters']=_[_0x1809('0x37')](_0x146bc5[_0x1809('0x34')],_0x146bc5[_0x1809('0x35')]);_0x51e4a6[_0x1809('0x38')]=_['intersection'](_0x146bc5['model'],qs[_0x1809('0x39')](_0x21ddab['query'][_0x1809('0x39')]));_0x51e4a6['attributes']=_0x51e4a6[_0x1809('0x38')][_0x1809('0x3a')]?_0x51e4a6[_0x1809('0x38')]:_0x146bc5[_0x1809('0x34')];if(!_0x21ddab['query'][_0x1809('0x3b')](_0x1809('0x3c'))){_0x51e4a6[_0x1809('0x3d')]=qs[_0x1809('0x3d')](_0x21ddab[_0x1809('0x35')]['limit']);_0x51e4a6['offset']=qs['offset'](_0x21ddab['query'][_0x1809('0x1c')]);}_0x51e4a6[_0x1809('0x3e')]=qs[_0x1809('0x3f')](_0x21ddab[_0x1809('0x35')][_0x1809('0x3f')]);_0x51e4a6['where']=qs[_0x1809('0x40')](_[_0x1809('0x41')](_0x21ddab['query'],_0x146bc5[_0x1809('0x40')]),_0x2bbe46);if(_0x21ddab[_0x1809('0x35')][_0x1809('0x42')]){_0x51e4a6['where']=_['merge'](_0x51e4a6[_0x1809('0x43')],{'$or':_[_0x1809('0x2e')](_0x2bbe46,function(_0x5576bc){if(_0x5576bc[_0x1809('0x32')]!==_0x1809('0x44')){var _0xb6e262={};_0xb6e262[_0x5576bc[_0x1809('0x2d')]]={'$like':'%'+_0x21ddab[_0x1809('0x35')][_0x1809('0x42')]+'%'};return _0xb6e262;}})});}_0x51e4a6=_[_0x1809('0x45')]({},_0x51e4a6,_0x21ddab[_0x1809('0x46')]);var _0x2434d7={'where':_0x51e4a6[_0x1809('0x43')]};return db[_0x1809('0x2f')][_0x1809('0x1e')](_0x2434d7)['then'](function(_0x3b0aa8){_0x505d34['count']=_0x3b0aa8;if(_0x21ddab[_0x1809('0x35')][_0x1809('0x47')]){_0x51e4a6['include']=[{'all':!![]}];}return db[_0x1809('0x2f')]['findAll'](_0x51e4a6);})['then'](function(_0x1921fc){_0x505d34[_0x1809('0x48')]=_0x1921fc;return _0x505d34;})['then'](respondWithFilteredResult(_0x3b62e4,_0x51e4a6))['catch'](handleError(_0x3b62e4,null));};exports[_0x1809('0x49')]=function(_0x4f23a,_0x28ff37){var _0x60fcab={'raw':![],'where':{'id':_0x4f23a[_0x1809('0x4a')]['id']}},_0x3b6bbd={};_0x3b6bbd[_0x1809('0x34')]=_[_0x1809('0x36')](db['AnalyticCustomReport']['rawAttributes']);_0x3b6bbd[_0x1809('0x35')]=_[_0x1809('0x36')](_0x4f23a[_0x1809('0x35')]);_0x3b6bbd['filters']=_[_0x1809('0x37')](_0x3b6bbd[_0x1809('0x34')],_0x3b6bbd['query']);_0x60fcab[_0x1809('0x38')]=_[_0x1809('0x37')](_0x3b6bbd[_0x1809('0x34')],qs[_0x1809('0x39')](_0x4f23a[_0x1809('0x35')][_0x1809('0x39')]));_0x60fcab[_0x1809('0x38')]=_0x60fcab['attributes'][_0x1809('0x3a')]?_0x60fcab[_0x1809('0x38')]:_0x3b6bbd[_0x1809('0x34')];if(_0x4f23a[_0x1809('0x35')]['includeAll']){_0x60fcab[_0x1809('0x4b')]=[{'all':!![]}];}_0x60fcab=_[_0x1809('0x45')]({},_0x60fcab,_0x4f23a[_0x1809('0x46')]);return db[_0x1809('0x2f')][_0x1809('0x4c')](_0x60fcab)[_0x1809('0x26')](handleEntityNotFound(_0x28ff37,null))[_0x1809('0x26')](respondWithResult(_0x28ff37,null))['catch'](handleError(_0x28ff37,null));};exports[_0x1809('0x4d')]=function(_0x5ca3ee,_0x4c06cc){return db[_0x1809('0x2f')][_0x1809('0x4d')](_0x5ca3ee[_0x1809('0x4e')],{})['then'](function(_0x5e5852){var _0x346239=_0x5ca3ee[_0x1809('0x4f')][_0x1809('0x28')]({'plain':!![]});if(!_0x346239)throw new Error(_0x1809('0x50'));if(_0x346239[_0x1809('0x51')]===_0x1809('0x4f')){var _0x4bb3b7=_0x5e5852[_0x1809('0x28')]({'plain':!![]});var _0x266a04=_0x1809('0x52');return db[_0x1809('0x53')][_0x1809('0x4c')]({'where':{'name':_0x266a04,'userProfileId':_0x346239[_0x1809('0x54')]},'raw':!![]})['then'](function(_0x159572){if(_0x159572&&_0x159572[_0x1809('0x55')]===0x0){return db[_0x1809('0x2a')][_0x1809('0x4d')]({'name':_0x4bb3b7[_0x1809('0x2d')],'resourceId':_0x4bb3b7['id'],'type':'CustomReports','sectionId':_0x159572['id']},{})['then'](function(){return _0x5e5852;});}else{return _0x5e5852;}})['catch'](function(_0x103628){logger[_0x1809('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x103628);throw _0x103628;});}return _0x5e5852;})[_0x1809('0x26')](respondWithResult(_0x4c06cc,0xc9))['catch'](handleError(_0x4c06cc,null));};exports[_0x1809('0x25')]=function(_0xb54a71,_0x4b3300){if(_0xb54a71[_0x1809('0x4e')]['id']){delete _0xb54a71[_0x1809('0x4e')]['id'];}return db['AnalyticCustomReport'][_0x1809('0x4c')]({'where':{'id':_0xb54a71[_0x1809('0x4a')]['id']}})[_0x1809('0x26')](handleEntityNotFound(_0x4b3300,null))[_0x1809('0x26')](saveUpdates(_0xb54a71[_0x1809('0x4e')],null))[_0x1809('0x26')](respondWithResult(_0x4b3300,null))[_0x1809('0x56')](handleError(_0x4b3300,null));};exports['destroy']=function(_0x2b9266,_0x2f680b){return db['AnalyticCustomReport'][_0x1809('0x4c')]({'where':{'id':_0x2b9266[_0x1809('0x4a')]['id']}})[_0x1809('0x26')](handleEntityNotFound(_0x2f680b,null))[_0x1809('0x26')](removeEntity(_0x2f680b,null))[_0x1809('0x56')](handleError(_0x2f680b,null));};exports[_0x1809('0x57')]=function(_0x28d3cc,_0x190add){var _0x59ef4f=0xa;var _0x4899a9=[_0x1809('0x58'),_0x1809('0x59'),'right_join',_0x1809('0x5a')];var _0x3b6d86={'SUM':_0x1809('0x5b'),'COUNT':_0x1809('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1809('0x5d'),'MIN':'MIN(%s)','AVG':_0x1809('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1809('0x5f'),'GROUP_CONCAT DESC':_0x1809('0x60')};var _0x37a40a={'SEC_TO_TIME':_0x1809('0x61'),'DATE':_0x1809('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x1809('0x63'),'UNIX_TIMESTAMP':_0x1809('0x64')};var _0x552453=function(_0xd0ff0a){return!_[_0x1809('0x65')]([_0x1809('0x66'),_0x1809('0x67'),'IS\x20EMPTY',_0x1809('0x68')],_0xd0ff0a);};var _0x3596fb=function(_0x4449f2){if(!_0x4449f2||!_0x4449f2[_0x1809('0x69')][_0x1809('0x3a')]){return'';}for(var _0x13b27c='(',_0x533a41=0x0;_0x533a41<_0x4449f2[_0x1809('0x69')][_0x1809('0x3a')];_0x533a41+=0x1){_0x533a41>0x0&&(_0x13b27c+='\x20'+_0x4449f2['operator']+'\x20');_0x13b27c+=_0x4449f2[_0x1809('0x69')][_0x533a41][_0x1809('0x6a')]?_0x3596fb(_0x4449f2[_0x1809('0x69')][_0x533a41]['group']):_0x4449f2[_0x1809('0x69')][_0x533a41][_0x1809('0x6b')]+'\x20'+_0x4449f2[_0x1809('0x69')][_0x533a41][_0x1809('0x6c')]+(_0x552453(_0x4449f2[_0x1809('0x69')][_0x533a41]['condition'])?'\x20'+_0x4449f2['rules'][_0x533a41][_0x1809('0x6d')]:'');}return _0x13b27c+')';};var _0x115e26={'where':{'id':_0x28d3cc[_0x1809('0x4a')]['id']}},_0x1d0b5e,_0x14ef6b,_0x203980,_0x1803bd,_0x1ba1a3;_0x115e26=_[_0x1809('0x45')]({},_0x115e26,_0x28d3cc[_0x1809('0x46')]);return db[_0x1809('0x2f')][_0x1809('0x4c')](_0x115e26)[_0x1809('0x26')](function(_0x2ca37a){if(_0x2ca37a){_0x1d0b5e=_0x2ca37a;return _0x2ca37a[_0x1809('0x6e')]();}return null;})[_0x1809('0x26')](function(_0x26bb99){if(_0x26bb99){if(!_0x26bb99[_0x1809('0x3a')]){throw new db[(_0x1809('0x6f'))]['ValidationErrorItem'](_0x1809('0x70'),0x193);}_0x14ef6b=_0x26bb99;return db[_0x1809('0x71')][_0x1809('0x72')]({'raw':!![]});}return null;})['then'](function(_0x3084ec){if(_0x3084ec){_0x203980=_[_0x1809('0x73')](_0x3084ec,'id');var _0x220daf;var _0x2f7c74=squel[_0x1809('0x74')]();_0x2f7c74['from'](_0x1d0b5e['table']);for(var _0x3ec3a1=0x0;_0x3ec3a1<_0x14ef6b[_0x1809('0x3a')];_0x3ec3a1+=0x1){_0x220daf=_0x14ef6b[_0x3ec3a1][_0x1809('0x75')]?_0x203980[_0x14ef6b[_0x3ec3a1][_0x1809('0x75')]][_0x1809('0x76')]:_0x14ef6b[_0x3ec3a1][_0x1809('0x6b')];_0x220daf=_0x14ef6b[_0x3ec3a1][_0x1809('0x77')]?_['replace'](_0x3b6d86[_0x14ef6b[_0x3ec3a1][_0x1809('0x77')]],'%s',_0x220daf):_0x220daf;_0x220daf=_0x14ef6b[_0x3ec3a1]['format']?_[_0x1809('0x78')](_0x37a40a[_0x14ef6b[_0x3ec3a1][_0x1809('0x79')]],'%s',_0x220daf):_0x220daf;if(_0x14ef6b[_0x3ec3a1]['groupBy']){_0x2f7c74['group'](_0x220daf);}_0x14ef6b[_0x3ec3a1][_0x1809('0x7a')]&&_0x2f7c74[_0x1809('0x3e')](_0x220daf,_0x14ef6b[_0x3ec3a1][_0x1809('0x7a')]===_0x1809('0x7b')?![]:!![]);_0x2f7c74['field'](_0x220daf,_0x14ef6b[_0x3ec3a1]['alias']||_0x220daf);}if(_0x1d0b5e[_0x1809('0x7c')]){_0x1d0b5e[_0x1809('0x7c')]=JSON['parse'](_0x1d0b5e['joins']);for(var _0x2b3841=0x0;_0x2b3841<_0x1d0b5e[_0x1809('0x7c')][_0x1809('0x3a')];_0x2b3841+=0x1){if(_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x32')]&&_[_0x1809('0x65')](_0x4899a9,_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x32')])&&_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7d')]&&_0x1d0b5e[_0x1809('0x7c')][_0x2b3841]['foreignTable']&&_0x1d0b5e['joins'][_0x2b3841][_0x1809('0x7e')]){_0x2f7c74[_0x1d0b5e[_0x1809('0x7c')][_0x2b3841]['type']](_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7f')],null,util[_0x1809('0x79')]('%s.%s\x20=\x20%s.%s',_0x1d0b5e['table'],_0x1d0b5e[_0x1809('0x7c')][_0x2b3841]['parentKey'],_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7f')],_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7e')]));}}}if(_0x1d0b5e[_0x1809('0x80')]){_0x1d0b5e[_0x1809('0x80')]=JSON[_0x1809('0x81')](_0x1d0b5e[_0x1809('0x80')]);_0x2f7c74[_0x1809('0x43')](_0x3596fb(_0x1d0b5e[_0x1809('0x80')][_0x1809('0x6a')]));}_0x1ba1a3=_0x2f7c74[_0x1809('0x82')]();_0x2f7c74[_0x1809('0x3d')](_0x59ef4f);_0x2f7c74[_0x1809('0x1c')](0x0);logger[_0x1809('0x83')](_0x1809('0x84'),_0x2f7c74[_0x1809('0x85')]());return dbH['sequelize'][_0x1809('0x35')](_0x2f7c74[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]});}})[_0x1809('0x26')](respondWithResult(_0x190add,null))['catch'](handleError(_0x190add,null));};function runReport(_0xaa2303,_0x294faa,_0x5b0d8e){var _0x104533=_0x294faa[_0x1809('0x2d')];var _0x3ad747=0xa;var _0x3acd45=[_0x1809('0x58'),'left_join',_0x1809('0x89'),'cross_join'];var _0x1e1492={'SUM':_0x1809('0x5b'),'COUNT':_0x1809('0x5c'),'COUNT DISTINCT':_0x1809('0x8a'),'MAX':'MAX(%s)','MIN':_0x1809('0x8b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1809('0x8c'),'GROUP_CONCAT ASC':_0x1809('0x5f'),'GROUP_CONCAT DESC':_0x1809('0x60')};var _0xce3d6e={'SEC_TO_TIME':_0x1809('0x61'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1809('0x64')};var _0x1e10a0=function(_0x1ae4e4){return!_[_0x1809('0x65')]([_0x1809('0x66'),_0x1809('0x67'),_0x1809('0x8d'),_0x1809('0x68')],_0x1ae4e4);};var _0x13b303=function(_0x12da14){if(!_0x12da14||!_0x12da14[_0x1809('0x69')][_0x1809('0x3a')]){return'';}for(var _0xabedca='(',_0x33c48d=0x0;_0x33c48d<_0x12da14[_0x1809('0x69')][_0x1809('0x3a')];_0x33c48d+=0x1){_0x33c48d>0x0&&(_0xabedca+='\x20'+_0x12da14['operator']+'\x20');_0xabedca+=_0x12da14[_0x1809('0x69')][_0x33c48d]['group']?_0x13b303(_0x12da14[_0x1809('0x69')][_0x33c48d][_0x1809('0x6a')]):_0x12da14[_0x1809('0x69')][_0x33c48d]['field']+'\x20'+_0x12da14['rules'][_0x33c48d][_0x1809('0x6c')]+(_0x1e10a0(_0x12da14['rules'][_0x33c48d][_0x1809('0x6c')])?'\x20'+_0x12da14[_0x1809('0x69')][_0x33c48d]['value']:'');}return _0xabedca+')';};var _0x5b08ec={'where':{'id':_0xaa2303['id']}},_0xed4258,_0x57d45d,_0x3b557f,_0x19b162,_0x350384;_0x5b08ec=_['merge']({},_0x5b08ec,_0x5b0d8e);return db['AnalyticCustomReport']['find'](_0x5b08ec)[_0x1809('0x26')](function(_0x3e1d62){if(_0x3e1d62){_0xed4258=_0x3e1d62;return _0x3e1d62[_0x1809('0x6e')]();}return null;})[_0x1809('0x26')](function(_0x5490c5){if(_0x5490c5){if(!_0x5490c5[_0x1809('0x3a')]){throw new db[(_0x1809('0x6f'))][(_0x1809('0x8e'))](_0x1809('0x70'),0x193);}_0x57d45d=_0x5490c5;return db[_0x1809('0x71')][_0x1809('0x72')]({'raw':!![]});}return null;})[_0x1809('0x26')](function(_0x4ca94f){if(_0x4ca94f){_0x3b557f=_[_0x1809('0x73')](_0x4ca94f,'id');var _0x6ec642;var _0x26fe09=squel[_0x1809('0x74')]();_0x26fe09[_0x1809('0x8f')](_0xed4258[_0x1809('0x90')]);for(var _0x49c6d2=0x0;_0x49c6d2<_0x57d45d[_0x1809('0x3a')];_0x49c6d2+=0x1){_0x6ec642=_0x57d45d[_0x49c6d2]['MetricId']?_0x3b557f[_0x57d45d[_0x49c6d2]['MetricId']][_0x1809('0x76')]:_0x57d45d[_0x49c6d2][_0x1809('0x6b')];_0x6ec642=_0x57d45d[_0x49c6d2][_0x1809('0x77')]?_[_0x1809('0x78')](_0x1e1492[_0x57d45d[_0x49c6d2][_0x1809('0x77')]],'%s',_0x6ec642):_0x6ec642;_0x6ec642=_0x57d45d[_0x49c6d2][_0x1809('0x79')]?_[_0x1809('0x78')](_0xce3d6e[_0x57d45d[_0x49c6d2][_0x1809('0x79')]],'%s',_0x6ec642):_0x6ec642;if(_0x57d45d[_0x49c6d2][_0x1809('0x91')]){_0x26fe09[_0x1809('0x6a')](_0x6ec642);}_0x57d45d[_0x49c6d2][_0x1809('0x7a')]&&_0x26fe09[_0x1809('0x3e')](_0x6ec642,_0x57d45d[_0x49c6d2][_0x1809('0x7a')]===_0x1809('0x7b')?![]:!![]);_0x26fe09['field'](_0x6ec642,_0x57d45d[_0x49c6d2][_0x1809('0x92')]||_0x6ec642);}if(_0xed4258['joins']){_0xed4258[_0x1809('0x7c')]=JSON[_0x1809('0x81')](_0xed4258[_0x1809('0x7c')]);for(var _0x503b98=0x0;_0x503b98<_0xed4258[_0x1809('0x7c')][_0x1809('0x3a')];_0x503b98+=0x1){if(_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x32')]&&_[_0x1809('0x65')](_0x3acd45,_0xed4258['joins'][_0x503b98][_0x1809('0x32')])&&_0xed4258['joins'][_0x503b98][_0x1809('0x7d')]&&_0xed4258[_0x1809('0x7c')][_0x503b98]['foreignTable']&&_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x7e')]){_0x26fe09[_0xed4258['joins'][_0x503b98]['type']](_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x7f')],null,util[_0x1809('0x79')](_0x1809('0x93'),_0xed4258[_0x1809('0x90')],_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x7d')],_0xed4258['joins'][_0x503b98]['foreignTable'],_0xed4258['joins'][_0x503b98][_0x1809('0x7e')]));}}}if(_0xed4258[_0x1809('0x80')]){_0xed4258[_0x1809('0x80')]=JSON['parse'](_0xed4258[_0x1809('0x80')]);_0x26fe09[_0x1809('0x43')](_0x13b303(_0xed4258[_0x1809('0x80')][_0x1809('0x6a')]));}_0x350384=_0x26fe09[_0x1809('0x82')]();_0x26fe09['limit'](_0x3ad747);_0x26fe09[_0x1809('0x1c')](0x0);return;}})[_0x1809('0x26')](function(){if(_0x294faa[_0x1809('0x94')]===_0x1809('0x95')){return null;}var _0x57a73a=_[_0x1809('0x45')](_0x294faa,{'name':_0x294faa[_0x1809('0x96')]||_0x294faa[_0x1809('0x2d')]||_0xed4258[_0x1809('0x2d')],'basename':_0x104533,'savename':util[_0x1809('0x79')](_0x1809('0x97'),_0x294faa[_0x1809('0x2d')]||_0xed4258[_0x1809('0x2d')],require(_0x1809('0x98'))[_0x1809('0x99')](0x4),_0x294faa[_0x1809('0x94')]||'csv'),'reportId':_0xed4258['id'],'reportType':_0x1809('0x9a')});return db[_0x1809('0x9b')]['create'](_0x57a73a,{'raw':!![]});})[_0x1809('0x26')](function(_0x126d2c){if(_0xed4258[_0x1809('0x90')]===_0x1809('0x9c')){_0x350384[_0x1809('0x43')](_0xed4258['table']+_0x1809('0x9d'),_0x294faa[_0x1809('0x9e')],_0x294faa[_0x1809('0x9f')]);}else{_0x350384[_0x1809('0x43')](_0xed4258[_0x1809('0x90')]+_0x1809('0xa0'),_0x294faa[_0x1809('0x9e')],_0x294faa[_0x1809('0x9f')]);}if(_0x126d2c){logger[_0x1809('0xa1')](_0x1809('0xa2'),_0x350384[_0x1809('0x85')]());require(_0x1809('0xa3'))[_0x1809('0xa4')](path[_0x1809('0x58')](__dirname,_0x1809('0xa5'),_0x126d2c['output']),[_0x126d2c['id'],_0x350384['toString'](),path['join'](__dirname,_0x1809('0xa6'),_0x126d2c[_0x1809('0xa7')]),_0x104533]);return _0x126d2c;}else{var _0x3974d9=squel[_0x1809('0x74')]();_0x3974d9[_0x1809('0x8f')]('('+_0x350384['toString']()+')',_0x1809('0xa8'));_0x3974d9[_0x1809('0x6b')](_0x1809('0xa9'),_0x1809('0x1e'));_0x350384[_0x1809('0x3d')](_0x294faa[_0x1809('0x3d')]||_0x3ad747);_0x350384[_0x1809('0x1c')](_0x294faa[_0x1809('0x1c')]||0x0);return dbH[_0x1809('0x86')]['query'](_0x3974d9[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]})[_0x1809('0x26')](function(_0x3b44f1){if(!_0x3b44f1[_0x1809('0x3a')]){_0x19b162=0x0;}else{_0x19b162=_0x3b44f1[0x0][_0x1809('0x1e')]||0x0;}return dbH[_0x1809('0x86')][_0x1809('0x35')](_0x350384[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]});})['then'](function(_0x5c22e7){return{'rows':_0x5c22e7||[],'count':_0x19b162};});}});}exports['run']=function(_0x38ea21,_0x5c0078){return runReport(_0x38ea21[_0x1809('0x4a')],_0x38ea21['query'],_0x38ea21[_0x1809('0x46')])[_0x1809('0x26')](respondWithResult(_0x5c0078,null))[_0x1809('0x56')](handleError(_0x5c0078,null));};exports[_0x1809('0xaa')]=runReport;exports[_0x1809('0x35')]=function(_0x365c42,_0x48932e){var _0x48122c=0xa;var _0x534688=[_0x1809('0x58'),'left_join','right_join',_0x1809('0x5a')];var _0x1261ca={'SUM':'SUM(%s)','COUNT':_0x1809('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x1809('0x8b'),'AVG':_0x1809('0x5e'),'GROUP_CONCAT':_0x1809('0x8c'),'GROUP_CONCAT ASC':_0x1809('0x5f'),'GROUP_CONCAT DESC':_0x1809('0x60')};var _0x2480e5={'SEC_TO_TIME':_0x1809('0x61'),'DATE':_0x1809('0x62'),'HOUR':_0x1809('0xab'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1809('0x64')};var _0x5b09bd=function(_0x275a85){return!_[_0x1809('0x65')](['IS\x20NULL',_0x1809('0x67'),_0x1809('0x8d'),'IS\x20NOT\x20EMPTY'],_0x275a85);};var _0x4f8877=function(_0x5976da){if(!_0x5976da||!_0x5976da['rules'][_0x1809('0x3a')]){return'';}for(var _0x3e1c35='(',_0x59de3e=0x0;_0x59de3e<_0x5976da['rules'][_0x1809('0x3a')];_0x59de3e+=0x1){_0x59de3e>0x0&&(_0x3e1c35+='\x20'+_0x5976da[_0x1809('0xac')]+'\x20');_0x3e1c35+=_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6a')]?_0x4f8877(_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6a')]):_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6b')]+'\x20'+_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6c')]+(_0x5b09bd(_0x5976da[_0x1809('0x69')][_0x59de3e]['condition'])?'\x20'+_0x5976da[_0x1809('0x69')][_0x59de3e]['value']:'');}return _0x3e1c35+')';};var _0x3ce05c={'where':{'id':_0x365c42[_0x1809('0x4a')]['id']}},_0x321452,_0xd78ab3,_0xd51404,_0x2f12e4,_0x282b78;_0x3ce05c=_[_0x1809('0x45')]({},_0x3ce05c,_0x365c42[_0x1809('0x46')]);return db[_0x1809('0x2f')][_0x1809('0x4c')](_0x3ce05c)[_0x1809('0x26')](function(_0x26bf35){if(_0x26bf35){_0x321452=_0x26bf35;return _0x26bf35[_0x1809('0x6e')]();}return null;})[_0x1809('0x26')](function(_0x11f48b){if(_0x11f48b){if(!_0x11f48b[_0x1809('0x3a')]){throw new db[(_0x1809('0x6f'))]['ValidationErrorItem'](_0x1809('0x70'),0x193);}_0xd78ab3=_0x11f48b;return db['AnalyticMetric'][_0x1809('0x72')]({'raw':!![]});}return null;})[_0x1809('0x26')](function(_0x188150){if(_0x188150){_0xd51404=_[_0x1809('0x73')](_0x188150,'id');var _0x5d08e4;var _0x49a532=squel[_0x1809('0x74')]();_0x49a532[_0x1809('0x8f')](_0x321452[_0x1809('0x90')]);for(var _0x2a92d6=0x0;_0x2a92d6<_0xd78ab3[_0x1809('0x3a')];_0x2a92d6+=0x1){_0x5d08e4=_0xd78ab3[_0x2a92d6][_0x1809('0x75')]?_0xd51404[_0xd78ab3[_0x2a92d6][_0x1809('0x75')]][_0x1809('0x76')]:_0xd78ab3[_0x2a92d6][_0x1809('0x6b')];_0x5d08e4=_0xd78ab3[_0x2a92d6]['function']?_['replace'](_0x1261ca[_0xd78ab3[_0x2a92d6]['function']],'%s',_0x5d08e4):_0x5d08e4;_0x5d08e4=_0xd78ab3[_0x2a92d6]['format']?_[_0x1809('0x78')](_0x2480e5[_0xd78ab3[_0x2a92d6][_0x1809('0x79')]],'%s',_0x5d08e4):_0x5d08e4;if(_0xd78ab3[_0x2a92d6][_0x1809('0x91')]){_0x49a532['group'](_0x5d08e4);}_0xd78ab3[_0x2a92d6]['orderBy']&&_0x49a532[_0x1809('0x3e')](_0x5d08e4,_0xd78ab3[_0x2a92d6][_0x1809('0x7a')]==='DESC'?![]:!![]);_0x49a532[_0x1809('0x6b')](_0x5d08e4,_0xd78ab3[_0x2a92d6][_0x1809('0x92')]||_0x5d08e4);}if(_0x321452[_0x1809('0x7c')]){_0x321452[_0x1809('0x7c')]=JSON[_0x1809('0x81')](_0x321452[_0x1809('0x7c')]);for(var _0x403f18=0x0;_0x403f18<_0x321452[_0x1809('0x7c')]['length'];_0x403f18+=0x1){if(_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x32')]&&_[_0x1809('0x65')](_0x534688,_0x321452[_0x1809('0x7c')][_0x403f18]['type'])&&_0x321452[_0x1809('0x7c')][_0x403f18]['parentKey']&&_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x7f')]&&_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x7e')]){_0x49a532[_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x32')]](_0x321452['joins'][_0x403f18][_0x1809('0x7f')],null,util[_0x1809('0x79')](_0x1809('0x93'),_0x321452[_0x1809('0x90')],_0x321452['joins'][_0x403f18][_0x1809('0x7d')],_0x321452['joins'][_0x403f18][_0x1809('0x7f')],_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x7e')]));}}}if(_0x321452[_0x1809('0x80')]){_0x321452[_0x1809('0x80')]=JSON[_0x1809('0x81')](_0x321452['conditions']);_0x49a532[_0x1809('0x43')](_0x4f8877(_0x321452[_0x1809('0x80')][_0x1809('0x6a')]));}_0x282b78=_0x49a532[_0x1809('0x82')]();_0x49a532[_0x1809('0x3d')](_0x48122c);_0x49a532[_0x1809('0x1c')](0x0);logger[_0x1809('0x83')]('Limited\x20Query:',_0x49a532[_0x1809('0x85')]());return dbH['sequelize'][_0x1809('0x35')](_0x49a532[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]});}})['then'](function(){return{'sql':_0x282b78[_0x1809('0x85')]()};})[_0x1809('0x26')](respondWithResult(_0x48932e,null))[_0x1809('0x56')](handleError(_0x48932e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 2e56b29..feea3e7 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 _0x27fc=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird'];(function(_0x145d1e,_0x263e6b){var _0x4a5495=function(_0x2eb189){while(--_0x2eb189){_0x145d1e['push'](_0x145d1e['shift']());}};_0x4a5495(++_0x263e6b);}(_0x27fc,0xd8));var _0xc27f=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x27fc[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0xc27f('0x0'));var util=require(_0xc27f('0x1'));var logger=require(_0xc27f('0x2'))('api');var moment=require(_0xc27f('0x3'));var BPromise=require(_0xc27f('0x4'));var rp=require(_0xc27f('0x5'));var fs=require('fs');var path=require(_0xc27f('0x6'));var rimraf=require('rimraf');var config=require(_0xc27f('0x7'));var attributes=require(_0xc27f('0x8'));module[_0xc27f('0x9')]=function(_0x38e911,_0xefeb68){return _0x38e911[_0xc27f('0xa')](_0xc27f('0xb'),attributes,{'tableName':_0xc27f('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x125d=['./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2474cd,_0x56c1cc){var _0x9f6b3e=function(_0x459ee6){while(--_0x459ee6){_0x2474cd['push'](_0x2474cd['shift']());}};_0x9f6b3e(++_0x56c1cc);}(_0x125d,0x66));var _0xd125=function(_0x12078d,_0x25fa78){_0x12078d=_0x12078d-0x0;var _0x167e27=_0x125d[_0x12078d];return _0x167e27;};'use strict';var _=require(_0xd125('0x0'));var util=require(_0xd125('0x1'));var logger=require('../../config/logger')(_0xd125('0x2'));var moment=require(_0xd125('0x3'));var BPromise=require(_0xd125('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd125('0x5'));var rimraf=require(_0xd125('0x6'));var config=require(_0xd125('0x7'));var attributes=require(_0xd125('0x8'));module['exports']=function(_0x10e17a,_0x24a0f7){return _0x10e17a[_0xd125('0x9')](_0xd125('0xa'),attributes,{'tableName':'analytics_custom_reports','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 3cd07da..58aff2d 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 _0x7f9c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash'];(function(_0x311f54,_0x5a83f3){var _0x26fe9e=function(_0x1dd811){while(--_0x1dd811){_0x311f54['push'](_0x311f54['shift']());}};_0x26fe9e(++_0x5a83f3);}(_0x7f9c,0x117));var _0xc7f9=function(_0x2a2d43,_0x165f8b){_0x2a2d43=_0x2a2d43-0x0;var _0xec3c59=_0x7f9c[_0x2a2d43];return _0xec3c59;};'use strict';var _=require(_0xc7f9('0x0'));var util=require(_0xc7f9('0x1'));var moment=require('moment');var BPromise=require(_0xc7f9('0x2'));var rs=require(_0xc7f9('0x3'));var fs=require('fs');var Redis=require(_0xc7f9('0x4'));var db=require(_0xc7f9('0x5'))['db'];var utils=require(_0xc7f9('0x6'));var logger=require('../../config/logger')(_0xc7f9('0x7'));var config=require('../../config/environment');var jayson=require(_0xc7f9('0x8'));var client=jayson[_0xc7f9('0x9')][_0xc7f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6b75,_0x60d7b,_0x1226e9){return new BPromise(function(_0xd571b,_0x3f3e73){return client['request'](_0x4f6b75,_0x1226e9)[_0xc7f9('0xb')](function(_0x13ec90){logger['info'](_0xc7f9('0xc'),_0x60d7b,_0xc7f9('0xd'));logger[_0xc7f9('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x60d7b,_0xc7f9('0xd'),JSON[_0xc7f9('0xf')](_0x13ec90));if(_0x13ec90['error']){if(_0x13ec90[_0xc7f9('0x10')]['code']===0x1f4){logger[_0xc7f9('0x10')](_0xc7f9('0xc'),_0x60d7b,_0x13ec90[_0xc7f9('0x10')][_0xc7f9('0x11')]);return _0x3f3e73(_0x13ec90[_0xc7f9('0x10')][_0xc7f9('0x11')]);}logger[_0xc7f9('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x60d7b,_0x13ec90['error'][_0xc7f9('0x11')]);return _0xd571b(_0x13ec90[_0xc7f9('0x10')][_0xc7f9('0x11')]);}else{logger[_0xc7f9('0x12')](_0xc7f9('0xc'),_0x60d7b,_0xc7f9('0xd'));_0xd571b(_0x13ec90[_0xc7f9('0x13')][_0xc7f9('0x11')]);}})['catch'](function(_0x1027b3){logger[_0xc7f9('0x10')](_0xc7f9('0xc'),_0x60d7b,_0x1027b3);_0x3f3e73(_0x1027b3);});});} \ No newline at end of file +var _0x712d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment'];(function(_0x412377,_0x3446b8){var _0x5b833a=function(_0x4e0ea4){while(--_0x4e0ea4){_0x412377['push'](_0x412377['shift']());}};_0x5b833a(++_0x3446b8);}(_0x712d,0x1e2));var _0xd712=function(_0x4bc62e,_0x2ed0a4){_0x4bc62e=_0x4bc62e-0x0;var _0xd9adfe=_0x712d[_0x4bc62e];return _0xd9adfe;};'use strict';var _=require(_0xd712('0x0'));var util=require('util');var moment=require(_0xd712('0x1'));var BPromise=require(_0xd712('0x2'));var rs=require(_0xd712('0x3'));var fs=require('fs');var Redis=require(_0xd712('0x4'));var db=require(_0xd712('0x5'))['db'];var utils=require(_0xd712('0x6'));var logger=require(_0xd712('0x7'))('rpc');var config=require(_0xd712('0x8'));var jayson=require(_0xd712('0x9'));var client=jayson[_0xd712('0xa')][_0xd712('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11cb31,_0x504912,_0x2d3ec3){return new BPromise(function(_0x5cedc0,_0x175cf6){return client['request'](_0x11cb31,_0x2d3ec3)[_0xd712('0xc')](function(_0x4d2188){logger[_0xd712('0xd')](_0xd712('0xe'),_0x504912,'request\x20sent');logger[_0xd712('0xf')](_0xd712('0x10'),_0x504912,_0xd712('0x11'),JSON[_0xd712('0x12')](_0x4d2188));if(_0x4d2188[_0xd712('0x13')]){if(_0x4d2188[_0xd712('0x13')]['code']===0x1f4){logger[_0xd712('0x13')](_0xd712('0xe'),_0x504912,_0x4d2188['error'][_0xd712('0x14')]);return _0x175cf6(_0x4d2188[_0xd712('0x13')]['message']);}logger[_0xd712('0x13')](_0xd712('0xe'),_0x504912,_0x4d2188[_0xd712('0x13')][_0xd712('0x14')]);return _0x5cedc0(_0x4d2188[_0xd712('0x13')][_0xd712('0x14')]);}else{logger[_0xd712('0xd')](_0xd712('0xe'),_0x504912,_0xd712('0x11'));_0x5cedc0(_0x4d2188['result'][_0xd712('0x14')]);}})[_0xd712('0x15')](function(_0x1ef8b6){logger[_0xd712('0x13')](_0xd712('0xe'),_0x504912,_0x1ef8b6);_0x175cf6(_0x1ef8b6);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 595cbc5..ab8c3a0 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 _0xc85c=['preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2f1ce0,_0x1920a2){var _0x41800a=function(_0x53f826){while(--_0x53f826){_0x2f1ce0['push'](_0x2f1ce0['shift']());}};_0x41800a(++_0x1920a2);}(_0xc85c,0xf6));var _0xcc85=function(_0x470615,_0x1c7aaa){_0x470615=_0x470615-0x0;var _0x189c81=_0xc85c[_0x470615];return _0x189c81;};'use strict';var multer=require(_0xcc85('0x0'));var util=require('util');var path=require(_0xcc85('0x1'));var timeout=require(_0xcc85('0x2'));var express=require(_0xcc85('0x3'));var router=express[_0xcc85('0x4')]();var fs_extra=require(_0xcc85('0x5'));var auth=require(_0xcc85('0x6'));var interaction=require(_0xcc85('0x7'));var config=require('../../config/environment');var controller=require(_0xcc85('0x8'));router[_0xcc85('0x9')]('/',auth[_0xcc85('0xa')](),controller[_0xcc85('0xb')]);router[_0xcc85('0x9')](_0xcc85('0xc'),auth[_0xcc85('0xa')](),controller[_0xcc85('0xd')]);router[_0xcc85('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xcc85('0xe')]);router[_0xcc85('0x9')](_0xcc85('0xf'),auth[_0xcc85('0xa')](),controller[_0xcc85('0x10')]);router[_0xcc85('0x9')](_0xcc85('0x11'),auth[_0xcc85('0xa')](),controller[_0xcc85('0x12')]);router[_0xcc85('0x13')]('/',auth[_0xcc85('0xa')](),controller[_0xcc85('0x14')]);router[_0xcc85('0x15')](_0xcc85('0xc'),auth['isAuthenticated'](),controller[_0xcc85('0x16')]);router[_0xcc85('0x17')](_0xcc85('0xc'),auth[_0xcc85('0xa')](),controller[_0xcc85('0x18')]);module[_0xcc85('0x19')]=router; \ No newline at end of file +var _0x56ca=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','create','put','delete'];(function(_0x294ebc,_0x355914){var _0x1db19b=function(_0x173eab){while(--_0x173eab){_0x294ebc['push'](_0x294ebc['shift']());}};_0x1db19b(++_0x355914);}(_0x56ca,0x1b9));var _0xa56c=function(_0x2b6b6e,_0x47f2b1){_0x2b6b6e=_0x2b6b6e-0x0;var _0x2bfceb=_0x56ca[_0x2b6b6e];return _0x2bfceb;};'use strict';var multer=require('multer');var util=require(_0xa56c('0x0'));var path=require('path');var timeout=require(_0xa56c('0x1'));var express=require(_0xa56c('0x2'));var router=express['Router']();var fs_extra=require(_0xa56c('0x3'));var auth=require(_0xa56c('0x4'));var interaction=require(_0xa56c('0x5'));var config=require(_0xa56c('0x6'));var controller=require(_0xa56c('0x7'));router[_0xa56c('0x8')]('/',auth[_0xa56c('0x9')](),controller[_0xa56c('0xa')]);router['get'](_0xa56c('0xb'),auth[_0xa56c('0x9')](),controller[_0xa56c('0xc')]);router[_0xa56c('0x8')](_0xa56c('0xd'),auth['isAuthenticated'](),controller[_0xa56c('0xe')]);router['get'](_0xa56c('0xf'),auth[_0xa56c('0x9')](),controller['run']);router[_0xa56c('0x8')](_0xa56c('0x10'),auth[_0xa56c('0x9')](),controller[_0xa56c('0x11')]);router['post']('/',auth[_0xa56c('0x9')](),controller[_0xa56c('0x12')]);router[_0xa56c('0x13')](_0xa56c('0xb'),auth[_0xa56c('0x9')](),controller['update']);router[_0xa56c('0x14')]('/:id',auth[_0xa56c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 31d667e..0482aab 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 _0x7fbe=['STRING','TEXT'];(function(_0x435aba,_0x1910b4){var _0x19c266=function(_0x2098aa){while(--_0x2098aa){_0x435aba['push'](_0x435aba['shift']());}};_0x19c266(++_0x1910b4);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x48a80d,_0x1b2aaf){_0x48a80d=_0x48a80d-0x0;var _0x267bcb=_0x7fbe[_0x48a80d];return _0x267bcb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file +var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0xa406af,_0xe9d7f1){var _0x22f04f=function(_0x3296d5){while(--_0x3296d5){_0xa406af['push'](_0xa406af['shift']());}};_0x22f04f(++_0xe9d7f1);}(_0xeda8,0x104));var _0x8eda=function(_0x561dea,_0x47c419){_0x561dea=_0x561dea-0x0;var _0x2e629e=_0xeda8[_0x561dea];return _0x2e629e;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a449670..d0ffdf8 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 _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0x30df37,_0x48ad64){_0x30df37=_0x30df37-0x0;var _0x41ab55=_0x687b[_0x30df37];return _0x41ab55;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file +var _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0xb14376,_0x5b0bf2){_0xb14376=_0xb14376-0x0;var _0x232f52=_0x687b[_0xb14376];return _0x232f52;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 542f635..04f3937 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 _0x584a=['AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x1d2103,_0x439533){var _0x4785a8=function(_0x5279ad){while(--_0x5279ad){_0x1d2103['push'](_0x1d2103['shift']());}};_0x4785a8(++_0x439533);}(_0x584a,0x183));var _0xa584=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0x584a[_0x3213b7];return _0xb960bf;};'use strict';var _=require(_0xa584('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa584('0x1'));var moment=require(_0xa584('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa584('0x3'));var rimraf=require(_0xa584('0x4'));var config=require(_0xa584('0x5'));var attributes=require(_0xa584('0x6'));module[_0xa584('0x7')]=function(_0x22e731,_0xf72819){return _0x22e731[_0xa584('0x8')](_0xa584('0x9'),attributes,{'tableName':_0xa584('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ddb=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9ddb,0x1d8));var _0xb9dd=function(_0x14278a,_0x485860){_0x14278a=_0x14278a-0x0;var _0x24835d=_0x9ddb[_0x14278a];return _0x24835d;};'use strict';var _=require('lodash');var util=require(_0xb9dd('0x0'));var logger=require(_0xb9dd('0x1'))(_0xb9dd('0x2'));var moment=require(_0xb9dd('0x3'));var BPromise=require(_0xb9dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb9dd('0x5'));var config=require(_0xb9dd('0x6'));var attributes=require(_0xb9dd('0x7'));module[_0xb9dd('0x8')]=function(_0x904f5c,_0x44b7){return _0x904f5c[_0xb9dd('0x9')](_0xb9dd('0xa'),attributes,{'tableName':_0xb9dd('0xb'),'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 33ee911..f02b808 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 _0x10b0=['client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x10b0,0x1e5));var _0x010b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x10b0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x010b('0x0'));var util=require(_0x010b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x010b('0x2'));var fs=require('fs');var Redis=require(_0x010b('0x3'));var db=require(_0x010b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x010b('0x5'))(_0x010b('0x6'));var config=require(_0x010b('0x7'));var jayson=require(_0x010b('0x8'));var client=jayson[_0x010b('0x9')][_0x010b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f30ae,_0x358c42,_0x22a8e9){return new BPromise(function(_0x549725,_0x446e74){return client[_0x010b('0xb')](_0x3f30ae,_0x22a8e9)['then'](function(_0x56a04f){logger[_0x010b('0xc')](_0x010b('0xd'),_0x358c42,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x358c42,_0x010b('0xe'),JSON['stringify'](_0x56a04f));if(_0x56a04f[_0x010b('0xf')]){if(_0x56a04f[_0x010b('0xf')][_0x010b('0x10')]===0x1f4){logger['error'](_0x010b('0xd'),_0x358c42,_0x56a04f['error'][_0x010b('0x11')]);return _0x446e74(_0x56a04f[_0x010b('0xf')][_0x010b('0x11')]);}logger['error'](_0x010b('0xd'),_0x358c42,_0x56a04f[_0x010b('0xf')][_0x010b('0x11')]);return _0x549725(_0x56a04f[_0x010b('0xf')][_0x010b('0x11')]);}else{logger[_0x010b('0xc')](_0x010b('0xd'),_0x358c42,_0x010b('0xe'));_0x549725(_0x56a04f['result'][_0x010b('0x11')]);}})[_0x010b('0x12')](function(_0x2dd9aa){logger[_0x010b('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x358c42,_0x2dd9aa);_0x446e74(_0x2dd9aa);});});} \ No newline at end of file +var _0x5036=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x11c4ff,_0x567b13){var _0x52e721=function(_0x2fd190){while(--_0x2fd190){_0x11c4ff['push'](_0x11c4ff['shift']());}};_0x52e721(++_0x567b13);}(_0x5036,0x91));var _0x6503=function(_0x34271c,_0x28a8b){_0x34271c=_0x34271c-0x0;var _0x83585f=_0x5036[_0x34271c];return _0x83585f;};'use strict';var _=require('lodash');var util=require(_0x6503('0x0'));var moment=require(_0x6503('0x1'));var BPromise=require(_0x6503('0x2'));var rs=require(_0x6503('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6503('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6503('0x5'))(_0x6503('0x6'));var config=require(_0x6503('0x7'));var jayson=require(_0x6503('0x8'));var client=jayson[_0x6503('0x9')][_0x6503('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3332cf,_0x51bab9,_0x2e9f1a){return new BPromise(function(_0x1018eb,_0x3db1b4){return client[_0x6503('0xb')](_0x3332cf,_0x2e9f1a)[_0x6503('0xc')](function(_0x59c835){logger['info'](_0x6503('0xd'),_0x51bab9,_0x6503('0xe'));logger['debug'](_0x6503('0xf'),_0x51bab9,'request\x20sent',JSON['stringify'](_0x59c835));if(_0x59c835[_0x6503('0x10')]){if(_0x59c835[_0x6503('0x10')][_0x6503('0x11')]===0x1f4){logger['error'](_0x6503('0xd'),_0x51bab9,_0x59c835[_0x6503('0x10')]['message']);return _0x3db1b4(_0x59c835[_0x6503('0x10')][_0x6503('0x12')]);}logger[_0x6503('0x10')](_0x6503('0xd'),_0x51bab9,_0x59c835[_0x6503('0x10')][_0x6503('0x12')]);return _0x1018eb(_0x59c835[_0x6503('0x10')][_0x6503('0x12')]);}else{logger['info'](_0x6503('0xd'),_0x51bab9,_0x6503('0xe'));_0x1018eb(_0x59c835[_0x6503('0x13')][_0x6503('0x12')]);}})[_0x6503('0x14')](function(_0x2a92a){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x51bab9,_0x2a92a);_0x3db1b4(_0x2a92a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index fe6c7d8..593db79 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 _0x5823=['util','path','connect-timeout','express','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/run','run','query','post','create','put','update','multer'];(function(_0x17d363,_0x180411){var _0x3ea444=function(_0x19fb7a){while(--_0x19fb7a){_0x17d363['push'](_0x17d363['shift']());}};_0x3ea444(++_0x180411);}(_0x5823,0x18e));var _0x3582=function(_0x61ef6c,_0x2c4d43){_0x61ef6c=_0x61ef6c-0x0;var _0x48f75c=_0x5823[_0x61ef6c];return _0x48f75c;};'use strict';var multer=require(_0x3582('0x0'));var util=require(_0x3582('0x1'));var path=require(_0x3582('0x2'));var timeout=require(_0x3582('0x3'));var express=require(_0x3582('0x4'));var router=express['Router']();var fs_extra=require(_0x3582('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3582('0x6'));var controller=require(_0x3582('0x7'));router[_0x3582('0x8')]('/',auth['isAuthenticated'](),controller[_0x3582('0x9')]);router['get'](_0x3582('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3582('0x8')]('/:id/preview',auth[_0x3582('0xb')](),controller['preview']);router[_0x3582('0x8')](_0x3582('0xc'),auth[_0x3582('0xb')](),controller[_0x3582('0xd')]);router['get']('/:id/query',auth[_0x3582('0xb')](),controller[_0x3582('0xe')]);router[_0x3582('0xf')]('/',auth[_0x3582('0xb')](),controller[_0x3582('0x10')]);router[_0x3582('0x11')](_0x3582('0xa'),auth[_0x3582('0xb')](),controller[_0x3582('0x12')]);router['delete'](_0x3582('0xa'),auth[_0x3582('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8c4e=['../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2a0504,_0x5b5bbc){var _0x492f99=function(_0x1cc057){while(--_0x1cc057){_0x2a0504['push'](_0x2a0504['shift']());}};_0x492f99(++_0x5b5bbc);}(_0x8c4e,0x117));var _0xe8c4=function(_0x5726a6,_0x48f53a){_0x5726a6=_0x5726a6-0x0;var _0x437d89=_0x8c4e[_0x5726a6];return _0x437d89;};'use strict';var multer=require(_0xe8c4('0x0'));var util=require(_0xe8c4('0x1'));var path=require('path');var timeout=require(_0xe8c4('0x2'));var express=require(_0xe8c4('0x3'));var router=express[_0xe8c4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe8c4('0x5'));var interaction=require(_0xe8c4('0x6'));var config=require(_0xe8c4('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xe8c4('0x8')]('/',auth[_0xe8c4('0x9')](),controller[_0xe8c4('0xa')]);router[_0xe8c4('0x8')](_0xe8c4('0xb'),auth[_0xe8c4('0x9')](),controller['show']);router[_0xe8c4('0x8')](_0xe8c4('0xc'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0xd')]);router[_0xe8c4('0x8')](_0xe8c4('0xe'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0xf')]);router[_0xe8c4('0x8')](_0xe8c4('0x10'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x11')]);router['post']('/',auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x12')]);router[_0xe8c4('0x13')](_0xe8c4('0xb'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x14')]);router['delete'](_0xe8c4('0xb'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 3f87b3c..44668a8 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 _0x9aaf=['scheduled','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9aaf,0x152));var _0xf9aa=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x9aaf[_0x4bcfa6];return _0x1c0165;};'use strict';var Sequelize=require(_0xf9aa('0x0'));var moment=require('moment');module[_0xf9aa('0x1')]={'name':{'type':Sequelize[_0xf9aa('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf9aa('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf9aa('0x3')](_0xf9aa('0x4'),_0xf9aa('0x5'),_0xf9aa('0x6')),'allowNull':![],'defaultValue':_0xf9aa('0x4')},'savename':{'type':Sequelize[_0xf9aa('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf9aa('0x7')]},'endDate':{'type':Sequelize[_0xf9aa('0x7')]},'status':{'type':Sequelize[_0xf9aa('0x2')],'defaultValue':_0xf9aa('0x8')},'type':{'type':Sequelize['ENUM'](_0xf9aa('0x9'),_0xf9aa('0xa')),'allowNull':![],'defaultValue':_0xf9aa('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xf9aa('0xb')]},'reportType':{'type':Sequelize[_0xf9aa('0x2')]}}; \ No newline at end of file +var _0xf924=['Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','STRING','csv','pdf','xlsx','DATE'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf924,0x1cd));var _0x4f92=function(_0x29e327,_0x2b6ea9){_0x29e327=_0x29e327-0x0;var _0x3dac9e=_0xf924[_0x29e327];return _0x3dac9e;};'use strict';var Sequelize=require(_0x4f92('0x0'));var moment=require(_0x4f92('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4f92('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4f92('0x3'),_0x4f92('0x4'),_0x4f92('0x5')),'allowNull':![],'defaultValue':_0x4f92('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x4f92('0x6')]},'endDate':{'type':Sequelize[_0x4f92('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x4f92('0x7')},'type':{'type':Sequelize[_0x4f92('0x8')](_0x4f92('0x9'),_0x4f92('0xa')),'allowNull':![],'defaultValue':_0x4f92('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x4f92('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c0490f4..6af251d 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 _0x1c10=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','join','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','sendStatus','stack','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes'];(function(_0x4a3af6,_0x13193c){var _0x191578=function(_0x3ad4eb){while(--_0x3ad4eb){_0x4a3af6['push'](_0x4a3af6['shift']());}};_0x191578(++_0x13193c);}(_0x1c10,0x8a));var _0x01c1=function(_0x1a03b7,_0x11b26c){_0x1a03b7=_0x1a03b7-0x0;var _0x234f13=_0x1c10[_0x1a03b7];return _0x234f13;};'use strict';var emlformat=require(_0x01c1('0x0'));var rimraf=require(_0x01c1('0x1'));var zipdir=require(_0x01c1('0x2'));var jsonpatch=require(_0x01c1('0x3'));var rp=require(_0x01c1('0x4'));var moment=require(_0x01c1('0x5'));var BPromise=require(_0x01c1('0x6'));var Mustache=require('mustache');var util=require(_0x01c1('0x7'));var path=require('path');var sox=require(_0x01c1('0x8'));var csv=require(_0x01c1('0x9'));var ejs=require(_0x01c1('0xa'));var fs=require('fs');var fs_extra=require(_0x01c1('0xb'));var _=require('lodash');var squel=require(_0x01c1('0xc'));var crypto=require(_0x01c1('0xd'));var jsforce=require(_0x01c1('0xe'));var deskjs=require(_0x01c1('0xf'));var toCsv=require(_0x01c1('0x9'));var querystring=require(_0x01c1('0x10'));var Papa=require(_0x01c1('0x11'));var Redis=require(_0x01c1('0x12'));var authService=require(_0x01c1('0x13'));var qs=require(_0x01c1('0x14'));var as=require(_0x01c1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01c1('0x16'))(_0x01c1('0x17'));var utils=require(_0x01c1('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01c1('0x19'))['db'];function respondWithStatusCode(_0x331778,_0x58584d){_0x58584d=_0x58584d||0xcc;return function(_0x506b2c){if(_0x506b2c){return _0x331778['sendStatus'](_0x58584d);}return _0x331778[_0x01c1('0x1a')](_0x58584d)[_0x01c1('0x1b')]();};}function respondWithResult(_0x537ec5,_0x35368a){_0x35368a=_0x35368a||0xc8;return function(_0x586d83){if(_0x586d83){return _0x537ec5[_0x01c1('0x1a')](_0x35368a)[_0x01c1('0x1c')](_0x586d83);}};}function respondWithFilteredResult(_0x23927b,_0x633df7){return function(_0x54c5cb){if(_0x54c5cb){var _0x1bef64=typeof _0x633df7[_0x01c1('0x1d')]===_0x01c1('0x1e')&&typeof _0x633df7['limit']===_0x01c1('0x1e');var _0x28ea76=_0x54c5cb[_0x01c1('0x1f')];var _0x4a86b=_0x1bef64?0x0:_0x633df7[_0x01c1('0x1d')];var _0x223ca1=_0x1bef64?_0x54c5cb['count']:_0x633df7[_0x01c1('0x1d')]+_0x633df7[_0x01c1('0x20')];var _0x275fad;if(_0x223ca1>=_0x28ea76){_0x223ca1=_0x28ea76;_0x275fad=0xc8;}else{_0x275fad=0xce;}_0x23927b[_0x01c1('0x1a')](_0x275fad);return _0x23927b[_0x01c1('0x21')](_0x01c1('0x22'),_0x4a86b+'-'+_0x223ca1+'/'+_0x28ea76)[_0x01c1('0x1c')](_0x54c5cb);}return null;};}function patchUpdates(_0xaeed02){return function(_0x535db3){try{jsonpatch[_0x01c1('0x23')](_0x535db3,_0xaeed02,!![]);}catch(_0x21b084){return BPromise[_0x01c1('0x24')](_0x21b084);}return _0x535db3[_0x01c1('0x25')]();};}function saveUpdates(_0x26d5d7,_0x5843c9){return function(_0x16d561){if(_0x16d561){return _0x16d561[_0x01c1('0x26')](_0x26d5d7)[_0x01c1('0x27')](function(_0xb50482){return _0xb50482;});}return null;};}function removeEntity(_0x580484,_0x1e8893){return function(_0x429091){if(_0x429091){return _0x429091[_0x01c1('0x28')]()[_0x01c1('0x27')](function(){var _0x155588=_0x429091[_0x01c1('0x29')]({'plain':!![]});var _0x3b64d2=_0x01c1('0x2a');return db['UserProfileResource'][_0x01c1('0x28')]({'where':{'type':_0x3b64d2,'resourceId':_0x155588['id']}})[_0x01c1('0x27')](function(){return _0x429091;});})['then'](function(){_0x580484[_0x01c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x554d0e,_0x2b0473){return function(_0xda56ae){if(!_0xda56ae){_0x554d0e[_0x01c1('0x2b')](0x194);}return _0xda56ae;};}function handleError(_0x76b4a,_0x4f7d89){_0x4f7d89=_0x4f7d89||0x1f4;return function(_0x1ffe65){logger['error'](_0x1ffe65[_0x01c1('0x2c')]);if(_0x1ffe65['name']){delete _0x1ffe65['name'];}_0x76b4a[_0x01c1('0x1a')](_0x4f7d89)[_0x01c1('0x2d')](_0x1ffe65);};}exports[_0x01c1('0x2e')]=function(_0x22f9d8,_0x16cd8a){var _0x102ff1={},_0x116fbd={},_0x259635={'count':0x0,'rows':[]};var _0x1f02ba=_[_0x01c1('0x2f')](db[_0x01c1('0x30')][_0x01c1('0x31')],function(_0x37592e){return{'name':_0x37592e[_0x01c1('0x32')],'type':_0x37592e[_0x01c1('0x33')][_0x01c1('0x34')]};});_0x116fbd[_0x01c1('0x35')]=_[_0x01c1('0x2f')](_0x1f02ba,_0x01c1('0x36'));_0x116fbd[_0x01c1('0x37')]=_[_0x01c1('0x38')](_0x22f9d8[_0x01c1('0x37')]);_0x116fbd[_0x01c1('0x39')]=_[_0x01c1('0x3a')](_0x116fbd['model'],_0x116fbd[_0x01c1('0x37')]);_0x102ff1[_0x01c1('0x3b')]=_[_0x01c1('0x3a')](_0x116fbd[_0x01c1('0x35')],qs[_0x01c1('0x3c')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x3c')]));_0x102ff1[_0x01c1('0x3b')]=_0x102ff1[_0x01c1('0x3b')][_0x01c1('0x3d')]?_0x102ff1[_0x01c1('0x3b')]:_0x116fbd[_0x01c1('0x35')];if(!_0x22f9d8['query'][_0x01c1('0x3e')](_0x01c1('0x3f'))){_0x102ff1[_0x01c1('0x20')]=qs[_0x01c1('0x20')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x20')]);_0x102ff1['offset']=qs[_0x01c1('0x1d')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x1d')]);}_0x102ff1[_0x01c1('0x40')]=qs[_0x01c1('0x41')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x41')]);_0x102ff1[_0x01c1('0x42')]=qs[_0x01c1('0x39')](_[_0x01c1('0x43')](_0x22f9d8[_0x01c1('0x37')],_0x116fbd[_0x01c1('0x39')]),_0x1f02ba);if(_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x44')]){_0x102ff1['where']=_[_0x01c1('0x45')](_0x102ff1[_0x01c1('0x42')],{'$or':_[_0x01c1('0x2f')](_0x1f02ba,function(_0x558fa2){if(_0x558fa2['type']!=='VIRTUAL'){var _0x3d6d94={};_0x3d6d94[_0x558fa2[_0x01c1('0x36')]]={'$like':'%'+_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x44')]+'%'};return _0x3d6d94;}})});}_0x102ff1=_[_0x01c1('0x45')]({},_0x102ff1,_0x22f9d8[_0x01c1('0x46')]);var _0x2d23f1={'where':_0x102ff1[_0x01c1('0x42')]};return db[_0x01c1('0x30')][_0x01c1('0x1f')](_0x2d23f1)[_0x01c1('0x27')](function(_0x39e08c){_0x259635[_0x01c1('0x1f')]=_0x39e08c;if(_0x22f9d8['query']['includeAll']){_0x102ff1[_0x01c1('0x47')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x01c1('0x48')](_0x102ff1);})[_0x01c1('0x27')](function(_0x1f97f0){_0x259635['rows']=_0x1f97f0;return _0x259635;})[_0x01c1('0x27')](respondWithFilteredResult(_0x16cd8a,_0x102ff1))[_0x01c1('0x49')](handleError(_0x16cd8a,null));};exports[_0x01c1('0x4a')]=function(_0x8aa46,_0xc64cdb){var _0x3be818={'raw':!![],'where':{'id':_0x8aa46[_0x01c1('0x4b')]['id']}},_0x3275ab={};_0x3275ab['model']=_[_0x01c1('0x38')](db[_0x01c1('0x30')][_0x01c1('0x31')]);_0x3275ab[_0x01c1('0x37')]=_[_0x01c1('0x38')](_0x8aa46[_0x01c1('0x37')]);_0x3275ab[_0x01c1('0x39')]=_[_0x01c1('0x3a')](_0x3275ab[_0x01c1('0x35')],_0x3275ab[_0x01c1('0x37')]);_0x3be818[_0x01c1('0x3b')]=_[_0x01c1('0x3a')](_0x3275ab[_0x01c1('0x35')],qs['fields'](_0x8aa46['query'][_0x01c1('0x3c')]));_0x3be818[_0x01c1('0x3b')]=_0x3be818[_0x01c1('0x3b')][_0x01c1('0x3d')]?_0x3be818[_0x01c1('0x3b')]:_0x3275ab[_0x01c1('0x35')];if(_0x8aa46[_0x01c1('0x37')][_0x01c1('0x4c')]){_0x3be818[_0x01c1('0x47')]=[{'all':!![]}];}_0x3be818=_[_0x01c1('0x45')]({},_0x3be818,_0x8aa46[_0x01c1('0x46')]);return db['AnalyticExtractedReport'][_0x01c1('0x4d')](_0x3be818)[_0x01c1('0x27')](handleEntityNotFound(_0xc64cdb,null))['then'](respondWithResult(_0xc64cdb,null))[_0x01c1('0x49')](handleError(_0xc64cdb,null));};exports[_0x01c1('0x4e')]=function(_0x5c067d,_0x4d23fe){return db[_0x01c1('0x30')][_0x01c1('0x4e')](_0x5c067d[_0x01c1('0x4f')],{})[_0x01c1('0x27')](function(_0x51cef1){var _0x2a8c4a=_0x5c067d[_0x01c1('0x50')][_0x01c1('0x29')]({'plain':!![]});if(!_0x2a8c4a)throw new Error(_0x01c1('0x51'));if(_0x2a8c4a['role']==='user'){var _0x1da8c3=_0x51cef1[_0x01c1('0x29')]({'plain':!![]});var _0x288975=_0x01c1('0x2a');return db[_0x01c1('0x52')]['find']({'where':{'name':_0x288975,'userProfileId':_0x2a8c4a[_0x01c1('0x53')]},'raw':!![]})[_0x01c1('0x27')](function(_0x3a81bd){if(_0x3a81bd&&_0x3a81bd[_0x01c1('0x54')]===0x0){return db[_0x01c1('0x55')][_0x01c1('0x4e')]({'name':_0x1da8c3[_0x01c1('0x36')],'resourceId':_0x1da8c3['id'],'type':_0x3a81bd['name'],'sectionId':_0x3a81bd['id']},{})['then'](function(){return _0x51cef1;});}else{return _0x51cef1;}})[_0x01c1('0x49')](function(_0x404047){logger[_0x01c1('0x56')](_0x01c1('0x57'),_0x404047);throw _0x404047;});}return _0x51cef1;})[_0x01c1('0x27')](respondWithResult(_0x4d23fe,0xc9))[_0x01c1('0x49')](handleError(_0x4d23fe,null));};exports[_0x01c1('0x26')]=function(_0x598843,_0x36fedc){if(_0x598843[_0x01c1('0x4f')]['id']){delete _0x598843['body']['id'];}return db[_0x01c1('0x30')][_0x01c1('0x4d')]({'where':{'id':_0x598843['params']['id']}})[_0x01c1('0x27')](handleEntityNotFound(_0x36fedc,null))[_0x01c1('0x27')](saveUpdates(_0x598843[_0x01c1('0x4f')],null))[_0x01c1('0x27')](respondWithResult(_0x36fedc,null))[_0x01c1('0x49')](handleError(_0x36fedc,null));};exports[_0x01c1('0x28')]=function(_0xb7e9db,_0x25f01e){return db[_0x01c1('0x30')]['find']({'where':{'id':_0xb7e9db[_0x01c1('0x4b')]['id']}})[_0x01c1('0x27')](handleEntityNotFound(_0x25f01e,null))[_0x01c1('0x27')](removeEntity(_0x25f01e,null))[_0x01c1('0x49')](handleError(_0x25f01e,null));};exports[_0x01c1('0x58')]=function(_0x3521f5,_0x1be031,_0x50098b){return db[_0x01c1('0x30')]['find']({'where':{'id':_0x3521f5[_0x01c1('0x4b')]['id']},'attributes':[_0x01c1('0x36'),_0x01c1('0x59'),_0x01c1('0x5a'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1be031,null))[_0x01c1('0x27')](function(_0x4b97ff){if(_0x4b97ff){if(!fs['existsSync'](path['join'](config[_0x01c1('0x5b')],'server/files/reports',_0x4b97ff[_0x01c1('0x5a')]))){throw new db[(_0x01c1('0x5c'))]['ValidationError'](_0x01c1('0x5d'));}if(_0x3521f5['query'][_0x01c1('0x5e')]){return _0x1be031[_0x01c1('0x2b')](0xc8);}return _0x1be031[_0x01c1('0x58')](path[_0x01c1('0x5f')](config['root'],'server/files/reports',_0x4b97ff[_0x01c1('0x5a')]),util['format'](_0x01c1('0x60'),_0x4b97ff[_0x01c1('0x59')]||_0x4b97ff['name'],_0x4b97ff[_0x01c1('0x61')][_0x01c1('0x62')]()));}})[_0x01c1('0x49')](handleError(_0x1be031,null));}; \ No newline at end of file +var _0x9fc0=['role','ExtractedReports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','AnalyticExtractedReport','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xde455,_0x1f7ed9){var _0x4822d5=function(_0x363598){while(--_0x363598){_0xde455['push'](_0xde455['shift']());}};_0x4822d5(++_0x1f7ed9);}(_0x9fc0,0x138));var _0x09fc=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0x9fc0[_0xa4928c];return _0x27cc29;};'use strict';var emlformat=require(_0x09fc('0x0'));var rimraf=require(_0x09fc('0x1'));var zipdir=require(_0x09fc('0x2'));var jsonpatch=require(_0x09fc('0x3'));var rp=require(_0x09fc('0x4'));var moment=require(_0x09fc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x09fc('0x6'));var util=require('util');var path=require(_0x09fc('0x7'));var sox=require(_0x09fc('0x8'));var csv=require(_0x09fc('0x9'));var ejs=require(_0x09fc('0xa'));var fs=require('fs');var fs_extra=require(_0x09fc('0xb'));var _=require('lodash');var squel=require(_0x09fc('0xc'));var crypto=require(_0x09fc('0xd'));var jsforce=require(_0x09fc('0xe'));var deskjs=require(_0x09fc('0xf'));var toCsv=require(_0x09fc('0x9'));var querystring=require('querystring');var Papa=require(_0x09fc('0x10'));var Redis=require(_0x09fc('0x11'));var authService=require(_0x09fc('0x12'));var qs=require(_0x09fc('0x13'));var as=require(_0x09fc('0x14'));var hardwareService=require(_0x09fc('0x15'));var logger=require(_0x09fc('0x16'))(_0x09fc('0x17'));var utils=require(_0x09fc('0x18'));var config=require(_0x09fc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x09fc('0x1a'))['db'];function respondWithStatusCode(_0x3f786c,_0x3c8011){_0x3c8011=_0x3c8011||0xcc;return function(_0xcae202){if(_0xcae202){return _0x3f786c[_0x09fc('0x1b')](_0x3c8011);}return _0x3f786c['status'](_0x3c8011)[_0x09fc('0x1c')]();};}function respondWithResult(_0x27bec0,_0x152e6c){_0x152e6c=_0x152e6c||0xc8;return function(_0x29d989){if(_0x29d989){return _0x27bec0[_0x09fc('0x1d')](_0x152e6c)[_0x09fc('0x1e')](_0x29d989);}};}function respondWithFilteredResult(_0xfaeb3a,_0x2f5dc7){return function(_0x255eba){if(_0x255eba){var _0xa18d29=typeof _0x2f5dc7[_0x09fc('0x1f')]==='undefined'&&typeof _0x2f5dc7[_0x09fc('0x20')]===_0x09fc('0x21');var _0x2e1bb0=_0x255eba['count'];var _0x4aec9c=_0xa18d29?0x0:_0x2f5dc7[_0x09fc('0x1f')];var _0x19a19f=_0xa18d29?_0x255eba[_0x09fc('0x22')]:_0x2f5dc7['offset']+_0x2f5dc7[_0x09fc('0x20')];var _0x50688f;if(_0x19a19f>=_0x2e1bb0){_0x19a19f=_0x2e1bb0;_0x50688f=0xc8;}else{_0x50688f=0xce;}_0xfaeb3a['status'](_0x50688f);return _0xfaeb3a[_0x09fc('0x23')](_0x09fc('0x24'),_0x4aec9c+'-'+_0x19a19f+'/'+_0x2e1bb0)[_0x09fc('0x1e')](_0x255eba);}return null;};}function patchUpdates(_0x34b454){return function(_0x55b176){try{jsonpatch[_0x09fc('0x25')](_0x55b176,_0x34b454,!![]);}catch(_0x2aac69){return BPromise[_0x09fc('0x26')](_0x2aac69);}return _0x55b176[_0x09fc('0x27')]();};}function saveUpdates(_0x11f5bd,_0x583df8){return function(_0x1fcc87){if(_0x1fcc87){return _0x1fcc87[_0x09fc('0x28')](_0x11f5bd)[_0x09fc('0x29')](function(_0xd59f29){return _0xd59f29;});}return null;};}function removeEntity(_0x52ed92,_0x2a7822){return function(_0x6549a4){if(_0x6549a4){return _0x6549a4[_0x09fc('0x2a')]()[_0x09fc('0x29')](function(){var _0x315871=_0x6549a4[_0x09fc('0x2b')]({'plain':!![]});var _0x4a0442='ExtractedReports';return db[_0x09fc('0x2c')]['destroy']({'where':{'type':_0x4a0442,'resourceId':_0x315871['id']}})[_0x09fc('0x29')](function(){return _0x6549a4;});})[_0x09fc('0x29')](function(){_0x52ed92[_0x09fc('0x1d')](0xcc)[_0x09fc('0x1c')]();});}};}function handleEntityNotFound(_0x6ff714,_0x414846){return function(_0xac2e28){if(!_0xac2e28){_0x6ff714[_0x09fc('0x1b')](0x194);}return _0xac2e28;};}function handleError(_0xf4b598,_0x3ca042){_0x3ca042=_0x3ca042||0x1f4;return function(_0x3b4d42){logger['error'](_0x3b4d42[_0x09fc('0x2d')]);if(_0x3b4d42['name']){delete _0x3b4d42[_0x09fc('0x2e')];}_0xf4b598[_0x09fc('0x1d')](_0x3ca042)['send'](_0x3b4d42);};}exports[_0x09fc('0x2f')]=function(_0x2c592d,_0x415051){var _0x45e316={},_0x25a388={},_0x203bba={'count':0x0,'rows':[]};var _0x216990=_[_0x09fc('0x30')](db['AnalyticExtractedReport'][_0x09fc('0x31')],function(_0x45543d){return{'name':_0x45543d[_0x09fc('0x32')],'type':_0x45543d[_0x09fc('0x33')][_0x09fc('0x34')]};});_0x25a388[_0x09fc('0x35')]=_['map'](_0x216990,_0x09fc('0x2e'));_0x25a388[_0x09fc('0x36')]=_[_0x09fc('0x37')](_0x2c592d[_0x09fc('0x36')]);_0x25a388[_0x09fc('0x38')]=_[_0x09fc('0x39')](_0x25a388[_0x09fc('0x35')],_0x25a388['query']);_0x45e316[_0x09fc('0x3a')]=_[_0x09fc('0x39')](_0x25a388['model'],qs[_0x09fc('0x3b')](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x3b')]));_0x45e316[_0x09fc('0x3a')]=_0x45e316['attributes'][_0x09fc('0x3c')]?_0x45e316[_0x09fc('0x3a')]:_0x25a388[_0x09fc('0x35')];if(!_0x2c592d[_0x09fc('0x36')]['hasOwnProperty']('nolimit')){_0x45e316[_0x09fc('0x20')]=qs[_0x09fc('0x20')](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x20')]);_0x45e316[_0x09fc('0x1f')]=qs[_0x09fc('0x1f')](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x1f')]);}_0x45e316[_0x09fc('0x3d')]=qs['sort'](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x3e')]);_0x45e316[_0x09fc('0x3f')]=qs[_0x09fc('0x38')](_[_0x09fc('0x40')](_0x2c592d['query'],_0x25a388['filters']),_0x216990);if(_0x2c592d[_0x09fc('0x36')][_0x09fc('0x41')]){_0x45e316[_0x09fc('0x3f')]=_[_0x09fc('0x42')](_0x45e316[_0x09fc('0x3f')],{'$or':_[_0x09fc('0x30')](_0x216990,function(_0x155f67){if(_0x155f67[_0x09fc('0x33')]!=='VIRTUAL'){var _0x5e3ea5={};_0x5e3ea5[_0x155f67[_0x09fc('0x2e')]]={'$like':'%'+_0x2c592d['query'][_0x09fc('0x41')]+'%'};return _0x5e3ea5;}})});}_0x45e316=_[_0x09fc('0x42')]({},_0x45e316,_0x2c592d[_0x09fc('0x43')]);var _0x39219f={'where':_0x45e316[_0x09fc('0x3f')]};return db[_0x09fc('0x44')]['count'](_0x39219f)[_0x09fc('0x29')](function(_0x4b8512){_0x203bba[_0x09fc('0x22')]=_0x4b8512;if(_0x2c592d[_0x09fc('0x36')][_0x09fc('0x45')]){_0x45e316[_0x09fc('0x46')]=[{'all':!![]}];}return db[_0x09fc('0x44')][_0x09fc('0x47')](_0x45e316);})[_0x09fc('0x29')](function(_0x3a76c4){_0x203bba[_0x09fc('0x48')]=_0x3a76c4;return _0x203bba;})['then'](respondWithFilteredResult(_0x415051,_0x45e316))['catch'](handleError(_0x415051,null));};exports[_0x09fc('0x49')]=function(_0x103240,_0x3b2dba){var _0x50712c={'raw':!![],'where':{'id':_0x103240[_0x09fc('0x4a')]['id']}},_0x32cd3e={};_0x32cd3e[_0x09fc('0x35')]=_[_0x09fc('0x37')](db['AnalyticExtractedReport'][_0x09fc('0x31')]);_0x32cd3e[_0x09fc('0x36')]=_['keys'](_0x103240[_0x09fc('0x36')]);_0x32cd3e[_0x09fc('0x38')]=_[_0x09fc('0x39')](_0x32cd3e['model'],_0x32cd3e[_0x09fc('0x36')]);_0x50712c[_0x09fc('0x3a')]=_['intersection'](_0x32cd3e[_0x09fc('0x35')],qs[_0x09fc('0x3b')](_0x103240[_0x09fc('0x36')][_0x09fc('0x3b')]));_0x50712c[_0x09fc('0x3a')]=_0x50712c['attributes'][_0x09fc('0x3c')]?_0x50712c[_0x09fc('0x3a')]:_0x32cd3e['model'];if(_0x103240[_0x09fc('0x36')]['includeAll']){_0x50712c[_0x09fc('0x46')]=[{'all':!![]}];}_0x50712c=_[_0x09fc('0x42')]({},_0x50712c,_0x103240['options']);return db[_0x09fc('0x44')]['find'](_0x50712c)['then'](handleEntityNotFound(_0x3b2dba,null))['then'](respondWithResult(_0x3b2dba,null))[_0x09fc('0x4b')](handleError(_0x3b2dba,null));};exports['create']=function(_0xba7035,_0x54d547){return db[_0x09fc('0x44')][_0x09fc('0x4c')](_0xba7035[_0x09fc('0x4d')],{})[_0x09fc('0x29')](function(_0x1ab60c){var _0x211465=_0xba7035[_0x09fc('0x4e')][_0x09fc('0x2b')]({'plain':!![]});if(!_0x211465)throw new Error(_0x09fc('0x4f'));if(_0x211465[_0x09fc('0x50')]===_0x09fc('0x4e')){var _0x291ef0=_0x1ab60c[_0x09fc('0x2b')]({'plain':!![]});var _0x40f767=_0x09fc('0x51');return db[_0x09fc('0x52')][_0x09fc('0x53')]({'where':{'name':_0x40f767,'userProfileId':_0x211465[_0x09fc('0x54')]},'raw':!![]})[_0x09fc('0x29')](function(_0x4c84a6){if(_0x4c84a6&&_0x4c84a6['autoAssociation']===0x0){return db[_0x09fc('0x2c')][_0x09fc('0x4c')]({'name':_0x291ef0[_0x09fc('0x2e')],'resourceId':_0x291ef0['id'],'type':_0x4c84a6[_0x09fc('0x2e')],'sectionId':_0x4c84a6['id']},{})[_0x09fc('0x29')](function(){return _0x1ab60c;});}else{return _0x1ab60c;}})['catch'](function(_0x320fe1){logger['error'](_0x09fc('0x55'),_0x320fe1);throw _0x320fe1;});}return _0x1ab60c;})[_0x09fc('0x29')](respondWithResult(_0x54d547,0xc9))[_0x09fc('0x4b')](handleError(_0x54d547,null));};exports[_0x09fc('0x28')]=function(_0x5d81f2,_0x2e1732){if(_0x5d81f2[_0x09fc('0x4d')]['id']){delete _0x5d81f2[_0x09fc('0x4d')]['id'];}return db[_0x09fc('0x44')][_0x09fc('0x53')]({'where':{'id':_0x5d81f2['params']['id']}})[_0x09fc('0x29')](handleEntityNotFound(_0x2e1732,null))[_0x09fc('0x29')](saveUpdates(_0x5d81f2[_0x09fc('0x4d')],null))[_0x09fc('0x29')](respondWithResult(_0x2e1732,null))[_0x09fc('0x4b')](handleError(_0x2e1732,null));};exports['destroy']=function(_0x3e59a1,_0x45e6e2){return db[_0x09fc('0x44')][_0x09fc('0x53')]({'where':{'id':_0x3e59a1[_0x09fc('0x4a')]['id']}})[_0x09fc('0x29')](handleEntityNotFound(_0x45e6e2,null))[_0x09fc('0x29')](removeEntity(_0x45e6e2,null))[_0x09fc('0x4b')](handleError(_0x45e6e2,null));};exports[_0x09fc('0x56')]=function(_0x3b16bb,_0x2261fa,_0x4ac7be){return db[_0x09fc('0x44')][_0x09fc('0x53')]({'where':{'id':_0x3b16bb[_0x09fc('0x4a')]['id']},'attributes':[_0x09fc('0x2e'),_0x09fc('0x57'),_0x09fc('0x58'),_0x09fc('0x59')],'raw':!![]})[_0x09fc('0x29')](handleEntityNotFound(_0x2261fa,null))['then'](function(_0x1c0e00){if(_0x1c0e00){if(!fs[_0x09fc('0x5a')](path[_0x09fc('0x5b')](config[_0x09fc('0x5c')],_0x09fc('0x5d'),_0x1c0e00[_0x09fc('0x58')]))){throw new db[(_0x09fc('0x5e'))][(_0x09fc('0x5f'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3b16bb[_0x09fc('0x36')][_0x09fc('0x60')]){return _0x2261fa['sendStatus'](0xc8);}return _0x2261fa[_0x09fc('0x56')](path[_0x09fc('0x5b')](config[_0x09fc('0x5c')],'server/files/reports',_0x1c0e00[_0x09fc('0x58')]),util[_0x09fc('0x61')]('%s.%s',_0x1c0e00[_0x09fc('0x57')]||_0x1c0e00[_0x09fc('0x2e')],_0x1c0e00[_0x09fc('0x59')]['toLowerCase']()));}})[_0x09fc('0x4b')](handleError(_0x2261fa,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7d9e1b3..6d67606 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 _0x3d09=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticExtractedReport','../../config/logger'];(function(_0x3a0390,_0x1ef29b){var _0x2e8eb0=function(_0x2793ef){while(--_0x2793ef){_0x3a0390['push'](_0x3a0390['shift']());}};_0x2e8eb0(++_0x1ef29b);}(_0x3d09,0x1e9));var _0x93d0=function(_0x5ce019,_0x382d56){_0x5ce019=_0x5ce019-0x0;var _0x3babd2=_0x3d09[_0x5ce019];return _0x3babd2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x93d0('0x0'))(_0x93d0('0x1'));var moment=require(_0x93d0('0x2'));var BPromise=require(_0x93d0('0x3'));var rp=require(_0x93d0('0x4'));var fs=require('fs');var path=require(_0x93d0('0x5'));var rimraf=require(_0x93d0('0x6'));var config=require(_0x93d0('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x93d0('0x8')]=function(_0x3c972e,_0x7bc9f5){return _0x3c972e['define'](_0x93d0('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd621=['request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird'];(function(_0x29c505,_0x5a2da4){var _0xee9319=function(_0x38d92a){while(--_0x38d92a){_0x29c505['push'](_0x29c505['shift']());}};_0xee9319(++_0x5a2da4);}(_0xd621,0x1db));var _0x1d62=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0xd621[_0x97db75];return _0x259a53;};'use strict';var _=require('lodash');var util=require(_0x1d62('0x0'));var logger=require(_0x1d62('0x1'))(_0x1d62('0x2'));var moment=require(_0x1d62('0x3'));var BPromise=require(_0x1d62('0x4'));var rp=require(_0x1d62('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d62('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d62('0x7'));module[_0x1d62('0x8')]=function(_0xb10afd,_0x253bce){return _0xb10afd[_0x1d62('0x9')](_0x1d62('0xa'),attributes,{'tableName':_0x1d62('0xb'),'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 1b795d5..0e8bb89 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 _0xff0c=['request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0xff0c,0x142));var _0xcff0=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0xff0c[_0x4a4922];return _0x55a8c6;};'use strict';var _=require(_0xcff0('0x0'));var util=require('util');var moment=require(_0xcff0('0x1'));var BPromise=require('bluebird');var rs=require(_0xcff0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcff0('0x3'))['db'];var utils=require(_0xcff0('0x4'));var logger=require(_0xcff0('0x5'))(_0xcff0('0x6'));var config=require(_0xcff0('0x7'));var jayson=require(_0xcff0('0x8'));var client=jayson[_0xcff0('0x9')][_0xcff0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x398cec,_0x44ae5c,_0x188f8f){return new BPromise(function(_0x1582a4,_0x4fac87){return client[_0xcff0('0xb')](_0x398cec,_0x188f8f)['then'](function(_0x1eadb6){logger[_0xcff0('0xc')](_0xcff0('0xd'),_0x44ae5c,_0xcff0('0xe'));logger['debug'](_0xcff0('0xf'),_0x44ae5c,'request\x20sent',JSON[_0xcff0('0x10')](_0x1eadb6));if(_0x1eadb6[_0xcff0('0x11')]){if(_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x12')]===0x1f4){logger[_0xcff0('0x11')](_0xcff0('0xd'),_0x44ae5c,_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x13')]);return _0x4fac87(_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x13')]);}logger[_0xcff0('0x11')](_0xcff0('0xd'),_0x44ae5c,_0x1eadb6['error'][_0xcff0('0x13')]);return _0x1582a4(_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x13')]);}else{logger[_0xcff0('0xc')](_0xcff0('0xd'),_0x44ae5c,_0xcff0('0xe'));_0x1582a4(_0x1eadb6[_0xcff0('0x14')][_0xcff0('0x13')]);}})['catch'](function(_0x1ab301){logger['error'](_0xcff0('0xd'),_0x44ae5c,_0x1ab301);_0x4fac87(_0x1ab301);});});} \ No newline at end of file +var _0xac02=['request\x20sent','stringify','error','code','message','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0xe0cd41,_0x24fb9b){var _0x1ac3c3=function(_0x29713d){while(--_0x29713d){_0xe0cd41['push'](_0xe0cd41['shift']());}};_0x1ac3c3(++_0x24fb9b);}(_0xac02,0xc3));var _0x2ac0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xac02[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x2ac0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ac0('0x1'));var db=require(_0x2ac0('0x2'))['db'];var utils=require(_0x2ac0('0x3'));var logger=require(_0x2ac0('0x4'))(_0x2ac0('0x5'));var config=require(_0x2ac0('0x6'));var jayson=require(_0x2ac0('0x7'));var client=jayson[_0x2ac0('0x8')][_0x2ac0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ceb94,_0x3d4e33,_0x399cb8){return new BPromise(function(_0x5c7bc3,_0x4e9741){return client[_0x2ac0('0xa')](_0x5ceb94,_0x399cb8)[_0x2ac0('0xb')](function(_0x17fe32){logger[_0x2ac0('0xc')](_0x2ac0('0xd'),_0x3d4e33,'request\x20sent');logger['debug'](_0x2ac0('0xe'),_0x3d4e33,_0x2ac0('0xf'),JSON[_0x2ac0('0x10')](_0x17fe32));if(_0x17fe32[_0x2ac0('0x11')]){if(_0x17fe32['error'][_0x2ac0('0x12')]===0x1f4){logger[_0x2ac0('0x11')](_0x2ac0('0xd'),_0x3d4e33,_0x17fe32['error']['message']);return _0x4e9741(_0x17fe32['error'][_0x2ac0('0x13')]);}logger['error'](_0x2ac0('0xd'),_0x3d4e33,_0x17fe32[_0x2ac0('0x11')]['message']);return _0x5c7bc3(_0x17fe32['error'][_0x2ac0('0x13')]);}else{logger[_0x2ac0('0xc')](_0x2ac0('0xd'),_0x3d4e33,_0x2ac0('0xf'));_0x5c7bc3(_0x17fe32['result'][_0x2ac0('0x13')]);}})[_0x2ac0('0x14')](function(_0x5f32a9){logger[_0x2ac0('0x11')](_0x2ac0('0xd'),_0x3d4e33,_0x5f32a9);_0x4e9741(_0x5f32a9);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 69ceffb..35552ac 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 _0x14cf=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1a365c,_0x4adc59){var _0x30c5ec=function(_0x261c8d){while(--_0x261c8d){_0x1a365c['push'](_0x1a365c['shift']());}};_0x30c5ec(++_0x4adc59);}(_0x14cf,0x19e));var _0xf14c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x14cf[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xf14c('0x0'));var util=require(_0xf14c('0x1'));var path=require(_0xf14c('0x2'));var timeout=require(_0xf14c('0x3'));var express=require(_0xf14c('0x4'));var router=express[_0xf14c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf14c('0x6'));var interaction=require(_0xf14c('0x7'));var config=require(_0xf14c('0x8'));var controller=require(_0xf14c('0x9'));router[_0xf14c('0xa')]('/',auth[_0xf14c('0xb')](),controller[_0xf14c('0xc')]);router[_0xf14c('0xa')](_0xf14c('0xd'),auth[_0xf14c('0xb')](),controller[_0xf14c('0xe')]);router[_0xf14c('0xa')](_0xf14c('0xf'),auth[_0xf14c('0xb')](),controller[_0xf14c('0x10')]);router[_0xf14c('0x11')]('/',auth['isAuthenticated'](),controller[_0xf14c('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf14c('0x13')]);router[_0xf14c('0x14')]('/:id',auth[_0xf14c('0xb')](),controller['destroy']);module[_0xf14c('0x15')]=router; \ No newline at end of file +var _0x89ef=['../../config/environment','isAuthenticated','get','/:id','show','/:id/download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xd5cad8,_0x7ed253){var _0x546feb=function(_0x476e52){while(--_0x476e52){_0xd5cad8['push'](_0xd5cad8['shift']());}};_0x546feb(++_0x7ed253);}(_0x89ef,0x188));var _0xf89e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x89ef[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xf89e('0x0'));var util=require(_0xf89e('0x1'));var path=require(_0xf89e('0x2'));var timeout=require(_0xf89e('0x3'));var express=require(_0xf89e('0x4'));var router=express[_0xf89e('0x5')]();var fs_extra=require(_0xf89e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf89e('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xf89e('0x8')](),controller['index']);router[_0xf89e('0x9')](_0xf89e('0xa'),auth['isAuthenticated'](),controller[_0xf89e('0xb')]);router[_0xf89e('0x9')](_0xf89e('0xc'),auth[_0xf89e('0x8')](),controller['download']);router[_0xf89e('0xd')]('/',auth[_0xf89e('0x8')](),controller[_0xf89e('0xe')]);router['put'](_0xf89e('0xa'),auth[_0xf89e('0x8')](),controller[_0xf89e('0xf')]);router[_0xf89e('0x10')](_0xf89e('0xa'),auth[_0xf89e('0x8')](),controller[_0xf89e('0x11')]);module[_0xf89e('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 f6106a2..8dfe2e7 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 _0x8d5d=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0xa4b8e1,_0x49d30b){var _0x507e42=function(_0xca2abc){while(--_0xca2abc){_0xa4b8e1['push'](_0xa4b8e1['shift']());}};_0x507e42(++_0x49d30b);}(_0x8d5d,0xdf));var _0xd8d5=function(_0x18d08b,_0x59e33d){_0x18d08b=_0x18d08b-0x0;var _0x29e500=_0x8d5d[_0x18d08b];return _0x29e500;};'use strict';var Sequelize=require(_0xd8d5('0x0'));module[_0xd8d5('0x1')]={'field':{'type':Sequelize[_0xd8d5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xd8d5('0x3')]},'format':{'type':Sequelize[_0xd8d5('0x3')]},'groupBy':{'type':Sequelize[_0xd8d5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd8d5('0x3')]},'custom':{'type':Sequelize[_0xd8d5('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe365=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1301a7,_0x3d0baa){var _0x1b5f19=function(_0x20d3cc){while(--_0x20d3cc){_0x1301a7['push'](_0x1301a7['shift']());}};_0x1b5f19(++_0x3d0baa);}(_0xe365,0xdc));var _0x5e36=function(_0x3fb391,_0x539bd5){_0x3fb391=_0x3fb391-0x0;var _0x3dd627=_0xe365[_0x3fb391];return _0x3dd627;};'use strict';var Sequelize=require(_0x5e36('0x0'));module[_0x5e36('0x1')]={'field':{'type':Sequelize[_0x5e36('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x5e36('0x3')]},'format':{'type':Sequelize[_0x5e36('0x3')]},'groupBy':{'type':Sequelize[_0x5e36('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5e36('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index df094c0..7df5d25 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 _0x13ce=['order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','keys','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','AnalyticFieldReport','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x13ce,0x6b));var _0xe13c=function(_0x16a3f9,_0x251ad4){_0x16a3f9=_0x16a3f9-0x0;var _0x231886=_0x13ce[_0x16a3f9];return _0x231886;};'use strict';var emlformat=require(_0xe13c('0x0'));var rimraf=require(_0xe13c('0x1'));var zipdir=require(_0xe13c('0x2'));var jsonpatch=require(_0xe13c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe13c('0x4'));var Mustache=require('mustache');var util=require(_0xe13c('0x5'));var path=require(_0xe13c('0x6'));var sox=require(_0xe13c('0x7'));var csv=require('to-csv');var ejs=require(_0xe13c('0x8'));var fs=require('fs');var fs_extra=require(_0xe13c('0x9'));var _=require('lodash');var squel=require(_0xe13c('0xa'));var crypto=require(_0xe13c('0xb'));var jsforce=require(_0xe13c('0xc'));var deskjs=require(_0xe13c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe13c('0xe'));var Papa=require(_0xe13c('0xf'));var Redis=require('ioredis');var authService=require(_0xe13c('0x10'));var qs=require(_0xe13c('0x11'));var as=require(_0xe13c('0x12'));var hardwareService=require(_0xe13c('0x13'));var logger=require(_0xe13c('0x14'))(_0xe13c('0x15'));var utils=require(_0xe13c('0x16'));var config=require(_0xe13c('0x17'));var licenseUtil=require(_0xe13c('0x18'));var db=require(_0xe13c('0x19'))['db'];function respondWithStatusCode(_0x21e7e1,_0x78325){_0x78325=_0x78325||0xcc;return function(_0x53c8c1){if(_0x53c8c1){return _0x21e7e1[_0xe13c('0x1a')](_0x78325);}return _0x21e7e1['status'](_0x78325)[_0xe13c('0x1b')]();};}function respondWithResult(_0x30309d,_0x13bb07){_0x13bb07=_0x13bb07||0xc8;return function(_0x742a12){if(_0x742a12){return _0x30309d[_0xe13c('0x1c')](_0x13bb07)[_0xe13c('0x1d')](_0x742a12);}};}function respondWithFilteredResult(_0x41e454,_0x594649){return function(_0x31cfaa){if(_0x31cfaa){var _0x5e0c00=typeof _0x594649[_0xe13c('0x1e')]===_0xe13c('0x1f')&&typeof _0x594649[_0xe13c('0x20')]===_0xe13c('0x1f');var _0x54ab9a=_0x31cfaa[_0xe13c('0x21')];var _0x243f5f=_0x5e0c00?0x0:_0x594649[_0xe13c('0x1e')];var _0x4d3105=_0x5e0c00?_0x31cfaa[_0xe13c('0x21')]:_0x594649[_0xe13c('0x1e')]+_0x594649['limit'];var _0x5f05a5;if(_0x4d3105>=_0x54ab9a){_0x4d3105=_0x54ab9a;_0x5f05a5=0xc8;}else{_0x5f05a5=0xce;}_0x41e454[_0xe13c('0x1c')](_0x5f05a5);return _0x41e454[_0xe13c('0x22')](_0xe13c('0x23'),_0x243f5f+'-'+_0x4d3105+'/'+_0x54ab9a)[_0xe13c('0x1d')](_0x31cfaa);}return null;};}function patchUpdates(_0x15b94c){return function(_0x590775){try{jsonpatch[_0xe13c('0x24')](_0x590775,_0x15b94c,!![]);}catch(_0xd66b66){return BPromise[_0xe13c('0x25')](_0xd66b66);}return _0x590775[_0xe13c('0x26')]();};}function saveUpdates(_0x29eff5,_0x942f6c){return function(_0x28a2f0){if(_0x28a2f0){return _0x28a2f0[_0xe13c('0x27')](_0x29eff5)[_0xe13c('0x28')](function(_0x528b35){return _0x528b35;});}return null;};}function removeEntity(_0x4c9bbf,_0x195c16){return function(_0x145c5){if(_0x145c5){return _0x145c5[_0xe13c('0x29')]()['then'](function(){_0x4c9bbf['status'](0xcc)[_0xe13c('0x1b')]();});}};}function handleEntityNotFound(_0x4de4c4,_0x1e6673){return function(_0x4180){if(!_0x4180){_0x4de4c4[_0xe13c('0x1a')](0x194);}return _0x4180;};}function handleError(_0x5dba7f,_0x2b4a55){_0x2b4a55=_0x2b4a55||0x1f4;return function(_0x5d3b77){logger['error'](_0x5d3b77['stack']);if(_0x5d3b77['name']){delete _0x5d3b77[_0xe13c('0x2a')];}_0x5dba7f[_0xe13c('0x1c')](_0x2b4a55)[_0xe13c('0x2b')](_0x5d3b77);};}exports[_0xe13c('0x2c')]=function(_0x36bb10,_0x3ec82f){var _0x3be6ca={},_0x3f1065={},_0x26ff54={'count':0x0,'rows':[]};var _0x1f94cd=_[_0xe13c('0x2d')](db[_0xe13c('0x2e')]['rawAttributes'],function(_0x7c5bf0){return{'name':_0x7c5bf0[_0xe13c('0x2f')],'type':_0x7c5bf0[_0xe13c('0x30')]['key']};});_0x3f1065[_0xe13c('0x31')]=_['map'](_0x1f94cd,_0xe13c('0x2a'));_0x3f1065[_0xe13c('0x32')]=_['keys'](_0x36bb10[_0xe13c('0x32')]);_0x3f1065[_0xe13c('0x33')]=_[_0xe13c('0x34')](_0x3f1065[_0xe13c('0x31')],_0x3f1065[_0xe13c('0x32')]);_0x3be6ca['attributes']=_['intersection'](_0x3f1065[_0xe13c('0x31')],qs['fields'](_0x36bb10['query'][_0xe13c('0x35')]));_0x3be6ca[_0xe13c('0x36')]=_0x3be6ca[_0xe13c('0x36')][_0xe13c('0x37')]?_0x3be6ca[_0xe13c('0x36')]:_0x3f1065['model'];if(!_0x36bb10[_0xe13c('0x32')]['hasOwnProperty'](_0xe13c('0x38'))){_0x3be6ca[_0xe13c('0x20')]=qs['limit'](_0x36bb10['query'][_0xe13c('0x20')]);_0x3be6ca[_0xe13c('0x1e')]=qs['offset'](_0x36bb10['query'][_0xe13c('0x1e')]);}_0x3be6ca[_0xe13c('0x39')]=qs[_0xe13c('0x3a')](_0x36bb10['query'][_0xe13c('0x3a')]);_0x3be6ca['where']=qs[_0xe13c('0x33')](_[_0xe13c('0x3b')](_0x36bb10['query'],_0x3f1065['filters']),_0x1f94cd);if(_0x36bb10[_0xe13c('0x32')]['filter']){_0x3be6ca[_0xe13c('0x3c')]=_[_0xe13c('0x3d')](_0x3be6ca[_0xe13c('0x3c')],{'$or':_['map'](_0x1f94cd,function(_0x5d7663){if(_0x5d7663[_0xe13c('0x30')]!==_0xe13c('0x3e')){var _0x43aef1={};_0x43aef1[_0x5d7663[_0xe13c('0x2a')]]={'$like':'%'+_0x36bb10['query'][_0xe13c('0x3f')]+'%'};return _0x43aef1;}})});}_0x3be6ca=_[_0xe13c('0x3d')]({},_0x3be6ca,_0x36bb10[_0xe13c('0x40')]);var _0x1827fb={'where':_0x3be6ca[_0xe13c('0x3c')]};return db['AnalyticFieldReport'][_0xe13c('0x21')](_0x1827fb)[_0xe13c('0x28')](function(_0x3beada){_0x26ff54[_0xe13c('0x21')]=_0x3beada;if(_0x36bb10[_0xe13c('0x32')][_0xe13c('0x41')]){_0x3be6ca[_0xe13c('0x42')]=[{'all':!![]}];}return db[_0xe13c('0x2e')]['findAll'](_0x3be6ca);})[_0xe13c('0x28')](function(_0x56e52e){_0x26ff54[_0xe13c('0x43')]=_0x56e52e;return _0x26ff54;})[_0xe13c('0x28')](respondWithFilteredResult(_0x3ec82f,_0x3be6ca))[_0xe13c('0x44')](handleError(_0x3ec82f,null));};exports['show']=function(_0x29ba52,_0x1f9209){var _0x152c8a={'raw':![],'where':{'id':_0x29ba52[_0xe13c('0x45')]['id']}},_0x40bc63={};_0x40bc63[_0xe13c('0x31')]=_[_0xe13c('0x46')](db['AnalyticFieldReport']['rawAttributes']);_0x40bc63[_0xe13c('0x32')]=_['keys'](_0x29ba52[_0xe13c('0x32')]);_0x40bc63['filters']=_['intersection'](_0x40bc63[_0xe13c('0x31')],_0x40bc63[_0xe13c('0x32')]);_0x152c8a[_0xe13c('0x36')]=_[_0xe13c('0x34')](_0x40bc63[_0xe13c('0x31')],qs['fields'](_0x29ba52[_0xe13c('0x32')][_0xe13c('0x35')]));_0x152c8a[_0xe13c('0x36')]=_0x152c8a[_0xe13c('0x36')][_0xe13c('0x37')]?_0x152c8a['attributes']:_0x40bc63[_0xe13c('0x31')];if(_0x29ba52[_0xe13c('0x32')][_0xe13c('0x41')]){_0x152c8a[_0xe13c('0x42')]=[{'all':!![]}];}_0x152c8a=_[_0xe13c('0x3d')]({},_0x152c8a,_0x29ba52[_0xe13c('0x40')]);return db[_0xe13c('0x2e')][_0xe13c('0x47')](_0x152c8a)[_0xe13c('0x28')](handleEntityNotFound(_0x1f9209,null))[_0xe13c('0x28')](respondWithResult(_0x1f9209,null))['catch'](handleError(_0x1f9209,null));};exports['create']=function(_0x16cd6e,_0x3866d0){return db[_0xe13c('0x2e')][_0xe13c('0x48')](_0x16cd6e[_0xe13c('0x49')],{})['then'](respondWithResult(_0x3866d0,0xc9))[_0xe13c('0x44')](handleError(_0x3866d0,null));};exports[_0xe13c('0x4a')]=function(_0x8785fe,_0x3b6f1b){return db['AnalyticFieldReport'][_0xe13c('0x4a')](_0x8785fe[_0xe13c('0x49')],{'raw':![],'individualHooks':!![]})[_0xe13c('0x28')](respondWithResult(_0x3b6f1b,0xc9))[_0xe13c('0x44')](handleError(_0x3b6f1b,null));};exports[_0xe13c('0x27')]=function(_0x374e2c,_0x447604){if(_0x374e2c['body']['id']){delete _0x374e2c[_0xe13c('0x49')]['id'];}return db[_0xe13c('0x2e')][_0xe13c('0x47')]({'where':{'id':_0x374e2c[_0xe13c('0x45')]['id']}})[_0xe13c('0x28')](handleEntityNotFound(_0x447604,null))[_0xe13c('0x28')](saveUpdates(_0x374e2c[_0xe13c('0x49')],null))[_0xe13c('0x28')](respondWithResult(_0x447604,null))['catch'](handleError(_0x447604,null));};exports[_0xe13c('0x29')]=function(_0x2c4333,_0xcfe4be){return db['AnalyticFieldReport'][_0xe13c('0x47')]({'where':{'id':_0x2c4333[_0xe13c('0x45')]['id']}})[_0xe13c('0x28')](handleEntityNotFound(_0xcfe4be,null))[_0xe13c('0x28')](removeEntity(_0xcfe4be,null))[_0xe13c('0x44')](handleError(_0xcfe4be,null));};exports[_0xe13c('0x4b')]=function(_0x217412,_0x3b3a5b){return db[_0xe13c('0x2e')][_0xe13c('0x29')]({'where':{'id':_0x217412['query'][_0xe13c('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xe13c('0x28')](respondWithResult(_0x3b3a5b,0xcc))['catch'](handleError(_0x3b3a5b,null));};exports[_0xe13c('0x4d')]=function(_0x12cde3,_0x5c3c28,_0x4a63ea){return db[_0xe13c('0x4e')]['findOne']({'where':{'id':_0x12cde3['params']['id']}})[_0xe13c('0x28')](handleEntityNotFound(_0x5c3c28,null))[_0xe13c('0x28')](function(_0x24c776){if(_0x24c776){return db[_0xe13c('0x4f')]['transaction'](function(_0x1f186a){return db['AnalyticFieldReport'][_0xe13c('0x29')]({'where':{'CustomReportId':_0x12cde3['params']['id']},'transaction':_0x1f186a})[_0xe13c('0x28')](function(_0x1dca77){var _0x1f6190=_[_0xe13c('0x2d')](_0x12cde3['body'],function(_0x1295eb){delete _0x1295eb['id'];_0x1295eb[_0xe13c('0x50')]=_0x12cde3[_0xe13c('0x45')]['id'];return _0x1295eb;});return db[_0xe13c('0x2e')]['bulkCreate'](_0x1f6190,{'transaction':_0x1f186a});});})['then'](function(){return db[_0xe13c('0x2e')][_0xe13c('0x51')]({'where':{'CustomReportId':_0x12cde3[_0xe13c('0x45')]['id']}});});}})[_0xe13c('0x28')](respondWithResult(_0x5c3c28,null))[_0xe13c('0x44')](handleError(_0x5c3c28,null));}; \ No newline at end of file +var _0x3901=['addFields','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','include','options','find','create','body','bulkCreate','params','destroy','bulkDestroy','ids'];(function(_0x4bea2a,_0x1638c5){var _0x152ad2=function(_0x25c627){while(--_0x25c627){_0x4bea2a['push'](_0x4bea2a['shift']());}};_0x152ad2(++_0x1638c5);}(_0x3901,0x181));var _0x1390=function(_0xf7fe97,_0x432968){_0xf7fe97=_0xf7fe97-0x0;var _0x55b1a5=_0x3901[_0xf7fe97];return _0x55b1a5;};'use strict';var emlformat=require(_0x1390('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1390('0x1'));var jsonpatch=require(_0x1390('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1390('0x3'));var Mustache=require(_0x1390('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1390('0x5'));var csv=require(_0x1390('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1390('0x7'));var squel=require(_0x1390('0x8'));var crypto=require(_0x1390('0x9'));var jsforce=require(_0x1390('0xa'));var deskjs=require(_0x1390('0xb'));var toCsv=require(_0x1390('0x6'));var querystring=require(_0x1390('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1390('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1390('0xe'));var hardwareService=require(_0x1390('0xf'));var logger=require('../../config/logger')(_0x1390('0x10'));var utils=require(_0x1390('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1390('0x12'));var db=require(_0x1390('0x13'))['db'];function respondWithStatusCode(_0x1fcc1c,_0x35d00d){_0x35d00d=_0x35d00d||0xcc;return function(_0x2dde8a){if(_0x2dde8a){return _0x1fcc1c['sendStatus'](_0x35d00d);}return _0x1fcc1c[_0x1390('0x14')](_0x35d00d)[_0x1390('0x15')]();};}function respondWithResult(_0x566512,_0x186f57){_0x186f57=_0x186f57||0xc8;return function(_0x1748e3){if(_0x1748e3){return _0x566512[_0x1390('0x14')](_0x186f57)[_0x1390('0x16')](_0x1748e3);}};}function respondWithFilteredResult(_0x219553,_0x194c6d){return function(_0x2543ad){if(_0x2543ad){var _0xe6df2b=typeof _0x194c6d[_0x1390('0x17')]===_0x1390('0x18')&&typeof _0x194c6d[_0x1390('0x19')]===_0x1390('0x18');var _0x252a62=_0x2543ad['count'];var _0x19612e=_0xe6df2b?0x0:_0x194c6d[_0x1390('0x17')];var _0x361b19=_0xe6df2b?_0x2543ad[_0x1390('0x1a')]:_0x194c6d[_0x1390('0x17')]+_0x194c6d['limit'];var _0x4b0078;if(_0x361b19>=_0x252a62){_0x361b19=_0x252a62;_0x4b0078=0xc8;}else{_0x4b0078=0xce;}_0x219553[_0x1390('0x14')](_0x4b0078);return _0x219553['set'](_0x1390('0x1b'),_0x19612e+'-'+_0x361b19+'/'+_0x252a62)[_0x1390('0x16')](_0x2543ad);}return null;};}function patchUpdates(_0x491834){return function(_0x34f5e3){try{jsonpatch[_0x1390('0x1c')](_0x34f5e3,_0x491834,!![]);}catch(_0x5d6b41){return BPromise['reject'](_0x5d6b41);}return _0x34f5e3[_0x1390('0x1d')]();};}function saveUpdates(_0x1b3605,_0x392fb1){return function(_0x2c48cd){if(_0x2c48cd){return _0x2c48cd[_0x1390('0x1e')](_0x1b3605)[_0x1390('0x1f')](function(_0x5f4e4d){return _0x5f4e4d;});}return null;};}function removeEntity(_0x44f8c8,_0x52d794){return function(_0xe647fb){if(_0xe647fb){return _0xe647fb['destroy']()['then'](function(){_0x44f8c8['status'](0xcc)[_0x1390('0x15')]();});}};}function handleEntityNotFound(_0x1d9cff,_0x4e1498){return function(_0x1d26ae){if(!_0x1d26ae){_0x1d9cff['sendStatus'](0x194);}return _0x1d26ae;};}function handleError(_0x3b78cd,_0x7b1146){_0x7b1146=_0x7b1146||0x1f4;return function(_0x1d1a92){logger['error'](_0x1d1a92[_0x1390('0x20')]);if(_0x1d1a92['name']){delete _0x1d1a92[_0x1390('0x21')];}_0x3b78cd[_0x1390('0x14')](_0x7b1146)['send'](_0x1d1a92);};}exports[_0x1390('0x22')]=function(_0x54bc45,_0x488272){var _0x318a39={},_0x4c87de={},_0x1a2701={'count':0x0,'rows':[]};var _0x2b70d2=_['map'](db[_0x1390('0x23')][_0x1390('0x24')],function(_0x512be0){return{'name':_0x512be0[_0x1390('0x25')],'type':_0x512be0['type'][_0x1390('0x26')]};});_0x4c87de['model']=_[_0x1390('0x27')](_0x2b70d2,_0x1390('0x21'));_0x4c87de['query']=_[_0x1390('0x28')](_0x54bc45[_0x1390('0x29')]);_0x4c87de[_0x1390('0x2a')]=_[_0x1390('0x2b')](_0x4c87de[_0x1390('0x2c')],_0x4c87de[_0x1390('0x29')]);_0x318a39[_0x1390('0x2d')]=_[_0x1390('0x2b')](_0x4c87de[_0x1390('0x2c')],qs[_0x1390('0x2e')](_0x54bc45[_0x1390('0x29')][_0x1390('0x2e')]));_0x318a39[_0x1390('0x2d')]=_0x318a39[_0x1390('0x2d')][_0x1390('0x2f')]?_0x318a39[_0x1390('0x2d')]:_0x4c87de[_0x1390('0x2c')];if(!_0x54bc45['query'][_0x1390('0x30')](_0x1390('0x31'))){_0x318a39[_0x1390('0x19')]=qs['limit'](_0x54bc45['query'][_0x1390('0x19')]);_0x318a39[_0x1390('0x17')]=qs['offset'](_0x54bc45[_0x1390('0x29')][_0x1390('0x17')]);}_0x318a39[_0x1390('0x32')]=qs[_0x1390('0x33')](_0x54bc45[_0x1390('0x29')][_0x1390('0x33')]);_0x318a39[_0x1390('0x34')]=qs['filters'](_[_0x1390('0x35')](_0x54bc45[_0x1390('0x29')],_0x4c87de[_0x1390('0x2a')]),_0x2b70d2);if(_0x54bc45['query'][_0x1390('0x36')]){_0x318a39[_0x1390('0x34')]=_[_0x1390('0x37')](_0x318a39[_0x1390('0x34')],{'$or':_[_0x1390('0x27')](_0x2b70d2,function(_0x381681){if(_0x381681[_0x1390('0x38')]!==_0x1390('0x39')){var _0x23f501={};_0x23f501[_0x381681[_0x1390('0x21')]]={'$like':'%'+_0x54bc45[_0x1390('0x29')]['filter']+'%'};return _0x23f501;}})});}_0x318a39=_[_0x1390('0x37')]({},_0x318a39,_0x54bc45['options']);var _0x1e4dfe={'where':_0x318a39[_0x1390('0x34')]};return db[_0x1390('0x23')]['count'](_0x1e4dfe)[_0x1390('0x1f')](function(_0x233bca){_0x1a2701['count']=_0x233bca;if(_0x54bc45[_0x1390('0x29')][_0x1390('0x3a')]){_0x318a39['include']=[{'all':!![]}];}return db[_0x1390('0x23')][_0x1390('0x3b')](_0x318a39);})['then'](function(_0x1d6cba){_0x1a2701['rows']=_0x1d6cba;return _0x1a2701;})['then'](respondWithFilteredResult(_0x488272,_0x318a39))[_0x1390('0x3c')](handleError(_0x488272,null));};exports['show']=function(_0x228a24,_0x471d6d){var _0x76b548={'raw':![],'where':{'id':_0x228a24['params']['id']}},_0xbb0e65={};_0xbb0e65[_0x1390('0x2c')]=_[_0x1390('0x28')](db[_0x1390('0x23')][_0x1390('0x24')]);_0xbb0e65[_0x1390('0x29')]=_[_0x1390('0x28')](_0x228a24[_0x1390('0x29')]);_0xbb0e65[_0x1390('0x2a')]=_[_0x1390('0x2b')](_0xbb0e65[_0x1390('0x2c')],_0xbb0e65[_0x1390('0x29')]);_0x76b548['attributes']=_[_0x1390('0x2b')](_0xbb0e65[_0x1390('0x2c')],qs[_0x1390('0x2e')](_0x228a24[_0x1390('0x29')][_0x1390('0x2e')]));_0x76b548[_0x1390('0x2d')]=_0x76b548[_0x1390('0x2d')][_0x1390('0x2f')]?_0x76b548[_0x1390('0x2d')]:_0xbb0e65[_0x1390('0x2c')];if(_0x228a24[_0x1390('0x29')][_0x1390('0x3a')]){_0x76b548[_0x1390('0x3d')]=[{'all':!![]}];}_0x76b548=_[_0x1390('0x37')]({},_0x76b548,_0x228a24[_0x1390('0x3e')]);return db[_0x1390('0x23')][_0x1390('0x3f')](_0x76b548)['then'](handleEntityNotFound(_0x471d6d,null))[_0x1390('0x1f')](respondWithResult(_0x471d6d,null))[_0x1390('0x3c')](handleError(_0x471d6d,null));};exports[_0x1390('0x40')]=function(_0x38512e,_0x3b3621){return db[_0x1390('0x23')][_0x1390('0x40')](_0x38512e[_0x1390('0x41')],{})[_0x1390('0x1f')](respondWithResult(_0x3b3621,0xc9))[_0x1390('0x3c')](handleError(_0x3b3621,null));};exports['bulkCreate']=function(_0x99b21d,_0x56906f){return db[_0x1390('0x23')][_0x1390('0x42')](_0x99b21d[_0x1390('0x41')],{'raw':![],'individualHooks':!![]})[_0x1390('0x1f')](respondWithResult(_0x56906f,0xc9))[_0x1390('0x3c')](handleError(_0x56906f,null));};exports[_0x1390('0x1e')]=function(_0x1d350a,_0x58f6e8){if(_0x1d350a[_0x1390('0x41')]['id']){delete _0x1d350a['body']['id'];}return db['AnalyticFieldReport'][_0x1390('0x3f')]({'where':{'id':_0x1d350a[_0x1390('0x43')]['id']}})['then'](handleEntityNotFound(_0x58f6e8,null))[_0x1390('0x1f')](saveUpdates(_0x1d350a[_0x1390('0x41')],null))[_0x1390('0x1f')](respondWithResult(_0x58f6e8,null))['catch'](handleError(_0x58f6e8,null));};exports[_0x1390('0x44')]=function(_0x24181c,_0x3ee11b){return db[_0x1390('0x23')]['find']({'where':{'id':_0x24181c[_0x1390('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ee11b,null))['then'](removeEntity(_0x3ee11b,null))['catch'](handleError(_0x3ee11b,null));};exports[_0x1390('0x45')]=function(_0x4ff322,_0x18e707){return db[_0x1390('0x23')][_0x1390('0x44')]({'where':{'id':_0x4ff322[_0x1390('0x29')][_0x1390('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x1390('0x1f')](respondWithResult(_0x18e707,0xcc))['catch'](handleError(_0x18e707,null));};exports[_0x1390('0x47')]=function(_0x257d8e,_0x19c985,_0xe512e4){return db['AnalyticCustomReport'][_0x1390('0x48')]({'where':{'id':_0x257d8e['params']['id']}})[_0x1390('0x1f')](handleEntityNotFound(_0x19c985,null))[_0x1390('0x1f')](function(_0x290b95){if(_0x290b95){return db[_0x1390('0x49')][_0x1390('0x4a')](function(_0x389b2b){return db[_0x1390('0x23')][_0x1390('0x44')]({'where':{'CustomReportId':_0x257d8e[_0x1390('0x43')]['id']},'transaction':_0x389b2b})[_0x1390('0x1f')](function(_0xf9973f){var _0x3ff7a7=_['map'](_0x257d8e[_0x1390('0x41')],function(_0x5cb307){delete _0x5cb307['id'];_0x5cb307[_0x1390('0x4b')]=_0x257d8e[_0x1390('0x43')]['id'];return _0x5cb307;});return db['AnalyticFieldReport'][_0x1390('0x42')](_0x3ff7a7,{'transaction':_0x389b2b});});})[_0x1390('0x1f')](function(){return db['AnalyticFieldReport'][_0x1390('0x3b')]({'where':{'CustomReportId':_0x257d8e['params']['id']}});});}})[_0x1390('0x1f')](respondWithResult(_0x19c985,null))[_0x1390('0x3c')](handleError(_0x19c985,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 0cb5726..2fef210 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 _0x5cd9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0xb68b92,_0x17e742){var _0x2f9b23=function(_0x15c5ab){while(--_0x15c5ab){_0xb68b92['push'](_0xb68b92['shift']());}};_0x2f9b23(++_0x17e742);}(_0x5cd9,0x1d1));var _0x95cd=function(_0x45fabc,_0x2f0df7){_0x45fabc=_0x45fabc-0x0;var _0x3012ac=_0x5cd9[_0x45fabc];return _0x3012ac;};'use strict';var _=require(_0x95cd('0x0'));var util=require(_0x95cd('0x1'));var logger=require(_0x95cd('0x2'))(_0x95cd('0x3'));var moment=require(_0x95cd('0x4'));var BPromise=require(_0x95cd('0x5'));var rp=require(_0x95cd('0x6'));var fs=require('fs');var path=require(_0x95cd('0x7'));var rimraf=require(_0x95cd('0x8'));var config=require(_0x95cd('0x9'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x4f151a,_0x3d3558){return _0x4f151a[_0x95cd('0xa')](_0x95cd('0xb'),attributes,{'tableName':_0x95cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd164=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x3f320c,_0x541b60){var _0x1a49fb=function(_0x471c43){while(--_0x471c43){_0x3f320c['push'](_0x3f320c['shift']());}};_0x1a49fb(++_0x541b60);}(_0xd164,0x198));var _0x4d16=function(_0xbf2500,_0x51c9d6){_0xbf2500=_0xbf2500-0x0;var _0x128f48=_0xd164[_0xbf2500];return _0x128f48;};'use strict';var _=require(_0x4d16('0x0'));var util=require(_0x4d16('0x1'));var logger=require(_0x4d16('0x2'))(_0x4d16('0x3'));var moment=require(_0x4d16('0x4'));var BPromise=require(_0x4d16('0x5'));var rp=require(_0x4d16('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d16('0x7'));var config=require(_0x4d16('0x8'));var attributes=require(_0x4d16('0x9'));module[_0x4d16('0xa')]=function(_0x2fe4fe,_0x4ab6a7){return _0x2fe4fe[_0x4d16('0xb')](_0x4d16('0xc'),attributes,{'tableName':_0x4d16('0xd'),'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 7d0befe..142c3e9 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 _0xf9a2=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xf9a2,0xb6));var _0x2f9a=function(_0x540a76,_0x1a337b){_0x540a76=_0x540a76-0x0;var _0x5b9c4f=_0xf9a2[_0x540a76];return _0x5b9c4f;};'use strict';var _=require('lodash');var util=require(_0x2f9a('0x0'));var moment=require('moment');var BPromise=require(_0x2f9a('0x1'));var rs=require(_0x2f9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f9a('0x3'))['db'];var utils=require(_0x2f9a('0x4'));var logger=require(_0x2f9a('0x5'))(_0x2f9a('0x6'));var config=require(_0x2f9a('0x7'));var jayson=require(_0x2f9a('0x8'));var client=jayson[_0x2f9a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ff7c,_0x3061d9,_0x23fbb0){return new BPromise(function(_0x503f54,_0x21e2a7){return client[_0x2f9a('0xa')](_0x49ff7c,_0x23fbb0)[_0x2f9a('0xb')](function(_0x45e852){logger[_0x2f9a('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3061d9,_0x2f9a('0xd'));logger[_0x2f9a('0xe')](_0x2f9a('0xf'),_0x3061d9,_0x2f9a('0xd'),JSON[_0x2f9a('0x10')](_0x45e852));if(_0x45e852[_0x2f9a('0x11')]){if(_0x45e852[_0x2f9a('0x11')][_0x2f9a('0x12')]===0x1f4){logger[_0x2f9a('0x11')](_0x2f9a('0x13'),_0x3061d9,_0x45e852[_0x2f9a('0x11')][_0x2f9a('0x14')]);return _0x21e2a7(_0x45e852['error'][_0x2f9a('0x14')]);}logger[_0x2f9a('0x11')](_0x2f9a('0x13'),_0x3061d9,_0x45e852['error'][_0x2f9a('0x14')]);return _0x503f54(_0x45e852['error'][_0x2f9a('0x14')]);}else{logger[_0x2f9a('0xc')](_0x2f9a('0x13'),_0x3061d9,'request\x20sent');_0x503f54(_0x45e852[_0x2f9a('0x15')][_0x2f9a('0x14')]);}})[_0x2f9a('0x16')](function(_0x35eff9){logger[_0x2f9a('0x11')](_0x2f9a('0x13'),_0x3061d9,_0x35eff9);_0x21e2a7(_0x35eff9);});});} \ No newline at end of file +var _0x344f=['request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','http'];(function(_0x56a0bb,_0x55fd27){var _0x349f94=function(_0x597edf){while(--_0x597edf){_0x56a0bb['push'](_0x56a0bb['shift']());}};_0x349f94(++_0x55fd27);}(_0x344f,0x14d));var _0xf344=function(_0x552d37,_0x21b0c4){_0x552d37=_0x552d37-0x0;var _0x3a765c=_0x344f[_0x552d37];return _0x3a765c;};'use strict';var _=require(_0xf344('0x0'));var util=require(_0xf344('0x1'));var moment=require(_0xf344('0x2'));var BPromise=require('bluebird');var rs=require(_0xf344('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf344('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf344('0x5'));var config=require('../../config/environment');var jayson=require(_0xf344('0x6'));var client=jayson[_0xf344('0x7')][_0xf344('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x90d3d9,_0x948307,_0x3e6552){return new BPromise(function(_0x4bd9de,_0x30a56f){return client[_0xf344('0x9')](_0x90d3d9,_0x3e6552)['then'](function(_0x139b43){logger['info'](_0xf344('0xa'),_0x948307,_0xf344('0xb'));logger[_0xf344('0xc')](_0xf344('0xd'),_0x948307,'request\x20sent',JSON[_0xf344('0xe')](_0x139b43));if(_0x139b43[_0xf344('0xf')]){if(_0x139b43['error']['code']===0x1f4){logger[_0xf344('0xf')](_0xf344('0xa'),_0x948307,_0x139b43[_0xf344('0xf')]['message']);return _0x30a56f(_0x139b43[_0xf344('0xf')][_0xf344('0x10')]);}logger[_0xf344('0xf')](_0xf344('0xa'),_0x948307,_0x139b43['error']['message']);return _0x4bd9de(_0x139b43[_0xf344('0xf')]['message']);}else{logger['info'](_0xf344('0xa'),_0x948307,'request\x20sent');_0x4bd9de(_0x139b43[_0xf344('0x11')]['message']);}})['catch'](function(_0x240009){logger[_0xf344('0xf')](_0xf344('0xa'),_0x948307,_0x240009);_0x30a56f(_0x240009);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 7b0316a..4635329 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(_0x112cc0,_0x56b670){var _0x47696f=function(_0x3e25a4){while(--_0x3e25a4){_0x112cc0['push'](_0x112cc0['shift']());}};_0x47696f(++_0x56b670);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x5320c1,_0x1f41bd){var _0x451574=function(_0x4cf080){while(--_0x4cf080){_0x5320c1['push'](_0x5320c1['shift']());}};_0x451574(++_0x1f41bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 b191d64..11ec9fd 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 _0x21a3=['name','TEXT','sequelize','STRING'];(function(_0x47bb5a,_0x3121b0){var _0x3e0b51=function(_0x1ee25b){while(--_0x1ee25b){_0x47bb5a['push'](_0x47bb5a['shift']());}};_0x3e0b51(++_0x3121b0);}(_0x21a3,0x66));var _0x321a=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0x21a3[_0x574ce3];return _0x3447a0;};'use strict';var Sequelize=require(_0x321a('0x0'));module['exports']={'name':{'type':Sequelize[_0x321a('0x1')],'allowNull':![],'unique':_0x321a('0x2')},'table':{'type':Sequelize[_0x321a('0x1')]},'metric':{'type':Sequelize[_0x321a('0x3')]},'description':{'type':Sequelize[_0x321a('0x1')]}}; \ No newline at end of file +var _0x49e9=['TEXT','sequelize','exports','name','STRING'];(function(_0x58b6c7,_0x3bf35e){var _0x5f50d0=function(_0x532e10){while(--_0x532e10){_0x58b6c7['push'](_0x58b6c7['shift']());}};_0x5f50d0(++_0x3bf35e);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x949e('0x0'));module[_0x949e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x949e('0x2')},'table':{'type':Sequelize[_0x949e('0x3')]},'metric':{'type':Sequelize[_0x949e('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 ae26a68..abedff2 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 _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x323c59,_0x2fa7f5){var _0x4b2831=function(_0x11c3b3){while(--_0x11c3b3){_0x323c59['push'](_0x323c59['shift']());}};_0x4b2831(++_0x2fa7f5);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x133611,_0x11a138){_0x133611=_0x133611-0x0;var _0x5b2514=_0x9c5a[_0x133611];return _0x5b2514;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file +var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x5ecd2a,_0x81f935){var _0x5c2850=function(_0x15dfed){while(--_0x15dfed){_0x5ecd2a['push'](_0x5ecd2a['shift']());}};_0x5c2850(++_0x81f935);}(_0x00bb,0x1d8));var _0xb00b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x00bb[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index f2707ee..8f474f5 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 _0xc03e=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','api','bluebird','path'];(function(_0x5a5e42,_0x2208b5){var _0x4eac7e=function(_0x3be2ed){while(--_0x3be2ed){_0x5a5e42['push'](_0x5a5e42['shift']());}};_0x4eac7e(++_0x2208b5);}(_0xc03e,0x15a));var _0xec03=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0xc03e[_0x4287b6];return _0x5a4f7e;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xec03('0x1'));var moment=require('moment');var BPromise=require(_0xec03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec03('0x3'));var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1ce78a,_0x31db21){return _0x1ce78a[_0xec03('0x8')](_0xec03('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc838=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4e7544,_0x17891b){var _0x1c20ee=function(_0x2c068b){while(--_0x2c068b){_0x4e7544['push'](_0x4e7544['shift']());}};_0x1c20ee(++_0x17891b);}(_0xc838,0xbd));var _0x8c83=function(_0x2ec1fa,_0x56dbd4){_0x2ec1fa=_0x2ec1fa-0x0;var _0x2bf179=_0xc838[_0x2ec1fa];return _0x2bf179;};'use strict';var _=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var logger=require(_0x8c83('0x2'))(_0x8c83('0x3'));var moment=require(_0x8c83('0x4'));var BPromise=require(_0x8c83('0x5'));var rp=require(_0x8c83('0x6'));var fs=require('fs');var path=require(_0x8c83('0x7'));var rimraf=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var attributes=require(_0x8c83('0xa'));module[_0x8c83('0xb')]=function(_0x115e50,_0x3aab2a){return _0x115e50[_0x8c83('0xc')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 05233bc..e656dd6 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 _0xcea3=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x2d222a,_0x17de56){var _0x57a81c=function(_0x22c34e){while(--_0x22c34e){_0x2d222a['push'](_0x2d222a['shift']());}};_0x57a81c(++_0x17de56);}(_0xcea3,0x98));var _0x3cea=function(_0x2bdb0e,_0x58b18c){_0x2bdb0e=_0x2bdb0e-0x0;var _0x39e9c3=_0xcea3[_0x2bdb0e];return _0x39e9c3;};'use strict';var _=require(_0x3cea('0x0'));var util=require(_0x3cea('0x1'));var moment=require(_0x3cea('0x2'));var BPromise=require(_0x3cea('0x3'));var rs=require(_0x3cea('0x4'));var fs=require('fs');var Redis=require(_0x3cea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cea('0x6'));var logger=require(_0x3cea('0x7'))(_0x3cea('0x8'));var config=require(_0x3cea('0x9'));var jayson=require(_0x3cea('0xa'));var client=jayson[_0x3cea('0xb')][_0x3cea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42cf52,_0x18531b,_0x117997){return new BPromise(function(_0x21d17a,_0x3d603d){return client['request'](_0x42cf52,_0x117997)['then'](function(_0x559c79){logger[_0x3cea('0xd')](_0x3cea('0xe'),_0x18531b,_0x3cea('0xf'));logger['debug'](_0x3cea('0x10'),_0x18531b,'request\x20sent',JSON[_0x3cea('0x11')](_0x559c79));if(_0x559c79['error']){if(_0x559c79[_0x3cea('0x12')][_0x3cea('0x13')]===0x1f4){logger[_0x3cea('0x12')](_0x3cea('0xe'),_0x18531b,_0x559c79[_0x3cea('0x12')][_0x3cea('0x14')]);return _0x3d603d(_0x559c79['error'][_0x3cea('0x14')]);}logger[_0x3cea('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x18531b,_0x559c79[_0x3cea('0x12')]['message']);return _0x21d17a(_0x559c79[_0x3cea('0x12')]['message']);}else{logger[_0x3cea('0xd')](_0x3cea('0xe'),_0x18531b,_0x3cea('0xf'));_0x21d17a(_0x559c79[_0x3cea('0x15')][_0x3cea('0x14')]);}})['catch'](function(_0xa09263){logger[_0x3cea('0x12')](_0x3cea('0xe'),_0x18531b,_0xa09263);_0x3d603d(_0xa09263);});});} \ No newline at end of file +var _0x6cbf=['result','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x12dbfa,_0x39f5c9){var _0x48983a=function(_0x1dcb6c){while(--_0x1dcb6c){_0x12dbfa['push'](_0x12dbfa['shift']());}};_0x48983a(++_0x39f5c9);}(_0x6cbf,0x122));var _0xf6cb=function(_0x1d8f94,_0x57edc0){_0x1d8f94=_0x1d8f94-0x0;var _0x31989c=_0x6cbf[_0x1d8f94];return _0x31989c;};'use strict';var _=require(_0xf6cb('0x0'));var util=require('util');var moment=require(_0xf6cb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6cb('0x2'));var db=require(_0xf6cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6cb('0x4'))(_0xf6cb('0x5'));var config=require(_0xf6cb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf6cb('0x7')][_0xf6cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc5bde1,_0x5ab9e2,_0x39ba5e){return new BPromise(function(_0x27cc2d,_0xb73a29){return client['request'](_0xc5bde1,_0x39ba5e)['then'](function(_0x4ab999){logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,_0xf6cb('0xb'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5ab9e2,_0xf6cb('0xb'),JSON[_0xf6cb('0xc')](_0x4ab999));if(_0x4ab999[_0xf6cb('0xd')]){if(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xe')]===0x1f4){logger['error'](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0xb73a29(_0x4ab999[_0xf6cb('0xd')]['message']);}logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0x27cc2d(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);}else{logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,'request\x20sent');_0x27cc2d(_0x4ab999[_0xf6cb('0x10')]['message']);}})[_0xf6cb('0x11')](function(_0x1f3978){logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x1f3978);_0xb73a29(_0x1f3978);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index b49dcec..f3a4baf 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 _0xd634=['/:id','update','util','path','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xd634,0xf4));var _0x4d63=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xd634[_0x2f87cd];return _0x5d7eda;};'use strict';var multer=require('multer');var util=require(_0x4d63('0x0'));var path=require(_0x4d63('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d63('0x2')]();var fs_extra=require(_0x4d63('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d63('0x4'));var controller=require(_0x4d63('0x5'));router[_0x4d63('0x6')]('/',auth[_0x4d63('0x7')](),controller[_0x4d63('0x8')]);router[_0x4d63('0x6')](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller[_0x4d63('0xa')]);router['delete'](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8efc=['put','destroy','exports','path','express','fs-extra','../../components/auth/service','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0x8d0eab,_0x43accb){var _0x3d343b=function(_0x33e8aa){while(--_0x33e8aa){_0x8d0eab['push'](_0x8d0eab['shift']());}};_0x3d343b(++_0x43accb);}(_0x8efc,0x8f));var _0xc8ef=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x8efc[_0xa3fadc];return _0x23ecb8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc8ef('0x0'));var timeout=require('connect-timeout');var express=require(_0xc8ef('0x1'));var router=express['Router']();var fs_extra=require(_0xc8ef('0x2'));var auth=require(_0xc8ef('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc8ef('0x4'));router['get']('/',auth[_0xc8ef('0x5')](),controller[_0xc8ef('0x6')]);router[_0xc8ef('0x7')](_0xc8ef('0x8'),auth[_0xc8ef('0x5')](),controller['show']);router[_0xc8ef('0x9')]('/',auth['isAuthenticated'](),controller[_0xc8ef('0xa')]);router[_0xc8ef('0xb')](_0xc8ef('0x8'),auth[_0xc8ef('0x5')](),controller['update']);router['delete']('/:id',auth[_0xc8ef('0x5')](),controller[_0xc8ef('0xc')]);module[_0xc8ef('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 146b614..ae670be 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 _0x92f3=['exports','TEXT','sequelize'];(function(_0x4017b4,_0x2cd5b8){var _0x34d43a=function(_0x5527a2){while(--_0x5527a2){_0x4017b4['push'](_0x4017b4['shift']());}};_0x34d43a(++_0x2cd5b8);}(_0x92f3,0xef));var _0x392f=function(_0x2a30da,_0x270871){_0x2a30da=_0x2a30da-0x0;var _0x49e870=_0x92f3[_0x2a30da];return _0x49e870;};'use strict';var Sequelize=require(_0x392f('0x0'));module[_0x392f('0x1')]={'tree':{'type':Sequelize[_0x392f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xcf50=['sequelize','TEXT'];(function(_0x255d05,_0x259f3e){var _0x487a4a=function(_0x4db5ef){while(--_0x4db5ef){_0x255d05['push'](_0x255d05['shift']());}};_0x487a4a(++_0x259f3e);}(_0xcf50,0xfc));var _0x0cf5=function(_0x5ad490,_0xd62e67){_0x5ad490=_0x5ad490-0x0;var _0x171bfb=_0xcf50[_0x5ad490];return _0x171bfb;};'use strict';var Sequelize=require(_0x0cf5('0x0'));module['exports']={'tree':{'type':Sequelize[_0x0cf5('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 34626a7..4c4fbbd 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 _0x1db3=['rawAttributes','type','key','model','query','intersection','fields','attributes','hasOwnProperty','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','AnalyticTreeReport','catch','params','keys','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','save','update','then','sendStatus','error','stack','name','send','index','map'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1db3,0x12b));var _0x31db=function(_0x3f763d,_0x13c788){_0x3f763d=_0x3f763d-0x0;var _0x48e041=_0x1db3[_0x3f763d];return _0x48e041;};'use strict';var emlformat=require(_0x31db('0x0'));var rimraf=require(_0x31db('0x1'));var zipdir=require(_0x31db('0x2'));var jsonpatch=require(_0x31db('0x3'));var rp=require('request-promise');var moment=require(_0x31db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x31db('0x5'));var util=require(_0x31db('0x6'));var path=require('path');var sox=require(_0x31db('0x7'));var csv=require(_0x31db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31db('0x9'));var _=require(_0x31db('0xa'));var squel=require('squel');var crypto=require(_0x31db('0xb'));var jsforce=require(_0x31db('0xc'));var deskjs=require(_0x31db('0xd'));var toCsv=require(_0x31db('0x8'));var querystring=require(_0x31db('0xe'));var Papa=require(_0x31db('0xf'));var Redis=require(_0x31db('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x31db('0x11'));var as=require(_0x31db('0x12'));var hardwareService=require(_0x31db('0x13'));var logger=require('../../config/logger')(_0x31db('0x14'));var utils=require('../../config/utils');var config=require(_0x31db('0x15'));var licenseUtil=require(_0x31db('0x16'));var db=require(_0x31db('0x17'))['db'];function respondWithStatusCode(_0x57f398,_0x11e54a){_0x11e54a=_0x11e54a||0xcc;return function(_0x54d13c){if(_0x54d13c){return _0x57f398['sendStatus'](_0x11e54a);}return _0x57f398[_0x31db('0x18')](_0x11e54a)['end']();};}function respondWithResult(_0x5cbf46,_0x39832f){_0x39832f=_0x39832f||0xc8;return function(_0x5f2ad8){if(_0x5f2ad8){return _0x5cbf46[_0x31db('0x18')](_0x39832f)[_0x31db('0x19')](_0x5f2ad8);}};}function respondWithFilteredResult(_0x27de6a,_0x19ab62){return function(_0x32e973){if(_0x32e973){var _0x2b6739=typeof _0x19ab62['offset']===_0x31db('0x1a')&&typeof _0x19ab62[_0x31db('0x1b')]===_0x31db('0x1a');var _0x3461c0=_0x32e973['count'];var _0x54fdd5=_0x2b6739?0x0:_0x19ab62[_0x31db('0x1c')];var _0x44272f=_0x2b6739?_0x32e973[_0x31db('0x1d')]:_0x19ab62['offset']+_0x19ab62[_0x31db('0x1b')];var _0x32ddac;if(_0x44272f>=_0x3461c0){_0x44272f=_0x3461c0;_0x32ddac=0xc8;}else{_0x32ddac=0xce;}_0x27de6a[_0x31db('0x18')](_0x32ddac);return _0x27de6a[_0x31db('0x1e')]('Content-Range',_0x54fdd5+'-'+_0x44272f+'/'+_0x3461c0)[_0x31db('0x19')](_0x32e973);}return null;};}function patchUpdates(_0x4fd950){return function(_0x55ead7){try{jsonpatch['apply'](_0x55ead7,_0x4fd950,!![]);}catch(_0x1818d6){return BPromise['reject'](_0x1818d6);}return _0x55ead7[_0x31db('0x1f')]();};}function saveUpdates(_0x2bcaa0,_0x2f5ce7){return function(_0xd1113d){if(_0xd1113d){return _0xd1113d[_0x31db('0x20')](_0x2bcaa0)[_0x31db('0x21')](function(_0x290a91){return _0x290a91;});}return null;};}function removeEntity(_0x4d23f,_0x2d8989){return function(_0x18374c){if(_0x18374c){return _0x18374c['destroy']()[_0x31db('0x21')](function(){_0x4d23f[_0x31db('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478d57,_0x2c9eec){return function(_0x174e97){if(!_0x174e97){_0x478d57[_0x31db('0x22')](0x194);}return _0x174e97;};}function handleError(_0x463b47,_0xdcd97){_0xdcd97=_0xdcd97||0x1f4;return function(_0x2ab9d1){logger[_0x31db('0x23')](_0x2ab9d1[_0x31db('0x24')]);if(_0x2ab9d1[_0x31db('0x25')]){delete _0x2ab9d1[_0x31db('0x25')];}_0x463b47['status'](_0xdcd97)[_0x31db('0x26')](_0x2ab9d1);};}exports[_0x31db('0x27')]=function(_0x4ccfd5,_0x24bcc1){var _0x533394={},_0x5ed72a={},_0x195593={'count':0x0,'rows':[]};var _0x49c7f3=_[_0x31db('0x28')](db['AnalyticTreeReport'][_0x31db('0x29')],function(_0x3eef98){return{'name':_0x3eef98['fieldName'],'type':_0x3eef98[_0x31db('0x2a')][_0x31db('0x2b')]};});_0x5ed72a[_0x31db('0x2c')]=_[_0x31db('0x28')](_0x49c7f3,_0x31db('0x25'));_0x5ed72a[_0x31db('0x2d')]=_['keys'](_0x4ccfd5[_0x31db('0x2d')]);_0x5ed72a['filters']=_[_0x31db('0x2e')](_0x5ed72a[_0x31db('0x2c')],_0x5ed72a[_0x31db('0x2d')]);_0x533394['attributes']=_['intersection'](_0x5ed72a[_0x31db('0x2c')],qs[_0x31db('0x2f')](_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x2f')]));_0x533394[_0x31db('0x30')]=_0x533394['attributes']['length']?_0x533394[_0x31db('0x30')]:_0x5ed72a[_0x31db('0x2c')];if(!_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x31')]('nolimit')){_0x533394['limit']=qs[_0x31db('0x1b')](_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x1b')]);_0x533394['offset']=qs[_0x31db('0x1c')](_0x4ccfd5['query'][_0x31db('0x1c')]);}_0x533394['order']=qs[_0x31db('0x32')](_0x4ccfd5['query'][_0x31db('0x32')]);_0x533394[_0x31db('0x33')]=qs[_0x31db('0x34')](_['pick'](_0x4ccfd5['query'],_0x5ed72a[_0x31db('0x34')]),_0x49c7f3);if(_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x35')]){_0x533394[_0x31db('0x33')]=_['merge'](_0x533394[_0x31db('0x33')],{'$or':_[_0x31db('0x28')](_0x49c7f3,function(_0x31f2e0){if(_0x31f2e0[_0x31db('0x2a')]!==_0x31db('0x36')){var _0x3a6a6b={};_0x3a6a6b[_0x31f2e0['name']]={'$like':'%'+_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x35')]+'%'};return _0x3a6a6b;}})});}_0x533394=_[_0x31db('0x37')]({},_0x533394,_0x4ccfd5[_0x31db('0x38')]);var _0x4a064e={'where':_0x533394[_0x31db('0x33')]};return db['AnalyticTreeReport'][_0x31db('0x1d')](_0x4a064e)['then'](function(_0x17b8fc){_0x195593[_0x31db('0x1d')]=_0x17b8fc;if(_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x39')]){_0x533394['include']=[{'all':!![]}];}return db[_0x31db('0x3a')]['findAll'](_0x533394);})[_0x31db('0x21')](function(_0x3c74c6){_0x195593['rows']=_0x3c74c6;return _0x195593;})[_0x31db('0x21')](respondWithFilteredResult(_0x24bcc1,_0x533394))[_0x31db('0x3b')](handleError(_0x24bcc1,null));};exports['show']=function(_0x2d7769,_0x32fabf){var _0x29305f={'raw':!![],'where':{'id':_0x2d7769[_0x31db('0x3c')]['id']}},_0x734e09={};_0x734e09['model']=_[_0x31db('0x3d')](db[_0x31db('0x3a')]['rawAttributes']);_0x734e09[_0x31db('0x2d')]=_[_0x31db('0x3d')](_0x2d7769['query']);_0x734e09[_0x31db('0x34')]=_[_0x31db('0x2e')](_0x734e09['model'],_0x734e09[_0x31db('0x2d')]);_0x29305f[_0x31db('0x30')]=_[_0x31db('0x2e')](_0x734e09['model'],qs[_0x31db('0x2f')](_0x2d7769['query'][_0x31db('0x2f')]));_0x29305f[_0x31db('0x30')]=_0x29305f[_0x31db('0x30')][_0x31db('0x3e')]?_0x29305f[_0x31db('0x30')]:_0x734e09[_0x31db('0x2c')];if(_0x2d7769[_0x31db('0x2d')][_0x31db('0x39')]){_0x29305f[_0x31db('0x3f')]=[{'all':!![]}];}_0x29305f=_[_0x31db('0x37')]({},_0x29305f,_0x2d7769['options']);return db[_0x31db('0x3a')][_0x31db('0x40')](_0x29305f)[_0x31db('0x21')](handleEntityNotFound(_0x32fabf,null))[_0x31db('0x21')](respondWithResult(_0x32fabf,null))[_0x31db('0x3b')](handleError(_0x32fabf,null));};exports[_0x31db('0x41')]=function(_0x123117,_0x11d737){return db[_0x31db('0x3a')][_0x31db('0x41')](_0x123117['body'],{})[_0x31db('0x21')](respondWithResult(_0x11d737,0xc9))['catch'](handleError(_0x11d737,null));};exports[_0x31db('0x20')]=function(_0x26e3b7,_0x5a8e88){if(_0x26e3b7[_0x31db('0x42')]['id']){delete _0x26e3b7['body']['id'];}return db[_0x31db('0x3a')][_0x31db('0x40')]({'where':{'id':_0x26e3b7['params']['id']}})['then'](handleEntityNotFound(_0x5a8e88,null))[_0x31db('0x21')](saveUpdates(_0x26e3b7[_0x31db('0x42')],null))['then'](respondWithResult(_0x5a8e88,null))[_0x31db('0x3b')](handleError(_0x5a8e88,null));};exports[_0x31db('0x43')]=function(_0x45bace,_0x563daa){return db[_0x31db('0x3a')][_0x31db('0x40')]({'where':{'id':_0x45bace[_0x31db('0x3c')]['id']}})[_0x31db('0x21')](handleEntityNotFound(_0x563daa,null))[_0x31db('0x21')](removeEntity(_0x563daa,null))[_0x31db('0x3b')](handleError(_0x563daa,null));}; \ No newline at end of file +var _0x337c=['options','includeAll','include','findAll','rows','catch','params','keys','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','type','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL'];(function(_0x12ff82,_0x4e767a){var _0x49bd51=function(_0x250d99){while(--_0x250d99){_0x12ff82['push'](_0x12ff82['shift']());}};_0x49bd51(++_0x4e767a);}(_0x337c,0x134));var _0xc337=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x337c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc337('0x0'));var rimraf=require(_0xc337('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc337('0x2'));var rp=require(_0xc337('0x3'));var moment=require(_0xc337('0x4'));var BPromise=require(_0xc337('0x5'));var Mustache=require(_0xc337('0x6'));var util=require(_0xc337('0x7'));var path=require(_0xc337('0x8'));var sox=require(_0xc337('0x9'));var csv=require(_0xc337('0xa'));var ejs=require(_0xc337('0xb'));var fs=require('fs');var fs_extra=require(_0xc337('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc337('0xd'));var jsforce=require(_0xc337('0xe'));var deskjs=require(_0xc337('0xf'));var toCsv=require(_0xc337('0xa'));var querystring=require(_0xc337('0x10'));var Papa=require(_0xc337('0x11'));var Redis=require(_0xc337('0x12'));var authService=require(_0xc337('0x13'));var qs=require(_0xc337('0x14'));var as=require(_0xc337('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc337('0x16'))('api');var utils=require(_0xc337('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc337('0x18'))['db'];function respondWithStatusCode(_0x5526f8,_0x39407c){_0x39407c=_0x39407c||0xcc;return function(_0x48a293){if(_0x48a293){return _0x5526f8[_0xc337('0x19')](_0x39407c);}return _0x5526f8['status'](_0x39407c)[_0xc337('0x1a')]();};}function respondWithResult(_0x9f2050,_0x1ee1cd){_0x1ee1cd=_0x1ee1cd||0xc8;return function(_0x4a80fd){if(_0x4a80fd){return _0x9f2050[_0xc337('0x1b')](_0x1ee1cd)[_0xc337('0x1c')](_0x4a80fd);}};}function respondWithFilteredResult(_0x4d4869,_0x579a0c){return function(_0x538e39){if(_0x538e39){var _0x8b41a1=typeof _0x579a0c['offset']===_0xc337('0x1d')&&typeof _0x579a0c[_0xc337('0x1e')]==='undefined';var _0x4ebd6f=_0x538e39[_0xc337('0x1f')];var _0x23437b=_0x8b41a1?0x0:_0x579a0c[_0xc337('0x20')];var _0x39b797=_0x8b41a1?_0x538e39[_0xc337('0x1f')]:_0x579a0c[_0xc337('0x20')]+_0x579a0c['limit'];var _0xbdfd48;if(_0x39b797>=_0x4ebd6f){_0x39b797=_0x4ebd6f;_0xbdfd48=0xc8;}else{_0xbdfd48=0xce;}_0x4d4869[_0xc337('0x1b')](_0xbdfd48);return _0x4d4869[_0xc337('0x21')](_0xc337('0x22'),_0x23437b+'-'+_0x39b797+'/'+_0x4ebd6f)['json'](_0x538e39);}return null;};}function patchUpdates(_0x40074f){return function(_0x46b157){try{jsonpatch[_0xc337('0x23')](_0x46b157,_0x40074f,!![]);}catch(_0x54b144){return BPromise[_0xc337('0x24')](_0x54b144);}return _0x46b157[_0xc337('0x25')]();};}function saveUpdates(_0x29cc5c,_0x5b1dba){return function(_0x2fdfbf){if(_0x2fdfbf){return _0x2fdfbf['update'](_0x29cc5c)[_0xc337('0x26')](function(_0x10b4af){return _0x10b4af;});}return null;};}function removeEntity(_0x7617cd,_0x4da37d){return function(_0x1c7a87){if(_0x1c7a87){return _0x1c7a87[_0xc337('0x27')]()[_0xc337('0x26')](function(){_0x7617cd[_0xc337('0x1b')](0xcc)[_0xc337('0x1a')]();});}};}function handleEntityNotFound(_0x452d7f,_0xb2de92){return function(_0x4c5e21){if(!_0x4c5e21){_0x452d7f[_0xc337('0x19')](0x194);}return _0x4c5e21;};}function handleError(_0x14c1e3,_0x1e9bfe){_0x1e9bfe=_0x1e9bfe||0x1f4;return function(_0x28976c){logger[_0xc337('0x28')](_0x28976c[_0xc337('0x29')]);if(_0x28976c[_0xc337('0x2a')]){delete _0x28976c[_0xc337('0x2a')];}_0x14c1e3[_0xc337('0x1b')](_0x1e9bfe)[_0xc337('0x2b')](_0x28976c);};}exports[_0xc337('0x2c')]=function(_0x2116e9,_0x2a0542){var _0x58efae={},_0x68fcf2={},_0x386eca={'count':0x0,'rows':[]};var _0xc84f7a=_['map'](db[_0xc337('0x2d')]['rawAttributes'],function(_0x306128){return{'name':_0x306128['fieldName'],'type':_0x306128[_0xc337('0x2e')]['key']};});_0x68fcf2['model']=_[_0xc337('0x2f')](_0xc84f7a,'name');_0x68fcf2[_0xc337('0x30')]=_['keys'](_0x2116e9[_0xc337('0x30')]);_0x68fcf2['filters']=_[_0xc337('0x31')](_0x68fcf2[_0xc337('0x32')],_0x68fcf2['query']);_0x58efae['attributes']=_['intersection'](_0x68fcf2[_0xc337('0x32')],qs[_0xc337('0x33')](_0x2116e9[_0xc337('0x30')][_0xc337('0x33')]));_0x58efae[_0xc337('0x34')]=_0x58efae[_0xc337('0x34')][_0xc337('0x35')]?_0x58efae[_0xc337('0x34')]:_0x68fcf2[_0xc337('0x32')];if(!_0x2116e9['query'][_0xc337('0x36')](_0xc337('0x37'))){_0x58efae[_0xc337('0x1e')]=qs[_0xc337('0x1e')](_0x2116e9[_0xc337('0x30')]['limit']);_0x58efae[_0xc337('0x20')]=qs[_0xc337('0x20')](_0x2116e9[_0xc337('0x30')][_0xc337('0x20')]);}_0x58efae['order']=qs['sort'](_0x2116e9[_0xc337('0x30')][_0xc337('0x38')]);_0x58efae[_0xc337('0x39')]=qs[_0xc337('0x3a')](_['pick'](_0x2116e9[_0xc337('0x30')],_0x68fcf2[_0xc337('0x3a')]),_0xc84f7a);if(_0x2116e9[_0xc337('0x30')][_0xc337('0x3b')]){_0x58efae[_0xc337('0x39')]=_[_0xc337('0x3c')](_0x58efae[_0xc337('0x39')],{'$or':_[_0xc337('0x2f')](_0xc84f7a,function(_0x536843){if(_0x536843[_0xc337('0x2e')]!==_0xc337('0x3d')){var _0xf22e3a={};_0xf22e3a[_0x536843[_0xc337('0x2a')]]={'$like':'%'+_0x2116e9[_0xc337('0x30')][_0xc337('0x3b')]+'%'};return _0xf22e3a;}})});}_0x58efae=_[_0xc337('0x3c')]({},_0x58efae,_0x2116e9[_0xc337('0x3e')]);var _0x1ed38b={'where':_0x58efae[_0xc337('0x39')]};return db[_0xc337('0x2d')]['count'](_0x1ed38b)[_0xc337('0x26')](function(_0xd18cea){_0x386eca['count']=_0xd18cea;if(_0x2116e9['query'][_0xc337('0x3f')]){_0x58efae[_0xc337('0x40')]=[{'all':!![]}];}return db[_0xc337('0x2d')][_0xc337('0x41')](_0x58efae);})[_0xc337('0x26')](function(_0x5e7dac){_0x386eca[_0xc337('0x42')]=_0x5e7dac;return _0x386eca;})['then'](respondWithFilteredResult(_0x2a0542,_0x58efae))[_0xc337('0x43')](handleError(_0x2a0542,null));};exports['show']=function(_0x547fa0,_0x1528e4){var _0x4af1b1={'raw':!![],'where':{'id':_0x547fa0[_0xc337('0x44')]['id']}},_0x17c8a1={};_0x17c8a1['model']=_[_0xc337('0x45')](db[_0xc337('0x2d')]['rawAttributes']);_0x17c8a1[_0xc337('0x30')]=_['keys'](_0x547fa0[_0xc337('0x30')]);_0x17c8a1['filters']=_[_0xc337('0x31')](_0x17c8a1[_0xc337('0x32')],_0x17c8a1[_0xc337('0x30')]);_0x4af1b1[_0xc337('0x34')]=_[_0xc337('0x31')](_0x17c8a1[_0xc337('0x32')],qs[_0xc337('0x33')](_0x547fa0['query'][_0xc337('0x33')]));_0x4af1b1['attributes']=_0x4af1b1[_0xc337('0x34')]['length']?_0x4af1b1[_0xc337('0x34')]:_0x17c8a1['model'];if(_0x547fa0[_0xc337('0x30')]['includeAll']){_0x4af1b1[_0xc337('0x40')]=[{'all':!![]}];}_0x4af1b1=_[_0xc337('0x3c')]({},_0x4af1b1,_0x547fa0[_0xc337('0x3e')]);return db[_0xc337('0x2d')]['find'](_0x4af1b1)['then'](handleEntityNotFound(_0x1528e4,null))[_0xc337('0x26')](respondWithResult(_0x1528e4,null))[_0xc337('0x43')](handleError(_0x1528e4,null));};exports[_0xc337('0x46')]=function(_0x389ed0,_0x4f1cec){return db[_0xc337('0x2d')][_0xc337('0x46')](_0x389ed0[_0xc337('0x47')],{})[_0xc337('0x26')](respondWithResult(_0x4f1cec,0xc9))['catch'](handleError(_0x4f1cec,null));};exports[_0xc337('0x48')]=function(_0x4d97b7,_0x5720d1){if(_0x4d97b7[_0xc337('0x47')]['id']){delete _0x4d97b7[_0xc337('0x47')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x4d97b7[_0xc337('0x44')]['id']}})['then'](handleEntityNotFound(_0x5720d1,null))['then'](saveUpdates(_0x4d97b7[_0xc337('0x47')],null))[_0xc337('0x26')](respondWithResult(_0x5720d1,null))['catch'](handleError(_0x5720d1,null));};exports[_0xc337('0x27')]=function(_0x4b073e,_0x17e50d){return db[_0xc337('0x2d')][_0xc337('0x49')]({'where':{'id':_0x4b073e['params']['id']}})[_0xc337('0x26')](handleEntityNotFound(_0x17e50d,null))[_0xc337('0x26')](removeEntity(_0x17e50d,null))[_0xc337('0x43')](handleError(_0x17e50d,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 76a704d..00b7c63 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 _0x2719=['analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x210c86,_0x3b6d61){var _0x2d7e0d=function(_0x3f2991){while(--_0x3f2991){_0x210c86['push'](_0x210c86['shift']());}};_0x2d7e0d(++_0x3b6d61);}(_0x2719,0x90));var _0x9271=function(_0x59d546,_0x107f05){_0x59d546=_0x59d546-0x0;var _0x41fbdb=_0x2719[_0x59d546];return _0x41fbdb;};'use strict';var _=require(_0x9271('0x0'));var util=require('util');var logger=require(_0x9271('0x1'))(_0x9271('0x2'));var moment=require(_0x9271('0x3'));var BPromise=require(_0x9271('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9271('0x5'));var rimraf=require(_0x9271('0x6'));var config=require(_0x9271('0x7'));var attributes=require(_0x9271('0x8'));module[_0x9271('0x9')]=function(_0x1f7322,_0x34fd09){return _0x1f7322[_0x9271('0xa')](_0x9271('0xb'),attributes,{'tableName':_0x9271('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d96=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x3d96,0x1a2));var _0x63d9=function(_0x233be7,_0x3a2f6b){_0x233be7=_0x233be7-0x0;var _0x2cb1f7=_0x3d96[_0x233be7];return _0x2cb1f7;};'use strict';var _=require(_0x63d9('0x0'));var util=require(_0x63d9('0x1'));var logger=require(_0x63d9('0x2'))(_0x63d9('0x3'));var moment=require(_0x63d9('0x4'));var BPromise=require('bluebird');var rp=require(_0x63d9('0x5'));var fs=require('fs');var path=require(_0x63d9('0x6'));var rimraf=require(_0x63d9('0x7'));var config=require(_0x63d9('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x63d9('0x9')]=function(_0x27a7fc,_0x2e8f38){return _0x27a7fc[_0x63d9('0xa')](_0x63d9('0xb'),attributes,{'tableName':_0x63d9('0xc'),'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 347ffd5..5dbec55 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2b9419,_0x355da6){var _0x2e1e6e=function(_0x297ad5){while(--_0x297ad5){_0x2b9419['push'](_0x2b9419['shift']());}};_0x2e1e6e(++_0x355da6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\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(_0x2cabae,_0x1b6883){_0x2cabae=_0x2cabae-0x0;var _0x4cf348=_0x7a54[_0x2cabae];return _0x4cf348;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d97e6a1..3121d56 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 _0x8acb=['put','/:id','delete','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','show','post','isAuthenticated'];(function(_0x1b8738,_0x5ed5c9){var _0x4c4556=function(_0x445018){while(--_0x445018){_0x1b8738['push'](_0x1b8738['shift']());}};_0x4c4556(++_0x5ed5c9);}(_0x8acb,0x1cf));var _0xb8ac=function(_0x2a18aa,_0x2be68d){_0x2a18aa=_0x2a18aa-0x0;var _0x43bdd3=_0x8acb[_0x2a18aa];return _0x43bdd3;};'use strict';var multer=require(_0xb8ac('0x0'));var util=require(_0xb8ac('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb8ac('0x2'));var router=express['Router']();var fs_extra=require(_0xb8ac('0x3'));var auth=require(_0xb8ac('0x4'));var interaction=require(_0xb8ac('0x5'));var config=require(_0xb8ac('0x6'));var controller=require(_0xb8ac('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb8ac('0x8')]);router[_0xb8ac('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb8ac('0xa')]);router[_0xb8ac('0xb')]('/',auth[_0xb8ac('0xc')](),controller['create']);router[_0xb8ac('0xd')](_0xb8ac('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xb8ac('0xf')](_0xb8ac('0xe'),auth[_0xb8ac('0xc')](),controller['destroy']);module[_0xb8ac('0x10')]=router; \ No newline at end of file +var _0x5cf5=['index','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x3a61cf,_0x120f14){var _0x12d6ca=function(_0x32fff6){while(--_0x32fff6){_0x3a61cf['push'](_0x3a61cf['shift']());}};_0x12d6ca(++_0x120f14);}(_0x5cf5,0x1cb));var _0x55cf=function(_0x521e41,_0x34e57f){_0x521e41=_0x521e41-0x0;var _0x25b247=_0x5cf5[_0x521e41];return _0x25b247;};'use strict';var multer=require(_0x55cf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x55cf('0x1'));var express=require(_0x55cf('0x2'));var router=express[_0x55cf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x55cf('0x4'));var interaction=require(_0x55cf('0x5'));var config=require('../../config/environment');var controller=require(_0x55cf('0x6'));router[_0x55cf('0x7')]('/',auth[_0x55cf('0x8')](),controller[_0x55cf('0x9')]);router[_0x55cf('0x7')](_0x55cf('0xa'),auth[_0x55cf('0x8')](),controller[_0x55cf('0xb')]);router[_0x55cf('0xc')]('/',auth[_0x55cf('0x8')](),controller['create']);router[_0x55cf('0xd')](_0x55cf('0xa'),auth['isAuthenticated'](),controller[_0x55cf('0xe')]);router[_0x55cf('0xf')](_0x55cf('0xa'),auth['isAuthenticated'](),controller[_0x55cf('0x10')]);module[_0x55cf('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 85204a9..de9b118 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 _0x83f1=['STRING','sequelize','exports'];(function(_0x1f3786,_0x311f9b){var _0x4e595c=function(_0xd32535){while(--_0xd32535){_0x1f3786['push'](_0x1f3786['shift']());}};_0x4e595c(++_0x311f9b);}(_0x83f1,0x1cc));var _0x183f=function(_0x3ca8ec,_0x409ea0){_0x3ca8ec=_0x3ca8ec-0x0;var _0x3fd1a9=_0x83f1[_0x3ca8ec];return _0x3fd1a9;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'name':{'type':Sequelize[_0x183f('0x2')]},'basename':{'type':Sequelize[_0x183f('0x2')]},'type':{'type':Sequelize[_0x183f('0x2')]}}; \ No newline at end of file +var _0xa98d=['STRING','sequelize'];(function(_0x16d367,_0xc8b7cc){var _0x5e4319=function(_0x23ae99){while(--_0x23ae99){_0x16d367['push'](_0x16d367['shift']());}};_0x5e4319(++_0xc8b7cc);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xda98('0x0'));module['exports']={'name':{'type':Sequelize[_0xda98('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xda98('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b972f0b..e900df4 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 _0x8ad7=['then','destroy','sendStatus','error','stack','name','index','Attachment','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','include','catch','show','rawAttributes','keys','clone','params','includeAll','find','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x3437a4,_0x4e577f){var _0x3dbdd0=function(_0x25f088){while(--_0x25f088){_0x3437a4['push'](_0x3437a4['shift']());}};_0x3dbdd0(++_0x4e577f);}(_0x8ad7,0xe4));var _0x78ad=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x8ad7[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0x78ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78ad('0x1'));var jsonpatch=require(_0x78ad('0x2'));var rp=require(_0x78ad('0x3'));var moment=require(_0x78ad('0x4'));var BPromise=require(_0x78ad('0x5'));var Mustache=require(_0x78ad('0x6'));var util=require(_0x78ad('0x7'));var path=require(_0x78ad('0x8'));var sox=require('sox');var csv=require(_0x78ad('0x9'));var ejs=require(_0x78ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78ad('0xb'));var crypto=require(_0x78ad('0xc'));var jsforce=require(_0x78ad('0xd'));var deskjs=require(_0x78ad('0xe'));var toCsv=require(_0x78ad('0x9'));var querystring=require(_0x78ad('0xf'));var Papa=require('papaparse');var Redis=require(_0x78ad('0x10'));var authService=require(_0x78ad('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ad('0x12'));var logger=require(_0x78ad('0x13'))('api');var utils=require(_0x78ad('0x14'));var config=require(_0x78ad('0x15'));var licenseUtil=require(_0x78ad('0x16'));var db=require(_0x78ad('0x17'))['db'];function respondWithStatusCode(_0x30ff69,_0x4deb08){_0x4deb08=_0x4deb08||0xcc;return function(_0x41a8a9){if(_0x41a8a9){return _0x30ff69['sendStatus'](_0x4deb08);}return _0x30ff69[_0x78ad('0x18')](_0x4deb08)[_0x78ad('0x19')]();};}function respondWithResult(_0x4dda6c,_0x52fd25){_0x52fd25=_0x52fd25||0xc8;return function(_0x5d944e){if(_0x5d944e){return _0x4dda6c[_0x78ad('0x18')](_0x52fd25)[_0x78ad('0x1a')](_0x5d944e);}};}function respondWithFilteredResult(_0x4bbaca,_0xe32b5a){return function(_0x1ac6f2){if(_0x1ac6f2){var _0x389c76=typeof _0xe32b5a[_0x78ad('0x1b')]===_0x78ad('0x1c')&&typeof _0xe32b5a[_0x78ad('0x1d')]===_0x78ad('0x1c');var _0x26056e=_0x1ac6f2[_0x78ad('0x1e')];var _0x165310=_0x389c76?0x0:_0xe32b5a[_0x78ad('0x1b')];var _0x46d739=_0x389c76?_0x1ac6f2[_0x78ad('0x1e')]:_0xe32b5a[_0x78ad('0x1b')]+_0xe32b5a[_0x78ad('0x1d')];var _0x3242f3;if(_0x46d739>=_0x26056e){_0x46d739=_0x26056e;_0x3242f3=0xc8;}else{_0x3242f3=0xce;}_0x4bbaca[_0x78ad('0x18')](_0x3242f3);return _0x4bbaca[_0x78ad('0x1f')](_0x78ad('0x20'),_0x165310+'-'+_0x46d739+'/'+_0x26056e)['json'](_0x1ac6f2);}return null;};}function patchUpdates(_0x4e649b){return function(_0x2aa42a){try{jsonpatch['apply'](_0x2aa42a,_0x4e649b,!![]);}catch(_0x2ff702){return BPromise[_0x78ad('0x21')](_0x2ff702);}return _0x2aa42a[_0x78ad('0x22')]();};}function saveUpdates(_0xf43c22,_0xa599f7){return function(_0x18cdc4){if(_0x18cdc4){return _0x18cdc4[_0x78ad('0x23')](_0xf43c22)[_0x78ad('0x24')](function(_0x2bba73){return _0x2bba73;});}return null;};}function removeEntity(_0x4a08fb,_0x407673){return function(_0x27b371){if(_0x27b371){return _0x27b371[_0x78ad('0x25')]()['then'](function(){_0x4a08fb[_0x78ad('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3244cc,_0x17097e){return function(_0x25c3c0){if(!_0x25c3c0){_0x3244cc[_0x78ad('0x26')](0x194);}return _0x25c3c0;};}function handleError(_0x57eaed,_0x28ce56){_0x28ce56=_0x28ce56||0x1f4;return function(_0x1c6808){logger[_0x78ad('0x27')](_0x1c6808[_0x78ad('0x28')]);if(_0x1c6808[_0x78ad('0x29')]){delete _0x1c6808[_0x78ad('0x29')];}_0x57eaed['status'](_0x28ce56)['send'](_0x1c6808);};}exports[_0x78ad('0x2a')]=function(_0x230d0f,_0x4e76e3){var _0x1c4925={},_0x59cdcd={},_0x2f65e3={'count':0x0,'rows':[]};var _0x5980cd=_['map'](db[_0x78ad('0x2b')]['rawAttributes'],function(_0x5b23aa){return{'name':_0x5b23aa[_0x78ad('0x2c')],'type':_0x5b23aa[_0x78ad('0x2d')][_0x78ad('0x2e')]};});_0x59cdcd[_0x78ad('0x2f')]=_['map'](_0x5980cd,_0x78ad('0x29'));_0x59cdcd[_0x78ad('0x30')]=_['keys'](_0x230d0f[_0x78ad('0x30')]);_0x59cdcd[_0x78ad('0x31')]=_['intersection'](_0x59cdcd[_0x78ad('0x2f')],_0x59cdcd[_0x78ad('0x30')]);_0x1c4925[_0x78ad('0x32')]=_[_0x78ad('0x33')](_0x59cdcd['model'],qs['fields'](_0x230d0f[_0x78ad('0x30')][_0x78ad('0x34')]));_0x1c4925['attributes']=_0x1c4925[_0x78ad('0x32')][_0x78ad('0x35')]?_0x1c4925['attributes']:_0x59cdcd[_0x78ad('0x2f')];if(!_0x230d0f[_0x78ad('0x30')][_0x78ad('0x36')](_0x78ad('0x37'))){_0x1c4925[_0x78ad('0x1d')]=qs['limit'](_0x230d0f[_0x78ad('0x30')]['limit']);_0x1c4925[_0x78ad('0x1b')]=qs['offset'](_0x230d0f[_0x78ad('0x30')][_0x78ad('0x1b')]);}_0x1c4925[_0x78ad('0x38')]=qs[_0x78ad('0x39')](_0x230d0f[_0x78ad('0x30')][_0x78ad('0x39')]);_0x1c4925['where']=qs[_0x78ad('0x31')](_[_0x78ad('0x3a')](_0x230d0f[_0x78ad('0x30')],_0x59cdcd['filters']),_0x5980cd);if(_0x230d0f['query'][_0x78ad('0x3b')]){_0x1c4925['where']=_[_0x78ad('0x3c')](_0x1c4925[_0x78ad('0x3d')],{'$or':_['map'](_0x5980cd,function(_0x28cd42){if(_0x28cd42[_0x78ad('0x2d')]!=='VIRTUAL'){var _0x15078d={};_0x15078d[_0x28cd42['name']]={'$like':'%'+_0x230d0f[_0x78ad('0x30')][_0x78ad('0x3b')]+'%'};return _0x15078d;}})});}_0x1c4925=_[_0x78ad('0x3c')]({},_0x1c4925,_0x230d0f[_0x78ad('0x3e')]);var _0x5c5c1f={'where':_0x1c4925['where']};return db['Attachment'][_0x78ad('0x1e')](_0x5c5c1f)['then'](function(_0x556cce){_0x2f65e3[_0x78ad('0x1e')]=_0x556cce;if(_0x230d0f[_0x78ad('0x30')]['includeAll']){_0x1c4925[_0x78ad('0x3f')]=[{'all':!![]}];}return db[_0x78ad('0x2b')]['findAll'](_0x1c4925);})['then'](function(_0x3ca359){_0x2f65e3['rows']=_0x3ca359;return _0x2f65e3;})['then'](respondWithFilteredResult(_0x4e76e3,_0x1c4925))[_0x78ad('0x40')](handleError(_0x4e76e3,null));};exports[_0x78ad('0x41')]=function(_0x201984,_0x55991a){var _0x41bf07={'raw':!![],'where':{'id':_0x201984['params']['id']}},_0x1b1c9e={};_0x1b1c9e[_0x78ad('0x2f')]=_['keys'](db[_0x78ad('0x2b')][_0x78ad('0x42')]);_0x1b1c9e['query']=_[_0x78ad('0x43')](_0x201984[_0x78ad('0x30')]);_0x1b1c9e['filters']=_[_0x78ad('0x33')](_0x1b1c9e['model'],_0x1b1c9e[_0x78ad('0x30')]);_0x41bf07[_0x78ad('0x32')]=_[_0x78ad('0x33')](_0x1b1c9e['model'],qs[_0x78ad('0x34')](_0x201984[_0x78ad('0x30')][_0x78ad('0x34')]));_0x41bf07[_0x78ad('0x32')]=_0x41bf07[_0x78ad('0x32')][_0x78ad('0x35')]?_0x41bf07[_0x78ad('0x32')]:_0x1b1c9e[_0x78ad('0x2f')];if(_0x201984['query']['includeAll']){_0x41bf07[_0x78ad('0x3f')]=[{'all':!![]}];}_0x41bf07=_[_0x78ad('0x3c')]({},_0x41bf07,_0x201984['options']);return db[_0x78ad('0x2b')]['find'](_0x41bf07)[_0x78ad('0x24')](handleEntityNotFound(_0x55991a,null))['then'](respondWithResult(_0x55991a,null))['catch'](handleError(_0x55991a,null));};exports[_0x78ad('0x44')]=function(_0x4cfe7d,_0x57a935){var _0x52aa41={'where':{'id':_0x4cfe7d[_0x78ad('0x45')]['id']}},_0x4f808b={};_0x4f808b[_0x78ad('0x2f')]=_['keys'](db[_0x78ad('0x2b')]['rawAttributes']);_0x52aa41[_0x78ad('0x32')]=_[_0x78ad('0x33')](_0x4f808b[_0x78ad('0x2f')],qs['fields'](_0x4cfe7d[_0x78ad('0x30')][_0x78ad('0x34')]));_0x52aa41['attributes']=_0x52aa41[_0x78ad('0x32')][_0x78ad('0x35')]?_0x52aa41['attributes']:_0x4f808b[_0x78ad('0x2f')];if(_0x4cfe7d[_0x78ad('0x30')][_0x78ad('0x46')]){_0x52aa41[_0x78ad('0x3f')]=[{'all':!![]}];}_0x52aa41=_[_0x78ad('0x3c')]({},_0x52aa41,_0x4cfe7d['options']);return db[_0x78ad('0x2b')][_0x78ad('0x47')](_0x52aa41)[_0x78ad('0x24')](handleEntityNotFound(_0x57a935,null))[_0x78ad('0x24')](function(_0x4eec4a){if(_0x4eec4a){var _0x148c93=_0x4eec4a[_0x78ad('0x48')]({'plain':!![]});_0x148c93=qs['omit'](_0x148c93,['id',_0x78ad('0x49'),_0x78ad('0x4a')]);_0x4cfe7d[_0x78ad('0x4b')]=_[_0x78ad('0x4c')](_0x4cfe7d[_0x78ad('0x4b')],['id',_0x78ad('0x49'),_0x78ad('0x4a')]);return db[_0x78ad('0x2b')][_0x78ad('0x4d')](_[_0x78ad('0x3c')](_0x148c93,_0x4cfe7d[_0x78ad('0x4b')]),{'include':_0x4cfe7d[_0x78ad('0x30')][_0x78ad('0x46')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x57a935,0xc9))[_0x78ad('0x40')](handleError(_0x57a935,null));};exports['update']=function(_0xd8287a,_0x5e2703){if(_0xd8287a[_0x78ad('0x4b')]['id']){delete _0xd8287a[_0x78ad('0x4b')]['id'];}return db['Attachment']['find']({'where':{'id':_0xd8287a[_0x78ad('0x45')]['id']}})[_0x78ad('0x24')](handleEntityNotFound(_0x5e2703,null))[_0x78ad('0x24')](saveUpdates(_0xd8287a[_0x78ad('0x4b')],null))[_0x78ad('0x24')](respondWithResult(_0x5e2703,null))[_0x78ad('0x40')](handleError(_0x5e2703,null));};exports[_0x78ad('0x25')]=function(_0x111072,_0x1f9f7b){return db[_0x78ad('0x2b')][_0x78ad('0x47')]({'where':{'id':_0x111072[_0x78ad('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f9f7b,null))[_0x78ad('0x24')](removeEntity(_0x1f9f7b,null))['catch'](handleError(_0x1f9f7b,null));};exports['create']=function(_0x452e38,_0x1f212b,_0x22e66e){_0x452e38[_0x78ad('0x4b')]['name']=_0x452e38[_0x78ad('0x4e')][_0x78ad('0x4f')];_0x452e38[_0x78ad('0x4b')][_0x78ad('0x50')]=_0x452e38['file']['filename'];_0x452e38[_0x78ad('0x4b')][_0x78ad('0x2d')]=_0x452e38[_0x78ad('0x4e')][_0x78ad('0x51')];return db['Attachment'][_0x78ad('0x4d')](_0x452e38['body'])['then'](respondWithResult(_0x1f212b,0xc9))[_0x78ad('0x40')](handleError(_0x1f212b,null));};exports[_0x78ad('0x52')]=function(_0x3496f2,_0x25f0c3,_0x2fb2dc){return db[_0x78ad('0x2b')][_0x78ad('0x53')]({'where':{'id':_0x3496f2[_0x78ad('0x45')]['id']},'raw':!![]})[_0x78ad('0x24')](handleEntityNotFound(_0x25f0c3,null))[_0x78ad('0x24')](function(_0x570279){if(_0x570279){var _0x554cf8=_0x570279[_0x78ad('0x54')]!==null;var _0x49921=path[_0x78ad('0x55')](config[_0x78ad('0x56')],_0x78ad('0x57'));if(_0x554cf8){_0x49921=path['join'](_0x49921,'offline-chat/');}var _0x3e51a4=path[_0x78ad('0x55')](_0x49921,_0x570279['basename']);return _0x25f0c3[_0x78ad('0x52')](_0x3e51a4);}})['catch'](handleError(_0x25f0c3,null));}; \ No newline at end of file +var _0x21da=['order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','params','find','clone','createdAt','updatedAt','body','omit','destroy','create','file','originalname','basename','download','findOne','join','server/files/attachments/','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1d236b,_0x1ab689){var _0x4b48c7=function(_0x325b6f){while(--_0x325b6f){_0x1d236b['push'](_0x1d236b['shift']());}};_0x4b48c7(++_0x1ab689);}(_0x21da,0x126));var _0xa21d=function(_0xc03ff6,_0x3461d9){_0xc03ff6=_0xc03ff6-0x0;var _0x977a61=_0x21da[_0xc03ff6];return _0x977a61;};'use strict';var emlformat=require(_0xa21d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa21d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa21d('0x2'));var Mustache=require(_0xa21d('0x3'));var util=require(_0xa21d('0x4'));var path=require(_0xa21d('0x5'));var sox=require(_0xa21d('0x6'));var csv=require(_0xa21d('0x7'));var ejs=require(_0xa21d('0x8'));var fs=require('fs');var fs_extra=require(_0xa21d('0x9'));var _=require('lodash');var squel=require(_0xa21d('0xa'));var crypto=require('crypto');var jsforce=require(_0xa21d('0xb'));var deskjs=require(_0xa21d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa21d('0xd'));var Papa=require(_0xa21d('0xe'));var Redis=require(_0xa21d('0xf'));var authService=require(_0xa21d('0x10'));var qs=require(_0xa21d('0x11'));var as=require(_0xa21d('0x12'));var hardwareService=require(_0xa21d('0x13'));var logger=require(_0xa21d('0x14'))(_0xa21d('0x15'));var utils=require(_0xa21d('0x16'));var config=require(_0xa21d('0x17'));var licenseUtil=require(_0xa21d('0x18'));var db=require(_0xa21d('0x19'))['db'];function respondWithStatusCode(_0x58b319,_0x3df72b){_0x3df72b=_0x3df72b||0xcc;return function(_0x232360){if(_0x232360){return _0x58b319[_0xa21d('0x1a')](_0x3df72b);}return _0x58b319['status'](_0x3df72b)[_0xa21d('0x1b')]();};}function respondWithResult(_0x15d301,_0x1bcd57){_0x1bcd57=_0x1bcd57||0xc8;return function(_0x4b6688){if(_0x4b6688){return _0x15d301['status'](_0x1bcd57)[_0xa21d('0x1c')](_0x4b6688);}};}function respondWithFilteredResult(_0x4c5e44,_0x902c29){return function(_0xa7be47){if(_0xa7be47){var _0x49eeac=typeof _0x902c29[_0xa21d('0x1d')]===_0xa21d('0x1e')&&typeof _0x902c29['limit']===_0xa21d('0x1e');var _0x250f3=_0xa7be47['count'];var _0x5525ad=_0x49eeac?0x0:_0x902c29['offset'];var _0x5963f9=_0x49eeac?_0xa7be47[_0xa21d('0x1f')]:_0x902c29['offset']+_0x902c29[_0xa21d('0x20')];var _0x616491;if(_0x5963f9>=_0x250f3){_0x5963f9=_0x250f3;_0x616491=0xc8;}else{_0x616491=0xce;}_0x4c5e44[_0xa21d('0x21')](_0x616491);return _0x4c5e44[_0xa21d('0x22')](_0xa21d('0x23'),_0x5525ad+'-'+_0x5963f9+'/'+_0x250f3)[_0xa21d('0x1c')](_0xa7be47);}return null;};}function patchUpdates(_0x24f741){return function(_0x21c1b2){try{jsonpatch[_0xa21d('0x24')](_0x21c1b2,_0x24f741,!![]);}catch(_0x44a2c2){return BPromise['reject'](_0x44a2c2);}return _0x21c1b2['save']();};}function saveUpdates(_0x2da71d,_0x318ba9){return function(_0x1cfcb7){if(_0x1cfcb7){return _0x1cfcb7[_0xa21d('0x25')](_0x2da71d)[_0xa21d('0x26')](function(_0x3176a1){return _0x3176a1;});}return null;};}function removeEntity(_0x4b4a53,_0x279eae){return function(_0x392f25){if(_0x392f25){return _0x392f25['destroy']()[_0xa21d('0x26')](function(){_0x4b4a53[_0xa21d('0x21')](0xcc)[_0xa21d('0x1b')]();});}};}function handleEntityNotFound(_0x1c6ee6,_0xa7ddc9){return function(_0x30a02c){if(!_0x30a02c){_0x1c6ee6['sendStatus'](0x194);}return _0x30a02c;};}function handleError(_0x5048d3,_0x46f3d4){_0x46f3d4=_0x46f3d4||0x1f4;return function(_0x516044){logger[_0xa21d('0x27')](_0x516044[_0xa21d('0x28')]);if(_0x516044[_0xa21d('0x29')]){delete _0x516044[_0xa21d('0x29')];}_0x5048d3[_0xa21d('0x21')](_0x46f3d4)[_0xa21d('0x2a')](_0x516044);};}exports['index']=function(_0xa2b7d1,_0x18eb1d){var _0x50a69a={},_0x99a8e={},_0x175677={'count':0x0,'rows':[]};var _0x423dab=_['map'](db['Attachment'][_0xa21d('0x2b')],function(_0x5460a8){return{'name':_0x5460a8[_0xa21d('0x2c')],'type':_0x5460a8[_0xa21d('0x2d')][_0xa21d('0x2e')]};});_0x99a8e[_0xa21d('0x2f')]=_[_0xa21d('0x30')](_0x423dab,_0xa21d('0x29'));_0x99a8e[_0xa21d('0x31')]=_[_0xa21d('0x32')](_0xa2b7d1[_0xa21d('0x31')]);_0x99a8e[_0xa21d('0x33')]=_[_0xa21d('0x34')](_0x99a8e[_0xa21d('0x2f')],_0x99a8e[_0xa21d('0x31')]);_0x50a69a[_0xa21d('0x35')]=_[_0xa21d('0x34')](_0x99a8e[_0xa21d('0x2f')],qs[_0xa21d('0x36')](_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x36')]));_0x50a69a[_0xa21d('0x35')]=_0x50a69a[_0xa21d('0x35')][_0xa21d('0x37')]?_0x50a69a['attributes']:_0x99a8e[_0xa21d('0x2f')];if(!_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x38')](_0xa21d('0x39'))){_0x50a69a[_0xa21d('0x20')]=qs[_0xa21d('0x20')](_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x20')]);_0x50a69a[_0xa21d('0x1d')]=qs[_0xa21d('0x1d')](_0xa2b7d1[_0xa21d('0x31')]['offset']);}_0x50a69a[_0xa21d('0x3a')]=qs[_0xa21d('0x3b')](_0xa2b7d1['query']['sort']);_0x50a69a[_0xa21d('0x3c')]=qs['filters'](_[_0xa21d('0x3d')](_0xa2b7d1[_0xa21d('0x31')],_0x99a8e[_0xa21d('0x33')]),_0x423dab);if(_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x3e')]){_0x50a69a[_0xa21d('0x3c')]=_[_0xa21d('0x3f')](_0x50a69a[_0xa21d('0x3c')],{'$or':_[_0xa21d('0x30')](_0x423dab,function(_0x1945a7){if(_0x1945a7[_0xa21d('0x2d')]!==_0xa21d('0x40')){var _0x2f7a77={};_0x2f7a77[_0x1945a7[_0xa21d('0x29')]]={'$like':'%'+_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x3e')]+'%'};return _0x2f7a77;}})});}_0x50a69a=_[_0xa21d('0x3f')]({},_0x50a69a,_0xa2b7d1[_0xa21d('0x41')]);var _0x331c88={'where':_0x50a69a[_0xa21d('0x3c')]};return db[_0xa21d('0x42')][_0xa21d('0x1f')](_0x331c88)['then'](function(_0x57aa92){_0x175677[_0xa21d('0x1f')]=_0x57aa92;if(_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x43')]){_0x50a69a[_0xa21d('0x44')]=[{'all':!![]}];}return db[_0xa21d('0x42')][_0xa21d('0x45')](_0x50a69a);})[_0xa21d('0x26')](function(_0x10152b){_0x175677[_0xa21d('0x46')]=_0x10152b;return _0x175677;})[_0xa21d('0x26')](respondWithFilteredResult(_0x18eb1d,_0x50a69a))[_0xa21d('0x47')](handleError(_0x18eb1d,null));};exports['show']=function(_0x508ca9,_0x31bb3f){var _0x4138c3={'raw':!![],'where':{'id':_0x508ca9[_0xa21d('0x48')]['id']}},_0x482fa1={};_0x482fa1['model']=_[_0xa21d('0x32')](db[_0xa21d('0x42')][_0xa21d('0x2b')]);_0x482fa1[_0xa21d('0x31')]=_['keys'](_0x508ca9[_0xa21d('0x31')]);_0x482fa1[_0xa21d('0x33')]=_[_0xa21d('0x34')](_0x482fa1[_0xa21d('0x2f')],_0x482fa1[_0xa21d('0x31')]);_0x4138c3['attributes']=_['intersection'](_0x482fa1[_0xa21d('0x2f')],qs['fields'](_0x508ca9[_0xa21d('0x31')][_0xa21d('0x36')]));_0x4138c3[_0xa21d('0x35')]=_0x4138c3[_0xa21d('0x35')]['length']?_0x4138c3[_0xa21d('0x35')]:_0x482fa1['model'];if(_0x508ca9[_0xa21d('0x31')][_0xa21d('0x43')]){_0x4138c3[_0xa21d('0x44')]=[{'all':!![]}];}_0x4138c3=_['merge']({},_0x4138c3,_0x508ca9[_0xa21d('0x41')]);return db[_0xa21d('0x42')][_0xa21d('0x49')](_0x4138c3)[_0xa21d('0x26')](handleEntityNotFound(_0x31bb3f,null))[_0xa21d('0x26')](respondWithResult(_0x31bb3f,null))[_0xa21d('0x47')](handleError(_0x31bb3f,null));};exports[_0xa21d('0x4a')]=function(_0xd5f0d3,_0x16d66f){var _0x13c00c={'where':{'id':_0xd5f0d3[_0xa21d('0x48')]['id']}},_0x3b901e={};_0x3b901e[_0xa21d('0x2f')]=_[_0xa21d('0x32')](db[_0xa21d('0x42')][_0xa21d('0x2b')]);_0x13c00c[_0xa21d('0x35')]=_['intersection'](_0x3b901e[_0xa21d('0x2f')],qs[_0xa21d('0x36')](_0xd5f0d3[_0xa21d('0x31')]['fields']));_0x13c00c['attributes']=_0x13c00c[_0xa21d('0x35')]['length']?_0x13c00c[_0xa21d('0x35')]:_0x3b901e[_0xa21d('0x2f')];if(_0xd5f0d3['query'][_0xa21d('0x43')]){_0x13c00c[_0xa21d('0x44')]=[{'all':!![]}];}_0x13c00c=_[_0xa21d('0x3f')]({},_0x13c00c,_0xd5f0d3[_0xa21d('0x41')]);return db[_0xa21d('0x42')]['find'](_0x13c00c)['then'](handleEntityNotFound(_0x16d66f,null))[_0xa21d('0x26')](function(_0x481b53){if(_0x481b53){var _0x1da99a=_0x481b53['get']({'plain':!![]});_0x1da99a=qs['omit'](_0x1da99a,['id',_0xa21d('0x4b'),_0xa21d('0x4c')]);_0xd5f0d3[_0xa21d('0x4d')]=_[_0xa21d('0x4e')](_0xd5f0d3[_0xa21d('0x4d')],['id',_0xa21d('0x4b'),_0xa21d('0x4c')]);return db[_0xa21d('0x42')]['create'](_['merge'](_0x1da99a,_0xd5f0d3['body']),{'include':_0xd5f0d3['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x16d66f,0xc9))[_0xa21d('0x47')](handleError(_0x16d66f,null));};exports[_0xa21d('0x25')]=function(_0x18a898,_0x51ae4b){if(_0x18a898[_0xa21d('0x4d')]['id']){delete _0x18a898[_0xa21d('0x4d')]['id'];}return db[_0xa21d('0x42')]['find']({'where':{'id':_0x18a898[_0xa21d('0x48')]['id']}})['then'](handleEntityNotFound(_0x51ae4b,null))[_0xa21d('0x26')](saveUpdates(_0x18a898[_0xa21d('0x4d')],null))['then'](respondWithResult(_0x51ae4b,null))['catch'](handleError(_0x51ae4b,null));};exports[_0xa21d('0x4f')]=function(_0x1753e8,_0x1f5318){return db[_0xa21d('0x42')][_0xa21d('0x49')]({'where':{'id':_0x1753e8[_0xa21d('0x48')]['id']}})[_0xa21d('0x26')](handleEntityNotFound(_0x1f5318,null))[_0xa21d('0x26')](removeEntity(_0x1f5318,null))[_0xa21d('0x47')](handleError(_0x1f5318,null));};exports[_0xa21d('0x50')]=function(_0xb5a5c5,_0x441fce,_0x4190af){_0xb5a5c5['body']['name']=_0xb5a5c5[_0xa21d('0x51')][_0xa21d('0x52')];_0xb5a5c5[_0xa21d('0x4d')][_0xa21d('0x53')]=_0xb5a5c5['file']['filename'];_0xb5a5c5['body'][_0xa21d('0x2d')]=_0xb5a5c5[_0xa21d('0x51')]['mimetype'];return db[_0xa21d('0x42')][_0xa21d('0x50')](_0xb5a5c5[_0xa21d('0x4d')])['then'](respondWithResult(_0x441fce,0xc9))['catch'](handleError(_0x441fce,null));};exports[_0xa21d('0x54')]=function(_0x12148e,_0x378f36,_0x4abdf9){return db['Attachment'][_0xa21d('0x55')]({'where':{'id':_0x12148e[_0xa21d('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x378f36,null))['then'](function(_0x217f86){if(_0x217f86){var _0x506021=_0x217f86['ChatOfflineMessageId']!==null;var _0x5d2612=path[_0xa21d('0x56')](config['root'],_0xa21d('0x57'));if(_0x506021){_0x5d2612=path['join'](_0x5d2612,'offline-chat/');}var _0x16f652=path[_0xa21d('0x56')](_0x5d2612,_0x217f86[_0xa21d('0x53')]);return _0x378f36[_0xa21d('0x54')](_0x16f652);}})[_0xa21d('0x47')](handleError(_0x378f36,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e52eed7..dc661ac 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 _0x1068=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4754df,_0x505290){var _0x2d61c0=function(_0x1b280f){while(--_0x1b280f){_0x4754df['push'](_0x4754df['shift']());}};_0x2d61c0(++_0x505290);}(_0x1068,0x14c));var _0x8106=function(_0x41b397,_0x53a516){_0x41b397=_0x41b397-0x0;var _0x2f7be6=_0x1068[_0x41b397];return _0x2f7be6;};'use strict';var _=require(_0x8106('0x0'));var util=require(_0x8106('0x1'));var logger=require(_0x8106('0x2'))(_0x8106('0x3'));var moment=require('moment');var BPromise=require(_0x8106('0x4'));var rp=require(_0x8106('0x5'));var fs=require('fs');var path=require(_0x8106('0x6'));var rimraf=require('rimraf');var config=require(_0x8106('0x7'));var attributes=require(_0x8106('0x8'));module[_0x8106('0x9')]=function(_0x1fdb72,_0x21399f){return _0x1fdb72[_0x8106('0xa')](_0x8106('0xb'),attributes,{'tableName':_0x8106('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0349=['path','../../config/environment','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x37fa0e,_0x542ac5){var _0x21eb37=function(_0x54fe7f){while(--_0x54fe7f){_0x37fa0e['push'](_0x37fa0e['shift']());}};_0x21eb37(++_0x542ac5);}(_0x0349,0x1c7));var _0x9034=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x0349[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x9034('0x0'));var util=require(_0x9034('0x1'));var logger=require(_0x9034('0x2'))(_0x9034('0x3'));var moment=require(_0x9034('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9034('0x5'));var rimraf=require('rimraf');var config=require(_0x9034('0x6'));var attributes=require('./attachment.attributes');module['exports']=function(_0x5ed773,_0x38596c){return _0x5ed773[_0x9034('0x7')](_0x9034('0x8'),attributes,{'tableName':_0x9034('0x9'),'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 bc0f925..ca3e07e 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 _0xe3ee=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','body','options','raw','CreateAttachment','debug','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','then','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x2b5ef6,_0x47f0f1){var _0x3419aa=function(_0x228e96){while(--_0x228e96){_0x2b5ef6['push'](_0x2b5ef6['shift']());}};_0x3419aa(++_0x47f0f1);}(_0xe3ee,0x116));var _0xee3e=function(_0x5f281f,_0x856880){_0x5f281f=_0x5f281f-0x0;var _0xc2f03f=_0xe3ee[_0x5f281f];return _0xc2f03f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee3e('0x0'));var BPromise=require(_0xee3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee3e('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee3e('0x3'));var config=require('../../config/environment');var jayson=require(_0xee3e('0x4'));var client=jayson[_0xee3e('0x5')][_0xee3e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xd893ca,_0x42d135,_0x39a770){return new BPromise(function(_0x43ab67,_0x17fba1){return client['request'](_0xd893ca,_0x39a770)[_0xee3e('0x7')](function(_0x2f6153){logger['info'](_0xee3e('0x8'),_0x42d135,_0xee3e('0x9'));logger['debug'](_0xee3e('0xa'),_0x42d135,_0xee3e('0x9'),JSON[_0xee3e('0xb')](_0x2f6153));if(_0x2f6153[_0xee3e('0xc')]){if(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xd')]===0x1f4){logger[_0xee3e('0xc')](_0xee3e('0x8'),_0x42d135,_0x2f6153['error']['message']);return _0x17fba1(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);}logger['error'](_0xee3e('0x8'),_0x42d135,_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);return _0x43ab67(_0x2f6153['error'][_0xee3e('0xe')]);}else{logger[_0xee3e('0xf')]('Attachment,\x20%s,\x20%s',_0x42d135,'request\x20sent');_0x43ab67(_0x2f6153[_0xee3e('0x10')][_0xee3e('0xe')]);}})[_0xee3e('0x11')](function(_0x512609){logger['error']('Attachment,\x20%s,\x20%s',_0x42d135,_0x512609);_0x17fba1(_0x512609);});});}exports['CreateAttachment']=function(_0x2589c0){var _0x23cd1f=this;return new Promise(function(_0x372605,_0x253530){return db[_0xee3e('0x12')]['create'](_0x2589c0[_0xee3e('0x13')],{'raw':_0x2589c0[_0xee3e('0x14')]?_0x2589c0[_0xee3e('0x14')][_0xee3e('0x15')]===undefined?!![]:![]:!![]})[_0xee3e('0x7')](function(_0x3b6d40){logger['info'](_0xee3e('0x16'),_0x2589c0);logger[_0xee3e('0x17')](_0xee3e('0x16'),_0x2589c0,JSON[_0xee3e('0xb')](_0x3b6d40));_0x372605(_0x3b6d40);})[_0xee3e('0x11')](function(_0xfbf279){logger[_0xee3e('0xc')](_0xee3e('0x16'),_0xfbf279[_0xee3e('0xe')],_0x2589c0);_0x253530(_0x23cd1f[_0xee3e('0xc')](0x1f4,_0xfbf279['message']));});});}; \ No newline at end of file +var _0x78f0=['client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','body','options','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x248be5,_0x499d9c){var _0x4be9aa=function(_0x467c2f){while(--_0x467c2f){_0x248be5['push'](_0x248be5['shift']());}};_0x4be9aa(++_0x499d9c);}(_0x78f0,0x15d));var _0x078f=function(_0x210cae,_0x3607a0){_0x210cae=_0x210cae-0x0;var _0xe9f760=_0x78f0[_0x210cae];return _0xe9f760;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var moment=require(_0x078f('0x2'));var BPromise=require(_0x078f('0x3'));var rs=require(_0x078f('0x4'));var fs=require('fs');var Redis=require(_0x078f('0x5'));var db=require(_0x078f('0x6'))['db'];var utils=require(_0x078f('0x7'));var logger=require('../../config/logger')(_0x078f('0x8'));var config=require(_0x078f('0x9'));var jayson=require(_0x078f('0xa'));var client=jayson[_0x078f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x728cfe,_0x205510,_0x4a7db3){return new BPromise(function(_0x2ef013,_0x1901e3){return client[_0x078f('0xc')](_0x728cfe,_0x4a7db3)[_0x078f('0xd')](function(_0x7e87f){logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));logger['debug'](_0x078f('0x11'),_0x205510,_0x078f('0x10'),JSON['stringify'](_0x7e87f));if(_0x7e87f[_0x078f('0x12')]){if(_0x7e87f[_0x078f('0x12')][_0x078f('0x13')]===0x1f4){logger[_0x078f('0x12')]('Attachment,\x20%s,\x20%s',_0x205510,_0x7e87f['error'][_0x078f('0x14')]);return _0x1901e3(_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);}logger[_0x078f('0x12')]('Attachment,\x20%s,\x20%s',_0x205510,_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);return _0x2ef013(_0x7e87f['error'][_0x078f('0x14')]);}else{logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));_0x2ef013(_0x7e87f[_0x078f('0x15')][_0x078f('0x14')]);}})['catch'](function(_0x56bad2){logger[_0x078f('0x12')](_0x078f('0xf'),_0x205510,_0x56bad2);_0x1901e3(_0x56bad2);});});}exports[_0x078f('0x16')]=function(_0x19a182){var _0x201560=this;return new Promise(function(_0x25bb2d,_0xb8af8c){return db[_0x078f('0x17')][_0x078f('0x18')](_0x19a182[_0x078f('0x19')],{'raw':_0x19a182[_0x078f('0x1a')]?_0x19a182[_0x078f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x078f('0xd')](function(_0x52c74f){logger['info'](_0x078f('0x16'),_0x19a182);logger[_0x078f('0x1b')](_0x078f('0x16'),_0x19a182,JSON[_0x078f('0x1c')](_0x52c74f));_0x25bb2d(_0x52c74f);})[_0x078f('0x1d')](function(_0x2c6db4){logger[_0x078f('0x12')](_0x078f('0x16'),_0x2c6db4[_0x078f('0x14')],_0x19a182);_0xb8af8c(_0x201560['error'](0x1f4,_0x2c6db4[_0x078f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index cb1e5b0..e1b02cb 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(_0x34e250,_0x513da5){var _0x229bfa=function(_0x389967){while(--_0x389967){_0x34e250['push'](_0x34e250['shift']());}};_0x229bfa(++_0x513da5);}(_0x2032,0xd9));var _0x2203=function(_0x11771b,_0x54dc0d){_0x11771b=_0x11771b-0x0;var _0x20c501=_0x2032[_0x11771b];return _0x20c501;};'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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0x0b0e[_0x230e39];return _0xa804e;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index ed5b7ec..10b3983 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 _0x4b20=['../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','then','name','role','disabled','blocked','blockedAt','agent','add','blockDuration','minutes','clearBlockUser','getLicense','catch','status','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','password','User','passport','passport-local','moment','activedirectory2','util','../../mysqldb'];(function(_0x51b3c6,_0x13bc82){var _0x5cbb1b=function(_0x25caa2){while(--_0x25caa2){_0x51b3c6['push'](_0x51b3c6['shift']());}};_0x5cbb1b(++_0x13bc82);}(_0x4b20,0x1c6));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x04b2('0x0'));var LocalStrategy=require(_0x04b2('0x1'))['Strategy'];var moment=require(_0x04b2('0x2'));var ActiveDirectory=require(_0x04b2('0x3'));var BPromise=require('bluebird');var util=require(_0x04b2('0x4'));var db=require(_0x04b2('0x5'))['db'];var authService=require(_0x04b2('0x6'));var utils=require('../../config/utils');var config=require(_0x04b2('0x7'));var logger=require(_0x04b2('0x8'))(_0x04b2('0x9'));function isActiveDirectoryConfigured(_0x3b4bbd){var _0x55352b=![];if(typeof _0x3b4bbd[_0x04b2('0xa')]!==_0x04b2('0xb')){_0x55352b=_0x3b4bbd[_0x04b2('0xa')][_0x04b2('0xc')]&&_0x3b4bbd[_0x04b2('0xa')][_0x04b2('0xd')]&&_0x3b4bbd[_0x04b2('0xa')][_0x04b2('0xe')];}return _0x55352b;}function adAuthenticate(_0x4962ca,_0x12e143,_0x43fac3){return new BPromise(function(_0x26e66f,_0x48e684){try{var _0x8f85bf=new ActiveDirectory(_0x4962ca);_0x8f85bf[_0x04b2('0xf')](_0x12e143,_0x43fac3,function(_0x4a8d79,_0x2c7595){if(_0x4a8d79){logger[_0x04b2('0x10')](_0x04b2('0x11'),_0x12e143,util[_0x04b2('0x12')](_0x4a8d79,{'showHidden':![],'depth':null}));_0x48e684(_0x04b2('0x13'));}else if(!_0x2c7595){logger[_0x04b2('0x10')](_0x04b2('0x14'),_0x12e143);_0x48e684(_0x04b2('0x13'));}else{_0x26e66f(_0x2c7595);}});}catch(_0x2bc915){_0x48e684(_0x2bc915);}});}function ActiveDirectoryAuthenticate(_0x4d7d73,_0x7e67e7,_0x4feadf,_0x1c5861){var _0x507b5d,_0x245d0b;if(!isActiveDirectoryConfigured(config)){logger[_0x04b2('0x10')](_0x04b2('0x15'),_0x7e67e7);return _0x1c5861(null,![],{'message':_0x04b2('0x13')});}return db[_0x04b2('0x16')][_0x04b2('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0x04b2('0x18')](function(_0xf9eebb){_0x507b5d=_0xf9eebb;if(!_0x507b5d['adSsoEnabled']){logger[_0x04b2('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x7e67e7);throw new Error(_0x04b2('0x13'));}return _0x4d7d73[_0x04b2('0x17')]({'logging':!![],'attributes':['id',_0x04b2('0x19'),'password','salt',_0x04b2('0x1a'),_0x04b2('0x1b'),_0x04b2('0x1c'),_0x04b2('0x1d'),'online'],'where':{'name':_0x7e67e7,'role':{'$or':['admin','user',_0x04b2('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x2f3256){if(!_0x2f3256||_0x2f3256&&_0x2f3256[_0x04b2('0x19')]!==_0x7e67e7){throw new Error(_0x04b2('0x13'));}_0x245d0b=_0x2f3256;var _0x1ca519=_0x245d0b[_0x04b2('0x19')]+'@'+config[_0x04b2('0xa')][_0x04b2('0xe')];return adAuthenticate(config[_0x04b2('0xa')],_0x1ca519,_0x4feadf);})[_0x04b2('0x18')](function(_0x2716ad){if(_0x245d0b['disabled']){throw new Error(_0x04b2('0x13'));}if(_0x507b5d['blockDuration']>0x0){if(_0x245d0b[_0x04b2('0x1c')]){if(moment(_0x245d0b[_0x04b2('0x1d')])[_0x04b2('0x1f')](_0x507b5d[_0x04b2('0x20')],_0x04b2('0x21'))>moment()){throw new Error(_0x04b2('0x13'));}return utils[_0x04b2('0x22')](_0x245d0b,0x0,![],null)[_0x04b2('0x18')](function(){return utils['getLicense'](_0x245d0b);})[_0x04b2('0x18')](function(){return _0x1c5861(null,_0x245d0b);});}else{return utils['getLicense'](_0x245d0b)[_0x04b2('0x18')](function(){return _0x1c5861(null,_0x245d0b);});}}else{return utils[_0x04b2('0x23')](_0x245d0b)[_0x04b2('0x18')](function(){return _0x1c5861(null,_0x245d0b);});}})[_0x04b2('0x24')](function(_0xb1b792){return _0x1c5861(null,![],_0xb1b792);});}function handleError(_0x3e0710,_0x7af90a,_0x436c63){return _0x3e0710[_0x04b2('0x25')](_0x7af90a||0x1f4)['send']({'message':_0x436c63?_0x436c63[_0x04b2('0x26')]||_0x436c63:''});}exports['login']=function(_0x129d24,_0x71fa5a,_0x52718b){passport[_0x04b2('0xf')](_0x04b2('0x27'),function(_0x57b80a,_0x32289e,_0x3c01e5){var _0x1f9fe6=_0x57b80a||_0x3c01e5;if(_0x1f9fe6){return handleError(_0x71fa5a,0x191,_0x1f9fe6);}if(!_0x32289e){return handleError(_0x71fa5a,0x194,{'message':_0x04b2('0x28')});}else{var _0x5e416e={'payload':{'id':_0x32289e['id'],'role':_0x32289e[_0x04b2('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x04b2('0x29')](_0x5e416e)['then'](function(_0x838303){_0x71fa5a[_0x04b2('0x2a')]({'id':_0x32289e['id'],'token':_0x838303,'statusCall':'','isAlreadyLogged':_0x32289e['online']});});}})(_0x129d24,_0x71fa5a,_0x52718b);};passport[_0x04b2('0x2b')](_0x04b2('0x27'),new LocalStrategy({'usernameField':'name','passwordField':_0x04b2('0x2c')},function(_0x1682bd,_0x4949fa,_0x5b7105){return ActiveDirectoryAuthenticate(db[_0x04b2('0x2d')],_0x1682bd,_0x4949fa,_0x5b7105);})); \ No newline at end of file +var _0xda8f=['online','admin','user','agent','disabled','add','minutes','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','User','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt'];(function(_0x57e6f5,_0x2e371f){var _0x59f71c=function(_0x5dde08){while(--_0x5dde08){_0x57e6f5['push'](_0x57e6f5['shift']());}};_0x59f71c(++_0x2e371f);}(_0xda8f,0xcc));var _0xfda8=function(_0x381db0,_0x5c1d55){_0x381db0=_0x381db0-0x0;var _0x59a3ef=_0xda8f[_0x381db0];return _0x59a3ef;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xfda8('0x0'));var ActiveDirectory=require(_0xfda8('0x1'));var BPromise=require(_0xfda8('0x2'));var util=require(_0xfda8('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0xfda8('0x4'));var utils=require(_0xfda8('0x5'));var config=require(_0xfda8('0x6'));var logger=require(_0xfda8('0x7'))(_0xfda8('0x8'));function isActiveDirectoryConfigured(_0x226bb1){var _0x10e0f7=![];if(typeof _0x226bb1[_0xfda8('0x9')]!==_0xfda8('0xa')){_0x10e0f7=_0x226bb1[_0xfda8('0x9')][_0xfda8('0xb')]&&_0x226bb1['activedirectory'][_0xfda8('0xc')]&&_0x226bb1[_0xfda8('0x9')][_0xfda8('0xd')];}return _0x10e0f7;}function adAuthenticate(_0x16e651,_0x206258,_0x470109){return new BPromise(function(_0x185999,_0x51fa1c){try{var _0x405ef3=new ActiveDirectory(_0x16e651);_0x405ef3[_0xfda8('0xe')](_0x206258,_0x470109,function(_0x3992a6,_0x1ed5d1){if(_0x3992a6){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x206258,util[_0xfda8('0xf')](_0x3992a6,{'showHidden':![],'depth':null}));_0x51fa1c(_0xfda8('0x10'));}else if(!_0x1ed5d1){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x206258);_0x51fa1c(_0xfda8('0x10'));}else{_0x185999(_0x1ed5d1);}});}catch(_0x50fe08){_0x51fa1c(_0x50fe08);}});}function ActiveDirectoryAuthenticate(_0x2024a7,_0x6546cd,_0x55502b,_0x51ea64){var _0x2f0ff4,_0x32e963;if(!isActiveDirectoryConfigured(config)){logger[_0xfda8('0x11')](_0xfda8('0x12'),_0x6546cd);return _0x51ea64(null,![],{'message':_0xfda8('0x10')});}return db[_0xfda8('0x13')][_0xfda8('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xfda8('0x15')],'raw':!![]})[_0xfda8('0x16')](function(_0x4da15c){_0x2f0ff4=_0x4da15c;if(!_0x2f0ff4[_0xfda8('0x17')]){logger[_0xfda8('0x11')](_0xfda8('0x18'),_0x6546cd);throw new Error(_0xfda8('0x10'));}return _0x2024a7[_0xfda8('0x14')]({'logging':!![],'attributes':['id',_0xfda8('0x19'),_0xfda8('0x1a'),_0xfda8('0x1b'),_0xfda8('0x1c'),'disabled',_0xfda8('0x1d'),_0xfda8('0x1e'),_0xfda8('0x1f')],'where':{'name':_0x6546cd,'role':{'$or':[_0xfda8('0x20'),_0xfda8('0x21'),_0xfda8('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x5c3ac4){if(!_0x5c3ac4||_0x5c3ac4&&_0x5c3ac4[_0xfda8('0x19')]!==_0x6546cd){throw new Error(_0xfda8('0x10'));}_0x32e963=_0x5c3ac4;var _0x40fd00=_0x32e963['name']+'@'+config['activedirectory'][_0xfda8('0xd')];return adAuthenticate(config['activedirectory'],_0x40fd00,_0x55502b);})['then'](function(_0x434ab1){if(_0x32e963[_0xfda8('0x23')]){throw new Error(_0xfda8('0x10'));}if(_0x2f0ff4['blockDuration']>0x0){if(_0x32e963['blocked']){if(moment(_0x32e963[_0xfda8('0x1e')])[_0xfda8('0x24')](_0x2f0ff4[_0xfda8('0x15')],_0xfda8('0x25'))>moment()){throw new Error(_0xfda8('0x10'));}return utils[_0xfda8('0x26')](_0x32e963,0x0,![],null)['then'](function(){return utils[_0xfda8('0x27')](_0x32e963);})[_0xfda8('0x16')](function(){return _0x51ea64(null,_0x32e963);});}else{return utils[_0xfda8('0x27')](_0x32e963)['then'](function(){return _0x51ea64(null,_0x32e963);});}}else{return utils[_0xfda8('0x27')](_0x32e963)[_0xfda8('0x16')](function(){return _0x51ea64(null,_0x32e963);});}})[_0xfda8('0x28')](function(_0x4d2a96){return _0x51ea64(null,![],_0x4d2a96);});}function handleError(_0x3171dc,_0x490929,_0x3d44d0){return _0x3171dc[_0xfda8('0x29')](_0x490929||0x1f4)[_0xfda8('0x2a')]({'message':_0x3d44d0?_0x3d44d0['message']||_0x3d44d0:''});}exports['login']=function(_0x24063a,_0x1ee5e5,_0x4ef602){passport[_0xfda8('0xe')](_0xfda8('0x2b'),function(_0xab467f,_0x62c269,_0x2a9c5f){var _0x5a9212=_0xab467f||_0x2a9c5f;if(_0x5a9212){return handleError(_0x1ee5e5,0x191,_0x5a9212);}if(!_0x62c269){return handleError(_0x1ee5e5,0x194,{'message':_0xfda8('0x2c')});}else{var _0x50724e={'payload':{'id':_0x62c269['id'],'role':_0x62c269[_0xfda8('0x1c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x50724e)['then'](function(_0xce4216){_0x1ee5e5[_0xfda8('0x2d')]({'id':_0x62c269['id'],'token':_0xce4216,'statusCall':'','isAlreadyLogged':_0x62c269[_0xfda8('0x1f')]});});}})(_0x24063a,_0x1ee5e5,_0x4ef602);};passport['use'](_0xfda8('0x2b'),new LocalStrategy({'usernameField':_0xfda8('0x19'),'passwordField':_0xfda8('0x1a')},function(_0x2adbe3,_0x4a36cf,_0x5b83d5){return ActiveDirectoryAuthenticate(db[_0xfda8('0x2e')],_0x2adbe3,_0x4a36cf,_0x5b83d5);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index f0d3ccc..140bf8f 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 _0xda46=['login','exports','Router','./authActiveDirectory.controller','post'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0xda46,0x7f));var _0x6da4=function(_0x5555ad,_0x70e0a8){_0x5555ad=_0x5555ad-0x0;var _0x8628d4=_0xda46[_0x5555ad];return _0x8628d4;};'use strict';var express=require('express');var router=express[_0x6da4('0x0')]();var controller=require(_0x6da4('0x1'));router[_0x6da4('0x2')]('/',controller[_0x6da4('0x3')]);module[_0x6da4('0x4')]=router; \ No newline at end of file +var _0xa55f=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa55f,0x16e));var _0xfa55=function(_0x548a22,_0x266250){_0x548a22=_0x548a22-0x0;var _0x4644b0=_0xa55f[_0x548a22];return _0x4644b0;};'use strict';var express=require('express');var router=express[_0xfa55('0x0')]();var controller=require(_0xfa55('0x1'));router[_0xfa55('0x2')]('/',controller[_0xfa55('0x3')]);module[_0xfa55('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index bd5e97d..a854d0e 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x7a54,0x106));var _0x47a5=function(_0xcd9c13,_0x5cb1bc){_0xcd9c13=_0xcd9c13-0x0;var _0x5b9bf3=_0x7a54[_0xcd9c13];return _0x5b9bf3;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7a54,0x106));var _0x47a5=function(_0x3416b2,_0x1e29d8){_0x3416b2=_0x3416b2-0x0;var _0x10c02d=_0x7a54[_0x3416b2];return _0x10c02d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index e7592dc..1d1a039 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 _0x970a=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x25b6f4,_0x282647){var _0x9bda9c=function(_0x595721){while(--_0x595721){_0x25b6f4['push'](_0x25b6f4['shift']());}};_0x9bda9c(++_0x282647);}(_0x970a,0xee));var _0xa970=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x970a[_0x59ee6f];return _0x4c0979;};'use strict';var express=require(_0xa970('0x0'));var passport=require(_0xa970('0x1'));var router=express[_0xa970('0x2')]();var controller=require(_0xa970('0x3'));var userController=require(_0xa970('0x4'));var authService=require(_0xa970('0x5'));router[_0xa970('0x6')]('/',controller[_0xa970('0x7')]);router[_0xa970('0x6')](_0xa970('0x8'),controller[_0xa970('0x9')],authService[_0xa970('0xa')],userController[_0xa970('0x7')],authService[_0xa970('0xb')]);module[_0xa970('0xc')]=router; \ No newline at end of file +var _0xf760=['../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x304d7e,_0x5cafcc){var _0x54e806=function(_0x1c6beb){while(--_0x1c6beb){_0x304d7e['push'](_0x304d7e['shift']());}};_0x54e806(++_0x5cafcc);}(_0xf760,0x1ab));var _0x0f76=function(_0x241c6a,_0x2531e4){_0x241c6a=_0x241c6a-0x0;var _0x13b613=_0xf760[_0x241c6a];return _0x13b613;};'use strict';var express=require('express');var passport=require(_0x0f76('0x0'));var router=express[_0x0f76('0x1')]();var controller=require(_0x0f76('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x0f76('0x3'));router[_0x0f76('0x4')]('/',controller[_0x0f76('0x5')]);router['get'](_0x0f76('0x6'),controller['callback'],authService[_0x0f76('0x7')],userController[_0x0f76('0x5')],authService[_0x0f76('0x8')]);module[_0x0f76('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index fd1bac0..54881e0 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 _0xa584=['getSmtpOptions','merge','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x20f605,_0x10e384){var _0x328e57=function(_0x490438){while(--_0x490438){_0x20f605['push'](_0x20f605['shift']());}};_0x328e57(++_0x10e384);}(_0xa584,0x17c));var _0x4a58=function(_0x47215c,_0x87a489){_0x47215c=_0x47215c-0x0;var _0x2d0f7c=_0xa584[_0x47215c];return _0x2d0f7c;};'use strict';var util=require(_0x4a58('0x0'));var passport=require(_0x4a58('0x1'));var LocalStrategy=require(_0x4a58('0x2'))['Strategy'];var jayson=require(_0x4a58('0x3'));var _=require(_0x4a58('0x4'));var rs=require(_0x4a58('0x5'));var moment=require('moment');var db=require(_0x4a58('0x6'))['db'];var authService=require(_0x4a58('0x7'));var utils=require('../../config/utils');var client=jayson[_0x4a58('0x8')][_0x4a58('0x9')]({'port':0x232b});function localAuthenticate(_0x456caf,_0x1515b3,_0x5c0520,_0x363759){var _0x2a0689,_0x31b387;return db[_0x4a58('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x4a58('0xb'),_0x4a58('0xc')],'raw':!![]})[_0x4a58('0xd')](function(_0x5b6ea8){_0x2a0689=_0x5b6ea8;return _0x456caf[_0x4a58('0xe')]({'attributes':['id','name',_0x4a58('0xf'),_0x4a58('0x10'),_0x4a58('0x11'),_0x4a58('0x12'),'blocked',_0x4a58('0x13'),'loginAttempts'],'where':{'name':_0x1515b3,'role':{'$or':[_0x4a58('0x14'),_0x4a58('0x15'),_0x4a58('0x16')]}}});})[_0x4a58('0xd')](function(_0x2ea28d){if(!_0x2ea28d||_0x2ea28d&&_0x2ea28d[_0x4a58('0x17')]!==_0x1515b3){throw new Error(_0x4a58('0x18'));}else{_0x31b387=_0x2ea28d;return _0x31b387;}})['then'](function(){_0x31b387[_0x4a58('0x19')](_0x5c0520,function(_0x448170,_0x1550a8){var _0x21414b=_0x31b387[_0x4a58('0x1a')]+0x1;if(_0x448170){return _0x363759(_0x448170);}else if(!_0x1550a8){if(_0x31b387['disabled']){return _0x363759(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2a0689[_0x4a58('0xb')]>0x0){if(_0x31b387[_0x4a58('0x1b')]){if(_0x2a0689['blockDuration']>0x0){if(moment(_0x31b387[_0x4a58('0x13')])[_0x4a58('0x1c')](_0x2a0689[_0x4a58('0xc')],_0x4a58('0x1d'))>moment()){return _0x363759(null,![],{'message':_0x4a58('0x18')});}else{return utils[_0x4a58('0x1e')](_0x31b387,_0x21414b,![],null)[_0x4a58('0xd')](function(){return _0x363759(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x363759(null,![],{'message':_0x4a58('0x18')});}}else{if(_0x21414b>=_0x2a0689[_0x4a58('0xb')]){return utils['clearBlockUser'](_0x31b387,0x0,!![],moment())[_0x4a58('0xd')](function(){return _0x363759(null,![],{'message':_0x4a58('0x18')});});}else{return utils[_0x4a58('0x1e')](_0x31b387,_0x21414b,![],null)['then'](function(){return _0x363759(null,![],{'message':_0x4a58('0x18')});});}}}else{return _0x363759(null,![],{'message':_0x4a58('0x18')});}}else{if(_0x31b387[_0x4a58('0x12')]){return _0x363759(null,![],{'message':_0x4a58('0x18')});}else if(_0x2a0689[_0x4a58('0xb')]>0x0){if(_0x31b387['blocked']){if(_0x2a0689[_0x4a58('0xc')]>0x0){if(moment(_0x31b387[_0x4a58('0x13')])[_0x4a58('0x1c')](_0x2a0689[_0x4a58('0xc')],_0x4a58('0x1d'))>moment()){return _0x363759(null,![],{'message':_0x4a58('0x18')});}else{return utils['clearBlockUser'](_0x31b387,0x0,![],null)[_0x4a58('0xd')](function(){return utils[_0x4a58('0x1f')](_0x31b387);})[_0x4a58('0xd')](function(){return _0x363759(null,_0x31b387);});}}else{return _0x363759(null,![],{'message':_0x4a58('0x18')});}}else{return utils[_0x4a58('0x1e')](_0x31b387,0x0,![],null)[_0x4a58('0xd')](function(){return utils[_0x4a58('0x1f')](_0x31b387);})[_0x4a58('0xd')](function(){return _0x363759(null,_0x31b387);})[_0x4a58('0x20')](function(_0x32473c){return _0x363759(null,![],_0x32473c);});}}else{if(_0x31b387[_0x4a58('0x1b')]){return _0x363759(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4a58('0x1f')](_0x31b387)[_0x4a58('0xd')](function(){return _0x363759(null,_0x31b387);});}}}});})[_0x4a58('0x20')](function(_0x1d9411){return _0x363759(null,![],_0x1d9411);});}function sendServiceMail(_0x5ae182){return db[_0x4a58('0x21')][_0x4a58('0x22')]({'where':{'service':!![]},'attributes':['id','name',_0x4a58('0x23')],'include':[{'model':db[_0x4a58('0x24')],'as':_0x4a58('0x25'),'include':[{'model':db[_0x4a58('0x26')],'as':'CloudProvider'}]}]})[_0x4a58('0xd')](function(_0x550b04){if(!_0x550b04){throw new Error(_0x4a58('0x27'));}var _0x9b59fa=_0x550b04[_0x4a58('0x28')]();var _0x3962db={'account':_0x9b59fa,'message':_[_0x4a58('0x29')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x550b04[_0x4a58('0x17')],_0x550b04[_0x4a58('0x23')]||_0x550b04[_0x4a58('0x25')][_0x4a58('0x15')])},_0x5ae182)};return client['request']('SendMail',_0x3962db);})[_0x4a58('0xd')](function(_0x10c09d){if(_0x10c09d[_0x4a58('0x2a')]){throw new Error(util[_0x4a58('0x2b')](_0x4a58('0x2c'),_0x10c09d['error'][_0x4a58('0x2d')]||JSON[_0x4a58('0x2e')](_0x10c09d[_0x4a58('0x2a')])));}return!![];});}function handleError(_0x2fba9f,_0x1ff9c9,_0x2a6e84){return _0x2fba9f[_0x4a58('0x2f')](_0x1ff9c9||0x1f4)[_0x4a58('0x30')]({'message':_0x2a6e84?_0x2a6e84[_0x4a58('0x2d')]||_0x2a6e84:''});}exports['login']=function(_0x1bfc14,_0x2fa861,_0x1e9733){passport[_0x4a58('0x19')]('local-login',function(_0x22813a,_0x71b182,_0xa2c094){var _0x37ebf6=_0x22813a||_0xa2c094;if(_0x37ebf6){return handleError(_0x2fa861,0x191,_0x37ebf6);}if(!_0x71b182){return handleError(_0x2fa861,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x22e528={'payload':{'id':_0x71b182['id'],'role':_0x71b182[_0x4a58('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x22e528)[_0x4a58('0xd')](function(_0x55a4b4){_0x2fa861[_0x4a58('0x31')]({'id':_0x71b182['id'],'token':_0x55a4b4,'statusCall':'','isAlreadyLogged':_0x71b182[_0x4a58('0x32')]});});}})(_0x1bfc14,_0x2fa861,_0x1e9733);};exports[_0x4a58('0x33')]=function(_0x3cf8fd,_0x46812e){if(!_0x3cf8fd[_0x4a58('0x34')]['email']){return handleError(_0x46812e,0x1f4,{'message':_0x4a58('0x35')});}var _0x14fb7e=rs['generate']();_0x3cf8fd[_0x4a58('0x34')]['email']=_0x3cf8fd[_0x4a58('0x34')][_0x4a58('0x23')][_0x4a58('0x36')]()[_0x4a58('0x37')]();var _0x5841e1;return db[_0x4a58('0xa')][_0x4a58('0xe')]({'where':{'id':0x1},'attributes':[_0x4a58('0xb'),_0x4a58('0xc')],'raw':!![]})[_0x4a58('0xd')](function(_0x558c19){_0x5841e1=_0x558c19;return db[_0x4a58('0x38')][_0x4a58('0x22')]({'where':{'email':_0x3cf8fd['body']['email']}});})[_0x4a58('0xd')](function(_0xec260f){if(!_0xec260f){throw new Error(_0x4a58('0x39'));}if(_0xec260f['disabled']){throw new Error(_0x4a58('0x3a'));}if(_0xec260f[_0x4a58('0x1b')]){if(moment(_0xec260f[_0x4a58('0x13')])[_0x4a58('0x1c')](_0x5841e1[_0x4a58('0xc')],_0x4a58('0x1d'))>moment()){throw new Error(_0x4a58('0x3b'));}else{_0xec260f[_0x4a58('0x1b')]=![];_0xec260f['blockedAt']=null;}}_0xec260f['resetPasswordToken']=_0x14fb7e;_0xec260f[_0x4a58('0x3c')]=Date[_0x4a58('0x3d')]()+0x36ee80;return _0xec260f['save']();})[_0x4a58('0xd')](function(){return sendServiceMail({'to':_0x3cf8fd[_0x4a58('0x34')][_0x4a58('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x4a58('0x3e')+_0x4a58('0x3f')+_0x4a58('0x40')+_0x3cf8fd[_0x4a58('0x41')][_0x4a58('0x42')]+_0x4a58('0x43')+_0x14fb7e+'\x0a\x0a'+_0x4a58('0x44')});})[_0x4a58('0xd')](function(){_0x46812e[_0x4a58('0x2f')](0xc8)[_0x4a58('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x4a58('0x20')](function(_0x1a57e9){return handleError(_0x46812e,0x1f4,_0x1a57e9);});};exports[_0x4a58('0x45')]=function(_0x1d81f1,_0x52404c){return db[_0x4a58('0x38')]['find']({'where':{'resetPasswordToken':_0x1d81f1[_0x4a58('0x46')][_0x4a58('0x47')],'resetPasswordExpires':{'$gt':Date[_0x4a58('0x3d')]()}}})[_0x4a58('0xd')](function(_0x1af49e){if(!_0x1af49e){throw new Error(_0x4a58('0x48'));}return db[_0x4a58('0xa')][_0x4a58('0xe')]({'attributes':['id',_0x4a58('0x49'),_0x4a58('0x4a'),_0x4a58('0x4b')]})['then'](function(_0x3ea89a){if(_0x3ea89a[_0x4a58('0x49')])authService[_0x4a58('0x4c')](_0x1d81f1['body'][_0x4a58('0xf')]);if(!_0x3ea89a[_0x4a58('0x4a')]||!_0x1af49e[_0x4a58('0x4d')])return _0x1af49e;authService[_0x4a58('0x4e')](_0x1d81f1['body'][_0x4a58('0xf')],_0x1af49e['previousPasswords'],_0x3ea89a[_0x4a58('0x4b')]);return _0x1af49e;})[_0x4a58('0xd')](function(){_0x1af49e['password']=_0x1d81f1[_0x4a58('0x34')]['password'];_0x1af49e[_0x4a58('0x4f')]=null;_0x1af49e['resetPasswordExpires']=null;return _0x1af49e[_0x4a58('0x50')]();});})[_0x4a58('0xd')](function(){_0x52404c['status'](0xc8)['send']({'message':_0x4a58('0x51')});})[_0x4a58('0x20')](function(_0xe9b0f7){return handleError(_0x52404c,0x1f4,_0xe9b0f7);});};passport[_0x4a58('0x52')](_0x4a58('0x53'),new LocalStrategy({'usernameField':_0x4a58('0x17'),'passwordField':_0x4a58('0xf')},function(_0x5c18ad,_0x31df25,_0x48eb47){return localAuthenticate(db[_0x4a58('0x38')],_0x5c18ad,_0x31df25,_0x48eb47);})); \ No newline at end of file +var _0x07c8=['find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','add','blockDuration','minutes','clearBlockUser','getLicense','catch'];(function(_0xf11a42,_0x210fdc){var _0x25f6d2=function(_0x243357){while(--_0x243357){_0xf11a42['push'](_0xf11a42['shift']());}};_0x25f6d2(++_0x210fdc);}(_0x07c8,0x7d));var _0x807c=function(_0x3a5269,_0x10e45a){_0x3a5269=_0x3a5269-0x0;var _0x446ed7=_0x07c8[_0x3a5269];return _0x446ed7;};'use strict';var util=require(_0x807c('0x0'));var passport=require(_0x807c('0x1'));var LocalStrategy=require('passport-local')[_0x807c('0x2')];var jayson=require(_0x807c('0x3'));var _=require(_0x807c('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x807c('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x807c('0x6'));var client=jayson[_0x807c('0x7')][_0x807c('0x8')]({'port':0x232b});function localAuthenticate(_0x5c84d1,_0x111980,_0x557381,_0x2a1ca3){var _0x158794,_0x7f3d05;return db[_0x807c('0x9')][_0x807c('0xa')]({'where':{'id':0x1},'attributes':[_0x807c('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x20b279){_0x158794=_0x20b279;return _0x5c84d1['findOne']({'attributes':['id','name','password',_0x807c('0xc'),'role',_0x807c('0xd'),_0x807c('0xe'),_0x807c('0xf'),_0x807c('0x10')],'where':{'name':_0x111980,'role':{'$or':[_0x807c('0x11'),_0x807c('0x12'),_0x807c('0x13')]}}});})['then'](function(_0x527311){if(!_0x527311||_0x527311&&_0x527311[_0x807c('0x14')]!==_0x111980){throw new Error(_0x807c('0x15'));}else{_0x7f3d05=_0x527311;return _0x7f3d05;}})[_0x807c('0x16')](function(){_0x7f3d05['authenticate'](_0x557381,function(_0x161799,_0x857022){var _0x5642dc=_0x7f3d05[_0x807c('0x10')]+0x1;if(_0x161799){return _0x2a1ca3(_0x161799);}else if(!_0x857022){if(_0x7f3d05['disabled']){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x158794[_0x807c('0xb')]>0x0){if(_0x7f3d05[_0x807c('0xe')]){if(_0x158794['blockDuration']>0x0){if(moment(_0x7f3d05[_0x807c('0xf')])[_0x807c('0x17')](_0x158794[_0x807c('0x18')],_0x807c('0x19'))>moment()){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}else{return utils[_0x807c('0x1a')](_0x7f3d05,_0x5642dc,![],null)[_0x807c('0x16')](function(){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});});}}else{return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}}else{if(_0x5642dc>=_0x158794['allowedLoginAttempts']){return utils[_0x807c('0x1a')](_0x7f3d05,0x0,!![],moment())['then'](function(){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});});}else{return utils[_0x807c('0x1a')](_0x7f3d05,_0x5642dc,![],null)['then'](function(){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}}else{if(_0x7f3d05[_0x807c('0xd')]){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x158794['allowedLoginAttempts']>0x0){if(_0x7f3d05[_0x807c('0xe')]){if(_0x158794[_0x807c('0x18')]>0x0){if(moment(_0x7f3d05['blockedAt'])['add'](_0x158794['blockDuration'],_0x807c('0x19'))>moment()){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x7f3d05,0x0,![],null)[_0x807c('0x16')](function(){return utils[_0x807c('0x1b')](_0x7f3d05);})['then'](function(){return _0x2a1ca3(null,_0x7f3d05);});}}else{return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}}else{return utils['clearBlockUser'](_0x7f3d05,0x0,![],null)[_0x807c('0x16')](function(){return utils[_0x807c('0x1b')](_0x7f3d05);})[_0x807c('0x16')](function(){return _0x2a1ca3(null,_0x7f3d05);})[_0x807c('0x1c')](function(_0x49dcf1){return _0x2a1ca3(null,![],_0x49dcf1);});}}else{if(_0x7f3d05[_0x807c('0xe')]){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}else{return utils['getLicense'](_0x7f3d05)[_0x807c('0x16')](function(){return _0x2a1ca3(null,_0x7f3d05);});}}}});})[_0x807c('0x1c')](function(_0x2417e5){return _0x2a1ca3(null,![],_0x2417e5);});}function sendServiceMail(_0x9151c7){return db['MailAccount'][_0x807c('0x1d')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x807c('0x1e')],'as':_0x807c('0x1f'),'include':[{'model':db[_0x807c('0x20')],'as':_0x807c('0x20')}]}]})[_0x807c('0x16')](function(_0x1ed059){if(!_0x1ed059){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x376b6f=_0x1ed059[_0x807c('0x21')]();var _0x278c0c={'account':_0x376b6f,'message':_[_0x807c('0x22')]({'from':util['format'](_0x807c('0x23'),_0x1ed059['name'],_0x1ed059[_0x807c('0x24')]||_0x1ed059[_0x807c('0x1f')]['user'])},_0x9151c7)};return client[_0x807c('0x25')]('SendMail',_0x278c0c);})[_0x807c('0x16')](function(_0x19c05c){if(_0x19c05c[_0x807c('0x26')]){throw new Error(util['format'](_0x807c('0x27'),_0x19c05c[_0x807c('0x26')][_0x807c('0x28')]||JSON[_0x807c('0x29')](_0x19c05c[_0x807c('0x26')])));}return!![];});}function handleError(_0xa20f56,_0x2d651a,_0x20672a){return _0xa20f56[_0x807c('0x2a')](_0x2d651a||0x1f4)[_0x807c('0x2b')]({'message':_0x20672a?_0x20672a[_0x807c('0x28')]||_0x20672a:''});}exports[_0x807c('0x2c')]=function(_0x15efdd,_0x1662db,_0xc561e6){passport[_0x807c('0x2d')](_0x807c('0x2e'),function(_0x1af642,_0x1413ed,_0x20862f){var _0x56c6a6=_0x1af642||_0x20862f;if(_0x56c6a6){return handleError(_0x1662db,0x191,_0x56c6a6);}if(!_0x1413ed){return handleError(_0x1662db,0x194,{'message':_0x807c('0x2f')});}else{var _0x225781={'payload':{'id':_0x1413ed['id'],'role':_0x1413ed['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x225781)[_0x807c('0x16')](function(_0x10f7b8){_0x1662db[_0x807c('0x30')]({'id':_0x1413ed['id'],'token':_0x10f7b8,'statusCall':'','isAlreadyLogged':_0x1413ed['online']});});}})(_0x15efdd,_0x1662db,_0xc561e6);};exports['forgot']=function(_0x1e1256,_0x11a473){if(!_0x1e1256[_0x807c('0x31')][_0x807c('0x24')]){return handleError(_0x11a473,0x1f4,{'message':_0x807c('0x32')});}var _0x10bf0a=rs[_0x807c('0x33')]();_0x1e1256['body'][_0x807c('0x24')]=_0x1e1256[_0x807c('0x31')][_0x807c('0x24')][_0x807c('0x34')]()['toLowerCase']();var _0x4e2295;return db[_0x807c('0x9')][_0x807c('0xa')]({'where':{'id':0x1},'attributes':[_0x807c('0xb'),_0x807c('0x18')],'raw':!![]})[_0x807c('0x16')](function(_0x42b1a8){_0x4e2295=_0x42b1a8;return db[_0x807c('0x35')][_0x807c('0x1d')]({'where':{'email':_0x1e1256[_0x807c('0x31')][_0x807c('0x24')]}});})['then'](function(_0x1b0347){if(!_0x1b0347){throw new Error(_0x807c('0x36'));}if(_0x1b0347['disabled']){throw new Error(_0x807c('0x37'));}if(_0x1b0347[_0x807c('0xe')]){if(moment(_0x1b0347[_0x807c('0xf')])[_0x807c('0x17')](_0x4e2295[_0x807c('0x18')],'minutes')>moment()){throw new Error(_0x807c('0x38'));}else{_0x1b0347[_0x807c('0xe')]=![];_0x1b0347['blockedAt']=null;}}_0x1b0347['resetPasswordToken']=_0x10bf0a;_0x1b0347[_0x807c('0x39')]=Date[_0x807c('0x3a')]()+0x36ee80;return _0x1b0347[_0x807c('0x3b')]();})[_0x807c('0x16')](function(){return sendServiceMail({'to':_0x1e1256[_0x807c('0x31')][_0x807c('0x24')],'subject':_0x807c('0x3c'),'text':_0x807c('0x3d')+_0x807c('0x3e')+_0x807c('0x3f')+_0x1e1256['headers'][_0x807c('0x40')]+_0x807c('0x41')+_0x10bf0a+'\x0a\x0a'+_0x807c('0x42')});})[_0x807c('0x16')](function(){_0x11a473['status'](0xc8)[_0x807c('0x2b')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x2a2ff0){return handleError(_0x11a473,0x1f4,_0x2a2ff0);});};exports['reset']=function(_0x2f5b44,_0x4687f5){return db[_0x807c('0x35')][_0x807c('0x1d')]({'where':{'resetPasswordToken':_0x2f5b44[_0x807c('0x43')][_0x807c('0x44')],'resetPasswordExpires':{'$gt':Date[_0x807c('0x3a')]()}}})[_0x807c('0x16')](function(_0x2c0647){if(!_0x2c0647){throw new Error(_0x807c('0x45'));}return db[_0x807c('0x9')][_0x807c('0xa')]({'attributes':['id',_0x807c('0x46'),_0x807c('0x47'),_0x807c('0x48')]})[_0x807c('0x16')](function(_0x52512a){if(_0x52512a[_0x807c('0x46')])authService['validatePasswordPattern'](_0x2f5b44[_0x807c('0x31')][_0x807c('0x49')]);if(!_0x52512a[_0x807c('0x47')]||!_0x2c0647[_0x807c('0x4a')])return _0x2c0647;authService['validatePasswordHistory'](_0x2f5b44[_0x807c('0x31')][_0x807c('0x49')],_0x2c0647['previousPasswords'],_0x52512a[_0x807c('0x48')]);return _0x2c0647;})['then'](function(){_0x2c0647['password']=_0x2f5b44['body']['password'];_0x2c0647['resetPasswordToken']=null;_0x2c0647[_0x807c('0x39')]=null;return _0x2c0647[_0x807c('0x3b')]();});})[_0x807c('0x16')](function(){_0x4687f5[_0x807c('0x2a')](0xc8)[_0x807c('0x2b')]({'message':_0x807c('0x4b')});})[_0x807c('0x1c')](function(_0x30a006){return handleError(_0x4687f5,0x1f4,_0x30a006);});};passport[_0x807c('0x4c')]('local-login',new LocalStrategy({'usernameField':_0x807c('0x14'),'passwordField':_0x807c('0x49')},function(_0x47fc04,_0x22ab3c,_0x57e8fd){return localAuthenticate(db[_0x807c('0x35')],_0x47fc04,_0x22ab3c,_0x57e8fd);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e5153a5..126530e 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 _0x26c4=['reset','exports','express','Router','./authLocal.controller','post','login','/reset/:token'];(function(_0x3547c7,_0x123133){var _0x30d6da=function(_0x36b7f4){while(--_0x36b7f4){_0x3547c7['push'](_0x3547c7['shift']());}};_0x30d6da(++_0x123133);}(_0x26c4,0x11a));var _0x426c=function(_0x43b6a5,_0x1e03fd){_0x43b6a5=_0x43b6a5-0x0;var _0x1a29b9=_0x26c4[_0x43b6a5];return _0x1a29b9;};'use strict';var express=require(_0x426c('0x0'));var router=express[_0x426c('0x1')]();var controller=require(_0x426c('0x2'));router[_0x426c('0x3')]('/',controller[_0x426c('0x4')]);router['post']('/forgot',controller['forgot']);router['post'](_0x426c('0x5'),controller[_0x426c('0x6')]);module[_0x426c('0x7')]=router; \ No newline at end of file +var _0x8b82=['/forgot','forgot','/reset/:token','reset','express','./authLocal.controller','post','login'];(function(_0x17f59f,_0x4b9eae){var _0x546846=function(_0x33eee4){while(--_0x33eee4){_0x17f59f['push'](_0x17f59f['shift']());}};_0x546846(++_0x4b9eae);}(_0x8b82,0x154));var _0x28b8=function(_0x2a4511,_0x8eed99){_0x2a4511=_0x2a4511-0x0;var _0x40704b=_0x8b82[_0x2a4511];return _0x40704b;};'use strict';var express=require(_0x28b8('0x0'));var router=express['Router']();var controller=require(_0x28b8('0x1'));router[_0x28b8('0x2')]('/',controller[_0x28b8('0x3')]);router[_0x28b8('0x2')](_0x28b8('0x4'),controller[_0x28b8('0x5')]);router[_0x28b8('0x2')](_0x28b8('0x6'),controller[_0x28b8('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a8a01f7..a9c5a55 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 _0x33c8=['BOOLEAN','exports','STRING'];(function(_0xbe2540,_0x59cf19){var _0x2e0015=function(_0x114890){while(--_0x114890){_0xbe2540['push'](_0xbe2540['shift']());}};_0x2e0015(++_0x59cf19);}(_0x33c8,0x1db));var _0x833c=function(_0x1fdb7a,_0x59c591){_0x1fdb7a=_0x1fdb7a-0x0;var _0x20d14c=_0x33c8[_0x1fdb7a];return _0x20d14c;};'use strict';var Sequelize=require('sequelize');module[_0x833c('0x0')]={'name':{'type':Sequelize[_0x833c('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x833c('0x1')]},'description':{'type':Sequelize[_0x833c('0x1')]},'status':{'type':Sequelize[_0x833c('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x177e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1239c9,_0x31a03b){var _0x5544ac=function(_0x536e01){while(--_0x536e01){_0x1239c9['push'](_0x1239c9['shift']());}};_0x5544ac(++_0x31a03b);}(_0x177e,0x11a));var _0xe177=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x177e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe177('0x0'));module[_0xe177('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe177('0x2')]},'description':{'type':Sequelize[_0xe177('0x2')]},'status':{'type':Sequelize[_0xe177('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 311dfec..6c59fa6 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 _0xa46a=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','findAll','catch','show','find','create','body','params','destroy','addConditions','Condition','omit','ids','getConditions','findOne','order','merge','options','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','end','error','stack','name','index','map','Automation','rawAttributes','fieldName','type'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa46a,0x11b));var _0xaa46=function(_0x552c27,_0x478dc2){_0x552c27=_0x552c27-0x0;var _0x2a0922=_0xa46a[_0x552c27];return _0x2a0922;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa46('0x0'));var zipdir=require(_0xaa46('0x1'));var jsonpatch=require(_0xaa46('0x2'));var rp=require(_0xaa46('0x3'));var moment=require(_0xaa46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa46('0x5'));var util=require(_0xaa46('0x6'));var path=require(_0xaa46('0x7'));var sox=require('sox');var csv=require(_0xaa46('0x8'));var ejs=require(_0xaa46('0x9'));var fs=require('fs');var fs_extra=require(_0xaa46('0xa'));var _=require(_0xaa46('0xb'));var squel=require('squel');var crypto=require(_0xaa46('0xc'));var jsforce=require(_0xaa46('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa46('0xe'));var Redis=require(_0xaa46('0xf'));var authService=require(_0xaa46('0x10'));var qs=require(_0xaa46('0x11'));var as=require(_0xaa46('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa46('0x13'))('api');var utils=require(_0xaa46('0x14'));var config=require(_0xaa46('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa46('0x16'))['db'];function respondWithStatusCode(_0x4c66d8,_0x23c9fe){_0x23c9fe=_0x23c9fe||0xcc;return function(_0x5a1f75){if(_0x5a1f75){return _0x4c66d8[_0xaa46('0x17')](_0x23c9fe);}return _0x4c66d8[_0xaa46('0x18')](_0x23c9fe)['end']();};}function respondWithResult(_0x8a57c2,_0x25baa2){_0x25baa2=_0x25baa2||0xc8;return function(_0x577a91){if(_0x577a91){return _0x8a57c2[_0xaa46('0x18')](_0x25baa2)[_0xaa46('0x19')](_0x577a91);}};}function respondWithFilteredResult(_0x147086,_0x2ed9c9){return function(_0x358834){if(_0x358834){var _0x580f37=typeof _0x2ed9c9[_0xaa46('0x1a')]==='undefined'&&typeof _0x2ed9c9[_0xaa46('0x1b')]===_0xaa46('0x1c');var _0x4eb956=_0x358834[_0xaa46('0x1d')];var _0x4e556a=_0x580f37?0x0:_0x2ed9c9[_0xaa46('0x1a')];var _0x23c840=_0x580f37?_0x358834['count']:_0x2ed9c9['offset']+_0x2ed9c9['limit'];var _0x50c97c;if(_0x23c840>=_0x4eb956){_0x23c840=_0x4eb956;_0x50c97c=0xc8;}else{_0x50c97c=0xce;}_0x147086['status'](_0x50c97c);return _0x147086[_0xaa46('0x1e')]('Content-Range',_0x4e556a+'-'+_0x23c840+'/'+_0x4eb956)['json'](_0x358834);}return null;};}function patchUpdates(_0x431b27){return function(_0x3f5471){try{jsonpatch['apply'](_0x3f5471,_0x431b27,!![]);}catch(_0x4e4237){return BPromise[_0xaa46('0x1f')](_0x4e4237);}return _0x3f5471[_0xaa46('0x20')]();};}function saveUpdates(_0xdd5bac,_0x55fa84){return function(_0x5548c1){if(_0x5548c1){return _0x5548c1[_0xaa46('0x21')](_0xdd5bac)[_0xaa46('0x22')](function(_0x458c09){return _0x458c09;});}return null;};}function removeEntity(_0x54c7c6,_0x1c8efd){return function(_0x4e2929){if(_0x4e2929){return _0x4e2929['destroy']()[_0xaa46('0x22')](function(){_0x54c7c6['status'](0xcc)[_0xaa46('0x23')]();});}};}function handleEntityNotFound(_0x5338f1,_0x95a44d){return function(_0x29ee03){if(!_0x29ee03){_0x5338f1[_0xaa46('0x17')](0x194);}return _0x29ee03;};}function handleError(_0x52f7a1,_0x19ddcf){_0x19ddcf=_0x19ddcf||0x1f4;return function(_0x53e4e4){logger[_0xaa46('0x24')](_0x53e4e4[_0xaa46('0x25')]);if(_0x53e4e4[_0xaa46('0x26')]){delete _0x53e4e4[_0xaa46('0x26')];}_0x52f7a1[_0xaa46('0x18')](_0x19ddcf)['send'](_0x53e4e4);};}exports[_0xaa46('0x27')]=function(_0x3e519b,_0x417568){var _0x39a86b={},_0x1c7664={},_0x2417ff={'count':0x0,'rows':[]};var _0x359094=_[_0xaa46('0x28')](db[_0xaa46('0x29')][_0xaa46('0x2a')],function(_0x1f01a4){return{'name':_0x1f01a4[_0xaa46('0x2b')],'type':_0x1f01a4[_0xaa46('0x2c')]['key']};});_0x1c7664[_0xaa46('0x2d')]=_[_0xaa46('0x28')](_0x359094,_0xaa46('0x26'));_0x1c7664[_0xaa46('0x2e')]=_[_0xaa46('0x2f')](_0x3e519b[_0xaa46('0x2e')]);_0x1c7664['filters']=_[_0xaa46('0x30')](_0x1c7664[_0xaa46('0x2d')],_0x1c7664[_0xaa46('0x2e')]);_0x39a86b[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x1c7664['model'],qs[_0xaa46('0x32')](_0x3e519b['query'][_0xaa46('0x32')]));_0x39a86b[_0xaa46('0x31')]=_0x39a86b[_0xaa46('0x31')][_0xaa46('0x33')]?_0x39a86b['attributes']:_0x1c7664[_0xaa46('0x2d')];if(!_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x34')](_0xaa46('0x35'))){_0x39a86b[_0xaa46('0x1b')]=qs['limit'](_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x1b')]);_0x39a86b[_0xaa46('0x1a')]=qs[_0xaa46('0x1a')](_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x1a')]);}_0x39a86b['order']=qs['sort'](_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x36')]);_0x39a86b['where']=qs[_0xaa46('0x37')](_[_0xaa46('0x38')](_0x3e519b['query'],_0x1c7664[_0xaa46('0x37')]),_0x359094);if(_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x39')]){_0x39a86b['where']=_['merge'](_0x39a86b[_0xaa46('0x3a')],{'$or':_[_0xaa46('0x28')](_0x359094,function(_0x1a264d){if(_0x1a264d[_0xaa46('0x2c')]!==_0xaa46('0x3b')){var _0xb8eece={};_0xb8eece[_0x1a264d['name']]={'$like':'%'+_0x3e519b['query'][_0xaa46('0x39')]+'%'};return _0xb8eece;}})});}_0x39a86b=_['merge']({},_0x39a86b,_0x3e519b['options']);var _0xc74b11={'where':_0x39a86b['where']};return db['Automation']['count'](_0xc74b11)['then'](function(_0x58191f){_0x2417ff['count']=_0x58191f;if(_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x3c')]){_0x39a86b[_0xaa46('0x3d')]=[{'all':!![]}];}return db[_0xaa46('0x29')][_0xaa46('0x3e')](_0x39a86b);})[_0xaa46('0x22')](function(_0x3b6d62){_0x2417ff['rows']=_0x3b6d62;return _0x2417ff;})[_0xaa46('0x22')](respondWithFilteredResult(_0x417568,_0x39a86b))[_0xaa46('0x3f')](handleError(_0x417568,null));};exports[_0xaa46('0x40')]=function(_0x178fc7,_0x35b22e){var _0x5ad603={'raw':![],'where':{'id':_0x178fc7['params']['id']}},_0x53ea65={};_0x53ea65[_0xaa46('0x2d')]=_[_0xaa46('0x2f')](db['Automation'][_0xaa46('0x2a')]);_0x53ea65[_0xaa46('0x2e')]=_['keys'](_0x178fc7[_0xaa46('0x2e')]);_0x53ea65[_0xaa46('0x37')]=_['intersection'](_0x53ea65[_0xaa46('0x2d')],_0x53ea65['query']);_0x5ad603[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x53ea65[_0xaa46('0x2d')],qs[_0xaa46('0x32')](_0x178fc7['query'][_0xaa46('0x32')]));_0x5ad603['attributes']=_0x5ad603[_0xaa46('0x31')]['length']?_0x5ad603[_0xaa46('0x31')]:_0x53ea65[_0xaa46('0x2d')];if(_0x178fc7[_0xaa46('0x2e')]['includeAll']){_0x5ad603[_0xaa46('0x3d')]=[{'all':!![]}];}_0x5ad603=_['merge']({},_0x5ad603,_0x178fc7['options']);return db[_0xaa46('0x29')][_0xaa46('0x41')](_0x5ad603)[_0xaa46('0x22')](handleEntityNotFound(_0x35b22e,null))[_0xaa46('0x22')](respondWithResult(_0x35b22e,null))[_0xaa46('0x3f')](handleError(_0x35b22e,null));};exports[_0xaa46('0x42')]=function(_0x308b0c,_0x42b134){return db[_0xaa46('0x29')][_0xaa46('0x42')](_0x308b0c[_0xaa46('0x43')],{})['then'](respondWithResult(_0x42b134,0xc9))['catch'](handleError(_0x42b134,null));};exports[_0xaa46('0x21')]=function(_0x4bc34d,_0xa39b9c){if(_0x4bc34d['body']['id']){delete _0x4bc34d['body']['id'];}return db[_0xaa46('0x29')]['find']({'where':{'id':_0x4bc34d[_0xaa46('0x44')]['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0xa39b9c,null))[_0xaa46('0x22')](saveUpdates(_0x4bc34d[_0xaa46('0x43')],null))['then'](respondWithResult(_0xa39b9c,null))[_0xaa46('0x3f')](handleError(_0xa39b9c,null));};exports[_0xaa46('0x45')]=function(_0x4431a2,_0x40f30f){return db[_0xaa46('0x29')]['find']({'where':{'id':_0x4431a2[_0xaa46('0x44')]['id']}})['then'](handleEntityNotFound(_0x40f30f,null))[_0xaa46('0x22')](removeEntity(_0x40f30f,null))[_0xaa46('0x3f')](handleError(_0x40f30f,null));};exports[_0xaa46('0x46')]=function(_0x519743,_0x5c5df2,_0x50dd54){return db[_0xaa46('0x47')][_0xaa46('0x41')]({'where':{'id':_0x519743[_0xaa46('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c5df2,null))[_0xaa46('0x22')](function(_0x22b752){if(_0x22b752){return _0x22b752[_0xaa46('0x46')](_0x519743[_0xaa46('0x43')]['ids'],_[_0xaa46('0x48')](_0x519743['body'],[_0xaa46('0x49'),'id'])||{});}})['then'](respondWithResult(_0x5c5df2,null))[_0xaa46('0x3f')](handleError(_0x5c5df2,null));};exports[_0xaa46('0x4a')]=function(_0x38845c,_0x12a33e,_0x69d355){var _0xca2bcf={};var _0x55e184={};var _0x3c5d67;var _0x3a83c2;return db[_0xaa46('0x29')][_0xaa46('0x4b')]({'where':{'id':_0x38845c['params']['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0x12a33e,null))['then'](function(_0x11ee21){if(_0x11ee21){_0x3c5d67=_0x11ee21;_0x55e184[_0xaa46('0x2d')]=_[_0xaa46('0x2f')](db[_0xaa46('0x47')][_0xaa46('0x2a')]);_0x55e184[_0xaa46('0x2e')]=_[_0xaa46('0x2f')](_0x38845c[_0xaa46('0x2e')]);_0x55e184[_0xaa46('0x37')]=_['intersection'](_0x55e184['model'],_0x55e184[_0xaa46('0x2e')]);_0xca2bcf[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x55e184[_0xaa46('0x2d')],qs['fields'](_0x38845c[_0xaa46('0x2e')][_0xaa46('0x32')]));_0xca2bcf[_0xaa46('0x31')]=_0xca2bcf['attributes'][_0xaa46('0x33')]?_0xca2bcf[_0xaa46('0x31')]:_0x55e184[_0xaa46('0x2d')];_0xca2bcf[_0xaa46('0x4c')]=qs[_0xaa46('0x36')](_0x38845c[_0xaa46('0x2e')]['sort']);_0xca2bcf[_0xaa46('0x3a')]=qs['filters'](_[_0xaa46('0x38')](_0x38845c[_0xaa46('0x2e')],_0x55e184[_0xaa46('0x37')]));if(_0x38845c['query'][_0xaa46('0x39')]){_0xca2bcf[_0xaa46('0x3a')]=_[_0xaa46('0x4d')](_0xca2bcf[_0xaa46('0x3a')],{'$or':_[_0xaa46('0x28')](_0xca2bcf[_0xaa46('0x31')],function(_0x2aa9b6){var _0x2598a8={};_0x2598a8[_0x2aa9b6]={'$like':'%'+_0x38845c[_0xaa46('0x2e')][_0xaa46('0x39')]+'%'};return _0x2598a8;})});}_0xca2bcf=_['merge']({},_0xca2bcf,_0x38845c[_0xaa46('0x4e')]);return _0x3c5d67[_0xaa46('0x4a')](_0xca2bcf);}})[_0xaa46('0x22')](function(_0x4e7018){if(_0x4e7018){_0x3a83c2=_0x4e7018[_0xaa46('0x33')];if(!_0x38845c['query']['hasOwnProperty'](_0xaa46('0x35'))){_0xca2bcf[_0xaa46('0x1b')]=qs[_0xaa46('0x1b')](_0x38845c[_0xaa46('0x2e')][_0xaa46('0x1b')]);_0xca2bcf['offset']=qs[_0xaa46('0x1a')](_0x38845c['query'][_0xaa46('0x1a')]);}return _0x3c5d67[_0xaa46('0x4a')](_0xca2bcf);}})['then'](function(_0x1d72ec){if(_0x1d72ec){return _0x1d72ec?{'count':_0x3a83c2,'rows':_0x1d72ec}:null;}})[_0xaa46('0x22')](respondWithResult(_0x12a33e,null))['catch'](handleError(_0x12a33e,null));};exports[_0xaa46('0x4f')]=function(_0x3d68e3,_0x1a6a22,_0x47d991){return db[_0xaa46('0x50')][_0xaa46('0x41')]({'where':{'id':_0x3d68e3[_0xaa46('0x44')]['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0x1a6a22,null))[_0xaa46('0x22')](function(_0x14d38e){if(_0x14d38e){return _0x14d38e[_0xaa46('0x4f')](_0x3d68e3[_0xaa46('0x43')][_0xaa46('0x49')],_[_0xaa46('0x48')](_0x3d68e3['body'],[_0xaa46('0x49'),'id'])||{});}})['then'](respondWithResult(_0x1a6a22,null))[_0xaa46('0x3f')](handleError(_0x1a6a22,null));};exports[_0xaa46('0x51')]=function(_0x36644b,_0x89a16b,_0x1e6b88){var _0x4bc331={};var _0x495c01={};var _0x264c95;var _0x1f3c71;return db[_0xaa46('0x29')]['findOne']({'where':{'id':_0x36644b[_0xaa46('0x44')]['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0x89a16b,null))['then'](function(_0x4f7a52){if(_0x4f7a52){_0x264c95=_0x4f7a52;_0x495c01['model']=_[_0xaa46('0x2f')](db[_0xaa46('0x50')][_0xaa46('0x2a')]);_0x495c01[_0xaa46('0x2e')]=_[_0xaa46('0x2f')](_0x36644b[_0xaa46('0x2e')]);_0x495c01[_0xaa46('0x37')]=_[_0xaa46('0x30')](_0x495c01[_0xaa46('0x2d')],_0x495c01[_0xaa46('0x2e')]);_0x4bc331[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x495c01['model'],qs['fields'](_0x36644b[_0xaa46('0x2e')][_0xaa46('0x32')]));_0x4bc331[_0xaa46('0x31')]=_0x4bc331['attributes'][_0xaa46('0x33')]?_0x4bc331['attributes']:_0x495c01[_0xaa46('0x2d')];_0x4bc331[_0xaa46('0x4c')]=qs[_0xaa46('0x36')](_0x36644b[_0xaa46('0x2e')][_0xaa46('0x36')]);_0x4bc331[_0xaa46('0x3a')]=qs[_0xaa46('0x37')](_[_0xaa46('0x38')](_0x36644b[_0xaa46('0x2e')],_0x495c01['filters']));if(_0x36644b[_0xaa46('0x2e')]['filter']){_0x4bc331['where']=_['merge'](_0x4bc331[_0xaa46('0x3a')],{'$or':_[_0xaa46('0x28')](_0x4bc331[_0xaa46('0x31')],function(_0xba4730){var _0x190ef3={};_0x190ef3[_0xba4730]={'$like':'%'+_0x36644b[_0xaa46('0x2e')]['filter']+'%'};return _0x190ef3;})});}_0x4bc331=_[_0xaa46('0x4d')]({},_0x4bc331,_0x36644b[_0xaa46('0x4e')]);return _0x264c95['getActions'](_0x4bc331);}})[_0xaa46('0x22')](function(_0x296ddc){if(_0x296ddc){_0x1f3c71=_0x296ddc[_0xaa46('0x33')];if(!_0x36644b[_0xaa46('0x2e')][_0xaa46('0x34')]('nolimit')){_0x4bc331[_0xaa46('0x1b')]=qs[_0xaa46('0x1b')](_0x36644b['query'][_0xaa46('0x1b')]);_0x4bc331[_0xaa46('0x1a')]=qs['offset'](_0x36644b[_0xaa46('0x2e')][_0xaa46('0x1a')]);}return _0x264c95[_0xaa46('0x51')](_0x4bc331);}})[_0xaa46('0x22')](function(_0x19e51f){if(_0x19e51f){return _0x19e51f?{'count':_0x1f3c71,'rows':_0x19e51f}:null;}})[_0xaa46('0x22')](respondWithResult(_0x89a16b,null))['catch'](handleError(_0x89a16b,null));}; \ No newline at end of file +var _0xb229=['name','send','index','Automation','rawAttributes','fieldName','type','model','map','keys','query','attributes','intersection','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','addConditions','ids','getConditions','Condition','order','addActions','Action','omit','getActions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../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','then','destroy','error','stack'];(function(_0x17cb74,_0x53baa1){var _0x2a2c1e=function(_0x499418){while(--_0x499418){_0x17cb74['push'](_0x17cb74['shift']());}};_0x2a2c1e(++_0x53baa1);}(_0xb229,0x123));var _0x9b22=function(_0x4a13af,_0x5db35d){_0x4a13af=_0x4a13af-0x0;var _0xf3b735=_0xb229[_0x4a13af];return _0xf3b735;};'use strict';var emlformat=require(_0x9b22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b22('0x1'));var jsonpatch=require(_0x9b22('0x2'));var rp=require(_0x9b22('0x3'));var moment=require('moment');var BPromise=require(_0x9b22('0x4'));var Mustache=require(_0x9b22('0x5'));var util=require(_0x9b22('0x6'));var path=require('path');var sox=require(_0x9b22('0x7'));var csv=require(_0x9b22('0x8'));var ejs=require(_0x9b22('0x9'));var fs=require('fs');var fs_extra=require(_0x9b22('0xa'));var _=require(_0x9b22('0xb'));var squel=require(_0x9b22('0xc'));var crypto=require(_0x9b22('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9b22('0xe'));var toCsv=require(_0x9b22('0x8'));var querystring=require('querystring');var Papa=require(_0x9b22('0xf'));var Redis=require(_0x9b22('0x10'));var authService=require(_0x9b22('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b22('0x12'));var hardwareService=require(_0x9b22('0x13'));var logger=require(_0x9b22('0x14'))(_0x9b22('0x15'));var utils=require(_0x9b22('0x16'));var config=require(_0x9b22('0x17'));var licenseUtil=require(_0x9b22('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310d9d,_0xe5bec7){_0xe5bec7=_0xe5bec7||0xcc;return function(_0x14288e){if(_0x14288e){return _0x310d9d[_0x9b22('0x19')](_0xe5bec7);}return _0x310d9d[_0x9b22('0x1a')](_0xe5bec7)[_0x9b22('0x1b')]();};}function respondWithResult(_0x2c6b35,_0x33a0bf){_0x33a0bf=_0x33a0bf||0xc8;return function(_0x562c89){if(_0x562c89){return _0x2c6b35['status'](_0x33a0bf)[_0x9b22('0x1c')](_0x562c89);}};}function respondWithFilteredResult(_0x4e16e5,_0x1f3232){return function(_0x314023){if(_0x314023){var _0x118023=typeof _0x1f3232[_0x9b22('0x1d')]===_0x9b22('0x1e')&&typeof _0x1f3232[_0x9b22('0x1f')]==='undefined';var _0x58cae6=_0x314023[_0x9b22('0x20')];var _0x12df29=_0x118023?0x0:_0x1f3232[_0x9b22('0x1d')];var _0x52b69b=_0x118023?_0x314023['count']:_0x1f3232[_0x9b22('0x1d')]+_0x1f3232['limit'];var _0x22f5e5;if(_0x52b69b>=_0x58cae6){_0x52b69b=_0x58cae6;_0x22f5e5=0xc8;}else{_0x22f5e5=0xce;}_0x4e16e5[_0x9b22('0x1a')](_0x22f5e5);return _0x4e16e5[_0x9b22('0x21')](_0x9b22('0x22'),_0x12df29+'-'+_0x52b69b+'/'+_0x58cae6)[_0x9b22('0x1c')](_0x314023);}return null;};}function patchUpdates(_0x320600){return function(_0x56156e){try{jsonpatch['apply'](_0x56156e,_0x320600,!![]);}catch(_0x44b35f){return BPromise[_0x9b22('0x23')](_0x44b35f);}return _0x56156e['save']();};}function saveUpdates(_0x5c0acd,_0x46912d){return function(_0xae44a){if(_0xae44a){return _0xae44a[_0x9b22('0x24')](_0x5c0acd)[_0x9b22('0x25')](function(_0x40b22d){return _0x40b22d;});}return null;};}function removeEntity(_0x5720b8,_0x5c648b){return function(_0x433220){if(_0x433220){return _0x433220[_0x9b22('0x26')]()['then'](function(){_0x5720b8['status'](0xcc)[_0x9b22('0x1b')]();});}};}function handleEntityNotFound(_0x4b1a07,_0x1d24d6){return function(_0x532bed){if(!_0x532bed){_0x4b1a07[_0x9b22('0x19')](0x194);}return _0x532bed;};}function handleError(_0xf10a72,_0xc10d16){_0xc10d16=_0xc10d16||0x1f4;return function(_0x448c84){logger[_0x9b22('0x27')](_0x448c84[_0x9b22('0x28')]);if(_0x448c84[_0x9b22('0x29')]){delete _0x448c84[_0x9b22('0x29')];}_0xf10a72[_0x9b22('0x1a')](_0xc10d16)[_0x9b22('0x2a')](_0x448c84);};}exports[_0x9b22('0x2b')]=function(_0x2eba42,_0x28063){var _0x19217d={},_0x2c955d={},_0x11bc7c={'count':0x0,'rows':[]};var _0x3336d0=_['map'](db[_0x9b22('0x2c')][_0x9b22('0x2d')],function(_0x3261c1){return{'name':_0x3261c1[_0x9b22('0x2e')],'type':_0x3261c1[_0x9b22('0x2f')]['key']};});_0x2c955d[_0x9b22('0x30')]=_[_0x9b22('0x31')](_0x3336d0,_0x9b22('0x29'));_0x2c955d['query']=_[_0x9b22('0x32')](_0x2eba42[_0x9b22('0x33')]);_0x2c955d['filters']=_['intersection'](_0x2c955d['model'],_0x2c955d[_0x9b22('0x33')]);_0x19217d[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x2c955d[_0x9b22('0x30')],qs['fields'](_0x2eba42['query']['fields']));_0x19217d['attributes']=_0x19217d[_0x9b22('0x34')][_0x9b22('0x36')]?_0x19217d['attributes']:_0x2c955d[_0x9b22('0x30')];if(!_0x2eba42[_0x9b22('0x33')]['hasOwnProperty'](_0x9b22('0x37'))){_0x19217d[_0x9b22('0x1f')]=qs[_0x9b22('0x1f')](_0x2eba42[_0x9b22('0x33')][_0x9b22('0x1f')]);_0x19217d[_0x9b22('0x1d')]=qs[_0x9b22('0x1d')](_0x2eba42['query'][_0x9b22('0x1d')]);}_0x19217d['order']=qs['sort'](_0x2eba42[_0x9b22('0x33')][_0x9b22('0x38')]);_0x19217d[_0x9b22('0x39')]=qs[_0x9b22('0x3a')](_[_0x9b22('0x3b')](_0x2eba42['query'],_0x2c955d['filters']),_0x3336d0);if(_0x2eba42[_0x9b22('0x33')][_0x9b22('0x3c')]){_0x19217d[_0x9b22('0x39')]=_[_0x9b22('0x3d')](_0x19217d[_0x9b22('0x39')],{'$or':_['map'](_0x3336d0,function(_0x45ac59){if(_0x45ac59[_0x9b22('0x2f')]!=='VIRTUAL'){var _0x2e6f2b={};_0x2e6f2b[_0x45ac59['name']]={'$like':'%'+_0x2eba42[_0x9b22('0x33')]['filter']+'%'};return _0x2e6f2b;}})});}_0x19217d=_[_0x9b22('0x3d')]({},_0x19217d,_0x2eba42[_0x9b22('0x3e')]);var _0x1feb95={'where':_0x19217d[_0x9b22('0x39')]};return db[_0x9b22('0x2c')]['count'](_0x1feb95)['then'](function(_0x94247){_0x11bc7c[_0x9b22('0x20')]=_0x94247;if(_0x2eba42[_0x9b22('0x33')][_0x9b22('0x3f')]){_0x19217d[_0x9b22('0x40')]=[{'all':!![]}];}return db[_0x9b22('0x2c')][_0x9b22('0x41')](_0x19217d);})[_0x9b22('0x25')](function(_0x42e507){_0x11bc7c[_0x9b22('0x42')]=_0x42e507;return _0x11bc7c;})[_0x9b22('0x25')](respondWithFilteredResult(_0x28063,_0x19217d))[_0x9b22('0x43')](handleError(_0x28063,null));};exports['show']=function(_0x242a6e,_0x3f4c1e){var _0x499dd6={'raw':![],'where':{'id':_0x242a6e[_0x9b22('0x44')]['id']}},_0x15724e={};_0x15724e[_0x9b22('0x30')]=_[_0x9b22('0x32')](db[_0x9b22('0x2c')][_0x9b22('0x2d')]);_0x15724e[_0x9b22('0x33')]=_['keys'](_0x242a6e[_0x9b22('0x33')]);_0x15724e['filters']=_['intersection'](_0x15724e[_0x9b22('0x30')],_0x15724e[_0x9b22('0x33')]);_0x499dd6[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x15724e['model'],qs[_0x9b22('0x45')](_0x242a6e[_0x9b22('0x33')][_0x9b22('0x45')]));_0x499dd6[_0x9b22('0x34')]=_0x499dd6[_0x9b22('0x34')]['length']?_0x499dd6['attributes']:_0x15724e['model'];if(_0x242a6e[_0x9b22('0x33')][_0x9b22('0x3f')]){_0x499dd6['include']=[{'all':!![]}];}_0x499dd6=_[_0x9b22('0x3d')]({},_0x499dd6,_0x242a6e[_0x9b22('0x3e')]);return db[_0x9b22('0x2c')][_0x9b22('0x46')](_0x499dd6)[_0x9b22('0x25')](handleEntityNotFound(_0x3f4c1e,null))[_0x9b22('0x25')](respondWithResult(_0x3f4c1e,null))['catch'](handleError(_0x3f4c1e,null));};exports[_0x9b22('0x47')]=function(_0x2e3711,_0x381c37){return db[_0x9b22('0x2c')][_0x9b22('0x47')](_0x2e3711[_0x9b22('0x48')],{})[_0x9b22('0x25')](respondWithResult(_0x381c37,0xc9))[_0x9b22('0x43')](handleError(_0x381c37,null));};exports['update']=function(_0x28b8d9,_0x17305f){if(_0x28b8d9[_0x9b22('0x48')]['id']){delete _0x28b8d9['body']['id'];}return db[_0x9b22('0x2c')][_0x9b22('0x46')]({'where':{'id':_0x28b8d9['params']['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x17305f,null))[_0x9b22('0x25')](saveUpdates(_0x28b8d9[_0x9b22('0x48')],null))[_0x9b22('0x25')](respondWithResult(_0x17305f,null))['catch'](handleError(_0x17305f,null));};exports[_0x9b22('0x26')]=function(_0x2222e3,_0x1454a5){return db[_0x9b22('0x2c')]['find']({'where':{'id':_0x2222e3['params']['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x1454a5,null))[_0x9b22('0x25')](removeEntity(_0x1454a5,null))[_0x9b22('0x43')](handleError(_0x1454a5,null));};exports[_0x9b22('0x49')]=function(_0xbbd6d0,_0x2237bb,_0x305db3){return db['Condition'][_0x9b22('0x46')]({'where':{'id':_0xbbd6d0['params']['id']}})['then'](handleEntityNotFound(_0x2237bb,null))[_0x9b22('0x25')](function(_0x380594){if(_0x380594){return _0x380594['addConditions'](_0xbbd6d0[_0x9b22('0x48')][_0x9b22('0x4a')],_['omit'](_0xbbd6d0[_0x9b22('0x48')],[_0x9b22('0x4a'),'id'])||{});}})[_0x9b22('0x25')](respondWithResult(_0x2237bb,null))[_0x9b22('0x43')](handleError(_0x2237bb,null));};exports[_0x9b22('0x4b')]=function(_0x21556a,_0x4e024a,_0x1ad937){var _0x52acc1={};var _0x2791ca={};var _0x339583;var _0x28d619;return db[_0x9b22('0x2c')]['findOne']({'where':{'id':_0x21556a[_0x9b22('0x44')]['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x4e024a,null))[_0x9b22('0x25')](function(_0x59e2fc){if(_0x59e2fc){_0x339583=_0x59e2fc;_0x2791ca[_0x9b22('0x30')]=_[_0x9b22('0x32')](db[_0x9b22('0x4c')]['rawAttributes']);_0x2791ca[_0x9b22('0x33')]=_[_0x9b22('0x32')](_0x21556a[_0x9b22('0x33')]);_0x2791ca[_0x9b22('0x3a')]=_[_0x9b22('0x35')](_0x2791ca[_0x9b22('0x30')],_0x2791ca[_0x9b22('0x33')]);_0x52acc1[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x2791ca[_0x9b22('0x30')],qs[_0x9b22('0x45')](_0x21556a[_0x9b22('0x33')]['fields']));_0x52acc1[_0x9b22('0x34')]=_0x52acc1[_0x9b22('0x34')][_0x9b22('0x36')]?_0x52acc1[_0x9b22('0x34')]:_0x2791ca[_0x9b22('0x30')];_0x52acc1[_0x9b22('0x4d')]=qs[_0x9b22('0x38')](_0x21556a['query'][_0x9b22('0x38')]);_0x52acc1[_0x9b22('0x39')]=qs['filters'](_[_0x9b22('0x3b')](_0x21556a[_0x9b22('0x33')],_0x2791ca[_0x9b22('0x3a')]));if(_0x21556a[_0x9b22('0x33')][_0x9b22('0x3c')]){_0x52acc1[_0x9b22('0x39')]=_[_0x9b22('0x3d')](_0x52acc1[_0x9b22('0x39')],{'$or':_[_0x9b22('0x31')](_0x52acc1[_0x9b22('0x34')],function(_0x6e48e3){var _0x10e234={};_0x10e234[_0x6e48e3]={'$like':'%'+_0x21556a[_0x9b22('0x33')]['filter']+'%'};return _0x10e234;})});}_0x52acc1=_['merge']({},_0x52acc1,_0x21556a['options']);return _0x339583[_0x9b22('0x4b')](_0x52acc1);}})[_0x9b22('0x25')](function(_0x43cd19){if(_0x43cd19){_0x28d619=_0x43cd19[_0x9b22('0x36')];if(!_0x21556a[_0x9b22('0x33')]['hasOwnProperty'](_0x9b22('0x37'))){_0x52acc1[_0x9b22('0x1f')]=qs[_0x9b22('0x1f')](_0x21556a[_0x9b22('0x33')][_0x9b22('0x1f')]);_0x52acc1['offset']=qs[_0x9b22('0x1d')](_0x21556a[_0x9b22('0x33')][_0x9b22('0x1d')]);}return _0x339583['getConditions'](_0x52acc1);}})[_0x9b22('0x25')](function(_0x222027){if(_0x222027){return _0x222027?{'count':_0x28d619,'rows':_0x222027}:null;}})[_0x9b22('0x25')](respondWithResult(_0x4e024a,null))[_0x9b22('0x43')](handleError(_0x4e024a,null));};exports[_0x9b22('0x4e')]=function(_0x164b2b,_0x52014c,_0x590b2c){return db[_0x9b22('0x4f')][_0x9b22('0x46')]({'where':{'id':_0x164b2b[_0x9b22('0x44')]['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x52014c,null))[_0x9b22('0x25')](function(_0x50ea40){if(_0x50ea40){return _0x50ea40[_0x9b22('0x4e')](_0x164b2b[_0x9b22('0x48')][_0x9b22('0x4a')],_[_0x9b22('0x50')](_0x164b2b[_0x9b22('0x48')],[_0x9b22('0x4a'),'id'])||{});}})[_0x9b22('0x25')](respondWithResult(_0x52014c,null))[_0x9b22('0x43')](handleError(_0x52014c,null));};exports[_0x9b22('0x51')]=function(_0x99e79d,_0x4cca0e,_0x43f8ff){var _0x2a6626={};var _0x389bd1={};var _0xb9f9a4;var _0x5f5c08;return db[_0x9b22('0x2c')][_0x9b22('0x52')]({'where':{'id':_0x99e79d[_0x9b22('0x44')]['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x4cca0e,null))[_0x9b22('0x25')](function(_0x58c160){if(_0x58c160){_0xb9f9a4=_0x58c160;_0x389bd1[_0x9b22('0x30')]=_[_0x9b22('0x32')](db[_0x9b22('0x4f')][_0x9b22('0x2d')]);_0x389bd1['query']=_[_0x9b22('0x32')](_0x99e79d[_0x9b22('0x33')]);_0x389bd1[_0x9b22('0x3a')]=_['intersection'](_0x389bd1[_0x9b22('0x30')],_0x389bd1[_0x9b22('0x33')]);_0x2a6626[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x389bd1[_0x9b22('0x30')],qs[_0x9b22('0x45')](_0x99e79d[_0x9b22('0x33')]['fields']));_0x2a6626[_0x9b22('0x34')]=_0x2a6626[_0x9b22('0x34')]['length']?_0x2a6626[_0x9b22('0x34')]:_0x389bd1[_0x9b22('0x30')];_0x2a6626[_0x9b22('0x4d')]=qs[_0x9b22('0x38')](_0x99e79d[_0x9b22('0x33')][_0x9b22('0x38')]);_0x2a6626['where']=qs[_0x9b22('0x3a')](_[_0x9b22('0x3b')](_0x99e79d[_0x9b22('0x33')],_0x389bd1[_0x9b22('0x3a')]));if(_0x99e79d[_0x9b22('0x33')][_0x9b22('0x3c')]){_0x2a6626[_0x9b22('0x39')]=_[_0x9b22('0x3d')](_0x2a6626[_0x9b22('0x39')],{'$or':_[_0x9b22('0x31')](_0x2a6626['attributes'],function(_0x3eb166){var _0x3642df={};_0x3642df[_0x3eb166]={'$like':'%'+_0x99e79d[_0x9b22('0x33')][_0x9b22('0x3c')]+'%'};return _0x3642df;})});}_0x2a6626=_[_0x9b22('0x3d')]({},_0x2a6626,_0x99e79d['options']);return _0xb9f9a4[_0x9b22('0x51')](_0x2a6626);}})[_0x9b22('0x25')](function(_0x53624f){if(_0x53624f){_0x5f5c08=_0x53624f['length'];if(!_0x99e79d[_0x9b22('0x33')]['hasOwnProperty']('nolimit')){_0x2a6626['limit']=qs[_0x9b22('0x1f')](_0x99e79d['query'][_0x9b22('0x1f')]);_0x2a6626['offset']=qs[_0x9b22('0x1d')](_0x99e79d[_0x9b22('0x33')]['offset']);}return _0xb9f9a4[_0x9b22('0x51')](_0x2a6626);}})[_0x9b22('0x25')](function(_0x2f7d39){if(_0x2f7d39){return _0x2f7d39?{'count':_0x5f5c08,'rows':_0x2f7d39}:null;}})[_0x9b22('0x25')](respondWithResult(_0x4cca0e,null))[_0x9b22('0x43')](handleError(_0x4cca0e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f0aa5b9..8d6743c 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 _0x26df=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x34d892,_0x3d97c6){var _0x443bc6=function(_0x2cb0ff){while(--_0x2cb0ff){_0x34d892['push'](_0x34d892['shift']());}};_0x443bc6(++_0x3d97c6);}(_0x26df,0x1a3));var _0xf26d=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x26df[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xf26d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf26d('0x1'));var moment=require(_0xf26d('0x2'));var BPromise=require(_0xf26d('0x3'));var rp=require(_0xf26d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf26d('0x5'));var config=require(_0xf26d('0x6'));var attributes=require(_0xf26d('0x7'));module[_0xf26d('0x8')]=function(_0x6a2f23,_0xdeff30){return _0x6a2f23[_0xf26d('0x9')](_0xf26d('0xa'),attributes,{'tableName':_0xf26d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6479=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','util','../../config/logger','moment','bluebird'];(function(_0x16a4e2,_0x416fbc){var _0x4de8e1=function(_0x378820){while(--_0x378820){_0x16a4e2['push'](_0x16a4e2['shift']());}};_0x4de8e1(++_0x416fbc);}(_0x6479,0x1dc));var _0x9647=function(_0x3a9d77,_0xdc466){_0x3a9d77=_0x3a9d77-0x0;var _0x130f80=_0x6479[_0x3a9d77];return _0x130f80;};'use strict';var _=require('lodash');var util=require(_0x9647('0x0'));var logger=require(_0x9647('0x1'))('api');var moment=require(_0x9647('0x2'));var BPromise=require(_0x9647('0x3'));var rp=require(_0x9647('0x4'));var fs=require('fs');var path=require(_0x9647('0x5'));var rimraf=require(_0x9647('0x6'));var config=require(_0x9647('0x7'));var attributes=require(_0x9647('0x8'));module[_0x9647('0x9')]=function(_0x3ed50b,_0x3d53b3){return _0x3ed50b[_0x9647('0xa')](_0x9647('0xb'),attributes,{'tableName':'tools_automations','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 5336ac0..4c664bf 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 _0x5fdc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring'];(function(_0x46e439,_0x47edec){var _0x3a8e2a=function(_0x17d9fc){while(--_0x17d9fc){_0x46e439['push'](_0x46e439['shift']());}};_0x3a8e2a(++_0x47edec);}(_0x5fdc,0x127));var _0xc5fd=function(_0x46dee4,_0x1d26f3){_0x46dee4=_0x46dee4-0x0;var _0x577d82=_0x5fdc[_0x46dee4];return _0x577d82;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('Automation,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});} \ No newline at end of file +var _0xb9e7=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0xb9e7[_0x3c6ae2];return _0x4edda;};'use strict';var _=require('lodash');var util=require(_0x7b9e('0x0'));var moment=require(_0x7b9e('0x1'));var BPromise=require(_0x7b9e('0x2'));var rs=require(_0x7b9e('0x3'));var fs=require('fs');var Redis=require(_0x7b9e('0x4'));var db=require(_0x7b9e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b9e('0x6'))(_0x7b9e('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b9e('0x8'));var client=jayson['client'][_0x7b9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ea3,_0x14e025,_0x9b53ea){return new BPromise(function(_0x30d1d8,_0x5c358c){return client[_0x7b9e('0xa')](_0x3e7ea3,_0x9b53ea)[_0x7b9e('0xb')](function(_0xb35b20){logger['info'](_0x7b9e('0xc'),_0x14e025,'request\x20sent');logger[_0x7b9e('0xd')](_0x7b9e('0xe'),_0x14e025,'request\x20sent',JSON['stringify'](_0xb35b20));if(_0xb35b20[_0x7b9e('0xf')]){if(_0xb35b20['error'][_0x7b9e('0x10')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x14e025,_0xb35b20['error'][_0x7b9e('0x11')]);return _0x5c358c(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}logger[_0x7b9e('0xf')]('Automation,\x20%s,\x20%s',_0x14e025,_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);return _0x30d1d8(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}else{logger[_0x7b9e('0x12')](_0x7b9e('0xc'),_0x14e025,_0x7b9e('0x13'));_0x30d1d8(_0xb35b20[_0x7b9e('0x14')][_0x7b9e('0x11')]);}})[_0x7b9e('0x15')](function(_0x49e88c){logger[_0x7b9e('0xf')]('Automation,\x20%s,\x20%s',_0x14e025,_0x49e88c);_0x5c358c(_0x49e88c);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 8cf6247..4005377 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 _0x15ab=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','index','/:id','isAuthenticated','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete'];(function(_0x180c49,_0x403808){var _0x406f6d=function(_0x4b7cbc){while(--_0x4b7cbc){_0x180c49['push'](_0x180c49['shift']());}};_0x406f6d(++_0x403808);}(_0x15ab,0xda));var _0xb15a=function(_0x559fa3,_0x22fabc){_0x559fa3=_0x559fa3-0x0;var _0x571dbb=_0x15ab[_0x559fa3];return _0x571dbb;};'use strict';var multer=require(_0xb15a('0x0'));var util=require(_0xb15a('0x1'));var path=require(_0xb15a('0x2'));var timeout=require(_0xb15a('0x3'));var express=require(_0xb15a('0x4'));var router=express[_0xb15a('0x5')]();var fs_extra=require(_0xb15a('0x6'));var auth=require(_0xb15a('0x7'));var interaction=require(_0xb15a('0x8'));var config=require('../../config/environment');var controller=require(_0xb15a('0x9'));router[_0xb15a('0xa')]('/',auth['isAuthenticated'](),controller[_0xb15a('0xb')]);router['get'](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller['show']);router[_0xb15a('0xa')](_0xb15a('0xe'),auth[_0xb15a('0xd')](),controller[_0xb15a('0xf')]);router[_0xb15a('0xa')](_0xb15a('0x10'),auth[_0xb15a('0xd')](),controller['getActions']);router[_0xb15a('0x11')]('/',auth[_0xb15a('0xd')](),controller[_0xb15a('0x12')]);router[_0xb15a('0x11')](_0xb15a('0xe'),auth[_0xb15a('0xd')](),controller['addConditions']);router['post']('/:id/actions',auth[_0xb15a('0xd')](),controller[_0xb15a('0x13')]);router[_0xb15a('0x14')](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller['update']);router[_0xb15a('0x15')](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x16')]);module[_0xb15a('0x17')]=router; \ No newline at end of file +var _0x9ef8=['put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/conditions','/:id/actions','post','create','addConditions'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x9ef8,0x17f));var _0x89ef=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9ef8[_0x22b68a];return _0x1ac67a;};'use strict';var multer=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var path=require('path');var timeout=require(_0x89ef('0x2'));var express=require(_0x89ef('0x3'));var router=express[_0x89ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89ef('0x5'));var interaction=require(_0x89ef('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router['get']('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0x8')]);router[_0x89ef('0x9')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xb')]);router[_0x89ef('0x9')](_0x89ef('0xc'),auth[_0x89ef('0x7')](),controller['getConditions']);router[_0x89ef('0x9')](_0x89ef('0xd'),auth[_0x89ef('0x7')](),controller['getActions']);router[_0x89ef('0xe')]('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0xf')]);router[_0x89ef('0xe')](_0x89ef('0xc'),auth['isAuthenticated'](),controller[_0x89ef('0x10')]);router['post'](_0x89ef('0xd'),auth[_0x89ef('0x7')](),controller['addActions']);router[_0x89ef('0x11')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0x12')]);router[_0x89ef('0x13')]('/:id',auth[_0x89ef('0x7')](),controller['destroy']);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 f6b46a2..0ebbe8f 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 _0xe502=['never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x3550ae,_0x13c5ce){var _0x441355=function(_0x3450a0){while(--_0x3450a0){_0x3550ae['push'](_0x3550ae['shift']());}};_0x441355(++_0x13c5ce);}(_0xe502,0x17c));var _0x2e50=function(_0x408aa8,_0x54b16e){_0x408aa8=_0x408aa8-0x0;var _0x8d1da7=_0xe502[_0x408aa8];return _0x8d1da7;};'use strict';var Sequelize=require('sequelize');module[_0x2e50('0x0')]={'name':{'type':Sequelize[_0x2e50('0x1')],'unique':_0x2e50('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2e50('0x3')](_0x2e50('0x4')),'allowNull':![],'defaultValue':_0x2e50('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x2e50('0x5')],'defaultValue':0x0,'comment':_0x2e50('0x6')},'limitCalls':{'type':Sequelize[_0x2e50('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x2e50('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2e50('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2e50('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2e50('0x1')],'defaultValue':_0x2e50('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x2e50('0x3')]('always',_0x2e50('0x10'),_0x2e50('0x11')),'defaultValue':_0x2e50('0x12')},'dialAMDActive':{'type':Sequelize[_0x2e50('0x5')],'defaultValue':0x0,'comment':_0x2e50('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2e50('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2e50('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2e50('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2e50('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x2e50('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2e50('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2e50('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2e50('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2e50('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2e50('0x3')](_0x2e50('0x1b'),_0x2e50('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x2e50('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2e50('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x4ce1=['name','ivr','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\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','STRING'];(function(_0x4c5934,_0x364a26){var _0x2b3204=function(_0x176b51){while(--_0x176b51){_0x4c5934['push'](_0x4c5934['shift']());}};_0x2b3204(++_0x364a26);}(_0x4ce1,0xca));var _0x14ce=function(_0x1ab735,_0x1dd5a8){_0x1ab735=_0x1ab735-0x0;var _0xec8fe8=_0x4ce1[_0x1ab735];return _0xec8fe8;};'use strict';var Sequelize=require(_0x14ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x14ce('0x1')],'unique':_0x14ce('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x14ce('0x3')),'allowNull':![],'defaultValue':_0x14ce('0x3')},'description':{'type':Sequelize[_0x14ce('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x14ce('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x14ce('0x5')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x14ce('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'comment':_0x14ce('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x14ce('0xc')},'dialTimezone':{'type':Sequelize[_0x14ce('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x14ce('0xd')](_0x14ce('0xe'),_0x14ce('0xf'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x14ce('0x10')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x14ce('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x14ce('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x14ce('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x14ce('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x14ce('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x14ce('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x14ce('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14ce('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x14ce('0x17'),_0x14ce('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x14ce('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14ce('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x14ce('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14ce('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('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 5effc26..d9a0b5f 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 _0x9703=['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','clone','omit','createdAt','updatedAt','update','destroy','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','CmHopperBlack','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','set','Content-Range','json','reject','save','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','Campaign','findAll','rows','catch','params','rawAttributes','fields','options'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9703,0xdb));var _0x3970=function(_0x546278,_0x9c3521){_0x546278=_0x546278-0x0;var _0x3f0647=_0x9703[_0x546278];return _0x3f0647;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3970('0x0'));var jsonpatch=require(_0x3970('0x1'));var rp=require(_0x3970('0x2'));var moment=require('moment');var BPromise=require(_0x3970('0x3'));var Mustache=require('mustache');var util=require(_0x3970('0x4'));var path=require('path');var sox=require(_0x3970('0x5'));var csv=require(_0x3970('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3970('0x7'));var squel=require(_0x3970('0x8'));var crypto=require(_0x3970('0x9'));var jsforce=require(_0x3970('0xa'));var deskjs=require(_0x3970('0xb'));var toCsv=require(_0x3970('0x6'));var querystring=require(_0x3970('0xc'));var Papa=require(_0x3970('0xd'));var Redis=require('ioredis');var authService=require(_0x3970('0xe'));var qs=require(_0x3970('0xf'));var as=require(_0x3970('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3970('0x11'))(_0x3970('0x12'));var utils=require('../../config/utils');var config=require(_0x3970('0x13'));var licenseUtil=require(_0x3970('0x14'));var db=require(_0x3970('0x15'))['db'];function respondWithStatusCode(_0x261275,_0x5920fb){_0x5920fb=_0x5920fb||0xcc;return function(_0x116af8){if(_0x116af8){return _0x261275[_0x3970('0x16')](_0x5920fb);}return _0x261275[_0x3970('0x17')](_0x5920fb)[_0x3970('0x18')]();};}function respondWithResult(_0x1cd5d9,_0x1089c0){_0x1089c0=_0x1089c0||0xc8;return function(_0x1dc283){if(_0x1dc283){return _0x1cd5d9[_0x3970('0x17')](_0x1089c0)['json'](_0x1dc283);}};}function respondWithFilteredResult(_0x1a617c,_0x176652){return function(_0x4de4ee){if(_0x4de4ee){var _0x21f297=typeof _0x176652[_0x3970('0x19')]==='undefined'&&typeof _0x176652['limit']==='undefined';var _0x3743c4=_0x4de4ee[_0x3970('0x1a')];var _0x5747a2=_0x21f297?0x0:_0x176652['offset'];var _0x21bd6b=_0x21f297?_0x4de4ee[_0x3970('0x1a')]:_0x176652[_0x3970('0x19')]+_0x176652['limit'];var _0x4bef3d;if(_0x21bd6b>=_0x3743c4){_0x21bd6b=_0x3743c4;_0x4bef3d=0xc8;}else{_0x4bef3d=0xce;}_0x1a617c[_0x3970('0x17')](_0x4bef3d);return _0x1a617c[_0x3970('0x1b')](_0x3970('0x1c'),_0x5747a2+'-'+_0x21bd6b+'/'+_0x3743c4)[_0x3970('0x1d')](_0x4de4ee);}return null;};}function patchUpdates(_0x3c865){return function(_0x14b28b){try{jsonpatch['apply'](_0x14b28b,_0x3c865,!![]);}catch(_0x475742){return BPromise[_0x3970('0x1e')](_0x475742);}return _0x14b28b[_0x3970('0x1f')]();};}function saveUpdates(_0x112fd0,_0x2058c5){return function(_0x308370){if(_0x308370){return _0x308370['update'](_0x112fd0)[_0x3970('0x20')](function(_0x48f9a5){return _0x48f9a5;});}return null;};}function removeEntity(_0x20f35b,_0x5f3d74){return function(_0xf010ac){if(_0xf010ac){return _0xf010ac['destroy']()[_0x3970('0x20')](function(){var _0x19f504=_0xf010ac[_0x3970('0x21')]({'plain':!![]});var _0x3889a7=_0x3970('0x22');return db[_0x3970('0x23')]['destroy']({'where':{'type':_0x3889a7,'resourceId':_0x19f504['id']}})[_0x3970('0x20')](function(){return _0xf010ac;});})[_0x3970('0x20')](function(){_0x20f35b[_0x3970('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37479f,_0x26cd59){return function(_0x5c34ef){if(!_0x5c34ef){_0x37479f[_0x3970('0x16')](0x194);}return _0x5c34ef;};}function handleError(_0x4e7ac6,_0x486ab9){_0x486ab9=_0x486ab9||0x1f4;return function(_0x544f15){logger[_0x3970('0x24')](_0x544f15[_0x3970('0x25')]);if(_0x544f15[_0x3970('0x26')]){delete _0x544f15[_0x3970('0x26')];}_0x4e7ac6[_0x3970('0x17')](_0x486ab9)[_0x3970('0x27')](_0x544f15);};}exports['index']=function(_0x4ec998,_0x1f0f0c){var _0x1a36da={},_0x4e2874={},_0x206cf1={'count':0x0,'rows':[]};var _0x15556e=_[_0x3970('0x28')](db['Campaign']['rawAttributes'],function(_0x5b8664){return{'name':_0x5b8664[_0x3970('0x29')],'type':_0x5b8664[_0x3970('0x2a')][_0x3970('0x2b')]};});_0x4e2874['model']=_[_0x3970('0x28')](_0x15556e,_0x3970('0x26'));_0x4e2874[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x4ec998[_0x3970('0x2c')]);_0x4e2874[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x4e2874[_0x3970('0x30')],_0x4e2874[_0x3970('0x2c')]);_0x1a36da['attributes']=_[_0x3970('0x2f')](_0x4e2874[_0x3970('0x30')],qs['fields'](_0x4ec998[_0x3970('0x2c')]['fields']));_0x1a36da[_0x3970('0x31')]=_0x1a36da[_0x3970('0x31')][_0x3970('0x32')]?_0x1a36da[_0x3970('0x31')]:_0x4e2874[_0x3970('0x30')];if(!_0x4ec998['query'][_0x3970('0x33')](_0x3970('0x34'))){_0x1a36da['limit']=qs[_0x3970('0x35')](_0x4ec998[_0x3970('0x2c')][_0x3970('0x35')]);_0x1a36da[_0x3970('0x19')]=qs['offset'](_0x4ec998[_0x3970('0x2c')][_0x3970('0x19')]);}_0x1a36da[_0x3970('0x36')]=qs[_0x3970('0x37')](_0x4ec998[_0x3970('0x2c')]['sort']);_0x1a36da['where']=qs[_0x3970('0x2e')](_[_0x3970('0x38')](_0x4ec998[_0x3970('0x2c')],_0x4e2874[_0x3970('0x2e')]),_0x15556e);if(_0x4ec998['query'][_0x3970('0x39')]){_0x1a36da[_0x3970('0x3a')]=_[_0x3970('0x3b')](_0x1a36da[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x15556e,function(_0xd6d13d){if(_0xd6d13d[_0x3970('0x2a')]!==_0x3970('0x3c')){var _0x5f09f2={};_0x5f09f2[_0xd6d13d['name']]={'$like':'%'+_0x4ec998[_0x3970('0x2c')][_0x3970('0x39')]+'%'};return _0x5f09f2;}})});}_0x1a36da=_['merge']({},_0x1a36da,_0x4ec998['options']);var _0x478369={'where':_0x1a36da[_0x3970('0x3a')]};return db['Campaign'][_0x3970('0x1a')](_0x478369)['then'](function(_0x496963){_0x206cf1[_0x3970('0x1a')]=_0x496963;if(_0x4ec998[_0x3970('0x2c')][_0x3970('0x3d')]){_0x1a36da[_0x3970('0x3e')]=[{'all':!![]}];}return db[_0x3970('0x3f')][_0x3970('0x40')](_0x1a36da);})[_0x3970('0x20')](function(_0x448538){_0x206cf1[_0x3970('0x41')]=_0x448538;return _0x206cf1;})[_0x3970('0x20')](respondWithFilteredResult(_0x1f0f0c,_0x1a36da))[_0x3970('0x42')](handleError(_0x1f0f0c,null));};exports['show']=function(_0x4dfbe1,_0x309e75){var _0x1623a2={'raw':![],'where':{'id':_0x4dfbe1[_0x3970('0x43')]['id']}},_0x851b79={};_0x851b79['model']=_[_0x3970('0x2d')](db['Campaign'][_0x3970('0x44')]);_0x851b79[_0x3970('0x2c')]=_['keys'](_0x4dfbe1['query']);_0x851b79['filters']=_['intersection'](_0x851b79[_0x3970('0x30')],_0x851b79[_0x3970('0x2c')]);_0x1623a2['attributes']=_[_0x3970('0x2f')](_0x851b79[_0x3970('0x30')],qs['fields'](_0x4dfbe1[_0x3970('0x2c')][_0x3970('0x45')]));_0x1623a2['attributes']=_0x1623a2[_0x3970('0x31')][_0x3970('0x32')]?_0x1623a2['attributes']:_0x851b79[_0x3970('0x30')];if(_0x4dfbe1['query'][_0x3970('0x3d')]){_0x1623a2[_0x3970('0x3e')]=[{'all':!![]}];}_0x1623a2=_[_0x3970('0x3b')]({},_0x1623a2,_0x4dfbe1[_0x3970('0x46')]);return db[_0x3970('0x3f')]['find'](_0x1623a2)['then'](handleEntityNotFound(_0x309e75,null))['then'](respondWithResult(_0x309e75,null))[_0x3970('0x42')](handleError(_0x309e75,null));};exports[_0x3970('0x47')]=function(_0x18bd6e,_0x238c4f){return db[_0x3970('0x3f')][_0x3970('0x47')](_0x18bd6e[_0x3970('0x48')],{})[_0x3970('0x20')](function(_0x2ee650){var _0x56152d=_0x18bd6e[_0x3970('0x49')][_0x3970('0x21')]({'plain':!![]});if(!_0x56152d)throw new Error(_0x3970('0x4a'));if(_0x56152d[_0x3970('0x4b')]===_0x3970('0x49')){var _0x27ecb7=_0x2ee650['get']({'plain':!![]});var _0x5686a4=_0x3970('0x22');return db[_0x3970('0x4c')][_0x3970('0x4d')]({'where':{'name':_0x5686a4,'userProfileId':_0x56152d[_0x3970('0x4e')]},'raw':!![]})[_0x3970('0x20')](function(_0x303250){if(_0x303250&&_0x303250[_0x3970('0x4f')]===0x0){return db[_0x3970('0x23')][_0x3970('0x47')]({'name':_0x27ecb7['name'],'resourceId':_0x27ecb7['id'],'type':_0x303250['name'],'sectionId':_0x303250['id']},{})[_0x3970('0x20')](function(){return _0x2ee650;});}else{return _0x2ee650;}})[_0x3970('0x42')](function(_0x1630ec){logger[_0x3970('0x24')](_0x3970('0x50'),_0x1630ec);throw _0x1630ec;});}return _0x2ee650;})[_0x3970('0x20')](respondWithResult(_0x238c4f,0xc9))[_0x3970('0x42')](handleError(_0x238c4f,null));};exports[_0x3970('0x51')]=function(_0x5758ff,_0x59678d){var _0x4f788b={'where':{'id':_0x5758ff[_0x3970('0x43')]['id']}},_0x190bd0={};_0x190bd0['model']=_[_0x3970('0x2d')](db['Campaign']['rawAttributes']);_0x4f788b[_0x3970('0x31')]=_[_0x3970('0x2f')](_0x190bd0[_0x3970('0x30')],qs[_0x3970('0x45')](_0x5758ff[_0x3970('0x2c')][_0x3970('0x45')]));_0x4f788b[_0x3970('0x31')]=_0x4f788b[_0x3970('0x31')]['length']?_0x4f788b['attributes']:_0x190bd0[_0x3970('0x30')];if(_0x5758ff[_0x3970('0x2c')][_0x3970('0x3d')]){_0x4f788b[_0x3970('0x3e')]=[{'all':!![]}];}_0x4f788b=_[_0x3970('0x3b')]({},_0x4f788b,_0x5758ff['options']);return db[_0x3970('0x3f')][_0x3970('0x4d')](_0x4f788b)['then'](handleEntityNotFound(_0x59678d,null))[_0x3970('0x20')](function(_0x247cc3){if(_0x247cc3){var _0x47f28b=_0x247cc3['get']({'plain':!![]});_0x47f28b=qs[_0x3970('0x52')](_0x47f28b,['id',_0x3970('0x53'),_0x3970('0x54')]);_0x5758ff[_0x3970('0x48')]=_[_0x3970('0x52')](_0x5758ff[_0x3970('0x48')],['id',_0x3970('0x53'),_0x3970('0x54')]);return db['Campaign'][_0x3970('0x47')](_[_0x3970('0x3b')](_0x47f28b,_0x5758ff[_0x3970('0x48')]),{'include':_0x5758ff['query'][_0x3970('0x3d')]?[{'all':!![]}]:undefined})[_0x3970('0x20')](function(_0x5402dc){var _0x3773a6=_0x5758ff['user'][_0x3970('0x21')]({'plain':!![]});if(!_0x3773a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3773a6[_0x3970('0x4b')]===_0x3970('0x49')){var _0x68ac1=_0x5402dc[_0x3970('0x21')]({'plain':!![]});var _0x5c54aa=_0x3970('0x22');return db[_0x3970('0x4c')][_0x3970('0x4d')]({'where':{'name':_0x5c54aa,'userProfileId':_0x3773a6[_0x3970('0x4e')]},'raw':!![]})[_0x3970('0x20')](function(_0x249764){if(_0x249764&&_0x249764[_0x3970('0x4f')]===0x0){return db[_0x3970('0x23')][_0x3970('0x47')]({'name':_0x68ac1[_0x3970('0x26')],'resourceId':_0x68ac1['id'],'type':_0x249764[_0x3970('0x26')],'sectionId':_0x249764['id']},{})[_0x3970('0x20')](function(){return _0x5402dc;});}else{return _0x5402dc;}})[_0x3970('0x42')](function(_0x2f1372){logger[_0x3970('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f1372);throw _0x2f1372;});}return _0x5402dc;});}})[_0x3970('0x20')](respondWithResult(_0x59678d,0xc9))['catch'](handleError(_0x59678d,null));};exports[_0x3970('0x55')]=function(_0x535f69,_0x1f33ea){if(_0x535f69['body']['id']){delete _0x535f69[_0x3970('0x48')]['id'];}return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x535f69[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x1f33ea,null))[_0x3970('0x20')](saveUpdates(_0x535f69[_0x3970('0x48')],null))[_0x3970('0x20')](respondWithResult(_0x1f33ea,null))[_0x3970('0x42')](handleError(_0x1f33ea,null));};exports[_0x3970('0x56')]=function(_0x19913a,_0xe6e639){return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x19913a[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0xe6e639,null))[_0x3970('0x20')](removeEntity(_0xe6e639,null))[_0x3970('0x42')](handleError(_0xe6e639,null));};exports['getHoppers']=function(_0x93ad95,_0x85819b,_0x2155f9){var _0x549e19={'raw':!![],'where':{}};var _0xbe56d9={};var _0x2031cd={'count':0x0,'rows':[]};return db['Campaign'][_0x3970('0x57')]({'where':{'id':_0x93ad95[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x85819b,null))[_0x3970('0x20')](function(_0x124dfd){if(_0x124dfd){_0xbe56d9[_0x3970('0x30')]=_[_0x3970('0x2d')](db[_0x3970('0x58')][_0x3970('0x44')]);_0xbe56d9[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x93ad95[_0x3970('0x2c')]);_0xbe56d9[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0xbe56d9[_0x3970('0x30')],_0xbe56d9[_0x3970('0x2c')]);_0x549e19['attributes']=_[_0x3970('0x2f')](_0xbe56d9['model'],qs['fields'](_0x93ad95[_0x3970('0x2c')][_0x3970('0x45')]));_0x549e19[_0x3970('0x31')]=_0x549e19['attributes'][_0x3970('0x32')]?_0x549e19[_0x3970('0x31')]:_0xbe56d9[_0x3970('0x30')];if(!_0x93ad95[_0x3970('0x2c')][_0x3970('0x33')]('nolimit')){_0x549e19[_0x3970('0x35')]=qs['limit'](_0x93ad95['query'][_0x3970('0x35')]);_0x549e19[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x93ad95[_0x3970('0x2c')][_0x3970('0x19')]);}_0x549e19[_0x3970('0x36')]=qs['sort'](_0x93ad95[_0x3970('0x2c')][_0x3970('0x37')]);_0x549e19[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_[_0x3970('0x38')](_0x93ad95[_0x3970('0x2c')],_0xbe56d9['filters']));_0x549e19['where'][_0x3970('0x59')]=_0x124dfd['id'];if(_0x93ad95[_0x3970('0x2c')][_0x3970('0x39')]){_0x549e19[_0x3970('0x3a')]=_[_0x3970('0x3b')](_0x549e19[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x549e19['attributes'],function(_0xc4ec5f){var _0x2d5fc9={};_0x2d5fc9[_0xc4ec5f]={'$like':'%'+_0x93ad95[_0x3970('0x2c')][_0x3970('0x39')]+'%'};return _0x2d5fc9;})});}_0x549e19=_[_0x3970('0x3b')]({},_0x549e19,_0x93ad95['options']);return db[_0x3970('0x58')][_0x3970('0x1a')]({'where':_0x549e19[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0x301398){_0x2031cd['count']=_0x301398;if(_0x93ad95[_0x3970('0x2c')][_0x3970('0x3d')]){_0x549e19[_0x3970('0x3e')]=[{'all':!![]}];}return db['CmHopper'][_0x3970('0x40')](_0x549e19);})['then'](function(_0x5384bd){_0x2031cd[_0x3970('0x41')]=_0x5384bd;return _0x2031cd;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x85819b,_0x549e19))['catch'](handleError(_0x85819b,null));};exports['getHopperHistories']=function(_0x797568,_0x2fdcb7,_0x31d1ed){var _0x432231={'raw':!![],'where':{}};var _0x48df95={};var _0x1bb13e={'count':0x0,'rows':[]};return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x797568[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x2fdcb7,null))[_0x3970('0x20')](function(_0x5da887){if(_0x5da887){_0x48df95['model']=_[_0x3970('0x2d')](db[_0x3970('0x5a')]['rawAttributes']);_0x48df95[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x797568[_0x3970('0x2c')]);_0x48df95[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x48df95[_0x3970('0x30')],_0x48df95[_0x3970('0x2c')]);_0x432231[_0x3970('0x31')]=_[_0x3970('0x2f')](_0x48df95[_0x3970('0x30')],qs[_0x3970('0x45')](_0x797568[_0x3970('0x2c')][_0x3970('0x45')]));_0x432231[_0x3970('0x31')]=_0x432231['attributes'][_0x3970('0x32')]?_0x432231[_0x3970('0x31')]:_0x48df95[_0x3970('0x30')];if(!_0x797568[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x432231[_0x3970('0x35')]=qs['limit'](_0x797568[_0x3970('0x2c')][_0x3970('0x35')]);_0x432231[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x797568[_0x3970('0x2c')]['offset']);}_0x432231['order']=qs[_0x3970('0x37')](_0x797568[_0x3970('0x2c')][_0x3970('0x37')]);_0x432231[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_['pick'](_0x797568[_0x3970('0x2c')],_0x48df95[_0x3970('0x2e')]));_0x432231[_0x3970('0x3a')]['CampaignId']=_0x5da887['id'];if(_0x797568[_0x3970('0x2c')][_0x3970('0x39')]){_0x432231[_0x3970('0x3a')]=_['merge'](_0x432231['where'],{'$or':_['map'](_0x432231[_0x3970('0x31')],function(_0x2fff29){var _0x2bd475={};_0x2bd475[_0x2fff29]={'$like':'%'+_0x797568[_0x3970('0x2c')]['filter']+'%'};return _0x2bd475;})});}_0x432231=_[_0x3970('0x3b')]({},_0x432231,_0x797568[_0x3970('0x46')]);return db['CmHopperHistory'][_0x3970('0x1a')]({'where':_0x432231[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0x14a377){_0x1bb13e[_0x3970('0x1a')]=_0x14a377;if(_0x797568['query'][_0x3970('0x3d')]){_0x432231[_0x3970('0x3e')]=[{'all':!![]}];}return db[_0x3970('0x5a')][_0x3970('0x40')](_0x432231);})['then'](function(_0x29713c){_0x1bb13e[_0x3970('0x41')]=_0x29713c;return _0x1bb13e;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x2fdcb7,_0x432231))[_0x3970('0x42')](handleError(_0x2fdcb7,null));};exports[_0x3970('0x5b')]=function(_0x336024,_0x43ea9f,_0x36a459){var _0x4432eb={'raw':!![],'where':{}};var _0x1e9aa8={};var _0x14d573={'count':0x0,'rows':[]};return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x336024[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x43ea9f,null))[_0x3970('0x20')](function(_0xb8112f){if(_0xb8112f){_0x1e9aa8['model']=_['keys'](db['CmHopperFinal'][_0x3970('0x44')]);_0x1e9aa8['query']=_[_0x3970('0x2d')](_0x336024[_0x3970('0x2c')]);_0x1e9aa8[_0x3970('0x2e')]=_['intersection'](_0x1e9aa8['model'],_0x1e9aa8['query']);_0x4432eb[_0x3970('0x31')]=_['intersection'](_0x1e9aa8['model'],qs[_0x3970('0x45')](_0x336024[_0x3970('0x2c')][_0x3970('0x45')]));_0x4432eb[_0x3970('0x31')]=_0x4432eb[_0x3970('0x31')]['length']?_0x4432eb['attributes']:_0x1e9aa8[_0x3970('0x30')];if(!_0x336024[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x4432eb[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x336024[_0x3970('0x2c')]['limit']);_0x4432eb[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x336024[_0x3970('0x2c')][_0x3970('0x19')]);}_0x4432eb[_0x3970('0x36')]=qs[_0x3970('0x37')](_0x336024[_0x3970('0x2c')][_0x3970('0x37')]);_0x4432eb[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_[_0x3970('0x38')](_0x336024[_0x3970('0x2c')],_0x1e9aa8[_0x3970('0x2e')]));_0x4432eb[_0x3970('0x3a')]['CampaignId']=_0xb8112f['id'];if(_0x336024[_0x3970('0x2c')][_0x3970('0x39')]){_0x4432eb[_0x3970('0x3a')]=_['merge'](_0x4432eb[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x4432eb[_0x3970('0x31')],function(_0x45d85c){var _0x544a62={};_0x544a62[_0x45d85c]={'$like':'%'+_0x336024[_0x3970('0x2c')]['filter']+'%'};return _0x544a62;})});}_0x4432eb=_[_0x3970('0x3b')]({},_0x4432eb,_0x336024['options']);return db[_0x3970('0x5c')][_0x3970('0x1a')]({'where':_0x4432eb[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0xfd2c73){_0x14d573[_0x3970('0x1a')]=_0xfd2c73;if(_0x336024[_0x3970('0x2c')][_0x3970('0x3d')]){_0x4432eb[_0x3970('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3970('0x40')](_0x4432eb);})['then'](function(_0x3027ef){_0x14d573[_0x3970('0x41')]=_0x3027ef;return _0x14d573;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x43ea9f,_0x4432eb))[_0x3970('0x42')](handleError(_0x43ea9f,null));};exports[_0x3970('0x5d')]=function(_0x4259c4,_0x399252,_0x9458de){var _0x3e301f={'raw':!![],'where':{}};var _0x579db0={};var _0x54e3ff={'count':0x0,'rows':[]};return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x4259c4[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x399252,null))[_0x3970('0x20')](function(_0x13ebfc){if(_0x13ebfc){_0x579db0[_0x3970('0x30')]=_[_0x3970('0x2d')](db['CmHopperBlack'][_0x3970('0x44')]);_0x579db0[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x4259c4[_0x3970('0x2c')]);_0x579db0[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x579db0['model'],_0x579db0[_0x3970('0x2c')]);_0x3e301f[_0x3970('0x31')]=_[_0x3970('0x2f')](_0x579db0[_0x3970('0x30')],qs[_0x3970('0x45')](_0x4259c4[_0x3970('0x2c')]['fields']));_0x3e301f[_0x3970('0x31')]=_0x3e301f[_0x3970('0x31')]['length']?_0x3e301f[_0x3970('0x31')]:_0x579db0['model'];if(!_0x4259c4[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x3e301f['limit']=qs['limit'](_0x4259c4[_0x3970('0x2c')]['limit']);_0x3e301f['offset']=qs['offset'](_0x4259c4['query'][_0x3970('0x19')]);}_0x3e301f['order']=qs['sort'](_0x4259c4[_0x3970('0x2c')][_0x3970('0x37')]);_0x3e301f[_0x3970('0x3a')]=qs['filters'](_[_0x3970('0x38')](_0x4259c4[_0x3970('0x2c')],_0x579db0[_0x3970('0x2e')]));_0x3e301f[_0x3970('0x3a')][_0x3970('0x59')]=_0x13ebfc['id'];if(_0x4259c4['query'][_0x3970('0x39')]){_0x3e301f[_0x3970('0x3a')]=_['merge'](_0x3e301f[_0x3970('0x3a')],{'$or':_['map'](_0x3e301f['attributes'],function(_0x54bf08){var _0x5eebd8={};_0x5eebd8[_0x54bf08]={'$like':'%'+_0x4259c4['query'][_0x3970('0x39')]+'%'};return _0x5eebd8;})});}_0x3e301f=_['merge']({},_0x3e301f,_0x4259c4['options']);return db['CmHopperBlack'][_0x3970('0x1a')]({'where':_0x3e301f[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0x234715){_0x54e3ff[_0x3970('0x1a')]=_0x234715;if(_0x4259c4[_0x3970('0x2c')]['includeAll']){_0x3e301f[_0x3970('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3970('0x40')](_0x3e301f);})[_0x3970('0x20')](function(_0x5a32d8){_0x54e3ff['rows']=_0x5a32d8;return _0x54e3ff;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x399252,_0x3e301f))[_0x3970('0x42')](handleError(_0x399252,null));};exports[_0x3970('0x5e')]=function(_0x3b9b50,_0x47dce3,_0x631808){var _0xc673f5={};var _0x391fba={};var _0x19be5f;var _0x196a82;return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x3b9b50[_0x3970('0x43')]['id']}})['then'](handleEntityNotFound(_0x47dce3,null))[_0x3970('0x20')](function(_0x2e2e7c){if(_0x2e2e7c){_0x19be5f=_0x2e2e7c;_0x391fba[_0x3970('0x30')]=_[_0x3970('0x2d')](db[_0x3970('0x5f')][_0x3970('0x44')]);_0x391fba[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x3b9b50[_0x3970('0x2c')]);_0x391fba[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x391fba[_0x3970('0x30')],_0x391fba['query']);_0xc673f5[_0x3970('0x31')]=_['intersection'](_0x391fba[_0x3970('0x30')],qs['fields'](_0x3b9b50[_0x3970('0x2c')][_0x3970('0x45')]));_0xc673f5[_0x3970('0x31')]=_0xc673f5['attributes'][_0x3970('0x32')]?_0xc673f5[_0x3970('0x31')]:_0x391fba[_0x3970('0x30')];_0xc673f5[_0x3970('0x36')]=qs['sort'](_0x3b9b50[_0x3970('0x2c')]['sort']);_0xc673f5[_0x3970('0x3a')]=qs['filters'](_[_0x3970('0x38')](_0x3b9b50[_0x3970('0x2c')],_0x391fba[_0x3970('0x2e')]));if(_0x3b9b50[_0x3970('0x2c')]['filter']){_0xc673f5[_0x3970('0x3a')]=_['merge'](_0xc673f5[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0xc673f5['attributes'],function(_0x592b83){var _0x210ce4={};_0x210ce4[_0x592b83]={'$like':'%'+_0x3b9b50['query'][_0x3970('0x39')]+'%'};return _0x210ce4;})});}_0xc673f5=_[_0x3970('0x3b')]({},_0xc673f5,_0x3b9b50[_0x3970('0x46')]);return _0x19be5f[_0x3970('0x5e')](_0xc673f5);}})[_0x3970('0x20')](function(_0x362f18){if(_0x362f18){_0x196a82=_0x362f18[_0x3970('0x32')];if(!_0x3b9b50[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0xc673f5[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x3b9b50[_0x3970('0x2c')][_0x3970('0x35')]);_0xc673f5[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x3b9b50[_0x3970('0x2c')]['offset']);}return _0x19be5f[_0x3970('0x5e')](_0xc673f5);}})[_0x3970('0x20')](function(_0x3cc230){if(_0x3cc230){return _0x3cc230?{'count':_0x196a82,'rows':_0x3cc230}:null;}})[_0x3970('0x20')](respondWithResult(_0x47dce3,null))['catch'](handleError(_0x47dce3,null));};exports[_0x3970('0x60')]=function(_0x401359,_0x5198cd,_0x3a3fec){var _0x350d29,_0x14d136;var _0x2133b0=[];var _0x2d9810=moment()[_0x3970('0x61')](_0x3970('0x62'));return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x401359[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x5198cd,null))['then'](function(_0x12b7d2){if(_0x12b7d2){_0x14d136=_0x12b7d2;return _0x12b7d2[_0x3970('0x60')](_0x401359[_0x3970('0x48')][_0x3970('0x63')],_[_0x3970('0x52')](_0x401359[_0x3970('0x48')],[_0x3970('0x63'),'id'])||{});}return null;})[_0x3970('0x64')](function(_0x52978a){var _0x139a0e;var _0x56036a;_0x350d29=_0x52978a||[];var _0x2ddd93=[];if(_0x52978a){for(var _0x3d6106=0x0;_0x3d6106<_0x52978a[_0x3970('0x32')];_0x3d6106+=0x1){var _0x17dad1=_0x52978a[_0x3d6106][_0x3970('0x21')]({'plain':!![]});_0x14d136[_0x3970('0x65')]=_0x401359[_0x3970('0x48')][_0x3970('0x65')]?_0x401359[_0x3970('0x48')]['dialCheckDuplicateType']:_0x14d136[_0x3970('0x65')];switch(_0x14d136[_0x3970('0x65')]){case _0x3970('0x66'):_0x139a0e=squel[_0x3970('0x67')]()[_0x3970('0x68')](_0x3970('0x69'))[_0x3970('0x6a')]([_0x3970('0x6b'),_0x3970('0x6c'),_0x3970('0x6d'),_0x3970('0x6e'),_0x3970('0x59'),_0x3970('0x53'),_0x3970('0x54')],squel[_0x3970('0x6f')]()['field']('phone','phone')[_0x3970('0x70')](_0x3970('0x71'),_0x3970('0x6c'))['field']('id','ContactId')[_0x3970('0x70')](_0x17dad1['CmListId'][_0x3970('0x72')](),'ListId')[_0x3970('0x70')](_0x401359['params']['id']['toString'](),_0x3970('0x59'))['field']('\x27'+_0x2d9810+'\x27',_0x3970('0x53'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27','updatedAt')[_0x3970('0x73')](_0x3970('0x74'))[_0x3970('0x3a')](_0x3970('0x75'))['where'](_0x3970('0x76'),_0x17dad1[_0x3970('0x77')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x3970('0x78'),squel['select']()[_0x3970('0x70')](_0x3970('0x79'))[_0x3970('0x73')]('cm_hopper_final')[_0x3970('0x3a')](_0x3970('0x7a'),_0x401359[_0x3970('0x43')]['id'][_0x3970('0x72')]()))[_0x3970('0x3a')](_0x3970('0x78'),squel[_0x3970('0x6f')]()[_0x3970('0x70')](_0x3970('0x7b'))[_0x3970('0x73')](_0x3970('0x69'))[_0x3970('0x3a')](_0x3970('0x7a'),_0x401359[_0x3970('0x43')]['id'][_0x3970('0x72')]())))[_0x3970('0x72')]();break;case _0x3970('0x7c'):_0x139a0e=squel[_0x3970('0x67')]()['into'](_0x3970('0x69'))[_0x3970('0x6a')]([_0x3970('0x6b'),_0x3970('0x6c'),_0x3970('0x6d'),'ListId','CampaignId',_0x3970('0x53'),_0x3970('0x54')],squel['select']()[_0x3970('0x70')](_0x3970('0x6b'),_0x3970('0x6b'))[_0x3970('0x70')](_0x3970('0x71'),'scheduledAt')[_0x3970('0x70')]('id',_0x3970('0x6d'))[_0x3970('0x70')](_0x17dad1[_0x3970('0x77')][_0x3970('0x72')](),_0x3970('0x6e'))[_0x3970('0x70')](_0x401359[_0x3970('0x43')]['id'][_0x3970('0x72')](),_0x3970('0x59'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27',_0x3970('0x53'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27',_0x3970('0x54'))[_0x3970('0x73')](_0x3970('0x74'))[_0x3970('0x3a')](_0x3970('0x75'))['where']('ListId\x20=\x20?',_0x17dad1[_0x3970('0x77')]['toString']())['where'](_0x3970('0x7d'))[_0x3970('0x3a')](_0x3970('0x78'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x3970('0x73')](_0x3970('0x69'))[_0x3970('0x3a')](_0x3970('0x7a'),_0x401359[_0x3970('0x43')]['id']['toString']())))[_0x3970('0x72')]();break;default:_0x139a0e=squel[_0x3970('0x67')]()[_0x3970('0x68')](_0x3970('0x69'))[_0x3970('0x6a')]([_0x3970('0x6b'),'scheduledAt',_0x3970('0x6d'),'ListId',_0x3970('0x59'),_0x3970('0x53'),_0x3970('0x54')],squel['select']()[_0x3970('0x70')](_0x3970('0x6b'),'phone')[_0x3970('0x70')](_0x3970('0x71'),_0x3970('0x6c'))[_0x3970('0x70')]('id',_0x3970('0x6d'))[_0x3970('0x70')](_0x17dad1[_0x3970('0x77')][_0x3970('0x72')](),_0x3970('0x6e'))[_0x3970('0x70')](_0x401359[_0x3970('0x43')]['id']['toString'](),'CampaignId')[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27','createdAt')['field']('\x27'+_0x2d9810+'\x27',_0x3970('0x54'))[_0x3970('0x73')](_0x3970('0x74'))[_0x3970('0x3a')](_0x3970('0x75'))['where'](_0x3970('0x76'),_0x17dad1[_0x3970('0x77')][_0x3970('0x72')]())[_0x3970('0x3a')](_0x3970('0x7d')))[_0x3970('0x72')]();}_0x56036a=squel[_0x3970('0x67')]()[_0x3970('0x68')]('cm_hopper_additional_phones')['fromQuery'](['cmHopperId','scheduledAt','phone',_0x3970('0x7e'),_0x3970('0x53'),_0x3970('0x54')],squel[_0x3970('0x6f')]()[_0x3970('0x70')](_0x3970('0x7f'),'id')[_0x3970('0x70')](_0x3970('0x71'),_0x3970('0x6c'))[_0x3970('0x70')](_0x3970('0x80'),'phone')['field'](_0x3970('0x81'),_0x3970('0x7e'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27',_0x3970('0x53'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27','updatedAt')[_0x3970('0x73')](_0x3970('0x82'),'ci')[_0x3970('0x83')](_0x3970('0x69'),'h',_0x3970('0x84'))['where'](_0x3970('0x85'),_0x17dad1[_0x3970('0x77')][_0x3970('0x72')]())['where'](_0x3970('0x86'),_0x401359['params']['id']['toString']())['where'](_0x3970('0x87'),_0x2d9810))[_0x3970('0x72')]();_0x2ddd93[_0x3970('0x88')](db[_0x3970('0x89')][_0x3970('0x2c')](_0x139a0e));_0x2133b0['push'](db[_0x3970('0x89')][_0x3970('0x2c')](_0x56036a));}return BPromise['all'](_0x2ddd93);}})[_0x3970('0x20')](function(){return BPromise[_0x3970('0x8a')](_0x2133b0);})['then'](function(){return _0x350d29;})[_0x3970('0x20')](respondWithResult(_0x5198cd,null))[_0x3970('0x42')](handleError(_0x5198cd,null));};exports['removeLists']=function(_0x16ba06,_0x3fba57,_0x1ed79b){return db[_0x3970('0x3f')]['find']({'where':{'id':_0x16ba06[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x3fba57,null))['then'](function(_0x4acda7){if(_0x4acda7){return _0x4acda7[_0x3970('0x8b')](_0x16ba06[_0x3970('0x2c')]['ids']);}})[_0x3970('0x20')](function(_0xf6a5fe){if(_0xf6a5fe){return db[_0x3970('0x58')]['destroy']({'where':{'ListId':_0x16ba06['query']['ids'],'CampaignId':_0x16ba06[_0x3970('0x43')]['id']}})[_0x3970('0x20')](function(){return _0xf6a5fe;});}})[_0x3970('0x20')](respondWithStatusCode(_0x3fba57,null))[_0x3970('0x42')](handleError(_0x3fba57,null));};exports[_0x3970('0x8c')]=function(_0x515da2,_0x3ee1eb,_0x981570){var _0x35c09c={};var _0x417aef={};var _0x79858e;var _0x47fe0e;return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x515da2[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x3ee1eb,null))[_0x3970('0x20')](function(_0x37b61b){if(_0x37b61b){_0x79858e=_0x37b61b;_0x417aef[_0x3970('0x30')]=_[_0x3970('0x2d')](db[_0x3970('0x5f')][_0x3970('0x44')]);_0x417aef[_0x3970('0x2c')]=_['keys'](_0x515da2['query']);_0x417aef[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x417aef[_0x3970('0x30')],_0x417aef[_0x3970('0x2c')]);_0x35c09c['attributes']=_[_0x3970('0x2f')](_0x417aef['model'],qs[_0x3970('0x45')](_0x515da2[_0x3970('0x2c')][_0x3970('0x45')]));_0x35c09c['attributes']=_0x35c09c[_0x3970('0x31')][_0x3970('0x32')]?_0x35c09c[_0x3970('0x31')]:_0x417aef[_0x3970('0x30')];_0x35c09c[_0x3970('0x36')]=qs['sort'](_0x515da2[_0x3970('0x2c')][_0x3970('0x37')]);_0x35c09c[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_['pick'](_0x515da2['query'],_0x417aef[_0x3970('0x2e')]));if(_0x515da2[_0x3970('0x2c')][_0x3970('0x39')]){_0x35c09c[_0x3970('0x3a')]=_['merge'](_0x35c09c[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x35c09c[_0x3970('0x31')],function(_0x13579b){var _0xf37367={};_0xf37367[_0x13579b]={'$like':'%'+_0x515da2[_0x3970('0x2c')][_0x3970('0x39')]+'%'};return _0xf37367;})});}_0x35c09c=_[_0x3970('0x3b')]({},_0x35c09c,_0x515da2[_0x3970('0x46')]);return _0x79858e[_0x3970('0x8c')](_0x35c09c);}})['then'](function(_0x2d4bc1){if(_0x2d4bc1){_0x47fe0e=_0x2d4bc1['length'];if(!_0x515da2[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x35c09c[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x515da2['query'][_0x3970('0x35')]);_0x35c09c[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x515da2[_0x3970('0x2c')]['offset']);}return _0x79858e['getBlackLists'](_0x35c09c);}})[_0x3970('0x20')](function(_0x5d4c52){if(_0x5d4c52){return _0x5d4c52?{'count':_0x47fe0e,'rows':_0x5d4c52}:null;}})[_0x3970('0x20')](respondWithResult(_0x3ee1eb,null))['catch'](handleError(_0x3ee1eb,null));};exports[_0x3970('0x8d')]=function(_0x235ee5,_0x3e4405,_0x141462){var _0x1fe68c,_0x4e1f2f;var _0x4629db=[];var _0x204704=moment()[_0x3970('0x61')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x235ee5[_0x3970('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e4405,null))[_0x3970('0x20')](function(_0xb350b5){if(_0xb350b5){_0x4e1f2f=_0xb350b5;return _0xb350b5[_0x3970('0x8d')](_0x235ee5['body'][_0x3970('0x63')],_[_0x3970('0x52')](_0x235ee5[_0x3970('0x48')],[_0x3970('0x63'),'id'])||{});}return null;})[_0x3970('0x64')](function(_0x2c919d){var _0x15620a;var _0x3daa69;_0x1fe68c=_0x2c919d||[];var _0x751cbf=[];if(_0x2c919d){for(var _0x5947a3=0x0;_0x5947a3<_0x2c919d['length'];_0x5947a3+=0x1){var _0x543103=_0x2c919d[_0x5947a3][_0x3970('0x21')]({'plain':!![]});_0x15620a=squel[_0x3970('0x67')]()[_0x3970('0x68')](_0x3970('0x8e'))[_0x3970('0x6a')]([_0x3970('0x6b'),'ContactId',_0x3970('0x6e'),_0x3970('0x59'),'createdAt','updatedAt'],squel[_0x3970('0x6f')]()[_0x3970('0x70')](_0x3970('0x6b'),_0x3970('0x6b'))[_0x3970('0x70')]('id','ContactId')[_0x3970('0x70')](_0x543103[_0x3970('0x77')][_0x3970('0x72')](),_0x3970('0x6e'))['field'](_0x235ee5['params']['id'][_0x3970('0x72')](),_0x3970('0x59'))['field']('NOW()','createdAt')[_0x3970('0x70')](_0x3970('0x71'),'updatedAt')['from'](_0x3970('0x74'))['where'](_0x3970('0x75'))[_0x3970('0x3a')]('ListId\x20=\x20?',_0x543103['CmListId'][_0x3970('0x72')]())[_0x3970('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x3970('0x72')]();_0x751cbf[_0x3970('0x88')](db[_0x3970('0x89')][_0x3970('0x2c')](_0x15620a));}return BPromise['all'](_0x751cbf);}})[_0x3970('0x20')](function(){return _0x1fe68c;})[_0x3970('0x20')](respondWithResult(_0x3e4405,null))[_0x3970('0x42')](handleError(_0x3e4405,null));};exports[_0x3970('0x8f')]=function(_0x528062,_0x37cac5,_0x3f950f){return db['Campaign'][_0x3970('0x4d')]({'where':{'id':_0x528062[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x37cac5,null))['then'](function(_0x3398ab){if(_0x3398ab){return _0x3398ab[_0x3970('0x8f')](_0x528062['query'][_0x3970('0x63')]);}})[_0x3970('0x20')](function(_0x45db02){if(_0x45db02){return db[_0x3970('0x90')]['destroy']({'where':{'ListId':_0x528062[_0x3970('0x2c')][_0x3970('0x63')],'CampaignId':_0x528062[_0x3970('0x43')]['id']}})['then'](function(){return _0x45db02;});}})[_0x3970('0x20')](respondWithStatusCode(_0x37cac5,null))[_0x3970('0x42')](handleError(_0x37cac5,null));}; \ No newline at end of file +var _0xa512=['CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','into','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','rows','catch','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','user','autoAssociation','UserProfileResource','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','findAll'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0xa512,0xcb));var _0x2a51=function(_0xf32c6d,_0x372704){_0xf32c6d=_0xf32c6d-0x0;var _0x156c11=_0xa512[_0xf32c6d];return _0x156c11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a51('0x0'));var zipdir=require(_0x2a51('0x1'));var jsonpatch=require(_0x2a51('0x2'));var rp=require(_0x2a51('0x3'));var moment=require(_0x2a51('0x4'));var BPromise=require(_0x2a51('0x5'));var Mustache=require(_0x2a51('0x6'));var util=require(_0x2a51('0x7'));var path=require(_0x2a51('0x8'));var sox=require(_0x2a51('0x9'));var csv=require(_0x2a51('0xa'));var ejs=require(_0x2a51('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2a51('0xc'));var jsforce=require(_0x2a51('0xd'));var deskjs=require(_0x2a51('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2a51('0xf'));var Redis=require(_0x2a51('0x10'));var authService=require(_0x2a51('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2a51('0x12'));var hardwareService=require(_0x2a51('0x13'));var logger=require(_0x2a51('0x14'))(_0x2a51('0x15'));var utils=require(_0x2a51('0x16'));var config=require(_0x2a51('0x17'));var licenseUtil=require(_0x2a51('0x18'));var db=require(_0x2a51('0x19'))['db'];function respondWithStatusCode(_0x50000f,_0x1ea025){_0x1ea025=_0x1ea025||0xcc;return function(_0x19bab0){if(_0x19bab0){return _0x50000f[_0x2a51('0x1a')](_0x1ea025);}return _0x50000f[_0x2a51('0x1b')](_0x1ea025)[_0x2a51('0x1c')]();};}function respondWithResult(_0x491616,_0x56109d){_0x56109d=_0x56109d||0xc8;return function(_0x4b9a1b){if(_0x4b9a1b){return _0x491616[_0x2a51('0x1b')](_0x56109d)['json'](_0x4b9a1b);}};}function respondWithFilteredResult(_0x17eaf8,_0x4607fe){return function(_0x5ccd9e){if(_0x5ccd9e){var _0x219858=typeof _0x4607fe['offset']===_0x2a51('0x1d')&&typeof _0x4607fe[_0x2a51('0x1e')]===_0x2a51('0x1d');var _0x5221d7=_0x5ccd9e[_0x2a51('0x1f')];var _0x941c8a=_0x219858?0x0:_0x4607fe[_0x2a51('0x20')];var _0xc501aa=_0x219858?_0x5ccd9e['count']:_0x4607fe['offset']+_0x4607fe['limit'];var _0x586113;if(_0xc501aa>=_0x5221d7){_0xc501aa=_0x5221d7;_0x586113=0xc8;}else{_0x586113=0xce;}_0x17eaf8[_0x2a51('0x1b')](_0x586113);return _0x17eaf8[_0x2a51('0x21')]('Content-Range',_0x941c8a+'-'+_0xc501aa+'/'+_0x5221d7)[_0x2a51('0x22')](_0x5ccd9e);}return null;};}function patchUpdates(_0x9516ad){return function(_0x478c30){try{jsonpatch[_0x2a51('0x23')](_0x478c30,_0x9516ad,!![]);}catch(_0x501a68){return BPromise['reject'](_0x501a68);}return _0x478c30[_0x2a51('0x24')]();};}function saveUpdates(_0x5b6096,_0x9b5573){return function(_0x2e941e){if(_0x2e941e){return _0x2e941e[_0x2a51('0x25')](_0x5b6096)[_0x2a51('0x26')](function(_0x5a62ee){return _0x5a62ee;});}return null;};}function removeEntity(_0xa0c8f0,_0x1cf707){return function(_0x1ad13d){if(_0x1ad13d){return _0x1ad13d[_0x2a51('0x27')]()[_0x2a51('0x26')](function(){var _0x247c12=_0x1ad13d[_0x2a51('0x28')]({'plain':!![]});var _0x12ad44=_0x2a51('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x12ad44,'resourceId':_0x247c12['id']}})[_0x2a51('0x26')](function(){return _0x1ad13d;});})[_0x2a51('0x26')](function(){_0xa0c8f0[_0x2a51('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1689e4,_0x51729d){return function(_0x516d1f){if(!_0x516d1f){_0x1689e4[_0x2a51('0x1a')](0x194);}return _0x516d1f;};}function handleError(_0x204516,_0x3c8b51){_0x3c8b51=_0x3c8b51||0x1f4;return function(_0x5e047c){logger[_0x2a51('0x2a')](_0x5e047c[_0x2a51('0x2b')]);if(_0x5e047c['name']){delete _0x5e047c[_0x2a51('0x2c')];}_0x204516[_0x2a51('0x1b')](_0x3c8b51)[_0x2a51('0x2d')](_0x5e047c);};}exports[_0x2a51('0x2e')]=function(_0x1a00d,_0x27d9f5){var _0x59cc4e={},_0x57422d={},_0x4b49d0={'count':0x0,'rows':[]};var _0x3757f0=_['map'](db['Campaign'][_0x2a51('0x2f')],function(_0x332973){return{'name':_0x332973[_0x2a51('0x30')],'type':_0x332973[_0x2a51('0x31')][_0x2a51('0x32')]};});_0x57422d[_0x2a51('0x33')]=_[_0x2a51('0x34')](_0x3757f0,_0x2a51('0x2c'));_0x57422d[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x1a00d['query']);_0x57422d[_0x2a51('0x37')]=_['intersection'](_0x57422d[_0x2a51('0x33')],_0x57422d[_0x2a51('0x35')]);_0x59cc4e[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x57422d['model'],qs['fields'](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x59cc4e['attributes']=_0x59cc4e['attributes'][_0x2a51('0x3b')]?_0x59cc4e[_0x2a51('0x38')]:_0x57422d['model'];if(!_0x1a00d['query']['hasOwnProperty']('nolimit')){_0x59cc4e[_0x2a51('0x1e')]=qs[_0x2a51('0x1e')](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x59cc4e[_0x2a51('0x20')]=qs['offset'](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x20')]);}_0x59cc4e[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x59cc4e[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x1a00d[_0x2a51('0x35')],_0x57422d[_0x2a51('0x37')]),_0x3757f0);if(_0x1a00d[_0x2a51('0x35')][_0x2a51('0x40')]){_0x59cc4e[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x59cc4e[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x3757f0,function(_0x3a9ec8){if(_0x3a9ec8[_0x2a51('0x31')]!==_0x2a51('0x42')){var _0x2daec4={};_0x2daec4[_0x3a9ec8['name']]={'$like':'%'+_0x1a00d[_0x2a51('0x35')][_0x2a51('0x40')]+'%'};return _0x2daec4;}})});}_0x59cc4e=_['merge']({},_0x59cc4e,_0x1a00d[_0x2a51('0x43')]);var _0x47f5f2={'where':_0x59cc4e[_0x2a51('0x3e')]};return db[_0x2a51('0x44')][_0x2a51('0x1f')](_0x47f5f2)['then'](function(_0x4a281e){_0x4b49d0[_0x2a51('0x1f')]=_0x4a281e;if(_0x1a00d[_0x2a51('0x35')][_0x2a51('0x45')]){_0x59cc4e[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x44')]['findAll'](_0x59cc4e);})[_0x2a51('0x26')](function(_0x52d25e){_0x4b49d0[_0x2a51('0x47')]=_0x52d25e;return _0x4b49d0;})['then'](respondWithFilteredResult(_0x27d9f5,_0x59cc4e))[_0x2a51('0x48')](handleError(_0x27d9f5,null));};exports['show']=function(_0x32fbc7,_0x1e39aa){var _0x28f7b8={'raw':![],'where':{'id':_0x32fbc7['params']['id']}},_0x71d842={};_0x71d842[_0x2a51('0x33')]=_['keys'](db[_0x2a51('0x44')][_0x2a51('0x2f')]);_0x71d842[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x32fbc7['query']);_0x71d842[_0x2a51('0x37')]=_[_0x2a51('0x39')](_0x71d842['model'],_0x71d842['query']);_0x28f7b8[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x71d842[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x32fbc7[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x28f7b8[_0x2a51('0x38')]=_0x28f7b8[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x28f7b8[_0x2a51('0x38')]:_0x71d842[_0x2a51('0x33')];if(_0x32fbc7[_0x2a51('0x35')][_0x2a51('0x45')]){_0x28f7b8[_0x2a51('0x46')]=[{'all':!![]}];}_0x28f7b8=_[_0x2a51('0x41')]({},_0x28f7b8,_0x32fbc7[_0x2a51('0x43')]);return db[_0x2a51('0x44')][_0x2a51('0x49')](_0x28f7b8)[_0x2a51('0x26')](handleEntityNotFound(_0x1e39aa,null))['then'](respondWithResult(_0x1e39aa,null))[_0x2a51('0x48')](handleError(_0x1e39aa,null));};exports['create']=function(_0x4d9841,_0x4f66ac){return db[_0x2a51('0x44')]['create'](_0x4d9841[_0x2a51('0x4a')],{})[_0x2a51('0x26')](function(_0x5d324b){var _0x34d833=_0x4d9841['user'][_0x2a51('0x28')]({'plain':!![]});if(!_0x34d833)throw new Error(_0x2a51('0x4b'));if(_0x34d833[_0x2a51('0x4c')]==='user'){var _0x1f9740=_0x5d324b[_0x2a51('0x28')]({'plain':!![]});var _0x4a36af=_0x2a51('0x29');return db[_0x2a51('0x4d')][_0x2a51('0x49')]({'where':{'name':_0x4a36af,'userProfileId':_0x34d833['userProfileId']},'raw':!![]})[_0x2a51('0x26')](function(_0x218fa8){if(_0x218fa8&&_0x218fa8['autoAssociation']===0x0){return db['UserProfileResource'][_0x2a51('0x4e')]({'name':_0x1f9740[_0x2a51('0x2c')],'resourceId':_0x1f9740['id'],'type':_0x218fa8[_0x2a51('0x2c')],'sectionId':_0x218fa8['id']},{})[_0x2a51('0x26')](function(){return _0x5d324b;});}else{return _0x5d324b;}})[_0x2a51('0x48')](function(_0x5918f6){logger[_0x2a51('0x2a')](_0x2a51('0x4f'),_0x5918f6);throw _0x5918f6;});}return _0x5d324b;})['then'](respondWithResult(_0x4f66ac,0xc9))[_0x2a51('0x48')](handleError(_0x4f66ac,null));};exports['clone']=function(_0x575265,_0x4a0e9a){var _0x4db059={'where':{'id':_0x575265[_0x2a51('0x50')]['id']}},_0x252bb7={};_0x252bb7[_0x2a51('0x33')]=_[_0x2a51('0x36')](db['Campaign'][_0x2a51('0x2f')]);_0x4db059['attributes']=_[_0x2a51('0x39')](_0x252bb7['model'],qs[_0x2a51('0x3a')](_0x575265[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x4db059['attributes']=_0x4db059[_0x2a51('0x38')]['length']?_0x4db059[_0x2a51('0x38')]:_0x252bb7[_0x2a51('0x33')];if(_0x575265[_0x2a51('0x35')]['includeAll']){_0x4db059[_0x2a51('0x46')]=[{'all':!![]}];}_0x4db059=_[_0x2a51('0x41')]({},_0x4db059,_0x575265[_0x2a51('0x43')]);return db[_0x2a51('0x44')][_0x2a51('0x49')](_0x4db059)[_0x2a51('0x26')](handleEntityNotFound(_0x4a0e9a,null))['then'](function(_0x1debdd){if(_0x1debdd){var _0x3c2b8b=_0x1debdd['get']({'plain':!![]});_0x3c2b8b=qs[_0x2a51('0x51')](_0x3c2b8b,['id',_0x2a51('0x52'),_0x2a51('0x53')]);_0x575265[_0x2a51('0x4a')]=_[_0x2a51('0x51')](_0x575265['body'],['id',_0x2a51('0x52'),_0x2a51('0x53')]);return db[_0x2a51('0x44')]['create'](_[_0x2a51('0x41')](_0x3c2b8b,_0x575265[_0x2a51('0x4a')]),{'include':_0x575265[_0x2a51('0x35')][_0x2a51('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x15c148){var _0x22c45f=_0x575265[_0x2a51('0x54')][_0x2a51('0x28')]({'plain':!![]});if(!_0x22c45f)throw new Error(_0x2a51('0x4b'));if(_0x22c45f[_0x2a51('0x4c')]===_0x2a51('0x54')){var _0x19a64e=_0x15c148['get']({'plain':!![]});var _0x213fb2=_0x2a51('0x29');return db['UserProfileSection'][_0x2a51('0x49')]({'where':{'name':_0x213fb2,'userProfileId':_0x22c45f['userProfileId']},'raw':!![]})[_0x2a51('0x26')](function(_0x384e90){if(_0x384e90&&_0x384e90[_0x2a51('0x55')]===0x0){return db[_0x2a51('0x56')][_0x2a51('0x4e')]({'name':_0x19a64e[_0x2a51('0x2c')],'resourceId':_0x19a64e['id'],'type':_0x384e90[_0x2a51('0x2c')],'sectionId':_0x384e90['id']},{})['then'](function(){return _0x15c148;});}else{return _0x15c148;}})['catch'](function(_0x31f0c1){logger[_0x2a51('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31f0c1);throw _0x31f0c1;});}return _0x15c148;});}})[_0x2a51('0x26')](respondWithResult(_0x4a0e9a,0xc9))[_0x2a51('0x48')](handleError(_0x4a0e9a,null));};exports[_0x2a51('0x25')]=function(_0x3c8818,_0x54c9f1){if(_0x3c8818[_0x2a51('0x4a')]['id']){delete _0x3c8818[_0x2a51('0x4a')]['id'];}return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x3c8818['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x54c9f1,null))[_0x2a51('0x26')](saveUpdates(_0x3c8818[_0x2a51('0x4a')],null))[_0x2a51('0x26')](respondWithResult(_0x54c9f1,null))[_0x2a51('0x48')](handleError(_0x54c9f1,null));};exports[_0x2a51('0x27')]=function(_0x12e107,_0x4e4f1c){return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x12e107['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x4e4f1c,null))[_0x2a51('0x26')](removeEntity(_0x4e4f1c,null))[_0x2a51('0x48')](handleError(_0x4e4f1c,null));};exports[_0x2a51('0x57')]=function(_0x1cc553,_0x5d6530,_0x27f51d){var _0x30c19b={'raw':!![],'where':{}};var _0x2e749c={};var _0x3f9612={'count':0x0,'rows':[]};return db['Campaign'][_0x2a51('0x58')]({'where':{'id':_0x1cc553['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x5d6530,null))[_0x2a51('0x26')](function(_0x7749e5){if(_0x7749e5){_0x2e749c[_0x2a51('0x33')]=_[_0x2a51('0x36')](db[_0x2a51('0x59')]['rawAttributes']);_0x2e749c['query']=_[_0x2a51('0x36')](_0x1cc553[_0x2a51('0x35')]);_0x2e749c['filters']=_[_0x2a51('0x39')](_0x2e749c[_0x2a51('0x33')],_0x2e749c[_0x2a51('0x35')]);_0x30c19b['attributes']=_[_0x2a51('0x39')](_0x2e749c[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x1cc553['query']['fields']));_0x30c19b[_0x2a51('0x38')]=_0x30c19b['attributes'][_0x2a51('0x3b')]?_0x30c19b[_0x2a51('0x38')]:_0x2e749c[_0x2a51('0x33')];if(!_0x1cc553[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x30c19b[_0x2a51('0x1e')]=qs['limit'](_0x1cc553[_0x2a51('0x35')]['limit']);_0x30c19b['offset']=qs[_0x2a51('0x20')](_0x1cc553['query']['offset']);}_0x30c19b[_0x2a51('0x3c')]=qs['sort'](_0x1cc553[_0x2a51('0x35')]['sort']);_0x30c19b[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x1cc553[_0x2a51('0x35')],_0x2e749c['filters']));_0x30c19b[_0x2a51('0x3e')]['CampaignId']=_0x7749e5['id'];if(_0x1cc553[_0x2a51('0x35')][_0x2a51('0x40')]){_0x30c19b[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x30c19b[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x30c19b[_0x2a51('0x38')],function(_0xc2ca62){var _0x2a7764={};_0x2a7764[_0xc2ca62]={'$like':'%'+_0x1cc553['query'][_0x2a51('0x40')]+'%'};return _0x2a7764;})});}_0x30c19b=_[_0x2a51('0x41')]({},_0x30c19b,_0x1cc553[_0x2a51('0x43')]);return db['CmHopper']['count']({'where':_0x30c19b[_0x2a51('0x3e')]})['then'](function(_0x53fb2d){_0x3f9612['count']=_0x53fb2d;if(_0x1cc553[_0x2a51('0x35')][_0x2a51('0x45')]){_0x30c19b[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x59')][_0x2a51('0x5c')](_0x30c19b);})[_0x2a51('0x26')](function(_0x2f35ca){_0x3f9612[_0x2a51('0x47')]=_0x2f35ca;return _0x3f9612;});}})['then'](respondWithFilteredResult(_0x5d6530,_0x30c19b))['catch'](handleError(_0x5d6530,null));};exports['getHopperHistories']=function(_0x1d357e,_0x48018e,_0x313aae){var _0x31c154={'raw':!![],'where':{}};var _0x333b9d={};var _0xa76fad={'count':0x0,'rows':[]};return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x1d357e['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x48018e,null))[_0x2a51('0x26')](function(_0x4c7546){if(_0x4c7546){_0x333b9d['model']=_[_0x2a51('0x36')](db[_0x2a51('0x5d')]['rawAttributes']);_0x333b9d['query']=_[_0x2a51('0x36')](_0x1d357e[_0x2a51('0x35')]);_0x333b9d['filters']=_['intersection'](_0x333b9d[_0x2a51('0x33')],_0x333b9d['query']);_0x31c154[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x333b9d[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x1d357e[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x31c154[_0x2a51('0x38')]=_0x31c154[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x31c154[_0x2a51('0x38')]:_0x333b9d['model'];if(!_0x1d357e[_0x2a51('0x35')]['hasOwnProperty']('nolimit')){_0x31c154[_0x2a51('0x1e')]=qs['limit'](_0x1d357e[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x31c154[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x1d357e[_0x2a51('0x35')][_0x2a51('0x20')]);}_0x31c154[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x1d357e['query'][_0x2a51('0x3d')]);_0x31c154['where']=qs[_0x2a51('0x37')](_['pick'](_0x1d357e[_0x2a51('0x35')],_0x333b9d[_0x2a51('0x37')]));_0x31c154[_0x2a51('0x3e')][_0x2a51('0x5e')]=_0x4c7546['id'];if(_0x1d357e[_0x2a51('0x35')][_0x2a51('0x40')]){_0x31c154['where']=_[_0x2a51('0x41')](_0x31c154[_0x2a51('0x3e')],{'$or':_['map'](_0x31c154['attributes'],function(_0x54b47a){var _0x36e05f={};_0x36e05f[_0x54b47a]={'$like':'%'+_0x1d357e[_0x2a51('0x35')]['filter']+'%'};return _0x36e05f;})});}_0x31c154=_[_0x2a51('0x41')]({},_0x31c154,_0x1d357e[_0x2a51('0x43')]);return db[_0x2a51('0x5d')]['count']({'where':_0x31c154[_0x2a51('0x3e')]})[_0x2a51('0x26')](function(_0x371531){_0xa76fad[_0x2a51('0x1f')]=_0x371531;if(_0x1d357e[_0x2a51('0x35')][_0x2a51('0x45')]){_0x31c154[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x5d')][_0x2a51('0x5c')](_0x31c154);})['then'](function(_0x405721){_0xa76fad[_0x2a51('0x47')]=_0x405721;return _0xa76fad;});}})[_0x2a51('0x26')](respondWithFilteredResult(_0x48018e,_0x31c154))[_0x2a51('0x48')](handleError(_0x48018e,null));};exports[_0x2a51('0x5f')]=function(_0x1f313a,_0x258b6a,_0x49ff93){var _0x3f9caf={'raw':!![],'where':{}};var _0x1d5546={};var _0x1910c2={'count':0x0,'rows':[]};return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x1f313a[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x258b6a,null))[_0x2a51('0x26')](function(_0x1c0957){if(_0x1c0957){_0x1d5546[_0x2a51('0x33')]=_[_0x2a51('0x36')](db['CmHopperFinal'][_0x2a51('0x2f')]);_0x1d5546[_0x2a51('0x35')]=_['keys'](_0x1f313a[_0x2a51('0x35')]);_0x1d5546[_0x2a51('0x37')]=_[_0x2a51('0x39')](_0x1d5546['model'],_0x1d5546[_0x2a51('0x35')]);_0x3f9caf['attributes']=_['intersection'](_0x1d5546[_0x2a51('0x33')],qs['fields'](_0x1f313a[_0x2a51('0x35')]['fields']));_0x3f9caf['attributes']=_0x3f9caf[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x3f9caf['attributes']:_0x1d5546[_0x2a51('0x33')];if(!_0x1f313a['query'][_0x2a51('0x5a')]('nolimit')){_0x3f9caf['limit']=qs[_0x2a51('0x1e')](_0x1f313a[_0x2a51('0x35')]['limit']);_0x3f9caf[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x1f313a['query']['offset']);}_0x3f9caf['order']=qs[_0x2a51('0x3d')](_0x1f313a[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x3f9caf[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x1f313a[_0x2a51('0x35')],_0x1d5546[_0x2a51('0x37')]));_0x3f9caf['where'][_0x2a51('0x5e')]=_0x1c0957['id'];if(_0x1f313a[_0x2a51('0x35')][_0x2a51('0x40')]){_0x3f9caf[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x3f9caf[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x3f9caf['attributes'],function(_0x4df883){var _0x85b97c={};_0x85b97c[_0x4df883]={'$like':'%'+_0x1f313a[_0x2a51('0x35')][_0x2a51('0x40')]+'%'};return _0x85b97c;})});}_0x3f9caf=_[_0x2a51('0x41')]({},_0x3f9caf,_0x1f313a[_0x2a51('0x43')]);return db[_0x2a51('0x60')][_0x2a51('0x1f')]({'where':_0x3f9caf[_0x2a51('0x3e')]})[_0x2a51('0x26')](function(_0x2da208){_0x1910c2[_0x2a51('0x1f')]=_0x2da208;if(_0x1f313a[_0x2a51('0x35')][_0x2a51('0x45')]){_0x3f9caf[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x60')][_0x2a51('0x5c')](_0x3f9caf);})[_0x2a51('0x26')](function(_0x214d99){_0x1910c2['rows']=_0x214d99;return _0x1910c2;});}})[_0x2a51('0x26')](respondWithFilteredResult(_0x258b6a,_0x3f9caf))[_0x2a51('0x48')](handleError(_0x258b6a,null));};exports[_0x2a51('0x61')]=function(_0x23c357,_0x3d7f32,_0x4d2ff2){var _0x243e35={'raw':!![],'where':{}};var _0x2ec964={};var _0x2c0697={'count':0x0,'rows':[]};return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x23c357[_0x2a51('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d7f32,null))['then'](function(_0x5b8a6a){if(_0x5b8a6a){_0x2ec964['model']=_[_0x2a51('0x36')](db[_0x2a51('0x62')][_0x2a51('0x2f')]);_0x2ec964[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x23c357[_0x2a51('0x35')]);_0x2ec964[_0x2a51('0x37')]=_[_0x2a51('0x39')](_0x2ec964[_0x2a51('0x33')],_0x2ec964['query']);_0x243e35[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x2ec964[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x23c357[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x243e35[_0x2a51('0x38')]=_0x243e35[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x243e35[_0x2a51('0x38')]:_0x2ec964[_0x2a51('0x33')];if(!_0x23c357[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x243e35[_0x2a51('0x1e')]=qs['limit'](_0x23c357[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x243e35[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x23c357[_0x2a51('0x35')]['offset']);}_0x243e35[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x23c357[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x243e35['where']=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x23c357[_0x2a51('0x35')],_0x2ec964['filters']));_0x243e35[_0x2a51('0x3e')][_0x2a51('0x5e')]=_0x5b8a6a['id'];if(_0x23c357[_0x2a51('0x35')][_0x2a51('0x40')]){_0x243e35[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x243e35['where'],{'$or':_[_0x2a51('0x34')](_0x243e35[_0x2a51('0x38')],function(_0x28205e){var _0x63746b={};_0x63746b[_0x28205e]={'$like':'%'+_0x23c357[_0x2a51('0x35')][_0x2a51('0x40')]+'%'};return _0x63746b;})});}_0x243e35=_[_0x2a51('0x41')]({},_0x243e35,_0x23c357[_0x2a51('0x43')]);return db[_0x2a51('0x62')][_0x2a51('0x1f')]({'where':_0x243e35[_0x2a51('0x3e')]})['then'](function(_0x518b36){_0x2c0697['count']=_0x518b36;if(_0x23c357['query'][_0x2a51('0x45')]){_0x243e35[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x62')]['findAll'](_0x243e35);})[_0x2a51('0x26')](function(_0x36a057){_0x2c0697['rows']=_0x36a057;return _0x2c0697;});}})[_0x2a51('0x26')](respondWithFilteredResult(_0x3d7f32,_0x243e35))[_0x2a51('0x48')](handleError(_0x3d7f32,null));};exports[_0x2a51('0x63')]=function(_0x4db224,_0x466027,_0x296f2b){var _0x281596={};var _0x3003fa={};var _0x3bd62e;var _0x14c6e1;return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x4db224[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x466027,null))[_0x2a51('0x26')](function(_0x531b2d){if(_0x531b2d){_0x3bd62e=_0x531b2d;_0x3003fa[_0x2a51('0x33')]=_[_0x2a51('0x36')](db[_0x2a51('0x64')][_0x2a51('0x2f')]);_0x3003fa[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x4db224[_0x2a51('0x35')]);_0x3003fa['filters']=_[_0x2a51('0x39')](_0x3003fa[_0x2a51('0x33')],_0x3003fa['query']);_0x281596[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x3003fa[_0x2a51('0x33')],qs['fields'](_0x4db224[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x281596[_0x2a51('0x38')]=_0x281596['attributes']['length']?_0x281596[_0x2a51('0x38')]:_0x3003fa['model'];_0x281596[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x4db224[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x281596[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x4db224[_0x2a51('0x35')],_0x3003fa[_0x2a51('0x37')]));if(_0x4db224[_0x2a51('0x35')][_0x2a51('0x40')]){_0x281596['where']=_[_0x2a51('0x41')](_0x281596['where'],{'$or':_[_0x2a51('0x34')](_0x281596['attributes'],function(_0x53cfdb){var _0x4c8447={};_0x4c8447[_0x53cfdb]={'$like':'%'+_0x4db224['query'][_0x2a51('0x40')]+'%'};return _0x4c8447;})});}_0x281596=_[_0x2a51('0x41')]({},_0x281596,_0x4db224[_0x2a51('0x43')]);return _0x3bd62e[_0x2a51('0x63')](_0x281596);}})['then'](function(_0x12c9b8){if(_0x12c9b8){_0x14c6e1=_0x12c9b8[_0x2a51('0x3b')];if(!_0x4db224[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x281596[_0x2a51('0x1e')]=qs[_0x2a51('0x1e')](_0x4db224[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x281596[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x4db224['query'][_0x2a51('0x20')]);}return _0x3bd62e[_0x2a51('0x63')](_0x281596);}})[_0x2a51('0x26')](function(_0x3ed7fa){if(_0x3ed7fa){return _0x3ed7fa?{'count':_0x14c6e1,'rows':_0x3ed7fa}:null;}})[_0x2a51('0x26')](respondWithResult(_0x466027,null))[_0x2a51('0x48')](handleError(_0x466027,null));};exports[_0x2a51('0x65')]=function(_0x2b73b2,_0x392677,_0x1f1652){var _0x5198df,_0x36fbf1;var _0x2f07a1=[];var _0x234b6b=moment()[_0x2a51('0x66')](_0x2a51('0x67'));return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x2b73b2[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x392677,null))[_0x2a51('0x26')](function(_0x1f93ae){if(_0x1f93ae){_0x36fbf1=_0x1f93ae;return _0x1f93ae[_0x2a51('0x65')](_0x2b73b2[_0x2a51('0x4a')][_0x2a51('0x68')],_['omit'](_0x2b73b2['body'],['ids','id'])||{});}return null;})[_0x2a51('0x69')](function(_0x293eba){var _0x1af919;var _0x1fd0ab;_0x5198df=_0x293eba||[];var _0x299911=[];if(_0x293eba){for(var _0x4ecb2f=0x0;_0x4ecb2f<_0x293eba[_0x2a51('0x3b')];_0x4ecb2f+=0x1){var _0x144399=_0x293eba[_0x4ecb2f][_0x2a51('0x28')]({'plain':!![]});_0x36fbf1[_0x2a51('0x6a')]=_0x2b73b2[_0x2a51('0x4a')][_0x2a51('0x6a')]?_0x2b73b2[_0x2a51('0x4a')][_0x2a51('0x6a')]:_0x36fbf1[_0x2a51('0x6a')];switch(_0x36fbf1['dialCheckDuplicateType']){case _0x2a51('0x6b'):_0x1af919=squel[_0x2a51('0x6c')]()['into']('cm_hopper')[_0x2a51('0x6d')]([_0x2a51('0x6e'),_0x2a51('0x6f'),_0x2a51('0x70'),_0x2a51('0x71'),'CampaignId',_0x2a51('0x52'),'updatedAt'],squel[_0x2a51('0x72')]()[_0x2a51('0x73')]('phone',_0x2a51('0x6e'))[_0x2a51('0x73')](_0x2a51('0x74'),_0x2a51('0x6f'))[_0x2a51('0x73')]('id',_0x2a51('0x70'))[_0x2a51('0x73')](_0x144399[_0x2a51('0x75')]['toString'](),'ListId')['field'](_0x2b73b2[_0x2a51('0x50')]['id'][_0x2a51('0x76')](),'CampaignId')[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27','updatedAt')[_0x2a51('0x77')](_0x2a51('0x78'))[_0x2a51('0x3e')](_0x2a51('0x79'))[_0x2a51('0x3e')](_0x2a51('0x7a'),_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())[_0x2a51('0x3e')](_0x2a51('0x7b'))[_0x2a51('0x3e')](_0x2a51('0x7c'),squel[_0x2a51('0x72')]()[_0x2a51('0x73')](_0x2a51('0x7d'))[_0x2a51('0x77')]('cm_hopper_final')['where'](_0x2a51('0x7e'),_0x2b73b2[_0x2a51('0x50')]['id']['toString']()))[_0x2a51('0x3e')](_0x2a51('0x7c'),squel[_0x2a51('0x72')]()[_0x2a51('0x73')]('COALESCE(phone,\x27\x27)')[_0x2a51('0x77')](_0x2a51('0x7f'))[_0x2a51('0x3e')]('CampaignId\x20=\x20?',_0x2b73b2[_0x2a51('0x50')]['id'][_0x2a51('0x76')]())))[_0x2a51('0x76')]();break;case _0x2a51('0x80'):_0x1af919=squel[_0x2a51('0x6c')]()[_0x2a51('0x81')]('cm_hopper')[_0x2a51('0x6d')]([_0x2a51('0x6e'),_0x2a51('0x6f'),_0x2a51('0x70'),'ListId',_0x2a51('0x5e'),_0x2a51('0x52'),_0x2a51('0x53')],squel[_0x2a51('0x72')]()[_0x2a51('0x73')](_0x2a51('0x6e'),_0x2a51('0x6e'))[_0x2a51('0x73')]('NOW()',_0x2a51('0x6f'))['field']('id','ContactId')[_0x2a51('0x73')](_0x144399['CmListId']['toString'](),_0x2a51('0x71'))['field'](_0x2b73b2[_0x2a51('0x50')]['id']['toString'](),_0x2a51('0x5e'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x53'))[_0x2a51('0x77')](_0x2a51('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0x2a51('0x3e')](_0x2a51('0x7a'),_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2a51('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2a51('0x73')](_0x2a51('0x82'))['from'](_0x2a51('0x7f'))['where'](_0x2a51('0x7e'),_0x2b73b2[_0x2a51('0x50')]['id']['toString']())))[_0x2a51('0x76')]();break;default:_0x1af919=squel[_0x2a51('0x6c')]()['into'](_0x2a51('0x7f'))['fromQuery']([_0x2a51('0x6e'),_0x2a51('0x6f'),_0x2a51('0x70'),'ListId','CampaignId','createdAt',_0x2a51('0x53')],squel['select']()[_0x2a51('0x73')](_0x2a51('0x6e'),_0x2a51('0x6e'))[_0x2a51('0x73')]('NOW()',_0x2a51('0x6f'))[_0x2a51('0x73')]('id',_0x2a51('0x70'))[_0x2a51('0x73')](_0x144399['CmListId'][_0x2a51('0x76')](),_0x2a51('0x71'))[_0x2a51('0x73')](_0x2b73b2[_0x2a51('0x50')]['id'][_0x2a51('0x76')](),_0x2a51('0x5e'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))['field']('\x27'+_0x234b6b+'\x27',_0x2a51('0x53'))[_0x2a51('0x77')](_0x2a51('0x78'))[_0x2a51('0x3e')]('deletedAt\x20IS\x20NULL')[_0x2a51('0x3e')]('ListId\x20=\x20?',_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())[_0x2a51('0x3e')](_0x2a51('0x7b')))[_0x2a51('0x76')]();}_0x1fd0ab=squel['insert']()[_0x2a51('0x81')](_0x2a51('0x83'))[_0x2a51('0x6d')](['cmHopperId',_0x2a51('0x6f'),_0x2a51('0x6e'),_0x2a51('0x84'),_0x2a51('0x52'),'updatedAt'],squel['select']()[_0x2a51('0x73')]('h.id','id')[_0x2a51('0x73')]('NOW()','scheduledAt')[_0x2a51('0x73')]('ci.item','phone')[_0x2a51('0x73')](_0x2a51('0x85'),_0x2a51('0x84'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x53'))['from'](_0x2a51('0x86'),'ci')[_0x2a51('0x87')]('cm_hopper','h',_0x2a51('0x88'))[_0x2a51('0x3e')](_0x2a51('0x89'),_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())['where'](_0x2a51('0x8a'),_0x2b73b2[_0x2a51('0x50')]['id']['toString']())['where'](_0x2a51('0x8b'),_0x234b6b))['toString']();_0x299911[_0x2a51('0x8c')](db[_0x2a51('0x8d')][_0x2a51('0x35')](_0x1af919));_0x2f07a1[_0x2a51('0x8c')](db[_0x2a51('0x8d')][_0x2a51('0x35')](_0x1fd0ab));}return BPromise[_0x2a51('0x8e')](_0x299911);}})[_0x2a51('0x26')](function(){return BPromise[_0x2a51('0x8e')](_0x2f07a1);})[_0x2a51('0x26')](function(){return _0x5198df;})[_0x2a51('0x26')](respondWithResult(_0x392677,null))['catch'](handleError(_0x392677,null));};exports[_0x2a51('0x8f')]=function(_0x342b1a,_0x646eba,_0x2ff63e){return db[_0x2a51('0x44')]['find']({'where':{'id':_0x342b1a['params']['id']}})['then'](handleEntityNotFound(_0x646eba,null))[_0x2a51('0x26')](function(_0x4bb580){if(_0x4bb580){return _0x4bb580[_0x2a51('0x8f')](_0x342b1a[_0x2a51('0x35')][_0x2a51('0x68')]);}})[_0x2a51('0x26')](function(_0x3e84a6){if(_0x3e84a6){return db[_0x2a51('0x59')][_0x2a51('0x27')]({'where':{'ListId':_0x342b1a[_0x2a51('0x35')][_0x2a51('0x68')],'CampaignId':_0x342b1a[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](function(){return _0x3e84a6;});}})[_0x2a51('0x26')](respondWithStatusCode(_0x646eba,null))[_0x2a51('0x48')](handleError(_0x646eba,null));};exports[_0x2a51('0x90')]=function(_0x4fc957,_0x39c206,_0x43d8b2){var _0x3c23aa={};var _0x30c36a={};var _0x34bd9a;var _0x6cbb5e;return db['Campaign'][_0x2a51('0x58')]({'where':{'id':_0x4fc957[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x39c206,null))[_0x2a51('0x26')](function(_0x1ebb9f){if(_0x1ebb9f){_0x34bd9a=_0x1ebb9f;_0x30c36a[_0x2a51('0x33')]=_[_0x2a51('0x36')](db[_0x2a51('0x64')]['rawAttributes']);_0x30c36a[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x4fc957[_0x2a51('0x35')]);_0x30c36a['filters']=_[_0x2a51('0x39')](_0x30c36a[_0x2a51('0x33')],_0x30c36a[_0x2a51('0x35')]);_0x3c23aa['attributes']=_[_0x2a51('0x39')](_0x30c36a[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x3c23aa[_0x2a51('0x38')]=_0x3c23aa[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x3c23aa[_0x2a51('0x38')]:_0x30c36a['model'];_0x3c23aa['order']=qs[_0x2a51('0x3d')](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x3c23aa[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x4fc957[_0x2a51('0x35')],_0x30c36a['filters']));if(_0x4fc957[_0x2a51('0x35')][_0x2a51('0x40')]){_0x3c23aa[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x3c23aa[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x3c23aa[_0x2a51('0x38')],function(_0x549aff){var _0x12fe03={};_0x12fe03[_0x549aff]={'$like':'%'+_0x4fc957['query'][_0x2a51('0x40')]+'%'};return _0x12fe03;})});}_0x3c23aa=_['merge']({},_0x3c23aa,_0x4fc957[_0x2a51('0x43')]);return _0x34bd9a[_0x2a51('0x90')](_0x3c23aa);}})[_0x2a51('0x26')](function(_0x3aa9e9){if(_0x3aa9e9){_0x6cbb5e=_0x3aa9e9[_0x2a51('0x3b')];if(!_0x4fc957[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x3c23aa['limit']=qs['limit'](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x3c23aa[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x20')]);}return _0x34bd9a[_0x2a51('0x90')](_0x3c23aa);}})['then'](function(_0x2d4109){if(_0x2d4109){return _0x2d4109?{'count':_0x6cbb5e,'rows':_0x2d4109}:null;}})[_0x2a51('0x26')](respondWithResult(_0x39c206,null))[_0x2a51('0x48')](handleError(_0x39c206,null));};exports[_0x2a51('0x91')]=function(_0x1d5e6f,_0x1a048b,_0x1a468){var _0x274892,_0x553c5d;var _0x27d1de=[];var _0x493455=moment()[_0x2a51('0x66')](_0x2a51('0x67'));return db[_0x2a51('0x44')]['find']({'where':{'id':_0x1d5e6f[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x1a048b,null))['then'](function(_0x1b228a){if(_0x1b228a){_0x553c5d=_0x1b228a;return _0x1b228a[_0x2a51('0x91')](_0x1d5e6f['body'][_0x2a51('0x68')],_[_0x2a51('0x51')](_0x1d5e6f[_0x2a51('0x4a')],['ids','id'])||{});}return null;})[_0x2a51('0x69')](function(_0x3aacb8){var _0x422fe1;var _0x5f3f50;_0x274892=_0x3aacb8||[];var _0x1ea4fb=[];if(_0x3aacb8){for(var _0x34aabc=0x0;_0x34aabc<_0x3aacb8[_0x2a51('0x3b')];_0x34aabc+=0x1){var _0x166e98=_0x3aacb8[_0x34aabc][_0x2a51('0x28')]({'plain':!![]});_0x422fe1=squel[_0x2a51('0x6c')]()[_0x2a51('0x81')](_0x2a51('0x92'))['fromQuery']([_0x2a51('0x6e'),_0x2a51('0x70'),'ListId',_0x2a51('0x5e'),_0x2a51('0x52'),'updatedAt'],squel[_0x2a51('0x72')]()[_0x2a51('0x73')](_0x2a51('0x6e'),_0x2a51('0x6e'))[_0x2a51('0x73')]('id','ContactId')[_0x2a51('0x73')](_0x166e98['CmListId']['toString'](),'ListId')[_0x2a51('0x73')](_0x1d5e6f['params']['id'][_0x2a51('0x76')](),_0x2a51('0x5e'))[_0x2a51('0x73')](_0x2a51('0x74'),_0x2a51('0x52'))[_0x2a51('0x73')](_0x2a51('0x74'),_0x2a51('0x53'))[_0x2a51('0x77')](_0x2a51('0x78'))[_0x2a51('0x3e')](_0x2a51('0x79'))[_0x2a51('0x3e')]('ListId\x20=\x20?',_0x166e98[_0x2a51('0x75')][_0x2a51('0x76')]())[_0x2a51('0x3e')](_0x2a51('0x7b')))[_0x2a51('0x76')]();_0x1ea4fb[_0x2a51('0x8c')](db[_0x2a51('0x8d')]['query'](_0x422fe1));}return BPromise[_0x2a51('0x8e')](_0x1ea4fb);}})[_0x2a51('0x26')](function(){return _0x274892;})[_0x2a51('0x26')](respondWithResult(_0x1a048b,null))[_0x2a51('0x48')](handleError(_0x1a048b,null));};exports[_0x2a51('0x93')]=function(_0x51d88a,_0x33701f,_0x118c9e){return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x51d88a[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x33701f,null))[_0x2a51('0x26')](function(_0x1ece21){if(_0x1ece21){return _0x1ece21[_0x2a51('0x93')](_0x51d88a[_0x2a51('0x35')][_0x2a51('0x68')]);}})[_0x2a51('0x26')](function(_0xd19a15){if(_0xd19a15){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x51d88a[_0x2a51('0x35')][_0x2a51('0x68')],'CampaignId':_0x51d88a['params']['id']}})[_0x2a51('0x26')](function(){return _0xd19a15;});}})[_0x2a51('0x26')](respondWithStatusCode(_0x33701f,null))[_0x2a51('0x48')](handleError(_0x33701f,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3e8ae0c..3ef2aba 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5b50ae,_0x7da7e1){var _0x84eb56=function(_0xad6b38){while(--_0xad6b38){_0x5b50ae['push'](_0x5b50ae['shift']());}};_0x84eb56(++_0x7da7e1);}(_0x7a54,0x106));var _0x47a5=function(_0x413f2c,_0x59141a){_0x413f2c=_0x413f2c-0x0;var _0x8b143d=_0x7a54[_0x413f2c];return _0x8b143d;};'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 1e372fb..a9713f8 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 _0x6f7f=['GetCampaign','Campaign','findAll','options','raw','where','include','map','attributes','model','debug','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Campaign,\x20%s,\x20%s','result'];(function(_0x14a872,_0x46902b){var _0x3ad0db=function(_0x5be2ef){while(--_0x5be2ef){_0x14a872['push'](_0x14a872['shift']());}};_0x3ad0db(++_0x46902b);}(_0x6f7f,0x177));var _0xf6f7=function(_0x2523fb,_0x507de7){_0x2523fb=_0x2523fb-0x0;var _0x201a7f=_0x6f7f[_0x2523fb];return _0x201a7f;};'use strict';var _=require('lodash');var util=require(_0xf6f7('0x0'));var moment=require(_0xf6f7('0x1'));var BPromise=require(_0xf6f7('0x2'));var rs=require(_0xf6f7('0x3'));var fs=require('fs');var Redis=require(_0xf6f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6f7('0x5'));var logger=require('../../config/logger')(_0xf6f7('0x6'));var config=require(_0xf6f7('0x7'));var jayson=require(_0xf6f7('0x8'));var client=jayson['client'][_0xf6f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x543eb3,_0x33a2b2,_0x3c641f){return new BPromise(function(_0xe86f3a,_0x279ed7){return client[_0xf6f7('0xa')](_0x543eb3,_0x3c641f)[_0xf6f7('0xb')](function(_0x506617){logger[_0xf6f7('0xc')]('Campaign,\x20%s,\x20%s',_0x33a2b2,'request\x20sent');logger['debug'](_0xf6f7('0xd'),_0x33a2b2,_0xf6f7('0xe'),JSON[_0xf6f7('0xf')](_0x506617));if(_0x506617[_0xf6f7('0x10')]){if(_0x506617[_0xf6f7('0x10')][_0xf6f7('0x11')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x33a2b2,_0x506617[_0xf6f7('0x10')][_0xf6f7('0x12')]);return _0x279ed7(_0x506617[_0xf6f7('0x10')][_0xf6f7('0x12')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x33a2b2,_0x506617[_0xf6f7('0x10')]['message']);return _0xe86f3a(_0x506617[_0xf6f7('0x10')]['message']);}else{logger[_0xf6f7('0xc')](_0xf6f7('0x13'),_0x33a2b2,_0xf6f7('0xe'));_0xe86f3a(_0x506617[_0xf6f7('0x14')][_0xf6f7('0x12')]);}})['catch'](function(_0x42aa26){logger[_0xf6f7('0x10')]('Campaign,\x20%s,\x20%s',_0x33a2b2,_0x42aa26);_0x279ed7(_0x42aa26);});});}exports[_0xf6f7('0x15')]=function(_0x438e3d){var _0xc23839=this;return new Promise(function(_0x5cc7a1,_0x5ba9f0){return db[_0xf6f7('0x16')][_0xf6f7('0x17')]({'raw':_0x438e3d['options']?_0x438e3d[_0xf6f7('0x18')][_0xf6f7('0x19')]===undefined?!![]:![]:!![],'where':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d[_0xf6f7('0x18')][_0xf6f7('0x1a')]||null:null,'attributes':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d[_0xf6f7('0x18')]['attributes']||null:null,'limit':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d['options']['limit']||null:null,'include':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d['options'][_0xf6f7('0x1b')]?_[_0xf6f7('0x1c')](_0x438e3d['options'][_0xf6f7('0x1b')],function(_0x5ec44f){return{'model':db[_0x5ec44f['model']],'as':_0x5ec44f['as'],'attributes':_0x5ec44f[_0xf6f7('0x1d')],'include':_0x5ec44f[_0xf6f7('0x1b')]?_[_0xf6f7('0x1c')](_0x5ec44f[_0xf6f7('0x1b')],function(_0xa903ff){return{'model':db[_0xa903ff['model']],'as':_0xa903ff['as'],'attributes':_0xa903ff['attributes'],'include':_0xa903ff[_0xf6f7('0x1b')]?_[_0xf6f7('0x1c')](_0xa903ff[_0xf6f7('0x1b')],function(_0x1de269){return{'model':db[_0x1de269[_0xf6f7('0x1e')]],'as':_0x1de269['as'],'attributes':_0x1de269[_0xf6f7('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49dd11){logger[_0xf6f7('0xc')](_0xf6f7('0x15'),_0x438e3d);logger[_0xf6f7('0x1f')](_0xf6f7('0x15'),_0x438e3d,JSON[_0xf6f7('0xf')](_0x49dd11));_0x5cc7a1(_0x49dd11);})[_0xf6f7('0x20')](function(_0x4b3100){logger['error']('GetCampaign',_0x4b3100[_0xf6f7('0x12')],_0x438e3d);_0x5ba9f0(_0xc23839['error'](0x1f4,_0x4b3100[_0xf6f7('0x12')]));});});}; \ No newline at end of file +var _0x7333=['info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x7333,0xfc));var _0x3733=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7333[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var moment=require(_0x3733('0x1'));var BPromise=require('bluebird');var rs=require(_0x3733('0x2'));var fs=require('fs');var Redis=require(_0x3733('0x3'));var db=require(_0x3733('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3733('0x5'))(_0x3733('0x6'));var config=require(_0x3733('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3733('0x8')][_0x3733('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3330c6,_0x3aab36,_0x5b5a50){return new BPromise(function(_0x1ee542,_0x5b184b){return client[_0x3733('0xa')](_0x3330c6,_0x5b5a50)[_0x3733('0xb')](function(_0x3bf4bc){logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));logger['debug'](_0x3733('0xe'),_0x3aab36,_0x3733('0xd'),JSON[_0x3733('0xf')](_0x3bf4bc));if(_0x3bf4bc[_0x3733('0x10')]){if(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x11')]===0x1f4){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x5b184b(_0x3bf4bc[_0x3733('0x10')]['message']);}logger['error'](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x1ee542(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);}else{logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));_0x1ee542(_0x3bf4bc[_0x3733('0x14')][_0x3733('0x13')]);}})[_0x3733('0x15')](function(_0x56c17a){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x56c17a);_0x5b184b(_0x56c17a);});});}exports[_0x3733('0x16')]=function(_0xd0f743){var _0x497600=this;return new Promise(function(_0x24a91e,_0x328490){return db[_0x3733('0x17')][_0x3733('0x18')]({'raw':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1a')]===undefined?!![]:![]:!![],'where':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')]['where']||null:null,'attributes':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1b')]||null:null,'limit':_0xd0f743['options']?_0xd0f743[_0x3733('0x19')][_0x3733('0x1c')]||null:null,'include':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1d')]?_[_0x3733('0x1e')](_0xd0f743[_0x3733('0x19')]['include'],function(_0x3187a3){return{'model':db[_0x3187a3['model']],'as':_0x3187a3['as'],'attributes':_0x3187a3[_0x3733('0x1b')],'include':_0x3187a3[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3187a3[_0x3733('0x1d')],function(_0x3f77d0){return{'model':db[_0x3f77d0[_0x3733('0x1f')]],'as':_0x3f77d0['as'],'attributes':_0x3f77d0[_0x3733('0x1b')],'include':_0x3f77d0[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3f77d0['include'],function(_0x1ce6c1){return{'model':db[_0x1ce6c1['model']],'as':_0x1ce6c1['as'],'attributes':_0x1ce6c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3733('0xb')](function(_0x12169e){logger[_0x3733('0xc')]('GetCampaign',_0xd0f743);logger[_0x3733('0x20')](_0x3733('0x16'),_0xd0f743,JSON[_0x3733('0xf')](_0x12169e));_0x24a91e(_0x12169e);})[_0x3733('0x15')](function(_0x13b66e){logger[_0x3733('0x10')](_0x3733('0x16'),_0x13b66e['message'],_0xd0f743);_0x328490(_0x497600[_0x3733('0x10')](0x1f4,_0x13b66e[_0x3733('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index dc7701f..b068556 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 _0x2b9a=['../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','put','update','delete','/:id/lists','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x36a4e0,_0x563105){var _0x1ee05d=function(_0x442538){while(--_0x442538){_0x36a4e0['push'](_0x36a4e0['shift']());}};_0x1ee05d(++_0x563105);}(_0x2b9a,0x164));var _0xa2b9=function(_0x5cc8b9,_0xd5a591){_0x5cc8b9=_0x5cc8b9-0x0;var _0x1e7ec9=_0x2b9a[_0x5cc8b9];return _0x1e7ec9;};'use strict';var multer=require(_0xa2b9('0x0'));var util=require(_0xa2b9('0x1'));var path=require(_0xa2b9('0x2'));var timeout=require(_0xa2b9('0x3'));var express=require(_0xa2b9('0x4'));var router=express[_0xa2b9('0x5')]();var fs_extra=require(_0xa2b9('0x6'));var auth=require(_0xa2b9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa2b9('0x8'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa2b9('0x9')]);router[_0xa2b9('0xa')](_0xa2b9('0xb'),auth[_0xa2b9('0xc')](),controller[_0xa2b9('0xd')]);router[_0xa2b9('0xa')]('/:id/hoppers',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0xe')]);router[_0xa2b9('0xa')](_0xa2b9('0xf'),auth['isAuthenticated'](),controller[_0xa2b9('0x10')]);router['get'](_0xa2b9('0x11'),auth['isAuthenticated'](),controller[_0xa2b9('0x12')]);router[_0xa2b9('0xa')]('/:id/hopper_black',auth[_0xa2b9('0xc')](),controller['getHopperBlacks']);router[_0xa2b9('0xa')]('/:id/lists',auth['isAuthenticated'](),controller[_0xa2b9('0x13')]);router[_0xa2b9('0xa')](_0xa2b9('0x14'),auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x15')]);router[_0xa2b9('0x16')]('/',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x17')]);router[_0xa2b9('0x16')]('/:id/clone',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x18')]);router[_0xa2b9('0x16')]('/:id/lists',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x19')]);router[_0xa2b9('0x16')]('/:id/blacklists',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x1a')]);router[_0xa2b9('0x1b')](_0xa2b9('0xb'),auth['isAuthenticated'](),controller[_0xa2b9('0x1c')]);router['delete']('/:id',auth[_0xa2b9('0xc')](),controller['destroy']);router[_0xa2b9('0x1d')](_0xa2b9('0x1e'),auth['isAuthenticated'](),controller[_0xa2b9('0x1f')]);router['delete'](_0xa2b9('0x14'),auth[_0xa2b9('0xc')](),controller['removeBlackLists']);module[_0xa2b9('0x20')]=router; \ No newline at end of file +var _0x0b96=['delete','/:id','destroy','removeLists','removeBlackLists','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0b96,0xc2));var _0x60b9=function(_0x327f41,_0x5c3672){_0x327f41=_0x327f41-0x0;var _0x3ffdae=_0x0b96[_0x327f41];return _0x3ffdae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x60b9('0x0'));var timeout=require(_0x60b9('0x1'));var express=require('express');var router=express[_0x60b9('0x2')]();var fs_extra=require(_0x60b9('0x3'));var auth=require(_0x60b9('0x4'));var interaction=require(_0x60b9('0x5'));var config=require('../../config/environment');var controller=require(_0x60b9('0x6'));router['get']('/',auth[_0x60b9('0x7')](),controller[_0x60b9('0x8')]);router[_0x60b9('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x60b9('0x9')](_0x60b9('0xa'),auth[_0x60b9('0x7')](),controller['getHoppers']);router[_0x60b9('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x60b9('0xb')]);router[_0x60b9('0x9')](_0x60b9('0xc'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x60b9('0xd')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x60b9('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0x60b9('0xe')]('/',auth[_0x60b9('0x7')](),controller['create']);router['post'](_0x60b9('0xf'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x10')]);router[_0x60b9('0xe')](_0x60b9('0x11'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x12')]);router[_0x60b9('0xe')](_0x60b9('0x13'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x14')]);router['put']('/:id',auth[_0x60b9('0x7')](),controller[_0x60b9('0x15')]);router[_0x60b9('0x16')](_0x60b9('0x17'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x18')]);router[_0x60b9('0x16')]('/:id/lists',auth[_0x60b9('0x7')](),controller[_0x60b9('0x19')]);router['delete'](_0x60b9('0x13'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e24c4c1..a383f38 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 _0x59c5=['TEXT','VIRTUAL','key','exports','STRING'];(function(_0x5f343f,_0x157119){var _0x509d92=function(_0x111a69){while(--_0x111a69){_0x5f343f['push'](_0x5f343f['shift']());}};_0x509d92(++_0x157119);}(_0x59c5,0x1c0));var _0x559c=function(_0x33727c,_0x170c69){_0x33727c=_0x33727c-0x0;var _0x7ce9d4=_0x59c5[_0x33727c];return _0x7ce9d4;};'use strict';var Sequelize=require('sequelize');module[_0x559c('0x0')]={'key':{'type':Sequelize[_0x559c('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x559c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x559c('0x1')]},'name':{'type':Sequelize[_0x559c('0x3')],'get':function(){return this['getDataValue'](_0x559c('0x4'));}}}; \ No newline at end of file +var _0x1f54=['STRING','TEXT','VIRTUAL','key','exports'];(function(_0x312e53,_0xa57cae){var _0x4b69dd=function(_0x84d6fc){while(--_0x84d6fc){_0x312e53['push'](_0x312e53['shift']());}};_0x4b69dd(++_0xa57cae);}(_0x1f54,0x15d));var _0x41f5=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x1f54[_0x277fa3];return _0x2e4520;};'use strict';var Sequelize=require('sequelize');module[_0x41f5('0x0')]={'key':{'type':Sequelize[_0x41f5('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x41f5('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x41f5('0x3')],'get':function(){return this['getDataValue'](_0x41f5('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index ad8a7f2..29361cb 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 _0x779c=['type','key','map','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','include','rows','catch','show','fields','includeAll','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x779c,0x1dd));var _0xc779=function(_0x4f800d,_0x2824f2){_0x4f800d=_0x4f800d-0x0;var _0x25421b=_0x779c[_0x4f800d];return _0x25421b;};'use strict';var emlformat=require(_0xc779('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc779('0x1'));var jsonpatch=require(_0xc779('0x2'));var rp=require(_0xc779('0x3'));var moment=require(_0xc779('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc779('0x5'));var util=require(_0xc779('0x6'));var path=require('path');var sox=require(_0xc779('0x7'));var csv=require(_0xc779('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc779('0x9'));var squel=require('squel');var crypto=require(_0xc779('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc779('0xb'));var toCsv=require(_0xc779('0x8'));var querystring=require(_0xc779('0xc'));var Papa=require(_0xc779('0xd'));var Redis=require('ioredis');var authService=require(_0xc779('0xe'));var qs=require(_0xc779('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc779('0x10'))(_0xc779('0x11'));var utils=require(_0xc779('0x12'));var config=require(_0xc779('0x13'));var licenseUtil=require(_0xc779('0x14'));var db=require(_0xc779('0x15'))['db'];function respondWithStatusCode(_0x24ec0e,_0x567b63){_0x567b63=_0x567b63||0xcc;return function(_0x582828){if(_0x582828){return _0x24ec0e[_0xc779('0x16')](_0x567b63);}return _0x24ec0e['status'](_0x567b63)[_0xc779('0x17')]();};}function respondWithResult(_0x2d7d35,_0x5ef7e9){_0x5ef7e9=_0x5ef7e9||0xc8;return function(_0x373926){if(_0x373926){return _0x2d7d35[_0xc779('0x18')](_0x5ef7e9)['json'](_0x373926);}};}function respondWithFilteredResult(_0x191070,_0x24c542){return function(_0x248ca1){if(_0x248ca1){var _0x2fc76b=typeof _0x24c542['offset']===_0xc779('0x19')&&typeof _0x24c542[_0xc779('0x1a')]==='undefined';var _0x417f6c=_0x248ca1[_0xc779('0x1b')];var _0x1f0ebc=_0x2fc76b?0x0:_0x24c542[_0xc779('0x1c')];var _0x1191ea=_0x2fc76b?_0x248ca1['count']:_0x24c542['offset']+_0x24c542[_0xc779('0x1a')];var _0x53de87;if(_0x1191ea>=_0x417f6c){_0x1191ea=_0x417f6c;_0x53de87=0xc8;}else{_0x53de87=0xce;}_0x191070[_0xc779('0x18')](_0x53de87);return _0x191070['set'](_0xc779('0x1d'),_0x1f0ebc+'-'+_0x1191ea+'/'+_0x417f6c)[_0xc779('0x1e')](_0x248ca1);}return null;};}function patchUpdates(_0x55820b){return function(_0xe6d35f){try{jsonpatch[_0xc779('0x1f')](_0xe6d35f,_0x55820b,!![]);}catch(_0x437280){return BPromise[_0xc779('0x20')](_0x437280);}return _0xe6d35f['save']();};}function saveUpdates(_0x521972,_0x3898be){return function(_0x567af8){if(_0x567af8){return _0x567af8[_0xc779('0x21')](_0x521972)[_0xc779('0x22')](function(_0x3148cb){return _0x3148cb;});}return null;};}function removeEntity(_0x5dbcdc,_0x44f769){return function(_0x22fb90){if(_0x22fb90){return _0x22fb90[_0xc779('0x23')]()['then'](function(){var _0x42d964=_0x22fb90[_0xc779('0x24')]({'plain':!![]});var _0x3eced8='CannedAnswers';return db[_0xc779('0x25')]['destroy']({'where':{'type':_0x3eced8,'resourceId':_0x42d964['id']}})[_0xc779('0x22')](function(){return _0x22fb90;});})['then'](function(){_0x5dbcdc[_0xc779('0x18')](0xcc)[_0xc779('0x17')]();});}};}function handleEntityNotFound(_0x157842,_0x401a2e){return function(_0x250595){if(!_0x250595){_0x157842['sendStatus'](0x194);}return _0x250595;};}function handleError(_0x4db079,_0x22e594){_0x22e594=_0x22e594||0x1f4;return function(_0x437227){logger[_0xc779('0x26')](_0x437227[_0xc779('0x27')]);if(_0x437227[_0xc779('0x28')]){delete _0x437227[_0xc779('0x28')];}_0x4db079[_0xc779('0x18')](_0x22e594)[_0xc779('0x29')](_0x437227);};}exports[_0xc779('0x2a')]=function(_0x1de117,_0x54d47d){var _0x31008a={},_0x6b4686={},_0x1b1d15={'count':0x0,'rows':[]};var _0x50ad3c=_['map'](db['CannedAnswer'][_0xc779('0x2b')],function(_0xe8c4f7){return{'name':_0xe8c4f7[_0xc779('0x2c')],'type':_0xe8c4f7[_0xc779('0x2d')][_0xc779('0x2e')]};});_0x6b4686['model']=_[_0xc779('0x2f')](_0x50ad3c,'name');_0x6b4686[_0xc779('0x30')]=_[_0xc779('0x31')](_0x1de117[_0xc779('0x30')]);_0x6b4686['filters']=_[_0xc779('0x32')](_0x6b4686[_0xc779('0x33')],_0x6b4686['query']);_0x31008a[_0xc779('0x34')]=_[_0xc779('0x32')](_0x6b4686[_0xc779('0x33')],qs['fields'](_0x1de117[_0xc779('0x30')]['fields']));_0x31008a[_0xc779('0x34')]=_0x31008a[_0xc779('0x34')][_0xc779('0x35')]?_0x31008a[_0xc779('0x34')]:_0x6b4686['model'];if(!_0x1de117[_0xc779('0x30')][_0xc779('0x36')](_0xc779('0x37'))){_0x31008a['limit']=qs[_0xc779('0x1a')](_0x1de117[_0xc779('0x30')][_0xc779('0x1a')]);_0x31008a[_0xc779('0x1c')]=qs[_0xc779('0x1c')](_0x1de117['query'][_0xc779('0x1c')]);}_0x31008a[_0xc779('0x38')]=qs[_0xc779('0x39')](_0x1de117[_0xc779('0x30')][_0xc779('0x39')]);_0x31008a[_0xc779('0x3a')]=qs[_0xc779('0x3b')](_[_0xc779('0x3c')](_0x1de117['query'],_0x6b4686['filters']),_0x50ad3c);if(_0x1de117[_0xc779('0x30')][_0xc779('0x3d')]){_0x31008a[_0xc779('0x3a')]=_[_0xc779('0x3e')](_0x31008a['where'],{'$or':[{'key':{'$like':'%'+_0x1de117['query'][_0xc779('0x3d')]+'%'}},{'value':{'$like':'%'+_0x1de117[_0xc779('0x30')][_0xc779('0x3d')]+'%'}}]});}_0x31008a=_[_0xc779('0x3e')]({},_0x31008a,_0x1de117[_0xc779('0x3f')]);var _0x219c56={'where':_0x31008a[_0xc779('0x3a')]};return db[_0xc779('0x40')]['count'](_0x219c56)['then'](function(_0x40b16b){_0x1b1d15[_0xc779('0x1b')]=_0x40b16b;if(_0x1de117['query']['includeAll']){_0x31008a[_0xc779('0x41')]=[{'all':!![]}];}return db[_0xc779('0x40')]['findAll'](_0x31008a);})['then'](function(_0x15769c){_0x1b1d15[_0xc779('0x42')]=_0x15769c;return _0x1b1d15;})[_0xc779('0x22')](respondWithFilteredResult(_0x54d47d,_0x31008a))[_0xc779('0x43')](handleError(_0x54d47d,null));};exports[_0xc779('0x44')]=function(_0x25474e,_0x118499){var _0x1b3c3c={'raw':!![],'where':{'id':_0x25474e['params']['id']}},_0xb96ce0={};_0xb96ce0['model']=_[_0xc779('0x31')](db[_0xc779('0x40')][_0xc779('0x2b')]);_0xb96ce0[_0xc779('0x30')]=_['keys'](_0x25474e[_0xc779('0x30')]);_0xb96ce0[_0xc779('0x3b')]=_[_0xc779('0x32')](_0xb96ce0[_0xc779('0x33')],_0xb96ce0[_0xc779('0x30')]);_0x1b3c3c[_0xc779('0x34')]=_[_0xc779('0x32')](_0xb96ce0['model'],qs[_0xc779('0x45')](_0x25474e[_0xc779('0x30')]['fields']));_0x1b3c3c[_0xc779('0x34')]=_0x1b3c3c[_0xc779('0x34')][_0xc779('0x35')]?_0x1b3c3c[_0xc779('0x34')]:_0xb96ce0[_0xc779('0x33')];if(_0x25474e[_0xc779('0x30')][_0xc779('0x46')]){_0x1b3c3c[_0xc779('0x41')]=[{'all':!![]}];}_0x1b3c3c=_['merge']({},_0x1b3c3c,_0x25474e['options']);return db[_0xc779('0x40')]['find'](_0x1b3c3c)[_0xc779('0x22')](handleEntityNotFound(_0x118499,null))[_0xc779('0x22')](respondWithResult(_0x118499,null))[_0xc779('0x43')](handleError(_0x118499,null));};exports[_0xc779('0x21')]=function(_0x59379b,_0x26ad0d){if(_0x59379b[_0xc779('0x47')]['id']){delete _0x59379b['body']['id'];}return db[_0xc779('0x40')][_0xc779('0x48')]({'where':{'id':_0x59379b[_0xc779('0x49')]['id']}})['then'](handleEntityNotFound(_0x26ad0d,null))[_0xc779('0x22')](saveUpdates(_0x59379b[_0xc779('0x47')],null))[_0xc779('0x22')](respondWithResult(_0x26ad0d,null))[_0xc779('0x43')](handleError(_0x26ad0d,null));};exports[_0xc779('0x23')]=function(_0x8b571d,_0x185524){return db[_0xc779('0x40')][_0xc779('0x48')]({'where':{'id':_0x8b571d['params']['id']}})[_0xc779('0x22')](handleEntityNotFound(_0x185524,null))[_0xc779('0x22')](removeEntity(_0x185524,null))[_0xc779('0x43')](handleError(_0x185524,null));};exports[_0xc779('0x4a')]=function(_0x583199,_0x349356){var _0xc09ce3={'key':_0x583199['body'][_0xc779('0x2e')]};if(_0x583199[_0xc779('0x47')]['MailAccountId']){_0xc09ce3[_0xc779('0x4b')]=_0x583199[_0xc779('0x47')][_0xc779('0x4b')];}else if(_0x583199['body']['SmsAccountId']){_0xc09ce3[_0xc779('0x4c')]=_0x583199[_0xc779('0x47')][_0xc779('0x4c')];}else if(_0x583199[_0xc779('0x47')][_0xc779('0x4d')]){_0xc09ce3['OpenchannelAccountId']=_0x583199[_0xc779('0x47')][_0xc779('0x4d')];}else if(_0x583199[_0xc779('0x47')][_0xc779('0x4e')]){_0xc09ce3['ChatWebsiteId']=_0x583199[_0xc779('0x47')][_0xc779('0x4e')];}return db['CannedAnswer'][_0xc779('0x48')]({'where':_0xc09ce3})[_0xc779('0x22')](function(_0x1b4da0){if(_0x1b4da0){throw new db[(_0xc779('0x4f'))]['ValidationError'](_0xc779('0x50'));}return db[_0xc779('0x40')]['create'](_0x583199['body']);})[_0xc779('0x22')](function(_0x4837d0){var _0x2b84f0=_0x583199[_0xc779('0x51')]['get']({'plain':!![]});if(!_0x2b84f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b84f0[_0xc779('0x52')]===_0xc779('0x51')){var _0x1e613a=_0x4837d0[_0xc779('0x24')]({'plain':!![]});return db[_0xc779('0x53')][_0xc779('0x48')]({'where':{'name':_0xc779('0x54'),'userProfileId':_0x2b84f0[_0xc779('0x55')]},'raw':!![]})[_0xc779('0x22')](function(_0x46b19e){if(_0x46b19e&&_0x46b19e[_0xc779('0x56')]===0x0){return db['UserProfileResource'][_0xc779('0x4a')]({'name':_0x1e613a[_0xc779('0x28')],'resourceId':_0x1e613a['id'],'type':_0x46b19e[_0xc779('0x28')],'sectionId':_0x46b19e['id']},{})[_0xc779('0x22')](function(){return _0x4837d0;});}else{return _0x4837d0;}})[_0xc779('0x43')](function(_0x1f3fe0){logger[_0xc779('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f3fe0);throw _0x1f3fe0;});}return _0x4837d0;})['then'](respondWithResult(_0x349356,0xc9))[_0xc779('0x43')](handleError(_0x349356,null));}; \ No newline at end of file +var _0x382e=['include','findAll','rows','show','find','catch','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','key','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll'];(function(_0x41eeed,_0x42dc83){var _0x1fa067=function(_0x545e32){while(--_0x545e32){_0x41eeed['push'](_0x41eeed['shift']());}};_0x1fa067(++_0x42dc83);}(_0x382e,0x6d));var _0xe382=function(_0x3507b4,_0x603d00){_0x3507b4=_0x3507b4-0x0;var _0x4b56cd=_0x382e[_0x3507b4];return _0x4b56cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe382('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe382('0x1'));var rp=require(_0xe382('0x2'));var moment=require('moment');var BPromise=require(_0xe382('0x3'));var Mustache=require('mustache');var util=require(_0xe382('0x4'));var path=require(_0xe382('0x5'));var sox=require(_0xe382('0x6'));var csv=require(_0xe382('0x7'));var ejs=require(_0xe382('0x8'));var fs=require('fs');var fs_extra=require(_0xe382('0x9'));var _=require('lodash');var squel=require(_0xe382('0xa'));var crypto=require(_0xe382('0xb'));var jsforce=require(_0xe382('0xc'));var deskjs=require(_0xe382('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe382('0xe'));var Papa=require(_0xe382('0xf'));var Redis=require(_0xe382('0x10'));var authService=require(_0xe382('0x11'));var qs=require(_0xe382('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe382('0x13'))(_0xe382('0x14'));var utils=require(_0xe382('0x15'));var config=require(_0xe382('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a4bb3,_0x5dcbef){_0x5dcbef=_0x5dcbef||0xcc;return function(_0x381e80){if(_0x381e80){return _0x2a4bb3[_0xe382('0x17')](_0x5dcbef);}return _0x2a4bb3['status'](_0x5dcbef)[_0xe382('0x18')]();};}function respondWithResult(_0x97dfb4,_0x929339){_0x929339=_0x929339||0xc8;return function(_0x4020c3){if(_0x4020c3){return _0x97dfb4[_0xe382('0x19')](_0x929339)['json'](_0x4020c3);}};}function respondWithFilteredResult(_0x50b3cf,_0x5ac6e3){return function(_0x170fcb){if(_0x170fcb){var _0x484f91=typeof _0x5ac6e3[_0xe382('0x1a')]===_0xe382('0x1b')&&typeof _0x5ac6e3['limit']===_0xe382('0x1b');var _0x46aaac=_0x170fcb[_0xe382('0x1c')];var _0x4ff142=_0x484f91?0x0:_0x5ac6e3[_0xe382('0x1a')];var _0x218e32=_0x484f91?_0x170fcb[_0xe382('0x1c')]:_0x5ac6e3[_0xe382('0x1a')]+_0x5ac6e3[_0xe382('0x1d')];var _0x472c99;if(_0x218e32>=_0x46aaac){_0x218e32=_0x46aaac;_0x472c99=0xc8;}else{_0x472c99=0xce;}_0x50b3cf[_0xe382('0x19')](_0x472c99);return _0x50b3cf['set'](_0xe382('0x1e'),_0x4ff142+'-'+_0x218e32+'/'+_0x46aaac)[_0xe382('0x1f')](_0x170fcb);}return null;};}function patchUpdates(_0x22bedc){return function(_0x3b6bbd){try{jsonpatch[_0xe382('0x20')](_0x3b6bbd,_0x22bedc,!![]);}catch(_0x2b5867){return BPromise[_0xe382('0x21')](_0x2b5867);}return _0x3b6bbd[_0xe382('0x22')]();};}function saveUpdates(_0x3c285a,_0x3be8be){return function(_0x633c46){if(_0x633c46){return _0x633c46['update'](_0x3c285a)[_0xe382('0x23')](function(_0x5cfbdb){return _0x5cfbdb;});}return null;};}function removeEntity(_0x48fb44,_0x5356f9){return function(_0x173eca){if(_0x173eca){return _0x173eca[_0xe382('0x24')]()['then'](function(){var _0x43ffdc=_0x173eca[_0xe382('0x25')]({'plain':!![]});var _0x100d16=_0xe382('0x26');return db[_0xe382('0x27')][_0xe382('0x24')]({'where':{'type':_0x100d16,'resourceId':_0x43ffdc['id']}})[_0xe382('0x23')](function(){return _0x173eca;});})[_0xe382('0x23')](function(){_0x48fb44[_0xe382('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477248,_0x1bdc49){return function(_0xf9827){if(!_0xf9827){_0x477248[_0xe382('0x17')](0x194);}return _0xf9827;};}function handleError(_0x1f9f39,_0xe840f3){_0xe840f3=_0xe840f3||0x1f4;return function(_0x5e1d7e){logger[_0xe382('0x28')](_0x5e1d7e[_0xe382('0x29')]);if(_0x5e1d7e[_0xe382('0x2a')]){delete _0x5e1d7e['name'];}_0x1f9f39[_0xe382('0x19')](_0xe840f3)[_0xe382('0x2b')](_0x5e1d7e);};}exports['index']=function(_0x130214,_0xa1224){var _0x140fb1={},_0x3b72c9={},_0x23c5da={'count':0x0,'rows':[]};var _0x139f87=_[_0xe382('0x2c')](db[_0xe382('0x2d')][_0xe382('0x2e')],function(_0x263406){return{'name':_0x263406[_0xe382('0x2f')],'type':_0x263406['type'][_0xe382('0x30')]};});_0x3b72c9['model']=_[_0xe382('0x2c')](_0x139f87,_0xe382('0x2a'));_0x3b72c9[_0xe382('0x31')]=_[_0xe382('0x32')](_0x130214[_0xe382('0x31')]);_0x3b72c9['filters']=_[_0xe382('0x33')](_0x3b72c9['model'],_0x3b72c9[_0xe382('0x31')]);_0x140fb1['attributes']=_[_0xe382('0x33')](_0x3b72c9['model'],qs['fields'](_0x130214[_0xe382('0x31')][_0xe382('0x34')]));_0x140fb1[_0xe382('0x35')]=_0x140fb1['attributes'][_0xe382('0x36')]?_0x140fb1['attributes']:_0x3b72c9[_0xe382('0x37')];if(!_0x130214[_0xe382('0x31')][_0xe382('0x38')](_0xe382('0x39'))){_0x140fb1['limit']=qs[_0xe382('0x1d')](_0x130214[_0xe382('0x31')]['limit']);_0x140fb1[_0xe382('0x1a')]=qs['offset'](_0x130214['query'][_0xe382('0x1a')]);}_0x140fb1[_0xe382('0x3a')]=qs['sort'](_0x130214['query'][_0xe382('0x3b')]);_0x140fb1['where']=qs[_0xe382('0x3c')](_[_0xe382('0x3d')](_0x130214['query'],_0x3b72c9[_0xe382('0x3c')]),_0x139f87);if(_0x130214[_0xe382('0x31')][_0xe382('0x3e')]){_0x140fb1[_0xe382('0x3f')]=_[_0xe382('0x40')](_0x140fb1[_0xe382('0x3f')],{'$or':[{'key':{'$like':'%'+_0x130214[_0xe382('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x130214[_0xe382('0x31')][_0xe382('0x3e')]+'%'}}]});}_0x140fb1=_[_0xe382('0x40')]({},_0x140fb1,_0x130214[_0xe382('0x41')]);var _0x412d38={'where':_0x140fb1[_0xe382('0x3f')]};return db[_0xe382('0x2d')][_0xe382('0x1c')](_0x412d38)[_0xe382('0x23')](function(_0x5d0c6e){_0x23c5da['count']=_0x5d0c6e;if(_0x130214[_0xe382('0x31')][_0xe382('0x42')]){_0x140fb1[_0xe382('0x43')]=[{'all':!![]}];}return db[_0xe382('0x2d')][_0xe382('0x44')](_0x140fb1);})[_0xe382('0x23')](function(_0x50594f){_0x23c5da[_0xe382('0x45')]=_0x50594f;return _0x23c5da;})[_0xe382('0x23')](respondWithFilteredResult(_0xa1224,_0x140fb1))['catch'](handleError(_0xa1224,null));};exports[_0xe382('0x46')]=function(_0x190727,_0x13abaf){var _0x5c1a3b={'raw':!![],'where':{'id':_0x190727['params']['id']}},_0x2b8c38={};_0x2b8c38['model']=_[_0xe382('0x32')](db[_0xe382('0x2d')][_0xe382('0x2e')]);_0x2b8c38[_0xe382('0x31')]=_['keys'](_0x190727[_0xe382('0x31')]);_0x2b8c38[_0xe382('0x3c')]=_[_0xe382('0x33')](_0x2b8c38['model'],_0x2b8c38[_0xe382('0x31')]);_0x5c1a3b['attributes']=_[_0xe382('0x33')](_0x2b8c38[_0xe382('0x37')],qs['fields'](_0x190727['query'][_0xe382('0x34')]));_0x5c1a3b[_0xe382('0x35')]=_0x5c1a3b[_0xe382('0x35')][_0xe382('0x36')]?_0x5c1a3b['attributes']:_0x2b8c38[_0xe382('0x37')];if(_0x190727[_0xe382('0x31')]['includeAll']){_0x5c1a3b[_0xe382('0x43')]=[{'all':!![]}];}_0x5c1a3b=_[_0xe382('0x40')]({},_0x5c1a3b,_0x190727['options']);return db[_0xe382('0x2d')][_0xe382('0x47')](_0x5c1a3b)[_0xe382('0x23')](handleEntityNotFound(_0x13abaf,null))['then'](respondWithResult(_0x13abaf,null))[_0xe382('0x48')](handleError(_0x13abaf,null));};exports[_0xe382('0x49')]=function(_0x194396,_0x3475a7){if(_0x194396[_0xe382('0x4a')]['id']){delete _0x194396['body']['id'];}return db[_0xe382('0x2d')][_0xe382('0x47')]({'where':{'id':_0x194396['params']['id']}})[_0xe382('0x23')](handleEntityNotFound(_0x3475a7,null))[_0xe382('0x23')](saveUpdates(_0x194396[_0xe382('0x4a')],null))['then'](respondWithResult(_0x3475a7,null))[_0xe382('0x48')](handleError(_0x3475a7,null));};exports[_0xe382('0x24')]=function(_0x46a99d,_0x1c7d74){return db[_0xe382('0x2d')][_0xe382('0x47')]({'where':{'id':_0x46a99d['params']['id']}})[_0xe382('0x23')](handleEntityNotFound(_0x1c7d74,null))[_0xe382('0x23')](removeEntity(_0x1c7d74,null))[_0xe382('0x48')](handleError(_0x1c7d74,null));};exports[_0xe382('0x4b')]=function(_0x39194e,_0xd92e24){var _0x3370c7={'key':_0x39194e[_0xe382('0x4a')]['key']};if(_0x39194e[_0xe382('0x4a')][_0xe382('0x4c')]){_0x3370c7[_0xe382('0x4c')]=_0x39194e[_0xe382('0x4a')]['MailAccountId'];}else if(_0x39194e[_0xe382('0x4a')][_0xe382('0x4d')]){_0x3370c7[_0xe382('0x4d')]=_0x39194e[_0xe382('0x4a')][_0xe382('0x4d')];}else if(_0x39194e[_0xe382('0x4a')][_0xe382('0x4e')]){_0x3370c7[_0xe382('0x4e')]=_0x39194e[_0xe382('0x4a')][_0xe382('0x4e')];}else if(_0x39194e[_0xe382('0x4a')]['ChatWebsiteId']){_0x3370c7[_0xe382('0x4f')]=_0x39194e[_0xe382('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer'][_0xe382('0x47')]({'where':_0x3370c7})[_0xe382('0x23')](function(_0x1941f6){if(_0x1941f6){throw new db['Sequelize']['ValidationError'](_0xe382('0x50'));}return db[_0xe382('0x2d')][_0xe382('0x4b')](_0x39194e[_0xe382('0x4a')]);})['then'](function(_0xb7d3e){var _0x112920=_0x39194e['user'][_0xe382('0x25')]({'plain':!![]});if(!_0x112920)throw new Error(_0xe382('0x51'));if(_0x112920[_0xe382('0x52')]===_0xe382('0x53')){var _0x5cefbc=_0xb7d3e[_0xe382('0x25')]({'plain':!![]});return db[_0xe382('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x112920[_0xe382('0x55')]},'raw':!![]})[_0xe382('0x23')](function(_0x5966d0){if(_0x5966d0&&_0x5966d0[_0xe382('0x56')]===0x0){return db[_0xe382('0x27')][_0xe382('0x4b')]({'name':_0x5cefbc[_0xe382('0x2a')],'resourceId':_0x5cefbc['id'],'type':_0x5966d0[_0xe382('0x2a')],'sectionId':_0x5966d0['id']},{})[_0xe382('0x23')](function(){return _0xb7d3e;});}else{return _0xb7d3e;}})['catch'](function(_0x4eac31){logger[_0xe382('0x28')](_0xe382('0x57'),_0x4eac31);throw _0x4eac31;});}return _0xb7d3e;})['then'](respondWithResult(_0xd92e24,0xc9))[_0xe382('0x48')](handleError(_0xd92e24,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 81f184e..79566c4 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 _0x153c=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x177385,_0x323024){var _0x1d4376=function(_0x21af8b){while(--_0x21af8b){_0x177385['push'](_0x177385['shift']());}};_0x1d4376(++_0x323024);}(_0x153c,0x8c));var _0xc153=function(_0x3dea86,_0x32414d){_0x3dea86=_0x3dea86-0x0;var _0x5a9bd1=_0x153c[_0x3dea86];return _0x5a9bd1;};'use strict';var _=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var logger=require(_0xc153('0x2'))(_0xc153('0x3'));var moment=require('moment');var BPromise=require(_0xc153('0x4'));var rp=require(_0xc153('0x5'));var fs=require('fs');var path=require(_0xc153('0x6'));var rimraf=require(_0xc153('0x7'));var config=require(_0xc153('0x8'));var attributes=require(_0xc153('0x9'));module[_0xc153('0xa')]=function(_0x58f5c5,_0x267a79){return _0x58f5c5[_0xc153('0xb')](_0xc153('0xc'),attributes,{'tableName':_0xc153('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc153('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x08ff=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xce87e3,_0x58cae4){var _0x7d87f4=function(_0x5bc232){while(--_0x5bc232){_0xce87e3['push'](_0xce87e3['shift']());}};_0x7d87f4(++_0x58cae4);}(_0x08ff,0x72));var _0xf08f=function(_0x5017e8,_0x44bf12){_0x5017e8=_0x5017e8-0x0;var _0x4f36f0=_0x08ff[_0x5017e8];return _0x4f36f0;};'use strict';var _=require(_0xf08f('0x0'));var util=require(_0xf08f('0x1'));var logger=require(_0xf08f('0x2'))(_0xf08f('0x3'));var moment=require(_0xf08f('0x4'));var BPromise=require(_0xf08f('0x5'));var rp=require(_0xf08f('0x6'));var fs=require('fs');var path=require(_0xf08f('0x7'));var rimraf=require('rimraf');var config=require(_0xf08f('0x8'));var attributes=require(_0xf08f('0x9'));module[_0xf08f('0xa')]=function(_0x1bf734,_0x4a4e14){return _0x1bf734['define'](_0xf08f('0xb'),attributes,{'tableName':_0xf08f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf08f('0xd'),'collate':_0xf08f('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 36d3486..0962278 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(_0x2e9475,_0x47c48c){var _0x1106ca=function(_0x5c1cb2){while(--_0x5c1cb2){_0x2e9475['push'](_0x2e9475['shift']());}};_0x1106ca(++_0x47c48c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x4fda0c,_0x28b229){var _0x5e828a=function(_0x2e5604){while(--_0x2e5604){_0x4fda0c['push'](_0x4fda0c['shift']());}};_0x5e828a(++_0x28b229);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index e8defb0..e636f0c 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 _0xe47a=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id'];(function(_0x504d47,_0x59661f){var _0x238d51=function(_0x4658c5){while(--_0x4658c5){_0x504d47['push'](_0x504d47['shift']());}};_0x238d51(++_0x59661f);}(_0xe47a,0x13b));var _0xae47=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe47a[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0xae47('0x0'));var util=require(_0xae47('0x1'));var path=require(_0xae47('0x2'));var timeout=require(_0xae47('0x3'));var express=require(_0xae47('0x4'));var router=express[_0xae47('0x5')]();var fs_extra=require(_0xae47('0x6'));var auth=require(_0xae47('0x7'));var interaction=require(_0xae47('0x8'));var config=require(_0xae47('0x9'));var controller=require(_0xae47('0xa'));router[_0xae47('0xb')]('/',auth[_0xae47('0xc')](),controller[_0xae47('0xd')]);router[_0xae47('0xb')](_0xae47('0xe'),auth[_0xae47('0xc')](),controller[_0xae47('0xf')]);router['post']('/',auth[_0xae47('0xc')](),controller[_0xae47('0x10')]);router[_0xae47('0x11')](_0xae47('0xe'),auth[_0xae47('0xc')](),controller[_0xae47('0x12')]);router[_0xae47('0x13')](_0xae47('0xe'),auth[_0xae47('0xc')](),controller[_0xae47('0x14')]);module[_0xae47('0x15')]=router; \ No newline at end of file +var _0x38df=['isAuthenticated','index','get','/:id','post','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x31e94f,_0x42ecd6){var _0x1b8494=function(_0x5da15c){while(--_0x5da15c){_0x31e94f['push'](_0x31e94f['shift']());}};_0x1b8494(++_0x42ecd6);}(_0x38df,0x18d));var _0xf38d=function(_0xf6074f,_0x40fe18){_0xf6074f=_0xf6074f-0x0;var _0x4c6c10=_0x38df[_0xf6074f];return _0x4c6c10;};'use strict';var multer=require(_0xf38d('0x0'));var util=require(_0xf38d('0x1'));var path=require(_0xf38d('0x2'));var timeout=require('connect-timeout');var express=require(_0xf38d('0x3'));var router=express[_0xf38d('0x4')]();var fs_extra=require(_0xf38d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf38d('0x6'));var config=require(_0xf38d('0x7'));var controller=require(_0xf38d('0x8'));router['get']('/',auth[_0xf38d('0x9')](),controller[_0xf38d('0xa')]);router[_0xf38d('0xb')](_0xf38d('0xc'),auth[_0xf38d('0x9')](),controller['show']);router[_0xf38d('0xd')]('/',auth[_0xf38d('0x9')](),controller['create']);router['put'](_0xf38d('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf38d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 2a6ae7d..2383894 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 _0xd404=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x4d6da3,_0x290a5a){var _0x224d75=function(_0x1b2ff7){while(--_0x1b2ff7){_0x4d6da3['push'](_0x4d6da3['shift']());}};_0x224d75(++_0x290a5a);}(_0xd404,0x15b));var _0x4d40=function(_0x4c3c81,_0x337b82){_0x4c3c81=_0x4c3c81-0x0;var _0x4949f6=_0xd404[_0x4c3c81];return _0x4949f6;};'use strict';var Sequelize=require(_0x4d40('0x0'));module[_0x4d40('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x4d40('0x2')},'clid':{'type':Sequelize[_0x4d40('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x4d40('0x3')]},'dcontext':{'type':Sequelize[_0x4d40('0x3')]},'channel':{'type':Sequelize[_0x4d40('0x3')]},'dstchannel':{'type':Sequelize[_0x4d40('0x3')]},'lastapp':{'type':Sequelize[_0x4d40('0x3')]},'lastdata':{'type':Sequelize[_0x4d40('0x3')]},'duration':{'type':Sequelize[_0x4d40('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4d40('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4d40('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4d40('0x3')]},'userfield':{'type':Sequelize[_0x4d40('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x4d40('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4d40('0x3')]},'tag':{'type':Sequelize[_0x4d40('0x3')]}}; \ No newline at end of file +var _0x3fb7=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0xaaa012,_0x93128c){var _0x4ed948=function(_0x5acf29){while(--_0x5acf29){_0xaaa012['push'](_0xaaa012['shift']());}};_0x4ed948(++_0x93128c);}(_0x3fb7,0x187));var _0x73fb=function(_0x2cd286,_0x4cabb9){_0x2cd286=_0x2cd286-0x0;var _0x542b78=_0x3fb7[_0x2cd286];return _0x542b78;};'use strict';var Sequelize=require(_0x73fb('0x0'));module[_0x73fb('0x1')]={'calldate':{'type':Sequelize[_0x73fb('0x2')],'allowNull':![],'defaultValue':_0x73fb('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x73fb('0x4')]},'dst':{'type':Sequelize[_0x73fb('0x4')]},'dcontext':{'type':Sequelize[_0x73fb('0x4')]},'channel':{'type':Sequelize[_0x73fb('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x73fb('0x4')]},'lastdata':{'type':Sequelize[_0x73fb('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x73fb('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x73fb('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x73fb('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x73fb('0x4')]},'type':{'type':Sequelize[_0x73fb('0x4')]},'tag':{'type':Sequelize[_0x73fb('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 65457b0..ca3c3c7 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 _0x9335=['hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','include','findAll','then','rows','show','params','rawAttributes','includeAll','options','find','create','catch','update','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','error','name','send','map','Cdr','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x2960cd,_0x3aafb0){var _0x2df769=function(_0x38be58){while(--_0x38be58){_0x2960cd['push'](_0x2960cd['shift']());}};_0x2df769(++_0x3aafb0);}(_0x9335,0xab));var _0x5933=function(_0x27e9d3,_0x3b9b3e){_0x27e9d3=_0x27e9d3-0x0;var _0x325885=_0x9335[_0x27e9d3];return _0x325885;};'use strict';var emlformat=require(_0x5933('0x0'));var rimraf=require(_0x5933('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5933('0x2'));var rp=require(_0x5933('0x3'));var moment=require(_0x5933('0x4'));var BPromise=require(_0x5933('0x5'));var Mustache=require(_0x5933('0x6'));var util=require(_0x5933('0x7'));var path=require(_0x5933('0x8'));var sox=require('sox');var csv=require(_0x5933('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5933('0xa'));var squel=require(_0x5933('0xb'));var crypto=require(_0x5933('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5933('0xd'));var toCsv=require(_0x5933('0x9'));var querystring=require(_0x5933('0xe'));var Papa=require(_0x5933('0xf'));var Redis=require(_0x5933('0x10'));var authService=require(_0x5933('0x11'));var qs=require(_0x5933('0x12'));var as=require(_0x5933('0x13'));var hardwareService=require(_0x5933('0x14'));var logger=require(_0x5933('0x15'))(_0x5933('0x16'));var utils=require(_0x5933('0x17'));var config=require(_0x5933('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5933('0x19'))['db'];function respondWithStatusCode(_0x5af679,_0x8b6bad){_0x8b6bad=_0x8b6bad||0xcc;return function(_0x1b4428){if(_0x1b4428){return _0x5af679[_0x5933('0x1a')](_0x8b6bad);}return _0x5af679['status'](_0x8b6bad)[_0x5933('0x1b')]();};}function respondWithResult(_0x542448,_0x1ab3d0){_0x1ab3d0=_0x1ab3d0||0xc8;return function(_0x4fc51d){if(_0x4fc51d){return _0x542448[_0x5933('0x1c')](_0x1ab3d0)['json'](_0x4fc51d);}};}function respondWithFilteredResult(_0xf6321f,_0x5e91da){return function(_0x404555){if(_0x404555){var _0x34c035=typeof _0x5e91da[_0x5933('0x1d')]==='undefined'&&typeof _0x5e91da['limit']===_0x5933('0x1e');var _0x2a2532=_0x404555[_0x5933('0x1f')];var _0x51a525=_0x34c035?0x0:_0x5e91da['offset'];var _0x15263f=_0x34c035?_0x404555['count']:_0x5e91da[_0x5933('0x1d')]+_0x5e91da[_0x5933('0x20')];var _0x21b1d7;if(_0x15263f>=_0x2a2532){_0x15263f=_0x2a2532;_0x21b1d7=0xc8;}else{_0x21b1d7=0xce;}_0xf6321f['status'](_0x21b1d7);return _0xf6321f[_0x5933('0x21')](_0x5933('0x22'),_0x51a525+'-'+_0x15263f+'/'+_0x2a2532)[_0x5933('0x23')](_0x404555);}return null;};}function patchUpdates(_0x4d661c){return function(_0x59a2cd){try{jsonpatch['apply'](_0x59a2cd,_0x4d661c,!![]);}catch(_0x36d602){return BPromise['reject'](_0x36d602);}return _0x59a2cd[_0x5933('0x24')]();};}function saveUpdates(_0x4a5252,_0x2d0fb7){return function(_0x50026f){if(_0x50026f){return _0x50026f['update'](_0x4a5252)['then'](function(_0x4a1901){return _0x4a1901;});}return null;};}function removeEntity(_0x3d70ef,_0x5639c7){return function(_0x1a2f5d){if(_0x1a2f5d){return _0x1a2f5d['destroy']()['then'](function(){_0x3d70ef[_0x5933('0x1c')](0xcc)[_0x5933('0x1b')]();});}};}function handleEntityNotFound(_0x297b15,_0x56e8a9){return function(_0xd2320){if(!_0xd2320){_0x297b15[_0x5933('0x1a')](0x194);}return _0xd2320;};}function handleError(_0x2348bc,_0x5a0de4){_0x5a0de4=_0x5a0de4||0x1f4;return function(_0x1e24f6){logger[_0x5933('0x25')](_0x1e24f6['stack']);if(_0x1e24f6[_0x5933('0x26')]){delete _0x1e24f6[_0x5933('0x26')];}_0x2348bc['status'](_0x5a0de4)[_0x5933('0x27')](_0x1e24f6);};}exports['index']=function(_0x51dbae,_0x45039b){var _0x1af598={},_0x4adb80={},_0x255ed5={'count':0x0,'rows':[]};var _0x51e2d6=_[_0x5933('0x28')](db[_0x5933('0x29')]['rawAttributes'],function(_0x4fc086){return{'name':_0x4fc086['fieldName'],'type':_0x4fc086[_0x5933('0x2a')][_0x5933('0x2b')]};});_0x4adb80['model']=_[_0x5933('0x28')](_0x51e2d6,_0x5933('0x26'));_0x4adb80[_0x5933('0x2c')]=_[_0x5933('0x2d')](_0x51dbae['query']);_0x4adb80[_0x5933('0x2e')]=_['intersection'](_0x4adb80[_0x5933('0x2f')],_0x4adb80['query']);_0x1af598[_0x5933('0x30')]=_[_0x5933('0x31')](_0x4adb80[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x51dbae['query'][_0x5933('0x32')]));_0x1af598[_0x5933('0x30')]=_0x1af598['attributes']['length']?_0x1af598[_0x5933('0x30')]:_0x4adb80['model'];if(!_0x51dbae['query'][_0x5933('0x33')](_0x5933('0x34'))){_0x1af598[_0x5933('0x20')]=qs[_0x5933('0x20')](_0x51dbae['query']['limit']);_0x1af598['offset']=qs['offset'](_0x51dbae[_0x5933('0x2c')]['offset']);}_0x1af598['order']=qs['sort'](_0x51dbae[_0x5933('0x2c')][_0x5933('0x35')]);_0x1af598[_0x5933('0x36')]=qs[_0x5933('0x2e')](_[_0x5933('0x37')](_0x51dbae[_0x5933('0x2c')],_0x4adb80[_0x5933('0x2e')]),_0x51e2d6);if(_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]){_0x1af598[_0x5933('0x36')]=_['merge'](_0x1af598[_0x5933('0x36')],{'$or':_[_0x5933('0x28')](_0x51e2d6,function(_0x6e2a66){if(_0x6e2a66[_0x5933('0x2a')]!==_0x5933('0x39')){var _0x2c1484={};_0x2c1484[_0x6e2a66[_0x5933('0x26')]]={'$like':'%'+_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]+'%'};return _0x2c1484;}})});}_0x1af598=_[_0x5933('0x3a')]({},_0x1af598,_0x51dbae['options']);var _0x5c2bd0={'where':_0x1af598[_0x5933('0x36')]};return db[_0x5933('0x29')][_0x5933('0x1f')](_0x5c2bd0)['then'](function(_0x5d07da){_0x255ed5[_0x5933('0x1f')]=_0x5d07da;if(_0x51dbae[_0x5933('0x2c')]['includeAll']){_0x1af598[_0x5933('0x3b')]=[{'all':!![]}];}return db[_0x5933('0x29')][_0x5933('0x3c')](_0x1af598);})[_0x5933('0x3d')](function(_0x192576){_0x255ed5[_0x5933('0x3e')]=_0x192576;return _0x255ed5;})['then'](respondWithFilteredResult(_0x45039b,_0x1af598))['catch'](handleError(_0x45039b,null));};exports[_0x5933('0x3f')]=function(_0x1aef52,_0x36d072){var _0x293845={'raw':!![],'where':{'id':_0x1aef52[_0x5933('0x40')]['id']}},_0x247c65={};_0x247c65['model']=_[_0x5933('0x2d')](db[_0x5933('0x29')][_0x5933('0x41')]);_0x247c65['query']=_[_0x5933('0x2d')](_0x1aef52[_0x5933('0x2c')]);_0x247c65[_0x5933('0x2e')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],_0x247c65[_0x5933('0x2c')]);_0x293845[_0x5933('0x30')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x1aef52['query'][_0x5933('0x32')]));_0x293845['attributes']=_0x293845['attributes']['length']?_0x293845[_0x5933('0x30')]:_0x247c65['model'];if(_0x1aef52['query'][_0x5933('0x42')]){_0x293845[_0x5933('0x3b')]=[{'all':!![]}];}_0x293845=_['merge']({},_0x293845,_0x1aef52[_0x5933('0x43')]);return db['Cdr'][_0x5933('0x44')](_0x293845)[_0x5933('0x3d')](handleEntityNotFound(_0x36d072,null))['then'](respondWithResult(_0x36d072,null))['catch'](handleError(_0x36d072,null));};exports[_0x5933('0x45')]=function(_0x4622bd,_0x38e713){return db[_0x5933('0x29')][_0x5933('0x45')](_0x4622bd['body'],{})[_0x5933('0x3d')](respondWithResult(_0x38e713,0xc9))[_0x5933('0x46')](handleError(_0x38e713,null));};exports[_0x5933('0x47')]=function(_0x4c2e69,_0x2d5fd4){if(_0x4c2e69[_0x5933('0x48')]['id']){delete _0x4c2e69[_0x5933('0x48')]['id'];}return db[_0x5933('0x29')]['find']({'where':{'id':_0x4c2e69[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x2d5fd4,null))[_0x5933('0x3d')](saveUpdates(_0x4c2e69[_0x5933('0x48')],null))['then'](respondWithResult(_0x2d5fd4,null))[_0x5933('0x46')](handleError(_0x2d5fd4,null));};exports[_0x5933('0x49')]=function(_0x41be67,_0x38f681){return db[_0x5933('0x29')][_0x5933('0x44')]({'where':{'id':_0x41be67[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x38f681,null))[_0x5933('0x3d')](removeEntity(_0x38f681,null))[_0x5933('0x46')](handleError(_0x38f681,null));};exports['describe']=function(_0x3fdd78,_0x4d0bb8){return db[_0x5933('0x29')]['describe']()[_0x5933('0x3d')](respondWithResult(_0x4d0bb8,null))['catch'](handleError(_0x4d0bb8,null));}; \ No newline at end of file +var _0x9009=['stack','name','index','Cdr','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','catch','show','params','includeAll','include','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x9009,0x1d4));var _0x9900=function(_0x38e707,_0x2432de){_0x38e707=_0x38e707-0x0;var _0x2816dd=_0x9009[_0x38e707];return _0x2816dd;};'use strict';var emlformat=require(_0x9900('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9900('0x1'));var jsonpatch=require(_0x9900('0x2'));var rp=require('request-promise');var moment=require(_0x9900('0x3'));var BPromise=require(_0x9900('0x4'));var Mustache=require(_0x9900('0x5'));var util=require(_0x9900('0x6'));var path=require('path');var sox=require(_0x9900('0x7'));var csv=require(_0x9900('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9900('0x9'));var squel=require(_0x9900('0xa'));var crypto=require('crypto');var jsforce=require(_0x9900('0xb'));var deskjs=require(_0x9900('0xc'));var toCsv=require(_0x9900('0x8'));var querystring=require(_0x9900('0xd'));var Papa=require('papaparse');var Redis=require(_0x9900('0xe'));var authService=require(_0x9900('0xf'));var qs=require(_0x9900('0x10'));var as=require(_0x9900('0x11'));var hardwareService=require(_0x9900('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9900('0x13'));var config=require(_0x9900('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17070a,_0x4e8312){_0x4e8312=_0x4e8312||0xcc;return function(_0x6bd4da){if(_0x6bd4da){return _0x17070a[_0x9900('0x15')](_0x4e8312);}return _0x17070a[_0x9900('0x16')](_0x4e8312)[_0x9900('0x17')]();};}function respondWithResult(_0x318fa5,_0x1014e8){_0x1014e8=_0x1014e8||0xc8;return function(_0x2eaf32){if(_0x2eaf32){return _0x318fa5[_0x9900('0x16')](_0x1014e8)[_0x9900('0x18')](_0x2eaf32);}};}function respondWithFilteredResult(_0x209b4d,_0x375ee0){return function(_0xce2dd6){if(_0xce2dd6){var _0x154e22=typeof _0x375ee0[_0x9900('0x19')]===_0x9900('0x1a')&&typeof _0x375ee0[_0x9900('0x1b')]===_0x9900('0x1a');var _0x5d9ec9=_0xce2dd6['count'];var _0x1017a5=_0x154e22?0x0:_0x375ee0[_0x9900('0x19')];var _0x1bd7a3=_0x154e22?_0xce2dd6[_0x9900('0x1c')]:_0x375ee0['offset']+_0x375ee0[_0x9900('0x1b')];var _0x57ae85;if(_0x1bd7a3>=_0x5d9ec9){_0x1bd7a3=_0x5d9ec9;_0x57ae85=0xc8;}else{_0x57ae85=0xce;}_0x209b4d['status'](_0x57ae85);return _0x209b4d[_0x9900('0x1d')]('Content-Range',_0x1017a5+'-'+_0x1bd7a3+'/'+_0x5d9ec9)[_0x9900('0x18')](_0xce2dd6);}return null;};}function patchUpdates(_0x596eff){return function(_0x48d6df){try{jsonpatch[_0x9900('0x1e')](_0x48d6df,_0x596eff,!![]);}catch(_0x2892ce){return BPromise[_0x9900('0x1f')](_0x2892ce);}return _0x48d6df[_0x9900('0x20')]();};}function saveUpdates(_0x5ee4ad,_0x215bd4){return function(_0x3e4cee){if(_0x3e4cee){return _0x3e4cee[_0x9900('0x21')](_0x5ee4ad)[_0x9900('0x22')](function(_0x45c0d0){return _0x45c0d0;});}return null;};}function removeEntity(_0x5368bf,_0x37842b){return function(_0x218d7e){if(_0x218d7e){return _0x218d7e['destroy']()[_0x9900('0x22')](function(){_0x5368bf[_0x9900('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a015,_0x43ed24){return function(_0x2ac147){if(!_0x2ac147){_0x54a015['sendStatus'](0x194);}return _0x2ac147;};}function handleError(_0x285d51,_0x4507a9){_0x4507a9=_0x4507a9||0x1f4;return function(_0x5e3e21){logger[_0x9900('0x23')](_0x5e3e21[_0x9900('0x24')]);if(_0x5e3e21[_0x9900('0x25')]){delete _0x5e3e21[_0x9900('0x25')];}_0x285d51[_0x9900('0x16')](_0x4507a9)['send'](_0x5e3e21);};}exports[_0x9900('0x26')]=function(_0x44d775,_0x10fbae){var _0x32e343={},_0x3b1b94={},_0x50f16a={'count':0x0,'rows':[]};var _0x4cef1f=_['map'](db[_0x9900('0x27')][_0x9900('0x28')],function(_0x4ef405){return{'name':_0x4ef405[_0x9900('0x29')],'type':_0x4ef405[_0x9900('0x2a')][_0x9900('0x2b')]};});_0x3b1b94['model']=_['map'](_0x4cef1f,_0x9900('0x25'));_0x3b1b94[_0x9900('0x2c')]=_[_0x9900('0x2d')](_0x44d775[_0x9900('0x2c')]);_0x3b1b94['filters']=_['intersection'](_0x3b1b94[_0x9900('0x2e')],_0x3b1b94[_0x9900('0x2c')]);_0x32e343[_0x9900('0x2f')]=_[_0x9900('0x30')](_0x3b1b94[_0x9900('0x2e')],qs[_0x9900('0x31')](_0x44d775[_0x9900('0x2c')][_0x9900('0x31')]));_0x32e343[_0x9900('0x2f')]=_0x32e343[_0x9900('0x2f')][_0x9900('0x32')]?_0x32e343[_0x9900('0x2f')]:_0x3b1b94[_0x9900('0x2e')];if(!_0x44d775['query']['hasOwnProperty'](_0x9900('0x33'))){_0x32e343['limit']=qs[_0x9900('0x1b')](_0x44d775[_0x9900('0x2c')][_0x9900('0x1b')]);_0x32e343[_0x9900('0x19')]=qs[_0x9900('0x19')](_0x44d775[_0x9900('0x2c')][_0x9900('0x19')]);}_0x32e343[_0x9900('0x34')]=qs[_0x9900('0x35')](_0x44d775['query']['sort']);_0x32e343['where']=qs[_0x9900('0x36')](_[_0x9900('0x37')](_0x44d775['query'],_0x3b1b94[_0x9900('0x36')]),_0x4cef1f);if(_0x44d775[_0x9900('0x2c')][_0x9900('0x38')]){_0x32e343['where']=_[_0x9900('0x39')](_0x32e343[_0x9900('0x3a')],{'$or':_[_0x9900('0x3b')](_0x4cef1f,function(_0x141131){if(_0x141131[_0x9900('0x2a')]!==_0x9900('0x3c')){var _0x510d6a={};_0x510d6a[_0x141131[_0x9900('0x25')]]={'$like':'%'+_0x44d775[_0x9900('0x2c')]['filter']+'%'};return _0x510d6a;}})});}_0x32e343=_[_0x9900('0x39')]({},_0x32e343,_0x44d775['options']);var _0x2cee90={'where':_0x32e343[_0x9900('0x3a')]};return db['Cdr'][_0x9900('0x1c')](_0x2cee90)[_0x9900('0x22')](function(_0x2595cc){_0x50f16a[_0x9900('0x1c')]=_0x2595cc;if(_0x44d775[_0x9900('0x2c')]['includeAll']){_0x32e343['include']=[{'all':!![]}];}return db[_0x9900('0x27')]['findAll'](_0x32e343);})['then'](function(_0x5e2765){_0x50f16a['rows']=_0x5e2765;return _0x50f16a;})['then'](respondWithFilteredResult(_0x10fbae,_0x32e343))[_0x9900('0x3d')](handleError(_0x10fbae,null));};exports[_0x9900('0x3e')]=function(_0x3c8f30,_0x42849a){var _0x31c003={'raw':!![],'where':{'id':_0x3c8f30[_0x9900('0x3f')]['id']}},_0xb94a40={};_0xb94a40[_0x9900('0x2e')]=_['keys'](db[_0x9900('0x27')][_0x9900('0x28')]);_0xb94a40['query']=_['keys'](_0x3c8f30[_0x9900('0x2c')]);_0xb94a40[_0x9900('0x36')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],_0xb94a40[_0x9900('0x2c')]);_0x31c003[_0x9900('0x2f')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],qs['fields'](_0x3c8f30[_0x9900('0x2c')][_0x9900('0x31')]));_0x31c003['attributes']=_0x31c003[_0x9900('0x2f')][_0x9900('0x32')]?_0x31c003[_0x9900('0x2f')]:_0xb94a40[_0x9900('0x2e')];if(_0x3c8f30['query'][_0x9900('0x40')]){_0x31c003[_0x9900('0x41')]=[{'all':!![]}];}_0x31c003=_['merge']({},_0x31c003,_0x3c8f30[_0x9900('0x42')]);return db[_0x9900('0x27')][_0x9900('0x43')](_0x31c003)['then'](handleEntityNotFound(_0x42849a,null))[_0x9900('0x22')](respondWithResult(_0x42849a,null))['catch'](handleError(_0x42849a,null));};exports[_0x9900('0x44')]=function(_0x5ea06a,_0x1409a0){return db[_0x9900('0x27')][_0x9900('0x44')](_0x5ea06a['body'],{})[_0x9900('0x22')](respondWithResult(_0x1409a0,0xc9))['catch'](handleError(_0x1409a0,null));};exports[_0x9900('0x21')]=function(_0x11be07,_0x5ac239){if(_0x11be07[_0x9900('0x45')]['id']){delete _0x11be07[_0x9900('0x45')]['id'];}return db['Cdr'][_0x9900('0x43')]({'where':{'id':_0x11be07[_0x9900('0x3f')]['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x5ac239,null))[_0x9900('0x22')](saveUpdates(_0x11be07[_0x9900('0x45')],null))['then'](respondWithResult(_0x5ac239,null))['catch'](handleError(_0x5ac239,null));};exports[_0x9900('0x46')]=function(_0x43cf2c,_0x2aa081){return db[_0x9900('0x27')][_0x9900('0x43')]({'where':{'id':_0x43cf2c['params']['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x2aa081,null))[_0x9900('0x22')](removeEntity(_0x2aa081,null))[_0x9900('0x3d')](handleError(_0x2aa081,null));};exports[_0x9900('0x47')]=function(_0x2f7f74,_0xb5512f){return db[_0x9900('0x27')]['describe']()[_0x9900('0x22')](respondWithResult(_0xb5512f,null))['catch'](handleError(_0xb5512f,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 6292934..07fede9 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x11c6b0,_0x1df7ee){var _0x3b2324=function(_0x5c76a1){while(--_0x5c76a1){_0x11c6b0['push'](_0x11c6b0['shift']());}};_0x3b2324(++_0x1df7ee);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2a3693,_0x4797a3){var _0x2334cc=function(_0x3423c2){while(--_0x3423c2){_0x2a3693['push'](_0x2a3693['shift']());}};_0x2334cc(++_0x4797a3);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab45,_0x55b7d6){_0x5ab45=_0x5ab45-0x0;var _0x1974cb=_0x7a54[_0x5ab45];return _0x1974cb;};'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 c463548..62489f0 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 _0xea8d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x470721,_0x59f687){var _0x6b0cfd=function(_0x548c03){while(--_0x548c03){_0x470721['push'](_0x470721['shift']());}};_0x6b0cfd(++_0x59f687);}(_0xea8d,0x141));var _0xdea8=function(_0x453dd4,_0x33ccb6){_0x453dd4=_0x453dd4-0x0;var _0x4b755e=_0xea8d[_0x453dd4];return _0x4b755e;};'use strict';var _=require(_0xdea8('0x0'));var util=require(_0xdea8('0x1'));var moment=require(_0xdea8('0x2'));var BPromise=require(_0xdea8('0x3'));var rs=require(_0xdea8('0x4'));var fs=require('fs');var Redis=require(_0xdea8('0x5'));var db=require(_0xdea8('0x6'))['db'];var utils=require(_0xdea8('0x7'));var logger=require(_0xdea8('0x8'))(_0xdea8('0x9'));var config=require(_0xdea8('0xa'));var jayson=require(_0xdea8('0xb'));var client=jayson[_0xdea8('0xc')][_0xdea8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28f62f,_0x3c9611,_0x4177ee){return new BPromise(function(_0x9a47cb,_0x2ab537){return client[_0xdea8('0xe')](_0x28f62f,_0x4177ee)[_0xdea8('0xf')](function(_0x2a5fc5){logger[_0xdea8('0x10')](_0xdea8('0x11'),_0x3c9611,_0xdea8('0x12'));logger['debug'](_0xdea8('0x13'),_0x3c9611,_0xdea8('0x12'),JSON[_0xdea8('0x14')](_0x2a5fc5));if(_0x2a5fc5[_0xdea8('0x15')]){if(_0x2a5fc5['error'][_0xdea8('0x16')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x3c9611,_0x2a5fc5[_0xdea8('0x15')]['message']);return _0x2ab537(_0x2a5fc5[_0xdea8('0x15')][_0xdea8('0x17')]);}logger['error'](_0xdea8('0x11'),_0x3c9611,_0x2a5fc5['error'][_0xdea8('0x17')]);return _0x9a47cb(_0x2a5fc5['error'][_0xdea8('0x17')]);}else{logger[_0xdea8('0x10')]('Cdr,\x20%s,\x20%s',_0x3c9611,'request\x20sent');_0x9a47cb(_0x2a5fc5['result'][_0xdea8('0x17')]);}})[_0xdea8('0x18')](function(_0x400d9e){logger[_0xdea8('0x15')](_0xdea8('0x11'),_0x3c9611,_0x400d9e);_0x2ab537(_0x400d9e);});});} \ No newline at end of file +var _0xa06c=['moment','bluebird','ioredis','../../config/logger','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x57c8c3,_0x3fca68){var _0x5cf569=function(_0x1294f7){while(--_0x1294f7){_0x57c8c3['push'](_0x57c8c3['shift']());}};_0x5cf569(++_0x3fca68);}(_0xa06c,0x198));var _0xca06=function(_0x34c2b6,_0x5f50d4){_0x34c2b6=_0x34c2b6-0x0;var _0x1debad=_0xa06c[_0x34c2b6];return _0x1debad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca06('0x0'));var BPromise=require(_0xca06('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca06('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xca06('0x3'))('rpc');var config=require(_0xca06('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xca06('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31e48b,_0x429f61,_0x2c8bf0){return new BPromise(function(_0x4ab328,_0x20929f){return client[_0xca06('0x6')](_0x31e48b,_0x2c8bf0)[_0xca06('0x7')](function(_0x6ec5ca){logger[_0xca06('0x8')](_0xca06('0x9'),_0x429f61,_0xca06('0xa'));logger[_0xca06('0xb')](_0xca06('0xc'),_0x429f61,'request\x20sent',JSON[_0xca06('0xd')](_0x6ec5ca));if(_0x6ec5ca[_0xca06('0xe')]){if(_0x6ec5ca[_0xca06('0xe')]['code']===0x1f4){logger[_0xca06('0xe')](_0xca06('0x9'),_0x429f61,_0x6ec5ca[_0xca06('0xe')][_0xca06('0xf')]);return _0x20929f(_0x6ec5ca[_0xca06('0xe')][_0xca06('0xf')]);}logger[_0xca06('0xe')](_0xca06('0x9'),_0x429f61,_0x6ec5ca[_0xca06('0xe')]['message']);return _0x4ab328(_0x6ec5ca[_0xca06('0xe')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x429f61,'request\x20sent');_0x4ab328(_0x6ec5ca['result'][_0xca06('0xf')]);}})[_0xca06('0x10')](function(_0x41ef87){logger['error']('Cdr,\x20%s,\x20%s',_0x429f61,_0x41ef87);_0x20929f(_0x41ef87);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 8ec7197..081d7f6 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _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(_0xa4a9b3,_0x3b271c){var _0xb7a49e=function(_0x19e4ff){while(--_0x19e4ff){_0xa4a9b3['push'](_0xa4a9b3['shift']());}};_0xb7a49e(++_0x3b271c);}(_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 449f2d6..4a5f2f4 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 _0x3179=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x34fac8,_0x3f0373){var _0x30b379=function(_0x113e98){while(--_0x113e98){_0x34fac8['push'](_0x34fac8['shift']());}};_0x30b379(++_0x3f0373);}(_0x3179,0xc6));var _0x9317=function(_0x4517b3,_0x1f0b7f){_0x4517b3=_0x4517b3-0x0;var _0x3c7bbc=_0x3179[_0x4517b3];return _0x3c7bbc;};'use strict';var Sequelize=require(_0x9317('0x0'));module[_0x9317('0x1')]={'priority':{'type':Sequelize[_0x9317('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9317('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9317('0x3')]},'interval':{'type':Sequelize[_0x9317('0x3')],'defaultValue':_0x9317('0x4')}}; \ No newline at end of file +var _0xad30=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x3a743f,_0x4eb9b8){var _0x17b633=function(_0x321660){while(--_0x321660){_0x3a743f['push'](_0x3a743f['shift']());}};_0x17b633(++_0x4eb9b8);}(_0xad30,0x111));var _0x0ad3=function(_0x1ab181,_0x43ee89){_0x1ab181=_0x1ab181-0x0;var _0x1fd4a9=_0xad30[_0x1ab181];return _0x1fd4a9;};'use strict';var Sequelize=require(_0x0ad3('0x0'));module[_0x0ad3('0x1')]={'priority':{'type':Sequelize[_0x0ad3('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ad3('0x3')},'appdata':{'type':Sequelize[_0x0ad3('0x4')]()},'description':{'type':Sequelize[_0x0ad3('0x5')]},'interval':{'type':Sequelize[_0x0ad3('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index b6a99b3..3659a38 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 _0x23a8=['destroy','error','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','params','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x486244,_0x38307b){var _0x4fcf10=function(_0x4519c3){while(--_0x4519c3){_0x486244['push'](_0x486244['shift']());}};_0x4fcf10(++_0x38307b);}(_0x23a8,0x172));var _0x823a=function(_0x21b55f,_0x3ad1c0){_0x21b55f=_0x21b55f-0x0;var _0xbedcb6=_0x23a8[_0x21b55f];return _0xbedcb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x823a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x823a('0x1'));var rp=require('request-promise');var moment=require(_0x823a('0x2'));var BPromise=require(_0x823a('0x3'));var Mustache=require('mustache');var util=require(_0x823a('0x4'));var path=require('path');var sox=require(_0x823a('0x5'));var csv=require(_0x823a('0x6'));var ejs=require(_0x823a('0x7'));var fs=require('fs');var fs_extra=require(_0x823a('0x8'));var _=require('lodash');var squel=require(_0x823a('0x9'));var crypto=require(_0x823a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x823a('0xb'));var toCsv=require(_0x823a('0x6'));var querystring=require('querystring');var Papa=require(_0x823a('0xc'));var Redis=require(_0x823a('0xd'));var authService=require(_0x823a('0xe'));var qs=require(_0x823a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x823a('0x10'));var logger=require(_0x823a('0x11'))(_0x823a('0x12'));var utils=require(_0x823a('0x13'));var config=require(_0x823a('0x14'));var licenseUtil=require(_0x823a('0x15'));var db=require(_0x823a('0x16'))['db'];function respondWithStatusCode(_0x283b1c,_0x4c898d){_0x4c898d=_0x4c898d||0xcc;return function(_0x1fae57){if(_0x1fae57){return _0x283b1c['sendStatus'](_0x4c898d);}return _0x283b1c[_0x823a('0x17')](_0x4c898d)[_0x823a('0x18')]();};}function respondWithResult(_0x27732a,_0x531298){_0x531298=_0x531298||0xc8;return function(_0x4a54da){if(_0x4a54da){return _0x27732a[_0x823a('0x17')](_0x531298)[_0x823a('0x19')](_0x4a54da);}};}function respondWithFilteredResult(_0x208182,_0x54989a){return function(_0x569d0f){if(_0x569d0f){var _0x525d16=typeof _0x54989a[_0x823a('0x1a')]===_0x823a('0x1b')&&typeof _0x54989a[_0x823a('0x1c')]===_0x823a('0x1b');var _0x25b92e=_0x569d0f[_0x823a('0x1d')];var _0xf66c9=_0x525d16?0x0:_0x54989a[_0x823a('0x1a')];var _0xedc3d1=_0x525d16?_0x569d0f[_0x823a('0x1d')]:_0x54989a[_0x823a('0x1a')]+_0x54989a[_0x823a('0x1c')];var _0x48b6ca;if(_0xedc3d1>=_0x25b92e){_0xedc3d1=_0x25b92e;_0x48b6ca=0xc8;}else{_0x48b6ca=0xce;}_0x208182[_0x823a('0x17')](_0x48b6ca);return _0x208182[_0x823a('0x1e')](_0x823a('0x1f'),_0xf66c9+'-'+_0xedc3d1+'/'+_0x25b92e)[_0x823a('0x19')](_0x569d0f);}return null;};}function patchUpdates(_0x305992){return function(_0x3dbc6b){try{jsonpatch[_0x823a('0x20')](_0x3dbc6b,_0x305992,!![]);}catch(_0x31ae96){return BPromise[_0x823a('0x21')](_0x31ae96);}return _0x3dbc6b[_0x823a('0x22')]();};}function saveUpdates(_0x4cabe1,_0x29d8a5){return function(_0x4b8ca1){if(_0x4b8ca1){return _0x4b8ca1['update'](_0x4cabe1)[_0x823a('0x23')](function(_0x196724){return _0x196724;});}return null;};}function removeEntity(_0x56286a,_0x2fb984){return function(_0x5d5cc0){if(_0x5d5cc0){return _0x5d5cc0[_0x823a('0x24')]()['then'](function(){_0x56286a[_0x823a('0x17')](0xcc)[_0x823a('0x18')]();});}};}function handleEntityNotFound(_0x4c898a,_0x1be429){return function(_0xc332dc){if(!_0xc332dc){_0x4c898a['sendStatus'](0x194);}return _0xc332dc;};}function handleError(_0x302926,_0xbca8f9){_0xbca8f9=_0xbca8f9||0x1f4;return function(_0x10bdf2){logger[_0x823a('0x25')](_0x10bdf2['stack']);if(_0x10bdf2[_0x823a('0x26')]){delete _0x10bdf2[_0x823a('0x26')];}_0x302926[_0x823a('0x17')](_0xbca8f9)[_0x823a('0x27')](_0x10bdf2);};}exports[_0x823a('0x28')]=function(_0x515393,_0x11450a){var _0x43c073={'raw':!![],'where':{'id':_0x515393['params']['id']}},_0x4cad01={};_0x4cad01[_0x823a('0x29')]=_[_0x823a('0x2a')](db[_0x823a('0x2b')]['rawAttributes']);_0x4cad01[_0x823a('0x2c')]=_[_0x823a('0x2a')](_0x515393[_0x823a('0x2c')]);_0x4cad01[_0x823a('0x2d')]=_[_0x823a('0x2e')](_0x4cad01[_0x823a('0x29')],_0x4cad01[_0x823a('0x2c')]);_0x43c073[_0x823a('0x2f')]=_[_0x823a('0x2e')](_0x4cad01[_0x823a('0x29')],qs[_0x823a('0x30')](_0x515393[_0x823a('0x2c')][_0x823a('0x30')]));_0x43c073[_0x823a('0x2f')]=_0x43c073[_0x823a('0x2f')][_0x823a('0x31')]?_0x43c073['attributes']:_0x4cad01[_0x823a('0x29')];if(_0x515393[_0x823a('0x2c')][_0x823a('0x32')]){_0x43c073[_0x823a('0x33')]=[{'all':!![]}];}_0x43c073=_[_0x823a('0x34')]({},_0x43c073,_0x515393[_0x823a('0x35')]);return db[_0x823a('0x2b')][_0x823a('0x36')](_0x43c073)['then'](handleEntityNotFound(_0x11450a,null))[_0x823a('0x23')](respondWithResult(_0x11450a,null))[_0x823a('0x37')](handleError(_0x11450a,null));};exports['update']=function(_0x52ba26,_0x2edc80){if(_0x52ba26[_0x823a('0x38')]['id']){delete _0x52ba26[_0x823a('0x38')]['id'];}return db[_0x823a('0x2b')]['find']({'where':{'id':_0x52ba26[_0x823a('0x39')]['id']}})[_0x823a('0x23')](handleEntityNotFound(_0x2edc80,null))['then'](saveUpdates(_0x52ba26[_0x823a('0x38')],null))[_0x823a('0x23')](respondWithResult(_0x2edc80,null))[_0x823a('0x37')](handleError(_0x2edc80,null));};exports[_0x823a('0x24')]=function(_0x36683d,_0x347768){return db[_0x823a('0x2b')]['find']({'where':{'id':_0x36683d[_0x823a('0x39')]['id']}})[_0x823a('0x23')](handleEntityNotFound(_0x347768,null))[_0x823a('0x23')](removeEntity(_0x347768,null))['catch'](handleError(_0x347768,null));}; \ No newline at end of file +var _0x3fb7=['status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus'];(function(_0x718dc7,_0x46deb7){var _0x3fd038=function(_0x2d3f39){while(--_0x2d3f39){_0x718dc7['push'](_0x718dc7['shift']());}};_0x3fd038(++_0x46deb7);}(_0x3fb7,0x189));var _0x73fb=function(_0x52ed83,_0x4f7328){_0x52ed83=_0x52ed83-0x0;var _0x223b12=_0x3fb7[_0x52ed83];return _0x223b12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x73fb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73fb('0x1'));var rp=require(_0x73fb('0x2'));var moment=require('moment');var BPromise=require(_0x73fb('0x3'));var Mustache=require('mustache');var util=require(_0x73fb('0x4'));var path=require(_0x73fb('0x5'));var sox=require(_0x73fb('0x6'));var csv=require(_0x73fb('0x7'));var ejs=require(_0x73fb('0x8'));var fs=require('fs');var fs_extra=require(_0x73fb('0x9'));var _=require(_0x73fb('0xa'));var squel=require(_0x73fb('0xb'));var crypto=require(_0x73fb('0xc'));var jsforce=require(_0x73fb('0xd'));var deskjs=require(_0x73fb('0xe'));var toCsv=require(_0x73fb('0x7'));var querystring=require(_0x73fb('0xf'));var Papa=require(_0x73fb('0x10'));var Redis=require(_0x73fb('0x11'));var authService=require(_0x73fb('0x12'));var qs=require(_0x73fb('0x13'));var as=require(_0x73fb('0x14'));var hardwareService=require(_0x73fb('0x15'));var logger=require(_0x73fb('0x16'))(_0x73fb('0x17'));var utils=require(_0x73fb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x73fb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fc7ac,_0x1f7626){_0x1f7626=_0x1f7626||0xcc;return function(_0x45c502){if(_0x45c502){return _0x3fc7ac[_0x73fb('0x1a')](_0x1f7626);}return _0x3fc7ac[_0x73fb('0x1b')](_0x1f7626)[_0x73fb('0x1c')]();};}function respondWithResult(_0x394ac5,_0x10d931){_0x10d931=_0x10d931||0xc8;return function(_0x743f1a){if(_0x743f1a){return _0x394ac5[_0x73fb('0x1b')](_0x10d931)[_0x73fb('0x1d')](_0x743f1a);}};}function respondWithFilteredResult(_0xa0b4dd,_0x2161ac){return function(_0x4986c3){if(_0x4986c3){var _0x1f679b=typeof _0x2161ac['offset']==='undefined'&&typeof _0x2161ac[_0x73fb('0x1e')]===_0x73fb('0x1f');var _0x4f4dda=_0x4986c3[_0x73fb('0x20')];var _0x1c9fa3=_0x1f679b?0x0:_0x2161ac[_0x73fb('0x21')];var _0x3ea9dd=_0x1f679b?_0x4986c3['count']:_0x2161ac['offset']+_0x2161ac[_0x73fb('0x1e')];var _0x460ae9;if(_0x3ea9dd>=_0x4f4dda){_0x3ea9dd=_0x4f4dda;_0x460ae9=0xc8;}else{_0x460ae9=0xce;}_0xa0b4dd[_0x73fb('0x1b')](_0x460ae9);return _0xa0b4dd['set'](_0x73fb('0x22'),_0x1c9fa3+'-'+_0x3ea9dd+'/'+_0x4f4dda)[_0x73fb('0x1d')](_0x4986c3);}return null;};}function patchUpdates(_0x25b409){return function(_0x41b334){try{jsonpatch[_0x73fb('0x23')](_0x41b334,_0x25b409,!![]);}catch(_0x204abf){return BPromise['reject'](_0x204abf);}return _0x41b334[_0x73fb('0x24')]();};}function saveUpdates(_0x474aaa,_0x2ff0f3){return function(_0x4d9d9c){if(_0x4d9d9c){return _0x4d9d9c['update'](_0x474aaa)[_0x73fb('0x25')](function(_0x2ae708){return _0x2ae708;});}return null;};}function removeEntity(_0x5486ff,_0x26b839){return function(_0x12c139){if(_0x12c139){return _0x12c139[_0x73fb('0x26')]()[_0x73fb('0x25')](function(){_0x5486ff[_0x73fb('0x1b')](0xcc)[_0x73fb('0x1c')]();});}};}function handleEntityNotFound(_0x801c4d,_0x222b87){return function(_0x3d213f){if(!_0x3d213f){_0x801c4d['sendStatus'](0x194);}return _0x3d213f;};}function handleError(_0x4a9ba2,_0x405e36){_0x405e36=_0x405e36||0x1f4;return function(_0x30b88){logger[_0x73fb('0x27')](_0x30b88[_0x73fb('0x28')]);if(_0x30b88[_0x73fb('0x29')]){delete _0x30b88[_0x73fb('0x29')];}_0x4a9ba2[_0x73fb('0x1b')](_0x405e36)['send'](_0x30b88);};}exports[_0x73fb('0x2a')]=function(_0x281449,_0x1bba66){var _0x46034e={'raw':!![],'where':{'id':_0x281449[_0x73fb('0x2b')]['id']}},_0x23d6c0={};_0x23d6c0[_0x73fb('0x2c')]=_[_0x73fb('0x2d')](db['ChatApplication'][_0x73fb('0x2e')]);_0x23d6c0[_0x73fb('0x2f')]=_['keys'](_0x281449['query']);_0x23d6c0[_0x73fb('0x30')]=_[_0x73fb('0x31')](_0x23d6c0[_0x73fb('0x2c')],_0x23d6c0[_0x73fb('0x2f')]);_0x46034e[_0x73fb('0x32')]=_['intersection'](_0x23d6c0[_0x73fb('0x2c')],qs[_0x73fb('0x33')](_0x281449[_0x73fb('0x2f')][_0x73fb('0x33')]));_0x46034e[_0x73fb('0x32')]=_0x46034e[_0x73fb('0x32')][_0x73fb('0x34')]?_0x46034e[_0x73fb('0x32')]:_0x23d6c0[_0x73fb('0x2c')];if(_0x281449[_0x73fb('0x2f')]['includeAll']){_0x46034e[_0x73fb('0x35')]=[{'all':!![]}];}_0x46034e=_[_0x73fb('0x36')]({},_0x46034e,_0x281449[_0x73fb('0x37')]);return db[_0x73fb('0x38')][_0x73fb('0x39')](_0x46034e)['then'](handleEntityNotFound(_0x1bba66,null))[_0x73fb('0x25')](respondWithResult(_0x1bba66,null))[_0x73fb('0x3a')](handleError(_0x1bba66,null));};exports['update']=function(_0x41e3fc,_0x512db5){if(_0x41e3fc[_0x73fb('0x3b')]['id']){delete _0x41e3fc['body']['id'];}return db['ChatApplication'][_0x73fb('0x39')]({'where':{'id':_0x41e3fc[_0x73fb('0x2b')]['id']}})[_0x73fb('0x25')](handleEntityNotFound(_0x512db5,null))['then'](saveUpdates(_0x41e3fc[_0x73fb('0x3b')],null))[_0x73fb('0x25')](respondWithResult(_0x512db5,null))[_0x73fb('0x3a')](handleError(_0x512db5,null));};exports[_0x73fb('0x26')]=function(_0x3901a9,_0x787d37){return db['ChatApplication']['find']({'where':{'id':_0x3901a9[_0x73fb('0x2b')]['id']}})[_0x73fb('0x25')](handleEntityNotFound(_0x787d37,null))[_0x73fb('0x25')](removeEntity(_0x787d37,null))[_0x73fb('0x3a')](handleError(_0x787d37,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9031028..90ecd38 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 _0x5309=['request-promise','path','rimraf','../../config/environment','define','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x5309,0x1aa));var _0x9530=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5309[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9530('0x0'));var util=require(_0x9530('0x1'));var logger=require(_0x9530('0x2'))(_0x9530('0x3'));var moment=require(_0x9530('0x4'));var BPromise=require(_0x9530('0x5'));var rp=require(_0x9530('0x6'));var fs=require('fs');var path=require(_0x9530('0x7'));var rimraf=require(_0x9530('0x8'));var config=require(_0x9530('0x9'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x1cb512,_0x187678){return _0x1cb512[_0x9530('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9530('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5c99=['api','moment','bluebird','request-promise','path','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5c99,0x169));var _0x95c9=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x5c99[_0x22377a];return _0x36f105;};'use strict';var _=require(_0x95c9('0x0'));var util=require(_0x95c9('0x1'));var logger=require(_0x95c9('0x2'))(_0x95c9('0x3'));var moment=require(_0x95c9('0x4'));var BPromise=require(_0x95c9('0x5'));var rp=require(_0x95c9('0x6'));var fs=require('fs');var path=require(_0x95c9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x95c9('0x8')]=function(_0x150cfd,_0x3ab33f){return _0x150cfd[_0x95c9('0x9')](_0x95c9('0xa'),attributes,{'tableName':_0x95c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95c9('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 8de4e5f..1048aa6 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 _0x811f=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2f216d,_0x3a23d6){var _0x5df2f1=function(_0x41f492){while(--_0x41f492){_0x2f216d['push'](_0x2f216d['shift']());}};_0x5df2f1(++_0x3a23d6);}(_0x811f,0x1b7));var _0xf811=function(_0x5a965f,_0x22d15f){_0x5a965f=_0x5a965f-0x0;var _0x188f8a=_0x811f[_0x5a965f];return _0x188f8a;};'use strict';var _=require(_0xf811('0x0'));var util=require('util');var moment=require(_0xf811('0x1'));var BPromise=require('bluebird');var rs=require(_0xf811('0x2'));var fs=require('fs');var Redis=require(_0xf811('0x3'));var db=require(_0xf811('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf811('0x5'))('rpc');var config=require(_0xf811('0x6'));var jayson=require(_0xf811('0x7'));var client=jayson[_0xf811('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45aaf8,_0x41102a,_0x51ef67){return new BPromise(function(_0x17d8a3,_0x146f54){return client['request'](_0x45aaf8,_0x51ef67)[_0xf811('0x9')](function(_0x42e837){logger[_0xf811('0xa')](_0xf811('0xb'),_0x41102a,_0xf811('0xc'));logger[_0xf811('0xd')](_0xf811('0xe'),_0x41102a,'request\x20sent',JSON[_0xf811('0xf')](_0x42e837));if(_0x42e837['error']){if(_0x42e837[_0xf811('0x10')][_0xf811('0x11')]===0x1f4){logger[_0xf811('0x10')](_0xf811('0xb'),_0x41102a,_0x42e837['error'][_0xf811('0x12')]);return _0x146f54(_0x42e837[_0xf811('0x10')][_0xf811('0x12')]);}logger[_0xf811('0x10')](_0xf811('0xb'),_0x41102a,_0x42e837[_0xf811('0x10')]['message']);return _0x17d8a3(_0x42e837['error']['message']);}else{logger['info'](_0xf811('0xb'),_0x41102a,_0xf811('0xc'));_0x17d8a3(_0x42e837[_0xf811('0x13')]['message']);}})[_0xf811('0x14')](function(_0x5220af){logger['error'](_0xf811('0xb'),_0x41102a,_0x5220af);_0x146f54(_0x5220af);});});} \ No newline at end of file +var _0xa807=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','client','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x555d6f,_0x3527d0){var _0x45929b=function(_0x22f076){while(--_0x22f076){_0x555d6f['push'](_0x555d6f['shift']());}};_0x45929b(++_0x3527d0);}(_0xa807,0x1e4));var _0x7a80=function(_0x1f2b89,_0x1dfc2f){_0x1f2b89=_0x1f2b89-0x0;var _0x376b20=_0xa807[_0x1f2b89];return _0x376b20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7a80('0x0'));var BPromise=require(_0x7a80('0x1'));var rs=require(_0x7a80('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a80('0x3'))['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[_0x7a80('0x4')][_0x7a80('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x75eb7d,_0x19e5ff,_0x355166){return new BPromise(function(_0x3e472e,_0x5a0269){return client[_0x7a80('0x6')](_0x75eb7d,_0x355166)['then'](function(_0x258224){logger['info'](_0x7a80('0x7'),_0x19e5ff,_0x7a80('0x8'));logger[_0x7a80('0x9')](_0x7a80('0xa'),_0x19e5ff,'request\x20sent',JSON[_0x7a80('0xb')](_0x258224));if(_0x258224[_0x7a80('0xc')]){if(_0x258224[_0x7a80('0xc')][_0x7a80('0xd')]===0x1f4){logger[_0x7a80('0xc')](_0x7a80('0x7'),_0x19e5ff,_0x258224[_0x7a80('0xc')][_0x7a80('0xe')]);return _0x5a0269(_0x258224[_0x7a80('0xc')]['message']);}logger[_0x7a80('0xc')](_0x7a80('0x7'),_0x19e5ff,_0x258224[_0x7a80('0xc')][_0x7a80('0xe')]);return _0x3e472e(_0x258224['error']['message']);}else{logger['info'](_0x7a80('0x7'),_0x19e5ff,_0x7a80('0x8'));_0x3e472e(_0x258224[_0x7a80('0xf')]['message']);}})[_0x7a80('0x10')](function(_0x31876d){logger[_0x7a80('0xc')]('ChatApplication,\x20%s,\x20%s',_0x19e5ff,_0x31876d);_0x5a0269(_0x31876d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index dced1b1..285f88a 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 _0xcc1c=['delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','isAuthenticated','show','put','/:id'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xcc1c,0x128));var _0xccc1=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0xcc1c[_0x1fc84d];return _0x2658fa;};'use strict';var multer=require(_0xccc1('0x0'));var util=require(_0xccc1('0x1'));var path=require('path');var timeout=require(_0xccc1('0x2'));var express=require(_0xccc1('0x3'));var router=express[_0xccc1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xccc1('0x5'));var interaction=require(_0xccc1('0x6'));var config=require('../../config/environment');var controller=require(_0xccc1('0x7'));router['get']('/:id',auth[_0xccc1('0x8')](),controller[_0xccc1('0x9')]);router[_0xccc1('0xa')](_0xccc1('0xb'),auth[_0xccc1('0x8')](),controller['update']);router[_0xccc1('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xccc1('0xd')]);module['exports']=router; \ No newline at end of file +var _0x4a4a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5965db,_0x19c677){var _0x31bd94=function(_0x44f497){while(--_0x44f497){_0x5965db['push'](_0x5965db['shift']());}};_0x31bd94(++_0x19c677);}(_0x4a4a,0x1b3));var _0xa4a4=function(_0x3a6b71,_0x50d52c){_0x3a6b71=_0x3a6b71-0x0;var _0x5d3f05=_0x4a4a[_0x3a6b71];return _0x5d3f05;};'use strict';var multer=require(_0xa4a4('0x0'));var util=require(_0xa4a4('0x1'));var path=require(_0xa4a4('0x2'));var timeout=require(_0xa4a4('0x3'));var express=require(_0xa4a4('0x4'));var router=express[_0xa4a4('0x5')]();var fs_extra=require(_0xa4a4('0x6'));var auth=require(_0xa4a4('0x7'));var interaction=require(_0xa4a4('0x8'));var config=require(_0xa4a4('0x9'));var controller=require(_0xa4a4('0xa'));router[_0xa4a4('0xb')](_0xa4a4('0xc'),auth[_0xa4a4('0xd')](),controller['show']);router[_0xa4a4('0xe')](_0xa4a4('0xc'),auth[_0xa4a4('0xd')](),controller[_0xa4a4('0xf')]);router[_0xa4a4('0x10')](_0xa4a4('0xc'),auth[_0xa4a4('0xd')](),controller['destroy']);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 d460efa..cc0a39d 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 _0xb091=['exports','STRING','BOOLEAN'];(function(_0x1c24e9,_0x3a8e49){var _0xe4fdb2=function(_0x182eee){while(--_0x182eee){_0x1c24e9['push'](_0x1c24e9['shift']());}};_0xe4fdb2(++_0x3a8e49);}(_0xb091,0x16e));var _0x1b09=function(_0x3a7ad1,_0x3cd277){_0x3a7ad1=_0x3a7ad1-0x0;var _0x1a5904=_0xb091[_0x3a7ad1];return _0x1a5904;};'use strict';var Sequelize=require('sequelize');module[_0x1b09('0x0')]={'name':{'type':Sequelize[_0x1b09('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1b09('0x1')]},'write':{'type':Sequelize[_0x1b09('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x75ff=['BOOLEAN','sequelize','exports','STRING'];(function(_0x469d90,_0x4ddc77){var _0xb98ba5=function(_0x6979c3){while(--_0x6979c3){_0x469d90['push'](_0x469d90['shift']());}};_0xb98ba5(++_0x4ddc77);}(_0x75ff,0x131));var _0xf75f=function(_0x1ccf3d,_0x461209){_0x1ccf3d=_0x1ccf3d-0x0;var _0x5345c1=_0x75ff[_0x1ccf3d];return _0x5345c1;};'use strict';var Sequelize=require(_0xf75f('0x0'));module[_0xf75f('0x1')]={'name':{'type':Sequelize[_0xf75f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf75f('0x2')]},'write':{'type':Sequelize[_0xf75f('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 026889d..bae66c6 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 _0xfaee=['includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','removeMembers','ChatGroupId','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x35fdb4,_0x2ae585){var _0x335294=function(_0x46b9a6){while(--_0x46b9a6){_0x35fdb4['push'](_0x35fdb4['shift']());}};_0x335294(++_0x2ae585);}(_0xfaee,0x79));var _0xefae=function(_0x119961,_0x38c0a1){_0x119961=_0x119961-0x0;var _0x147fe2=_0xfaee[_0x119961];return _0x147fe2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xefae('0x0'));var rp=require(_0xefae('0x1'));var moment=require(_0xefae('0x2'));var BPromise=require(_0xefae('0x3'));var Mustache=require(_0xefae('0x4'));var util=require(_0xefae('0x5'));var path=require(_0xefae('0x6'));var sox=require('sox');var csv=require(_0xefae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefae('0x8'));var _=require(_0xefae('0x9'));var squel=require(_0xefae('0xa'));var crypto=require(_0xefae('0xb'));var jsforce=require(_0xefae('0xc'));var deskjs=require(_0xefae('0xd'));var toCsv=require(_0xefae('0x7'));var querystring=require(_0xefae('0xe'));var Papa=require(_0xefae('0xf'));var Redis=require('ioredis');var authService=require(_0xefae('0x10'));var qs=require(_0xefae('0x11'));var as=require(_0xefae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xefae('0x13'));var utils=require(_0xefae('0x14'));var config=require(_0xefae('0x15'));var licenseUtil=require(_0xefae('0x16'));var db=require(_0xefae('0x17'))['db'];config['redis']=_[_0xefae('0x18')](config['redis'],{'host':_0xefae('0x19'),'port':0x18eb});var socket=require(_0xefae('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3e8379,_0x981f9f){_0x981f9f=_0x981f9f||0xcc;return function(_0x2f56e1){if(_0x2f56e1){return _0x3e8379[_0xefae('0x1b')](_0x981f9f);}return _0x3e8379['status'](_0x981f9f)['end']();};}function respondWithResult(_0x3530c2,_0x5eba43){_0x5eba43=_0x5eba43||0xc8;return function(_0x34ca36){if(_0x34ca36){return _0x3530c2[_0xefae('0x1c')](_0x5eba43)['json'](_0x34ca36);}};}function respondWithFilteredResult(_0x48ef11,_0x3ec554){return function(_0x2b4e4f){if(_0x2b4e4f){var _0x3a8779=typeof _0x3ec554['offset']===_0xefae('0x1d')&&typeof _0x3ec554[_0xefae('0x1e')]===_0xefae('0x1d');var _0x269d8c=_0x2b4e4f[_0xefae('0x1f')];var _0x4a6679=_0x3a8779?0x0:_0x3ec554['offset'];var _0x3c59c0=_0x3a8779?_0x2b4e4f[_0xefae('0x1f')]:_0x3ec554[_0xefae('0x20')]+_0x3ec554[_0xefae('0x1e')];var _0x3a7fde;if(_0x3c59c0>=_0x269d8c){_0x3c59c0=_0x269d8c;_0x3a7fde=0xc8;}else{_0x3a7fde=0xce;}_0x48ef11[_0xefae('0x1c')](_0x3a7fde);return _0x48ef11[_0xefae('0x21')]('Content-Range',_0x4a6679+'-'+_0x3c59c0+'/'+_0x269d8c)[_0xefae('0x22')](_0x2b4e4f);}return null;};}function patchUpdates(_0x671991){return function(_0x4ee8b1){try{jsonpatch[_0xefae('0x23')](_0x4ee8b1,_0x671991,!![]);}catch(_0x1fb2ab){return BPromise[_0xefae('0x24')](_0x1fb2ab);}return _0x4ee8b1[_0xefae('0x25')]();};}function saveUpdates(_0x296862,_0x52bbef){return function(_0x551044){if(_0x551044){return _0x551044[_0xefae('0x26')](_0x296862)[_0xefae('0x27')](function(_0x194c9e){return _0x194c9e;});}return null;};}function removeEntity(_0x2d2582,_0x201524){return function(_0x28fbb0){if(_0x28fbb0){return _0x28fbb0['destroy']()[_0xefae('0x27')](function(){_0x2d2582[_0xefae('0x1c')](0xcc)[_0xefae('0x28')]();});}};}function handleEntityNotFound(_0x2e70d0,_0x97c098){return function(_0x2ecdcd){if(!_0x2ecdcd){_0x2e70d0[_0xefae('0x1b')](0x194);}return _0x2ecdcd;};}function handleError(_0x52b0b3,_0x32ef51){_0x32ef51=_0x32ef51||0x1f4;return function(_0x47a4a7){logger[_0xefae('0x29')](_0x47a4a7[_0xefae('0x2a')]);if(_0x47a4a7[_0xefae('0x2b')]){delete _0x47a4a7['name'];}_0x52b0b3['status'](_0x32ef51)[_0xefae('0x2c')](_0x47a4a7);};}exports[_0xefae('0x2d')]=function(_0x256938,_0x1cb9f3){var _0x22956b={},_0x5083c2={},_0x5c1081={'count':0x0,'rows':[]};var _0xa1cef8=_[_0xefae('0x2e')](db[_0xefae('0x2f')][_0xefae('0x30')],function(_0x5b0164){return{'name':_0x5b0164['fieldName'],'type':_0x5b0164[_0xefae('0x31')][_0xefae('0x32')]};});_0x5083c2[_0xefae('0x33')]=_['map'](_0xa1cef8,_0xefae('0x2b'));_0x5083c2['query']=_[_0xefae('0x34')](_0x256938[_0xefae('0x35')]);_0x5083c2[_0xefae('0x36')]=_[_0xefae('0x37')](_0x5083c2[_0xefae('0x33')],_0x5083c2[_0xefae('0x35')]);_0x22956b['attributes']=_[_0xefae('0x37')](_0x5083c2[_0xefae('0x33')],qs['fields'](_0x256938[_0xefae('0x35')][_0xefae('0x38')]));_0x22956b['attributes']=_0x22956b[_0xefae('0x39')][_0xefae('0x3a')]?_0x22956b[_0xefae('0x39')]:_0x5083c2[_0xefae('0x33')];if(!_0x256938[_0xefae('0x35')][_0xefae('0x3b')](_0xefae('0x3c'))){_0x22956b[_0xefae('0x1e')]=qs[_0xefae('0x1e')](_0x256938['query'][_0xefae('0x1e')]);_0x22956b[_0xefae('0x20')]=qs['offset'](_0x256938['query']['offset']);}_0x22956b[_0xefae('0x3d')]=qs[_0xefae('0x3e')](_0x256938[_0xefae('0x35')][_0xefae('0x3e')]);_0x22956b[_0xefae('0x3f')]=qs[_0xefae('0x36')](_[_0xefae('0x40')](_0x256938['query'],_0x5083c2[_0xefae('0x36')]),_0xa1cef8);if(_0x256938[_0xefae('0x35')][_0xefae('0x41')]){_0x22956b['where']=_['merge'](_0x22956b['where'],{'$or':_['map'](_0xa1cef8,function(_0x3ec081){if(_0x3ec081[_0xefae('0x31')]!==_0xefae('0x42')){var _0x2fda63={};_0x2fda63[_0x3ec081[_0xefae('0x2b')]]={'$like':'%'+_0x256938['query'][_0xefae('0x41')]+'%'};return _0x2fda63;}})});}_0x22956b=_[_0xefae('0x43')]({},_0x22956b,_0x256938[_0xefae('0x44')]);var _0xf59669={'where':_0x22956b[_0xefae('0x3f')]};return db[_0xefae('0x2f')][_0xefae('0x1f')](_0xf59669)[_0xefae('0x27')](function(_0x1ce7e2){_0x5c1081[_0xefae('0x1f')]=_0x1ce7e2;if(_0x256938['query'][_0xefae('0x45')]){_0x22956b[_0xefae('0x46')]=[{'all':!![]}];}return db[_0xefae('0x2f')][_0xefae('0x47')](_0x22956b);})[_0xefae('0x27')](function(_0x5e846d){_0x5c1081[_0xefae('0x48')]=_0x5e846d;return _0x5c1081;})[_0xefae('0x27')](respondWithFilteredResult(_0x1cb9f3,_0x22956b))[_0xefae('0x49')](handleError(_0x1cb9f3,null));};exports[_0xefae('0x4a')]=function(_0x233d3e,_0x41f2a0){var _0x3d47ab={'raw':!![],'where':{'id':_0x233d3e[_0xefae('0x4b')]['id']}},_0x1aa2c8={};_0x1aa2c8[_0xefae('0x33')]=_[_0xefae('0x34')](db[_0xefae('0x2f')][_0xefae('0x30')]);_0x1aa2c8['query']=_[_0xefae('0x34')](_0x233d3e[_0xefae('0x35')]);_0x1aa2c8['filters']=_[_0xefae('0x37')](_0x1aa2c8['model'],_0x1aa2c8[_0xefae('0x35')]);_0x3d47ab[_0xefae('0x39')]=_[_0xefae('0x37')](_0x1aa2c8[_0xefae('0x33')],qs[_0xefae('0x38')](_0x233d3e[_0xefae('0x35')][_0xefae('0x38')]));_0x3d47ab[_0xefae('0x39')]=_0x3d47ab[_0xefae('0x39')][_0xefae('0x3a')]?_0x3d47ab[_0xefae('0x39')]:_0x1aa2c8[_0xefae('0x33')];if(_0x233d3e[_0xefae('0x35')][_0xefae('0x45')]){_0x3d47ab[_0xefae('0x46')]=[{'all':!![]}];}_0x3d47ab=_[_0xefae('0x43')]({},_0x3d47ab,_0x233d3e[_0xefae('0x44')]);return db[_0xefae('0x2f')][_0xefae('0x4c')](_0x3d47ab)[_0xefae('0x27')](handleEntityNotFound(_0x41f2a0,null))[_0xefae('0x27')](respondWithResult(_0x41f2a0,null))['catch'](handleError(_0x41f2a0,null));};exports[_0xefae('0x4d')]=function(_0x2bd222,_0x4956a7){return db['ChatGroup'][_0xefae('0x4d')](_0x2bd222['body'],{})[_0xefae('0x27')](respondWithResult(_0x4956a7,0xc9))[_0xefae('0x49')](handleError(_0x4956a7,null));};exports['update']=function(_0x2ad81f,_0x2998db){if(_0x2ad81f[_0xefae('0x4e')]['id']){delete _0x2ad81f['body']['id'];}return db[_0xefae('0x2f')][_0xefae('0x4c')]({'where':{'id':_0x2ad81f[_0xefae('0x4b')]['id']}})[_0xefae('0x27')](handleEntityNotFound(_0x2998db,null))[_0xefae('0x27')](saveUpdates(_0x2ad81f[_0xefae('0x4e')],null))[_0xefae('0x27')](respondWithResult(_0x2998db,null))[_0xefae('0x49')](handleError(_0x2998db,null));};exports[_0xefae('0x4f')]=function(_0x4fc47e,_0x1a0c48){return db[_0xefae('0x2f')]['find']({'where':{'id':_0x4fc47e[_0xefae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1a0c48,null))[_0xefae('0x27')](removeEntity(_0x1a0c48,null))['catch'](handleError(_0x1a0c48,null));};exports['describe']=function(_0x10dfd0,_0x12ba5f){return db[_0xefae('0x2f')][_0xefae('0x50')]()[_0xefae('0x27')](respondWithResult(_0x12ba5f,null))[_0xefae('0x49')](handleError(_0x12ba5f,null));};exports[_0xefae('0x51')]=function(_0x5453e8,_0x2fa163,_0x358571){return db[_0xefae('0x52')][_0xefae('0x1f')]({'where':{'ChatGroupId':_0x5453e8[_0xefae('0x4b')]['id'],'ToId':_0x5453e8['user']['id'],'read':![]}})[_0xefae('0x27')](function(_0x4afaa2){return{'id':_[_0xefae('0x53')](_0x5453e8[_0xefae('0x4b')]['id']),'count':_0x4afaa2};})[_0xefae('0x27')](respondWithResult(_0x2fa163,null))['catch'](handleError(_0x2fa163,null));};exports[_0xefae('0x54')]=function(_0x5953d5,_0x4c6d07,_0x4432ad){return db[_0xefae('0x2f')][_0xefae('0x4c')]({'where':{'id':_0x5953d5[_0xefae('0x4b')]['id']}})[_0xefae('0x27')](handleEntityNotFound(_0x4c6d07,null))['then'](function(_0x4852e0){if(_0x4852e0){return _0x4852e0[_0xefae('0x54')](_0x5953d5[_0xefae('0x4e')][_0xefae('0x55')],_[_0xefae('0x56')](_0x5953d5['body'],[_0xefae('0x55'),'id'])||{});}})[_0xefae('0x27')](respondWithResult(_0x4c6d07,null))['catch'](handleError(_0x4c6d07,null));};exports[_0xefae('0x57')]=function(_0x1a830b,_0x561b0b,_0x352525){var _0x385844={};var _0x2e9c32={};var _0x283aba;var _0x44057a;return db[_0xefae('0x2f')]['findOne']({'where':{'id':_0x1a830b[_0xefae('0x4b')]['id']}})[_0xefae('0x27')](handleEntityNotFound(_0x561b0b,null))[_0xefae('0x27')](function(_0x276c2c){if(_0x276c2c){_0x283aba=_0x276c2c;_0x2e9c32[_0xefae('0x33')]=_[_0xefae('0x34')](db[_0xefae('0x58')]['rawAttributes']);_0x2e9c32[_0xefae('0x35')]=_[_0xefae('0x34')](_0x1a830b[_0xefae('0x35')]);_0x2e9c32[_0xefae('0x36')]=_[_0xefae('0x37')](_0x2e9c32[_0xefae('0x33')],_0x2e9c32['query']);_0x385844[_0xefae('0x39')]=_[_0xefae('0x37')](_0x2e9c32['model'],qs[_0xefae('0x38')](_0x1a830b[_0xefae('0x35')][_0xefae('0x38')]));_0x385844[_0xefae('0x39')]=_0x385844[_0xefae('0x39')]['length']?_0x385844[_0xefae('0x39')]:_0x2e9c32['model'];_0x385844[_0xefae('0x3d')]=qs[_0xefae('0x3e')](_0x1a830b['query'][_0xefae('0x3e')]);_0x385844[_0xefae('0x3f')]=qs[_0xefae('0x36')](_[_0xefae('0x40')](_0x1a830b[_0xefae('0x35')],_0x2e9c32[_0xefae('0x36')]));if(_0x1a830b[_0xefae('0x35')][_0xefae('0x41')]){_0x385844[_0xefae('0x3f')]=_['merge'](_0x385844[_0xefae('0x3f')],{'$or':_['map'](_0x385844['attributes'],function(_0x205774){var _0x439c99={};_0x439c99[_0x205774]={'$like':'%'+_0x1a830b[_0xefae('0x35')][_0xefae('0x41')]+'%'};return _0x439c99;})});}_0x385844=_[_0xefae('0x43')]({},_0x385844,_0x1a830b['options']);return _0x283aba['getMembers'](_0x385844);}})['then'](function(_0x248882){if(_0x248882){_0x44057a=_0x248882['length'];if(!_0x1a830b['query'][_0xefae('0x3b')]('nolimit')){_0x385844[_0xefae('0x1e')]=qs['limit'](_0x1a830b[_0xefae('0x35')]['limit']);_0x385844[_0xefae('0x20')]=qs[_0xefae('0x20')](_0x1a830b[_0xefae('0x35')]['offset']);}return _0x283aba['getMembers'](_0x385844);}})['then'](function(_0x254852){if(_0x254852){return _0x254852?{'count':_0x44057a,'rows':_0x254852}:null;}})['then'](respondWithResult(_0x561b0b,null))[_0xefae('0x49')](handleError(_0x561b0b,null));};exports['removeMembers']=function(_0x4ba820,_0x8203f1,_0x2f188a){return db['ChatGroup']['find']({'where':{'id':_0x4ba820['params']['id']}})['then'](handleEntityNotFound(_0x8203f1,null))[_0xefae('0x27')](function(_0x1ecba7){if(_0x1ecba7){return _0x1ecba7[_0xefae('0x59')](_0x4ba820[_0xefae('0x35')]['ids']);}})[_0xefae('0x27')](respondWithStatusCode(_0x8203f1,null))['catch'](handleError(_0x8203f1,null));};exports['addMessage']=function(_0x5b8614,_0x26d1ea,_0x1a329f){if(_0x5b8614['body']['id']){delete _0x5b8614[_0xefae('0x4e')]['id'];}return db['ChatGroup'][_0xefae('0x4c')]({'where':{'id':_0x5b8614['params']['id']}})['then'](handleEntityNotFound(_0x26d1ea,null))[_0xefae('0x27')](function(_0x1e915a){if(_0x1e915a){_0x5b8614['body'][_0xefae('0x5a')]=_0x1e915a['id'];return db['ChatInternalMessage'][_0xefae('0x4d')](_0x5b8614[_0xefae('0x4e')]);}})[_0xefae('0x27')](respondWithResult(_0x26d1ea,null))['catch'](handleError(_0x26d1ea,null));};exports['getMessages']=function(_0x5013f3,_0x1ba19b,_0x12dc59){var _0x506a09={};var _0x35549c={};var _0x541570;var _0xf49e2e;return db[_0xefae('0x2f')][_0xefae('0x5b')]({'where':{'id':_0x5013f3['params']['id']}})['then'](handleEntityNotFound(_0x1ba19b,null))[_0xefae('0x27')](function(_0x40b604){if(_0x40b604){_0x541570=_0x40b604;_0x35549c[_0xefae('0x33')]=_[_0xefae('0x34')](db['ChatInternalMessage'][_0xefae('0x30')]);_0x35549c[_0xefae('0x35')]=_[_0xefae('0x34')](_0x5013f3['query']);_0x35549c['filters']=_['intersection'](_0x35549c[_0xefae('0x33')],_0x35549c['query']);_0x506a09[_0xefae('0x39')]=_['intersection'](_0x35549c[_0xefae('0x33')],qs['fields'](_0x5013f3['query']['fields']));_0x506a09[_0xefae('0x39')]=_0x506a09[_0xefae('0x39')][_0xefae('0x3a')]?_0x506a09[_0xefae('0x39')]:_0x35549c[_0xefae('0x33')];_0x506a09[_0xefae('0x3d')]=qs[_0xefae('0x3e')](_0x5013f3['query'][_0xefae('0x3e')]);_0x506a09['where']=qs[_0xefae('0x36')](_[_0xefae('0x40')](_0x5013f3[_0xefae('0x35')],_0x35549c[_0xefae('0x36')]));if(_0x5013f3[_0xefae('0x35')][_0xefae('0x41')]){_0x506a09['where']=_['merge'](_0x506a09[_0xefae('0x3f')],{'$or':_[_0xefae('0x2e')](_0x506a09[_0xefae('0x39')],function(_0x318a67){var _0x2dbe1a={};_0x2dbe1a[_0x318a67]={'$like':'%'+_0x5013f3['query']['filter']+'%'};return _0x2dbe1a;})});}if(_0x5013f3[_0xefae('0x35')][_0xefae('0x5c')]){var _0x2d4448=_0x5013f3[_0xefae('0x35')][_0xefae('0x5c')]['split'](',');var _0x31f6b8={};_0x31f6b8[_0x2d4448[0x0]]={'$gte':moment(_0x2d4448[0x1])['format'](_0xefae('0x5d'))};_0x506a09[_0xefae('0x3f')]=_[_0xefae('0x43')](_0x506a09[_0xefae('0x3f')],_0x31f6b8);}_0x506a09=_['merge']({},_0x506a09,_0x5013f3['options']);return _0x541570[_0xefae('0x5e')](_0x506a09);}})[_0xefae('0x27')](function(_0x1196e4){if(_0x1196e4){_0xf49e2e=_0x1196e4['length'];if(!_0x5013f3[_0xefae('0x35')]['hasOwnProperty']('nolimit')){_0x506a09[_0xefae('0x1e')]=qs[_0xefae('0x1e')](_0x5013f3[_0xefae('0x35')][_0xefae('0x1e')]);_0x506a09[_0xefae('0x20')]=qs[_0xefae('0x20')](_0x5013f3[_0xefae('0x35')][_0xefae('0x20')]);}return _0x541570[_0xefae('0x5e')](_0x506a09);}})[_0xefae('0x27')](function(_0x59d2e2){if(_0x59d2e2){return _0x59d2e2?{'count':_0xf49e2e,'rows':_0x59d2e2}:null;}})[_0xefae('0x27')](respondWithResult(_0x1ba19b,null))['catch'](handleError(_0x1ba19b,null));}; \ No newline at end of file +var _0x7976=['addMembers','ids','omit','getMembers','findOne','User','nolimit','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','ChatGroup','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','destroy','describe','getUnread','user','toInteger','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7976,0x137));var _0x6797=function(_0x184b3d,_0x504fbc){_0x184b3d=_0x184b3d-0x0;var _0x27f867=_0x7976[_0x184b3d];return _0x27f867;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6797('0x0'));var zipdir=require(_0x6797('0x1'));var jsonpatch=require(_0x6797('0x2'));var rp=require(_0x6797('0x3'));var moment=require(_0x6797('0x4'));var BPromise=require(_0x6797('0x5'));var Mustache=require(_0x6797('0x6'));var util=require(_0x6797('0x7'));var path=require(_0x6797('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6797('0x9'));var fs=require('fs');var fs_extra=require(_0x6797('0xa'));var _=require(_0x6797('0xb'));var squel=require(_0x6797('0xc'));var crypto=require('crypto');var jsforce=require(_0x6797('0xd'));var deskjs=require(_0x6797('0xe'));var toCsv=require(_0x6797('0xf'));var querystring=require(_0x6797('0x10'));var Papa=require(_0x6797('0x11'));var Redis=require(_0x6797('0x12'));var authService=require(_0x6797('0x13'));var qs=require(_0x6797('0x14'));var as=require(_0x6797('0x15'));var hardwareService=require(_0x6797('0x16'));var logger=require('../../config/logger')(_0x6797('0x17'));var utils=require(_0x6797('0x18'));var config=require(_0x6797('0x19'));var licenseUtil=require(_0x6797('0x1a'));var db=require(_0x6797('0x1b'))['db'];config[_0x6797('0x1c')]=_[_0x6797('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6797('0x1e'))(new Redis(config[_0x6797('0x1c')]));require('./chatGroup.socket')[_0x6797('0x1f')](socket);function respondWithStatusCode(_0x296f41,_0x399722){_0x399722=_0x399722||0xcc;return function(_0x307318){if(_0x307318){return _0x296f41['sendStatus'](_0x399722);}return _0x296f41['status'](_0x399722)[_0x6797('0x20')]();};}function respondWithResult(_0x2991e0,_0x1e6c0c){_0x1e6c0c=_0x1e6c0c||0xc8;return function(_0x4ded4c){if(_0x4ded4c){return _0x2991e0['status'](_0x1e6c0c)[_0x6797('0x21')](_0x4ded4c);}};}function respondWithFilteredResult(_0x461ccc,_0x3e86df){return function(_0x467cc2){if(_0x467cc2){var _0x33b11d=typeof _0x3e86df[_0x6797('0x22')]==='undefined'&&typeof _0x3e86df[_0x6797('0x23')]===_0x6797('0x24');var _0x18f019=_0x467cc2[_0x6797('0x25')];var _0x38ee6e=_0x33b11d?0x0:_0x3e86df[_0x6797('0x22')];var _0x1d06f4=_0x33b11d?_0x467cc2['count']:_0x3e86df['offset']+_0x3e86df['limit'];var _0x3c2453;if(_0x1d06f4>=_0x18f019){_0x1d06f4=_0x18f019;_0x3c2453=0xc8;}else{_0x3c2453=0xce;}_0x461ccc[_0x6797('0x26')](_0x3c2453);return _0x461ccc['set'](_0x6797('0x27'),_0x38ee6e+'-'+_0x1d06f4+'/'+_0x18f019)['json'](_0x467cc2);}return null;};}function patchUpdates(_0x4ee356){return function(_0x306ec5){try{jsonpatch[_0x6797('0x28')](_0x306ec5,_0x4ee356,!![]);}catch(_0x34a199){return BPromise[_0x6797('0x29')](_0x34a199);}return _0x306ec5[_0x6797('0x2a')]();};}function saveUpdates(_0x1cc01c,_0x574caa){return function(_0x34ab16){if(_0x34ab16){return _0x34ab16['update'](_0x1cc01c)['then'](function(_0x1dc0d3){return _0x1dc0d3;});}return null;};}function removeEntity(_0x51fb55,_0x3ced40){return function(_0x18793b){if(_0x18793b){return _0x18793b['destroy']()[_0x6797('0x2b')](function(){_0x51fb55[_0x6797('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2981d2,_0x82ea90){return function(_0x171b19){if(!_0x171b19){_0x2981d2['sendStatus'](0x194);}return _0x171b19;};}function handleError(_0x318c8e,_0x35071c){_0x35071c=_0x35071c||0x1f4;return function(_0x2628b4){logger[_0x6797('0x2c')](_0x2628b4[_0x6797('0x2d')]);if(_0x2628b4['name']){delete _0x2628b4[_0x6797('0x2e')];}_0x318c8e['status'](_0x35071c)[_0x6797('0x2f')](_0x2628b4);};}exports[_0x6797('0x30')]=function(_0x53595c,_0x585f6e){var _0x19a15d={},_0x1a316f={},_0x4dc614={'count':0x0,'rows':[]};var _0x20f69c=_[_0x6797('0x31')](db['ChatGroup']['rawAttributes'],function(_0x4c94ff){return{'name':_0x4c94ff[_0x6797('0x32')],'type':_0x4c94ff[_0x6797('0x33')][_0x6797('0x34')]};});_0x1a316f['model']=_[_0x6797('0x31')](_0x20f69c,_0x6797('0x2e'));_0x1a316f['query']=_[_0x6797('0x35')](_0x53595c[_0x6797('0x36')]);_0x1a316f['filters']=_['intersection'](_0x1a316f[_0x6797('0x37')],_0x1a316f[_0x6797('0x36')]);_0x19a15d[_0x6797('0x38')]=_[_0x6797('0x39')](_0x1a316f[_0x6797('0x37')],qs[_0x6797('0x3a')](_0x53595c[_0x6797('0x36')]['fields']));_0x19a15d[_0x6797('0x38')]=_0x19a15d[_0x6797('0x38')][_0x6797('0x3b')]?_0x19a15d[_0x6797('0x38')]:_0x1a316f['model'];if(!_0x53595c[_0x6797('0x36')][_0x6797('0x3c')]('nolimit')){_0x19a15d[_0x6797('0x23')]=qs[_0x6797('0x23')](_0x53595c[_0x6797('0x36')]['limit']);_0x19a15d['offset']=qs[_0x6797('0x22')](_0x53595c[_0x6797('0x36')][_0x6797('0x22')]);}_0x19a15d[_0x6797('0x3d')]=qs['sort'](_0x53595c[_0x6797('0x36')][_0x6797('0x3e')]);_0x19a15d[_0x6797('0x3f')]=qs[_0x6797('0x40')](_[_0x6797('0x41')](_0x53595c[_0x6797('0x36')],_0x1a316f['filters']),_0x20f69c);if(_0x53595c['query']['filter']){_0x19a15d[_0x6797('0x3f')]=_['merge'](_0x19a15d[_0x6797('0x3f')],{'$or':_['map'](_0x20f69c,function(_0x1a9b05){if(_0x1a9b05[_0x6797('0x33')]!=='VIRTUAL'){var _0x1a0a37={};_0x1a0a37[_0x1a9b05[_0x6797('0x2e')]]={'$like':'%'+_0x53595c[_0x6797('0x36')][_0x6797('0x42')]+'%'};return _0x1a0a37;}})});}_0x19a15d=_[_0x6797('0x43')]({},_0x19a15d,_0x53595c[_0x6797('0x44')]);var _0x4dd525={'where':_0x19a15d[_0x6797('0x3f')]};return db[_0x6797('0x45')][_0x6797('0x25')](_0x4dd525)[_0x6797('0x2b')](function(_0x14ff60){_0x4dc614[_0x6797('0x25')]=_0x14ff60;if(_0x53595c['query'][_0x6797('0x46')]){_0x19a15d[_0x6797('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x6797('0x48')](_0x19a15d);})[_0x6797('0x2b')](function(_0x30d087){_0x4dc614['rows']=_0x30d087;return _0x4dc614;})[_0x6797('0x2b')](respondWithFilteredResult(_0x585f6e,_0x19a15d))[_0x6797('0x49')](handleError(_0x585f6e,null));};exports[_0x6797('0x4a')]=function(_0x124120,_0x413cb3){var _0xf8c992={'raw':!![],'where':{'id':_0x124120[_0x6797('0x4b')]['id']}},_0xcf2647={};_0xcf2647[_0x6797('0x37')]=_['keys'](db[_0x6797('0x45')][_0x6797('0x4c')]);_0xcf2647[_0x6797('0x36')]=_[_0x6797('0x35')](_0x124120[_0x6797('0x36')]);_0xcf2647[_0x6797('0x40')]=_[_0x6797('0x39')](_0xcf2647[_0x6797('0x37')],_0xcf2647[_0x6797('0x36')]);_0xf8c992[_0x6797('0x38')]=_[_0x6797('0x39')](_0xcf2647[_0x6797('0x37')],qs['fields'](_0x124120['query'][_0x6797('0x3a')]));_0xf8c992[_0x6797('0x38')]=_0xf8c992['attributes'][_0x6797('0x3b')]?_0xf8c992[_0x6797('0x38')]:_0xcf2647[_0x6797('0x37')];if(_0x124120[_0x6797('0x36')][_0x6797('0x46')]){_0xf8c992[_0x6797('0x47')]=[{'all':!![]}];}_0xf8c992=_['merge']({},_0xf8c992,_0x124120[_0x6797('0x44')]);return db[_0x6797('0x45')]['find'](_0xf8c992)[_0x6797('0x2b')](handleEntityNotFound(_0x413cb3,null))['then'](respondWithResult(_0x413cb3,null))['catch'](handleError(_0x413cb3,null));};exports[_0x6797('0x4d')]=function(_0x25bc23,_0x278de6){return db[_0x6797('0x45')]['create'](_0x25bc23[_0x6797('0x4e')],{})[_0x6797('0x2b')](respondWithResult(_0x278de6,0xc9))['catch'](handleError(_0x278de6,null));};exports['update']=function(_0x3bbdb8,_0x2aef4e){if(_0x3bbdb8[_0x6797('0x4e')]['id']){delete _0x3bbdb8[_0x6797('0x4e')]['id'];}return db[_0x6797('0x45')]['find']({'where':{'id':_0x3bbdb8[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x2aef4e,null))[_0x6797('0x2b')](saveUpdates(_0x3bbdb8[_0x6797('0x4e')],null))[_0x6797('0x2b')](respondWithResult(_0x2aef4e,null))[_0x6797('0x49')](handleError(_0x2aef4e,null));};exports[_0x6797('0x4f')]=function(_0x5ef5ce,_0x63a1bd){return db['ChatGroup']['find']({'where':{'id':_0x5ef5ce['params']['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x63a1bd,null))['then'](removeEntity(_0x63a1bd,null))[_0x6797('0x49')](handleError(_0x63a1bd,null));};exports['describe']=function(_0x53a49f,_0xc71123){return db[_0x6797('0x45')][_0x6797('0x50')]()[_0x6797('0x2b')](respondWithResult(_0xc71123,null))[_0x6797('0x49')](handleError(_0xc71123,null));};exports[_0x6797('0x51')]=function(_0x315ff0,_0x199c60,_0x39c4d7){return db['ChatInternalMessage'][_0x6797('0x25')]({'where':{'ChatGroupId':_0x315ff0['params']['id'],'ToId':_0x315ff0[_0x6797('0x52')]['id'],'read':![]}})['then'](function(_0x4f71e3){return{'id':_[_0x6797('0x53')](_0x315ff0[_0x6797('0x4b')]['id']),'count':_0x4f71e3};})[_0x6797('0x2b')](respondWithResult(_0x199c60,null))[_0x6797('0x49')](handleError(_0x199c60,null));};exports['addMembers']=function(_0x39bd28,_0x1b2965,_0x210d03){return db[_0x6797('0x45')][_0x6797('0x54')]({'where':{'id':_0x39bd28[_0x6797('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b2965,null))['then'](function(_0x3c6bb6){if(_0x3c6bb6){return _0x3c6bb6[_0x6797('0x55')](_0x39bd28[_0x6797('0x4e')][_0x6797('0x56')],_[_0x6797('0x57')](_0x39bd28[_0x6797('0x4e')],['ids','id'])||{});}})[_0x6797('0x2b')](respondWithResult(_0x1b2965,null))[_0x6797('0x49')](handleError(_0x1b2965,null));};exports[_0x6797('0x58')]=function(_0x3ac9d3,_0x18d2e2,_0x24debf){var _0x7c2174={};var _0x17d05d={};var _0x3e018f;var _0x5f473e;return db[_0x6797('0x45')][_0x6797('0x59')]({'where':{'id':_0x3ac9d3[_0x6797('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18d2e2,null))['then'](function(_0x174f13){if(_0x174f13){_0x3e018f=_0x174f13;_0x17d05d[_0x6797('0x37')]=_['keys'](db[_0x6797('0x5a')][_0x6797('0x4c')]);_0x17d05d[_0x6797('0x36')]=_[_0x6797('0x35')](_0x3ac9d3[_0x6797('0x36')]);_0x17d05d['filters']=_[_0x6797('0x39')](_0x17d05d['model'],_0x17d05d[_0x6797('0x36')]);_0x7c2174[_0x6797('0x38')]=_[_0x6797('0x39')](_0x17d05d[_0x6797('0x37')],qs[_0x6797('0x3a')](_0x3ac9d3[_0x6797('0x36')][_0x6797('0x3a')]));_0x7c2174[_0x6797('0x38')]=_0x7c2174['attributes'][_0x6797('0x3b')]?_0x7c2174[_0x6797('0x38')]:_0x17d05d['model'];_0x7c2174['order']=qs[_0x6797('0x3e')](_0x3ac9d3[_0x6797('0x36')][_0x6797('0x3e')]);_0x7c2174[_0x6797('0x3f')]=qs[_0x6797('0x40')](_[_0x6797('0x41')](_0x3ac9d3[_0x6797('0x36')],_0x17d05d['filters']));if(_0x3ac9d3['query'][_0x6797('0x42')]){_0x7c2174[_0x6797('0x3f')]=_[_0x6797('0x43')](_0x7c2174[_0x6797('0x3f')],{'$or':_[_0x6797('0x31')](_0x7c2174[_0x6797('0x38')],function(_0x560a57){var _0x1c39ad={};_0x1c39ad[_0x560a57]={'$like':'%'+_0x3ac9d3['query'][_0x6797('0x42')]+'%'};return _0x1c39ad;})});}_0x7c2174=_[_0x6797('0x43')]({},_0x7c2174,_0x3ac9d3[_0x6797('0x44')]);return _0x3e018f[_0x6797('0x58')](_0x7c2174);}})[_0x6797('0x2b')](function(_0x1c4442){if(_0x1c4442){_0x5f473e=_0x1c4442[_0x6797('0x3b')];if(!_0x3ac9d3[_0x6797('0x36')][_0x6797('0x3c')](_0x6797('0x5b'))){_0x7c2174[_0x6797('0x23')]=qs[_0x6797('0x23')](_0x3ac9d3['query'][_0x6797('0x23')]);_0x7c2174[_0x6797('0x22')]=qs['offset'](_0x3ac9d3[_0x6797('0x36')][_0x6797('0x22')]);}return _0x3e018f['getMembers'](_0x7c2174);}})['then'](function(_0x2bdb9f){if(_0x2bdb9f){return _0x2bdb9f?{'count':_0x5f473e,'rows':_0x2bdb9f}:null;}})[_0x6797('0x2b')](respondWithResult(_0x18d2e2,null))[_0x6797('0x49')](handleError(_0x18d2e2,null));};exports['removeMembers']=function(_0x16f51d,_0x5b74b1,_0x3ff6b5){return db[_0x6797('0x45')][_0x6797('0x54')]({'where':{'id':_0x16f51d[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x5b74b1,null))[_0x6797('0x2b')](function(_0x4b5ae5){if(_0x4b5ae5){return _0x4b5ae5['removeMembers'](_0x16f51d['query']['ids']);}})[_0x6797('0x2b')](respondWithStatusCode(_0x5b74b1,null))[_0x6797('0x49')](handleError(_0x5b74b1,null));};exports['addMessage']=function(_0x28f567,_0x8dc1db,_0x11f842){if(_0x28f567[_0x6797('0x4e')]['id']){delete _0x28f567[_0x6797('0x4e')]['id'];}return db[_0x6797('0x45')][_0x6797('0x54')]({'where':{'id':_0x28f567[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x8dc1db,null))[_0x6797('0x2b')](function(_0x409100){if(_0x409100){_0x28f567['body'][_0x6797('0x5c')]=_0x409100['id'];return db[_0x6797('0x5d')]['create'](_0x28f567[_0x6797('0x4e')]);}})[_0x6797('0x2b')](respondWithResult(_0x8dc1db,null))[_0x6797('0x49')](handleError(_0x8dc1db,null));};exports[_0x6797('0x5e')]=function(_0x14e399,_0x38fe8a,_0xa236e){var _0x553527={};var _0x173b52={};var _0xa6ab98;var _0xfcf3de;return db[_0x6797('0x45')][_0x6797('0x59')]({'where':{'id':_0x14e399[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x38fe8a,null))[_0x6797('0x2b')](function(_0x7e5799){if(_0x7e5799){_0xa6ab98=_0x7e5799;_0x173b52[_0x6797('0x37')]=_[_0x6797('0x35')](db[_0x6797('0x5d')][_0x6797('0x4c')]);_0x173b52[_0x6797('0x36')]=_[_0x6797('0x35')](_0x14e399[_0x6797('0x36')]);_0x173b52['filters']=_[_0x6797('0x39')](_0x173b52[_0x6797('0x37')],_0x173b52[_0x6797('0x36')]);_0x553527[_0x6797('0x38')]=_[_0x6797('0x39')](_0x173b52['model'],qs[_0x6797('0x3a')](_0x14e399['query'][_0x6797('0x3a')]));_0x553527[_0x6797('0x38')]=_0x553527['attributes'][_0x6797('0x3b')]?_0x553527['attributes']:_0x173b52['model'];_0x553527[_0x6797('0x3d')]=qs[_0x6797('0x3e')](_0x14e399[_0x6797('0x36')][_0x6797('0x3e')]);_0x553527[_0x6797('0x3f')]=qs[_0x6797('0x40')](_['pick'](_0x14e399[_0x6797('0x36')],_0x173b52[_0x6797('0x40')]));if(_0x14e399[_0x6797('0x36')][_0x6797('0x42')]){_0x553527[_0x6797('0x3f')]=_[_0x6797('0x43')](_0x553527[_0x6797('0x3f')],{'$or':_[_0x6797('0x31')](_0x553527['attributes'],function(_0x426cd5){var _0x72f8c5={};_0x72f8c5[_0x426cd5]={'$like':'%'+_0x14e399['query']['filter']+'%'};return _0x72f8c5;})});}if(_0x14e399[_0x6797('0x36')][_0x6797('0x5f')]){var _0x489133=_0x14e399[_0x6797('0x36')][_0x6797('0x5f')][_0x6797('0x60')](',');var _0x25312a={};_0x25312a[_0x489133[0x0]]={'$gte':moment(_0x489133[0x1])[_0x6797('0x61')](_0x6797('0x62'))};_0x553527[_0x6797('0x3f')]=_[_0x6797('0x43')](_0x553527[_0x6797('0x3f')],_0x25312a);}_0x553527=_[_0x6797('0x43')]({},_0x553527,_0x14e399[_0x6797('0x44')]);return _0xa6ab98[_0x6797('0x5e')](_0x553527);}})[_0x6797('0x2b')](function(_0x1bfb3a){if(_0x1bfb3a){_0xfcf3de=_0x1bfb3a[_0x6797('0x3b')];if(!_0x14e399['query'][_0x6797('0x3c')](_0x6797('0x5b'))){_0x553527[_0x6797('0x23')]=qs[_0x6797('0x23')](_0x14e399[_0x6797('0x36')][_0x6797('0x23')]);_0x553527['offset']=qs[_0x6797('0x22')](_0x14e399['query'][_0x6797('0x22')]);}return _0xa6ab98[_0x6797('0x5e')](_0x553527);}})[_0x6797('0x2b')](function(_0x12e321){if(_0x12e321){return _0x12e321?{'count':_0xfcf3de,'rows':_0x12e321}:null;}})[_0x6797('0x2b')](respondWithResult(_0x38fe8a,null))[_0x6797('0x49')](handleError(_0x38fe8a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 18b02c0..2a7c88e 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 _0x69a0=['events','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x230bdd,_0x10d76d){var _0x4de116=function(_0x15b36d){while(--_0x15b36d){_0x230bdd['push'](_0x230bdd['shift']());}};_0x4de116(++_0x10d76d);}(_0x69a0,0x181));var _0x069a=function(_0x1f4748,_0x368e06){_0x1f4748=_0x1f4748-0x0;var _0x3802cb=_0x69a0[_0x1f4748];return _0x3802cb;};'use strict';var EventEmitter=require(_0x069a('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x069a('0x1'),'afterUpdate':_0x069a('0x2'),'afterDestroy':_0x069a('0x3')};function emitEvent(_0x2cde9f){return function(_0x39c93d,_0x51cf04,_0x5422a3){ChatGroupEvents[_0x069a('0x4')](_0x2cde9f+':'+_0x39c93d['id'],_0x39c93d);ChatGroupEvents[_0x069a('0x4')](_0x2cde9f,_0x39c93d);_0x5422a3(null);};}for(var e in events){if(events[_0x069a('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x069a('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0xf954=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x42e293,_0x2f3181){var _0xc8697c=function(_0x5ad749){while(--_0x5ad749){_0x42e293['push'](_0x42e293['shift']());}};_0xc8697c(++_0x2f3181);}(_0xf954,0x10e));var _0x4f95=function(_0x340e24,_0xde71e){_0x340e24=_0x340e24-0x0;var _0x1808a=_0xf954[_0x340e24];return _0x1808a;};'use strict';var EventEmitter=require(_0x4f95('0x0'));var ChatGroup=require(_0x4f95('0x1'))['db'][_0x4f95('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4f95('0x3')](0x0);var events={'afterCreate':_0x4f95('0x4'),'afterUpdate':_0x4f95('0x5'),'afterDestroy':_0x4f95('0x6')};function emitEvent(_0x56b04c){return function(_0x5476e1,_0x3e7ef4,_0x124804){ChatGroupEvents[_0x4f95('0x7')](_0x56b04c+':'+_0x5476e1['id'],_0x5476e1);ChatGroupEvents[_0x4f95('0x7')](_0x56b04c,_0x5476e1);_0x124804(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4f95('0x8')](e,emitEvent(event));}}module[_0x4f95('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 85f8573..155f8ff 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 _0x130e=['chat_groups','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatGroup'];(function(_0x1fff29,_0x3df123){var _0x46b43e=function(_0xcc74fb){while(--_0xcc74fb){_0x1fff29['push'](_0x1fff29['shift']());}};_0x46b43e(++_0x3df123);}(_0x130e,0x1e5));var _0xe130=function(_0x468161,_0x47cb9a){_0x468161=_0x468161-0x0;var _0x4f75d2=_0x130e[_0x468161];return _0x4f75d2;};'use strict';var _=require(_0xe130('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe130('0x1'));var moment=require(_0xe130('0x2'));var BPromise=require(_0xe130('0x3'));var rp=require(_0xe130('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe130('0x5'));var config=require(_0xe130('0x6'));var attributes=require('./chatGroup.attributes');module[_0xe130('0x7')]=function(_0x5412c1,_0x5290f4){return _0x5412c1[_0xe130('0x8')](_0xe130('0x9'),attributes,{'tableName':_0xe130('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf656=['chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xf656,0x139));var _0x6f65=function(_0x497386,_0x22d287){_0x497386=_0x497386-0x0;var _0x5be956=_0xf656[_0x497386];return _0x5be956;};'use strict';var _=require(_0x6f65('0x0'));var util=require('util');var logger=require(_0x6f65('0x1'))(_0x6f65('0x2'));var moment=require(_0x6f65('0x3'));var BPromise=require(_0x6f65('0x4'));var rp=require(_0x6f65('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f65('0x6'));var config=require('../../config/environment');var attributes=require(_0x6f65('0x7'));module[_0x6f65('0x8')]=function(_0x1c3d15,_0x2fdd28){return _0x1c3d15[_0x6f65('0x9')](_0x6f65('0xa'),attributes,{'tableName':_0x6f65('0xb'),'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 a44fa3e..e4d3dbf 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 _0x6732=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x260664,_0xfc9cfb){var _0x294d27=function(_0x20c826){while(--_0x20c826){_0x260664['push'](_0x260664['shift']());}};_0x294d27(++_0xfc9cfb);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var moment=require(_0x2673('0x2'));var BPromise=require(_0x2673('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2673('0x4'));var db=require(_0x2673('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2673('0x6'))(_0x2673('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2673('0x8')][_0x2673('0x9')]({'port':0x232a});config[_0x2673('0xa')]=_[_0x2673('0xb')](config[_0x2673('0xa')],{'host':_0x2673('0xc'),'port':0x18eb});var socket=require(_0x2673('0xd'))(new Redis(config[_0x2673('0xa')]));require(_0x2673('0xe'))[_0x2673('0xf')](socket);function respondWithRpcPromise(_0x1cde0f,_0x3176be,_0xd9759d){return new BPromise(function(_0x29daef,_0x35b72e){return client[_0x2673('0x10')](_0x1cde0f,_0xd9759d)[_0x2673('0x11')](function(_0xacd8f7){logger[_0x2673('0x12')]('ChatGroup,\x20%s,\x20%s',_0x3176be,_0x2673('0x13'));logger['debug'](_0x2673('0x14'),_0x3176be,_0x2673('0x13'),JSON[_0x2673('0x15')](_0xacd8f7));if(_0xacd8f7[_0x2673('0x16')]){if(_0xacd8f7[_0x2673('0x16')]['code']===0x1f4){logger['error'](_0x2673('0x17'),_0x3176be,_0xacd8f7[_0x2673('0x16')][_0x2673('0x18')]);return _0x35b72e(_0xacd8f7[_0x2673('0x16')][_0x2673('0x18')]);}logger['error'](_0x2673('0x17'),_0x3176be,_0xacd8f7[_0x2673('0x16')][_0x2673('0x18')]);return _0x29daef(_0xacd8f7[_0x2673('0x16')]['message']);}else{logger[_0x2673('0x12')](_0x2673('0x17'),_0x3176be,_0x2673('0x13'));_0x29daef(_0xacd8f7[_0x2673('0x19')][_0x2673('0x18')]);}})['catch'](function(_0x585be4){logger[_0x2673('0x16')](_0x2673('0x17'),_0x3176be,_0x585be4);_0x35b72e(_0x585be4);});});} \ No newline at end of file +var _0xdd50=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0xdd50,0x172));var _0x0dd5=function(_0x51b19b,_0x5015d2){_0x51b19b=_0x51b19b-0x0;var _0x1a3cd6=_0xdd50[_0x51b19b];return _0x1a3cd6;};'use strict';var _=require('lodash');var util=require(_0x0dd5('0x0'));var moment=require(_0x0dd5('0x1'));var BPromise=require(_0x0dd5('0x2'));var rs=require(_0x0dd5('0x3'));var fs=require('fs');var Redis=require(_0x0dd5('0x4'));var db=require(_0x0dd5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0dd5('0x6'));var client=jayson[_0x0dd5('0x7')][_0x0dd5('0x8')]({'port':0x232a});config[_0x0dd5('0x9')]=_[_0x0dd5('0xa')](config['redis'],{'host':_0x0dd5('0xb'),'port':0x18eb});var socket=require(_0x0dd5('0xc'))(new Redis(config[_0x0dd5('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x2a07db,_0x22419f,_0x20b37b){return new BPromise(function(_0x53c590,_0x574b2e){return client[_0x0dd5('0xd')](_0x2a07db,_0x20b37b)[_0x0dd5('0xe')](function(_0x51b19a){logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,_0x0dd5('0x11'));logger[_0x0dd5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x22419f,_0x0dd5('0x11'),JSON['stringify'](_0x51b19a));if(_0x51b19a[_0x0dd5('0x13')]){if(_0x51b19a['error'][_0x0dd5('0x14')]===0x1f4){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x574b2e(_0x51b19a[_0x0dd5('0x13')]['message']);}logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x53c590(_0x51b19a['error'][_0x0dd5('0x15')]);}else{logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,'request\x20sent');_0x53c590(_0x51b19a[_0x0dd5('0x16')][_0x0dd5('0x15')]);}})[_0x0dd5('0x17')](function(_0x2cba7e){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x2cba7e);_0x574b2e(_0x2cba7e);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d17cb83..037b988 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 _0xeab6=['remove','update','removeListener','length','chatGroup:','./chatGroup.events','save'];(function(_0x3a4515,_0x121874){var _0x1752cd=function(_0x14a7b2){while(--_0x14a7b2){_0x3a4515['push'](_0x3a4515['shift']());}};_0x1752cd(++_0x121874);}(_0xeab6,0x140));var _0x6eab=function(_0x21a098,_0x204c09){_0x21a098=_0x21a098-0x0;var _0x3233a5=_0xeab6[_0x21a098];return _0x3233a5;};'use strict';var ChatGroupEvents=require(_0x6eab('0x0'));var events=[_0x6eab('0x1'),_0x6eab('0x2'),_0x6eab('0x3')];function createListener(_0x3e28b7,_0x3feb4e){return function(_0x22194b){_0x3feb4e['emit'](_0x3e28b7,_0x22194b);};}function removeListener(_0x6882f1,_0x35218d){return function(){ChatGroupEvents[_0x6eab('0x4')](_0x6882f1,_0x35218d);};}exports['register']=function(_0x380306){for(var _0x6179ec=0x0,_0x10a5af=events[_0x6eab('0x5')];_0x6179ec<_0x10a5af;_0x6179ec++){var _0x81956=events[_0x6179ec];var _0x52d0ee=createListener(_0x6eab('0x6')+_0x81956,_0x380306);ChatGroupEvents['on'](_0x81956,_0x52d0ee);}}; \ No newline at end of file +var _0x406e=['./chatGroup.events','remove','update','removeListener','length'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x406e,0x6e));var _0xe406=function(_0x5c3912,_0x115ce1){_0x5c3912=_0x5c3912-0x0;var _0xccad87=_0x406e[_0x5c3912];return _0xccad87;};'use strict';var ChatGroupEvents=require(_0xe406('0x0'));var events=['save',_0xe406('0x1'),_0xe406('0x2')];function createListener(_0x2526f0,_0x2cf799){return function(_0x139552){_0x2cf799['emit'](_0x2526f0,_0x139552);};}function removeListener(_0x141698,_0x3cd35e){return function(){ChatGroupEvents[_0xe406('0x3')](_0x141698,_0x3cd35e);};}exports['register']=function(_0x5c88f7){for(var _0x5b13b9=0x0,_0x14775a=events[_0xe406('0x4')];_0x5b13b9<_0x14775a;_0x5b13b9++){var _0x24e2ce=events[_0x5b13b9];var _0x7f1891=createListener('chatGroup:'+_0x24e2ce,_0x5c88f7);ChatGroupEvents['on'](_0x24e2ce,_0x7f1891);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 96a0612..42b6ed8 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 _0x52e3=['/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get'];(function(_0x41af54,_0x31e48f){var _0x5ae081=function(_0x29116d){while(--_0x29116d){_0x41af54['push'](_0x41af54['shift']());}};_0x5ae081(++_0x31e48f);}(_0x52e3,0x1b7));var _0x352e=function(_0x4f17db,_0x199bbd){_0x4f17db=_0x4f17db-0x0;var _0x46b69c=_0x52e3[_0x4f17db];return _0x46b69c;};'use strict';var multer=require(_0x352e('0x0'));var util=require('util');var path=require(_0x352e('0x1'));var timeout=require(_0x352e('0x2'));var express=require('express');var router=express[_0x352e('0x3')]();var fs_extra=require(_0x352e('0x4'));var auth=require(_0x352e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x352e('0x6'));var controller=require(_0x352e('0x7'));router['get']('/',auth[_0x352e('0x8')](),controller[_0x352e('0x9')]);router[_0x352e('0xa')](_0x352e('0xb'),auth[_0x352e('0x8')](),controller[_0x352e('0xc')]);router[_0x352e('0xa')](_0x352e('0xd'),auth[_0x352e('0x8')](),controller[_0x352e('0xe')]);router[_0x352e('0xa')](_0x352e('0xf'),auth[_0x352e('0x8')](),controller[_0x352e('0x10')]);router[_0x352e('0xa')](_0x352e('0x11'),auth[_0x352e('0x8')](),controller[_0x352e('0x12')]);router[_0x352e('0xa')](_0x352e('0x13'),auth[_0x352e('0x8')](),controller[_0x352e('0x14')]);router[_0x352e('0x15')]('/',auth[_0x352e('0x8')](),controller[_0x352e('0x16')]);router['post'](_0x352e('0x11'),auth[_0x352e('0x8')](),controller[_0x352e('0x17')]);router[_0x352e('0x15')](_0x352e('0x13'),auth['isAuthenticated'](),controller[_0x352e('0x18')]);router['put'](_0x352e('0xd'),auth[_0x352e('0x8')](),controller[_0x352e('0x19')]);router[_0x352e('0x1a')]('/:id',auth[_0x352e('0x8')](),controller[_0x352e('0x1b')]);router[_0x352e('0x1a')]('/:id/members',auth[_0x352e('0x8')](),controller[_0x352e('0x1c')]);module[_0x352e('0x1d')]=router; \ No newline at end of file +var _0xbb02=['destroy','/:id/members','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMessages','post','create','addMembers','/:id/messages','addMessage','update','delete'];(function(_0x30b881,_0x22d2ba){var _0x43444e=function(_0x208557){while(--_0x208557){_0x30b881['push'](_0x30b881['shift']());}};_0x43444e(++_0x22d2ba);}(_0xbb02,0x111));var _0x2bb0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbb02[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x2bb0('0x0'));var util=require(_0x2bb0('0x1'));var path=require(_0x2bb0('0x2'));var timeout=require(_0x2bb0('0x3'));var express=require(_0x2bb0('0x4'));var router=express['Router']();var fs_extra=require(_0x2bb0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2bb0('0x6'));var config=require('../../config/environment');var controller=require(_0x2bb0('0x7'));router[_0x2bb0('0x8')]('/',auth[_0x2bb0('0x9')](),controller[_0x2bb0('0xa')]);router['get'](_0x2bb0('0xb'),auth[_0x2bb0('0x9')](),controller['describe']);router[_0x2bb0('0x8')](_0x2bb0('0xc'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0xd')]);router[_0x2bb0('0x8')](_0x2bb0('0xe'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0xf')]);router[_0x2bb0('0x8')]('/:id/members',auth[_0x2bb0('0x9')](),controller['getMembers']);router[_0x2bb0('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2bb0('0x10')]);router[_0x2bb0('0x11')]('/',auth['isAuthenticated'](),controller[_0x2bb0('0x12')]);router[_0x2bb0('0x11')]('/:id/members',auth['isAuthenticated'](),controller[_0x2bb0('0x13')]);router[_0x2bb0('0x11')](_0x2bb0('0x14'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0x15')]);router['put'](_0x2bb0('0xc'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0x16')]);router[_0x2bb0('0x17')](_0x2bb0('0xc'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0x18')]);router[_0x2bb0('0x17')](_0x2bb0('0x19'),auth[_0x2bb0('0x9')](),controller['removeMembers']);module[_0x2bb0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index c9d5207..67602ce 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 _0x97c1=['TEXT','STRING','long','DATE','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','thumb','star'];(function(_0x3e6a68,_0x29ac68){var _0x2e8b06=function(_0x587f73){while(--_0x587f73){_0x3e6a68['push'](_0x3e6a68['shift']());}};_0x2e8b06(++_0x29ac68);}(_0x97c1,0xdf));var _0x197c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x97c1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x197c('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x197c('0x3')),'defaultValue':_0x197c('0x4')},'ratingMessage':{'type':Sequelize[_0x197c('0x5')]},'pathTranscript':{'type':Sequelize[_0x197c('0x5')]},'mailTranscript':{'type':Sequelize[_0x197c('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x197c('0x6')]},'thirdDisposition':{'type':Sequelize[_0x197c('0x6')]},'note':{'type':Sequelize[_0x197c('0x6')]},'browserName':{'type':Sequelize[_0x197c('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x197c('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x197c('0x6')]},'deviceType':{'type':Sequelize[_0x197c('0x6')]},'referer':{'type':Sequelize[_0x197c('0x5')]},'customerIp':{'type':Sequelize[_0x197c('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x197c('0x7'))},'read1stAt':{'type':Sequelize[_0x197c('0x8')]},'lastMsgAt':{'type':Sequelize[_0x197c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x197c('0x9')]('in',_0x197c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x197c('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x197c('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x197c('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x152f=['sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x152f,0x144));var _0xf152=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x152f[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'closed':{'type':Sequelize[_0xf152('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf152('0x3')]},'ratingType':{'type':Sequelize[_0xf152('0x4')]('star',_0xf152('0x5')),'defaultValue':_0xf152('0x6')},'ratingMessage':{'type':Sequelize[_0xf152('0x7')]},'pathTranscript':{'type':Sequelize[_0xf152('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf152('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf152('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf152('0x9')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf152('0x9')]},'osVersion':{'type':Sequelize[_0xf152('0x9')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf152('0x9')]},'deviceType':{'type':Sequelize[_0xf152('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf152('0x9')]},'formData':{'type':Sequelize[_0xf152('0x7')](_0xf152('0xa'))},'read1stAt':{'type':Sequelize[_0xf152('0x8')]},'lastMsgAt':{'type':Sequelize[_0xf152('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf152('0x4')]('in',_0xf152('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf152('0x9')]},'customerPort':{'type':Sequelize[_0xf152('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xf152('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xf152('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f3763fe..6ca7c0e 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 _0x9f62=['findAll','getMyMessages','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','firstName','lastName','read','Account','Owner','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.ejs','.pdf','err','zip-dir','moment','bluebird','mustache','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','stack','name','send','render','merge','body','contact','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','talking','answered','unmanaged','abandoned','total','UserId','closed','waiting','disposition','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','sequelize','toString','ChatInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','o.fullname','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','include','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','ValidationError','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','nolimit','sort','$gte','options'];(function(_0x3d593d,_0x1dec8d){var _0x501ec5=function(_0x1b7039){while(--_0x1b7039){_0x3d593d['push'](_0x3d593d['shift']());}};_0x501ec5(++_0x1dec8d);}(_0x9f62,0x154));var _0x29f6=function(_0x35d8fa,_0x245fb7){_0x35d8fa=_0x35d8fa-0x0;var _0x585992=_0x9f62[_0x35d8fa];return _0x585992;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x0'));var rp=require('request-promise');var moment=require(_0x29f6('0x1'));var BPromise=require(_0x29f6('0x2'));var Mustache=require(_0x29f6('0x3'));var util=require('util');var path=require('path');var ejs=require(_0x29f6('0x4'));var fs=require('fs');var _=require(_0x29f6('0x5'));var squel=require(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x29f6('0x8'));var pdf=require(_0x29f6('0x9'));var logger=require(_0x29f6('0xa'))(_0x29f6('0xb'));var config=require(_0x29f6('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x29f6('0xd'),'port':0x18eb});var socket=require(_0x29f6('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x29f6('0xf')](socket);var jayson=require(_0x29f6('0x10'));var client=jayson['client'][_0x29f6('0x11')]({'port':0x232b});var client9004=jayson[_0x29f6('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b9b6a,_0x559585,_0x57b2d2,_0x2ae0e4){return new BPromise(function(_0x55cf4,_0x189344){var _0x11a1fd=_0x2ae0e4||client;return _0x11a1fd[_0x29f6('0x13')](_0x5b9b6a,_0x57b2d2)[_0x29f6('0x14')](function(_0x35d2e2){logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));logger[_0x29f6('0x18')](_0x29f6('0x19'),_0x559585,_0x29f6('0x17'),JSON[_0x29f6('0x1a')](_0x35d2e2));if(_0x35d2e2[_0x29f6('0x1b')]){if(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x559585,_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x189344(_0x35d2e2[_0x29f6('0x1b')]['message']);}logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x35d2e2['error'][_0x29f6('0x1d')]);return _0x55cf4(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);}else{logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));_0x55cf4(_0x35d2e2['result'][_0x29f6('0x1d')]);}})['catch'](function(_0x4acb15){logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x4acb15);_0x189344(_0x4acb15);});});}function respondWithStatusCode(_0x39c6b3,_0xafb5dd){_0xafb5dd=_0xafb5dd||0xcc;return function(_0x54ddeb){if(_0x54ddeb){return _0x39c6b3[_0x29f6('0x1e')](_0xafb5dd);}return _0x39c6b3['status'](_0xafb5dd)[_0x29f6('0x1f')]();};}function respondWithResult(_0xcce041,_0x4200cc){_0x4200cc=_0x4200cc||0xc8;return function(_0x1b80aa){if(_0x1b80aa){return _0xcce041['status'](_0x4200cc)[_0x29f6('0x20')](_0x1b80aa);}};}function respondWithFilteredResult(_0x4d494f,_0x47c385){return function(_0x1401fb){if(_0x1401fb){var _0x45f792=typeof _0x47c385[_0x29f6('0x21')]===_0x29f6('0x22')&&typeof _0x47c385[_0x29f6('0x23')]===_0x29f6('0x22');var _0x23c630=_0x1401fb['count'];var _0x2183b7=_0x45f792?0x0:_0x47c385[_0x29f6('0x21')];var _0x1ab8d8=_0x45f792?_0x1401fb[_0x29f6('0x24')]:_0x47c385[_0x29f6('0x21')]+_0x47c385[_0x29f6('0x23')];var _0x3790f5;if(_0x1ab8d8>=_0x23c630){_0x1ab8d8=_0x23c630;_0x3790f5=0xc8;}else{_0x3790f5=0xce;}_0x4d494f[_0x29f6('0x25')](_0x3790f5);return _0x4d494f[_0x29f6('0x26')](_0x29f6('0x27'),_0x2183b7+'-'+_0x1ab8d8+'/'+_0x23c630)[_0x29f6('0x20')](_0x1401fb);}return null;};}function saveUpdates(_0x1c3f0b){return function(_0x40c830){if(_0x40c830){return _0x40c830[_0x29f6('0x28')](_0x1c3f0b)[_0x29f6('0x14')](function(_0x218931){return _0x218931;});}return null;};}function removeEntity(_0x3a7249){return function(_0x5492c2){if(_0x5492c2){return _0x5492c2['destroy']()[_0x29f6('0x14')](function(){_0x3a7249['status'](0xcc)[_0x29f6('0x1f')]();});}};}function handleEntityNotFound(_0xc8d2c5){return function(_0x1e1bb6){if(!_0x1e1bb6){_0xc8d2c5[_0x29f6('0x1e')](0x194);}return _0x1e1bb6;};}function handleError(_0x5e5d89,_0x53e11f){_0x53e11f=_0x53e11f||0x1f4;return function(_0x1bde69){logger[_0x29f6('0x1b')](_0x1bde69[_0x29f6('0x29')]);if(_0x1bde69[_0x29f6('0x2a')]){delete _0x1bde69[_0x29f6('0x2a')];}_0x5e5d89[_0x29f6('0x25')](_0x53e11f)[_0x29f6('0x2b')](_0x1bde69);};}function getMustacheRender(_0x1c3f0f,_0xad83a3){return Mustache[_0x29f6('0x2c')](_0x1c3f0f,_[_0x29f6('0x2d')](_0xad83a3[_0x29f6('0x2e')],{'contact':_0xad83a3[_0x29f6('0x2f')],'message':_0xad83a3[_0x29f6('0x1d')],'agent':_0xad83a3['agent'],'interaction':_0xad83a3['interaction'],'account':_0xad83a3[_0x29f6('0x30')]}))||'';}function getInteractionUsers(_0x44cf19,_0x1cd62a){return new BPromise(function(_0x5416dc,_0x3e1e25){try{if(_0x1cd62a[_0x44cf19['id']]){_0x44cf19[_0x29f6('0x31')]=_[_0x29f6('0x32')](_0x1cd62a[_0x44cf19['id']],function(_0x27d945){return{'id':_0x27d945['id'],'fullname':_0x27d945[_0x29f6('0x33')]};});}}catch(_0x48fbd1){_0x3e1e25(_0x48fbd1);}_0x5416dc(_0x44cf19);});}function getInteractionTags(_0x7695ee,_0x2ad06f){return new BPromise(function(_0x2c3441,_0x1b51cc){try{if(_0x7695ee['TagIds']){_0x7695ee[_0x29f6('0x34')]=[];_0x7695ee[_0x29f6('0x35')][_0x29f6('0x36')](',')[_0x29f6('0x37')](function(_0x5ddc09){_0x7695ee['Tags'][_0x29f6('0x38')](_0x2ad06f[_0x5ddc09]);});}delete _0x7695ee['TagIds'];}catch(_0x10f077){_0x1b51cc(_0x10f077);}_0x2c3441(_0x7695ee);});}function updateChatInteraction(_0x551411,_0x3a1a75,_0x537210){return new BPromise(function(_0x34b1ea,_0x11fb2d){return getInteractionUsers(_0x551411,_0x537210)['then'](function(_0x1431fc){return getInteractionTags(_0x1431fc,_0x3a1a75);})['then'](function(_0x3f3475){return getStateInteraction(_0x3f3475);})[_0x29f6('0x14')](function(_0x4aea11){_0x34b1ea(_0x4aea11);})[_0x29f6('0x39')](function(_0xc6a6b1){_0x11fb2d(_0xc6a6b1);});});}function getStateInteraction(_0x2cad42){return new BPromise(function(_0x1e9d5a){_0x2cad42['waiting']=0x0;_0x2cad42[_0x29f6('0x3a')]=0x0;_0x2cad42[_0x29f6('0x3b')]=0x0;_0x2cad42[_0x29f6('0x3c')]=0x0;_0x2cad42[_0x29f6('0x3d')]=0x0;_0x2cad42[_0x29f6('0x3e')]=0x0;if(!_0x2cad42['closed']&&!_0x2cad42[_0x29f6('0x3f')]){_0x2cad42['waiting']+=0x1;}if(!_0x2cad42[_0x29f6('0x40')]&&_0x2cad42['UserId']){_0x2cad42[_0x29f6('0x3a')]+=0x1;if(_0x2cad42[_0x29f6('0x41')]){_0x2cad42['waiting']-=0x1;}}if(_0x2cad42[_0x29f6('0x40')]&&_0x2cad42[_0x29f6('0x42')]===_0x29f6('0x3d')){_0x2cad42[_0x29f6('0x3d')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42[_0x29f6('0x40')]&&!_0x2cad42[_0x29f6('0x3f')]&&_0x2cad42['disposition']){_0x2cad42[_0x29f6('0x3c')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42['closed']&&_0x2cad42['UserId']){_0x2cad42['answered']+=0x1;if(_0x2cad42[_0x29f6('0x3a')]){_0x2cad42[_0x29f6('0x3a')]-=0x1;}}_0x2cad42[_0x29f6('0x3e')]+=0x1;_0x1e9d5a(_0x2cad42);});}exports[_0x29f6('0x43')]=function(_0x19fd60,_0x270842){var _0x29b3f6={},_0x155ffb={},_0x352119={'count':0x0,'rows':[]};var _0x1bde93=_['map'](db['ChatInteraction'][_0x29f6('0x44')],function(_0x450e76){return{'name':_0x450e76[_0x29f6('0x45')],'type':_0x450e76[_0x29f6('0x46')]['key']};});_0x155ffb[_0x29f6('0x47')]=_[_0x29f6('0x32')](_0x1bde93,'name');_0x155ffb[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x19fd60[_0x29f6('0x48')]);_0x155ffb[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],_0x155ffb[_0x29f6('0x48')]);_0x29b3f6[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x19fd60[_0x29f6('0x48')]['fields']));_0x29b3f6[_0x29f6('0x4c')]=_0x29b3f6[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x29b3f6[_0x29f6('0x4c')]:_0x155ffb[_0x29f6('0x47')];if(!_0x19fd60['query'][_0x29f6('0x4f')]('nolimit')){_0x29b3f6['limit']=qs[_0x29f6('0x23')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x23')]);_0x29b3f6[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x19fd60['query'][_0x29f6('0x21')]);}_0x29b3f6[_0x29f6('0x50')]=qs['sort'](_0x19fd60[_0x29f6('0x48')]['sort']);_0x29b3f6[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x19fd60[_0x29f6('0x48')],_0x155ffb['filters']),_0x1bde93);var _0x199060=[];var _0xaa915c=squel[_0x29f6('0x53')]()[_0x29f6('0x54')]('id')[_0x29f6('0x54')](_0x29f6('0x2a'))[_0x29f6('0x54')]('color')[_0x29f6('0x55')](_0x29f6('0x56'));var _0x3bca11=squel[_0x29f6('0x53')]()[_0x29f6('0x54')](_0x29f6('0x57'))[_0x29f6('0x54')](_0x29f6('0x58'))[_0x29f6('0x54')](_0x29f6('0x59'))['from']('user_has_chat_interactions','ui')[_0x29f6('0x5a')](_0x29f6('0x5b'),'u',_0x29f6('0x5c'));var _0x5ab84e=squel[_0x29f6('0x53')]()['from']('chat_interactions','i')[_0x29f6('0x5a')](_0x29f6('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x29f6('0x5b'),'o',_0x29f6('0x5e'))[_0x29f6('0x5a')]('chat_websites','a',_0x29f6('0x5f'))[_0x29f6('0x5a')](_0x29f6('0x60'),'me',_0x29f6('0x61'))[_0x29f6('0x5a')](_0x29f6('0x62'),'it',_0x29f6('0x63'))[_0x29f6('0x5a')](_0x29f6('0x56'),'t',_0x29f6('0x64'));var _0x2d4c8d=squel[_0x29f6('0x65')]();var _0x434e04=[];var _0x5078d1=squel['expr']();var _0x2bd7d9;if(_0x19fd60['query'][_0x29f6('0x66')]){_0x2bd7d9=as[_0x29f6('0x67')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x66')]);var _0x2f757b=_0x2bd7d9['sqlOperator'];for(var _0x56c442=0x0;_0x56c442<_0x2bd7d9[_0x29f6('0x68')][_0x29f6('0x4e')];_0x56c442++){var _0x293f9d=_0x2bd7d9[_0x29f6('0x68')][_0x56c442];var _0x56342e='i';var _0x32291b=_['find'](_0x1bde93,['name',_0x293f9d[_0x29f6('0x54')]]);if(!_0x32291b){switch(_0x293f9d[_0x29f6('0x54')]){case'unreadMessages':if(_0x293f9d[_0x29f6('0x69')]==0x1){_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d['field']+_0x29f6('0x6b'));}else{_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d[_0x29f6('0x54')]+_0x29f6('0x6c'));}break;case _0x29f6('0x6d'):if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){if(_0x293f9d['value'][_0x29f6('0x36')]('\x20')['length']>0x1){_0x2d4c8d[_0x2f757b](_0x29f6('0x70'),qs['getFullTextValue'](_0x293f9d['value']),null);}else{var _0x1a3357='%'+_0x293f9d[_0x29f6('0x69')]+'%';_0x2d4c8d[_0x2f757b](_0x29f6('0x71'),_0x1a3357,_0x1a3357,_0x1a3357);}}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x72')]);_0x293f9d[_0x29f6('0x54')]='ContactId';_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b[_0x29f6('0x46')],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x76'):var _0x56f3cb=_0x293f9d[_0x29f6('0x69')][_0x29f6('0x36')](',')[_0x29f6('0x32')](function(_0x456578){return Number(_0x456578);});_0x56f3cb[_0x29f6('0x37')](function(_0x122a1a){_0x5078d1['or'](_0x29f6('0x77'),'%,'+_0x122a1a+',%');});_0x434e04=_[_0x29f6('0x78')](_0x434e04,_0x56f3cb);break;case'User':if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){_0x2d4c8d[_0x2f757b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x293f9d[_0x29f6('0x69')]+'%',null);}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x3f')]);_0x293f9d['field']=_0x29f6('0x3f');_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e['text'],_0x411f3e['value'][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x2e'):_0x411f3e=as[_0x29f6('0x73')]('me',null,_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')]['start'],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);break;}}else{var _0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}}}else{var _0x478ed0=_(_0x19fd60[_0x29f6('0x48')])[_0x29f6('0x49')]()[_0x29f6('0x32')](function(_0x1f401c){return _[_0x29f6('0x79')](_0x1bde93,[_0x29f6('0x2a'),_0x1f401c])?_0x1f401c:undefined;})['compact']()[_0x29f6('0x69')]();if(!_['isEmpty'](_0x478ed0)){_0x478ed0['forEach'](function(_0x4f9907){if(_0x4f9907===_0x29f6('0x7a')){_0x5ab84e['where'](_0x29f6('0x7b'),[][_0x29f6('0x7c')](_0x19fd60[_0x29f6('0x48')][_0x4f9907]));}else if(_0x4f9907===_0x29f6('0x7d')){var _0x8a5e58=JSON[_0x29f6('0x7e')](_0x19fd60[_0x29f6('0x48')][_0x4f9907])['$gte'];var _0x3a23f3=JSON['parse'](_0x19fd60[_0x29f6('0x48')][_0x4f9907])[_0x29f6('0x7f')];_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x80'),_0x8a5e58,_0x3a23f3);}else{if(_0x19fd60[_0x29f6('0x48')][_0x4f9907]===_0x29f6('0x81')){_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x82'));}else{_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x83'),_0x19fd60[_0x29f6('0x48')][_0x4f9907]);}}});}if(_0x19fd60[_0x29f6('0x48')]['read']){if(_0x19fd60['query']['read']==0x1){_0x5ab84e[_0x29f6('0x6a')](_0x29f6('0x84'));}else{_0x5ab84e['having'](_0x29f6('0x85'));}}if(_0x19fd60['query'][_0x29f6('0x86')]){_0x434e04=_[_0x29f6('0x87')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')])?_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]:new Array(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]);_0x434e04[_0x29f6('0x37')](function(_0xa2ab9e){_0x5078d1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa2ab9e+',%');});}if(_0x19fd60[_0x29f6('0x48')]['filter']){var _0x16bb3c=_0x19fd60[_0x29f6('0x48')][_0x29f6('0x88')][_0x29f6('0x89')]('\x5c','\x5c\x5c')[_0x29f6('0x89')](/'/g,'\x27\x27');if(qs[_0x29f6('0x8a')](_0x16bb3c)){_0x2d4c8d['or'](_0x29f6('0x8b'),_0x16bb3c+'%');}else{_0x2d4c8d['or'](_0x29f6('0x8c'),qs['getFullTextValue'](_0x16bb3c))['or'](_0x29f6('0x8d'),_0x16bb3c+'%');}}}_0x5ab84e[_0x29f6('0x51')](_0x2d4c8d);_0x5ab84e['group']('i.id');var _0x216f51={'type':db[_0x29f6('0x8e')][_0x29f6('0x8f')][_0x29f6('0x90')],'raw':!![]};var _0x467dd2=_0x5ab84e[_0x29f6('0x91')]();_0x467dd2[_0x29f6('0x54')](_0x29f6('0x92'));_0x467dd2[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));if(_0x29b3f6[_0x29f6('0x50')]){_0x29b3f6['order']['forEach'](function(_0x2e2f16){var _0x180658=_0x2e2f16[0x0]==='contactName'?_0x2e2f16[0x0]:'i.'+_0x2e2f16[0x0];_0x5ab84e[_0x29f6('0x50')](_0x180658,_0x2e2f16[0x1]===_0x29f6('0x95')?![]:!![]);});}if(!_[_0x29f6('0x96')](_0x434e04)){_0x5ab84e[_0x29f6('0x6a')](_0x5078d1);_0x467dd2[_0x29f6('0x51')](_0x29f6('0x97'),_0x434e04);}BPromise[_0x29f6('0x98')]()['then'](function(){if(!_0x2bd7d9){if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return;_0x467dd2[_0x29f6('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x99'));return;}if(_0x19fd60['user'][_0x29f6('0x9a')]!==_0x29f6('0x9b'))return;return _0x19fd60['user'][_0x29f6('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x405124){if(_[_0x29f6('0x96')](_0x405124)){_0x467dd2[_0x29f6('0x51')](_0x29f6('0x9d'));_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x9d'));}else{_0x467dd2['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));_0x5ab84e[_0x29f6('0x51')]('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));}});})['then'](function(){if(_0x19fd60[_0x29f6('0x9e')][_0x29f6('0x9a')]===_0x29f6('0x9b')&&!_0x2bd7d9&&!_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return[];return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x467dd2['toString'](),_0x216f51);})[_0x29f6('0x14')](function(_0x365b6d){_0x352119[_0x29f6('0x24')]=_0x365b6d['length'];if(_0x352119['count']===0x0)return[];return db['sequelize']['query'](_0xaa915c[_0x29f6('0xa0')](),_0x216f51)['then'](function(_0x537a8d){_0x199060=_['keyBy'](_0x537a8d,'id');_0x216f51=_[_0x29f6('0x2d')](_0x216f51,{'model':db[_0x29f6('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x4d')]){_0x29b3f6[_0x29f6('0x4c')]['forEach'](function(_0x28cf80){_0x5ab84e['field']('i.'+_0x28cf80);});}else{_0x5ab84e[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));_0x5ab84e[_0x29f6('0x54')]('a.key','Account.key');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa2'),_0x29f6('0xa3'));_0x5ab84e['field'](_0x29f6('0xa4'),_0x29f6('0xa5'));_0x5ab84e['field'](_0x29f6('0xa6'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa7'),_0x29f6('0xa8'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa9'),_0x29f6('0xaa'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xab'),_0x29f6('0xac'));_0x5ab84e['field'](_0x29f6('0xad'),'Contact.phone');_0x5ab84e['field']('c.mobile',_0x29f6('0xae'));_0x5ab84e[_0x29f6('0x54')]('c.fax','Contact.fax');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xaf'),'Owner.fullname');_0x5ab84e['field']('o.internal','Owner.internal');_0x5ab84e[_0x29f6('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29f6('0x35'));}if(_0x29b3f6[_0x29f6('0x23')])_0x5ab84e['limit'](_0x29b3f6[_0x29f6('0x23')]);if(_0x29b3f6[_0x29f6('0x21')])_0x5ab84e['offset'](_0x29b3f6[_0x29f6('0x21')]);return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x5ab84e[_0x29f6('0xa0')](),_0x216f51);})[_0x29f6('0x14')](function(_0x399328){if(_0x399328[_0x29f6('0x4e')]>0x0)_0x3bca11[_0x29f6('0x51')](_0x29f6('0xb0'),_[_0x29f6('0x32')](_0x399328,'id'));return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x3bca11[_0x29f6('0xa0')](),_0x216f51)[_0x29f6('0x14')](function(_0x5076ed){var _0x24757e=_[_0x29f6('0xb1')](_0x5076ed,_0x29f6('0xb2'));var _0x264617=[];_0x399328[_0x29f6('0x37')](function(_0x3569f7){_0x264617[_0x29f6('0x38')](updateChatInteraction(_0x3569f7,_0x199060,_0x24757e));});return BPromise['all'](_0x264617);});});})[_0x29f6('0x14')](function(_0x4ec09d){_0x352119[_0x29f6('0xb3')]=_0x4ec09d;return _0x352119;})[_0x29f6('0x14')](respondWithFilteredResult(_0x270842,_0x29b3f6))[_0x29f6('0x39')](handleError(_0x270842,null));};exports[_0x29f6('0xb4')]=function(_0x43c44d,_0x63517e){var _0x2dc960={'raw':![],'where':{'id':_0x43c44d[_0x29f6('0xb5')]['id']}},_0x312a6f={};_0x312a6f['model']=_[_0x29f6('0x49')](db[_0x29f6('0xa1')]['rawAttributes']);_0x312a6f['query']=_[_0x29f6('0x49')](_0x43c44d[_0x29f6('0x48')]);_0x312a6f[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x312a6f['model'],_0x312a6f[_0x29f6('0x48')]);_0x2dc960[_0x29f6('0x4c')]=_['intersection'](_0x312a6f[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x43c44d[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x2dc960[_0x29f6('0x4c')]=_0x2dc960[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2dc960[_0x29f6('0x4c')]:_0x312a6f[_0x29f6('0x47')];if(_0x43c44d[_0x29f6('0x48')][_0x29f6('0xb6')]){_0x2dc960[_0x29f6('0xb7')]=[{'all':!![]}];}_0x2dc960=_[_0x29f6('0x2d')]({},_0x2dc960,_0x43c44d['options']);return db[_0x29f6('0xa1')][_0x29f6('0xb8')](_0x2dc960)[_0x29f6('0x14')](handleEntityNotFound(_0x63517e,null))[_0x29f6('0x14')](respondWithResult(_0x63517e,null))['catch'](handleError(_0x63517e,null));};exports[_0x29f6('0xb9')]=function(_0x2ffad1,_0x37ea1b){return db['ChatInteraction'][_0x29f6('0xb9')](_0x2ffad1[_0x29f6('0x2e')],{})['then'](respondWithResult(_0x37ea1b,0xc9))[_0x29f6('0x39')](handleError(_0x37ea1b,null));};exports[_0x29f6('0x28')]=function(_0x26f030,_0x247bce){if(_0x26f030[_0x29f6('0x2e')]['id']){delete _0x26f030[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x26f030[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x247bce,null))[_0x29f6('0x14')](saveUpdates(_0x26f030['body'],null))['then'](respondWithResult(_0x247bce,null))[_0x29f6('0x39')](handleError(_0x247bce,null));};exports[_0x29f6('0xba')]=function(_0x1621b7,_0x1f0e72){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x1621b7[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1f0e72,null))['then'](removeEntity(_0x1f0e72,null))['catch'](handleError(_0x1f0e72,null));};exports['describe']=function(_0x1fd477,_0x45dfd1){return db[_0x29f6('0xa1')][_0x29f6('0xbb')]()['then'](respondWithResult(_0x45dfd1,null))[_0x29f6('0x39')](handleError(_0x45dfd1,null));};exports[_0x29f6('0xbc')]=function(_0x4f2471,_0x1ef540){var _0x5a51c0=_0x4f2471[_0x29f6('0xb5')]['id'];var _0x2a2e0e;var _0xaccfb7;var _0x19c10d;return db['ChatInteraction'][_0x29f6('0xbd')]({'where':{'id':_0x5a51c0}})['then'](function(_0x47785a){_0x2a2e0e=_0x47785a;return db[_0x29f6('0xbe')][_0x29f6('0xbd')]({'where':{'id':_0x47785a[_0x29f6('0x7a')]},'attributes':['id',_0x29f6('0xbf'),_0x29f6('0xc0'),'vidaooTopic','vidaooNote',_0x29f6('0xc1')],'raw':!![]});})['then'](function(_0x5db958){if(_0x5db958&&_0x5db958[_0x29f6('0xbf')]&&_0x5db958['vidaooEscalation']){_0xaccfb7=_0x5db958;var _0x67c30a={'interaction':{'id':_0x5a51c0},'agent':{'id':_0x4f2471[_0x29f6('0x9e')]['id'],'name':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x2a')],'fullname':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x33')],'email':_0x4f2471['user'][_0x29f6('0xc2')]},'contact':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x2f')],'account':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x30')]};var _0x1cec09={'rejectUnauthorized':![],'method':_0x29f6('0xc3'),'url':_0x29f6('0xc4'),'headers':{'X-APIKEY':_0x5db958[_0x29f6('0xbf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f2471[_0x29f6('0x9e')][_0x29f6('0xc2')]],'buttons':null,'topic':_0xaccfb7['vidaooTopic'],'note':_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc6')])?null:getMustacheRender(_0xaccfb7['vidaooNote'],_0x67c30a),'metadata':null},'redirect':_0x29f6('0xc7'),'json':!![]};try{if(!_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc1')])){var _0x50d48d=getMustacheRender(_0xaccfb7['vidaooMetadata'],_0x67c30a);var _0x1413a5=JSON[_0x29f6('0x7e')](_0x50d48d);_0x1cec09[_0x29f6('0x2e')][_0x29f6('0xc8')]=_0x1413a5;}}catch(_0x2b6357){throw new db[(_0x29f6('0x8e'))]['ValidationError'](_0x29f6('0xc9'));}return rp(_0x1cec09);}else{throw new db[(_0x29f6('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x231f26){_0x19c10d=_0x231f26;if(_0x19c10d['id']){var _0x578d49={'body':_0x19c10d[_0x29f6('0xca')],'ChatWebsiteId':_0xaccfb7['id'],'ChatInteractionId':_0x2a2e0e['id'],'direction':'out','UserId':_0x4f2471[_0x29f6('0x9e')]['id']};return db[_0x29f6('0xcb')][_0x29f6('0xb9')](_0x578d49,{});}else{throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x29f6('0x14')](function(){return _0x2a2e0e['updateAttributes']({'vidaooSessionId':_0x19c10d['id']});})[_0x29f6('0x14')](respondWithResult(_0x1ef540,null))[_0x29f6('0x39')](handleError(_0x1ef540,null));};exports[_0x29f6('0xcd')]=function(_0x19d1cb,_0x478660){if(_0x19d1cb[_0x29f6('0x2e')]['id']){delete _0x19d1cb[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x19d1cb[_0x29f6('0xb5')]['id']},'include':[{'model':db['CmContact'],'as':_0x29f6('0x6d')}]})[_0x29f6('0x14')](handleEntityNotFound(_0x478660,null))['then'](saveUpdates(_0x19d1cb[_0x29f6('0x2e')],null))['then'](respondWithResult(_0x478660,null))[_0x29f6('0x39')](handleError(_0x478660,null));};exports[_0x29f6('0xce')]=function(_0x52c66d,_0x955f7){if(_0x52c66d[_0x29f6('0x2e')]['id']){delete _0x52c66d['body']['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x52c66d[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](function(_0x352a07){if(!_0x352a07){logger[_0x29f6('0x1b')](_0x29f6('0xcf'),_0x29f6('0xce'),0x194,'entity\x20not\x20found');_0x955f7[_0x29f6('0x1e')](0x194);}else{if(_0x352a07[_0x29f6('0x3f')]){throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Interaction\x20already\x20assigned');}}return _0x352a07;})[_0x29f6('0x14')](function(_0x10648e){if(_0x10648e){return _0x10648e[_0x29f6('0x28')]({'closed':_0x52c66d[_0x29f6('0x2e')][_0x29f6('0x40')],'disposition':_0x52c66d['body']['disposition']})[_0x29f6('0x14')](function(_0x1b3b27){return _0x1b3b27;});}})['then'](function(){return respondWithRpcPromise(_0x29f6('0xd0'),'abandon',_0x52c66d['body'],client9004);})[_0x29f6('0x14')](respondWithResult(_0x955f7,null))['catch'](handleError(_0x955f7,null));};exports[_0x29f6('0xd1')]=function(_0x24a7fb,_0x454c4c){_0x24a7fb[_0x29f6('0x2e')]['name']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd3')];_0x24a7fb[_0x29f6('0x2e')][_0x29f6('0xd4')]=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd5')];_0x24a7fb['body']['type']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd6')];return db[_0x29f6('0xd7')][_0x29f6('0xb9')](_0x24a7fb[_0x29f6('0x2e')])[_0x29f6('0x14')](respondWithResult(_0x454c4c,0xc9))[_0x29f6('0x39')](handleError(_0x454c4c,null));};exports[_0x29f6('0xd8')]=function(_0x3d131a,_0x2bc181){return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d131a[_0x29f6('0xb5')]['id']},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null))[_0x29f6('0x14')](function(_0x583f5f){if(_0x583f5f){if(_0x583f5f[_0x29f6('0x40')]){return _0x2bc181[_0x29f6('0x25')](0x193)[_0x29f6('0x20')]({'status':0x193,'message':_0x29f6('0xd9')});}return db[_0x29f6('0xd7')]['findOne']({'where':{'id':_0x3d131a[_0x29f6('0x48')][_0x29f6('0xda')]},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null));}})['then'](function(_0x2378b8){if(_0x2378b8){var _0x2a5414=_0x2378b8[_0x29f6('0xdb')]!==null;var _0x189048=path['join'](config[_0x29f6('0xdc')],'server/files/attachments/');if(_0x2a5414){_0x189048=path[_0x29f6('0xdd')](_0x189048,'offline-chat/');}var _0x2aa18b=path[_0x29f6('0xdd')](_0x189048,_0x2378b8[_0x29f6('0xd4')]);return _0x2bc181[_0x29f6('0xde')](_0x2aa18b);}})['catch'](handleError(_0x2bc181,null));};exports[_0x29f6('0xdf')]=function(_0x2216ef,_0x4577ee){var _0x2ef994=null;var _0x28e4c5=null;var _0x168724=null;if(_0x2216ef[_0x29f6('0x2e')]['id']){delete _0x2216ef[_0x29f6('0x2e')]['id'];}if(_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')]){_0x168724=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server/files/chat/upload/',util[_0x29f6('0xe1')](_0x29f6('0xe2'),Date[_0x29f6('0xe3')]()));_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe4')]=_0x168724;}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x2216ef[_0x29f6('0xb5')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x29f6('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x29f6('0x14')](handleEntityNotFound(_0x4577ee,null))['then'](saveUpdates(_0x2216ef[_0x29f6('0x2e')],null))[_0x29f6('0x14')](function(_0x4a3381){if(_0x4a3381){_0x2ef994=_0x4a3381;return db[_0x29f6('0xbe')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994[_0x29f6('0x7a')]}});}})[_0x29f6('0x14')](function(_0xdb766a){if(_0xdb766a){_0x28e4c5=_0xdb766a;return db[_0x29f6('0xe6')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994['ContactId']}});}})[_0x29f6('0x14')](function(_0x37735f){if(_0x37735f){if(_0x168724){var _0x399aed=null;for(var _0xe432b0=0x1;_0xe432b0<_0x2ef994[_0x29f6('0xe5')][_0x29f6('0x4e')];++_0xe432b0){_0x399aed=_0x2ef994['Messages'][_0xe432b0];var _0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):_0x29f6('0xe9');var _0x46a5da=_0x2216ef['body'][_0x29f6('0xea')]||util['format']('%s%d',_0x29f6('0xeb'),_0x399aed[_0x29f6('0x72')]);switch(_0x28e4c5[_0x29f6('0xec')]){case _0x29f6('0xed'):_0x21bc96=_0x399aed['UserId']?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed[_0x29f6('0x3f')]):_0x29f6('0xe9');break;case _0x29f6('0xee'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed[_0x29f6('0xef')][_0x29f6('0xf0')]||_0x399aed[_0x29f6('0xef')][_0x29f6('0x33')]:_0x29f6('0xe9');break;case _0x29f6('0xf1'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed['User']['fullname']:_0x29f6('0xe9');break;default:_0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):'System';}var _0x593d86=util[_0x29f6('0xe1')](_0x29f6('0xf2'),moment(_0x399aed[_0x29f6('0x7d')])[_0x29f6('0xe1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x399aed[_0x29f6('0xf3')]==='in'?_0x46a5da:_0x21bc96,_0x399aed[_0x29f6('0x2e')]);if(!_0x399aed[_0x29f6('0xf4')]){fs[_0x29f6('0xf5')](_0x168724,_0x593d86);}}return db[_0x29f6('0xf6')][_0x29f6('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0x29f6('0xf7')],'as':_0x29f6('0xf8'),'raw':!![],'include':[{'model':db[_0x29f6('0xf9')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29f6('0x14')](function(_0x294136){if(!_0x294136||!_0x294136[_0x29f6('0xf8')]||!_0x2216ef[_0x29f6('0x2e')])return _0x2ef994;var _0x59fb2a=_0x294136['getSmtpOptions']();return respondWithRpcPromise(_0x29f6('0xfa'),_0x29f6('0xfb'),{'account':_0x59fb2a,'message':{'from':util[_0x29f6('0xe1')](_0x29f6('0xfc'),_0x294136[_0x29f6('0x2a')],_0x294136['email']||_0x294136[_0x29f6('0xf8')][_0x29f6('0x9e')]),'to':_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')],'subject':_0x29f6('0xfd'),'text':util[_0x29f6('0xe1')](_0x29f6('0xfe'),_0x2216ef['body'][_0x29f6('0xe0')]),'attachments':[{'path':_0x168724}]}})[_0x29f6('0x14')](function(){return _0x2ef994;})[_0x29f6('0x39')](function(_0x3d027f){logger['error'](_0x3d027f);});})[_0x29f6('0x14')](respondWithStatusCode(_0x4577ee,0xc8))[_0x29f6('0x39')](handleError(_0x4577ee,null));};exports[_0x29f6('0xff')]=function(_0x2df557,_0x589222){return db[_0x29f6('0xcb')][_0x29f6('0xb8')]({'where':{'id':_0x2df557[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x589222,null))[_0x29f6('0x14')](function(_0x318fd1){if(_0x318fd1){return _0x318fd1[_0x29f6('0xff')](_0x2df557[_0x29f6('0x2e')]['ids'],_[_0x29f6('0x100')](_0x2df557[_0x29f6('0x2e')],['ids','id'])||{});}})['then'](respondWithResult(_0x589222,null))['catch'](handleError(_0x589222,null));};exports[_0x29f6('0x101')]=function(_0x29017d,_0x5863a2){var _0x2f7729={'raw':![],'where':{}};var _0x171342={};var _0x1dafb9={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x29017d['params']['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x5863a2,null))[_0x29f6('0x14')](function(_0x1207f7){if(_0x1207f7){_0x171342[_0x29f6('0x47')]=_[_0x29f6('0x49')](db[_0x29f6('0xcb')][_0x29f6('0x44')]);_0x171342[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x29017d[_0x29f6('0x48')]);_0x171342['filters']=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],_0x171342['query']);_0x2f7729[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x29017d[_0x29f6('0x48')]['fields']));_0x2f7729[_0x29f6('0x4c')]=_0x2f7729[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2f7729['attributes']:_0x171342['model'];if(!_0x29017d[_0x29f6('0x48')][_0x29f6('0x4f')](_0x29f6('0x102'))){_0x2f7729[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x29017d[_0x29f6('0x48')]['limit']);_0x2f7729['offset']=qs[_0x29f6('0x21')](_0x29017d[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x2f7729[_0x29f6('0x50')]=qs[_0x29f6('0x103')](_0x29017d[_0x29f6('0x48')]['sort']);_0x2f7729['where']=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x29017d[_0x29f6('0x48')],_0x171342['filters']));_0x2f7729['where']['ChatInteractionId']=_0x1207f7['id'];if(_0x29017d[_0x29f6('0x48')]['filter']){_0x2f7729[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x2f7729[_0x29f6('0x4c')],function(_0x25532f){var _0x31ebb3={};_0x31ebb3[_0x25532f]={'$like':'%'+_0x29017d[_0x29f6('0x48')][_0x29f6('0x88')]+'%'};return _0x31ebb3;})});}if(_0x29017d['query'][_0x29f6('0x104')]){var _0x173977=_0x29017d['query'][_0x29f6('0x104')][_0x29f6('0x36')](',');var _0x43acdc={};_0x43acdc[_0x173977[0x0]]={'$gte':moment(_0x173977[0x1])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f7729['where']=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],_0x43acdc);}_0x2f7729=_[_0x29f6('0x2d')]({},_0x2f7729,_0x29017d[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x2f7729['where']})[_0x29f6('0x14')](function(_0x216ad8){_0x1dafb9['count']=_0x216ad8;if(_0x29017d['query']['includeAll']){_0x2f7729[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')][_0x29f6('0x106')](_0x2f7729);})[_0x29f6('0x14')](function(_0x2b1808){_0x1dafb9['rows']=_0x2b1808;return _0x1dafb9;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x5863a2,_0x2f7729))[_0x29f6('0x39')](handleError(_0x5863a2,null));};exports[_0x29f6('0x107')]=function(_0x3d68f3,_0x1cb0c0){var _0x47e4e5={'where':{}},_0x3a19d2={},_0x3450c3={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d68f3[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1cb0c0,null))[_0x29f6('0x14')](function(_0x6a318b){if(_0x6a318b){_0x3a19d2['model']=_[_0x29f6('0x49')](db[_0x29f6('0xcb')]['rawAttributes']);_0x3a19d2[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x3d68f3[_0x29f6('0x48')]);_0x3a19d2['filters']=_['intersection'](_0x3a19d2['model'],_0x3a19d2['query']);_0x47e4e5[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x3a19d2[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x47e4e5[_0x29f6('0x4c')]=_0x47e4e5[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x47e4e5[_0x29f6('0x4c')]:_0x3a19d2['model'];if(!_0x3d68f3[_0x29f6('0x48')]['hasOwnProperty'](_0x29f6('0x102'))){_0x47e4e5[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x23')]);_0x47e4e5[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x47e4e5['order']=qs['sort'](_0x3d68f3[_0x29f6('0x48')]['sort']);_0x47e4e5[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x3d68f3[_0x29f6('0x48')],_0x3a19d2[_0x29f6('0x4a')]));_0x47e4e5['where'][_0x29f6('0xb2')]=_0x6a318b['id'];if(_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x88')]){_0x47e4e5[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x47e4e5[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x47e4e5[_0x29f6('0x4c')],function(_0x346ece){var _0xc22605={};_0xc22605[_0x346ece]={'$like':'%'+_0x3d68f3[_0x29f6('0x48')]['filter']+'%'};return _0xc22605;})});}_0x47e4e5[_0x29f6('0x51')]['secret']=![];if(_0x3d68f3[_0x29f6('0x48')]['id']){_0x47e4e5[_0x29f6('0x51')]['id']={'$gt':_0x3d68f3['query']['id']};}_0x47e4e5=_['merge']({},_0x47e4e5,_0x3d68f3[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x47e4e5[_0x29f6('0x51')]})[_0x29f6('0x14')](function(_0x15db8c){_0x3450c3[_0x29f6('0x24')]=_0x15db8c;_0x47e4e5[_0x29f6('0xb7')]=[];if(_0x3d68f3['query']['includeAgent']){_0x47e4e5[_0x29f6('0xb7')]['push']({'model':db[_0x29f6('0xef')],'as':_0x29f6('0xef'),'attributes':['id','fullname',_0x29f6('0xf0')]});}if(_0x3d68f3[_0x29f6('0x48')]['includeAll']){_0x47e4e5[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')]['findAll'](_0x47e4e5);})['then'](function(_0x37c860){_0x3450c3[_0x29f6('0xb3')]=_0x37c860;return _0x3450c3;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x1cb0c0,_0x47e4e5))[_0x29f6('0x39')](handleError(_0x1cb0c0,null));};exports[_0x29f6('0x108')]=function(_0x371548,_0x7a0ebf){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x371548[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x7a0ebf,null))[_0x29f6('0x14')](function(_0x1e05e2){if(_0x1e05e2){return _0x1e05e2[_0x29f6('0x109')](_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')],_[_0x29f6('0x100')](_0x371548[_0x29f6('0x2e')],[_0x29f6('0x10a'),'id'])||{})[_0x29f6('0x10b')](function(){return db[_0x29f6('0x76')]['findAll']({'attributes':['id',_0x29f6('0x2a'),_0x29f6('0x10c')],'where':{'id':_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')]}});})['then'](function(_0x5248ba){socket[_0x29f6('0x10d')](_0x29f6('0x10e'),{'id':Number(_0x371548[_0x29f6('0xb5')]['id']),'tags':_0x5248ba||[]});return{'id':Number(_0x371548['params']['id']),'tags':_0x5248ba||[]};});}})[_0x29f6('0x14')](respondWithResult(_0x7a0ebf,null))[_0x29f6('0x39')](handleError(_0x7a0ebf,null));};exports[_0x29f6('0x10f')]=function(_0x47028e,_0x410ab5){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x47028e[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x410ab5,null))[_0x29f6('0x14')](function(_0x281c49){if(_0x281c49){return _0x281c49[_0x29f6('0x10f')](_0x47028e[_0x29f6('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x410ab5,null))[_0x29f6('0x39')](handleError(_0x410ab5,null));};exports['download']=function(_0x5250bc,_0x31ba94){var _0x31dcfe=moment()[_0x29f6('0x110')]()[_0x29f6('0xa0')]();var _0x5cf3d4=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],_0x29f6('0x111'),'files',_0x29f6('0x112'));var _0x5dcaf2=path['join'](config['root'],'server',_0x29f6('0x113'),_0x29f6('0x114'));var _0xcf75fe=path[_0x29f6('0xdd')](_0x5cf3d4,_0x31dcfe);var _0x48ecb0=util['format']('transcript-%d-%s.zip',_0x5250bc[_0x29f6('0xb5')]['id'],_0x31dcfe);var _0x5de30e=path[_0x29f6('0xdd')](_0x5cf3d4,_0x48ecb0);var _0x10989a=[];_0x10989a[_0x29f6('0x38')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x10989a[_0x29f6('0x38')]({'model':db[_0x29f6('0xe6')],'as':_0x29f6('0x6d'),'attributes':['id',_0x29f6('0x115'),_0x29f6('0x116')],'raw':!![]});if(_0x5250bc['query'][_0x29f6('0x114')]){_0x10989a[_0x29f6('0x38')]({'model':db['Attachment'],'as':_0x29f6('0xd7'),'raw':!![]});}var _0x15c951=[{'model':db[_0x29f6('0xcb')],'as':'Messages','attributes':['id','body',_0x29f6('0x7d'),'direction',_0x29f6('0xf4'),_0x29f6('0x117')],'include':_0x10989a}];_0x15c951['push']({'model':db['ChatWebsite'],'as':_0x29f6('0x118'),'attributes':['id',_0x29f6('0x2a')]});_0x15c951[_0x29f6('0x38')]({'model':db['User'],'as':_0x29f6('0x119'),'attributes':['id',_0x29f6('0x33')]});return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x5250bc[_0x29f6('0xb5')]['id']},'include':_0x15c951})['then'](handleEntityNotFound(_0x31ba94,null))[_0x29f6('0x14')](function(_0x4ad41d){if(_0x4ad41d){var _0x598bcd=_0x4ad41d['get']({'plain':!![]});fs['mkdirSync'](_0xcf75fe);var _0x53751c={'channel':_0x29f6('0x11a'),'account':_0x598bcd['Account'][_0x29f6('0x2a')],'agent':_0x598bcd[_0x29f6('0x119')]?_0x598bcd[_0x29f6('0x119')][_0x29f6('0x33')]:_0x29f6('0x11b'),'createdAt':moment(_0x598bcd['createdAt'])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'closedAt':_0x598bcd['closed']?moment(_0x598bcd[_0x29f6('0x11d')])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29f6('0xa0')]():'','disposition':_0x598bcd['disposition'],'chatInfo':{'browser':_0x598bcd[_0x29f6('0x11e')],'os':_0x598bcd[_0x29f6('0x11f')],'referer':_0x598bcd[_0x29f6('0x120')],'customerIp':_0x598bcd[_0x29f6('0x121')],'customerPort':_0x598bcd[_0x29f6('0x122')]?_0x598bcd[_0x29f6('0x122')]:_0x29f6('0x11b')},'messages':_(_0x598bcd[_0x29f6('0xe5')])[_0x29f6('0x123')]()[_0x29f6('0x88')]({'secret':![]})[_0x29f6('0x32')](function(_0x2fd414){if(_0x2fd414['Attachment']){var _0x49c5f6=path[_0x29f6('0xdd')](_0x5dcaf2,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]);if(fs[_0x29f6('0x124')](_0x49c5f6)){fs[_0x29f6('0x125')](_0x49c5f6)[_0x29f6('0x126')](fs[_0x29f6('0x127')](path[_0x29f6('0xdd')](_0xcf75fe,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')])));}}return{'date':moment(_0x2fd414[_0x29f6('0x7d')])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'sender':_0x2fd414[_0x29f6('0xf3')]===_0x29f6('0x128')?_0x2fd414[_0x29f6('0xef')]?_0x2fd414[_0x29f6('0xef')]['fullname']:_0x29f6('0xe9'):_0x2fd414[_0x29f6('0x6d')]['firstName']+(_0x2fd414['Contact'][_0x29f6('0x116')]?'\x20'+_0x2fd414[_0x29f6('0x6d')][_0x29f6('0x116')]:''),'body':_0x2fd414[_0x29f6('0xd7')]?_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]:_0x2fd414[_0x29f6('0x2e')],'direction':_0x2fd414['direction']==='out'?'A':'C','secret':_0x2fd414['secret'],'read':_0x2fd414[_0x29f6('0x117')],'attachment':_0x2fd414[_0x29f6('0xd7')]};})[_0x29f6('0x69')]()};return ejs[_0x29f6('0x129')](path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server','views',_0x29f6('0x12a')),{'interaction':_0x53751c})[_0x29f6('0x14')](function(_0x3307a1){var _0x595aff=path[_0x29f6('0xdd')](_0xcf75fe,'transcript-'+_0x598bcd['id']+'-'+_0x31dcfe+_0x29f6('0x12b'));var _0x3101aa={'path':_0x595aff,'channel':'Chat','interactionId':_0x598bcd['id']};return pdf['createPdfFromHTML'](_0x3307a1,_0x3101aa);})[_0x29f6('0x14')](function(){return new Promise(function(_0x4c7b46,_0x41d45f){zipdir(_0xcf75fe,{'saveTo':_0x5de30e},function(_0x1f1679,_0x2dfc83){if(_0x1f1679)return _0x41d45f(_0x1f1679);return _0x4c7b46(_0x2dfc83);});})[_0x29f6('0x14')](function(){return new BPromise(function(_0x53cde9,_0x26eef7){rimraf(_0xcf75fe,function(_0x17b595){if(_0x17b595)_0x26eef7(_0x17b595);return _0x53cde9();});});})['then'](function(){return _0x31ba94[_0x29f6('0xde')](_0x5de30e,_0x48ecb0,function(_0x22fcde){if(_0x22fcde){logger[_0x29f6('0x1b')](_0x29f6('0x12c'),_0x22fcde);}else{fs['unlinkSync'](_0x5de30e);}});});});}else{return _0x31ba94[_0x29f6('0x1e')](0xc8);}})[_0x29f6('0x39')](handleError(_0x31ba94,null));}; \ No newline at end of file +var _0x99e9=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','some','compact','isEmpty','forEach','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','rawAttributes','include','options','create','body','describe','createVidaooSession','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','attachmentUpload','file','basename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','ChatWebsite','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','includeAgent','addTags','setTags','spread','emit','removeTags','download','unix','server','files','tmp','attachments','lastName','createdAt','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','zip-dir','request-promise','moment','bluebird','util','path','ejs','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','render','merge','interaction','account','Users','fullname','Tags','split','push','TagIds','waiting','talking','unmanaged','abandoned','total','closed','UserId','disposition','map','ChatInteraction','fieldName','type','key','keys','intersection','model','attributes','fields','length','hasOwnProperty','query','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','text','end','Tag','User'];(function(_0x1d1116,_0x498e8b){var _0x1ccae2=function(_0x4e421f){while(--_0x4e421f){_0x1d1116['push'](_0x1d1116['shift']());}};_0x1ccae2(++_0x498e8b);}(_0x99e9,0xb4));var _0x999e=function(_0x11b4fb,_0x10c784){_0x11b4fb=_0x11b4fb-0x0;var _0x56cbb5=_0x99e9[_0x11b4fb];return _0x56cbb5;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x999e('0x0'));var rp=require(_0x999e('0x1'));var moment=require(_0x999e('0x2'));var BPromise=require(_0x999e('0x3'));var Mustache=require('mustache');var util=require(_0x999e('0x4'));var path=require(_0x999e('0x5'));var ejs=require(_0x999e('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x999e('0x7'));var Redis=require('ioredis');var qs=require(_0x999e('0x8'));var as=require(_0x999e('0x9'));var pdf=require(_0x999e('0xa'));var logger=require(_0x999e('0xb'))('api');var config=require(_0x999e('0xc'));var db=require(_0x999e('0xd'))['db'];config[_0x999e('0xe')]=_[_0x999e('0xf')](config[_0x999e('0xe')],{'host':_0x999e('0x10'),'port':0x18eb});var socket=require(_0x999e('0x11'))(new Redis(config[_0x999e('0xe')]));require(_0x999e('0x12'))[_0x999e('0x13')](socket);var jayson=require(_0x999e('0x14'));var client=jayson[_0x999e('0x15')][_0x999e('0x16')]({'port':0x232b});var client9004=jayson[_0x999e('0x15')][_0x999e('0x16')]({'port':0x232c});function respondWithRpcPromise(_0xdb587b,_0x26b55a,_0x47a3c1,_0x15f771){return new BPromise(function(_0x54afad,_0x3e6f5a){var _0x387924=_0x15f771||client;return _0x387924[_0x999e('0x17')](_0xdb587b,_0x47a3c1)['then'](function(_0x28bdd1){logger['info'](_0x999e('0x18'),_0x26b55a,'request\x20sent');logger['debug'](_0x999e('0x19'),_0x26b55a,_0x999e('0x1a'),JSON[_0x999e('0x1b')](_0x28bdd1));if(_0x28bdd1[_0x999e('0x1c')]){if(_0x28bdd1[_0x999e('0x1c')][_0x999e('0x1d')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x26b55a,_0x28bdd1['error'][_0x999e('0x1e')]);return _0x3e6f5a(_0x28bdd1[_0x999e('0x1c')][_0x999e('0x1e')]);}logger[_0x999e('0x1c')](_0x999e('0x18'),_0x26b55a,_0x28bdd1[_0x999e('0x1c')]['message']);return _0x54afad(_0x28bdd1['error'][_0x999e('0x1e')]);}else{logger[_0x999e('0x1f')](_0x999e('0x18'),_0x26b55a,'request\x20sent');_0x54afad(_0x28bdd1[_0x999e('0x20')][_0x999e('0x1e')]);}})[_0x999e('0x21')](function(_0x36fce4){logger[_0x999e('0x1c')](_0x999e('0x18'),_0x26b55a,_0x36fce4);_0x3e6f5a(_0x36fce4);});});}function respondWithStatusCode(_0x427bcf,_0x4d4474){_0x4d4474=_0x4d4474||0xcc;return function(_0x54ad83){if(_0x54ad83){return _0x427bcf[_0x999e('0x22')](_0x4d4474);}return _0x427bcf[_0x999e('0x23')](_0x4d4474)['end']();};}function respondWithResult(_0x452acd,_0xe324d8){_0xe324d8=_0xe324d8||0xc8;return function(_0x3f548e){if(_0x3f548e){return _0x452acd[_0x999e('0x23')](_0xe324d8)[_0x999e('0x24')](_0x3f548e);}};}function respondWithFilteredResult(_0x320634,_0x4f8406){return function(_0x2e1cc5){if(_0x2e1cc5){var _0x4199ff=typeof _0x4f8406[_0x999e('0x25')]===_0x999e('0x26')&&typeof _0x4f8406[_0x999e('0x27')]===_0x999e('0x26');var _0x44b790=_0x2e1cc5['count'];var _0x28f803=_0x4199ff?0x0:_0x4f8406['offset'];var _0x4fed13=_0x4199ff?_0x2e1cc5[_0x999e('0x28')]:_0x4f8406[_0x999e('0x25')]+_0x4f8406[_0x999e('0x27')];var _0x555ca0;if(_0x4fed13>=_0x44b790){_0x4fed13=_0x44b790;_0x555ca0=0xc8;}else{_0x555ca0=0xce;}_0x320634[_0x999e('0x23')](_0x555ca0);return _0x320634[_0x999e('0x29')](_0x999e('0x2a'),_0x28f803+'-'+_0x4fed13+'/'+_0x44b790)[_0x999e('0x24')](_0x2e1cc5);}return null;};}function saveUpdates(_0x15dca1){return function(_0x327079){if(_0x327079){return _0x327079[_0x999e('0x2b')](_0x15dca1)[_0x999e('0x2c')](function(_0x27102b){return _0x27102b;});}return null;};}function removeEntity(_0x3ddacb){return function(_0x53ece1){if(_0x53ece1){return _0x53ece1[_0x999e('0x2d')]()[_0x999e('0x2c')](function(){_0x3ddacb[_0x999e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca5b8){return function(_0x5af72c){if(!_0x5af72c){_0x2ca5b8['sendStatus'](0x194);}return _0x5af72c;};}function handleError(_0x28a228,_0x332195){_0x332195=_0x332195||0x1f4;return function(_0x5aa206){logger['error'](_0x5aa206[_0x999e('0x2e')]);if(_0x5aa206[_0x999e('0x2f')]){delete _0x5aa206[_0x999e('0x2f')];}_0x28a228[_0x999e('0x23')](_0x332195)['send'](_0x5aa206);};}function getMustacheRender(_0x2724be,_0x41d6f1){return Mustache[_0x999e('0x30')](_0x2724be,_[_0x999e('0x31')](_0x41d6f1['body'],{'contact':_0x41d6f1['contact'],'message':_0x41d6f1[_0x999e('0x1e')],'agent':_0x41d6f1['agent'],'interaction':_0x41d6f1[_0x999e('0x32')],'account':_0x41d6f1[_0x999e('0x33')]}))||'';}function getInteractionUsers(_0x69e059,_0x14c9e0){return new BPromise(function(_0x5ad3f1,_0xebda67){try{if(_0x14c9e0[_0x69e059['id']]){_0x69e059[_0x999e('0x34')]=_['map'](_0x14c9e0[_0x69e059['id']],function(_0x4808d1){return{'id':_0x4808d1['id'],'fullname':_0x4808d1[_0x999e('0x35')]};});}}catch(_0x4aa98c){_0xebda67(_0x4aa98c);}_0x5ad3f1(_0x69e059);});}function getInteractionTags(_0xa0c150,_0x5dac45){return new BPromise(function(_0x518083,_0x504ac1){try{if(_0xa0c150['TagIds']){_0xa0c150[_0x999e('0x36')]=[];_0xa0c150['TagIds'][_0x999e('0x37')](',')['forEach'](function(_0x4cfa34){_0xa0c150['Tags'][_0x999e('0x38')](_0x5dac45[_0x4cfa34]);});}delete _0xa0c150[_0x999e('0x39')];}catch(_0xd529df){_0x504ac1(_0xd529df);}_0x518083(_0xa0c150);});}function updateChatInteraction(_0xe3c089,_0x379064,_0x368183){return new BPromise(function(_0x32e494,_0x176a8c){return getInteractionUsers(_0xe3c089,_0x368183)['then'](function(_0x3ff20a){return getInteractionTags(_0x3ff20a,_0x379064);})[_0x999e('0x2c')](function(_0x1e1229){return getStateInteraction(_0x1e1229);})[_0x999e('0x2c')](function(_0x5dd3db){_0x32e494(_0x5dd3db);})[_0x999e('0x21')](function(_0x53730c){_0x176a8c(_0x53730c);});});}function getStateInteraction(_0x36194c){return new BPromise(function(_0x35b318){_0x36194c[_0x999e('0x3a')]=0x0;_0x36194c[_0x999e('0x3b')]=0x0;_0x36194c['answered']=0x0;_0x36194c[_0x999e('0x3c')]=0x0;_0x36194c[_0x999e('0x3d')]=0x0;_0x36194c[_0x999e('0x3e')]=0x0;if(!_0x36194c['closed']&&!_0x36194c['UserId']){_0x36194c[_0x999e('0x3a')]+=0x1;}if(!_0x36194c[_0x999e('0x3f')]&&_0x36194c[_0x999e('0x40')]){_0x36194c[_0x999e('0x3b')]+=0x1;if(_0x36194c[_0x999e('0x3a')]){_0x36194c[_0x999e('0x3a')]-=0x1;}}if(_0x36194c[_0x999e('0x3f')]&&_0x36194c[_0x999e('0x41')]===_0x999e('0x3d')){_0x36194c[_0x999e('0x3d')]+=0x1;if(_0x36194c['waiting']){_0x36194c['waiting']-=0x1;}}else if(_0x36194c[_0x999e('0x3f')]&&!_0x36194c[_0x999e('0x40')]&&_0x36194c[_0x999e('0x41')]){_0x36194c[_0x999e('0x3c')]+=0x1;if(_0x36194c[_0x999e('0x3a')]){_0x36194c[_0x999e('0x3a')]-=0x1;}}else if(_0x36194c['closed']&&_0x36194c[_0x999e('0x40')]){_0x36194c['answered']+=0x1;if(_0x36194c['talking']){_0x36194c[_0x999e('0x3b')]-=0x1;}}_0x36194c['total']+=0x1;_0x35b318(_0x36194c);});}exports['index']=function(_0x5a7366,_0x4f904e){var _0xc89b1={},_0x2841f7={},_0x5e50f5={'count':0x0,'rows':[]};var _0x4542e6=_[_0x999e('0x42')](db[_0x999e('0x43')]['rawAttributes'],function(_0x4b230d){return{'name':_0x4b230d[_0x999e('0x44')],'type':_0x4b230d[_0x999e('0x45')][_0x999e('0x46')]};});_0x2841f7['model']=_['map'](_0x4542e6,'name');_0x2841f7['query']=_[_0x999e('0x47')](_0x5a7366['query']);_0x2841f7['filters']=_[_0x999e('0x48')](_0x2841f7[_0x999e('0x49')],_0x2841f7['query']);_0xc89b1[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x2841f7['model'],qs[_0x999e('0x4b')](_0x5a7366['query'][_0x999e('0x4b')]));_0xc89b1[_0x999e('0x4a')]=_0xc89b1['attributes'][_0x999e('0x4c')]?_0xc89b1[_0x999e('0x4a')]:_0x2841f7['model'];if(!_0x5a7366['query'][_0x999e('0x4d')]('nolimit')){_0xc89b1['limit']=qs['limit'](_0x5a7366[_0x999e('0x4e')][_0x999e('0x27')]);_0xc89b1[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x5a7366[_0x999e('0x4e')][_0x999e('0x25')]);}_0xc89b1['order']=qs[_0x999e('0x4f')](_0x5a7366[_0x999e('0x4e')]['sort']);_0xc89b1[_0x999e('0x50')]=qs[_0x999e('0x51')](_[_0x999e('0x52')](_0x5a7366[_0x999e('0x4e')],_0x2841f7[_0x999e('0x51')]),_0x4542e6);var _0x334d19=[];var _0x428842=squel[_0x999e('0x53')]()[_0x999e('0x54')]('id')['field'](_0x999e('0x2f'))[_0x999e('0x54')](_0x999e('0x55'))[_0x999e('0x56')]('tools_tags');var _0x392324=squel[_0x999e('0x53')]()[_0x999e('0x54')](_0x999e('0x57'))[_0x999e('0x54')](_0x999e('0x58'))[_0x999e('0x54')](_0x999e('0x59'))['from']('user_has_chat_interactions','ui')[_0x999e('0x5a')](_0x999e('0x5b'),'u',_0x999e('0x5c'));var _0xefd231=squel[_0x999e('0x53')]()[_0x999e('0x56')](_0x999e('0x5d'),'i')['left_join']('cm_contacts','c',_0x999e('0x5e'))[_0x999e('0x5a')](_0x999e('0x5b'),'o',_0x999e('0x5f'))[_0x999e('0x5a')]('chat_websites','a',_0x999e('0x60'))[_0x999e('0x5a')](_0x999e('0x61'),'me',_0x999e('0x62'))[_0x999e('0x5a')](_0x999e('0x63'),'it',_0x999e('0x64'))['left_join'](_0x999e('0x65'),'t','t.id\x20=\x20it.TagId');var _0xe35369=squel[_0x999e('0x66')]();var _0x2ce0b3=[];var _0x25f6a6=squel[_0x999e('0x66')]();var _0x53cfbc;if(_0x5a7366['query'][_0x999e('0x67')]){_0x53cfbc=as[_0x999e('0x68')](_0x5a7366[_0x999e('0x4e')][_0x999e('0x67')]);var _0x470e51=_0x53cfbc[_0x999e('0x69')];for(var _0x23fd58=0x0;_0x23fd58<_0x53cfbc[_0x999e('0x6a')][_0x999e('0x4c')];_0x23fd58++){var _0x7f9dfe=_0x53cfbc[_0x999e('0x6a')][_0x23fd58];var _0xcc200b='i';var _0x77a387=_[_0x999e('0x6b')](_0x4542e6,[_0x999e('0x2f'),_0x7f9dfe['field']]);if(!_0x77a387){switch(_0x7f9dfe[_0x999e('0x54')]){case _0x999e('0x6c'):if(_0x7f9dfe[_0x999e('0x6d')]==0x1){_0xefd231[_0x999e('0x6e')]('`'+_0x7f9dfe['field']+'`\x20=\x200');}else{_0xefd231[_0x999e('0x6e')]('`'+_0x7f9dfe[_0x999e('0x54')]+_0x999e('0x6f'));}break;case _0x999e('0x70'):if(_0x7f9dfe[_0x999e('0x71')]===_0x999e('0x72')){if(_0x7f9dfe[_0x999e('0x6d')][_0x999e('0x37')]('\x20')[_0x999e('0x4c')]>0x1){_0xe35369[_0x470e51]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x999e('0x73')](_0x7f9dfe['value']),null);}else{var _0x184b3e='%'+_0x7f9dfe[_0x999e('0x6d')]+'%';_0xe35369[_0x470e51]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x184b3e,_0x184b3e,_0x184b3e);}}else{_0x77a387=_[_0x999e('0x6b')](_0x4542e6,[_0x999e('0x2f'),_0x999e('0x74')]);_0x7f9dfe[_0x999e('0x54')]=_0x999e('0x74');_0x1f0dc3=as['buildExpression'](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value']['start'],_0x1f0dc3['value'][_0x999e('0x76')]);}break;case _0x999e('0x77'):var _0x3432fd=_0x7f9dfe[_0x999e('0x6d')][_0x999e('0x37')](',')['map'](function(_0x492a5a){return Number(_0x492a5a);});_0x3432fd['forEach'](function(_0x49293d){_0x25f6a6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x49293d+',%');});_0x2ce0b3=_['union'](_0x2ce0b3,_0x3432fd);break;case _0x999e('0x78'):if(_0x7f9dfe['operator']===_0x999e('0x72')){_0xe35369[_0x470e51](_0x999e('0x79'),'%'+_0x7f9dfe[_0x999e('0x6d')]+'%',null);}else{_0x77a387=_['find'](_0x4542e6,[_0x999e('0x2f'),_0x999e('0x40')]);_0x7f9dfe[_0x999e('0x54')]=_0x999e('0x40');_0x1f0dc3=as[_0x999e('0x7a')](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value'][_0x999e('0x7b')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x76')]);}break;case'body':_0x1f0dc3=as[_0x999e('0x7a')]('me',null,_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value'][_0x999e('0x7b')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x76')]);break;}}else{var _0x1f0dc3=as[_0x999e('0x7a')](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x7b')],_0x1f0dc3['value'][_0x999e('0x76')]);}}}else{var _0x21a712=_(_0x5a7366[_0x999e('0x4e')])['keys']()[_0x999e('0x42')](function(_0x48e0ca){return _[_0x999e('0x7c')](_0x4542e6,[_0x999e('0x2f'),_0x48e0ca])?_0x48e0ca:undefined;})[_0x999e('0x7d')]()['value']();if(!_[_0x999e('0x7e')](_0x21a712)){_0x21a712[_0x999e('0x7f')](function(_0x1d6b40){if(_0x1d6b40===_0x999e('0x80')){_0xefd231[_0x999e('0x50')](_0x999e('0x81'),[]['concat'](_0x5a7366[_0x999e('0x4e')][_0x1d6b40]));}else if(_0x1d6b40==='createdAt'){var _0x34f25c=JSON['parse'](_0x5a7366['query'][_0x1d6b40])[_0x999e('0x82')];var _0x5d136c=JSON[_0x999e('0x83')](_0x5a7366[_0x999e('0x4e')][_0x1d6b40])['$lte'];_0xefd231[_0x999e('0x50')](_0x999e('0x84'),_0x34f25c,_0x5d136c);}else{if(_0x5a7366['query'][_0x1d6b40]===_0x999e('0x85')){_0xefd231[_0x999e('0x50')]('i.'+_0x1d6b40+_0x999e('0x86'));}else{_0xefd231[_0x999e('0x50')]('i.'+_0x1d6b40+_0x999e('0x87'),_0x5a7366[_0x999e('0x4e')][_0x1d6b40]);}}});}if(_0x5a7366[_0x999e('0x4e')][_0x999e('0x88')]){if(_0x5a7366['query']['read']==0x1){_0xefd231[_0x999e('0x6e')](_0x999e('0x89'));}else{_0xefd231[_0x999e('0x6e')](_0x999e('0x8a'));}}if(_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')]){_0x2ce0b3=_['isArray'](_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')])?_0x5a7366['query'][_0x999e('0x8b')]:new Array(_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')]);_0x2ce0b3['forEach'](function(_0x389520){_0x25f6a6['or'](_0x999e('0x8c'),'%,'+_0x389520+',%');});}if(_0x5a7366[_0x999e('0x4e')]['filter']){var _0x216040=_0x5a7366[_0x999e('0x4e')][_0x999e('0x8d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x999e('0x8e')](_0x216040)){_0xe35369['or']('i.id\x20LIKE\x20?',_0x216040+'%');}else{_0xe35369['or'](_0x999e('0x8f'),qs[_0x999e('0x73')](_0x216040))['or'](_0x999e('0x90'),_0x216040+'%');}}}_0xefd231[_0x999e('0x50')](_0xe35369);_0xefd231[_0x999e('0x91')](_0x999e('0x92'));var _0x43043a={'type':db['Sequelize'][_0x999e('0x93')]['SELECT'],'raw':!![]};var _0x5a65c8=_0xefd231[_0x999e('0x94')]();_0x5a65c8[_0x999e('0x54')](_0x999e('0x92'));_0x5a65c8[_0x999e('0x54')](_0x999e('0x95'),_0x999e('0x6c'));if(_0xc89b1['order']){_0xc89b1[_0x999e('0x96')]['forEach'](function(_0x302161){var _0x1f39c0=_0x302161[0x0]===_0x999e('0x97')?_0x302161[0x0]:'i.'+_0x302161[0x0];_0xefd231['order'](_0x1f39c0,_0x302161[0x1]===_0x999e('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x2ce0b3)){_0xefd231[_0x999e('0x6e')](_0x25f6a6);_0x5a65c8[_0x999e('0x50')](_0x999e('0x99'),_0x2ce0b3);}BPromise[_0x999e('0x9a')]()[_0x999e('0x2c')](function(){if(!_0x53cfbc){if(_0x5a7366['query']['ChatWebsiteId'])return;_0x5a65c8[_0x999e('0x50')](_0x999e('0x9b'));_0xefd231[_0x999e('0x50')](_0x999e('0x9b'));return;}if(_0x5a7366[_0x999e('0x9c')][_0x999e('0x9d')]!==_0x999e('0x9e'))return;return _0x5a7366[_0x999e('0x9c')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x999e('0x2c')](function(_0xaed39c){if(_[_0x999e('0x7e')](_0xaed39c)){_0x5a65c8[_0x999e('0x50')](_0x999e('0x9f'));_0xefd231[_0x999e('0x50')](_0x999e('0x9f'));}else{_0x5a65c8[_0x999e('0x50')]('i.ChatWebsiteId\x20IN\x20?',_[_0x999e('0x42')](_0xaed39c,'id'));_0xefd231[_0x999e('0x50')](_0x999e('0x81'),_[_0x999e('0x42')](_0xaed39c,'id'));}});})[_0x999e('0x2c')](function(){if(_0x5a7366[_0x999e('0x9c')][_0x999e('0x9d')]===_0x999e('0x9e')&&!_0x53cfbc&&!_0x5a7366['query'][_0x999e('0x80')])return[];return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x5a65c8['toString'](),_0x43043a);})[_0x999e('0x2c')](function(_0x3edea2){_0x5e50f5[_0x999e('0x28')]=_0x3edea2[_0x999e('0x4c')];if(_0x5e50f5[_0x999e('0x28')]===0x0)return[];return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x428842[_0x999e('0xa1')](),_0x43043a)[_0x999e('0x2c')](function(_0x4ee1d4){_0x334d19=_[_0x999e('0xa2')](_0x4ee1d4,'id');_0x43043a=_[_0x999e('0x31')](_0x43043a,{'model':db[_0x999e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a7366['query']['fields']){_0xc89b1[_0x999e('0x4a')][_0x999e('0x7f')](function(_0x421f60){_0xefd231['field']('i.'+_0x421f60);});}else{_0xefd231[_0x999e('0x54')](_0x999e('0x95'),_0x999e('0x6c'));_0xefd231['field'](_0x999e('0xa3'),_0x999e('0xa4'));_0xefd231['field'](_0x999e('0xa5'),'Account.mandatoryDisposition');_0xefd231['field'](_0x999e('0xa6'),_0x999e('0x97'));_0xefd231[_0x999e('0x54')](_0x999e('0xa7'));_0xefd231['field'](_0x999e('0xa8'),_0x999e('0xa9'));_0xefd231[_0x999e('0x54')](_0x999e('0xaa'),_0x999e('0xab'));_0xefd231['field'](_0x999e('0xac'),_0x999e('0xad'));_0xefd231[_0x999e('0x54')]('c.phone',_0x999e('0xae'));_0xefd231[_0x999e('0x54')](_0x999e('0xaf'),_0x999e('0xb0'));_0xefd231[_0x999e('0x54')](_0x999e('0xb1'),_0x999e('0xb2'));_0xefd231[_0x999e('0x54')]('o.fullname',_0x999e('0xb3'));_0xefd231[_0x999e('0x54')](_0x999e('0xb4'),_0x999e('0xb5'));_0xefd231['field'](_0x999e('0xb6'),_0x999e('0x39'));}if(_0xc89b1[_0x999e('0x27')])_0xefd231[_0x999e('0x27')](_0xc89b1[_0x999e('0x27')]);if(_0xc89b1['offset'])_0xefd231[_0x999e('0x25')](_0xc89b1[_0x999e('0x25')]);return db[_0x999e('0xa0')][_0x999e('0x4e')](_0xefd231[_0x999e('0xa1')](),_0x43043a);})[_0x999e('0x2c')](function(_0x5ca126){if(_0x5ca126['length']>0x0)_0x392324[_0x999e('0x50')](_0x999e('0xb7'),_['map'](_0x5ca126,'id'));return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x392324['toString'](),_0x43043a)[_0x999e('0x2c')](function(_0x230dd6){var _0x131123=_[_0x999e('0xb8')](_0x230dd6,_0x999e('0xb9'));var _0x5e2f44=[];_0x5ca126[_0x999e('0x7f')](function(_0x33edad){_0x5e2f44[_0x999e('0x38')](updateChatInteraction(_0x33edad,_0x334d19,_0x131123));});return BPromise[_0x999e('0xba')](_0x5e2f44);});});})[_0x999e('0x2c')](function(_0x9361d5){_0x5e50f5[_0x999e('0xbb')]=_0x9361d5;return _0x5e50f5;})['then'](respondWithFilteredResult(_0x4f904e,_0xc89b1))[_0x999e('0x21')](handleError(_0x4f904e,null));};exports['show']=function(_0x2dfa8d,_0xd93cfb){var _0x2c9520={'raw':![],'where':{'id':_0x2dfa8d[_0x999e('0xbc')]['id']}},_0x2bcab1={};_0x2bcab1[_0x999e('0x49')]=_[_0x999e('0x47')](db[_0x999e('0x43')][_0x999e('0xbd')]);_0x2bcab1['query']=_[_0x999e('0x47')](_0x2dfa8d['query']);_0x2bcab1[_0x999e('0x51')]=_['intersection'](_0x2bcab1[_0x999e('0x49')],_0x2bcab1['query']);_0x2c9520['attributes']=_[_0x999e('0x48')](_0x2bcab1[_0x999e('0x49')],qs['fields'](_0x2dfa8d['query'][_0x999e('0x4b')]));_0x2c9520[_0x999e('0x4a')]=_0x2c9520[_0x999e('0x4a')][_0x999e('0x4c')]?_0x2c9520[_0x999e('0x4a')]:_0x2bcab1['model'];if(_0x2dfa8d[_0x999e('0x4e')]['includeAll']){_0x2c9520[_0x999e('0xbe')]=[{'all':!![]}];}_0x2c9520=_[_0x999e('0x31')]({},_0x2c9520,_0x2dfa8d[_0x999e('0xbf')]);return db[_0x999e('0x43')]['find'](_0x2c9520)[_0x999e('0x2c')](handleEntityNotFound(_0xd93cfb,null))[_0x999e('0x2c')](respondWithResult(_0xd93cfb,null))[_0x999e('0x21')](handleError(_0xd93cfb,null));};exports[_0x999e('0xc0')]=function(_0xf51d13,_0x1304f2){return db[_0x999e('0x43')][_0x999e('0xc0')](_0xf51d13[_0x999e('0xc1')],{})['then'](respondWithResult(_0x1304f2,0xc9))[_0x999e('0x21')](handleError(_0x1304f2,null));};exports[_0x999e('0x2b')]=function(_0x2fd5cd,_0x39dfbc){if(_0x2fd5cd[_0x999e('0xc1')]['id']){delete _0x2fd5cd[_0x999e('0xc1')]['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x2fd5cd['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x39dfbc,null))['then'](saveUpdates(_0x2fd5cd[_0x999e('0xc1')],null))[_0x999e('0x2c')](respondWithResult(_0x39dfbc,null))['catch'](handleError(_0x39dfbc,null));};exports[_0x999e('0x2d')]=function(_0x1daa73,_0x27c5d9){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x1daa73['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x27c5d9,null))['then'](removeEntity(_0x27c5d9,null))['catch'](handleError(_0x27c5d9,null));};exports[_0x999e('0xc2')]=function(_0x16b8f4,_0x1a8269){return db['ChatInteraction'][_0x999e('0xc2')]()[_0x999e('0x2c')](respondWithResult(_0x1a8269,null))[_0x999e('0x21')](handleError(_0x1a8269,null));};exports[_0x999e('0xc3')]=function(_0x28a9fe,_0x191506){var _0x392488=_0x28a9fe['params']['id'];var _0xe325ef;var _0x3bacb4;var _0x5e0400;return db[_0x999e('0x43')]['findOne']({'where':{'id':_0x392488}})[_0x999e('0x2c')](function(_0xc1a8ce){_0xe325ef=_0xc1a8ce;return db['ChatWebsite']['findOne']({'where':{'id':_0xc1a8ce['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0x999e('0xc4'),_0x999e('0xc5')],'raw':!![]});})[_0x999e('0x2c')](function(_0x1b1716){if(_0x1b1716&&_0x1b1716[_0x999e('0xc6')]&&_0x1b1716[_0x999e('0xc7')]){_0x3bacb4=_0x1b1716;var _0xf8fb4={'interaction':{'id':_0x392488},'agent':{'id':_0x28a9fe[_0x999e('0x9c')]['id'],'name':_0x28a9fe[_0x999e('0x9c')][_0x999e('0x2f')],'fullname':_0x28a9fe['user'][_0x999e('0x35')],'email':_0x28a9fe[_0x999e('0x9c')][_0x999e('0xc8')]},'contact':_0x28a9fe[_0x999e('0xc1')][_0x999e('0xc9')],'account':_0x28a9fe[_0x999e('0xc1')][_0x999e('0x33')]};var _0x2b9b50={'rejectUnauthorized':![],'method':_0x999e('0xca'),'url':_0x999e('0xcb'),'headers':{'X-APIKEY':_0x1b1716[_0x999e('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x28a9fe[_0x999e('0x9c')][_0x999e('0xc8')]],'buttons':null,'topic':_0x3bacb4[_0x999e('0xcc')],'note':_[_0x999e('0xcd')](_0x3bacb4[_0x999e('0xc4')])?null:getMustacheRender(_0x3bacb4['vidaooNote'],_0xf8fb4),'metadata':null},'redirect':_0x999e('0xce'),'json':!![]};try{if(!_['isNull'](_0x3bacb4['vidaooMetadata'])){var _0x20812f=getMustacheRender(_0x3bacb4['vidaooMetadata'],_0xf8fb4);var _0x459142=JSON['parse'](_0x20812f);_0x2b9b50[_0x999e('0xc1')]['metadata']=_0x459142;}}catch(_0x13caa5){throw new db['Sequelize'][(_0x999e('0xcf'))](_0x999e('0xd0'));}return rp(_0x2b9b50);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x999e('0x2c')](function(_0x2b8609){_0x5e0400=_0x2b8609;if(_0x5e0400['id']){var _0x1c324d={'body':_0x5e0400['join_url'],'ChatWebsiteId':_0x3bacb4['id'],'ChatInteractionId':_0xe325ef['id'],'direction':'out','UserId':_0x28a9fe[_0x999e('0x9c')]['id']};return db['ChatMessage'][_0x999e('0xc0')](_0x1c324d,{});}else{throw new db[(_0x999e('0xd1'))][(_0x999e('0xcf'))](_0x999e('0xd2'));}})[_0x999e('0x2c')](function(){return _0xe325ef[_0x999e('0xd3')]({'vidaooSessionId':_0x5e0400['id']});})[_0x999e('0x2c')](respondWithResult(_0x191506,null))[_0x999e('0x21')](handleError(_0x191506,null));};exports[_0x999e('0xd4')]=function(_0x2034f3,_0x4b9ec3){if(_0x2034f3[_0x999e('0xc1')]['id']){delete _0x2034f3['body']['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x2034f3['params']['id']},'include':[{'model':db[_0x999e('0xd5')],'as':_0x999e('0x70')}]})[_0x999e('0x2c')](handleEntityNotFound(_0x4b9ec3,null))[_0x999e('0x2c')](saveUpdates(_0x2034f3['body'],null))[_0x999e('0x2c')](respondWithResult(_0x4b9ec3,null))[_0x999e('0x21')](handleError(_0x4b9ec3,null));};exports[_0x999e('0xd6')]=function(_0x457f07,_0x4da13d){if(_0x457f07['body']['id']){delete _0x457f07[_0x999e('0xc1')]['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x457f07[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](function(_0x2e9dd0){if(!_0x2e9dd0){logger['error'](_0x999e('0xd7'),_0x999e('0xd6'),0x194,'entity\x20not\x20found');_0x4da13d['sendStatus'](0x194);}else{if(_0x2e9dd0[_0x999e('0x40')]){throw new db[(_0x999e('0xd1'))][(_0x999e('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x2e9dd0;})[_0x999e('0x2c')](function(_0x1c1a62){if(_0x1c1a62){return _0x1c1a62[_0x999e('0x2b')]({'closed':_0x457f07[_0x999e('0xc1')]['closed'],'disposition':_0x457f07[_0x999e('0xc1')][_0x999e('0x41')]})[_0x999e('0x2c')](function(_0x5a04d3){return _0x5a04d3;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x999e('0xd6'),_0x457f07['body'],client9004);})[_0x999e('0x2c')](respondWithResult(_0x4da13d,null))[_0x999e('0x21')](handleError(_0x4da13d,null));};exports[_0x999e('0xd8')]=function(_0x27978d,_0x31c0c3){_0x27978d[_0x999e('0xc1')][_0x999e('0x2f')]=_0x27978d[_0x999e('0xd9')]['originalname'];_0x27978d['body'][_0x999e('0xda')]=_0x27978d[_0x999e('0xd9')]['filename'];_0x27978d[_0x999e('0xc1')]['type']=_0x27978d['file'][_0x999e('0xdb')];return db[_0x999e('0xdc')][_0x999e('0xc0')](_0x27978d[_0x999e('0xc1')])[_0x999e('0x2c')](respondWithResult(_0x31c0c3,0xc9))[_0x999e('0x21')](handleError(_0x31c0c3,null));};exports[_0x999e('0xdd')]=function(_0x3131a2,_0x31fa6c){return db[_0x999e('0x43')][_0x999e('0xde')]({'where':{'id':_0x3131a2['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x31fa6c,null))[_0x999e('0x2c')](function(_0x41b122){if(_0x41b122){if(_0x41b122['closed']){return _0x31fa6c[_0x999e('0x23')](0x193)['json']({'status':0x193,'message':_0x999e('0xdf')});}return db[_0x999e('0xdc')][_0x999e('0xde')]({'where':{'id':_0x3131a2['query'][_0x999e('0xe0')]},'raw':!![]})[_0x999e('0x2c')](handleEntityNotFound(_0x31fa6c,null));}})[_0x999e('0x2c')](function(_0x1b0128){if(_0x1b0128){var _0x10ea96=_0x1b0128['ChatOfflineMessageId']!==null;var _0x5d0f54=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0xe3'));if(_0x10ea96){_0x5d0f54=path[_0x999e('0xe1')](_0x5d0f54,_0x999e('0xe4'));}var _0xc91cf5=path[_0x999e('0xe1')](_0x5d0f54,_0x1b0128[_0x999e('0xda')]);return _0x31fa6c['download'](_0xc91cf5);}})[_0x999e('0x21')](handleError(_0x31fa6c,null));};exports[_0x999e('0xe5')]=function(_0x3cf88d,_0x31ff46){var _0x24bfd1=null;var _0x1a2a5e=null;var _0x57529d=null;if(_0x3cf88d['body']['id']){delete _0x3cf88d[_0x999e('0xc1')]['id'];}if(_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')]){_0x57529d=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0xe7'),util[_0x999e('0xe8')](_0x999e('0xe9'),Date[_0x999e('0xea')]()));_0x3cf88d[_0x999e('0xc1')][_0x999e('0xeb')]=_0x57529d;}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x3cf88d['params']['id']},'include':[{'model':db[_0x999e('0xec')],'as':_0x999e('0xed'),'include':[{'model':db['User'],'as':_0x999e('0x78')}]}]})[_0x999e('0x2c')](handleEntityNotFound(_0x31ff46,null))[_0x999e('0x2c')](saveUpdates(_0x3cf88d[_0x999e('0xc1')],null))[_0x999e('0x2c')](function(_0x2f793c){if(_0x2f793c){_0x24bfd1=_0x2f793c;return db[_0x999e('0xee')][_0x999e('0x6b')]({'where':{'id':_0x24bfd1['ChatWebsiteId']}});}})[_0x999e('0x2c')](function(_0x459bbe){if(_0x459bbe){_0x1a2a5e=_0x459bbe;return db['CmContact'][_0x999e('0x6b')]({'where':{'id':_0x24bfd1[_0x999e('0x74')]}});}})[_0x999e('0x2c')](function(_0x2091a3){if(_0x2091a3){if(_0x57529d){var _0x5c51f9=null;for(var _0x572d81=0x1;_0x572d81<_0x24bfd1[_0x999e('0xed')][_0x999e('0x4c')];++_0x572d81){_0x5c51f9=_0x24bfd1[_0x999e('0xed')][_0x572d81];var _0x298c2c=_0x5c51f9['UserId']?util['format'](_0x999e('0xef'),_0x1a2a5e['agentAlias'],_0x5c51f9['UserId']):_0x999e('0xf0');var _0x53d3f1=_0x3cf88d['body'][_0x999e('0xf1')]||util['format'](_0x999e('0xef'),_0x999e('0xf2'),_0x5c51f9[_0x999e('0x74')]);switch(_0x1a2a5e[_0x999e('0xf3')]){case _0x999e('0xf4'):_0x298c2c=_0x5c51f9['UserId']?util[_0x999e('0xe8')]('%s%d',_0x1a2a5e[_0x999e('0xf5')],_0x5c51f9[_0x999e('0x40')]):_0x999e('0xf0');break;case _0x999e('0xf6'):_0x298c2c=_0x5c51f9[_0x999e('0x40')]?_0x5c51f9[_0x999e('0x78')]['alias']||_0x5c51f9[_0x999e('0x78')][_0x999e('0x35')]:_0x999e('0xf0');break;case _0x999e('0xf7'):_0x298c2c=_0x5c51f9[_0x999e('0x40')]?_0x5c51f9[_0x999e('0x78')]['fullname']:_0x999e('0xf0');break;default:_0x298c2c=_0x5c51f9[_0x999e('0x40')]?util['format'](_0x999e('0xef'),_0x1a2a5e[_0x999e('0xf5')],_0x5c51f9[_0x999e('0x40')]):'System';}var _0x18b2aa=util[_0x999e('0xe8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x5c51f9['createdAt'])[_0x999e('0xe8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x5c51f9[_0x999e('0xf8')]==='in'?_0x53d3f1:_0x298c2c,_0x5c51f9[_0x999e('0xc1')]);if(!_0x5c51f9[_0x999e('0xf9')]){fs[_0x999e('0xfa')](_0x57529d,_0x18b2aa);}}return db[_0x999e('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x999e('0xfc'),'raw':!![],'include':[{'model':db[_0x999e('0xfd')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x999e('0x2c')](function(_0x2e9c95){if(!_0x2e9c95||!_0x2e9c95['Smtp']||!_0x3cf88d[_0x999e('0xc1')])return _0x24bfd1;var _0x4cf199=_0x2e9c95['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x999e('0xfe'),{'account':_0x4cf199,'message':{'from':util[_0x999e('0xe8')]('\x22%s\x22\x20<%s>',_0x2e9c95['name'],_0x2e9c95['email']||_0x2e9c95[_0x999e('0xfc')]['user']),'to':_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')],'subject':_0x999e('0xff'),'text':util[_0x999e('0xe8')](_0x999e('0x100'),_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')]),'attachments':[{'path':_0x57529d}]}})[_0x999e('0x2c')](function(){return _0x24bfd1;})['catch'](function(_0x4a32f7){logger[_0x999e('0x1c')](_0x4a32f7);});})[_0x999e('0x2c')](respondWithStatusCode(_0x31ff46,0xc8))[_0x999e('0x21')](handleError(_0x31ff46,null));};exports[_0x999e('0x101')]=function(_0x55b0e5,_0x516a01){return db[_0x999e('0xec')][_0x999e('0x6b')]({'where':{'id':_0x55b0e5[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x516a01,null))[_0x999e('0x2c')](function(_0x51966e){if(_0x51966e){return _0x51966e[_0x999e('0x101')](_0x55b0e5[_0x999e('0xc1')][_0x999e('0x102')],_['omit'](_0x55b0e5[_0x999e('0xc1')],[_0x999e('0x102'),'id'])||{});}})['then'](respondWithResult(_0x516a01,null))['catch'](handleError(_0x516a01,null));};exports[_0x999e('0x103')]=function(_0x51bffa,_0x542b39){var _0x237a69={'raw':![],'where':{}};var _0x3729e1={};var _0x4f1e06={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x51bffa['params']['id']}})['then'](handleEntityNotFound(_0x542b39,null))['then'](function(_0xd62f58){if(_0xd62f58){_0x3729e1[_0x999e('0x49')]=_[_0x999e('0x47')](db['ChatMessage'][_0x999e('0xbd')]);_0x3729e1[_0x999e('0x4e')]=_[_0x999e('0x47')](_0x51bffa['query']);_0x3729e1[_0x999e('0x51')]=_[_0x999e('0x48')](_0x3729e1[_0x999e('0x49')],_0x3729e1[_0x999e('0x4e')]);_0x237a69[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x3729e1['model'],qs[_0x999e('0x4b')](_0x51bffa['query'][_0x999e('0x4b')]));_0x237a69[_0x999e('0x4a')]=_0x237a69[_0x999e('0x4a')][_0x999e('0x4c')]?_0x237a69[_0x999e('0x4a')]:_0x3729e1[_0x999e('0x49')];if(!_0x51bffa['query'][_0x999e('0x4d')](_0x999e('0x104'))){_0x237a69['limit']=qs[_0x999e('0x27')](_0x51bffa['query']['limit']);_0x237a69[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x51bffa[_0x999e('0x4e')]['offset']);}_0x237a69['order']=qs[_0x999e('0x4f')](_0x51bffa[_0x999e('0x4e')][_0x999e('0x4f')]);_0x237a69[_0x999e('0x50')]=qs[_0x999e('0x51')](_['pick'](_0x51bffa[_0x999e('0x4e')],_0x3729e1[_0x999e('0x51')]));_0x237a69[_0x999e('0x50')][_0x999e('0xb9')]=_0xd62f58['id'];if(_0x51bffa[_0x999e('0x4e')]['filter']){_0x237a69[_0x999e('0x50')]=_[_0x999e('0x31')](_0x237a69[_0x999e('0x50')],{'$or':_[_0x999e('0x42')](_0x237a69['attributes'],function(_0x1dcd99){var _0x4a4cae={};_0x4a4cae[_0x1dcd99]={'$like':'%'+_0x51bffa[_0x999e('0x4e')][_0x999e('0x8d')]+'%'};return _0x4a4cae;})});}if(_0x51bffa['query']['$gte']){var _0x2c7f82=_0x51bffa[_0x999e('0x4e')][_0x999e('0x82')][_0x999e('0x37')](',');var _0x118c1e={};_0x118c1e[_0x2c7f82[0x0]]={'$gte':moment(_0x2c7f82[0x1])['format'](_0x999e('0x105'))};_0x237a69[_0x999e('0x50')]=_[_0x999e('0x31')](_0x237a69['where'],_0x118c1e);}_0x237a69=_[_0x999e('0x31')]({},_0x237a69,_0x51bffa['options']);return db[_0x999e('0xec')][_0x999e('0x28')]({'where':_0x237a69[_0x999e('0x50')]})[_0x999e('0x2c')](function(_0x597a35){_0x4f1e06['count']=_0x597a35;if(_0x51bffa[_0x999e('0x4e')][_0x999e('0x106')]){_0x237a69[_0x999e('0xbe')]=[{'all':!![]}];}return db[_0x999e('0xec')][_0x999e('0x107')](_0x237a69);})[_0x999e('0x2c')](function(_0x139487){_0x4f1e06['rows']=_0x139487;return _0x4f1e06;});}})[_0x999e('0x2c')](respondWithFilteredResult(_0x542b39,_0x237a69))['catch'](handleError(_0x542b39,null));};exports['getMyMessages']=function(_0x10d312,_0x1f19d0){var _0xf9a5ff={'where':{}},_0x3163f1={},_0x377931={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x999e('0xde')]({'where':{'id':_0x10d312[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x1f19d0,null))[_0x999e('0x2c')](function(_0x4f8e5c){if(_0x4f8e5c){_0x3163f1[_0x999e('0x49')]=_[_0x999e('0x47')](db[_0x999e('0xec')]['rawAttributes']);_0x3163f1[_0x999e('0x4e')]=_[_0x999e('0x47')](_0x10d312[_0x999e('0x4e')]);_0x3163f1[_0x999e('0x51')]=_['intersection'](_0x3163f1[_0x999e('0x49')],_0x3163f1[_0x999e('0x4e')]);_0xf9a5ff[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x3163f1[_0x999e('0x49')],qs[_0x999e('0x4b')](_0x10d312[_0x999e('0x4e')][_0x999e('0x4b')]));_0xf9a5ff['attributes']=_0xf9a5ff[_0x999e('0x4a')]['length']?_0xf9a5ff['attributes']:_0x3163f1[_0x999e('0x49')];if(!_0x10d312[_0x999e('0x4e')][_0x999e('0x4d')](_0x999e('0x104'))){_0xf9a5ff['limit']=qs[_0x999e('0x27')](_0x10d312[_0x999e('0x4e')]['limit']);_0xf9a5ff[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x10d312[_0x999e('0x4e')][_0x999e('0x25')]);}_0xf9a5ff[_0x999e('0x96')]=qs['sort'](_0x10d312[_0x999e('0x4e')]['sort']);_0xf9a5ff[_0x999e('0x50')]=qs[_0x999e('0x51')](_[_0x999e('0x52')](_0x10d312[_0x999e('0x4e')],_0x3163f1[_0x999e('0x51')]));_0xf9a5ff[_0x999e('0x50')][_0x999e('0xb9')]=_0x4f8e5c['id'];if(_0x10d312[_0x999e('0x4e')]['filter']){_0xf9a5ff[_0x999e('0x50')]=_[_0x999e('0x31')](_0xf9a5ff['where'],{'$or':_[_0x999e('0x42')](_0xf9a5ff['attributes'],function(_0x1db16c){var _0x4c6fad={};_0x4c6fad[_0x1db16c]={'$like':'%'+_0x10d312['query'][_0x999e('0x8d')]+'%'};return _0x4c6fad;})});}_0xf9a5ff[_0x999e('0x50')]['secret']=![];if(_0x10d312[_0x999e('0x4e')]['id']){_0xf9a5ff[_0x999e('0x50')]['id']={'$gt':_0x10d312[_0x999e('0x4e')]['id']};}_0xf9a5ff=_[_0x999e('0x31')]({},_0xf9a5ff,_0x10d312[_0x999e('0xbf')]);return db[_0x999e('0xec')][_0x999e('0x28')]({'where':_0xf9a5ff[_0x999e('0x50')]})['then'](function(_0x1a5fc2){_0x377931[_0x999e('0x28')]=_0x1a5fc2;_0xf9a5ff['include']=[];if(_0x10d312['query'][_0x999e('0x108')]){_0xf9a5ff['include'][_0x999e('0x38')]({'model':db[_0x999e('0x78')],'as':_0x999e('0x78'),'attributes':['id',_0x999e('0x35'),'alias']});}if(_0x10d312['query'][_0x999e('0x106')]){_0xf9a5ff[_0x999e('0xbe')]=[{'all':!![]}];}return db[_0x999e('0xec')][_0x999e('0x107')](_0xf9a5ff);})[_0x999e('0x2c')](function(_0x359277){_0x377931[_0x999e('0xbb')]=_0x359277;return _0x377931;});}})[_0x999e('0x2c')](respondWithFilteredResult(_0x1f19d0,_0xf9a5ff))['catch'](handleError(_0x1f19d0,null));};exports[_0x999e('0x109')]=function(_0x16323c,_0x4da0bc){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x16323c['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x4da0bc,null))[_0x999e('0x2c')](function(_0x2707dc){if(_0x2707dc){return _0x2707dc[_0x999e('0x10a')](_0x16323c['body'][_0x999e('0x102')],_['omit'](_0x16323c[_0x999e('0xc1')],[_0x999e('0x102'),'id'])||{})[_0x999e('0x10b')](function(){return db['Tag']['findAll']({'attributes':['id',_0x999e('0x2f'),_0x999e('0x55')],'where':{'id':_0x16323c['body'][_0x999e('0x102')]}});})[_0x999e('0x2c')](function(_0x392d35){socket[_0x999e('0x10c')]('chatInteractionTags:save',{'id':Number(_0x16323c[_0x999e('0xbc')]['id']),'tags':_0x392d35||[]});return{'id':Number(_0x16323c['params']['id']),'tags':_0x392d35||[]};});}})[_0x999e('0x2c')](respondWithResult(_0x4da0bc,null))[_0x999e('0x21')](handleError(_0x4da0bc,null));};exports[_0x999e('0x10d')]=function(_0x3a63f5,_0x201add){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x3a63f5[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x201add,null))['then'](function(_0x563457){if(_0x563457){return _0x563457['removeTags'](_0x3a63f5['query']['ids']);}})[_0x999e('0x2c')](respondWithStatusCode(_0x201add,null))[_0x999e('0x21')](handleError(_0x201add,null));};exports[_0x999e('0x10e')]=function(_0x35c0e4,_0x49af7d){var _0x49ce92=moment()[_0x999e('0x10f')]()[_0x999e('0xa1')]();var _0x21ecc2=path['join'](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x111'),_0x999e('0x112'));var _0x3c0a39=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x111'),_0x999e('0x113'));var _0x375777=path[_0x999e('0xe1')](_0x21ecc2,_0x49ce92);var _0x34323f=util[_0x999e('0xe8')]('transcript-%d-%s.zip',_0x35c0e4[_0x999e('0xbc')]['id'],_0x49ce92);var _0x527d6d=path[_0x999e('0xe1')](_0x21ecc2,_0x34323f);var _0x2b3e01=[];_0x2b3e01[_0x999e('0x38')]({'model':db['User'],'as':_0x999e('0x78'),'attributes':['id',_0x999e('0x35')],'raw':!![]});_0x2b3e01[_0x999e('0x38')]({'model':db[_0x999e('0xd5')],'as':_0x999e('0x70'),'attributes':['id','firstName',_0x999e('0x114')],'raw':!![]});if(_0x35c0e4[_0x999e('0x4e')][_0x999e('0x113')]){_0x2b3e01[_0x999e('0x38')]({'model':db[_0x999e('0xdc')],'as':_0x999e('0xdc'),'raw':!![]});}var _0x1c7b1e=[{'model':db['ChatMessage'],'as':_0x999e('0xed'),'attributes':['id',_0x999e('0xc1'),_0x999e('0x115'),_0x999e('0xf8'),_0x999e('0xf9'),_0x999e('0x88')],'include':_0x2b3e01}];_0x1c7b1e['push']({'model':db['ChatWebsite'],'as':_0x999e('0x116'),'attributes':['id','name']});_0x1c7b1e[_0x999e('0x38')]({'model':db[_0x999e('0x78')],'as':_0x999e('0x117'),'attributes':['id',_0x999e('0x35')]});return db['ChatInteraction'][_0x999e('0x6b')]({'where':{'id':_0x35c0e4['params']['id']},'include':_0x1c7b1e})[_0x999e('0x2c')](handleEntityNotFound(_0x49af7d,null))[_0x999e('0x2c')](function(_0x2d29ee){if(_0x2d29ee){var _0x14350e=_0x2d29ee[_0x999e('0x118')]({'plain':!![]});fs[_0x999e('0x119')](_0x375777);var _0x256c4c={'channel':_0x999e('0x11a'),'account':_0x14350e[_0x999e('0x116')][_0x999e('0x2f')],'agent':_0x14350e[_0x999e('0x117')]?_0x14350e[_0x999e('0x117')][_0x999e('0x35')]:_0x999e('0x11b'),'createdAt':moment(_0x14350e[_0x999e('0x115')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x14350e[_0x999e('0x3f')]?moment(_0x14350e[_0x999e('0x11c')])[_0x999e('0xe8')](_0x999e('0x105'))[_0x999e('0xa1')]():'','disposition':_0x14350e['disposition'],'chatInfo':{'browser':_0x14350e[_0x999e('0x11d')],'os':_0x14350e[_0x999e('0x11e')],'referer':_0x14350e[_0x999e('0x11f')],'customerIp':_0x14350e[_0x999e('0x120')],'customerPort':_0x14350e[_0x999e('0x121')]?_0x14350e[_0x999e('0x121')]:_0x999e('0x11b')},'messages':_(_0x14350e[_0x999e('0xed')])[_0x999e('0x122')]()[_0x999e('0x8d')]({'secret':![]})['map'](function(_0x2ec1e4){if(_0x2ec1e4[_0x999e('0xdc')]){var _0x5b7284=path[_0x999e('0xe1')](_0x3c0a39,_0x2ec1e4[_0x999e('0xdc')][_0x999e('0xda')]);if(fs[_0x999e('0x123')](_0x5b7284)){fs['createReadStream'](_0x5b7284)['pipe'](fs[_0x999e('0x124')](path['join'](_0x375777,_0x2ec1e4['Attachment']['basename'])));}}return{'date':moment(_0x2ec1e4[_0x999e('0x115')])[_0x999e('0xe8')](_0x999e('0x105'))[_0x999e('0xa1')](),'sender':_0x2ec1e4['direction']==='out'?_0x2ec1e4[_0x999e('0x78')]?_0x2ec1e4[_0x999e('0x78')]['fullname']:_0x999e('0xf0'):_0x2ec1e4['Contact']['firstName']+(_0x2ec1e4[_0x999e('0x70')][_0x999e('0x114')]?'\x20'+_0x2ec1e4[_0x999e('0x70')]['lastName']:''),'body':_0x2ec1e4[_0x999e('0xdc')]?_0x2ec1e4[_0x999e('0xdc')]['basename']:_0x2ec1e4[_0x999e('0xc1')],'direction':_0x2ec1e4['direction']===_0x999e('0x125')?'A':'C','secret':_0x2ec1e4['secret'],'read':_0x2ec1e4[_0x999e('0x88')],'attachment':_0x2ec1e4[_0x999e('0xdc')]};})[_0x999e('0x6d')]()};return ejs[_0x999e('0x126')](path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x127'),_0x999e('0x128')),{'interaction':_0x256c4c})[_0x999e('0x2c')](function(_0x17fff9){var _0x33763d=path[_0x999e('0xe1')](_0x375777,_0x999e('0x129')+_0x14350e['id']+'-'+_0x49ce92+_0x999e('0x12a'));var _0x29aeb7={'path':_0x33763d,'channel':'Chat','interactionId':_0x14350e['id']};return pdf[_0x999e('0x12b')](_0x17fff9,_0x29aeb7);})[_0x999e('0x2c')](function(){return new Promise(function(_0x1bebaf,_0x3cf4aa){zipdir(_0x375777,{'saveTo':_0x527d6d},function(_0x3141f3,_0x2c56b5){if(_0x3141f3)return _0x3cf4aa(_0x3141f3);return _0x1bebaf(_0x2c56b5);});})[_0x999e('0x2c')](function(){return new BPromise(function(_0x27eb61,_0x5a2902){rimraf(_0x375777,function(_0x5ec0a5){if(_0x5ec0a5)_0x5a2902(_0x5ec0a5);return _0x27eb61();});});})[_0x999e('0x2c')](function(){return _0x49af7d['download'](_0x527d6d,_0x34323f,function(_0x38b97e){if(_0x38b97e){logger[_0x999e('0x1c')](_0x999e('0x12c'),_0x38b97e);}else{fs['unlinkSync'](_0x527d6d);}});});});}else{return _0x49af7d['sendStatus'](0xc8);}})[_0x999e('0x21')](handleError(_0x49af7d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index b9b5de9..3c07c5c 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 _0xb4b2=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','ChatInteraction','save'];(function(_0x3596c7,_0x1061ba){var _0x413455=function(_0x5eacb2){while(--_0x5eacb2){_0x3596c7['push'](_0x3596c7['shift']());}};_0x413455(++_0x1061ba);}(_0xb4b2,0x151));var _0x2b4b=function(_0x27cc87,_0x2ce582){_0x27cc87=_0x27cc87-0x0;var _0x53dc98=_0xb4b2[_0x27cc87];return _0x53dc98;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x2b4b('0x0'))['db'][_0x2b4b('0x1')];var ChatMessage=require(_0x2b4b('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2b4b('0x2'),'afterUpdate':_0x2b4b('0x3'),'afterDestroy':_0x2b4b('0x4')};function emitEvent(_0x45c6ec){return function(_0x57a8fe,_0x226c2d,_0x5c2825){_0x57a8fe[_0x2b4b('0x5')]({'attributes':['id'],'raw':!![]})[_0x2b4b('0x6')](function(_0x53a2d6){_0x57a8fe[_0x2b4b('0x7')](_0x2b4b('0x8'),_0x53a2d6[_0x2b4b('0x9')](function(_0x2ca939){return{'id':_0x2ca939['id']};}));return ChatMessage[_0x2b4b('0xa')]({'where':{'ChatInteractionId':_0x57a8fe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2b4b('0x6')](function(_0x10586b){_0x57a8fe[_0x2b4b('0x7')](_0x2b4b('0xb'),_0x10586b[_0x2b4b('0xc')]);ChatInteractionEvents[_0x2b4b('0xd')](_0x45c6ec+':'+_0x57a8fe['id'],_0x57a8fe);ChatInteractionEvents['emit'](_0x45c6ec,_0x57a8fe);_0x5c2825(null);})[_0x2b4b('0xe')](_0x5c2825(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x2b4b('0xf')](e,emitEvent(event));}}module[_0x2b4b('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xc00e=['hasOwnProperty','../../mysqldb','ChatMessage','setMaxListeners','save','then','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0xdca4a6,_0x4965f6){var _0x5c5b95=function(_0x2c8fe7){while(--_0x2c8fe7){_0xdca4a6['push'](_0xdca4a6['shift']());}};_0x5c5b95(++_0x4965f6);}(_0xc00e,0x17a));var _0xec00=function(_0x466d75,_0x2b7b3f){_0x466d75=_0x466d75-0x0;var _0x43233a=_0xc00e[_0x466d75];return _0x43233a;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xec00('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xec00('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xec00('0x2')](0x0);var events={'afterCreate':_0xec00('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x127c91){return function(_0x39a8ad,_0x49e3d6,_0x3e8e01){_0x39a8ad['getUsers']({'attributes':['id'],'raw':!![]})[_0xec00('0x4')](function(_0x5ba576){_0x39a8ad['setDataValue']('Users',_0x5ba576[_0xec00('0x5')](function(_0x1a3c92){return{'id':_0x1a3c92['id']};}));return ChatMessage[_0xec00('0x6')]({'where':{'ChatInteractionId':_0x39a8ad['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19a3a1){_0x39a8ad[_0xec00('0x7')](_0xec00('0x8'),_0x19a3a1[_0xec00('0x9')]);ChatInteractionEvents[_0xec00('0xa')](_0x127c91+':'+_0x39a8ad['id'],_0x39a8ad);ChatInteractionEvents[_0xec00('0xa')](_0x127c91,_0x39a8ad);_0x3e8e01(null);})[_0xec00('0xb')](_0x3e8e01(null));};}for(var e in events){if(events[_0xec00('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 3253280..d26be68 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 _0x9432=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x165da5,_0x22204d){var _0x56724c=function(_0x5a784c){while(--_0x5a784c){_0x165da5['push'](_0x165da5['shift']());}};_0x56724c(++_0x22204d);}(_0x9432,0xfc));var _0x2943=function(_0x29fd36,_0x4555a4){_0x29fd36=_0x29fd36-0x0;var _0x2ec196=_0x9432[_0x29fd36];return _0x2ec196;};'use strict';var _=require(_0x2943('0x0'));var util=require(_0x2943('0x1'));var logger=require(_0x2943('0x2'))(_0x2943('0x3'));var moment=require(_0x2943('0x4'));var BPromise=require(_0x2943('0x5'));var rp=require(_0x2943('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2943('0x7'));var config=require(_0x2943('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x27a263,_0x1c8e96){return _0x27a263[_0x2943('0x9')](_0x2943('0xa'),attributes,{'tableName':_0x2943('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29b612,_0x1dafc4,_0x4b524c){if(_0x29b612[_0x2943('0xc')](_0x2943('0xd'))){_0x29b612[_0x2943('0xe')]=moment()[_0x2943('0xf')](_0x2943('0x10'));}_0x4b524c(null,_0x29b612);}},'charset':_0x2943('0x11'),'collate':_0x2943('0x12')});}; \ No newline at end of file +var _0xcc4c=['moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5acb40,_0x4be650){var _0x522760=function(_0x1e4b9e){while(--_0x1e4b9e){_0x5acb40['push'](_0x5acb40['shift']());}};_0x522760(++_0x4be650);}(_0xcc4c,0x1b7));var _0xccc4=function(_0x3715fc,_0xec8927){_0x3715fc=_0x3715fc-0x0;var _0x40a4cf=_0xcc4c[_0x3715fc];return _0x40a4cf;};'use strict';var _=require(_0xccc4('0x0'));var util=require('util');var logger=require(_0xccc4('0x1'))(_0xccc4('0x2'));var moment=require(_0xccc4('0x3'));var BPromise=require('bluebird');var rp=require(_0xccc4('0x4'));var fs=require('fs');var path=require(_0xccc4('0x5'));var rimraf=require(_0xccc4('0x6'));var config=require(_0xccc4('0x7'));var attributes=require(_0xccc4('0x8'));module[_0xccc4('0x9')]=function(_0x240039,_0x53af0f){return _0x240039['define']('ChatInteraction',attributes,{'tableName':_0xccc4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39aebd,_0x1542c1,_0x57a668){if(_0x39aebd[_0xccc4('0xb')]('closed')){_0x39aebd[_0xccc4('0xc')]=moment()[_0xccc4('0xd')](_0xccc4('0xe'));}_0x57a668(null,_0x39aebd);}},'charset':_0xccc4('0xf'),'collate':_0xccc4('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 50f5849..62a174c 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 _0x37d1=['error','code','message','result','catch','ChatInteraction','update','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','body','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x37d1,0x116));var _0x137d=function(_0x2b20aa,_0x168618){_0x2b20aa=_0x2b20aa-0x0;var _0x10fba0=_0x37d1[_0x2b20aa];return _0x10fba0;};'use strict';var _=require(_0x137d('0x0'));var util=require(_0x137d('0x1'));var moment=require(_0x137d('0x2'));var BPromise=require(_0x137d('0x3'));var rs=require(_0x137d('0x4'));var fs=require('fs');var Redis=require(_0x137d('0x5'));var db=require(_0x137d('0x6'))['db'];var utils=require(_0x137d('0x7'));var logger=require(_0x137d('0x8'))(_0x137d('0x9'));var config=require(_0x137d('0xa'));var jayson=require(_0x137d('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x137d('0xc')]=_[_0x137d('0xd')](config[_0x137d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x137d('0xe'))(new Redis(config[_0x137d('0xc')]));require(_0x137d('0xf'))[_0x137d('0x10')](socket);function respondWithRpcPromise(_0x3bb0da,_0x2e4722,_0x451482){return new BPromise(function(_0x30282a,_0x574327){return client['request'](_0x3bb0da,_0x451482)[_0x137d('0x11')](function(_0x4cb0fe){logger[_0x137d('0x12')](_0x137d('0x13'),_0x2e4722,_0x137d('0x14'));logger[_0x137d('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2e4722,'request\x20sent',JSON[_0x137d('0x16')](_0x4cb0fe));if(_0x4cb0fe[_0x137d('0x17')]){if(_0x4cb0fe[_0x137d('0x17')][_0x137d('0x18')]===0x1f4){logger[_0x137d('0x17')](_0x137d('0x13'),_0x2e4722,_0x4cb0fe['error']['message']);return _0x574327(_0x4cb0fe[_0x137d('0x17')][_0x137d('0x19')]);}logger[_0x137d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2e4722,_0x4cb0fe[_0x137d('0x17')][_0x137d('0x19')]);return _0x30282a(_0x4cb0fe[_0x137d('0x17')][_0x137d('0x19')]);}else{logger['info'](_0x137d('0x13'),_0x2e4722,_0x137d('0x14'));_0x30282a(_0x4cb0fe[_0x137d('0x1a')]['message']);}})[_0x137d('0x1b')](function(_0x5df994){logger[_0x137d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2e4722,_0x5df994);_0x574327(_0x5df994);});});}exports['UpdateChatInteraction']=function(_0x29fd7d){var _0xa42d=this;return new Promise(function(_0x1f7e87,_0x40040b){return db[_0x137d('0x1c')][_0x137d('0x1d')](_0x29fd7d['body'],{'raw':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d[_0x137d('0x1e')][_0x137d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d[_0x137d('0x1e')][_0x137d('0x20')]||null:null,'attributes':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d[_0x137d('0x1e')][_0x137d('0x21')]||null:null,'limit':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d['options'][_0x137d('0x22')]||null:null})[_0x137d('0x11')](function(_0xb596d9){logger['info'](_0x137d('0x23'),_0x29fd7d);logger['debug']('UpdateChatInteraction',_0x29fd7d,JSON[_0x137d('0x16')](_0xb596d9));_0x1f7e87(_0xb596d9);})[_0x137d('0x1b')](function(_0x11398c){logger[_0x137d('0x17')](_0x137d('0x23'),_0x11398c[_0x137d('0x19')],_0x29fd7d);_0x40040b(_0xa42d[_0x137d('0x17')](0x1f4,_0x11398c[_0x137d('0x19')]));});});};exports[_0x137d('0x24')]=function(_0x180c4e){return new Promise(function(_0x10fb44,_0x157583){return db[_0x137d('0x1c')][_0x137d('0x25')]({'where':_0x180c4e['options']?_0x180c4e[_0x137d('0x1e')][_0x137d('0x20')]||null:null})[_0x137d('0x11')](function(_0x2c43fe){if(_0x2c43fe){return _0x2c43fe[_0x137d('0x26')](_0x180c4e[_0x137d('0x27')]['ids'],_[_0x137d('0x28')](_0x180c4e['body'],[_0x137d('0x29'),'id'])||{});}})['spread'](function(_0x7e9f04){logger[_0x137d('0x12')]('AddTags',_0x180c4e);logger[_0x137d('0x15')](_0x137d('0x2a'),_0x180c4e,JSON[_0x137d('0x16')](_0x7e9f04));_0x10fb44(_0x7e9f04);})[_0x137d('0x1b')](function(_0x36aaa6){logger[_0x137d('0x17')](_0x137d('0x2a'),_0x36aaa6[_0x137d('0x19')],_0x180c4e);_0x157583(_this[_0x137d('0x17')](0x1f4,_0x36aaa6[_0x137d('0x19')]));});});}; \ No newline at end of file +var _0xafb5=['defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x39a4d0,_0x39d667){var _0x9078ca=function(_0x16c729){while(--_0x16c729){_0x39a4d0['push'](_0x39a4d0['shift']());}};_0x9078ca(++_0x39d667);}(_0xafb5,0xcb));var _0x5afb=function(_0x2ff990,_0x52dd2c){_0x2ff990=_0x2ff990-0x0;var _0x2e9ece=_0xafb5[_0x2ff990];return _0x2e9ece;};'use strict';var _=require('lodash');var util=require(_0x5afb('0x0'));var moment=require(_0x5afb('0x1'));var BPromise=require(_0x5afb('0x2'));var rs=require(_0x5afb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5afb('0x4'))['db'];var utils=require(_0x5afb('0x5'));var logger=require(_0x5afb('0x6'))(_0x5afb('0x7'));var config=require(_0x5afb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5afb('0x9')][_0x5afb('0xa')]({'port':0x232a});config[_0x5afb('0xb')]=_[_0x5afb('0xc')](config[_0x5afb('0xb')],{'host':_0x5afb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5afb('0xe'))[_0x5afb('0xf')](socket);function respondWithRpcPromise(_0x35cbce,_0xf93cd2,_0x7a9b34){return new BPromise(function(_0x4b83c2,_0x8acb76){return client[_0x5afb('0x10')](_0x35cbce,_0x7a9b34)[_0x5afb('0x11')](function(_0x32beb7){logger[_0x5afb('0x12')](_0x5afb('0x13'),_0xf93cd2,_0x5afb('0x14'));logger['debug'](_0x5afb('0x15'),_0xf93cd2,_0x5afb('0x14'),JSON['stringify'](_0x32beb7));if(_0x32beb7[_0x5afb('0x16')]){if(_0x32beb7[_0x5afb('0x16')]['code']===0x1f4){logger[_0x5afb('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xf93cd2,_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);return _0x8acb76(_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);}logger[_0x5afb('0x16')](_0x5afb('0x13'),_0xf93cd2,_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);return _0x4b83c2(_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);}else{logger[_0x5afb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0xf93cd2,_0x5afb('0x14'));_0x4b83c2(_0x32beb7[_0x5afb('0x18')]['message']);}})['catch'](function(_0x2c3944){logger[_0x5afb('0x16')](_0x5afb('0x13'),_0xf93cd2,_0x2c3944);_0x8acb76(_0x2c3944);});});}exports['UpdateChatInteraction']=function(_0x5697a3){var _0x528514=this;return new Promise(function(_0x47aa4a,_0x2a0157){return db[_0x5afb('0x19')][_0x5afb('0x1a')](_0x5697a3[_0x5afb('0x1b')],{'raw':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x1e')]||null:null,'attributes':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x1f')]||null:null,'limit':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x20')]||null:null})['then'](function(_0x1bf810){logger[_0x5afb('0x12')]('UpdateChatInteraction',_0x5697a3);logger['debug'](_0x5afb('0x21'),_0x5697a3,JSON[_0x5afb('0x22')](_0x1bf810));_0x47aa4a(_0x1bf810);})[_0x5afb('0x23')](function(_0x43820b){logger[_0x5afb('0x16')](_0x5afb('0x21'),_0x43820b['message'],_0x5697a3);_0x2a0157(_0x528514[_0x5afb('0x16')](0x1f4,_0x43820b[_0x5afb('0x17')]));});});};exports[_0x5afb('0x24')]=function(_0x4f3519){return new Promise(function(_0x5c5f35,_0x8f4c9d){return db[_0x5afb('0x19')][_0x5afb('0x25')]({'where':_0x4f3519[_0x5afb('0x1c')]?_0x4f3519[_0x5afb('0x1c')][_0x5afb('0x1e')]||null:null})[_0x5afb('0x11')](function(_0x1248b8){if(_0x1248b8){return _0x1248b8[_0x5afb('0x26')](_0x4f3519[_0x5afb('0x1b')]['ids'],_[_0x5afb('0x27')](_0x4f3519[_0x5afb('0x1b')],[_0x5afb('0x28'),'id'])||{});}})['spread'](function(_0x49447f){logger[_0x5afb('0x12')](_0x5afb('0x29'),_0x4f3519);logger[_0x5afb('0x2a')]('AddTags',_0x4f3519,JSON[_0x5afb('0x22')](_0x49447f));_0x5c5f35(_0x49447f);})[_0x5afb('0x23')](function(_0x58d015){logger[_0x5afb('0x16')](_0x5afb('0x29'),_0x58d015['message'],_0x4f3519);_0x8f4c9d(_this[_0x5afb('0x16')](0x1f4,_0x58d015[_0x5afb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 1519256..5f1e96e 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 _0xa8a8=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x128b88,_0x3a3984){var _0x299b5c=function(_0x23694d){while(--_0x23694d){_0x128b88['push'](_0x128b88['shift']());}};_0x299b5c(++_0x3a3984);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3ffca4,_0x3cb819){_0x3ffca4=_0x3ffca4-0x0;var _0x2212ec=_0xa8a8[_0x3ffca4];return _0x2212ec;};'use strict';var ChatInteractionEvents=require(_0x8a8a('0x0'));var events=[_0x8a8a('0x1'),_0x8a8a('0x2'),_0x8a8a('0x3')];function createListener(_0x5221bc,_0x2a2676){return function(_0x3296a6){_0x2a2676[_0x8a8a('0x4')](_0x5221bc,_0x3296a6);};}function removeListener(_0x3ed1de,_0x45515d){return function(){ChatInteractionEvents[_0x8a8a('0x5')](_0x3ed1de,_0x45515d);};}exports[_0x8a8a('0x6')]=function(_0x12db82){for(var _0x2e8193=0x0,_0x315fe9=events[_0x8a8a('0x7')];_0x2e8193<_0x315fe9;_0x2e8193++){var _0x8e7aa0=events[_0x2e8193];var _0x4225b9=createListener(_0x8a8a('0x8')+_0x8e7aa0,_0x12db82);ChatInteractionEvents['on'](_0x8e7aa0,_0x4225b9);}}; \ No newline at end of file +var _0xe56d=['./chatInteraction.events','emit','removeListener','register','length'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0xe56d,0x1ea));var _0xde56=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xe56d[_0x280ae7];return _0x418b9e;};'use strict';var ChatInteractionEvents=require(_0xde56('0x0'));var events=['save','remove','update'];function createListener(_0x4ad900,_0x40c4f6){return function(_0x29abd9){_0x40c4f6[_0xde56('0x1')](_0x4ad900,_0x29abd9);};}function removeListener(_0x33f7ec,_0x56d503){return function(){ChatInteractionEvents[_0xde56('0x2')](_0x33f7ec,_0x56d503);};}exports[_0xde56('0x3')]=function(_0x2c6d08){for(var _0x13bea9=0x0,_0x1bf93e=events[_0xde56('0x4')];_0x13bea9<_0x1bf93e;_0x13bea9++){var _0x2eb29f=events[_0x13bea9];var _0x5a2268=createListener('chatInteraction:'+_0x2eb29f,_0x2c6d08);ChatInteractionEvents['on'](_0x2eb29f,_0x5a2268);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 32d1001..4c99685 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 _0x2779=['destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','chat','chatinteraction:addtags','/:id','tracked','chatinteraction:update','put','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2779,0x12f));var _0x9277=function(_0x198e30,_0x3275c7){_0x198e30=_0x198e30-0x0;var _0x18ce2f=_0x2779[_0x198e30];return _0x18ce2f;};'use strict';var multer=require(_0x9277('0x0'));var util=require('util');var path=require(_0x9277('0x1'));var timeout=require(_0x9277('0x2'));var express=require(_0x9277('0x3'));var router=express[_0x9277('0x4')]();var fs_extra=require(_0x9277('0x5'));var auth=require(_0x9277('0x6'));var interaction=require(_0x9277('0x7'));var config=require('../../config/environment');var controller=require(_0x9277('0x8'));router[_0x9277('0x9')]('/',auth[_0x9277('0xa')](),controller[_0x9277('0xb')]);router[_0x9277('0x9')](_0x9277('0xc'),auth['isAuthenticated'](),controller[_0x9277('0xd')]);router[_0x9277('0x9')]('/:id',auth[_0x9277('0xe')](),controller[_0x9277('0xf')]);router[_0x9277('0x9')](_0x9277('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x9277('0x11')]);router[_0x9277('0x9')](_0x9277('0x12'),auth[_0x9277('0xa')](),controller['getMessages']);router[_0x9277('0x9')](_0x9277('0x13'),auth[_0x9277('0xe')](),controller[_0x9277('0x14')]);router[_0x9277('0x9')](_0x9277('0x15'),auth[_0x9277('0xa')](),controller['download']);router[_0x9277('0x16')]('/',auth[_0x9277('0xa')](),controller[_0x9277('0x17')]);router[_0x9277('0x16')](_0x9277('0x18'),auth[_0x9277('0xa')](),controller[_0x9277('0x19')]);var upload=multer({'storage':multer[_0x9277('0x1a')]({'destination':function(_0x4918f4,_0x3430ca,_0x1b858c){_0x1b858c(null,path['join'](config['root'],_0x9277('0x1b')));},'filename':function(_0x25ed1c,_0x51ab30,_0x287dcc){_0x287dcc(null,util['format'](_0x9277('0x1c'),Date[_0x9277('0x1d')](),_0x51ab30[_0x9277('0x1e')][_0x9277('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9277('0x16')](_0x9277('0x20'),upload[_0x9277('0x21')]('file'),controller[_0x9277('0x22')]);router['post']('/:id/messages',auth[_0x9277('0xe')](),controller['addMessage']);router[_0x9277('0x16')]('/:id/tags',auth[_0x9277('0xa')](),interaction['tracked'](_0x9277('0x23'),_0x9277('0x24')),controller['addTags']);router['put'](_0x9277('0x25'),auth[_0x9277('0xa')](),interaction[_0x9277('0x26')](_0x9277('0x23'),_0x9277('0x27')),controller['update']);router[_0x9277('0x28')](_0x9277('0x29'),controller['customUpdate']);router['put'](_0x9277('0x2a'),auth[_0x9277('0xe')](),controller['abandon']);router['put'](_0x9277('0x2b'),controller[_0x9277('0x2c')]);router[_0x9277('0x2d')](_0x9277('0x25'),auth[_0x9277('0xa')](),interaction[_0x9277('0x26')](_0x9277('0x23'),_0x9277('0x2e')),controller[_0x9277('0x2f')]);router[_0x9277('0x2d')](_0x9277('0x30'),auth['isAuthenticated'](),controller[_0x9277('0x31')]);module['exports']=router; \ No newline at end of file +var _0xe6ba=['diskStorage','join','root','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','update','put','customUpdate','/:id/abandon','close','delete','chatinteraction:destroy','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession'];(function(_0x3bd24c,_0x5543e0){var _0x3c358e=function(_0x49e234){while(--_0x49e234){_0x3bd24c['push'](_0x3bd24c['shift']());}};_0x3c358e(++_0x5543e0);}(_0xe6ba,0x77));var _0xae6b=function(_0x4e8127,_0x442a92){_0x4e8127=_0x4e8127-0x0;var _0x9a68d1=_0xe6ba[_0x4e8127];return _0x9a68d1;};'use strict';var multer=require('multer');var util=require(_0xae6b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xae6b('0x1'));var router=express[_0xae6b('0x2')]();var fs_extra=require(_0xae6b('0x3'));var auth=require(_0xae6b('0x4'));var interaction=require(_0xae6b('0x5'));var config=require(_0xae6b('0x6'));var controller=require(_0xae6b('0x7'));router[_0xae6b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xae6b('0x8')]('/describe',auth[_0xae6b('0x9')](),controller[_0xae6b('0xa')]);router[_0xae6b('0x8')](_0xae6b('0xb'),auth[_0xae6b('0xc')](),controller[_0xae6b('0xd')]);router[_0xae6b('0x8')](_0xae6b('0xe'),auth[_0xae6b('0xc')](),controller[_0xae6b('0xf')]);router[_0xae6b('0x8')](_0xae6b('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0xae6b('0x8')](_0xae6b('0x11'),auth[_0xae6b('0xc')](),controller[_0xae6b('0x12')]);router['get'](_0xae6b('0x13'),auth[_0xae6b('0x9')](),controller[_0xae6b('0x14')]);router[_0xae6b('0x15')]('/',auth[_0xae6b('0x9')](),controller[_0xae6b('0x16')]);router[_0xae6b('0x15')](_0xae6b('0x17'),auth['isAuthenticated'](),controller[_0xae6b('0x18')]);var upload=multer({'storage':multer[_0xae6b('0x19')]({'destination':function(_0x22ca98,_0x489846,_0x2085ba){_0x2085ba(null,path[_0xae6b('0x1a')](config[_0xae6b('0x1b')],'server/files/attachments/'));},'filename':function(_0x18e956,_0x344f84,_0x28cae1){_0x28cae1(null,util[_0xae6b('0x1c')](_0xae6b('0x1d'),Date[_0xae6b('0x1e')](),_0x344f84['originalname'][_0xae6b('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xae6b('0x20'),upload['single'](_0xae6b('0x21')),controller[_0xae6b('0x22')]);router[_0xae6b('0x15')](_0xae6b('0x10'),auth[_0xae6b('0xc')](),controller[_0xae6b('0x23')]);router[_0xae6b('0x15')](_0xae6b('0x24'),auth[_0xae6b('0x9')](),interaction[_0xae6b('0x25')](_0xae6b('0x26'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0xae6b('0xb'),auth[_0xae6b('0x9')](),interaction[_0xae6b('0x25')](_0xae6b('0x26'),'chatinteraction:update'),controller[_0xae6b('0x27')]);router[_0xae6b('0x28')]('/:id/custom_update',controller[_0xae6b('0x29')]);router[_0xae6b('0x28')](_0xae6b('0x2a'),auth[_0xae6b('0xc')](),controller['abandon']);router[_0xae6b('0x28')]('/:id/close',controller[_0xae6b('0x2b')]);router[_0xae6b('0x2c')](_0xae6b('0xb'),auth[_0xae6b('0x9')](),interaction[_0xae6b('0x25')](_0xae6b('0x26'),_0xae6b('0x2d')),controller[_0xae6b('0x2e')]);router[_0xae6b('0x2c')]('/:id/tags',auth[_0xae6b('0x9')](),controller['removeTags']);module[_0xae6b('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index fa94659..44b8b30 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 _0xc61c=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x207015,_0x570b4b){var _0x7c8426=function(_0xfa3c9e){while(--_0xfa3c9e){_0x207015['push'](_0x207015['shift']());}};_0x7c8426(++_0x570b4b);}(_0xc61c,0xb8));var _0xcc61=function(_0x5ccdd5,_0x137596){_0x5ccdd5=_0x5ccdd5-0x0;var _0x2bb303=_0xc61c[_0x5ccdd5];return _0x2bb303;};'use strict';var Sequelize=require('sequelize');module[_0xcc61('0x0')]={'body':{'type':Sequelize[_0xcc61('0x1')](_0xcc61('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcc61('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcc61('0x4')]}}; \ No newline at end of file +var _0xa486=['sequelize','exports','TEXT','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa486,0xa0));var _0x6a48=function(_0x2ef72c,_0x4cee49){_0x2ef72c=_0x2ef72c-0x0;var _0x2a25b9=_0xa486[_0x2ef72c];return _0x2a25b9;};'use strict';var Sequelize=require(_0x6a48('0x0'));module[_0x6a48('0x1')]={'body':{'type':Sequelize[_0x6a48('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6a48('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 052de60..d5e41b6 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 _0x3f7f=['fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','type','options','ChatInternalMessage','includeAll','findAll','catch','show','params','length','create','body','find','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId','ToId','read','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x3f7f,0x143));var _0xf3f7=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3f7f[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0xf3f7('0x0'));var rimraf=require(_0xf3f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3f7('0x2'));var rp=require(_0xf3f7('0x3'));var moment=require(_0xf3f7('0x4'));var BPromise=require(_0xf3f7('0x5'));var Mustache=require('mustache');var util=require(_0xf3f7('0x6'));var path=require(_0xf3f7('0x7'));var sox=require(_0xf3f7('0x8'));var csv=require(_0xf3f7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3f7('0xa'));var _=require(_0xf3f7('0xb'));var squel=require(_0xf3f7('0xc'));var crypto=require(_0xf3f7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf3f7('0x9'));var querystring=require(_0xf3f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xf3f7('0xf'));var authService=require(_0xf3f7('0x10'));var qs=require(_0xf3f7('0x11'));var as=require(_0xf3f7('0x12'));var hardwareService=require(_0xf3f7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf3f7('0x14'));var config=require(_0xf3f7('0x15'));var licenseUtil=require(_0xf3f7('0x16'));var db=require(_0xf3f7('0x17'))['db'];config[_0xf3f7('0x18')]=_[_0xf3f7('0x19')](config[_0xf3f7('0x18')],{'host':_0xf3f7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3f7('0x18')]));require(_0xf3f7('0x1b'))['register'](socket);function respondWithStatusCode(_0x53b6a5,_0x7d6a20){_0x7d6a20=_0x7d6a20||0xcc;return function(_0x1c575a){if(_0x1c575a){return _0x53b6a5['sendStatus'](_0x7d6a20);}return _0x53b6a5[_0xf3f7('0x1c')](_0x7d6a20)[_0xf3f7('0x1d')]();};}function respondWithResult(_0x286bd6,_0x3ce19c){_0x3ce19c=_0x3ce19c||0xc8;return function(_0x1c5f4b){if(_0x1c5f4b){return _0x286bd6[_0xf3f7('0x1c')](_0x3ce19c)[_0xf3f7('0x1e')](_0x1c5f4b);}};}function respondWithFilteredResult(_0x5a502b,_0xbe0ef5){return function(_0xe7836b){if(_0xe7836b){var _0x234db8=typeof _0xbe0ef5[_0xf3f7('0x1f')]===_0xf3f7('0x20')&&typeof _0xbe0ef5[_0xf3f7('0x21')]==='undefined';var _0x45bef7=_0xe7836b['count'];var _0x59773a=_0x234db8?0x0:_0xbe0ef5['offset'];var _0x5e7acb=_0x234db8?_0xe7836b[_0xf3f7('0x22')]:_0xbe0ef5[_0xf3f7('0x1f')]+_0xbe0ef5['limit'];var _0x1a57f9;if(_0x5e7acb>=_0x45bef7){_0x5e7acb=_0x45bef7;_0x1a57f9=0xc8;}else{_0x1a57f9=0xce;}_0x5a502b[_0xf3f7('0x1c')](_0x1a57f9);return _0x5a502b[_0xf3f7('0x23')](_0xf3f7('0x24'),_0x59773a+'-'+_0x5e7acb+'/'+_0x45bef7)[_0xf3f7('0x1e')](_0xe7836b);}return null;};}function patchUpdates(_0x5c6b58){return function(_0x25eba5){try{jsonpatch['apply'](_0x25eba5,_0x5c6b58,!![]);}catch(_0x27b42a){return BPromise[_0xf3f7('0x25')](_0x27b42a);}return _0x25eba5[_0xf3f7('0x26')]();};}function saveUpdates(_0x50a31f,_0x1352c2){return function(_0x5ec7de){if(_0x5ec7de){return _0x5ec7de[_0xf3f7('0x27')](_0x50a31f)[_0xf3f7('0x28')](function(_0x4ad9e3){return _0x4ad9e3;});}return null;};}function removeEntity(_0x76f15c,_0x14db43){return function(_0x29ca26){if(_0x29ca26){return _0x29ca26[_0xf3f7('0x29')]()[_0xf3f7('0x28')](function(){_0x76f15c[_0xf3f7('0x1c')](0xcc)[_0xf3f7('0x1d')]();});}};}function handleEntityNotFound(_0x550c19,_0x25219b){return function(_0x5a545e){if(!_0x5a545e){_0x550c19[_0xf3f7('0x2a')](0x194);}return _0x5a545e;};}function handleError(_0x1dec78,_0x32ede2){_0x32ede2=_0x32ede2||0x1f4;return function(_0x24efd9){logger[_0xf3f7('0x2b')](_0x24efd9[_0xf3f7('0x2c')]);if(_0x24efd9[_0xf3f7('0x2d')]){delete _0x24efd9[_0xf3f7('0x2d')];}_0x1dec78[_0xf3f7('0x1c')](_0x32ede2)[_0xf3f7('0x2e')](_0x24efd9);};}exports[_0xf3f7('0x2f')]=function(_0x49c071,_0x1519a3){var _0x229948={},_0x1beef4={},_0x4e0951={'count':0x0,'rows':[]};var _0x387198=_[_0xf3f7('0x30')](db['ChatInternalMessage'][_0xf3f7('0x31')],function(_0x2bad2d){return{'name':_0x2bad2d[_0xf3f7('0x32')],'type':_0x2bad2d['type']['key']};});_0x1beef4[_0xf3f7('0x33')]=_[_0xf3f7('0x30')](_0x387198,_0xf3f7('0x2d'));_0x1beef4[_0xf3f7('0x34')]=_[_0xf3f7('0x35')](_0x49c071[_0xf3f7('0x34')]);_0x1beef4[_0xf3f7('0x36')]=_['intersection'](_0x1beef4[_0xf3f7('0x33')],_0x1beef4[_0xf3f7('0x34')]);_0x229948['attributes']=_[_0xf3f7('0x37')](_0x1beef4[_0xf3f7('0x33')],qs[_0xf3f7('0x38')](_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x38')]));_0x229948[_0xf3f7('0x39')]=_0x229948[_0xf3f7('0x39')]['length']?_0x229948[_0xf3f7('0x39')]:_0x1beef4[_0xf3f7('0x33')];if(!_0x49c071['query']['hasOwnProperty'](_0xf3f7('0x3a'))){_0x229948[_0xf3f7('0x21')]=qs[_0xf3f7('0x21')](_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x21')]);_0x229948[_0xf3f7('0x1f')]=qs[_0xf3f7('0x1f')](_0x49c071[_0xf3f7('0x34')]['offset']);}_0x229948[_0xf3f7('0x3b')]=qs['sort'](_0x49c071['query'][_0xf3f7('0x3c')]);_0x229948['where']=qs['filters'](_[_0xf3f7('0x3d')](_0x49c071[_0xf3f7('0x34')],_0x1beef4[_0xf3f7('0x36')]),_0x387198);if(_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x3e')]){_0x229948[_0xf3f7('0x3f')]=_[_0xf3f7('0x40')](_0x229948[_0xf3f7('0x3f')],{'$or':_['map'](_0x387198,function(_0x145f7f){if(_0x145f7f[_0xf3f7('0x41')]!=='VIRTUAL'){var _0x4fd6fc={};_0x4fd6fc[_0x145f7f[_0xf3f7('0x2d')]]={'$like':'%'+_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x3e')]+'%'};return _0x4fd6fc;}})});}_0x229948=_[_0xf3f7('0x40')]({},_0x229948,_0x49c071[_0xf3f7('0x42')]);var _0x49e102={'where':_0x229948[_0xf3f7('0x3f')]};return db[_0xf3f7('0x43')][_0xf3f7('0x22')](_0x49e102)['then'](function(_0x4901b0){_0x4e0951['count']=_0x4901b0;if(_0x49c071['query'][_0xf3f7('0x44')]){_0x229948['include']=[{'all':!![]}];}return db[_0xf3f7('0x43')][_0xf3f7('0x45')](_0x229948);})['then'](function(_0x361b4a){_0x4e0951['rows']=_0x361b4a;return _0x4e0951;})[_0xf3f7('0x28')](respondWithFilteredResult(_0x1519a3,_0x229948))[_0xf3f7('0x46')](handleError(_0x1519a3,null));};exports[_0xf3f7('0x47')]=function(_0x597fd2,_0x2105e2){var _0x2b9c05={'raw':!![],'where':{'id':_0x597fd2[_0xf3f7('0x48')]['id']}},_0x46808f={};_0x46808f[_0xf3f7('0x33')]=_[_0xf3f7('0x35')](db[_0xf3f7('0x43')][_0xf3f7('0x31')]);_0x46808f[_0xf3f7('0x34')]=_[_0xf3f7('0x35')](_0x597fd2[_0xf3f7('0x34')]);_0x46808f['filters']=_[_0xf3f7('0x37')](_0x46808f[_0xf3f7('0x33')],_0x46808f[_0xf3f7('0x34')]);_0x2b9c05[_0xf3f7('0x39')]=_[_0xf3f7('0x37')](_0x46808f[_0xf3f7('0x33')],qs[_0xf3f7('0x38')](_0x597fd2[_0xf3f7('0x34')][_0xf3f7('0x38')]));_0x2b9c05['attributes']=_0x2b9c05[_0xf3f7('0x39')][_0xf3f7('0x49')]?_0x2b9c05[_0xf3f7('0x39')]:_0x46808f[_0xf3f7('0x33')];if(_0x597fd2['query'][_0xf3f7('0x44')]){_0x2b9c05['include']=[{'all':!![]}];}_0x2b9c05=_[_0xf3f7('0x40')]({},_0x2b9c05,_0x597fd2['options']);return db[_0xf3f7('0x43')]['find'](_0x2b9c05)['then'](handleEntityNotFound(_0x2105e2,null))[_0xf3f7('0x28')](respondWithResult(_0x2105e2,null))['catch'](handleError(_0x2105e2,null));};exports['create']=function(_0x3932df,_0x1dba71){return db[_0xf3f7('0x43')][_0xf3f7('0x4a')](_0x3932df[_0xf3f7('0x4b')],{})[_0xf3f7('0x28')](respondWithResult(_0x1dba71,0xc9))[_0xf3f7('0x46')](handleError(_0x1dba71,null));};exports['update']=function(_0x49511b,_0x4eb97d){if(_0x49511b[_0xf3f7('0x4b')]['id']){delete _0x49511b[_0xf3f7('0x4b')]['id'];}return db['ChatInternalMessage'][_0xf3f7('0x4c')]({'where':{'id':_0x49511b[_0xf3f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x4eb97d,null))[_0xf3f7('0x28')](saveUpdates(_0x49511b[_0xf3f7('0x4b')],null))[_0xf3f7('0x28')](respondWithResult(_0x4eb97d,null))[_0xf3f7('0x46')](handleError(_0x4eb97d,null));};exports[_0xf3f7('0x29')]=function(_0x37990c,_0x29886a){return db[_0xf3f7('0x43')][_0xf3f7('0x4c')]({'where':{'id':_0x37990c[_0xf3f7('0x48')]['id']}})[_0xf3f7('0x28')](handleEntityNotFound(_0x29886a,null))[_0xf3f7('0x28')](removeEntity(_0x29886a,null))[_0xf3f7('0x46')](handleError(_0x29886a,null));};exports['describe']=function(_0x2c1cec,_0x33022e){return db[_0xf3f7('0x43')][_0xf3f7('0x4d')]()[_0xf3f7('0x28')](respondWithResult(_0x33022e,null))[_0xf3f7('0x46')](handleError(_0x33022e,null));};function wrapUser(_0x581d87){return function(_0x2b22f9){var _0x2294bf=_0x581d87[_0xf3f7('0x4e')]({'plain':!![]});_0x2294bf['messages']=[];if(_0x2b22f9){_0x2294bf['lastMessageAt']=_0x2b22f9[_0xf3f7('0x4f')];_0x2294bf[_0xf3f7('0x50')]=_0x2b22f9;}else{_0x2294bf[_0xf3f7('0x51')]=moment(0x0)[_0xf3f7('0x52')](_0xf3f7('0x53'));_0x2294bf[_0xf3f7('0x50')]={};}return _0x2294bf;};}exports[_0xf3f7('0x54')]=function(_0x59f2bf,_0x582116,_0x1979a6){var _0x1730f5=[];return db['User'][_0xf3f7('0x45')]({'where':{'role':[_0xf3f7('0x55'),_0xf3f7('0x56'),_0xf3f7('0x57')]},'attributes':['id',_0xf3f7('0x58'),_0xf3f7('0x2d'),_0xf3f7('0x59'),_0xf3f7('0x5a'),_0xf3f7('0x5b'),_0xf3f7('0x5c'),_0xf3f7('0x5d'),_0xf3f7('0x5e'),'showWebBar'],'order':qs[_0xf3f7('0x3c')](_0xf3f7('0x5f')),'include':[{'model':db[_0xf3f7('0x60')],'as':_0xf3f7('0x61'),'attributes':['id',_0xf3f7('0x2d'),_0xf3f7('0x41')],'through':{'attributes':[]}}]})[_0xf3f7('0x28')](function(_0x2a65cc){if(_0x2a65cc){var _0x452aef=_0x59f2bf[_0xf3f7('0x57')][_0xf3f7('0x4e')]({'plain':!![]});if(!_0x452aef)throw new Error(_0xf3f7('0x62'));if(_0x452aef['role']===_0xf3f7('0x57')){return db[_0xf3f7('0x63')]['find']({'where':{'name':_0xf3f7('0x64'),'userProfileId':_0x452aef[_0xf3f7('0x65')]},'raw':!![]})[_0xf3f7('0x28')](function(_0x4b2a98){if(_0x4b2a98){if(_0x4b2a98[_0xf3f7('0x66')]===0x0){return db[_0xf3f7('0x67')][_0xf3f7('0x45')]({'where':{'sectionId':_0x4b2a98['id']},'raw':!![]})[_0xf3f7('0x28')](function(_0x93a01){var _0x4b1c61=[];if(_['isEmpty'](_0x93a01)){_0x4b1c61=_['filter'](_0x2a65cc,function(_0x4be0a5){if(_0x4be0a5[_0xf3f7('0x59')]!==_0xf3f7('0x55')){return _0x4be0a5;}});return _0x4b1c61;}else{for(var _0x18b14f=0x0;_0x18b14f<_0x2a65cc['length'];_0x18b14f++){var _0x53f055=_0x2a65cc[_0x18b14f];if(_0x53f055[_0xf3f7('0x59')]===_0xf3f7('0x55')){var _0x2ffef3=_[_0xf3f7('0x4c')](_0x93a01,function(_0x456bed){return _0x456bed[_0xf3f7('0x68')]===_0x53f055['id'];});if(_0x2ffef3)_0x4b1c61[_0xf3f7('0x69')](_0x53f055);}else{_0x4b1c61[_0xf3f7('0x69')](_0x53f055);}}return _0x4b1c61;}});}else{return _0x2a65cc;}}else{var _0xfd7ac8=_[_0xf3f7('0x3e')](_0x2a65cc,function(_0x42edf5){if(_0x42edf5[_0xf3f7('0x59')]!==_0xf3f7('0x55')){return _0x42edf5;}});return _0xfd7ac8;}});}else{return _0x2a65cc;}}})[_0xf3f7('0x28')](function(_0x3f43b5){var _0x50a270=[];if(_0x3f43b5){_0x1730f5=_0x3f43b5;for(var _0x4c62d1=0x0;_0x4c62d1<_0x3f43b5['length'];_0x4c62d1+=0x1){_0x1730f5[_0x4c62d1][_0xf3f7('0x6a')]=[];_0x50a270[_0xf3f7('0x69')](db['ChatInternalMessage'][_0xf3f7('0x4c')]({'where':{'FromId':[_0x59f2bf['user']['id'],_0x3f43b5[_0x4c62d1]['id']],'ToId':[_0x59f2bf[_0xf3f7('0x57')]['id'],_0x3f43b5[_0x4c62d1]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xf3f7('0x6b'),_0xf3f7('0x6c'),_0xf3f7('0x6d'),_0xf3f7('0x4b')],'order':qs[_0xf3f7('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf3f7('0x28')](wrapUser(_0x3f43b5[_0x4c62d1])));}return BPromise[_0xf3f7('0x6e')](_0x50a270);}return[];})['then'](function(_0x505123){return{'rows':_0x505123,'count':_0x505123['length']};})['then'](respondWithResult(_0x582116,null))[_0xf3f7('0x46')](handleError(_0x582116,null));}; \ No newline at end of file +var _0x3431=['filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','create','body','find','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','push','ToId','-createdAt','all','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x2a1b86,_0x58ff06){var _0x33546b=function(_0x1cdf36){while(--_0x1cdf36){_0x2a1b86['push'](_0x2a1b86['shift']());}};_0x33546b(++_0x58ff06);}(_0x3431,0xfd));var _0x1343=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x3431[_0xa28b1a];return _0x4c9b78;};'use strict';var emlformat=require(_0x1343('0x0'));var rimraf=require(_0x1343('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1343('0x2'));var moment=require(_0x1343('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1343('0x4'));var util=require(_0x1343('0x5'));var path=require(_0x1343('0x6'));var sox=require(_0x1343('0x7'));var csv=require(_0x1343('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1343('0x9'));var _=require(_0x1343('0xa'));var squel=require('squel');var crypto=require(_0x1343('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1343('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1343('0xc'));var authService=require(_0x1343('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1343('0xe'));var logger=require(_0x1343('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x1343('0x10'));var licenseUtil=require(_0x1343('0x11'));var db=require(_0x1343('0x12'))['db'];config['redis']=_[_0x1343('0x13')](config[_0x1343('0x14')],{'host':_0x1343('0x15'),'port':0x18eb});var socket=require(_0x1343('0x16'))(new Redis(config[_0x1343('0x14')]));require(_0x1343('0x17'))[_0x1343('0x18')](socket);function respondWithStatusCode(_0x49f556,_0x1fcd2c){_0x1fcd2c=_0x1fcd2c||0xcc;return function(_0xf912dc){if(_0xf912dc){return _0x49f556['sendStatus'](_0x1fcd2c);}return _0x49f556[_0x1343('0x19')](_0x1fcd2c)[_0x1343('0x1a')]();};}function respondWithResult(_0x558ae8,_0x2b9c94){_0x2b9c94=_0x2b9c94||0xc8;return function(_0x4b953a){if(_0x4b953a){return _0x558ae8[_0x1343('0x19')](_0x2b9c94)[_0x1343('0x1b')](_0x4b953a);}};}function respondWithFilteredResult(_0x2b788e,_0x38388b){return function(_0x503022){if(_0x503022){var _0x2ac64f=typeof _0x38388b[_0x1343('0x1c')]===_0x1343('0x1d')&&typeof _0x38388b[_0x1343('0x1e')]===_0x1343('0x1d');var _0x3561c0=_0x503022['count'];var _0x526432=_0x2ac64f?0x0:_0x38388b[_0x1343('0x1c')];var _0x87afc=_0x2ac64f?_0x503022[_0x1343('0x1f')]:_0x38388b[_0x1343('0x1c')]+_0x38388b['limit'];var _0x22df3c;if(_0x87afc>=_0x3561c0){_0x87afc=_0x3561c0;_0x22df3c=0xc8;}else{_0x22df3c=0xce;}_0x2b788e[_0x1343('0x19')](_0x22df3c);return _0x2b788e[_0x1343('0x20')](_0x1343('0x21'),_0x526432+'-'+_0x87afc+'/'+_0x3561c0)[_0x1343('0x1b')](_0x503022);}return null;};}function patchUpdates(_0x9e1bc5){return function(_0x5dff77){try{jsonpatch['apply'](_0x5dff77,_0x9e1bc5,!![]);}catch(_0x55850f){return BPromise[_0x1343('0x22')](_0x55850f);}return _0x5dff77[_0x1343('0x23')]();};}function saveUpdates(_0x5b3dc7,_0x4788e4){return function(_0x16f160){if(_0x16f160){return _0x16f160[_0x1343('0x24')](_0x5b3dc7)[_0x1343('0x25')](function(_0x3be5fe){return _0x3be5fe;});}return null;};}function removeEntity(_0x3b93bc,_0xbe06fd){return function(_0x33ce25){if(_0x33ce25){return _0x33ce25[_0x1343('0x26')]()[_0x1343('0x25')](function(){_0x3b93bc[_0x1343('0x19')](0xcc)[_0x1343('0x1a')]();});}};}function handleEntityNotFound(_0x34b50c,_0xabb75d){return function(_0x4b2e64){if(!_0x4b2e64){_0x34b50c[_0x1343('0x27')](0x194);}return _0x4b2e64;};}function handleError(_0x382653,_0x35c9f7){_0x35c9f7=_0x35c9f7||0x1f4;return function(_0x1d2277){logger[_0x1343('0x28')](_0x1d2277[_0x1343('0x29')]);if(_0x1d2277[_0x1343('0x2a')]){delete _0x1d2277['name'];}_0x382653[_0x1343('0x19')](_0x35c9f7)[_0x1343('0x2b')](_0x1d2277);};}exports[_0x1343('0x2c')]=function(_0x3e316c,_0x2234bc){var _0x34e0c0={},_0x528d3e={},_0x4e0dae={'count':0x0,'rows':[]};var _0x1bc3d0=_[_0x1343('0x2d')](db[_0x1343('0x2e')]['rawAttributes'],function(_0x5b1c59){return{'name':_0x5b1c59[_0x1343('0x2f')],'type':_0x5b1c59[_0x1343('0x30')][_0x1343('0x31')]};});_0x528d3e[_0x1343('0x32')]=_[_0x1343('0x2d')](_0x1bc3d0,_0x1343('0x2a'));_0x528d3e[_0x1343('0x33')]=_[_0x1343('0x34')](_0x3e316c[_0x1343('0x33')]);_0x528d3e[_0x1343('0x35')]=_[_0x1343('0x36')](_0x528d3e[_0x1343('0x32')],_0x528d3e[_0x1343('0x33')]);_0x34e0c0[_0x1343('0x37')]=_[_0x1343('0x36')](_0x528d3e[_0x1343('0x32')],qs['fields'](_0x3e316c['query'][_0x1343('0x38')]));_0x34e0c0['attributes']=_0x34e0c0[_0x1343('0x37')]['length']?_0x34e0c0[_0x1343('0x37')]:_0x528d3e[_0x1343('0x32')];if(!_0x3e316c['query']['hasOwnProperty'](_0x1343('0x39'))){_0x34e0c0[_0x1343('0x1e')]=qs[_0x1343('0x1e')](_0x3e316c[_0x1343('0x33')][_0x1343('0x1e')]);_0x34e0c0[_0x1343('0x1c')]=qs[_0x1343('0x1c')](_0x3e316c[_0x1343('0x33')]['offset']);}_0x34e0c0[_0x1343('0x3a')]=qs[_0x1343('0x3b')](_0x3e316c[_0x1343('0x33')]['sort']);_0x34e0c0[_0x1343('0x3c')]=qs[_0x1343('0x35')](_[_0x1343('0x3d')](_0x3e316c['query'],_0x528d3e[_0x1343('0x35')]),_0x1bc3d0);if(_0x3e316c[_0x1343('0x33')][_0x1343('0x3e')]){_0x34e0c0[_0x1343('0x3c')]=_[_0x1343('0x3f')](_0x34e0c0[_0x1343('0x3c')],{'$or':_[_0x1343('0x2d')](_0x1bc3d0,function(_0x479864){if(_0x479864[_0x1343('0x30')]!==_0x1343('0x40')){var _0xf47e30={};_0xf47e30[_0x479864[_0x1343('0x2a')]]={'$like':'%'+_0x3e316c[_0x1343('0x33')][_0x1343('0x3e')]+'%'};return _0xf47e30;}})});}_0x34e0c0=_['merge']({},_0x34e0c0,_0x3e316c[_0x1343('0x41')]);var _0x3336b6={'where':_0x34e0c0[_0x1343('0x3c')]};return db[_0x1343('0x2e')][_0x1343('0x1f')](_0x3336b6)[_0x1343('0x25')](function(_0x19e9a8){_0x4e0dae['count']=_0x19e9a8;if(_0x3e316c[_0x1343('0x33')][_0x1343('0x42')]){_0x34e0c0[_0x1343('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x34e0c0);})[_0x1343('0x25')](function(_0x3452db){_0x4e0dae[_0x1343('0x44')]=_0x3452db;return _0x4e0dae;})['then'](respondWithFilteredResult(_0x2234bc,_0x34e0c0))['catch'](handleError(_0x2234bc,null));};exports[_0x1343('0x45')]=function(_0x248f60,_0x55307e){var _0x1ba198={'raw':!![],'where':{'id':_0x248f60[_0x1343('0x46')]['id']}},_0x17eb0f={};_0x17eb0f['model']=_[_0x1343('0x34')](db[_0x1343('0x2e')]['rawAttributes']);_0x17eb0f[_0x1343('0x33')]=_['keys'](_0x248f60['query']);_0x17eb0f[_0x1343('0x35')]=_[_0x1343('0x36')](_0x17eb0f['model'],_0x17eb0f[_0x1343('0x33')]);_0x1ba198[_0x1343('0x37')]=_[_0x1343('0x36')](_0x17eb0f['model'],qs[_0x1343('0x38')](_0x248f60[_0x1343('0x33')][_0x1343('0x38')]));_0x1ba198[_0x1343('0x37')]=_0x1ba198['attributes'][_0x1343('0x47')]?_0x1ba198[_0x1343('0x37')]:_0x17eb0f[_0x1343('0x32')];if(_0x248f60[_0x1343('0x33')][_0x1343('0x42')]){_0x1ba198['include']=[{'all':!![]}];}_0x1ba198=_[_0x1343('0x3f')]({},_0x1ba198,_0x248f60['options']);return db['ChatInternalMessage']['find'](_0x1ba198)[_0x1343('0x25')](handleEntityNotFound(_0x55307e,null))[_0x1343('0x25')](respondWithResult(_0x55307e,null))[_0x1343('0x48')](handleError(_0x55307e,null));};exports[_0x1343('0x49')]=function(_0x12deb1,_0x115083){return db[_0x1343('0x2e')][_0x1343('0x49')](_0x12deb1[_0x1343('0x4a')],{})[_0x1343('0x25')](respondWithResult(_0x115083,0xc9))[_0x1343('0x48')](handleError(_0x115083,null));};exports[_0x1343('0x24')]=function(_0x131f3c,_0x4bd890){if(_0x131f3c['body']['id']){delete _0x131f3c['body']['id'];}return db[_0x1343('0x2e')]['find']({'where':{'id':_0x131f3c['params']['id']}})[_0x1343('0x25')](handleEntityNotFound(_0x4bd890,null))[_0x1343('0x25')](saveUpdates(_0x131f3c['body'],null))[_0x1343('0x25')](respondWithResult(_0x4bd890,null))['catch'](handleError(_0x4bd890,null));};exports['destroy']=function(_0x1d46d6,_0x545228){return db[_0x1343('0x2e')][_0x1343('0x4b')]({'where':{'id':_0x1d46d6[_0x1343('0x46')]['id']}})['then'](handleEntityNotFound(_0x545228,null))[_0x1343('0x25')](removeEntity(_0x545228,null))['catch'](handleError(_0x545228,null));};exports['describe']=function(_0x53afd5,_0x2de8c3){return db[_0x1343('0x2e')]['describe']()['then'](respondWithResult(_0x2de8c3,null))[_0x1343('0x48')](handleError(_0x2de8c3,null));};function wrapUser(_0x4ada40){return function(_0x50d411){var _0x207a4f=_0x4ada40['get']({'plain':!![]});_0x207a4f[_0x1343('0x4c')]=[];if(_0x50d411){_0x207a4f[_0x1343('0x4d')]=_0x50d411[_0x1343('0x4e')];_0x207a4f['lastMessage']=_0x50d411;}else{_0x207a4f['lastMessageAt']=moment(0x0)[_0x1343('0x4f')](_0x1343('0x50'));_0x207a4f[_0x1343('0x51')]={};}return _0x207a4f;};}exports[_0x1343('0x52')]=function(_0x1ac6ca,_0x23aa9e,_0x299fe9){var _0x20a68d=[];return db[_0x1343('0x53')][_0x1343('0x54')]({'where':{'role':[_0x1343('0x55'),_0x1343('0x56'),_0x1343('0x57')]},'attributes':['id','fullname','name',_0x1343('0x58'),_0x1343('0x59'),_0x1343('0x5a'),_0x1343('0x5b'),_0x1343('0x5c'),_0x1343('0x5d'),_0x1343('0x5e')],'order':qs['sort'](_0x1343('0x5f')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x1343('0x30')],'through':{'attributes':[]}}]})[_0x1343('0x25')](function(_0x694790){if(_0x694790){var _0x21576c=_0x1ac6ca[_0x1343('0x57')][_0x1343('0x60')]({'plain':!![]});if(!_0x21576c)throw new Error(_0x1343('0x61'));if(_0x21576c[_0x1343('0x58')]===_0x1343('0x57')){return db[_0x1343('0x62')][_0x1343('0x4b')]({'where':{'name':_0x1343('0x63'),'userProfileId':_0x21576c['userProfileId']},'raw':!![]})['then'](function(_0x3b6ca8){if(_0x3b6ca8){if(_0x3b6ca8['autoAssociation']===0x0){return db[_0x1343('0x64')][_0x1343('0x54')]({'where':{'sectionId':_0x3b6ca8['id']},'raw':!![]})['then'](function(_0x53f705){var _0x3a6997=[];if(_['isEmpty'](_0x53f705)){_0x3a6997=_[_0x1343('0x3e')](_0x694790,function(_0x39227e){if(_0x39227e[_0x1343('0x58')]!==_0x1343('0x55')){return _0x39227e;}});return _0x3a6997;}else{for(var _0xb228bb=0x0;_0xb228bb<_0x694790['length'];_0xb228bb++){var _0x322bfa=_0x694790[_0xb228bb];if(_0x322bfa[_0x1343('0x58')]===_0x1343('0x55')){var _0x2a02c8=_[_0x1343('0x4b')](_0x53f705,function(_0x27cf55){return _0x27cf55['resourceId']===_0x322bfa['id'];});if(_0x2a02c8)_0x3a6997['push'](_0x322bfa);}else{_0x3a6997[_0x1343('0x65')](_0x322bfa);}}return _0x3a6997;}});}else{return _0x694790;}}else{var _0x44c44a=_[_0x1343('0x3e')](_0x694790,function(_0x49ea16){if(_0x49ea16[_0x1343('0x58')]!==_0x1343('0x55')){return _0x49ea16;}});return _0x44c44a;}});}else{return _0x694790;}}})['then'](function(_0x46e16b){var _0x1fd55d=[];if(_0x46e16b){_0x20a68d=_0x46e16b;for(var _0x2f0541=0x0;_0x2f0541<_0x46e16b[_0x1343('0x47')];_0x2f0541+=0x1){_0x20a68d[_0x2f0541][_0x1343('0x4c')]=[];_0x1fd55d[_0x1343('0x65')](db['ChatInternalMessage'][_0x1343('0x4b')]({'where':{'FromId':[_0x1ac6ca[_0x1343('0x57')]['id'],_0x46e16b[_0x2f0541]['id']],'ToId':[_0x1ac6ca[_0x1343('0x57')]['id'],_0x46e16b[_0x2f0541]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x1343('0x66'),'read','body'],'order':qs[_0x1343('0x3b')](_0x1343('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x46e16b[_0x2f0541])));}return BPromise[_0x1343('0x68')](_0x1fd55d);}return[];})[_0x1343('0x25')](function(_0x4297d3){return{'rows':_0x4297d3,'count':_0x4297d3['length']};})[_0x1343('0x25')](respondWithResult(_0x23aa9e,null))[_0x1343('0x48')](handleError(_0x23aa9e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7723c78..4ad91d3 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 _0x4668=['setMaxListeners','update','emit','hasOwnProperty','hook','events','ChatInternalMessage'];(function(_0x268790,_0x23ed2){var _0x5e3108=function(_0xbb9dbc){while(--_0xbb9dbc){_0x268790['push'](_0x268790['shift']());}};_0x5e3108(++_0x23ed2);}(_0x4668,0x101));var _0x8466=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4668[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x8466('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x8466('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8466('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8466('0x3'),'afterDestroy':'remove'};function emitEvent(_0x42537a){return function(_0x17a455,_0x531c2a,_0x4b702a){ChatInternalMessageEvents[_0x8466('0x4')](_0x42537a+':'+_0x17a455['id'],_0x17a455);ChatInternalMessageEvents[_0x8466('0x4')](_0x42537a,_0x17a455);_0x4b702a(null);};}for(var e in events){if(events[_0x8466('0x5')](e)){var event=events[e];ChatInternalMessage[_0x8466('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xd2f0=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x1406cc,_0x324383){var _0x19ea2e=function(_0x145dd6){while(--_0x145dd6){_0x1406cc['push'](_0x1406cc['shift']());}};_0x19ea2e(++_0x324383);}(_0xd2f0,0x13f));var _0x0d2f=function(_0x530538,_0x4e46d4){_0x530538=_0x530538-0x0;var _0x47b2a1=_0xd2f0[_0x530538];return _0x47b2a1;};'use strict';var EventEmitter=require(_0x0d2f('0x0'));var ChatInternalMessage=require(_0x0d2f('0x1'))['db'][_0x0d2f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0d2f('0x3')](0x0);var events={'afterCreate':_0x0d2f('0x4'),'afterUpdate':_0x0d2f('0x5'),'afterDestroy':_0x0d2f('0x6')};function emitEvent(_0x4389ac){return function(_0x3927f4,_0x1e6e66,_0x4467c1){ChatInternalMessageEvents['emit'](_0x4389ac+':'+_0x3927f4['id'],_0x3927f4);ChatInternalMessageEvents[_0x0d2f('0x7')](_0x4389ac,_0x3927f4);_0x4467c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0d2f('0x8')](e,emitEvent(event));}}module[_0x0d2f('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 83ec7ec..f519a27 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 _0x520f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x520f,0x1b2));var _0xf520=function(_0xadd0d2,_0x3bf5b9){_0xadd0d2=_0xadd0d2-0x0;var _0x2d564c=_0x520f[_0xadd0d2];return _0x2d564c;};'use strict';var _=require(_0xf520('0x0'));var util=require(_0xf520('0x1'));var logger=require(_0xf520('0x2'))('api');var moment=require(_0xf520('0x3'));var BPromise=require(_0xf520('0x4'));var rp=require(_0xf520('0x5'));var fs=require('fs');var path=require(_0xf520('0x6'));var rimraf=require('rimraf');var config=require(_0xf520('0x7'));var attributes=require(_0xf520('0x8'));module['exports']=function(_0x435e23,_0x4cb34e){return _0x435e23[_0xf520('0x9')](_0xf520('0xa'),attributes,{'tableName':_0xf520('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf520('0xc'),'collate':_0xf520('0xd')});}; \ No newline at end of file +var _0x3d4d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1e3cc1,_0x458765){var _0x28fea1=function(_0x3bc9a4){while(--_0x3bc9a4){_0x1e3cc1['push'](_0x1e3cc1['shift']());}};_0x28fea1(++_0x458765);}(_0x3d4d,0x18d));var _0xd3d4=function(_0x399333,_0xbcfa38){_0x399333=_0x399333-0x0;var _0x8733a=_0x3d4d[_0x399333];return _0x8733a;};'use strict';var _=require(_0xd3d4('0x0'));var util=require(_0xd3d4('0x1'));var logger=require('../../config/logger')(_0xd3d4('0x2'));var moment=require(_0xd3d4('0x3'));var BPromise=require(_0xd3d4('0x4'));var rp=require(_0xd3d4('0x5'));var fs=require('fs');var path=require(_0xd3d4('0x6'));var rimraf=require(_0xd3d4('0x7'));var config=require(_0xd3d4('0x8'));var attributes=require(_0xd3d4('0x9'));module[_0xd3d4('0xa')]=function(_0x53661a,_0x10d2e9){return _0x53661a[_0xd3d4('0xb')](_0xd3d4('0xc'),attributes,{'tableName':_0xd3d4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd3d4('0xe'),'collate':_0xd3d4('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 56a362d..9710ec4 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 _0x3731=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','request'];(function(_0x10792c,_0x112ee2){var _0x2594eb=function(_0xff9fde){while(--_0xff9fde){_0x10792c['push'](_0x10792c['shift']());}};_0x2594eb(++_0x112ee2);}(_0x3731,0xba));var _0x1373=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3731[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1373('0x0'));var util=require('util');var moment=require(_0x1373('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1373('0x2'));var logger=require(_0x1373('0x3'))(_0x1373('0x4'));var config=require(_0x1373('0x5'));var jayson=require(_0x1373('0x6'));var client=jayson['client'][_0x1373('0x7')]({'port':0x232a});config[_0x1373('0x8')]=_[_0x1373('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1373('0xa'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x37ae78,_0x2e4c06,_0x2d72fd){return new BPromise(function(_0x248c27,_0x45e39d){return client[_0x1373('0xb')](_0x37ae78,_0x2d72fd)[_0x1373('0xc')](function(_0x46e0ce){logger[_0x1373('0xd')](_0x1373('0xe'),_0x2e4c06,_0x1373('0xf'));logger[_0x1373('0x10')](_0x1373('0x11'),_0x2e4c06,_0x1373('0xf'),JSON['stringify'](_0x46e0ce));if(_0x46e0ce['error']){if(_0x46e0ce[_0x1373('0x12')][_0x1373('0x13')]===0x1f4){logger[_0x1373('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x2e4c06,_0x46e0ce['error'][_0x1373('0x14')]);return _0x45e39d(_0x46e0ce[_0x1373('0x12')][_0x1373('0x14')]);}logger[_0x1373('0x12')](_0x1373('0xe'),_0x2e4c06,_0x46e0ce[_0x1373('0x12')]['message']);return _0x248c27(_0x46e0ce[_0x1373('0x12')]['message']);}else{logger[_0x1373('0xd')](_0x1373('0xe'),_0x2e4c06,'request\x20sent');_0x248c27(_0x46e0ce[_0x1373('0x15')][_0x1373('0x14')]);}})['catch'](function(_0xc3dd56){logger['error'](_0x1373('0xe'),_0x2e4c06,_0xc3dd56);_0x45e39d(_0xc3dd56);});});} \ No newline at end of file +var _0x16c6=['error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x16c6,0x18d));var _0x616c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x16c6[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x616c('0x0'));var util=require('util');var moment=require(_0x616c('0x1'));var BPromise=require(_0x616c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x616c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x616c('0x4'));var logger=require(_0x616c('0x5'))(_0x616c('0x6'));var config=require(_0x616c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x616c('0x8')]({'port':0x232a});config[_0x616c('0x9')]=_[_0x616c('0xa')](config[_0x616c('0x9')],{'host':_0x616c('0xb'),'port':0x18eb});var socket=require(_0x616c('0xc'))(new Redis(config['redis']));require(_0x616c('0xd'))[_0x616c('0xe')](socket);function respondWithRpcPromise(_0x39a811,_0x5c7484,_0x3edcfa){return new BPromise(function(_0x257bce,_0x1404c2){return client[_0x616c('0xf')](_0x39a811,_0x3edcfa)[_0x616c('0x10')](function(_0x3d88e6){logger[_0x616c('0x11')](_0x616c('0x12'),_0x5c7484,'request\x20sent');logger[_0x616c('0x13')](_0x616c('0x14'),_0x5c7484,_0x616c('0x15'),JSON[_0x616c('0x16')](_0x3d88e6));if(_0x3d88e6[_0x616c('0x17')]){if(_0x3d88e6[_0x616c('0x17')][_0x616c('0x18')]===0x1f4){logger['error'](_0x616c('0x12'),_0x5c7484,_0x3d88e6['error']['message']);return _0x1404c2(_0x3d88e6['error'][_0x616c('0x19')]);}logger[_0x616c('0x17')](_0x616c('0x12'),_0x5c7484,_0x3d88e6[_0x616c('0x17')][_0x616c('0x19')]);return _0x257bce(_0x3d88e6['error'][_0x616c('0x19')]);}else{logger['info'](_0x616c('0x12'),_0x5c7484,'request\x20sent');_0x257bce(_0x3d88e6[_0x616c('0x1a')][_0x616c('0x19')]);}})[_0x616c('0x1b')](function(_0x2d38f8){logger[_0x616c('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x5c7484,_0x2d38f8);_0x1404c2(_0x2d38f8);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 804c8b3..286ff48 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 _0x8b64=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x8b64,0xb4));var _0x48b6=function(_0x20ecec,_0x54a52f){_0x20ecec=_0x20ecec-0x0;var _0x5c669d=_0x8b64[_0x20ecec];return _0x5c669d;};'use strict';var ChatInternalMessageEvents=require(_0x48b6('0x0'));var events=[_0x48b6('0x1'),'remove',_0x48b6('0x2')];function createListener(_0x9738d,_0x227b4b){return function(_0x16f243){_0x227b4b['emit'](_0x9738d,_0x16f243);};}function removeListener(_0x29b186,_0x5b9eda){return function(){ChatInternalMessageEvents[_0x48b6('0x3')](_0x29b186,_0x5b9eda);};}exports[_0x48b6('0x4')]=function(_0x1d4192){for(var _0x561a1f=0x0,_0x522cd5=events[_0x48b6('0x5')];_0x561a1f<_0x522cd5;_0x561a1f++){var _0x507713=events[_0x561a1f];var _0x1d9fd5=createListener(_0x48b6('0x6')+_0x507713,_0x1d4192);ChatInternalMessageEvents['on'](_0x507713,_0x1d9fd5);}}; \ No newline at end of file +var _0xe1cd=['length','./chatInternalMessage.events','save','remove','update','removeListener'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xe1cd,0x175));var _0xde1c=function(_0x489413,_0xea1c39){_0x489413=_0x489413-0x0;var _0x22d38e=_0xe1cd[_0x489413];return _0x22d38e;};'use strict';var ChatInternalMessageEvents=require(_0xde1c('0x0'));var events=[_0xde1c('0x1'),_0xde1c('0x2'),_0xde1c('0x3')];function createListener(_0x1f3f23,_0x5b6d56){return function(_0x3841fd){_0x5b6d56['emit'](_0x1f3f23,_0x3841fd);};}function removeListener(_0x55996e,_0x30e60d){return function(){ChatInternalMessageEvents[_0xde1c('0x4')](_0x55996e,_0x30e60d);};}exports['register']=function(_0x5a1f11){for(var _0x25b398=0x0,_0x1f60df=events[_0xde1c('0x5')];_0x25b398<_0x1f60df;_0x25b398++){var _0xe515c1=events[_0x25b398];var _0x457850=createListener('chatInternalMessage:'+_0xe515c1,_0x5a1f11);ChatInternalMessageEvents['on'](_0xe515c1,_0x457850);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 432bf53..5e3a51d 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 _0xad74=['post','create','put','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0xad74,0x17e));var _0x4ad7=function(_0x34480a,_0x162f49){_0x34480a=_0x34480a-0x0;var _0x47f40d=_0xad74[_0x34480a];return _0x47f40d;};'use strict';var multer=require(_0x4ad7('0x0'));var util=require(_0x4ad7('0x1'));var path=require(_0x4ad7('0x2'));var timeout=require(_0x4ad7('0x3'));var express=require('express');var router=express[_0x4ad7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ad7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4ad7('0x6'));var controller=require(_0x4ad7('0x7'));router[_0x4ad7('0x8')]('/',auth[_0x4ad7('0x9')](),controller[_0x4ad7('0xa')]);router[_0x4ad7('0x8')](_0x4ad7('0xb'),auth[_0x4ad7('0x9')](),controller[_0x4ad7('0xc')]);router[_0x4ad7('0x8')](_0x4ad7('0xd'),auth[_0x4ad7('0x9')](),controller[_0x4ad7('0xe')]);router['get'](_0x4ad7('0xf'),auth[_0x4ad7('0x9')](),controller[_0x4ad7('0x10')]);router[_0x4ad7('0x11')]('/',auth[_0x4ad7('0x9')](),controller[_0x4ad7('0x12')]);router[_0x4ad7('0x13')](_0x4ad7('0xf'),controller['update']);router[_0x4ad7('0x14')](_0x4ad7('0xf'),auth[_0x4ad7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6902=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','/:id','update'];(function(_0x57d6e4,_0x8eb6e9){var _0x92c962=function(_0xfcf8be){while(--_0xfcf8be){_0x57d6e4['push'](_0x57d6e4['shift']());}};_0x92c962(++_0x8eb6e9);}(_0x6902,0x145));var _0x2690=function(_0x22d9e9,_0x6f5066){_0x22d9e9=_0x22d9e9-0x0;var _0x26a963=_0x6902[_0x22d9e9];return _0x26a963;};'use strict';var multer=require(_0x2690('0x0'));var util=require('util');var path=require(_0x2690('0x1'));var timeout=require('connect-timeout');var express=require(_0x2690('0x2'));var router=express[_0x2690('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2690('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2690('0x5'));var controller=require(_0x2690('0x6'));router[_0x2690('0x7')]('/',auth[_0x2690('0x8')](),controller[_0x2690('0x9')]);router[_0x2690('0x7')](_0x2690('0xa'),auth[_0x2690('0x8')](),controller[_0x2690('0xb')]);router[_0x2690('0x7')](_0x2690('0xc'),auth[_0x2690('0x8')](),controller[_0x2690('0xd')]);router[_0x2690('0x7')]('/:id',auth[_0x2690('0x8')](),controller[_0x2690('0xe')]);router[_0x2690('0xf')]('/',auth[_0x2690('0x8')](),controller[_0x2690('0x10')]);router[_0x2690('0x11')](_0x2690('0x12'),controller[_0x2690('0x13')]);router[_0x2690('0x14')](_0x2690('0x12'),auth[_0x2690('0x8')](),controller[_0x2690('0x15')]);module[_0x2690('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 4f9b4e2..869ca25 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 _0x263f=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0xddbc76,_0x4838a1){var _0x3d9eec=function(_0x2344e7){while(--_0x2344e7){_0xddbc76['push'](_0xddbc76['shift']());}};_0x3d9eec(++_0x4838a1);}(_0x263f,0x182));var _0xf263=function(_0x356c3e,_0x50dffc){_0x356c3e=_0x356c3e-0x0;var _0x562c2d=_0x263f[_0x356c3e];return _0x562c2d;};'use strict';var Sequelize=require(_0xf263('0x0'));module[_0xf263('0x1')]={'body':{'type':Sequelize[_0xf263('0x2')](_0xf263('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf263('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf263('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf263('0x5')),'defaultValue':_0xf263('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf263('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf263('0x2')]}}; \ No newline at end of file +var _0x36ee=['ENUM','out','DATE','STRING','TEXT','BOOLEAN'];(function(_0x372ae9,_0x41ebad){var _0x123083=function(_0x515b14){while(--_0x515b14){_0x372ae9['push'](_0x372ae9['shift']());}};_0x123083(++_0x41ebad);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xe36e('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe36e('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe36e('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe36e('0x2')]('in',_0xe36e('0x3')),'defaultValue':_0xe36e('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe36e('0x4')]},'providerName':{'type':Sequelize[_0xe36e('0x5')]},'providerResponse':{'type':Sequelize[_0xe36e('0x0')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index fd04412..16f4bd5 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 _0xde26=['./chatMessage.socket','register','jayson/promise','http','request','then','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update','end','stack','name','send','index','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','ChatMessage','includeAll','show','params','rawAttributes','include','create','body','destroy','find','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','parse','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','formData','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost'];(function(_0x4f0a61,_0x1df9a7){var _0x447ea6=function(_0x22577e){while(--_0x22577e){_0x4f0a61['push'](_0x4f0a61['shift']());}};_0x447ea6(++_0x1df9a7);}(_0xde26,0x69));var _0x6de2=function(_0x4a42f0,_0x2da65d){_0x4a42f0=_0x4a42f0-0x0;var _0x3dc532=_0xde26[_0x4a42f0];return _0x3dc532;};'use strict';var emlformat=require(_0x6de2('0x0'));var rimraf=require(_0x6de2('0x1'));var zipdir=require(_0x6de2('0x2'));var jsonpatch=require(_0x6de2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6de2('0x4'));var Mustache=require(_0x6de2('0x5'));var util=require(_0x6de2('0x6'));var path=require('path');var sox=require(_0x6de2('0x7'));var csv=require(_0x6de2('0x8'));var ejs=require(_0x6de2('0x9'));var fs=require('fs');var fs_extra=require(_0x6de2('0xa'));var _=require(_0x6de2('0xb'));var squel=require(_0x6de2('0xc'));var crypto=require(_0x6de2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6de2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6de2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6de2('0x10'));var qs=require(_0x6de2('0x11'));var as=require(_0x6de2('0x12'));var hardwareService=require(_0x6de2('0x13'));var logger=require(_0x6de2('0x14'))(_0x6de2('0x15'));var utils=require(_0x6de2('0x16'));var config=require(_0x6de2('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6de2('0x18')]=_[_0x6de2('0x19')](config[_0x6de2('0x18')],{'host':_0x6de2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6de2('0x18')]));require(_0x6de2('0x1b'))[_0x6de2('0x1c')](socket);var jayson=require(_0x6de2('0x1d'));var client=jayson['client'][_0x6de2('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x6de2('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4c921a,_0x3240d0,_0x507775,_0x258f16){return new BPromise(function(_0x37bb56,_0x4bd8f8){var _0x38c260=_0x258f16||client;return _0x38c260[_0x6de2('0x1f')](_0x4c921a,_0x507775)[_0x6de2('0x20')](function(_0x51a69a){logger['info'](_0x6de2('0x21'),_0x3240d0,'request\x20sent');logger['debug'](_0x6de2('0x22'),_0x3240d0,_0x6de2('0x23'),JSON[_0x6de2('0x24')](_0x51a69a));if(_0x51a69a['error']){if(_0x51a69a[_0x6de2('0x25')][_0x6de2('0x26')]===0x1f4){logger['error'](_0x6de2('0x21'),_0x3240d0,_0x51a69a[_0x6de2('0x25')][_0x6de2('0x27')]);return _0x4bd8f8(_0x51a69a[_0x6de2('0x25')][_0x6de2('0x27')]);}logger[_0x6de2('0x25')](_0x6de2('0x21'),_0x3240d0,_0x51a69a[_0x6de2('0x25')][_0x6de2('0x27')]);return _0x37bb56(_0x51a69a['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3240d0,_0x6de2('0x23'));_0x37bb56(_0x51a69a[_0x6de2('0x28')][_0x6de2('0x27')]);}})[_0x6de2('0x29')](function(_0x445b2e){logger[_0x6de2('0x25')](_0x6de2('0x21'),_0x3240d0,_0x445b2e);_0x4bd8f8(_0x445b2e);});});}function respondWithStatusCode(_0x1ed14e,_0x24d87a){_0x24d87a=_0x24d87a||0xcc;return function(_0x49168){if(_0x49168){return _0x1ed14e[_0x6de2('0x2a')](_0x24d87a);}return _0x1ed14e[_0x6de2('0x2b')](_0x24d87a)['end']();};}function respondWithResult(_0x501cee,_0x4ae355){_0x4ae355=_0x4ae355||0xc8;return function(_0x4731f7){if(_0x4731f7){return _0x501cee[_0x6de2('0x2b')](_0x4ae355)[_0x6de2('0x2c')](_0x4731f7);}};}function respondWithFilteredResult(_0x3c7409,_0x317676){return function(_0x36c422){if(_0x36c422){var _0x2ccf3d=typeof _0x317676[_0x6de2('0x2d')]===_0x6de2('0x2e')&&typeof _0x317676[_0x6de2('0x2f')]==='undefined';var _0x29cc9d=_0x36c422[_0x6de2('0x30')];var _0x338fae=_0x2ccf3d?0x0:_0x317676[_0x6de2('0x2d')];var _0x354cc2=_0x2ccf3d?_0x36c422['count']:_0x317676[_0x6de2('0x2d')]+_0x317676[_0x6de2('0x2f')];var _0x1a38d2;if(_0x354cc2>=_0x29cc9d){_0x354cc2=_0x29cc9d;_0x1a38d2=0xc8;}else{_0x1a38d2=0xce;}_0x3c7409[_0x6de2('0x2b')](_0x1a38d2);return _0x3c7409['set']('Content-Range',_0x338fae+'-'+_0x354cc2+'/'+_0x29cc9d)[_0x6de2('0x2c')](_0x36c422);}return null;};}function patchUpdates(_0x2bf1e2){return function(_0x2f2cd6){try{jsonpatch[_0x6de2('0x31')](_0x2f2cd6,_0x2bf1e2,!![]);}catch(_0x33b03e){return BPromise[_0x6de2('0x32')](_0x33b03e);}return _0x2f2cd6['save']();};}function saveUpdates(_0xfd6553,_0x4c8a31){return function(_0x58e760){if(_0x58e760){return _0x58e760[_0x6de2('0x33')](_0xfd6553)['then'](function(_0x32b07c){return _0x32b07c;});}return null;};}function removeEntity(_0x5d82dd,_0x4866c6){return function(_0x52c8c8){if(_0x52c8c8){return _0x52c8c8['destroy']()['then'](function(){_0x5d82dd[_0x6de2('0x2b')](0xcc)[_0x6de2('0x34')]();});}};}function handleEntityNotFound(_0x58f258,_0x21ba4f){return function(_0x2bd30f){if(!_0x2bd30f){_0x58f258[_0x6de2('0x2a')](0x194);}return _0x2bd30f;};}function handleError(_0x5dc00b,_0x42c820){_0x42c820=_0x42c820||0x1f4;return function(_0x15cb5e){logger[_0x6de2('0x25')](_0x15cb5e[_0x6de2('0x35')]);if(_0x15cb5e[_0x6de2('0x36')]){delete _0x15cb5e[_0x6de2('0x36')];}_0x5dc00b[_0x6de2('0x2b')](_0x42c820)[_0x6de2('0x37')](_0x15cb5e);};}exports[_0x6de2('0x38')]=function(_0x4ad952,_0x4dddd6){var _0x319630={},_0x48c399={},_0x108610={'count':0x0,'rows':[]};var _0x595208=_['map'](db['ChatMessage']['rawAttributes'],function(_0x40d62d){return{'name':_0x40d62d[_0x6de2('0x39')],'type':_0x40d62d[_0x6de2('0x3a')][_0x6de2('0x3b')]};});_0x48c399[_0x6de2('0x3c')]=_[_0x6de2('0x3d')](_0x595208,_0x6de2('0x36'));_0x48c399['query']=_[_0x6de2('0x3e')](_0x4ad952['query']);_0x48c399[_0x6de2('0x3f')]=_['intersection'](_0x48c399['model'],_0x48c399[_0x6de2('0x40')]);_0x319630[_0x6de2('0x41')]=_[_0x6de2('0x42')](_0x48c399[_0x6de2('0x3c')],qs['fields'](_0x4ad952[_0x6de2('0x40')][_0x6de2('0x43')]));_0x319630[_0x6de2('0x41')]=_0x319630[_0x6de2('0x41')]['length']?_0x319630[_0x6de2('0x41')]:_0x48c399[_0x6de2('0x3c')];if(!_0x4ad952[_0x6de2('0x40')][_0x6de2('0x44')](_0x6de2('0x45'))){_0x319630['limit']=qs[_0x6de2('0x2f')](_0x4ad952[_0x6de2('0x40')][_0x6de2('0x2f')]);_0x319630[_0x6de2('0x2d')]=qs[_0x6de2('0x2d')](_0x4ad952[_0x6de2('0x40')][_0x6de2('0x2d')]);}_0x319630[_0x6de2('0x46')]=qs[_0x6de2('0x47')](_0x4ad952[_0x6de2('0x40')]['sort']);_0x319630['where']=qs['filters'](_['pick'](_0x4ad952[_0x6de2('0x40')],_0x48c399[_0x6de2('0x3f')]),_0x595208);if(_0x4ad952[_0x6de2('0x40')]['filter']){_0x319630[_0x6de2('0x48')]=_['merge'](_0x319630[_0x6de2('0x48')],{'$or':_['map'](_0x595208,function(_0x4e2906){if(_0x4e2906['type']!==_0x6de2('0x49')){var _0x1db23d={};_0x1db23d[_0x4e2906[_0x6de2('0x36')]]={'$like':'%'+_0x4ad952[_0x6de2('0x40')][_0x6de2('0x4a')]+'%'};return _0x1db23d;}})});}_0x319630=_[_0x6de2('0x4b')]({},_0x319630,_0x4ad952[_0x6de2('0x4c')]);var _0x2ed357={'where':_0x319630['where']};return db[_0x6de2('0x4d')][_0x6de2('0x30')](_0x2ed357)['then'](function(_0x36accd){_0x108610[_0x6de2('0x30')]=_0x36accd;if(_0x4ad952['query'][_0x6de2('0x4e')]){_0x319630['include']=[{'all':!![]}];}return db[_0x6de2('0x4d')]['findAll'](_0x319630);})['then'](function(_0x5e920a){_0x108610['rows']=_0x5e920a;return _0x108610;})[_0x6de2('0x20')](respondWithFilteredResult(_0x4dddd6,_0x319630))['catch'](handleError(_0x4dddd6,null));};exports[_0x6de2('0x4f')]=function(_0x2de905,_0x123678){var _0x2ee7bd={'raw':!![],'where':{'id':_0x2de905[_0x6de2('0x50')]['id']}},_0x39babb={};_0x39babb[_0x6de2('0x3c')]=_[_0x6de2('0x3e')](db[_0x6de2('0x4d')][_0x6de2('0x51')]);_0x39babb[_0x6de2('0x40')]=_[_0x6de2('0x3e')](_0x2de905[_0x6de2('0x40')]);_0x39babb['filters']=_['intersection'](_0x39babb['model'],_0x39babb['query']);_0x2ee7bd['attributes']=_[_0x6de2('0x42')](_0x39babb[_0x6de2('0x3c')],qs[_0x6de2('0x43')](_0x2de905[_0x6de2('0x40')][_0x6de2('0x43')]));_0x2ee7bd[_0x6de2('0x41')]=_0x2ee7bd['attributes']['length']?_0x2ee7bd[_0x6de2('0x41')]:_0x39babb[_0x6de2('0x3c')];if(_0x2de905[_0x6de2('0x40')][_0x6de2('0x4e')]){_0x2ee7bd[_0x6de2('0x52')]=[{'all':!![]}];}_0x2ee7bd=_[_0x6de2('0x4b')]({},_0x2ee7bd,_0x2de905[_0x6de2('0x4c')]);return db[_0x6de2('0x4d')]['find'](_0x2ee7bd)[_0x6de2('0x20')](handleEntityNotFound(_0x123678,null))[_0x6de2('0x20')](respondWithResult(_0x123678,null))[_0x6de2('0x29')](handleError(_0x123678,null));};exports['create']=function(_0x49031d,_0x30d14b){return db[_0x6de2('0x4d')][_0x6de2('0x53')](_0x49031d[_0x6de2('0x54')],{})['then'](respondWithResult(_0x30d14b,0xc9))[_0x6de2('0x29')](handleError(_0x30d14b,null));};exports[_0x6de2('0x33')]=function(_0x550c70,_0x1945f2){if(_0x550c70[_0x6de2('0x54')]['id']){delete _0x550c70[_0x6de2('0x54')]['id'];}return db[_0x6de2('0x4d')]['find']({'where':{'id':_0x550c70[_0x6de2('0x50')]['id']}})[_0x6de2('0x20')](handleEntityNotFound(_0x1945f2,null))['then'](saveUpdates(_0x550c70[_0x6de2('0x54')],null))['then'](respondWithResult(_0x1945f2,null))['catch'](handleError(_0x1945f2,null));};exports[_0x6de2('0x55')]=function(_0x1c24e0,_0x38671d){return db[_0x6de2('0x4d')][_0x6de2('0x56')]({'where':{'id':_0x1c24e0[_0x6de2('0x50')]['id']}})[_0x6de2('0x20')](handleEntityNotFound(_0x38671d,null))['then'](removeEntity(_0x38671d,null))['catch'](handleError(_0x38671d,null));};exports[_0x6de2('0x57')]=function(_0x2411af,_0x28e5e4){return db[_0x6de2('0x4d')][_0x6de2('0x57')]()[_0x6de2('0x20')](respondWithResult(_0x28e5e4,null))[_0x6de2('0x29')](handleError(_0x28e5e4,null));};var interaction_log=require(_0x6de2('0x14'))(_0x6de2('0x58'));exports['accept']=function(_0x56e5c8,_0x1cbaa3,_0x56012){var _0x578d11={'agent':{},'channel':_0x6de2('0x59')};if(_0x56e5c8[_0x6de2('0x54')]['id']){delete _0x56e5c8[_0x6de2('0x54')]['id'];}_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5a')]=!![];_0x56e5c8['body'][_0x6de2('0x5b')]=moment()[_0x6de2('0x5c')](_0x6de2('0x5d'));_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')]=_0x56e5c8[_0x6de2('0x54')]['UserId']||_0x56e5c8[_0x6de2('0x5f')]['id'];_0x578d11[_0x6de2('0x60')]['id']=_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')];return db[_0x6de2('0x4d')][_0x6de2('0x56')]({'where':{'id':_0x56e5c8[_0x6de2('0x50')]['id'],'UserId':null}})[_0x6de2('0x20')](handleEntityNotFound(_0x1cbaa3,null))['then'](saveUpdates(_0x56e5c8[_0x6de2('0x54')],null))[_0x6de2('0x20')](function(_0x3b4381){if(_0x3b4381){_0x578d11[_0x6de2('0x27')]=_0x3b4381[_0x6de2('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x6de2('0x56')]({'where':{'id':_0x3b4381[_0x6de2('0x62')]}});}return null;})[_0x6de2('0x20')](handleEntityNotFound(_0x1cbaa3,null))['then'](function(_0x31c81e){if(_0x31c81e){return _0x31c81e[_0x6de2('0x33')]({'UserId':_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')],'read1stAt':_['isNil'](_0x31c81e[_0x6de2('0x63')])?moment()[_0x6de2('0x5c')](_0x6de2('0x5d')):undefined});}return null;})[_0x6de2('0x20')](function(_0x134502){if(_0x134502){_0x578d11[_0x6de2('0x64')]=_0x134502[_0x6de2('0x61')]({'plain':!![]});interaction_log[_0x6de2('0x65')](_0x6de2('0x66'),_0x56e5c8[_0x6de2('0x5f')]['id'],_0x56e5c8[_0x6de2('0x5f')][_0x6de2('0x36')],_0x56e5c8['user'][_0x6de2('0x67')],_0x578d11[_0x6de2('0x64')]['id'],_0x56e5c8[_0x6de2('0x54')]?JSON[_0x6de2('0x24')](_0x56e5c8[_0x6de2('0x54')]):_0x6de2('0x68'));return respondWithRpcPromise(_0x6de2('0x69'),_0x6de2('0x6a'),_0x578d11);}return null;})[_0x6de2('0x20')](function(_0x1c6431){var _0x15f220=_0x6de2('0x6b')+_0x1c6431[_0x6de2('0x27')][_0x6de2('0x6c')];return db[_0x6de2('0x6d')][_0x6de2('0x40')](_0x15f220,{'type':db[_0x6de2('0x6e')][_0x6de2('0x6f')][_0x6de2('0x70')],'raw':!![]})[_0x6de2('0x20')](function(_0x50ba0c){return _0x50ba0c;});})[_0x6de2('0x20')](function(_0x5d040a){if(_0x5d040a){_0x578d11[_0x6de2('0x27')][_0x6de2('0x71')]=_0x5d040a[0x0];if(!_0x56e5c8['body'][_0x6de2('0x5e')])return;return db[_0x6de2('0x72')]['find']({'where':{'id':_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')],'role':_0x6de2('0x60')},'attributes':['id',_0x6de2('0x36'),_0x6de2('0x73'),'email',_0x6de2('0x74')],'raw':!![]});}return null;})[_0x6de2('0x20')](function(_0x1e6e60){if(!_0x1e6e60)return null;_0x578d11[_0x6de2('0x27')][_0x6de2('0x60')]=_0x1e6e60;return _0x578d11;})[_0x6de2('0x20')](function(_0x23fb7e){if(_0x23fb7e){if(_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x75')]){_0x578d11[_0x6de2('0x27')][_0x6de2('0x76')]=util['format'](_0x6de2('0x77'),_0x56e5c8[_0x6de2('0x5f')][_0x6de2('0x36')]);_0x578d11[_0x6de2('0x27')][_0x6de2('0x78')]=_0x578d11[_0x6de2('0x78')];_0x578d11[_0x6de2('0x27')][_0x6de2('0x79')]=_0x578d11['channel'];_0x578d11[_0x6de2('0x27')]['event']=_0x6de2('0x7a');return respondWithRpcPromise(_0x6de2('0x7b'),_0x6de2('0x7b'),{'event':_0x6de2('0x7c'),'message':_['merge'](_0x578d11[_0x6de2('0x27')],JSON[_0x6de2('0x7d')](_0x578d11['interaction']['formData']))},client9002)[_0x6de2('0x20')](function(){return _0x578d11;});}return _0x578d11;}return null;})['then'](respondWithResult(_0x1cbaa3,null))['catch'](handleError(_0x1cbaa3,null));};var interaction_log=require(_0x6de2('0x14'))(_0x6de2('0x58'));exports['reject']=function(_0x58062e,_0x569237,_0x592867){var _0x4287d3={'agent':{},'channel':'chat'};if(_0x58062e[_0x6de2('0x54')]['id']){delete _0x58062e['body']['id'];}_0x58062e['body'][_0x6de2('0x5e')]=_0x58062e[_0x6de2('0x54')][_0x6de2('0x5e')]||_0x58062e['user']['id'];_0x4287d3[_0x6de2('0x60')]['id']=_0x58062e[_0x6de2('0x54')]['UserId'];return db[_0x6de2('0x4d')]['find']({'where':{'id':_0x58062e[_0x6de2('0x50')]['id'],'UserId':null}})[_0x6de2('0x20')](handleEntityNotFound(_0x569237,null))[_0x6de2('0x20')](function(_0x345371){if(_0x345371){_0x4287d3['message']=_0x345371['get']({'plain':!![]});return db[_0x6de2('0x7e')]['find']({'where':{'id':_0x345371[_0x6de2('0x62')]}});}return null;})[_0x6de2('0x20')](handleEntityNotFound(_0x569237,null))[_0x6de2('0x20')](function(_0x4d4d0e){if(_0x4d4d0e){_0x4287d3[_0x6de2('0x64')]=_0x4d4d0e[_0x6de2('0x61')]({'plain':!![]});interaction_log['info'](_0x6de2('0x7f'),_0x58062e[_0x6de2('0x5f')]['id'],_0x58062e[_0x6de2('0x5f')][_0x6de2('0x36')],_0x58062e[_0x6de2('0x5f')][_0x6de2('0x67')],_0x4287d3[_0x6de2('0x64')]['id'],_0x58062e['body']?JSON['stringify'](_0x58062e['body']):_0x6de2('0x68'));return respondWithRpcPromise(_0x6de2('0x80'),_0x6de2('0x81'),_0x4287d3);}return null;})[_0x6de2('0x20')](function(_0x4b0dc5){var _0x324861=_0x6de2('0x6b')+_0x4b0dc5[_0x6de2('0x27')][_0x6de2('0x6c')];return db[_0x6de2('0x6d')][_0x6de2('0x40')](_0x324861,{'type':db[_0x6de2('0x6e')][_0x6de2('0x6f')][_0x6de2('0x70')],'raw':!![]})[_0x6de2('0x20')](function(_0x3d1a18){return _0x3d1a18;});})[_0x6de2('0x20')](function(_0x3f5846){if(_0x3f5846){_0x4287d3[_0x6de2('0x27')]['contact']=_0x3f5846[0x0];if(!_0x58062e['body']['UserId'])return;return db[_0x6de2('0x72')]['find']({'where':{'id':_0x58062e[_0x6de2('0x54')]['UserId'],'role':_0x6de2('0x60')},'attributes':['id',_0x6de2('0x36'),'fullname','email',_0x6de2('0x74')],'raw':!![]});}return null;})[_0x6de2('0x20')](function(_0x3f8ce2){if(!_0x3f8ce2)return null;_0x4287d3[_0x6de2('0x27')][_0x6de2('0x60')]=_0x3f8ce2;return _0x4287d3;})[_0x6de2('0x20')](function(_0x55327d){if(_0x55327d){_0x55327d['message'][_0x6de2('0x76')]=util[_0x6de2('0x5c')](_0x6de2('0x77'),_0x58062e[_0x6de2('0x5f')][_0x6de2('0x36')]);_0x55327d['message'][_0x6de2('0x78')]=_0x4287d3[_0x6de2('0x78')];_0x55327d[_0x6de2('0x27')][_0x6de2('0x79')]=_0x4287d3[_0x6de2('0x78')];_0x55327d[_0x6de2('0x27')][_0x6de2('0x82')]='reject';respondWithRpcPromise(_0x6de2('0x7b'),_0x6de2('0x7b'),{'event':'rejectmessage','message':_[_0x6de2('0x4b')](_0x4287d3[_0x6de2('0x27')],JSON[_0x6de2('0x7d')](_0x4287d3[_0x6de2('0x64')][_0x6de2('0x83')]))},client9002);return _0x4287d3;}return null;})[_0x6de2('0x20')](respondWithResult(_0x569237,null))['catch'](handleError(_0x569237,null));}; \ No newline at end of file +var _0x6c07=['user','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','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','channel','motionChannel','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','interface','SIP/%s','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','filters','create','body','find','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x31d8a6,_0x32e347){var _0x54772a=function(_0x546322){while(--_0x546322){_0x31d8a6['push'](_0x31d8a6['shift']());}};_0x54772a(++_0x32e347);}(_0x6c07,0xaa));var _0x76c0=function(_0x5099d0,_0x48bd45){_0x5099d0=_0x5099d0-0x0;var _0x1cef16=_0x6c07[_0x5099d0];return _0x1cef16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76c0('0x0'));var zipdir=require(_0x76c0('0x1'));var jsonpatch=require(_0x76c0('0x2'));var rp=require(_0x76c0('0x3'));var moment=require(_0x76c0('0x4'));var BPromise=require(_0x76c0('0x5'));var Mustache=require(_0x76c0('0x6'));var util=require(_0x76c0('0x7'));var path=require('path');var sox=require(_0x76c0('0x8'));var csv=require('to-csv');var ejs=require(_0x76c0('0x9'));var fs=require('fs');var fs_extra=require(_0x76c0('0xa'));var _=require(_0x76c0('0xb'));var squel=require(_0x76c0('0xc'));var crypto=require(_0x76c0('0xd'));var jsforce=require(_0x76c0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x76c0('0xf'));var querystring=require(_0x76c0('0x10'));var Papa=require('papaparse');var Redis=require(_0x76c0('0x11'));var authService=require(_0x76c0('0x12'));var qs=require(_0x76c0('0x13'));var as=require(_0x76c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x76c0('0x15'))(_0x76c0('0x16'));var utils=require('../../config/utils');var config=require(_0x76c0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x76c0('0x18')]=_[_0x76c0('0x19')](config[_0x76c0('0x18')],{'host':_0x76c0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x76c0('0x1b'))['register'](socket);var jayson=require(_0x76c0('0x1c'));var client=jayson[_0x76c0('0x1d')][_0x76c0('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x76c0('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3ec4ec,_0x2d228d,_0x52bbc8,_0x28769f){return new BPromise(function(_0x49a69e,_0x35d77d){var _0x312f29=_0x28769f||client;return _0x312f29[_0x76c0('0x1f')](_0x3ec4ec,_0x52bbc8)[_0x76c0('0x20')](function(_0x4a904e){logger[_0x76c0('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2d228d,_0x76c0('0x22'));logger[_0x76c0('0x23')](_0x76c0('0x24'),_0x2d228d,_0x76c0('0x22'),JSON[_0x76c0('0x25')](_0x4a904e));if(_0x4a904e[_0x76c0('0x26')]){if(_0x4a904e[_0x76c0('0x26')][_0x76c0('0x27')]===0x1f4){logger['error'](_0x76c0('0x28'),_0x2d228d,_0x4a904e[_0x76c0('0x26')][_0x76c0('0x29')]);return _0x35d77d(_0x4a904e['error'][_0x76c0('0x29')]);}logger[_0x76c0('0x26')](_0x76c0('0x28'),_0x2d228d,_0x4a904e[_0x76c0('0x26')]['message']);return _0x49a69e(_0x4a904e[_0x76c0('0x26')][_0x76c0('0x29')]);}else{logger[_0x76c0('0x21')](_0x76c0('0x28'),_0x2d228d,'request\x20sent');_0x49a69e(_0x4a904e[_0x76c0('0x2a')][_0x76c0('0x29')]);}})[_0x76c0('0x2b')](function(_0x5bf23c){logger[_0x76c0('0x26')](_0x76c0('0x28'),_0x2d228d,_0x5bf23c);_0x35d77d(_0x5bf23c);});});}function respondWithStatusCode(_0x1a934f,_0x325db8){_0x325db8=_0x325db8||0xcc;return function(_0x381f30){if(_0x381f30){return _0x1a934f[_0x76c0('0x2c')](_0x325db8);}return _0x1a934f[_0x76c0('0x2d')](_0x325db8)[_0x76c0('0x2e')]();};}function respondWithResult(_0x20cd78,_0x2eb779){_0x2eb779=_0x2eb779||0xc8;return function(_0x275316){if(_0x275316){return _0x20cd78[_0x76c0('0x2d')](_0x2eb779)['json'](_0x275316);}};}function respondWithFilteredResult(_0x22792,_0x5ec8ae){return function(_0x160adb){if(_0x160adb){var _0x6bf734=typeof _0x5ec8ae[_0x76c0('0x2f')]===_0x76c0('0x30')&&typeof _0x5ec8ae[_0x76c0('0x31')]==='undefined';var _0x47c62c=_0x160adb[_0x76c0('0x32')];var _0x223372=_0x6bf734?0x0:_0x5ec8ae[_0x76c0('0x2f')];var _0x71580=_0x6bf734?_0x160adb[_0x76c0('0x32')]:_0x5ec8ae[_0x76c0('0x2f')]+_0x5ec8ae[_0x76c0('0x31')];var _0x5810e8;if(_0x71580>=_0x47c62c){_0x71580=_0x47c62c;_0x5810e8=0xc8;}else{_0x5810e8=0xce;}_0x22792['status'](_0x5810e8);return _0x22792[_0x76c0('0x33')](_0x76c0('0x34'),_0x223372+'-'+_0x71580+'/'+_0x47c62c)['json'](_0x160adb);}return null;};}function patchUpdates(_0x27ced0){return function(_0x169f9f){try{jsonpatch['apply'](_0x169f9f,_0x27ced0,!![]);}catch(_0xb7e9f0){return BPromise[_0x76c0('0x35')](_0xb7e9f0);}return _0x169f9f[_0x76c0('0x36')]();};}function saveUpdates(_0x64cbe2,_0x7d091b){return function(_0x499b7d){if(_0x499b7d){return _0x499b7d[_0x76c0('0x37')](_0x64cbe2)['then'](function(_0x57e671){return _0x57e671;});}return null;};}function removeEntity(_0x51872c,_0x5289e5){return function(_0x5910d1){if(_0x5910d1){return _0x5910d1[_0x76c0('0x38')]()[_0x76c0('0x20')](function(){_0x51872c[_0x76c0('0x2d')](0xcc)[_0x76c0('0x2e')]();});}};}function handleEntityNotFound(_0x185ee4,_0x4ac954){return function(_0x1f7b61){if(!_0x1f7b61){_0x185ee4[_0x76c0('0x2c')](0x194);}return _0x1f7b61;};}function handleError(_0xa83fa8,_0x127726){_0x127726=_0x127726||0x1f4;return function(_0x3c0878){logger['error'](_0x3c0878[_0x76c0('0x39')]);if(_0x3c0878[_0x76c0('0x3a')]){delete _0x3c0878[_0x76c0('0x3a')];}_0xa83fa8[_0x76c0('0x2d')](_0x127726)['send'](_0x3c0878);};}exports[_0x76c0('0x3b')]=function(_0x42e777,_0x2b02a3){var _0x251b2a={},_0x452289={},_0x8b8775={'count':0x0,'rows':[]};var _0x453d9a=_[_0x76c0('0x3c')](db[_0x76c0('0x3d')][_0x76c0('0x3e')],function(_0x5e9d0c){return{'name':_0x5e9d0c[_0x76c0('0x3f')],'type':_0x5e9d0c[_0x76c0('0x40')]['key']};});_0x452289[_0x76c0('0x41')]=_['map'](_0x453d9a,_0x76c0('0x3a'));_0x452289[_0x76c0('0x42')]=_['keys'](_0x42e777[_0x76c0('0x42')]);_0x452289['filters']=_[_0x76c0('0x43')](_0x452289[_0x76c0('0x41')],_0x452289[_0x76c0('0x42')]);_0x251b2a[_0x76c0('0x44')]=_[_0x76c0('0x43')](_0x452289[_0x76c0('0x41')],qs['fields'](_0x42e777[_0x76c0('0x42')][_0x76c0('0x45')]));_0x251b2a[_0x76c0('0x44')]=_0x251b2a[_0x76c0('0x44')][_0x76c0('0x46')]?_0x251b2a[_0x76c0('0x44')]:_0x452289['model'];if(!_0x42e777[_0x76c0('0x42')][_0x76c0('0x47')](_0x76c0('0x48'))){_0x251b2a['limit']=qs['limit'](_0x42e777['query'][_0x76c0('0x31')]);_0x251b2a['offset']=qs[_0x76c0('0x2f')](_0x42e777[_0x76c0('0x42')][_0x76c0('0x2f')]);}_0x251b2a[_0x76c0('0x49')]=qs[_0x76c0('0x4a')](_0x42e777[_0x76c0('0x42')][_0x76c0('0x4a')]);_0x251b2a[_0x76c0('0x4b')]=qs['filters'](_[_0x76c0('0x4c')](_0x42e777[_0x76c0('0x42')],_0x452289['filters']),_0x453d9a);if(_0x42e777[_0x76c0('0x42')][_0x76c0('0x4d')]){_0x251b2a[_0x76c0('0x4b')]=_[_0x76c0('0x4e')](_0x251b2a[_0x76c0('0x4b')],{'$or':_[_0x76c0('0x3c')](_0x453d9a,function(_0x522411){if(_0x522411[_0x76c0('0x40')]!=='VIRTUAL'){var _0x4c7c89={};_0x4c7c89[_0x522411[_0x76c0('0x3a')]]={'$like':'%'+_0x42e777['query'][_0x76c0('0x4d')]+'%'};return _0x4c7c89;}})});}_0x251b2a=_[_0x76c0('0x4e')]({},_0x251b2a,_0x42e777[_0x76c0('0x4f')]);var _0x528948={'where':_0x251b2a[_0x76c0('0x4b')]};return db[_0x76c0('0x3d')][_0x76c0('0x32')](_0x528948)[_0x76c0('0x20')](function(_0x3cbfe7){_0x8b8775['count']=_0x3cbfe7;if(_0x42e777[_0x76c0('0x42')][_0x76c0('0x50')]){_0x251b2a[_0x76c0('0x51')]=[{'all':!![]}];}return db[_0x76c0('0x3d')][_0x76c0('0x52')](_0x251b2a);})[_0x76c0('0x20')](function(_0x40c633){_0x8b8775[_0x76c0('0x53')]=_0x40c633;return _0x8b8775;})[_0x76c0('0x20')](respondWithFilteredResult(_0x2b02a3,_0x251b2a))[_0x76c0('0x2b')](handleError(_0x2b02a3,null));};exports[_0x76c0('0x54')]=function(_0x178f0f,_0x240654){var _0x16e282={'raw':!![],'where':{'id':_0x178f0f[_0x76c0('0x55')]['id']}},_0x592dfa={};_0x592dfa[_0x76c0('0x41')]=_[_0x76c0('0x56')](db[_0x76c0('0x3d')][_0x76c0('0x3e')]);_0x592dfa['query']=_[_0x76c0('0x56')](_0x178f0f[_0x76c0('0x42')]);_0x592dfa[_0x76c0('0x57')]=_[_0x76c0('0x43')](_0x592dfa[_0x76c0('0x41')],_0x592dfa[_0x76c0('0x42')]);_0x16e282[_0x76c0('0x44')]=_[_0x76c0('0x43')](_0x592dfa[_0x76c0('0x41')],qs[_0x76c0('0x45')](_0x178f0f[_0x76c0('0x42')]['fields']));_0x16e282[_0x76c0('0x44')]=_0x16e282['attributes'][_0x76c0('0x46')]?_0x16e282[_0x76c0('0x44')]:_0x592dfa[_0x76c0('0x41')];if(_0x178f0f[_0x76c0('0x42')][_0x76c0('0x50')]){_0x16e282[_0x76c0('0x51')]=[{'all':!![]}];}_0x16e282=_[_0x76c0('0x4e')]({},_0x16e282,_0x178f0f[_0x76c0('0x4f')]);return db[_0x76c0('0x3d')]['find'](_0x16e282)[_0x76c0('0x20')](handleEntityNotFound(_0x240654,null))[_0x76c0('0x20')](respondWithResult(_0x240654,null))[_0x76c0('0x2b')](handleError(_0x240654,null));};exports[_0x76c0('0x58')]=function(_0xd05651,_0x48d0e0){return db[_0x76c0('0x3d')][_0x76c0('0x58')](_0xd05651[_0x76c0('0x59')],{})[_0x76c0('0x20')](respondWithResult(_0x48d0e0,0xc9))['catch'](handleError(_0x48d0e0,null));};exports[_0x76c0('0x37')]=function(_0xda9571,_0x49d171){if(_0xda9571[_0x76c0('0x59')]['id']){delete _0xda9571[_0x76c0('0x59')]['id'];}return db['ChatMessage'][_0x76c0('0x5a')]({'where':{'id':_0xda9571[_0x76c0('0x55')]['id']}})[_0x76c0('0x20')](handleEntityNotFound(_0x49d171,null))['then'](saveUpdates(_0xda9571['body'],null))[_0x76c0('0x20')](respondWithResult(_0x49d171,null))[_0x76c0('0x2b')](handleError(_0x49d171,null));};exports[_0x76c0('0x38')]=function(_0x7a17a2,_0x12fe72){return db['ChatMessage'][_0x76c0('0x5a')]({'where':{'id':_0x7a17a2[_0x76c0('0x55')]['id']}})[_0x76c0('0x20')](handleEntityNotFound(_0x12fe72,null))[_0x76c0('0x20')](removeEntity(_0x12fe72,null))['catch'](handleError(_0x12fe72,null));};exports['describe']=function(_0x516009,_0x31f93c){return db[_0x76c0('0x3d')][_0x76c0('0x5b')]()[_0x76c0('0x20')](respondWithResult(_0x31f93c,null))[_0x76c0('0x2b')](handleError(_0x31f93c,null));};var interaction_log=require('../../config/logger')(_0x76c0('0x5c'));exports['accept']=function(_0x519d9b,_0x5a57c8,_0x59a980){var _0x431c82={'agent':{},'channel':'chat'};if(_0x519d9b[_0x76c0('0x59')]['id']){delete _0x519d9b[_0x76c0('0x59')]['id'];}_0x519d9b[_0x76c0('0x59')][_0x76c0('0x5d')]=!![];_0x519d9b[_0x76c0('0x59')][_0x76c0('0x5e')]=moment()[_0x76c0('0x5f')](_0x76c0('0x60'));_0x519d9b['body'][_0x76c0('0x61')]=_0x519d9b['body'][_0x76c0('0x61')]||_0x519d9b[_0x76c0('0x62')]['id'];_0x431c82['agent']['id']=_0x519d9b['body'][_0x76c0('0x61')];return db[_0x76c0('0x3d')][_0x76c0('0x5a')]({'where':{'id':_0x519d9b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5a57c8,null))['then'](saveUpdates(_0x519d9b[_0x76c0('0x59')],null))[_0x76c0('0x20')](function(_0x3040ee){if(_0x3040ee){_0x431c82['message']=_0x3040ee[_0x76c0('0x63')]({'plain':!![]});return db[_0x76c0('0x64')][_0x76c0('0x5a')]({'where':{'id':_0x3040ee[_0x76c0('0x65')]}});}return null;})[_0x76c0('0x20')](handleEntityNotFound(_0x5a57c8,null))[_0x76c0('0x20')](function(_0x23c820){if(_0x23c820){return _0x23c820[_0x76c0('0x37')]({'UserId':_0x519d9b[_0x76c0('0x59')][_0x76c0('0x61')],'read1stAt':_[_0x76c0('0x66')](_0x23c820[_0x76c0('0x67')])?moment()[_0x76c0('0x5f')](_0x76c0('0x60')):undefined});}return null;})[_0x76c0('0x20')](function(_0x2aa82c){if(_0x2aa82c){_0x431c82[_0x76c0('0x68')]=_0x2aa82c[_0x76c0('0x63')]({'plain':!![]});interaction_log[_0x76c0('0x21')](_0x76c0('0x69'),_0x519d9b[_0x76c0('0x62')]['id'],_0x519d9b['user'][_0x76c0('0x3a')],_0x519d9b['user'][_0x76c0('0x6a')],_0x431c82[_0x76c0('0x68')]['id'],_0x519d9b[_0x76c0('0x59')]?JSON['stringify'](_0x519d9b[_0x76c0('0x59')]):_0x76c0('0x6b'));return respondWithRpcPromise(_0x76c0('0x6c'),'acceptMessage',_0x431c82);}return null;})[_0x76c0('0x20')](function(_0x4969e1){var _0x583d80=_0x76c0('0x6d')+_0x4969e1['message'][_0x76c0('0x6e')];return db[_0x76c0('0x6f')][_0x76c0('0x42')](_0x583d80,{'type':db[_0x76c0('0x70')][_0x76c0('0x71')][_0x76c0('0x72')],'raw':!![]})[_0x76c0('0x20')](function(_0x3bb4e2){return _0x3bb4e2;});})[_0x76c0('0x20')](function(_0x393794){if(_0x393794){_0x431c82[_0x76c0('0x29')][_0x76c0('0x73')]=_0x393794[0x0];if(!_0x519d9b[_0x76c0('0x59')][_0x76c0('0x61')])return;return db[_0x76c0('0x74')][_0x76c0('0x5a')]({'where':{'id':_0x519d9b['body']['UserId'],'role':_0x76c0('0x75')},'attributes':['id',_0x76c0('0x3a'),_0x76c0('0x76'),_0x76c0('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1f80f3){if(!_0x1f80f3)return null;_0x431c82[_0x76c0('0x29')][_0x76c0('0x75')]=_0x1f80f3;return _0x431c82;})[_0x76c0('0x20')](function(_0xf86ae5){if(_0xf86ae5){if(_0x519d9b[_0x76c0('0x59')][_0x76c0('0x78')]){_0x431c82[_0x76c0('0x29')]['interface']=util[_0x76c0('0x5f')]('SIP/%s',_0x519d9b['user']['name']);_0x431c82[_0x76c0('0x29')][_0x76c0('0x79')]=_0x431c82[_0x76c0('0x79')];_0x431c82[_0x76c0('0x29')][_0x76c0('0x7a')]=_0x431c82['channel'];_0x431c82[_0x76c0('0x29')]['event']='accept';return respondWithRpcPromise('EventManager',_0x76c0('0x7b'),{'event':_0x76c0('0x7c'),'message':_[_0x76c0('0x4e')](_0x431c82[_0x76c0('0x29')],JSON[_0x76c0('0x7d')](_0x431c82[_0x76c0('0x68')][_0x76c0('0x7e')]))},client9002)[_0x76c0('0x20')](function(){return _0x431c82;});}return _0x431c82;}return null;})['then'](respondWithResult(_0x5a57c8,null))['catch'](handleError(_0x5a57c8,null));};var interaction_log=require(_0x76c0('0x15'))(_0x76c0('0x5c'));exports['reject']=function(_0x276640,_0x34893e,_0x5ca770){var _0x3768b0={'agent':{},'channel':'chat'};if(_0x276640[_0x76c0('0x59')]['id']){delete _0x276640[_0x76c0('0x59')]['id'];}_0x276640[_0x76c0('0x59')][_0x76c0('0x61')]=_0x276640[_0x76c0('0x59')]['UserId']||_0x276640[_0x76c0('0x62')]['id'];_0x3768b0['agent']['id']=_0x276640[_0x76c0('0x59')][_0x76c0('0x61')];return db['ChatMessage'][_0x76c0('0x5a')]({'where':{'id':_0x276640[_0x76c0('0x55')]['id'],'UserId':null}})[_0x76c0('0x20')](handleEntityNotFound(_0x34893e,null))[_0x76c0('0x20')](function(_0xbd131f){if(_0xbd131f){_0x3768b0[_0x76c0('0x29')]=_0xbd131f[_0x76c0('0x63')]({'plain':!![]});return db[_0x76c0('0x64')][_0x76c0('0x5a')]({'where':{'id':_0xbd131f[_0x76c0('0x65')]}});}return null;})[_0x76c0('0x20')](handleEntityNotFound(_0x34893e,null))[_0x76c0('0x20')](function(_0x71a724){if(_0x71a724){_0x3768b0[_0x76c0('0x68')]=_0x71a724[_0x76c0('0x63')]({'plain':!![]});interaction_log['info'](_0x76c0('0x7f'),_0x276640[_0x76c0('0x62')]['id'],_0x276640[_0x76c0('0x62')]['name'],_0x276640['user'][_0x76c0('0x6a')],_0x3768b0[_0x76c0('0x68')]['id'],_0x276640['body']?JSON[_0x76c0('0x25')](_0x276640[_0x76c0('0x59')]):'null');return respondWithRpcPromise(_0x76c0('0x80'),_0x76c0('0x81'),_0x3768b0);}return null;})[_0x76c0('0x20')](function(_0x4c6f2f){var _0x1fa1fe=_0x76c0('0x6d')+_0x4c6f2f[_0x76c0('0x29')][_0x76c0('0x6e')];return db['sequelize'][_0x76c0('0x42')](_0x1fa1fe,{'type':db[_0x76c0('0x70')]['QueryTypes'][_0x76c0('0x72')],'raw':!![]})[_0x76c0('0x20')](function(_0x83fae7){return _0x83fae7;});})['then'](function(_0x3ed278){if(_0x3ed278){_0x3768b0[_0x76c0('0x29')][_0x76c0('0x73')]=_0x3ed278[0x0];if(!_0x276640[_0x76c0('0x59')][_0x76c0('0x61')])return;return db[_0x76c0('0x74')][_0x76c0('0x5a')]({'where':{'id':_0x276640[_0x76c0('0x59')][_0x76c0('0x61')],'role':'agent'},'attributes':['id',_0x76c0('0x3a'),_0x76c0('0x76'),_0x76c0('0x77'),_0x76c0('0x82')],'raw':!![]});}return null;})['then'](function(_0x3d7b9b){if(!_0x3d7b9b)return null;_0x3768b0[_0x76c0('0x29')][_0x76c0('0x75')]=_0x3d7b9b;return _0x3768b0;})[_0x76c0('0x20')](function(_0x4cf777){if(_0x4cf777){_0x4cf777[_0x76c0('0x29')][_0x76c0('0x83')]=util[_0x76c0('0x5f')](_0x76c0('0x84'),_0x276640['user'][_0x76c0('0x3a')]);_0x4cf777[_0x76c0('0x29')]['channel']=_0x3768b0[_0x76c0('0x79')];_0x4cf777[_0x76c0('0x29')]['motionChannel']=_0x3768b0[_0x76c0('0x79')];_0x4cf777[_0x76c0('0x29')]['event']='reject';respondWithRpcPromise(_0x76c0('0x7b'),_0x76c0('0x7b'),{'event':_0x76c0('0x85'),'message':_[_0x76c0('0x4e')](_0x3768b0[_0x76c0('0x29')],JSON[_0x76c0('0x7d')](_0x3768b0[_0x76c0('0x68')][_0x76c0('0x7e')]))},client9002);return _0x3768b0;}return null;})[_0x76c0('0x20')](respondWithResult(_0x34893e,null))[_0x76c0('0x2b')](handleError(_0x34893e,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index cd80b7e..5bb3f7b 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 _0x4ede=['save','update','remove','emit','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x35a59c,_0x3c08ef){var _0x11bf0e=function(_0x154cec){while(--_0x154cec){_0x35a59c['push'](_0x35a59c['shift']());}};_0x11bf0e(++_0x3c08ef);}(_0x4ede,0x138));var _0xe4ed=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4ede[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0xe4ed('0x0'));var ChatMessage=require(_0xe4ed('0x1'))['db'][_0xe4ed('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4ed('0x3'),'afterUpdate':_0xe4ed('0x4'),'afterDestroy':_0xe4ed('0x5')};function emitEvent(_0x40e543){return function(_0x1abd31,_0xaa1f01,_0x42a69d){ChatMessageEvents[_0xe4ed('0x6')](_0x40e543+':'+_0x1abd31['id'],_0x1abd31);ChatMessageEvents[_0xe4ed('0x6')](_0x40e543,_0x1abd31);_0x42a69d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xe4ed('0x7')](e,emitEvent(event));}}module[_0xe4ed('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x80c5=['ChatMessage','save','update','emit','hasOwnProperty','events'];(function(_0xcd52ba,_0x1e9bdb){var _0x1f07a0=function(_0x5358db){while(--_0x5358db){_0xcd52ba['push'](_0xcd52ba['shift']());}};_0x1f07a0(++_0x1e9bdb);}(_0x80c5,0x15b));var _0x580c=function(_0x3a1770,_0x2a13da){_0x3a1770=_0x3a1770-0x0;var _0x517f6c=_0x80c5[_0x3a1770];return _0x517f6c;};'use strict';var EventEmitter=require(_0x580c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x580c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x580c('0x2'),'afterUpdate':_0x580c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2b32ae){return function(_0x24fad9,_0x2597c4,_0xb5ada7){ChatMessageEvents[_0x580c('0x4')](_0x2b32ae+':'+_0x24fad9['id'],_0x24fad9);ChatMessageEvents[_0x580c('0x4')](_0x2b32ae,_0x24fad9);_0xb5ada7(null);};}for(var e in events){if(events[_0x580c('0x5')](e)){var event=events[e];ChatMessage['hook'](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 2155cba..1eca3bc 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 _0xe30f=['chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','exports','ChatMessage'];(function(_0x2f6167,_0x432253){var _0x2e2548=function(_0x1da10){while(--_0x1da10){_0x2f6167['push'](_0x2f6167['shift']());}};_0x2e2548(++_0x432253);}(_0xe30f,0x11a));var _0xfe30=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe30f[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xfe30('0x0'));var util=require(_0xfe30('0x1'));var logger=require(_0xfe30('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfe30('0x3'));var fs=require('fs');var path=require(_0xfe30('0x4'));var rimraf=require(_0xfe30('0x5'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xfe30('0x6')]=function(_0x2a16f0,_0x3eb313){return _0x2a16f0['define'](_0xfe30('0x7'),attributes,{'tableName':_0xfe30('0x8'),'paranoid':![],'indexes':[{'name':_0xfe30('0x9'),'fields':[_0xfe30('0xa')],'type':_0xfe30('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54dc14,_0x39b3ee,_0xf33da1){var _0x288993=_0x2a16f0[_0xfe30('0xc')];var _0x47cbe5=_0x54dc14[_0xfe30('0xd')]({'plain':!![]});if(_0x47cbe5[_0xfe30('0xe')][_0xfe30('0xf')]()==='in'||_0x47cbe5[_0xfe30('0xe')][_0xfe30('0xf')]()===_0xfe30('0x10')&&!_0x47cbe5[_0xfe30('0x11')]&&!_[_0xfe30('0x12')](_0x47cbe5[_0xfe30('0x13')])){_0x288993['ChatInteraction'][_0xfe30('0x14')]({'where':{'id':_0x47cbe5[_0xfe30('0x15')]}})[_0xfe30('0x16')](function(_0x677747){if(_0x677747){_0x677747[_0xfe30('0x17')]({'lastMsgAt':_0x47cbe5[_0xfe30('0x18')],'lastMsgDirection':_0x47cbe5[_0xfe30('0xe')][_0xfe30('0xf')]()});}})[_0xfe30('0x19')](function(_0x41bca6){console[_0xfe30('0x1a')](_0x41bca6);});}_0xf33da1();}},'charset':_0xfe30('0x1b'),'collate':_0xfe30('0x1c')});}; \ No newline at end of file +var _0xa94d=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','catch','error','utf8mb4','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa94d,0x80));var _0xda94=function(_0x351f4d,_0x43f5b7){_0x351f4d=_0x351f4d-0x0;var _0x779646=_0xa94d[_0x351f4d];return _0x779646;};'use strict';var _=require(_0xda94('0x0'));var util=require(_0xda94('0x1'));var logger=require(_0xda94('0x2'))(_0xda94('0x3'));var moment=require('moment');var BPromise=require(_0xda94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda94('0x5'));var rimraf=require(_0xda94('0x6'));var config=require(_0xda94('0x7'));var attributes=require('./chatMessage.attributes');module[_0xda94('0x8')]=function(_0x4b42a0,_0x278a7e){return _0x4b42a0[_0xda94('0x9')](_0xda94('0xa'),attributes,{'tableName':_0xda94('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xda94('0xc')],'type':_0xda94('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3812fc,_0x50b0f1,_0x22eb04){var _0x295765=_0x4b42a0[_0xda94('0xe')];var _0x3f30dd=_0x3812fc[_0xda94('0xf')]({'plain':!![]});if(_0x3f30dd[_0xda94('0x10')]['toLowerCase']()==='in'||_0x3f30dd[_0xda94('0x10')]['toLowerCase']()==='out'&&!_0x3f30dd[_0xda94('0x11')]&&!_[_0xda94('0x12')](_0x3f30dd[_0xda94('0x13')])){_0x295765[_0xda94('0x14')][_0xda94('0x15')]({'where':{'id':_0x3f30dd[_0xda94('0x16')]}})['then'](function(_0x374913){if(_0x374913){_0x374913['update']({'lastMsgAt':_0x3f30dd['createdAt'],'lastMsgDirection':_0x3f30dd[_0xda94('0x10')]['toLowerCase']()});}})[_0xda94('0x17')](function(_0x1e9cab){console[_0xda94('0x18')](_0x1e9cab);});}_0x22eb04();}},'charset':_0xda94('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 5160080..85cbe39 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 _0x7769=['then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x4d0e23,_0x4e03b7){var _0x4d2fc4=function(_0x26f074){while(--_0x26f074){_0x4d0e23['push'](_0x4d0e23['shift']());}};_0x4d2fc4(++_0x4e03b7);}(_0x7769,0x15e));var _0x9776=function(_0x19ad33,_0x62a060){_0x19ad33=_0x19ad33-0x0;var _0x547380=_0x7769[_0x19ad33];return _0x547380;};'use strict';var _=require(_0x9776('0x0'));var util=require(_0x9776('0x1'));var moment=require(_0x9776('0x2'));var BPromise=require(_0x9776('0x3'));var rs=require(_0x9776('0x4'));var fs=require('fs');var Redis=require(_0x9776('0x5'));var db=require(_0x9776('0x6'))['db'];var utils=require(_0x9776('0x7'));var logger=require(_0x9776('0x8'))(_0x9776('0x9'));var config=require(_0x9776('0xa'));var jayson=require(_0x9776('0xb'));var client=jayson[_0x9776('0xc')][_0x9776('0xd')]({'port':0x232a});config[_0x9776('0xe')]=_[_0x9776('0xf')](config[_0x9776('0xe')],{'host':_0x9776('0x10'),'port':0x18eb});var socket=require(_0x9776('0x11'))(new Redis(config['redis']));require(_0x9776('0x12'))[_0x9776('0x13')](socket);function respondWithRpcPromise(_0x16ce7f,_0xbfc7bf,_0x2e4ec4){return new BPromise(function(_0x269cbb,_0x1d9a5e){return client['request'](_0x16ce7f,_0x2e4ec4)[_0x9776('0x14')](function(_0x5f1a68){logger['info']('ChatMessage,\x20%s,\x20%s',_0xbfc7bf,'request\x20sent');logger[_0x9776('0x15')](_0x9776('0x16'),_0xbfc7bf,'request\x20sent',JSON[_0x9776('0x17')](_0x5f1a68));if(_0x5f1a68[_0x9776('0x18')]){if(_0x5f1a68[_0x9776('0x18')][_0x9776('0x19')]===0x1f4){logger[_0x9776('0x18')](_0x9776('0x1a'),_0xbfc7bf,_0x5f1a68[_0x9776('0x18')]['message']);return _0x1d9a5e(_0x5f1a68[_0x9776('0x18')][_0x9776('0x1b')]);}logger[_0x9776('0x18')](_0x9776('0x1a'),_0xbfc7bf,_0x5f1a68['error'][_0x9776('0x1b')]);return _0x269cbb(_0x5f1a68[_0x9776('0x18')][_0x9776('0x1b')]);}else{logger[_0x9776('0x1c')]('ChatMessage,\x20%s,\x20%s',_0xbfc7bf,_0x9776('0x1d'));_0x269cbb(_0x5f1a68[_0x9776('0x1e')][_0x9776('0x1b')]);}})[_0x9776('0x1f')](function(_0x4b1203){logger[_0x9776('0x18')](_0x9776('0x1a'),_0xbfc7bf,_0x4b1203);_0x1d9a5e(_0x4b1203);});});}exports[_0x9776('0x20')]=function(_0x10a80a){var _0x544863=this;return new Promise(function(_0x1d91a3,_0x3419de){return db[_0x9776('0x21')]['create'](_0x10a80a[_0x9776('0x22')],{'raw':_0x10a80a[_0x9776('0x23')]?_0x10a80a[_0x9776('0x23')][_0x9776('0x24')]===undefined?!![]:![]:!![]})[_0x9776('0x14')](function(_0xb4c629){logger[_0x9776('0x1c')](_0x9776('0x20'),_0x10a80a);logger['debug'](_0x9776('0x20'),_0x10a80a,JSON[_0x9776('0x17')](_0xb4c629));_0x1d91a3(_0xb4c629);})[_0x9776('0x1f')](function(_0x3b45a4){logger[_0x9776('0x18')](_0x9776('0x20'),_0x3b45a4[_0x9776('0x1b')],_0x10a80a);_0x3419de(_0x544863['error'](0x1f4,_0x3b45a4[_0x9776('0x1b')]));});});}; \ No newline at end of file +var _0xcc5f=['error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','raw','then','debug','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','register','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0xb86b17,_0x2e1437){var _0x5e562e=function(_0x39ea82){while(--_0x39ea82){_0xb86b17['push'](_0xb86b17['shift']());}};_0x5e562e(++_0x2e1437);}(_0xcc5f,0x12f));var _0xfcc5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc5f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xfcc5('0x0'));var util=require(_0xfcc5('0x1'));var moment=require(_0xfcc5('0x2'));var BPromise=require('bluebird');var rs=require(_0xfcc5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcc5('0x4'))['db'];var utils=require(_0xfcc5('0x5'));var logger=require(_0xfcc5('0x6'))(_0xfcc5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfcc5('0x8')][_0xfcc5('0x9')]({'port':0x232a});config[_0xfcc5('0xa')]=_['defaults'](config[_0xfcc5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcc5('0xb'))(new Redis(config[_0xfcc5('0xa')]));require('./chatMessage.socket')[_0xfcc5('0xc')](socket);function respondWithRpcPromise(_0x2a6ef8,_0x2bfebb,_0x3d822){return new BPromise(function(_0x390410,_0x21cadb){return client['request'](_0x2a6ef8,_0x3d822)['then'](function(_0x57a180){logger['info'](_0xfcc5('0xd'),_0x2bfebb,_0xfcc5('0xe'));logger['debug'](_0xfcc5('0xf'),_0x2bfebb,_0xfcc5('0xe'),JSON['stringify'](_0x57a180));if(_0x57a180[_0xfcc5('0x10')]){if(_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x11')]===0x1f4){logger['error'](_0xfcc5('0xd'),_0x2bfebb,_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x12')]);return _0x21cadb(_0x57a180['error'][_0xfcc5('0x12')]);}logger[_0xfcc5('0x10')]('ChatMessage,\x20%s,\x20%s',_0x2bfebb,_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x12')]);return _0x390410(_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x12')]);}else{logger[_0xfcc5('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2bfebb,_0xfcc5('0xe'));_0x390410(_0x57a180[_0xfcc5('0x14')]['message']);}})[_0xfcc5('0x15')](function(_0x49f10e){logger[_0xfcc5('0x10')](_0xfcc5('0xd'),_0x2bfebb,_0x49f10e);_0x21cadb(_0x49f10e);});});}exports[_0xfcc5('0x16')]=function(_0xe34334){var _0x47eb6=this;return new Promise(function(_0x4f9a59,_0x1e313b){return db[_0xfcc5('0x17')][_0xfcc5('0x18')](_0xe34334['body'],{'raw':_0xe34334['options']?_0xe34334['options'][_0xfcc5('0x19')]===undefined?!![]:![]:!![]})[_0xfcc5('0x1a')](function(_0x9c3ed0){logger['info']('CreateChatMessage',_0xe34334);logger[_0xfcc5('0x1b')](_0xfcc5('0x16'),_0xe34334,JSON[_0xfcc5('0x1c')](_0x9c3ed0));_0x4f9a59(_0x9c3ed0);})[_0xfcc5('0x15')](function(_0xd8560a){logger[_0xfcc5('0x10')](_0xfcc5('0x16'),_0xd8560a[_0xfcc5('0x12')],_0xe34334);_0x1e313b(_0x47eb6[_0xfcc5('0x10')](0x1f4,_0xd8560a[_0xfcc5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b19fd55..8c6f648 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 _0x032e=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x7924fe,_0x363a57){var _0x418354=function(_0x489b02){while(--_0x489b02){_0x7924fe['push'](_0x7924fe['shift']());}};_0x418354(++_0x363a57);}(_0x032e,0x124));var _0xe032=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x032e[_0x2b5eae];return _0x5f3ac9;};'use strict';var ChatMessageEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatMessageEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatMessageEvents['on'](_0x3289b0,_0xd84027);}}; \ No newline at end of file +var _0xe5d5=['length','chatMessage:','remove','removeListener','register'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0xe5d5,0x156));var _0x5e5d=function(_0x3d2a94,_0x27a633){_0x3d2a94=_0x3d2a94-0x0;var _0x315d9f=_0xe5d5[_0x3d2a94];return _0x315d9f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x5e5d('0x0'),'update'];function createListener(_0x9f47d6,_0x4b8ae9){return function(_0x50afd3){_0x4b8ae9['emit'](_0x9f47d6,_0x50afd3);};}function removeListener(_0x3e2410,_0x191980){return function(){ChatMessageEvents[_0x5e5d('0x1')](_0x3e2410,_0x191980);};}exports[_0x5e5d('0x2')]=function(_0x13bcb7){for(var _0x39077f=0x0,_0x3200d5=events[_0x5e5d('0x3')];_0x39077f<_0x3200d5;_0x39077f++){var _0x23de8d=events[_0x39077f];var _0x131a59=createListener(_0x5e5d('0x4')+_0x23de8d,_0x13bcb7);ChatMessageEvents['on'](_0x23de8d,_0x131a59);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 9a03b0f..207c750 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 _0x74c6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','delete','exports','util','path'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x74c6,0x178));var _0x674c=function(_0x2ffbf5,_0x5e9b1d){_0x2ffbf5=_0x2ffbf5-0x0;var _0x2bc37a=_0x74c6[_0x2ffbf5];return _0x2bc37a;};'use strict';var multer=require('multer');var util=require(_0x674c('0x0'));var path=require(_0x674c('0x1'));var timeout=require(_0x674c('0x2'));var express=require(_0x674c('0x3'));var router=express[_0x674c('0x4')]();var fs_extra=require(_0x674c('0x5'));var auth=require(_0x674c('0x6'));var interaction=require(_0x674c('0x7'));var config=require(_0x674c('0x8'));var controller=require(_0x674c('0x9'));router[_0x674c('0xa')]('/',auth[_0x674c('0xb')](),controller[_0x674c('0xc')]);router[_0x674c('0xa')](_0x674c('0xd'),auth[_0x674c('0xb')](),controller[_0x674c('0xe')]);router[_0x674c('0xa')](_0x674c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x674c('0x10')]('/',auth[_0x674c('0xb')](),interaction['tracked'](_0x674c('0x11'),_0x674c('0x12')),controller[_0x674c('0x13')]);router['put'](_0x674c('0xf'),controller[_0x674c('0x14')]);router[_0x674c('0x15')](_0x674c('0x16'),auth[_0x674c('0xb')](),controller[_0x674c('0x17')]);router[_0x674c('0x15')](_0x674c('0x18'),auth[_0x674c('0xb')](),controller['reject']);router[_0x674c('0x19')](_0x674c('0xf'),auth[_0x674c('0xb')](),controller['destroy']);module[_0x674c('0x1a')]=router; \ No newline at end of file +var _0x94bd=['show','post','chat','create','put','update','/:id/accept','accept','reject','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x54e331,_0x244a1d){var _0x39f511=function(_0x476649){while(--_0x476649){_0x54e331['push'](_0x54e331['shift']());}};_0x39f511(++_0x244a1d);}(_0x94bd,0x112));var _0xd94b=function(_0x1fd0c5,_0x241216){_0x1fd0c5=_0x1fd0c5-0x0;var _0xaece36=_0x94bd[_0x1fd0c5];return _0xaece36;};'use strict';var multer=require(_0xd94b('0x0'));var util=require(_0xd94b('0x1'));var path=require(_0xd94b('0x2'));var timeout=require(_0xd94b('0x3'));var express=require('express');var router=express[_0xd94b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd94b('0x5'));var interaction=require(_0xd94b('0x6'));var config=require(_0xd94b('0x7'));var controller=require(_0xd94b('0x8'));router[_0xd94b('0x9')]('/',auth[_0xd94b('0xa')](),controller[_0xd94b('0xb')]);router[_0xd94b('0x9')]('/describe',auth[_0xd94b('0xa')](),controller[_0xd94b('0xc')]);router[_0xd94b('0x9')](_0xd94b('0xd'),auth[_0xd94b('0xa')](),controller[_0xd94b('0xe')]);router[_0xd94b('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xd94b('0x10'),'chatmessage:create'),controller[_0xd94b('0x11')]);router[_0xd94b('0x12')]('/:id',controller[_0xd94b('0x13')]);router[_0xd94b('0x12')](_0xd94b('0x14'),auth[_0xd94b('0xa')](),controller[_0xd94b('0x15')]);router[_0xd94b('0x12')]('/:id/reject',auth[_0xd94b('0xa')](),controller[_0xd94b('0x16')]);router['delete'](_0xd94b('0xd'),auth[_0xd94b('0xa')](),controller[_0xd94b('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 5fa6fd5..431edee 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 _0x5f66=['medium','TEXT','exports'];(function(_0x986e18,_0x2b9185){var _0x436d06=function(_0x3930fc){while(--_0x3930fc){_0x986e18['push'](_0x986e18['shift']());}};_0x436d06(++_0x2b9185);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0x0b0e[_0x3caeb5];return _0x5eca7e;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 32044ab..cb1fd73 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(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7a54,0x106));var _0x47a5=function(_0x59fcd8,_0x22a3b4){_0x59fcd8=_0x59fcd8-0x0;var _0x506688=_0x7a54[_0x59fcd8];return _0x506688;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xf7f4e4,_0x13c7c3){var _0x2bfe72=function(_0x400799){while(--_0x400799){_0xf7f4e4['push'](_0xf7f4e4['shift']());}};_0x2bfe72(++_0x13c7c3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 868e9d5..aa39861 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 _0x5074=['save','update','emit','hasOwnProperty','hook','exports','ChatOfflineMessage','setMaxListeners'];(function(_0x36d48e,_0x4d3775){var _0x5c8ead=function(_0x333532){while(--_0x333532){_0x36d48e['push'](_0x36d48e['shift']());}};_0x5c8ead(++_0x4d3775);}(_0x5074,0x6e));var _0x4507=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0x5074[_0x189c9e];return _0x3f38ca;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x4507('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4507('0x1')](0x0);var events={'afterCreate':_0x4507('0x2'),'afterUpdate':_0x4507('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cb67e){return function(_0x24978f,_0x2af675,_0x34baca){ChatOfflineMessageEvents[_0x4507('0x4')](_0x3cb67e+':'+_0x24978f['id'],_0x24978f);ChatOfflineMessageEvents['emit'](_0x3cb67e,_0x24978f);_0x34baca(null);};}for(var e in events){if(events[_0x4507('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x4507('0x6')](e,emitEvent(event));}}module[_0x4507('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xafca=['ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x19569b,_0x4c1525){var _0x596579=function(_0x30525e){while(--_0x30525e){_0x19569b['push'](_0x19569b['shift']());}};_0x596579(++_0x4c1525);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xaafc('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xaafc('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xaafc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaafc('0x3')};function emitEvent(_0x2ba994){return function(_0x379add,_0xd5021b,_0xe1500d){ChatOfflineMessageEvents['emit'](_0x2ba994+':'+_0x379add['id'],_0x379add);ChatOfflineMessageEvents[_0xaafc('0x4')](_0x2ba994,_0x379add);_0xe1500d(null);};}for(var e in events){if(events[_0xaafc('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xaafc('0x6')](e,emitEvent(event));}}module[_0xaafc('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 3ff46b4..267fb0e 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 _0xa3d3=['exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3d3,0x1ef));var _0x3a3d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa3d3[_0x51020b];return _0x371e47;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x3a3d('0x0')]=function(_0x5635c6){return _0x5635c6[_0x3a3d('0x1')](_0x3a3d('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a3d('0x3'),'collate':_0x3a3d('0x4')});}; \ No newline at end of file +var _0x0429=['./chatOfflineMessage.attributes','define','utf8mb4_unicode_ci'];(function(_0x2bf5e9,_0x59fdc0){var _0x4cc16a=function(_0x3a6d63){while(--_0x3a6d63){_0x2bf5e9['push'](_0x2bf5e9['shift']());}};_0x4cc16a(++_0x59fdc0);}(_0x0429,0xea));var _0x9042=function(_0x31abdf,_0x5a77a3){_0x31abdf=_0x31abdf-0x0;var _0x4b25b4=_0x0429[_0x31abdf];return _0x4b25b4;};'use strict';var attributes=require(_0x9042('0x0'));module['exports']=function(_0x41add0){return _0x41add0[_0x9042('0x1')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9042('0x2')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index b6e4d7c..497504e 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 _0x63b6=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x26d931,_0x228d92){var _0x1d3c32=function(_0x5717ad){while(--_0x5717ad){_0x26d931['push'](_0x26d931['shift']());}};_0x1d3c32(++_0x228d92);}(_0x63b6,0x127));var _0x663b=function(_0x4e4c69,_0x5d7f1c){_0x4e4c69=_0x4e4c69-0x0;var _0x35def9=_0x63b6[_0x4e4c69];return _0x35def9;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var moment=require(_0x663b('0x2'));var BPromise=require('bluebird');var rs=require(_0x663b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x663b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x663b('0x5'))(_0x663b('0x6'));var config=require(_0x663b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x663b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210eb1,_0x53f5cf,_0x414dc2){return new BPromise(function(_0x2976ff,_0xf8f3ff){return client[_0x663b('0x9')](_0x210eb1,_0x414dc2)[_0x663b('0xa')](function(_0x1e1698){logger['info'](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));logger[_0x663b('0xd')](_0x663b('0xe'),_0x53f5cf,_0x663b('0xc'),JSON[_0x663b('0xf')](_0x1e1698));if(_0x1e1698[_0x663b('0x10')]){if(_0x1e1698[_0x663b('0x10')][_0x663b('0x11')]===0x1f4){logger[_0x663b('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x53f5cf,_0x1e1698['error'][_0x663b('0x12')]);return _0xf8f3ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x1e1698[_0x663b('0x10')]['message']);return _0x2976ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}else{logger[_0x663b('0x13')](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));_0x2976ff(_0x1e1698[_0x663b('0x14')][_0x663b('0x12')]);}})[_0x663b('0x15')](function(_0x63443b){logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x63443b);_0xf8f3ff(_0x63443b);});});} \ No newline at end of file +var _0x0389=['../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','debug','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x343f5b,_0x5c5f5f){var _0x14d9cc=function(_0x5808ad){while(--_0x5808ad){_0x343f5b['push'](_0x343f5b['shift']());}};_0x14d9cc(++_0x5c5f5f);}(_0x0389,0x175));var _0x9038=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0x0389[_0x533132];return _0x1a7447;};'use strict';var _=require(_0x9038('0x0'));var util=require('util');var moment=require(_0x9038('0x1'));var BPromise=require(_0x9038('0x2'));var rs=require(_0x9038('0x3'));var fs=require('fs');var Redis=require(_0x9038('0x4'));var db=require(_0x9038('0x5'))['db'];var utils=require(_0x9038('0x6'));var logger=require(_0x9038('0x7'))('rpc');var config=require(_0x9038('0x8'));var jayson=require(_0x9038('0x9'));var client=jayson[_0x9038('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5be684,_0x5dea05,_0x394000){return new BPromise(function(_0x2a81c8,_0x23ab4a){return client[_0x9038('0xb')](_0x5be684,_0x394000)['then'](function(_0xbf1aea){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5dea05,_0x9038('0xc'));logger[_0x9038('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5dea05,_0x9038('0xc'),JSON['stringify'](_0xbf1aea));if(_0xbf1aea[_0x9038('0xe')]){if(_0xbf1aea[_0x9038('0xe')][_0x9038('0xf')]===0x1f4){logger['error'](_0x9038('0x10'),_0x5dea05,_0xbf1aea[_0x9038('0xe')][_0x9038('0x11')]);return _0x23ab4a(_0xbf1aea[_0x9038('0xe')]['message']);}logger[_0x9038('0xe')](_0x9038('0x10'),_0x5dea05,_0xbf1aea[_0x9038('0xe')][_0x9038('0x11')]);return _0x2a81c8(_0xbf1aea['error']['message']);}else{logger['info'](_0x9038('0x10'),_0x5dea05,_0x9038('0xc'));_0x2a81c8(_0xbf1aea[_0x9038('0x12')][_0x9038('0x11')]);}})[_0x9038('0x13')](function(_0x9b0929){logger[_0x9038('0xe')](_0x9038('0x10'),_0x5dea05,_0x9b0929);_0x23ab4a(_0x9b0929);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index aac57c7..f1e5396 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 _0xad28=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x28ecda,_0x445af6){var _0x516338=function(_0x5f2349){while(--_0x5f2349){_0x28ecda['push'](_0x28ecda['shift']());}};_0x516338(++_0x445af6);}(_0xad28,0x1ce));var _0x8ad2=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xad28[_0x34a8c8];return _0x1fe6e5;};'use strict';var multer=require(_0x8ad2('0x0'));var util=require(_0x8ad2('0x1'));var path=require(_0x8ad2('0x2'));var timeout=require(_0x8ad2('0x3'));var express=require('express');var router=express[_0x8ad2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8ad2('0x5'));var interaction=require(_0x8ad2('0x6'));var config=require(_0x8ad2('0x7'));var controller=require(_0x8ad2('0x8'));router[_0x8ad2('0x9')]('/',auth['isAuthenticated'](),controller[_0x8ad2('0xa')]);router[_0x8ad2('0x9')](_0x8ad2('0xb'),auth[_0x8ad2('0xc')](),controller[_0x8ad2('0xd')]);router['get'](_0x8ad2('0xe'),auth[_0x8ad2('0xc')](),controller[_0x8ad2('0xf')]);router[_0x8ad2('0x10')]('/',auth[_0x8ad2('0xc')](),controller[_0x8ad2('0x11')]);router[_0x8ad2('0x12')](_0x8ad2('0xe'),auth['isAuthenticated'](),controller[_0x8ad2('0x13')]);router[_0x8ad2('0x14')](_0x8ad2('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe433=['fs-extra','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x5485a0,_0xbc0839){var _0x401e68=function(_0x10250a){while(--_0x10250a){_0x5485a0['push'](_0x5485a0['shift']());}};_0x401e68(++_0xbc0839);}(_0xe433,0x1b4));var _0x3e43=function(_0x350976,_0x39f6cf){_0x350976=_0x350976-0x0;var _0xf0c14=_0xe433[_0x350976];return _0xf0c14;};'use strict';var multer=require('multer');var util=require(_0x3e43('0x0'));var path=require(_0x3e43('0x1'));var timeout=require(_0x3e43('0x2'));var express=require('express');var router=express[_0x3e43('0x3')]();var fs_extra=require(_0x3e43('0x4'));var auth=require(_0x3e43('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e43('0x6'));router[_0x3e43('0x7')]('/',auth[_0x3e43('0x8')](),controller[_0x3e43('0x9')]);router[_0x3e43('0x7')]('/describe',auth[_0x3e43('0x8')](),controller[_0x3e43('0xa')]);router[_0x3e43('0x7')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0xc')]);router[_0x3e43('0xd')]('/',auth[_0x3e43('0x8')](),controller[_0x3e43('0xe')]);router[_0x3e43('0xf')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0x10')]);router[_0x3e43('0x11')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0x12')]);module[_0x3e43('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c988d7a..3599981 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 _0xe143=['mouseOver','timeout','INTEGER','exports','STRING','ENUM'];(function(_0x1f6e71,_0x19360b){var _0x2271aa=function(_0x2f0431){while(--_0x2f0431){_0x1f6e71['push'](_0x1f6e71['shift']());}};_0x2271aa(++_0x19360b);}(_0xe143,0x17d));var _0x3e14=function(_0x299f83,_0x1a1677){_0x299f83=_0x299f83-0x0;var _0x5200b1=_0xe143[_0x299f83];return _0x5200b1;};'use strict';var Sequelize=require('sequelize');module[_0x3e14('0x0')]={'name':{'type':Sequelize[_0x3e14('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3e14('0x2')](_0x3e14('0x3'),_0x3e14('0x4')),'defaultValue':_0x3e14('0x3')},'selector':{'type':Sequelize[_0x3e14('0x1')]},'timeout':{'type':Sequelize[_0x3e14('0x5')]}}; \ No newline at end of file +var _0xb0f4=['mouseOver','INTEGER','exports','STRING','ENUM'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xb0f4,0x66));var _0x4b0f=function(_0x10e31a,_0x6a302d){_0x10e31a=_0x10e31a-0x0;var _0xa3e8a0=_0xb0f4[_0x10e31a];return _0xa3e8a0;};'use strict';var Sequelize=require('sequelize');module[_0x4b0f('0x0')]={'name':{'type':Sequelize[_0x4b0f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4b0f('0x2')]('mouseOver','timeout'),'defaultValue':_0x4b0f('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4b0f('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 6efa085..2c11350 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 _0x4491=['then','stack','send','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','create','body','catch','params','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x5ca318,_0x46d445){var _0x50879e=function(_0x1b993a){while(--_0x1b993a){_0x5ca318['push'](_0x5ca318['shift']());}};_0x50879e(++_0x46d445);}(_0x4491,0x1bb));var _0x1449=function(_0x2827d7,_0x4966fb){_0x2827d7=_0x2827d7-0x0;var _0x4e2d25=_0x4491[_0x2827d7];return _0x4e2d25;};'use strict';var emlformat=require(_0x1449('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1449('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1449('0x2'));var moment=require(_0x1449('0x3'));var BPromise=require(_0x1449('0x4'));var Mustache=require(_0x1449('0x5'));var util=require(_0x1449('0x6'));var path=require(_0x1449('0x7'));var sox=require('sox');var csv=require(_0x1449('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1449('0x9'));var _=require(_0x1449('0xa'));var squel=require(_0x1449('0xb'));var crypto=require(_0x1449('0xc'));var jsforce=require(_0x1449('0xd'));var deskjs=require(_0x1449('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1449('0xf'));var Papa=require(_0x1449('0x10'));var Redis=require('ioredis');var authService=require(_0x1449('0x11'));var qs=require(_0x1449('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1449('0x13'));var logger=require(_0x1449('0x14'))('api');var utils=require(_0x1449('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1449('0x16'))['db'];function respondWithStatusCode(_0x3f5424,_0x399815){_0x399815=_0x399815||0xcc;return function(_0x25bce3){if(_0x25bce3){return _0x3f5424[_0x1449('0x17')](_0x399815);}return _0x3f5424[_0x1449('0x18')](_0x399815)[_0x1449('0x19')]();};}function respondWithResult(_0x377c96,_0x267d9a){_0x267d9a=_0x267d9a||0xc8;return function(_0x41b34d){if(_0x41b34d){return _0x377c96[_0x1449('0x18')](_0x267d9a)[_0x1449('0x1a')](_0x41b34d);}};}function respondWithFilteredResult(_0x441344,_0x2cf76c){return function(_0x1ec7e8){if(_0x1ec7e8){var _0x59b128=typeof _0x2cf76c[_0x1449('0x1b')]===_0x1449('0x1c')&&typeof _0x2cf76c['limit']===_0x1449('0x1c');var _0x290b72=_0x1ec7e8[_0x1449('0x1d')];var _0x364878=_0x59b128?0x0:_0x2cf76c[_0x1449('0x1b')];var _0x30a65f=_0x59b128?_0x1ec7e8[_0x1449('0x1d')]:_0x2cf76c[_0x1449('0x1b')]+_0x2cf76c[_0x1449('0x1e')];var _0x2dbae1;if(_0x30a65f>=_0x290b72){_0x30a65f=_0x290b72;_0x2dbae1=0xc8;}else{_0x2dbae1=0xce;}_0x441344[_0x1449('0x18')](_0x2dbae1);return _0x441344[_0x1449('0x1f')](_0x1449('0x20'),_0x364878+'-'+_0x30a65f+'/'+_0x290b72)['json'](_0x1ec7e8);}return null;};}function patchUpdates(_0x108f41){return function(_0x49c4d6){try{jsonpatch[_0x1449('0x21')](_0x49c4d6,_0x108f41,!![]);}catch(_0xaaea1d){return BPromise[_0x1449('0x22')](_0xaaea1d);}return _0x49c4d6[_0x1449('0x23')]();};}function saveUpdates(_0x3a2c85,_0x4dcc1b){return function(_0x4c86b9){if(_0x4c86b9){return _0x4c86b9[_0x1449('0x24')](_0x3a2c85)[_0x1449('0x25')](function(_0x100ac6){return _0x100ac6;});}return null;};}function removeEntity(_0x356d6b,_0x545cee){return function(_0x29e254){if(_0x29e254){return _0x29e254['destroy']()[_0x1449('0x25')](function(){_0x356d6b[_0x1449('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a8cf0,_0x507a14){return function(_0x1ef1e3){if(!_0x1ef1e3){_0x5a8cf0[_0x1449('0x17')](0x194);}return _0x1ef1e3;};}function handleError(_0x39ad3c,_0x529dae){_0x529dae=_0x529dae||0x1f4;return function(_0x40e7d5){logger['error'](_0x40e7d5[_0x1449('0x26')]);if(_0x40e7d5['name']){delete _0x40e7d5['name'];}_0x39ad3c[_0x1449('0x18')](_0x529dae)[_0x1449('0x27')](_0x40e7d5);};}exports['show']=function(_0xe6900c,_0x5c3fdf){var _0x2836a1={'raw':!![],'where':{'id':_0xe6900c['params']['id']}},_0x36a74a={};_0x36a74a['model']=_[_0x1449('0x28')](db['ChatProactiveAction'][_0x1449('0x29')]);_0x36a74a[_0x1449('0x2a')]=_[_0x1449('0x28')](_0xe6900c[_0x1449('0x2a')]);_0x36a74a[_0x1449('0x2b')]=_[_0x1449('0x2c')](_0x36a74a[_0x1449('0x2d')],_0x36a74a[_0x1449('0x2a')]);_0x2836a1[_0x1449('0x2e')]=_[_0x1449('0x2c')](_0x36a74a[_0x1449('0x2d')],qs[_0x1449('0x2f')](_0xe6900c[_0x1449('0x2a')][_0x1449('0x2f')]));_0x2836a1[_0x1449('0x2e')]=_0x2836a1[_0x1449('0x2e')][_0x1449('0x30')]?_0x2836a1['attributes']:_0x36a74a[_0x1449('0x2d')];if(_0xe6900c['query'][_0x1449('0x31')]){_0x2836a1[_0x1449('0x32')]=[{'all':!![]}];}_0x2836a1=_[_0x1449('0x33')]({},_0x2836a1,_0xe6900c[_0x1449('0x34')]);return db[_0x1449('0x35')][_0x1449('0x36')](_0x2836a1)[_0x1449('0x25')](handleEntityNotFound(_0x5c3fdf,null))[_0x1449('0x25')](respondWithResult(_0x5c3fdf,null))['catch'](handleError(_0x5c3fdf,null));};exports['create']=function(_0x59c075,_0x19610c){return db[_0x1449('0x35')][_0x1449('0x37')](_0x59c075[_0x1449('0x38')],{})[_0x1449('0x25')](respondWithResult(_0x19610c,0xc9))[_0x1449('0x39')](handleError(_0x19610c,null));};exports[_0x1449('0x24')]=function(_0x2b7bd8,_0x5a1f92){if(_0x2b7bd8[_0x1449('0x38')]['id']){delete _0x2b7bd8[_0x1449('0x38')]['id'];}return db[_0x1449('0x35')][_0x1449('0x36')]({'where':{'id':_0x2b7bd8[_0x1449('0x3a')]['id']}})[_0x1449('0x25')](handleEntityNotFound(_0x5a1f92,null))['then'](saveUpdates(_0x2b7bd8[_0x1449('0x38')],null))[_0x1449('0x25')](respondWithResult(_0x5a1f92,null))['catch'](handleError(_0x5a1f92,null));};exports[_0x1449('0x3b')]=function(_0x4c8d2a,_0x2ccb90){return db[_0x1449('0x35')][_0x1449('0x36')]({'where':{'id':_0x4c8d2a[_0x1449('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2ccb90,null))[_0x1449('0x25')](removeEntity(_0x2ccb90,null))[_0x1449('0x39')](handleError(_0x2ccb90,null));}; \ No newline at end of file +var _0xe49a=['status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xe49a,0xd7));var _0xae49=function(_0x5bfbc4,_0xceeb1){_0x5bfbc4=_0x5bfbc4-0x0;var _0x1489d3=_0xe49a[_0x5bfbc4];return _0x1489d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae49('0x0'));var zipdir=require(_0xae49('0x1'));var jsonpatch=require(_0xae49('0x2'));var rp=require(_0xae49('0x3'));var moment=require(_0xae49('0x4'));var BPromise=require(_0xae49('0x5'));var Mustache=require(_0xae49('0x6'));var util=require('util');var path=require(_0xae49('0x7'));var sox=require(_0xae49('0x8'));var csv=require(_0xae49('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae49('0xa'));var _=require('lodash');var squel=require(_0xae49('0xb'));var crypto=require(_0xae49('0xc'));var jsforce=require(_0xae49('0xd'));var deskjs=require(_0xae49('0xe'));var toCsv=require(_0xae49('0x9'));var querystring=require(_0xae49('0xf'));var Papa=require(_0xae49('0x10'));var Redis=require('ioredis');var authService=require(_0xae49('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xae49('0x12'));var hardwareService=require(_0xae49('0x13'));var logger=require(_0xae49('0x14'))('api');var utils=require(_0xae49('0x15'));var config=require(_0xae49('0x16'));var licenseUtil=require(_0xae49('0x17'));var db=require(_0xae49('0x18'))['db'];function respondWithStatusCode(_0x16d017,_0x3b7197){_0x3b7197=_0x3b7197||0xcc;return function(_0x56a96e){if(_0x56a96e){return _0x16d017['sendStatus'](_0x3b7197);}return _0x16d017[_0xae49('0x19')](_0x3b7197)[_0xae49('0x1a')]();};}function respondWithResult(_0x369b7e,_0xffb91e){_0xffb91e=_0xffb91e||0xc8;return function(_0x2e9256){if(_0x2e9256){return _0x369b7e[_0xae49('0x19')](_0xffb91e)[_0xae49('0x1b')](_0x2e9256);}};}function respondWithFilteredResult(_0x182d26,_0x296e27){return function(_0x603f4c){if(_0x603f4c){var _0x1a0965=typeof _0x296e27['offset']===_0xae49('0x1c')&&typeof _0x296e27[_0xae49('0x1d')]===_0xae49('0x1c');var _0x5ca474=_0x603f4c[_0xae49('0x1e')];var _0x1ec3be=_0x1a0965?0x0:_0x296e27['offset'];var _0x290d8b=_0x1a0965?_0x603f4c[_0xae49('0x1e')]:_0x296e27['offset']+_0x296e27['limit'];var _0x30ec79;if(_0x290d8b>=_0x5ca474){_0x290d8b=_0x5ca474;_0x30ec79=0xc8;}else{_0x30ec79=0xce;}_0x182d26['status'](_0x30ec79);return _0x182d26['set']('Content-Range',_0x1ec3be+'-'+_0x290d8b+'/'+_0x5ca474)[_0xae49('0x1b')](_0x603f4c);}return null;};}function patchUpdates(_0x454ae5){return function(_0x48562a){try{jsonpatch[_0xae49('0x1f')](_0x48562a,_0x454ae5,!![]);}catch(_0x836b55){return BPromise[_0xae49('0x20')](_0x836b55);}return _0x48562a[_0xae49('0x21')]();};}function saveUpdates(_0x16fa5b,_0x4b3830){return function(_0x76ed84){if(_0x76ed84){return _0x76ed84[_0xae49('0x22')](_0x16fa5b)[_0xae49('0x23')](function(_0x595129){return _0x595129;});}return null;};}function removeEntity(_0x3df402,_0x5d3fcc){return function(_0x1ca991){if(_0x1ca991){return _0x1ca991[_0xae49('0x24')]()[_0xae49('0x23')](function(){_0x3df402['status'](0xcc)[_0xae49('0x1a')]();});}};}function handleEntityNotFound(_0x38fdf4,_0x504e9e){return function(_0x54d4d0){if(!_0x54d4d0){_0x38fdf4['sendStatus'](0x194);}return _0x54d4d0;};}function handleError(_0x4167f4,_0x189e62){_0x189e62=_0x189e62||0x1f4;return function(_0xd79a45){logger[_0xae49('0x25')](_0xd79a45[_0xae49('0x26')]);if(_0xd79a45['name']){delete _0xd79a45[_0xae49('0x27')];}_0x4167f4[_0xae49('0x19')](_0x189e62)[_0xae49('0x28')](_0xd79a45);};}exports[_0xae49('0x29')]=function(_0x1178ce,_0x20015f){var _0x36ba34={'raw':!![],'where':{'id':_0x1178ce[_0xae49('0x2a')]['id']}},_0xb47cdf={};_0xb47cdf[_0xae49('0x2b')]=_[_0xae49('0x2c')](db['ChatProactiveAction'][_0xae49('0x2d')]);_0xb47cdf['query']=_[_0xae49('0x2c')](_0x1178ce['query']);_0xb47cdf[_0xae49('0x2e')]=_[_0xae49('0x2f')](_0xb47cdf[_0xae49('0x2b')],_0xb47cdf[_0xae49('0x30')]);_0x36ba34[_0xae49('0x31')]=_[_0xae49('0x2f')](_0xb47cdf[_0xae49('0x2b')],qs['fields'](_0x1178ce[_0xae49('0x30')]['fields']));_0x36ba34[_0xae49('0x31')]=_0x36ba34['attributes'][_0xae49('0x32')]?_0x36ba34['attributes']:_0xb47cdf[_0xae49('0x2b')];if(_0x1178ce[_0xae49('0x30')][_0xae49('0x33')]){_0x36ba34[_0xae49('0x34')]=[{'all':!![]}];}_0x36ba34=_[_0xae49('0x35')]({},_0x36ba34,_0x1178ce[_0xae49('0x36')]);return db[_0xae49('0x37')][_0xae49('0x38')](_0x36ba34)[_0xae49('0x23')](handleEntityNotFound(_0x20015f,null))[_0xae49('0x23')](respondWithResult(_0x20015f,null))[_0xae49('0x39')](handleError(_0x20015f,null));};exports[_0xae49('0x3a')]=function(_0x5b8907,_0x1278d7){return db[_0xae49('0x37')][_0xae49('0x3a')](_0x5b8907[_0xae49('0x3b')],{})[_0xae49('0x23')](respondWithResult(_0x1278d7,0xc9))[_0xae49('0x39')](handleError(_0x1278d7,null));};exports[_0xae49('0x22')]=function(_0x332d06,_0x4135d7){if(_0x332d06[_0xae49('0x3b')]['id']){delete _0x332d06['body']['id'];}return db[_0xae49('0x37')]['find']({'where':{'id':_0x332d06['params']['id']}})[_0xae49('0x23')](handleEntityNotFound(_0x4135d7,null))['then'](saveUpdates(_0x332d06['body'],null))[_0xae49('0x23')](respondWithResult(_0x4135d7,null))[_0xae49('0x39')](handleError(_0x4135d7,null));};exports['destroy']=function(_0x8b165,_0x4e7da8){return db['ChatProactiveAction'][_0xae49('0x38')]({'where':{'id':_0x8b165[_0xae49('0x2a')]['id']}})[_0xae49('0x23')](handleEntityNotFound(_0x4e7da8,null))[_0xae49('0x23')](removeEntity(_0x4e7da8,null))[_0xae49('0x39')](handleError(_0x4e7da8,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index ec746e0..1efcd09 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 _0x9777=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9777,0x1bf));var _0x7977=function(_0x2475b7,_0x29fe3b){_0x2475b7=_0x2475b7-0x0;var _0x26d294=_0x9777[_0x2475b7];return _0x26d294;};'use strict';var _=require(_0x7977('0x0'));var util=require(_0x7977('0x1'));var logger=require(_0x7977('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7977('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7977('0x4'));var rimraf=require(_0x7977('0x5'));var config=require(_0x7977('0x6'));var attributes=require(_0x7977('0x7'));module[_0x7977('0x8')]=function(_0x48f859,_0x3581b9){return _0x48f859[_0x7977('0x9')](_0x7977('0xa'),attributes,{'tableName':_0x7977('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe479=['define','chat_proactive_actions','util','../../config/logger','api','moment','request-promise','path','./chatProactiveAction.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe479,0x156));var _0x9e47=function(_0x4a9061,_0x44e947){_0x4a9061=_0x4a9061-0x0;var _0x4a3843=_0xe479[_0x4a9061];return _0x4a3843;};'use strict';var _=require('lodash');var util=require(_0x9e47('0x0'));var logger=require(_0x9e47('0x1'))(_0x9e47('0x2'));var moment=require(_0x9e47('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e47('0x4'));var fs=require('fs');var path=require(_0x9e47('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e47('0x6'));module[_0x9e47('0x7')]=function(_0x58883e,_0x23d216){return _0x58883e[_0x9e47('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x9e47('0x9'),'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 ec9c342..60c746a 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 _0x1587=['ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','error','code','ChatProactiveAction,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0x6b25ac,_0xe9fa01){var _0x4c84e9=function(_0x2bf6ec){while(--_0x2bf6ec){_0x6b25ac['push'](_0x6b25ac['shift']());}};_0x4c84e9(++_0xe9fa01);}(_0x1587,0x6a));var _0x7158=function(_0x35d909,_0x58b59e){_0x35d909=_0x35d909-0x0;var _0x5874ba=_0x1587[_0x35d909];return _0x5874ba;};'use strict';var _=require('lodash');var util=require(_0x7158('0x0'));var moment=require(_0x7158('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7158('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7158('0x3'))('rpc');var config=require(_0x7158('0x4'));var jayson=require(_0x7158('0x5'));var client=jayson[_0x7158('0x6')][_0x7158('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x292df3,_0x2488d2,_0x1d68ac){return new BPromise(function(_0x257220,_0x37598e){return client[_0x7158('0x8')](_0x292df3,_0x1d68ac)[_0x7158('0x9')](function(_0x103b38){logger[_0x7158('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x2488d2,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2488d2,'request\x20sent',JSON['stringify'](_0x103b38));if(_0x103b38[_0x7158('0xb')]){if(_0x103b38['error'][_0x7158('0xc')]===0x1f4){logger[_0x7158('0xb')](_0x7158('0xd'),_0x2488d2,_0x103b38['error'][_0x7158('0xe')]);return _0x37598e(_0x103b38[_0x7158('0xb')]['message']);}logger[_0x7158('0xb')](_0x7158('0xd'),_0x2488d2,_0x103b38[_0x7158('0xb')][_0x7158('0xe')]);return _0x257220(_0x103b38[_0x7158('0xb')][_0x7158('0xe')]);}else{logger[_0x7158('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x2488d2,_0x7158('0xf'));_0x257220(_0x103b38[_0x7158('0x10')][_0x7158('0xe')]);}})[_0x7158('0x11')](function(_0x210fbe){logger[_0x7158('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x2488d2,_0x210fbe);_0x37598e(_0x210fbe);});});} \ No newline at end of file +var _0x2246=['moment','randomstring','../../mysqldb','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','result','catch','lodash'];(function(_0x5e3cef,_0x3c57f5){var _0x34c370=function(_0x4bc3e4){while(--_0x4bc3e4){_0x5e3cef['push'](_0x5e3cef['shift']());}};_0x34c370(++_0x3c57f5);}(_0x2246,0xb3));var _0x6224=function(_0x2bfd84,_0x1b455c){_0x2bfd84=_0x2bfd84-0x0;var _0x143f36=_0x2246[_0x2bfd84];return _0x143f36;};'use strict';var _=require(_0x6224('0x0'));var util=require('util');var moment=require(_0x6224('0x1'));var BPromise=require('bluebird');var rs=require(_0x6224('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6224('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6224('0x4'));var config=require(_0x6224('0x5'));var jayson=require(_0x6224('0x6'));var client=jayson[_0x6224('0x7')][_0x6224('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2db4f3,_0x56a1c9,_0x90c8bb){return new BPromise(function(_0x1af029,_0x5d9c4f){return client[_0x6224('0x9')](_0x2db4f3,_0x90c8bb)['then'](function(_0x37eeab){logger[_0x6224('0xa')](_0x6224('0xb'),_0x56a1c9,_0x6224('0xc'));logger[_0x6224('0xd')](_0x6224('0xe'),_0x56a1c9,_0x6224('0xc'),JSON[_0x6224('0xf')](_0x37eeab));if(_0x37eeab[_0x6224('0x10')]){if(_0x37eeab[_0x6224('0x10')]['code']===0x1f4){logger[_0x6224('0x10')](_0x6224('0xb'),_0x56a1c9,_0x37eeab[_0x6224('0x10')][_0x6224('0x11')]);return _0x5d9c4f(_0x37eeab[_0x6224('0x10')][_0x6224('0x11')]);}logger[_0x6224('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x56a1c9,_0x37eeab['error'][_0x6224('0x11')]);return _0x1af029(_0x37eeab[_0x6224('0x10')]['message']);}else{logger['info'](_0x6224('0xb'),_0x56a1c9,'request\x20sent');_0x1af029(_0x37eeab[_0x6224('0x12')]['message']);}})[_0x6224('0x13')](function(_0x447097){logger[_0x6224('0x10')](_0x6224('0xb'),_0x56a1c9,_0x447097);_0x5d9c4f(_0x447097);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 4da3ff1..5eae47b 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 _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1fe29d,_0x1d05c5){var _0x5d5506=function(_0x9806c6){while(--_0x9806c6){_0x1fe29d['push'](_0x1fe29d['shift']());}};_0x5d5506(++_0x1d05c5);}(_0x2d17,0x17e));var _0x72d1=function(_0x4e2dd9,_0x117a37){_0x4e2dd9=_0x4e2dd9-0x0;var _0x3fc116=_0x2d17[_0x4e2dd9];return _0x3fc116;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router; \ No newline at end of file +var _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0xeda5dd,_0x2c1360){var _0x3f0237=function(_0x517dc2){while(--_0x517dc2){_0xeda5dd['push'](_0xeda5dd['shift']());}};_0x3f0237(++_0x2c1360);}(_0xdc97,0x13b));var _0x7dc9=function(_0x236fdf,_0x58fb28){_0x236fdf=_0x236fdf-0x0;var _0x40c49a=_0xdc97[_0x236fdf];return _0x40c49a;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index d07d9b3..edcdddc 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 _0xc60a=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','beepall'];(function(_0x396f60,_0x44c360){var _0x569f36=function(_0x1b2f25){while(--_0x1b2f25){_0x396f60['push'](_0x396f60['shift']());}};_0x569f36(++_0x44c360);}(_0xc60a,0xa2));var _0xac60=function(_0x3a018d,_0xd6683a){_0x3a018d=_0x3a018d-0x0;var _0x301f6c=_0xc60a[_0x3a018d];return _0x301f6c;};'use strict';var Sequelize=require(_0xac60('0x0'));module[_0xac60('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac60('0x2')]},'timeout':{'type':Sequelize[_0xac60('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac60('0x4')]('rrmemory',_0xac60('0x5'),_0xac60('0x6'))}}; \ No newline at end of file +var _0x0407=['ENUM','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x95ddad,_0x4d021a){var _0x51c73d=function(_0x227cff){while(--_0x227cff){_0x95ddad['push'](_0x95ddad['shift']());}};_0x51c73d(++_0x4d021a);}(_0x0407,0x1ad));var _0x7040=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x0407[_0x4b4277];return _0x1ff405;};'use strict';var Sequelize=require(_0x7040('0x0'));module[_0x7040('0x1')]={'name':{'type':Sequelize[_0x7040('0x2')],'unique':_0x7040('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7040('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7040('0x5')]('rrmemory',_0x7040('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0c026e8..f2a546d 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 _0x0cf9=['path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','find','describe','findOne','UserChatQueue','order','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','Team','length','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','zip-dir','fast-json-patch','request-promise','util'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0x0cf9,0x8d));var _0x90cf=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x0cf9[_0x34e14d];return _0x3d8e08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x90cf('0x0'));var jsonpatch=require(_0x90cf('0x1'));var rp=require(_0x90cf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x90cf('0x3'));var path=require(_0x90cf('0x4'));var sox=require('sox');var csv=require(_0x90cf('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90cf('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x90cf('0x7'));var jsforce=require(_0x90cf('0x8'));var deskjs=require(_0x90cf('0x9'));var toCsv=require(_0x90cf('0x5'));var querystring=require(_0x90cf('0xa'));var Papa=require(_0x90cf('0xb'));var Redis=require(_0x90cf('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x90cf('0xd'));var as=require(_0x90cf('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90cf('0xf'))(_0x90cf('0x10'));var utils=require(_0x90cf('0x11'));var config=require(_0x90cf('0x12'));var licenseUtil=require(_0x90cf('0x13'));var db=require('../../mysqldb')['db'];config[_0x90cf('0x14')]=_[_0x90cf('0x15')](config[_0x90cf('0x14')],{'host':_0x90cf('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90cf('0x14')]));require('./chatQueue.socket')[_0x90cf('0x17')](socket);var jayson=require(_0x90cf('0x18'));var client=jayson[_0x90cf('0x19')][_0x90cf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x187490,_0x3b0568,_0xbc473c,_0x48fc35){return new BPromise(function(_0x5cd5a5,_0x32c5e6){var _0xeaeeed=_0x48fc35||client;return _0xeaeeed['request'](_0x187490,_0xbc473c)['then'](function(_0x428f9a){logger[_0x90cf('0x1b')](_0x90cf('0x1c'),_0x3b0568,_0x90cf('0x1d'));logger['debug'](_0x90cf('0x1e'),_0x3b0568,_0x90cf('0x1d'),JSON['stringify'](_0x428f9a));if(_0x428f9a[_0x90cf('0x1f')]){if(_0x428f9a[_0x90cf('0x1f')]['code']===0x1f4){logger[_0x90cf('0x1f')](_0x90cf('0x1c'),_0x3b0568,_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);return _0x32c5e6(_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x3b0568,_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);return _0x5cd5a5(_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);}else{logger[_0x90cf('0x1b')](_0x90cf('0x1c'),_0x3b0568,_0x90cf('0x1d'));_0x5cd5a5(_0x428f9a[_0x90cf('0x21')]['message']);}})['catch'](function(_0xf7939f){logger[_0x90cf('0x1f')](_0x90cf('0x1c'),_0x3b0568,_0xf7939f);_0x32c5e6(_0xf7939f);});});}function respondWithStatusCode(_0x1020bb,_0x13973b){_0x13973b=_0x13973b||0xcc;return function(_0x1426fe){if(_0x1426fe){return _0x1020bb[_0x90cf('0x22')](_0x13973b);}return _0x1020bb[_0x90cf('0x23')](_0x13973b)[_0x90cf('0x24')]();};}function respondWithResult(_0x239c06,_0x17542c){_0x17542c=_0x17542c||0xc8;return function(_0x555550){if(_0x555550){return _0x239c06['status'](_0x17542c)[_0x90cf('0x25')](_0x555550);}};}function respondWithFilteredResult(_0x10e6b7,_0x32ab34){return function(_0xcc0e0a){if(_0xcc0e0a){var _0x1123d4=typeof _0x32ab34[_0x90cf('0x26')]===_0x90cf('0x27')&&typeof _0x32ab34[_0x90cf('0x28')]===_0x90cf('0x27');var _0x417737=_0xcc0e0a[_0x90cf('0x29')];var _0x1c5dea=_0x1123d4?0x0:_0x32ab34['offset'];var _0x59f5e6=_0x1123d4?_0xcc0e0a[_0x90cf('0x29')]:_0x32ab34[_0x90cf('0x26')]+_0x32ab34['limit'];var _0x508f74;if(_0x59f5e6>=_0x417737){_0x59f5e6=_0x417737;_0x508f74=0xc8;}else{_0x508f74=0xce;}_0x10e6b7[_0x90cf('0x23')](_0x508f74);return _0x10e6b7[_0x90cf('0x2a')](_0x90cf('0x2b'),_0x1c5dea+'-'+_0x59f5e6+'/'+_0x417737)[_0x90cf('0x25')](_0xcc0e0a);}return null;};}function patchUpdates(_0x4035a1){return function(_0x45d900){try{jsonpatch['apply'](_0x45d900,_0x4035a1,!![]);}catch(_0x35f4a2){return BPromise[_0x90cf('0x2c')](_0x35f4a2);}return _0x45d900[_0x90cf('0x2d')]();};}function saveUpdates(_0x3e39e6,_0x2526c4){return function(_0x1b170a){if(_0x1b170a){return _0x1b170a['update'](_0x3e39e6)[_0x90cf('0x2e')](function(_0x6cf176){return _0x6cf176;});}return null;};}function removeEntity(_0x2cd268,_0x155e6b){return function(_0x34cfbc){if(_0x34cfbc){return _0x34cfbc[_0x90cf('0x2f')]()['then'](function(){var _0x218bd6=_0x34cfbc[_0x90cf('0x30')]({'plain':!![]});var _0x3cf026=_0x90cf('0x31');return db[_0x90cf('0x32')][_0x90cf('0x2f')]({'where':{'type':_0x3cf026,'resourceId':_0x218bd6['id']}})[_0x90cf('0x2e')](function(){return _0x34cfbc;});})[_0x90cf('0x2e')](function(){_0x2cd268[_0x90cf('0x23')](0xcc)[_0x90cf('0x24')]();});}};}function handleEntityNotFound(_0x3f4b27,_0x2fcc4c){return function(_0x204405){if(!_0x204405){_0x3f4b27[_0x90cf('0x22')](0x194);}return _0x204405;};}function handleError(_0x1abcf2,_0x4518ac){_0x4518ac=_0x4518ac||0x1f4;return function(_0x396bbb){logger[_0x90cf('0x1f')](_0x396bbb[_0x90cf('0x33')]);if(_0x396bbb['name']){delete _0x396bbb[_0x90cf('0x34')];}_0x1abcf2[_0x90cf('0x23')](_0x4518ac)[_0x90cf('0x35')](_0x396bbb);};}exports['index']=function(_0x25ddb3,_0xe4e6d3){var _0x265591={},_0x324ba2={},_0x442da3={'count':0x0,'rows':[]};var _0xdd105a=_[_0x90cf('0x36')](db[_0x90cf('0x37')]['rawAttributes'],function(_0x2b43e3){return{'name':_0x2b43e3[_0x90cf('0x38')],'type':_0x2b43e3[_0x90cf('0x39')][_0x90cf('0x3a')]};});_0x324ba2['model']=_[_0x90cf('0x36')](_0xdd105a,'name');_0x324ba2[_0x90cf('0x3b')]=_[_0x90cf('0x3c')](_0x25ddb3[_0x90cf('0x3b')]);_0x324ba2[_0x90cf('0x3d')]=_[_0x90cf('0x3e')](_0x324ba2[_0x90cf('0x3f')],_0x324ba2[_0x90cf('0x3b')]);_0x265591['attributes']=_[_0x90cf('0x3e')](_0x324ba2[_0x90cf('0x3f')],qs[_0x90cf('0x40')](_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x40')]));_0x265591[_0x90cf('0x41')]=_0x265591['attributes']['length']?_0x265591[_0x90cf('0x41')]:_0x324ba2[_0x90cf('0x3f')];if(!_0x25ddb3['query'][_0x90cf('0x42')](_0x90cf('0x43'))){_0x265591['limit']=qs[_0x90cf('0x28')](_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x28')]);_0x265591['offset']=qs['offset'](_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x26')]);}_0x265591['order']=qs[_0x90cf('0x44')](_0x25ddb3['query'][_0x90cf('0x44')]);_0x265591[_0x90cf('0x45')]=qs[_0x90cf('0x3d')](_[_0x90cf('0x46')](_0x25ddb3[_0x90cf('0x3b')],_0x324ba2['filters']),_0xdd105a);if(_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x47')]){_0x265591[_0x90cf('0x45')]=_[_0x90cf('0x48')](_0x265591[_0x90cf('0x45')],{'$or':_[_0x90cf('0x36')](_0xdd105a,function(_0x102233){if(_0x102233[_0x90cf('0x39')]!==_0x90cf('0x49')){var _0x3a399a={};_0x3a399a[_0x102233[_0x90cf('0x34')]]={'$like':'%'+_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x47')]+'%'};return _0x3a399a;}})});}_0x265591=_[_0x90cf('0x48')]({},_0x265591,_0x25ddb3[_0x90cf('0x4a')]);var _0x2a0699={'where':_0x265591[_0x90cf('0x45')]};return db[_0x90cf('0x37')][_0x90cf('0x29')](_0x2a0699)[_0x90cf('0x2e')](function(_0x21edcf){_0x442da3[_0x90cf('0x29')]=_0x21edcf;if(_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x4b')]){_0x265591['include']=[{'all':!![]}];}return db['ChatQueue'][_0x90cf('0x4c')](_0x265591);})[_0x90cf('0x2e')](function(_0x418b6a){_0x442da3[_0x90cf('0x4d')]=_0x418b6a;return _0x442da3;})['then'](respondWithFilteredResult(_0xe4e6d3,_0x265591))[_0x90cf('0x4e')](handleError(_0xe4e6d3,null));};exports[_0x90cf('0x4f')]=function(_0x4cf351,_0x1b3508){var _0x21fbf5={'raw':!![],'where':{'id':_0x4cf351['params']['id']}},_0x2b694a={};_0x2b694a[_0x90cf('0x3f')]=_[_0x90cf('0x3c')](db[_0x90cf('0x37')][_0x90cf('0x50')]);_0x2b694a[_0x90cf('0x3b')]=_['keys'](_0x4cf351['query']);_0x2b694a['filters']=_[_0x90cf('0x3e')](_0x2b694a[_0x90cf('0x3f')],_0x2b694a[_0x90cf('0x3b')]);_0x21fbf5[_0x90cf('0x41')]=_[_0x90cf('0x3e')](_0x2b694a[_0x90cf('0x3f')],qs[_0x90cf('0x40')](_0x4cf351[_0x90cf('0x3b')][_0x90cf('0x40')]));_0x21fbf5[_0x90cf('0x41')]=_0x21fbf5['attributes']['length']?_0x21fbf5['attributes']:_0x2b694a[_0x90cf('0x3f')];if(_0x4cf351[_0x90cf('0x3b')][_0x90cf('0x4b')]){_0x21fbf5['include']=[{'all':!![]}];}_0x21fbf5=_[_0x90cf('0x48')]({},_0x21fbf5,_0x4cf351[_0x90cf('0x4a')]);return db['ChatQueue']['find'](_0x21fbf5)['then'](handleEntityNotFound(_0x1b3508,null))[_0x90cf('0x2e')](respondWithResult(_0x1b3508,null))[_0x90cf('0x4e')](handleError(_0x1b3508,null));};exports['create']=function(_0x4974e6,_0x3199e0){return db[_0x90cf('0x37')][_0x90cf('0x51')](_0x4974e6['body'],{})[_0x90cf('0x2e')](function(_0x5b261a){var _0x265b6e=_0x4974e6[_0x90cf('0x52')][_0x90cf('0x30')]({'plain':!![]});if(!_0x265b6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x265b6e[_0x90cf('0x53')]===_0x90cf('0x52')){var _0x5875cb=_0x5b261a[_0x90cf('0x30')]({'plain':!![]});var _0x49b1a7=_0x90cf('0x31');return db[_0x90cf('0x54')]['find']({'where':{'name':_0x49b1a7,'userProfileId':_0x265b6e[_0x90cf('0x55')]},'raw':!![]})['then'](function(_0x5ca777){if(_0x5ca777&&_0x5ca777[_0x90cf('0x56')]===0x0){return db[_0x90cf('0x32')][_0x90cf('0x51')]({'name':_0x5875cb[_0x90cf('0x34')],'resourceId':_0x5875cb['id'],'type':_0x5ca777[_0x90cf('0x34')],'sectionId':_0x5ca777['id']},{})[_0x90cf('0x2e')](function(){return _0x5b261a;});}else{return _0x5b261a;}})[_0x90cf('0x4e')](function(_0x400cde){logger[_0x90cf('0x1f')](_0x90cf('0x57'),_0x400cde);throw _0x400cde;});}return _0x5b261a;})[_0x90cf('0x2e')](respondWithResult(_0x3199e0,0xc9))[_0x90cf('0x4e')](handleError(_0x3199e0,null));};exports[_0x90cf('0x58')]=function(_0x3ca6b8,_0x2c5139){if(_0x3ca6b8[_0x90cf('0x59')]['id']){delete _0x3ca6b8['body']['id'];}return db[_0x90cf('0x37')]['find']({'where':{'id':_0x3ca6b8[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x2c5139,null))['then'](saveUpdates(_0x3ca6b8[_0x90cf('0x59')],null))[_0x90cf('0x2e')](respondWithResult(_0x2c5139,null))[_0x90cf('0x4e')](handleError(_0x2c5139,null));};exports[_0x90cf('0x2f')]=function(_0x2903a4,_0x36f359){return db['ChatQueue'][_0x90cf('0x5b')]({'where':{'id':_0x2903a4[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x36f359,null))[_0x90cf('0x2e')](removeEntity(_0x36f359,null))['catch'](handleError(_0x36f359,null));};exports[_0x90cf('0x5c')]=function(_0x3d53ea,_0x442b57){return db[_0x90cf('0x37')][_0x90cf('0x5c')]()[_0x90cf('0x2e')](respondWithResult(_0x442b57,null))[_0x90cf('0x4e')](handleError(_0x442b57,null));};exports['getMembers']=function(_0x2ac6da,_0x40dd77,_0x2fefd0){var _0x112280={'raw':!![],'where':{}},_0x55b382={},_0x2dfa37;return db[_0x90cf('0x37')][_0x90cf('0x5d')]({'where':{'id':_0x2ac6da[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x40dd77,null))[_0x90cf('0x2e')](function(_0x394ea0){if(_0x394ea0){_0x2dfa37=_0x394ea0['get']({'plain':!![]});_0x55b382[_0x90cf('0x3f')]=_['keys'](db[_0x90cf('0x5e')]['rawAttributes']);_0x55b382[_0x90cf('0x3b')]=_[_0x90cf('0x3c')](_0x2ac6da['query']);_0x55b382[_0x90cf('0x3d')]=_['intersection'](_0x55b382['model'],_0x55b382[_0x90cf('0x3b')]);_0x112280[_0x90cf('0x41')]=_['intersection'](_0x55b382['model'],qs[_0x90cf('0x40')](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x40')]));_0x112280['attributes']=_0x112280[_0x90cf('0x41')]['length']?_0x112280[_0x90cf('0x41')]:_0x55b382[_0x90cf('0x3f')];if(!_0x2ac6da['query'][_0x90cf('0x42')](_0x90cf('0x43'))){_0x112280[_0x90cf('0x28')]=qs[_0x90cf('0x28')](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x28')]);_0x112280[_0x90cf('0x26')]=qs['offset'](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x26')]);}_0x112280[_0x90cf('0x5f')]=qs[_0x90cf('0x44')](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x44')]);_0x112280[_0x90cf('0x45')]=qs[_0x90cf('0x3d')](_[_0x90cf('0x46')](_0x2ac6da['query'],_0x55b382[_0x90cf('0x3d')]));_0x112280[_0x90cf('0x45')]['ChatQueueId']=_0x394ea0['id'];if(_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x47')]){_0x112280[_0x90cf('0x45')]=_['merge'](_0x112280[_0x90cf('0x45')],{'$or':_[_0x90cf('0x36')](_0x112280[_0x90cf('0x41')],function(_0x325f24){var _0x1ce290={};_0x1ce290[_0x325f24]={'$like':'%'+_0x2ac6da['query'][_0x90cf('0x47')]+'%'};return _0x1ce290;})});}_0x112280=_[_0x90cf('0x48')]({},_0x112280,_0x2ac6da['options']);return db[_0x90cf('0x5e')]['findAll'](_0x112280);}})[_0x90cf('0x2e')](function(_0x4d8ef8){if(_0x4d8ef8){return db[_0x90cf('0x60')][_0x90cf('0x61')]({'where':{'id':_[_0x90cf('0x36')](_0x4d8ef8,_0x90cf('0x62')),'role':_0x90cf('0x63')},'attributes':['id',_0x90cf('0x34'),'chatPause',_0x90cf('0x64'),_0x90cf('0x65')]});}})[_0x90cf('0x2e')](function(_0x6b10d){if(_0x6b10d){return{'count':_0x6b10d[_0x90cf('0x29')],'rows':_['map'](_0x6b10d[_0x90cf('0x4d')],function(_0x32538b){return{'membername':_0x32538b[_0x90cf('0x34')],'UserId':_0x32538b['id'],'queue_name':_0x2dfa37[_0x90cf('0x34')],'ChatQueueId':_0x2dfa37['id'],'interface':util[_0x90cf('0x66')](_0x90cf('0x67'),'SIP',_0x32538b[_0x90cf('0x34')]),'penalty':0x0,'paused':_0x32538b['chatPause'],'createdAt':_0x32538b['createdAt'],'updatedAt':_0x32538b[_0x90cf('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x90cf('0x2e')](respondWithFilteredResult(_0x40dd77,_0x112280))[_0x90cf('0x4e')](handleError(_0x40dd77,null));};exports['getTeams']=function(_0x2a9d1b,_0x97176e,_0x1ddc5f){var _0x5db957={};var _0x15c468={};var _0x1a0c85;var _0x3d8716;return db[_0x90cf('0x37')]['findOne']({'where':{'id':_0x2a9d1b[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x97176e,null))['then'](function(_0x15feff){if(_0x15feff){_0x1a0c85=_0x15feff;_0x15c468[_0x90cf('0x3f')]=_[_0x90cf('0x3c')](db[_0x90cf('0x68')][_0x90cf('0x50')]);_0x15c468[_0x90cf('0x3b')]=_[_0x90cf('0x3c')](_0x2a9d1b[_0x90cf('0x3b')]);_0x15c468['filters']=_[_0x90cf('0x3e')](_0x15c468[_0x90cf('0x3f')],_0x15c468[_0x90cf('0x3b')]);_0x5db957['attributes']=_[_0x90cf('0x3e')](_0x15c468[_0x90cf('0x3f')],qs['fields'](_0x2a9d1b[_0x90cf('0x3b')]['fields']));_0x5db957['attributes']=_0x5db957[_0x90cf('0x41')][_0x90cf('0x69')]?_0x5db957[_0x90cf('0x41')]:_0x15c468['model'];_0x5db957[_0x90cf('0x5f')]=qs['sort'](_0x2a9d1b['query']['sort']);_0x5db957[_0x90cf('0x45')]=qs[_0x90cf('0x3d')](_['pick'](_0x2a9d1b[_0x90cf('0x3b')],_0x15c468['filters']));if(_0x2a9d1b[_0x90cf('0x3b')][_0x90cf('0x47')]){_0x5db957[_0x90cf('0x45')]=_[_0x90cf('0x48')](_0x5db957['where'],{'$or':_[_0x90cf('0x36')](_0x5db957['attributes'],function(_0x218f69){var _0x4af285={};_0x4af285[_0x218f69]={'$like':'%'+_0x2a9d1b[_0x90cf('0x3b')][_0x90cf('0x47')]+'%'};return _0x4af285;})});}_0x5db957=_[_0x90cf('0x48')]({},_0x5db957,_0x2a9d1b[_0x90cf('0x4a')]);return _0x1a0c85['getTeams'](_0x5db957);}})['then'](function(_0x2bd60b){if(_0x2bd60b){_0x3d8716=_0x2bd60b['length'];if(!_0x2a9d1b['query'][_0x90cf('0x42')]('nolimit')){_0x5db957[_0x90cf('0x28')]=qs['limit'](_0x2a9d1b['query']['limit']);_0x5db957[_0x90cf('0x26')]=qs[_0x90cf('0x26')](_0x2a9d1b[_0x90cf('0x3b')][_0x90cf('0x26')]);}return _0x1a0c85[_0x90cf('0x6a')](_0x5db957);}})[_0x90cf('0x2e')](function(_0x8cd9c0){if(_0x8cd9c0){return _0x8cd9c0?{'count':_0x3d8716,'rows':_0x8cd9c0}:null;}})[_0x90cf('0x2e')](respondWithResult(_0x97176e,null))['catch'](handleError(_0x97176e,null));};exports['addTeams']=function(_0x567726,_0x2f8f4b,_0x1e1d59){var _0x3661a0=_0x567726['body']['ids'];return db[_0x90cf('0x68')][_0x90cf('0x4c')]({'where':{'id':_0x3661a0},'attributes':['id'],'include':[{'model':db[_0x90cf('0x60')],'as':_0x90cf('0x6b'),'attributes':['id','name',_0x90cf('0x6c'),_0x90cf('0x6d'),_0x90cf('0x6e')],'raw':!![]}]})[_0x90cf('0x2e')](function(_0x5880fa){if(_0x5880fa){var _0x8e7f2d=_[_0x90cf('0x6f')](_0x5880fa,function(_0x4f86ed){var _0x14e52f=_0x4f86ed[_0x90cf('0x30')]({'plain':!![]});return _0x14e52f[_0x90cf('0x6b')];});return db[_0x90cf('0x37')][_0x90cf('0x5b')]({'where':{'id':_0x567726[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](function(_0x329ca2){return db[_0x90cf('0x70')][_0x90cf('0x71')](function(_0x4aa35d){return _0x329ca2[_0x90cf('0x72')](_0x3661a0,{'transaction':_0x4aa35d})[_0x90cf('0x2e')](function(){return BPromise[_0x90cf('0x73')](_0x8e7f2d,function(_0x2bd8cc){return db[_0x90cf('0x5e')][_0x90cf('0x74')]({'where':{'UserId':_0x2bd8cc['id'],'ChatQueueId':_0x567726[_0x90cf('0x5a')]['id']},'transaction':_0x4aa35d});});})[_0x90cf('0x2e')](function(){_0x8e7f2d[_0x90cf('0x75')](function(_0x17f6f8){socket[_0x90cf('0x76')](_0x90cf('0x77'),{'UserId':_0x17f6f8['id'],'ChatQueueId':_0x329ca2['id']});});});});});}})[_0x90cf('0x2e')](respondWithStatusCode(_0x2f8f4b,null))[_0x90cf('0x4e')](handleError(_0x2f8f4b,null));};exports[_0x90cf('0x78')]=function(_0x5cd31c,_0x559c4d,_0x4e6393){return db['Team'][_0x90cf('0x4c')]({'where':{'id':_0x5cd31c[_0x90cf('0x3b')][_0x90cf('0x79')]},'attributes':['id'],'include':[{'model':db[_0x90cf('0x60')],'as':_0x90cf('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x90cf('0x2e')](handleEntityNotFound(_0x559c4d,null))[_0x90cf('0x2e')](function(_0x3a2a56){var _0xb46a12=_['map'](_0x3a2a56,'id');var _0x1a5dda=[];var _0x590885=[];var _0x26dd8e=squel[_0x90cf('0x7a')]();_0x26dd8e[_0x90cf('0x7b')](_0x90cf('0x7c'))[_0x90cf('0x7d')](_0x90cf('0x7e'),'tq')[_0x90cf('0x7f')]('user_has_teams','ut',_0x90cf('0x80'))[_0x90cf('0x45')](_0x90cf('0x81'),_0x5cd31c[_0x90cf('0x5a')]['id']);for(var _0x5fd4ea=0x0;_0x5fd4ea<_0x3a2a56[_0x90cf('0x69')];_0x5fd4ea+=0x1){let _0x19ac69=_0x3a2a56[_0x5fd4ea];for(var _0x47f159=0x0;_0x47f159<_0x19ac69['Agents'][_0x90cf('0x69')];_0x47f159+=0x1){let _0x574396=_0x19ac69[_0x90cf('0x6b')][_0x47f159];var _0x20a4a1=_0x26dd8e[_0x90cf('0x82')]();_0x20a4a1[_0x90cf('0x45')]('ut.UserId\x20=\x20?',_0x574396['id']);_0x590885[_0x90cf('0x83')](db[_0x90cf('0x70')][_0x90cf('0x3b')](_0x20a4a1['toString'](),{'type':db[_0x90cf('0x70')]['QueryTypes']['SELECT']})[_0x90cf('0x2e')](function(_0x2ab0e){if(_0x2ab0e['length']===0x1){return _0x574396['id'];}else{var _0xc15d79=_[_0x90cf('0x84')](_[_0x90cf('0x36')](_0x2ab0e,_0x90cf('0x85')),function(_0x477f00){return _[_0x90cf('0x86')](_0xb46a12,_0x477f00);});if(_0xc15d79){return _0x574396['id'];}}}));}}return BPromise[_0x90cf('0x87')](_0x590885)[_0x90cf('0x2e')](function(_0x19dacd){_0x1a5dda=_(_0x1a5dda)[_0x90cf('0x88')](_0x19dacd)[_0x90cf('0x89')]()[_0x90cf('0x8a')]();return db[_0x90cf('0x37')][_0x90cf('0x5b')]({'where':{'id':_0x5cd31c['params']['id']}})[_0x90cf('0x2e')](function(_0x3a8377){return db['sequelize'][_0x90cf('0x71')](function(_0x110aeb){return _0x3a8377[_0x90cf('0x78')](_0x5cd31c[_0x90cf('0x3b')][_0x90cf('0x79')],{'transaction':_0x110aeb})['then'](function(){if(!_['isEmpty'](_0x1a5dda)){return _0x3a8377[_0x90cf('0x8b')](_0x1a5dda,{'transaction':_0x110aeb});}})['then'](function(){_0x1a5dda[_0x90cf('0x75')](function(_0x4de011){socket['emit'](_0x90cf('0x8c'),{'UserId':_0x4de011,'ChatQueueId':_0x3a8377['id']});});});});});});})['then'](respondWithStatusCode(_0x559c4d,null))[_0x90cf('0x4e')](handleError(_0x559c4d,null));};exports[_0x90cf('0x8d')]=function(_0x4bde0c,_0x104c5b,_0x2dece1){return db[_0x90cf('0x37')]['find']({'where':{'id':_0x4bde0c[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x104c5b,null))[_0x90cf('0x2e')](function(_0x11fcc2){if(_0x11fcc2){return _0x11fcc2[_0x90cf('0x8d')](_0x4bde0c[_0x90cf('0x59')]['ids'],_[_0x90cf('0x8e')](_0x4bde0c['body'],[_0x90cf('0x79'),'id'])||{})[_0x90cf('0x8f')](function(_0x3c5b2b){for(var _0x5b3dc0=0x0;_0x5b3dc0<_0x4bde0c[_0x90cf('0x59')]['ids'][_0x90cf('0x69')];_0x5b3dc0+=0x1){socket['emit'](_0x90cf('0x77'),{'UserId':Number(_0x4bde0c[_0x90cf('0x59')][_0x90cf('0x79')][_0x5b3dc0]),'ChatQueueId':Number(_0x4bde0c[_0x90cf('0x5a')]['id'])});}return _0x3c5b2b;});}})[_0x90cf('0x2e')](respondWithResult(_0x104c5b,null))[_0x90cf('0x4e')](handleError(_0x104c5b,null));};exports[_0x90cf('0x8b')]=function(_0x5c97c9,_0x1b2290,_0x8a1820){return db[_0x90cf('0x37')][_0x90cf('0x5b')]({'where':{'id':_0x5c97c9['params']['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x1b2290,null))[_0x90cf('0x2e')](function(_0x42999a){if(_0x42999a){return _0x42999a[_0x90cf('0x8b')](_0x5c97c9['query'][_0x90cf('0x79')])[_0x90cf('0x2e')](function(){if(_[_0x90cf('0x90')](_0x5c97c9['query']['ids'])){for(var _0x4f3be5=0x0;_0x4f3be5<_0x5c97c9[_0x90cf('0x3b')]['ids'][_0x90cf('0x69')];_0x4f3be5+=0x1){socket['emit'](_0x90cf('0x8c'),{'UserId':Number(_0x5c97c9['query']['ids'][_0x4f3be5]),'ChatQueueId':Number(_0x5c97c9[_0x90cf('0x5a')]['id'])});}}else{socket['emit'](_0x90cf('0x8c'),{'UserId':Number(_0x5c97c9[_0x90cf('0x3b')][_0x90cf('0x79')]),'ChatQueueId':Number(_0x5c97c9[_0x90cf('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b2290,null))[_0x90cf('0x4e')](handleError(_0x1b2290,null));};exports['getAgents']=function(_0xeea30a,_0xbd7e60,_0x4d0bb9){var _0x5a7496={};var _0x3a10d6={};var _0x2ae4ba;var _0x42e7a5;return db['ChatQueue'][_0x90cf('0x5d')]({'where':{'id':_0xeea30a[_0x90cf('0x5a')]['id']}})['then'](handleEntityNotFound(_0xbd7e60,null))[_0x90cf('0x2e')](function(_0x1b8596){if(_0x1b8596){_0x2ae4ba=_0x1b8596;_0x3a10d6[_0x90cf('0x3f')]=_[_0x90cf('0x3c')](db[_0x90cf('0x60')]['rawAttributes']);_0x3a10d6['query']=_[_0x90cf('0x3c')](_0xeea30a[_0x90cf('0x3b')]);_0x3a10d6['filters']=_[_0x90cf('0x3e')](_0x3a10d6[_0x90cf('0x3f')],_0x3a10d6[_0x90cf('0x3b')]);_0x5a7496[_0x90cf('0x41')]=_[_0x90cf('0x3e')](_0x3a10d6[_0x90cf('0x3f')],qs[_0x90cf('0x40')](_0xeea30a[_0x90cf('0x3b')]['fields']));_0x5a7496[_0x90cf('0x41')]=_0x5a7496[_0x90cf('0x41')]['length']?_0x5a7496[_0x90cf('0x41')]:_0x3a10d6['model'];_0x5a7496[_0x90cf('0x5f')]=qs['sort'](_0xeea30a[_0x90cf('0x3b')][_0x90cf('0x44')]);_0x5a7496['where']=qs[_0x90cf('0x3d')](_['pick'](_0xeea30a['query'],_0x3a10d6[_0x90cf('0x3d')]));if(_0xeea30a[_0x90cf('0x3b')]['filter']){_0x5a7496['where']=_[_0x90cf('0x48')](_0x5a7496['where'],{'$or':_[_0x90cf('0x36')](_0x5a7496[_0x90cf('0x41')],function(_0x19876e){var _0x1d65d0={};_0x1d65d0[_0x19876e]={'$like':'%'+_0xeea30a[_0x90cf('0x3b')]['filter']+'%'};return _0x1d65d0;})});}_0x5a7496=_[_0x90cf('0x48')]({},_0x5a7496,_0xeea30a[_0x90cf('0x4a')]);return _0x2ae4ba['getAgents'](_0x5a7496);}})[_0x90cf('0x2e')](function(_0x4d8325){if(_0x4d8325){_0x42e7a5=_0x4d8325[_0x90cf('0x69')];if(!_0xeea30a[_0x90cf('0x3b')]['hasOwnProperty'](_0x90cf('0x43'))){_0x5a7496[_0x90cf('0x28')]=qs[_0x90cf('0x28')](_0xeea30a[_0x90cf('0x3b')]['limit']);_0x5a7496[_0x90cf('0x26')]=qs['offset'](_0xeea30a[_0x90cf('0x3b')]['offset']);}return _0x2ae4ba['getAgents'](_0x5a7496);}})['then'](function(_0x4bee70){if(_0x4bee70){return _0x4bee70?{'count':_0x42e7a5,'rows':_0x4bee70}:null;}})[_0x90cf('0x2e')](respondWithResult(_0xbd7e60,null))[_0x90cf('0x4e')](handleError(_0xbd7e60,null));}; \ No newline at end of file +var _0xa39b=['includeAll','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','nolimit','order','pick','ChatQueueId','UserChatQueue','findAndCountAll','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','User','Agents','voicePause','interface','sequelize','each','forEach','emit','removeTeams','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','transaction','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','ChatQueues','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','options','include','findAll','rows'];(function(_0x58b3ce,_0x24e20b){var _0x1c8926=function(_0x59f620){while(--_0x59f620){_0x58b3ce['push'](_0x58b3ce['shift']());}};_0x1c8926(++_0x24e20b);}(_0xa39b,0x169));var _0xba39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa39b[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xba39('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba39('0x1'));var rp=require(_0xba39('0x2'));var moment=require('moment');var BPromise=require(_0xba39('0x3'));var Mustache=require(_0xba39('0x4'));var util=require(_0xba39('0x5'));var path=require(_0xba39('0x6'));var sox=require(_0xba39('0x7'));var csv=require(_0xba39('0x8'));var ejs=require(_0xba39('0x9'));var fs=require('fs');var fs_extra=require(_0xba39('0xa'));var _=require(_0xba39('0xb'));var squel=require(_0xba39('0xc'));var crypto=require(_0xba39('0xd'));var jsforce=require(_0xba39('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xba39('0x8'));var querystring=require('querystring');var Papa=require(_0xba39('0xf'));var Redis=require('ioredis');var authService=require(_0xba39('0x10'));var qs=require(_0xba39('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba39('0x12'));var utils=require(_0xba39('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xba39('0x14'));var db=require(_0xba39('0x15'))['db'];config['redis']=_[_0xba39('0x16')](config[_0xba39('0x17')],{'host':_0xba39('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xba39('0x19'))['register'](socket);var jayson=require(_0xba39('0x1a'));var client=jayson[_0xba39('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8428,_0x254a13,_0x568339,_0x3c42da){return new BPromise(function(_0x5df289,_0x5bdc87){var _0x5db731=_0x3c42da||client;return _0x5db731[_0xba39('0x1c')](_0x2d8428,_0x568339)['then'](function(_0x5644d4){logger[_0xba39('0x1d')](_0xba39('0x1e'),_0x254a13,_0xba39('0x1f'));logger[_0xba39('0x20')](_0xba39('0x21'),_0x254a13,_0xba39('0x1f'),JSON[_0xba39('0x22')](_0x5644d4));if(_0x5644d4[_0xba39('0x23')]){if(_0x5644d4['error'][_0xba39('0x24')]===0x1f4){logger[_0xba39('0x23')]('ChatQueue,\x20%s,\x20%s',_0x254a13,_0x5644d4[_0xba39('0x23')][_0xba39('0x25')]);return _0x5bdc87(_0x5644d4[_0xba39('0x23')][_0xba39('0x25')]);}logger[_0xba39('0x23')]('ChatQueue,\x20%s,\x20%s',_0x254a13,_0x5644d4[_0xba39('0x23')][_0xba39('0x25')]);return _0x5df289(_0x5644d4[_0xba39('0x23')]['message']);}else{logger[_0xba39('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x254a13,_0xba39('0x1f'));_0x5df289(_0x5644d4[_0xba39('0x26')]['message']);}})[_0xba39('0x27')](function(_0x2b1a01){logger['error'](_0xba39('0x1e'),_0x254a13,_0x2b1a01);_0x5bdc87(_0x2b1a01);});});}function respondWithStatusCode(_0x2fca5f,_0x1fb7bb){_0x1fb7bb=_0x1fb7bb||0xcc;return function(_0x1193e2){if(_0x1193e2){return _0x2fca5f['sendStatus'](_0x1fb7bb);}return _0x2fca5f['status'](_0x1fb7bb)['end']();};}function respondWithResult(_0x4574c3,_0x29c0ea){_0x29c0ea=_0x29c0ea||0xc8;return function(_0x5bfd84){if(_0x5bfd84){return _0x4574c3[_0xba39('0x28')](_0x29c0ea)[_0xba39('0x29')](_0x5bfd84);}};}function respondWithFilteredResult(_0x5b6ea2,_0x4fee87){return function(_0x31e8ae){if(_0x31e8ae){var _0x534784=typeof _0x4fee87['offset']===_0xba39('0x2a')&&typeof _0x4fee87[_0xba39('0x2b')]===_0xba39('0x2a');var _0x108f28=_0x31e8ae[_0xba39('0x2c')];var _0x364ded=_0x534784?0x0:_0x4fee87[_0xba39('0x2d')];var _0x53c97e=_0x534784?_0x31e8ae['count']:_0x4fee87[_0xba39('0x2d')]+_0x4fee87[_0xba39('0x2b')];var _0xed5250;if(_0x53c97e>=_0x108f28){_0x53c97e=_0x108f28;_0xed5250=0xc8;}else{_0xed5250=0xce;}_0x5b6ea2[_0xba39('0x28')](_0xed5250);return _0x5b6ea2[_0xba39('0x2e')](_0xba39('0x2f'),_0x364ded+'-'+_0x53c97e+'/'+_0x108f28)[_0xba39('0x29')](_0x31e8ae);}return null;};}function patchUpdates(_0x5c8b48){return function(_0x5914a5){try{jsonpatch['apply'](_0x5914a5,_0x5c8b48,!![]);}catch(_0x121f15){return BPromise['reject'](_0x121f15);}return _0x5914a5[_0xba39('0x30')]();};}function saveUpdates(_0x121da5,_0x2c7c12){return function(_0x4cf566){if(_0x4cf566){return _0x4cf566[_0xba39('0x31')](_0x121da5)[_0xba39('0x32')](function(_0x30a33b){return _0x30a33b;});}return null;};}function removeEntity(_0x5a7498,_0x3a238f){return function(_0x1b740e){if(_0x1b740e){return _0x1b740e[_0xba39('0x33')]()[_0xba39('0x32')](function(){var _0x87a12d=_0x1b740e[_0xba39('0x34')]({'plain':!![]});var _0x378ff8=_0xba39('0x35');return db['UserProfileResource'][_0xba39('0x33')]({'where':{'type':_0x378ff8,'resourceId':_0x87a12d['id']}})[_0xba39('0x32')](function(){return _0x1b740e;});})[_0xba39('0x32')](function(){_0x5a7498['status'](0xcc)[_0xba39('0x36')]();});}};}function handleEntityNotFound(_0x5caa2d,_0x30a726){return function(_0x1a7956){if(!_0x1a7956){_0x5caa2d['sendStatus'](0x194);}return _0x1a7956;};}function handleError(_0x2ca506,_0x32887f){_0x32887f=_0x32887f||0x1f4;return function(_0x74e0b5){logger[_0xba39('0x23')](_0x74e0b5[_0xba39('0x37')]);if(_0x74e0b5[_0xba39('0x38')]){delete _0x74e0b5[_0xba39('0x38')];}_0x2ca506['status'](_0x32887f)['send'](_0x74e0b5);};}exports[_0xba39('0x39')]=function(_0x44a77c,_0x4a6312){var _0x6e9c68={},_0x56ddf8={},_0x37dd75={'count':0x0,'rows':[]};var _0x39112d=_[_0xba39('0x3a')](db[_0xba39('0x3b')][_0xba39('0x3c')],function(_0x26631e){return{'name':_0x26631e[_0xba39('0x3d')],'type':_0x26631e[_0xba39('0x3e')][_0xba39('0x3f')]};});_0x56ddf8[_0xba39('0x40')]=_[_0xba39('0x3a')](_0x39112d,'name');_0x56ddf8[_0xba39('0x41')]=_[_0xba39('0x42')](_0x44a77c[_0xba39('0x41')]);_0x56ddf8[_0xba39('0x43')]=_[_0xba39('0x44')](_0x56ddf8[_0xba39('0x40')],_0x56ddf8[_0xba39('0x41')]);_0x6e9c68[_0xba39('0x45')]=_[_0xba39('0x44')](_0x56ddf8[_0xba39('0x40')],qs[_0xba39('0x46')](_0x44a77c[_0xba39('0x41')]['fields']));_0x6e9c68[_0xba39('0x45')]=_0x6e9c68['attributes'][_0xba39('0x47')]?_0x6e9c68[_0xba39('0x45')]:_0x56ddf8[_0xba39('0x40')];if(!_0x44a77c[_0xba39('0x41')]['hasOwnProperty']('nolimit')){_0x6e9c68['limit']=qs['limit'](_0x44a77c[_0xba39('0x41')][_0xba39('0x2b')]);_0x6e9c68[_0xba39('0x2d')]=qs[_0xba39('0x2d')](_0x44a77c[_0xba39('0x41')][_0xba39('0x2d')]);}_0x6e9c68['order']=qs['sort'](_0x44a77c[_0xba39('0x41')][_0xba39('0x48')]);_0x6e9c68[_0xba39('0x49')]=qs[_0xba39('0x43')](_['pick'](_0x44a77c['query'],_0x56ddf8[_0xba39('0x43')]),_0x39112d);if(_0x44a77c[_0xba39('0x41')][_0xba39('0x4a')]){_0x6e9c68['where']=_['merge'](_0x6e9c68[_0xba39('0x49')],{'$or':_[_0xba39('0x3a')](_0x39112d,function(_0x34c13b){if(_0x34c13b[_0xba39('0x3e')]!=='VIRTUAL'){var _0x526dc3={};_0x526dc3[_0x34c13b[_0xba39('0x38')]]={'$like':'%'+_0x44a77c[_0xba39('0x41')][_0xba39('0x4a')]+'%'};return _0x526dc3;}})});}_0x6e9c68=_[_0xba39('0x4b')]({},_0x6e9c68,_0x44a77c[_0xba39('0x4c')]);var _0x5cbf2b={'where':_0x6e9c68['where']};return db[_0xba39('0x3b')][_0xba39('0x2c')](_0x5cbf2b)[_0xba39('0x32')](function(_0x5289dd){_0x37dd75[_0xba39('0x2c')]=_0x5289dd;if(_0x44a77c[_0xba39('0x41')]['includeAll']){_0x6e9c68[_0xba39('0x4d')]=[{'all':!![]}];}return db[_0xba39('0x3b')][_0xba39('0x4e')](_0x6e9c68);})['then'](function(_0x3437c1){_0x37dd75[_0xba39('0x4f')]=_0x3437c1;return _0x37dd75;})['then'](respondWithFilteredResult(_0x4a6312,_0x6e9c68))[_0xba39('0x27')](handleError(_0x4a6312,null));};exports['show']=function(_0x2cdaba,_0x26224e){var _0x7467b1={'raw':!![],'where':{'id':_0x2cdaba['params']['id']}},_0x2c3edd={};_0x2c3edd[_0xba39('0x40')]=_[_0xba39('0x42')](db[_0xba39('0x3b')]['rawAttributes']);_0x2c3edd[_0xba39('0x41')]=_[_0xba39('0x42')](_0x2cdaba[_0xba39('0x41')]);_0x2c3edd[_0xba39('0x43')]=_[_0xba39('0x44')](_0x2c3edd[_0xba39('0x40')],_0x2c3edd[_0xba39('0x41')]);_0x7467b1[_0xba39('0x45')]=_[_0xba39('0x44')](_0x2c3edd[_0xba39('0x40')],qs['fields'](_0x2cdaba[_0xba39('0x41')][_0xba39('0x46')]));_0x7467b1[_0xba39('0x45')]=_0x7467b1['attributes'][_0xba39('0x47')]?_0x7467b1[_0xba39('0x45')]:_0x2c3edd[_0xba39('0x40')];if(_0x2cdaba[_0xba39('0x41')][_0xba39('0x50')]){_0x7467b1[_0xba39('0x4d')]=[{'all':!![]}];}_0x7467b1=_[_0xba39('0x4b')]({},_0x7467b1,_0x2cdaba['options']);return db['ChatQueue'][_0xba39('0x51')](_0x7467b1)['then'](handleEntityNotFound(_0x26224e,null))['then'](respondWithResult(_0x26224e,null))['catch'](handleError(_0x26224e,null));};exports['create']=function(_0x594e87,_0x1b2fe0){return db[_0xba39('0x3b')][_0xba39('0x52')](_0x594e87[_0xba39('0x53')],{})['then'](function(_0x239257){var _0x39be0f=_0x594e87[_0xba39('0x54')][_0xba39('0x34')]({'plain':!![]});if(!_0x39be0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39be0f[_0xba39('0x55')]===_0xba39('0x54')){var _0x2a1c7b=_0x239257[_0xba39('0x34')]({'plain':!![]});var _0x1557e2=_0xba39('0x35');return db['UserProfileSection'][_0xba39('0x51')]({'where':{'name':_0x1557e2,'userProfileId':_0x39be0f[_0xba39('0x56')]},'raw':!![]})[_0xba39('0x32')](function(_0x3bd162){if(_0x3bd162&&_0x3bd162[_0xba39('0x57')]===0x0){return db[_0xba39('0x58')][_0xba39('0x52')]({'name':_0x2a1c7b['name'],'resourceId':_0x2a1c7b['id'],'type':_0x3bd162[_0xba39('0x38')],'sectionId':_0x3bd162['id']},{})['then'](function(){return _0x239257;});}else{return _0x239257;}})[_0xba39('0x27')](function(_0x2a85b2){logger[_0xba39('0x23')](_0xba39('0x59'),_0x2a85b2);throw _0x2a85b2;});}return _0x239257;})['then'](respondWithResult(_0x1b2fe0,0xc9))['catch'](handleError(_0x1b2fe0,null));};exports[_0xba39('0x31')]=function(_0x56b347,_0x4d1549){if(_0x56b347[_0xba39('0x53')]['id']){delete _0x56b347[_0xba39('0x53')]['id'];}return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x56b347['params']['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x4d1549,null))[_0xba39('0x32')](saveUpdates(_0x56b347['body'],null))['then'](respondWithResult(_0x4d1549,null))[_0xba39('0x27')](handleError(_0x4d1549,null));};exports[_0xba39('0x33')]=function(_0x33cf13,_0x54dd0c){return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x33cf13[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x54dd0c,null))[_0xba39('0x32')](removeEntity(_0x54dd0c,null))[_0xba39('0x27')](handleError(_0x54dd0c,null));};exports['describe']=function(_0x34da85,_0x8beac6){return db['ChatQueue'][_0xba39('0x5b')]()[_0xba39('0x32')](respondWithResult(_0x8beac6,null))[_0xba39('0x27')](handleError(_0x8beac6,null));};exports[_0xba39('0x5c')]=function(_0x4e5026,_0x581649,_0x26f47f){var _0x23ff61={'raw':!![],'where':{}},_0x1ce0b3={},_0x38714b;return db['ChatQueue'][_0xba39('0x5d')]({'where':{'id':_0x4e5026['params']['id']}})['then'](handleEntityNotFound(_0x581649,null))[_0xba39('0x32')](function(_0x4ca9c6){if(_0x4ca9c6){_0x38714b=_0x4ca9c6[_0xba39('0x34')]({'plain':!![]});_0x1ce0b3[_0xba39('0x40')]=_['keys'](db['UserChatQueue'][_0xba39('0x3c')]);_0x1ce0b3[_0xba39('0x41')]=_[_0xba39('0x42')](_0x4e5026[_0xba39('0x41')]);_0x1ce0b3[_0xba39('0x43')]=_[_0xba39('0x44')](_0x1ce0b3['model'],_0x1ce0b3[_0xba39('0x41')]);_0x23ff61[_0xba39('0x45')]=_[_0xba39('0x44')](_0x1ce0b3[_0xba39('0x40')],qs[_0xba39('0x46')](_0x4e5026[_0xba39('0x41')][_0xba39('0x46')]));_0x23ff61['attributes']=_0x23ff61[_0xba39('0x45')][_0xba39('0x47')]?_0x23ff61[_0xba39('0x45')]:_0x1ce0b3[_0xba39('0x40')];if(!_0x4e5026[_0xba39('0x41')][_0xba39('0x5e')](_0xba39('0x5f'))){_0x23ff61[_0xba39('0x2b')]=qs[_0xba39('0x2b')](_0x4e5026[_0xba39('0x41')]['limit']);_0x23ff61[_0xba39('0x2d')]=qs[_0xba39('0x2d')](_0x4e5026[_0xba39('0x41')][_0xba39('0x2d')]);}_0x23ff61[_0xba39('0x60')]=qs[_0xba39('0x48')](_0x4e5026[_0xba39('0x41')][_0xba39('0x48')]);_0x23ff61[_0xba39('0x49')]=qs[_0xba39('0x43')](_[_0xba39('0x61')](_0x4e5026[_0xba39('0x41')],_0x1ce0b3[_0xba39('0x43')]));_0x23ff61[_0xba39('0x49')][_0xba39('0x62')]=_0x4ca9c6['id'];if(_0x4e5026[_0xba39('0x41')][_0xba39('0x4a')]){_0x23ff61['where']=_[_0xba39('0x4b')](_0x23ff61[_0xba39('0x49')],{'$or':_['map'](_0x23ff61['attributes'],function(_0x22f9e2){var _0x1f6042={};_0x1f6042[_0x22f9e2]={'$like':'%'+_0x4e5026[_0xba39('0x41')]['filter']+'%'};return _0x1f6042;})});}_0x23ff61=_[_0xba39('0x4b')]({},_0x23ff61,_0x4e5026[_0xba39('0x4c')]);return db[_0xba39('0x63')][_0xba39('0x4e')](_0x23ff61);}})[_0xba39('0x32')](function(_0x1ff656){if(_0x1ff656){return db['User'][_0xba39('0x64')]({'where':{'id':_['map'](_0x1ff656,'UserId'),'role':_0xba39('0x65')},'attributes':['id','name',_0xba39('0x66'),'updatedAt',_0xba39('0x67')]});}})[_0xba39('0x32')](function(_0x4252c7){if(_0x4252c7){return{'count':_0x4252c7[_0xba39('0x2c')],'rows':_[_0xba39('0x3a')](_0x4252c7[_0xba39('0x4f')],function(_0x2d3568){return{'membername':_0x2d3568[_0xba39('0x38')],'UserId':_0x2d3568['id'],'queue_name':_0x38714b['name'],'ChatQueueId':_0x38714b['id'],'interface':util[_0xba39('0x68')](_0xba39('0x69'),_0xba39('0x6a'),_0x2d3568[_0xba39('0x38')]),'penalty':0x0,'paused':_0x2d3568[_0xba39('0x66')],'createdAt':_0x2d3568[_0xba39('0x67')],'updatedAt':_0x2d3568[_0xba39('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xba39('0x32')](respondWithFilteredResult(_0x581649,_0x23ff61))[_0xba39('0x27')](handleError(_0x581649,null));};exports['getTeams']=function(_0x5365a9,_0x573edd,_0x413137){var _0x504c3b={};var _0x2afc72={};var _0x3fa34b;var _0xe2d951;return db[_0xba39('0x3b')][_0xba39('0x5d')]({'where':{'id':_0x5365a9[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x573edd,null))[_0xba39('0x32')](function(_0x193884){if(_0x193884){_0x3fa34b=_0x193884;_0x2afc72[_0xba39('0x40')]=_[_0xba39('0x42')](db[_0xba39('0x6c')][_0xba39('0x3c')]);_0x2afc72[_0xba39('0x41')]=_[_0xba39('0x42')](_0x5365a9[_0xba39('0x41')]);_0x2afc72['filters']=_[_0xba39('0x44')](_0x2afc72[_0xba39('0x40')],_0x2afc72[_0xba39('0x41')]);_0x504c3b[_0xba39('0x45')]=_[_0xba39('0x44')](_0x2afc72[_0xba39('0x40')],qs['fields'](_0x5365a9['query'][_0xba39('0x46')]));_0x504c3b[_0xba39('0x45')]=_0x504c3b['attributes'][_0xba39('0x47')]?_0x504c3b[_0xba39('0x45')]:_0x2afc72['model'];_0x504c3b[_0xba39('0x60')]=qs[_0xba39('0x48')](_0x5365a9[_0xba39('0x41')]['sort']);_0x504c3b[_0xba39('0x49')]=qs['filters'](_[_0xba39('0x61')](_0x5365a9[_0xba39('0x41')],_0x2afc72[_0xba39('0x43')]));if(_0x5365a9[_0xba39('0x41')]['filter']){_0x504c3b['where']=_['merge'](_0x504c3b[_0xba39('0x49')],{'$or':_[_0xba39('0x3a')](_0x504c3b['attributes'],function(_0x4c77d4){var _0x5d4126={};_0x5d4126[_0x4c77d4]={'$like':'%'+_0x5365a9['query'][_0xba39('0x4a')]+'%'};return _0x5d4126;})});}_0x504c3b=_[_0xba39('0x4b')]({},_0x504c3b,_0x5365a9['options']);return _0x3fa34b['getTeams'](_0x504c3b);}})['then'](function(_0x74eb49){if(_0x74eb49){_0xe2d951=_0x74eb49[_0xba39('0x47')];if(!_0x5365a9['query'][_0xba39('0x5e')](_0xba39('0x5f'))){_0x504c3b[_0xba39('0x2b')]=qs['limit'](_0x5365a9[_0xba39('0x41')][_0xba39('0x2b')]);_0x504c3b[_0xba39('0x2d')]=qs['offset'](_0x5365a9[_0xba39('0x41')][_0xba39('0x2d')]);}return _0x3fa34b[_0xba39('0x6d')](_0x504c3b);}})['then'](function(_0x48b2f9){if(_0x48b2f9){return _0x48b2f9?{'count':_0xe2d951,'rows':_0x48b2f9}:null;}})[_0xba39('0x32')](respondWithResult(_0x573edd,null))[_0xba39('0x27')](handleError(_0x573edd,null));};exports[_0xba39('0x6e')]=function(_0x292ca4,_0x4a15e4,_0x5db4a4){var _0x22636d=_0x292ca4[_0xba39('0x53')][_0xba39('0x6f')];return db[_0xba39('0x6c')][_0xba39('0x4e')]({'where':{'id':_0x22636d},'attributes':['id'],'include':[{'model':db[_0xba39('0x70')],'as':_0xba39('0x71'),'attributes':['id',_0xba39('0x38'),'online',_0xba39('0x72'),_0xba39('0x73')],'raw':!![]}]})['then'](function(_0x2a3167){if(_0x2a3167){var _0x7b885c=_['flatMap'](_0x2a3167,function(_0x3f6eb0){var _0x5c4f01=_0x3f6eb0[_0xba39('0x34')]({'plain':!![]});return _0x5c4f01[_0xba39('0x71')];});return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x292ca4[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](function(_0x25a0f8){return db[_0xba39('0x74')]['transaction'](function(_0x2a360b){return _0x25a0f8[_0xba39('0x6e')](_0x22636d,{'transaction':_0x2a360b})[_0xba39('0x32')](function(){return BPromise[_0xba39('0x75')](_0x7b885c,function(_0xeef952){return db[_0xba39('0x63')]['findOrCreate']({'where':{'UserId':_0xeef952['id'],'ChatQueueId':_0x292ca4[_0xba39('0x5a')]['id']},'transaction':_0x2a360b});});})['then'](function(){_0x7b885c[_0xba39('0x76')](function(_0x201b19){socket[_0xba39('0x77')]('userChatQueue:save',{'UserId':_0x201b19['id'],'ChatQueueId':_0x25a0f8['id']});});});});});}})['then'](respondWithStatusCode(_0x4a15e4,null))[_0xba39('0x27')](handleError(_0x4a15e4,null));};exports[_0xba39('0x78')]=function(_0x35f238,_0x99e796,_0x4eee96){return db[_0xba39('0x6c')]['findAll']({'where':{'id':_0x35f238[_0xba39('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0xba39('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x99e796,null))[_0xba39('0x32')](function(_0x1e51ba){var _0x3e6e5c=_[_0xba39('0x3a')](_0x1e51ba,'id');var _0x1ef5ac=[];var _0x17637a=[];var _0x3b4418=squel[_0xba39('0x79')]();_0x3b4418[_0xba39('0x7a')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0xba39('0x7b')](_0xba39('0x7c'),'ut',_0xba39('0x7d'))[_0xba39('0x49')](_0xba39('0x7e'),_0x35f238['params']['id']);for(var _0x3eb45c=0x0;_0x3eb45c<_0x1e51ba[_0xba39('0x47')];_0x3eb45c+=0x1){let _0x251ed1=_0x1e51ba[_0x3eb45c];for(var _0x3a5cdb=0x0;_0x3a5cdb<_0x251ed1[_0xba39('0x71')][_0xba39('0x47')];_0x3a5cdb+=0x1){let _0x57d7fa=_0x251ed1['Agents'][_0x3a5cdb];var _0x49c1d9=_0x3b4418[_0xba39('0x7f')]();_0x49c1d9[_0xba39('0x49')](_0xba39('0x80'),_0x57d7fa['id']);_0x17637a[_0xba39('0x81')](db[_0xba39('0x74')][_0xba39('0x41')](_0x49c1d9[_0xba39('0x82')](),{'type':db['sequelize']['QueryTypes'][_0xba39('0x83')]})['then'](function(_0x35ac16){if(_0x35ac16[_0xba39('0x47')]===0x1){return _0x57d7fa['id'];}else{var _0x1379f2=_[_0xba39('0x84')](_[_0xba39('0x3a')](_0x35ac16,_0xba39('0x85')),function(_0x2d2cbb){return _[_0xba39('0x86')](_0x3e6e5c,_0x2d2cbb);});if(_0x1379f2){return _0x57d7fa['id'];}}}));}}return BPromise['all'](_0x17637a)[_0xba39('0x32')](function(_0x41aaa6){_0x1ef5ac=_(_0x1ef5ac)[_0xba39('0x87')](_0x41aaa6)[_0xba39('0x88')]()[_0xba39('0x89')]();return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x35f238[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](function(_0x41dee1){return db['sequelize'][_0xba39('0x8a')](function(_0x1fc0ea){return _0x41dee1[_0xba39('0x78')](_0x35f238[_0xba39('0x41')][_0xba39('0x6f')],{'transaction':_0x1fc0ea})[_0xba39('0x32')](function(){if(!_['isEmpty'](_0x1ef5ac)){return _0x41dee1[_0xba39('0x8b')](_0x1ef5ac,{'transaction':_0x1fc0ea});}})[_0xba39('0x32')](function(){_0x1ef5ac['forEach'](function(_0x1a8da4){socket[_0xba39('0x77')](_0xba39('0x8c'),{'UserId':_0x1a8da4,'ChatQueueId':_0x41dee1['id']});});});});});});})['then'](respondWithStatusCode(_0x99e796,null))['catch'](handleError(_0x99e796,null));};exports[_0xba39('0x8d')]=function(_0x83d921,_0x367b65,_0x426920){return db[_0xba39('0x3b')]['find']({'where':{'id':_0x83d921[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x367b65,null))[_0xba39('0x32')](function(_0x114c53){if(_0x114c53){return _0x114c53[_0xba39('0x8d')](_0x83d921['body'][_0xba39('0x6f')],_[_0xba39('0x8e')](_0x83d921[_0xba39('0x53')],[_0xba39('0x6f'),'id'])||{})[_0xba39('0x8f')](function(_0x14a356){for(var _0x29b49c=0x0;_0x29b49c<_0x83d921[_0xba39('0x53')][_0xba39('0x6f')][_0xba39('0x47')];_0x29b49c+=0x1){socket[_0xba39('0x77')](_0xba39('0x90'),{'UserId':Number(_0x83d921[_0xba39('0x53')]['ids'][_0x29b49c]),'ChatQueueId':Number(_0x83d921[_0xba39('0x5a')]['id'])});}return _0x14a356;});}})['then'](respondWithResult(_0x367b65,null))['catch'](handleError(_0x367b65,null));};exports[_0xba39('0x8b')]=function(_0x55fca0,_0x1eecf2,_0x36887f){return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x55fca0[_0xba39('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1eecf2,null))[_0xba39('0x32')](function(_0x273d04){if(_0x273d04){return _0x273d04[_0xba39('0x8b')](_0x55fca0[_0xba39('0x41')]['ids'])[_0xba39('0x32')](function(){if(_[_0xba39('0x91')](_0x55fca0[_0xba39('0x41')][_0xba39('0x6f')])){for(var _0x31ce75=0x0;_0x31ce75<_0x55fca0[_0xba39('0x41')]['ids'][_0xba39('0x47')];_0x31ce75+=0x1){socket[_0xba39('0x77')]('userChatQueue:remove',{'UserId':Number(_0x55fca0[_0xba39('0x41')][_0xba39('0x6f')][_0x31ce75]),'ChatQueueId':Number(_0x55fca0[_0xba39('0x5a')]['id'])});}}else{socket[_0xba39('0x77')](_0xba39('0x8c'),{'UserId':Number(_0x55fca0[_0xba39('0x41')][_0xba39('0x6f')]),'ChatQueueId':Number(_0x55fca0[_0xba39('0x5a')]['id'])});}});}})[_0xba39('0x32')](respondWithStatusCode(_0x1eecf2,null))[_0xba39('0x27')](handleError(_0x1eecf2,null));};exports[_0xba39('0x92')]=function(_0x25e317,_0xb70ff6,_0x158c2f){var _0x94cbe6={};var _0x2518f3={};var _0x2dce24;var _0x4cf931;return db[_0xba39('0x3b')][_0xba39('0x5d')]({'where':{'id':_0x25e317[_0xba39('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb70ff6,null))[_0xba39('0x32')](function(_0x35ec36){if(_0x35ec36){_0x2dce24=_0x35ec36;_0x2518f3['model']=_['keys'](db[_0xba39('0x70')][_0xba39('0x3c')]);_0x2518f3['query']=_[_0xba39('0x42')](_0x25e317['query']);_0x2518f3[_0xba39('0x43')]=_['intersection'](_0x2518f3['model'],_0x2518f3[_0xba39('0x41')]);_0x94cbe6[_0xba39('0x45')]=_[_0xba39('0x44')](_0x2518f3[_0xba39('0x40')],qs[_0xba39('0x46')](_0x25e317[_0xba39('0x41')]['fields']));_0x94cbe6['attributes']=_0x94cbe6[_0xba39('0x45')]['length']?_0x94cbe6[_0xba39('0x45')]:_0x2518f3[_0xba39('0x40')];_0x94cbe6[_0xba39('0x60')]=qs['sort'](_0x25e317[_0xba39('0x41')][_0xba39('0x48')]);_0x94cbe6['where']=qs[_0xba39('0x43')](_[_0xba39('0x61')](_0x25e317['query'],_0x2518f3['filters']));if(_0x25e317[_0xba39('0x41')]['filter']){_0x94cbe6[_0xba39('0x49')]=_['merge'](_0x94cbe6[_0xba39('0x49')],{'$or':_[_0xba39('0x3a')](_0x94cbe6[_0xba39('0x45')],function(_0x196bac){var _0x354994={};_0x354994[_0x196bac]={'$like':'%'+_0x25e317['query'][_0xba39('0x4a')]+'%'};return _0x354994;})});}_0x94cbe6=_[_0xba39('0x4b')]({},_0x94cbe6,_0x25e317[_0xba39('0x4c')]);return _0x2dce24[_0xba39('0x92')](_0x94cbe6);}})['then'](function(_0x50bba0){if(_0x50bba0){_0x4cf931=_0x50bba0['length'];if(!_0x25e317[_0xba39('0x41')][_0xba39('0x5e')](_0xba39('0x5f'))){_0x94cbe6[_0xba39('0x2b')]=qs[_0xba39('0x2b')](_0x25e317['query'][_0xba39('0x2b')]);_0x94cbe6[_0xba39('0x2d')]=qs['offset'](_0x25e317['query'][_0xba39('0x2d')]);}return _0x2dce24[_0xba39('0x92')](_0x94cbe6);}})['then'](function(_0xe43515){if(_0xe43515){return _0xe43515?{'count':_0x4cf931,'rows':_0xe43515}:null;}})[_0xba39('0x32')](respondWithResult(_0xb70ff6,null))[_0xba39('0x27')](handleError(_0xb70ff6,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 816bc4a..e0de8c2 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 _0x673f=['hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x673f,0x64));var _0xf673=function(_0x1131f6,_0x4436b1){_0x1131f6=_0x1131f6-0x0;var _0x44a965=_0x673f[_0x1131f6];return _0x44a965;};'use strict';var EventEmitter=require(_0xf673('0x0'));var ChatQueue=require(_0xf673('0x1'))['db'][_0xf673('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf673('0x3')](0x0);var events={'afterCreate':_0xf673('0x4'),'afterUpdate':'update','afterDestroy':_0xf673('0x5')};function emitEvent(_0x136928){return function(_0x971d88,_0x1df3cc,_0xec2576){ChatQueueEvents[_0xf673('0x6')](_0x136928+':'+_0x971d88['id'],_0x971d88);ChatQueueEvents[_0xf673('0x6')](_0x136928,_0x971d88);_0xec2576(null);};}for(var e in events){if(events[_0xf673('0x7')](e)){var event=events[e];ChatQueue[_0xf673('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x7764=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7764,0xa4));var _0x4776=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x7764[_0x3f3f06];return _0x140feb;};'use strict';var EventEmitter=require(_0x4776('0x0'));var ChatQueue=require(_0x4776('0x1'))['db'][_0x4776('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4776('0x3')](0x0);var events={'afterCreate':_0x4776('0x4'),'afterUpdate':_0x4776('0x5'),'afterDestroy':_0x4776('0x6')};function emitEvent(_0x424a79){return function(_0x3b28ba,_0x1f5638,_0x5ab4c2){ChatQueueEvents['emit'](_0x424a79+':'+_0x3b28ba['id'],_0x3b28ba);ChatQueueEvents[_0x4776('0x7')](_0x424a79,_0x3b28ba);_0x5ab4c2(null);};}for(var e in events){if(events[_0x4776('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4776('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ebd231e..e6642eb 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 _0x2ad6=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','api','moment','bluebird','request-promise'];(function(_0x54577d,_0x4ec759){var _0x43da03=function(_0x12a99c){while(--_0x12a99c){_0x54577d['push'](_0x54577d['shift']());}};_0x43da03(++_0x4ec759);}(_0x2ad6,0x19f));var _0x62ad=function(_0x130ea6,_0x287e7d){_0x130ea6=_0x130ea6-0x0;var _0x2a95a8=_0x2ad6[_0x130ea6];return _0x2a95a8;};'use strict';var _=require(_0x62ad('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x62ad('0x1'));var moment=require(_0x62ad('0x2'));var BPromise=require(_0x62ad('0x3'));var rp=require(_0x62ad('0x4'));var fs=require('fs');var path=require(_0x62ad('0x5'));var rimraf=require(_0x62ad('0x6'));var config=require(_0x62ad('0x7'));var attributes=require(_0x62ad('0x8'));module[_0x62ad('0x9')]=function(_0x153148,_0x55683a){return _0x153148[_0x62ad('0xa')](_0x62ad('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e0d=['define','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x564093,_0x4dbd09){var _0x26b2fe=function(_0xc665bd){while(--_0xc665bd){_0x564093['push'](_0x564093['shift']());}};_0x26b2fe(++_0x4dbd09);}(_0x7e0d,0x16e));var _0xd7e0=function(_0x51c635,_0x375829){_0x51c635=_0x51c635-0x0;var _0x2a1710=_0x7e0d[_0x51c635];return _0x2a1710;};'use strict';var _=require(_0xd7e0('0x0'));var util=require(_0xd7e0('0x1'));var logger=require(_0xd7e0('0x2'))(_0xd7e0('0x3'));var moment=require(_0xd7e0('0x4'));var BPromise=require(_0xd7e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7e0('0x6'));var rimraf=require(_0xd7e0('0x7'));var config=require(_0xd7e0('0x8'));var attributes=require(_0xd7e0('0x9'));module[_0xd7e0('0xa')]=function(_0x276465,_0x5ddb11){return _0x276465[_0xd7e0('0xb')]('ChatQueue',attributes,{'tableName':_0xd7e0('0xc'),'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 e0be91f..80e972c 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 _0x20d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowChatQueue','catch'];(function(_0x319c7a,_0x4ba7f1){var _0x330284=function(_0x50f3d3){while(--_0x50f3d3){_0x319c7a['push'](_0x319c7a['shift']());}};_0x330284(++_0x4ba7f1);}(_0x20d6,0x1b8));var _0x620d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x20d6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var moment=require(_0x620d('0x2'));var BPromise=require(_0x620d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x620d('0x4'));var db=require(_0x620d('0x5'))['db'];var utils=require(_0x620d('0x6'));var logger=require(_0x620d('0x7'))(_0x620d('0x8'));var config=require(_0x620d('0x9'));var jayson=require(_0x620d('0xa'));var client=jayson[_0x620d('0xb')][_0x620d('0xc')]({'port':0x232a});config[_0x620d('0xd')]=_[_0x620d('0xe')](config['redis'],{'host':_0x620d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x620d('0x10'))[_0x620d('0x11')](socket);function respondWithRpcPromise(_0x3afc77,_0x4325de,_0x1fd32f){return new BPromise(function(_0x420803,_0x4812fd){return client[_0x620d('0x12')](_0x3afc77,_0x1fd32f)[_0x620d('0x13')](function(_0x498358){logger[_0x620d('0x14')](_0x620d('0x15'),_0x4325de,_0x620d('0x16'));logger[_0x620d('0x17')](_0x620d('0x18'),_0x4325de,_0x620d('0x16'),JSON[_0x620d('0x19')](_0x498358));if(_0x498358[_0x620d('0x1a')]){if(_0x498358['error'][_0x620d('0x1b')]===0x1f4){logger[_0x620d('0x1a')](_0x620d('0x15'),_0x4325de,_0x498358[_0x620d('0x1a')][_0x620d('0x1c')]);return _0x4812fd(_0x498358['error']['message']);}logger['error'](_0x620d('0x15'),_0x4325de,_0x498358['error'][_0x620d('0x1c')]);return _0x420803(_0x498358[_0x620d('0x1a')][_0x620d('0x1c')]);}else{logger[_0x620d('0x14')](_0x620d('0x15'),_0x4325de,_0x620d('0x16'));_0x420803(_0x498358[_0x620d('0x1d')]['message']);}})['catch'](function(_0x4538f3){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4325de,_0x4538f3);_0x4812fd(_0x4538f3);});});}exports[_0x620d('0x1e')]=function(_0x5bc792){var _0x437970=this;return new Promise(function(_0x502b02,_0x18347d){return db[_0x620d('0x1f')][_0x620d('0x20')]({'raw':_0x5bc792['options']?_0x5bc792[_0x620d('0x21')][_0x620d('0x22')]===undefined?!![]:![]:!![],'where':_0x5bc792[_0x620d('0x21')]?_0x5bc792[_0x620d('0x21')][_0x620d('0x23')]||null:null,'attributes':_0x5bc792['options']?_0x5bc792[_0x620d('0x21')]['attributes']||null:null,'limit':_0x5bc792[_0x620d('0x21')]?_0x5bc792[_0x620d('0x21')][_0x620d('0x24')]||null:null,'include':_0x5bc792[_0x620d('0x21')]?_0x5bc792[_0x620d('0x21')][_0x620d('0x25')]?_[_0x620d('0x26')](_0x5bc792[_0x620d('0x21')][_0x620d('0x25')],function(_0xd70df4){return{'model':db[_0xd70df4[_0x620d('0x27')]],'as':_0xd70df4['as'],'attributes':_0xd70df4[_0x620d('0x28')],'include':_0xd70df4[_0x620d('0x25')]?_[_0x620d('0x26')](_0xd70df4[_0x620d('0x25')],function(_0x2d5208){return{'model':db[_0x2d5208['model']],'as':_0x2d5208['as'],'attributes':_0x2d5208['attributes'],'include':_0x2d5208[_0x620d('0x25')]?_['map'](_0x2d5208[_0x620d('0x25')],function(_0x341904){return{'model':db[_0x341904[_0x620d('0x27')]],'as':_0x341904['as'],'attributes':_0x341904[_0x620d('0x28')]};}):[]};}):[]};}):[]:[]})[_0x620d('0x13')](function(_0x188f3e){logger[_0x620d('0x14')](_0x620d('0x1e'),_0x5bc792);logger[_0x620d('0x17')](_0x620d('0x1e'),_0x5bc792,JSON[_0x620d('0x19')](_0x188f3e));_0x502b02(_0x188f3e);})['catch'](function(_0x2ce266){logger[_0x620d('0x1a')](_0x620d('0x1e'),_0x2ce266[_0x620d('0x1c')],_0x5bc792);_0x18347d(_0x437970[_0x620d('0x1a')](0x1f4,_0x2ce266[_0x620d('0x1c')]));});});};exports['ShowChatQueue']=function(_0x2ece12){var _0x3a12ae=this;return new Promise(function(_0x540b74,_0x1be285){return db['ChatQueue'][_0x620d('0x29')]({'raw':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')][_0x620d('0x22')]===undefined?!![]:![]:!![],'where':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')][_0x620d('0x23')]||null:null,'attributes':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')]['attributes']||null:null,'include':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')][_0x620d('0x25')]?_[_0x620d('0x26')](_0x2ece12[_0x620d('0x21')]['include'],function(_0x553952){return{'model':db[_0x553952[_0x620d('0x27')]],'as':_0x553952['as'],'attributes':_0x553952[_0x620d('0x28')],'include':_0x553952[_0x620d('0x25')]?_[_0x620d('0x26')](_0x553952[_0x620d('0x25')],function(_0x41cc33){return{'model':db[_0x41cc33[_0x620d('0x27')]],'as':_0x41cc33['as'],'attributes':_0x41cc33[_0x620d('0x28')],'include':_0x41cc33['include']?_[_0x620d('0x26')](_0x41cc33[_0x620d('0x25')],function(_0x308b6d){return{'model':db[_0x308b6d[_0x620d('0x27')]],'as':_0x308b6d['as'],'attributes':_0x308b6d[_0x620d('0x28')]};}):[]};}):[]};}):[]:[]})[_0x620d('0x13')](function(_0x4b50f4){logger[_0x620d('0x14')](_0x620d('0x2a'),_0x2ece12);logger[_0x620d('0x17')](_0x620d('0x2a'),_0x2ece12,JSON[_0x620d('0x19')](_0x4b50f4));_0x540b74(_0x4b50f4);})[_0x620d('0x2b')](function(_0x5d8c2b){logger[_0x620d('0x1a')]('ShowChatQueue',_0x5d8c2b[_0x620d('0x1c')],_0x2ece12);_0x1be285(_0x3a12ae[_0x620d('0x1a')](0x1f4,_0x5d8c2b[_0x620d('0x1c')]));});});}; \ No newline at end of file +var _0x0419=['socket.io-emitter','./chatQueue.socket','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','raw','limit','include','model','attributes','map','then','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x11efe8,_0xe6ad7e){var _0x5954b8=function(_0x48bc36){while(--_0x48bc36){_0x11efe8['push'](_0x11efe8['shift']());}};_0x5954b8(++_0xe6ad7e);}(_0x0419,0x153));var _0x9041=function(_0x5c8e81,_0x53351e){_0x5c8e81=_0x5c8e81-0x0;var _0x31e3a8=_0x0419[_0x5c8e81];return _0x31e3a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9041('0x0'));var BPromise=require(_0x9041('0x1'));var rs=require(_0x9041('0x2'));var fs=require('fs');var Redis=require(_0x9041('0x3'));var db=require(_0x9041('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9041('0x5'));var config=require(_0x9041('0x6'));var jayson=require(_0x9041('0x7'));var client=jayson[_0x9041('0x8')]['http']({'port':0x232a});config[_0x9041('0x9')]=_[_0x9041('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9041('0xb'))(new Redis(config[_0x9041('0x9')]));require(_0x9041('0xc'))['register'](socket);function respondWithRpcPromise(_0x33b812,_0x4d0aaf,_0x22487){return new BPromise(function(_0x2964e9,_0x992570){return client['request'](_0x33b812,_0x22487)['then'](function(_0x473271){logger[_0x9041('0xd')]('ChatQueue,\x20%s,\x20%s',_0x4d0aaf,'request\x20sent');logger[_0x9041('0xe')](_0x9041('0xf'),_0x4d0aaf,_0x9041('0x10'),JSON[_0x9041('0x11')](_0x473271));if(_0x473271[_0x9041('0x12')]){if(_0x473271[_0x9041('0x12')][_0x9041('0x13')]===0x1f4){logger[_0x9041('0x12')](_0x9041('0x14'),_0x4d0aaf,_0x473271[_0x9041('0x12')][_0x9041('0x15')]);return _0x992570(_0x473271['error']['message']);}logger['error'](_0x9041('0x14'),_0x4d0aaf,_0x473271[_0x9041('0x12')][_0x9041('0x15')]);return _0x2964e9(_0x473271['error'][_0x9041('0x15')]);}else{logger[_0x9041('0xd')](_0x9041('0x14'),_0x4d0aaf,'request\x20sent');_0x2964e9(_0x473271[_0x9041('0x16')][_0x9041('0x15')]);}})[_0x9041('0x17')](function(_0x36a5c2){logger[_0x9041('0x12')](_0x9041('0x14'),_0x4d0aaf,_0x36a5c2);_0x992570(_0x36a5c2);});});}exports[_0x9041('0x18')]=function(_0x2f52e0){var _0x5cff96=this;return new Promise(function(_0x3d527b,_0xa8ee07){return db[_0x9041('0x19')]['findAll']({'raw':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f52e0['options']?_0x2f52e0[_0x9041('0x1a')]['where']||null:null,'attributes':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')]['attributes']||null:null,'limit':_0x2f52e0['options']?_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1c')]||null:null,'include':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')]['include']?_['map'](_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1d')],function(_0x11401a){return{'model':db[_0x11401a[_0x9041('0x1e')]],'as':_0x11401a['as'],'attributes':_0x11401a[_0x9041('0x1f')],'include':_0x11401a['include']?_[_0x9041('0x20')](_0x11401a[_0x9041('0x1d')],function(_0x57a1db){return{'model':db[_0x57a1db[_0x9041('0x1e')]],'as':_0x57a1db['as'],'attributes':_0x57a1db[_0x9041('0x1f')],'include':_0x57a1db[_0x9041('0x1d')]?_[_0x9041('0x20')](_0x57a1db[_0x9041('0x1d')],function(_0x462620){return{'model':db[_0x462620[_0x9041('0x1e')]],'as':_0x462620['as'],'attributes':_0x462620[_0x9041('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9041('0x21')](function(_0xd3861e){logger[_0x9041('0xd')](_0x9041('0x18'),_0x2f52e0);logger[_0x9041('0xe')](_0x9041('0x18'),_0x2f52e0,JSON[_0x9041('0x11')](_0xd3861e));_0x3d527b(_0xd3861e);})[_0x9041('0x17')](function(_0x4fee5f){logger[_0x9041('0x12')](_0x9041('0x18'),_0x4fee5f[_0x9041('0x15')],_0x2f52e0);_0xa8ee07(_0x5cff96['error'](0x1f4,_0x4fee5f[_0x9041('0x15')]));});});};exports[_0x9041('0x22')]=function(_0x21c3d5){var _0x3c31e8=this;return new Promise(function(_0x2ea40a,_0x3370b0){return db['ChatQueue']['find']({'raw':_0x21c3d5['options']?_0x21c3d5['options'][_0x9041('0x1b')]===undefined?!![]:![]:!![],'where':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5['options']['where']||null:null,'attributes':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5[_0x9041('0x1a')][_0x9041('0x1f')]||null:null,'include':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5[_0x9041('0x1a')][_0x9041('0x1d')]?_['map'](_0x21c3d5['options']['include'],function(_0x152b15){return{'model':db[_0x152b15['model']],'as':_0x152b15['as'],'attributes':_0x152b15['attributes'],'include':_0x152b15[_0x9041('0x1d')]?_[_0x9041('0x20')](_0x152b15[_0x9041('0x1d')],function(_0xc22135){return{'model':db[_0xc22135[_0x9041('0x1e')]],'as':_0xc22135['as'],'attributes':_0xc22135[_0x9041('0x1f')],'include':_0xc22135[_0x9041('0x1d')]?_['map'](_0xc22135[_0x9041('0x1d')],function(_0x23b91e){return{'model':db[_0x23b91e[_0x9041('0x1e')]],'as':_0x23b91e['as'],'attributes':_0x23b91e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9041('0x21')](function(_0xe21f3){logger[_0x9041('0xd')]('ShowChatQueue',_0x21c3d5);logger[_0x9041('0xe')](_0x9041('0x22'),_0x21c3d5,JSON[_0x9041('0x11')](_0xe21f3));_0x2ea40a(_0xe21f3);})['catch'](function(_0x3745c0){logger[_0x9041('0x12')](_0x9041('0x22'),_0x3745c0[_0x9041('0x15')],_0x21c3d5);_0x3370b0(_0x3c31e8[_0x9041('0x12')](0x1f4,_0x3745c0[_0x9041('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 024930b..cda8aee 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 _0x4d9e=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x5a6646,_0x559c84){var _0xf4c087=function(_0x269e01){while(--_0x269e01){_0x5a6646['push'](_0x5a6646['shift']());}};_0xf4c087(++_0x559c84);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x369eae,_0x1628bc){_0x369eae=_0x369eae-0x0;var _0x11f827=_0x4d9e[_0x369eae];return _0x11f827;};'use strict';var ChatQueueEvents=require(_0xe4d9('0x0'));var events=['save','remove',_0xe4d9('0x1')];function createListener(_0x574c1d,_0x36adac){return function(_0x4d7687){_0x36adac[_0xe4d9('0x2')](_0x574c1d,_0x4d7687);};}function removeListener(_0x2deaef,_0x47a09f){return function(){ChatQueueEvents[_0xe4d9('0x3')](_0x2deaef,_0x47a09f);};}exports[_0xe4d9('0x4')]=function(_0x278035){for(var _0x34c2a2=0x0,_0x125dbc=events[_0xe4d9('0x5')];_0x34c2a2<_0x125dbc;_0x34c2a2++){var _0x54a63a=events[_0x34c2a2];var _0x36316f=createListener(_0xe4d9('0x6')+_0x54a63a,_0x278035);ChatQueueEvents['on'](_0x54a63a,_0x36316f);}}; \ No newline at end of file +var _0x5636=['save','emit','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x10e2f2,_0x5492b2){var _0x1164b8=function(_0x1d422f){while(--_0x1d422f){_0x10e2f2['push'](_0x10e2f2['shift']());}};_0x1164b8(++_0x5492b2);}(_0x5636,0x102));var _0x6563=function(_0x5799a9,_0x39521b){_0x5799a9=_0x5799a9-0x0;var _0x37f3a4=_0x5636[_0x5799a9];return _0x37f3a4;};'use strict';var ChatQueueEvents=require(_0x6563('0x0'));var events=[_0x6563('0x1'),'remove','update'];function createListener(_0x579d5c,_0x44872c){return function(_0x3a95f7){_0x44872c[_0x6563('0x2')](_0x579d5c,_0x3a95f7);};}function removeListener(_0x4ac653,_0x166a58){return function(){ChatQueueEvents[_0x6563('0x3')](_0x4ac653,_0x166a58);};}exports[_0x6563('0x4')]=function(_0x39792f){for(var _0x29f687=0x0,_0x193942=events[_0x6563('0x5')];_0x29f687<_0x193942;_0x29f687++){var _0x2d57d5=events[_0x29f687];var _0x2d0d5b=createListener(_0x6563('0x6')+_0x2d57d5,_0x39792f);ChatQueueEvents['on'](_0x2d57d5,_0x2d0d5b);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 24d7120..a85ccde 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x6bd897,_0x325332){var _0x5ee8fe=function(_0x5ba4f8){while(--_0x5ba4f8){_0x6bd897['push'](_0x6bd897['shift']());}};_0x5ee8fe(++_0x325332);}(_0xe14b,0x93));var _0xbe14=function(_0xa82736,_0x5edfd0){_0xa82736=_0xa82736-0x0;var _0x17f073=_0xe14b[_0xa82736];return _0x17f073;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4fee66,_0x21e44d){var _0x341533=function(_0x213c15){while(--_0x213c15){_0x4fee66['push'](_0x4fee66['shift']());}};_0x341533(++_0x21e44d);}(_0x55ca,0x126));var _0xa55c=function(_0x5bf609,_0x5c1e35){_0x5bf609=_0x5bf609-0x0;var _0x3c3a74=_0x55ca[_0x5bf609];return _0x3c3a74;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index f6cfd73..7e38107 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 _0xf0c7=['sequelize','exports','STRING','DATE','moment'];(function(_0x2103e9,_0x5c985c){var _0x107d4c=function(_0x136f6c){while(--_0x136f6c){_0x2103e9['push'](_0x2103e9['shift']());}};_0x107d4c(++_0x5c985c);}(_0xf0c7,0x1c1));var _0x7f0c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf0c7[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0x7f0c('0x0'));var Sequelize=require(_0x7f0c('0x1'));module[_0x7f0c('0x2')]={'uniqueid':{'type':Sequelize[_0x7f0c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7f0c('0x4')]},'leaveAt':{'type':Sequelize[_0x7f0c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7f0c('0x4')]},'reason':{'type':Sequelize[_0x7f0c('0x3')]}}; \ No newline at end of file +var _0x9f06=['sequelize','exports','STRING','DATE','moment'];(function(_0x3262bc,_0x18b462){var _0x138f45=function(_0x325b12){while(--_0x325b12){_0x3262bc['push'](_0x3262bc['shift']());}};_0x138f45(++_0x18b462);}(_0x9f06,0xfe));var _0x69f0=function(_0x2ff3db,_0x13ee40){_0x2ff3db=_0x2ff3db-0x0;var _0x4d0e9e=_0x9f06[_0x2ff3db];return _0x4d0e9e;};'use strict';var moment=require(_0x69f0('0x0'));var Sequelize=require(_0x69f0('0x1'));module[_0x69f0('0x2')]={'uniqueid':{'type':Sequelize[_0x69f0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x69f0('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x69f0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x69f0('0x4')]},'reason':{'type':Sequelize[_0x69f0('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1a28b44..a5a345b 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 _0xef17=['key','map','intersection','model','attributes','fields','length','query','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','offset','json','apply','reject','save','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName'];(function(_0x4bbeeb,_0xf4af9f){var _0x125503=function(_0x3e2e52){while(--_0x3e2e52){_0x4bbeeb['push'](_0x4bbeeb['shift']());}};_0x125503(++_0xf4af9f);}(_0xef17,0x136));var _0x7ef1=function(_0x288748,_0x5dfdf5){_0x288748=_0x288748-0x0;var _0x5795a3=_0xef17[_0x288748];return _0x5795a3;};'use strict';var emlformat=require(_0x7ef1('0x0'));var rimraf=require(_0x7ef1('0x1'));var zipdir=require(_0x7ef1('0x2'));var jsonpatch=require(_0x7ef1('0x3'));var rp=require(_0x7ef1('0x4'));var moment=require(_0x7ef1('0x5'));var BPromise=require(_0x7ef1('0x6'));var Mustache=require(_0x7ef1('0x7'));var util=require(_0x7ef1('0x8'));var path=require('path');var sox=require(_0x7ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x7ef1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ef1('0xc'));var deskjs=require(_0x7ef1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ef1('0xe'));var Papa=require(_0x7ef1('0xf'));var Redis=require(_0x7ef1('0x10'));var authService=require(_0x7ef1('0x11'));var qs=require(_0x7ef1('0x12'));var as=require(_0x7ef1('0x13'));var hardwareService=require(_0x7ef1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7ef1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122c8a,_0x51e226){_0x51e226=_0x51e226||0xcc;return function(_0x36ddf9){if(_0x36ddf9){return _0x122c8a[_0x7ef1('0x16')](_0x51e226);}return _0x122c8a[_0x7ef1('0x17')](_0x51e226)[_0x7ef1('0x18')]();};}function respondWithResult(_0x39ea9c,_0x317125){_0x317125=_0x317125||0xc8;return function(_0x26e9fb){if(_0x26e9fb){return _0x39ea9c[_0x7ef1('0x17')](_0x317125)['json'](_0x26e9fb);}};}function respondWithFilteredResult(_0x4de80f,_0x267f0e){return function(_0x5d0499){if(_0x5d0499){var _0x20b843=typeof _0x267f0e[_0x7ef1('0x19')]==='undefined'&&typeof _0x267f0e['limit']==='undefined';var _0x300645=_0x5d0499['count'];var _0x3a5835=_0x20b843?0x0:_0x267f0e['offset'];var _0x5a7b2b=_0x20b843?_0x5d0499['count']:_0x267f0e[_0x7ef1('0x19')]+_0x267f0e['limit'];var _0x38c5a7;if(_0x5a7b2b>=_0x300645){_0x5a7b2b=_0x300645;_0x38c5a7=0xc8;}else{_0x38c5a7=0xce;}_0x4de80f[_0x7ef1('0x17')](_0x38c5a7);return _0x4de80f['set']('Content-Range',_0x3a5835+'-'+_0x5a7b2b+'/'+_0x300645)[_0x7ef1('0x1a')](_0x5d0499);}return null;};}function patchUpdates(_0x5490b9){return function(_0x458459){try{jsonpatch[_0x7ef1('0x1b')](_0x458459,_0x5490b9,!![]);}catch(_0x2f8164){return BPromise[_0x7ef1('0x1c')](_0x2f8164);}return _0x458459[_0x7ef1('0x1d')]();};}function saveUpdates(_0xf24942,_0x20887b){return function(_0xd71594){if(_0xd71594){return _0xd71594['update'](_0xf24942)[_0x7ef1('0x1e')](function(_0x3b118f){return _0x3b118f;});}return null;};}function removeEntity(_0x3f26fb,_0x3324d4){return function(_0x31b5bf){if(_0x31b5bf){return _0x31b5bf[_0x7ef1('0x1f')]()[_0x7ef1('0x1e')](function(){_0x3f26fb[_0x7ef1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1ace,_0x33e008){return function(_0x12ef5a){if(!_0x12ef5a){_0x4b1ace[_0x7ef1('0x16')](0x194);}return _0x12ef5a;};}function handleError(_0xcfce5e,_0x19c2c2){_0x19c2c2=_0x19c2c2||0x1f4;return function(_0x4cfa16){logger[_0x7ef1('0x20')](_0x4cfa16[_0x7ef1('0x21')]);if(_0x4cfa16[_0x7ef1('0x22')]){delete _0x4cfa16[_0x7ef1('0x22')];}_0xcfce5e[_0x7ef1('0x17')](_0x19c2c2)[_0x7ef1('0x23')](_0x4cfa16);};}exports[_0x7ef1('0x24')]=function(_0x58e7ee,_0x2e8f1b){var _0x4b0380={},_0x3306b0={},_0x2546bf={'count':0x0,'rows':[]};var _0x4b5fde=_['map'](db[_0x7ef1('0x25')][_0x7ef1('0x26')],function(_0x5ab3a5){return{'name':_0x5ab3a5[_0x7ef1('0x27')],'type':_0x5ab3a5['type'][_0x7ef1('0x28')]};});_0x3306b0['model']=_[_0x7ef1('0x29')](_0x4b5fde,_0x7ef1('0x22'));_0x3306b0['query']=_['keys'](_0x58e7ee['query']);_0x3306b0['filters']=_[_0x7ef1('0x2a')](_0x3306b0[_0x7ef1('0x2b')],_0x3306b0['query']);_0x4b0380[_0x7ef1('0x2c')]=_['intersection'](_0x3306b0['model'],qs[_0x7ef1('0x2d')](_0x58e7ee['query'][_0x7ef1('0x2d')]));_0x4b0380[_0x7ef1('0x2c')]=_0x4b0380[_0x7ef1('0x2c')][_0x7ef1('0x2e')]?_0x4b0380['attributes']:_0x3306b0[_0x7ef1('0x2b')];if(!_0x58e7ee[_0x7ef1('0x2f')]['hasOwnProperty']('nolimit')){_0x4b0380['limit']=qs['limit'](_0x58e7ee[_0x7ef1('0x2f')]['limit']);_0x4b0380[_0x7ef1('0x19')]=qs[_0x7ef1('0x19')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x19')]);}_0x4b0380[_0x7ef1('0x30')]=qs[_0x7ef1('0x31')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x31')]);_0x4b0380[_0x7ef1('0x32')]=qs[_0x7ef1('0x33')](_[_0x7ef1('0x34')](_0x58e7ee['query'],_0x3306b0[_0x7ef1('0x33')]),_0x4b5fde);if(_0x58e7ee[_0x7ef1('0x2f')]['filter']){_0x4b0380[_0x7ef1('0x32')]=_[_0x7ef1('0x35')](_0x4b0380[_0x7ef1('0x32')],{'$or':_[_0x7ef1('0x29')](_0x4b5fde,function(_0x8ef5b3){if(_0x8ef5b3['type']!==_0x7ef1('0x36')){var _0x1ccbfb={};_0x1ccbfb[_0x8ef5b3[_0x7ef1('0x22')]]={'$like':'%'+_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x37')]+'%'};return _0x1ccbfb;}})});}_0x4b0380=_[_0x7ef1('0x35')]({},_0x4b0380,_0x58e7ee[_0x7ef1('0x38')]);var _0x238aa7={'where':_0x4b0380[_0x7ef1('0x32')]};return db[_0x7ef1('0x25')][_0x7ef1('0x39')](_0x238aa7)[_0x7ef1('0x1e')](function(_0x2da912){_0x2546bf[_0x7ef1('0x39')]=_0x2da912;if(_0x58e7ee[_0x7ef1('0x2f')]['includeAll']){_0x4b0380[_0x7ef1('0x3a')]=[{'all':!![]}];}return db[_0x7ef1('0x25')][_0x7ef1('0x3b')](_0x4b0380);})[_0x7ef1('0x1e')](function(_0x3889d7){_0x2546bf[_0x7ef1('0x3c')]=_0x3889d7;return _0x2546bf;})[_0x7ef1('0x1e')](respondWithFilteredResult(_0x2e8f1b,_0x4b0380))[_0x7ef1('0x3d')](handleError(_0x2e8f1b,null));};exports[_0x7ef1('0x3e')]=function(_0x1cff0b,_0x3e5ecd){var _0x374bf5={'raw':!![],'where':{'id':_0x1cff0b['params']['id']}},_0x2fb6c4={};_0x2fb6c4[_0x7ef1('0x2b')]=_[_0x7ef1('0x3f')](db[_0x7ef1('0x25')][_0x7ef1('0x26')]);_0x2fb6c4[_0x7ef1('0x2f')]=_[_0x7ef1('0x3f')](_0x1cff0b['query']);_0x2fb6c4[_0x7ef1('0x33')]=_[_0x7ef1('0x2a')](_0x2fb6c4[_0x7ef1('0x2b')],_0x2fb6c4[_0x7ef1('0x2f')]);_0x374bf5[_0x7ef1('0x2c')]=_[_0x7ef1('0x2a')](_0x2fb6c4['model'],qs[_0x7ef1('0x2d')](_0x1cff0b[_0x7ef1('0x2f')][_0x7ef1('0x2d')]));_0x374bf5[_0x7ef1('0x2c')]=_0x374bf5['attributes'][_0x7ef1('0x2e')]?_0x374bf5['attributes']:_0x2fb6c4['model'];if(_0x1cff0b[_0x7ef1('0x2f')]['includeAll']){_0x374bf5[_0x7ef1('0x3a')]=[{'all':!![]}];}_0x374bf5=_['merge']({},_0x374bf5,_0x1cff0b[_0x7ef1('0x38')]);return db[_0x7ef1('0x25')][_0x7ef1('0x40')](_0x374bf5)[_0x7ef1('0x1e')](handleEntityNotFound(_0x3e5ecd,null))[_0x7ef1('0x1e')](respondWithResult(_0x3e5ecd,null))[_0x7ef1('0x3d')](handleError(_0x3e5ecd,null));};exports[_0x7ef1('0x41')]=function(_0x106096,_0x49e089){return db['ChatQueueReport'][_0x7ef1('0x41')](_0x106096[_0x7ef1('0x42')],{})['then'](respondWithResult(_0x49e089,0xc9))[_0x7ef1('0x3d')](handleError(_0x49e089,null));};exports[_0x7ef1('0x43')]=function(_0xd06ca9,_0x5ce876){if(_0xd06ca9['body']['id']){delete _0xd06ca9[_0x7ef1('0x42')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0xd06ca9[_0x7ef1('0x44')]['id']}})[_0x7ef1('0x1e')](handleEntityNotFound(_0x5ce876,null))[_0x7ef1('0x1e')](saveUpdates(_0xd06ca9[_0x7ef1('0x42')],null))[_0x7ef1('0x1e')](respondWithResult(_0x5ce876,null))['catch'](handleError(_0x5ce876,null));};exports[_0x7ef1('0x1f')]=function(_0x4e425b,_0x350dde){return db['ChatQueueReport'][_0x7ef1('0x40')]({'where':{'id':_0x4e425b['params']['id']}})['then'](handleEntityNotFound(_0x350dde,null))[_0x7ef1('0x1e')](removeEntity(_0x350dde,null))['catch'](handleError(_0x350dde,null));};exports[_0x7ef1('0x45')]=function(_0x30a4ce,_0x54a0bb){return db[_0x7ef1('0x25')][_0x7ef1('0x45')]()[_0x7ef1('0x1e')](respondWithResult(_0x54a0bb,null))['catch'](handleError(_0x54a0bb,null));}; \ No newline at end of file +var _0x7046=['map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ChatQueueReport','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','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','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send'];(function(_0x152c0c,_0x13059e){var _0x27cbcb=function(_0x5a63c2){while(--_0x5a63c2){_0x152c0c['push'](_0x152c0c['shift']());}};_0x27cbcb(++_0x13059e);}(_0x7046,0x144));var _0x6704=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7046[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x6704('0x0'));var rimraf=require(_0x6704('0x1'));var zipdir=require(_0x6704('0x2'));var jsonpatch=require(_0x6704('0x3'));var rp=require('request-promise');var moment=require(_0x6704('0x4'));var BPromise=require(_0x6704('0x5'));var Mustache=require(_0x6704('0x6'));var util=require('util');var path=require(_0x6704('0x7'));var sox=require(_0x6704('0x8'));var csv=require(_0x6704('0x9'));var ejs=require(_0x6704('0xa'));var fs=require('fs');var fs_extra=require(_0x6704('0xb'));var _=require('lodash');var squel=require(_0x6704('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6704('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6704('0xe'));var Redis=require(_0x6704('0xf'));var authService=require(_0x6704('0x10'));var qs=require(_0x6704('0x11'));var as=require(_0x6704('0x12'));var hardwareService=require(_0x6704('0x13'));var logger=require(_0x6704('0x14'))(_0x6704('0x15'));var utils=require('../../config/utils');var config=require(_0x6704('0x16'));var licenseUtil=require(_0x6704('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2feb52,_0x1db0ad){_0x1db0ad=_0x1db0ad||0xcc;return function(_0x327e03){if(_0x327e03){return _0x2feb52[_0x6704('0x18')](_0x1db0ad);}return _0x2feb52[_0x6704('0x19')](_0x1db0ad)[_0x6704('0x1a')]();};}function respondWithResult(_0x17b9bc,_0x2da4df){_0x2da4df=_0x2da4df||0xc8;return function(_0x24ece3){if(_0x24ece3){return _0x17b9bc['status'](_0x2da4df)[_0x6704('0x1b')](_0x24ece3);}};}function respondWithFilteredResult(_0x1752bc,_0x35082b){return function(_0x4fef80){if(_0x4fef80){var _0x11782a=typeof _0x35082b[_0x6704('0x1c')]===_0x6704('0x1d')&&typeof _0x35082b[_0x6704('0x1e')]===_0x6704('0x1d');var _0x5adb35=_0x4fef80[_0x6704('0x1f')];var _0x31d732=_0x11782a?0x0:_0x35082b[_0x6704('0x1c')];var _0xe49450=_0x11782a?_0x4fef80[_0x6704('0x1f')]:_0x35082b['offset']+_0x35082b[_0x6704('0x1e')];var _0x2f6eae;if(_0xe49450>=_0x5adb35){_0xe49450=_0x5adb35;_0x2f6eae=0xc8;}else{_0x2f6eae=0xce;}_0x1752bc[_0x6704('0x19')](_0x2f6eae);return _0x1752bc[_0x6704('0x20')](_0x6704('0x21'),_0x31d732+'-'+_0xe49450+'/'+_0x5adb35)[_0x6704('0x1b')](_0x4fef80);}return null;};}function patchUpdates(_0x42b27f){return function(_0x5bb33e){try{jsonpatch[_0x6704('0x22')](_0x5bb33e,_0x42b27f,!![]);}catch(_0xf6d433){return BPromise[_0x6704('0x23')](_0xf6d433);}return _0x5bb33e['save']();};}function saveUpdates(_0x4dca58,_0x48d829){return function(_0x3e183b){if(_0x3e183b){return _0x3e183b[_0x6704('0x24')](_0x4dca58)[_0x6704('0x25')](function(_0x41f89e){return _0x41f89e;});}return null;};}function removeEntity(_0x56d1e1,_0xf2c459){return function(_0xabb97a){if(_0xabb97a){return _0xabb97a[_0x6704('0x26')]()[_0x6704('0x25')](function(){_0x56d1e1[_0x6704('0x19')](0xcc)[_0x6704('0x1a')]();});}};}function handleEntityNotFound(_0x2acafd,_0x5d50ff){return function(_0x896227){if(!_0x896227){_0x2acafd[_0x6704('0x18')](0x194);}return _0x896227;};}function handleError(_0x36bea4,_0x1bdfee){_0x1bdfee=_0x1bdfee||0x1f4;return function(_0x118d93){logger['error'](_0x118d93['stack']);if(_0x118d93[_0x6704('0x27')]){delete _0x118d93[_0x6704('0x27')];}_0x36bea4[_0x6704('0x19')](_0x1bdfee)[_0x6704('0x28')](_0x118d93);};}exports['index']=function(_0x1def46,_0x18cd98){var _0x5c229d={},_0x588814={},_0x16e749={'count':0x0,'rows':[]};var _0x5363c9=_[_0x6704('0x29')](db['ChatQueueReport']['rawAttributes'],function(_0x7e193e){return{'name':_0x7e193e[_0x6704('0x2a')],'type':_0x7e193e[_0x6704('0x2b')]['key']};});_0x588814[_0x6704('0x2c')]=_[_0x6704('0x29')](_0x5363c9,_0x6704('0x27'));_0x588814[_0x6704('0x2d')]=_[_0x6704('0x2e')](_0x1def46[_0x6704('0x2d')]);_0x588814[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],_0x588814[_0x6704('0x2d')]);_0x5c229d[_0x6704('0x31')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x1def46[_0x6704('0x2d')][_0x6704('0x32')]));_0x5c229d[_0x6704('0x31')]=_0x5c229d[_0x6704('0x31')][_0x6704('0x33')]?_0x5c229d[_0x6704('0x31')]:_0x588814[_0x6704('0x2c')];if(!_0x1def46[_0x6704('0x2d')][_0x6704('0x34')](_0x6704('0x35'))){_0x5c229d[_0x6704('0x1e')]=qs['limit'](_0x1def46['query']['limit']);_0x5c229d[_0x6704('0x1c')]=qs[_0x6704('0x1c')](_0x1def46[_0x6704('0x2d')]['offset']);}_0x5c229d[_0x6704('0x36')]=qs['sort'](_0x1def46[_0x6704('0x2d')][_0x6704('0x37')]);_0x5c229d[_0x6704('0x38')]=qs[_0x6704('0x2f')](_[_0x6704('0x39')](_0x1def46[_0x6704('0x2d')],_0x588814[_0x6704('0x2f')]),_0x5363c9);if(_0x1def46[_0x6704('0x2d')]['filter']){_0x5c229d['where']=_[_0x6704('0x3a')](_0x5c229d[_0x6704('0x38')],{'$or':_['map'](_0x5363c9,function(_0x48f3c2){if(_0x48f3c2[_0x6704('0x2b')]!=='VIRTUAL'){var _0xd7e27b={};_0xd7e27b[_0x48f3c2[_0x6704('0x27')]]={'$like':'%'+_0x1def46[_0x6704('0x2d')][_0x6704('0x3b')]+'%'};return _0xd7e27b;}})});}_0x5c229d=_['merge']({},_0x5c229d,_0x1def46[_0x6704('0x3c')]);var _0x1ee017={'where':_0x5c229d['where']};return db[_0x6704('0x3d')]['count'](_0x1ee017)[_0x6704('0x25')](function(_0x714c83){_0x16e749[_0x6704('0x1f')]=_0x714c83;if(_0x1def46['query'][_0x6704('0x3e')]){_0x5c229d[_0x6704('0x3f')]=[{'all':!![]}];}return db[_0x6704('0x3d')]['findAll'](_0x5c229d);})[_0x6704('0x25')](function(_0x444d36){_0x16e749[_0x6704('0x40')]=_0x444d36;return _0x16e749;})[_0x6704('0x25')](respondWithFilteredResult(_0x18cd98,_0x5c229d))['catch'](handleError(_0x18cd98,null));};exports[_0x6704('0x41')]=function(_0x50cc74,_0x2defda){var _0x45a217={'raw':!![],'where':{'id':_0x50cc74[_0x6704('0x42')]['id']}},_0x10fc26={};_0x10fc26['model']=_['keys'](db['ChatQueueReport'][_0x6704('0x43')]);_0x10fc26['query']=_[_0x6704('0x2e')](_0x50cc74['query']);_0x10fc26[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x10fc26['model'],_0x10fc26[_0x6704('0x2d')]);_0x45a217[_0x6704('0x31')]=_[_0x6704('0x30')](_0x10fc26[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x50cc74['query'][_0x6704('0x32')]));_0x45a217[_0x6704('0x31')]=_0x45a217[_0x6704('0x31')][_0x6704('0x33')]?_0x45a217[_0x6704('0x31')]:_0x10fc26['model'];if(_0x50cc74[_0x6704('0x2d')]['includeAll']){_0x45a217[_0x6704('0x3f')]=[{'all':!![]}];}_0x45a217=_[_0x6704('0x3a')]({},_0x45a217,_0x50cc74[_0x6704('0x3c')]);return db[_0x6704('0x3d')][_0x6704('0x44')](_0x45a217)['then'](handleEntityNotFound(_0x2defda,null))[_0x6704('0x25')](respondWithResult(_0x2defda,null))[_0x6704('0x45')](handleError(_0x2defda,null));};exports['create']=function(_0x1b9d36,_0x17a98a){return db[_0x6704('0x3d')][_0x6704('0x46')](_0x1b9d36[_0x6704('0x47')],{})[_0x6704('0x25')](respondWithResult(_0x17a98a,0xc9))['catch'](handleError(_0x17a98a,null));};exports[_0x6704('0x24')]=function(_0x5b0713,_0xb73442){if(_0x5b0713['body']['id']){delete _0x5b0713[_0x6704('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5b0713[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0xb73442,null))[_0x6704('0x25')](saveUpdates(_0x5b0713[_0x6704('0x47')],null))[_0x6704('0x25')](respondWithResult(_0xb73442,null))[_0x6704('0x45')](handleError(_0xb73442,null));};exports['destroy']=function(_0x5b9e28,_0x254cf7){return db[_0x6704('0x3d')][_0x6704('0x44')]({'where':{'id':_0x5b9e28[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0x254cf7,null))[_0x6704('0x25')](removeEntity(_0x254cf7,null))[_0x6704('0x45')](handleError(_0x254cf7,null));};exports[_0x6704('0x48')]=function(_0x1fcfb0,_0x44e4a5){return db[_0x6704('0x3d')][_0x6704('0x48')]()[_0x6704('0x25')](respondWithResult(_0x44e4a5,null))[_0x6704('0x45')](handleError(_0x44e4a5,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 868d5f7..aeca127 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5baf45,_0x34bef2){var _0x44fc4b=function(_0xe70b6a){while(--_0xe70b6a){_0x5baf45['push'](_0x5baf45['shift']());}};_0x44fc4b(++_0x34bef2);}(_0x757a,0xde));var _0xa757=function(_0x4174e1,_0x48051d){_0x4174e1=_0x4174e1-0x0;var _0x1c59eb=_0x757a[_0x4174e1];return _0x1c59eb;};'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')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e1119,_0x32dc78){_0x4e1119=_0x4e1119-0x0;var _0x35f53d=_0xb10b[_0x4e1119];return _0x35f53d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index baef1ee..d506dc5 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 _0x1546=['ChatQueueReport','where','limit','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatQueueReport','body','options','raw','UpdateChatQueueReport'];(function(_0x3b40d8,_0x1954fc){var _0x2fe201=function(_0x3bcad8){while(--_0x3bcad8){_0x3b40d8['push'](_0x3b40d8['shift']());}};_0x2fe201(++_0x1954fc);}(_0x1546,0x18b));var _0x6154=function(_0x2e69ad,_0x4a50ae){_0x2e69ad=_0x2e69ad-0x0;var _0x320d9a=_0x1546[_0x2e69ad];return _0x320d9a;};'use strict';var _=require('lodash');var util=require(_0x6154('0x0'));var moment=require(_0x6154('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6154('0x2'))['db'];var utils=require(_0x6154('0x3'));var logger=require(_0x6154('0x4'))(_0x6154('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6154('0x6')][_0x6154('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x314d28,_0x39b763,_0x102541){return new BPromise(function(_0x44c302,_0x403229){return client[_0x6154('0x8')](_0x314d28,_0x102541)[_0x6154('0x9')](function(_0x4d0a7e){logger[_0x6154('0xa')](_0x6154('0xb'),_0x39b763,'request\x20sent');logger[_0x6154('0xc')](_0x6154('0xd'),_0x39b763,_0x6154('0xe'),JSON[_0x6154('0xf')](_0x4d0a7e));if(_0x4d0a7e[_0x6154('0x10')]){if(_0x4d0a7e[_0x6154('0x10')]['code']===0x1f4){logger[_0x6154('0x10')](_0x6154('0xb'),_0x39b763,_0x4d0a7e[_0x6154('0x10')]['message']);return _0x403229(_0x4d0a7e[_0x6154('0x10')][_0x6154('0x11')]);}logger[_0x6154('0x10')](_0x6154('0xb'),_0x39b763,_0x4d0a7e['error'][_0x6154('0x11')]);return _0x44c302(_0x4d0a7e[_0x6154('0x10')]['message']);}else{logger[_0x6154('0xa')](_0x6154('0xb'),_0x39b763,_0x6154('0xe'));_0x44c302(_0x4d0a7e[_0x6154('0x12')][_0x6154('0x11')]);}})[_0x6154('0x13')](function(_0x479a89){logger[_0x6154('0x10')](_0x6154('0xb'),_0x39b763,_0x479a89);_0x403229(_0x479a89);});});}exports[_0x6154('0x14')]=function(_0x283e31){var _0x34be0f=this;return new Promise(function(_0x53eb2b,_0x55af38){return db['ChatQueueReport']['create'](_0x283e31[_0x6154('0x15')],{'raw':_0x283e31[_0x6154('0x16')]?_0x283e31['options'][_0x6154('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x50b844){logger[_0x6154('0xa')](_0x6154('0x14'),_0x283e31);logger['debug']('CreateChatQueueReport',_0x283e31,JSON[_0x6154('0xf')](_0x50b844));_0x53eb2b(_0x50b844);})[_0x6154('0x13')](function(_0x4df022){logger['error'](_0x6154('0x14'),_0x4df022[_0x6154('0x11')],_0x283e31);_0x55af38(_0x34be0f[_0x6154('0x10')](0x1f4,_0x4df022[_0x6154('0x11')]));});});};exports[_0x6154('0x18')]=function(_0x7da997){var _0x438576=this;return new Promise(function(_0x10785c,_0x1711b9){return db[_0x6154('0x19')]['update'](_0x7da997['body'],{'raw':_0x7da997[_0x6154('0x16')]?_0x7da997[_0x6154('0x16')][_0x6154('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7da997[_0x6154('0x16')]?_0x7da997[_0x6154('0x16')][_0x6154('0x1a')]||null:null,'attributes':_0x7da997[_0x6154('0x16')]?_0x7da997[_0x6154('0x16')]['attributes']||null:null,'limit':_0x7da997['options']?_0x7da997[_0x6154('0x16')][_0x6154('0x1b')]||null:null})[_0x6154('0x9')](function(_0x1ce81b){logger[_0x6154('0xa')]('UpdateChatQueueReport',_0x7da997);logger[_0x6154('0xc')](_0x6154('0x18'),_0x7da997,JSON['stringify'](_0x1ce81b));_0x10785c(_0x1ce81b);})[_0x6154('0x13')](function(_0x3b934b){logger[_0x6154('0x10')]('UpdateChatQueueReport',_0x3b934b['message'],_0x7da997);_0x1711b9(_0x438576[_0x6154('0x10')](0x1f4,_0x3b934b[_0x6154('0x11')]));});});}; \ No newline at end of file +var _0x900f=['info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','UpdateChatQueueReport','update','raw','attributes','limit','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x53e9d9,_0x39edc4){var _0x4f3de6=function(_0x5ba626){while(--_0x5ba626){_0x53e9d9['push'](_0x53e9d9['shift']());}};_0x4f3de6(++_0x39edc4);}(_0x900f,0x18a));var _0xf900=function(_0x20b9fc,_0x5dab92){_0x20b9fc=_0x20b9fc-0x0;var _0x511a2b=_0x900f[_0x20b9fc];return _0x511a2b;};'use strict';var _=require(_0xf900('0x0'));var util=require(_0xf900('0x1'));var moment=require('moment');var BPromise=require(_0xf900('0x2'));var rs=require(_0xf900('0x3'));var fs=require('fs');var Redis=require(_0xf900('0x4'));var db=require(_0xf900('0x5'))['db'];var utils=require(_0xf900('0x6'));var logger=require(_0xf900('0x7'))('rpc');var config=require(_0xf900('0x8'));var jayson=require(_0xf900('0x9'));var client=jayson[_0xf900('0xa')][_0xf900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f01ff,_0x56fcd4,_0x44153a){return new BPromise(function(_0x4cfc6d,_0x4cbf6b){return client[_0xf900('0xc')](_0x1f01ff,_0x44153a)[_0xf900('0xd')](function(_0x4bdc30){logger[_0xf900('0xe')](_0xf900('0xf'),_0x56fcd4,_0xf900('0x10'));logger['debug'](_0xf900('0x11'),_0x56fcd4,_0xf900('0x10'),JSON[_0xf900('0x12')](_0x4bdc30));if(_0x4bdc30[_0xf900('0x13')]){if(_0x4bdc30['error'][_0xf900('0x14')]===0x1f4){logger[_0xf900('0x13')](_0xf900('0xf'),_0x56fcd4,_0x4bdc30['error'][_0xf900('0x15')]);return _0x4cbf6b(_0x4bdc30[_0xf900('0x13')]['message']);}logger[_0xf900('0x13')](_0xf900('0xf'),_0x56fcd4,_0x4bdc30[_0xf900('0x13')]['message']);return _0x4cfc6d(_0x4bdc30[_0xf900('0x13')][_0xf900('0x15')]);}else{logger[_0xf900('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x56fcd4,_0xf900('0x10'));_0x4cfc6d(_0x4bdc30[_0xf900('0x16')][_0xf900('0x15')]);}})[_0xf900('0x17')](function(_0xc96578){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x56fcd4,_0xc96578);_0x4cbf6b(_0xc96578);});});}exports[_0xf900('0x18')]=function(_0x38e35){var _0x3a6afe=this;return new Promise(function(_0x394e8d,_0x48820b){return db[_0xf900('0x19')]['create'](_0x38e35[_0xf900('0x1a')],{'raw':_0x38e35['options']?_0x38e35[_0xf900('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf900('0xd')](function(_0x3d116d){logger[_0xf900('0xe')](_0xf900('0x18'),_0x38e35);logger['debug'](_0xf900('0x18'),_0x38e35,JSON['stringify'](_0x3d116d));_0x394e8d(_0x3d116d);})['catch'](function(_0x52f3cd){logger[_0xf900('0x13')](_0xf900('0x18'),_0x52f3cd['message'],_0x38e35);_0x48820b(_0x3a6afe['error'](0x1f4,_0x52f3cd['message']));});});};exports[_0xf900('0x1c')]=function(_0x427133){var _0x41d5c6=this;return new Promise(function(_0x33d371,_0x5926af){return db[_0xf900('0x19')][_0xf900('0x1d')](_0x427133['body'],{'raw':_0x427133[_0xf900('0x1b')]?_0x427133[_0xf900('0x1b')][_0xf900('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x427133['options']?_0x427133[_0xf900('0x1b')]['where']||null:null,'attributes':_0x427133[_0xf900('0x1b')]?_0x427133[_0xf900('0x1b')][_0xf900('0x1f')]||null:null,'limit':_0x427133[_0xf900('0x1b')]?_0x427133[_0xf900('0x1b')][_0xf900('0x20')]||null:null})[_0xf900('0xd')](function(_0xa6f659){logger[_0xf900('0xe')](_0xf900('0x1c'),_0x427133);logger[_0xf900('0x21')](_0xf900('0x1c'),_0x427133,JSON[_0xf900('0x12')](_0xa6f659));_0x33d371(_0xa6f659);})[_0xf900('0x17')](function(_0x1e44f3){logger[_0xf900('0x13')](_0xf900('0x1c'),_0x1e44f3[_0xf900('0x15')],_0x427133);_0x5926af(_0x41d5c6[_0xf900('0x13')](0x1f4,_0x1e44f3[_0xf900('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 209cbc8..4d84512 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 _0x3db2=['isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x449225,_0xf44ffb){var _0x2b70a9=function(_0x3c62ab){while(--_0x3c62ab){_0x449225['push'](_0x449225['shift']());}};_0x2b70a9(++_0xf44ffb);}(_0x3db2,0x186));var _0x23db=function(_0x1d9d12,_0x2c7d98){_0x1d9d12=_0x1d9d12-0x0;var _0x4f680e=_0x3db2[_0x1d9d12];return _0x4f680e;};'use strict';var multer=require(_0x23db('0x0'));var util=require(_0x23db('0x1'));var path=require(_0x23db('0x2'));var timeout=require(_0x23db('0x3'));var express=require(_0x23db('0x4'));var router=express[_0x23db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x23db('0x6'));var interaction=require(_0x23db('0x7'));var config=require(_0x23db('0x8'));var controller=require('./chatQueueReport.controller');router[_0x23db('0x9')]('/',auth[_0x23db('0xa')](),controller['index']);router[_0x23db('0x9')](_0x23db('0xb'),auth[_0x23db('0xa')](),controller[_0x23db('0xc')]);router[_0x23db('0x9')](_0x23db('0xd'),auth[_0x23db('0xa')](),controller[_0x23db('0xe')]);router[_0x23db('0xf')]('/',auth[_0x23db('0xa')](),controller['create']);router[_0x23db('0x10')](_0x23db('0xd'),auth[_0x23db('0xa')](),controller['update']);router[_0x23db('0x11')](_0x23db('0xd'),auth[_0x23db('0xa')](),controller[_0x23db('0x12')]);module[_0x23db('0x13')]=router; \ No newline at end of file +var _0x23cb=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x23cb,0x1bb));var _0xb23c=function(_0x5e56db,_0x37f86e){_0x5e56db=_0x5e56db-0x0;var _0x2f49c9=_0x23cb[_0x5e56db];return _0x2f49c9;};'use strict';var multer=require(_0xb23c('0x0'));var util=require('util');var path=require(_0xb23c('0x1'));var timeout=require(_0xb23c('0x2'));var express=require(_0xb23c('0x3'));var router=express[_0xb23c('0x4')]();var fs_extra=require(_0xb23c('0x5'));var auth=require(_0xb23c('0x6'));var interaction=require(_0xb23c('0x7'));var config=require(_0xb23c('0x8'));var controller=require(_0xb23c('0x9'));router[_0xb23c('0xa')]('/',auth[_0xb23c('0xb')](),controller[_0xb23c('0xc')]);router[_0xb23c('0xa')](_0xb23c('0xd'),auth[_0xb23c('0xb')](),controller[_0xb23c('0xe')]);router['get'](_0xb23c('0xf'),auth[_0xb23c('0xb')](),controller[_0xb23c('0x10')]);router['post']('/',auth[_0xb23c('0xb')](),controller[_0xb23c('0x11')]);router['put'](_0xb23c('0xf'),auth['isAuthenticated'](),controller[_0xb23c('0x12')]);router[_0xb23c('0x13')](_0xb23c('0xf'),auth['isAuthenticated'](),controller[_0xb23c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 048aa99..0848937 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1bf3fa,_0x4daed8){var _0x31bddc=function(_0x4e324d){while(--_0x4e324d){_0x1bf3fa['push'](_0x1bf3fa['shift']());}};_0x31bddc(++_0x4daed8);}(_0xe706,0xa3));var _0x6e70=function(_0x126ee1,_0x4b9781){_0x126ee1=_0x126ee1-0x0;var _0x32524c=_0xe706[_0x126ee1];return _0x32524c;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4e8401,_0x51b328){var _0x17269f=function(_0x35ac65){while(--_0x35ac65){_0x4e8401['push'](_0x4e8401['shift']());}};_0x17269f(++_0x51b328);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 3777043..4d756d2 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 _0x6efc=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','stack','name','send','index','ChatTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','include','options','find','create','body','params','describe'];(function(_0x790c06,_0x1fe3ff){var _0xa6d4fe=function(_0x120a95){while(--_0x120a95){_0x790c06['push'](_0x790c06['shift']());}};_0xa6d4fe(++_0x1fe3ff);}(_0x6efc,0xcf));var _0xc6ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6efc[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc6ef('0x0'));var jsonpatch=require(_0xc6ef('0x1'));var rp=require(_0xc6ef('0x2'));var moment=require('moment');var BPromise=require(_0xc6ef('0x3'));var Mustache=require(_0xc6ef('0x4'));var util=require(_0xc6ef('0x5'));var path=require(_0xc6ef('0x6'));var sox=require(_0xc6ef('0x7'));var csv=require(_0xc6ef('0x8'));var ejs=require(_0xc6ef('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6ef('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc6ef('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6ef('0xc'));var Papa=require(_0xc6ef('0xd'));var Redis=require(_0xc6ef('0xe'));var authService=require(_0xc6ef('0xf'));var qs=require(_0xc6ef('0x10'));var as=require(_0xc6ef('0x11'));var hardwareService=require(_0xc6ef('0x12'));var logger=require(_0xc6ef('0x13'))('api');var utils=require(_0xc6ef('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6ef('0x15'))['db'];function respondWithStatusCode(_0x460164,_0x5ee6e3){_0x5ee6e3=_0x5ee6e3||0xcc;return function(_0x2469a1){if(_0x2469a1){return _0x460164[_0xc6ef('0x16')](_0x5ee6e3);}return _0x460164[_0xc6ef('0x17')](_0x5ee6e3)['end']();};}function respondWithResult(_0x4c2a38,_0x4cb10e){_0x4cb10e=_0x4cb10e||0xc8;return function(_0x5cd836){if(_0x5cd836){return _0x4c2a38['status'](_0x4cb10e)[_0xc6ef('0x18')](_0x5cd836);}};}function respondWithFilteredResult(_0x3ef1d9,_0x578731){return function(_0x32342c){if(_0x32342c){var _0x1be5f2=typeof _0x578731['offset']===_0xc6ef('0x19')&&typeof _0x578731[_0xc6ef('0x1a')]===_0xc6ef('0x19');var _0x36028d=_0x32342c[_0xc6ef('0x1b')];var _0xcc86ee=_0x1be5f2?0x0:_0x578731[_0xc6ef('0x1c')];var _0x191451=_0x1be5f2?_0x32342c[_0xc6ef('0x1b')]:_0x578731[_0xc6ef('0x1c')]+_0x578731[_0xc6ef('0x1a')];var _0x308fc1;if(_0x191451>=_0x36028d){_0x191451=_0x36028d;_0x308fc1=0xc8;}else{_0x308fc1=0xce;}_0x3ef1d9[_0xc6ef('0x17')](_0x308fc1);return _0x3ef1d9['set'](_0xc6ef('0x1d'),_0xcc86ee+'-'+_0x191451+'/'+_0x36028d)[_0xc6ef('0x18')](_0x32342c);}return null;};}function patchUpdates(_0x1803f9){return function(_0x5dab31){try{jsonpatch[_0xc6ef('0x1e')](_0x5dab31,_0x1803f9,!![]);}catch(_0x1f7138){return BPromise[_0xc6ef('0x1f')](_0x1f7138);}return _0x5dab31['save']();};}function saveUpdates(_0x19c368,_0x241982){return function(_0x103462){if(_0x103462){return _0x103462['update'](_0x19c368)[_0xc6ef('0x20')](function(_0x3a585e){return _0x3a585e;});}return null;};}function removeEntity(_0x123b92,_0x3f459b){return function(_0x4091e6){if(_0x4091e6){return _0x4091e6[_0xc6ef('0x21')]()['then'](function(){_0x123b92[_0xc6ef('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cd1ca,_0x25b371){return function(_0x20d858){if(!_0x20d858){_0x4cd1ca[_0xc6ef('0x16')](0x194);}return _0x20d858;};}function handleError(_0xf6eb1f,_0x56aa03){_0x56aa03=_0x56aa03||0x1f4;return function(_0x40d324){logger['error'](_0x40d324[_0xc6ef('0x22')]);if(_0x40d324[_0xc6ef('0x23')]){delete _0x40d324[_0xc6ef('0x23')];}_0xf6eb1f[_0xc6ef('0x17')](_0x56aa03)[_0xc6ef('0x24')](_0x40d324);};}exports[_0xc6ef('0x25')]=function(_0x5ac7bc,_0x2ca76d){var _0x1df934={},_0x583223={},_0x1edccd={'count':0x0,'rows':[]};var _0x5424db=_['map'](db[_0xc6ef('0x26')]['rawAttributes'],function(_0x55ce9d){return{'name':_0x55ce9d[_0xc6ef('0x27')],'type':_0x55ce9d[_0xc6ef('0x28')][_0xc6ef('0x29')]};});_0x583223[_0xc6ef('0x2a')]=_[_0xc6ef('0x2b')](_0x5424db,_0xc6ef('0x23'));_0x583223[_0xc6ef('0x2c')]=_[_0xc6ef('0x2d')](_0x5ac7bc[_0xc6ef('0x2c')]);_0x583223[_0xc6ef('0x2e')]=_['intersection'](_0x583223['model'],_0x583223[_0xc6ef('0x2c')]);_0x1df934['attributes']=_[_0xc6ef('0x2f')](_0x583223['model'],qs[_0xc6ef('0x30')](_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x30')]));_0x1df934[_0xc6ef('0x31')]=_0x1df934[_0xc6ef('0x31')]['length']?_0x1df934[_0xc6ef('0x31')]:_0x583223['model'];if(!_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x32')]('nolimit')){_0x1df934['limit']=qs[_0xc6ef('0x1a')](_0x5ac7bc[_0xc6ef('0x2c')]['limit']);_0x1df934['offset']=qs[_0xc6ef('0x1c')](_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x1c')]);}_0x1df934[_0xc6ef('0x33')]=qs[_0xc6ef('0x34')](_0x5ac7bc['query'][_0xc6ef('0x34')]);_0x1df934[_0xc6ef('0x35')]=qs[_0xc6ef('0x2e')](_[_0xc6ef('0x36')](_0x5ac7bc[_0xc6ef('0x2c')],_0x583223['filters']),_0x5424db);if(_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x37')]){_0x1df934[_0xc6ef('0x35')]=_[_0xc6ef('0x38')](_0x1df934[_0xc6ef('0x35')],{'$or':_['map'](_0x5424db,function(_0x4b028b){if(_0x4b028b[_0xc6ef('0x28')]!==_0xc6ef('0x39')){var _0x4da0c3={};_0x4da0c3[_0x4b028b[_0xc6ef('0x23')]]={'$like':'%'+_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x37')]+'%'};return _0x4da0c3;}})});}_0x1df934=_['merge']({},_0x1df934,_0x5ac7bc['options']);var _0x10b364={'where':_0x1df934['where']};return db[_0xc6ef('0x26')][_0xc6ef('0x1b')](_0x10b364)[_0xc6ef('0x20')](function(_0x55360d){_0x1edccd[_0xc6ef('0x1b')]=_0x55360d;if(_0x5ac7bc['query'][_0xc6ef('0x3a')]){_0x1df934['include']=[{'all':!![]}];}return db[_0xc6ef('0x26')]['findAll'](_0x1df934);})[_0xc6ef('0x20')](function(_0x1e4d25){_0x1edccd[_0xc6ef('0x3b')]=_0x1e4d25;return _0x1edccd;})['then'](respondWithFilteredResult(_0x2ca76d,_0x1df934))[_0xc6ef('0x3c')](handleError(_0x2ca76d,null));};exports[_0xc6ef('0x3d')]=function(_0x21296c,_0x4c5b2a){var _0x1fd359={'raw':!![],'where':{'id':_0x21296c['params']['id']}},_0x18e210={};_0x18e210[_0xc6ef('0x2a')]=_[_0xc6ef('0x2d')](db['ChatTransferReport']['rawAttributes']);_0x18e210[_0xc6ef('0x2c')]=_[_0xc6ef('0x2d')](_0x21296c[_0xc6ef('0x2c')]);_0x18e210[_0xc6ef('0x2e')]=_[_0xc6ef('0x2f')](_0x18e210[_0xc6ef('0x2a')],_0x18e210[_0xc6ef('0x2c')]);_0x1fd359[_0xc6ef('0x31')]=_['intersection'](_0x18e210[_0xc6ef('0x2a')],qs[_0xc6ef('0x30')](_0x21296c[_0xc6ef('0x2c')][_0xc6ef('0x30')]));_0x1fd359[_0xc6ef('0x31')]=_0x1fd359[_0xc6ef('0x31')]['length']?_0x1fd359[_0xc6ef('0x31')]:_0x18e210[_0xc6ef('0x2a')];if(_0x21296c[_0xc6ef('0x2c')][_0xc6ef('0x3a')]){_0x1fd359[_0xc6ef('0x3e')]=[{'all':!![]}];}_0x1fd359=_[_0xc6ef('0x38')]({},_0x1fd359,_0x21296c[_0xc6ef('0x3f')]);return db[_0xc6ef('0x26')][_0xc6ef('0x40')](_0x1fd359)[_0xc6ef('0x20')](handleEntityNotFound(_0x4c5b2a,null))[_0xc6ef('0x20')](respondWithResult(_0x4c5b2a,null))['catch'](handleError(_0x4c5b2a,null));};exports[_0xc6ef('0x41')]=function(_0x390e70,_0xc602ff){return db['ChatTransferReport'][_0xc6ef('0x41')](_0x390e70['body'],{})['then'](respondWithResult(_0xc602ff,0xc9))[_0xc6ef('0x3c')](handleError(_0xc602ff,null));};exports['update']=function(_0x2bf7e8,_0x5c3785){if(_0x2bf7e8[_0xc6ef('0x42')]['id']){delete _0x2bf7e8[_0xc6ef('0x42')]['id'];}return db['ChatTransferReport'][_0xc6ef('0x40')]({'where':{'id':_0x2bf7e8[_0xc6ef('0x43')]['id']}})[_0xc6ef('0x20')](handleEntityNotFound(_0x5c3785,null))['then'](saveUpdates(_0x2bf7e8[_0xc6ef('0x42')],null))[_0xc6ef('0x20')](respondWithResult(_0x5c3785,null))[_0xc6ef('0x3c')](handleError(_0x5c3785,null));};exports[_0xc6ef('0x21')]=function(_0x2599f0,_0xf4da4a){return db['ChatTransferReport'][_0xc6ef('0x40')]({'where':{'id':_0x2599f0[_0xc6ef('0x43')]['id']}})['then'](handleEntityNotFound(_0xf4da4a,null))[_0xc6ef('0x20')](removeEntity(_0xf4da4a,null))[_0xc6ef('0x3c')](handleError(_0xf4da4a,null));};exports[_0xc6ef('0x44')]=function(_0x59652e,_0x56e2c4){return db[_0xc6ef('0x26')][_0xc6ef('0x44')]()[_0xc6ef('0x20')](respondWithResult(_0x56e2c4,null))[_0xc6ef('0x3c')](handleError(_0x56e2c4,null));}; \ No newline at end of file +var _0x33c4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','eml-format'];(function(_0x2c4185,_0x28176d){var _0x2fb767=function(_0x4f862a){while(--_0x4f862a){_0x2c4185['push'](_0x2c4185['shift']());}};_0x2fb767(++_0x28176d);}(_0x33c4,0xef));var _0x433c=function(_0x30fdf9,_0x89096d){_0x30fdf9=_0x30fdf9-0x0;var _0x3c43bb=_0x33c4[_0x30fdf9];return _0x3c43bb;};'use strict';var emlformat=require(_0x433c('0x0'));var rimraf=require(_0x433c('0x1'));var zipdir=require(_0x433c('0x2'));var jsonpatch=require(_0x433c('0x3'));var rp=require(_0x433c('0x4'));var moment=require(_0x433c('0x5'));var BPromise=require(_0x433c('0x6'));var Mustache=require(_0x433c('0x7'));var util=require('util');var path=require(_0x433c('0x8'));var sox=require(_0x433c('0x9'));var csv=require(_0x433c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x433c('0xb'));var _=require(_0x433c('0xc'));var squel=require(_0x433c('0xd'));var crypto=require('crypto');var jsforce=require(_0x433c('0xe'));var deskjs=require(_0x433c('0xf'));var toCsv=require(_0x433c('0xa'));var querystring=require(_0x433c('0x10'));var Papa=require(_0x433c('0x11'));var Redis=require(_0x433c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x433c('0x13'));var as=require(_0x433c('0x14'));var hardwareService=require(_0x433c('0x15'));var logger=require('../../config/logger')(_0x433c('0x16'));var utils=require(_0x433c('0x17'));var config=require(_0x433c('0x18'));var licenseUtil=require(_0x433c('0x19'));var db=require(_0x433c('0x1a'))['db'];function respondWithStatusCode(_0xa984ab,_0x383752){_0x383752=_0x383752||0xcc;return function(_0x3ac2ae){if(_0x3ac2ae){return _0xa984ab['sendStatus'](_0x383752);}return _0xa984ab[_0x433c('0x1b')](_0x383752)[_0x433c('0x1c')]();};}function respondWithResult(_0x5a45d8,_0x52f8db){_0x52f8db=_0x52f8db||0xc8;return function(_0x9b2ff1){if(_0x9b2ff1){return _0x5a45d8[_0x433c('0x1b')](_0x52f8db)[_0x433c('0x1d')](_0x9b2ff1);}};}function respondWithFilteredResult(_0x578984,_0x164058){return function(_0x5151f2){if(_0x5151f2){var _0x242de7=typeof _0x164058[_0x433c('0x1e')]===_0x433c('0x1f')&&typeof _0x164058[_0x433c('0x20')]==='undefined';var _0x185b03=_0x5151f2[_0x433c('0x21')];var _0x1e30f2=_0x242de7?0x0:_0x164058[_0x433c('0x1e')];var _0x21adff=_0x242de7?_0x5151f2[_0x433c('0x21')]:_0x164058['offset']+_0x164058[_0x433c('0x20')];var _0x38d0c1;if(_0x21adff>=_0x185b03){_0x21adff=_0x185b03;_0x38d0c1=0xc8;}else{_0x38d0c1=0xce;}_0x578984['status'](_0x38d0c1);return _0x578984[_0x433c('0x22')]('Content-Range',_0x1e30f2+'-'+_0x21adff+'/'+_0x185b03)[_0x433c('0x1d')](_0x5151f2);}return null;};}function patchUpdates(_0x55db29){return function(_0x2dac54){try{jsonpatch['apply'](_0x2dac54,_0x55db29,!![]);}catch(_0x4d493a){return BPromise[_0x433c('0x23')](_0x4d493a);}return _0x2dac54[_0x433c('0x24')]();};}function saveUpdates(_0x26e3ef,_0x5a8531){return function(_0x275f65){if(_0x275f65){return _0x275f65['update'](_0x26e3ef)[_0x433c('0x25')](function(_0x41ed82){return _0x41ed82;});}return null;};}function removeEntity(_0x119bef,_0x642269){return function(_0x4309e5){if(_0x4309e5){return _0x4309e5[_0x433c('0x26')]()[_0x433c('0x25')](function(){_0x119bef[_0x433c('0x1b')](0xcc)[_0x433c('0x1c')]();});}};}function handleEntityNotFound(_0x20f0d8,_0x51f6bd){return function(_0xf7b528){if(!_0xf7b528){_0x20f0d8[_0x433c('0x27')](0x194);}return _0xf7b528;};}function handleError(_0x405606,_0x24f2a4){_0x24f2a4=_0x24f2a4||0x1f4;return function(_0x285817){logger[_0x433c('0x28')](_0x285817[_0x433c('0x29')]);if(_0x285817[_0x433c('0x2a')]){delete _0x285817[_0x433c('0x2a')];}_0x405606['status'](_0x24f2a4)[_0x433c('0x2b')](_0x285817);};}exports[_0x433c('0x2c')]=function(_0x4da59b,_0x383737){var _0x3cea21={},_0x56023c={},_0x1ee713={'count':0x0,'rows':[]};var _0x2d837d=_[_0x433c('0x2d')](db[_0x433c('0x2e')][_0x433c('0x2f')],function(_0x9effa3){return{'name':_0x9effa3[_0x433c('0x30')],'type':_0x9effa3[_0x433c('0x31')][_0x433c('0x32')]};});_0x56023c[_0x433c('0x33')]=_[_0x433c('0x2d')](_0x2d837d,_0x433c('0x2a'));_0x56023c[_0x433c('0x34')]=_['keys'](_0x4da59b[_0x433c('0x34')]);_0x56023c['filters']=_[_0x433c('0x35')](_0x56023c[_0x433c('0x33')],_0x56023c[_0x433c('0x34')]);_0x3cea21[_0x433c('0x36')]=_['intersection'](_0x56023c['model'],qs[_0x433c('0x37')](_0x4da59b['query']['fields']));_0x3cea21[_0x433c('0x36')]=_0x3cea21[_0x433c('0x36')][_0x433c('0x38')]?_0x3cea21[_0x433c('0x36')]:_0x56023c[_0x433c('0x33')];if(!_0x4da59b[_0x433c('0x34')][_0x433c('0x39')](_0x433c('0x3a'))){_0x3cea21[_0x433c('0x20')]=qs[_0x433c('0x20')](_0x4da59b[_0x433c('0x34')][_0x433c('0x20')]);_0x3cea21['offset']=qs['offset'](_0x4da59b[_0x433c('0x34')]['offset']);}_0x3cea21[_0x433c('0x3b')]=qs[_0x433c('0x3c')](_0x4da59b[_0x433c('0x34')][_0x433c('0x3c')]);_0x3cea21['where']=qs[_0x433c('0x3d')](_[_0x433c('0x3e')](_0x4da59b['query'],_0x56023c[_0x433c('0x3d')]),_0x2d837d);if(_0x4da59b[_0x433c('0x34')][_0x433c('0x3f')]){_0x3cea21[_0x433c('0x40')]=_[_0x433c('0x41')](_0x3cea21[_0x433c('0x40')],{'$or':_[_0x433c('0x2d')](_0x2d837d,function(_0x398aae){if(_0x398aae['type']!==_0x433c('0x42')){var _0x2d2123={};_0x2d2123[_0x398aae[_0x433c('0x2a')]]={'$like':'%'+_0x4da59b['query']['filter']+'%'};return _0x2d2123;}})});}_0x3cea21=_[_0x433c('0x41')]({},_0x3cea21,_0x4da59b[_0x433c('0x43')]);var _0x598af2={'where':_0x3cea21[_0x433c('0x40')]};return db[_0x433c('0x2e')]['count'](_0x598af2)['then'](function(_0x25a509){_0x1ee713[_0x433c('0x21')]=_0x25a509;if(_0x4da59b[_0x433c('0x34')][_0x433c('0x44')]){_0x3cea21[_0x433c('0x45')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x433c('0x46')](_0x3cea21);})['then'](function(_0x11574c){_0x1ee713[_0x433c('0x47')]=_0x11574c;return _0x1ee713;})[_0x433c('0x25')](respondWithFilteredResult(_0x383737,_0x3cea21))['catch'](handleError(_0x383737,null));};exports[_0x433c('0x48')]=function(_0x4af150,_0xe641ab){var _0x416466={'raw':!![],'where':{'id':_0x4af150[_0x433c('0x49')]['id']}},_0x111434={};_0x111434[_0x433c('0x33')]=_['keys'](db[_0x433c('0x2e')][_0x433c('0x2f')]);_0x111434['query']=_[_0x433c('0x4a')](_0x4af150[_0x433c('0x34')]);_0x111434['filters']=_[_0x433c('0x35')](_0x111434[_0x433c('0x33')],_0x111434[_0x433c('0x34')]);_0x416466[_0x433c('0x36')]=_[_0x433c('0x35')](_0x111434[_0x433c('0x33')],qs['fields'](_0x4af150[_0x433c('0x34')]['fields']));_0x416466[_0x433c('0x36')]=_0x416466[_0x433c('0x36')][_0x433c('0x38')]?_0x416466[_0x433c('0x36')]:_0x111434[_0x433c('0x33')];if(_0x4af150[_0x433c('0x34')][_0x433c('0x44')]){_0x416466[_0x433c('0x45')]=[{'all':!![]}];}_0x416466=_['merge']({},_0x416466,_0x4af150[_0x433c('0x43')]);return db['ChatTransferReport'][_0x433c('0x4b')](_0x416466)[_0x433c('0x25')](handleEntityNotFound(_0xe641ab,null))['then'](respondWithResult(_0xe641ab,null))[_0x433c('0x4c')](handleError(_0xe641ab,null));};exports[_0x433c('0x4d')]=function(_0x1ef56a,_0x48a583){return db[_0x433c('0x2e')][_0x433c('0x4d')](_0x1ef56a[_0x433c('0x4e')],{})[_0x433c('0x25')](respondWithResult(_0x48a583,0xc9))[_0x433c('0x4c')](handleError(_0x48a583,null));};exports[_0x433c('0x4f')]=function(_0x5dc935,_0x4b4324){if(_0x5dc935[_0x433c('0x4e')]['id']){delete _0x5dc935['body']['id'];}return db[_0x433c('0x2e')][_0x433c('0x4b')]({'where':{'id':_0x5dc935[_0x433c('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b4324,null))[_0x433c('0x25')](saveUpdates(_0x5dc935[_0x433c('0x4e')],null))[_0x433c('0x25')](respondWithResult(_0x4b4324,null))[_0x433c('0x4c')](handleError(_0x4b4324,null));};exports[_0x433c('0x26')]=function(_0x3a7d35,_0x528cf9){return db[_0x433c('0x2e')][_0x433c('0x4b')]({'where':{'id':_0x3a7d35[_0x433c('0x49')]['id']}})[_0x433c('0x25')](handleEntityNotFound(_0x528cf9,null))[_0x433c('0x25')](removeEntity(_0x528cf9,null))[_0x433c('0x4c')](handleError(_0x528cf9,null));};exports['describe']=function(_0x89f549,_0x29534e){return db[_0x433c('0x2e')]['describe']()['then'](respondWithResult(_0x29534e,null))[_0x433c('0x4c')](handleError(_0x29534e,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 85eb6d9..e3edc8e 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 _0x6520=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x6520,0x127));var _0x0652=function(_0x1bc937,_0xf06a04){_0x1bc937=_0x1bc937-0x0;var _0x56308c=_0x6520[_0x1bc937];return _0x56308c;};'use strict';var _=require(_0x0652('0x0'));var util=require(_0x0652('0x1'));var logger=require(_0x0652('0x2'))(_0x0652('0x3'));var moment=require(_0x0652('0x4'));var BPromise=require(_0x0652('0x5'));var rp=require(_0x0652('0x6'));var fs=require('fs');var path=require(_0x0652('0x7'));var rimraf=require(_0x0652('0x8'));var config=require('../../config/environment');var attributes=require(_0x0652('0x9'));module['exports']=function(_0x27c622,_0x58fd69){return _0x27c622[_0x0652('0xa')](_0x0652('0xb'),attributes,{'tableName':_0x0652('0xc'),'paranoid':![],'indexes':[{'name':_0x0652('0xd'),'fields':[_0x0652('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4241=['util','../../config/logger','api','moment','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid'];(function(_0x9711a9,_0x551293){var _0x41e0ae=function(_0x5ba288){while(--_0x5ba288){_0x9711a9['push'](_0x9711a9['shift']());}};_0x41e0ae(++_0x551293);}(_0x4241,0xd8));var _0x1424=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x4241[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0x1424('0x0'));var logger=require(_0x1424('0x1'))(_0x1424('0x2'));var moment=require(_0x1424('0x3'));var BPromise=require(_0x1424('0x4'));var rp=require(_0x1424('0x5'));var fs=require('fs');var path=require(_0x1424('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1424('0x7'));module[_0x1424('0x8')]=function(_0x2e7ecb,_0x1d1e23){return _0x2e7ecb[_0x1424('0x9')](_0x1424('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1424('0xb'),'fields':[_0x1424('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 209cd62..561f074 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 _0x555c=['client','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x555c,0x183));var _0xc555=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x555c[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xc555('0x0'));var moment=require('moment');var BPromise=require(_0xc555('0x1'));var rs=require(_0xc555('0x2'));var fs=require('fs');var Redis=require(_0xc555('0x3'));var db=require(_0xc555('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc555('0x5'))(_0xc555('0x6'));var config=require(_0xc555('0x7'));var jayson=require(_0xc555('0x8'));var client=jayson[_0xc555('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19d902,_0x58ee9c,_0x539330){return new BPromise(function(_0x3cdccc,_0x86ea63){return client['request'](_0x19d902,_0x539330)[_0xc555('0xa')](function(_0x5fd376){logger[_0xc555('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x58ee9c,'request\x20sent');logger[_0xc555('0xc')](_0xc555('0xd'),_0x58ee9c,_0xc555('0xe'),JSON[_0xc555('0xf')](_0x5fd376));if(_0x5fd376[_0xc555('0x10')]){if(_0x5fd376[_0xc555('0x10')][_0xc555('0x11')]===0x1f4){logger[_0xc555('0x10')](_0xc555('0x12'),_0x58ee9c,_0x5fd376[_0xc555('0x10')][_0xc555('0x13')]);return _0x86ea63(_0x5fd376['error'][_0xc555('0x13')]);}logger[_0xc555('0x10')](_0xc555('0x12'),_0x58ee9c,_0x5fd376[_0xc555('0x10')][_0xc555('0x13')]);return _0x3cdccc(_0x5fd376[_0xc555('0x10')][_0xc555('0x13')]);}else{logger['info'](_0xc555('0x12'),_0x58ee9c,_0xc555('0xe'));_0x3cdccc(_0x5fd376[_0xc555('0x14')]['message']);}})[_0xc555('0x15')](function(_0x204099){logger[_0xc555('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x58ee9c,_0x204099);_0x86ea63(_0x204099);});});} \ No newline at end of file +var _0xe86d=['../../config/logger','../../config/environment','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','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18f94c,_0x335e09){var _0x22d8c5=function(_0x32ce21){while(--_0x32ce21){_0x18f94c['push'](_0x18f94c['shift']());}};_0x22d8c5(++_0x335e09);}(_0xe86d,0x144));var _0xde86=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe86d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xde86('0x0'));var util=require('util');var moment=require(_0xde86('0x1'));var BPromise=require(_0xde86('0x2'));var rs=require(_0xde86('0x3'));var fs=require('fs');var Redis=require(_0xde86('0x4'));var db=require(_0xde86('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde86('0x6'))('rpc');var config=require(_0xde86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xde86('0x8')][_0xde86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33ecc8,_0x1419e8,_0x147be5){return new BPromise(function(_0x53d556,_0x54da1e){return client['request'](_0x33ecc8,_0x147be5)[_0xde86('0xa')](function(_0x3ae1d2){logger[_0xde86('0xb')](_0xde86('0xc'),_0x1419e8,_0xde86('0xd'));logger[_0xde86('0xe')](_0xde86('0xf'),_0x1419e8,_0xde86('0xd'),JSON[_0xde86('0x10')](_0x3ae1d2));if(_0x3ae1d2[_0xde86('0x11')]){if(_0x3ae1d2[_0xde86('0x11')][_0xde86('0x12')]===0x1f4){logger[_0xde86('0x11')](_0xde86('0xc'),_0x1419e8,_0x3ae1d2[_0xde86('0x11')][_0xde86('0x13')]);return _0x54da1e(_0x3ae1d2[_0xde86('0x11')]['message']);}logger[_0xde86('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1419e8,_0x3ae1d2[_0xde86('0x11')][_0xde86('0x13')]);return _0x53d556(_0x3ae1d2['error']['message']);}else{logger[_0xde86('0xb')](_0xde86('0xc'),_0x1419e8,'request\x20sent');_0x53d556(_0x3ae1d2[_0xde86('0x14')]['message']);}})[_0xde86('0x15')](function(_0x51590a){logger[_0xde86('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1419e8,_0x51590a);_0x54da1e(_0x51590a);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 14c4916..ddf5e35 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 _0x23b2=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1f30ca,_0x2ddb13){var _0x57f751=function(_0x4fb64f){while(--_0x4fb64f){_0x1f30ca['push'](_0x1f30ca['shift']());}};_0x57f751(++_0x2ddb13);}(_0x23b2,0x1df));var _0x223b=function(_0x7fa072,_0x356b25){_0x7fa072=_0x7fa072-0x0;var _0x31297f=_0x23b2[_0x7fa072];return _0x31297f;};'use strict';var multer=require(_0x223b('0x0'));var util=require(_0x223b('0x1'));var path=require(_0x223b('0x2'));var timeout=require(_0x223b('0x3'));var express=require(_0x223b('0x4'));var router=express[_0x223b('0x5')]();var fs_extra=require(_0x223b('0x6'));var auth=require(_0x223b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x223b('0x8'));var controller=require('./chatTransferReport.controller');router[_0x223b('0x9')]('/',auth[_0x223b('0xa')](),controller[_0x223b('0xb')]);router[_0x223b('0x9')](_0x223b('0xc'),auth[_0x223b('0xa')](),controller[_0x223b('0xd')]);router[_0x223b('0x9')]('/:id',auth[_0x223b('0xa')](),controller[_0x223b('0xe')]);router['post']('/',auth[_0x223b('0xa')](),controller[_0x223b('0xf')]);router[_0x223b('0x10')](_0x223b('0x11'),auth[_0x223b('0xa')](),controller[_0x223b('0x12')]);router[_0x223b('0x13')](_0x223b('0x11'),auth['isAuthenticated'](),controller[_0x223b('0x14')]);module[_0x223b('0x15')]=router; \ No newline at end of file +var _0x5128=['post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x55c2a2,_0x34fa87){var _0x1ac7e0=function(_0x51decc){while(--_0x51decc){_0x55c2a2['push'](_0x55c2a2['shift']());}};_0x1ac7e0(++_0x34fa87);}(_0x5128,0x16a));var _0x8512=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x5128[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x8512('0x0'));var util=require(_0x8512('0x1'));var path=require(_0x8512('0x2'));var timeout=require(_0x8512('0x3'));var express=require(_0x8512('0x4'));var router=express[_0x8512('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8512('0x6'));var config=require(_0x8512('0x7'));var controller=require(_0x8512('0x8'));router[_0x8512('0x9')]('/',auth['isAuthenticated'](),controller[_0x8512('0xa')]);router['get'](_0x8512('0xb'),auth[_0x8512('0xc')](),controller[_0x8512('0xd')]);router[_0x8512('0x9')](_0x8512('0xe'),auth[_0x8512('0xc')](),controller[_0x8512('0xf')]);router[_0x8512('0x10')]('/',auth[_0x8512('0xc')](),controller[_0x8512('0x11')]);router['put'](_0x8512('0xe'),auth[_0x8512('0xc')](),controller[_0x8512('0x12')]);router[_0x8512('0x13')](_0x8512('0xe'),auth[_0x8512('0xc')](),controller['destroy']);module[_0x8512('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 238f358..d45b42e 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 _0xf109=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','Agent'];(function(_0x47df00,_0x2762bc){var _0x6a0587=function(_0x255bd9){while(--_0x255bd9){_0x47df00['push'](_0x47df00['shift']());}};_0x6a0587(++_0x2762bc);}(_0xf109,0xce));var _0x9f10=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xf109[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x9f10('0x0'));var rs=require(_0x9f10('0x1'));module[_0x9f10('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x9f10('0x3')]},'mapKey':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'key':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x5')},'customerAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9f10('0x3')]},'animation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9f10('0x9')]('rounded','squared'),'defaultValue':_0x9f10('0xa')},'header_online':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xc')},'offline_chat_button':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xe')},'download_transcript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x12')},'noteTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x16')},'ratingType':{'type':Sequelize[_0x9f10('0x9')](_0x9f10('0x17'),_0x9f10('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':_0x9f10('0x1b'),'variable':null,'config':{'placeholder':_0x9f10('0x1c'),'type':'text','required':!![]},'props':{'title':_0x9f10('0x1c'),'helpText':''}},{'type':_0x9f10('0x1b'),'props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9f10('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x1e'))?JSON['parse'](this[_0x9f10('0x1d')](_0x9f10('0x1e'))):{};},'set':function(_0x11cae7){return this[_0x9f10('0x1f')]('onlineForm',JSON['stringify'](_0x11cae7));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':'input','props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9f10('0x4'),'type':_0x9f10('0x4')},'variable':null},{'type':_0x9f10('0x20'),'config':{'placeholder':_0x9f10('0x21')},'props':{'title':'Comments','helpText':_0x9f10('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x23'))?JSON[_0x9f10('0x24')](this[_0x9f10('0x1d')](_0x9f10('0x23'))):{};},'set':function(_0x581b1d){return this[_0x9f10('0x1f')](_0x9f10('0x23'),JSON[_0x9f10('0x1a')](_0x581b1d));}},'token':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x25')},'waitingMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x26')},'offlineMessageBody':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9f10('0x29')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9f10('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9f10('0x29')],'defaultValue':function(){return _0x9f10('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2c')},'verticalAlignment':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2d')},'messagesAlignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2e')},'defaultTitle':{'type':Sequelize[_0x9f10('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9f10('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'comment':_0x9f10('0x31'),'set':function(_0x433e70){if(!_0x433e70)this[_0x9f10('0x1f')](_0x9f10('0x32'),null);this[_0x9f10('0x1f')](_0x9f10('0x33'),_0x433e70);}},'vidaooEscalation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9f10('0x3')]},'vidaooTopic':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2750=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Send','Feedback','thumb','star','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2750,0x13b));var _0x0275=function(_0x441b96,_0x33388d){_0x441b96=_0x441b96-0x0;var _0x291425=_0x2750[_0x441b96];return _0x291425;};'use strict';var Sequelize=require(_0x0275('0x0'));var rs=require('randomstring');module[_0x0275('0x1')]={'name':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'unique':_0x0275('0x3')},'description':{'type':Sequelize[_0x0275('0x2')]},'mapKey':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'key':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x5')},'customerAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0275('0xa')](_0x0275('0xb'),_0x0275('0xc')),'defaultValue':_0x0275('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0xd')},'start_chat_button':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xf')},'download_transcript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0275('0x11')]},'closingQuestion':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x13')},'noteTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x14')},'skipMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x15')},'ratingType':{'type':Sequelize['ENUM']('star',_0x0275('0x16')),'defaultValue':_0x0275('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0275('0x19'),'type':'text','required':!![]},'props':{'title':_0x0275('0x19'),'helpText':''}},{'type':_0x0275('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':_0x0275('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0275('0x1b')]('onlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x1d'))):{};},'set':function(_0x15813f){return this[_0x0275('0x1e')](_0x0275('0x1d'),JSON['stringify'](_0x15813f));}},'offlineForm':{'type':Sequelize[_0x0275('0x11')],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':_0x0275('0x1a'),'props':{'title':_0x0275('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':'email'},'variable':null},{'type':_0x0275('0x1f'),'config':{'placeholder':_0x0275('0x20')},'props':{'title':_0x0275('0x20'),'helpText':_0x0275('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x0275('0x1b')]('offlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x22'))):{};},'set':function(_0x489d7f){return this['setDataValue'](_0x0275('0x22'),JSON[_0x0275('0x18')](_0x489d7f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0275('0x23')]();}},'autoclose':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0275('0x2')]},'waitingTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0275('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0275('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0275('0x2a');}},'notificationSound':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2d')},'defaultTitle':{'type':Sequelize[_0x0275('0x2')]},'customerAvatar':{'type':Sequelize[_0x0275('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0275('0x8')],'comment':_0x0275('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0275('0x31'),'set':function(_0x76b8fa){if(!_0x76b8fa)this[_0x0275('0x1e')](_0x0275('0x32'),null);this[_0x0275('0x1e')](_0x0275('0x33'),_0x76b8fa);}},'vidaooEscalation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x34')},'vidaooNote':{'type':Sequelize[_0x0275('0x2')],'defaultValue':function(){return _0x0275('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0275('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index afac044..3ab9f27 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 _0x17cd=['index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','params','include','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatWebsites','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','../../config/license/util','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','DESC','ChatApplication','account','applications','Applications','list','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','iftime\x20%s,%s','interval','timezone','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','online','false','offlineForm','onlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','UserProfileResource','stack','name','send'];(function(_0x3ba2fb,_0x5e00d9){var _0x36d161=function(_0x5364d3){while(--_0x5364d3){_0x3ba2fb['push'](_0x3ba2fb['shift']());}};_0x36d161(++_0x5e00d9);}(_0x17cd,0xf9));var _0xd17c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x17cd[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xd17c('0x0'));var Mustache=require(_0xd17c('0x1'));var util=require('util');var path=require(_0xd17c('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd17c('0x3'));var _=require(_0xd17c('0x4'));var querystring=require(_0xd17c('0x5'));var Redis=require(_0xd17c('0x6'));var qs=require(_0xd17c('0x7'));var logger=require(_0xd17c('0x8'))('api');var config=require(_0xd17c('0x9'));var db=require(_0xd17c('0xa'))['db'];config[_0xd17c('0xb')]=_[_0xd17c('0xc')](config['redis'],{'host':_0xd17c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd17c('0xb')]));require(_0xd17c('0xe'))[_0xd17c('0xf')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson['client'][_0xd17c('0x10')]({'port':0x232c});var client9002=jayson[_0xd17c('0x11')][_0xd17c('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xd17c('0x10')]({'port':0x232b});var client9001=jayson[_0xd17c('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x34537c,_0x861413,_0x231719,_0x12c679){return new BPromise(function(_0x181a63,_0x2dd14c){var _0x599635=_0x12c679||client;return _0x599635[_0xd17c('0x12')](_0x34537c,_0x231719)[_0xd17c('0x13')](function(_0x1bf7dc){logger['info'](_0xd17c('0x14'),_0x861413,_0xd17c('0x15'));logger[_0xd17c('0x16')](_0xd17c('0x17'),_0x861413,'request\x20sent',JSON[_0xd17c('0x18')](_0x1bf7dc));if(_0x1bf7dc[_0xd17c('0x19')]){if(_0x1bf7dc[_0xd17c('0x19')][_0xd17c('0x1a')]===0x1f4){logger[_0xd17c('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x861413,_0x1bf7dc[_0xd17c('0x19')][_0xd17c('0x1b')]);return _0x2dd14c(_0x1bf7dc[_0xd17c('0x19')]['message']);}logger[_0xd17c('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x861413,_0x1bf7dc[_0xd17c('0x19')]['message']);return _0x181a63(_0x1bf7dc[_0xd17c('0x19')][_0xd17c('0x1b')]);}else{logger[_0xd17c('0x1c')](_0xd17c('0x14'),_0x861413,'request\x20sent');_0x181a63(_0x1bf7dc[_0xd17c('0x1d')][_0xd17c('0x1b')]);}})[_0xd17c('0x1e')](function(_0x4f565e){logger['error'](_0xd17c('0x14'),_0x861413,_0x4f565e);_0x2dd14c(_0x4f565e);});});}function respondWithStatusCode(_0x5b79b7,_0x20fc07){_0x20fc07=_0x20fc07||0xcc;return function(_0x4b37d8){if(_0x4b37d8){return _0x5b79b7[_0xd17c('0x1f')](_0x20fc07);}return _0x5b79b7['status'](_0x20fc07)[_0xd17c('0x20')]();};}function respondWithResult(_0xdd53ca,_0x67401c){_0x67401c=_0x67401c||0xc8;return function(_0x26f22e){if(_0x26f22e){return _0xdd53ca[_0xd17c('0x21')](_0x67401c)['json'](_0x26f22e);}};}function respondWithFilteredResult(_0x1bde18,_0x52270f){return function(_0x18d73b){if(_0x18d73b){var _0xbb1cb9=typeof _0x52270f[_0xd17c('0x22')]===_0xd17c('0x23')&&typeof _0x52270f[_0xd17c('0x24')]===_0xd17c('0x23');var _0x5f8b=_0x18d73b[_0xd17c('0x25')];var _0x58753c=_0xbb1cb9?0x0:_0x52270f[_0xd17c('0x22')];var _0x46c900=_0xbb1cb9?_0x18d73b['count']:_0x52270f[_0xd17c('0x22')]+_0x52270f[_0xd17c('0x24')];var _0x4cba58;if(_0x46c900>=_0x5f8b){_0x46c900=_0x5f8b;_0x4cba58=0xc8;}else{_0x4cba58=0xce;}_0x1bde18['status'](_0x4cba58);return _0x1bde18[_0xd17c('0x26')](_0xd17c('0x27'),_0x58753c+'-'+_0x46c900+'/'+_0x5f8b)[_0xd17c('0x28')](_0x18d73b);}return null;};}function saveUpdates(_0x135575){return function(_0x5479e8){if(_0x5479e8){return _0x5479e8[_0xd17c('0x29')](_0x135575)[_0xd17c('0x13')](function(_0x367b36){return _0x367b36;});}return null;};}function removeEntity(_0x4f567b){return function(_0x2c5b5f){if(_0x2c5b5f){return _0x2c5b5f[_0xd17c('0x2a')]()[_0xd17c('0x13')](function(){var _0x46ab00=_0x2c5b5f[_0xd17c('0x2b')]({'plain':!![]});var _0x333013='ChatWebsites';return db[_0xd17c('0x2c')]['destroy']({'where':{'type':_0x333013,'resourceId':_0x46ab00['id']}})[_0xd17c('0x13')](function(){return _0x2c5b5f;});})[_0xd17c('0x13')](function(){_0x4f567b[_0xd17c('0x21')](0xcc)[_0xd17c('0x20')]();});}};}function handleEntityNotFound(_0x4f2fe2){return function(_0x2339dd){if(!_0x2339dd){_0x4f2fe2['sendStatus'](0x194);}return _0x2339dd;};}function handleError(_0x366588,_0x27db77){_0x27db77=_0x27db77||0x1f4;return function(_0x47dc74){logger[_0xd17c('0x19')](_0x47dc74[_0xd17c('0x2d')]);if(_0x47dc74[_0xd17c('0x2e')]){delete _0x47dc74[_0xd17c('0x2e')];}_0x366588[_0xd17c('0x21')](_0x27db77)[_0xd17c('0x2f')](_0x47dc74);};}exports[_0xd17c('0x30')]=function(_0x30b419,_0xdbb232){var _0x13d917={'include':[{'model':db[_0xd17c('0x31')],'as':_0xd17c('0x32')}]},_0x5f10d9={},_0x2bc24f={'count':0x0,'rows':[]};var _0x5f1c6d=_[_0xd17c('0x33')](db[_0xd17c('0x34')][_0xd17c('0x35')],function(_0x4b95c7){return{'name':_0x4b95c7[_0xd17c('0x36')],'type':_0x4b95c7[_0xd17c('0x37')]['key']};});_0x5f10d9[_0xd17c('0x38')]=_[_0xd17c('0x33')](_0x5f1c6d,_0xd17c('0x2e'));_0x5f10d9[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x30b419[_0xd17c('0x39')]);_0x5f10d9['filters']=_[_0xd17c('0x3b')](_0x5f10d9[_0xd17c('0x38')],_0x5f10d9[_0xd17c('0x39')]);_0x13d917[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x5f10d9['model'],qs[_0xd17c('0x3d')](_0x30b419[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x13d917[_0xd17c('0x3c')]=_0x13d917[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x13d917[_0xd17c('0x3c')]:_0x5f10d9[_0xd17c('0x38')];if(!_0x30b419[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x13d917['limit']=qs[_0xd17c('0x24')](_0x30b419[_0xd17c('0x39')]['limit']);_0x13d917[_0xd17c('0x22')]=qs['offset'](_0x30b419[_0xd17c('0x39')][_0xd17c('0x22')]);}_0x13d917[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x30b419['query'][_0xd17c('0x42')]);_0x13d917[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_['pick'](_0x30b419['query'],_0x5f10d9[_0xd17c('0x44')]),_0x5f1c6d);if(_0x30b419[_0xd17c('0x39')][_0xd17c('0x45')]){_0x13d917[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x13d917['where'],{'$or':_[_0xd17c('0x33')](_0x5f1c6d,function(_0x14db40){if(_0x14db40[_0xd17c('0x37')]!==_0xd17c('0x47')){var _0x375aec={};_0x375aec[_0x14db40[_0xd17c('0x2e')]]={'$like':'%'+_0x30b419[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x375aec;}})});}_0x13d917=_[_0xd17c('0x46')]({},_0x13d917,_0x30b419[_0xd17c('0x48')]);var _0x50f732={'where':_0x13d917[_0xd17c('0x43')]};return db[_0xd17c('0x34')][_0xd17c('0x25')](_0x50f732)[_0xd17c('0x13')](function(_0x465e93){_0x2bc24f[_0xd17c('0x25')]=_0x465e93;if(_0x30b419[_0xd17c('0x39')][_0xd17c('0x49')]){_0x13d917['include']=[{'all':!![]}];}return db[_0xd17c('0x34')]['findAll'](_0x13d917);})['then'](function(_0x148a78){_0x2bc24f['rows']=_0x148a78;return _0x2bc24f;})[_0xd17c('0x13')](respondWithFilteredResult(_0xdbb232,_0x13d917))[_0xd17c('0x1e')](handleError(_0xdbb232,null));};exports['show']=function(_0x23c786,_0x52d4bd){var _0x75e627={'raw':![],'where':{'id':_0x23c786[_0xd17c('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0xd17c('0x32')}]},_0x2edd35={};_0x2edd35['model']=_['keys'](db['ChatWebsite'][_0xd17c('0x35')]);_0x2edd35[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x23c786['query']);_0x2edd35[_0xd17c('0x44')]=_['intersection'](_0x2edd35[_0xd17c('0x38')],_0x2edd35[_0xd17c('0x39')]);_0x75e627[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x2edd35['model'],qs[_0xd17c('0x3d')](_0x23c786[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x75e627[_0xd17c('0x3c')]=_0x75e627[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x75e627[_0xd17c('0x3c')]:_0x2edd35[_0xd17c('0x38')];if(_0x23c786['query'][_0xd17c('0x49')]){_0x75e627[_0xd17c('0x4b')]=[{'all':!![]}];}_0x75e627=_[_0xd17c('0x46')]({},_0x75e627,_0x23c786[_0xd17c('0x48')]);return db[_0xd17c('0x34')][_0xd17c('0x4c')](_0x75e627)[_0xd17c('0x13')](handleEntityNotFound(_0x52d4bd,null))[_0xd17c('0x13')](respondWithResult(_0x52d4bd,null))[_0xd17c('0x1e')](handleError(_0x52d4bd,null));};exports['create']=function(_0x1f6d54,_0x2bc363){return db[_0xd17c('0x34')]['create'](_0x1f6d54[_0xd17c('0x4d')],{})[_0xd17c('0x13')](function(_0x428d82){var _0x25de2c=_0x1f6d54['user'][_0xd17c('0x2b')]({'plain':!![]});if(!_0x25de2c)throw new Error(_0xd17c('0x4e'));if(_0x25de2c[_0xd17c('0x4f')]===_0xd17c('0x50')){var _0x30a6a7=_0x428d82[_0xd17c('0x2b')]({'plain':!![]});var _0x2c4d73=_0xd17c('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x2c4d73,'userProfileId':_0x25de2c[_0xd17c('0x52')]},'raw':!![]})[_0xd17c('0x13')](function(_0x514a1a){if(_0x514a1a&&_0x514a1a['autoAssociation']===0x0){return db[_0xd17c('0x2c')][_0xd17c('0x53')]({'name':_0x30a6a7[_0xd17c('0x2e')],'resourceId':_0x30a6a7['id'],'type':_0x514a1a[_0xd17c('0x2e')],'sectionId':_0x514a1a['id']},{})[_0xd17c('0x13')](function(){return _0x428d82;});}else{return _0x428d82;}})['catch'](function(_0x50fd60){logger[_0xd17c('0x19')](_0xd17c('0x54'),_0x50fd60);throw _0x50fd60;});}return _0x428d82;})[_0xd17c('0x13')](respondWithResult(_0x2bc363,0xc9))[_0xd17c('0x1e')](handleError(_0x2bc363,null));};exports['update']=function(_0x1a07b1,_0x411f1d){if(_0x1a07b1['body']['id']){delete _0x1a07b1[_0xd17c('0x4d')]['id'];}return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x1a07b1['params']['id']},'include':[{'model':db[_0xd17c('0x31')],'as':'mandatoryDispositionPause'}]})[_0xd17c('0x13')](handleEntityNotFound(_0x411f1d,null))[_0xd17c('0x13')](saveUpdates(_0x1a07b1['body'],null))[_0xd17c('0x13')](respondWithResult(_0x411f1d,null))[_0xd17c('0x1e')](handleError(_0x411f1d,null));};exports['destroy']=function(_0x95ef88,_0x500654){return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x95ef88['params']['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x500654,null))[_0xd17c('0x13')](removeEntity(_0x500654,null))[_0xd17c('0x1e')](handleError(_0x500654,null));};exports[_0xd17c('0x55')]=function(_0x4daa83,_0x1af564){return db[_0xd17c('0x34')][_0xd17c('0x55')]()[_0xd17c('0x13')](respondWithResult(_0x1af564,null))['catch'](handleError(_0x1af564,null));};exports[_0xd17c('0x56')]=function(_0x3af8cc,_0x101b36){if(_0x3af8cc['body']['id']){delete _0x3af8cc[_0xd17c('0x4d')]['id'];}return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x3af8cc[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x101b36,null))[_0xd17c('0x13')](function(_0x268c5c){if(_0x268c5c){_0x3af8cc[_0xd17c('0x4d')][_0xd17c('0x57')]=_0x268c5c['id'];return db[_0xd17c('0x58')][_0xd17c('0x53')](_0x3af8cc[_0xd17c('0x4d')]);}})[_0xd17c('0x13')](respondWithResult(_0x101b36,null))[_0xd17c('0x1e')](handleError(_0x101b36,null));};exports[_0xd17c('0x59')]=function(_0x637145,_0x5e4550){var _0x51ce2c={'raw':![],'where':{}};var _0x2430d2={};var _0x206a3d={'count':0x0,'rows':[]};return db[_0xd17c('0x34')]['findOne']({'where':{'id':_0x637145[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x5e4550,null))[_0xd17c('0x13')](function(_0x12ef5a){if(_0x12ef5a){_0x2430d2[_0xd17c('0x38')]=_[_0xd17c('0x3a')](db[_0xd17c('0x58')][_0xd17c('0x35')]);_0x2430d2[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x637145[_0xd17c('0x39')]);_0x2430d2[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x2430d2[_0xd17c('0x38')],_0x2430d2[_0xd17c('0x39')]);_0x51ce2c[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x2430d2['model'],qs['fields'](_0x637145[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x51ce2c[_0xd17c('0x3c')]=_0x51ce2c[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x51ce2c[_0xd17c('0x3c')]:_0x2430d2[_0xd17c('0x38')];if(!_0x637145[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x51ce2c[_0xd17c('0x24')]=qs['limit'](_0x637145['query'][_0xd17c('0x24')]);_0x51ce2c[_0xd17c('0x22')]=qs['offset'](_0x637145[_0xd17c('0x39')][_0xd17c('0x22')]);}_0x51ce2c[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x637145['query']['sort']);_0x51ce2c[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0x637145[_0xd17c('0x39')],_0x2430d2[_0xd17c('0x44')]));_0x51ce2c[_0xd17c('0x43')]['ChatWebsiteId']=_0x12ef5a['id'];if(_0x637145[_0xd17c('0x39')][_0xd17c('0x45')]){_0x51ce2c[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x51ce2c[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x51ce2c[_0xd17c('0x3c')],function(_0x316c94){var _0x5e193d={};_0x5e193d[_0x316c94]={'$like':'%'+_0x637145[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x5e193d;})});}_0x51ce2c=_[_0xd17c('0x46')]({},_0x51ce2c,_0x637145[_0xd17c('0x48')]);return db[_0xd17c('0x58')][_0xd17c('0x25')]({'where':_0x51ce2c[_0xd17c('0x43')]})[_0xd17c('0x13')](function(_0x381b13){_0x206a3d[_0xd17c('0x25')]=_0x381b13;if(_0x637145[_0xd17c('0x39')][_0xd17c('0x49')]){_0x51ce2c[_0xd17c('0x4b')]=[{'all':!![]}];}return db[_0xd17c('0x58')][_0xd17c('0x5b')](_0x51ce2c);})['then'](function(_0x3a952c){_0x206a3d[_0xd17c('0x5c')]=_0x3a952c;return _0x206a3d;});}})[_0xd17c('0x13')](respondWithFilteredResult(_0x5e4550,_0x51ce2c))['catch'](handleError(_0x5e4550,null));};exports[_0xd17c('0x5d')]=function(_0x19be6c,_0x3abd5c){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x19be6c['params']['id']}})['then'](handleEntityNotFound(_0x3abd5c,null))[_0xd17c('0x13')](function(_0xc9b314){if(_0xc9b314){return _0xc9b314[_0xd17c('0x5d')](_0x19be6c[_0xd17c('0x39')]['ids']);}})[_0xd17c('0x13')](respondWithStatusCode(_0x3abd5c,null))[_0xd17c('0x1e')](handleError(_0x3abd5c,null));};exports[_0xd17c('0x5e')]=function(_0x5841ce,_0xec7fd5){if(_0x5841ce[_0xd17c('0x4d')]['id']){delete _0x5841ce[_0xd17c('0x4d')]['id'];}return db[_0xd17c('0x34')]['find']({'where':{'id':_0x5841ce['params']['id']}})['then'](handleEntityNotFound(_0xec7fd5,null))[_0xd17c('0x13')](function(_0x59f8ff){if(_0x59f8ff){_0x5841ce[_0xd17c('0x4d')][_0xd17c('0x57')]=_0x59f8ff['id'];return db[_0xd17c('0x5f')][_0xd17c('0x53')](_0x5841ce[_0xd17c('0x4d')]);}})[_0xd17c('0x13')](respondWithResult(_0xec7fd5,null))['catch'](handleError(_0xec7fd5,null));};exports[_0xd17c('0x60')]=function(_0x3dc51d,_0x56f044){var _0x1bf8dc={'raw':![],'where':{}};var _0x444aa4={};var _0x263974={'count':0x0,'rows':[]};return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0x3dc51d[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x56f044,null))[_0xd17c('0x13')](function(_0x17d006){if(_0x17d006){_0x444aa4['model']=_[_0xd17c('0x3a')](db[_0xd17c('0x5f')][_0xd17c('0x35')]);_0x444aa4['query']=_['keys'](_0x3dc51d[_0xd17c('0x39')]);_0x444aa4[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x444aa4[_0xd17c('0x38')],_0x444aa4[_0xd17c('0x39')]);_0x1bf8dc[_0xd17c('0x3c')]=_['intersection'](_0x444aa4[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x1bf8dc['attributes']=_0x1bf8dc['attributes'][_0xd17c('0x3e')]?_0x1bf8dc[_0xd17c('0x3c')]:_0x444aa4[_0xd17c('0x38')];if(!_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x3f')]('nolimit')){_0x1bf8dc[_0xd17c('0x24')]=qs['limit'](_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x24')]);_0x1bf8dc[_0xd17c('0x22')]=qs[_0xd17c('0x22')](_0x3dc51d[_0xd17c('0x39')]['offset']);}_0x1bf8dc['order']=qs[_0xd17c('0x42')](_0x3dc51d['query'][_0xd17c('0x42')]);_0x1bf8dc['where']=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0x3dc51d[_0xd17c('0x39')],_0x444aa4['filters']));_0x1bf8dc[_0xd17c('0x43')][_0xd17c('0x57')]=_0x17d006['id'];if(_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x45')]){_0x1bf8dc[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x1bf8dc[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x1bf8dc['attributes'],function(_0x453d3d){var _0xec75a8={};_0xec75a8[_0x453d3d]={'$like':'%'+_0x3dc51d[_0xd17c('0x39')]['filter']+'%'};return _0xec75a8;})});}_0x1bf8dc=_[_0xd17c('0x46')]({},_0x1bf8dc,_0x3dc51d['options']);return db[_0xd17c('0x5f')][_0xd17c('0x25')]({'where':_0x1bf8dc['where']})['then'](function(_0x278788){_0x263974[_0xd17c('0x25')]=_0x278788;if(_0x3dc51d['query'][_0xd17c('0x49')]){_0x1bf8dc[_0xd17c('0x4b')]=[{'all':!![]}];}return db[_0xd17c('0x5f')][_0xd17c('0x5b')](_0x1bf8dc);})['then'](function(_0x548dbf){_0x263974[_0xd17c('0x5c')]=_0x548dbf;return _0x263974;});}})[_0xd17c('0x13')](respondWithFilteredResult(_0x56f044,_0x1bf8dc))['catch'](handleError(_0x56f044,null));};exports[_0xd17c('0x62')]=function(_0x4287d4,_0x55ee45){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x4287d4[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x55ee45,null))[_0xd17c('0x13')](function(_0x2c7981){if(_0x2c7981){return _0x2c7981[_0xd17c('0x62')](_0x4287d4[_0xd17c('0x39')][_0xd17c('0x63')]);}})[_0xd17c('0x13')](respondWithStatusCode(_0x55ee45,null))[_0xd17c('0x1e')](handleError(_0x55ee45,null));};exports[_0xd17c('0x64')]=function(_0x1ce748,_0x5acde7){_0x1ce748[_0xd17c('0x4d')][_0xd17c('0x65')]=_0x1ce748['file'][_0xd17c('0x66')];return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x1ce748[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x5acde7,null))[_0xd17c('0x13')](saveUpdates(_0x1ce748[_0xd17c('0x4d')],null))['then'](respondWithResult(_0x5acde7,null))['catch'](handleError(_0x5acde7,null));};exports[_0xd17c('0x67')]=function(_0x385471,_0x39613f){_0x385471['body'][_0xd17c('0x68')]=_0x385471[_0xd17c('0x69')][_0xd17c('0x66')];return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x385471[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x39613f,null))[_0xd17c('0x13')](saveUpdates(_0x385471['body'],null))['then'](respondWithResult(_0x39613f,null))['catch'](handleError(_0x39613f,null));};exports[_0xd17c('0x6a')]=function(_0x3a05f1,_0x593e9c){_0x3a05f1['body'][_0xd17c('0x6b')]=_0x3a05f1[_0xd17c('0x69')][_0xd17c('0x66')];return db[_0xd17c('0x34')]['find']({'where':{'id':_0x3a05f1[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x593e9c,null))[_0xd17c('0x13')](saveUpdates(_0x3a05f1[_0xd17c('0x4d')],null))[_0xd17c('0x13')](respondWithResult(_0x593e9c,null))['catch'](handleError(_0x593e9c,null));};exports['addSystemAvatar']=function(_0x2d4932,_0x410ad8){_0x2d4932[_0xd17c('0x4d')][_0xd17c('0x6c')]=_0x2d4932[_0xd17c('0x69')][_0xd17c('0x66')];return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x2d4932[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x410ad8,null))[_0xd17c('0x13')](saveUpdates(_0x2d4932['body'],null))[_0xd17c('0x13')](respondWithResult(_0x410ad8,null))[_0xd17c('0x1e')](handleError(_0x410ad8,null));};exports[_0xd17c('0x6d')]=function(_0x5ebac5,_0x4a3645){var _0x250492=path['join'](config['root'],'server/files/images/logos/default_logo.svg');var _0x362265={'where':{'id':_0x5ebac5[_0xd17c('0x4a')]['id']},'attributes':['id',_0xd17c('0x65')],'raw':!![]};var _0x5ab70f=![];return require(_0xd17c('0x6e'))[_0xd17c('0x6f')]()['then'](function(_0x471938){if(_0x471938){_0x5ab70f=_0x471938[_0xd17c('0x70')];}})['then'](function(){return db[_0xd17c('0x34')][_0xd17c('0x4c')](_0x362265);})[_0xd17c('0x13')](handleEntityNotFound(_0x4a3645,null))['then'](function(_0xe33801){if(_0xe33801){if(!_[_0xd17c('0x71')](_0xe33801[_0xd17c('0x65')])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x75'),_0xe33801[_0xd17c('0x65')]))&&_0x5ab70f){_0x250492=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x75'),_0xe33801[_0xd17c('0x65')]);}}return _0x4a3645['download'](_0x250492);}})[_0xd17c('0x1e')](handleError(_0x4a3645,null));};exports[_0xd17c('0x76')]=function(_0xa7aef7,_0x1053ef){var _0x1902f7=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x77'));var _0xf53fd1={'where':{'id':_0xa7aef7['params']['id']},'attributes':['id',_0xd17c('0x68')],'raw':!![]};return db['ChatWebsite'][_0xd17c('0x4c')](_0xf53fd1)[_0xd17c('0x13')](handleEntityNotFound(_0x1053ef,null))['then'](function(_0x2a36df){if(_0x2a36df){if(!_[_0xd17c('0x71')](_0x2a36df['agentAvatar'])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config['root'],'server/files/images/avatars/',_0x2a36df['agentAvatar']))){_0x1902f7=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x78'),_0x2a36df[_0xd17c('0x68')]);}}return _0x1053ef['download'](_0x1902f7);}})[_0xd17c('0x1e')](handleError(_0x1053ef,null));};exports['getCustomerAvatar']=function(_0x846a37,_0x45fa23){var _0x322690=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x79'));var _0x51228d={'where':{'id':_0x846a37['params']['id']},'attributes':['id',_0xd17c('0x6b'),_0xd17c('0x7a')],'raw':!![]};return db[_0xd17c('0x34')][_0xd17c('0x4c')](_0x51228d)['then'](handleEntityNotFound(_0x45fa23,null))[_0xd17c('0x13')](function(_0x3402a6){if(_0x3402a6){if(!_[_0xd17c('0x71')](_0x3402a6[_0xd17c('0x6b')])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],'server/files/images/avatars/',_0x3402a6[_0xd17c('0x6b')]))&&_0x3402a6[_0xd17c('0x7a')]){_0x322690=path[_0xd17c('0x73')](config[_0xd17c('0x74')],'server/files/images/avatars/',_0x3402a6['customerAvatar']);}}return _0x45fa23[_0xd17c('0x7b')](_0x322690);}})['catch'](handleError(_0x45fa23,null));};exports[_0xd17c('0x7c')]=function(_0x29db72,_0x3fc1fd){var _0x1109aa=path['join'](config[_0xd17c('0x74')],_0xd17c('0x7d'));var _0x5448f2={'where':{'id':_0x29db72['params']['id']},'attributes':['id',_0xd17c('0x6c')],'raw':!![]};return db[_0xd17c('0x34')]['find'](_0x5448f2)[_0xd17c('0x13')](handleEntityNotFound(_0x3fc1fd,null))['then'](function(_0x353852){if(_0x353852){if(!_[_0xd17c('0x71')](_0x353852[_0xd17c('0x6c')])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x78'),_0x353852[_0xd17c('0x6c')]))){_0x1109aa=path['join'](config[_0xd17c('0x74')],_0xd17c('0x78'),_0x353852[_0xd17c('0x6c')]);}}return _0x3fc1fd[_0xd17c('0x7b')](_0x1109aa);}})[_0xd17c('0x1e')](handleError(_0x3fc1fd,null));};exports[_0xd17c('0x7e')]=function(_0xb3dbd7,_0x403575){var _0x34a19c=require(_0xd17c('0x7f'));var _0x50e083=new _0x34a19c();var _0x1625ba=_0x50e083['setUA'](_0xb3dbd7[_0xd17c('0x80')]['user-agent'])[_0xd17c('0x81')]();var _0x5c106c={'body':_0xb3dbd7['body'],'channel':_0xd17c('0x82')};var _0x717316=[];var _0x1c251e=[];var _0x1123d7={};var _0x2664a1=![];return db['CmContact'][_0xd17c('0x55')]()[_0xd17c('0x13')](function(_0x2b531d){if(!_0x2b531d){throw new db['Sequelize'][(_0xd17c('0x83'))](_0xd17c('0x84'));}_0x717316=_[_0xd17c('0x85')](_[_0xd17c('0x3a')](_0x2b531d),[_0xd17c('0x86'),_0xd17c('0x87')]);_0x1c251e=_[_0xd17c('0x85')](_[_0xd17c('0x3a')](_0x2b531d),[_0xd17c('0x86'),_0xd17c('0x87'),_0xd17c('0x88'),_0xd17c('0x89')]);if(_0xb3dbd7[_0xd17c('0x4d')]['id']){delete _0xb3dbd7['body']['id'];}if(_[_0xd17c('0x71')](_0xb3dbd7[_0xd17c('0x4d')]['from'])){throw new db['Sequelize']['ValidationError'](_0xd17c('0x8a'));}if(_['isNil'](_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x4d')])||_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x4d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd17c('0x71')](_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x8b')])){throw new db['Sequelize'][(_0xd17c('0x83'))](_0xd17c('0x8c')+_0x1c251e);}if(!_[_0xd17c('0x8d')](_0x1c251e,_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x8b')])){throw new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))](_0xd17c('0x8f')+_0x1c251e);}_0x1123d7[_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x8b')]]=_0xb3dbd7['body'][_0xd17c('0x90')];})[_0xd17c('0x13')](function(){return db[_0xd17c('0x34')]['find']({'where':{'id':_0xb3dbd7[_0xd17c('0x4a')]['id']},'include':[{'model':db[_0xd17c('0x91')],'as':_0xd17c('0x92'),'include':[{'model':db[_0xd17c('0x93')],'as':'Contacts','where':_0x1123d7,'limit':0x1,'order':[[_0xd17c('0x87'),_0xd17c('0x94')]]}]},{'model':db[_0xd17c('0x95')],'as':'Applications'}]});})[_0xd17c('0x13')](handleEntityNotFound(_0x403575,null))[_0xd17c('0x13')](function(_0x4fbe2c){if(_0x4fbe2c&&_0x4fbe2c[_0xd17c('0x92')]){_0x5c106c[_0xd17c('0x96')]=_0x4fbe2c;_0x5c106c[_0xd17c('0x97')]=_0x4fbe2c[_0xd17c('0x98')];_0x5c106c[_0xd17c('0x99')]=_0x4fbe2c[_0xd17c('0x92')];_0x5c106c[_0xd17c('0x97')]=_['orderBy'](_0x5c106c[_0xd17c('0x97')],[_0xd17c('0x9a')],[_0xd17c('0x9b')]);if(_0x5c106c[_0xd17c('0x96')][_0xd17c('0x98')]){delete _0x5c106c[_0xd17c('0x96')]['Applications'];}if(_0x5c106c[_0xd17c('0x96')][_0xd17c('0x92')]&&_0x5c106c[_0xd17c('0x96')][_0xd17c('0x92')][_0xd17c('0x9c')][_0xd17c('0x3e')]){return _0x5c106c[_0xd17c('0x96')][_0xd17c('0x92')][_0xd17c('0x9c')][0x0];}var _0x3b0726=_[_0xd17c('0xc')](_0xb3dbd7['body'],{'firstName':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x90')],'ListId':_0x4fbe2c[_0xd17c('0x89')]});_0x3b0726[_0xb3dbd7[_0xd17c('0x4d')]['mapKey']]=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x90')];return db['CmContact'][_0xd17c('0x53')](_0x3b0726,{'fields':_0x717316,'raw':!![]});}})[_0xd17c('0x13')](handleEntityNotFound(_0x403575,null))[_0xd17c('0x13')](function(_0x55dc63){_0x5c106c[_0xd17c('0x9d')]=_0x55dc63;var _0x1d62d3=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x9e')];if(_0xb3dbd7['headers'][_0xd17c('0x9f')]){_0x1d62d3=_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0x9f')];}else if(_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa0')]){_0x1d62d3=_[_0xd17c('0xa1')](_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa0')][_0xd17c('0xa2')](','));}if(_0x55dc63){var _0x31f137={'ContactId':_0x55dc63['id'],'ChatWebsiteId':_0xb3dbd7[_0xd17c('0x4a')]['id'],'from':(_0x55dc63[_0xd17c('0xa3')]||'')+'\x20'+(_0x55dc63[_0xd17c('0xa4')]||''),'customerIp':_0x1d62d3,'customerPort':_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa5')]?_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa5')]:null,'referer':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xa6')],'browserName':_0x1625ba[_0xd17c('0xa7')][_0xd17c('0x2e')]&&_0x1625ba[_0xd17c('0xa7')][_0xd17c('0xa8')]?util[_0xd17c('0xa9')](_0xd17c('0xaa'),_0x1625ba[_0xd17c('0xa7')][_0xd17c('0x2e')],_0x1625ba['browser'][_0xd17c('0xa8')]):'unknown','browserVersion':_0x1625ba[_0xd17c('0xa7')][_0xd17c('0xa8')]||_0xd17c('0xab'),'osName':util[_0xd17c('0xa9')](_0xd17c('0xaa'),_0x1625ba['os'][_0xd17c('0x2e')],_0x1625ba['os'][_0xd17c('0xa8')]),'osVersion':_0x1625ba['os'][_0xd17c('0xa8')],'deviceModel':_0x1625ba[_0xd17c('0xac')][_0xd17c('0x38')]&&_0x1625ba['device'][_0xd17c('0xad')]?util[_0xd17c('0xa9')](_0xd17c('0xae'),_0x1625ba['device']['model'],_0x1625ba[_0xd17c('0xac')]['vendor'],_0x1625ba[_0xd17c('0xac')]['type']):null,'deviceVendor':_0x1625ba[_0xd17c('0xac')]['vendor'],'deviceType':_0x1625ba[_0xd17c('0xac')]['type'],'formData':JSON[_0xd17c('0x18')](_0xb3dbd7[_0xd17c('0x4d')])};var _0x2e3b54={'ChatWebsiteId':_0xb3dbd7['params']['id'],'closed':![]};if(_0xb3dbd7['body'][_0xd17c('0xaf')]){_0x2e3b54[_0xd17c('0xaf')]=_0xb3dbd7['body']['threadId'];return db[_0xd17c('0xb0')]['find']({'where':_0x2e3b54})[_0xd17c('0x13')](function(_0x1b27e7){if(_0x1b27e7){return[_0x1b27e7,![]];}_0x31f137[_0xd17c('0xaf')]=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xaf')];_0x31f137[_0xd17c('0xb1')]=_0xb3dbd7['body'][_0xd17c('0xb1')];return db[_0xd17c('0xb0')][_0xd17c('0x53')](_0x31f137)[_0xd17c('0x13')](function(_0xccf14e){return[_0xccf14e,!![]];});});}_0x2e3b54['ContactId']=_0x55dc63['id'];if(_0xb3dbd7['body'][_0xd17c('0xb2')]&&_0xb3dbd7['body'][_0xd17c('0xb2')]['id']){_0x2e3b54['id']=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xb2')]['id'];return db[_0xd17c('0xb0')][_0xd17c('0x4c')]({'where':_0x2e3b54})[_0xd17c('0x13')](function(_0x6bbc0a){if(_0x6bbc0a){return[_0x6bbc0a,![]];}return db[_0xd17c('0xb0')][_0xd17c('0x53')](_0x31f137)[_0xd17c('0x13')](function(_0x276299){return[_0x276299,!![]];});});}return db[_0xd17c('0xb0')][_0xd17c('0x53')](_0x31f137)['then'](function(_0x49039e){return[_0x49039e,!![]];});}})[_0xd17c('0xb3')](function(_0x559704,_0x321b17){if(_0x559704){_0x2664a1=_0x321b17;if(!_0x321b17){var _0x14b476={'from':(_0x5c106c[_0xd17c('0x9d')]['firstName']||'')+'\x20'+(_0x5c106c[_0xd17c('0x9d')][_0xd17c('0xa4')]||'')};if(_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xaf')]&&_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xb4')]&&_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xaf')]!=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xb4')]){_0x14b476[_0xd17c('0xaf')]=_0xb3dbd7['body'][_0xd17c('0xb4')];}return _0x559704['update'](_0x14b476);}else{return _0x559704;}}})['then'](function(_0x1143ba){_0x5c106c[_0xd17c('0xb2')]=_0x1143ba[_0xd17c('0x2b')]({'plain':!![]});_0x5c106c[_0xd17c('0xb2')][_0xd17c('0xb5')]=_0x2664a1;if(_0x5c106c[_0xd17c('0xb2')][_0xd17c('0xb5')]){if(_0x5c106c[_0xd17c('0x96')][_0xd17c('0xb6')]){_0x5c106c['applications'][_0xd17c('0xb7')]({'id':0x0,'priority':_0x5c106c[_0xd17c('0x97')][_0xd17c('0x3e')]+0x1,'app':_0xd17c('0xb8'),'appdata':_0xd17c('0xb9'),'interval':_0xd17c('0xba')});}}return db[_0xd17c('0xbb')][_0xd17c('0x53')]({'body':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x4d')],'ChatWebsiteId':_0xb3dbd7[_0xd17c('0x4a')]['id'],'ChatInteractionId':_0x1143ba['id'],'direction':'in','ContactId':_0x5c106c[_0xd17c('0x9d')]['id'],'AttachmentId':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xbc')]});})[_0xd17c('0x13')](function(_0x325824){_0x5c106c[_0xd17c('0x1b')]=_0x325824;if(_0x5c106c[_0xd17c('0xb2')][_0xd17c('0xbd')]){return db[_0xd17c('0xbe')][_0xd17c('0x4c')]({'attributes':['id',_0xd17c('0x2e')],'where':{'id':_0x5c106c['interaction'][_0xd17c('0xbd')]}})['then'](function(_0x53587d){if(_0x53587d){_0x5c106c[_0xd17c('0x97')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd17c('0xbf'),'appdata':_0x53587d[_0xd17c('0x2e')]+','+(_0x5c106c[_0xd17c('0x96')][_0xd17c('0xc0')]||0xa),'interval':_0xd17c('0xba')});_0x5c106c['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xd17c('0xc1'),_0x5c106c);});}return respondWithRpcPromise(_0xd17c('0xc2'),_0xd17c('0xc1'),_0x5c106c);})[_0xd17c('0x13')](function(_0x4c5d23){respondWithRpcPromise(_0xd17c('0xc3'),_0xd17c('0xc3'),{'event':_0xd17c('0x7e'),'message':_0x4c5d23},client9002);return _0x4c5d23;})[_0xd17c('0x13')](respondWithResult(_0x403575,null))[_0xd17c('0x1e')](handleError(_0x403575,null));};exports[_0xd17c('0xc4')]=function(_0x54f92a,_0x594048){var _0x21ed6a,_0x35c8fa,_0x3433dd;var _0x521368=[];var _0x4bcb4b={};var _0x350d3a=_0x54f92a[_0xd17c('0xc5')]||[];var _0x3f2cb8=[];var _0x1e5967;return db[_0xd17c('0x93')][_0xd17c('0x55')]()[_0xd17c('0x13')](function(_0x309afd){if(!_0x309afd){throw new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))]('no\x20available\x20attributes');}_0x521368=_['difference'](_[_0xd17c('0x3a')](_0x309afd),[_0xd17c('0x86'),_0xd17c('0x87'),_0xd17c('0x88'),_0xd17c('0x89')]);if(_0x54f92a[_0xd17c('0x4d')]['id']){delete _0x54f92a['body']['id'];}if(_[_0xd17c('0x71')](_0x54f92a[_0xd17c('0x4d')]['from'])){throw _0x594048[_0xd17c('0x21')](0x1f4)['send'](new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))](_0xd17c('0x8a')));}if(_[_0xd17c('0x71')](_0x54f92a[_0xd17c('0x4d')]['body'])||_0x54f92a[_0xd17c('0x4d')][_0xd17c('0x4d')]===''){throw _0x594048[_0xd17c('0x21')](0x1f4)[_0xd17c('0x2f')](new db['Sequelize']['ValidationError'](_0xd17c('0xc6')));}if(_['isNil'](_0x54f92a[_0xd17c('0x4d')][_0xd17c('0xc7')])){throw _0x594048[_0xd17c('0x21')](0x1f4)[_0xd17c('0x2f')](new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x521368));}if(!_['includes'](_0x521368,_0x54f92a['body'][_0xd17c('0xc7')])){throw _0x594048[_0xd17c('0x21')](0x1f4)[_0xd17c('0x2f')](new db[(_0xd17c('0x8e'))]['ValidationError'](_0xd17c('0xc8')+_0x521368));}_0x4bcb4b[_0x54f92a[_0xd17c('0x4d')][_0xd17c('0xc7')]]=_0x54f92a[_0xd17c('0x4d')][_0xd17c('0x90')];})[_0xd17c('0x13')](function(){return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x54f92a[_0xd17c('0x4a')]['id']},'include':[{'model':db[_0xd17c('0x91')],'as':_0xd17c('0x92')},{'model':db[_0xd17c('0xc9')],'as':_0xd17c('0xc9')}]});})[_0xd17c('0x13')](handleEntityNotFound(_0x594048,null))[_0xd17c('0x13')](function(_0x4015e1){if(_0x4015e1&&_0x4015e1[_0xd17c('0x92')]){_0x35c8fa=_0x4015e1;var _0x16484c=_['defaults'](_0x54f92a['body'],{'firstName':_0x54f92a[_0xd17c('0x4d')]['from'],'phone':_0x54f92a[_0xd17c('0x4d')][_0xd17c('0x90')],'ListId':_0x4015e1[_0xd17c('0x89')]});_0x16484c[_0x54f92a[_0xd17c('0x4d')][_0xd17c('0xc7')]]=_0x54f92a['body']['from'];return db[_0xd17c('0x93')][_0xd17c('0xca')]({'where':_0x4bcb4b,'defaults':_0x16484c});}})[_0xd17c('0xb3')](function(_0x44bf05){if(_0x44bf05){_0x3433dd=_0x44bf05;var _0x50017f=fs[_0xd17c('0xcb')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0xcc')),_0xd17c('0xcd'));var _0x39a34b=ejs[_0xd17c('0xce')](_0x50017f,{'body':_[_0xd17c('0xcf')](_0x54f92a[_0xd17c('0x4d')]['body']),'bodyTitle':_0x35c8fa[_0xd17c('0xd0')]});return db[_0xd17c('0xd1')][_0xd17c('0x53')]({'body':_0x39a34b,'plainBody':htmlToText[_0xd17c('0xd2')](_0x39a34b),'ContactId':_0x44bf05['id'],'ChatWebsiteId':_0x35c8fa['id']});}})[_0xd17c('0x13')](function(_0x4fbb60){_0x1e5967=_0x4fbb60;if(_0x350d3a[_0xd17c('0x3e')]){var _0x52d0d5=_0x350d3a[_0xd17c('0x33')](function(_0x42bdf3){return{'name':_0x42bdf3[_0xd17c('0xd3')],'basename':_0x42bdf3[_0xd17c('0x66')],'type':_0x42bdf3[_0xd17c('0xd4')],'ChatOfflineMessageId':_0x4fbb60['id']};});_0x3f2cb8=_0x52d0d5[_0xd17c('0x33')](_0x478072=>{var _0x3e3a06={'filename':_0x478072[_0xd17c('0x2e')],'path':path['join'](config['root'],_0xd17c('0xd5'),_0xd17c('0xc5'),_0xd17c('0xd6'),_0xd17c('0xd7'),_0x478072[_0xd17c('0xd8')])};return _0x3e3a06;});if(!_0x35c8fa['openNewInteraction']){return db[_0xd17c('0xd9')][_0xd17c('0xda')](function(_0x7c0cb){return db['Attachment'][_0xd17c('0xdb')](_0x52d0d5,{'transaction':_0x7c0cb});});}}})[_0xd17c('0x13')](function(){if(_0x1e5967){_0x21ed6a=_0x1e5967;return db[_0xd17c('0xc9')][_0xd17c('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0xd17c('0xdc')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x37b5db){if(_0x37b5db&&_0x37b5db[_0xd17c('0xdd')]&&_0x35c8fa['forwardOffline']&&_0x35c8fa[_0xd17c('0xde')]){var _0x4c367b=_0x37b5db['getSmtpOptions']();return respondWithRpcPromise(_0xd17c('0xdf'),_0xd17c('0xe0'),{'account':_0x4c367b,'message':{'from':util[_0xd17c('0xa9')](_0xd17c('0xe1'),_0x37b5db['name'],_0x37b5db[_0xd17c('0xe2')]||_0x37b5db[_0xd17c('0xdd')]['user']),'to':_0x35c8fa[_0xd17c('0xde')],'subject':_0x35c8fa[_0xd17c('0xe3')],'html':_0x21ed6a[_0xd17c('0x4d')],'attachments':_0x3f2cb8}},client9003)[_0xd17c('0x13')](function(){return _0x21ed6a;})['catch'](function(_0x1ad7b8){logger['error'](_0x1ad7b8);});}})[_0xd17c('0x13')](function(){if(_0x35c8fa&&_0x35c8fa['openNewInteraction']&&_0x35c8fa[_0xd17c('0xe4')]){var _0x4fcee5=[];if(_0x350d3a[_0xd17c('0x3e')]){_0x4fcee5=_0x350d3a[_0xd17c('0x33')](function(_0x3dac57){return{'name':_0x3dac57[_0xd17c('0xd3')],'basename':_0x3dac57[_0xd17c('0x66')],'type':_0x3dac57[_0xd17c('0xd4')],'ChatOfflineMessageId':_0x1e5967['id']};});}var _0x52bfe3;if(!_[_0xd17c('0x71')](_0x35c8fa[_0xd17c('0xe5')])){var _0x286691=_[_0xd17c('0x33')](_0x54f92a[_0xd17c('0x4d')],function(_0x400ea0){return _0x400ea0;});var _0x26ba94=_[_0xd17c('0xe6')](_0x286691)[0x0];var _0x36c6e4=_[_0xd17c('0xe7')](_0x26ba94,function(_0x4c3e0c){return _0x4c3e0c;});_0x52bfe3=_0x36c6e4[0x1][_0x35c8fa[_0xd17c('0xe5')]];}var _0x3a655e={'from':_0x3433dd['email'],'firstName':_0x3433dd[_0xd17c('0xa3')],'lastName':_0x3433dd[_0xd17c('0xa4')],'mapKey':_0xd17c('0xe2'),'message':{'from':_0x3433dd[_0xd17c('0xe2')],'to':_0x35c8fa['MailAccount'][_0xd17c('0xe2')],'cc':'','subject':_[_0xd17c('0x71')](_0x52bfe3)?_0x35c8fa[_0xd17c('0xe3')]:_0x52bfe3,'messageId':'','sentAt':new Date(),'attach':_0x4fcee5[_0xd17c('0x3e')],'attachments':_0x4fcee5,'originChannel':'Chat','ChatWebsiteId':_0x35c8fa['id'],'ChatOfflineMessageId':_0x21ed6a['id'],'originTo':_0x35c8fa[_0xd17c('0xc9')][_0xd17c('0xe2')]},'body':_0x21ed6a['body']};var _0x5a9611={'account':{'id':_0x35c8fa[_0xd17c('0xe4')]},'body':_0x3a655e,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xd17c('0xe8'),_0xd17c('0xe9'),_0x5a9611,client9001)[_0xd17c('0x13')](function(){return _0x21ed6a;})[_0xd17c('0x1e')](function(_0x378052){logger[_0xd17c('0x19')](_0x378052);});}return;})[_0xd17c('0x13')](function(){if(_0x21ed6a){return _0x21ed6a;}})[_0xd17c('0x13')](respondWithResult(_0x594048,null))[_0xd17c('0x1e')](function(_0x31dfb4){logger[_0xd17c('0x19')](_0xd17c('0x1e'),_0x31dfb4);for(var _0x39346e of _0x350d3a){var _0xfc85e0=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0xd5'),_0xd17c('0xc5'),'attachments','offline-chat',_0x39346e['filename']);fs_extra[_0xd17c('0xea')](_0xfc85e0)[_0xd17c('0x1e')](function(_0x1c91e7){logger[_0xd17c('0x19')](_0xd17c('0xeb'),_0xfc85e0,_0x1c91e7);});}});};exports[_0xd17c('0xec')]=function(_0x1fafb7,_0x27b3ec){return db[_0xd17c('0xb0')][_0xd17c('0x4c')]({'where':{'id':_0x1fafb7[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x27b3ec,null))[_0xd17c('0x13')](function(_0x2a32cd){if(_0x2a32cd){return _0x2a32cd[_0xd17c('0xec')](_0x1fafb7['body'][_0xd17c('0x63')],_[_0xd17c('0xed')](_0x1fafb7[_0xd17c('0x4d')],[_0xd17c('0x63'),'id'])||{});}})['then'](respondWithResult(_0x27b3ec,null))['catch'](handleError(_0x27b3ec,null));};exports[_0xd17c('0xee')]=function(_0x32d8f1,_0x141cad){var _0x183e53={'raw':![],'where':{}};var _0x226e84={};var _0x76e181={'count':0x0,'rows':[]};return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0x32d8f1[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x141cad,null))[_0xd17c('0x13')](function(_0x50566b){if(_0x50566b){_0x226e84['model']=_[_0xd17c('0x3a')](db[_0xd17c('0xb0')][_0xd17c('0x35')]);_0x226e84[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x32d8f1[_0xd17c('0x39')]);_0x226e84[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x226e84['model'],_0x226e84['query']);_0x183e53[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x226e84[_0xd17c('0x38')],qs['fields'](_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x183e53[_0xd17c('0x3c')]=_0x183e53[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x183e53[_0xd17c('0x3c')]:_0x226e84[_0xd17c('0x38')];if(!_0x32d8f1['query'][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x183e53[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0x32d8f1[_0xd17c('0x39')]['limit']);_0x183e53['offset']=qs[_0xd17c('0x22')](_0x32d8f1['query']['offset']);}_0x183e53[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x32d8f1[_0xd17c('0x39')]['sort']);_0x183e53[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_['pick'](_0x32d8f1[_0xd17c('0x39')],_0x226e84[_0xd17c('0x44')]));_0x183e53[_0xd17c('0x43')][_0xd17c('0x57')]=_0x50566b['id'];if(_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x45')]){_0x183e53[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x183e53[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x183e53[_0xd17c('0x3c')],function(_0x22b3be){var _0x5ee1d4={};_0x5ee1d4[_0x22b3be]={'$like':'%'+_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x5ee1d4;})});}_0x183e53=_[_0xd17c('0x46')]({},_0x183e53,_0x32d8f1[_0xd17c('0x48')]);return db[_0xd17c('0xb0')][_0xd17c('0x25')]({'where':_0x183e53[_0xd17c('0x43')]})[_0xd17c('0x13')](function(_0x5104c5){_0x76e181['count']=_0x5104c5;if(_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x49')]){_0x183e53['include']=[{'model':db['CmContact'],'as':_0xd17c('0xef'),'required':![]},{'model':db[_0xd17c('0xbe')],'as':_0xd17c('0xf0'),'attributes':[_0xd17c('0x2e'),_0xd17c('0xf1'),_0xd17c('0xf2')],'required':![]},{'model':db['Tag'],'as':_0xd17c('0xf3'),'attributes':['id',_0xd17c('0x2e'),_0xd17c('0xf4')],'where':_0x32d8f1[_0xd17c('0x39')]['tag']?{'id':_0x32d8f1[_0xd17c('0x39')]['tag']}:undefined,'required':_0x32d8f1[_0xd17c('0x39')][_0xd17c('0xf5')]?!![]:![]}];}return db['ChatInteraction'][_0xd17c('0x5b')](_0x183e53);})['then'](function(_0x2241ce){_0x76e181[_0xd17c('0x5c')]=_0x2241ce;return _0x76e181;});}})[_0xd17c('0x13')](respondWithFilteredResult(_0x141cad,_0x183e53))['catch'](handleError(_0x141cad,null));};function iftimePromise(_0x3c5d61,_0x1293de){return respondWithRpcPromise('Command',_0xd17c('0xf6'),{'command':_0x1293de['timezone']?util[_0xd17c('0xa9')](_0xd17c('0xf7'),_0x3c5d61[_0xd17c('0xf8')],_0x1293de[_0xd17c('0xf9')]):util[_0xd17c('0xa9')]('iftime\x20%s',_0x3c5d61[_0xd17c('0xf8')])},client9002)[_0xd17c('0x13')](function(_0x254f4f){var _0x4323c6=_0x254f4f&&_0x254f4f[_0xd17c('0xfa')](_0xd17c('0xfb'))>=0x0?!![]:![];logger['info'](_0xd17c('0xfc'),_0x1293de['id'],_0x3c5d61['id'],_0x3c5d61[_0xd17c('0xf8')],_0x4323c6?_0xd17c('0xfd'):_0xd17c('0xfe'),_0x1293de['timezone']?_0x1293de[_0xd17c('0xf9')]:_0xd17c('0xff'));return _0x4323c6;})[_0xd17c('0x1e')](function(_0x4b7605){logger['error'](_0xd17c('0xfc'),_0x1293de['id'],_0x3c5d61['id'],_0x3c5d61[_0xd17c('0xf8')],util[_0xd17c('0x100')](_0x4b7605,{'showHidden':![],'depth':null}),_0x1293de[_0xd17c('0xf9')]?_0x1293de[_0xd17c('0xf9')]:_0xd17c('0xff'));return![];});}exports['getSnippet']=function(_0x121356,_0x4d690a){var _0x31d7f8=0x0;var _0x33eae5=0x0;var _0x5b40eb=![];var _0x45d06e;var _0x2e2a4a;return db['ChatWebsite'][_0xd17c('0x4c')]({'where':{'id':_0x121356[_0xd17c('0x4a')]['id']},'include':[{'model':db[_0xd17c('0x101')],'as':_0xd17c('0x101'),'include':[{'model':db[_0xd17c('0x101')],'as':_0xd17c('0x102'),'attributes':['id',_0xd17c('0xf8')],'raw':!![]}]}]})[_0xd17c('0x13')](handleEntityNotFound(_0x4d690a,null))['then'](function(_0x14562d){if(_0x14562d){_0x45d06e=_0x14562d;return _0x14562d['getProactiveActions']({'raw':!![]});}})[_0xd17c('0x13')](function(_0x162868){if(_0x45d06e){if(_0x162868){_0x2e2a4a=_0x162868;}}return require(_0xd17c('0x6e'))[_0xd17c('0x6f')]();})['then'](function(_0x27dc69){if(_0x27dc69){_0x33eae5=_0x27dc69[_0xd17c('0x103')];_0x5b40eb=_0x27dc69[_0xd17c('0x70')];}})['then'](function(){return db[_0xd17c('0xb0')][_0xd17c('0x25')]({'where':{'closed':![]}});})[_0xd17c('0x13')](function(_0x51c32a){_0x31d7f8=_0x51c32a;if(_0x33eae5&&_0x51c32a>_0x33eae5){return db[_0xd17c('0x104')]['findOne']({'where':{'id':0x1}})['then'](function(_0x2fa77f){if(_0x2fa77f){_0x2fa77f['increment'](_0xd17c('0x105'));}});}})['then'](function(){if(_0x45d06e[_0xd17c('0x101')]&&_0x45d06e[_0xd17c('0x101')][_0xd17c('0x102')]){var _0x3cc24a=[];for(var _0x200e95=0x0;_0x200e95<_0x45d06e['Interval'][_0xd17c('0x102')][_0xd17c('0x3e')];_0x200e95++){var _0xa13a9d=_0x45d06e[_0xd17c('0x101')]['Intervals'][_0x200e95][_0xd17c('0x2b')]({'plain':!![]});_0x3cc24a[_0xd17c('0xb7')](iftimePromise(_0xa13a9d,_0x45d06e));}return BPromise['all'](_0x3cc24a)['then'](function(_0x16c690){return _[_0xd17c('0x106')](_0x16c690);});}else{return!![];}})[_0xd17c('0x13')](function(_0x50e844){var _0x371ccc=fs[_0xd17c('0xcb')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x107')),'utf8');var _0x41c27a={'remote':_0x45d06e[_0xd17c('0x108')],'query':querystring[_0xd17c('0x18')](_[_0xd17c('0x46')](_0x45d06e[_0xd17c('0x2b')]({'plain':!![]}),{'customerIp':_0x121356[_0xd17c('0x80')][_0xd17c('0xa0')]||_0x121356['headers']['x-real-ip']||_0x121356[_0xd17c('0x109')][_0xd17c('0x10a')]||_0x121356['ip'],'referer':_0x121356[_0xd17c('0x80')][_0xd17c('0xa6')],'openedInteractions':_0x31d7f8,'maxInteractions':_0x33eae5,'virtual':_0x5b40eb[_0xd17c('0x103')],'online':_0x50e844,'custom':_0x5b40eb}))['replace'](/'/g,'\x5c\x27')};_0x4d690a['send'](ejs[_0xd17c('0xce')](Mustache['render'](_0x371ccc,_0x41c27a),{'proactiveActions':_0x2e2a4a,'alignment':_0x45d06e[_0xd17c('0x10b')],'verticalAlignment':_0x45d06e[_0xd17c('0x10c')],'div_color':_0x45d06e[_0xd17c('0xf4')],'labelText':_0x45d06e[_0xd17c('0x10d')],'text_color':_0x45d06e[_0xd17c('0x10e')],'text_button_color':_0x45d06e[_0xd17c('0x10f')],'button_color':_0x45d06e[_0xd17c('0x110')],'background_color':_0x45d06e['backgroundColor'],'hideWhenOffline':_0x45d06e[_0xd17c('0x111')],'interval':_0x45d06e[_0xd17c('0x112')]}));})[_0xd17c('0x1e')](handleError(_0x4d690a,null));};exports[_0xd17c('0x113')]=function(_0x3ba4ec,_0x4367c9){var _0x2d939e=_0x3ba4ec[_0xd17c('0x4a')]['id'];var _0x1a1217=_0x3ba4ec[_0xd17c('0x4d')];var _0x13cbcb=0xc8;var _0x4dc3c4=null;return db[_0xd17c('0xd9')][_0xd17c('0xda')]({'isolationLevel':db['sequelize'][_0xd17c('0x114')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5563f0){return db[_0xd17c('0x34')]['findOne']({'where':{'id':_0x2d939e},'transaction':_0x5563f0})[_0xd17c('0x13')](function(_0x1027aa){if(_0x1027aa){return db[_0xd17c('0x95')][_0xd17c('0x2a')]({'where':{'ChatWebsiteId':_0x2d939e},'transaction':_0x5563f0})['then'](function(){var _0x5d89d1=_['map'](_0x1a1217,function(_0x30a8ef){_0x30a8ef[_0xd17c('0x57')]=_0x2d939e;return _0x30a8ef;});return db[_0xd17c('0x95')][_0xd17c('0xdb')](_0x5d89d1,{'transaction':_0x5563f0});});}else{_0x13cbcb=0x194;_0x4dc3c4=[];}});})['then'](function(){if(_0x13cbcb!==0x194){return db[_0xd17c('0x95')][_0xd17c('0x115')]({'where':{'ChatWebsiteId':_0x2d939e},'order':_0xd17c('0x9a')})[_0xd17c('0x13')](function(_0x242603){_0x4dc3c4=_0x242603;});}})[_0xd17c('0x1e')](function(_0x4dc52a){_0x13cbcb=0x1f4;logger[_0xd17c('0x19')](_0x4dc52a[_0xd17c('0x2d')]);if(_0x4dc52a[_0xd17c('0x2e')]){delete _0x4dc52a['name'];}_0x4dc3c4=_0x4dc52a;})[_0xd17c('0x116')](function(){if(_0x4dc3c4===null){_0x4367c9['sendStatus'](_0x13cbcb);}else{if(_0x13cbcb===0x1f4){_0x4367c9[_0xd17c('0x21')](_0x13cbcb)[_0xd17c('0x2f')](_0x4dc3c4);}else{_0x4367c9[_0xd17c('0x21')](_0x13cbcb)['json'](_0x4dc3c4);}}});};exports[_0xd17c('0x117')]=function(_0x144eec,_0x44c546){var _0x4f3ce1={};var _0x2b63a1={};var _0xae2b9a;var _0x4dbbde;return db[_0xd17c('0x34')]['findOne']({'where':{'id':_0x144eec['params']['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x44c546,null))[_0xd17c('0x13')](function(_0x2c166d){if(_0x2c166d){_0xae2b9a=_0x2c166d;_0x2b63a1[_0xd17c('0x38')]=_[_0xd17c('0x3a')](db['ChatApplication'][_0xd17c('0x35')]);_0x2b63a1['query']=_[_0xd17c('0x3a')](_0x144eec[_0xd17c('0x39')]);_0x2b63a1[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x2b63a1['model'],_0x2b63a1['query']);_0x4f3ce1[_0xd17c('0x3c')]=_['intersection'](_0x2b63a1[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x4f3ce1[_0xd17c('0x3c')]=_0x4f3ce1[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x4f3ce1[_0xd17c('0x3c')]:_0x2b63a1[_0xd17c('0x38')];_0x4f3ce1[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x42')]);_0x4f3ce1['where']=qs['filters'](_[_0xd17c('0x5a')](_0x144eec['query'],_0x2b63a1[_0xd17c('0x44')]));if(_0x144eec['query'][_0xd17c('0x45')]){_0x4f3ce1[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x4f3ce1[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x4f3ce1[_0xd17c('0x3c')],function(_0x2f0d91){var _0x3eb794={};_0x3eb794[_0x2f0d91]={'$like':'%'+_0x144eec[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x3eb794;})});}_0x4f3ce1=_['merge']({},_0x4f3ce1,_0x144eec[_0xd17c('0x48')]);return _0xae2b9a[_0xd17c('0x117')](_0x4f3ce1);}})['then'](function(_0x539afd){if(_0x539afd){_0x4dbbde=_0x539afd[_0xd17c('0x3e')];if(!_0x144eec[_0xd17c('0x39')]['hasOwnProperty'](_0xd17c('0x40'))){_0x4f3ce1['limit']=qs[_0xd17c('0x24')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x24')]);_0x4f3ce1[_0xd17c('0x22')]=qs[_0xd17c('0x22')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x22')]);}return _0xae2b9a[_0xd17c('0x117')](_0x4f3ce1);}})[_0xd17c('0x13')](function(_0x5d6cfe){if(_0x5d6cfe){return _0x5d6cfe?{'count':_0x4dbbde,'rows':_0x5d6cfe}:null;}})[_0xd17c('0x13')](respondWithResult(_0x44c546,null))['catch'](handleError(_0x44c546,null));};exports['addProactiveActions']=function(_0x444b9f,_0x22c09c){return db['chatProactiveAction'][_0xd17c('0x4c')]({'where':{'id':_0x444b9f[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22c09c,null))[_0xd17c('0x13')](function(_0x268e6e){if(_0x268e6e){return _0x268e6e[_0xd17c('0x118')](_0x444b9f['body'][_0xd17c('0x63')],_[_0xd17c('0xed')](_0x444b9f[_0xd17c('0x4d')],[_0xd17c('0x63'),'id'])||{});}})[_0xd17c('0x13')](respondWithResult(_0x22c09c,null))[_0xd17c('0x1e')](handleError(_0x22c09c,null));};exports[_0xd17c('0x119')]=function(_0xc10f02,_0x2e6713){var _0x587a19={};var _0x6b6ea9={};var _0xd9aa97;var _0x589507;return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0xc10f02[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e6713,null))[_0xd17c('0x13')](function(_0x55d5ed){if(_0x55d5ed){_0xd9aa97=_0x55d5ed;_0x6b6ea9['model']=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x6b6ea9['query']=_[_0xd17c('0x3a')](_0xc10f02[_0xd17c('0x39')]);_0x6b6ea9[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x6b6ea9[_0xd17c('0x38')],_0x6b6ea9[_0xd17c('0x39')]);_0x587a19[_0xd17c('0x3c')]=_['intersection'](_0x6b6ea9[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0xc10f02[_0xd17c('0x39')]['fields']));_0x587a19[_0xd17c('0x3c')]=_0x587a19[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x587a19['attributes']:_0x6b6ea9[_0xd17c('0x38')];_0x587a19[_0xd17c('0x41')]=qs['sort'](_0xc10f02[_0xd17c('0x39')]['sort']);_0x587a19['where']=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0xc10f02['query'],_0x6b6ea9['filters']));if(_0xc10f02[_0xd17c('0x39')][_0xd17c('0x45')]){_0x587a19[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x587a19[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x587a19[_0xd17c('0x3c')],function(_0x169497){var _0x345e6c={};_0x345e6c[_0x169497]={'$like':'%'+_0xc10f02[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x345e6c;})});}_0x587a19=_['merge']({},_0x587a19,_0xc10f02[_0xd17c('0x48')]);return _0xd9aa97[_0xd17c('0x119')](_0x587a19);}})['then'](function(_0x58c70a){if(_0x58c70a){_0x589507=_0x58c70a[_0xd17c('0x3e')];if(!_0xc10f02[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x587a19[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0xc10f02[_0xd17c('0x39')][_0xd17c('0x24')]);_0x587a19['offset']=qs[_0xd17c('0x22')](_0xc10f02[_0xd17c('0x39')][_0xd17c('0x22')]);}return _0xd9aa97[_0xd17c('0x119')](_0x587a19);}})[_0xd17c('0x13')](function(_0x2eb49a){if(_0x2eb49a){return _0x2eb49a?{'count':_0x589507,'rows':_0x2eb49a}:null;}})[_0xd17c('0x13')](respondWithResult(_0x2e6713,null))['catch'](handleError(_0x2e6713,null));};exports['getFields']=function(_0x1c74a2,_0x49c779){var _0x31a352=_0x1c74a2[_0xd17c('0x39')][_0xd17c('0x11a')]===_0xd17c('0x11b')?_0xd17c('0x11c'):_0xd17c('0x11d');return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'attributes':['id',_0x31a352],'where':{'id':_0x1c74a2[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x49c779,null))[_0xd17c('0x13')](function(_0x44c536){if(_0x44c536){var _0x284c97=_0x44c536[_0x31a352];var _0x2fea96=_0x284c97&&_0x284c97[_0xd17c('0x11e')]?_0x284c97[_0xd17c('0x11e')]:[];_0x49c779[_0xd17c('0x2f')]({'fromKey':_['isNil'](_0x284c97[_0xd17c('0x11f')])?undefined:_0x284c97[_0xd17c('0x11f')],'count':_0x2fea96[_0xd17c('0x3e')],'rows':_0x2fea96});}})[_0xd17c('0x1e')](handleError(_0x49c779,null));};exports['getOfflineMessages']=function(_0x112917,_0xa6364a){var _0x382e52={'raw':![],'where':{}};var _0x52cff6={};var _0x40a1f2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd17c('0x61')]({'where':{'id':_0x112917[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa6364a,null))[_0xd17c('0x13')](function(_0x2d2037){if(_0x2d2037){_0x52cff6['model']=_[_0xd17c('0x3a')](db['ChatOfflineMessage']['rawAttributes']);_0x52cff6['query']=_[_0xd17c('0x3a')](_0x112917[_0xd17c('0x39')]);_0x52cff6[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x52cff6[_0xd17c('0x38')],_0x52cff6[_0xd17c('0x39')]);_0x382e52[_0xd17c('0x3c')]=_['intersection'](_0x52cff6[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0x112917[_0xd17c('0x39')]['fields']));_0x382e52['attributes']=_0x382e52[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x382e52[_0xd17c('0x3c')]:_0x52cff6[_0xd17c('0x38')];if(!_0x112917[_0xd17c('0x39')]['hasOwnProperty'](_0xd17c('0x40'))){_0x382e52[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0x112917[_0xd17c('0x39')][_0xd17c('0x24')]);_0x382e52['offset']=qs[_0xd17c('0x22')](_0x112917['query'][_0xd17c('0x22')]);}_0x382e52[_0xd17c('0x41')]=qs['sort'](_0x112917['query']['sort']);_0x382e52['where']=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0x112917[_0xd17c('0x39')],_0x52cff6['filters']));_0x382e52[_0xd17c('0x43')]['ChatWebsiteId']=_0x2d2037['id'];if(_0x112917[_0xd17c('0x39')][_0xd17c('0x45')]){_0x382e52[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x382e52[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x382e52[_0xd17c('0x3c')],function(_0x368928){var _0x24bf24={};_0x24bf24[_0x368928]={'$like':'%'+_0x112917[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x24bf24;})});}_0x382e52=_[_0xd17c('0x46')]({},_0x382e52,_0x112917[_0xd17c('0x48')]);return db[_0xd17c('0xd1')][_0xd17c('0x25')]({'where':_0x382e52[_0xd17c('0x43')]})['then'](function(_0xdd721a){_0x40a1f2[_0xd17c('0x25')]=_0xdd721a;if(_0x112917[_0xd17c('0x39')]['includeAll']){_0x382e52[_0xd17c('0x4b')]=[{'all':!![]}];}else{_0x382e52['include']=[{'model':db[_0xd17c('0x93')],'as':'Contact','required':![]},{'model':db[_0xd17c('0x120')],'as':_0xd17c('0x121'),'required':![]}];}return db[_0xd17c('0xd1')][_0xd17c('0x5b')](_0x382e52);})[_0xd17c('0x13')](function(_0x30f76a){_0x40a1f2[_0xd17c('0x5c')]=_0x30f76a;return _0x40a1f2;});}})['then'](respondWithFilteredResult(_0xa6364a,_0x382e52))['catch'](handleError(_0xa6364a,null));};exports[_0xd17c('0x122')]=function(_0x58a0a7,_0x19b008){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x58a0a7[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x19b008,null))[_0xd17c('0x13')](function(_0x2913da){if(_0x2913da){return _0x2913da[_0xd17c('0x122')](_0x58a0a7['body']['ids'],_[_0xd17c('0xed')](_0x58a0a7['body'],[_0xd17c('0x63'),'id'])||{})[_0xd17c('0xb3')](function(_0x278dcd){for(var _0x986f0f=0x0;_0x986f0f<_0x58a0a7[_0xd17c('0x4d')][_0xd17c('0x63')][_0xd17c('0x3e')];_0x986f0f+=0x1){socket[_0xd17c('0x123')](_0xd17c('0x124'),{'UserId':Number(_0x58a0a7['body'][_0xd17c('0x63')][_0x986f0f]),'ChatWebsiteId':Number(_0x58a0a7[_0xd17c('0x4a')]['id'])});}return _0x278dcd;});}})[_0xd17c('0x13')](respondWithResult(_0x19b008,null))['catch'](handleError(_0x19b008,null));};exports['removeAgents']=function(_0x405ef5,_0x3f7301){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x405ef5[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x3f7301,null))[_0xd17c('0x13')](function(_0x4bd7de){if(_0x4bd7de){return _0x4bd7de[_0xd17c('0x125')](_0x405ef5[_0xd17c('0x39')][_0xd17c('0x63')])[_0xd17c('0x13')](function(){if(_[_0xd17c('0x126')](_0x405ef5['query'][_0xd17c('0x63')])){for(var _0xc29225=0x0;_0xc29225<_0x405ef5[_0xd17c('0x39')][_0xd17c('0x63')]['length'];_0xc29225+=0x1){socket[_0xd17c('0x123')](_0xd17c('0x127'),{'UserId':Number(_0x405ef5[_0xd17c('0x39')]['ids'][_0xc29225]),'ChatWebsiteId':Number(_0x405ef5['params']['id'])});}}else{socket[_0xd17c('0x123')](_0xd17c('0x127'),{'UserId':Number(_0x405ef5['query'][_0xd17c('0x63')]),'ChatWebsiteId':Number(_0x405ef5['params']['id'])});}});}})[_0xd17c('0x13')](respondWithStatusCode(_0x3f7301,null))['catch'](handleError(_0x3f7301,null));};exports['getAgents']=function(_0x54f94a,_0x5f0856){var _0x336147={};var _0x460b3c={};var _0x5b05cf;var _0x1dd3e7;return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0x54f94a[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f0856,null))['then'](function(_0x433c35){if(_0x433c35){_0x5b05cf=_0x433c35;_0x460b3c[_0xd17c('0x38')]=_[_0xd17c('0x3a')](db[_0xd17c('0xbe')]['rawAttributes']);_0x460b3c[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x54f94a[_0xd17c('0x39')]);_0x460b3c[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x460b3c[_0xd17c('0x38')],_0x460b3c[_0xd17c('0x39')]);_0x336147[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x460b3c[_0xd17c('0x38')],qs['fields'](_0x54f94a[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x336147[_0xd17c('0x3c')]=_0x336147[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x336147['attributes']:_0x460b3c[_0xd17c('0x38')];_0x336147[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x54f94a[_0xd17c('0x39')][_0xd17c('0x42')]);_0x336147[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_['pick'](_0x54f94a[_0xd17c('0x39')],_0x460b3c['filters']));if(_0x54f94a['query']['filter']){_0x336147[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x336147[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x336147['attributes'],function(_0x4e50a6){var _0x3b60e7={};_0x3b60e7[_0x4e50a6]={'$like':'%'+_0x54f94a[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x3b60e7;})});}_0x336147=_[_0xd17c('0x46')]({},_0x336147,_0x54f94a['options']);return _0x5b05cf[_0xd17c('0x128')](_0x336147);}})[_0xd17c('0x13')](function(_0x25c5e9){if(_0x25c5e9){_0x1dd3e7=_0x25c5e9['length'];if(!_0x54f94a[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x336147[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0x54f94a[_0xd17c('0x39')][_0xd17c('0x24')]);_0x336147['offset']=qs[_0xd17c('0x22')](_0x54f94a['query'][_0xd17c('0x22')]);}return _0x5b05cf[_0xd17c('0x128')](_0x336147);}})[_0xd17c('0x13')](function(_0x4ecfeb){if(_0x4ecfeb){return _0x4ecfeb?{'count':_0x1dd3e7,'rows':_0x4ecfeb}:null;}})[_0xd17c('0x13')](respondWithResult(_0x5f0856,null))[_0xd17c('0x1e')](handleError(_0x5f0856,null));}; \ No newline at end of file +var _0x3d0f=['addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','filename','systemAvatar','join','root','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','account','applications','list','orderBy','asc','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','lastName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','CompanyId','from\x20is\x20mandatory','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','MailAccountId','NotifyMailAccount','server','remove','addInteraction','omit','getInteractions','options','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','priority','getApplications','addProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','destroy','then','get','UserProfileResource','end','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','mandatoryDispositionPause','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','find','update','describe','ChatWebsiteId','Disposition','findOne','rows','ids'];(function(_0x6b5894,_0x4e4acd){var _0x4a43d3=function(_0x4ee905){while(--_0x4ee905){_0x6b5894['push'](_0x6b5894['shift']());}};_0x4a43d3(++_0x4e4acd);}(_0x3d0f,0xc3));var _0xf3d0=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x3d0f[_0x4b174a];return _0x3cd7bf;};'use strict';var BPromise=require(_0xf3d0('0x0'));var Mustache=require(_0xf3d0('0x1'));var util=require('util');var path=require(_0xf3d0('0x2'));var ejs=require(_0xf3d0('0x3'));var fs=require('fs');var fs_extra=require(_0xf3d0('0x4'));var _=require(_0xf3d0('0x5'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0xf3d0('0x6'));var logger=require(_0xf3d0('0x7'))(_0xf3d0('0x8'));var config=require(_0xf3d0('0x9'));var db=require(_0xf3d0('0xa'))['db'];config[_0xf3d0('0xb')]=_[_0xf3d0('0xc')](config[_0xf3d0('0xb')],{'host':_0xf3d0('0xd'),'port':0x18eb});var socket=require(_0xf3d0('0xe'))(new Redis(config[_0xf3d0('0xb')]));require(_0xf3d0('0xf'))[_0xf3d0('0x10')](socket);var htmlToText=require(_0xf3d0('0x11'));var jayson=require(_0xf3d0('0x12'));var client=jayson[_0xf3d0('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xf3d0('0x13')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xf3d0('0x13')][_0xf3d0('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x35ba1a,_0x22aba3,_0x50fc57,_0x41f253){return new BPromise(function(_0x3c229c,_0x3ff20a){var _0x3fc89a=_0x41f253||client;return _0x3fc89a['request'](_0x35ba1a,_0x50fc57)['then'](function(_0x5838e0){logger[_0xf3d0('0x15')](_0xf3d0('0x16'),_0x22aba3,_0xf3d0('0x17'));logger['debug'](_0xf3d0('0x18'),_0x22aba3,'request\x20sent',JSON[_0xf3d0('0x19')](_0x5838e0));if(_0x5838e0[_0xf3d0('0x1a')]){if(_0x5838e0['error'][_0xf3d0('0x1b')]===0x1f4){logger[_0xf3d0('0x1a')](_0xf3d0('0x16'),_0x22aba3,_0x5838e0['error'][_0xf3d0('0x1c')]);return _0x3ff20a(_0x5838e0[_0xf3d0('0x1a')][_0xf3d0('0x1c')]);}logger[_0xf3d0('0x1a')](_0xf3d0('0x16'),_0x22aba3,_0x5838e0['error']['message']);return _0x3c229c(_0x5838e0[_0xf3d0('0x1a')][_0xf3d0('0x1c')]);}else{logger[_0xf3d0('0x15')](_0xf3d0('0x16'),_0x22aba3,_0xf3d0('0x17'));_0x3c229c(_0x5838e0[_0xf3d0('0x1d')][_0xf3d0('0x1c')]);}})[_0xf3d0('0x1e')](function(_0x15e2db){logger[_0xf3d0('0x1a')](_0xf3d0('0x16'),_0x22aba3,_0x15e2db);_0x3ff20a(_0x15e2db);});});}function respondWithStatusCode(_0x4d4b7c,_0x3dbba9){_0x3dbba9=_0x3dbba9||0xcc;return function(_0x31c571){if(_0x31c571){return _0x4d4b7c[_0xf3d0('0x1f')](_0x3dbba9);}return _0x4d4b7c['status'](_0x3dbba9)['end']();};}function respondWithResult(_0x23e3d0,_0x589e0d){_0x589e0d=_0x589e0d||0xc8;return function(_0x3356aa){if(_0x3356aa){return _0x23e3d0['status'](_0x589e0d)[_0xf3d0('0x20')](_0x3356aa);}};}function respondWithFilteredResult(_0x3c5e5e,_0x5e4202){return function(_0x89e938){if(_0x89e938){var _0x5e3a37=typeof _0x5e4202[_0xf3d0('0x21')]==='undefined'&&typeof _0x5e4202[_0xf3d0('0x22')]===_0xf3d0('0x23');var _0x5959a7=_0x89e938['count'];var _0x4d9404=_0x5e3a37?0x0:_0x5e4202[_0xf3d0('0x21')];var _0xc3e71d=_0x5e3a37?_0x89e938[_0xf3d0('0x24')]:_0x5e4202['offset']+_0x5e4202['limit'];var _0x1b4641;if(_0xc3e71d>=_0x5959a7){_0xc3e71d=_0x5959a7;_0x1b4641=0xc8;}else{_0x1b4641=0xce;}_0x3c5e5e[_0xf3d0('0x25')](_0x1b4641);return _0x3c5e5e[_0xf3d0('0x26')](_0xf3d0('0x27'),_0x4d9404+'-'+_0xc3e71d+'/'+_0x5959a7)[_0xf3d0('0x20')](_0x89e938);}return null;};}function saveUpdates(_0x3da878){return function(_0x15f39d){if(_0x15f39d){return _0x15f39d['update'](_0x3da878)['then'](function(_0x1200ec){return _0x1200ec;});}return null;};}function removeEntity(_0x37178f){return function(_0x346f3b){if(_0x346f3b){return _0x346f3b[_0xf3d0('0x28')]()[_0xf3d0('0x29')](function(){var _0xf6bd10=_0x346f3b[_0xf3d0('0x2a')]({'plain':!![]});var _0x3d98b8='ChatWebsites';return db[_0xf3d0('0x2b')][_0xf3d0('0x28')]({'where':{'type':_0x3d98b8,'resourceId':_0xf6bd10['id']}})[_0xf3d0('0x29')](function(){return _0x346f3b;});})[_0xf3d0('0x29')](function(){_0x37178f[_0xf3d0('0x25')](0xcc)[_0xf3d0('0x2c')]();});}};}function handleEntityNotFound(_0x3845de){return function(_0x3cd689){if(!_0x3cd689){_0x3845de[_0xf3d0('0x1f')](0x194);}return _0x3cd689;};}function handleError(_0x2e2377,_0x53eefd){_0x53eefd=_0x53eefd||0x1f4;return function(_0x19a81b){logger['error'](_0x19a81b[_0xf3d0('0x2d')]);if(_0x19a81b[_0xf3d0('0x2e')]){delete _0x19a81b[_0xf3d0('0x2e')];}_0x2e2377['status'](_0x53eefd)[_0xf3d0('0x2f')](_0x19a81b);};}exports[_0xf3d0('0x30')]=function(_0x1fcbf6,_0x1d5c7f){var _0x3cc64e={'include':[{'model':db[_0xf3d0('0x31')],'as':'mandatoryDispositionPause'}]},_0x26c118={},_0x4c8ce3={'count':0x0,'rows':[]};var _0x4b477b=_[_0xf3d0('0x32')](db[_0xf3d0('0x33')][_0xf3d0('0x34')],function(_0x57a10d){return{'name':_0x57a10d[_0xf3d0('0x35')],'type':_0x57a10d[_0xf3d0('0x36')][_0xf3d0('0x37')]};});_0x26c118[_0xf3d0('0x38')]=_[_0xf3d0('0x32')](_0x4b477b,'name');_0x26c118[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x1fcbf6[_0xf3d0('0x39')]);_0x26c118[_0xf3d0('0x3b')]=_['intersection'](_0x26c118[_0xf3d0('0x38')],_0x26c118[_0xf3d0('0x39')]);_0x3cc64e['attributes']=_[_0xf3d0('0x3c')](_0x26c118[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x3d')]));_0x3cc64e[_0xf3d0('0x3e')]=_0x3cc64e[_0xf3d0('0x3e')]['length']?_0x3cc64e['attributes']:_0x26c118[_0xf3d0('0x38')];if(!_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x3cc64e[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x1fcbf6['query'][_0xf3d0('0x22')]);_0x3cc64e[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x1fcbf6['query'][_0xf3d0('0x21')]);}_0x3cc64e[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x3cc64e[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x1fcbf6[_0xf3d0('0x39')],_0x26c118[_0xf3d0('0x3b')]),_0x4b477b);if(_0x1fcbf6['query'][_0xf3d0('0x45')]){_0x3cc64e['where']=_[_0xf3d0('0x46')](_0x3cc64e[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x4b477b,function(_0x57cfbb){if(_0x57cfbb[_0xf3d0('0x36')]!==_0xf3d0('0x47')){var _0x2f4f3b={};_0x2f4f3b[_0x57cfbb[_0xf3d0('0x2e')]]={'$like':'%'+_0x1fcbf6[_0xf3d0('0x39')]['filter']+'%'};return _0x2f4f3b;}})});}_0x3cc64e=_['merge']({},_0x3cc64e,_0x1fcbf6['options']);var _0x28e1d5={'where':_0x3cc64e[_0xf3d0('0x43')]};return db[_0xf3d0('0x33')][_0xf3d0('0x24')](_0x28e1d5)[_0xf3d0('0x29')](function(_0x5ea041){_0x4c8ce3[_0xf3d0('0x24')]=_0x5ea041;if(_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x48')]){_0x3cc64e[_0xf3d0('0x49')]=[{'all':!![]}];}return db[_0xf3d0('0x33')][_0xf3d0('0x4a')](_0x3cc64e);})[_0xf3d0('0x29')](function(_0xc50ecb){_0x4c8ce3['rows']=_0xc50ecb;return _0x4c8ce3;})[_0xf3d0('0x29')](respondWithFilteredResult(_0x1d5c7f,_0x3cc64e))[_0xf3d0('0x1e')](handleError(_0x1d5c7f,null));};exports[_0xf3d0('0x4b')]=function(_0x533b3d,_0x29d25c){var _0x590d0a={'raw':![],'where':{'id':_0x533b3d[_0xf3d0('0x4c')]['id']},'include':[{'model':db[_0xf3d0('0x31')],'as':_0xf3d0('0x4d')}]},_0x436f72={};_0x436f72[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0x33')][_0xf3d0('0x34')]);_0x436f72[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x533b3d['query']);_0x436f72[_0xf3d0('0x3b')]=_['intersection'](_0x436f72['model'],_0x436f72[_0xf3d0('0x39')]);_0x590d0a[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x436f72['model'],qs[_0xf3d0('0x3d')](_0x533b3d['query'][_0xf3d0('0x3d')]));_0x590d0a[_0xf3d0('0x3e')]=_0x590d0a[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x590d0a[_0xf3d0('0x3e')]:_0x436f72[_0xf3d0('0x38')];if(_0x533b3d['query'][_0xf3d0('0x48')]){_0x590d0a[_0xf3d0('0x49')]=[{'all':!![]}];}_0x590d0a=_[_0xf3d0('0x46')]({},_0x590d0a,_0x533b3d['options']);return db[_0xf3d0('0x33')]['find'](_0x590d0a)['then'](handleEntityNotFound(_0x29d25c,null))['then'](respondWithResult(_0x29d25c,null))[_0xf3d0('0x1e')](handleError(_0x29d25c,null));};exports[_0xf3d0('0x4f')]=function(_0x101171,_0x29f776){return db['ChatWebsite'][_0xf3d0('0x4f')](_0x101171[_0xf3d0('0x50')],{})['then'](function(_0xe2d01f){var _0x6b385=_0x101171[_0xf3d0('0x51')][_0xf3d0('0x2a')]({'plain':!![]});if(!_0x6b385)throw new Error(_0xf3d0('0x52'));if(_0x6b385[_0xf3d0('0x53')]===_0xf3d0('0x51')){var _0x442eb5=_0xe2d01f[_0xf3d0('0x2a')]({'plain':!![]});var _0x15269a=_0xf3d0('0x54');return db[_0xf3d0('0x55')][_0xf3d0('0x56')]({'where':{'name':_0x15269a,'userProfileId':_0x6b385['userProfileId']},'raw':!![]})[_0xf3d0('0x29')](function(_0x42fde2){if(_0x42fde2&&_0x42fde2['autoAssociation']===0x0){return db[_0xf3d0('0x2b')][_0xf3d0('0x4f')]({'name':_0x442eb5[_0xf3d0('0x2e')],'resourceId':_0x442eb5['id'],'type':_0x42fde2['name'],'sectionId':_0x42fde2['id']},{})[_0xf3d0('0x29')](function(){return _0xe2d01f;});}else{return _0xe2d01f;}})[_0xf3d0('0x1e')](function(_0x868014){logger[_0xf3d0('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x868014);throw _0x868014;});}return _0xe2d01f;})['then'](respondWithResult(_0x29f776,0xc9))[_0xf3d0('0x1e')](handleError(_0x29f776,null));};exports[_0xf3d0('0x57')]=function(_0x4e191e,_0x5a9e15){if(_0x4e191e[_0xf3d0('0x50')]['id']){delete _0x4e191e['body']['id'];}return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x4e191e['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5a9e15,null))[_0xf3d0('0x29')](saveUpdates(_0x4e191e[_0xf3d0('0x50')],null))['then'](respondWithResult(_0x5a9e15,null))[_0xf3d0('0x1e')](handleError(_0x5a9e15,null));};exports[_0xf3d0('0x28')]=function(_0xb2f89,_0xf8f487){return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0xb2f89[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0xf8f487,null))[_0xf3d0('0x29')](removeEntity(_0xf8f487,null))[_0xf3d0('0x1e')](handleError(_0xf8f487,null));};exports[_0xf3d0('0x58')]=function(_0xbb08eb,_0x318ab0){return db[_0xf3d0('0x33')][_0xf3d0('0x58')]()[_0xf3d0('0x29')](respondWithResult(_0x318ab0,null))['catch'](handleError(_0x318ab0,null));};exports['addDisposition']=function(_0x377d15,_0x52c4e6){if(_0x377d15['body']['id']){delete _0x377d15[_0xf3d0('0x50')]['id'];}return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x377d15[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x52c4e6,null))[_0xf3d0('0x29')](function(_0x26ef9b){if(_0x26ef9b){_0x377d15[_0xf3d0('0x50')][_0xf3d0('0x59')]=_0x26ef9b['id'];return db[_0xf3d0('0x5a')][_0xf3d0('0x4f')](_0x377d15[_0xf3d0('0x50')]);}})['then'](respondWithResult(_0x52c4e6,null))[_0xf3d0('0x1e')](handleError(_0x52c4e6,null));};exports['getDispositions']=function(_0x3133ce,_0x55f95f){var _0x4890f3={'raw':![],'where':{}};var _0x2a63d6={};var _0x42f27c={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x3133ce[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x55f95f,null))[_0xf3d0('0x29')](function(_0x4deb61){if(_0x4deb61){_0x2a63d6['model']=_['keys'](db[_0xf3d0('0x5a')][_0xf3d0('0x34')]);_0x2a63d6[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x3133ce[_0xf3d0('0x39')]);_0x2a63d6[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0x2a63d6[_0xf3d0('0x38')],_0x2a63d6[_0xf3d0('0x39')]);_0x4890f3[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x2a63d6[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x3133ce['query'][_0xf3d0('0x3d')]));_0x4890f3[_0xf3d0('0x3e')]=_0x4890f3[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x4890f3['attributes']:_0x2a63d6['model'];if(!_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x4890f3['limit']=qs['limit'](_0x3133ce['query']['limit']);_0x4890f3['offset']=qs['offset'](_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x21')]);}_0x4890f3[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x4890f3[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x3133ce['query'],_0x2a63d6['filters']));_0x4890f3[_0xf3d0('0x43')][_0xf3d0('0x59')]=_0x4deb61['id'];if(_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x4890f3[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x4890f3[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x4890f3[_0xf3d0('0x3e')],function(_0x19235c){var _0x5a9e3d={};_0x5a9e3d[_0x19235c]={'$like':'%'+_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x5a9e3d;})});}_0x4890f3=_[_0xf3d0('0x46')]({},_0x4890f3,_0x3133ce['options']);return db['Disposition'][_0xf3d0('0x24')]({'where':_0x4890f3['where']})[_0xf3d0('0x29')](function(_0x1cc134){_0x42f27c[_0xf3d0('0x24')]=_0x1cc134;if(_0x3133ce['query']['includeAll']){_0x4890f3[_0xf3d0('0x49')]=[{'all':!![]}];}return db['Disposition'][_0xf3d0('0x4a')](_0x4890f3);})['then'](function(_0x29887c){_0x42f27c[_0xf3d0('0x5c')]=_0x29887c;return _0x42f27c;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x55f95f,_0x4890f3))[_0xf3d0('0x1e')](handleError(_0x55f95f,null));};exports['removeDispositions']=function(_0x3ad1d1,_0x4596e9){return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x3ad1d1[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x4596e9,null))[_0xf3d0('0x29')](function(_0x3e687e){if(_0x3e687e){return _0x3e687e['removeDispositions'](_0x3ad1d1[_0xf3d0('0x39')][_0xf3d0('0x5d')]);}})[_0xf3d0('0x29')](respondWithStatusCode(_0x4596e9,null))[_0xf3d0('0x1e')](handleError(_0x4596e9,null));};exports[_0xf3d0('0x5e')]=function(_0x2ed1b,_0xd731a){if(_0x2ed1b['body']['id']){delete _0x2ed1b[_0xf3d0('0x50')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2ed1b[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0xd731a,null))[_0xf3d0('0x29')](function(_0x5c69c8){if(_0x5c69c8){_0x2ed1b[_0xf3d0('0x50')][_0xf3d0('0x59')]=_0x5c69c8['id'];return db[_0xf3d0('0x5f')][_0xf3d0('0x4f')](_0x2ed1b[_0xf3d0('0x50')]);}})[_0xf3d0('0x29')](respondWithResult(_0xd731a,null))[_0xf3d0('0x1e')](handleError(_0xd731a,null));};exports[_0xf3d0('0x60')]=function(_0x2460f9,_0x5cf23f){var _0x3ec379={'raw':![],'where':{}};var _0x5e9b86={};var _0x2a59ee={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x2460f9['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x5cf23f,null))[_0xf3d0('0x29')](function(_0x3cd0a0){if(_0x3cd0a0){_0x5e9b86[_0xf3d0('0x38')]=_['keys'](db[_0xf3d0('0x5f')][_0xf3d0('0x34')]);_0x5e9b86[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x2460f9[_0xf3d0('0x39')]);_0x5e9b86['filters']=_[_0xf3d0('0x3c')](_0x5e9b86[_0xf3d0('0x38')],_0x5e9b86[_0xf3d0('0x39')]);_0x3ec379[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x5e9b86[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x3d')]));_0x3ec379[_0xf3d0('0x3e')]=_0x3ec379[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x3ec379[_0xf3d0('0x3e')]:_0x5e9b86[_0xf3d0('0x38')];if(!_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x3ec379[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x3ec379[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x21')]);}_0x3ec379[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x3ec379['where']=qs['filters'](_[_0xf3d0('0x44')](_0x2460f9[_0xf3d0('0x39')],_0x5e9b86['filters']));_0x3ec379[_0xf3d0('0x43')][_0xf3d0('0x59')]=_0x3cd0a0['id'];if(_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x3ec379['where']=_[_0xf3d0('0x46')](_0x3ec379[_0xf3d0('0x43')],{'$or':_['map'](_0x3ec379['attributes'],function(_0x5bac08){var _0x937b37={};_0x937b37[_0x5bac08]={'$like':'%'+_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x937b37;})});}_0x3ec379=_['merge']({},_0x3ec379,_0x2460f9['options']);return db[_0xf3d0('0x5f')][_0xf3d0('0x24')]({'where':_0x3ec379[_0xf3d0('0x43')]})[_0xf3d0('0x29')](function(_0x48c0fd){_0x2a59ee[_0xf3d0('0x24')]=_0x48c0fd;if(_0x2460f9['query'][_0xf3d0('0x48')]){_0x3ec379[_0xf3d0('0x49')]=[{'all':!![]}];}return db[_0xf3d0('0x5f')][_0xf3d0('0x4a')](_0x3ec379);})[_0xf3d0('0x29')](function(_0xe7f697){_0x2a59ee[_0xf3d0('0x5c')]=_0xe7f697;return _0x2a59ee;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x5cf23f,_0x3ec379))['catch'](handleError(_0x5cf23f,null));};exports[_0xf3d0('0x61')]=function(_0x3bf4ab,_0x469b5e){return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x3bf4ab[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x469b5e,null))['then'](function(_0xc80b71){if(_0xc80b71){return _0xc80b71[_0xf3d0('0x61')](_0x3bf4ab[_0xf3d0('0x39')][_0xf3d0('0x5d')]);}})[_0xf3d0('0x29')](respondWithStatusCode(_0x469b5e,null))[_0xf3d0('0x1e')](handleError(_0x469b5e,null));};exports['addLogo']=function(_0x24728f,_0x952a0){_0x24728f[_0xf3d0('0x50')][_0xf3d0('0x62')]=_0x24728f['file']['filename'];return db['ChatWebsite'][_0xf3d0('0x56')]({'where':{'id':_0x24728f[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x952a0,null))['then'](saveUpdates(_0x24728f[_0xf3d0('0x50')],null))['then'](respondWithResult(_0x952a0,null))['catch'](handleError(_0x952a0,null));};exports[_0xf3d0('0x63')]=function(_0x1fa666,_0x1f34a9){_0x1fa666[_0xf3d0('0x50')][_0xf3d0('0x64')]=_0x1fa666['file']['filename'];return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x1fa666[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x1f34a9,null))[_0xf3d0('0x29')](saveUpdates(_0x1fa666[_0xf3d0('0x50')],null))[_0xf3d0('0x29')](respondWithResult(_0x1f34a9,null))[_0xf3d0('0x1e')](handleError(_0x1f34a9,null));};exports[_0xf3d0('0x65')]=function(_0x4c813d,_0x23e6fe){_0x4c813d[_0xf3d0('0x50')][_0xf3d0('0x66')]=_0x4c813d[_0xf3d0('0x67')][_0xf3d0('0x68')];return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x4c813d[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23e6fe,null))[_0xf3d0('0x29')](saveUpdates(_0x4c813d[_0xf3d0('0x50')],null))[_0xf3d0('0x29')](respondWithResult(_0x23e6fe,null))[_0xf3d0('0x1e')](handleError(_0x23e6fe,null));};exports['addSystemAvatar']=function(_0x4b0f76,_0x137dfa){_0x4b0f76['body'][_0xf3d0('0x69')]=_0x4b0f76[_0xf3d0('0x67')][_0xf3d0('0x68')];return db['ChatWebsite'][_0xf3d0('0x56')]({'where':{'id':_0x4b0f76[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x137dfa,null))[_0xf3d0('0x29')](saveUpdates(_0x4b0f76[_0xf3d0('0x50')],null))[_0xf3d0('0x29')](respondWithResult(_0x137dfa,null))[_0xf3d0('0x1e')](handleError(_0x137dfa,null));};exports['getLogo']=function(_0x1187b5,_0x48f0c8){var _0x29657d=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server/files/images/logos/default_logo.svg');var _0x180277={'where':{'id':_0x1187b5[_0xf3d0('0x4c')]['id']},'attributes':['id',_0xf3d0('0x62')],'raw':!![]};var _0x17edd1=![];return require(_0xf3d0('0x6c'))[_0xf3d0('0x6d')]()[_0xf3d0('0x29')](function(_0xb64dbb){if(_0xb64dbb){_0x17edd1=_0xb64dbb[_0xf3d0('0x6e')];}})[_0xf3d0('0x29')](function(){return db[_0xf3d0('0x33')][_0xf3d0('0x56')](_0x180277);})[_0xf3d0('0x29')](handleEntityNotFound(_0x48f0c8,null))[_0xf3d0('0x29')](function(_0x55bbbe){if(_0x55bbbe){if(!_[_0xf3d0('0x6f')](_0x55bbbe[_0xf3d0('0x62')])){if(fs['existsSync'](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server/files/images/logos/',_0x55bbbe[_0xf3d0('0x62')]))&&_0x17edd1){_0x29657d=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x70'),_0x55bbbe[_0xf3d0('0x62')]);}}return _0x48f0c8['download'](_0x29657d);}})[_0xf3d0('0x1e')](handleError(_0x48f0c8,null));};exports[_0xf3d0('0x71')]=function(_0x22ebb2,_0x39ae51){var _0x115fe6=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x72'));var _0x1dd28b={'where':{'id':_0x22ebb2[_0xf3d0('0x4c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xf3d0('0x33')][_0xf3d0('0x56')](_0x1dd28b)['then'](handleEntityNotFound(_0x39ae51,null))[_0xf3d0('0x29')](function(_0x561564){if(_0x561564){if(!_['isNil'](_0x561564[_0xf3d0('0x64')])){if(fs[_0xf3d0('0x73')](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x561564[_0xf3d0('0x64')]))){_0x115fe6=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x561564[_0xf3d0('0x64')]);}}return _0x39ae51[_0xf3d0('0x75')](_0x115fe6);}})[_0xf3d0('0x1e')](handleError(_0x39ae51,null));};exports['getCustomerAvatar']=function(_0x59f777,_0x331741){var _0xd10c4e=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x76'));var _0x2d96b6={'where':{'id':_0x59f777[_0xf3d0('0x4c')]['id']},'attributes':['id','customerAvatar',_0xf3d0('0x77')],'raw':!![]};return db['ChatWebsite'][_0xf3d0('0x56')](_0x2d96b6)[_0xf3d0('0x29')](handleEntityNotFound(_0x331741,null))[_0xf3d0('0x29')](function(_0x4dada8){if(_0x4dada8){if(!_[_0xf3d0('0x6f')](_0x4dada8[_0xf3d0('0x66')])){if(fs[_0xf3d0('0x73')](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x4dada8['customerAvatar']))&&_0x4dada8[_0xf3d0('0x77')]){_0xd10c4e=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server/files/images/avatars/',_0x4dada8[_0xf3d0('0x66')]);}}return _0x331741['download'](_0xd10c4e);}})[_0xf3d0('0x1e')](handleError(_0x331741,null));};exports[_0xf3d0('0x78')]=function(_0x22b82c,_0x20206f){var _0xddf82e=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x79'));var _0x332ac1={'where':{'id':_0x22b82c[_0xf3d0('0x4c')]['id']},'attributes':['id',_0xf3d0('0x69')],'raw':!![]};return db[_0xf3d0('0x33')][_0xf3d0('0x56')](_0x332ac1)['then'](handleEntityNotFound(_0x20206f,null))[_0xf3d0('0x29')](function(_0x286c48){if(_0x286c48){if(!_[_0xf3d0('0x6f')](_0x286c48[_0xf3d0('0x69')])){if(fs['existsSync'](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x286c48[_0xf3d0('0x69')]))){_0xddf82e=path['join'](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x286c48[_0xf3d0('0x69')]);}}return _0x20206f['download'](_0xddf82e);}})['catch'](handleError(_0x20206f,null));};exports['notify']=function(_0x1a45b1,_0x57513d){var _0x344c29=require('user-agent-parser');var _0x4091b9=new _0x344c29();var _0x2488f0=_0x4091b9[_0xf3d0('0x7a')](_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x7c')])[_0xf3d0('0x7d')]();var _0x5ebfac={'body':_0x1a45b1[_0xf3d0('0x50')],'channel':_0xf3d0('0x7e')};var _0x15e596=[];var _0x34571e=[];var _0x2007f2={};var _0x373ed1=![];return db[_0xf3d0('0x7f')][_0xf3d0('0x58')]()[_0xf3d0('0x29')](function(_0x2d9604){if(!_0x2d9604){throw new db['Sequelize'][(_0xf3d0('0x80'))](_0xf3d0('0x81'));}_0x15e596=_[_0xf3d0('0x82')](_[_0xf3d0('0x3a')](_0x2d9604),['createdAt',_0xf3d0('0x83')]);_0x34571e=_[_0xf3d0('0x82')](_[_0xf3d0('0x3a')](_0x2d9604),['createdAt',_0xf3d0('0x83'),'CompanyId','ListId']);if(_0x1a45b1['body']['id']){delete _0x1a45b1['body']['id'];}if(_['isNil'](_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x84')])){throw new db[(_0xf3d0('0x85'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xf3d0('0x6f')](_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x50')])||_0x1a45b1['body'][_0xf3d0('0x50')]===''){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0x86'));}if(_[_0xf3d0('0x6f')](_0x1a45b1['body']['mapKey'])){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0x87')+_0x34571e);}if(!_[_0xf3d0('0x88')](_0x34571e,_0x1a45b1[_0xf3d0('0x50')]['mapKey'])){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0x89')+_0x34571e);}_0x2007f2[_0x1a45b1['body']['mapKey']]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x84')];})[_0xf3d0('0x29')](function(){return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x1a45b1[_0xf3d0('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0xf3d0('0x8a'),'include':[{'model':db[_0xf3d0('0x7f')],'as':_0xf3d0('0x8b'),'where':_0x2007f2,'limit':0x1,'order':[[_0xf3d0('0x83'),_0xf3d0('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0xf3d0('0x8d')}]});})[_0xf3d0('0x29')](handleEntityNotFound(_0x57513d,null))['then'](function(_0x40558e){if(_0x40558e&&_0x40558e['List']){_0x5ebfac[_0xf3d0('0x8e')]=_0x40558e;_0x5ebfac[_0xf3d0('0x8f')]=_0x40558e[_0xf3d0('0x8d')];_0x5ebfac[_0xf3d0('0x90')]=_0x40558e[_0xf3d0('0x8a')];_0x5ebfac['applications']=_[_0xf3d0('0x91')](_0x5ebfac[_0xf3d0('0x8f')],['priority'],[_0xf3d0('0x92')]);if(_0x5ebfac['account']['Applications']){delete _0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0x8d')];}if(_0x5ebfac[_0xf3d0('0x8e')]['List']&&_0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0x8a')]['Contacts']['length']){return _0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0x8a')][_0xf3d0('0x8b')][0x0];}var _0x35868c=_[_0xf3d0('0xc')](_0x1a45b1[_0xf3d0('0x50')],{'firstName':_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x84')],'ListId':_0x40558e[_0xf3d0('0x93')]});_0x35868c[_0x1a45b1['body']['mapKey']]=_0x1a45b1[_0xf3d0('0x50')]['from'];return db['CmContact'][_0xf3d0('0x4f')](_0x35868c,{'fields':_0x15e596,'raw':!![]});}})[_0xf3d0('0x29')](handleEntityNotFound(_0x57513d,null))[_0xf3d0('0x29')](function(_0x51dc53){_0x5ebfac['contact']=_0x51dc53;var _0x58e7c0=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x94')];if(_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x95')]){_0x58e7c0=_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x95')];}else if(_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x96')]){_0x58e7c0=_[_0xf3d0('0x97')](_0x1a45b1[_0xf3d0('0x7b')]['x-forwarded-for'][_0xf3d0('0x98')](','));}if(_0x51dc53){var _0x421dac={'ContactId':_0x51dc53['id'],'ChatWebsiteId':_0x1a45b1[_0xf3d0('0x4c')]['id'],'from':(_0x51dc53['firstName']||'')+'\x20'+(_0x51dc53['lastName']||''),'customerIp':_0x58e7c0,'customerPort':_0x1a45b1['headers']['x-real-port']?_0x1a45b1[_0xf3d0('0x7b')]['x-real-port']:null,'referer':_0x1a45b1['body'][_0xf3d0('0x99')],'browserName':_0x2488f0[_0xf3d0('0x9a')]['name']&&_0x2488f0[_0xf3d0('0x9a')][_0xf3d0('0x9b')]?util[_0xf3d0('0x9c')](_0xf3d0('0x9d'),_0x2488f0[_0xf3d0('0x9a')][_0xf3d0('0x2e')],_0x2488f0[_0xf3d0('0x9a')]['version']):_0xf3d0('0x9e'),'browserVersion':_0x2488f0['browser'][_0xf3d0('0x9b')]||_0xf3d0('0x9e'),'osName':util['format'](_0xf3d0('0x9d'),_0x2488f0['os']['name'],_0x2488f0['os'][_0xf3d0('0x9b')]),'osVersion':_0x2488f0['os'][_0xf3d0('0x9b')],'deviceModel':_0x2488f0[_0xf3d0('0x9f')]['model']&&_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0xa0')]?util[_0xf3d0('0x9c')](_0xf3d0('0xa1'),_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0x38')],_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0xa0')],_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0x36')]):null,'deviceVendor':_0x2488f0['device']['vendor'],'deviceType':_0x2488f0[_0xf3d0('0x9f')]['type'],'formData':JSON['stringify'](_0x1a45b1[_0xf3d0('0x50')])};var _0x1daae0={'ChatWebsiteId':_0x1a45b1['params']['id'],'closed':![]};if(_0x1a45b1[_0xf3d0('0x50')]['threadId']){_0x1daae0[_0xf3d0('0xa2')]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa2')];return db[_0xf3d0('0xa3')][_0xf3d0('0x56')]({'where':_0x1daae0})['then'](function(_0x568914){if(_0x568914){return[_0x568914,![]];}_0x421dac['threadId']=_0x1a45b1['body'][_0xf3d0('0xa2')];_0x421dac[_0xf3d0('0xa4')]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa4')];return db[_0xf3d0('0xa3')][_0xf3d0('0x4f')](_0x421dac)[_0xf3d0('0x29')](function(_0x55b5ee){return[_0x55b5ee,!![]];});});}_0x1daae0[_0xf3d0('0xa5')]=_0x51dc53['id'];if(_0x1a45b1[_0xf3d0('0x50')]['interaction']&&_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa6')]['id']){_0x1daae0['id']=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa6')]['id'];return db['ChatInteraction'][_0xf3d0('0x56')]({'where':_0x1daae0})[_0xf3d0('0x29')](function(_0x56353a){if(_0x56353a){return[_0x56353a,![]];}return db[_0xf3d0('0xa3')][_0xf3d0('0x4f')](_0x421dac)['then'](function(_0x302361){return[_0x302361,!![]];});});}return db['ChatInteraction'][_0xf3d0('0x4f')](_0x421dac)[_0xf3d0('0x29')](function(_0x223172){return[_0x223172,!![]];});}})[_0xf3d0('0xa7')](function(_0x460c1f,_0x3b5145){if(_0x460c1f){_0x373ed1=_0x3b5145;if(!_0x3b5145){var _0x1cb39a={'from':(_0x5ebfac[_0xf3d0('0xa8')][_0xf3d0('0xa9')]||'')+'\x20'+(_0x5ebfac['contact'][_0xf3d0('0xaa')]||'')};if(_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa2')]&&_0x1a45b1['body'][_0xf3d0('0xab')]&&_0x1a45b1['body']['threadId']!=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xab')]){_0x1cb39a[_0xf3d0('0xa2')]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xab')];}return _0x460c1f[_0xf3d0('0x57')](_0x1cb39a);}else{return _0x460c1f;}}})[_0xf3d0('0x29')](function(_0x140710){_0x5ebfac[_0xf3d0('0xa6')]=_0x140710[_0xf3d0('0x2a')]({'plain':!![]});_0x5ebfac['interaction'][_0xf3d0('0xac')]=_0x373ed1;if(_0x5ebfac[_0xf3d0('0xa6')][_0xf3d0('0xac')]){if(_0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0xad')]){_0x5ebfac[_0xf3d0('0x8f')][_0xf3d0('0xae')]({'id':0x0,'priority':_0x5ebfac[_0xf3d0('0x8f')][_0xf3d0('0x4e')]+0x1,'app':_0xf3d0('0xaf'),'appdata':_0xf3d0('0xb0'),'interval':'*,*,*,*'});}}return db[_0xf3d0('0xb1')][_0xf3d0('0x4f')]({'body':_0x1a45b1['body']['body'],'ChatWebsiteId':_0x1a45b1['params']['id'],'ChatInteractionId':_0x140710['id'],'direction':'in','ContactId':_0x5ebfac[_0xf3d0('0xa8')]['id'],'AttachmentId':_0x1a45b1['body'][_0xf3d0('0xb2')]});})[_0xf3d0('0x29')](function(_0x1b2581){_0x5ebfac[_0xf3d0('0x1c')]=_0x1b2581;if(_0x5ebfac[_0xf3d0('0xa6')]['UserId']){return db[_0xf3d0('0xb3')]['find']({'attributes':['id','name'],'where':{'id':_0x5ebfac['interaction'][_0xf3d0('0xb4')]}})['then'](function(_0x687d25){if(_0x687d25){_0x5ebfac['applications'][_0xf3d0('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x687d25[_0xf3d0('0x2e')]+','+(_0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0xb6')]||0xa),'interval':'*,*,*,*'});_0x5ebfac[_0xf3d0('0xb7')]=!![];}return respondWithRpcPromise(_0xf3d0('0xb8'),_0xf3d0('0xb9'),_0x5ebfac);});}return respondWithRpcPromise(_0xf3d0('0xb8'),_0xf3d0('0xb9'),_0x5ebfac);})[_0xf3d0('0x29')](function(_0x40c24b){respondWithRpcPromise(_0xf3d0('0xba'),_0xf3d0('0xba'),{'event':_0xf3d0('0xbb'),'message':_0x40c24b},client9002);return _0x40c24b;})[_0xf3d0('0x29')](respondWithResult(_0x57513d,null))['catch'](handleError(_0x57513d,null));};exports[_0xf3d0('0xbc')]=function(_0x18588c,_0x392e9d){var _0x3087ad,_0x145022,_0x339953;var _0x1ddf5d=[];var _0x31e430={};var _0xb86039=_0x18588c[_0xf3d0('0xbd')]||[];var _0x382374=[];var _0x2ac327;return db[_0xf3d0('0x7f')][_0xf3d0('0x58')]()[_0xf3d0('0x29')](function(_0x5193d9){if(!_0x5193d9){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))]('no\x20available\x20attributes');}_0x1ddf5d=_[_0xf3d0('0x82')](_['keys'](_0x5193d9),['createdAt',_0xf3d0('0x83'),_0xf3d0('0xbe'),_0xf3d0('0x93')]);if(_0x18588c[_0xf3d0('0x50')]['id']){delete _0x18588c[_0xf3d0('0x50')]['id'];}if(_['isNil'](_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x84')])){throw _0x392e9d['status'](0x1f4)[_0xf3d0('0x2f')](new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0xbf')));}if(_[_0xf3d0('0x6f')](_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x50')])||_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x50')]===''){throw _0x392e9d[_0xf3d0('0x25')](0x1f4)[_0xf3d0('0x2f')](new db['Sequelize'][(_0xf3d0('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf3d0('0x6f')](_0x18588c[_0xf3d0('0x50')][_0xf3d0('0xc0')])){throw _0x392e9d['status'](0x1f4)['send'](new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ddf5d));}if(!_[_0xf3d0('0x88')](_0x1ddf5d,_0x18588c[_0xf3d0('0x50')]['mapKeyOffline'])){throw _0x392e9d[_0xf3d0('0x25')](0x1f4)['send'](new db['Sequelize'][(_0xf3d0('0x80'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ddf5d));}_0x31e430[_0x18588c[_0xf3d0('0x50')]['mapKeyOffline']]=_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x84')];})[_0xf3d0('0x29')](function(){return db['ChatWebsite'][_0xf3d0('0x56')]({'where':{'id':_0x18588c[_0xf3d0('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0xf3d0('0x8a')},{'model':db[_0xf3d0('0xc1')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x392e9d,null))['then'](function(_0x442032){if(_0x442032&&_0x442032[_0xf3d0('0x8a')]){_0x145022=_0x442032;var _0x364830=_[_0xf3d0('0xc')](_0x18588c['body'],{'firstName':_0x18588c[_0xf3d0('0x50')]['from'],'phone':_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x84')],'ListId':_0x442032['ListId']});_0x364830[_0x18588c[_0xf3d0('0x50')][_0xf3d0('0xc0')]]=_0x18588c['body'][_0xf3d0('0x84')];return db[_0xf3d0('0x7f')][_0xf3d0('0xc2')]({'where':_0x31e430,'defaults':_0x364830});}})[_0xf3d0('0xa7')](function(_0x16b747){if(_0x16b747){_0x339953=_0x16b747;var _0x6ffdf3=fs[_0xf3d0('0xc3')](path[_0xf3d0('0x6a')](config['root'],_0xf3d0('0xc4')),_0xf3d0('0xc5'));var _0x4b1b84=ejs[_0xf3d0('0xc6')](_0x6ffdf3,{'body':_[_0xf3d0('0xc7')](_0x18588c['body']['body']),'bodyTitle':_0x145022[_0xf3d0('0xc8')]});return db[_0xf3d0('0xc9')][_0xf3d0('0x4f')]({'body':_0x4b1b84,'plainBody':htmlToText[_0xf3d0('0xca')](_0x4b1b84),'ContactId':_0x16b747['id'],'ChatWebsiteId':_0x145022['id']});}})[_0xf3d0('0x29')](function(_0x507c93){_0x2ac327=_0x507c93;if(_0xb86039['length']){var _0x34e578=_0xb86039['map'](function(_0x3579ac){return{'name':_0x3579ac[_0xf3d0('0xcb')],'basename':_0x3579ac[_0xf3d0('0x68')],'type':_0x3579ac['mimetype'],'ChatOfflineMessageId':_0x507c93['id']};});_0x382374=_0x34e578['map'](_0x46c7a7=>{var _0x46040f={'filename':_0x46c7a7[_0xf3d0('0x2e')],'path':path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server',_0xf3d0('0xbd'),_0xf3d0('0xcc'),_0xf3d0('0xcd'),_0x46c7a7[_0xf3d0('0xce')])};return _0x46040f;});if(!_0x145022[_0xf3d0('0xcf')]){return db[_0xf3d0('0xd0')][_0xf3d0('0xd1')](function(_0x4500b7){return db[_0xf3d0('0xd2')][_0xf3d0('0xd3')](_0x34e578,{'transaction':_0x4500b7});});}}})[_0xf3d0('0x29')](function(){if(_0x2ac327){_0x3087ad=_0x2ac327;return db[_0xf3d0('0xc1')][_0xf3d0('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf3d0('0xd4'),'raw':!![],'include':[{'model':db[_0xf3d0('0xd5')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xf3d0('0x29')](function(_0x2c862a){if(_0x2c862a&&_0x2c862a[_0xf3d0('0xd4')]&&_0x145022[_0xf3d0('0xd6')]&&_0x145022[_0xf3d0('0xd7')]){var _0x2e6612=_0x2c862a[_0xf3d0('0xd8')]();return respondWithRpcPromise(_0xf3d0('0xd9'),'sendMail',{'account':_0x2e6612,'message':{'from':util[_0xf3d0('0x9c')](_0xf3d0('0xda'),_0x2c862a[_0xf3d0('0x2e')],_0x2c862a[_0xf3d0('0xdb')]||_0x2c862a['Smtp'][_0xf3d0('0x51')]),'to':_0x145022[_0xf3d0('0xd7')],'subject':_0x145022[_0xf3d0('0xdc')],'html':_0x3087ad[_0xf3d0('0x50')],'attachments':_0x382374}},client9003)['then'](function(){return _0x3087ad;})[_0xf3d0('0x1e')](function(_0x1f6ef2){logger['error'](_0x1f6ef2);});}})['then'](function(){if(_0x145022&&_0x145022[_0xf3d0('0xcf')]&&_0x145022['MailAccountId']){var _0x43cbcc=[];if(_0xb86039['length']){_0x43cbcc=_0xb86039['map'](function(_0x5e39c7){return{'name':_0x5e39c7['originalname'],'basename':_0x5e39c7[_0xf3d0('0x68')],'type':_0x5e39c7[_0xf3d0('0xdd')],'ChatOfflineMessageId':_0x2ac327['id']};});}var _0x6fb97a;if(!_['isNil'](_0x145022[_0xf3d0('0xde')])){var _0x90d109=_[_0xf3d0('0x32')](_0x18588c[_0xf3d0('0x50')],function(_0x1f7950){return _0x1f7950;});var _0x5c85c7=_[_0xf3d0('0xdf')](_0x90d109)[0x0];var _0x3424cc=_['mapValues'](_0x5c85c7,function(_0xf3a064){return _0xf3a064;});_0x6fb97a=_0x3424cc[0x1][_0x145022[_0xf3d0('0xde')]];}var _0x242b48={'from':_0x339953[_0xf3d0('0xdb')],'firstName':_0x339953[_0xf3d0('0xa9')],'lastName':_0x339953[_0xf3d0('0xaa')],'mapKey':'email','message':{'from':_0x339953[_0xf3d0('0xdb')],'to':_0x145022[_0xf3d0('0xc1')]['email'],'cc':'','subject':_['isNil'](_0x6fb97a)?_0x145022[_0xf3d0('0xdc')]:_0x6fb97a,'messageId':'','sentAt':new Date(),'attach':_0x43cbcc[_0xf3d0('0x4e')],'attachments':_0x43cbcc,'originChannel':'Chat','ChatWebsiteId':_0x145022['id'],'ChatOfflineMessageId':_0x3087ad['id'],'originTo':_0x145022[_0xf3d0('0xc1')][_0xf3d0('0xdb')]},'body':_0x3087ad['body']};var _0x48d449={'account':{'id':_0x145022[_0xf3d0('0xe0')]},'body':_0x242b48,'log':_0xf3d0('0xe1')};return respondWithRpcPromise(_0xf3d0('0xe1'),'notifyMail',_0x48d449,client9001)[_0xf3d0('0x29')](function(){return _0x3087ad;})[_0xf3d0('0x1e')](function(_0x49d73e){logger[_0xf3d0('0x1a')](_0x49d73e);});}return;})[_0xf3d0('0x29')](function(){if(_0x3087ad){return _0x3087ad;}})[_0xf3d0('0x29')](respondWithResult(_0x392e9d,null))[_0xf3d0('0x1e')](function(_0x90a8be){logger[_0xf3d0('0x1a')](_0xf3d0('0x1e'),_0x90a8be);for(var _0x1f302f of _0xb86039){var _0x4b8f10=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0xe2'),_0xf3d0('0xbd'),'attachments',_0xf3d0('0xcd'),_0x1f302f[_0xf3d0('0x68')]);fs_extra[_0xf3d0('0xe3')](_0x4b8f10)['catch'](function(_0x28a89e){logger[_0xf3d0('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x4b8f10,_0x28a89e);});}});};exports[_0xf3d0('0xe4')]=function(_0x30359e,_0x228c9c){return db[_0xf3d0('0xa3')]['find']({'where':{'id':_0x30359e['params']['id']}})['then'](handleEntityNotFound(_0x228c9c,null))[_0xf3d0('0x29')](function(_0x140fb6){if(_0x140fb6){return _0x140fb6[_0xf3d0('0xe4')](_0x30359e['body']['ids'],_[_0xf3d0('0xe5')](_0x30359e[_0xf3d0('0x50')],['ids','id'])||{});}})[_0xf3d0('0x29')](respondWithResult(_0x228c9c,null))[_0xf3d0('0x1e')](handleError(_0x228c9c,null));};exports[_0xf3d0('0xe6')]=function(_0x4f5583,_0x241b49){var _0x5077bf={'raw':![],'where':{}};var _0x590f5d={};var _0xb42bd2={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')]['findOne']({'where':{'id':_0x4f5583[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x241b49,null))['then'](function(_0x16958c){if(_0x16958c){_0x590f5d[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db['ChatInteraction'][_0xf3d0('0x34')]);_0x590f5d[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x4f5583[_0xf3d0('0x39')]);_0x590f5d[_0xf3d0('0x3b')]=_['intersection'](_0x590f5d[_0xf3d0('0x38')],_0x590f5d[_0xf3d0('0x39')]);_0x5077bf[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x590f5d[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x4f5583['query'][_0xf3d0('0x3d')]));_0x5077bf['attributes']=_0x5077bf[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x5077bf['attributes']:_0x590f5d[_0xf3d0('0x38')];if(!_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x5077bf[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x5077bf['offset']=qs[_0xf3d0('0x21')](_0x4f5583[_0xf3d0('0x39')]['offset']);}_0x5077bf[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x4f5583[_0xf3d0('0x39')]['sort']);_0x5077bf[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x4f5583['query'],_0x590f5d[_0xf3d0('0x3b')]));_0x5077bf[_0xf3d0('0x43')][_0xf3d0('0x59')]=_0x16958c['id'];if(_0x4f5583['query'][_0xf3d0('0x45')]){_0x5077bf[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x5077bf[_0xf3d0('0x43')],{'$or':_['map'](_0x5077bf[_0xf3d0('0x3e')],function(_0x4c3d21){var _0x5e0df8={};_0x5e0df8[_0x4c3d21]={'$like':'%'+_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x5e0df8;})});}_0x5077bf=_[_0xf3d0('0x46')]({},_0x5077bf,_0x4f5583[_0xf3d0('0xe7')]);return db[_0xf3d0('0xa3')]['count']({'where':_0x5077bf[_0xf3d0('0x43')]})[_0xf3d0('0x29')](function(_0x5f162e){_0xb42bd2['count']=_0x5f162e;if(_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x48')]){_0x5077bf[_0xf3d0('0x49')]=[{'model':db['CmContact'],'as':_0xf3d0('0xe8'),'required':![]},{'model':db[_0xf3d0('0xb3')],'as':_0xf3d0('0xe9'),'attributes':[_0xf3d0('0x2e'),_0xf3d0('0xea'),_0xf3d0('0xeb')],'required':![]},{'model':db[_0xf3d0('0xec')],'as':_0xf3d0('0xed'),'attributes':['id','name',_0xf3d0('0xee')],'where':_0x4f5583['query'][_0xf3d0('0xef')]?{'id':_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0xef')]}:undefined,'required':_0x4f5583['query'][_0xf3d0('0xef')]?!![]:![]}];}return db[_0xf3d0('0xa3')][_0xf3d0('0x4a')](_0x5077bf);})[_0xf3d0('0x29')](function(_0x432f01){_0xb42bd2['rows']=_0x432f01;return _0xb42bd2;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x241b49,_0x5077bf))[_0xf3d0('0x1e')](handleError(_0x241b49,null));};function iftimePromise(_0x496736,_0x3f1f9d){return respondWithRpcPromise(_0xf3d0('0xf0'),_0xf3d0('0xf1'),{'command':_0x3f1f9d[_0xf3d0('0xf2')]?util[_0xf3d0('0x9c')]('iftime\x20%s,%s',_0x496736[_0xf3d0('0xf3')],_0x3f1f9d[_0xf3d0('0xf2')]):util['format']('iftime\x20%s',_0x496736['interval'])},client9002)[_0xf3d0('0x29')](function(_0x27cdc2){var _0x3dd850=_0x27cdc2&&_0x27cdc2['indexOf']('true')>=0x0?!![]:![];logger[_0xf3d0('0x15')](_0xf3d0('0xf4'),_0x3f1f9d['id'],_0x496736['id'],_0x496736[_0xf3d0('0xf3')],_0x3dd850?_0xf3d0('0xf5'):_0xf3d0('0xf6'),_0x3f1f9d[_0xf3d0('0xf2')]?_0x3f1f9d['timezone']:_0xf3d0('0xf7'));return _0x3dd850;})[_0xf3d0('0x1e')](function(_0x32e831){logger[_0xf3d0('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3f1f9d['id'],_0x496736['id'],_0x496736['interval'],util['inspect'](_0x32e831,{'showHidden':![],'depth':null}),_0x3f1f9d['timezone']?_0x3f1f9d['timezone']:_0xf3d0('0xf7'));return![];});}exports['getSnippet']=function(_0x3caef7,_0x3d7efe){var _0x4d4078=0x0;var _0x3ccac5=0x0;var _0x552e04=![];var _0x42c1ee;var _0xe65435;return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x3caef7[_0xf3d0('0x4c')]['id']},'include':[{'model':db[_0xf3d0('0xf8')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xf3d0('0xf3')],'raw':!![]}]}]})[_0xf3d0('0x29')](handleEntityNotFound(_0x3d7efe,null))[_0xf3d0('0x29')](function(_0x3c59e1){if(_0x3c59e1){_0x42c1ee=_0x3c59e1;return _0x3c59e1[_0xf3d0('0xf9')]({'raw':!![]});}})[_0xf3d0('0x29')](function(_0x458d29){if(_0x42c1ee){if(_0x458d29){_0xe65435=_0x458d29;}}return require(_0xf3d0('0x6c'))[_0xf3d0('0x6d')]();})[_0xf3d0('0x29')](function(_0x410152){if(_0x410152){_0x3ccac5=_0x410152[_0xf3d0('0xfa')];_0x552e04=_0x410152[_0xf3d0('0x6e')];}})['then'](function(){return db[_0xf3d0('0xa3')][_0xf3d0('0x24')]({'where':{'closed':![]}});})[_0xf3d0('0x29')](function(_0x472e11){_0x4d4078=_0x472e11;if(_0x3ccac5&&_0x472e11>_0x3ccac5){return db['License'][_0xf3d0('0x5b')]({'where':{'id':0x1}})[_0xf3d0('0x29')](function(_0x432c11){if(_0x432c11){_0x432c11[_0xf3d0('0xfb')](_0xf3d0('0xfc'));}});}})[_0xf3d0('0x29')](function(){if(_0x42c1ee[_0xf3d0('0xf8')]&&_0x42c1ee[_0xf3d0('0xf8')]['Intervals']){var _0x41002c=[];for(var _0x23a665=0x0;_0x23a665<_0x42c1ee['Interval'][_0xf3d0('0xfd')][_0xf3d0('0x4e')];_0x23a665++){var _0x7856df=_0x42c1ee[_0xf3d0('0xf8')][_0xf3d0('0xfd')][_0x23a665]['get']({'plain':!![]});_0x41002c[_0xf3d0('0xae')](iftimePromise(_0x7856df,_0x42c1ee));}return BPromise[_0xf3d0('0xfe')](_0x41002c)['then'](function(_0x34aa0e){return _['some'](_0x34aa0e);});}else{return!![];}})[_0xf3d0('0x29')](function(_0x119bf0){var _0x1d73c5=fs[_0xf3d0('0xc3')](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0xff')),_0xf3d0('0xc5'));var _0x2e63df={'remote':_0x42c1ee['remote'],'query':querystring['stringify'](_[_0xf3d0('0x46')](_0x42c1ee['get']({'plain':!![]}),{'customerIp':_0x3caef7[_0xf3d0('0x7b')][_0xf3d0('0x96')]||_0x3caef7[_0xf3d0('0x7b')][_0xf3d0('0x100')]||_0x3caef7[_0xf3d0('0x101')][_0xf3d0('0x102')]||_0x3caef7['ip'],'referer':_0x3caef7[_0xf3d0('0x7b')][_0xf3d0('0x99')],'openedInteractions':_0x4d4078,'maxInteractions':_0x3ccac5,'virtual':_0x552e04['virtual'],'online':_0x119bf0,'custom':_0x552e04}))[_0xf3d0('0x103')](/'/g,'\x5c\x27')};_0x3d7efe['send'](ejs[_0xf3d0('0xc6')](Mustache[_0xf3d0('0xc6')](_0x1d73c5,_0x2e63df),{'proactiveActions':_0xe65435,'alignment':_0x42c1ee['alignment'],'verticalAlignment':_0x42c1ee[_0xf3d0('0x104')],'div_color':_0x42c1ee[_0xf3d0('0xee')],'labelText':_0x42c1ee[_0xf3d0('0x105')],'text_color':_0x42c1ee[_0xf3d0('0x106')],'text_button_color':_0x42c1ee['textButtonColor'],'button_color':_0x42c1ee[_0xf3d0('0x107')],'background_color':_0x42c1ee[_0xf3d0('0x108')],'hideWhenOffline':_0x42c1ee[_0xf3d0('0x109')],'interval':_0x42c1ee[_0xf3d0('0x10a')]}));})[_0xf3d0('0x1e')](handleError(_0x3d7efe,null));};exports[_0xf3d0('0x10b')]=function(_0x560fd3,_0x76980c){var _0xed510c=_0x560fd3[_0xf3d0('0x4c')]['id'];var _0x1e3141=_0x560fd3[_0xf3d0('0x50')];var _0xa2dbf2=0xc8;var _0x6daa6=null;return db['sequelize'][_0xf3d0('0xd1')]({'isolationLevel':db[_0xf3d0('0xd0')][_0xf3d0('0x10c')][_0xf3d0('0x10d')][_0xf3d0('0x10e')]},function(_0x10c3f4){return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0xed510c},'transaction':_0x10c3f4})[_0xf3d0('0x29')](function(_0x162e15){if(_0x162e15){return db[_0xf3d0('0x10f')][_0xf3d0('0x28')]({'where':{'ChatWebsiteId':_0xed510c},'transaction':_0x10c3f4})[_0xf3d0('0x29')](function(){var _0x4568ef=_[_0xf3d0('0x32')](_0x1e3141,function(_0x6c35a4){_0x6c35a4['ChatWebsiteId']=_0xed510c;return _0x6c35a4;});return db[_0xf3d0('0x10f')][_0xf3d0('0xd3')](_0x4568ef,{'transaction':_0x10c3f4});});}else{_0xa2dbf2=0x194;_0x6daa6=[];}});})[_0xf3d0('0x29')](function(){if(_0xa2dbf2!==0x194){return db[_0xf3d0('0x10f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xed510c},'order':_0xf3d0('0x110')})[_0xf3d0('0x29')](function(_0x2290c5){_0x6daa6=_0x2290c5;});}})[_0xf3d0('0x1e')](function(_0x22af69){_0xa2dbf2=0x1f4;logger[_0xf3d0('0x1a')](_0x22af69['stack']);if(_0x22af69['name']){delete _0x22af69[_0xf3d0('0x2e')];}_0x6daa6=_0x22af69;})['finally'](function(){if(_0x6daa6===null){_0x76980c[_0xf3d0('0x1f')](_0xa2dbf2);}else{if(_0xa2dbf2===0x1f4){_0x76980c['status'](_0xa2dbf2)[_0xf3d0('0x2f')](_0x6daa6);}else{_0x76980c[_0xf3d0('0x25')](_0xa2dbf2)[_0xf3d0('0x20')](_0x6daa6);}}});};exports['getApplications']=function(_0x243676,_0x4b51c2){var _0x5551c6={};var _0xe0064a={};var _0x54eb60;var _0x4cadc1;return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x243676[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b51c2,null))['then'](function(_0x493e0b){if(_0x493e0b){_0x54eb60=_0x493e0b;_0xe0064a[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0x10f')][_0xf3d0('0x34')]);_0xe0064a['query']=_[_0xf3d0('0x3a')](_0x243676[_0xf3d0('0x39')]);_0xe0064a[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0xe0064a[_0xf3d0('0x38')],_0xe0064a['query']);_0x5551c6[_0xf3d0('0x3e')]=_['intersection'](_0xe0064a[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x243676['query'][_0xf3d0('0x3d')]));_0x5551c6['attributes']=_0x5551c6[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x5551c6[_0xf3d0('0x3e')]:_0xe0064a[_0xf3d0('0x38')];_0x5551c6['order']=qs['sort'](_0x243676[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x5551c6[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x243676[_0xf3d0('0x39')],_0xe0064a[_0xf3d0('0x3b')]));if(_0x243676[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x5551c6[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x5551c6['where'],{'$or':_[_0xf3d0('0x32')](_0x5551c6['attributes'],function(_0x391c0c){var _0x385173={};_0x385173[_0x391c0c]={'$like':'%'+_0x243676['query'][_0xf3d0('0x45')]+'%'};return _0x385173;})});}_0x5551c6=_[_0xf3d0('0x46')]({},_0x5551c6,_0x243676[_0xf3d0('0xe7')]);return _0x54eb60[_0xf3d0('0x111')](_0x5551c6);}})[_0xf3d0('0x29')](function(_0x401b41){if(_0x401b41){_0x4cadc1=_0x401b41['length'];if(!_0x243676[_0xf3d0('0x39')]['hasOwnProperty']('nolimit')){_0x5551c6[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x243676[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x5551c6[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x243676['query'][_0xf3d0('0x21')]);}return _0x54eb60['getApplications'](_0x5551c6);}})[_0xf3d0('0x29')](function(_0x4967d5){if(_0x4967d5){return _0x4967d5?{'count':_0x4cadc1,'rows':_0x4967d5}:null;}})[_0xf3d0('0x29')](respondWithResult(_0x4b51c2,null))[_0xf3d0('0x1e')](handleError(_0x4b51c2,null));};exports[_0xf3d0('0x112')]=function(_0x5d9653,_0x3ad00a){return db['chatProactiveAction']['find']({'where':{'id':_0x5d9653['params']['id']}})['then'](handleEntityNotFound(_0x3ad00a,null))[_0xf3d0('0x29')](function(_0x1552ad){if(_0x1552ad){return _0x1552ad['addProactiveActions'](_0x5d9653['body'][_0xf3d0('0x5d')],_[_0xf3d0('0xe5')](_0x5d9653[_0xf3d0('0x50')],[_0xf3d0('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x3ad00a,null))['catch'](handleError(_0x3ad00a,null));};exports[_0xf3d0('0xf9')]=function(_0x2e7d2a,_0x1d7459){var _0x29d1e6={};var _0x58e3f4={};var _0x26de3b;var _0x5ecae9;return db['ChatWebsite'][_0xf3d0('0x5b')]({'where':{'id':_0x2e7d2a[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x1d7459,null))[_0xf3d0('0x29')](function(_0x371d03){if(_0x371d03){_0x26de3b=_0x371d03;_0x58e3f4[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0x113')][_0xf3d0('0x34')]);_0x58e3f4['query']=_[_0xf3d0('0x3a')](_0x2e7d2a[_0xf3d0('0x39')]);_0x58e3f4[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0x58e3f4['model'],_0x58e3f4['query']);_0x29d1e6['attributes']=_[_0xf3d0('0x3c')](_0x58e3f4[_0xf3d0('0x38')],qs['fields'](_0x2e7d2a[_0xf3d0('0x39')][_0xf3d0('0x3d')]));_0x29d1e6[_0xf3d0('0x3e')]=_0x29d1e6[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x29d1e6[_0xf3d0('0x3e')]:_0x58e3f4[_0xf3d0('0x38')];_0x29d1e6[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x2e7d2a[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x29d1e6['where']=qs['filters'](_[_0xf3d0('0x44')](_0x2e7d2a[_0xf3d0('0x39')],_0x58e3f4[_0xf3d0('0x3b')]));if(_0x2e7d2a[_0xf3d0('0x39')]['filter']){_0x29d1e6[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x29d1e6[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x29d1e6['attributes'],function(_0x51ef1f){var _0x445298={};_0x445298[_0x51ef1f]={'$like':'%'+_0x2e7d2a['query'][_0xf3d0('0x45')]+'%'};return _0x445298;})});}_0x29d1e6=_[_0xf3d0('0x46')]({},_0x29d1e6,_0x2e7d2a[_0xf3d0('0xe7')]);return _0x26de3b[_0xf3d0('0xf9')](_0x29d1e6);}})[_0xf3d0('0x29')](function(_0x18b792){if(_0x18b792){_0x5ecae9=_0x18b792[_0xf3d0('0x4e')];if(!_0x2e7d2a['query'][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x29d1e6[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x2e7d2a['query']['limit']);_0x29d1e6[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x2e7d2a['query'][_0xf3d0('0x21')]);}return _0x26de3b[_0xf3d0('0xf9')](_0x29d1e6);}})[_0xf3d0('0x29')](function(_0x3a4a9e){if(_0x3a4a9e){return _0x3a4a9e?{'count':_0x5ecae9,'rows':_0x3a4a9e}:null;}})[_0xf3d0('0x29')](respondWithResult(_0x1d7459,null))[_0xf3d0('0x1e')](handleError(_0x1d7459,null));};exports['getFields']=function(_0x21175f,_0x1c68c2){var _0x574e01=_0x21175f['query'][_0xf3d0('0x114')]===_0xf3d0('0x115')?_0xf3d0('0x116'):_0xf3d0('0x117');return db['ChatWebsite'][_0xf3d0('0x56')]({'attributes':['id',_0x574e01],'where':{'id':_0x21175f['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x1c68c2,null))[_0xf3d0('0x29')](function(_0x544174){if(_0x544174){var _0x57c410=_0x544174[_0x574e01];var _0x2536f9=_0x57c410&&_0x57c410[_0xf3d0('0x118')]?_0x57c410[_0xf3d0('0x118')]:[];_0x1c68c2[_0xf3d0('0x2f')]({'fromKey':_[_0xf3d0('0x6f')](_0x57c410[_0xf3d0('0x119')])?undefined:_0x57c410[_0xf3d0('0x119')],'count':_0x2536f9['length'],'rows':_0x2536f9});}})[_0xf3d0('0x1e')](handleError(_0x1c68c2,null));};exports[_0xf3d0('0x11a')]=function(_0x3aab92,_0x244f8d){var _0xdfd280={'raw':![],'where':{}};var _0x204f97={};var _0xbe3657={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x3aab92['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x244f8d,null))[_0xf3d0('0x29')](function(_0x31d713){if(_0x31d713){_0x204f97[_0xf3d0('0x38')]=_['keys'](db[_0xf3d0('0xc9')][_0xf3d0('0x34')]);_0x204f97[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x3aab92['query']);_0x204f97[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0x204f97[_0xf3d0('0x38')],_0x204f97[_0xf3d0('0x39')]);_0xdfd280['attributes']=_[_0xf3d0('0x3c')](_0x204f97['model'],qs[_0xf3d0('0x3d')](_0x3aab92['query'][_0xf3d0('0x3d')]));_0xdfd280[_0xf3d0('0x3e')]=_0xdfd280[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0xdfd280[_0xf3d0('0x3e')]:_0x204f97['model'];if(!_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x3f')]('nolimit')){_0xdfd280[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x3aab92['query'][_0xf3d0('0x22')]);_0xdfd280[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x3aab92['query']['offset']);}_0xdfd280[_0xf3d0('0x41')]=qs['sort'](_0x3aab92['query'][_0xf3d0('0x42')]);_0xdfd280['where']=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x3aab92[_0xf3d0('0x39')],_0x204f97[_0xf3d0('0x3b')]));_0xdfd280[_0xf3d0('0x43')]['ChatWebsiteId']=_0x31d713['id'];if(_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0xdfd280[_0xf3d0('0x43')]=_['merge'](_0xdfd280[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0xdfd280[_0xf3d0('0x3e')],function(_0x30b442){var _0x5de6c8={};_0x5de6c8[_0x30b442]={'$like':'%'+_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x5de6c8;})});}_0xdfd280=_[_0xf3d0('0x46')]({},_0xdfd280,_0x3aab92[_0xf3d0('0xe7')]);return db['ChatOfflineMessage']['count']({'where':_0xdfd280[_0xf3d0('0x43')]})['then'](function(_0x27a156){_0xbe3657[_0xf3d0('0x24')]=_0x27a156;if(_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x48')]){_0xdfd280['include']=[{'all':!![]}];}else{_0xdfd280[_0xf3d0('0x49')]=[{'model':db[_0xf3d0('0x7f')],'as':_0xf3d0('0xe8'),'required':![]},{'model':db[_0xf3d0('0xd2')],'as':_0xf3d0('0x11b'),'required':![]}];}return db[_0xf3d0('0xc9')][_0xf3d0('0x4a')](_0xdfd280);})[_0xf3d0('0x29')](function(_0x5bdf5b){_0xbe3657[_0xf3d0('0x5c')]=_0x5bdf5b;return _0xbe3657;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x244f8d,_0xdfd280))[_0xf3d0('0x1e')](handleError(_0x244f8d,null));};exports[_0xf3d0('0x11c')]=function(_0x106e5d,_0x55afde){return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x106e5d[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x55afde,null))[_0xf3d0('0x29')](function(_0x308ef){if(_0x308ef){return _0x308ef['addAgents'](_0x106e5d[_0xf3d0('0x50')][_0xf3d0('0x5d')],_['omit'](_0x106e5d[_0xf3d0('0x50')],[_0xf3d0('0x5d'),'id'])||{})[_0xf3d0('0xa7')](function(_0x4e5061){for(var _0x53cd38=0x0;_0x53cd38<_0x106e5d[_0xf3d0('0x50')]['ids'][_0xf3d0('0x4e')];_0x53cd38+=0x1){socket[_0xf3d0('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x106e5d['body'][_0xf3d0('0x5d')][_0x53cd38]),'ChatWebsiteId':Number(_0x106e5d[_0xf3d0('0x4c')]['id'])});}return _0x4e5061;});}})[_0xf3d0('0x29')](respondWithResult(_0x55afde,null))[_0xf3d0('0x1e')](handleError(_0x55afde,null));};exports[_0xf3d0('0x11e')]=function(_0x3269b4,_0x118616){return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x3269b4[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x118616,null))[_0xf3d0('0x29')](function(_0x325119){if(_0x325119){return _0x325119[_0xf3d0('0x11e')](_0x3269b4['query'][_0xf3d0('0x5d')])[_0xf3d0('0x29')](function(){if(_['isArray'](_0x3269b4[_0xf3d0('0x39')][_0xf3d0('0x5d')])){for(var _0xd54e7f=0x0;_0xd54e7f<_0x3269b4[_0xf3d0('0x39')][_0xf3d0('0x5d')]['length'];_0xd54e7f+=0x1){socket[_0xf3d0('0x11d')](_0xf3d0('0x11f'),{'UserId':Number(_0x3269b4[_0xf3d0('0x39')][_0xf3d0('0x5d')][_0xd54e7f]),'ChatWebsiteId':Number(_0x3269b4[_0xf3d0('0x4c')]['id'])});}}else{socket[_0xf3d0('0x11d')](_0xf3d0('0x11f'),{'UserId':Number(_0x3269b4[_0xf3d0('0x39')]['ids']),'ChatWebsiteId':Number(_0x3269b4[_0xf3d0('0x4c')]['id'])});}});}})[_0xf3d0('0x29')](respondWithStatusCode(_0x118616,null))['catch'](handleError(_0x118616,null));};exports['getAgents']=function(_0x495312,_0x30a2e8){var _0x200dbb={};var _0x20b76e={};var _0x19a8b7;var _0xfdb394;return db['ChatWebsite'][_0xf3d0('0x5b')]({'where':{'id':_0x495312['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x30a2e8,null))[_0xf3d0('0x29')](function(_0x121e09){if(_0x121e09){_0x19a8b7=_0x121e09;_0x20b76e[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0xb3')][_0xf3d0('0x34')]);_0x20b76e[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x495312[_0xf3d0('0x39')]);_0x20b76e['filters']=_[_0xf3d0('0x3c')](_0x20b76e[_0xf3d0('0x38')],_0x20b76e[_0xf3d0('0x39')]);_0x200dbb['attributes']=_[_0xf3d0('0x3c')](_0x20b76e['model'],qs[_0xf3d0('0x3d')](_0x495312['query']['fields']));_0x200dbb[_0xf3d0('0x3e')]=_0x200dbb[_0xf3d0('0x3e')]['length']?_0x200dbb[_0xf3d0('0x3e')]:_0x20b76e['model'];_0x200dbb[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x495312[_0xf3d0('0x39')]['sort']);_0x200dbb[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x495312[_0xf3d0('0x39')],_0x20b76e[_0xf3d0('0x3b')]));if(_0x495312[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x200dbb['where']=_[_0xf3d0('0x46')](_0x200dbb[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x200dbb[_0xf3d0('0x3e')],function(_0x4414da){var _0x1c357c={};_0x1c357c[_0x4414da]={'$like':'%'+_0x495312[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x1c357c;})});}_0x200dbb=_['merge']({},_0x200dbb,_0x495312['options']);return _0x19a8b7[_0xf3d0('0x120')](_0x200dbb);}})[_0xf3d0('0x29')](function(_0x414a07){if(_0x414a07){_0xfdb394=_0x414a07[_0xf3d0('0x4e')];if(!_0x495312[_0xf3d0('0x39')]['hasOwnProperty'](_0xf3d0('0x40'))){_0x200dbb['limit']=qs[_0xf3d0('0x22')](_0x495312[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x200dbb['offset']=qs['offset'](_0x495312[_0xf3d0('0x39')][_0xf3d0('0x21')]);}return _0x19a8b7['getAgents'](_0x200dbb);}})['then'](function(_0x2b9849){if(_0x2b9849){return _0x2b9849?{'count':_0xfdb394,'rows':_0x2b9849}:null;}})[_0xf3d0('0x29')](respondWithResult(_0x30a2e8,null))['catch'](handleError(_0x30a2e8,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index a0788bf..b46d900 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 _0x5a52=['update','remove','emit','hasOwnProperty','exports','events','save'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a52,0x18d));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x25a5('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25a5('0x1'),'afterUpdate':_0x25a5('0x2'),'afterDestroy':_0x25a5('0x3')};function emitEvent(_0x2f17d9){return function(_0x2fc1db,_0x407636,_0x1d9132){ChatWebsiteEvents[_0x25a5('0x4')](_0x2f17d9+':'+_0x2fc1db['id'],_0x2fc1db);ChatWebsiteEvents['emit'](_0x2f17d9,_0x2fc1db);_0x1d9132(null);};}for(var e in events){if(events[_0x25a5('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x25a5('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa7b4=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','save'];(function(_0x4fe704,_0x243304){var _0x5e604b=function(_0x5562ca){while(--_0x5562ca){_0x4fe704['push'](_0x4fe704['shift']());}};_0x5e604b(++_0x243304);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x3f8dfa,_0x4ca511){_0x3f8dfa=_0x3f8dfa-0x0;var _0x4fd797=_0xa7b4[_0x3f8dfa];return _0x4fd797;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x4a7b('0x0'))['db'][_0x4a7b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4a7b('0x2'),'afterUpdate':_0x4a7b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5de6a2){return function(_0x4cadbf,_0x8c0229,_0x348341){ChatWebsiteEvents['emit'](_0x5de6a2+':'+_0x4cadbf['id'],_0x4cadbf);ChatWebsiteEvents[_0x4a7b('0x4')](_0x5de6a2,_0x4cadbf);_0x348341(null);};}for(var e in events){if(events[_0x4a7b('0x5')](e)){var event=events[e];ChatWebsite[_0x4a7b('0x6')](e,emitEvent(event));}}module[_0x4a7b('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 81ea3c2..41d8448 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 _0x3c86=['chat_websites','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x1e053f,_0x53ce14){var _0x4a0c43=function(_0x2518c3){while(--_0x2518c3){_0x1e053f['push'](_0x1e053f['shift']());}};_0x4a0c43(++_0x53ce14);}(_0x3c86,0x6d));var _0x63c8=function(_0x374bbd,_0x35a7b4){_0x374bbd=_0x374bbd-0x0;var _0x1470b7=_0x3c86[_0x374bbd];return _0x1470b7;};'use strict';var _=require('lodash');var util=require(_0x63c8('0x0'));var logger=require(_0x63c8('0x1'))(_0x63c8('0x2'));var moment=require('moment');var BPromise=require(_0x63c8('0x3'));var rp=require(_0x63c8('0x4'));var fs=require('fs');var path=require(_0x63c8('0x5'));var rimraf=require(_0x63c8('0x6'));var config=require('../../config/environment');var attributes=require(_0x63c8('0x7'));module[_0x63c8('0x8')]=function(_0x149023,_0xc8e0ca){return _0x149023[_0x63c8('0x9')](_0x63c8('0xa'),attributes,{'tableName':_0x63c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3075=['bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3075,0x18f));var _0x5307=function(_0x45a003,_0x2d9b81){_0x45a003=_0x45a003-0x0;var _0x228bae=_0x3075[_0x45a003];return _0x228bae;};'use strict';var _=require(_0x5307('0x0'));var util=require(_0x5307('0x1'));var logger=require(_0x5307('0x2'))(_0x5307('0x3'));var moment=require('moment');var BPromise=require(_0x5307('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5307('0x5'));var rimraf=require(_0x5307('0x6'));var config=require(_0x5307('0x7'));var attributes=require(_0x5307('0x8'));module[_0x5307('0x9')]=function(_0x39ad95,_0x297ad5){return _0x39ad95[_0x5307('0xa')](_0x5307('0xb'),attributes,{'tableName':_0x5307('0xc'),'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 e1a3e86..3b17717 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 _0x4199=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4199,0xb4));var _0x9419=function(_0x300bc5,_0xde5424){_0x300bc5=_0x300bc5-0x0;var _0x2223b5=_0x4199[_0x300bc5];return _0x2223b5;};'use strict';var _=require(_0x9419('0x0'));var util=require(_0x9419('0x1'));var moment=require(_0x9419('0x2'));var BPromise=require('bluebird');var rs=require(_0x9419('0x3'));var fs=require('fs');var Redis=require(_0x9419('0x4'));var db=require(_0x9419('0x5'))['db'];var utils=require(_0x9419('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9419('0x7'));var jayson=require(_0x9419('0x8'));var client=jayson[_0x9419('0x9')][_0x9419('0xa')]({'port':0x232a});config[_0x9419('0xb')]=_[_0x9419('0xc')](config[_0x9419('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9419('0xd'))(new Redis(config[_0x9419('0xb')]));require(_0x9419('0xe'))[_0x9419('0xf')](socket);function respondWithRpcPromise(_0xb32e78,_0x2ffd0c,_0x4793e6){return new BPromise(function(_0x527c8d,_0x1955bc){return client['request'](_0xb32e78,_0x4793e6)[_0x9419('0x10')](function(_0x27bb4b){logger['info'](_0x9419('0x11'),_0x2ffd0c,_0x9419('0x12'));logger[_0x9419('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2ffd0c,_0x9419('0x12'),JSON['stringify'](_0x27bb4b));if(_0x27bb4b[_0x9419('0x14')]){if(_0x27bb4b[_0x9419('0x14')][_0x9419('0x15')]===0x1f4){logger[_0x9419('0x14')](_0x9419('0x11'),_0x2ffd0c,_0x27bb4b[_0x9419('0x14')]['message']);return _0x1955bc(_0x27bb4b[_0x9419('0x14')]['message']);}logger[_0x9419('0x14')](_0x9419('0x11'),_0x2ffd0c,_0x27bb4b['error'][_0x9419('0x16')]);return _0x527c8d(_0x27bb4b[_0x9419('0x14')][_0x9419('0x16')]);}else{logger[_0x9419('0x17')](_0x9419('0x11'),_0x2ffd0c,'request\x20sent');_0x527c8d(_0x27bb4b[_0x9419('0x18')][_0x9419('0x16')]);}})[_0x9419('0x19')](function(_0x2aace1){logger[_0x9419('0x14')](_0x9419('0x11'),_0x2ffd0c,_0x2aace1);_0x1955bc(_0x2aace1);});});} \ No newline at end of file +var _0x1c57=['code','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x438ce8,_0x1cb2c9){var _0x2a63aa=function(_0x57e609){while(--_0x57e609){_0x438ce8['push'](_0x438ce8['shift']());}};_0x2a63aa(++_0x1cb2c9);}(_0x1c57,0x1a6));var _0x71c5=function(_0x354b92,_0x5acc71){_0x354b92=_0x354b92-0x0;var _0x40c7fc=_0x1c57[_0x354b92];return _0x40c7fc;};'use strict';var _=require(_0x71c5('0x0'));var util=require(_0x71c5('0x1'));var moment=require(_0x71c5('0x2'));var BPromise=require(_0x71c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71c5('0x4'))['db'];var utils=require(_0x71c5('0x5'));var logger=require('../../config/logger')(_0x71c5('0x6'));var config=require(_0x71c5('0x7'));var jayson=require(_0x71c5('0x8'));var client=jayson[_0x71c5('0x9')][_0x71c5('0xa')]({'port':0x232a});config[_0x71c5('0xb')]=_[_0x71c5('0xc')](config['redis'],{'host':_0x71c5('0xd'),'port':0x18eb});var socket=require(_0x71c5('0xe'))(new Redis(config[_0x71c5('0xb')]));require(_0x71c5('0xf'))[_0x71c5('0x10')](socket);function respondWithRpcPromise(_0x562807,_0x2f2193,_0x4c2add){return new BPromise(function(_0x600169,_0x2eb548){return client[_0x71c5('0x11')](_0x562807,_0x4c2add)[_0x71c5('0x12')](function(_0x11b756){logger[_0x71c5('0x13')](_0x71c5('0x14'),_0x2f2193,_0x71c5('0x15'));logger[_0x71c5('0x16')](_0x71c5('0x17'),_0x2f2193,_0x71c5('0x15'),JSON[_0x71c5('0x18')](_0x11b756));if(_0x11b756[_0x71c5('0x19')]){if(_0x11b756['error'][_0x71c5('0x1a')]===0x1f4){logger['error'](_0x71c5('0x14'),_0x2f2193,_0x11b756[_0x71c5('0x19')][_0x71c5('0x1b')]);return _0x2eb548(_0x11b756[_0x71c5('0x19')]['message']);}logger[_0x71c5('0x19')](_0x71c5('0x14'),_0x2f2193,_0x11b756['error'][_0x71c5('0x1b')]);return _0x600169(_0x11b756['error']['message']);}else{logger[_0x71c5('0x13')](_0x71c5('0x14'),_0x2f2193,_0x71c5('0x15'));_0x600169(_0x11b756['result'][_0x71c5('0x1b')]);}})['catch'](function(_0x27f1a1){logger[_0x71c5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x2f2193,_0x27f1a1);_0x2eb548(_0x27f1a1);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 049b975..507f622 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 _0xb526=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x11b70e,_0x6a143d){var _0x33c8a1=function(_0x2cb22f){while(--_0x2cb22f){_0x11b70e['push'](_0x11b70e['shift']());}};_0x33c8a1(++_0x6a143d);}(_0xb526,0x170));var _0x6b52=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xb526[_0xca1f0e];return _0x35e4ef;};'use strict';var ChatWebsiteEvents=require(_0x6b52('0x0'));var events=[_0x6b52('0x1'),_0x6b52('0x2'),_0x6b52('0x3')];function createListener(_0x438d11,_0x4f9de0){return function(_0x191358){_0x4f9de0[_0x6b52('0x4')](_0x438d11,_0x191358);};}function removeListener(_0x3f8e28,_0x577379){return function(){ChatWebsiteEvents[_0x6b52('0x5')](_0x3f8e28,_0x577379);};}exports[_0x6b52('0x6')]=function(_0x5d0d4b){for(var _0x766b28=0x0,_0x2196f8=events[_0x6b52('0x7')];_0x766b28<_0x2196f8;_0x766b28++){var _0x37fb06=events[_0x766b28];var _0x45c1f8=createListener('chatWebsite:'+_0x37fb06,_0x5d0d4b);ChatWebsiteEvents['on'](_0x37fb06,_0x45c1f8);}}; \ No newline at end of file +var _0x565d=['update','emit','removeListener','register','length','./chatWebsite.events','save'];(function(_0x63de62,_0xe5cc89){var _0x3daddf=function(_0x2a5d79){while(--_0x2a5d79){_0x63de62['push'](_0x63de62['shift']());}};_0x3daddf(++_0xe5cc89);}(_0x565d,0xc9));var _0xd565=function(_0x4478d1,_0x4d7c0f){_0x4478d1=_0x4478d1-0x0;var _0x833119=_0x565d[_0x4478d1];return _0x833119;};'use strict';var ChatWebsiteEvents=require(_0xd565('0x0'));var events=[_0xd565('0x1'),'remove',_0xd565('0x2')];function createListener(_0x586786,_0x464cb5){return function(_0x2d2871){_0x464cb5[_0xd565('0x3')](_0x586786,_0x2d2871);};}function removeListener(_0x49a117,_0x516c14){return function(){ChatWebsiteEvents[_0xd565('0x4')](_0x49a117,_0x516c14);};}exports[_0xd565('0x5')]=function(_0x1da37a){for(var _0x16c144=0x0,_0xa3149c=events[_0xd565('0x6')];_0x16c144<_0xa3149c;_0x16c144++){var _0x166379=events[_0x16c144];var _0x4171d8=createListener('chatWebsite:'+_0x166379,_0x1da37a);ChatWebsiteEvents['on'](_0x166379,_0x4171d8);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ac19b33..f5ec731 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 _0x8b25=['/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','file','root','server/files/images/avatars/','addAvatar','/:id/customer_avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','/:id/offline','offline','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x8b25,0x77));var _0x58b2=function(_0x3ef79e,_0x24e73c){_0x3ef79e=_0x3ef79e-0x0;var _0x172304=_0x8b25[_0x3ef79e];return _0x172304;};'use strict';var multer=require(_0x58b2('0x0'));var util=require('util');var path=require(_0x58b2('0x1'));var timeout=require(_0x58b2('0x2'));var express=require('express');var router=express[_0x58b2('0x3')]();var fs_extra=require(_0x58b2('0x4'));var auth=require(_0x58b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x58b2('0x6'));var controller=require(_0x58b2('0x7'));router[_0x58b2('0x8')]('/',auth[_0x58b2('0x9')](),controller[_0x58b2('0xa')]);router['get'](_0x58b2('0xb'),auth['isAuthenticated'](),controller[_0x58b2('0xc')]);router[_0x58b2('0x8')](_0x58b2('0xd'),auth[_0x58b2('0x9')](),controller[_0x58b2('0xe')]);router[_0x58b2('0x8')](_0x58b2('0xf'),auth[_0x58b2('0x9')](),controller['getDispositions']);router[_0x58b2('0x8')]('/:id/canned_answers',auth[_0x58b2('0x9')](),controller['getAnswers']);router[_0x58b2('0x8')](_0x58b2('0x10'),controller[_0x58b2('0x11')]);router['get'](_0x58b2('0x12'),controller[_0x58b2('0x13')]);router[_0x58b2('0x8')]('/:id/customer_avatar',controller[_0x58b2('0x14')]);router[_0x58b2('0x8')](_0x58b2('0x15'),controller[_0x58b2('0x16')]);router['get'](_0x58b2('0x17'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x18')]);router['get'](_0x58b2('0x19'),controller[_0x58b2('0x1a')]);router[_0x58b2('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x58b2('0x1b')]);router[_0x58b2('0x8')](_0x58b2('0x1c'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x1d')]);router[_0x58b2('0x8')]('/:id/fields',controller[_0x58b2('0x1e')]);router[_0x58b2('0x8')](_0x58b2('0x1f'),auth['isAuthenticated'](),controller[_0x58b2('0x20')]);router[_0x58b2('0x8')](_0x58b2('0x21'),auth[_0x58b2('0x9')](),controller['getAgents']);router[_0x58b2('0x22')]('/',auth[_0x58b2('0x9')](),controller[_0x58b2('0x23')]);router[_0x58b2('0x22')](_0x58b2('0xf'),auth[_0x58b2('0x9')](),controller['addDisposition']);router[_0x58b2('0x22')](_0x58b2('0x24'),auth['isAuthenticated'](),controller[_0x58b2('0x25')]);var upload=multer({'storage':multer[_0x58b2('0x26')]({'destination':function(_0x1f8765,_0x2c31b4,_0x53af45){_0x53af45(null,path[_0x58b2('0x27')](config['root'],_0x58b2('0x28')));},'filename':function(_0x3e1e09,_0x403644,_0x33c1c5){_0x33c1c5(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date[_0x58b2('0x2b')](),_0x403644[_0x58b2('0x2c')]));}})});router[_0x58b2('0x22')](_0x58b2('0x10'),upload['single'](_0x58b2('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x58b2('0x26')]({'destination':function(_0x2cf392,_0x22bfcf,_0x7a696e){_0x7a696e(null,path[_0x58b2('0x27')](config[_0x58b2('0x2e')],_0x58b2('0x2f')));},'filename':function(_0x942851,_0x2006d4,_0x4f49f0){_0x4f49f0(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date[_0x58b2('0x2b')](),_0x2006d4[_0x58b2('0x2c')]));}})});router[_0x58b2('0x22')](_0x58b2('0x12'),upload['single'](_0x58b2('0x2d')),controller[_0x58b2('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x384305,_0x30fd26,_0x1adf1c){_0x1adf1c(null,path[_0x58b2('0x27')](config[_0x58b2('0x2e')],_0x58b2('0x2f')));},'filename':function(_0x1b9716,_0x372808,_0x82f724){_0x82f724(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date['now'](),_0x372808['originalname']));}})});router[_0x58b2('0x22')](_0x58b2('0x31'),upload[_0x58b2('0x32')]('file'),controller[_0x58b2('0x33')]);var upload=multer({'storage':multer[_0x58b2('0x26')]({'destination':function(_0x58f058,_0x517319,_0x114218){_0x114218(null,path['join'](config[_0x58b2('0x2e')],_0x58b2('0x2f')));},'filename':function(_0x2913f8,_0x53e1cb,_0x3916c5){_0x3916c5(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date[_0x58b2('0x2b')](),_0x53e1cb[_0x58b2('0x2c')]));}})});router['post'](_0x58b2('0x15'),upload[_0x58b2('0x32')]('file'),controller[_0x58b2('0x34')]);router[_0x58b2('0x22')](_0x58b2('0x35'),controller[_0x58b2('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0xcec58a,_0x21d01c,_0x111113){const _0x5d92ae=path['join'](config[_0x58b2('0x2e')],_0x58b2('0x37'),_0x58b2('0x38'),_0x58b2('0x39'));fs_extra['ensureDir'](_0x5d92ae,function(){_0x111113(null,_0x5d92ae);});},'filename':function(_0x1dee20,_0x15b92e,_0x4fff39){const _0x4e2082=_0x15b92e['originalname'][_0x58b2('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x38991d=path['extname'](_0x4e2082);const _0x20a913=Date['now']()+'-'+_0x4e2082[_0x58b2('0x3a')](_0x38991d,'')+_0x38991d;_0x4fff39(null,_0x20a913);}})});router['post'](_0x58b2('0x3b'),offlineUploadMulter['any'](),controller[_0x58b2('0x3c')]);router['post'](_0x58b2('0x17'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x3d')]);router[_0x58b2('0x22')](_0x58b2('0x3e'),auth[_0x58b2('0x9')](),controller['addApplications']);router['post'](_0x58b2('0x1c'),auth['isAuthenticated'](),controller[_0x58b2('0x3f')]);router[_0x58b2('0x22')](_0x58b2('0x21'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x40')]);router[_0x58b2('0x41')](_0x58b2('0xd'),auth['isAuthenticated'](),controller[_0x58b2('0x42')]);router[_0x58b2('0x43')](_0x58b2('0xd'),auth[_0x58b2('0x9')](),controller['destroy']);router['delete'](_0x58b2('0xf'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x44')]);router[_0x58b2('0x43')](_0x58b2('0x24'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x45')]);router[_0x58b2('0x43')](_0x58b2('0x21'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x46')]);module[_0x58b2('0x47')]=router; \ No newline at end of file +var _0x4220=['put','delete','destroy','removeDispositions','removeAnswers','exports','multer','connect-timeout','express','Router','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','addAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions'];(function(_0x25ff12,_0x2d0522){var _0x428ce4=function(_0xc214fd){while(--_0xc214fd){_0x25ff12['push'](_0x25ff12['shift']());}};_0x428ce4(++_0x2d0522);}(_0x4220,0xde));var _0x0422=function(_0x62d10c,_0x563e59){_0x62d10c=_0x62d10c-0x0;var _0x338a0c=_0x4220[_0x62d10c];return _0x338a0c;};'use strict';var multer=require(_0x0422('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0422('0x1'));var express=require(_0x0422('0x2'));var router=express[_0x0422('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0422('0x4'));var controller=require(_0x0422('0x5'));router[_0x0422('0x6')]('/',auth[_0x0422('0x7')](),controller[_0x0422('0x8')]);router[_0x0422('0x6')](_0x0422('0x9'),auth[_0x0422('0x7')](),controller[_0x0422('0xa')]);router['get'](_0x0422('0xb'),auth[_0x0422('0x7')](),controller['show']);router[_0x0422('0x6')](_0x0422('0xc'),auth['isAuthenticated'](),controller[_0x0422('0xd')]);router[_0x0422('0x6')](_0x0422('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x0422('0x6')](_0x0422('0xf'),controller[_0x0422('0x10')]);router['get'](_0x0422('0x11'),controller[_0x0422('0x12')]);router[_0x0422('0x6')](_0x0422('0x13'),controller[_0x0422('0x14')]);router['get'](_0x0422('0x15'),controller[_0x0422('0x16')]);router['get'](_0x0422('0x17'),auth[_0x0422('0x7')](),controller[_0x0422('0x18')]);router[_0x0422('0x6')](_0x0422('0x19'),controller[_0x0422('0x1a')]);router[_0x0422('0x6')]('/:id/applications',auth[_0x0422('0x7')](),controller[_0x0422('0x1b')]);router[_0x0422('0x6')]('/:id/proactive_actions',auth[_0x0422('0x7')](),controller[_0x0422('0x1c')]);router[_0x0422('0x6')]('/:id/fields',controller[_0x0422('0x1d')]);router['get'](_0x0422('0x1e'),auth[_0x0422('0x7')](),controller[_0x0422('0x1f')]);router[_0x0422('0x6')](_0x0422('0x20'),auth[_0x0422('0x7')](),controller['getAgents']);router[_0x0422('0x21')]('/',auth[_0x0422('0x7')](),controller['create']);router['post'](_0x0422('0xc'),auth[_0x0422('0x7')](),controller[_0x0422('0x22')]);router[_0x0422('0x21')](_0x0422('0xe'),auth['isAuthenticated'](),controller[_0x0422('0x23')]);var upload=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x344709,_0x15454b,_0x5c202a){_0x5c202a(null,path[_0x0422('0x25')](config[_0x0422('0x26')],_0x0422('0x27')));},'filename':function(_0x1ca6bf,_0x14caf4,_0x53496a){_0x53496a(null,util[_0x0422('0x28')](_0x0422('0x29'),Date[_0x0422('0x2a')](),_0x14caf4[_0x0422('0x2b')]));}})});router[_0x0422('0x21')]('/:id/logo',upload[_0x0422('0x2c')](_0x0422('0x2d')),controller[_0x0422('0x2e')]);var upload=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x4b414e,_0x4db660,_0x406a24){_0x406a24(null,path[_0x0422('0x25')](config[_0x0422('0x26')],'server/files/images/avatars/'));},'filename':function(_0x5d1db3,_0x5bb631,_0x89593a){_0x89593a(null,util[_0x0422('0x28')](_0x0422('0x29'),Date[_0x0422('0x2a')](),_0x5bb631[_0x0422('0x2b')]));}})});router[_0x0422('0x21')]('/:id/avatar',upload['single'](_0x0422('0x2d')),controller[_0x0422('0x2f')]);var upload=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x3ea73f,_0xc48748,_0x131da4){_0x131da4(null,path[_0x0422('0x25')](config[_0x0422('0x26')],_0x0422('0x30')));},'filename':function(_0x78915a,_0x4d77e1,_0x29d6d6){_0x29d6d6(null,util[_0x0422('0x28')](_0x0422('0x29'),Date['now'](),_0x4d77e1['originalname']));}})});router['post']('/:id/customer_avatar',upload['single'](_0x0422('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38025a,_0xd07962,_0x21df8b){_0x21df8b(null,path[_0x0422('0x25')](config['root'],_0x0422('0x30')));},'filename':function(_0x13869f,_0x2e8bd0,_0x337395){_0x337395(null,util[_0x0422('0x28')](_0x0422('0x29'),Date[_0x0422('0x2a')](),_0x2e8bd0[_0x0422('0x2b')]));}})});router[_0x0422('0x21')](_0x0422('0x15'),upload[_0x0422('0x2c')](_0x0422('0x2d')),controller[_0x0422('0x31')]);router[_0x0422('0x21')](_0x0422('0x32'),controller[_0x0422('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x2a118b,_0x4e5d35,_0x23c6b4){const _0x2f5658=path[_0x0422('0x25')](config[_0x0422('0x26')],_0x0422('0x34'),_0x0422('0x35'),_0x0422('0x36'));fs_extra[_0x0422('0x37')](_0x2f5658,function(){_0x23c6b4(null,_0x2f5658);});},'filename':function(_0x284b7a,_0x51de32,_0x3b79b2){const _0x4617cb=_0x51de32[_0x0422('0x2b')][_0x0422('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x25a5bc=path[_0x0422('0x39')](_0x4617cb);const _0x1b250e=Date['now']()+'-'+_0x4617cb[_0x0422('0x38')](_0x25a5bc,'')+_0x25a5bc;_0x3b79b2(null,_0x1b250e);}})});router[_0x0422('0x21')](_0x0422('0x3a'),offlineUploadMulter[_0x0422('0x3b')](),controller[_0x0422('0x3c')]);router[_0x0422('0x21')](_0x0422('0x17'),auth['isAuthenticated'](),controller[_0x0422('0x3d')]);router[_0x0422('0x21')](_0x0422('0x3e'),auth['isAuthenticated'](),controller[_0x0422('0x3f')]);router['post'](_0x0422('0x40'),auth['isAuthenticated'](),controller[_0x0422('0x41')]);router[_0x0422('0x21')](_0x0422('0x20'),auth[_0x0422('0x7')](),controller['addAgents']);router[_0x0422('0x42')](_0x0422('0xb'),auth[_0x0422('0x7')](),controller['update']);router[_0x0422('0x43')](_0x0422('0xb'),auth['isAuthenticated'](),controller[_0x0422('0x44')]);router[_0x0422('0x43')](_0x0422('0xc'),auth[_0x0422('0x7')](),controller[_0x0422('0x45')]);router[_0x0422('0x43')](_0x0422('0xe'),auth[_0x0422('0x7')](),controller[_0x0422('0x46')]);router[_0x0422('0x43')](_0x0422('0x20'),auth[_0x0422('0x7')](),controller['removeAgents']);module[_0x0422('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 50f414e..160ca3a 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 _0x0a10=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../config/environment','Router','env','production','app'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0a10,0x174));var _0x00a1=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0x0a10[_0x1d29f6];return _0x491093;};var beaverLogger=require('beaver-logger/server');var express=require(_0x00a1('0x0'));var auth=require('../components/auth/service');var config=require(_0x00a1('0x1'));var router=express[_0x00a1('0x2')]();var isProduction=config[_0x00a1('0x3')]===_0x00a1('0x4')||![];function clientSideLogs(_0x2208c2,_0x341b88,_0x2b6fd3){var _0x45f26b=_0x2208c2[_0x00a1('0x5')][_0x00a1('0x6')](_0x00a1('0x7'));if(!_0x45f26b){throw new Error(_0x00a1('0x8'));}return beaverLogger[_0x00a1('0x9')]({'uri':_0x00a1('0xa'),'logger':_0x45f26b,'enableCors':!isProduction})(_0x2208c2,_0x341b88,_0x2b6fd3);}router[_0x00a1('0xb')](auth[_0x00a1('0xc')](),clientSideLogs);module[_0x00a1('0xd')]=router; \ No newline at end of file +var _0x5784=['Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','production','app','get','client-side-logger'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x5784,0x10c));var _0x4578=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5784[_0x59ee6f];return _0x4c0979;};var beaverLogger=require(_0x4578('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x4578('0x1'));var router=express[_0x4578('0x2')]();var isProduction=config[_0x4578('0x3')]===_0x4578('0x4')||![];function clientSideLogs(_0x32b7cd,_0x1beb3a,_0x3e82a5){var _0x3e2897=_0x32b7cd[_0x4578('0x5')][_0x4578('0x6')](_0x4578('0x7'));if(!_0x3e2897){throw new Error(_0x4578('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x4578('0x9'),'logger':_0x3e2897,'enableCors':!isProduction})(_0x32b7cd,_0x1beb3a,_0x3e82a5);}router['use'](auth[_0x4578('0xa')](),clientSideLogs);module[_0x4578('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index cfac6fb..350e86b 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 _0x43e0=['AmazonAWS','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM'];(function(_0x9f53db,_0x7b3878){var _0x407025=function(_0x24c908){while(--_0x24c908){_0x9f53db['push'](_0x9f53db['shift']());}};_0x407025(++_0x7b3878);}(_0x43e0,0x6b));var _0x043e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x43e0[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0x043e('0x0')]={'name':{'type':Sequelize[_0x043e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x043e('0x2')](_0x043e('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x043e('0x2')]('Outlook365',_0x043e('0x4'))},'data1':{'type':Sequelize[_0x043e('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x043e('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x043e('0x1')],'comment':_0x043e('0x5')},'data4':{'type':Sequelize[_0x043e('0x1')],'comment':_0x043e('0x6')},'data5':{'type':Sequelize[_0x043e('0x7')],'comment':_0x043e('0x8')},'data6':{'type':Sequelize['TEXT'],'comment':_0x043e('0x9')},'data7':{'type':Sequelize[_0x043e('0x7')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xd033=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','AmazonAWS','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x62ff30,_0x131488){var _0x5f5904=function(_0x5bded9){while(--_0x5bded9){_0x62ff30['push'](_0x62ff30['shift']());}};_0x5f5904(++_0x131488);}(_0xd033,0x16d));var _0x3d03=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xd033[_0x2becba];return _0x90b5dd;};'use strict';var Sequelize=require(_0x3d03('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d03('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x3d03('0x2'),'Google',_0x3d03('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3d03('0x4')](_0x3d03('0x5'),_0x3d03('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x3d03('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x3d03('0x8')},'data3':{'type':Sequelize[_0x3d03('0x1')],'comment':_0x3d03('0x9')},'data4':{'type':Sequelize[_0x3d03('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x3d03('0xa')],'comment':_0x3d03('0xb')},'data6':{'type':Sequelize[_0x3d03('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x3d03('0xa')],'comment':_0x3d03('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index b00f203..5df8cd8 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 _0x7c7a=['decryptString','data3','show','MicrosoftAzure','includes','join','body','encryptString','catch','update','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','parse','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','then','destroy','error','stack','name','send','padEnd','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','service'];(function(_0x410ff6,_0x4b4011){var _0x32cb57=function(_0x467876){while(--_0x467876){_0x410ff6['push'](_0x410ff6['shift']());}};_0x32cb57(++_0x4b4011);}(_0x7c7a,0x184));var _0xa7c7=function(_0x460851,_0x1b333e){_0x460851=_0x460851-0x0;var _0x2a1c04=_0x7c7a[_0x460851];return _0x2a1c04;};'use strict';var _=require(_0xa7c7('0x0'));var Redis=require(_0xa7c7('0x1'));var qs=require(_0xa7c7('0x2'));var encryptor=require(_0xa7c7('0x3'));var config=require(_0xa7c7('0x4'));var logger=require('../../config/logger')(_0xa7c7('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xa7c7('0x6'));config[_0xa7c7('0x7')]=_[_0xa7c7('0x8')](config[_0xa7c7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c7('0x9'))(new Redis(config[_0xa7c7('0x7')]));var redis=new Redis(config[_0xa7c7('0x7')]);function respondWithStatusCode(_0x8a0f49,_0x594ce5){_0x594ce5=_0x594ce5||0xcc;return function(_0xe290fd){if(_0xe290fd){return _0x8a0f49[_0xa7c7('0xa')](_0x594ce5);}return _0x8a0f49[_0xa7c7('0xb')](_0x594ce5)[_0xa7c7('0xc')]();};}function respondWithResult(_0x369700,_0xa0e408){_0xa0e408=_0xa0e408||0xc8;return function(_0x53a120){if(_0x53a120){return _0x369700[_0xa7c7('0xb')](_0xa0e408)[_0xa7c7('0xd')](_0x53a120);}};}function respondWithFilteredResult(_0xe0cc56,_0x22063a){return function(_0x2c51d0){if(_0x2c51d0){var _0x33ba17=typeof _0x22063a[_0xa7c7('0xe')]===_0xa7c7('0xf')&&typeof _0x22063a['limit']===_0xa7c7('0xf');var _0x3493a2=_0x2c51d0[_0xa7c7('0x10')];var _0x3fa940=_0x33ba17?0x0:_0x22063a['offset'];var _0x410f0d=_0x33ba17?_0x2c51d0['count']:_0x22063a[_0xa7c7('0xe')]+_0x22063a[_0xa7c7('0x11')];var _0x531ed9;if(_0x410f0d>=_0x3493a2){_0x410f0d=_0x3493a2;_0x531ed9=0xc8;}else{_0x531ed9=0xce;}_0xe0cc56[_0xa7c7('0xb')](_0x531ed9);return _0xe0cc56['set'](_0xa7c7('0x12'),_0x3fa940+'-'+_0x410f0d+'/'+_0x3493a2)[_0xa7c7('0xd')](_0x2c51d0);}return null;};}function saveUpdates(_0x197394){return function(_0x3b2f0e){if(_0x3b2f0e){return _0x3b2f0e['update'](_0x197394)[_0xa7c7('0x13')](function(_0x4ee588){return _0x4ee588;});}return null;};}function removeEntity(_0x429d96){return function(_0x9bb775){if(_0x9bb775){return _0x9bb775[_0xa7c7('0x14')]()[_0xa7c7('0x13')](function(){_0x429d96['status'](0xcc)[_0xa7c7('0xc')]();});}};}function handleEntityNotFound(_0x50a733){return function(_0x3123ee){if(!_0x3123ee){_0x50a733[_0xa7c7('0xa')](0x194);}return _0x3123ee;};}function handleError(_0x126f05,_0x472891){_0x472891=_0x472891||0x1f4;return function(_0x1df083){logger[_0xa7c7('0x15')](_0x1df083[_0xa7c7('0x16')]);if(_0x1df083[_0xa7c7('0x17')]){delete _0x1df083[_0xa7c7('0x17')];}_0x126f05[_0xa7c7('0xb')](_0x472891)[_0xa7c7('0x18')](_0x1df083);};}function maskClientSecret(_0x8c96a5){return _[_0xa7c7('0x19')](_0x8c96a5['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0xe4741f,_0x3358e4){var _0x583c22={},_0x50e4fa={},_0x4fb095={'count':0x0,'rows':[]};var _0x2e862d=_[_0xa7c7('0x1a')](db['CloudProvider'][_0xa7c7('0x1b')],function(_0x4266b9){return{'name':_0x4266b9['fieldName'],'type':_0x4266b9[_0xa7c7('0x1c')][_0xa7c7('0x1d')]};});_0x50e4fa[_0xa7c7('0x1e')]=_['map'](_0x2e862d,'name');_0x50e4fa[_0xa7c7('0x1f')]=_[_0xa7c7('0x20')](_0xe4741f[_0xa7c7('0x1f')]);_0x50e4fa[_0xa7c7('0x21')]=_[_0xa7c7('0x22')](_0x50e4fa[_0xa7c7('0x1e')],_0x50e4fa['query']);_0x583c22[_0xa7c7('0x23')]=_[_0xa7c7('0x22')](_0x50e4fa[_0xa7c7('0x1e')],qs[_0xa7c7('0x24')](_0xe4741f['query']['fields']));_0x583c22[_0xa7c7('0x23')]=_0x583c22[_0xa7c7('0x23')][_0xa7c7('0x25')]?_0x583c22[_0xa7c7('0x23')]:_0x50e4fa[_0xa7c7('0x1e')];if(!_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0x26')]('nolimit')){_0x583c22[_0xa7c7('0x11')]=qs[_0xa7c7('0x11')](_0xe4741f['query'][_0xa7c7('0x11')]);_0x583c22[_0xa7c7('0xe')]=qs[_0xa7c7('0xe')](_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0xe')]);}_0x583c22[_0xa7c7('0x27')]=qs[_0xa7c7('0x28')](_0xe4741f['query'][_0xa7c7('0x28')]);_0x583c22[_0xa7c7('0x29')]=qs[_0xa7c7('0x21')](_[_0xa7c7('0x2a')](_0xe4741f['query'],_0x50e4fa['filters']),_0x2e862d);if(_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0x2b')]){_0x583c22['where']=_[_0xa7c7('0x2c')](_0x583c22[_0xa7c7('0x29')],{'$or':_['map'](_0x2e862d,function(_0x153ae2){if(_0x153ae2[_0xa7c7('0x1c')]!==_0xa7c7('0x2d')){var _0x273c1e={};_0x273c1e[_0x153ae2[_0xa7c7('0x17')]]={'$like':'%'+_0xe4741f['query'][_0xa7c7('0x2b')]+'%'};return _0x273c1e;}})});}_0x583c22=_['merge']({},_0x583c22,_0xe4741f[_0xa7c7('0x2e')]);var _0x141b2e={'where':_0x583c22[_0xa7c7('0x29')]};return db[_0xa7c7('0x2f')][_0xa7c7('0x10')](_0x141b2e)[_0xa7c7('0x13')](function(_0x261db9){_0x4fb095[_0xa7c7('0x10')]=_0x261db9;if(_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0x30')]){_0x583c22[_0xa7c7('0x31')]=[{'all':!![]}];}return db[_0xa7c7('0x2f')][_0xa7c7('0x32')](_0x583c22);})[_0xa7c7('0x13')](function(_0x5d5d1e){_0x4fb095['rows']=_[_0xa7c7('0x1a')](_0x5d5d1e,function(_0x5cc27a){if(_0x5cc27a[_0xa7c7('0x33')]==='MicrosoftAzure'){var _0x55ccb6=encryptor[_0xa7c7('0x34')](_0x5cc27a[_0xa7c7('0x35')]);_0x5cc27a[_0xa7c7('0x35')]=maskClientSecret(_0x55ccb6);}return _0x5cc27a;});return _0x4fb095;})[_0xa7c7('0x13')](respondWithFilteredResult(_0x3358e4,_0x583c22))['catch'](handleError(_0x3358e4,null));};exports[_0xa7c7('0x36')]=function(_0x27d7b7,_0x94b5a4){var _0x55e83c={'raw':!![],'where':{'id':_0x27d7b7['params']['id']}},_0xfce3c0={};_0xfce3c0[_0xa7c7('0x1e')]=_[_0xa7c7('0x20')](db[_0xa7c7('0x2f')][_0xa7c7('0x1b')]);_0xfce3c0['query']=_['keys'](_0x27d7b7['query']);_0xfce3c0[_0xa7c7('0x21')]=_[_0xa7c7('0x22')](_0xfce3c0[_0xa7c7('0x1e')],_0xfce3c0[_0xa7c7('0x1f')]);_0x55e83c[_0xa7c7('0x23')]=_[_0xa7c7('0x22')](_0xfce3c0[_0xa7c7('0x1e')],qs['fields'](_0x27d7b7['query'][_0xa7c7('0x24')]));_0x55e83c['attributes']=_0x55e83c[_0xa7c7('0x23')][_0xa7c7('0x25')]?_0x55e83c[_0xa7c7('0x23')]:_0xfce3c0['model'];if(_0x27d7b7[_0xa7c7('0x1f')][_0xa7c7('0x30')]){_0x55e83c[_0xa7c7('0x31')]=[{'all':!![]}];}_0x55e83c=_[_0xa7c7('0x2c')]({},_0x55e83c,_0x27d7b7['options']);return db[_0xa7c7('0x2f')]['find'](_0x55e83c)['then'](handleEntityNotFound(_0x94b5a4,null))['then'](function(_0x3a271f){if(_0x3a271f[_0xa7c7('0x33')]===_0xa7c7('0x37')){var _0x1b235e=encryptor[_0xa7c7('0x34')](_0x3a271f[_0xa7c7('0x35')]);_0x3a271f[_0xa7c7('0x35')]=maskClientSecret(_0x1b235e);}return _0x3a271f;})['then'](respondWithResult(_0x94b5a4,null))['catch'](handleError(_0x94b5a4,null));};exports['create']=function(_0x27f553,_0x385bab){if(!_0x27f553['body'][_0xa7c7('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x27f553['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x50c121=db[_0xa7c7('0x2f')][_0xa7c7('0x1b')][_0xa7c7('0x33')]['values'];if(!_0x50c121[_0xa7c7('0x38')](_0x27f553['body'][_0xa7c7('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x50c121[_0xa7c7('0x39')](',\x20'));if(_0x27f553[_0xa7c7('0x3a')][_0xa7c7('0x33')]===_0xa7c7('0x37')&&_0x27f553[_0xa7c7('0x3a')][_0xa7c7('0x35')]){_0x27f553[_0xa7c7('0x3a')][_0xa7c7('0x35')]=encryptor[_0xa7c7('0x3b')](_0x27f553[_0xa7c7('0x3a')]['data3']);}return db['CloudProvider']['create'](_0x27f553[_0xa7c7('0x3a')],{})['then'](respondWithResult(_0x385bab,0xc9))[_0xa7c7('0x3c')](handleError(_0x385bab,null));};exports[_0xa7c7('0x3d')]=function(_0x55d165,_0x277cca){if(_0x55d165[_0xa7c7('0x3a')]['id']){delete _0x55d165[_0xa7c7('0x3a')]['id'];}return db['CloudProvider'][_0xa7c7('0x3e')]({'where':{'id':_0x55d165['params']['id']}})[_0xa7c7('0x13')](handleEntityNotFound(_0x277cca,null))[_0xa7c7('0x13')](function(_0x4d5df3){if(_0x4d5df3['service']===_0xa7c7('0x37')&&_0x55d165[_0xa7c7('0x3a')]['data3']){_0x55d165[_0xa7c7('0x3a')][_0xa7c7('0x35')]=encryptor[_0xa7c7('0x3b')](_0x55d165[_0xa7c7('0x3a')][_0xa7c7('0x35')]);}return _0x4d5df3;})['then'](saveUpdates(_0x55d165['body'],null))[_0xa7c7('0x13')](respondWithResult(_0x277cca,null))[_0xa7c7('0x3c')](handleError(_0x277cca,null));};exports[_0xa7c7('0x14')]=function(_0x2feba2,_0x37b039){return db[_0xa7c7('0x2f')][_0xa7c7('0x3e')]({'where':{'id':_0x2feba2['params']['id']}})[_0xa7c7('0x13')](handleEntityNotFound(_0x37b039,null))[_0xa7c7('0x13')](removeEntity(_0x37b039,null))['catch'](handleError(_0x37b039,null));};exports[_0xa7c7('0x3f')]=function(_0x5d0be6,_0x16ac4f){return db[_0xa7c7('0x2f')][_0xa7c7('0x40')]({'where':{'id':_0x5d0be6['params']['id']},'raw':!![]})[_0xa7c7('0x13')](function(_0x2a9d02){if(!_0x2a9d02)return _0x16ac4f['sendStatus'](0x194);return{'url':oauth[_0xa7c7('0x41')](_0x2a9d02,_0x5d0be6['user']['id'])};})['then'](respondWithResult(_0x16ac4f,null))[_0xa7c7('0x3c')](handleError(_0x16ac4f,null));};exports[_0xa7c7('0x42')]=function(_0x11a191,_0x4fbd1c){var _0x311792=_0x11a191[_0xa7c7('0x3a')];var _0xacb7c5;var _0x552c2b;if(_0x311792[_0xa7c7('0x15')])throw _0x311792;redis[_0xa7c7('0x43')](_0x311792[_0xa7c7('0x44')])['then'](function(_0x4e6bf7){if(!_0x4e6bf7)throw new Error('Invalid\x20state\x20parameter');_0xacb7c5=JSON[_0xa7c7('0x45')](_0x4e6bf7);var _0x4ad845=Buffer['from'](_0x311792[_0xa7c7('0x44')],_0xa7c7('0x46'))['toString'](_0xa7c7('0x47'));_0x552c2b=JSON[_0xa7c7('0x45')](_0x4ad845);if(!oauth[_0xa7c7('0x48')](_0x311792[_0xa7c7('0x49')],_0xacb7c5[_0xa7c7('0x4a')]))throw new Error(_0xa7c7('0x4b'));redis[_0xa7c7('0x4c')](_0x311792[_0xa7c7('0x44')]);return oauth[_0xa7c7('0x4d')](_0x311792[_0xa7c7('0x4e')],_0xacb7c5);})[_0xa7c7('0x13')](function(_0x1e83b1){_0xacb7c5[_0xa7c7('0x4f')]=_0x1e83b1[_0xa7c7('0x50')];_0xacb7c5[_0xa7c7('0x51')]=_0x1e83b1[_0xa7c7('0x52')];return db[_0xa7c7('0x2f')][_0xa7c7('0x3d')]({'data5':_0xacb7c5[_0xa7c7('0x4f')],'data6':_0xacb7c5[_0xa7c7('0x51')]},{'where':{'id':_0xacb7c5['id']}});})['then'](function(){oauth[_0xa7c7('0x53')](_0xacb7c5);socket[_0xa7c7('0x54')]('microsoftAuthorization:success',{'id':_0x552c2b['id']});return;})['then'](respondWithStatusCode(_0x4fbd1c,null))[_0xa7c7('0x3c')](function(_0x197ff9){if(_0x552c2b){socket[_0xa7c7('0x54')]('microsoftAuthorization:error',{'id':_0x552c2b['id']});}if(!_0xacb7c5){logger[_0xa7c7('0x15')](_0xa7c7('0x55'),_0x197ff9);return _0x4fbd1c[_0xa7c7('0xb')](0x1f4)[_0xa7c7('0x18')](_0x197ff9['message']);}logger[_0xa7c7('0x15')](_0xa7c7('0x56'),_0xacb7c5['id'],JSON[_0xa7c7('0x57')](_0x197ff9));});}; \ No newline at end of file +var _0xe800=['service','MicrosoftAzure','decryptString','data3','show','keys','rawAttributes','length','find','catch','create','body','Name\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','from','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','error','name','send','padEnd','slice','index','map','CloudProvider','key','model','query','filters','intersection','fields','attributes','nolimit','order','where','filter','merge','type','options','includeAll','include','findAll','rows'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0xe800,0x1e7));var _0x0e80=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xe800[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x0e80('0x0'));var Redis=require(_0x0e80('0x1'));var qs=require(_0x0e80('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x0e80('0x3'));var logger=require(_0x0e80('0x4'))(_0x0e80('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x0e80('0x6'));config[_0x0e80('0x7')]=_[_0x0e80('0x8')](config['redis'],{'host':_0x0e80('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x0e80('0x7')]);function respondWithStatusCode(_0x1f196e,_0x566df9){_0x566df9=_0x566df9||0xcc;return function(_0x2f9fee){if(_0x2f9fee){return _0x1f196e['sendStatus'](_0x566df9);}return _0x1f196e['status'](_0x566df9)[_0x0e80('0xa')]();};}function respondWithResult(_0x4141da,_0x4aab11){_0x4aab11=_0x4aab11||0xc8;return function(_0x121f31){if(_0x121f31){return _0x4141da['status'](_0x4aab11)[_0x0e80('0xb')](_0x121f31);}};}function respondWithFilteredResult(_0x2882a6,_0x3f9fb8){return function(_0x11eff5){if(_0x11eff5){var _0x5d2159=typeof _0x3f9fb8[_0x0e80('0xc')]===_0x0e80('0xd')&&typeof _0x3f9fb8[_0x0e80('0xe')]===_0x0e80('0xd');var _0x401dfc=_0x11eff5[_0x0e80('0xf')];var _0x5ebf43=_0x5d2159?0x0:_0x3f9fb8[_0x0e80('0xc')];var _0x368654=_0x5d2159?_0x11eff5['count']:_0x3f9fb8[_0x0e80('0xc')]+_0x3f9fb8[_0x0e80('0xe')];var _0x8d4492;if(_0x368654>=_0x401dfc){_0x368654=_0x401dfc;_0x8d4492=0xc8;}else{_0x8d4492=0xce;}_0x2882a6[_0x0e80('0x10')](_0x8d4492);return _0x2882a6[_0x0e80('0x11')](_0x0e80('0x12'),_0x5ebf43+'-'+_0x368654+'/'+_0x401dfc)[_0x0e80('0xb')](_0x11eff5);}return null;};}function saveUpdates(_0x43e74b){return function(_0x3c8f67){if(_0x3c8f67){return _0x3c8f67[_0x0e80('0x13')](_0x43e74b)[_0x0e80('0x14')](function(_0x56116f){return _0x56116f;});}return null;};}function removeEntity(_0x17064f){return function(_0x3c96ce){if(_0x3c96ce){return _0x3c96ce['destroy']()[_0x0e80('0x14')](function(){_0x17064f['status'](0xcc)[_0x0e80('0xa')]();});}};}function handleEntityNotFound(_0x58ce94){return function(_0x44b191){if(!_0x44b191){_0x58ce94['sendStatus'](0x194);}return _0x44b191;};}function handleError(_0x5cf301,_0xfaf502){_0xfaf502=_0xfaf502||0x1f4;return function(_0x16c5dd){logger[_0x0e80('0x15')](_0x16c5dd['stack']);if(_0x16c5dd[_0x0e80('0x16')]){delete _0x16c5dd[_0x0e80('0x16')];}_0x5cf301[_0x0e80('0x10')](_0xfaf502)[_0x0e80('0x17')](_0x16c5dd);};}function maskClientSecret(_0x14c245){return _[_0x0e80('0x18')](_0x14c245[_0x0e80('0x19')](0x0,0x3),0x14,'*');}exports[_0x0e80('0x1a')]=function(_0xb8cde,_0x34fbce){var _0x2f6969={},_0x1285a8={},_0xfb2cc8={'count':0x0,'rows':[]};var _0x4cdfcb=_[_0x0e80('0x1b')](db[_0x0e80('0x1c')]['rawAttributes'],function(_0x4046b0){return{'name':_0x4046b0['fieldName'],'type':_0x4046b0['type'][_0x0e80('0x1d')]};});_0x1285a8[_0x0e80('0x1e')]=_[_0x0e80('0x1b')](_0x4cdfcb,_0x0e80('0x16'));_0x1285a8[_0x0e80('0x1f')]=_['keys'](_0xb8cde[_0x0e80('0x1f')]);_0x1285a8[_0x0e80('0x20')]=_[_0x0e80('0x21')](_0x1285a8[_0x0e80('0x1e')],_0x1285a8[_0x0e80('0x1f')]);_0x2f6969['attributes']=_[_0x0e80('0x21')](_0x1285a8[_0x0e80('0x1e')],qs[_0x0e80('0x22')](_0xb8cde['query'][_0x0e80('0x22')]));_0x2f6969['attributes']=_0x2f6969[_0x0e80('0x23')]['length']?_0x2f6969[_0x0e80('0x23')]:_0x1285a8[_0x0e80('0x1e')];if(!_0xb8cde[_0x0e80('0x1f')]['hasOwnProperty'](_0x0e80('0x24'))){_0x2f6969[_0x0e80('0xe')]=qs[_0x0e80('0xe')](_0xb8cde[_0x0e80('0x1f')][_0x0e80('0xe')]);_0x2f6969[_0x0e80('0xc')]=qs[_0x0e80('0xc')](_0xb8cde[_0x0e80('0x1f')][_0x0e80('0xc')]);}_0x2f6969[_0x0e80('0x25')]=qs['sort'](_0xb8cde[_0x0e80('0x1f')]['sort']);_0x2f6969[_0x0e80('0x26')]=qs[_0x0e80('0x20')](_['pick'](_0xb8cde[_0x0e80('0x1f')],_0x1285a8['filters']),_0x4cdfcb);if(_0xb8cde['query'][_0x0e80('0x27')]){_0x2f6969[_0x0e80('0x26')]=_[_0x0e80('0x28')](_0x2f6969[_0x0e80('0x26')],{'$or':_[_0x0e80('0x1b')](_0x4cdfcb,function(_0x4dc03d){if(_0x4dc03d[_0x0e80('0x29')]!=='VIRTUAL'){var _0x2369b4={};_0x2369b4[_0x4dc03d[_0x0e80('0x16')]]={'$like':'%'+_0xb8cde['query'][_0x0e80('0x27')]+'%'};return _0x2369b4;}})});}_0x2f6969=_['merge']({},_0x2f6969,_0xb8cde[_0x0e80('0x2a')]);var _0x141e54={'where':_0x2f6969['where']};return db['CloudProvider'][_0x0e80('0xf')](_0x141e54)[_0x0e80('0x14')](function(_0x229206){_0xfb2cc8['count']=_0x229206;if(_0xb8cde[_0x0e80('0x1f')][_0x0e80('0x2b')]){_0x2f6969[_0x0e80('0x2c')]=[{'all':!![]}];}return db['CloudProvider'][_0x0e80('0x2d')](_0x2f6969);})[_0x0e80('0x14')](function(_0x1aea88){_0xfb2cc8[_0x0e80('0x2e')]=_['map'](_0x1aea88,function(_0x5e1cd2){if(_0x5e1cd2[_0x0e80('0x2f')]===_0x0e80('0x30')){var _0x26f315=encryptor[_0x0e80('0x31')](_0x5e1cd2['data3']);_0x5e1cd2[_0x0e80('0x32')]=maskClientSecret(_0x26f315);}return _0x5e1cd2;});return _0xfb2cc8;})[_0x0e80('0x14')](respondWithFilteredResult(_0x34fbce,_0x2f6969))['catch'](handleError(_0x34fbce,null));};exports[_0x0e80('0x33')]=function(_0x366abf,_0x3a4e8e){var _0x298ccb={'raw':!![],'where':{'id':_0x366abf['params']['id']}},_0x4fbedd={};_0x4fbedd[_0x0e80('0x1e')]=_[_0x0e80('0x34')](db[_0x0e80('0x1c')][_0x0e80('0x35')]);_0x4fbedd[_0x0e80('0x1f')]=_[_0x0e80('0x34')](_0x366abf['query']);_0x4fbedd['filters']=_[_0x0e80('0x21')](_0x4fbedd[_0x0e80('0x1e')],_0x4fbedd[_0x0e80('0x1f')]);_0x298ccb[_0x0e80('0x23')]=_[_0x0e80('0x21')](_0x4fbedd[_0x0e80('0x1e')],qs['fields'](_0x366abf[_0x0e80('0x1f')][_0x0e80('0x22')]));_0x298ccb[_0x0e80('0x23')]=_0x298ccb[_0x0e80('0x23')][_0x0e80('0x36')]?_0x298ccb[_0x0e80('0x23')]:_0x4fbedd[_0x0e80('0x1e')];if(_0x366abf[_0x0e80('0x1f')]['includeAll']){_0x298ccb[_0x0e80('0x2c')]=[{'all':!![]}];}_0x298ccb=_[_0x0e80('0x28')]({},_0x298ccb,_0x366abf['options']);return db[_0x0e80('0x1c')][_0x0e80('0x37')](_0x298ccb)['then'](handleEntityNotFound(_0x3a4e8e,null))[_0x0e80('0x14')](function(_0x5a3f6d){if(_0x5a3f6d['service']===_0x0e80('0x30')){var _0x5d510c=encryptor[_0x0e80('0x31')](_0x5a3f6d['data3']);_0x5a3f6d[_0x0e80('0x32')]=maskClientSecret(_0x5d510c);}return _0x5a3f6d;})[_0x0e80('0x14')](respondWithResult(_0x3a4e8e,null))[_0x0e80('0x38')](handleError(_0x3a4e8e,null));};exports[_0x0e80('0x39')]=function(_0x54902e,_0x4a1af8){if(!_0x54902e[_0x0e80('0x3a')][_0x0e80('0x16')])throw new Error(_0x0e80('0x3b'));if(!_0x54902e[_0x0e80('0x3a')][_0x0e80('0x2f')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5b94d2=db[_0x0e80('0x1c')]['rawAttributes'][_0x0e80('0x2f')][_0x0e80('0x3c')];if(!_0x5b94d2[_0x0e80('0x3d')](_0x54902e['body'][_0x0e80('0x2f')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5b94d2[_0x0e80('0x3e')](',\x20'));if(_0x54902e['body']['service']==='MicrosoftAzure'&&_0x54902e[_0x0e80('0x3a')][_0x0e80('0x32')]){_0x54902e[_0x0e80('0x3a')][_0x0e80('0x32')]=encryptor[_0x0e80('0x3f')](_0x54902e['body']['data3']);}return db[_0x0e80('0x1c')][_0x0e80('0x39')](_0x54902e['body'],{})['then'](respondWithResult(_0x4a1af8,0xc9))[_0x0e80('0x38')](handleError(_0x4a1af8,null));};exports[_0x0e80('0x13')]=function(_0x25b599,_0x59f6b3){if(_0x25b599['body']['id']){delete _0x25b599[_0x0e80('0x3a')]['id'];}return db[_0x0e80('0x1c')][_0x0e80('0x37')]({'where':{'id':_0x25b599[_0x0e80('0x40')]['id']}})[_0x0e80('0x14')](handleEntityNotFound(_0x59f6b3,null))[_0x0e80('0x14')](function(_0x4ebcc7){if(_0x4ebcc7[_0x0e80('0x2f')]===_0x0e80('0x30')&&_0x25b599[_0x0e80('0x3a')]['data3']){_0x25b599['body']['data3']=encryptor[_0x0e80('0x3f')](_0x25b599[_0x0e80('0x3a')]['data3']);}return _0x4ebcc7;})[_0x0e80('0x14')](saveUpdates(_0x25b599[_0x0e80('0x3a')],null))['then'](respondWithResult(_0x59f6b3,null))['catch'](handleError(_0x59f6b3,null));};exports['destroy']=function(_0x35a3fe,_0x4a2c35){return db[_0x0e80('0x1c')][_0x0e80('0x37')]({'where':{'id':_0x35a3fe['params']['id']}})[_0x0e80('0x14')](handleEntityNotFound(_0x4a2c35,null))[_0x0e80('0x14')](removeEntity(_0x4a2c35,null))[_0x0e80('0x38')](handleError(_0x4a2c35,null));};exports[_0x0e80('0x41')]=function(_0x514763,_0x2d37a0){return db[_0x0e80('0x1c')][_0x0e80('0x42')]({'where':{'id':_0x514763['params']['id']},'raw':!![]})['then'](function(_0x910ff6){if(!_0x910ff6)return _0x2d37a0['sendStatus'](0x194);return{'url':oauth[_0x0e80('0x43')](_0x910ff6,_0x514763[_0x0e80('0x44')]['id'])};})[_0x0e80('0x14')](respondWithResult(_0x2d37a0,null))[_0x0e80('0x38')](handleError(_0x2d37a0,null));};exports['oauth2MicrosoftCallback']=function(_0x304048,_0x216173){var _0x282f73=_0x304048[_0x0e80('0x3a')];var _0x1f970d;var _0x4c1853;if(_0x282f73[_0x0e80('0x15')])throw _0x282f73;redis[_0x0e80('0x45')](_0x282f73[_0x0e80('0x46')])[_0x0e80('0x14')](function(_0x166b09){if(!_0x166b09)throw new Error(_0x0e80('0x47'));_0x1f970d=JSON['parse'](_0x166b09);var _0x6de0d5=Buffer[_0x0e80('0x48')](_0x282f73[_0x0e80('0x46')],'base64')[_0x0e80('0x49')](_0x0e80('0x4a'));_0x4c1853=JSON[_0x0e80('0x4b')](_0x6de0d5);if(!oauth[_0x0e80('0x4c')](_0x282f73[_0x0e80('0x4d')],_0x1f970d[_0x0e80('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x282f73[_0x0e80('0x46')]);return oauth[_0x0e80('0x4f')](_0x282f73[_0x0e80('0x50')],_0x1f970d);})[_0x0e80('0x14')](function(_0x112a5c){_0x1f970d[_0x0e80('0x51')]=_0x112a5c['access_token'];_0x1f970d[_0x0e80('0x52')]=_0x112a5c['refresh_token'];return db[_0x0e80('0x1c')]['update']({'data5':_0x1f970d[_0x0e80('0x51')],'data6':_0x1f970d[_0x0e80('0x52')]},{'where':{'id':_0x1f970d['id']}});})[_0x0e80('0x14')](function(){oauth[_0x0e80('0x53')](_0x1f970d);socket[_0x0e80('0x54')](_0x0e80('0x55'),{'id':_0x4c1853['id']});return;})[_0x0e80('0x14')](respondWithStatusCode(_0x216173,null))['catch'](function(_0x3097e3){if(_0x4c1853){socket[_0x0e80('0x54')]('microsoftAuthorization:error',{'id':_0x4c1853['id']});}if(!_0x1f970d){logger[_0x0e80('0x15')](_0x0e80('0x56'),_0x3097e3);return _0x216173[_0x0e80('0x10')](0x1f4)[_0x0e80('0x17')](_0x3097e3[_0x0e80('0x57')]);}logger[_0x0e80('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1f970d['id'],JSON[_0x0e80('0x58')](_0x3097e3));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index dbeab2a..3a10014 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 _0x150b=['cloud_providers','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','CloudProvider'];(function(_0x80b901,_0x1e708f){var _0x496487=function(_0x52b6b7){while(--_0x52b6b7){_0x80b901['push'](_0x80b901['shift']());}};_0x496487(++_0x1e708f);}(_0x150b,0xb1));var _0xb150=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x150b[_0x5d860f];return _0x236490;};'use strict';var _=require('lodash');var util=require(_0xb150('0x0'));var logger=require(_0xb150('0x1'))('api');var moment=require(_0xb150('0x2'));var BPromise=require(_0xb150('0x3'));var rp=require(_0xb150('0x4'));var fs=require('fs');var path=require(_0xb150('0x5'));var rimraf=require(_0xb150('0x6'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xb150('0x7')]=function(_0x244d64,_0x36ff8b){return _0x244d64[_0xb150('0x8')](_0xb150('0x9'),attributes,{'tableName':_0xb150('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd111=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','../../config/logger','moment','bluebird'];(function(_0x32dd39,_0x991f90){var _0x463bf3=function(_0x165e0a){while(--_0x165e0a){_0x32dd39['push'](_0x32dd39['shift']());}};_0x463bf3(++_0x991f90);}(_0xd111,0x1f4));var _0x1d11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd111[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1d11('0x0'));var util=require('util');var logger=require(_0x1d11('0x1'))('api');var moment=require(_0x1d11('0x2'));var BPromise=require(_0x1d11('0x3'));var rp=require(_0x1d11('0x4'));var fs=require('fs');var path=require(_0x1d11('0x5'));var rimraf=require(_0x1d11('0x6'));var config=require(_0x1d11('0x7'));var attributes=require(_0x1d11('0x8'));module[_0x1d11('0x9')]=function(_0x4c4469,_0xa8ed94){return _0x4c4469[_0x1d11('0xa')]('CloudProvider',attributes,{'tableName':_0x1d11('0xb'),'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 92b94b9..28d7207 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 _0x5ffc=['push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','form_post','scope','nonce','login','key','oauth2Claims','replace','oauth2/','set','payload','issuer','aud','audience','isAfter','data3','CloudProvider','findOne','then','refresh_token','data6','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','intervals','bind','findAll','map','all','exports','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','type','Dynamics365'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0x5ffc,0x7e));var _0xc5ff=function(_0x454589,_0x3e852e){_0x454589=_0x454589-0x0;var _0x468c5c=_0x5ffc[_0x454589];return _0x468c5c;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xc5ff('0x0'));var moment=require(_0xc5ff('0x1'));var Redis=require(_0xc5ff('0x2'));var rp=require(_0xc5ff('0x3'));var util=require(_0xc5ff('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0xc5ff('0x5'));var logger=require(_0xc5ff('0x6'))(_0xc5ff('0x7'));var schedule=require(_0xc5ff('0x8'));var db=require(_0xc5ff('0x9'))['db'];config[_0xc5ff('0xa')]=_[_0xc5ff('0xb')](config[_0xc5ff('0xa')],{'host':_0xc5ff('0xc'),'port':0x18eb});var redis=new Redis(config[_0xc5ff('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xc5ff('0xd'),_0xc5ff('0xe'),_0xc5ff('0xf'),'offline_access',_0xc5ff('0x10'),_0xc5ff('0x11'),_0xc5ff('0x12')],'Dynamics365':[_0xc5ff('0xd'),_0xc5ff('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1f0bcd){var _0x5f1d59=_['map'](AZURE_AUTH_SCOPES[_0x1f0bcd[_0xc5ff('0x14')]]);if(_0x1f0bcd[_0xc5ff('0x14')]===_0xc5ff('0x15'))_0x5f1d59[_0xc5ff('0x16')](_0x1f0bcd[_0xc5ff('0x17')]+_0xc5ff('0x18'));return _0x5f1d59[_0xc5ff('0x19')]('\x20');}function getAccessTokenScope(_0x18948b){if(_0x18948b[_0xc5ff('0x14')]===_0xc5ff('0x1a'))return _0xc5ff('0x10');if(_0x18948b[_0xc5ff('0x14')]===_0xc5ff('0x15'))return _0x18948b[_0xc5ff('0x17')]+_0xc5ff('0x18');}function generateMicrosoftAuthorizationUrl(_0x7a71e3,_0x5ced2b){var _0xc6492e=MICROSOFT_AUTH_URL['replace'](_0xc5ff('0x1b'),_0x7a71e3[_0xc5ff('0x1c')]);var _0x255915=['code',_0xc5ff('0x1d')];var _0x189b41=Buffer[_0xc5ff('0x1e')](JSON[_0xc5ff('0x1f')]({'id':_0x5ced2b}))[_0xc5ff('0x20')](_0xc5ff('0x21'));var _0x1b9990=crypto[_0xc5ff('0x22')](0x10)[_0xc5ff('0x20')](_0xc5ff('0x23'));var _0x16ce71=getAuthorizationScopes(_0x7a71e3);var _0xc5d714=[{'key':_0xc5ff('0x24'),'value':_0x7a71e3[_0xc5ff('0x25')]},{'key':_0xc5ff('0x26'),'value':encodeURIComponent(_0x255915['join']('\x20'))},{'key':'redirect_uri','value':_0x7a71e3[_0xc5ff('0x27')]},{'key':'response_mode','value':_0xc5ff('0x28')},{'key':_0xc5ff('0x29'),'value':encodeURIComponent(_0x16ce71)},{'key':'state','value':_0x189b41},{'key':_0xc5ff('0x2a'),'value':_0x1b9990},{'key':'prompt','value':_0xc5ff('0x2b')}];var _0x263971=_0xc6492e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xc5d714,function(_0x1ef3c3){return _0x1ef3c3[_0xc5ff('0x2c')]+'='+_0x1ef3c3['value'];})['join']('&');_0x7a71e3[_0xc5ff('0x2d')]={'issuer':_0xc6492e[_0xc5ff('0x2e')](_0xc5ff('0x2f'),''),'audience':_0x7a71e3[_0xc5ff('0x25')],'state':_0x189b41,'nonce':_0x1b9990};redis[_0xc5ff('0x30')](_0x189b41,JSON['stringify'](_0x7a71e3));return _0x263971;}function isValidIdToken(_0x46575d,_0x4a7f8d){try{var _0x145de0=jwt['decode'](_0x46575d,{'complete':!![]});var _0x2770d1=_0x145de0[_0xc5ff('0x31')];if(_0x2770d1['iss']!==_0x4a7f8d[_0xc5ff('0x32')])return![];if(_0x2770d1[_0xc5ff('0x33')]!==_0x4a7f8d[_0xc5ff('0x34')])return![];if(_0x2770d1['nonce']!==_0x4a7f8d[_0xc5ff('0x2a')])return![];if(moment()[_0xc5ff('0x35')](moment['unix'](_0x2770d1['exp'])))return![];return!![];}catch(_0x258f90){throw _0x258f90;}}function refreshOauth2MicrosoftAccessToken(_0x26929b){return Promise['resolve']()['then'](function(){if(_0x26929b[_0xc5ff('0x36')])return _0x26929b;return db[_0xc5ff('0x37')][_0xc5ff('0x38')]({'where':{'id':_0x26929b['id']},'raw':!![]});})[_0xc5ff('0x39')](function(_0xa4e9ee){var _0x58f94d={'grant_type':_0xc5ff('0x3a'),'refresh_token':_0xa4e9ee[_0xc5ff('0x3b')],'scope':getAccessTokenScope(_0xa4e9ee),'redirect_uri':_0xa4e9ee[_0xc5ff('0x27')],'client_id':_0xa4e9ee[_0xc5ff('0x25')],'client_secret':encryptor['decryptString'](_0xa4e9ee[_0xc5ff('0x36')])};var _0x3fe621={'method':_0xc5ff('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xc5ff('0x2e')]('{TENANT_ID}',_0xa4e9ee[_0xc5ff('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x58f94d,'json':!![]};return rp(_0x3fe621);})['then'](function(_0x3d6930){_0x26929b[_0xc5ff('0x3d')]=_0x3d6930[_0xc5ff('0x3e')];_0x26929b[_0xc5ff('0x3b')]=_0x3d6930[_0xc5ff('0x3a')];return db[_0xc5ff('0x37')][_0xc5ff('0x3f')]({'data5':_0x26929b[_0xc5ff('0x3d')],'data6':_0x26929b[_0xc5ff('0x3b')]},{'where':{'id':_0x26929b['id']}});})[_0xc5ff('0x39')](function(){return _0x26929b;})[_0xc5ff('0x40')](function(_0x1d955b){logger[_0xc5ff('0x41')](_0xc5ff('0x42'),_0x26929b['id'],_0x1d955b);});}function getOauth2MicrosoftAccessToken(_0x35571a,_0x1e8c9f){var _0x3f4dc8={'grant_type':'authorization_code','code':_0x35571a,'scope':getAccessTokenScope(_0x1e8c9f),'redirect_uri':_0x1e8c9f['data4'],'client_id':_0x1e8c9f[_0xc5ff('0x25')],'client_secret':encryptor[_0xc5ff('0x43')](_0x1e8c9f[_0xc5ff('0x36')])};var _0x145501={'method':_0xc5ff('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xc5ff('0x2e')]('{TENANT_ID}',_0x1e8c9f[_0xc5ff('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f4dc8,'json':!![]};return rp(_0x145501);}function startRefreshInterval(_0x400091){var _0x1dae10=schedule[_0xc5ff('0x44')];if(_0x1dae10[_0x400091['id']])clearInterval(_0x1dae10[_0x400091['id']]);_0x1dae10[_0x400091['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc5ff('0x45')](this,{'id':_0x400091['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc5ff('0x44')]=_0x1dae10;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xc5ff('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc5ff('0x39')](function(_0x10a4a3){var _0x45ad84=_0x10a4a3[_0xc5ff('0x47')](function(_0x3790ec){return refreshOauth2MicrosoftAccessToken(_0x3790ec)[_0xc5ff('0x39')](function(_0x418117){startRefreshInterval(_0x418117);});});return Promise[_0xc5ff('0x48')](_0x45ad84);})['catch'](function(_0x5d5839){var _0x5c9a2b=_0x5d5839?util['inspect'](_0x5d5839,{'showHidden':![],'depth':null}):'';logger[_0xc5ff('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x5c9a2b);});}module[_0xc5ff('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1046=['iss','issuer','aud','isAfter','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','all','inspect','exports','lodash','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','replace','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','data1','response_type','data4','response_mode','scope','state','nonce','value','join','oauth2/','set','decode','payload'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x1046,0x18d));var _0x6104=function(_0x5d8e01,_0x2eb597){_0x5d8e01=_0x5d8e01-0x0;var _0x48db39=_0x1046[_0x5d8e01];return _0x48db39;};'use strict';var _=require(_0x6104('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x6104('0x1'));var rp=require(_0x6104('0x2'));var util=require(_0x6104('0x3'));var encryptor=require(_0x6104('0x4'));var config=require(_0x6104('0x5'));var logger=require(_0x6104('0x6'))(_0x6104('0x7'));var schedule=require(_0x6104('0x8'));var db=require(_0x6104('0x9'))['db'];config[_0x6104('0xa')]=_['defaults'](config[_0x6104('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x6104('0xa')]);var MICROSOFT_AUTH_URL=_0x6104('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6104('0xc'),_0x6104('0xd'),'email',_0x6104('0xe'),_0x6104('0xf'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x6104('0xc'),_0x6104('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x6104('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x6104('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x117316){var _0x4ea6a8=_[_0x6104('0x12')](AZURE_AUTH_SCOPES[_0x117316[_0x6104('0x13')]]);if(_0x117316[_0x6104('0x13')]===_0x6104('0x14'))_0x4ea6a8['push'](_0x117316[_0x6104('0x15')]+_0x6104('0x16'));return _0x4ea6a8['join']('\x20');}function getAccessTokenScope(_0x142ca2){if(_0x142ca2['type']===_0x6104('0x17'))return _0x6104('0xf');if(_0x142ca2['type']===_0x6104('0x14'))return _0x142ca2[_0x6104('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xe0cbba,_0x29fe33){var _0xb9e162=MICROSOFT_AUTH_URL[_0x6104('0x18')]('{TENANT_ID}',_0xe0cbba[_0x6104('0x19')]);var _0x10c940=[_0x6104('0x1a'),_0x6104('0x1b')];var _0x5aa639=Buffer[_0x6104('0x1c')](JSON[_0x6104('0x1d')]({'id':_0x29fe33}))['toString'](_0x6104('0x1e'));var _0x44e08c=crypto[_0x6104('0x1f')](0x10)[_0x6104('0x20')](_0x6104('0x21'));var _0x56c61c=getAuthorizationScopes(_0xe0cbba);var _0x1afa94=[{'key':'client_id','value':_0xe0cbba[_0x6104('0x22')]},{'key':_0x6104('0x23'),'value':encodeURIComponent(_0x10c940['join']('\x20'))},{'key':'redirect_uri','value':_0xe0cbba[_0x6104('0x24')]},{'key':_0x6104('0x25'),'value':'form_post'},{'key':_0x6104('0x26'),'value':encodeURIComponent(_0x56c61c)},{'key':_0x6104('0x27'),'value':_0x5aa639},{'key':_0x6104('0x28'),'value':_0x44e08c},{'key':'prompt','value':'login'}];var _0xb83003=_0xb9e162+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6104('0x12')](_0x1afa94,function(_0x4dfd3f){return _0x4dfd3f['key']+'='+_0x4dfd3f[_0x6104('0x29')];})[_0x6104('0x2a')]('&');_0xe0cbba['oauth2Claims']={'issuer':_0xb9e162[_0x6104('0x18')](_0x6104('0x2b'),''),'audience':_0xe0cbba[_0x6104('0x22')],'state':_0x5aa639,'nonce':_0x44e08c};redis[_0x6104('0x2c')](_0x5aa639,JSON['stringify'](_0xe0cbba));return _0xb83003;}function isValidIdToken(_0x20de8e,_0x15f168){try{var _0x38f3f3=jwt[_0x6104('0x2d')](_0x20de8e,{'complete':!![]});var _0x18d346=_0x38f3f3[_0x6104('0x2e')];if(_0x18d346[_0x6104('0x2f')]!==_0x15f168[_0x6104('0x30')])return![];if(_0x18d346[_0x6104('0x31')]!==_0x15f168['audience'])return![];if(_0x18d346[_0x6104('0x28')]!==_0x15f168['nonce'])return![];if(moment()[_0x6104('0x32')](moment['unix'](_0x18d346[_0x6104('0x33')])))return![];return!![];}catch(_0x4c591d){throw _0x4c591d;}}function refreshOauth2MicrosoftAccessToken(_0x43c160){return Promise[_0x6104('0x34')]()[_0x6104('0x35')](function(){if(_0x43c160['data3'])return _0x43c160;return db[_0x6104('0x36')][_0x6104('0x37')]({'where':{'id':_0x43c160['id']},'raw':!![]});})[_0x6104('0x35')](function(_0xc0b0dd){var _0xfc2339={'grant_type':_0x6104('0x38'),'refresh_token':_0xc0b0dd[_0x6104('0x39')],'scope':getAccessTokenScope(_0xc0b0dd),'redirect_uri':_0xc0b0dd[_0x6104('0x24')],'client_id':_0xc0b0dd['data1'],'client_secret':encryptor[_0x6104('0x3a')](_0xc0b0dd[_0x6104('0x3b')])};var _0x5a9f98={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x6104('0x18')](_0x6104('0x3c'),_0xc0b0dd['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xfc2339,'json':!![]};return rp(_0x5a9f98);})[_0x6104('0x35')](function(_0x1731ad){_0x43c160[_0x6104('0x3d')]=_0x1731ad[_0x6104('0x3e')];_0x43c160[_0x6104('0x39')]=_0x1731ad[_0x6104('0x38')];return db[_0x6104('0x36')][_0x6104('0x3f')]({'data5':_0x43c160[_0x6104('0x3d')],'data6':_0x43c160['data6']},{'where':{'id':_0x43c160['id']}});})[_0x6104('0x35')](function(){return _0x43c160;})[_0x6104('0x40')](function(_0x54e165){logger[_0x6104('0x41')](_0x6104('0x42'),_0x43c160['id'],_0x54e165);});}function getOauth2MicrosoftAccessToken(_0x375592,_0x176473){var _0x567bd0={'grant_type':'authorization_code','code':_0x375592,'scope':getAccessTokenScope(_0x176473),'redirect_uri':_0x176473[_0x6104('0x24')],'client_id':_0x176473['data1'],'client_secret':encryptor['decryptString'](_0x176473[_0x6104('0x3b')])};var _0x3321b4={'method':_0x6104('0x43'),'uri':MICROSOFT_AUTH_URL[_0x6104('0x18')](_0x6104('0x3c'),_0x176473[_0x6104('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x567bd0,'json':!![]};return rp(_0x3321b4);}function startRefreshInterval(_0x604988){var _0x3b191d=schedule[_0x6104('0x44')];if(_0x3b191d[_0x604988['id']])clearInterval(_0x3b191d[_0x604988['id']]);_0x3b191d[_0x604988['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6104('0x45')](this,{'id':_0x604988['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6104('0x44')]=_0x3b191d;}function startAllRefreshIntervals(){return db[_0x6104('0x36')][_0x6104('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x89db04){var _0x3c7a1c=_0x89db04[_0x6104('0x12')](function(_0x1b103c){return refreshOauth2MicrosoftAccessToken(_0x1b103c)['then'](function(_0x20c6ff){startRefreshInterval(_0x20c6ff);});});return Promise[_0x6104('0x47')](_0x3c7a1c);})[_0x6104('0x40')](function(_0x4c56ed){var _0x366206=_0x4c56ed?util[_0x6104('0x48')](_0x4c56ed,{'showHidden':![],'depth':null}):'';logger[_0x6104('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x366206);});}module[_0x6104('0x49')]={'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 378ae69..e9d3507 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 _0x9805=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4adf81,_0x27f409){var _0x3dda91=function(_0xfd5090){while(--_0xfd5090){_0x4adf81['push'](_0x4adf81['shift']());}};_0x3dda91(++_0x27f409);}(_0x9805,0x18f));var _0x5980=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x9805[_0x5a7f64];return _0x3d30f1;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var moment=require(_0x5980('0x2'));var BPromise=require(_0x5980('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5980('0x4'))['db'];var utils=require(_0x5980('0x5'));var logger=require(_0x5980('0x6'))(_0x5980('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5980('0x8')][_0x5980('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9b,_0x1d6536,_0x175728){return new BPromise(function(_0x3399a9,_0xf8b3c0){return client[_0x5980('0xa')](_0x326b9b,_0x175728)[_0x5980('0xb')](function(_0x35b0ad){logger[_0x5980('0xc')](_0x5980('0xd'),_0x1d6536,'request\x20sent');logger['debug'](_0x5980('0xe'),_0x1d6536,_0x5980('0xf'),JSON[_0x5980('0x10')](_0x35b0ad));if(_0x35b0ad[_0x5980('0x11')]){if(_0x35b0ad['error'][_0x5980('0x12')]===0x1f4){logger[_0x5980('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1d6536,_0x35b0ad['error'][_0x5980('0x13')]);return _0xf8b3c0(_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);}logger[_0x5980('0x11')](_0x5980('0xd'),_0x1d6536,_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);return _0x3399a9(_0x35b0ad[_0x5980('0x11')]['message']);}else{logger[_0x5980('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1d6536,_0x5980('0xf'));_0x3399a9(_0x35b0ad[_0x5980('0x14')][_0x5980('0x13')]);}})[_0x5980('0x15')](function(_0x183261){logger['error'](_0x5980('0xd'),_0x1d6536,_0x183261);_0xf8b3c0(_0x183261);});});} \ No newline at end of file +var _0x731b=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x731b,0xf7));var _0xb731=function(_0x47c534,_0x595faa){_0x47c534=_0x47c534-0x0;var _0x2b16fc=_0x731b[_0x47c534];return _0x2b16fc;};'use strict';var _=require(_0xb731('0x0'));var util=require(_0xb731('0x1'));var moment=require('moment');var BPromise=require(_0xb731('0x2'));var rs=require(_0xb731('0x3'));var fs=require('fs');var Redis=require(_0xb731('0x4'));var db=require(_0xb731('0x5'))['db'];var utils=require(_0xb731('0x6'));var logger=require(_0xb731('0x7'))('rpc');var config=require(_0xb731('0x8'));var jayson=require(_0xb731('0x9'));var client=jayson[_0xb731('0xa')][_0xb731('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12c59b,_0x2b475d,_0x173768){return new BPromise(function(_0x58b83c,_0x2ab04b){return client[_0xb731('0xc')](_0x12c59b,_0x173768)[_0xb731('0xd')](function(_0x26488c){logger[_0xb731('0xe')](_0xb731('0xf'),_0x2b475d,_0xb731('0x10'));logger[_0xb731('0x11')](_0xb731('0x12'),_0x2b475d,_0xb731('0x10'),JSON[_0xb731('0x13')](_0x26488c));if(_0x26488c[_0xb731('0x14')]){if(_0x26488c[_0xb731('0x14')][_0xb731('0x15')]===0x1f4){logger[_0xb731('0x14')]('CloudProvider,\x20%s,\x20%s',_0x2b475d,_0x26488c[_0xb731('0x14')]['message']);return _0x2ab04b(_0x26488c[_0xb731('0x14')][_0xb731('0x16')]);}logger[_0xb731('0x14')]('CloudProvider,\x20%s,\x20%s',_0x2b475d,_0x26488c[_0xb731('0x14')]['message']);return _0x58b83c(_0x26488c['error']['message']);}else{logger[_0xb731('0xe')](_0xb731('0xf'),_0x2b475d,'request\x20sent');_0x58b83c(_0x26488c[_0xb731('0x17')][_0xb731('0x16')]);}})['catch'](function(_0x30da75){logger[_0xb731('0x14')](_0xb731('0xf'),_0x2b475d,_0x30da75);_0x2ab04b(_0x30da75);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8019b22..d9c6b6c 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0xb1b48e,_0x28af0b){var _0xffa622=function(_0x4bea8f){while(--_0x4bea8f){_0xb1b48e['push'](_0xb1b48e['shift']());}};_0xffa622(++_0x28af0b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x5a79cd,_0x101690){var _0x83aaf0=function(_0x4eec07){while(--_0x4eec07){_0x5a79cd['push'](_0x5a79cd['shift']());}};_0x83aaf0(++_0x101690);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xc4aa[_0x4a747d];return _0x3a5b5c;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 691cdc0..1d28345 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 _0x076b=['STRING','name','sequelize','exports'];(function(_0xc29e65,_0x7f1e9e){var _0x36240d=function(_0x29a1ce){while(--_0x29a1ce){_0xc29e65['push'](_0xc29e65['shift']());}};_0x36240d(++_0x7f1e9e);}(_0x076b,0x76));var _0xb076=function(_0x36fa2c,_0x3c3374){_0x36fa2c=_0x36fa2c-0x0;var _0x51529e=_0x076b[_0x36fa2c];return _0x51529e;};'use strict';var Sequelize=require(_0xb076('0x0'));module[_0xb076('0x1')]={'name':{'type':Sequelize[_0xb076('0x2')],'unique':_0xb076('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb076('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xb076('0x2')]},'phone':{'type':Sequelize[_0xb076('0x2')]},'fax':{'type':Sequelize[_0xb076('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xb076('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb076('0x2')]},'country':{'type':Sequelize[_0xb076('0x2')]},'email':{'type':Sequelize[_0xb076('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb076('0x2')]},'sStreet':{'type':Sequelize[_0xb076('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb076('0x2')]}}; \ No newline at end of file +var _0x85ac=['sequelize','exports','STRING','name'];(function(_0x53012f,_0xaa1316){var _0x2e7670=function(_0x50b547){while(--_0x50b547){_0x53012f['push'](_0x53012f['shift']());}};_0x2e7670(++_0xaa1316);}(_0x85ac,0x1c4));var _0xc85a=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x85ac[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0xc85a('0x0'));module[_0xc85a('0x1')]={'name':{'type':Sequelize[_0xc85a('0x2')],'unique':_0xc85a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc85a('0x2')]},'phone':{'type':Sequelize[_0xc85a('0x2')]},'fax':{'type':Sequelize[_0xc85a('0x2')]},'type':{'type':Sequelize[_0xc85a('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc85a('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc85a('0x2')]},'email':{'type':Sequelize[_0xc85a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc85a('0x2')]},'sStreet':{'type':Sequelize[_0xc85a('0x2')]},'sPostalCode':{'type':Sequelize[_0xc85a('0x2')]},'sCity':{'type':Sequelize[_0xc85a('0x2')]},'sCountry':{'type':Sequelize[_0xc85a('0x2')]},'description':{'type':Sequelize[_0xc85a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 69e2cc7..0875793 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 _0xff0b=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','findOne','getContacts','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','error','stack','index','CmCompany','describe','model'];(function(_0x69fea6,_0x3fdef5){var _0x2d7038=function(_0x1c7c64){while(--_0x1c7c64){_0x69fea6['push'](_0x69fea6['shift']());}};_0x2d7038(++_0x3fdef5);}(_0xff0b,0x12e));var _0xbff0=function(_0x56966a,_0x4783c2){_0x56966a=_0x56966a-0x0;var _0x477527=_0xff0b[_0x56966a];return _0x477527;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbff0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbff0('0x1'));var rp=require(_0xbff0('0x2'));var moment=require(_0xbff0('0x3'));var BPromise=require(_0xbff0('0x4'));var Mustache=require(_0xbff0('0x5'));var util=require(_0xbff0('0x6'));var path=require('path');var sox=require(_0xbff0('0x7'));var csv=require(_0xbff0('0x8'));var ejs=require(_0xbff0('0x9'));var fs=require('fs');var fs_extra=require(_0xbff0('0xa'));var _=require(_0xbff0('0xb'));var squel=require(_0xbff0('0xc'));var crypto=require(_0xbff0('0xd'));var jsforce=require(_0xbff0('0xe'));var deskjs=require(_0xbff0('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbff0('0x10'));var Redis=require(_0xbff0('0x11'));var authService=require(_0xbff0('0x12'));var qs=require(_0xbff0('0x13'));var as=require(_0xbff0('0x14'));var hardwareService=require(_0xbff0('0x15'));var logger=require(_0xbff0('0x16'))(_0xbff0('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbff0('0x18'))['db'];function respondWithStatusCode(_0x53d1b7,_0x1bf3bb){_0x1bf3bb=_0x1bf3bb||0xcc;return function(_0xa3bc73){if(_0xa3bc73){return _0x53d1b7[_0xbff0('0x19')](_0x1bf3bb);}return _0x53d1b7[_0xbff0('0x1a')](_0x1bf3bb)[_0xbff0('0x1b')]();};}function respondWithResult(_0x2f7f85,_0x114b97){_0x114b97=_0x114b97||0xc8;return function(_0x25d37f){if(_0x25d37f){return _0x2f7f85[_0xbff0('0x1a')](_0x114b97)[_0xbff0('0x1c')](_0x25d37f);}};}function respondWithFilteredResult(_0x391880,_0x24cff3){return function(_0x355174){if(_0x355174){var _0x7778ae=typeof _0x24cff3['offset']===_0xbff0('0x1d')&&typeof _0x24cff3[_0xbff0('0x1e')]===_0xbff0('0x1d');var _0x4440da=_0x355174[_0xbff0('0x1f')];var _0x2918cd=_0x7778ae?0x0:_0x24cff3['offset'];var _0x2763d6=_0x7778ae?_0x355174[_0xbff0('0x1f')]:_0x24cff3[_0xbff0('0x20')]+_0x24cff3['limit'];var _0x163d1e;if(_0x2763d6>=_0x4440da){_0x2763d6=_0x4440da;_0x163d1e=0xc8;}else{_0x163d1e=0xce;}_0x391880[_0xbff0('0x1a')](_0x163d1e);return _0x391880[_0xbff0('0x21')](_0xbff0('0x22'),_0x2918cd+'-'+_0x2763d6+'/'+_0x4440da)[_0xbff0('0x1c')](_0x355174);}return null;};}function patchUpdates(_0x42039b){return function(_0x199924){try{jsonpatch[_0xbff0('0x23')](_0x199924,_0x42039b,!![]);}catch(_0x2f7ac6){return BPromise[_0xbff0('0x24')](_0x2f7ac6);}return _0x199924[_0xbff0('0x25')]();};}function saveUpdates(_0x2814ca,_0x259b0b){return function(_0x5c8fca){if(_0x5c8fca){return _0x5c8fca[_0xbff0('0x26')](_0x2814ca)[_0xbff0('0x27')](function(_0x33b0a8){return _0x33b0a8;});}return null;};}function removeEntity(_0x1decb5,_0x3ce2ea){return function(_0x195697){if(_0x195697){return _0x195697['destroy']()['then'](function(){var _0x997e74=_0x195697[_0xbff0('0x28')]({'plain':!![]});var _0x268887=_0xbff0('0x29');return db[_0xbff0('0x2a')][_0xbff0('0x2b')]({'where':{'type':_0x268887,'resourceId':_0x997e74['id']}})['then'](function(){return _0x195697;});})[_0xbff0('0x27')](function(){_0x1decb5[_0xbff0('0x1a')](0xcc)[_0xbff0('0x1b')]();});}};}function handleEntityNotFound(_0x42d466,_0xcde13f){return function(_0x56da66){if(!_0x56da66){_0x42d466[_0xbff0('0x19')](0x194);}return _0x56da66;};}function handleError(_0x40f725,_0x1e9010){_0x1e9010=_0x1e9010||0x1f4;return function(_0x2493e6){logger[_0xbff0('0x2c')](_0x2493e6[_0xbff0('0x2d')]);if(_0x2493e6['name']){delete _0x2493e6['name'];}_0x40f725['status'](_0x1e9010)['send'](_0x2493e6);};}exports[_0xbff0('0x2e')]=function(_0x2bf86b,_0x4be646){var _0xe0c6b5={},_0xdec686={},_0x3467d8={'count':0x0,'rows':[]};return db[_0xbff0('0x2f')][_0xbff0('0x30')]()['then'](function(_0x59532f){_0xdec686[_0xbff0('0x31')]=_[_0xbff0('0x32')](_0x59532f);_0xdec686['query']=_[_0xbff0('0x32')](_0x2bf86b[_0xbff0('0x33')]);_0xdec686[_0xbff0('0x34')]=_[_0xbff0('0x35')](_0xdec686['model'],_0xdec686[_0xbff0('0x33')]);_0xe0c6b5[_0xbff0('0x36')]=_['intersection'](_0xdec686[_0xbff0('0x31')],qs[_0xbff0('0x37')](_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x37')]));_0xe0c6b5[_0xbff0('0x36')]=_0xe0c6b5['attributes'][_0xbff0('0x38')]?_0xe0c6b5[_0xbff0('0x36')]:_0xdec686['model'];if(!_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x39')](_0xbff0('0x3a'))){_0xe0c6b5[_0xbff0('0x1e')]=qs['limit'](_0x2bf86b['query'][_0xbff0('0x1e')]);_0xe0c6b5[_0xbff0('0x20')]=qs[_0xbff0('0x20')](_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x20')]);}_0xe0c6b5[_0xbff0('0x3b')]=qs[_0xbff0('0x3c')](_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x3c')]);_0xe0c6b5[_0xbff0('0x3d')]=qs[_0xbff0('0x34')](_[_0xbff0('0x3e')](_0x2bf86b['query'],_0xdec686[_0xbff0('0x34')]),_0x59532f);if(_0x2bf86b['query'][_0xbff0('0x3f')]){_0xe0c6b5[_0xbff0('0x3d')]=_[_0xbff0('0x40')](_0xe0c6b5[_0xbff0('0x3d')],{'$or':_[_0xbff0('0x41')](_0xe0c6b5[_0xbff0('0x36')],function(_0x53823d){var _0x51d584={};_0x51d584[_0x53823d]={'$like':'%'+_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x3f')]+'%'};return _0x51d584;})});}_0xe0c6b5=_['merge']({},_0xe0c6b5,_0x2bf86b[_0xbff0('0x42')]);var _0x60c4db={'where':_0xe0c6b5['where']};return db[_0xbff0('0x2f')][_0xbff0('0x1f')](_0x60c4db)[_0xbff0('0x27')](function(_0x1bc67c){_0x3467d8['count']=_0x1bc67c;if(_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x43')]){_0xe0c6b5[_0xbff0('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0xbff0('0x45')](_0xe0c6b5);})[_0xbff0('0x27')](function(_0x3d181){_0x3467d8[_0xbff0('0x46')]=_0x3d181;return _0x3467d8;})['then'](respondWithFilteredResult(_0x4be646,_0xe0c6b5))[_0xbff0('0x47')](handleError(_0x4be646,null));})[_0xbff0('0x47')](handleError(_0x4be646,null));};exports[_0xbff0('0x48')]=function(_0x4a9b77,_0x14a963){var _0x5607c5={'raw':![],'where':{'id':_0x4a9b77[_0xbff0('0x49')]['id']}},_0xa82e83={};_0xa82e83['model']=_['keys'](db[_0xbff0('0x2f')][_0xbff0('0x4a')]);_0xa82e83['query']=_['keys'](_0x4a9b77['query']);_0xa82e83['filters']=_[_0xbff0('0x35')](_0xa82e83[_0xbff0('0x31')],_0xa82e83['query']);_0x5607c5[_0xbff0('0x36')]=_[_0xbff0('0x35')](_0xa82e83['model'],qs['fields'](_0x4a9b77['query'][_0xbff0('0x37')]));_0x5607c5[_0xbff0('0x36')]=_0x5607c5[_0xbff0('0x36')]['length']?_0x5607c5['attributes']:_0xa82e83[_0xbff0('0x31')];if(_0x4a9b77[_0xbff0('0x33')][_0xbff0('0x43')]){_0x5607c5['include']=[{'all':!![]}];}_0x5607c5=_[_0xbff0('0x40')]({},_0x5607c5,_0x4a9b77['options']);return db[_0xbff0('0x2f')][_0xbff0('0x4b')](_0x5607c5)['then'](handleEntityNotFound(_0x14a963,null))[_0xbff0('0x27')](respondWithResult(_0x14a963,null))[_0xbff0('0x47')](handleError(_0x14a963,null));};exports[_0xbff0('0x4c')]=function(_0x496857,_0x28663b){return db[_0xbff0('0x2f')][_0xbff0('0x4c')](_0x496857[_0xbff0('0x4d')],{})[_0xbff0('0x27')](function(_0xa56c60){var _0x1eb8de=_0x496857[_0xbff0('0x4e')][_0xbff0('0x28')]({'plain':!![]});if(!_0x1eb8de)throw new Error(_0xbff0('0x4f'));if(_0x1eb8de['role']===_0xbff0('0x4e')){var _0x8ca120=_0xa56c60[_0xbff0('0x28')]({'plain':!![]});var _0x49e142=_0xbff0('0x29');return db[_0xbff0('0x50')]['find']({'where':{'name':_0x49e142,'userProfileId':_0x1eb8de['userProfileId']},'raw':!![]})[_0xbff0('0x27')](function(_0x155e70){if(_0x155e70&&_0x155e70[_0xbff0('0x51')]===0x0){return db[_0xbff0('0x2a')][_0xbff0('0x4c')]({'name':_0x8ca120[_0xbff0('0x52')],'resourceId':_0x8ca120['id'],'type':_0x155e70[_0xbff0('0x52')],'sectionId':_0x155e70['id']},{})[_0xbff0('0x27')](function(){return _0xa56c60;});}else{return _0xa56c60;}})[_0xbff0('0x47')](function(_0x556abd){logger[_0xbff0('0x2c')](_0xbff0('0x53'),_0x556abd);throw _0x556abd;});}return _0xa56c60;})[_0xbff0('0x27')](respondWithResult(_0x28663b,0xc9))['catch'](handleError(_0x28663b,null));};exports[_0xbff0('0x26')]=function(_0x4abd3e,_0x5888cb){if(_0x4abd3e[_0xbff0('0x4d')]['id']){delete _0x4abd3e[_0xbff0('0x4d')]['id'];}return db[_0xbff0('0x2f')]['find']({'where':{'id':_0x4abd3e[_0xbff0('0x49')]['id']}})[_0xbff0('0x27')](handleEntityNotFound(_0x5888cb,null))['then'](saveUpdates(_0x4abd3e[_0xbff0('0x4d')],null))['then'](respondWithResult(_0x5888cb,null))['catch'](handleError(_0x5888cb,null));};exports[_0xbff0('0x2b')]=function(_0x4f29df,_0xd7dc93){return db[_0xbff0('0x2f')]['find']({'where':{'id':_0x4f29df[_0xbff0('0x49')]['id']}})[_0xbff0('0x27')](handleEntityNotFound(_0xd7dc93,null))[_0xbff0('0x27')](removeEntity(_0xd7dc93,null))[_0xbff0('0x47')](handleError(_0xd7dc93,null));};exports[_0xbff0('0x30')]=function(_0x1aee34,_0x3a4a2a){return db[_0xbff0('0x2f')][_0xbff0('0x30')]()[_0xbff0('0x27')](respondWithResult(_0x3a4a2a,null))[_0xbff0('0x47')](handleError(_0x3a4a2a,null));};exports[_0xbff0('0x54')]=function(_0x531579,_0xa183ab,_0x14143a){return db['CmContact'][_0xbff0('0x4b')]({'where':{'id':_0x531579[_0xbff0('0x49')]['id']}})['then'](handleEntityNotFound(_0xa183ab,null))[_0xbff0('0x27')](function(_0x59d70d){if(_0x59d70d){return _0x59d70d['addContacts'](_0x531579['body']['ids'],_[_0xbff0('0x55')](_0x531579['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xa183ab,null))[_0xbff0('0x47')](handleError(_0xa183ab,null));};exports['getContacts']=function(_0x49743c,_0x10b1c3,_0x4248a3){var _0x30b1ba={};var _0x4fa915={};var _0x398e39;var _0x41d0a1;return db[_0xbff0('0x2f')][_0xbff0('0x56')]({'where':{'id':_0x49743c[_0xbff0('0x49')]['id']}})[_0xbff0('0x27')](handleEntityNotFound(_0x10b1c3,null))['then'](function(_0x313bb3){if(_0x313bb3){_0x398e39=_0x313bb3;_0x4fa915[_0xbff0('0x31')]=_[_0xbff0('0x32')](db['CmContact'][_0xbff0('0x4a')]);_0x4fa915[_0xbff0('0x33')]=_[_0xbff0('0x32')](_0x49743c[_0xbff0('0x33')]);_0x4fa915[_0xbff0('0x34')]=_[_0xbff0('0x35')](_0x4fa915[_0xbff0('0x31')],_0x4fa915[_0xbff0('0x33')]);_0x30b1ba[_0xbff0('0x36')]=_['intersection'](_0x4fa915[_0xbff0('0x31')],qs[_0xbff0('0x37')](_0x49743c[_0xbff0('0x33')][_0xbff0('0x37')]));_0x30b1ba[_0xbff0('0x36')]=_0x30b1ba[_0xbff0('0x36')]['length']?_0x30b1ba['attributes']:_0x4fa915['model'];_0x30b1ba[_0xbff0('0x3b')]=qs['sort'](_0x49743c['query']['sort']);_0x30b1ba[_0xbff0('0x3d')]=qs['filters'](_[_0xbff0('0x3e')](_0x49743c[_0xbff0('0x33')],_0x4fa915[_0xbff0('0x34')]));if(_0x49743c['query'][_0xbff0('0x3f')]){_0x30b1ba[_0xbff0('0x3d')]=_[_0xbff0('0x40')](_0x30b1ba[_0xbff0('0x3d')],{'$or':_[_0xbff0('0x41')](_0x30b1ba[_0xbff0('0x36')],function(_0x5a662e){var _0x2bc885={};_0x2bc885[_0x5a662e]={'$like':'%'+_0x49743c['query'][_0xbff0('0x3f')]+'%'};return _0x2bc885;})});}_0x30b1ba=_[_0xbff0('0x40')]({},_0x30b1ba,_0x49743c['options']);return _0x398e39[_0xbff0('0x57')](_0x30b1ba);}})['then'](function(_0x21884c){if(_0x21884c){_0x41d0a1=_0x21884c[_0xbff0('0x38')];if(!_0x49743c[_0xbff0('0x33')][_0xbff0('0x39')]('nolimit')){_0x30b1ba[_0xbff0('0x1e')]=qs['limit'](_0x49743c[_0xbff0('0x33')]['limit']);_0x30b1ba[_0xbff0('0x20')]=qs['offset'](_0x49743c[_0xbff0('0x33')][_0xbff0('0x20')]);}return _0x398e39[_0xbff0('0x57')](_0x30b1ba);}})[_0xbff0('0x27')](function(_0x167d72){if(_0x167d72){return _0x167d72?{'count':_0x41d0a1,'rows':_0x167d72}:null;}})[_0xbff0('0x27')](respondWithResult(_0x10b1c3,null))['catch'](handleError(_0x10b1c3,null));}; \ No newline at end of file +var _0x50cc=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','Companies','UserProfileResource','stack','name','send','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x24f430,_0x523751){var _0x23cc82=function(_0x2bf6fc){while(--_0x2bf6fc){_0x24f430['push'](_0x24f430['shift']());}};_0x23cc82(++_0x523751);}(_0x50cc,0x9c));var _0xc50c=function(_0x163ff5,_0x45cd16){_0x163ff5=_0x163ff5-0x0;var _0x5a09bf=_0x50cc[_0x163ff5];return _0x5a09bf;};'use strict';var emlformat=require(_0xc50c('0x0'));var rimraf=require(_0xc50c('0x1'));var zipdir=require(_0xc50c('0x2'));var jsonpatch=require(_0xc50c('0x3'));var rp=require(_0xc50c('0x4'));var moment=require(_0xc50c('0x5'));var BPromise=require(_0xc50c('0x6'));var Mustache=require(_0xc50c('0x7'));var util=require(_0xc50c('0x8'));var path=require(_0xc50c('0x9'));var sox=require(_0xc50c('0xa'));var csv=require('to-csv');var ejs=require(_0xc50c('0xb'));var fs=require('fs');var fs_extra=require(_0xc50c('0xc'));var _=require(_0xc50c('0xd'));var squel=require(_0xc50c('0xe'));var crypto=require(_0xc50c('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc50c('0x10'));var querystring=require(_0xc50c('0x11'));var Papa=require(_0xc50c('0x12'));var Redis=require(_0xc50c('0x13'));var authService=require(_0xc50c('0x14'));var qs=require(_0xc50c('0x15'));var as=require(_0xc50c('0x16'));var hardwareService=require(_0xc50c('0x17'));var logger=require(_0xc50c('0x18'))(_0xc50c('0x19'));var utils=require('../../config/utils');var config=require(_0xc50c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc50c('0x1b'))['db'];function respondWithStatusCode(_0x4505f1,_0x5f2142){_0x5f2142=_0x5f2142||0xcc;return function(_0x793588){if(_0x793588){return _0x4505f1[_0xc50c('0x1c')](_0x5f2142);}return _0x4505f1[_0xc50c('0x1d')](_0x5f2142)['end']();};}function respondWithResult(_0x1663b2,_0x29dc4d){_0x29dc4d=_0x29dc4d||0xc8;return function(_0x1866b4){if(_0x1866b4){return _0x1663b2['status'](_0x29dc4d)[_0xc50c('0x1e')](_0x1866b4);}};}function respondWithFilteredResult(_0x15ec93,_0x2a8fe8){return function(_0x44bbf5){if(_0x44bbf5){var _0x41865d=typeof _0x2a8fe8[_0xc50c('0x1f')]===_0xc50c('0x20')&&typeof _0x2a8fe8[_0xc50c('0x21')]===_0xc50c('0x20');var _0xcb32b8=_0x44bbf5[_0xc50c('0x22')];var _0x48c661=_0x41865d?0x0:_0x2a8fe8[_0xc50c('0x1f')];var _0x132888=_0x41865d?_0x44bbf5[_0xc50c('0x22')]:_0x2a8fe8[_0xc50c('0x1f')]+_0x2a8fe8[_0xc50c('0x21')];var _0xafeeca;if(_0x132888>=_0xcb32b8){_0x132888=_0xcb32b8;_0xafeeca=0xc8;}else{_0xafeeca=0xce;}_0x15ec93[_0xc50c('0x1d')](_0xafeeca);return _0x15ec93[_0xc50c('0x23')]('Content-Range',_0x48c661+'-'+_0x132888+'/'+_0xcb32b8)['json'](_0x44bbf5);}return null;};}function patchUpdates(_0x179c4a){return function(_0x3e4005){try{jsonpatch[_0xc50c('0x24')](_0x3e4005,_0x179c4a,!![]);}catch(_0x2e2ba3){return BPromise[_0xc50c('0x25')](_0x2e2ba3);}return _0x3e4005[_0xc50c('0x26')]();};}function saveUpdates(_0x4aa4a6,_0x52da06){return function(_0x40911a){if(_0x40911a){return _0x40911a['update'](_0x4aa4a6)[_0xc50c('0x27')](function(_0x3e534a){return _0x3e534a;});}return null;};}function removeEntity(_0x20f35f,_0x52bf4f){return function(_0x15827b){if(_0x15827b){return _0x15827b[_0xc50c('0x28')]()['then'](function(){var _0x176844=_0x15827b[_0xc50c('0x29')]({'plain':!![]});var _0x44a540=_0xc50c('0x2a');return db[_0xc50c('0x2b')][_0xc50c('0x28')]({'where':{'type':_0x44a540,'resourceId':_0x176844['id']}})[_0xc50c('0x27')](function(){return _0x15827b;});})['then'](function(){_0x20f35f[_0xc50c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x377135,_0x555802){return function(_0x4cbb00){if(!_0x4cbb00){_0x377135[_0xc50c('0x1c')](0x194);}return _0x4cbb00;};}function handleError(_0x5898a7,_0x3fa10f){_0x3fa10f=_0x3fa10f||0x1f4;return function(_0x5935cf){logger['error'](_0x5935cf[_0xc50c('0x2c')]);if(_0x5935cf[_0xc50c('0x2d')]){delete _0x5935cf[_0xc50c('0x2d')];}_0x5898a7[_0xc50c('0x1d')](_0x3fa10f)[_0xc50c('0x2e')](_0x5935cf);};}exports['index']=function(_0x259bb9,_0x219d37){var _0x4317e0={},_0x17d0b8={},_0x1dd557={'count':0x0,'rows':[]};return db[_0xc50c('0x2f')][_0xc50c('0x30')]()['then'](function(_0x28edd6){_0x17d0b8['model']=_[_0xc50c('0x31')](_0x28edd6);_0x17d0b8[_0xc50c('0x32')]=_[_0xc50c('0x31')](_0x259bb9[_0xc50c('0x32')]);_0x17d0b8[_0xc50c('0x33')]=_[_0xc50c('0x34')](_0x17d0b8[_0xc50c('0x35')],_0x17d0b8[_0xc50c('0x32')]);_0x4317e0[_0xc50c('0x36')]=_['intersection'](_0x17d0b8[_0xc50c('0x35')],qs[_0xc50c('0x37')](_0x259bb9[_0xc50c('0x32')]['fields']));_0x4317e0[_0xc50c('0x36')]=_0x4317e0[_0xc50c('0x36')][_0xc50c('0x38')]?_0x4317e0[_0xc50c('0x36')]:_0x17d0b8['model'];if(!_0x259bb9['query'][_0xc50c('0x39')](_0xc50c('0x3a'))){_0x4317e0[_0xc50c('0x21')]=qs[_0xc50c('0x21')](_0x259bb9['query'][_0xc50c('0x21')]);_0x4317e0['offset']=qs[_0xc50c('0x1f')](_0x259bb9[_0xc50c('0x32')][_0xc50c('0x1f')]);}_0x4317e0['order']=qs[_0xc50c('0x3b')](_0x259bb9[_0xc50c('0x32')]['sort']);_0x4317e0[_0xc50c('0x3c')]=qs[_0xc50c('0x33')](_[_0xc50c('0x3d')](_0x259bb9[_0xc50c('0x32')],_0x17d0b8['filters']),_0x28edd6);if(_0x259bb9[_0xc50c('0x32')][_0xc50c('0x3e')]){_0x4317e0[_0xc50c('0x3c')]=_['merge'](_0x4317e0[_0xc50c('0x3c')],{'$or':_[_0xc50c('0x3f')](_0x4317e0['attributes'],function(_0x377708){var _0x4128e3={};_0x4128e3[_0x377708]={'$like':'%'+_0x259bb9[_0xc50c('0x32')][_0xc50c('0x3e')]+'%'};return _0x4128e3;})});}_0x4317e0=_[_0xc50c('0x40')]({},_0x4317e0,_0x259bb9['options']);var _0x127903={'where':_0x4317e0[_0xc50c('0x3c')]};return db['CmCompany']['count'](_0x127903)[_0xc50c('0x27')](function(_0x58ea15){_0x1dd557[_0xc50c('0x22')]=_0x58ea15;if(_0x259bb9[_0xc50c('0x32')][_0xc50c('0x41')]){_0x4317e0[_0xc50c('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0xc50c('0x43')](_0x4317e0);})[_0xc50c('0x27')](function(_0x97711){_0x1dd557[_0xc50c('0x44')]=_0x97711;return _0x1dd557;})['then'](respondWithFilteredResult(_0x219d37,_0x4317e0))['catch'](handleError(_0x219d37,null));})[_0xc50c('0x45')](handleError(_0x219d37,null));};exports[_0xc50c('0x46')]=function(_0x299d57,_0x3a9aac){var _0x232d4d={'raw':![],'where':{'id':_0x299d57[_0xc50c('0x47')]['id']}},_0x329338={};_0x329338[_0xc50c('0x35')]=_['keys'](db['CmCompany']['rawAttributes']);_0x329338['query']=_[_0xc50c('0x31')](_0x299d57['query']);_0x329338[_0xc50c('0x33')]=_['intersection'](_0x329338[_0xc50c('0x35')],_0x329338[_0xc50c('0x32')]);_0x232d4d[_0xc50c('0x36')]=_['intersection'](_0x329338[_0xc50c('0x35')],qs[_0xc50c('0x37')](_0x299d57[_0xc50c('0x32')][_0xc50c('0x37')]));_0x232d4d['attributes']=_0x232d4d[_0xc50c('0x36')][_0xc50c('0x38')]?_0x232d4d['attributes']:_0x329338[_0xc50c('0x35')];if(_0x299d57['query'][_0xc50c('0x41')]){_0x232d4d['include']=[{'all':!![]}];}_0x232d4d=_[_0xc50c('0x40')]({},_0x232d4d,_0x299d57[_0xc50c('0x48')]);return db[_0xc50c('0x2f')][_0xc50c('0x49')](_0x232d4d)[_0xc50c('0x27')](handleEntityNotFound(_0x3a9aac,null))[_0xc50c('0x27')](respondWithResult(_0x3a9aac,null))['catch'](handleError(_0x3a9aac,null));};exports['create']=function(_0x2513f9,_0x1066ee){return db[_0xc50c('0x2f')][_0xc50c('0x4a')](_0x2513f9[_0xc50c('0x4b')],{})['then'](function(_0x22fbc7){var _0x2941c8=_0x2513f9[_0xc50c('0x4c')][_0xc50c('0x29')]({'plain':!![]});if(!_0x2941c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2941c8[_0xc50c('0x4d')]===_0xc50c('0x4c')){var _0x437a1f=_0x22fbc7[_0xc50c('0x29')]({'plain':!![]});var _0x1ab655=_0xc50c('0x2a');return db[_0xc50c('0x4e')]['find']({'where':{'name':_0x1ab655,'userProfileId':_0x2941c8[_0xc50c('0x4f')]},'raw':!![]})[_0xc50c('0x27')](function(_0x473f68){if(_0x473f68&&_0x473f68[_0xc50c('0x50')]===0x0){return db[_0xc50c('0x2b')][_0xc50c('0x4a')]({'name':_0x437a1f[_0xc50c('0x2d')],'resourceId':_0x437a1f['id'],'type':_0x473f68[_0xc50c('0x2d')],'sectionId':_0x473f68['id']},{})[_0xc50c('0x27')](function(){return _0x22fbc7;});}else{return _0x22fbc7;}})['catch'](function(_0xe5fcd3){logger['error'](_0xc50c('0x51'),_0xe5fcd3);throw _0xe5fcd3;});}return _0x22fbc7;})['then'](respondWithResult(_0x1066ee,0xc9))[_0xc50c('0x45')](handleError(_0x1066ee,null));};exports[_0xc50c('0x52')]=function(_0x3dfab5,_0x49b81a){if(_0x3dfab5[_0xc50c('0x4b')]['id']){delete _0x3dfab5[_0xc50c('0x4b')]['id'];}return db[_0xc50c('0x2f')][_0xc50c('0x49')]({'where':{'id':_0x3dfab5['params']['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x49b81a,null))[_0xc50c('0x27')](saveUpdates(_0x3dfab5[_0xc50c('0x4b')],null))[_0xc50c('0x27')](respondWithResult(_0x49b81a,null))[_0xc50c('0x45')](handleError(_0x49b81a,null));};exports[_0xc50c('0x28')]=function(_0x56d35f,_0x4182e5){return db[_0xc50c('0x2f')][_0xc50c('0x49')]({'where':{'id':_0x56d35f[_0xc50c('0x47')]['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x4182e5,null))['then'](removeEntity(_0x4182e5,null))[_0xc50c('0x45')](handleError(_0x4182e5,null));};exports[_0xc50c('0x30')]=function(_0x4a43cb,_0x226e56){return db[_0xc50c('0x2f')][_0xc50c('0x30')]()[_0xc50c('0x27')](respondWithResult(_0x226e56,null))[_0xc50c('0x45')](handleError(_0x226e56,null));};exports[_0xc50c('0x53')]=function(_0x32bc3f,_0x285ce2,_0x11d8c6){return db[_0xc50c('0x54')][_0xc50c('0x49')]({'where':{'id':_0x32bc3f[_0xc50c('0x47')]['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x285ce2,null))[_0xc50c('0x27')](function(_0x2a8fc8){if(_0x2a8fc8){return _0x2a8fc8[_0xc50c('0x53')](_0x32bc3f[_0xc50c('0x4b')][_0xc50c('0x55')],_[_0xc50c('0x56')](_0x32bc3f[_0xc50c('0x4b')],[_0xc50c('0x55'),'id'])||{});}})[_0xc50c('0x27')](respondWithResult(_0x285ce2,null))[_0xc50c('0x45')](handleError(_0x285ce2,null));};exports[_0xc50c('0x57')]=function(_0x4bd894,_0x585457,_0x281b37){var _0x2faecf={};var _0x23f9fd={};var _0x4649da;var _0x49a25b;return db[_0xc50c('0x2f')][_0xc50c('0x58')]({'where':{'id':_0x4bd894[_0xc50c('0x47')]['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x585457,null))['then'](function(_0x9749f){if(_0x9749f){_0x4649da=_0x9749f;_0x23f9fd[_0xc50c('0x35')]=_[_0xc50c('0x31')](db['CmContact'][_0xc50c('0x59')]);_0x23f9fd[_0xc50c('0x32')]=_['keys'](_0x4bd894[_0xc50c('0x32')]);_0x23f9fd[_0xc50c('0x33')]=_[_0xc50c('0x34')](_0x23f9fd[_0xc50c('0x35')],_0x23f9fd[_0xc50c('0x32')]);_0x2faecf[_0xc50c('0x36')]=_['intersection'](_0x23f9fd[_0xc50c('0x35')],qs[_0xc50c('0x37')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x37')]));_0x2faecf[_0xc50c('0x36')]=_0x2faecf[_0xc50c('0x36')][_0xc50c('0x38')]?_0x2faecf[_0xc50c('0x36')]:_0x23f9fd['model'];_0x2faecf[_0xc50c('0x5a')]=qs[_0xc50c('0x3b')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x3b')]);_0x2faecf[_0xc50c('0x3c')]=qs[_0xc50c('0x33')](_['pick'](_0x4bd894['query'],_0x23f9fd['filters']));if(_0x4bd894[_0xc50c('0x32')][_0xc50c('0x3e')]){_0x2faecf['where']=_[_0xc50c('0x40')](_0x2faecf[_0xc50c('0x3c')],{'$or':_[_0xc50c('0x3f')](_0x2faecf['attributes'],function(_0x31236c){var _0x7be25d={};_0x7be25d[_0x31236c]={'$like':'%'+_0x4bd894['query'][_0xc50c('0x3e')]+'%'};return _0x7be25d;})});}_0x2faecf=_[_0xc50c('0x40')]({},_0x2faecf,_0x4bd894[_0xc50c('0x48')]);return _0x4649da[_0xc50c('0x57')](_0x2faecf);}})[_0xc50c('0x27')](function(_0x53c510){if(_0x53c510){_0x49a25b=_0x53c510[_0xc50c('0x38')];if(!_0x4bd894[_0xc50c('0x32')][_0xc50c('0x39')]('nolimit')){_0x2faecf[_0xc50c('0x21')]=qs[_0xc50c('0x21')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x21')]);_0x2faecf[_0xc50c('0x1f')]=qs[_0xc50c('0x1f')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x1f')]);}return _0x4649da['getContacts'](_0x2faecf);}})[_0xc50c('0x27')](function(_0x27e650){if(_0x27e650){return _0x27e650?{'count':_0x49a25b,'rows':_0x27e650}:null;}})[_0xc50c('0x27')](respondWithResult(_0x585457,null))[_0xc50c('0x45')](handleError(_0x585457,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5911930..0d18fdb 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 _0x7e81=['api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x7e81,0xa7));var _0x17e8=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7e81[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var util=require(_0x17e8('0x0'));var logger=require('../../config/logger')(_0x17e8('0x1'));var moment=require(_0x17e8('0x2'));var BPromise=require(_0x17e8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17e8('0x4'));var rimraf=require(_0x17e8('0x5'));var config=require(_0x17e8('0x6'));var attributes=require(_0x17e8('0x7'));module[_0x17e8('0x8')]=function(_0x1bb44e,_0x1b81af){return _0x1bb44e[_0x17e8('0x9')](_0x17e8('0xa'),attributes,{'tableName':_0x17e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12ca=['path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12ca,0x85));var _0xa12c=function(_0x41667c,_0x5151be){_0x41667c=_0x41667c-0x0;var _0x4a2870=_0x12ca[_0x41667c];return _0x4a2870;};'use strict';var _=require(_0xa12c('0x0'));var util=require(_0xa12c('0x1'));var logger=require(_0xa12c('0x2'))(_0xa12c('0x3'));var moment=require(_0xa12c('0x4'));var BPromise=require(_0xa12c('0x5'));var rp=require(_0xa12c('0x6'));var fs=require('fs');var path=require(_0xa12c('0x7'));var rimraf=require(_0xa12c('0x8'));var config=require(_0xa12c('0x9'));var attributes=require('./cmCompany.attributes');module[_0xa12c('0xa')]=function(_0x5286e2,_0x6d77a5){return _0x5286e2[_0xa12c('0xb')](_0xa12c('0xc'),attributes,{'tableName':_0xa12c('0xd'),'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 f015cb0..d13d715 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 _0x7f6b=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7f6b,0x11f));var _0xb7f6=function(_0x1591b2,_0x1546f3){_0x1591b2=_0x1591b2-0x0;var _0x627a49=_0x7f6b[_0x1591b2];return _0x627a49;};'use strict';var _=require(_0xb7f6('0x0'));var util=require('util');var moment=require(_0xb7f6('0x1'));var BPromise=require('bluebird');var rs=require(_0xb7f6('0x2'));var fs=require('fs');var Redis=require(_0xb7f6('0x3'));var db=require(_0xb7f6('0x4'))['db'];var utils=require(_0xb7f6('0x5'));var logger=require(_0xb7f6('0x6'))(_0xb7f6('0x7'));var config=require(_0xb7f6('0x8'));var jayson=require(_0xb7f6('0x9'));var client=jayson[_0xb7f6('0xa')][_0xb7f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x330343,_0x556014,_0xf6b34b){return new BPromise(function(_0xe2f6f0,_0x46d8c9){return client['request'](_0x330343,_0xf6b34b)[_0xb7f6('0xc')](function(_0xd85c89){logger['info'](_0xb7f6('0xd'),_0x556014,'request\x20sent');logger[_0xb7f6('0xe')](_0xb7f6('0xf'),_0x556014,_0xb7f6('0x10'),JSON[_0xb7f6('0x11')](_0xd85c89));if(_0xd85c89[_0xb7f6('0x12')]){if(_0xd85c89[_0xb7f6('0x12')][_0xb7f6('0x13')]===0x1f4){logger['error'](_0xb7f6('0xd'),_0x556014,_0xd85c89[_0xb7f6('0x12')][_0xb7f6('0x14')]);return _0x46d8c9(_0xd85c89['error'][_0xb7f6('0x14')]);}logger[_0xb7f6('0x12')]('CmCompany,\x20%s,\x20%s',_0x556014,_0xd85c89['error'][_0xb7f6('0x14')]);return _0xe2f6f0(_0xd85c89[_0xb7f6('0x12')][_0xb7f6('0x14')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x556014,_0xb7f6('0x10'));_0xe2f6f0(_0xd85c89['result'][_0xb7f6('0x14')]);}})[_0xb7f6('0x15')](function(_0x1d5c1d){logger[_0xb7f6('0x12')](_0xb7f6('0xd'),_0x556014,_0x1d5c1d);_0x46d8c9(_0x1d5c1d);});});} \ No newline at end of file +var _0x482a=['CmCompany,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x29c61c,_0x5c2c78){var _0x253c3e=function(_0x40f3d1){while(--_0x40f3d1){_0x29c61c['push'](_0x29c61c['shift']());}};_0x253c3e(++_0x5c2c78);}(_0x482a,0xfa));var _0xa482=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x482a[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xa482('0x0'));var moment=require(_0xa482('0x1'));var BPromise=require(_0xa482('0x2'));var rs=require(_0xa482('0x3'));var fs=require('fs');var Redis=require(_0xa482('0x4'));var db=require(_0xa482('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa482('0x6'))(_0xa482('0x7'));var config=require(_0xa482('0x8'));var jayson=require(_0xa482('0x9'));var client=jayson[_0xa482('0xa')][_0xa482('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171125,_0x31e568,_0x2a4a76){return new BPromise(function(_0x4e6749,_0x27ba54){return client[_0xa482('0xc')](_0x171125,_0x2a4a76)[_0xa482('0xd')](function(_0x5daa90){logger['info'](_0xa482('0xe'),_0x31e568,'request\x20sent');logger[_0xa482('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x31e568,'request\x20sent',JSON[_0xa482('0x10')](_0x5daa90));if(_0x5daa90[_0xa482('0x11')]){if(_0x5daa90[_0xa482('0x11')][_0xa482('0x12')]===0x1f4){logger[_0xa482('0x11')](_0xa482('0xe'),_0x31e568,_0x5daa90[_0xa482('0x11')][_0xa482('0x13')]);return _0x27ba54(_0x5daa90[_0xa482('0x11')][_0xa482('0x13')]);}logger['error'](_0xa482('0xe'),_0x31e568,_0x5daa90['error']['message']);return _0x4e6749(_0x5daa90[_0xa482('0x11')][_0xa482('0x13')]);}else{logger[_0xa482('0x14')](_0xa482('0xe'),_0x31e568,_0xa482('0x15'));_0x4e6749(_0x5daa90[_0xa482('0x16')]['message']);}})[_0xa482('0x17')](function(_0x5db1ed){logger['error'](_0xa482('0xe'),_0x31e568,_0x5db1ed);_0x27ba54(_0x5db1ed);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 700ff49..9bee232 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 _0xfa41=['create','addContacts','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x2052a1,_0x1dd53a){var _0xa7b1e7=function(_0x3f4861){while(--_0x3f4861){_0x2052a1['push'](_0x2052a1['shift']());}};_0xa7b1e7(++_0x1dd53a);}(_0xfa41,0xeb));var _0x1fa4=function(_0xa81926,_0x38e368){_0xa81926=_0xa81926-0x0;var _0x8177ef=_0xfa41[_0xa81926];return _0x8177ef;};'use strict';var multer=require(_0x1fa4('0x0'));var util=require('util');var path=require(_0x1fa4('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fa4('0x2'));var router=express[_0x1fa4('0x3')]();var fs_extra=require(_0x1fa4('0x4'));var auth=require(_0x1fa4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa4('0x6'));var controller=require(_0x1fa4('0x7'));router[_0x1fa4('0x8')]('/',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xa')]);router[_0x1fa4('0x8')](_0x1fa4('0xb'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xc')]);router[_0x1fa4('0x8')](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xe')]);router[_0x1fa4('0x8')](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x10')]);router[_0x1fa4('0x11')]('/',auth['isAuthenticated'](),controller[_0x1fa4('0x12')]);router['post'](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x13')]);router[_0x1fa4('0x14')]('/:id',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x15')]);router['delete'](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3124=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getContacts','post','create','/:id/contacts','addContacts','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x432624,_0x3b0230){var _0x407609=function(_0x3e2dd7){while(--_0x3e2dd7){_0x432624['push'](_0x432624['shift']());}};_0x407609(++_0x3b0230);}(_0x3124,0x149));var _0x4312=function(_0x3b7fc8,_0x55a9ae){_0x3b7fc8=_0x3b7fc8-0x0;var _0x1c362e=_0x3124[_0x3b7fc8];return _0x1c362e;};'use strict';var multer=require(_0x4312('0x0'));var util=require(_0x4312('0x1'));var path=require(_0x4312('0x2'));var timeout=require(_0x4312('0x3'));var express=require('express');var router=express[_0x4312('0x4')]();var fs_extra=require(_0x4312('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4312('0x6'));var config=require(_0x4312('0x7'));var controller=require('./cmCompany.controller');router[_0x4312('0x8')]('/',auth[_0x4312('0x9')](),controller[_0x4312('0xa')]);router[_0x4312('0x8')](_0x4312('0xb'),auth[_0x4312('0x9')](),controller[_0x4312('0xc')]);router[_0x4312('0x8')](_0x4312('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4312('0x8')]('/:id/contacts',auth[_0x4312('0x9')](),controller[_0x4312('0xe')]);router[_0x4312('0xf')]('/',auth[_0x4312('0x9')](),controller[_0x4312('0x10')]);router[_0x4312('0xf')](_0x4312('0x11'),auth[_0x4312('0x9')](),controller[_0x4312('0x12')]);router[_0x4312('0x13')](_0x4312('0xd'),auth[_0x4312('0x9')](),controller[_0x4312('0x14')]);router['delete'](_0x4312('0xd'),auth[_0x4312('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 83fda3c..2b32cc0 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 _0xf894=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x476355,_0x1eed50){var _0x292a65=function(_0x52bec5){while(--_0x52bec5){_0x476355['push'](_0x476355['shift']());}};_0x292a65(++_0x1eed50);}(_0xf894,0x112));var _0x4f89=function(_0x2c65d2,_0x734727){_0x2c65d2=_0x2c65d2-0x0;var _0x1114a1=_0xf894[_0x2c65d2];return _0x1114a1;};'use strict';var _=require(_0x4f89('0x0'));var Sequelize=require(_0x4f89('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4f89('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4f89('0x2')]},'street':{'type':Sequelize[_0x4f89('0x2')]},'postalCode':{'type':Sequelize[_0x4f89('0x2')]},'city':{'type':Sequelize[_0x4f89('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x4f89('0x2')]},'description':{'type':Sequelize[_0x4f89('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x4f89('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4f89('0x2')]},'url':{'type':Sequelize[_0x4f89('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x4f89('0x2')]},'teams':{'type':Sequelize[_0x4f89('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x4f89('0x2')]},'wechat':{'type':Sequelize[_0x4f89('0x2')]},'telegram':{'type':Sequelize[_0x4f89('0x2')]},'UserId':{'type':Sequelize[_0x4f89('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x4f89('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4f89('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4f89('0x6')],'defaultValue':Sequelize[_0x4f89('0x7')]},'dialTimezone':{'type':Sequelize[_0x4f89('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfdca=['NOW','INTEGER','lodash','sequelize','exports','STRING','TEXT','UNSIGNED','DATE'];(function(_0xac42f5,_0xf79119){var _0x417f77=function(_0x825d82){while(--_0x825d82){_0xac42f5['push'](_0xac42f5['shift']());}};_0x417f77(++_0xf79119);}(_0xfdca,0xc8));var _0xafdc=function(_0x168462,_0x417f34){_0x168462=_0x168462-0x0;var _0x34c0d0=_0xfdca[_0x168462];return _0x34c0d0;};'use strict';var _=require(_0xafdc('0x0'));var Sequelize=require(_0xafdc('0x1'));module[_0xafdc('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xafdc('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xafdc('0x3')]},'city':{'type':Sequelize[_0xafdc('0x3')]},'country':{'type':Sequelize[_0xafdc('0x3')]},'dateOfBirth':{'type':Sequelize[_0xafdc('0x3')]},'description':{'type':Sequelize[_0xafdc('0x4')]},'phone':{'type':Sequelize[_0xafdc('0x3')]},'mobile':{'type':Sequelize[_0xafdc('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xafdc('0x3')]},'url':{'type':Sequelize[_0xafdc('0x3')]},'facebook':{'type':Sequelize[_0xafdc('0x3')]},'fb_data':{'type':Sequelize[_0xafdc('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xafdc('0x3')]},'teams':{'type':Sequelize[_0xafdc('0x3')]},'viber':{'type':Sequelize[_0xafdc('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xafdc('0x3')]},'telegram':{'type':Sequelize[_0xafdc('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xafdc('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xafdc('0x6')],'defaultValue':Sequelize[_0xafdc('0x7')]},'dialTimezone':{'type':Sequelize[_0xafdc('0x3')]},'utcOffset':{'type':Sequelize[_0xafdc('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d07d03e..4a26a41 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 _0x5ded=['join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','$or','findOrCreate','spread','show','ItemType','literal','$and','omit','format','pickBy','cf_%d','table','cm_contacts','setFields','toParam','phone','findOne','rawAttributes','filters','options','getTags','setTags','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','ContactId','includeAll','include','getHopperHistories','rows','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','meta','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','importUpdates','message','error\x20child\x20process','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20createdAt\x20filter','source','callerid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','fullname','alias','createdAt','findAndCountAll','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','DESC','chat','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','moment','bluebird','util','path','squel','../../config/logger','api','../../config/environment','../../config/environment/shared','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','sendStatus','error','name','send','index','CmContact','describe','length','keys','startsWith','push','CmCustomField','cf_','all','fieldType','type','model','query','intersection','attributes','fields','nolimit','order','sort','pick','select','field','color','tools_tags','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','split','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?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','having','t.id\x20IN\x20?','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','catch','params','columnName','analytics','findAll','displayName','custom','values','hasOwnProperty','body','get','isArray','tags'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5ded,0x1dc));var _0xd5de=function(_0x5a0af1,_0x50e73b){_0x5a0af1=_0x5a0af1-0x0;var _0x456e76=_0x5ded[_0x5a0af1];return _0x456e76;};'use strict';var moment=require(_0xd5de('0x0'));var BPromise=require(_0xd5de('0x1'));var util=require(_0xd5de('0x2'));var path=require(_0xd5de('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd5de('0x4'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xd5de('0x5'))(_0xd5de('0x6'));var config=require(_0xd5de('0x7'));var shared=require(_0xd5de('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd5de('0x9')](config[_0xd5de('0xa')],{'host':_0xd5de('0xb'),'port':0x18eb});var socket=require(_0xd5de('0xc'))(new Redis(config[_0xd5de('0xa')]));require(_0xd5de('0xd'))['register'](socket);function respondWithResult(_0x44d9cd,_0x327f3c){_0x327f3c=_0x327f3c||0xc8;return function(_0x5d89df){if(_0x5d89df){return _0x44d9cd[_0xd5de('0xe')](_0x327f3c)['json'](_0x5d89df);}};}function respondWithFilteredResult(_0x44ff08,_0x11e7c2){return function(_0x33b420){if(_0x33b420){var _0x17770e=typeof _0x11e7c2[_0xd5de('0xf')]===_0xd5de('0x10')&&typeof _0x11e7c2[_0xd5de('0x11')]==='undefined';var _0x37a7a0=_0x33b420[_0xd5de('0x12')];var _0x18b49f=_0x17770e?0x0:_0x11e7c2[_0xd5de('0xf')];var _0x4cfe7f=_0x17770e?_0x33b420[_0xd5de('0x12')]:_0x11e7c2[_0xd5de('0xf')]+_0x11e7c2[_0xd5de('0x11')];var _0x192535;if(_0x4cfe7f>=_0x37a7a0){_0x4cfe7f=_0x37a7a0;_0x192535=0xc8;}else{_0x192535=0xce;}_0x44ff08['status'](_0x192535);return _0x44ff08[_0xd5de('0x13')](_0xd5de('0x14'),_0x18b49f+'-'+_0x4cfe7f+'/'+_0x37a7a0)[_0xd5de('0x15')](_0x33b420);}return null;};}function saveUpdates(_0x3f6a06){return function(_0x4c9323){if(_0x4c9323){return _0x4c9323[_0xd5de('0x16')](_0x3f6a06)[_0xd5de('0x17')](function(_0x572b74){return _0x572b74;});}return null;};}function removeEntity(_0x54439d){return function(_0x5d6638){if(_0x5d6638){return _0x5d6638[_0xd5de('0x18')]()['then'](function(){_0x54439d[_0xd5de('0xe')](0xcc)[_0xd5de('0x19')]();});}};}function handleEntityNotFound(_0xc09fd9){return function(_0x34f93a){if(!_0x34f93a){_0xc09fd9[_0xd5de('0x1a')](0x194);}return _0x34f93a;};}function handleError(_0x390362,_0x32de58){_0x32de58=_0x32de58||0x1f4;return function(_0x76cc05){logger[_0xd5de('0x1b')](_0x76cc05['stack']);if(_0x76cc05['name']){delete _0x76cc05[_0xd5de('0x1c')];}_0x390362['status'](_0x32de58)[_0xd5de('0x1d')](_0x76cc05);};}exports[_0xd5de('0x1e')]=function(_0x497842,_0xcf51cb){var _0x55d185={},_0x211fa9={},_0xf0b4a9={'count':0x0,'rows':[]};return db[_0xd5de('0x1f')][_0xd5de('0x20')]()[_0xd5de('0x17')](function(_0x4b4a38){var _0x560dd6=[];for(var _0x1a260b=0x0;_0x1a260b0x1){_0x1930fb['or'](_0xd5de('0x5f'),qs[_0xd5de('0x60')](_0x3bcf5d),null);}else{if(qs['isNumeric'](_0x3bcf5d)){_0x1930fb['or'](_0xd5de('0x61'),_0x3bcf5d+'%');_0x1930fb['or'](_0xd5de('0x62'),_0x3bcf5d+'%');_0x1930fb['or']('c.mobile\x20LIKE\x20?',_0x3bcf5d+'%');_0x1930fb['or']('c.fax\x20LIKE\x20?',_0x3bcf5d+'%');}else if(qs[_0xd5de('0x63')](_0x3bcf5d)){_0x1930fb['or'](_0xd5de('0x64'),_0x3bcf5d+'%');}else{_0x1930fb['or'](_0xd5de('0x65'),'%'+_0x3bcf5d+'%');_0x1930fb['or'](_0xd5de('0x66'),'%'+_0x3bcf5d+'%');_0x1930fb['or'](_0xd5de('0x64'),'%'+_0x3bcf5d+'%');}}}}_0xa049bc['where'](_0x1930fb);_0xa049bc[_0xd5de('0x67')](_0xd5de('0x68'));var _0x47264f={'type':db[_0xd5de('0x69')][_0xd5de('0x6a')][_0xd5de('0x6b')],'raw':!![]};var _0x1c84e9=_0xa049bc['clone']()['field'](_0xd5de('0x68'));if(_0x55d185[_0xd5de('0x30')]){_0x55d185[_0xd5de('0x30')][_0xd5de('0x48')](function(_0xbb84c5){_0xa049bc['order']('c.'+_0xbb84c5[0x0],_0xbb84c5[0x1]==='DESC'?![]:!![]);});}if(!_[_0xd5de('0x57')](_0x1035ed)){_0xa049bc[_0xd5de('0x6c')](_0xbe671a);_0x1c84e9[_0xd5de('0x3e')](_0xd5de('0x6d'),_0x1035ed);}BPromise[_0xd5de('0x6e')]()[_0xd5de('0x17')](function(){if(!_0x3e5810)return;if(_0x497842[_0xd5de('0x6f')][_0xd5de('0x70')]!==_0xd5de('0x71'))return;if(!_[_0xd5de('0x72')](_0x3e5810[_0xd5de('0x43')],[_0xd5de('0x34'),_0xd5de('0x4b')])){return _0x497842[_0xd5de('0x6f')]['getLists']({'attributes':['id'],'raw':!![]})[_0xd5de('0x17')](function(_0x35eef5){if(_['isEmpty'](_0x35eef5)){_0x1c84e9[_0xd5de('0x3e')](_0xd5de('0x73'));_0xa049bc[_0xd5de('0x3e')](_0xd5de('0x73'));}else{_0x1c84e9['where'](_0xd5de('0x59'),_[_0xd5de('0x47')](_0x35eef5,'id'));_0xa049bc[_0xd5de('0x3e')](_0xd5de('0x59'),_[_0xd5de('0x47')](_0x35eef5,'id'));}});}})[_0xd5de('0x17')](function(){if(_0x497842['user'][_0xd5de('0x70')]==='agent'&&!_0x3e5810&&!_0x497842[_0xd5de('0x2b')][_0xd5de('0x58')])return[];return db[_0xd5de('0x74')][_0xd5de('0x2b')](_0x1c84e9[_0xd5de('0x75')](),_0x47264f);})[_0xd5de('0x17')](function(_0x5f37c1){_0xf0b4a9[_0xd5de('0x12')]=_0x5f37c1[_0xd5de('0x21')];if(_0xf0b4a9[_0xd5de('0x12')]===0x0)return[];return db[_0xd5de('0x74')][_0xd5de('0x2b')](_0x249762[_0xd5de('0x75')](),_0x47264f)['then'](function(_0x230c1c){_0x595916=_[_0xd5de('0x76')](_0x230c1c,'id');_0x47264f=_[_0xd5de('0x77')](_0x47264f,{'model':db[_0xd5de('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x497842['query'][_0xd5de('0x2e')]){_0x55d185['attributes']['forEach'](function(_0x282dcd){_0xa049bc[_0xd5de('0x34')]('c.'+_0x282dcd);});}else{_0xa049bc[_0xd5de('0x34')]('c.id');_0xa049bc[_0xd5de('0x34')](_0xd5de('0x78'));_0xa049bc[_0xd5de('0x34')](_0xd5de('0x79'));_0xa049bc['field'](_0xd5de('0x7a'));_0xa049bc['field']('c.mobile');_0xa049bc[_0xd5de('0x34')]('c.fax');_0xa049bc[_0xd5de('0x34')]('c.email');_0xa049bc[_0xd5de('0x34')](_0xd5de('0x7b'));_0xa049bc['field'](_0xd5de('0x7c'));_0xa049bc['field']('c.deletedAt');_0xa049bc[_0xd5de('0x34')]('c.CompanyId');_0xa049bc[_0xd5de('0x34')](_0xd5de('0x7d'),'TagIds');}if(_0x55d185[_0xd5de('0x11')])_0xa049bc['limit'](_0x55d185[_0xd5de('0x11')]);if(_0x55d185[_0xd5de('0xf')])_0xa049bc[_0xd5de('0xf')](_0x55d185['offset']);return db[_0xd5de('0x74')][_0xd5de('0x2b')](_0xa049bc['toString'](),_0x47264f);});})[_0xd5de('0x17')](function(_0x5751cf){_0x5751cf[_0xd5de('0x48')](function(_0x49da50){if(_0x49da50['TagIds']){_0x49da50['Tags']=[];_0x49da50['TagIds'][_0xd5de('0x5e')](',')[_0xd5de('0x48')](function(_0x63c8db){_0x49da50['Tags'][_0xd5de('0x24')](_0x595916[_0x63c8db]);});}delete _0x49da50[_0xd5de('0x7e')];});_0xf0b4a9['rows']=_0x5751cf;return _0xf0b4a9;})['then'](respondWithFilteredResult(_0xcf51cb,_0x55d185));})[_0xd5de('0x7f')](handleError(_0xcf51cb,null));};exports[_0xd5de('0x18')]=function(_0x48b560,_0x1e4529){return db['CmContact'][_0xd5de('0x44')]({'where':{'id':_0x48b560[_0xd5de('0x80')]['id']}})[_0xd5de('0x17')](handleEntityNotFound(_0x1e4529,null))[_0xd5de('0x17')](removeEntity(_0x1e4529,null))[_0xd5de('0x7f')](handleError(_0x1e4529,null));};exports[_0xd5de('0x20')]=function(_0x53ab74,_0x5955ca){return db[_0xd5de('0x1f')][_0xd5de('0x20')]()[_0xd5de('0x17')](function(_0x3dac82){delete _0x3dac82['tags'];for(var _0x4a2521=0x0;_0x4a25210x0){return new Promise(function(_0x53b04b,_0x18423e){var _0x507671=[];for(var _0x4cd8bc=0x0;_0x4cd8bc<_0x3a2689[_0xd5de('0x21')];_0x4cd8bc++){_0x507671[_0xd5de('0x24')](insertAdditionalPhones(_0x3a2689[_0x4cd8bc]['contact'],_0x3a2689[_0x4cd8bc]['additionalPhones']));}Promise[_0xd5de('0x27')](_0x507671)[_0xd5de('0x17')](function(){_0x53b04b(0x1);});})['then'](function(){return{'success':_0x3b9860,'failure':_0x284c56,'duplicates':_0x451934};});}else{return{'success':_0x3b9860,'failure':_0x284c56,'duplicates':_0x451934};}}})['then'](respondWithResult(_0xe58200,0xc9))['catch'](handleError(_0xe58200,null));};exports[_0xd5de('0xb0')]=function(_0x515141,_0x32330c){var _0x1b56a3;return db[_0xd5de('0x1f')]['describe']()[_0xd5de('0x17')](function(_0x4c9b9a){return db[_0xd5de('0x1f')][_0xd5de('0x44')]({'where':{'id':_0x515141[_0xd5de('0x80')]['id']},'include':[{'model':db[_0xd5de('0x45')],'as':'Tags','attributes':['id',_0xd5de('0x1c'),_0xd5de('0x35')],'required':_0x515141[_0xd5de('0x2b')][_0xd5de('0x5d')]?!![]:![]},{'model':db[_0xd5de('0x9b')],'as':'Phones','where':{'CmContactId':_0x515141[_0xd5de('0x80')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xd5de('0xb1')}]}],'order':[db[_0xd5de('0x74')][_0xd5de('0xb2')]('Phones.OrderBy')],'attributes':_['keys'](_0x4c9b9a)});})[_0xd5de('0x17')](function(_0x3e3abc){if(!_['isNil'](_0x3e3abc)){_0x1b56a3=_0x3e3abc[_0xd5de('0x89')]({'plain':!![]});var _0x215365={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3e3abc&&_0x3e3abc[_0xd5de('0x58')]){if(_0x3e3abc[_0xd5de('0x58')]){_0x215365[_0xd5de('0x3e')][_0xd5de('0xb3')]['push']({'ListId':{'$ne':_0x3e3abc[_0xd5de('0x58')]}});}}return db['CmCustomField'][_0xd5de('0x83')](_0x215365);}})[_0xd5de('0x17')](function(_0x537a85){if(!_['isNil'](_0x537a85)){return _[_0xd5de('0xb4')](_0x1b56a3,_[_0xd5de('0x47')](_0x537a85,function(_0x353f1f){return util[_0xd5de('0xb5')]('cf_%d',_0x353f1f['id']);}));}})[_0xd5de('0x17')](handleEntityNotFound(_0x32330c,null))[_0xd5de('0x17')](respondWithResult(_0x32330c,null))[_0xd5de('0x7f')](handleError(_0x32330c,null));};exports[_0xd5de('0x16')]=function(_0x2fc007,_0x407b8f){var _0x720caf;if(_0x2fc007[_0xd5de('0x88')]['id']){delete _0x2fc007[_0xd5de('0x88')]['id'];}if(!_[_0xd5de('0x55')](_0x2fc007[_0xd5de('0x88')][_0xd5de('0xa7')])){var _0x45c4ac=_0x2fc007[_0xd5de('0x88')][_0xd5de('0xa7')];if(!_['isNil'](shared['timezones'][_0x45c4ac]))_0x2fc007[_0xd5de('0x88')][_0xd5de('0xa9')]=shared['timezones'][_0x45c4ac][_0xd5de('0xa9')];}return db[_0xd5de('0x1f')]['find']({'where':{'id':_0x2fc007['params']['id']}})[_0xd5de('0x17')](handleEntityNotFound(_0x407b8f,null))[_0xd5de('0x17')](saveUpdates(_0x2fc007[_0xd5de('0x88')],null))['then'](function(_0x1a3c8c){_0x720caf=_0x1a3c8c;var _0x5e52ad={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1a3c8c&&_0x1a3c8c['ListId']){if(_0x1a3c8c[_0xd5de('0x58')]){_0x5e52ad[_0xd5de('0x3e')][_0xd5de('0xb3')]['push']({'ListId':{'$ne':_0x1a3c8c['ListId']}});}}return db['CmCustomField'][_0xd5de('0x83')](_0x5e52ad);})[_0xd5de('0x17')](function(_0x2a9638){if(_0x2a9638){return _['omit'](_[_0xd5de('0xb6')](_0x2fc007[_0xd5de('0x88')],function(_0x18d2c3,_0x56468f){return _[_0xd5de('0x23')](_0x56468f,_0xd5de('0x26'));}),_[_0xd5de('0x47')](_0x2a9638,function(_0x5bbf1b){return util[_0xd5de('0xb5')](_0xd5de('0xb7'),_0x5bbf1b['id']);}));}})[_0xd5de('0x17')](function(_0x459a02){if(_0x459a02&&!_['isEmpty'](_0x459a02)){var _0x3ea8d2=squel['update']()[_0xd5de('0xb8')](_0xd5de('0xb9'))[_0xd5de('0xba')](_0x459a02)[_0xd5de('0x3e')]('id\x20=\x20?',_0x2fc007[_0xd5de('0x80')]['id'])[_0xd5de('0xbb')]();return db[_0xd5de('0x74')][_0xd5de('0x2b')](_0x3ea8d2[_0xd5de('0x52')],{'replacements':_0x3ea8d2['values']});}})[_0xd5de('0x17')](function(){if(_0x2fc007['body'][_0xd5de('0xbc')]&&_0x720caf){return db['CmHopper'][_0xd5de('0x16')]({'phone':_0x2fc007[_0xd5de('0x88')][_0xd5de('0xbc')],'OrderBy':0x0},{'where':{'ContactId':_0x720caf['id']}});}})[_0xd5de('0x17')](function(){return _0x720caf;})['then'](respondWithResult(_0x407b8f,null))[_0xd5de('0x7f')](handleError(_0x407b8f,null));};exports['getTags']=function(_0x4a3e2b,_0x23353a){var _0x2fc0bb={};var _0x49739f={};var _0x352d03;var _0x4eca63;return db[_0xd5de('0x1f')][_0xd5de('0xbd')]({'where':{'id':_0x4a3e2b[_0xd5de('0x80')]['id']}})['then'](handleEntityNotFound(_0x23353a,null))[_0xd5de('0x17')](function(_0x2dbe9d){if(_0x2dbe9d){_0x352d03=_0x2dbe9d;_0x49739f[_0xd5de('0x2a')]=_[_0xd5de('0x22')](db['Tag'][_0xd5de('0xbe')]);_0x49739f[_0xd5de('0x2b')]=_['keys'](_0x4a3e2b[_0xd5de('0x2b')]);_0x49739f[_0xd5de('0xbf')]=_[_0xd5de('0x2c')](_0x49739f[_0xd5de('0x2a')],_0x49739f[_0xd5de('0x2b')]);_0x2fc0bb[_0xd5de('0x2d')]=_[_0xd5de('0x2c')](_0x49739f[_0xd5de('0x2a')],qs[_0xd5de('0x2e')](_0x4a3e2b[_0xd5de('0x2b')][_0xd5de('0x2e')]));_0x2fc0bb[_0xd5de('0x2d')]=_0x2fc0bb[_0xd5de('0x2d')][_0xd5de('0x21')]?_0x2fc0bb[_0xd5de('0x2d')]:_0x49739f[_0xd5de('0x2a')];_0x2fc0bb[_0xd5de('0x30')]=qs[_0xd5de('0x31')](_0x4a3e2b[_0xd5de('0x2b')][_0xd5de('0x31')]);_0x2fc0bb[_0xd5de('0x3e')]=qs[_0xd5de('0xbf')](_['pick'](_0x4a3e2b[_0xd5de('0x2b')],_0x49739f[_0xd5de('0xbf')]));if(_0x4a3e2b[_0xd5de('0x2b')]['filter']){_0x2fc0bb[_0xd5de('0x3e')]=_[_0xd5de('0x77')](_0x2fc0bb[_0xd5de('0x3e')],{'$or':_[_0xd5de('0x47')](_0x2fc0bb['attributes'],function(_0x10859a){var _0x1b94c1={};_0x1b94c1[_0x10859a]={'$like':'%'+_0x4a3e2b[_0xd5de('0x2b')][_0xd5de('0x54')]+'%'};return _0x1b94c1;})});}_0x2fc0bb=_[_0xd5de('0x77')]({},_0x2fc0bb,_0x4a3e2b[_0xd5de('0xc0')]);return _0x352d03[_0xd5de('0xc1')](_0x2fc0bb);}})[_0xd5de('0x17')](function(_0x2cc2f1){if(_0x2cc2f1){_0x4eca63=_0x2cc2f1[_0xd5de('0x21')];if(!_0x4a3e2b[_0xd5de('0x2b')][_0xd5de('0x87')]('nolimit')){_0x2fc0bb['limit']=qs['limit'](_0x4a3e2b[_0xd5de('0x2b')]['limit']);_0x2fc0bb[_0xd5de('0xf')]=qs[_0xd5de('0xf')](_0x4a3e2b[_0xd5de('0x2b')][_0xd5de('0xf')]);}return _0x352d03[_0xd5de('0xc1')](_0x2fc0bb);}})[_0xd5de('0x17')](function(_0x4f6beb){if(_0x4f6beb){return _0x4f6beb?{'count':_0x4eca63,'rows':_0x4f6beb}:null;}})[_0xd5de('0x17')](respondWithResult(_0x23353a,null))[_0xd5de('0x7f')](handleError(_0x23353a,null));};exports[_0xd5de('0xc2')]=function(_0x30fcf6,_0xd17f7f){if(_0x30fcf6[_0xd5de('0x88')]['id']){delete _0x30fcf6['body']['id'];}return db[_0xd5de('0x1f')][_0xd5de('0xbd')]({'where':{'id':_0x30fcf6[_0xd5de('0x80')]['id']}})['then'](handleEntityNotFound(_0xd17f7f,null))[_0xd5de('0x17')](function(_0x968e48){if(_0x968e48){return _0x968e48[_0xd5de('0xc2')](_0x30fcf6[_0xd5de('0x88')]['ids']||[]);}return null;})[_0xd5de('0x17')](respondWithResult(_0xd17f7f,null))[_0xd5de('0x7f')](handleError(_0xd17f7f,null));};exports[_0xd5de('0xc3')]=function(_0x438d8a,_0xf628c8){var _0x57bcf1=[];_0x57bcf1[_0xd5de('0x24')](addAdditionalPhones(_0x438d8a[_0xd5de('0x88')]));Promise['all'](_0x57bcf1)[_0xd5de('0x17')](function(){_0x57bcf1=[];_0x57bcf1[_0xd5de('0x24')](deleteCmHopperPhones(_0x438d8a[_0xd5de('0x88')]['id']));_0x57bcf1['push'](addCmHopperPhones(_0x438d8a[_0xd5de('0x88')]['id']));Promise[_0xd5de('0x27')](_0x57bcf1)[_0xd5de('0x17')](function(){return[0x1];})[_0xd5de('0x17')](respondWithResult(_0xf628c8,null));});};function addAdditionalPhones(_0x4bb2dc){var _0x20bd7c;return new Promise(function(_0x1d1ddd,_0x208ec7){return db[_0xd5de('0x9b')][_0xd5de('0x18')]({'where':{'CmContactId':_0x4bb2dc['id']}})[_0xd5de('0x17')](function(){db[_0xd5de('0xc4')][_0xd5de('0x83')]({'raw':!![],'attributes':['id',_0xd5de('0xc5')]})[_0xd5de('0x17')](function(_0x5d16f8){var _0x633f16=[];for(var _0x1b5353=0x0;_0x1b5353<_0x4bb2dc[_0xd5de('0xc6')][_0xd5de('0x21')];_0x1b5353++){var _0x1a0614=_0x4bb2dc[_0xd5de('0xc7')]?_[_0xd5de('0x55')](_0x4bb2dc[_0xd5de('0xc7')][_0x1b5353])?'':_0x4bb2dc[_0xd5de('0xc7')][_0x1b5353]:_0x4bb2dc[_0xd5de('0xc6')][_0x1b5353][_0xd5de('0xc8')]?_0x4bb2dc[_0xd5de('0xc6')][_0x1b5353][_0xd5de('0xc8')]:'';var _0x27d177=_[_0xd5de('0x55')](_0x4bb2dc['items'][_0x1b5353]['description'])?'':_0x4bb2dc[_0xd5de('0xc6')][_0x1b5353][_0xd5de('0xc9')];var _0x412ed0=_0x1a0614+':'+_0x4bb2dc['items'][_0x1b5353][_0xd5de('0xbc')]+'§'+_0x27d177;if(_[_0xd5de('0x55')](_0x20bd7c))_0x20bd7c=_0x412ed0;else _0x20bd7c+=';'+_0x412ed0;var _0x193b7d=null;if(_0x4bb2dc['item_types']){if(!_['isNil'](_0x4bb2dc['item_types'][_0x1b5353])){var _0x5c7724=_[_0xd5de('0x44')](_0x5d16f8,function(_0x111154){return _0x111154['id']===_0x4bb2dc[_0xd5de('0xc7')][_0x1b5353];});if(!_[_0xd5de('0x55')](_0x5c7724)){_0x193b7d=_0x5c7724[_0xd5de('0xc5')];}}}else{if(!_[_0xd5de('0x55')](_0x4bb2dc[_0xd5de('0xc6')][_0x1b5353])){var _0x5c7724=_['find'](_0x5d16f8,function(_0x3bea82){return _0x3bea82['id']===_0x4bb2dc[_0xd5de('0xc6')][_0x1b5353]['ItemTypeId'];});if(!_['isNil'](_0x5c7724)){_0x193b7d=_0x1b5353;}}}if(_[_0xd5de('0x55')](_0x193b7d)){_0x193b7d=0x64;}_0x633f16[_0xd5de('0x24')](addAdditionalPhone(_0x4bb2dc['id'],_0x4bb2dc['items'][_0x1b5353]['phone'],_0x4bb2dc[_0xd5de('0xc7')]?_[_0xd5de('0x55')](_0x4bb2dc[_0xd5de('0xc7')][_0x1b5353])?null:_0x4bb2dc[_0xd5de('0xc7')][_0x1b5353]:_0x4bb2dc[_0xd5de('0xc6')][_0x1b5353]['ItemTypeId']?_0x4bb2dc[_0xd5de('0xc6')][_0x1b5353][_0xd5de('0xc8')]:null,_0x193b7d,_0x27d177));}Promise[_0xd5de('0x27')](_0x633f16)[_0xd5de('0x17')](function(){db[_0xd5de('0x1f')][_0xd5de('0x16')]({'AdditionalPhones':_0x20bd7c},{'where':{'id':_0x4bb2dc['id']}})[_0xd5de('0x17')](function(){_0x1d1ddd(0x1);});});});});});}function addAdditionalPhone(_0x3135ac,_0x260024,_0x4ce41e,_0x50de59,_0x3c6ca5){return db[_0xd5de('0x9b')][_0xd5de('0x44')]({'where':{'CmContactId':_0x3135ac,'item':_0x260024}})[_0xd5de('0x17')](function(_0x2f28e9){if(_0x2f28e9)logger[_0xd5de('0x8f')](_0xd5de('0xca'),_0x2f28e9);else{db['CmContactHasItem'][_0xd5de('0x93')]({'CmContactId':_0x3135ac,'item':_0x260024,'ItemTypeId':_0x4ce41e,'OrderBy':_0x50de59,'ItemClass':'PHONE','description':_0x3c6ca5});}});}function deletePhones(_0x47fec4){return db[_0xd5de('0x9b')]['destroy']({'where':{'CmContactId':_0x47fec4}});}function deleteCmHopperPhones(_0x3efa4c){return new Promise(function(_0xef7247,_0x2263de){return db[_0xd5de('0x8e')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3efa4c}})[_0xd5de('0x17')](function(_0x19b6ab){db[_0xd5de('0xcb')]['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x19b6ab,'id')}}});})['then'](function(){_0xef7247(0x1);});});}function addCmHopperPhones(_0x32e143){return new Promise(function(_0x5c191b,_0x5985b7){return db[_0xd5de('0x8e')][_0xd5de('0x83')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x32e143}})[_0xd5de('0x17')](function(_0x1ca1fb){var _0x4431a6=[];_[_0xd5de('0x47')](_0x1ca1fb,function(_0x5e9902){_0x4431a6[_0xd5de('0x24')](createCmHopperPhone(_0x32e143,_0x5e9902['id']));});Promise[_0xd5de('0x27')](_0x4431a6)['then'](function(){_0x5c191b(0x1);});});});}function createCmHopperPhone(_0x4d7826,_0x897e8f){return new Promise(function(_0xefe732,_0x39b268){db['CmContactHasItem'][_0xd5de('0x83')]({'raw':!![],'attributes':[_0xd5de('0xcc'),_0xd5de('0xc5')],'where':{'CmContactId':_0x4d7826,'ItemClass':'PHONE'},'include':[{'model':db[_0xd5de('0xc4')],'attributes':[_0xd5de('0xc5')],'as':_0xd5de('0xb1')}],'order':[_0xd5de('0xc5'),db[_0xd5de('0x74')][_0xd5de('0xb2')](_0xd5de('0xcd'))]})['then'](function(_0x1e24cc){var _0x176938=0x1;var _0x2ac344=_['map'](_0x1e24cc,function(_0x8a1731){_0x8a1731[_0xd5de('0xce')]=_0x897e8f;_0x8a1731['phone']=_0x8a1731[_0xd5de('0xcc')];_0x8a1731[_0xd5de('0xc5')]=_0x176938;delete _0x8a1731[_0xd5de('0xcf')];_0x176938=_0x176938+0x1;return _0x8a1731;});return db[_0xd5de('0xcb')][_0xd5de('0xab')](_0x2ac344,{});})[_0xd5de('0x17')](function(){_0xefe732(0x1);});});}function insertAdditionalPhones(_0x309378,_0x49b7fc){return new Promise(function(_0x872815,_0x1f39de){var _0x43c49f=[];for(var _0x3fb281=0x0;_0x3fb281<_0x49b7fc[_0xd5de('0x21')];_0x3fb281++){var _0x3be66e=_0x49b7fc[_0x3fb281];_0x43c49f[_0xd5de('0x24')](parseContactItemType(_0x3be66e));}Promise[_0xd5de('0x27')](_0x43c49f)[_0xd5de('0x17')](function(){var _0xfec69={'id':_0x309378['id'],'items':_0x49b7fc};return addAdditionalPhones(_0xfec69)[_0xd5de('0x17')](function(_0x57a229){return addCmHopperPhones(_0x309378['id']);});})['then'](function(){_0x872815(_0x309378);});});}function parseContactItemType(_0xcd7509){return new Promise(function(_0x2dbbf2,_0x4d7440){if(_0xcd7509[_0xd5de('0x87')](_0xd5de('0xc8'))){_0x2dbbf2(_0xcd7509);}else{return db[_0xd5de('0xc4')][_0xd5de('0x44')]({'where':{'name':_0xcd7509[_0xd5de('0xb1')]}})[_0xd5de('0x17')](function(_0x1d9a85){if(_[_0xd5de('0x55')](_0x1d9a85))_0xcd7509[_0xd5de('0xc8')]=null;else _0xcd7509[_0xd5de('0xc8')]=_0x1d9a85['id'];_0x2dbbf2(_0xcd7509);});}});}exports[_0xd5de('0xd0')]=function(_0x159bed,_0x495b5c){return db[_0xd5de('0x9b')][_0xd5de('0x83')]({'raw':!![],'where':{'CmContactId':_0x159bed[_0xd5de('0x80')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xd5de('0xc4')],'as':_0xd5de('0xb1')}],'order':[[_0xd5de('0xc5')],[db[_0xd5de('0x74')][_0xd5de('0xb2')](_0xd5de('0xcd'))]]})[_0xd5de('0x17')](function(_0x33cdd7){return _0x33cdd7;})[_0xd5de('0x17')](respondWithResult(_0x495b5c,null))['catch'](handleError(_0x495b5c,null));};exports[_0xd5de('0xd1')]=function(_0x9086da,_0x4e0476){return db[_0xd5de('0x9b')][_0xd5de('0x83')]({'raw':!![],'where':{'CmContactId':_0x9086da[_0xd5de('0x88')][_0xd5de('0xd2')]}})[_0xd5de('0x17')](function(_0x174dff){var _0x5b653e=_['map'](_0x174dff,function(_0x32376e){_0x32376e[_0xd5de('0xd3')]=_0x9086da['body'][_0xd5de('0xd4')];return _0x32376e;});return db[_0xd5de('0x9b')][_0xd5de('0xab')](_0x5b653e,{});})[_0xd5de('0x17')](function(_0x5875f2){return addCmHopperPhones(_0x9086da['body'][_0xd5de('0xd4')]);})['then'](function(_0x5480dc){return['ok'];})[_0xd5de('0x17')](respondWithResult(_0x4e0476,null))[_0xd5de('0x7f')](handleError(_0x4e0476,null));};exports['rescheduleAdditionalPhones']=function(_0x2a6575,_0x396047){var _0x835df9=[];_0x835df9[_0xd5de('0x24')](createCmHopperPhone(_0x2a6575[_0xd5de('0x88')]['id'],_0x2a6575[_0xd5de('0x88')][_0xd5de('0xd5')]));Promise[_0xd5de('0x27')](_0x835df9)[_0xd5de('0x17')](function(){return[0x1];})[_0xd5de('0x17')](respondWithResult(_0x396047,null));};exports[_0xd5de('0xd6')]=function(_0x4300c1,_0x1158fe){var _0x229e68={'raw':![],'where':{}};var _0x796b4={};var _0x3fbb76={'count':0x0,'rows':[]};return db[_0xd5de('0x1f')]['findOne']({'where':{'id':_0x4300c1[_0xd5de('0x80')]['id']}})[_0xd5de('0x17')](handleEntityNotFound(_0x1158fe,null))[_0xd5de('0x17')](function(_0x7fe8c2){if(_0x7fe8c2){_0x796b4[_0xd5de('0x2a')]=_[_0xd5de('0x22')](db[_0xd5de('0x8e')]['rawAttributes']);_0x796b4[_0xd5de('0x2b')]=_[_0xd5de('0x22')](_0x4300c1['query']);_0x796b4[_0xd5de('0xbf')]=_[_0xd5de('0x2c')](_0x796b4[_0xd5de('0x2a')],_0x796b4[_0xd5de('0x2b')]);_0x229e68['attributes']=_[_0xd5de('0x2c')](_0x796b4[_0xd5de('0x2a')],qs[_0xd5de('0x2e')](_0x4300c1[_0xd5de('0x2b')][_0xd5de('0x2e')]));_0x229e68['attributes']=_0x229e68[_0xd5de('0x2d')][_0xd5de('0x21')]?_0x229e68[_0xd5de('0x2d')]:_0x796b4['model'];if(!_0x4300c1['query'][_0xd5de('0x87')](_0xd5de('0x2f'))){_0x229e68[_0xd5de('0x11')]=qs[_0xd5de('0x11')](_0x4300c1[_0xd5de('0x2b')][_0xd5de('0x11')]);_0x229e68[_0xd5de('0xf')]=qs[_0xd5de('0xf')](_0x4300c1[_0xd5de('0x2b')]['offset']);}_0x229e68[_0xd5de('0x30')]=qs[_0xd5de('0x31')](_0x4300c1[_0xd5de('0x2b')][_0xd5de('0x31')]);_0x229e68['where']=qs['filters'](_[_0xd5de('0x32')](_0x4300c1[_0xd5de('0x2b')],_0x796b4[_0xd5de('0xbf')]));_0x229e68[_0xd5de('0x3e')][_0xd5de('0xd7')]=_0x7fe8c2['id'];if(_0x4300c1[_0xd5de('0x2b')]['filter']){_0x229e68['where']=_[_0xd5de('0x77')](_0x229e68[_0xd5de('0x3e')],{'$or':_[_0xd5de('0x47')](_0x229e68[_0xd5de('0x2d')],function(_0x24b1ce){var _0x428f2d={};_0x428f2d[_0x24b1ce]={'$like':'%'+_0x4300c1[_0xd5de('0x2b')][_0xd5de('0x54')]+'%'};return _0x428f2d;})});}_0x229e68=_['merge']({},_0x229e68,_0x4300c1[_0xd5de('0xc0')]);return db[_0xd5de('0x8e')][_0xd5de('0x12')]({'where':_0x229e68[_0xd5de('0x3e')]})['then'](function(_0x695b33){_0x3fbb76[_0xd5de('0x12')]=_0x695b33;if(_0x4300c1[_0xd5de('0x2b')][_0xd5de('0xd8')]){_0x229e68[_0xd5de('0xd9')]=[{'all':!![]}];}return db['CmHopper'][_0xd5de('0x83')](_0x229e68);})[_0xd5de('0x17')](function(_0x40e668){_0x3fbb76['rows']=_0x40e668;return _0x3fbb76;});}})[_0xd5de('0x17')](respondWithFilteredResult(_0x1158fe,_0x229e68))[_0xd5de('0x7f')](handleError(_0x1158fe,null));};exports[_0xd5de('0xda')]=function(_0x4e9251,_0x4a187a){var _0x5e5a23={'raw':!![],'where':{}};var _0x24a6ad={};var _0x46223a={'count':0x0,'rows':[]};return db[_0xd5de('0x1f')][_0xd5de('0xbd')]({'where':{'id':_0x4e9251['params']['id']}})[_0xd5de('0x17')](handleEntityNotFound(_0x4a187a,null))[_0xd5de('0x17')](function(_0xe205b1){if(_0xe205b1){_0x24a6ad[_0xd5de('0x2a')]=_[_0xd5de('0x22')](db['CmHopperHistory'][_0xd5de('0xbe')]);_0x24a6ad['query']=_['keys'](_0x4e9251[_0xd5de('0x2b')]);_0x24a6ad['filters']=_[_0xd5de('0x2c')](_0x24a6ad['model'],_0x24a6ad[_0xd5de('0x2b')]);_0x5e5a23[_0xd5de('0x2d')]=_[_0xd5de('0x2c')](_0x24a6ad[_0xd5de('0x2a')],qs[_0xd5de('0x2e')](_0x4e9251[_0xd5de('0x2b')][_0xd5de('0x2e')]));_0x5e5a23[_0xd5de('0x2d')]=_0x5e5a23[_0xd5de('0x2d')][_0xd5de('0x21')]?_0x5e5a23[_0xd5de('0x2d')]:_0x24a6ad[_0xd5de('0x2a')];if(!_0x4e9251[_0xd5de('0x2b')]['hasOwnProperty'](_0xd5de('0x2f'))){_0x5e5a23[_0xd5de('0x11')]=qs[_0xd5de('0x11')](_0x4e9251[_0xd5de('0x2b')][_0xd5de('0x11')]);_0x5e5a23['offset']=qs[_0xd5de('0xf')](_0x4e9251[_0xd5de('0x2b')][_0xd5de('0xf')]);}_0x5e5a23['order']=qs[_0xd5de('0x31')](_0x4e9251['query']['sort']);_0x5e5a23[_0xd5de('0x3e')]=qs[_0xd5de('0xbf')](_[_0xd5de('0x32')](_0x4e9251[_0xd5de('0x2b')],_0x24a6ad[_0xd5de('0xbf')]));_0x5e5a23[_0xd5de('0x3e')][_0xd5de('0xd7')]=_0xe205b1['id'];if(_0x4e9251[_0xd5de('0x2b')]['filter']){_0x5e5a23[_0xd5de('0x3e')]=_[_0xd5de('0x77')](_0x5e5a23['where'],{'$or':_[_0xd5de('0x47')](_0x5e5a23[_0xd5de('0x2d')],function(_0x3e19ce){var _0x3083ae={};_0x3083ae[_0x3e19ce]={'$like':'%'+_0x4e9251[_0xd5de('0x2b')][_0xd5de('0x54')]+'%'};return _0x3083ae;})});}_0x5e5a23=_[_0xd5de('0x77')]({},_0x5e5a23,_0x4e9251[_0xd5de('0xc0')]);return db['CmHopperHistory'][_0xd5de('0x12')]({'where':_0x5e5a23[_0xd5de('0x3e')]})[_0xd5de('0x17')](function(_0x5d4dcf){_0x46223a['count']=_0x5d4dcf;if(_0x4e9251[_0xd5de('0x2b')][_0xd5de('0xd8')]){_0x5e5a23[_0xd5de('0xd9')]=[{'all':!![]}];}return db[_0xd5de('0x9c')]['findAll'](_0x5e5a23);})[_0xd5de('0x17')](function(_0x5f5144){_0x46223a[_0xd5de('0xdb')]=_0x5f5144;return _0x46223a;});}})[_0xd5de('0x17')](respondWithFilteredResult(_0x4a187a,_0x5e5a23))[_0xd5de('0x7f')](handleError(_0x4a187a,null));};exports['getHopperFinals']=function(_0x4b8fd7,_0x1c2fe8){var _0x550872={'raw':!![],'where':{}};var _0xc13d1={};var _0x936589={'count':0x0,'rows':[]};return db['CmContact'][_0xd5de('0xbd')]({'where':{'id':_0x4b8fd7[_0xd5de('0x80')]['id']}})[_0xd5de('0x17')](handleEntityNotFound(_0x1c2fe8,null))['then'](function(_0x513da5){if(_0x513da5){_0xc13d1[_0xd5de('0x2a')]=_[_0xd5de('0x22')](db['CmHopperFinal']['rawAttributes']);_0xc13d1[_0xd5de('0x2b')]=_[_0xd5de('0x22')](_0x4b8fd7[_0xd5de('0x2b')]);_0xc13d1['filters']=_[_0xd5de('0x2c')](_0xc13d1[_0xd5de('0x2a')],_0xc13d1[_0xd5de('0x2b')]);_0x550872['attributes']=_[_0xd5de('0x2c')](_0xc13d1[_0xd5de('0x2a')],qs['fields'](_0x4b8fd7[_0xd5de('0x2b')][_0xd5de('0x2e')]));_0x550872[_0xd5de('0x2d')]=_0x550872[_0xd5de('0x2d')][_0xd5de('0x21')]?_0x550872[_0xd5de('0x2d')]:_0xc13d1[_0xd5de('0x2a')];if(!_0x4b8fd7[_0xd5de('0x2b')][_0xd5de('0x87')](_0xd5de('0x2f'))){_0x550872[_0xd5de('0x11')]=qs['limit'](_0x4b8fd7['query'][_0xd5de('0x11')]);_0x550872[_0xd5de('0xf')]=qs[_0xd5de('0xf')](_0x4b8fd7['query'][_0xd5de('0xf')]);}_0x550872[_0xd5de('0x30')]=qs[_0xd5de('0x31')](_0x4b8fd7[_0xd5de('0x2b')][_0xd5de('0x31')]);_0x550872[_0xd5de('0x3e')]=qs['filters'](_['pick'](_0x4b8fd7['query'],_0xc13d1[_0xd5de('0xbf')]));_0x550872[_0xd5de('0x3e')]['ContactId']=_0x513da5['id'];if(_0x4b8fd7[_0xd5de('0x2b')][_0xd5de('0x54')]){_0x550872[_0xd5de('0x3e')]=_[_0xd5de('0x77')](_0x550872[_0xd5de('0x3e')],{'$or':_[_0xd5de('0x47')](_0x550872['attributes'],function(_0x7bf624){var _0x408b7e={};_0x408b7e[_0x7bf624]={'$like':'%'+_0x4b8fd7[_0xd5de('0x2b')]['filter']+'%'};return _0x408b7e;})});}_0x550872=_[_0xd5de('0x77')]({},_0x550872,_0x4b8fd7[_0xd5de('0xc0')]);return db[_0xd5de('0xdc')][_0xd5de('0x12')]({'where':_0x550872[_0xd5de('0x3e')]})[_0xd5de('0x17')](function(_0x234811){_0x936589[_0xd5de('0x12')]=_0x234811;if(_0x4b8fd7[_0xd5de('0x2b')]['includeAll']){_0x550872[_0xd5de('0xd9')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x550872);})['then'](function(_0x23c07d){_0x936589['rows']=_0x23c07d;return _0x936589;});}})['then'](respondWithFilteredResult(_0x1c2fe8,_0x550872))[_0xd5de('0x7f')](handleError(_0x1c2fe8,null));};exports[_0xd5de('0xdd')]=function(_0x5a51cc,_0x1d8397){var _0x5a55fc={'raw':!![],'where':{}};var _0x4cbbe8={};var _0x14e34e={'count':0x0,'rows':[]};return db[_0xd5de('0x1f')]['findOne']({'where':{'id':_0x5a51cc[_0xd5de('0x80')]['id']}})[_0xd5de('0x17')](handleEntityNotFound(_0x1d8397,null))[_0xd5de('0x17')](function(_0x2575f0){if(_0x2575f0){_0x4cbbe8[_0xd5de('0x2a')]=_[_0xd5de('0x22')](db['JscriptySessionReport'][_0xd5de('0xbe')]);_0x4cbbe8[_0xd5de('0x2b')]=_[_0xd5de('0x22')](_0x5a51cc[_0xd5de('0x2b')]);_0x4cbbe8['filters']=_[_0xd5de('0x2c')](_0x4cbbe8['model'],_0x4cbbe8[_0xd5de('0x2b')]);_0x5a55fc[_0xd5de('0x2d')]=_[_0xd5de('0x2c')](_0x4cbbe8[_0xd5de('0x2a')],qs[_0xd5de('0x2e')](_0x5a51cc[_0xd5de('0x2b')][_0xd5de('0x2e')]));_0x5a55fc[_0xd5de('0x2d')]=_0x5a55fc[_0xd5de('0x2d')]['length']?_0x5a55fc[_0xd5de('0x2d')]:_0x4cbbe8['model'];if(!_0x5a51cc[_0xd5de('0x2b')][_0xd5de('0x87')](_0xd5de('0x2f'))){_0x5a55fc[_0xd5de('0x11')]=qs['limit'](_0x5a51cc[_0xd5de('0x2b')]['limit']);_0x5a55fc['offset']=qs[_0xd5de('0xf')](_0x5a51cc[_0xd5de('0x2b')][_0xd5de('0xf')]);}_0x5a55fc[_0xd5de('0x30')]=qs['sort'](_0x5a51cc[_0xd5de('0x2b')]['sort']);_0x5a55fc['where']=qs['filters'](_[_0xd5de('0x32')](_0x5a51cc[_0xd5de('0x2b')],_0x4cbbe8['filters']));_0x5a55fc[_0xd5de('0x3e')]['ContactId']=_0x2575f0['id'];if(_0x5a51cc[_0xd5de('0x2b')][_0xd5de('0x54')]){_0x5a55fc['where']=_[_0xd5de('0x77')](_0x5a55fc[_0xd5de('0x3e')],{'$or':_[_0xd5de('0x47')](_0x5a55fc[_0xd5de('0x2d')],function(_0xc2e7d8){var _0x29440f={};_0x29440f[_0xc2e7d8]={'$like':'%'+_0x5a51cc[_0xd5de('0x2b')][_0xd5de('0x54')]+'%'};return _0x29440f;})});}_0x5a55fc=_['merge']({},_0x5a55fc,_0x5a51cc['options']);return db[_0xd5de('0xa4')][_0xd5de('0x12')]({'where':_0x5a55fc[_0xd5de('0x3e')]})[_0xd5de('0x17')](function(_0x517a54){_0x14e34e[_0xd5de('0x12')]=_0x517a54;if(_0x5a51cc[_0xd5de('0x2b')][_0xd5de('0xd8')]){_0x5a55fc[_0xd5de('0xd9')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xd5de('0x83')](_0x5a55fc);})[_0xd5de('0x17')](function(_0x20bed1){_0x14e34e[_0xd5de('0xdb')]=_0x20bed1;return _0x14e34e;});}})[_0xd5de('0x17')](respondWithFilteredResult(_0x1d8397,_0x5a55fc))[_0xd5de('0x7f')](handleError(_0x1d8397,null));};exports[_0xd5de('0xde')]=function(_0x143b5f,_0x5aede9){try{if(!_0x143b5f[_0xd5de('0x88')][_0xd5de('0x58')]){throw new Error(_0xd5de('0xdf'));}if(!_0x143b5f['body'][_0xd5de('0xe0')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x143b5f[_0xd5de('0x88')]['binding_values']){throw new Error(_0xd5de('0xe1'));}if(!_0x143b5f[_0xd5de('0x88')][_0xd5de('0xe2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4c8543=_0x143b5f['body'][_0xd5de('0xe0')][_0xd5de('0x5e')](',');var _0x1b4405=_0x143b5f['body'][_0xd5de('0xe3')][_0xd5de('0x5e')](',');if(!_0x4c8543[_0xd5de('0x21')]||!_0x1b4405[_0xd5de('0x21')]||_0x4c8543[_0xd5de('0x21')]!==_0x1b4405[_0xd5de('0x21')]){throw new Error(_0xd5de('0xe4'));}_0x143b5f[_0xd5de('0x88')]['fields']=_[_0xd5de('0xe5')](_0x4c8543,_0x1b4405);if(!_0x143b5f[_0xd5de('0x88')][_0xd5de('0x2e')][_0xd5de('0xbc')]){throw new Error(_0xd5de('0xe6'));}if(!_0x143b5f['body'][_0xd5de('0x2e')]['firstName']){throw new Error(_0xd5de('0xe7'));}var _0x502bc0=path[_0xd5de('0x8c')](config[_0xd5de('0xe8')],_0xd5de('0xe9'),_0x143b5f[_0xd5de('0xea')][_0xd5de('0xeb')]);fs[_0xd5de('0xec')](_0x502bc0,parseInt('0777',0x8));var _0x517d86=require('child_process')[_0xd5de('0xed')](path[_0xd5de('0x8c')](__dirname,_0xd5de('0xee')),[_0x502bc0,_0x143b5f[_0xd5de('0x88')]['binding_keys'],_0x143b5f[_0xd5de('0x88')]['binding_values'],_0x143b5f[_0xd5de('0x88')]['ListId'],_0x143b5f[_0xd5de('0x88')][_0xd5de('0xef')],_0x143b5f[_0xd5de('0x88')][_0xd5de('0xac')],_0x143b5f['body'][_0xd5de('0xe2')]]);return _0x5aede9[_0xd5de('0xe')](0xc8)[_0xd5de('0x15')]({'message':'File\x20uploaded\x20correctly!','pid':_0x517d86[_0xd5de('0xf0')]});}catch(_0x4210f2){return _0x5aede9[_0xd5de('0xe')](0x1f4)[_0xd5de('0x1d')](_0x4210f2);}};exports[_0xd5de('0xf1')]=function(_0x102c1c,_0x17a643){var _0x2472b1=fs[_0xd5de('0xf2')](_0x102c1c[_0xd5de('0xea')]['path']);Papa[_0xd5de('0xf3')](_0x2472b1,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x521328){return _0x17a643[_0xd5de('0xe')](0xc8)[_0xd5de('0x15')]({'file':_0x102c1c[_0xd5de('0xea')],'fields':_0x521328[_0xd5de('0xf4')][_0xd5de('0x2e')]});}});};exports['import']=function(_0x129f51,_0x326998){return db['User'][_0xd5de('0x83')]({'raw':!![],'attributes':['id'],'where':{'role':_0xd5de('0x71')}})[_0xd5de('0x17')](function(_0xfc82a0){var _0x581136=![];if(!_0x129f51[_0xd5de('0x88')][_0xd5de('0x58')]){throw new Error(_0xd5de('0xdf'));}if(!_0x129f51[_0xd5de('0x88')]['binding'][_0xd5de('0xbc')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x129f51[_0xd5de('0x88')][_0xd5de('0xf5')][_0xd5de('0xf6')]){throw new Error(_0xd5de('0xe7'));}if(!_0x129f51[_0xd5de('0x88')]['socket_timestamp']){throw new Error(_0xd5de('0xf7'));}var _0x3cee8f=require(_0xd5de('0xf8'))[_0xd5de('0xed')](path[_0xd5de('0x8c')](__dirname,_0xd5de('0xf9')),[_0x129f51['params']['id'],JSON[_0xd5de('0xfa')](_0x129f51[_0xd5de('0x88')]),JSON[_0xd5de('0xfa')](_0xfc82a0)]);_0x3cee8f['on']('message',function(){_0x581136=!![];return _0x326998['status'](0xc8)['json']({'message':_0xd5de('0xfb'),'pid':_0x3cee8f[_0xd5de('0xf0')]});});_0x3cee8f['on'](_0xd5de('0xfc'),function(_0x3bc92b){if(_0x3bc92b&&!_0x581136){return _0x326998[_0xd5de('0xe')](0x1f4)[_0xd5de('0x15')]({'message':'error\x20child\x20process','pid':_0x3cee8f[_0xd5de('0xf0')]});}});})[_0xd5de('0x7f')](handleError(_0x326998,null));};exports[_0xd5de('0xfd')]=function(_0x44e185,_0x8958b0,_0x2a72e5){return db[_0xd5de('0x4b')][_0xd5de('0x83')]({'raw':!![],'attributes':['id'],'where':{'role':_0xd5de('0x71')}})[_0xd5de('0x17')](function(_0x5dff50){var _0x3894b8=![];if(!_0x44e185[_0xd5de('0x88')][_0xd5de('0x58')]){throw new Error('No\x20ListId\x20specified');}if(!_0x44e185['body'][_0xd5de('0xf5')]['phone']){throw new Error(_0xd5de('0xe6'));}if(!_0x44e185[_0xd5de('0x88')][_0xd5de('0xf5')]['firstName']){throw new Error(_0xd5de('0xe7'));}if(!_0x44e185['body'][_0xd5de('0xe2')]){throw new Error(_0xd5de('0xf7'));}var _0x47e3ff=require(_0xd5de('0xf8'))[_0xd5de('0xed')](path[_0xd5de('0x8c')](__dirname,'../../components/import/cm/csvUpdates'),[_0x44e185[_0xd5de('0x80')]['id'],JSON['stringify'](_0x44e185[_0xd5de('0x88')]),JSON[_0xd5de('0xfa')](_0x5dff50)]);_0x47e3ff['on'](_0xd5de('0xfe'),function(_0x2160ce){_0x3894b8=!![];return _0x8958b0[_0xd5de('0xe')](0xc8)['json']({'message':_0xd5de('0xfb'),'pid':_0x47e3ff[_0xd5de('0xf0')]});});_0x47e3ff['on'](_0xd5de('0xfc'),function(_0x44b58f){if(_0x44b58f&&!_0x3894b8){return _0x8958b0[_0xd5de('0xe')](0x1f4)['json']({'message':_0xd5de('0xff'),'pid':_0x47e3ff[_0xd5de('0xf0')]});}});})[_0xd5de('0x7f')](handleError(_0x8958b0,null));};exports['getJourney']=function(_0x4aa6a6,_0x21071e){var _0x16f936=[_0xd5de('0x100'),'chat',_0xd5de('0x101'),_0xd5de('0x102'),_0xd5de('0x103'),_0xd5de('0x104'),_0xd5de('0x105')];var _0x2c1f8f={'offset':0x0,'order':qs[_0xd5de('0x31')](_0xd5de('0x106'))},_0x5c1fd6={'count':0x0,'rows':[]};Promise[_0xd5de('0x6e')]()[_0xd5de('0x17')](function(){if(_0x4aa6a6['query'][_0xd5de('0x107')]){if(!_[_0xd5de('0x108')](_0x16f936,_0x4aa6a6[_0xd5de('0x2b')]['channel'][_0xd5de('0x109')]())){throw new Error(_0xd5de('0x10a'));}_0x16f936=[_0x4aa6a6[_0xd5de('0x2b')]['channel'][_0xd5de('0x109')]()];}if(_0x4aa6a6[_0xd5de('0x2b')][_0xd5de('0x10b')]){try{var _0xcfcf52=JSON[_0xd5de('0xf3')](_0x4aa6a6[_0xd5de('0x2b')][_0xd5de('0x10b')]);if(!moment(_0xcfcf52['from'])[_0xd5de('0x10c')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0xcfcf52['to'])[_0xd5de('0x10c')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x26b751){throw new Error(_0xd5de('0x10d'));}}if(!_0x4aa6a6[_0xd5de('0x2b')][_0xd5de('0x87')](_0xd5de('0x2f'))){_0x2c1f8f[_0xd5de('0x11')]=qs[_0xd5de('0x11')](_0x4aa6a6[_0xd5de('0x2b')][_0xd5de('0x11')]||0xa);_0x2c1f8f[_0xd5de('0xf')]=qs[_0xd5de('0xf')](_0x4aa6a6[_0xd5de('0x2b')]['offset']);}var _0x1da786=_0x16f936['map'](function(_0x114a76){if(_0x114a76==='voice'){var _0x331504={'attributes':['id','uniqueid',_0xd5de('0x29'),_0xd5de('0x10e'),'destination',_0xd5de('0x10f'),_0xd5de('0x110'),_0xd5de('0x111'),_0xd5de('0x112'),_0xd5de('0x113'),'createdAt',_0xd5de('0x114'),_0xd5de('0x115'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x4aa6a6[_0xd5de('0x80')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0xd5de('0x1c'),_0xd5de('0x116'),_0xd5de('0x117')]}],'order':[[_0xd5de('0x118'),'DESC']]};if(_0x4aa6a6['query'][_0xd5de('0x10b')]){_0x331504[_0xd5de('0x3e')]['createdAt']={'$gte':_0xcfcf52[_0xd5de('0x37')],'$lte':_0xcfcf52['to']};}return db[_0xd5de('0x9e')][_0xd5de('0x119')](_0x331504)[_0xd5de('0x17')](function(_0x351ddf){_0x5c1fd6[_0xd5de('0x12')]+=_0x351ddf[_0xd5de('0x12')];return _[_0xd5de('0x47')](_0x351ddf[_0xd5de('0xdb')],function(_0x31ddad){var _0x1daeef=_0x31ddad[_0xd5de('0x89')]({'plain':!![]});_0x1daeef[_0xd5de('0x107')]=_0x114a76;if(_0x1daeef['User']){_0x1daeef[_0xd5de('0x4b')]={'id':_0x1daeef['User']['id'],'name':_0x1daeef[_0xd5de('0x4b')][_0xd5de('0x1c')],'fullname':_0x1daeef['User'][_0xd5de('0x116')],'alias':_0x1daeef[_0xd5de('0x4b')]['alias']};}return _0x1daeef;});});}else{var _0x19e695=_['startCase'](_0x114a76)+(_0x114a76==='chat'?'Website':'Account');var _0x4e068d={'attributes':['id','closed',_0xd5de('0x11a'),_0xd5de('0x118'),'note',_0xd5de('0x11b'),_0xd5de('0x11c'),_0xd5de('0x11d'),_0xd5de('0x11e'),_0x19e695+'Id'],'where':{'ContactId':_0x4aa6a6[_0xd5de('0x80')]['id']},'include':[{'model':db[_0x19e695],'as':_0xd5de('0x11f'),'attributes':['id',_0xd5de('0x1c'),_0xd5de('0x120')]},{'model':db[_0xd5de('0x4b')],'as':_0xd5de('0x121'),'attributes':['id',_0xd5de('0x1c'),'fullname']},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd5de('0x1c'),_0xd5de('0x35')],'through':{'attributes':[]}}],'order':[[_0xd5de('0x118'),_0xd5de('0x122')]]};if(_0x4aa6a6[_0xd5de('0x2b')][_0xd5de('0x10b')]){_0x4e068d[_0xd5de('0x3e')][_0xd5de('0x118')]={'$gte':_0xcfcf52[_0xd5de('0x37')],'$lte':_0xcfcf52['to']};}switch(_0x114a76){case _0xd5de('0x123'):_0x4e068d[_0xd5de('0x2d')][_0xd5de('0x24')](_0xd5de('0x124'),_0xd5de('0x125'),_0xd5de('0x126'),_0xd5de('0x127'),_0xd5de('0x128'),_0xd5de('0x129'),_0xd5de('0x12a'),'ratingValue',_0xd5de('0x12b'));break;case _0xd5de('0x100'):_0x4e068d[_0xd5de('0x2d')][_0xd5de('0x24')](_0xd5de('0x12c'),_0xd5de('0x12d'));break;case _0xd5de('0x102'):_0x4e068d[_0xd5de('0x2d')][_0xd5de('0x24')](_0xd5de('0x12e'),_0xd5de('0x12f'));break;}return db[_['startCase'](_0x114a76)+_0xd5de('0x130')]['findAndCountAll'](_0x4e068d)[_0xd5de('0x17')](function(_0xb4c8df){_0x5c1fd6['count']+=_0xb4c8df[_0xd5de('0x12')];return _[_0xd5de('0x47')](_0xb4c8df['rows'],function(_0x1b5d92){var _0x3852ca=_0x1b5d92[_0xd5de('0x89')]({'plain':!![]});_0x3852ca['channel']=_0x114a76;if(_0x3852ca[_0xd5de('0x121')]){_0x3852ca[_0xd5de('0x121')]={'id':_0x3852ca[_0xd5de('0x121')]['id'],'name':_0x3852ca['Owner'][_0xd5de('0x1c')],'fullname':_0x3852ca[_0xd5de('0x121')][_0xd5de('0x116')]};}return _0x3852ca;});});}});return Promise[_0xd5de('0x27')](_0x1da786);})[_0xd5de('0x17')](function(_0x11a733){return _(_0x11a733)[_0xd5de('0x131')]()[_0xd5de('0x132')](_0xd5de('0x118'))[_0xd5de('0x133')]()[_0xd5de('0x46')]();})[_0xd5de('0x17')](function(_0x32c137){_0x5c1fd6[_0xd5de('0xdb')]=_0x2c1f8f[_0xd5de('0x11')]?_0x32c137['slice'](_0x2c1f8f[_0xd5de('0xf')],_0x2c1f8f[_0xd5de('0xf')]+_0x2c1f8f[_0xd5de('0x11')]):_0x32c137;return _0x5c1fd6;})[_0xd5de('0x17')](respondWithFilteredResult(_0x21071e,_0x2c1f8f))[_0xd5de('0x7f')](handleError(_0x21071e,null));}; \ No newline at end of file +var _0xe799=['literal','$and','CmCustomField','cf_%d','omit','pickBy','setFields','toParam','values','phone','getTags','rawAttributes','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','options','includeAll','include','getHopperHistories','getHopperFinals','JscriptySessionReport','uploadCsv','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','No\x20ListId\x20specified','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','source','destination','callerid','endtime','duration','note','createdAt','userSecondDisposition','UserId','fullname','findAndCountAll','Website','Account','closed','closedAt','thirdDisposition','key','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','referer','substatus','externalUrl','startCase','flatten','sortBy','slice','moment','bluebird','path','lodash','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','./cmContact.socket','json','offset','undefined','limit','count','Content-Range','update','destroy','then','end','sendStatus','error','stack','name','status','CmContact','describe','keys','length','cf_','push','findOne','trimStart','all','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','tools_tags','select','from','cm_contacts','left_join','cm_user_has_contacts','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','user','getLists','c.ListId\x20IS\x20NULL','role','agent','sequelize','toString','merge','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','startsWith','columnName','findAll','displayName','alias','custom','body','get','mergeWith','isArray','tags','info','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','ListId','findOrCreate','spread','contact','show','Phones','ContactItemType','ItemType'];(function(_0x2993a1,_0x5dda04){var _0x1a11d0=function(_0x36e7e9){while(--_0x36e7e9){_0x2993a1['push'](_0x2993a1['shift']());}};_0x1a11d0(++_0x5dda04);}(_0xe799,0x78));var _0x9e79=function(_0x2a9869,_0x16e672){_0x2a9869=_0x2a9869-0x0;var _0x5d6466=_0xe799[_0x2a9869];return _0x5d6466;};'use strict';var moment=require(_0x9e79('0x0'));var BPromise=require(_0x9e79('0x1'));var util=require('util');var path=require(_0x9e79('0x2'));var fs=require('fs');var _=require(_0x9e79('0x3'));var squel=require('squel');var Papa=require(_0x9e79('0x4'));var Redis=require('ioredis');var qs=require(_0x9e79('0x5'));var as=require(_0x9e79('0x6'));var logger=require(_0x9e79('0x7'))(_0x9e79('0x8'));var config=require(_0x9e79('0x9'));var shared=require('../../config/environment/shared');var db=require(_0x9e79('0xa'))['db'];config[_0x9e79('0xb')]=_['defaults'](config[_0x9e79('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e79('0xb')]));require(_0x9e79('0xc'))['register'](socket);function respondWithResult(_0x25724f,_0x2d848b){_0x2d848b=_0x2d848b||0xc8;return function(_0x22017f){if(_0x22017f){return _0x25724f['status'](_0x2d848b)[_0x9e79('0xd')](_0x22017f);}};}function respondWithFilteredResult(_0x63d5d6,_0x511ac1){return function(_0x26a852){if(_0x26a852){var _0x546849=typeof _0x511ac1[_0x9e79('0xe')]===_0x9e79('0xf')&&typeof _0x511ac1[_0x9e79('0x10')]===_0x9e79('0xf');var _0x22c7ba=_0x26a852[_0x9e79('0x11')];var _0x1388ba=_0x546849?0x0:_0x511ac1['offset'];var _0x2bf536=_0x546849?_0x26a852[_0x9e79('0x11')]:_0x511ac1[_0x9e79('0xe')]+_0x511ac1[_0x9e79('0x10')];var _0x2fb35f;if(_0x2bf536>=_0x22c7ba){_0x2bf536=_0x22c7ba;_0x2fb35f=0xc8;}else{_0x2fb35f=0xce;}_0x63d5d6['status'](_0x2fb35f);return _0x63d5d6['set'](_0x9e79('0x12'),_0x1388ba+'-'+_0x2bf536+'/'+_0x22c7ba)[_0x9e79('0xd')](_0x26a852);}return null;};}function saveUpdates(_0x5d8849){return function(_0x400c91){if(_0x400c91){return _0x400c91[_0x9e79('0x13')](_0x5d8849)['then'](function(_0x2985fe){return _0x2985fe;});}return null;};}function removeEntity(_0xb254fc){return function(_0x4f122a){if(_0x4f122a){return _0x4f122a[_0x9e79('0x14')]()[_0x9e79('0x15')](function(){_0xb254fc['status'](0xcc)[_0x9e79('0x16')]();});}};}function handleEntityNotFound(_0x125326){return function(_0x41a80f){if(!_0x41a80f){_0x125326[_0x9e79('0x17')](0x194);}return _0x41a80f;};}function handleError(_0x49bc4b,_0xba4b23){_0xba4b23=_0xba4b23||0x1f4;return function(_0xe934f5){logger[_0x9e79('0x18')](_0xe934f5[_0x9e79('0x19')]);if(_0xe934f5['name']){delete _0xe934f5[_0x9e79('0x1a')];}_0x49bc4b[_0x9e79('0x1b')](_0xba4b23)['send'](_0xe934f5);};}exports['index']=function(_0x305e20,_0x36699f){var _0x50da6a={},_0x216673={},_0x1f7ed7={'count':0x0,'rows':[]};return db[_0x9e79('0x1c')][_0x9e79('0x1d')]()['then'](function(_0x27ab17){var _0x241c17=[];for(var _0x574cf3=0x0;_0x574cf30x1){_0x3e0f59['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9e79('0x5c')](_0x2d0300),null);}else{if(qs[_0x9e79('0x5d')](_0x2d0300)){_0x3e0f59['or'](_0x9e79('0x5e'),_0x2d0300+'%');_0x3e0f59['or'](_0x9e79('0x5f'),_0x2d0300+'%');_0x3e0f59['or'](_0x9e79('0x60'),_0x2d0300+'%');_0x3e0f59['or']('c.fax\x20LIKE\x20?',_0x2d0300+'%');}else if(qs[_0x9e79('0x61')](_0x2d0300)){_0x3e0f59['or'](_0x9e79('0x62'),_0x2d0300+'%');}else{_0x3e0f59['or'](_0x9e79('0x63'),'%'+_0x2d0300+'%');_0x3e0f59['or']('c.lastName\x20LIKE\x20?','%'+_0x2d0300+'%');_0x3e0f59['or'](_0x9e79('0x62'),'%'+_0x2d0300+'%');}}}}_0x36d947['where'](_0x3e0f59);_0x36d947[_0x9e79('0x64')](_0x9e79('0x65'));var _0x1c93d7={'type':db[_0x9e79('0x66')][_0x9e79('0x67')][_0x9e79('0x68')],'raw':!![]};var _0x8e3026=_0x36d947[_0x9e79('0x69')]()[_0x9e79('0x33')](_0x9e79('0x65'));if(_0x50da6a[_0x9e79('0x2f')]){_0x50da6a[_0x9e79('0x2f')]['forEach'](function(_0x31a5a0){_0x36d947[_0x9e79('0x2f')]('c.'+_0x31a5a0[0x0],_0x31a5a0[0x1]===_0x9e79('0x6a')?![]:!![]);});}if(!_[_0x9e79('0x56')](_0x16d987)){_0x36d947['having'](_0x10cc67);_0x8e3026[_0x9e79('0x31')](_0x9e79('0x6b'),_0x16d987);}BPromise[_0x9e79('0x6c')]()[_0x9e79('0x15')](function(){if(!_0x48ac1e)return;if(_0x305e20[_0x9e79('0x6d')]['role']!=='agent')return;if(!_['some'](_0x48ac1e[_0x9e79('0x41')],[_0x9e79('0x33'),_0x9e79('0x4a')])){return _0x305e20[_0x9e79('0x6d')][_0x9e79('0x6e')]({'attributes':['id'],'raw':!![]})['then'](function(_0xfb8471){if(_[_0x9e79('0x56')](_0xfb8471)){_0x8e3026[_0x9e79('0x31')](_0x9e79('0x6f'));_0x36d947['where']('c.ListId\x20IS\x20NULL');}else{_0x8e3026[_0x9e79('0x31')](_0x9e79('0x57'),_[_0x9e79('0x46')](_0xfb8471,'id'));_0x36d947[_0x9e79('0x31')](_0x9e79('0x57'),_[_0x9e79('0x46')](_0xfb8471,'id'));}});}})[_0x9e79('0x15')](function(){if(_0x305e20[_0x9e79('0x6d')][_0x9e79('0x70')]===_0x9e79('0x71')&&!_0x48ac1e&&!_0x305e20[_0x9e79('0x28')]['ListId'])return[];return db[_0x9e79('0x72')][_0x9e79('0x28')](_0x8e3026[_0x9e79('0x73')](),_0x1c93d7);})[_0x9e79('0x15')](function(_0x418c1f){_0x1f7ed7[_0x9e79('0x11')]=_0x418c1f[_0x9e79('0x1f')];if(_0x1f7ed7[_0x9e79('0x11')]===0x0)return[];return db[_0x9e79('0x72')]['query'](_0x3f9765[_0x9e79('0x73')](),_0x1c93d7)[_0x9e79('0x15')](function(_0x26abee){_0x48da78=_['keyBy'](_0x26abee,'id');_0x1c93d7=_[_0x9e79('0x74')](_0x1c93d7,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x305e20[_0x9e79('0x28')][_0x9e79('0x2c')]){_0x50da6a[_0x9e79('0x2a')][_0x9e79('0x47')](function(_0x22e515){_0x36d947['field']('c.'+_0x22e515);});}else{_0x36d947[_0x9e79('0x33')](_0x9e79('0x65'));_0x36d947[_0x9e79('0x33')]('c.firstName');_0x36d947[_0x9e79('0x33')]('c.lastName');_0x36d947[_0x9e79('0x33')]('c.phone');_0x36d947[_0x9e79('0x33')]('c.mobile');_0x36d947[_0x9e79('0x33')](_0x9e79('0x75'));_0x36d947[_0x9e79('0x33')]('c.email');_0x36d947[_0x9e79('0x33')](_0x9e79('0x76'));_0x36d947[_0x9e79('0x33')](_0x9e79('0x77'));_0x36d947['field'](_0x9e79('0x78'));_0x36d947['field'](_0x9e79('0x79'));_0x36d947[_0x9e79('0x33')](_0x9e79('0x7a'),'TagIds');}if(_0x50da6a[_0x9e79('0x10')])_0x36d947[_0x9e79('0x10')](_0x50da6a[_0x9e79('0x10')]);if(_0x50da6a['offset'])_0x36d947['offset'](_0x50da6a[_0x9e79('0xe')]);return db[_0x9e79('0x72')][_0x9e79('0x28')](_0x36d947['toString'](),_0x1c93d7);});})[_0x9e79('0x15')](function(_0x355003){_0x355003[_0x9e79('0x47')](function(_0x103dfa){if(_0x103dfa[_0x9e79('0x7b')]){_0x103dfa['Tags']=[];_0x103dfa[_0x9e79('0x7b')][_0x9e79('0x45')](',')[_0x9e79('0x47')](function(_0x41c395){_0x103dfa[_0x9e79('0x7c')][_0x9e79('0x21')](_0x48da78[_0x41c395]);});}delete _0x103dfa['TagIds'];});_0x1f7ed7[_0x9e79('0x7d')]=_0x355003;return _0x1f7ed7;})[_0x9e79('0x15')](respondWithFilteredResult(_0x36699f,_0x50da6a));})[_0x9e79('0x7e')](handleError(_0x36699f,null));};exports[_0x9e79('0x14')]=function(_0x36c1c5,_0x25bf5e){return db['CmContact'][_0x9e79('0x42')]({'where':{'id':_0x36c1c5[_0x9e79('0x7f')]['id']}})[_0x9e79('0x15')](handleEntityNotFound(_0x25bf5e,null))[_0x9e79('0x15')](removeEntity(_0x25bf5e,null))[_0x9e79('0x7e')](handleError(_0x25bf5e,null));};exports[_0x9e79('0x1d')]=function(_0x3da09f,_0x3c670c){return db['CmContact'][_0x9e79('0x1d')]()[_0x9e79('0x15')](function(_0x421dd0){delete _0x421dd0['tags'];for(var _0x21f646=0x0;_0x21f6460x0){return new Promise(function(_0xc33a9e,_0xe2d08a){var _0xc34a08=[];for(var _0x210b4f=0x0;_0x210b4f<_0x4a769d[_0x9e79('0x1f')];_0x210b4f++){_0xc34a08[_0x9e79('0x21')](insertAdditionalPhones(_0x4a769d[_0x210b4f][_0x9e79('0xb3')],_0x4a769d[_0x210b4f]['additionalPhones']));}Promise[_0x9e79('0x24')](_0xc34a08)['then'](function(){_0xc33a9e(0x1);});})[_0x9e79('0x15')](function(){return{'success':_0x2fc375,'failure':_0x52cba9,'duplicates':_0x13784e};});}else{return{'success':_0x2fc375,'failure':_0x52cba9,'duplicates':_0x13784e};}}})['then'](respondWithResult(_0x1119b7,0xc9))[_0x9e79('0x7e')](handleError(_0x1119b7,null));};exports[_0x9e79('0xb4')]=function(_0x9f8e7,_0x2ad828){var _0xd854d6;return db[_0x9e79('0x1c')]['describe']()[_0x9e79('0x15')](function(_0x3755ca){return db[_0x9e79('0x1c')][_0x9e79('0x42')]({'where':{'id':_0x9f8e7[_0x9e79('0x7f')]['id']},'include':[{'model':db['Tag'],'as':_0x9e79('0x7c'),'attributes':['id','name',_0x9e79('0x34')],'required':_0x9f8e7[_0x9e79('0x28')]['tag']?!![]:![]},{'model':db[_0x9e79('0x9a')],'as':_0x9e79('0xb5'),'where':{'CmContactId':_0x9f8e7[_0x9e79('0x7f')]['id']},'required':![],'include':[{'model':db[_0x9e79('0xb6')],'as':_0x9e79('0xb7')}]}],'order':[db['sequelize'][_0x9e79('0xb8')]('Phones.OrderBy')],'attributes':_[_0x9e79('0x1e')](_0x3755ca)});})[_0x9e79('0x15')](function(_0x4a3e7a){if(!_[_0x9e79('0x54')](_0x4a3e7a)){_0xd854d6=_0x4a3e7a[_0x9e79('0x87')]({'plain':!![]});var _0x4336a6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4a3e7a&&_0x4a3e7a[_0x9e79('0xb0')]){if(_0x4a3e7a[_0x9e79('0xb0')]){_0x4336a6[_0x9e79('0x31')][_0x9e79('0xb9')][_0x9e79('0x21')]({'ListId':{'$ne':_0x4a3e7a[_0x9e79('0xb0')]}});}}return db[_0x9e79('0xba')]['findAll'](_0x4336a6);}})[_0x9e79('0x15')](function(_0x55f040){if(!_[_0x9e79('0x54')](_0x55f040)){return _['omit'](_0xd854d6,_[_0x9e79('0x46')](_0x55f040,function(_0x115ebd){return util['format'](_0x9e79('0xbb'),_0x115ebd['id']);}));}})['then'](handleEntityNotFound(_0x2ad828,null))['then'](respondWithResult(_0x2ad828,null))[_0x9e79('0x7e')](handleError(_0x2ad828,null));};exports['update']=function(_0x4d9857,_0x5472fd){var _0x3c72f7;if(_0x4d9857[_0x9e79('0x86')]['id']){delete _0x4d9857[_0x9e79('0x86')]['id'];}if(!_[_0x9e79('0x54')](_0x4d9857[_0x9e79('0x86')][_0x9e79('0xa8')])){var _0x1f3b05=_0x4d9857[_0x9e79('0x86')]['dialTimezone'];if(!_['isNil'](shared[_0x9e79('0xa9')][_0x1f3b05]))_0x4d9857[_0x9e79('0x86')]['utcOffset']=shared[_0x9e79('0xa9')][_0x1f3b05][_0x9e79('0xaa')];}return db[_0x9e79('0x1c')]['find']({'where':{'id':_0x4d9857['params']['id']}})[_0x9e79('0x15')](handleEntityNotFound(_0x5472fd,null))[_0x9e79('0x15')](saveUpdates(_0x4d9857[_0x9e79('0x86')],null))[_0x9e79('0x15')](function(_0x5b0f0c){_0x3c72f7=_0x5b0f0c;var _0x2ed6a1={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5b0f0c&&_0x5b0f0c['ListId']){if(_0x5b0f0c[_0x9e79('0xb0')]){_0x2ed6a1[_0x9e79('0x31')][_0x9e79('0xb9')]['push']({'ListId':{'$ne':_0x5b0f0c[_0x9e79('0xb0')]}});}}return db[_0x9e79('0xba')][_0x9e79('0x82')](_0x2ed6a1);})[_0x9e79('0x15')](function(_0x24b18d){if(_0x24b18d){return _[_0x9e79('0xbc')](_[_0x9e79('0xbd')](_0x4d9857['body'],function(_0x43d80c,_0x43a6fb){return _[_0x9e79('0x80')](_0x43a6fb,_0x9e79('0x20'));}),_['map'](_0x24b18d,function(_0x3ebb69){return util['format'](_0x9e79('0xbb'),_0x3ebb69['id']);}));}})[_0x9e79('0x15')](function(_0x2b31f6){if(_0x2b31f6&&!_[_0x9e79('0x56')](_0x2b31f6)){var _0x5493f1=squel[_0x9e79('0x13')]()['table'](_0x9e79('0x38'))[_0x9e79('0xbe')](_0x2b31f6)[_0x9e79('0x31')]('id\x20=\x20?',_0x4d9857[_0x9e79('0x7f')]['id'])[_0x9e79('0xbf')]();return db['sequelize'][_0x9e79('0x28')](_0x5493f1[_0x9e79('0x51')],{'replacements':_0x5493f1[_0x9e79('0xc0')]});}})['then'](function(){if(_0x4d9857[_0x9e79('0x86')][_0x9e79('0xc1')]&&_0x3c72f7){return db[_0x9e79('0x8c')][_0x9e79('0x13')]({'phone':_0x4d9857[_0x9e79('0x86')][_0x9e79('0xc1')],'OrderBy':0x0},{'where':{'ContactId':_0x3c72f7['id']}});}})[_0x9e79('0x15')](function(){return _0x3c72f7;})[_0x9e79('0x15')](respondWithResult(_0x5472fd,null))[_0x9e79('0x7e')](handleError(_0x5472fd,null));};exports[_0x9e79('0xc2')]=function(_0x4fbd9e,_0xf3b37b){var _0x4cf858={};var _0x42ab93={};var _0x57bf91;var _0x2d6540;return db[_0x9e79('0x1c')][_0x9e79('0x22')]({'where':{'id':_0x4fbd9e['params']['id']}})['then'](handleEntityNotFound(_0xf3b37b,null))['then'](function(_0x374a28){if(_0x374a28){_0x57bf91=_0x374a28;_0x42ab93[_0x9e79('0x27')]=_[_0x9e79('0x1e')](db[_0x9e79('0x43')][_0x9e79('0xc3')]);_0x42ab93['query']=_['keys'](_0x4fbd9e['query']);_0x42ab93[_0x9e79('0x29')]=_[_0x9e79('0x2b')](_0x42ab93['model'],_0x42ab93['query']);_0x4cf858[_0x9e79('0x2a')]=_['intersection'](_0x42ab93['model'],qs[_0x9e79('0x2c')](_0x4fbd9e['query'][_0x9e79('0x2c')]));_0x4cf858[_0x9e79('0x2a')]=_0x4cf858[_0x9e79('0x2a')][_0x9e79('0x1f')]?_0x4cf858[_0x9e79('0x2a')]:_0x42ab93['model'];_0x4cf858[_0x9e79('0x2f')]=qs[_0x9e79('0x30')](_0x4fbd9e[_0x9e79('0x28')][_0x9e79('0x30')]);_0x4cf858[_0x9e79('0x31')]=qs[_0x9e79('0x29')](_[_0x9e79('0x32')](_0x4fbd9e['query'],_0x42ab93[_0x9e79('0x29')]));if(_0x4fbd9e['query'][_0x9e79('0x53')]){_0x4cf858[_0x9e79('0x31')]=_[_0x9e79('0x74')](_0x4cf858[_0x9e79('0x31')],{'$or':_[_0x9e79('0x46')](_0x4cf858[_0x9e79('0x2a')],function(_0x1f235d){var _0x370679={};_0x370679[_0x1f235d]={'$like':'%'+_0x4fbd9e['query']['filter']+'%'};return _0x370679;})});}_0x4cf858=_[_0x9e79('0x74')]({},_0x4cf858,_0x4fbd9e['options']);return _0x57bf91[_0x9e79('0xc2')](_0x4cf858);}})[_0x9e79('0x15')](function(_0x9a998d){if(_0x9a998d){_0x2d6540=_0x9a998d['length'];if(!_0x4fbd9e[_0x9e79('0x28')][_0x9e79('0x2d')](_0x9e79('0x2e'))){_0x4cf858[_0x9e79('0x10')]=qs[_0x9e79('0x10')](_0x4fbd9e['query'][_0x9e79('0x10')]);_0x4cf858[_0x9e79('0xe')]=qs[_0x9e79('0xe')](_0x4fbd9e['query'][_0x9e79('0xe')]);}return _0x57bf91[_0x9e79('0xc2')](_0x4cf858);}})[_0x9e79('0x15')](function(_0x535c95){if(_0x535c95){return _0x535c95?{'count':_0x2d6540,'rows':_0x535c95}:null;}})[_0x9e79('0x15')](respondWithResult(_0xf3b37b,null))['catch'](handleError(_0xf3b37b,null));};exports[_0x9e79('0xc4')]=function(_0x390627,_0x458d98){if(_0x390627[_0x9e79('0x86')]['id']){delete _0x390627[_0x9e79('0x86')]['id'];}return db[_0x9e79('0x1c')][_0x9e79('0x22')]({'where':{'id':_0x390627['params']['id']}})[_0x9e79('0x15')](handleEntityNotFound(_0x458d98,null))['then'](function(_0xdc0906){if(_0xdc0906){return _0xdc0906[_0x9e79('0xc4')](_0x390627[_0x9e79('0x86')][_0x9e79('0xc5')]||[]);}return null;})[_0x9e79('0x15')](respondWithResult(_0x458d98,null))[_0x9e79('0x7e')](handleError(_0x458d98,null));};exports[_0x9e79('0xc6')]=function(_0x21439b,_0x3c0640){var _0x456b96=[];_0x456b96[_0x9e79('0x21')](addAdditionalPhones(_0x21439b[_0x9e79('0x86')]));Promise['all'](_0x456b96)[_0x9e79('0x15')](function(){_0x456b96=[];_0x456b96[_0x9e79('0x21')](deleteCmHopperPhones(_0x21439b[_0x9e79('0x86')]['id']));_0x456b96[_0x9e79('0x21')](addCmHopperPhones(_0x21439b[_0x9e79('0x86')]['id']));Promise[_0x9e79('0x24')](_0x456b96)[_0x9e79('0x15')](function(){return[0x1];})[_0x9e79('0x15')](respondWithResult(_0x3c0640,null));});};function addAdditionalPhones(_0x54a875){var _0x50898e;return new Promise(function(_0x36255d,_0x51628b){return db[_0x9e79('0x9a')]['destroy']({'where':{'CmContactId':_0x54a875['id']}})[_0x9e79('0x15')](function(){db['ContactItemType'][_0x9e79('0x82')]({'raw':!![],'attributes':['id',_0x9e79('0xc7')]})[_0x9e79('0x15')](function(_0x5ee0a7){var _0x5c314c=[];for(var _0x129935=0x0;_0x129935<_0x54a875[_0x9e79('0xc8')][_0x9e79('0x1f')];_0x129935++){var _0x19a576=_0x54a875[_0x9e79('0xc9')]?_[_0x9e79('0x54')](_0x54a875['item_types'][_0x129935])?'':_0x54a875['item_types'][_0x129935]:_0x54a875[_0x9e79('0xc8')][_0x129935][_0x9e79('0xca')]?_0x54a875[_0x9e79('0xc8')][_0x129935][_0x9e79('0xca')]:'';var _0x3df463=_[_0x9e79('0x54')](_0x54a875[_0x9e79('0xc8')][_0x129935]['description'])?'':_0x54a875['items'][_0x129935]['description'];var _0x3e692b=_0x19a576+':'+_0x54a875['items'][_0x129935][_0x9e79('0xc1')]+'§'+_0x3df463;if(_['isNil'](_0x50898e))_0x50898e=_0x3e692b;else _0x50898e+=';'+_0x3e692b;var _0x2a878d=null;if(_0x54a875[_0x9e79('0xc9')]){if(!_[_0x9e79('0x54')](_0x54a875[_0x9e79('0xc9')][_0x129935])){var _0x19dcf5=_[_0x9e79('0x42')](_0x5ee0a7,function(_0x419361){return _0x419361['id']===_0x54a875[_0x9e79('0xc9')][_0x129935];});if(!_[_0x9e79('0x54')](_0x19dcf5)){_0x2a878d=_0x19dcf5[_0x9e79('0xc7')];}}}else{if(!_[_0x9e79('0x54')](_0x54a875[_0x9e79('0xc8')][_0x129935])){var _0x19dcf5=_[_0x9e79('0x42')](_0x5ee0a7,function(_0x2764cf){return _0x2764cf['id']===_0x54a875[_0x9e79('0xc8')][_0x129935][_0x9e79('0xca')];});if(!_[_0x9e79('0x54')](_0x19dcf5)){_0x2a878d=_0x129935;}}}if(_[_0x9e79('0x54')](_0x2a878d)){_0x2a878d=0x64;}_0x5c314c[_0x9e79('0x21')](addAdditionalPhone(_0x54a875['id'],_0x54a875[_0x9e79('0xc8')][_0x129935]['phone'],_0x54a875[_0x9e79('0xc9')]?_[_0x9e79('0x54')](_0x54a875[_0x9e79('0xc9')][_0x129935])?null:_0x54a875['item_types'][_0x129935]:_0x54a875[_0x9e79('0xc8')][_0x129935][_0x9e79('0xca')]?_0x54a875[_0x9e79('0xc8')][_0x129935][_0x9e79('0xca')]:null,_0x2a878d,_0x3df463));}Promise[_0x9e79('0x24')](_0x5c314c)['then'](function(){db[_0x9e79('0x1c')][_0x9e79('0x13')]({'AdditionalPhones':_0x50898e},{'where':{'id':_0x54a875['id']}})['then'](function(){_0x36255d(0x1);});});});});});}function addAdditionalPhone(_0x45db73,_0x12c943,_0x4314d7,_0x5d5d69,_0xdfe9f9){return db['CmContactHasItem'][_0x9e79('0x42')]({'where':{'CmContactId':_0x45db73,'item':_0x12c943}})[_0x9e79('0x15')](function(_0x31f0a3){if(_0x31f0a3)logger[_0x9e79('0x8b')](_0x9e79('0xcb'),_0x31f0a3);else{db['CmContactHasItem'][_0x9e79('0x8f')]({'CmContactId':_0x45db73,'item':_0x12c943,'ItemTypeId':_0x4314d7,'OrderBy':_0x5d5d69,'ItemClass':_0x9e79('0xcc'),'description':_0xdfe9f9});}});}function deletePhones(_0x427ec1){return db['CmContactHasItem'][_0x9e79('0x14')]({'where':{'CmContactId':_0x427ec1}});}function deleteCmHopperPhones(_0x4a949d){return new Promise(function(_0x2bffc7,_0x5071ce){return db[_0x9e79('0x8c')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4a949d}})[_0x9e79('0x15')](function(_0x401749){db[_0x9e79('0xcd')][_0x9e79('0x14')]({'where':{'CmHopperId':{'$in':_[_0x9e79('0x46')](_0x401749,'id')}}});})['then'](function(){_0x2bffc7(0x1);});});}function addCmHopperPhones(_0x1a6845){return new Promise(function(_0x3d7090,_0x2e28ce){return db[_0x9e79('0x8c')][_0x9e79('0x82')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1a6845}})['then'](function(_0x2a4bc5){var _0x1433a1=[];_[_0x9e79('0x46')](_0x2a4bc5,function(_0x1de8a5){_0x1433a1[_0x9e79('0x21')](createCmHopperPhone(_0x1a6845,_0x1de8a5['id']));});Promise[_0x9e79('0x24')](_0x1433a1)[_0x9e79('0x15')](function(){_0x3d7090(0x1);});});});}function createCmHopperPhone(_0x366f65,_0x3e8ed4){return new Promise(function(_0x4f9dfa,_0x38acec){db['CmContactHasItem'][_0x9e79('0x82')]({'raw':!![],'attributes':[_0x9e79('0xce'),'OrderBy'],'where':{'CmContactId':_0x366f65,'ItemClass':'PHONE'},'include':[{'model':db[_0x9e79('0xb6')],'attributes':[_0x9e79('0xc7')],'as':_0x9e79('0xb7')}],'order':['OrderBy',db[_0x9e79('0x72')][_0x9e79('0xb8')](_0x9e79('0xcf'))]})[_0x9e79('0x15')](function(_0x46ced7){var _0x7c397=0x1;var _0x45ef58=_[_0x9e79('0x46')](_0x46ced7,function(_0x2561c3){_0x2561c3[_0x9e79('0xd0')]=_0x3e8ed4;_0x2561c3[_0x9e79('0xc1')]=_0x2561c3[_0x9e79('0xce')];_0x2561c3['OrderBy']=_0x7c397;delete _0x2561c3[_0x9e79('0xd1')];_0x7c397=_0x7c397+0x1;return _0x2561c3;});return db[_0x9e79('0xcd')][_0x9e79('0xac')](_0x45ef58,{});})[_0x9e79('0x15')](function(){_0x4f9dfa(0x1);});});}function insertAdditionalPhones(_0x19f2f5,_0xe269a1){return new Promise(function(_0x24324f,_0x1866f6){var _0x49cc9c=[];for(var _0xeed24f=0x0;_0xeed24f<_0xe269a1['length'];_0xeed24f++){var _0x5d270b=_0xe269a1[_0xeed24f];_0x49cc9c[_0x9e79('0x21')](parseContactItemType(_0x5d270b));}Promise[_0x9e79('0x24')](_0x49cc9c)[_0x9e79('0x15')](function(){var _0x1e0ba2={'id':_0x19f2f5['id'],'items':_0xe269a1};return addAdditionalPhones(_0x1e0ba2)[_0x9e79('0x15')](function(_0x2e0c78){return addCmHopperPhones(_0x19f2f5['id']);});})['then'](function(){_0x24324f(_0x19f2f5);});});}function parseContactItemType(_0x3d7519){return new Promise(function(_0x1dd0ed,_0x42b036){if(_0x3d7519[_0x9e79('0x2d')](_0x9e79('0xca'))){_0x1dd0ed(_0x3d7519);}else{return db[_0x9e79('0xb6')]['find']({'where':{'name':_0x3d7519['ItemType']}})[_0x9e79('0x15')](function(_0x1abdf7){if(_['isNil'](_0x1abdf7))_0x3d7519[_0x9e79('0xca')]=null;else _0x3d7519[_0x9e79('0xca')]=_0x1abdf7['id'];_0x1dd0ed(_0x3d7519);});}});}exports['getAdditionalPhones']=function(_0x50b18d,_0x4f7578){return db[_0x9e79('0x9a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x50b18d[_0x9e79('0x7f')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x9e79('0xb6')],'as':'ItemType'}],'order':[[_0x9e79('0xc7')],[db[_0x9e79('0x72')]['literal'](_0x9e79('0xcf'))]]})['then'](function(_0x7b2ca2){return _0x7b2ca2;})[_0x9e79('0x15')](respondWithResult(_0x4f7578,null))[_0x9e79('0x7e')](handleError(_0x4f7578,null));};exports[_0x9e79('0xd2')]=function(_0x53549a,_0x3ac1fc){return db['CmContactHasItem'][_0x9e79('0x82')]({'raw':!![],'where':{'CmContactId':_0x53549a[_0x9e79('0x86')][_0x9e79('0xd3')]}})['then'](function(_0x534bc9){var _0x4eb3f3=_[_0x9e79('0x46')](_0x534bc9,function(_0x445c3f){_0x445c3f['CmContactId']=_0x53549a[_0x9e79('0x86')][_0x9e79('0xd4')];return _0x445c3f;});return db[_0x9e79('0x9a')][_0x9e79('0xac')](_0x4eb3f3,{});})['then'](function(_0x522e1e){return addCmHopperPhones(_0x53549a['body'][_0x9e79('0xd4')]);})['then'](function(_0x4547b3){return['ok'];})[_0x9e79('0x15')](respondWithResult(_0x3ac1fc,null))[_0x9e79('0x7e')](handleError(_0x3ac1fc,null));};exports[_0x9e79('0xd5')]=function(_0x2d0bd6,_0x1a49ea){var _0x59131e=[];_0x59131e[_0x9e79('0x21')](createCmHopperPhone(_0x2d0bd6[_0x9e79('0x86')]['id'],_0x2d0bd6[_0x9e79('0x86')][_0x9e79('0xd6')]));Promise['all'](_0x59131e)[_0x9e79('0x15')](function(){return[0x1];})[_0x9e79('0x15')](respondWithResult(_0x1a49ea,null));};exports[_0x9e79('0xd7')]=function(_0x1e91e8,_0x4be1b6){var _0x539ef5={'raw':![],'where':{}};var _0x4c2294={};var _0x2771d2={'count':0x0,'rows':[]};return db[_0x9e79('0x1c')]['findOne']({'where':{'id':_0x1e91e8['params']['id']}})[_0x9e79('0x15')](handleEntityNotFound(_0x4be1b6,null))[_0x9e79('0x15')](function(_0xaddbc9){if(_0xaddbc9){_0x4c2294[_0x9e79('0x27')]=_[_0x9e79('0x1e')](db[_0x9e79('0x8c')]['rawAttributes']);_0x4c2294['query']=_[_0x9e79('0x1e')](_0x1e91e8[_0x9e79('0x28')]);_0x4c2294['filters']=_[_0x9e79('0x2b')](_0x4c2294[_0x9e79('0x27')],_0x4c2294['query']);_0x539ef5[_0x9e79('0x2a')]=_[_0x9e79('0x2b')](_0x4c2294[_0x9e79('0x27')],qs['fields'](_0x1e91e8['query']['fields']));_0x539ef5[_0x9e79('0x2a')]=_0x539ef5[_0x9e79('0x2a')][_0x9e79('0x1f')]?_0x539ef5[_0x9e79('0x2a')]:_0x4c2294[_0x9e79('0x27')];if(!_0x1e91e8[_0x9e79('0x28')]['hasOwnProperty'](_0x9e79('0x2e'))){_0x539ef5['limit']=qs[_0x9e79('0x10')](_0x1e91e8[_0x9e79('0x28')][_0x9e79('0x10')]);_0x539ef5[_0x9e79('0xe')]=qs[_0x9e79('0xe')](_0x1e91e8['query']['offset']);}_0x539ef5[_0x9e79('0x2f')]=qs['sort'](_0x1e91e8[_0x9e79('0x28')][_0x9e79('0x30')]);_0x539ef5[_0x9e79('0x31')]=qs[_0x9e79('0x29')](_[_0x9e79('0x32')](_0x1e91e8[_0x9e79('0x28')],_0x4c2294[_0x9e79('0x29')]));_0x539ef5[_0x9e79('0x31')][_0x9e79('0xd8')]=_0xaddbc9['id'];if(_0x1e91e8[_0x9e79('0x28')][_0x9e79('0x53')]){_0x539ef5[_0x9e79('0x31')]=_['merge'](_0x539ef5[_0x9e79('0x31')],{'$or':_[_0x9e79('0x46')](_0x539ef5[_0x9e79('0x2a')],function(_0x5cc725){var _0xabe5c2={};_0xabe5c2[_0x5cc725]={'$like':'%'+_0x1e91e8[_0x9e79('0x28')][_0x9e79('0x53')]+'%'};return _0xabe5c2;})});}_0x539ef5=_[_0x9e79('0x74')]({},_0x539ef5,_0x1e91e8[_0x9e79('0xd9')]);return db[_0x9e79('0x8c')]['count']({'where':_0x539ef5[_0x9e79('0x31')]})['then'](function(_0x3a6c3f){_0x2771d2[_0x9e79('0x11')]=_0x3a6c3f;if(_0x1e91e8[_0x9e79('0x28')][_0x9e79('0xda')]){_0x539ef5[_0x9e79('0xdb')]=[{'all':!![]}];}return db[_0x9e79('0x8c')][_0x9e79('0x82')](_0x539ef5);})[_0x9e79('0x15')](function(_0x5fab83){_0x2771d2['rows']=_0x5fab83;return _0x2771d2;});}})[_0x9e79('0x15')](respondWithFilteredResult(_0x4be1b6,_0x539ef5))[_0x9e79('0x7e')](handleError(_0x4be1b6,null));};exports[_0x9e79('0xdc')]=function(_0x25077e,_0x1500b4){var _0x309bf1={'raw':!![],'where':{}};var _0x521118={};var _0x7e59ec={'count':0x0,'rows':[]};return db['CmContact'][_0x9e79('0x22')]({'where':{'id':_0x25077e[_0x9e79('0x7f')]['id']}})[_0x9e79('0x15')](handleEntityNotFound(_0x1500b4,null))[_0x9e79('0x15')](function(_0x2f37ec){if(_0x2f37ec){_0x521118['model']=_[_0x9e79('0x1e')](db['CmHopperHistory'][_0x9e79('0xc3')]);_0x521118[_0x9e79('0x28')]=_[_0x9e79('0x1e')](_0x25077e[_0x9e79('0x28')]);_0x521118[_0x9e79('0x29')]=_['intersection'](_0x521118[_0x9e79('0x27')],_0x521118['query']);_0x309bf1[_0x9e79('0x2a')]=_[_0x9e79('0x2b')](_0x521118[_0x9e79('0x27')],qs[_0x9e79('0x2c')](_0x25077e['query']['fields']));_0x309bf1[_0x9e79('0x2a')]=_0x309bf1[_0x9e79('0x2a')]['length']?_0x309bf1[_0x9e79('0x2a')]:_0x521118['model'];if(!_0x25077e['query']['hasOwnProperty'](_0x9e79('0x2e'))){_0x309bf1[_0x9e79('0x10')]=qs['limit'](_0x25077e[_0x9e79('0x28')]['limit']);_0x309bf1[_0x9e79('0xe')]=qs[_0x9e79('0xe')](_0x25077e['query'][_0x9e79('0xe')]);}_0x309bf1[_0x9e79('0x2f')]=qs[_0x9e79('0x30')](_0x25077e[_0x9e79('0x28')][_0x9e79('0x30')]);_0x309bf1[_0x9e79('0x31')]=qs['filters'](_['pick'](_0x25077e[_0x9e79('0x28')],_0x521118[_0x9e79('0x29')]));_0x309bf1[_0x9e79('0x31')]['ContactId']=_0x2f37ec['id'];if(_0x25077e['query'][_0x9e79('0x53')]){_0x309bf1[_0x9e79('0x31')]=_['merge'](_0x309bf1[_0x9e79('0x31')],{'$or':_['map'](_0x309bf1[_0x9e79('0x2a')],function(_0x95c680){var _0x153839={};_0x153839[_0x95c680]={'$like':'%'+_0x25077e['query'][_0x9e79('0x53')]+'%'};return _0x153839;})});}_0x309bf1=_[_0x9e79('0x74')]({},_0x309bf1,_0x25077e['options']);return db[_0x9e79('0x9c')][_0x9e79('0x11')]({'where':_0x309bf1['where']})[_0x9e79('0x15')](function(_0x4032de){_0x7e59ec[_0x9e79('0x11')]=_0x4032de;if(_0x25077e[_0x9e79('0x28')][_0x9e79('0xda')]){_0x309bf1[_0x9e79('0xdb')]=[{'all':!![]}];}return db[_0x9e79('0x9c')]['findAll'](_0x309bf1);})['then'](function(_0x594101){_0x7e59ec[_0x9e79('0x7d')]=_0x594101;return _0x7e59ec;});}})[_0x9e79('0x15')](respondWithFilteredResult(_0x1500b4,_0x309bf1))[_0x9e79('0x7e')](handleError(_0x1500b4,null));};exports[_0x9e79('0xdd')]=function(_0x1062f7,_0x33808e){var _0x33e518={'raw':!![],'where':{}};var _0x55f452={};var _0x4a2b94={'count':0x0,'rows':[]};return db[_0x9e79('0x1c')][_0x9e79('0x22')]({'where':{'id':_0x1062f7[_0x9e79('0x7f')]['id']}})[_0x9e79('0x15')](handleEntityNotFound(_0x33808e,null))[_0x9e79('0x15')](function(_0x1fa692){if(_0x1fa692){_0x55f452[_0x9e79('0x27')]=_[_0x9e79('0x1e')](db['CmHopperFinal'][_0x9e79('0xc3')]);_0x55f452['query']=_[_0x9e79('0x1e')](_0x1062f7[_0x9e79('0x28')]);_0x55f452[_0x9e79('0x29')]=_[_0x9e79('0x2b')](_0x55f452[_0x9e79('0x27')],_0x55f452[_0x9e79('0x28')]);_0x33e518[_0x9e79('0x2a')]=_[_0x9e79('0x2b')](_0x55f452['model'],qs[_0x9e79('0x2c')](_0x1062f7[_0x9e79('0x28')]['fields']));_0x33e518[_0x9e79('0x2a')]=_0x33e518[_0x9e79('0x2a')][_0x9e79('0x1f')]?_0x33e518[_0x9e79('0x2a')]:_0x55f452[_0x9e79('0x27')];if(!_0x1062f7[_0x9e79('0x28')][_0x9e79('0x2d')]('nolimit')){_0x33e518['limit']=qs[_0x9e79('0x10')](_0x1062f7[_0x9e79('0x28')][_0x9e79('0x10')]);_0x33e518[_0x9e79('0xe')]=qs[_0x9e79('0xe')](_0x1062f7[_0x9e79('0x28')][_0x9e79('0xe')]);}_0x33e518['order']=qs[_0x9e79('0x30')](_0x1062f7[_0x9e79('0x28')][_0x9e79('0x30')]);_0x33e518[_0x9e79('0x31')]=qs[_0x9e79('0x29')](_['pick'](_0x1062f7['query'],_0x55f452[_0x9e79('0x29')]));_0x33e518[_0x9e79('0x31')][_0x9e79('0xd8')]=_0x1fa692['id'];if(_0x1062f7[_0x9e79('0x28')][_0x9e79('0x53')]){_0x33e518[_0x9e79('0x31')]=_['merge'](_0x33e518[_0x9e79('0x31')],{'$or':_[_0x9e79('0x46')](_0x33e518[_0x9e79('0x2a')],function(_0x52c53a){var _0x314b6e={};_0x314b6e[_0x52c53a]={'$like':'%'+_0x1062f7['query'][_0x9e79('0x53')]+'%'};return _0x314b6e;})});}_0x33e518=_[_0x9e79('0x74')]({},_0x33e518,_0x1062f7['options']);return db[_0x9e79('0x9b')]['count']({'where':_0x33e518[_0x9e79('0x31')]})[_0x9e79('0x15')](function(_0x1eca19){_0x4a2b94[_0x9e79('0x11')]=_0x1eca19;if(_0x1062f7[_0x9e79('0x28')][_0x9e79('0xda')]){_0x33e518[_0x9e79('0xdb')]=[{'all':!![]}];}return db[_0x9e79('0x9b')][_0x9e79('0x82')](_0x33e518);})[_0x9e79('0x15')](function(_0x32dfa9){_0x4a2b94[_0x9e79('0x7d')]=_0x32dfa9;return _0x4a2b94;});}})[_0x9e79('0x15')](respondWithFilteredResult(_0x33808e,_0x33e518))[_0x9e79('0x7e')](handleError(_0x33808e,null));};exports['getJscriptySessions']=function(_0x2eab75,_0xa6c356){var _0x115754={'raw':!![],'where':{}};var _0x5da63e={};var _0x540a9b={'count':0x0,'rows':[]};return db[_0x9e79('0x1c')][_0x9e79('0x22')]({'where':{'id':_0x2eab75[_0x9e79('0x7f')]['id']}})['then'](handleEntityNotFound(_0xa6c356,null))[_0x9e79('0x15')](function(_0x392cb0){if(_0x392cb0){_0x5da63e['model']=_[_0x9e79('0x1e')](db[_0x9e79('0xde')]['rawAttributes']);_0x5da63e['query']=_['keys'](_0x2eab75[_0x9e79('0x28')]);_0x5da63e[_0x9e79('0x29')]=_['intersection'](_0x5da63e[_0x9e79('0x27')],_0x5da63e['query']);_0x115754[_0x9e79('0x2a')]=_[_0x9e79('0x2b')](_0x5da63e[_0x9e79('0x27')],qs[_0x9e79('0x2c')](_0x2eab75[_0x9e79('0x28')][_0x9e79('0x2c')]));_0x115754[_0x9e79('0x2a')]=_0x115754[_0x9e79('0x2a')]['length']?_0x115754[_0x9e79('0x2a')]:_0x5da63e[_0x9e79('0x27')];if(!_0x2eab75[_0x9e79('0x28')][_0x9e79('0x2d')](_0x9e79('0x2e'))){_0x115754['limit']=qs[_0x9e79('0x10')](_0x2eab75[_0x9e79('0x28')][_0x9e79('0x10')]);_0x115754[_0x9e79('0xe')]=qs['offset'](_0x2eab75[_0x9e79('0x28')][_0x9e79('0xe')]);}_0x115754[_0x9e79('0x2f')]=qs[_0x9e79('0x30')](_0x2eab75['query'][_0x9e79('0x30')]);_0x115754[_0x9e79('0x31')]=qs['filters'](_[_0x9e79('0x32')](_0x2eab75[_0x9e79('0x28')],_0x5da63e['filters']));_0x115754[_0x9e79('0x31')][_0x9e79('0xd8')]=_0x392cb0['id'];if(_0x2eab75['query'][_0x9e79('0x53')]){_0x115754[_0x9e79('0x31')]=_[_0x9e79('0x74')](_0x115754[_0x9e79('0x31')],{'$or':_['map'](_0x115754[_0x9e79('0x2a')],function(_0x3f9366){var _0x35b47a={};_0x35b47a[_0x3f9366]={'$like':'%'+_0x2eab75['query'][_0x9e79('0x53')]+'%'};return _0x35b47a;})});}_0x115754=_[_0x9e79('0x74')]({},_0x115754,_0x2eab75[_0x9e79('0xd9')]);return db['JscriptySessionReport']['count']({'where':_0x115754[_0x9e79('0x31')]})[_0x9e79('0x15')](function(_0x5ad4af){_0x540a9b[_0x9e79('0x11')]=_0x5ad4af;if(_0x2eab75[_0x9e79('0x28')][_0x9e79('0xda')]){_0x115754[_0x9e79('0xdb')]=[{'all':!![]}];}return db[_0x9e79('0xde')][_0x9e79('0x82')](_0x115754);})[_0x9e79('0x15')](function(_0xd0dcf9){_0x540a9b[_0x9e79('0x7d')]=_0xd0dcf9;return _0x540a9b;});}})[_0x9e79('0x15')](respondWithFilteredResult(_0xa6c356,_0x115754))[_0x9e79('0x7e')](handleError(_0xa6c356,null));};exports[_0x9e79('0xdf')]=function(_0x1c6ae2,_0x2b10d1){try{if(!_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0xb0')]){throw new Error('No\x20ListId\x20specified');}if(!_0x1c6ae2[_0x9e79('0x86')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x1c6ae2['body'][_0x9e79('0xe0')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x1c6ae2['body'][_0x9e79('0xe1')]){throw new Error(_0x9e79('0xe2'));}var _0x13d542=_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0xe3')][_0x9e79('0x45')](',');var _0x4f632c=_0x1c6ae2['body'][_0x9e79('0xe0')][_0x9e79('0x45')](',');if(!_0x13d542[_0x9e79('0x1f')]||!_0x4f632c[_0x9e79('0x1f')]||_0x13d542['length']!==_0x4f632c[_0x9e79('0x1f')]){throw new Error(_0x9e79('0xe4'));}_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0x2c')]=_[_0x9e79('0xe5')](_0x13d542,_0x4f632c);if(!_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0x2c')][_0x9e79('0xc1')]){throw new Error(_0x9e79('0xe6'));}if(!_0x1c6ae2[_0x9e79('0x86')]['fields'][_0x9e79('0xe7')]){throw new Error(_0x9e79('0xe8'));}var _0x2dd748=path['join'](config[_0x9e79('0xe9')],_0x9e79('0xea'),_0x1c6ae2[_0x9e79('0xeb')][_0x9e79('0xec')]);fs['chmodSync'](_0x2dd748,parseInt(_0x9e79('0xed'),0x8));var _0xd267cf=require(_0x9e79('0xee'))[_0x9e79('0xef')](path[_0x9e79('0xa7')](__dirname,_0x9e79('0xf0')),[_0x2dd748,_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0xe3')],_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0xe0')],_0x1c6ae2['body'][_0x9e79('0xb0')],_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0xf1')],_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0xae')],_0x1c6ae2[_0x9e79('0x86')][_0x9e79('0xe1')]]);return _0x2b10d1[_0x9e79('0x1b')](0xc8)[_0x9e79('0xd')]({'message':_0x9e79('0xf2'),'pid':_0xd267cf[_0x9e79('0xf3')]});}catch(_0x473c11){return _0x2b10d1[_0x9e79('0x1b')](0x1f4)[_0x9e79('0xf4')](_0x473c11);}};exports['upload']=function(_0x187a33,_0x308a1f){var _0x5283fb=fs[_0x9e79('0xf5')](_0x187a33[_0x9e79('0xeb')][_0x9e79('0x2')]);Papa[_0x9e79('0xf6')](_0x5283fb,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4ab63b){return _0x308a1f[_0x9e79('0x1b')](0xc8)[_0x9e79('0xd')]({'file':_0x187a33[_0x9e79('0xeb')],'fields':_0x4ab63b[_0x9e79('0xf7')][_0x9e79('0x2c')]});}});};exports[_0x9e79('0xf8')]=function(_0x761404,_0xa7aaf4){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})['then'](function(_0x532f3f){var _0x3486f5=![];if(!_0x761404[_0x9e79('0x86')][_0x9e79('0xb0')]){throw new Error('No\x20ListId\x20specified');}if(!_0x761404[_0x9e79('0x86')][_0x9e79('0xf9')][_0x9e79('0xc1')]){throw new Error(_0x9e79('0xe6'));}if(!_0x761404[_0x9e79('0x86')][_0x9e79('0xf9')]['firstName']){throw new Error(_0x9e79('0xe8'));}if(!_0x761404[_0x9e79('0x86')][_0x9e79('0xe1')]){throw new Error(_0x9e79('0xe2'));}var _0x4cefe3=require('child_process')[_0x9e79('0xef')](path[_0x9e79('0xa7')](__dirname,_0x9e79('0xfa')),[_0x761404['params']['id'],JSON[_0x9e79('0xfb')](_0x761404[_0x9e79('0x86')]),JSON[_0x9e79('0xfb')](_0x532f3f)]);_0x4cefe3['on'](_0x9e79('0xfc'),function(){_0x3486f5=!![];return _0xa7aaf4['status'](0xc8)[_0x9e79('0xd')]({'message':_0x9e79('0xfd'),'pid':_0x4cefe3[_0x9e79('0xf3')]});});_0x4cefe3['on'](_0x9e79('0xfe'),function(_0x91176c){if(_0x91176c&&!_0x3486f5){return _0xa7aaf4[_0x9e79('0x1b')](0x1f4)[_0x9e79('0xd')]({'message':'error\x20child\x20process','pid':_0x4cefe3[_0x9e79('0xf3')]});}});})['catch'](handleError(_0xa7aaf4,null));};exports[_0x9e79('0xff')]=function(_0x343cba,_0x1a54f7,_0x43f2de){return db[_0x9e79('0x4a')][_0x9e79('0x82')]({'raw':!![],'attributes':['id'],'where':{'role':_0x9e79('0x71')}})[_0x9e79('0x15')](function(_0x2ded8b){var _0x32f83d=![];if(!_0x343cba[_0x9e79('0x86')][_0x9e79('0xb0')]){throw new Error(_0x9e79('0x100'));}if(!_0x343cba[_0x9e79('0x86')]['binding'][_0x9e79('0xc1')]){throw new Error(_0x9e79('0xe6'));}if(!_0x343cba[_0x9e79('0x86')][_0x9e79('0xf9')][_0x9e79('0xe7')]){throw new Error(_0x9e79('0xe8'));}if(!_0x343cba[_0x9e79('0x86')][_0x9e79('0xe1')]){throw new Error(_0x9e79('0xe2'));}var _0x1dda0b=require(_0x9e79('0xee'))['fork'](path[_0x9e79('0xa7')](__dirname,_0x9e79('0x101')),[_0x343cba[_0x9e79('0x7f')]['id'],JSON[_0x9e79('0xfb')](_0x343cba[_0x9e79('0x86')]),JSON[_0x9e79('0xfb')](_0x2ded8b)]);_0x1dda0b['on'](_0x9e79('0xfc'),function(_0x1d4bda){_0x32f83d=!![];return _0x1a54f7[_0x9e79('0x1b')](0xc8)[_0x9e79('0xd')]({'message':_0x9e79('0xfd'),'pid':_0x1dda0b[_0x9e79('0xf3')]});});_0x1dda0b['on'](_0x9e79('0xfe'),function(_0x244c27){if(_0x244c27&&!_0x32f83d){return _0x1a54f7[_0x9e79('0x1b')](0x1f4)[_0x9e79('0xd')]({'message':_0x9e79('0x102'),'pid':_0x1dda0b['pid']});}});})['catch'](handleError(_0x1a54f7,null));};exports[_0x9e79('0x103')]=function(_0x184fe8,_0x673289){var _0x4dfd43=[_0x9e79('0x104'),_0x9e79('0x105'),_0x9e79('0x106'),_0x9e79('0x107'),_0x9e79('0x108'),_0x9e79('0x109'),'voice'];var _0xad937c={'offset':0x0,'order':qs['sort'](_0x9e79('0x10a'))},_0x1d63ba={'count':0x0,'rows':[]};Promise[_0x9e79('0x6c')]()['then'](function(){if(_0x184fe8[_0x9e79('0x28')][_0x9e79('0x10b')]){if(!_[_0x9e79('0x10c')](_0x4dfd43,_0x184fe8[_0x9e79('0x28')]['channel'][_0x9e79('0x10d')]())){throw new Error(_0x9e79('0x10e'));}_0x4dfd43=[_0x184fe8[_0x9e79('0x28')]['channel']['toLowerCase']()];}if(_0x184fe8[_0x9e79('0x28')][_0x9e79('0x10f')]){try{var _0x14355c=JSON['parse'](_0x184fe8[_0x9e79('0x28')]['range']);if(!moment(_0x14355c['from'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x14355c['to'])['isValid']()){throw new Error(_0x9e79('0x110'));}}catch(_0x283947){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x184fe8[_0x9e79('0x28')][_0x9e79('0x2d')](_0x9e79('0x2e'))){_0xad937c[_0x9e79('0x10')]=qs[_0x9e79('0x10')](_0x184fe8[_0x9e79('0x28')][_0x9e79('0x10')]||0xa);_0xad937c[_0x9e79('0xe')]=qs[_0x9e79('0xe')](_0x184fe8[_0x9e79('0x28')][_0x9e79('0xe')]);}var _0x5d728c=_0x4dfd43['map'](function(_0x6d099a){if(_0x6d099a===_0x9e79('0x111')){var _0x1c9aaa={'attributes':['id','uniqueid',_0x9e79('0x26'),_0x9e79('0x112'),_0x9e79('0x113'),_0x9e79('0x114'),'starttime',_0x9e79('0x115'),_0x9e79('0x116'),_0x9e79('0x117'),_0x9e79('0x118'),'userDisposition',_0x9e79('0x119'),'userThirdDisposition',_0x9e79('0x11a')],'where':{'ContactId':_0x184fe8[_0x9e79('0x7f')]['id']},'include':[{'model':db[_0x9e79('0x4a')],'as':_0x9e79('0x4a'),'attributes':['id',_0x9e79('0x1a'),_0x9e79('0x11b'),'alias']}],'order':[[_0x9e79('0x118'),_0x9e79('0x6a')]]};if(_0x184fe8[_0x9e79('0x28')][_0x9e79('0x10f')]){_0x1c9aaa['where']['createdAt']={'$gte':_0x14355c[_0x9e79('0x37')],'$lte':_0x14355c['to']};}return db[_0x9e79('0x9e')][_0x9e79('0x11c')](_0x1c9aaa)['then'](function(_0x3bd350){_0x1d63ba[_0x9e79('0x11')]+=_0x3bd350[_0x9e79('0x11')];return _[_0x9e79('0x46')](_0x3bd350[_0x9e79('0x7d')],function(_0x58a48f){var _0x5dcd51=_0x58a48f[_0x9e79('0x87')]({'plain':!![]});_0x5dcd51[_0x9e79('0x10b')]=_0x6d099a;if(_0x5dcd51[_0x9e79('0x4a')]){_0x5dcd51[_0x9e79('0x4a')]={'id':_0x5dcd51[_0x9e79('0x4a')]['id'],'name':_0x5dcd51[_0x9e79('0x4a')][_0x9e79('0x1a')],'fullname':_0x5dcd51[_0x9e79('0x4a')][_0x9e79('0x11b')],'alias':_0x5dcd51[_0x9e79('0x4a')]['alias']};}return _0x5dcd51;});});}else{var _0x3a9ce6=_['startCase'](_0x6d099a)+(_0x6d099a===_0x9e79('0x105')?_0x9e79('0x11d'):_0x9e79('0x11e'));var _0x1cc753={'attributes':['id',_0x9e79('0x11f'),_0x9e79('0x120'),_0x9e79('0x118'),_0x9e79('0x117'),'disposition','secondDisposition',_0x9e79('0x121'),_0x9e79('0x11a'),_0x3a9ce6+'Id'],'where':{'ContactId':_0x184fe8[_0x9e79('0x7f')]['id']},'include':[{'model':db[_0x3a9ce6],'as':'Account','attributes':['id','name',_0x9e79('0x122')]},{'model':db[_0x9e79('0x4a')],'as':_0x9e79('0x123'),'attributes':['id',_0x9e79('0x1a'),_0x9e79('0x11b')]},{'model':db[_0x9e79('0x43')],'as':'Tags','attributes':['id','name',_0x9e79('0x34')],'through':{'attributes':[]}}],'order':[['createdAt',_0x9e79('0x6a')]]};if(_0x184fe8[_0x9e79('0x28')][_0x9e79('0x10f')]){_0x1cc753['where'][_0x9e79('0x118')]={'$gte':_0x14355c[_0x9e79('0x37')],'$lte':_0x14355c['to']};}switch(_0x6d099a){case _0x9e79('0x105'):_0x1cc753[_0x9e79('0x2a')]['push'](_0x9e79('0x124'),'customerIp',_0x9e79('0x125'),_0x9e79('0x126'),_0x9e79('0x127'),_0x9e79('0x128'),'ratingType','ratingValue',_0x9e79('0x129'));break;case _0x9e79('0x104'):_0x1cc753[_0x9e79('0x2a')][_0x9e79('0x21')]('subject',_0x9e79('0x12a'));break;case'openchannel':_0x1cc753['attributes'][_0x9e79('0x21')](_0x9e79('0x12b'),'threadId');break;}return db[_[_0x9e79('0x12c')](_0x6d099a)+'Interaction']['findAndCountAll'](_0x1cc753)[_0x9e79('0x15')](function(_0x2a595b){_0x1d63ba[_0x9e79('0x11')]+=_0x2a595b[_0x9e79('0x11')];return _['map'](_0x2a595b[_0x9e79('0x7d')],function(_0x3abb29){var _0x2a80b4=_0x3abb29['get']({'plain':!![]});_0x2a80b4[_0x9e79('0x10b')]=_0x6d099a;if(_0x2a80b4[_0x9e79('0x123')]){_0x2a80b4[_0x9e79('0x123')]={'id':_0x2a80b4[_0x9e79('0x123')]['id'],'name':_0x2a80b4[_0x9e79('0x123')][_0x9e79('0x1a')],'fullname':_0x2a80b4[_0x9e79('0x123')][_0x9e79('0x11b')]};}return _0x2a80b4;});});}});return Promise['all'](_0x5d728c);})[_0x9e79('0x15')](function(_0x1cc5a2){return _(_0x1cc5a2)[_0x9e79('0x12d')]()[_0x9e79('0x12e')]('createdAt')['reverse']()[_0x9e79('0x44')]();})[_0x9e79('0x15')](function(_0x21c73a){_0x1d63ba[_0x9e79('0x7d')]=_0xad937c['limit']?_0x21c73a[_0x9e79('0x12f')](_0xad937c[_0x9e79('0xe')],_0xad937c[_0x9e79('0xe')]+_0xad937c[_0x9e79('0x10')]):_0x21c73a;return _0x1d63ba;})['then'](respondWithFilteredResult(_0x673289,_0xad937c))[_0x9e79('0x7e')](handleError(_0x673289,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 196d37b..75f38c9 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 _0xbd87=['exports','setMaxListeners','save','update','remove','emit'];(function(_0x102674,_0x2f96fe){var _0x437c27=function(_0x2f9265){while(--_0x2f9265){_0x102674['push'](_0x102674['shift']());}};_0x437c27(++_0x2f96fe);}(_0xbd87,0x133));var _0x7bd8=function(_0xe10a88,_0x369287){_0xe10a88=_0xe10a88-0x0;var _0x205a3f=_0xbd87[_0xe10a88];return _0x205a3f;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7bd8('0x0')](0x0);var events={'afterCreate':_0x7bd8('0x1'),'afterUpdate':_0x7bd8('0x2'),'afterDestroy':_0x7bd8('0x3')};function emitEvent(_0x7be996){return function(_0x2f6952,_0xcba678,_0x529c70){CmContactEvents[_0x7bd8('0x4')](_0x7be996+':'+_0x2f6952['id'],_0x2f6952);CmContactEvents[_0x7bd8('0x4')](_0x7be996,_0x2f6952);_0x529c70(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x7bd8('0x5')]=CmContactEvents; \ No newline at end of file +var _0x885a=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact','setMaxListeners'];(function(_0xc7c78d,_0x1dd9fb){var _0x175f3d=function(_0x1966cf){while(--_0x1966cf){_0xc7c78d['push'](_0xc7c78d['shift']());}};_0x175f3d(++_0x1dd9fb);}(_0x885a,0x180));var _0xa885=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x885a[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xa885('0x0'))['db'][_0xa885('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xa885('0x2')](0x0);var events={'afterCreate':_0xa885('0x3'),'afterUpdate':'update','afterDestroy':_0xa885('0x4')};function emitEvent(_0x1c41b5){return function(_0x2386ec,_0x106e16,_0x108285){CmContactEvents[_0xa885('0x5')](_0x1c41b5+':'+_0x2386ec['id'],_0x2386ec);CmContactEvents['emit'](_0x1c41b5,_0x2386ec);_0x108285(null);};}for(var e in events){if(events[_0xa885('0x6')](e)){var event=events[e];CmContact[_0xa885('0x7')](e,emitEvent(event));}}module[_0xa885('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 be55790..1babbae 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 _0xd581=['all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','email','utf8mb4','utf8mb4_unicode_ci','models','get','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','priority','callbackUniqueid','catch','CmHopper','\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','ListId','error','cmContact','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','create','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','always','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','push'];(function(_0x2deb01,_0x4e741c){var _0x3920b3=function(_0x391a64){while(--_0x391a64){_0x2deb01['push'](_0x2deb01['shift']());}};_0x3920b3(++_0x4e741c);}(_0xd581,0x98));var _0x1d58=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xd581[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require('lodash');var util=require(_0x1d58('0x0'));var logger=require(_0x1d58('0x1'))(_0x1d58('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d58('0x3'));var rimraf=require(_0x1d58('0x4'));var config=require(_0x1d58('0x5'));var shared=require(_0x1d58('0x6'));var attributes=require(_0x1d58('0x7'));module[_0x1d58('0x8')]=function(_0x4f78d5,_0x112c45){return _0x4f78d5[_0x1d58('0x9')]('CmContact',attributes,{'tableName':_0x1d58('0xa'),'paranoid':!![],'indexes':[{'name':_0x1d58('0xb'),'fields':[_0x1d58('0xb')]},{'name':_0x1d58('0xc'),'fields':[_0x1d58('0xd'),_0x1d58('0xe'),_0x1d58('0xb'),_0x1d58('0xf'),'fax',_0x1d58('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x1d58('0x11'),'collate':_0x1d58('0x12'),'hooks':{'afterCreate':function(_0x4dc08a,_0x37f794,_0x222c99){var _0x57ec91=_0x4f78d5[_0x1d58('0x13')];var _0x57b367=_0x4dc08a[_0x1d58('0x14')]({'plain':!![]});function _0x744d2(){return function(_0x28ed25){logger['error']('cmContact',_0x1d58('0x15'),util[_0x1d58('0x16')](_0x28ed25,{'showHidden':![],'depth':null}));};}function _0x5e4435(_0x55c60e,_0x2c380a){var _0xff6406=_0x2c380a[_0x1d58('0x17')]?_0x2c380a['scheduledat']:moment()[_0x1d58('0x18')](_0x1d58('0x19'));return new BPromise(function(_0x3eb13f,_0x587706){if(_[_0x1d58('0x1a')](_0x2c380a[_0x1d58('0x1b')])){_0x3eb13f({'ret':_0xff6406});}else{_0x57ec91[_0x1d58('0x1c')][_0x1d58('0x1d')]({'where':{'id':_0x55c60e['id']}})[_0x1d58('0x1e')](function(_0x4b7b4e){if(!_[_0x1d58('0x1a')](_0x4b7b4e)){var _0x3c2661=_0x4b7b4e[_0x1d58('0x1b')];if(!_['isNil'](_0x3c2661)){var _0x459b17=shared['timezones'];var _0x5bf501=_0x459b17[_0x3c2661];var _0x540b63=_0x459b17[_0x2c380a['dialTimezone']];if(!_[_0x1d58('0x1a')](_0x5bf501)&&!_[_0x1d58('0x1a')](_0x540b63)){var _0x46892a=_0x5bf501[_0x1d58('0x1f')]-_0x540b63[_0x1d58('0x1f')];_0xff6406=_0x2c380a[_0x1d58('0x17')]?_0x2c380a[_0x1d58('0x17')]:moment();var _0x1bed53=moment(_0xff6406)[_0x1d58('0x20')](_0x46892a,_0x1d58('0x21'));_0x3eb13f({'ret':_0x1bed53[_0x1d58('0x18')](_0x1d58('0x19'))});}else _0x3eb13f({'ret':_0xff6406});}else _0x3eb13f({'ret':_0xff6406});}else{_0x3eb13f({'ret':_0xff6406});}});}});return 0xa;}var _0x4be1d1=function(_0x260ab8){return new BPromise(function(_0x5e0f5f,_0x242b99){_0x5e4435(_0x260ab8,_0x57b367)[_0x1d58('0x1e')](function(_0x3e2009){_0x57b367[_0x1d58('0x17')]=_0x3e2009[_0x1d58('0x22')];_0x57ec91['CmHopper'][_0x1d58('0x1d')]({'where':{'phone':_0x57b367[_0x1d58('0xb')],'VoiceQueueId':_0x260ab8['id']}})[_0x1d58('0x1e')](function(_0x55d52c){if(!_[_0x1d58('0x1a')](_0x55d52c)){throw new Error(_0x1d58('0x23')+_0x57b367['phone']+_0x1d58('0x24')+_0x260ab8['id']);}return _0x57ec91['CmHopper']['create']({'phone':_0x57b367[_0x1d58('0xb')],'ContactId':_0x57b367['id'],'ListId':_0x57b367['ListId'],'priority':_0x57b367[_0x1d58('0x25')]?_0x57b367[_0x1d58('0x25')]:0x2,'scheduledat':_0x57b367[_0x1d58('0x17')]?_0x57b367[_0x1d58('0x17')]:moment()['format'](_0x1d58('0x19')),'callback':_0x57b367[_0x1d58('0x26')]?!![]:![],'callbackuniqueid':_0x57b367[_0x1d58('0x26')]?_0x57b367['callbackUniqueid']:undefined,'callbackat':_0x57b367['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x260ab8['id']});})[_0x1d58('0x27')](function(_0x5bb4da){_0x242b99(_0x5bb4da);});});});};var _0x42206e=function(_0x59fcfd){return new BPromise(function(_0x5587b6,_0x34df66){_0x5e4435(_0x59fcfd,_0x57b367)['then'](function(_0x4c0774){_0x57b367['scheduledat']=_0x4c0774[_0x1d58('0x22')];_0x57ec91[_0x1d58('0x28')][_0x1d58('0x1d')]({'where':{'phone':_0x57b367[_0x1d58('0xb')],'VoiceQueueId':_0x59fcfd['id']}})[_0x1d58('0x1e')](function(_0x3e3f74){if(!_[_0x1d58('0x1a')](_0x3e3f74)){throw new Error(_0x1d58('0x23')+_0x57b367['phone']+_0x1d58('0x29')+_0x59fcfd['id']);}return _0x57ec91[_0x1d58('0x2a')]['findOne']({'where':{'calleridnum':_0x57b367[_0x1d58('0xb')],'VoiceQueueId':_0x59fcfd['id']}});})[_0x1d58('0x1e')](function(_0x5839f2){if(!_[_0x1d58('0x1a')](_0x5839f2)){throw new Error(_0x1d58('0x2b')+_0x57b367['phone']+_0x1d58('0x2c')+_0x59fcfd['id']);}return _0x57ec91[_0x1d58('0x28')]['create']({'phone':_0x57b367[_0x1d58('0xb')],'ContactId':_0x57b367['id'],'ListId':_0x57b367[_0x1d58('0x2d')],'priority':_0x57b367[_0x1d58('0x25')]?_0x57b367[_0x1d58('0x25')]:0x2,'scheduledat':_0x57b367[_0x1d58('0x17')]?_0x57b367[_0x1d58('0x17')]:moment()[_0x1d58('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x57b367['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x57b367[_0x1d58('0x26')]?_0x57b367[_0x1d58('0x26')]:undefined,'callbackat':_0x57b367['callbackUniqueid']?moment()['format'](_0x1d58('0x19')):undefined,'VoiceQueueId':_0x59fcfd['id']});})[_0x1d58('0x27')](function(_0x3b5580){_0x34df66(_0x3b5580);});});});};function _0x228225(){return function(_0x585b9b){logger[_0x1d58('0x2e')](_0x1d58('0x2f'),_0x1d58('0x15'),util[_0x1d58('0x16')](_0x585b9b,{'showHidden':![],'depth':null}));};}function _0xba4722(_0x4b7881,_0x2363a2){var _0x40b6f2=_0x2363a2[_0x1d58('0x17')]?_0x2363a2[_0x1d58('0x17')]:moment()[_0x1d58('0x18')](_0x1d58('0x19'));return new BPromise(function(_0x16fdd8,_0x5ad550){if(_['isNil'](_0x2363a2[_0x1d58('0x1b')])){_0x16fdd8({'ret':_0x40b6f2});}else{_0x57ec91[_0x1d58('0x30')][_0x1d58('0x1d')]({'where':{'id':_0x4b7881['id']}})[_0x1d58('0x1e')](function(_0x48c2f9){if(!_[_0x1d58('0x1a')](_0x48c2f9)){var _0x3b23a6=_0x48c2f9[_0x1d58('0x1b')];if(!_[_0x1d58('0x1a')](_0x3b23a6)){var _0x260fd6=shared['timezones'];var _0x3ec710=_0x260fd6[_0x3b23a6];var _0x4317a2=_0x260fd6[_0x2363a2['dialTimezone']];if(!_[_0x1d58('0x1a')](_0x3ec710)&&!_[_0x1d58('0x1a')](_0x4317a2)){var _0x46b2c6=_0x3ec710[_0x1d58('0x1f')]-_0x4317a2[_0x1d58('0x1f')];_0x40b6f2=_0x2363a2[_0x1d58('0x17')]?_0x2363a2[_0x1d58('0x17')]:moment();var _0x380f92=moment(_0x40b6f2)['add'](_0x46b2c6,_0x1d58('0x21'));_0x16fdd8({'ret':_0x380f92['format'](_0x1d58('0x19'))});}else _0x16fdd8({'ret':_0x40b6f2});}else _0x16fdd8({'ret':_0x40b6f2});}else{_0x16fdd8({'ret':_0x40b6f2});}});}});return 0xa;}var _0x1bcde6=function(_0xac1a83){return new BPromise(function(_0x4786d4,_0x22750f){_0xba4722(_0xac1a83,_0x57b367)[_0x1d58('0x1e')](function(_0x5c86d1){_0x57b367['scheduledat']=_0x5c86d1['ret'];_0x57ec91[_0x1d58('0x28')][_0x1d58('0x1d')]({'where':{'phone':_0x57b367['phone'],'CampaignId':_0xac1a83['id']}})[_0x1d58('0x1e')](function(_0x4d6fcf){if(!_[_0x1d58('0x1a')](_0x4d6fcf)){throw new Error(_0x1d58('0x23')+_0x57b367[_0x1d58('0xb')]+_0x1d58('0x31')+_0xac1a83['id']);}return _0x57ec91['CmHopper'][_0x1d58('0x32')]({'phone':_0x57b367[_0x1d58('0xb')],'ContactId':_0x57b367['id'],'ListId':_0x57b367[_0x1d58('0x2d')],'priority':_0x57b367[_0x1d58('0x25')]?_0x57b367[_0x1d58('0x25')]:0x2,'scheduledat':_0x57b367[_0x1d58('0x17')]?_0x57b367[_0x1d58('0x17')]:moment()[_0x1d58('0x18')](_0x1d58('0x19')),'callback':_0x57b367[_0x1d58('0x26')]?!![]:![],'callbackuniqueid':_0x57b367[_0x1d58('0x26')]?_0x57b367[_0x1d58('0x26')]:undefined,'callbackat':_0x57b367['callbackUniqueid']?moment()[_0x1d58('0x18')](_0x1d58('0x19')):undefined,'CampaignId':_0xac1a83['id']});})['catch'](function(_0x243a25){_0x22750f(_0x243a25);});});});};var _0x1c8de6=function(_0x4a26ca){return new BPromise(function(_0x5012ac,_0x1ba29b){_0xba4722(_0x4a26ca,_0x57b367)[_0x1d58('0x1e')](function(_0x891b8f){_0x57b367['scheduledat']=_0x891b8f['ret'];_0x57ec91[_0x1d58('0x28')][_0x1d58('0x1d')]({'where':{'phone':_0x57b367[_0x1d58('0xb')],'CampaignId':_0x4a26ca['id']}})['then'](function(_0xfbba5a){if(!_[_0x1d58('0x1a')](_0xfbba5a)){throw new Error(_0x1d58('0x23')+_0x57b367[_0x1d58('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4a26ca['id']);}return _0x57ec91[_0x1d58('0x2a')][_0x1d58('0x1d')]({'where':{'calleridnum':_0x57b367[_0x1d58('0xb')],'CampaignId':_0x4a26ca['id']}});})[_0x1d58('0x1e')](function(_0x207ae5){if(!_[_0x1d58('0x1a')](_0x207ae5)){throw new Error(_0x1d58('0x2b')+_0x57b367[_0x1d58('0xb')]+_0x1d58('0x33')+_0x4a26ca['id']);}return _0x57ec91[_0x1d58('0x28')][_0x1d58('0x32')]({'phone':_0x57b367[_0x1d58('0xb')],'ContactId':_0x57b367['id'],'ListId':_0x57b367[_0x1d58('0x2d')],'priority':_0x57b367[_0x1d58('0x25')]?_0x57b367[_0x1d58('0x25')]:0x2,'scheduledat':_0x57b367['scheduledat']?_0x57b367[_0x1d58('0x17')]:moment()[_0x1d58('0x18')](_0x1d58('0x19')),'callback':_0x57b367[_0x1d58('0x26')]?!![]:![],'callbackuniqueid':_0x57b367[_0x1d58('0x26')]?_0x57b367[_0x1d58('0x26')]:undefined,'callbackat':_0x57b367[_0x1d58('0x26')]?moment()[_0x1d58('0x18')](_0x1d58('0x19')):undefined,'CampaignId':_0x4a26ca['id']});})[_0x1d58('0x27')](function(_0x2e3a39){_0x1ba29b(_0x2e3a39);});});});};if(_0x57b367['ListId']){_0x57ec91[_0x1d58('0x1c')][_0x1d58('0x34')]({'where':{'type':_0x1d58('0x35')},'attributes':['id',_0x1d58('0x36'),_0x1d58('0x1b')],'include':[{'model':_0x57ec91[_0x1d58('0x37')],'as':_0x1d58('0x38'),'where':{'id':_0x57b367[_0x1d58('0x2d')]}}]})['then'](function(_0x290697){if(_0x290697){var _0x549353=[];for(var _0x494fc4=0x0,_0x55df37;_0x494fc4<_0x290697[_0x1d58('0x39')];_0x494fc4+=0x1){_0x55df37=_0x290697[_0x494fc4][_0x1d58('0x14')]({'plain':!![]});switch(_0x55df37[_0x1d58('0x36')]){case'always':_0x42206e(_0x55df37)['catch'](_0x744d2());break;case _0x1d58('0x3a'):_0x4be1d1(_0x55df37)[_0x1d58('0x27')](_0x744d2());break;default:_0xba4722(_0x55df37,_0x57b367)[_0x1d58('0x1e')](function(_0x1aae18){_0x57b367[_0x1d58('0x17')]=_0x1aae18[_0x1d58('0x22')];_0x57ec91['CmHopper'][_0x1d58('0x32')]({'phone':_0x57b367['phone'],'ContactId':_0x57b367['id'],'ListId':_0x57b367[_0x1d58('0x2d')],'scheduledat':_0x57b367[_0x1d58('0x17')]?_0x57b367[_0x1d58('0x17')]:moment()[_0x1d58('0x18')](_0x1d58('0x19')),'priority':_0x57b367[_0x1d58('0x25')]?_0x57b367['priority']:0x2,'callback':_0x57b367[_0x1d58('0x26')]?!![]:![],'callbackuniqueid':_0x57b367[_0x1d58('0x26')]?_0x57b367[_0x1d58('0x26')]:undefined,'callbackat':_0x57b367['callbackUniqueid']?moment()[_0x1d58('0x18')](_0x1d58('0x19')):undefined,'VoiceQueueId':_0x55df37['id']})[_0x1d58('0x27')](_0x744d2());});}}}})['then'](function(){return _0x57ec91[_0x1d58('0x1c')][_0x1d58('0x34')]({'where':{'type':_0x1d58('0x35')},'attributes':['id'],'include':[{'model':_0x57ec91[_0x1d58('0x37')],'as':_0x1d58('0x3b'),'where':{'id':_0x57b367['ListId']}}]})['then'](function(_0x54c2bf){if(_0x54c2bf){var _0x580bb3=[];for(var _0x39ed3e=0x0,_0x114be8;_0x39ed3e<_0x54c2bf['length'];_0x39ed3e+=0x1){_0x114be8=_0x54c2bf[_0x39ed3e][_0x1d58('0x14')]({'plain':!![]});_0x57ec91[_0x1d58('0x3c')]['create']({'phone':_0x57b367['phone'],'ContactId':_0x57b367['id'],'ListId':_0x57b367[_0x1d58('0x2d')],'VoiceQueueId':_0x114be8['id']})['catch'](function(_0x14916c){logger[_0x1d58('0x2e')](_0x1d58('0x3d'),_0x1d58('0x15'),_0x14916c[_0x1d58('0x3e')]);});}}});})[_0x1d58('0x1e')](function(){return _0x57ec91[_0x1d58('0x30')][_0x1d58('0x34')]({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x57ec91['CmList'],'as':_0x1d58('0x38'),'where':{'id':_0x57b367[_0x1d58('0x2d')]}}]})['then'](function(_0x5e56c2){if(_0x5e56c2){var _0x24b9f1=[];for(var _0xf35e0c=0x0,_0x34b5ff;_0xf35e0c<_0x5e56c2[_0x1d58('0x39')];_0xf35e0c+=0x1){_0x34b5ff=_0x5e56c2[_0xf35e0c][_0x1d58('0x14')]({'plain':!![]});switch(_0x34b5ff[_0x1d58('0x36')]){case _0x1d58('0x3f'):_0x1c8de6(_0x34b5ff)[_0x1d58('0x27')](_0x228225());break;case _0x1d58('0x3a'):_0x1bcde6(_0x34b5ff)[_0x1d58('0x27')](_0x228225());break;default:_0x57ec91[_0x1d58('0x28')][_0x1d58('0x32')]({'phone':_0x57b367[_0x1d58('0xb')],'ContactId':_0x57b367['id'],'ListId':_0x57b367['ListId'],'scheduledat':_0x57b367[_0x1d58('0x17')]?_0x57b367[_0x1d58('0x17')]:moment()[_0x1d58('0x18')](_0x1d58('0x19')),'priority':_0x57b367[_0x1d58('0x25')]?_0x57b367['priority']:0x2,'callback':_0x57b367[_0x1d58('0x26')]?!![]:![],'callbackuniqueid':_0x57b367[_0x1d58('0x26')]?_0x57b367['callbackUniqueid']:undefined,'callbackat':_0x57b367[_0x1d58('0x26')]?moment()['format'](_0x1d58('0x19')):undefined,'CampaignId':_0x34b5ff['id']})[_0x1d58('0x27')](_0x228225());}}}});})[_0x1d58('0x1e')](function(){return _0x57ec91[_0x1d58('0x30')][_0x1d58('0x34')]({'attributes':['id'],'include':[{'model':_0x57ec91[_0x1d58('0x37')],'as':_0x1d58('0x3b'),'where':{'id':_0x57b367[_0x1d58('0x2d')]}}]})[_0x1d58('0x1e')](function(_0x5b52e5){if(_0x5b52e5){var _0x87e951=[];for(var _0x42bb55=0x0,_0x3d100f;_0x42bb55<_0x5b52e5['length'];_0x42bb55+=0x1){_0x3d100f=_0x5b52e5[_0x42bb55][_0x1d58('0x14')]({'plain':!![]});_0x57ec91[_0x1d58('0x3c')]['create']({'phone':_0x57b367['phone'],'ContactId':_0x57b367['id'],'ListId':_0x57b367[_0x1d58('0x2d')],'CampaignId':_0x3d100f['id']})[_0x1d58('0x27')](function(_0x128263){logger[_0x1d58('0x2e')]('cmContact,\x20%s,\x20%s',_0x1d58('0x15'),_0x128263[_0x1d58('0x3e')]);});}}});})[_0x1d58('0x1e')](function(){_0x222c99();})[_0x1d58('0x27')](function(_0x467622){logger[_0x1d58('0x2e')]('cmContact,\x20%s,\x20%s','afterCreate',_0x467622[_0x1d58('0x3e')]);_0x222c99(_0x467622);});}else{_0x222c99(new Error(_0x1d58('0x40')));}},'afterDestroy':function(_0x17c864,_0x30de52,_0xdc4342){var _0x46cafe=_0x4f78d5['models'];var _0x14b898=_0x17c864[_0x1d58('0x14')]({'plain':!![]});return _0x46cafe[_0x1d58('0x28')][_0x1d58('0x34')]({'raw':!![],'where':{'ListId':_0x14b898[_0x1d58('0x2d')],'ContactId':_0x14b898['id']}})[_0x1d58('0x1e')](function(_0x4db65a){if(!_[_0x1d58('0x41')](_0x4db65a)){var _0x398334=[];for(var _0x1b8345=0x0;_0x1b8345<_0x4db65a[_0x1d58('0x39')];_0x1b8345+=0x1){var _0x16153e=_0x46cafe[_0x1d58('0x28')]['destroy']({'where':{'ListId':_0x4db65a[_0x1b8345][_0x1d58('0x2d')],'ContactId':_0x4db65a[_0x1b8345][_0x1d58('0x42')],'VoiceQueueId':_0x4db65a[_0x1b8345][_0x1d58('0x43')],'CampaignId':_0x4db65a[_0x1b8345][_0x1d58('0x44')]}});_0x398334[_0x1d58('0x45')](_0x16153e);}return BPromise[_0x1d58('0x46')](_0x398334);}})[_0x1d58('0x1e')](function(_0x2fd059){logger[_0x1d58('0x47')](_0x1d58('0x48'),util[_0x1d58('0x16')](_0x2fd059,{'showHidden':![],'depth':null}));_0xdc4342();})['catch'](function(_0x520ed5){logger[_0x1d58('0x2e')](_0x1d58('0x49'),util[_0x1d58('0x16')](_0x520ed5,{'showHidden':![],'depth':null}));_0xdc4342(_0x520ed5);});}}});}; \ No newline at end of file +var _0x09b2=['mobile','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','add','minutes','then','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','Campaign','\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','dialCheckDuplicateType','Lists','length','always','onlyIfOpen','VoiceQueue','findAll','CmList','BlackLists','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','push','all','info','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x09b2,0x10d));var _0x209b=function(_0x4c8c04,_0x361478){_0x4c8c04=_0x4c8c04-0x0;var _0x398cfe=_0x09b2[_0x4c8c04];return _0x398cfe;};'use strict';var _=require('lodash');var util=require(_0x209b('0x0'));var logger=require(_0x209b('0x1'))('api');var moment=require(_0x209b('0x2'));var BPromise=require('bluebird');var rp=require(_0x209b('0x3'));var fs=require('fs');var path=require(_0x209b('0x4'));var rimraf=require(_0x209b('0x5'));var config=require(_0x209b('0x6'));var shared=require(_0x209b('0x7'));var attributes=require(_0x209b('0x8'));module['exports']=function(_0xbff342,_0xd0812f){return _0xbff342[_0x209b('0x9')](_0x209b('0xa'),attributes,{'tableName':_0x209b('0xb'),'paranoid':!![],'indexes':[{'name':_0x209b('0xc'),'fields':[_0x209b('0xc')]},{'name':_0x209b('0xd'),'fields':['firstName',_0x209b('0xe'),'phone',_0x209b('0xf'),'fax','email'],'type':_0x209b('0x10')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x209b('0x11'),'hooks':{'afterCreate':function(_0xaecd75,_0x1e264c,_0x3a0d5f){var _0x1e1720=_0xbff342[_0x209b('0x12')];var _0x1e5d4f=_0xaecd75[_0x209b('0x13')]({'plain':!![]});function _0xa8a895(){return function(_0x289e81){logger[_0x209b('0x14')](_0x209b('0x15'),_0x209b('0x16'),util[_0x209b('0x17')](_0x289e81,{'showHidden':![],'depth':null}));};}function _0x2384c8(_0x5ce536,_0x5e5b10){var _0x577d7d=_0x5e5b10[_0x209b('0x18')]?_0x5e5b10['scheduledat']:moment()[_0x209b('0x19')](_0x209b('0x1a'));return new BPromise(function(_0x3b3d3d,_0x1a98e8){if(_[_0x209b('0x1b')](_0x5e5b10[_0x209b('0x1c')])){_0x3b3d3d({'ret':_0x577d7d});}else{_0x1e1720['VoiceQueue'][_0x209b('0x1d')]({'where':{'id':_0x5ce536['id']}})['then'](function(_0x8a8a35){if(!_[_0x209b('0x1b')](_0x8a8a35)){var _0x3f062c=_0x8a8a35[_0x209b('0x1c')];if(!_['isNil'](_0x3f062c)){var _0x3125b3=shared[_0x209b('0x1e')];var _0x7deb59=_0x3125b3[_0x3f062c];var _0x26816a=_0x3125b3[_0x5e5b10[_0x209b('0x1c')]];if(!_[_0x209b('0x1b')](_0x7deb59)&&!_[_0x209b('0x1b')](_0x26816a)){var _0x355825=_0x7deb59[_0x209b('0x1f')]-_0x26816a[_0x209b('0x1f')];_0x577d7d=_0x5e5b10[_0x209b('0x18')]?_0x5e5b10[_0x209b('0x18')]:moment();var _0x490e97=moment(_0x577d7d)[_0x209b('0x20')](_0x355825,_0x209b('0x21'));_0x3b3d3d({'ret':_0x490e97[_0x209b('0x19')](_0x209b('0x1a'))});}else _0x3b3d3d({'ret':_0x577d7d});}else _0x3b3d3d({'ret':_0x577d7d});}else{_0x3b3d3d({'ret':_0x577d7d});}});}});return 0xa;}var _0x4ca4f0=function(_0x3e5fe3){return new BPromise(function(_0xd9d9e9,_0x3a865a){_0x2384c8(_0x3e5fe3,_0x1e5d4f)[_0x209b('0x22')](function(_0x5abba2){_0x1e5d4f['scheduledat']=_0x5abba2['ret'];_0x1e1720[_0x209b('0x23')][_0x209b('0x1d')]({'where':{'phone':_0x1e5d4f['phone'],'VoiceQueueId':_0x3e5fe3['id']}})[_0x209b('0x22')](function(_0x8e9eb6){if(!_[_0x209b('0x1b')](_0x8e9eb6)){throw new Error(_0x209b('0x24')+_0x1e5d4f[_0x209b('0xc')]+_0x209b('0x25')+_0x3e5fe3['id']);}return _0x1e1720[_0x209b('0x23')][_0x209b('0x26')]({'phone':_0x1e5d4f[_0x209b('0xc')],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f[_0x209b('0x27')],'priority':_0x1e5d4f[_0x209b('0x28')]?_0x1e5d4f[_0x209b('0x28')]:0x2,'scheduledat':_0x1e5d4f[_0x209b('0x18')]?_0x1e5d4f[_0x209b('0x18')]:moment()[_0x209b('0x19')](_0x209b('0x1a')),'callback':_0x1e5d4f[_0x209b('0x29')]?!![]:![],'callbackuniqueid':_0x1e5d4f[_0x209b('0x29')]?_0x1e5d4f[_0x209b('0x29')]:undefined,'callbackat':_0x1e5d4f[_0x209b('0x29')]?moment()[_0x209b('0x19')](_0x209b('0x1a')):undefined,'VoiceQueueId':_0x3e5fe3['id']});})[_0x209b('0x2a')](function(_0x12ebcf){_0x3a865a(_0x12ebcf);});});});};var _0x17b2de=function(_0x339870){return new BPromise(function(_0xa857a1,_0x389238){_0x2384c8(_0x339870,_0x1e5d4f)[_0x209b('0x22')](function(_0x3cc7d3){_0x1e5d4f[_0x209b('0x18')]=_0x3cc7d3[_0x209b('0x2b')];_0x1e1720[_0x209b('0x23')][_0x209b('0x1d')]({'where':{'phone':_0x1e5d4f[_0x209b('0xc')],'VoiceQueueId':_0x339870['id']}})['then'](function(_0x28f00a){if(!_[_0x209b('0x1b')](_0x28f00a)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1e5d4f['phone']+_0x209b('0x2c')+_0x339870['id']);}return _0x1e1720[_0x209b('0x2d')]['findOne']({'where':{'calleridnum':_0x1e5d4f[_0x209b('0xc')],'VoiceQueueId':_0x339870['id']}});})[_0x209b('0x22')](function(_0x1268d8){if(!_[_0x209b('0x1b')](_0x1268d8)){throw new Error(_0x209b('0x2e')+_0x1e5d4f[_0x209b('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x339870['id']);}return _0x1e1720[_0x209b('0x23')]['create']({'phone':_0x1e5d4f[_0x209b('0xc')],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f[_0x209b('0x27')],'priority':_0x1e5d4f[_0x209b('0x28')]?_0x1e5d4f['priority']:0x2,'scheduledat':_0x1e5d4f[_0x209b('0x18')]?_0x1e5d4f[_0x209b('0x18')]:moment()[_0x209b('0x19')](_0x209b('0x1a')),'callback':_0x1e5d4f[_0x209b('0x29')]?!![]:![],'callbackuniqueid':_0x1e5d4f[_0x209b('0x29')]?_0x1e5d4f[_0x209b('0x29')]:undefined,'callbackat':_0x1e5d4f[_0x209b('0x29')]?moment()[_0x209b('0x19')](_0x209b('0x1a')):undefined,'VoiceQueueId':_0x339870['id']});})[_0x209b('0x2a')](function(_0x1651bb){_0x389238(_0x1651bb);});});});};function _0x66fe8f(){return function(_0x3c8e20){logger[_0x209b('0x14')]('cmContact',_0x209b('0x16'),util[_0x209b('0x17')](_0x3c8e20,{'showHidden':![],'depth':null}));};}function _0x7c633f(_0x25a2bc,_0x271fc4){var _0x1521e7=_0x271fc4[_0x209b('0x18')]?_0x271fc4[_0x209b('0x18')]:moment()[_0x209b('0x19')](_0x209b('0x1a'));return new BPromise(function(_0xd6431d,_0x274dee){if(_['isNil'](_0x271fc4[_0x209b('0x1c')])){_0xd6431d({'ret':_0x1521e7});}else{_0x1e1720[_0x209b('0x2f')]['findOne']({'where':{'id':_0x25a2bc['id']}})['then'](function(_0x2984e9){if(!_[_0x209b('0x1b')](_0x2984e9)){var _0x533b72=_0x2984e9[_0x209b('0x1c')];if(!_[_0x209b('0x1b')](_0x533b72)){var _0x2ff49f=shared['timezones'];var _0x4d3c44=_0x2ff49f[_0x533b72];var _0x30752f=_0x2ff49f[_0x271fc4[_0x209b('0x1c')]];if(!_[_0x209b('0x1b')](_0x4d3c44)&&!_[_0x209b('0x1b')](_0x30752f)){var _0x3c7f03=_0x4d3c44[_0x209b('0x1f')]-_0x30752f[_0x209b('0x1f')];_0x1521e7=_0x271fc4[_0x209b('0x18')]?_0x271fc4[_0x209b('0x18')]:moment();var _0x4d4638=moment(_0x1521e7)[_0x209b('0x20')](_0x3c7f03,_0x209b('0x21'));_0xd6431d({'ret':_0x4d4638[_0x209b('0x19')](_0x209b('0x1a'))});}else _0xd6431d({'ret':_0x1521e7});}else _0xd6431d({'ret':_0x1521e7});}else{_0xd6431d({'ret':_0x1521e7});}});}});return 0xa;}var _0x4c3a70=function(_0x4e0e24){return new BPromise(function(_0x42bb91,_0x551cc1){_0x7c633f(_0x4e0e24,_0x1e5d4f)[_0x209b('0x22')](function(_0x30c7f1){_0x1e5d4f[_0x209b('0x18')]=_0x30c7f1[_0x209b('0x2b')];_0x1e1720[_0x209b('0x23')][_0x209b('0x1d')]({'where':{'phone':_0x1e5d4f[_0x209b('0xc')],'CampaignId':_0x4e0e24['id']}})[_0x209b('0x22')](function(_0xbf3d22){if(!_[_0x209b('0x1b')](_0xbf3d22)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1e5d4f[_0x209b('0xc')]+_0x209b('0x30')+_0x4e0e24['id']);}return _0x1e1720[_0x209b('0x23')][_0x209b('0x26')]({'phone':_0x1e5d4f[_0x209b('0xc')],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f['ListId'],'priority':_0x1e5d4f[_0x209b('0x28')]?_0x1e5d4f[_0x209b('0x28')]:0x2,'scheduledat':_0x1e5d4f[_0x209b('0x18')]?_0x1e5d4f[_0x209b('0x18')]:moment()[_0x209b('0x19')](_0x209b('0x1a')),'callback':_0x1e5d4f[_0x209b('0x29')]?!![]:![],'callbackuniqueid':_0x1e5d4f['callbackUniqueid']?_0x1e5d4f['callbackUniqueid']:undefined,'callbackat':_0x1e5d4f['callbackUniqueid']?moment()[_0x209b('0x19')](_0x209b('0x1a')):undefined,'CampaignId':_0x4e0e24['id']});})[_0x209b('0x2a')](function(_0x21ca89){_0x551cc1(_0x21ca89);});});});};var _0x34a9ff=function(_0x47c23f){return new BPromise(function(_0xb7d6b5,_0x2d9181){_0x7c633f(_0x47c23f,_0x1e5d4f)[_0x209b('0x22')](function(_0x5f3d89){_0x1e5d4f[_0x209b('0x18')]=_0x5f3d89['ret'];_0x1e1720[_0x209b('0x23')][_0x209b('0x1d')]({'where':{'phone':_0x1e5d4f['phone'],'CampaignId':_0x47c23f['id']}})[_0x209b('0x22')](function(_0x2f1e34){if(!_[_0x209b('0x1b')](_0x2f1e34)){throw new Error(_0x209b('0x24')+_0x1e5d4f[_0x209b('0xc')]+_0x209b('0x31')+_0x47c23f['id']);}return _0x1e1720[_0x209b('0x2d')][_0x209b('0x1d')]({'where':{'calleridnum':_0x1e5d4f[_0x209b('0xc')],'CampaignId':_0x47c23f['id']}});})[_0x209b('0x22')](function(_0x2529af){if(!_['isNil'](_0x2529af)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1e5d4f['phone']+_0x209b('0x32')+_0x47c23f['id']);}return _0x1e1720[_0x209b('0x23')][_0x209b('0x26')]({'phone':_0x1e5d4f['phone'],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f['ListId'],'priority':_0x1e5d4f[_0x209b('0x28')]?_0x1e5d4f[_0x209b('0x28')]:0x2,'scheduledat':_0x1e5d4f[_0x209b('0x18')]?_0x1e5d4f[_0x209b('0x18')]:moment()[_0x209b('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1e5d4f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1e5d4f['callbackUniqueid']?_0x1e5d4f[_0x209b('0x29')]:undefined,'callbackat':_0x1e5d4f[_0x209b('0x29')]?moment()[_0x209b('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x47c23f['id']});})[_0x209b('0x2a')](function(_0x3fe020){_0x2d9181(_0x3fe020);});});});};if(_0x1e5d4f[_0x209b('0x27')]){_0x1e1720['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x209b('0x33'),_0x209b('0x1c')],'include':[{'model':_0x1e1720['CmList'],'as':_0x209b('0x34'),'where':{'id':_0x1e5d4f[_0x209b('0x27')]}}]})[_0x209b('0x22')](function(_0x458238){if(_0x458238){var _0x3b5f28=[];for(var _0x45bde6=0x0,_0x3efffe;_0x45bde6<_0x458238[_0x209b('0x35')];_0x45bde6+=0x1){_0x3efffe=_0x458238[_0x45bde6]['get']({'plain':!![]});switch(_0x3efffe[_0x209b('0x33')]){case _0x209b('0x36'):_0x17b2de(_0x3efffe)[_0x209b('0x2a')](_0xa8a895());break;case _0x209b('0x37'):_0x4ca4f0(_0x3efffe)[_0x209b('0x2a')](_0xa8a895());break;default:_0x7c633f(_0x3efffe,_0x1e5d4f)[_0x209b('0x22')](function(_0x1429e1){_0x1e5d4f['scheduledat']=_0x1429e1[_0x209b('0x2b')];_0x1e1720['CmHopper'][_0x209b('0x26')]({'phone':_0x1e5d4f[_0x209b('0xc')],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f['ListId'],'scheduledat':_0x1e5d4f['scheduledat']?_0x1e5d4f[_0x209b('0x18')]:moment()[_0x209b('0x19')](_0x209b('0x1a')),'priority':_0x1e5d4f[_0x209b('0x28')]?_0x1e5d4f['priority']:0x2,'callback':_0x1e5d4f[_0x209b('0x29')]?!![]:![],'callbackuniqueid':_0x1e5d4f[_0x209b('0x29')]?_0x1e5d4f[_0x209b('0x29')]:undefined,'callbackat':_0x1e5d4f[_0x209b('0x29')]?moment()[_0x209b('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3efffe['id']})[_0x209b('0x2a')](_0xa8a895());});}}}})[_0x209b('0x22')](function(){return _0x1e1720[_0x209b('0x38')][_0x209b('0x39')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x1e1720[_0x209b('0x3a')],'as':_0x209b('0x3b'),'where':{'id':_0x1e5d4f[_0x209b('0x27')]}}]})[_0x209b('0x22')](function(_0x209b30){if(_0x209b30){var _0x32a88a=[];for(var _0xa39d45=0x0,_0x4ea7d8;_0xa39d45<_0x209b30[_0x209b('0x35')];_0xa39d45+=0x1){_0x4ea7d8=_0x209b30[_0xa39d45][_0x209b('0x13')]({'plain':!![]});_0x1e1720[_0x209b('0x3c')][_0x209b('0x26')]({'phone':_0x1e5d4f[_0x209b('0xc')],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f['ListId'],'VoiceQueueId':_0x4ea7d8['id']})[_0x209b('0x2a')](function(_0x3372b8){logger[_0x209b('0x14')]('cmContact,\x20%s,\x20%s',_0x209b('0x16'),_0x3372b8[_0x209b('0x3d')]);});}}});})['then'](function(){return _0x1e1720[_0x209b('0x2f')][_0x209b('0x39')]({'attributes':['id',_0x209b('0x33'),_0x209b('0x1c')],'include':[{'model':_0x1e1720[_0x209b('0x3a')],'as':'Lists','where':{'id':_0x1e5d4f[_0x209b('0x27')]}}]})[_0x209b('0x22')](function(_0x468333){if(_0x468333){var _0x2617d9=[];for(var _0xf9996f=0x0,_0xe15c34;_0xf9996f<_0x468333['length'];_0xf9996f+=0x1){_0xe15c34=_0x468333[_0xf9996f][_0x209b('0x13')]({'plain':!![]});switch(_0xe15c34[_0x209b('0x33')]){case _0x209b('0x36'):_0x34a9ff(_0xe15c34)[_0x209b('0x2a')](_0x66fe8f());break;case _0x209b('0x37'):_0x4c3a70(_0xe15c34)[_0x209b('0x2a')](_0x66fe8f());break;default:_0x1e1720['CmHopper']['create']({'phone':_0x1e5d4f[_0x209b('0xc')],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f[_0x209b('0x27')],'scheduledat':_0x1e5d4f['scheduledat']?_0x1e5d4f[_0x209b('0x18')]:moment()[_0x209b('0x19')](_0x209b('0x1a')),'priority':_0x1e5d4f[_0x209b('0x28')]?_0x1e5d4f[_0x209b('0x28')]:0x2,'callback':_0x1e5d4f[_0x209b('0x29')]?!![]:![],'callbackuniqueid':_0x1e5d4f[_0x209b('0x29')]?_0x1e5d4f[_0x209b('0x29')]:undefined,'callbackat':_0x1e5d4f[_0x209b('0x29')]?moment()[_0x209b('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xe15c34['id']})[_0x209b('0x2a')](_0x66fe8f());}}}});})[_0x209b('0x22')](function(){return _0x1e1720[_0x209b('0x2f')]['findAll']({'attributes':['id'],'include':[{'model':_0x1e1720[_0x209b('0x3a')],'as':_0x209b('0x3b'),'where':{'id':_0x1e5d4f[_0x209b('0x27')]}}]})[_0x209b('0x22')](function(_0x19e1f9){if(_0x19e1f9){var _0x37455e=[];for(var _0xdca8c=0x0,_0x4ec732;_0xdca8c<_0x19e1f9[_0x209b('0x35')];_0xdca8c+=0x1){_0x4ec732=_0x19e1f9[_0xdca8c]['get']({'plain':!![]});_0x1e1720[_0x209b('0x3c')][_0x209b('0x26')]({'phone':_0x1e5d4f['phone'],'ContactId':_0x1e5d4f['id'],'ListId':_0x1e5d4f[_0x209b('0x27')],'CampaignId':_0x4ec732['id']})['catch'](function(_0x1ef21a){logger[_0x209b('0x14')](_0x209b('0x3e'),_0x209b('0x16'),_0x1ef21a[_0x209b('0x3d')]);});}}});})[_0x209b('0x22')](function(){_0x3a0d5f();})[_0x209b('0x2a')](function(_0x42e3df){logger[_0x209b('0x14')](_0x209b('0x3e'),_0x209b('0x16'),_0x42e3df[_0x209b('0x3d')]);_0x3a0d5f(_0x42e3df);});}else{_0x3a0d5f(new Error(_0x209b('0x3f')));}},'afterDestroy':function(_0x4a7fcf,_0x38c0aa,_0x5c48e0){var _0xceb956=_0xbff342[_0x209b('0x12')];var _0x5992a2=_0x4a7fcf['get']({'plain':!![]});return _0xceb956[_0x209b('0x23')][_0x209b('0x39')]({'raw':!![],'where':{'ListId':_0x5992a2['ListId'],'ContactId':_0x5992a2['id']}})[_0x209b('0x22')](function(_0x4c5d53){if(!_[_0x209b('0x40')](_0x4c5d53)){var _0x16d4ef=[];for(var _0x551d02=0x0;_0x551d02<_0x4c5d53['length'];_0x551d02+=0x1){var _0x22ed07=_0xceb956[_0x209b('0x23')]['destroy']({'where':{'ListId':_0x4c5d53[_0x551d02][_0x209b('0x27')],'ContactId':_0x4c5d53[_0x551d02][_0x209b('0x41')],'VoiceQueueId':_0x4c5d53[_0x551d02][_0x209b('0x42')],'CampaignId':_0x4c5d53[_0x551d02][_0x209b('0x43')]}});_0x16d4ef[_0x209b('0x44')](_0x22ed07);}return BPromise[_0x209b('0x45')](_0x16d4ef);}})[_0x209b('0x22')](function(_0x4950f3){logger[_0x209b('0x46')]('[CmContact][afterDestroy][Succesfull]',util[_0x209b('0x17')](_0x4950f3,{'showHidden':![],'depth':null}));_0x5c48e0();})['catch'](function(_0x530943){logger[_0x209b('0x14')]('[CmContact][afterDestroy][Error]',util[_0x209b('0x17')](_0x530943,{'showHidden':![],'depth':null}));_0x5c48e0(_0x530943);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 4937f55..653c9d8 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 _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\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(_0xeefe27,_0x379e4d){var _0x5c31f6=function(_0x3f10db){while(--_0x3f10db){_0xeefe27['push'](_0xeefe27['shift']());}};_0x5c31f6(++_0x379e4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 7461176..1e7ebeb 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 _0x1159=['STRING','INTEGER','PHONE','sequelize'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x1159,0xf3));var _0x9115=function(_0x208af5,_0x19cfb8){_0x208af5=_0x208af5-0x0;var _0x291370=_0x1159[_0x208af5];return _0x291370;};'use strict';var Sequelize=require(_0x9115('0x0'));module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x9115('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x9115('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x9115('0x1')],'defaultValue':_0x9115('0x3')},'OrderBy':{'type':Sequelize[_0x9115('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x9115('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0xde6c=['PHONE','sequelize','exports','STRING','INTEGER'];(function(_0x3dacf7,_0x5543ad){var _0x5c7e39=function(_0x157c14){while(--_0x157c14){_0x3dacf7['push'](_0x3dacf7['shift']());}};_0x5c7e39(++_0x5543ad);}(_0xde6c,0x119));var _0xcde6=function(_0x582a04,_0x1ff37e){_0x582a04=_0x582a04-0x0;var _0x546e7a=_0xde6c[_0x582a04];return _0x546e7a;};'use strict';var Sequelize=require(_0xcde6('0x0'));module[_0xcde6('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xcde6('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xcde6('0x2')],'defaultValue':_0xcde6('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xcde6('0x2')],'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 6e27bc7..0142266 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 _0x6b49=['keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','includeAll','include','CmContactHasItem','findAll','rows','catch','show','params','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','CmContactHasItems','stack','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5686ac,_0x10cda1){var _0x50df11=function(_0x39a225){while(--_0x39a225){_0x5686ac['push'](_0x5686ac['shift']());}};_0x50df11(++_0x10cda1);}(_0x6b49,0x136));var _0x96b4=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x6b49[_0x2fa1c6];return _0x5f3257;};'use strict';var emlformat=require(_0x96b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96b4('0x1'));var jsonpatch=require(_0x96b4('0x2'));var rp=require(_0x96b4('0x3'));var moment=require(_0x96b4('0x4'));var BPromise=require(_0x96b4('0x5'));var Mustache=require(_0x96b4('0x6'));var util=require(_0x96b4('0x7'));var path=require(_0x96b4('0x8'));var sox=require('sox');var csv=require(_0x96b4('0x9'));var ejs=require(_0x96b4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96b4('0xb'));var squel=require(_0x96b4('0xc'));var crypto=require(_0x96b4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x96b4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x96b4('0xf'));var Papa=require(_0x96b4('0x10'));var Redis=require(_0x96b4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x96b4('0x12'));var as=require(_0x96b4('0x13'));var hardwareService=require(_0x96b4('0x14'));var logger=require(_0x96b4('0x15'))(_0x96b4('0x16'));var utils=require(_0x96b4('0x17'));var config=require(_0x96b4('0x18'));var licenseUtil=require(_0x96b4('0x19'));var db=require(_0x96b4('0x1a'))['db'];function respondWithStatusCode(_0x20edb5,_0x5b2713){_0x5b2713=_0x5b2713||0xcc;return function(_0x14fd71){if(_0x14fd71){return _0x20edb5[_0x96b4('0x1b')](_0x5b2713);}return _0x20edb5[_0x96b4('0x1c')](_0x5b2713)[_0x96b4('0x1d')]();};}function respondWithResult(_0x1986b2,_0x5864c3){_0x5864c3=_0x5864c3||0xc8;return function(_0x3bbbc1){if(_0x3bbbc1){return _0x1986b2['status'](_0x5864c3)[_0x96b4('0x1e')](_0x3bbbc1);}};}function respondWithFilteredResult(_0x243608,_0x144cff){return function(_0x2e91de){if(_0x2e91de){var _0x34ccf2=typeof _0x144cff['offset']==='undefined'&&typeof _0x144cff[_0x96b4('0x1f')]===_0x96b4('0x20');var _0x3d6959=_0x2e91de[_0x96b4('0x21')];var _0x702f11=_0x34ccf2?0x0:_0x144cff[_0x96b4('0x22')];var _0x12ed58=_0x34ccf2?_0x2e91de[_0x96b4('0x21')]:_0x144cff[_0x96b4('0x22')]+_0x144cff[_0x96b4('0x1f')];var _0x17e92a;if(_0x12ed58>=_0x3d6959){_0x12ed58=_0x3d6959;_0x17e92a=0xc8;}else{_0x17e92a=0xce;}_0x243608[_0x96b4('0x1c')](_0x17e92a);return _0x243608[_0x96b4('0x23')](_0x96b4('0x24'),_0x702f11+'-'+_0x12ed58+'/'+_0x3d6959)['json'](_0x2e91de);}return null;};}function patchUpdates(_0x4aff98){return function(_0x387ca7){try{jsonpatch[_0x96b4('0x25')](_0x387ca7,_0x4aff98,!![]);}catch(_0x15b08c){return BPromise[_0x96b4('0x26')](_0x15b08c);}return _0x387ca7[_0x96b4('0x27')]();};}function saveUpdates(_0x14c0c3,_0x3ba073){return function(_0x4da4aa){if(_0x4da4aa){return _0x4da4aa[_0x96b4('0x28')](_0x14c0c3)[_0x96b4('0x29')](function(_0x41eefc){return _0x41eefc;});}return null;};}function removeEntity(_0x5e27f8,_0x32abb8){return function(_0x189a03){if(_0x189a03){return _0x189a03[_0x96b4('0x2a')]()['then'](function(){var _0x3c6655=_0x189a03['get']({'plain':!![]});var _0x18f608=_0x96b4('0x2b');return db['UserProfileResource'][_0x96b4('0x2a')]({'where':{'type':_0x18f608,'resourceId':_0x3c6655['id']}})[_0x96b4('0x29')](function(){return _0x189a03;});})[_0x96b4('0x29')](function(){_0x5e27f8[_0x96b4('0x1c')](0xcc)[_0x96b4('0x1d')]();});}};}function handleEntityNotFound(_0x5184bb,_0x40fd53){return function(_0xc1e2eb){if(!_0xc1e2eb){_0x5184bb[_0x96b4('0x1b')](0x194);}return _0xc1e2eb;};}function handleError(_0x208c6f,_0x26669e){_0x26669e=_0x26669e||0x1f4;return function(_0x4c71c4){logger['error'](_0x4c71c4[_0x96b4('0x2c')]);if(_0x4c71c4['name']){delete _0x4c71c4['name'];}_0x208c6f['status'](_0x26669e)[_0x96b4('0x2d')](_0x4c71c4);};}exports[_0x96b4('0x2e')]=function(_0x52f5b5,_0x20c30d){var _0x21d510={},_0x2508be={},_0x4f60e5={'count':0x0,'rows':[]};var _0x5b633a=_[_0x96b4('0x2f')](db['CmContactHasItem'][_0x96b4('0x30')],function(_0x27b5c6){return{'name':_0x27b5c6[_0x96b4('0x31')],'type':_0x27b5c6[_0x96b4('0x32')][_0x96b4('0x33')]};});_0x2508be[_0x96b4('0x34')]=_['map'](_0x5b633a,'name');_0x2508be[_0x96b4('0x35')]=_[_0x96b4('0x36')](_0x52f5b5[_0x96b4('0x35')]);_0x2508be['filters']=_[_0x96b4('0x37')](_0x2508be[_0x96b4('0x34')],_0x2508be[_0x96b4('0x35')]);_0x21d510['attributes']=_['intersection'](_0x2508be[_0x96b4('0x34')],qs[_0x96b4('0x38')](_0x52f5b5[_0x96b4('0x35')]['fields']));_0x21d510[_0x96b4('0x39')]=_0x21d510[_0x96b4('0x39')]['length']?_0x21d510[_0x96b4('0x39')]:_0x2508be[_0x96b4('0x34')];if(!_0x52f5b5[_0x96b4('0x35')][_0x96b4('0x3a')](_0x96b4('0x3b'))){_0x21d510[_0x96b4('0x1f')]=qs[_0x96b4('0x1f')](_0x52f5b5[_0x96b4('0x35')][_0x96b4('0x1f')]);_0x21d510[_0x96b4('0x22')]=qs['offset'](_0x52f5b5[_0x96b4('0x35')][_0x96b4('0x22')]);}_0x21d510[_0x96b4('0x3c')]=qs[_0x96b4('0x3d')](_0x52f5b5['query'][_0x96b4('0x3d')]);_0x21d510[_0x96b4('0x3e')]=qs[_0x96b4('0x3f')](_[_0x96b4('0x40')](_0x52f5b5['query'],_0x2508be[_0x96b4('0x3f')]),_0x5b633a);if(_0x52f5b5[_0x96b4('0x35')][_0x96b4('0x41')]){_0x21d510[_0x96b4('0x3e')]=_[_0x96b4('0x42')](_0x21d510['where'],{'$or':_[_0x96b4('0x2f')](_0x5b633a,function(_0x37754f){if(_0x37754f[_0x96b4('0x32')]!==_0x96b4('0x43')){var _0x225774={};_0x225774[_0x37754f[_0x96b4('0x44')]]={'$like':'%'+_0x52f5b5[_0x96b4('0x35')][_0x96b4('0x41')]+'%'};return _0x225774;}})});}_0x21d510=_[_0x96b4('0x42')]({},_0x21d510,_0x52f5b5['options']);var _0x591b24={'where':_0x21d510[_0x96b4('0x3e')]};return db['CmContactHasItem'][_0x96b4('0x21')](_0x591b24)[_0x96b4('0x29')](function(_0x3593f0){_0x4f60e5['count']=_0x3593f0;if(_0x52f5b5['query'][_0x96b4('0x45')]){_0x21d510[_0x96b4('0x46')]=[{'all':!![]}];}return db[_0x96b4('0x47')][_0x96b4('0x48')](_0x21d510);})[_0x96b4('0x29')](function(_0x172018){_0x4f60e5[_0x96b4('0x49')]=_0x172018;return _0x4f60e5;})[_0x96b4('0x29')](respondWithFilteredResult(_0x20c30d,_0x21d510))[_0x96b4('0x4a')](handleError(_0x20c30d,null));};exports[_0x96b4('0x4b')]=function(_0x8c59af,_0x3f9dd6){var _0x10f392={'raw':!![],'where':{'id':_0x8c59af[_0x96b4('0x4c')]['id']}},_0x241071={};_0x241071[_0x96b4('0x34')]=_[_0x96b4('0x36')](db[_0x96b4('0x47')][_0x96b4('0x30')]);_0x241071[_0x96b4('0x35')]=_[_0x96b4('0x36')](_0x8c59af[_0x96b4('0x35')]);_0x241071['filters']=_['intersection'](_0x241071[_0x96b4('0x34')],_0x241071['query']);_0x10f392[_0x96b4('0x39')]=_[_0x96b4('0x37')](_0x241071[_0x96b4('0x34')],qs[_0x96b4('0x38')](_0x8c59af['query'][_0x96b4('0x38')]));_0x10f392[_0x96b4('0x39')]=_0x10f392[_0x96b4('0x39')][_0x96b4('0x4d')]?_0x10f392['attributes']:_0x241071['model'];if(_0x8c59af[_0x96b4('0x35')][_0x96b4('0x45')]){_0x10f392[_0x96b4('0x46')]=[{'all':!![]}];}_0x10f392=_[_0x96b4('0x42')]({},_0x10f392,_0x8c59af[_0x96b4('0x4e')]);return db['CmContactHasItem'][_0x96b4('0x4f')](_0x10f392)[_0x96b4('0x29')](handleEntityNotFound(_0x3f9dd6,null))['then'](respondWithResult(_0x3f9dd6,null))['catch'](handleError(_0x3f9dd6,null));};exports[_0x96b4('0x50')]=function(_0x1fe007,_0x4f4efa){return db[_0x96b4('0x47')][_0x96b4('0x50')](_0x1fe007[_0x96b4('0x51')],{})[_0x96b4('0x29')](function(_0x57ff93){var _0x328216=_0x1fe007[_0x96b4('0x52')][_0x96b4('0x53')]({'plain':!![]});if(!_0x328216)throw new Error(_0x96b4('0x54'));if(_0x328216['role']===_0x96b4('0x52')){var _0x281703=_0x57ff93[_0x96b4('0x53')]({'plain':!![]});var _0x193063=_0x96b4('0x2b');return db[_0x96b4('0x55')][_0x96b4('0x4f')]({'where':{'name':_0x193063,'userProfileId':_0x328216[_0x96b4('0x56')]},'raw':!![]})[_0x96b4('0x29')](function(_0x3c6172){if(_0x3c6172&&_0x3c6172[_0x96b4('0x57')]===0x0){return db[_0x96b4('0x58')][_0x96b4('0x50')]({'name':_0x281703[_0x96b4('0x44')],'resourceId':_0x281703['id'],'type':_0x3c6172[_0x96b4('0x44')],'sectionId':_0x3c6172['id']},{})[_0x96b4('0x29')](function(){return _0x57ff93;});}else{return _0x57ff93;}})[_0x96b4('0x4a')](function(_0x270d87){logger[_0x96b4('0x59')](_0x96b4('0x5a'),_0x270d87);throw _0x270d87;});}return _0x57ff93;})[_0x96b4('0x29')](respondWithResult(_0x4f4efa,0xc9))[_0x96b4('0x4a')](handleError(_0x4f4efa,null));};exports[_0x96b4('0x28')]=function(_0x9b969e,_0x3b45d1){if(_0x9b969e[_0x96b4('0x51')]['id']){delete _0x9b969e[_0x96b4('0x51')]['id'];}return db['CmContactHasItem'][_0x96b4('0x4f')]({'where':{'id':_0x9b969e[_0x96b4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b45d1,null))[_0x96b4('0x29')](saveUpdates(_0x9b969e[_0x96b4('0x51')],null))[_0x96b4('0x29')](respondWithResult(_0x3b45d1,null))['catch'](handleError(_0x3b45d1,null));};exports['destroy']=function(_0x5b59e3,_0x11cb29){return db[_0x96b4('0x47')][_0x96b4('0x4f')]({'where':{'id':_0x5b59e3[_0x96b4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x11cb29,null))[_0x96b4('0x29')](removeEntity(_0x11cb29,null))[_0x96b4('0x4a')](handleError(_0x11cb29,null));}; \ No newline at end of file +var _0x2b53=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','get','destroy','end','error','stack','name','send','CmContactHasItem','rawAttributes','fieldName','type','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','userProfileId'];(function(_0x4845bb,_0x37ca30){var _0x4fb138=function(_0x209061){while(--_0x209061){_0x4845bb['push'](_0x4845bb['shift']());}};_0x4fb138(++_0x37ca30);}(_0x2b53,0xaf));var _0x32b5=function(_0x35884c,_0x33c6ce){_0x35884c=_0x35884c-0x0;var _0x6deba6=_0x2b53[_0x35884c];return _0x6deba6;};'use strict';var emlformat=require(_0x32b5('0x0'));var rimraf=require(_0x32b5('0x1'));var zipdir=require(_0x32b5('0x2'));var jsonpatch=require(_0x32b5('0x3'));var rp=require(_0x32b5('0x4'));var moment=require(_0x32b5('0x5'));var BPromise=require(_0x32b5('0x6'));var Mustache=require(_0x32b5('0x7'));var util=require(_0x32b5('0x8'));var path=require(_0x32b5('0x9'));var sox=require(_0x32b5('0xa'));var csv=require(_0x32b5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32b5('0xc'));var _=require(_0x32b5('0xd'));var squel=require(_0x32b5('0xe'));var crypto=require(_0x32b5('0xf'));var jsforce=require(_0x32b5('0x10'));var deskjs=require(_0x32b5('0x11'));var toCsv=require(_0x32b5('0xb'));var querystring=require(_0x32b5('0x12'));var Papa=require(_0x32b5('0x13'));var Redis=require(_0x32b5('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x32b5('0x15'));var hardwareService=require(_0x32b5('0x16'));var logger=require('../../config/logger')(_0x32b5('0x17'));var utils=require('../../config/utils');var config=require(_0x32b5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x32b5('0x19'))['db'];function respondWithStatusCode(_0x226656,_0x28c3a6){_0x28c3a6=_0x28c3a6||0xcc;return function(_0x43e3ce){if(_0x43e3ce){return _0x226656[_0x32b5('0x1a')](_0x28c3a6);}return _0x226656[_0x32b5('0x1b')](_0x28c3a6)['end']();};}function respondWithResult(_0x5f0bc3,_0x4504b7){_0x4504b7=_0x4504b7||0xc8;return function(_0x42e1da){if(_0x42e1da){return _0x5f0bc3[_0x32b5('0x1b')](_0x4504b7)[_0x32b5('0x1c')](_0x42e1da);}};}function respondWithFilteredResult(_0x3342fb,_0x21b166){return function(_0x1d9aea){if(_0x1d9aea){var _0x241676=typeof _0x21b166[_0x32b5('0x1d')]==='undefined'&&typeof _0x21b166['limit']===_0x32b5('0x1e');var _0x127775=_0x1d9aea[_0x32b5('0x1f')];var _0x1ad942=_0x241676?0x0:_0x21b166[_0x32b5('0x1d')];var _0x441c0a=_0x241676?_0x1d9aea['count']:_0x21b166[_0x32b5('0x1d')]+_0x21b166[_0x32b5('0x20')];var _0x1d57cf;if(_0x441c0a>=_0x127775){_0x441c0a=_0x127775;_0x1d57cf=0xc8;}else{_0x1d57cf=0xce;}_0x3342fb[_0x32b5('0x1b')](_0x1d57cf);return _0x3342fb[_0x32b5('0x21')](_0x32b5('0x22'),_0x1ad942+'-'+_0x441c0a+'/'+_0x127775)['json'](_0x1d9aea);}return null;};}function patchUpdates(_0x373591){return function(_0xd52f3c){try{jsonpatch[_0x32b5('0x23')](_0xd52f3c,_0x373591,!![]);}catch(_0x52ae33){return BPromise['reject'](_0x52ae33);}return _0xd52f3c['save']();};}function saveUpdates(_0x2d8660,_0x2721ab){return function(_0x9addbc){if(_0x9addbc){return _0x9addbc[_0x32b5('0x24')](_0x2d8660)[_0x32b5('0x25')](function(_0xe34d33){return _0xe34d33;});}return null;};}function removeEntity(_0x54a90d,_0x2ba973){return function(_0x4e5ad2){if(_0x4e5ad2){return _0x4e5ad2['destroy']()[_0x32b5('0x25')](function(){var _0x2eb1df=_0x4e5ad2[_0x32b5('0x26')]({'plain':!![]});var _0xc44668='CmContactHasItems';return db['UserProfileResource'][_0x32b5('0x27')]({'where':{'type':_0xc44668,'resourceId':_0x2eb1df['id']}})[_0x32b5('0x25')](function(){return _0x4e5ad2;});})['then'](function(){_0x54a90d[_0x32b5('0x1b')](0xcc)[_0x32b5('0x28')]();});}};}function handleEntityNotFound(_0x1e0d1b,_0x173d78){return function(_0x126038){if(!_0x126038){_0x1e0d1b[_0x32b5('0x1a')](0x194);}return _0x126038;};}function handleError(_0x1eaf1a,_0x42f4c2){_0x42f4c2=_0x42f4c2||0x1f4;return function(_0x1da24c){logger[_0x32b5('0x29')](_0x1da24c[_0x32b5('0x2a')]);if(_0x1da24c['name']){delete _0x1da24c[_0x32b5('0x2b')];}_0x1eaf1a['status'](_0x42f4c2)[_0x32b5('0x2c')](_0x1da24c);};}exports['index']=function(_0x2dbd73,_0x106a26){var _0x260d41={},_0x1b0fd8={},_0x334c5d={'count':0x0,'rows':[]};var _0xfee05a=_['map'](db[_0x32b5('0x2d')][_0x32b5('0x2e')],function(_0x47c038){return{'name':_0x47c038[_0x32b5('0x2f')],'type':_0x47c038[_0x32b5('0x30')]['key']};});_0x1b0fd8[_0x32b5('0x31')]=_['map'](_0xfee05a,_0x32b5('0x2b'));_0x1b0fd8['query']=_['keys'](_0x2dbd73[_0x32b5('0x32')]);_0x1b0fd8['filters']=_[_0x32b5('0x33')](_0x1b0fd8[_0x32b5('0x31')],_0x1b0fd8[_0x32b5('0x32')]);_0x260d41['attributes']=_[_0x32b5('0x33')](_0x1b0fd8[_0x32b5('0x31')],qs[_0x32b5('0x34')](_0x2dbd73['query'][_0x32b5('0x34')]));_0x260d41['attributes']=_0x260d41['attributes'][_0x32b5('0x35')]?_0x260d41[_0x32b5('0x36')]:_0x1b0fd8[_0x32b5('0x31')];if(!_0x2dbd73[_0x32b5('0x32')][_0x32b5('0x37')](_0x32b5('0x38'))){_0x260d41[_0x32b5('0x20')]=qs['limit'](_0x2dbd73[_0x32b5('0x32')]['limit']);_0x260d41['offset']=qs[_0x32b5('0x1d')](_0x2dbd73['query'][_0x32b5('0x1d')]);}_0x260d41[_0x32b5('0x39')]=qs[_0x32b5('0x3a')](_0x2dbd73[_0x32b5('0x32')][_0x32b5('0x3a')]);_0x260d41[_0x32b5('0x3b')]=qs['filters'](_[_0x32b5('0x3c')](_0x2dbd73[_0x32b5('0x32')],_0x1b0fd8[_0x32b5('0x3d')]),_0xfee05a);if(_0x2dbd73[_0x32b5('0x32')]['filter']){_0x260d41[_0x32b5('0x3b')]=_[_0x32b5('0x3e')](_0x260d41[_0x32b5('0x3b')],{'$or':_[_0x32b5('0x3f')](_0xfee05a,function(_0x179354){if(_0x179354['type']!==_0x32b5('0x40')){var _0x319b2c={};_0x319b2c[_0x179354[_0x32b5('0x2b')]]={'$like':'%'+_0x2dbd73[_0x32b5('0x32')][_0x32b5('0x41')]+'%'};return _0x319b2c;}})});}_0x260d41=_[_0x32b5('0x3e')]({},_0x260d41,_0x2dbd73[_0x32b5('0x42')]);var _0x4d7379={'where':_0x260d41[_0x32b5('0x3b')]};return db['CmContactHasItem']['count'](_0x4d7379)['then'](function(_0x1f8d53){_0x334c5d[_0x32b5('0x1f')]=_0x1f8d53;if(_0x2dbd73[_0x32b5('0x32')][_0x32b5('0x43')]){_0x260d41['include']=[{'all':!![]}];}return db[_0x32b5('0x2d')][_0x32b5('0x44')](_0x260d41);})['then'](function(_0x1d036e){_0x334c5d[_0x32b5('0x45')]=_0x1d036e;return _0x334c5d;})[_0x32b5('0x25')](respondWithFilteredResult(_0x106a26,_0x260d41))[_0x32b5('0x46')](handleError(_0x106a26,null));};exports[_0x32b5('0x47')]=function(_0x183081,_0x1dd7dc){var _0x43c191={'raw':!![],'where':{'id':_0x183081[_0x32b5('0x48')]['id']}},_0x503544={};_0x503544[_0x32b5('0x31')]=_[_0x32b5('0x49')](db[_0x32b5('0x2d')][_0x32b5('0x2e')]);_0x503544[_0x32b5('0x32')]=_['keys'](_0x183081['query']);_0x503544['filters']=_[_0x32b5('0x33')](_0x503544[_0x32b5('0x31')],_0x503544[_0x32b5('0x32')]);_0x43c191[_0x32b5('0x36')]=_[_0x32b5('0x33')](_0x503544[_0x32b5('0x31')],qs[_0x32b5('0x34')](_0x183081[_0x32b5('0x32')][_0x32b5('0x34')]));_0x43c191[_0x32b5('0x36')]=_0x43c191['attributes'][_0x32b5('0x35')]?_0x43c191[_0x32b5('0x36')]:_0x503544[_0x32b5('0x31')];if(_0x183081['query'][_0x32b5('0x43')]){_0x43c191['include']=[{'all':!![]}];}_0x43c191=_['merge']({},_0x43c191,_0x183081[_0x32b5('0x42')]);return db[_0x32b5('0x2d')][_0x32b5('0x4a')](_0x43c191)[_0x32b5('0x25')](handleEntityNotFound(_0x1dd7dc,null))['then'](respondWithResult(_0x1dd7dc,null))[_0x32b5('0x46')](handleError(_0x1dd7dc,null));};exports['create']=function(_0x106c41,_0x4c5066){return db['CmContactHasItem'][_0x32b5('0x4b')](_0x106c41[_0x32b5('0x4c')],{})[_0x32b5('0x25')](function(_0xb3ffea){var _0x2d6584=_0x106c41[_0x32b5('0x4d')]['get']({'plain':!![]});if(!_0x2d6584)throw new Error(_0x32b5('0x4e'));if(_0x2d6584[_0x32b5('0x4f')]===_0x32b5('0x4d')){var _0xca6039=_0xb3ffea[_0x32b5('0x26')]({'plain':!![]});var _0x186aa7=_0x32b5('0x50');return db[_0x32b5('0x51')][_0x32b5('0x4a')]({'where':{'name':_0x186aa7,'userProfileId':_0x2d6584[_0x32b5('0x52')]},'raw':!![]})[_0x32b5('0x25')](function(_0x215734){if(_0x215734&&_0x215734[_0x32b5('0x53')]===0x0){return db[_0x32b5('0x54')][_0x32b5('0x4b')]({'name':_0xca6039[_0x32b5('0x2b')],'resourceId':_0xca6039['id'],'type':_0x215734['name'],'sectionId':_0x215734['id']},{})['then'](function(){return _0xb3ffea;});}else{return _0xb3ffea;}})[_0x32b5('0x46')](function(_0x327a52){logger[_0x32b5('0x29')](_0x32b5('0x55'),_0x327a52);throw _0x327a52;});}return _0xb3ffea;})['then'](respondWithResult(_0x4c5066,0xc9))[_0x32b5('0x46')](handleError(_0x4c5066,null));};exports[_0x32b5('0x24')]=function(_0x399589,_0x47757e){if(_0x399589[_0x32b5('0x4c')]['id']){delete _0x399589[_0x32b5('0x4c')]['id'];}return db[_0x32b5('0x2d')][_0x32b5('0x4a')]({'where':{'id':_0x399589[_0x32b5('0x48')]['id']}})[_0x32b5('0x25')](handleEntityNotFound(_0x47757e,null))['then'](saveUpdates(_0x399589['body'],null))[_0x32b5('0x25')](respondWithResult(_0x47757e,null))[_0x32b5('0x46')](handleError(_0x47757e,null));};exports[_0x32b5('0x27')]=function(_0x2cfbe6,_0x13fddb){return db[_0x32b5('0x2d')][_0x32b5('0x4a')]({'where':{'id':_0x2cfbe6[_0x32b5('0x48')]['id']}})[_0x32b5('0x25')](handleEntityNotFound(_0x13fddb,null))[_0x32b5('0x25')](removeEntity(_0x13fddb,null))['catch'](handleError(_0x13fddb,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index f36c663..ba95095 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 _0xfa65=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','util'];(function(_0x5481d1,_0xfe8c2f){var _0x32a3b4=function(_0x4f63a0){while(--_0x4f63a0){_0x5481d1['push'](_0x5481d1['shift']());}};_0x32a3b4(++_0xfe8c2f);}(_0xfa65,0x197));var _0x5fa6=function(_0x56cd04,_0x2152b8){_0x56cd04=_0x56cd04-0x0;var _0x24e0d1=_0xfa65[_0x56cd04];return _0x24e0d1;};'use strict';var _=require('lodash');var util=require(_0x5fa6('0x0'));var logger=require(_0x5fa6('0x1'))(_0x5fa6('0x2'));var moment=require('moment');var BPromise=require(_0x5fa6('0x3'));var rp=require(_0x5fa6('0x4'));var fs=require('fs');var path=require(_0x5fa6('0x5'));var rimraf=require(_0x5fa6('0x6'));var config=require(_0x5fa6('0x7'));var attributes=require(_0x5fa6('0x8'));module[_0x5fa6('0x9')]=function(_0x4c0f44,_0x13a66e){return _0x4c0f44['define'](_0x5fa6('0xa'),attributes,{'tableName':_0x5fa6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27ce=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CmContactHasItem','lodash'];(function(_0x2d5633,_0x29232d){var _0x5b6b0c=function(_0x35ddbe){while(--_0x35ddbe){_0x2d5633['push'](_0x2d5633['shift']());}};_0x5b6b0c(++_0x29232d);}(_0x27ce,0x1d8));var _0xe27c=function(_0x4e7992,_0x2e07cf){_0x4e7992=_0x4e7992-0x0;var _0x5a276d=_0x27ce[_0x4e7992];return _0x5a276d;};'use strict';var _=require(_0xe27c('0x0'));var util=require(_0xe27c('0x1'));var logger=require(_0xe27c('0x2'))(_0xe27c('0x3'));var moment=require(_0xe27c('0x4'));var BPromise=require('bluebird');var rp=require(_0xe27c('0x5'));var fs=require('fs');var path=require(_0xe27c('0x6'));var rimraf=require(_0xe27c('0x7'));var config=require(_0xe27c('0x8'));var attributes=require('./cmContactHasItem.attributes');module[_0xe27c('0x9')]=function(_0x64ed91,_0x1a13da){return _0x64ed91['define'](_0xe27c('0xa'),attributes,{'tableName':'cm_contact_has_items','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 6f20a01..3fd935c 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 _0x7478=['message','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5a1454,_0x1126ad){var _0x3406e6=function(_0x16525d){while(--_0x16525d){_0x5a1454['push'](_0x5a1454['shift']());}};_0x3406e6(++_0x1126ad);}(_0x7478,0xde));var _0x8747=function(_0x2e5ef1,_0x251ede){_0x2e5ef1=_0x2e5ef1-0x0;var _0x1b5fe0=_0x7478[_0x2e5ef1];return _0x1b5fe0;};'use strict';var _=require(_0x8747('0x0'));var util=require(_0x8747('0x1'));var moment=require(_0x8747('0x2'));var BPromise=require('bluebird');var rs=require(_0x8747('0x3'));var fs=require('fs');var Redis=require(_0x8747('0x4'));var db=require(_0x8747('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8747('0x6'));var config=require(_0x8747('0x7'));var jayson=require(_0x8747('0x8'));var client=jayson[_0x8747('0x9')][_0x8747('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53fa73,_0x52f141,_0x25d5a8){return new BPromise(function(_0x5143ca,_0x58c59){return client[_0x8747('0xb')](_0x53fa73,_0x25d5a8)[_0x8747('0xc')](function(_0x1ac47b){logger['info'](_0x8747('0xd'),_0x52f141,'request\x20sent');logger[_0x8747('0xe')](_0x8747('0xf'),_0x52f141,_0x8747('0x10'),JSON[_0x8747('0x11')](_0x1ac47b));if(_0x1ac47b[_0x8747('0x12')]){if(_0x1ac47b[_0x8747('0x12')][_0x8747('0x13')]===0x1f4){logger['error'](_0x8747('0xd'),_0x52f141,_0x1ac47b[_0x8747('0x12')][_0x8747('0x14')]);return _0x58c59(_0x1ac47b[_0x8747('0x12')][_0x8747('0x14')]);}logger[_0x8747('0x12')](_0x8747('0xd'),_0x52f141,_0x1ac47b[_0x8747('0x12')]['message']);return _0x5143ca(_0x1ac47b[_0x8747('0x12')][_0x8747('0x14')]);}else{logger[_0x8747('0x15')]('CmContactHasItem,\x20%s,\x20%s',_0x52f141,_0x8747('0x10'));_0x5143ca(_0x1ac47b['result'][_0x8747('0x14')]);}})['catch'](function(_0x3c925f){logger['error'](_0x8747('0xd'),_0x52f141,_0x3c925f);_0x58c59(_0x3c925f);});});} \ No newline at end of file +var _0xd97e=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0xd97e,0x120));var _0xed97=function(_0xb3f604,_0x43c410){_0xb3f604=_0xb3f604-0x0;var _0x584768=_0xd97e[_0xb3f604];return _0x584768;};'use strict';var _=require(_0xed97('0x0'));var util=require(_0xed97('0x1'));var moment=require(_0xed97('0x2'));var BPromise=require(_0xed97('0x3'));var rs=require(_0xed97('0x4'));var fs=require('fs');var Redis=require(_0xed97('0x5'));var db=require(_0xed97('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xed97('0x7'))('rpc');var config=require(_0xed97('0x8'));var jayson=require(_0xed97('0x9'));var client=jayson[_0xed97('0xa')][_0xed97('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45d1bd,_0x3c9c98,_0x4a208f){return new BPromise(function(_0x238ac7,_0x2953bb){return client['request'](_0x45d1bd,_0x4a208f)['then'](function(_0x305976){logger[_0xed97('0xc')](_0xed97('0xd'),_0x3c9c98,'request\x20sent');logger[_0xed97('0xe')](_0xed97('0xf'),_0x3c9c98,_0xed97('0x10'),JSON[_0xed97('0x11')](_0x305976));if(_0x305976['error']){if(_0x305976['error'][_0xed97('0x12')]===0x1f4){logger[_0xed97('0x13')](_0xed97('0xd'),_0x3c9c98,_0x305976[_0xed97('0x13')][_0xed97('0x14')]);return _0x2953bb(_0x305976[_0xed97('0x13')][_0xed97('0x14')]);}logger[_0xed97('0x13')](_0xed97('0xd'),_0x3c9c98,_0x305976['error']['message']);return _0x238ac7(_0x305976[_0xed97('0x13')][_0xed97('0x14')]);}else{logger['info'](_0xed97('0xd'),_0x3c9c98,_0xed97('0x10'));_0x238ac7(_0x305976[_0xed97('0x15')][_0xed97('0x14')]);}})['catch'](function(_0x1ab39e){logger['error'](_0xed97('0xd'),_0x3c9c98,_0x1ab39e);_0x2953bb(_0x1ab39e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 04f0f49..abaf092 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 _0xdb71=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0xdb71,0x1e0));var _0x1db7=function(_0x38aaf2,_0x5a9c6d){_0x38aaf2=_0x38aaf2-0x0;var _0x236fc0=_0xdb71[_0x38aaf2];return _0x236fc0;};'use strict';var multer=require(_0x1db7('0x0'));var util=require(_0x1db7('0x1'));var path=require(_0x1db7('0x2'));var timeout=require(_0x1db7('0x3'));var express=require(_0x1db7('0x4'));var router=express[_0x1db7('0x5')]();var fs_extra=require(_0x1db7('0x6'));var auth=require(_0x1db7('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0x1db7('0x8')]('/',auth[_0x1db7('0x9')](),controller[_0x1db7('0xa')]);router[_0x1db7('0x8')](_0x1db7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1db7('0xc')]('/',auth[_0x1db7('0x9')](),controller[_0x1db7('0xd')]);router[_0x1db7('0xe')](_0x1db7('0xb'),auth['isAuthenticated'](),controller[_0x1db7('0xf')]);router[_0x1db7('0x10')](_0x1db7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1db7('0x11')]=router; \ No newline at end of file +var _0x9d46=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x406c42,_0x3127ce){var _0x44443d=function(_0x559f23){while(--_0x559f23){_0x406c42['push'](_0x406c42['shift']());}};_0x44443d(++_0x3127ce);}(_0x9d46,0x1f4));var _0x69d4=function(_0xa77853,_0x14f61b){_0xa77853=_0xa77853-0x0;var _0x4b8f55=_0x9d46[_0xa77853];return _0x4b8f55;};'use strict';var multer=require(_0x69d4('0x0'));var util=require(_0x69d4('0x1'));var path=require(_0x69d4('0x2'));var timeout=require(_0x69d4('0x3'));var express=require(_0x69d4('0x4'));var router=express[_0x69d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x69d4('0x6'));var interaction=require(_0x69d4('0x7'));var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0x69d4('0x8')]('/',auth[_0x69d4('0x9')](),controller[_0x69d4('0xa')]);router[_0x69d4('0x8')]('/:id',auth[_0x69d4('0x9')](),controller[_0x69d4('0xb')]);router['post']('/',auth[_0x69d4('0x9')](),controller[_0x69d4('0xc')]);router[_0x69d4('0xd')](_0x69d4('0xe'),auth[_0x69d4('0x9')](),controller['update']);router[_0x69d4('0xf')](_0x69d4('0xe'),auth[_0x69d4('0x9')](),controller[_0x69d4('0x10')]);module[_0x69d4('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 98f5af9..217a086 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 _0x7592=['name','TEXT','type','values','isArray','stringify','BOOLEAN','ENUM','sequelize','VIRTUAL','getDataValue','alias','STRING','setDataValue'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7592,0x104));var _0x2759=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0x7592[_0x301dab];return _0x2500a2;};'use strict';var Sequelize=require(_0x2759('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x2759('0x1')],'get':function(_0x2dc8ff){return this[_0x2759('0x2')](_0x2759('0x3'));}},'alias':{'type':Sequelize[_0x2759('0x4')],'allowNull':![],'set':function(_0x2d5f80){this[_0x2759('0x5')](_0x2759('0x3'),_0x2d5f80?_0x2d5f80:this[_0x2759('0x2')](_0x2759('0x6')));}},'type':{'type':Sequelize[_0x2759('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x2759('0x7')]('long'),'get':function(){if(this[_0x2759('0x2')](_0x2759('0x8'))==='select'){return JSON['parse'](this['getDataValue'](_0x2759('0x9')));}else{return this['getDataValue'](_0x2759('0x9'));}},'set':function(_0x132f14){if(Array[_0x2759('0xa')](_0x132f14)){this[_0x2759('0x5')]('values',JSON[_0x2759('0xb')](_0x132f14));}else{this[_0x2759('0x5')](_0x2759('0x9'),_0x132f14);}}},'required':{'type':Sequelize[_0x2759('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x2759('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2759('0xd')]('voice')}}; \ No newline at end of file +var _0xd8bc=['TEXT','long','type','select','values','isArray','setDataValue','stringify','ENUM','sequelize','VIRTUAL','STRING','getDataValue'];(function(_0x3e781b,_0x488bce){var _0x479a29=function(_0x1c1eca){while(--_0x1c1eca){_0x3e781b['push'](_0x3e781b['shift']());}};_0x479a29(++_0x488bce);}(_0xd8bc,0x168));var _0xcd8b=function(_0x4d055d,_0x1c307e){_0x4d055d=_0x4d055d-0x0;var _0x2fdbec=_0xd8bc[_0x4d055d];return _0x2fdbec;};'use strict';var Sequelize=require(_0xcd8b('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xcd8b('0x1')],'get':function(_0xfad4ad){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xcd8b('0x2')],'allowNull':![],'set':function(_0x4adb98){this['setDataValue']('alias',_0x4adb98?_0x4adb98:this[_0xcd8b('0x3')]('name'));}},'type':{'type':Sequelize[_0xcd8b('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0xcd8b('0x4')](_0xcd8b('0x5')),'get':function(){if(this[_0xcd8b('0x3')](_0xcd8b('0x6'))===_0xcd8b('0x7')){return JSON['parse'](this['getDataValue'](_0xcd8b('0x8')));}else{return this[_0xcd8b('0x3')]('values');}},'set':function(_0x10ba2d){if(Array[_0xcd8b('0x9')](_0x10ba2d)){this[_0xcd8b('0xa')](_0xcd8b('0x8'),JSON[_0xcd8b('0xb')](_0x10ba2d));}else{this[_0xcd8b('0xa')](_0xcd8b('0x8'),_0x10ba2d);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xcd8b('0xc')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 8236cd9..b1da24e 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 _0x10c7=['then','destroy','name','send','index','map','CmCustomField','fieldName','type','model','differenceBy','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','show','params','rawAttributes','length','find','catch','update','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','format','cf_%d','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','reject','save'];(function(_0x27638d,_0x4094db){var _0x35da35=function(_0x538095){while(--_0x538095){_0x27638d['push'](_0x27638d['shift']());}};_0x35da35(++_0x4094db);}(_0x10c7,0xd8));var _0x710c=function(_0x381b03,_0x3604d3){_0x381b03=_0x381b03-0x0;var _0x19d10d=_0x10c7[_0x381b03];return _0x19d10d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x710c('0x0'));var zipdir=require(_0x710c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x710c('0x2'));var moment=require(_0x710c('0x3'));var BPromise=require(_0x710c('0x4'));var Mustache=require(_0x710c('0x5'));var util=require(_0x710c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x710c('0x7'));var ejs=require(_0x710c('0x8'));var fs=require('fs');var fs_extra=require(_0x710c('0x9'));var _=require(_0x710c('0xa'));var squel=require(_0x710c('0xb'));var crypto=require('crypto');var jsforce=require(_0x710c('0xc'));var deskjs=require(_0x710c('0xd'));var toCsv=require(_0x710c('0x7'));var querystring=require('querystring');var Papa=require(_0x710c('0xe'));var Redis=require(_0x710c('0xf'));var authService=require(_0x710c('0x10'));var qs=require(_0x710c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x710c('0x12'));var logger=require('../../config/logger')(_0x710c('0x13'));var utils=require(_0x710c('0x14'));var config=require(_0x710c('0x15'));var licenseUtil=require(_0x710c('0x16'));var db=require(_0x710c('0x17'))['db'];function respondWithStatusCode(_0x2fb1ce,_0x530202){_0x530202=_0x530202||0xcc;return function(_0x356b79){if(_0x356b79){return _0x2fb1ce[_0x710c('0x18')](_0x530202);}return _0x2fb1ce['status'](_0x530202)[_0x710c('0x19')]();};}function respondWithResult(_0x308a5c,_0x338830){_0x338830=_0x338830||0xc8;return function(_0x15a84b){if(_0x15a84b){return _0x308a5c['status'](_0x338830)[_0x710c('0x1a')](_0x15a84b);}};}function respondWithFilteredResult(_0x4ff3da,_0x5d4824){return function(_0x36b78d){if(_0x36b78d){var _0x3424d9=typeof _0x5d4824['offset']==='undefined'&&typeof _0x5d4824[_0x710c('0x1b')]===_0x710c('0x1c');var _0x2766f7=_0x36b78d[_0x710c('0x1d')];var _0x3fbdb3=_0x3424d9?0x0:_0x5d4824[_0x710c('0x1e')];var _0x3d0bc5=_0x3424d9?_0x36b78d[_0x710c('0x1d')]:_0x5d4824[_0x710c('0x1e')]+_0x5d4824[_0x710c('0x1b')];var _0x2b3aa9;if(_0x3d0bc5>=_0x2766f7){_0x3d0bc5=_0x2766f7;_0x2b3aa9=0xc8;}else{_0x2b3aa9=0xce;}_0x4ff3da[_0x710c('0x1f')](_0x2b3aa9);return _0x4ff3da['set'](_0x710c('0x20'),_0x3fbdb3+'-'+_0x3d0bc5+'/'+_0x2766f7)[_0x710c('0x1a')](_0x36b78d);}return null;};}function patchUpdates(_0x21d633){return function(_0x6380c5){try{jsonpatch[_0x710c('0x21')](_0x6380c5,_0x21d633,!![]);}catch(_0x4260f8){return BPromise[_0x710c('0x22')](_0x4260f8);}return _0x6380c5[_0x710c('0x23')]();};}function saveUpdates(_0x3ebb49,_0x442f50){return function(_0x20744d){if(_0x20744d){return _0x20744d['update'](_0x3ebb49)[_0x710c('0x24')](function(_0xfb006e){return _0xfb006e;});}return null;};}function removeEntity(_0x58272a,_0x5cc024){return function(_0x4e2ec6){if(_0x4e2ec6){return _0x4e2ec6[_0x710c('0x25')]()[_0x710c('0x24')](function(){_0x58272a[_0x710c('0x1f')](0xcc)[_0x710c('0x19')]();});}};}function handleEntityNotFound(_0x943d8b,_0x37ab36){return function(_0x2609b6){if(!_0x2609b6){_0x943d8b[_0x710c('0x18')](0x194);}return _0x2609b6;};}function handleError(_0x4313d2,_0x52418d){_0x52418d=_0x52418d||0x1f4;return function(_0x577fed){logger['error'](_0x577fed['stack']);if(_0x577fed[_0x710c('0x26')]){delete _0x577fed[_0x710c('0x26')];}_0x4313d2[_0x710c('0x1f')](_0x52418d)[_0x710c('0x27')](_0x577fed);};}exports[_0x710c('0x28')]=function(_0x27ee96,_0x54f588){var _0x298647={},_0x439070={},_0x158c29={'count':0x0,'rows':[]};var _0x41cd9a=_[_0x710c('0x29')](db[_0x710c('0x2a')]['rawAttributes'],function(_0x4cd02a){return{'name':_0x4cd02a[_0x710c('0x2b')],'type':_0x4cd02a[_0x710c('0x2c')]['key']};});_0x439070[_0x710c('0x2d')]=_[_0x710c('0x2e')](_[_0x710c('0x29')](_0x41cd9a,_0x710c('0x26')),['name']);_0x439070[_0x710c('0x2f')]=_[_0x710c('0x30')](_0x27ee96[_0x710c('0x2f')]);_0x439070[_0x710c('0x31')]=_['intersection'](_0x439070[_0x710c('0x2d')],_0x439070['query']);_0x298647[_0x710c('0x32')]=_[_0x710c('0x33')](_0x439070[_0x710c('0x2d')],qs[_0x710c('0x34')](_0x27ee96[_0x710c('0x2f')][_0x710c('0x34')]));_0x298647['attributes']=_0x298647[_0x710c('0x32')]['length']?_0x298647[_0x710c('0x32')]:_0x439070[_0x710c('0x2d')];if(!_0x27ee96[_0x710c('0x2f')][_0x710c('0x35')](_0x710c('0x36'))){_0x298647['limit']=qs[_0x710c('0x1b')](_0x27ee96[_0x710c('0x2f')]['limit']);_0x298647[_0x710c('0x1e')]=qs[_0x710c('0x1e')](_0x27ee96[_0x710c('0x2f')][_0x710c('0x1e')]);}_0x298647[_0x710c('0x37')]=qs[_0x710c('0x38')](_0x27ee96[_0x710c('0x2f')][_0x710c('0x38')]);_0x298647[_0x710c('0x39')]=qs[_0x710c('0x31')](_['pick'](_0x27ee96['query'],_0x439070[_0x710c('0x31')]),_0x41cd9a);if(_0x27ee96[_0x710c('0x2f')]['filter']){_0x298647['where']=_[_0x710c('0x3a')](_0x298647[_0x710c('0x39')],{'$or':_[_0x710c('0x29')](_0x41cd9a,function(_0x34af94){if(_0x34af94[_0x710c('0x2c')]!==_0x710c('0x3b')){var _0x33befc={};_0x33befc[_0x34af94[_0x710c('0x26')]]={'$like':'%'+_0x27ee96[_0x710c('0x2f')]['filter']+'%'};return _0x33befc;}})});}_0x298647=_[_0x710c('0x3a')]({},_0x298647,_0x27ee96[_0x710c('0x3c')]);var _0x4cac93={'where':_0x298647[_0x710c('0x39')]};return db[_0x710c('0x2a')][_0x710c('0x1d')](_0x4cac93)[_0x710c('0x24')](function(_0x9c2943){_0x158c29[_0x710c('0x1d')]=_0x9c2943;if(_0x27ee96[_0x710c('0x2f')]['includeAll']){_0x298647[_0x710c('0x3d')]=[{'all':!![]}];}return db[_0x710c('0x2a')]['findAll'](_0x298647);})[_0x710c('0x24')](function(_0x1bc850){_0x158c29['rows']=_0x1bc850;return _0x158c29;})[_0x710c('0x24')](respondWithFilteredResult(_0x54f588,_0x298647))['catch'](handleError(_0x54f588,null));};exports[_0x710c('0x3e')]=function(_0x4d2226,_0x3d71f9){var _0x2444d3={'raw':!![],'where':{'id':_0x4d2226[_0x710c('0x3f')]['id']}},_0x3f1225={};_0x3f1225['model']=_[_0x710c('0x30')](db['CmCustomField'][_0x710c('0x40')]);_0x3f1225[_0x710c('0x2f')]=_[_0x710c('0x30')](_0x4d2226[_0x710c('0x2f')]);_0x3f1225[_0x710c('0x31')]=_[_0x710c('0x33')](_0x3f1225[_0x710c('0x2d')],_0x3f1225[_0x710c('0x2f')]);_0x2444d3['attributes']=_[_0x710c('0x33')](_0x3f1225[_0x710c('0x2d')],qs[_0x710c('0x34')](_0x4d2226['query']['fields']));_0x2444d3['attributes']=_0x2444d3[_0x710c('0x32')][_0x710c('0x41')]?_0x2444d3[_0x710c('0x32')]:_0x3f1225[_0x710c('0x2d')];if(_0x4d2226[_0x710c('0x2f')]['includeAll']){_0x2444d3[_0x710c('0x3d')]=[{'all':!![]}];}_0x2444d3=_[_0x710c('0x3a')]({},_0x2444d3,_0x4d2226[_0x710c('0x3c')]);return db[_0x710c('0x2a')][_0x710c('0x42')](_0x2444d3)['then'](handleEntityNotFound(_0x3d71f9,null))['then'](respondWithResult(_0x3d71f9,null))[_0x710c('0x43')](handleError(_0x3d71f9,null));};exports[_0x710c('0x44')]=function(_0x523e16,_0x370f1b){if(_0x523e16[_0x710c('0x45')]['id']){delete _0x523e16[_0x710c('0x45')]['id'];}return db[_0x710c('0x2a')][_0x710c('0x42')]({'where':{'id':_0x523e16[_0x710c('0x3f')]['id']}})[_0x710c('0x24')](handleEntityNotFound(_0x370f1b,null))[_0x710c('0x24')](saveUpdates(_0x523e16[_0x710c('0x45')],null))['then'](respondWithResult(_0x370f1b,null))[_0x710c('0x43')](handleError(_0x370f1b,null));};exports[_0x710c('0x25')]=function(_0x3472b0,_0x284c4b){return db['CmCustomField'][_0x710c('0x42')]({'where':{'id':_0x3472b0['params']['id']}})['then'](handleEntityNotFound(_0x284c4b,null))[_0x710c('0x24')](removeEntity(_0x284c4b,null))[_0x710c('0x43')](handleError(_0x284c4b,null));};exports[_0x710c('0x46')]=function(_0xc56441,_0x49b6d5){var _0x54666b;return db[_0x710c('0x47')][_0x710c('0x48')](function(_0x4941a7){return db['CmCustomField'][_0x710c('0x46')](_0xc56441[_0x710c('0x45')],{'transaction':_0x4941a7})[_0x710c('0x24')](function(_0x46fb55){_0x54666b=_0x46fb55;var _0x36e575={'type':db[_0x710c('0x49')][_0x710c('0x4a')],'transaction':_0x4941a7};switch(_0xc56441[_0x710c('0x45')][_0x710c('0x2c')]){case _0x710c('0x4b'):_0x36e575[_0x710c('0x2c')]=db[_0x710c('0x49')]['TEXT'];break;case _0x710c('0x4c'):_0x36e575[_0x710c('0x2c')]=db[_0x710c('0x49')][_0x710c('0x4d')];break;case _0x710c('0x4e'):_0x36e575['type']=db[_0x710c('0x49')][_0x710c('0x4f')];_0x36e575[_0x710c('0x50')]=![];break;default:}return db[_0x710c('0x47')][_0x710c('0x51')]['addColumn']('cm_contacts',util[_0x710c('0x52')](_0x710c('0x53'),_0x54666b['id']),_0x36e575);})[_0x710c('0x24')](function(){return _0x54666b;});})[_0x710c('0x24')](respondWithResult(_0x49b6d5,0xc9))[_0x710c('0x43')](handleError(_0x49b6d5,null));}; \ No newline at end of file +var _0x01ae=['INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','type','model','differenceBy','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','include','CmCustomField','findAll','rows','show','params','rawAttributes','find','catch','body','sequelize','create','Sequelize','TEXT','text'];(function(_0x5aad76,_0x3848af){var _0x259eb9=function(_0x3f742f){while(--_0x3f742f){_0x5aad76['push'](_0x5aad76['shift']());}};_0x259eb9(++_0x3848af);}(_0x01ae,0x1af));var _0xe01a=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0x01ae[_0x5093e9];return _0x4c9a22;};'use strict';var emlformat=require(_0xe01a('0x0'));var rimraf=require(_0xe01a('0x1'));var zipdir=require(_0xe01a('0x2'));var jsonpatch=require(_0xe01a('0x3'));var rp=require('request-promise');var moment=require(_0xe01a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe01a('0x5'));var util=require(_0xe01a('0x6'));var path=require(_0xe01a('0x7'));var sox=require(_0xe01a('0x8'));var csv=require(_0xe01a('0x9'));var ejs=require(_0xe01a('0xa'));var fs=require('fs');var fs_extra=require(_0xe01a('0xb'));var _=require(_0xe01a('0xc'));var squel=require(_0xe01a('0xd'));var crypto=require(_0xe01a('0xe'));var jsforce=require(_0xe01a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe01a('0x10'));var Papa=require(_0xe01a('0x11'));var Redis=require('ioredis');var authService=require(_0xe01a('0x12'));var qs=require(_0xe01a('0x13'));var as=require(_0xe01a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe01a('0x15'))(_0xe01a('0x16'));var utils=require(_0xe01a('0x17'));var config=require(_0xe01a('0x18'));var licenseUtil=require(_0xe01a('0x19'));var db=require(_0xe01a('0x1a'))['db'];function respondWithStatusCode(_0x517909,_0x155a57){_0x155a57=_0x155a57||0xcc;return function(_0x5747ad){if(_0x5747ad){return _0x517909[_0xe01a('0x1b')](_0x155a57);}return _0x517909[_0xe01a('0x1c')](_0x155a57)[_0xe01a('0x1d')]();};}function respondWithResult(_0x3784a7,_0x3c7551){_0x3c7551=_0x3c7551||0xc8;return function(_0x1a3c7c){if(_0x1a3c7c){return _0x3784a7[_0xe01a('0x1c')](_0x3c7551)[_0xe01a('0x1e')](_0x1a3c7c);}};}function respondWithFilteredResult(_0x581c32,_0x2b2d5a){return function(_0x507728){if(_0x507728){var _0x4a083a=typeof _0x2b2d5a[_0xe01a('0x1f')]===_0xe01a('0x20')&&typeof _0x2b2d5a[_0xe01a('0x21')]===_0xe01a('0x20');var _0x37a3a5=_0x507728[_0xe01a('0x22')];var _0x20e505=_0x4a083a?0x0:_0x2b2d5a[_0xe01a('0x1f')];var _0x843ae0=_0x4a083a?_0x507728[_0xe01a('0x22')]:_0x2b2d5a[_0xe01a('0x1f')]+_0x2b2d5a[_0xe01a('0x21')];var _0x3e5b05;if(_0x843ae0>=_0x37a3a5){_0x843ae0=_0x37a3a5;_0x3e5b05=0xc8;}else{_0x3e5b05=0xce;}_0x581c32[_0xe01a('0x1c')](_0x3e5b05);return _0x581c32[_0xe01a('0x23')](_0xe01a('0x24'),_0x20e505+'-'+_0x843ae0+'/'+_0x37a3a5)['json'](_0x507728);}return null;};}function patchUpdates(_0x2c3cbe){return function(_0x543f4f){try{jsonpatch[_0xe01a('0x25')](_0x543f4f,_0x2c3cbe,!![]);}catch(_0xf597e1){return BPromise[_0xe01a('0x26')](_0xf597e1);}return _0x543f4f[_0xe01a('0x27')]();};}function saveUpdates(_0xe5aa2d,_0x5010de){return function(_0x5d617f){if(_0x5d617f){return _0x5d617f[_0xe01a('0x28')](_0xe5aa2d)[_0xe01a('0x29')](function(_0x5dbb58){return _0x5dbb58;});}return null;};}function removeEntity(_0xcfda10,_0xfbee8){return function(_0x5a398c){if(_0x5a398c){return _0x5a398c[_0xe01a('0x2a')]()['then'](function(){_0xcfda10[_0xe01a('0x1c')](0xcc)[_0xe01a('0x1d')]();});}};}function handleEntityNotFound(_0x58b602,_0xdf8556){return function(_0x284401){if(!_0x284401){_0x58b602[_0xe01a('0x1b')](0x194);}return _0x284401;};}function handleError(_0x1495f2,_0xa2a910){_0xa2a910=_0xa2a910||0x1f4;return function(_0x5e90c6){logger[_0xe01a('0x2b')](_0x5e90c6['stack']);if(_0x5e90c6[_0xe01a('0x2c')]){delete _0x5e90c6[_0xe01a('0x2c')];}_0x1495f2[_0xe01a('0x1c')](_0xa2a910)[_0xe01a('0x2d')](_0x5e90c6);};}exports['index']=function(_0x556f1b,_0x1fad14){var _0x55c276={},_0x5724f7={},_0x12037d={'count':0x0,'rows':[]};var _0x279098=_[_0xe01a('0x2e')](db['CmCustomField']['rawAttributes'],function(_0x5cabd3){return{'name':_0x5cabd3['fieldName'],'type':_0x5cabd3[_0xe01a('0x2f')]['key']};});_0x5724f7[_0xe01a('0x30')]=_[_0xe01a('0x31')](_['map'](_0x279098,'name'),[_0xe01a('0x2c')]);_0x5724f7['query']=_[_0xe01a('0x32')](_0x556f1b[_0xe01a('0x33')]);_0x5724f7['filters']=_[_0xe01a('0x34')](_0x5724f7[_0xe01a('0x30')],_0x5724f7[_0xe01a('0x33')]);_0x55c276[_0xe01a('0x35')]=_[_0xe01a('0x34')](_0x5724f7[_0xe01a('0x30')],qs['fields'](_0x556f1b[_0xe01a('0x33')][_0xe01a('0x36')]));_0x55c276[_0xe01a('0x35')]=_0x55c276['attributes']['length']?_0x55c276[_0xe01a('0x35')]:_0x5724f7[_0xe01a('0x30')];if(!_0x556f1b[_0xe01a('0x33')][_0xe01a('0x37')]('nolimit')){_0x55c276['limit']=qs[_0xe01a('0x21')](_0x556f1b['query'][_0xe01a('0x21')]);_0x55c276['offset']=qs[_0xe01a('0x1f')](_0x556f1b['query'][_0xe01a('0x1f')]);}_0x55c276[_0xe01a('0x38')]=qs['sort'](_0x556f1b['query'][_0xe01a('0x39')]);_0x55c276[_0xe01a('0x3a')]=qs[_0xe01a('0x3b')](_['pick'](_0x556f1b[_0xe01a('0x33')],_0x5724f7[_0xe01a('0x3b')]),_0x279098);if(_0x556f1b[_0xe01a('0x33')][_0xe01a('0x3c')]){_0x55c276[_0xe01a('0x3a')]=_[_0xe01a('0x3d')](_0x55c276['where'],{'$or':_['map'](_0x279098,function(_0xd62130){if(_0xd62130['type']!=='VIRTUAL'){var _0x42aaeb={};_0x42aaeb[_0xd62130[_0xe01a('0x2c')]]={'$like':'%'+_0x556f1b[_0xe01a('0x33')][_0xe01a('0x3c')]+'%'};return _0x42aaeb;}})});}_0x55c276=_['merge']({},_0x55c276,_0x556f1b[_0xe01a('0x3e')]);var _0x4f41ce={'where':_0x55c276[_0xe01a('0x3a')]};return db['CmCustomField'][_0xe01a('0x22')](_0x4f41ce)['then'](function(_0x4d444b){_0x12037d[_0xe01a('0x22')]=_0x4d444b;if(_0x556f1b[_0xe01a('0x33')][_0xe01a('0x3f')]){_0x55c276[_0xe01a('0x40')]=[{'all':!![]}];}return db[_0xe01a('0x41')][_0xe01a('0x42')](_0x55c276);})[_0xe01a('0x29')](function(_0x5c85b3){_0x12037d[_0xe01a('0x43')]=_0x5c85b3;return _0x12037d;})[_0xe01a('0x29')](respondWithFilteredResult(_0x1fad14,_0x55c276))['catch'](handleError(_0x1fad14,null));};exports[_0xe01a('0x44')]=function(_0x2e71b9,_0x2d91b4){var _0x394b64={'raw':!![],'where':{'id':_0x2e71b9[_0xe01a('0x45')]['id']}},_0x2fbf2a={};_0x2fbf2a[_0xe01a('0x30')]=_[_0xe01a('0x32')](db[_0xe01a('0x41')][_0xe01a('0x46')]);_0x2fbf2a[_0xe01a('0x33')]=_[_0xe01a('0x32')](_0x2e71b9[_0xe01a('0x33')]);_0x2fbf2a[_0xe01a('0x3b')]=_['intersection'](_0x2fbf2a[_0xe01a('0x30')],_0x2fbf2a[_0xe01a('0x33')]);_0x394b64[_0xe01a('0x35')]=_['intersection'](_0x2fbf2a[_0xe01a('0x30')],qs[_0xe01a('0x36')](_0x2e71b9[_0xe01a('0x33')][_0xe01a('0x36')]));_0x394b64['attributes']=_0x394b64[_0xe01a('0x35')]['length']?_0x394b64['attributes']:_0x2fbf2a[_0xe01a('0x30')];if(_0x2e71b9[_0xe01a('0x33')][_0xe01a('0x3f')]){_0x394b64[_0xe01a('0x40')]=[{'all':!![]}];}_0x394b64=_['merge']({},_0x394b64,_0x2e71b9['options']);return db['CmCustomField'][_0xe01a('0x47')](_0x394b64)[_0xe01a('0x29')](handleEntityNotFound(_0x2d91b4,null))[_0xe01a('0x29')](respondWithResult(_0x2d91b4,null))[_0xe01a('0x48')](handleError(_0x2d91b4,null));};exports[_0xe01a('0x28')]=function(_0x1a56b6,_0x3c0a80){if(_0x1a56b6['body']['id']){delete _0x1a56b6[_0xe01a('0x49')]['id'];}return db[_0xe01a('0x41')][_0xe01a('0x47')]({'where':{'id':_0x1a56b6[_0xe01a('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c0a80,null))[_0xe01a('0x29')](saveUpdates(_0x1a56b6['body'],null))[_0xe01a('0x29')](respondWithResult(_0x3c0a80,null))['catch'](handleError(_0x3c0a80,null));};exports[_0xe01a('0x2a')]=function(_0x6a4fba,_0x24f4f4){return db[_0xe01a('0x41')]['find']({'where':{'id':_0x6a4fba[_0xe01a('0x45')]['id']}})[_0xe01a('0x29')](handleEntityNotFound(_0x24f4f4,null))[_0xe01a('0x29')](removeEntity(_0x24f4f4,null))[_0xe01a('0x48')](handleError(_0x24f4f4,null));};exports['create']=function(_0x5e5838,_0x4213e7){var _0x9a63de;return db[_0xe01a('0x4a')]['transaction'](function(_0x15a432){return db['CmCustomField'][_0xe01a('0x4b')](_0x5e5838[_0xe01a('0x49')],{'transaction':_0x15a432})[_0xe01a('0x29')](function(_0x1bb850){_0x9a63de=_0x1bb850;var _0x3aef21={'type':db[_0xe01a('0x4c')][_0xe01a('0x4d')],'transaction':_0x15a432};switch(_0x5e5838[_0xe01a('0x49')]['type']){case _0xe01a('0x4e'):_0x3aef21['type']=db[_0xe01a('0x4c')][_0xe01a('0x4d')];break;case'number':_0x3aef21[_0xe01a('0x2f')]=db[_0xe01a('0x4c')][_0xe01a('0x4f')];break;case _0xe01a('0x50'):_0x3aef21[_0xe01a('0x2f')]=db[_0xe01a('0x4c')][_0xe01a('0x51')];_0x3aef21['defaultValue']=![];break;default:}return db[_0xe01a('0x4a')][_0xe01a('0x52')][_0xe01a('0x53')](_0xe01a('0x54'),util['format']('cf_%d',_0x9a63de['id']),_0x3aef21);})[_0xe01a('0x29')](function(){return _0x9a63de;});})[_0xe01a('0x29')](respondWithResult(_0x4213e7,0xc9))['catch'](handleError(_0x4213e7,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index ee20f60..d944559 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 _0xca32=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x27378b,_0x1a7162){var _0x4b637b=function(_0x719b6a){while(--_0x719b6a){_0x27378b['push'](_0x27378b['shift']());}};_0x4b637b(++_0x1a7162);}(_0xca32,0x99));var _0x2ca3=function(_0x49c306,_0x274dd8){_0x49c306=_0x49c306-0x0;var _0x592b42=_0xca32[_0x49c306];return _0x592b42;};'use strict';var _=require(_0x2ca3('0x0'));var util=require(_0x2ca3('0x1'));var logger=require('../../config/logger')(_0x2ca3('0x2'));var moment=require(_0x2ca3('0x3'));var BPromise=require(_0x2ca3('0x4'));var rp=require(_0x2ca3('0x5'));var fs=require('fs');var path=require(_0x2ca3('0x6'));var rimraf=require(_0x2ca3('0x7'));var config=require(_0x2ca3('0x8'));var attributes=require(_0x2ca3('0x9'));module[_0x2ca3('0xa')]=function(_0x240b6e,_0x1c6dc7){return _0x240b6e[_0x2ca3('0xb')](_0x2ca3('0xc'),attributes,{'tableName':_0x2ca3('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2565=['rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','api','bluebird'];(function(_0x3007ab,_0x4a57d5){var _0x2ab383=function(_0x343e66){while(--_0x343e66){_0x3007ab['push'](_0x3007ab['shift']());}};_0x2ab383(++_0x4a57d5);}(_0x2565,0x19d));var _0x5256=function(_0x1bbdbc,_0x4fa6a5){_0x1bbdbc=_0x1bbdbc-0x0;var _0x25da41=_0x2565[_0x1bbdbc];return _0x25da41;};'use strict';var _=require(_0x5256('0x0'));var util=require(_0x5256('0x1'));var logger=require(_0x5256('0x2'))(_0x5256('0x3'));var moment=require('moment');var BPromise=require(_0x5256('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5256('0x5'));var config=require(_0x5256('0x6'));var attributes=require(_0x5256('0x7'));module[_0x5256('0x8')]=function(_0x4847bc,_0x47bd52){return _0x4847bc[_0x5256('0x9')](_0x5256('0xa'),attributes,{'tableName':'cm_custom_fields','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 b3c6c1f..a5e0977 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 _0xed72=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x4c3f41,_0x4ba1e7){var _0x89010c=function(_0x449b90){while(--_0x449b90){_0x4c3f41['push'](_0x4c3f41['shift']());}};_0x89010c(++_0x4ba1e7);}(_0xed72,0xcc));var _0x2ed7=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xed72[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0x2ed7('0x0'));var util=require(_0x2ed7('0x1'));var moment=require(_0x2ed7('0x2'));var BPromise=require(_0x2ed7('0x3'));var rs=require(_0x2ed7('0x4'));var fs=require('fs');var Redis=require(_0x2ed7('0x5'));var db=require(_0x2ed7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ed7('0x7'))(_0x2ed7('0x8'));var config=require(_0x2ed7('0x9'));var jayson=require(_0x2ed7('0xa'));var client=jayson[_0x2ed7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb02a15,_0x148a47,_0xa45f4){return new BPromise(function(_0x179d4e,_0x1ab3d0){return client['request'](_0xb02a15,_0xa45f4)['then'](function(_0x44b68b){logger[_0x2ed7('0xc')](_0x2ed7('0xd'),_0x148a47,_0x2ed7('0xe'));logger[_0x2ed7('0xf')](_0x2ed7('0x10'),_0x148a47,_0x2ed7('0xe'),JSON[_0x2ed7('0x11')](_0x44b68b));if(_0x44b68b[_0x2ed7('0x12')]){if(_0x44b68b['error'][_0x2ed7('0x13')]===0x1f4){logger['error'](_0x2ed7('0xd'),_0x148a47,_0x44b68b[_0x2ed7('0x12')]['message']);return _0x1ab3d0(_0x44b68b[_0x2ed7('0x12')][_0x2ed7('0x14')]);}logger['error'](_0x2ed7('0xd'),_0x148a47,_0x44b68b[_0x2ed7('0x12')][_0x2ed7('0x14')]);return _0x179d4e(_0x44b68b[_0x2ed7('0x12')][_0x2ed7('0x14')]);}else{logger[_0x2ed7('0xc')]('CmCustomField,\x20%s,\x20%s',_0x148a47,_0x2ed7('0xe'));_0x179d4e(_0x44b68b[_0x2ed7('0x15')][_0x2ed7('0x14')]);}})[_0x2ed7('0x16')](function(_0x358189){logger[_0x2ed7('0x12')](_0x2ed7('0xd'),_0x148a47,_0x358189);_0x1ab3d0(_0x358189);});});} \ No newline at end of file +var _0xd707=['info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2ddca1,_0x5279a7){var _0x592e93=function(_0x407dac){while(--_0x407dac){_0x2ddca1['push'](_0x2ddca1['shift']());}};_0x592e93(++_0x5279a7);}(_0xd707,0xb2));var _0x7d70=function(_0xddf4ee,_0xc2ef88){_0xddf4ee=_0xddf4ee-0x0;var _0x564e4a=_0xd707[_0xddf4ee];return _0x564e4a;};'use strict';var _=require(_0x7d70('0x0'));var util=require(_0x7d70('0x1'));var moment=require(_0x7d70('0x2'));var BPromise=require(_0x7d70('0x3'));var rs=require(_0x7d70('0x4'));var fs=require('fs');var Redis=require(_0x7d70('0x5'));var db=require(_0x7d70('0x6'))['db'];var utils=require(_0x7d70('0x7'));var logger=require('../../config/logger')(_0x7d70('0x8'));var config=require(_0x7d70('0x9'));var jayson=require(_0x7d70('0xa'));var client=jayson[_0x7d70('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2786ef,_0x34a176,_0x25a08c){return new BPromise(function(_0x430ae5,_0x3c6103){return client[_0x7d70('0xc')](_0x2786ef,_0x25a08c)[_0x7d70('0xd')](function(_0x29ec04){logger[_0x7d70('0xe')](_0x7d70('0xf'),_0x34a176,'request\x20sent');logger['debug'](_0x7d70('0x10'),_0x34a176,_0x7d70('0x11'),JSON[_0x7d70('0x12')](_0x29ec04));if(_0x29ec04['error']){if(_0x29ec04[_0x7d70('0x13')][_0x7d70('0x14')]===0x1f4){logger[_0x7d70('0x13')](_0x7d70('0xf'),_0x34a176,_0x29ec04[_0x7d70('0x13')][_0x7d70('0x15')]);return _0x3c6103(_0x29ec04[_0x7d70('0x13')]['message']);}logger[_0x7d70('0x13')](_0x7d70('0xf'),_0x34a176,_0x29ec04[_0x7d70('0x13')]['message']);return _0x430ae5(_0x29ec04[_0x7d70('0x13')][_0x7d70('0x15')]);}else{logger[_0x7d70('0xe')](_0x7d70('0xf'),_0x34a176,_0x7d70('0x11'));_0x430ae5(_0x29ec04[_0x7d70('0x16')][_0x7d70('0x15')]);}})[_0x7d70('0x17')](function(_0x1b0cd6){logger[_0x7d70('0x13')](_0x7d70('0xf'),_0x34a176,_0x1b0cd6);_0x3c6103(_0x1b0cd6);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e918467..6eb5a41 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 _0x0f89=['../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0f89,0x111));var _0x90f8=function(_0x3ca8f8,_0x306e7e){_0x3ca8f8=_0x3ca8f8-0x0;var _0x670e9f=_0x0f89[_0x3ca8f8];return _0x670e9f;};'use strict';var multer=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var path=require(_0x90f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x90f8('0x3'));var router=express[_0x90f8('0x4')]();var fs_extra=require(_0x90f8('0x5'));var auth=require(_0x90f8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x90f8('0x7'));var controller=require(_0x90f8('0x8'));router['get']('/',auth[_0x90f8('0x9')](),controller[_0x90f8('0xa')]);router[_0x90f8('0xb')](_0x90f8('0xc'),auth[_0x90f8('0x9')](),controller[_0x90f8('0xd')]);router[_0x90f8('0xe')]('/',auth[_0x90f8('0x9')](),controller[_0x90f8('0xf')]);router[_0x90f8('0x10')](_0x90f8('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x90f8('0x11')](_0x90f8('0xc'),auth[_0x90f8('0x9')](),controller[_0x90f8('0x12')]);module[_0x90f8('0x13')]=router; \ No newline at end of file +var _0x3f8a=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x11be52,_0x2ef4f4){var _0x5b0bf8=function(_0x3659b6){while(--_0x3659b6){_0x11be52['push'](_0x11be52['shift']());}};_0x5b0bf8(++_0x2ef4f4);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x34cb0e,_0x3497f0){_0x34cb0e=_0x34cb0e-0x0;var _0x34b333=_0x3f8a[_0x34cb0e];return _0x34b333;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xa')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xf')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router[_0xa3f8('0x11')]('/:id',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x12')]);router[_0xa3f8('0x13')](_0xa3f8('0xd'),auth['isAuthenticated'](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7cc0bce..a1ef09d 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 _0x266f=['contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED'];(function(_0x213a25,_0x105240){var _0x3064bb=function(_0x2e0fe3){while(--_0x2e0fe3){_0x213a25['push'](_0x213a25['shift']());}};_0x3064bb(++_0x105240);}(_0x266f,0xfe));var _0xf266=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x266f[_0x1589dd];return _0x1bddd1;};'use strict';var moment=require(_0xf266('0x0'));var Sequelize=require(_0xf266('0x1'));module[_0xf266('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xf266('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf266('0x4')],'defaultValue':moment()[_0xf266('0x5')](_0xf266('0x6'))},'countbusyretry':{'type':Sequelize[_0xf266('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf266('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf266('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf266('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf266('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf266('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf266('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xf266('0x7')],'unique':_0xf266('0xa')},'UserId':{'type':Sequelize[_0xf266('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xf266('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xf266('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xf266('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf266('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf266('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf266('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xf266('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xf266('0x8')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xb553=['INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0xb553,0x184));var _0x3b55=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb553[_0x3e5086];return _0xfeb102;};'use strict';var moment=require(_0x3b55('0x0'));var Sequelize=require(_0x3b55('0x1'));module[_0x3b55('0x2')]={'phone':{'type':Sequelize[_0x3b55('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x3b55('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3b55('0x5')],'defaultValue':moment()[_0x3b55('0x6')](_0x3b55('0x7'))},'countbusyretry':{'type':Sequelize[_0x3b55('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3b55('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3b55('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3b55('0x5')]},'priority':{'type':Sequelize[_0x3b55('0x8')](0x2)[_0x3b55('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3b55('0x8')],'unique':_0x3b55('0xa')},'ListId':{'type':Sequelize[_0x3b55('0x8')],'unique':_0x3b55('0xa')},'UserId':{'type':Sequelize[_0x3b55('0x8')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x3b55('0xa')},'CampaignId':{'type':Sequelize[_0x3b55('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x3b55('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3b55('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3b55('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3b55('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3b55('0x3')]},'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 34710f1..2f36d12 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 _0xcd38=['options','includeAll','include','findAll','show','params','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','firstName','lastName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','direction','prev','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','CmCompany','Company','CmList','List','dialActive','getPreviewRecall','transaction','scheduledat','recallme','Contact','getOpenContacts','isNil','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','CmHopper','rawAttributes','fieldName','type','key','query','keys','filters','model','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','order','sort','where','filter','merge','map','VIRTUAL'];(function(_0x43fa6e,_0xd516fa){var _0x5ce0d1=function(_0x1f2cee){while(--_0x1f2cee){_0x43fa6e['push'](_0x43fa6e['shift']());}};_0x5ce0d1(++_0xd516fa);}(_0xcd38,0xea));var _0x8cd3=function(_0x139d54,_0x1a8543){_0x139d54=_0x139d54-0x0;var _0x45d3fe=_0xcd38[_0x139d54];return _0x45d3fe;};'use strict';var emlformat=require(_0x8cd3('0x0'));var rimraf=require(_0x8cd3('0x1'));var zipdir=require(_0x8cd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8cd3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8cd3('0x4'));var util=require('util');var path=require('path');var sox=require(_0x8cd3('0x5'));var csv=require(_0x8cd3('0x6'));var ejs=require(_0x8cd3('0x7'));var fs=require('fs');var fs_extra=require(_0x8cd3('0x8'));var _=require(_0x8cd3('0x9'));var squel=require(_0x8cd3('0xa'));var crypto=require('crypto');var jsforce=require(_0x8cd3('0xb'));var deskjs=require(_0x8cd3('0xc'));var toCsv=require(_0x8cd3('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8cd3('0xd'));var qs=require(_0x8cd3('0xe'));var as=require(_0x8cd3('0xf'));var hardwareService=require(_0x8cd3('0x10'));var logger=require(_0x8cd3('0x11'))(_0x8cd3('0x12'));var utils=require('../../config/utils');var config=require(_0x8cd3('0x13'));var shared=require('../../config/environment');var licenseUtil=require(_0x8cd3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f2379,_0x1f2500){_0x1f2500=_0x1f2500||0xcc;return function(_0x45c72a){if(_0x45c72a){return _0x3f2379[_0x8cd3('0x15')](_0x1f2500);}return _0x3f2379[_0x8cd3('0x16')](_0x1f2500)['end']();};}function respondWithResult(_0x5a7be6,_0x440281){_0x440281=_0x440281||0xc8;return function(_0x3f1dad){if(_0x3f1dad){return _0x5a7be6['status'](_0x440281)[_0x8cd3('0x17')](_0x3f1dad);}};}function respondWithFilteredResult(_0x263152,_0x4ac48d){return function(_0x302df3){if(_0x302df3){var _0xc593cd=typeof _0x4ac48d[_0x8cd3('0x18')]==='undefined'&&typeof _0x4ac48d[_0x8cd3('0x19')]===_0x8cd3('0x1a');var _0x57c516=_0x302df3[_0x8cd3('0x1b')];var _0x816387=_0xc593cd?0x0:_0x4ac48d[_0x8cd3('0x18')];var _0x30a9cb=_0xc593cd?_0x302df3[_0x8cd3('0x1b')]:_0x4ac48d[_0x8cd3('0x18')]+_0x4ac48d[_0x8cd3('0x19')];var _0x47bcec;if(_0x30a9cb>=_0x57c516){_0x30a9cb=_0x57c516;_0x47bcec=0xc8;}else{_0x47bcec=0xce;}_0x263152[_0x8cd3('0x16')](_0x47bcec);return _0x263152[_0x8cd3('0x1c')](_0x8cd3('0x1d'),_0x816387+'-'+_0x30a9cb+'/'+_0x57c516)[_0x8cd3('0x17')](_0x302df3);}return null;};}function patchUpdates(_0x4764b8){return function(_0x42d238){try{jsonpatch['apply'](_0x42d238,_0x4764b8,!![]);}catch(_0x55a879){return BPromise[_0x8cd3('0x1e')](_0x55a879);}return _0x42d238[_0x8cd3('0x1f')]();};}function saveUpdates(_0x193e30,_0x3e9d42){return function(_0x1c5920){if(_0x1c5920){return _0x1c5920[_0x8cd3('0x20')](_0x193e30)['then'](function(_0x73d9a3){return _0x73d9a3;});}return null;};}function removeEntity(_0x144d0a,_0x3238f5){return function(_0x421759){if(_0x421759){return _0x421759[_0x8cd3('0x21')]()[_0x8cd3('0x22')](function(){_0x144d0a[_0x8cd3('0x16')](0xcc)[_0x8cd3('0x23')]();});}};}function handleEntityNotFound(_0x363a90,_0x3ed0a5){return function(_0x42f6d9){if(!_0x42f6d9){_0x363a90[_0x8cd3('0x15')](0x194);}return _0x42f6d9;};}function handleError(_0xa55534,_0x3e36e2){_0x3e36e2=_0x3e36e2||0x1f4;return function(_0x43cdb0){logger[_0x8cd3('0x24')](_0x43cdb0['stack']);if(_0x43cdb0[_0x8cd3('0x25')]){delete _0x43cdb0[_0x8cd3('0x25')];}_0xa55534[_0x8cd3('0x16')](_0x3e36e2)[_0x8cd3('0x26')](_0x43cdb0);};}exports[_0x8cd3('0x27')]=function(_0x683baa,_0x3a52a7){var _0x61d18c={},_0xecb0a5={},_0x4f80ef={'count':0x0,'rows':[]};var _0x2cb98b=_['map'](db[_0x8cd3('0x28')][_0x8cd3('0x29')],function(_0x2439f4){return{'name':_0x2439f4[_0x8cd3('0x2a')],'type':_0x2439f4[_0x8cd3('0x2b')][_0x8cd3('0x2c')]};});_0xecb0a5['model']=_['map'](_0x2cb98b,_0x8cd3('0x25'));_0xecb0a5[_0x8cd3('0x2d')]=_[_0x8cd3('0x2e')](_0x683baa[_0x8cd3('0x2d')]);_0xecb0a5[_0x8cd3('0x2f')]=_['intersection'](_0xecb0a5[_0x8cd3('0x30')],_0xecb0a5[_0x8cd3('0x2d')]);_0xecb0a5[_0x8cd3('0x2f')]=_['concat'](_0xecb0a5['filters'],[_0x8cd3('0x31'),'$or',_0x8cd3('0x32'),_0x8cd3('0x33'),_0x8cd3('0x34'),_0x8cd3('0x35'),_0x8cd3('0x36'),_0x8cd3('0x37'),_0x8cd3('0x38'),_0x8cd3('0x39'),_0x8cd3('0x3a'),_0x8cd3('0x3b'),'$notIn',_0x8cd3('0x3c'),_0x8cd3('0x3d'),'$iLike',_0x8cd3('0x3e'),_0x8cd3('0x3c'),_0x8cd3('0x3f'),_0x8cd3('0x40'),_0x8cd3('0x41'),_0x8cd3('0x42')]);_0x61d18c[_0x8cd3('0x43')]=_[_0x8cd3('0x44')](_0xecb0a5['model'],qs['fields'](_0x683baa[_0x8cd3('0x2d')][_0x8cd3('0x45')]));_0x61d18c[_0x8cd3('0x43')]=_0x61d18c[_0x8cd3('0x43')][_0x8cd3('0x46')]?_0x61d18c[_0x8cd3('0x43')]:_0xecb0a5[_0x8cd3('0x30')];if(!_0x683baa[_0x8cd3('0x2d')]['hasOwnProperty']('nolimit')){_0x61d18c[_0x8cd3('0x19')]=qs[_0x8cd3('0x19')](_0x683baa[_0x8cd3('0x2d')][_0x8cd3('0x19')]);_0x61d18c[_0x8cd3('0x18')]=qs[_0x8cd3('0x18')](_0x683baa[_0x8cd3('0x2d')][_0x8cd3('0x18')]);}_0x61d18c[_0x8cd3('0x47')]=qs[_0x8cd3('0x48')](_0x683baa[_0x8cd3('0x2d')]['sort']);_0x61d18c[_0x8cd3('0x49')]=qs['filters'](_['pick'](_0x683baa[_0x8cd3('0x2d')],_0xecb0a5[_0x8cd3('0x2f')]),_0x2cb98b);if(_0x683baa[_0x8cd3('0x2d')][_0x8cd3('0x4a')]){_0x61d18c[_0x8cd3('0x49')]=_[_0x8cd3('0x4b')](_0x61d18c['where'],{'$or':_[_0x8cd3('0x4c')](_0x2cb98b,function(_0xa4e491){if(_0xa4e491[_0x8cd3('0x2b')]!==_0x8cd3('0x4d')){var _0x57d119={};_0x57d119[_0xa4e491[_0x8cd3('0x25')]]={'$like':'%'+_0x683baa['query'][_0x8cd3('0x4a')]+'%'};return _0x57d119;}})});}_0x61d18c=_[_0x8cd3('0x4b')]({},_0x61d18c,_0x683baa[_0x8cd3('0x4e')]);var _0x2aace7={'where':_0x61d18c['where']};return db[_0x8cd3('0x28')]['count'](_0x2aace7)[_0x8cd3('0x22')](function(_0x1172ab){_0x4f80ef[_0x8cd3('0x1b')]=_0x1172ab;if(_0x683baa['query'][_0x8cd3('0x4f')]){_0x61d18c[_0x8cd3('0x50')]=[{'all':!![]}];}return db[_0x8cd3('0x28')][_0x8cd3('0x51')](_0x61d18c);})[_0x8cd3('0x22')](function(_0x26bddb){_0x4f80ef['rows']=_0x26bddb;return _0x4f80ef;})['then'](respondWithFilteredResult(_0x3a52a7,_0x61d18c))['catch'](handleError(_0x3a52a7,null));};exports[_0x8cd3('0x52')]=function(_0x1d7090,_0x22e53e){var _0x44824a={'raw':!![],'where':{'id':_0x1d7090[_0x8cd3('0x53')]['id']}},_0x59ecef={};_0x59ecef[_0x8cd3('0x30')]=_[_0x8cd3('0x2e')](db[_0x8cd3('0x28')][_0x8cd3('0x29')]);_0x59ecef[_0x8cd3('0x2d')]=_['keys'](_0x1d7090[_0x8cd3('0x2d')]);_0x59ecef['filters']=_[_0x8cd3('0x44')](_0x59ecef[_0x8cd3('0x30')],_0x59ecef[_0x8cd3('0x2d')]);_0x44824a[_0x8cd3('0x43')]=_[_0x8cd3('0x44')](_0x59ecef[_0x8cd3('0x30')],qs[_0x8cd3('0x45')](_0x1d7090[_0x8cd3('0x2d')][_0x8cd3('0x45')]));_0x44824a[_0x8cd3('0x43')]=_0x44824a[_0x8cd3('0x43')][_0x8cd3('0x46')]?_0x44824a['attributes']:_0x59ecef[_0x8cd3('0x30')];if(_0x1d7090['query'][_0x8cd3('0x4f')]){_0x44824a[_0x8cd3('0x50')]=[{'all':!![]}];}_0x44824a=_[_0x8cd3('0x4b')]({},_0x44824a,_0x1d7090['options']);return db[_0x8cd3('0x28')][_0x8cd3('0x54')](_0x44824a)[_0x8cd3('0x22')](handleEntityNotFound(_0x22e53e,null))[_0x8cd3('0x22')](respondWithResult(_0x22e53e,null))[_0x8cd3('0x55')](handleError(_0x22e53e,null));};exports['create']=function(_0x127e3d,_0x33afb1){return db[_0x8cd3('0x28')][_0x8cd3('0x56')](_0x127e3d[_0x8cd3('0x57')],{})[_0x8cd3('0x22')](respondWithResult(_0x33afb1,0xc9))['catch'](handleError(_0x33afb1,null));};exports[_0x8cd3('0x20')]=function(_0x424d55,_0x1c8f10){if(_0x424d55[_0x8cd3('0x57')]['id']){delete _0x424d55[_0x8cd3('0x57')]['id'];}return db[_0x8cd3('0x28')][_0x8cd3('0x54')]({'where':{'id':_0x424d55[_0x8cd3('0x53')]['id']}})[_0x8cd3('0x22')](handleEntityNotFound(_0x1c8f10,null))[_0x8cd3('0x22')](saveUpdates(_0x424d55[_0x8cd3('0x57')],null))['then'](respondWithResult(_0x1c8f10,null))['catch'](handleError(_0x1c8f10,null));};exports[_0x8cd3('0x58')]=function(_0x5032fb,_0x3aa532){return db[_0x8cd3('0x28')][_0x8cd3('0x58')]()['then'](respondWithResult(_0x3aa532,null))[_0x8cd3('0x55')](handleError(_0x3aa532,null));};exports[_0x8cd3('0x21')]=function(_0x5da1ca,_0x574bbd){var _0x1f939e;var _0x2a877b=_0x5da1ca[_0x8cd3('0x53')]['id'];return db[_0x8cd3('0x28')]['find']({'where':{'id':_0x5da1ca[_0x8cd3('0x53')]['id']}})[_0x8cd3('0x22')](handleEntityNotFound(_0x574bbd,null))['then'](function(_0x39e03f){if(_0x39e03f){return _0x39e03f['destroy']()[_0x8cd3('0x22')](function(_0x89f1e8){return _0x89f1e8;});}})[_0x8cd3('0x22')](function(_0x54550a){_0x1f939e=_0x54550a;if(_0x54550a){if(_0x54550a[_0x8cd3('0x59')]||_0x54550a[_0x8cd3('0x5a')]){return db[_0x54550a[_0x8cd3('0x59')]?_0x8cd3('0x5b'):_0x8cd3('0x5c')][_0x8cd3('0x54')]({'where':{'id':_0x54550a[_0x8cd3('0x59')]?_0x54550a[_0x8cd3('0x59')]:_0x54550a[_0x8cd3('0x5a')]},'attributes':['id',_0x8cd3('0x25')],'raw':!![]});}}})[_0x8cd3('0x22')](function(_0xc5662a){var _0x398cd3={};if(_0xc5662a){_[_0x8cd3('0x4b')](_0x398cd3,_[_0x8cd3('0x5d')](_0x1f939e[_0x8cd3('0x5e')],[_0x8cd3('0x5f'),_0x8cd3('0x60'),'id']));_0x398cd3['state']=0x15;_0x398cd3[_0x8cd3('0x61')]=_0x8cd3('0x62');_0x398cd3[_0x8cd3('0x63')]=_0xc5662a['name'];_0x398cd3[_0x8cd3('0x64')]=_0x5da1ca['user']['name'];_0x398cd3[_0x8cd3('0x65')]=_0x5da1ca[_0x8cd3('0x66')]['id'];_0x398cd3['deleted']=!![];_0x398cd3[_0x8cd3('0x67')]=moment()[_0x8cd3('0x68')](_0x8cd3('0x69'));_0x398cd3[_0x8cd3('0x6a')]=_0x1f939e[_0x8cd3('0x6b')];_0x398cd3['campaigntype']=_0x1f939e[_0x8cd3('0x59')]?_0x8cd3('0x6c'):'ivr';return db[_0x8cd3('0x6d')][_0x8cd3('0x54')]({'where':{'id':_0x398cd3['ContactId']},'attributes':[_0x8cd3('0x6e'),_0x8cd3('0x6f')]})[_0x8cd3('0x22')](function(_0x30321b){if(!_['isNil'](_0x574bbd)&&!_['isNil'](_0x30321b[_0x8cd3('0x6e')])){_0x398cd3[_0x8cd3('0x70')]=_0x30321b['firstName'];if(!_['isNil'](_0x30321b[_0x8cd3('0x6f')])){_0x398cd3[_0x8cd3('0x70')]+='\x20'+_0x30321b[_0x8cd3('0x6f')];}}})['finally'](function(){return db[_0x8cd3('0x71')]['create'](_0x398cd3);});}})[_0x8cd3('0x22')](function(_0x1512e4){return db[_0x8cd3('0x72')]['destroy']({'where':{'CmHopperId':_0x2a877b}});})[_0x8cd3('0x22')](function(){return _0x574bbd[_0x8cd3('0x16')](0xcc)[_0x8cd3('0x23')]();})[_0x8cd3('0x55')](handleError(_0x574bbd,null));};exports[_0x8cd3('0x73')]=function(_0x19b063,_0x1393da,_0x1bcec0){var _0x4cdfb0=[];return db['CmContact'][_0x8cd3('0x58')]()[_0x8cd3('0x22')](function(_0x3b0d49){_0x4cdfb0=_['keys'](_0x3b0d49);return _0x19b063[_0x8cd3('0x66')][_0x8cd3('0x74')]({'where':{'type':_0x8cd3('0x75'),'dialActive':!![],'dialMethod':_0x8cd3('0x76')},'attributes':['id',_0x8cd3('0x77'),_0x8cd3('0x78')],'raw':!![]});})['then'](function(_0x5ed2a0){if(_0x5ed2a0&&_0x5ed2a0['length']){return db['sequelize']['transaction'](function(_0x30ce86){var _0x44623c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8cd3('0x68')](_0x8cd3('0x69'))},'VoiceQueueId':{'$in':_[_0x8cd3('0x4c')](_0x5ed2a0,'id')},'$or':[{'UserId':null},{'UserId':_0x19b063[_0x8cd3('0x66')]['id']}]};var _0x24110c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5ed2a0)[_0x8cd3('0x4a')]([_0x8cd3('0x78'),0x0])['map']('id')[_0x8cd3('0x79')]()},'$or':[{'UserId':null},{'UserId':_0x19b063['user']['id']}]};var _0x410744={'$or':[_0x44623c,_0x24110c]};var _0x113803=[];if(_0x19b063[_0x8cd3('0x57')][_0x8cd3('0x7a')]&&_0x19b063['body'][_0x8cd3('0x7a')]===_0x8cd3('0x7b')){if(!_['isEmpty'](_0x19b063[_0x8cd3('0x57')][_0x8cd3('0x7c')])){_0x410744['id']={'$in':_0x19b063[_0x8cd3('0x57')][_0x8cd3('0x7c')]};}_0x113803=[['priority',_0x8cd3('0x7d')],[_0x8cd3('0x7e'),_0x5ed2a0[0x0][_0x8cd3('0x77')]==='ASC'?_0x8cd3('0x7f'):_0x8cd3('0x7d')],db['sequelize'][_0x8cd3('0x80')](_0x8cd3('0x81')),['id',_0x8cd3('0x7f')]];}else{if(!_[_0x8cd3('0x82')](_0x19b063[_0x8cd3('0x57')][_0x8cd3('0x7c')])){_0x410744['id']={'$notIn':_0x19b063['body']['hopperIds']};}_0x113803=[['priority',_0x8cd3('0x7f')],[_0x8cd3('0x7e'),_0x5ed2a0[0x0][_0x8cd3('0x77')]],db[_0x8cd3('0x83')][_0x8cd3('0x80')](_0x8cd3('0x84')),['id',_0x8cd3('0x7d')]];}return db[_0x8cd3('0x28')][_0x8cd3('0x85')]({'attributes':['id','scheduledat',_0x8cd3('0x6b'),'recallme'],'where':_0x410744,'order':_0x113803,'transaction':_0x30ce86,'lock':_0x30ce86[_0x8cd3('0x86')][_0x8cd3('0x87')],'include':[{'model':db[_0x8cd3('0x6d')],'as':'Contact','attributes':_0x4cdfb0,'include':[{'model':db[_0x8cd3('0x88')],'as':_0x8cd3('0x89'),'attributes':['id','name']}]},{'model':db[_0x8cd3('0x8a')],'as':_0x8cd3('0x8b'),'attributes':['id',_0x8cd3('0x25')]},{'model':db[_0x8cd3('0x5b')],'as':'Queue','attributes':['id','name',_0x8cd3('0x8c')]}]})[_0x8cd3('0x22')](function(_0x2b51c0){if(_0x2b51c0){return _0x2b51c0[_0x8cd3('0x20')]({'UserId':_0x19b063[_0x8cd3('0x66')]['id']},{'transaction':_0x30ce86});}});});}})[_0x8cd3('0x22')](handleEntityNotFound(_0x1393da,null))[_0x8cd3('0x22')](respondWithResult(_0x1393da,null))[_0x8cd3('0x55')](handleError(_0x1393da,null));};exports[_0x8cd3('0x8d')]=function(_0x4c1a99,_0x3f10e3,_0xa4cd1e){var _0x1f0d3c=[];return db[_0x8cd3('0x6d')]['describe']()[_0x8cd3('0x22')](function(_0x2a8cef){_0x1f0d3c=_[_0x8cd3('0x2e')](_0x2a8cef);return _0x4c1a99[_0x8cd3('0x66')][_0x8cd3('0x74')]({'where':{'type':_0x8cd3('0x75'),'dialActive':!![],'dialMethod':_0x8cd3('0x76')},'attributes':['id','dialOrderByScheduledAt',_0x8cd3('0x78')],'raw':!![]});})[_0x8cd3('0x22')](function(_0x1105a7){if(_0x1105a7&&_0x1105a7[_0x8cd3('0x46')]){return db[_0x8cd3('0x83')][_0x8cd3('0x8e')](function(_0x9a3535){var _0x15e70d={'active':![],'recallme':!![],'id':_0x4c1a99['body']['hopperId']};return db['CmHopper']['findOne']({'attributes':['id',_0x8cd3('0x8f'),_0x8cd3('0x90')],'where':_0x15e70d,'transaction':_0x9a3535,'lock':_0x9a3535['LOCK'][_0x8cd3('0x87')],'include':[{'model':db[_0x8cd3('0x6d')],'as':_0x8cd3('0x91'),'attributes':_0x1f0d3c,'include':[{'model':db[_0x8cd3('0x88')],'as':_0x8cd3('0x89'),'attributes':['id',_0x8cd3('0x25')]}]},{'model':db[_0x8cd3('0x8a')],'as':_0x8cd3('0x8b'),'attributes':['id',_0x8cd3('0x25')]},{'model':db[_0x8cd3('0x5b')],'as':'Queue','attributes':['id',_0x8cd3('0x25'),_0x8cd3('0x8c')]}]})[_0x8cd3('0x22')](function(_0x460975){if(_0x460975){return _0x460975['update']({'UserId':_0x4c1a99[_0x8cd3('0x66')]['id']},{'transaction':_0x9a3535});}});});}})[_0x8cd3('0x22')](handleEntityNotFound(_0x3f10e3,null))[_0x8cd3('0x22')](respondWithResult(_0x3f10e3,null))['catch'](handleError(_0x3f10e3,null));};exports[_0x8cd3('0x92')]=function(_0x3f195f,_0x3f5e5a,_0x11730d){return _0x3f195f[_0x8cd3('0x66')][_0x8cd3('0x74')]({'where':{'type':_0x8cd3('0x75'),'dialActive':!![],'dialMethod':_0x8cd3('0x76')},'attributes':['id'],'raw':!![]})[_0x8cd3('0x22')](function(_0x3f34a5){if(_0x3f34a5&&_0x3f34a5[_0x8cd3('0x46')]){return db[_0x8cd3('0x28')][_0x8cd3('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8cd3('0x68')](_0x8cd3('0x69'))},'VoiceQueueId':{'$in':_[_0x8cd3('0x4c')](_0x3f34a5,'id')},'$or':[{'UserId':null},{'UserId':_0x3f195f['user']['id']}]}});}return 0x0;})[_0x8cd3('0x22')](function(_0x51ee0e){if(!_[_0x8cd3('0x93')](_0x51ee0e)&&_[_0x8cd3('0x94')](_0x51ee0e)){return _0x3f5e5a[_0x8cd3('0x16')](0xc8)[_0x8cd3('0x17')]({'contacts':_0x51ee0e});}else{logger[_0x8cd3('0x24')](_0x8cd3('0x95'),_0x8cd3('0x92'),0x194,_0x8cd3('0x96'));_0x3f5e5a[_0x8cd3('0x15')](0x194);}})[_0x8cd3('0x55')](handleError(_0x3f5e5a,null));};exports[_0x8cd3('0x97')]=function(_0x531417,_0x3ea3ce,_0x5ef44b){var _0x253a66=shared[_0x8cd3('0x98')];var _0x524c93=[];_[_0x8cd3('0x4c')](_0x253a66,function(_0x40953b){_0x524c93[_0x8cd3('0x99')]({'id':_0x40953b['name'],'name':_0x40953b[_0x8cd3('0x25')],'utcOffset':_0x40953b[_0x8cd3('0x9a')]});});return _0x3ea3ce[_0x8cd3('0x16')](0xc8)[_0x8cd3('0x17')]({'tz':_0x524c93});};exports[_0x8cd3('0x9b')]=function(_0x55cc41,_0x1cc778,_0x20e93f){var _0x36396a=shared[_0x8cd3('0x98')];var _0x41e9f9={};if(!_[_0x8cd3('0x93')](_0x36396a[_0x55cc41['body']['id']]))_0x41e9f9=_0x36396a[_0x55cc41[_0x8cd3('0x57')]['id']];return _0x1cc778['status'](0xc8)['json'](_0x41e9f9);}; \ No newline at end of file +var _0xe010=['../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','CmHopper','fieldName','key','model','query','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','describe','VoiceQueueId','VoiceQueue','CampaignId','omit','dataValues','updatedAt','state','statedesc','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','create','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','CmCompany','CmList','List','dialActive','getPreviewRecall','hopperId','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','getTimezone','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0xd1c6d8,_0x3eb001){var _0x27ab29=function(_0x31de34){while(--_0x31de34){_0xd1c6d8['push'](_0xd1c6d8['shift']());}};_0x27ab29(++_0x3eb001);}(_0xe010,0x125));var _0x0e01=function(_0x12bd92,_0x8c41ba){_0x12bd92=_0x12bd92-0x0;var _0x521cf7=_0xe010[_0x12bd92];return _0x521cf7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e01('0x0'));var zipdir=require(_0x0e01('0x1'));var jsonpatch=require(_0x0e01('0x2'));var rp=require(_0x0e01('0x3'));var moment=require(_0x0e01('0x4'));var BPromise=require(_0x0e01('0x5'));var Mustache=require(_0x0e01('0x6'));var util=require(_0x0e01('0x7'));var path=require('path');var sox=require(_0x0e01('0x8'));var csv=require('to-csv');var ejs=require(_0x0e01('0x9'));var fs=require('fs');var fs_extra=require(_0x0e01('0xa'));var _=require(_0x0e01('0xb'));var squel=require(_0x0e01('0xc'));var crypto=require(_0x0e01('0xd'));var jsforce=require(_0x0e01('0xe'));var deskjs=require(_0x0e01('0xf'));var toCsv=require(_0x0e01('0x10'));var querystring=require(_0x0e01('0x11'));var Papa=require(_0x0e01('0x12'));var Redis=require(_0x0e01('0x13'));var authService=require(_0x0e01('0x14'));var qs=require(_0x0e01('0x15'));var as=require(_0x0e01('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e01('0x17'))(_0x0e01('0x18'));var utils=require('../../config/utils');var config=require(_0x0e01('0x19'));var shared=require(_0x0e01('0x19'));var licenseUtil=require(_0x0e01('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a5e62,_0x165089){_0x165089=_0x165089||0xcc;return function(_0x103f53){if(_0x103f53){return _0x4a5e62['sendStatus'](_0x165089);}return _0x4a5e62[_0x0e01('0x1b')](_0x165089)[_0x0e01('0x1c')]();};}function respondWithResult(_0x3c725f,_0x5c628c){_0x5c628c=_0x5c628c||0xc8;return function(_0x50f83a){if(_0x50f83a){return _0x3c725f[_0x0e01('0x1b')](_0x5c628c)[_0x0e01('0x1d')](_0x50f83a);}};}function respondWithFilteredResult(_0x507704,_0x85d3ee){return function(_0x4a0db8){if(_0x4a0db8){var _0x138ce1=typeof _0x85d3ee[_0x0e01('0x1e')]===_0x0e01('0x1f')&&typeof _0x85d3ee[_0x0e01('0x20')]===_0x0e01('0x1f');var _0x231ebb=_0x4a0db8['count'];var _0x430ac0=_0x138ce1?0x0:_0x85d3ee[_0x0e01('0x1e')];var _0x2e81cc=_0x138ce1?_0x4a0db8[_0x0e01('0x21')]:_0x85d3ee['offset']+_0x85d3ee[_0x0e01('0x20')];var _0x5c6baf;if(_0x2e81cc>=_0x231ebb){_0x2e81cc=_0x231ebb;_0x5c6baf=0xc8;}else{_0x5c6baf=0xce;}_0x507704[_0x0e01('0x1b')](_0x5c6baf);return _0x507704[_0x0e01('0x22')]('Content-Range',_0x430ac0+'-'+_0x2e81cc+'/'+_0x231ebb)['json'](_0x4a0db8);}return null;};}function patchUpdates(_0x4b21fb){return function(_0x581c9e){try{jsonpatch[_0x0e01('0x23')](_0x581c9e,_0x4b21fb,!![]);}catch(_0x1e9b2d){return BPromise[_0x0e01('0x24')](_0x1e9b2d);}return _0x581c9e[_0x0e01('0x25')]();};}function saveUpdates(_0x2d7af6,_0x3e58a4){return function(_0x56d378){if(_0x56d378){return _0x56d378[_0x0e01('0x26')](_0x2d7af6)[_0x0e01('0x27')](function(_0x3634d7){return _0x3634d7;});}return null;};}function removeEntity(_0x2d633c,_0x50b557){return function(_0x479960){if(_0x479960){return _0x479960[_0x0e01('0x28')]()[_0x0e01('0x27')](function(){_0x2d633c[_0x0e01('0x1b')](0xcc)[_0x0e01('0x1c')]();});}};}function handleEntityNotFound(_0x202652,_0xa3fe8c){return function(_0x1d29b9){if(!_0x1d29b9){_0x202652[_0x0e01('0x29')](0x194);}return _0x1d29b9;};}function handleError(_0x4a6fba,_0x1fafdd){_0x1fafdd=_0x1fafdd||0x1f4;return function(_0x243390){logger[_0x0e01('0x2a')](_0x243390[_0x0e01('0x2b')]);if(_0x243390[_0x0e01('0x2c')]){delete _0x243390[_0x0e01('0x2c')];}_0x4a6fba[_0x0e01('0x1b')](_0x1fafdd)['send'](_0x243390);};}exports[_0x0e01('0x2d')]=function(_0x338589,_0x5caf78){var _0x4f635f={},_0x593d27={},_0x292044={'count':0x0,'rows':[]};var _0x2990df=_[_0x0e01('0x2e')](db[_0x0e01('0x2f')]['rawAttributes'],function(_0x186d0d){return{'name':_0x186d0d[_0x0e01('0x30')],'type':_0x186d0d['type'][_0x0e01('0x31')]};});_0x593d27[_0x0e01('0x32')]=_[_0x0e01('0x2e')](_0x2990df,_0x0e01('0x2c'));_0x593d27[_0x0e01('0x33')]=_['keys'](_0x338589[_0x0e01('0x33')]);_0x593d27['filters']=_[_0x0e01('0x34')](_0x593d27[_0x0e01('0x32')],_0x593d27[_0x0e01('0x33')]);_0x593d27[_0x0e01('0x35')]=_['concat'](_0x593d27['filters'],[_0x0e01('0x36'),_0x0e01('0x37'),_0x0e01('0x38'),_0x0e01('0x39'),_0x0e01('0x3a'),_0x0e01('0x3b'),_0x0e01('0x3c'),_0x0e01('0x3d'),_0x0e01('0x3e'),_0x0e01('0x3f'),_0x0e01('0x40'),_0x0e01('0x41'),'$notIn',_0x0e01('0x42'),_0x0e01('0x43'),_0x0e01('0x44'),_0x0e01('0x45'),_0x0e01('0x42'),_0x0e01('0x46'),_0x0e01('0x47'),_0x0e01('0x48'),'$any']);_0x4f635f['attributes']=_['intersection'](_0x593d27[_0x0e01('0x32')],qs[_0x0e01('0x49')](_0x338589[_0x0e01('0x33')][_0x0e01('0x49')]));_0x4f635f['attributes']=_0x4f635f[_0x0e01('0x4a')][_0x0e01('0x4b')]?_0x4f635f['attributes']:_0x593d27['model'];if(!_0x338589['query'][_0x0e01('0x4c')]('nolimit')){_0x4f635f[_0x0e01('0x20')]=qs['limit'](_0x338589[_0x0e01('0x33')][_0x0e01('0x20')]);_0x4f635f[_0x0e01('0x1e')]=qs[_0x0e01('0x1e')](_0x338589[_0x0e01('0x33')][_0x0e01('0x1e')]);}_0x4f635f[_0x0e01('0x4d')]=qs['sort'](_0x338589[_0x0e01('0x33')][_0x0e01('0x4e')]);_0x4f635f[_0x0e01('0x4f')]=qs['filters'](_[_0x0e01('0x50')](_0x338589['query'],_0x593d27[_0x0e01('0x35')]),_0x2990df);if(_0x338589['query'][_0x0e01('0x51')]){_0x4f635f[_0x0e01('0x4f')]=_[_0x0e01('0x52')](_0x4f635f[_0x0e01('0x4f')],{'$or':_[_0x0e01('0x2e')](_0x2990df,function(_0x4cf52a){if(_0x4cf52a[_0x0e01('0x53')]!==_0x0e01('0x54')){var _0x39eedb={};_0x39eedb[_0x4cf52a['name']]={'$like':'%'+_0x338589['query'][_0x0e01('0x51')]+'%'};return _0x39eedb;}})});}_0x4f635f=_[_0x0e01('0x52')]({},_0x4f635f,_0x338589['options']);var _0xb0c542={'where':_0x4f635f['where']};return db[_0x0e01('0x2f')][_0x0e01('0x21')](_0xb0c542)[_0x0e01('0x27')](function(_0x4a66cf){_0x292044[_0x0e01('0x21')]=_0x4a66cf;if(_0x338589[_0x0e01('0x33')][_0x0e01('0x55')]){_0x4f635f[_0x0e01('0x56')]=[{'all':!![]}];}return db['CmHopper'][_0x0e01('0x57')](_0x4f635f);})['then'](function(_0x5121cf){_0x292044[_0x0e01('0x58')]=_0x5121cf;return _0x292044;})[_0x0e01('0x27')](respondWithFilteredResult(_0x5caf78,_0x4f635f))[_0x0e01('0x59')](handleError(_0x5caf78,null));};exports[_0x0e01('0x5a')]=function(_0x3dcc18,_0x45ac0d){var _0x562258={'raw':!![],'where':{'id':_0x3dcc18[_0x0e01('0x5b')]['id']}},_0xf2b82d={};_0xf2b82d[_0x0e01('0x32')]=_[_0x0e01('0x5c')](db[_0x0e01('0x2f')][_0x0e01('0x5d')]);_0xf2b82d[_0x0e01('0x33')]=_[_0x0e01('0x5c')](_0x3dcc18[_0x0e01('0x33')]);_0xf2b82d[_0x0e01('0x35')]=_['intersection'](_0xf2b82d[_0x0e01('0x32')],_0xf2b82d['query']);_0x562258[_0x0e01('0x4a')]=_[_0x0e01('0x34')](_0xf2b82d[_0x0e01('0x32')],qs['fields'](_0x3dcc18[_0x0e01('0x33')][_0x0e01('0x49')]));_0x562258[_0x0e01('0x4a')]=_0x562258[_0x0e01('0x4a')][_0x0e01('0x4b')]?_0x562258[_0x0e01('0x4a')]:_0xf2b82d['model'];if(_0x3dcc18[_0x0e01('0x33')][_0x0e01('0x55')]){_0x562258[_0x0e01('0x56')]=[{'all':!![]}];}_0x562258=_['merge']({},_0x562258,_0x3dcc18['options']);return db['CmHopper'][_0x0e01('0x5e')](_0x562258)[_0x0e01('0x27')](handleEntityNotFound(_0x45ac0d,null))['then'](respondWithResult(_0x45ac0d,null))[_0x0e01('0x59')](handleError(_0x45ac0d,null));};exports['create']=function(_0x484af5,_0x2ac478){return db[_0x0e01('0x2f')]['create'](_0x484af5[_0x0e01('0x5f')],{})[_0x0e01('0x27')](respondWithResult(_0x2ac478,0xc9))['catch'](handleError(_0x2ac478,null));};exports['update']=function(_0x273f31,_0x22dd9e){if(_0x273f31[_0x0e01('0x5f')]['id']){delete _0x273f31[_0x0e01('0x5f')]['id'];}return db[_0x0e01('0x2f')][_0x0e01('0x5e')]({'where':{'id':_0x273f31['params']['id']}})[_0x0e01('0x27')](handleEntityNotFound(_0x22dd9e,null))[_0x0e01('0x27')](saveUpdates(_0x273f31[_0x0e01('0x5f')],null))['then'](respondWithResult(_0x22dd9e,null))[_0x0e01('0x59')](handleError(_0x22dd9e,null));};exports['describe']=function(_0x455223,_0x47524a){return db[_0x0e01('0x2f')][_0x0e01('0x60')]()['then'](respondWithResult(_0x47524a,null))[_0x0e01('0x59')](handleError(_0x47524a,null));};exports[_0x0e01('0x28')]=function(_0x147303,_0x36d0ff){var _0x4480f7;var _0x3bb5c9=_0x147303[_0x0e01('0x5b')]['id'];return db[_0x0e01('0x2f')][_0x0e01('0x5e')]({'where':{'id':_0x147303[_0x0e01('0x5b')]['id']}})['then'](handleEntityNotFound(_0x36d0ff,null))['then'](function(_0x1a44bc){if(_0x1a44bc){return _0x1a44bc[_0x0e01('0x28')]()[_0x0e01('0x27')](function(_0x3ad650){return _0x3ad650;});}})[_0x0e01('0x27')](function(_0x19e0da){_0x4480f7=_0x19e0da;if(_0x19e0da){if(_0x19e0da[_0x0e01('0x61')]||_0x19e0da['CampaignId']){return db[_0x19e0da['VoiceQueueId']?_0x0e01('0x62'):'Campaign'][_0x0e01('0x5e')]({'where':{'id':_0x19e0da[_0x0e01('0x61')]?_0x19e0da[_0x0e01('0x61')]:_0x19e0da[_0x0e01('0x63')]},'attributes':['id',_0x0e01('0x2c')],'raw':!![]});}}})[_0x0e01('0x27')](function(_0x43a640){var _0x85a38f={};if(_0x43a640){_[_0x0e01('0x52')](_0x85a38f,_[_0x0e01('0x64')](_0x4480f7[_0x0e01('0x65')],['createdAt',_0x0e01('0x66'),'id']));_0x85a38f[_0x0e01('0x67')]=0x15;_0x85a38f[_0x0e01('0x68')]='deleted';_0x85a38f['campaign']=_0x43a640[_0x0e01('0x2c')];_0x85a38f[_0x0e01('0x69')]=_0x147303[_0x0e01('0x6a')][_0x0e01('0x2c')];_0x85a38f[_0x0e01('0x6b')]=_0x147303[_0x0e01('0x6a')]['id'];_0x85a38f['deleted']=!![];_0x85a38f[_0x0e01('0x6c')]=moment()[_0x0e01('0x6d')](_0x0e01('0x6e'));_0x85a38f['calleridnum']=_0x4480f7[_0x0e01('0x6f')];_0x85a38f[_0x0e01('0x70')]=_0x4480f7['VoiceQueueId']?_0x0e01('0x71'):_0x0e01('0x72');return db[_0x0e01('0x73')][_0x0e01('0x5e')]({'where':{'id':_0x85a38f['ContactId']},'attributes':[_0x0e01('0x74'),_0x0e01('0x75')]})[_0x0e01('0x27')](function(_0x411cc9){if(!_['isNil'](_0x36d0ff)&&!_[_0x0e01('0x76')](_0x411cc9[_0x0e01('0x74')])){_0x85a38f[_0x0e01('0x77')]=_0x411cc9['firstName'];if(!_['isNil'](_0x411cc9[_0x0e01('0x75')])){_0x85a38f['calleridname']+='\x20'+_0x411cc9[_0x0e01('0x75')];}}})[_0x0e01('0x78')](function(){return db['CmHopperFinal'][_0x0e01('0x79')](_0x85a38f);});}})['then'](function(_0x38f1c4){return db[_0x0e01('0x7a')][_0x0e01('0x28')]({'where':{'CmHopperId':_0x3bb5c9}});})[_0x0e01('0x27')](function(){return _0x36d0ff['status'](0xcc)[_0x0e01('0x1c')]();})[_0x0e01('0x59')](handleError(_0x36d0ff,null));};exports[_0x0e01('0x7b')]=function(_0x154caf,_0x1efed5,_0x374e79){var _0x524107=[];return db['CmContact'][_0x0e01('0x60')]()[_0x0e01('0x27')](function(_0xaa41c7){_0x524107=_[_0x0e01('0x5c')](_0xaa41c7);return _0x154caf[_0x0e01('0x6a')][_0x0e01('0x7c')]({'where':{'type':_0x0e01('0x7d'),'dialActive':!![],'dialMethod':_0x0e01('0x7e')},'attributes':['id','dialOrderByScheduledAt',_0x0e01('0x7f')],'raw':!![]});})[_0x0e01('0x27')](function(_0x32ad68){if(_0x32ad68&&_0x32ad68['length']){return db[_0x0e01('0x80')][_0x0e01('0x81')](function(_0x501309){var _0x2a4e21={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0e01('0x6d')](_0x0e01('0x6e'))},'VoiceQueueId':{'$in':_['map'](_0x32ad68,'id')},'$or':[{'UserId':null},{'UserId':_0x154caf[_0x0e01('0x6a')]['id']}]};var _0x56d7b4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x32ad68)[_0x0e01('0x51')]([_0x0e01('0x7f'),0x0])[_0x0e01('0x2e')]('id')[_0x0e01('0x82')]()},'$or':[{'UserId':null},{'UserId':_0x154caf[_0x0e01('0x6a')]['id']}]};var _0x1e2328={'$or':[_0x2a4e21,_0x56d7b4]};var _0x2870ff=[];if(_0x154caf['body']['direction']&&_0x154caf[_0x0e01('0x5f')][_0x0e01('0x83')]===_0x0e01('0x84')){if(!_[_0x0e01('0x85')](_0x154caf[_0x0e01('0x5f')][_0x0e01('0x86')])){_0x1e2328['id']={'$in':_0x154caf[_0x0e01('0x5f')]['hopperIds']};}_0x2870ff=[[_0x0e01('0x87'),_0x0e01('0x88')],['scheduledAt',_0x32ad68[0x0][_0x0e01('0x89')]==='ASC'?'DESC':'ASC'],db[_0x0e01('0x80')][_0x0e01('0x8a')](_0x0e01('0x8b')),['id','DESC']];}else{if(!_[_0x0e01('0x85')](_0x154caf[_0x0e01('0x5f')][_0x0e01('0x86')])){_0x1e2328['id']={'$notIn':_0x154caf[_0x0e01('0x5f')][_0x0e01('0x86')]};}_0x2870ff=[[_0x0e01('0x87'),_0x0e01('0x8c')],[_0x0e01('0x8d'),_0x32ad68[0x0]['dialOrderByScheduledAt']],db[_0x0e01('0x80')][_0x0e01('0x8a')](_0x0e01('0x8e')),['id',_0x0e01('0x88')]];}return db[_0x0e01('0x2f')][_0x0e01('0x8f')]({'attributes':['id',_0x0e01('0x90'),_0x0e01('0x6f'),_0x0e01('0x91')],'where':_0x1e2328,'order':_0x2870ff,'transaction':_0x501309,'lock':_0x501309[_0x0e01('0x92')][_0x0e01('0x93')],'include':[{'model':db[_0x0e01('0x73')],'as':'Contact','attributes':_0x524107,'include':[{'model':db[_0x0e01('0x94')],'as':'Company','attributes':['id',_0x0e01('0x2c')]}]},{'model':db[_0x0e01('0x95')],'as':_0x0e01('0x96'),'attributes':['id',_0x0e01('0x2c')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x0e01('0x2c'),_0x0e01('0x97')]}]})['then'](function(_0x22a7d8){if(_0x22a7d8){return _0x22a7d8['update']({'UserId':_0x154caf[_0x0e01('0x6a')]['id']},{'transaction':_0x501309});}});});}})[_0x0e01('0x27')](handleEntityNotFound(_0x1efed5,null))[_0x0e01('0x27')](respondWithResult(_0x1efed5,null))[_0x0e01('0x59')](handleError(_0x1efed5,null));};exports[_0x0e01('0x98')]=function(_0x1d96d4,_0x2e7d53,_0x2b4e1d){var _0x201237=[];return db[_0x0e01('0x73')][_0x0e01('0x60')]()[_0x0e01('0x27')](function(_0x1123e9){_0x201237=_[_0x0e01('0x5c')](_0x1123e9);return _0x1d96d4['user'][_0x0e01('0x7c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x0e01('0x89'),_0x0e01('0x7f')],'raw':!![]});})['then'](function(_0x27bede){if(_0x27bede&&_0x27bede['length']){return db[_0x0e01('0x80')][_0x0e01('0x81')](function(_0x4f28fe){var _0x304150={'active':![],'recallme':!![],'id':_0x1d96d4[_0x0e01('0x5f')][_0x0e01('0x99')]};return db['CmHopper'][_0x0e01('0x8f')]({'attributes':['id',_0x0e01('0x90'),_0x0e01('0x91')],'where':_0x304150,'transaction':_0x4f28fe,'lock':_0x4f28fe[_0x0e01('0x92')]['UPDATE'],'include':[{'model':db[_0x0e01('0x73')],'as':'Contact','attributes':_0x201237,'include':[{'model':db[_0x0e01('0x94')],'as':'Company','attributes':['id',_0x0e01('0x2c')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x0e01('0x2c')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x0e01('0x2c'),_0x0e01('0x97')]}]})[_0x0e01('0x27')](function(_0x1d4826){if(_0x1d4826){return _0x1d4826[_0x0e01('0x26')]({'UserId':_0x1d96d4['user']['id']},{'transaction':_0x4f28fe});}});});}})[_0x0e01('0x27')](handleEntityNotFound(_0x2e7d53,null))[_0x0e01('0x27')](respondWithResult(_0x2e7d53,null))[_0x0e01('0x59')](handleError(_0x2e7d53,null));};exports[_0x0e01('0x9a')]=function(_0x1be019,_0x11f28e,_0x1b44b4){return _0x1be019[_0x0e01('0x6a')][_0x0e01('0x7c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x0e01('0x27')](function(_0x17ce55){if(_0x17ce55&&_0x17ce55[_0x0e01('0x4b')]){return db['CmHopper'][_0x0e01('0x21')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0e01('0x6d')](_0x0e01('0x6e'))},'VoiceQueueId':{'$in':_[_0x0e01('0x2e')](_0x17ce55,'id')},'$or':[{'UserId':null},{'UserId':_0x1be019[_0x0e01('0x6a')]['id']}]}});}return 0x0;})[_0x0e01('0x27')](function(_0x5a6b5d){if(!_[_0x0e01('0x76')](_0x5a6b5d)&&_['isNumber'](_0x5a6b5d)){return _0x11f28e[_0x0e01('0x1b')](0xc8)[_0x0e01('0x1d')]({'contacts':_0x5a6b5d});}else{logger[_0x0e01('0x2a')](_0x0e01('0x9b'),_0x0e01('0x9a'),0x194,'entity\x20not\x20found');_0x11f28e[_0x0e01('0x29')](0x194);}})['catch'](handleError(_0x11f28e,null));};exports[_0x0e01('0x9c')]=function(_0x5f26d8,_0x383d03,_0x502437){var _0x4f2e6d=shared[_0x0e01('0x9d')];var _0x343eb1=[];_[_0x0e01('0x2e')](_0x4f2e6d,function(_0x277afc){_0x343eb1['push']({'id':_0x277afc[_0x0e01('0x2c')],'name':_0x277afc[_0x0e01('0x2c')],'utcOffset':_0x277afc['utcOffset']});});return _0x383d03[_0x0e01('0x1b')](0xc8)[_0x0e01('0x1d')]({'tz':_0x343eb1});};exports[_0x0e01('0x9e')]=function(_0x28781d,_0x44da5b,_0x20bbe0){var _0x49e96d=shared[_0x0e01('0x9d')];var _0x168737={};if(!_[_0x0e01('0x76')](_0x49e96d[_0x28781d[_0x0e01('0x5f')]['id']]))_0x168737=_0x49e96d[_0x28781d[_0x0e01('0x5f')]['id']];return _0x44da5b['status'](0xc8)[_0x0e01('0x1d')](_0x168737);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 2a368d7..be4ec3f 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 _0xba34=['priority','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x338581,_0x85c756){var _0x306123=function(_0x127017){while(--_0x127017){_0x338581['push'](_0x338581['shift']());}};_0x306123(++_0x85c756);}(_0xba34,0x119));var _0x4ba3=function(_0x4b933f,_0x56ba89){_0x4b933f=_0x4b933f-0x0;var _0x992c9d=_0xba34[_0x4b933f];return _0x992c9d;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('CmHopper',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]},{'name':_0x4ba3('0xc'),'fields':[_0x4ba3('0xc')]},{'name':_0x4ba3('0xd'),'fields':[_0x4ba3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]},{'name':_0xb71a('0xd'),'fields':[_0xb71a('0xd')]},{'name':_0xb71a('0xe'),'fields':[_0xb71a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index fb72fbc..6969e2a 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 _0x1268=['create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','findAll','CmContact','Contact','User','Agent','name','voicePause','push','includes','update','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','active','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','GetContactRecallMe','order','UserId','LOCK','UPDATE','all','keys','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','then','info','request\x20sent','debug','error','code','CmHopper,\x20%s,\x20%s','message','result','options','raw','where','attributes','limit','include','map','model','GetCmHopper','stringify','catch','ShowCmHopper','CreateCmHopper','CmHopper'];(function(_0x1fab34,_0x1623f9){var _0x4dd496=function(_0x5f0b8b){while(--_0x5f0b8b){_0x1fab34['push'](_0x1fab34['shift']());}};_0x4dd496(++_0x1623f9);}(_0x1268,0xdc));var _0x8126=function(_0x170fdd,_0x13f741){_0x170fdd=_0x170fdd-0x0;var _0x37905f=_0x1268[_0x170fdd];return _0x37905f;};'use strict';var _=require('lodash');var util=require(_0x8126('0x0'));var moment=require(_0x8126('0x1'));var BPromise=require('bluebird');var rs=require(_0x8126('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8126('0x3'));var logger=require(_0x8126('0x4'))(_0x8126('0x5'));var config=require(_0x8126('0x6'));var jayson=require(_0x8126('0x7'));const {validateExpressRequest}=require(_0x8126('0x8'));var client=jayson[_0x8126('0x9')][_0x8126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4208b6,_0x5cb1f8,_0x364678){return new BPromise(function(_0x4587f3,_0x340ad9){return client[_0x8126('0xb')](_0x4208b6,_0x364678)[_0x8126('0xc')](function(_0x51877d){logger[_0x8126('0xd')]('CmHopper,\x20%s,\x20%s',_0x5cb1f8,_0x8126('0xe'));logger[_0x8126('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5cb1f8,_0x8126('0xe'),JSON['stringify'](_0x51877d));if(_0x51877d['error']){if(_0x51877d[_0x8126('0x10')][_0x8126('0x11')]===0x1f4){logger[_0x8126('0x10')](_0x8126('0x12'),_0x5cb1f8,_0x51877d[_0x8126('0x10')][_0x8126('0x13')]);return _0x340ad9(_0x51877d['error'][_0x8126('0x13')]);}logger['error'](_0x8126('0x12'),_0x5cb1f8,_0x51877d[_0x8126('0x10')]['message']);return _0x4587f3(_0x51877d[_0x8126('0x10')][_0x8126('0x13')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x5cb1f8,_0x8126('0xe'));_0x4587f3(_0x51877d[_0x8126('0x14')][_0x8126('0x13')]);}})['catch'](function(_0x5272b7){logger[_0x8126('0x10')](_0x8126('0x12'),_0x5cb1f8,_0x5272b7);_0x340ad9(_0x5272b7);});});}exports['GetCmHopper']=function(_0x1ff066){var _0xbf0166=this;return new Promise(function(_0x442caa,_0x45d83a){return db['CmHopper']['findAll']({'raw':_0x1ff066[_0x8126('0x15')]?_0x1ff066['options'][_0x8126('0x16')]===undefined?!![]:![]:!![],'where':_0x1ff066[_0x8126('0x15')]?_0x1ff066['options'][_0x8126('0x17')]||null:null,'attributes':_0x1ff066['options']?_0x1ff066['options'][_0x8126('0x18')]||null:null,'limit':_0x1ff066['options']?_0x1ff066['options'][_0x8126('0x19')]||null:null,'include':_0x1ff066[_0x8126('0x15')]?_0x1ff066[_0x8126('0x15')][_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x1ff066[_0x8126('0x15')][_0x8126('0x1a')],function(_0x430cc8){return{'model':db[_0x430cc8[_0x8126('0x1c')]],'as':_0x430cc8['as'],'attributes':_0x430cc8[_0x8126('0x18')],'include':_0x430cc8[_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x430cc8['include'],function(_0x563ec7){return{'model':db[_0x563ec7['model']],'as':_0x563ec7['as'],'attributes':_0x563ec7[_0x8126('0x18')],'include':_0x563ec7['include']?_[_0x8126('0x1b')](_0x563ec7['include'],function(_0x31dd7d){return{'model':db[_0x31dd7d[_0x8126('0x1c')]],'as':_0x31dd7d['as'],'attributes':_0x31dd7d[_0x8126('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x168c3c){logger[_0x8126('0xd')](_0x8126('0x1d'),_0x1ff066);logger['debug']('GetCmHopper',_0x1ff066,JSON[_0x8126('0x1e')](_0x168c3c));_0x442caa(_0x168c3c);})[_0x8126('0x1f')](function(_0x2765d4){logger[_0x8126('0x10')](_0x8126('0x1d'),_0x2765d4[_0x8126('0x13')],_0x1ff066);_0x45d83a(_0xbf0166[_0x8126('0x10')](0x1f4,_0x2765d4[_0x8126('0x13')]));});});};exports[_0x8126('0x20')]=function(_0x3f8590){var _0x1013c8=this;return new Promise(function(_0x160cc8,_0xe0c664){return db['CmHopper']['find']({'raw':_0x3f8590['options']?_0x3f8590[_0x8126('0x15')][_0x8126('0x16')]===undefined?!![]:![]:!![],'where':_0x3f8590[_0x8126('0x15')]?_0x3f8590[_0x8126('0x15')]['where']||null:null,'attributes':_0x3f8590[_0x8126('0x15')]?_0x3f8590[_0x8126('0x15')][_0x8126('0x18')]||null:null,'include':_0x3f8590['options']?_0x3f8590['options'][_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x3f8590[_0x8126('0x15')]['include'],function(_0x107c51){return{'model':db[_0x107c51[_0x8126('0x1c')]],'as':_0x107c51['as'],'attributes':_0x107c51['attributes'],'include':_0x107c51[_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x107c51[_0x8126('0x1a')],function(_0xfb77d0){return{'model':db[_0xfb77d0[_0x8126('0x1c')]],'as':_0xfb77d0['as'],'attributes':_0xfb77d0['attributes'],'include':_0xfb77d0[_0x8126('0x1a')]?_[_0x8126('0x1b')](_0xfb77d0[_0x8126('0x1a')],function(_0x27483d){return{'model':db[_0x27483d[_0x8126('0x1c')]],'as':_0x27483d['as'],'attributes':_0x27483d['attributes']};}):[]};}):[]};}):[]:[]})[_0x8126('0xc')](function(_0x4431eb){logger[_0x8126('0xd')](_0x8126('0x20'),_0x3f8590);logger[_0x8126('0xf')](_0x8126('0x20'),_0x3f8590,JSON[_0x8126('0x1e')](_0x4431eb));_0x160cc8(_0x4431eb);})[_0x8126('0x1f')](function(_0x3ae1d4){logger['error'](_0x8126('0x20'),_0x3ae1d4[_0x8126('0x13')],_0x3f8590);_0xe0c664(_0x1013c8['error'](0x1f4,_0x3ae1d4['message']));});});};exports[_0x8126('0x21')]=function(_0xdda953){var _0x31182a=this;return new Promise(function(_0x43fed8,_0x5841fc){return db[_0x8126('0x22')][_0x8126('0x23')](_0xdda953[_0x8126('0x24')],{'raw':_0xdda953[_0x8126('0x15')]?_0xdda953[_0x8126('0x15')][_0x8126('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x47f70c){logger[_0x8126('0xd')](_0x8126('0x21'),_0xdda953);logger[_0x8126('0xf')](_0x8126('0x21'),_0xdda953,JSON['stringify'](_0x47f70c));_0x43fed8(_0x47f70c);})['catch'](function(_0x391966){logger[_0x8126('0x10')](_0x8126('0x21'),_0x391966[_0x8126('0x13')],_0xdda953);_0x5841fc(_0x31182a[_0x8126('0x10')](0x1f4,_0x391966['message']));});});};exports[_0x8126('0x25')]=function(_0x1be7a4){var _0x587eed=this;return new Promise(function(_0x5df3a1,_0x56ab68){return db[_0x8126('0x22')]['update'](_0x1be7a4[_0x8126('0x24')],{'raw':_0x1be7a4[_0x8126('0x15')]?_0x1be7a4[_0x8126('0x15')][_0x8126('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1be7a4[_0x8126('0x15')]?_0x1be7a4[_0x8126('0x15')][_0x8126('0x17')]||null:null,'attributes':_0x1be7a4[_0x8126('0x15')]?_0x1be7a4['options']['attributes']||null:null,'limit':_0x1be7a4[_0x8126('0x15')]?_0x1be7a4[_0x8126('0x15')]['limit']||null:null})['then'](function(_0x5963a4){logger[_0x8126('0xd')](_0x8126('0x25'),_0x1be7a4);logger[_0x8126('0xd')](_0x8126('0x26'),JSON[_0x8126('0x1e')](_0x1be7a4['options'][_0x8126('0x17')]),_0x1be7a4[_0x8126('0x24')]['active']);logger[_0x8126('0xf')](_0x8126('0x25'),_0x1be7a4,JSON[_0x8126('0x1e')](_0x5963a4));_0x5df3a1(_0x5963a4);})[_0x8126('0x1f')](function(_0x202566){logger['error']('UpdateCmHopper',_0x202566[_0x8126('0x13')],_0x1be7a4);_0x56ab68(_0x587eed[_0x8126('0x10')](0x1f4,_0x202566[_0x8126('0x13')]));});});};exports[_0x8126('0x27')]=function(_0x1b9ee4){var _0x31c476=this;return new Promise(function(_0x2c5ccf,_0x1d3a54){return db['CmHopper']['destroy']({'where':_0x1b9ee4['options']?_0x1b9ee4[_0x8126('0x15')][_0x8126('0x17')]||null:null})[_0x8126('0xc')](function(_0x3fa291){logger[_0x8126('0xd')](_0x8126('0x27'),_0x1b9ee4);logger['debug'](_0x8126('0x27'),_0x1b9ee4,JSON[_0x8126('0x1e')](_0x3fa291));_0x2c5ccf(_0x3fa291);})[_0x8126('0x1f')](function(_0x1cd12b){logger[_0x8126('0x10')](_0x8126('0x27'),_0x1cd12b['message'],_0x1b9ee4);_0x1d3a54(_0x31c476[_0x8126('0x10')](0x1f4,_0x1cd12b[_0x8126('0x13')]));});});};exports[_0x8126('0x28')]=function(_0xb898b2){var _0x41cb22=this;return new Promise(function(_0x516126,_0x41c7b2){return db['CmContact'][_0x8126('0x29')]()[_0x8126('0xc')](function(_0x3831b5){return db[_0x8126('0x2a')][_0x8126('0x2b')](function(_0x5d6dd6){return db[_0x8126('0x22')][_0x8126('0x2c')]({'where':_0xb898b2[_0x8126('0x15')]?_0xb898b2['options']['where']||null:null,'attributes':_0xb898b2[_0x8126('0x15')]?_0xb898b2[_0x8126('0x15')]['attributes']||null:null,'limit':_0xb898b2['options']?_0xb898b2[_0x8126('0x15')][_0x8126('0x19')]||null:null,'order':_0xb898b2[_0x8126('0x15')]?_0xb898b2[_0x8126('0x15')]['order']||null:null,'transaction':_0x5d6dd6,'lock':_0x5d6dd6['LOCK']['UPDATE'],'include':[{'model':db[_0x8126('0x2d')],'as':_0x8126('0x2e'),'attributes':_['keys'](_0x3831b5)},{'model':db[_0x8126('0x2f')],'as':_0x8126('0x30'),'attributes':['id',_0x8126('0x31'),_0x8126('0x32')]}]})[_0x8126('0xc')](function(_0x16e40a){var _0x1ecd1a=[];var _0x48a4b9=[];for(var _0x5d5b02=0x0;_0x5d5b02<_0x16e40a['length'];_0x5d5b02+=0x1){var _0x51bee6=_0x16e40a[_0x5d5b02]['UserId'];if(_0x51bee6===null){_0x1ecd1a[_0x8126('0x33')](_0x16e40a[_0x5d5b02]['update'](_0xb898b2[_0x8126('0x24')],{'transaction':_0x5d6dd6}));}else if(!_0x48a4b9[_0x8126('0x34')](_0x51bee6)){_0x48a4b9[_0x8126('0x33')](_0x51bee6);_0x1ecd1a[_0x8126('0x33')](_0x16e40a[_0x5d5b02][_0x8126('0x35')](_0xb898b2[_0x8126('0x24')],{'transaction':_0x5d6dd6}));}}return BPromise['all'](_0x1ecd1a);});})[_0x8126('0xc')](function(_0xaf5c68){logger[_0x8126('0xd')]('GetContactDialer',_0xb898b2);if(_0xaf5c68[_0x8126('0x36')]>0x0){logger[_0x8126('0xd')](_0x8126('0x37'),_0xaf5c68[0x0]['dataValues']['id'],_0xaf5c68[0x0]['dataValues']['ContactId'],_0xaf5c68[0x0]['dataValues'][_0x8126('0x38')]);}logger['debug'](_0x8126('0x28'),_0xb898b2,JSON[_0x8126('0x1e')](_0xaf5c68));_0x516126(_0xaf5c68);})[_0x8126('0x1f')](function(_0x57c9a9){logger[_0x8126('0x10')](_0x8126('0x28'),_0x57c9a9[_0x8126('0x13')],_0xb898b2);_0x41c7b2(_0x41cb22[_0x8126('0x10')](0x1f4,_0x57c9a9[_0x8126('0x13')]));});});});};exports[_0x8126('0x39')]=function(_0x352eee){var _0x4ae9b2=this;return new Promise(function(_0x11685a,_0x333670){return db['sequelize']['transaction'](function(_0x55e34d){return db[_0x8126('0x3a')][_0x8126('0x23')](_0x352eee[_0x8126('0x24')],{'raw':_0x352eee[_0x8126('0x15')]?_0x352eee[_0x8126('0x15')][_0x8126('0x16')]===undefined?!![]:![]:!![],'transaction':_0x55e34d})[_0x8126('0xc')](function(){logger[_0x8126('0xd')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8126('0x1e')](_0x352eee[_0x8126('0x15')][_0x8126('0x17')]),_0x352eee['options'][_0x8126('0x17')]['active']);return db[_0x8126('0x22')]['destroy']({'where':_0x352eee[_0x8126('0x15')]?_0x352eee[_0x8126('0x15')]['where']||null:null,'transaction':_0x55e34d});});})[_0x8126('0xc')](function(_0x43898f){logger[_0x8126('0xd')]('MoveContactManagedDialer',_0x352eee);logger[_0x8126('0xf')](_0x8126('0x39'),_0x352eee,JSON[_0x8126('0x1e')](_0x43898f));_0x11685a(_0x43898f);})['catch'](function(_0x183efb){logger[_0x8126('0x10')]('MoveContactManagedDialer',_0x183efb[_0x8126('0x13')],_0x352eee);_0x333670(_0x4ae9b2[_0x8126('0x10')](0x1f4,_0x183efb['message']));});});};exports[_0x8126('0x3b')]=function(_0x26750c){var _0x4507f9=this;return new Promise(function(_0x23d404,_0xce7b9f){return db['CmHopper'][_0x8126('0x2c')]({'raw':_0x26750c[_0x8126('0x15')]?_0x26750c[_0x8126('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x26750c[_0x8126('0x15')]?_0x26750c[_0x8126('0x15')][_0x8126('0x17')]||null:null,'attributes':[[db['sequelize']['fn'](_0x8126('0x3c'),db[_0x8126('0x2a')]['fn']('IF',db[_0x8126('0x2a')][_0x8126('0x3d')](_0x8126('0x3e')+util[_0x8126('0x3f')](_0x8126('0x40'),moment()[_0x8126('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x8126('0x41')))),'contactsRescheduled']]})[_0x8126('0xc')](function(_0x2059a6){logger[_0x8126('0xd')](_0x8126('0x3b'),_0x26750c);logger['debug'](_0x8126('0x3b'),_0x26750c,JSON['stringify'](_0x2059a6));_0x23d404(_0x2059a6);})[_0x8126('0x1f')](function(_0x502b47){logger[_0x8126('0x10')](_0x8126('0x3b'),_0x502b47[_0x8126('0x13')],_0x26750c);_0xce7b9f(_0x4507f9[_0x8126('0x10')](0x1f4,_0x502b47[_0x8126('0x13')]));});});};exports[_0x8126('0x42')]=function(_0x5164c2){var _0x284ce4=this;return new Promise(function(_0x4c98fd,_0x3f2604){return db[_0x8126('0x2d')][_0x8126('0x29')]()[_0x8126('0xc')](function(_0x1fe6a8){return db['sequelize'][_0x8126('0x2b')](function(_0x2bd8d9){return db[_0x8126('0x22')][_0x8126('0x2c')]({'where':_0x5164c2['options']?_0x5164c2[_0x8126('0x15')]['where']||null:null,'attributes':_0x5164c2[_0x8126('0x15')]?_0x5164c2['options']['attributes']||null:null,'limit':0x1,'order':_0x5164c2['options']?_0x5164c2[_0x8126('0x15')][_0x8126('0x43')]||null:null,'group':db[_0x8126('0x22')][_0x8126('0x44')],'transaction':_0x2bd8d9,'lock':_0x2bd8d9[_0x8126('0x45')][_0x8126('0x46')],'include':_0x5164c2[_0x8126('0x15')]?_0x5164c2['options'][_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x5164c2[_0x8126('0x15')][_0x8126('0x1a')],function(_0x5635b8){return{'model':db[_0x5635b8[_0x8126('0x1c')]],'as':_0x5635b8['as'],'attributes':_0x5635b8[_0x8126('0x18')],'include':_0x5635b8[_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x5635b8[_0x8126('0x1a')],function(_0x2544f5){return{'model':db[_0x2544f5[_0x8126('0x1c')]],'as':_0x2544f5['as'],'attributes':_0x2544f5[_0x8126('0x18')],'include':_0x2544f5['include']?_['map'](_0x2544f5[_0x8126('0x1a')],function(_0x2ddfe4){return{'model':db[_0x2ddfe4[_0x8126('0x1c')]],'as':_0x2ddfe4['as'],'attributes':_0x2ddfe4[_0x8126('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8126('0xc')](function(_0x1d6467){var _0x310c02=[];for(var _0x1934b1=0x0;_0x1934b1<_0x1d6467[_0x8126('0x36')];_0x1934b1+=0x1){_0x310c02[_0x8126('0x33')](_0x1d6467[_0x1934b1][_0x8126('0x35')](_0x5164c2[_0x8126('0x24')],{'transaction':_0x2bd8d9}));}return BPromise[_0x8126('0x47')](_0x310c02);});})[_0x8126('0xc')](function(_0x40c8b5){logger[_0x8126('0xd')](_0x8126('0x42'),_0x5164c2);logger[_0x8126('0xf')]('GetContactRecallMe',_0x5164c2,JSON[_0x8126('0x1e')](_0x40c8b5));_0x4c98fd(_0x40c8b5);})[_0x8126('0x1f')](function(_0x493796){logger['error'](_0x8126('0x42'),_0x493796[_0x8126('0x13')],_0x5164c2);_0x3f2604(_0x284ce4[_0x8126('0x10')](0x1f4,_0x493796['message']));});});});};exports['GetCmHopperPreview']=function(_0x163148){var _0xda013b=this;return new Promise(function(_0x208e6,_0x222393){db[_0x8126('0x2d')]['describe']()[_0x8126('0xc')](function(_0xe17d54){return db[_0x8126('0x22')][_0x8126('0x2c')]({'raw':_0x163148['options']?_0x163148[_0x8126('0x15')][_0x8126('0x16')]===undefined?!![]:![]:!![],'where':_0x163148[_0x8126('0x15')]?_0x163148[_0x8126('0x15')][_0x8126('0x17')]||null:null,'attributes':_0x163148[_0x8126('0x15')]?_0x163148[_0x8126('0x15')][_0x8126('0x18')]||null:null,'limit':_0x163148['options']?_0x163148[_0x8126('0x15')][_0x8126('0x19')]||null:null,'include':_0x163148[_0x8126('0x15')]?_0x163148[_0x8126('0x15')][_0x8126('0x1a')]?_['map'](_0x163148[_0x8126('0x15')][_0x8126('0x1a')],function(_0x34e397){return{'model':db[_0x34e397[_0x8126('0x1c')]],'as':_0x34e397['as'],'attributes':_0x34e397['as']===_0x8126('0x2e')?_[_0x8126('0x48')](_0xe17d54):_0x34e397[_0x8126('0x18')],'include':_0x34e397[_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x34e397[_0x8126('0x1a')],function(_0x26f3dc){return{'model':db[_0x26f3dc[_0x8126('0x1c')]],'as':_0x26f3dc['as'],'attributes':_0x26f3dc['attributes'],'include':_0x26f3dc[_0x8126('0x1a')]?_[_0x8126('0x1b')](_0x26f3dc[_0x8126('0x1a')],function(_0x2514d3){return{'model':db[_0x2514d3[_0x8126('0x1c')]],'as':_0x2514d3['as'],'attributes':_0x2514d3[_0x8126('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8126('0xc')](function(_0x1c08da){logger[_0x8126('0xd')]('GetCmHopper',_0x163148);logger['debug'](_0x8126('0x1d'),_0x163148,JSON[_0x8126('0x1e')](_0x1c08da));_0x208e6(_0x1c08da);})[_0x8126('0x1f')](function(_0xe58e54){logger[_0x8126('0x10')]('GetCmHopper',_0xe58e54[_0x8126('0x13')],_0x163148);_0x222393(_0xda013b[_0x8126('0x10')](0x1f4,_0xe58e54['message']));});});});};exports['GetContactByPhone']=function(_0x532cd0){var _0xfc2f97=this;return new Promise(function(_0x5c0363,_0x2b73ff){return db[_0x8126('0x2d')][_0x8126('0x49')]({'raw':!![],'where':{'phone':_0x532cd0[_0x8126('0x15')][_0x8126('0x17')][_0x8126('0x4a')]},'attributes':['id',_0x8126('0x4b')],'order':[['id',_0x8126('0x4c')]]})[_0x8126('0xc')](function(_0x532dda){logger[_0x8126('0xd')](_0x8126('0x4d'),_0x532cd0);logger[_0x8126('0xf')]('getContactByPhone',_0x532cd0,JSON[_0x8126('0x1e')](_0x532dda));_0x5c0363(_0x532dda);})['catch'](function(_0x41060a){logger[_0x8126('0x10')](_0x8126('0x4d'),_0x41060a[_0x8126('0x13')],_0x532cd0);_0x2b73ff(_0xfc2f97[_0x8126('0x10')](0x1f4,_0x41060a['message']));});});};exports['ResetActiveCalls']=function(_0x5de72d){var _0x54949b=this;return new Promise(function(_0x12dbdb,_0x1ab71b){return db[_0x8126('0x2a')][_0x8126('0x2b')](function(_0x29be85){return db['CmHopper'][_0x8126('0x35')]({'active':![]},{'where':{},'transaction':_0x29be85})['then'](function(_0x8cb27d){logger[_0x8126('0xd')](_0x8126('0x4e'),_0x5de72d);logger[_0x8126('0xf')]('ResetActiveCalls',_0x5de72d,JSON[_0x8126('0x1e')](_0x8cb27d));_0x12dbdb(_0x8cb27d);})[_0x8126('0x1f')](function(_0x4ae8cb){logger[_0x8126('0x10')]('ResetActiveCalls',_0x4ae8cb[_0x8126('0x13')],_0x5de72d);_0x1ab71b(_0x54949b[_0x8126('0x10')](0x1f4,_0x4ae8cb['message']));});});});};exports[_0x8126('0x4f')]=function(_0x383d8c){var _0x232488=this;var _0x538342=_0x383d8c[_0x8126('0x24')][_0x8126('0x17')][_0x8126('0x50')];var _0x20d553=_0x383d8c[_0x8126('0x24')][_0x8126('0x17')][_0x8126('0x51')];return new Promise(function(_0x2d083b,_0xad5d1e){return db['CmHopper'][_0x8126('0x2c')]({'where':{'voiceQueueId':_0x538342,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize']['literal'](_0x8126('0x52')+_0x20d553+_0x8126('0x53'))}},'include':[{'model':db[_0x8126('0x2d')],'as':_0x8126('0x2e')},{'model':db[_0x8126('0x2f')],'as':'Agent','attributes':['id',_0x8126('0x31'),_0x8126('0x32')]},{'model':db[_0x8126('0x54')],'as':'List'}]})[_0x8126('0xc')](function(_0x24b466){return db[_0x8126('0x2a')][_0x8126('0x2b')](function(_0x56804a){return db[_0x8126('0x22')][_0x8126('0x35')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x538342,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x8126('0x2a')][_0x8126('0x3d')]('NOW()\x20+\x20INTERVAL\x20'+_0x20d553+_0x8126('0x53'))}},'transaction':_0x56804a})['then'](function(_0x234619){_0x2d083b(_0x24b466);})[_0x8126('0x1f')](function(_0x3ba031){logger[_0x8126('0x10')](_0x8126('0x4f'),_0x3ba031[_0x8126('0x13')],_0x383d8c);_0xad5d1e(validateExpressRequest);});});})['catch'](function(_0x4fe5df){logger[_0x8126('0x10')](_0x8126('0x4f'),_0x4fe5df['message'],_0x383d8c);_0xad5d1e(_0x232488['error'](0x1f4,_0x4fe5df[_0x8126('0x13')]));});});}; \ No newline at end of file +var _0xdc26=['UPDATE','Contact','User','Agent','name','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','CountReScheduled','COUNT','literal','\x22%s\x22','contactsRescheduled','GetContactRecallMe','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','\x20MINUTE','voicePause','CmList','List','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','http','then','info','request\x20sent','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','options','where','attributes','limit','include','map','model','find','raw','ShowCmHopper','debug','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','LOCK'];(function(_0x435138,_0x263f8a){var _0x57a83f=function(_0x1c35b4){while(--_0x1c35b4){_0x435138['push'](_0x435138['shift']());}};_0x57a83f(++_0x263f8a);}(_0xdc26,0xd6));var _0x6dc2=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0xdc26[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x6dc2('0x0'));var util=require(_0x6dc2('0x1'));var moment=require(_0x6dc2('0x2'));var BPromise=require(_0x6dc2('0x3'));var rs=require(_0x6dc2('0x4'));var fs=require('fs');var Redis=require(_0x6dc2('0x5'));var db=require(_0x6dc2('0x6'))['db'];var utils=require(_0x6dc2('0x7'));var logger=require(_0x6dc2('0x8'))(_0x6dc2('0x9'));var config=require(_0x6dc2('0xa'));var jayson=require(_0x6dc2('0xb'));const {validateExpressRequest}=require(_0x6dc2('0xc'));var client=jayson[_0x6dc2('0xd')][_0x6dc2('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x346d07,_0x40017a,_0x26e051){return new BPromise(function(_0x196823,_0xc75824){return client['request'](_0x346d07,_0x26e051)[_0x6dc2('0xf')](function(_0x47d5aa){logger[_0x6dc2('0x10')]('CmHopper,\x20%s,\x20%s',_0x40017a,_0x6dc2('0x11'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x40017a,'request\x20sent',JSON[_0x6dc2('0x12')](_0x47d5aa));if(_0x47d5aa['error']){if(_0x47d5aa[_0x6dc2('0x13')][_0x6dc2('0x14')]===0x1f4){logger[_0x6dc2('0x13')](_0x6dc2('0x15'),_0x40017a,_0x47d5aa[_0x6dc2('0x13')][_0x6dc2('0x16')]);return _0xc75824(_0x47d5aa[_0x6dc2('0x13')]['message']);}logger[_0x6dc2('0x13')]('CmHopper,\x20%s,\x20%s',_0x40017a,_0x47d5aa['error']['message']);return _0x196823(_0x47d5aa[_0x6dc2('0x13')][_0x6dc2('0x16')]);}else{logger[_0x6dc2('0x10')](_0x6dc2('0x15'),_0x40017a,_0x6dc2('0x11'));_0x196823(_0x47d5aa[_0x6dc2('0x17')]['message']);}})[_0x6dc2('0x18')](function(_0x52aaeb){logger[_0x6dc2('0x13')](_0x6dc2('0x15'),_0x40017a,_0x52aaeb);_0xc75824(_0x52aaeb);});});}exports[_0x6dc2('0x19')]=function(_0x74d053){var _0x1fa9ff=this;return new Promise(function(_0x1a6b72,_0x5c14c0){return db[_0x6dc2('0x1a')]['findAll']({'raw':_0x74d053[_0x6dc2('0x1b')]?_0x74d053['options']['raw']===undefined?!![]:![]:!![],'where':_0x74d053[_0x6dc2('0x1b')]?_0x74d053[_0x6dc2('0x1b')][_0x6dc2('0x1c')]||null:null,'attributes':_0x74d053[_0x6dc2('0x1b')]?_0x74d053[_0x6dc2('0x1b')][_0x6dc2('0x1d')]||null:null,'limit':_0x74d053[_0x6dc2('0x1b')]?_0x74d053[_0x6dc2('0x1b')][_0x6dc2('0x1e')]||null:null,'include':_0x74d053['options']?_0x74d053[_0x6dc2('0x1b')][_0x6dc2('0x1f')]?_[_0x6dc2('0x20')](_0x74d053[_0x6dc2('0x1b')][_0x6dc2('0x1f')],function(_0x21b953){return{'model':db[_0x21b953['model']],'as':_0x21b953['as'],'attributes':_0x21b953[_0x6dc2('0x1d')],'include':_0x21b953[_0x6dc2('0x1f')]?_['map'](_0x21b953[_0x6dc2('0x1f')],function(_0x80858){return{'model':db[_0x80858['model']],'as':_0x80858['as'],'attributes':_0x80858[_0x6dc2('0x1d')],'include':_0x80858['include']?_[_0x6dc2('0x20')](_0x80858[_0x6dc2('0x1f')],function(_0x3280ec){return{'model':db[_0x3280ec[_0x6dc2('0x21')]],'as':_0x3280ec['as'],'attributes':_0x3280ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dc2('0xf')](function(_0x2c6223){logger[_0x6dc2('0x10')](_0x6dc2('0x19'),_0x74d053);logger['debug'](_0x6dc2('0x19'),_0x74d053,JSON[_0x6dc2('0x12')](_0x2c6223));_0x1a6b72(_0x2c6223);})['catch'](function(_0x5a2f42){logger[_0x6dc2('0x13')](_0x6dc2('0x19'),_0x5a2f42[_0x6dc2('0x16')],_0x74d053);_0x5c14c0(_0x1fa9ff[_0x6dc2('0x13')](0x1f4,_0x5a2f42[_0x6dc2('0x16')]));});});};exports['ShowCmHopper']=function(_0x1f9c99){var _0x393f3b=this;return new Promise(function(_0x581491,_0x431fc3){return db[_0x6dc2('0x1a')][_0x6dc2('0x22')]({'raw':_0x1f9c99['options']?_0x1f9c99['options'][_0x6dc2('0x23')]===undefined?!![]:![]:!![],'where':_0x1f9c99[_0x6dc2('0x1b')]?_0x1f9c99['options'][_0x6dc2('0x1c')]||null:null,'attributes':_0x1f9c99[_0x6dc2('0x1b')]?_0x1f9c99[_0x6dc2('0x1b')][_0x6dc2('0x1d')]||null:null,'include':_0x1f9c99['options']?_0x1f9c99[_0x6dc2('0x1b')][_0x6dc2('0x1f')]?_['map'](_0x1f9c99['options'][_0x6dc2('0x1f')],function(_0x905ebb){return{'model':db[_0x905ebb[_0x6dc2('0x21')]],'as':_0x905ebb['as'],'attributes':_0x905ebb[_0x6dc2('0x1d')],'include':_0x905ebb['include']?_[_0x6dc2('0x20')](_0x905ebb[_0x6dc2('0x1f')],function(_0xf2d71e){return{'model':db[_0xf2d71e[_0x6dc2('0x21')]],'as':_0xf2d71e['as'],'attributes':_0xf2d71e[_0x6dc2('0x1d')],'include':_0xf2d71e[_0x6dc2('0x1f')]?_[_0x6dc2('0x20')](_0xf2d71e[_0x6dc2('0x1f')],function(_0x9ef6a6){return{'model':db[_0x9ef6a6[_0x6dc2('0x21')]],'as':_0x9ef6a6['as'],'attributes':_0x9ef6a6[_0x6dc2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4880d1){logger[_0x6dc2('0x10')](_0x6dc2('0x24'),_0x1f9c99);logger[_0x6dc2('0x25')](_0x6dc2('0x24'),_0x1f9c99,JSON[_0x6dc2('0x12')](_0x4880d1));_0x581491(_0x4880d1);})[_0x6dc2('0x18')](function(_0x18683d){logger['error'](_0x6dc2('0x24'),_0x18683d[_0x6dc2('0x16')],_0x1f9c99);_0x431fc3(_0x393f3b['error'](0x1f4,_0x18683d[_0x6dc2('0x16')]));});});};exports['CreateCmHopper']=function(_0x574db7){var _0x21971b=this;return new Promise(function(_0x2713c7,_0x1c7ff1){return db[_0x6dc2('0x1a')][_0x6dc2('0x26')](_0x574db7[_0x6dc2('0x27')],{'raw':_0x574db7[_0x6dc2('0x1b')]?_0x574db7[_0x6dc2('0x1b')][_0x6dc2('0x23')]===undefined?!![]:![]:!![]})[_0x6dc2('0xf')](function(_0x23f30a){logger['info']('CreateCmHopper',_0x574db7);logger[_0x6dc2('0x25')](_0x6dc2('0x28'),_0x574db7,JSON[_0x6dc2('0x12')](_0x23f30a));_0x2713c7(_0x23f30a);})[_0x6dc2('0x18')](function(_0x421dac){logger[_0x6dc2('0x13')](_0x6dc2('0x28'),_0x421dac[_0x6dc2('0x16')],_0x574db7);_0x1c7ff1(_0x21971b[_0x6dc2('0x13')](0x1f4,_0x421dac[_0x6dc2('0x16')]));});});};exports[_0x6dc2('0x29')]=function(_0x4e8e13){var _0x5b8e1c=this;return new Promise(function(_0x3861c5,_0x2ad83c){return db[_0x6dc2('0x1a')][_0x6dc2('0x2a')](_0x4e8e13[_0x6dc2('0x27')],{'raw':_0x4e8e13[_0x6dc2('0x1b')]?_0x4e8e13[_0x6dc2('0x1b')][_0x6dc2('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e8e13[_0x6dc2('0x1b')]?_0x4e8e13['options'][_0x6dc2('0x1c')]||null:null,'attributes':_0x4e8e13[_0x6dc2('0x1b')]?_0x4e8e13[_0x6dc2('0x1b')][_0x6dc2('0x1d')]||null:null,'limit':_0x4e8e13[_0x6dc2('0x1b')]?_0x4e8e13[_0x6dc2('0x1b')][_0x6dc2('0x1e')]||null:null})[_0x6dc2('0xf')](function(_0xff665f){logger['info'](_0x6dc2('0x29'),_0x4e8e13);logger[_0x6dc2('0x10')](_0x6dc2('0x2b'),JSON[_0x6dc2('0x12')](_0x4e8e13[_0x6dc2('0x1b')]['where']),_0x4e8e13[_0x6dc2('0x27')]['active']);logger['debug'](_0x6dc2('0x29'),_0x4e8e13,JSON[_0x6dc2('0x12')](_0xff665f));_0x3861c5(_0xff665f);})['catch'](function(_0x66f105){logger['error'](_0x6dc2('0x29'),_0x66f105[_0x6dc2('0x16')],_0x4e8e13);_0x2ad83c(_0x5b8e1c[_0x6dc2('0x13')](0x1f4,_0x66f105[_0x6dc2('0x16')]));});});};exports[_0x6dc2('0x2c')]=function(_0x1eca55){var _0x785cab=this;return new Promise(function(_0x20e230,_0x1a618c){return db[_0x6dc2('0x1a')][_0x6dc2('0x2d')]({'where':_0x1eca55[_0x6dc2('0x1b')]?_0x1eca55['options'][_0x6dc2('0x1c')]||null:null})['then'](function(_0x3bd475){logger[_0x6dc2('0x10')](_0x6dc2('0x2c'),_0x1eca55);logger[_0x6dc2('0x25')](_0x6dc2('0x2c'),_0x1eca55,JSON[_0x6dc2('0x12')](_0x3bd475));_0x20e230(_0x3bd475);})[_0x6dc2('0x18')](function(_0x58c387){logger[_0x6dc2('0x13')](_0x6dc2('0x2c'),_0x58c387[_0x6dc2('0x16')],_0x1eca55);_0x1a618c(_0x785cab[_0x6dc2('0x13')](0x1f4,_0x58c387[_0x6dc2('0x16')]));});});};exports[_0x6dc2('0x2e')]=function(_0x2f7209){var _0x51075b=this;return new Promise(function(_0xb94dc7,_0xe0314a){return db[_0x6dc2('0x2f')][_0x6dc2('0x30')]()[_0x6dc2('0xf')](function(_0x6749ca){return db[_0x6dc2('0x31')][_0x6dc2('0x32')](function(_0x482477){return db[_0x6dc2('0x1a')][_0x6dc2('0x33')]({'where':_0x2f7209[_0x6dc2('0x1b')]?_0x2f7209['options'][_0x6dc2('0x1c')]||null:null,'attributes':_0x2f7209[_0x6dc2('0x1b')]?_0x2f7209[_0x6dc2('0x1b')][_0x6dc2('0x1d')]||null:null,'limit':_0x2f7209['options']?_0x2f7209[_0x6dc2('0x1b')]['limit']||null:null,'order':_0x2f7209[_0x6dc2('0x1b')]?_0x2f7209['options']['order']||null:null,'transaction':_0x482477,'lock':_0x482477[_0x6dc2('0x34')][_0x6dc2('0x35')],'include':[{'model':db[_0x6dc2('0x2f')],'as':_0x6dc2('0x36'),'attributes':_['keys'](_0x6749ca)},{'model':db[_0x6dc2('0x37')],'as':_0x6dc2('0x38'),'attributes':['id',_0x6dc2('0x39'),'voicePause']}]})['then'](function(_0x50a0c3){var _0x136f0c=[];var _0x5303f8=[];for(var _0xfb4160=0x0;_0xfb4160<_0x50a0c3[_0x6dc2('0x3a')];_0xfb4160+=0x1){var _0x44f977=_0x50a0c3[_0xfb4160][_0x6dc2('0x3b')];if(_0x44f977===null){_0x136f0c[_0x6dc2('0x3c')](_0x50a0c3[_0xfb4160][_0x6dc2('0x2a')](_0x2f7209[_0x6dc2('0x27')],{'transaction':_0x482477}));}else if(!_0x5303f8[_0x6dc2('0x3d')](_0x44f977)){_0x5303f8[_0x6dc2('0x3c')](_0x44f977);_0x136f0c[_0x6dc2('0x3c')](_0x50a0c3[_0xfb4160]['update'](_0x2f7209[_0x6dc2('0x27')],{'transaction':_0x482477}));}}return BPromise[_0x6dc2('0x3e')](_0x136f0c);});})[_0x6dc2('0xf')](function(_0x325285){logger[_0x6dc2('0x10')]('GetContactDialer',_0x2f7209);if(_0x325285['length']>0x0){logger[_0x6dc2('0x10')](_0x6dc2('0x3f'),_0x325285[0x0][_0x6dc2('0x40')]['id'],_0x325285[0x0][_0x6dc2('0x40')][_0x6dc2('0x41')],_0x325285[0x0][_0x6dc2('0x40')][_0x6dc2('0x42')]);}logger[_0x6dc2('0x25')](_0x6dc2('0x2e'),_0x2f7209,JSON[_0x6dc2('0x12')](_0x325285));_0xb94dc7(_0x325285);})['catch'](function(_0xafbf67){logger[_0x6dc2('0x13')]('GetContactDialer',_0xafbf67[_0x6dc2('0x16')],_0x2f7209);_0xe0314a(_0x51075b[_0x6dc2('0x13')](0x1f4,_0xafbf67[_0x6dc2('0x16')]));});});});};exports[_0x6dc2('0x43')]=function(_0xebfe40){var _0x316d97=this;return new Promise(function(_0x176e44,_0x51a971){return db[_0x6dc2('0x31')][_0x6dc2('0x32')](function(_0x3e75e1){return db['CmHopperFinal'][_0x6dc2('0x26')](_0xebfe40[_0x6dc2('0x27')],{'raw':_0xebfe40[_0x6dc2('0x1b')]?_0xebfe40['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x3e75e1})[_0x6dc2('0xf')](function(){logger[_0x6dc2('0x10')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0xebfe40[_0x6dc2('0x1b')]['where']),_0xebfe40[_0x6dc2('0x1b')][_0x6dc2('0x1c')][_0x6dc2('0x42')]);return db[_0x6dc2('0x1a')][_0x6dc2('0x2d')]({'where':_0xebfe40['options']?_0xebfe40[_0x6dc2('0x1b')][_0x6dc2('0x1c')]||null:null,'transaction':_0x3e75e1});});})['then'](function(_0x14e589){logger[_0x6dc2('0x10')](_0x6dc2('0x43'),_0xebfe40);logger[_0x6dc2('0x25')](_0x6dc2('0x43'),_0xebfe40,JSON[_0x6dc2('0x12')](_0x14e589));_0x176e44(_0x14e589);})[_0x6dc2('0x18')](function(_0x140b59){logger[_0x6dc2('0x13')]('MoveContactManagedDialer',_0x140b59[_0x6dc2('0x16')],_0xebfe40);_0x51a971(_0x316d97[_0x6dc2('0x13')](0x1f4,_0x140b59[_0x6dc2('0x16')]));});});};exports[_0x6dc2('0x44')]=function(_0xde7eb1){var _0x53f487=this;return new Promise(function(_0xab7f6c,_0xa14127){return db[_0x6dc2('0x1a')]['findAll']({'raw':_0xde7eb1['options']?_0xde7eb1[_0x6dc2('0x1b')][_0x6dc2('0x23')]===undefined?!![]:![]:!![],'where':_0xde7eb1[_0x6dc2('0x1b')]?_0xde7eb1[_0x6dc2('0x1b')][_0x6dc2('0x1c')]||null:null,'attributes':[[db[_0x6dc2('0x31')]['fn'](_0x6dc2('0x45'),db[_0x6dc2('0x31')]['fn']('IF',db[_0x6dc2('0x31')][_0x6dc2('0x46')]('`scheduledat`\x20>=\x20'+util['format'](_0x6dc2('0x47'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x6dc2('0x48')]]})['then'](function(_0x36498b){logger['info'](_0x6dc2('0x44'),_0xde7eb1);logger[_0x6dc2('0x25')]('CountReScheduled',_0xde7eb1,JSON[_0x6dc2('0x12')](_0x36498b));_0xab7f6c(_0x36498b);})[_0x6dc2('0x18')](function(_0x4cd3ad){logger[_0x6dc2('0x13')](_0x6dc2('0x44'),_0x4cd3ad['message'],_0xde7eb1);_0xa14127(_0x53f487[_0x6dc2('0x13')](0x1f4,_0x4cd3ad[_0x6dc2('0x16')]));});});};exports['GetContactRecallMe']=function(_0x2cdbf8){var _0x53959e=this;return new Promise(function(_0x5b47e3,_0x431f6a){return db['CmContact'][_0x6dc2('0x30')]()[_0x6dc2('0xf')](function(_0x37cc56){return db[_0x6dc2('0x31')][_0x6dc2('0x32')](function(_0x548021){return db['CmHopper']['findAll']({'where':_0x2cdbf8[_0x6dc2('0x1b')]?_0x2cdbf8['options'][_0x6dc2('0x1c')]||null:null,'attributes':_0x2cdbf8[_0x6dc2('0x1b')]?_0x2cdbf8[_0x6dc2('0x1b')]['attributes']||null:null,'limit':0x1,'order':_0x2cdbf8['options']?_0x2cdbf8['options']['order']||null:null,'group':db[_0x6dc2('0x1a')][_0x6dc2('0x3b')],'transaction':_0x548021,'lock':_0x548021[_0x6dc2('0x34')][_0x6dc2('0x35')],'include':_0x2cdbf8[_0x6dc2('0x1b')]?_0x2cdbf8['options']['include']?_['map'](_0x2cdbf8[_0x6dc2('0x1b')][_0x6dc2('0x1f')],function(_0x2e139d){return{'model':db[_0x2e139d[_0x6dc2('0x21')]],'as':_0x2e139d['as'],'attributes':_0x2e139d[_0x6dc2('0x1d')],'include':_0x2e139d[_0x6dc2('0x1f')]?_[_0x6dc2('0x20')](_0x2e139d['include'],function(_0x27b88a){return{'model':db[_0x27b88a[_0x6dc2('0x21')]],'as':_0x27b88a['as'],'attributes':_0x27b88a['attributes'],'include':_0x27b88a[_0x6dc2('0x1f')]?_['map'](_0x27b88a[_0x6dc2('0x1f')],function(_0x22ed19){return{'model':db[_0x22ed19[_0x6dc2('0x21')]],'as':_0x22ed19['as'],'attributes':_0x22ed19[_0x6dc2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6dc2('0xf')](function(_0x48aaea){var _0x1687e7=[];for(var _0x38a538=0x0;_0x38a538<_0x48aaea[_0x6dc2('0x3a')];_0x38a538+=0x1){_0x1687e7[_0x6dc2('0x3c')](_0x48aaea[_0x38a538][_0x6dc2('0x2a')](_0x2cdbf8[_0x6dc2('0x27')],{'transaction':_0x548021}));}return BPromise[_0x6dc2('0x3e')](_0x1687e7);});})[_0x6dc2('0xf')](function(_0xb19981){logger['info'](_0x6dc2('0x49'),_0x2cdbf8);logger[_0x6dc2('0x25')]('GetContactRecallMe',_0x2cdbf8,JSON[_0x6dc2('0x12')](_0xb19981));_0x5b47e3(_0xb19981);})['catch'](function(_0x2c4e3a){logger[_0x6dc2('0x13')](_0x6dc2('0x49'),_0x2c4e3a['message'],_0x2cdbf8);_0x431f6a(_0x53959e[_0x6dc2('0x13')](0x1f4,_0x2c4e3a['message']));});});});};exports['GetCmHopperPreview']=function(_0x3e61c2){var _0xf15dee=this;return new Promise(function(_0xc4640e,_0x2a09a0){db[_0x6dc2('0x2f')][_0x6dc2('0x30')]()['then'](function(_0x4def63){return db['CmHopper']['findAll']({'raw':_0x3e61c2[_0x6dc2('0x1b')]?_0x3e61c2[_0x6dc2('0x1b')][_0x6dc2('0x23')]===undefined?!![]:![]:!![],'where':_0x3e61c2[_0x6dc2('0x1b')]?_0x3e61c2['options']['where']||null:null,'attributes':_0x3e61c2[_0x6dc2('0x1b')]?_0x3e61c2[_0x6dc2('0x1b')][_0x6dc2('0x1d')]||null:null,'limit':_0x3e61c2[_0x6dc2('0x1b')]?_0x3e61c2[_0x6dc2('0x1b')][_0x6dc2('0x1e')]||null:null,'include':_0x3e61c2[_0x6dc2('0x1b')]?_0x3e61c2[_0x6dc2('0x1b')][_0x6dc2('0x1f')]?_[_0x6dc2('0x20')](_0x3e61c2[_0x6dc2('0x1b')][_0x6dc2('0x1f')],function(_0x5241e6){return{'model':db[_0x5241e6[_0x6dc2('0x21')]],'as':_0x5241e6['as'],'attributes':_0x5241e6['as']===_0x6dc2('0x36')?_[_0x6dc2('0x4a')](_0x4def63):_0x5241e6[_0x6dc2('0x1d')],'include':_0x5241e6[_0x6dc2('0x1f')]?_[_0x6dc2('0x20')](_0x5241e6['include'],function(_0x4cf75c){return{'model':db[_0x4cf75c['model']],'as':_0x4cf75c['as'],'attributes':_0x4cf75c['attributes'],'include':_0x4cf75c[_0x6dc2('0x1f')]?_[_0x6dc2('0x20')](_0x4cf75c[_0x6dc2('0x1f')],function(_0x3d754c){return{'model':db[_0x3d754c[_0x6dc2('0x21')]],'as':_0x3d754c['as'],'attributes':_0x3d754c[_0x6dc2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6dc2('0xf')](function(_0x5960f6){logger[_0x6dc2('0x10')](_0x6dc2('0x19'),_0x3e61c2);logger[_0x6dc2('0x25')](_0x6dc2('0x19'),_0x3e61c2,JSON[_0x6dc2('0x12')](_0x5960f6));_0xc4640e(_0x5960f6);})[_0x6dc2('0x18')](function(_0x30a2f2){logger[_0x6dc2('0x13')](_0x6dc2('0x19'),_0x30a2f2[_0x6dc2('0x16')],_0x3e61c2);_0x2a09a0(_0xf15dee[_0x6dc2('0x13')](0x1f4,_0x30a2f2['message']));});});});};exports[_0x6dc2('0x4b')]=function(_0x230bdf){var _0xf8b0c5=this;return new Promise(function(_0x9ee44c,_0x8e2542){return db[_0x6dc2('0x2f')][_0x6dc2('0x4c')]({'raw':!![],'where':{'phone':_0x230bdf[_0x6dc2('0x1b')]['where'][_0x6dc2('0x4d')]},'attributes':['id',_0x6dc2('0x4e')],'order':[['id',_0x6dc2('0x4f')]]})[_0x6dc2('0xf')](function(_0x510d14){logger['info'](_0x6dc2('0x50'),_0x230bdf);logger['debug'](_0x6dc2('0x50'),_0x230bdf,JSON[_0x6dc2('0x12')](_0x510d14));_0x9ee44c(_0x510d14);})[_0x6dc2('0x18')](function(_0x5b8e88){logger[_0x6dc2('0x13')](_0x6dc2('0x50'),_0x5b8e88[_0x6dc2('0x16')],_0x230bdf);_0x8e2542(_0xf8b0c5[_0x6dc2('0x13')](0x1f4,_0x5b8e88[_0x6dc2('0x16')]));});});};exports[_0x6dc2('0x51')]=function(_0x2aa75e){var _0x52446b=this;return new Promise(function(_0x32fd8b,_0x1f9151){return db[_0x6dc2('0x31')][_0x6dc2('0x32')](function(_0x4c9ed9){return db[_0x6dc2('0x1a')][_0x6dc2('0x2a')]({'active':![]},{'where':{},'transaction':_0x4c9ed9})[_0x6dc2('0xf')](function(_0x189ba2){logger[_0x6dc2('0x10')]('ResetActiveCalls',_0x2aa75e);logger[_0x6dc2('0x25')]('ResetActiveCalls',_0x2aa75e,JSON[_0x6dc2('0x12')](_0x189ba2));_0x32fd8b(_0x189ba2);})[_0x6dc2('0x18')](function(_0xd4fb3d){logger[_0x6dc2('0x13')](_0x6dc2('0x51'),_0xd4fb3d['message'],_0x2aa75e);_0x1f9151(_0x52446b[_0x6dc2('0x13')](0x1f4,_0xd4fb3d[_0x6dc2('0x16')]));});});});};exports[_0x6dc2('0x52')]=function(_0x5cdcc1){var _0x3071b3=this;var _0xa8978=_0x5cdcc1[_0x6dc2('0x27')][_0x6dc2('0x1c')][_0x6dc2('0x53')];var _0xe3fc5e=_0x5cdcc1['body'][_0x6dc2('0x1c')][_0x6dc2('0x54')];return new Promise(function(_0x82bd48,_0x156bfa){return db[_0x6dc2('0x1a')][_0x6dc2('0x33')]({'where':{'voiceQueueId':_0xa8978,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x6dc2('0x31')][_0x6dc2('0x46')]('NOW()\x20+\x20INTERVAL\x20'+_0xe3fc5e+_0x6dc2('0x55'))}},'include':[{'model':db[_0x6dc2('0x2f')],'as':'Contact'},{'model':db[_0x6dc2('0x37')],'as':'Agent','attributes':['id',_0x6dc2('0x39'),_0x6dc2('0x56')]},{'model':db[_0x6dc2('0x57')],'as':_0x6dc2('0x58')}]})[_0x6dc2('0xf')](function(_0x26d9fe){return db[_0x6dc2('0x31')]['transaction'](function(_0x3ea698){return db[_0x6dc2('0x1a')]['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0xa8978,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x6dc2('0x31')][_0x6dc2('0x46')]('NOW()\x20+\x20INTERVAL\x20'+_0xe3fc5e+'\x20MINUTE')}},'transaction':_0x3ea698})[_0x6dc2('0xf')](function(_0x48ced8){_0x82bd48(_0x26d9fe);})[_0x6dc2('0x18')](function(_0x256d66){logger[_0x6dc2('0x13')](_0x6dc2('0x52'),_0x256d66[_0x6dc2('0x16')],_0x5cdcc1);_0x156bfa(validateExpressRequest);});});})['catch'](function(_0x52f3a3){logger[_0x6dc2('0x13')](_0x6dc2('0x52'),_0x52f3a3[_0x6dc2('0x16')],_0x5cdcc1);_0x156bfa(_0x3071b3[_0x6dc2('0x13')](0x1f4,_0x52f3a3[_0x6dc2('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 5e7ecdd..fbe272e 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 _0x5d05=['/:id','show','post','/timezone','getTimezone','getPreviewRecall','put','update','destroy','exports','multer','path','express','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones'];(function(_0x3b7c21,_0x561b3f){var _0x585333=function(_0x5d484b){while(--_0x5d484b){_0x3b7c21['push'](_0x3b7c21['shift']());}};_0x585333(++_0x561b3f);}(_0x5d05,0x104));var _0x55d0=function(_0x2bc6a2,_0x44e6ea){_0x2bc6a2=_0x2bc6a2-0x0;var _0x50f1ce=_0x5d05[_0x2bc6a2];return _0x50f1ce;};'use strict';var multer=require(_0x55d0('0x0'));var util=require('util');var path=require(_0x55d0('0x1'));var timeout=require('connect-timeout');var express=require(_0x55d0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x55d0('0x3'));var config=require(_0x55d0('0x4'));var controller=require(_0x55d0('0x5'));router[_0x55d0('0x6')]('/',auth[_0x55d0('0x7')](),controller[_0x55d0('0x8')]);router['get'](_0x55d0('0x9'),auth[_0x55d0('0x7')](),controller[_0x55d0('0xa')]);router['get'](_0x55d0('0xb'),auth[_0x55d0('0x7')](),controller[_0x55d0('0xc')]);router['get'](_0x55d0('0xd'),auth['isAuthenticated'](),controller[_0x55d0('0xe')]);router[_0x55d0('0x6')](_0x55d0('0xf'),auth[_0x55d0('0x7')](),controller[_0x55d0('0x10')]);router[_0x55d0('0x11')]('/',auth[_0x55d0('0x7')](),controller['create']);router['post']('/preview',auth[_0x55d0('0x7')](),controller['getPreview']);router[_0x55d0('0x11')](_0x55d0('0x12'),auth['isAuthenticated'](),controller[_0x55d0('0x13')]);router[_0x55d0('0x11')]('/previewrecall',auth[_0x55d0('0x7')](),controller[_0x55d0('0x14')]);router[_0x55d0('0x15')]('/:id',auth[_0x55d0('0x7')](),controller[_0x55d0('0x16')]);router['delete'](_0x55d0('0xf'),auth['isAuthenticated'](),controller[_0x55d0('0x17')]);module[_0x55d0('0x18')]=router; \ No newline at end of file +var _0x5a3f=['../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','getTimezones','/:id','post','create','/preview','getPreview','/timezone','/previewrecall','getPreviewRecall','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3d9dc2,_0x4d0f69){var _0x9f75a0=function(_0x23d927){while(--_0x23d927){_0x3d9dc2['push'](_0x3d9dc2['shift']());}};_0x9f75a0(++_0x4d0f69);}(_0x5a3f,0xed));var _0xf5a3=function(_0x5f53d8,_0x546590){_0x5f53d8=_0x5f53d8-0x0;var _0x749bc5=_0x5a3f[_0x5f53d8];return _0x749bc5;};'use strict';var multer=require(_0xf5a3('0x0'));var util=require(_0xf5a3('0x1'));var path=require(_0xf5a3('0x2'));var timeout=require(_0xf5a3('0x3'));var express=require(_0xf5a3('0x4'));var router=express[_0xf5a3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf5a3('0x6'));var config=require(_0xf5a3('0x7'));var controller=require(_0xf5a3('0x8'));router[_0xf5a3('0x9')]('/',auth[_0xf5a3('0xa')](),controller[_0xf5a3('0xb')]);router['get']('/describe',auth[_0xf5a3('0xa')](),controller[_0xf5a3('0xc')]);router[_0xf5a3('0x9')](_0xf5a3('0xd'),auth[_0xf5a3('0xa')](),controller[_0xf5a3('0xe')]);router[_0xf5a3('0x9')]('/timezones',auth[_0xf5a3('0xa')](),controller[_0xf5a3('0xf')]);router[_0xf5a3('0x9')](_0xf5a3('0x10'),auth[_0xf5a3('0xa')](),controller['show']);router[_0xf5a3('0x11')]('/',auth['isAuthenticated'](),controller[_0xf5a3('0x12')]);router[_0xf5a3('0x11')](_0xf5a3('0x13'),auth[_0xf5a3('0xa')](),controller[_0xf5a3('0x14')]);router[_0xf5a3('0x11')](_0xf5a3('0x15'),auth[_0xf5a3('0xa')](),controller['getTimezone']);router[_0xf5a3('0x11')](_0xf5a3('0x16'),auth[_0xf5a3('0xa')](),controller[_0xf5a3('0x17')]);router[_0xf5a3('0x18')](_0xf5a3('0x10'),auth[_0xf5a3('0xa')](),controller['update']);router['delete'](_0xf5a3('0x10'),auth[_0xf5a3('0xa')](),controller[_0xf5a3('0x19')]);module[_0xf5a3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 7209e57..5e610e4 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 _0x8ff0=['moment','sequelize','exports','STRING','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x8ff0,0x1e0));var _0x08ff=function(_0x56f2e4,_0x453f62){_0x56f2e4=_0x56f2e4-0x0;var _0x311606=_0x8ff0[_0x56f2e4];return _0x311606;};'use strict';var moment=require(_0x08ff('0x0'));var Sequelize=require(_0x08ff('0x1'));module[_0x08ff('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x08ff('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x08ff('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x08ff('0x5')],'defaultValue':moment()[_0x08ff('0x6')](_0x08ff('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x08ff('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x08ff('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x08ff('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x08ff('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x08ff('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e0f=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','moment','sequelize','DATE','format'];(function(_0x4bb441,_0x2ef5f1){var _0x4ad319=function(_0xfc76af){while(--_0xfc76af){_0x4bb441['push'](_0x4bb441['shift']());}};_0x4ad319(++_0x2ef5f1);}(_0x8e0f,0x140));var _0xf8e0=function(_0x1e6600,_0x576d88){_0x1e6600=_0x1e6600-0x0;var _0x1b54db=_0x8e0f[_0x1e6600];return _0x1b54db;};'use strict';var moment=require(_0xf8e0('0x0'));var Sequelize=require(_0xf8e0('0x1'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xf8e0('0x2')],'defaultValue':moment()[_0xf8e0('0x3')](_0xf8e0('0x4'))},'countbusyretry':{'type':Sequelize[_0xf8e0('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf8e0('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf8e0('0x5')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xf8e0('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf8e0('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf8e0('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf8e0('0x5')],'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 ca0544f..1591fca 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 _0x72fb=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','sendStatus','error','stack','name','send','index','map','CmHopperAdditionalPhone','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x2068b0,_0x167f45){var _0x4d7a50=function(_0x1b1023){while(--_0x1b1023){_0x2068b0['push'](_0x2068b0['shift']());}};_0x4d7a50(++_0x167f45);}(_0x72fb,0x136));var _0xb72f=function(_0x580a59,_0x21266c){_0x580a59=_0x580a59-0x0;var _0x19da51=_0x72fb[_0x580a59];return _0x19da51;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb72f('0x0'));var zipdir=require(_0xb72f('0x1'));var jsonpatch=require(_0xb72f('0x2'));var rp=require(_0xb72f('0x3'));var moment=require('moment');var BPromise=require(_0xb72f('0x4'));var Mustache=require(_0xb72f('0x5'));var util=require('util');var path=require(_0xb72f('0x6'));var sox=require(_0xb72f('0x7'));var csv=require(_0xb72f('0x8'));var ejs=require(_0xb72f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb72f('0xa'));var squel=require(_0xb72f('0xb'));var crypto=require(_0xb72f('0xc'));var jsforce=require(_0xb72f('0xd'));var deskjs=require(_0xb72f('0xe'));var toCsv=require(_0xb72f('0x8'));var querystring=require('querystring');var Papa=require(_0xb72f('0xf'));var Redis=require(_0xb72f('0x10'));var authService=require(_0xb72f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb72f('0x12'));var logger=require(_0xb72f('0x13'))(_0xb72f('0x14'));var utils=require('../../config/utils');var config=require(_0xb72f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb72f('0x16'))['db'];function respondWithStatusCode(_0x3fa7d9,_0x5dc4b7){_0x5dc4b7=_0x5dc4b7||0xcc;return function(_0x2ee4fb){if(_0x2ee4fb){return _0x3fa7d9['sendStatus'](_0x5dc4b7);}return _0x3fa7d9[_0xb72f('0x17')](_0x5dc4b7)[_0xb72f('0x18')]();};}function respondWithResult(_0x11b3a7,_0x481f8c){_0x481f8c=_0x481f8c||0xc8;return function(_0x2f89a4){if(_0x2f89a4){return _0x11b3a7[_0xb72f('0x17')](_0x481f8c)[_0xb72f('0x19')](_0x2f89a4);}};}function respondWithFilteredResult(_0x55c20c,_0x18a80e){return function(_0x345def){if(_0x345def){var _0x538492=typeof _0x18a80e[_0xb72f('0x1a')]===_0xb72f('0x1b')&&typeof _0x18a80e[_0xb72f('0x1c')]===_0xb72f('0x1b');var _0x405132=_0x345def[_0xb72f('0x1d')];var _0x2388bb=_0x538492?0x0:_0x18a80e[_0xb72f('0x1a')];var _0xc03cc9=_0x538492?_0x345def[_0xb72f('0x1d')]:_0x18a80e[_0xb72f('0x1a')]+_0x18a80e['limit'];var _0x4229d7;if(_0xc03cc9>=_0x405132){_0xc03cc9=_0x405132;_0x4229d7=0xc8;}else{_0x4229d7=0xce;}_0x55c20c[_0xb72f('0x17')](_0x4229d7);return _0x55c20c[_0xb72f('0x1e')](_0xb72f('0x1f'),_0x2388bb+'-'+_0xc03cc9+'/'+_0x405132)['json'](_0x345def);}return null;};}function patchUpdates(_0x31a2a9){return function(_0x32f1f5){try{jsonpatch['apply'](_0x32f1f5,_0x31a2a9,!![]);}catch(_0x554890){return BPromise[_0xb72f('0x20')](_0x554890);}return _0x32f1f5[_0xb72f('0x21')]();};}function saveUpdates(_0x498916,_0x500cd9){return function(_0x515b6f){if(_0x515b6f){return _0x515b6f[_0xb72f('0x22')](_0x498916)[_0xb72f('0x23')](function(_0x4ea78a){return _0x4ea78a;});}return null;};}function removeEntity(_0x4a457e,_0x4c1e5b){return function(_0x249fcf){if(_0x249fcf){return _0x249fcf[_0xb72f('0x24')]()[_0xb72f('0x23')](function(){var _0x3eccf4=_0x249fcf[_0xb72f('0x25')]({'plain':!![]});var _0x59385b=_0xb72f('0x26');return db['UserProfileResource'][_0xb72f('0x24')]({'where':{'type':_0x59385b,'resourceId':_0x3eccf4['id']}})[_0xb72f('0x23')](function(){return _0x249fcf;});})[_0xb72f('0x23')](function(){_0x4a457e['status'](0xcc)[_0xb72f('0x18')]();});}};}function handleEntityNotFound(_0x5ef248,_0x13aa0f){return function(_0x34eefa){if(!_0x34eefa){_0x5ef248[_0xb72f('0x27')](0x194);}return _0x34eefa;};}function handleError(_0x266ab4,_0xf5ba62){_0xf5ba62=_0xf5ba62||0x1f4;return function(_0x335506){logger[_0xb72f('0x28')](_0x335506[_0xb72f('0x29')]);if(_0x335506['name']){delete _0x335506[_0xb72f('0x2a')];}_0x266ab4[_0xb72f('0x17')](_0xf5ba62)[_0xb72f('0x2b')](_0x335506);};}exports[_0xb72f('0x2c')]=function(_0x5b24f7,_0x145c48){var _0x2debf3={},_0x3df839={},_0x36575a={'count':0x0,'rows':[]};var _0x17e33c=_[_0xb72f('0x2d')](db[_0xb72f('0x2e')]['rawAttributes'],function(_0x4ebb26){return{'name':_0x4ebb26[_0xb72f('0x2f')],'type':_0x4ebb26[_0xb72f('0x30')]['key']};});_0x3df839[_0xb72f('0x31')]=_[_0xb72f('0x2d')](_0x17e33c,_0xb72f('0x2a'));_0x3df839[_0xb72f('0x32')]=_[_0xb72f('0x33')](_0x5b24f7['query']);_0x3df839[_0xb72f('0x34')]=_[_0xb72f('0x35')](_0x3df839[_0xb72f('0x31')],_0x3df839[_0xb72f('0x32')]);_0x2debf3[_0xb72f('0x36')]=_[_0xb72f('0x35')](_0x3df839[_0xb72f('0x31')],qs[_0xb72f('0x37')](_0x5b24f7[_0xb72f('0x32')][_0xb72f('0x37')]));_0x2debf3[_0xb72f('0x36')]=_0x2debf3[_0xb72f('0x36')][_0xb72f('0x38')]?_0x2debf3[_0xb72f('0x36')]:_0x3df839[_0xb72f('0x31')];if(!_0x5b24f7[_0xb72f('0x32')][_0xb72f('0x39')](_0xb72f('0x3a'))){_0x2debf3['limit']=qs['limit'](_0x5b24f7[_0xb72f('0x32')][_0xb72f('0x1c')]);_0x2debf3[_0xb72f('0x1a')]=qs[_0xb72f('0x1a')](_0x5b24f7[_0xb72f('0x32')]['offset']);}_0x2debf3['order']=qs[_0xb72f('0x3b')](_0x5b24f7['query']['sort']);_0x2debf3['where']=qs[_0xb72f('0x34')](_[_0xb72f('0x3c')](_0x5b24f7[_0xb72f('0x32')],_0x3df839[_0xb72f('0x34')]),_0x17e33c);if(_0x5b24f7[_0xb72f('0x32')][_0xb72f('0x3d')]){_0x2debf3[_0xb72f('0x3e')]=_[_0xb72f('0x3f')](_0x2debf3['where'],{'$or':_[_0xb72f('0x2d')](_0x17e33c,function(_0x570ee0){if(_0x570ee0['type']!=='VIRTUAL'){var _0x33af58={};_0x33af58[_0x570ee0['name']]={'$like':'%'+_0x5b24f7['query'][_0xb72f('0x3d')]+'%'};return _0x33af58;}})});}_0x2debf3=_[_0xb72f('0x3f')]({},_0x2debf3,_0x5b24f7[_0xb72f('0x40')]);var _0x260b2e={'where':_0x2debf3['where']};return db[_0xb72f('0x2e')][_0xb72f('0x1d')](_0x260b2e)[_0xb72f('0x23')](function(_0x225d0b){_0x36575a[_0xb72f('0x1d')]=_0x225d0b;if(_0x5b24f7[_0xb72f('0x32')][_0xb72f('0x41')]){_0x2debf3[_0xb72f('0x42')]=[{'all':!![]}];}return db[_0xb72f('0x2e')][_0xb72f('0x43')](_0x2debf3);})[_0xb72f('0x23')](function(_0xb28751){_0x36575a[_0xb72f('0x44')]=_0xb28751;return _0x36575a;})[_0xb72f('0x23')](respondWithFilteredResult(_0x145c48,_0x2debf3))[_0xb72f('0x45')](handleError(_0x145c48,null));};exports[_0xb72f('0x46')]=function(_0xdeab6,_0x240ef9){var _0x1413cf={'raw':!![],'where':{'id':_0xdeab6[_0xb72f('0x47')]['id']}},_0x148532={};_0x148532[_0xb72f('0x31')]=_[_0xb72f('0x33')](db[_0xb72f('0x2e')]['rawAttributes']);_0x148532[_0xb72f('0x32')]=_[_0xb72f('0x33')](_0xdeab6[_0xb72f('0x32')]);_0x148532['filters']=_[_0xb72f('0x35')](_0x148532['model'],_0x148532[_0xb72f('0x32')]);_0x1413cf['attributes']=_[_0xb72f('0x35')](_0x148532[_0xb72f('0x31')],qs[_0xb72f('0x37')](_0xdeab6[_0xb72f('0x32')]['fields']));_0x1413cf[_0xb72f('0x36')]=_0x1413cf[_0xb72f('0x36')]['length']?_0x1413cf[_0xb72f('0x36')]:_0x148532[_0xb72f('0x31')];if(_0xdeab6['query'][_0xb72f('0x41')]){_0x1413cf[_0xb72f('0x42')]=[{'all':!![]}];}_0x1413cf=_[_0xb72f('0x3f')]({},_0x1413cf,_0xdeab6['options']);return db['CmHopperAdditionalPhone'][_0xb72f('0x48')](_0x1413cf)[_0xb72f('0x23')](handleEntityNotFound(_0x240ef9,null))[_0xb72f('0x23')](respondWithResult(_0x240ef9,null))[_0xb72f('0x45')](handleError(_0x240ef9,null));};exports[_0xb72f('0x49')]=function(_0x10e86f,_0x4dae11){return db['CmHopperAdditionalPhone'][_0xb72f('0x49')](_0x10e86f[_0xb72f('0x4a')],{})['then'](function(_0x46d850){var _0x535bf2=_0x10e86f['user'][_0xb72f('0x25')]({'plain':!![]});if(!_0x535bf2)throw new Error(_0xb72f('0x4b'));if(_0x535bf2['role']==='user'){var _0x2a58d9=_0x46d850[_0xb72f('0x25')]({'plain':!![]});var _0x42541=_0xb72f('0x26');return db[_0xb72f('0x4c')][_0xb72f('0x48')]({'where':{'name':_0x42541,'userProfileId':_0x535bf2['userProfileId']},'raw':!![]})[_0xb72f('0x23')](function(_0x334990){if(_0x334990&&_0x334990[_0xb72f('0x4d')]===0x0){return db[_0xb72f('0x4e')][_0xb72f('0x49')]({'name':_0x2a58d9[_0xb72f('0x2a')],'resourceId':_0x2a58d9['id'],'type':_0x334990[_0xb72f('0x2a')],'sectionId':_0x334990['id']},{})[_0xb72f('0x23')](function(){return _0x46d850;});}else{return _0x46d850;}})[_0xb72f('0x45')](function(_0x4c4c8b){logger[_0xb72f('0x28')](_0xb72f('0x4f'),_0x4c4c8b);throw _0x4c4c8b;});}return _0x46d850;})[_0xb72f('0x23')](respondWithResult(_0x4dae11,0xc9))[_0xb72f('0x45')](handleError(_0x4dae11,null));};exports['update']=function(_0x41454b,_0x583579){if(_0x41454b['body']['id']){delete _0x41454b[_0xb72f('0x4a')]['id'];}return db[_0xb72f('0x2e')][_0xb72f('0x48')]({'where':{'id':_0x41454b[_0xb72f('0x47')]['id']}})[_0xb72f('0x23')](handleEntityNotFound(_0x583579,null))[_0xb72f('0x23')](saveUpdates(_0x41454b[_0xb72f('0x4a')],null))[_0xb72f('0x23')](respondWithResult(_0x583579,null))['catch'](handleError(_0x583579,null));};exports[_0xb72f('0x24')]=function(_0x4fca0e,_0x43ac05){return db[_0xb72f('0x2e')][_0xb72f('0x48')]({'where':{'id':_0x4fca0e[_0xb72f('0x47')]['id']}})[_0xb72f('0x23')](handleEntityNotFound(_0x43ac05,null))[_0xb72f('0x23')](removeEntity(_0x43ac05,null))[_0xb72f('0x45')](handleError(_0x43ac05,null));}; \ No newline at end of file +var _0xbbf2=['sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','CmHopperAdditionalPhones','destroy','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x418305,_0xcf9d75){var _0x39a433=function(_0x44dbfb){while(--_0x44dbfb){_0x418305['push'](_0x418305['shift']());}};_0x39a433(++_0xcf9d75);}(_0xbbf2,0x8e));var _0x2bbf=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xbbf2[_0xe39824];return _0x4bc31e;};'use strict';var emlformat=require(_0x2bbf('0x0'));var rimraf=require(_0x2bbf('0x1'));var zipdir=require(_0x2bbf('0x2'));var jsonpatch=require(_0x2bbf('0x3'));var rp=require(_0x2bbf('0x4'));var moment=require(_0x2bbf('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2bbf('0x6'));var path=require('path');var sox=require(_0x2bbf('0x7'));var csv=require(_0x2bbf('0x8'));var ejs=require(_0x2bbf('0x9'));var fs=require('fs');var fs_extra=require(_0x2bbf('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2bbf('0xb'));var deskjs=require(_0x2bbf('0xc'));var toCsv=require(_0x2bbf('0x8'));var querystring=require('querystring');var Papa=require(_0x2bbf('0xd'));var Redis=require('ioredis');var authService=require(_0x2bbf('0xe'));var qs=require(_0x2bbf('0xf'));var as=require(_0x2bbf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bbf('0x11'))('api');var utils=require(_0x2bbf('0x12'));var config=require(_0x2bbf('0x13'));var licenseUtil=require(_0x2bbf('0x14'));var db=require(_0x2bbf('0x15'))['db'];function respondWithStatusCode(_0x392f83,_0x359853){_0x359853=_0x359853||0xcc;return function(_0x45162b){if(_0x45162b){return _0x392f83[_0x2bbf('0x16')](_0x359853);}return _0x392f83['status'](_0x359853)[_0x2bbf('0x17')]();};}function respondWithResult(_0xc26096,_0x13316d){_0x13316d=_0x13316d||0xc8;return function(_0x127bae){if(_0x127bae){return _0xc26096[_0x2bbf('0x18')](_0x13316d)['json'](_0x127bae);}};}function respondWithFilteredResult(_0x3a8e63,_0x43b274){return function(_0x30bcb5){if(_0x30bcb5){var _0x9d7c0d=typeof _0x43b274[_0x2bbf('0x19')]===_0x2bbf('0x1a')&&typeof _0x43b274['limit']===_0x2bbf('0x1a');var _0x4e28ef=_0x30bcb5[_0x2bbf('0x1b')];var _0x5c9eb9=_0x9d7c0d?0x0:_0x43b274[_0x2bbf('0x19')];var _0x39372d=_0x9d7c0d?_0x30bcb5[_0x2bbf('0x1b')]:_0x43b274['offset']+_0x43b274[_0x2bbf('0x1c')];var _0x2b8244;if(_0x39372d>=_0x4e28ef){_0x39372d=_0x4e28ef;_0x2b8244=0xc8;}else{_0x2b8244=0xce;}_0x3a8e63[_0x2bbf('0x18')](_0x2b8244);return _0x3a8e63[_0x2bbf('0x1d')](_0x2bbf('0x1e'),_0x5c9eb9+'-'+_0x39372d+'/'+_0x4e28ef)[_0x2bbf('0x1f')](_0x30bcb5);}return null;};}function patchUpdates(_0xb868e0){return function(_0xedc286){try{jsonpatch[_0x2bbf('0x20')](_0xedc286,_0xb868e0,!![]);}catch(_0x38f207){return BPromise['reject'](_0x38f207);}return _0xedc286['save']();};}function saveUpdates(_0x364c49,_0x36b04a){return function(_0x1c2d83){if(_0x1c2d83){return _0x1c2d83[_0x2bbf('0x21')](_0x364c49)[_0x2bbf('0x22')](function(_0x3ea6d3){return _0x3ea6d3;});}return null;};}function removeEntity(_0x5bf5ae,_0x5f5781){return function(_0x28256f){if(_0x28256f){return _0x28256f['destroy']()['then'](function(){var _0x58d747=_0x28256f['get']({'plain':!![]});var _0x556500=_0x2bbf('0x23');return db['UserProfileResource'][_0x2bbf('0x24')]({'where':{'type':_0x556500,'resourceId':_0x58d747['id']}})[_0x2bbf('0x22')](function(){return _0x28256f;});})['then'](function(){_0x5bf5ae[_0x2bbf('0x18')](0xcc)[_0x2bbf('0x17')]();});}};}function handleEntityNotFound(_0x6d9341,_0x33bb1e){return function(_0x431f29){if(!_0x431f29){_0x6d9341[_0x2bbf('0x16')](0x194);}return _0x431f29;};}function handleError(_0x6a468,_0x4cd1d0){_0x4cd1d0=_0x4cd1d0||0x1f4;return function(_0x3ccb9f){logger['error'](_0x3ccb9f[_0x2bbf('0x25')]);if(_0x3ccb9f[_0x2bbf('0x26')]){delete _0x3ccb9f[_0x2bbf('0x26')];}_0x6a468[_0x2bbf('0x18')](_0x4cd1d0)[_0x2bbf('0x27')](_0x3ccb9f);};}exports[_0x2bbf('0x28')]=function(_0x522faf,_0x32fe3c){var _0x39e69c={},_0xae3591={},_0x42ba58={'count':0x0,'rows':[]};var _0x32122a=_[_0x2bbf('0x29')](db[_0x2bbf('0x2a')][_0x2bbf('0x2b')],function(_0x5b88a9){return{'name':_0x5b88a9[_0x2bbf('0x2c')],'type':_0x5b88a9[_0x2bbf('0x2d')][_0x2bbf('0x2e')]};});_0xae3591[_0x2bbf('0x2f')]=_[_0x2bbf('0x29')](_0x32122a,'name');_0xae3591[_0x2bbf('0x30')]=_[_0x2bbf('0x31')](_0x522faf[_0x2bbf('0x30')]);_0xae3591[_0x2bbf('0x32')]=_['intersection'](_0xae3591['model'],_0xae3591[_0x2bbf('0x30')]);_0x39e69c[_0x2bbf('0x33')]=_[_0x2bbf('0x34')](_0xae3591[_0x2bbf('0x2f')],qs[_0x2bbf('0x35')](_0x522faf[_0x2bbf('0x30')][_0x2bbf('0x35')]));_0x39e69c[_0x2bbf('0x33')]=_0x39e69c[_0x2bbf('0x33')][_0x2bbf('0x36')]?_0x39e69c['attributes']:_0xae3591[_0x2bbf('0x2f')];if(!_0x522faf[_0x2bbf('0x30')][_0x2bbf('0x37')](_0x2bbf('0x38'))){_0x39e69c[_0x2bbf('0x1c')]=qs[_0x2bbf('0x1c')](_0x522faf[_0x2bbf('0x30')]['limit']);_0x39e69c['offset']=qs['offset'](_0x522faf[_0x2bbf('0x30')][_0x2bbf('0x19')]);}_0x39e69c[_0x2bbf('0x39')]=qs[_0x2bbf('0x3a')](_0x522faf['query']['sort']);_0x39e69c['where']=qs['filters'](_['pick'](_0x522faf[_0x2bbf('0x30')],_0xae3591[_0x2bbf('0x32')]),_0x32122a);if(_0x522faf[_0x2bbf('0x30')][_0x2bbf('0x3b')]){_0x39e69c[_0x2bbf('0x3c')]=_[_0x2bbf('0x3d')](_0x39e69c[_0x2bbf('0x3c')],{'$or':_['map'](_0x32122a,function(_0x18cb7a){if(_0x18cb7a[_0x2bbf('0x2d')]!=='VIRTUAL'){var _0x2b569d={};_0x2b569d[_0x18cb7a[_0x2bbf('0x26')]]={'$like':'%'+_0x522faf[_0x2bbf('0x30')][_0x2bbf('0x3b')]+'%'};return _0x2b569d;}})});}_0x39e69c=_[_0x2bbf('0x3d')]({},_0x39e69c,_0x522faf[_0x2bbf('0x3e')]);var _0x2a395c={'where':_0x39e69c[_0x2bbf('0x3c')]};return db[_0x2bbf('0x2a')]['count'](_0x2a395c)[_0x2bbf('0x22')](function(_0x5157c5){_0x42ba58[_0x2bbf('0x1b')]=_0x5157c5;if(_0x522faf[_0x2bbf('0x30')][_0x2bbf('0x3f')]){_0x39e69c['include']=[{'all':!![]}];}return db[_0x2bbf('0x2a')][_0x2bbf('0x40')](_0x39e69c);})[_0x2bbf('0x22')](function(_0x45e261){_0x42ba58[_0x2bbf('0x41')]=_0x45e261;return _0x42ba58;})[_0x2bbf('0x22')](respondWithFilteredResult(_0x32fe3c,_0x39e69c))['catch'](handleError(_0x32fe3c,null));};exports[_0x2bbf('0x42')]=function(_0x18f427,_0x4692a4){var _0x3d37ed={'raw':!![],'where':{'id':_0x18f427[_0x2bbf('0x43')]['id']}},_0x1481d9={};_0x1481d9[_0x2bbf('0x2f')]=_[_0x2bbf('0x31')](db[_0x2bbf('0x2a')][_0x2bbf('0x2b')]);_0x1481d9[_0x2bbf('0x30')]=_[_0x2bbf('0x31')](_0x18f427[_0x2bbf('0x30')]);_0x1481d9['filters']=_[_0x2bbf('0x34')](_0x1481d9[_0x2bbf('0x2f')],_0x1481d9[_0x2bbf('0x30')]);_0x3d37ed[_0x2bbf('0x33')]=_[_0x2bbf('0x34')](_0x1481d9[_0x2bbf('0x2f')],qs[_0x2bbf('0x35')](_0x18f427[_0x2bbf('0x30')]['fields']));_0x3d37ed[_0x2bbf('0x33')]=_0x3d37ed[_0x2bbf('0x33')][_0x2bbf('0x36')]?_0x3d37ed[_0x2bbf('0x33')]:_0x1481d9[_0x2bbf('0x2f')];if(_0x18f427[_0x2bbf('0x30')][_0x2bbf('0x3f')]){_0x3d37ed[_0x2bbf('0x44')]=[{'all':!![]}];}_0x3d37ed=_[_0x2bbf('0x3d')]({},_0x3d37ed,_0x18f427[_0x2bbf('0x3e')]);return db[_0x2bbf('0x2a')][_0x2bbf('0x45')](_0x3d37ed)[_0x2bbf('0x22')](handleEntityNotFound(_0x4692a4,null))[_0x2bbf('0x22')](respondWithResult(_0x4692a4,null))[_0x2bbf('0x46')](handleError(_0x4692a4,null));};exports[_0x2bbf('0x47')]=function(_0xca183,_0x1a00b1){return db[_0x2bbf('0x2a')][_0x2bbf('0x47')](_0xca183[_0x2bbf('0x48')],{})[_0x2bbf('0x22')](function(_0x50e96d){var _0x3b586e=_0xca183[_0x2bbf('0x49')][_0x2bbf('0x4a')]({'plain':!![]});if(!_0x3b586e)throw new Error(_0x2bbf('0x4b'));if(_0x3b586e[_0x2bbf('0x4c')]===_0x2bbf('0x49')){var _0x57c8e5=_0x50e96d[_0x2bbf('0x4a')]({'plain':!![]});var _0x2a6a5b=_0x2bbf('0x23');return db[_0x2bbf('0x4d')][_0x2bbf('0x45')]({'where':{'name':_0x2a6a5b,'userProfileId':_0x3b586e[_0x2bbf('0x4e')]},'raw':!![]})['then'](function(_0x41407c){if(_0x41407c&&_0x41407c[_0x2bbf('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x57c8e5[_0x2bbf('0x26')],'resourceId':_0x57c8e5['id'],'type':_0x41407c[_0x2bbf('0x26')],'sectionId':_0x41407c['id']},{})['then'](function(){return _0x50e96d;});}else{return _0x50e96d;}})[_0x2bbf('0x46')](function(_0x3fe53b){logger[_0x2bbf('0x50')](_0x2bbf('0x51'),_0x3fe53b);throw _0x3fe53b;});}return _0x50e96d;})['then'](respondWithResult(_0x1a00b1,0xc9))[_0x2bbf('0x46')](handleError(_0x1a00b1,null));};exports['update']=function(_0x5ca2c7,_0x1f5d13){if(_0x5ca2c7[_0x2bbf('0x48')]['id']){delete _0x5ca2c7['body']['id'];}return db[_0x2bbf('0x2a')][_0x2bbf('0x45')]({'where':{'id':_0x5ca2c7['params']['id']}})[_0x2bbf('0x22')](handleEntityNotFound(_0x1f5d13,null))['then'](saveUpdates(_0x5ca2c7['body'],null))[_0x2bbf('0x22')](respondWithResult(_0x1f5d13,null))[_0x2bbf('0x46')](handleError(_0x1f5d13,null));};exports[_0x2bbf('0x24')]=function(_0x47b82c,_0x5320a0){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x47b82c['params']['id']}})['then'](handleEntityNotFound(_0x5320a0,null))['then'](removeEntity(_0x5320a0,null))['catch'](handleError(_0x5320a0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index d597f16..b38f584 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 _0x6459=['util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','cm_hopper_additional_phones','lodash'];(function(_0x3cb7e8,_0xb8f77){var _0x72798f=function(_0x114662){while(--_0x114662){_0x3cb7e8['push'](_0x3cb7e8['shift']());}};_0x72798f(++_0xb8f77);}(_0x6459,0x1c2));var _0x9645=function(_0x1b6f11,_0x2357c6){_0x1b6f11=_0x1b6f11-0x0;var _0x74ae0=_0x6459[_0x1b6f11];return _0x74ae0;};'use strict';var _=require(_0x9645('0x0'));var util=require(_0x9645('0x1'));var logger=require('../../config/logger')(_0x9645('0x2'));var moment=require(_0x9645('0x3'));var BPromise=require(_0x9645('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9645('0x5'));var rimraf=require(_0x9645('0x6'));var config=require(_0x9645('0x7'));var attributes=require(_0x9645('0x8'));module[_0x9645('0x9')]=function(_0x2fe0f5,_0x589f96){return _0x2fe0f5['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0x9645('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacf9=['cm_hopper_additional_phones','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','CmHopperAdditionalPhone'];(function(_0xe2c665,_0x5467a0){var _0x5bcbb7=function(_0x4002dc){while(--_0x4002dc){_0xe2c665['push'](_0xe2c665['shift']());}};_0x5bcbb7(++_0x5467a0);}(_0xacf9,0x198));var _0x9acf=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xacf9[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require(_0x9acf('0x0'));var logger=require(_0x9acf('0x1'))(_0x9acf('0x2'));var moment=require('moment');var BPromise=require(_0x9acf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9acf('0x4'));var rimraf=require(_0x9acf('0x5'));var config=require(_0x9acf('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x9acf('0x7')]=function(_0xdd953f,_0x3599fb){return _0xdd953f[_0x9acf('0x8')](_0x9acf('0x9'),attributes,{'tableName':_0x9acf('0xa'),'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 97e0996..ba9e3d0 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 _0x254b=['SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','findOne','countmachineretry','dialGlobalMaxRetry','VerifyAdditionalPhones','catch'];(function(_0x11a0cf,_0x39442f){var _0x4a338f=function(_0x3e7b8d){while(--_0x3e7b8d){_0x11a0cf['push'](_0x11a0cf['shift']());}};_0x4a338f(++_0x39442f);}(_0x254b,0xb8));var _0xb254=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x254b[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xb254('0x0'));var util=require(_0xb254('0x1'));var moment=require(_0xb254('0x2'));var BPromise=require('bluebird');var rs=require(_0xb254('0x3'));var fs=require('fs');var Redis=require(_0xb254('0x4'));var db=require(_0xb254('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb254('0x6'))(_0xb254('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb254('0x8')][_0xb254('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17eb55,_0x21f442,_0xc9c9a){return new BPromise(function(_0x3b8714,_0x3cdca3){return client['request'](_0x17eb55,_0xc9c9a)['then'](function(_0x56a030){logger[_0xb254('0xa')](_0xb254('0xb'),_0x21f442,_0xb254('0xc'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x21f442,_0xb254('0xc'),JSON[_0xb254('0xd')](_0x56a030));if(_0x56a030[_0xb254('0xe')]){if(_0x56a030[_0xb254('0xe')][_0xb254('0xf')]===0x1f4){logger[_0xb254('0xe')](_0xb254('0xb'),_0x21f442,_0x56a030[_0xb254('0xe')]['message']);return _0x3cdca3(_0x56a030[_0xb254('0xe')]['message']);}logger[_0xb254('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x21f442,_0x56a030[_0xb254('0xe')][_0xb254('0x10')]);return _0x3b8714(_0x56a030[_0xb254('0xe')][_0xb254('0x10')]);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x21f442,_0xb254('0xc'));_0x3b8714(_0x56a030[_0xb254('0x11')][_0xb254('0x10')]);}})['catch'](function(_0xde16ad){logger[_0xb254('0xe')](_0xb254('0xb'),_0x21f442,_0xde16ad);_0x3cdca3(_0xde16ad);});});}exports['VerifyAdditionalPhones']=function(_0x6aec21){var _0x273eae=this;return new Promise(function(_0x307919,_0xe4da02){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x6aec21[_0xb254('0x12')][_0xb254('0x13')],'ListId':_0x6aec21[_0xb254('0x12')][_0xb254('0x14')],'VoiceQueueId':_0x6aec21['body'][_0xb254('0x15')]===undefined?null:_0x6aec21[_0xb254('0x12')]['VoiceQueueId'],'CampaignId':_0x6aec21['body']['CampaignId']===undefined?null:_0x6aec21[_0xb254('0x12')][_0xb254('0x16')]}})[_0xb254('0x17')](function(_0x12a8ed){if(_0x12a8ed!=null){return db[_0xb254('0x18')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x12a8ed['id'],'OrderBy':{'$gt':_0x12a8ed[_0xb254('0x19')]}},'order':[[_0xb254('0x19'),_0xb254('0x1a')]]})[_0xb254('0x17')](function(_0x4ce7c7){var _0xd44f77=0x0;if(_0x4ce7c7){if(_0x4ce7c7[_0xb254('0x1b')]+_0x4ce7c7[_0xb254('0x1c')]+_0x4ce7c7[_0xb254('0x1d')]+_0x4ce7c7[_0xb254('0x1e')]+_0x4ce7c7[_0xb254('0x1f')]+_0x4ce7c7[_0xb254('0x20')]+_0x4ce7c7['countmachineretry']+_0x4ce7c7[_0xb254('0x21')]<_0x6aec21[_0xb254('0x22')]['dialGlobalMaxRetry'])_0xd44f77=0x1;_0x307919({'additional':_0xd44f77});}else{return db[_0xb254('0x18')][_0xb254('0x23')]({'raw':!![],'where':{'CmHopperId':_0x12a8ed['id']},'order':[[_0xb254('0x19'),_0xb254('0x1a')]]})[_0xb254('0x17')](function(_0x3a3835){var _0x5807cd=0x0;if(_0x3a3835){if(_0x3a3835['countbusyretry']+_0x3a3835[_0xb254('0x1c')]+_0x3a3835[_0xb254('0x1d')]+_0x3a3835[_0xb254('0x1e')]+_0x3a3835[_0xb254('0x1f')]+_0x3a3835[_0xb254('0x20')]+_0x3a3835[_0xb254('0x24')]+_0x3a3835[_0xb254('0x21')]<_0x6aec21[_0xb254('0x22')][_0xb254('0x25')])_0x5807cd=0x1;_0x307919({'additional':_0x5807cd});}else{_0x307919({'additional':0x0});}})['catch'](function(_0xe8a2a9){logger[_0xb254('0xe')](_0xb254('0x26'),_0xe8a2a9['message']);_0xe4da02(_0x273eae[_0xb254('0xe')](0x1f4,_0xe8a2a9[_0xb254('0x10')]));});}})[_0xb254('0x27')](function(_0x16ba75){logger['error'](_0xb254('0x26'),_0x16ba75[_0xb254('0x10')]);_0xe4da02(_0x273eae[_0xb254('0xe')](0x1f4,_0x16ba75[_0xb254('0x10')]));});}else _0x307919({'additional':0x0});});});};exports[_0xb254('0x28')]=function(_0x506070){var _0x27fb46=this;return new Promise(function(_0x44f9e3,_0x7a42ce){return db[_0xb254('0x29')][_0xb254('0x23')]({'raw':!![],'where':{'ContactId':_0x506070[_0xb254('0x12')][_0xb254('0x13')],'ListId':_0x506070[_0xb254('0x12')][_0xb254('0x14')],'VoiceQueueId':_0x506070[_0xb254('0x12')][_0xb254('0x15')]===undefined?null:_0x506070[_0xb254('0x12')][_0xb254('0x15')],'CampaignId':_0x506070[_0xb254('0x12')][_0xb254('0x16')]===undefined?null:_0x506070[_0xb254('0x12')][_0xb254('0x16')]}})[_0xb254('0x17')](function(_0x56b778){if(_0x56b778!=null){return db['CmHopperAdditionalPhone'][_0xb254('0x23')]({'raw':!![],'where':{'CmHopperId':_0x56b778['id'],'OrderBy':{'$gte':_0x56b778[_0xb254('0x19')]}},'order':[['OrderBy',_0xb254('0x1a')]]})['then'](function(_0x3d576c){if(_0x3d576c)return activateAdditionalPhone(_0x56b778,_0x506070[_0xb254('0x12')],_0x3d576c,_0x506070[_0xb254('0x2a')],_0x506070[_0xb254('0x2b')])[_0xb254('0x17')](function(_0x9ccd39){_0x44f9e3(_0x9ccd39);});else{return db[_0xb254('0x18')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x56b778['id']},'order':[[_0xb254('0x19'),_0xb254('0x1a')]]})['then'](function(_0x477df6){if(_0x477df6)return activateAdditionalPhone(_0x56b778,_0x506070[_0xb254('0x12')],_0x477df6,_0x506070[_0xb254('0x2a')],_0x506070[_0xb254('0x2b')])[_0xb254('0x17')](function(_0x4808a3){_0x44f9e3(_0x4808a3);});else{_0x44f9e3({'id':_0x56b778['id'],'phone':''});}})[_0xb254('0x27')](function(_0x1ac098){logger[_0xb254('0xe')](_0xb254('0x26'),_0x1ac098[_0xb254('0x10')]);_0x7a42ce(_0x27fb46[_0xb254('0xe')](0x1f4,_0x1ac098[_0xb254('0x10')]));});}})[_0xb254('0x27')](function(_0x22e95e){logger[_0xb254('0xe')](_0xb254('0x26'),_0x22e95e['message']);_0x7a42ce(_0x27fb46['error'](0x1f4,_0x22e95e[_0xb254('0x10')]));});}else _0x44f9e3(0x1);});});};function activateAdditionalPhone(_0x27a373,_0x375a1e,_0x595f96,_0x3c755f,_0x74eac7){return new Promise(function(_0x553f80,_0x24fd25){var _0x3f996f;if(_[_0xb254('0x2c')](_0x595f96[_0xb254('0x2d')])){_0x595f96[_0xb254('0x2d')]=moment();}if(moment()>moment(_0x595f96[_0xb254('0x2d')])){_0x3f996f=moment()[_0xb254('0x2e')](_0x74eac7||0x3,'minutes');}else{if(_0x595f96['OrderBy']==0x0){_0x3f996f=moment(_0x595f96[_0xb254('0x2d')]);}else{_0x3f996f=moment()[_0xb254('0x2e')](_0x74eac7||0x3,_0xb254('0x2f'));}}if(_[_0xb254('0x2c')](_0x3f996f)){_0x3f996f=moment()[_0xb254('0x2e')](_0x74eac7||0x3,_0xb254('0x2f'));}var _0x48e041={'phone':_0x27a373[_0xb254('0x30')],'active':0x0,'OrderBy':_[_0xb254('0x2c')](_0x27a373['OrderBy'])?0x0:_0x27a373[_0xb254('0x19')],'scheduledat':moment()[_0xb254('0x2e')](_0x3c755f||0x1,_0xb254('0x2f')),'countbusyretry':_0x375a1e['countbusyretry'],'countcongestionretry':_0x375a1e['countcongestionretry'],'countnoanswerretry':_0x375a1e[_0xb254('0x1d')],'countnosuchnumberretry':_0x375a1e['countnosuchnumberretry'],'countdropretry':_0x375a1e[_0xb254('0x1f')],'countabandonedretry':_0x375a1e[_0xb254('0x20')],'countmachineretry':_0x375a1e[_0xb254('0x24')],'countagentrejectretry':_0x375a1e[_0xb254('0x21')],'createdAt':_0x375a1e[_0xb254('0x31')],'updatedAt':_0x375a1e[_0xb254('0x32')]};var _0x4819cb={'CmHopperId':_0x27a373['id'],'phone':_0x595f96[_0xb254('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x595f96['OrderBy'])?0x0:_0x595f96['OrderBy'],'scheduledat':_0x3f996f,'countbusyretry':_0x595f96[_0xb254('0x1b')],'countcongestionretry':_0x595f96[_0xb254('0x1c')],'countnoanswerretry':_0x595f96[_0xb254('0x1d')],'countnosuchnumberretry':_0x595f96[_0xb254('0x1e')],'countdropretry':_0x595f96['countdropretry'],'countabandonedretry':_0x595f96[_0xb254('0x20')],'countmachineretry':_0x595f96[_0xb254('0x24')],'countagentrejectretry':_0x595f96[_0xb254('0x21')],'createdAt':_0x595f96[_0xb254('0x31')],'updatedAt':_0x595f96[_0xb254('0x32')]};return db['sequelize'][_0xb254('0x33')](function(_0x4d8c9c){return db[_0xb254('0x18')][_0xb254('0x34')](_0x48e041,{'where':{'id':_0x595f96['id']}},{'transaction':_0x4d8c9c})[_0xb254('0x17')](function(){return db['CmHopper']['update'](_0x4819cb,{'where':{'id':_0x27a373['id']}},{'transaction':_0x4d8c9c});});})[_0xb254('0x17')](function(_0x54e890){_0x553f80({'id':_0x27a373['id'],'phone':_0x595f96[_0xb254('0x30')]});})['catch'](function(_0x3bc9e5){logger[_0xb254('0xe')](_0xb254('0x35'),_0x3bc9e5[_0xb254('0x10')]);_0x24fd25({'error':_0x3bc9e5[_0xb254('0x10')]});});});}exports[_0xb254('0x36')]=function(_0x282af7){var _0x20a54c=this;return new Promise(function(_0x381d5b,_0x6f5266){return db[_0xb254('0x29')]['update'](_0x282af7[_0xb254('0x12')][_0xb254('0x37')],{'where':{'id':_0x282af7['body']['id']}})[_0xb254('0x17')](function(_0x26c657){_0x381d5b(_0x26c657);})[_0xb254('0x27')](function(_0x245baf){logger[_0xb254('0xe')]('IncrementPreviewCounters',_0x245baf[_0xb254('0x10')]);_0x6f5266(_0x20a54c['error'](0x1f4,_0x245baf[_0xb254('0x10')]));});});}; \ No newline at end of file +var _0xfaed=['info','CmHopperAdditionalPhone,\x20%s,\x20%s','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','countcongestionretry','countabandonedretry','dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','countagentrejectretry','createdAt','updatedAt','phone','sequelize','transaction','IncrementPreviewCounters','update','field','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfaed,0xd1));var _0xdfae=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0xfaed[_0x3e531a];return _0x3c2574;};'use strict';var _=require(_0xdfae('0x0'));var util=require(_0xdfae('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfae('0x2'));var db=require(_0xdfae('0x3'))['db'];var utils=require(_0xdfae('0x4'));var logger=require(_0xdfae('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdfae('0x6'));var client=jayson[_0xdfae('0x7')][_0xdfae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x497a2,_0x176967,_0x50b98b){return new BPromise(function(_0x49464e,_0x1c98da){return client[_0xdfae('0x9')](_0x497a2,_0x50b98b)[_0xdfae('0xa')](function(_0x837384){logger[_0xdfae('0xb')](_0xdfae('0xc'),_0x176967,'request\x20sent');logger['debug'](_0xdfae('0xd'),_0x176967,_0xdfae('0xe'),JSON['stringify'](_0x837384));if(_0x837384['error']){if(_0x837384[_0xdfae('0xf')]['code']===0x1f4){logger[_0xdfae('0xf')](_0xdfae('0xc'),_0x176967,_0x837384['error'][_0xdfae('0x10')]);return _0x1c98da(_0x837384[_0xdfae('0xf')][_0xdfae('0x10')]);}logger[_0xdfae('0xf')](_0xdfae('0xc'),_0x176967,_0x837384[_0xdfae('0xf')]['message']);return _0x49464e(_0x837384['error']['message']);}else{logger[_0xdfae('0xb')](_0xdfae('0xc'),_0x176967,'request\x20sent');_0x49464e(_0x837384[_0xdfae('0x11')][_0xdfae('0x10')]);}})[_0xdfae('0x12')](function(_0xad1ad7){logger[_0xdfae('0xf')](_0xdfae('0xc'),_0x176967,_0xad1ad7);_0x1c98da(_0xad1ad7);});});}exports[_0xdfae('0x13')]=function(_0x569045){var _0x208faa=this;return new Promise(function(_0x2136e0,_0x4be6d2){return db[_0xdfae('0x14')][_0xdfae('0x15')]({'raw':!![],'where':{'ContactId':_0x569045['body'][_0xdfae('0x16')],'ListId':_0x569045[_0xdfae('0x17')][_0xdfae('0x18')],'VoiceQueueId':_0x569045[_0xdfae('0x17')][_0xdfae('0x19')]===undefined?null:_0x569045[_0xdfae('0x17')]['VoiceQueueId'],'CampaignId':_0x569045[_0xdfae('0x17')]['CampaignId']===undefined?null:_0x569045[_0xdfae('0x17')][_0xdfae('0x1a')]}})[_0xdfae('0xa')](function(_0x51c7ad){if(_0x51c7ad!=null){return db[_0xdfae('0x1b')][_0xdfae('0x15')]({'raw':!![],'where':{'CmHopperId':_0x51c7ad['id'],'OrderBy':{'$gt':_0x51c7ad[_0xdfae('0x1c')]}},'order':[[_0xdfae('0x1c'),_0xdfae('0x1d')]]})[_0xdfae('0xa')](function(_0x2b00d5){var _0x486d19=0x0;if(_0x2b00d5){if(_0x2b00d5[_0xdfae('0x1e')]+_0x2b00d5['countcongestionretry']+_0x2b00d5[_0xdfae('0x1f')]+_0x2b00d5[_0xdfae('0x20')]+_0x2b00d5[_0xdfae('0x21')]+_0x2b00d5['countabandonedretry']+_0x2b00d5[_0xdfae('0x22')]+_0x2b00d5['countagentrejectretry']<_0x569045[_0xdfae('0x23')]['dialGlobalMaxRetry'])_0x486d19=0x1;_0x2136e0({'additional':_0x486d19});}else{return db[_0xdfae('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x51c7ad['id']},'order':[['OrderBy','ASC']]})[_0xdfae('0xa')](function(_0x4dda8a){var _0x4ab146=0x0;if(_0x4dda8a){if(_0x4dda8a[_0xdfae('0x1e')]+_0x4dda8a[_0xdfae('0x24')]+_0x4dda8a[_0xdfae('0x1f')]+_0x4dda8a[_0xdfae('0x20')]+_0x4dda8a[_0xdfae('0x21')]+_0x4dda8a[_0xdfae('0x25')]+_0x4dda8a[_0xdfae('0x22')]+_0x4dda8a['countagentrejectretry']<_0x569045[_0xdfae('0x23')][_0xdfae('0x26')])_0x4ab146=0x1;_0x2136e0({'additional':_0x4ab146});}else{_0x2136e0({'additional':0x0});}})[_0xdfae('0x12')](function(_0x45a59a){logger[_0xdfae('0xf')]('VerifyAdditionalPhones',_0x45a59a[_0xdfae('0x10')]);_0x4be6d2(_0x208faa[_0xdfae('0xf')](0x1f4,_0x45a59a[_0xdfae('0x10')]));});}})[_0xdfae('0x12')](function(_0x1250f2){logger[_0xdfae('0xf')](_0xdfae('0x13'),_0x1250f2[_0xdfae('0x10')]);_0x4be6d2(_0x208faa['error'](0x1f4,_0x1250f2[_0xdfae('0x10')]));});}else _0x2136e0({'additional':0x0});});});};exports[_0xdfae('0x27')]=function(_0x558166){var _0x7bfc16=this;return new Promise(function(_0x4ba753,_0xb52762){return db[_0xdfae('0x14')][_0xdfae('0x15')]({'raw':!![],'where':{'ContactId':_0x558166['body'][_0xdfae('0x16')],'ListId':_0x558166[_0xdfae('0x17')]['ListId'],'VoiceQueueId':_0x558166[_0xdfae('0x17')]['VoiceQueueId']===undefined?null:_0x558166[_0xdfae('0x17')][_0xdfae('0x19')],'CampaignId':_0x558166[_0xdfae('0x17')][_0xdfae('0x1a')]===undefined?null:_0x558166[_0xdfae('0x17')][_0xdfae('0x1a')]}})['then'](function(_0x4cc92c){if(_0x4cc92c!=null){return db[_0xdfae('0x1b')][_0xdfae('0x15')]({'raw':!![],'where':{'CmHopperId':_0x4cc92c['id'],'OrderBy':{'$gte':_0x4cc92c['OrderBy']}},'order':[[_0xdfae('0x1c'),_0xdfae('0x1d')]]})[_0xdfae('0xa')](function(_0x1d8bc6){if(_0x1d8bc6)return activateAdditionalPhone(_0x4cc92c,_0x558166['body'],_0x1d8bc6,_0x558166[_0xdfae('0x28')],_0x558166[_0xdfae('0x29')])[_0xdfae('0xa')](function(_0x489b3a){_0x4ba753(_0x489b3a);});else{return db[_0xdfae('0x1b')][_0xdfae('0x15')]({'raw':!![],'where':{'CmHopperId':_0x4cc92c['id']},'order':[[_0xdfae('0x1c'),_0xdfae('0x1d')]]})[_0xdfae('0xa')](function(_0x3b6aa0){if(_0x3b6aa0)return activateAdditionalPhone(_0x4cc92c,_0x558166['body'],_0x3b6aa0,_0x558166[_0xdfae('0x28')],_0x558166['waitTime'])[_0xdfae('0xa')](function(_0x5dee5c){_0x4ba753(_0x5dee5c);});else{_0x4ba753({'id':_0x4cc92c['id'],'phone':''});}})[_0xdfae('0x12')](function(_0x2eafb9){logger[_0xdfae('0xf')](_0xdfae('0x13'),_0x2eafb9['message']);_0xb52762(_0x7bfc16[_0xdfae('0xf')](0x1f4,_0x2eafb9[_0xdfae('0x10')]));});}})[_0xdfae('0x12')](function(_0x2ec0b7){logger[_0xdfae('0xf')]('VerifyAdditionalPhones',_0x2ec0b7[_0xdfae('0x10')]);_0xb52762(_0x7bfc16[_0xdfae('0xf')](0x1f4,_0x2ec0b7[_0xdfae('0x10')]));});}else _0x4ba753(0x1);});});};function activateAdditionalPhone(_0x3cae7f,_0x5dd835,_0x4e2a31,_0x57b8f4,_0x38c004){return new Promise(function(_0x1c2a2d,_0x1f7bb3){var _0x1a0b13;if(_[_0xdfae('0x2a')](_0x4e2a31[_0xdfae('0x2b')])){_0x4e2a31[_0xdfae('0x2b')]=moment();}if(moment()>moment(_0x4e2a31[_0xdfae('0x2b')])){_0x1a0b13=moment()['add'](_0x38c004||0x3,'minutes');}else{if(_0x4e2a31[_0xdfae('0x1c')]==0x0){_0x1a0b13=moment(_0x4e2a31[_0xdfae('0x2b')]);}else{_0x1a0b13=moment()[_0xdfae('0x2c')](_0x38c004||0x3,'minutes');}}if(_[_0xdfae('0x2a')](_0x1a0b13)){_0x1a0b13=moment()[_0xdfae('0x2c')](_0x38c004||0x3,_0xdfae('0x2d'));}var _0x17ae40={'phone':_0x3cae7f['phone'],'active':0x0,'OrderBy':_['isNil'](_0x3cae7f[_0xdfae('0x1c')])?0x0:_0x3cae7f[_0xdfae('0x1c')],'scheduledat':moment()[_0xdfae('0x2c')](_0x57b8f4||0x1,_0xdfae('0x2d')),'countbusyretry':_0x5dd835[_0xdfae('0x1e')],'countcongestionretry':_0x5dd835['countcongestionretry'],'countnoanswerretry':_0x5dd835[_0xdfae('0x1f')],'countnosuchnumberretry':_0x5dd835[_0xdfae('0x20')],'countdropretry':_0x5dd835[_0xdfae('0x21')],'countabandonedretry':_0x5dd835[_0xdfae('0x25')],'countmachineretry':_0x5dd835[_0xdfae('0x22')],'countagentrejectretry':_0x5dd835[_0xdfae('0x2e')],'createdAt':_0x5dd835[_0xdfae('0x2f')],'updatedAt':_0x5dd835[_0xdfae('0x30')]};var _0x4e8353={'CmHopperId':_0x3cae7f['id'],'phone':_0x4e2a31[_0xdfae('0x31')],'active':0x0,'OrderBy':_[_0xdfae('0x2a')](_0x4e2a31[_0xdfae('0x1c')])?0x0:_0x4e2a31[_0xdfae('0x1c')],'scheduledat':_0x1a0b13,'countbusyretry':_0x4e2a31[_0xdfae('0x1e')],'countcongestionretry':_0x4e2a31['countcongestionretry'],'countnoanswerretry':_0x4e2a31[_0xdfae('0x1f')],'countnosuchnumberretry':_0x4e2a31['countnosuchnumberretry'],'countdropretry':_0x4e2a31['countdropretry'],'countabandonedretry':_0x4e2a31['countabandonedretry'],'countmachineretry':_0x4e2a31[_0xdfae('0x22')],'countagentrejectretry':_0x4e2a31['countagentrejectretry'],'createdAt':_0x4e2a31[_0xdfae('0x2f')],'updatedAt':_0x4e2a31[_0xdfae('0x30')]};return db[_0xdfae('0x32')][_0xdfae('0x33')](function(_0x1f67fa){return db[_0xdfae('0x1b')]['update'](_0x17ae40,{'where':{'id':_0x4e2a31['id']}},{'transaction':_0x1f67fa})['then'](function(){return db[_0xdfae('0x14')]['update'](_0x4e8353,{'where':{'id':_0x3cae7f['id']}},{'transaction':_0x1f67fa});});})['then'](function(_0x287e68){_0x1c2a2d({'id':_0x3cae7f['id'],'phone':_0x4e2a31[_0xdfae('0x31')]});})['catch'](function(_0x20dc66){logger[_0xdfae('0xf')]('activateAdditionalPhone',_0x20dc66[_0xdfae('0x10')]);_0x1f7bb3({'error':_0x20dc66[_0xdfae('0x10')]});});});}exports[_0xdfae('0x34')]=function(_0x11dcbb){var _0x344fc1=this;return new Promise(function(_0x48f2a9,_0x167330){return db['CmHopper'][_0xdfae('0x35')](_0x11dcbb['body'][_0xdfae('0x36')],{'where':{'id':_0x11dcbb['body']['id']}})[_0xdfae('0xa')](function(_0xde56fb){_0x48f2a9(_0xde56fb);})[_0xdfae('0x12')](function(_0x17aa88){logger[_0xdfae('0xf')](_0xdfae('0x34'),_0x17aa88['message']);_0x167330(_0x344fc1['error'](0x1f4,_0x17aa88[_0xdfae('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index f131733..c8fab31 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 _0x33f8=['/:id','show','post','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x33f8,0x1f4));var _0x833f=function(_0x55cd33,_0x2e27b0){_0x55cd33=_0x55cd33-0x0;var _0x5f4a9d=_0x33f8[_0x55cd33];return _0x5f4a9d;};'use strict';var multer=require(_0x833f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x833f('0x1'));var express=require(_0x833f('0x2'));var router=express['Router']();var fs_extra=require(_0x833f('0x3'));var auth=require(_0x833f('0x4'));var interaction=require(_0x833f('0x5'));var config=require(_0x833f('0x6'));var controller=require(_0x833f('0x7'));router[_0x833f('0x8')]('/',auth[_0x833f('0x9')](),controller['index']);router[_0x833f('0x8')](_0x833f('0xa'),auth[_0x833f('0x9')](),controller[_0x833f('0xb')]);router[_0x833f('0xc')]('/',auth[_0x833f('0x9')](),controller['create']);router[_0x833f('0xd')](_0x833f('0xa'),auth[_0x833f('0x9')](),controller[_0x833f('0xe')]);router[_0x833f('0xf')]('/:id',auth[_0x833f('0x9')](),controller['destroy']);module[_0x833f('0x10')]=router; \ No newline at end of file +var _0x0805=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0805,0x1c9));var _0x5080=function(_0x27d627,_0x4d4c2c){_0x27d627=_0x27d627-0x0;var _0x50f6f3=_0x0805[_0x27d627];return _0x50f6f3;};'use strict';var multer=require(_0x5080('0x0'));var util=require(_0x5080('0x1'));var path=require(_0x5080('0x2'));var timeout=require(_0x5080('0x3'));var express=require(_0x5080('0x4'));var router=express[_0x5080('0x5')]();var fs_extra=require(_0x5080('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5080('0x7'));var config=require(_0x5080('0x8'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x5080('0x9')]('/',auth['isAuthenticated'](),controller[_0x5080('0xa')]);router['get'](_0x5080('0xb'),auth[_0x5080('0xc')](),controller[_0x5080('0xd')]);router[_0x5080('0xe')]('/',auth['isAuthenticated'](),controller[_0x5080('0xf')]);router[_0x5080('0x10')]('/:id',auth[_0x5080('0xc')](),controller[_0x5080('0x11')]);router[_0x5080('0x12')](_0x5080('0xb'),auth['isAuthenticated'](),controller['destroy']);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 bc75a41..ec8c5bb 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 _0x7eff=['exports','STRING','contactListQueue','INTEGER','sequelize'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0x7eff,0x162));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0xf7ef('0x0'));module[_0xf7ef('0x1')]={'phone':{'type':Sequelize[_0xf7ef('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xf7ef('0x3')},'ListId':{'type':Sequelize[_0xf7ef('0x4')],'unique':_0xf7ef('0x3')},'VoiceQueueId':{'type':Sequelize[_0xf7ef('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x0ab2=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x3dcbc8,_0x4f9f95){var _0x312aed=function(_0x1f246f){while(--_0x1f246f){_0x3dcbc8['push'](_0x3dcbc8['shift']());}};_0x312aed(++_0x4f9f95);}(_0x0ab2,0x9a));var _0x20ab=function(_0x19f866,_0xf68c27){_0x19f866=_0x19f866-0x0;var _0x59bf91=_0x0ab2[_0x19f866];return _0x59bf91;};'use strict';var moment=require(_0x20ab('0x0'));var Sequelize=require(_0x20ab('0x1'));module[_0x20ab('0x2')]={'phone':{'type':Sequelize[_0x20ab('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x20ab('0x4')],'unique':_0x20ab('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x20ab('0x4')],'unique':_0x20ab('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c346112..d6add30 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 _0x3423=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','rows','show','intersection','includeAll','find','catch','body','destroy','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x44da86,_0x4ceab2){var _0x594400=function(_0x3e071a){while(--_0x3e071a){_0x44da86['push'](_0x44da86['shift']());}};_0x594400(++_0x4ceab2);}(_0x3423,0x127));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3342('0x0'));var rimraf=require(_0x3342('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3342('0x2'));var rp=require(_0x3342('0x3'));var moment=require(_0x3342('0x4'));var BPromise=require(_0x3342('0x5'));var Mustache=require('mustache');var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3342('0x8'));var fs=require('fs');var fs_extra=require(_0x3342('0x9'));var _=require(_0x3342('0xa'));var squel=require(_0x3342('0xb'));var crypto=require(_0x3342('0xc'));var jsforce=require(_0x3342('0xd'));var deskjs=require(_0x3342('0xe'));var toCsv=require(_0x3342('0xf'));var querystring=require(_0x3342('0x10'));var Papa=require(_0x3342('0x11'));var Redis=require(_0x3342('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3342('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3342('0x14'));var logger=require(_0x3342('0x15'))(_0x3342('0x16'));var utils=require(_0x3342('0x17'));var config=require(_0x3342('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3342('0x19'))['db'];function respondWithStatusCode(_0x233588,_0x4ccae8){_0x4ccae8=_0x4ccae8||0xcc;return function(_0x2a8069){if(_0x2a8069){return _0x233588[_0x3342('0x1a')](_0x4ccae8);}return _0x233588[_0x3342('0x1b')](_0x4ccae8)[_0x3342('0x1c')]();};}function respondWithResult(_0x5356a0,_0x47702f){_0x47702f=_0x47702f||0xc8;return function(_0x58c047){if(_0x58c047){return _0x5356a0[_0x3342('0x1b')](_0x47702f)['json'](_0x58c047);}};}function respondWithFilteredResult(_0x2de0ad,_0x55985a){return function(_0x428845){if(_0x428845){var _0x43bf30=typeof _0x55985a['offset']===_0x3342('0x1d')&&typeof _0x55985a['limit']===_0x3342('0x1d');var _0xcdc4ed=_0x428845[_0x3342('0x1e')];var _0x3c4fc7=_0x43bf30?0x0:_0x55985a['offset'];var _0x42d874=_0x43bf30?_0x428845['count']:_0x55985a[_0x3342('0x1f')]+_0x55985a[_0x3342('0x20')];var _0x4c62ce;if(_0x42d874>=_0xcdc4ed){_0x42d874=_0xcdc4ed;_0x4c62ce=0xc8;}else{_0x4c62ce=0xce;}_0x2de0ad['status'](_0x4c62ce);return _0x2de0ad[_0x3342('0x21')](_0x3342('0x22'),_0x3c4fc7+'-'+_0x42d874+'/'+_0xcdc4ed)[_0x3342('0x23')](_0x428845);}return null;};}function patchUpdates(_0x2c5dbd){return function(_0x457903){try{jsonpatch[_0x3342('0x24')](_0x457903,_0x2c5dbd,!![]);}catch(_0x3880a6){return BPromise[_0x3342('0x25')](_0x3880a6);}return _0x457903[_0x3342('0x26')]();};}function saveUpdates(_0x3ec4d9,_0x3ea289){return function(_0x43a636){if(_0x43a636){return _0x43a636[_0x3342('0x27')](_0x3ec4d9)[_0x3342('0x28')](function(_0x214519){return _0x214519;});}return null;};}function removeEntity(_0x20103b,_0x3171d9){return function(_0x2596c4){if(_0x2596c4){return _0x2596c4['destroy']()[_0x3342('0x28')](function(){_0x20103b[_0x3342('0x1b')](0xcc)[_0x3342('0x1c')]();});}};}function handleEntityNotFound(_0x1f663c,_0x58afe5){return function(_0x38cf4e){if(!_0x38cf4e){_0x1f663c['sendStatus'](0x194);}return _0x38cf4e;};}function handleError(_0xe1fa9c,_0x1c7cdf){_0x1c7cdf=_0x1c7cdf||0x1f4;return function(_0x3f177f){logger[_0x3342('0x29')](_0x3f177f[_0x3342('0x2a')]);if(_0x3f177f[_0x3342('0x2b')]){delete _0x3f177f[_0x3342('0x2b')];}_0xe1fa9c[_0x3342('0x1b')](_0x1c7cdf)['send'](_0x3f177f);};}exports[_0x3342('0x2c')]=function(_0x31f199,_0x182d42){var _0x43158b={},_0x2af76a={},_0x442db4={'count':0x0,'rows':[]};var _0x2071cb=_[_0x3342('0x2d')](db[_0x3342('0x2e')][_0x3342('0x2f')],function(_0x377324){return{'name':_0x377324[_0x3342('0x30')],'type':_0x377324['type'][_0x3342('0x31')]};});_0x2af76a[_0x3342('0x32')]=_[_0x3342('0x2d')](_0x2071cb,_0x3342('0x2b'));_0x2af76a[_0x3342('0x33')]=_[_0x3342('0x34')](_0x31f199[_0x3342('0x33')]);_0x2af76a[_0x3342('0x35')]=_['intersection'](_0x2af76a[_0x3342('0x32')],_0x2af76a[_0x3342('0x33')]);_0x43158b[_0x3342('0x36')]=_['intersection'](_0x2af76a[_0x3342('0x32')],qs[_0x3342('0x37')](_0x31f199[_0x3342('0x33')][_0x3342('0x37')]));_0x43158b[_0x3342('0x36')]=_0x43158b[_0x3342('0x36')][_0x3342('0x38')]?_0x43158b['attributes']:_0x2af76a[_0x3342('0x32')];if(!_0x31f199['query'][_0x3342('0x39')](_0x3342('0x3a'))){_0x43158b[_0x3342('0x20')]=qs[_0x3342('0x20')](_0x31f199['query']['limit']);_0x43158b[_0x3342('0x1f')]=qs[_0x3342('0x1f')](_0x31f199['query'][_0x3342('0x1f')]);}_0x43158b[_0x3342('0x3b')]=qs[_0x3342('0x3c')](_0x31f199['query']['sort']);_0x43158b[_0x3342('0x3d')]=qs['filters'](_[_0x3342('0x3e')](_0x31f199[_0x3342('0x33')],_0x2af76a[_0x3342('0x35')]),_0x2071cb);if(_0x31f199[_0x3342('0x33')][_0x3342('0x3f')]){_0x43158b['where']=_['merge'](_0x43158b[_0x3342('0x3d')],{'$or':_[_0x3342('0x2d')](_0x2071cb,function(_0x626d87){if(_0x626d87[_0x3342('0x40')]!==_0x3342('0x41')){var _0x4167c0={};_0x4167c0[_0x626d87['name']]={'$like':'%'+_0x31f199[_0x3342('0x33')][_0x3342('0x3f')]+'%'};return _0x4167c0;}})});}_0x43158b=_[_0x3342('0x42')]({},_0x43158b,_0x31f199[_0x3342('0x43')]);var _0x15a6f9={'where':_0x43158b[_0x3342('0x3d')]};return db['CmHopperBlack']['count'](_0x15a6f9)[_0x3342('0x28')](function(_0xf5682c){_0x442db4['count']=_0xf5682c;if(_0x31f199[_0x3342('0x33')]['includeAll']){_0x43158b[_0x3342('0x44')]=[{'all':!![]}];}return db[_0x3342('0x2e')]['findAll'](_0x43158b);})['then'](function(_0x54c684){_0x442db4[_0x3342('0x45')]=_0x54c684;return _0x442db4;})['then'](respondWithFilteredResult(_0x182d42,_0x43158b))['catch'](handleError(_0x182d42,null));};exports[_0x3342('0x46')]=function(_0x5d211f,_0x400e04){var _0x58566b={'raw':!![],'where':{'id':_0x5d211f['params']['id']}},_0x31370d={};_0x31370d['model']=_[_0x3342('0x34')](db['CmHopperBlack'][_0x3342('0x2f')]);_0x31370d[_0x3342('0x33')]=_[_0x3342('0x34')](_0x5d211f[_0x3342('0x33')]);_0x31370d['filters']=_[_0x3342('0x47')](_0x31370d[_0x3342('0x32')],_0x31370d[_0x3342('0x33')]);_0x58566b['attributes']=_[_0x3342('0x47')](_0x31370d['model'],qs[_0x3342('0x37')](_0x5d211f[_0x3342('0x33')][_0x3342('0x37')]));_0x58566b[_0x3342('0x36')]=_0x58566b[_0x3342('0x36')][_0x3342('0x38')]?_0x58566b['attributes']:_0x31370d[_0x3342('0x32')];if(_0x5d211f[_0x3342('0x33')][_0x3342('0x48')]){_0x58566b[_0x3342('0x44')]=[{'all':!![]}];}_0x58566b=_['merge']({},_0x58566b,_0x5d211f['options']);return db[_0x3342('0x2e')][_0x3342('0x49')](_0x58566b)[_0x3342('0x28')](handleEntityNotFound(_0x400e04,null))[_0x3342('0x28')](respondWithResult(_0x400e04,null))[_0x3342('0x4a')](handleError(_0x400e04,null));};exports[_0x3342('0x27')]=function(_0xa255ab,_0x5914bd){if(_0xa255ab[_0x3342('0x4b')]['id']){delete _0xa255ab[_0x3342('0x4b')]['id'];}return db[_0x3342('0x2e')][_0x3342('0x49')]({'where':{'id':_0xa255ab['params']['id']}})[_0x3342('0x28')](handleEntityNotFound(_0x5914bd,null))[_0x3342('0x28')](saveUpdates(_0xa255ab[_0x3342('0x4b')],null))['then'](respondWithResult(_0x5914bd,null))['catch'](handleError(_0x5914bd,null));};exports[_0x3342('0x4c')]=function(_0x50a2fa,_0x3342e3){return db[_0x3342('0x2e')][_0x3342('0x49')]({'where':{'id':_0x50a2fa[_0x3342('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3342e3,null))['then'](removeEntity(_0x3342e3,null))[_0x3342('0x4a')](handleError(_0x3342e3,null));};exports[_0x3342('0x4e')]=function(_0x448e7b,_0x43971e){return db[_0x3342('0x2e')][_0x3342('0x4e')]()[_0x3342('0x28')](respondWithResult(_0x43971e,null))[_0x3342('0x4a')](handleError(_0x43971e,null));}; \ No newline at end of file +var _0x3ea2=['attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','query','keys','filters','intersection','model'];(function(_0x289190,_0x54a1af){var _0x4fa62e=function(_0x446b34){while(--_0x446b34){_0x289190['push'](_0x289190['shift']());}};_0x4fa62e(++_0x54a1af);}(_0x3ea2,0x1b1));var _0x23ea=function(_0x2e712f,_0x60d75f){_0x2e712f=_0x2e712f-0x0;var _0x2fb152=_0x3ea2[_0x2e712f];return _0x2fb152;};'use strict';var emlformat=require(_0x23ea('0x0'));var rimraf=require(_0x23ea('0x1'));var zipdir=require(_0x23ea('0x2'));var jsonpatch=require(_0x23ea('0x3'));var rp=require(_0x23ea('0x4'));var moment=require(_0x23ea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x23ea('0x6'));var util=require('util');var path=require(_0x23ea('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23ea('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x23ea('0x9'));var jsforce=require(_0x23ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x23ea('0xb'));var querystring=require(_0x23ea('0xc'));var Papa=require(_0x23ea('0xd'));var Redis=require(_0x23ea('0xe'));var authService=require(_0x23ea('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x23ea('0x10'));var hardwareService=require(_0x23ea('0x11'));var logger=require(_0x23ea('0x12'))(_0x23ea('0x13'));var utils=require('../../config/utils');var config=require(_0x23ea('0x14'));var licenseUtil=require(_0x23ea('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cab50,_0x15c67e){_0x15c67e=_0x15c67e||0xcc;return function(_0x186211){if(_0x186211){return _0x2cab50[_0x23ea('0x16')](_0x15c67e);}return _0x2cab50[_0x23ea('0x17')](_0x15c67e)[_0x23ea('0x18')]();};}function respondWithResult(_0x18172d,_0x22cd6e){_0x22cd6e=_0x22cd6e||0xc8;return function(_0x1f93c7){if(_0x1f93c7){return _0x18172d['status'](_0x22cd6e)[_0x23ea('0x19')](_0x1f93c7);}};}function respondWithFilteredResult(_0xa016f7,_0x13f920){return function(_0x5e65ac){if(_0x5e65ac){var _0x3f11b7=typeof _0x13f920['offset']===_0x23ea('0x1a')&&typeof _0x13f920[_0x23ea('0x1b')]===_0x23ea('0x1a');var _0x407c4c=_0x5e65ac[_0x23ea('0x1c')];var _0x53e18e=_0x3f11b7?0x0:_0x13f920[_0x23ea('0x1d')];var _0x1a645b=_0x3f11b7?_0x5e65ac[_0x23ea('0x1c')]:_0x13f920[_0x23ea('0x1d')]+_0x13f920[_0x23ea('0x1b')];var _0x507155;if(_0x1a645b>=_0x407c4c){_0x1a645b=_0x407c4c;_0x507155=0xc8;}else{_0x507155=0xce;}_0xa016f7[_0x23ea('0x17')](_0x507155);return _0xa016f7[_0x23ea('0x1e')]('Content-Range',_0x53e18e+'-'+_0x1a645b+'/'+_0x407c4c)[_0x23ea('0x19')](_0x5e65ac);}return null;};}function patchUpdates(_0x1632c0){return function(_0x54cc3c){try{jsonpatch[_0x23ea('0x1f')](_0x54cc3c,_0x1632c0,!![]);}catch(_0x57cf47){return BPromise[_0x23ea('0x20')](_0x57cf47);}return _0x54cc3c['save']();};}function saveUpdates(_0x2a110d,_0x7bad07){return function(_0x32e82f){if(_0x32e82f){return _0x32e82f[_0x23ea('0x21')](_0x2a110d)[_0x23ea('0x22')](function(_0x95e3e0){return _0x95e3e0;});}return null;};}function removeEntity(_0xac298a,_0x52dc95){return function(_0x1c44ed){if(_0x1c44ed){return _0x1c44ed['destroy']()[_0x23ea('0x22')](function(){_0xac298a[_0x23ea('0x17')](0xcc)[_0x23ea('0x18')]();});}};}function handleEntityNotFound(_0x5aa39b,_0x57d2da){return function(_0x363812){if(!_0x363812){_0x5aa39b[_0x23ea('0x16')](0x194);}return _0x363812;};}function handleError(_0x475ea5,_0x58b7d4){_0x58b7d4=_0x58b7d4||0x1f4;return function(_0x1c6c5){logger[_0x23ea('0x23')](_0x1c6c5[_0x23ea('0x24')]);if(_0x1c6c5['name']){delete _0x1c6c5[_0x23ea('0x25')];}_0x475ea5[_0x23ea('0x17')](_0x58b7d4)[_0x23ea('0x26')](_0x1c6c5);};}exports[_0x23ea('0x27')]=function(_0x4bdadf,_0x4d9ebc){var _0x958807={},_0x275032={},_0x4d6f9f={'count':0x0,'rows':[]};var _0x440d1c=_[_0x23ea('0x28')](db[_0x23ea('0x29')][_0x23ea('0x2a')],function(_0x5bf78b){return{'name':_0x5bf78b[_0x23ea('0x2b')],'type':_0x5bf78b[_0x23ea('0x2c')]['key']};});_0x275032['model']=_[_0x23ea('0x28')](_0x440d1c,'name');_0x275032[_0x23ea('0x2d')]=_[_0x23ea('0x2e')](_0x4bdadf[_0x23ea('0x2d')]);_0x275032[_0x23ea('0x2f')]=_[_0x23ea('0x30')](_0x275032[_0x23ea('0x31')],_0x275032[_0x23ea('0x2d')]);_0x958807[_0x23ea('0x32')]=_[_0x23ea('0x30')](_0x275032[_0x23ea('0x31')],qs[_0x23ea('0x33')](_0x4bdadf[_0x23ea('0x2d')][_0x23ea('0x33')]));_0x958807[_0x23ea('0x32')]=_0x958807['attributes'][_0x23ea('0x34')]?_0x958807['attributes']:_0x275032[_0x23ea('0x31')];if(!_0x4bdadf[_0x23ea('0x2d')][_0x23ea('0x35')]('nolimit')){_0x958807['limit']=qs['limit'](_0x4bdadf[_0x23ea('0x2d')]['limit']);_0x958807['offset']=qs[_0x23ea('0x1d')](_0x4bdadf['query'][_0x23ea('0x1d')]);}_0x958807['order']=qs[_0x23ea('0x36')](_0x4bdadf[_0x23ea('0x2d')][_0x23ea('0x36')]);_0x958807[_0x23ea('0x37')]=qs[_0x23ea('0x2f')](_[_0x23ea('0x38')](_0x4bdadf[_0x23ea('0x2d')],_0x275032[_0x23ea('0x2f')]),_0x440d1c);if(_0x4bdadf['query'][_0x23ea('0x39')]){_0x958807[_0x23ea('0x37')]=_[_0x23ea('0x3a')](_0x958807['where'],{'$or':_[_0x23ea('0x28')](_0x440d1c,function(_0x325f90){if(_0x325f90[_0x23ea('0x2c')]!==_0x23ea('0x3b')){var _0x2542a2={};_0x2542a2[_0x325f90['name']]={'$like':'%'+_0x4bdadf['query'][_0x23ea('0x39')]+'%'};return _0x2542a2;}})});}_0x958807=_[_0x23ea('0x3a')]({},_0x958807,_0x4bdadf[_0x23ea('0x3c')]);var _0x924f5e={'where':_0x958807['where']};return db['CmHopperBlack']['count'](_0x924f5e)['then'](function(_0x221e04){_0x4d6f9f['count']=_0x221e04;if(_0x4bdadf[_0x23ea('0x2d')][_0x23ea('0x3d')]){_0x958807[_0x23ea('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x958807);})[_0x23ea('0x22')](function(_0x22d8c4){_0x4d6f9f['rows']=_0x22d8c4;return _0x4d6f9f;})['then'](respondWithFilteredResult(_0x4d9ebc,_0x958807))[_0x23ea('0x3f')](handleError(_0x4d9ebc,null));};exports['show']=function(_0x12eef7,_0x448509){var _0xebd6cd={'raw':!![],'where':{'id':_0x12eef7[_0x23ea('0x40')]['id']}},_0x4ae9f5={};_0x4ae9f5[_0x23ea('0x31')]=_[_0x23ea('0x2e')](db[_0x23ea('0x29')][_0x23ea('0x2a')]);_0x4ae9f5[_0x23ea('0x2d')]=_[_0x23ea('0x2e')](_0x12eef7[_0x23ea('0x2d')]);_0x4ae9f5['filters']=_[_0x23ea('0x30')](_0x4ae9f5[_0x23ea('0x31')],_0x4ae9f5['query']);_0xebd6cd[_0x23ea('0x32')]=_[_0x23ea('0x30')](_0x4ae9f5[_0x23ea('0x31')],qs[_0x23ea('0x33')](_0x12eef7[_0x23ea('0x2d')][_0x23ea('0x33')]));_0xebd6cd[_0x23ea('0x32')]=_0xebd6cd['attributes'][_0x23ea('0x34')]?_0xebd6cd[_0x23ea('0x32')]:_0x4ae9f5[_0x23ea('0x31')];if(_0x12eef7['query'][_0x23ea('0x3d')]){_0xebd6cd[_0x23ea('0x3e')]=[{'all':!![]}];}_0xebd6cd=_[_0x23ea('0x3a')]({},_0xebd6cd,_0x12eef7[_0x23ea('0x3c')]);return db[_0x23ea('0x29')][_0x23ea('0x41')](_0xebd6cd)['then'](handleEntityNotFound(_0x448509,null))['then'](respondWithResult(_0x448509,null))[_0x23ea('0x3f')](handleError(_0x448509,null));};exports[_0x23ea('0x21')]=function(_0x23cd5a,_0x585eeb){if(_0x23cd5a[_0x23ea('0x42')]['id']){delete _0x23cd5a[_0x23ea('0x42')]['id'];}return db['CmHopperBlack'][_0x23ea('0x41')]({'where':{'id':_0x23cd5a[_0x23ea('0x40')]['id']}})[_0x23ea('0x22')](handleEntityNotFound(_0x585eeb,null))[_0x23ea('0x22')](saveUpdates(_0x23cd5a[_0x23ea('0x42')],null))[_0x23ea('0x22')](respondWithResult(_0x585eeb,null))['catch'](handleError(_0x585eeb,null));};exports[_0x23ea('0x43')]=function(_0x44f966,_0x5a0a28){return db[_0x23ea('0x29')][_0x23ea('0x41')]({'where':{'id':_0x44f966[_0x23ea('0x40')]['id']}})['then'](handleEntityNotFound(_0x5a0a28,null))[_0x23ea('0x22')](removeEntity(_0x5a0a28,null))[_0x23ea('0x3f')](handleError(_0x5a0a28,null));};exports[_0x23ea('0x44')]=function(_0x55dff7,_0x46d5e1){return db[_0x23ea('0x29')][_0x23ea('0x44')]()[_0x23ea('0x22')](respondWithResult(_0x46d5e1,null))[_0x23ea('0x3f')](handleError(_0x46d5e1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3d03781..34fb804 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 _0x2b8a=['lodash','../../config/logger','request-promise','rimraf','../../config/environment','exports','CmHopperBlack','cm_hopper_black'];(function(_0x3e8023,_0x375e6e){var _0x106af0=function(_0x1dc956){while(--_0x1dc956){_0x3e8023['push'](_0x3e8023['shift']());}};_0x106af0(++_0x375e6e);}(_0x2b8a,0xe0));var _0xa2b8=function(_0x10731f,_0x3b60bd){_0x10731f=_0x10731f-0x0;var _0x859c=_0x2b8a[_0x10731f];return _0x859c;};'use strict';var _=require(_0xa2b8('0x0'));var util=require('util');var logger=require(_0xa2b8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa2b8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2b8('0x3'));var config=require(_0xa2b8('0x4'));var attributes=require('./cmHopperBlack.attributes');module[_0xa2b8('0x5')]=function(_0xcf2e73,_0x334d50){return _0xcf2e73['define'](_0xa2b8('0x6'),attributes,{'tableName':_0xa2b8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47fa=['cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperBlack'];(function(_0x5f158a,_0x54cbaa){var _0x488d5b=function(_0x577030){while(--_0x577030){_0x5f158a['push'](_0x5f158a['shift']());}};_0x488d5b(++_0x54cbaa);}(_0x47fa,0x1ae));var _0xa47f=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x47fa[_0x10dc64];return _0x9cf98d;};'use strict';var _=require(_0xa47f('0x0'));var util=require(_0xa47f('0x1'));var logger=require(_0xa47f('0x2'))(_0xa47f('0x3'));var moment=require('moment');var BPromise=require(_0xa47f('0x4'));var rp=require(_0xa47f('0x5'));var fs=require('fs');var path=require(_0xa47f('0x6'));var rimraf=require(_0xa47f('0x7'));var config=require(_0xa47f('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0xa47f('0x9')]=function(_0x44619c,_0x2265f4){return _0x44619c[_0xa47f('0xa')](_0xa47f('0xb'),attributes,{'tableName':_0xa47f('0xc'),'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 7082e80..4fbf8ce 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 _0x29f2=['destroy','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','limit','include','model','attributes','map','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack'];(function(_0x3b9716,_0x19c124){var _0x3eb0ca=function(_0x28b16b){while(--_0x28b16b){_0x3b9716['push'](_0x3b9716['shift']());}};_0x3eb0ca(++_0x19c124);}(_0x29f2,0xe5));var _0x229f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x229f('0x0'));var util=require(_0x229f('0x1'));var moment=require(_0x229f('0x2'));var BPromise=require('bluebird');var rs=require(_0x229f('0x3'));var fs=require('fs');var Redis=require(_0x229f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x229f('0x5'));var logger=require('../../config/logger')(_0x229f('0x6'));var config=require(_0x229f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x229f('0x8')][_0x229f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ea6cd,_0x5ace26,_0x49cc94){return new BPromise(function(_0x31e24c,_0x9f2b2c){return client[_0x229f('0xa')](_0x4ea6cd,_0x49cc94)[_0x229f('0xb')](function(_0x53dbf2){logger[_0x229f('0xc')](_0x229f('0xd'),_0x5ace26,_0x229f('0xe'));logger[_0x229f('0xf')](_0x229f('0x10'),_0x5ace26,_0x229f('0xe'),JSON[_0x229f('0x11')](_0x53dbf2));if(_0x53dbf2['error']){if(_0x53dbf2[_0x229f('0x12')][_0x229f('0x13')]===0x1f4){logger[_0x229f('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x5ace26,_0x53dbf2[_0x229f('0x12')]['message']);return _0x9f2b2c(_0x53dbf2[_0x229f('0x12')][_0x229f('0x14')]);}logger[_0x229f('0x12')](_0x229f('0xd'),_0x5ace26,_0x53dbf2[_0x229f('0x12')][_0x229f('0x14')]);return _0x31e24c(_0x53dbf2['error'][_0x229f('0x14')]);}else{logger[_0x229f('0xc')](_0x229f('0xd'),_0x5ace26,_0x229f('0xe'));_0x31e24c(_0x53dbf2[_0x229f('0x15')]['message']);}})[_0x229f('0x16')](function(_0x28ff2f){logger[_0x229f('0x12')](_0x229f('0xd'),_0x5ace26,_0x28ff2f);_0x9f2b2c(_0x28ff2f);});});}exports[_0x229f('0x17')]=function(_0x3c8da6){var _0x1f79cc=this;return new Promise(function(_0x2170b2,_0x5928f8){return db[_0x229f('0x18')]['findAll']({'raw':_0x3c8da6[_0x229f('0x19')]?_0x3c8da6[_0x229f('0x19')][_0x229f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c8da6[_0x229f('0x19')]?_0x3c8da6['options'][_0x229f('0x1b')]||null:null,'attributes':_0x3c8da6['options']?_0x3c8da6[_0x229f('0x19')]['attributes']||null:null,'limit':_0x3c8da6['options']?_0x3c8da6[_0x229f('0x19')][_0x229f('0x1c')]||null:null,'include':_0x3c8da6[_0x229f('0x19')]?_0x3c8da6[_0x229f('0x19')][_0x229f('0x1d')]?_['map'](_0x3c8da6[_0x229f('0x19')][_0x229f('0x1d')],function(_0x2b547a){return{'model':db[_0x2b547a[_0x229f('0x1e')]],'as':_0x2b547a['as'],'attributes':_0x2b547a[_0x229f('0x1f')],'include':_0x2b547a[_0x229f('0x1d')]?_[_0x229f('0x20')](_0x2b547a[_0x229f('0x1d')],function(_0x4ba139){return{'model':db[_0x4ba139[_0x229f('0x1e')]],'as':_0x4ba139['as'],'attributes':_0x4ba139[_0x229f('0x1f')],'include':_0x4ba139['include']?_[_0x229f('0x20')](_0x4ba139[_0x229f('0x1d')],function(_0x382dcd){return{'model':db[_0x382dcd['model']],'as':_0x382dcd['as'],'attributes':_0x382dcd['attributes']};}):[]};}):[]};}):[]:[]})[_0x229f('0xb')](function(_0x4b5ec0){logger[_0x229f('0xc')](_0x229f('0x17'),_0x3c8da6);logger[_0x229f('0xf')]('GetCmHopperBlack',_0x3c8da6,JSON[_0x229f('0x11')](_0x4b5ec0));_0x2170b2(_0x4b5ec0);})[_0x229f('0x16')](function(_0x724d7){logger[_0x229f('0x12')](_0x229f('0x17'),_0x724d7[_0x229f('0x14')],_0x3c8da6);_0x5928f8(_0x1f79cc[_0x229f('0x12')](0x1f4,_0x724d7['message']));});});};exports[_0x229f('0x21')]=function(_0x38dd37){var _0x2c9705=this;return new Promise(function(_0x4a539c,_0x1d4b86){return db['CmHopperBlack'][_0x229f('0x22')](_0x38dd37[_0x229f('0x23')],{'raw':_0x38dd37[_0x229f('0x19')]?_0x38dd37['options'][_0x229f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38dd37[_0x229f('0x19')]?_0x38dd37[_0x229f('0x19')][_0x229f('0x1b')]||null:null,'attributes':_0x38dd37[_0x229f('0x19')]?_0x38dd37[_0x229f('0x19')][_0x229f('0x1f')]||null:null,'limit':_0x38dd37[_0x229f('0x19')]?_0x38dd37['options'][_0x229f('0x1c')]||null:null})[_0x229f('0xb')](function(_0x287db1){logger[_0x229f('0xc')](_0x229f('0x21'),_0x38dd37);logger['debug'](_0x229f('0x21'),_0x38dd37,JSON['stringify'](_0x287db1));_0x4a539c(_0x287db1);})['catch'](function(_0x19268b){logger[_0x229f('0x12')](_0x229f('0x21'),_0x19268b[_0x229f('0x14')],_0x38dd37);_0x1d4b86(_0x2c9705[_0x229f('0x12')](0x1f4,_0x19268b['message']));});});};exports[_0x229f('0x24')]=function(_0x236db0){var _0x5b2a0d=this;return new Promise(function(_0x4ac084,_0x6aecf6){return db[_0x229f('0x18')][_0x229f('0x25')]({'where':_0x236db0[_0x229f('0x19')]?_0x236db0[_0x229f('0x19')][_0x229f('0x1b')]||null:null})['then'](function(_0xa024ea){logger[_0x229f('0xc')](_0x229f('0x24'),_0x236db0);logger[_0x229f('0xf')]('DestroyCmHopperBlack',_0x236db0,JSON[_0x229f('0x11')](_0xa024ea));_0x4ac084(_0xa024ea);})[_0x229f('0x16')](function(_0x3a7777){logger[_0x229f('0x12')](_0x229f('0x24'),_0x3a7777[_0x229f('0x14')],_0x236db0);_0x6aecf6(_0x5b2a0d[_0x229f('0x12')](0x1f4,_0x3a7777[_0x229f('0x14')]));});});}; \ No newline at end of file +var _0x7a2f=['CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','model','include','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50ffda,_0x17fd9){var _0x992861=function(_0x100679){while(--_0x100679){_0x50ffda['push'](_0x50ffda['shift']());}};_0x992861(++_0x17fd9);}(_0x7a2f,0x6d));var _0xf7a2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a2f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf7a2('0x0'));var util=require(_0xf7a2('0x1'));var moment=require(_0xf7a2('0x2'));var BPromise=require(_0xf7a2('0x3'));var rs=require(_0xf7a2('0x4'));var fs=require('fs');var Redis=require(_0xf7a2('0x5'));var db=require(_0xf7a2('0x6'))['db'];var utils=require(_0xf7a2('0x7'));var logger=require(_0xf7a2('0x8'))(_0xf7a2('0x9'));var config=require(_0xf7a2('0xa'));var jayson=require(_0xf7a2('0xb'));var client=jayson[_0xf7a2('0xc')][_0xf7a2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x563060,_0x5cbd5b,_0xd725e3){return new BPromise(function(_0x5e78eb,_0x552014){return client[_0xf7a2('0xe')](_0x563060,_0xd725e3)[_0xf7a2('0xf')](function(_0x4ead58){logger[_0xf7a2('0x10')](_0xf7a2('0x11'),_0x5cbd5b,_0xf7a2('0x12'));logger[_0xf7a2('0x13')](_0xf7a2('0x14'),_0x5cbd5b,'request\x20sent',JSON[_0xf7a2('0x15')](_0x4ead58));if(_0x4ead58[_0xf7a2('0x16')]){if(_0x4ead58[_0xf7a2('0x16')][_0xf7a2('0x17')]===0x1f4){logger[_0xf7a2('0x16')]('CmHopperBlack,\x20%s,\x20%s',_0x5cbd5b,_0x4ead58[_0xf7a2('0x16')][_0xf7a2('0x18')]);return _0x552014(_0x4ead58[_0xf7a2('0x16')][_0xf7a2('0x18')]);}logger[_0xf7a2('0x16')](_0xf7a2('0x11'),_0x5cbd5b,_0x4ead58[_0xf7a2('0x16')][_0xf7a2('0x18')]);return _0x5e78eb(_0x4ead58[_0xf7a2('0x16')][_0xf7a2('0x18')]);}else{logger['info'](_0xf7a2('0x11'),_0x5cbd5b,_0xf7a2('0x12'));_0x5e78eb(_0x4ead58[_0xf7a2('0x19')][_0xf7a2('0x18')]);}})[_0xf7a2('0x1a')](function(_0x232967){logger[_0xf7a2('0x16')](_0xf7a2('0x11'),_0x5cbd5b,_0x232967);_0x552014(_0x232967);});});}exports[_0xf7a2('0x1b')]=function(_0x57e81c){var _0x8fd6ad=this;return new Promise(function(_0x1647d5,_0x1038d4){return db[_0xf7a2('0x1c')][_0xf7a2('0x1d')]({'raw':_0x57e81c[_0xf7a2('0x1e')]?_0x57e81c[_0xf7a2('0x1e')][_0xf7a2('0x1f')]===undefined?!![]:![]:!![],'where':_0x57e81c['options']?_0x57e81c[_0xf7a2('0x1e')][_0xf7a2('0x20')]||null:null,'attributes':_0x57e81c[_0xf7a2('0x1e')]?_0x57e81c[_0xf7a2('0x1e')][_0xf7a2('0x21')]||null:null,'limit':_0x57e81c['options']?_0x57e81c[_0xf7a2('0x1e')][_0xf7a2('0x22')]||null:null,'include':_0x57e81c[_0xf7a2('0x1e')]?_0x57e81c[_0xf7a2('0x1e')]['include']?_[_0xf7a2('0x23')](_0x57e81c[_0xf7a2('0x1e')]['include'],function(_0x43acf7){return{'model':db[_0x43acf7[_0xf7a2('0x24')]],'as':_0x43acf7['as'],'attributes':_0x43acf7['attributes'],'include':_0x43acf7['include']?_['map'](_0x43acf7[_0xf7a2('0x25')],function(_0x841b9e){return{'model':db[_0x841b9e[_0xf7a2('0x24')]],'as':_0x841b9e['as'],'attributes':_0x841b9e[_0xf7a2('0x21')],'include':_0x841b9e['include']?_['map'](_0x841b9e[_0xf7a2('0x25')],function(_0x4c8041){return{'model':db[_0x4c8041['model']],'as':_0x4c8041['as'],'attributes':_0x4c8041[_0xf7a2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf7a2('0xf')](function(_0x3eb3b7){logger[_0xf7a2('0x10')](_0xf7a2('0x1b'),_0x57e81c);logger[_0xf7a2('0x13')]('GetCmHopperBlack',_0x57e81c,JSON[_0xf7a2('0x15')](_0x3eb3b7));_0x1647d5(_0x3eb3b7);})[_0xf7a2('0x1a')](function(_0x46cdc2){logger[_0xf7a2('0x16')](_0xf7a2('0x1b'),_0x46cdc2['message'],_0x57e81c);_0x1038d4(_0x8fd6ad[_0xf7a2('0x16')](0x1f4,_0x46cdc2[_0xf7a2('0x18')]));});});};exports[_0xf7a2('0x26')]=function(_0xe32f32){var _0x375200=this;return new Promise(function(_0x13513c,_0x5644e3){return db[_0xf7a2('0x1c')][_0xf7a2('0x27')](_0xe32f32[_0xf7a2('0x28')],{'raw':_0xe32f32['options']?_0xe32f32['options'][_0xf7a2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe32f32[_0xf7a2('0x1e')]?_0xe32f32[_0xf7a2('0x1e')][_0xf7a2('0x20')]||null:null,'attributes':_0xe32f32[_0xf7a2('0x1e')]?_0xe32f32['options'][_0xf7a2('0x21')]||null:null,'limit':_0xe32f32[_0xf7a2('0x1e')]?_0xe32f32[_0xf7a2('0x1e')][_0xf7a2('0x22')]||null:null})[_0xf7a2('0xf')](function(_0x2ca0bd){logger[_0xf7a2('0x10')]('UpdateCmHopperBlack',_0xe32f32);logger[_0xf7a2('0x13')](_0xf7a2('0x26'),_0xe32f32,JSON[_0xf7a2('0x15')](_0x2ca0bd));_0x13513c(_0x2ca0bd);})[_0xf7a2('0x1a')](function(_0x172ae2){logger['error']('UpdateCmHopperBlack',_0x172ae2[_0xf7a2('0x18')],_0xe32f32);_0x5644e3(_0x375200[_0xf7a2('0x16')](0x1f4,_0x172ae2['message']));});});};exports[_0xf7a2('0x29')]=function(_0x11c7a7){var _0x542141=this;return new Promise(function(_0x27a1c0,_0x522377){return db[_0xf7a2('0x1c')][_0xf7a2('0x2a')]({'where':_0x11c7a7[_0xf7a2('0x1e')]?_0x11c7a7['options']['where']||null:null})[_0xf7a2('0xf')](function(_0x94b448){logger[_0xf7a2('0x10')](_0xf7a2('0x29'),_0x11c7a7);logger[_0xf7a2('0x13')]('DestroyCmHopperBlack',_0x11c7a7,JSON[_0xf7a2('0x15')](_0x94b448));_0x27a1c0(_0x94b448);})[_0xf7a2('0x1a')](function(_0x5f0996){logger['error']('DestroyCmHopperBlack',_0x5f0996[_0xf7a2('0x18')],_0x11c7a7);_0x522377(_0x542141[_0xf7a2('0x16')](0x1f4,_0x5f0996[_0xf7a2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b680964..3a9129a 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 _0xabce=['show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe'];(function(_0x190e1f,_0x11e558){var _0x2ba93a=function(_0x395440){while(--_0x395440){_0x190e1f['push'](_0x190e1f['shift']());}};_0x2ba93a(++_0x11e558);}(_0xabce,0x103));var _0xeabc=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xabce[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./cmHopperBlack.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')](_0xeabc('0xd'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xe')]);router[_0xeabc('0xf')](_0xeabc('0xd'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);module[_0xeabc('0x11')]=router; \ No newline at end of file +var _0xf072=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x3491b0,_0x33c216){var _0x3df38c=function(_0x165a4e){while(--_0x165a4e){_0x3491b0['push'](_0x3491b0['shift']());}};_0x3df38c(++_0x33c216);}(_0xf072,0x1cf));var _0x2f07=function(_0x496ee9,_0x4dba12){_0x496ee9=_0x496ee9-0x0;var _0xb7016a=_0xf072[_0x496ee9];return _0xb7016a;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0xf')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller['update']);router[_0x2f07('0x10')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 2f1e89d..1502583 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 _0xae34=['followuptime','diff','seconds','BOOLEAN','moment','exports','STRING','INTEGER','DATE','getDataValue','endtime','setDataValue'];(function(_0xe745df,_0x46f8fd){var _0xc0eadf=function(_0x244004){while(--_0x244004){_0xe745df['push'](_0xe745df['shift']());}};_0xc0eadf(++_0x46f8fd);}(_0xae34,0x94));var _0x4ae3=function(_0x32d8f9,_0x1e7765){_0x32d8f9=_0x32d8f9-0x0;var _0x2a86ca=_0xae34[_0x32d8f9];return _0x2a86ca;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4ae3('0x0'));module[_0x4ae3('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x4ae3('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x4ae3('0x2')]},'originatecalleridname':{'type':Sequelize[_0x4ae3('0x2')]},'calleridnum':{'type':Sequelize[_0x4ae3('0x2')]},'calleridname':{'type':Sequelize[_0x4ae3('0x2')]},'starttime':{'type':Sequelize[_0x4ae3('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4ae3('0x4')]},'droptime':{'type':Sequelize[_0x4ae3('0x4')]},'endtime':{'type':Sequelize[_0x4ae3('0x4')]},'ringtime':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4ae3('0x2')]},'campaign':{'type':Sequelize[_0x4ae3('0x2')]},'campaigntype':{'type':Sequelize[_0x4ae3('0x2')]},'membername':{'type':Sequelize[_0x4ae3('0x2')]},'reason':{'type':Sequelize[_0x4ae3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4ae3('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4ae3('0x2')]},'dispositionat':{'type':Sequelize[_0x4ae3('0x4')],'set':function(_0x3147d4){var _0x216fa5=this[_0x4ae3('0x5')](_0x4ae3('0x6'));if(_0x216fa5&&_0x3147d4){this[_0x4ae3('0x7')](_0x4ae3('0x8'),moment(_0x3147d4)[_0x4ae3('0x9')](moment(_0x216fa5),_0x4ae3('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x4ae3('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x4ae3('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x4ae3('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4ae3('0x4')]},'deleted':{'type':Sequelize[_0x4ae3('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x4ae3('0x4')]},'recallme':{'type':Sequelize[_0x4ae3('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x4ae3('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4ae3('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6ff6=['STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE'];(function(_0x2c3e5a,_0x265a33){var _0x1483ac=function(_0x20951f){while(--_0x20951f){_0x2c3e5a['push'](_0x2c3e5a['shift']());}};_0x1483ac(++_0x265a33);}(_0x6ff6,0x119));var _0x66ff=function(_0xd11367,_0x21465a){_0xd11367=_0xd11367-0x0;var _0x4d23c2=_0x6ff6[_0xd11367];return _0x4d23c2;};'use strict';var Sequelize=require(_0x66ff('0x0'));var moment=require(_0x66ff('0x1'));module[_0x66ff('0x2')]={'state':{'type':Sequelize[_0x66ff('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x66ff('0x4')]},'countbusyretry':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x66ff('0x5')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x66ff('0x4')]},'responsetime':{'type':Sequelize[_0x66ff('0x4')]},'answertime':{'type':Sequelize[_0x66ff('0x4')]},'droptime':{'type':Sequelize[_0x66ff('0x4')]},'endtime':{'type':Sequelize[_0x66ff('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x66ff('0x5')]},'campaigntype':{'type':Sequelize[_0x66ff('0x5')]},'membername':{'type':Sequelize[_0x66ff('0x5')]},'reason':{'type':Sequelize[_0x66ff('0x5')]},'disposition':{'type':Sequelize[_0x66ff('0x5')]},'secondDisposition':{'type':Sequelize[_0x66ff('0x5')]},'thirdDisposition':{'type':Sequelize[_0x66ff('0x5')]},'dispositionat':{'type':Sequelize[_0x66ff('0x4')],'set':function(_0x1f6dfa){var _0x1f0564=this[_0x66ff('0x6')](_0x66ff('0x7'));if(_0x1f0564&&_0x1f6dfa){this[_0x66ff('0x8')](_0x66ff('0x9'),moment(_0x1f6dfa)[_0x66ff('0xa')](moment(_0x1f0564),_0x66ff('0xb')));}}},'amd':{'type':Sequelize[_0x66ff('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x66ff('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x66ff('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x66ff('0x4')]},'callback':{'type':Sequelize[_0x66ff('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x66ff('0x4')]},'deleted':{'type':Sequelize[_0x66ff('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x66ff('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x66ff('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x66ff('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x66ff('0x3')],'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 220e5c3..bff3078 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 _0xc1c6=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperFinal','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','ANY_VALUE(ContactId)','field','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x70193a,_0xe71e9b){_0x70193a=_0x70193a-0x0;var _0x480e80=_0xc1c6[_0x70193a];return _0x480e80;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['CmHopperFinal']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['CmHopperFinal'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['describe']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')]()[_0x6c1c('0x25')](respondWithResult(_0x58d075,null))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x26cf7f,_0x52c14d){if(_0x26cf7f[_0x6c1c('0x48')][_0x6c1c('0x49')]){delete _0x26cf7f['body'][_0x6c1c('0x49')];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'uniqueid':_0x26cf7f[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x52c14d,null))[_0x6c1c('0x25')](saveUpdates(_0x26cf7f[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0x52c14d,null))['catch'](handleError(_0x52c14d,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x56b367,_0x5714a6,_0x5008b7){return db[_0x6c1c('0x2b')][_0x6c1c('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x56b367['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x53')))),'congestionContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x55')))),_0x6c1c('0x56')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize'][_0x6c1c('0x4e')](_0x6c1c('0x57')))),_0x6c1c('0x58')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),'answeringMachine']]})[_0x6c1c('0x25')](handleEntityNotFound(_0x5714a6,null))[_0x6c1c('0x25')](respondWithResult(_0x5714a6,null))[_0x6c1c('0x41')](handleError(_0x5714a6,null));};exports[_0x6c1c('0x5a')]=function(_0x14f3b5,_0x3229e6,_0xed095f){return db['CmHopperFinal'][_0x6c1c('0x3f')]({'raw':![],'where':{'CampaignId':_0x14f3b5['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x53')))),_0x6c1c('0x5b')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x5c')))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x6c1c('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),_0x6c1c('0x5d')]]})[_0x6c1c('0x25')](handleEntityNotFound(_0x3229e6,null))[_0x6c1c('0x25')](respondWithResult(_0x3229e6,null))['catch'](handleError(_0x3229e6,null));};exports[_0x6c1c('0x5e')]=function(_0x16b741,_0x204e78,_0x5a919a){return db['VoiceQueue']['find']({'where':{'id':_0x16b741[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x204e78,null))['then'](function(_0x10e499){var _0x579ca3;if(_0x10e499){_0x579ca3=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))[_0x6c1c('0x62')](['phone',_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId','VoiceQueueId',_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))['field']('NOW()','scheduledAt')['field'](_0x6c1c('0x6a'),'ContactId')[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))['field'](_0x6c1c('0x6e'),_0x6c1c('0x6f'))[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x65'))['field'](_0x6c1c('0x70'),'updatedAt')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x16b741['body'][_0x6c1c('0x76')]['toString']())['where'](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x69'))['from'](_0x6c1c('0x61'))['where'](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]()))['where'](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')]('calleridnum')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))['toString']();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x579ca3);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x204e78,null))[_0x6c1c('0x41')](handleError(_0x204e78,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1ad9e2,_0x44d8c4,_0x33a141){return db['Campaign'][_0x6c1c('0x46')]({'where':{'id':_0x1ad9e2[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x44d8c4,null))[_0x6c1c('0x25')](function(_0x50b56b){var _0x1a493a;if(_0x50b56b){_0x1a493a=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))['fromQuery']([_0x6c1c('0x69'),_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId',_0x6c1c('0x7b'),_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))[_0x6c1c('0x6b')]('NOW()',_0x6c1c('0x63'))['field'](_0x6c1c('0x6a'),_0x6c1c('0x64'))[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))[_0x6c1c('0x6b')](_0x6c1c('0x7c'),_0x6c1c('0x7b'))['field'](_0x6c1c('0x70'),'createdAt')[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x66'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2[_0x6c1c('0x43')]['id']['toString']())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x1ad9e2['body']['state'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x69'))[_0x6c1c('0x71')](_0x6c1c('0x61'))[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2['params']['id'][_0x6c1c('0x74')]()))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x7e'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')]('CampaignId\x20=\x20?',_0x1ad9e2['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))[_0x6c1c('0x74')]();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x1a493a);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x44d8c4,null))[_0x6c1c('0x41')](handleError(_0x44d8c4,null));};exports['checkContactHopper']=function(_0x3e40b6,_0x654041,_0x1a0da8){return db[_0x6c1c('0x7f')][_0x6c1c('0x80')]({'where':{'VoiceQueueId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x6f')],'CampaignId':_0x3e40b6[_0x6c1c('0x48')]['CampaignId'],'ContactId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x64')]}})[_0x6c1c('0x25')](handleEntityNotFound(_0x654041,null))[_0x6c1c('0x25')](function(_0x385629){if(_0x385629){return _0x385629;}return null;})[_0x6c1c('0x25')](respondWithResult(_0x654041,null))[_0x6c1c('0x41')](handleError(_0x654041,null));}; \ No newline at end of file +var _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`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','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x5d17,0x114));var _0x75d1=function(_0x2e3210,_0x555b54){_0x2e3210=_0x2e3210-0x0;var _0x399fad=_0x5d17[_0x2e3210];return _0x399fad;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index a7e866e..53871c0 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 _0xb714=['rimraf','./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb714,0x69));var _0x4b71=function(_0x44365d,_0x44e0cb){_0x44365d=_0x44365d-0x0;var _0x1a4a9e=_0xb714[_0x44365d];return _0x1a4a9e;};'use strict';var _=require(_0x4b71('0x0'));var util=require(_0x4b71('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4b71('0x2'));var rp=require(_0x4b71('0x3'));var fs=require('fs');var path=require(_0x4b71('0x4'));var rimraf=require(_0x4b71('0x5'));var config=require('../../config/environment');var attributes=require(_0x4b71('0x6'));module['exports']=function(_0xc45d24,_0x5d2064){return _0xc45d24[_0x4b71('0x7')](_0x4b71('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x4b71('0x9'),'fields':[_0x4b71('0x9')]},{'name':'uniqueid','fields':[_0x4b71('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed73=['moment','bluebird','request-promise','path','./cmHopperFinal.attributes','define','calleridnum','uniqueid','lodash','util','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xed73,0xce));var _0x3ed7=function(_0x52f10d,_0x1d276e){_0x52f10d=_0x52f10d-0x0;var _0x331882=_0xed73[_0x52f10d];return _0x331882;};'use strict';var _=require(_0x3ed7('0x0'));var util=require(_0x3ed7('0x1'));var logger=require('../../config/logger')(_0x3ed7('0x2'));var moment=require(_0x3ed7('0x3'));var BPromise=require(_0x3ed7('0x4'));var rp=require(_0x3ed7('0x5'));var fs=require('fs');var path=require(_0x3ed7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3ed7('0x7'));module['exports']=function(_0x6f15f3,_0x318d9b){return _0x6f15f3[_0x3ed7('0x8')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3ed7('0x9'),'fields':[_0x3ed7('0x9')]},{'name':'uniqueid','fields':[_0x3ed7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 78c4fb0..1ae787f 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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3f2be9,_0x465648){var _0x1a7bb4=function(_0x26233d){while(--_0x26233d){_0x3f2be9['push'](_0x3f2be9['shift']());}};_0x1a7bb4(++_0x465648);}(_0x7a54,0x106));var _0x47a5=function(_0x5add02,_0x4ead8a){_0x5add02=_0x5add02-0x0;var _0xe6de79=_0x7a54[_0x5add02];return _0xe6de79;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x23600c,_0x31d165){var _0x57f2a2=function(_0x591ded){while(--_0x591ded){_0x23600c['push'](_0x23600c['shift']());}};_0x57f2a2(++_0x31d165);}(_0xb10b,0x12a));var _0xbb10=function(_0x17bfa4,_0x3eb5f7){_0x17bfa4=_0x17bfa4-0x0;var _0x3d9ca8=_0xb10b[_0x17bfa4];return _0x3d9ca8;};'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 c9931a4..8ef8cb4 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 _0x1048=['moveContactsIvrCampaignHopperFinal','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x5f0f7a,_0x244c53){var _0x8742e7=function(_0x48ff6e){while(--_0x48ff6e){_0x5f0f7a['push'](_0x5f0f7a['shift']());}};_0x8742e7(++_0x244c53);}(_0x1048,0x18a));var _0x8104=function(_0x3581b6,_0x3054dc){_0x3581b6=_0x3581b6-0x0;var _0x369742=_0x1048[_0x3581b6];return _0x369742;};'use strict';var multer=require(_0x8104('0x0'));var util=require(_0x8104('0x1'));var path=require(_0x8104('0x2'));var timeout=require(_0x8104('0x3'));var express=require(_0x8104('0x4'));var router=express[_0x8104('0x5')]();var fs_extra=require(_0x8104('0x6'));var auth=require(_0x8104('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x8104('0x8')]('/',auth['isAuthenticated'](),controller[_0x8104('0x9')]);router[_0x8104('0x8')](_0x8104('0xa'),auth[_0x8104('0xb')](),controller[_0x8104('0xc')]);router[_0x8104('0x8')](_0x8104('0xd'),auth[_0x8104('0xb')](),controller[_0x8104('0xe')]);router[_0x8104('0x8')](_0x8104('0xf'),auth[_0x8104('0xb')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x8104('0x8')](_0x8104('0x10'),auth['isAuthenticated'](),controller[_0x8104('0x11')]);router[_0x8104('0x12')](_0x8104('0x13'),auth['isAuthenticated'](),controller[_0x8104('0x14')]);router[_0x8104('0x12')](_0x8104('0x15'),auth[_0x8104('0xb')](),controller[_0x8104('0x16')]);router[_0x8104('0x12')]('/checkContactHopper',auth[_0x8104('0xb')](),controller['checkContactHopper']);router[_0x8104('0x17')](_0x8104('0xd'),auth['isAuthenticated'](),controller[_0x8104('0x18')]);module[_0x8104('0x19')]=router; \ No newline at end of file +var _0xc6e8=['express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','index','get','isAuthenticated','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','multer','util','path','connect-timeout'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xc6e8,0x9e));var _0x8c6e=function(_0x38212c,_0x8d1af0){_0x38212c=_0x38212c-0x0;var _0x417df6=_0xc6e8[_0x38212c];return _0x417df6;};'use strict';var multer=require(_0x8c6e('0x0'));var util=require(_0x8c6e('0x1'));var path=require(_0x8c6e('0x2'));var timeout=require(_0x8c6e('0x3'));var express=require(_0x8c6e('0x4'));var router=express['Router']();var fs_extra=require(_0x8c6e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c6e('0x6'));var config=require(_0x8c6e('0x7'));var controller=require(_0x8c6e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8c6e('0x9')]);router[_0x8c6e('0xa')]('/describe',auth[_0x8c6e('0xb')](),controller[_0x8c6e('0xc')]);router[_0x8c6e('0xa')]('/:id',auth[_0x8c6e('0xb')](),controller[_0x8c6e('0xd')]);router[_0x8c6e('0xa')](_0x8c6e('0xe'),auth[_0x8c6e('0xb')](),controller[_0x8c6e('0xf')]);router['get'](_0x8c6e('0x10'),auth['isAuthenticated'](),controller[_0x8c6e('0x11')]);router[_0x8c6e('0x12')](_0x8c6e('0x13'),auth[_0x8c6e('0xb')](),controller[_0x8c6e('0x14')]);router[_0x8c6e('0x12')](_0x8c6e('0x15'),auth['isAuthenticated'](),controller[_0x8c6e('0x16')]);router[_0x8c6e('0x12')](_0x8c6e('0x17'),auth['isAuthenticated'](),controller[_0x8c6e('0x18')]);router[_0x8c6e('0x19')](_0x8c6e('0x1a'),auth[_0x8c6e('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 78d5260..e98af5d 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 _0x801b=['DATE','BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x801b,0xf2));var _0xb801=function(_0x21a9e2,_0x5375da){_0x21a9e2=_0x21a9e2-0x0;var _0x33817f=_0x801b[_0x21a9e2];return _0x33817f;};'use strict';var Sequelize=require(_0xb801('0x0'));module[_0xb801('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb801('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb801('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb801('0x2')]},'originatecalleridname':{'type':Sequelize[_0xb801('0x2')]},'calleridnum':{'type':Sequelize[_0xb801('0x2')]},'calleridname':{'type':Sequelize[_0xb801('0x2')]},'starttime':{'type':Sequelize[_0xb801('0x4')]},'responsetime':{'type':Sequelize[_0xb801('0x4')]},'answertime':{'type':Sequelize[_0xb801('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb801('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb801('0x2')]},'campaign':{'type':Sequelize[_0xb801('0x2')]},'campaigntype':{'type':Sequelize[_0xb801('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb801('0x2')]},'amd':{'type':Sequelize[_0xb801('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb801('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xb801('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb801('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb801('0x4')]},'recallme':{'type':Sequelize[_0xb801('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xb801('0x4')]},'edited':{'type':Sequelize[_0xb801('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb801('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb801('0x2')]}}; \ No newline at end of file +var _0xf8ec=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x3c603f,_0x19fa88){var _0x334e3f=function(_0x5e332a){while(--_0x5e332a){_0x3c603f['push'](_0x3c603f['shift']());}};_0x334e3f(++_0x19fa88);}(_0xf8ec,0x17a));var _0xcf8e=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xf8ec[_0x13ce0c];return _0x4388fb;};'use strict';var Sequelize=require('sequelize');module[_0xcf8e('0x0')]={'state':{'type':Sequelize[_0xcf8e('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xcf8e('0x2')]},'scheduledat':{'type':Sequelize[_0xcf8e('0x3')]},'countbusyretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xcf8e('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xcf8e('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcf8e('0x2')]},'calleridname':{'type':Sequelize[_0xcf8e('0x2')]},'starttime':{'type':Sequelize[_0xcf8e('0x3')]},'responsetime':{'type':Sequelize[_0xcf8e('0x3')]},'answertime':{'type':Sequelize[_0xcf8e('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xcf8e('0x3')]},'ringtime':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcf8e('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xcf8e('0x2')]},'membername':{'type':Sequelize[_0xcf8e('0x2')]},'reason':{'type':Sequelize[_0xcf8e('0x2')]},'amd':{'type':Sequelize[_0xcf8e('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xcf8e('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xcf8e('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcf8e('0x3')]},'recallme':{'type':Sequelize[_0xcf8e('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xcf8e('0x3')]},'edited':{'type':Sequelize[_0xcf8e('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcf8e('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcf8e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8c69c0a..d3ea66b 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 _0x8d7c=['type','model','keys','query','filters','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','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','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName'];(function(_0x2da230,_0x5a5dfc){var _0x3504a9=function(_0x5bc685){while(--_0x5bc685){_0x2da230['push'](_0x2da230['shift']());}};_0x3504a9(++_0x5a5dfc);}(_0x8d7c,0x19e));var _0xc8d7=function(_0x3c1d8d,_0xb28fc6){_0x3c1d8d=_0x3c1d8d-0x0;var _0x33ad03=_0x8d7c[_0x3c1d8d];return _0x33ad03;};'use strict';var emlformat=require(_0xc8d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc8d7('0x1'));var jsonpatch=require(_0xc8d7('0x2'));var rp=require(_0xc8d7('0x3'));var moment=require(_0xc8d7('0x4'));var BPromise=require(_0xc8d7('0x5'));var Mustache=require(_0xc8d7('0x6'));var util=require('util');var path=require(_0xc8d7('0x7'));var sox=require('sox');var csv=require(_0xc8d7('0x8'));var ejs=require(_0xc8d7('0x9'));var fs=require('fs');var fs_extra=require(_0xc8d7('0xa'));var _=require(_0xc8d7('0xb'));var squel=require('squel');var crypto=require(_0xc8d7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc8d7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc8d7('0xe'));var authService=require(_0xc8d7('0xf'));var qs=require(_0xc8d7('0x10'));var as=require(_0xc8d7('0x11'));var hardwareService=require(_0xc8d7('0x12'));var logger=require(_0xc8d7('0x13'))(_0xc8d7('0x14'));var utils=require(_0xc8d7('0x15'));var config=require(_0xc8d7('0x16'));var licenseUtil=require(_0xc8d7('0x17'));var db=require(_0xc8d7('0x18'))['db'];function respondWithStatusCode(_0x2e7489,_0x261f12){_0x261f12=_0x261f12||0xcc;return function(_0x28dbb6){if(_0x28dbb6){return _0x2e7489[_0xc8d7('0x19')](_0x261f12);}return _0x2e7489[_0xc8d7('0x1a')](_0x261f12)[_0xc8d7('0x1b')]();};}function respondWithResult(_0x83bc80,_0x45a439){_0x45a439=_0x45a439||0xc8;return function(_0x3b50ec){if(_0x3b50ec){return _0x83bc80['status'](_0x45a439)[_0xc8d7('0x1c')](_0x3b50ec);}};}function respondWithFilteredResult(_0x498aa0,_0x25c21c){return function(_0x5123e8){if(_0x5123e8){var _0x29e78d=typeof _0x25c21c[_0xc8d7('0x1d')]===_0xc8d7('0x1e')&&typeof _0x25c21c['limit']==='undefined';var _0x5be9fe=_0x5123e8['count'];var _0x22e7ba=_0x29e78d?0x0:_0x25c21c[_0xc8d7('0x1d')];var _0x20c993=_0x29e78d?_0x5123e8[_0xc8d7('0x1f')]:_0x25c21c[_0xc8d7('0x1d')]+_0x25c21c['limit'];var _0x748e68;if(_0x20c993>=_0x5be9fe){_0x20c993=_0x5be9fe;_0x748e68=0xc8;}else{_0x748e68=0xce;}_0x498aa0[_0xc8d7('0x1a')](_0x748e68);return _0x498aa0[_0xc8d7('0x20')](_0xc8d7('0x21'),_0x22e7ba+'-'+_0x20c993+'/'+_0x5be9fe)['json'](_0x5123e8);}return null;};}function patchUpdates(_0x1bcc01){return function(_0x560360){try{jsonpatch[_0xc8d7('0x22')](_0x560360,_0x1bcc01,!![]);}catch(_0x5bcad4){return BPromise[_0xc8d7('0x23')](_0x5bcad4);}return _0x560360[_0xc8d7('0x24')]();};}function saveUpdates(_0x2e48a6,_0x2b9a5e){return function(_0x186425){if(_0x186425){return _0x186425[_0xc8d7('0x25')](_0x2e48a6)[_0xc8d7('0x26')](function(_0x1f119b){return _0x1f119b;});}return null;};}function removeEntity(_0x2f7e7f,_0x448515){return function(_0x26e104){if(_0x26e104){return _0x26e104[_0xc8d7('0x27')]()[_0xc8d7('0x26')](function(){_0x2f7e7f[_0xc8d7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x324718,_0x2d22da){return function(_0x23f28c){if(!_0x23f28c){_0x324718[_0xc8d7('0x19')](0x194);}return _0x23f28c;};}function handleError(_0xf5a85f,_0x3c9320){_0x3c9320=_0x3c9320||0x1f4;return function(_0x5d233b){logger[_0xc8d7('0x28')](_0x5d233b[_0xc8d7('0x29')]);if(_0x5d233b[_0xc8d7('0x2a')]){delete _0x5d233b[_0xc8d7('0x2a')];}_0xf5a85f[_0xc8d7('0x1a')](_0x3c9320)[_0xc8d7('0x2b')](_0x5d233b);};}exports['index']=function(_0x1a7988,_0x36e2ed){var _0x23b1f8={},_0x235ca5={},_0x3aec19={'count':0x0,'rows':[]};var _0x4c9ba6=_[_0xc8d7('0x2c')](db[_0xc8d7('0x2d')][_0xc8d7('0x2e')],function(_0x3b656c){return{'name':_0x3b656c[_0xc8d7('0x2f')],'type':_0x3b656c[_0xc8d7('0x30')]['key']};});_0x235ca5[_0xc8d7('0x31')]=_[_0xc8d7('0x2c')](_0x4c9ba6,_0xc8d7('0x2a'));_0x235ca5['query']=_[_0xc8d7('0x32')](_0x1a7988[_0xc8d7('0x33')]);_0x235ca5[_0xc8d7('0x34')]=_['intersection'](_0x235ca5['model'],_0x235ca5['query']);_0x23b1f8[_0xc8d7('0x35')]=_['intersection'](_0x235ca5[_0xc8d7('0x31')],qs['fields'](_0x1a7988[_0xc8d7('0x33')]['fields']));_0x23b1f8[_0xc8d7('0x35')]=_0x23b1f8['attributes'][_0xc8d7('0x36')]?_0x23b1f8[_0xc8d7('0x35')]:_0x235ca5[_0xc8d7('0x31')];if(!_0x1a7988['query'][_0xc8d7('0x37')]('nolimit')){_0x23b1f8[_0xc8d7('0x38')]=qs[_0xc8d7('0x38')](_0x1a7988[_0xc8d7('0x33')][_0xc8d7('0x38')]);_0x23b1f8[_0xc8d7('0x1d')]=qs[_0xc8d7('0x1d')](_0x1a7988[_0xc8d7('0x33')][_0xc8d7('0x1d')]);}_0x23b1f8[_0xc8d7('0x39')]=qs[_0xc8d7('0x3a')](_0x1a7988['query'][_0xc8d7('0x3a')]);_0x23b1f8[_0xc8d7('0x3b')]=qs[_0xc8d7('0x34')](_['pick'](_0x1a7988[_0xc8d7('0x33')],_0x235ca5['filters']),_0x4c9ba6);if(_0x1a7988[_0xc8d7('0x33')][_0xc8d7('0x3c')]){_0x23b1f8[_0xc8d7('0x3b')]=_[_0xc8d7('0x3d')](_0x23b1f8[_0xc8d7('0x3b')],{'$or':_[_0xc8d7('0x2c')](_0x4c9ba6,function(_0x68fd99){if(_0x68fd99[_0xc8d7('0x30')]!==_0xc8d7('0x3e')){var _0x453751={};_0x453751[_0x68fd99[_0xc8d7('0x2a')]]={'$like':'%'+_0x1a7988[_0xc8d7('0x33')][_0xc8d7('0x3c')]+'%'};return _0x453751;}})});}_0x23b1f8=_['merge']({},_0x23b1f8,_0x1a7988[_0xc8d7('0x3f')]);var _0x3df7df={'where':_0x23b1f8[_0xc8d7('0x3b')]};return db[_0xc8d7('0x2d')][_0xc8d7('0x1f')](_0x3df7df)[_0xc8d7('0x26')](function(_0x1a3215){_0x3aec19[_0xc8d7('0x1f')]=_0x1a3215;if(_0x1a7988[_0xc8d7('0x33')][_0xc8d7('0x40')]){_0x23b1f8[_0xc8d7('0x41')]=[{'all':!![]}];}return db[_0xc8d7('0x2d')][_0xc8d7('0x42')](_0x23b1f8);})[_0xc8d7('0x26')](function(_0x4fd02){_0x3aec19[_0xc8d7('0x43')]=_0x4fd02;return _0x3aec19;})[_0xc8d7('0x26')](respondWithFilteredResult(_0x36e2ed,_0x23b1f8))[_0xc8d7('0x44')](handleError(_0x36e2ed,null));};exports[_0xc8d7('0x45')]=function(_0x2683a8,_0x24236b){var _0x30352f={'raw':!![],'where':{'id':_0x2683a8[_0xc8d7('0x46')]['id']}},_0x29d5a8={};_0x29d5a8[_0xc8d7('0x31')]=_[_0xc8d7('0x32')](db[_0xc8d7('0x2d')][_0xc8d7('0x2e')]);_0x29d5a8[_0xc8d7('0x33')]=_[_0xc8d7('0x32')](_0x2683a8['query']);_0x29d5a8[_0xc8d7('0x34')]=_['intersection'](_0x29d5a8[_0xc8d7('0x31')],_0x29d5a8['query']);_0x30352f[_0xc8d7('0x35')]=_['intersection'](_0x29d5a8[_0xc8d7('0x31')],qs['fields'](_0x2683a8[_0xc8d7('0x33')][_0xc8d7('0x47')]));_0x30352f[_0xc8d7('0x35')]=_0x30352f[_0xc8d7('0x35')][_0xc8d7('0x36')]?_0x30352f['attributes']:_0x29d5a8[_0xc8d7('0x31')];if(_0x2683a8[_0xc8d7('0x33')]['includeAll']){_0x30352f[_0xc8d7('0x41')]=[{'all':!![]}];}_0x30352f=_[_0xc8d7('0x3d')]({},_0x30352f,_0x2683a8[_0xc8d7('0x3f')]);return db[_0xc8d7('0x2d')][_0xc8d7('0x48')](_0x30352f)['then'](handleEntityNotFound(_0x24236b,null))[_0xc8d7('0x26')](respondWithResult(_0x24236b,null))['catch'](handleError(_0x24236b,null));};exports[_0xc8d7('0x49')]=function(_0x525687,_0x794441){return db['CmHopperHistory'][_0xc8d7('0x49')](_0x525687[_0xc8d7('0x4a')],{})['then'](respondWithResult(_0x794441,0xc9))[_0xc8d7('0x44')](handleError(_0x794441,null));};exports[_0xc8d7('0x4b')]=function(_0x50f67b,_0x44e485){return db[_0xc8d7('0x2d')][_0xc8d7('0x4b')]()[_0xc8d7('0x26')](respondWithResult(_0x44e485,null))[_0xc8d7('0x44')](handleError(_0x44e485,null));};exports[_0xc8d7('0x25')]=function(_0x11a6fd,_0x1d265f){if(_0x11a6fd[_0xc8d7('0x4a')][_0xc8d7('0x4c')]){delete _0x11a6fd[_0xc8d7('0x4a')][_0xc8d7('0x4c')];}return db[_0xc8d7('0x2d')][_0xc8d7('0x48')]({'where':{'uniqueid':_0x11a6fd[_0xc8d7('0x46')]['id']}})[_0xc8d7('0x26')](handleEntityNotFound(_0x1d265f,null))[_0xc8d7('0x26')](saveUpdates(_0x11a6fd[_0xc8d7('0x4a')],null))['then'](respondWithResult(_0x1d265f,null))[_0xc8d7('0x44')](handleError(_0x1d265f,null));}; \ No newline at end of file +var _0xc1e4=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x35fad7,_0x54c8a4){var _0x58aac0=function(_0x11b4b1){while(--_0x11b4b1){_0x35fad7['push'](_0x35fad7['shift']());}};_0x58aac0(++_0x54c8a4);}(_0xc1e4,0xc7));var _0x4c1e=function(_0xbc5de1,_0x3f69db){_0xbc5de1=_0xbc5de1-0x0;var _0x1f4ba1=_0xc1e4[_0xbc5de1];return _0x1f4ba1;};'use strict';var emlformat=require(_0x4c1e('0x0'));var rimraf=require(_0x4c1e('0x1'));var zipdir=require(_0x4c1e('0x2'));var jsonpatch=require(_0x4c1e('0x3'));var rp=require(_0x4c1e('0x4'));var moment=require(_0x4c1e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4c1e('0x6'));var util=require('util');var path=require(_0x4c1e('0x7'));var sox=require(_0x4c1e('0x8'));var csv=require(_0x4c1e('0x9'));var ejs=require(_0x4c1e('0xa'));var fs=require('fs');var fs_extra=require(_0x4c1e('0xb'));var _=require(_0x4c1e('0xc'));var squel=require('squel');var crypto=require(_0x4c1e('0xd'));var jsforce=require(_0x4c1e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4c1e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4c1e('0xf'));var authService=require(_0x4c1e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4c1e('0x11'));var hardwareService=require(_0x4c1e('0x12'));var logger=require('../../config/logger')(_0x4c1e('0x13'));var utils=require('../../config/utils');var config=require(_0x4c1e('0x14'));var licenseUtil=require(_0x4c1e('0x15'));var db=require(_0x4c1e('0x16'))['db'];function respondWithStatusCode(_0x3d6190,_0x3eaccb){_0x3eaccb=_0x3eaccb||0xcc;return function(_0x5de7ec){if(_0x5de7ec){return _0x3d6190[_0x4c1e('0x17')](_0x3eaccb);}return _0x3d6190[_0x4c1e('0x18')](_0x3eaccb)[_0x4c1e('0x19')]();};}function respondWithResult(_0x24cd0b,_0x2d3fe8){_0x2d3fe8=_0x2d3fe8||0xc8;return function(_0x1bbb42){if(_0x1bbb42){return _0x24cd0b[_0x4c1e('0x18')](_0x2d3fe8)[_0x4c1e('0x1a')](_0x1bbb42);}};}function respondWithFilteredResult(_0x2771a8,_0x240d86){return function(_0x326cc8){if(_0x326cc8){var _0x2c1099=typeof _0x240d86[_0x4c1e('0x1b')]===_0x4c1e('0x1c')&&typeof _0x240d86[_0x4c1e('0x1d')]==='undefined';var _0x45f87d=_0x326cc8[_0x4c1e('0x1e')];var _0xe57d99=_0x2c1099?0x0:_0x240d86[_0x4c1e('0x1b')];var _0x460c37=_0x2c1099?_0x326cc8[_0x4c1e('0x1e')]:_0x240d86[_0x4c1e('0x1b')]+_0x240d86[_0x4c1e('0x1d')];var _0x3c460f;if(_0x460c37>=_0x45f87d){_0x460c37=_0x45f87d;_0x3c460f=0xc8;}else{_0x3c460f=0xce;}_0x2771a8[_0x4c1e('0x18')](_0x3c460f);return _0x2771a8[_0x4c1e('0x1f')]('Content-Range',_0xe57d99+'-'+_0x460c37+'/'+_0x45f87d)['json'](_0x326cc8);}return null;};}function patchUpdates(_0x201c4e){return function(_0xe2bb72){try{jsonpatch[_0x4c1e('0x20')](_0xe2bb72,_0x201c4e,!![]);}catch(_0x1562e8){return BPromise[_0x4c1e('0x21')](_0x1562e8);}return _0xe2bb72[_0x4c1e('0x22')]();};}function saveUpdates(_0x1b50f2,_0x58b576){return function(_0x25fc5b){if(_0x25fc5b){return _0x25fc5b[_0x4c1e('0x23')](_0x1b50f2)[_0x4c1e('0x24')](function(_0x41c848){return _0x41c848;});}return null;};}function removeEntity(_0x270246,_0x313fef){return function(_0x16394a){if(_0x16394a){return _0x16394a[_0x4c1e('0x25')]()[_0x4c1e('0x24')](function(){_0x270246[_0x4c1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32d076,_0x36a091){return function(_0x5eb5ac){if(!_0x5eb5ac){_0x32d076[_0x4c1e('0x17')](0x194);}return _0x5eb5ac;};}function handleError(_0x408520,_0x420cd0){_0x420cd0=_0x420cd0||0x1f4;return function(_0x552977){logger[_0x4c1e('0x26')](_0x552977['stack']);if(_0x552977[_0x4c1e('0x27')]){delete _0x552977[_0x4c1e('0x27')];}_0x408520['status'](_0x420cd0)['send'](_0x552977);};}exports['index']=function(_0x3301e6,_0x25a9ea){var _0x414487={},_0x14ad93={},_0x3405d8={'count':0x0,'rows':[]};var _0x4f37d5=_[_0x4c1e('0x28')](db[_0x4c1e('0x29')][_0x4c1e('0x2a')],function(_0x43f883){return{'name':_0x43f883[_0x4c1e('0x2b')],'type':_0x43f883[_0x4c1e('0x2c')][_0x4c1e('0x2d')]};});_0x14ad93[_0x4c1e('0x2e')]=_[_0x4c1e('0x28')](_0x4f37d5,_0x4c1e('0x27'));_0x14ad93[_0x4c1e('0x2f')]=_[_0x4c1e('0x30')](_0x3301e6['query']);_0x14ad93[_0x4c1e('0x31')]=_['intersection'](_0x14ad93[_0x4c1e('0x2e')],_0x14ad93['query']);_0x414487['attributes']=_['intersection'](_0x14ad93['model'],qs[_0x4c1e('0x32')](_0x3301e6['query'][_0x4c1e('0x32')]));_0x414487['attributes']=_0x414487[_0x4c1e('0x33')]['length']?_0x414487[_0x4c1e('0x33')]:_0x14ad93[_0x4c1e('0x2e')];if(!_0x3301e6[_0x4c1e('0x2f')][_0x4c1e('0x34')]('nolimit')){_0x414487[_0x4c1e('0x1d')]=qs[_0x4c1e('0x1d')](_0x3301e6[_0x4c1e('0x2f')][_0x4c1e('0x1d')]);_0x414487[_0x4c1e('0x1b')]=qs[_0x4c1e('0x1b')](_0x3301e6[_0x4c1e('0x2f')][_0x4c1e('0x1b')]);}_0x414487[_0x4c1e('0x35')]=qs[_0x4c1e('0x36')](_0x3301e6[_0x4c1e('0x2f')]['sort']);_0x414487[_0x4c1e('0x37')]=qs[_0x4c1e('0x31')](_[_0x4c1e('0x38')](_0x3301e6[_0x4c1e('0x2f')],_0x14ad93[_0x4c1e('0x31')]),_0x4f37d5);if(_0x3301e6['query']['filter']){_0x414487[_0x4c1e('0x37')]=_[_0x4c1e('0x39')](_0x414487['where'],{'$or':_[_0x4c1e('0x28')](_0x4f37d5,function(_0x24b181){if(_0x24b181[_0x4c1e('0x2c')]!==_0x4c1e('0x3a')){var _0x26c7f1={};_0x26c7f1[_0x24b181[_0x4c1e('0x27')]]={'$like':'%'+_0x3301e6[_0x4c1e('0x2f')][_0x4c1e('0x3b')]+'%'};return _0x26c7f1;}})});}_0x414487=_[_0x4c1e('0x39')]({},_0x414487,_0x3301e6[_0x4c1e('0x3c')]);var _0x41489b={'where':_0x414487[_0x4c1e('0x37')]};return db[_0x4c1e('0x29')][_0x4c1e('0x1e')](_0x41489b)[_0x4c1e('0x24')](function(_0x39fe7c){_0x3405d8['count']=_0x39fe7c;if(_0x3301e6[_0x4c1e('0x2f')][_0x4c1e('0x3d')]){_0x414487[_0x4c1e('0x3e')]=[{'all':!![]}];}return db[_0x4c1e('0x29')][_0x4c1e('0x3f')](_0x414487);})['then'](function(_0x4682c3){_0x3405d8[_0x4c1e('0x40')]=_0x4682c3;return _0x3405d8;})[_0x4c1e('0x24')](respondWithFilteredResult(_0x25a9ea,_0x414487))[_0x4c1e('0x41')](handleError(_0x25a9ea,null));};exports[_0x4c1e('0x42')]=function(_0x28ac98,_0x58aff6){var _0x20cf29={'raw':!![],'where':{'id':_0x28ac98[_0x4c1e('0x43')]['id']}},_0xa28672={};_0xa28672[_0x4c1e('0x2e')]=_[_0x4c1e('0x30')](db[_0x4c1e('0x29')][_0x4c1e('0x2a')]);_0xa28672['query']=_[_0x4c1e('0x30')](_0x28ac98[_0x4c1e('0x2f')]);_0xa28672[_0x4c1e('0x31')]=_[_0x4c1e('0x44')](_0xa28672['model'],_0xa28672['query']);_0x20cf29['attributes']=_['intersection'](_0xa28672['model'],qs[_0x4c1e('0x32')](_0x28ac98[_0x4c1e('0x2f')][_0x4c1e('0x32')]));_0x20cf29[_0x4c1e('0x33')]=_0x20cf29[_0x4c1e('0x33')][_0x4c1e('0x45')]?_0x20cf29['attributes']:_0xa28672['model'];if(_0x28ac98[_0x4c1e('0x2f')]['includeAll']){_0x20cf29[_0x4c1e('0x3e')]=[{'all':!![]}];}_0x20cf29=_[_0x4c1e('0x39')]({},_0x20cf29,_0x28ac98[_0x4c1e('0x3c')]);return db[_0x4c1e('0x29')]['find'](_0x20cf29)[_0x4c1e('0x24')](handleEntityNotFound(_0x58aff6,null))['then'](respondWithResult(_0x58aff6,null))[_0x4c1e('0x41')](handleError(_0x58aff6,null));};exports[_0x4c1e('0x46')]=function(_0x4fb4a0,_0x5947e9){return db[_0x4c1e('0x29')][_0x4c1e('0x46')](_0x4fb4a0[_0x4c1e('0x47')],{})[_0x4c1e('0x24')](respondWithResult(_0x5947e9,0xc9))[_0x4c1e('0x41')](handleError(_0x5947e9,null));};exports[_0x4c1e('0x48')]=function(_0x41e1de,_0x569a7c){return db[_0x4c1e('0x29')][_0x4c1e('0x48')]()[_0x4c1e('0x24')](respondWithResult(_0x569a7c,null))[_0x4c1e('0x41')](handleError(_0x569a7c,null));};exports[_0x4c1e('0x23')]=function(_0x42e209,_0x3aaaab){if(_0x42e209[_0x4c1e('0x47')]['uniqueid']){delete _0x42e209['body'][_0x4c1e('0x49')];}return db[_0x4c1e('0x29')][_0x4c1e('0x4a')]({'where':{'uniqueid':_0x42e209[_0x4c1e('0x43')]['id']}})[_0x4c1e('0x24')](handleEntityNotFound(_0x3aaaab,null))['then'](saveUpdates(_0x42e209[_0x4c1e('0x47')],null))[_0x4c1e('0x24')](respondWithResult(_0x3aaaab,null))['catch'](handleError(_0x3aaaab,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index ad47d97..7e66655 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 _0x9af6=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory'];(function(_0x36147b,_0x57f40b){var _0x141351=function(_0x219aa1){while(--_0x219aa1){_0x36147b['push'](_0x36147b['shift']());}};_0x141351(++_0x57f40b);}(_0x9af6,0x1d7));var _0x69af=function(_0xba7335,_0x22e516){_0xba7335=_0xba7335-0x0;var _0x540b04=_0x9af6[_0xba7335];return _0x540b04;};'use strict';var _=require(_0x69af('0x0'));var util=require(_0x69af('0x1'));var logger=require(_0x69af('0x2'))('api');var moment=require('moment');var BPromise=require(_0x69af('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x69af('0x4'));var config=require(_0x69af('0x5'));var attributes=require(_0x69af('0x6'));module['exports']=function(_0x3848c6,_0x54e2f1){return _0x3848c6[_0x69af('0x7')](_0x69af('0x8'),attributes,{'tableName':_0x69af('0x9'),'paranoid':![],'indexes':[{'name':_0x69af('0xa'),'fields':[_0x69af('0xa')]},{'name':_0x69af('0xb'),'fields':[_0x69af('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ccb=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','CmHopperHistory'];(function(_0x1b10de,_0x29199a){var _0x1abecd=function(_0x3ca4a0){while(--_0x3ca4a0){_0x1b10de['push'](_0x1b10de['shift']());}};_0x1abecd(++_0x29199a);}(_0x4ccb,0x196));var _0xb4cc=function(_0x189cd3,_0x381906){_0x189cd3=_0x189cd3-0x0;var _0x2a5f0e=_0x4ccb[_0x189cd3];return _0x2a5f0e;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[{'name':_0xb4cc('0xb'),'fields':['endtime']},{'name':_0xb4cc('0xc'),'fields':[_0xb4cc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 6daa656..a041a21 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 _0xb43b=['`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','then','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG'];(function(_0x36bee5,_0x5db9df){var _0x161571=function(_0x321a75){while(--_0x321a75){_0x36bee5['push'](_0x36bee5['shift']());}};_0x161571(++_0x5db9df);}(_0xb43b,0x1b2));var _0xbb43=function(_0x575864,_0x343511){_0x575864=_0x575864-0x0;var _0x185f1b=_0xb43b[_0x575864];return _0x185f1b;};'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')]('CmHopperHistory,\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')]('CmHopperHistory,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('CmHopperHistory,\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);});});}exports[_0xbb43('0x15')]=function(_0x2e3b43){var _0x55dd73=this;return new Promise(function(_0x1c16d7,_0x4f28b8){return db[_0xbb43('0x16')][_0xbb43('0x17')](_0x2e3b43['body'],{'raw':_0x2e3b43['options']?_0x2e3b43[_0xbb43('0x18')][_0xbb43('0x19')]===undefined?!![]:![]:!![]})[_0xbb43('0x1a')](function(_0x2bf2d4){logger['info'](_0xbb43('0x15'),_0x2e3b43);logger['debug'](_0xbb43('0x15'),_0x2e3b43,JSON['stringify'](_0x2bf2d4));_0x1c16d7(_0x2bf2d4);})[_0xbb43('0x14')](function(_0x565256){logger[_0xbb43('0x10')](_0xbb43('0x15'),_0x565256['message'],_0x2e3b43);_0x4f28b8(_0x55dd73[_0xbb43('0x10')](0x1f4,_0x565256['message']));});});};exports[_0xbb43('0x1b')]=function(_0x298ce2){var _0x16384e=this;return new Promise(function(_0x4d6d77,_0x53f0d5){return db['CmHopperHistory'][_0xbb43('0x1c')]({'raw':_0x298ce2[_0xbb43('0x18')]?_0x298ce2['options'][_0xbb43('0x19')]===undefined?!![]:![]:!![],'where':_0x298ce2[_0xbb43('0x18')]?_0x298ce2[_0xbb43('0x18')][_0xbb43('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xbb43('0x1e')][_0xbb43('0x1f')]('id')),_0xbb43('0x20')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xbb43('0x23')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),_0xbb43('0x24')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbb43('0x1e')]['literal'](_0xbb43('0x25')))),_0xbb43('0x26')],[db[_0xbb43('0x1e')]['fn']('AVG',db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')](_0xbb43('0x27')))),_0xbb43('0x28')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x29'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')](_0xbb43('0x2a')))),_0xbb43('0x2b')]]})[_0xbb43('0x1a')](function(_0x4015ec){logger[_0xbb43('0xb')](_0xbb43('0x1b'),_0x298ce2);logger[_0xbb43('0xd')](_0xbb43('0x1b'),_0x298ce2,JSON[_0xbb43('0xf')](_0x4015ec));_0x4d6d77(_0x4015ec);})[_0xbb43('0x14')](function(_0x18debb){logger[_0xbb43('0x10')](_0xbb43('0x1b'),_0x18debb[_0xbb43('0x12')],_0x298ce2);_0x53f0d5(_0x16384e[_0xbb43('0x10')](0x1f4,_0x18debb['message']));});});};exports[_0xbb43('0x2c')]=function(_0x2d2056){var _0x52a694=this;return new Promise(function(_0x285014,_0x2c9a7c){return db[_0xbb43('0x16')]['findAll']({'raw':_0x2d2056['options']?_0x2d2056['options'][_0xbb43('0x19')]===undefined?!![]:![]:!![],'where':_0x2d2056[_0xbb43('0x18')]?_0x2d2056['options']['where']||null:null,'attributes':[[_0xbb43('0x2d'),_0xbb43('0x2e')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')](_0xbb43('0x2f')))),_0xbb43('0x30')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db['sequelize']['fn']('IF',db[_0xbb43('0x1e')]['literal'](_0xbb43('0x31')))),_0xbb43('0x32')],[db['sequelize']['fn'](_0xbb43('0x21'),db['sequelize']['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')](_0xbb43('0x33')))),_0xbb43('0x34')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0xbb43('0x35')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x208,\x201,\x20null'))),_0xbb43('0x36')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xbb43('0x37')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')](_0xbb43('0x38')))),_0xbb43('0x39')],[db['sequelize']['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbb43('0x3a')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db['sequelize']['fn']('IF',db[_0xbb43('0x1e')]['literal'](_0xbb43('0x3b')))),_0xbb43('0x3c')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0xbb43('0x3d')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db['sequelize'][_0xbb43('0x22')](_0xbb43('0x3e')))),_0xbb43('0x3f')],[db[_0xbb43('0x1e')]['fn']('COUNT',db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')][_0xbb43('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0xbb43('0x3d')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xbb43('0x40')]],'group':['campaign']})[_0xbb43('0x1a')](function(_0xe0cdba){logger['info'](_0xbb43('0x2c'),_0x2d2056);logger[_0xbb43('0xd')](_0xbb43('0x2c'),_0x2d2056,JSON[_0xbb43('0xf')](_0xe0cdba));_0x285014(_0xe0cdba);})[_0xbb43('0x14')](function(_0x5cb3c6){logger[_0xbb43('0x10')]('GetVoiceQueueHopperHistory',_0x5cb3c6['message'],_0x2d2056);_0x2c9a7c(_0x52a694[_0xbb43('0x10')](0x1f4,_0x5cb3c6[_0xbb43('0x12')]));});});};exports[_0xbb43('0x41')]=function(_0x474cee){var _0x129ee6=this;return new Promise(function(_0x5db053,_0x53a525){return db[_0xbb43('0x16')][_0xbb43('0x1c')]({'raw':_0x474cee[_0xbb43('0x18')]?_0x474cee[_0xbb43('0x18')][_0xbb43('0x19')]===undefined?!![]:![]:!![],'where':_0x474cee[_0xbb43('0x18')]?_0x474cee[_0xbb43('0x18')][_0xbb43('0x1d')]||null:null,'attributes':[[_0xbb43('0x2d'),'name'],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')][_0xbb43('0x1f')]('id')),_0xbb43('0x42')],[db[_0xbb43('0x1e')]['fn'](_0xbb43('0x21'),db[_0xbb43('0x1e')]['fn']('IF',db[_0xbb43('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xbb43('0x43')]],'group':[_0xbb43('0x2d')]})[_0xbb43('0x1a')](function(_0x3d4692){logger[_0xbb43('0xb')](_0xbb43('0x41'),_0x474cee);logger[_0xbb43('0xd')]('GetCampaignHopperHistory',_0x474cee,JSON[_0xbb43('0xf')](_0x3d4692));_0x5db053(_0x3d4692);})['catch'](function(_0x5a6ff0){logger[_0xbb43('0x10')](_0xbb43('0x41'),_0x5a6ff0[_0xbb43('0x12')],_0x474cee);_0x53a525(_0x129ee6[_0xbb43('0x10')](0x1f4,_0x5a6ff0[_0xbb43('0x12')]));});});}; \ No newline at end of file +var _0x4d04=['name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\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=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateCmHopperHistory','create','options','debug','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory'];(function(_0x233dc0,_0x2866ad){var _0x1fc160=function(_0x51e38b){while(--_0x51e38b){_0x233dc0['push'](_0x233dc0['shift']());}};_0x1fc160(++_0x2866ad);}(_0x4d04,0xf3));var _0x44d0=function(_0x557daa,_0x5717f8){_0x557daa=_0x557daa-0x0;var _0x17875b=_0x4d04[_0x557daa];return _0x17875b;};'use strict';var _=require('lodash');var util=require(_0x44d0('0x0'));var moment=require(_0x44d0('0x1'));var BPromise=require(_0x44d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44d0('0x3'));var db=require(_0x44d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x44d0('0x5'))(_0x44d0('0x6'));var config=require(_0x44d0('0x7'));var jayson=require(_0x44d0('0x8'));var client=jayson[_0x44d0('0x9')][_0x44d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a76eb,_0x1426f6,_0x10e3ce){return new BPromise(function(_0x4b800a,_0x507108){return client[_0x44d0('0xb')](_0x3a76eb,_0x10e3ce)[_0x44d0('0xc')](function(_0x3b34d6){logger['info'](_0x44d0('0xd'),_0x1426f6,'request\x20sent');logger['debug'](_0x44d0('0xe'),_0x1426f6,'request\x20sent',JSON[_0x44d0('0xf')](_0x3b34d6));if(_0x3b34d6[_0x44d0('0x10')]){if(_0x3b34d6[_0x44d0('0x10')][_0x44d0('0x11')]===0x1f4){logger[_0x44d0('0x10')](_0x44d0('0xd'),_0x1426f6,_0x3b34d6[_0x44d0('0x10')]['message']);return _0x507108(_0x3b34d6[_0x44d0('0x10')][_0x44d0('0x12')]);}logger[_0x44d0('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x1426f6,_0x3b34d6[_0x44d0('0x10')][_0x44d0('0x12')]);return _0x4b800a(_0x3b34d6[_0x44d0('0x10')][_0x44d0('0x12')]);}else{logger[_0x44d0('0x13')](_0x44d0('0xd'),_0x1426f6,_0x44d0('0x14'));_0x4b800a(_0x3b34d6[_0x44d0('0x15')]['message']);}})[_0x44d0('0x16')](function(_0x22d939){logger[_0x44d0('0x10')](_0x44d0('0xd'),_0x1426f6,_0x22d939);_0x507108(_0x22d939);});});}exports[_0x44d0('0x17')]=function(_0x29de0f){var _0x1b498b=this;return new Promise(function(_0x59024b,_0x2f2da1){return db['CmHopperHistory'][_0x44d0('0x18')](_0x29de0f['body'],{'raw':_0x29de0f[_0x44d0('0x19')]?_0x29de0f['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x49a39d){logger[_0x44d0('0x13')](_0x44d0('0x17'),_0x29de0f);logger[_0x44d0('0x1a')](_0x44d0('0x17'),_0x29de0f,JSON[_0x44d0('0xf')](_0x49a39d));_0x59024b(_0x49a39d);})[_0x44d0('0x16')](function(_0x184dce){logger[_0x44d0('0x10')](_0x44d0('0x17'),_0x184dce['message'],_0x29de0f);_0x2f2da1(_0x1b498b[_0x44d0('0x10')](0x1f4,_0x184dce['message']));});});};exports[_0x44d0('0x1b')]=function(_0x2fdcaf){var _0x71e6d0=this;return new Promise(function(_0xc82165,_0x2eda2d){return db['CmHopperHistory'][_0x44d0('0x1c')]({'raw':_0x2fdcaf[_0x44d0('0x19')]?_0x2fdcaf['options'][_0x44d0('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fdcaf[_0x44d0('0x19')]?_0x2fdcaf[_0x44d0('0x19')][_0x44d0('0x1e')]||null:null,'attributes':[[db[_0x44d0('0x1f')]['fn']('COUNT',db['sequelize'][_0x44d0('0x20')]('id')),_0x44d0('0x21')],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x44d0('0x23')))),_0x44d0('0x24')],[db['sequelize']['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x26')))),_0x44d0('0x27')],[db[_0x44d0('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x44d0('0x25')](_0x44d0('0x28')))),_0x44d0('0x29')],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x2a'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x2b')))),_0x44d0('0x2c')],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x2d')))),_0x44d0('0x2e')]]})['then'](function(_0x5b6798){logger[_0x44d0('0x13')](_0x44d0('0x1b'),_0x2fdcaf);logger[_0x44d0('0x1a')](_0x44d0('0x1b'),_0x2fdcaf,JSON[_0x44d0('0xf')](_0x5b6798));_0xc82165(_0x5b6798);})['catch'](function(_0x302c79){logger[_0x44d0('0x10')](_0x44d0('0x1b'),_0x302c79['message'],_0x2fdcaf);_0x2eda2d(_0x71e6d0['error'](0x1f4,_0x302c79[_0x44d0('0x12')]));});});};exports[_0x44d0('0x2f')]=function(_0x2d9623){var _0x1dfa60=this;return new Promise(function(_0x5939e1,_0x37ce9b){return db[_0x44d0('0x30')][_0x44d0('0x1c')]({'raw':_0x2d9623['options']?_0x2d9623['options'][_0x44d0('0x1d')]===undefined?!![]:![]:!![],'where':_0x2d9623[_0x44d0('0x19')]?_0x2d9623['options'][_0x44d0('0x1e')]||null:null,'attributes':[['campaign',_0x44d0('0x31')],[db['sequelize']['fn'](_0x44d0('0x22'),db['sequelize']['fn']('IF',db[_0x44d0('0x1f')]['literal'](_0x44d0('0x32')))),_0x44d0('0x33')],[db[_0x44d0('0x1f')]['fn']('COUNT',db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x34')))),'outboundNoAnswerCallsDay'],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db['sequelize'][_0x44d0('0x25')]('`state`\x20=\x204,\x201,\x20null'))),_0x44d0('0x35')],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')]['literal'](_0x44d0('0x36')))),_0x44d0('0x37')],[db['sequelize']['fn'](_0x44d0('0x22'),db['sequelize']['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')]('`state`\x20=\x208,\x201,\x20null'))),_0x44d0('0x38')],[db[_0x44d0('0x1f')]['fn']('COUNT',db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x39')))),'outboundDropCallsDayTimeout'],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x44d0('0x3a')],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x3b')))),_0x44d0('0x3c')],[db[_0x44d0('0x1f')]['fn']('COUNT',db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x3d')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')]['literal'](_0x44d0('0x3e')))),_0x44d0('0x3f')],[db['sequelize']['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x40')))),_0x44d0('0x41')],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x42')))),_0x44d0('0x43')],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')](_0x44d0('0x44')))),_0x44d0('0x41')],[db[_0x44d0('0x1f')]['fn']('COUNT',db[_0x44d0('0x1f')]['fn']('IF',db[_0x44d0('0x1f')][_0x44d0('0x25')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x44d0('0x45')]})[_0x44d0('0xc')](function(_0x12ac6a){logger[_0x44d0('0x13')](_0x44d0('0x2f'),_0x2d9623);logger[_0x44d0('0x1a')](_0x44d0('0x2f'),_0x2d9623,JSON[_0x44d0('0xf')](_0x12ac6a));_0x5939e1(_0x12ac6a);})['catch'](function(_0x285d1e){logger['error'](_0x44d0('0x2f'),_0x285d1e[_0x44d0('0x12')],_0x2d9623);_0x37ce9b(_0x1dfa60[_0x44d0('0x10')](0x1f4,_0x285d1e['message']));});});};exports[_0x44d0('0x46')]=function(_0x59b60a){var _0x481140=this;return new Promise(function(_0x19d10d,_0x444c66){return db[_0x44d0('0x30')]['findAll']({'raw':_0x59b60a['options']?_0x59b60a[_0x44d0('0x19')][_0x44d0('0x1d')]===undefined?!![]:![]:!![],'where':_0x59b60a[_0x44d0('0x19')]?_0x59b60a[_0x44d0('0x19')][_0x44d0('0x1e')]||null:null,'attributes':[[_0x44d0('0x45'),'name'],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db['sequelize'][_0x44d0('0x20')]('id')),_0x44d0('0x47')],[db[_0x44d0('0x1f')]['fn'](_0x44d0('0x22'),db[_0x44d0('0x1f')]['fn']('IF',db['sequelize'][_0x44d0('0x25')](_0x44d0('0x23')))),_0x44d0('0x48')]],'group':[_0x44d0('0x45')]})['then'](function(_0x4e2998){logger['info'](_0x44d0('0x46'),_0x59b60a);logger[_0x44d0('0x1a')](_0x44d0('0x46'),_0x59b60a,JSON[_0x44d0('0xf')](_0x4e2998));_0x19d10d(_0x4e2998);})[_0x44d0('0x16')](function(_0x1bda43){logger[_0x44d0('0x10')](_0x44d0('0x46'),_0x1bda43['message'],_0x59b60a);_0x444c66(_0x481140[_0x44d0('0x10')](0x1f4,_0x1bda43['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 320ab7b..cd5e0c3 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 _0xb276=['./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3d39ca,_0x245306){var _0x11be60=function(_0x12ef42){while(--_0x12ef42){_0x3d39ca['push'](_0x3d39ca['shift']());}};_0x11be60(++_0x245306);}(_0xb276,0xa3));var _0x6b27=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0xb276[_0x2defb5];return _0x229c53;};'use strict';var multer=require(_0x6b27('0x0'));var util=require('util');var path=require(_0x6b27('0x1'));var timeout=require('connect-timeout');var express=require(_0x6b27('0x2'));var router=express[_0x6b27('0x3')]();var fs_extra=require(_0x6b27('0x4'));var auth=require(_0x6b27('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b27('0x6'));var controller=require(_0x6b27('0x7'));router[_0x6b27('0x8')]('/',auth[_0x6b27('0x9')](),controller[_0x6b27('0xa')]);router['get'](_0x6b27('0xb'),auth[_0x6b27('0x9')](),controller['describe']);router[_0x6b27('0x8')](_0x6b27('0xc'),auth[_0x6b27('0x9')](),controller[_0x6b27('0xd')]);router['post']('/',auth[_0x6b27('0x9')](),controller[_0x6b27('0xe')]);router[_0x6b27('0xf')](_0x6b27('0xc'),auth[_0x6b27('0x9')](),controller[_0x6b27('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2421=['show','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x2421,0x1e8));var _0x1242=function(_0x50f351,_0x1f6a1e){_0x50f351=_0x50f351-0x0;var _0x345798=_0x2421[_0x50f351];return _0x345798;};'use strict';var multer=require(_0x1242('0x0'));var util=require(_0x1242('0x1'));var path=require(_0x1242('0x2'));var timeout=require('connect-timeout');var express=require(_0x1242('0x3'));var router=express[_0x1242('0x4')]();var fs_extra=require(_0x1242('0x5'));var auth=require(_0x1242('0x6'));var interaction=require(_0x1242('0x7'));var config=require(_0x1242('0x8'));var controller=require(_0x1242('0x9'));router['get']('/',auth[_0x1242('0xa')](),controller[_0x1242('0xb')]);router[_0x1242('0xc')](_0x1242('0xd'),auth[_0x1242('0xa')](),controller[_0x1242('0xe')]);router[_0x1242('0xc')](_0x1242('0xf'),auth[_0x1242('0xa')](),controller[_0x1242('0x10')]);router['post']('/',auth[_0x1242('0xa')](),controller[_0x1242('0x11')]);router[_0x1242('0x12')]('/:id',auth[_0x1242('0xa')](),controller[_0x1242('0x13')]);module[_0x1242('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index dc15e87..cd98ff7 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 _0x639d=['STRING','sequelize','exports'];(function(_0x1c4846,_0x53286){var _0xaac318=function(_0x354341){while(--_0x354341){_0x1c4846['push'](_0x1c4846['shift']());}};_0xaac318(++_0x53286);}(_0x639d,0xbb));var _0xd639=function(_0x4e4b26,_0x1692cb){_0x4e4b26=_0x4e4b26-0x0;var _0x4884ba=_0x639d[_0x4e4b26];return _0x4884ba;};'use strict';var Sequelize=require(_0xd639('0x0'));module[_0xd639('0x1')]={'name':{'type':Sequelize[_0xd639('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd639('0x2')]},'dialPrefix':{'type':Sequelize[_0xd639('0x2')]}}; \ No newline at end of file +var _0x777f=['exports','STRING','name','sequelize'];(function(_0x14d099,_0x5353c9){var _0x14266b=function(_0x34f197){while(--_0x34f197){_0x14d099['push'](_0x14d099['shift']());}};_0x14266b(++_0x5353c9);}(_0x777f,0x9f));var _0xf777=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x777f[_0x35f7f5];return _0x5567a4;};'use strict';var Sequelize=require(_0xf777('0x0'));module[_0xf777('0x1')]={'name':{'type':Sequelize[_0xf777('0x2')],'unique':_0xf777('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf777('0x2')]},'dialPrefix':{'type':Sequelize[_0xf777('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 12b6624..7b288bb 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 _0xe3a7=['findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','User','info','message','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./cmList.socket','register','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','update','destroy','then','get','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmList','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','create','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ListId','Disposition','removeDispositions','ids','addContacts','CmContact','tags','each','success','push','dataValues','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','alias','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','select','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','getCustomFields','findOne'];(function(_0x498953,_0x82d4af){var _0x4b2237=function(_0x5eda56){while(--_0x5eda56){_0x498953['push'](_0x498953['shift']());}};_0x4b2237(++_0x82d4af);}(_0xe3a7,0x14d));var _0x7e3a=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xe3a7[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e3a('0x0'));var zipdir=require(_0x7e3a('0x1'));var jsonpatch=require(_0x7e3a('0x2'));var rp=require(_0x7e3a('0x3'));var moment=require('moment');var BPromise=require(_0x7e3a('0x4'));var Mustache=require(_0x7e3a('0x5'));var util=require(_0x7e3a('0x6'));var path=require('path');var sox=require(_0x7e3a('0x7'));var csv=require('to-csv');var ejs=require(_0x7e3a('0x8'));var fs=require('fs');var fs_extra=require(_0x7e3a('0x9'));var _=require(_0x7e3a('0xa'));var squel=require('squel');var crypto=require(_0x7e3a('0xb'));var jsforce=require(_0x7e3a('0xc'));var deskjs=require(_0x7e3a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e3a('0xe'));var authService=require(_0x7e3a('0xf'));var qs=require(_0x7e3a('0x10'));var as=require(_0x7e3a('0x11'));var hardwareService=require(_0x7e3a('0x12'));var logger=require('../../config/logger')(_0x7e3a('0x13'));var utils=require(_0x7e3a('0x14'));var config=require(_0x7e3a('0x15'));var licenseUtil=require(_0x7e3a('0x16'));var db=require(_0x7e3a('0x17'))['db'];var csv_results;config['redis']=_[_0x7e3a('0x18')](config[_0x7e3a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e3a('0x1a'))(new Redis(config[_0x7e3a('0x19')]));require(_0x7e3a('0x1b'))[_0x7e3a('0x1c')](socket);function respondWithStatusCode(_0x2d7e33,_0x390f53){_0x390f53=_0x390f53||0xcc;return function(_0x518f47){if(_0x518f47){return _0x2d7e33['sendStatus'](_0x390f53);}return _0x2d7e33['status'](_0x390f53)[_0x7e3a('0x1d')]();};}function respondWithResult(_0x45c851,_0x3fe15c){_0x3fe15c=_0x3fe15c||0xc8;return function(_0x2d0e30){if(_0x2d0e30){return _0x45c851['status'](_0x3fe15c)[_0x7e3a('0x1e')](_0x2d0e30);}};}function respondWithFilteredResult(_0x4a71b0,_0x25bd2f){return function(_0x52a56d){if(_0x52a56d){var _0x5317fb=typeof _0x25bd2f[_0x7e3a('0x1f')]===_0x7e3a('0x20')&&typeof _0x25bd2f[_0x7e3a('0x21')]===_0x7e3a('0x20');var _0x475f61=_0x52a56d['count'];var _0x11f820=_0x5317fb?0x0:_0x25bd2f[_0x7e3a('0x1f')];var _0x4f71ff=_0x5317fb?_0x52a56d['count']:_0x25bd2f[_0x7e3a('0x1f')]+_0x25bd2f[_0x7e3a('0x21')];var _0x342f0a;if(_0x4f71ff>=_0x475f61){_0x4f71ff=_0x475f61;_0x342f0a=0xc8;}else{_0x342f0a=0xce;}_0x4a71b0[_0x7e3a('0x22')](_0x342f0a);return _0x4a71b0[_0x7e3a('0x23')](_0x7e3a('0x24'),_0x11f820+'-'+_0x4f71ff+'/'+_0x475f61)['json'](_0x52a56d);}return null;};}function patchUpdates(_0x93352f){return function(_0x1a3c32){try{jsonpatch[_0x7e3a('0x25')](_0x1a3c32,_0x93352f,!![]);}catch(_0x1d768f){return BPromise[_0x7e3a('0x26')](_0x1d768f);}return _0x1a3c32['save']();};}function saveUpdates(_0x564a22,_0x51556c){return function(_0x3e9a78){if(_0x3e9a78){return _0x3e9a78[_0x7e3a('0x27')](_0x564a22)['then'](function(_0xa08c7e){return _0xa08c7e;});}return null;};}function removeEntity(_0x65e7bc,_0x39177e){return function(_0x550cb0){if(_0x550cb0){return _0x550cb0[_0x7e3a('0x28')]()[_0x7e3a('0x29')](function(){var _0x1294ce=_0x550cb0[_0x7e3a('0x2a')]({'plain':!![]});var _0xe4abf9=_0x7e3a('0x2b');return db[_0x7e3a('0x2c')][_0x7e3a('0x28')]({'where':{'type':_0xe4abf9,'resourceId':_0x1294ce['id']}})['then'](function(){return _0x550cb0;});})[_0x7e3a('0x29')](function(){_0x65e7bc[_0x7e3a('0x22')](0xcc)[_0x7e3a('0x1d')]();});}};}function handleEntityNotFound(_0x1b0cfd,_0x424c9a){return function(_0x4bc11c){if(!_0x4bc11c){_0x1b0cfd[_0x7e3a('0x2d')](0x194);}return _0x4bc11c;};}function handleError(_0x20b155,_0xa8b7fb){_0xa8b7fb=_0xa8b7fb||0x1f4;return function(_0x5da7fd){logger[_0x7e3a('0x2e')](_0x5da7fd[_0x7e3a('0x2f')]);if(_0x5da7fd[_0x7e3a('0x30')]){delete _0x5da7fd[_0x7e3a('0x30')];}_0x20b155[_0x7e3a('0x22')](_0xa8b7fb)[_0x7e3a('0x31')](_0x5da7fd);};}exports[_0x7e3a('0x32')]=function(_0x4b7364,_0x8e577f){var _0x1902c7={},_0x36d09a={},_0x10461b={'count':0x0,'rows':[]};var _0x276fe1=_[_0x7e3a('0x33')](db[_0x7e3a('0x34')][_0x7e3a('0x35')],function(_0x42cf04){return{'name':_0x42cf04['fieldName'],'type':_0x42cf04[_0x7e3a('0x36')][_0x7e3a('0x37')]};});_0x36d09a['model']=_[_0x7e3a('0x33')](_0x276fe1,_0x7e3a('0x30'));_0x36d09a[_0x7e3a('0x38')]=_[_0x7e3a('0x39')](_0x4b7364[_0x7e3a('0x38')]);_0x36d09a[_0x7e3a('0x3a')]=_['intersection'](_0x36d09a[_0x7e3a('0x3b')],_0x36d09a[_0x7e3a('0x38')]);_0x1902c7[_0x7e3a('0x3c')]=_[_0x7e3a('0x3d')](_0x36d09a[_0x7e3a('0x3b')],qs[_0x7e3a('0x3e')](_0x4b7364['query'][_0x7e3a('0x3e')]));_0x1902c7[_0x7e3a('0x3c')]=_0x1902c7[_0x7e3a('0x3c')][_0x7e3a('0x3f')]?_0x1902c7[_0x7e3a('0x3c')]:_0x36d09a[_0x7e3a('0x3b')];if(!_0x4b7364[_0x7e3a('0x38')][_0x7e3a('0x40')](_0x7e3a('0x41'))){_0x1902c7[_0x7e3a('0x21')]=qs[_0x7e3a('0x21')](_0x4b7364[_0x7e3a('0x38')][_0x7e3a('0x21')]);_0x1902c7[_0x7e3a('0x1f')]=qs[_0x7e3a('0x1f')](_0x4b7364[_0x7e3a('0x38')][_0x7e3a('0x1f')]);}_0x1902c7[_0x7e3a('0x42')]=qs[_0x7e3a('0x43')](_0x4b7364[_0x7e3a('0x38')][_0x7e3a('0x43')]);_0x1902c7[_0x7e3a('0x44')]=qs[_0x7e3a('0x3a')](_[_0x7e3a('0x45')](_0x4b7364[_0x7e3a('0x38')],_0x36d09a[_0x7e3a('0x3a')]),_0x276fe1);if(_0x4b7364['query'][_0x7e3a('0x46')]){_0x1902c7['where']=_[_0x7e3a('0x47')](_0x1902c7[_0x7e3a('0x44')],{'$or':_[_0x7e3a('0x33')](_0x276fe1,function(_0x58aa4f){if(_0x58aa4f[_0x7e3a('0x36')]!=='VIRTUAL'){var _0x40f294={};_0x40f294[_0x58aa4f[_0x7e3a('0x30')]]={'$like':'%'+_0x4b7364[_0x7e3a('0x38')][_0x7e3a('0x46')]+'%'};return _0x40f294;}})});}_0x1902c7=_['merge']({},_0x1902c7,_0x4b7364[_0x7e3a('0x48')]);var _0x3fe26a={'where':_0x1902c7[_0x7e3a('0x44')]};return db['CmList'][_0x7e3a('0x49')](_0x3fe26a)[_0x7e3a('0x29')](function(_0x5e7128){_0x10461b[_0x7e3a('0x49')]=_0x5e7128;if(_0x4b7364[_0x7e3a('0x38')][_0x7e3a('0x4a')]){_0x1902c7[_0x7e3a('0x4b')]=[{'all':!![]}];}return db['CmList'][_0x7e3a('0x4c')](_0x1902c7);})[_0x7e3a('0x29')](function(_0xd21b97){_0x10461b[_0x7e3a('0x4d')]=_0xd21b97;return _0x10461b;})['then'](respondWithFilteredResult(_0x8e577f,_0x1902c7))[_0x7e3a('0x4e')](handleError(_0x8e577f,null));};exports[_0x7e3a('0x4f')]=function(_0x346a41,_0x59b552){var _0x47e3ea={'raw':![],'where':{'id':_0x346a41['params']['id']}},_0x580b79={};_0x580b79['model']=_['keys'](db[_0x7e3a('0x34')][_0x7e3a('0x35')]);_0x580b79[_0x7e3a('0x38')]=_[_0x7e3a('0x39')](_0x346a41[_0x7e3a('0x38')]);_0x580b79[_0x7e3a('0x3a')]=_['intersection'](_0x580b79['model'],_0x580b79[_0x7e3a('0x38')]);_0x47e3ea[_0x7e3a('0x3c')]=_[_0x7e3a('0x3d')](_0x580b79[_0x7e3a('0x3b')],qs[_0x7e3a('0x3e')](_0x346a41['query'][_0x7e3a('0x3e')]));_0x47e3ea[_0x7e3a('0x3c')]=_0x47e3ea[_0x7e3a('0x3c')][_0x7e3a('0x3f')]?_0x47e3ea[_0x7e3a('0x3c')]:_0x580b79[_0x7e3a('0x3b')];if(_0x346a41[_0x7e3a('0x38')][_0x7e3a('0x4a')]){_0x47e3ea[_0x7e3a('0x4b')]=[{'all':!![]}];}_0x47e3ea=_['merge']({},_0x47e3ea,_0x346a41[_0x7e3a('0x48')]);return db['CmList']['find'](_0x47e3ea)['then'](handleEntityNotFound(_0x59b552,null))[_0x7e3a('0x29')](respondWithResult(_0x59b552,null))[_0x7e3a('0x4e')](handleError(_0x59b552,null));};exports[_0x7e3a('0x50')]=function(_0x544522,_0x20ee34){return db[_0x7e3a('0x34')][_0x7e3a('0x50')](_0x544522['body'],{})['then'](function(_0x5b9007){var _0x555133=_0x544522[_0x7e3a('0x51')][_0x7e3a('0x2a')]({'plain':!![]});if(!_0x555133)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x555133[_0x7e3a('0x52')]===_0x7e3a('0x51')){var _0x90f01=_0x5b9007[_0x7e3a('0x2a')]({'plain':!![]});var _0x44d1c7=_0x7e3a('0x2b');return db['UserProfileSection'][_0x7e3a('0x53')]({'where':{'name':_0x44d1c7,'userProfileId':_0x555133['userProfileId']},'raw':!![]})['then'](function(_0x132a50){if(_0x132a50&&_0x132a50[_0x7e3a('0x54')]===0x0){return db['UserProfileResource'][_0x7e3a('0x50')]({'name':_0x90f01['name'],'resourceId':_0x90f01['id'],'type':_0x132a50[_0x7e3a('0x30')],'sectionId':_0x132a50['id']},{})[_0x7e3a('0x29')](function(){return _0x5b9007;});}else{return _0x5b9007;}})['catch'](function(_0x3a881e){logger[_0x7e3a('0x2e')](_0x7e3a('0x55'),_0x3a881e);throw _0x3a881e;});}return _0x5b9007;})[_0x7e3a('0x29')](respondWithResult(_0x20ee34,0xc9))[_0x7e3a('0x4e')](handleError(_0x20ee34,null));};exports[_0x7e3a('0x27')]=function(_0x17700a,_0x3aa6d4){if(_0x17700a[_0x7e3a('0x56')]['id']){delete _0x17700a['body']['id'];}return db[_0x7e3a('0x34')][_0x7e3a('0x53')]({'where':{'id':_0x17700a[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x3aa6d4,null))[_0x7e3a('0x29')](saveUpdates(_0x17700a['body'],null))['then'](respondWithResult(_0x3aa6d4,null))['catch'](handleError(_0x3aa6d4,null));};exports[_0x7e3a('0x28')]=function(_0x38b017,_0x3e31f4){return db['CmList'][_0x7e3a('0x53')]({'where':{'id':_0x38b017[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x3e31f4,null))[_0x7e3a('0x29')](removeEntity(_0x3e31f4,null))['catch'](handleError(_0x3e31f4,null));};exports[_0x7e3a('0x58')]=function(_0x371365,_0x4c9302){return db[_0x7e3a('0x34')][_0x7e3a('0x58')]()[_0x7e3a('0x29')](respondWithResult(_0x4c9302,null))['catch'](handleError(_0x4c9302,null));};exports[_0x7e3a('0x59')]=function(_0x1709c9,_0x1b6ae9,_0x1004bc){if(_0x1709c9[_0x7e3a('0x56')]['id']){delete _0x1709c9[_0x7e3a('0x56')]['id'];}return db[_0x7e3a('0x34')][_0x7e3a('0x53')]({'where':{'id':_0x1709c9['params']['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x1b6ae9,null))[_0x7e3a('0x29')](function(_0x4e603a){if(_0x4e603a){_0x1709c9[_0x7e3a('0x56')][_0x7e3a('0x5a')]=_0x4e603a['id'];return db['Disposition']['create'](_0x1709c9['body']);}})['then'](respondWithResult(_0x1b6ae9,null))[_0x7e3a('0x4e')](handleError(_0x1b6ae9,null));};exports['getDispositions']=function(_0x301c54,_0x2ce4d2,_0x1691ff){var _0x26082c={'raw':![],'where':{}};var _0x29198c={};var _0x513dd7={'count':0x0,'rows':[]};return db[_0x7e3a('0x34')]['findOne']({'where':{'id':_0x301c54[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x2ce4d2,null))[_0x7e3a('0x29')](function(_0xbdaf72){if(_0xbdaf72){_0x29198c['model']=_[_0x7e3a('0x39')](db[_0x7e3a('0x5b')][_0x7e3a('0x35')]);_0x29198c[_0x7e3a('0x38')]=_[_0x7e3a('0x39')](_0x301c54[_0x7e3a('0x38')]);_0x29198c['filters']=_['intersection'](_0x29198c[_0x7e3a('0x3b')],_0x29198c[_0x7e3a('0x38')]);_0x26082c['attributes']=_[_0x7e3a('0x3d')](_0x29198c[_0x7e3a('0x3b')],qs['fields'](_0x301c54[_0x7e3a('0x38')][_0x7e3a('0x3e')]));_0x26082c['attributes']=_0x26082c['attributes'][_0x7e3a('0x3f')]?_0x26082c['attributes']:_0x29198c[_0x7e3a('0x3b')];if(!_0x301c54[_0x7e3a('0x38')][_0x7e3a('0x40')]('nolimit')){_0x26082c[_0x7e3a('0x21')]=qs['limit'](_0x301c54[_0x7e3a('0x38')]['limit']);_0x26082c[_0x7e3a('0x1f')]=qs[_0x7e3a('0x1f')](_0x301c54[_0x7e3a('0x38')][_0x7e3a('0x1f')]);}_0x26082c['order']=qs[_0x7e3a('0x43')](_0x301c54[_0x7e3a('0x38')][_0x7e3a('0x43')]);_0x26082c[_0x7e3a('0x44')]=qs[_0x7e3a('0x3a')](_[_0x7e3a('0x45')](_0x301c54[_0x7e3a('0x38')],_0x29198c[_0x7e3a('0x3a')]));_0x26082c['where'][_0x7e3a('0x5a')]=_0xbdaf72['id'];if(_0x301c54['query'][_0x7e3a('0x46')]){_0x26082c['where']=_[_0x7e3a('0x47')](_0x26082c[_0x7e3a('0x44')],{'$or':_[_0x7e3a('0x33')](_0x26082c[_0x7e3a('0x3c')],function(_0x1b41bc){var _0x52f804={};_0x52f804[_0x1b41bc]={'$like':'%'+_0x301c54['query'][_0x7e3a('0x46')]+'%'};return _0x52f804;})});}_0x26082c=_['merge']({},_0x26082c,_0x301c54[_0x7e3a('0x48')]);return db[_0x7e3a('0x5b')]['count']({'where':_0x26082c[_0x7e3a('0x44')]})[_0x7e3a('0x29')](function(_0x291a15){_0x513dd7['count']=_0x291a15;if(_0x301c54[_0x7e3a('0x38')][_0x7e3a('0x4a')]){_0x26082c[_0x7e3a('0x4b')]=[{'all':!![]}];}return db[_0x7e3a('0x5b')][_0x7e3a('0x4c')](_0x26082c);})[_0x7e3a('0x29')](function(_0x171fe7){_0x513dd7[_0x7e3a('0x4d')]=_0x171fe7;return _0x513dd7;});}})[_0x7e3a('0x29')](respondWithFilteredResult(_0x2ce4d2,_0x26082c))[_0x7e3a('0x4e')](handleError(_0x2ce4d2,null));};exports[_0x7e3a('0x5c')]=function(_0x55267e,_0x13053a,_0x47297f){return db[_0x7e3a('0x34')]['find']({'where':{'id':_0x55267e[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x13053a,null))[_0x7e3a('0x29')](function(_0x59c145){if(_0x59c145){return _0x59c145[_0x7e3a('0x5c')](_0x55267e['query'][_0x7e3a('0x5d')]);}})[_0x7e3a('0x29')](respondWithStatusCode(_0x13053a,null))[_0x7e3a('0x4e')](handleError(_0x13053a,null));};exports[_0x7e3a('0x5e')]=function(_0x430d8d,_0x24fe81,_0xc3b03f){return db[_0x7e3a('0x34')][_0x7e3a('0x53')]({'where':{'id':_0x430d8d[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x24fe81,null))[_0x7e3a('0x29')](function(_0x275e33){if(_0x275e33){var _0x192b43=[];var _0x1b5f7e={'success':[],'errors':[]};return db[_0x7e3a('0x5f')][_0x7e3a('0x58')]()[_0x7e3a('0x29')](function(_0x108669){if(_0x430d8d[_0x7e3a('0x56')]['tags']&&_['isArray'](_0x430d8d[_0x7e3a('0x56')][_0x7e3a('0x60')])){if(_0x430d8d[_0x7e3a('0x56')][_0x7e3a('0x60')][_0x7e3a('0x3f')]){_0x430d8d[_0x7e3a('0x56')][_0x7e3a('0x60')]=_0x430d8d[_0x7e3a('0x56')][_0x7e3a('0x60')]['join'](';')+';';}else{_0x430d8d[_0x7e3a('0x56')][_0x7e3a('0x60')]=null;}}else{_0x430d8d[_0x7e3a('0x56')][_0x7e3a('0x60')]=null;}if(_0x430d8d[_0x7e3a('0x56')]&&_['isArray'](_0x430d8d[_0x7e3a('0x56')])){for(var _0x538e59=0x0;_0x538e59<_0x430d8d['body'][_0x7e3a('0x3f')];_0x538e59+=0x1){_0x430d8d['body'][_0x538e59][_0x7e3a('0x5a')]=_0x430d8d['params']['id'];_0x192b43['push'](_0x430d8d[_0x7e3a('0x56')][_0x538e59]);}return BPromise[_0x7e3a('0x61')](_0x192b43,function(_0x3cb5a8){return db['CmContact'][_0x7e3a('0x50')](_['omit'](_0x3cb5a8,[_0x7e3a('0x5d'),'id'])||{},{'fields':_[_0x7e3a('0x39')](_0x108669),'raw':!![]})[_0x7e3a('0x29')](function(_0xfe536f){_0x1b5f7e[_0x7e3a('0x62')][_0x7e3a('0x63')](_0xfe536f[_0x7e3a('0x64')]);})[_0x7e3a('0x4e')](function(_0x1949bd){_0x1b5f7e['errors'][_0x7e3a('0x63')]({'data':_0x3cb5a8,'error':_0x1949bd['message']});});})[_0x7e3a('0x29')](function(_0x45e881){return _0x1b5f7e;})['catch'](function(_0x4d08a5){return _0x4d08a5;});}else{_0x24fe81[_0x7e3a('0x22')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x7e3a('0x29')](respondWithResult(_0x24fe81,null))[_0x7e3a('0x4e')](handleError(_0x24fe81,null));};exports['getContacts']=function(_0x22700d,_0x381f76,_0x4311de){var _0xb65d40;return db[_0x7e3a('0x34')]['find']({'where':{'id':_0x22700d['params']['id']},'include':[{'model':db[_0x7e3a('0x65')],'as':_0x7e3a('0x66')}]})['then'](handleEntityNotFound(_0x381f76,null))['then'](function(_0x1f7e0e){if(_0x1f7e0e){_0xb65d40=_0x1f7e0e;return db[_0x7e3a('0x5f')]['rawAttributes'];}})[_0x7e3a('0x29')](function(_0x290d5d){if(_0x290d5d){var _0x58b801={};var _0x59a57e={};_0x59a57e['model']=_[_0x7e3a('0x67')](_['keys'](_0x290d5d),_['map'](_0xb65d40[_0x7e3a('0x66')],function(_0x25ea69){return util[_0x7e3a('0x68')](_0x7e3a('0x69'),_0x25ea69['id']);}));_0x59a57e['query']=_['keys'](_0x22700d[_0x7e3a('0x38')]);_0x59a57e[_0x7e3a('0x3a')]=_['intersection'](_0x59a57e['model'],_0x59a57e[_0x7e3a('0x38')]);_0x58b801[_0x7e3a('0x3c')]=_['intersection'](_0x59a57e[_0x7e3a('0x3b')],qs[_0x7e3a('0x3e')](_0x22700d[_0x7e3a('0x38')]['fields']));_0x58b801['attributes']=_0x58b801['attributes']['length']?_0x58b801[_0x7e3a('0x3c')]:_0x59a57e[_0x7e3a('0x3b')];if(!_0x22700d[_0x7e3a('0x38')]['hasOwnProperty']('nolimit')){_0x58b801[_0x7e3a('0x21')]=qs[_0x7e3a('0x21')](_0x22700d[_0x7e3a('0x38')][_0x7e3a('0x21')]);_0x58b801['offset']=qs['offset'](_0x22700d[_0x7e3a('0x38')][_0x7e3a('0x1f')]);}_0x58b801[_0x7e3a('0x42')]=qs[_0x7e3a('0x43')](_0x22700d[_0x7e3a('0x38')][_0x7e3a('0x43')]);_0x58b801[_0x7e3a('0x44')]=qs[_0x7e3a('0x3a')](_['pick'](_0x22700d['query'],_0x59a57e[_0x7e3a('0x3a')]));_0x58b801[_0x7e3a('0x6a')]=!![];if(_0x22700d[_0x7e3a('0x38')][_0x7e3a('0x46')]){_0x58b801[_0x7e3a('0x44')]=_[_0x7e3a('0x47')](_0x58b801[_0x7e3a('0x44')],{'$or':_['map'](_0x58b801[_0x7e3a('0x3c')],function(_0xe68d0e){var _0x107a82={};_0x107a82[_0xe68d0e]={'$like':'%'+_0x22700d[_0x7e3a('0x38')]['filter']+'%'};return _0x107a82;})});}_0x58b801=_['merge']({},_0x58b801,_0x22700d[_0x7e3a('0x48')]);return _0xb65d40[_0x7e3a('0x6b')](_0x58b801);}})['then'](respondWithResult(_0x381f76,null))[_0x7e3a('0x4e')](handleError(_0x381f76,null));};exports[_0x7e3a('0x6c')]=function(_0x10b1bb,_0x55479c,_0x578773){var _0x381ef7;var _0x2a7720;var _0x327b65;var _0xfec9ba=_0x10b1bb[_0x7e3a('0x57')]['id'];csv_results=[];return db[_0x7e3a('0x6d')][_0x7e3a('0x4c')]({'attributes':['id',_0x7e3a('0x30')],'raw':!![],'order':['OrderBy']})[_0x7e3a('0x29')](function(_0x269b4a){_0x381ef7=_0x269b4a;var _0x14d13a=_[_0x7e3a('0x39')](db[_0x7e3a('0x5f')][_0x7e3a('0x35')]);return db[_0x7e3a('0x65')]['findAll']({'raw':!![],'attributes':['id',_0x7e3a('0x6e')]})[_0x7e3a('0x29')](function(_0x10ac30){_0x2a7720=_0x10ac30;var _0x51b450=squel['select']()[_0x7e3a('0x3e')](_0x14d13a)[_0x7e3a('0x6f')](_0x7e3a('0x70'),'c')[_0x7e3a('0x44')]('c.ListId\x20=\x20?',_0xfec9ba)['where'](_0x7e3a('0x71'))['distinct']();for(var _0x12e72d=0x0;_0x12e72d<_0x2a7720[_0x7e3a('0x3f')];_0x12e72d++){_0x51b450[_0x7e3a('0x72')](_0x7e3a('0x73')+_0x2a7720[_0x12e72d]['id'],_0x7e3a('0x74')+_0x2a7720[_0x12e72d][_0x7e3a('0x6e')]);}for(var _0x12e72d=0x0;_0x12e72d<_0x381ef7[_0x7e3a('0x3f')];_0x12e72d++){_0x51b450[_0x7e3a('0x72')](squel[_0x7e3a('0x75')]()['field'](_0x7e3a('0x76'))[_0x7e3a('0x6f')]('cm_contact_has_items')[_0x7e3a('0x44')](_0x7e3a('0x77'),_0x381ef7[_0x12e72d]['id'])[_0x7e3a('0x44')](_0x7e3a('0x78')),_0x7e3a('0x79')+_0x381ef7[_0x12e72d]['name']);_0x51b450[_0x7e3a('0x72')](squel[_0x7e3a('0x75')]()[_0x7e3a('0x72')]('description')[_0x7e3a('0x6f')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x381ef7[_0x12e72d]['id'])[_0x7e3a('0x44')](_0x7e3a('0x78')),_0x7e3a('0x7a')+_0x381ef7[_0x12e72d]['name']);}var _0x7e7de1=[];_0x7e7de1[_0x7e3a('0x63')](_0x51b450[_0x7e3a('0x7b')]());BPromise[_0x7e3a('0x61')](_0x7e7de1,handleQuery)[_0x7e3a('0x29')](function(_0x519645){handleQuery(_0x51b450['toString']());var _0x43d7e5=csv_results[0x0];if(!_[_0x7e3a('0x7c')](_0x43d7e5)){var _0x334154=toCsv(_0x43d7e5);var _0x175adb=Date[_0x7e3a('0x7d')]();fs[_0x7e3a('0x7e')](util[_0x7e3a('0x68')](_0x7e3a('0x7f'),_0xfec9ba,_0x175adb),_0x334154);_0x55479c[_0x7e3a('0x80')](_0x7e3a('0x81'),_0x7e3a('0x82')+util[_0x7e3a('0x68')](_0x7e3a('0x83'),_0xfec9ba,_0x175adb));_0x55479c[_0x7e3a('0x80')]('Content-type',_0x7e3a('0x84'));return _0x55479c[_0x7e3a('0x85')](util[_0x7e3a('0x68')](_0x7e3a('0x7f'),_0xfec9ba,_0x175adb));}else{return _0x55479c[_0x7e3a('0x2d')](0xcc);}});});});};exports['addCustomField']=function(_0x42c90a,_0x18e219,_0x55a368){var _0x160a8d;delete _0x42c90a[_0x7e3a('0x56')]['id'];return db['CmList']['findOne']({'where':{'id':_0x42c90a[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x18e219,null))[_0x7e3a('0x29')](function(_0x9f193){if(_0x9f193){return db[_0x7e3a('0x86')][_0x7e3a('0x87')](function(_0x2404da){return db['CmCustomField']['create'](_0x42c90a['body'],{'transaction':_0x2404da})[_0x7e3a('0x29')](function(_0x124c13){_0x160a8d=_0x124c13;return _0x9f193[_0x7e3a('0x88')](_0x124c13,{'transaction':_0x2404da});})[_0x7e3a('0x29')](function(){var _0x5ee1d5={'type':db[_0x7e3a('0x89')]['TEXT'],'transaction':_0x2404da};switch(_0x42c90a[_0x7e3a('0x56')][_0x7e3a('0x36')]){case'text':_0x5ee1d5[_0x7e3a('0x36')]=db[_0x7e3a('0x89')][_0x7e3a('0x8a')];break;case _0x7e3a('0x8b'):_0x5ee1d5[_0x7e3a('0x36')]=db[_0x7e3a('0x89')][_0x7e3a('0x8c')];break;case _0x7e3a('0x8d'):_0x5ee1d5[_0x7e3a('0x36')]=db['Sequelize'][_0x7e3a('0x8e')];_0x5ee1d5['defaultValue']=![];break;default:}return db[_0x7e3a('0x86')][_0x7e3a('0x8f')][_0x7e3a('0x90')](_0x7e3a('0x70'),util[_0x7e3a('0x68')]('cf_%s',_0x160a8d['id']),_0x5ee1d5);})[_0x7e3a('0x29')](function(){return _0x160a8d;});});}})['then'](respondWithResult(_0x18e219,null))['catch'](handleError(_0x18e219,null));};exports[_0x7e3a('0x91')]=function(_0x3071cc,_0x4f3874,_0x4d14d5){var _0x5f1150={};var _0x5e63b6={};var _0x4fc8a0;var _0x47c194;return db[_0x7e3a('0x34')][_0x7e3a('0x92')]({'where':{'id':_0x3071cc[_0x7e3a('0x57')]['id']}})['then'](handleEntityNotFound(_0x4f3874,null))[_0x7e3a('0x29')](function(_0x58acef){if(_0x58acef){_0x4fc8a0=_0x58acef;_0x5e63b6[_0x7e3a('0x3b')]=_[_0x7e3a('0x39')](db[_0x7e3a('0x65')][_0x7e3a('0x35')]);_0x5e63b6[_0x7e3a('0x38')]=_['keys'](_0x3071cc[_0x7e3a('0x38')]);_0x5e63b6[_0x7e3a('0x3a')]=_['intersection'](_0x5e63b6[_0x7e3a('0x3b')],_0x5e63b6[_0x7e3a('0x38')]);_0x5f1150[_0x7e3a('0x3c')]=_[_0x7e3a('0x3d')](_0x5e63b6[_0x7e3a('0x3b')],qs[_0x7e3a('0x3e')](_0x3071cc[_0x7e3a('0x38')]['fields']));_0x5f1150[_0x7e3a('0x3c')]=_0x5f1150[_0x7e3a('0x3c')][_0x7e3a('0x3f')]?_0x5f1150[_0x7e3a('0x3c')]:_0x5e63b6[_0x7e3a('0x3b')];_0x5f1150[_0x7e3a('0x42')]=qs['sort'](_0x3071cc['query'][_0x7e3a('0x43')]);_0x5f1150['where']=qs['filters'](_['pick'](_0x3071cc[_0x7e3a('0x38')],_0x5e63b6[_0x7e3a('0x3a')]));_0x5f1150[_0x7e3a('0x44')]=_[_0x7e3a('0x47')](_0x5f1150[_0x7e3a('0x44')],{'$or':[{'ListId':_0x58acef['id']},{'ListId':null}]});if(_0x3071cc[_0x7e3a('0x38')][_0x7e3a('0x46')]){_0x5f1150[_0x7e3a('0x44')]=_[_0x7e3a('0x47')](_0x5f1150[_0x7e3a('0x44')],{'$or':_[_0x7e3a('0x33')](_0x5f1150[_0x7e3a('0x3c')],function(_0x43d23e){var _0x3d4da5={};_0x3d4da5[_0x43d23e]={'$like':'%'+_0x3071cc[_0x7e3a('0x38')][_0x7e3a('0x46')]+'%'};return _0x3d4da5;})});}_0x5f1150=_[_0x7e3a('0x47')]({},_0x5f1150,_0x3071cc[_0x7e3a('0x48')]);return db[_0x7e3a('0x65')][_0x7e3a('0x93')](_0x5f1150);}})['then'](respondWithResult(_0x4f3874,null))[_0x7e3a('0x4e')](handleError(_0x4f3874,null));};exports[_0x7e3a('0x94')]=function(_0x2fdbe9,_0x54fa9d){return db[_0x7e3a('0x65')][_0x7e3a('0x93')]({'where':{'ListId':null}})[_0x7e3a('0x29')](handleEntityNotFound(_0x54fa9d,null))[_0x7e3a('0x29')](function(_0x21d68a){return _0x21d68a;})[_0x7e3a('0x29')](respondWithResult(_0x54fa9d,null))[_0x7e3a('0x4e')](handleError(_0x54fa9d,null));};exports[_0x7e3a('0x95')]=function(_0x12b485,_0x1b3456,_0x51310f){return db['CmList'][_0x7e3a('0x53')]({'where':{'id':_0x12b485[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x1b3456,null))[_0x7e3a('0x29')](function(_0x17043c){if(_0x17043c){return _0x17043c[_0x7e3a('0x95')](_0x12b485[_0x7e3a('0x56')][_0x7e3a('0x5d')],_[_0x7e3a('0x96')](_0x12b485[_0x7e3a('0x56')],[_0x7e3a('0x5d'),'id'])||{})[_0x7e3a('0x97')](function(_0x2b2882){for(var _0x2cbd41=0x0;_0x2cbd41<_0x12b485[_0x7e3a('0x56')][_0x7e3a('0x5d')][_0x7e3a('0x3f')];_0x2cbd41+=0x1){socket[_0x7e3a('0x98')](_0x7e3a('0x99'),{'UserId':Number(_0x12b485[_0x7e3a('0x56')]['ids'][_0x2cbd41]),'CmListId':Number(_0x12b485[_0x7e3a('0x57')]['id'])});}return _0x2b2882;});}})[_0x7e3a('0x29')](respondWithResult(_0x1b3456,null))[_0x7e3a('0x4e')](handleError(_0x1b3456,null));};exports[_0x7e3a('0x9a')]=function(_0x19c827,_0x288217,_0x50a7bf){return db['CmList']['find']({'where':{'id':_0x19c827['params']['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x288217,null))[_0x7e3a('0x29')](function(_0x4f7ae5){if(_0x4f7ae5){return _0x4f7ae5[_0x7e3a('0x9a')](_0x19c827['query'][_0x7e3a('0x5d')])[_0x7e3a('0x29')](function(){if(_[_0x7e3a('0x9b')](_0x19c827[_0x7e3a('0x38')][_0x7e3a('0x5d')])){for(var _0x1bd02c=0x0;_0x1bd02c<_0x19c827[_0x7e3a('0x38')][_0x7e3a('0x5d')][_0x7e3a('0x3f')];_0x1bd02c+=0x1){socket[_0x7e3a('0x98')](_0x7e3a('0x9c'),{'UserId':Number(_0x19c827[_0x7e3a('0x38')][_0x7e3a('0x5d')][_0x1bd02c]),'CmListId':Number(_0x19c827[_0x7e3a('0x57')]['id'])});}}else{socket[_0x7e3a('0x98')](_0x7e3a('0x9c'),{'UserId':Number(_0x19c827['query'][_0x7e3a('0x5d')]),'CmListId':Number(_0x19c827[_0x7e3a('0x57')]['id'])});}});}})[_0x7e3a('0x29')](respondWithStatusCode(_0x288217,null))[_0x7e3a('0x4e')](handleError(_0x288217,null));};exports['getAgents']=function(_0x3f4593,_0x1823e1,_0x17a10b){var _0x4787df={};var _0x31588a={};var _0x5522a0;var _0x5c7070;return db[_0x7e3a('0x34')][_0x7e3a('0x92')]({'where':{'id':_0x3f4593[_0x7e3a('0x57')]['id']}})[_0x7e3a('0x29')](handleEntityNotFound(_0x1823e1,null))['then'](function(_0x26c4c2){if(_0x26c4c2){_0x5522a0=_0x26c4c2;_0x31588a['model']=_[_0x7e3a('0x39')](db[_0x7e3a('0x9d')][_0x7e3a('0x35')]);_0x31588a[_0x7e3a('0x38')]=_[_0x7e3a('0x39')](_0x3f4593[_0x7e3a('0x38')]);_0x31588a[_0x7e3a('0x3a')]=_[_0x7e3a('0x3d')](_0x31588a[_0x7e3a('0x3b')],_0x31588a[_0x7e3a('0x38')]);_0x4787df['attributes']=_['intersection'](_0x31588a[_0x7e3a('0x3b')],qs['fields'](_0x3f4593['query'][_0x7e3a('0x3e')]));_0x4787df[_0x7e3a('0x3c')]=_0x4787df[_0x7e3a('0x3c')][_0x7e3a('0x3f')]?_0x4787df['attributes']:_0x31588a[_0x7e3a('0x3b')];_0x4787df[_0x7e3a('0x42')]=qs[_0x7e3a('0x43')](_0x3f4593[_0x7e3a('0x38')]['sort']);_0x4787df[_0x7e3a('0x44')]=qs[_0x7e3a('0x3a')](_[_0x7e3a('0x45')](_0x3f4593[_0x7e3a('0x38')],_0x31588a[_0x7e3a('0x3a')]));if(_0x3f4593[_0x7e3a('0x38')]['filter']){_0x4787df['where']=_[_0x7e3a('0x47')](_0x4787df[_0x7e3a('0x44')],{'$or':_['map'](_0x4787df['attributes'],function(_0x2c4b99){var _0x307e20={};_0x307e20[_0x2c4b99]={'$like':'%'+_0x3f4593[_0x7e3a('0x38')][_0x7e3a('0x46')]+'%'};return _0x307e20;})});}_0x4787df=_[_0x7e3a('0x47')]({},_0x4787df,_0x3f4593[_0x7e3a('0x48')]);return _0x5522a0['getAgents'](_0x4787df);}})['then'](function(_0x171cc9){if(_0x171cc9){_0x5c7070=_0x171cc9[_0x7e3a('0x3f')];if(!_0x3f4593[_0x7e3a('0x38')][_0x7e3a('0x40')](_0x7e3a('0x41'))){_0x4787df[_0x7e3a('0x21')]=qs[_0x7e3a('0x21')](_0x3f4593['query'][_0x7e3a('0x21')]);_0x4787df[_0x7e3a('0x1f')]=qs[_0x7e3a('0x1f')](_0x3f4593['query'][_0x7e3a('0x1f')]);}return _0x5522a0['getAgents'](_0x4787df);}})['then'](function(_0x21801a){if(_0x21801a){return _0x21801a?{'count':_0x5c7070,'rows':_0x21801a}:null;}})[_0x7e3a('0x29')](respondWithResult(_0x1823e1,null))[_0x7e3a('0x4e')](handleError(_0x1823e1,null));};function handleQuery(_0x2b6758){logger[_0x7e3a('0x9e')](_0x2b6758);return db[_0x7e3a('0x86')][_0x7e3a('0x38')](_0x2b6758)[_0x7e3a('0x97')](function(_0xd4dd6a){csv_results[_0x7e3a('0x63')](_0xd4dd6a);})[_0x7e3a('0x4e')](function(_0x10c2dd){logger['error'](_0x10c2dd[_0x7e3a('0x9f')]);});} \ No newline at end of file +var _0x480b=['getContacts','getContactsCsv','alias','from','cm_contacts','c.deletedAt\x20is\x20null','c.cf_','customField_','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','select','description','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','download','format','addCustomField','sequelize','transaction','Sequelize','TEXT','text','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','get','Lists','UserProfileResource','end','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','options','CmList','includeAll','include','rows','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','pick','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','cf_%d','raw'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x480b,0x16f));var _0xb480=function(_0x1a1a7f,_0x486000){_0x1a1a7f=_0x1a1a7f-0x0;var _0xc90f63=_0x480b[_0x1a1a7f];return _0xc90f63;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb480('0x0'));var jsonpatch=require(_0xb480('0x1'));var rp=require(_0xb480('0x2'));var moment=require('moment');var BPromise=require(_0xb480('0x3'));var Mustache=require(_0xb480('0x4'));var util=require(_0xb480('0x5'));var path=require(_0xb480('0x6'));var sox=require(_0xb480('0x7'));var csv=require(_0xb480('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb480('0x9'));var _=require(_0xb480('0xa'));var squel=require(_0xb480('0xb'));var crypto=require(_0xb480('0xc'));var jsforce=require(_0xb480('0xd'));var deskjs=require(_0xb480('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb480('0xf'));var Papa=require(_0xb480('0x10'));var Redis=require('ioredis');var authService=require(_0xb480('0x11'));var qs=require(_0xb480('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb480('0x13'));var logger=require(_0xb480('0x14'))('api');var utils=require(_0xb480('0x15'));var config=require(_0xb480('0x16'));var licenseUtil=require(_0xb480('0x17'));var db=require(_0xb480('0x18'))['db'];var csv_results;config[_0xb480('0x19')]=_['defaults'](config[_0xb480('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb480('0x1a'))(new Redis(config['redis']));require(_0xb480('0x1b'))[_0xb480('0x1c')](socket);function respondWithStatusCode(_0x5dbd29,_0x3f3ec3){_0x3f3ec3=_0x3f3ec3||0xcc;return function(_0x4e7ece){if(_0x4e7ece){return _0x5dbd29['sendStatus'](_0x3f3ec3);}return _0x5dbd29['status'](_0x3f3ec3)['end']();};}function respondWithResult(_0x5ed2ae,_0x212002){_0x212002=_0x212002||0xc8;return function(_0x1b3a32){if(_0x1b3a32){return _0x5ed2ae[_0xb480('0x1d')](_0x212002)[_0xb480('0x1e')](_0x1b3a32);}};}function respondWithFilteredResult(_0x280528,_0x233db3){return function(_0x45fd46){if(_0x45fd46){var _0x4f5eda=typeof _0x233db3[_0xb480('0x1f')]==='undefined'&&typeof _0x233db3[_0xb480('0x20')]===_0xb480('0x21');var _0x1624e1=_0x45fd46[_0xb480('0x22')];var _0x101670=_0x4f5eda?0x0:_0x233db3[_0xb480('0x1f')];var _0x16588d=_0x4f5eda?_0x45fd46[_0xb480('0x22')]:_0x233db3[_0xb480('0x1f')]+_0x233db3[_0xb480('0x20')];var _0x3e002e;if(_0x16588d>=_0x1624e1){_0x16588d=_0x1624e1;_0x3e002e=0xc8;}else{_0x3e002e=0xce;}_0x280528[_0xb480('0x1d')](_0x3e002e);return _0x280528[_0xb480('0x23')]('Content-Range',_0x101670+'-'+_0x16588d+'/'+_0x1624e1)[_0xb480('0x1e')](_0x45fd46);}return null;};}function patchUpdates(_0x461ea4){return function(_0x3c97a7){try{jsonpatch[_0xb480('0x24')](_0x3c97a7,_0x461ea4,!![]);}catch(_0x2d543c){return BPromise[_0xb480('0x25')](_0x2d543c);}return _0x3c97a7[_0xb480('0x26')]();};}function saveUpdates(_0x1bd70c,_0x211457){return function(_0x4fdeb8){if(_0x4fdeb8){return _0x4fdeb8['update'](_0x1bd70c)[_0xb480('0x27')](function(_0x1976f9){return _0x1976f9;});}return null;};}function removeEntity(_0x5ecd71,_0xdd3d82){return function(_0x32fa21){if(_0x32fa21){return _0x32fa21[_0xb480('0x28')]()[_0xb480('0x27')](function(){var _0x549f81=_0x32fa21[_0xb480('0x29')]({'plain':!![]});var _0x1b7c13=_0xb480('0x2a');return db[_0xb480('0x2b')][_0xb480('0x28')]({'where':{'type':_0x1b7c13,'resourceId':_0x549f81['id']}})['then'](function(){return _0x32fa21;});})[_0xb480('0x27')](function(){_0x5ecd71[_0xb480('0x1d')](0xcc)[_0xb480('0x2c')]();});}};}function handleEntityNotFound(_0x167d13,_0x2d266e){return function(_0x411fef){if(!_0x411fef){_0x167d13[_0xb480('0x2d')](0x194);}return _0x411fef;};}function handleError(_0x8c2e2,_0x417a21){_0x417a21=_0x417a21||0x1f4;return function(_0x333db0){logger[_0xb480('0x2e')](_0x333db0[_0xb480('0x2f')]);if(_0x333db0[_0xb480('0x30')]){delete _0x333db0[_0xb480('0x30')];}_0x8c2e2[_0xb480('0x1d')](_0x417a21)[_0xb480('0x31')](_0x333db0);};}exports['index']=function(_0x4033ab,_0x273171){var _0x110b6c={},_0x4bf3e3={},_0x13c27c={'count':0x0,'rows':[]};var _0x8e92a=_['map'](db['CmList'][_0xb480('0x32')],function(_0x12520e){return{'name':_0x12520e[_0xb480('0x33')],'type':_0x12520e[_0xb480('0x34')][_0xb480('0x35')]};});_0x4bf3e3[_0xb480('0x36')]=_[_0xb480('0x37')](_0x8e92a,_0xb480('0x30'));_0x4bf3e3[_0xb480('0x38')]=_[_0xb480('0x39')](_0x4033ab['query']);_0x4bf3e3[_0xb480('0x3a')]=_['intersection'](_0x4bf3e3['model'],_0x4bf3e3[_0xb480('0x38')]);_0x110b6c[_0xb480('0x3b')]=_[_0xb480('0x3c')](_0x4bf3e3[_0xb480('0x36')],qs[_0xb480('0x3d')](_0x4033ab[_0xb480('0x38')][_0xb480('0x3d')]));_0x110b6c[_0xb480('0x3b')]=_0x110b6c['attributes']['length']?_0x110b6c[_0xb480('0x3b')]:_0x4bf3e3[_0xb480('0x36')];if(!_0x4033ab['query']['hasOwnProperty'](_0xb480('0x3e'))){_0x110b6c[_0xb480('0x20')]=qs[_0xb480('0x20')](_0x4033ab[_0xb480('0x38')][_0xb480('0x20')]);_0x110b6c[_0xb480('0x1f')]=qs[_0xb480('0x1f')](_0x4033ab[_0xb480('0x38')][_0xb480('0x1f')]);}_0x110b6c[_0xb480('0x3f')]=qs[_0xb480('0x40')](_0x4033ab[_0xb480('0x38')][_0xb480('0x40')]);_0x110b6c[_0xb480('0x41')]=qs[_0xb480('0x3a')](_['pick'](_0x4033ab[_0xb480('0x38')],_0x4bf3e3['filters']),_0x8e92a);if(_0x4033ab[_0xb480('0x38')][_0xb480('0x42')]){_0x110b6c[_0xb480('0x41')]=_[_0xb480('0x43')](_0x110b6c['where'],{'$or':_['map'](_0x8e92a,function(_0x1693d4){if(_0x1693d4[_0xb480('0x34')]!=='VIRTUAL'){var _0x44d37c={};_0x44d37c[_0x1693d4[_0xb480('0x30')]]={'$like':'%'+_0x4033ab['query'][_0xb480('0x42')]+'%'};return _0x44d37c;}})});}_0x110b6c=_[_0xb480('0x43')]({},_0x110b6c,_0x4033ab[_0xb480('0x44')]);var _0x144bcc={'where':_0x110b6c['where']};return db[_0xb480('0x45')][_0xb480('0x22')](_0x144bcc)[_0xb480('0x27')](function(_0x151a9d){_0x13c27c['count']=_0x151a9d;if(_0x4033ab[_0xb480('0x38')][_0xb480('0x46')]){_0x110b6c[_0xb480('0x47')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x110b6c);})[_0xb480('0x27')](function(_0xfdff2c){_0x13c27c[_0xb480('0x48')]=_0xfdff2c;return _0x13c27c;})['then'](respondWithFilteredResult(_0x273171,_0x110b6c))[_0xb480('0x49')](handleError(_0x273171,null));};exports['show']=function(_0x2bc238,_0x3e385b){var _0xda9a3c={'raw':![],'where':{'id':_0x2bc238['params']['id']}},_0xb1cd0d={};_0xb1cd0d[_0xb480('0x36')]=_[_0xb480('0x39')](db[_0xb480('0x45')]['rawAttributes']);_0xb1cd0d['query']=_[_0xb480('0x39')](_0x2bc238['query']);_0xb1cd0d[_0xb480('0x3a')]=_[_0xb480('0x3c')](_0xb1cd0d[_0xb480('0x36')],_0xb1cd0d['query']);_0xda9a3c[_0xb480('0x3b')]=_[_0xb480('0x3c')](_0xb1cd0d[_0xb480('0x36')],qs[_0xb480('0x3d')](_0x2bc238[_0xb480('0x38')][_0xb480('0x3d')]));_0xda9a3c[_0xb480('0x3b')]=_0xda9a3c[_0xb480('0x3b')][_0xb480('0x4a')]?_0xda9a3c[_0xb480('0x3b')]:_0xb1cd0d[_0xb480('0x36')];if(_0x2bc238[_0xb480('0x38')][_0xb480('0x46')]){_0xda9a3c[_0xb480('0x47')]=[{'all':!![]}];}_0xda9a3c=_[_0xb480('0x43')]({},_0xda9a3c,_0x2bc238['options']);return db[_0xb480('0x45')][_0xb480('0x4b')](_0xda9a3c)[_0xb480('0x27')](handleEntityNotFound(_0x3e385b,null))['then'](respondWithResult(_0x3e385b,null))[_0xb480('0x49')](handleError(_0x3e385b,null));};exports['create']=function(_0x1ea759,_0x162640){return db['CmList'][_0xb480('0x4c')](_0x1ea759[_0xb480('0x4d')],{})[_0xb480('0x27')](function(_0x38c221){var _0x1cc590=_0x1ea759[_0xb480('0x4e')][_0xb480('0x29')]({'plain':!![]});if(!_0x1cc590)throw new Error(_0xb480('0x4f'));if(_0x1cc590[_0xb480('0x50')]===_0xb480('0x4e')){var _0x19b993=_0x38c221['get']({'plain':!![]});var _0x20816f=_0xb480('0x2a');return db[_0xb480('0x51')][_0xb480('0x4b')]({'where':{'name':_0x20816f,'userProfileId':_0x1cc590['userProfileId']},'raw':!![]})[_0xb480('0x27')](function(_0x25f8d){if(_0x25f8d&&_0x25f8d['autoAssociation']===0x0){return db[_0xb480('0x2b')]['create']({'name':_0x19b993[_0xb480('0x30')],'resourceId':_0x19b993['id'],'type':_0x25f8d['name'],'sectionId':_0x25f8d['id']},{})[_0xb480('0x27')](function(){return _0x38c221;});}else{return _0x38c221;}})['catch'](function(_0x3460e7){logger[_0xb480('0x2e')](_0xb480('0x52'),_0x3460e7);throw _0x3460e7;});}return _0x38c221;})[_0xb480('0x27')](respondWithResult(_0x162640,0xc9))[_0xb480('0x49')](handleError(_0x162640,null));};exports[_0xb480('0x53')]=function(_0x1e14fc,_0x4e689e){if(_0x1e14fc[_0xb480('0x4d')]['id']){delete _0x1e14fc[_0xb480('0x4d')]['id'];}return db[_0xb480('0x45')][_0xb480('0x4b')]({'where':{'id':_0x1e14fc[_0xb480('0x54')]['id']}})['then'](handleEntityNotFound(_0x4e689e,null))[_0xb480('0x27')](saveUpdates(_0x1e14fc[_0xb480('0x4d')],null))['then'](respondWithResult(_0x4e689e,null))['catch'](handleError(_0x4e689e,null));};exports['destroy']=function(_0x574d0a,_0x38aba3){return db[_0xb480('0x45')][_0xb480('0x4b')]({'where':{'id':_0x574d0a[_0xb480('0x54')]['id']}})['then'](handleEntityNotFound(_0x38aba3,null))['then'](removeEntity(_0x38aba3,null))[_0xb480('0x49')](handleError(_0x38aba3,null));};exports[_0xb480('0x55')]=function(_0xaa8658,_0x4496b0){return db[_0xb480('0x45')][_0xb480('0x55')]()[_0xb480('0x27')](respondWithResult(_0x4496b0,null))[_0xb480('0x49')](handleError(_0x4496b0,null));};exports[_0xb480('0x56')]=function(_0x31e080,_0x55421e,_0x2a3583){if(_0x31e080[_0xb480('0x4d')]['id']){delete _0x31e080[_0xb480('0x4d')]['id'];}return db[_0xb480('0x45')][_0xb480('0x4b')]({'where':{'id':_0x31e080['params']['id']}})[_0xb480('0x27')](handleEntityNotFound(_0x55421e,null))['then'](function(_0x18b9a3){if(_0x18b9a3){_0x31e080[_0xb480('0x4d')][_0xb480('0x57')]=_0x18b9a3['id'];return db[_0xb480('0x58')][_0xb480('0x4c')](_0x31e080['body']);}})[_0xb480('0x27')](respondWithResult(_0x55421e,null))['catch'](handleError(_0x55421e,null));};exports[_0xb480('0x59')]=function(_0x336f9e,_0x5db667,_0x2975fe){var _0x3fc7bf={'raw':![],'where':{}};var _0x1dc1da={};var _0x99a6d2={'count':0x0,'rows':[]};return db[_0xb480('0x45')][_0xb480('0x5a')]({'where':{'id':_0x336f9e['params']['id']}})[_0xb480('0x27')](handleEntityNotFound(_0x5db667,null))[_0xb480('0x27')](function(_0x523b52){if(_0x523b52){_0x1dc1da[_0xb480('0x36')]=_[_0xb480('0x39')](db[_0xb480('0x58')][_0xb480('0x32')]);_0x1dc1da[_0xb480('0x38')]=_[_0xb480('0x39')](_0x336f9e[_0xb480('0x38')]);_0x1dc1da[_0xb480('0x3a')]=_[_0xb480('0x3c')](_0x1dc1da[_0xb480('0x36')],_0x1dc1da[_0xb480('0x38')]);_0x3fc7bf[_0xb480('0x3b')]=_[_0xb480('0x3c')](_0x1dc1da[_0xb480('0x36')],qs['fields'](_0x336f9e['query']['fields']));_0x3fc7bf[_0xb480('0x3b')]=_0x3fc7bf['attributes'][_0xb480('0x4a')]?_0x3fc7bf[_0xb480('0x3b')]:_0x1dc1da[_0xb480('0x36')];if(!_0x336f9e[_0xb480('0x38')][_0xb480('0x5b')](_0xb480('0x3e'))){_0x3fc7bf[_0xb480('0x20')]=qs[_0xb480('0x20')](_0x336f9e[_0xb480('0x38')][_0xb480('0x20')]);_0x3fc7bf['offset']=qs[_0xb480('0x1f')](_0x336f9e[_0xb480('0x38')][_0xb480('0x1f')]);}_0x3fc7bf[_0xb480('0x3f')]=qs[_0xb480('0x40')](_0x336f9e[_0xb480('0x38')][_0xb480('0x40')]);_0x3fc7bf[_0xb480('0x41')]=qs[_0xb480('0x3a')](_[_0xb480('0x5c')](_0x336f9e[_0xb480('0x38')],_0x1dc1da[_0xb480('0x3a')]));_0x3fc7bf['where']['ListId']=_0x523b52['id'];if(_0x336f9e['query'][_0xb480('0x42')]){_0x3fc7bf[_0xb480('0x41')]=_[_0xb480('0x43')](_0x3fc7bf[_0xb480('0x41')],{'$or':_[_0xb480('0x37')](_0x3fc7bf[_0xb480('0x3b')],function(_0x5ba953){var _0x4d0a0b={};_0x4d0a0b[_0x5ba953]={'$like':'%'+_0x336f9e[_0xb480('0x38')][_0xb480('0x42')]+'%'};return _0x4d0a0b;})});}_0x3fc7bf=_[_0xb480('0x43')]({},_0x3fc7bf,_0x336f9e[_0xb480('0x44')]);return db[_0xb480('0x58')]['count']({'where':_0x3fc7bf['where']})[_0xb480('0x27')](function(_0x48570c){_0x99a6d2['count']=_0x48570c;if(_0x336f9e[_0xb480('0x38')][_0xb480('0x46')]){_0x3fc7bf[_0xb480('0x47')]=[{'all':!![]}];}return db[_0xb480('0x58')][_0xb480('0x5d')](_0x3fc7bf);})[_0xb480('0x27')](function(_0x23e717){_0x99a6d2[_0xb480('0x48')]=_0x23e717;return _0x99a6d2;});}})[_0xb480('0x27')](respondWithFilteredResult(_0x5db667,_0x3fc7bf))[_0xb480('0x49')](handleError(_0x5db667,null));};exports[_0xb480('0x5e')]=function(_0x4ded7b,_0xdb02aa,_0x21a1f6){return db[_0xb480('0x45')][_0xb480('0x4b')]({'where':{'id':_0x4ded7b['params']['id']}})[_0xb480('0x27')](handleEntityNotFound(_0xdb02aa,null))['then'](function(_0xf8a24f){if(_0xf8a24f){return _0xf8a24f[_0xb480('0x5e')](_0x4ded7b['query'][_0xb480('0x5f')]);}})[_0xb480('0x27')](respondWithStatusCode(_0xdb02aa,null))[_0xb480('0x49')](handleError(_0xdb02aa,null));};exports[_0xb480('0x60')]=function(_0x4af4e6,_0x348213,_0x4aa1e5){return db[_0xb480('0x45')][_0xb480('0x4b')]({'where':{'id':_0x4af4e6['params']['id']}})[_0xb480('0x27')](handleEntityNotFound(_0x348213,null))[_0xb480('0x27')](function(_0x3e8487){if(_0x3e8487){var _0x253cc3=[];var _0x59460e={'success':[],'errors':[]};return db[_0xb480('0x61')][_0xb480('0x55')]()[_0xb480('0x27')](function(_0x18b567){if(_0x4af4e6['body'][_0xb480('0x62')]&&_[_0xb480('0x63')](_0x4af4e6[_0xb480('0x4d')][_0xb480('0x62')])){if(_0x4af4e6[_0xb480('0x4d')][_0xb480('0x62')][_0xb480('0x4a')]){_0x4af4e6['body'][_0xb480('0x62')]=_0x4af4e6[_0xb480('0x4d')]['tags'][_0xb480('0x64')](';')+';';}else{_0x4af4e6[_0xb480('0x4d')][_0xb480('0x62')]=null;}}else{_0x4af4e6[_0xb480('0x4d')][_0xb480('0x62')]=null;}if(_0x4af4e6[_0xb480('0x4d')]&&_['isArray'](_0x4af4e6[_0xb480('0x4d')])){for(var _0x370329=0x0;_0x370329<_0x4af4e6[_0xb480('0x4d')]['length'];_0x370329+=0x1){_0x4af4e6[_0xb480('0x4d')][_0x370329]['ListId']=_0x4af4e6['params']['id'];_0x253cc3[_0xb480('0x65')](_0x4af4e6[_0xb480('0x4d')][_0x370329]);}return BPromise[_0xb480('0x66')](_0x253cc3,function(_0x6cd259){return db[_0xb480('0x61')][_0xb480('0x4c')](_[_0xb480('0x67')](_0x6cd259,[_0xb480('0x5f'),'id'])||{},{'fields':_[_0xb480('0x39')](_0x18b567),'raw':!![]})['then'](function(_0x53163a){_0x59460e[_0xb480('0x68')]['push'](_0x53163a['dataValues']);})['catch'](function(_0xba03bd){_0x59460e[_0xb480('0x69')][_0xb480('0x65')]({'data':_0x6cd259,'error':_0xba03bd[_0xb480('0x6a')]});});})[_0xb480('0x27')](function(_0x5ca4a5){return _0x59460e;})['catch'](function(_0x2a8164){return _0x2a8164;});}else{_0x348213[_0xb480('0x1d')](0x190)[_0xb480('0x1e')]({'message':_0xb480('0x6b')});}});}})[_0xb480('0x27')](respondWithResult(_0x348213,null))[_0xb480('0x49')](handleError(_0x348213,null));};exports['getContacts']=function(_0x2012f5,_0x24e177,_0x56f51d){var _0x134e48;return db[_0xb480('0x45')][_0xb480('0x4b')]({'where':{'id':_0x2012f5[_0xb480('0x54')]['id']},'include':[{'model':db[_0xb480('0x6c')],'as':'CustomFields'}]})[_0xb480('0x27')](handleEntityNotFound(_0x24e177,null))['then'](function(_0x271410){if(_0x271410){_0x134e48=_0x271410;return db[_0xb480('0x61')][_0xb480('0x32')];}})[_0xb480('0x27')](function(_0x5c2d2b){if(_0x5c2d2b){var _0x8b2651={};var _0x3681b9={};_0x3681b9[_0xb480('0x36')]=_[_0xb480('0x6d')](_[_0xb480('0x39')](_0x5c2d2b),_['map'](_0x134e48[_0xb480('0x6e')],function(_0x4a97b2){return util['format'](_0xb480('0x6f'),_0x4a97b2['id']);}));_0x3681b9[_0xb480('0x38')]=_['keys'](_0x2012f5[_0xb480('0x38')]);_0x3681b9['filters']=_['intersection'](_0x3681b9['model'],_0x3681b9['query']);_0x8b2651[_0xb480('0x3b')]=_['intersection'](_0x3681b9[_0xb480('0x36')],qs[_0xb480('0x3d')](_0x2012f5[_0xb480('0x38')][_0xb480('0x3d')]));_0x8b2651[_0xb480('0x3b')]=_0x8b2651[_0xb480('0x3b')]['length']?_0x8b2651[_0xb480('0x3b')]:_0x3681b9[_0xb480('0x36')];if(!_0x2012f5['query'][_0xb480('0x5b')](_0xb480('0x3e'))){_0x8b2651[_0xb480('0x20')]=qs[_0xb480('0x20')](_0x2012f5['query'][_0xb480('0x20')]);_0x8b2651['offset']=qs[_0xb480('0x1f')](_0x2012f5['query'][_0xb480('0x1f')]);}_0x8b2651[_0xb480('0x3f')]=qs[_0xb480('0x40')](_0x2012f5[_0xb480('0x38')][_0xb480('0x40')]);_0x8b2651[_0xb480('0x41')]=qs[_0xb480('0x3a')](_[_0xb480('0x5c')](_0x2012f5['query'],_0x3681b9[_0xb480('0x3a')]));_0x8b2651[_0xb480('0x70')]=!![];if(_0x2012f5['query'][_0xb480('0x42')]){_0x8b2651[_0xb480('0x41')]=_[_0xb480('0x43')](_0x8b2651[_0xb480('0x41')],{'$or':_[_0xb480('0x37')](_0x8b2651[_0xb480('0x3b')],function(_0x10cfb2){var _0x512583={};_0x512583[_0x10cfb2]={'$like':'%'+_0x2012f5['query'][_0xb480('0x42')]+'%'};return _0x512583;})});}_0x8b2651=_['merge']({},_0x8b2651,_0x2012f5[_0xb480('0x44')]);return _0x134e48[_0xb480('0x71')](_0x8b2651);}})['then'](respondWithResult(_0x24e177,null))[_0xb480('0x49')](handleError(_0x24e177,null));};exports[_0xb480('0x72')]=function(_0x132323,_0x893575,_0x5bd219){var _0x3ebcf1;var _0x8a4f87;var _0x383cf1;var _0x513e83=_0x132323[_0xb480('0x54')]['id'];csv_results=[];return db['ContactItemType'][_0xb480('0x5d')]({'attributes':['id',_0xb480('0x30')],'raw':!![],'order':['OrderBy']})[_0xb480('0x27')](function(_0x47c867){_0x3ebcf1=_0x47c867;var _0x1e23d4=_[_0xb480('0x39')](db[_0xb480('0x61')][_0xb480('0x32')]);return db['CmCustomField'][_0xb480('0x5d')]({'raw':!![],'attributes':['id',_0xb480('0x73')]})[_0xb480('0x27')](function(_0x3512e2){_0x8a4f87=_0x3512e2;var _0x1bae66=squel['select']()[_0xb480('0x3d')](_0x1e23d4)[_0xb480('0x74')](_0xb480('0x75'),'c')[_0xb480('0x41')]('c.ListId\x20=\x20?',_0x513e83)[_0xb480('0x41')](_0xb480('0x76'))['distinct']();for(var _0x1368f6=0x0;_0x1368f6<_0x8a4f87[_0xb480('0x4a')];_0x1368f6++){_0x1bae66['field'](_0xb480('0x77')+_0x8a4f87[_0x1368f6]['id'],_0xb480('0x78')+_0x8a4f87[_0x1368f6]['alias']);}for(var _0x1368f6=0x0;_0x1368f6<_0x3ebcf1[_0xb480('0x4a')];_0x1368f6++){_0x1bae66[_0xb480('0x79')](squel['select']()[_0xb480('0x79')](_0xb480('0x7a'))[_0xb480('0x74')](_0xb480('0x7b'))[_0xb480('0x41')](_0xb480('0x7c'),_0x3ebcf1[_0x1368f6]['id'])[_0xb480('0x41')](_0xb480('0x7d')),_0xb480('0x7e')+_0x3ebcf1[_0x1368f6][_0xb480('0x30')]);_0x1bae66[_0xb480('0x79')](squel[_0xb480('0x7f')]()[_0xb480('0x79')](_0xb480('0x80'))[_0xb480('0x74')]('cm_contact_has_items')[_0xb480('0x41')]('ItemTypeId\x20=\x20?',_0x3ebcf1[_0x1368f6]['id'])['where'](_0xb480('0x7d')),_0xb480('0x81')+_0x3ebcf1[_0x1368f6][_0xb480('0x30')]);}var _0x3ce04f=[];_0x3ce04f[_0xb480('0x65')](_0x1bae66[_0xb480('0x82')]());BPromise['each'](_0x3ce04f,handleQuery)[_0xb480('0x27')](function(_0x359921){handleQuery(_0x1bae66[_0xb480('0x82')]());var _0x345789=csv_results[0x0];if(!_[_0xb480('0x83')](_0x345789)){var _0x4dfa2e=toCsv(_0x345789);var _0x3b6a29=Date[_0xb480('0x84')]();fs['writeFileSync'](util['format'](_0xb480('0x85'),_0x513e83,_0x3b6a29),_0x4dfa2e);_0x893575['setHeader'](_0xb480('0x86'),_0xb480('0x87')+util['format'](_0xb480('0x88'),_0x513e83,_0x3b6a29));_0x893575[_0xb480('0x89')]('Content-type','text/csv');return _0x893575[_0xb480('0x8a')](util[_0xb480('0x8b')]('/tmp/list_%d_%s.csv',_0x513e83,_0x3b6a29));}else{return _0x893575[_0xb480('0x2d')](0xcc);}});});});};exports[_0xb480('0x8c')]=function(_0x54b5b7,_0x2e0fe5,_0x4a85be){var _0x8351d1;delete _0x54b5b7[_0xb480('0x4d')]['id'];return db[_0xb480('0x45')][_0xb480('0x5a')]({'where':{'id':_0x54b5b7[_0xb480('0x54')]['id']}})[_0xb480('0x27')](handleEntityNotFound(_0x2e0fe5,null))[_0xb480('0x27')](function(_0x39f230){if(_0x39f230){return db[_0xb480('0x8d')][_0xb480('0x8e')](function(_0x53260e){return db[_0xb480('0x6c')][_0xb480('0x4c')](_0x54b5b7[_0xb480('0x4d')],{'transaction':_0x53260e})[_0xb480('0x27')](function(_0x84840b){_0x8351d1=_0x84840b;return _0x39f230['addCustomFields'](_0x84840b,{'transaction':_0x53260e});})['then'](function(){var _0x42607a={'type':db[_0xb480('0x8f')][_0xb480('0x90')],'transaction':_0x53260e};switch(_0x54b5b7[_0xb480('0x4d')][_0xb480('0x34')]){case _0xb480('0x91'):_0x42607a[_0xb480('0x34')]=db[_0xb480('0x8f')][_0xb480('0x90')];break;case'number':_0x42607a[_0xb480('0x34')]=db['Sequelize']['INTEGER'];break;case'switch':_0x42607a[_0xb480('0x34')]=db[_0xb480('0x8f')][_0xb480('0x92')];_0x42607a['defaultValue']=![];break;default:}return db[_0xb480('0x8d')][_0xb480('0x93')][_0xb480('0x94')]('cm_contacts',util[_0xb480('0x8b')](_0xb480('0x95'),_0x8351d1['id']),_0x42607a);})['then'](function(){return _0x8351d1;});});}})[_0xb480('0x27')](respondWithResult(_0x2e0fe5,null))[_0xb480('0x49')](handleError(_0x2e0fe5,null));};exports[_0xb480('0x96')]=function(_0x5a33b2,_0x18a2ef,_0xfbecb9){var _0x3d512d={};var _0x3707ad={};var _0x516cf7;var _0x5d39f4;return db['CmList']['findOne']({'where':{'id':_0x5a33b2[_0xb480('0x54')]['id']}})[_0xb480('0x27')](handleEntityNotFound(_0x18a2ef,null))[_0xb480('0x27')](function(_0x1050fc){if(_0x1050fc){_0x516cf7=_0x1050fc;_0x3707ad[_0xb480('0x36')]=_[_0xb480('0x39')](db['CmCustomField']['rawAttributes']);_0x3707ad[_0xb480('0x38')]=_[_0xb480('0x39')](_0x5a33b2[_0xb480('0x38')]);_0x3707ad[_0xb480('0x3a')]=_[_0xb480('0x3c')](_0x3707ad[_0xb480('0x36')],_0x3707ad[_0xb480('0x38')]);_0x3d512d['attributes']=_['intersection'](_0x3707ad[_0xb480('0x36')],qs[_0xb480('0x3d')](_0x5a33b2[_0xb480('0x38')]['fields']));_0x3d512d[_0xb480('0x3b')]=_0x3d512d[_0xb480('0x3b')][_0xb480('0x4a')]?_0x3d512d['attributes']:_0x3707ad[_0xb480('0x36')];_0x3d512d['order']=qs[_0xb480('0x40')](_0x5a33b2[_0xb480('0x38')][_0xb480('0x40')]);_0x3d512d['where']=qs[_0xb480('0x3a')](_['pick'](_0x5a33b2[_0xb480('0x38')],_0x3707ad['filters']));_0x3d512d['where']=_[_0xb480('0x43')](_0x3d512d[_0xb480('0x41')],{'$or':[{'ListId':_0x1050fc['id']},{'ListId':null}]});if(_0x5a33b2[_0xb480('0x38')][_0xb480('0x42')]){_0x3d512d['where']=_['merge'](_0x3d512d[_0xb480('0x41')],{'$or':_[_0xb480('0x37')](_0x3d512d[_0xb480('0x3b')],function(_0x23615a){var _0x2f166d={};_0x2f166d[_0x23615a]={'$like':'%'+_0x5a33b2[_0xb480('0x38')][_0xb480('0x42')]+'%'};return _0x2f166d;})});}_0x3d512d=_['merge']({},_0x3d512d,_0x5a33b2[_0xb480('0x44')]);return db['CmCustomField']['findAndCountAll'](_0x3d512d);}})[_0xb480('0x27')](respondWithResult(_0x18a2ef,null))[_0xb480('0x49')](handleError(_0x18a2ef,null));};exports[_0xb480('0x97')]=function(_0x4448cf,_0x3bb328){return db[_0xb480('0x6c')][_0xb480('0x98')]({'where':{'ListId':null}})[_0xb480('0x27')](handleEntityNotFound(_0x3bb328,null))['then'](function(_0x345708){return _0x345708;})[_0xb480('0x27')](respondWithResult(_0x3bb328,null))[_0xb480('0x49')](handleError(_0x3bb328,null));};exports['addAgents']=function(_0x1fec72,_0x563433,_0x10a226){return db[_0xb480('0x45')]['find']({'where':{'id':_0x1fec72[_0xb480('0x54')]['id']}})[_0xb480('0x27')](handleEntityNotFound(_0x563433,null))[_0xb480('0x27')](function(_0x43a819){if(_0x43a819){return _0x43a819['addAgents'](_0x1fec72['body'][_0xb480('0x5f')],_[_0xb480('0x67')](_0x1fec72[_0xb480('0x4d')],['ids','id'])||{})[_0xb480('0x99')](function(_0x56a6ad){for(var _0x165149=0x0;_0x165149<_0x1fec72[_0xb480('0x4d')][_0xb480('0x5f')]['length'];_0x165149+=0x1){socket[_0xb480('0x9a')](_0xb480('0x9b'),{'UserId':Number(_0x1fec72[_0xb480('0x4d')]['ids'][_0x165149]),'CmListId':Number(_0x1fec72['params']['id'])});}return _0x56a6ad;});}})[_0xb480('0x27')](respondWithResult(_0x563433,null))['catch'](handleError(_0x563433,null));};exports['removeAgents']=function(_0x2edf56,_0x130ff1,_0x21e095){return db[_0xb480('0x45')][_0xb480('0x4b')]({'where':{'id':_0x2edf56[_0xb480('0x54')]['id']}})['then'](handleEntityNotFound(_0x130ff1,null))[_0xb480('0x27')](function(_0x5b6c7c){if(_0x5b6c7c){return _0x5b6c7c[_0xb480('0x9c')](_0x2edf56[_0xb480('0x38')]['ids'])[_0xb480('0x27')](function(){if(_[_0xb480('0x63')](_0x2edf56[_0xb480('0x38')]['ids'])){for(var _0x1081e1=0x0;_0x1081e1<_0x2edf56[_0xb480('0x38')][_0xb480('0x5f')][_0xb480('0x4a')];_0x1081e1+=0x1){socket[_0xb480('0x9a')](_0xb480('0x9d'),{'UserId':Number(_0x2edf56['query']['ids'][_0x1081e1]),'CmListId':Number(_0x2edf56[_0xb480('0x54')]['id'])});}}else{socket[_0xb480('0x9a')](_0xb480('0x9d'),{'UserId':Number(_0x2edf56[_0xb480('0x38')][_0xb480('0x5f')]),'CmListId':Number(_0x2edf56[_0xb480('0x54')]['id'])});}});}})[_0xb480('0x27')](respondWithStatusCode(_0x130ff1,null))[_0xb480('0x49')](handleError(_0x130ff1,null));};exports[_0xb480('0x9e')]=function(_0x20a33a,_0x490b2e,_0x51b246){var _0x30855b={};var _0x5cfc99={};var _0x325d8d;var _0x2026a5;return db['CmList'][_0xb480('0x5a')]({'where':{'id':_0x20a33a['params']['id']}})[_0xb480('0x27')](handleEntityNotFound(_0x490b2e,null))[_0xb480('0x27')](function(_0x35c0ac){if(_0x35c0ac){_0x325d8d=_0x35c0ac;_0x5cfc99['model']=_['keys'](db[_0xb480('0x9f')][_0xb480('0x32')]);_0x5cfc99[_0xb480('0x38')]=_['keys'](_0x20a33a[_0xb480('0x38')]);_0x5cfc99[_0xb480('0x3a')]=_[_0xb480('0x3c')](_0x5cfc99['model'],_0x5cfc99[_0xb480('0x38')]);_0x30855b[_0xb480('0x3b')]=_[_0xb480('0x3c')](_0x5cfc99[_0xb480('0x36')],qs['fields'](_0x20a33a['query'][_0xb480('0x3d')]));_0x30855b[_0xb480('0x3b')]=_0x30855b['attributes'][_0xb480('0x4a')]?_0x30855b[_0xb480('0x3b')]:_0x5cfc99[_0xb480('0x36')];_0x30855b[_0xb480('0x3f')]=qs[_0xb480('0x40')](_0x20a33a[_0xb480('0x38')][_0xb480('0x40')]);_0x30855b[_0xb480('0x41')]=qs['filters'](_['pick'](_0x20a33a[_0xb480('0x38')],_0x5cfc99[_0xb480('0x3a')]));if(_0x20a33a['query'][_0xb480('0x42')]){_0x30855b[_0xb480('0x41')]=_[_0xb480('0x43')](_0x30855b[_0xb480('0x41')],{'$or':_['map'](_0x30855b[_0xb480('0x3b')],function(_0x5e1c28){var _0x4b534f={};_0x4b534f[_0x5e1c28]={'$like':'%'+_0x20a33a[_0xb480('0x38')][_0xb480('0x42')]+'%'};return _0x4b534f;})});}_0x30855b=_[_0xb480('0x43')]({},_0x30855b,_0x20a33a[_0xb480('0x44')]);return _0x325d8d[_0xb480('0x9e')](_0x30855b);}})[_0xb480('0x27')](function(_0x1fdac4){if(_0x1fdac4){_0x2026a5=_0x1fdac4[_0xb480('0x4a')];if(!_0x20a33a['query'][_0xb480('0x5b')]('nolimit')){_0x30855b[_0xb480('0x20')]=qs['limit'](_0x20a33a['query'][_0xb480('0x20')]);_0x30855b[_0xb480('0x1f')]=qs[_0xb480('0x1f')](_0x20a33a[_0xb480('0x38')][_0xb480('0x1f')]);}return _0x325d8d[_0xb480('0x9e')](_0x30855b);}})[_0xb480('0x27')](function(_0x45d4e2){if(_0x45d4e2){return _0x45d4e2?{'count':_0x2026a5,'rows':_0x45d4e2}:null;}})[_0xb480('0x27')](respondWithResult(_0x490b2e,null))[_0xb480('0x49')](handleError(_0x490b2e,null));};function handleQuery(_0x3b73eb){logger['info'](_0x3b73eb);return db[_0xb480('0x8d')][_0xb480('0x38')](_0x3b73eb)[_0xb480('0x99')](function(_0x3ec5b1){csv_results[_0xb480('0x65')](_0x3ec5b1);})[_0xb480('0x49')](function(_0x384597){logger['error'](_0x384597[_0xb480('0x6a')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 7b8d0dd..12e700c 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x24f571,_0x291e1b){_0x24f571=_0x24f571-0x0;var _0x1608aa=_0x326f[_0x24f571];return _0x1608aa;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3e74,0x175));var _0x43e7=function(_0x49dc9b,_0x5285ee){_0x49dc9b=_0x49dc9b-0x0;var _0x5427d8=_0x3e74[_0x49dc9b];return _0x5427d8;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 927622b..b92fd76 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 _0x4483=['define','CmList','cm_lists','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x5b9b16,_0x130bc5){var _0x3cb207=function(_0x4d46c3){while(--_0x4d46c3){_0x5b9b16['push'](_0x5b9b16['shift']());}};_0x3cb207(++_0x130bc5);}(_0x4483,0x1a3));var _0x3448=function(_0x33b642,_0x4eaf3e){_0x33b642=_0x33b642-0x0;var _0x3277d4=_0x4483[_0x33b642];return _0x3277d4;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var moment=require(_0x3448('0x3'));var BPromise=require(_0x3448('0x4'));var rp=require(_0x3448('0x5'));var fs=require('fs');var path=require(_0x3448('0x6'));var rimraf=require(_0x3448('0x7'));var config=require('../../config/environment');var attributes=require(_0x3448('0x8'));module[_0x3448('0x9')]=function(_0x1b05db,_0xd3606d){return _0x1b05db[_0x3448('0xa')](_0x3448('0xb'),attributes,{'tableName':_0x3448('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','../../config/logger','api'];(function(_0x408a46,_0x12aa83){var _0x2dfa20=function(_0x419b9d){while(--_0x419b9d){_0x408a46['push'](_0x408a46['shift']());}};_0x2dfa20(++_0x12aa83);}(_0x1339,0x1ed));var _0x9133=function(_0xbcf27,_0x1c65ff){_0xbcf27=_0xbcf27-0x0;var _0x230df6=_0x1339[_0xbcf27];return _0x230df6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./cmList.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('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 504bd33..68bb95c 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 _0xcc7b=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x4cfe02,_0x50d83a){var _0x34b0ad=function(_0x17ef0a){while(--_0x17ef0a){_0x4cfe02['push'](_0x4cfe02['shift']());}};_0x34b0ad(++_0x50d83a);}(_0xcc7b,0xb0));var _0xbcc7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcc7b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xbcc7('0x0'));var moment=require(_0xbcc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcc7('0x2'));var db=require(_0xbcc7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcc7('0x4'))('rpc');var config=require(_0xbcc7('0x5'));var jayson=require(_0xbcc7('0x6'));var client=jayson[_0xbcc7('0x7')][_0xbcc7('0x8')]({'port':0x232a});config[_0xbcc7('0x9')]=_[_0xbcc7('0xa')](config[_0xbcc7('0x9')],{'host':_0xbcc7('0xb'),'port':0x18eb});var socket=require(_0xbcc7('0xc'))(new Redis(config[_0xbcc7('0x9')]));require(_0xbcc7('0xd'))[_0xbcc7('0xe')](socket);function respondWithRpcPromise(_0x648d0a,_0x1ab482,_0x499c14){return new BPromise(function(_0x4b80c8,_0x5e8112){return client[_0xbcc7('0xf')](_0x648d0a,_0x499c14)[_0xbcc7('0x10')](function(_0x42d2e6){logger[_0xbcc7('0x11')](_0xbcc7('0x12'),_0x1ab482,_0xbcc7('0x13'));logger['debug'](_0xbcc7('0x14'),_0x1ab482,_0xbcc7('0x13'),JSON['stringify'](_0x42d2e6));if(_0x42d2e6[_0xbcc7('0x15')]){if(_0x42d2e6['error'][_0xbcc7('0x16')]===0x1f4){logger[_0xbcc7('0x15')]('CmList,\x20%s,\x20%s',_0x1ab482,_0x42d2e6['error']['message']);return _0x5e8112(_0x42d2e6[_0xbcc7('0x15')][_0xbcc7('0x17')]);}logger[_0xbcc7('0x15')](_0xbcc7('0x12'),_0x1ab482,_0x42d2e6[_0xbcc7('0x15')][_0xbcc7('0x17')]);return _0x4b80c8(_0x42d2e6[_0xbcc7('0x15')][_0xbcc7('0x17')]);}else{logger['info'](_0xbcc7('0x12'),_0x1ab482,_0xbcc7('0x13'));_0x4b80c8(_0x42d2e6[_0xbcc7('0x18')][_0xbcc7('0x17')]);}})[_0xbcc7('0x19')](function(_0x168446){logger['error']('CmList,\x20%s,\x20%s',_0x1ab482,_0x168446);_0x5e8112(_0x168446);});});} \ No newline at end of file +var _0x2b25=['lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','redis','localhost','socket.io-emitter','register','request','info','debug','request\x20sent','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch'];(function(_0x936f1f,_0x2eaf2f){var _0xb36ff7=function(_0x4877ac){while(--_0x4877ac){_0x936f1f['push'](_0x936f1f['shift']());}};_0xb36ff7(++_0x2eaf2f);}(_0x2b25,0x8a));var _0x52b2=function(_0x20259c,_0xe43fb2){_0x20259c=_0x20259c-0x0;var _0x4d988e=_0x2b25[_0x20259c];return _0x4d988e;};'use strict';var _=require(_0x52b2('0x0'));var util=require(_0x52b2('0x1'));var moment=require(_0x52b2('0x2'));var BPromise=require(_0x52b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52b2('0x4'));var db=require(_0x52b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x52b2('0x6'));var config=require('../../config/environment');var jayson=require(_0x52b2('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x52b2('0x8')]=_['defaults'](config[_0x52b2('0x8')],{'host':_0x52b2('0x9'),'port':0x18eb});var socket=require(_0x52b2('0xa'))(new Redis(config[_0x52b2('0x8')]));require('./cmList.socket')[_0x52b2('0xb')](socket);function respondWithRpcPromise(_0x392cdb,_0xd911ed,_0x41a89e){return new BPromise(function(_0x20a6d0,_0x3838e6){return client[_0x52b2('0xc')](_0x392cdb,_0x41a89e)['then'](function(_0x38e042){logger[_0x52b2('0xd')]('CmList,\x20%s,\x20%s',_0xd911ed,'request\x20sent');logger[_0x52b2('0xe')]('CmList,\x20%s,\x20%s,\x20%s',_0xd911ed,_0x52b2('0xf'),JSON[_0x52b2('0x10')](_0x38e042));if(_0x38e042[_0x52b2('0x11')]){if(_0x38e042[_0x52b2('0x11')][_0x52b2('0x12')]===0x1f4){logger['error'](_0x52b2('0x13'),_0xd911ed,_0x38e042[_0x52b2('0x11')][_0x52b2('0x14')]);return _0x3838e6(_0x38e042[_0x52b2('0x11')]['message']);}logger['error']('CmList,\x20%s,\x20%s',_0xd911ed,_0x38e042[_0x52b2('0x11')]['message']);return _0x20a6d0(_0x38e042[_0x52b2('0x11')][_0x52b2('0x14')]);}else{logger[_0x52b2('0xd')](_0x52b2('0x13'),_0xd911ed,_0x52b2('0xf'));_0x20a6d0(_0x38e042[_0x52b2('0x15')][_0x52b2('0x14')]);}})[_0x52b2('0x16')](function(_0x3a917f){logger['error']('CmList,\x20%s,\x20%s',_0xd911ed,_0x3a917f);_0x3838e6(_0x3a917f);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3520b76..63ef511 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 _0x46cf=['length','cmList:','./cmList.events','emit','register'];(function(_0x3aa321,_0x5bcde5){var _0x2bc5a5=function(_0xabb066){while(--_0xabb066){_0x3aa321['push'](_0x3aa321['shift']());}};_0x2bc5a5(++_0x5bcde5);}(_0x46cf,0x115));var _0xf46c=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x46cf[_0x4e7d25];return _0x526fe6;};'use strict';var CmListEvents=require(_0xf46c('0x0'));var events=['save','remove','update'];function createListener(_0x4f602d,_0x33bcc3){return function(_0x1b3b1e){_0x33bcc3[_0xf46c('0x1')](_0x4f602d,_0x1b3b1e);};}function removeListener(_0x32563f,_0x24479a){return function(){CmListEvents['removeListener'](_0x32563f,_0x24479a);};}exports[_0xf46c('0x2')]=function(_0x2c0259){for(var _0x333896=0x0,_0x4d0d6c=events[_0xf46c('0x3')];_0x333896<_0x4d0d6c;_0x333896++){var _0x3f2bcc=events[_0x333896];var _0x268435=createListener(_0xf46c('0x4')+_0x3f2bcc,_0x2c0259);CmListEvents['on'](_0x3f2bcc,_0x268435);}}; \ No newline at end of file +var _0x1b7a=['length','cmList:','./cmList.events','save','update','emit','register'];(function(_0x2b2cf5,_0x2cf1be){var _0x1d8f4a=function(_0x48ee6f){while(--_0x48ee6f){_0x2b2cf5['push'](_0x2b2cf5['shift']());}};_0x1d8f4a(++_0x2cf1be);}(_0x1b7a,0x136));var _0xa1b7=function(_0x5d582c,_0x5bf483){_0x5d582c=_0x5d582c-0x0;var _0x5853c8=_0x1b7a[_0x5d582c];return _0x5853c8;};'use strict';var CmListEvents=require(_0xa1b7('0x0'));var events=[_0xa1b7('0x1'),'remove',_0xa1b7('0x2')];function createListener(_0x52d46b,_0xf213ce){return function(_0x35bdea){_0xf213ce[_0xa1b7('0x3')](_0x52d46b,_0x35bdea);};}function removeListener(_0x1e3ec7,_0x23358c){return function(){CmListEvents['removeListener'](_0x1e3ec7,_0x23358c);};}exports[_0xa1b7('0x4')]=function(_0xd1543e){for(var _0x37e2ee=0x0,_0xbde2b1=events[_0xa1b7('0x5')];_0x37e2ee<_0xbde2b1;_0x37e2ee++){var _0x12889a=events[_0x37e2ee];var _0x555e08=createListener(_0xa1b7('0x6')+_0x12889a,_0xd1543e);CmListEvents['on'](_0x12889a,_0x555e08);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 6bcb845..84199d1 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 _0xd120=['/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','/:id/fields','put','delete','destroy','removeDispositions','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContactsCsv','getCustomFields'];(function(_0x5451bc,_0x55d036){var _0x2680b9=function(_0x3c29f8){while(--_0x3c29f8){_0x5451bc['push'](_0x5451bc['shift']());}};_0x2680b9(++_0x55d036);}(_0xd120,0x1b2));var _0x0d12=function(_0x3eb69b,_0x412e7c){_0x3eb69b=_0x3eb69b-0x0;var _0x20df78=_0xd120[_0x3eb69b];return _0x20df78;};'use strict';var multer=require(_0x0d12('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0d12('0x1'));var express=require(_0x0d12('0x2'));var router=express['Router']();var fs_extra=require(_0x0d12('0x3'));var auth=require(_0x0d12('0x4'));var interaction=require(_0x0d12('0x5'));var config=require(_0x0d12('0x6'));var controller=require(_0x0d12('0x7'));router['get']('/',auth[_0x0d12('0x8')](),controller[_0x0d12('0x9')]);router[_0x0d12('0xa')](_0x0d12('0xb'),auth[_0x0d12('0x8')](),controller[_0x0d12('0xc')]);router[_0x0d12('0xa')](_0x0d12('0xd'),auth['isAuthenticated'](),controller[_0x0d12('0xe')]);router['get'](_0x0d12('0xf'),auth[_0x0d12('0x8')](),controller[_0x0d12('0x10')]);router[_0x0d12('0xa')](_0x0d12('0x11'),auth[_0x0d12('0x8')](),controller[_0x0d12('0x12')]);router['get']('/:id/contacts',auth[_0x0d12('0x8')](),controller['getContacts']);router[_0x0d12('0xa')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x0d12('0x13')]);router[_0x0d12('0xa')]('/:id/fields',auth[_0x0d12('0x8')](),controller[_0x0d12('0x14')]);router[_0x0d12('0xa')](_0x0d12('0x15'),auth[_0x0d12('0x8')](),controller[_0x0d12('0x16')]);router[_0x0d12('0x17')]('/',auth[_0x0d12('0x8')](),controller[_0x0d12('0x18')]);router['post'](_0x0d12('0x11'),auth['isAuthenticated'](),controller[_0x0d12('0x19')]);router['post'](_0x0d12('0x1a'),auth[_0x0d12('0x8')](),controller[_0x0d12('0x1b')]);router[_0x0d12('0x17')](_0x0d12('0x1c'),auth[_0x0d12('0x8')](),controller['addCustomField']);router[_0x0d12('0x17')](_0x0d12('0x15'),auth[_0x0d12('0x8')](),controller['addAgents']);router[_0x0d12('0x1d')]('/:id',auth[_0x0d12('0x8')](),controller['update']);router[_0x0d12('0x1e')](_0x0d12('0xf'),auth[_0x0d12('0x8')](),controller[_0x0d12('0x1f')]);router[_0x0d12('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x0d12('0x20')]);router[_0x0d12('0x1e')]('/:id/users',auth[_0x0d12('0x8')](),controller[_0x0d12('0x21')]);module[_0x0d12('0x22')]=router; \ No newline at end of file +var _0x372a=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x372a,0x177));var _0xa372=function(_0x5e22d3,_0x1342e5){_0x5e22d3=_0x5e22d3-0x0;var _0x2e580d=_0x372a[_0x5e22d3];return _0x2e580d;};'use strict';var multer=require(_0xa372('0x0'));var util=require('util');var path=require(_0xa372('0x1'));var timeout=require(_0xa372('0x2'));var express=require(_0xa372('0x3'));var router=express[_0xa372('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa372('0x5'));var interaction=require(_0xa372('0x6'));var config=require(_0xa372('0x7'));var controller=require('./cmList.controller');router['get']('/',auth[_0xa372('0x8')](),controller['index']);router[_0xa372('0x9')](_0xa372('0xa'),auth[_0xa372('0x8')](),controller[_0xa372('0xb')]);router[_0xa372('0x9')](_0xa372('0xc'),auth[_0xa372('0x8')](),controller[_0xa372('0xd')]);router['get'](_0xa372('0xe'),auth['isAuthenticated'](),controller[_0xa372('0xf')]);router['get'](_0xa372('0x10'),auth[_0xa372('0x8')](),controller[_0xa372('0x11')]);router['get'](_0xa372('0x12'),auth[_0xa372('0x8')](),controller[_0xa372('0x13')]);router[_0xa372('0x9')](_0xa372('0x14'),auth['isAuthenticated'](),controller[_0xa372('0x15')]);router[_0xa372('0x9')](_0xa372('0x16'),auth[_0xa372('0x8')](),controller[_0xa372('0x17')]);router[_0xa372('0x9')](_0xa372('0x18'),auth[_0xa372('0x8')](),controller[_0xa372('0x19')]);router[_0xa372('0x1a')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/dispositions',auth[_0xa372('0x8')](),controller[_0xa372('0x1b')]);router[_0xa372('0x1a')](_0xa372('0x12'),auth[_0xa372('0x8')](),controller[_0xa372('0x1c')]);router[_0xa372('0x1a')](_0xa372('0x16'),auth[_0xa372('0x8')](),controller[_0xa372('0x1d')]);router[_0xa372('0x1a')](_0xa372('0x18'),auth[_0xa372('0x8')](),controller[_0xa372('0x1e')]);router[_0xa372('0x1f')](_0xa372('0xe'),auth[_0xa372('0x8')](),controller[_0xa372('0x20')]);router[_0xa372('0x21')]('/:id',auth[_0xa372('0x8')](),controller[_0xa372('0x22')]);router[_0xa372('0x21')](_0xa372('0x10'),auth[_0xa372('0x8')](),controller[_0xa372('0x23')]);router['delete'](_0xa372('0x18'),auth[_0xa372('0x8')](),controller[_0xa372('0x24')]);module[_0xa372('0x25')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index a840d1c..01beaae 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 _0xa0b9=['VIRTUAL','getDataValue','field','STRING'];(function(_0x15bb8a,_0x194b60){var _0x4d3680=function(_0x4c14d3){while(--_0x4c14d3){_0x15bb8a['push'](_0x15bb8a['shift']());}};_0x4d3680(++_0x194b60);}(_0xa0b9,0x190));var _0x9a0b=function(_0x5bf8b0,_0x5d8bc2){_0x5bf8b0=_0x5bf8b0-0x0;var _0xb75aff=_0xa0b9[_0x5bf8b0];return _0xb75aff;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9a0b('0x0')],'get':function(_0x37f6a9){return this[_0x9a0b('0x1')](_0x9a0b('0x2'));}},'field':{'type':Sequelize[_0x9a0b('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9a0b('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xf360=['field','STRING','sequelize','getDataValue'];(function(_0x4eba09,_0x29dd46){var _0x21ab50=function(_0xca9b09){while(--_0xca9b09){_0x4eba09['push'](_0x4eba09['shift']());}};_0x21ab50(++_0x29dd46);}(_0xf360,0x92));var _0x0f36=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf360[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x0f36('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x328de9){return this[_0x0f36('0x1')](_0x0f36('0x2'));}},'field':{'type':Sequelize[_0x0f36('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x0f36('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 215b1b8..0ec6bd8 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 _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x507409,_0x8b534e){var _0x55023b=function(_0x4e4c84){while(--_0x4e4c84){_0x507409['push'](_0x507409['shift']());}};_0x55023b(++_0x8b534e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +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(_0x4f1690,_0x2b24a4){var _0x4f9459=function(_0x7197f9){while(--_0x7197f9){_0x4f1690['push'](_0x4f1690['shift']());}};_0x4f9459(++_0x2b24a4);}(_0x7a54,0x106));var _0x47a5=function(_0x2a31a4,_0x54a80e){_0x2a31a4=_0x2a31a4-0x0;var _0x5a14a3=_0x7a54[_0x2a31a4];return _0x5a14a3;};'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 6f32a6c..7f40161 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 _0x3eb0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','define','Condition','util'];(function(_0x590766,_0x26a057){var _0x4e2f10=function(_0x5d96a4){while(--_0x5d96a4){_0x590766['push'](_0x590766['shift']());}};_0x4e2f10(++_0x26a057);}(_0x3eb0,0x1a3));var _0x03eb=function(_0x110808,_0x24eb2f){_0x110808=_0x110808-0x0;var _0x114008=_0x3eb0[_0x110808];return _0x114008;};'use strict';var _=require('lodash');var util=require(_0x03eb('0x0'));var logger=require(_0x03eb('0x1'))(_0x03eb('0x2'));var moment=require(_0x03eb('0x3'));var BPromise=require(_0x03eb('0x4'));var rp=require(_0x03eb('0x5'));var fs=require('fs');var path=require(_0x03eb('0x6'));var rimraf=require(_0x03eb('0x7'));var config=require(_0x03eb('0x8'));var attributes=require(_0x03eb('0x9'));module['exports']=function(_0x505c44,_0x3ad96c){return _0x505c44[_0x03eb('0xa')](_0x03eb('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec04=['lodash','api','moment','bluebird','path','../../config/environment','Condition','tools_conditions'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xec04,0x130));var _0x4ec0=function(_0x1274a0,_0x386950){_0x1274a0=_0x1274a0-0x0;var _0x88f9e=_0xec04[_0x1274a0];return _0x88f9e;};'use strict';var _=require(_0x4ec0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4ec0('0x1'));var moment=require(_0x4ec0('0x2'));var BPromise=require(_0x4ec0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ec0('0x4'));var rimraf=require('rimraf');var config=require(_0x4ec0('0x5'));var attributes=require('./condition.attributes');module['exports']=function(_0x1e25de,_0x167318){return _0x1e25de['define'](_0x4ec0('0x6'),attributes,{'tableName':_0x4ec0('0x7'),'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 037f059..b12fb56 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 _0x8229=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request\x20sent'];(function(_0x39b148,_0x37726e){var _0x17a5ef=function(_0x35a1c0){while(--_0x35a1c0){_0x39b148['push'](_0x39b148['shift']());}};_0x17a5ef(++_0x37726e);}(_0x8229,0x111));var _0x9822=function(_0x58db52,_0x495507){_0x58db52=_0x58db52-0x0;var _0x5bc0c6=_0x8229[_0x58db52];return _0x5bc0c6;};'use strict';var _=require(_0x9822('0x0'));var util=require('util');var moment=require(_0x9822('0x1'));var BPromise=require(_0x9822('0x2'));var rs=require(_0x9822('0x3'));var fs=require('fs');var Redis=require(_0x9822('0x4'));var db=require(_0x9822('0x5'))['db'];var utils=require(_0x9822('0x6'));var logger=require('../../config/logger')(_0x9822('0x7'));var config=require(_0x9822('0x8'));var jayson=require(_0x9822('0x9'));var client=jayson[_0x9822('0xa')][_0x9822('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44fdaa,_0x4c3e36,_0x48f6a7){return new BPromise(function(_0x317633,_0x28eda2){return client['request'](_0x44fdaa,_0x48f6a7)['then'](function(_0x19ea5b){logger['info']('Condition,\x20%s,\x20%s',_0x4c3e36,_0x9822('0xc'));logger['debug'](_0x9822('0xd'),_0x4c3e36,'request\x20sent',JSON[_0x9822('0xe')](_0x19ea5b));if(_0x19ea5b[_0x9822('0xf')]){if(_0x19ea5b['error'][_0x9822('0x10')]===0x1f4){logger['error'](_0x9822('0x11'),_0x4c3e36,_0x19ea5b[_0x9822('0xf')][_0x9822('0x12')]);return _0x28eda2(_0x19ea5b[_0x9822('0xf')]['message']);}logger[_0x9822('0xf')](_0x9822('0x11'),_0x4c3e36,_0x19ea5b[_0x9822('0xf')]['message']);return _0x317633(_0x19ea5b[_0x9822('0xf')][_0x9822('0x12')]);}else{logger[_0x9822('0x13')](_0x9822('0x11'),_0x4c3e36,'request\x20sent');_0x317633(_0x19ea5b[_0x9822('0x14')]['message']);}})[_0x9822('0x15')](function(_0x54bafa){logger[_0x9822('0xf')](_0x9822('0x11'),_0x4c3e36,_0x54bafa);_0x28eda2(_0x54bafa);});});} \ No newline at end of file +var _0x4fec=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fec,0x156));var _0xc4fe=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0x4fec[_0x16bb4b];return _0x8aeb84;};'use strict';var _=require(_0xc4fe('0x0'));var util=require(_0xc4fe('0x1'));var moment=require(_0xc4fe('0x2'));var BPromise=require(_0xc4fe('0x3'));var rs=require(_0xc4fe('0x4'));var fs=require('fs');var Redis=require(_0xc4fe('0x5'));var db=require(_0xc4fe('0x6'))['db'];var utils=require(_0xc4fe('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc4fe('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc4fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41b371,_0x1a392f,_0x817fed){return new BPromise(function(_0x18eeb8,_0x103410){return client[_0xc4fe('0xa')](_0x41b371,_0x817fed)[_0xc4fe('0xb')](function(_0x1c80ed){logger[_0xc4fe('0xc')]('Condition,\x20%s,\x20%s',_0x1a392f,_0xc4fe('0xd'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x1a392f,_0xc4fe('0xd'),JSON[_0xc4fe('0xe')](_0x1c80ed));if(_0x1c80ed[_0xc4fe('0xf')]){if(_0x1c80ed[_0xc4fe('0xf')][_0xc4fe('0x10')]===0x1f4){logger['error'](_0xc4fe('0x11'),_0x1a392f,_0x1c80ed[_0xc4fe('0xf')][_0xc4fe('0x12')]);return _0x103410(_0x1c80ed['error'][_0xc4fe('0x12')]);}logger['error'](_0xc4fe('0x11'),_0x1a392f,_0x1c80ed[_0xc4fe('0xf')]['message']);return _0x18eeb8(_0x1c80ed[_0xc4fe('0xf')]['message']);}else{logger[_0xc4fe('0xc')](_0xc4fe('0x11'),_0x1a392f,_0xc4fe('0xd'));_0x18eeb8(_0x1c80ed['result'][_0xc4fe('0x12')]);}})[_0xc4fe('0x13')](function(_0x141470){logger[_0xc4fe('0xf')](_0xc4fe('0x11'),_0x1a392f,_0x141470);_0x103410(_0x141470);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ca91a04..4eaeeb6 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 _0xd0cd=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','delete','isAuthenticated','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x565464,_0x38f10c){var _0x480534=function(_0x3ad05b){while(--_0x3ad05b){_0x565464['push'](_0x565464['shift']());}};_0x480534(++_0x38f10c);}(_0xd0cd,0xe7));var _0xdd0c=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0xd0cd[_0x51ed62];return _0x34aee3;};'use strict';var multer=require(_0xdd0c('0x0'));var util=require(_0xdd0c('0x1'));var path=require(_0xdd0c('0x2'));var timeout=require(_0xdd0c('0x3'));var express=require('express');var router=express[_0xdd0c('0x4')]();var fs_extra=require(_0xdd0c('0x5'));var auth=require(_0xdd0c('0x6'));var interaction=require(_0xdd0c('0x7'));var config=require(_0xdd0c('0x8'));var controller=require(_0xdd0c('0x9'));router[_0xdd0c('0xa')](_0xdd0c('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xdd0c('0xc')](_0xdd0c('0xb'),auth[_0xdd0c('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x648b=['./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service'];(function(_0x11ba4a,_0x1f86db){var _0x3ccd7d=function(_0x143694){while(--_0x143694){_0x11ba4a['push'](_0x11ba4a['shift']());}};_0x3ccd7d(++_0x1f86db);}(_0x648b,0x73));var _0xb648=function(_0x1abf69,_0xab2085){_0x1abf69=_0x1abf69-0x0;var _0x4843e2=_0x648b[_0x1abf69];return _0x4843e2;};'use strict';var multer=require(_0xb648('0x0'));var util=require(_0xb648('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb648('0x2')]();var fs_extra=require(_0xb648('0x3'));var auth=require(_0xb648('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb648('0x5'));router[_0xb648('0x6')](_0xb648('0x7'),auth[_0xb648('0x8')](),controller['update']);router[_0xb648('0x9')](_0xb648('0x7'),auth[_0xb648('0x8')](),controller[_0xb648('0xa')]);module[_0xb648('0xb')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index ba8465f..00958e3 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 _0x7109=['sequelize','exports','INTEGER','STRING'];(function(_0x19ba4d,_0xf21d0e){var _0x23d429=function(_0x4a5ebd){while(--_0x4a5ebd){_0x19ba4d['push'](_0x19ba4d['shift']());}};_0x23d429(++_0xf21d0e);}(_0x7109,0xd4));var _0x9710=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x7109[_0x1abb09];return _0xea1c07;};'use strict';var Sequelize=require(_0x9710('0x0'));module[_0x9710('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x9710('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x9710('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xbe85=['sequelize','exports','STRING','INTEGER'];(function(_0x4e1211,_0x3babe2){var _0x2ffc28=function(_0x4febf4){while(--_0x4febf4){_0x4e1211['push'](_0x4e1211['shift']());}};_0x2ffc28(++_0x3babe2);}(_0xbe85,0x19c));var _0x5be8=function(_0x85869f,_0x28a313){_0x85869f=_0x85869f-0x0;var _0x43b9a8=_0xbe85[_0x85869f];return _0x43b9a8;};'use strict';var Sequelize=require(_0x5be8('0x0'));module[_0x5be8('0x1')]={'name':{'type':Sequelize[_0x5be8('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x5be8('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x5be8('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 4d0f14f..071ff68 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 _0x5f66=['fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','filter','merge','options','ContactItemType','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','ContactItemTypes','UserProfileResource','name','send','index','map'];(function(_0x375805,_0xd75f6d){var _0x59248d=function(_0x4f5df7){while(--_0x4f5df7){_0x375805['push'](_0x375805['shift']());}};_0x59248d(++_0xd75f6d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){var _0x2774a1=_0x1eeaaa['get']({'plain':!![]});var _0x9d7bb0=_0x65f6('0x22');return db[_0x65f6('0x23')]['destroy']({'where':{'type':_0x9d7bb0,'resourceId':_0x2774a1['id']}})['then'](function(){return _0x1eeaaa;});})['then'](function(){_0xd173f4[_0x65f6('0x15')](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0x4b2292,_0x296cd9){return function(_0x28f710){if(!_0x28f710){_0x4b2292['sendStatus'](0x194);}return _0x28f710;};}function handleError(_0x325cb4,_0x2bff2b){_0x2bff2b=_0x2bff2b||0x1f4;return function(_0x28d0df){logger['error'](_0x28d0df['stack']);if(_0x28d0df['name']){delete _0x28d0df[_0x65f6('0x24')];}_0x325cb4[_0x65f6('0x15')](_0x2bff2b)[_0x65f6('0x25')](_0x28d0df);};}exports[_0x65f6('0x26')]=function(_0x518cac,_0x14a387){var _0x144e55={},_0x4ace4c={},_0x4ea23d={'count':0x0,'rows':[]};var _0x154cbd=_[_0x65f6('0x27')](db['ContactItemType']['rawAttributes'],function(_0x10b368){return{'name':_0x10b368[_0x65f6('0x28')],'type':_0x10b368[_0x65f6('0x29')][_0x65f6('0x2a')]};});_0x4ace4c[_0x65f6('0x2b')]=_[_0x65f6('0x27')](_0x154cbd,'name');_0x4ace4c[_0x65f6('0x2c')]=_[_0x65f6('0x2d')](_0x518cac[_0x65f6('0x2c')]);_0x4ace4c['filters']=_[_0x65f6('0x2e')](_0x4ace4c[_0x65f6('0x2b')],_0x4ace4c[_0x65f6('0x2c')]);_0x144e55[_0x65f6('0x2f')]=_[_0x65f6('0x2e')](_0x4ace4c[_0x65f6('0x2b')],qs['fields'](_0x518cac[_0x65f6('0x2c')][_0x65f6('0x30')]));_0x144e55['attributes']=_0x144e55[_0x65f6('0x2f')]['length']?_0x144e55[_0x65f6('0x2f')]:_0x4ace4c['model'];if(!_0x518cac[_0x65f6('0x2c')][_0x65f6('0x31')]('nolimit')){_0x144e55[_0x65f6('0x19')]=qs[_0x65f6('0x19')](_0x518cac[_0x65f6('0x2c')]['limit']);_0x144e55['offset']=qs[_0x65f6('0x1b')](_0x518cac['query'][_0x65f6('0x1b')]);}_0x144e55['order']=qs[_0x65f6('0x32')](_0x518cac[_0x65f6('0x2c')]['sort']);_0x144e55[_0x65f6('0x33')]=qs['filters'](_['pick'](_0x518cac[_0x65f6('0x2c')],_0x4ace4c[_0x65f6('0x34')]),_0x154cbd);if(_0x518cac[_0x65f6('0x2c')][_0x65f6('0x35')]){_0x144e55[_0x65f6('0x33')]=_[_0x65f6('0x36')](_0x144e55[_0x65f6('0x33')],{'$or':_[_0x65f6('0x27')](_0x154cbd,function(_0x4f933b){if(_0x4f933b[_0x65f6('0x29')]!=='VIRTUAL'){var _0x12a589={};_0x12a589[_0x4f933b[_0x65f6('0x24')]]={'$like':'%'+_0x518cac[_0x65f6('0x2c')][_0x65f6('0x35')]+'%'};return _0x12a589;}})});}_0x144e55=_['merge']({},_0x144e55,_0x518cac[_0x65f6('0x37')]);var _0x1d6421={'where':_0x144e55[_0x65f6('0x33')]};return db[_0x65f6('0x38')][_0x65f6('0x1a')](_0x1d6421)[_0x65f6('0x21')](function(_0xed4c96){_0x4ea23d[_0x65f6('0x1a')]=_0xed4c96;if(_0x518cac[_0x65f6('0x2c')]['includeAll']){_0x144e55[_0x65f6('0x39')]=[{'all':!![]}];}return db[_0x65f6('0x38')][_0x65f6('0x3a')](_0x144e55);})[_0x65f6('0x21')](function(_0x83e2d9){_0x4ea23d[_0x65f6('0x3b')]=_0x83e2d9;return _0x4ea23d;})[_0x65f6('0x21')](respondWithFilteredResult(_0x14a387,_0x144e55))[_0x65f6('0x3c')](handleError(_0x14a387,null));};exports[_0x65f6('0x3d')]=function(_0x2abbed,_0xcf19da){var _0x2c008a={'raw':!![],'where':{'id':_0x2abbed[_0x65f6('0x3e')]['id']}},_0x6c4d94={};_0x6c4d94[_0x65f6('0x2b')]=_[_0x65f6('0x2d')](db['ContactItemType'][_0x65f6('0x3f')]);_0x6c4d94[_0x65f6('0x2c')]=_[_0x65f6('0x2d')](_0x2abbed[_0x65f6('0x2c')]);_0x6c4d94['filters']=_[_0x65f6('0x2e')](_0x6c4d94[_0x65f6('0x2b')],_0x6c4d94[_0x65f6('0x2c')]);_0x2c008a['attributes']=_[_0x65f6('0x2e')](_0x6c4d94[_0x65f6('0x2b')],qs[_0x65f6('0x30')](_0x2abbed[_0x65f6('0x2c')]['fields']));_0x2c008a[_0x65f6('0x2f')]=_0x2c008a['attributes'][_0x65f6('0x40')]?_0x2c008a[_0x65f6('0x2f')]:_0x6c4d94['model'];if(_0x2abbed[_0x65f6('0x2c')]['includeAll']){_0x2c008a[_0x65f6('0x39')]=[{'all':!![]}];}_0x2c008a=_[_0x65f6('0x36')]({},_0x2c008a,_0x2abbed[_0x65f6('0x37')]);return db[_0x65f6('0x38')][_0x65f6('0x41')](_0x2c008a)[_0x65f6('0x21')](handleEntityNotFound(_0xcf19da,null))['then'](respondWithResult(_0xcf19da,null))['catch'](handleError(_0xcf19da,null));};exports[_0x65f6('0x42')]=function(_0x15d3ba,_0x3b647a){return db[_0x65f6('0x38')][_0x65f6('0x42')](_0x15d3ba[_0x65f6('0x43')],{})[_0x65f6('0x21')](function(_0x41690c){var _0x414f49=_0x15d3ba['user'][_0x65f6('0x44')]({'plain':!![]});if(!_0x414f49)throw new Error(_0x65f6('0x45'));if(_0x414f49[_0x65f6('0x46')]==='user'){var _0x47e749=_0x41690c[_0x65f6('0x44')]({'plain':!![]});var _0x49ba5a=_0x65f6('0x22');return db[_0x65f6('0x47')]['find']({'where':{'name':_0x49ba5a,'userProfileId':_0x414f49[_0x65f6('0x48')]},'raw':!![]})['then'](function(_0x247be3){if(_0x247be3&&_0x247be3[_0x65f6('0x49')]===0x0){return db[_0x65f6('0x23')]['create']({'name':_0x47e749[_0x65f6('0x24')],'resourceId':_0x47e749['id'],'type':_0x247be3[_0x65f6('0x24')],'sectionId':_0x247be3['id']},{})['then'](function(){return _0x41690c;});}else{return _0x41690c;}})[_0x65f6('0x3c')](function(_0x34312c){logger['error'](_0x65f6('0x4a'),_0x34312c);throw _0x34312c;});}return _0x41690c;})[_0x65f6('0x21')](respondWithResult(_0x3b647a,0xc9))[_0x65f6('0x3c')](handleError(_0x3b647a,null));};exports[_0x65f6('0x4b')]=function(_0x234fa7,_0x2350ca){if(_0x234fa7[_0x65f6('0x43')]['id']){delete _0x234fa7[_0x65f6('0x43')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x234fa7['params']['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x2350ca,null))[_0x65f6('0x21')](saveUpdates(_0x234fa7[_0x65f6('0x43')],null))[_0x65f6('0x21')](respondWithResult(_0x2350ca,null))['catch'](handleError(_0x2350ca,null));};exports[_0x65f6('0x20')]=function(_0x2032b9,_0x9ff849){return db['ContactItemType'][_0x65f6('0x41')]({'where':{'id':_0x2032b9[_0x65f6('0x3e')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x9ff849,null))['then'](db['CmContactHasItem'][_0x65f6('0x4b')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2032b9[_0x65f6('0x3e')]['id']}}))[_0x65f6('0x21')](removeEntity(_0x9ff849,null))[_0x65f6('0x3c')](handleError(_0x9ff849,null));}; \ No newline at end of file +var _0x9582=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','ContactItemType','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x9582,0x95));var _0x2958=function(_0xf50ae3,_0x1cec09){_0xf50ae3=_0xf50ae3-0x0;var _0x3cf318=_0x9582[_0xf50ae3];return _0x3cf318;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){var _0x1943af=_0xaf5547[_0x2958('0x27')]({'plain':!![]});var _0x4f811a='ContactItemTypes';return db[_0x2958('0x28')][_0x2958('0x26')]({'where':{'type':_0x4f811a,'resourceId':_0x1943af['id']}})[_0x2958('0x25')](function(){return _0xaf5547;});})[_0x2958('0x25')](function(){_0x330763['status'](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x57ae96,_0x402d97){return function(_0x40adce){if(!_0x40adce){_0x57ae96[_0x2958('0x19')](0x194);}return _0x40adce;};}function handleError(_0x4581d3,_0x23a566){_0x23a566=_0x23a566||0x1f4;return function(_0x36e2a5){logger[_0x2958('0x29')](_0x36e2a5['stack']);if(_0x36e2a5[_0x2958('0x2a')]){delete _0x36e2a5['name'];}_0x4581d3['status'](_0x23a566)[_0x2958('0x2b')](_0x36e2a5);};}exports[_0x2958('0x2c')]=function(_0x973486,_0x34e56e){var _0x584179={},_0x2d9472={},_0x222b83={'count':0x0,'rows':[]};var _0x2c73e9=_['map'](db[_0x2958('0x2d')][_0x2958('0x2e')],function(_0x5f34d4){return{'name':_0x5f34d4[_0x2958('0x2f')],'type':_0x5f34d4['type'][_0x2958('0x30')]};});_0x2d9472['model']=_[_0x2958('0x31')](_0x2c73e9,'name');_0x2d9472[_0x2958('0x32')]=_[_0x2958('0x33')](_0x973486[_0x2958('0x32')]);_0x2d9472[_0x2958('0x34')]=_[_0x2958('0x35')](_0x2d9472[_0x2958('0x36')],_0x2d9472[_0x2958('0x32')]);_0x584179[_0x2958('0x37')]=_[_0x2958('0x35')](_0x2d9472['model'],qs[_0x2958('0x38')](_0x973486['query'][_0x2958('0x38')]));_0x584179['attributes']=_0x584179[_0x2958('0x37')][_0x2958('0x39')]?_0x584179[_0x2958('0x37')]:_0x2d9472[_0x2958('0x36')];if(!_0x973486[_0x2958('0x32')][_0x2958('0x3a')](_0x2958('0x3b'))){_0x584179[_0x2958('0x1c')]=qs[_0x2958('0x1c')](_0x973486[_0x2958('0x32')][_0x2958('0x1c')]);_0x584179[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x973486['query'][_0x2958('0x1e')]);}_0x584179[_0x2958('0x3c')]=qs[_0x2958('0x3d')](_0x973486[_0x2958('0x32')]['sort']);_0x584179[_0x2958('0x3e')]=qs[_0x2958('0x34')](_[_0x2958('0x3f')](_0x973486[_0x2958('0x32')],_0x2d9472[_0x2958('0x34')]),_0x2c73e9);if(_0x973486[_0x2958('0x32')][_0x2958('0x40')]){_0x584179[_0x2958('0x3e')]=_[_0x2958('0x41')](_0x584179[_0x2958('0x3e')],{'$or':_[_0x2958('0x31')](_0x2c73e9,function(_0xb0398d){if(_0xb0398d[_0x2958('0x42')]!=='VIRTUAL'){var _0x7bec41={};_0x7bec41[_0xb0398d[_0x2958('0x2a')]]={'$like':'%'+_0x973486['query']['filter']+'%'};return _0x7bec41;}})});}_0x584179=_[_0x2958('0x41')]({},_0x584179,_0x973486[_0x2958('0x43')]);var _0xab188={'where':_0x584179[_0x2958('0x3e')]};return db[_0x2958('0x2d')][_0x2958('0x1f')](_0xab188)[_0x2958('0x25')](function(_0x13be6d){_0x222b83[_0x2958('0x1f')]=_0x13be6d;if(_0x973486[_0x2958('0x32')][_0x2958('0x44')]){_0x584179[_0x2958('0x45')]=[{'all':!![]}];}return db[_0x2958('0x2d')]['findAll'](_0x584179);})[_0x2958('0x25')](function(_0x112256){_0x222b83[_0x2958('0x46')]=_0x112256;return _0x222b83;})[_0x2958('0x25')](respondWithFilteredResult(_0x34e56e,_0x584179))['catch'](handleError(_0x34e56e,null));};exports[_0x2958('0x47')]=function(_0x4af190,_0x53ac56){var _0x38c785={'raw':!![],'where':{'id':_0x4af190[_0x2958('0x48')]['id']}},_0x35993f={};_0x35993f[_0x2958('0x36')]=_[_0x2958('0x33')](db[_0x2958('0x2d')]['rawAttributes']);_0x35993f[_0x2958('0x32')]=_['keys'](_0x4af190['query']);_0x35993f[_0x2958('0x34')]=_['intersection'](_0x35993f[_0x2958('0x36')],_0x35993f[_0x2958('0x32')]);_0x38c785[_0x2958('0x37')]=_[_0x2958('0x35')](_0x35993f[_0x2958('0x36')],qs[_0x2958('0x38')](_0x4af190[_0x2958('0x32')][_0x2958('0x38')]));_0x38c785['attributes']=_0x38c785[_0x2958('0x37')][_0x2958('0x39')]?_0x38c785[_0x2958('0x37')]:_0x35993f[_0x2958('0x36')];if(_0x4af190['query'][_0x2958('0x44')]){_0x38c785[_0x2958('0x45')]=[{'all':!![]}];}_0x38c785=_['merge']({},_0x38c785,_0x4af190[_0x2958('0x43')]);return db[_0x2958('0x2d')][_0x2958('0x49')](_0x38c785)[_0x2958('0x25')](handleEntityNotFound(_0x53ac56,null))[_0x2958('0x25')](respondWithResult(_0x53ac56,null))[_0x2958('0x4a')](handleError(_0x53ac56,null));};exports['create']=function(_0x1fff2a,_0x38b551){return db[_0x2958('0x2d')][_0x2958('0x4b')](_0x1fff2a[_0x2958('0x4c')],{})[_0x2958('0x25')](function(_0x1794c7){var _0xeabeaa=_0x1fff2a[_0x2958('0x4d')][_0x2958('0x27')]({'plain':!![]});if(!_0xeabeaa)throw new Error(_0x2958('0x4e'));if(_0xeabeaa[_0x2958('0x4f')]===_0x2958('0x4d')){var _0x3f7bc1=_0x1794c7[_0x2958('0x27')]({'plain':!![]});var _0xfce675=_0x2958('0x50');return db['UserProfileSection'][_0x2958('0x49')]({'where':{'name':_0xfce675,'userProfileId':_0xeabeaa['userProfileId']},'raw':!![]})[_0x2958('0x25')](function(_0x2816cd){if(_0x2816cd&&_0x2816cd[_0x2958('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x3f7bc1[_0x2958('0x2a')],'resourceId':_0x3f7bc1['id'],'type':_0x2816cd[_0x2958('0x2a')],'sectionId':_0x2816cd['id']},{})[_0x2958('0x25')](function(){return _0x1794c7;});}else{return _0x1794c7;}})['catch'](function(_0x524562){logger[_0x2958('0x29')](_0x2958('0x52'),_0x524562);throw _0x524562;});}return _0x1794c7;})[_0x2958('0x25')](respondWithResult(_0x38b551,0xc9))[_0x2958('0x4a')](handleError(_0x38b551,null));};exports[_0x2958('0x24')]=function(_0x3bdcb6,_0x34da27){if(_0x3bdcb6[_0x2958('0x4c')]['id']){delete _0x3bdcb6[_0x2958('0x4c')]['id'];}return db['ContactItemType'][_0x2958('0x49')]({'where':{'id':_0x3bdcb6[_0x2958('0x48')]['id']}})['then'](handleEntityNotFound(_0x34da27,null))[_0x2958('0x25')](saveUpdates(_0x3bdcb6[_0x2958('0x4c')],null))[_0x2958('0x25')](respondWithResult(_0x34da27,null))[_0x2958('0x4a')](handleError(_0x34da27,null));};exports[_0x2958('0x26')]=function(_0x16d927,_0x542df8){return db[_0x2958('0x2d')][_0x2958('0x49')]({'where':{'id':_0x16d927[_0x2958('0x48')]['id']}})['then'](handleEntityNotFound(_0x542df8,null))['then'](db[_0x2958('0x53')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x16d927[_0x2958('0x48')]['id']}}))['then'](removeEntity(_0x542df8,null))[_0x2958('0x4a')](handleError(_0x542df8,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 50abbe8..8e3bb0f 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 _0x7816=['bluebird','path','rimraf','./contactItemType.attributes','exports','ContactItemType','lodash','util','../../config/logger','api'];(function(_0x1e6afe,_0x5a43f9){var _0x5e2162=function(_0x9cc2f8){while(--_0x9cc2f8){_0x1e6afe['push'](_0x1e6afe['shift']());}};_0x5e2162(++_0x5a43f9);}(_0x7816,0x1be));var _0x6781=function(_0x4bf457,_0x14dcf4){_0x4bf457=_0x4bf457-0x0;var _0x232be2=_0x7816[_0x4bf457];return _0x232be2;};'use strict';var _=require(_0x6781('0x0'));var util=require(_0x6781('0x1'));var logger=require(_0x6781('0x2'))(_0x6781('0x3'));var moment=require('moment');var BPromise=require(_0x6781('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6781('0x5'));var rimraf=require(_0x6781('0x6'));var config=require('../../config/environment');var attributes=require(_0x6781('0x7'));module[_0x6781('0x8')]=function(_0x4a6bec,_0x32f43b){return _0x4a6bec['define'](_0x6781('0x9'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d79=['define','ContactItemType','tools_contact_item_types','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x80a57e,_0x292fc1){var _0x396eb4=function(_0x2a9dcc){while(--_0x2a9dcc){_0x80a57e['push'](_0x80a57e['shift']());}};_0x396eb4(++_0x292fc1);}(_0x2d79,0xd2));var _0x92d7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2d79[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x92d7('0x0'));var util=require(_0x92d7('0x1'));var logger=require('../../config/logger')(_0x92d7('0x2'));var moment=require('moment');var BPromise=require(_0x92d7('0x3'));var rp=require(_0x92d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92d7('0x5'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x5a8b47,_0x5ebba4){return _0x5a8b47[_0x92d7('0x6')](_0x92d7('0x7'),attributes,{'tableName':_0x92d7('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 d950506..5807f63 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 _0x1ff7=['../../config/environment','http','request','then','info','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ContactItemType,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x37eb5c,_0x477cc0){var _0x243e31=function(_0x2ebb5a){while(--_0x2ebb5a){_0x37eb5c['push'](_0x37eb5c['shift']());}};_0x243e31(++_0x477cc0);}(_0x1ff7,0x189));var _0x71ff=function(_0x23f705,_0x5530e9){_0x23f705=_0x23f705-0x0;var _0x3579b0=_0x1ff7[_0x23f705];return _0x3579b0;};'use strict';var _=require(_0x71ff('0x0'));var util=require(_0x71ff('0x1'));var moment=require('moment');var BPromise=require(_0x71ff('0x2'));var rs=require(_0x71ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71ff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x71ff('0x5'))(_0x71ff('0x6'));var config=require(_0x71ff('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x71ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ee9d8,_0x2c199a,_0x23357c){return new BPromise(function(_0x14a20a,_0x4ff037){return client[_0x71ff('0x9')](_0x5ee9d8,_0x23357c)[_0x71ff('0xa')](function(_0x5013d2){logger[_0x71ff('0xb')]('ContactItemType,\x20%s,\x20%s',_0x2c199a,'request\x20sent');logger['debug'](_0x71ff('0xc'),_0x2c199a,_0x71ff('0xd'),JSON[_0x71ff('0xe')](_0x5013d2));if(_0x5013d2['error']){if(_0x5013d2[_0x71ff('0xf')][_0x71ff('0x10')]===0x1f4){logger[_0x71ff('0xf')]('ContactItemType,\x20%s,\x20%s',_0x2c199a,_0x5013d2[_0x71ff('0xf')][_0x71ff('0x11')]);return _0x4ff037(_0x5013d2[_0x71ff('0xf')][_0x71ff('0x11')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x2c199a,_0x5013d2[_0x71ff('0xf')]['message']);return _0x14a20a(_0x5013d2[_0x71ff('0xf')][_0x71ff('0x11')]);}else{logger[_0x71ff('0xb')](_0x71ff('0x12'),_0x2c199a,_0x71ff('0xd'));_0x14a20a(_0x5013d2[_0x71ff('0x13')][_0x71ff('0x11')]);}})['catch'](function(_0x52df2a){logger['error'](_0x71ff('0x12'),_0x2c199a,_0x52df2a);_0x4ff037(_0x52df2a);});});} \ No newline at end of file +var _0x07bb=['message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x6fd582,_0x5c2d36){var _0x5875f9=function(_0x242fe2){while(--_0x242fe2){_0x6fd582['push'](_0x6fd582['shift']());}};_0x5875f9(++_0x5c2d36);}(_0x07bb,0xc9));var _0xb07b=function(_0x2f1e5b,_0x136a30){_0x2f1e5b=_0x2f1e5b-0x0;var _0x4a1898=_0x07bb[_0x2f1e5b];return _0x4a1898;};'use strict';var _=require(_0xb07b('0x0'));var util=require('util');var moment=require(_0xb07b('0x1'));var BPromise=require(_0xb07b('0x2'));var rs=require(_0xb07b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb07b('0x4'))['db'];var utils=require(_0xb07b('0x5'));var logger=require(_0xb07b('0x6'))(_0xb07b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb07b('0x8'));var client=jayson[_0xb07b('0x9')][_0xb07b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c02ed,_0x483e3f,_0x1bfed2){return new BPromise(function(_0x4b6ea8,_0x2f8657){return client[_0xb07b('0xb')](_0x2c02ed,_0x1bfed2)[_0xb07b('0xc')](function(_0x16123e){logger['info'](_0xb07b('0xd'),_0x483e3f,_0xb07b('0xe'));logger['debug'](_0xb07b('0xf'),_0x483e3f,_0xb07b('0xe'),JSON[_0xb07b('0x10')](_0x16123e));if(_0x16123e[_0xb07b('0x11')]){if(_0x16123e[_0xb07b('0x11')][_0xb07b('0x12')]===0x1f4){logger[_0xb07b('0x11')]('ContactItemType,\x20%s,\x20%s',_0x483e3f,_0x16123e[_0xb07b('0x11')][_0xb07b('0x13')]);return _0x2f8657(_0x16123e[_0xb07b('0x11')]['message']);}logger['error'](_0xb07b('0xd'),_0x483e3f,_0x16123e[_0xb07b('0x11')][_0xb07b('0x13')]);return _0x4b6ea8(_0x16123e[_0xb07b('0x11')][_0xb07b('0x13')]);}else{logger[_0xb07b('0x14')](_0xb07b('0xd'),_0x483e3f,'request\x20sent');_0x4b6ea8(_0x16123e['result']['message']);}})[_0xb07b('0x15')](function(_0x5522cc){logger['error'](_0xb07b('0xd'),_0x483e3f,_0x5522cc);_0x2f8657(_0x5522cc);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 2f62879..7661772 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 _0xf9dc=['fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','get','index','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3376dc,_0x13d29b){var _0x23579a=function(_0x275b59){while(--_0x275b59){_0x3376dc['push'](_0x3376dc['shift']());}};_0x23579a(++_0x13d29b);}(_0xf9dc,0x1ab));var _0xcf9d=function(_0x313532,_0x33e75f){_0x313532=_0x313532-0x0;var _0x44bc16=_0xf9dc[_0x313532];return _0x44bc16;};'use strict';var multer=require(_0xcf9d('0x0'));var util=require(_0xcf9d('0x1'));var path=require(_0xcf9d('0x2'));var timeout=require(_0xcf9d('0x3'));var express=require(_0xcf9d('0x4'));var router=express['Router']();var fs_extra=require(_0xcf9d('0x5'));var auth=require(_0xcf9d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf9d('0x7'));var controller=require(_0xcf9d('0x8'));router[_0xcf9d('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf9d('0xa')]);router[_0xcf9d('0x9')](_0xcf9d('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcf9d('0xc')](),controller['create']);router['put'](_0xcf9d('0xb'),auth[_0xcf9d('0xc')](),controller[_0xcf9d('0xd')]);router['delete'](_0xcf9d('0xb'),auth[_0xcf9d('0xc')](),controller[_0xcf9d('0xe')]);module[_0xcf9d('0xf')]=router; \ No newline at end of file +var _0xd65e=['fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x20ed2a,_0x52f547){var _0x3acdf1=function(_0x33d2f4){while(--_0x33d2f4){_0x20ed2a['push'](_0x20ed2a['shift']());}};_0x3acdf1(++_0x52f547);}(_0xd65e,0x163));var _0xed65=function(_0x404b4f,_0x3615fe){_0x404b4f=_0x404b4f-0x0;var _0x563ad2=_0xd65e[_0x404b4f];return _0x563ad2;};'use strict';var multer=require('multer');var util=require(_0xed65('0x0'));var path=require(_0xed65('0x1'));var timeout=require(_0xed65('0x2'));var express=require(_0xed65('0x3'));var router=express[_0xed65('0x4')]();var fs_extra=require(_0xed65('0x5'));var auth=require(_0xed65('0x6'));var interaction=require(_0xed65('0x7'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router['get']('/',auth[_0xed65('0x8')](),controller['index']);router[_0xed65('0x9')](_0xed65('0xa'),auth['isAuthenticated'](),controller[_0xed65('0xb')]);router[_0xed65('0xc')]('/',auth[_0xed65('0x8')](),controller[_0xed65('0xd')]);router[_0xed65('0xe')](_0xed65('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xed65('0xf')](_0xed65('0xa'),auth['isAuthenticated'](),controller[_0xed65('0x10')]);module[_0xed65('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index f7a81b4..9183dac 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 _0xb10b=['name','sequelize','STRING'];(function(_0x59993a,_0x56fb60){var _0xb091e9=function(_0x3ff8f4){while(--_0x3ff8f4){_0x59993a['push'](_0x59993a['shift']());}};_0xb091e9(++_0x56fb60);}(_0xb10b,0x12a));var _0xbb10=function(_0x360585,_0x2284ce){_0x360585=_0x360585-0x0;var _0x5371e4=_0xb10b[_0x360585];return _0x5371e4;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x16dbcd,_0x274516){var _0x34706e=function(_0x43433d){while(--_0x43433d){_0x16dbcd['push'](_0x16dbcd['shift']());}};_0x34706e(++_0x274516);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 2e342e6..340418b 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 _0xc745=['path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','Dashboard','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','error','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrSmsAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3aff6a,_0x4cf886){var _0x2c248f=function(_0x541743){while(--_0x541743){_0x3aff6a['push'](_0x3aff6a['shift']());}};_0x2c248f(++_0x4cf886);}(_0xc745,0x16d));var _0x5c74=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc745[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x5c74('0x0'));var rimraf=require(_0x5c74('0x1'));var zipdir=require(_0x5c74('0x2'));var jsonpatch=require(_0x5c74('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5c74('0x4'));var sox=require(_0x5c74('0x5'));var csv=require(_0x5c74('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c74('0x7'));var _=require('lodash');var squel=require(_0x5c74('0x8'));var crypto=require('crypto');var jsforce=require(_0x5c74('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5c74('0x6'));var querystring=require(_0x5c74('0xa'));var Papa=require(_0x5c74('0xb'));var Redis=require('ioredis');var authService=require(_0x5c74('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c74('0xd'));var logger=require(_0x5c74('0xe'))('api');var utils=require(_0x5c74('0xf'));var config=require(_0x5c74('0x10'));var licenseUtil=require(_0x5c74('0x11'));var db=require(_0x5c74('0x12'))['db'];config[_0x5c74('0x13')]=_['defaults'](config['redis'],{'host':_0x5c74('0x14'),'port':0x18eb});var socket=require(_0x5c74('0x15'))(new Redis(config[_0x5c74('0x13')]));require(_0x5c74('0x16'))[_0x5c74('0x17')](socket);function respondWithStatusCode(_0x4c382c,_0x28f43d){_0x28f43d=_0x28f43d||0xcc;return function(_0x33a646){if(_0x33a646){return _0x4c382c['sendStatus'](_0x28f43d);}return _0x4c382c[_0x5c74('0x18')](_0x28f43d)[_0x5c74('0x19')]();};}function respondWithResult(_0x4709af,_0x4cfb8f){_0x4cfb8f=_0x4cfb8f||0xc8;return function(_0x4a6c7d){if(_0x4a6c7d){return _0x4709af[_0x5c74('0x18')](_0x4cfb8f)[_0x5c74('0x1a')](_0x4a6c7d);}};}function respondWithFilteredResult(_0x17a417,_0x32482c){return function(_0x1115e8){if(_0x1115e8){var _0x3d837f=typeof _0x32482c['offset']===_0x5c74('0x1b')&&typeof _0x32482c['limit']===_0x5c74('0x1b');var _0x5bb47f=_0x1115e8[_0x5c74('0x1c')];var _0x138551=_0x3d837f?0x0:_0x32482c[_0x5c74('0x1d')];var _0xe133d=_0x3d837f?_0x1115e8[_0x5c74('0x1c')]:_0x32482c[_0x5c74('0x1d')]+_0x32482c[_0x5c74('0x1e')];var _0x387c23;if(_0xe133d>=_0x5bb47f){_0xe133d=_0x5bb47f;_0x387c23=0xc8;}else{_0x387c23=0xce;}_0x17a417[_0x5c74('0x18')](_0x387c23);return _0x17a417[_0x5c74('0x1f')](_0x5c74('0x20'),_0x138551+'-'+_0xe133d+'/'+_0x5bb47f)['json'](_0x1115e8);}return null;};}function patchUpdates(_0xe8ed78){return function(_0x212019){try{jsonpatch['apply'](_0x212019,_0xe8ed78,!![]);}catch(_0x7ec9b3){return BPromise['reject'](_0x7ec9b3);}return _0x212019[_0x5c74('0x21')]();};}function saveUpdates(_0x2fb873,_0x45f1f4){return function(_0x59e1ce){if(_0x59e1ce){return _0x59e1ce[_0x5c74('0x22')](_0x2fb873)[_0x5c74('0x23')](function(_0x1e25f6){return _0x1e25f6;});}return null;};}function removeEntity(_0x39ec37,_0x242d3d){return function(_0x3c200a){if(_0x3c200a){return _0x3c200a[_0x5c74('0x24')]()[_0x5c74('0x23')](function(){var _0xc90189=_0x3c200a[_0x5c74('0x25')]({'plain':!![]});var _0x29d2ef=_0x5c74('0x26');return db[_0x5c74('0x27')][_0x5c74('0x24')]({'where':{'type':_0x29d2ef,'resourceId':_0xc90189['id']}})[_0x5c74('0x23')](function(){return _0x3c200a;});})[_0x5c74('0x23')](function(){_0x39ec37['status'](0xcc)[_0x5c74('0x19')]();});}};}function handleEntityNotFound(_0x3ad1c2,_0x338bd8){return function(_0x145f96){if(!_0x145f96){_0x3ad1c2[_0x5c74('0x28')](0x194);}return _0x145f96;};}function handleError(_0x275063,_0x1d1e33){_0x1d1e33=_0x1d1e33||0x1f4;return function(_0x59e43){logger['error'](_0x59e43[_0x5c74('0x29')]);if(_0x59e43[_0x5c74('0x2a')]){delete _0x59e43[_0x5c74('0x2a')];}_0x275063['status'](_0x1d1e33)[_0x5c74('0x2b')](_0x59e43);};}exports[_0x5c74('0x2c')]=function(_0x584c4d,_0x366af0){var _0x3bf05a={},_0x27ee23={},_0x13df93={'count':0x0,'rows':[]};var _0x110831=_[_0x5c74('0x2d')](db['Dashboard'][_0x5c74('0x2e')],function(_0x5972d7){return{'name':_0x5972d7['fieldName'],'type':_0x5972d7[_0x5c74('0x2f')][_0x5c74('0x30')]};});_0x27ee23[_0x5c74('0x31')]=_[_0x5c74('0x2d')](_0x110831,_0x5c74('0x2a'));_0x27ee23[_0x5c74('0x32')]=_['keys'](_0x584c4d[_0x5c74('0x32')]);_0x27ee23[_0x5c74('0x33')]=_[_0x5c74('0x34')](_0x27ee23['model'],_0x27ee23[_0x5c74('0x32')]);_0x3bf05a[_0x5c74('0x35')]=_[_0x5c74('0x34')](_0x27ee23['model'],qs[_0x5c74('0x36')](_0x584c4d[_0x5c74('0x32')][_0x5c74('0x36')]));_0x3bf05a[_0x5c74('0x35')]=_0x3bf05a[_0x5c74('0x35')][_0x5c74('0x37')]?_0x3bf05a[_0x5c74('0x35')]:_0x27ee23['model'];if(!_0x584c4d['query'][_0x5c74('0x38')](_0x5c74('0x39'))){_0x3bf05a['limit']=qs['limit'](_0x584c4d['query'][_0x5c74('0x1e')]);_0x3bf05a[_0x5c74('0x1d')]=qs['offset'](_0x584c4d[_0x5c74('0x32')][_0x5c74('0x1d')]);}_0x3bf05a[_0x5c74('0x3a')]=qs[_0x5c74('0x3b')](_0x584c4d[_0x5c74('0x32')][_0x5c74('0x3b')]);_0x3bf05a[_0x5c74('0x3c')]=qs[_0x5c74('0x33')](_[_0x5c74('0x3d')](_0x584c4d['query'],_0x27ee23[_0x5c74('0x33')]),_0x110831);if(_0x584c4d[_0x5c74('0x32')][_0x5c74('0x3e')]){_0x3bf05a[_0x5c74('0x3c')]=_[_0x5c74('0x3f')](_0x3bf05a[_0x5c74('0x3c')],{'$or':_[_0x5c74('0x2d')](_0x110831,function(_0x55c212){if(_0x55c212[_0x5c74('0x2f')]!=='VIRTUAL'){var _0x207be5={};_0x207be5[_0x55c212[_0x5c74('0x2a')]]={'$like':'%'+_0x584c4d[_0x5c74('0x32')][_0x5c74('0x3e')]+'%'};return _0x207be5;}})});}_0x3bf05a=_['merge']({},_0x3bf05a,_0x584c4d['options']);var _0x4c32ea={'where':_0x3bf05a[_0x5c74('0x3c')]};return db['Dashboard'][_0x5c74('0x1c')](_0x4c32ea)['then'](function(_0x501a74){_0x13df93[_0x5c74('0x1c')]=_0x501a74;if(_0x584c4d[_0x5c74('0x32')][_0x5c74('0x40')]){_0x3bf05a[_0x5c74('0x41')]=[{'all':!![]}];}return db[_0x5c74('0x42')][_0x5c74('0x43')](_0x3bf05a);})[_0x5c74('0x23')](function(_0x492b42){_0x13df93[_0x5c74('0x44')]=_0x492b42;return _0x13df93;})['then'](respondWithFilteredResult(_0x366af0,_0x3bf05a))[_0x5c74('0x45')](handleError(_0x366af0,null));};exports[_0x5c74('0x46')]=function(_0x1dcfe9,_0x511c76){var _0x2e1f07={'raw':![],'where':{'id':_0x1dcfe9[_0x5c74('0x47')]['id']}},_0x5cdc69={};_0x5cdc69['model']=_['keys'](db[_0x5c74('0x42')][_0x5c74('0x2e')]);_0x5cdc69[_0x5c74('0x32')]=_[_0x5c74('0x48')](_0x1dcfe9[_0x5c74('0x32')]);_0x5cdc69[_0x5c74('0x33')]=_[_0x5c74('0x34')](_0x5cdc69[_0x5c74('0x31')],_0x5cdc69[_0x5c74('0x32')]);_0x2e1f07[_0x5c74('0x35')]=_[_0x5c74('0x34')](_0x5cdc69['model'],qs[_0x5c74('0x36')](_0x1dcfe9[_0x5c74('0x32')][_0x5c74('0x36')]));_0x2e1f07[_0x5c74('0x35')]=_0x2e1f07[_0x5c74('0x35')]['length']?_0x2e1f07['attributes']:_0x5cdc69[_0x5c74('0x31')];if(_0x1dcfe9[_0x5c74('0x32')][_0x5c74('0x40')]){_0x2e1f07[_0x5c74('0x41')]=[{'all':!![]}];}_0x2e1f07=_[_0x5c74('0x3f')]({},_0x2e1f07,_0x1dcfe9[_0x5c74('0x49')]);return db[_0x5c74('0x42')][_0x5c74('0x4a')](_0x2e1f07)['then'](handleEntityNotFound(_0x511c76,null))[_0x5c74('0x23')](respondWithResult(_0x511c76,null))[_0x5c74('0x45')](handleError(_0x511c76,null));};exports[_0x5c74('0x4b')]=function(_0x52dcac,_0x3be583){return db[_0x5c74('0x42')][_0x5c74('0x4b')](_0x52dcac[_0x5c74('0x4c')],{})['then'](function(_0x113dd5){var _0x13b8f1=_0x52dcac[_0x5c74('0x4d')][_0x5c74('0x25')]({'plain':!![]});if(!_0x13b8f1)throw new Error(_0x5c74('0x4e'));if(_0x13b8f1[_0x5c74('0x4f')]===_0x5c74('0x4d')){var _0x1b2685=_0x113dd5[_0x5c74('0x25')]({'plain':!![]});var _0x115880=_0x5c74('0x26');return db[_0x5c74('0x50')][_0x5c74('0x4a')]({'where':{'name':_0x115880,'userProfileId':_0x13b8f1['userProfileId']},'raw':!![]})[_0x5c74('0x23')](function(_0x120df4){if(_0x120df4&&_0x120df4[_0x5c74('0x51')]===0x0){return db[_0x5c74('0x27')][_0x5c74('0x4b')]({'name':_0x1b2685[_0x5c74('0x2a')],'resourceId':_0x1b2685['id'],'type':_0x120df4[_0x5c74('0x2a')],'sectionId':_0x120df4['id']},{})[_0x5c74('0x23')](function(){return _0x113dd5;});}else{return _0x113dd5;}})[_0x5c74('0x45')](function(_0x5af570){logger['error'](_0x5c74('0x52'),_0x5af570);throw _0x5af570;});}return _0x113dd5;})[_0x5c74('0x23')](respondWithResult(_0x3be583,0xc9))['catch'](handleError(_0x3be583,null));};exports[_0x5c74('0x53')]=function(_0x12cca1,_0x53bab7){var _0x2a176e={'where':{'id':_0x12cca1[_0x5c74('0x47')]['id']}},_0x3098b5={};_0x3098b5[_0x5c74('0x31')]=_[_0x5c74('0x48')](db[_0x5c74('0x42')][_0x5c74('0x2e')]);_0x2a176e[_0x5c74('0x35')]=_[_0x5c74('0x34')](_0x3098b5[_0x5c74('0x31')],qs[_0x5c74('0x36')](_0x12cca1['query'][_0x5c74('0x36')]));_0x2a176e[_0x5c74('0x35')]=_0x2a176e['attributes'][_0x5c74('0x37')]?_0x2a176e[_0x5c74('0x35')]:_0x3098b5['model'];if(_0x12cca1['query'][_0x5c74('0x40')]){_0x2a176e[_0x5c74('0x41')]=[{'all':!![]}];}_0x2a176e=_[_0x5c74('0x3f')]({},_0x2a176e,_0x12cca1[_0x5c74('0x49')]);return db['Dashboard'][_0x5c74('0x4a')](_0x2a176e)['then'](handleEntityNotFound(_0x53bab7,null))[_0x5c74('0x23')](function(_0x19265c){if(_0x19265c){var _0x12b0ee=_0x19265c[_0x5c74('0x25')]({'plain':!![]});_0x12b0ee=qs[_0x5c74('0x54')](_0x12b0ee,['id',_0x5c74('0x55'),_0x5c74('0x56')]);_0x12cca1[_0x5c74('0x4c')]=_[_0x5c74('0x54')](_0x12cca1[_0x5c74('0x4c')],['id','createdAt',_0x5c74('0x56')]);return db[_0x5c74('0x42')]['create'](_[_0x5c74('0x3f')](_0x12b0ee,_0x12cca1[_0x5c74('0x4c')]),{'include':_0x12cca1['query'][_0x5c74('0x40')]?[{'all':!![]}]:undefined})[_0x5c74('0x23')](function(_0x2e5092){var _0x3d88c3=_0x12cca1[_0x5c74('0x4d')][_0x5c74('0x25')]({'plain':!![]});if(!_0x3d88c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d88c3[_0x5c74('0x4f')]===_0x5c74('0x4d')){var _0x46ba0f=_0x2e5092['get']({'plain':!![]});var _0x432a6a='CustomDashboards';return db[_0x5c74('0x50')]['find']({'where':{'name':_0x432a6a,'userProfileId':_0x3d88c3[_0x5c74('0x57')]},'raw':!![]})[_0x5c74('0x23')](function(_0x4c332b){if(_0x4c332b&&_0x4c332b['autoAssociation']===0x0){return db[_0x5c74('0x27')][_0x5c74('0x4b')]({'name':_0x46ba0f[_0x5c74('0x2a')],'resourceId':_0x46ba0f['id'],'type':_0x4c332b['name'],'sectionId':_0x4c332b['id']},{})['then'](function(){return _0x2e5092;});}else{return _0x2e5092;}})[_0x5c74('0x45')](function(_0x3db8ec){logger[_0x5c74('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3db8ec);throw _0x3db8ec;});}return _0x2e5092;});}})['then'](respondWithResult(_0x53bab7,0xc9))['catch'](handleError(_0x53bab7,null));};exports[_0x5c74('0x22')]=function(_0x347d6f,_0xd0249d){if(_0x347d6f['body']['id']){delete _0x347d6f['body']['id'];}return db[_0x5c74('0x42')][_0x5c74('0x4a')]({'where':{'id':_0x347d6f[_0x5c74('0x47')]['id']}})[_0x5c74('0x23')](handleEntityNotFound(_0xd0249d,null))[_0x5c74('0x23')](saveUpdates(_0x347d6f[_0x5c74('0x4c')],null))['then'](respondWithResult(_0xd0249d,null))[_0x5c74('0x45')](handleError(_0xd0249d,null));};exports[_0x5c74('0x24')]=function(_0x41ab8c,_0x3d8140){return db[_0x5c74('0x42')][_0x5c74('0x4a')]({'where':{'id':_0x41ab8c['params']['id']}})[_0x5c74('0x23')](handleEntityNotFound(_0x3d8140,null))[_0x5c74('0x23')](removeEntity(_0x3d8140,null))[_0x5c74('0x45')](handleError(_0x3d8140,null));};function widgetAttributes(_0x1a8390){try{switch(_0x1a8390[_0x5c74('0x2f')]){case'iframe':return[{'name':_0x5c74('0x59'),'value':_0x1a8390['attrUrl']||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x0]?_0x1a8390[_0x5c74('0x5a')][0x0][_0x5c74('0x5b')]:undefined)||_0x5c74('0x5c')}];case _0x5c74('0x5d'):return[{'name':_0x5c74('0x5e'),'value':_0x1a8390[_0x5c74('0x5e')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x0]?_0x1a8390['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x5c74('0x5f'),'value':_0x1a8390[_0x5c74('0x5f')]||(_0x1a8390['attrs']&&_0x1a8390[_0x5c74('0x5a')][0x0]?_0x1a8390[_0x5c74('0x5a')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x5c74('0x60'),'value':_0x1a8390[_0x5c74('0x60')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x1]?_0x1a8390[_0x5c74('0x5a')][0x1][_0x5c74('0x5b')]:undefined)||_0x5c74('0x61')},{'name':_0x5c74('0x62'),'value':_0x1a8390[_0x5c74('0x62')]||(_0x1a8390['attrs']&&_0x1a8390[_0x5c74('0x5a')][0x2]?_0x1a8390['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x5c74('0x63'),'value':_0x1a8390[_0x5c74('0x63')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x0]?_0x1a8390[_0x5c74('0x5a')][0x0][_0x5c74('0x5b')]:undefined)||_0x5c74('0x64')},{'name':_0x5c74('0x65'),'value':_0x1a8390[_0x5c74('0x65')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x1]?_0x1a8390[_0x5c74('0x5a')][0x1]['value']:undefined)||[]},{'name':_0x5c74('0x62'),'value':_0x1a8390[_0x5c74('0x62')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x2]?_0x1a8390['attrs'][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x1a8390['attrChannel']||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x3]?_0x1a8390[_0x5c74('0x5a')][0x3][_0x5c74('0x5b')]:undefined)||_0x5c74('0x66')},{'name':_0x5c74('0x67'),'value':_0x1a8390[_0x5c74('0x67')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x4]?_0x1a8390[_0x5c74('0x5a')][0x4][_0x5c74('0x5b')]:undefined)||''},{'name':_0x5c74('0x68'),'value':_0x1a8390[_0x5c74('0x68')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x5]?_0x1a8390['attrs'][0x5][_0x5c74('0x5b')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1a8390['attrSmsAccounts']||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x6]?_0x1a8390[_0x5c74('0x5a')][0x6][_0x5c74('0x5b')]:undefined)||''},{'name':_0x5c74('0x69'),'value':_0x1a8390[_0x5c74('0x69')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x7]?_0x1a8390[_0x5c74('0x5a')][0x7][_0x5c74('0x5b')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1a8390[_0x5c74('0x6a')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x8]?_0x1a8390[_0x5c74('0x5a')][0x8][_0x5c74('0x5b')]:undefined)||''},{'name':_0x5c74('0x6b'),'value':_0x1a8390[_0x5c74('0x6b')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x9]?_0x1a8390[_0x5c74('0x5a')][0x9][_0x5c74('0x5b')]:undefined)||''}];case'multibar-chart':case _0x5c74('0x6c'):return[{'name':'attrSerie1','value':_0x1a8390[_0x5c74('0x6d')]||(_0x1a8390['attrs']&&_0x1a8390[_0x5c74('0x5a')][0x0]?_0x1a8390[_0x5c74('0x5a')][0x0][_0x5c74('0x5b')]:undefined)||_0x5c74('0x64')},{'name':'attrSerie2','value':_0x1a8390[_0x5c74('0x6e')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x1]?_0x1a8390['attrs'][0x1][_0x5c74('0x5b')]:undefined)||null},{'name':'attrSerie3','value':_0x1a8390[_0x5c74('0x6f')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x2]?_0x1a8390[_0x5c74('0x5a')][0x2]['value']:undefined)||null},{'name':_0x5c74('0x65'),'value':_0x1a8390[_0x5c74('0x65')]||(_0x1a8390['attrs']&&_0x1a8390[_0x5c74('0x5a')][0x3]?_0x1a8390[_0x5c74('0x5a')][0x3]['value']:undefined)||[]},{'name':_0x5c74('0x70'),'value':_0x1a8390[_0x5c74('0x70')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x4]?_0x1a8390[_0x5c74('0x5a')][0x4][_0x5c74('0x5b')]:undefined)||_0x5c74('0x66')},{'name':_0x5c74('0x67'),'value':_0x1a8390[_0x5c74('0x67')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x5]?_0x1a8390[_0x5c74('0x5a')][0x5][_0x5c74('0x5b')]:undefined)||''},{'name':_0x5c74('0x68'),'value':_0x1a8390[_0x5c74('0x68')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x6]?_0x1a8390[_0x5c74('0x5a')][0x6][_0x5c74('0x5b')]:undefined)||''},{'name':_0x5c74('0x71'),'value':_0x1a8390[_0x5c74('0x71')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390['attrs'][0x7]?_0x1a8390[_0x5c74('0x5a')][0x7][_0x5c74('0x5b')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1a8390[_0x5c74('0x69')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x8]?_0x1a8390[_0x5c74('0x5a')][0x8]['value']:undefined)||''},{'name':_0x5c74('0x6a'),'value':_0x1a8390[_0x5c74('0x6a')]||(_0x1a8390['attrs']&&_0x1a8390[_0x5c74('0x5a')][0x9]?_0x1a8390[_0x5c74('0x5a')][0x9]['value']:undefined)||''},{'name':_0x5c74('0x6b'),'value':_0x1a8390[_0x5c74('0x6b')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0xa]?_0x1a8390[_0x5c74('0x5a')][0xa][_0x5c74('0x5b')]:undefined)||''}];case _0x5c74('0x72'):return[{'name':_0x5c74('0x73'),'type':_0x1a8390['reportType']||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x0]?_0x1a8390[_0x5c74('0x5a')][0x0][_0x5c74('0x2f')]:undefined)||null,'value':_0x1a8390[_0x5c74('0x73')]||(_0x1a8390['attrs']&&_0x1a8390[_0x5c74('0x5a')][0x0]?_0x1a8390[_0x5c74('0x5a')][0x0][_0x5c74('0x5b')]:undefined)||null},{'name':_0x5c74('0x74'),'value':_0x1a8390[_0x5c74('0x74')]||(_0x1a8390[_0x5c74('0x5a')]&&_0x1a8390[_0x5c74('0x5a')][0x1]?_0x1a8390['attrs'][0x1][_0x5c74('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x55e013){logger[_0x5c74('0x58')](_0x5c74('0x75'),JSON[_0x5c74('0x76')](_0x55e013));return[];}}exports['addItem']=function(_0x19cdc4,_0x12b8f2,_0x15741b){if(_0x19cdc4[_0x5c74('0x4c')]['id']){delete _0x19cdc4[_0x5c74('0x4c')]['id'];}return db[_0x5c74('0x42')]['find']({'where':{'id':_0x19cdc4[_0x5c74('0x47')]['id']}})[_0x5c74('0x23')](handleEntityNotFound(_0x12b8f2,null))[_0x5c74('0x23')](function(_0x1b3694){if(_0x1b3694){_0x19cdc4[_0x5c74('0x4c')][_0x5c74('0x77')]=_0x1b3694['id'];_0x19cdc4[_0x5c74('0x4c')][_0x5c74('0x5a')]=widgetAttributes(_0x19cdc4[_0x5c74('0x4c')]);return db[_0x5c74('0x78')][_0x5c74('0x4b')](_0x19cdc4[_0x5c74('0x4c')]);}})[_0x5c74('0x23')](respondWithResult(_0x12b8f2,null))['catch'](handleError(_0x12b8f2,null));};exports[_0x5c74('0x79')]=function(_0x584b1a,_0x292672,_0xc68f71){var _0x3087c3={};var _0x34e2a7={};var _0x20bd69;var _0x111e86;return db[_0x5c74('0x42')][_0x5c74('0x7a')]({'where':{'id':_0x584b1a[_0x5c74('0x47')]['id']}})[_0x5c74('0x23')](handleEntityNotFound(_0x292672,null))[_0x5c74('0x23')](function(_0x14d729){if(_0x14d729){_0x20bd69=_0x14d729;_0x34e2a7[_0x5c74('0x31')]=_[_0x5c74('0x48')](db[_0x5c74('0x78')][_0x5c74('0x2e')]);_0x34e2a7[_0x5c74('0x32')]=_[_0x5c74('0x48')](_0x584b1a['query']);_0x34e2a7[_0x5c74('0x33')]=_[_0x5c74('0x34')](_0x34e2a7['model'],_0x34e2a7[_0x5c74('0x32')]);_0x3087c3['attributes']=_[_0x5c74('0x34')](_0x34e2a7[_0x5c74('0x31')],qs[_0x5c74('0x36')](_0x584b1a[_0x5c74('0x32')][_0x5c74('0x36')]));_0x3087c3[_0x5c74('0x35')]=_0x3087c3[_0x5c74('0x35')][_0x5c74('0x37')]?_0x3087c3[_0x5c74('0x35')]:_0x34e2a7['model'];_0x3087c3[_0x5c74('0x3a')]=qs[_0x5c74('0x3b')](_0x584b1a[_0x5c74('0x32')]['sort']);_0x3087c3['where']=qs[_0x5c74('0x33')](_[_0x5c74('0x3d')](_0x584b1a[_0x5c74('0x32')],_0x34e2a7[_0x5c74('0x33')]));if(_0x584b1a[_0x5c74('0x32')][_0x5c74('0x3e')]){_0x3087c3['where']=_[_0x5c74('0x3f')](_0x3087c3['where'],{'$or':_['map'](_0x3087c3[_0x5c74('0x35')],function(_0x24aecb){var _0x358945={};_0x358945[_0x24aecb]={'$like':'%'+_0x584b1a[_0x5c74('0x32')]['filter']+'%'};return _0x358945;})});}_0x3087c3=_[_0x5c74('0x3f')]({},_0x3087c3,_0x584b1a[_0x5c74('0x49')]);return _0x20bd69['getItems'](_0x3087c3);}})[_0x5c74('0x23')](function(_0x2307a3){if(_0x2307a3){_0x111e86=_0x2307a3['length'];if(!_0x584b1a['query'][_0x5c74('0x38')](_0x5c74('0x39'))){_0x3087c3[_0x5c74('0x1e')]=qs[_0x5c74('0x1e')](_0x584b1a[_0x5c74('0x32')][_0x5c74('0x1e')]);_0x3087c3[_0x5c74('0x1d')]=qs['offset'](_0x584b1a[_0x5c74('0x32')][_0x5c74('0x1d')]);}return _0x20bd69[_0x5c74('0x79')](_0x3087c3);}})['then'](function(_0x4a269f){if(_0x4a269f){return _0x4a269f?{'count':_0x111e86,'rows':_0x4a269f}:null;}})[_0x5c74('0x23')](respondWithResult(_0x292672,null))[_0x5c74('0x45')](handleError(_0x292672,null));}; \ No newline at end of file +var _0xc328=['crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','stack','name','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','create','body','user','role','CustomDashboards','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','includeAll','Unable\x20to\x20retrieve\x20the\x20current\x20user','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','getItems','findOne','DashboardItem','order','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel'];(function(_0x508640,_0x4451a5){var _0x26e214=function(_0x8ed511){while(--_0x8ed511){_0x508640['push'](_0x508640['shift']());}};_0x26e214(++_0x4451a5);}(_0xc328,0x73));var _0x8c32=function(_0x2a1fb1,_0x238da5){_0x2a1fb1=_0x2a1fb1-0x0;var _0x56b46b=_0xc328[_0x2a1fb1];return _0x56b46b;};'use strict';var emlformat=require(_0x8c32('0x0'));var rimraf=require(_0x8c32('0x1'));var zipdir=require(_0x8c32('0x2'));var jsonpatch=require(_0x8c32('0x3'));var rp=require(_0x8c32('0x4'));var moment=require(_0x8c32('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c32('0x6'));var util=require(_0x8c32('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8c32('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c32('0x9'));var _=require(_0x8c32('0xa'));var squel=require(_0x8c32('0xb'));var crypto=require(_0x8c32('0xc'));var jsforce=require(_0x8c32('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8c32('0x8'));var querystring=require(_0x8c32('0xe'));var Papa=require('papaparse');var Redis=require(_0x8c32('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8c32('0x10'));var as=require(_0x8c32('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c32('0x12'))(_0x8c32('0x13'));var utils=require('../../config/utils');var config=require(_0x8c32('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c32('0x15'))['db'];config['redis']=_['defaults'](config[_0x8c32('0x16')],{'host':_0x8c32('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c32('0x16')]));require(_0x8c32('0x18'))[_0x8c32('0x19')](socket);function respondWithStatusCode(_0x211bdc,_0x5d5c9c){_0x5d5c9c=_0x5d5c9c||0xcc;return function(_0x973710){if(_0x973710){return _0x211bdc[_0x8c32('0x1a')](_0x5d5c9c);}return _0x211bdc[_0x8c32('0x1b')](_0x5d5c9c)[_0x8c32('0x1c')]();};}function respondWithResult(_0x5b6559,_0x3f12fd){_0x3f12fd=_0x3f12fd||0xc8;return function(_0x26e373){if(_0x26e373){return _0x5b6559[_0x8c32('0x1b')](_0x3f12fd)[_0x8c32('0x1d')](_0x26e373);}};}function respondWithFilteredResult(_0x19e162,_0x3e9051){return function(_0x4ccc8a){if(_0x4ccc8a){var _0x5aca54=typeof _0x3e9051[_0x8c32('0x1e')]===_0x8c32('0x1f')&&typeof _0x3e9051[_0x8c32('0x20')]===_0x8c32('0x1f');var _0x28e1c7=_0x4ccc8a[_0x8c32('0x21')];var _0x5cd8fd=_0x5aca54?0x0:_0x3e9051['offset'];var _0x11a3d5=_0x5aca54?_0x4ccc8a[_0x8c32('0x21')]:_0x3e9051[_0x8c32('0x1e')]+_0x3e9051[_0x8c32('0x20')];var _0x1d98c9;if(_0x11a3d5>=_0x28e1c7){_0x11a3d5=_0x28e1c7;_0x1d98c9=0xc8;}else{_0x1d98c9=0xce;}_0x19e162[_0x8c32('0x1b')](_0x1d98c9);return _0x19e162[_0x8c32('0x22')](_0x8c32('0x23'),_0x5cd8fd+'-'+_0x11a3d5+'/'+_0x28e1c7)[_0x8c32('0x1d')](_0x4ccc8a);}return null;};}function patchUpdates(_0x555c1c){return function(_0x184b38){try{jsonpatch[_0x8c32('0x24')](_0x184b38,_0x555c1c,!![]);}catch(_0x2d749f){return BPromise['reject'](_0x2d749f);}return _0x184b38[_0x8c32('0x25')]();};}function saveUpdates(_0x2f9a7f,_0xf62faf){return function(_0x46b5ac){if(_0x46b5ac){return _0x46b5ac[_0x8c32('0x26')](_0x2f9a7f)['then'](function(_0x4cae82){return _0x4cae82;});}return null;};}function removeEntity(_0x5cc1b6,_0x129825){return function(_0x3ac788){if(_0x3ac788){return _0x3ac788[_0x8c32('0x27')]()[_0x8c32('0x28')](function(){var _0x40c4cc=_0x3ac788[_0x8c32('0x29')]({'plain':!![]});var _0x57dde4='CustomDashboards';return db[_0x8c32('0x2a')][_0x8c32('0x27')]({'where':{'type':_0x57dde4,'resourceId':_0x40c4cc['id']}})[_0x8c32('0x28')](function(){return _0x3ac788;});})[_0x8c32('0x28')](function(){_0x5cc1b6['status'](0xcc)[_0x8c32('0x1c')]();});}};}function handleEntityNotFound(_0x4fe8c4,_0x2b5bc5){return function(_0x113e2e){if(!_0x113e2e){_0x4fe8c4[_0x8c32('0x1a')](0x194);}return _0x113e2e;};}function handleError(_0x1d87a3,_0x495dbd){_0x495dbd=_0x495dbd||0x1f4;return function(_0x5c0641){logger['error'](_0x5c0641[_0x8c32('0x2b')]);if(_0x5c0641[_0x8c32('0x2c')]){delete _0x5c0641[_0x8c32('0x2c')];}_0x1d87a3['status'](_0x495dbd)['send'](_0x5c0641);};}exports[_0x8c32('0x2d')]=function(_0x55ef28,_0x59d687){var _0x1e75ab={},_0xe2bd5b={},_0x4392ad={'count':0x0,'rows':[]};var _0x32efba=_['map'](db[_0x8c32('0x2e')][_0x8c32('0x2f')],function(_0x9dd8dd){return{'name':_0x9dd8dd[_0x8c32('0x30')],'type':_0x9dd8dd[_0x8c32('0x31')][_0x8c32('0x32')]};});_0xe2bd5b[_0x8c32('0x33')]=_[_0x8c32('0x34')](_0x32efba,_0x8c32('0x2c'));_0xe2bd5b[_0x8c32('0x35')]=_[_0x8c32('0x36')](_0x55ef28[_0x8c32('0x35')]);_0xe2bd5b[_0x8c32('0x37')]=_[_0x8c32('0x38')](_0xe2bd5b[_0x8c32('0x33')],_0xe2bd5b['query']);_0x1e75ab['attributes']=_[_0x8c32('0x38')](_0xe2bd5b['model'],qs['fields'](_0x55ef28[_0x8c32('0x35')][_0x8c32('0x39')]));_0x1e75ab[_0x8c32('0x3a')]=_0x1e75ab[_0x8c32('0x3a')][_0x8c32('0x3b')]?_0x1e75ab[_0x8c32('0x3a')]:_0xe2bd5b[_0x8c32('0x33')];if(!_0x55ef28[_0x8c32('0x35')][_0x8c32('0x3c')]('nolimit')){_0x1e75ab[_0x8c32('0x20')]=qs['limit'](_0x55ef28[_0x8c32('0x35')][_0x8c32('0x20')]);_0x1e75ab['offset']=qs[_0x8c32('0x1e')](_0x55ef28[_0x8c32('0x35')][_0x8c32('0x1e')]);}_0x1e75ab['order']=qs['sort'](_0x55ef28[_0x8c32('0x35')][_0x8c32('0x3d')]);_0x1e75ab['where']=qs[_0x8c32('0x37')](_['pick'](_0x55ef28[_0x8c32('0x35')],_0xe2bd5b[_0x8c32('0x37')]),_0x32efba);if(_0x55ef28[_0x8c32('0x35')][_0x8c32('0x3e')]){_0x1e75ab[_0x8c32('0x3f')]=_[_0x8c32('0x40')](_0x1e75ab[_0x8c32('0x3f')],{'$or':_[_0x8c32('0x34')](_0x32efba,function(_0x30830b){if(_0x30830b[_0x8c32('0x31')]!==_0x8c32('0x41')){var _0x9f8fa3={};_0x9f8fa3[_0x30830b[_0x8c32('0x2c')]]={'$like':'%'+_0x55ef28[_0x8c32('0x35')][_0x8c32('0x3e')]+'%'};return _0x9f8fa3;}})});}_0x1e75ab=_[_0x8c32('0x40')]({},_0x1e75ab,_0x55ef28[_0x8c32('0x42')]);var _0x4471d7={'where':_0x1e75ab[_0x8c32('0x3f')]};return db['Dashboard']['count'](_0x4471d7)[_0x8c32('0x28')](function(_0x251dda){_0x4392ad[_0x8c32('0x21')]=_0x251dda;if(_0x55ef28[_0x8c32('0x35')]['includeAll']){_0x1e75ab[_0x8c32('0x43')]=[{'all':!![]}];}return db[_0x8c32('0x2e')]['findAll'](_0x1e75ab);})[_0x8c32('0x28')](function(_0x574650){_0x4392ad[_0x8c32('0x44')]=_0x574650;return _0x4392ad;})[_0x8c32('0x28')](respondWithFilteredResult(_0x59d687,_0x1e75ab))[_0x8c32('0x45')](handleError(_0x59d687,null));};exports[_0x8c32('0x46')]=function(_0x481686,_0x40b3bf){var _0x3949ee={'raw':![],'where':{'id':_0x481686[_0x8c32('0x47')]['id']}},_0x387156={};_0x387156[_0x8c32('0x33')]=_[_0x8c32('0x36')](db[_0x8c32('0x2e')][_0x8c32('0x2f')]);_0x387156[_0x8c32('0x35')]=_[_0x8c32('0x36')](_0x481686['query']);_0x387156[_0x8c32('0x37')]=_[_0x8c32('0x38')](_0x387156[_0x8c32('0x33')],_0x387156['query']);_0x3949ee[_0x8c32('0x3a')]=_[_0x8c32('0x38')](_0x387156[_0x8c32('0x33')],qs[_0x8c32('0x39')](_0x481686[_0x8c32('0x35')][_0x8c32('0x39')]));_0x3949ee['attributes']=_0x3949ee[_0x8c32('0x3a')]['length']?_0x3949ee['attributes']:_0x387156[_0x8c32('0x33')];if(_0x481686['query']['includeAll']){_0x3949ee[_0x8c32('0x43')]=[{'all':!![]}];}_0x3949ee=_['merge']({},_0x3949ee,_0x481686[_0x8c32('0x42')]);return db[_0x8c32('0x2e')]['find'](_0x3949ee)['then'](handleEntityNotFound(_0x40b3bf,null))[_0x8c32('0x28')](respondWithResult(_0x40b3bf,null))[_0x8c32('0x45')](handleError(_0x40b3bf,null));};exports[_0x8c32('0x48')]=function(_0x1aef98,_0x52a1ff){return db[_0x8c32('0x2e')][_0x8c32('0x48')](_0x1aef98[_0x8c32('0x49')],{})[_0x8c32('0x28')](function(_0x11e906){var _0x6320ef=_0x1aef98[_0x8c32('0x4a')][_0x8c32('0x29')]({'plain':!![]});if(!_0x6320ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6320ef[_0x8c32('0x4b')]===_0x8c32('0x4a')){var _0x4493c7=_0x11e906['get']({'plain':!![]});var _0x1cff31=_0x8c32('0x4c');return db[_0x8c32('0x4d')][_0x8c32('0x4e')]({'where':{'name':_0x1cff31,'userProfileId':_0x6320ef[_0x8c32('0x4f')]},'raw':!![]})[_0x8c32('0x28')](function(_0x437929){if(_0x437929&&_0x437929[_0x8c32('0x50')]===0x0){return db[_0x8c32('0x2a')]['create']({'name':_0x4493c7[_0x8c32('0x2c')],'resourceId':_0x4493c7['id'],'type':_0x437929[_0x8c32('0x2c')],'sectionId':_0x437929['id']},{})['then'](function(){return _0x11e906;});}else{return _0x11e906;}})[_0x8c32('0x45')](function(_0xb61496){logger[_0x8c32('0x51')](_0x8c32('0x52'),_0xb61496);throw _0xb61496;});}return _0x11e906;})[_0x8c32('0x28')](respondWithResult(_0x52a1ff,0xc9))[_0x8c32('0x45')](handleError(_0x52a1ff,null));};exports[_0x8c32('0x53')]=function(_0x28f564,_0x4fe1db){var _0x3865a0={'where':{'id':_0x28f564[_0x8c32('0x47')]['id']}},_0x324f4e={};_0x324f4e[_0x8c32('0x33')]=_[_0x8c32('0x36')](db[_0x8c32('0x2e')][_0x8c32('0x2f')]);_0x3865a0['attributes']=_[_0x8c32('0x38')](_0x324f4e[_0x8c32('0x33')],qs['fields'](_0x28f564[_0x8c32('0x35')][_0x8c32('0x39')]));_0x3865a0['attributes']=_0x3865a0[_0x8c32('0x3a')][_0x8c32('0x3b')]?_0x3865a0[_0x8c32('0x3a')]:_0x324f4e[_0x8c32('0x33')];if(_0x28f564[_0x8c32('0x35')]['includeAll']){_0x3865a0[_0x8c32('0x43')]=[{'all':!![]}];}_0x3865a0=_['merge']({},_0x3865a0,_0x28f564[_0x8c32('0x42')]);return db[_0x8c32('0x2e')][_0x8c32('0x4e')](_0x3865a0)[_0x8c32('0x28')](handleEntityNotFound(_0x4fe1db,null))[_0x8c32('0x28')](function(_0x3090af){if(_0x3090af){var _0x2378c4=_0x3090af[_0x8c32('0x29')]({'plain':!![]});_0x2378c4=qs[_0x8c32('0x54')](_0x2378c4,['id',_0x8c32('0x55'),'updatedAt']);_0x28f564[_0x8c32('0x49')]=_[_0x8c32('0x54')](_0x28f564[_0x8c32('0x49')],['id','createdAt',_0x8c32('0x56')]);return db[_0x8c32('0x2e')]['create'](_[_0x8c32('0x40')](_0x2378c4,_0x28f564[_0x8c32('0x49')]),{'include':_0x28f564[_0x8c32('0x35')][_0x8c32('0x57')]?[{'all':!![]}]:undefined})['then'](function(_0x204294){var _0x494666=_0x28f564[_0x8c32('0x4a')][_0x8c32('0x29')]({'plain':!![]});if(!_0x494666)throw new Error(_0x8c32('0x58'));if(_0x494666[_0x8c32('0x4b')]===_0x8c32('0x4a')){var _0x591ac4=_0x204294[_0x8c32('0x29')]({'plain':!![]});var _0x1207ae=_0x8c32('0x4c');return db['UserProfileSection'][_0x8c32('0x4e')]({'where':{'name':_0x1207ae,'userProfileId':_0x494666[_0x8c32('0x4f')]},'raw':!![]})[_0x8c32('0x28')](function(_0x57bdc0){if(_0x57bdc0&&_0x57bdc0[_0x8c32('0x50')]===0x0){return db['UserProfileResource'][_0x8c32('0x48')]({'name':_0x591ac4['name'],'resourceId':_0x591ac4['id'],'type':_0x57bdc0[_0x8c32('0x2c')],'sectionId':_0x57bdc0['id']},{})['then'](function(){return _0x204294;});}else{return _0x204294;}})['catch'](function(_0x34c35a){logger[_0x8c32('0x51')](_0x8c32('0x52'),_0x34c35a);throw _0x34c35a;});}return _0x204294;});}})['then'](respondWithResult(_0x4fe1db,0xc9))[_0x8c32('0x45')](handleError(_0x4fe1db,null));};exports[_0x8c32('0x26')]=function(_0x5c76b2,_0x5c1104){if(_0x5c76b2[_0x8c32('0x49')]['id']){delete _0x5c76b2[_0x8c32('0x49')]['id'];}return db['Dashboard'][_0x8c32('0x4e')]({'where':{'id':_0x5c76b2[_0x8c32('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c1104,null))[_0x8c32('0x28')](saveUpdates(_0x5c76b2[_0x8c32('0x49')],null))[_0x8c32('0x28')](respondWithResult(_0x5c1104,null))[_0x8c32('0x45')](handleError(_0x5c1104,null));};exports['destroy']=function(_0x4bb750,_0x591a5f){return db[_0x8c32('0x2e')]['find']({'where':{'id':_0x4bb750[_0x8c32('0x47')]['id']}})[_0x8c32('0x28')](handleEntityNotFound(_0x591a5f,null))[_0x8c32('0x28')](removeEntity(_0x591a5f,null))['catch'](handleError(_0x591a5f,null));};function widgetAttributes(_0x371686){try{switch(_0x371686[_0x8c32('0x31')]){case'iframe':return[{'name':_0x8c32('0x59'),'value':_0x371686[_0x8c32('0x59')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686['attrs'][0x0]?_0x371686['attrs'][0x0][_0x8c32('0x5b')]:undefined)||_0x8c32('0x5c')}];case _0x8c32('0x5d'):return[{'name':_0x8c32('0x5e'),'value':_0x371686[_0x8c32('0x5e')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x0]?_0x371686[_0x8c32('0x5a')][0x0][_0x8c32('0x5b')]:undefined)||''}];case'clock':return[{'name':_0x8c32('0x5f'),'value':_0x371686[_0x8c32('0x5f')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x0]?_0x371686[_0x8c32('0x5a')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x8c32('0x60'),'value':_0x371686[_0x8c32('0x60')]||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x1]?_0x371686[_0x8c32('0x5a')][0x1]['value']:undefined)||_0x8c32('0x61')},{'name':_0x8c32('0x62'),'value':_0x371686[_0x8c32('0x62')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x2]?_0x371686['attrs'][0x2][_0x8c32('0x5b')]:undefined)||0xc}];case _0x8c32('0x63'):return[{'name':_0x8c32('0x64'),'value':_0x371686[_0x8c32('0x64')]||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x0]?_0x371686[_0x8c32('0x5a')][0x0][_0x8c32('0x5b')]:undefined)||_0x8c32('0x65')},{'name':'attrVoiceQueues','value':_0x371686[_0x8c32('0x66')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x1]?_0x371686[_0x8c32('0x5a')][0x1][_0x8c32('0x5b')]:undefined)||[]},{'name':'attrFontSize','value':_0x371686['attrFontSize']||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x2]?_0x371686[_0x8c32('0x5a')][0x2][_0x8c32('0x5b')]:undefined)||0x14},{'name':'attrChannel','value':_0x371686[_0x8c32('0x67')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686['attrs'][0x3]?_0x371686[_0x8c32('0x5a')][0x3]['value']:undefined)||_0x8c32('0x68')},{'name':'attrEmailAccounts','value':_0x371686[_0x8c32('0x69')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x4]?_0x371686[_0x8c32('0x5a')][0x4][_0x8c32('0x5b')]:undefined)||''},{'name':_0x8c32('0x6a'),'value':_0x371686[_0x8c32('0x6a')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x5]?_0x371686['attrs'][0x5]['value']:undefined)||''},{'name':_0x8c32('0x6b'),'value':_0x371686[_0x8c32('0x6b')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x6]?_0x371686[_0x8c32('0x5a')][0x6][_0x8c32('0x5b')]:undefined)||''},{'name':_0x8c32('0x6c'),'value':_0x371686[_0x8c32('0x6c')]||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x7]?_0x371686['attrs'][0x7]['value']:undefined)||''},{'name':_0x8c32('0x6d'),'value':_0x371686[_0x8c32('0x6d')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x8]?_0x371686[_0x8c32('0x5a')][0x8][_0x8c32('0x5b')]:undefined)||''},{'name':_0x8c32('0x6e'),'value':_0x371686[_0x8c32('0x6e')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x9]?_0x371686[_0x8c32('0x5a')][0x9][_0x8c32('0x5b')]:undefined)||''}];case _0x8c32('0x6f'):case _0x8c32('0x70'):return[{'name':'attrSerie1','value':_0x371686['attrSerie1']||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x0]?_0x371686[_0x8c32('0x5a')][0x0][_0x8c32('0x5b')]:undefined)||_0x8c32('0x65')},{'name':'attrSerie2','value':_0x371686[_0x8c32('0x71')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x1]?_0x371686[_0x8c32('0x5a')][0x1][_0x8c32('0x5b')]:undefined)||null},{'name':'attrSerie3','value':_0x371686[_0x8c32('0x72')]||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x2]?_0x371686[_0x8c32('0x5a')][0x2]['value']:undefined)||null},{'name':_0x8c32('0x66'),'value':_0x371686[_0x8c32('0x66')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x3]?_0x371686['attrs'][0x3][_0x8c32('0x5b')]:undefined)||[]},{'name':_0x8c32('0x67'),'value':_0x371686[_0x8c32('0x67')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x4]?_0x371686['attrs'][0x4][_0x8c32('0x5b')]:undefined)||'voice'},{'name':_0x8c32('0x69'),'value':_0x371686['attrEmailAccounts']||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x5]?_0x371686[_0x8c32('0x5a')][0x5][_0x8c32('0x5b')]:undefined)||''},{'name':_0x8c32('0x6a'),'value':_0x371686[_0x8c32('0x6a')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x6]?_0x371686[_0x8c32('0x5a')][0x6]['value']:undefined)||''},{'name':_0x8c32('0x6b'),'value':_0x371686['attrSmsAccounts']||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x7]?_0x371686[_0x8c32('0x5a')][0x7][_0x8c32('0x5b')]:undefined)||''},{'name':_0x8c32('0x6c'),'value':_0x371686['attrOpenchannelAccounts']||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x8]?_0x371686[_0x8c32('0x5a')][0x8]['value']:undefined)||''},{'name':_0x8c32('0x6d'),'value':_0x371686[_0x8c32('0x6d')]||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x9]?_0x371686[_0x8c32('0x5a')][0x9]['value']:undefined)||''},{'name':_0x8c32('0x6e'),'value':_0x371686['attrChatWebsites']||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0xa]?_0x371686[_0x8c32('0x5a')][0xa]['value']:undefined)||''}];case _0x8c32('0x73'):return[{'name':_0x8c32('0x74'),'type':_0x371686[_0x8c32('0x75')]||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x0]?_0x371686[_0x8c32('0x5a')][0x0][_0x8c32('0x31')]:undefined)||null,'value':_0x371686[_0x8c32('0x74')]||(_0x371686[_0x8c32('0x5a')]&&_0x371686[_0x8c32('0x5a')][0x0]?_0x371686[_0x8c32('0x5a')][0x0]['value']:undefined)||null},{'name':_0x8c32('0x76'),'value':_0x371686[_0x8c32('0x76')]||(_0x371686['attrs']&&_0x371686[_0x8c32('0x5a')][0x1]?_0x371686['attrs'][0x1][_0x8c32('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x56c6cc){logger[_0x8c32('0x51')](_0x8c32('0x77'),JSON['stringify'](_0x56c6cc));return[];}}exports['addItem']=function(_0x3777c1,_0x2ad74e,_0x1dbf0e){if(_0x3777c1[_0x8c32('0x49')]['id']){delete _0x3777c1[_0x8c32('0x49')]['id'];}return db[_0x8c32('0x2e')][_0x8c32('0x4e')]({'where':{'id':_0x3777c1['params']['id']}})['then'](handleEntityNotFound(_0x2ad74e,null))['then'](function(_0x2a0361){if(_0x2a0361){_0x3777c1[_0x8c32('0x49')][_0x8c32('0x78')]=_0x2a0361['id'];_0x3777c1[_0x8c32('0x49')][_0x8c32('0x5a')]=widgetAttributes(_0x3777c1[_0x8c32('0x49')]);return db['DashboardItem'][_0x8c32('0x48')](_0x3777c1[_0x8c32('0x49')]);}})['then'](respondWithResult(_0x2ad74e,null))['catch'](handleError(_0x2ad74e,null));};exports[_0x8c32('0x79')]=function(_0x38791,_0x37f72b,_0x3d9eb9){var _0x3cec71={};var _0x4eeacb={};var _0x344836;var _0x433a44;return db[_0x8c32('0x2e')][_0x8c32('0x7a')]({'where':{'id':_0x38791[_0x8c32('0x47')]['id']}})[_0x8c32('0x28')](handleEntityNotFound(_0x37f72b,null))['then'](function(_0xf18775){if(_0xf18775){_0x344836=_0xf18775;_0x4eeacb[_0x8c32('0x33')]=_[_0x8c32('0x36')](db[_0x8c32('0x7b')][_0x8c32('0x2f')]);_0x4eeacb[_0x8c32('0x35')]=_[_0x8c32('0x36')](_0x38791[_0x8c32('0x35')]);_0x4eeacb[_0x8c32('0x37')]=_['intersection'](_0x4eeacb[_0x8c32('0x33')],_0x4eeacb[_0x8c32('0x35')]);_0x3cec71['attributes']=_['intersection'](_0x4eeacb[_0x8c32('0x33')],qs[_0x8c32('0x39')](_0x38791[_0x8c32('0x35')][_0x8c32('0x39')]));_0x3cec71[_0x8c32('0x3a')]=_0x3cec71[_0x8c32('0x3a')]['length']?_0x3cec71[_0x8c32('0x3a')]:_0x4eeacb['model'];_0x3cec71[_0x8c32('0x7c')]=qs[_0x8c32('0x3d')](_0x38791[_0x8c32('0x35')]['sort']);_0x3cec71[_0x8c32('0x3f')]=qs[_0x8c32('0x37')](_[_0x8c32('0x7d')](_0x38791[_0x8c32('0x35')],_0x4eeacb[_0x8c32('0x37')]));if(_0x38791[_0x8c32('0x35')][_0x8c32('0x3e')]){_0x3cec71[_0x8c32('0x3f')]=_[_0x8c32('0x40')](_0x3cec71[_0x8c32('0x3f')],{'$or':_[_0x8c32('0x34')](_0x3cec71[_0x8c32('0x3a')],function(_0xdf4cad){var _0x4f6233={};_0x4f6233[_0xdf4cad]={'$like':'%'+_0x38791['query'][_0x8c32('0x3e')]+'%'};return _0x4f6233;})});}_0x3cec71=_[_0x8c32('0x40')]({},_0x3cec71,_0x38791[_0x8c32('0x42')]);return _0x344836[_0x8c32('0x79')](_0x3cec71);}})[_0x8c32('0x28')](function(_0x41e14d){if(_0x41e14d){_0x433a44=_0x41e14d[_0x8c32('0x3b')];if(!_0x38791[_0x8c32('0x35')]['hasOwnProperty'](_0x8c32('0x7e'))){_0x3cec71[_0x8c32('0x20')]=qs[_0x8c32('0x20')](_0x38791['query'][_0x8c32('0x20')]);_0x3cec71[_0x8c32('0x1e')]=qs[_0x8c32('0x1e')](_0x38791[_0x8c32('0x35')][_0x8c32('0x1e')]);}return _0x344836[_0x8c32('0x79')](_0x3cec71);}})[_0x8c32('0x28')](function(_0x18dce4){if(_0x18dce4){return _0x18dce4?{'count':_0x433a44,'rows':_0x18dce4}:null;}})['then'](respondWithResult(_0x37f72b,null))[_0x8c32('0x45')](handleError(_0x37f72b,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1bd37c7..2b80524 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 _0xe451=['exports','Dashboard','remove','emit','hasOwnProperty'];(function(_0x26ec62,_0x417f53){var _0x141a44=function(_0x83af8f){while(--_0x83af8f){_0x26ec62['push'](_0x26ec62['shift']());}};_0x141a44(++_0x417f53);}(_0xe451,0xec));var _0x1e45=function(_0x1a962c,_0x2980a6){_0x1a962c=_0x1a962c-0x0;var _0x38b0c6=_0xe451[_0x1a962c];return _0x38b0c6;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x1e45('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1e45('0x1')};function emitEvent(_0x363caa){return function(_0x1f9061,_0x197c03,_0x5cc973){DashboardEvents[_0x1e45('0x2')](_0x363caa+':'+_0x1f9061['id'],_0x1f9061);DashboardEvents[_0x1e45('0x2')](_0x363caa,_0x1f9061);_0x5cc973(null);};}for(var e in events){if(events[_0x1e45('0x3')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x1e45('0x4')]=DashboardEvents; \ No newline at end of file +var _0x3cd2=['Dashboard','save','update','emit','hook','exports','../../mysqldb'];(function(_0x4a9218,_0x2b25cc){var _0x338098=function(_0x3fc1b7){while(--_0x3fc1b7){_0x4a9218['push'](_0x4a9218['shift']());}};_0x338098(++_0x2b25cc);}(_0x3cd2,0xd1));var _0x23cd=function(_0x364872,_0x132bb7){_0x364872=_0x364872-0x0;var _0x4400d8=_0x3cd2[_0x364872];return _0x4400d8;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x23cd('0x0'))['db'][_0x23cd('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x23cd('0x2'),'afterUpdate':_0x23cd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2e1546){return function(_0x4f05cd,_0x5c77e3,_0xf2207f){DashboardEvents[_0x23cd('0x4')](_0x2e1546+':'+_0x4f05cd['id'],_0x4f05cd);DashboardEvents['emit'](_0x2e1546,_0x4f05cd);_0xf2207f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x23cd('0x5')](e,emitEvent(event));}}module[_0x23cd('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 0105f79..06aa36a 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 _0x4fab=['moment','request-promise','path','rimraf','../../config/environment','dashboards','util','../../config/logger','api'];(function(_0x25e66b,_0x439438){var _0x463895=function(_0x2d1476){while(--_0x2d1476){_0x25e66b['push'](_0x25e66b['shift']());}};_0x463895(++_0x439438);}(_0x4fab,0x72));var _0xb4fa=function(_0x17586e,_0x3d94ea){_0x17586e=_0x17586e-0x0;var _0x5f2563=_0x4fab[_0x17586e];return _0x5f2563;};'use strict';var _=require('lodash');var util=require(_0xb4fa('0x0'));var logger=require(_0xb4fa('0x1'))(_0xb4fa('0x2'));var moment=require(_0xb4fa('0x3'));var BPromise=require('bluebird');var rp=require(_0xb4fa('0x4'));var fs=require('fs');var path=require(_0xb4fa('0x5'));var rimraf=require(_0xb4fa('0x6'));var config=require(_0xb4fa('0x7'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x4cfd88,_0x21c30a){return _0x4cfd88['define']('Dashboard',attributes,{'tableName':_0xb4fa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x322b=['api','moment','bluebird','rimraf','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','../../config/logger'];(function(_0x3b7e6f,_0x1565b5){var _0x4873c3=function(_0x3f0ac6){while(--_0x3f0ac6){_0x3b7e6f['push'](_0x3b7e6f['shift']());}};_0x4873c3(++_0x1565b5);}(_0x322b,0x1ec));var _0xb322=function(_0x476d87,_0xf0b58f){_0x476d87=_0x476d87-0x0;var _0x2498d9=_0x322b[_0x476d87];return _0x2498d9;};'use strict';var _=require(_0xb322('0x0'));var util=require(_0xb322('0x1'));var logger=require(_0xb322('0x2'))(_0xb322('0x3'));var moment=require(_0xb322('0x4'));var BPromise=require(_0xb322('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb322('0x6'));var config=require('../../config/environment');var attributes=require(_0xb322('0x7'));module[_0xb322('0x8')]=function(_0x25fbf8,_0x31f6a6){return _0x25fbf8['define'](_0xb322('0x9'),attributes,{'tableName':_0xb322('0xa'),'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 49f2719..4640892 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 _0x4b5c=['code','message','result','catch','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2d6bc7,_0x348be5){var _0x2773a0=function(_0x496c7f){while(--_0x496c7f){_0x2d6bc7['push'](_0x2d6bc7['shift']());}};_0x2773a0(++_0x348be5);}(_0x4b5c,0x1df));var _0xc4b5=function(_0x3e36ae,_0x61596f){_0x3e36ae=_0x3e36ae-0x0;var _0x4e76aa=_0x4b5c[_0x3e36ae];return _0x4e76aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc4b5('0x0'));var BPromise=require('bluebird');var rs=require(_0xc4b5('0x1'));var fs=require('fs');var Redis=require(_0xc4b5('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc4b5('0x3'))(_0xc4b5('0x4'));var config=require('../../config/environment');var jayson=require(_0xc4b5('0x5'));var client=jayson[_0xc4b5('0x6')]['http']({'port':0x232a});config[_0xc4b5('0x7')]=_['defaults'](config['redis'],{'host':_0xc4b5('0x8'),'port':0x18eb});var socket=require(_0xc4b5('0x9'))(new Redis(config[_0xc4b5('0x7')]));require(_0xc4b5('0xa'))[_0xc4b5('0xb')](socket);function respondWithRpcPromise(_0x314f74,_0x38e4fb,_0x188b93){return new BPromise(function(_0xdb61f7,_0x1111a3){return client[_0xc4b5('0xc')](_0x314f74,_0x188b93)[_0xc4b5('0xd')](function(_0x28dda3){logger[_0xc4b5('0xe')](_0xc4b5('0xf'),_0x38e4fb,_0xc4b5('0x10'));logger[_0xc4b5('0x11')](_0xc4b5('0x12'),_0x38e4fb,_0xc4b5('0x10'),JSON[_0xc4b5('0x13')](_0x28dda3));if(_0x28dda3[_0xc4b5('0x14')]){if(_0x28dda3['error'][_0xc4b5('0x15')]===0x1f4){logger['error'](_0xc4b5('0xf'),_0x38e4fb,_0x28dda3['error'][_0xc4b5('0x16')]);return _0x1111a3(_0x28dda3[_0xc4b5('0x14')][_0xc4b5('0x16')]);}logger[_0xc4b5('0x14')](_0xc4b5('0xf'),_0x38e4fb,_0x28dda3['error'][_0xc4b5('0x16')]);return _0xdb61f7(_0x28dda3[_0xc4b5('0x14')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x38e4fb,_0xc4b5('0x10'));_0xdb61f7(_0x28dda3[_0xc4b5('0x17')][_0xc4b5('0x16')]);}})[_0xc4b5('0x18')](function(_0x32579c){logger['error'](_0xc4b5('0xf'),_0x38e4fb,_0x32579c);_0x1111a3(_0x32579c);});});} \ No newline at end of file +var _0x37c4=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3f6d25,_0x5967e9){var _0x3e4a59=function(_0x101641){while(--_0x101641){_0x3f6d25['push'](_0x3f6d25['shift']());}};_0x3e4a59(++_0x5967e9);}(_0x37c4,0x1e4));var _0x437c=function(_0x18f346,_0x2318ce){_0x18f346=_0x18f346-0x0;var _0x4b0b3a=_0x37c4[_0x18f346];return _0x4b0b3a;};'use strict';var _=require(_0x437c('0x0'));var util=require(_0x437c('0x1'));var moment=require(_0x437c('0x2'));var BPromise=require(_0x437c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x437c('0x4'));var db=require(_0x437c('0x5'))['db'];var utils=require(_0x437c('0x6'));var logger=require(_0x437c('0x7'))(_0x437c('0x8'));var config=require(_0x437c('0x9'));var jayson=require(_0x437c('0xa'));var client=jayson['client'][_0x437c('0xb')]({'port':0x232a});config[_0x437c('0xc')]=_[_0x437c('0xd')](config[_0x437c('0xc')],{'host':_0x437c('0xe'),'port':0x18eb});var socket=require(_0x437c('0xf'))(new Redis(config['redis']));require(_0x437c('0x10'))[_0x437c('0x11')](socket);function respondWithRpcPromise(_0xbd8481,_0x1fc17d,_0x5cb386){return new BPromise(function(_0x116903,_0x3f24f5){return client[_0x437c('0x12')](_0xbd8481,_0x5cb386)['then'](function(_0x388a9d){logger[_0x437c('0x13')](_0x437c('0x14'),_0x1fc17d,'request\x20sent');logger['debug'](_0x437c('0x15'),_0x1fc17d,_0x437c('0x16'),JSON[_0x437c('0x17')](_0x388a9d));if(_0x388a9d[_0x437c('0x18')]){if(_0x388a9d['error'][_0x437c('0x19')]===0x1f4){logger[_0x437c('0x18')](_0x437c('0x14'),_0x1fc17d,_0x388a9d[_0x437c('0x18')]['message']);return _0x3f24f5(_0x388a9d[_0x437c('0x18')][_0x437c('0x1a')]);}logger['error'](_0x437c('0x14'),_0x1fc17d,_0x388a9d[_0x437c('0x18')][_0x437c('0x1a')]);return _0x116903(_0x388a9d[_0x437c('0x18')]['message']);}else{logger['info'](_0x437c('0x14'),_0x1fc17d,_0x437c('0x16'));_0x116903(_0x388a9d[_0x437c('0x1b')][_0x437c('0x1a')]);}})[_0x437c('0x1c')](function(_0x1f201c){logger['error'](_0x437c('0x14'),_0x1fc17d,_0x1f201c);_0x3f24f5(_0x1f201c);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index aa6d543..0ecdec1 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 _0x598f=['save','update','emit','register','length','dashboard:'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x598f,0x150));var _0xf598=function(_0x6d954c,_0x48e044){_0x6d954c=_0x6d954c-0x0;var _0x687e39=_0x598f[_0x6d954c];return _0x687e39;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xf598('0x0'),'remove',_0xf598('0x1')];function createListener(_0x51d0fb,_0x481e08){return function(_0x54129c){_0x481e08[_0xf598('0x2')](_0x51d0fb,_0x54129c);};}function removeListener(_0x460836,_0x38d775){return function(){DashboardEvents['removeListener'](_0x460836,_0x38d775);};}exports[_0xf598('0x3')]=function(_0xeda24d){for(var _0x350d48=0x0,_0x524574=events[_0xf598('0x4')];_0x350d48<_0x524574;_0x350d48++){var _0xa71af0=events[_0x350d48];var _0x6f9b0a=createListener(_0xf598('0x5')+_0xa71af0,_0xeda24d);DashboardEvents['on'](_0xa71af0,_0x6f9b0a);}}; \ No newline at end of file +var _0x8d41=['save','remove','update','emit','removeListener','length','./dashboard.events'];(function(_0x3f9095,_0x4eaea5){var _0x105179=function(_0x5a8ee7){while(--_0x5a8ee7){_0x3f9095['push'](_0x3f9095['shift']());}};_0x105179(++_0x4eaea5);}(_0x8d41,0x1aa));var _0x18d4=function(_0x386078,_0x49ad4f){_0x386078=_0x386078-0x0;var _0xd6675c=_0x8d41[_0x386078];return _0xd6675c;};'use strict';var DashboardEvents=require(_0x18d4('0x0'));var events=[_0x18d4('0x1'),_0x18d4('0x2'),_0x18d4('0x3')];function createListener(_0x214df3,_0x4cc034){return function(_0x1dc5f0){_0x4cc034[_0x18d4('0x4')](_0x214df3,_0x1dc5f0);};}function removeListener(_0x124d27,_0x2c4d52){return function(){DashboardEvents[_0x18d4('0x5')](_0x124d27,_0x2c4d52);};}exports['register']=function(_0xa68ffd){for(var _0x25b129=0x0,_0x31e994=events[_0x18d4('0x6')];_0x25b129<_0x31e994;_0x25b129++){var _0x4d5d87=events[_0x25b129];var _0x3948b5=createListener('dashboard:'+_0x4d5d87,_0xa68ffd);DashboardEvents['on'](_0x4d5d87,_0x3948b5);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index f8a514e..237618b 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 _0xe6bd=['/:id/clone','clone','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','/:id','get','/:id/items','getItems','post','create'];(function(_0x581a53,_0x1caaa7){var _0x2e646b=function(_0x34c360){while(--_0x34c360){_0x581a53['push'](_0x581a53['shift']());}};_0x2e646b(++_0x1caaa7);}(_0xe6bd,0x13b));var _0xde6b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe6bd[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xde6b('0x0'));var util=require(_0xde6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xde6b('0x2')]();var fs_extra=require(_0xde6b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xde6b('0x4'));var config=require(_0xde6b('0x5'));var controller=require(_0xde6b('0x6'));router['get']('/',auth[_0xde6b('0x7')](),controller[_0xde6b('0x8')]);router['get'](_0xde6b('0x9'),auth[_0xde6b('0x7')](),controller['show']);router[_0xde6b('0xa')](_0xde6b('0xb'),auth['isAuthenticated'](),controller[_0xde6b('0xc')]);router[_0xde6b('0xd')]('/',auth[_0xde6b('0x7')](),controller[_0xde6b('0xe')]);router[_0xde6b('0xd')](_0xde6b('0xf'),auth[_0xde6b('0x7')](),controller[_0xde6b('0x10')]);router[_0xde6b('0xd')]('/:id/items',auth[_0xde6b('0x7')](),controller['addItem']);router[_0xde6b('0x11')](_0xde6b('0x9'),auth[_0xde6b('0x7')](),controller[_0xde6b('0x12')]);router[_0xde6b('0x13')]('/:id',auth[_0xde6b('0x7')](),controller[_0xde6b('0x14')]);module[_0xde6b('0x15')]=router; \ No newline at end of file +var _0x0deb=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/items','post','create','/:id/clone','clone','update','delete','destroy','multer','util'];(function(_0x41600c,_0x46a5b5){var _0x174c9e=function(_0x24c40b){while(--_0x24c40b){_0x41600c['push'](_0x41600c['shift']());}};_0x174c9e(++_0x46a5b5);}(_0x0deb,0x1d9));var _0xb0de=function(_0x35f042,_0x14aa36){_0x35f042=_0x35f042-0x0;var _0x2efcbf=_0x0deb[_0x35f042];return _0x2efcbf;};'use strict';var multer=require(_0xb0de('0x0'));var util=require(_0xb0de('0x1'));var path=require(_0xb0de('0x2'));var timeout=require(_0xb0de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb0de('0x4'));var auth=require(_0xb0de('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb0de('0x6'));var controller=require('./dashboard.controller');router[_0xb0de('0x7')]('/',auth[_0xb0de('0x8')](),controller['index']);router['get'](_0xb0de('0x9'),auth['isAuthenticated'](),controller[_0xb0de('0xa')]);router[_0xb0de('0x7')](_0xb0de('0xb'),auth[_0xb0de('0x8')](),controller['getItems']);router[_0xb0de('0xc')]('/',auth[_0xb0de('0x8')](),controller[_0xb0de('0xd')]);router[_0xb0de('0xc')](_0xb0de('0xe'),auth[_0xb0de('0x8')](),controller[_0xb0de('0xf')]);router[_0xb0de('0xc')](_0xb0de('0xb'),auth[_0xb0de('0x8')](),controller['addItem']);router['put'](_0xb0de('0x9'),auth['isAuthenticated'](),controller[_0xb0de('0x10')]);router[_0xb0de('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb0de('0x12')]);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 c3833b1..97f54c9 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 _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabce,0x103));var _0xeabc=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xabce[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x3af9ed,_0x129011){var _0x51adaa=function(_0x393a52){while(--_0x393a52){_0x3af9ed['push'](_0x3af9ed['shift']());}};_0x51adaa(++_0x129011);}(_0xe3da,0x1cd));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'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 743d860..072f160 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 _0x28b1=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','DashboardItem','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','params','type','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x51d4a3,_0x1ac94e){var _0x490835=function(_0x2ffe9a){while(--_0x2ffe9a){_0x51d4a3['push'](_0x51d4a3['shift']());}};_0x490835(++_0x1ac94e);}(_0x28b1,0x1d6));var _0x128b=function(_0x9c759d,_0x380ca6){_0x9c759d=_0x9c759d-0x0;var _0x496c2c=_0x28b1[_0x9c759d];return _0x496c2c;};'use strict';var emlformat=require(_0x128b('0x0'));var rimraf=require(_0x128b('0x1'));var zipdir=require(_0x128b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x128b('0x3'));var moment=require(_0x128b('0x4'));var BPromise=require(_0x128b('0x5'));var Mustache=require(_0x128b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x128b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x128b('0x8'));var _=require('lodash');var squel=require(_0x128b('0x9'));var crypto=require(_0x128b('0xa'));var jsforce=require(_0x128b('0xb'));var deskjs=require(_0x128b('0xc'));var toCsv=require(_0x128b('0xd'));var querystring=require(_0x128b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x128b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x128b('0x10'));var logger=require(_0x128b('0x11'))(_0x128b('0x12'));var utils=require(_0x128b('0x13'));var config=require(_0x128b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x128b('0x15'))['db'];config['redis']=_[_0x128b('0x16')](config[_0x128b('0x17')],{'host':_0x128b('0x18'),'port':0x18eb});var socket=require(_0x128b('0x19'))(new Redis(config[_0x128b('0x17')]));require(_0x128b('0x1a'))[_0x128b('0x1b')](socket);function respondWithStatusCode(_0x129056,_0x10160e){_0x10160e=_0x10160e||0xcc;return function(_0x37ba57){if(_0x37ba57){return _0x129056[_0x128b('0x1c')](_0x10160e);}return _0x129056[_0x128b('0x1d')](_0x10160e)[_0x128b('0x1e')]();};}function respondWithResult(_0x51f09a,_0x4b9101){_0x4b9101=_0x4b9101||0xc8;return function(_0x5110be){if(_0x5110be){return _0x51f09a['status'](_0x4b9101)['json'](_0x5110be);}};}function respondWithFilteredResult(_0x2b36c0,_0x1530d6){return function(_0x2f04a5){if(_0x2f04a5){var _0x13d62b=typeof _0x1530d6[_0x128b('0x1f')]==='undefined'&&typeof _0x1530d6[_0x128b('0x20')]===_0x128b('0x21');var _0x3ed3b0=_0x2f04a5[_0x128b('0x22')];var _0x5ea8d6=_0x13d62b?0x0:_0x1530d6[_0x128b('0x1f')];var _0x3fe1ce=_0x13d62b?_0x2f04a5['count']:_0x1530d6[_0x128b('0x1f')]+_0x1530d6['limit'];var _0x1606f5;if(_0x3fe1ce>=_0x3ed3b0){_0x3fe1ce=_0x3ed3b0;_0x1606f5=0xc8;}else{_0x1606f5=0xce;}_0x2b36c0[_0x128b('0x1d')](_0x1606f5);return _0x2b36c0[_0x128b('0x23')]('Content-Range',_0x5ea8d6+'-'+_0x3fe1ce+'/'+_0x3ed3b0)['json'](_0x2f04a5);}return null;};}function patchUpdates(_0x39bc81){return function(_0x390c80){try{jsonpatch[_0x128b('0x24')](_0x390c80,_0x39bc81,!![]);}catch(_0x1e4503){return BPromise[_0x128b('0x25')](_0x1e4503);}return _0x390c80[_0x128b('0x26')]();};}function saveUpdates(_0x182692,_0x5c5307){return function(_0x51d17c){if(_0x51d17c){return _0x51d17c[_0x128b('0x27')](_0x182692)[_0x128b('0x28')](function(_0x25bb95){return _0x25bb95;});}return null;};}function removeEntity(_0x224c70,_0x2fb086){return function(_0x5923ab){if(_0x5923ab){return _0x5923ab['destroy']()[_0x128b('0x28')](function(){_0x224c70[_0x128b('0x1d')](0xcc)[_0x128b('0x1e')]();});}};}function handleEntityNotFound(_0x4a6a0d,_0x10e736){return function(_0xc0797a){if(!_0xc0797a){_0x4a6a0d['sendStatus'](0x194);}return _0xc0797a;};}function handleError(_0x9cbaae,_0x3a904c){_0x3a904c=_0x3a904c||0x1f4;return function(_0x2a512a){logger[_0x128b('0x29')](_0x2a512a[_0x128b('0x2a')]);if(_0x2a512a[_0x128b('0x2b')]){delete _0x2a512a[_0x128b('0x2b')];}_0x9cbaae[_0x128b('0x1d')](_0x3a904c)[_0x128b('0x2c')](_0x2a512a);};}exports['show']=function(_0x9008c4,_0x286e6f){var _0x148945={'raw':![],'where':{'id':_0x9008c4['params']['id']}},_0x145a6d={};_0x145a6d['model']=_['keys'](db[_0x128b('0x2d')][_0x128b('0x2e')]);_0x145a6d[_0x128b('0x2f')]=_[_0x128b('0x30')](_0x9008c4[_0x128b('0x2f')]);_0x145a6d[_0x128b('0x31')]=_[_0x128b('0x32')](_0x145a6d[_0x128b('0x33')],_0x145a6d[_0x128b('0x2f')]);_0x148945['attributes']=_['intersection'](_0x145a6d['model'],qs[_0x128b('0x34')](_0x9008c4['query'][_0x128b('0x34')]));_0x148945[_0x128b('0x35')]=_0x148945[_0x128b('0x35')][_0x128b('0x36')]?_0x148945[_0x128b('0x35')]:_0x145a6d['model'];if(_0x9008c4[_0x128b('0x2f')][_0x128b('0x37')]){_0x148945[_0x128b('0x38')]=[{'all':!![]}];}_0x148945=_[_0x128b('0x39')]({},_0x148945,_0x9008c4[_0x128b('0x3a')]);return db['DashboardItem'][_0x128b('0x3b')](_0x148945)[_0x128b('0x28')](handleEntityNotFound(_0x286e6f,null))[_0x128b('0x28')](respondWithResult(_0x286e6f,null))[_0x128b('0x3c')](handleError(_0x286e6f,null));};exports['destroy']=function(_0x40b7b3,_0x6ac474){return db[_0x128b('0x2d')][_0x128b('0x3b')]({'where':{'id':_0x40b7b3[_0x128b('0x3d')]['id']}})[_0x128b('0x28')](handleEntityNotFound(_0x6ac474,null))['then'](removeEntity(_0x6ac474,null))['catch'](handleError(_0x6ac474,null));};function widgetAttributes(_0x2fa7aa){try{switch(_0x2fa7aa[_0x128b('0x3e')]){case _0x128b('0x3f'):return[{'name':'attrUrl','value':_0x2fa7aa[_0x128b('0x40')]||(_0x2fa7aa['attrs']&&_0x2fa7aa[_0x128b('0x41')][0x0]?_0x2fa7aa[_0x128b('0x41')][0x0][_0x128b('0x42')]:undefined)||_0x128b('0x43')}];case'custom':return[{'name':_0x128b('0x44'),'value':_0x2fa7aa[_0x128b('0x44')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x0]?_0x2fa7aa[_0x128b('0x41')][0x0][_0x128b('0x42')]:undefined)||''}];case'clock':return[{'name':_0x128b('0x45'),'value':_0x2fa7aa[_0x128b('0x45')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa['attrs'][0x0]?_0x2fa7aa['attrs'][0x0][_0x128b('0x42')]:undefined)||_0x128b('0x46')},{'name':_0x128b('0x47'),'value':_0x2fa7aa[_0x128b('0x47')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x1]?_0x2fa7aa['attrs'][0x1]['value']:undefined)||_0x128b('0x48')},{'name':_0x128b('0x49'),'value':_0x2fa7aa[_0x128b('0x49')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa['attrs'][0x2]?_0x2fa7aa[_0x128b('0x41')][0x2][_0x128b('0x42')]:undefined)||0xc}];case _0x128b('0x4a'):return[{'name':_0x128b('0x4b'),'value':_0x2fa7aa['attrMetric']||(_0x2fa7aa['attrs']&&_0x2fa7aa['attrs'][0x0]?_0x2fa7aa['attrs'][0x0][_0x128b('0x42')]:undefined)||_0x128b('0x4c')},{'name':_0x128b('0x4d'),'value':_0x2fa7aa[_0x128b('0x4d')]||(_0x2fa7aa['attrs']&&_0x2fa7aa[_0x128b('0x41')][0x1]?_0x2fa7aa['attrs'][0x1]['value']:undefined)||[]},{'name':_0x128b('0x49'),'value':_0x2fa7aa[_0x128b('0x49')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x2]?_0x2fa7aa['attrs'][0x2][_0x128b('0x42')]:undefined)||0x14},{'name':_0x128b('0x4e'),'value':_0x2fa7aa[_0x128b('0x4e')]||(_0x2fa7aa['attrs']&&_0x2fa7aa[_0x128b('0x41')][0x3]?_0x2fa7aa[_0x128b('0x41')][0x3][_0x128b('0x42')]:undefined)||_0x128b('0x4f')},{'name':_0x128b('0x50'),'value':_0x2fa7aa['attrEmailAccounts']||(_0x2fa7aa['attrs']&&_0x2fa7aa['attrs'][0x4]?_0x2fa7aa['attrs'][0x4][_0x128b('0x42')]:undefined)||''},{'name':_0x128b('0x51'),'value':_0x2fa7aa['attrFaxAccounts']||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x5]?_0x2fa7aa[_0x128b('0x41')][0x5][_0x128b('0x42')]:undefined)||''},{'name':_0x128b('0x52'),'value':_0x2fa7aa['attrSmsAccounts']||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x6]?_0x2fa7aa[_0x128b('0x41')][0x6][_0x128b('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2fa7aa[_0x128b('0x53')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x7]?_0x2fa7aa[_0x128b('0x41')][0x7][_0x128b('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2fa7aa[_0x128b('0x54')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x8]?_0x2fa7aa['attrs'][0x8][_0x128b('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2fa7aa[_0x128b('0x55')]||(_0x2fa7aa['attrs']&&_0x2fa7aa['attrs'][0x9]?_0x2fa7aa[_0x128b('0x41')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0x128b('0x56'):return[{'name':_0x128b('0x57'),'value':_0x2fa7aa[_0x128b('0x57')]||(_0x2fa7aa['attrs']&&_0x2fa7aa['attrs'][0x0]?_0x2fa7aa['attrs'][0x0][_0x128b('0x42')]:undefined)||_0x128b('0x4c')},{'name':_0x128b('0x58'),'value':_0x2fa7aa[_0x128b('0x58')]||(_0x2fa7aa['attrs']&&_0x2fa7aa[_0x128b('0x41')][0x1]?_0x2fa7aa[_0x128b('0x41')][0x1]['value']:undefined)||null},{'name':_0x128b('0x59'),'value':_0x2fa7aa['attrSerie3']||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x2]?_0x2fa7aa[_0x128b('0x41')][0x2][_0x128b('0x42')]:undefined)||null},{'name':_0x128b('0x4d'),'value':_0x2fa7aa[_0x128b('0x4d')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x3]?_0x2fa7aa[_0x128b('0x41')][0x3][_0x128b('0x42')]:undefined)||[]},{'name':_0x128b('0x4e'),'value':_0x2fa7aa[_0x128b('0x4e')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x4]?_0x2fa7aa[_0x128b('0x41')][0x4][_0x128b('0x42')]:undefined)||'voice'},{'name':_0x128b('0x50'),'value':_0x2fa7aa[_0x128b('0x50')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x5]?_0x2fa7aa[_0x128b('0x41')][0x5][_0x128b('0x42')]:undefined)||''},{'name':_0x128b('0x51'),'value':_0x2fa7aa[_0x128b('0x51')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x6]?_0x2fa7aa[_0x128b('0x41')][0x6][_0x128b('0x42')]:undefined)||''},{'name':_0x128b('0x52'),'value':_0x2fa7aa[_0x128b('0x52')]||(_0x2fa7aa['attrs']&&_0x2fa7aa[_0x128b('0x41')][0x7]?_0x2fa7aa[_0x128b('0x41')][0x7]['value']:undefined)||''},{'name':_0x128b('0x53'),'value':_0x2fa7aa[_0x128b('0x53')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x8]?_0x2fa7aa[_0x128b('0x41')][0x8][_0x128b('0x42')]:undefined)||''},{'name':_0x128b('0x54'),'value':_0x2fa7aa[_0x128b('0x54')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa['attrs'][0x9]?_0x2fa7aa[_0x128b('0x41')][0x9][_0x128b('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2fa7aa[_0x128b('0x55')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0xa]?_0x2fa7aa['attrs'][0xa][_0x128b('0x42')]:undefined)||''}];case _0x128b('0x5a'):return[{'name':_0x128b('0x5b'),'type':_0x2fa7aa[_0x128b('0x5c')]||(_0x2fa7aa['attrs']&&_0x2fa7aa[_0x128b('0x41')][0x0]?_0x2fa7aa[_0x128b('0x41')][0x0][_0x128b('0x3e')]:undefined)||null,'value':_0x2fa7aa[_0x128b('0x5b')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa[_0x128b('0x41')][0x0]?_0x2fa7aa[_0x128b('0x41')][0x0][_0x128b('0x42')]:undefined)||null},{'name':'attrRefresh','value':_0x2fa7aa[_0x128b('0x5d')]||(_0x2fa7aa[_0x128b('0x41')]&&_0x2fa7aa['attrs'][0x1]?_0x2fa7aa[_0x128b('0x41')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2921b8){logger[_0x128b('0x29')]('widgetAttributes:\x20%s',JSON[_0x128b('0x5e')](_0x2921b8));return[];}}exports[_0x128b('0x5f')]=function(_0x3921ab,_0x33093a){if(_0x3921ab[_0x128b('0x60')]){_0x3921ab[_0x128b('0x60')][_0x128b('0x41')]=widgetAttributes(_0x3921ab[_0x128b('0x60')]);}return db[_0x128b('0x2d')][_0x128b('0x5f')](_0x3921ab['body'],{})['then'](respondWithResult(_0x33093a,0xc9))[_0x128b('0x3c')](handleError(_0x33093a,null));};exports['update']=function(_0x3ee8ae,_0x199ebb){if(_0x3ee8ae['body']['id']){delete _0x3ee8ae[_0x128b('0x60')]['id'];}_0x3ee8ae[_0x128b('0x60')]['attrs']=widgetAttributes(_0x3ee8ae['body']);return db['DashboardItem'][_0x128b('0x3b')]({'where':{'id':_0x3ee8ae['params']['id']}})[_0x128b('0x28')](handleEntityNotFound(_0x199ebb,null))[_0x128b('0x28')](saveUpdates(_0x3ee8ae[_0x128b('0x60')],null))['then'](respondWithResult(_0x199ebb,null))[_0x128b('0x3c')](handleError(_0x199ebb,null));}; \ No newline at end of file +var _0x78d3=['total','attrVoiceQueues','attrChannel','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrEmailAccounts','web-report','attrReport','reportType','attrRefresh','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','length','options','find','catch','type','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric'];(function(_0x83f401,_0x3f9b4c){var _0x31783e=function(_0x4c8061){while(--_0x4c8061){_0x83f401['push'](_0x83f401['shift']());}};_0x31783e(++_0x3f9b4c);}(_0x78d3,0x73));var _0x378d=function(_0x4f1450,_0xc8f1c7){_0x4f1450=_0x4f1450-0x0;var _0x3201b8=_0x78d3[_0x4f1450];return _0x3201b8;};'use strict';var emlformat=require(_0x378d('0x0'));var rimraf=require(_0x378d('0x1'));var zipdir=require(_0x378d('0x2'));var jsonpatch=require(_0x378d('0x3'));var rp=require(_0x378d('0x4'));var moment=require(_0x378d('0x5'));var BPromise=require(_0x378d('0x6'));var Mustache=require(_0x378d('0x7'));var util=require(_0x378d('0x8'));var path=require(_0x378d('0x9'));var sox=require(_0x378d('0xa'));var csv=require(_0x378d('0xb'));var ejs=require(_0x378d('0xc'));var fs=require('fs');var fs_extra=require(_0x378d('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x378d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x378d('0xf'));var toCsv=require(_0x378d('0xb'));var querystring=require(_0x378d('0x10'));var Papa=require(_0x378d('0x11'));var Redis=require(_0x378d('0x12'));var authService=require(_0x378d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x378d('0x14'));var hardwareService=require(_0x378d('0x15'));var logger=require(_0x378d('0x16'))('api');var utils=require(_0x378d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x378d('0x18'))['db'];config[_0x378d('0x19')]=_['defaults'](config[_0x378d('0x19')],{'host':_0x378d('0x1a'),'port':0x18eb});var socket=require(_0x378d('0x1b'))(new Redis(config['redis']));require(_0x378d('0x1c'))['register'](socket);function respondWithStatusCode(_0x756450,_0x331f32){_0x331f32=_0x331f32||0xcc;return function(_0x1f2f89){if(_0x1f2f89){return _0x756450[_0x378d('0x1d')](_0x331f32);}return _0x756450[_0x378d('0x1e')](_0x331f32)['end']();};}function respondWithResult(_0x46856f,_0x4ae722){_0x4ae722=_0x4ae722||0xc8;return function(_0x2f24dc){if(_0x2f24dc){return _0x46856f[_0x378d('0x1e')](_0x4ae722)[_0x378d('0x1f')](_0x2f24dc);}};}function respondWithFilteredResult(_0x254ff5,_0x300b21){return function(_0x50ce98){if(_0x50ce98){var _0x4294fc=typeof _0x300b21['offset']===_0x378d('0x20')&&typeof _0x300b21[_0x378d('0x21')]===_0x378d('0x20');var _0x1d2852=_0x50ce98[_0x378d('0x22')];var _0x11584b=_0x4294fc?0x0:_0x300b21[_0x378d('0x23')];var _0x521d40=_0x4294fc?_0x50ce98['count']:_0x300b21[_0x378d('0x23')]+_0x300b21[_0x378d('0x21')];var _0x48b7f9;if(_0x521d40>=_0x1d2852){_0x521d40=_0x1d2852;_0x48b7f9=0xc8;}else{_0x48b7f9=0xce;}_0x254ff5[_0x378d('0x1e')](_0x48b7f9);return _0x254ff5[_0x378d('0x24')](_0x378d('0x25'),_0x11584b+'-'+_0x521d40+'/'+_0x1d2852)[_0x378d('0x1f')](_0x50ce98);}return null;};}function patchUpdates(_0x3acdf9){return function(_0x5e43a2){try{jsonpatch[_0x378d('0x26')](_0x5e43a2,_0x3acdf9,!![]);}catch(_0x4f43a6){return BPromise[_0x378d('0x27')](_0x4f43a6);}return _0x5e43a2[_0x378d('0x28')]();};}function saveUpdates(_0x3f2ebc,_0x57e2b2){return function(_0x330354){if(_0x330354){return _0x330354[_0x378d('0x29')](_0x3f2ebc)[_0x378d('0x2a')](function(_0x5e515d){return _0x5e515d;});}return null;};}function removeEntity(_0x20e5e6,_0x22fee7){return function(_0x36dbca){if(_0x36dbca){return _0x36dbca[_0x378d('0x2b')]()[_0x378d('0x2a')](function(){_0x20e5e6[_0x378d('0x1e')](0xcc)[_0x378d('0x2c')]();});}};}function handleEntityNotFound(_0x34ffa7,_0x5724f9){return function(_0x564f8a){if(!_0x564f8a){_0x34ffa7[_0x378d('0x1d')](0x194);}return _0x564f8a;};}function handleError(_0x5e0e5b,_0x1def01){_0x1def01=_0x1def01||0x1f4;return function(_0x292b73){logger[_0x378d('0x2d')](_0x292b73[_0x378d('0x2e')]);if(_0x292b73['name']){delete _0x292b73['name'];}_0x5e0e5b[_0x378d('0x1e')](_0x1def01)['send'](_0x292b73);};}exports['show']=function(_0x50b45e,_0x3e1dac){var _0x49722a={'raw':![],'where':{'id':_0x50b45e[_0x378d('0x2f')]['id']}},_0x4d1de5={};_0x4d1de5['model']=_[_0x378d('0x30')](db[_0x378d('0x31')][_0x378d('0x32')]);_0x4d1de5['query']=_[_0x378d('0x30')](_0x50b45e[_0x378d('0x33')]);_0x4d1de5[_0x378d('0x34')]=_[_0x378d('0x35')](_0x4d1de5[_0x378d('0x36')],_0x4d1de5['query']);_0x49722a[_0x378d('0x37')]=_[_0x378d('0x35')](_0x4d1de5[_0x378d('0x36')],qs[_0x378d('0x38')](_0x50b45e['query'][_0x378d('0x38')]));_0x49722a['attributes']=_0x49722a['attributes'][_0x378d('0x39')]?_0x49722a[_0x378d('0x37')]:_0x4d1de5['model'];if(_0x50b45e[_0x378d('0x33')]['includeAll']){_0x49722a['include']=[{'all':!![]}];}_0x49722a=_['merge']({},_0x49722a,_0x50b45e[_0x378d('0x3a')]);return db[_0x378d('0x31')][_0x378d('0x3b')](_0x49722a)[_0x378d('0x2a')](handleEntityNotFound(_0x3e1dac,null))[_0x378d('0x2a')](respondWithResult(_0x3e1dac,null))['catch'](handleError(_0x3e1dac,null));};exports[_0x378d('0x2b')]=function(_0x128d20,_0x3a4430){return db['DashboardItem'][_0x378d('0x3b')]({'where':{'id':_0x128d20[_0x378d('0x2f')]['id']}})[_0x378d('0x2a')](handleEntityNotFound(_0x3a4430,null))['then'](removeEntity(_0x3a4430,null))[_0x378d('0x3c')](handleError(_0x3a4430,null));};function widgetAttributes(_0x480f48){try{switch(_0x480f48[_0x378d('0x3d')]){case'iframe':return[{'name':'attrUrl','value':_0x480f48[_0x378d('0x3e')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x0]?_0x480f48[_0x378d('0x3f')][0x0][_0x378d('0x40')]:undefined)||_0x378d('0x41')}];case'custom':return[{'name':'attrPath','value':_0x480f48[_0x378d('0x42')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x0]?_0x480f48[_0x378d('0x3f')][0x0][_0x378d('0x40')]:undefined)||''}];case _0x378d('0x43'):return[{'name':_0x378d('0x44'),'value':_0x480f48[_0x378d('0x44')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x0]?_0x480f48[_0x378d('0x3f')][0x0][_0x378d('0x40')]:undefined)||_0x378d('0x45')},{'name':'attrTimezone','value':_0x480f48[_0x378d('0x46')]||(_0x480f48['attrs']&&_0x480f48['attrs'][0x1]?_0x480f48[_0x378d('0x3f')][0x1]['value']:undefined)||_0x378d('0x47')},{'name':_0x378d('0x48'),'value':_0x480f48['attrFontSize']||(_0x480f48['attrs']&&_0x480f48['attrs'][0x2]?_0x480f48[_0x378d('0x3f')][0x2][_0x378d('0x40')]:undefined)||0xc}];case _0x378d('0x49'):return[{'name':'attrMetric','value':_0x480f48[_0x378d('0x4a')]||(_0x480f48['attrs']&&_0x480f48[_0x378d('0x3f')][0x0]?_0x480f48[_0x378d('0x3f')][0x0][_0x378d('0x40')]:undefined)||_0x378d('0x4b')},{'name':'attrVoiceQueues','value':_0x480f48[_0x378d('0x4c')]||(_0x480f48['attrs']&&_0x480f48[_0x378d('0x3f')][0x1]?_0x480f48[_0x378d('0x3f')][0x1][_0x378d('0x40')]:undefined)||[]},{'name':_0x378d('0x48'),'value':_0x480f48[_0x378d('0x48')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0x2]?_0x480f48['attrs'][0x2][_0x378d('0x40')]:undefined)||0x14},{'name':_0x378d('0x4d'),'value':_0x480f48[_0x378d('0x4d')]||(_0x480f48['attrs']&&_0x480f48['attrs'][0x3]?_0x480f48[_0x378d('0x3f')][0x3]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x480f48['attrEmailAccounts']||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x4]?_0x480f48[_0x378d('0x3f')][0x4][_0x378d('0x40')]:undefined)||''},{'name':_0x378d('0x4e'),'value':_0x480f48['attrFaxAccounts']||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x5]?_0x480f48['attrs'][0x5]['value']:undefined)||''},{'name':_0x378d('0x4f'),'value':_0x480f48[_0x378d('0x4f')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x6]?_0x480f48[_0x378d('0x3f')][0x6][_0x378d('0x40')]:undefined)||''},{'name':_0x378d('0x50'),'value':_0x480f48[_0x378d('0x50')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x7]?_0x480f48['attrs'][0x7][_0x378d('0x40')]:undefined)||''},{'name':_0x378d('0x51'),'value':_0x480f48[_0x378d('0x51')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0x8]?_0x480f48[_0x378d('0x3f')][0x8][_0x378d('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x480f48[_0x378d('0x52')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0x9]?_0x480f48[_0x378d('0x3f')][0x9]['value']:undefined)||''}];case _0x378d('0x53'):case'pie-chart':return[{'name':_0x378d('0x54'),'value':_0x480f48[_0x378d('0x54')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x0]?_0x480f48[_0x378d('0x3f')][0x0][_0x378d('0x40')]:undefined)||_0x378d('0x4b')},{'name':_0x378d('0x55'),'value':_0x480f48[_0x378d('0x55')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0x1]?_0x480f48[_0x378d('0x3f')][0x1][_0x378d('0x40')]:undefined)||null},{'name':_0x378d('0x56'),'value':_0x480f48[_0x378d('0x56')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0x2]?_0x480f48[_0x378d('0x3f')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x480f48[_0x378d('0x4c')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x3]?_0x480f48[_0x378d('0x3f')][0x3][_0x378d('0x40')]:undefined)||[]},{'name':'attrChannel','value':_0x480f48[_0x378d('0x4d')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x4]?_0x480f48[_0x378d('0x3f')][0x4][_0x378d('0x40')]:undefined)||_0x378d('0x57')},{'name':_0x378d('0x58'),'value':_0x480f48[_0x378d('0x58')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x5]?_0x480f48['attrs'][0x5][_0x378d('0x40')]:undefined)||''},{'name':_0x378d('0x4e'),'value':_0x480f48[_0x378d('0x4e')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0x6]?_0x480f48[_0x378d('0x3f')][0x6]['value']:undefined)||''},{'name':_0x378d('0x4f'),'value':_0x480f48[_0x378d('0x4f')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x7]?_0x480f48['attrs'][0x7][_0x378d('0x40')]:undefined)||''},{'name':_0x378d('0x50'),'value':_0x480f48[_0x378d('0x50')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x8]?_0x480f48['attrs'][0x8][_0x378d('0x40')]:undefined)||''},{'name':_0x378d('0x51'),'value':_0x480f48['attrWhatsappAccounts']||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x9]?_0x480f48[_0x378d('0x3f')][0x9][_0x378d('0x40')]:undefined)||''},{'name':_0x378d('0x52'),'value':_0x480f48['attrChatWebsites']||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0xa]?_0x480f48[_0x378d('0x3f')][0xa]['value']:undefined)||''}];case _0x378d('0x59'):return[{'name':_0x378d('0x5a'),'type':_0x480f48[_0x378d('0x5b')]||(_0x480f48['attrs']&&_0x480f48['attrs'][0x0]?_0x480f48[_0x378d('0x3f')][0x0][_0x378d('0x3d')]:undefined)||null,'value':_0x480f48[_0x378d('0x5a')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48[_0x378d('0x3f')][0x0]?_0x480f48[_0x378d('0x3f')][0x0][_0x378d('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x480f48[_0x378d('0x5c')]||(_0x480f48[_0x378d('0x3f')]&&_0x480f48['attrs'][0x1]?_0x480f48[_0x378d('0x3f')][0x1][_0x378d('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x244775){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x244775));return[];}}exports[_0x378d('0x5d')]=function(_0x4e0665,_0x5739e9){if(_0x4e0665[_0x378d('0x5e')]){_0x4e0665[_0x378d('0x5e')][_0x378d('0x3f')]=widgetAttributes(_0x4e0665[_0x378d('0x5e')]);}return db[_0x378d('0x31')][_0x378d('0x5d')](_0x4e0665[_0x378d('0x5e')],{})[_0x378d('0x2a')](respondWithResult(_0x5739e9,0xc9))[_0x378d('0x3c')](handleError(_0x5739e9,null));};exports[_0x378d('0x29')]=function(_0x18a913,_0x5156ad){if(_0x18a913[_0x378d('0x5e')]['id']){delete _0x18a913[_0x378d('0x5e')]['id'];}_0x18a913[_0x378d('0x5e')][_0x378d('0x3f')]=widgetAttributes(_0x18a913['body']);return db[_0x378d('0x31')][_0x378d('0x3b')]({'where':{'id':_0x18a913[_0x378d('0x2f')]['id']}})[_0x378d('0x2a')](handleEntityNotFound(_0x5156ad,null))[_0x378d('0x2a')](saveUpdates(_0x18a913[_0x378d('0x5e')],null))[_0x378d('0x2a')](respondWithResult(_0x5156ad,null))['catch'](handleError(_0x5156ad,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 766ee55..ab34589 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 _0x0c14=['../../mysqldb','DashboardItem','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x46eafd,_0xc04d8e){var _0x11cb9e=function(_0x8e519){while(--_0x8e519){_0x46eafd['push'](_0x46eafd['shift']());}};_0x11cb9e(++_0xc04d8e);}(_0x0c14,0xc7));var _0x40c1=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x0c14[_0x1f9f37];return _0x21c080;};'use strict';var EventEmitter=require(_0x40c1('0x0'));var DashboardItem=require(_0x40c1('0x1'))['db'][_0x40c1('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x40c1('0x3')};function emitEvent(_0x555b78){return function(_0x11f058,_0x56c463,_0x2bcf5e){DashboardItemEvents[_0x40c1('0x4')](_0x555b78+':'+_0x11f058['id'],_0x11f058);DashboardItemEvents[_0x40c1('0x4')](_0x555b78,_0x11f058);_0x2bcf5e(null);};}for(var e in events){if(events[_0x40c1('0x5')](e)){var event=events[e];DashboardItem[_0x40c1('0x6')](e,emitEvent(event));}}module[_0x40c1('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xb06b=['DashboardItem','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x16f4ee,_0x5091c8){var _0x4029ce=function(_0x22bdde){while(--_0x22bdde){_0x16f4ee['push'](_0x16f4ee['shift']());}};_0x4029ce(++_0x5091c8);}(_0xb06b,0x1b6));var _0xbb06=function(_0x2aad6b,_0x2eb08f){_0x2aad6b=_0x2aad6b-0x0;var _0x3cdf57=_0xb06b[_0x2aad6b];return _0x3cdf57;};'use strict';var EventEmitter=require(_0xbb06('0x0'));var DashboardItem=require(_0xbb06('0x1'))['db'][_0xbb06('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbb06('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb06('0x4'),'afterDestroy':_0xbb06('0x5')};function emitEvent(_0x209415){return function(_0x3a73f6,_0x3a9b5f,_0x18d1da){DashboardItemEvents['emit'](_0x209415+':'+_0x3a73f6['id'],_0x3a73f6);DashboardItemEvents[_0xbb06('0x6')](_0x209415,_0x3a73f6);_0x18d1da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xbb06('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index d10a9fd..b6ddbe0 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 _0x7717=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x7717,0x11f));var _0x7771=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7717[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7771('0x0'));var util=require(_0x7771('0x1'));var logger=require(_0x7771('0x2'))('api');var moment=require(_0x7771('0x3'));var BPromise=require(_0x7771('0x4'));var rp=require(_0x7771('0x5'));var fs=require('fs');var path=require(_0x7771('0x6'));var rimraf=require(_0x7771('0x7'));var config=require('../../config/environment');var attributes=require(_0x7771('0x8'));module[_0x7771('0x9')]=function(_0x563346,_0x2f0f49){return _0x563346[_0x7771('0xa')](_0x7771('0xb'),attributes,{'tableName':_0x7771('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1233=['define','dashboard_items','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x482d63,_0x3715c3){var _0x3dfdf7=function(_0xe6e7f3){while(--_0xe6e7f3){_0x482d63['push'](_0x482d63['shift']());}};_0x3dfdf7(++_0x3715c3);}(_0x1233,0x1ca));var _0x3123=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0x1233[_0x45b1ba];return _0x145ddb;};'use strict';var _=require('lodash');var util=require(_0x3123('0x0'));var logger=require(_0x3123('0x1'))('api');var moment=require(_0x3123('0x2'));var BPromise=require(_0x3123('0x3'));var rp=require(_0x3123('0x4'));var fs=require('fs');var path=require(_0x3123('0x5'));var rimraf=require(_0x3123('0x6'));var config=require(_0x3123('0x7'));var attributes=require(_0x3123('0x8'));module[_0x3123('0x9')]=function(_0x2e568b,_0x321a81){return _0x2e568b[_0x3123('0xa')]('DashboardItem',attributes,{'tableName':_0x3123('0xb'),'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 147ce91..236f1a2 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 _0x22e8=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x22e8,0x9b));var _0x822e=function(_0x2391ff,_0x3bd8f0){_0x2391ff=_0x2391ff-0x0;var _0x31a79f=_0x22e8[_0x2391ff];return _0x31a79f;};'use strict';var _=require(_0x822e('0x0'));var util=require(_0x822e('0x1'));var moment=require(_0x822e('0x2'));var BPromise=require(_0x822e('0x3'));var rs=require(_0x822e('0x4'));var fs=require('fs');var Redis=require(_0x822e('0x5'));var db=require(_0x822e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x822e('0x7'))(_0x822e('0x8'));var config=require(_0x822e('0x9'));var jayson=require(_0x822e('0xa'));var client=jayson[_0x822e('0xb')][_0x822e('0xc')]({'port':0x232a});config[_0x822e('0xd')]=_[_0x822e('0xe')](config[_0x822e('0xd')],{'host':_0x822e('0xf'),'port':0x18eb});var socket=require(_0x822e('0x10'))(new Redis(config['redis']));require(_0x822e('0x11'))[_0x822e('0x12')](socket);function respondWithRpcPromise(_0x282a21,_0x251b79,_0x197dde){return new BPromise(function(_0x510a29,_0x5b4bf1){return client[_0x822e('0x13')](_0x282a21,_0x197dde)[_0x822e('0x14')](function(_0x49dc07){logger[_0x822e('0x15')](_0x822e('0x16'),_0x251b79,'request\x20sent');logger[_0x822e('0x17')](_0x822e('0x18'),_0x251b79,'request\x20sent',JSON[_0x822e('0x19')](_0x49dc07));if(_0x49dc07['error']){if(_0x49dc07[_0x822e('0x1a')]['code']===0x1f4){logger[_0x822e('0x1a')](_0x822e('0x16'),_0x251b79,_0x49dc07['error'][_0x822e('0x1b')]);return _0x5b4bf1(_0x49dc07['error'][_0x822e('0x1b')]);}logger[_0x822e('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x251b79,_0x49dc07[_0x822e('0x1a')]['message']);return _0x510a29(_0x49dc07[_0x822e('0x1a')][_0x822e('0x1b')]);}else{logger[_0x822e('0x15')](_0x822e('0x16'),_0x251b79,_0x822e('0x1c'));_0x510a29(_0x49dc07[_0x822e('0x1d')][_0x822e('0x1b')]);}})[_0x822e('0x1e')](function(_0x4a7424){logger[_0x822e('0x1a')](_0x822e('0x16'),_0x251b79,_0x4a7424);_0x5b4bf1(_0x4a7424);});});} \ No newline at end of file +var _0xeb73=['localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeb73,0x115));var _0x3eb7=function(_0x94dd49,_0x2661bc){_0x94dd49=_0x94dd49-0x0;var _0x44571f=_0xeb73[_0x94dd49];return _0x44571f;};'use strict';var _=require(_0x3eb7('0x0'));var util=require(_0x3eb7('0x1'));var moment=require(_0x3eb7('0x2'));var BPromise=require(_0x3eb7('0x3'));var rs=require(_0x3eb7('0x4'));var fs=require('fs');var Redis=require(_0x3eb7('0x5'));var db=require(_0x3eb7('0x6'))['db'];var utils=require(_0x3eb7('0x7'));var logger=require(_0x3eb7('0x8'))(_0x3eb7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3eb7('0xa')][_0x3eb7('0xb')]({'port':0x232a});config[_0x3eb7('0xc')]=_['defaults'](config['redis'],{'host':_0x3eb7('0xd'),'port':0x18eb});var socket=require(_0x3eb7('0xe'))(new Redis(config['redis']));require(_0x3eb7('0xf'))[_0x3eb7('0x10')](socket);function respondWithRpcPromise(_0x13422d,_0x36d4d6,_0x2e33de){return new BPromise(function(_0x397476,_0x1dd9e6){return client[_0x3eb7('0x11')](_0x13422d,_0x2e33de)[_0x3eb7('0x12')](function(_0x196c1f){logger[_0x3eb7('0x13')](_0x3eb7('0x14'),_0x36d4d6,_0x3eb7('0x15'));logger[_0x3eb7('0x16')](_0x3eb7('0x17'),_0x36d4d6,'request\x20sent',JSON[_0x3eb7('0x18')](_0x196c1f));if(_0x196c1f[_0x3eb7('0x19')]){if(_0x196c1f[_0x3eb7('0x19')][_0x3eb7('0x1a')]===0x1f4){logger[_0x3eb7('0x19')]('DashboardItem,\x20%s,\x20%s',_0x36d4d6,_0x196c1f[_0x3eb7('0x19')][_0x3eb7('0x1b')]);return _0x1dd9e6(_0x196c1f[_0x3eb7('0x19')][_0x3eb7('0x1b')]);}logger['error'](_0x3eb7('0x14'),_0x36d4d6,_0x196c1f[_0x3eb7('0x19')][_0x3eb7('0x1b')]);return _0x397476(_0x196c1f[_0x3eb7('0x19')][_0x3eb7('0x1b')]);}else{logger['info'](_0x3eb7('0x14'),_0x36d4d6,_0x3eb7('0x15'));_0x397476(_0x196c1f['result']['message']);}})[_0x3eb7('0x1c')](function(_0x51689a){logger[_0x3eb7('0x19')]('DashboardItem,\x20%s,\x20%s',_0x36d4d6,_0x51689a);_0x1dd9e6(_0x51689a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 48bb4db..1e329ac 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 _0xf237=['save','remove','update','removeListener','register','length','./dashboardItem.events'];(function(_0x345365,_0x49eb25){var _0x4d0ef0=function(_0xbc78ca){while(--_0xbc78ca){_0x345365['push'](_0x345365['shift']());}};_0x4d0ef0(++_0x49eb25);}(_0xf237,0x180));var _0x7f23=function(_0x5cb997,_0x2d4835){_0x5cb997=_0x5cb997-0x0;var _0x33bac3=_0xf237[_0x5cb997];return _0x33bac3;};'use strict';var DashboardItemEvents=require(_0x7f23('0x0'));var events=[_0x7f23('0x1'),_0x7f23('0x2'),_0x7f23('0x3')];function createListener(_0x31c4b1,_0x3a9c1d){return function(_0x7ddd97){_0x3a9c1d['emit'](_0x31c4b1,_0x7ddd97);};}function removeListener(_0x22b26b,_0x24718d){return function(){DashboardItemEvents[_0x7f23('0x4')](_0x22b26b,_0x24718d);};}exports[_0x7f23('0x5')]=function(_0xc54f32){for(var _0x3e4116=0x0,_0x158c52=events[_0x7f23('0x6')];_0x3e4116<_0x158c52;_0x3e4116++){var _0x3f3276=events[_0x3e4116];var _0x323c68=createListener('dashboardItem:'+_0x3f3276,_0xc54f32);DashboardItemEvents['on'](_0x3f3276,_0x323c68);}}; \ No newline at end of file +var _0xc111=['register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x2b26c7,_0x1242c4){var _0x47eaa0=function(_0x39dad6){while(--_0x39dad6){_0x2b26c7['push'](_0x2b26c7['shift']());}};_0x47eaa0(++_0x1242c4);}(_0xc111,0x1e3));var _0x1c11=function(_0x401708,_0x265745){_0x401708=_0x401708-0x0;var _0x115566=_0xc111[_0x401708];return _0x115566;};'use strict';var DashboardItemEvents=require(_0x1c11('0x0'));var events=[_0x1c11('0x1'),'remove','update'];function createListener(_0x1fab3b,_0x101062){return function(_0x30c670){_0x101062['emit'](_0x1fab3b,_0x30c670);};}function removeListener(_0x1a3726,_0x4abb47){return function(){DashboardItemEvents['removeListener'](_0x1a3726,_0x4abb47);};}exports[_0x1c11('0x2')]=function(_0x5a55c7){for(var _0x388e69=0x0,_0x4222e7=events[_0x1c11('0x3')];_0x388e69<_0x4222e7;_0x388e69++){var _0x226bca=events[_0x388e69];var _0x31495d=createListener(_0x1c11('0x4')+_0x226bca,_0x5a55c7);DashboardItemEvents['on'](_0x226bca,_0x31495d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d3ad7c4..655c74f 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 _0xb618=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','put','destroy'];(function(_0x3a8fac,_0x30d23c){var _0x249970=function(_0x27eee4){while(--_0x27eee4){_0x3a8fac['push'](_0x3a8fac['shift']());}};_0x249970(++_0x30d23c);}(_0xb618,0x188));var _0x8b61=function(_0x3a402c,_0x947df1){_0x3a402c=_0x3a402c-0x0;var _0x396fa6=_0xb618[_0x3a402c];return _0x396fa6;};'use strict';var multer=require(_0x8b61('0x0'));var util=require(_0x8b61('0x1'));var path=require(_0x8b61('0x2'));var timeout=require(_0x8b61('0x3'));var express=require(_0x8b61('0x4'));var router=express[_0x8b61('0x5')]();var fs_extra=require(_0x8b61('0x6'));var auth=require(_0x8b61('0x7'));var interaction=require(_0x8b61('0x8'));var config=require('../../config/environment');var controller=require(_0x8b61('0x9'));router[_0x8b61('0xa')](_0x8b61('0xb'),auth[_0x8b61('0xc')](),controller[_0x8b61('0xd')]);router['post']('/',auth[_0x8b61('0xc')](),controller['create']);router[_0x8b61('0xe')](_0x8b61('0xb'),auth[_0x8b61('0xc')](),controller['update']);router['delete'](_0x8b61('0xb'),auth[_0x8b61('0xc')](),controller[_0x8b61('0xf')]);module[_0x8b61('0x10')]=router; \ No newline at end of file +var _0x78e2=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0x41b2db,_0x4471a3){var _0x3e8830=function(_0x58b425){while(--_0x58b425){_0x41b2db['push'](_0x41b2db['shift']());}};_0x3e8830(++_0x4471a3);}(_0x78e2,0x12e));var _0x278e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78e2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x278e('0x0'));var util=require(_0x278e('0x1'));var path=require(_0x278e('0x2'));var timeout=require(_0x278e('0x3'));var express=require(_0x278e('0x4'));var router=express[_0x278e('0x5')]();var fs_extra=require(_0x278e('0x6'));var auth=require(_0x278e('0x7'));var interaction=require(_0x278e('0x8'));var config=require(_0x278e('0x9'));var controller=require(_0x278e('0xa'));router[_0x278e('0xb')](_0x278e('0xc'),auth['isAuthenticated'](),controller[_0x278e('0xd')]);router[_0x278e('0xe')]('/',auth[_0x278e('0xf')](),controller[_0x278e('0x10')]);router[_0x278e('0x11')](_0x278e('0xc'),auth[_0x278e('0xf')](),controller['update']);router[_0x278e('0x12')](_0x278e('0xc'),auth['isAuthenticated'](),controller[_0x278e('0x13')]);module[_0x278e('0x14')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d3d3cf7..367c2d3 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 _0x6af3=['sequelize','STRING','ENUM','first','third'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6af3,0x1db));var _0x36af=function(_0x3729fa,_0x2f6288){_0x3729fa=_0x3729fa-0x0;var _0xd6563=_0x6af3[_0x3729fa];return _0xd6563;};'use strict';var Sequelize=require(_0x36af('0x0'));module['exports']={'name':{'type':Sequelize[_0x36af('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x36af('0x2')](_0x36af('0x3'),'second',_0x36af('0x4')),'allowNull':![],'defaultValue':_0x36af('0x3')},'description':{'type':Sequelize[_0x36af('0x1')]}}; \ No newline at end of file +var _0xff62=['second','third','sequelize','exports','STRING','ENUM','first'];(function(_0x163d8f,_0x168394){var _0x3f3c38=function(_0x17318e){while(--_0x17318e){_0x163d8f['push'](_0x163d8f['shift']());}};_0x3f3c38(++_0x168394);}(_0xff62,0x136));var _0x2ff6=function(_0x14fe3e,_0x111552){_0x14fe3e=_0x14fe3e-0x0;var _0x49dc1e=_0xff62[_0x14fe3e];return _0x49dc1e;};'use strict';var Sequelize=require(_0x2ff6('0x0'));module[_0x2ff6('0x1')]={'name':{'type':Sequelize[_0x2ff6('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x2ff6('0x3')](_0x2ff6('0x4'),_0x2ff6('0x5'),_0x2ff6('0x6')),'allowNull':![],'defaultValue':_0x2ff6('0x4')},'description':{'type':Sequelize[_0x2ff6('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 986bfef..4cda6f2 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 _0x1fbe=['to-csv','ejs','fs-extra','squel','jsforce','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','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','error','name','send','Disposition','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util'];(function(_0x6da012,_0x5bebca){var _0x5378a0=function(_0x3f8cd0){while(--_0x3f8cd0){_0x6da012['push'](_0x6da012['shift']());}};_0x5378a0(++_0x5bebca);}(_0x1fbe,0xef));var _0xe1fb=function(_0x171b2f,_0x337677){_0x171b2f=_0x171b2f-0x0;var _0x4678d8=_0x1fbe[_0x171b2f];return _0x4678d8;};'use strict';var emlformat=require(_0xe1fb('0x0'));var rimraf=require(_0xe1fb('0x1'));var zipdir=require(_0xe1fb('0x2'));var jsonpatch=require(_0xe1fb('0x3'));var rp=require('request-promise');var moment=require(_0xe1fb('0x4'));var BPromise=require(_0xe1fb('0x5'));var Mustache=require('mustache');var util=require(_0xe1fb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe1fb('0x7'));var ejs=require(_0xe1fb('0x8'));var fs=require('fs');var fs_extra=require(_0xe1fb('0x9'));var _=require('lodash');var squel=require(_0xe1fb('0xa'));var crypto=require('crypto');var jsforce=require(_0xe1fb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe1fb('0x7'));var querystring=require(_0xe1fb('0xc'));var Papa=require(_0xe1fb('0xd'));var Redis=require(_0xe1fb('0xe'));var authService=require(_0xe1fb('0xf'));var qs=require(_0xe1fb('0x10'));var as=require(_0xe1fb('0x11'));var hardwareService=require(_0xe1fb('0x12'));var logger=require(_0xe1fb('0x13'))(_0xe1fb('0x14'));var utils=require('../../config/utils');var config=require(_0xe1fb('0x15'));var licenseUtil=require(_0xe1fb('0x16'));var db=require(_0xe1fb('0x17'))['db'];function respondWithStatusCode(_0x39a809,_0x357062){_0x357062=_0x357062||0xcc;return function(_0x995cd4){if(_0x995cd4){return _0x39a809[_0xe1fb('0x18')](_0x357062);}return _0x39a809[_0xe1fb('0x19')](_0x357062)[_0xe1fb('0x1a')]();};}function respondWithResult(_0x34b6d,_0x5def97){_0x5def97=_0x5def97||0xc8;return function(_0x55b1bd){if(_0x55b1bd){return _0x34b6d[_0xe1fb('0x19')](_0x5def97)[_0xe1fb('0x1b')](_0x55b1bd);}};}function respondWithFilteredResult(_0x2a2524,_0x3c7f58){return function(_0x4b85f2){if(_0x4b85f2){var _0x4fe122=typeof _0x3c7f58[_0xe1fb('0x1c')]===_0xe1fb('0x1d')&&typeof _0x3c7f58[_0xe1fb('0x1e')]===_0xe1fb('0x1d');var _0x13733a=_0x4b85f2['count'];var _0x3546ad=_0x4fe122?0x0:_0x3c7f58['offset'];var _0x220b73=_0x4fe122?_0x4b85f2[_0xe1fb('0x1f')]:_0x3c7f58[_0xe1fb('0x1c')]+_0x3c7f58[_0xe1fb('0x1e')];var _0x372151;if(_0x220b73>=_0x13733a){_0x220b73=_0x13733a;_0x372151=0xc8;}else{_0x372151=0xce;}_0x2a2524[_0xe1fb('0x19')](_0x372151);return _0x2a2524['set'](_0xe1fb('0x20'),_0x3546ad+'-'+_0x220b73+'/'+_0x13733a)[_0xe1fb('0x1b')](_0x4b85f2);}return null;};}function patchUpdates(_0x4a413c){return function(_0x517f6e){try{jsonpatch[_0xe1fb('0x21')](_0x517f6e,_0x4a413c,!![]);}catch(_0x470d8a){return BPromise[_0xe1fb('0x22')](_0x470d8a);}return _0x517f6e[_0xe1fb('0x23')]();};}function saveUpdates(_0x460c34,_0x63aad2){return function(_0x3ec3cb){if(_0x3ec3cb){return _0x3ec3cb['update'](_0x460c34)[_0xe1fb('0x24')](function(_0xdd5e68){return _0xdd5e68;});}return null;};}function removeEntity(_0x5c0905,_0x5d04a7){return function(_0x259758){if(_0x259758){return _0x259758[_0xe1fb('0x25')]()[_0xe1fb('0x24')](function(){var _0x28b9e4=_0x259758[_0xe1fb('0x26')]({'plain':!![]});var _0x325971='Dispositions';return db['UserProfileResource']['destroy']({'where':{'type':_0x325971,'resourceId':_0x28b9e4['id']}})[_0xe1fb('0x24')](function(){return _0x259758;});})['then'](function(){_0x5c0905['status'](0xcc)[_0xe1fb('0x1a')]();});}};}function handleEntityNotFound(_0x59ce2a,_0x382c18){return function(_0x21a6d1){if(!_0x21a6d1){_0x59ce2a[_0xe1fb('0x18')](0x194);}return _0x21a6d1;};}function handleError(_0x32af5d,_0x2cfc71){_0x2cfc71=_0x2cfc71||0x1f4;return function(_0x26c547){logger[_0xe1fb('0x27')](_0x26c547['stack']);if(_0x26c547[_0xe1fb('0x28')]){delete _0x26c547[_0xe1fb('0x28')];}_0x32af5d['status'](_0x2cfc71)[_0xe1fb('0x29')](_0x26c547);};}exports['index']=function(_0x4f51dc,_0x43cb78){var _0x3e3b89={},_0x2b782d={},_0x1394d9={'count':0x0,'rows':[]};var _0x1fef4a=_['map'](db[_0xe1fb('0x2a')][_0xe1fb('0x2b')],function(_0x409bbd){return{'name':_0x409bbd[_0xe1fb('0x2c')],'type':_0x409bbd[_0xe1fb('0x2d')]['key']};});_0x2b782d[_0xe1fb('0x2e')]=_[_0xe1fb('0x2f')](_0x1fef4a,_0xe1fb('0x28'));_0x2b782d[_0xe1fb('0x30')]=_[_0xe1fb('0x31')](_0x4f51dc[_0xe1fb('0x30')]);_0x2b782d[_0xe1fb('0x32')]=_[_0xe1fb('0x33')](_0x2b782d['model'],_0x2b782d['query']);_0x3e3b89['attributes']=_['intersection'](_0x2b782d['model'],qs[_0xe1fb('0x34')](_0x4f51dc[_0xe1fb('0x30')][_0xe1fb('0x34')]));_0x3e3b89[_0xe1fb('0x35')]=_0x3e3b89[_0xe1fb('0x35')][_0xe1fb('0x36')]?_0x3e3b89['attributes']:_0x2b782d['model'];if(!_0x4f51dc['query'][_0xe1fb('0x37')](_0xe1fb('0x38'))){_0x3e3b89[_0xe1fb('0x1e')]=qs[_0xe1fb('0x1e')](_0x4f51dc['query']['limit']);_0x3e3b89['offset']=qs[_0xe1fb('0x1c')](_0x4f51dc[_0xe1fb('0x30')][_0xe1fb('0x1c')]);}_0x3e3b89[_0xe1fb('0x39')]=qs[_0xe1fb('0x3a')](_0x4f51dc['query'][_0xe1fb('0x3a')]);_0x3e3b89[_0xe1fb('0x3b')]=qs[_0xe1fb('0x32')](_[_0xe1fb('0x3c')](_0x4f51dc[_0xe1fb('0x30')],_0x2b782d[_0xe1fb('0x32')]),_0x1fef4a);if(_0x4f51dc['query'][_0xe1fb('0x3d')]){_0x3e3b89[_0xe1fb('0x3b')]=_[_0xe1fb('0x3e')](_0x3e3b89['where'],{'$or':_[_0xe1fb('0x2f')](_0x1fef4a,function(_0x24923b){if(_0x24923b[_0xe1fb('0x2d')]!==_0xe1fb('0x3f')){var _0x168ac1={};_0x168ac1[_0x24923b[_0xe1fb('0x28')]]={'$like':'%'+_0x4f51dc[_0xe1fb('0x30')][_0xe1fb('0x3d')]+'%'};return _0x168ac1;}})});}_0x3e3b89=_[_0xe1fb('0x3e')]({},_0x3e3b89,_0x4f51dc['options']);var _0x4da06e={'where':_0x3e3b89[_0xe1fb('0x3b')]};return db['Disposition'][_0xe1fb('0x1f')](_0x4da06e)[_0xe1fb('0x24')](function(_0x18247a){_0x1394d9['count']=_0x18247a;if(_0x4f51dc['query'][_0xe1fb('0x40')]){_0x3e3b89['include']=[{'all':!![]}];}return db['Disposition'][_0xe1fb('0x41')](_0x3e3b89);})['then'](function(_0x52f1a0){_0x1394d9['rows']=_0x52f1a0;return _0x1394d9;})[_0xe1fb('0x24')](respondWithFilteredResult(_0x43cb78,_0x3e3b89))[_0xe1fb('0x42')](handleError(_0x43cb78,null));};exports['show']=function(_0x351815,_0x58f7a7){var _0x4d5d6c={'raw':!![],'where':{'id':_0x351815['params']['id']}},_0x4cfaf7={};_0x4cfaf7['model']=_[_0xe1fb('0x31')](db['Disposition']['rawAttributes']);_0x4cfaf7[_0xe1fb('0x30')]=_['keys'](_0x351815[_0xe1fb('0x30')]);_0x4cfaf7[_0xe1fb('0x32')]=_[_0xe1fb('0x33')](_0x4cfaf7[_0xe1fb('0x2e')],_0x4cfaf7['query']);_0x4d5d6c['attributes']=_[_0xe1fb('0x33')](_0x4cfaf7[_0xe1fb('0x2e')],qs[_0xe1fb('0x34')](_0x351815[_0xe1fb('0x30')][_0xe1fb('0x34')]));_0x4d5d6c['attributes']=_0x4d5d6c['attributes']['length']?_0x4d5d6c[_0xe1fb('0x35')]:_0x4cfaf7[_0xe1fb('0x2e')];if(_0x351815[_0xe1fb('0x30')][_0xe1fb('0x40')]){_0x4d5d6c[_0xe1fb('0x43')]=[{'all':!![]}];}_0x4d5d6c=_[_0xe1fb('0x3e')]({},_0x4d5d6c,_0x351815[_0xe1fb('0x44')]);return db[_0xe1fb('0x2a')]['find'](_0x4d5d6c)[_0xe1fb('0x24')](handleEntityNotFound(_0x58f7a7,null))[_0xe1fb('0x24')](respondWithResult(_0x58f7a7,null))[_0xe1fb('0x42')](handleError(_0x58f7a7,null));};exports[_0xe1fb('0x45')]=function(_0x32705c,_0x38a941){return db[_0xe1fb('0x2a')]['create'](_0x32705c['body'],{})[_0xe1fb('0x24')](function(_0x3a58be){var _0x1995b5=_0x32705c[_0xe1fb('0x46')]['get']({'plain':!![]});if(!_0x1995b5)throw new Error(_0xe1fb('0x47'));if(_0x1995b5[_0xe1fb('0x48')]===_0xe1fb('0x46')){var _0x80131d=_0x3a58be[_0xe1fb('0x26')]({'plain':!![]});var _0x236415=_0xe1fb('0x49');return db[_0xe1fb('0x4a')]['find']({'where':{'name':_0x236415,'userProfileId':_0x1995b5['userProfileId']},'raw':!![]})[_0xe1fb('0x24')](function(_0x403365){if(_0x403365&&_0x403365[_0xe1fb('0x4b')]===0x0){return db[_0xe1fb('0x4c')][_0xe1fb('0x45')]({'name':_0x80131d[_0xe1fb('0x28')],'resourceId':_0x80131d['id'],'type':_0x403365[_0xe1fb('0x28')],'sectionId':_0x403365['id']},{})[_0xe1fb('0x24')](function(){return _0x3a58be;});}else{return _0x3a58be;}})['catch'](function(_0x428f08){logger[_0xe1fb('0x27')](_0xe1fb('0x4d'),_0x428f08);throw _0x428f08;});}return _0x3a58be;})['then'](respondWithResult(_0x38a941,0xc9))[_0xe1fb('0x42')](handleError(_0x38a941,null));};exports[_0xe1fb('0x4e')]=function(_0x11bb9a,_0x5a01e8){if(_0x11bb9a[_0xe1fb('0x4f')]['id']){delete _0x11bb9a[_0xe1fb('0x4f')]['id'];}return db['Disposition'][_0xe1fb('0x50')]({'where':{'id':_0x11bb9a[_0xe1fb('0x51')]['id']}})[_0xe1fb('0x24')](handleEntityNotFound(_0x5a01e8,null))['then'](saveUpdates(_0x11bb9a[_0xe1fb('0x4f')],null))['then'](respondWithResult(_0x5a01e8,null))[_0xe1fb('0x42')](handleError(_0x5a01e8,null));};exports[_0xe1fb('0x25')]=function(_0x2d5427,_0x27c111){return db[_0xe1fb('0x2a')][_0xe1fb('0x50')]({'where':{'id':_0x2d5427[_0xe1fb('0x51')]['id']}})[_0xe1fb('0x24')](handleEntityNotFound(_0x27c111,null))[_0xe1fb('0x24')](removeEntity(_0x27c111,null))[_0xe1fb('0x42')](handleError(_0x27c111,null));}; \ No newline at end of file +var _0xea1c=['Content-Range','json','apply','update','then','destroy','get','UserProfileResource','end','error','stack','name','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','Dispositions','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','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea1c,0xdb));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcea1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcea1('0x1'));var jsonpatch=require(_0xcea1('0x2'));var rp=require(_0xcea1('0x3'));var moment=require(_0xcea1('0x4'));var BPromise=require(_0xcea1('0x5'));var Mustache=require(_0xcea1('0x6'));var util=require(_0xcea1('0x7'));var path=require(_0xcea1('0x8'));var sox=require(_0xcea1('0x9'));var csv=require(_0xcea1('0xa'));var ejs=require(_0xcea1('0xb'));var fs=require('fs');var fs_extra=require(_0xcea1('0xc'));var _=require(_0xcea1('0xd'));var squel=require('squel');var crypto=require(_0xcea1('0xe'));var jsforce=require(_0xcea1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcea1('0xa'));var querystring=require(_0xcea1('0x10'));var Papa=require(_0xcea1('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcea1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcea1('0x13'));var logger=require(_0xcea1('0x14'))(_0xcea1('0x15'));var utils=require(_0xcea1('0x16'));var config=require(_0xcea1('0x17'));var licenseUtil=require(_0xcea1('0x18'));var db=require(_0xcea1('0x19'))['db'];function respondWithStatusCode(_0x48645f,_0x55cc3b){_0x55cc3b=_0x55cc3b||0xcc;return function(_0x35dc90){if(_0x35dc90){return _0x48645f[_0xcea1('0x1a')](_0x55cc3b);}return _0x48645f['status'](_0x55cc3b)['end']();};}function respondWithResult(_0x4f6f03,_0x57e5ea){_0x57e5ea=_0x57e5ea||0xc8;return function(_0x487c77){if(_0x487c77){return _0x4f6f03['status'](_0x57e5ea)['json'](_0x487c77);}};}function respondWithFilteredResult(_0x4eb2a1,_0x39ad76){return function(_0x33ec74){if(_0x33ec74){var _0x298cc0=typeof _0x39ad76[_0xcea1('0x1b')]===_0xcea1('0x1c')&&typeof _0x39ad76[_0xcea1('0x1d')]==='undefined';var _0x2b92e3=_0x33ec74['count'];var _0x3e2ecf=_0x298cc0?0x0:_0x39ad76[_0xcea1('0x1b')];var _0x58c324=_0x298cc0?_0x33ec74[_0xcea1('0x1e')]:_0x39ad76[_0xcea1('0x1b')]+_0x39ad76[_0xcea1('0x1d')];var _0x1fda0c;if(_0x58c324>=_0x2b92e3){_0x58c324=_0x2b92e3;_0x1fda0c=0xc8;}else{_0x1fda0c=0xce;}_0x4eb2a1[_0xcea1('0x1f')](_0x1fda0c);return _0x4eb2a1[_0xcea1('0x20')](_0xcea1('0x21'),_0x3e2ecf+'-'+_0x58c324+'/'+_0x2b92e3)[_0xcea1('0x22')](_0x33ec74);}return null;};}function patchUpdates(_0x5bd581){return function(_0x4a4a15){try{jsonpatch[_0xcea1('0x23')](_0x4a4a15,_0x5bd581,!![]);}catch(_0x392061){return BPromise['reject'](_0x392061);}return _0x4a4a15['save']();};}function saveUpdates(_0x22b8ca,_0x4612e7){return function(_0x5b906a){if(_0x5b906a){return _0x5b906a[_0xcea1('0x24')](_0x22b8ca)[_0xcea1('0x25')](function(_0x126697){return _0x126697;});}return null;};}function removeEntity(_0x409cb7,_0x5f0162){return function(_0x294fac){if(_0x294fac){return _0x294fac[_0xcea1('0x26')]()[_0xcea1('0x25')](function(){var _0x3d7d2e=_0x294fac[_0xcea1('0x27')]({'plain':!![]});var _0x49d9cd='Dispositions';return db[_0xcea1('0x28')]['destroy']({'where':{'type':_0x49d9cd,'resourceId':_0x3d7d2e['id']}})[_0xcea1('0x25')](function(){return _0x294fac;});})[_0xcea1('0x25')](function(){_0x409cb7[_0xcea1('0x1f')](0xcc)[_0xcea1('0x29')]();});}};}function handleEntityNotFound(_0x40fabe,_0x45c603){return function(_0x28747f){if(!_0x28747f){_0x40fabe[_0xcea1('0x1a')](0x194);}return _0x28747f;};}function handleError(_0x78ffc,_0x2fddda){_0x2fddda=_0x2fddda||0x1f4;return function(_0x75da61){logger[_0xcea1('0x2a')](_0x75da61[_0xcea1('0x2b')]);if(_0x75da61['name']){delete _0x75da61[_0xcea1('0x2c')];}_0x78ffc[_0xcea1('0x1f')](_0x2fddda)['send'](_0x75da61);};}exports['index']=function(_0x1faf01,_0x5830b4){var _0x464cb7={},_0x4ac698={},_0x2822dd={'count':0x0,'rows':[]};var _0x36b145=_['map'](db['Disposition']['rawAttributes'],function(_0x418f09){return{'name':_0x418f09['fieldName'],'type':_0x418f09['type'][_0xcea1('0x2d')]};});_0x4ac698[_0xcea1('0x2e')]=_['map'](_0x36b145,_0xcea1('0x2c'));_0x4ac698[_0xcea1('0x2f')]=_[_0xcea1('0x30')](_0x1faf01[_0xcea1('0x2f')]);_0x4ac698[_0xcea1('0x31')]=_[_0xcea1('0x32')](_0x4ac698[_0xcea1('0x2e')],_0x4ac698[_0xcea1('0x2f')]);_0x464cb7['attributes']=_[_0xcea1('0x32')](_0x4ac698[_0xcea1('0x2e')],qs[_0xcea1('0x33')](_0x1faf01[_0xcea1('0x2f')][_0xcea1('0x33')]));_0x464cb7[_0xcea1('0x34')]=_0x464cb7[_0xcea1('0x34')][_0xcea1('0x35')]?_0x464cb7[_0xcea1('0x34')]:_0x4ac698[_0xcea1('0x2e')];if(!_0x1faf01['query']['hasOwnProperty'](_0xcea1('0x36'))){_0x464cb7[_0xcea1('0x1d')]=qs[_0xcea1('0x1d')](_0x1faf01['query'][_0xcea1('0x1d')]);_0x464cb7[_0xcea1('0x1b')]=qs[_0xcea1('0x1b')](_0x1faf01[_0xcea1('0x2f')][_0xcea1('0x1b')]);}_0x464cb7[_0xcea1('0x37')]=qs[_0xcea1('0x38')](_0x1faf01[_0xcea1('0x2f')]['sort']);_0x464cb7[_0xcea1('0x39')]=qs[_0xcea1('0x31')](_[_0xcea1('0x3a')](_0x1faf01['query'],_0x4ac698[_0xcea1('0x31')]),_0x36b145);if(_0x1faf01['query'][_0xcea1('0x3b')]){_0x464cb7[_0xcea1('0x39')]=_[_0xcea1('0x3c')](_0x464cb7[_0xcea1('0x39')],{'$or':_[_0xcea1('0x3d')](_0x36b145,function(_0x61c34e){if(_0x61c34e[_0xcea1('0x3e')]!==_0xcea1('0x3f')){var _0x32ee64={};_0x32ee64[_0x61c34e[_0xcea1('0x2c')]]={'$like':'%'+_0x1faf01[_0xcea1('0x2f')][_0xcea1('0x3b')]+'%'};return _0x32ee64;}})});}_0x464cb7=_['merge']({},_0x464cb7,_0x1faf01[_0xcea1('0x40')]);var _0x552753={'where':_0x464cb7['where']};return db[_0xcea1('0x41')][_0xcea1('0x1e')](_0x552753)['then'](function(_0x4527ee){_0x2822dd[_0xcea1('0x1e')]=_0x4527ee;if(_0x1faf01[_0xcea1('0x2f')][_0xcea1('0x42')]){_0x464cb7[_0xcea1('0x43')]=[{'all':!![]}];}return db['Disposition'][_0xcea1('0x44')](_0x464cb7);})[_0xcea1('0x25')](function(_0x573236){_0x2822dd[_0xcea1('0x45')]=_0x573236;return _0x2822dd;})[_0xcea1('0x25')](respondWithFilteredResult(_0x5830b4,_0x464cb7))[_0xcea1('0x46')](handleError(_0x5830b4,null));};exports[_0xcea1('0x47')]=function(_0x287ba3,_0x287022){var _0x3ac46f={'raw':!![],'where':{'id':_0x287ba3[_0xcea1('0x48')]['id']}},_0xfd758d={};_0xfd758d['model']=_[_0xcea1('0x30')](db[_0xcea1('0x41')][_0xcea1('0x49')]);_0xfd758d['query']=_[_0xcea1('0x30')](_0x287ba3[_0xcea1('0x2f')]);_0xfd758d[_0xcea1('0x31')]=_[_0xcea1('0x32')](_0xfd758d[_0xcea1('0x2e')],_0xfd758d[_0xcea1('0x2f')]);_0x3ac46f[_0xcea1('0x34')]=_['intersection'](_0xfd758d[_0xcea1('0x2e')],qs[_0xcea1('0x33')](_0x287ba3[_0xcea1('0x2f')][_0xcea1('0x33')]));_0x3ac46f[_0xcea1('0x34')]=_0x3ac46f[_0xcea1('0x34')][_0xcea1('0x35')]?_0x3ac46f[_0xcea1('0x34')]:_0xfd758d[_0xcea1('0x2e')];if(_0x287ba3[_0xcea1('0x2f')][_0xcea1('0x42')]){_0x3ac46f[_0xcea1('0x43')]=[{'all':!![]}];}_0x3ac46f=_[_0xcea1('0x3c')]({},_0x3ac46f,_0x287ba3[_0xcea1('0x40')]);return db[_0xcea1('0x41')][_0xcea1('0x4a')](_0x3ac46f)[_0xcea1('0x25')](handleEntityNotFound(_0x287022,null))['then'](respondWithResult(_0x287022,null))['catch'](handleError(_0x287022,null));};exports['create']=function(_0x145bfe,_0x147b9f){return db[_0xcea1('0x41')][_0xcea1('0x4b')](_0x145bfe[_0xcea1('0x4c')],{})[_0xcea1('0x25')](function(_0x38a574){var _0x234cb7=_0x145bfe[_0xcea1('0x4d')][_0xcea1('0x27')]({'plain':!![]});if(!_0x234cb7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x234cb7[_0xcea1('0x4e')]==='user'){var _0xe4cfad=_0x38a574[_0xcea1('0x27')]({'plain':!![]});var _0x4e5f60=_0xcea1('0x4f');return db[_0xcea1('0x50')][_0xcea1('0x4a')]({'where':{'name':_0x4e5f60,'userProfileId':_0x234cb7[_0xcea1('0x51')]},'raw':!![]})[_0xcea1('0x25')](function(_0x1ef55c){if(_0x1ef55c&&_0x1ef55c[_0xcea1('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0xe4cfad['name'],'resourceId':_0xe4cfad['id'],'type':_0x1ef55c[_0xcea1('0x2c')],'sectionId':_0x1ef55c['id']},{})[_0xcea1('0x25')](function(){return _0x38a574;});}else{return _0x38a574;}})['catch'](function(_0x32c643){logger[_0xcea1('0x2a')](_0xcea1('0x53'),_0x32c643);throw _0x32c643;});}return _0x38a574;})['then'](respondWithResult(_0x147b9f,0xc9))[_0xcea1('0x46')](handleError(_0x147b9f,null));};exports['update']=function(_0x576937,_0x4d0903){if(_0x576937[_0xcea1('0x4c')]['id']){delete _0x576937[_0xcea1('0x4c')]['id'];}return db[_0xcea1('0x41')][_0xcea1('0x4a')]({'where':{'id':_0x576937[_0xcea1('0x48')]['id']}})[_0xcea1('0x25')](handleEntityNotFound(_0x4d0903,null))['then'](saveUpdates(_0x576937['body'],null))['then'](respondWithResult(_0x4d0903,null))[_0xcea1('0x46')](handleError(_0x4d0903,null));};exports[_0xcea1('0x26')]=function(_0x4e5043,_0x51565f){return db[_0xcea1('0x41')][_0xcea1('0x4a')]({'where':{'id':_0x4e5043[_0xcea1('0x48')]['id']}})[_0xcea1('0x25')](handleEntityNotFound(_0x51565f,null))[_0xcea1('0x25')](removeEntity(_0x51565f,null))[_0xcea1('0x46')](handleError(_0x51565f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index e3d8b95..83806ff 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 _0x8ffe=['define','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_sms','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports'];(function(_0x1219a2,_0x209845){var _0xcd062a=function(_0x4433a9){while(--_0x4433a9){_0x1219a2['push'](_0x1219a2['shift']());}};_0xcd062a(++_0x209845);}(_0x8ffe,0x125));var _0xe8ff=function(_0xe8f729,_0x36192d){_0xe8f729=_0xe8f729-0x0;var _0x30fbfa=_0x8ffe[_0xe8f729];return _0x30fbfa;};'use strict';var _=require(_0xe8ff('0x0'));var util=require(_0xe8ff('0x1'));var logger=require(_0xe8ff('0x2'))(_0xe8ff('0x3'));var moment=require(_0xe8ff('0x4'));var BPromise=require(_0xe8ff('0x5'));var rp=require(_0xe8ff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8ff('0x7'));var config=require(_0xe8ff('0x8'));var attributes=require(_0xe8ff('0x9'));module[_0xe8ff('0xa')]=function(_0x33cd71,_0x40b0a0){return _0x33cd71[_0xe8ff('0xb')]('Disposition',attributes,{'tableName':_0xe8ff('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe8ff('0xd'),'fields':[_0xe8ff('0xe'),'ListId']},{'unique':!![],'name':_0xe8ff('0xf'),'fields':['name',_0xe8ff('0x10')]},{'unique':!![],'name':'name_mail','fields':[_0xe8ff('0xe'),'MailAccountId']},{'unique':!![],'name':_0xe8ff('0x11'),'fields':[_0xe8ff('0xe'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xe8ff('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':_0xe8ff('0x12'),'fields':[_0xe8ff('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb5ab=['name_mail','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','request-promise','../../config/environment','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId'];(function(_0x53f1d4,_0x26ed48){var _0x1fe942=function(_0x26bf8a){while(--_0x26bf8a){_0x53f1d4['push'](_0x53f1d4['shift']());}};_0x1fe942(++_0x26ed48);}(_0xb5ab,0x1d6));var _0xbb5a=function(_0xe003bd,_0x3fbb70){_0xe003bd=_0xe003bd-0x0;var _0xd0eda3=_0xb5ab[_0xe003bd];return _0xd0eda3;};'use strict';var _=require(_0xbb5a('0x0'));var util=require(_0xbb5a('0x1'));var logger=require('../../config/logger')(_0xbb5a('0x2'));var moment=require(_0xbb5a('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbb5a('0x5'));var attributes=require('./disposition.attributes');module['exports']=function(_0x4a1bf2,_0x5e66b1){return _0x4a1bf2[_0xbb5a('0x6')](_0xbb5a('0x7'),attributes,{'tableName':_0xbb5a('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbb5a('0x9'),'fields':['name',_0xbb5a('0xa')]},{'unique':!![],'name':_0xbb5a('0xb'),'fields':[_0xbb5a('0xc'),_0xbb5a('0xd')]},{'unique':!![],'name':_0xbb5a('0xe'),'fields':[_0xbb5a('0xc'),'MailAccountId']},{'unique':!![],'name':_0xbb5a('0xf'),'fields':[_0xbb5a('0xc'),_0xbb5a('0x10')]},{'unique':!![],'name':'name_fax','fields':['name',_0xbb5a('0x11')]},{'unique':!![],'name':_0xbb5a('0x12'),'fields':['name',_0xbb5a('0x13')]},{'unique':!![],'name':_0xbb5a('0x14'),'fields':[_0xbb5a('0xc'),_0xbb5a('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index c87093b..aaf4a46 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(_0x53519d,_0x4181d7){var _0x43a39d=function(_0x531924){while(--_0x531924){_0x53519d['push'](_0x53519d['shift']());}};_0x43a39d(++_0x4181d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x26a8bf,_0x580a94){var _0x5a488f=function(_0x33f484){while(--_0x33f484){_0x26a8bf['push'](_0x26a8bf['shift']());}};_0x5a488f(++_0x580a94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 ddd6069..f5fe54d 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 _0x5699=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id'];(function(_0x236fdc,_0x22a498){var _0x5b9bbe=function(_0x14d3c6){while(--_0x14d3c6){_0x236fdc['push'](_0x236fdc['shift']());}};_0x5b9bbe(++_0x22a498);}(_0x5699,0x148));var _0x9569=function(_0x16bf3f,_0x209017){_0x16bf3f=_0x16bf3f-0x0;var _0xde2717=_0x5699[_0x16bf3f];return _0xde2717;};'use strict';var multer=require(_0x9569('0x0'));var util=require(_0x9569('0x1'));var path=require(_0x9569('0x2'));var timeout=require('connect-timeout');var express=require(_0x9569('0x3'));var router=express[_0x9569('0x4')]();var fs_extra=require(_0x9569('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9569('0x6'));var controller=require(_0x9569('0x7'));router['get']('/',auth[_0x9569('0x8')](),controller[_0x9569('0x9')]);router[_0x9569('0xa')](_0x9569('0xb'),auth[_0x9569('0x8')](),controller[_0x9569('0xc')]);router[_0x9569('0xd')]('/',auth['isAuthenticated'](),controller[_0x9569('0xe')]);router[_0x9569('0xf')](_0x9569('0xb'),auth[_0x9569('0x8')](),controller[_0x9569('0x10')]);router[_0x9569('0x11')](_0x9569('0xb'),auth['isAuthenticated'](),controller[_0x9569('0x12')]);module[_0x9569('0x13')]=router; \ No newline at end of file +var _0xc0b8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer'];(function(_0x4d79ca,_0x413286){var _0x57af1f=function(_0x5df6f3){while(--_0x5df6f3){_0x4d79ca['push'](_0x4d79ca['shift']());}};_0x57af1f(++_0x413286);}(_0xc0b8,0x153));var _0x8c0b=function(_0x51f3c6,_0x4758e8){_0x51f3c6=_0x51f3c6-0x0;var _0x33fe6d=_0xc0b8[_0x51f3c6];return _0x33fe6d;};'use strict';var multer=require(_0x8c0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8c0b('0x1'));var express=require(_0x8c0b('0x2'));var router=express[_0x8c0b('0x3')]();var fs_extra=require(_0x8c0b('0x4'));var auth=require(_0x8c0b('0x5'));var interaction=require(_0x8c0b('0x6'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x8c0b('0x7')]('/',auth[_0x8c0b('0x8')](),controller[_0x8c0b('0x9')]);router[_0x8c0b('0x7')](_0x8c0b('0xa'),auth[_0x8c0b('0x8')](),controller[_0x8c0b('0xb')]);router[_0x8c0b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c0b('0xd')](_0x8c0b('0xa'),auth[_0x8c0b('0x8')](),controller[_0x8c0b('0xe')]);router[_0x8c0b('0xf')]('/:id',auth[_0x8c0b('0x8')](),controller[_0x8c0b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a55d4dd..1e0b4ff 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 _0xcfb6=['sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','14400','4800','v17,v27,v29','INTEGER','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0xcfb6,0x1e4));var _0x6cfb=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xcfb6[_0x545a3a];return _0x5a5493;};'use strict';var Sequelize=require(_0x6cfb('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cfb('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6cfb('0x1')]},'ecm':{'type':Sequelize[_0x6cfb('0x2')]('yes','no'),'defaultValue':_0x6cfb('0x3')},'headerinfo':{'type':Sequelize[_0x6cfb('0x1')],'defaultValue':_0x6cfb('0x4')},'localstationid':{'type':Sequelize[_0x6cfb('0x1')],'unique':_0x6cfb('0x5')},'minrate':{'type':Sequelize[_0x6cfb('0x2')](_0x6cfb('0x6'),'4800',_0x6cfb('0x7'),_0x6cfb('0x8'),'12000',_0x6cfb('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x6cfb('0x2')](_0x6cfb('0x6'),_0x6cfb('0xa'),'7200','9600','12000',_0x6cfb('0x9')),'defaultValue':_0x6cfb('0x9')},'modem':{'type':Sequelize[_0x6cfb('0x1')],'defaultValue':_0x6cfb('0xb')},'gateway':{'type':Sequelize[_0x6cfb('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6cfb('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6cfb('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6cfb('0x2')](_0x6cfb('0xd'),'IAX','DADHI','KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6cfb('0xe')],'defaultValue':function(){return _0x6cfb('0xf');}},'notificationSound':{'type':Sequelize[_0x6cfb('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6cfb('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6cfb('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6cfb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6cfb('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6cfb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6cfb('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x6cfb('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x6cfb('0x10')],'defaultValue':![],'comment':_0x6cfb('0x12'),'set':function(_0x184f00){if(!_0x184f00)this['setDataValue'](_0x6cfb('0x13'),null);this[_0x6cfb('0x14')](_0x6cfb('0x15'),_0x184f00);}}}; \ No newline at end of file +var _0x55a4=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600','12000','14400','2400','INTEGER','SIP','IAX','TEXT'];(function(_0x12c3a3,_0x2762df){var _0x5b8b23=function(_0x2653ed){while(--_0x2653ed){_0x12c3a3['push'](_0x12c3a3['shift']());}};_0x5b8b23(++_0x2762df);}(_0x55a4,0x151));var _0x455a=function(_0x1aa2d6,_0x3ae300){_0x1aa2d6=_0x1aa2d6-0x0;var _0x412511=_0x55a4[_0x1aa2d6];return _0x412511;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x455a('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x455a('0x0')]},'ecm':{'type':Sequelize['ENUM'](_0x455a('0x1'),'no'),'defaultValue':_0x455a('0x1')},'headerinfo':{'type':Sequelize[_0x455a('0x0')],'defaultValue':_0x455a('0x2')},'localstationid':{'type':Sequelize[_0x455a('0x0')],'unique':_0x455a('0x3')},'minrate':{'type':Sequelize[_0x455a('0x4')]('2400',_0x455a('0x5'),_0x455a('0x6'),_0x455a('0x7'),_0x455a('0x8'),_0x455a('0x9')),'defaultValue':_0x455a('0x5')},'maxrate':{'type':Sequelize[_0x455a('0x4')](_0x455a('0xa'),_0x455a('0x5'),_0x455a('0x6'),_0x455a('0x7'),_0x455a('0x8'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x455a('0x0')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x455a('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x455a('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x455a('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x455a('0xc'),_0x455a('0xd'),'DADHI','KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x455a('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x455a('0xe')],'defaultValue':function(){return _0x455a('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x455a('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x455a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x455a('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x455a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x455a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x455a('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x455a('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x455a('0x10')],'defaultValue':![],'comment':_0x455a('0x12'),'set':function(_0x160ddc){if(!_0x160ddc)this[_0x455a('0x13')](_0x455a('0x14'),null);this['setDataValue'](_0x455a('0x15'),_0x160ddc);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 70603dd..ea58fc4 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 _0x7fdf=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','FaxAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','FaxAccount','fieldName','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','include','removeAnswers','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','stack','finally','getApplications','context','from-voip-provider','localstationid','app','system','description','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','maxrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','fax','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3279fd,_0x1ec794){var _0xe51d6d=function(_0x175d09){while(--_0x175d09){_0x3279fd['push'](_0x3279fd['shift']());}};_0xe51d6d(++_0x1ec794);}(_0x7fdf,0x182));var _0xf7fd=function(_0x36d183,_0x321974){_0x36d183=_0x36d183-0x0;var _0x442e71=_0x7fdf[_0x36d183];return _0x442e71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7fd('0x0'));var zipdir=require(_0xf7fd('0x1'));var jsonpatch=require(_0xf7fd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf7fd('0x3'));var Mustache=require(_0xf7fd('0x4'));var util=require(_0xf7fd('0x5'));var path=require(_0xf7fd('0x6'));var sox=require(_0xf7fd('0x7'));var csv=require(_0xf7fd('0x8'));var ejs=require(_0xf7fd('0x9'));var fs=require('fs');var fs_extra=require(_0xf7fd('0xa'));var _=require(_0xf7fd('0xb'));var squel=require(_0xf7fd('0xc'));var crypto=require(_0xf7fd('0xd'));var jsforce=require(_0xf7fd('0xe'));var deskjs=require(_0xf7fd('0xf'));var toCsv=require(_0xf7fd('0x8'));var querystring=require(_0xf7fd('0x10'));var Papa=require(_0xf7fd('0x11'));var Redis=require('ioredis');var authService=require(_0xf7fd('0x12'));var qs=require(_0xf7fd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7fd('0x14'));var logger=require(_0xf7fd('0x15'))('api');var utils=require(_0xf7fd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf7fd('0x17'));var db=require(_0xf7fd('0x18'))['db'];config[_0xf7fd('0x19')]=_['defaults'](config[_0xf7fd('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7fd('0x1a'))(new Redis(config['redis']));require(_0xf7fd('0x1b'))[_0xf7fd('0x1c')](socket);var jayson=require(_0xf7fd('0x1d'));var client=jayson[_0xf7fd('0x1e')][_0xf7fd('0x1f')]({'port':0x232c});var client9002=jayson[_0xf7fd('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x559658,_0x6b9848,_0x2eee8e,_0x185ecc){return new BPromise(function(_0x26df63,_0x3aa6d7){var _0xf0ad87=_0x185ecc||client;return _0xf0ad87[_0xf7fd('0x20')](_0x559658,_0x2eee8e)[_0xf7fd('0x21')](function(_0x411ab){logger[_0xf7fd('0x22')](_0xf7fd('0x23'),_0x6b9848,_0xf7fd('0x24'));logger[_0xf7fd('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x6b9848,'request\x20sent',JSON[_0xf7fd('0x26')](_0x411ab));if(_0x411ab['error']){if(_0x411ab[_0xf7fd('0x27')][_0xf7fd('0x28')]===0x1f4){logger['error'](_0xf7fd('0x23'),_0x6b9848,_0x411ab[_0xf7fd('0x27')][_0xf7fd('0x29')]);return _0x3aa6d7(_0x411ab[_0xf7fd('0x27')]['message']);}logger['error'](_0xf7fd('0x23'),_0x6b9848,_0x411ab[_0xf7fd('0x27')]['message']);return _0x26df63(_0x411ab[_0xf7fd('0x27')][_0xf7fd('0x29')]);}else{logger[_0xf7fd('0x22')](_0xf7fd('0x23'),_0x6b9848,_0xf7fd('0x24'));_0x26df63(_0x411ab[_0xf7fd('0x2a')][_0xf7fd('0x29')]);}})['catch'](function(_0x3c9acf){logger['error']('FaxAccount,\x20%s,\x20%s',_0x6b9848,_0x3c9acf);_0x3aa6d7(_0x3c9acf);});});}function respondWithStatusCode(_0x4b1aa0,_0x531097){_0x531097=_0x531097||0xcc;return function(_0x338926){if(_0x338926){return _0x4b1aa0[_0xf7fd('0x2b')](_0x531097);}return _0x4b1aa0[_0xf7fd('0x2c')](_0x531097)[_0xf7fd('0x2d')]();};}function respondWithResult(_0x411136,_0x3a148f){_0x3a148f=_0x3a148f||0xc8;return function(_0x12e99e){if(_0x12e99e){return _0x411136[_0xf7fd('0x2c')](_0x3a148f)[_0xf7fd('0x2e')](_0x12e99e);}};}function respondWithFilteredResult(_0x1b3936,_0x2e70f3){return function(_0x17f1ad){if(_0x17f1ad){var _0x5ae6c4=typeof _0x2e70f3[_0xf7fd('0x2f')]===_0xf7fd('0x30')&&typeof _0x2e70f3[_0xf7fd('0x31')]===_0xf7fd('0x30');var _0x4078fe=_0x17f1ad['count'];var _0x6088d2=_0x5ae6c4?0x0:_0x2e70f3[_0xf7fd('0x2f')];var _0x145271=_0x5ae6c4?_0x17f1ad[_0xf7fd('0x32')]:_0x2e70f3[_0xf7fd('0x2f')]+_0x2e70f3[_0xf7fd('0x31')];var _0x41d6df;if(_0x145271>=_0x4078fe){_0x145271=_0x4078fe;_0x41d6df=0xc8;}else{_0x41d6df=0xce;}_0x1b3936[_0xf7fd('0x2c')](_0x41d6df);return _0x1b3936[_0xf7fd('0x33')]('Content-Range',_0x6088d2+'-'+_0x145271+'/'+_0x4078fe)[_0xf7fd('0x2e')](_0x17f1ad);}return null;};}function patchUpdates(_0x3f2225){return function(_0x2534c5){try{jsonpatch[_0xf7fd('0x34')](_0x2534c5,_0x3f2225,!![]);}catch(_0x529323){return BPromise[_0xf7fd('0x35')](_0x529323);}return _0x2534c5['save']();};}function saveUpdates(_0x60c5b6,_0x55b76d){return function(_0x5cc21a){if(_0x5cc21a){return _0x5cc21a[_0xf7fd('0x36')](_0x60c5b6)[_0xf7fd('0x21')](function(_0x4ddce1){return _0x4ddce1;});}return null;};}function removeEntity(_0x3b5a96,_0x50133f){return function(_0x18c0b0){if(_0x18c0b0){return _0x18c0b0[_0xf7fd('0x37')]()['then'](function(){var _0x517870=_0x18c0b0['get']({'plain':!![]});var _0x1e4217=_0xf7fd('0x38');return db[_0xf7fd('0x39')][_0xf7fd('0x37')]({'where':{'type':_0x1e4217,'resourceId':_0x517870['id']}})[_0xf7fd('0x21')](function(){return _0x18c0b0;});})['then'](function(){_0x3b5a96[_0xf7fd('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4872,_0x3d3cbf){return function(_0x1a5781){if(!_0x1a5781){_0x4b4872[_0xf7fd('0x2b')](0x194);}return _0x1a5781;};}function handleError(_0x5e38c3,_0x44b295){_0x44b295=_0x44b295||0x1f4;return function(_0x1567f3){logger[_0xf7fd('0x27')](_0x1567f3['stack']);if(_0x1567f3[_0xf7fd('0x3a')]){delete _0x1567f3['name'];}_0x5e38c3[_0xf7fd('0x2c')](_0x44b295)[_0xf7fd('0x3b')](_0x1567f3);};}exports[_0xf7fd('0x3c')]=function(_0x9cd0d,_0x5ef8f6){var _0x26fb3f={'include':[{'model':db['Pause'],'as':_0xf7fd('0x3d')}]},_0x31ae09={},_0x2a1032={'count':0x0,'rows':[]};var _0x4ae95b=_[_0xf7fd('0x3e')](db[_0xf7fd('0x3f')]['rawAttributes'],function(_0x4c6990){return{'name':_0x4c6990[_0xf7fd('0x40')],'type':_0x4c6990['type']['key']};});_0x31ae09[_0xf7fd('0x41')]=_[_0xf7fd('0x3e')](_0x4ae95b,_0xf7fd('0x3a'));_0x31ae09['query']=_[_0xf7fd('0x42')](_0x9cd0d['query']);_0x31ae09['filters']=_['intersection'](_0x31ae09[_0xf7fd('0x41')],_0x31ae09[_0xf7fd('0x43')]);_0x26fb3f[_0xf7fd('0x44')]=_[_0xf7fd('0x45')](_0x31ae09[_0xf7fd('0x41')],qs['fields'](_0x9cd0d[_0xf7fd('0x43')][_0xf7fd('0x46')]));_0x26fb3f['attributes']=_0x26fb3f[_0xf7fd('0x44')][_0xf7fd('0x47')]?_0x26fb3f[_0xf7fd('0x44')]:_0x31ae09['model'];if(!_0x9cd0d[_0xf7fd('0x43')]['hasOwnProperty']('nolimit')){_0x26fb3f['limit']=qs['limit'](_0x9cd0d[_0xf7fd('0x43')]['limit']);_0x26fb3f['offset']=qs[_0xf7fd('0x2f')](_0x9cd0d[_0xf7fd('0x43')][_0xf7fd('0x2f')]);}_0x26fb3f[_0xf7fd('0x48')]=qs[_0xf7fd('0x49')](_0x9cd0d['query'][_0xf7fd('0x49')]);_0x26fb3f[_0xf7fd('0x4a')]=qs[_0xf7fd('0x4b')](_[_0xf7fd('0x4c')](_0x9cd0d[_0xf7fd('0x43')],_0x31ae09[_0xf7fd('0x4b')]),_0x4ae95b);if(_0x9cd0d[_0xf7fd('0x43')][_0xf7fd('0x4d')]){_0x26fb3f['where']=_[_0xf7fd('0x4e')](_0x26fb3f['where'],{'$or':_[_0xf7fd('0x3e')](_0x4ae95b,function(_0x23afa6){if(_0x23afa6[_0xf7fd('0x4f')]!==_0xf7fd('0x50')){var _0x3f1216={};_0x3f1216[_0x23afa6['name']]={'$like':'%'+_0x9cd0d[_0xf7fd('0x43')][_0xf7fd('0x4d')]+'%'};return _0x3f1216;}})});}_0x26fb3f=_['merge']({},_0x26fb3f,_0x9cd0d[_0xf7fd('0x51')]);var _0x4d76e5={'where':_0x26fb3f[_0xf7fd('0x4a')]};return db['FaxAccount'][_0xf7fd('0x32')](_0x4d76e5)['then'](function(_0x23b354){_0x2a1032['count']=_0x23b354;if(_0x9cd0d['query'][_0xf7fd('0x52')]){_0x26fb3f['include']=[{'all':!![]}];}return db[_0xf7fd('0x3f')][_0xf7fd('0x53')](_0x26fb3f);})[_0xf7fd('0x21')](function(_0x33dd7b){_0x2a1032[_0xf7fd('0x54')]=_0x33dd7b;return _0x2a1032;})[_0xf7fd('0x21')](respondWithFilteredResult(_0x5ef8f6,_0x26fb3f))[_0xf7fd('0x55')](handleError(_0x5ef8f6,null));};exports[_0xf7fd('0x56')]=function(_0x5eb906,_0x1892ca){var _0x361b42={'raw':![],'where':{'id':_0x5eb906[_0xf7fd('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xf11c05={};_0xf11c05['model']=_[_0xf7fd('0x42')](db[_0xf7fd('0x3f')][_0xf7fd('0x58')]);_0xf11c05['query']=_[_0xf7fd('0x42')](_0x5eb906[_0xf7fd('0x43')]);_0xf11c05[_0xf7fd('0x4b')]=_[_0xf7fd('0x45')](_0xf11c05[_0xf7fd('0x41')],_0xf11c05['query']);_0x361b42[_0xf7fd('0x44')]=_[_0xf7fd('0x45')](_0xf11c05['model'],qs[_0xf7fd('0x46')](_0x5eb906['query']['fields']));_0x361b42[_0xf7fd('0x44')]=_0x361b42[_0xf7fd('0x44')][_0xf7fd('0x47')]?_0x361b42[_0xf7fd('0x44')]:_0xf11c05[_0xf7fd('0x41')];if(_0x5eb906['query'][_0xf7fd('0x52')]){_0x361b42['include']=[{'all':!![]}];}_0x361b42=_[_0xf7fd('0x4e')]({},_0x361b42,_0x5eb906['options']);return db[_0xf7fd('0x3f')][_0xf7fd('0x59')](_0x361b42)[_0xf7fd('0x21')](handleEntityNotFound(_0x1892ca,null))[_0xf7fd('0x21')](respondWithResult(_0x1892ca,null))['catch'](handleError(_0x1892ca,null));};exports['create']=function(_0xcf7cb8,_0x3cefe5){return db[_0xf7fd('0x3f')][_0xf7fd('0x5a')](_0xcf7cb8[_0xf7fd('0x5b')],{})[_0xf7fd('0x21')](function(_0x4dbf4d){var _0x563a35=_0xcf7cb8[_0xf7fd('0x5c')][_0xf7fd('0x5d')]({'plain':!![]});if(!_0x563a35)throw new Error(_0xf7fd('0x5e'));if(_0x563a35[_0xf7fd('0x5f')]===_0xf7fd('0x5c')){var _0x235491=_0x4dbf4d[_0xf7fd('0x5d')]({'plain':!![]});var _0x4a7dee=_0xf7fd('0x38');return db['UserProfileSection'][_0xf7fd('0x59')]({'where':{'name':_0x4a7dee,'userProfileId':_0x563a35[_0xf7fd('0x60')]},'raw':!![]})[_0xf7fd('0x21')](function(_0x43ab6b){if(_0x43ab6b&&_0x43ab6b[_0xf7fd('0x61')]===0x0){return db[_0xf7fd('0x39')][_0xf7fd('0x5a')]({'name':_0x235491[_0xf7fd('0x3a')],'resourceId':_0x235491['id'],'type':_0x43ab6b['name'],'sectionId':_0x43ab6b['id']},{})[_0xf7fd('0x21')](function(){return _0x4dbf4d;});}else{return _0x4dbf4d;}})['catch'](function(_0x54078b){logger['error'](_0xf7fd('0x62'),_0x54078b);throw _0x54078b;});}return _0x4dbf4d;})[_0xf7fd('0x21')](respondWithResult(_0x3cefe5,0xc9))[_0xf7fd('0x55')](handleError(_0x3cefe5,null));};exports['update']=function(_0x49bc27,_0x408310){if(_0x49bc27[_0xf7fd('0x5b')]['id']){delete _0x49bc27[_0xf7fd('0x5b')]['id'];}return db[_0xf7fd('0x3f')]['find']({'where':{'id':_0x49bc27[_0xf7fd('0x57')]['id']},'include':[{'model':db[_0xf7fd('0x63')],'as':_0xf7fd('0x3d')}]})[_0xf7fd('0x21')](handleEntityNotFound(_0x408310,null))['then'](saveUpdates(_0x49bc27['body'],null))[_0xf7fd('0x21')](respondWithResult(_0x408310,null))[_0xf7fd('0x55')](handleError(_0x408310,null));};exports[_0xf7fd('0x37')]=function(_0xd6c4f9,_0x123fd4){return db[_0xf7fd('0x3f')][_0xf7fd('0x59')]({'where':{'id':_0xd6c4f9[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x123fd4,null))[_0xf7fd('0x21')](removeEntity(_0x123fd4,null))['catch'](handleError(_0x123fd4,null));};exports[_0xf7fd('0x64')]=function(_0x87216f,_0x98a8c3){return db[_0xf7fd('0x3f')][_0xf7fd('0x64')]()[_0xf7fd('0x21')](respondWithResult(_0x98a8c3,null))[_0xf7fd('0x55')](handleError(_0x98a8c3,null));};exports[_0xf7fd('0x65')]=function(_0x24bb4e,_0x2a1710,_0x4b89ef){if(_0x24bb4e[_0xf7fd('0x5b')]['id']){delete _0x24bb4e['body']['id'];}return db[_0xf7fd('0x3f')]['find']({'where':{'id':_0x24bb4e[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x2a1710,null))[_0xf7fd('0x21')](function(_0x5f33b5){if(_0x5f33b5){_0x24bb4e['body'][_0xf7fd('0x66')]=_0x5f33b5['id'];return db['Disposition']['create'](_0x24bb4e[_0xf7fd('0x5b')]);}})[_0xf7fd('0x21')](respondWithResult(_0x2a1710,null))['catch'](handleError(_0x2a1710,null));};exports[_0xf7fd('0x67')]=function(_0x2211df,_0x146f68,_0x5e4efc){var _0x597af3={'raw':![],'where':{}};var _0xfe39de={};var _0x2531dc={'count':0x0,'rows':[]};return db[_0xf7fd('0x3f')][_0xf7fd('0x68')]({'where':{'id':_0x2211df[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x146f68,null))['then'](function(_0x5f2984){if(_0x5f2984){_0xfe39de[_0xf7fd('0x41')]=_[_0xf7fd('0x42')](db[_0xf7fd('0x69')][_0xf7fd('0x58')]);_0xfe39de[_0xf7fd('0x43')]=_['keys'](_0x2211df['query']);_0xfe39de[_0xf7fd('0x4b')]=_[_0xf7fd('0x45')](_0xfe39de[_0xf7fd('0x41')],_0xfe39de[_0xf7fd('0x43')]);_0x597af3[_0xf7fd('0x44')]=_['intersection'](_0xfe39de['model'],qs[_0xf7fd('0x46')](_0x2211df[_0xf7fd('0x43')][_0xf7fd('0x46')]));_0x597af3['attributes']=_0x597af3[_0xf7fd('0x44')]['length']?_0x597af3[_0xf7fd('0x44')]:_0xfe39de[_0xf7fd('0x41')];if(!_0x2211df[_0xf7fd('0x43')]['hasOwnProperty'](_0xf7fd('0x6a'))){_0x597af3[_0xf7fd('0x31')]=qs[_0xf7fd('0x31')](_0x2211df['query'][_0xf7fd('0x31')]);_0x597af3['offset']=qs[_0xf7fd('0x2f')](_0x2211df[_0xf7fd('0x43')]['offset']);}_0x597af3[_0xf7fd('0x48')]=qs[_0xf7fd('0x49')](_0x2211df[_0xf7fd('0x43')][_0xf7fd('0x49')]);_0x597af3[_0xf7fd('0x4a')]=qs[_0xf7fd('0x4b')](_[_0xf7fd('0x4c')](_0x2211df[_0xf7fd('0x43')],_0xfe39de[_0xf7fd('0x4b')]));_0x597af3[_0xf7fd('0x4a')][_0xf7fd('0x66')]=_0x5f2984['id'];if(_0x2211df['query'][_0xf7fd('0x4d')]){_0x597af3[_0xf7fd('0x4a')]=_[_0xf7fd('0x4e')](_0x597af3[_0xf7fd('0x4a')],{'$or':_[_0xf7fd('0x3e')](_0x597af3[_0xf7fd('0x44')],function(_0x126010){var _0x5bbc34={};_0x5bbc34[_0x126010]={'$like':'%'+_0x2211df[_0xf7fd('0x43')][_0xf7fd('0x4d')]+'%'};return _0x5bbc34;})});}_0x597af3=_['merge']({},_0x597af3,_0x2211df[_0xf7fd('0x51')]);return db[_0xf7fd('0x69')][_0xf7fd('0x32')]({'where':_0x597af3[_0xf7fd('0x4a')]})[_0xf7fd('0x21')](function(_0x270040){_0x2531dc['count']=_0x270040;if(_0x2211df[_0xf7fd('0x43')][_0xf7fd('0x52')]){_0x597af3['include']=[{'all':!![]}];}return db[_0xf7fd('0x69')][_0xf7fd('0x53')](_0x597af3);})[_0xf7fd('0x21')](function(_0x2b6ba9){_0x2531dc[_0xf7fd('0x54')]=_0x2b6ba9;return _0x2531dc;});}})['then'](respondWithFilteredResult(_0x146f68,_0x597af3))['catch'](handleError(_0x146f68,null));};exports[_0xf7fd('0x6b')]=function(_0x3c090e,_0x18ee23,_0x584c77){return db[_0xf7fd('0x3f')]['find']({'where':{'id':_0x3c090e[_0xf7fd('0x57')]['id']}})['then'](handleEntityNotFound(_0x18ee23,null))['then'](function(_0x40852c){if(_0x40852c){return _0x40852c[_0xf7fd('0x6b')](_0x3c090e[_0xf7fd('0x43')][_0xf7fd('0x6c')]);}})[_0xf7fd('0x21')](respondWithStatusCode(_0x18ee23,null))['catch'](handleError(_0x18ee23,null));};exports[_0xf7fd('0x6d')]=function(_0x367c85,_0x5567c6,_0x28f5fe){if(_0x367c85[_0xf7fd('0x5b')]['id']){delete _0x367c85['body']['id'];}return db[_0xf7fd('0x3f')][_0xf7fd('0x59')]({'where':{'id':_0x367c85['params']['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x5567c6,null))[_0xf7fd('0x21')](function(_0x5e18d4){if(_0x5e18d4){_0x367c85[_0xf7fd('0x5b')][_0xf7fd('0x66')]=_0x5e18d4['id'];return db[_0xf7fd('0x6e')][_0xf7fd('0x5a')](_0x367c85[_0xf7fd('0x5b')]);}})[_0xf7fd('0x21')](respondWithResult(_0x5567c6,null))['catch'](handleError(_0x5567c6,null));};exports[_0xf7fd('0x6f')]=function(_0x161d6a,_0xd0608c,_0x40baff){var _0x3fb9b7={'raw':![],'where':{}};var _0x31d911={};var _0x3bfb2e={'count':0x0,'rows':[]};return db[_0xf7fd('0x3f')][_0xf7fd('0x68')]({'where':{'id':_0x161d6a[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0xd0608c,null))[_0xf7fd('0x21')](function(_0x3e87a4){if(_0x3e87a4){_0x31d911[_0xf7fd('0x41')]=_[_0xf7fd('0x42')](db[_0xf7fd('0x6e')][_0xf7fd('0x58')]);_0x31d911[_0xf7fd('0x43')]=_[_0xf7fd('0x42')](_0x161d6a[_0xf7fd('0x43')]);_0x31d911[_0xf7fd('0x4b')]=_['intersection'](_0x31d911[_0xf7fd('0x41')],_0x31d911[_0xf7fd('0x43')]);_0x3fb9b7[_0xf7fd('0x44')]=_['intersection'](_0x31d911['model'],qs['fields'](_0x161d6a['query'][_0xf7fd('0x46')]));_0x3fb9b7[_0xf7fd('0x44')]=_0x3fb9b7[_0xf7fd('0x44')][_0xf7fd('0x47')]?_0x3fb9b7[_0xf7fd('0x44')]:_0x31d911[_0xf7fd('0x41')];if(!_0x161d6a['query'][_0xf7fd('0x70')](_0xf7fd('0x6a'))){_0x3fb9b7[_0xf7fd('0x31')]=qs[_0xf7fd('0x31')](_0x161d6a[_0xf7fd('0x43')]['limit']);_0x3fb9b7[_0xf7fd('0x2f')]=qs[_0xf7fd('0x2f')](_0x161d6a[_0xf7fd('0x43')]['offset']);}_0x3fb9b7[_0xf7fd('0x48')]=qs[_0xf7fd('0x49')](_0x161d6a[_0xf7fd('0x43')][_0xf7fd('0x49')]);_0x3fb9b7['where']=qs[_0xf7fd('0x4b')](_[_0xf7fd('0x4c')](_0x161d6a[_0xf7fd('0x43')],_0x31d911[_0xf7fd('0x4b')]));_0x3fb9b7['where'][_0xf7fd('0x66')]=_0x3e87a4['id'];if(_0x161d6a[_0xf7fd('0x43')]['filter']){_0x3fb9b7[_0xf7fd('0x4a')]=_[_0xf7fd('0x4e')](_0x3fb9b7[_0xf7fd('0x4a')],{'$or':_[_0xf7fd('0x3e')](_0x3fb9b7[_0xf7fd('0x44')],function(_0x57d223){var _0x448200={};_0x448200[_0x57d223]={'$like':'%'+_0x161d6a[_0xf7fd('0x43')]['filter']+'%'};return _0x448200;})});}_0x3fb9b7=_['merge']({},_0x3fb9b7,_0x161d6a[_0xf7fd('0x51')]);return db[_0xf7fd('0x6e')][_0xf7fd('0x32')]({'where':_0x3fb9b7[_0xf7fd('0x4a')]})[_0xf7fd('0x21')](function(_0x601d3b){_0x3bfb2e[_0xf7fd('0x32')]=_0x601d3b;if(_0x161d6a[_0xf7fd('0x43')][_0xf7fd('0x52')]){_0x3fb9b7[_0xf7fd('0x71')]=[{'all':!![]}];}return db[_0xf7fd('0x6e')][_0xf7fd('0x53')](_0x3fb9b7);})[_0xf7fd('0x21')](function(_0x16dec8){_0x3bfb2e['rows']=_0x16dec8;return _0x3bfb2e;});}})['then'](respondWithFilteredResult(_0xd0608c,_0x3fb9b7))[_0xf7fd('0x55')](handleError(_0xd0608c,null));};exports[_0xf7fd('0x72')]=function(_0x16a43d,_0x242ee,_0x2939ba){return db['FaxAccount'][_0xf7fd('0x59')]({'where':{'id':_0x16a43d[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x242ee,null))[_0xf7fd('0x21')](function(_0x54b1a2){if(_0x54b1a2){return _0x54b1a2['removeAnswers'](_0x16a43d[_0xf7fd('0x43')][_0xf7fd('0x6c')]);}})['then'](respondWithStatusCode(_0x242ee,null))[_0xf7fd('0x55')](handleError(_0x242ee,null));};exports['addInteraction']=function(_0x192c09,_0x2ba673,_0x37be82){return db[_0xf7fd('0x73')][_0xf7fd('0x59')]({'where':{'id':_0x192c09[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x2ba673,null))[_0xf7fd('0x21')](function(_0x11506e){if(_0x11506e){return _0x11506e['addInteraction'](_0x192c09[_0xf7fd('0x5b')][_0xf7fd('0x6c')],_[_0xf7fd('0x74')](_0x192c09['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2ba673,null))[_0xf7fd('0x55')](handleError(_0x2ba673,null));};exports[_0xf7fd('0x75')]=function(_0xa2c0c2,_0x3cbb04,_0x53783f){var _0x29878b={'raw':![],'where':{}};var _0x5037f1={};var _0x8fa9c8={'count':0x0,'rows':[]};return db[_0xf7fd('0x3f')][_0xf7fd('0x68')]({'where':{'id':_0xa2c0c2[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x3cbb04,null))['then'](function(_0x2c1621){if(_0x2c1621){_0x5037f1[_0xf7fd('0x41')]=_['keys'](db[_0xf7fd('0x73')][_0xf7fd('0x58')]);_0x5037f1[_0xf7fd('0x43')]=_[_0xf7fd('0x42')](_0xa2c0c2[_0xf7fd('0x43')]);_0x5037f1[_0xf7fd('0x4b')]=_[_0xf7fd('0x45')](_0x5037f1[_0xf7fd('0x41')],_0x5037f1[_0xf7fd('0x43')]);_0x29878b[_0xf7fd('0x44')]=_['intersection'](_0x5037f1['model'],qs[_0xf7fd('0x46')](_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x46')]));_0x29878b[_0xf7fd('0x44')]=_0x29878b[_0xf7fd('0x44')][_0xf7fd('0x47')]?_0x29878b[_0xf7fd('0x44')]:_0x5037f1[_0xf7fd('0x41')];if(!_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x70')](_0xf7fd('0x6a'))){_0x29878b[_0xf7fd('0x31')]=qs['limit'](_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x31')]);_0x29878b[_0xf7fd('0x2f')]=qs[_0xf7fd('0x2f')](_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x2f')]);}_0x29878b['order']=qs[_0xf7fd('0x49')](_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x49')]);_0x29878b[_0xf7fd('0x4a')]=qs[_0xf7fd('0x4b')](_[_0xf7fd('0x4c')](_0xa2c0c2[_0xf7fd('0x43')],_0x5037f1[_0xf7fd('0x4b')]));_0x29878b[_0xf7fd('0x4a')]['FaxAccountId']=_0x2c1621['id'];if(_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x4d')]){_0x29878b[_0xf7fd('0x4a')]=_['merge'](_0x29878b[_0xf7fd('0x4a')],{'$or':_[_0xf7fd('0x3e')](_0x29878b['attributes'],function(_0x957f74){var _0x45bace={};_0x45bace[_0x957f74]={'$like':'%'+_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x4d')]+'%'};return _0x45bace;})});}_0x29878b=_['merge']({},_0x29878b,_0xa2c0c2[_0xf7fd('0x51')]);return db[_0xf7fd('0x73')]['count']({'where':_0x29878b[_0xf7fd('0x4a')]})['then'](function(_0x46fc83){_0x8fa9c8[_0xf7fd('0x32')]=_0x46fc83;if(_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x52')]){_0x29878b['include']=[{'model':db[_0xf7fd('0x76')],'as':_0xf7fd('0x77'),'required':![]},{'model':db[_0xf7fd('0x78')],'as':_0xf7fd('0x79'),'attributes':[_0xf7fd('0x3a'),_0xf7fd('0x7a'),_0xf7fd('0x7b')],'required':![]},{'model':db[_0xf7fd('0x7c')],'as':_0xf7fd('0x7d'),'attributes':['id',_0xf7fd('0x3a'),_0xf7fd('0x7e')],'where':_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x7f')]?{'id':_0xa2c0c2[_0xf7fd('0x43')][_0xf7fd('0x7f')]}:undefined,'required':_0xa2c0c2['query'][_0xf7fd('0x7f')]?!![]:![]}];}return db[_0xf7fd('0x73')][_0xf7fd('0x53')](_0x29878b);})[_0xf7fd('0x21')](function(_0xaaf505){_0x8fa9c8['rows']=_0xaaf505;return _0x8fa9c8;});}})[_0xf7fd('0x21')](respondWithFilteredResult(_0x3cbb04,_0x29878b))[_0xf7fd('0x55')](handleError(_0x3cbb04,null));};exports[_0xf7fd('0x80')]=function(_0x152995,_0x53e560){var _0x2765e7=_0x152995[_0xf7fd('0x57')]['id'];var _0x3da084=_0x152995[_0xf7fd('0x5b')];var _0x469efd=0xc8;var _0x3c963a=null;return db[_0xf7fd('0x81')]['transaction']({'isolationLevel':db[_0xf7fd('0x81')][_0xf7fd('0x82')][_0xf7fd('0x83')][_0xf7fd('0x84')]},function(_0x165d08){return db[_0xf7fd('0x3f')]['findOne']({'where':{'id':_0x2765e7},'transaction':_0x165d08})[_0xf7fd('0x21')](function(_0x59445d){if(_0x59445d){return db[_0xf7fd('0x85')]['destroy']({'where':{'FaxAccountId':_0x2765e7},'transaction':_0x165d08})[_0xf7fd('0x21')](function(){var _0x19982a=_[_0xf7fd('0x3e')](_0x3da084,function(_0x25d8d4){_0x25d8d4[_0xf7fd('0x66')]=_0x2765e7;return _0x25d8d4;});return db['FaxApplication']['bulkCreate'](_0x19982a,{'transaction':_0x165d08});});}else{_0x469efd=0x194;_0x3c963a=[];}});})[_0xf7fd('0x21')](function(){if(_0x469efd!==0x194){return db[_0xf7fd('0x85')][_0xf7fd('0x86')]({'where':{'FaxAccountId':_0x2765e7},'order':_0xf7fd('0x87')})[_0xf7fd('0x21')](function(_0x46a2a9){_0x3c963a=_0x46a2a9;});}})[_0xf7fd('0x55')](function(_0x43b926){_0x469efd=0x1f4;logger[_0xf7fd('0x27')](_0x43b926[_0xf7fd('0x88')]);if(_0x43b926['name']){delete _0x43b926[_0xf7fd('0x3a')];}_0x3c963a=_0x43b926;})[_0xf7fd('0x89')](function(){if(_0x3c963a===null){_0x53e560[_0xf7fd('0x2b')](_0x469efd);}else{if(_0x469efd===0x1f4){_0x53e560[_0xf7fd('0x2c')](_0x469efd)[_0xf7fd('0x3b')](_0x3c963a);}else{_0x53e560[_0xf7fd('0x2c')](_0x469efd)[_0xf7fd('0x2e')](_0x3c963a);}}});};exports[_0xf7fd('0x8a')]=function(_0xb14372,_0x48d379,_0x55d4e3){var _0x239a80={};var _0x5196b7={};var _0x421934;var _0x185f90;return db[_0xf7fd('0x3f')][_0xf7fd('0x68')]({'where':{'id':_0xb14372[_0xf7fd('0x57')]['id']}})['then'](handleEntityNotFound(_0x48d379,null))['then'](function(_0x3e8eb0){if(_0x3e8eb0){_0x421934=_0x3e8eb0;_0x5196b7['model']=_[_0xf7fd('0x42')](db[_0xf7fd('0x85')][_0xf7fd('0x58')]);_0x5196b7[_0xf7fd('0x43')]=_[_0xf7fd('0x42')](_0xb14372[_0xf7fd('0x43')]);_0x5196b7[_0xf7fd('0x4b')]=_[_0xf7fd('0x45')](_0x5196b7[_0xf7fd('0x41')],_0x5196b7[_0xf7fd('0x43')]);_0x239a80[_0xf7fd('0x44')]=_[_0xf7fd('0x45')](_0x5196b7['model'],qs[_0xf7fd('0x46')](_0xb14372['query'][_0xf7fd('0x46')]));_0x239a80['attributes']=_0x239a80[_0xf7fd('0x44')][_0xf7fd('0x47')]?_0x239a80[_0xf7fd('0x44')]:_0x5196b7[_0xf7fd('0x41')];_0x239a80[_0xf7fd('0x48')]=qs[_0xf7fd('0x49')](_0xb14372['query'][_0xf7fd('0x49')]);_0x239a80[_0xf7fd('0x4a')]=qs['filters'](_[_0xf7fd('0x4c')](_0xb14372[_0xf7fd('0x43')],_0x5196b7[_0xf7fd('0x4b')]));if(_0xb14372[_0xf7fd('0x43')][_0xf7fd('0x4d')]){_0x239a80[_0xf7fd('0x4a')]=_[_0xf7fd('0x4e')](_0x239a80[_0xf7fd('0x4a')],{'$or':_[_0xf7fd('0x3e')](_0x239a80['attributes'],function(_0x2443ba){var _0x1d52ec={};_0x1d52ec[_0x2443ba]={'$like':'%'+_0xb14372[_0xf7fd('0x43')]['filter']+'%'};return _0x1d52ec;})});}_0x239a80=_[_0xf7fd('0x4e')]({},_0x239a80,_0xb14372[_0xf7fd('0x51')]);return _0x421934[_0xf7fd('0x8a')](_0x239a80);}})[_0xf7fd('0x21')](function(_0x1b1c27){if(_0x1b1c27){_0x185f90=_0x1b1c27[_0xf7fd('0x47')];if(!_0xb14372[_0xf7fd('0x43')]['hasOwnProperty']('nolimit')){_0x239a80[_0xf7fd('0x31')]=qs[_0xf7fd('0x31')](_0xb14372[_0xf7fd('0x43')][_0xf7fd('0x31')]);_0x239a80[_0xf7fd('0x2f')]=qs[_0xf7fd('0x2f')](_0xb14372['query']['offset']);}return _0x421934[_0xf7fd('0x8a')](_0x239a80);}})[_0xf7fd('0x21')](function(_0x41f3c5){if(_0x41f3c5){return _0x41f3c5?{'count':_0x185f90,'rows':_0x41f3c5}:null;}})[_0xf7fd('0x21')](respondWithResult(_0x48d379,null))[_0xf7fd('0x55')](handleError(_0x48d379,null));};function Extension(_0x547aa6,_0x172a8d,_0x4102ec,_0x35a85c){this[_0xf7fd('0x8b')]=_0xf7fd('0x8c');this['exten']=_0x547aa6[_0xf7fd('0x8d')];this[_0xf7fd('0x8e')]=_0x35a85c;this[_0xf7fd('0x4f')]=_0xf7fd('0x8f');this[_0xf7fd('0x90')]='Fax\x20Extension';this['FaxAccountId']=_0x547aa6['id'];this[_0xf7fd('0x87')]=_0x172a8d;this['appdata']=_0x4102ec;}function createExtensionsReciveFax(_0x436e20){var _0x18b7d2=0x1;var _0x440963=[];_0x440963[_0xf7fd('0x91')](new Extension(_0x436e20,_0x18b7d2,'',_0xf7fd('0x92')));_0x18b7d2+=0x1;_0x440963[_0xf7fd('0x91')](new Extension(_0x436e20,_0x18b7d2,_0xf7fd('0x93'),_0xf7fd('0x94')));_0x18b7d2+=0x1;for(var _0x3625d8 in _0x436e20){if(_0x436e20[_0xf7fd('0x70')](_0x3625d8)&&(_0x3625d8===_0xf7fd('0x95')||_0x3625d8==='localstationid'||_0x3625d8==='gateway'||_0x3625d8===_0xf7fd('0x96')||_0x3625d8==='headerinfo'||_0x3625d8===_0xf7fd('0x97')||_0x3625d8==='minrate'||_0x3625d8===_0xf7fd('0x98')||_0x3625d8===_0xf7fd('0x99'))){_0x440963[_0xf7fd('0x91')](new Extension(_0x436e20,_0x18b7d2,_0xf7fd('0x9a')+_0x3625d8+')='+_0x436e20[_0x3625d8],'Set'));_0x18b7d2+=0x1;}}_0x440963[_0xf7fd('0x91')](new Extension(_0x436e20,_0x18b7d2,'6',_0xf7fd('0x9b')));_0x18b7d2+=0x1;_0x440963['push'](new Extension(_0x436e20,_0x18b7d2,'/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',_0xf7fd('0x9c')));_0x18b7d2=0x0;return _0x440963;}exports[_0xf7fd('0x9d')]=function(_0x5da23c,_0x444999,_0x1af679){var _0x2f525b;return db[_0xf7fd('0x81')][_0xf7fd('0x9e')](function(_0x5c1c81){return db[_0xf7fd('0x3f')]['create'](_0x5da23c[_0xf7fd('0x5b')],{'transaction':_0x5c1c81})['then'](function(_0x396e32){_0x2f525b=_0x396e32['get']({'plain':!![]});return db[_0xf7fd('0x9f')][_0xf7fd('0xa0')](createExtensionsReciveFax(_0x2f525b),{'transaction':_0x5c1c81});});})['then'](function(){return _0x2f525b;})[_0xf7fd('0x21')](respondWithResult(_0x444999,null))[_0xf7fd('0x55')](handleError(_0x444999,null));};exports[_0xf7fd('0xa1')]=function(_0x49eca8,_0x33d25b,_0x57af4c){var _0xcc950b;return db[_0xf7fd('0x81')][_0xf7fd('0x9e')](function(_0x3003be){return db[_0xf7fd('0x3f')][_0xf7fd('0x36')](_0x49eca8[_0xf7fd('0x5b')],{'where':{'id':_0x49eca8[_0xf7fd('0x5b')]['id']},'transaction':_0x3003be})[_0xf7fd('0x21')](function(_0x161ddc){return db['VoiceExtension'][_0xf7fd('0x37')]({'where':{'FaxAccountId':_0x49eca8[_0xf7fd('0x5b')]['id']},'transaction':_0x3003be})[_0xf7fd('0x21')](function(_0x1ba89e){return db[_0xf7fd('0x9f')][_0xf7fd('0xa0')](createExtensionsReciveFax(_[_0xf7fd('0x74')](_0x49eca8['body'],[_0xf7fd('0xa2'),_0xf7fd('0xa3'),'createdAt',_0xf7fd('0xa4'),'TrunkId',_0xf7fd('0xa5')])),{'transaction':_0x3003be});});});})[_0xf7fd('0x21')](function(){return db['FaxAccount'][_0xf7fd('0xa6')](_0x49eca8[_0xf7fd('0x5b')]['id']);})['then'](respondWithResult(_0x33d25b,null))[_0xf7fd('0x55')](handleError(_0x33d25b,null));};exports[_0xf7fd('0xa7')]=function(_0x31f13b,_0x2b323c,_0x27f8e9){var _0x10052b={'raw':!![],'where':{}};var _0xce608a={};var _0x31b423={'count':0x0,'rows':[]};return db[_0xf7fd('0x3f')][_0xf7fd('0x68')]({'where':{'id':_0x31f13b[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x2b323c,null))[_0xf7fd('0x21')](function(_0xdd793e){if(_0xdd793e){_0xce608a[_0xf7fd('0x41')]=_[_0xf7fd('0x42')](db[_0xf7fd('0xa8')][_0xf7fd('0x58')]);_0xce608a[_0xf7fd('0x43')]=_[_0xf7fd('0x42')](_0x31f13b['query']);_0xce608a[_0xf7fd('0x4b')]=_[_0xf7fd('0x45')](_0xce608a[_0xf7fd('0x41')],_0xce608a[_0xf7fd('0x43')]);_0x10052b[_0xf7fd('0x44')]=_[_0xf7fd('0x45')](_0xce608a[_0xf7fd('0x41')],qs['fields'](_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0x46')]));_0x10052b[_0xf7fd('0x44')]=_0x10052b[_0xf7fd('0x44')][_0xf7fd('0x47')]?_0x10052b[_0xf7fd('0x44')]:_0xce608a[_0xf7fd('0x41')];if(!_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0x70')](_0xf7fd('0x6a'))){_0x10052b['limit']=qs['limit'](_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0x31')]);_0x10052b[_0xf7fd('0x2f')]=qs[_0xf7fd('0x2f')](_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0x2f')]);}_0x10052b[_0xf7fd('0x48')]=qs[_0xf7fd('0x49')](_0x31f13b[_0xf7fd('0x43')]['sort']);_0x10052b['where']=qs[_0xf7fd('0x4b')](_[_0xf7fd('0x4c')](_0x31f13b['query'],_0xce608a[_0xf7fd('0x4b')]));_0x10052b[_0xf7fd('0x4a')]['FaxAccountId']=_0xdd793e['id'];if(_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0x4d')]){_0x10052b['where']=_['merge'](_0x10052b[_0xf7fd('0x4a')],{'$or':_[_0xf7fd('0x3e')](_0x10052b[_0xf7fd('0x44')],function(_0xdec113){var _0x30d920={};_0x30d920[_0xdec113]={'$like':'%'+_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0x4d')]+'%'};return _0x30d920;})});}if(_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0xa9')]){var _0x49d0c2=_0x31f13b[_0xf7fd('0x43')][_0xf7fd('0xa9')]['split'](',');var _0x5526ce={};_0x5526ce[_0x49d0c2[0x0]]={'$gte':moment(_0x49d0c2[0x1])[_0xf7fd('0xaa')](_0xf7fd('0xab'))};_0x10052b[_0xf7fd('0x4a')]=_['merge'](_0x10052b[_0xf7fd('0x4a')],_0x5526ce);}_0x10052b=_['merge']({},_0x10052b,_0x31f13b['options']);return db[_0xf7fd('0xa8')]['count']({'where':_0x10052b[_0xf7fd('0x4a')]})[_0xf7fd('0x21')](function(_0x4b5739){_0x31b423['count']=_0x4b5739;if(_0x31f13b['query']['includeAll']){_0x10052b['include']=[{'all':!![]}];}return db[_0xf7fd('0xa8')][_0xf7fd('0x53')](_0x10052b);})['then'](function(_0x55a919){_0x31b423[_0xf7fd('0x54')]=_0x55a919;return _0x31b423;});}})['then'](respondWithFilteredResult(_0x2b323c,_0x10052b))['catch'](handleError(_0x2b323c,null));};exports['send']=function(_0x170d3e,_0x13022b,_0x5116a9){var _0x2337b7,_0x5ca033={},_0x312d86;if(_0x170d3e['body']['to']){_0x312d86=_0x170d3e['body']['to'][0x0];}return db[_0xf7fd('0x3f')][_0xf7fd('0x59')]({'where':{'id':_0x170d3e[_0xf7fd('0x57')]['id']},'include':[{'model':db[_0xf7fd('0xac')],'as':_0xf7fd('0xad'),'include':[{'model':db[_0xf7fd('0x76')],'as':'Contacts','where':{'fax':_0x312d86},'limit':0x1,'order':[[_0xf7fd('0xa4'),_0xf7fd('0xae')]]}]}]})[_0xf7fd('0x21')](handleEntityNotFound(_0x13022b,null))[_0xf7fd('0x21')](function(_0x3109b9){_0x2337b7=_0x3109b9;if(_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')]&&_0x170d3e['body'][_0xf7fd('0xaf')][_0xf7fd('0x47')]){for(var _0x3dc52c=0x0;_0x3dc52c<_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][_0xf7fd('0x47')];_0x3dc52c+=0x1){_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][_0x3dc52c]={'filename':_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][_0x3dc52c][_0xf7fd('0x3a')],'id':_0x170d3e['body'][_0xf7fd('0xaf')][_0x3dc52c]['id'],'path':path[_0xf7fd('0xb0')](config[_0xf7fd('0xb1')],'server/files/attachments',_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][_0x3dc52c][_0xf7fd('0xb2')])};}}return respondWithRpcPromise(_0xf7fd('0xb3'),_0xf7fd('0xb3'),{'FaxAccountId':_[_0xf7fd('0xb4')](_0x170d3e['params']['id'])?undefined:_0x170d3e[_0xf7fd('0x57')]['id'],'path':_[_0xf7fd('0xb4')](_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][0x0][_0xf7fd('0x6')])?undefined:_0x170d3e['body'][_0xf7fd('0xaf')][0x0][_0xf7fd('0x6')],'fax':_[_0xf7fd('0xb4')](_0x170d3e['body']['to'][0x0])?undefined:_0x170d3e[_0xf7fd('0x5b')]['to'][0x0]},client9002);})[_0xf7fd('0x21')](function(){if(_0x2337b7){if(_[_0xf7fd('0xb4')](_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xb5')])){_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xb5')]=util[_0xf7fd('0xaa')]('\x22%s\x22\x20<%s>',_0x2337b7[_0xf7fd('0x3a')],_0x2337b7[_0xf7fd('0xb6')]);}if(_0x2337b7['List']){if(_0x2337b7[_0xf7fd('0xad')][_0xf7fd('0xb7')][_0xf7fd('0x47')]){return _0x2337b7[_0xf7fd('0xad')][_0xf7fd('0xb7')][0x0];}else{return db[_0xf7fd('0x76')][_0xf7fd('0x5a')](_[_0xf7fd('0xb8')](_0x170d3e['body'],{'firstName':_0x170d3e['body']['to'][0x0],'phone':_0x170d3e[_0xf7fd('0x5b')]['to'][0x0],'fax':_0x170d3e[_0xf7fd('0x5b')]['to'][0x0],'ListId':_0x2337b7['ListId']}));}}else{throw new Error(_0xf7fd('0xb9'));}}else{throw new Error(_0xf7fd('0xba'));}})[_0xf7fd('0x21')](function(_0x259280){if(_0x259280){return db[_0xf7fd('0x73')][_0xf7fd('0x59')]({'where':{'ContactId':_0x259280['id'],'closed':![],'FaxAccountId':_0x2337b7['id']}})[_0xf7fd('0x21')](function(_0x2a500a){if(_0x2a500a){return[_0x2a500a,![]];}return db['FaxInteraction'][_0xf7fd('0x5a')]({'UserId':_0x170d3e[_0xf7fd('0x5c')]['id'],'ContactId':_0x259280['id'],'FaxAccountId':_0x2337b7['id'],'fax':_0x170d3e[_0xf7fd('0x5b')]['to'][0x0],'firstMsgDirection':_0xf7fd('0xbb'),'Messages':[_['merge'](_0x170d3e['body'],{'read':![],'body':_0x170d3e[_0xf7fd('0x5b')]['attachments'][0x0]['filename'],'FaxAccountId':_0x2337b7['id'],'UserId':_0x170d3e['user']['id'],'ContactId':_0x259280['id'],'AttachmentId':_0x170d3e[_0xf7fd('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xf7fd('0xbc')}]})[_0xf7fd('0x21')](function(_0x27489d){return[_0x27489d,!![]];});});}else{throw new Error(_0xf7fd('0xbd'));}})['spread'](function(_0xb5b06f,_0x5bd9cd){if(_0x5bd9cd){return _0xb5b06f;}return db[_0xf7fd('0xa8')][_0xf7fd('0x5a')]({'direction':_0xf7fd('0xbb'),'read':![],'body':_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][0x0]['filename'],'FaxAccountId':_0x2337b7['id'],'FaxInteractionId':_0xb5b06f['id'],'UserId':_0x170d3e[_0xf7fd('0x5c')]['id'],'ContactId':_0xb5b06f[_0xf7fd('0xbe')],'AttachmentId':_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][0x0]['id']})[_0xf7fd('0x21')](function(_0x5933f7){_0xb5b06f[_0xf7fd('0xbf')][_0xf7fd('0xbc')]=[];_0xb5b06f[_0xf7fd('0xbf')]['Messages']['push'](_0x5933f7[_0xf7fd('0xbf')]);return _0xb5b06f;});})[_0xf7fd('0x21')](function(_0x2997ec){respondWithRpcPromise(_0xf7fd('0xc0'),_0xf7fd('0xc0'),{'FaxAccountId':_[_0xf7fd('0xb4')](_0x170d3e[_0xf7fd('0x57')]['id'])?undefined:_0x170d3e[_0xf7fd('0x57')]['id'],'path':_[_0xf7fd('0xb4')](_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][0x0][_0xf7fd('0x6')])?undefined:_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][0x0]['path'],'fax':_['isNil'](_0x170d3e[_0xf7fd('0x5b')]['to'][0x0])?undefined:_0x170d3e['body']['to'][0x0],'AttachmentId':_0x170d3e[_0xf7fd('0x5b')][_0xf7fd('0xaf')][0x0]['id']},client9002)[_0xf7fd('0x21')](function(_0x3653a2){logger[_0xf7fd('0x22')](_0xf7fd('0xc1'),_0x3653a2);})[_0xf7fd('0x55')](function(_0x2519a1){logger[_0xf7fd('0x22')]('SendFaxRpc,\x20%s',_0x2519a1);});return _0x2997ec;})['then'](respondWithResult(_0x13022b,null))[_0xf7fd('0x55')](handleError(_0x13022b,null));};exports[_0xf7fd('0xc2')]=function(_0x5c30f3,_0x53e93e,_0x416899){return db[_0xf7fd('0x3f')]['find']({'where':{'id':_0x5c30f3[_0xf7fd('0x57')]['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x53e93e,null))[_0xf7fd('0x21')](function(_0x296c02){if(_0x296c02){return _0x296c02['addAgents'](_0x5c30f3[_0xf7fd('0x5b')]['ids'],_[_0xf7fd('0x74')](_0x5c30f3[_0xf7fd('0x5b')],[_0xf7fd('0x6c'),'id'])||{})[_0xf7fd('0xc3')](function(_0xad29b4){for(var _0x5e145e=0x0;_0x5e145e<_0x5c30f3[_0xf7fd('0x5b')][_0xf7fd('0x6c')]['length'];_0x5e145e+=0x1){socket[_0xf7fd('0xc4')](_0xf7fd('0xc5'),{'UserId':Number(_0x5c30f3['body'][_0xf7fd('0x6c')][_0x5e145e]),'FaxAccountId':Number(_0x5c30f3['params']['id'])});}return _0xad29b4;});}})['then'](respondWithResult(_0x53e93e,null))[_0xf7fd('0x55')](handleError(_0x53e93e,null));};exports['removeAgents']=function(_0x5a3c9f,_0x2cb932,_0x9df7e1){return db[_0xf7fd('0x3f')][_0xf7fd('0x59')]({'where':{'id':_0x5a3c9f['params']['id']}})['then'](handleEntityNotFound(_0x2cb932,null))['then'](function(_0x3d2fa9){if(_0x3d2fa9){return _0x3d2fa9[_0xf7fd('0xc6')](_0x5a3c9f[_0xf7fd('0x43')][_0xf7fd('0x6c')])[_0xf7fd('0x21')](function(){if(_[_0xf7fd('0xc7')](_0x5a3c9f[_0xf7fd('0x43')]['ids'])){for(var _0x32f081=0x0;_0x32f081<_0x5a3c9f['query']['ids'][_0xf7fd('0x47')];_0x32f081+=0x1){socket['emit'](_0xf7fd('0xc8'),{'UserId':Number(_0x5a3c9f[_0xf7fd('0x43')][_0xf7fd('0x6c')][_0x32f081]),'FaxAccountId':Number(_0x5a3c9f['params']['id'])});}}else{socket[_0xf7fd('0xc4')](_0xf7fd('0xc8'),{'UserId':Number(_0x5a3c9f[_0xf7fd('0x43')][_0xf7fd('0x6c')]),'FaxAccountId':Number(_0x5a3c9f['params']['id'])});}});}})[_0xf7fd('0x21')](respondWithStatusCode(_0x2cb932,null))[_0xf7fd('0x55')](handleError(_0x2cb932,null));};exports[_0xf7fd('0xc9')]=function(_0x457d1d,_0x368e0e,_0x41545c){var _0x5a4eae={};var _0x44e961={};var _0x1ef267;var _0x182139;return db[_0xf7fd('0x3f')][_0xf7fd('0x68')]({'where':{'id':_0x457d1d['params']['id']}})[_0xf7fd('0x21')](handleEntityNotFound(_0x368e0e,null))[_0xf7fd('0x21')](function(_0x4f2c73){if(_0x4f2c73){_0x1ef267=_0x4f2c73;_0x44e961[_0xf7fd('0x41')]=_['keys'](db[_0xf7fd('0x78')][_0xf7fd('0x58')]);_0x44e961[_0xf7fd('0x43')]=_[_0xf7fd('0x42')](_0x457d1d[_0xf7fd('0x43')]);_0x44e961[_0xf7fd('0x4b')]=_[_0xf7fd('0x45')](_0x44e961[_0xf7fd('0x41')],_0x44e961[_0xf7fd('0x43')]);_0x5a4eae[_0xf7fd('0x44')]=_[_0xf7fd('0x45')](_0x44e961[_0xf7fd('0x41')],qs[_0xf7fd('0x46')](_0x457d1d[_0xf7fd('0x43')]['fields']));_0x5a4eae[_0xf7fd('0x44')]=_0x5a4eae[_0xf7fd('0x44')][_0xf7fd('0x47')]?_0x5a4eae['attributes']:_0x44e961[_0xf7fd('0x41')];_0x5a4eae['order']=qs['sort'](_0x457d1d[_0xf7fd('0x43')]['sort']);_0x5a4eae[_0xf7fd('0x4a')]=qs[_0xf7fd('0x4b')](_[_0xf7fd('0x4c')](_0x457d1d['query'],_0x44e961[_0xf7fd('0x4b')]));if(_0x457d1d[_0xf7fd('0x43')][_0xf7fd('0x4d')]){_0x5a4eae[_0xf7fd('0x4a')]=_[_0xf7fd('0x4e')](_0x5a4eae[_0xf7fd('0x4a')],{'$or':_[_0xf7fd('0x3e')](_0x5a4eae['attributes'],function(_0x48acc1){var _0x4be82e={};_0x4be82e[_0x48acc1]={'$like':'%'+_0x457d1d['query']['filter']+'%'};return _0x4be82e;})});}_0x5a4eae=_[_0xf7fd('0x4e')]({},_0x5a4eae,_0x457d1d[_0xf7fd('0x51')]);return _0x1ef267[_0xf7fd('0xc9')](_0x5a4eae);}})[_0xf7fd('0x21')](function(_0x574d97){if(_0x574d97){_0x182139=_0x574d97[_0xf7fd('0x47')];if(!_0x457d1d[_0xf7fd('0x43')][_0xf7fd('0x70')]('nolimit')){_0x5a4eae['limit']=qs[_0xf7fd('0x31')](_0x457d1d[_0xf7fd('0x43')][_0xf7fd('0x31')]);_0x5a4eae[_0xf7fd('0x2f')]=qs[_0xf7fd('0x2f')](_0x457d1d[_0xf7fd('0x43')][_0xf7fd('0x2f')]);}return _0x1ef267['getAgents'](_0x5a4eae);}})[_0xf7fd('0x21')](function(_0x3e1bf0){if(_0x3e1bf0){return _0x3e1bf0?{'count':_0x182139,'rows':_0x3e1bf0}:null;}})['then'](respondWithResult(_0x368e0e,null))[_0xf7fd('0x55')](handleError(_0x368e0e,null));}; \ No newline at end of file +var _0x65ed=['maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','addAnswer','CannedAnswer','pick','removeAnswers','ids','addInteraction','omit','FaxInteraction','CmContact','User','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect'];(function(_0x5c1e29,_0xd59ff9){var _0x26922=function(_0x3a1ff1){while(--_0x3a1ff1){_0x5c1e29['push'](_0x5c1e29['shift']());}};_0x26922(++_0xd59ff9);}(_0x65ed,0xfc));var _0xd65e=function(_0x26f499,_0x2359ef){_0x26f499=_0x26f499-0x0;var _0xccb39=_0x65ed[_0x26f499];return _0xccb39;};'use strict';var emlformat=require(_0xd65e('0x0'));var rimraf=require(_0xd65e('0x1'));var zipdir=require(_0xd65e('0x2'));var jsonpatch=require(_0xd65e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd65e('0x4'));var path=require('path');var sox=require(_0xd65e('0x5'));var csv=require(_0xd65e('0x6'));var ejs=require(_0xd65e('0x7'));var fs=require('fs');var fs_extra=require(_0xd65e('0x8'));var _=require('lodash');var squel=require(_0xd65e('0x9'));var crypto=require(_0xd65e('0xa'));var jsforce=require(_0xd65e('0xb'));var deskjs=require(_0xd65e('0xc'));var toCsv=require(_0xd65e('0x6'));var querystring=require(_0xd65e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd65e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd65e('0xf'));var hardwareService=require(_0xd65e('0x10'));var logger=require(_0xd65e('0x11'))(_0xd65e('0x12'));var utils=require(_0xd65e('0x13'));var config=require(_0xd65e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd65e('0x15')]=_[_0xd65e('0x16')](config[_0xd65e('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xd65e('0x17'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xd65e('0x18')](socket);var jayson=require(_0xd65e('0x19'));var client=jayson[_0xd65e('0x1a')][_0xd65e('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xd65e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x21a79d,_0x1021bc,_0x27831c,_0x12ecbd){return new BPromise(function(_0x249271,_0x4fc411){var _0x71a8c4=_0x12ecbd||client;return _0x71a8c4[_0xd65e('0x1c')](_0x21a79d,_0x27831c)[_0xd65e('0x1d')](function(_0x232b58){logger['info']('FaxAccount,\x20%s,\x20%s',_0x1021bc,'request\x20sent');logger[_0xd65e('0x1e')](_0xd65e('0x1f'),_0x1021bc,'request\x20sent',JSON[_0xd65e('0x20')](_0x232b58));if(_0x232b58[_0xd65e('0x21')]){if(_0x232b58[_0xd65e('0x21')][_0xd65e('0x22')]===0x1f4){logger[_0xd65e('0x21')](_0xd65e('0x23'),_0x1021bc,_0x232b58['error']['message']);return _0x4fc411(_0x232b58['error'][_0xd65e('0x24')]);}logger[_0xd65e('0x21')]('FaxAccount,\x20%s,\x20%s',_0x1021bc,_0x232b58['error'][_0xd65e('0x24')]);return _0x249271(_0x232b58[_0xd65e('0x21')]['message']);}else{logger[_0xd65e('0x25')](_0xd65e('0x23'),_0x1021bc,'request\x20sent');_0x249271(_0x232b58[_0xd65e('0x26')][_0xd65e('0x24')]);}})[_0xd65e('0x27')](function(_0x5eaba6){logger[_0xd65e('0x21')]('FaxAccount,\x20%s,\x20%s',_0x1021bc,_0x5eaba6);_0x4fc411(_0x5eaba6);});});}function respondWithStatusCode(_0x3aaa9d,_0x564dd6){_0x564dd6=_0x564dd6||0xcc;return function(_0x1c302a){if(_0x1c302a){return _0x3aaa9d[_0xd65e('0x28')](_0x564dd6);}return _0x3aaa9d[_0xd65e('0x29')](_0x564dd6)[_0xd65e('0x2a')]();};}function respondWithResult(_0x18f298,_0x701c8f){_0x701c8f=_0x701c8f||0xc8;return function(_0x523a54){if(_0x523a54){return _0x18f298['status'](_0x701c8f)[_0xd65e('0x2b')](_0x523a54);}};}function respondWithFilteredResult(_0x3b2e9f,_0x3e842f){return function(_0x289998){if(_0x289998){var _0x16f42e=typeof _0x3e842f[_0xd65e('0x2c')]===_0xd65e('0x2d')&&typeof _0x3e842f[_0xd65e('0x2e')]===_0xd65e('0x2d');var _0x51d1ae=_0x289998[_0xd65e('0x2f')];var _0xdade6f=_0x16f42e?0x0:_0x3e842f[_0xd65e('0x2c')];var _0x43b91a=_0x16f42e?_0x289998[_0xd65e('0x2f')]:_0x3e842f[_0xd65e('0x2c')]+_0x3e842f['limit'];var _0x5ab8e7;if(_0x43b91a>=_0x51d1ae){_0x43b91a=_0x51d1ae;_0x5ab8e7=0xc8;}else{_0x5ab8e7=0xce;}_0x3b2e9f[_0xd65e('0x29')](_0x5ab8e7);return _0x3b2e9f[_0xd65e('0x30')]('Content-Range',_0xdade6f+'-'+_0x43b91a+'/'+_0x51d1ae)[_0xd65e('0x2b')](_0x289998);}return null;};}function patchUpdates(_0x545bdf){return function(_0x33b704){try{jsonpatch['apply'](_0x33b704,_0x545bdf,!![]);}catch(_0x5a334b){return BPromise[_0xd65e('0x31')](_0x5a334b);}return _0x33b704[_0xd65e('0x32')]();};}function saveUpdates(_0xbaf458,_0x1e4a9c){return function(_0x38b323){if(_0x38b323){return _0x38b323[_0xd65e('0x33')](_0xbaf458)[_0xd65e('0x1d')](function(_0x4a4d04){return _0x4a4d04;});}return null;};}function removeEntity(_0x1618e5,_0x1b435a){return function(_0x8448a6){if(_0x8448a6){return _0x8448a6[_0xd65e('0x34')]()[_0xd65e('0x1d')](function(){var _0x18f351=_0x8448a6[_0xd65e('0x35')]({'plain':!![]});var _0x1df130=_0xd65e('0x36');return db[_0xd65e('0x37')]['destroy']({'where':{'type':_0x1df130,'resourceId':_0x18f351['id']}})[_0xd65e('0x1d')](function(){return _0x8448a6;});})['then'](function(){_0x1618e5[_0xd65e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417d70,_0xe7de86){return function(_0xdfbd86){if(!_0xdfbd86){_0x417d70[_0xd65e('0x28')](0x194);}return _0xdfbd86;};}function handleError(_0x3c2f31,_0x344bf1){_0x344bf1=_0x344bf1||0x1f4;return function(_0x515c32){logger[_0xd65e('0x21')](_0x515c32[_0xd65e('0x38')]);if(_0x515c32['name']){delete _0x515c32[_0xd65e('0x39')];}_0x3c2f31[_0xd65e('0x29')](_0x344bf1)[_0xd65e('0x3a')](_0x515c32);};}exports[_0xd65e('0x3b')]=function(_0x5202a6,_0x64802a){var _0x4c5e44={'include':[{'model':db[_0xd65e('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1ea151={},_0x265299={'count':0x0,'rows':[]};var _0xfe3008=_[_0xd65e('0x3d')](db['FaxAccount'][_0xd65e('0x3e')],function(_0x5c9798){return{'name':_0x5c9798[_0xd65e('0x3f')],'type':_0x5c9798[_0xd65e('0x40')][_0xd65e('0x41')]};});_0x1ea151['model']=_[_0xd65e('0x3d')](_0xfe3008,_0xd65e('0x39'));_0x1ea151['query']=_[_0xd65e('0x42')](_0x5202a6[_0xd65e('0x43')]);_0x1ea151[_0xd65e('0x44')]=_[_0xd65e('0x45')](_0x1ea151[_0xd65e('0x46')],_0x1ea151[_0xd65e('0x43')]);_0x4c5e44[_0xd65e('0x47')]=_[_0xd65e('0x45')](_0x1ea151[_0xd65e('0x46')],qs['fields'](_0x5202a6[_0xd65e('0x43')][_0xd65e('0x48')]));_0x4c5e44[_0xd65e('0x47')]=_0x4c5e44[_0xd65e('0x47')][_0xd65e('0x49')]?_0x4c5e44[_0xd65e('0x47')]:_0x1ea151[_0xd65e('0x46')];if(!_0x5202a6['query'][_0xd65e('0x4a')](_0xd65e('0x4b'))){_0x4c5e44[_0xd65e('0x2e')]=qs[_0xd65e('0x2e')](_0x5202a6['query'][_0xd65e('0x2e')]);_0x4c5e44[_0xd65e('0x2c')]=qs[_0xd65e('0x2c')](_0x5202a6[_0xd65e('0x43')]['offset']);}_0x4c5e44[_0xd65e('0x4c')]=qs[_0xd65e('0x4d')](_0x5202a6['query'][_0xd65e('0x4d')]);_0x4c5e44[_0xd65e('0x4e')]=qs[_0xd65e('0x44')](_['pick'](_0x5202a6[_0xd65e('0x43')],_0x1ea151[_0xd65e('0x44')]),_0xfe3008);if(_0x5202a6[_0xd65e('0x43')][_0xd65e('0x4f')]){_0x4c5e44[_0xd65e('0x4e')]=_[_0xd65e('0x50')](_0x4c5e44[_0xd65e('0x4e')],{'$or':_[_0xd65e('0x3d')](_0xfe3008,function(_0x56a702){if(_0x56a702['type']!==_0xd65e('0x51')){var _0x5abdae={};_0x5abdae[_0x56a702[_0xd65e('0x39')]]={'$like':'%'+_0x5202a6[_0xd65e('0x43')][_0xd65e('0x4f')]+'%'};return _0x5abdae;}})});}_0x4c5e44=_[_0xd65e('0x50')]({},_0x4c5e44,_0x5202a6[_0xd65e('0x52')]);var _0x256adc={'where':_0x4c5e44['where']};return db[_0xd65e('0x53')][_0xd65e('0x2f')](_0x256adc)[_0xd65e('0x1d')](function(_0x13e449){_0x265299[_0xd65e('0x2f')]=_0x13e449;if(_0x5202a6[_0xd65e('0x43')][_0xd65e('0x54')]){_0x4c5e44[_0xd65e('0x55')]=[{'all':!![]}];}return db[_0xd65e('0x53')]['findAll'](_0x4c5e44);})['then'](function(_0x2c2ee0){_0x265299['rows']=_0x2c2ee0;return _0x265299;})[_0xd65e('0x1d')](respondWithFilteredResult(_0x64802a,_0x4c5e44))[_0xd65e('0x27')](handleError(_0x64802a,null));};exports[_0xd65e('0x56')]=function(_0x1835ca,_0x48f763){var _0x1996e0={'raw':![],'where':{'id':_0x1835ca[_0xd65e('0x57')]['id']},'include':[{'model':db[_0xd65e('0x3c')],'as':'mandatoryDispositionPause'}]},_0x330376={};_0x330376[_0xd65e('0x46')]=_['keys'](db[_0xd65e('0x53')][_0xd65e('0x3e')]);_0x330376[_0xd65e('0x43')]=_[_0xd65e('0x42')](_0x1835ca[_0xd65e('0x43')]);_0x330376[_0xd65e('0x44')]=_[_0xd65e('0x45')](_0x330376[_0xd65e('0x46')],_0x330376['query']);_0x1996e0[_0xd65e('0x47')]=_[_0xd65e('0x45')](_0x330376[_0xd65e('0x46')],qs[_0xd65e('0x48')](_0x1835ca[_0xd65e('0x43')]['fields']));_0x1996e0['attributes']=_0x1996e0[_0xd65e('0x47')]['length']?_0x1996e0[_0xd65e('0x47')]:_0x330376[_0xd65e('0x46')];if(_0x1835ca['query'][_0xd65e('0x54')]){_0x1996e0[_0xd65e('0x55')]=[{'all':!![]}];}_0x1996e0=_[_0xd65e('0x50')]({},_0x1996e0,_0x1835ca[_0xd65e('0x52')]);return db['FaxAccount'][_0xd65e('0x58')](_0x1996e0)['then'](handleEntityNotFound(_0x48f763,null))['then'](respondWithResult(_0x48f763,null))[_0xd65e('0x27')](handleError(_0x48f763,null));};exports[_0xd65e('0x59')]=function(_0x4e48d4,_0x17613b){return db[_0xd65e('0x53')][_0xd65e('0x59')](_0x4e48d4[_0xd65e('0x5a')],{})[_0xd65e('0x1d')](function(_0x3f084c){var _0x531379=_0x4e48d4['user'][_0xd65e('0x35')]({'plain':!![]});if(!_0x531379)throw new Error(_0xd65e('0x5b'));if(_0x531379[_0xd65e('0x5c')]===_0xd65e('0x5d')){var _0x6f446a=_0x3f084c[_0xd65e('0x35')]({'plain':!![]});var _0x4cdb3d='FaxAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x4cdb3d,'userProfileId':_0x531379[_0xd65e('0x5e')]},'raw':!![]})[_0xd65e('0x1d')](function(_0xd6c875){if(_0xd6c875&&_0xd6c875[_0xd65e('0x5f')]===0x0){return db['UserProfileResource'][_0xd65e('0x59')]({'name':_0x6f446a[_0xd65e('0x39')],'resourceId':_0x6f446a['id'],'type':_0xd6c875['name'],'sectionId':_0xd6c875['id']},{})[_0xd65e('0x1d')](function(){return _0x3f084c;});}else{return _0x3f084c;}})[_0xd65e('0x27')](function(_0x252a07){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x252a07);throw _0x252a07;});}return _0x3f084c;})[_0xd65e('0x1d')](respondWithResult(_0x17613b,0xc9))[_0xd65e('0x27')](handleError(_0x17613b,null));};exports[_0xd65e('0x33')]=function(_0x29a8de,_0x3a62d3){if(_0x29a8de[_0xd65e('0x5a')]['id']){delete _0x29a8de[_0xd65e('0x5a')]['id'];}return db[_0xd65e('0x53')]['find']({'where':{'id':_0x29a8de['params']['id']},'include':[{'model':db['Pause'],'as':_0xd65e('0x60')}]})['then'](handleEntityNotFound(_0x3a62d3,null))[_0xd65e('0x1d')](saveUpdates(_0x29a8de[_0xd65e('0x5a')],null))[_0xd65e('0x1d')](respondWithResult(_0x3a62d3,null))[_0xd65e('0x27')](handleError(_0x3a62d3,null));};exports['destroy']=function(_0x1e7d9c,_0x420063){return db[_0xd65e('0x53')]['find']({'where':{'id':_0x1e7d9c[_0xd65e('0x57')]['id']}})['then'](handleEntityNotFound(_0x420063,null))['then'](removeEntity(_0x420063,null))[_0xd65e('0x27')](handleError(_0x420063,null));};exports[_0xd65e('0x61')]=function(_0x48bfa2,_0x11c976){return db[_0xd65e('0x53')]['describe']()[_0xd65e('0x1d')](respondWithResult(_0x11c976,null))[_0xd65e('0x27')](handleError(_0x11c976,null));};exports[_0xd65e('0x62')]=function(_0x4bc507,_0x447374,_0x3c4338){if(_0x4bc507['body']['id']){delete _0x4bc507[_0xd65e('0x5a')]['id'];}return db[_0xd65e('0x53')]['find']({'where':{'id':_0x4bc507[_0xd65e('0x57')]['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0x447374,null))[_0xd65e('0x1d')](function(_0x2f8a1e){if(_0x2f8a1e){_0x4bc507[_0xd65e('0x5a')][_0xd65e('0x63')]=_0x2f8a1e['id'];return db[_0xd65e('0x64')][_0xd65e('0x59')](_0x4bc507['body']);}})['then'](respondWithResult(_0x447374,null))[_0xd65e('0x27')](handleError(_0x447374,null));};exports[_0xd65e('0x65')]=function(_0x3f3962,_0x2f4552,_0x3ec4e7){var _0x28df9e={'raw':![],'where':{}};var _0x24fcb8={};var _0x32db98={'count':0x0,'rows':[]};return db[_0xd65e('0x53')][_0xd65e('0x66')]({'where':{'id':_0x3f3962['params']['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0x2f4552,null))['then'](function(_0x345368){if(_0x345368){_0x24fcb8[_0xd65e('0x46')]=_['keys'](db[_0xd65e('0x64')][_0xd65e('0x3e')]);_0x24fcb8['query']=_['keys'](_0x3f3962[_0xd65e('0x43')]);_0x24fcb8[_0xd65e('0x44')]=_['intersection'](_0x24fcb8['model'],_0x24fcb8[_0xd65e('0x43')]);_0x28df9e[_0xd65e('0x47')]=_[_0xd65e('0x45')](_0x24fcb8[_0xd65e('0x46')],qs[_0xd65e('0x48')](_0x3f3962[_0xd65e('0x43')][_0xd65e('0x48')]));_0x28df9e['attributes']=_0x28df9e[_0xd65e('0x47')][_0xd65e('0x49')]?_0x28df9e[_0xd65e('0x47')]:_0x24fcb8[_0xd65e('0x46')];if(!_0x3f3962[_0xd65e('0x43')][_0xd65e('0x4a')](_0xd65e('0x4b'))){_0x28df9e[_0xd65e('0x2e')]=qs[_0xd65e('0x2e')](_0x3f3962['query'][_0xd65e('0x2e')]);_0x28df9e['offset']=qs[_0xd65e('0x2c')](_0x3f3962[_0xd65e('0x43')][_0xd65e('0x2c')]);}_0x28df9e['order']=qs[_0xd65e('0x4d')](_0x3f3962[_0xd65e('0x43')][_0xd65e('0x4d')]);_0x28df9e[_0xd65e('0x4e')]=qs[_0xd65e('0x44')](_['pick'](_0x3f3962[_0xd65e('0x43')],_0x24fcb8['filters']));_0x28df9e[_0xd65e('0x4e')]['FaxAccountId']=_0x345368['id'];if(_0x3f3962[_0xd65e('0x43')][_0xd65e('0x4f')]){_0x28df9e[_0xd65e('0x4e')]=_[_0xd65e('0x50')](_0x28df9e[_0xd65e('0x4e')],{'$or':_[_0xd65e('0x3d')](_0x28df9e[_0xd65e('0x47')],function(_0x17e425){var _0x35ac37={};_0x35ac37[_0x17e425]={'$like':'%'+_0x3f3962[_0xd65e('0x43')][_0xd65e('0x4f')]+'%'};return _0x35ac37;})});}_0x28df9e=_[_0xd65e('0x50')]({},_0x28df9e,_0x3f3962[_0xd65e('0x52')]);return db[_0xd65e('0x64')]['count']({'where':_0x28df9e[_0xd65e('0x4e')]})[_0xd65e('0x1d')](function(_0x338b63){_0x32db98[_0xd65e('0x2f')]=_0x338b63;if(_0x3f3962['query'][_0xd65e('0x54')]){_0x28df9e[_0xd65e('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xd65e('0x67')](_0x28df9e);})[_0xd65e('0x1d')](function(_0x687ada){_0x32db98[_0xd65e('0x68')]=_0x687ada;return _0x32db98;});}})[_0xd65e('0x1d')](respondWithFilteredResult(_0x2f4552,_0x28df9e))[_0xd65e('0x27')](handleError(_0x2f4552,null));};exports[_0xd65e('0x69')]=function(_0x58ee24,_0x5c98ef,_0x27b0a9){return db[_0xd65e('0x53')][_0xd65e('0x58')]({'where':{'id':_0x58ee24[_0xd65e('0x57')]['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0x5c98ef,null))['then'](function(_0x5650d2){if(_0x5650d2){return _0x5650d2[_0xd65e('0x69')](_0x58ee24[_0xd65e('0x43')]['ids']);}})[_0xd65e('0x1d')](respondWithStatusCode(_0x5c98ef,null))[_0xd65e('0x27')](handleError(_0x5c98ef,null));};exports[_0xd65e('0x6a')]=function(_0x1a9c76,_0x56d00d,_0x5061e3){if(_0x1a9c76[_0xd65e('0x5a')]['id']){delete _0x1a9c76[_0xd65e('0x5a')]['id'];}return db[_0xd65e('0x53')][_0xd65e('0x58')]({'where':{'id':_0x1a9c76[_0xd65e('0x57')]['id']}})['then'](handleEntityNotFound(_0x56d00d,null))[_0xd65e('0x1d')](function(_0x42837a){if(_0x42837a){_0x1a9c76[_0xd65e('0x5a')][_0xd65e('0x63')]=_0x42837a['id'];return db[_0xd65e('0x6b')]['create'](_0x1a9c76['body']);}})['then'](respondWithResult(_0x56d00d,null))[_0xd65e('0x27')](handleError(_0x56d00d,null));};exports['getAnswers']=function(_0x340919,_0x2e16a9,_0x1b11a0){var _0x2a6763={'raw':![],'where':{}};var _0x320dac={};var _0xea3bc0={'count':0x0,'rows':[]};return db[_0xd65e('0x53')][_0xd65e('0x66')]({'where':{'id':_0x340919[_0xd65e('0x57')]['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0x2e16a9,null))[_0xd65e('0x1d')](function(_0x534d35){if(_0x534d35){_0x320dac[_0xd65e('0x46')]=_[_0xd65e('0x42')](db[_0xd65e('0x6b')][_0xd65e('0x3e')]);_0x320dac[_0xd65e('0x43')]=_[_0xd65e('0x42')](_0x340919['query']);_0x320dac['filters']=_[_0xd65e('0x45')](_0x320dac[_0xd65e('0x46')],_0x320dac[_0xd65e('0x43')]);_0x2a6763[_0xd65e('0x47')]=_[_0xd65e('0x45')](_0x320dac[_0xd65e('0x46')],qs['fields'](_0x340919[_0xd65e('0x43')][_0xd65e('0x48')]));_0x2a6763[_0xd65e('0x47')]=_0x2a6763[_0xd65e('0x47')][_0xd65e('0x49')]?_0x2a6763[_0xd65e('0x47')]:_0x320dac[_0xd65e('0x46')];if(!_0x340919[_0xd65e('0x43')][_0xd65e('0x4a')](_0xd65e('0x4b'))){_0x2a6763[_0xd65e('0x2e')]=qs[_0xd65e('0x2e')](_0x340919[_0xd65e('0x43')][_0xd65e('0x2e')]);_0x2a6763[_0xd65e('0x2c')]=qs[_0xd65e('0x2c')](_0x340919['query'][_0xd65e('0x2c')]);}_0x2a6763[_0xd65e('0x4c')]=qs[_0xd65e('0x4d')](_0x340919[_0xd65e('0x43')][_0xd65e('0x4d')]);_0x2a6763[_0xd65e('0x4e')]=qs[_0xd65e('0x44')](_[_0xd65e('0x6c')](_0x340919[_0xd65e('0x43')],_0x320dac[_0xd65e('0x44')]));_0x2a6763[_0xd65e('0x4e')][_0xd65e('0x63')]=_0x534d35['id'];if(_0x340919[_0xd65e('0x43')][_0xd65e('0x4f')]){_0x2a6763[_0xd65e('0x4e')]=_[_0xd65e('0x50')](_0x2a6763[_0xd65e('0x4e')],{'$or':_[_0xd65e('0x3d')](_0x2a6763[_0xd65e('0x47')],function(_0x54255b){var _0x1a2b02={};_0x1a2b02[_0x54255b]={'$like':'%'+_0x340919[_0xd65e('0x43')][_0xd65e('0x4f')]+'%'};return _0x1a2b02;})});}_0x2a6763=_[_0xd65e('0x50')]({},_0x2a6763,_0x340919['options']);return db[_0xd65e('0x6b')][_0xd65e('0x2f')]({'where':_0x2a6763[_0xd65e('0x4e')]})['then'](function(_0x1f6d1c){_0xea3bc0[_0xd65e('0x2f')]=_0x1f6d1c;if(_0x340919['query'][_0xd65e('0x54')]){_0x2a6763[_0xd65e('0x55')]=[{'all':!![]}];}return db[_0xd65e('0x6b')]['findAll'](_0x2a6763);})[_0xd65e('0x1d')](function(_0x27f79e){_0xea3bc0[_0xd65e('0x68')]=_0x27f79e;return _0xea3bc0;});}})[_0xd65e('0x1d')](respondWithFilteredResult(_0x2e16a9,_0x2a6763))[_0xd65e('0x27')](handleError(_0x2e16a9,null));};exports[_0xd65e('0x6d')]=function(_0xb78183,_0x10e562,_0x302f16){return db[_0xd65e('0x53')]['find']({'where':{'id':_0xb78183[_0xd65e('0x57')]['id']}})['then'](handleEntityNotFound(_0x10e562,null))[_0xd65e('0x1d')](function(_0x3058b9){if(_0x3058b9){return _0x3058b9['removeAnswers'](_0xb78183['query'][_0xd65e('0x6e')]);}})[_0xd65e('0x1d')](respondWithStatusCode(_0x10e562,null))['catch'](handleError(_0x10e562,null));};exports['addInteraction']=function(_0x1c4c96,_0x55880c,_0x122848){return db['FaxInteraction'][_0xd65e('0x58')]({'where':{'id':_0x1c4c96[_0xd65e('0x57')]['id']}})['then'](handleEntityNotFound(_0x55880c,null))[_0xd65e('0x1d')](function(_0x186d5b){if(_0x186d5b){return _0x186d5b[_0xd65e('0x6f')](_0x1c4c96[_0xd65e('0x5a')]['ids'],_[_0xd65e('0x70')](_0x1c4c96[_0xd65e('0x5a')],[_0xd65e('0x6e'),'id'])||{});}})[_0xd65e('0x1d')](respondWithResult(_0x55880c,null))[_0xd65e('0x27')](handleError(_0x55880c,null));};exports['getInteractions']=function(_0x4a52e8,_0x1e43ee,_0x497e4d){var _0x395943={'raw':![],'where':{}};var _0x186f85={};var _0x193064={'count':0x0,'rows':[]};return db[_0xd65e('0x53')][_0xd65e('0x66')]({'where':{'id':_0x4a52e8[_0xd65e('0x57')]['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0x1e43ee,null))[_0xd65e('0x1d')](function(_0x2c513f){if(_0x2c513f){_0x186f85[_0xd65e('0x46')]=_[_0xd65e('0x42')](db[_0xd65e('0x71')][_0xd65e('0x3e')]);_0x186f85['query']=_[_0xd65e('0x42')](_0x4a52e8[_0xd65e('0x43')]);_0x186f85['filters']=_[_0xd65e('0x45')](_0x186f85['model'],_0x186f85[_0xd65e('0x43')]);_0x395943['attributes']=_['intersection'](_0x186f85['model'],qs[_0xd65e('0x48')](_0x4a52e8[_0xd65e('0x43')][_0xd65e('0x48')]));_0x395943['attributes']=_0x395943[_0xd65e('0x47')][_0xd65e('0x49')]?_0x395943['attributes']:_0x186f85[_0xd65e('0x46')];if(!_0x4a52e8[_0xd65e('0x43')][_0xd65e('0x4a')](_0xd65e('0x4b'))){_0x395943[_0xd65e('0x2e')]=qs[_0xd65e('0x2e')](_0x4a52e8['query'][_0xd65e('0x2e')]);_0x395943[_0xd65e('0x2c')]=qs[_0xd65e('0x2c')](_0x4a52e8[_0xd65e('0x43')][_0xd65e('0x2c')]);}_0x395943['order']=qs[_0xd65e('0x4d')](_0x4a52e8[_0xd65e('0x43')]['sort']);_0x395943['where']=qs[_0xd65e('0x44')](_['pick'](_0x4a52e8['query'],_0x186f85[_0xd65e('0x44')]));_0x395943[_0xd65e('0x4e')][_0xd65e('0x63')]=_0x2c513f['id'];if(_0x4a52e8[_0xd65e('0x43')][_0xd65e('0x4f')]){_0x395943[_0xd65e('0x4e')]=_[_0xd65e('0x50')](_0x395943['where'],{'$or':_[_0xd65e('0x3d')](_0x395943[_0xd65e('0x47')],function(_0x88a54){var _0x18ef6b={};_0x18ef6b[_0x88a54]={'$like':'%'+_0x4a52e8[_0xd65e('0x43')][_0xd65e('0x4f')]+'%'};return _0x18ef6b;})});}_0x395943=_[_0xd65e('0x50')]({},_0x395943,_0x4a52e8[_0xd65e('0x52')]);return db['FaxInteraction'][_0xd65e('0x2f')]({'where':_0x395943['where']})[_0xd65e('0x1d')](function(_0x542da8){_0x193064[_0xd65e('0x2f')]=_0x542da8;if(_0x4a52e8['query'][_0xd65e('0x54')]){_0x395943[_0xd65e('0x55')]=[{'model':db[_0xd65e('0x72')],'as':'Contact','required':![]},{'model':db[_0xd65e('0x73')],'as':_0xd65e('0x74'),'attributes':[_0xd65e('0x39'),_0xd65e('0x75'),_0xd65e('0x76')],'required':![]},{'model':db[_0xd65e('0x77')],'as':'Tags','attributes':['id',_0xd65e('0x39'),_0xd65e('0x78')],'where':_0x4a52e8[_0xd65e('0x43')][_0xd65e('0x79')]?{'id':_0x4a52e8['query'][_0xd65e('0x79')]}:undefined,'required':_0x4a52e8[_0xd65e('0x43')][_0xd65e('0x79')]?!![]:![]}];}return db[_0xd65e('0x71')][_0xd65e('0x67')](_0x395943);})[_0xd65e('0x1d')](function(_0x2707b0){_0x193064[_0xd65e('0x68')]=_0x2707b0;return _0x193064;});}})[_0xd65e('0x1d')](respondWithFilteredResult(_0x1e43ee,_0x395943))[_0xd65e('0x27')](handleError(_0x1e43ee,null));};exports['addApplications']=function(_0x111acd,_0x2c6c0a){var _0x33e417=_0x111acd[_0xd65e('0x57')]['id'];var _0x516c9e=_0x111acd[_0xd65e('0x5a')];var _0x29aa31=0xc8;var _0x287d17=null;return db[_0xd65e('0x7a')][_0xd65e('0x7b')]({'isolationLevel':db[_0xd65e('0x7a')][_0xd65e('0x7c')][_0xd65e('0x7d')][_0xd65e('0x7e')]},function(_0x43e27c){return db[_0xd65e('0x53')][_0xd65e('0x66')]({'where':{'id':_0x33e417},'transaction':_0x43e27c})[_0xd65e('0x1d')](function(_0x304806){if(_0x304806){return db['FaxApplication'][_0xd65e('0x34')]({'where':{'FaxAccountId':_0x33e417},'transaction':_0x43e27c})['then'](function(){var _0x3982a9=_[_0xd65e('0x3d')](_0x516c9e,function(_0x3da5e3){_0x3da5e3[_0xd65e('0x63')]=_0x33e417;return _0x3da5e3;});return db[_0xd65e('0x7f')][_0xd65e('0x80')](_0x3982a9,{'transaction':_0x43e27c});});}else{_0x29aa31=0x194;_0x287d17=[];}});})[_0xd65e('0x1d')](function(){if(_0x29aa31!==0x194){return db[_0xd65e('0x7f')][_0xd65e('0x81')]({'where':{'FaxAccountId':_0x33e417},'order':'priority'})[_0xd65e('0x1d')](function(_0x3873a9){_0x287d17=_0x3873a9;});}})[_0xd65e('0x27')](function(_0x4c6743){_0x29aa31=0x1f4;logger[_0xd65e('0x21')](_0x4c6743['stack']);if(_0x4c6743[_0xd65e('0x39')]){delete _0x4c6743[_0xd65e('0x39')];}_0x287d17=_0x4c6743;})[_0xd65e('0x82')](function(){if(_0x287d17===null){_0x2c6c0a[_0xd65e('0x28')](_0x29aa31);}else{if(_0x29aa31===0x1f4){_0x2c6c0a[_0xd65e('0x29')](_0x29aa31)['send'](_0x287d17);}else{_0x2c6c0a[_0xd65e('0x29')](_0x29aa31)['json'](_0x287d17);}}});};exports['getApplications']=function(_0x1457b7,_0x317ec4,_0x46eeaa){var _0x2af5c4={};var _0x4f8aa6={};var _0x27d5ad;var _0x3c8fe2;return db[_0xd65e('0x53')]['findOne']({'where':{'id':_0x1457b7[_0xd65e('0x57')]['id']}})['then'](handleEntityNotFound(_0x317ec4,null))[_0xd65e('0x1d')](function(_0x1aec4d){if(_0x1aec4d){_0x27d5ad=_0x1aec4d;_0x4f8aa6['model']=_[_0xd65e('0x42')](db[_0xd65e('0x7f')][_0xd65e('0x3e')]);_0x4f8aa6['query']=_['keys'](_0x1457b7[_0xd65e('0x43')]);_0x4f8aa6[_0xd65e('0x44')]=_['intersection'](_0x4f8aa6['model'],_0x4f8aa6[_0xd65e('0x43')]);_0x2af5c4[_0xd65e('0x47')]=_[_0xd65e('0x45')](_0x4f8aa6['model'],qs[_0xd65e('0x48')](_0x1457b7[_0xd65e('0x43')][_0xd65e('0x48')]));_0x2af5c4[_0xd65e('0x47')]=_0x2af5c4[_0xd65e('0x47')][_0xd65e('0x49')]?_0x2af5c4[_0xd65e('0x47')]:_0x4f8aa6['model'];_0x2af5c4['order']=qs['sort'](_0x1457b7['query']['sort']);_0x2af5c4['where']=qs[_0xd65e('0x44')](_[_0xd65e('0x6c')](_0x1457b7[_0xd65e('0x43')],_0x4f8aa6['filters']));if(_0x1457b7['query']['filter']){_0x2af5c4['where']=_[_0xd65e('0x50')](_0x2af5c4[_0xd65e('0x4e')],{'$or':_[_0xd65e('0x3d')](_0x2af5c4[_0xd65e('0x47')],function(_0x4a4963){var _0x523a6c={};_0x523a6c[_0x4a4963]={'$like':'%'+_0x1457b7[_0xd65e('0x43')][_0xd65e('0x4f')]+'%'};return _0x523a6c;})});}_0x2af5c4=_[_0xd65e('0x50')]({},_0x2af5c4,_0x1457b7[_0xd65e('0x52')]);return _0x27d5ad['getApplications'](_0x2af5c4);}})[_0xd65e('0x1d')](function(_0x598537){if(_0x598537){_0x3c8fe2=_0x598537[_0xd65e('0x49')];if(!_0x1457b7[_0xd65e('0x43')][_0xd65e('0x4a')]('nolimit')){_0x2af5c4['limit']=qs['limit'](_0x1457b7[_0xd65e('0x43')]['limit']);_0x2af5c4[_0xd65e('0x2c')]=qs['offset'](_0x1457b7['query'][_0xd65e('0x2c')]);}return _0x27d5ad[_0xd65e('0x83')](_0x2af5c4);}})[_0xd65e('0x1d')](function(_0x52daee){if(_0x52daee){return _0x52daee?{'count':_0x3c8fe2,'rows':_0x52daee}:null;}})[_0xd65e('0x1d')](respondWithResult(_0x317ec4,null))[_0xd65e('0x27')](handleError(_0x317ec4,null));};function Extension(_0x16cee7,_0x4994c3,_0x2aa5e3,_0x3e9c10){this[_0xd65e('0x84')]=_0xd65e('0x85');this[_0xd65e('0x86')]=_0x16cee7[_0xd65e('0x87')];this[_0xd65e('0x88')]=_0x3e9c10;this[_0xd65e('0x40')]='system';this[_0xd65e('0x89')]=_0xd65e('0x8a');this[_0xd65e('0x63')]=_0x16cee7['id'];this[_0xd65e('0x8b')]=_0x4994c3;this[_0xd65e('0x8c')]=_0x2aa5e3;}function createExtensionsReciveFax(_0x29d48d){var _0x2ba55d=0x1;var _0x40f62f=[];_0x40f62f[_0xd65e('0x8d')](new Extension(_0x29d48d,_0x2ba55d,'',_0xd65e('0x8e')));_0x2ba55d+=0x1;_0x40f62f[_0xd65e('0x8d')](new Extension(_0x29d48d,_0x2ba55d,_0xd65e('0x8f'),_0xd65e('0x90')));_0x2ba55d+=0x1;for(var _0x46ae90 in _0x29d48d){if(_0x29d48d['hasOwnProperty'](_0x46ae90)&&(_0x46ae90===_0xd65e('0x91')||_0x46ae90===_0xd65e('0x87')||_0x46ae90===_0xd65e('0x92')||_0x46ae90===_0xd65e('0x93')||_0x46ae90==='headerinfo'||_0x46ae90===_0xd65e('0x94')||_0x46ae90===_0xd65e('0x95')||_0x46ae90===_0xd65e('0x96')||_0x46ae90===_0xd65e('0x97'))){_0x40f62f[_0xd65e('0x8d')](new Extension(_0x29d48d,_0x2ba55d,_0xd65e('0x98')+_0x46ae90+')='+_0x29d48d[_0x46ae90],_0xd65e('0x90')));_0x2ba55d+=0x1;}}_0x40f62f['push'](new Extension(_0x29d48d,_0x2ba55d,'6',_0xd65e('0x99')));_0x2ba55d+=0x1;_0x40f62f[_0xd65e('0x8d')](new Extension(_0x29d48d,_0x2ba55d,_0xd65e('0x9a'),'ReceiveFax'));_0x2ba55d=0x0;return _0x40f62f;}exports[_0xd65e('0x9b')]=function(_0x3f2b20,_0x106e6e,_0x41c5c8){var _0x6af097;return db[_0xd65e('0x7a')]['transaction'](function(_0xfd1f41){return db[_0xd65e('0x53')][_0xd65e('0x59')](_0x3f2b20[_0xd65e('0x5a')],{'transaction':_0xfd1f41})[_0xd65e('0x1d')](function(_0x5ccb4b){_0x6af097=_0x5ccb4b[_0xd65e('0x35')]({'plain':!![]});return db[_0xd65e('0x9c')][_0xd65e('0x80')](createExtensionsReciveFax(_0x6af097),{'transaction':_0xfd1f41});});})['then'](function(){return _0x6af097;})[_0xd65e('0x1d')](respondWithResult(_0x106e6e,null))[_0xd65e('0x27')](handleError(_0x106e6e,null));};exports[_0xd65e('0x9d')]=function(_0x8c8ee0,_0x12395b,_0x26afac){var _0x397255;return db[_0xd65e('0x7a')]['transaction'](function(_0x2da1db){return db['FaxAccount'][_0xd65e('0x33')](_0x8c8ee0[_0xd65e('0x5a')],{'where':{'id':_0x8c8ee0[_0xd65e('0x5a')]['id']},'transaction':_0x2da1db})[_0xd65e('0x1d')](function(_0x2aefa7){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x8c8ee0[_0xd65e('0x5a')]['id']},'transaction':_0x2da1db})[_0xd65e('0x1d')](function(_0x1698ba){return db[_0xd65e('0x9c')][_0xd65e('0x80')](createExtensionsReciveFax(_[_0xd65e('0x70')](_0x8c8ee0['body'],[_0xd65e('0x9e'),_0xd65e('0x41'),_0xd65e('0x9f'),_0xd65e('0xa0'),'TrunkId',_0xd65e('0xa1')])),{'transaction':_0x2da1db});});});})[_0xd65e('0x1d')](function(){return db['FaxAccount']['findById'](_0x8c8ee0[_0xd65e('0x5a')]['id']);})['then'](respondWithResult(_0x12395b,null))[_0xd65e('0x27')](handleError(_0x12395b,null));};exports[_0xd65e('0xa2')]=function(_0x2abb38,_0xb05c78,_0x355c56){var _0x25a7fc={'raw':!![],'where':{}};var _0x1b0aa9={};var _0x5278f1={'count':0x0,'rows':[]};return db[_0xd65e('0x53')]['findOne']({'where':{'id':_0x2abb38[_0xd65e('0x57')]['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0xb05c78,null))['then'](function(_0x36f39c){if(_0x36f39c){_0x1b0aa9[_0xd65e('0x46')]=_[_0xd65e('0x42')](db['FaxMessage'][_0xd65e('0x3e')]);_0x1b0aa9['query']=_[_0xd65e('0x42')](_0x2abb38[_0xd65e('0x43')]);_0x1b0aa9[_0xd65e('0x44')]=_[_0xd65e('0x45')](_0x1b0aa9[_0xd65e('0x46')],_0x1b0aa9[_0xd65e('0x43')]);_0x25a7fc[_0xd65e('0x47')]=_[_0xd65e('0x45')](_0x1b0aa9[_0xd65e('0x46')],qs['fields'](_0x2abb38[_0xd65e('0x43')][_0xd65e('0x48')]));_0x25a7fc[_0xd65e('0x47')]=_0x25a7fc[_0xd65e('0x47')][_0xd65e('0x49')]?_0x25a7fc[_0xd65e('0x47')]:_0x1b0aa9[_0xd65e('0x46')];if(!_0x2abb38['query'][_0xd65e('0x4a')]('nolimit')){_0x25a7fc[_0xd65e('0x2e')]=qs[_0xd65e('0x2e')](_0x2abb38[_0xd65e('0x43')][_0xd65e('0x2e')]);_0x25a7fc[_0xd65e('0x2c')]=qs[_0xd65e('0x2c')](_0x2abb38[_0xd65e('0x43')][_0xd65e('0x2c')]);}_0x25a7fc[_0xd65e('0x4c')]=qs[_0xd65e('0x4d')](_0x2abb38[_0xd65e('0x43')][_0xd65e('0x4d')]);_0x25a7fc[_0xd65e('0x4e')]=qs[_0xd65e('0x44')](_['pick'](_0x2abb38[_0xd65e('0x43')],_0x1b0aa9[_0xd65e('0x44')]));_0x25a7fc[_0xd65e('0x4e')][_0xd65e('0x63')]=_0x36f39c['id'];if(_0x2abb38[_0xd65e('0x43')][_0xd65e('0x4f')]){_0x25a7fc['where']=_['merge'](_0x25a7fc[_0xd65e('0x4e')],{'$or':_['map'](_0x25a7fc[_0xd65e('0x47')],function(_0x211e09){var _0x3f0d08={};_0x3f0d08[_0x211e09]={'$like':'%'+_0x2abb38['query'][_0xd65e('0x4f')]+'%'};return _0x3f0d08;})});}if(_0x2abb38[_0xd65e('0x43')][_0xd65e('0xa3')]){var _0x5124bf=_0x2abb38[_0xd65e('0x43')][_0xd65e('0xa3')][_0xd65e('0xa4')](',');var _0x4b589b={};_0x4b589b[_0x5124bf[0x0]]={'$gte':moment(_0x5124bf[0x1])[_0xd65e('0xa5')](_0xd65e('0xa6'))};_0x25a7fc['where']=_[_0xd65e('0x50')](_0x25a7fc[_0xd65e('0x4e')],_0x4b589b);}_0x25a7fc=_['merge']({},_0x25a7fc,_0x2abb38['options']);return db['FaxMessage']['count']({'where':_0x25a7fc[_0xd65e('0x4e')]})[_0xd65e('0x1d')](function(_0x535ac1){_0x5278f1[_0xd65e('0x2f')]=_0x535ac1;if(_0x2abb38[_0xd65e('0x43')][_0xd65e('0x54')]){_0x25a7fc[_0xd65e('0x55')]=[{'all':!![]}];}return db[_0xd65e('0xa7')][_0xd65e('0x67')](_0x25a7fc);})[_0xd65e('0x1d')](function(_0xc49b79){_0x5278f1[_0xd65e('0x68')]=_0xc49b79;return _0x5278f1;});}})[_0xd65e('0x1d')](respondWithFilteredResult(_0xb05c78,_0x25a7fc))[_0xd65e('0x27')](handleError(_0xb05c78,null));};exports[_0xd65e('0x3a')]=function(_0x412506,_0x39e939,_0xb23f42){var _0x2926de,_0x44b3a0={},_0x6ce281;if(_0x412506[_0xd65e('0x5a')]['to']){_0x6ce281=_0x412506['body']['to'][0x0];}return db[_0xd65e('0x53')][_0xd65e('0x58')]({'where':{'id':_0x412506[_0xd65e('0x57')]['id']},'include':[{'model':db[_0xd65e('0xa8')],'as':_0xd65e('0xa9'),'include':[{'model':db[_0xd65e('0x72')],'as':_0xd65e('0xaa'),'where':{'fax':_0x6ce281},'limit':0x1,'order':[[_0xd65e('0xa0'),_0xd65e('0xab')]]}]}]})['then'](handleEntityNotFound(_0x39e939,null))['then'](function(_0x71e160){_0x2926de=_0x71e160;if(_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')]&&_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')]['length']){for(var _0x41a0e5=0x0;_0x41a0e5<_0x412506['body']['attachments'][_0xd65e('0x49')];_0x41a0e5+=0x1){_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')][_0x41a0e5]={'filename':_0x412506['body']['attachments'][_0x41a0e5][_0xd65e('0x39')],'id':_0x412506['body'][_0xd65e('0xac')][_0x41a0e5]['id'],'path':path[_0xd65e('0xad')](config[_0xd65e('0xae')],_0xd65e('0xaf'),_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')][_0x41a0e5]['basename'])};}}return respondWithRpcPromise(_0xd65e('0xb0'),_0xd65e('0xb0'),{'FaxAccountId':_['isNil'](_0x412506[_0xd65e('0x57')]['id'])?undefined:_0x412506[_0xd65e('0x57')]['id'],'path':_[_0xd65e('0xb1')](_0x412506[_0xd65e('0x5a')]['attachments'][0x0]['path'])?undefined:_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')][0x0][_0xd65e('0xb2')],'fax':_[_0xd65e('0xb1')](_0x412506[_0xd65e('0x5a')]['to'][0x0])?undefined:_0x412506[_0xd65e('0x5a')]['to'][0x0]},client9002);})[_0xd65e('0x1d')](function(){if(_0x2926de){if(_['isNil'](_0x412506['body'][_0xd65e('0xb3')])){_0x412506[_0xd65e('0x5a')][_0xd65e('0xb3')]=util['format'](_0xd65e('0xb4'),_0x2926de[_0xd65e('0x39')],_0x2926de[_0xd65e('0xb5')]);}if(_0x2926de['List']){if(_0x2926de[_0xd65e('0xa9')][_0xd65e('0xaa')][_0xd65e('0x49')]){return _0x2926de['List'][_0xd65e('0xaa')][0x0];}else{return db[_0xd65e('0x72')][_0xd65e('0x59')](_['defaults'](_0x412506[_0xd65e('0x5a')],{'firstName':_0x412506[_0xd65e('0x5a')]['to'][0x0],'phone':_0x412506[_0xd65e('0x5a')]['to'][0x0],'fax':_0x412506[_0xd65e('0x5a')]['to'][0x0],'ListId':_0x2926de[_0xd65e('0xa1')]}));}}else{throw new Error(_0xd65e('0xb6'));}}else{throw new Error(_0xd65e('0xb7'));}})[_0xd65e('0x1d')](function(_0xe91405){if(_0xe91405){return db[_0xd65e('0x71')][_0xd65e('0x58')]({'where':{'ContactId':_0xe91405['id'],'closed':![],'FaxAccountId':_0x2926de['id']}})['then'](function(_0x229f10){if(_0x229f10){return[_0x229f10,![]];}return db[_0xd65e('0x71')][_0xd65e('0x59')]({'UserId':_0x412506[_0xd65e('0x5d')]['id'],'ContactId':_0xe91405['id'],'FaxAccountId':_0x2926de['id'],'fax':_0x412506['body']['to'][0x0],'firstMsgDirection':_0xd65e('0xb8'),'Messages':[_['merge'](_0x412506[_0xd65e('0x5a')],{'read':![],'body':_0x412506['body'][_0xd65e('0xac')][0x0][_0xd65e('0xb9')],'FaxAccountId':_0x2926de['id'],'UserId':_0x412506['user']['id'],'ContactId':_0xe91405['id'],'AttachmentId':_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')][0x0]['id']})]},{'include':[{'model':db[_0xd65e('0xa7')],'as':'Messages'}]})[_0xd65e('0x1d')](function(_0x28437d){return[_0x28437d,!![]];});});}else{throw new Error(_0xd65e('0xba'));}})[_0xd65e('0xbb')](function(_0x2f1084,_0x3ce842){if(_0x3ce842){return _0x2f1084;}return db['FaxMessage'][_0xd65e('0x59')]({'direction':_0xd65e('0xb8'),'read':![],'body':_0x412506['body'][_0xd65e('0xac')][0x0]['filename'],'FaxAccountId':_0x2926de['id'],'FaxInteractionId':_0x2f1084['id'],'UserId':_0x412506[_0xd65e('0x5d')]['id'],'ContactId':_0x2f1084[_0xd65e('0xbc')],'AttachmentId':_0x412506['body'][_0xd65e('0xac')][0x0]['id']})[_0xd65e('0x1d')](function(_0x5bcea1){_0x2f1084[_0xd65e('0xbd')][_0xd65e('0xbe')]=[];_0x2f1084[_0xd65e('0xbd')][_0xd65e('0xbe')]['push'](_0x5bcea1[_0xd65e('0xbd')]);return _0x2f1084;});})[_0xd65e('0x1d')](function(_0x5027b6){respondWithRpcPromise(_0xd65e('0xbf'),_0xd65e('0xbf'),{'FaxAccountId':_[_0xd65e('0xb1')](_0x412506[_0xd65e('0x57')]['id'])?undefined:_0x412506[_0xd65e('0x57')]['id'],'path':_['isNil'](_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')][0x0]['path'])?undefined:_0x412506[_0xd65e('0x5a')]['attachments'][0x0][_0xd65e('0xb2')],'fax':_[_0xd65e('0xb1')](_0x412506['body']['to'][0x0])?undefined:_0x412506[_0xd65e('0x5a')]['to'][0x0],'AttachmentId':_0x412506[_0xd65e('0x5a')][_0xd65e('0xac')][0x0]['id']},client9002)[_0xd65e('0x1d')](function(_0x515bc2){logger['info'](_0xd65e('0xc0'),_0x515bc2);})[_0xd65e('0x27')](function(_0x51341e){logger[_0xd65e('0x25')]('SendFaxRpc,\x20%s',_0x51341e);});return _0x5027b6;})[_0xd65e('0x1d')](respondWithResult(_0x39e939,null))[_0xd65e('0x27')](handleError(_0x39e939,null));};exports['addAgents']=function(_0x3e8063,_0x224448,_0x5ce54a){return db[_0xd65e('0x53')][_0xd65e('0x58')]({'where':{'id':_0x3e8063[_0xd65e('0x57')]['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0x224448,null))[_0xd65e('0x1d')](function(_0x4672d3){if(_0x4672d3){return _0x4672d3[_0xd65e('0xc1')](_0x3e8063['body'][_0xd65e('0x6e')],_['omit'](_0x3e8063[_0xd65e('0x5a')],['ids','id'])||{})[_0xd65e('0xbb')](function(_0x476e98){for(var _0x2d9877=0x0;_0x2d9877<_0x3e8063[_0xd65e('0x5a')][_0xd65e('0x6e')][_0xd65e('0x49')];_0x2d9877+=0x1){socket[_0xd65e('0xc2')](_0xd65e('0xc3'),{'UserId':Number(_0x3e8063[_0xd65e('0x5a')][_0xd65e('0x6e')][_0x2d9877]),'FaxAccountId':Number(_0x3e8063['params']['id'])});}return _0x476e98;});}})[_0xd65e('0x1d')](respondWithResult(_0x224448,null))['catch'](handleError(_0x224448,null));};exports[_0xd65e('0xc4')]=function(_0x5a91d9,_0x38a1a9,_0x3eb076){return db[_0xd65e('0x53')][_0xd65e('0x58')]({'where':{'id':_0x5a91d9[_0xd65e('0x57')]['id']}})[_0xd65e('0x1d')](handleEntityNotFound(_0x38a1a9,null))['then'](function(_0xe8197){if(_0xe8197){return _0xe8197[_0xd65e('0xc4')](_0x5a91d9[_0xd65e('0x43')][_0xd65e('0x6e')])[_0xd65e('0x1d')](function(){if(_[_0xd65e('0xc5')](_0x5a91d9['query'][_0xd65e('0x6e')])){for(var _0x146793=0x0;_0x146793<_0x5a91d9['query']['ids'][_0xd65e('0x49')];_0x146793+=0x1){socket[_0xd65e('0xc2')](_0xd65e('0xc6'),{'UserId':Number(_0x5a91d9[_0xd65e('0x43')][_0xd65e('0x6e')][_0x146793]),'FaxAccountId':Number(_0x5a91d9[_0xd65e('0x57')]['id'])});}}else{socket[_0xd65e('0xc2')](_0xd65e('0xc6'),{'UserId':Number(_0x5a91d9[_0xd65e('0x43')]['ids']),'FaxAccountId':Number(_0x5a91d9[_0xd65e('0x57')]['id'])});}});}})[_0xd65e('0x1d')](respondWithStatusCode(_0x38a1a9,null))[_0xd65e('0x27')](handleError(_0x38a1a9,null));};exports[_0xd65e('0xc7')]=function(_0xf5319f,_0x39892c,_0x11e230){var _0x26f05d={};var _0x36c6f6={};var _0x338ba6;var _0x46940d;return db[_0xd65e('0x53')]['findOne']({'where':{'id':_0xf5319f[_0xd65e('0x57')]['id']}})['then'](handleEntityNotFound(_0x39892c,null))['then'](function(_0x280261){if(_0x280261){_0x338ba6=_0x280261;_0x36c6f6[_0xd65e('0x46')]=_['keys'](db[_0xd65e('0x73')]['rawAttributes']);_0x36c6f6['query']=_[_0xd65e('0x42')](_0xf5319f['query']);_0x36c6f6[_0xd65e('0x44')]=_[_0xd65e('0x45')](_0x36c6f6[_0xd65e('0x46')],_0x36c6f6[_0xd65e('0x43')]);_0x26f05d['attributes']=_[_0xd65e('0x45')](_0x36c6f6[_0xd65e('0x46')],qs[_0xd65e('0x48')](_0xf5319f[_0xd65e('0x43')][_0xd65e('0x48')]));_0x26f05d['attributes']=_0x26f05d[_0xd65e('0x47')][_0xd65e('0x49')]?_0x26f05d[_0xd65e('0x47')]:_0x36c6f6[_0xd65e('0x46')];_0x26f05d['order']=qs[_0xd65e('0x4d')](_0xf5319f[_0xd65e('0x43')][_0xd65e('0x4d')]);_0x26f05d['where']=qs['filters'](_[_0xd65e('0x6c')](_0xf5319f[_0xd65e('0x43')],_0x36c6f6['filters']));if(_0xf5319f[_0xd65e('0x43')][_0xd65e('0x4f')]){_0x26f05d[_0xd65e('0x4e')]=_[_0xd65e('0x50')](_0x26f05d[_0xd65e('0x4e')],{'$or':_['map'](_0x26f05d['attributes'],function(_0x26c838){var _0x594a10={};_0x594a10[_0x26c838]={'$like':'%'+_0xf5319f[_0xd65e('0x43')][_0xd65e('0x4f')]+'%'};return _0x594a10;})});}_0x26f05d=_[_0xd65e('0x50')]({},_0x26f05d,_0xf5319f['options']);return _0x338ba6['getAgents'](_0x26f05d);}})[_0xd65e('0x1d')](function(_0x14871e){if(_0x14871e){_0x46940d=_0x14871e['length'];if(!_0xf5319f[_0xd65e('0x43')][_0xd65e('0x4a')](_0xd65e('0x4b'))){_0x26f05d[_0xd65e('0x2e')]=qs[_0xd65e('0x2e')](_0xf5319f['query'][_0xd65e('0x2e')]);_0x26f05d[_0xd65e('0x2c')]=qs['offset'](_0xf5319f[_0xd65e('0x43')]['offset']);}return _0x338ba6[_0xd65e('0xc7')](_0x26f05d);}})['then'](function(_0x19aea2){if(_0x19aea2){return _0x19aea2?{'count':_0x46940d,'rows':_0x19aea2}:null;}})[_0xd65e('0x1d')](respondWithResult(_0x39892c,null))[_0xd65e('0x27')](handleError(_0x39892c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 12277de..c9a40bf 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 _0x2ed6=['FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x4e12ed,_0x304486){var _0x1034cd=function(_0x2e613b){while(--_0x2e613b){_0x4e12ed['push'](_0x4e12ed['shift']());}};_0x1034cd(++_0x304486);}(_0x2ed6,0x128));var _0x62ed=function(_0x231037,_0x3f6f96){_0x231037=_0x231037-0x0;var _0x45c13a=_0x2ed6[_0x231037];return _0x45c13a;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x62ed('0x0'))['db'][_0x62ed('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x62ed('0x2')](0x0);var events={'afterCreate':_0x62ed('0x3'),'afterUpdate':_0x62ed('0x4'),'afterDestroy':_0x62ed('0x5')};function emitEvent(_0x2781b8){return function(_0x469eed,_0x24b4aa,_0x30e2c6){FaxAccountEvents[_0x62ed('0x6')](_0x2781b8+':'+_0x469eed['id'],_0x469eed);FaxAccountEvents['emit'](_0x2781b8,_0x469eed);_0x30e2c6(null);};}for(var e in events){if(events[_0x62ed('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x62ed('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x9bb3=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x2044f2,_0x2a40b2){var _0xeae6ea=function(_0x32f2be){while(--_0x32f2be){_0x2044f2['push'](_0x2044f2['shift']());}};_0xeae6ea(++_0x2a40b2);}(_0x9bb3,0x134));var _0x39bb=function(_0x5a837f,_0x33a197){_0x5a837f=_0x5a837f-0x0;var _0x4e4db0=_0x9bb3[_0x5a837f];return _0x4e4db0;};'use strict';var EventEmitter=require(_0x39bb('0x0'));var FaxAccount=require(_0x39bb('0x1'))['db'][_0x39bb('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x39bb('0x3')](0x0);var events={'afterCreate':_0x39bb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x40566c){return function(_0xc3b9fd,_0x3cd3b9,_0x2e238f){FaxAccountEvents[_0x39bb('0x5')](_0x40566c+':'+_0xc3b9fd['id'],_0xc3b9fd);FaxAccountEvents[_0x39bb('0x5')](_0x40566c,_0xc3b9fd);_0x2e238f(null);};}for(var e in events){if(events[_0x39bb('0x6')](e)){var event=events[e];FaxAccount[_0x39bb('0x7')](e,emitEvent(event));}}module[_0x39bb('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 0acfb61..7ada1ad 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 _0xe971=['define','FaxAccount','fax_accounts','util','../../config/logger','moment','path','rimraf','../../config/environment','exports'];(function(_0x2b360e,_0x4f4efb){var _0x39d291=function(_0x1fb72c){while(--_0x1fb72c){_0x2b360e['push'](_0x2b360e['shift']());}};_0x39d291(++_0x4f4efb);}(_0xe971,0x1b1));var _0x1e97=function(_0x957c29,_0x336f99){_0x957c29=_0x957c29-0x0;var _0x4f9a8b=_0xe971[_0x957c29];return _0x4f9a8b;};'use strict';var _=require('lodash');var util=require(_0x1e97('0x0'));var logger=require(_0x1e97('0x1'))('api');var moment=require(_0x1e97('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e97('0x3'));var rimraf=require(_0x1e97('0x4'));var config=require(_0x1e97('0x5'));var attributes=require('./faxAccount.attributes');module[_0x1e97('0x6')]=function(_0x43ebd2,_0xe7f577){return _0x43ebd2[_0x1e97('0x7')](_0x1e97('0x8'),attributes,{'tableName':_0x1e97('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ca1=['fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxAccount.attributes','exports','define'];(function(_0x32fd11,_0x4df16b){var _0x4580a2=function(_0x12b60a){while(--_0x12b60a){_0x32fd11['push'](_0x32fd11['shift']());}};_0x4580a2(++_0x4df16b);}(_0x0ca1,0xe8));var _0x10ca=function(_0xc675cb,_0x486af5){_0xc675cb=_0xc675cb-0x0;var _0x1d306a=_0x0ca1[_0xc675cb];return _0x1d306a;};'use strict';var _=require('lodash');var util=require(_0x10ca('0x0'));var logger=require(_0x10ca('0x1'))(_0x10ca('0x2'));var moment=require(_0x10ca('0x3'));var BPromise=require(_0x10ca('0x4'));var rp=require(_0x10ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10ca('0x6'));var config=require('../../config/environment');var attributes=require(_0x10ca('0x7'));module[_0x10ca('0x8')]=function(_0x408775,_0x5e49ef){return _0x408775[_0x10ca('0x9')]('FaxAccount',attributes,{'tableName':_0x10ca('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 ea5a0c2..3a1381a 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 _0x2406=['CmList','List','Contacts','DESC','FaxApplication','get','applications','Applications','orderBy','priority','asc','ListId','contact','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','name','interaction','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','GetFaxAccount','FaxAccount','options','where','attributes','limit','include','map','model','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','find','account'];(function(_0x1da542,_0x34bb34){var _0x364bd5=function(_0x1719a4){while(--_0x1719a4){_0x1da542['push'](_0x1da542['shift']());}};_0x364bd5(++_0x34bb34);}(_0x2406,0x7c));var _0x6240=function(_0x4442a1,_0x445724){_0x4442a1=_0x4442a1-0x0;var _0xe82b8c=_0x2406[_0x4442a1];return _0xe82b8c;};'use strict';var _=require(_0x6240('0x0'));var util=require('util');var moment=require(_0x6240('0x1'));var BPromise=require(_0x6240('0x2'));var rs=require(_0x6240('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6240('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6240('0x5'))(_0x6240('0x6'));var config=require('../../config/environment');var jayson=require(_0x6240('0x7'));var client=jayson[_0x6240('0x8')][_0x6240('0x9')]({'port':0x232c});config['redis']=_[_0x6240('0xa')](config[_0x6240('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6240('0xc'))(new Redis(config[_0x6240('0xb')]));require(_0x6240('0xd'))[_0x6240('0xe')](socket);function respondWithRpcPromise(_0xdd1d18,_0x21f2ce,_0x556172){return new BPromise(function(_0x3e4be9,_0x18af4f){return client[_0x6240('0xf')](_0xdd1d18,_0x556172)[_0x6240('0x10')](function(_0x5e39d2){logger['info'](_0x6240('0x11'),_0x21f2ce,_0x6240('0x12'));logger[_0x6240('0x13')](_0x6240('0x14'),_0x21f2ce,_0x6240('0x12'),JSON['stringify'](_0x5e39d2));if(_0x5e39d2[_0x6240('0x15')]){if(_0x5e39d2[_0x6240('0x15')][_0x6240('0x16')]===0x1f4){logger['error'](_0x6240('0x11'),_0x21f2ce,_0x5e39d2[_0x6240('0x15')][_0x6240('0x17')]);return _0x18af4f(_0x5e39d2[_0x6240('0x15')][_0x6240('0x17')]);}logger[_0x6240('0x15')](_0x6240('0x11'),_0x21f2ce,_0x5e39d2[_0x6240('0x15')][_0x6240('0x17')]);return _0x3e4be9(_0x5e39d2[_0x6240('0x15')][_0x6240('0x17')]);}else{logger[_0x6240('0x18')](_0x6240('0x11'),_0x21f2ce,_0x6240('0x12'));_0x3e4be9(_0x5e39d2['result'][_0x6240('0x17')]);}})['catch'](function(_0xa98c85){logger['error'](_0x6240('0x11'),_0x21f2ce,_0xa98c85);_0x18af4f(_0xa98c85);});});}exports[_0x6240('0x19')]=function(_0x2c80fb){var _0x30eb8d=this;return new Promise(function(_0x17b5be,_0x214cd6){return db[_0x6240('0x1a')]['findAll']({'raw':_0x2c80fb['options']?_0x2c80fb[_0x6240('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2c80fb[_0x6240('0x1b')]?_0x2c80fb[_0x6240('0x1b')][_0x6240('0x1c')]||null:null,'attributes':_0x2c80fb[_0x6240('0x1b')]?_0x2c80fb[_0x6240('0x1b')][_0x6240('0x1d')]||null:null,'limit':_0x2c80fb['options']?_0x2c80fb[_0x6240('0x1b')][_0x6240('0x1e')]||null:null,'include':_0x2c80fb['options']?_0x2c80fb[_0x6240('0x1b')][_0x6240('0x1f')]?_[_0x6240('0x20')](_0x2c80fb[_0x6240('0x1b')][_0x6240('0x1f')],function(_0x5b5349){return{'model':db[_0x5b5349['model']],'as':_0x5b5349['as'],'attributes':_0x5b5349[_0x6240('0x1d')],'include':_0x5b5349[_0x6240('0x1f')]?_[_0x6240('0x20')](_0x5b5349[_0x6240('0x1f')],function(_0x5df761){return{'model':db[_0x5df761['model']],'as':_0x5df761['as'],'attributes':_0x5df761[_0x6240('0x1d')],'include':_0x5df761[_0x6240('0x1f')]?_[_0x6240('0x20')](_0x5df761[_0x6240('0x1f')],function(_0x4ee03a){return{'model':db[_0x4ee03a[_0x6240('0x21')]],'as':_0x4ee03a['as'],'attributes':_0x4ee03a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6240('0x10')](function(_0x4d65b0){logger['info']('GetFaxAccount',_0x2c80fb);logger[_0x6240('0x13')](_0x6240('0x19'),_0x2c80fb,JSON[_0x6240('0x22')](_0x4d65b0));_0x17b5be(_0x4d65b0);})[_0x6240('0x23')](function(_0x4df2e7){logger[_0x6240('0x15')](_0x6240('0x19'),_0x4df2e7[_0x6240('0x17')],_0x2c80fb);_0x214cd6(_0x30eb8d[_0x6240('0x15')](0x1f4,_0x4df2e7[_0x6240('0x17')]));});});};exports[_0x6240('0x24')]=function(_0x3337bd,_0x4b078d,_0x5130aa){var _0xafc5f5=this;return new Promise(function(_0xebd51f,_0x4ed815){var _0x5c5d74={'body':_0x3337bd[_0x6240('0x25')],'channel':_0x6240('0x26')};var _0x149698=[];var _0x3fee58=[];var _0x54493d={};return db[_0x6240('0x27')][_0x6240('0x28')]()[_0x6240('0x10')](function(_0x15ea49){if(!_0x15ea49){throw new db[(_0x6240('0x29'))][(_0x6240('0x2a'))]('no\x20available\x20attributes');}_0x149698=_[_0x6240('0x2b')](_[_0x6240('0x2c')](_0x15ea49),[_0x6240('0x2d'),_0x6240('0x2e')]);_0x3fee58=_['difference'](_[_0x6240('0x2c')](_0x15ea49),[_0x6240('0x2d'),_0x6240('0x2e'),_0x6240('0x2f'),'ListId']);if(_0x3337bd['body']['id']){delete _0x3337bd[_0x6240('0x25')]['id'];}if(_[_0x6240('0x30')](_0x3337bd['body'][_0x6240('0x31')])){throw new db['Sequelize'][(_0x6240('0x2a'))](_0x6240('0x32'));}if(_[_0x6240('0x30')](_0x3337bd[_0x6240('0x25')][_0x6240('0x25')])||_0x3337bd['body'][_0x6240('0x25')]===''){throw new db[(_0x6240('0x29'))][(_0x6240('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6240('0x30')](_0x3337bd[_0x6240('0x25')]['mapKey'])){throw new db['Sequelize'][(_0x6240('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fee58);}if(!_['includes'](_0x3fee58,_0x3337bd[_0x6240('0x25')][_0x6240('0x33')])){throw new db[(_0x6240('0x29'))][(_0x6240('0x2a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fee58);}_0x54493d[_0x3337bd[_0x6240('0x25')][_0x6240('0x33')]]=_0x3337bd[_0x6240('0x25')]['from'];})['then'](function(){return db[_0x6240('0x1a')][_0x6240('0x34')]({'where':{'id':_0x3337bd[_0x6240('0x35')]['id']},'include':[{'model':db[_0x6240('0x36')],'as':_0x6240('0x37'),'include':[{'model':db[_0x6240('0x27')],'as':_0x6240('0x38'),'where':_0x54493d,'limit':0x1,'order':[[_0x6240('0x2e'),_0x6240('0x39')]]}]},{'model':db[_0x6240('0x3a')],'as':'Applications'}]});})[_0x6240('0x10')](function(_0x1f5dbe){if(_0x1f5dbe&&_0x1f5dbe[_0x6240('0x37')]){var _0x3e2fee=_0x1f5dbe[_0x6240('0x3b')]({'plain':!![]});_0x5c5d74[_0x6240('0x35')]=_0x3e2fee;_0x5c5d74[_0x6240('0x3c')]=_0x3e2fee[_0x6240('0x3d')];_0x5c5d74['list']=_0x3e2fee[_0x6240('0x37')];_0x5c5d74[_0x6240('0x3c')]=_[_0x6240('0x3e')](_0x5c5d74['applications'],[_0x6240('0x3f')],[_0x6240('0x40')]);if(_0x5c5d74[_0x6240('0x35')]['Applications']){delete _0x5c5d74[_0x6240('0x35')][_0x6240('0x3d')];}if(_0x5c5d74['account'][_0x6240('0x37')]&&_0x5c5d74[_0x6240('0x35')]['List']['Contacts']['length']){return _0x5c5d74['account']['List'][_0x6240('0x38')][0x0];}var _0x29167e=_[_0x6240('0xa')](_0x3337bd[_0x6240('0x25')],{'firstName':_0x3337bd[_0x6240('0x25')]['from'],'ListId':_0x3e2fee[_0x6240('0x41')]});_0x29167e[_0x3337bd[_0x6240('0x25')][_0x6240('0x33')]]=_0x3337bd[_0x6240('0x25')]['from'];return db['CmContact']['create'](_0x29167e,{'fields':_0x149698,'raw':!![]});}})[_0x6240('0x10')](function(_0x54e7be){_0x5c5d74[_0x6240('0x42')]=_0x54e7be;if(_0x54e7be){var _0x1de47c={'ContactId':_0x54e7be['id'],'FaxAccountId':_0x3337bd[_0x6240('0x35')]['id'],'fax':_0x54e7be[_0x6240('0x26')]};return db[_0x6240('0x43')][_0x6240('0x34')]({'where':{'ContactId':_0x54e7be['id'],'closed':![],'FaxAccountId':_0x3337bd[_0x6240('0x35')]['id']}})[_0x6240('0x10')](function(_0x58bddb){if(_0x58bddb){return[_0x58bddb,![]];}return db['FaxInteraction'][_0x6240('0x44')](_0x1de47c)['then'](function(_0xa6dbed){return[_0xa6dbed,!![]];});});}else{throw new Error(_0x6240('0x45'));}})[_0x6240('0x46')](function(_0x22ac87,_0x529c57){var _0x31c7a4=_0x22ac87[_0x6240('0x3b')]({'plain':!![]});if(_0x529c57){if(_0x5c5d74[_0x6240('0x35')][_0x6240('0x47')]){_0x5c5d74[_0x6240('0x3c')][_0x6240('0x48')]({'id':0x0,'priority':_0x5c5d74[_0x6240('0x3c')][_0x6240('0x49')]+0x1,'app':_0x6240('0x4a'),'appdata':_0x6240('0x4b'),'interval':_0x6240('0x4c')});}_0x31c7a4[_0x6240('0x4d')]=!![];}else{_0x31c7a4[_0x6240('0x4d')]=![];}_0x5c5d74['interaction']=_0x31c7a4;return db['FaxMessage'][_0x6240('0x44')]({'body':_0x3337bd[_0x6240('0x25')][_0x6240('0x25')],'FaxAccountId':_0x3337bd['account']['id'],'FaxInteractionId':_0x22ac87['id'],'direction':'in','ContactId':_0x22ac87[_0x6240('0x4e')],'AttachmentId':_0x3337bd[_0x6240('0x25')][_0x6240('0x4f')]});})[_0x6240('0x10')](function(_0x1179e0){_0x5c5d74['message']=_0x1179e0;if(_0x5c5d74['interaction'][_0x6240('0x50')]){return db[_0x6240('0x51')][_0x6240('0x34')]({'attributes':['id',_0x6240('0x52')],'where':{'id':_0x5c5d74[_0x6240('0x53')][_0x6240('0x50')]}})[_0x6240('0x10')](function(_0x375b6c){if(_0x375b6c){_0x5c5d74['applications'][_0x6240('0x54')]({'id':0x0,'priority':0x0,'app':_0x6240('0x55'),'appdata':_0x375b6c[_0x6240('0x52')]+','+(_0x5c5d74[_0x6240('0x35')][_0x6240('0x56')]||0xa),'interval':_0x6240('0x4c')});}return respondWithRpcPromise(_0x6240('0x57'),_0x6240('0x58'),_0x5c5d74);});}return respondWithRpcPromise(_0x6240('0x57'),'startRouting',_0x5c5d74);})[_0x6240('0x10')](function(_0x4e5037){_0xebd51f(_0x4e5037);})[_0x6240('0x23')](function(_0x24ea3d){_0x4ed815(_0xafc5f5[_0x6240('0x15')](0x1f4,_0x24ea3d[_0x6240('0x17')]));});});}; \ No newline at end of file +var _0xd1d0=['no\x20available\x20attributes','difference','createdAt','keys','updatedAt','CompanyId','ListId','body','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','Applications','get','applications','list','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','util','moment','randomstring','ioredis','../../config/utils','client','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','debug','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','FaxAccount','findAll','options','limit','map','include','model','attributes','then','info','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','ValidationError'];(function(_0x23e8f1,_0x3a447e){var _0x293215=function(_0x50998e){while(--_0x50998e){_0x23e8f1['push'](_0x23e8f1['shift']());}};_0x293215(++_0x3a447e);}(_0xd1d0,0x1e1));var _0x0d1d=function(_0x238206,_0x428c99){_0x238206=_0x238206-0x0;var _0x472abe=_0xd1d0[_0x238206];return _0x472abe;};'use strict';var _=require('lodash');var util=require(_0x0d1d('0x0'));var moment=require(_0x0d1d('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d1d('0x2'));var fs=require('fs');var Redis=require(_0x0d1d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d1d('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d1d('0x5')]['http']({'port':0x232c});config['redis']=_[_0x0d1d('0x6')](config[_0x0d1d('0x7')],{'host':_0x0d1d('0x8'),'port':0x18eb});var socket=require(_0x0d1d('0x9'))(new Redis(config[_0x0d1d('0x7')]));require(_0x0d1d('0xa'))['register'](socket);function respondWithRpcPromise(_0x5ba907,_0x12befe,_0x3a961b){return new BPromise(function(_0x3beb75,_0x2f98cc){return client[_0x0d1d('0xb')](_0x5ba907,_0x3a961b)['then'](function(_0x51010e){logger['info']('FaxAccount,\x20%s,\x20%s',_0x12befe,'request\x20sent');logger[_0x0d1d('0xc')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x12befe,_0x0d1d('0xd'),JSON[_0x0d1d('0xe')](_0x51010e));if(_0x51010e[_0x0d1d('0xf')]){if(_0x51010e[_0x0d1d('0xf')][_0x0d1d('0x10')]===0x1f4){logger[_0x0d1d('0xf')](_0x0d1d('0x11'),_0x12befe,_0x51010e[_0x0d1d('0xf')][_0x0d1d('0x12')]);return _0x2f98cc(_0x51010e[_0x0d1d('0xf')][_0x0d1d('0x12')]);}logger[_0x0d1d('0xf')]('FaxAccount,\x20%s,\x20%s',_0x12befe,_0x51010e['error'][_0x0d1d('0x12')]);return _0x3beb75(_0x51010e['error'][_0x0d1d('0x12')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x12befe,'request\x20sent');_0x3beb75(_0x51010e['result'][_0x0d1d('0x12')]);}})['catch'](function(_0x5c119f){logger[_0x0d1d('0xf')](_0x0d1d('0x11'),_0x12befe,_0x5c119f);_0x2f98cc(_0x5c119f);});});}exports['GetFaxAccount']=function(_0x2213f8){var _0x2e0f30=this;return new Promise(function(_0x154b12,_0x90a04a){return db[_0x0d1d('0x13')][_0x0d1d('0x14')]({'raw':_0x2213f8['options']?_0x2213f8['options']['raw']===undefined?!![]:![]:!![],'where':_0x2213f8[_0x0d1d('0x15')]?_0x2213f8[_0x0d1d('0x15')]['where']||null:null,'attributes':_0x2213f8[_0x0d1d('0x15')]?_0x2213f8[_0x0d1d('0x15')]['attributes']||null:null,'limit':_0x2213f8['options']?_0x2213f8[_0x0d1d('0x15')][_0x0d1d('0x16')]||null:null,'include':_0x2213f8[_0x0d1d('0x15')]?_0x2213f8['options']['include']?_[_0x0d1d('0x17')](_0x2213f8['options'][_0x0d1d('0x18')],function(_0xaf54c7){return{'model':db[_0xaf54c7[_0x0d1d('0x19')]],'as':_0xaf54c7['as'],'attributes':_0xaf54c7[_0x0d1d('0x1a')],'include':_0xaf54c7[_0x0d1d('0x18')]?_['map'](_0xaf54c7['include'],function(_0x1f0b40){return{'model':db[_0x1f0b40[_0x0d1d('0x19')]],'as':_0x1f0b40['as'],'attributes':_0x1f0b40[_0x0d1d('0x1a')],'include':_0x1f0b40[_0x0d1d('0x18')]?_['map'](_0x1f0b40['include'],function(_0x13c203){return{'model':db[_0x13c203['model']],'as':_0x13c203['as'],'attributes':_0x13c203[_0x0d1d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0d1d('0x1b')](function(_0x233f5d){logger[_0x0d1d('0x1c')]('GetFaxAccount',_0x2213f8);logger[_0x0d1d('0xc')](_0x0d1d('0x1d'),_0x2213f8,JSON[_0x0d1d('0xe')](_0x233f5d));_0x154b12(_0x233f5d);})['catch'](function(_0x1aaed7){logger[_0x0d1d('0xf')]('GetFaxAccount',_0x1aaed7[_0x0d1d('0x12')],_0x2213f8);_0x90a04a(_0x2e0f30[_0x0d1d('0xf')](0x1f4,_0x1aaed7[_0x0d1d('0x12')]));});});};exports[_0x0d1d('0x1e')]=function(_0x35c4e1,_0x6d5e1b,_0x5c87e0){var _0x4909a5=this;return new Promise(function(_0xc2c0e2,_0x216404){var _0x52e16d={'body':_0x35c4e1['body'],'channel':_0x0d1d('0x1f')};var _0x38335c=[];var _0x2219a6=[];var _0x15d6aa={};return db[_0x0d1d('0x20')][_0x0d1d('0x21')]()[_0x0d1d('0x1b')](function(_0x38a83f){if(!_0x38a83f){throw new db['Sequelize'][(_0x0d1d('0x22'))](_0x0d1d('0x23'));}_0x38335c=_[_0x0d1d('0x24')](_['keys'](_0x38a83f),[_0x0d1d('0x25'),'updatedAt']);_0x2219a6=_[_0x0d1d('0x24')](_[_0x0d1d('0x26')](_0x38a83f),['createdAt',_0x0d1d('0x27'),_0x0d1d('0x28'),_0x0d1d('0x29')]);if(_0x35c4e1[_0x0d1d('0x2a')]['id']){delete _0x35c4e1[_0x0d1d('0x2a')]['id'];}if(_['isNil'](_0x35c4e1[_0x0d1d('0x2a')][_0x0d1d('0x2b')])){throw new db['Sequelize'][(_0x0d1d('0x22'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x35c4e1['body'][_0x0d1d('0x2a')])||_0x35c4e1['body'][_0x0d1d('0x2a')]===''){throw new db[(_0x0d1d('0x2c'))][(_0x0d1d('0x22'))](_0x0d1d('0x2d'));}if(_[_0x0d1d('0x2e')](_0x35c4e1[_0x0d1d('0x2a')][_0x0d1d('0x2f')])){throw new db['Sequelize'][(_0x0d1d('0x22'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2219a6);}if(!_[_0x0d1d('0x30')](_0x2219a6,_0x35c4e1[_0x0d1d('0x2a')][_0x0d1d('0x2f')])){throw new db['Sequelize'][(_0x0d1d('0x22'))](_0x0d1d('0x31')+_0x2219a6);}_0x15d6aa[_0x35c4e1[_0x0d1d('0x2a')]['mapKey']]=_0x35c4e1[_0x0d1d('0x2a')][_0x0d1d('0x2b')];})['then'](function(){return db[_0x0d1d('0x13')][_0x0d1d('0x32')]({'where':{'id':_0x35c4e1[_0x0d1d('0x33')]['id']},'include':[{'model':db[_0x0d1d('0x34')],'as':_0x0d1d('0x35'),'include':[{'model':db[_0x0d1d('0x20')],'as':_0x0d1d('0x36'),'where':_0x15d6aa,'limit':0x1,'order':[[_0x0d1d('0x27'),_0x0d1d('0x37')]]}]},{'model':db['FaxApplication'],'as':_0x0d1d('0x38')}]});})[_0x0d1d('0x1b')](function(_0x2c6eb8){if(_0x2c6eb8&&_0x2c6eb8[_0x0d1d('0x35')]){var _0x2cbd7a=_0x2c6eb8[_0x0d1d('0x39')]({'plain':!![]});_0x52e16d[_0x0d1d('0x33')]=_0x2cbd7a;_0x52e16d[_0x0d1d('0x3a')]=_0x2cbd7a[_0x0d1d('0x38')];_0x52e16d[_0x0d1d('0x3b')]=_0x2cbd7a['List'];_0x52e16d[_0x0d1d('0x3a')]=_[_0x0d1d('0x3c')](_0x52e16d['applications'],[_0x0d1d('0x3d')],[_0x0d1d('0x3e')]);if(_0x52e16d[_0x0d1d('0x33')][_0x0d1d('0x38')]){delete _0x52e16d[_0x0d1d('0x33')]['Applications'];}if(_0x52e16d[_0x0d1d('0x33')]['List']&&_0x52e16d[_0x0d1d('0x33')][_0x0d1d('0x35')][_0x0d1d('0x36')][_0x0d1d('0x3f')]){return _0x52e16d[_0x0d1d('0x33')][_0x0d1d('0x35')]['Contacts'][0x0];}var _0x4f9b90=_['defaults'](_0x35c4e1['body'],{'firstName':_0x35c4e1['body']['from'],'ListId':_0x2cbd7a[_0x0d1d('0x29')]});_0x4f9b90[_0x35c4e1['body'][_0x0d1d('0x2f')]]=_0x35c4e1[_0x0d1d('0x2a')][_0x0d1d('0x2b')];return db[_0x0d1d('0x20')][_0x0d1d('0x40')](_0x4f9b90,{'fields':_0x38335c,'raw':!![]});}})[_0x0d1d('0x1b')](function(_0x38dfb6){_0x52e16d[_0x0d1d('0x41')]=_0x38dfb6;if(_0x38dfb6){var _0x529670={'ContactId':_0x38dfb6['id'],'FaxAccountId':_0x35c4e1[_0x0d1d('0x33')]['id'],'fax':_0x38dfb6[_0x0d1d('0x1f')]};return db[_0x0d1d('0x42')][_0x0d1d('0x32')]({'where':{'ContactId':_0x38dfb6['id'],'closed':![],'FaxAccountId':_0x35c4e1['account']['id']}})[_0x0d1d('0x1b')](function(_0x1178a6){if(_0x1178a6){return[_0x1178a6,![]];}return db['FaxInteraction'][_0x0d1d('0x40')](_0x529670)['then'](function(_0x5dabab){return[_0x5dabab,!![]];});});}else{throw new Error(_0x0d1d('0x43'));}})[_0x0d1d('0x44')](function(_0x405f81,_0x6bfa92){var _0x3e8e8e=_0x405f81['get']({'plain':!![]});if(_0x6bfa92){if(_0x52e16d['account'][_0x0d1d('0x45')]){_0x52e16d['applications'][_0x0d1d('0x46')]({'id':0x0,'priority':_0x52e16d[_0x0d1d('0x3a')]['length']+0x1,'app':_0x0d1d('0x47'),'appdata':_0x0d1d('0x48'),'interval':_0x0d1d('0x49')});}_0x3e8e8e[_0x0d1d('0x4a')]=!![];}else{_0x3e8e8e[_0x0d1d('0x4a')]=![];}_0x52e16d[_0x0d1d('0x4b')]=_0x3e8e8e;return db[_0x0d1d('0x4c')][_0x0d1d('0x40')]({'body':_0x35c4e1[_0x0d1d('0x2a')][_0x0d1d('0x2a')],'FaxAccountId':_0x35c4e1['account']['id'],'FaxInteractionId':_0x405f81['id'],'direction':'in','ContactId':_0x405f81['ContactId'],'AttachmentId':_0x35c4e1[_0x0d1d('0x2a')][_0x0d1d('0x4d')]});})['then'](function(_0x1a1660){_0x52e16d[_0x0d1d('0x12')]=_0x1a1660;if(_0x52e16d[_0x0d1d('0x4b')][_0x0d1d('0x4e')]){return db[_0x0d1d('0x4f')][_0x0d1d('0x32')]({'attributes':['id','name'],'where':{'id':_0x52e16d['interaction'][_0x0d1d('0x4e')]}})[_0x0d1d('0x1b')](function(_0x351a6a){if(_0x351a6a){_0x52e16d['applications'][_0x0d1d('0x50')]({'id':0x0,'priority':0x0,'app':_0x0d1d('0x51'),'appdata':_0x351a6a[_0x0d1d('0x52')]+','+(_0x52e16d['account'][_0x0d1d('0x53')]||0xa),'interval':_0x0d1d('0x49')});}return respondWithRpcPromise(_0x0d1d('0x54'),_0x0d1d('0x55'),_0x52e16d);});}return respondWithRpcPromise(_0x0d1d('0x54'),_0x0d1d('0x55'),_0x52e16d);})[_0x0d1d('0x1b')](function(_0x4998cb){_0xc2c0e2(_0x4998cb);})['catch'](function(_0x1e420a){_0x216404(_0x4909a5[_0x0d1d('0xf')](0x1f4,_0x1e420a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index fc54d63..296df0c 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 _0x0c9f=['length','update','removeListener'];(function(_0x60866a,_0x37b5e1){var _0x2e3071=function(_0x1436c1){while(--_0x1436c1){_0x60866a['push'](_0x60866a['shift']());}};_0x2e3071(++_0x37b5e1);}(_0x0c9f,0x151));var _0xf0c9=function(_0x4e6f5e,_0xeca414){_0x4e6f5e=_0x4e6f5e-0x0;var _0x41e07b=_0x0c9f[_0x4e6f5e];return _0x41e07b;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save','remove',_0xf0c9('0x0')];function createListener(_0x46f2c1,_0x5f06e0){return function(_0x5e41d2){_0x5f06e0['emit'](_0x46f2c1,_0x5e41d2);};}function removeListener(_0x44fb71,_0x3faec7){return function(){FaxAccountEvents[_0xf0c9('0x1')](_0x44fb71,_0x3faec7);};}exports['register']=function(_0x323871){for(var _0x2c01d8=0x0,_0x59c4be=events[_0xf0c9('0x2')];_0x2c01d8<_0x59c4be;_0x2c01d8++){var _0x2f7c3c=events[_0x2c01d8];var _0x475541=createListener('faxAccount:'+_0x2f7c3c,_0x323871);FaxAccountEvents['on'](_0x2f7c3c,_0x475541);}}; \ No newline at end of file +var _0x6830=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x43105a,_0x4e04e9){var _0x482df2=function(_0x19a76c){while(--_0x19a76c){_0x43105a['push'](_0x43105a['shift']());}};_0x482df2(++_0x4e04e9);}(_0x6830,0x91));var _0x0683=function(_0x324255,_0x373fa1){_0x324255=_0x324255-0x0;var _0xe885e1=_0x6830[_0x324255];return _0xe885e1;};'use strict';var FaxAccountEvents=require(_0x0683('0x0'));var events=[_0x0683('0x1'),_0x0683('0x2'),_0x0683('0x3')];function createListener(_0x24e12b,_0x2c7b83){return function(_0x4c925f){_0x2c7b83[_0x0683('0x4')](_0x24e12b,_0x4c925f);};}function removeListener(_0x2c56f4,_0x30d002){return function(){FaxAccountEvents[_0x0683('0x5')](_0x2c56f4,_0x30d002);};}exports[_0x0683('0x6')]=function(_0x4a8f77){for(var _0x3382ea=0x0,_0x519e1d=events[_0x0683('0x7')];_0x3382ea<_0x519e1d;_0x3382ea++){var _0x48883b=events[_0x3382ea];var _0x309cad=createListener(_0x0683('0x8')+_0x48883b,_0x4a8f77);FaxAccountEvents['on'](_0x48883b,_0x309cad);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index b85035d..efb1c88 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x5316d3,_0x5cba98){var _0x27d9fa=function(_0x4c6d92){while(--_0x4c6d92){_0x5316d3['push'](_0x5316d3['shift']());}};_0x27d9fa(++_0x5cba98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x32ba88,_0x17e5e9){var _0x568a41=function(_0x184f0f){while(--_0x184f0f){_0x32ba88['push'](_0x32ba88['shift']());}};_0x568a41(++_0x17e5e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 0501bfb..fefb8c1 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 _0x4955=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x20e882,_0x16185c){var _0x3e0dbe=function(_0x3d0129){while(--_0x3d0129){_0x20e882['push'](_0x20e882['shift']());}};_0x3e0dbe(++_0x16185c);}(_0x4955,0xd0));var _0x5495=function(_0x229750,_0x57d457){_0x229750=_0x229750-0x0;var _0x458463=_0x4955[_0x229750];return _0x458463;};'use strict';var Sequelize=require(_0x5495('0x0'));module[_0x5495('0x1')]={'priority':{'type':Sequelize[_0x5495('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5495('0x3')],'allowNull':![],'defaultValue':_0x5495('0x4')},'appdata':{'type':Sequelize[_0x5495('0x5')]()},'description':{'type':Sequelize[_0x5495('0x3')]},'interval':{'type':Sequelize[_0x5495('0x3')],'defaultValue':_0x5495('0x6')}}; \ No newline at end of file +var _0x0a12=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0xc37399,_0x2bea35){var _0x31a4c8=function(_0x41099b){while(--_0x41099b){_0xc37399['push'](_0xc37399['shift']());}};_0x31a4c8(++_0x2bea35);}(_0x0a12,0x1e3));var _0x20a1=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x0a12[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require(_0x20a1('0x0'));module[_0x20a1('0x1')]={'priority':{'type':Sequelize[_0x20a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x20a1('0x3')],'allowNull':![],'defaultValue':_0x20a1('0x4')},'appdata':{'type':Sequelize[_0x20a1('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x20a1('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4e2d622..a483bd6 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 _0x76c6=['save','update','then','destroy','error','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject'];(function(_0x298ebb,_0x5a4f51){var _0x375f36=function(_0x25309a){while(--_0x25309a){_0x298ebb['push'](_0x298ebb['shift']());}};_0x375f36(++_0x5a4f51);}(_0x76c6,0x6f));var _0x676c=function(_0x59d342,_0x4e8ea3){_0x59d342=_0x59d342-0x0;var _0x1f6ebe=_0x76c6[_0x59d342];return _0x1f6ebe;};'use strict';var emlformat=require(_0x676c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x676c('0x1'));var jsonpatch=require(_0x676c('0x2'));var rp=require(_0x676c('0x3'));var moment=require('moment');var BPromise=require(_0x676c('0x4'));var Mustache=require(_0x676c('0x5'));var util=require(_0x676c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x676c('0x7'));var ejs=require(_0x676c('0x8'));var fs=require('fs');var fs_extra=require(_0x676c('0x9'));var _=require(_0x676c('0xa'));var squel=require('squel');var crypto=require(_0x676c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x676c('0xc'));var toCsv=require(_0x676c('0x7'));var querystring=require(_0x676c('0xd'));var Papa=require(_0x676c('0xe'));var Redis=require(_0x676c('0xf'));var authService=require(_0x676c('0x10'));var qs=require(_0x676c('0x11'));var as=require(_0x676c('0x12'));var hardwareService=require(_0x676c('0x13'));var logger=require(_0x676c('0x14'))(_0x676c('0x15'));var utils=require('../../config/utils');var config=require(_0x676c('0x16'));var licenseUtil=require(_0x676c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x159dd7,_0x10a881){_0x10a881=_0x10a881||0xcc;return function(_0x1efb8b){if(_0x1efb8b){return _0x159dd7[_0x676c('0x18')](_0x10a881);}return _0x159dd7['status'](_0x10a881)[_0x676c('0x19')]();};}function respondWithResult(_0x4145c0,_0x1a8e0c){_0x1a8e0c=_0x1a8e0c||0xc8;return function(_0x11c326){if(_0x11c326){return _0x4145c0[_0x676c('0x1a')](_0x1a8e0c)[_0x676c('0x1b')](_0x11c326);}};}function respondWithFilteredResult(_0x3a6a80,_0xdfe75f){return function(_0x510452){if(_0x510452){var _0x2a4dab=typeof _0xdfe75f[_0x676c('0x1c')]===_0x676c('0x1d')&&typeof _0xdfe75f['limit']===_0x676c('0x1d');var _0x2b48bd=_0x510452[_0x676c('0x1e')];var _0x41fe35=_0x2a4dab?0x0:_0xdfe75f[_0x676c('0x1c')];var _0x24a4ea=_0x2a4dab?_0x510452[_0x676c('0x1e')]:_0xdfe75f[_0x676c('0x1c')]+_0xdfe75f[_0x676c('0x1f')];var _0x222a09;if(_0x24a4ea>=_0x2b48bd){_0x24a4ea=_0x2b48bd;_0x222a09=0xc8;}else{_0x222a09=0xce;}_0x3a6a80[_0x676c('0x1a')](_0x222a09);return _0x3a6a80[_0x676c('0x20')](_0x676c('0x21'),_0x41fe35+'-'+_0x24a4ea+'/'+_0x2b48bd)[_0x676c('0x1b')](_0x510452);}return null;};}function patchUpdates(_0x292a65){return function(_0x1b85ad){try{jsonpatch['apply'](_0x1b85ad,_0x292a65,!![]);}catch(_0x4df8a2){return BPromise[_0x676c('0x22')](_0x4df8a2);}return _0x1b85ad[_0x676c('0x23')]();};}function saveUpdates(_0x284ac5,_0x5a0f2a){return function(_0x3a7754){if(_0x3a7754){return _0x3a7754[_0x676c('0x24')](_0x284ac5)[_0x676c('0x25')](function(_0x1c5483){return _0x1c5483;});}return null;};}function removeEntity(_0x5dfa3f,_0x415330){return function(_0x10b958){if(_0x10b958){return _0x10b958[_0x676c('0x26')]()[_0x676c('0x25')](function(){_0x5dfa3f[_0x676c('0x1a')](0xcc)[_0x676c('0x19')]();});}};}function handleEntityNotFound(_0x2e1a3a,_0x2e8ca8){return function(_0x5578cf){if(!_0x5578cf){_0x2e1a3a['sendStatus'](0x194);}return _0x5578cf;};}function handleError(_0x3575db,_0x465486){_0x465486=_0x465486||0x1f4;return function(_0x1183cf){logger[_0x676c('0x27')](_0x1183cf['stack']);if(_0x1183cf[_0x676c('0x28')]){delete _0x1183cf[_0x676c('0x28')];}_0x3575db[_0x676c('0x1a')](_0x465486)[_0x676c('0x29')](_0x1183cf);};}exports['index']=function(_0x1cd86b,_0x2f4020){var _0xbef5df={},_0x12f355={},_0x398ad8={'count':0x0,'rows':[]};var _0x1ac264=_[_0x676c('0x2a')](db[_0x676c('0x2b')][_0x676c('0x2c')],function(_0x284def){return{'name':_0x284def[_0x676c('0x2d')],'type':_0x284def[_0x676c('0x2e')][_0x676c('0x2f')]};});_0x12f355['model']=_[_0x676c('0x2a')](_0x1ac264,_0x676c('0x28'));_0x12f355[_0x676c('0x30')]=_[_0x676c('0x31')](_0x1cd86b[_0x676c('0x30')]);_0x12f355[_0x676c('0x32')]=_[_0x676c('0x33')](_0x12f355[_0x676c('0x34')],_0x12f355[_0x676c('0x30')]);_0xbef5df[_0x676c('0x35')]=_[_0x676c('0x33')](_0x12f355['model'],qs['fields'](_0x1cd86b[_0x676c('0x30')][_0x676c('0x36')]));_0xbef5df[_0x676c('0x35')]=_0xbef5df[_0x676c('0x35')][_0x676c('0x37')]?_0xbef5df[_0x676c('0x35')]:_0x12f355[_0x676c('0x34')];if(!_0x1cd86b[_0x676c('0x30')][_0x676c('0x38')]('nolimit')){_0xbef5df[_0x676c('0x1f')]=qs[_0x676c('0x1f')](_0x1cd86b['query'][_0x676c('0x1f')]);_0xbef5df[_0x676c('0x1c')]=qs['offset'](_0x1cd86b['query'][_0x676c('0x1c')]);}_0xbef5df['order']=qs[_0x676c('0x39')](_0x1cd86b[_0x676c('0x30')]['sort']);_0xbef5df[_0x676c('0x3a')]=qs[_0x676c('0x32')](_[_0x676c('0x3b')](_0x1cd86b[_0x676c('0x30')],_0x12f355[_0x676c('0x32')]),_0x1ac264);if(_0x1cd86b[_0x676c('0x30')]['filter']){_0xbef5df[_0x676c('0x3a')]=_[_0x676c('0x3c')](_0xbef5df[_0x676c('0x3a')],{'$or':_[_0x676c('0x2a')](_0x1ac264,function(_0x183ba1){if(_0x183ba1[_0x676c('0x2e')]!=='VIRTUAL'){var _0x1b5ba1={};_0x1b5ba1[_0x183ba1[_0x676c('0x28')]]={'$like':'%'+_0x1cd86b[_0x676c('0x30')][_0x676c('0x3d')]+'%'};return _0x1b5ba1;}})});}_0xbef5df=_['merge']({},_0xbef5df,_0x1cd86b[_0x676c('0x3e')]);var _0x3c5f9a={'where':_0xbef5df['where']};return db[_0x676c('0x2b')][_0x676c('0x1e')](_0x3c5f9a)[_0x676c('0x25')](function(_0x3b52e3){_0x398ad8['count']=_0x3b52e3;if(_0x1cd86b['query'][_0x676c('0x3f')]){_0xbef5df['include']=[{'all':!![]}];}return db[_0x676c('0x2b')][_0x676c('0x40')](_0xbef5df);})[_0x676c('0x25')](function(_0x5a0d94){_0x398ad8[_0x676c('0x41')]=_0x5a0d94;return _0x398ad8;})[_0x676c('0x25')](respondWithFilteredResult(_0x2f4020,_0xbef5df))[_0x676c('0x42')](handleError(_0x2f4020,null));};exports[_0x676c('0x43')]=function(_0x331d7c,_0x956e3a){var _0x256406={'raw':!![],'where':{'id':_0x331d7c['params']['id']}},_0x3c5b8b={};_0x3c5b8b[_0x676c('0x34')]=_[_0x676c('0x31')](db[_0x676c('0x2b')][_0x676c('0x2c')]);_0x3c5b8b[_0x676c('0x30')]=_[_0x676c('0x31')](_0x331d7c[_0x676c('0x30')]);_0x3c5b8b['filters']=_[_0x676c('0x33')](_0x3c5b8b[_0x676c('0x34')],_0x3c5b8b['query']);_0x256406[_0x676c('0x35')]=_[_0x676c('0x33')](_0x3c5b8b[_0x676c('0x34')],qs[_0x676c('0x36')](_0x331d7c['query'][_0x676c('0x36')]));_0x256406[_0x676c('0x35')]=_0x256406['attributes'][_0x676c('0x37')]?_0x256406[_0x676c('0x35')]:_0x3c5b8b[_0x676c('0x34')];if(_0x331d7c[_0x676c('0x30')][_0x676c('0x3f')]){_0x256406[_0x676c('0x44')]=[{'all':!![]}];}_0x256406=_[_0x676c('0x3c')]({},_0x256406,_0x331d7c['options']);return db[_0x676c('0x2b')][_0x676c('0x45')](_0x256406)[_0x676c('0x25')](handleEntityNotFound(_0x956e3a,null))['then'](respondWithResult(_0x956e3a,null))[_0x676c('0x42')](handleError(_0x956e3a,null));};exports['create']=function(_0x21c1bd,_0x1584aa){return db[_0x676c('0x2b')][_0x676c('0x46')](_0x21c1bd[_0x676c('0x47')],{})[_0x676c('0x25')](respondWithResult(_0x1584aa,0xc9))[_0x676c('0x42')](handleError(_0x1584aa,null));};exports[_0x676c('0x24')]=function(_0x2a5775,_0x2e165e){if(_0x2a5775[_0x676c('0x47')]['id']){delete _0x2a5775['body']['id'];}return db[_0x676c('0x2b')]['find']({'where':{'id':_0x2a5775['params']['id']}})['then'](handleEntityNotFound(_0x2e165e,null))['then'](saveUpdates(_0x2a5775[_0x676c('0x47')],null))[_0x676c('0x25')](respondWithResult(_0x2e165e,null))[_0x676c('0x42')](handleError(_0x2e165e,null));};exports[_0x676c('0x26')]=function(_0x4959e5,_0x8af4ea){return db[_0x676c('0x2b')][_0x676c('0x45')]({'where':{'id':_0x4959e5[_0x676c('0x48')]['id']}})['then'](handleEntityNotFound(_0x8af4ea,null))[_0x676c('0x25')](removeEntity(_0x8af4ea,null))[_0x676c('0x42')](handleError(_0x8af4ea,null));}; \ No newline at end of file +var _0x1412=['destroy','name','send','map','FaxApplication','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','rows','catch','show','params','filters','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','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','offset','undefined','limit','count','set','json','apply','save','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1412,0x1cb));var _0x2141=function(_0x49189a,_0x12d695){_0x49189a=_0x49189a-0x0;var _0x56b6aa=_0x1412[_0x49189a];return _0x56b6aa;};'use strict';var emlformat=require(_0x2141('0x0'));var rimraf=require(_0x2141('0x1'));var zipdir=require(_0x2141('0x2'));var jsonpatch=require(_0x2141('0x3'));var rp=require(_0x2141('0x4'));var moment=require(_0x2141('0x5'));var BPromise=require(_0x2141('0x6'));var Mustache=require(_0x2141('0x7'));var util=require('util');var path=require(_0x2141('0x8'));var sox=require('sox');var csv=require(_0x2141('0x9'));var ejs=require(_0x2141('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2141('0xb'));var crypto=require(_0x2141('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2141('0xd'));var toCsv=require(_0x2141('0x9'));var querystring=require(_0x2141('0xe'));var Papa=require(_0x2141('0xf'));var Redis=require(_0x2141('0x10'));var authService=require(_0x2141('0x11'));var qs=require(_0x2141('0x12'));var as=require(_0x2141('0x13'));var hardwareService=require(_0x2141('0x14'));var logger=require('../../config/logger')(_0x2141('0x15'));var utils=require(_0x2141('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2141('0x17'));var db=require(_0x2141('0x18'))['db'];function respondWithStatusCode(_0x568240,_0x4871b5){_0x4871b5=_0x4871b5||0xcc;return function(_0x67f8ce){if(_0x67f8ce){return _0x568240[_0x2141('0x19')](_0x4871b5);}return _0x568240[_0x2141('0x1a')](_0x4871b5)[_0x2141('0x1b')]();};}function respondWithResult(_0x4a53b1,_0x74b04f){_0x74b04f=_0x74b04f||0xc8;return function(_0x1e7066){if(_0x1e7066){return _0x4a53b1['status'](_0x74b04f)['json'](_0x1e7066);}};}function respondWithFilteredResult(_0x418d33,_0x20ff88){return function(_0x17aa99){if(_0x17aa99){var _0xa4a98d=typeof _0x20ff88[_0x2141('0x1c')]===_0x2141('0x1d')&&typeof _0x20ff88[_0x2141('0x1e')]===_0x2141('0x1d');var _0xf8588d=_0x17aa99[_0x2141('0x1f')];var _0x3702a9=_0xa4a98d?0x0:_0x20ff88[_0x2141('0x1c')];var _0x46109b=_0xa4a98d?_0x17aa99[_0x2141('0x1f')]:_0x20ff88[_0x2141('0x1c')]+_0x20ff88[_0x2141('0x1e')];var _0x3c2fe3;if(_0x46109b>=_0xf8588d){_0x46109b=_0xf8588d;_0x3c2fe3=0xc8;}else{_0x3c2fe3=0xce;}_0x418d33['status'](_0x3c2fe3);return _0x418d33[_0x2141('0x20')]('Content-Range',_0x3702a9+'-'+_0x46109b+'/'+_0xf8588d)[_0x2141('0x21')](_0x17aa99);}return null;};}function patchUpdates(_0x146a8c){return function(_0x31de1c){try{jsonpatch[_0x2141('0x22')](_0x31de1c,_0x146a8c,!![]);}catch(_0x3f9cc2){return BPromise['reject'](_0x3f9cc2);}return _0x31de1c[_0x2141('0x23')]();};}function saveUpdates(_0x445fa1,_0x24573d){return function(_0x34031e){if(_0x34031e){return _0x34031e[_0x2141('0x24')](_0x445fa1)[_0x2141('0x25')](function(_0xdc2661){return _0xdc2661;});}return null;};}function removeEntity(_0x3a3194,_0x24c703){return function(_0x223ad0){if(_0x223ad0){return _0x223ad0[_0x2141('0x26')]()[_0x2141('0x25')](function(){_0x3a3194[_0x2141('0x1a')](0xcc)[_0x2141('0x1b')]();});}};}function handleEntityNotFound(_0x300cd0,_0x11a2b1){return function(_0x3f3ca0){if(!_0x3f3ca0){_0x300cd0[_0x2141('0x19')](0x194);}return _0x3f3ca0;};}function handleError(_0x292de3,_0x47a467){_0x47a467=_0x47a467||0x1f4;return function(_0x1e9756){logger['error'](_0x1e9756['stack']);if(_0x1e9756['name']){delete _0x1e9756[_0x2141('0x27')];}_0x292de3['status'](_0x47a467)[_0x2141('0x28')](_0x1e9756);};}exports['index']=function(_0x4dde9c,_0x1da1d9){var _0x476d0e={},_0x1c7b1d={},_0x3753ae={'count':0x0,'rows':[]};var _0x851f00=_[_0x2141('0x29')](db[_0x2141('0x2a')][_0x2141('0x2b')],function(_0x3d2507){return{'name':_0x3d2507['fieldName'],'type':_0x3d2507[_0x2141('0x2c')][_0x2141('0x2d')]};});_0x1c7b1d[_0x2141('0x2e')]=_['map'](_0x851f00,_0x2141('0x27'));_0x1c7b1d[_0x2141('0x2f')]=_[_0x2141('0x30')](_0x4dde9c[_0x2141('0x2f')]);_0x1c7b1d['filters']=_[_0x2141('0x31')](_0x1c7b1d['model'],_0x1c7b1d['query']);_0x476d0e[_0x2141('0x32')]=_[_0x2141('0x31')](_0x1c7b1d[_0x2141('0x2e')],qs[_0x2141('0x33')](_0x4dde9c['query'][_0x2141('0x33')]));_0x476d0e['attributes']=_0x476d0e['attributes'][_0x2141('0x34')]?_0x476d0e['attributes']:_0x1c7b1d[_0x2141('0x2e')];if(!_0x4dde9c['query'][_0x2141('0x35')](_0x2141('0x36'))){_0x476d0e['limit']=qs[_0x2141('0x1e')](_0x4dde9c[_0x2141('0x2f')][_0x2141('0x1e')]);_0x476d0e[_0x2141('0x1c')]=qs[_0x2141('0x1c')](_0x4dde9c[_0x2141('0x2f')]['offset']);}_0x476d0e[_0x2141('0x37')]=qs[_0x2141('0x38')](_0x4dde9c['query'][_0x2141('0x38')]);_0x476d0e['where']=qs['filters'](_['pick'](_0x4dde9c[_0x2141('0x2f')],_0x1c7b1d['filters']),_0x851f00);if(_0x4dde9c[_0x2141('0x2f')][_0x2141('0x39')]){_0x476d0e[_0x2141('0x3a')]=_[_0x2141('0x3b')](_0x476d0e[_0x2141('0x3a')],{'$or':_[_0x2141('0x29')](_0x851f00,function(_0x3436c9){if(_0x3436c9['type']!=='VIRTUAL'){var _0x89072={};_0x89072[_0x3436c9[_0x2141('0x27')]]={'$like':'%'+_0x4dde9c[_0x2141('0x2f')][_0x2141('0x39')]+'%'};return _0x89072;}})});}_0x476d0e=_[_0x2141('0x3b')]({},_0x476d0e,_0x4dde9c[_0x2141('0x3c')]);var _0x80e437={'where':_0x476d0e[_0x2141('0x3a')]};return db[_0x2141('0x2a')]['count'](_0x80e437)[_0x2141('0x25')](function(_0x446fb1){_0x3753ae[_0x2141('0x1f')]=_0x446fb1;if(_0x4dde9c[_0x2141('0x2f')][_0x2141('0x3d')]){_0x476d0e[_0x2141('0x3e')]=[{'all':!![]}];}return db[_0x2141('0x2a')]['findAll'](_0x476d0e);})[_0x2141('0x25')](function(_0x54539a){_0x3753ae[_0x2141('0x3f')]=_0x54539a;return _0x3753ae;})[_0x2141('0x25')](respondWithFilteredResult(_0x1da1d9,_0x476d0e))[_0x2141('0x40')](handleError(_0x1da1d9,null));};exports[_0x2141('0x41')]=function(_0x588625,_0x185d5e){var _0x43e7c7={'raw':!![],'where':{'id':_0x588625[_0x2141('0x42')]['id']}},_0x5e4eaa={};_0x5e4eaa['model']=_['keys'](db['FaxApplication'][_0x2141('0x2b')]);_0x5e4eaa[_0x2141('0x2f')]=_['keys'](_0x588625['query']);_0x5e4eaa[_0x2141('0x43')]=_[_0x2141('0x31')](_0x5e4eaa['model'],_0x5e4eaa[_0x2141('0x2f')]);_0x43e7c7['attributes']=_[_0x2141('0x31')](_0x5e4eaa[_0x2141('0x2e')],qs['fields'](_0x588625[_0x2141('0x2f')]['fields']));_0x43e7c7['attributes']=_0x43e7c7[_0x2141('0x32')][_0x2141('0x34')]?_0x43e7c7[_0x2141('0x32')]:_0x5e4eaa[_0x2141('0x2e')];if(_0x588625['query'][_0x2141('0x3d')]){_0x43e7c7[_0x2141('0x3e')]=[{'all':!![]}];}_0x43e7c7=_[_0x2141('0x3b')]({},_0x43e7c7,_0x588625['options']);return db[_0x2141('0x2a')][_0x2141('0x44')](_0x43e7c7)[_0x2141('0x25')](handleEntityNotFound(_0x185d5e,null))[_0x2141('0x25')](respondWithResult(_0x185d5e,null))[_0x2141('0x40')](handleError(_0x185d5e,null));};exports[_0x2141('0x45')]=function(_0x56588b,_0x18076f){return db['FaxApplication'][_0x2141('0x45')](_0x56588b[_0x2141('0x46')],{})[_0x2141('0x25')](respondWithResult(_0x18076f,0xc9))[_0x2141('0x40')](handleError(_0x18076f,null));};exports[_0x2141('0x24')]=function(_0x52dab2,_0x4465e9){if(_0x52dab2[_0x2141('0x46')]['id']){delete _0x52dab2[_0x2141('0x46')]['id'];}return db[_0x2141('0x2a')][_0x2141('0x44')]({'where':{'id':_0x52dab2[_0x2141('0x42')]['id']}})[_0x2141('0x25')](handleEntityNotFound(_0x4465e9,null))[_0x2141('0x25')](saveUpdates(_0x52dab2[_0x2141('0x46')],null))[_0x2141('0x25')](respondWithResult(_0x4465e9,null))[_0x2141('0x40')](handleError(_0x4465e9,null));};exports[_0x2141('0x26')]=function(_0x1b9bba,_0x5139de){return db[_0x2141('0x2a')][_0x2141('0x44')]({'where':{'id':_0x1b9bba[_0x2141('0x42')]['id']}})[_0x2141('0x25')](handleEntityNotFound(_0x5139de,null))[_0x2141('0x25')](removeEntity(_0x5139de,null))[_0x2141('0x40')](handleError(_0x5139de,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8194951..bfd8d78 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 _0x875b=['bluebird','request-promise','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x1a3fe9,_0x1ec6ad){var _0x18826e=function(_0x41ace9){while(--_0x41ace9){_0x1a3fe9['push'](_0x1a3fe9['shift']());}};_0x18826e(++_0x1ec6ad);}(_0x875b,0x1a9));var _0xb875=function(_0x45096e,_0x17e82d){_0x45096e=_0x45096e-0x0;var _0xba1fa3=_0x875b[_0x45096e];return _0xba1fa3;};'use strict';var _=require(_0xb875('0x0'));var util=require('util');var logger=require(_0xb875('0x1'))(_0xb875('0x2'));var moment=require(_0xb875('0x3'));var BPromise=require(_0xb875('0x4'));var rp=require(_0xb875('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb875('0x6'));module[_0xb875('0x7')]=function(_0x6aa774,_0x238e66){return _0x6aa774[_0xb875('0x8')]('FaxApplication',attributes,{'tableName':_0xb875('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb875('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7228=['utf8mb4','util','../../config/logger','bluebird','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x115353,_0x422958){var _0x3ccc23=function(_0x380635){while(--_0x380635){_0x115353['push'](_0x115353['shift']());}};_0x3ccc23(++_0x422958);}(_0x7228,0x123));var _0x8722=function(_0x13bcd0,_0x29da7e){_0x13bcd0=_0x13bcd0-0x0;var _0x13e7cd=_0x7228[_0x13bcd0];return _0x13e7cd;};'use strict';var _=require('lodash');var util=require(_0x8722('0x0'));var logger=require(_0x8722('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8722('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8722('0x3'));var config=require(_0x8722('0x4'));var attributes=require(_0x8722('0x5'));module[_0x8722('0x6')]=function(_0x572dd1,_0x153332){return _0x572dd1[_0x8722('0x7')](_0x8722('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8722('0x9'),'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 01bfd6d..900402a 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 _0x6c2f=['request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','body','raw','options','where','limit','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6c2f,0x95));var _0xf6c2=function(_0x553298,_0x317e89){_0x553298=_0x553298-0x0;var _0x4e6d19=_0x6c2f[_0x553298];return _0x4e6d19;};'use strict';var _=require(_0xf6c2('0x0'));var util=require(_0xf6c2('0x1'));var moment=require(_0xf6c2('0x2'));var BPromise=require(_0xf6c2('0x3'));var rs=require(_0xf6c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6c2('0x5'))['db'];var utils=require(_0xf6c2('0x6'));var logger=require(_0xf6c2('0x7'))(_0xf6c2('0x8'));var config=require(_0xf6c2('0x9'));var jayson=require(_0xf6c2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18e2ef,_0x6dac00,_0x349eb3){return new BPromise(function(_0xecd8cd,_0x5467d7){return client[_0xf6c2('0xb')](_0x18e2ef,_0x349eb3)[_0xf6c2('0xc')](function(_0x455e13){logger[_0xf6c2('0xd')](_0xf6c2('0xe'),_0x6dac00,_0xf6c2('0xf'));logger[_0xf6c2('0x10')](_0xf6c2('0x11'),_0x6dac00,_0xf6c2('0xf'),JSON[_0xf6c2('0x12')](_0x455e13));if(_0x455e13[_0xf6c2('0x13')]){if(_0x455e13[_0xf6c2('0x13')][_0xf6c2('0x14')]===0x1f4){logger[_0xf6c2('0x13')]('FaxApplication,\x20%s,\x20%s',_0x6dac00,_0x455e13[_0xf6c2('0x13')][_0xf6c2('0x15')]);return _0x5467d7(_0x455e13[_0xf6c2('0x13')][_0xf6c2('0x15')]);}logger[_0xf6c2('0x13')](_0xf6c2('0xe'),_0x6dac00,_0x455e13[_0xf6c2('0x13')]['message']);return _0xecd8cd(_0x455e13[_0xf6c2('0x13')]['message']);}else{logger[_0xf6c2('0xd')](_0xf6c2('0xe'),_0x6dac00,'request\x20sent');_0xecd8cd(_0x455e13[_0xf6c2('0x16')][_0xf6c2('0x15')]);}})[_0xf6c2('0x17')](function(_0x11d349){logger['error']('FaxApplication,\x20%s,\x20%s',_0x6dac00,_0x11d349);_0x5467d7(_0x11d349);});});}exports['UpdateFaxApplication']=function(_0x599d5e){var _0x133a9b=this;return new Promise(function(_0x56b87,_0x5850f9){return db[_0xf6c2('0x18')][_0xf6c2('0x19')](_0x599d5e[_0xf6c2('0x1a')],{'raw':_0x599d5e['options']?_0x599d5e['options'][_0xf6c2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x599d5e[_0xf6c2('0x1c')]?_0x599d5e[_0xf6c2('0x1c')][_0xf6c2('0x1d')]||null:null,'attributes':_0x599d5e[_0xf6c2('0x1c')]?_0x599d5e['options']['attributes']||null:null,'limit':_0x599d5e[_0xf6c2('0x1c')]?_0x599d5e[_0xf6c2('0x1c')][_0xf6c2('0x1e')]||null:null})[_0xf6c2('0xc')](function(_0x593467){logger['info'](_0xf6c2('0x1f'),_0x599d5e);logger[_0xf6c2('0x10')](_0xf6c2('0x1f'),_0x599d5e,JSON[_0xf6c2('0x12')](_0x593467));_0x56b87(_0x593467);})[_0xf6c2('0x17')](function(_0x48343e){logger[_0xf6c2('0x13')]('UpdateFaxApplication',_0x48343e['message'],_0x599d5e);_0x5850f9(_0x133a9b[_0xf6c2('0x13')](0x1f4,_0x48343e[_0xf6c2('0x15')]));});});}; \ No newline at end of file +var _0x56c0=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','stringify'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x56c0,0x174));var _0x056c=function(_0x48099d,_0x3abf72){_0x48099d=_0x48099d-0x0;var _0x1b626c=_0x56c0[_0x48099d];return _0x1b626c;};'use strict';var _=require('lodash');var util=require(_0x056c('0x0'));var moment=require('moment');var BPromise=require(_0x056c('0x1'));var rs=require(_0x056c('0x2'));var fs=require('fs');var Redis=require(_0x056c('0x3'));var db=require(_0x056c('0x4'))['db'];var utils=require(_0x056c('0x5'));var logger=require(_0x056c('0x6'))(_0x056c('0x7'));var config=require(_0x056c('0x8'));var jayson=require(_0x056c('0x9'));var client=jayson[_0x056c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16dac3,_0x21db5c,_0xdaad84){return new BPromise(function(_0xb9b398,_0x22a243){return client[_0x056c('0xb')](_0x16dac3,_0xdaad84)[_0x056c('0xc')](function(_0x338db1){logger[_0x056c('0xd')](_0x056c('0xe'),_0x21db5c,'request\x20sent');logger[_0x056c('0xf')](_0x056c('0x10'),_0x21db5c,'request\x20sent',JSON['stringify'](_0x338db1));if(_0x338db1[_0x056c('0x11')]){if(_0x338db1[_0x056c('0x11')]['code']===0x1f4){logger[_0x056c('0x11')](_0x056c('0xe'),_0x21db5c,_0x338db1[_0x056c('0x11')][_0x056c('0x12')]);return _0x22a243(_0x338db1[_0x056c('0x11')][_0x056c('0x12')]);}logger[_0x056c('0x11')](_0x056c('0xe'),_0x21db5c,_0x338db1[_0x056c('0x11')][_0x056c('0x12')]);return _0xb9b398(_0x338db1['error'][_0x056c('0x12')]);}else{logger[_0x056c('0xd')](_0x056c('0xe'),_0x21db5c,'request\x20sent');_0xb9b398(_0x338db1[_0x056c('0x13')][_0x056c('0x12')]);}})[_0x056c('0x14')](function(_0x4ad983){logger[_0x056c('0x11')](_0x056c('0xe'),_0x21db5c,_0x4ad983);_0x22a243(_0x4ad983);});});}exports['UpdateFaxApplication']=function(_0x1ec51b){var _0xd564e=this;return new Promise(function(_0x128c61,_0x39aa41){return db[_0x056c('0x15')][_0x056c('0x16')](_0x1ec51b[_0x056c('0x17')],{'raw':_0x1ec51b[_0x056c('0x18')]?_0x1ec51b[_0x056c('0x18')][_0x056c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec51b[_0x056c('0x18')]?_0x1ec51b[_0x056c('0x18')][_0x056c('0x1a')]||null:null,'attributes':_0x1ec51b[_0x056c('0x18')]?_0x1ec51b[_0x056c('0x18')][_0x056c('0x1b')]||null:null,'limit':_0x1ec51b[_0x056c('0x18')]?_0x1ec51b[_0x056c('0x18')][_0x056c('0x1c')]||null:null})[_0x056c('0xc')](function(_0xe63175){logger[_0x056c('0xd')]('UpdateFaxApplication',_0x1ec51b);logger[_0x056c('0xf')](_0x056c('0x1d'),_0x1ec51b,JSON[_0x056c('0x1e')](_0xe63175));_0x128c61(_0xe63175);})['catch'](function(_0x47839c){logger[_0x056c('0x11')]('UpdateFaxApplication',_0x47839c[_0x056c('0x12')],_0x1ec51b);_0x39aa41(_0xd564e[_0x056c('0x11')](0x1f4,_0x47839c[_0x056c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0c7c896..9afbd63 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 _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x590e71,_0x4c55ad){var _0x575304=function(_0x440d7b){while(--_0x440d7b){_0x590e71['push'](_0x590e71['shift']());}};_0x575304(++_0x4c55ad);}(_0xac4a,0x13f));var _0xaac4=function(_0x59fcc0,_0x4fa34f){_0x59fcc0=_0x59fcc0-0x0;var _0x451962=_0xac4a[_0x59fcc0];return _0x451962;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file +var _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x4cf5e8,_0x13acc4){var _0x41e414=function(_0xfa8d94){while(--_0xfa8d94){_0x4cf5e8['push'](_0x4cf5e8['shift']());}};_0x41e414(++_0x13acc4);}(_0x5c00,0x17e));var _0x05c0=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x5c00[_0x13187a];return _0x65b85f;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 3473e68..5c9d553 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 _0xd128=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd128,0x12b));var _0x8d12=function(_0x5d01d6,_0xfa8365){_0x5d01d6=_0x5d01d6-0x0;var _0x5eb446=_0xd128[_0x5d01d6];return _0x5eb446;};'use strict';var Sequelize=require(_0x8d12('0x0'));module[_0x8d12('0x1')]={'closed':{'type':Sequelize[_0x8d12('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8d12('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8d12('0x4')]},'note':{'type':Sequelize[_0x8d12('0x4')]},'read1stAt':{'type':Sequelize[_0x8d12('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8d12('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8d12('0x5')]('in',_0x8d12('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7de1=['exports','STRING','DATE','out','ENUM','sequelize'];(function(_0x15ecb2,_0x2bd427){var _0x761c4b=function(_0x45e5e9){while(--_0x45e5e9){_0x15ecb2['push'](_0x15ecb2['shift']());}};_0x761c4b(++_0x2bd427);}(_0x7de1,0x1cd));var _0x17de=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0x7de1[_0x37d0bc];return _0x170e60;};'use strict';var Sequelize=require(_0x17de('0x0'));module[_0x17de('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x17de('0x2')]},'secondDisposition':{'type':Sequelize[_0x17de('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x17de('0x3')]},'fax':{'type':Sequelize[_0x17de('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x17de('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x17de('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x17de('0x5')]('in',_0x17de('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index cfe04d0..33cb399 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 _0xb235=['FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','field','from','select','u.id','user_has_fax_interactions','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','catch','show','includeAll','merge','options','create','update','params','destroy','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','hasOwnProperty','pick','filter','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','color','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','tmp','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','Users','map','TagIds','Tags','split','forEach','push','talking','unmanaged','total','closed','UserId','waiting','answered','index'];(function(_0x421f33,_0x5d60cf){var _0x4492f7=function(_0x1a9f3a){while(--_0x1a9f3a){_0x421f33['push'](_0x421f33['shift']());}};_0x4492f7(++_0x5d60cf);}(_0xb235,0xa6));var _0x5b23=function(_0x4539ca,_0x3a07cd){_0x4539ca=_0x4539ca-0x0;var _0x552d4a=_0xb235[_0x4539ca];return _0x552d4a;};'use strict';var emlformat=require(_0x5b23('0x0'));var rimraf=require(_0x5b23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5b23('0x2'));var moment=require(_0x5b23('0x3'));var BPromise=require(_0x5b23('0x4'));var Mustache=require(_0x5b23('0x5'));var util=require(_0x5b23('0x6'));var path=require(_0x5b23('0x7'));var sox=require(_0x5b23('0x8'));var csv=require('to-csv');var ejs=require(_0x5b23('0x9'));var fs=require('fs');var fs_extra=require(_0x5b23('0xa'));var _=require(_0x5b23('0xb'));var squel=require(_0x5b23('0xc'));var crypto=require(_0x5b23('0xd'));var jsforce=require(_0x5b23('0xe'));var deskjs=require(_0x5b23('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5b23('0x10'));var Papa=require(_0x5b23('0x11'));var Redis=require('ioredis');var authService=require(_0x5b23('0x12'));var qs=require(_0x5b23('0x13'));var as=require(_0x5b23('0x14'));var hardwareService=require(_0x5b23('0x15'));var logger=require(_0x5b23('0x16'))(_0x5b23('0x17'));var utils=require('../../config/utils');var config=require(_0x5b23('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b23('0x19'))['db'];config[_0x5b23('0x1a')]=_['defaults'](config[_0x5b23('0x1a')],{'host':_0x5b23('0x1b'),'port':0x18eb});var socket=require(_0x5b23('0x1c'))(new Redis(config[_0x5b23('0x1a')]));require(_0x5b23('0x1d'))[_0x5b23('0x1e')](socket);function respondWithStatusCode(_0x490bd6,_0x4c224c){_0x4c224c=_0x4c224c||0xcc;return function(_0x3f5890){if(_0x3f5890){return _0x490bd6['sendStatus'](_0x4c224c);}return _0x490bd6['status'](_0x4c224c)[_0x5b23('0x1f')]();};}function respondWithResult(_0xfe2fc,_0x4a4094){_0x4a4094=_0x4a4094||0xc8;return function(_0x4624a1){if(_0x4624a1){return _0xfe2fc[_0x5b23('0x20')](_0x4a4094)[_0x5b23('0x21')](_0x4624a1);}};}function respondWithFilteredResult(_0x214df5,_0x521102){return function(_0xefd522){if(_0xefd522){var _0x597b90=typeof _0x521102[_0x5b23('0x22')]===_0x5b23('0x23')&&typeof _0x521102['limit']===_0x5b23('0x23');var _0x5dc7cd=_0xefd522[_0x5b23('0x24')];var _0x275f5b=_0x597b90?0x0:_0x521102['offset'];var _0x4f6d46=_0x597b90?_0xefd522['count']:_0x521102[_0x5b23('0x22')]+_0x521102[_0x5b23('0x25')];var _0x5efbae;if(_0x4f6d46>=_0x5dc7cd){_0x4f6d46=_0x5dc7cd;_0x5efbae=0xc8;}else{_0x5efbae=0xce;}_0x214df5['status'](_0x5efbae);return _0x214df5[_0x5b23('0x26')](_0x5b23('0x27'),_0x275f5b+'-'+_0x4f6d46+'/'+_0x5dc7cd)[_0x5b23('0x21')](_0xefd522);}return null;};}function patchUpdates(_0x228e30){return function(_0x193a1e){try{jsonpatch[_0x5b23('0x28')](_0x193a1e,_0x228e30,!![]);}catch(_0x487239){return BPromise[_0x5b23('0x29')](_0x487239);}return _0x193a1e[_0x5b23('0x2a')]();};}function saveUpdates(_0x4713ba,_0x3d8b82){return function(_0x45bfbe){if(_0x45bfbe){return _0x45bfbe['update'](_0x4713ba)[_0x5b23('0x2b')](function(_0x2bf5f1){return _0x2bf5f1;});}return null;};}function removeEntity(_0xfb21d0,_0x3dd1d9){return function(_0x1f485a){if(_0x1f485a){return _0x1f485a['destroy']()[_0x5b23('0x2b')](function(){_0xfb21d0[_0x5b23('0x20')](0xcc)[_0x5b23('0x1f')]();});}};}function handleEntityNotFound(_0x59ed37,_0x449fdb){return function(_0x29c4b8){if(!_0x29c4b8){_0x59ed37[_0x5b23('0x2c')](0x194);}return _0x29c4b8;};}function handleError(_0x5b9ed2,_0x178e92){_0x178e92=_0x178e92||0x1f4;return function(_0x55e83e){logger[_0x5b23('0x2d')](_0x55e83e[_0x5b23('0x2e')]);if(_0x55e83e[_0x5b23('0x2f')]){delete _0x55e83e['name'];}_0x5b9ed2[_0x5b23('0x20')](_0x178e92)['send'](_0x55e83e);};}function getInteractionUsers(_0x37762a,_0x411386){return new BPromise(function(_0x38436e,_0x1ff239){try{if(_0x411386[_0x37762a['id']]){_0x37762a[_0x5b23('0x30')]=_[_0x5b23('0x31')](_0x411386[_0x37762a['id']],function(_0x34f573){return{'id':_0x34f573['id'],'fullname':_0x34f573['fullname']};});}}catch(_0x4b7d7a){_0x1ff239(_0x4b7d7a);}_0x38436e(_0x37762a);});}function getInteractionTags(_0x29274a,_0x136f05){return new BPromise(function(_0x3f1e00,_0x37a5a3){try{if(_0x29274a[_0x5b23('0x32')]){_0x29274a[_0x5b23('0x33')]=[];_0x29274a[_0x5b23('0x32')][_0x5b23('0x34')](',')[_0x5b23('0x35')](function(_0x4a2fc7){_0x29274a[_0x5b23('0x33')][_0x5b23('0x36')](_0x136f05[_0x4a2fc7]);});}delete _0x29274a[_0x5b23('0x32')];}catch(_0x32c746){_0x37a5a3(_0x32c746);}_0x3f1e00(_0x29274a);});}function updateFaxInteraction(_0x564aa1,_0x24125f,_0x2c7a9a){return new BPromise(function(_0x52262f,_0x44b26c){return getInteractionUsers(_0x564aa1,_0x2c7a9a)[_0x5b23('0x2b')](function(_0x22570d){return getInteractionTags(_0x22570d,_0x24125f);})[_0x5b23('0x2b')](function(_0x4834de){return getStateInteraction(_0x4834de);})[_0x5b23('0x2b')](function(_0x4f84ec){_0x52262f(_0x4f84ec);})['catch'](function(_0x3f9674){_0x44b26c(_0x3f9674);});});}function getStateInteraction(_0x59faac){return new BPromise(function(_0x5868b5){_0x59faac['waiting']=0x0;_0x59faac[_0x5b23('0x37')]=0x0;_0x59faac['answered']=0x0;_0x59faac[_0x5b23('0x38')]=0x0;_0x59faac[_0x5b23('0x39')]=0x0;if(!_0x59faac[_0x5b23('0x3a')]&&!_0x59faac[_0x5b23('0x3b')]){_0x59faac[_0x5b23('0x3c')]+=0x1;}if(!_0x59faac['closed']&&_0x59faac[_0x5b23('0x3b')]){_0x59faac[_0x5b23('0x37')]+=0x1;if(_0x59faac[_0x5b23('0x3c')]){_0x59faac[_0x5b23('0x3c')]-=0x1;}}if(_0x59faac['closed']&&_0x59faac[_0x5b23('0x3b')]){_0x59faac[_0x5b23('0x3d')]+=0x1;if(_0x59faac[_0x5b23('0x37')]){_0x59faac[_0x5b23('0x37')]-=0x1;}}if(_0x59faac[_0x5b23('0x3a')]&&!_0x59faac[_0x5b23('0x3b')]){_0x59faac[_0x5b23('0x38')]+=0x1;if(_0x59faac[_0x5b23('0x3c')]){_0x59faac[_0x5b23('0x3c')]-=0x1;}}_0x59faac[_0x5b23('0x39')]+=0x1;_0x5868b5(_0x59faac);});}exports[_0x5b23('0x3e')]=function(_0x20c4f8,_0x131adb){var _0x5d9f90={},_0xeae17f={},_0x5bf532={'count':0x0,'rows':[]};var _0x355f21=_['map'](db[_0x5b23('0x3f')][_0x5b23('0x40')],function(_0x12c000){return{'name':_0x12c000[_0x5b23('0x41')],'type':_0x12c000[_0x5b23('0x42')][_0x5b23('0x43')]};});_0xeae17f[_0x5b23('0x44')]=_[_0x5b23('0x31')](_0x355f21,'name');_0xeae17f[_0x5b23('0x45')]=_[_0x5b23('0x46')](_0x20c4f8[_0x5b23('0x45')]);_0xeae17f['filters']=_[_0x5b23('0x47')](_0xeae17f[_0x5b23('0x44')],_0xeae17f[_0x5b23('0x45')]);_0x5d9f90[_0x5b23('0x48')]=_[_0x5b23('0x47')](_0xeae17f[_0x5b23('0x44')],qs[_0x5b23('0x49')](_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x49')]));_0x5d9f90[_0x5b23('0x48')]=_0x5d9f90[_0x5b23('0x48')]['length']?_0x5d9f90[_0x5b23('0x48')]:_0xeae17f['model'];if(!_0x20c4f8['query']['hasOwnProperty'](_0x5b23('0x4a'))){_0x5d9f90[_0x5b23('0x25')]=qs[_0x5b23('0x25')](_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x25')]);_0x5d9f90[_0x5b23('0x22')]=qs['offset'](_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x22')]);}_0x5d9f90[_0x5b23('0x4b')]=qs[_0x5b23('0x4c')](_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x4c')]);_0x5d9f90[_0x5b23('0x4d')]=qs[_0x5b23('0x4e')](_['pick'](_0x20c4f8[_0x5b23('0x45')],_0xeae17f[_0x5b23('0x4e')]),_0x355f21);var _0x5a0b72=[];var _0x1c8a6e=squel['select']()[_0x5b23('0x4f')]('id')[_0x5b23('0x4f')](_0x5b23('0x2f'))[_0x5b23('0x4f')]('color')[_0x5b23('0x50')]('tools_tags');var _0x4a8d93=squel[_0x5b23('0x51')]()[_0x5b23('0x4f')](_0x5b23('0x52'))[_0x5b23('0x4f')]('u.fullname')[_0x5b23('0x4f')]('ui.FaxInteractionId')[_0x5b23('0x50')](_0x5b23('0x53'),'ui')['left_join']('users','u',_0x5b23('0x54'));var _0x17c3e8=squel['select']()[_0x5b23('0x50')](_0x5b23('0x55'),'i')['left_join'](_0x5b23('0x56'),'c',_0x5b23('0x57'))[_0x5b23('0x58')](_0x5b23('0x59'),'o',_0x5b23('0x5a'))[_0x5b23('0x58')](_0x5b23('0x5b'),'a',_0x5b23('0x5c'))[_0x5b23('0x58')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0x5b23('0x58')](_0x5b23('0x5d'),'it',_0x5b23('0x5e'))['left_join'](_0x5b23('0x5f'),'t',_0x5b23('0x60'));var _0x3fb54a=squel['expr']();var _0x4dfe66=[];var _0x27a7d6=squel['expr']();var _0x50fac1;if(_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x61')]){_0x50fac1=as[_0x5b23('0x62')](_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x61')]);var _0x308152=_0x50fac1[_0x5b23('0x63')];for(var _0x37d598=0x0;_0x37d598<_0x50fac1[_0x5b23('0x64')][_0x5b23('0x65')];_0x37d598++){var _0x2c346f=_0x50fac1[_0x5b23('0x64')][_0x37d598];var _0x3bfb95='i';var _0x15ed05=_[_0x5b23('0x66')](_0x355f21,[_0x5b23('0x2f'),_0x2c346f[_0x5b23('0x4f')]]);if(!_0x15ed05){switch(_0x2c346f[_0x5b23('0x4f')]){case _0x5b23('0x67'):if(_0x2c346f[_0x5b23('0x68')]==0x1){_0x17c3e8[_0x5b23('0x69')]('`'+_0x2c346f[_0x5b23('0x4f')]+_0x5b23('0x6a'));}else{_0x17c3e8[_0x5b23('0x69')]('`'+_0x2c346f[_0x5b23('0x4f')]+_0x5b23('0x6b'));}break;case'Contact':if(_0x2c346f[_0x5b23('0x6c')]==='$substring'){if(_0x2c346f[_0x5b23('0x68')][_0x5b23('0x34')]('\x20')['length']>0x1){_0x3fb54a[_0x308152]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2c346f['value']),null);}else{var _0x171fb6='%'+_0x2c346f['value']+'%';_0x3fb54a[_0x308152]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x171fb6,_0x171fb6,_0x171fb6);}}else{_0x15ed05=_[_0x5b23('0x66')](_0x355f21,[_0x5b23('0x2f'),_0x5b23('0x6d')]);_0x2c346f[_0x5b23('0x4f')]=_0x5b23('0x6d');_0x5cc6f4=as[_0x5b23('0x6e')](_0x3bfb95,_0x15ed05[_0x5b23('0x42')],_0x2c346f);_0x3fb54a[_0x308152](_0x5cc6f4[_0x5b23('0x6f')],_0x5cc6f4[_0x5b23('0x68')][_0x5b23('0x70')],_0x5cc6f4['value']['end']);}break;case _0x5b23('0x71'):var _0x17212b=_0x2c346f['value'][_0x5b23('0x34')](',')['map'](function(_0xc172fe){return Number(_0xc172fe);});_0x17212b[_0x5b23('0x35')](function(_0x2c06cb){_0x27a7d6['or'](_0x5b23('0x72'),'%,'+_0x2c06cb+',%');});_0x4dfe66=_['union'](_0x4dfe66,_0x17212b);break;case _0x5b23('0x73'):if(_0x2c346f[_0x5b23('0x6c')]===_0x5b23('0x74')){_0x3fb54a[_0x308152](_0x5b23('0x75'),'%'+_0x2c346f[_0x5b23('0x68')]+'%',null);}else{_0x15ed05=_[_0x5b23('0x66')](_0x355f21,[_0x5b23('0x2f'),_0x5b23('0x3b')]);_0x2c346f[_0x5b23('0x4f')]='UserId';_0x5cc6f4=as['buildExpression'](_0x3bfb95,_0x15ed05[_0x5b23('0x42')],_0x2c346f);_0x3fb54a[_0x308152](_0x5cc6f4[_0x5b23('0x6f')],_0x5cc6f4[_0x5b23('0x68')][_0x5b23('0x70')],_0x5cc6f4['value']['end']);}break;case _0x5b23('0x76'):_0x5cc6f4=as['buildExpression']('me',null,_0x2c346f);_0x3fb54a[_0x308152](_0x5cc6f4[_0x5b23('0x6f')],_0x5cc6f4[_0x5b23('0x68')][_0x5b23('0x70')],_0x5cc6f4[_0x5b23('0x68')][_0x5b23('0x1f')]);break;}}else{var _0x5cc6f4=as['buildExpression'](_0x3bfb95,_0x15ed05[_0x5b23('0x42')],_0x2c346f);_0x3fb54a[_0x308152](_0x5cc6f4[_0x5b23('0x6f')],_0x5cc6f4[_0x5b23('0x68')][_0x5b23('0x70')],_0x5cc6f4[_0x5b23('0x68')][_0x5b23('0x1f')]);}}}else{var _0x28b838=_(_0x20c4f8[_0x5b23('0x45')])[_0x5b23('0x46')]()[_0x5b23('0x31')](function(_0x5eb41c){return _[_0x5b23('0x77')](_0x355f21,[_0x5b23('0x2f'),_0x5eb41c])?_0x5eb41c:undefined;})[_0x5b23('0x78')]()[_0x5b23('0x68')]();if(!_[_0x5b23('0x79')](_0x28b838)){_0x28b838[_0x5b23('0x35')](function(_0x3b7cb6){if(_0x3b7cb6===_0x5b23('0x7a')){_0x17c3e8[_0x5b23('0x4d')](_0x5b23('0x7b'),[][_0x5b23('0x7c')](_0x20c4f8[_0x5b23('0x45')][_0x3b7cb6]));}else if(_0x3b7cb6===_0x5b23('0x7d')){var _0x27b3a1=JSON['parse'](_0x20c4f8['query'][_0x3b7cb6])[_0x5b23('0x7e')];var _0x37ed6a=JSON[_0x5b23('0x7f')](_0x20c4f8['query'][_0x3b7cb6])[_0x5b23('0x80')];_0x17c3e8[_0x5b23('0x4d')](_0x5b23('0x81'),_0x27b3a1,_0x37ed6a);}else{if(_0x20c4f8[_0x5b23('0x45')][_0x3b7cb6]===_0x5b23('0x82')){_0x17c3e8[_0x5b23('0x4d')]('i.'+_0x3b7cb6+_0x5b23('0x83'));}else{_0x17c3e8[_0x5b23('0x4d')]('i.'+_0x3b7cb6+_0x5b23('0x84'),_0x20c4f8[_0x5b23('0x45')][_0x3b7cb6]);}}});}if(_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x85')]){if(_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x85')]==0x1){_0x17c3e8[_0x5b23('0x69')](_0x5b23('0x86'));}else{_0x17c3e8[_0x5b23('0x69')](_0x5b23('0x87'));}}if(_0x20c4f8[_0x5b23('0x45')]['tag']){_0x4dfe66=_[_0x5b23('0x88')](_0x20c4f8[_0x5b23('0x45')]['tag'])?_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x89')]:new Array(_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x89')]);_0x4dfe66['forEach'](function(_0x1f93df){_0x27a7d6['or'](_0x5b23('0x72'),'%,'+_0x1f93df+',%');});}if(_0x20c4f8[_0x5b23('0x45')]['filter']){var _0x25cc2a=_0x20c4f8[_0x5b23('0x45')]['filter'][_0x5b23('0x8a')]('\x5c','\x5c\x5c')[_0x5b23('0x8a')](/'/g,'\x27\x27');if(qs[_0x5b23('0x8b')](_0x25cc2a)){_0x3fb54a['or'](_0x5b23('0x8c'),_0x25cc2a+'%')['or'](_0x5b23('0x8d'),_0x25cc2a+'%');}_0x3fb54a['or'](_0x5b23('0x8e'),_0x25cc2a+'%');}}_0x17c3e8['where'](_0x3fb54a);_0x17c3e8[_0x5b23('0x8f')](_0x5b23('0x90'));var _0x51fe3f={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x3ca244=_0x17c3e8[_0x5b23('0x91')]();_0x3ca244[_0x5b23('0x4f')]('i.id');_0x3ca244[_0x5b23('0x4f')](_0x5b23('0x92'),'unreadMessages');if(_0x5d9f90['order']){_0x5d9f90[_0x5b23('0x4b')][_0x5b23('0x35')](function(_0xf98e1f){var _0x3702b5=_0xf98e1f[0x0]===_0x5b23('0x93')?_0xf98e1f[0x0]:'i.'+_0xf98e1f[0x0];_0x17c3e8[_0x5b23('0x4b')](_0x3702b5,_0xf98e1f[0x1]===_0x5b23('0x94')?![]:!![]);});}if(!_[_0x5b23('0x79')](_0x4dfe66)){_0x17c3e8[_0x5b23('0x69')](_0x27a7d6);_0x3ca244[_0x5b23('0x4d')](_0x5b23('0x95'),_0x4dfe66);}BPromise[_0x5b23('0x96')]()['then'](function(){if(!_0x50fac1){if(_0x20c4f8[_0x5b23('0x45')][_0x5b23('0x7a')])return;_0x3ca244[_0x5b23('0x4d')](_0x5b23('0x97'));_0x17c3e8[_0x5b23('0x4d')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x20c4f8[_0x5b23('0x98')][_0x5b23('0x99')]!==_0x5b23('0x9a'))return;return _0x20c4f8[_0x5b23('0x98')][_0x5b23('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1f8b42){if(_['isEmpty'](_0x1f8b42)){_0x3ca244[_0x5b23('0x4d')](_0x5b23('0x9c'));_0x17c3e8['where'](_0x5b23('0x9c'));}else{_0x3ca244[_0x5b23('0x4d')](_0x5b23('0x7b'),_[_0x5b23('0x31')](_0x1f8b42,'id'));_0x17c3e8[_0x5b23('0x4d')](_0x5b23('0x7b'),_['map'](_0x1f8b42,'id'));}});})['then'](function(){if(_0x20c4f8['user'][_0x5b23('0x99')]==='agent'&&!_0x50fac1&&!_0x20c4f8['query'][_0x5b23('0x7a')])return[];return db[_0x5b23('0x9d')][_0x5b23('0x45')](_0x3ca244[_0x5b23('0x9e')](),_0x51fe3f);})['then'](function(_0x29e316){_0x5bf532[_0x5b23('0x24')]=_0x29e316[_0x5b23('0x65')];if(_0x5bf532['count']===0x0)return[];return db['sequelize'][_0x5b23('0x45')](_0x1c8a6e['toString'](),_0x51fe3f)[_0x5b23('0x2b')](function(_0x36c71c){_0x5a0b72=_[_0x5b23('0x9f')](_0x36c71c,'id');_0x51fe3f=_['merge'](_0x51fe3f,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20c4f8[_0x5b23('0x45')]['fields']){_0x5d9f90[_0x5b23('0x48')]['forEach'](function(_0x4a69ef){_0x17c3e8[_0x5b23('0x4f')]('i.'+_0x4a69ef);});}else{_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0x92'),_0x5b23('0x67'));_0x17c3e8[_0x5b23('0x4f')]('a.key',_0x5b23('0xa0'));_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xa1'),'Account.mandatoryDisposition');_0x17c3e8[_0x5b23('0x4f')]('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',_0x5b23('0x93'));_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xa2'));_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xa3'),_0x5b23('0xa4'));_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xa5'),'Contact.lastName');_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xa6'),_0x5b23('0xa7'));_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xa8'),_0x5b23('0xa9'));_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xaa'),_0x5b23('0xab'));_0x17c3e8['field'](_0x5b23('0xac'),_0x5b23('0xad'));_0x17c3e8[_0x5b23('0x4f')](_0x5b23('0xae'),_0x5b23('0xaf'));_0x17c3e8[_0x5b23('0x4f')]('o.internal',_0x5b23('0xb0'));_0x17c3e8['field'](_0x5b23('0xb1'),_0x5b23('0x32'));}if(_0x5d9f90[_0x5b23('0x25')])_0x17c3e8[_0x5b23('0x25')](_0x5d9f90[_0x5b23('0x25')]);if(_0x5d9f90[_0x5b23('0x22')])_0x17c3e8[_0x5b23('0x22')](_0x5d9f90['offset']);return db[_0x5b23('0x9d')][_0x5b23('0x45')](_0x17c3e8[_0x5b23('0x9e')](),_0x51fe3f);})[_0x5b23('0x2b')](function(_0x334e1f){if(_0x334e1f[_0x5b23('0x65')]>0x0)_0x4a8d93[_0x5b23('0x4d')](_0x5b23('0xb2'),_[_0x5b23('0x31')](_0x334e1f,'id'));return db[_0x5b23('0x9d')]['query'](_0x4a8d93['toString'](),_0x51fe3f)[_0x5b23('0x2b')](function(_0x6c8f1d){var _0x431ed9=_[_0x5b23('0xb3')](_0x6c8f1d,_0x5b23('0xb4'));var _0xe64141=[];_0x334e1f[_0x5b23('0x35')](function(_0x390494){_0xe64141[_0x5b23('0x36')](updateFaxInteraction(_0x390494,_0x5a0b72,_0x431ed9));});return BPromise[_0x5b23('0xb5')](_0xe64141);});});})[_0x5b23('0x2b')](function(_0x5ca40d){_0x5bf532[_0x5b23('0xb6')]=_0x5ca40d;return _0x5bf532;})[_0x5b23('0x2b')](respondWithFilteredResult(_0x131adb,_0x5d9f90))[_0x5b23('0xb7')](handleError(_0x131adb,null));};exports[_0x5b23('0xb8')]=function(_0x180ac3,_0x16e55f){var _0x2c7d7c={'raw':![],'where':{'id':_0x180ac3['params']['id']}},_0x56cce5={};_0x56cce5[_0x5b23('0x44')]=_[_0x5b23('0x46')](db[_0x5b23('0x3f')][_0x5b23('0x40')]);_0x56cce5[_0x5b23('0x45')]=_['keys'](_0x180ac3[_0x5b23('0x45')]);_0x56cce5[_0x5b23('0x4e')]=_[_0x5b23('0x47')](_0x56cce5[_0x5b23('0x44')],_0x56cce5['query']);_0x2c7d7c[_0x5b23('0x48')]=_[_0x5b23('0x47')](_0x56cce5[_0x5b23('0x44')],qs[_0x5b23('0x49')](_0x180ac3[_0x5b23('0x45')][_0x5b23('0x49')]));_0x2c7d7c[_0x5b23('0x48')]=_0x2c7d7c[_0x5b23('0x48')][_0x5b23('0x65')]?_0x2c7d7c[_0x5b23('0x48')]:_0x56cce5[_0x5b23('0x44')];if(_0x180ac3[_0x5b23('0x45')][_0x5b23('0xb9')]){_0x2c7d7c['include']=[{'all':!![]}];}_0x2c7d7c=_[_0x5b23('0xba')]({},_0x2c7d7c,_0x180ac3[_0x5b23('0xbb')]);return db[_0x5b23('0x3f')][_0x5b23('0x66')](_0x2c7d7c)[_0x5b23('0x2b')](handleEntityNotFound(_0x16e55f,null))['then'](respondWithResult(_0x16e55f,null))[_0x5b23('0xb7')](handleError(_0x16e55f,null));};exports[_0x5b23('0xbc')]=function(_0x33e7d7,_0x326b3a){return db[_0x5b23('0x3f')][_0x5b23('0xbc')](_0x33e7d7[_0x5b23('0x76')],{})[_0x5b23('0x2b')](respondWithResult(_0x326b3a,0xc9))[_0x5b23('0xb7')](handleError(_0x326b3a,null));};exports[_0x5b23('0xbd')]=function(_0x5db8d3,_0x4e8374){if(_0x5db8d3[_0x5b23('0x76')]['id']){delete _0x5db8d3[_0x5b23('0x76')]['id'];}return db[_0x5b23('0x3f')][_0x5b23('0x66')]({'where':{'id':_0x5db8d3[_0x5b23('0xbe')]['id']}})[_0x5b23('0x2b')](handleEntityNotFound(_0x4e8374,null))[_0x5b23('0x2b')](saveUpdates(_0x5db8d3[_0x5b23('0x76')],null))['then'](respondWithResult(_0x4e8374,null))['catch'](handleError(_0x4e8374,null));};exports[_0x5b23('0xbf')]=function(_0x3b5568,_0x3d4480){return db['FaxInteraction'][_0x5b23('0x66')]({'where':{'id':_0x3b5568[_0x5b23('0xbe')]['id']}})[_0x5b23('0x2b')](handleEntityNotFound(_0x3d4480,null))[_0x5b23('0x2b')](removeEntity(_0x3d4480,null))[_0x5b23('0xb7')](handleError(_0x3d4480,null));};exports[_0x5b23('0xc0')]=function(_0xa1b420,_0xce0383){return db['FaxInteraction'][_0x5b23('0xc0')]()['then'](respondWithResult(_0xce0383,null))['catch'](handleError(_0xce0383,null));};exports[_0x5b23('0xc1')]=function(_0x5e937b,_0x525aa6,_0x315706){return db['FaxMessage'][_0x5b23('0x66')]({'where':{'id':_0x5e937b['params']['id']}})[_0x5b23('0x2b')](handleEntityNotFound(_0x525aa6,null))['then'](function(_0x4bdc97){if(_0x4bdc97){return _0x4bdc97[_0x5b23('0xc1')](_0x5e937b[_0x5b23('0x76')][_0x5b23('0xc2')],_[_0x5b23('0xc3')](_0x5e937b['body'],[_0x5b23('0xc2'),'id'])||{});}})[_0x5b23('0x2b')](respondWithResult(_0x525aa6,null))[_0x5b23('0xb7')](handleError(_0x525aa6,null));};exports[_0x5b23('0xc4')]=function(_0x102d14,_0x5c9a8b,_0x9009c9){var _0x36f336={'raw':![],'where':{}};var _0x319afc={};var _0x2db911={'count':0x0,'rows':[]};return db[_0x5b23('0x3f')][_0x5b23('0xc5')]({'where':{'id':_0x102d14[_0x5b23('0xbe')]['id']}})[_0x5b23('0x2b')](handleEntityNotFound(_0x5c9a8b,null))['then'](function(_0x2e6838){if(_0x2e6838){_0x319afc[_0x5b23('0x44')]=_[_0x5b23('0x46')](db[_0x5b23('0xc6')][_0x5b23('0x40')]);_0x319afc[_0x5b23('0x45')]=_[_0x5b23('0x46')](_0x102d14[_0x5b23('0x45')]);_0x319afc['filters']=_[_0x5b23('0x47')](_0x319afc[_0x5b23('0x44')],_0x319afc[_0x5b23('0x45')]);_0x36f336[_0x5b23('0x48')]=_[_0x5b23('0x47')](_0x319afc['model'],qs[_0x5b23('0x49')](_0x102d14['query']['fields']));_0x36f336[_0x5b23('0x48')]=_0x36f336['attributes'][_0x5b23('0x65')]?_0x36f336['attributes']:_0x319afc[_0x5b23('0x44')];if(!_0x102d14[_0x5b23('0x45')][_0x5b23('0xc7')](_0x5b23('0x4a'))){_0x36f336[_0x5b23('0x25')]=qs[_0x5b23('0x25')](_0x102d14[_0x5b23('0x45')][_0x5b23('0x25')]);_0x36f336[_0x5b23('0x22')]=qs[_0x5b23('0x22')](_0x102d14[_0x5b23('0x45')][_0x5b23('0x22')]);}_0x36f336[_0x5b23('0x4b')]=qs[_0x5b23('0x4c')](_0x102d14['query'][_0x5b23('0x4c')]);_0x36f336[_0x5b23('0x4d')]=qs['filters'](_[_0x5b23('0xc8')](_0x102d14['query'],_0x319afc[_0x5b23('0x4e')]));_0x36f336[_0x5b23('0x4d')][_0x5b23('0xb4')]=_0x2e6838['id'];if(_0x102d14[_0x5b23('0x45')]['filter']){_0x36f336[_0x5b23('0x4d')]=_['merge'](_0x36f336[_0x5b23('0x4d')],{'$or':_['map'](_0x36f336[_0x5b23('0x48')],function(_0x3c57cd){var _0x45718f={};_0x45718f[_0x3c57cd]={'$like':'%'+_0x102d14[_0x5b23('0x45')][_0x5b23('0xc9')]+'%'};return _0x45718f;})});}if(_0x102d14[_0x5b23('0x45')][_0x5b23('0x7e')]){var _0x228d2c=_0x102d14[_0x5b23('0x45')]['$gte'][_0x5b23('0x34')](',');var _0x423a28={};_0x423a28[_0x228d2c[0x0]]={'$gte':moment(_0x228d2c[0x1])[_0x5b23('0xca')](_0x5b23('0xcb'))};_0x36f336[_0x5b23('0x4d')]=_[_0x5b23('0xba')](_0x36f336['where'],_0x423a28);}_0x36f336=_[_0x5b23('0xba')]({},_0x36f336,_0x102d14[_0x5b23('0xbb')]);return db[_0x5b23('0xc6')]['count']({'where':_0x36f336[_0x5b23('0x4d')]})['then'](function(_0x475179){_0x2db911[_0x5b23('0x24')]=_0x475179;if(_0x102d14[_0x5b23('0x45')]['includeAll']){_0x36f336[_0x5b23('0xcc')]=[{'all':!![]}];}return db[_0x5b23('0xc6')][_0x5b23('0xcd')](_0x36f336);})[_0x5b23('0x2b')](function(_0x457994){_0x2db911[_0x5b23('0xb6')]=_0x457994;return _0x2db911;});}})['then'](respondWithFilteredResult(_0x5c9a8b,_0x36f336))[_0x5b23('0xb7')](handleError(_0x5c9a8b,null));};exports[_0x5b23('0xce')]=function(_0x25dee1,_0x171a45,_0x480a49){return db[_0x5b23('0x3f')][_0x5b23('0x66')]({'where':{'id':_0x25dee1[_0x5b23('0xbe')]['id']}})[_0x5b23('0x2b')](handleEntityNotFound(_0x171a45,null))[_0x5b23('0x2b')](function(_0x31a146){if(_0x31a146){return _0x31a146[_0x5b23('0xcf')](_0x25dee1[_0x5b23('0x76')]['ids'],_[_0x5b23('0xc3')](_0x25dee1[_0x5b23('0x76')],['ids','id'])||{})['spread'](function(){return db[_0x5b23('0x71')][_0x5b23('0xcd')]({'attributes':['id','name',_0x5b23('0xd0')],'where':{'id':_0x25dee1[_0x5b23('0x76')][_0x5b23('0xc2')]}});})[_0x5b23('0x2b')](function(_0x3bfdba){socket[_0x5b23('0xd1')](_0x5b23('0xd2'),{'id':Number(_0x25dee1[_0x5b23('0xbe')]['id']),'tags':_0x3bfdba||[]});return{'id':Number(_0x25dee1['params']['id']),'tags':_0x3bfdba||[]};});}})[_0x5b23('0x2b')](respondWithResult(_0x171a45,null))['catch'](handleError(_0x171a45,null));};exports[_0x5b23('0xd3')]=function(_0x4f96d2,_0x1f8f28,_0x2dac3c){return db[_0x5b23('0x3f')]['find']({'where':{'id':_0x4f96d2['params']['id']}})[_0x5b23('0x2b')](handleEntityNotFound(_0x1f8f28,null))[_0x5b23('0x2b')](function(_0x260dd6){if(_0x260dd6){return _0x260dd6['removeTags'](_0x4f96d2[_0x5b23('0x45')][_0x5b23('0xc2')]);}})['then'](respondWithStatusCode(_0x1f8f28,null))['catch'](handleError(_0x1f8f28,null));};exports[_0x5b23('0xd4')]=function(_0x853fe,_0x2f2f9b){var _0x3a5506=moment()['unix']()['toString']();var _0x3888fd=path[_0x5b23('0xd5')](config[_0x5b23('0xd6')],_0x5b23('0xd7'),_0x5b23('0xd8'),_0x5b23('0xd9'));var _0x3c850e=path[_0x5b23('0xd5')](config[_0x5b23('0xd6')],_0x5b23('0xd7'),_0x5b23('0xd8'),'attachments');var _0x334eb6=path[_0x5b23('0xd5')](_0x3888fd,_0x3a5506);var _0x2e651a=util['format'](_0x5b23('0xda'),_0x853fe[_0x5b23('0xbe')]['id'],_0x3a5506);var _0x184a9d=path[_0x5b23('0xd5')](_0x3888fd,_0x2e651a);var _0x3df2b8=[];_0x3df2b8[_0x5b23('0x36')]({'model':db['Attachment'],'as':_0x5b23('0xdb'),'raw':!![]});var _0x153198=[{'model':db[_0x5b23('0xc6')],'as':_0x5b23('0xdc'),'attributes':['id',_0x5b23('0x76'),_0x5b23('0x7d')],'include':_0x3df2b8}];return db[_0x5b23('0x3f')]['find']({'where':{'id':_0x853fe['params']['id']},'include':_0x153198})[_0x5b23('0x2b')](handleEntityNotFound(_0x2f2f9b,null))[_0x5b23('0x2b')](function(_0xc73a38){if(_0xc73a38&&_0xc73a38[_0x5b23('0xdc')]){var _0x52f7f2=_0xc73a38['get']({'plain':!![]});fs[_0x5b23('0xdd')](_0x334eb6);for(var _0x3b1094=0x0;_0x3b1094<_0x52f7f2[_0x5b23('0xdc')][_0x5b23('0x65')];_0x3b1094++){var _0x300029=_0x52f7f2[_0x5b23('0xdc')][_0x3b1094][_0x5b23('0xdb')];if(_0x300029){var _0x22c0d5=path[_0x5b23('0xd5')](_0x3c850e,_0x300029[_0x5b23('0xde')]);if(fs[_0x5b23('0xdf')](_0x22c0d5)){fs[_0x5b23('0xe0')](_0x22c0d5)['pipe'](fs[_0x5b23('0xe1')](path['join'](_0x334eb6,_0x300029[_0x5b23('0xde')])));}}}return BPromise[_0x5b23('0x96')]()[_0x5b23('0x2b')](function(){return new BPromise(function(_0x4c75fe,_0x29d2b9){zipdir(_0x334eb6,{'saveTo':_0x184a9d},function(_0x11e39f,_0x3ad3d7){if(_0x11e39f)return _0x29d2b9(_0x11e39f);return _0x4c75fe(_0x3ad3d7);});})[_0x5b23('0x2b')](function(){return new BPromise(function(_0x4dcffe,_0x58f626){rimraf(_0x334eb6,function(_0x3f7ad8){if(_0x3f7ad8)_0x58f626(_0x3f7ad8);return _0x4dcffe();});});})[_0x5b23('0x2b')](function(){return _0x2f2f9b['download'](_0x184a9d,_0x2e651a,function(_0x19688d){if(_0x19688d){console[_0x5b23('0xe2')](_0x5b23('0xe3'),_0x19688d);}else{fs[_0x5b23('0xe4')](_0x184a9d);}});});});}else{return _0x2f2f9b[_0x5b23('0x2c')](0xc8);}})[_0x5b23('0xb7')](handleError(_0x2f2f9b,null));}; \ No newline at end of file +var _0xfa88=['end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','waiting','total','closed','UserId','answered','talking','unmanaged','index','FaxInteraction','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','getMessages','findOne','format','findAll','addTags','setTags','omit','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','status'];(function(_0xc4790d,_0x1016df){var _0x5202b9=function(_0x28ec3e){while(--_0x28ec3e){_0xc4790d['push'](_0xc4790d['shift']());}};_0x5202b9(++_0x1016df);}(_0xfa88,0x1a1));var _0x8fa8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfa88[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x8fa8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8fa8('0x1'));var rp=require('request-promise');var moment=require(_0x8fa8('0x2'));var BPromise=require(_0x8fa8('0x3'));var Mustache=require(_0x8fa8('0x4'));var util=require(_0x8fa8('0x5'));var path=require('path');var sox=require(_0x8fa8('0x6'));var csv=require(_0x8fa8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fa8('0x8'));var _=require(_0x8fa8('0x9'));var squel=require(_0x8fa8('0xa'));var crypto=require('crypto');var jsforce=require(_0x8fa8('0xb'));var deskjs=require(_0x8fa8('0xc'));var toCsv=require(_0x8fa8('0x7'));var querystring=require(_0x8fa8('0xd'));var Papa=require(_0x8fa8('0xe'));var Redis=require('ioredis');var authService=require(_0x8fa8('0xf'));var qs=require(_0x8fa8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fa8('0x11'));var logger=require(_0x8fa8('0x12'))(_0x8fa8('0x13'));var utils=require(_0x8fa8('0x14'));var config=require(_0x8fa8('0x15'));var licenseUtil=require(_0x8fa8('0x16'));var db=require(_0x8fa8('0x17'))['db'];config['redis']=_[_0x8fa8('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8fa8('0x19'))(new Redis(config[_0x8fa8('0x1a')]));require(_0x8fa8('0x1b'))[_0x8fa8('0x1c')](socket);function respondWithStatusCode(_0x21fe2b,_0xd35cd1){_0xd35cd1=_0xd35cd1||0xcc;return function(_0x9dc71d){if(_0x9dc71d){return _0x21fe2b[_0x8fa8('0x1d')](_0xd35cd1);}return _0x21fe2b[_0x8fa8('0x1e')](_0xd35cd1)[_0x8fa8('0x1f')]();};}function respondWithResult(_0x3b61fb,_0x1cf3ac){_0x1cf3ac=_0x1cf3ac||0xc8;return function(_0x52f650){if(_0x52f650){return _0x3b61fb[_0x8fa8('0x1e')](_0x1cf3ac)['json'](_0x52f650);}};}function respondWithFilteredResult(_0x329dae,_0x1404b5){return function(_0x42696c){if(_0x42696c){var _0x4ce576=typeof _0x1404b5['offset']===_0x8fa8('0x20')&&typeof _0x1404b5[_0x8fa8('0x21')]===_0x8fa8('0x20');var _0x412f42=_0x42696c['count'];var _0x40295c=_0x4ce576?0x0:_0x1404b5[_0x8fa8('0x22')];var _0x4fba71=_0x4ce576?_0x42696c[_0x8fa8('0x23')]:_0x1404b5['offset']+_0x1404b5[_0x8fa8('0x21')];var _0x252051;if(_0x4fba71>=_0x412f42){_0x4fba71=_0x412f42;_0x252051=0xc8;}else{_0x252051=0xce;}_0x329dae[_0x8fa8('0x1e')](_0x252051);return _0x329dae[_0x8fa8('0x24')](_0x8fa8('0x25'),_0x40295c+'-'+_0x4fba71+'/'+_0x412f42)[_0x8fa8('0x26')](_0x42696c);}return null;};}function patchUpdates(_0x5d0cf2){return function(_0x1cfc47){try{jsonpatch[_0x8fa8('0x27')](_0x1cfc47,_0x5d0cf2,!![]);}catch(_0x5b253a){return BPromise[_0x8fa8('0x28')](_0x5b253a);}return _0x1cfc47[_0x8fa8('0x29')]();};}function saveUpdates(_0x5d37b7,_0x2418f6){return function(_0x4b946d){if(_0x4b946d){return _0x4b946d[_0x8fa8('0x2a')](_0x5d37b7)[_0x8fa8('0x2b')](function(_0x4358c4){return _0x4358c4;});}return null;};}function removeEntity(_0x1c777b,_0x44d7c2){return function(_0x3cb1ac){if(_0x3cb1ac){return _0x3cb1ac[_0x8fa8('0x2c')]()[_0x8fa8('0x2b')](function(){_0x1c777b[_0x8fa8('0x1e')](0xcc)[_0x8fa8('0x1f')]();});}};}function handleEntityNotFound(_0x2352ab,_0x239478){return function(_0x5f3fe1){if(!_0x5f3fe1){_0x2352ab[_0x8fa8('0x1d')](0x194);}return _0x5f3fe1;};}function handleError(_0x30e60d,_0x378b1c){_0x378b1c=_0x378b1c||0x1f4;return function(_0x3e7261){logger[_0x8fa8('0x2d')](_0x3e7261['stack']);if(_0x3e7261[_0x8fa8('0x2e')]){delete _0x3e7261[_0x8fa8('0x2e')];}_0x30e60d[_0x8fa8('0x1e')](_0x378b1c)[_0x8fa8('0x2f')](_0x3e7261);};}function getInteractionUsers(_0x26a4a0,_0x1340c8){return new BPromise(function(_0x31d331,_0x3303d7){try{if(_0x1340c8[_0x26a4a0['id']]){_0x26a4a0[_0x8fa8('0x30')]=_[_0x8fa8('0x31')](_0x1340c8[_0x26a4a0['id']],function(_0x20b32f){return{'id':_0x20b32f['id'],'fullname':_0x20b32f['fullname']};});}}catch(_0x205507){_0x3303d7(_0x205507);}_0x31d331(_0x26a4a0);});}function getInteractionTags(_0x5a8e9d,_0xa753c0){return new BPromise(function(_0x1b778c,_0x9067aa){try{if(_0x5a8e9d[_0x8fa8('0x32')]){_0x5a8e9d[_0x8fa8('0x33')]=[];_0x5a8e9d[_0x8fa8('0x32')][_0x8fa8('0x34')](',')[_0x8fa8('0x35')](function(_0x170d1b){_0x5a8e9d[_0x8fa8('0x33')][_0x8fa8('0x36')](_0xa753c0[_0x170d1b]);});}delete _0x5a8e9d[_0x8fa8('0x32')];}catch(_0x1d3785){_0x9067aa(_0x1d3785);}_0x1b778c(_0x5a8e9d);});}function updateFaxInteraction(_0x3897b1,_0x4bcddd,_0x3e3eba){return new BPromise(function(_0x4c511c,_0x3dcfb4){return getInteractionUsers(_0x3897b1,_0x3e3eba)[_0x8fa8('0x2b')](function(_0x5a1a6d){return getInteractionTags(_0x5a1a6d,_0x4bcddd);})['then'](function(_0x5dd988){return getStateInteraction(_0x5dd988);})[_0x8fa8('0x2b')](function(_0x325ecc){_0x4c511c(_0x325ecc);})[_0x8fa8('0x37')](function(_0x3f5184){_0x3dcfb4(_0x3f5184);});});}function getStateInteraction(_0x50db7c){return new BPromise(function(_0x268f50){_0x50db7c[_0x8fa8('0x38')]=0x0;_0x50db7c['talking']=0x0;_0x50db7c['answered']=0x0;_0x50db7c['unmanaged']=0x0;_0x50db7c[_0x8fa8('0x39')]=0x0;if(!_0x50db7c[_0x8fa8('0x3a')]&&!_0x50db7c['UserId']){_0x50db7c[_0x8fa8('0x38')]+=0x1;}if(!_0x50db7c[_0x8fa8('0x3a')]&&_0x50db7c[_0x8fa8('0x3b')]){_0x50db7c['talking']+=0x1;if(_0x50db7c[_0x8fa8('0x38')]){_0x50db7c[_0x8fa8('0x38')]-=0x1;}}if(_0x50db7c[_0x8fa8('0x3a')]&&_0x50db7c[_0x8fa8('0x3b')]){_0x50db7c[_0x8fa8('0x3c')]+=0x1;if(_0x50db7c[_0x8fa8('0x3d')]){_0x50db7c[_0x8fa8('0x3d')]-=0x1;}}if(_0x50db7c[_0x8fa8('0x3a')]&&!_0x50db7c[_0x8fa8('0x3b')]){_0x50db7c[_0x8fa8('0x3e')]+=0x1;if(_0x50db7c[_0x8fa8('0x38')]){_0x50db7c['waiting']-=0x1;}}_0x50db7c['total']+=0x1;_0x268f50(_0x50db7c);});}exports[_0x8fa8('0x3f')]=function(_0x4dab67,_0x1ba0f1){var _0x54e801={},_0x2f7a6b={},_0xbf7a7d={'count':0x0,'rows':[]};var _0x38c5fe=_['map'](db[_0x8fa8('0x40')][_0x8fa8('0x41')],function(_0x49c034){return{'name':_0x49c034['fieldName'],'type':_0x49c034[_0x8fa8('0x42')][_0x8fa8('0x43')]};});_0x2f7a6b[_0x8fa8('0x44')]=_['map'](_0x38c5fe,_0x8fa8('0x2e'));_0x2f7a6b[_0x8fa8('0x45')]=_[_0x8fa8('0x46')](_0x4dab67[_0x8fa8('0x45')]);_0x2f7a6b['filters']=_[_0x8fa8('0x47')](_0x2f7a6b[_0x8fa8('0x44')],_0x2f7a6b[_0x8fa8('0x45')]);_0x54e801['attributes']=_[_0x8fa8('0x47')](_0x2f7a6b[_0x8fa8('0x44')],qs[_0x8fa8('0x48')](_0x4dab67[_0x8fa8('0x45')]['fields']));_0x54e801[_0x8fa8('0x49')]=_0x54e801['attributes'][_0x8fa8('0x4a')]?_0x54e801[_0x8fa8('0x49')]:_0x2f7a6b['model'];if(!_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x4b')](_0x8fa8('0x4c'))){_0x54e801[_0x8fa8('0x21')]=qs[_0x8fa8('0x21')](_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x21')]);_0x54e801['offset']=qs[_0x8fa8('0x22')](_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x22')]);}_0x54e801[_0x8fa8('0x4d')]=qs[_0x8fa8('0x4e')](_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x4e')]);_0x54e801[_0x8fa8('0x4f')]=qs[_0x8fa8('0x50')](_[_0x8fa8('0x51')](_0x4dab67[_0x8fa8('0x45')],_0x2f7a6b[_0x8fa8('0x50')]),_0x38c5fe);var _0x525f2d=[];var _0x3f408b=squel[_0x8fa8('0x52')]()[_0x8fa8('0x53')]('id')['field'](_0x8fa8('0x2e'))['field'](_0x8fa8('0x54'))[_0x8fa8('0x55')](_0x8fa8('0x56'));var _0xb66988=squel['select']()[_0x8fa8('0x53')](_0x8fa8('0x57'))['field']('u.fullname')['field'](_0x8fa8('0x58'))['from'](_0x8fa8('0x59'),'ui')[_0x8fa8('0x5a')](_0x8fa8('0x5b'),'u',_0x8fa8('0x5c'));var _0xcac2dc=squel[_0x8fa8('0x52')]()[_0x8fa8('0x55')]('fax_interactions','i')[_0x8fa8('0x5a')](_0x8fa8('0x5d'),'c',_0x8fa8('0x5e'))[_0x8fa8('0x5a')](_0x8fa8('0x5b'),'o','o.id\x20=\x20i.UserId')[_0x8fa8('0x5a')]('fax_accounts','a',_0x8fa8('0x5f'))[_0x8fa8('0x5a')](_0x8fa8('0x60'),'me',_0x8fa8('0x61'))[_0x8fa8('0x5a')](_0x8fa8('0x62'),'it',_0x8fa8('0x63'))['left_join'](_0x8fa8('0x56'),'t',_0x8fa8('0x64'));var _0x4e8a4b=squel['expr']();var _0x4f5b8f=[];var _0xc46a4a=squel[_0x8fa8('0x65')]();var _0x2b74b6;if(_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x66')]){_0x2b74b6=as[_0x8fa8('0x67')](_0x4dab67['query'][_0x8fa8('0x66')]);var _0x319ba5=_0x2b74b6[_0x8fa8('0x68')];for(var _0x50d6f2=0x0;_0x50d6f2<_0x2b74b6[_0x8fa8('0x69')][_0x8fa8('0x4a')];_0x50d6f2++){var _0x246e20=_0x2b74b6[_0x8fa8('0x69')][_0x50d6f2];var _0x3380f4='i';var _0x551291=_[_0x8fa8('0x6a')](_0x38c5fe,[_0x8fa8('0x2e'),_0x246e20[_0x8fa8('0x53')]]);if(!_0x551291){switch(_0x246e20[_0x8fa8('0x53')]){case _0x8fa8('0x6b'):if(_0x246e20[_0x8fa8('0x6c')]==0x1){_0xcac2dc[_0x8fa8('0x6d')]('`'+_0x246e20['field']+_0x8fa8('0x6e'));}else{_0xcac2dc[_0x8fa8('0x6d')]('`'+_0x246e20[_0x8fa8('0x53')]+'`\x20>\x200');}break;case'Contact':if(_0x246e20[_0x8fa8('0x6f')]===_0x8fa8('0x70')){if(_0x246e20[_0x8fa8('0x6c')][_0x8fa8('0x34')]('\x20')[_0x8fa8('0x4a')]>0x1){_0x4e8a4b[_0x319ba5](_0x8fa8('0x71'),qs[_0x8fa8('0x72')](_0x246e20['value']),null);}else{var _0x233152='%'+_0x246e20['value']+'%';_0x4e8a4b[_0x319ba5](_0x8fa8('0x73'),_0x233152,_0x233152,_0x233152);}}else{_0x551291=_[_0x8fa8('0x6a')](_0x38c5fe,[_0x8fa8('0x2e'),_0x8fa8('0x74')]);_0x246e20[_0x8fa8('0x53')]=_0x8fa8('0x74');_0x854697=as['buildExpression'](_0x3380f4,_0x551291[_0x8fa8('0x42')],_0x246e20);_0x4e8a4b[_0x319ba5](_0x854697[_0x8fa8('0x75')],_0x854697[_0x8fa8('0x6c')][_0x8fa8('0x76')],_0x854697[_0x8fa8('0x6c')][_0x8fa8('0x1f')]);}break;case'Tag':var _0x5af07d=_0x246e20[_0x8fa8('0x6c')][_0x8fa8('0x34')](',')[_0x8fa8('0x31')](function(_0xc26ba9){return Number(_0xc26ba9);});_0x5af07d[_0x8fa8('0x35')](function(_0x1e61f2){_0xc46a4a['or'](_0x8fa8('0x77'),'%,'+_0x1e61f2+',%');});_0x4f5b8f=_['union'](_0x4f5b8f,_0x5af07d);break;case _0x8fa8('0x78'):if(_0x246e20[_0x8fa8('0x6f')]==='$substring'){_0x4e8a4b[_0x319ba5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x246e20[_0x8fa8('0x6c')]+'%',null);}else{_0x551291=_[_0x8fa8('0x6a')](_0x38c5fe,[_0x8fa8('0x2e'),'UserId']);_0x246e20[_0x8fa8('0x53')]=_0x8fa8('0x3b');_0x854697=as[_0x8fa8('0x79')](_0x3380f4,_0x551291[_0x8fa8('0x42')],_0x246e20);_0x4e8a4b[_0x319ba5](_0x854697[_0x8fa8('0x75')],_0x854697['value'][_0x8fa8('0x76')],_0x854697[_0x8fa8('0x6c')][_0x8fa8('0x1f')]);}break;case _0x8fa8('0x7a'):_0x854697=as[_0x8fa8('0x79')]('me',null,_0x246e20);_0x4e8a4b[_0x319ba5](_0x854697[_0x8fa8('0x75')],_0x854697[_0x8fa8('0x6c')][_0x8fa8('0x76')],_0x854697['value']['end']);break;}}else{var _0x854697=as['buildExpression'](_0x3380f4,_0x551291[_0x8fa8('0x42')],_0x246e20);_0x4e8a4b[_0x319ba5](_0x854697[_0x8fa8('0x75')],_0x854697[_0x8fa8('0x6c')][_0x8fa8('0x76')],_0x854697[_0x8fa8('0x6c')]['end']);}}}else{var _0x1cff7d=_(_0x4dab67['query'])['keys']()[_0x8fa8('0x31')](function(_0x200397){return _[_0x8fa8('0x7b')](_0x38c5fe,[_0x8fa8('0x2e'),_0x200397])?_0x200397:undefined;})[_0x8fa8('0x7c')]()[_0x8fa8('0x6c')]();if(!_[_0x8fa8('0x7d')](_0x1cff7d)){_0x1cff7d[_0x8fa8('0x35')](function(_0x32220a){if(_0x32220a===_0x8fa8('0x7e')){_0xcac2dc[_0x8fa8('0x4f')](_0x8fa8('0x7f'),[][_0x8fa8('0x80')](_0x4dab67[_0x8fa8('0x45')][_0x32220a]));}else if(_0x32220a===_0x8fa8('0x81')){var _0x12da52=JSON[_0x8fa8('0x82')](_0x4dab67[_0x8fa8('0x45')][_0x32220a])[_0x8fa8('0x83')];var _0x27fd44=JSON['parse'](_0x4dab67[_0x8fa8('0x45')][_0x32220a])[_0x8fa8('0x84')];_0xcac2dc[_0x8fa8('0x4f')](_0x8fa8('0x85'),_0x12da52,_0x27fd44);}else{if(_0x4dab67[_0x8fa8('0x45')][_0x32220a]===_0x8fa8('0x86')){_0xcac2dc[_0x8fa8('0x4f')]('i.'+_0x32220a+_0x8fa8('0x87'));}else{_0xcac2dc[_0x8fa8('0x4f')]('i.'+_0x32220a+_0x8fa8('0x88'),_0x4dab67['query'][_0x32220a]);}}});}if(_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x89')]){if(_0x4dab67[_0x8fa8('0x45')]['read']==0x1){_0xcac2dc['having'](_0x8fa8('0x8a'));}else{_0xcac2dc[_0x8fa8('0x6d')](_0x8fa8('0x8b'));}}if(_0x4dab67['query'][_0x8fa8('0x8c')]){_0x4f5b8f=_[_0x8fa8('0x8d')](_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x8c')])?_0x4dab67['query']['tag']:new Array(_0x4dab67['query']['tag']);_0x4f5b8f[_0x8fa8('0x35')](function(_0x1a16ca){_0xc46a4a['or'](_0x8fa8('0x77'),'%,'+_0x1a16ca+',%');});}if(_0x4dab67[_0x8fa8('0x45')]['filter']){var _0x5ddbef=_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x8e')][_0x8fa8('0x8f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8fa8('0x90')](_0x5ddbef)){_0x4e8a4b['or'](_0x8fa8('0x91'),_0x5ddbef+'%')['or'](_0x8fa8('0x92'),_0x5ddbef+'%');}_0x4e8a4b['or'](_0x8fa8('0x93'),_0x5ddbef+'%');}}_0xcac2dc[_0x8fa8('0x4f')](_0x4e8a4b);_0xcac2dc[_0x8fa8('0x94')](_0x8fa8('0x95'));var _0x2543cc={'type':db[_0x8fa8('0x96')][_0x8fa8('0x97')][_0x8fa8('0x98')],'raw':!![]};var _0x3430e4=_0xcac2dc['clone']();_0x3430e4['field'](_0x8fa8('0x95'));_0x3430e4[_0x8fa8('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8fa8('0x6b'));if(_0x54e801[_0x8fa8('0x4d')]){_0x54e801[_0x8fa8('0x4d')][_0x8fa8('0x35')](function(_0xcd65e9){var _0xa1dfa=_0xcd65e9[0x0]===_0x8fa8('0x99')?_0xcd65e9[0x0]:'i.'+_0xcd65e9[0x0];_0xcac2dc[_0x8fa8('0x4d')](_0xa1dfa,_0xcd65e9[0x1]===_0x8fa8('0x9a')?![]:!![]);});}if(!_['isEmpty'](_0x4f5b8f)){_0xcac2dc[_0x8fa8('0x6d')](_0xc46a4a);_0x3430e4[_0x8fa8('0x4f')]('t.id\x20IN\x20?',_0x4f5b8f);}BPromise[_0x8fa8('0x9b')]()[_0x8fa8('0x2b')](function(){if(!_0x2b74b6){if(_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x7e')])return;_0x3430e4[_0x8fa8('0x4f')](_0x8fa8('0x9c'));_0xcac2dc[_0x8fa8('0x4f')](_0x8fa8('0x9c'));return;}if(_0x4dab67[_0x8fa8('0x9d')][_0x8fa8('0x9e')]!==_0x8fa8('0x9f'))return;return _0x4dab67[_0x8fa8('0x9d')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x8fa8('0x2b')](function(_0x4f3d87){if(_[_0x8fa8('0x7d')](_0x4f3d87)){_0x3430e4[_0x8fa8('0x4f')](_0x8fa8('0xa0'));_0xcac2dc[_0x8fa8('0x4f')](_0x8fa8('0xa0'));}else{_0x3430e4[_0x8fa8('0x4f')](_0x8fa8('0x7f'),_[_0x8fa8('0x31')](_0x4f3d87,'id'));_0xcac2dc[_0x8fa8('0x4f')]('i.FaxAccountId\x20IN\x20?',_[_0x8fa8('0x31')](_0x4f3d87,'id'));}});})['then'](function(){if(_0x4dab67[_0x8fa8('0x9d')][_0x8fa8('0x9e')]==='agent'&&!_0x2b74b6&&!_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x7e')])return[];return db[_0x8fa8('0xa1')][_0x8fa8('0x45')](_0x3430e4[_0x8fa8('0xa2')](),_0x2543cc);})[_0x8fa8('0x2b')](function(_0x1a6b04){_0xbf7a7d[_0x8fa8('0x23')]=_0x1a6b04[_0x8fa8('0x4a')];if(_0xbf7a7d[_0x8fa8('0x23')]===0x0)return[];return db[_0x8fa8('0xa1')][_0x8fa8('0x45')](_0x3f408b['toString'](),_0x2543cc)['then'](function(_0x2a0fa1){_0x525f2d=_[_0x8fa8('0xa3')](_0x2a0fa1,'id');_0x2543cc=_[_0x8fa8('0xa4')](_0x2543cc,{'model':db[_0x8fa8('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4dab67[_0x8fa8('0x45')][_0x8fa8('0x48')]){_0x54e801[_0x8fa8('0x49')][_0x8fa8('0x35')](function(_0x12f3e0){_0xcac2dc[_0x8fa8('0x53')]('i.'+_0x12f3e0);});}else{_0xcac2dc[_0x8fa8('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0xcac2dc['field'](_0x8fa8('0xa5'),_0x8fa8('0xa6'));_0xcac2dc[_0x8fa8('0x53')](_0x8fa8('0xa7'),_0x8fa8('0xa8'));_0xcac2dc[_0x8fa8('0x53')]('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',_0x8fa8('0x99'));_0xcac2dc[_0x8fa8('0x53')]('i.*');_0xcac2dc[_0x8fa8('0x53')]('c.firstName','Contact.firstName');_0xcac2dc[_0x8fa8('0x53')]('c.lastName',_0x8fa8('0xa9'));_0xcac2dc[_0x8fa8('0x53')](_0x8fa8('0xaa'),_0x8fa8('0xab'));_0xcac2dc['field'](_0x8fa8('0xac'),_0x8fa8('0xad'));_0xcac2dc['field'](_0x8fa8('0xae'),_0x8fa8('0xaf'));_0xcac2dc[_0x8fa8('0x53')](_0x8fa8('0xb0'),'Contact.fax');_0xcac2dc[_0x8fa8('0x53')](_0x8fa8('0xb1'),_0x8fa8('0xb2'));_0xcac2dc[_0x8fa8('0x53')](_0x8fa8('0xb3'),_0x8fa8('0xb4'));_0xcac2dc[_0x8fa8('0x53')](_0x8fa8('0xb5'),_0x8fa8('0x32'));}if(_0x54e801['limit'])_0xcac2dc[_0x8fa8('0x21')](_0x54e801[_0x8fa8('0x21')]);if(_0x54e801[_0x8fa8('0x22')])_0xcac2dc[_0x8fa8('0x22')](_0x54e801[_0x8fa8('0x22')]);return db[_0x8fa8('0xa1')][_0x8fa8('0x45')](_0xcac2dc['toString'](),_0x2543cc);})['then'](function(_0x5260fd){if(_0x5260fd[_0x8fa8('0x4a')]>0x0)_0xb66988[_0x8fa8('0x4f')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x5260fd,'id'));return db['sequelize'][_0x8fa8('0x45')](_0xb66988[_0x8fa8('0xa2')](),_0x2543cc)[_0x8fa8('0x2b')](function(_0x53c294){var _0x35b0a9=_[_0x8fa8('0xb6')](_0x53c294,_0x8fa8('0xb7'));var _0x1edf11=[];_0x5260fd[_0x8fa8('0x35')](function(_0x151c49){_0x1edf11[_0x8fa8('0x36')](updateFaxInteraction(_0x151c49,_0x525f2d,_0x35b0a9));});return BPromise[_0x8fa8('0xb8')](_0x1edf11);});});})['then'](function(_0x377df1){_0xbf7a7d[_0x8fa8('0xb9')]=_0x377df1;return _0xbf7a7d;})['then'](respondWithFilteredResult(_0x1ba0f1,_0x54e801))[_0x8fa8('0x37')](handleError(_0x1ba0f1,null));};exports[_0x8fa8('0xba')]=function(_0x5d6010,_0x2f9782){var _0x326aee={'raw':![],'where':{'id':_0x5d6010[_0x8fa8('0xbb')]['id']}},_0x5672b1={};_0x5672b1['model']=_['keys'](db[_0x8fa8('0x40')][_0x8fa8('0x41')]);_0x5672b1[_0x8fa8('0x45')]=_[_0x8fa8('0x46')](_0x5d6010[_0x8fa8('0x45')]);_0x5672b1[_0x8fa8('0x50')]=_[_0x8fa8('0x47')](_0x5672b1[_0x8fa8('0x44')],_0x5672b1[_0x8fa8('0x45')]);_0x326aee['attributes']=_[_0x8fa8('0x47')](_0x5672b1[_0x8fa8('0x44')],qs['fields'](_0x5d6010['query'][_0x8fa8('0x48')]));_0x326aee[_0x8fa8('0x49')]=_0x326aee[_0x8fa8('0x49')][_0x8fa8('0x4a')]?_0x326aee[_0x8fa8('0x49')]:_0x5672b1[_0x8fa8('0x44')];if(_0x5d6010[_0x8fa8('0x45')][_0x8fa8('0xbc')]){_0x326aee[_0x8fa8('0xbd')]=[{'all':!![]}];}_0x326aee=_[_0x8fa8('0xa4')]({},_0x326aee,_0x5d6010[_0x8fa8('0xbe')]);return db[_0x8fa8('0x40')][_0x8fa8('0x6a')](_0x326aee)[_0x8fa8('0x2b')](handleEntityNotFound(_0x2f9782,null))[_0x8fa8('0x2b')](respondWithResult(_0x2f9782,null))[_0x8fa8('0x37')](handleError(_0x2f9782,null));};exports[_0x8fa8('0xbf')]=function(_0x3d8bd5,_0x527baa){return db['FaxInteraction']['create'](_0x3d8bd5[_0x8fa8('0x7a')],{})[_0x8fa8('0x2b')](respondWithResult(_0x527baa,0xc9))['catch'](handleError(_0x527baa,null));};exports[_0x8fa8('0x2a')]=function(_0x20b692,_0x169908){if(_0x20b692['body']['id']){delete _0x20b692[_0x8fa8('0x7a')]['id'];}return db[_0x8fa8('0x40')][_0x8fa8('0x6a')]({'where':{'id':_0x20b692[_0x8fa8('0xbb')]['id']}})['then'](handleEntityNotFound(_0x169908,null))['then'](saveUpdates(_0x20b692[_0x8fa8('0x7a')],null))['then'](respondWithResult(_0x169908,null))[_0x8fa8('0x37')](handleError(_0x169908,null));};exports[_0x8fa8('0x2c')]=function(_0x43da0b,_0x37f224){return db[_0x8fa8('0x40')][_0x8fa8('0x6a')]({'where':{'id':_0x43da0b[_0x8fa8('0xbb')]['id']}})[_0x8fa8('0x2b')](handleEntityNotFound(_0x37f224,null))['then'](removeEntity(_0x37f224,null))[_0x8fa8('0x37')](handleError(_0x37f224,null));};exports[_0x8fa8('0xc0')]=function(_0x22f541,_0x516f7f){return db[_0x8fa8('0x40')]['describe']()[_0x8fa8('0x2b')](respondWithResult(_0x516f7f,null))['catch'](handleError(_0x516f7f,null));};exports[_0x8fa8('0xc1')]=function(_0x44cd9c,_0x5ee24a,_0x4af37d){return db[_0x8fa8('0xc2')][_0x8fa8('0x6a')]({'where':{'id':_0x44cd9c[_0x8fa8('0xbb')]['id']}})['then'](handleEntityNotFound(_0x5ee24a,null))[_0x8fa8('0x2b')](function(_0x589d49){if(_0x589d49){return _0x589d49[_0x8fa8('0xc1')](_0x44cd9c['body'][_0x8fa8('0xc3')],_['omit'](_0x44cd9c[_0x8fa8('0x7a')],[_0x8fa8('0xc3'),'id'])||{});}})['then'](respondWithResult(_0x5ee24a,null))[_0x8fa8('0x37')](handleError(_0x5ee24a,null));};exports[_0x8fa8('0xc4')]=function(_0x5ce46c,_0x4ef5bb,_0x52656a){var _0x2578ae={'raw':![],'where':{}};var _0x1df38c={};var _0x5c5e2c={'count':0x0,'rows':[]};return db[_0x8fa8('0x40')][_0x8fa8('0xc5')]({'where':{'id':_0x5ce46c[_0x8fa8('0xbb')]['id']}})[_0x8fa8('0x2b')](handleEntityNotFound(_0x4ef5bb,null))[_0x8fa8('0x2b')](function(_0x53dbd2){if(_0x53dbd2){_0x1df38c[_0x8fa8('0x44')]=_[_0x8fa8('0x46')](db[_0x8fa8('0xc2')]['rawAttributes']);_0x1df38c[_0x8fa8('0x45')]=_['keys'](_0x5ce46c[_0x8fa8('0x45')]);_0x1df38c[_0x8fa8('0x50')]=_['intersection'](_0x1df38c[_0x8fa8('0x44')],_0x1df38c[_0x8fa8('0x45')]);_0x2578ae[_0x8fa8('0x49')]=_[_0x8fa8('0x47')](_0x1df38c[_0x8fa8('0x44')],qs[_0x8fa8('0x48')](_0x5ce46c[_0x8fa8('0x45')][_0x8fa8('0x48')]));_0x2578ae[_0x8fa8('0x49')]=_0x2578ae[_0x8fa8('0x49')][_0x8fa8('0x4a')]?_0x2578ae['attributes']:_0x1df38c[_0x8fa8('0x44')];if(!_0x5ce46c[_0x8fa8('0x45')][_0x8fa8('0x4b')](_0x8fa8('0x4c'))){_0x2578ae[_0x8fa8('0x21')]=qs[_0x8fa8('0x21')](_0x5ce46c[_0x8fa8('0x45')][_0x8fa8('0x21')]);_0x2578ae[_0x8fa8('0x22')]=qs[_0x8fa8('0x22')](_0x5ce46c['query'][_0x8fa8('0x22')]);}_0x2578ae[_0x8fa8('0x4d')]=qs[_0x8fa8('0x4e')](_0x5ce46c['query'][_0x8fa8('0x4e')]);_0x2578ae[_0x8fa8('0x4f')]=qs[_0x8fa8('0x50')](_[_0x8fa8('0x51')](_0x5ce46c['query'],_0x1df38c[_0x8fa8('0x50')]));_0x2578ae[_0x8fa8('0x4f')][_0x8fa8('0xb7')]=_0x53dbd2['id'];if(_0x5ce46c[_0x8fa8('0x45')][_0x8fa8('0x8e')]){_0x2578ae['where']=_['merge'](_0x2578ae[_0x8fa8('0x4f')],{'$or':_['map'](_0x2578ae['attributes'],function(_0x4ad3d5){var _0x197d76={};_0x197d76[_0x4ad3d5]={'$like':'%'+_0x5ce46c[_0x8fa8('0x45')][_0x8fa8('0x8e')]+'%'};return _0x197d76;})});}if(_0x5ce46c['query']['$gte']){var _0x2246bd=_0x5ce46c[_0x8fa8('0x45')][_0x8fa8('0x83')]['split'](',');var _0x3dd13c={};_0x3dd13c[_0x2246bd[0x0]]={'$gte':moment(_0x2246bd[0x1])[_0x8fa8('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2578ae['where']=_[_0x8fa8('0xa4')](_0x2578ae[_0x8fa8('0x4f')],_0x3dd13c);}_0x2578ae=_['merge']({},_0x2578ae,_0x5ce46c[_0x8fa8('0xbe')]);return db[_0x8fa8('0xc2')][_0x8fa8('0x23')]({'where':_0x2578ae[_0x8fa8('0x4f')]})[_0x8fa8('0x2b')](function(_0x121822){_0x5c5e2c[_0x8fa8('0x23')]=_0x121822;if(_0x5ce46c[_0x8fa8('0x45')]['includeAll']){_0x2578ae[_0x8fa8('0xbd')]=[{'all':!![]}];}return db[_0x8fa8('0xc2')][_0x8fa8('0xc7')](_0x2578ae);})['then'](function(_0x3f7071){_0x5c5e2c[_0x8fa8('0xb9')]=_0x3f7071;return _0x5c5e2c;});}})[_0x8fa8('0x2b')](respondWithFilteredResult(_0x4ef5bb,_0x2578ae))[_0x8fa8('0x37')](handleError(_0x4ef5bb,null));};exports[_0x8fa8('0xc8')]=function(_0x4dde14,_0x417676,_0x4fdef5){return db['FaxInteraction'][_0x8fa8('0x6a')]({'where':{'id':_0x4dde14[_0x8fa8('0xbb')]['id']}})['then'](handleEntityNotFound(_0x417676,null))[_0x8fa8('0x2b')](function(_0x3f2b24){if(_0x3f2b24){return _0x3f2b24[_0x8fa8('0xc9')](_0x4dde14['body']['ids'],_[_0x8fa8('0xca')](_0x4dde14[_0x8fa8('0x7a')],[_0x8fa8('0xc3'),'id'])||{})['spread'](function(){return db['Tag'][_0x8fa8('0xc7')]({'attributes':['id','name',_0x8fa8('0x54')],'where':{'id':_0x4dde14['body']['ids']}});})['then'](function(_0x235c4e){socket[_0x8fa8('0xcb')](_0x8fa8('0xcc'),{'id':Number(_0x4dde14['params']['id']),'tags':_0x235c4e||[]});return{'id':Number(_0x4dde14['params']['id']),'tags':_0x235c4e||[]};});}})[_0x8fa8('0x2b')](respondWithResult(_0x417676,null))['catch'](handleError(_0x417676,null));};exports['removeTags']=function(_0x1ec34b,_0x22645a,_0x5068d4){return db[_0x8fa8('0x40')][_0x8fa8('0x6a')]({'where':{'id':_0x1ec34b['params']['id']}})[_0x8fa8('0x2b')](handleEntityNotFound(_0x22645a,null))[_0x8fa8('0x2b')](function(_0x118f63){if(_0x118f63){return _0x118f63[_0x8fa8('0xcd')](_0x1ec34b[_0x8fa8('0x45')][_0x8fa8('0xc3')]);}})[_0x8fa8('0x2b')](respondWithStatusCode(_0x22645a,null))[_0x8fa8('0x37')](handleError(_0x22645a,null));};exports[_0x8fa8('0xce')]=function(_0x164556,_0x2533cb){var _0xe4b054=moment()['unix']()[_0x8fa8('0xa2')]();var _0x47672e=path[_0x8fa8('0xcf')](config[_0x8fa8('0xd0')],_0x8fa8('0xd1'),_0x8fa8('0xd2'),_0x8fa8('0xd3'));var _0x5c2a75=path['join'](config['root'],'server',_0x8fa8('0xd2'),_0x8fa8('0xd4'));var _0x95b915=path[_0x8fa8('0xcf')](_0x47672e,_0xe4b054);var _0x2f781f=util[_0x8fa8('0xc6')](_0x8fa8('0xd5'),_0x164556[_0x8fa8('0xbb')]['id'],_0xe4b054);var _0x131cc5=path[_0x8fa8('0xcf')](_0x47672e,_0x2f781f);var _0x12200e=[];_0x12200e['push']({'model':db['Attachment'],'as':_0x8fa8('0xd6'),'raw':!![]});var _0x39f2a0=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x8fa8('0x7a'),_0x8fa8('0x81')],'include':_0x12200e}];return db[_0x8fa8('0x40')][_0x8fa8('0x6a')]({'where':{'id':_0x164556[_0x8fa8('0xbb')]['id']},'include':_0x39f2a0})[_0x8fa8('0x2b')](handleEntityNotFound(_0x2533cb,null))[_0x8fa8('0x2b')](function(_0x4e2343){if(_0x4e2343&&_0x4e2343[_0x8fa8('0xd7')]){var _0x1b1167=_0x4e2343['get']({'plain':!![]});fs[_0x8fa8('0xd8')](_0x95b915);for(var _0x1100b4=0x0;_0x1100b4<_0x1b1167[_0x8fa8('0xd7')][_0x8fa8('0x4a')];_0x1100b4++){var _0x49e00b=_0x1b1167['Messages'][_0x1100b4][_0x8fa8('0xd6')];if(_0x49e00b){var _0x2ee768=path[_0x8fa8('0xcf')](_0x5c2a75,_0x49e00b[_0x8fa8('0xd9')]);if(fs[_0x8fa8('0xda')](_0x2ee768)){fs[_0x8fa8('0xdb')](_0x2ee768)[_0x8fa8('0xdc')](fs[_0x8fa8('0xdd')](path['join'](_0x95b915,_0x49e00b[_0x8fa8('0xd9')])));}}}return BPromise[_0x8fa8('0x9b')]()['then'](function(){return new BPromise(function(_0x449764,_0x496bf3){zipdir(_0x95b915,{'saveTo':_0x131cc5},function(_0x23018a,_0x18dd41){if(_0x23018a)return _0x496bf3(_0x23018a);return _0x449764(_0x18dd41);});})['then'](function(){return new BPromise(function(_0x33a2ad,_0xec0926){rimraf(_0x95b915,function(_0x3cc96d){if(_0x3cc96d)_0xec0926(_0x3cc96d);return _0x33a2ad();});});})['then'](function(){return _0x2533cb[_0x8fa8('0xce')](_0x131cc5,_0x2f781f,function(_0x18a291){if(_0x18a291){console[_0x8fa8('0xde')](_0x8fa8('0xdf'),_0x18a291);}else{fs['unlinkSync'](_0x131cc5);}});});});}else{return _0x2533cb[_0x8fa8('0x1d')](0xc8);}})[_0x8fa8('0x37')](handleError(_0x2533cb,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 9720752..a46dafd 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 _0x4ec5=['Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','then','setDataValue'];(function(_0x156b7b,_0xf7e428){var _0x2702a0=function(_0x5f3d8b){while(--_0x5f3d8b){_0x156b7b['push'](_0x156b7b['shift']());}};_0x2702a0(++_0xf7e428);}(_0x4ec5,0x1a9));var _0x54ec=function(_0x417dd8,_0xa64d27){_0x417dd8=_0x417dd8-0x0;var _0x124e3a=_0x4ec5[_0x417dd8];return _0x124e3a;};'use strict';var EventEmitter=require(_0x54ec('0x0'));var FaxInteraction=require(_0x54ec('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x54ec('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54ec('0x2'),'afterUpdate':_0x54ec('0x3'),'afterDestroy':_0x54ec('0x4')};function emitEvent(_0x4a3e7a){return function(_0x549943,_0x596f5b,_0x1cb509){_0x549943['getUsers']({'attributes':['id'],'raw':!![]})[_0x54ec('0x5')](function(_0x13b7e9){_0x549943[_0x54ec('0x6')](_0x54ec('0x7'),_0x13b7e9['map'](function(_0x12047c){return{'id':_0x12047c['id']};}));return FaxMessage[_0x54ec('0x8')]({'where':{'FaxInteractionId':_0x549943['id'],'direction':'in','read':![]},'raw':!![]});})[_0x54ec('0x5')](function(_0x4d6712){_0x549943[_0x54ec('0x6')](_0x54ec('0x9'),_0x4d6712[_0x54ec('0xa')]);FaxInteractionEvents[_0x54ec('0xb')](_0x4a3e7a+':'+_0x549943['id'],_0x549943);FaxInteractionEvents[_0x54ec('0xb')](_0x4a3e7a,_0x549943);_0x1cb509(null);})[_0x54ec('0xc')](_0x1cb509(null));};}for(var e in events){if(events[_0x54ec('0xd')](e)){var event=events[e];FaxInteraction[_0x54ec('0xe')](e,emitEvent(event));}}module[_0x54ec('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x227c=['events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x227c,0x198));var _0xc227=function(_0x58bf72,_0x270672){_0x58bf72=_0x58bf72-0x0;var _0x5ac3aa=_0x227c[_0x58bf72];return _0x5ac3aa;};'use strict';var EventEmitter=require(_0xc227('0x0'));var FaxInteraction=require(_0xc227('0x1'))['db'][_0xc227('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xc227('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc227('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc227('0x5'),'afterDestroy':_0xc227('0x6')};function emitEvent(_0x4d905a){return function(_0x126fc9,_0x501907,_0x3059bc){_0x126fc9[_0xc227('0x7')]({'attributes':['id'],'raw':!![]})[_0xc227('0x8')](function(_0x23efc0){_0x126fc9[_0xc227('0x9')]('Users',_0x23efc0[_0xc227('0xa')](function(_0x1473c0){return{'id':_0x1473c0['id']};}));return FaxMessage[_0xc227('0xb')]({'where':{'FaxInteractionId':_0x126fc9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc227('0x8')](function(_0x5936dd){_0x126fc9[_0xc227('0x9')](_0xc227('0xc'),_0x5936dd['length']);FaxInteractionEvents[_0xc227('0xd')](_0x4d905a+':'+_0x126fc9['id'],_0x126fc9);FaxInteractionEvents[_0xc227('0xd')](_0x4d905a,_0x126fc9);_0x3059bc(null);})['catch'](_0x3059bc(null));};}for(var e in events){if(events[_0xc227('0xe')](e)){var event=events[e];FaxInteraction[_0xc227('0xf')](e,emitEvent(event));}}module[_0xc227('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0ec5c9d..0b5cd9a 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 _0x919f=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x919f,0x192));var _0xf919=function(_0x486f62,_0x46ef35){_0x486f62=_0x486f62-0x0;var _0x493e5d=_0x919f[_0x486f62];return _0x493e5d;};'use strict';var _=require('lodash');var util=require(_0xf919('0x0'));var logger=require(_0xf919('0x1'))(_0xf919('0x2'));var moment=require('moment');var BPromise=require(_0xf919('0x3'));var rp=require(_0xf919('0x4'));var fs=require('fs');var path=require(_0xf919('0x5'));var rimraf=require(_0xf919('0x6'));var config=require(_0xf919('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xf919('0x8')]=function(_0x3aa4bc,_0x10e216){return _0x3aa4bc[_0xf919('0x9')](_0xf919('0xa'),attributes,{'tableName':_0xf919('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4592dd,_0x995941,_0x5855a6){if(_0x4592dd[_0xf919('0xc')](_0xf919('0xd'))){_0x4592dd[_0xf919('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5855a6(null,_0x4592dd);}}});}; \ No newline at end of file +var _0xc0d7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','api'];(function(_0x4cc818,_0xd0bc6){var _0xc5c53c=function(_0x53520b){while(--_0x53520b){_0x4cc818['push'](_0x4cc818['shift']());}};_0xc5c53c(++_0xd0bc6);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x22abe9,_0x25428e){_0x22abe9=_0x22abe9-0x0;var _0x245639=_0xc0d7[_0x22abe9];return _0x245639;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c0d('0x0'));var moment=require(_0x7c0d('0x1'));var BPromise=require(_0x7c0d('0x2'));var rp=require(_0x7c0d('0x3'));var fs=require('fs');var path=require(_0x7c0d('0x4'));var rimraf=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var attributes=require(_0x7c0d('0x7'));module[_0x7c0d('0x8')]=function(_0x5a6a70,_0x507bc0){return _0x5a6a70[_0x7c0d('0x9')](_0x7c0d('0xa'),attributes,{'tableName':_0x7c0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e6d16,_0x35c579,_0x15d9ed){if(_0x5e6d16[_0x7c0d('0xc')](_0x7c0d('0xd'))){_0x5e6d16['closedAt']=moment()[_0x7c0d('0xe')](_0x7c0d('0xf'));}_0x15d9ed(null,_0x5e6d16);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 0bb0cad..eb6b024 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 _0x0052=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','AddTagsToFaxInteraction','omit','body','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e9fe0,_0x5caf83){var _0x21c90c=function(_0x40940c){while(--_0x40940c){_0x1e9fe0['push'](_0x1e9fe0['shift']());}};_0x21c90c(++_0x5caf83);}(_0x0052,0x1c3));var _0x2005=function(_0x39b730,_0x3406c8){_0x39b730=_0x39b730-0x0;var _0x2d4b92=_0x0052[_0x39b730];return _0x2d4b92;};'use strict';var _=require('lodash');var util=require(_0x2005('0x0'));var moment=require(_0x2005('0x1'));var BPromise=require(_0x2005('0x2'));var rs=require(_0x2005('0x3'));var fs=require('fs');var Redis=require(_0x2005('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2005('0x5'));var logger=require(_0x2005('0x6'))(_0x2005('0x7'));var config=require('../../config/environment');var jayson=require(_0x2005('0x8'));var client=jayson[_0x2005('0x9')][_0x2005('0xa')]({'port':0x232a});config['redis']=_[_0x2005('0xb')](config[_0x2005('0xc')],{'host':_0x2005('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2005('0xe'))[_0x2005('0xf')](socket);function respondWithRpcPromise(_0x32d209,_0x1a38db,_0x26369e){return new BPromise(function(_0x22b888,_0x418ee4){return client[_0x2005('0x10')](_0x32d209,_0x26369e)[_0x2005('0x11')](function(_0x6d64ab){logger[_0x2005('0x12')](_0x2005('0x13'),_0x1a38db,_0x2005('0x14'));logger[_0x2005('0x15')](_0x2005('0x16'),_0x1a38db,_0x2005('0x14'),JSON[_0x2005('0x17')](_0x6d64ab));if(_0x6d64ab['error']){if(_0x6d64ab[_0x2005('0x18')][_0x2005('0x19')]===0x1f4){logger['error'](_0x2005('0x13'),_0x1a38db,_0x6d64ab[_0x2005('0x18')]['message']);return _0x418ee4(_0x6d64ab[_0x2005('0x18')][_0x2005('0x1a')]);}logger['error'](_0x2005('0x13'),_0x1a38db,_0x6d64ab[_0x2005('0x18')][_0x2005('0x1a')]);return _0x22b888(_0x6d64ab['error'][_0x2005('0x1a')]);}else{logger[_0x2005('0x12')](_0x2005('0x13'),_0x1a38db,_0x2005('0x14'));_0x22b888(_0x6d64ab[_0x2005('0x1b')][_0x2005('0x1a')]);}})[_0x2005('0x1c')](function(_0x5238ea){logger['error'](_0x2005('0x13'),_0x1a38db,_0x5238ea);_0x418ee4(_0x5238ea);});});}exports[_0x2005('0x1d')]=function(_0x316988){var _0x470cef=this;return new Promise(function(_0x1dc6ef,_0x3ff757){return db[_0x2005('0x1e')][_0x2005('0x1f')](_0x316988['body'],{'raw':_0x316988[_0x2005('0x20')]?_0x316988[_0x2005('0x20')][_0x2005('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316988[_0x2005('0x20')]?_0x316988[_0x2005('0x20')][_0x2005('0x22')]||null:null,'attributes':_0x316988[_0x2005('0x20')]?_0x316988[_0x2005('0x20')][_0x2005('0x23')]||null:null,'limit':_0x316988[_0x2005('0x20')]?_0x316988['options'][_0x2005('0x24')]||null:null})['then'](function(_0x5d9207){logger[_0x2005('0x12')](_0x2005('0x1d'),_0x316988);logger[_0x2005('0x15')](_0x2005('0x1d'),_0x316988,JSON[_0x2005('0x17')](_0x5d9207));_0x1dc6ef(_0x5d9207);})[_0x2005('0x1c')](function(_0x375059){logger[_0x2005('0x18')](_0x2005('0x1d'),_0x375059[_0x2005('0x1a')],_0x316988);_0x3ff757(_0x470cef['error'](0x1f4,_0x375059[_0x2005('0x1a')]));});});};exports[_0x2005('0x25')]=function(_0x539974){return new Promise(function(_0x10a616,_0x22b4e7){return db[_0x2005('0x1e')]['find']({'where':_0x539974['options']?_0x539974[_0x2005('0x20')]['where']||null:null})['then'](function(_0x11e4ef){if(_0x11e4ef){return _0x11e4ef['addTags'](_0x539974['body']['ids'],_[_0x2005('0x26')](_0x539974[_0x2005('0x27')],[_0x2005('0x28'),'id'])||{});}})[_0x2005('0x29')](function(_0x4077ef){logger[_0x2005('0x12')](_0x2005('0x2a'),_0x539974);logger[_0x2005('0x15')]('AddTags',_0x539974,JSON[_0x2005('0x17')](_0x4077ef));_0x10a616(_0x4077ef);})[_0x2005('0x1c')](function(_0x1f0eef){logger['error'](_0x2005('0x2a'),_0x1f0eef[_0x2005('0x1a')],_0x539974);_0x22b4e7(_this[_0x2005('0x18')](0x1f4,_0x1f0eef[_0x2005('0x1a')]));});});}; \ No newline at end of file +var _0xceb3=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','catch','AddTagsToFaxInteraction','find','where','addTags','ids','spread','AddTags','lodash'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0xceb3,0x167));var _0x3ceb=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xceb3[_0x3203a1];return _0x24215e;};'use strict';var _=require(_0x3ceb('0x0'));var util=require(_0x3ceb('0x1'));var moment=require('moment');var BPromise=require(_0x3ceb('0x2'));var rs=require(_0x3ceb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ceb('0x4'))['db'];var utils=require(_0x3ceb('0x5'));var logger=require(_0x3ceb('0x6'))('rpc');var config=require(_0x3ceb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ceb('0x8')]({'port':0x232a});config[_0x3ceb('0x9')]=_[_0x3ceb('0xa')](config[_0x3ceb('0x9')],{'host':_0x3ceb('0xb'),'port':0x18eb});var socket=require(_0x3ceb('0xc'))(new Redis(config[_0x3ceb('0x9')]));require('./faxInteraction.socket')[_0x3ceb('0xd')](socket);function respondWithRpcPromise(_0x20719f,_0xf72e92,_0x2bb861){return new BPromise(function(_0xef33bd,_0x4c6abb){return client[_0x3ceb('0xe')](_0x20719f,_0x2bb861)[_0x3ceb('0xf')](function(_0x465991){logger[_0x3ceb('0x10')]('FaxInteraction,\x20%s,\x20%s',_0xf72e92,_0x3ceb('0x11'));logger[_0x3ceb('0x12')](_0x3ceb('0x13'),_0xf72e92,_0x3ceb('0x11'),JSON[_0x3ceb('0x14')](_0x465991));if(_0x465991['error']){if(_0x465991[_0x3ceb('0x15')][_0x3ceb('0x16')]===0x1f4){logger[_0x3ceb('0x15')](_0x3ceb('0x17'),_0xf72e92,_0x465991['error'][_0x3ceb('0x18')]);return _0x4c6abb(_0x465991[_0x3ceb('0x15')]['message']);}logger[_0x3ceb('0x15')](_0x3ceb('0x17'),_0xf72e92,_0x465991['error'][_0x3ceb('0x18')]);return _0xef33bd(_0x465991['error']['message']);}else{logger[_0x3ceb('0x10')](_0x3ceb('0x17'),_0xf72e92,_0x3ceb('0x11'));_0xef33bd(_0x465991[_0x3ceb('0x19')]['message']);}})['catch'](function(_0x3ecfa3){logger[_0x3ceb('0x15')](_0x3ceb('0x17'),_0xf72e92,_0x3ecfa3);_0x4c6abb(_0x3ecfa3);});});}exports[_0x3ceb('0x1a')]=function(_0x58253c){var _0x394d97=this;return new Promise(function(_0x467f48,_0x59c38f){return db[_0x3ceb('0x1b')][_0x3ceb('0x1c')](_0x58253c[_0x3ceb('0x1d')],{'raw':_0x58253c[_0x3ceb('0x1e')]?_0x58253c[_0x3ceb('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58253c['options']?_0x58253c['options']['where']||null:null,'attributes':_0x58253c['options']?_0x58253c[_0x3ceb('0x1e')][_0x3ceb('0x1f')]||null:null,'limit':_0x58253c[_0x3ceb('0x1e')]?_0x58253c[_0x3ceb('0x1e')]['limit']||null:null})[_0x3ceb('0xf')](function(_0x4761a2){logger['info'](_0x3ceb('0x1a'),_0x58253c);logger[_0x3ceb('0x12')](_0x3ceb('0x1a'),_0x58253c,JSON['stringify'](_0x4761a2));_0x467f48(_0x4761a2);})[_0x3ceb('0x20')](function(_0x576004){logger[_0x3ceb('0x15')](_0x3ceb('0x1a'),_0x576004['message'],_0x58253c);_0x59c38f(_0x394d97[_0x3ceb('0x15')](0x1f4,_0x576004['message']));});});};exports[_0x3ceb('0x21')]=function(_0x481e51){return new Promise(function(_0x42662c,_0x4a1eb3){return db[_0x3ceb('0x1b')][_0x3ceb('0x22')]({'where':_0x481e51['options']?_0x481e51[_0x3ceb('0x1e')][_0x3ceb('0x23')]||null:null})['then'](function(_0x26922a){if(_0x26922a){return _0x26922a[_0x3ceb('0x24')](_0x481e51[_0x3ceb('0x1d')][_0x3ceb('0x25')],_['omit'](_0x481e51[_0x3ceb('0x1d')],[_0x3ceb('0x25'),'id'])||{});}})[_0x3ceb('0x26')](function(_0x3af762){logger[_0x3ceb('0x10')](_0x3ceb('0x27'),_0x481e51);logger['debug'](_0x3ceb('0x27'),_0x481e51,JSON[_0x3ceb('0x14')](_0x3af762));_0x42662c(_0x3af762);})[_0x3ceb('0x20')](function(_0xca98f9){logger[_0x3ceb('0x15')]('AddTags',_0xca98f9[_0x3ceb('0x18')],_0x481e51);_0x4a1eb3(_this[_0x3ceb('0x15')](0x1f4,_0xca98f9[_0x3ceb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 71f3a91..d89c66e 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 _0xc260=['register','length','faxInteraction:','./faxInteraction.events','save','remove','emit','removeListener'];(function(_0x5af221,_0x5b2255){var _0x4c110f=function(_0xad529f){while(--_0xad529f){_0x5af221['push'](_0x5af221['shift']());}};_0x4c110f(++_0x5b2255);}(_0xc260,0x12b));var _0x0c26=function(_0x2ec3dd,_0x4a57c8){_0x2ec3dd=_0x2ec3dd-0x0;var _0x5272b2=_0xc260[_0x2ec3dd];return _0x5272b2;};'use strict';var FaxInteractionEvents=require(_0x0c26('0x0'));var events=[_0x0c26('0x1'),_0x0c26('0x2'),'update'];function createListener(_0xcc4782,_0x482b29){return function(_0x38f432){_0x482b29[_0x0c26('0x3')](_0xcc4782,_0x38f432);};}function removeListener(_0x49fc0c,_0xc1384c){return function(){FaxInteractionEvents[_0x0c26('0x4')](_0x49fc0c,_0xc1384c);};}exports[_0x0c26('0x5')]=function(_0xec6e20){for(var _0x2a3edb=0x0,_0x1f49e2=events[_0x0c26('0x6')];_0x2a3edb<_0x1f49e2;_0x2a3edb++){var _0x4718b8=events[_0x2a3edb];var _0x2e3678=createListener(_0x0c26('0x7')+_0x4718b8,_0xec6e20);FaxInteractionEvents['on'](_0x4718b8,_0x2e3678);}}; \ No newline at end of file +var _0x3cc5=['length','faxInteraction:','./faxInteraction.events','remove','emit','register'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x3cc5,0x80));var _0x53cc=function(_0x5850e5,_0x4e4bc7){_0x5850e5=_0x5850e5-0x0;var _0x1c9bbc=_0x3cc5[_0x5850e5];return _0x1c9bbc;};'use strict';var FaxInteractionEvents=require(_0x53cc('0x0'));var events=['save',_0x53cc('0x1'),'update'];function createListener(_0x71ca7c,_0x28a20d){return function(_0x3ef183){_0x28a20d[_0x53cc('0x2')](_0x71ca7c,_0x3ef183);};}function removeListener(_0x255651,_0x13b24d){return function(){FaxInteractionEvents['removeListener'](_0x255651,_0x13b24d);};}exports[_0x53cc('0x3')]=function(_0x3fd24a){for(var _0xf21c8e=0x0,_0x53648e=events[_0x53cc('0x4')];_0xf21c8e<_0x53648e;_0xf21c8e++){var _0x4dadf2=events[_0xf21c8e];var _0x396eaa=createListener(_0x53cc('0x5')+_0x4dadf2,_0x3fd24a);FaxInteractionEvents['on'](_0x4dadf2,_0x396eaa);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 7653eb4..5c11df8 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 _0xa437=['./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xc6ac3b,_0x13d14d){var _0x473f45=function(_0x11288d){while(--_0x11288d){_0xc6ac3b['push'](_0xc6ac3b['shift']());}};_0x473f45(++_0x13d14d);}(_0xa437,0x12f));var _0x7a43=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa437[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7a43('0x0'));var util=require(_0x7a43('0x1'));var path=require(_0x7a43('0x2'));var timeout=require(_0x7a43('0x3'));var express=require(_0x7a43('0x4'));var router=express[_0x7a43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7a43('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7a43('0x7'));router['get']('/',auth[_0x7a43('0x8')](),controller[_0x7a43('0x9')]);router[_0x7a43('0xa')](_0x7a43('0xb'),auth[_0x7a43('0x8')](),controller[_0x7a43('0xc')]);router[_0x7a43('0xa')]('/:id',auth[_0x7a43('0x8')](),controller[_0x7a43('0xd')]);router[_0x7a43('0xa')](_0x7a43('0xe'),auth[_0x7a43('0x8')](),controller[_0x7a43('0xf')]);router[_0x7a43('0xa')](_0x7a43('0x10'),auth[_0x7a43('0x8')](),controller[_0x7a43('0x11')]);router[_0x7a43('0x12')]('/',auth[_0x7a43('0x8')](),controller['create']);router[_0x7a43('0x12')](_0x7a43('0xe'),auth[_0x7a43('0x8')](),controller[_0x7a43('0x13')]);router['post'](_0x7a43('0x14'),auth[_0x7a43('0x8')](),interaction[_0x7a43('0x15')](_0x7a43('0x16'),_0x7a43('0x17')),controller[_0x7a43('0x18')]);router[_0x7a43('0x19')](_0x7a43('0x1a'),auth[_0x7a43('0x8')](),interaction[_0x7a43('0x15')](_0x7a43('0x16'),_0x7a43('0x1b')),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x7a43('0x15')](_0x7a43('0x16'),_0x7a43('0x1c')),controller['destroy']);router['delete'](_0x7a43('0x14'),auth['isAuthenticated'](),controller[_0x7a43('0x1d')]);module[_0x7a43('0x1e')]=router; \ No newline at end of file +var _0xb18e=['./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x268916,_0x1c27e1){var _0x38f8a4=function(_0x5e9ea6){while(--_0x5e9ea6){_0x268916['push'](_0x268916['shift']());}};_0x38f8a4(++_0x1c27e1);}(_0xb18e,0x199));var _0xeb18=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0xb18e[_0x2405bc];return _0x5272d4;};'use strict';var multer=require(_0xeb18('0x0'));var util=require(_0xeb18('0x1'));var path=require('path');var timeout=require(_0xeb18('0x2'));var express=require('express');var router=express[_0xeb18('0x3')]();var fs_extra=require(_0xeb18('0x4'));var auth=require(_0xeb18('0x5'));var interaction=require(_0xeb18('0x6'));var config=require('../../config/environment');var controller=require(_0xeb18('0x7'));router[_0xeb18('0x8')]('/',auth[_0xeb18('0x9')](),controller[_0xeb18('0xa')]);router[_0xeb18('0x8')](_0xeb18('0xb'),auth[_0xeb18('0x9')](),controller['describe']);router[_0xeb18('0x8')](_0xeb18('0xc'),auth[_0xeb18('0x9')](),controller[_0xeb18('0xd')]);router[_0xeb18('0x8')](_0xeb18('0xe'),auth[_0xeb18('0x9')](),controller[_0xeb18('0xf')]);router['get'](_0xeb18('0x10'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x11')]);router[_0xeb18('0x12')]('/',auth[_0xeb18('0x9')](),controller[_0xeb18('0x13')]);router[_0xeb18('0x12')](_0xeb18('0xe'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x14')]);router[_0xeb18('0x12')](_0xeb18('0x15'),auth[_0xeb18('0x9')](),interaction[_0xeb18('0x16')](_0xeb18('0x17'),_0xeb18('0x18')),controller[_0xeb18('0x19')]);router[_0xeb18('0x1a')]('/:id',auth[_0xeb18('0x9')](),interaction['tracked'](_0xeb18('0x17'),'faxinteraction:update'),controller[_0xeb18('0x1b')]);router[_0xeb18('0x1c')](_0xeb18('0xc'),auth['isAuthenticated'](),interaction[_0xeb18('0x16')]('fax',_0xeb18('0x1d')),controller[_0xeb18('0x1e')]);router[_0xeb18('0x1c')](_0xeb18('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xeb18('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 a683d8b..5004273 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 _0x668b=['medium','BOOLEAN','out','TEXT','DATE','sequelize','exports'];(function(_0x3e4fe2,_0x3d70e8){var _0x21238c=function(_0x2357fe){while(--_0x2357fe){_0x3e4fe2['push'](_0x3e4fe2['shift']());}};_0x21238c(++_0x3d70e8);}(_0x668b,0x140));var _0xb668=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0x668b[_0x1505e5];return _0x5b1dcd;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb668('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb668('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb668('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xb668('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0xb668('0x6')]}}; \ No newline at end of file +var _0x4fdb=['ENUM','out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2a7182,_0x49e325){var _0x1a4c12=function(_0x252aca){while(--_0x252aca){_0x2a7182['push'](_0x2a7182['shift']());}};_0x1a4c12(++_0x49e325);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x53b81b,_0x576329){_0x53b81b=_0x53b81b-0x0;var _0x34b629=_0x4fdb[_0x53b81b];return _0x34b629;};'use strict';var Sequelize=require(_0xb4fd('0x0'));module[_0xb4fd('0x1')]={'body':{'type':Sequelize[_0xb4fd('0x2')](_0xb4fd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb4fd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb4fd('0x5')]('in',_0xb4fd('0x6')),'defaultValue':_0xb4fd('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xb4fd('0x2')],'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 8ef944f..849d0c0 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 _0x4102=['AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','Attachment','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','Content-Range','reject','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','body','params','describe','../../config/logger','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','role','stringify','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','format','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','SIP/%s','rejectmessage','create','CmContact','findOne'];(function(_0x4e1924,_0x42f19c){var _0x5b6ac7=function(_0x17dff0){while(--_0x17dff0){_0x4e1924['push'](_0x4e1924['shift']());}};_0x5b6ac7(++_0x42f19c);}(_0x4102,0x123));var _0x2410=function(_0x54b790,_0x5db535){_0x54b790=_0x54b790-0x0;var _0x442b2f=_0x4102[_0x54b790];return _0x442b2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2410('0x0'));var zipdir=require(_0x2410('0x1'));var jsonpatch=require(_0x2410('0x2'));var rp=require(_0x2410('0x3'));var moment=require('moment');var BPromise=require(_0x2410('0x4'));var Mustache=require(_0x2410('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2410('0x6'));var csv=require(_0x2410('0x7'));var ejs=require(_0x2410('0x8'));var fs=require('fs');var fs_extra=require(_0x2410('0x9'));var _=require(_0x2410('0xa'));var squel=require('squel');var crypto=require(_0x2410('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2410('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2410('0xd'));var Redis=require(_0x2410('0xe'));var authService=require(_0x2410('0xf'));var qs=require(_0x2410('0x10'));var as=require(_0x2410('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2410('0x12'));var config=require(_0x2410('0x13'));var licenseUtil=require(_0x2410('0x14'));var db=require(_0x2410('0x15'))['db'];config[_0x2410('0x16')]=_['defaults'](config[_0x2410('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x2410('0x17'))(new Redis(config[_0x2410('0x16')]));require(_0x2410('0x18'))[_0x2410('0x19')](socket);var jayson=require(_0x2410('0x1a'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1825af,_0x47a09a,_0x165958,_0x159c17){return new BPromise(function(_0x42f5ce,_0x3ec1ff){var _0x456042=_0x159c17||client;return _0x456042[_0x2410('0x1b')](_0x1825af,_0x165958)[_0x2410('0x1c')](function(_0x459f2e){logger[_0x2410('0x1d')](_0x2410('0x1e'),_0x47a09a,_0x2410('0x1f'));logger['debug'](_0x2410('0x20'),_0x47a09a,'request\x20sent',JSON['stringify'](_0x459f2e));if(_0x459f2e[_0x2410('0x21')]){if(_0x459f2e['error'][_0x2410('0x22')]===0x1f4){logger[_0x2410('0x21')](_0x2410('0x1e'),_0x47a09a,_0x459f2e['error'][_0x2410('0x23')]);return _0x3ec1ff(_0x459f2e['error'][_0x2410('0x23')]);}logger[_0x2410('0x21')](_0x2410('0x1e'),_0x47a09a,_0x459f2e[_0x2410('0x21')][_0x2410('0x23')]);return _0x42f5ce(_0x459f2e[_0x2410('0x21')][_0x2410('0x23')]);}else{logger[_0x2410('0x1d')]('FaxMessage,\x20%s,\x20%s',_0x47a09a,_0x2410('0x1f'));_0x42f5ce(_0x459f2e[_0x2410('0x24')][_0x2410('0x23')]);}})[_0x2410('0x25')](function(_0xd72812){logger['error'](_0x2410('0x1e'),_0x47a09a,_0xd72812);_0x3ec1ff(_0xd72812);});});}function respondWithStatusCode(_0x2515e5,_0x3139a8){_0x3139a8=_0x3139a8||0xcc;return function(_0x10d06b){if(_0x10d06b){return _0x2515e5[_0x2410('0x26')](_0x3139a8);}return _0x2515e5[_0x2410('0x27')](_0x3139a8)[_0x2410('0x28')]();};}function respondWithResult(_0x280199,_0x537df7){_0x537df7=_0x537df7||0xc8;return function(_0x5ab47c){if(_0x5ab47c){return _0x280199[_0x2410('0x27')](_0x537df7)[_0x2410('0x29')](_0x5ab47c);}};}function respondWithFilteredResult(_0xafc92d,_0x134596){return function(_0x4c6a28){if(_0x4c6a28){var _0x41e6a4=typeof _0x134596['offset']===_0x2410('0x2a')&&typeof _0x134596['limit']===_0x2410('0x2a');var _0x2c87ff=_0x4c6a28[_0x2410('0x2b')];var _0x23039a=_0x41e6a4?0x0:_0x134596[_0x2410('0x2c')];var _0xe8871=_0x41e6a4?_0x4c6a28[_0x2410('0x2b')]:_0x134596[_0x2410('0x2c')]+_0x134596['limit'];var _0xe13ce;if(_0xe8871>=_0x2c87ff){_0xe8871=_0x2c87ff;_0xe13ce=0xc8;}else{_0xe13ce=0xce;}_0xafc92d['status'](_0xe13ce);return _0xafc92d['set'](_0x2410('0x2d'),_0x23039a+'-'+_0xe8871+'/'+_0x2c87ff)[_0x2410('0x29')](_0x4c6a28);}return null;};}function patchUpdates(_0x1695c7){return function(_0x503b71){try{jsonpatch['apply'](_0x503b71,_0x1695c7,!![]);}catch(_0x3679fd){return BPromise[_0x2410('0x2e')](_0x3679fd);}return _0x503b71['save']();};}function saveUpdates(_0x1a86ef,_0x30aa49){return function(_0x7cb5b9){if(_0x7cb5b9){return _0x7cb5b9[_0x2410('0x2f')](_0x1a86ef)['then'](function(_0x42675a){return _0x42675a;});}return null;};}function removeEntity(_0x5aaf9c,_0x292fd2){return function(_0x2e7efc){if(_0x2e7efc){return _0x2e7efc[_0x2410('0x30')]()[_0x2410('0x1c')](function(){_0x5aaf9c['status'](0xcc)[_0x2410('0x28')]();});}};}function handleEntityNotFound(_0x3ce246,_0x44dc97){return function(_0x29e70d){if(!_0x29e70d){_0x3ce246[_0x2410('0x26')](0x194);}return _0x29e70d;};}function handleError(_0x45ad91,_0x519028){_0x519028=_0x519028||0x1f4;return function(_0x10c9e0){logger[_0x2410('0x21')](_0x10c9e0[_0x2410('0x31')]);if(_0x10c9e0[_0x2410('0x32')]){delete _0x10c9e0[_0x2410('0x32')];}_0x45ad91[_0x2410('0x27')](_0x519028)[_0x2410('0x33')](_0x10c9e0);};}exports[_0x2410('0x34')]=function(_0x463bd3,_0x24e73b){var _0x21e516={},_0x808810={},_0x49e80c={'count':0x0,'rows':[]};var _0x1bf471=_[_0x2410('0x35')](db[_0x2410('0x36')][_0x2410('0x37')],function(_0x2a4d25){return{'name':_0x2a4d25['fieldName'],'type':_0x2a4d25[_0x2410('0x38')][_0x2410('0x39')]};});_0x808810[_0x2410('0x3a')]=_[_0x2410('0x35')](_0x1bf471,_0x2410('0x32'));_0x808810[_0x2410('0x3b')]=_[_0x2410('0x3c')](_0x463bd3[_0x2410('0x3b')]);_0x808810[_0x2410('0x3d')]=_[_0x2410('0x3e')](_0x808810[_0x2410('0x3a')],_0x808810[_0x2410('0x3b')]);_0x21e516[_0x2410('0x3f')]=_['intersection'](_0x808810[_0x2410('0x3a')],qs[_0x2410('0x40')](_0x463bd3[_0x2410('0x3b')][_0x2410('0x40')]));_0x21e516[_0x2410('0x3f')]=_0x21e516[_0x2410('0x3f')][_0x2410('0x41')]?_0x21e516[_0x2410('0x3f')]:_0x808810[_0x2410('0x3a')];if(!_0x463bd3['query']['hasOwnProperty'](_0x2410('0x42'))){_0x21e516[_0x2410('0x43')]=qs['limit'](_0x463bd3[_0x2410('0x3b')][_0x2410('0x43')]);_0x21e516[_0x2410('0x2c')]=qs[_0x2410('0x2c')](_0x463bd3['query'][_0x2410('0x2c')]);}_0x21e516[_0x2410('0x44')]=qs[_0x2410('0x45')](_0x463bd3['query'][_0x2410('0x45')]);_0x21e516[_0x2410('0x46')]=qs[_0x2410('0x3d')](_[_0x2410('0x47')](_0x463bd3[_0x2410('0x3b')],_0x808810[_0x2410('0x3d')]),_0x1bf471);if(_0x463bd3[_0x2410('0x3b')][_0x2410('0x48')]){_0x21e516[_0x2410('0x46')]=_[_0x2410('0x49')](_0x21e516[_0x2410('0x46')],{'$or':_[_0x2410('0x35')](_0x1bf471,function(_0x5c3629){if(_0x5c3629[_0x2410('0x38')]!==_0x2410('0x4a')){var _0x394e98={};_0x394e98[_0x5c3629[_0x2410('0x32')]]={'$like':'%'+_0x463bd3[_0x2410('0x3b')][_0x2410('0x48')]+'%'};return _0x394e98;}})});}_0x21e516=_[_0x2410('0x49')]({},_0x21e516,_0x463bd3[_0x2410('0x4b')]);var _0x1a9933={'where':_0x21e516[_0x2410('0x46')]};return db[_0x2410('0x36')][_0x2410('0x2b')](_0x1a9933)[_0x2410('0x1c')](function(_0x2b4122){_0x49e80c[_0x2410('0x2b')]=_0x2b4122;if(_0x463bd3[_0x2410('0x3b')][_0x2410('0x4c')]){_0x21e516[_0x2410('0x4d')]=[{'all':!![]}];}return db[_0x2410('0x36')][_0x2410('0x4e')](_0x21e516);})[_0x2410('0x1c')](function(_0x2b8e26){_0x49e80c[_0x2410('0x4f')]=_0x2b8e26;return _0x49e80c;})[_0x2410('0x1c')](respondWithFilteredResult(_0x24e73b,_0x21e516))['catch'](handleError(_0x24e73b,null));};exports[_0x2410('0x50')]=function(_0xb2f004,_0x22f62c){var _0xd77e39={'raw':!![],'where':{'id':_0xb2f004['params']['id']}},_0x559d6c={};_0x559d6c['model']=_[_0x2410('0x3c')](db['FaxMessage'][_0x2410('0x37')]);_0x559d6c[_0x2410('0x3b')]=_[_0x2410('0x3c')](_0xb2f004[_0x2410('0x3b')]);_0x559d6c[_0x2410('0x3d')]=_[_0x2410('0x3e')](_0x559d6c[_0x2410('0x3a')],_0x559d6c[_0x2410('0x3b')]);_0xd77e39[_0x2410('0x3f')]=_[_0x2410('0x3e')](_0x559d6c['model'],qs[_0x2410('0x40')](_0xb2f004[_0x2410('0x3b')]['fields']));_0xd77e39[_0x2410('0x3f')]=_0xd77e39[_0x2410('0x3f')][_0x2410('0x41')]?_0xd77e39['attributes']:_0x559d6c[_0x2410('0x3a')];if(_0xb2f004[_0x2410('0x3b')][_0x2410('0x4c')]){_0xd77e39[_0x2410('0x4d')]=[{'all':!![]}];}_0xd77e39=_['merge']({},_0xd77e39,_0xb2f004[_0x2410('0x4b')]);return db[_0x2410('0x36')][_0x2410('0x51')](_0xd77e39)['then'](handleEntityNotFound(_0x22f62c,null))['then'](respondWithResult(_0x22f62c,null))[_0x2410('0x25')](handleError(_0x22f62c,null));};exports['update']=function(_0x1c3008,_0x286b22){if(_0x1c3008[_0x2410('0x52')]['id']){delete _0x1c3008['body']['id'];}return db[_0x2410('0x36')]['find']({'where':{'id':_0x1c3008[_0x2410('0x53')]['id']}})[_0x2410('0x1c')](handleEntityNotFound(_0x286b22,null))[_0x2410('0x1c')](saveUpdates(_0x1c3008['body'],null))[_0x2410('0x1c')](respondWithResult(_0x286b22,null))[_0x2410('0x25')](handleError(_0x286b22,null));};exports[_0x2410('0x30')]=function(_0x40e8f6,_0x347570){return db['FaxMessage'][_0x2410('0x51')]({'where':{'id':_0x40e8f6['params']['id']}})[_0x2410('0x1c')](handleEntityNotFound(_0x347570,null))[_0x2410('0x1c')](removeEntity(_0x347570,null))[_0x2410('0x25')](handleError(_0x347570,null));};exports[_0x2410('0x54')]=function(_0x9792b1,_0x4e2f02){return db[_0x2410('0x36')][_0x2410('0x54')]()[_0x2410('0x1c')](respondWithResult(_0x4e2f02,null))[_0x2410('0x25')](handleError(_0x4e2f02,null));};var interaction_log=require(_0x2410('0x55'))(_0x2410('0x56'));exports['accept']=function(_0x4ff86e,_0x4c498b,_0x5d7dd0){var _0x30d4d9={'agent':{},'channel':_0x2410('0x57')};if(_0x4ff86e[_0x2410('0x52')]['id']){delete _0x4ff86e[_0x2410('0x52')]['id'];}_0x4ff86e[_0x2410('0x52')][_0x2410('0x58')]=!![];_0x4ff86e[_0x2410('0x52')][_0x2410('0x59')]=moment()['format'](_0x2410('0x5a'));_0x4ff86e[_0x2410('0x52')][_0x2410('0x5b')]=_0x4ff86e[_0x2410('0x52')]['UserId']||_0x4ff86e[_0x2410('0x5c')]['id'];_0x30d4d9['agent']['id']=_0x4ff86e[_0x2410('0x52')]['UserId'];return db['FaxMessage'][_0x2410('0x51')]({'where':{'id':_0x4ff86e[_0x2410('0x53')]['id'],'UserId':null}})[_0x2410('0x1c')](handleEntityNotFound(_0x4c498b,null))['then'](saveUpdates(_0x4ff86e['body'],null))[_0x2410('0x1c')](function(_0x4d39b1){if(_0x4d39b1){_0x30d4d9[_0x2410('0x23')]=_0x4d39b1[_0x2410('0x5d')]({'plain':!![]});return db[_0x2410('0x5e')][_0x2410('0x51')]({'where':{'id':_0x4d39b1[_0x2410('0x5f')]}});}return null;})[_0x2410('0x1c')](handleEntityNotFound(_0x4c498b,null))['then'](function(_0x34aaa1){if(_0x34aaa1){return _0x34aaa1['update']({'UserId':_0x4ff86e[_0x2410('0x52')][_0x2410('0x5b')],'read1stAt':_[_0x2410('0x60')](_0x34aaa1[_0x2410('0x61')])?moment()['format'](_0x2410('0x5a')):undefined});}return null;})[_0x2410('0x1c')](function(_0x39705c){if(_0x39705c){_0x30d4d9[_0x2410('0x62')]=_0x39705c[_0x2410('0x5d')]({'plain':!![]});interaction_log[_0x2410('0x1d')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ff86e['user']['id'],_0x4ff86e[_0x2410('0x5c')][_0x2410('0x32')],_0x4ff86e[_0x2410('0x5c')][_0x2410('0x63')],_0x30d4d9[_0x2410('0x62')]['id'],_0x4ff86e[_0x2410('0x52')]?JSON[_0x2410('0x64')](_0x4ff86e['body']):'null');return respondWithRpcPromise(_0x2410('0x65'),_0x2410('0x66'),_0x30d4d9);}return null;})['then'](function(_0x49edb6){var _0x228ac2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49edb6['message'][_0x2410('0x67')];return db[_0x2410('0x68')][_0x2410('0x3b')](_0x228ac2,{'type':db[_0x2410('0x69')][_0x2410('0x6a')][_0x2410('0x6b')],'raw':!![]})[_0x2410('0x1c')](function(_0x475274){return _0x475274;});})[_0x2410('0x1c')](function(_0x1ae84c){if(_0x1ae84c){_0x30d4d9[_0x2410('0x23')][_0x2410('0x6c')]=_0x1ae84c[0x0];if(!_0x4ff86e[_0x2410('0x52')]['UserId'])return;return db[_0x2410('0x6d')]['find']({'where':{'id':_0x4ff86e[_0x2410('0x52')]['UserId'],'role':_0x2410('0x6e')},'attributes':['id',_0x2410('0x32'),_0x2410('0x6f'),_0x2410('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4fe652){if(!_0x4fe652)return null;_0x30d4d9[_0x2410('0x23')][_0x2410('0x6e')]=_0x4fe652;return _0x30d4d9;})[_0x2410('0x1c')](function(_0x3a9244){if(_0x3a9244){if(_0x4ff86e['body'][_0x2410('0x71')]){_0x30d4d9[_0x2410('0x23')][_0x2410('0x72')]=util[_0x2410('0x73')]('SIP/%s',_0x4ff86e[_0x2410('0x5c')][_0x2410('0x32')]);_0x30d4d9[_0x2410('0x23')]['channel']=_0x30d4d9[_0x2410('0x74')];_0x30d4d9[_0x2410('0x23')][_0x2410('0x75')]=_0x30d4d9[_0x2410('0x74')];_0x30d4d9['message'][_0x2410('0x76')]='accept';return respondWithRpcPromise('EventManager',_0x2410('0x77'),{'event':_0x2410('0x78'),'message':_0x30d4d9['message']},client9002)[_0x2410('0x1c')](function(){return _0x30d4d9;});}return _0x30d4d9;}return null;})['then'](respondWithResult(_0x4c498b,null))[_0x2410('0x25')](handleError(_0x4c498b,null));};var interaction_log=require(_0x2410('0x55'))(_0x2410('0x56'));exports[_0x2410('0x2e')]=function(_0x568cce,_0x3b2717,_0x3902c1){var _0x574af6={'agent':{},'channel':_0x2410('0x57')};if(_0x568cce['body']['id']){delete _0x568cce[_0x2410('0x52')]['id'];}_0x568cce['body'][_0x2410('0x5b')]=_0x568cce[_0x2410('0x52')]['UserId']||_0x568cce[_0x2410('0x5c')]['id'];_0x574af6['agent']['id']=_0x568cce[_0x2410('0x52')]['UserId'];return db['FaxMessage'][_0x2410('0x51')]({'where':{'id':_0x568cce['params']['id'],'UserId':null}})[_0x2410('0x1c')](handleEntityNotFound(_0x3b2717,null))[_0x2410('0x1c')](function(_0x53710a){if(_0x53710a){_0x574af6[_0x2410('0x23')]=_0x53710a[_0x2410('0x5d')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x53710a[_0x2410('0x5f')]}});}return null;})[_0x2410('0x1c')](handleEntityNotFound(_0x3b2717,null))[_0x2410('0x1c')](function(_0x52e911){if(_0x52e911){_0x574af6['interaction']=_0x52e911['get']({'plain':!![]});interaction_log[_0x2410('0x1d')](_0x2410('0x79'),_0x568cce[_0x2410('0x5c')]['id'],_0x568cce[_0x2410('0x5c')][_0x2410('0x32')],_0x568cce[_0x2410('0x5c')]['role'],_0x574af6[_0x2410('0x62')]['id'],_0x568cce[_0x2410('0x52')]?JSON['stringify'](_0x568cce[_0x2410('0x52')]):_0x2410('0x7a'));return respondWithRpcPromise(_0x2410('0x7b'),_0x2410('0x7c'),_0x574af6);}return null;})[_0x2410('0x1c')](function(_0x4244c2){var _0xd6ad97=_0x2410('0x7d')+_0x4244c2[_0x2410('0x23')][_0x2410('0x67')];return db[_0x2410('0x68')][_0x2410('0x3b')](_0xd6ad97,{'type':db[_0x2410('0x69')][_0x2410('0x6a')]['SELECT'],'raw':!![]})[_0x2410('0x1c')](function(_0xb53a0e){return _0xb53a0e;});})[_0x2410('0x1c')](function(_0x282db7){if(_0x282db7){_0x574af6[_0x2410('0x23')][_0x2410('0x6c')]=_0x282db7[0x0];if(!_0x568cce[_0x2410('0x52')]['UserId'])return;return db['User'][_0x2410('0x51')]({'where':{'id':_0x568cce[_0x2410('0x52')][_0x2410('0x5b')],'role':_0x2410('0x6e')},'attributes':['id',_0x2410('0x32'),_0x2410('0x6f'),'email',_0x2410('0x7e')],'raw':!![]});}return null;})[_0x2410('0x1c')](function(_0x3484d0){if(!_0x3484d0)return null;_0x574af6[_0x2410('0x23')]['agent']=_0x3484d0;return _0x574af6;})[_0x2410('0x1c')](function(_0x558d28){if(_0x558d28){_0x558d28[_0x2410('0x23')]['interface']=util['format'](_0x2410('0x7f'),_0x568cce[_0x2410('0x5c')][_0x2410('0x32')]);_0x558d28[_0x2410('0x23')][_0x2410('0x74')]=_0x574af6['channel'];_0x558d28[_0x2410('0x23')]['motionChannel']=_0x574af6[_0x2410('0x74')];_0x558d28[_0x2410('0x23')][_0x2410('0x76')]='reject';respondWithRpcPromise(_0x2410('0x77'),_0x2410('0x77'),{'event':_0x2410('0x80'),'message':_0x558d28['message']},client9002);return _0x574af6;}return null;})[_0x2410('0x1c')](respondWithResult(_0x3b2717,null))['catch'](handleError(_0x3b2717,null));};exports[_0x2410('0x81')]=function(_0x16b71e,_0x586dc4){var _0x39a961;return db['FaxMessage'][_0x2410('0x81')](_0x16b71e[_0x2410('0x52')],{})['then'](function(_0x503ace){_0x39a961=_0x503ace;return db[_0x2410('0x82')][_0x2410('0x83')]({'where':{'id':_0x39a961['ContactId']}});})[_0x2410('0x1c')](function(_0x3a8299){if(_[_0x2410('0x60')](_0x3a8299)){return;}else{_0x39a961[_0x2410('0x57')]=_0x3a8299['fax'];return db['Attachment']['findOne']({'where':{'id':_0x39a961[_0x2410('0x84')]}});}})['then'](function(_0x5b728e){return respondWithRpcPromise(_0x2410('0x85'),_0x2410('0x85'),{'FaxAccountId':_[_0x2410('0x60')](_0x16b71e['body'])?undefined:_0x16b71e[_0x2410('0x52')]['FaxAccountId'],'path':_['isNil'](_0x5b728e)?undefined:util['format'](_0x2410('0x86'),_0x5b728e['basename']),'fax':_[_0x2410('0x60')](_0x39a961[_0x2410('0x57')])?undefined:_0x39a961[_0x2410('0x57')],'AttachmentId':_0x39a961[_0x2410('0x84')]},client9002);})['then'](respondWithResult(_0x586dc4,0xc9))[_0x2410('0x25')](handleError(_0x586dc4,null));};exports[_0x2410('0x87')]=function(_0x6fcc71,_0x4ae1c0){var _0x2b7574=path[_0x2410('0x88')](config[_0x2410('0x89')],_0x2410('0x8a'),_0x2410('0x8b'),'attachments');return db['FaxMessage'][_0x2410('0x51')]({'where':{'id':_0x6fcc71['params']['id']},'include':[{'model':db[_0x2410('0x8c')],'as':'Attachment'}]})[_0x2410('0x1c')](handleEntityNotFound(_0x4ae1c0,null))['then'](function(_0x2eda89){if(_0x2eda89){return _0x4ae1c0[_0x2410('0x87')](path['join'](_0x2b7574,_0x2eda89[_0x2410('0x8c')]['basename']));}})[_0x2410('0x25')](handleError(_0x4ae1c0,null));}; \ No newline at end of file +var _0x1b52=['key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','FaxMessage','includeAll','include','findAll','rows','show','keys','find','update','body','params','describe','accept','read','readAt','UserId','user','agent','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','format','SIP/%s','channel','event','EventManager','fax','FaxInteractionId','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','motionChannel','rejectmessage','create','CmContact','findOne','ContactId','Attachment','SendFax','basename','AttachmentId','download','join','root','server','files','attachments','zip-dir','fast-json-patch','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','status','json','offset','undefined','count','limit','apply','reject','save','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x1b52,0x1f4));var _0x21b5=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x1b52[_0x1cbcf1];return _0x3a06f0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x21b5('0x0'));var jsonpatch=require(_0x21b5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x21b5('0x2'));var util=require(_0x21b5('0x3'));var path=require('path');var sox=require(_0x21b5('0x4'));var csv=require('to-csv');var ejs=require(_0x21b5('0x5'));var fs=require('fs');var fs_extra=require(_0x21b5('0x6'));var _=require(_0x21b5('0x7'));var squel=require(_0x21b5('0x8'));var crypto=require(_0x21b5('0x9'));var jsforce=require(_0x21b5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x21b5('0xb'));var querystring=require('querystring');var Papa=require(_0x21b5('0xc'));var Redis=require(_0x21b5('0xd'));var authService=require(_0x21b5('0xe'));var qs=require(_0x21b5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21b5('0x10'));var logger=require(_0x21b5('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x21b5('0x12'));var licenseUtil=require(_0x21b5('0x13'));var db=require(_0x21b5('0x14'))['db'];config[_0x21b5('0x15')]=_['defaults'](config[_0x21b5('0x15')],{'host':_0x21b5('0x16'),'port':0x18eb});var socket=require(_0x21b5('0x17'))(new Redis(config[_0x21b5('0x15')]));require(_0x21b5('0x18'))[_0x21b5('0x19')](socket);var jayson=require(_0x21b5('0x1a'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x21b5('0x1b')][_0x21b5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5ce720,_0x3802de,_0x3ec4a3,_0x26ef37){return new BPromise(function(_0x4f822e,_0x14bf94){var _0x18cef3=_0x26ef37||client;return _0x18cef3['request'](_0x5ce720,_0x3ec4a3)[_0x21b5('0x1d')](function(_0x2eac5d){logger[_0x21b5('0x1e')](_0x21b5('0x1f'),_0x3802de,'request\x20sent');logger['debug'](_0x21b5('0x20'),_0x3802de,_0x21b5('0x21'),JSON['stringify'](_0x2eac5d));if(_0x2eac5d[_0x21b5('0x22')]){if(_0x2eac5d['error'][_0x21b5('0x23')]===0x1f4){logger[_0x21b5('0x22')](_0x21b5('0x1f'),_0x3802de,_0x2eac5d['error']['message']);return _0x14bf94(_0x2eac5d['error']['message']);}logger[_0x21b5('0x22')](_0x21b5('0x1f'),_0x3802de,_0x2eac5d['error'][_0x21b5('0x24')]);return _0x4f822e(_0x2eac5d['error']['message']);}else{logger[_0x21b5('0x1e')](_0x21b5('0x1f'),_0x3802de,_0x21b5('0x21'));_0x4f822e(_0x2eac5d['result'][_0x21b5('0x24')]);}})[_0x21b5('0x25')](function(_0x3c7cdf){logger[_0x21b5('0x22')](_0x21b5('0x1f'),_0x3802de,_0x3c7cdf);_0x14bf94(_0x3c7cdf);});});}function respondWithStatusCode(_0x3f5516,_0xf57a0c){_0xf57a0c=_0xf57a0c||0xcc;return function(_0x56ac8a){if(_0x56ac8a){return _0x3f5516['sendStatus'](_0xf57a0c);}return _0x3f5516[_0x21b5('0x26')](_0xf57a0c)['end']();};}function respondWithResult(_0x5022ea,_0x168d63){_0x168d63=_0x168d63||0xc8;return function(_0x15cea2){if(_0x15cea2){return _0x5022ea[_0x21b5('0x26')](_0x168d63)[_0x21b5('0x27')](_0x15cea2);}};}function respondWithFilteredResult(_0x20a214,_0x5ce735){return function(_0xb1f4a){if(_0xb1f4a){var _0x575d18=typeof _0x5ce735[_0x21b5('0x28')]===_0x21b5('0x29')&&typeof _0x5ce735['limit']===_0x21b5('0x29');var _0x3c4644=_0xb1f4a[_0x21b5('0x2a')];var _0x1f4ac8=_0x575d18?0x0:_0x5ce735[_0x21b5('0x28')];var _0x5f59e7=_0x575d18?_0xb1f4a['count']:_0x5ce735[_0x21b5('0x28')]+_0x5ce735[_0x21b5('0x2b')];var _0x4d68c1;if(_0x5f59e7>=_0x3c4644){_0x5f59e7=_0x3c4644;_0x4d68c1=0xc8;}else{_0x4d68c1=0xce;}_0x20a214['status'](_0x4d68c1);return _0x20a214['set']('Content-Range',_0x1f4ac8+'-'+_0x5f59e7+'/'+_0x3c4644)['json'](_0xb1f4a);}return null;};}function patchUpdates(_0x41725e){return function(_0x344918){try{jsonpatch[_0x21b5('0x2c')](_0x344918,_0x41725e,!![]);}catch(_0x59ebbf){return BPromise[_0x21b5('0x2d')](_0x59ebbf);}return _0x344918[_0x21b5('0x2e')]();};}function saveUpdates(_0x431e0e,_0x3ec6eb){return function(_0x393339){if(_0x393339){return _0x393339['update'](_0x431e0e)['then'](function(_0x46193f){return _0x46193f;});}return null;};}function removeEntity(_0x2f65fb,_0x3ae393){return function(_0x3d7272){if(_0x3d7272){return _0x3d7272[_0x21b5('0x2f')]()['then'](function(){_0x2f65fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x87d543,_0x2ba5ef){return function(_0xf1d578){if(!_0xf1d578){_0x87d543[_0x21b5('0x30')](0x194);}return _0xf1d578;};}function handleError(_0xcdd988,_0x12920e){_0x12920e=_0x12920e||0x1f4;return function(_0x3f61d7){logger[_0x21b5('0x22')](_0x3f61d7[_0x21b5('0x31')]);if(_0x3f61d7[_0x21b5('0x32')]){delete _0x3f61d7[_0x21b5('0x32')];}_0xcdd988[_0x21b5('0x26')](_0x12920e)[_0x21b5('0x33')](_0x3f61d7);};}exports[_0x21b5('0x34')]=function(_0x13fafc,_0x27defa){var _0x168d14={},_0x21b87b={},_0x49a424={'count':0x0,'rows':[]};var _0x8ebba8=_['map'](db['FaxMessage'][_0x21b5('0x35')],function(_0x59d980){return{'name':_0x59d980[_0x21b5('0x36')],'type':_0x59d980[_0x21b5('0x37')][_0x21b5('0x38')]};});_0x21b87b['model']=_[_0x21b5('0x39')](_0x8ebba8,_0x21b5('0x32'));_0x21b87b[_0x21b5('0x3a')]=_['keys'](_0x13fafc[_0x21b5('0x3a')]);_0x21b87b[_0x21b5('0x3b')]=_[_0x21b5('0x3c')](_0x21b87b[_0x21b5('0x3d')],_0x21b87b[_0x21b5('0x3a')]);_0x168d14[_0x21b5('0x3e')]=_[_0x21b5('0x3c')](_0x21b87b[_0x21b5('0x3d')],qs[_0x21b5('0x3f')](_0x13fafc['query'][_0x21b5('0x3f')]));_0x168d14[_0x21b5('0x3e')]=_0x168d14[_0x21b5('0x3e')][_0x21b5('0x40')]?_0x168d14[_0x21b5('0x3e')]:_0x21b87b[_0x21b5('0x3d')];if(!_0x13fafc[_0x21b5('0x3a')][_0x21b5('0x41')](_0x21b5('0x42'))){_0x168d14['limit']=qs[_0x21b5('0x2b')](_0x13fafc[_0x21b5('0x3a')][_0x21b5('0x2b')]);_0x168d14['offset']=qs['offset'](_0x13fafc[_0x21b5('0x3a')][_0x21b5('0x28')]);}_0x168d14['order']=qs[_0x21b5('0x43')](_0x13fafc[_0x21b5('0x3a')][_0x21b5('0x43')]);_0x168d14[_0x21b5('0x44')]=qs[_0x21b5('0x3b')](_['pick'](_0x13fafc[_0x21b5('0x3a')],_0x21b87b[_0x21b5('0x3b')]),_0x8ebba8);if(_0x13fafc[_0x21b5('0x3a')]['filter']){_0x168d14['where']=_[_0x21b5('0x45')](_0x168d14[_0x21b5('0x44')],{'$or':_[_0x21b5('0x39')](_0x8ebba8,function(_0x4e4c9){if(_0x4e4c9[_0x21b5('0x37')]!==_0x21b5('0x46')){var _0x4d47fe={};_0x4d47fe[_0x4e4c9['name']]={'$like':'%'+_0x13fafc[_0x21b5('0x3a')][_0x21b5('0x47')]+'%'};return _0x4d47fe;}})});}_0x168d14=_['merge']({},_0x168d14,_0x13fafc[_0x21b5('0x48')]);var _0x36ba57={'where':_0x168d14[_0x21b5('0x44')]};return db[_0x21b5('0x49')][_0x21b5('0x2a')](_0x36ba57)[_0x21b5('0x1d')](function(_0x4cf5aa){_0x49a424[_0x21b5('0x2a')]=_0x4cf5aa;if(_0x13fafc[_0x21b5('0x3a')][_0x21b5('0x4a')]){_0x168d14[_0x21b5('0x4b')]=[{'all':!![]}];}return db[_0x21b5('0x49')][_0x21b5('0x4c')](_0x168d14);})['then'](function(_0x104811){_0x49a424[_0x21b5('0x4d')]=_0x104811;return _0x49a424;})[_0x21b5('0x1d')](respondWithFilteredResult(_0x27defa,_0x168d14))[_0x21b5('0x25')](handleError(_0x27defa,null));};exports[_0x21b5('0x4e')]=function(_0x3ef744,_0x3e0461){var _0x4b79f8={'raw':!![],'where':{'id':_0x3ef744['params']['id']}},_0x11dd50={};_0x11dd50[_0x21b5('0x3d')]=_['keys'](db['FaxMessage'][_0x21b5('0x35')]);_0x11dd50['query']=_[_0x21b5('0x4f')](_0x3ef744[_0x21b5('0x3a')]);_0x11dd50[_0x21b5('0x3b')]=_[_0x21b5('0x3c')](_0x11dd50[_0x21b5('0x3d')],_0x11dd50[_0x21b5('0x3a')]);_0x4b79f8['attributes']=_[_0x21b5('0x3c')](_0x11dd50[_0x21b5('0x3d')],qs[_0x21b5('0x3f')](_0x3ef744[_0x21b5('0x3a')][_0x21b5('0x3f')]));_0x4b79f8[_0x21b5('0x3e')]=_0x4b79f8['attributes']['length']?_0x4b79f8[_0x21b5('0x3e')]:_0x11dd50['model'];if(_0x3ef744[_0x21b5('0x3a')][_0x21b5('0x4a')]){_0x4b79f8[_0x21b5('0x4b')]=[{'all':!![]}];}_0x4b79f8=_[_0x21b5('0x45')]({},_0x4b79f8,_0x3ef744[_0x21b5('0x48')]);return db['FaxMessage'][_0x21b5('0x50')](_0x4b79f8)[_0x21b5('0x1d')](handleEntityNotFound(_0x3e0461,null))[_0x21b5('0x1d')](respondWithResult(_0x3e0461,null))['catch'](handleError(_0x3e0461,null));};exports[_0x21b5('0x51')]=function(_0x487a4b,_0x94fe42){if(_0x487a4b['body']['id']){delete _0x487a4b[_0x21b5('0x52')]['id'];}return db[_0x21b5('0x49')][_0x21b5('0x50')]({'where':{'id':_0x487a4b[_0x21b5('0x53')]['id']}})[_0x21b5('0x1d')](handleEntityNotFound(_0x94fe42,null))[_0x21b5('0x1d')](saveUpdates(_0x487a4b['body'],null))[_0x21b5('0x1d')](respondWithResult(_0x94fe42,null))[_0x21b5('0x25')](handleError(_0x94fe42,null));};exports['destroy']=function(_0xacb548,_0x251197){return db[_0x21b5('0x49')][_0x21b5('0x50')]({'where':{'id':_0xacb548[_0x21b5('0x53')]['id']}})[_0x21b5('0x1d')](handleEntityNotFound(_0x251197,null))[_0x21b5('0x1d')](removeEntity(_0x251197,null))['catch'](handleError(_0x251197,null));};exports['describe']=function(_0x385224,_0x59bc07){return db[_0x21b5('0x49')][_0x21b5('0x54')]()['then'](respondWithResult(_0x59bc07,null))[_0x21b5('0x25')](handleError(_0x59bc07,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x21b5('0x55')]=function(_0x81f772,_0x1befc3,_0x2d4720){var _0x4d4576={'agent':{},'channel':'fax'};if(_0x81f772[_0x21b5('0x52')]['id']){delete _0x81f772['body']['id'];}_0x81f772[_0x21b5('0x52')][_0x21b5('0x56')]=!![];_0x81f772['body'][_0x21b5('0x57')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x81f772[_0x21b5('0x52')][_0x21b5('0x58')]=_0x81f772[_0x21b5('0x52')]['UserId']||_0x81f772[_0x21b5('0x59')]['id'];_0x4d4576[_0x21b5('0x5a')]['id']=_0x81f772[_0x21b5('0x52')][_0x21b5('0x58')];return db['FaxMessage'][_0x21b5('0x50')]({'where':{'id':_0x81f772[_0x21b5('0x53')]['id'],'UserId':null}})[_0x21b5('0x1d')](handleEntityNotFound(_0x1befc3,null))['then'](saveUpdates(_0x81f772[_0x21b5('0x52')],null))[_0x21b5('0x1d')](function(_0x25ccee){if(_0x25ccee){_0x4d4576[_0x21b5('0x24')]=_0x25ccee[_0x21b5('0x5b')]({'plain':!![]});return db[_0x21b5('0x5c')][_0x21b5('0x50')]({'where':{'id':_0x25ccee['FaxInteractionId']}});}return null;})[_0x21b5('0x1d')](handleEntityNotFound(_0x1befc3,null))[_0x21b5('0x1d')](function(_0x419ad1){if(_0x419ad1){return _0x419ad1[_0x21b5('0x51')]({'UserId':_0x81f772[_0x21b5('0x52')][_0x21b5('0x58')],'read1stAt':_[_0x21b5('0x5d')](_0x419ad1[_0x21b5('0x5e')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x21b5('0x1d')](function(_0x3ec82a){if(_0x3ec82a){_0x4d4576['interaction']=_0x3ec82a['get']({'plain':!![]});interaction_log[_0x21b5('0x1e')](_0x21b5('0x5f'),_0x81f772['user']['id'],_0x81f772[_0x21b5('0x59')][_0x21b5('0x32')],_0x81f772[_0x21b5('0x59')][_0x21b5('0x60')],_0x4d4576['interaction']['id'],_0x81f772[_0x21b5('0x52')]?JSON[_0x21b5('0x61')](_0x81f772[_0x21b5('0x52')]):_0x21b5('0x62'));return respondWithRpcPromise('AcceptMessage',_0x21b5('0x63'),_0x4d4576);}return null;})[_0x21b5('0x1d')](function(_0x2f4c0d){var _0x4e862a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2f4c0d[_0x21b5('0x24')]['ContactId'];return db[_0x21b5('0x64')][_0x21b5('0x3a')](_0x4e862a,{'type':db[_0x21b5('0x65')][_0x21b5('0x66')]['SELECT'],'raw':!![]})[_0x21b5('0x1d')](function(_0x2848e4){return _0x2848e4;});})[_0x21b5('0x1d')](function(_0x33c632){if(_0x33c632){_0x4d4576[_0x21b5('0x24')][_0x21b5('0x67')]=_0x33c632[0x0];if(!_0x81f772[_0x21b5('0x52')][_0x21b5('0x58')])return;return db[_0x21b5('0x68')][_0x21b5('0x50')]({'where':{'id':_0x81f772['body'][_0x21b5('0x58')],'role':_0x21b5('0x5a')},'attributes':['id','name',_0x21b5('0x69'),_0x21b5('0x6a'),_0x21b5('0x6b')],'raw':!![]});}return null;})[_0x21b5('0x1d')](function(_0x4c2e1a){if(!_0x4c2e1a)return null;_0x4d4576[_0x21b5('0x24')][_0x21b5('0x5a')]=_0x4c2e1a;return _0x4d4576;})[_0x21b5('0x1d')](function(_0x5ade40){if(_0x5ade40){if(_0x81f772[_0x21b5('0x52')][_0x21b5('0x6c')]){_0x4d4576[_0x21b5('0x24')][_0x21b5('0x6d')]=util[_0x21b5('0x6e')](_0x21b5('0x6f'),_0x81f772[_0x21b5('0x59')][_0x21b5('0x32')]);_0x4d4576[_0x21b5('0x24')][_0x21b5('0x70')]=_0x4d4576[_0x21b5('0x70')];_0x4d4576['message']['motionChannel']=_0x4d4576[_0x21b5('0x70')];_0x4d4576[_0x21b5('0x24')][_0x21b5('0x71')]=_0x21b5('0x55');return respondWithRpcPromise(_0x21b5('0x72'),_0x21b5('0x72'),{'event':'acceptmessage','message':_0x4d4576[_0x21b5('0x24')]},client9002)[_0x21b5('0x1d')](function(){return _0x4d4576;});}return _0x4d4576;}return null;})[_0x21b5('0x1d')](respondWithResult(_0x1befc3,null))[_0x21b5('0x25')](handleError(_0x1befc3,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x21b5('0x2d')]=function(_0x128d23,_0x2af600,_0x1f92c8){var _0x4c80c4={'agent':{},'channel':_0x21b5('0x73')};if(_0x128d23[_0x21b5('0x52')]['id']){delete _0x128d23[_0x21b5('0x52')]['id'];}_0x128d23[_0x21b5('0x52')][_0x21b5('0x58')]=_0x128d23['body']['UserId']||_0x128d23[_0x21b5('0x59')]['id'];_0x4c80c4['agent']['id']=_0x128d23['body'][_0x21b5('0x58')];return db[_0x21b5('0x49')]['find']({'where':{'id':_0x128d23['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2af600,null))[_0x21b5('0x1d')](function(_0xf84051){if(_0xf84051){_0x4c80c4[_0x21b5('0x24')]=_0xf84051['get']({'plain':!![]});return db[_0x21b5('0x5c')][_0x21b5('0x50')]({'where':{'id':_0xf84051[_0x21b5('0x74')]}});}return null;})[_0x21b5('0x1d')](handleEntityNotFound(_0x2af600,null))[_0x21b5('0x1d')](function(_0x3a59b8){if(_0x3a59b8){_0x4c80c4[_0x21b5('0x75')]=_0x3a59b8[_0x21b5('0x5b')]({'plain':!![]});interaction_log[_0x21b5('0x1e')](_0x21b5('0x76'),_0x128d23['user']['id'],_0x128d23[_0x21b5('0x59')][_0x21b5('0x32')],_0x128d23[_0x21b5('0x59')]['role'],_0x4c80c4[_0x21b5('0x75')]['id'],_0x128d23[_0x21b5('0x52')]?JSON[_0x21b5('0x61')](_0x128d23[_0x21b5('0x52')]):_0x21b5('0x62'));return respondWithRpcPromise(_0x21b5('0x77'),_0x21b5('0x78'),_0x4c80c4);}return null;})[_0x21b5('0x1d')](function(_0x196470){var _0x334157=_0x21b5('0x79')+_0x196470['message']['ContactId'];return db[_0x21b5('0x64')]['query'](_0x334157,{'type':db[_0x21b5('0x65')]['QueryTypes'][_0x21b5('0x7a')],'raw':!![]})[_0x21b5('0x1d')](function(_0x4793c7){return _0x4793c7;});})[_0x21b5('0x1d')](function(_0x5b1f89){if(_0x5b1f89){_0x4c80c4[_0x21b5('0x24')][_0x21b5('0x67')]=_0x5b1f89[0x0];if(!_0x128d23[_0x21b5('0x52')][_0x21b5('0x58')])return;return db[_0x21b5('0x68')][_0x21b5('0x50')]({'where':{'id':_0x128d23[_0x21b5('0x52')][_0x21b5('0x58')],'role':_0x21b5('0x5a')},'attributes':['id',_0x21b5('0x32'),'fullname',_0x21b5('0x6a'),_0x21b5('0x6b')],'raw':!![]});}return null;})[_0x21b5('0x1d')](function(_0x27bbc8){if(!_0x27bbc8)return null;_0x4c80c4[_0x21b5('0x24')][_0x21b5('0x5a')]=_0x27bbc8;return _0x4c80c4;})['then'](function(_0x442a16){if(_0x442a16){_0x442a16[_0x21b5('0x24')][_0x21b5('0x6d')]=util[_0x21b5('0x6e')](_0x21b5('0x6f'),_0x128d23[_0x21b5('0x59')]['name']);_0x442a16[_0x21b5('0x24')][_0x21b5('0x70')]=_0x4c80c4[_0x21b5('0x70')];_0x442a16[_0x21b5('0x24')][_0x21b5('0x7b')]=_0x4c80c4[_0x21b5('0x70')];_0x442a16['message']['event']=_0x21b5('0x2d');respondWithRpcPromise(_0x21b5('0x72'),_0x21b5('0x72'),{'event':_0x21b5('0x7c'),'message':_0x442a16[_0x21b5('0x24')]},client9002);return _0x4c80c4;}return null;})[_0x21b5('0x1d')](respondWithResult(_0x2af600,null))[_0x21b5('0x25')](handleError(_0x2af600,null));};exports[_0x21b5('0x7d')]=function(_0x58486a,_0x438935){var _0x4848c6;return db[_0x21b5('0x49')][_0x21b5('0x7d')](_0x58486a[_0x21b5('0x52')],{})[_0x21b5('0x1d')](function(_0x1c14f4){_0x4848c6=_0x1c14f4;return db[_0x21b5('0x7e')][_0x21b5('0x7f')]({'where':{'id':_0x4848c6[_0x21b5('0x80')]}});})[_0x21b5('0x1d')](function(_0x1fb66f){if(_[_0x21b5('0x5d')](_0x1fb66f)){return;}else{_0x4848c6[_0x21b5('0x73')]=_0x1fb66f[_0x21b5('0x73')];return db[_0x21b5('0x81')][_0x21b5('0x7f')]({'where':{'id':_0x4848c6['AttachmentId']}});}})['then'](function(_0x2f7cb7){return respondWithRpcPromise(_0x21b5('0x82'),_0x21b5('0x82'),{'FaxAccountId':_[_0x21b5('0x5d')](_0x58486a['body'])?undefined:_0x58486a['body']['FaxAccountId'],'path':_[_0x21b5('0x5d')](_0x2f7cb7)?undefined:util[_0x21b5('0x6e')]('/var/opt/motion2/server/files/attachments/%s',_0x2f7cb7[_0x21b5('0x83')]),'fax':_['isNil'](_0x4848c6[_0x21b5('0x73')])?undefined:_0x4848c6[_0x21b5('0x73')],'AttachmentId':_0x4848c6[_0x21b5('0x84')]},client9002);})[_0x21b5('0x1d')](respondWithResult(_0x438935,0xc9))[_0x21b5('0x25')](handleError(_0x438935,null));};exports[_0x21b5('0x85')]=function(_0x4d03b4,_0x10d648){var _0x2695ac=path[_0x21b5('0x86')](config[_0x21b5('0x87')],_0x21b5('0x88'),_0x21b5('0x89'),_0x21b5('0x8a'));return db[_0x21b5('0x49')]['find']({'where':{'id':_0x4d03b4[_0x21b5('0x53')]['id']},'include':[{'model':db[_0x21b5('0x81')],'as':_0x21b5('0x81')}]})[_0x21b5('0x1d')](handleEntityNotFound(_0x10d648,null))[_0x21b5('0x1d')](function(_0x232de){if(_0x232de){return _0x10d648['download'](path['join'](_0x2695ac,_0x232de[_0x21b5('0x81')][_0x21b5('0x83')]));}})['catch'](handleError(_0x10d648,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 4cfdc29..57ee3ff 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 _0x0967=['update','remove','emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save'];(function(_0x384c01,_0x1e0dc5){var _0x300793=function(_0x32bb86){while(--_0x32bb86){_0x384c01['push'](_0x384c01['shift']());}};_0x300793(++_0x1e0dc5);}(_0x0967,0x100));var _0x7096=function(_0x1dd8df,_0x54b7bc){_0x1dd8df=_0x1dd8df-0x0;var _0xb2abea=_0x0967[_0x1dd8df];return _0xb2abea;};'use strict';var EventEmitter=require(_0x7096('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7096('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7096('0x2')](0x0);var events={'afterCreate':_0x7096('0x3'),'afterUpdate':_0x7096('0x4'),'afterDestroy':_0x7096('0x5')};function emitEvent(_0xe41170){return function(_0x4106a2,_0x2a50e2,_0x4eba77){FaxMessageEvents[_0x7096('0x6')](_0xe41170+':'+_0x4106a2['id'],_0x4106a2);FaxMessageEvents[_0x7096('0x6')](_0xe41170,_0x4106a2);_0x4eba77(null);};}for(var e in events){if(events[_0x7096('0x7')](e)){var event=events[e];FaxMessage[_0x7096('0x8')](e,emitEvent(event));}}module[_0x7096('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x806b=['update','remove','emit','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x3d0695,_0x7282c5){var _0x36b6e8=function(_0x2407b4){while(--_0x2407b4){_0x3d0695['push'](_0x3d0695['shift']());}};_0x36b6e8(++_0x7282c5);}(_0x806b,0x163));var _0xb806=function(_0x1971d3,_0x1e5634){_0x1971d3=_0x1971d3-0x0;var _0x56167c=_0x806b[_0x1971d3];return _0x56167c;};'use strict';var EventEmitter=require(_0xb806('0x0'));var FaxMessage=require(_0xb806('0x1'))['db'][_0xb806('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xb806('0x3')](0x0);var events={'afterCreate':_0xb806('0x4'),'afterUpdate':_0xb806('0x5'),'afterDestroy':_0xb806('0x6')};function emitEvent(_0x2cbd26){return function(_0x595117,_0x32c93c,_0x2ddaa3){FaxMessageEvents[_0xb806('0x7')](_0x2cbd26+':'+_0x595117['id'],_0x595117);FaxMessageEvents[_0xb806('0x7')](_0x2cbd26,_0x595117);_0x2ddaa3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xb806('0x8')](e,emitEvent(event));}}module[_0xb806('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 55f1f35..07ff277 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 _0x8419=['api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','update','catch','utf8mb4','lodash','util','../../config/logger'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x8419,0x6d));var _0x9841=function(_0x1d5835,_0x4c4366){_0x1d5835=_0x1d5835-0x0;var _0x1a16af=_0x8419[_0x1d5835];return _0x1a16af;};'use strict';var _=require(_0x9841('0x0'));var util=require(_0x9841('0x1'));var logger=require(_0x9841('0x2'))(_0x9841('0x3'));var moment=require(_0x9841('0x4'));var BPromise=require(_0x9841('0x5'));var rp=require(_0x9841('0x6'));var fs=require('fs');var path=require(_0x9841('0x7'));var rimraf=require(_0x9841('0x8'));var config=require('../../config/environment');var attributes=require(_0x9841('0x9'));module[_0x9841('0xa')]=function(_0x2acd7e,_0x490475){return _0x2acd7e['define'](_0x9841('0xb'),attributes,{'tableName':_0x9841('0xc'),'paranoid':![],'indexes':[{'name':_0x9841('0xd'),'fields':[_0x9841('0xe')],'type':_0x9841('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a69c0,_0x2edcce,_0x3c3cfb){var _0x38a84d=_0x2acd7e['models'];var _0x564a75=_0x2a69c0[_0x9841('0x10')]({'plain':!![]});if(_0x564a75[_0x9841('0x11')][_0x9841('0x12')]()==='in'||_0x564a75['direction']['toLowerCase']()===_0x9841('0x13')&&!_0x564a75[_0x9841('0x14')]&&!_[_0x9841('0x15')](_0x564a75[_0x9841('0x16')])){_0x38a84d['FaxInteraction'][_0x9841('0x17')]({'where':{'id':_0x564a75[_0x9841('0x18')]}})['then'](function(_0x5610f6){if(_0x5610f6){_0x5610f6[_0x9841('0x19')]({'lastMsgAt':_0x564a75['createdAt'],'lastMsgDirection':_0x564a75[_0x9841('0x11')][_0x9841('0x12')]()});}})[_0x9841('0x1a')](function(_0x3ce0ca){console['error'](_0x3ce0ca);});}_0x3c3cfb();}},'charset':_0x9841('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8b51=['toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxMessage','fti_fax_messages','FULLTEXT','models','get','direction'];(function(_0x26cd0e,_0x258a66){var _0x3cd200=function(_0x5b7c6b){while(--_0x5b7c6b){_0x26cd0e['push'](_0x26cd0e['shift']());}};_0x3cd200(++_0x258a66);}(_0x8b51,0x1cf));var _0x18b5=function(_0x10c3bd,_0x2d9216){_0x10c3bd=_0x10c3bd-0x0;var _0x5d48f0=_0x8b51[_0x10c3bd];return _0x5d48f0;};'use strict';var _=require(_0x18b5('0x0'));var util=require(_0x18b5('0x1'));var logger=require(_0x18b5('0x2'))(_0x18b5('0x3'));var moment=require(_0x18b5('0x4'));var BPromise=require(_0x18b5('0x5'));var rp=require(_0x18b5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18b5('0x7'));var config=require(_0x18b5('0x8'));var attributes=require('./faxMessage.attributes');module[_0x18b5('0x9')]=function(_0x5b6274,_0x4d93a3){return _0x5b6274[_0x18b5('0xa')](_0x18b5('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x18b5('0xc'),'fields':['body'],'type':_0x18b5('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x37bd18,_0x348a8d,_0x5225e1){var _0x58fe0d=_0x5b6274[_0x18b5('0xe')];var _0x443808=_0x37bd18[_0x18b5('0xf')]({'plain':!![]});if(_0x443808[_0x18b5('0x10')][_0x18b5('0x11')]()==='in'||_0x443808[_0x18b5('0x10')][_0x18b5('0x11')]()===_0x18b5('0x12')&&!_0x443808[_0x18b5('0x13')]&&!_[_0x18b5('0x14')](_0x443808[_0x18b5('0x15')])){_0x58fe0d[_0x18b5('0x16')][_0x18b5('0x17')]({'where':{'id':_0x443808['FaxInteractionId']}})[_0x18b5('0x18')](function(_0x217a11){if(_0x217a11){_0x217a11[_0x18b5('0x19')]({'lastMsgAt':_0x443808['createdAt'],'lastMsgDirection':_0x443808[_0x18b5('0x10')][_0x18b5('0x11')]()});}})[_0x18b5('0x1a')](function(_0x207553){console[_0x18b5('0x1b')](_0x207553);});}_0x5225e1();}},'charset':_0x18b5('0x1c'),'collate':_0x18b5('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index d55a342..95bdba5 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 _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0x3ca7bd,_0x5f46b2){var _0x4a69a9=function(_0x3af259){while(--_0x3af259){_0x3ca7bd['push'](_0x3ca7bd['shift']());}};_0x4a69a9(++_0x5f46b2);}(_0x0e85,0x7c));var _0x50e8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0e85[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});}; \ No newline at end of file +var _0xb821=['register','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x7c317d,_0x5806ae){var _0x40b74c=function(_0x3a9a15){while(--_0x3a9a15){_0x7c317d['push'](_0x7c317d['shift']());}};_0x40b74c(++_0x5806ae);}(_0xb821,0xa7));var _0x1b82=function(_0x2c6ec8,_0x183d07){_0x2c6ec8=_0x2c6ec8-0x0;var _0x1ea328=_0xb821[_0x2c6ec8];return _0x1ea328;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});config[_0x1b82('0x8')]=_[_0x1b82('0x9')](config[_0x1b82('0x8')],{'host':_0x1b82('0xa'),'port':0x18eb});var socket=require(_0x1b82('0xb'))(new Redis(config[_0x1b82('0x8')]));require(_0x1b82('0xc'))[_0x1b82('0xd')](socket);function respondWithRpcPromise(_0x4955b5,_0x4011f2,_0x30c6ee){return new BPromise(function(_0x44dfd4,_0x14c57a){return client[_0x1b82('0xe')](_0x4955b5,_0x30c6ee)[_0x1b82('0xf')](function(_0x739f99){logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1b82('0x11'));logger[_0x1b82('0x12')](_0x1b82('0x13'),_0x4011f2,_0x1b82('0x11'),JSON['stringify'](_0x739f99));if(_0x739f99[_0x1b82('0x14')]){if(_0x739f99['error']['code']===0x1f4){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);return _0x14c57a(_0x739f99['error'][_0x1b82('0x15')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')]['message']);return _0x44dfd4(_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);}else{logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,'request\x20sent');_0x44dfd4(_0x739f99[_0x1b82('0x16')]['message']);}})[_0x1b82('0x17')](function(_0x1002a1){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1002a1);_0x14c57a(_0x1002a1);});});}exports[_0x1b82('0x18')]=function(_0x2b6ee8){var _0x11af50=this;return new Promise(function(_0x46e5e2,_0x10d45c){return db['FaxMessage'][_0x1b82('0x19')](_0x2b6ee8[_0x1b82('0x1a')],{'raw':_0x2b6ee8[_0x1b82('0x1b')]?_0x2b6ee8[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![]})[_0x1b82('0xf')](function(_0x2d07f4){logger['info'](_0x1b82('0x18'),_0x2b6ee8);logger[_0x1b82('0x12')]('CreateFaxMessage',_0x2b6ee8,JSON[_0x1b82('0x1d')](_0x2d07f4));_0x46e5e2(_0x2d07f4);})[_0x1b82('0x17')](function(_0x1ad9d6){logger['error'](_0x1b82('0x18'),_0x1ad9d6['message'],_0x2b6ee8);_0x10d45c(_0x11af50['error'](0x1f4,_0x1ad9d6['message']));});});};exports[_0x1b82('0x1e')]=function(_0x149d0f){var _0xfd00d1=this;return new Promise(function(_0x257b79,_0x548a3b){return db[_0x1b82('0x1f')][_0x1b82('0x20')](_0x149d0f[_0x1b82('0x1a')],{'raw':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x21')]||null:null,'attributes':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x22')]||null:null,'limit':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f['options'][_0x1b82('0x23')]||null:null})[_0x1b82('0xf')](function(_0x155a34){logger[_0x1b82('0x10')](_0x1b82('0x1e'),_0x149d0f);logger[_0x1b82('0x12')](_0x1b82('0x1e'),_0x149d0f,JSON[_0x1b82('0x1d')](_0x155a34));_0x257b79(_0x155a34);})[_0x1b82('0x17')](function(_0x362657){logger['error'](_0x1b82('0x1e'),_0x362657[_0x1b82('0x15')],_0x149d0f);_0x548a3b(_0xfd00d1[_0x1b82('0x14')](0x1f4,_0x362657[_0x1b82('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7b23479..661c6ac 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 _0x9bec=['length','faxMessage:','./faxMessage.events','save','remove','emit','register'];(function(_0x3a41a8,_0x1e25b9){var _0x19dfeb=function(_0x4f6567){while(--_0x4f6567){_0x3a41a8['push'](_0x3a41a8['shift']());}};_0x19dfeb(++_0x1e25b9);}(_0x9bec,0xf0));var _0xc9be=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9bec[_0x126558];return _0x1f6d14;};'use strict';var FaxMessageEvents=require(_0xc9be('0x0'));var events=[_0xc9be('0x1'),_0xc9be('0x2'),'update'];function createListener(_0x333dfe,_0x41718b){return function(_0x1c69b4){_0x41718b[_0xc9be('0x3')](_0x333dfe,_0x1c69b4);};}function removeListener(_0x2127d8,_0x1234d3){return function(){FaxMessageEvents['removeListener'](_0x2127d8,_0x1234d3);};}exports[_0xc9be('0x4')]=function(_0x2e510e){for(var _0x595e85=0x0,_0x1316cd=events[_0xc9be('0x5')];_0x595e85<_0x1316cd;_0x595e85++){var _0x44a1bc=events[_0x595e85];var _0x9a8910=createListener(_0xc9be('0x6')+_0x44a1bc,_0x2e510e);FaxMessageEvents['on'](_0x44a1bc,_0x9a8910);}}; \ No newline at end of file +var _0x4ef3=['save','remove','update','removeListener','register','length','faxMessage:'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4ef3,0x103));var _0x34ef=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0x4ef3[_0x35d59c];return _0x18cd27;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x34ef('0x0'),_0x34ef('0x1'),_0x34ef('0x2')];function createListener(_0x14a020,_0x13c18d){return function(_0x9cdc29){_0x13c18d['emit'](_0x14a020,_0x9cdc29);};}function removeListener(_0xfb5250,_0x3f8c20){return function(){FaxMessageEvents[_0x34ef('0x3')](_0xfb5250,_0x3f8c20);};}exports[_0x34ef('0x4')]=function(_0x4059b){for(var _0x40b733=0x0,_0x159054=events[_0x34ef('0x5')];_0x40b733<_0x159054;_0x40b733++){var _0x2ca28b=events[_0x40b733];var _0x178496=createListener(_0x34ef('0x6')+_0x2ca28b,_0x4059b);FaxMessageEvents['on'](_0x2ca28b,_0x178496);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 21ce553..6488108 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 _0x4ea3=['isAuthenticated','index','/describe','/:id','/:id/download','post','tracked','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./faxMessage.controller','get'];(function(_0x4e069d,_0x250d71){var _0x3558ae=function(_0x55550b){while(--_0x55550b){_0x4e069d['push'](_0x4e069d['shift']());}};_0x3558ae(++_0x250d71);}(_0x4ea3,0x70));var _0x34ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4ea3[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['describe']);router[_0x34ea('0x7')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0x7')](_0x34ea('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x34ea('0xd')]('/',auth[_0x34ea('0x8')](),interaction[_0x34ea('0xe')]('fax',_0x34ea('0xf')),controller[_0x34ea('0x10')]);router[_0x34ea('0x11')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0x12')]);router[_0x34ea('0x11')](_0x34ea('0x13'),auth[_0x34ea('0x8')](),controller[_0x34ea('0x14')]);router[_0x34ea('0x11')]('/:id/reject',auth[_0x34ea('0x8')](),controller[_0x34ea('0x15')]);router[_0x34ea('0x16')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['destroy']);module[_0x34ea('0x17')]=router; \ No newline at end of file +var _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','faxmessage:create'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0x1be1,0x192));var _0x11be=function(_0x59d601,_0x349ff3){_0x59d601=_0x59d601-0x0;var _0x52b7b2=_0x1be1[_0x59d601];return _0x52b7b2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('fax',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 46f0d26..5e0d510 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 _0xceed=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xceed,0x76));var _0xdcee=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xceed[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0xdcee('0x0'));module['exports']={'name':{'type':Sequelize[_0xdcee('0x1')],'unique':_0xdcee('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdcee('0x1')]},'timeout':{'type':Sequelize[_0xdcee('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdcee('0x4')](_0xdcee('0x5'),_0xdcee('0x6'),_0xdcee('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdcee('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa759=['roundrobin','sequelize','exports','STRING','name'];(function(_0x17dc50,_0x351b90){var _0x15d854=function(_0x1a0e5c){while(--_0x1a0e5c){_0x17dc50['push'](_0x17dc50['shift']());}};_0x15d854(++_0x351b90);}(_0xa759,0xb5));var _0x9a75=function(_0x21125f,_0x8079f8){_0x21125f=_0x21125f-0x0;var _0x2f421d=_0xa759[_0x21125f];return _0x2f421d;};'use strict';var Sequelize=require(_0x9a75('0x0'));module[_0x9a75('0x1')]={'name':{'type':Sequelize[_0x9a75('0x2')],'unique':_0x9a75('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a75('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x9a75('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 947b02f..83bfa52 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 _0xef52=['length','hasOwnProperty','limit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','nolimit','FaxQueueId','merge','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','union','compact','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','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','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','update','destroy','FaxQueues','then','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x1aa65d,_0xf9591d){var _0x3f6502=function(_0x2006ad){while(--_0x2006ad){_0x1aa65d['push'](_0x1aa65d['shift']());}};_0x3f6502(++_0xf9591d);}(_0xef52,0xdd));var _0x2ef5=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0xef52[_0x1e48d3];return _0x2852b1;};'use strict';var emlformat=require(_0x2ef5('0x0'));var rimraf=require(_0x2ef5('0x1'));var zipdir=require(_0x2ef5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ef5('0x3'));var moment=require('moment');var BPromise=require(_0x2ef5('0x4'));var Mustache=require(_0x2ef5('0x5'));var util=require('util');var path=require(_0x2ef5('0x6'));var sox=require(_0x2ef5('0x7'));var csv=require(_0x2ef5('0x8'));var ejs=require(_0x2ef5('0x9'));var fs=require('fs');var fs_extra=require(_0x2ef5('0xa'));var _=require(_0x2ef5('0xb'));var squel=require(_0x2ef5('0xc'));var crypto=require(_0x2ef5('0xd'));var jsforce=require(_0x2ef5('0xe'));var deskjs=require(_0x2ef5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2ef5('0x10'));var Papa=require(_0x2ef5('0x11'));var Redis=require(_0x2ef5('0x12'));var authService=require(_0x2ef5('0x13'));var qs=require(_0x2ef5('0x14'));var as=require(_0x2ef5('0x15'));var hardwareService=require(_0x2ef5('0x16'));var logger=require(_0x2ef5('0x17'))('api');var utils=require(_0x2ef5('0x18'));var config=require(_0x2ef5('0x19'));var licenseUtil=require(_0x2ef5('0x1a'));var db=require(_0x2ef5('0x1b'))['db'];config[_0x2ef5('0x1c')]=_[_0x2ef5('0x1d')](config[_0x2ef5('0x1c')],{'host':_0x2ef5('0x1e'),'port':0x18eb});var socket=require(_0x2ef5('0x1f'))(new Redis(config[_0x2ef5('0x1c')]));require(_0x2ef5('0x20'))[_0x2ef5('0x21')](socket);function respondWithStatusCode(_0x153410,_0x2e0b4d){_0x2e0b4d=_0x2e0b4d||0xcc;return function(_0x4b8c50){if(_0x4b8c50){return _0x153410[_0x2ef5('0x22')](_0x2e0b4d);}return _0x153410[_0x2ef5('0x23')](_0x2e0b4d)[_0x2ef5('0x24')]();};}function respondWithResult(_0x4eb1c1,_0x40edaf){_0x40edaf=_0x40edaf||0xc8;return function(_0x8b22eb){if(_0x8b22eb){return _0x4eb1c1[_0x2ef5('0x23')](_0x40edaf)[_0x2ef5('0x25')](_0x8b22eb);}};}function respondWithFilteredResult(_0x3a0781,_0x33a636){return function(_0x5a0e7e){if(_0x5a0e7e){var _0x4c48c4=typeof _0x33a636['offset']===_0x2ef5('0x26')&&typeof _0x33a636['limit']===_0x2ef5('0x26');var _0x468f3d=_0x5a0e7e[_0x2ef5('0x27')];var _0xcf948b=_0x4c48c4?0x0:_0x33a636[_0x2ef5('0x28')];var _0x68c527=_0x4c48c4?_0x5a0e7e[_0x2ef5('0x27')]:_0x33a636['offset']+_0x33a636['limit'];var _0x4b745d;if(_0x68c527>=_0x468f3d){_0x68c527=_0x468f3d;_0x4b745d=0xc8;}else{_0x4b745d=0xce;}_0x3a0781[_0x2ef5('0x23')](_0x4b745d);return _0x3a0781[_0x2ef5('0x29')](_0x2ef5('0x2a'),_0xcf948b+'-'+_0x68c527+'/'+_0x468f3d)[_0x2ef5('0x25')](_0x5a0e7e);}return null;};}function patchUpdates(_0x106a6b){return function(_0x511968){try{jsonpatch[_0x2ef5('0x2b')](_0x511968,_0x106a6b,!![]);}catch(_0x4c4455){return BPromise['reject'](_0x4c4455);}return _0x511968['save']();};}function saveUpdates(_0x10a4c2,_0x582b50){return function(_0x53bed6){if(_0x53bed6){return _0x53bed6[_0x2ef5('0x2c')](_0x10a4c2)['then'](function(_0x203709){return _0x203709;});}return null;};}function removeEntity(_0x28d97d,_0x51163f){return function(_0x127b2c){if(_0x127b2c){return _0x127b2c[_0x2ef5('0x2d')]()['then'](function(){var _0x22e4db=_0x127b2c['get']({'plain':!![]});var _0x27f1ef=_0x2ef5('0x2e');return db['UserProfileResource'][_0x2ef5('0x2d')]({'where':{'type':_0x27f1ef,'resourceId':_0x22e4db['id']}})['then'](function(){return _0x127b2c;});})[_0x2ef5('0x2f')](function(){_0x28d97d[_0x2ef5('0x23')](0xcc)[_0x2ef5('0x24')]();});}};}function handleEntityNotFound(_0x11f37e,_0x26d846){return function(_0x4c6537){if(!_0x4c6537){_0x11f37e[_0x2ef5('0x22')](0x194);}return _0x4c6537;};}function handleError(_0x34c10a,_0x33e696){_0x33e696=_0x33e696||0x1f4;return function(_0x1ea7db){logger[_0x2ef5('0x30')](_0x1ea7db[_0x2ef5('0x31')]);if(_0x1ea7db['name']){delete _0x1ea7db[_0x2ef5('0x32')];}_0x34c10a[_0x2ef5('0x23')](_0x33e696)[_0x2ef5('0x33')](_0x1ea7db);};}exports[_0x2ef5('0x34')]=function(_0x5a2654,_0x41d2ce){var _0x528ee3={},_0x23fec5={},_0x206963={'count':0x0,'rows':[]};var _0x10669a=_[_0x2ef5('0x35')](db[_0x2ef5('0x36')][_0x2ef5('0x37')],function(_0x19e4af){return{'name':_0x19e4af[_0x2ef5('0x38')],'type':_0x19e4af[_0x2ef5('0x39')]['key']};});_0x23fec5[_0x2ef5('0x3a')]=_[_0x2ef5('0x35')](_0x10669a,_0x2ef5('0x32'));_0x23fec5[_0x2ef5('0x3b')]=_[_0x2ef5('0x3c')](_0x5a2654['query']);_0x23fec5[_0x2ef5('0x3d')]=_[_0x2ef5('0x3e')](_0x23fec5[_0x2ef5('0x3a')],_0x23fec5[_0x2ef5('0x3b')]);_0x528ee3[_0x2ef5('0x3f')]=_[_0x2ef5('0x3e')](_0x23fec5[_0x2ef5('0x3a')],qs[_0x2ef5('0x40')](_0x5a2654[_0x2ef5('0x3b')]['fields']));_0x528ee3[_0x2ef5('0x3f')]=_0x528ee3[_0x2ef5('0x3f')][_0x2ef5('0x41')]?_0x528ee3[_0x2ef5('0x3f')]:_0x23fec5[_0x2ef5('0x3a')];if(!_0x5a2654[_0x2ef5('0x3b')][_0x2ef5('0x42')]('nolimit')){_0x528ee3[_0x2ef5('0x43')]=qs[_0x2ef5('0x43')](_0x5a2654[_0x2ef5('0x3b')][_0x2ef5('0x43')]);_0x528ee3[_0x2ef5('0x28')]=qs[_0x2ef5('0x28')](_0x5a2654[_0x2ef5('0x3b')][_0x2ef5('0x28')]);}_0x528ee3[_0x2ef5('0x44')]=qs[_0x2ef5('0x45')](_0x5a2654['query'][_0x2ef5('0x45')]);_0x528ee3[_0x2ef5('0x46')]=qs[_0x2ef5('0x3d')](_[_0x2ef5('0x47')](_0x5a2654[_0x2ef5('0x3b')],_0x23fec5['filters']),_0x10669a);if(_0x5a2654[_0x2ef5('0x3b')][_0x2ef5('0x48')]){_0x528ee3[_0x2ef5('0x46')]=_['merge'](_0x528ee3[_0x2ef5('0x46')],{'$or':_[_0x2ef5('0x35')](_0x10669a,function(_0x2d2648){if(_0x2d2648[_0x2ef5('0x39')]!=='VIRTUAL'){var _0x550b1c={};_0x550b1c[_0x2d2648[_0x2ef5('0x32')]]={'$like':'%'+_0x5a2654[_0x2ef5('0x3b')][_0x2ef5('0x48')]+'%'};return _0x550b1c;}})});}_0x528ee3=_['merge']({},_0x528ee3,_0x5a2654['options']);var _0x2eed0c={'where':_0x528ee3[_0x2ef5('0x46')]};return db['FaxQueue'][_0x2ef5('0x27')](_0x2eed0c)['then'](function(_0xae359c){_0x206963[_0x2ef5('0x27')]=_0xae359c;if(_0x5a2654[_0x2ef5('0x3b')][_0x2ef5('0x49')]){_0x528ee3[_0x2ef5('0x4a')]=[{'all':!![]}];}return db[_0x2ef5('0x36')][_0x2ef5('0x4b')](_0x528ee3);})[_0x2ef5('0x2f')](function(_0x1e05fe){_0x206963[_0x2ef5('0x4c')]=_0x1e05fe;return _0x206963;})[_0x2ef5('0x2f')](respondWithFilteredResult(_0x41d2ce,_0x528ee3))[_0x2ef5('0x4d')](handleError(_0x41d2ce,null));};exports['show']=function(_0x586224,_0x1d2b7f){var _0x21294f={'raw':!![],'where':{'id':_0x586224[_0x2ef5('0x4e')]['id']}},_0x592e59={};_0x592e59[_0x2ef5('0x3a')]=_[_0x2ef5('0x3c')](db['FaxQueue'][_0x2ef5('0x37')]);_0x592e59[_0x2ef5('0x3b')]=_[_0x2ef5('0x3c')](_0x586224['query']);_0x592e59['filters']=_['intersection'](_0x592e59[_0x2ef5('0x3a')],_0x592e59[_0x2ef5('0x3b')]);_0x21294f[_0x2ef5('0x3f')]=_[_0x2ef5('0x3e')](_0x592e59['model'],qs[_0x2ef5('0x40')](_0x586224['query']['fields']));_0x21294f[_0x2ef5('0x3f')]=_0x21294f[_0x2ef5('0x3f')][_0x2ef5('0x41')]?_0x21294f[_0x2ef5('0x3f')]:_0x592e59[_0x2ef5('0x3a')];if(_0x586224['query']['includeAll']){_0x21294f[_0x2ef5('0x4a')]=[{'all':!![]}];}_0x21294f=_['merge']({},_0x21294f,_0x586224[_0x2ef5('0x4f')]);return db[_0x2ef5('0x36')][_0x2ef5('0x50')](_0x21294f)['then'](handleEntityNotFound(_0x1d2b7f,null))[_0x2ef5('0x2f')](respondWithResult(_0x1d2b7f,null))['catch'](handleError(_0x1d2b7f,null));};exports['create']=function(_0x5d9206,_0x16757e){return db[_0x2ef5('0x36')][_0x2ef5('0x51')](_0x5d9206[_0x2ef5('0x52')],{})[_0x2ef5('0x2f')](function(_0x9cc711){var _0x429015=_0x5d9206[_0x2ef5('0x53')][_0x2ef5('0x54')]({'plain':!![]});if(!_0x429015)throw new Error(_0x2ef5('0x55'));if(_0x429015[_0x2ef5('0x56')]===_0x2ef5('0x53')){var _0x5c008f=_0x9cc711[_0x2ef5('0x54')]({'plain':!![]});var _0x4338d5=_0x2ef5('0x2e');return db[_0x2ef5('0x57')][_0x2ef5('0x50')]({'where':{'name':_0x4338d5,'userProfileId':_0x429015[_0x2ef5('0x58')]},'raw':!![]})[_0x2ef5('0x2f')](function(_0x76a65b){if(_0x76a65b&&_0x76a65b['autoAssociation']===0x0){return db['UserProfileResource'][_0x2ef5('0x51')]({'name':_0x5c008f[_0x2ef5('0x32')],'resourceId':_0x5c008f['id'],'type':_0x76a65b[_0x2ef5('0x32')],'sectionId':_0x76a65b['id']},{})[_0x2ef5('0x2f')](function(){return _0x9cc711;});}else{return _0x9cc711;}})[_0x2ef5('0x4d')](function(_0xcc6bbd){logger[_0x2ef5('0x30')](_0x2ef5('0x59'),_0xcc6bbd);throw _0xcc6bbd;});}return _0x9cc711;})[_0x2ef5('0x2f')](respondWithResult(_0x16757e,0xc9))[_0x2ef5('0x4d')](handleError(_0x16757e,null));};exports[_0x2ef5('0x2c')]=function(_0x3afb29,_0x5cc441){if(_0x3afb29['body']['id']){delete _0x3afb29[_0x2ef5('0x52')]['id'];}return db[_0x2ef5('0x36')][_0x2ef5('0x50')]({'where':{'id':_0x3afb29[_0x2ef5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5cc441,null))[_0x2ef5('0x2f')](saveUpdates(_0x3afb29['body'],null))['then'](respondWithResult(_0x5cc441,null))[_0x2ef5('0x4d')](handleError(_0x5cc441,null));};exports[_0x2ef5('0x2d')]=function(_0x4a5081,_0x2fc88d){return db[_0x2ef5('0x36')][_0x2ef5('0x50')]({'where':{'id':_0x4a5081[_0x2ef5('0x4e')]['id']}})[_0x2ef5('0x2f')](handleEntityNotFound(_0x2fc88d,null))[_0x2ef5('0x2f')](removeEntity(_0x2fc88d,null))[_0x2ef5('0x4d')](handleError(_0x2fc88d,null));};exports['describe']=function(_0x1eb8da,_0x2c0fae){return db[_0x2ef5('0x36')][_0x2ef5('0x5a')]()[_0x2ef5('0x2f')](respondWithResult(_0x2c0fae,null))['catch'](handleError(_0x2c0fae,null));};exports[_0x2ef5('0x5b')]=function(_0x10ec46,_0x4f4742,_0x4b35ef){var _0x4f1d11={'raw':!![],'where':{}},_0x37c0f7={},_0x585d30;return db['FaxQueue']['findOne']({'where':{'id':_0x10ec46[_0x2ef5('0x4e')]['id']}})[_0x2ef5('0x2f')](handleEntityNotFound(_0x4f4742,null))[_0x2ef5('0x2f')](function(_0x3b4ad1){if(_0x3b4ad1){_0x585d30=_0x3b4ad1[_0x2ef5('0x54')]({'plain':!![]});_0x37c0f7['model']=_[_0x2ef5('0x3c')](db[_0x2ef5('0x5c')][_0x2ef5('0x37')]);_0x37c0f7[_0x2ef5('0x3b')]=_[_0x2ef5('0x3c')](_0x10ec46[_0x2ef5('0x3b')]);_0x37c0f7['filters']=_['intersection'](_0x37c0f7[_0x2ef5('0x3a')],_0x37c0f7[_0x2ef5('0x3b')]);_0x4f1d11['attributes']=_[_0x2ef5('0x3e')](_0x37c0f7[_0x2ef5('0x3a')],qs[_0x2ef5('0x40')](_0x10ec46[_0x2ef5('0x3b')][_0x2ef5('0x40')]));_0x4f1d11[_0x2ef5('0x3f')]=_0x4f1d11[_0x2ef5('0x3f')][_0x2ef5('0x41')]?_0x4f1d11['attributes']:_0x37c0f7['model'];if(!_0x10ec46['query'][_0x2ef5('0x42')](_0x2ef5('0x5d'))){_0x4f1d11[_0x2ef5('0x43')]=qs[_0x2ef5('0x43')](_0x10ec46['query'][_0x2ef5('0x43')]);_0x4f1d11[_0x2ef5('0x28')]=qs[_0x2ef5('0x28')](_0x10ec46[_0x2ef5('0x3b')][_0x2ef5('0x28')]);}_0x4f1d11[_0x2ef5('0x44')]=qs['sort'](_0x10ec46[_0x2ef5('0x3b')][_0x2ef5('0x45')]);_0x4f1d11['where']=qs[_0x2ef5('0x3d')](_[_0x2ef5('0x47')](_0x10ec46['query'],_0x37c0f7['filters']));_0x4f1d11[_0x2ef5('0x46')][_0x2ef5('0x5e')]=_0x3b4ad1['id'];if(_0x10ec46[_0x2ef5('0x3b')]['filter']){_0x4f1d11['where']=_['merge'](_0x4f1d11[_0x2ef5('0x46')],{'$or':_[_0x2ef5('0x35')](_0x4f1d11[_0x2ef5('0x3f')],function(_0x63b0f5){var _0x1785a0={};_0x1785a0[_0x63b0f5]={'$like':'%'+_0x10ec46[_0x2ef5('0x3b')][_0x2ef5('0x48')]+'%'};return _0x1785a0;})});}_0x4f1d11=_[_0x2ef5('0x5f')]({},_0x4f1d11,_0x10ec46[_0x2ef5('0x4f')]);return db[_0x2ef5('0x5c')][_0x2ef5('0x4b')](_0x4f1d11);}})[_0x2ef5('0x2f')](function(_0x169dde){if(_0x169dde){return db[_0x2ef5('0x60')][_0x2ef5('0x61')]({'where':{'id':_[_0x2ef5('0x35')](_0x169dde,_0x2ef5('0x62')),'role':'agent'},'attributes':['id',_0x2ef5('0x32'),_0x2ef5('0x63'),_0x2ef5('0x64'),_0x2ef5('0x65')]});}})['then'](function(_0x343a28){if(_0x343a28){return{'count':_0x343a28[_0x2ef5('0x27')],'rows':_[_0x2ef5('0x35')](_0x343a28[_0x2ef5('0x4c')],function(_0x2030cc){return{'membername':_0x2030cc['name'],'UserId':_0x2030cc['id'],'queue_name':_0x585d30[_0x2ef5('0x32')],'FaxQueueId':_0x585d30['id'],'interface':util[_0x2ef5('0x66')](_0x2ef5('0x67'),_0x2ef5('0x68'),_0x2030cc[_0x2ef5('0x32')]),'penalty':0x0,'paused':_0x2030cc['faxPause'],'createdAt':_0x2030cc['createdAt'],'updatedAt':_0x2030cc[_0x2ef5('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2ef5('0x2f')](respondWithFilteredResult(_0x4f4742,_0x4f1d11))['catch'](handleError(_0x4f4742,null));};exports[_0x2ef5('0x69')]=function(_0x25a5d2,_0x204eb8,_0x2a1cbc){var _0x880c6d={};var _0x35bbf4={};var _0x4af76b;var _0x54e570;return db[_0x2ef5('0x36')][_0x2ef5('0x6a')]({'where':{'id':_0x25a5d2[_0x2ef5('0x4e')]['id']}})[_0x2ef5('0x2f')](handleEntityNotFound(_0x204eb8,null))[_0x2ef5('0x2f')](function(_0x2bd48b){if(_0x2bd48b){_0x4af76b=_0x2bd48b;_0x35bbf4[_0x2ef5('0x3a')]=_[_0x2ef5('0x3c')](db[_0x2ef5('0x6b')][_0x2ef5('0x37')]);_0x35bbf4[_0x2ef5('0x3b')]=_[_0x2ef5('0x3c')](_0x25a5d2['query']);_0x35bbf4[_0x2ef5('0x3d')]=_[_0x2ef5('0x3e')](_0x35bbf4[_0x2ef5('0x3a')],_0x35bbf4[_0x2ef5('0x3b')]);_0x880c6d[_0x2ef5('0x3f')]=_[_0x2ef5('0x3e')](_0x35bbf4[_0x2ef5('0x3a')],qs[_0x2ef5('0x40')](_0x25a5d2[_0x2ef5('0x3b')][_0x2ef5('0x40')]));_0x880c6d[_0x2ef5('0x3f')]=_0x880c6d[_0x2ef5('0x3f')]['length']?_0x880c6d['attributes']:_0x35bbf4['model'];_0x880c6d[_0x2ef5('0x44')]=qs[_0x2ef5('0x45')](_0x25a5d2['query'][_0x2ef5('0x45')]);_0x880c6d[_0x2ef5('0x46')]=qs[_0x2ef5('0x3d')](_[_0x2ef5('0x47')](_0x25a5d2['query'],_0x35bbf4[_0x2ef5('0x3d')]));if(_0x25a5d2[_0x2ef5('0x3b')][_0x2ef5('0x48')]){_0x880c6d[_0x2ef5('0x46')]=_[_0x2ef5('0x5f')](_0x880c6d[_0x2ef5('0x46')],{'$or':_[_0x2ef5('0x35')](_0x880c6d[_0x2ef5('0x3f')],function(_0x4ff752){var _0x12c622={};_0x12c622[_0x4ff752]={'$like':'%'+_0x25a5d2[_0x2ef5('0x3b')][_0x2ef5('0x48')]+'%'};return _0x12c622;})});}_0x880c6d=_[_0x2ef5('0x5f')]({},_0x880c6d,_0x25a5d2[_0x2ef5('0x4f')]);return _0x4af76b[_0x2ef5('0x69')](_0x880c6d);}})[_0x2ef5('0x2f')](function(_0x3225ae){if(_0x3225ae){_0x54e570=_0x3225ae[_0x2ef5('0x41')];if(!_0x25a5d2[_0x2ef5('0x3b')][_0x2ef5('0x42')](_0x2ef5('0x5d'))){_0x880c6d[_0x2ef5('0x43')]=qs[_0x2ef5('0x43')](_0x25a5d2[_0x2ef5('0x3b')][_0x2ef5('0x43')]);_0x880c6d[_0x2ef5('0x28')]=qs[_0x2ef5('0x28')](_0x25a5d2['query']['offset']);}return _0x4af76b[_0x2ef5('0x69')](_0x880c6d);}})['then'](function(_0x15f8d6){if(_0x15f8d6){return _0x15f8d6?{'count':_0x54e570,'rows':_0x15f8d6}:null;}})[_0x2ef5('0x2f')](respondWithResult(_0x204eb8,null))[_0x2ef5('0x4d')](handleError(_0x204eb8,null));};exports['addTeams']=function(_0x1e9d82,_0x6016a4,_0x264aad){var _0x2c10b6=_0x1e9d82[_0x2ef5('0x52')]['ids'];return db[_0x2ef5('0x6b')][_0x2ef5('0x4b')]({'where':{'id':_0x2c10b6},'attributes':['id'],'include':[{'model':db[_0x2ef5('0x60')],'as':'Agents','attributes':['id',_0x2ef5('0x32'),_0x2ef5('0x6c'),'voicePause',_0x2ef5('0x6d')],'raw':!![]}]})['then'](function(_0x245912){if(_0x245912){var _0x436d8e=_[_0x2ef5('0x6e')](_0x245912,function(_0x13cde6){var _0x3cf58e=_0x13cde6[_0x2ef5('0x54')]({'plain':!![]});return _0x3cf58e['Agents'];});return db[_0x2ef5('0x36')][_0x2ef5('0x50')]({'where':{'id':_0x1e9d82['params']['id']}})[_0x2ef5('0x2f')](function(_0xe45bb2){return db[_0x2ef5('0x6f')][_0x2ef5('0x70')](function(_0x497579){return _0xe45bb2[_0x2ef5('0x71')](_0x2c10b6,{'transaction':_0x497579})[_0x2ef5('0x2f')](function(){return BPromise[_0x2ef5('0x72')](_0x436d8e,function(_0x36e94e){return db[_0x2ef5('0x5c')][_0x2ef5('0x73')]({'where':{'UserId':_0x36e94e['id'],'FaxQueueId':_0x1e9d82[_0x2ef5('0x4e')]['id']},'transaction':_0x497579});});})[_0x2ef5('0x2f')](function(){_0x436d8e[_0x2ef5('0x74')](function(_0x44ab18){socket[_0x2ef5('0x75')](_0x2ef5('0x76'),{'UserId':_0x44ab18['id'],'FaxQueueId':_0xe45bb2['id']});});});});});}})[_0x2ef5('0x2f')](respondWithStatusCode(_0x6016a4,null))['catch'](handleError(_0x6016a4,null));};exports[_0x2ef5('0x77')]=function(_0x4b5c09,_0x25665b,_0x47dd7f){return db['Team'][_0x2ef5('0x4b')]({'where':{'id':_0x4b5c09[_0x2ef5('0x3b')][_0x2ef5('0x78')]},'attributes':['id'],'include':[{'model':db[_0x2ef5('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2ef5('0x2f')](handleEntityNotFound(_0x25665b,null))[_0x2ef5('0x2f')](function(_0x4f284e){var _0x1c766e=_['map'](_0x4f284e,'id');var _0x3ccb83=[];var _0x491cc9=[];var _0xcd9567=squel[_0x2ef5('0x79')]();_0xcd9567[_0x2ef5('0x7a')](_0x2ef5('0x7b'))['from']('team_has_fax_queues','tq')[_0x2ef5('0x7c')](_0x2ef5('0x7d'),'ut',_0x2ef5('0x7e'))['where']('FaxQueueId\x20=\x20?',_0x4b5c09['params']['id']);for(var _0x1d173f=0x0;_0x1d173f<_0x4f284e['length'];_0x1d173f+=0x1){let _0x27b724=_0x4f284e[_0x1d173f];for(var _0x49fd6c=0x0;_0x49fd6c<_0x27b724[_0x2ef5('0x7f')][_0x2ef5('0x41')];_0x49fd6c+=0x1){let _0x2b134d=_0x27b724[_0x2ef5('0x7f')][_0x49fd6c];var _0x5b49c8=_0xcd9567[_0x2ef5('0x80')]();_0x5b49c8['where'](_0x2ef5('0x81'),_0x2b134d['id']);_0x491cc9[_0x2ef5('0x82')](db[_0x2ef5('0x6f')][_0x2ef5('0x3b')](_0x5b49c8[_0x2ef5('0x83')](),{'type':db[_0x2ef5('0x6f')]['QueryTypes']['SELECT']})['then'](function(_0x2e9a81){if(_0x2e9a81['length']===0x1){return _0x2b134d['id'];}else{var _0x4929cc=_[_0x2ef5('0x84')](_[_0x2ef5('0x35')](_0x2e9a81,_0x2ef5('0x85')),function(_0x7da6ba){return _['includes'](_0x1c766e,_0x7da6ba);});if(_0x4929cc){return _0x2b134d['id'];}}}));}}return BPromise['all'](_0x491cc9)[_0x2ef5('0x2f')](function(_0x462cd4){_0x3ccb83=_(_0x3ccb83)[_0x2ef5('0x86')](_0x462cd4)[_0x2ef5('0x87')]()['value']();return db[_0x2ef5('0x36')][_0x2ef5('0x50')]({'where':{'id':_0x4b5c09[_0x2ef5('0x4e')]['id']}})[_0x2ef5('0x2f')](function(_0x8ca522){return db[_0x2ef5('0x6f')][_0x2ef5('0x70')](function(_0x290681){return _0x8ca522['removeTeams'](_0x4b5c09[_0x2ef5('0x3b')][_0x2ef5('0x78')],{'transaction':_0x290681})['then'](function(){if(!_['isEmpty'](_0x3ccb83)){return _0x8ca522[_0x2ef5('0x88')](_0x3ccb83,{'transaction':_0x290681});}})[_0x2ef5('0x2f')](function(){_0x3ccb83['forEach'](function(_0x118ceb){socket[_0x2ef5('0x75')](_0x2ef5('0x89'),{'UserId':_0x118ceb,'FaxQueueId':_0x8ca522['id']});});});});});});})['then'](respondWithStatusCode(_0x25665b,null))[_0x2ef5('0x4d')](handleError(_0x25665b,null));};exports['addAgents']=function(_0x4f007d,_0x249479,_0x51a248){return db[_0x2ef5('0x36')][_0x2ef5('0x50')]({'where':{'id':_0x4f007d[_0x2ef5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x249479,null))[_0x2ef5('0x2f')](function(_0x40fc19){if(_0x40fc19){return _0x40fc19[_0x2ef5('0x8a')](_0x4f007d['body'][_0x2ef5('0x78')],_[_0x2ef5('0x8b')](_0x4f007d[_0x2ef5('0x52')],['ids','id'])||{})[_0x2ef5('0x8c')](function(_0x53c39e){for(var _0x4665f9=0x0;_0x4665f9<_0x4f007d[_0x2ef5('0x52')][_0x2ef5('0x78')][_0x2ef5('0x41')];_0x4665f9+=0x1){socket[_0x2ef5('0x75')](_0x2ef5('0x76'),{'UserId':Number(_0x4f007d['body'][_0x2ef5('0x78')][_0x4665f9]),'FaxQueueId':Number(_0x4f007d[_0x2ef5('0x4e')]['id'])});}return _0x53c39e;});}})['then'](respondWithResult(_0x249479,null))['catch'](handleError(_0x249479,null));};exports[_0x2ef5('0x88')]=function(_0x3b01f7,_0x5774b4,_0x3195f7){return db[_0x2ef5('0x36')][_0x2ef5('0x50')]({'where':{'id':_0x3b01f7[_0x2ef5('0x4e')]['id']}})[_0x2ef5('0x2f')](handleEntityNotFound(_0x5774b4,null))[_0x2ef5('0x2f')](function(_0x2a5148){if(_0x2a5148){return _0x2a5148[_0x2ef5('0x88')](_0x3b01f7[_0x2ef5('0x3b')][_0x2ef5('0x78')])['then'](function(){if(_[_0x2ef5('0x8d')](_0x3b01f7[_0x2ef5('0x3b')][_0x2ef5('0x78')])){for(var _0x24f2fe=0x0;_0x24f2fe<_0x3b01f7['query'][_0x2ef5('0x78')]['length'];_0x24f2fe+=0x1){socket['emit'](_0x2ef5('0x89'),{'UserId':Number(_0x3b01f7[_0x2ef5('0x3b')]['ids'][_0x24f2fe]),'FaxQueueId':Number(_0x3b01f7[_0x2ef5('0x4e')]['id'])});}}else{socket['emit'](_0x2ef5('0x89'),{'UserId':Number(_0x3b01f7[_0x2ef5('0x3b')][_0x2ef5('0x78')]),'FaxQueueId':Number(_0x3b01f7[_0x2ef5('0x4e')]['id'])});}});}})[_0x2ef5('0x2f')](respondWithStatusCode(_0x5774b4,null))[_0x2ef5('0x4d')](handleError(_0x5774b4,null));};exports['getAgents']=function(_0x2708d9,_0x1b047b,_0x1804bc){var _0xee9a61={};var _0x140736={};var _0x4e0085;var _0x491151;return db[_0x2ef5('0x36')][_0x2ef5('0x6a')]({'where':{'id':_0x2708d9['params']['id']}})[_0x2ef5('0x2f')](handleEntityNotFound(_0x1b047b,null))[_0x2ef5('0x2f')](function(_0x3904c1){if(_0x3904c1){_0x4e0085=_0x3904c1;_0x140736[_0x2ef5('0x3a')]=_['keys'](db[_0x2ef5('0x60')][_0x2ef5('0x37')]);_0x140736[_0x2ef5('0x3b')]=_[_0x2ef5('0x3c')](_0x2708d9[_0x2ef5('0x3b')]);_0x140736[_0x2ef5('0x3d')]=_[_0x2ef5('0x3e')](_0x140736[_0x2ef5('0x3a')],_0x140736['query']);_0xee9a61['attributes']=_[_0x2ef5('0x3e')](_0x140736[_0x2ef5('0x3a')],qs[_0x2ef5('0x40')](_0x2708d9[_0x2ef5('0x3b')][_0x2ef5('0x40')]));_0xee9a61[_0x2ef5('0x3f')]=_0xee9a61[_0x2ef5('0x3f')][_0x2ef5('0x41')]?_0xee9a61['attributes']:_0x140736['model'];_0xee9a61[_0x2ef5('0x44')]=qs[_0x2ef5('0x45')](_0x2708d9[_0x2ef5('0x3b')][_0x2ef5('0x45')]);_0xee9a61[_0x2ef5('0x46')]=qs[_0x2ef5('0x3d')](_[_0x2ef5('0x47')](_0x2708d9[_0x2ef5('0x3b')],_0x140736[_0x2ef5('0x3d')]));if(_0x2708d9[_0x2ef5('0x3b')]['filter']){_0xee9a61['where']=_[_0x2ef5('0x5f')](_0xee9a61[_0x2ef5('0x46')],{'$or':_[_0x2ef5('0x35')](_0xee9a61[_0x2ef5('0x3f')],function(_0x30decc){var _0x7eb288={};_0x7eb288[_0x30decc]={'$like':'%'+_0x2708d9[_0x2ef5('0x3b')][_0x2ef5('0x48')]+'%'};return _0x7eb288;})});}_0xee9a61=_['merge']({},_0xee9a61,_0x2708d9['options']);return _0x4e0085[_0x2ef5('0x8e')](_0xee9a61);}})[_0x2ef5('0x2f')](function(_0x61be1f){if(_0x61be1f){_0x491151=_0x61be1f[_0x2ef5('0x41')];if(!_0x2708d9[_0x2ef5('0x3b')][_0x2ef5('0x42')](_0x2ef5('0x5d'))){_0xee9a61['limit']=qs[_0x2ef5('0x43')](_0x2708d9[_0x2ef5('0x3b')][_0x2ef5('0x43')]);_0xee9a61[_0x2ef5('0x28')]=qs[_0x2ef5('0x28')](_0x2708d9['query'][_0x2ef5('0x28')]);}return _0x4e0085[_0x2ef5('0x8e')](_0xee9a61);}})[_0x2ef5('0x2f')](function(_0x5a1d8f){if(_0x5a1d8f){return _0x5a1d8f?{'count':_0x491151,'rows':_0x5a1d8f}:null;}})[_0x2ef5('0x2f')](respondWithResult(_0x1b047b,null))[_0x2ef5('0x4d')](handleError(_0x1b047b,null));}; \ No newline at end of file +var _0x6106=['getTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','forEach','emit','removeTeams','select','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxQueue.socket','register','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','find','create','body','user','role','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','pick','UserFaxQueue','findAll','User','findAndCountAll','faxPause','updatedAt','%s/%s','SIP','createdAt'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6106,0x19a));var _0x6610=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x6106[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x6610('0x0'));var rimraf=require(_0x6610('0x1'));var zipdir=require(_0x6610('0x2'));var jsonpatch=require(_0x6610('0x3'));var rp=require(_0x6610('0x4'));var moment=require(_0x6610('0x5'));var BPromise=require(_0x6610('0x6'));var Mustache=require('mustache');var util=require(_0x6610('0x7'));var path=require(_0x6610('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6610('0x9'));var _=require(_0x6610('0xa'));var squel=require('squel');var crypto=require(_0x6610('0xb'));var jsforce=require(_0x6610('0xc'));var deskjs=require(_0x6610('0xd'));var toCsv=require(_0x6610('0xe'));var querystring=require(_0x6610('0xf'));var Papa=require('papaparse');var Redis=require(_0x6610('0x10'));var authService=require(_0x6610('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6610('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6610('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6610('0x14'));var db=require(_0x6610('0x15'))['db'];config['redis']=_[_0x6610('0x16')](config[_0x6610('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6610('0x18'))(new Redis(config[_0x6610('0x17')]));require(_0x6610('0x19'))[_0x6610('0x1a')](socket);function respondWithStatusCode(_0x271f09,_0x3a4341){_0x3a4341=_0x3a4341||0xcc;return function(_0x2d9b4b){if(_0x2d9b4b){return _0x271f09['sendStatus'](_0x3a4341);}return _0x271f09['status'](_0x3a4341)[_0x6610('0x1b')]();};}function respondWithResult(_0x21dd20,_0x4713ce){_0x4713ce=_0x4713ce||0xc8;return function(_0x3c9fa6){if(_0x3c9fa6){return _0x21dd20[_0x6610('0x1c')](_0x4713ce)['json'](_0x3c9fa6);}};}function respondWithFilteredResult(_0x5eae38,_0x1170b1){return function(_0x3309b3){if(_0x3309b3){var _0x17fcf3=typeof _0x1170b1[_0x6610('0x1d')]===_0x6610('0x1e')&&typeof _0x1170b1[_0x6610('0x1f')]===_0x6610('0x1e');var _0x5a6652=_0x3309b3['count'];var _0x29baf9=_0x17fcf3?0x0:_0x1170b1[_0x6610('0x1d')];var _0x16480e=_0x17fcf3?_0x3309b3['count']:_0x1170b1[_0x6610('0x1d')]+_0x1170b1[_0x6610('0x1f')];var _0x24d58a;if(_0x16480e>=_0x5a6652){_0x16480e=_0x5a6652;_0x24d58a=0xc8;}else{_0x24d58a=0xce;}_0x5eae38[_0x6610('0x1c')](_0x24d58a);return _0x5eae38[_0x6610('0x20')](_0x6610('0x21'),_0x29baf9+'-'+_0x16480e+'/'+_0x5a6652)['json'](_0x3309b3);}return null;};}function patchUpdates(_0x3e554f){return function(_0x30201d){try{jsonpatch[_0x6610('0x22')](_0x30201d,_0x3e554f,!![]);}catch(_0x1bee0f){return BPromise[_0x6610('0x23')](_0x1bee0f);}return _0x30201d[_0x6610('0x24')]();};}function saveUpdates(_0x20e38d,_0x19c20d){return function(_0x34feed){if(_0x34feed){return _0x34feed[_0x6610('0x25')](_0x20e38d)[_0x6610('0x26')](function(_0x24e756){return _0x24e756;});}return null;};}function removeEntity(_0x240aef,_0x19c063){return function(_0x1a0278){if(_0x1a0278){return _0x1a0278[_0x6610('0x27')]()[_0x6610('0x26')](function(){var _0x5efcda=_0x1a0278[_0x6610('0x28')]({'plain':!![]});var _0x5e899a='FaxQueues';return db[_0x6610('0x29')][_0x6610('0x27')]({'where':{'type':_0x5e899a,'resourceId':_0x5efcda['id']}})[_0x6610('0x26')](function(){return _0x1a0278;});})['then'](function(){_0x240aef[_0x6610('0x1c')](0xcc)[_0x6610('0x1b')]();});}};}function handleEntityNotFound(_0x549a5d,_0x2755e4){return function(_0x1c8b31){if(!_0x1c8b31){_0x549a5d['sendStatus'](0x194);}return _0x1c8b31;};}function handleError(_0x25269e,_0x53ce59){_0x53ce59=_0x53ce59||0x1f4;return function(_0x10d7b9){logger['error'](_0x10d7b9[_0x6610('0x2a')]);if(_0x10d7b9[_0x6610('0x2b')]){delete _0x10d7b9[_0x6610('0x2b')];}_0x25269e[_0x6610('0x1c')](_0x53ce59)[_0x6610('0x2c')](_0x10d7b9);};}exports[_0x6610('0x2d')]=function(_0x46c0e7,_0xa13265){var _0x1c0511={},_0x51aad6={},_0x2fa533={'count':0x0,'rows':[]};var _0x393266=_['map'](db[_0x6610('0x2e')][_0x6610('0x2f')],function(_0x214755){return{'name':_0x214755[_0x6610('0x30')],'type':_0x214755[_0x6610('0x31')]['key']};});_0x51aad6['model']=_['map'](_0x393266,'name');_0x51aad6[_0x6610('0x32')]=_['keys'](_0x46c0e7[_0x6610('0x32')]);_0x51aad6[_0x6610('0x33')]=_['intersection'](_0x51aad6[_0x6610('0x34')],_0x51aad6['query']);_0x1c0511[_0x6610('0x35')]=_[_0x6610('0x36')](_0x51aad6[_0x6610('0x34')],qs[_0x6610('0x37')](_0x46c0e7[_0x6610('0x32')][_0x6610('0x37')]));_0x1c0511[_0x6610('0x35')]=_0x1c0511['attributes'][_0x6610('0x38')]?_0x1c0511[_0x6610('0x35')]:_0x51aad6[_0x6610('0x34')];if(!_0x46c0e7[_0x6610('0x32')][_0x6610('0x39')](_0x6610('0x3a'))){_0x1c0511['limit']=qs[_0x6610('0x1f')](_0x46c0e7[_0x6610('0x32')][_0x6610('0x1f')]);_0x1c0511[_0x6610('0x1d')]=qs[_0x6610('0x1d')](_0x46c0e7['query'][_0x6610('0x1d')]);}_0x1c0511[_0x6610('0x3b')]=qs[_0x6610('0x3c')](_0x46c0e7[_0x6610('0x32')][_0x6610('0x3c')]);_0x1c0511['where']=qs[_0x6610('0x33')](_['pick'](_0x46c0e7['query'],_0x51aad6[_0x6610('0x33')]),_0x393266);if(_0x46c0e7['query'][_0x6610('0x3d')]){_0x1c0511[_0x6610('0x3e')]=_[_0x6610('0x3f')](_0x1c0511[_0x6610('0x3e')],{'$or':_[_0x6610('0x40')](_0x393266,function(_0x16c028){if(_0x16c028[_0x6610('0x31')]!==_0x6610('0x41')){var _0x4b1a73={};_0x4b1a73[_0x16c028[_0x6610('0x2b')]]={'$like':'%'+_0x46c0e7['query'][_0x6610('0x3d')]+'%'};return _0x4b1a73;}})});}_0x1c0511=_[_0x6610('0x3f')]({},_0x1c0511,_0x46c0e7[_0x6610('0x42')]);var _0xfffd22={'where':_0x1c0511[_0x6610('0x3e')]};return db['FaxQueue'][_0x6610('0x43')](_0xfffd22)[_0x6610('0x26')](function(_0x346874){_0x2fa533[_0x6610('0x43')]=_0x346874;if(_0x46c0e7[_0x6610('0x32')][_0x6610('0x44')]){_0x1c0511[_0x6610('0x45')]=[{'all':!![]}];}return db[_0x6610('0x2e')]['findAll'](_0x1c0511);})['then'](function(_0x51e8df){_0x2fa533[_0x6610('0x46')]=_0x51e8df;return _0x2fa533;})['then'](respondWithFilteredResult(_0xa13265,_0x1c0511))['catch'](handleError(_0xa13265,null));};exports[_0x6610('0x47')]=function(_0x73bcbd,_0xb7b03b){var _0x3280f4={'raw':!![],'where':{'id':_0x73bcbd[_0x6610('0x48')]['id']}},_0x2501e0={};_0x2501e0[_0x6610('0x34')]=_[_0x6610('0x49')](db['FaxQueue'][_0x6610('0x2f')]);_0x2501e0[_0x6610('0x32')]=_[_0x6610('0x49')](_0x73bcbd[_0x6610('0x32')]);_0x2501e0[_0x6610('0x33')]=_['intersection'](_0x2501e0[_0x6610('0x34')],_0x2501e0[_0x6610('0x32')]);_0x3280f4[_0x6610('0x35')]=_['intersection'](_0x2501e0['model'],qs[_0x6610('0x37')](_0x73bcbd['query']['fields']));_0x3280f4[_0x6610('0x35')]=_0x3280f4['attributes']['length']?_0x3280f4[_0x6610('0x35')]:_0x2501e0[_0x6610('0x34')];if(_0x73bcbd[_0x6610('0x32')][_0x6610('0x44')]){_0x3280f4[_0x6610('0x45')]=[{'all':!![]}];}_0x3280f4=_[_0x6610('0x3f')]({},_0x3280f4,_0x73bcbd[_0x6610('0x42')]);return db[_0x6610('0x2e')][_0x6610('0x4a')](_0x3280f4)[_0x6610('0x26')](handleEntityNotFound(_0xb7b03b,null))[_0x6610('0x26')](respondWithResult(_0xb7b03b,null))['catch'](handleError(_0xb7b03b,null));};exports[_0x6610('0x4b')]=function(_0x37e543,_0x5c99b7){return db[_0x6610('0x2e')]['create'](_0x37e543[_0x6610('0x4c')],{})[_0x6610('0x26')](function(_0x454851){var _0x35dd21=_0x37e543[_0x6610('0x4d')]['get']({'plain':!![]});if(!_0x35dd21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35dd21[_0x6610('0x4e')]===_0x6610('0x4d')){var _0x1a1032=_0x454851[_0x6610('0x28')]({'plain':!![]});var _0x53210a='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x53210a,'userProfileId':_0x35dd21['userProfileId']},'raw':!![]})[_0x6610('0x26')](function(_0x2c56e7){if(_0x2c56e7&&_0x2c56e7['autoAssociation']===0x0){return db[_0x6610('0x29')][_0x6610('0x4b')]({'name':_0x1a1032[_0x6610('0x2b')],'resourceId':_0x1a1032['id'],'type':_0x2c56e7[_0x6610('0x2b')],'sectionId':_0x2c56e7['id']},{})[_0x6610('0x26')](function(){return _0x454851;});}else{return _0x454851;}})[_0x6610('0x4f')](function(_0x2cbd28){logger['error'](_0x6610('0x50'),_0x2cbd28);throw _0x2cbd28;});}return _0x454851;})[_0x6610('0x26')](respondWithResult(_0x5c99b7,0xc9))[_0x6610('0x4f')](handleError(_0x5c99b7,null));};exports[_0x6610('0x25')]=function(_0x1e40a9,_0x284690){if(_0x1e40a9[_0x6610('0x4c')]['id']){delete _0x1e40a9[_0x6610('0x4c')]['id'];}return db[_0x6610('0x2e')][_0x6610('0x4a')]({'where':{'id':_0x1e40a9[_0x6610('0x48')]['id']}})[_0x6610('0x26')](handleEntityNotFound(_0x284690,null))[_0x6610('0x26')](saveUpdates(_0x1e40a9[_0x6610('0x4c')],null))[_0x6610('0x26')](respondWithResult(_0x284690,null))['catch'](handleError(_0x284690,null));};exports['destroy']=function(_0x3de82d,_0x5e1bde){return db[_0x6610('0x2e')][_0x6610('0x4a')]({'where':{'id':_0x3de82d[_0x6610('0x48')]['id']}})[_0x6610('0x26')](handleEntityNotFound(_0x5e1bde,null))['then'](removeEntity(_0x5e1bde,null))[_0x6610('0x4f')](handleError(_0x5e1bde,null));};exports[_0x6610('0x51')]=function(_0x19030f,_0x47e500){return db[_0x6610('0x2e')][_0x6610('0x51')]()['then'](respondWithResult(_0x47e500,null))[_0x6610('0x4f')](handleError(_0x47e500,null));};exports[_0x6610('0x52')]=function(_0x2984c8,_0x5d6526,_0x35b033){var _0x4f9a80={'raw':!![],'where':{}},_0x55b819={},_0x5c3f8b;return db['FaxQueue'][_0x6610('0x53')]({'where':{'id':_0x2984c8[_0x6610('0x48')]['id']}})[_0x6610('0x26')](handleEntityNotFound(_0x5d6526,null))[_0x6610('0x26')](function(_0x2f3209){if(_0x2f3209){_0x5c3f8b=_0x2f3209[_0x6610('0x28')]({'plain':!![]});_0x55b819[_0x6610('0x34')]=_[_0x6610('0x49')](db['UserFaxQueue'][_0x6610('0x2f')]);_0x55b819['query']=_['keys'](_0x2984c8[_0x6610('0x32')]);_0x55b819['filters']=_[_0x6610('0x36')](_0x55b819[_0x6610('0x34')],_0x55b819[_0x6610('0x32')]);_0x4f9a80['attributes']=_[_0x6610('0x36')](_0x55b819[_0x6610('0x34')],qs[_0x6610('0x37')](_0x2984c8[_0x6610('0x32')][_0x6610('0x37')]));_0x4f9a80[_0x6610('0x35')]=_0x4f9a80[_0x6610('0x35')][_0x6610('0x38')]?_0x4f9a80[_0x6610('0x35')]:_0x55b819[_0x6610('0x34')];if(!_0x2984c8['query']['hasOwnProperty']('nolimit')){_0x4f9a80[_0x6610('0x1f')]=qs[_0x6610('0x1f')](_0x2984c8[_0x6610('0x32')][_0x6610('0x1f')]);_0x4f9a80[_0x6610('0x1d')]=qs[_0x6610('0x1d')](_0x2984c8[_0x6610('0x32')]['offset']);}_0x4f9a80[_0x6610('0x3b')]=qs['sort'](_0x2984c8[_0x6610('0x32')][_0x6610('0x3c')]);_0x4f9a80[_0x6610('0x3e')]=qs[_0x6610('0x33')](_[_0x6610('0x54')](_0x2984c8[_0x6610('0x32')],_0x55b819[_0x6610('0x33')]));_0x4f9a80[_0x6610('0x3e')]['FaxQueueId']=_0x2f3209['id'];if(_0x2984c8[_0x6610('0x32')][_0x6610('0x3d')]){_0x4f9a80[_0x6610('0x3e')]=_[_0x6610('0x3f')](_0x4f9a80['where'],{'$or':_[_0x6610('0x40')](_0x4f9a80[_0x6610('0x35')],function(_0x4c84d3){var _0x44878c={};_0x44878c[_0x4c84d3]={'$like':'%'+_0x2984c8[_0x6610('0x32')][_0x6610('0x3d')]+'%'};return _0x44878c;})});}_0x4f9a80=_[_0x6610('0x3f')]({},_0x4f9a80,_0x2984c8[_0x6610('0x42')]);return db[_0x6610('0x55')][_0x6610('0x56')](_0x4f9a80);}})[_0x6610('0x26')](function(_0x4cddb2){if(_0x4cddb2){return db[_0x6610('0x57')][_0x6610('0x58')]({'where':{'id':_['map'](_0x4cddb2,'UserId'),'role':'agent'},'attributes':['id','name',_0x6610('0x59'),_0x6610('0x5a'),'createdAt']});}})[_0x6610('0x26')](function(_0xada5f8){if(_0xada5f8){return{'count':_0xada5f8[_0x6610('0x43')],'rows':_[_0x6610('0x40')](_0xada5f8[_0x6610('0x46')],function(_0x3baceb){return{'membername':_0x3baceb[_0x6610('0x2b')],'UserId':_0x3baceb['id'],'queue_name':_0x5c3f8b[_0x6610('0x2b')],'FaxQueueId':_0x5c3f8b['id'],'interface':util['format'](_0x6610('0x5b'),_0x6610('0x5c'),_0x3baceb[_0x6610('0x2b')]),'penalty':0x0,'paused':_0x3baceb[_0x6610('0x59')],'createdAt':_0x3baceb[_0x6610('0x5d')],'updatedAt':_0x3baceb[_0x6610('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6610('0x26')](respondWithFilteredResult(_0x5d6526,_0x4f9a80))[_0x6610('0x4f')](handleError(_0x5d6526,null));};exports[_0x6610('0x5e')]=function(_0x2b01d2,_0x3ea24b,_0x198aa0){var _0x3d01ce={};var _0x31513b={};var _0x35e6e0;var _0x3ebcb2;return db[_0x6610('0x2e')]['findOne']({'where':{'id':_0x2b01d2['params']['id']}})[_0x6610('0x26')](handleEntityNotFound(_0x3ea24b,null))[_0x6610('0x26')](function(_0x2756a4){if(_0x2756a4){_0x35e6e0=_0x2756a4;_0x31513b[_0x6610('0x34')]=_['keys'](db['Team']['rawAttributes']);_0x31513b[_0x6610('0x32')]=_[_0x6610('0x49')](_0x2b01d2[_0x6610('0x32')]);_0x31513b[_0x6610('0x33')]=_[_0x6610('0x36')](_0x31513b[_0x6610('0x34')],_0x31513b[_0x6610('0x32')]);_0x3d01ce[_0x6610('0x35')]=_['intersection'](_0x31513b[_0x6610('0x34')],qs[_0x6610('0x37')](_0x2b01d2[_0x6610('0x32')][_0x6610('0x37')]));_0x3d01ce[_0x6610('0x35')]=_0x3d01ce['attributes'][_0x6610('0x38')]?_0x3d01ce[_0x6610('0x35')]:_0x31513b[_0x6610('0x34')];_0x3d01ce['order']=qs[_0x6610('0x3c')](_0x2b01d2[_0x6610('0x32')][_0x6610('0x3c')]);_0x3d01ce[_0x6610('0x3e')]=qs[_0x6610('0x33')](_[_0x6610('0x54')](_0x2b01d2[_0x6610('0x32')],_0x31513b['filters']));if(_0x2b01d2[_0x6610('0x32')][_0x6610('0x3d')]){_0x3d01ce[_0x6610('0x3e')]=_[_0x6610('0x3f')](_0x3d01ce[_0x6610('0x3e')],{'$or':_[_0x6610('0x40')](_0x3d01ce[_0x6610('0x35')],function(_0x4ec145){var _0x3b8d3b={};_0x3b8d3b[_0x4ec145]={'$like':'%'+_0x2b01d2[_0x6610('0x32')][_0x6610('0x3d')]+'%'};return _0x3b8d3b;})});}_0x3d01ce=_[_0x6610('0x3f')]({},_0x3d01ce,_0x2b01d2[_0x6610('0x42')]);return _0x35e6e0[_0x6610('0x5e')](_0x3d01ce);}})[_0x6610('0x26')](function(_0x3a7462){if(_0x3a7462){_0x3ebcb2=_0x3a7462[_0x6610('0x38')];if(!_0x2b01d2['query'][_0x6610('0x39')](_0x6610('0x3a'))){_0x3d01ce[_0x6610('0x1f')]=qs[_0x6610('0x1f')](_0x2b01d2[_0x6610('0x32')]['limit']);_0x3d01ce[_0x6610('0x1d')]=qs[_0x6610('0x1d')](_0x2b01d2['query'][_0x6610('0x1d')]);}return _0x35e6e0[_0x6610('0x5e')](_0x3d01ce);}})[_0x6610('0x26')](function(_0x1c8beb){if(_0x1c8beb){return _0x1c8beb?{'count':_0x3ebcb2,'rows':_0x1c8beb}:null;}})[_0x6610('0x26')](respondWithResult(_0x3ea24b,null))[_0x6610('0x4f')](handleError(_0x3ea24b,null));};exports['addTeams']=function(_0x24955e,_0x30433e,_0xd359d){var _0x448edf=_0x24955e[_0x6610('0x4c')][_0x6610('0x5f')];return db[_0x6610('0x60')]['findAll']({'where':{'id':_0x448edf},'attributes':['id'],'include':[{'model':db[_0x6610('0x57')],'as':_0x6610('0x61'),'attributes':['id','name',_0x6610('0x62'),_0x6610('0x63'),_0x6610('0x64')],'raw':!![]}]})['then'](function(_0x190f4d){if(_0x190f4d){var _0x19c09e=_['flatMap'](_0x190f4d,function(_0x2e25d7){var _0x2e9348=_0x2e25d7['get']({'plain':!![]});return _0x2e9348[_0x6610('0x61')];});return db[_0x6610('0x2e')][_0x6610('0x4a')]({'where':{'id':_0x24955e[_0x6610('0x48')]['id']}})[_0x6610('0x26')](function(_0x4d8e59){return db[_0x6610('0x65')][_0x6610('0x66')](function(_0x2814ce){return _0x4d8e59[_0x6610('0x67')](_0x448edf,{'transaction':_0x2814ce})[_0x6610('0x26')](function(){return BPromise[_0x6610('0x68')](_0x19c09e,function(_0x1fb60c){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x1fb60c['id'],'FaxQueueId':_0x24955e[_0x6610('0x48')]['id']},'transaction':_0x2814ce});});})[_0x6610('0x26')](function(){_0x19c09e[_0x6610('0x69')](function(_0x1a1500){socket[_0x6610('0x6a')]('userFaxQueue:save',{'UserId':_0x1a1500['id'],'FaxQueueId':_0x4d8e59['id']});});});});});}})[_0x6610('0x26')](respondWithStatusCode(_0x30433e,null))[_0x6610('0x4f')](handleError(_0x30433e,null));};exports[_0x6610('0x6b')]=function(_0x47fbfa,_0x3aea35,_0xa8eee5){return db[_0x6610('0x60')][_0x6610('0x56')]({'where':{'id':_0x47fbfa[_0x6610('0x32')][_0x6610('0x5f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6610('0x61'),'attributes':['id'],'raw':!![]}]})[_0x6610('0x26')](handleEntityNotFound(_0x3aea35,null))['then'](function(_0x48c818){var _0x37e5bd=_[_0x6610('0x40')](_0x48c818,'id');var _0x21de7f=[];var _0x37e457=[];var _0x5571da=squel[_0x6610('0x6c')]();_0x5571da['field']('tq.TeamId')['from']('team_has_fax_queues','tq')['join'](_0x6610('0x6d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6610('0x3e')](_0x6610('0x6e'),_0x47fbfa[_0x6610('0x48')]['id']);for(var _0x414acd=0x0;_0x414acd<_0x48c818[_0x6610('0x38')];_0x414acd+=0x1){let _0x56b165=_0x48c818[_0x414acd];for(var _0x139e56=0x0;_0x139e56<_0x56b165[_0x6610('0x61')][_0x6610('0x38')];_0x139e56+=0x1){let _0x5adb91=_0x56b165[_0x6610('0x61')][_0x139e56];var _0x533697=_0x5571da['clone']();_0x533697[_0x6610('0x3e')](_0x6610('0x6f'),_0x5adb91['id']);_0x37e457[_0x6610('0x70')](db['sequelize'][_0x6610('0x32')](_0x533697['toString'](),{'type':db[_0x6610('0x65')]['QueryTypes'][_0x6610('0x71')]})[_0x6610('0x26')](function(_0x5c0699){if(_0x5c0699[_0x6610('0x38')]===0x1){return _0x5adb91['id'];}else{var _0x19983a=_[_0x6610('0x72')](_[_0x6610('0x40')](_0x5c0699,_0x6610('0x73')),function(_0x333e05){return _['includes'](_0x37e5bd,_0x333e05);});if(_0x19983a){return _0x5adb91['id'];}}}));}}return BPromise['all'](_0x37e457)[_0x6610('0x26')](function(_0x2c7a14){_0x21de7f=_(_0x21de7f)['union'](_0x2c7a14)[_0x6610('0x74')]()[_0x6610('0x75')]();return db[_0x6610('0x2e')][_0x6610('0x4a')]({'where':{'id':_0x47fbfa[_0x6610('0x48')]['id']}})[_0x6610('0x26')](function(_0x5dbfa5){return db[_0x6610('0x65')][_0x6610('0x66')](function(_0x2ea5ba){return _0x5dbfa5[_0x6610('0x6b')](_0x47fbfa[_0x6610('0x32')][_0x6610('0x5f')],{'transaction':_0x2ea5ba})[_0x6610('0x26')](function(){if(!_['isEmpty'](_0x21de7f)){return _0x5dbfa5[_0x6610('0x76')](_0x21de7f,{'transaction':_0x2ea5ba});}})[_0x6610('0x26')](function(){_0x21de7f[_0x6610('0x69')](function(_0x9a9547){socket[_0x6610('0x6a')](_0x6610('0x77'),{'UserId':_0x9a9547,'FaxQueueId':_0x5dbfa5['id']});});});});});});})[_0x6610('0x26')](respondWithStatusCode(_0x3aea35,null))[_0x6610('0x4f')](handleError(_0x3aea35,null));};exports['addAgents']=function(_0xb09046,_0x447217,_0x355817){return db[_0x6610('0x2e')]['find']({'where':{'id':_0xb09046[_0x6610('0x48')]['id']}})[_0x6610('0x26')](handleEntityNotFound(_0x447217,null))[_0x6610('0x26')](function(_0x4ed418){if(_0x4ed418){return _0x4ed418[_0x6610('0x78')](_0xb09046[_0x6610('0x4c')][_0x6610('0x5f')],_[_0x6610('0x79')](_0xb09046[_0x6610('0x4c')],[_0x6610('0x5f'),'id'])||{})[_0x6610('0x7a')](function(_0x10bda1){for(var _0x58ca72=0x0;_0x58ca72<_0xb09046[_0x6610('0x4c')][_0x6610('0x5f')][_0x6610('0x38')];_0x58ca72+=0x1){socket[_0x6610('0x6a')](_0x6610('0x7b'),{'UserId':Number(_0xb09046[_0x6610('0x4c')][_0x6610('0x5f')][_0x58ca72]),'FaxQueueId':Number(_0xb09046[_0x6610('0x48')]['id'])});}return _0x10bda1;});}})['then'](respondWithResult(_0x447217,null))['catch'](handleError(_0x447217,null));};exports['removeAgents']=function(_0xcb900f,_0x191cbd,_0x528751){return db[_0x6610('0x2e')]['find']({'where':{'id':_0xcb900f[_0x6610('0x48')]['id']}})[_0x6610('0x26')](handleEntityNotFound(_0x191cbd,null))['then'](function(_0x43452a){if(_0x43452a){return _0x43452a[_0x6610('0x76')](_0xcb900f[_0x6610('0x32')][_0x6610('0x5f')])[_0x6610('0x26')](function(){if(_[_0x6610('0x7c')](_0xcb900f[_0x6610('0x32')][_0x6610('0x5f')])){for(var _0x250e7f=0x0;_0x250e7f<_0xcb900f['query'][_0x6610('0x5f')][_0x6610('0x38')];_0x250e7f+=0x1){socket[_0x6610('0x6a')]('userFaxQueue:remove',{'UserId':Number(_0xcb900f[_0x6610('0x32')]['ids'][_0x250e7f]),'FaxQueueId':Number(_0xcb900f[_0x6610('0x48')]['id'])});}}else{socket[_0x6610('0x6a')](_0x6610('0x77'),{'UserId':Number(_0xcb900f[_0x6610('0x32')][_0x6610('0x5f')]),'FaxQueueId':Number(_0xcb900f[_0x6610('0x48')]['id'])});}});}})[_0x6610('0x26')](respondWithStatusCode(_0x191cbd,null))['catch'](handleError(_0x191cbd,null));};exports[_0x6610('0x7d')]=function(_0x26aa52,_0x14c17c,_0x41abc9){var _0x445be0={};var _0x229668={};var _0x1a0cc0;var _0x2121f3;return db[_0x6610('0x2e')][_0x6610('0x53')]({'where':{'id':_0x26aa52[_0x6610('0x48')]['id']}})[_0x6610('0x26')](handleEntityNotFound(_0x14c17c,null))['then'](function(_0x48585){if(_0x48585){_0x1a0cc0=_0x48585;_0x229668[_0x6610('0x34')]=_[_0x6610('0x49')](db[_0x6610('0x57')][_0x6610('0x2f')]);_0x229668[_0x6610('0x32')]=_[_0x6610('0x49')](_0x26aa52[_0x6610('0x32')]);_0x229668['filters']=_[_0x6610('0x36')](_0x229668[_0x6610('0x34')],_0x229668[_0x6610('0x32')]);_0x445be0[_0x6610('0x35')]=_[_0x6610('0x36')](_0x229668[_0x6610('0x34')],qs[_0x6610('0x37')](_0x26aa52[_0x6610('0x32')][_0x6610('0x37')]));_0x445be0[_0x6610('0x35')]=_0x445be0[_0x6610('0x35')]['length']?_0x445be0['attributes']:_0x229668[_0x6610('0x34')];_0x445be0['order']=qs[_0x6610('0x3c')](_0x26aa52[_0x6610('0x32')][_0x6610('0x3c')]);_0x445be0[_0x6610('0x3e')]=qs[_0x6610('0x33')](_['pick'](_0x26aa52[_0x6610('0x32')],_0x229668[_0x6610('0x33')]));if(_0x26aa52[_0x6610('0x32')]['filter']){_0x445be0['where']=_[_0x6610('0x3f')](_0x445be0[_0x6610('0x3e')],{'$or':_['map'](_0x445be0[_0x6610('0x35')],function(_0xaef2af){var _0x10741c={};_0x10741c[_0xaef2af]={'$like':'%'+_0x26aa52[_0x6610('0x32')][_0x6610('0x3d')]+'%'};return _0x10741c;})});}_0x445be0=_['merge']({},_0x445be0,_0x26aa52[_0x6610('0x42')]);return _0x1a0cc0[_0x6610('0x7d')](_0x445be0);}})[_0x6610('0x26')](function(_0x226365){if(_0x226365){_0x2121f3=_0x226365[_0x6610('0x38')];if(!_0x26aa52['query'][_0x6610('0x39')]('nolimit')){_0x445be0[_0x6610('0x1f')]=qs[_0x6610('0x1f')](_0x26aa52[_0x6610('0x32')][_0x6610('0x1f')]);_0x445be0[_0x6610('0x1d')]=qs[_0x6610('0x1d')](_0x26aa52['query'][_0x6610('0x1d')]);}return _0x1a0cc0['getAgents'](_0x445be0);}})[_0x6610('0x26')](function(_0x40ff8b){if(_0x40ff8b){return _0x40ff8b?{'count':_0x2121f3,'rows':_0x40ff8b}:null;}})[_0x6610('0x26')](respondWithResult(_0x14c17c,null))[_0x6610('0x4f')](handleError(_0x14c17c,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 95c2143..2bf2e6f 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 _0x57bc=['remove','hasOwnProperty','hook','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x388c25,_0x38497c){var _0x5dbb75=function(_0x3eb687){while(--_0x3eb687){_0x388c25['push'](_0x388c25['shift']());}};_0x5dbb75(++_0x38497c);}(_0x57bc,0x7b));var _0xc57b=function(_0x1a227f,_0xac3b4d){_0x1a227f=_0x1a227f-0x0;var _0x21aa96=_0x57bc[_0x1a227f];return _0x21aa96;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xc57b('0x0'))['db'][_0xc57b('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc57b('0x2')](0x0);var events={'afterCreate':_0xc57b('0x3'),'afterUpdate':_0xc57b('0x4'),'afterDestroy':_0xc57b('0x5')};function emitEvent(_0x1086e2){return function(_0x2c1a62,_0x5e1a31,_0x54640b){FaxQueueEvents['emit'](_0x1086e2+':'+_0x2c1a62['id'],_0x2c1a62);FaxQueueEvents['emit'](_0x1086e2,_0x2c1a62);_0x54640b(null);};}for(var e in events){if(events[_0xc57b('0x6')](e)){var event=events[e];FaxQueue[_0xc57b('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x379d=['../../mysqldb','FaxQueue','setMaxListeners','emit','hasOwnProperty','exports'];(function(_0x44bda8,_0x1728d6){var _0x326d63=function(_0x3bd0e4){while(--_0x3bd0e4){_0x44bda8['push'](_0x44bda8['shift']());}};_0x326d63(++_0x1728d6);}(_0x379d,0x19e));var _0xd379=function(_0x299e98,_0xcf14c){_0x299e98=_0x299e98-0x0;var _0xcf8a38=_0x379d[_0x299e98];return _0xcf8a38;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xd379('0x0'))['db'][_0xd379('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd379('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x14ebd2){return function(_0x1508f9,_0x34f065,_0x49d4e6){FaxQueueEvents[_0xd379('0x3')](_0x14ebd2+':'+_0x1508f9['id'],_0x1508f9);FaxQueueEvents['emit'](_0x14ebd2,_0x1508f9);_0x49d4e6(null);};}for(var e in events){if(events[_0xd379('0x4')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd379('0x5')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 56f7316..7474ea5 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 _0x4157=['FaxQueue','lodash','util','../../config/logger','request-promise','rimraf','exports'];(function(_0x1deb92,_0x56a042){var _0xe2a143=function(_0x402af6){while(--_0x402af6){_0x1deb92['push'](_0x1deb92['shift']());}};_0xe2a143(++_0x56a042);}(_0x4157,0xbe));var _0x7415=function(_0x42ae20,_0x1d2416){_0x42ae20=_0x42ae20-0x0;var _0x25f839=_0x4157[_0x42ae20];return _0x25f839;};'use strict';var _=require(_0x7415('0x0'));var util=require(_0x7415('0x1'));var logger=require(_0x7415('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7415('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7415('0x4'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x7415('0x5')]=function(_0xc6adf6,_0x1ef7e5){return _0xc6adf6['define'](_0x7415('0x6'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84ae=['../../config/logger','api','request-promise','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue','lodash'];(function(_0x3feaa2,_0x4305f0){var _0x3d395d=function(_0x6a4294){while(--_0x6a4294){_0x3feaa2['push'](_0x3feaa2['shift']());}};_0x3d395d(++_0x4305f0);}(_0x84ae,0x127));var _0xe84a=function(_0x2b7db4,_0x446ae1){_0x2b7db4=_0x2b7db4-0x0;var _0x576a15=_0x84ae[_0x2b7db4];return _0x576a15;};'use strict';var _=require(_0xe84a('0x0'));var util=require('util');var logger=require(_0xe84a('0x1'))(_0xe84a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe84a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe84a('0x4'));var config=require(_0xe84a('0x5'));var attributes=require(_0xe84a('0x6'));module['exports']=function(_0x5d6212,_0x3cf864){return _0x5d6212['define'](_0xe84a('0x7'),attributes,{'tableName':'fax_queues','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 6c23b03..f351ff7 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 _0x429e=['stringify','error','code','message','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','then','catch','ShowFaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x257dd7,_0x2157c1){var _0x159fc5=function(_0x81ae3f){while(--_0x81ae3f){_0x257dd7['push'](_0x257dd7['shift']());}};_0x159fc5(++_0x2157c1);}(_0x429e,0x14b));var _0xe429=function(_0x3fcd61,_0x19dda4){_0x3fcd61=_0x3fcd61-0x0;var _0x5e813a=_0x429e[_0x3fcd61];return _0x5e813a;};'use strict';var _=require(_0xe429('0x0'));var util=require(_0xe429('0x1'));var moment=require(_0xe429('0x2'));var BPromise=require(_0xe429('0x3'));var rs=require(_0xe429('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe429('0x5'))['db'];var utils=require(_0xe429('0x6'));var logger=require(_0xe429('0x7'))(_0xe429('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe429('0x9')][_0xe429('0xa')]({'port':0x232a});config[_0xe429('0xb')]=_[_0xe429('0xc')](config[_0xe429('0xb')],{'host':_0xe429('0xd'),'port':0x18eb});var socket=require(_0xe429('0xe'))(new Redis(config[_0xe429('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x16c6ab,_0x5ebb32,_0x192d35){return new BPromise(function(_0x3d0925,_0x6463ef){return client[_0xe429('0xf')](_0x16c6ab,_0x192d35)['then'](function(_0x3a940f){logger[_0xe429('0x10')](_0xe429('0x11'),_0x5ebb32,_0xe429('0x12'));logger[_0xe429('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5ebb32,'request\x20sent',JSON[_0xe429('0x14')](_0x3a940f));if(_0x3a940f[_0xe429('0x15')]){if(_0x3a940f[_0xe429('0x15')][_0xe429('0x16')]===0x1f4){logger[_0xe429('0x15')](_0xe429('0x11'),_0x5ebb32,_0x3a940f[_0xe429('0x15')][_0xe429('0x17')]);return _0x6463ef(_0x3a940f[_0xe429('0x15')][_0xe429('0x17')]);}logger[_0xe429('0x15')]('FaxQueue,\x20%s,\x20%s',_0x5ebb32,_0x3a940f[_0xe429('0x15')][_0xe429('0x17')]);return _0x3d0925(_0x3a940f['error'][_0xe429('0x17')]);}else{logger[_0xe429('0x10')]('FaxQueue,\x20%s,\x20%s',_0x5ebb32,_0xe429('0x12'));_0x3d0925(_0x3a940f['result']['message']);}})['catch'](function(_0x5e5329){logger[_0xe429('0x15')](_0xe429('0x11'),_0x5ebb32,_0x5e5329);_0x6463ef(_0x5e5329);});});}exports[_0xe429('0x18')]=function(_0x643bdc){var _0x3665c2=this;return new Promise(function(_0x12755f,_0x4b6983){return db[_0xe429('0x19')][_0xe429('0x1a')]({'raw':_0x643bdc[_0xe429('0x1b')]?_0x643bdc[_0xe429('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x643bdc[_0xe429('0x1b')]?_0x643bdc[_0xe429('0x1b')][_0xe429('0x1c')]||null:null,'attributes':_0x643bdc[_0xe429('0x1b')]?_0x643bdc[_0xe429('0x1b')][_0xe429('0x1d')]||null:null,'limit':_0x643bdc[_0xe429('0x1b')]?_0x643bdc[_0xe429('0x1b')][_0xe429('0x1e')]||null:null,'include':_0x643bdc[_0xe429('0x1b')]?_0x643bdc['options'][_0xe429('0x1f')]?_[_0xe429('0x20')](_0x643bdc[_0xe429('0x1b')]['include'],function(_0x12009f){return{'model':db[_0x12009f[_0xe429('0x21')]],'as':_0x12009f['as'],'attributes':_0x12009f[_0xe429('0x1d')],'include':_0x12009f['include']?_[_0xe429('0x20')](_0x12009f[_0xe429('0x1f')],function(_0x4a2226){return{'model':db[_0x4a2226[_0xe429('0x21')]],'as':_0x4a2226['as'],'attributes':_0x4a2226[_0xe429('0x1d')],'include':_0x4a2226[_0xe429('0x1f')]?_['map'](_0x4a2226[_0xe429('0x1f')],function(_0x1f4e64){return{'model':db[_0x1f4e64['model']],'as':_0x1f4e64['as'],'attributes':_0x1f4e64['attributes']};}):[]};}):[]};}):[]:[]})[_0xe429('0x22')](function(_0x25b18a){logger[_0xe429('0x10')]('GetFaxQueue',_0x643bdc);logger[_0xe429('0x13')](_0xe429('0x18'),_0x643bdc,JSON[_0xe429('0x14')](_0x25b18a));_0x12755f(_0x25b18a);})[_0xe429('0x23')](function(_0x4c77ae){logger['error'](_0xe429('0x18'),_0x4c77ae[_0xe429('0x17')],_0x643bdc);_0x4b6983(_0x3665c2[_0xe429('0x15')](0x1f4,_0x4c77ae['message']));});});};exports[_0xe429('0x24')]=function(_0x1f02d6){var _0x1b00a7=this;return new Promise(function(_0x53bb20,_0x4298eb){return db[_0xe429('0x19')][_0xe429('0x25')]({'raw':_0x1f02d6[_0xe429('0x1b')]?_0x1f02d6[_0xe429('0x1b')][_0xe429('0x26')]===undefined?!![]:![]:!![],'where':_0x1f02d6[_0xe429('0x1b')]?_0x1f02d6[_0xe429('0x1b')][_0xe429('0x1c')]||null:null,'attributes':_0x1f02d6[_0xe429('0x1b')]?_0x1f02d6[_0xe429('0x1b')]['attributes']||null:null,'include':_0x1f02d6[_0xe429('0x1b')]?_0x1f02d6[_0xe429('0x1b')][_0xe429('0x1f')]?_[_0xe429('0x20')](_0x1f02d6[_0xe429('0x1b')][_0xe429('0x1f')],function(_0x55ba54){return{'model':db[_0x55ba54[_0xe429('0x21')]],'as':_0x55ba54['as'],'attributes':_0x55ba54['attributes'],'include':_0x55ba54[_0xe429('0x1f')]?_['map'](_0x55ba54[_0xe429('0x1f')],function(_0x39b831){return{'model':db[_0x39b831[_0xe429('0x21')]],'as':_0x39b831['as'],'attributes':_0x39b831['attributes'],'include':_0x39b831[_0xe429('0x1f')]?_[_0xe429('0x20')](_0x39b831[_0xe429('0x1f')],function(_0x1177bc){return{'model':db[_0x1177bc['model']],'as':_0x1177bc['as'],'attributes':_0x1177bc[_0xe429('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xef0df1){logger[_0xe429('0x10')](_0xe429('0x24'),_0x1f02d6);logger['debug']('ShowFaxQueue',_0x1f02d6,JSON[_0xe429('0x14')](_0xef0df1));_0x53bb20(_0xef0df1);})['catch'](function(_0x328165){logger['error'](_0xe429('0x24'),_0x328165[_0xe429('0x17')],_0x1f02d6);_0x4298eb(_0x1b00a7[_0xe429('0x15')](0x1f4,_0x328165[_0xe429('0x17')]));});});}; \ No newline at end of file +var _0x136b=['jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','findAll','options','raw','attributes','limit','include','map','model','ShowFaxQueue','FaxQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x136b,0x13f));var _0xb136=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x136b[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xb136('0x0'));var util=require(_0xb136('0x1'));var moment=require(_0xb136('0x2'));var BPromise=require(_0xb136('0x3'));var rs=require(_0xb136('0x4'));var fs=require('fs');var Redis=require(_0xb136('0x5'));var db=require(_0xb136('0x6'))['db'];var utils=require(_0xb136('0x7'));var logger=require('../../config/logger')(_0xb136('0x8'));var config=require('../../config/environment');var jayson=require(_0xb136('0x9'));var client=jayson[_0xb136('0xa')][_0xb136('0xb')]({'port':0x232a});config[_0xb136('0xc')]=_[_0xb136('0xd')](config[_0xb136('0xc')],{'host':_0xb136('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb136('0xc')]));require(_0xb136('0xf'))['register'](socket);function respondWithRpcPromise(_0x4caab0,_0x5dccd4,_0xe4fcea){return new BPromise(function(_0x5bd672,_0x5f241b){return client[_0xb136('0x10')](_0x4caab0,_0xe4fcea)[_0xb136('0x11')](function(_0x2c8368){logger[_0xb136('0x12')](_0xb136('0x13'),_0x5dccd4,_0xb136('0x14'));logger[_0xb136('0x15')](_0xb136('0x16'),_0x5dccd4,_0xb136('0x14'),JSON[_0xb136('0x17')](_0x2c8368));if(_0x2c8368[_0xb136('0x18')]){if(_0x2c8368['error']['code']===0x1f4){logger[_0xb136('0x18')]('FaxQueue,\x20%s,\x20%s',_0x5dccd4,_0x2c8368[_0xb136('0x18')][_0xb136('0x19')]);return _0x5f241b(_0x2c8368[_0xb136('0x18')][_0xb136('0x19')]);}logger[_0xb136('0x18')](_0xb136('0x13'),_0x5dccd4,_0x2c8368[_0xb136('0x18')][_0xb136('0x19')]);return _0x5bd672(_0x2c8368['error'][_0xb136('0x19')]);}else{logger[_0xb136('0x12')]('FaxQueue,\x20%s,\x20%s',_0x5dccd4,_0xb136('0x14'));_0x5bd672(_0x2c8368[_0xb136('0x1a')][_0xb136('0x19')]);}})[_0xb136('0x1b')](function(_0x2257be){logger[_0xb136('0x18')]('FaxQueue,\x20%s,\x20%s',_0x5dccd4,_0x2257be);_0x5f241b(_0x2257be);});});}exports[_0xb136('0x1c')]=function(_0xb90a0a){var _0x5d2f87=this;return new Promise(function(_0x5c7aac,_0x4296d3){return db['FaxQueue'][_0xb136('0x1d')]({'raw':_0xb90a0a['options']?_0xb90a0a[_0xb136('0x1e')][_0xb136('0x1f')]===undefined?!![]:![]:!![],'where':_0xb90a0a[_0xb136('0x1e')]?_0xb90a0a[_0xb136('0x1e')]['where']||null:null,'attributes':_0xb90a0a[_0xb136('0x1e')]?_0xb90a0a[_0xb136('0x1e')][_0xb136('0x20')]||null:null,'limit':_0xb90a0a['options']?_0xb90a0a[_0xb136('0x1e')][_0xb136('0x21')]||null:null,'include':_0xb90a0a[_0xb136('0x1e')]?_0xb90a0a[_0xb136('0x1e')][_0xb136('0x22')]?_[_0xb136('0x23')](_0xb90a0a[_0xb136('0x1e')][_0xb136('0x22')],function(_0x2de8fa){return{'model':db[_0x2de8fa[_0xb136('0x24')]],'as':_0x2de8fa['as'],'attributes':_0x2de8fa[_0xb136('0x20')],'include':_0x2de8fa[_0xb136('0x22')]?_[_0xb136('0x23')](_0x2de8fa[_0xb136('0x22')],function(_0x1c0a59){return{'model':db[_0x1c0a59['model']],'as':_0x1c0a59['as'],'attributes':_0x1c0a59[_0xb136('0x20')],'include':_0x1c0a59[_0xb136('0x22')]?_['map'](_0x1c0a59[_0xb136('0x22')],function(_0x51578d){return{'model':db[_0x51578d[_0xb136('0x24')]],'as':_0x51578d['as'],'attributes':_0x51578d[_0xb136('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54c314){logger[_0xb136('0x12')](_0xb136('0x1c'),_0xb90a0a);logger[_0xb136('0x15')](_0xb136('0x1c'),_0xb90a0a,JSON[_0xb136('0x17')](_0x54c314));_0x5c7aac(_0x54c314);})[_0xb136('0x1b')](function(_0x4d4dde){logger[_0xb136('0x18')]('GetFaxQueue',_0x4d4dde[_0xb136('0x19')],_0xb90a0a);_0x4296d3(_0x5d2f87['error'](0x1f4,_0x4d4dde[_0xb136('0x19')]));});});};exports[_0xb136('0x25')]=function(_0x43f770){var _0x753c00=this;return new Promise(function(_0xe633a4,_0xab889e){return db[_0xb136('0x26')][_0xb136('0x27')]({'raw':_0x43f770['options']?_0x43f770[_0xb136('0x1e')][_0xb136('0x1f')]===undefined?!![]:![]:!![],'where':_0x43f770[_0xb136('0x1e')]?_0x43f770[_0xb136('0x1e')][_0xb136('0x28')]||null:null,'attributes':_0x43f770[_0xb136('0x1e')]?_0x43f770['options']['attributes']||null:null,'include':_0x43f770['options']?_0x43f770[_0xb136('0x1e')][_0xb136('0x22')]?_[_0xb136('0x23')](_0x43f770[_0xb136('0x1e')][_0xb136('0x22')],function(_0x2a99c8){return{'model':db[_0x2a99c8[_0xb136('0x24')]],'as':_0x2a99c8['as'],'attributes':_0x2a99c8['attributes'],'include':_0x2a99c8[_0xb136('0x22')]?_[_0xb136('0x23')](_0x2a99c8['include'],function(_0x2b7463){return{'model':db[_0x2b7463[_0xb136('0x24')]],'as':_0x2b7463['as'],'attributes':_0x2b7463[_0xb136('0x20')],'include':_0x2b7463[_0xb136('0x22')]?_[_0xb136('0x23')](_0x2b7463[_0xb136('0x22')],function(_0x4cf4a3){return{'model':db[_0x4cf4a3[_0xb136('0x24')]],'as':_0x4cf4a3['as'],'attributes':_0x4cf4a3[_0xb136('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51075d){logger['info'](_0xb136('0x25'),_0x43f770);logger[_0xb136('0x15')]('ShowFaxQueue',_0x43f770,JSON['stringify'](_0x51075d));_0xe633a4(_0x51075d);})[_0xb136('0x1b')](function(_0x3aa2f1){logger[_0xb136('0x18')](_0xb136('0x25'),_0x3aa2f1['message'],_0x43f770);_0xab889e(_0x753c00[_0xb136('0x18')](0x1f4,_0x3aa2f1[_0xb136('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index cbac199..1290a3e 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 _0xa209=['./faxQueue.events','save','update','emit','removeListener','register'];(function(_0x38d2d1,_0x2d67ea){var _0x422b6d=function(_0x1be48c){while(--_0x1be48c){_0x38d2d1['push'](_0x38d2d1['shift']());}};_0x422b6d(++_0x2d67ea);}(_0xa209,0xba));var _0x9a20=function(_0x59c55f,_0x1736ac){_0x59c55f=_0x59c55f-0x0;var _0x5d39b0=_0xa209[_0x59c55f];return _0x5d39b0;};'use strict';var FaxQueueEvents=require(_0x9a20('0x0'));var events=[_0x9a20('0x1'),'remove',_0x9a20('0x2')];function createListener(_0x241329,_0x11f943){return function(_0x1da913){_0x11f943[_0x9a20('0x3')](_0x241329,_0x1da913);};}function removeListener(_0x1c7f7a,_0x4a27a1){return function(){FaxQueueEvents[_0x9a20('0x4')](_0x1c7f7a,_0x4a27a1);};}exports[_0x9a20('0x5')]=function(_0xb4a3f4){for(var _0x3f6b50=0x0,_0x2fe790=events['length'];_0x3f6b50<_0x2fe790;_0x3f6b50++){var _0x3744e8=events[_0x3f6b50];var _0x2194d8=createListener('faxQueue:'+_0x3744e8,_0xb4a3f4);FaxQueueEvents['on'](_0x3744e8,_0x2194d8);}}; \ No newline at end of file +var _0x1d6f=['faxQueue:','./faxQueue.events','emit','register'];(function(_0x1f28a4,_0x5ae5e6){var _0x1dccf5=function(_0x4375c2){while(--_0x4375c2){_0x1f28a4['push'](_0x1f28a4['shift']());}};_0x1dccf5(++_0x5ae5e6);}(_0x1d6f,0x171));var _0xf1d6=function(_0x20b16a,_0x214b2b){_0x20b16a=_0x20b16a-0x0;var _0xe0e29c=_0x1d6f[_0x20b16a];return _0xe0e29c;};'use strict';var FaxQueueEvents=require(_0xf1d6('0x0'));var events=['save','remove','update'];function createListener(_0x3b88bf,_0x4fdf4c){return function(_0x2a24c3){_0x4fdf4c[_0xf1d6('0x1')](_0x3b88bf,_0x2a24c3);};}function removeListener(_0x31f147,_0x3ebeea){return function(){FaxQueueEvents['removeListener'](_0x31f147,_0x3ebeea);};}exports[_0xf1d6('0x2')]=function(_0x2b1d57){for(var _0x195b21=0x0,_0x1b8fe7=events['length'];_0x195b21<_0x1b8fe7;_0x195b21++){var _0xa32b7d=events[_0x195b21];var _0x678a98=createListener(_0xf1d6('0x3')+_0xa32b7d,_0x2b1d57);FaxQueueEvents['on'](_0xa32b7d,_0x678a98);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 13286f2..dcd646d 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 _0x444e=['addAgents','put','update','delete','destroy','/:id/users','removeAgents','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getAgents','post'];(function(_0xc2869e,_0x105457){var _0x243be2=function(_0x4876b6){while(--_0x4876b6){_0xc2869e['push'](_0xc2869e['shift']());}};_0x243be2(++_0x105457);}(_0x444e,0xe8));var _0xe444=function(_0x30468f,_0x2c5db6){_0x30468f=_0x30468f-0x0;var _0x302978=_0x444e[_0x30468f];return _0x302978;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['get'](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0xd')]);router['get']('/:id/members',auth[_0xe444('0x8')](),controller[_0xe444('0xe')]);router['get'](_0xe444('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe444('0x7')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x10')]);router['post']('/',auth[_0xe444('0x8')](),controller['create']);router['post'](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['addTeams']);router[_0xe444('0x11')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x12')]);router[_0xe444('0x13')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x14')]);router[_0xe444('0x15')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x16')]);router[_0xe444('0x15')](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['removeTeams']);router[_0xe444('0x15')](_0xe444('0x17'),auth[_0xe444('0x8')](),controller[_0xe444('0x18')]);module['exports']=router; \ No newline at end of file +var _0x39e6=['getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x39e6,0x9e));var _0x639e=function(_0x98111a,_0x5d20cc){_0x98111a=_0x98111a-0x0;var _0x289349=_0x39e6[_0x98111a];return _0x289349;};'use strict';var multer=require(_0x639e('0x0'));var util=require('util');var path=require(_0x639e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x639e('0x2')]();var fs_extra=require(_0x639e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x639e('0x4'));var config=require(_0x639e('0x5'));var controller=require(_0x639e('0x6'));router[_0x639e('0x7')]('/',auth[_0x639e('0x8')](),controller[_0x639e('0x9')]);router[_0x639e('0x7')](_0x639e('0xa'),auth[_0x639e('0x8')](),controller[_0x639e('0xb')]);router[_0x639e('0x7')](_0x639e('0xc'),auth[_0x639e('0x8')](),controller[_0x639e('0xd')]);router[_0x639e('0x7')](_0x639e('0xe'),auth[_0x639e('0x8')](),controller[_0x639e('0xf')]);router['get']('/:id/teams',auth[_0x639e('0x8')](),controller[_0x639e('0x10')]);router[_0x639e('0x7')](_0x639e('0x11'),auth[_0x639e('0x8')](),controller[_0x639e('0x12')]);router[_0x639e('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x639e('0x13')](_0x639e('0x14'),auth[_0x639e('0x8')](),controller[_0x639e('0x15')]);router[_0x639e('0x13')](_0x639e('0x11'),auth['isAuthenticated'](),controller[_0x639e('0x16')]);router[_0x639e('0x17')](_0x639e('0xc'),auth[_0x639e('0x8')](),controller['update']);router[_0x639e('0x18')]('/:id',auth[_0x639e('0x8')](),controller[_0x639e('0x19')]);router[_0x639e('0x18')](_0x639e('0x14'),auth[_0x639e('0x8')](),controller[_0x639e('0x1a')]);router['delete'](_0x639e('0x11'),auth[_0x639e('0x8')](),controller[_0x639e('0x1b')]);module[_0x639e('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index fa6fab9..2ccba25 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 _0xd59d=['DATE','moment','exports','STRING'];(function(_0x4a923f,_0x3aef91){var _0x5d0cbc=function(_0x593b4e){while(--_0x593b4e){_0x4a923f['push'](_0x4a923f['shift']());}};_0x5d0cbc(++_0x3aef91);}(_0xd59d,0x81));var _0xdd59=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xd59d[_0x4e4f0e];return _0x1a7219;};'use strict';var moment=require(_0xdd59('0x0'));var Sequelize=require('sequelize');module[_0xdd59('0x1')]={'uniqueid':{'type':Sequelize[_0xdd59('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdd59('0x2')]},'joinAt':{'type':Sequelize[_0xdd59('0x3')]},'leaveAt':{'type':Sequelize[_0xdd59('0x3')]},'acceptAt':{'type':Sequelize[_0xdd59('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdd59('0x2')]}}; \ No newline at end of file +var _0xce1a=['STRING','DATE','moment'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0xce1a,0xbf));var _0xace1=function(_0x48d6cb,_0x47724b){_0x48d6cb=_0x48d6cb-0x0;var _0x11464b=_0xce1a[_0x48d6cb];return _0x11464b;};'use strict';var moment=require(_0xace1('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xace1('0x1')]},'joinAt':{'type':Sequelize[_0xace1('0x2')]},'leaveAt':{'type':Sequelize[_0xace1('0x2')]},'acceptAt':{'type':Sequelize[_0xace1('0x2')]},'exitAt':{'type':Sequelize[_0xace1('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index d4aa01d..3a789a6 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 _0xa902=['ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','FaxQueueReport','findAll','rows','catch','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv'];(function(_0x3deeb1,_0x145921){var _0x8f8699=function(_0x567eb9){while(--_0x567eb9){_0x3deeb1['push'](_0x3deeb1['shift']());}};_0x8f8699(++_0x145921);}(_0xa902,0x8d));var _0x2a90=function(_0x4b6295,_0x456ed9){_0x4b6295=_0x4b6295-0x0;var _0x5b4941=_0xa902[_0x4b6295];return _0x5b4941;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];function respondWithStatusCode(_0x57458a,_0x1f6953){_0x1f6953=_0x1f6953||0xcc;return function(_0x57aee3){if(_0x57aee3){return _0x57458a[_0x2a90('0x17')](_0x1f6953);}return _0x57458a[_0x2a90('0x18')](_0x1f6953)[_0x2a90('0x19')]();};}function respondWithResult(_0x4c328b,_0x56d1b8){_0x56d1b8=_0x56d1b8||0xc8;return function(_0x57227c){if(_0x57227c){return _0x4c328b[_0x2a90('0x18')](_0x56d1b8)[_0x2a90('0x1a')](_0x57227c);}};}function respondWithFilteredResult(_0x5a2682,_0x1ff63d){return function(_0x21c648){if(_0x21c648){var _0x312782=typeof _0x1ff63d[_0x2a90('0x1b')]===_0x2a90('0x1c')&&typeof _0x1ff63d[_0x2a90('0x1d')]===_0x2a90('0x1c');var _0x10cf94=_0x21c648[_0x2a90('0x1e')];var _0x5c3e4b=_0x312782?0x0:_0x1ff63d[_0x2a90('0x1b')];var _0x1d9a28=_0x312782?_0x21c648[_0x2a90('0x1e')]:_0x1ff63d['offset']+_0x1ff63d[_0x2a90('0x1d')];var _0x1f51a6;if(_0x1d9a28>=_0x10cf94){_0x1d9a28=_0x10cf94;_0x1f51a6=0xc8;}else{_0x1f51a6=0xce;}_0x5a2682[_0x2a90('0x18')](_0x1f51a6);return _0x5a2682[_0x2a90('0x1f')](_0x2a90('0x20'),_0x5c3e4b+'-'+_0x1d9a28+'/'+_0x10cf94)[_0x2a90('0x1a')](_0x21c648);}return null;};}function patchUpdates(_0x312cd5){return function(_0x114d42){try{jsonpatch[_0x2a90('0x21')](_0x114d42,_0x312cd5,!![]);}catch(_0x465284){return BPromise[_0x2a90('0x22')](_0x465284);}return _0x114d42[_0x2a90('0x23')]();};}function saveUpdates(_0x4fdd62,_0x3da7d0){return function(_0x217873){if(_0x217873){return _0x217873[_0x2a90('0x24')](_0x4fdd62)[_0x2a90('0x25')](function(_0x5912fd){return _0x5912fd;});}return null;};}function removeEntity(_0x180485,_0xd033d){return function(_0x4ed9e6){if(_0x4ed9e6){return _0x4ed9e6[_0x2a90('0x26')]()[_0x2a90('0x25')](function(){_0x180485[_0x2a90('0x18')](0xcc)[_0x2a90('0x19')]();});}};}function handleEntityNotFound(_0x2a212c,_0x1303d9){return function(_0x29ed73){if(!_0x29ed73){_0x2a212c[_0x2a90('0x17')](0x194);}return _0x29ed73;};}function handleError(_0x48c2f9,_0x27f883){_0x27f883=_0x27f883||0x1f4;return function(_0x17f978){logger[_0x2a90('0x27')](_0x17f978[_0x2a90('0x28')]);if(_0x17f978[_0x2a90('0x29')]){delete _0x17f978['name'];}_0x48c2f9['status'](_0x27f883)[_0x2a90('0x2a')](_0x17f978);};}exports['index']=function(_0x53391e,_0x4969c3){var _0x2d83b3={},_0x3c78f5={},_0x595638={'count':0x0,'rows':[]};var _0x5bd700=_[_0x2a90('0x2b')](db['FaxQueueReport'][_0x2a90('0x2c')],function(_0x6892e1){return{'name':_0x6892e1[_0x2a90('0x2d')],'type':_0x6892e1[_0x2a90('0x2e')][_0x2a90('0x2f')]};});_0x3c78f5[_0x2a90('0x30')]=_[_0x2a90('0x2b')](_0x5bd700,'name');_0x3c78f5[_0x2a90('0x31')]=_[_0x2a90('0x32')](_0x53391e[_0x2a90('0x31')]);_0x3c78f5['filters']=_[_0x2a90('0x33')](_0x3c78f5[_0x2a90('0x30')],_0x3c78f5[_0x2a90('0x31')]);_0x2d83b3[_0x2a90('0x34')]=_['intersection'](_0x3c78f5[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x53391e[_0x2a90('0x31')][_0x2a90('0x35')]));_0x2d83b3[_0x2a90('0x34')]=_0x2d83b3[_0x2a90('0x34')]['length']?_0x2d83b3[_0x2a90('0x34')]:_0x3c78f5[_0x2a90('0x30')];if(!_0x53391e[_0x2a90('0x31')][_0x2a90('0x36')]('nolimit')){_0x2d83b3[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x53391e['query'][_0x2a90('0x1d')]);_0x2d83b3[_0x2a90('0x1b')]=qs['offset'](_0x53391e['query'][_0x2a90('0x1b')]);}_0x2d83b3[_0x2a90('0x37')]=qs[_0x2a90('0x38')](_0x53391e['query'][_0x2a90('0x38')]);_0x2d83b3['where']=qs[_0x2a90('0x39')](_['pick'](_0x53391e[_0x2a90('0x31')],_0x3c78f5['filters']),_0x5bd700);if(_0x53391e['query'][_0x2a90('0x3a')]){_0x2d83b3['where']=_[_0x2a90('0x3b')](_0x2d83b3[_0x2a90('0x3c')],{'$or':_[_0x2a90('0x2b')](_0x5bd700,function(_0x573aee){if(_0x573aee[_0x2a90('0x2e')]!==_0x2a90('0x3d')){var _0x3be438={};_0x3be438[_0x573aee['name']]={'$like':'%'+_0x53391e[_0x2a90('0x31')][_0x2a90('0x3a')]+'%'};return _0x3be438;}})});}_0x2d83b3=_[_0x2a90('0x3b')]({},_0x2d83b3,_0x53391e['options']);var _0x1aa096={'where':_0x2d83b3[_0x2a90('0x3c')]};return db['FaxQueueReport'][_0x2a90('0x1e')](_0x1aa096)[_0x2a90('0x25')](function(_0x2a6bea){_0x595638[_0x2a90('0x1e')]=_0x2a6bea;if(_0x53391e[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x2d83b3[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x40')][_0x2a90('0x41')](_0x2d83b3);})[_0x2a90('0x25')](function(_0x45b41c){_0x595638[_0x2a90('0x42')]=_0x45b41c;return _0x595638;})[_0x2a90('0x25')](respondWithFilteredResult(_0x4969c3,_0x2d83b3))[_0x2a90('0x43')](handleError(_0x4969c3,null));};exports['show']=function(_0x45cbc2,_0x3a70fe){var _0x528b41={'raw':!![],'where':{'id':_0x45cbc2[_0x2a90('0x44')]['id']}},_0x1045bb={};_0x1045bb[_0x2a90('0x30')]=_[_0x2a90('0x32')](db[_0x2a90('0x40')]['rawAttributes']);_0x1045bb[_0x2a90('0x31')]=_['keys'](_0x45cbc2[_0x2a90('0x31')]);_0x1045bb['filters']=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],_0x1045bb[_0x2a90('0x31')]);_0x528b41[_0x2a90('0x34')]=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x45cbc2['query']['fields']));_0x528b41[_0x2a90('0x34')]=_0x528b41[_0x2a90('0x34')][_0x2a90('0x45')]?_0x528b41[_0x2a90('0x34')]:_0x1045bb[_0x2a90('0x30')];if(_0x45cbc2[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x528b41[_0x2a90('0x3f')]=[{'all':!![]}];}_0x528b41=_['merge']({},_0x528b41,_0x45cbc2[_0x2a90('0x46')]);return db['FaxQueueReport'][_0x2a90('0x47')](_0x528b41)[_0x2a90('0x25')](handleEntityNotFound(_0x3a70fe,null))['then'](respondWithResult(_0x3a70fe,null))[_0x2a90('0x43')](handleError(_0x3a70fe,null));};exports[_0x2a90('0x48')]=function(_0x280e63,_0x1d55db){return db[_0x2a90('0x40')][_0x2a90('0x48')](_0x280e63[_0x2a90('0x49')],{})['then'](respondWithResult(_0x1d55db,0xc9))['catch'](handleError(_0x1d55db,null));};exports[_0x2a90('0x24')]=function(_0x2611d0,_0x42c890){if(_0x2611d0[_0x2a90('0x49')]['id']){delete _0x2611d0[_0x2a90('0x49')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x2611d0[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x42c890,null))['then'](saveUpdates(_0x2611d0['body'],null))['then'](respondWithResult(_0x42c890,null))[_0x2a90('0x43')](handleError(_0x42c890,null));};exports['destroy']=function(_0x370da3,_0x3dfe72){return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x370da3[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x3dfe72,null))['then'](removeEntity(_0x3dfe72,null))[_0x2a90('0x43')](handleError(_0x3dfe72,null));};exports[_0x2a90('0x4a')]=function(_0x48d3bc,_0x265769){return db['FaxQueueReport']['describe']()[_0x2a90('0x25')](respondWithResult(_0x265769,null))[_0x2a90('0x43')](handleError(_0x265769,null));}; \ No newline at end of file +var _0xf2c7=['findAll','show','keys','filters','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','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','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0xfbdbd1,_0x2dc9d9){var _0x3e55b7=function(_0x1c569b){while(--_0x1c569b){_0xfbdbd1['push'](_0xfbdbd1['shift']());}};_0x3e55b7(++_0x2dc9d9);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xf2c7[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0x7f2c('0x0'));var rimraf=require(_0x7f2c('0x1'));var zipdir=require(_0x7f2c('0x2'));var jsonpatch=require(_0x7f2c('0x3'));var rp=require('request-promise');var moment=require(_0x7f2c('0x4'));var BPromise=require(_0x7f2c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7f2c('0x6'));var sox=require('sox');var csv=require(_0x7f2c('0x7'));var ejs=require(_0x7f2c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f2c('0x9'));var squel=require(_0x7f2c('0xa'));var crypto=require(_0x7f2c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7f2c('0xc'));var toCsv=require(_0x7f2c('0x7'));var querystring=require(_0x7f2c('0xd'));var Papa=require(_0x7f2c('0xe'));var Redis=require(_0x7f2c('0xf'));var authService=require(_0x7f2c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7f2c('0x11'));var hardwareService=require(_0x7f2c('0x12'));var logger=require(_0x7f2c('0x13'))(_0x7f2c('0x14'));var utils=require(_0x7f2c('0x15'));var config=require(_0x7f2c('0x16'));var licenseUtil=require(_0x7f2c('0x17'));var db=require(_0x7f2c('0x18'))['db'];function respondWithStatusCode(_0x1c280d,_0x53309e){_0x53309e=_0x53309e||0xcc;return function(_0x2af83c){if(_0x2af83c){return _0x1c280d['sendStatus'](_0x53309e);}return _0x1c280d[_0x7f2c('0x19')](_0x53309e)[_0x7f2c('0x1a')]();};}function respondWithResult(_0x4e83ee,_0x51186f){_0x51186f=_0x51186f||0xc8;return function(_0x2a3409){if(_0x2a3409){return _0x4e83ee[_0x7f2c('0x19')](_0x51186f)['json'](_0x2a3409);}};}function respondWithFilteredResult(_0x3282f9,_0x153c8c){return function(_0x5d9aa2){if(_0x5d9aa2){var _0x1846c6=typeof _0x153c8c[_0x7f2c('0x1b')]===_0x7f2c('0x1c')&&typeof _0x153c8c[_0x7f2c('0x1d')]===_0x7f2c('0x1c');var _0x31858f=_0x5d9aa2[_0x7f2c('0x1e')];var _0xd8eb94=_0x1846c6?0x0:_0x153c8c[_0x7f2c('0x1b')];var _0x1d4ec4=_0x1846c6?_0x5d9aa2['count']:_0x153c8c['offset']+_0x153c8c[_0x7f2c('0x1d')];var _0x45b3e3;if(_0x1d4ec4>=_0x31858f){_0x1d4ec4=_0x31858f;_0x45b3e3=0xc8;}else{_0x45b3e3=0xce;}_0x3282f9[_0x7f2c('0x19')](_0x45b3e3);return _0x3282f9[_0x7f2c('0x1f')](_0x7f2c('0x20'),_0xd8eb94+'-'+_0x1d4ec4+'/'+_0x31858f)[_0x7f2c('0x21')](_0x5d9aa2);}return null;};}function patchUpdates(_0x130e51){return function(_0x13d338){try{jsonpatch[_0x7f2c('0x22')](_0x13d338,_0x130e51,!![]);}catch(_0x196651){return BPromise[_0x7f2c('0x23')](_0x196651);}return _0x13d338[_0x7f2c('0x24')]();};}function saveUpdates(_0x22399d,_0x13fcaf){return function(_0x1a1ee9){if(_0x1a1ee9){return _0x1a1ee9[_0x7f2c('0x25')](_0x22399d)['then'](function(_0x3e711c){return _0x3e711c;});}return null;};}function removeEntity(_0x8a9710,_0x4856b3){return function(_0x38f472){if(_0x38f472){return _0x38f472[_0x7f2c('0x26')]()[_0x7f2c('0x27')](function(){_0x8a9710['status'](0xcc)[_0x7f2c('0x1a')]();});}};}function handleEntityNotFound(_0x2386bf,_0x2eb03e){return function(_0x5198c9){if(!_0x5198c9){_0x2386bf[_0x7f2c('0x28')](0x194);}return _0x5198c9;};}function handleError(_0x1f3ed5,_0x2edbe4){_0x2edbe4=_0x2edbe4||0x1f4;return function(_0x491773){logger[_0x7f2c('0x29')](_0x491773['stack']);if(_0x491773[_0x7f2c('0x2a')]){delete _0x491773[_0x7f2c('0x2a')];}_0x1f3ed5[_0x7f2c('0x19')](_0x2edbe4)[_0x7f2c('0x2b')](_0x491773);};}exports[_0x7f2c('0x2c')]=function(_0x50ad96,_0x301bf4){var _0x287124={},_0x5a6051={},_0x2f6729={'count':0x0,'rows':[]};var _0x1b6a2b=_[_0x7f2c('0x2d')](db[_0x7f2c('0x2e')][_0x7f2c('0x2f')],function(_0x198434){return{'name':_0x198434[_0x7f2c('0x30')],'type':_0x198434[_0x7f2c('0x31')][_0x7f2c('0x32')]};});_0x5a6051[_0x7f2c('0x33')]=_[_0x7f2c('0x2d')](_0x1b6a2b,_0x7f2c('0x2a'));_0x5a6051[_0x7f2c('0x34')]=_['keys'](_0x50ad96[_0x7f2c('0x34')]);_0x5a6051['filters']=_[_0x7f2c('0x35')](_0x5a6051[_0x7f2c('0x33')],_0x5a6051[_0x7f2c('0x34')]);_0x287124[_0x7f2c('0x36')]=_['intersection'](_0x5a6051['model'],qs[_0x7f2c('0x37')](_0x50ad96[_0x7f2c('0x34')][_0x7f2c('0x37')]));_0x287124[_0x7f2c('0x36')]=_0x287124[_0x7f2c('0x36')][_0x7f2c('0x38')]?_0x287124[_0x7f2c('0x36')]:_0x5a6051['model'];if(!_0x50ad96[_0x7f2c('0x34')][_0x7f2c('0x39')](_0x7f2c('0x3a'))){_0x287124[_0x7f2c('0x1d')]=qs[_0x7f2c('0x1d')](_0x50ad96['query'][_0x7f2c('0x1d')]);_0x287124[_0x7f2c('0x1b')]=qs[_0x7f2c('0x1b')](_0x50ad96[_0x7f2c('0x34')][_0x7f2c('0x1b')]);}_0x287124[_0x7f2c('0x3b')]=qs[_0x7f2c('0x3c')](_0x50ad96[_0x7f2c('0x34')][_0x7f2c('0x3c')]);_0x287124[_0x7f2c('0x3d')]=qs['filters'](_['pick'](_0x50ad96[_0x7f2c('0x34')],_0x5a6051['filters']),_0x1b6a2b);if(_0x50ad96[_0x7f2c('0x34')][_0x7f2c('0x3e')]){_0x287124[_0x7f2c('0x3d')]=_[_0x7f2c('0x3f')](_0x287124['where'],{'$or':_[_0x7f2c('0x2d')](_0x1b6a2b,function(_0x5044dc){if(_0x5044dc[_0x7f2c('0x31')]!==_0x7f2c('0x40')){var _0x1d789b={};_0x1d789b[_0x5044dc[_0x7f2c('0x2a')]]={'$like':'%'+_0x50ad96[_0x7f2c('0x34')][_0x7f2c('0x3e')]+'%'};return _0x1d789b;}})});}_0x287124=_['merge']({},_0x287124,_0x50ad96[_0x7f2c('0x41')]);var _0x4cdc44={'where':_0x287124['where']};return db[_0x7f2c('0x2e')][_0x7f2c('0x1e')](_0x4cdc44)['then'](function(_0x1e0bf9){_0x2f6729['count']=_0x1e0bf9;if(_0x50ad96[_0x7f2c('0x34')][_0x7f2c('0x42')]){_0x287124['include']=[{'all':!![]}];}return db[_0x7f2c('0x2e')][_0x7f2c('0x43')](_0x287124);})[_0x7f2c('0x27')](function(_0x31e467){_0x2f6729['rows']=_0x31e467;return _0x2f6729;})['then'](respondWithFilteredResult(_0x301bf4,_0x287124))['catch'](handleError(_0x301bf4,null));};exports[_0x7f2c('0x44')]=function(_0x67fb00,_0x2e884e){var _0x2190b8={'raw':!![],'where':{'id':_0x67fb00['params']['id']}},_0x456a9e={};_0x456a9e['model']=_[_0x7f2c('0x45')](db[_0x7f2c('0x2e')]['rawAttributes']);_0x456a9e['query']=_[_0x7f2c('0x45')](_0x67fb00[_0x7f2c('0x34')]);_0x456a9e[_0x7f2c('0x46')]=_[_0x7f2c('0x35')](_0x456a9e[_0x7f2c('0x33')],_0x456a9e[_0x7f2c('0x34')]);_0x2190b8[_0x7f2c('0x36')]=_[_0x7f2c('0x35')](_0x456a9e[_0x7f2c('0x33')],qs[_0x7f2c('0x37')](_0x67fb00['query']['fields']));_0x2190b8[_0x7f2c('0x36')]=_0x2190b8['attributes'][_0x7f2c('0x38')]?_0x2190b8['attributes']:_0x456a9e[_0x7f2c('0x33')];if(_0x67fb00[_0x7f2c('0x34')][_0x7f2c('0x42')]){_0x2190b8['include']=[{'all':!![]}];}_0x2190b8=_[_0x7f2c('0x3f')]({},_0x2190b8,_0x67fb00[_0x7f2c('0x41')]);return db[_0x7f2c('0x2e')]['find'](_0x2190b8)['then'](handleEntityNotFound(_0x2e884e,null))[_0x7f2c('0x27')](respondWithResult(_0x2e884e,null))[_0x7f2c('0x47')](handleError(_0x2e884e,null));};exports[_0x7f2c('0x48')]=function(_0x33a530,_0x588a8c){return db[_0x7f2c('0x2e')][_0x7f2c('0x48')](_0x33a530[_0x7f2c('0x49')],{})[_0x7f2c('0x27')](respondWithResult(_0x588a8c,0xc9))[_0x7f2c('0x47')](handleError(_0x588a8c,null));};exports['update']=function(_0x276004,_0x3ff774){if(_0x276004[_0x7f2c('0x49')]['id']){delete _0x276004[_0x7f2c('0x49')]['id'];}return db[_0x7f2c('0x2e')][_0x7f2c('0x4a')]({'where':{'id':_0x276004[_0x7f2c('0x4b')]['id']}})[_0x7f2c('0x27')](handleEntityNotFound(_0x3ff774,null))['then'](saveUpdates(_0x276004[_0x7f2c('0x49')],null))[_0x7f2c('0x27')](respondWithResult(_0x3ff774,null))[_0x7f2c('0x47')](handleError(_0x3ff774,null));};exports[_0x7f2c('0x26')]=function(_0x4436e2,_0x1f73e3){return db['FaxQueueReport']['find']({'where':{'id':_0x4436e2[_0x7f2c('0x4b')]['id']}})[_0x7f2c('0x27')](handleEntityNotFound(_0x1f73e3,null))[_0x7f2c('0x27')](removeEntity(_0x1f73e3,null))[_0x7f2c('0x47')](handleError(_0x1f73e3,null));};exports[_0x7f2c('0x4c')]=function(_0x5b7f63,_0x1e2b0f){return db['FaxQueueReport'][_0x7f2c('0x4c')]()[_0x7f2c('0x27')](respondWithResult(_0x1e2b0f,null))[_0x7f2c('0x47')](handleError(_0x1e2b0f,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 3c9f0e5..67af224 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(_0x5b0182,_0x1029ad){var _0x5adeed=function(_0x38d878){while(--_0x38d878){_0x5b0182['push'](_0x5b0182['shift']());}};_0x5adeed(++_0x1029ad);}(_0x4975,0x86));var _0x5497=function(_0x2953fa,_0x4d0f13){_0x2953fa=_0x2953fa-0x0;var _0x5f1c6f=_0x4975[_0x2953fa];return _0x5f1c6f;};'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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3a94d3,_0x2326f7){var _0x44ab7c=function(_0x2eba0b){while(--_0x2eba0b){_0x3a94d3['push'](_0x3a94d3['shift']());}};_0x44ab7c(++_0x2326f7);}(_0x53ec,0x192));var _0xc53e=function(_0x31038b,_0x3ac1c9){_0x31038b=_0x31038b-0x0;var _0x1c9d3c=_0x53ec[_0x31038b];return _0x1c9d3c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index c9ecdd7..22dd67d 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 _0x7213=['../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','catch','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x71e27f,_0x58d37d){var _0x27ccfb=function(_0x5b1612){while(--_0x5b1612){_0x71e27f['push'](_0x71e27f['shift']());}};_0x27ccfb(++_0x58d37d);}(_0x7213,0x163));var _0x3721=function(_0x5ac23e,_0x4c05ef){_0x5ac23e=_0x5ac23e-0x0;var _0x16a744=_0x7213[_0x5ac23e];return _0x16a744;};'use strict';var _=require(_0x3721('0x0'));var util=require(_0x3721('0x1'));var moment=require(_0x3721('0x2'));var BPromise=require('bluebird');var rs=require(_0x3721('0x3'));var fs=require('fs');var Redis=require(_0x3721('0x4'));var db=require(_0x3721('0x5'))['db'];var utils=require(_0x3721('0x6'));var logger=require(_0x3721('0x7'))('rpc');var config=require(_0x3721('0x8'));var jayson=require(_0x3721('0x9'));var client=jayson['client'][_0x3721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x231e0e,_0x35a5dd,_0x137ae7){return new BPromise(function(_0x37dd4c,_0x2c27d8){return client[_0x3721('0xb')](_0x231e0e,_0x137ae7)[_0x3721('0xc')](function(_0x4bcde5){logger[_0x3721('0xd')](_0x3721('0xe'),_0x35a5dd,_0x3721('0xf'));logger[_0x3721('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x35a5dd,'request\x20sent',JSON[_0x3721('0x11')](_0x4bcde5));if(_0x4bcde5[_0x3721('0x12')]){if(_0x4bcde5[_0x3721('0x12')][_0x3721('0x13')]===0x1f4){logger[_0x3721('0x12')](_0x3721('0xe'),_0x35a5dd,_0x4bcde5[_0x3721('0x12')][_0x3721('0x14')]);return _0x2c27d8(_0x4bcde5[_0x3721('0x12')][_0x3721('0x14')]);}logger['error'](_0x3721('0xe'),_0x35a5dd,_0x4bcde5['error'][_0x3721('0x14')]);return _0x37dd4c(_0x4bcde5[_0x3721('0x12')][_0x3721('0x14')]);}else{logger[_0x3721('0xd')](_0x3721('0xe'),_0x35a5dd,_0x3721('0xf'));_0x37dd4c(_0x4bcde5[_0x3721('0x15')][_0x3721('0x14')]);}})['catch'](function(_0x4c9ddf){logger[_0x3721('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x35a5dd,_0x4c9ddf);_0x2c27d8(_0x4c9ddf);});});}exports[_0x3721('0x16')]=function(_0x5dca47){var _0x301f38=this;return new Promise(function(_0x2afe08,_0x28944b){return db[_0x3721('0x17')][_0x3721('0x18')](_0x5dca47[_0x3721('0x19')],{'raw':_0x5dca47[_0x3721('0x1a')]?_0x5dca47[_0x3721('0x1a')][_0x3721('0x1b')]===undefined?!![]:![]:!![]})[_0x3721('0xc')](function(_0x5e5f1e){logger[_0x3721('0xd')](_0x3721('0x16'),_0x5dca47);logger[_0x3721('0x10')](_0x3721('0x16'),_0x5dca47,JSON[_0x3721('0x11')](_0x5e5f1e));_0x2afe08(_0x5e5f1e);})[_0x3721('0x1c')](function(_0x3639fd){logger['error'](_0x3721('0x16'),_0x3639fd[_0x3721('0x14')],_0x5dca47);_0x28944b(_0x301f38['error'](0x1f4,_0x3639fd[_0x3721('0x14')]));});});};exports[_0x3721('0x1d')]=function(_0x1780a4){var _0xb1e52a=this;return new Promise(function(_0x1db1ac,_0x5af69f){return db[_0x3721('0x17')][_0x3721('0x1e')](_0x1780a4[_0x3721('0x19')],{'raw':_0x1780a4[_0x3721('0x1a')]?_0x1780a4[_0x3721('0x1a')][_0x3721('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1780a4['options']?_0x1780a4[_0x3721('0x1a')]['where']||null:null,'attributes':_0x1780a4[_0x3721('0x1a')]?_0x1780a4[_0x3721('0x1a')][_0x3721('0x1f')]||null:null,'limit':_0x1780a4[_0x3721('0x1a')]?_0x1780a4[_0x3721('0x1a')][_0x3721('0x20')]||null:null})[_0x3721('0xc')](function(_0x378027){logger['info'](_0x3721('0x1d'),_0x1780a4);logger[_0x3721('0x10')](_0x3721('0x1d'),_0x1780a4,JSON[_0x3721('0x11')](_0x378027));_0x1db1ac(_0x378027);})[_0x3721('0x1c')](function(_0x3a4af1){logger[_0x3721('0x12')](_0x3721('0x1d'),_0x3a4af1[_0x3721('0x14')],_0x1780a4);_0x5af69f(_0xb1e52a['error'](0x1f4,_0x3a4af1[_0x3721('0x14')]));});});}; \ No newline at end of file +var _0xd9ec=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','stringify','UpdateFaxQueueReport','update','raw','attributes','limit','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','FaxQueueReport,\x20%s,\x20%s'];(function(_0x109dbd,_0x290d2b){var _0x395644=function(_0x5a8c2d){while(--_0x5a8c2d){_0x109dbd['push'](_0x109dbd['shift']());}};_0x395644(++_0x290d2b);}(_0xd9ec,0x173));var _0xcd9e=function(_0xc9993,_0x2e02cb){_0xc9993=_0xc9993-0x0;var _0x3ad233=_0xd9ec[_0xc9993];return _0x3ad233;};'use strict';var _=require('lodash');var util=require(_0xcd9e('0x0'));var moment=require('moment');var BPromise=require(_0xcd9e('0x1'));var rs=require(_0xcd9e('0x2'));var fs=require('fs');var Redis=require(_0xcd9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd9e('0x4'));var logger=require(_0xcd9e('0x5'))(_0xcd9e('0x6'));var config=require(_0xcd9e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcd9e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10078b,_0x70488,_0x46208f){return new BPromise(function(_0x27bbd0,_0x3abb58){return client[_0xcd9e('0x9')](_0x10078b,_0x46208f)[_0xcd9e('0xa')](function(_0x5a6a4c){logger[_0xcd9e('0xb')](_0xcd9e('0xc'),_0x70488,'request\x20sent');logger[_0xcd9e('0xd')](_0xcd9e('0xe'),_0x70488,_0xcd9e('0xf'),JSON['stringify'](_0x5a6a4c));if(_0x5a6a4c[_0xcd9e('0x10')]){if(_0x5a6a4c[_0xcd9e('0x10')][_0xcd9e('0x11')]===0x1f4){logger[_0xcd9e('0x10')](_0xcd9e('0xc'),_0x70488,_0x5a6a4c[_0xcd9e('0x10')][_0xcd9e('0x12')]);return _0x3abb58(_0x5a6a4c['error'][_0xcd9e('0x12')]);}logger[_0xcd9e('0x10')](_0xcd9e('0xc'),_0x70488,_0x5a6a4c['error'][_0xcd9e('0x12')]);return _0x27bbd0(_0x5a6a4c[_0xcd9e('0x10')]['message']);}else{logger[_0xcd9e('0xb')](_0xcd9e('0xc'),_0x70488,'request\x20sent');_0x27bbd0(_0x5a6a4c[_0xcd9e('0x13')]['message']);}})[_0xcd9e('0x14')](function(_0x576c04){logger[_0xcd9e('0x10')](_0xcd9e('0xc'),_0x70488,_0x576c04);_0x3abb58(_0x576c04);});});}exports[_0xcd9e('0x15')]=function(_0x1467da){var _0x1ba122=this;return new Promise(function(_0x3159fd,_0xb035ff){return db[_0xcd9e('0x16')][_0xcd9e('0x17')](_0x1467da[_0xcd9e('0x18')],{'raw':_0x1467da['options']?_0x1467da[_0xcd9e('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x49e60e){logger[_0xcd9e('0xb')]('CreateFaxQueueReport',_0x1467da);logger['debug']('CreateFaxQueueReport',_0x1467da,JSON[_0xcd9e('0x1a')](_0x49e60e));_0x3159fd(_0x49e60e);})[_0xcd9e('0x14')](function(_0x48cdd6){logger[_0xcd9e('0x10')](_0xcd9e('0x15'),_0x48cdd6[_0xcd9e('0x12')],_0x1467da);_0xb035ff(_0x1ba122['error'](0x1f4,_0x48cdd6[_0xcd9e('0x12')]));});});};exports[_0xcd9e('0x1b')]=function(_0x598387){var _0x37f8d2=this;return new Promise(function(_0x160d98,_0x84ae37){return db['FaxQueueReport'][_0xcd9e('0x1c')](_0x598387[_0xcd9e('0x18')],{'raw':_0x598387['options']?_0x598387[_0xcd9e('0x19')][_0xcd9e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x598387[_0xcd9e('0x19')]?_0x598387['options']['where']||null:null,'attributes':_0x598387['options']?_0x598387[_0xcd9e('0x19')][_0xcd9e('0x1e')]||null:null,'limit':_0x598387['options']?_0x598387[_0xcd9e('0x19')][_0xcd9e('0x1f')]||null:null})[_0xcd9e('0xa')](function(_0x293092){logger[_0xcd9e('0xb')](_0xcd9e('0x1b'),_0x598387);logger['debug'](_0xcd9e('0x1b'),_0x598387,JSON[_0xcd9e('0x1a')](_0x293092));_0x160d98(_0x293092);})['catch'](function(_0x428f7e){logger[_0xcd9e('0x10')](_0xcd9e('0x1b'),_0x428f7e[_0xcd9e('0x12')],_0x598387);_0x84ae37(_0x37f8d2[_0xcd9e('0x10')](0x1f4,_0x428f7e[_0xcd9e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 471e56a..f336ae7 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 _0xf33e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x42a584,_0x2d9ee3){var _0x56be59=function(_0x5809dd){while(--_0x5809dd){_0x42a584['push'](_0x42a584['shift']());}};_0x56be59(++_0x2d9ee3);}(_0xf33e,0x12a));var _0xef33=function(_0x3d938d,_0x5ed96d){_0x3d938d=_0x3d938d-0x0;var _0x2b721f=_0xf33e[_0x3d938d];return _0x2b721f;};'use strict';var multer=require(_0xef33('0x0'));var util=require(_0xef33('0x1'));var path=require(_0xef33('0x2'));var timeout=require(_0xef33('0x3'));var express=require(_0xef33('0x4'));var router=express[_0xef33('0x5')]();var fs_extra=require(_0xef33('0x6'));var auth=require(_0xef33('0x7'));var interaction=require(_0xef33('0x8'));var config=require('../../config/environment');var controller=require(_0xef33('0x9'));router[_0xef33('0xa')]('/',auth[_0xef33('0xb')](),controller[_0xef33('0xc')]);router[_0xef33('0xa')](_0xef33('0xd'),auth[_0xef33('0xb')](),controller[_0xef33('0xe')]);router['get']('/:id',auth[_0xef33('0xb')](),controller['show']);router[_0xef33('0xf')]('/',auth[_0xef33('0xb')](),controller[_0xef33('0x10')]);router[_0xef33('0x11')](_0xef33('0x12'),auth[_0xef33('0xb')](),controller[_0xef33('0x13')]);router[_0xef33('0x14')](_0xef33('0x12'),auth[_0xef33('0xb')](),controller[_0xef33('0x15')]);module[_0xef33('0x16')]=router; \ No newline at end of file +var _0x91ff=['/describe','describe','/:id','show','post','create','put','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3b994b,_0x353cf1){var _0x4a7058=function(_0x59fc4d){while(--_0x59fc4d){_0x3b994b['push'](_0x3b994b['shift']());}};_0x4a7058(++_0x353cf1);}(_0x91ff,0x1b9));var _0xf91f=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x91ff[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require('multer');var util=require(_0xf91f('0x0'));var path=require(_0xf91f('0x1'));var timeout=require(_0xf91f('0x2'));var express=require('express');var router=express[_0xf91f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf91f('0x4'));var interaction=require(_0xf91f('0x5'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xf91f('0x6')]('/',auth[_0xf91f('0x7')](),controller[_0xf91f('0x8')]);router['get'](_0xf91f('0x9'),auth[_0xf91f('0x7')](),controller[_0xf91f('0xa')]);router[_0xf91f('0x6')](_0xf91f('0xb'),auth[_0xf91f('0x7')](),controller[_0xf91f('0xc')]);router[_0xf91f('0xd')]('/',auth[_0xf91f('0x7')](),controller[_0xf91f('0xe')]);router[_0xf91f('0xf')](_0xf91f('0xb'),auth[_0xf91f('0x7')](),controller[_0xf91f('0x10')]);router['delete'](_0xf91f('0xb'),auth[_0xf91f('0x7')](),controller['destroy']);module[_0xf91f('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 55663d3..d8dc785 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4714a9,_0x2585b4){var _0x29b254=function(_0x6f8467){while(--_0x6f8467){_0x4714a9['push'](_0x4714a9['shift']());}};_0x29b254(++_0x2585b4);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x484f4b,_0x433e27){var _0x4457f1=function(_0x160609){while(--_0x160609){_0x484f4b['push'](_0x484f4b['shift']());}};_0x4457f1(++_0x433e27);}(_0xf4eb,0xec));var _0xbf4e=function(_0x25e797,_0x59986e){_0x25e797=_0x25e797-0x0;var _0x528ab1=_0xf4eb[_0x25e797];return _0x528ab1;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 98d1e41..0d81903 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 _0x620c=['limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','FaxTransferReport','rawAttributes','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0xca9c69,_0x5b1efc){var _0x22f44f=function(_0xb3e244){while(--_0xb3e244){_0xca9c69['push'](_0xca9c69['shift']());}};_0x22f44f(++_0x5b1efc);}(_0x620c,0xcd));var _0xc620=function(_0x4e70dc,_0x4db117){_0x4e70dc=_0x4e70dc-0x0;var _0x14c07f=_0x620c[_0x4e70dc];return _0x14c07f;};'use strict';var emlformat=require(_0xc620('0x0'));var rimraf=require(_0xc620('0x1'));var zipdir=require(_0xc620('0x2'));var jsonpatch=require(_0xc620('0x3'));var rp=require(_0xc620('0x4'));var moment=require('moment');var BPromise=require(_0xc620('0x5'));var Mustache=require(_0xc620('0x6'));var util=require(_0xc620('0x7'));var path=require(_0xc620('0x8'));var sox=require(_0xc620('0x9'));var csv=require(_0xc620('0xa'));var ejs=require(_0xc620('0xb'));var fs=require('fs');var fs_extra=require(_0xc620('0xc'));var _=require(_0xc620('0xd'));var squel=require(_0xc620('0xe'));var crypto=require(_0xc620('0xf'));var jsforce=require(_0xc620('0x10'));var deskjs=require(_0xc620('0x11'));var toCsv=require('to-csv');var querystring=require(_0xc620('0x12'));var Papa=require(_0xc620('0x13'));var Redis=require(_0xc620('0x14'));var authService=require(_0xc620('0x15'));var qs=require(_0xc620('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc620('0x17'));var logger=require(_0xc620('0x18'))(_0xc620('0x19'));var utils=require(_0xc620('0x1a'));var config=require(_0xc620('0x1b'));var licenseUtil=require(_0xc620('0x1c'));var db=require(_0xc620('0x1d'))['db'];function respondWithStatusCode(_0x5e025b,_0x516e50){_0x516e50=_0x516e50||0xcc;return function(_0x31581c){if(_0x31581c){return _0x5e025b[_0xc620('0x1e')](_0x516e50);}return _0x5e025b[_0xc620('0x1f')](_0x516e50)['end']();};}function respondWithResult(_0x21a5a1,_0x50b7f6){_0x50b7f6=_0x50b7f6||0xc8;return function(_0xcf3c0f){if(_0xcf3c0f){return _0x21a5a1[_0xc620('0x1f')](_0x50b7f6)[_0xc620('0x20')](_0xcf3c0f);}};}function respondWithFilteredResult(_0x18dd74,_0x460714){return function(_0x206ea3){if(_0x206ea3){var _0x4aff2f=typeof _0x460714[_0xc620('0x21')]===_0xc620('0x22')&&typeof _0x460714[_0xc620('0x23')]==='undefined';var _0x2fc2e0=_0x206ea3['count'];var _0x2956b6=_0x4aff2f?0x0:_0x460714[_0xc620('0x21')];var _0x54ae58=_0x4aff2f?_0x206ea3['count']:_0x460714[_0xc620('0x21')]+_0x460714[_0xc620('0x23')];var _0x4a5321;if(_0x54ae58>=_0x2fc2e0){_0x54ae58=_0x2fc2e0;_0x4a5321=0xc8;}else{_0x4a5321=0xce;}_0x18dd74['status'](_0x4a5321);return _0x18dd74[_0xc620('0x24')](_0xc620('0x25'),_0x2956b6+'-'+_0x54ae58+'/'+_0x2fc2e0)[_0xc620('0x20')](_0x206ea3);}return null;};}function patchUpdates(_0x1d5041){return function(_0x148056){try{jsonpatch[_0xc620('0x26')](_0x148056,_0x1d5041,!![]);}catch(_0x598242){return BPromise['reject'](_0x598242);}return _0x148056[_0xc620('0x27')]();};}function saveUpdates(_0x16620c,_0x101e67){return function(_0x1df705){if(_0x1df705){return _0x1df705[_0xc620('0x28')](_0x16620c)[_0xc620('0x29')](function(_0xa839d8){return _0xa839d8;});}return null;};}function removeEntity(_0xe49931,_0x1e31d0){return function(_0x2ff13f){if(_0x2ff13f){return _0x2ff13f[_0xc620('0x2a')]()['then'](function(){_0xe49931['status'](0xcc)[_0xc620('0x2b')]();});}};}function handleEntityNotFound(_0x2f54d1,_0x1a9d7a){return function(_0x5ebe3f){if(!_0x5ebe3f){_0x2f54d1[_0xc620('0x1e')](0x194);}return _0x5ebe3f;};}function handleError(_0x108d81,_0x106e8c){_0x106e8c=_0x106e8c||0x1f4;return function(_0x461780){logger[_0xc620('0x2c')](_0x461780[_0xc620('0x2d')]);if(_0x461780[_0xc620('0x2e')]){delete _0x461780[_0xc620('0x2e')];}_0x108d81[_0xc620('0x1f')](_0x106e8c)[_0xc620('0x2f')](_0x461780);};}exports[_0xc620('0x30')]=function(_0x2f3d81,_0x2e597f){var _0x32fb7b={},_0x5b7743={},_0x4c66a0={'count':0x0,'rows':[]};var _0x3824f6=_['map'](db[_0xc620('0x31')][_0xc620('0x32')],function(_0x51d06e){return{'name':_0x51d06e['fieldName'],'type':_0x51d06e[_0xc620('0x33')]['key']};});_0x5b7743[_0xc620('0x34')]=_[_0xc620('0x35')](_0x3824f6,_0xc620('0x2e'));_0x5b7743[_0xc620('0x36')]=_[_0xc620('0x37')](_0x2f3d81[_0xc620('0x36')]);_0x5b7743[_0xc620('0x38')]=_[_0xc620('0x39')](_0x5b7743[_0xc620('0x34')],_0x5b7743[_0xc620('0x36')]);_0x32fb7b['attributes']=_[_0xc620('0x39')](_0x5b7743[_0xc620('0x34')],qs[_0xc620('0x3a')](_0x2f3d81['query'][_0xc620('0x3a')]));_0x32fb7b[_0xc620('0x3b')]=_0x32fb7b[_0xc620('0x3b')][_0xc620('0x3c')]?_0x32fb7b[_0xc620('0x3b')]:_0x5b7743['model'];if(!_0x2f3d81[_0xc620('0x36')][_0xc620('0x3d')]('nolimit')){_0x32fb7b[_0xc620('0x23')]=qs['limit'](_0x2f3d81['query'][_0xc620('0x23')]);_0x32fb7b[_0xc620('0x21')]=qs[_0xc620('0x21')](_0x2f3d81[_0xc620('0x36')][_0xc620('0x21')]);}_0x32fb7b['order']=qs[_0xc620('0x3e')](_0x2f3d81[_0xc620('0x36')][_0xc620('0x3e')]);_0x32fb7b[_0xc620('0x3f')]=qs[_0xc620('0x38')](_[_0xc620('0x40')](_0x2f3d81[_0xc620('0x36')],_0x5b7743['filters']),_0x3824f6);if(_0x2f3d81[_0xc620('0x36')][_0xc620('0x41')]){_0x32fb7b['where']=_[_0xc620('0x42')](_0x32fb7b[_0xc620('0x3f')],{'$or':_[_0xc620('0x35')](_0x3824f6,function(_0x32f7b9){if(_0x32f7b9['type']!=='VIRTUAL'){var _0x3cb742={};_0x3cb742[_0x32f7b9['name']]={'$like':'%'+_0x2f3d81[_0xc620('0x36')][_0xc620('0x41')]+'%'};return _0x3cb742;}})});}_0x32fb7b=_[_0xc620('0x42')]({},_0x32fb7b,_0x2f3d81[_0xc620('0x43')]);var _0x378fb9={'where':_0x32fb7b[_0xc620('0x3f')]};return db[_0xc620('0x31')][_0xc620('0x44')](_0x378fb9)[_0xc620('0x29')](function(_0x10ac45){_0x4c66a0[_0xc620('0x44')]=_0x10ac45;if(_0x2f3d81[_0xc620('0x36')][_0xc620('0x45')]){_0x32fb7b[_0xc620('0x46')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xc620('0x47')](_0x32fb7b);})[_0xc620('0x29')](function(_0x4f1e92){_0x4c66a0[_0xc620('0x48')]=_0x4f1e92;return _0x4c66a0;})[_0xc620('0x29')](respondWithFilteredResult(_0x2e597f,_0x32fb7b))[_0xc620('0x49')](handleError(_0x2e597f,null));};exports[_0xc620('0x4a')]=function(_0x1eac62,_0x107768){var _0x287f72={'raw':!![],'where':{'id':_0x1eac62[_0xc620('0x4b')]['id']}},_0x32e52d={};_0x32e52d['model']=_[_0xc620('0x37')](db[_0xc620('0x31')]['rawAttributes']);_0x32e52d[_0xc620('0x36')]=_[_0xc620('0x37')](_0x1eac62['query']);_0x32e52d[_0xc620('0x38')]=_['intersection'](_0x32e52d[_0xc620('0x34')],_0x32e52d[_0xc620('0x36')]);_0x287f72[_0xc620('0x3b')]=_[_0xc620('0x39')](_0x32e52d[_0xc620('0x34')],qs['fields'](_0x1eac62[_0xc620('0x36')][_0xc620('0x3a')]));_0x287f72['attributes']=_0x287f72[_0xc620('0x3b')]['length']?_0x287f72[_0xc620('0x3b')]:_0x32e52d[_0xc620('0x34')];if(_0x1eac62['query'][_0xc620('0x45')]){_0x287f72[_0xc620('0x46')]=[{'all':!![]}];}_0x287f72=_[_0xc620('0x42')]({},_0x287f72,_0x1eac62[_0xc620('0x43')]);return db[_0xc620('0x31')][_0xc620('0x4c')](_0x287f72)[_0xc620('0x29')](handleEntityNotFound(_0x107768,null))[_0xc620('0x29')](respondWithResult(_0x107768,null))[_0xc620('0x49')](handleError(_0x107768,null));};exports['create']=function(_0x553d10,_0x15b11a){return db[_0xc620('0x31')][_0xc620('0x4d')](_0x553d10[_0xc620('0x4e')],{})[_0xc620('0x29')](respondWithResult(_0x15b11a,0xc9))['catch'](handleError(_0x15b11a,null));};exports[_0xc620('0x28')]=function(_0x541848,_0x49e529){if(_0x541848['body']['id']){delete _0x541848['body']['id'];}return db[_0xc620('0x31')][_0xc620('0x4c')]({'where':{'id':_0x541848['params']['id']}})[_0xc620('0x29')](handleEntityNotFound(_0x49e529,null))[_0xc620('0x29')](saveUpdates(_0x541848[_0xc620('0x4e')],null))[_0xc620('0x29')](respondWithResult(_0x49e529,null))['catch'](handleError(_0x49e529,null));};exports['destroy']=function(_0x14fa8,_0x4402dd){return db[_0xc620('0x31')]['find']({'where':{'id':_0x14fa8['params']['id']}})[_0xc620('0x29')](handleEntityNotFound(_0x4402dd,null))['then'](removeEntity(_0x4402dd,null))['catch'](handleError(_0x4402dd,null));};exports['describe']=function(_0x16ab49,_0x20e121){return db[_0xc620('0x31')][_0xc620('0x4f')]()[_0xc620('0x29')](respondWithResult(_0x20e121,null))['catch'](handleError(_0x20e121,null));}; \ No newline at end of file +var _0xe1a8=['then','error','stack','name','send','map','FaxTransferReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0xe1a8,0xfd));var _0x8e1a=function(_0x172b0b,_0x5600cd){_0x172b0b=_0x172b0b-0x0;var _0x2ea1e1=_0xe1a8[_0x172b0b];return _0x2ea1e1;};'use strict';var emlformat=require(_0x8e1a('0x0'));var rimraf=require(_0x8e1a('0x1'));var zipdir=require(_0x8e1a('0x2'));var jsonpatch=require(_0x8e1a('0x3'));var rp=require('request-promise');var moment=require(_0x8e1a('0x4'));var BPromise=require(_0x8e1a('0x5'));var Mustache=require(_0x8e1a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8e1a('0x7'));var csv=require(_0x8e1a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e1a('0x9'));var _=require('lodash');var squel=require(_0x8e1a('0xa'));var crypto=require(_0x8e1a('0xb'));var jsforce=require(_0x8e1a('0xc'));var deskjs=require(_0x8e1a('0xd'));var toCsv=require(_0x8e1a('0x8'));var querystring=require(_0x8e1a('0xe'));var Papa=require(_0x8e1a('0xf'));var Redis=require(_0x8e1a('0x10'));var authService=require(_0x8e1a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e1a('0x12'));var logger=require(_0x8e1a('0x13'))(_0x8e1a('0x14'));var utils=require(_0x8e1a('0x15'));var config=require(_0x8e1a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x568d74,_0x3aead0){_0x3aead0=_0x3aead0||0xcc;return function(_0x30b649){if(_0x30b649){return _0x568d74[_0x8e1a('0x17')](_0x3aead0);}return _0x568d74[_0x8e1a('0x18')](_0x3aead0)[_0x8e1a('0x19')]();};}function respondWithResult(_0x222064,_0x4ecb27){_0x4ecb27=_0x4ecb27||0xc8;return function(_0xf7717){if(_0xf7717){return _0x222064[_0x8e1a('0x18')](_0x4ecb27)['json'](_0xf7717);}};}function respondWithFilteredResult(_0x2ba4e9,_0x57f651){return function(_0x32bda4){if(_0x32bda4){var _0x330bc0=typeof _0x57f651[_0x8e1a('0x1a')]==='undefined'&&typeof _0x57f651[_0x8e1a('0x1b')]===_0x8e1a('0x1c');var _0x3bb6a8=_0x32bda4[_0x8e1a('0x1d')];var _0x1fecfb=_0x330bc0?0x0:_0x57f651[_0x8e1a('0x1a')];var _0x5e75ff=_0x330bc0?_0x32bda4['count']:_0x57f651[_0x8e1a('0x1a')]+_0x57f651[_0x8e1a('0x1b')];var _0x4c6ce6;if(_0x5e75ff>=_0x3bb6a8){_0x5e75ff=_0x3bb6a8;_0x4c6ce6=0xc8;}else{_0x4c6ce6=0xce;}_0x2ba4e9[_0x8e1a('0x18')](_0x4c6ce6);return _0x2ba4e9[_0x8e1a('0x1e')](_0x8e1a('0x1f'),_0x1fecfb+'-'+_0x5e75ff+'/'+_0x3bb6a8)[_0x8e1a('0x20')](_0x32bda4);}return null;};}function patchUpdates(_0x34f93d){return function(_0x521c92){try{jsonpatch[_0x8e1a('0x21')](_0x521c92,_0x34f93d,!![]);}catch(_0x177f2b){return BPromise[_0x8e1a('0x22')](_0x177f2b);}return _0x521c92['save']();};}function saveUpdates(_0x3f79e3,_0x5181a0){return function(_0x23648c){if(_0x23648c){return _0x23648c['update'](_0x3f79e3)[_0x8e1a('0x23')](function(_0x4ce9cc){return _0x4ce9cc;});}return null;};}function removeEntity(_0xf1bb55,_0x57593d){return function(_0x31080b){if(_0x31080b){return _0x31080b['destroy']()[_0x8e1a('0x23')](function(){_0xf1bb55[_0x8e1a('0x18')](0xcc)[_0x8e1a('0x19')]();});}};}function handleEntityNotFound(_0x1ca18d,_0x2de8ad){return function(_0x2614f8){if(!_0x2614f8){_0x1ca18d['sendStatus'](0x194);}return _0x2614f8;};}function handleError(_0x12ba57,_0x48f899){_0x48f899=_0x48f899||0x1f4;return function(_0x2f69f4){logger[_0x8e1a('0x24')](_0x2f69f4[_0x8e1a('0x25')]);if(_0x2f69f4[_0x8e1a('0x26')]){delete _0x2f69f4[_0x8e1a('0x26')];}_0x12ba57['status'](_0x48f899)[_0x8e1a('0x27')](_0x2f69f4);};}exports['index']=function(_0x1725da,_0xa99478){var _0x2ba2c1={},_0x170624={},_0x4f1c5f={'count':0x0,'rows':[]};var _0x2caab1=_[_0x8e1a('0x28')](db[_0x8e1a('0x29')][_0x8e1a('0x2a')],function(_0x2a75e0){return{'name':_0x2a75e0['fieldName'],'type':_0x2a75e0[_0x8e1a('0x2b')][_0x8e1a('0x2c')]};});_0x170624[_0x8e1a('0x2d')]=_[_0x8e1a('0x28')](_0x2caab1,'name');_0x170624[_0x8e1a('0x2e')]=_['keys'](_0x1725da['query']);_0x170624[_0x8e1a('0x2f')]=_[_0x8e1a('0x30')](_0x170624[_0x8e1a('0x2d')],_0x170624[_0x8e1a('0x2e')]);_0x2ba2c1[_0x8e1a('0x31')]=_['intersection'](_0x170624[_0x8e1a('0x2d')],qs[_0x8e1a('0x32')](_0x1725da['query'][_0x8e1a('0x32')]));_0x2ba2c1[_0x8e1a('0x31')]=_0x2ba2c1[_0x8e1a('0x31')]['length']?_0x2ba2c1[_0x8e1a('0x31')]:_0x170624[_0x8e1a('0x2d')];if(!_0x1725da['query'][_0x8e1a('0x33')]('nolimit')){_0x2ba2c1[_0x8e1a('0x1b')]=qs[_0x8e1a('0x1b')](_0x1725da['query'][_0x8e1a('0x1b')]);_0x2ba2c1['offset']=qs[_0x8e1a('0x1a')](_0x1725da[_0x8e1a('0x2e')][_0x8e1a('0x1a')]);}_0x2ba2c1[_0x8e1a('0x34')]=qs['sort'](_0x1725da[_0x8e1a('0x2e')][_0x8e1a('0x35')]);_0x2ba2c1[_0x8e1a('0x36')]=qs[_0x8e1a('0x2f')](_[_0x8e1a('0x37')](_0x1725da[_0x8e1a('0x2e')],_0x170624[_0x8e1a('0x2f')]),_0x2caab1);if(_0x1725da[_0x8e1a('0x2e')][_0x8e1a('0x38')]){_0x2ba2c1['where']=_[_0x8e1a('0x39')](_0x2ba2c1[_0x8e1a('0x36')],{'$or':_[_0x8e1a('0x28')](_0x2caab1,function(_0x24fa37){if(_0x24fa37[_0x8e1a('0x2b')]!==_0x8e1a('0x3a')){var _0x259cf2={};_0x259cf2[_0x24fa37[_0x8e1a('0x26')]]={'$like':'%'+_0x1725da['query'][_0x8e1a('0x38')]+'%'};return _0x259cf2;}})});}_0x2ba2c1=_[_0x8e1a('0x39')]({},_0x2ba2c1,_0x1725da[_0x8e1a('0x3b')]);var _0x560a68={'where':_0x2ba2c1[_0x8e1a('0x36')]};return db['FaxTransferReport']['count'](_0x560a68)[_0x8e1a('0x23')](function(_0x4a4bc9){_0x4f1c5f[_0x8e1a('0x1d')]=_0x4a4bc9;if(_0x1725da[_0x8e1a('0x2e')][_0x8e1a('0x3c')]){_0x2ba2c1[_0x8e1a('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x2ba2c1);})[_0x8e1a('0x23')](function(_0x2f75ed){_0x4f1c5f['rows']=_0x2f75ed;return _0x4f1c5f;})[_0x8e1a('0x23')](respondWithFilteredResult(_0xa99478,_0x2ba2c1))[_0x8e1a('0x3e')](handleError(_0xa99478,null));};exports[_0x8e1a('0x3f')]=function(_0x4eb2c9,_0x47078b){var _0x467a8c={'raw':!![],'where':{'id':_0x4eb2c9[_0x8e1a('0x40')]['id']}},_0x35668f={};_0x35668f[_0x8e1a('0x2d')]=_[_0x8e1a('0x41')](db[_0x8e1a('0x29')][_0x8e1a('0x2a')]);_0x35668f['query']=_[_0x8e1a('0x41')](_0x4eb2c9[_0x8e1a('0x2e')]);_0x35668f[_0x8e1a('0x2f')]=_[_0x8e1a('0x30')](_0x35668f[_0x8e1a('0x2d')],_0x35668f['query']);_0x467a8c[_0x8e1a('0x31')]=_[_0x8e1a('0x30')](_0x35668f[_0x8e1a('0x2d')],qs[_0x8e1a('0x32')](_0x4eb2c9[_0x8e1a('0x2e')][_0x8e1a('0x32')]));_0x467a8c[_0x8e1a('0x31')]=_0x467a8c[_0x8e1a('0x31')]['length']?_0x467a8c[_0x8e1a('0x31')]:_0x35668f['model'];if(_0x4eb2c9[_0x8e1a('0x2e')][_0x8e1a('0x3c')]){_0x467a8c[_0x8e1a('0x3d')]=[{'all':!![]}];}_0x467a8c=_[_0x8e1a('0x39')]({},_0x467a8c,_0x4eb2c9[_0x8e1a('0x3b')]);return db[_0x8e1a('0x29')][_0x8e1a('0x42')](_0x467a8c)[_0x8e1a('0x23')](handleEntityNotFound(_0x47078b,null))[_0x8e1a('0x23')](respondWithResult(_0x47078b,null))[_0x8e1a('0x3e')](handleError(_0x47078b,null));};exports[_0x8e1a('0x43')]=function(_0x5e3ed4,_0x1c1623){return db[_0x8e1a('0x29')]['create'](_0x5e3ed4[_0x8e1a('0x44')],{})[_0x8e1a('0x23')](respondWithResult(_0x1c1623,0xc9))[_0x8e1a('0x3e')](handleError(_0x1c1623,null));};exports[_0x8e1a('0x45')]=function(_0x1eb4ff,_0x2afd96){if(_0x1eb4ff['body']['id']){delete _0x1eb4ff[_0x8e1a('0x44')]['id'];}return db[_0x8e1a('0x29')][_0x8e1a('0x42')]({'where':{'id':_0x1eb4ff[_0x8e1a('0x40')]['id']}})[_0x8e1a('0x23')](handleEntityNotFound(_0x2afd96,null))[_0x8e1a('0x23')](saveUpdates(_0x1eb4ff[_0x8e1a('0x44')],null))[_0x8e1a('0x23')](respondWithResult(_0x2afd96,null))[_0x8e1a('0x3e')](handleError(_0x2afd96,null));};exports[_0x8e1a('0x46')]=function(_0x2f8587,_0x1653db){return db[_0x8e1a('0x29')][_0x8e1a('0x42')]({'where':{'id':_0x2f8587[_0x8e1a('0x40')]['id']}})[_0x8e1a('0x23')](handleEntityNotFound(_0x1653db,null))[_0x8e1a('0x23')](removeEntity(_0x1653db,null))['catch'](handleError(_0x1653db,null));};exports[_0x8e1a('0x47')]=function(_0x1b0227,_0xb78c0e){return db[_0x8e1a('0x29')][_0x8e1a('0x47')]()[_0x8e1a('0x23')](respondWithResult(_0xb78c0e,null))[_0x8e1a('0x3e')](handleError(_0xb78c0e,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ef4ab07..c1fcb93 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 _0xb82e=['../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x345271,_0x3c4857){var _0x271e81=function(_0x3c9b08){while(--_0x3c9b08){_0x345271['push'](_0x345271['shift']());}};_0x271e81(++_0x3c4857);}(_0xb82e,0x172));var _0xeb82=function(_0x593aa0,_0x157c23){_0x593aa0=_0x593aa0-0x0;var _0x768286=_0xb82e[_0x593aa0];return _0x768286;};'use strict';var _=require(_0xeb82('0x0'));var util=require(_0xeb82('0x1'));var logger=require(_0xeb82('0x2'))(_0xeb82('0x3'));var moment=require('moment');var BPromise=require(_0xeb82('0x4'));var rp=require(_0xeb82('0x5'));var fs=require('fs');var path=require(_0xeb82('0x6'));var rimraf=require('rimraf');var config=require(_0xeb82('0x7'));var attributes=require(_0xeb82('0x8'));module['exports']=function(_0x23f2f8,_0x26434d){return _0x23f2f8[_0xeb82('0x9')](_0xeb82('0xa'),attributes,{'tableName':_0xeb82('0xb'),'paranoid':![],'indexes':[{'name':_0xeb82('0xc'),'fields':[_0xeb82('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4bdc=['exports','define','report_fax_transfer','uniqueid','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0xfef9e0,_0x4fd0ba){var _0x1a78e9=function(_0xb1f295){while(--_0xb1f295){_0xfef9e0['push'](_0xfef9e0['shift']());}};_0x1a78e9(++_0x4fd0ba);}(_0x4bdc,0x122));var _0xc4bd=function(_0x47efbb,_0x1cc558){_0x47efbb=_0x47efbb-0x0;var _0x575b20=_0x4bdc[_0x47efbb];return _0x575b20;};'use strict';var _=require(_0xc4bd('0x0'));var util=require(_0xc4bd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc4bd('0x2'));var rp=require(_0xc4bd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4bd('0x4'));var config=require(_0xc4bd('0x5'));var attributes=require(_0xc4bd('0x6'));module[_0xc4bd('0x7')]=function(_0x39aab8,_0x3f3db4){return _0x39aab8[_0xc4bd('0x8')]('FaxTransferReport',attributes,{'tableName':_0xc4bd('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc4bd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 5d99732..e12ee17 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 _0x1a98=['jayson/promise','client','http','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x31295c,_0x2f2b82){var _0x2c150e=function(_0x957f1){while(--_0x957f1){_0x31295c['push'](_0x31295c['shift']());}};_0x2c150e(++_0x2f2b82);}(_0x1a98,0x15e));var _0x81a9=function(_0x1001c3,_0x825a9d){_0x1001c3=_0x1001c3-0x0;var _0x23778f=_0x1a98[_0x1001c3];return _0x23778f;};'use strict';var _=require(_0x81a9('0x0'));var util=require(_0x81a9('0x1'));var moment=require(_0x81a9('0x2'));var BPromise=require(_0x81a9('0x3'));var rs=require(_0x81a9('0x4'));var fs=require('fs');var Redis=require(_0x81a9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x81a9('0x6'));var logger=require(_0x81a9('0x7'))(_0x81a9('0x8'));var config=require(_0x81a9('0x9'));var jayson=require(_0x81a9('0xa'));var client=jayson[_0x81a9('0xb')][_0x81a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x516657,_0x53a12d,_0x20ab28){return new BPromise(function(_0x5b799f,_0x235236){return client['request'](_0x516657,_0x20ab28)['then'](function(_0x4cd961){logger[_0x81a9('0xd')](_0x81a9('0xe'),_0x53a12d,'request\x20sent');logger[_0x81a9('0xf')](_0x81a9('0x10'),_0x53a12d,_0x81a9('0x11'),JSON[_0x81a9('0x12')](_0x4cd961));if(_0x4cd961[_0x81a9('0x13')]){if(_0x4cd961[_0x81a9('0x13')][_0x81a9('0x14')]===0x1f4){logger[_0x81a9('0x13')](_0x81a9('0xe'),_0x53a12d,_0x4cd961[_0x81a9('0x13')][_0x81a9('0x15')]);return _0x235236(_0x4cd961['error']['message']);}logger[_0x81a9('0x13')](_0x81a9('0xe'),_0x53a12d,_0x4cd961[_0x81a9('0x13')][_0x81a9('0x15')]);return _0x5b799f(_0x4cd961['error'][_0x81a9('0x15')]);}else{logger[_0x81a9('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x53a12d,_0x81a9('0x11'));_0x5b799f(_0x4cd961[_0x81a9('0x16')][_0x81a9('0x15')]);}})[_0x81a9('0x17')](function(_0x543870){logger[_0x81a9('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x53a12d,_0x543870);_0x235236(_0x543870);});});} \ No newline at end of file +var _0xb566=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x8cf1e4,_0x2ea789){var _0x57636d=function(_0x2f81ca){while(--_0x2f81ca){_0x8cf1e4['push'](_0x8cf1e4['shift']());}};_0x57636d(++_0x2ea789);}(_0xb566,0x141));var _0x6b56=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0xb566[_0x6d6a66];return _0x11eb6e;};'use strict';var _=require('lodash');var util=require(_0x6b56('0x0'));var moment=require(_0x6b56('0x1'));var BPromise=require(_0x6b56('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b56('0x3'));var db=require(_0x6b56('0x4'))['db'];var utils=require(_0x6b56('0x5'));var logger=require(_0x6b56('0x6'))(_0x6b56('0x7'));var config=require(_0x6b56('0x8'));var jayson=require(_0x6b56('0x9'));var client=jayson[_0x6b56('0xa')][_0x6b56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x311023,_0x610903,_0x5e4ea5){return new BPromise(function(_0x23b277,_0x41f4cf){return client[_0x6b56('0xc')](_0x311023,_0x5e4ea5)[_0x6b56('0xd')](function(_0x4ac829){logger[_0x6b56('0xe')](_0x6b56('0xf'),_0x610903,_0x6b56('0x10'));logger[_0x6b56('0x11')](_0x6b56('0x12'),_0x610903,_0x6b56('0x10'),JSON[_0x6b56('0x13')](_0x4ac829));if(_0x4ac829['error']){if(_0x4ac829[_0x6b56('0x14')][_0x6b56('0x15')]===0x1f4){logger['error'](_0x6b56('0xf'),_0x610903,_0x4ac829[_0x6b56('0x14')][_0x6b56('0x16')]);return _0x41f4cf(_0x4ac829[_0x6b56('0x14')]['message']);}logger[_0x6b56('0x14')](_0x6b56('0xf'),_0x610903,_0x4ac829['error']['message']);return _0x23b277(_0x4ac829[_0x6b56('0x14')][_0x6b56('0x16')]);}else{logger[_0x6b56('0xe')](_0x6b56('0xf'),_0x610903,'request\x20sent');_0x23b277(_0x4ac829[_0x6b56('0x17')][_0x6b56('0x16')]);}})[_0x6b56('0x18')](function(_0x51ded3){logger[_0x6b56('0x14')](_0x6b56('0xf'),_0x610903,_0x51ded3);_0x41f4cf(_0x51ded3);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 9f18d0d..342c5fb 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 _0xe17c=['create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x4bad6c,_0x29ec89){var _0x46ac3b=function(_0x7f67e0){while(--_0x7f67e0){_0x4bad6c['push'](_0x4bad6c['shift']());}};_0x46ac3b(++_0x29ec89);}(_0xe17c,0x1be));var _0xce17=function(_0x24d11e,_0x13b6b0){_0x24d11e=_0x24d11e-0x0;var _0x53113c=_0xe17c[_0x24d11e];return _0x53113c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce17('0x0'));var timeout=require(_0xce17('0x1'));var express=require(_0xce17('0x2'));var router=express['Router']();var fs_extra=require(_0xce17('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xce17('0x4'));var config=require('../../config/environment');var controller=require(_0xce17('0x5'));router['get']('/',auth[_0xce17('0x6')](),controller[_0xce17('0x7')]);router['get'](_0xce17('0x8'),auth[_0xce17('0x6')](),controller[_0xce17('0x9')]);router[_0xce17('0xa')](_0xce17('0xb'),auth[_0xce17('0x6')](),controller[_0xce17('0xc')]);router[_0xce17('0xd')]('/',auth[_0xce17('0x6')](),controller[_0xce17('0xe')]);router[_0xce17('0xf')](_0xce17('0xb'),auth[_0xce17('0x6')](),controller[_0xce17('0x10')]);router[_0xce17('0x11')]('/:id',auth[_0xce17('0x6')](),controller[_0xce17('0x12')]);module[_0xce17('0x13')]=router; \ No newline at end of file +var _0x986a=['isAuthenticated','index','/describe','post','create','put','/:id','update','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get'];(function(_0x3992fa,_0x4d7c2c){var _0x4cddc4=function(_0x5baa50){while(--_0x5baa50){_0x3992fa['push'](_0x3992fa['shift']());}};_0x4cddc4(++_0x4d7c2c);}(_0x986a,0x15d));var _0xa986=function(_0x4c3699,_0x3c2c26){_0x4c3699=_0x4c3699-0x0;var _0x4e182e=_0x986a[_0x4c3699];return _0x4e182e;};'use strict';var multer=require(_0xa986('0x0'));var util=require('util');var path=require(_0xa986('0x1'));var timeout=require('connect-timeout');var express=require(_0xa986('0x2'));var router=express[_0xa986('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa986('0x4'));var interaction=require(_0xa986('0x5'));var config=require('../../config/environment');var controller=require(_0xa986('0x6'));router[_0xa986('0x7')]('/',auth[_0xa986('0x8')](),controller[_0xa986('0x9')]);router[_0xa986('0x7')](_0xa986('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa986('0x7')]('/:id',auth[_0xa986('0x8')](),controller['show']);router[_0xa986('0xb')]('/',auth[_0xa986('0x8')](),controller[_0xa986('0xc')]);router[_0xa986('0xd')](_0xa986('0xe'),auth[_0xa986('0x8')](),controller[_0xa986('0xf')]);router[_0xa986('0x10')](_0xa986('0xe'),auth[_0xa986('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index da3dc20..8f75fdc 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 _0xaec7=['get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c5b4e,_0x2326af){var _0x3a22a1=function(_0x4dbe23){while(--_0x4dbe23){_0x5c5b4e['push'](_0x5c5b4e['shift']());}};_0x3a22a1(++_0x2326af);}(_0xaec7,0x117));var _0x7aec=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xaec7[_0x4c7935];return _0x30651d;};'use strict';var multer=require(_0x7aec('0x0'));var util=require(_0x7aec('0x1'));var path=require('path');var timeout=require(_0x7aec('0x2'));var express=require(_0x7aec('0x3'));var router=express[_0x7aec('0x4')]();var fs_extra=require(_0x7aec('0x5'));var auth=require(_0x7aec('0x6'));var interaction=require(_0x7aec('0x7'));var config=require(_0x7aec('0x8'));var controller=require('./intDeskAccount.controller');router[_0x7aec('0x9')]('/',auth[_0x7aec('0xa')](),controller[_0x7aec('0xb')]);router[_0x7aec('0x9')](_0x7aec('0xc'),auth[_0x7aec('0xa')](),controller[_0x7aec('0xd')]);router[_0x7aec('0x9')]('/:id/configurations',auth[_0x7aec('0xa')](),controller[_0x7aec('0xe')]);router[_0x7aec('0x9')](_0x7aec('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x7aec('0x10')]('/',auth[_0x7aec('0xa')](),controller[_0x7aec('0x11')]);router[_0x7aec('0x10')](_0x7aec('0x12'),auth[_0x7aec('0xa')](),controller[_0x7aec('0x13')]);router['put'](_0x7aec('0xc'),auth[_0x7aec('0xa')](),controller[_0x7aec('0x14')]);router[_0x7aec('0x15')](_0x7aec('0xc'),auth[_0x7aec('0xa')](),controller[_0x7aec('0x16')]);module[_0x7aec('0x17')]=router; \ No newline at end of file +var _0x5619=['post','addConfiguration','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x5619,0x1d4));var _0x9561=function(_0x1970cd,_0xbbfebc){_0x1970cd=_0x1970cd-0x0;var _0x257a8d=_0x5619[_0x1970cd];return _0x257a8d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9561('0x0'));var timeout=require(_0x9561('0x1'));var express=require(_0x9561('0x2'));var router=express[_0x9561('0x3')]();var fs_extra=require(_0x9561('0x4'));var auth=require(_0x9561('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9561('0x6'));var controller=require(_0x9561('0x7'));router[_0x9561('0x8')]('/',auth[_0x9561('0x9')](),controller['index']);router[_0x9561('0x8')](_0x9561('0xa'),auth['isAuthenticated'](),controller[_0x9561('0xb')]);router[_0x9561('0x8')](_0x9561('0xc'),auth[_0x9561('0x9')](),controller['getConfigurations']);router[_0x9561('0x8')](_0x9561('0xd'),auth[_0x9561('0x9')](),controller[_0x9561('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9561('0xf')](_0x9561('0xc'),auth['isAuthenticated'](),controller[_0x9561('0x10')]);router[_0x9561('0x11')](_0x9561('0xa'),auth[_0x9561('0x9')](),controller[_0x9561('0x12')]);router[_0x9561('0x13')](_0x9561('0xa'),auth[_0x9561('0x9')](),controller['destroy']);module[_0x9561('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 5da17aa..4f37b75 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 _0xb603=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x1d83db,_0x89d115){var _0x2dc1d1=function(_0x13fdc3){while(--_0x13fdc3){_0x1d83db['push'](_0x1d83db['shift']());}};_0x2dc1d1(++_0x89d115);}(_0xb603,0x102));var _0x3b60=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xb603[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x3b60('0x0'));module[_0x3b60('0x1')]={'name':{'type':Sequelize[_0x3b60('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3b60('0x2')]},'authType':{'type':Sequelize[_0x3b60('0x3')]('basic'),'defaultValue':_0x3b60('0x4')},'password':{'type':Sequelize[_0x3b60('0x2')]},'consumerKey':{'type':Sequelize[_0x3b60('0x2')]},'consumerSecret':{'type':Sequelize[_0x3b60('0x2')]},'token':{'type':Sequelize[_0x3b60('0x2')]},'tokenSecret':{'type':Sequelize[_0x3b60('0x2')]},'serverUrl':{'type':Sequelize[_0x3b60('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3b60('0x3')](_0x3b60('0x5'),_0x3b60('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x23f5=['ENUM','integrationTab','newTab','exports','STRING','basic'];(function(_0x298de3,_0x43e88d){var _0x2bcf0a=function(_0x4ac970){while(--_0x4ac970){_0x298de3['push'](_0x298de3['shift']());}};_0x2bcf0a(++_0x43e88d);}(_0x23f5,0xf9));var _0x523f=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x23f5[_0x557fd2];return _0x1b54a2;};'use strict';var Sequelize=require('sequelize');module[_0x523f('0x0')]={'name':{'type':Sequelize[_0x523f('0x1')]},'description':{'type':Sequelize[_0x523f('0x1')]},'username':{'type':Sequelize[_0x523f('0x1')]},'remoteUri':{'type':Sequelize[_0x523f('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x523f('0x2')),'defaultValue':_0x523f('0x2')},'password':{'type':Sequelize[_0x523f('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x523f('0x1')]},'token':{'type':Sequelize[_0x523f('0x1')]},'tokenSecret':{'type':Sequelize[_0x523f('0x1')]},'serverUrl':{'type':Sequelize[_0x523f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x523f('0x3')](_0x523f('0x4'),_0x523f('0x5')),'defaultValue':_0x523f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 0f27872..4ed150c 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 _0xf44f=['getSubjects','Descriptions','channel','DeskField','getFields','priority','remoteUri','username','consumerSecret','tokenSecret','substring','lastIndexOf','GET','format','application/json','authType','basic','headers','Authorization','Basic\x20%s','password','toString','base64','concat','_embedded','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','DeskAccount','rawAttributes','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','params','includeAll','find','create','body','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects'];(function(_0xfc4f77,_0x476e41){var _0x4c3a9a=function(_0x395029){while(--_0x395029){_0xfc4f77['push'](_0xfc4f77['shift']());}};_0x4c3a9a(++_0x476e41);}(_0xf44f,0x1e6));var _0xff44=function(_0x59f5a6,_0x10b0eb){_0x59f5a6=_0x59f5a6-0x0;var _0x4f8254=_0xf44f[_0x59f5a6];return _0x4f8254;};'use strict';var emlformat=require(_0xff44('0x0'));var rimraf=require(_0xff44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff44('0x2'));var rp=require(_0xff44('0x3'));var moment=require(_0xff44('0x4'));var BPromise=require(_0xff44('0x5'));var Mustache=require(_0xff44('0x6'));var util=require(_0xff44('0x7'));var path=require(_0xff44('0x8'));var sox=require(_0xff44('0x9'));var csv=require(_0xff44('0xa'));var ejs=require(_0xff44('0xb'));var fs=require('fs');var fs_extra=require(_0xff44('0xc'));var _=require(_0xff44('0xd'));var squel=require(_0xff44('0xe'));var crypto=require(_0xff44('0xf'));var jsforce=require(_0xff44('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xff44('0xa'));var querystring=require('querystring');var Papa=require(_0xff44('0x11'));var Redis=require(_0xff44('0x12'));var authService=require(_0xff44('0x13'));var qs=require(_0xff44('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff44('0x15'));var logger=require('../../config/logger')(_0xff44('0x16'));var utils=require(_0xff44('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff44('0x18'));var db=require(_0xff44('0x19'))['db'];var integrations=require(_0xff44('0x1a'));function respondWithStatusCode(_0x18d8bc,_0x3f6ebd){_0x3f6ebd=_0x3f6ebd||0xcc;return function(_0x596359){if(_0x596359){return _0x18d8bc['sendStatus'](_0x3f6ebd);}return _0x18d8bc['status'](_0x3f6ebd)[_0xff44('0x1b')]();};}function respondWithResult(_0x582917,_0x4bf434){_0x4bf434=_0x4bf434||0xc8;return function(_0x15dc71){if(_0x15dc71){return _0x582917[_0xff44('0x1c')](_0x4bf434)['json'](_0x15dc71);}};}function respondWithFilteredResult(_0x3af40f,_0xc150d3){return function(_0x382424){if(_0x382424){var _0x333d66=typeof _0xc150d3[_0xff44('0x1d')]===_0xff44('0x1e')&&typeof _0xc150d3[_0xff44('0x1f')]===_0xff44('0x1e');var _0x15faba=_0x382424[_0xff44('0x20')];var _0x49b17a=_0x333d66?0x0:_0xc150d3[_0xff44('0x1d')];var _0x503312=_0x333d66?_0x382424[_0xff44('0x20')]:_0xc150d3[_0xff44('0x1d')]+_0xc150d3[_0xff44('0x1f')];var _0xd23d05;if(_0x503312>=_0x15faba){_0x503312=_0x15faba;_0xd23d05=0xc8;}else{_0xd23d05=0xce;}_0x3af40f['status'](_0xd23d05);return _0x3af40f[_0xff44('0x21')]('Content-Range',_0x49b17a+'-'+_0x503312+'/'+_0x15faba)[_0xff44('0x22')](_0x382424);}return null;};}function patchUpdates(_0x5927a0){return function(_0x491d57){try{jsonpatch[_0xff44('0x23')](_0x491d57,_0x5927a0,!![]);}catch(_0x488219){return BPromise[_0xff44('0x24')](_0x488219);}return _0x491d57[_0xff44('0x25')]();};}function saveUpdates(_0x491fd9,_0x58ed74){return function(_0x596b9e){if(_0x596b9e){return _0x596b9e[_0xff44('0x26')](_0x491fd9)['then'](function(_0x46ccfb){return _0x46ccfb;});}return null;};}function removeEntity(_0x329444,_0x235c1a){return function(_0x5c178f){if(_0x5c178f){return _0x5c178f[_0xff44('0x27')]()[_0xff44('0x28')](function(){_0x329444['status'](0xcc)[_0xff44('0x1b')]();});}};}function handleEntityNotFound(_0x26fd55,_0x91b13b){return function(_0x8813){if(!_0x8813){_0x26fd55[_0xff44('0x29')](0x194);}return _0x8813;};}function handleError(_0x1ea465,_0x3d1c97){_0x3d1c97=_0x3d1c97||0x1f4;return function(_0x10250d){logger[_0xff44('0x2a')](_0x10250d[_0xff44('0x2b')]);if(_0x10250d[_0xff44('0x2c')]){delete _0x10250d[_0xff44('0x2c')];}_0x1ea465['status'](_0x3d1c97)[_0xff44('0x2d')](_0x10250d);};}exports[_0xff44('0x2e')]=function(_0x10417e,_0x318036){var _0x18898a={},_0x1bc07a={},_0x5a4d67={'count':0x0,'rows':[]};var _0x244e38=_['map'](db[_0xff44('0x2f')][_0xff44('0x30')],function(_0x28a851){return{'name':_0x28a851['fieldName'],'type':_0x28a851['type'][_0xff44('0x31')]};});_0x1bc07a[_0xff44('0x32')]=_[_0xff44('0x33')](_0x244e38,_0xff44('0x2c'));_0x1bc07a['query']=_[_0xff44('0x34')](_0x10417e['query']);_0x1bc07a[_0xff44('0x35')]=_[_0xff44('0x36')](_0x1bc07a[_0xff44('0x32')],_0x1bc07a[_0xff44('0x37')]);_0x18898a[_0xff44('0x38')]=_[_0xff44('0x36')](_0x1bc07a[_0xff44('0x32')],qs[_0xff44('0x39')](_0x10417e['query'][_0xff44('0x39')]));_0x18898a[_0xff44('0x38')]=_0x18898a[_0xff44('0x38')][_0xff44('0x3a')]?_0x18898a[_0xff44('0x38')]:_0x1bc07a[_0xff44('0x32')];if(!_0x10417e['query'][_0xff44('0x3b')](_0xff44('0x3c'))){_0x18898a['limit']=qs['limit'](_0x10417e[_0xff44('0x37')][_0xff44('0x1f')]);_0x18898a[_0xff44('0x1d')]=qs[_0xff44('0x1d')](_0x10417e[_0xff44('0x37')][_0xff44('0x1d')]);}_0x18898a['order']=qs[_0xff44('0x3d')](_0x10417e[_0xff44('0x37')][_0xff44('0x3d')]);_0x18898a[_0xff44('0x3e')]=qs[_0xff44('0x35')](_[_0xff44('0x3f')](_0x10417e[_0xff44('0x37')],_0x1bc07a['filters']),_0x244e38);if(_0x10417e[_0xff44('0x37')][_0xff44('0x40')]){_0x18898a[_0xff44('0x3e')]=_[_0xff44('0x41')](_0x18898a[_0xff44('0x3e')],{'$or':_[_0xff44('0x33')](_0x244e38,function(_0x3bd219){if(_0x3bd219[_0xff44('0x42')]!=='VIRTUAL'){var _0x49e1ab={};_0x49e1ab[_0x3bd219[_0xff44('0x2c')]]={'$like':'%'+_0x10417e[_0xff44('0x37')]['filter']+'%'};return _0x49e1ab;}})});}_0x18898a=_[_0xff44('0x41')]({},_0x18898a,_0x10417e[_0xff44('0x43')]);var _0x37ed38={'where':_0x18898a[_0xff44('0x3e')]};return db[_0xff44('0x2f')][_0xff44('0x20')](_0x37ed38)[_0xff44('0x28')](function(_0x29b289){_0x5a4d67[_0xff44('0x20')]=_0x29b289;if(_0x10417e[_0xff44('0x37')]['includeAll']){_0x18898a[_0xff44('0x44')]=[{'all':!![]}];}return db[_0xff44('0x2f')][_0xff44('0x45')](_0x18898a);})['then'](function(_0x3ccadd){_0x5a4d67[_0xff44('0x46')]=_0x3ccadd;return _0x5a4d67;})['then'](respondWithFilteredResult(_0x318036,_0x18898a))[_0xff44('0x47')](handleError(_0x318036,null));};exports['show']=function(_0x211b6a,_0x3975a){var _0x27bafc={'raw':![],'where':{'id':_0x211b6a[_0xff44('0x48')]['id']}},_0x23ae99={};_0x23ae99['model']=_[_0xff44('0x34')](db['DeskAccount'][_0xff44('0x30')]);_0x23ae99['query']=_['keys'](_0x211b6a['query']);_0x23ae99[_0xff44('0x35')]=_['intersection'](_0x23ae99[_0xff44('0x32')],_0x23ae99['query']);_0x27bafc['attributes']=_[_0xff44('0x36')](_0x23ae99[_0xff44('0x32')],qs[_0xff44('0x39')](_0x211b6a[_0xff44('0x37')][_0xff44('0x39')]));_0x27bafc[_0xff44('0x38')]=_0x27bafc[_0xff44('0x38')]['length']?_0x27bafc[_0xff44('0x38')]:_0x23ae99[_0xff44('0x32')];if(_0x211b6a[_0xff44('0x37')][_0xff44('0x49')]){_0x27bafc['include']=[{'all':!![]}];}_0x27bafc=_[_0xff44('0x41')]({},_0x27bafc,_0x211b6a[_0xff44('0x43')]);return db[_0xff44('0x2f')][_0xff44('0x4a')](_0x27bafc)[_0xff44('0x28')](handleEntityNotFound(_0x3975a,null))['then'](respondWithResult(_0x3975a,null))[_0xff44('0x47')](handleError(_0x3975a,null));};exports['create']=function(_0x3da6cd,_0x1f6adf){return db[_0xff44('0x2f')][_0xff44('0x4b')](_0x3da6cd[_0xff44('0x4c')],{})[_0xff44('0x28')](respondWithResult(_0x1f6adf,0xc9))[_0xff44('0x47')](handleError(_0x1f6adf,null));};exports['update']=function(_0x3c19a6,_0x88e110){if(_0x3c19a6[_0xff44('0x4c')]['id']){delete _0x3c19a6['body']['id'];}return db['DeskAccount'][_0xff44('0x4a')]({'where':{'id':_0x3c19a6[_0xff44('0x48')]['id']}})[_0xff44('0x28')](handleEntityNotFound(_0x88e110,null))[_0xff44('0x28')](saveUpdates(_0x3c19a6[_0xff44('0x4c')],null))[_0xff44('0x28')](respondWithResult(_0x88e110,null))[_0xff44('0x47')](handleError(_0x88e110,null));};exports[_0xff44('0x27')]=function(_0x3a7e83,_0xdb7c44){return db[_0xff44('0x2f')]['find']({'where':{'id':_0x3a7e83['params']['id']}})[_0xff44('0x28')](handleEntityNotFound(_0xdb7c44,null))[_0xff44('0x28')](removeEntity(_0xdb7c44,null))[_0xff44('0x47')](handleError(_0xdb7c44,null));};exports[_0xff44('0x4d')]=function(_0x8d6642,_0x230d7c,_0x18bf49){var _0x364666={};var _0x524bbb={};var _0x30cf9e;var _0x128c42;return db[_0xff44('0x2f')][_0xff44('0x4e')]({'where':{'id':_0x8d6642[_0xff44('0x48')]['id']}})[_0xff44('0x28')](handleEntityNotFound(_0x230d7c,null))[_0xff44('0x28')](function(_0x2cb4f2){if(_0x2cb4f2){_0x30cf9e=_0x2cb4f2;_0x524bbb[_0xff44('0x32')]=_['keys'](db[_0xff44('0x4f')][_0xff44('0x30')]);_0x524bbb['query']=_[_0xff44('0x34')](_0x8d6642[_0xff44('0x37')]);_0x524bbb[_0xff44('0x35')]=_[_0xff44('0x36')](_0x524bbb[_0xff44('0x32')],_0x524bbb[_0xff44('0x37')]);_0x364666[_0xff44('0x38')]=_[_0xff44('0x36')](_0x524bbb[_0xff44('0x32')],qs[_0xff44('0x39')](_0x8d6642[_0xff44('0x37')][_0xff44('0x39')]));_0x364666[_0xff44('0x38')]=_0x364666[_0xff44('0x38')][_0xff44('0x3a')]?_0x364666[_0xff44('0x38')]:_0x524bbb[_0xff44('0x32')];_0x364666[_0xff44('0x50')]=qs[_0xff44('0x3d')](_0x8d6642[_0xff44('0x37')]['sort']);_0x364666[_0xff44('0x3e')]=qs[_0xff44('0x35')](_[_0xff44('0x3f')](_0x8d6642[_0xff44('0x37')],_0x524bbb[_0xff44('0x35')]));if(_0x8d6642[_0xff44('0x37')][_0xff44('0x40')]){_0x364666[_0xff44('0x3e')]=_['merge'](_0x364666[_0xff44('0x3e')],{'$or':_[_0xff44('0x33')](_0x364666[_0xff44('0x38')],function(_0x604632){var _0x1e63ad={};_0x1e63ad[_0x604632]={'$like':'%'+_0x8d6642[_0xff44('0x37')]['filter']+'%'};return _0x1e63ad;})});}_0x364666=_['merge']({},_0x364666,_0x8d6642['options']);return _0x30cf9e[_0xff44('0x4d')](_0x364666);}})[_0xff44('0x28')](function(_0x8208b9){if(_0x8208b9){_0x128c42=_0x8208b9[_0xff44('0x3a')];if(!_0x8d6642[_0xff44('0x37')]['hasOwnProperty'](_0xff44('0x3c'))){_0x364666[_0xff44('0x1f')]=qs[_0xff44('0x1f')](_0x8d6642[_0xff44('0x37')][_0xff44('0x1f')]);_0x364666[_0xff44('0x1d')]=qs[_0xff44('0x1d')](_0x8d6642[_0xff44('0x37')][_0xff44('0x1d')]);}return _0x30cf9e[_0xff44('0x4d')](_0x364666);}})[_0xff44('0x28')](function(_0x5cdd63){if(_0x5cdd63){return _0x5cdd63?{'count':_0x128c42,'rows':_0x5cdd63}:null;}})[_0xff44('0x28')](respondWithResult(_0x230d7c,null))['catch'](handleError(_0x230d7c,null));};exports[_0xff44('0x51')]=function(_0x1c0931,_0xeb183,_0x59285d){if(_0x1c0931[_0xff44('0x4c')]['id']){delete _0x1c0931[_0xff44('0x4c')]['id'];}return db[_0xff44('0x2f')][_0xff44('0x4e')]({'where':{'id':_0x1c0931[_0xff44('0x48')]['id']}})[_0xff44('0x28')](handleEntityNotFound(_0xeb183,null))['then'](function(_0x2abaac){if(_0x2abaac){_0x1c0931[_0xff44('0x4c')][_0xff44('0x52')]=_0x2abaac['id'];_0x1c0931[_0xff44('0x4c')][_0xff44('0x53')]=integrations[_0xff44('0x54')](_0x1c0931['body']['channel'],_0x1c0931['body']['type']);_0x1c0931[_0xff44('0x4c')][_0xff44('0x55')]=integrations['getDescriptions'](_0x1c0931['body'][_0xff44('0x56')],_0x1c0931[_0xff44('0x4c')][_0xff44('0x42')]);return db[_0xff44('0x4f')][_0xff44('0x4b')](_0x1c0931[_0xff44('0x4c')],{'include':[{'model':db[_0xff44('0x57')],'as':'Subjects'},{'model':db['DeskField'],'as':_0xff44('0x55')}]});}return null;})[_0xff44('0x28')](respondWithResult(_0xeb183,null))[_0xff44('0x47')](handleError(_0xeb183,null));};exports[_0xff44('0x58')]=function(_0x4a6964,_0x4c242e,_0x6fe622){var _0x206f01=[{'name':_0xff44('0x59'),'label':_0xff44('0x59'),'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 _0x553823='';return db[_0xff44('0x2f')][_0xff44('0x4e')]({'where':{'id':_0x4a6964[_0xff44('0x48')]['id']},'attributes':['id',_0xff44('0x5a'),'authType',_0xff44('0x5b'),'password','consumerKey',_0xff44('0x5c'),'token',_0xff44('0x5d')]})[_0xff44('0x28')](handleEntityNotFound(_0x4c242e,null))[_0xff44('0x28')](function(_0x16633c){if(_0x16633c){_0x553823=_0x16633c[_0xff44('0x5a')];var _0x1d5d3c=_0x553823['slice'](-0x1);if(_0x1d5d3c==='/'){_0x553823=_0x553823[_0xff44('0x5e')](0x0,_0x553823[_0xff44('0x5f')](_0x1d5d3c));}var _0x46d943={'method':_0xff44('0x60'),'uri':util[_0xff44('0x61')]('%s/custom_fields',_0x553823),'headers':{'Content-Type':_0xff44('0x62'),'Accept':_0xff44('0x62')},'json':!![]};if(_0x16633c[_0xff44('0x63')]===_0xff44('0x64')){_0x46d943[_0xff44('0x65')][_0xff44('0x66')]=util['format'](_0xff44('0x67'),new Buffer(util['format']('%s:%s',_0x16633c['username'],_0x16633c[_0xff44('0x68')]))[_0xff44('0x69')](_0xff44('0x6a')));}return rp(_0x46d943)[_0xff44('0x28')](function(_0x4f39e3){return _0x206f01[_0xff44('0x6b')](_[_0xff44('0x33')](_0x4f39e3[_0xff44('0x6c')]['entries'],function(_0x97bab){return{'id':_0x97bab[_0xff44('0x2c')],'name':_0x97bab[_0xff44('0x2c')],'type':_0x97bab['type'],'active':_0x97bab['active'],'label':_0x97bab['label'],'custom':!![]};}));});}})[_0xff44('0x28')](function(_0x421466){return{'count':_0x421466['length'],'rows':_0x421466};})['then'](respondWithResult(_0x4c242e,null))[_0xff44('0x47')](function(_0x13f604){var _0x377200=_0x4a6964[_0xff44('0x37')]['test']?0x1f4:_0x13f604[_0xff44('0x6d')]||0x1f4;logger['error'](_0xff44('0x6e'),_0xff44('0x58'),_0x377200,JSON[_0xff44('0x6f')](_0x13f604));delete _0x13f604['name'];if(_0x377200===0x191){_0x377200=0x190;}_0x4c242e[_0xff44('0x1c')](_0x377200)['send'](_0x4a6964['query'][_0xff44('0x70')]?{'message':_0xff44('0x71'),'statusCode':_0x13f604[_0xff44('0x6d')]}:_0x13f604);});}; \ No newline at end of file +var _0xa9ee=['filter','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','DeskConfiguration','order','pick','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','util','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','offset','reject','save','update','then','destroy','error','name','index','map','DeskAccount','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort'];(function(_0x17ffd0,_0x49ee4f){var _0x86f7c0=function(_0x545e6a){while(--_0x545e6a){_0x17ffd0['push'](_0x17ffd0['shift']());}};_0x86f7c0(++_0x49ee4f);}(_0xa9ee,0xa9));var _0xea9e=function(_0x6d2f9d,_0x59eb92){_0x6d2f9d=_0x6d2f9d-0x0;var _0x49a959=_0xa9ee[_0x6d2f9d];return _0x49a959;};'use strict';var emlformat=require(_0xea9e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea9e('0x1'));var rp=require(_0xea9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea9e('0x3'));var path=require('path');var sox=require(_0xea9e('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea9e('0x5'));var _=require('lodash');var squel=require(_0xea9e('0x6'));var crypto=require(_0xea9e('0x7'));var jsforce=require(_0xea9e('0x8'));var deskjs=require(_0xea9e('0x9'));var toCsv=require('to-csv');var querystring=require(_0xea9e('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xea9e('0xb'));var qs=require(_0xea9e('0xc'));var as=require(_0xea9e('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea9e('0xe'))(_0xea9e('0xf'));var utils=require(_0xea9e('0x10'));var config=require(_0xea9e('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xea9e('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x411db2,_0x2fa657){_0x2fa657=_0x2fa657||0xcc;return function(_0x301571){if(_0x301571){return _0x411db2[_0xea9e('0x13')](_0x2fa657);}return _0x411db2['status'](_0x2fa657)[_0xea9e('0x14')]();};}function respondWithResult(_0x12e17f,_0x39cba0){_0x39cba0=_0x39cba0||0xc8;return function(_0x466cd0){if(_0x466cd0){return _0x12e17f[_0xea9e('0x15')](_0x39cba0)[_0xea9e('0x16')](_0x466cd0);}};}function respondWithFilteredResult(_0x20cdc8,_0x566220){return function(_0x1a0596){if(_0x1a0596){var _0x3a7c66=typeof _0x566220['offset']==='undefined'&&typeof _0x566220[_0xea9e('0x17')]==='undefined';var _0x2c36e2=_0x1a0596['count'];var _0x3ce69a=_0x3a7c66?0x0:_0x566220[_0xea9e('0x18')];var _0x222398=_0x3a7c66?_0x1a0596['count']:_0x566220[_0xea9e('0x18')]+_0x566220[_0xea9e('0x17')];var _0x466b04;if(_0x222398>=_0x2c36e2){_0x222398=_0x2c36e2;_0x466b04=0xc8;}else{_0x466b04=0xce;}_0x20cdc8[_0xea9e('0x15')](_0x466b04);return _0x20cdc8['set']('Content-Range',_0x3ce69a+'-'+_0x222398+'/'+_0x2c36e2)['json'](_0x1a0596);}return null;};}function patchUpdates(_0x2a2a5c){return function(_0xede2d2){try{jsonpatch['apply'](_0xede2d2,_0x2a2a5c,!![]);}catch(_0x3d06e3){return BPromise[_0xea9e('0x19')](_0x3d06e3);}return _0xede2d2[_0xea9e('0x1a')]();};}function saveUpdates(_0x516a09,_0xe81795){return function(_0x2689d6){if(_0x2689d6){return _0x2689d6[_0xea9e('0x1b')](_0x516a09)[_0xea9e('0x1c')](function(_0x2ba6fe){return _0x2ba6fe;});}return null;};}function removeEntity(_0x102c46,_0x1e32de){return function(_0x3c7908){if(_0x3c7908){return _0x3c7908[_0xea9e('0x1d')]()[_0xea9e('0x1c')](function(){_0x102c46['status'](0xcc)[_0xea9e('0x14')]();});}};}function handleEntityNotFound(_0x44d595,_0x431d7f){return function(_0x57a40c){if(!_0x57a40c){_0x44d595['sendStatus'](0x194);}return _0x57a40c;};}function handleError(_0x43e1f1,_0x2d95d6){_0x2d95d6=_0x2d95d6||0x1f4;return function(_0xe4d4a6){logger[_0xea9e('0x1e')](_0xe4d4a6['stack']);if(_0xe4d4a6[_0xea9e('0x1f')]){delete _0xe4d4a6[_0xea9e('0x1f')];}_0x43e1f1[_0xea9e('0x15')](_0x2d95d6)['send'](_0xe4d4a6);};}exports[_0xea9e('0x20')]=function(_0x509c1d,_0x1cf308){var _0x23647f={},_0x1a1f56={},_0x679bf={'count':0x0,'rows':[]};var _0x29d541=_[_0xea9e('0x21')](db[_0xea9e('0x22')]['rawAttributes'],function(_0x35228d){return{'name':_0x35228d[_0xea9e('0x23')],'type':_0x35228d[_0xea9e('0x24')][_0xea9e('0x25')]};});_0x1a1f56[_0xea9e('0x26')]=_['map'](_0x29d541,'name');_0x1a1f56[_0xea9e('0x27')]=_['keys'](_0x509c1d['query']);_0x1a1f56[_0xea9e('0x28')]=_['intersection'](_0x1a1f56['model'],_0x1a1f56[_0xea9e('0x27')]);_0x23647f[_0xea9e('0x29')]=_[_0xea9e('0x2a')](_0x1a1f56['model'],qs[_0xea9e('0x2b')](_0x509c1d['query']['fields']));_0x23647f[_0xea9e('0x29')]=_0x23647f[_0xea9e('0x29')][_0xea9e('0x2c')]?_0x23647f[_0xea9e('0x29')]:_0x1a1f56[_0xea9e('0x26')];if(!_0x509c1d[_0xea9e('0x27')]['hasOwnProperty'](_0xea9e('0x2d'))){_0x23647f[_0xea9e('0x17')]=qs['limit'](_0x509c1d[_0xea9e('0x27')]['limit']);_0x23647f[_0xea9e('0x18')]=qs[_0xea9e('0x18')](_0x509c1d[_0xea9e('0x27')][_0xea9e('0x18')]);}_0x23647f['order']=qs[_0xea9e('0x2e')](_0x509c1d[_0xea9e('0x27')]['sort']);_0x23647f['where']=qs[_0xea9e('0x28')](_['pick'](_0x509c1d['query'],_0x1a1f56['filters']),_0x29d541);if(_0x509c1d[_0xea9e('0x27')][_0xea9e('0x2f')]){_0x23647f[_0xea9e('0x30')]=_[_0xea9e('0x31')](_0x23647f[_0xea9e('0x30')],{'$or':_[_0xea9e('0x21')](_0x29d541,function(_0x550a89){if(_0x550a89[_0xea9e('0x24')]!==_0xea9e('0x32')){var _0x175998={};_0x175998[_0x550a89[_0xea9e('0x1f')]]={'$like':'%'+_0x509c1d[_0xea9e('0x27')][_0xea9e('0x2f')]+'%'};return _0x175998;}})});}_0x23647f=_[_0xea9e('0x31')]({},_0x23647f,_0x509c1d['options']);var _0x10ad2a={'where':_0x23647f[_0xea9e('0x30')]};return db[_0xea9e('0x22')][_0xea9e('0x33')](_0x10ad2a)[_0xea9e('0x1c')](function(_0x5b5c52){_0x679bf[_0xea9e('0x33')]=_0x5b5c52;if(_0x509c1d['query'][_0xea9e('0x34')]){_0x23647f[_0xea9e('0x35')]=[{'all':!![]}];}return db[_0xea9e('0x22')][_0xea9e('0x36')](_0x23647f);})['then'](function(_0x4abfcc){_0x679bf[_0xea9e('0x37')]=_0x4abfcc;return _0x679bf;})['then'](respondWithFilteredResult(_0x1cf308,_0x23647f))[_0xea9e('0x38')](handleError(_0x1cf308,null));};exports[_0xea9e('0x39')]=function(_0x2bbdde,_0x52c078){var _0x2f5b0d={'raw':![],'where':{'id':_0x2bbdde[_0xea9e('0x3a')]['id']}},_0x4ca024={};_0x4ca024[_0xea9e('0x26')]=_[_0xea9e('0x3b')](db[_0xea9e('0x22')][_0xea9e('0x3c')]);_0x4ca024[_0xea9e('0x27')]=_[_0xea9e('0x3b')](_0x2bbdde[_0xea9e('0x27')]);_0x4ca024['filters']=_[_0xea9e('0x2a')](_0x4ca024[_0xea9e('0x26')],_0x4ca024[_0xea9e('0x27')]);_0x2f5b0d[_0xea9e('0x29')]=_[_0xea9e('0x2a')](_0x4ca024[_0xea9e('0x26')],qs[_0xea9e('0x2b')](_0x2bbdde[_0xea9e('0x27')][_0xea9e('0x2b')]));_0x2f5b0d[_0xea9e('0x29')]=_0x2f5b0d['attributes']['length']?_0x2f5b0d[_0xea9e('0x29')]:_0x4ca024[_0xea9e('0x26')];if(_0x2bbdde['query'][_0xea9e('0x34')]){_0x2f5b0d[_0xea9e('0x35')]=[{'all':!![]}];}_0x2f5b0d=_[_0xea9e('0x31')]({},_0x2f5b0d,_0x2bbdde[_0xea9e('0x3d')]);return db[_0xea9e('0x22')][_0xea9e('0x3e')](_0x2f5b0d)[_0xea9e('0x1c')](handleEntityNotFound(_0x52c078,null))['then'](respondWithResult(_0x52c078,null))[_0xea9e('0x38')](handleError(_0x52c078,null));};exports[_0xea9e('0x3f')]=function(_0x308c4c,_0x39a71c){return db['DeskAccount'][_0xea9e('0x3f')](_0x308c4c[_0xea9e('0x40')],{})[_0xea9e('0x1c')](respondWithResult(_0x39a71c,0xc9))[_0xea9e('0x38')](handleError(_0x39a71c,null));};exports[_0xea9e('0x1b')]=function(_0x387696,_0x1d1cdb){if(_0x387696[_0xea9e('0x40')]['id']){delete _0x387696[_0xea9e('0x40')]['id'];}return db['DeskAccount'][_0xea9e('0x3e')]({'where':{'id':_0x387696['params']['id']}})['then'](handleEntityNotFound(_0x1d1cdb,null))[_0xea9e('0x1c')](saveUpdates(_0x387696[_0xea9e('0x40')],null))[_0xea9e('0x1c')](respondWithResult(_0x1d1cdb,null))[_0xea9e('0x38')](handleError(_0x1d1cdb,null));};exports[_0xea9e('0x1d')]=function(_0x33b697,_0x38efed){return db['DeskAccount']['find']({'where':{'id':_0x33b697[_0xea9e('0x3a')]['id']}})[_0xea9e('0x1c')](handleEntityNotFound(_0x38efed,null))[_0xea9e('0x1c')](removeEntity(_0x38efed,null))[_0xea9e('0x38')](handleError(_0x38efed,null));};exports['getConfigurations']=function(_0x4d3e9a,_0x1fc449,_0xab17fc){var _0x1fa27b={};var _0x3d8e56={};var _0x1ac02b;var _0x586f80;return db[_0xea9e('0x22')]['findOne']({'where':{'id':_0x4d3e9a[_0xea9e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1fc449,null))[_0xea9e('0x1c')](function(_0x1f8b4a){if(_0x1f8b4a){_0x1ac02b=_0x1f8b4a;_0x3d8e56[_0xea9e('0x26')]=_[_0xea9e('0x3b')](db[_0xea9e('0x41')][_0xea9e('0x3c')]);_0x3d8e56['query']=_[_0xea9e('0x3b')](_0x4d3e9a[_0xea9e('0x27')]);_0x3d8e56['filters']=_['intersection'](_0x3d8e56[_0xea9e('0x26')],_0x3d8e56[_0xea9e('0x27')]);_0x1fa27b['attributes']=_[_0xea9e('0x2a')](_0x3d8e56[_0xea9e('0x26')],qs[_0xea9e('0x2b')](_0x4d3e9a['query'][_0xea9e('0x2b')]));_0x1fa27b['attributes']=_0x1fa27b[_0xea9e('0x29')][_0xea9e('0x2c')]?_0x1fa27b[_0xea9e('0x29')]:_0x3d8e56[_0xea9e('0x26')];_0x1fa27b[_0xea9e('0x42')]=qs[_0xea9e('0x2e')](_0x4d3e9a[_0xea9e('0x27')][_0xea9e('0x2e')]);_0x1fa27b[_0xea9e('0x30')]=qs[_0xea9e('0x28')](_[_0xea9e('0x43')](_0x4d3e9a[_0xea9e('0x27')],_0x3d8e56[_0xea9e('0x28')]));if(_0x4d3e9a[_0xea9e('0x27')][_0xea9e('0x2f')]){_0x1fa27b[_0xea9e('0x30')]=_[_0xea9e('0x31')](_0x1fa27b[_0xea9e('0x30')],{'$or':_['map'](_0x1fa27b[_0xea9e('0x29')],function(_0x3c7b5f){var _0x417edd={};_0x417edd[_0x3c7b5f]={'$like':'%'+_0x4d3e9a[_0xea9e('0x27')][_0xea9e('0x2f')]+'%'};return _0x417edd;})});}_0x1fa27b=_[_0xea9e('0x31')]({},_0x1fa27b,_0x4d3e9a[_0xea9e('0x3d')]);return _0x1ac02b[_0xea9e('0x44')](_0x1fa27b);}})[_0xea9e('0x1c')](function(_0xf38ec6){if(_0xf38ec6){_0x586f80=_0xf38ec6[_0xea9e('0x2c')];if(!_0x4d3e9a[_0xea9e('0x27')][_0xea9e('0x45')](_0xea9e('0x2d'))){_0x1fa27b[_0xea9e('0x17')]=qs[_0xea9e('0x17')](_0x4d3e9a[_0xea9e('0x27')][_0xea9e('0x17')]);_0x1fa27b['offset']=qs[_0xea9e('0x18')](_0x4d3e9a[_0xea9e('0x27')][_0xea9e('0x18')]);}return _0x1ac02b[_0xea9e('0x44')](_0x1fa27b);}})['then'](function(_0x2fc59f){if(_0x2fc59f){return _0x2fc59f?{'count':_0x586f80,'rows':_0x2fc59f}:null;}})[_0xea9e('0x1c')](respondWithResult(_0x1fc449,null))[_0xea9e('0x38')](handleError(_0x1fc449,null));};exports[_0xea9e('0x46')]=function(_0x495314,_0x584dd4,_0x1101c4){if(_0x495314[_0xea9e('0x40')]['id']){delete _0x495314[_0xea9e('0x40')]['id'];}return db[_0xea9e('0x22')][_0xea9e('0x47')]({'where':{'id':_0x495314[_0xea9e('0x3a')]['id']}})[_0xea9e('0x1c')](handleEntityNotFound(_0x584dd4,null))[_0xea9e('0x1c')](function(_0x1869ea){if(_0x1869ea){_0x495314[_0xea9e('0x40')][_0xea9e('0x48')]=_0x1869ea['id'];_0x495314['body'][_0xea9e('0x49')]=integrations[_0xea9e('0x4a')](_0x495314[_0xea9e('0x40')][_0xea9e('0x4b')],_0x495314['body']['type']);_0x495314[_0xea9e('0x40')][_0xea9e('0x4c')]=integrations['getDescriptions'](_0x495314[_0xea9e('0x40')][_0xea9e('0x4b')],_0x495314[_0xea9e('0x40')][_0xea9e('0x24')]);return db['DeskConfiguration'][_0xea9e('0x3f')](_0x495314[_0xea9e('0x40')],{'include':[{'model':db['DeskField'],'as':_0xea9e('0x49')},{'model':db[_0xea9e('0x4d')],'as':_0xea9e('0x4c')}]});}return null;})[_0xea9e('0x1c')](respondWithResult(_0x584dd4,null))[_0xea9e('0x38')](handleError(_0x584dd4,null));};exports[_0xea9e('0x4e')]=function(_0x5b60f5,_0x413664,_0x514a48){var _0x15ec9d=[{'name':'priority','label':_0xea9e('0x4f'),'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 _0x11dd7f='';return db[_0xea9e('0x22')][_0xea9e('0x47')]({'where':{'id':_0x5b60f5[_0xea9e('0x3a')]['id']},'attributes':['id',_0xea9e('0x50'),_0xea9e('0x51'),_0xea9e('0x52'),_0xea9e('0x53'),_0xea9e('0x54'),_0xea9e('0x55'),_0xea9e('0x56'),_0xea9e('0x57')]})[_0xea9e('0x1c')](handleEntityNotFound(_0x413664,null))[_0xea9e('0x1c')](function(_0x136612){if(_0x136612){_0x11dd7f=_0x136612[_0xea9e('0x50')];var _0x18c192=_0x11dd7f['slice'](-0x1);if(_0x18c192==='/'){_0x11dd7f=_0x11dd7f[_0xea9e('0x58')](0x0,_0x11dd7f[_0xea9e('0x59')](_0x18c192));}var _0x28343d={'method':_0xea9e('0x5a'),'uri':util['format']('%s/custom_fields',_0x11dd7f),'headers':{'Content-Type':'application/json','Accept':_0xea9e('0x5b')},'json':!![]};if(_0x136612['authType']===_0xea9e('0x5c')){_0x28343d[_0xea9e('0x5d')][_0xea9e('0x5e')]=util[_0xea9e('0x5f')](_0xea9e('0x60'),new Buffer(util['format'](_0xea9e('0x61'),_0x136612['username'],_0x136612[_0xea9e('0x53')]))[_0xea9e('0x62')]('base64'));}return rp(_0x28343d)[_0xea9e('0x1c')](function(_0x139dad){return _0x15ec9d[_0xea9e('0x63')](_[_0xea9e('0x21')](_0x139dad[_0xea9e('0x64')][_0xea9e('0x65')],function(_0x262776){return{'id':_0x262776['name'],'name':_0x262776[_0xea9e('0x1f')],'type':_0x262776[_0xea9e('0x24')],'active':_0x262776['active'],'label':_0x262776[_0xea9e('0x66')],'custom':!![]};}));});}})[_0xea9e('0x1c')](function(_0x52bbf5){return{'count':_0x52bbf5[_0xea9e('0x2c')],'rows':_0x52bbf5};})[_0xea9e('0x1c')](respondWithResult(_0x413664,null))['catch'](function(_0x39b945){var _0x5dd562=_0x5b60f5[_0xea9e('0x27')][_0xea9e('0x67')]?0x1f4:_0x39b945['statusCode']||0x1f4;logger['error'](_0xea9e('0x68'),_0xea9e('0x4e'),_0x5dd562,JSON[_0xea9e('0x69')](_0x39b945));delete _0x39b945[_0xea9e('0x1f')];if(_0x5dd562===0x191){_0x5dd562=0x190;}_0x413664['status'](_0x5dd562)[_0xea9e('0x6a')](_0x5b60f5[_0xea9e('0x27')]['test']?{'message':_0xea9e('0x6b'),'statusCode':_0x39b945['statusCode']}:_0x39b945);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e583a75..378a0d6 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 _0xb4f0=['define','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x57d058,_0x56b505){var _0x26cfc9=function(_0x38739d){while(--_0x38739d){_0x57d058['push'](_0x57d058['shift']());}};_0x26cfc9(++_0x56b505);}(_0xb4f0,0x11a));var _0x0b4f=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb4f0[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x0b4f('0x0'));var util=require(_0x0b4f('0x1'));var logger=require(_0x0b4f('0x2'))(_0x0b4f('0x3'));var moment=require(_0x0b4f('0x4'));var BPromise=require(_0x0b4f('0x5'));var rp=require(_0x0b4f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b4f('0x7'));var config=require(_0x0b4f('0x8'));var attributes=require(_0x0b4f('0x9'));var integrations=require(_0x0b4f('0xa'));module[_0x0b4f('0xb')]=function(_0xf3e63,_0x5f9345){return _0xf3e63[_0x0b4f('0xc')]('DeskAccount',attributes,{'tableName':_0x0b4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16e8=['rimraf','../../config/environment','./intDeskAccount.attributes','exports','DeskAccount','lodash','../../config/logger','moment','request-promise','path'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x16e8,0x9b));var _0x816e=function(_0x25a6f0,_0x2da337){_0x25a6f0=_0x25a6f0-0x0;var _0x216494=_0x16e8[_0x25a6f0];return _0x216494;};'use strict';var _=require(_0x816e('0x0'));var util=require('util');var logger=require(_0x816e('0x1'))('api');var moment=require(_0x816e('0x2'));var BPromise=require('bluebird');var rp=require(_0x816e('0x3'));var fs=require('fs');var path=require(_0x816e('0x4'));var rimraf=require(_0x816e('0x5'));var config=require(_0x816e('0x6'));var attributes=require(_0x816e('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x816e('0x8')]=function(_0x53becc,_0x311abd){return _0x53becc['define'](_0x816e('0x9'),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 d9a56d4..71e9138 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 _0x69bf=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','info','result','catch','DeskAccount','findAll','options','raw','where','attributes','include','map','model','GetDeskAccount','ShowDeskAccount','then','lodash','util','moment','bluebird','ioredis'];(function(_0x2b7389,_0x58311b){var _0xe5d9da=function(_0xecec75){while(--_0xecec75){_0x2b7389['push'](_0x2b7389['shift']());}};_0xe5d9da(++_0x58311b);}(_0x69bf,0x12d));var _0xf69b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x69bf[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf69b('0x0'));var util=require(_0xf69b('0x1'));var moment=require(_0xf69b('0x2'));var BPromise=require(_0xf69b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf69b('0x4'));var db=require(_0xf69b('0x5'))['db'];var utils=require(_0xf69b('0x6'));var logger=require(_0xf69b('0x7'))('rpc');var config=require(_0xf69b('0x8'));var jayson=require(_0xf69b('0x9'));var client=jayson[_0xf69b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2a1a,_0x5f18ec,_0xe1ef2a){return new BPromise(function(_0x57a818,_0x7f7254){return client[_0xf69b('0xb')](_0x1a2a1a,_0xe1ef2a)['then'](function(_0x4df703){logger['info']('DeskAccount,\x20%s,\x20%s',_0x5f18ec,_0xf69b('0xc'));logger[_0xf69b('0xd')](_0xf69b('0xe'),_0x5f18ec,_0xf69b('0xc'),JSON[_0xf69b('0xf')](_0x4df703));if(_0x4df703['error']){if(_0x4df703['error']['code']===0x1f4){logger[_0xf69b('0x10')](_0xf69b('0x11'),_0x5f18ec,_0x4df703[_0xf69b('0x10')][_0xf69b('0x12')]);return _0x7f7254(_0x4df703[_0xf69b('0x10')]['message']);}logger[_0xf69b('0x10')]('DeskAccount,\x20%s,\x20%s',_0x5f18ec,_0x4df703[_0xf69b('0x10')]['message']);return _0x57a818(_0x4df703[_0xf69b('0x10')][_0xf69b('0x12')]);}else{logger[_0xf69b('0x13')]('DeskAccount,\x20%s,\x20%s',_0x5f18ec,_0xf69b('0xc'));_0x57a818(_0x4df703[_0xf69b('0x14')][_0xf69b('0x12')]);}})[_0xf69b('0x15')](function(_0x341d34){logger[_0xf69b('0x10')](_0xf69b('0x11'),_0x5f18ec,_0x341d34);_0x7f7254(_0x341d34);});});}exports['GetDeskAccount']=function(_0x4f8cfc){var _0x3b28f7=this;return new Promise(function(_0x27a958,_0x1707f6){return db[_0xf69b('0x16')][_0xf69b('0x17')]({'raw':_0x4f8cfc[_0xf69b('0x18')]?_0x4f8cfc[_0xf69b('0x18')][_0xf69b('0x19')]===undefined?!![]:![]:!![],'where':_0x4f8cfc[_0xf69b('0x18')]?_0x4f8cfc[_0xf69b('0x18')][_0xf69b('0x1a')]||null:null,'attributes':_0x4f8cfc[_0xf69b('0x18')]?_0x4f8cfc[_0xf69b('0x18')][_0xf69b('0x1b')]||null:null,'limit':_0x4f8cfc[_0xf69b('0x18')]?_0x4f8cfc[_0xf69b('0x18')]['limit']||null:null,'include':_0x4f8cfc[_0xf69b('0x18')]?_0x4f8cfc[_0xf69b('0x18')]['include']?_['map'](_0x4f8cfc[_0xf69b('0x18')]['include'],function(_0xc22b1){return{'model':db[_0xc22b1['model']],'as':_0xc22b1['as'],'attributes':_0xc22b1['attributes'],'include':_0xc22b1[_0xf69b('0x1c')]?_[_0xf69b('0x1d')](_0xc22b1[_0xf69b('0x1c')],function(_0x1dccef){return{'model':db[_0x1dccef['model']],'as':_0x1dccef['as'],'attributes':_0x1dccef[_0xf69b('0x1b')],'include':_0x1dccef['include']?_['map'](_0x1dccef[_0xf69b('0x1c')],function(_0x5d4f8b){return{'model':db[_0x5d4f8b[_0xf69b('0x1e')]],'as':_0x5d4f8b['as'],'attributes':_0x5d4f8b[_0xf69b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa7d774){logger[_0xf69b('0x13')](_0xf69b('0x1f'),_0x4f8cfc);logger[_0xf69b('0xd')]('GetDeskAccount',_0x4f8cfc,JSON[_0xf69b('0xf')](_0xa7d774));_0x27a958(_0xa7d774);})[_0xf69b('0x15')](function(_0x4e2981){logger[_0xf69b('0x10')](_0xf69b('0x1f'),_0x4e2981[_0xf69b('0x12')],_0x4f8cfc);_0x1707f6(_0x3b28f7[_0xf69b('0x10')](0x1f4,_0x4e2981[_0xf69b('0x12')]));});});};exports[_0xf69b('0x20')]=function(_0x129ccb){var _0x4e1d81=this;return new Promise(function(_0x22dfa1,_0x26a8f0){return db[_0xf69b('0x16')]['find']({'raw':_0x129ccb[_0xf69b('0x18')]?_0x129ccb['options'][_0xf69b('0x19')]===undefined?!![]:![]:!![],'where':_0x129ccb[_0xf69b('0x18')]?_0x129ccb[_0xf69b('0x18')]['where']||null:null,'attributes':_0x129ccb[_0xf69b('0x18')]?_0x129ccb[_0xf69b('0x18')]['attributes']||null:null,'include':_0x129ccb['options']?_0x129ccb['options'][_0xf69b('0x1c')]?_[_0xf69b('0x1d')](_0x129ccb[_0xf69b('0x18')][_0xf69b('0x1c')],function(_0xd810c6){return{'model':db[_0xd810c6[_0xf69b('0x1e')]],'as':_0xd810c6['as'],'attributes':_0xd810c6[_0xf69b('0x1b')],'include':_0xd810c6['include']?_['map'](_0xd810c6[_0xf69b('0x1c')],function(_0x40ebee){return{'model':db[_0x40ebee[_0xf69b('0x1e')]],'as':_0x40ebee['as'],'attributes':_0x40ebee['attributes'],'include':_0x40ebee['include']?_[_0xf69b('0x1d')](_0x40ebee['include'],function(_0x1ab208){return{'model':db[_0x1ab208[_0xf69b('0x1e')]],'as':_0x1ab208['as'],'attributes':_0x1ab208['attributes']};}):[]};}):[]};}):[]:[]})[_0xf69b('0x21')](function(_0x30f196){logger['info'](_0xf69b('0x20'),_0x129ccb);logger[_0xf69b('0xd')](_0xf69b('0x20'),_0x129ccb,JSON[_0xf69b('0xf')](_0x30f196));_0x22dfa1(_0x30f196);})[_0xf69b('0x15')](function(_0x3fa629){logger[_0xf69b('0x10')](_0xf69b('0x20'),_0x3fa629[_0xf69b('0x12')],_0x129ccb);_0x26a8f0(_0x4e1d81['error'](0x1f4,_0x3fa629[_0xf69b('0x12')]));});});}; \ No newline at end of file +var _0xabfa=['rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowDeskAccount','find','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x515380,_0x546b77){var _0x3cd646=function(_0x56ee41){while(--_0x56ee41){_0x515380['push'](_0x515380['shift']());}};_0x3cd646(++_0x546b77);}(_0xabfa,0x1b3));var _0xaabf=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xabfa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0xaabf('0x0'));var moment=require(_0xaabf('0x1'));var BPromise=require('bluebird');var rs=require(_0xaabf('0x2'));var fs=require('fs');var Redis=require(_0xaabf('0x3'));var db=require(_0xaabf('0x4'))['db'];var utils=require(_0xaabf('0x5'));var logger=require(_0xaabf('0x6'))(_0xaabf('0x7'));var config=require(_0xaabf('0x8'));var jayson=require(_0xaabf('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42106b,_0x3f8d40,_0x2dc017){return new BPromise(function(_0x31a247,_0x53aca6){return client['request'](_0x42106b,_0x2dc017)['then'](function(_0x2d627d){logger[_0xaabf('0xa')]('DeskAccount,\x20%s,\x20%s',_0x3f8d40,_0xaabf('0xb'));logger[_0xaabf('0xc')](_0xaabf('0xd'),_0x3f8d40,_0xaabf('0xb'),JSON[_0xaabf('0xe')](_0x2d627d));if(_0x2d627d[_0xaabf('0xf')]){if(_0x2d627d[_0xaabf('0xf')][_0xaabf('0x10')]===0x1f4){logger[_0xaabf('0xf')](_0xaabf('0x11'),_0x3f8d40,_0x2d627d[_0xaabf('0xf')][_0xaabf('0x12')]);return _0x53aca6(_0x2d627d[_0xaabf('0xf')][_0xaabf('0x12')]);}logger['error'](_0xaabf('0x11'),_0x3f8d40,_0x2d627d[_0xaabf('0xf')][_0xaabf('0x12')]);return _0x31a247(_0x2d627d[_0xaabf('0xf')][_0xaabf('0x12')]);}else{logger[_0xaabf('0xa')]('DeskAccount,\x20%s,\x20%s',_0x3f8d40,'request\x20sent');_0x31a247(_0x2d627d[_0xaabf('0x13')]['message']);}})['catch'](function(_0x52b707){logger[_0xaabf('0xf')]('DeskAccount,\x20%s,\x20%s',_0x3f8d40,_0x52b707);_0x53aca6(_0x52b707);});});}exports[_0xaabf('0x14')]=function(_0x2aa0df){var _0x49dafa=this;return new Promise(function(_0x53e9f7,_0xeb215c){return db[_0xaabf('0x15')][_0xaabf('0x16')]({'raw':_0x2aa0df[_0xaabf('0x17')]?_0x2aa0df[_0xaabf('0x17')][_0xaabf('0x18')]===undefined?!![]:![]:!![],'where':_0x2aa0df[_0xaabf('0x17')]?_0x2aa0df['options'][_0xaabf('0x19')]||null:null,'attributes':_0x2aa0df[_0xaabf('0x17')]?_0x2aa0df[_0xaabf('0x17')][_0xaabf('0x1a')]||null:null,'limit':_0x2aa0df['options']?_0x2aa0df[_0xaabf('0x17')]['limit']||null:null,'include':_0x2aa0df['options']?_0x2aa0df[_0xaabf('0x17')][_0xaabf('0x1b')]?_[_0xaabf('0x1c')](_0x2aa0df[_0xaabf('0x17')]['include'],function(_0x5f30ab){return{'model':db[_0x5f30ab[_0xaabf('0x1d')]],'as':_0x5f30ab['as'],'attributes':_0x5f30ab['attributes'],'include':_0x5f30ab[_0xaabf('0x1b')]?_[_0xaabf('0x1c')](_0x5f30ab['include'],function(_0x2ea481){return{'model':db[_0x2ea481[_0xaabf('0x1d')]],'as':_0x2ea481['as'],'attributes':_0x2ea481[_0xaabf('0x1a')],'include':_0x2ea481[_0xaabf('0x1b')]?_[_0xaabf('0x1c')](_0x2ea481[_0xaabf('0x1b')],function(_0x4fd856){return{'model':db[_0x4fd856[_0xaabf('0x1d')]],'as':_0x4fd856['as'],'attributes':_0x4fd856[_0xaabf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xaabf('0x1e')](function(_0x2711c4){logger[_0xaabf('0xa')]('GetDeskAccount',_0x2aa0df);logger[_0xaabf('0xc')](_0xaabf('0x14'),_0x2aa0df,JSON[_0xaabf('0xe')](_0x2711c4));_0x53e9f7(_0x2711c4);})['catch'](function(_0x5228d0){logger['error'](_0xaabf('0x14'),_0x5228d0[_0xaabf('0x12')],_0x2aa0df);_0xeb215c(_0x49dafa[_0xaabf('0xf')](0x1f4,_0x5228d0['message']));});});};exports[_0xaabf('0x1f')]=function(_0x334ad3){var _0x1c9dad=this;return new Promise(function(_0x25b127,_0x40b856){return db[_0xaabf('0x15')][_0xaabf('0x20')]({'raw':_0x334ad3[_0xaabf('0x17')]?_0x334ad3[_0xaabf('0x17')][_0xaabf('0x18')]===undefined?!![]:![]:!![],'where':_0x334ad3[_0xaabf('0x17')]?_0x334ad3[_0xaabf('0x17')][_0xaabf('0x19')]||null:null,'attributes':_0x334ad3[_0xaabf('0x17')]?_0x334ad3[_0xaabf('0x17')]['attributes']||null:null,'include':_0x334ad3['options']?_0x334ad3[_0xaabf('0x17')]['include']?_[_0xaabf('0x1c')](_0x334ad3[_0xaabf('0x17')][_0xaabf('0x1b')],function(_0x420a5d){return{'model':db[_0x420a5d[_0xaabf('0x1d')]],'as':_0x420a5d['as'],'attributes':_0x420a5d[_0xaabf('0x1a')],'include':_0x420a5d[_0xaabf('0x1b')]?_['map'](_0x420a5d[_0xaabf('0x1b')],function(_0x7ef16d){return{'model':db[_0x7ef16d['model']],'as':_0x7ef16d['as'],'attributes':_0x7ef16d[_0xaabf('0x1a')],'include':_0x7ef16d[_0xaabf('0x1b')]?_['map'](_0x7ef16d[_0xaabf('0x1b')],function(_0xf0354d){return{'model':db[_0xf0354d['model']],'as':_0xf0354d['as'],'attributes':_0xf0354d[_0xaabf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xaabf('0x1e')](function(_0x510c21){logger['info']('ShowDeskAccount',_0x334ad3);logger[_0xaabf('0xc')](_0xaabf('0x1f'),_0x334ad3,JSON['stringify'](_0x510c21));_0x25b127(_0x510c21);})[_0xaabf('0x21')](function(_0x40928d){logger[_0xaabf('0xf')](_0xaabf('0x1f'),_0x40928d[_0xaabf('0x12')],_0x334ad3);_0x40b856(_0x1c9dad[_0xaabf('0xf')](0x1f4,_0x40928d['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 420b764..3b7bc9b 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(_0x3fb316,_0x458362){var _0x318ce3=function(_0x3e82f4){while(--_0x3e82f4){_0x3fb316['push'](_0x3fb316['shift']());}};_0x318ce3(++_0x458362);}(_0x008c,0x188));var _0xc008=function(_0xea81a1,_0xb28e9e){_0xea81a1=_0xea81a1-0x0;var _0x2cd030=_0x008c[_0xea81a1];return _0x2cd030;};'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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x55aa06,_0x2e288f){var _0x267d72=function(_0x1a58f0){while(--_0x1a58f0){_0x55aa06['push'](_0x55aa06['shift']());}};_0x267d72(++_0x2e288f);}(_0x3e74,0x175));var _0x43e7=function(_0x258351,_0x46990f){_0x258351=_0x258351-0x0;var _0x1f2408=_0x3e74[_0x258351];return _0x1f2408;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4093a0b..4ec92fa 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 _0xe2eb=['sequelize','exports','STRING'];(function(_0x51c578,_0x4cb9bb){var _0x59d490=function(_0xe1625){while(--_0xe1625){_0x51c578['push'](_0x51c578['shift']());}};_0x59d490(++_0x4cb9bb);}(_0xe2eb,0xfc));var _0xbe2e=function(_0x1476ea,_0x1fec4f){_0x1476ea=_0x1476ea-0x0;var _0x20e562=_0xe2eb[_0x1476ea];return _0x20e562;};'use strict';var Sequelize=require(_0xbe2e('0x0'));module[_0xbe2e('0x1')]={'name':{'type':Sequelize[_0xbe2e('0x2')]},'description':{'type':Sequelize[_0xbe2e('0x2')]}}; \ No newline at end of file +var _0xb836=['sequelize','exports','STRING'];(function(_0x44ffeb,_0x1aa2ce){var _0x222237=function(_0x1ca99a){while(--_0x1ca99a){_0x44ffeb['push'](_0x44ffeb['shift']());}};_0x222237(++_0x1aa2ce);}(_0xb836,0x147));var _0x6b83=function(_0x4a2c8e,_0x26e5c8){_0x4a2c8e=_0x4a2c8e-0x0;var _0xc6f2b3=_0xb836[_0x4a2c8e];return _0xc6f2b3;};'use strict';var Sequelize=require(_0x6b83('0x0'));module[_0x6b83('0x1')]={'name':{'type':Sequelize[_0x6b83('0x2')]},'description':{'type':Sequelize[_0x6b83('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index e05cd89..1abaf03 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 _0xcde2=['set','Content-Range','apply','reject','update','then','end','error','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','getFields','findOne','pick','DeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x2ce446,_0x1c3675){var _0xc4f45e=function(_0x2eb2ca){while(--_0x2eb2ca){_0x2ce446['push'](_0x2ce446['shift']());}};_0xc4f45e(++_0x1c3675);}(_0xcde2,0x89));var _0x2cde=function(_0x2269cf,_0x8212e7){_0x2269cf=_0x2269cf-0x0;var _0x24b711=_0xcde2[_0x2269cf];return _0x24b711;};'use strict';var emlformat=require(_0x2cde('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cde('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cde('0x2'));var moment=require(_0x2cde('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2cde('0x4'));var util=require(_0x2cde('0x5'));var path=require(_0x2cde('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2cde('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cde('0x8'));var squel=require(_0x2cde('0x9'));var crypto=require(_0x2cde('0xa'));var jsforce=require(_0x2cde('0xb'));var deskjs=require(_0x2cde('0xc'));var toCsv=require(_0x2cde('0xd'));var querystring=require(_0x2cde('0xe'));var Papa=require('papaparse');var Redis=require(_0x2cde('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cde('0x10'));var hardwareService=require(_0x2cde('0x11'));var logger=require(_0x2cde('0x12'))(_0x2cde('0x13'));var utils=require('../../config/utils');var config=require(_0x2cde('0x14'));var licenseUtil=require(_0x2cde('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37e9f7,_0x429e85){_0x429e85=_0x429e85||0xcc;return function(_0x4c44b3){if(_0x4c44b3){return _0x37e9f7[_0x2cde('0x16')](_0x429e85);}return _0x37e9f7['status'](_0x429e85)['end']();};}function respondWithResult(_0x2698f8,_0x149c32){_0x149c32=_0x149c32||0xc8;return function(_0x411617){if(_0x411617){return _0x2698f8[_0x2cde('0x17')](_0x149c32)[_0x2cde('0x18')](_0x411617);}};}function respondWithFilteredResult(_0x49e5d4,_0x2b43b0){return function(_0x1777f4){if(_0x1777f4){var _0x4c5d60=typeof _0x2b43b0[_0x2cde('0x19')]===_0x2cde('0x1a')&&typeof _0x2b43b0[_0x2cde('0x1b')]===_0x2cde('0x1a');var _0x482e7c=_0x1777f4[_0x2cde('0x1c')];var _0x47a382=_0x4c5d60?0x0:_0x2b43b0[_0x2cde('0x19')];var _0x24ecfe=_0x4c5d60?_0x1777f4['count']:_0x2b43b0[_0x2cde('0x19')]+_0x2b43b0[_0x2cde('0x1b')];var _0x4bd7e9;if(_0x24ecfe>=_0x482e7c){_0x24ecfe=_0x482e7c;_0x4bd7e9=0xc8;}else{_0x4bd7e9=0xce;}_0x49e5d4[_0x2cde('0x17')](_0x4bd7e9);return _0x49e5d4[_0x2cde('0x1d')](_0x2cde('0x1e'),_0x47a382+'-'+_0x24ecfe+'/'+_0x482e7c)[_0x2cde('0x18')](_0x1777f4);}return null;};}function patchUpdates(_0x29e729){return function(_0x2b87ff){try{jsonpatch[_0x2cde('0x1f')](_0x2b87ff,_0x29e729,!![]);}catch(_0x23073f){return BPromise[_0x2cde('0x20')](_0x23073f);}return _0x2b87ff['save']();};}function saveUpdates(_0x378755,_0x318eb8){return function(_0x428b29){if(_0x428b29){return _0x428b29[_0x2cde('0x21')](_0x378755)[_0x2cde('0x22')](function(_0x20c455){return _0x20c455;});}return null;};}function removeEntity(_0x5dd6c8,_0x149da1){return function(_0xba4f9a){if(_0xba4f9a){return _0xba4f9a['destroy']()[_0x2cde('0x22')](function(){_0x5dd6c8[_0x2cde('0x17')](0xcc)[_0x2cde('0x23')]();});}};}function handleEntityNotFound(_0x26d784,_0x4f5bad){return function(_0x4903c8){if(!_0x4903c8){_0x26d784['sendStatus'](0x194);}return _0x4903c8;};}function handleError(_0x4073f9,_0x47f14d){_0x47f14d=_0x47f14d||0x1f4;return function(_0x282362){logger[_0x2cde('0x24')](_0x282362['stack']);if(_0x282362[_0x2cde('0x25')]){delete _0x282362[_0x2cde('0x25')];}_0x4073f9[_0x2cde('0x17')](_0x47f14d)[_0x2cde('0x26')](_0x282362);};}exports[_0x2cde('0x27')]=function(_0x1a41fe,_0x33076d){var _0x53e5eb={},_0x3c0725={},_0x1e6115={'count':0x0,'rows':[]};var _0x12a8ac=_['map'](db[_0x2cde('0x28')][_0x2cde('0x29')],function(_0x2620a9){return{'name':_0x2620a9[_0x2cde('0x2a')],'type':_0x2620a9[_0x2cde('0x2b')]['key']};});_0x3c0725[_0x2cde('0x2c')]=_[_0x2cde('0x2d')](_0x12a8ac,_0x2cde('0x25'));_0x3c0725[_0x2cde('0x2e')]=_['keys'](_0x1a41fe[_0x2cde('0x2e')]);_0x3c0725[_0x2cde('0x2f')]=_[_0x2cde('0x30')](_0x3c0725[_0x2cde('0x2c')],_0x3c0725[_0x2cde('0x2e')]);_0x53e5eb[_0x2cde('0x31')]=_[_0x2cde('0x30')](_0x3c0725[_0x2cde('0x2c')],qs[_0x2cde('0x32')](_0x1a41fe[_0x2cde('0x2e')]['fields']));_0x53e5eb[_0x2cde('0x31')]=_0x53e5eb[_0x2cde('0x31')][_0x2cde('0x33')]?_0x53e5eb['attributes']:_0x3c0725['model'];if(!_0x1a41fe[_0x2cde('0x2e')][_0x2cde('0x34')](_0x2cde('0x35'))){_0x53e5eb[_0x2cde('0x1b')]=qs[_0x2cde('0x1b')](_0x1a41fe[_0x2cde('0x2e')][_0x2cde('0x1b')]);_0x53e5eb['offset']=qs[_0x2cde('0x19')](_0x1a41fe['query'][_0x2cde('0x19')]);}_0x53e5eb[_0x2cde('0x36')]=qs[_0x2cde('0x37')](_0x1a41fe[_0x2cde('0x2e')][_0x2cde('0x37')]);_0x53e5eb[_0x2cde('0x38')]=qs[_0x2cde('0x2f')](_['pick'](_0x1a41fe['query'],_0x3c0725['filters']),_0x12a8ac);if(_0x1a41fe[_0x2cde('0x2e')][_0x2cde('0x39')]){_0x53e5eb['where']=_[_0x2cde('0x3a')](_0x53e5eb[_0x2cde('0x38')],{'$or':_[_0x2cde('0x2d')](_0x12a8ac,function(_0x44f3e3){if(_0x44f3e3[_0x2cde('0x2b')]!==_0x2cde('0x3b')){var _0xb8ffde={};_0xb8ffde[_0x44f3e3[_0x2cde('0x25')]]={'$like':'%'+_0x1a41fe[_0x2cde('0x2e')]['filter']+'%'};return _0xb8ffde;}})});}_0x53e5eb=_['merge']({},_0x53e5eb,_0x1a41fe[_0x2cde('0x3c')]);var _0x34c641={'where':_0x53e5eb['where']};return db['DeskConfiguration']['count'](_0x34c641)[_0x2cde('0x22')](function(_0x496dcf){_0x1e6115[_0x2cde('0x1c')]=_0x496dcf;if(_0x1a41fe[_0x2cde('0x2e')][_0x2cde('0x3d')]){_0x53e5eb[_0x2cde('0x3e')]=[{'all':!![]}];}return db[_0x2cde('0x28')][_0x2cde('0x3f')](_0x53e5eb);})[_0x2cde('0x22')](function(_0x4bcde1){_0x1e6115[_0x2cde('0x40')]=_0x4bcde1;return _0x1e6115;})[_0x2cde('0x22')](respondWithFilteredResult(_0x33076d,_0x53e5eb))[_0x2cde('0x41')](handleError(_0x33076d,null));};exports[_0x2cde('0x42')]=function(_0x1330ee,_0x351b4a){var _0x44b5e={'raw':![],'where':{'id':_0x1330ee[_0x2cde('0x43')]['id']}},_0x358453={};_0x358453[_0x2cde('0x2c')]=_['keys'](db['DeskConfiguration'][_0x2cde('0x29')]);_0x358453[_0x2cde('0x2e')]=_[_0x2cde('0x44')](_0x1330ee[_0x2cde('0x2e')]);_0x358453[_0x2cde('0x2f')]=_[_0x2cde('0x30')](_0x358453[_0x2cde('0x2c')],_0x358453['query']);_0x44b5e['attributes']=_[_0x2cde('0x30')](_0x358453['model'],qs[_0x2cde('0x32')](_0x1330ee[_0x2cde('0x2e')][_0x2cde('0x32')]));_0x44b5e[_0x2cde('0x31')]=_0x44b5e['attributes'][_0x2cde('0x33')]?_0x44b5e['attributes']:_0x358453['model'];if(_0x1330ee[_0x2cde('0x2e')]['includeAll']){_0x44b5e[_0x2cde('0x3e')]=[{'all':!![]}];}_0x44b5e=_[_0x2cde('0x3a')]({},_0x44b5e,_0x1330ee[_0x2cde('0x3c')]);return db[_0x2cde('0x28')]['find'](_0x44b5e)['then'](handleEntityNotFound(_0x351b4a,null))[_0x2cde('0x22')](respondWithResult(_0x351b4a,null))['catch'](handleError(_0x351b4a,null));};exports['create']=function(_0x2c33eb,_0x24af4b){return db[_0x2cde('0x28')][_0x2cde('0x45')](_0x2c33eb[_0x2cde('0x46')],{})[_0x2cde('0x22')](respondWithResult(_0x24af4b,0xc9))[_0x2cde('0x41')](handleError(_0x24af4b,null));};exports[_0x2cde('0x21')]=function(_0x280c7b,_0x186115){if(_0x280c7b[_0x2cde('0x46')]['id']){delete _0x280c7b[_0x2cde('0x46')]['id'];}return db[_0x2cde('0x28')][_0x2cde('0x47')]({'where':{'id':_0x280c7b['params']['id']}})[_0x2cde('0x22')](handleEntityNotFound(_0x186115,null))[_0x2cde('0x22')](saveUpdates(_0x280c7b['body'],null))[_0x2cde('0x22')](respondWithResult(_0x186115,null))[_0x2cde('0x41')](handleError(_0x186115,null));};exports[_0x2cde('0x48')]=function(_0x2f85ef,_0x45e8a1){return db[_0x2cde('0x28')]['find']({'where':{'id':_0x2f85ef['params']['id']}})['then'](handleEntityNotFound(_0x45e8a1,null))[_0x2cde('0x22')](removeEntity(_0x45e8a1,null))['catch'](handleError(_0x45e8a1,null));};exports[_0x2cde('0x49')]=function(_0x5dceb1,_0x9f3a8f,_0x4737fd){var _0x5080b7={};var _0x2dbcc0={};var _0x58704c;var _0x33406e;return db[_0x2cde('0x28')][_0x2cde('0x4a')]({'where':{'id':_0x5dceb1[_0x2cde('0x43')]['id']}})['then'](handleEntityNotFound(_0x9f3a8f,null))[_0x2cde('0x22')](function(_0x5a47f8){if(_0x5a47f8){_0x58704c=_0x5a47f8;_0x2dbcc0[_0x2cde('0x2c')]=_[_0x2cde('0x44')](db['DeskField'][_0x2cde('0x29')]);_0x2dbcc0[_0x2cde('0x2e')]=_[_0x2cde('0x44')](_0x5dceb1[_0x2cde('0x2e')]);_0x2dbcc0['filters']=_[_0x2cde('0x30')](_0x2dbcc0['model'],_0x2dbcc0[_0x2cde('0x2e')]);_0x5080b7[_0x2cde('0x31')]=_[_0x2cde('0x30')](_0x2dbcc0[_0x2cde('0x2c')],qs[_0x2cde('0x32')](_0x5dceb1[_0x2cde('0x2e')][_0x2cde('0x32')]));_0x5080b7['attributes']=_0x5080b7[_0x2cde('0x31')][_0x2cde('0x33')]?_0x5080b7[_0x2cde('0x31')]:_0x2dbcc0[_0x2cde('0x2c')];_0x5080b7[_0x2cde('0x36')]=qs['sort'](_0x5dceb1[_0x2cde('0x2e')]['sort']);_0x5080b7['where']=qs[_0x2cde('0x2f')](_[_0x2cde('0x4b')](_0x5dceb1[_0x2cde('0x2e')],_0x2dbcc0['filters']));if(_0x5dceb1[_0x2cde('0x2e')][_0x2cde('0x39')]){_0x5080b7['where']=_[_0x2cde('0x3a')](_0x5080b7[_0x2cde('0x38')],{'$or':_['map'](_0x5080b7[_0x2cde('0x31')],function(_0x549a37){var _0x3fab15={};_0x3fab15[_0x549a37]={'$like':'%'+_0x5dceb1[_0x2cde('0x2e')][_0x2cde('0x39')]+'%'};return _0x3fab15;})});}_0x5080b7=_[_0x2cde('0x3a')]({},_0x5080b7,_0x5dceb1[_0x2cde('0x3c')]);return _0x58704c[_0x2cde('0x49')](_0x5080b7);}})[_0x2cde('0x22')](function(_0x323fc1){if(_0x323fc1){_0x33406e=_0x323fc1[_0x2cde('0x33')];if(!_0x5dceb1['query']['hasOwnProperty']('nolimit')){_0x5080b7[_0x2cde('0x1b')]=qs['limit'](_0x5dceb1[_0x2cde('0x2e')][_0x2cde('0x1b')]);_0x5080b7[_0x2cde('0x19')]=qs[_0x2cde('0x19')](_0x5dceb1['query'][_0x2cde('0x19')]);}return _0x58704c[_0x2cde('0x49')](_0x5080b7);}})[_0x2cde('0x22')](function(_0x402e22){if(_0x402e22){return _0x402e22?{'count':_0x33406e,'rows':_0x402e22}:null;}})[_0x2cde('0x22')](respondWithResult(_0x9f3a8f,null))[_0x2cde('0x41')](handleError(_0x9f3a8f,null));};exports['getSubjects']=function(_0x242bea,_0x22c397,_0x35f7c5){var _0x5e2621={};var _0x2a7e53={};var _0x42498c;var _0x2541c9;return db[_0x2cde('0x28')][_0x2cde('0x4a')]({'where':{'id':_0x242bea[_0x2cde('0x43')]['id']}})[_0x2cde('0x22')](handleEntityNotFound(_0x22c397,null))[_0x2cde('0x22')](function(_0x5ced59){if(_0x5ced59){_0x42498c=_0x5ced59;_0x2a7e53[_0x2cde('0x2c')]=_[_0x2cde('0x44')](db[_0x2cde('0x4c')][_0x2cde('0x29')]);_0x2a7e53[_0x2cde('0x2e')]=_[_0x2cde('0x44')](_0x242bea[_0x2cde('0x2e')]);_0x2a7e53[_0x2cde('0x2f')]=_[_0x2cde('0x30')](_0x2a7e53[_0x2cde('0x2c')],_0x2a7e53[_0x2cde('0x2e')]);_0x5e2621['attributes']=_[_0x2cde('0x30')](_0x2a7e53[_0x2cde('0x2c')],qs[_0x2cde('0x32')](_0x242bea[_0x2cde('0x2e')][_0x2cde('0x32')]));_0x5e2621['attributes']=_0x5e2621[_0x2cde('0x31')][_0x2cde('0x33')]?_0x5e2621['attributes']:_0x2a7e53[_0x2cde('0x2c')];_0x5e2621[_0x2cde('0x36')]=qs['sort'](_0x242bea['query'][_0x2cde('0x37')]);_0x5e2621['where']=qs[_0x2cde('0x2f')](_['pick'](_0x242bea['query'],_0x2a7e53['filters']));if(_0x242bea[_0x2cde('0x2e')]['filter']){_0x5e2621[_0x2cde('0x38')]=_[_0x2cde('0x3a')](_0x5e2621[_0x2cde('0x38')],{'$or':_['map'](_0x5e2621[_0x2cde('0x31')],function(_0x3b64cd){var _0x24b70e={};_0x24b70e[_0x3b64cd]={'$like':'%'+_0x242bea[_0x2cde('0x2e')][_0x2cde('0x39')]+'%'};return _0x24b70e;})});}_0x5e2621=_[_0x2cde('0x3a')]({},_0x5e2621,_0x242bea[_0x2cde('0x3c')]);return _0x42498c[_0x2cde('0x4d')](_0x5e2621);}})[_0x2cde('0x22')](function(_0x5908c3){if(_0x5908c3){_0x2541c9=_0x5908c3['length'];if(!_0x242bea[_0x2cde('0x2e')][_0x2cde('0x34')](_0x2cde('0x35'))){_0x5e2621[_0x2cde('0x1b')]=qs['limit'](_0x242bea[_0x2cde('0x2e')][_0x2cde('0x1b')]);_0x5e2621['offset']=qs['offset'](_0x242bea[_0x2cde('0x2e')][_0x2cde('0x19')]);}return _0x42498c[_0x2cde('0x4d')](_0x5e2621);}})[_0x2cde('0x22')](function(_0x2d1048){if(_0x2d1048){return _0x2d1048?{'count':_0x2541c9,'rows':_0x2d1048}:null;}})['then'](respondWithResult(_0x22c397,null))[_0x2cde('0x41')](handleError(_0x22c397,null));};exports['getDescriptions']=function(_0x34c77c,_0x37ff63,_0x56c535){var _0x3adf1e={};var _0x1f0304={};var _0x5bca56;var _0x49e0c2;return db[_0x2cde('0x28')][_0x2cde('0x4a')]({'where':{'id':_0x34c77c[_0x2cde('0x43')]['id']}})[_0x2cde('0x22')](handleEntityNotFound(_0x37ff63,null))[_0x2cde('0x22')](function(_0x714712){if(_0x714712){_0x5bca56=_0x714712;_0x1f0304['model']=_[_0x2cde('0x44')](db[_0x2cde('0x4c')][_0x2cde('0x29')]);_0x1f0304['query']=_[_0x2cde('0x44')](_0x34c77c['query']);_0x1f0304['filters']=_[_0x2cde('0x30')](_0x1f0304[_0x2cde('0x2c')],_0x1f0304[_0x2cde('0x2e')]);_0x3adf1e[_0x2cde('0x31')]=_['intersection'](_0x1f0304[_0x2cde('0x2c')],qs[_0x2cde('0x32')](_0x34c77c[_0x2cde('0x2e')][_0x2cde('0x32')]));_0x3adf1e['attributes']=_0x3adf1e[_0x2cde('0x31')][_0x2cde('0x33')]?_0x3adf1e[_0x2cde('0x31')]:_0x1f0304[_0x2cde('0x2c')];_0x3adf1e['order']=qs[_0x2cde('0x37')](_0x34c77c[_0x2cde('0x2e')][_0x2cde('0x37')]);_0x3adf1e[_0x2cde('0x38')]=qs[_0x2cde('0x2f')](_['pick'](_0x34c77c[_0x2cde('0x2e')],_0x1f0304['filters']));if(_0x34c77c['query'][_0x2cde('0x39')]){_0x3adf1e[_0x2cde('0x38')]=_[_0x2cde('0x3a')](_0x3adf1e[_0x2cde('0x38')],{'$or':_[_0x2cde('0x2d')](_0x3adf1e[_0x2cde('0x31')],function(_0x226d6c){var _0x2f08ed={};_0x2f08ed[_0x226d6c]={'$like':'%'+_0x34c77c[_0x2cde('0x2e')][_0x2cde('0x39')]+'%'};return _0x2f08ed;})});}_0x3adf1e=_[_0x2cde('0x3a')]({},_0x3adf1e,_0x34c77c[_0x2cde('0x3c')]);return _0x5bca56[_0x2cde('0x4e')](_0x3adf1e);}})['then'](function(_0x16a7c8){if(_0x16a7c8){_0x49e0c2=_0x16a7c8[_0x2cde('0x33')];if(!_0x34c77c[_0x2cde('0x2e')][_0x2cde('0x34')]('nolimit')){_0x3adf1e[_0x2cde('0x1b')]=qs[_0x2cde('0x1b')](_0x34c77c[_0x2cde('0x2e')][_0x2cde('0x1b')]);_0x3adf1e[_0x2cde('0x19')]=qs[_0x2cde('0x19')](_0x34c77c[_0x2cde('0x2e')]['offset']);}return _0x5bca56[_0x2cde('0x4e')](_0x3adf1e);}})[_0x2cde('0x22')](function(_0x5f1009){if(_0x5f1009){return _0x5f1009?{'count':_0x49e0c2,'rows':_0x5f1009}:null;}})[_0x2cde('0x22')](respondWithResult(_0x37ff63,null))[_0x2cde('0x41')](handleError(_0x37ff63,null));};exports['getTags']=function(_0x3c5d49,_0x44eff6,_0x19f7ea){var _0x26acd5={};var _0x2361f5={};var _0x2fc3f1;var _0xafae23;return db[_0x2cde('0x28')]['findOne']({'where':{'id':_0x3c5d49[_0x2cde('0x43')]['id']}})['then'](handleEntityNotFound(_0x44eff6,null))[_0x2cde('0x22')](function(_0x25f945){if(_0x25f945){_0x2fc3f1=_0x25f945;_0x2361f5[_0x2cde('0x2c')]=_[_0x2cde('0x44')](db[_0x2cde('0x4f')][_0x2cde('0x29')]);_0x2361f5[_0x2cde('0x2e')]=_[_0x2cde('0x44')](_0x3c5d49['query']);_0x2361f5[_0x2cde('0x2f')]=_[_0x2cde('0x30')](_0x2361f5[_0x2cde('0x2c')],_0x2361f5[_0x2cde('0x2e')]);_0x26acd5[_0x2cde('0x31')]=_[_0x2cde('0x30')](_0x2361f5['model'],qs[_0x2cde('0x32')](_0x3c5d49[_0x2cde('0x2e')][_0x2cde('0x32')]));_0x26acd5[_0x2cde('0x31')]=_0x26acd5[_0x2cde('0x31')]['length']?_0x26acd5['attributes']:_0x2361f5[_0x2cde('0x2c')];_0x26acd5[_0x2cde('0x36')]=qs[_0x2cde('0x37')](_0x3c5d49[_0x2cde('0x2e')]['sort']);_0x26acd5[_0x2cde('0x38')]=qs[_0x2cde('0x2f')](_[_0x2cde('0x4b')](_0x3c5d49['query'],_0x2361f5[_0x2cde('0x2f')]));if(_0x3c5d49['query'][_0x2cde('0x39')]){_0x26acd5[_0x2cde('0x38')]=_[_0x2cde('0x3a')](_0x26acd5['where'],{'$or':_[_0x2cde('0x2d')](_0x26acd5[_0x2cde('0x31')],function(_0x19d3b0){var _0x2e7531={};_0x2e7531[_0x19d3b0]={'$like':'%'+_0x3c5d49[_0x2cde('0x2e')][_0x2cde('0x39')]+'%'};return _0x2e7531;})});}_0x26acd5=_['merge']({},_0x26acd5,_0x3c5d49[_0x2cde('0x3c')]);return _0x2fc3f1[_0x2cde('0x50')](_0x26acd5);}})[_0x2cde('0x22')](function(_0x492425){if(_0x492425){_0xafae23=_0x492425['length'];if(!_0x3c5d49[_0x2cde('0x2e')][_0x2cde('0x34')](_0x2cde('0x35'))){_0x26acd5['limit']=qs[_0x2cde('0x1b')](_0x3c5d49['query'][_0x2cde('0x1b')]);_0x26acd5[_0x2cde('0x19')]=qs[_0x2cde('0x19')](_0x3c5d49[_0x2cde('0x2e')][_0x2cde('0x19')]);}return _0x2fc3f1[_0x2cde('0x50')](_0x26acd5);}})['then'](function(_0x5f19ee){if(_0x5f19ee){return _0x5f19ee?{'count':_0xafae23,'rows':_0x5f19ee}:null;}})[_0x2cde('0x22')](respondWithResult(_0x44eff6,null))[_0x2cde('0x41')](handleError(_0x44eff6,null));};exports[_0x2cde('0x51')]=function(_0x851ff,_0x46781a,_0x352ca1){if(_0x851ff[_0x2cde('0x46')]['id']){delete _0x851ff['body']['id'];}return db[_0x2cde('0x28')][_0x2cde('0x4a')]({'where':{'id':_0x851ff['params']['id']}})[_0x2cde('0x22')](handleEntityNotFound(_0x46781a,null))[_0x2cde('0x22')](function(_0x4a0696){if(_0x4a0696){return _0x4a0696['setTags'](_0x851ff[_0x2cde('0x46')][_0x2cde('0x52')]||[]);}return null;})['then'](respondWithResult(_0x46781a,null))[_0x2cde('0x41')](handleError(_0x46781a,null));}; \ No newline at end of file +var _0x13a8=['getSubjects','getDescriptions','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','end','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','DeskConfiguration','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','update','getFields','findOne','DeskField'];(function(_0x464cbe,_0x49c570){var _0x68195d=function(_0x13c820){while(--_0x13c820){_0x464cbe['push'](_0x464cbe['shift']());}};_0x68195d(++_0x49c570);}(_0x13a8,0x101));var _0x813a=function(_0xc6f792,_0x558bbd){_0xc6f792=_0xc6f792-0x0;var _0x5e2dfc=_0x13a8[_0xc6f792];return _0x5e2dfc;};'use strict';var emlformat=require(_0x813a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x813a('0x1'));var rp=require(_0x813a('0x2'));var moment=require(_0x813a('0x3'));var BPromise=require(_0x813a('0x4'));var Mustache=require(_0x813a('0x5'));var util=require(_0x813a('0x6'));var path=require(_0x813a('0x7'));var sox=require(_0x813a('0x8'));var csv=require(_0x813a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x813a('0xa'));var _=require(_0x813a('0xb'));var squel=require(_0x813a('0xc'));var crypto=require(_0x813a('0xd'));var jsforce=require(_0x813a('0xe'));var deskjs=require(_0x813a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x813a('0x10'));var Papa=require(_0x813a('0x11'));var Redis=require(_0x813a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x813a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x813a('0x14'));var config=require(_0x813a('0x15'));var licenseUtil=require(_0x813a('0x16'));var db=require(_0x813a('0x17'))['db'];function respondWithStatusCode(_0x21704f,_0x326472){_0x326472=_0x326472||0xcc;return function(_0x332461){if(_0x332461){return _0x21704f[_0x813a('0x18')](_0x326472);}return _0x21704f[_0x813a('0x19')](_0x326472)['end']();};}function respondWithResult(_0x52857c,_0x3ad45e){_0x3ad45e=_0x3ad45e||0xc8;return function(_0x45d13b){if(_0x45d13b){return _0x52857c['status'](_0x3ad45e)[_0x813a('0x1a')](_0x45d13b);}};}function respondWithFilteredResult(_0x1d46e4,_0x31c1a2){return function(_0x3cbd3d){if(_0x3cbd3d){var _0xa538b3=typeof _0x31c1a2[_0x813a('0x1b')]===_0x813a('0x1c')&&typeof _0x31c1a2['limit']===_0x813a('0x1c');var _0x4d3f9c=_0x3cbd3d[_0x813a('0x1d')];var _0x2ed7b3=_0xa538b3?0x0:_0x31c1a2[_0x813a('0x1b')];var _0x3714a1=_0xa538b3?_0x3cbd3d[_0x813a('0x1d')]:_0x31c1a2['offset']+_0x31c1a2[_0x813a('0x1e')];var _0x2a4849;if(_0x3714a1>=_0x4d3f9c){_0x3714a1=_0x4d3f9c;_0x2a4849=0xc8;}else{_0x2a4849=0xce;}_0x1d46e4[_0x813a('0x19')](_0x2a4849);return _0x1d46e4[_0x813a('0x1f')](_0x813a('0x20'),_0x2ed7b3+'-'+_0x3714a1+'/'+_0x4d3f9c)[_0x813a('0x1a')](_0x3cbd3d);}return null;};}function patchUpdates(_0x4861cb){return function(_0x313e24){try{jsonpatch[_0x813a('0x21')](_0x313e24,_0x4861cb,!![]);}catch(_0x34204d){return BPromise['reject'](_0x34204d);}return _0x313e24[_0x813a('0x22')]();};}function saveUpdates(_0x5cd0a0,_0x346661){return function(_0x29d1c1){if(_0x29d1c1){return _0x29d1c1['update'](_0x5cd0a0)['then'](function(_0x27b6f9){return _0x27b6f9;});}return null;};}function removeEntity(_0x4a0b35,_0x1d26fc){return function(_0x37e209){if(_0x37e209){return _0x37e209[_0x813a('0x23')]()[_0x813a('0x24')](function(){_0x4a0b35[_0x813a('0x19')](0xcc)[_0x813a('0x25')]();});}};}function handleEntityNotFound(_0x55c89c,_0x3cbd13){return function(_0x595c55){if(!_0x595c55){_0x55c89c[_0x813a('0x18')](0x194);}return _0x595c55;};}function handleError(_0x36e90f,_0x3d2b42){_0x3d2b42=_0x3d2b42||0x1f4;return function(_0x54092d){logger['error'](_0x54092d[_0x813a('0x26')]);if(_0x54092d[_0x813a('0x27')]){delete _0x54092d[_0x813a('0x27')];}_0x36e90f[_0x813a('0x19')](_0x3d2b42)[_0x813a('0x28')](_0x54092d);};}exports[_0x813a('0x29')]=function(_0x7d190,_0x2806bf){var _0x317d71={},_0x3199e4={},_0x2e7de0={'count':0x0,'rows':[]};var _0x170bcd=_[_0x813a('0x2a')](db['DeskConfiguration']['rawAttributes'],function(_0x26009a){return{'name':_0x26009a[_0x813a('0x2b')],'type':_0x26009a[_0x813a('0x2c')]['key']};});_0x3199e4[_0x813a('0x2d')]=_[_0x813a('0x2a')](_0x170bcd,'name');_0x3199e4[_0x813a('0x2e')]=_[_0x813a('0x2f')](_0x7d190[_0x813a('0x2e')]);_0x3199e4[_0x813a('0x30')]=_[_0x813a('0x31')](_0x3199e4['model'],_0x3199e4[_0x813a('0x2e')]);_0x317d71['attributes']=_[_0x813a('0x31')](_0x3199e4[_0x813a('0x2d')],qs['fields'](_0x7d190[_0x813a('0x2e')][_0x813a('0x32')]));_0x317d71[_0x813a('0x33')]=_0x317d71[_0x813a('0x33')]['length']?_0x317d71[_0x813a('0x33')]:_0x3199e4['model'];if(!_0x7d190[_0x813a('0x2e')][_0x813a('0x34')](_0x813a('0x35'))){_0x317d71[_0x813a('0x1e')]=qs['limit'](_0x7d190[_0x813a('0x2e')]['limit']);_0x317d71[_0x813a('0x1b')]=qs['offset'](_0x7d190[_0x813a('0x2e')][_0x813a('0x1b')]);}_0x317d71[_0x813a('0x36')]=qs['sort'](_0x7d190[_0x813a('0x2e')][_0x813a('0x37')]);_0x317d71[_0x813a('0x38')]=qs[_0x813a('0x30')](_[_0x813a('0x39')](_0x7d190['query'],_0x3199e4[_0x813a('0x30')]),_0x170bcd);if(_0x7d190[_0x813a('0x2e')]['filter']){_0x317d71[_0x813a('0x38')]=_[_0x813a('0x3a')](_0x317d71[_0x813a('0x38')],{'$or':_[_0x813a('0x2a')](_0x170bcd,function(_0x1c189c){if(_0x1c189c[_0x813a('0x2c')]!==_0x813a('0x3b')){var _0x1b0d50={};_0x1b0d50[_0x1c189c[_0x813a('0x27')]]={'$like':'%'+_0x7d190[_0x813a('0x2e')][_0x813a('0x3c')]+'%'};return _0x1b0d50;}})});}_0x317d71=_[_0x813a('0x3a')]({},_0x317d71,_0x7d190[_0x813a('0x3d')]);var _0x56a330={'where':_0x317d71[_0x813a('0x38')]};return db['DeskConfiguration'][_0x813a('0x1d')](_0x56a330)[_0x813a('0x24')](function(_0x4b139f){_0x2e7de0[_0x813a('0x1d')]=_0x4b139f;if(_0x7d190[_0x813a('0x2e')][_0x813a('0x3e')]){_0x317d71[_0x813a('0x3f')]=[{'all':!![]}];}return db[_0x813a('0x40')][_0x813a('0x41')](_0x317d71);})[_0x813a('0x24')](function(_0x32c5e5){_0x2e7de0[_0x813a('0x42')]=_0x32c5e5;return _0x2e7de0;})[_0x813a('0x24')](respondWithFilteredResult(_0x2806bf,_0x317d71))['catch'](handleError(_0x2806bf,null));};exports[_0x813a('0x43')]=function(_0xa753c8,_0x375338){var _0x1c3f95={'raw':![],'where':{'id':_0xa753c8[_0x813a('0x44')]['id']}},_0x53baa9={};_0x53baa9[_0x813a('0x2d')]=_[_0x813a('0x2f')](db[_0x813a('0x40')][_0x813a('0x45')]);_0x53baa9[_0x813a('0x2e')]=_[_0x813a('0x2f')](_0xa753c8['query']);_0x53baa9[_0x813a('0x30')]=_[_0x813a('0x31')](_0x53baa9['model'],_0x53baa9['query']);_0x1c3f95['attributes']=_[_0x813a('0x31')](_0x53baa9['model'],qs[_0x813a('0x32')](_0xa753c8[_0x813a('0x2e')][_0x813a('0x32')]));_0x1c3f95[_0x813a('0x33')]=_0x1c3f95[_0x813a('0x33')][_0x813a('0x46')]?_0x1c3f95[_0x813a('0x33')]:_0x53baa9[_0x813a('0x2d')];if(_0xa753c8['query'][_0x813a('0x3e')]){_0x1c3f95[_0x813a('0x3f')]=[{'all':!![]}];}_0x1c3f95=_[_0x813a('0x3a')]({},_0x1c3f95,_0xa753c8[_0x813a('0x3d')]);return db['DeskConfiguration'][_0x813a('0x47')](_0x1c3f95)[_0x813a('0x24')](handleEntityNotFound(_0x375338,null))[_0x813a('0x24')](respondWithResult(_0x375338,null))[_0x813a('0x48')](handleError(_0x375338,null));};exports['create']=function(_0xac4bde,_0x15265f){return db['DeskConfiguration'][_0x813a('0x49')](_0xac4bde[_0x813a('0x4a')],{})[_0x813a('0x24')](respondWithResult(_0x15265f,0xc9))[_0x813a('0x48')](handleError(_0x15265f,null));};exports[_0x813a('0x4b')]=function(_0x548691,_0x296969){if(_0x548691[_0x813a('0x4a')]['id']){delete _0x548691[_0x813a('0x4a')]['id'];}return db['DeskConfiguration'][_0x813a('0x47')]({'where':{'id':_0x548691[_0x813a('0x44')]['id']}})[_0x813a('0x24')](handleEntityNotFound(_0x296969,null))[_0x813a('0x24')](saveUpdates(_0x548691[_0x813a('0x4a')],null))[_0x813a('0x24')](respondWithResult(_0x296969,null))[_0x813a('0x48')](handleError(_0x296969,null));};exports[_0x813a('0x23')]=function(_0x446424,_0x120962){return db[_0x813a('0x40')][_0x813a('0x47')]({'where':{'id':_0x446424[_0x813a('0x44')]['id']}})['then'](handleEntityNotFound(_0x120962,null))['then'](removeEntity(_0x120962,null))[_0x813a('0x48')](handleError(_0x120962,null));};exports[_0x813a('0x4c')]=function(_0x51fb02,_0x350034,_0x1025a4){var _0x4c11b5={};var _0x373e29={};var _0x4de381;var _0x1c8157;return db['DeskConfiguration'][_0x813a('0x4d')]({'where':{'id':_0x51fb02[_0x813a('0x44')]['id']}})[_0x813a('0x24')](handleEntityNotFound(_0x350034,null))[_0x813a('0x24')](function(_0x150e78){if(_0x150e78){_0x4de381=_0x150e78;_0x373e29[_0x813a('0x2d')]=_[_0x813a('0x2f')](db[_0x813a('0x4e')][_0x813a('0x45')]);_0x373e29['query']=_[_0x813a('0x2f')](_0x51fb02[_0x813a('0x2e')]);_0x373e29[_0x813a('0x30')]=_['intersection'](_0x373e29[_0x813a('0x2d')],_0x373e29[_0x813a('0x2e')]);_0x4c11b5['attributes']=_[_0x813a('0x31')](_0x373e29['model'],qs[_0x813a('0x32')](_0x51fb02[_0x813a('0x2e')][_0x813a('0x32')]));_0x4c11b5[_0x813a('0x33')]=_0x4c11b5[_0x813a('0x33')][_0x813a('0x46')]?_0x4c11b5[_0x813a('0x33')]:_0x373e29[_0x813a('0x2d')];_0x4c11b5[_0x813a('0x36')]=qs['sort'](_0x51fb02['query']['sort']);_0x4c11b5['where']=qs[_0x813a('0x30')](_[_0x813a('0x39')](_0x51fb02[_0x813a('0x2e')],_0x373e29[_0x813a('0x30')]));if(_0x51fb02[_0x813a('0x2e')][_0x813a('0x3c')]){_0x4c11b5[_0x813a('0x38')]=_[_0x813a('0x3a')](_0x4c11b5['where'],{'$or':_[_0x813a('0x2a')](_0x4c11b5[_0x813a('0x33')],function(_0x28e91e){var _0x2b92f3={};_0x2b92f3[_0x28e91e]={'$like':'%'+_0x51fb02['query'][_0x813a('0x3c')]+'%'};return _0x2b92f3;})});}_0x4c11b5=_['merge']({},_0x4c11b5,_0x51fb02[_0x813a('0x3d')]);return _0x4de381[_0x813a('0x4c')](_0x4c11b5);}})[_0x813a('0x24')](function(_0x3d9831){if(_0x3d9831){_0x1c8157=_0x3d9831[_0x813a('0x46')];if(!_0x51fb02['query']['hasOwnProperty'](_0x813a('0x35'))){_0x4c11b5[_0x813a('0x1e')]=qs['limit'](_0x51fb02[_0x813a('0x2e')][_0x813a('0x1e')]);_0x4c11b5[_0x813a('0x1b')]=qs[_0x813a('0x1b')](_0x51fb02['query'][_0x813a('0x1b')]);}return _0x4de381[_0x813a('0x4c')](_0x4c11b5);}})[_0x813a('0x24')](function(_0x248a9d){if(_0x248a9d){return _0x248a9d?{'count':_0x1c8157,'rows':_0x248a9d}:null;}})['then'](respondWithResult(_0x350034,null))[_0x813a('0x48')](handleError(_0x350034,null));};exports[_0x813a('0x4f')]=function(_0x24e29d,_0x5bd809,_0x117a77){var _0x291e27={};var _0x60b2d6={};var _0x52adee;var _0x264862;return db[_0x813a('0x40')]['findOne']({'where':{'id':_0x24e29d[_0x813a('0x44')]['id']}})[_0x813a('0x24')](handleEntityNotFound(_0x5bd809,null))[_0x813a('0x24')](function(_0x4d7051){if(_0x4d7051){_0x52adee=_0x4d7051;_0x60b2d6[_0x813a('0x2d')]=_[_0x813a('0x2f')](db['DeskField'][_0x813a('0x45')]);_0x60b2d6[_0x813a('0x2e')]=_[_0x813a('0x2f')](_0x24e29d['query']);_0x60b2d6['filters']=_[_0x813a('0x31')](_0x60b2d6['model'],_0x60b2d6[_0x813a('0x2e')]);_0x291e27[_0x813a('0x33')]=_[_0x813a('0x31')](_0x60b2d6[_0x813a('0x2d')],qs['fields'](_0x24e29d['query'][_0x813a('0x32')]));_0x291e27[_0x813a('0x33')]=_0x291e27[_0x813a('0x33')][_0x813a('0x46')]?_0x291e27[_0x813a('0x33')]:_0x60b2d6[_0x813a('0x2d')];_0x291e27['order']=qs['sort'](_0x24e29d[_0x813a('0x2e')]['sort']);_0x291e27['where']=qs['filters'](_[_0x813a('0x39')](_0x24e29d[_0x813a('0x2e')],_0x60b2d6[_0x813a('0x30')]));if(_0x24e29d[_0x813a('0x2e')][_0x813a('0x3c')]){_0x291e27[_0x813a('0x38')]=_['merge'](_0x291e27['where'],{'$or':_[_0x813a('0x2a')](_0x291e27['attributes'],function(_0x317309){var _0x5ee14a={};_0x5ee14a[_0x317309]={'$like':'%'+_0x24e29d[_0x813a('0x2e')][_0x813a('0x3c')]+'%'};return _0x5ee14a;})});}_0x291e27=_[_0x813a('0x3a')]({},_0x291e27,_0x24e29d['options']);return _0x52adee[_0x813a('0x4f')](_0x291e27);}})[_0x813a('0x24')](function(_0x1b435b){if(_0x1b435b){_0x264862=_0x1b435b[_0x813a('0x46')];if(!_0x24e29d[_0x813a('0x2e')]['hasOwnProperty'](_0x813a('0x35'))){_0x291e27['limit']=qs[_0x813a('0x1e')](_0x24e29d['query'][_0x813a('0x1e')]);_0x291e27['offset']=qs[_0x813a('0x1b')](_0x24e29d['query'][_0x813a('0x1b')]);}return _0x52adee[_0x813a('0x4f')](_0x291e27);}})[_0x813a('0x24')](function(_0x72d723){if(_0x72d723){return _0x72d723?{'count':_0x264862,'rows':_0x72d723}:null;}})[_0x813a('0x24')](respondWithResult(_0x5bd809,null))[_0x813a('0x48')](handleError(_0x5bd809,null));};exports[_0x813a('0x50')]=function(_0x36dc40,_0x3d0e07,_0x3e0222){var _0xd67e1e={};var _0xc15bbe={};var _0x3aa9eb;var _0x20aac3;return db['DeskConfiguration'][_0x813a('0x4d')]({'where':{'id':_0x36dc40[_0x813a('0x44')]['id']}})[_0x813a('0x24')](handleEntityNotFound(_0x3d0e07,null))[_0x813a('0x24')](function(_0xa8659f){if(_0xa8659f){_0x3aa9eb=_0xa8659f;_0xc15bbe[_0x813a('0x2d')]=_[_0x813a('0x2f')](db[_0x813a('0x4e')]['rawAttributes']);_0xc15bbe['query']=_[_0x813a('0x2f')](_0x36dc40['query']);_0xc15bbe[_0x813a('0x30')]=_[_0x813a('0x31')](_0xc15bbe['model'],_0xc15bbe['query']);_0xd67e1e[_0x813a('0x33')]=_[_0x813a('0x31')](_0xc15bbe['model'],qs[_0x813a('0x32')](_0x36dc40[_0x813a('0x2e')][_0x813a('0x32')]));_0xd67e1e[_0x813a('0x33')]=_0xd67e1e[_0x813a('0x33')][_0x813a('0x46')]?_0xd67e1e[_0x813a('0x33')]:_0xc15bbe[_0x813a('0x2d')];_0xd67e1e['order']=qs[_0x813a('0x37')](_0x36dc40[_0x813a('0x2e')][_0x813a('0x37')]);_0xd67e1e[_0x813a('0x38')]=qs['filters'](_[_0x813a('0x39')](_0x36dc40[_0x813a('0x2e')],_0xc15bbe[_0x813a('0x30')]));if(_0x36dc40[_0x813a('0x2e')][_0x813a('0x3c')]){_0xd67e1e[_0x813a('0x38')]=_[_0x813a('0x3a')](_0xd67e1e[_0x813a('0x38')],{'$or':_[_0x813a('0x2a')](_0xd67e1e['attributes'],function(_0x3d97bb){var _0x29d7fe={};_0x29d7fe[_0x3d97bb]={'$like':'%'+_0x36dc40['query']['filter']+'%'};return _0x29d7fe;})});}_0xd67e1e=_[_0x813a('0x3a')]({},_0xd67e1e,_0x36dc40[_0x813a('0x3d')]);return _0x3aa9eb[_0x813a('0x50')](_0xd67e1e);}})[_0x813a('0x24')](function(_0x40098c){if(_0x40098c){_0x20aac3=_0x40098c[_0x813a('0x46')];if(!_0x36dc40[_0x813a('0x2e')]['hasOwnProperty'](_0x813a('0x35'))){_0xd67e1e[_0x813a('0x1e')]=qs[_0x813a('0x1e')](_0x36dc40[_0x813a('0x2e')][_0x813a('0x1e')]);_0xd67e1e['offset']=qs[_0x813a('0x1b')](_0x36dc40[_0x813a('0x2e')][_0x813a('0x1b')]);}return _0x3aa9eb[_0x813a('0x50')](_0xd67e1e);}})['then'](function(_0x13dabc){if(_0x13dabc){return _0x13dabc?{'count':_0x20aac3,'rows':_0x13dabc}:null;}})[_0x813a('0x24')](respondWithResult(_0x3d0e07,null))[_0x813a('0x48')](handleError(_0x3d0e07,null));};exports[_0x813a('0x51')]=function(_0x15b7ad,_0x4fe653,_0x2af4c8){var _0x1c9737={};var _0x2440a7={};var _0x876dd9;var _0x48972d;return db[_0x813a('0x40')][_0x813a('0x4d')]({'where':{'id':_0x15b7ad['params']['id']}})[_0x813a('0x24')](handleEntityNotFound(_0x4fe653,null))['then'](function(_0x5779d5){if(_0x5779d5){_0x876dd9=_0x5779d5;_0x2440a7[_0x813a('0x2d')]=_[_0x813a('0x2f')](db['Tag'][_0x813a('0x45')]);_0x2440a7['query']=_[_0x813a('0x2f')](_0x15b7ad['query']);_0x2440a7['filters']=_[_0x813a('0x31')](_0x2440a7[_0x813a('0x2d')],_0x2440a7[_0x813a('0x2e')]);_0x1c9737[_0x813a('0x33')]=_[_0x813a('0x31')](_0x2440a7[_0x813a('0x2d')],qs['fields'](_0x15b7ad[_0x813a('0x2e')]['fields']));_0x1c9737[_0x813a('0x33')]=_0x1c9737[_0x813a('0x33')][_0x813a('0x46')]?_0x1c9737[_0x813a('0x33')]:_0x2440a7['model'];_0x1c9737[_0x813a('0x36')]=qs['sort'](_0x15b7ad['query'][_0x813a('0x37')]);_0x1c9737[_0x813a('0x38')]=qs[_0x813a('0x30')](_['pick'](_0x15b7ad[_0x813a('0x2e')],_0x2440a7[_0x813a('0x30')]));if(_0x15b7ad[_0x813a('0x2e')][_0x813a('0x3c')]){_0x1c9737[_0x813a('0x38')]=_[_0x813a('0x3a')](_0x1c9737[_0x813a('0x38')],{'$or':_[_0x813a('0x2a')](_0x1c9737[_0x813a('0x33')],function(_0x1ba8e2){var _0x205870={};_0x205870[_0x1ba8e2]={'$like':'%'+_0x15b7ad['query'][_0x813a('0x3c')]+'%'};return _0x205870;})});}_0x1c9737=_[_0x813a('0x3a')]({},_0x1c9737,_0x15b7ad[_0x813a('0x3d')]);return _0x876dd9[_0x813a('0x51')](_0x1c9737);}})[_0x813a('0x24')](function(_0x4e0118){if(_0x4e0118){_0x48972d=_0x4e0118[_0x813a('0x46')];if(!_0x15b7ad['query'][_0x813a('0x34')](_0x813a('0x35'))){_0x1c9737[_0x813a('0x1e')]=qs[_0x813a('0x1e')](_0x15b7ad[_0x813a('0x2e')][_0x813a('0x1e')]);_0x1c9737[_0x813a('0x1b')]=qs[_0x813a('0x1b')](_0x15b7ad['query'][_0x813a('0x1b')]);}return _0x876dd9[_0x813a('0x51')](_0x1c9737);}})[_0x813a('0x24')](function(_0x2399d3){if(_0x2399d3){return _0x2399d3?{'count':_0x48972d,'rows':_0x2399d3}:null;}})['then'](respondWithResult(_0x4fe653,null))['catch'](handleError(_0x4fe653,null));};exports['setTags']=function(_0x23bf0b,_0x56c93f,_0x2eb5fb){if(_0x23bf0b[_0x813a('0x4a')]['id']){delete _0x23bf0b[_0x813a('0x4a')]['id'];}return db[_0x813a('0x40')][_0x813a('0x4d')]({'where':{'id':_0x23bf0b[_0x813a('0x44')]['id']}})['then'](handleEntityNotFound(_0x56c93f,null))[_0x813a('0x24')](function(_0x3787a9){if(_0x3787a9){return _0x3787a9[_0x813a('0x52')](_0x23bf0b['body'][_0x813a('0x53')]||[]);}return null;})[_0x813a('0x24')](respondWithResult(_0x56c93f,null))['catch'](handleError(_0x56c93f,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 8fe9cca..2931e42 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 _0x0413=['rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x412dd9,_0x22b93a){var _0xfd0e67=function(_0x2baf04){while(--_0x2baf04){_0x412dd9['push'](_0x412dd9['shift']());}};_0xfd0e67(++_0x22b93a);}(_0x0413,0x11a));var _0x3041=function(_0x46d55e,_0x1145cd){_0x46d55e=_0x46d55e-0x0;var _0x3b9597=_0x0413[_0x46d55e];return _0x3b9597;};'use strict';var _=require(_0x3041('0x0'));var util=require(_0x3041('0x1'));var logger=require('../../config/logger')(_0x3041('0x2'));var moment=require(_0x3041('0x3'));var BPromise=require(_0x3041('0x4'));var rp=require(_0x3041('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3041('0x6'));var config=require(_0x3041('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0x3041('0x8')]=function(_0xfaabd8,_0x557c42){return _0xfaabd8[_0x3041('0x9')](_0x3041('0xa'),attributes,{'tableName':_0x3041('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d2f=['define','DeskConfiguration','int_desk_configurations','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x294e75,_0x58a48e){var _0x3da666=function(_0x380e1f){while(--_0x380e1f){_0x294e75['push'](_0x294e75['shift']());}};_0x3da666(++_0x58a48e);}(_0x7d2f,0xc3));var _0xf7d2=function(_0x42864c,_0x216c5d){_0x42864c=_0x42864c-0x0;var _0x5db157=_0x7d2f[_0x42864c];return _0x5db157;};'use strict';var _=require('lodash');var util=require(_0xf7d2('0x0'));var logger=require(_0xf7d2('0x1'))('api');var moment=require(_0xf7d2('0x2'));var BPromise=require('bluebird');var rp=require(_0xf7d2('0x3'));var fs=require('fs');var path=require(_0xf7d2('0x4'));var rimraf=require(_0xf7d2('0x5'));var config=require(_0xf7d2('0x6'));var attributes=require(_0xf7d2('0x7'));module[_0xf7d2('0x8')]=function(_0x51d59f,_0x579066){return _0x51d59f[_0xf7d2('0x9')](_0xf7d2('0xa'),attributes,{'tableName':_0xf7d2('0xb'),'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 bbf0ab5..978e862 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 _0xdcdb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xdcdb,0x64));var _0xbdcd=function(_0x4bfa32,_0x5051ca){_0x4bfa32=_0x4bfa32-0x0;var _0xce097d=_0xdcdb[_0x4bfa32];return _0xce097d;};'use strict';var _=require(_0xbdcd('0x0'));var util=require(_0xbdcd('0x1'));var moment=require(_0xbdcd('0x2'));var BPromise=require(_0xbdcd('0x3'));var rs=require(_0xbdcd('0x4'));var fs=require('fs');var Redis=require(_0xbdcd('0x5'));var db=require(_0xbdcd('0x6'))['db'];var utils=require(_0xbdcd('0x7'));var logger=require(_0xbdcd('0x8'))(_0xbdcd('0x9'));var config=require(_0xbdcd('0xa'));var jayson=require(_0xbdcd('0xb'));var client=jayson[_0xbdcd('0xc')][_0xbdcd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3f2bbc,_0x8744ad,_0xbccbe2){return new BPromise(function(_0x338a29,_0x201493){return client[_0xbdcd('0xe')](_0x3f2bbc,_0xbccbe2)['then'](function(_0x6d798a){logger[_0xbdcd('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x8744ad,_0xbdcd('0x10'));logger[_0xbdcd('0x11')](_0xbdcd('0x12'),_0x8744ad,_0xbdcd('0x10'),JSON[_0xbdcd('0x13')](_0x6d798a));if(_0x6d798a[_0xbdcd('0x14')]){if(_0x6d798a[_0xbdcd('0x14')][_0xbdcd('0x15')]===0x1f4){logger['error'](_0xbdcd('0x16'),_0x8744ad,_0x6d798a['error'][_0xbdcd('0x17')]);return _0x201493(_0x6d798a['error']['message']);}logger[_0xbdcd('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x8744ad,_0x6d798a[_0xbdcd('0x14')][_0xbdcd('0x17')]);return _0x338a29(_0x6d798a['error'][_0xbdcd('0x17')]);}else{logger[_0xbdcd('0xf')](_0xbdcd('0x16'),_0x8744ad,_0xbdcd('0x10'));_0x338a29(_0x6d798a['result'][_0xbdcd('0x17')]);}})[_0xbdcd('0x18')](function(_0x2893d7){logger[_0xbdcd('0x14')](_0xbdcd('0x16'),_0x8744ad,_0x2893d7);_0x201493(_0x2893d7);});});} \ No newline at end of file +var _0xbecf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x18211a,_0x4d8edb){var _0x16afcf=function(_0x4b8716){while(--_0x4b8716){_0x18211a['push'](_0x18211a['shift']());}};_0x16afcf(++_0x4d8edb);}(_0xbecf,0x15c));var _0xfbec=function(_0x3ee486,_0x6ac5d0){_0x3ee486=_0x3ee486-0x0;var _0x419c49=_0xbecf[_0x3ee486];return _0x419c49;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbec('0x0'));var BPromise=require(_0xfbec('0x1'));var rs=require(_0xfbec('0x2'));var fs=require('fs');var Redis=require(_0xfbec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbec('0x4'));var logger=require(_0xfbec('0x5'))(_0xfbec('0x6'));var config=require(_0xfbec('0x7'));var jayson=require(_0xfbec('0x8'));var client=jayson['client'][_0xfbec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34a717,_0x33c701,_0x410cab){return new BPromise(function(_0x43bc5b,_0x312ad1){return client[_0xfbec('0xa')](_0x34a717,_0x410cab)[_0xfbec('0xb')](function(_0x21863f){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x33c701,'request\x20sent');logger[_0xfbec('0xc')](_0xfbec('0xd'),_0x33c701,_0xfbec('0xe'),JSON[_0xfbec('0xf')](_0x21863f));if(_0x21863f[_0xfbec('0x10')]){if(_0x21863f['error'][_0xfbec('0x11')]===0x1f4){logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f[_0xfbec('0x10')]['message']);return _0x312ad1(_0x21863f[_0xfbec('0x10')][_0xfbec('0x13')]);}logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f['error'][_0xfbec('0x13')]);return _0x43bc5b(_0x21863f['error'][_0xfbec('0x13')]);}else{logger['info'](_0xfbec('0x12'),_0x33c701,_0xfbec('0xe'));_0x43bc5b(_0x21863f[_0xfbec('0x14')]['message']);}})[_0xfbec('0x15')](function(_0x2a3329){logger[_0xfbec('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x33c701,_0x2a3329);_0x312ad1(_0x2a3329);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2ba73ff..fd9baf7 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 _0xe8f9=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete'];(function(_0xf7faae,_0x580d1e){var _0xe21f5a=function(_0x4c97f1){while(--_0x4c97f1){_0xf7faae['push'](_0xf7faae['shift']());}};_0xe21f5a(++_0x580d1e);}(_0xe8f9,0x73));var _0x9e8f=function(_0x54ffbc,_0x299f85){_0x54ffbc=_0x54ffbc-0x0;var _0x37875d=_0xe8f9[_0x54ffbc];return _0x37875d;};'use strict';var multer=require('multer');var util=require(_0x9e8f('0x0'));var path=require(_0x9e8f('0x1'));var timeout=require(_0x9e8f('0x2'));var express=require(_0x9e8f('0x3'));var router=express[_0x9e8f('0x4')]();var fs_extra=require(_0x9e8f('0x5'));var auth=require(_0x9e8f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e8f('0x7'));var controller=require(_0x9e8f('0x8'));router['get']('/',auth[_0x9e8f('0x9')](),controller[_0x9e8f('0xa')]);router[_0x9e8f('0xb')](_0x9e8f('0xc'),auth['isAuthenticated'](),controller[_0x9e8f('0xd')]);router[_0x9e8f('0xe')]('/',auth[_0x9e8f('0x9')](),controller[_0x9e8f('0xf')]);router['put'](_0x9e8f('0xc'),auth[_0x9e8f('0x9')](),controller[_0x9e8f('0x10')]);router[_0x9e8f('0x11')](_0x9e8f('0xc'),auth[_0x9e8f('0x9')](),controller['destroy']);module[_0x9e8f('0x12')]=router; \ No newline at end of file +var _0xb368=['get','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xcac552,_0x332d2b){var _0x4923cb=function(_0xa6e06f){while(--_0xa6e06f){_0xcac552['push'](_0xcac552['shift']());}};_0x4923cb(++_0x332d2b);}(_0xb368,0x68));var _0x8b36=function(_0x5b1ecf,_0x21a4e3){_0x5b1ecf=_0x5b1ecf-0x0;var _0x5c79d0=_0xb368[_0x5b1ecf];return _0x5c79d0;};'use strict';var multer=require(_0x8b36('0x0'));var util=require(_0x8b36('0x1'));var path=require(_0x8b36('0x2'));var timeout=require(_0x8b36('0x3'));var express=require(_0x8b36('0x4'));var router=express[_0x8b36('0x5')]();var fs_extra=require(_0x8b36('0x6'));var auth=require(_0x8b36('0x7'));var interaction=require(_0x8b36('0x8'));var config=require(_0x8b36('0x9'));var controller=require('./intDeskField.controller');router[_0x8b36('0xa')]('/',auth[_0x8b36('0xb')](),controller['index']);router['get'](_0x8b36('0xc'),auth['isAuthenticated'](),controller[_0x8b36('0xd')]);router['post']('/',auth[_0x8b36('0xb')](),controller[_0x8b36('0xe')]);router[_0x8b36('0xf')]('/:id',auth[_0x8b36('0xb')](),controller[_0x8b36('0x10')]);router['delete']('/:id',auth[_0x8b36('0xb')](),controller[_0x8b36('0x11')]);module[_0x8b36('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 99da141..65d08bd 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 _0x0c4e=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x52ffd9,_0x29935d){var _0x11c57a=function(_0x5de2c5){while(--_0x5de2c5){_0x52ffd9['push'](_0x52ffd9['shift']());}};_0x11c57a(++_0x29935d);}(_0x0c4e,0xd0));var _0xe0c4=function(_0x5a7f77,_0x448b86){_0x5a7f77=_0x5a7f77-0x0;var _0x16f9c9=_0x0c4e[_0x5a7f77];return _0x16f9c9;};'use strict';var Sequelize=require(_0xe0c4('0x0'));module[_0xe0c4('0x1')]={'type':{'type':Sequelize[_0xe0c4('0x2')](_0xe0c4('0x3'),_0xe0c4('0x4'),_0xe0c4('0x5'),_0xe0c4('0x6'),_0xe0c4('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe0c4('0x8')]},'key':{'type':Sequelize[_0xe0c4('0x8')]},'keyType':{'type':Sequelize[_0xe0c4('0x2')]('string',_0xe0c4('0x4'),_0xe0c4('0x5'))},'keyContent':{'type':Sequelize[_0xe0c4('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe0c4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0c4('0x8')]}}; \ No newline at end of file +var _0x1704=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0x1704,0x99));var _0x4170=function(_0x5350ab,_0x5d51c6){_0x5350ab=_0x5350ab-0x0;var _0x2775f9=_0x1704[_0x5350ab];return _0x2775f9;};'use strict';var Sequelize=require(_0x4170('0x0'));module[_0x4170('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4170('0x2'),_0x4170('0x3'),_0x4170('0x4'),_0x4170('0x5'),_0x4170('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4170('0x7')]},'key':{'type':Sequelize[_0x4170('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4170('0x2'),_0x4170('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4170('0x7')]},'customField':{'type':Sequelize[_0x4170('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4170('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 8891a04..e16ef29 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 _0xefce=['ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x437663,_0x4b1832){var _0x1f3d51=function(_0x3a30d4){while(--_0x3a30d4){_0x437663['push'](_0x437663['shift']());}};_0x1f3d51(++_0x4b1832);}(_0xefce,0x1e8));var _0xeefc=function(_0x17f145,_0x3422bb){_0x17f145=_0x17f145-0x0;var _0x2d5420=_0xefce[_0x17f145];return _0x2d5420;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeefc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeefc('0x1'));var moment=require(_0xeefc('0x2'));var BPromise=require(_0xeefc('0x3'));var Mustache=require(_0xeefc('0x4'));var util=require(_0xeefc('0x5'));var path=require(_0xeefc('0x6'));var sox=require(_0xeefc('0x7'));var csv=require(_0xeefc('0x8'));var ejs=require(_0xeefc('0x9'));var fs=require('fs');var fs_extra=require(_0xeefc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeefc('0xb'));var jsforce=require(_0xeefc('0xc'));var deskjs=require(_0xeefc('0xd'));var toCsv=require(_0xeefc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeefc('0xe'));var authService=require(_0xeefc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeefc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeefc('0x11'))(_0xeefc('0x12'));var utils=require('../../config/utils');var config=require(_0xeefc('0x13'));var licenseUtil=require(_0xeefc('0x14'));var db=require(_0xeefc('0x15'))['db'];function respondWithStatusCode(_0x5f255a,_0x454066){_0x454066=_0x454066||0xcc;return function(_0x3e9251){if(_0x3e9251){return _0x5f255a[_0xeefc('0x16')](_0x454066);}return _0x5f255a[_0xeefc('0x17')](_0x454066)[_0xeefc('0x18')]();};}function respondWithResult(_0x405ba3,_0xa0e71a){_0xa0e71a=_0xa0e71a||0xc8;return function(_0x4537e2){if(_0x4537e2){return _0x405ba3[_0xeefc('0x17')](_0xa0e71a)[_0xeefc('0x19')](_0x4537e2);}};}function respondWithFilteredResult(_0x224d28,_0x5d728e){return function(_0x3d8489){if(_0x3d8489){var _0x5c447b=typeof _0x5d728e[_0xeefc('0x1a')]===_0xeefc('0x1b')&&typeof _0x5d728e[_0xeefc('0x1c')]===_0xeefc('0x1b');var _0x15baaa=_0x3d8489['count'];var _0x1c247e=_0x5c447b?0x0:_0x5d728e[_0xeefc('0x1a')];var _0x55c2fb=_0x5c447b?_0x3d8489[_0xeefc('0x1d')]:_0x5d728e[_0xeefc('0x1a')]+_0x5d728e[_0xeefc('0x1c')];var _0x4ba684;if(_0x55c2fb>=_0x15baaa){_0x55c2fb=_0x15baaa;_0x4ba684=0xc8;}else{_0x4ba684=0xce;}_0x224d28[_0xeefc('0x17')](_0x4ba684);return _0x224d28[_0xeefc('0x1e')]('Content-Range',_0x1c247e+'-'+_0x55c2fb+'/'+_0x15baaa)[_0xeefc('0x19')](_0x3d8489);}return null;};}function patchUpdates(_0x5b34b9){return function(_0x208959){try{jsonpatch[_0xeefc('0x1f')](_0x208959,_0x5b34b9,!![]);}catch(_0x3cebaa){return BPromise[_0xeefc('0x20')](_0x3cebaa);}return _0x208959[_0xeefc('0x21')]();};}function saveUpdates(_0x2f475e,_0x2ac6e0){return function(_0x4ec1c9){if(_0x4ec1c9){return _0x4ec1c9[_0xeefc('0x22')](_0x2f475e)[_0xeefc('0x23')](function(_0x6e690b){return _0x6e690b;});}return null;};}function removeEntity(_0xe20f0a,_0x4eea87){return function(_0x48246d){if(_0x48246d){return _0x48246d[_0xeefc('0x24')]()[_0xeefc('0x23')](function(){_0xe20f0a[_0xeefc('0x17')](0xcc)[_0xeefc('0x18')]();});}};}function handleEntityNotFound(_0x4aeaa7,_0x16e60e){return function(_0x3ea299){if(!_0x3ea299){_0x4aeaa7[_0xeefc('0x16')](0x194);}return _0x3ea299;};}function handleError(_0x4776f5,_0x5773c8){_0x5773c8=_0x5773c8||0x1f4;return function(_0x5a8736){logger[_0xeefc('0x25')](_0x5a8736['stack']);if(_0x5a8736[_0xeefc('0x26')]){delete _0x5a8736[_0xeefc('0x26')];}_0x4776f5['status'](_0x5773c8)['send'](_0x5a8736);};}exports[_0xeefc('0x27')]=function(_0x56ea84,_0x56de5f){var _0x453f6e={},_0x1079f2={},_0x4d3aec={'count':0x0,'rows':[]};var _0x47acb4=_[_0xeefc('0x28')](db[_0xeefc('0x29')][_0xeefc('0x2a')],function(_0x13a33e){return{'name':_0x13a33e[_0xeefc('0x2b')],'type':_0x13a33e[_0xeefc('0x2c')][_0xeefc('0x2d')]};});_0x1079f2[_0xeefc('0x2e')]=_[_0xeefc('0x28')](_0x47acb4,'name');_0x1079f2[_0xeefc('0x2f')]=_[_0xeefc('0x30')](_0x56ea84[_0xeefc('0x2f')]);_0x1079f2[_0xeefc('0x31')]=_[_0xeefc('0x32')](_0x1079f2[_0xeefc('0x2e')],_0x1079f2[_0xeefc('0x2f')]);_0x453f6e[_0xeefc('0x33')]=_[_0xeefc('0x32')](_0x1079f2[_0xeefc('0x2e')],qs[_0xeefc('0x34')](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x34')]));_0x453f6e['attributes']=_0x453f6e[_0xeefc('0x33')][_0xeefc('0x35')]?_0x453f6e['attributes']:_0x1079f2[_0xeefc('0x2e')];if(!_0x56ea84[_0xeefc('0x2f')]['hasOwnProperty']('nolimit')){_0x453f6e[_0xeefc('0x1c')]=qs[_0xeefc('0x1c')](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x1c')]);_0x453f6e['offset']=qs[_0xeefc('0x1a')](_0x56ea84['query'][_0xeefc('0x1a')]);}_0x453f6e[_0xeefc('0x36')]=qs['sort'](_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x37')]);_0x453f6e[_0xeefc('0x38')]=qs[_0xeefc('0x31')](_[_0xeefc('0x39')](_0x56ea84[_0xeefc('0x2f')],_0x1079f2[_0xeefc('0x31')]),_0x47acb4);if(_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3a')]){_0x453f6e[_0xeefc('0x38')]=_['merge'](_0x453f6e['where'],{'$or':_['map'](_0x47acb4,function(_0x2cab08){if(_0x2cab08[_0xeefc('0x2c')]!==_0xeefc('0x3b')){var _0x463283={};_0x463283[_0x2cab08['name']]={'$like':'%'+_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3a')]+'%'};return _0x463283;}})});}_0x453f6e=_[_0xeefc('0x3c')]({},_0x453f6e,_0x56ea84[_0xeefc('0x3d')]);var _0x4ddf39={'where':_0x453f6e[_0xeefc('0x38')]};return db[_0xeefc('0x29')][_0xeefc('0x1d')](_0x4ddf39)[_0xeefc('0x23')](function(_0x26015c){_0x4d3aec[_0xeefc('0x1d')]=_0x26015c;if(_0x56ea84[_0xeefc('0x2f')][_0xeefc('0x3e')]){_0x453f6e[_0xeefc('0x3f')]=[{'all':!![]}];}return db[_0xeefc('0x29')]['findAll'](_0x453f6e);})['then'](function(_0x34786f){_0x4d3aec[_0xeefc('0x40')]=_0x34786f;return _0x4d3aec;})[_0xeefc('0x23')](respondWithFilteredResult(_0x56de5f,_0x453f6e))[_0xeefc('0x41')](handleError(_0x56de5f,null));};exports[_0xeefc('0x42')]=function(_0x44e88,_0x560d99){var _0x49b478={'raw':!![],'where':{'id':_0x44e88[_0xeefc('0x43')]['id']}},_0x28049e={};_0x28049e[_0xeefc('0x2e')]=_[_0xeefc('0x30')](db[_0xeefc('0x29')][_0xeefc('0x2a')]);_0x28049e[_0xeefc('0x2f')]=_[_0xeefc('0x30')](_0x44e88[_0xeefc('0x2f')]);_0x28049e['filters']=_[_0xeefc('0x32')](_0x28049e[_0xeefc('0x2e')],_0x28049e[_0xeefc('0x2f')]);_0x49b478[_0xeefc('0x33')]=_[_0xeefc('0x32')](_0x28049e[_0xeefc('0x2e')],qs[_0xeefc('0x34')](_0x44e88[_0xeefc('0x2f')][_0xeefc('0x34')]));_0x49b478[_0xeefc('0x33')]=_0x49b478[_0xeefc('0x33')][_0xeefc('0x35')]?_0x49b478[_0xeefc('0x33')]:_0x28049e[_0xeefc('0x2e')];if(_0x44e88[_0xeefc('0x2f')]['includeAll']){_0x49b478[_0xeefc('0x3f')]=[{'all':!![]}];}_0x49b478=_[_0xeefc('0x3c')]({},_0x49b478,_0x44e88[_0xeefc('0x3d')]);return db[_0xeefc('0x29')][_0xeefc('0x44')](_0x49b478)[_0xeefc('0x23')](handleEntityNotFound(_0x560d99,null))[_0xeefc('0x23')](respondWithResult(_0x560d99,null))[_0xeefc('0x41')](handleError(_0x560d99,null));};exports[_0xeefc('0x45')]=function(_0x2b5298,_0xaf7a14){return db[_0xeefc('0x29')][_0xeefc('0x45')](_0x2b5298[_0xeefc('0x46')],{})['then'](respondWithResult(_0xaf7a14,0xc9))[_0xeefc('0x41')](handleError(_0xaf7a14,null));};exports[_0xeefc('0x22')]=function(_0x29f739,_0x76f2fa){if(_0x29f739['body']['id']){delete _0x29f739['body']['id'];}return db[_0xeefc('0x29')][_0xeefc('0x44')]({'where':{'id':_0x29f739[_0xeefc('0x43')]['id']}})[_0xeefc('0x23')](handleEntityNotFound(_0x76f2fa,null))[_0xeefc('0x23')](saveUpdates(_0x29f739[_0xeefc('0x46')],null))[_0xeefc('0x23')](respondWithResult(_0x76f2fa,null))[_0xeefc('0x41')](handleError(_0x76f2fa,null));};exports['destroy']=function(_0x5eece6,_0x28e7e9){return db[_0xeefc('0x29')][_0xeefc('0x44')]({'where':{'id':_0x5eece6['params']['id']}})[_0xeefc('0x23')](handleEntityNotFound(_0x28e7e9,null))[_0xeefc('0x23')](removeEntity(_0x28e7e9,null))[_0xeefc('0x41')](handleError(_0x28e7e9,null));}; \ No newline at end of file +var _0xfa74=['zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','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','status','end','json','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','keys','intersection','model','attributes','fields','length','query','offset','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find'];(function(_0xf81d68,_0x2f9a49){var _0x129146=function(_0x1021b0){while(--_0x1021b0){_0xf81d68['push'](_0xf81d68['shift']());}};_0x129146(++_0x2f9a49);}(_0xfa74,0x1b0));var _0x4fa7=function(_0x198f57,_0x520f89){_0x198f57=_0x198f57-0x0;var _0x16f2a0=_0xfa74[_0x198f57];return _0x16f2a0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4fa7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4fa7('0x1'));var moment=require(_0x4fa7('0x2'));var BPromise=require(_0x4fa7('0x3'));var Mustache=require('mustache');var util=require(_0x4fa7('0x4'));var path=require(_0x4fa7('0x5'));var sox=require(_0x4fa7('0x6'));var csv=require(_0x4fa7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fa7('0x8'));var squel=require('squel');var crypto=require(_0x4fa7('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4fa7('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4fa7('0xb'));var Papa=require(_0x4fa7('0xc'));var Redis=require(_0x4fa7('0xd'));var authService=require(_0x4fa7('0xe'));var qs=require(_0x4fa7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fa7('0x10'));var logger=require(_0x4fa7('0x11'))(_0x4fa7('0x12'));var utils=require(_0x4fa7('0x13'));var config=require(_0x4fa7('0x14'));var licenseUtil=require(_0x4fa7('0x15'));var db=require(_0x4fa7('0x16'))['db'];function respondWithStatusCode(_0x2ebed0,_0x4abdfd){_0x4abdfd=_0x4abdfd||0xcc;return function(_0x54fb39){if(_0x54fb39){return _0x2ebed0[_0x4fa7('0x17')](_0x4abdfd);}return _0x2ebed0[_0x4fa7('0x18')](_0x4abdfd)[_0x4fa7('0x19')]();};}function respondWithResult(_0x18259e,_0x7bbbc1){_0x7bbbc1=_0x7bbbc1||0xc8;return function(_0x255b3c){if(_0x255b3c){return _0x18259e[_0x4fa7('0x18')](_0x7bbbc1)[_0x4fa7('0x1a')](_0x255b3c);}};}function respondWithFilteredResult(_0x18f07c,_0xd2325d){return function(_0x47f3d7){if(_0x47f3d7){var _0x483cd1=typeof _0xd2325d['offset']===_0x4fa7('0x1b')&&typeof _0xd2325d[_0x4fa7('0x1c')]===_0x4fa7('0x1b');var _0x14d8dc=_0x47f3d7[_0x4fa7('0x1d')];var _0x6eddb1=_0x483cd1?0x0:_0xd2325d['offset'];var _0x5e7c6d=_0x483cd1?_0x47f3d7[_0x4fa7('0x1d')]:_0xd2325d['offset']+_0xd2325d['limit'];var _0x26a22e;if(_0x5e7c6d>=_0x14d8dc){_0x5e7c6d=_0x14d8dc;_0x26a22e=0xc8;}else{_0x26a22e=0xce;}_0x18f07c[_0x4fa7('0x18')](_0x26a22e);return _0x18f07c[_0x4fa7('0x1e')](_0x4fa7('0x1f'),_0x6eddb1+'-'+_0x5e7c6d+'/'+_0x14d8dc)[_0x4fa7('0x1a')](_0x47f3d7);}return null;};}function patchUpdates(_0x4869ef){return function(_0x9b5634){try{jsonpatch['apply'](_0x9b5634,_0x4869ef,!![]);}catch(_0x2aa1d8){return BPromise['reject'](_0x2aa1d8);}return _0x9b5634['save']();};}function saveUpdates(_0x558782,_0x12678d){return function(_0x3c12d7){if(_0x3c12d7){return _0x3c12d7[_0x4fa7('0x20')](_0x558782)[_0x4fa7('0x21')](function(_0x4d70dd){return _0x4d70dd;});}return null;};}function removeEntity(_0x454f1e,_0x4a8301){return function(_0x3cf851){if(_0x3cf851){return _0x3cf851[_0x4fa7('0x22')]()[_0x4fa7('0x21')](function(){_0x454f1e['status'](0xcc)[_0x4fa7('0x19')]();});}};}function handleEntityNotFound(_0x4be7f2,_0x90e1b2){return function(_0x3e54cf){if(!_0x3e54cf){_0x4be7f2[_0x4fa7('0x17')](0x194);}return _0x3e54cf;};}function handleError(_0x1caa71,_0x164795){_0x164795=_0x164795||0x1f4;return function(_0x406902){logger[_0x4fa7('0x23')](_0x406902[_0x4fa7('0x24')]);if(_0x406902[_0x4fa7('0x25')]){delete _0x406902[_0x4fa7('0x25')];}_0x1caa71[_0x4fa7('0x18')](_0x164795)[_0x4fa7('0x26')](_0x406902);};}exports[_0x4fa7('0x27')]=function(_0x541d6c,_0x84ca5e){var _0x397dc5={},_0x1e67fe={},_0x3fd169={'count':0x0,'rows':[]};var _0x4008d3=_[_0x4fa7('0x28')](db[_0x4fa7('0x29')][_0x4fa7('0x2a')],function(_0x226b9e){return{'name':_0x226b9e[_0x4fa7('0x2b')],'type':_0x226b9e[_0x4fa7('0x2c')][_0x4fa7('0x2d')]};});_0x1e67fe['model']=_['map'](_0x4008d3,_0x4fa7('0x25'));_0x1e67fe['query']=_[_0x4fa7('0x2e')](_0x541d6c['query']);_0x1e67fe['filters']=_[_0x4fa7('0x2f')](_0x1e67fe[_0x4fa7('0x30')],_0x1e67fe['query']);_0x397dc5[_0x4fa7('0x31')]=_[_0x4fa7('0x2f')](_0x1e67fe[_0x4fa7('0x30')],qs[_0x4fa7('0x32')](_0x541d6c['query']['fields']));_0x397dc5[_0x4fa7('0x31')]=_0x397dc5[_0x4fa7('0x31')][_0x4fa7('0x33')]?_0x397dc5['attributes']:_0x1e67fe[_0x4fa7('0x30')];if(!_0x541d6c[_0x4fa7('0x34')]['hasOwnProperty']('nolimit')){_0x397dc5['limit']=qs[_0x4fa7('0x1c')](_0x541d6c[_0x4fa7('0x34')]['limit']);_0x397dc5[_0x4fa7('0x35')]=qs[_0x4fa7('0x35')](_0x541d6c[_0x4fa7('0x34')]['offset']);}_0x397dc5[_0x4fa7('0x36')]=qs[_0x4fa7('0x37')](_0x541d6c[_0x4fa7('0x34')][_0x4fa7('0x37')]);_0x397dc5[_0x4fa7('0x38')]=qs[_0x4fa7('0x39')](_[_0x4fa7('0x3a')](_0x541d6c[_0x4fa7('0x34')],_0x1e67fe[_0x4fa7('0x39')]),_0x4008d3);if(_0x541d6c[_0x4fa7('0x34')][_0x4fa7('0x3b')]){_0x397dc5[_0x4fa7('0x38')]=_[_0x4fa7('0x3c')](_0x397dc5[_0x4fa7('0x38')],{'$or':_['map'](_0x4008d3,function(_0x431924){if(_0x431924[_0x4fa7('0x2c')]!=='VIRTUAL'){var _0x799936={};_0x799936[_0x431924[_0x4fa7('0x25')]]={'$like':'%'+_0x541d6c['query']['filter']+'%'};return _0x799936;}})});}_0x397dc5=_[_0x4fa7('0x3c')]({},_0x397dc5,_0x541d6c[_0x4fa7('0x3d')]);var _0x5e1356={'where':_0x397dc5[_0x4fa7('0x38')]};return db['DeskField'][_0x4fa7('0x1d')](_0x5e1356)[_0x4fa7('0x21')](function(_0x2ddabf){_0x3fd169[_0x4fa7('0x1d')]=_0x2ddabf;if(_0x541d6c[_0x4fa7('0x34')][_0x4fa7('0x3e')]){_0x397dc5[_0x4fa7('0x3f')]=[{'all':!![]}];}return db[_0x4fa7('0x29')][_0x4fa7('0x40')](_0x397dc5);})[_0x4fa7('0x21')](function(_0x442899){_0x3fd169[_0x4fa7('0x41')]=_0x442899;return _0x3fd169;})[_0x4fa7('0x21')](respondWithFilteredResult(_0x84ca5e,_0x397dc5))[_0x4fa7('0x42')](handleError(_0x84ca5e,null));};exports[_0x4fa7('0x43')]=function(_0x4ff580,_0x322283){var _0x3b3903={'raw':!![],'where':{'id':_0x4ff580[_0x4fa7('0x44')]['id']}},_0x545c50={};_0x545c50[_0x4fa7('0x30')]=_[_0x4fa7('0x2e')](db[_0x4fa7('0x29')][_0x4fa7('0x2a')]);_0x545c50[_0x4fa7('0x34')]=_['keys'](_0x4ff580[_0x4fa7('0x34')]);_0x545c50[_0x4fa7('0x39')]=_[_0x4fa7('0x2f')](_0x545c50[_0x4fa7('0x30')],_0x545c50[_0x4fa7('0x34')]);_0x3b3903[_0x4fa7('0x31')]=_[_0x4fa7('0x2f')](_0x545c50[_0x4fa7('0x30')],qs[_0x4fa7('0x32')](_0x4ff580['query'][_0x4fa7('0x32')]));_0x3b3903[_0x4fa7('0x31')]=_0x3b3903[_0x4fa7('0x31')][_0x4fa7('0x33')]?_0x3b3903[_0x4fa7('0x31')]:_0x545c50[_0x4fa7('0x30')];if(_0x4ff580['query'][_0x4fa7('0x3e')]){_0x3b3903['include']=[{'all':!![]}];}_0x3b3903=_[_0x4fa7('0x3c')]({},_0x3b3903,_0x4ff580[_0x4fa7('0x3d')]);return db[_0x4fa7('0x29')]['find'](_0x3b3903)[_0x4fa7('0x21')](handleEntityNotFound(_0x322283,null))[_0x4fa7('0x21')](respondWithResult(_0x322283,null))['catch'](handleError(_0x322283,null));};exports[_0x4fa7('0x45')]=function(_0x23ca01,_0x500834){return db[_0x4fa7('0x29')][_0x4fa7('0x45')](_0x23ca01[_0x4fa7('0x46')],{})[_0x4fa7('0x21')](respondWithResult(_0x500834,0xc9))[_0x4fa7('0x42')](handleError(_0x500834,null));};exports['update']=function(_0x2e2dfe,_0x45059d){if(_0x2e2dfe[_0x4fa7('0x46')]['id']){delete _0x2e2dfe[_0x4fa7('0x46')]['id'];}return db[_0x4fa7('0x29')][_0x4fa7('0x47')]({'where':{'id':_0x2e2dfe[_0x4fa7('0x44')]['id']}})['then'](handleEntityNotFound(_0x45059d,null))[_0x4fa7('0x21')](saveUpdates(_0x2e2dfe[_0x4fa7('0x46')],null))['then'](respondWithResult(_0x45059d,null))[_0x4fa7('0x42')](handleError(_0x45059d,null));};exports[_0x4fa7('0x22')]=function(_0x51d06f,_0x3b1418){return db[_0x4fa7('0x29')][_0x4fa7('0x47')]({'where':{'id':_0x51d06f['params']['id']}})['then'](handleEntityNotFound(_0x3b1418,null))[_0x4fa7('0x21')](removeEntity(_0x3b1418,null))['catch'](handleError(_0x3b1418,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 730f122..35f2859 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 _0x8189=['moment','request-promise','rimraf','../../config/environment','./intDeskField.attributes','define','desk_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x5c1930,_0x1b15e7){var _0x163a34=function(_0x52b4b5){while(--_0x52b4b5){_0x5c1930['push'](_0x5c1930['shift']());}};_0x163a34(++_0x1b15e7);}(_0x8189,0x11d));var _0x9818=function(_0x3a7b1d,_0x2d51b8){_0x3a7b1d=_0x3a7b1d-0x0;var _0x5ea1a4=_0x8189[_0x3a7b1d];return _0x5ea1a4;};'use strict';var _=require('lodash');var util=require(_0x9818('0x0'));var logger=require(_0x9818('0x1'))(_0x9818('0x2'));var moment=require(_0x9818('0x3'));var BPromise=require('bluebird');var rp=require(_0x9818('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9818('0x5'));var config=require(_0x9818('0x6'));var attributes=require(_0x9818('0x7'));module['exports']=function(_0x2164bc,_0x4cf17e){return _0x2164bc[_0x9818('0x8')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x9818('0x9'),'fields':[_0x9818('0xa'),_0x9818('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3909=['request-promise','path','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x35ba71,_0xa2fbbd){var _0x5f04f4=function(_0x30a04f){while(--_0x30a04f){_0x35ba71['push'](_0x35ba71['shift']());}};_0x5f04f4(++_0xa2fbbd);}(_0x3909,0x72));var _0x9390=function(_0x2aa48b,_0x5a4446){_0x2aa48b=_0x2aa48b-0x0;var _0x48caf8=_0x3909[_0x2aa48b];return _0x48caf8;};'use strict';var _=require(_0x9390('0x0'));var util=require(_0x9390('0x1'));var logger=require(_0x9390('0x2'))(_0x9390('0x3'));var moment=require(_0x9390('0x4'));var BPromise=require(_0x9390('0x5'));var rp=require(_0x9390('0x6'));var fs=require('fs');var path=require(_0x9390('0x7'));var rimraf=require(_0x9390('0x8'));var config=require('../../config/environment');var attributes=require(_0x9390('0x9'));module[_0x9390('0xa')]=function(_0x1e7f64,_0x541962){return _0x1e7f64['define'](_0x9390('0xb'),attributes,{'tableName':_0x9390('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x9390('0xd'),_0x9390('0xe')],'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 a4502f0..33f9188 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 _0x97a5=['client','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x349a13,_0x3cd835){var _0x47ddc0=function(_0x55c81e){while(--_0x55c81e){_0x349a13['push'](_0x349a13['shift']());}};_0x47ddc0(++_0x3cd835);}(_0x97a5,0x158));var _0x597a=function(_0x3407be,_0x3ad78b){_0x3407be=_0x3407be-0x0;var _0x1743e2=_0x97a5[_0x3407be];return _0x1743e2;};'use strict';var _=require(_0x597a('0x0'));var util=require(_0x597a('0x1'));var moment=require(_0x597a('0x2'));var BPromise=require('bluebird');var rs=require(_0x597a('0x3'));var fs=require('fs');var Redis=require(_0x597a('0x4'));var db=require(_0x597a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x597a('0x6'))(_0x597a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x597a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34d10b,_0x31fefe,_0x57c5a9){return new BPromise(function(_0x5c8eb0,_0xd6e8a0){return client[_0x597a('0x9')](_0x34d10b,_0x57c5a9)[_0x597a('0xa')](function(_0x1508cf){logger['info'](_0x597a('0xb'),_0x31fefe,_0x597a('0xc'));logger[_0x597a('0xd')](_0x597a('0xe'),_0x31fefe,_0x597a('0xc'),JSON[_0x597a('0xf')](_0x1508cf));if(_0x1508cf['error']){if(_0x1508cf['error'][_0x597a('0x10')]===0x1f4){logger[_0x597a('0x11')]('DeskField,\x20%s,\x20%s',_0x31fefe,_0x1508cf['error'][_0x597a('0x12')]);return _0xd6e8a0(_0x1508cf[_0x597a('0x11')][_0x597a('0x12')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x31fefe,_0x1508cf['error'][_0x597a('0x12')]);return _0x5c8eb0(_0x1508cf[_0x597a('0x11')]['message']);}else{logger[_0x597a('0x13')](_0x597a('0xb'),_0x31fefe,'request\x20sent');_0x5c8eb0(_0x1508cf[_0x597a('0x14')]['message']);}})[_0x597a('0x15')](function(_0x382e8a){logger['error'](_0x597a('0xb'),_0x31fefe,_0x382e8a);_0xd6e8a0(_0x382e8a);});});} \ No newline at end of file +var _0xcbda=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcbda,0x12d));var _0xacbd=function(_0x2c34c6,_0x10348c){_0x2c34c6=_0x2c34c6-0x0;var _0xd27a1d=_0xcbda[_0x2c34c6];return _0xd27a1d;};'use strict';var _=require('lodash');var util=require(_0xacbd('0x0'));var moment=require(_0xacbd('0x1'));var BPromise=require('bluebird');var rs=require(_0xacbd('0x2'));var fs=require('fs');var Redis=require(_0xacbd('0x3'));var db=require(_0xacbd('0x4'))['db'];var utils=require(_0xacbd('0x5'));var logger=require(_0xacbd('0x6'))(_0xacbd('0x7'));var config=require(_0xacbd('0x8'));var jayson=require(_0xacbd('0x9'));var client=jayson[_0xacbd('0xa')][_0xacbd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48cc83,_0x200f5d,_0x122b35){return new BPromise(function(_0x4ef4be,_0x2f4f2a){return client[_0xacbd('0xc')](_0x48cc83,_0x122b35)[_0xacbd('0xd')](function(_0x5e9a18){logger[_0xacbd('0xe')](_0xacbd('0xf'),_0x200f5d,_0xacbd('0x10'));logger[_0xacbd('0x11')](_0xacbd('0x12'),_0x200f5d,'request\x20sent',JSON[_0xacbd('0x13')](_0x5e9a18));if(_0x5e9a18[_0xacbd('0x14')]){if(_0x5e9a18[_0xacbd('0x14')][_0xacbd('0x15')]===0x1f4){logger[_0xacbd('0x14')]('DeskField,\x20%s,\x20%s',_0x200f5d,_0x5e9a18[_0xacbd('0x14')][_0xacbd('0x16')]);return _0x2f4f2a(_0x5e9a18[_0xacbd('0x14')]['message']);}logger['error']('DeskField,\x20%s,\x20%s',_0x200f5d,_0x5e9a18[_0xacbd('0x14')][_0xacbd('0x16')]);return _0x4ef4be(_0x5e9a18[_0xacbd('0x14')][_0xacbd('0x16')]);}else{logger['info'](_0xacbd('0xf'),_0x200f5d,_0xacbd('0x10'));_0x4ef4be(_0x5e9a18[_0xacbd('0x17')][_0xacbd('0x16')]);}})[_0xacbd('0x18')](function(_0x227b20){logger['error']('DeskField,\x20%s,\x20%s',_0x200f5d,_0x227b20);_0x2f4f2a(_0x227b20);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 7a11244..1c36ed3 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 _0x296a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x310d47,_0x4c8db8){var _0x2683fe=function(_0x476109){while(--_0x476109){_0x310d47['push'](_0x310d47['shift']());}};_0x2683fe(++_0x4c8db8);}(_0x296a,0xe3));var _0xa296=function(_0x486d8c,_0x2c5530){_0x486d8c=_0x486d8c-0x0;var _0x30f9f8=_0x296a[_0x486d8c];return _0x30f9f8;};'use strict';var multer=require(_0xa296('0x0'));var util=require(_0xa296('0x1'));var path=require(_0xa296('0x2'));var timeout=require(_0xa296('0x3'));var express=require(_0xa296('0x4'));var router=express[_0xa296('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa296('0x6'));var interaction=require(_0xa296('0x7'));var config=require(_0xa296('0x8'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa296('0x9')]);router[_0xa296('0xa')]('/:id',auth[_0xa296('0xb')](),controller['show']);router['get'](_0xa296('0xc'),auth[_0xa296('0xb')](),controller[_0xa296('0xd')]);router[_0xa296('0xa')](_0xa296('0xe'),auth['isAuthenticated'](),controller[_0xa296('0xf')]);router[_0xa296('0x10')]('/',auth[_0xa296('0xb')](),controller['create']);router['post'](_0xa296('0xc'),auth[_0xa296('0xb')](),controller['addConfiguration']);router['put'](_0xa296('0x11'),auth[_0xa296('0xb')](),controller[_0xa296('0x12')]);router[_0xa296('0x13')](_0xa296('0x11'),auth[_0xa296('0xb')](),controller[_0xa296('0x14')]);module['exports']=router; \ No newline at end of file +var _0x347a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','index','get','isAuthenticated','show','/:id/fields','post','create','/:id/configurations','addConfiguration','put','/:id','update','exports','util','connect-timeout','express'];(function(_0x2395c4,_0x4120c4){var _0x5576ad=function(_0x33745a){while(--_0x33745a){_0x2395c4['push'](_0x2395c4['shift']());}};_0x5576ad(++_0x4120c4);}(_0x347a,0x18c));var _0xa347=function(_0x4cfc35,_0xb52690){_0x4cfc35=_0x4cfc35-0x0;var _0x43a384=_0x347a[_0x4cfc35];return _0x43a384;};'use strict';var multer=require('multer');var util=require(_0xa347('0x0'));var path=require('path');var timeout=require(_0xa347('0x1'));var express=require(_0xa347('0x2'));var router=express[_0xa347('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa347('0x4'));var interaction=require(_0xa347('0x5'));var config=require(_0xa347('0x6'));var controller=require(_0xa347('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa347('0x8')]);router[_0xa347('0x9')]('/:id',auth[_0xa347('0xa')](),controller[_0xa347('0xb')]);router[_0xa347('0x9')]('/:id/configurations',auth[_0xa347('0xa')](),controller['getConfigurations']);router[_0xa347('0x9')](_0xa347('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xa347('0xd')]('/',auth['isAuthenticated'](),controller[_0xa347('0xe')]);router[_0xa347('0xd')](_0xa347('0xf'),auth[_0xa347('0xa')](),controller[_0xa347('0x10')]);router[_0xa347('0x11')](_0xa347('0x12'),auth[_0xa347('0xa')](),controller[_0xa347('0x13')]);router['delete'](_0xa347('0x12'),auth[_0xa347('0xa')](),controller['destroy']);module[_0xa347('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 8448c3e..9ee14e8 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 _0x965d=['exports','STRING','sequelize'];(function(_0x4ba0e0,_0x1ade33){var _0x4983c0=function(_0x3269cf){while(--_0x3269cf){_0x4ba0e0['push'](_0x4ba0e0['shift']());}};_0x4983c0(++_0x1ade33);}(_0x965d,0x1be));var _0xd965=function(_0x791cb0,_0x5860e0){_0x791cb0=_0x791cb0-0x0;var _0x5844df=_0x965d[_0x791cb0];return _0x5844df;};'use strict';var Sequelize=require(_0xd965('0x0'));module[_0xd965('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd965('0x2')]},'password':{'type':Sequelize[_0xd965('0x2')]},'remoteUri':{'type':Sequelize[_0xd965('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd965('0x2')]},'clientSecret':{'type':Sequelize[_0xd965('0x2')]},'serverUrl':{'type':Sequelize[_0xd965('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x5e8d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5d7828,_0x16aa10){var _0x12f8c1=function(_0x28741b){while(--_0x28741b){_0x5d7828['push'](_0x5d7828['shift']());}};_0x12f8c1(++_0x16aa10);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x55b2b9,_0x43974f){_0x55b2b9=_0x55b2b9-0x0;var _0x4a0eb0=_0x5e8d[_0x55b2b9];return _0x4a0eb0;};'use strict';var Sequelize=require(_0xd5e8('0x0'));module[_0xd5e8('0x1')]={'name':{'type':Sequelize[_0xd5e8('0x2')]},'username':{'type':Sequelize[_0xd5e8('0x2')]},'password':{'type':Sequelize[_0xd5e8('0x2')]},'remoteUri':{'type':Sequelize[_0xd5e8('0x2')]},'tenantId':{'type':Sequelize[_0xd5e8('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xd5e8('0x2')]},'serverUrl':{'type':Sequelize[_0xd5e8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xd5e8('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 8452702..942001a 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 _0xb427=['findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','Incident','PhoneCall','description','customerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','modernAuthentication','access_token','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','Attributes','includes','@odata.type','push','all','isNil','BooleanAttributeMetadata','forEach','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','EntityDefinitions(','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','LogicalName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../config/logger','api','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','status','end','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x5e44af,_0x433fd7){var _0x30b0e6=function(_0x674102){while(--_0x674102){_0x5e44af['push'](_0x5e44af['shift']());}};_0x30b0e6(++_0x433fd7);}(_0xb427,0x139));var _0x7b42=function(_0x3c08b2,_0x248334){_0x3c08b2=_0x3c08b2-0x0;var _0x68aedd=_0xb427[_0x3c08b2];return _0x68aedd;};'use strict';var rp=require('request-promise');var util=require(_0x7b42('0x0'));var _=require(_0x7b42('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x7b42('0x2'))(_0x7b42('0x3'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x3ccb4d,_0x19ccc6){_0x19ccc6=_0x19ccc6||0xc8;return function(_0x8ef046){if(_0x8ef046){return _0x3ccb4d['status'](_0x19ccc6)[_0x7b42('0x4')](_0x8ef046);}};}function respondWithFilteredResult(_0x544058,_0xa7e09d){return function(_0x441a98){if(_0x441a98){var _0x373384=typeof _0xa7e09d[_0x7b42('0x5')]===_0x7b42('0x6')&&typeof _0xa7e09d['limit']==='undefined';var _0x261ccc=_0x441a98['count'];var _0x28b1db=_0x373384?0x0:_0xa7e09d[_0x7b42('0x5')];var _0x345321=_0x373384?_0x441a98[_0x7b42('0x7')]:_0xa7e09d['offset']+_0xa7e09d[_0x7b42('0x8')];var _0x2fb893;if(_0x345321>=_0x261ccc){_0x345321=_0x261ccc;_0x2fb893=0xc8;}else{_0x2fb893=0xce;}_0x544058['status'](_0x2fb893);return _0x544058[_0x7b42('0x9')](_0x7b42('0xa'),_0x28b1db+'-'+_0x345321+'/'+_0x261ccc)[_0x7b42('0x4')](_0x441a98);}return null;};}function saveUpdates(_0x56dff7){return function(_0x40152b){if(_0x40152b){return _0x40152b[_0x7b42('0xb')](_0x56dff7)['then'](function(_0x4282f7){return _0x4282f7;});}return null;};}function removeEntity(_0x4b82af){return function(_0x34adc5){if(_0x34adc5){return _0x34adc5[_0x7b42('0xc')]()[_0x7b42('0xd')](function(){_0x4b82af[_0x7b42('0xe')](0xcc)[_0x7b42('0xf')]();});}};}function handleEntityNotFound(_0x5d5bea){return function(_0x4853ac){if(!_0x4853ac){_0x5d5bea['sendStatus'](0x194);}return _0x4853ac;};}function handleError(_0x3f022b,_0x54c7ad){_0x54c7ad=_0x54c7ad||0x1f4;return function(_0x3adae0){logger[_0x7b42('0x10')](_0x3adae0[_0x7b42('0x11')]);if(_0x3adae0[_0x7b42('0x12')]){delete _0x3adae0['name'];}_0x3f022b[_0x7b42('0xe')](_0x54c7ad)[_0x7b42('0x13')](_0x3adae0);};}exports[_0x7b42('0x14')]=function(_0x449c,_0x2ce939){var _0x45832b={},_0xe7a746={},_0x616a3e={'count':0x0,'rows':[]};var _0x2cab56=_['map'](db[_0x7b42('0x15')][_0x7b42('0x16')],function(_0x247051){return{'name':_0x247051[_0x7b42('0x17')],'type':_0x247051[_0x7b42('0x18')]['key']};});_0xe7a746['model']=_['map'](_0x2cab56,_0x7b42('0x12'));_0xe7a746['query']=_[_0x7b42('0x19')](_0x449c[_0x7b42('0x1a')]);_0xe7a746[_0x7b42('0x1b')]=_[_0x7b42('0x1c')](_0xe7a746['model'],_0xe7a746['query']);_0x45832b['attributes']=_[_0x7b42('0x1c')](_0xe7a746[_0x7b42('0x1d')],qs[_0x7b42('0x1e')](_0x449c[_0x7b42('0x1a')][_0x7b42('0x1e')]));_0x45832b[_0x7b42('0x1f')]=_0x45832b[_0x7b42('0x1f')][_0x7b42('0x20')]?_0x45832b[_0x7b42('0x1f')]:_0xe7a746[_0x7b42('0x1d')];if(!_0x449c['query'][_0x7b42('0x21')](_0x7b42('0x22'))){_0x45832b[_0x7b42('0x8')]=qs[_0x7b42('0x8')](_0x449c[_0x7b42('0x1a')][_0x7b42('0x8')]);_0x45832b[_0x7b42('0x5')]=qs[_0x7b42('0x5')](_0x449c[_0x7b42('0x1a')][_0x7b42('0x5')]);}_0x45832b[_0x7b42('0x23')]=qs[_0x7b42('0x24')](_0x449c[_0x7b42('0x1a')][_0x7b42('0x24')]);_0x45832b['where']=qs[_0x7b42('0x1b')](_[_0x7b42('0x25')](_0x449c[_0x7b42('0x1a')],_0xe7a746[_0x7b42('0x1b')]),_0x2cab56);if(_0x449c[_0x7b42('0x1a')][_0x7b42('0x26')]){_0x45832b[_0x7b42('0x27')]=_['merge'](_0x45832b[_0x7b42('0x27')],{'$or':_[_0x7b42('0x28')](_0x2cab56,function(_0x4db7db){if(_0x4db7db['type']!=='VIRTUAL'){var _0x1128e0={};_0x1128e0[_0x4db7db['name']]={'$like':'%'+_0x449c[_0x7b42('0x1a')][_0x7b42('0x26')]+'%'};return _0x1128e0;}})});}_0x45832b=_[_0x7b42('0x29')]({},_0x45832b,_0x449c[_0x7b42('0x2a')]);var _0x16ad3a={'where':_0x45832b[_0x7b42('0x27')]};return db[_0x7b42('0x15')][_0x7b42('0x7')](_0x16ad3a)['then'](function(_0x36a652){_0x616a3e[_0x7b42('0x7')]=_0x36a652;if(_0x449c[_0x7b42('0x1a')][_0x7b42('0x2b')]){_0x45832b[_0x7b42('0x2c')]=[{'all':!![]}];}return db[_0x7b42('0x15')][_0x7b42('0x2d')](_0x45832b);})[_0x7b42('0xd')](function(_0x52259f){_0x616a3e[_0x7b42('0x2e')]=_0x52259f;return _0x616a3e;})[_0x7b42('0xd')](respondWithFilteredResult(_0x2ce939,_0x45832b))[_0x7b42('0x2f')](handleError(_0x2ce939,null));};exports[_0x7b42('0x30')]=function(_0x3a9337,_0x266d92){var _0x243c78={'raw':![],'where':{'id':_0x3a9337[_0x7b42('0x31')]['id']}},_0x44d28d={};_0x44d28d[_0x7b42('0x1d')]=_[_0x7b42('0x19')](db[_0x7b42('0x15')][_0x7b42('0x16')]);_0x44d28d['query']=_[_0x7b42('0x19')](_0x3a9337[_0x7b42('0x1a')]);_0x44d28d[_0x7b42('0x1b')]=_[_0x7b42('0x1c')](_0x44d28d[_0x7b42('0x1d')],_0x44d28d[_0x7b42('0x1a')]);_0x243c78[_0x7b42('0x1f')]=_['intersection'](_0x44d28d[_0x7b42('0x1d')],qs[_0x7b42('0x1e')](_0x3a9337['query'][_0x7b42('0x1e')]));_0x243c78[_0x7b42('0x1f')]=_0x243c78[_0x7b42('0x1f')][_0x7b42('0x20')]?_0x243c78[_0x7b42('0x1f')]:_0x44d28d[_0x7b42('0x1d')];if(_0x3a9337[_0x7b42('0x1a')][_0x7b42('0x2b')]){_0x243c78['include']=[{'all':!![]}];}_0x243c78=_['merge']({},_0x243c78,_0x3a9337[_0x7b42('0x2a')]);return db['Dynamics365Account'][_0x7b42('0x32')](_0x243c78)[_0x7b42('0xd')](handleEntityNotFound(_0x266d92,null))[_0x7b42('0xd')](respondWithResult(_0x266d92,null))[_0x7b42('0x2f')](handleError(_0x266d92,null));};exports[_0x7b42('0x33')]=function(_0x6b344d,_0x3e84b5){return db['Dynamics365Account'][_0x7b42('0x33')](_0x6b344d[_0x7b42('0x34')],{})[_0x7b42('0xd')](respondWithResult(_0x3e84b5,0xc9))[_0x7b42('0x2f')](handleError(_0x3e84b5,null));};exports[_0x7b42('0xb')]=function(_0x3fbb97,_0x3a4618){if(_0x3fbb97[_0x7b42('0x34')]['id']){delete _0x3fbb97[_0x7b42('0x34')]['id'];}return db[_0x7b42('0x15')][_0x7b42('0x32')]({'where':{'id':_0x3fbb97['params']['id']}})[_0x7b42('0xd')](handleEntityNotFound(_0x3a4618,null))['then'](saveUpdates(_0x3fbb97[_0x7b42('0x34')],null))[_0x7b42('0xd')](respondWithResult(_0x3a4618,null))[_0x7b42('0x2f')](handleError(_0x3a4618,null));};exports[_0x7b42('0xc')]=function(_0x473923,_0x269b3f){return db['Dynamics365Account'][_0x7b42('0x32')]({'where':{'id':_0x473923[_0x7b42('0x31')]['id']}})[_0x7b42('0xd')](handleEntityNotFound(_0x269b3f,null))[_0x7b42('0xd')](removeEntity(_0x269b3f,null))[_0x7b42('0x2f')](handleError(_0x269b3f,null));};exports['getConfigurations']=function(_0x5c35f3,_0x2f1e11){var _0x5219cf={};var _0x4a35d2={};var _0x32ac65;var _0x28718d;return db[_0x7b42('0x15')][_0x7b42('0x35')]({'where':{'id':_0x5c35f3[_0x7b42('0x31')]['id']}})[_0x7b42('0xd')](handleEntityNotFound(_0x2f1e11,null))['then'](function(_0x5e4a84){if(_0x5e4a84){_0x32ac65=_0x5e4a84;_0x4a35d2['model']=_[_0x7b42('0x19')](db[_0x7b42('0x36')]['rawAttributes']);_0x4a35d2[_0x7b42('0x1a')]=_[_0x7b42('0x19')](_0x5c35f3[_0x7b42('0x1a')]);_0x4a35d2['filters']=_['intersection'](_0x4a35d2['model'],_0x4a35d2[_0x7b42('0x1a')]);_0x5219cf[_0x7b42('0x1f')]=_[_0x7b42('0x1c')](_0x4a35d2[_0x7b42('0x1d')],qs[_0x7b42('0x1e')](_0x5c35f3['query'][_0x7b42('0x1e')]));_0x5219cf[_0x7b42('0x1f')]=_0x5219cf[_0x7b42('0x1f')][_0x7b42('0x20')]?_0x5219cf[_0x7b42('0x1f')]:_0x4a35d2[_0x7b42('0x1d')];_0x5219cf[_0x7b42('0x23')]=qs['sort'](_0x5c35f3['query'][_0x7b42('0x24')]);_0x5219cf[_0x7b42('0x27')]=qs['filters'](_[_0x7b42('0x25')](_0x5c35f3[_0x7b42('0x1a')],_0x4a35d2['filters']));if(_0x5c35f3[_0x7b42('0x1a')][_0x7b42('0x26')]){_0x5219cf[_0x7b42('0x27')]=_['merge'](_0x5219cf[_0x7b42('0x27')],{'$or':_[_0x7b42('0x28')](_0x5219cf['attributes'],function(_0x50e232){var _0x3086e8={};_0x3086e8[_0x50e232]={'$like':'%'+_0x5c35f3[_0x7b42('0x1a')]['filter']+'%'};return _0x3086e8;})});}_0x5219cf=_[_0x7b42('0x29')]({},_0x5219cf,_0x5c35f3[_0x7b42('0x2a')]);return _0x32ac65['getConfigurations'](_0x5219cf);}})[_0x7b42('0xd')](function(_0x225394){if(_0x225394){_0x28718d=_0x225394['length'];if(!_0x5c35f3[_0x7b42('0x1a')][_0x7b42('0x21')](_0x7b42('0x22'))){_0x5219cf['limit']=qs['limit'](_0x5c35f3['query']['limit']);_0x5219cf[_0x7b42('0x5')]=qs['offset'](_0x5c35f3['query']['offset']);}return _0x32ac65[_0x7b42('0x37')](_0x5219cf);}})[_0x7b42('0xd')](function(_0x3837e5){if(_0x3837e5){return _0x3837e5?{'count':_0x28718d,'rows':_0x3837e5}:null;}})['then'](respondWithResult(_0x2f1e11,null))['catch'](handleError(_0x2f1e11,null));};exports[_0x7b42('0x38')]=function(_0x3b118d,_0x775d40){if(_0x3b118d[_0x7b42('0x34')]['id']){delete _0x3b118d[_0x7b42('0x34')]['id'];}return db[_0x7b42('0x15')][_0x7b42('0x35')]({'where':{'id':_0x3b118d[_0x7b42('0x31')]['id']}})[_0x7b42('0xd')](handleEntityNotFound(_0x775d40,null))[_0x7b42('0xd')](function(_0x4e6fc3){if(_0x4e6fc3){_0x3b118d[_0x7b42('0x34')][_0x7b42('0x39')]=_0x4e6fc3['id'];_0x3b118d[_0x7b42('0x34')][_0x7b42('0x3a')]=integrations[_0x7b42('0x3b')](_0x3b118d['body'][_0x7b42('0x3c')],_0x3b118d[_0x7b42('0x34')]['type']);_0x3b118d[_0x7b42('0x34')]['Descriptions']=integrations[_0x7b42('0x3d')](_0x3b118d[_0x7b42('0x34')]['channel'],_0x3b118d[_0x7b42('0x34')][_0x7b42('0x18')]);return db['Dynamics365Configuration']['create'](_0x3b118d[_0x7b42('0x34')],{'include':[{'model':db[_0x7b42('0x3e')],'as':_0x7b42('0x3a')},{'model':db['Dynamics365Field'],'as':_0x7b42('0x3f')}]});}return null;})['then'](respondWithResult(_0x775d40,null))[_0x7b42('0x2f')](handleError(_0x775d40,null));};function sanitizeRemoteUri(_0xb34d8f){var _0x3552bc=_0xb34d8f[_0x7b42('0x40')](-0x1);if(_0x3552bc==='/')return _0xb34d8f[_0x7b42('0x41')](0x0,_0xb34d8f[_0x7b42('0x42')](_0x3552bc));return _0xb34d8f;}function getWebApiUrl(_0x9a1f4d){return util[_0x7b42('0x43')](_0x7b42('0x44'),_0x9a1f4d);}exports['getFields']=function(_0x467fad,_0x92c16a){var _0xf6612a=_0x467fad[_0x7b42('0x1a')]['ticketType'];var _0x5ef5d2=_0xf6612a==='incident'?_0x7b42('0x45'):_0x7b42('0x46');var _0x59b85e='';var _0xcba13d='';var _0x5313f6='';var _0x34c054='';var _0x350218='';var _0x220404='';var _0x39775d='';var _0x40153d='';var _0x4917b2=['title',_0x7b42('0x47'),_0x7b42('0x48'),'ownerid',_0x7b42('0x49'),'subject',_0x7b42('0x4a'),_0x7b42('0x4b'),_0x7b42('0x4c'),_0x7b42('0x4d')];var _0x535545=[_0x7b42('0x4e'),_0x7b42('0x4f'),_0x7b42('0x50'),'billedserviceunits',_0x7b42('0x51'),_0x7b42('0x52'),_0x7b42('0x53'),'contractidname','createdbyexternalpartyname',_0x7b42('0x54'),_0x7b42('0x55'),_0x7b42('0x56'),_0x7b42('0x57'),'createdonbehalfbyname',_0x7b42('0x58'),_0x7b42('0x59'),_0x7b42('0x5a'),_0x7b42('0x5b'),_0x7b42('0x5c'),'entitlementidname',_0x7b42('0x5d'),_0x7b42('0x5e'),_0x7b42('0x5f'),_0x7b42('0x60'),'firstresponsebykpiidname',_0x7b42('0x61'),'importsequencenumber','influencescore','kbarticleidname',_0x7b42('0x62'),_0x7b42('0x63'),'modifiedbyexternalpartyname',_0x7b42('0x64'),_0x7b42('0x65'),'modifiedbyyominame',_0x7b42('0x66'),_0x7b42('0x67'),_0x7b42('0x68'),_0x7b42('0x69'),_0x7b42('0x6a'),_0x7b42('0x6b'),_0x7b42('0x6c'),_0x7b42('0x6d'),_0x7b42('0x6e'),_0x7b42('0x6f'),_0x7b42('0x70'),_0x7b42('0x71'),_0x7b42('0x72'),_0x7b42('0x73'),_0x7b42('0x74'),'productidname',_0x7b42('0x75'),_0x7b42('0x76'),_0x7b42('0x77'),_0x7b42('0x78'),_0x7b42('0x79'),'responsiblecontactidyominame',_0x7b42('0x7a'),'slainvokedidname',_0x7b42('0x7b'),_0x7b42('0x7c'),_0x7b42('0x7d'),'statuscode',_0x7b42('0x7e'),_0x7b42('0x7f'),_0x7b42('0x80'),_0x7b42('0x81'),_0x7b42('0x82'),'utcconversiontimezonecode',_0x7b42('0x83')];var _0x3a5415=_0x4917b2[_0x7b42('0x84')](_0x535545);return db['Dynamics365Account'][_0x7b42('0x35')]({'where':{'id':_0x467fad[_0x7b42('0x31')]['id']},'attributes':['id',_0x7b42('0x85'),_0x7b42('0x86'),_0x7b42('0x87'),_0x7b42('0x88'),_0x7b42('0x89'),_0x7b42('0x8a'),'modernAuthentication'],'include':[{'model':db[_0x7b42('0x8b')],'as':_0x7b42('0x8b'),'attributes':['id',_0x7b42('0x8c'),'data7']}]})[_0x7b42('0xd')](handleEntityNotFound(_0x92c16a,null))[_0x7b42('0xd')](function(_0x14641b){if(_0x14641b){if(_0x14641b[_0x7b42('0x8d')]){_0x14641b[_0x7b42('0x8e')]=_0x14641b['CloudProvider']['data5'];_0x40153d=sanitizeRemoteUri(_0x14641b[_0x7b42('0x8b')]['data7']);_0x39775d=getWebApiUrl(_0x40153d);return _0x14641b;}_0x40153d=sanitizeRemoteUri(_0x14641b['remoteUri']);_0x39775d=getWebApiUrl(_0x40153d);var _0x1ef3a6={'method':_0x7b42('0x8f'),'uri':'https://login.microsoftonline.com/'+_0x14641b['tenantId']+_0x7b42('0x90'),'form':{'client_id':_0x14641b['clientId'],'resource':_0x40153d,'username':_0x14641b[_0x7b42('0x85')],'password':_0x14641b['password'],'grant_type':_0x7b42('0x86'),'client_secret':_0x14641b[_0x7b42('0x8a')]},'json':!![]};return rp(_0x1ef3a6);}})[_0x7b42('0xd')](function(_0x556098){_0x220404=_0x556098[_0x7b42('0x8e')];var _0x5eaa7c={'method':_0x7b42('0x91'),'uri':encodeURI(_0x39775d+_0x7b42('0x92')+_0x5ef5d2+'\x27'),'headers':{'Authorization':_0x7b42('0x93')+_0x220404,'If-None-Match':null,'OData-Version':_0x7b42('0x94')},'json':!![]};return rp(_0x5eaa7c);})[_0x7b42('0xd')](function(_0x2df965){var _0x59ac9e=_0x2df965['value'][0x0];var _0x72f649=_0x59ac9e[_0x7b42('0x95')];var _0x3c1d8b={'method':'GET','uri':_0x39775d+'EntityDefinitions('+_0x72f649+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x220404,'If-None-Match':null,'OData-Version':_0x7b42('0x94')},'json':!![]};return rp(_0x3c1d8b);})[_0x7b42('0xd')](function(_0x439059){_0x59b85e=_0x439059;_0xcba13d=_0x59b85e[_0x7b42('0x96')];_0xcba13d=_['remove'](_0xcba13d,function(_0x21a4be){return!_0x3a5415[_0x7b42('0x97')](_0x21a4be['LogicalName']);});var _0x547f45=[];var _0x35a47d=[];_0xcba13d['forEach'](function(_0x282bf8){if(_0x282bf8[_0x7b42('0x98')]){var _0x53744a=_0x282bf8[_0x7b42('0x98')][_0x7b42('0x41')](_0x282bf8[_0x7b42('0x98')][_0x7b42('0x42')]('.')+0x1);if(_0x53744a==='PicklistAttributeMetadata'){_0x547f45[_0x7b42('0x99')](getSelectList(_0x39775d,_0xf6612a,_0x35a47d,_0x59b85e[_0x7b42('0x95')],_0x282bf8[_0x7b42('0x95')],_0x220404));}}});return Promise[_0x7b42('0x9a')](_0x547f45);})[_0x7b42('0xd')](function(_0x52edfb){_0x5313f6=_0x52edfb[0x0];var _0x4c72f3=[];var _0x5cb118=[];_0xcba13d['forEach'](function(_0x190438){if(!_[_0x7b42('0x9b')](_0x190438[_0x7b42('0x98')])){var _0x9438ba=_0x190438[_0x7b42('0x98')][_0x7b42('0x41')](_0x190438[_0x7b42('0x98')][_0x7b42('0x42')]('.')+0x1);if(_0x9438ba===_0x7b42('0x9c')){_0x4c72f3[_0x7b42('0x99')](getBooleanList(_0x39775d,_0xf6612a,_0x5cb118,_0x59b85e['MetadataId'],_0x190438['MetadataId'],_0x220404));}}});return Promise[_0x7b42('0x9a')](_0x4c72f3);})[_0x7b42('0xd')](function(_0x2da173){_0x34c054=_0x2da173[0x0];var _0x37ef7c=[];var _0x2903f9=[];_0xcba13d[_0x7b42('0x9d')](function(_0x2281d6){if(_0x2281d6['@odata.type']){var _0x4828b6=_0x2281d6[_0x7b42('0x98')][_0x7b42('0x41')](_0x2281d6[_0x7b42('0x98')]['lastIndexOf']('.')+0x1);if(_0x4828b6===_0x7b42('0x9e')||_0x4828b6===_0x7b42('0x9f')||_0x4828b6==='BigIntAttributeMetadata'||_0x4828b6===_0x7b42('0xa0')||_0x4828b6===_0x7b42('0xa1')||_0x4828b6==='DateTimeAttributeMetadata'||_0x4828b6===_0x7b42('0xa2')||_0x4828b6==='EntityNameAttributeMetadata'||_0x4828b6===_0x7b42('0xa3')||_0x4828b6===_0x7b42('0xa4')){_0x37ef7c[_0x7b42('0x99')](getInputList(_0x39775d,_0xf6612a,_0x4828b6,_0x2903f9,_0x59b85e[_0x7b42('0x95')],_0x2281d6[_0x7b42('0x95')],_0x220404));}}});return Promise[_0x7b42('0x9a')](_0x37ef7c);})['then'](function(_0x11e56f){_0x350218=_0x11e56f[0x0];var _0x4258f7=_0x5313f6[_0x7b42('0x84')](_0x34c054)['concat'](_0x350218);var _0x7951c2={'count':_0x4258f7[_0x7b42('0x20')],'rows':_0x4258f7};return _0x7951c2;})['then'](respondWithResult(_0x92c16a,null))['catch'](function(_0x326fe1){var _0x587182=_0x467fad[_0x7b42('0x1a')][_0x7b42('0xa5')]?0x1f4:_0x326fe1[_0x7b42('0xa6')]||0x1f4;logger['error'](_0x326fe1[_0x7b42('0x11')]);delete _0x326fe1[_0x7b42('0x12')];if(_0x587182===0x191){_0x587182=0x190;}_0x92c16a['status'](_0x587182)[_0x7b42('0x13')](_0x467fad[_0x7b42('0x1a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x326fe1['statusCode']}:_0x326fe1);});};function getSelectList(_0x263910,_0x1d906a,_0x49a97a,_0x46062f,_0x24e477,_0x511834){var _0x1a5a9a={'method':_0x7b42('0x91'),'uri':_0x263910+_0x7b42('0xa7')+_0x46062f+')/Attributes('+_0x24e477+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x7b42('0x93')+_0x511834,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1a5a9a)['then'](function(_0x3c4fb8){var _0x17c0af=[];var _0x19d55d=_0x3c4fb8[_0x7b42('0xa8')][_0x7b42('0xa9')];_0x19d55d[_0x7b42('0x9d')](function(_0x71d32b){_0x17c0af[_0x7b42('0x99')]({'name':_0x71d32b['Label'][_0x7b42('0xaa')][_0x7b42('0xab')],'value':String(_0x71d32b[_0x7b42('0xac')])});});var _0x3dd14d={'id':_0x1d906a+'_'+_0x3c4fb8['LogicalName'],'name':_0x3c4fb8[_0x7b42('0xad')]['UserLocalizedLabel'][_0x7b42('0xab')],'custom':![],'options':_0x17c0af};_0x49a97a[_0x7b42('0x99')](_0x3dd14d);return _0x49a97a;});}function getBooleanList(_0x476778,_0x39c645,_0x44775a,_0x23e477,_0x253a9a,_0x1fb3fe){var _0x46dd0f={'method':_0x7b42('0x91'),'uri':_0x476778+'EntityDefinitions('+_0x23e477+_0x7b42('0xae')+_0x253a9a+_0x7b42('0xaf'),'headers':{'Authorization':_0x7b42('0x93')+_0x1fb3fe,'If-None-Match':null,'OData-Version':_0x7b42('0x94')},'json':!![]};return rp(_0x46dd0f)['then'](function(_0x171cf0){var _0x330ef5=[];_0x330ef5[_0x7b42('0x99')]({'name':_0x171cf0[_0x7b42('0xa8')][_0x7b42('0xb0')][_0x7b42('0xab')][_0x7b42('0xaa')][_0x7b42('0xab')],'value':_0x7b42('0xb1')},{'name':_0x171cf0[_0x7b42('0xa8')][_0x7b42('0xb2')]['Label']['UserLocalizedLabel'][_0x7b42('0xab')],'value':_0x7b42('0xb3')});var _0x2682f4={'id':_0x39c645+'_'+_0x171cf0[_0x7b42('0xb4')],'name':_0x171cf0[_0x7b42('0xad')][_0x7b42('0xaa')][_0x7b42('0xab')],'custom':![],'options':_0x330ef5};_0x44775a[_0x7b42('0x99')](_0x2682f4);return _0x44775a;});}function getInputList(_0x4057c7,_0x284b2b,_0x18cc10,_0x2e1613,_0x35a6c0,_0x1d4f7c,_0xa5e040){var _0x1fe5f4={'method':'GET','uri':_0x4057c7+'EntityDefinitions('+_0x35a6c0+_0x7b42('0xae')+_0x1d4f7c+_0x7b42('0xb5')+_0x18cc10+_0x7b42('0xb6'),'headers':{'Authorization':_0x7b42('0x93')+_0xa5e040,'If-None-Match':null,'OData-Version':_0x7b42('0x94')},'json':!![]};return rp(_0x1fe5f4)[_0x7b42('0xd')](function(_0x4aa6bc){var _0x1ed7e6={'id':_0x284b2b+'_'+_0x4aa6bc[_0x7b42('0xb4')],'name':_0x4aa6bc[_0x7b42('0xad')][_0x7b42('0xaa')]?_0x4aa6bc['DisplayName'][_0x7b42('0xaa')][_0x7b42('0xab')]:_0x4aa6bc[_0x7b42('0xb4')],'custom':![],'options':[]};_0x2e1613[_0x7b42('0x99')](_0x1ed7e6);return _0x2e1613;});} \ No newline at end of file +var _0x01b7=['EntityNameAttributeMetadata','StateAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','limit','undefined','count','offset','json','then','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','Dynamics365Account','findAll','catch','params','keys','includeAll','include','create','body','find','destroy','getConfigurations','findOne','Dynamics365Configuration','filter','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','substring','lastIndexOf','getFields','incident','Incident','PhoneCall','title','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','username','password','remoteUri','tenantId','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','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','forEach','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata'];(function(_0x5f46c7,_0x18023c){var _0x499788=function(_0x34e009){while(--_0x34e009){_0x5f46c7['push'](_0x5f46c7['shift']());}};_0x499788(++_0x18023c);}(_0x01b7,0x17f));var _0x701b=function(_0x82d330,_0x3040b0){_0x82d330=_0x82d330-0x0;var _0x39b5c5=_0x01b7[_0x82d330];return _0x39b5c5;};'use strict';var rp=require(_0x701b('0x0'));var util=require(_0x701b('0x1'));var _=require(_0x701b('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x701b('0x3'))(_0x701b('0x4'));var db=require(_0x701b('0x5'))['db'];var integrations=require(_0x701b('0x6'));function respondWithResult(_0x298b6e,_0x224915){_0x224915=_0x224915||0xc8;return function(_0x78d010){if(_0x78d010){return _0x298b6e[_0x701b('0x7')](_0x224915)['json'](_0x78d010);}};}function respondWithFilteredResult(_0x3f33cb,_0x2b032e){return function(_0x2be3dc){if(_0x2be3dc){var _0x3fc7ee=typeof _0x2b032e['offset']==='undefined'&&typeof _0x2b032e[_0x701b('0x8')]===_0x701b('0x9');var _0x299a80=_0x2be3dc[_0x701b('0xa')];var _0x440dda=_0x3fc7ee?0x0:_0x2b032e[_0x701b('0xb')];var _0x451b45=_0x3fc7ee?_0x2be3dc[_0x701b('0xa')]:_0x2b032e[_0x701b('0xb')]+_0x2b032e[_0x701b('0x8')];var _0x4a55a7;if(_0x451b45>=_0x299a80){_0x451b45=_0x299a80;_0x4a55a7=0xc8;}else{_0x4a55a7=0xce;}_0x3f33cb[_0x701b('0x7')](_0x4a55a7);return _0x3f33cb['set']('Content-Range',_0x440dda+'-'+_0x451b45+'/'+_0x299a80)[_0x701b('0xc')](_0x2be3dc);}return null;};}function saveUpdates(_0x5df946){return function(_0x56a0ce){if(_0x56a0ce){return _0x56a0ce['update'](_0x5df946)[_0x701b('0xd')](function(_0x24e391){return _0x24e391;});}return null;};}function removeEntity(_0x1e3c60){return function(_0x1e0420){if(_0x1e0420){return _0x1e0420['destroy']()[_0x701b('0xd')](function(){_0x1e3c60[_0x701b('0x7')](0xcc)[_0x701b('0xe')]();});}};}function handleEntityNotFound(_0x25135c){return function(_0x4a16e7){if(!_0x4a16e7){_0x25135c[_0x701b('0xf')](0x194);}return _0x4a16e7;};}function handleError(_0x2b07a9,_0x218eaa){_0x218eaa=_0x218eaa||0x1f4;return function(_0x313d13){logger[_0x701b('0x10')](_0x313d13[_0x701b('0x11')]);if(_0x313d13[_0x701b('0x12')]){delete _0x313d13[_0x701b('0x12')];}_0x2b07a9[_0x701b('0x7')](_0x218eaa)[_0x701b('0x13')](_0x313d13);};}exports['index']=function(_0x306b98,_0x50dda6){var _0x407023={},_0x829d={},_0x23298f={'count':0x0,'rows':[]};var _0x1f36d8=_[_0x701b('0x14')](db['Dynamics365Account'][_0x701b('0x15')],function(_0x1414a9){return{'name':_0x1414a9[_0x701b('0x16')],'type':_0x1414a9[_0x701b('0x17')][_0x701b('0x18')]};});_0x829d[_0x701b('0x19')]=_[_0x701b('0x14')](_0x1f36d8,'name');_0x829d[_0x701b('0x1a')]=_['keys'](_0x306b98[_0x701b('0x1a')]);_0x829d[_0x701b('0x1b')]=_['intersection'](_0x829d[_0x701b('0x19')],_0x829d['query']);_0x407023[_0x701b('0x1c')]=_[_0x701b('0x1d')](_0x829d[_0x701b('0x19')],qs[_0x701b('0x1e')](_0x306b98[_0x701b('0x1a')][_0x701b('0x1e')]));_0x407023['attributes']=_0x407023[_0x701b('0x1c')][_0x701b('0x1f')]?_0x407023[_0x701b('0x1c')]:_0x829d['model'];if(!_0x306b98['query'][_0x701b('0x20')]('nolimit')){_0x407023[_0x701b('0x8')]=qs['limit'](_0x306b98[_0x701b('0x1a')][_0x701b('0x8')]);_0x407023[_0x701b('0xb')]=qs[_0x701b('0xb')](_0x306b98[_0x701b('0x1a')]['offset']);}_0x407023[_0x701b('0x21')]=qs[_0x701b('0x22')](_0x306b98[_0x701b('0x1a')][_0x701b('0x22')]);_0x407023[_0x701b('0x23')]=qs[_0x701b('0x1b')](_['pick'](_0x306b98[_0x701b('0x1a')],_0x829d[_0x701b('0x1b')]),_0x1f36d8);if(_0x306b98['query']['filter']){_0x407023[_0x701b('0x23')]=_[_0x701b('0x24')](_0x407023[_0x701b('0x23')],{'$or':_[_0x701b('0x14')](_0x1f36d8,function(_0x5e56d8){if(_0x5e56d8['type']!==_0x701b('0x25')){var _0x384c3b={};_0x384c3b[_0x5e56d8[_0x701b('0x12')]]={'$like':'%'+_0x306b98[_0x701b('0x1a')]['filter']+'%'};return _0x384c3b;}})});}_0x407023=_[_0x701b('0x24')]({},_0x407023,_0x306b98[_0x701b('0x26')]);var _0x1e2b2f={'where':_0x407023[_0x701b('0x23')]};return db[_0x701b('0x27')][_0x701b('0xa')](_0x1e2b2f)[_0x701b('0xd')](function(_0x5b0751){_0x23298f[_0x701b('0xa')]=_0x5b0751;if(_0x306b98['query']['includeAll']){_0x407023['include']=[{'all':!![]}];}return db[_0x701b('0x27')][_0x701b('0x28')](_0x407023);})[_0x701b('0xd')](function(_0x6ec561){_0x23298f['rows']=_0x6ec561;return _0x23298f;})['then'](respondWithFilteredResult(_0x50dda6,_0x407023))[_0x701b('0x29')](handleError(_0x50dda6,null));};exports['show']=function(_0x38086c,_0x13d57f){var _0x243979={'raw':![],'where':{'id':_0x38086c[_0x701b('0x2a')]['id']}},_0x43d8f9={};_0x43d8f9[_0x701b('0x19')]=_['keys'](db[_0x701b('0x27')][_0x701b('0x15')]);_0x43d8f9[_0x701b('0x1a')]=_[_0x701b('0x2b')](_0x38086c[_0x701b('0x1a')]);_0x43d8f9[_0x701b('0x1b')]=_['intersection'](_0x43d8f9[_0x701b('0x19')],_0x43d8f9[_0x701b('0x1a')]);_0x243979[_0x701b('0x1c')]=_[_0x701b('0x1d')](_0x43d8f9[_0x701b('0x19')],qs[_0x701b('0x1e')](_0x38086c[_0x701b('0x1a')][_0x701b('0x1e')]));_0x243979[_0x701b('0x1c')]=_0x243979['attributes']['length']?_0x243979[_0x701b('0x1c')]:_0x43d8f9[_0x701b('0x19')];if(_0x38086c['query'][_0x701b('0x2c')]){_0x243979[_0x701b('0x2d')]=[{'all':!![]}];}_0x243979=_[_0x701b('0x24')]({},_0x243979,_0x38086c[_0x701b('0x26')]);return db[_0x701b('0x27')]['find'](_0x243979)[_0x701b('0xd')](handleEntityNotFound(_0x13d57f,null))['then'](respondWithResult(_0x13d57f,null))['catch'](handleError(_0x13d57f,null));};exports['create']=function(_0x323724,_0x55d9b2){return db[_0x701b('0x27')][_0x701b('0x2e')](_0x323724[_0x701b('0x2f')],{})['then'](respondWithResult(_0x55d9b2,0xc9))[_0x701b('0x29')](handleError(_0x55d9b2,null));};exports['update']=function(_0x25afa4,_0x294ecd){if(_0x25afa4[_0x701b('0x2f')]['id']){delete _0x25afa4['body']['id'];}return db[_0x701b('0x27')][_0x701b('0x30')]({'where':{'id':_0x25afa4['params']['id']}})['then'](handleEntityNotFound(_0x294ecd,null))[_0x701b('0xd')](saveUpdates(_0x25afa4[_0x701b('0x2f')],null))[_0x701b('0xd')](respondWithResult(_0x294ecd,null))['catch'](handleError(_0x294ecd,null));};exports[_0x701b('0x31')]=function(_0x47a752,_0x5a4031){return db[_0x701b('0x27')][_0x701b('0x30')]({'where':{'id':_0x47a752[_0x701b('0x2a')]['id']}})[_0x701b('0xd')](handleEntityNotFound(_0x5a4031,null))[_0x701b('0xd')](removeEntity(_0x5a4031,null))[_0x701b('0x29')](handleError(_0x5a4031,null));};exports[_0x701b('0x32')]=function(_0x51be0d,_0x49e3fa){var _0x46c452={};var _0x1274f4={};var _0x41bfab;var _0x1e9cde;return db[_0x701b('0x27')][_0x701b('0x33')]({'where':{'id':_0x51be0d[_0x701b('0x2a')]['id']}})[_0x701b('0xd')](handleEntityNotFound(_0x49e3fa,null))[_0x701b('0xd')](function(_0x4845b9){if(_0x4845b9){_0x41bfab=_0x4845b9;_0x1274f4['model']=_[_0x701b('0x2b')](db[_0x701b('0x34')][_0x701b('0x15')]);_0x1274f4['query']=_[_0x701b('0x2b')](_0x51be0d[_0x701b('0x1a')]);_0x1274f4[_0x701b('0x1b')]=_[_0x701b('0x1d')](_0x1274f4[_0x701b('0x19')],_0x1274f4[_0x701b('0x1a')]);_0x46c452['attributes']=_[_0x701b('0x1d')](_0x1274f4[_0x701b('0x19')],qs['fields'](_0x51be0d[_0x701b('0x1a')][_0x701b('0x1e')]));_0x46c452[_0x701b('0x1c')]=_0x46c452[_0x701b('0x1c')][_0x701b('0x1f')]?_0x46c452['attributes']:_0x1274f4['model'];_0x46c452[_0x701b('0x21')]=qs[_0x701b('0x22')](_0x51be0d['query']['sort']);_0x46c452[_0x701b('0x23')]=qs[_0x701b('0x1b')](_['pick'](_0x51be0d[_0x701b('0x1a')],_0x1274f4['filters']));if(_0x51be0d[_0x701b('0x1a')][_0x701b('0x35')]){_0x46c452[_0x701b('0x23')]=_[_0x701b('0x24')](_0x46c452[_0x701b('0x23')],{'$or':_[_0x701b('0x14')](_0x46c452[_0x701b('0x1c')],function(_0x2a2492){var _0x56ef71={};_0x56ef71[_0x2a2492]={'$like':'%'+_0x51be0d[_0x701b('0x1a')][_0x701b('0x35')]+'%'};return _0x56ef71;})});}_0x46c452=_[_0x701b('0x24')]({},_0x46c452,_0x51be0d[_0x701b('0x26')]);return _0x41bfab['getConfigurations'](_0x46c452);}})[_0x701b('0xd')](function(_0xe9d35d){if(_0xe9d35d){_0x1e9cde=_0xe9d35d['length'];if(!_0x51be0d[_0x701b('0x1a')][_0x701b('0x20')]('nolimit')){_0x46c452[_0x701b('0x8')]=qs[_0x701b('0x8')](_0x51be0d[_0x701b('0x1a')][_0x701b('0x8')]);_0x46c452[_0x701b('0xb')]=qs[_0x701b('0xb')](_0x51be0d[_0x701b('0x1a')][_0x701b('0xb')]);}return _0x41bfab[_0x701b('0x32')](_0x46c452);}})[_0x701b('0xd')](function(_0x9f7fa3){if(_0x9f7fa3){return _0x9f7fa3?{'count':_0x1e9cde,'rows':_0x9f7fa3}:null;}})[_0x701b('0xd')](respondWithResult(_0x49e3fa,null))[_0x701b('0x29')](handleError(_0x49e3fa,null));};exports['addConfiguration']=function(_0x1d2682,_0x3a7c5c){if(_0x1d2682[_0x701b('0x2f')]['id']){delete _0x1d2682[_0x701b('0x2f')]['id'];}return db[_0x701b('0x27')]['findOne']({'where':{'id':_0x1d2682['params']['id']}})['then'](handleEntityNotFound(_0x3a7c5c,null))[_0x701b('0xd')](function(_0x26e41f){if(_0x26e41f){_0x1d2682['body']['AccountId']=_0x26e41f['id'];_0x1d2682[_0x701b('0x2f')][_0x701b('0x36')]=integrations[_0x701b('0x37')](_0x1d2682[_0x701b('0x2f')]['channel'],_0x1d2682[_0x701b('0x2f')][_0x701b('0x17')]);_0x1d2682['body'][_0x701b('0x38')]=integrations[_0x701b('0x39')](_0x1d2682[_0x701b('0x2f')][_0x701b('0x3a')],_0x1d2682[_0x701b('0x2f')][_0x701b('0x17')]);return db[_0x701b('0x34')][_0x701b('0x2e')](_0x1d2682[_0x701b('0x2f')],{'include':[{'model':db[_0x701b('0x3b')],'as':_0x701b('0x36')},{'model':db[_0x701b('0x3b')],'as':'Descriptions'}]});}return null;})[_0x701b('0xd')](respondWithResult(_0x3a7c5c,null))[_0x701b('0x29')](handleError(_0x3a7c5c,null));};function sanitizeRemoteUri(_0x2dab8f){var _0x5876e2=_0x2dab8f['slice'](-0x1);if(_0x5876e2==='/')return _0x2dab8f[_0x701b('0x3c')](0x0,_0x2dab8f[_0x701b('0x3d')](_0x5876e2));return _0x2dab8f;}function getWebApiUrl(_0x3b8ec0){return util['format']('%s/api/data/v9.0/',_0x3b8ec0);}exports[_0x701b('0x3e')]=function(_0x2e3a7d,_0x37e972){var _0x34785f=_0x2e3a7d['query']['ticketType'];var _0xead5c8=_0x34785f===_0x701b('0x3f')?_0x701b('0x40'):_0x701b('0x41');var _0x1ca734='';var _0x29a156='';var _0x88f46b='';var _0x2ed593='';var _0x1b3848='';var _0x40c082='';var _0x46a2aa='';var _0x11e6d9='';var _0x6b3877=[_0x701b('0x42'),'description',_0x701b('0x43'),'ownerid',_0x701b('0x44'),_0x701b('0x45'),_0x701b('0x46'),_0x701b('0x47'),_0x701b('0x48'),_0x701b('0x49')];var _0x19e6db=['accountidname',_0x701b('0x4a'),'actualserviceunits',_0x701b('0x4b'),'contactidname',_0x701b('0x4c'),_0x701b('0x4d'),_0x701b('0x4e'),_0x701b('0x4f'),_0x701b('0x50'),_0x701b('0x51'),_0x701b('0x52'),'createdon',_0x701b('0x53'),_0x701b('0x54'),_0x701b('0x55'),_0x701b('0x56'),'customeridyominame','emailaddress',_0x701b('0x57'),'entityimage_timestamp','entityimage_url',_0x701b('0x58'),_0x701b('0x59'),_0x701b('0x5a'),'followupby',_0x701b('0x5b'),_0x701b('0x5c'),_0x701b('0x5d'),'lastonholdtime','masteridname','modifiedbyexternalpartyname',_0x701b('0x5e'),_0x701b('0x5f'),'modifiedbyyominame',_0x701b('0x60'),_0x701b('0x61'),_0x701b('0x62'),'msdyn_incidenttypename',_0x701b('0x63'),_0x701b('0x64'),_0x701b('0x65'),'overriddencreatedon',_0x701b('0x66'),_0x701b('0x67'),_0x701b('0x68'),_0x701b('0x69'),'primarycontactidname',_0x701b('0x6a'),_0x701b('0x6b'),_0x701b('0x6c'),_0x701b('0x6d'),_0x701b('0x6e'),_0x701b('0x6f'),_0x701b('0x70'),_0x701b('0x71'),_0x701b('0x72'),_0x701b('0x73'),'slainvokedidname',_0x701b('0x74'),_0x701b('0x75'),'statecode','statuscode','subjectidname',_0x701b('0x76'),_0x701b('0x77'),_0x701b('0x78'),_0x701b('0x79'),_0x701b('0x7a'),'versionnumber'];var _0x489d96=_0x6b3877['concat'](_0x19e6db);return db['Dynamics365Account'][_0x701b('0x33')]({'where':{'id':_0x2e3a7d[_0x701b('0x2a')]['id']},'attributes':['id',_0x701b('0x7b'),_0x701b('0x7c'),_0x701b('0x7d'),_0x701b('0x7e'),_0x701b('0x7f'),_0x701b('0x80'),_0x701b('0x81')],'include':[{'model':db[_0x701b('0x82')],'as':_0x701b('0x82'),'attributes':['id',_0x701b('0x83'),_0x701b('0x84')]}]})[_0x701b('0xd')](handleEntityNotFound(_0x37e972,null))['then'](function(_0x463469){if(_0x463469){if(_0x463469[_0x701b('0x81')]){_0x463469['access_token']=_0x463469[_0x701b('0x82')][_0x701b('0x83')];_0x11e6d9=sanitizeRemoteUri(_0x463469[_0x701b('0x82')][_0x701b('0x84')]);_0x46a2aa=getWebApiUrl(_0x11e6d9);return _0x463469;}_0x11e6d9=sanitizeRemoteUri(_0x463469[_0x701b('0x7d')]);_0x46a2aa=getWebApiUrl(_0x11e6d9);var _0x4d87f3={'method':_0x701b('0x85'),'uri':_0x701b('0x86')+_0x463469[_0x701b('0x7e')]+_0x701b('0x87'),'form':{'client_id':_0x463469[_0x701b('0x7f')],'resource':_0x11e6d9,'username':_0x463469['username'],'password':_0x463469['password'],'grant_type':'password','client_secret':_0x463469[_0x701b('0x80')]},'json':!![]};return rp(_0x4d87f3);}})[_0x701b('0xd')](function(_0x57481e){_0x40c082=_0x57481e[_0x701b('0x88')];var _0x3993c4={'method':_0x701b('0x89'),'uri':encodeURI(_0x46a2aa+_0x701b('0x8a')+_0xead5c8+'\x27'),'headers':{'Authorization':_0x701b('0x8b')+_0x40c082,'If-None-Match':null,'OData-Version':_0x701b('0x8c')},'json':!![]};return rp(_0x3993c4);})[_0x701b('0xd')](function(_0x45e13c){var _0x8f47f1=_0x45e13c[_0x701b('0x8d')][0x0];var _0x33dfe5=_0x8f47f1[_0x701b('0x8e')];var _0x23792b={'method':'GET','uri':_0x46a2aa+_0x701b('0x8f')+_0x33dfe5+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x701b('0x8b')+_0x40c082,'If-None-Match':null,'OData-Version':_0x701b('0x8c')},'json':!![]};return rp(_0x23792b);})[_0x701b('0xd')](function(_0x1256bf){_0x1ca734=_0x1256bf;_0x29a156=_0x1ca734[_0x701b('0x90')];_0x29a156=_[_0x701b('0x91')](_0x29a156,function(_0x4e5bd4){return!_0x489d96[_0x701b('0x92')](_0x4e5bd4[_0x701b('0x93')]);});var _0x1af48a=[];var _0x44b501=[];_0x29a156['forEach'](function(_0xfade9e){if(_0xfade9e[_0x701b('0x94')]){var _0x206f1f=_0xfade9e['@odata.type'][_0x701b('0x3c')](_0xfade9e[_0x701b('0x94')][_0x701b('0x3d')]('.')+0x1);if(_0x206f1f===_0x701b('0x95')){_0x1af48a['push'](getSelectList(_0x46a2aa,_0x34785f,_0x44b501,_0x1ca734['MetadataId'],_0xfade9e[_0x701b('0x8e')],_0x40c082));}}});return Promise['all'](_0x1af48a);})['then'](function(_0x502274){_0x88f46b=_0x502274[0x0];var _0xa08a3c=[];var _0xe5a116=[];_0x29a156[_0x701b('0x96')](function(_0x213ad4){if(!_[_0x701b('0x97')](_0x213ad4['@odata.type'])){var _0x38cb6d=_0x213ad4[_0x701b('0x94')][_0x701b('0x3c')](_0x213ad4[_0x701b('0x94')][_0x701b('0x3d')]('.')+0x1);if(_0x38cb6d===_0x701b('0x98')){_0xa08a3c[_0x701b('0x99')](getBooleanList(_0x46a2aa,_0x34785f,_0xe5a116,_0x1ca734[_0x701b('0x8e')],_0x213ad4['MetadataId'],_0x40c082));}}});return Promise[_0x701b('0x9a')](_0xa08a3c);})[_0x701b('0xd')](function(_0x195dc3){_0x2ed593=_0x195dc3[0x0];var _0x2d53d8=[];var _0x375883=[];_0x29a156[_0x701b('0x96')](function(_0x3e149e){if(_0x3e149e[_0x701b('0x94')]){var _0x56aa16=_0x3e149e[_0x701b('0x94')][_0x701b('0x3c')](_0x3e149e[_0x701b('0x94')][_0x701b('0x3d')]('.')+0x1);if(_0x56aa16===_0x701b('0x9b')||_0x56aa16==='DoubleAttributeMetadata'||_0x56aa16===_0x701b('0x9c')||_0x56aa16===_0x701b('0x9d')||_0x56aa16===_0x701b('0x9e')||_0x56aa16==='DateTimeAttributeMetadata'||_0x56aa16===_0x701b('0x9f')||_0x56aa16===_0x701b('0xa0')||_0x56aa16===_0x701b('0xa1')||_0x56aa16==='DecimalAttributeMetadata'){_0x2d53d8[_0x701b('0x99')](getInputList(_0x46a2aa,_0x34785f,_0x56aa16,_0x375883,_0x1ca734[_0x701b('0x8e')],_0x3e149e['MetadataId'],_0x40c082));}}});return Promise['all'](_0x2d53d8);})[_0x701b('0xd')](function(_0x2f662b){_0x1b3848=_0x2f662b[0x0];var _0x497aa3=_0x88f46b[_0x701b('0xa2')](_0x2ed593)[_0x701b('0xa2')](_0x1b3848);var _0x188a15={'count':_0x497aa3[_0x701b('0x1f')],'rows':_0x497aa3};return _0x188a15;})[_0x701b('0xd')](respondWithResult(_0x37e972,null))[_0x701b('0x29')](function(_0x2525d5){var _0x3500a7=_0x2e3a7d[_0x701b('0x1a')][_0x701b('0xa3')]?0x1f4:_0x2525d5[_0x701b('0xa4')]||0x1f4;logger[_0x701b('0x10')](_0x2525d5[_0x701b('0x11')]);delete _0x2525d5['name'];if(_0x3500a7===0x191){_0x3500a7=0x190;}_0x37e972['status'](_0x3500a7)['send'](_0x2e3a7d[_0x701b('0x1a')][_0x701b('0xa3')]?{'message':_0x701b('0xa5'),'statusCode':_0x2525d5[_0x701b('0xa4')]}:_0x2525d5);});};function getSelectList(_0x1606af,_0xfe624b,_0x5cd5b3,_0x4f7b65,_0x4eefc8,_0x1de7b8){var _0x58fdfb={'method':_0x701b('0x89'),'uri':_0x1606af+_0x701b('0x8f')+_0x4f7b65+')/Attributes('+_0x4eefc8+_0x701b('0xa6')+_0x701b('0xa7'),'headers':{'Authorization':_0x701b('0x8b')+_0x1de7b8,'If-None-Match':null,'OData-Version':_0x701b('0x8c')},'json':!![]};return rp(_0x58fdfb)[_0x701b('0xd')](function(_0x3a9761){var _0x5acceb=[];var _0x51fcb9=_0x3a9761['OptionSet'][_0x701b('0xa8')];_0x51fcb9[_0x701b('0x96')](function(_0x740743){_0x5acceb[_0x701b('0x99')]({'name':_0x740743[_0x701b('0xa9')][_0x701b('0xaa')]['Label'],'value':String(_0x740743['Value'])});});var _0x44cecc={'id':_0xfe624b+'_'+_0x3a9761[_0x701b('0x93')],'name':_0x3a9761[_0x701b('0xab')][_0x701b('0xaa')][_0x701b('0xa9')],'custom':![],'options':_0x5acceb};_0x5cd5b3[_0x701b('0x99')](_0x44cecc);return _0x5cd5b3;});}function getBooleanList(_0x1d4082,_0x5552e9,_0x15a7f7,_0x38b612,_0xaf3ea3,_0x1c2c4e){var _0xced614={'method':'GET','uri':_0x1d4082+_0x701b('0x8f')+_0x38b612+_0x701b('0xac')+_0xaf3ea3+_0x701b('0xad'),'headers':{'Authorization':_0x701b('0x8b')+_0x1c2c4e,'If-None-Match':null,'OData-Version':_0x701b('0x8c')},'json':!![]};return rp(_0xced614)[_0x701b('0xd')](function(_0x121935){var _0x291e4d=[];_0x291e4d['push']({'name':_0x121935[_0x701b('0xae')][_0x701b('0xaf')][_0x701b('0xa9')]['UserLocalizedLabel'][_0x701b('0xa9')],'value':_0x701b('0xb0')},{'name':_0x121935[_0x701b('0xae')][_0x701b('0xb1')]['Label']['UserLocalizedLabel']['Label'],'value':_0x701b('0xb2')});var _0x1f40e8={'id':_0x5552e9+'_'+_0x121935[_0x701b('0x93')],'name':_0x121935[_0x701b('0xab')][_0x701b('0xaa')][_0x701b('0xa9')],'custom':![],'options':_0x291e4d};_0x15a7f7[_0x701b('0x99')](_0x1f40e8);return _0x15a7f7;});}function getInputList(_0x3744fb,_0x50b72b,_0x314704,_0x4c5778,_0x4ecddd,_0x48d2c0,_0x3681ce){var _0x5e0d9f={'method':'GET','uri':_0x3744fb+_0x701b('0x8f')+_0x4ecddd+')/Attributes('+_0x48d2c0+_0x701b('0xb3')+_0x314704+_0x701b('0xb4'),'headers':{'Authorization':_0x701b('0x8b')+_0x3681ce,'If-None-Match':null,'OData-Version':_0x701b('0x8c')},'json':!![]};return rp(_0x5e0d9f)[_0x701b('0xd')](function(_0x53fb6d){var _0x320468={'id':_0x50b72b+'_'+_0x53fb6d[_0x701b('0x93')],'name':_0x53fb6d[_0x701b('0xab')]['UserLocalizedLabel']?_0x53fb6d[_0x701b('0xab')][_0x701b('0xaa')]['Label']:_0x53fb6d[_0x701b('0x93')],'custom':![],'options':[]};_0x4c5778['push'](_0x320468);return _0x4c5778;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 6c945da..d3d88e2 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x2bb66c,_0x36c6c6){var _0x1e0f98=function(_0x1e3412){while(--_0x1e3412){_0x2bb66c['push'](_0x2bb66c['shift']());}};_0x1e0f98(++_0x36c6c6);}(_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 1608dd4..c3311cb 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 _0x9fc3=['request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Dynamics365Account','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','debug','catch','ShowDynamics365Account','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x13a219,_0x25acd3){var _0x50e371=function(_0x187aea){while(--_0x187aea){_0x13a219['push'](_0x13a219['shift']());}};_0x50e371(++_0x25acd3);}(_0x9fc3,0x199));var _0x39fc=function(_0x231536,_0x549d64){_0x231536=_0x231536-0x0;var _0x18fa6f=_0x9fc3[_0x231536];return _0x18fa6f;};'use strict';var _=require(_0x39fc('0x0'));var util=require('util');var moment=require(_0x39fc('0x1'));var BPromise=require(_0x39fc('0x2'));var rs=require(_0x39fc('0x3'));var fs=require('fs');var Redis=require(_0x39fc('0x4'));var db=require(_0x39fc('0x5'))['db'];var utils=require(_0x39fc('0x6'));var logger=require(_0x39fc('0x7'))('rpc');var config=require(_0x39fc('0x8'));var jayson=require(_0x39fc('0x9'));var client=jayson[_0x39fc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e1262,_0x2a976c,_0x410f33){return new BPromise(function(_0x524674,_0x28538f){return client[_0x39fc('0xb')](_0x4e1262,_0x410f33)[_0x39fc('0xc')](function(_0x23275b){logger['info'](_0x39fc('0xd'),_0x2a976c,_0x39fc('0xe'));logger['debug'](_0x39fc('0xf'),_0x2a976c,'request\x20sent',JSON[_0x39fc('0x10')](_0x23275b));if(_0x23275b['error']){if(_0x23275b[_0x39fc('0x11')][_0x39fc('0x12')]===0x1f4){logger[_0x39fc('0x11')](_0x39fc('0xd'),_0x2a976c,_0x23275b[_0x39fc('0x11')]['message']);return _0x28538f(_0x23275b[_0x39fc('0x11')]['message']);}logger[_0x39fc('0x11')](_0x39fc('0xd'),_0x2a976c,_0x23275b[_0x39fc('0x11')]['message']);return _0x524674(_0x23275b['error'][_0x39fc('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x2a976c,_0x39fc('0xe'));_0x524674(_0x23275b[_0x39fc('0x14')][_0x39fc('0x13')]);}})['catch'](function(_0x7d455c){logger[_0x39fc('0x11')](_0x39fc('0xd'),_0x2a976c,_0x7d455c);_0x28538f(_0x7d455c);});});}exports['GetDynamics365Account']=function(_0xa46a2b){var _0x216f24=this;return new Promise(function(_0xea64c2,_0x1f36b9){return db[_0x39fc('0x15')]['findAll']({'raw':_0xa46a2b['options']?_0xa46a2b[_0x39fc('0x16')][_0x39fc('0x17')]===undefined?!![]:![]:!![],'where':_0xa46a2b[_0x39fc('0x16')]?_0xa46a2b['options'][_0x39fc('0x18')]||null:null,'attributes':_0xa46a2b[_0x39fc('0x16')]?_0xa46a2b[_0x39fc('0x16')][_0x39fc('0x19')]||null:null,'limit':_0xa46a2b['options']?_0xa46a2b['options'][_0x39fc('0x1a')]||null:null,'include':_0xa46a2b[_0x39fc('0x16')]?_0xa46a2b[_0x39fc('0x16')][_0x39fc('0x1b')]?_[_0x39fc('0x1c')](_0xa46a2b[_0x39fc('0x16')]['include'],function(_0xda5d17){return{'model':db[_0xda5d17[_0x39fc('0x1d')]],'as':_0xda5d17['as'],'attributes':_0xda5d17[_0x39fc('0x19')],'include':_0xda5d17[_0x39fc('0x1b')]?_['map'](_0xda5d17[_0x39fc('0x1b')],function(_0x203398){return{'model':db[_0x203398[_0x39fc('0x1d')]],'as':_0x203398['as'],'attributes':_0x203398['attributes'],'include':_0x203398[_0x39fc('0x1b')]?_[_0x39fc('0x1c')](_0x203398[_0x39fc('0x1b')],function(_0x4fe691){return{'model':db[_0x4fe691[_0x39fc('0x1d')]],'as':_0x4fe691['as'],'attributes':_0x4fe691[_0x39fc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x39fc('0xc')](function(_0x3e208f){logger['info'](_0x39fc('0x1e'),_0xa46a2b);logger[_0x39fc('0x1f')](_0x39fc('0x1e'),_0xa46a2b,JSON[_0x39fc('0x10')](_0x3e208f));_0xea64c2(_0x3e208f);})[_0x39fc('0x20')](function(_0x2fc5b6){logger[_0x39fc('0x11')](_0x39fc('0x1e'),_0x2fc5b6[_0x39fc('0x13')],_0xa46a2b);_0x1f36b9(_0x216f24['error'](0x1f4,_0x2fc5b6['message']));});});};exports[_0x39fc('0x21')]=function(_0x4c7918){var _0x4ae656=this;return new Promise(function(_0x121dac,_0x10d8f8){return db['Dynamics365Account']['find']({'raw':_0x4c7918[_0x39fc('0x16')]?_0x4c7918[_0x39fc('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4c7918[_0x39fc('0x16')]?_0x4c7918[_0x39fc('0x16')][_0x39fc('0x18')]||null:null,'attributes':_0x4c7918[_0x39fc('0x16')]?_0x4c7918[_0x39fc('0x16')][_0x39fc('0x19')]||null:null,'include':_0x4c7918[_0x39fc('0x16')]?_0x4c7918[_0x39fc('0x16')][_0x39fc('0x1b')]?_[_0x39fc('0x1c')](_0x4c7918[_0x39fc('0x16')][_0x39fc('0x1b')],function(_0xcad31f){return{'model':db[_0xcad31f[_0x39fc('0x1d')]],'as':_0xcad31f['as'],'attributes':_0xcad31f['attributes'],'include':_0xcad31f[_0x39fc('0x1b')]?_['map'](_0xcad31f['include'],function(_0x31bfd7){return{'model':db[_0x31bfd7['model']],'as':_0x31bfd7['as'],'attributes':_0x31bfd7[_0x39fc('0x19')],'include':_0x31bfd7[_0x39fc('0x1b')]?_[_0x39fc('0x1c')](_0x31bfd7[_0x39fc('0x1b')],function(_0x7bf14e){return{'model':db[_0x7bf14e[_0x39fc('0x1d')]],'as':_0x7bf14e['as'],'attributes':_0x7bf14e[_0x39fc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x39fc('0xc')](function(_0x3c056d){logger[_0x39fc('0x22')](_0x39fc('0x21'),_0x4c7918);logger[_0x39fc('0x1f')](_0x39fc('0x21'),_0x4c7918,JSON['stringify'](_0x3c056d));_0x121dac(_0x3c056d);})[_0x39fc('0x20')](function(_0x6f5ff5){logger['error'](_0x39fc('0x21'),_0x6f5ff5['message'],_0x4c7918);_0x10d8f8(_0x4ae656[_0x39fc('0x11')](0x1f4,_0x6f5ff5[_0x39fc('0x13')]));});});}; \ No newline at end of file +var _0x1486=['find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Dynamics365Account,\x20%s,\x20%s','result','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowDynamics365Account','Dynamics365Account'];(function(_0x5d8a94,_0x5d91a6){var _0x412be3=function(_0x5425f2){while(--_0x5425f2){_0x5d8a94['push'](_0x5d8a94['shift']());}};_0x412be3(++_0x5d91a6);}(_0x1486,0x145));var _0x6148=function(_0x51bb2c,_0x1a3932){_0x51bb2c=_0x51bb2c-0x0;var _0x30ebd8=_0x1486[_0x51bb2c];return _0x30ebd8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6148('0x0'));var BPromise=require('bluebird');var rs=require(_0x6148('0x1'));var fs=require('fs');var Redis=require(_0x6148('0x2'));var db=require(_0x6148('0x3'))['db'];var utils=require(_0x6148('0x4'));var logger=require(_0x6148('0x5'))(_0x6148('0x6'));var config=require(_0x6148('0x7'));var jayson=require(_0x6148('0x8'));var client=jayson[_0x6148('0x9')][_0x6148('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457189,_0x5b5858,_0x297dd1){return new BPromise(function(_0x2e9223,_0xbf411){return client[_0x6148('0xb')](_0x457189,_0x297dd1)[_0x6148('0xc')](function(_0x5630f1){logger[_0x6148('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x5b5858,'request\x20sent');logger[_0x6148('0xe')](_0x6148('0xf'),_0x5b5858,_0x6148('0x10'),JSON[_0x6148('0x11')](_0x5630f1));if(_0x5630f1['error']){if(_0x5630f1[_0x6148('0x12')]['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5b5858,_0x5630f1[_0x6148('0x12')][_0x6148('0x13')]);return _0xbf411(_0x5630f1[_0x6148('0x12')][_0x6148('0x13')]);}logger[_0x6148('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x5b5858,_0x5630f1[_0x6148('0x12')][_0x6148('0x13')]);return _0x2e9223(_0x5630f1[_0x6148('0x12')][_0x6148('0x13')]);}else{logger[_0x6148('0xd')](_0x6148('0x14'),_0x5b5858,_0x6148('0x10'));_0x2e9223(_0x5630f1[_0x6148('0x15')][_0x6148('0x13')]);}})['catch'](function(_0x3bc562){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5b5858,_0x3bc562);_0xbf411(_0x3bc562);});});}exports[_0x6148('0x16')]=function(_0x54721d){var _0x5e8953=this;return new Promise(function(_0x104e85,_0x5e0526){return db['Dynamics365Account'][_0x6148('0x17')]({'raw':_0x54721d[_0x6148('0x18')]?_0x54721d[_0x6148('0x18')][_0x6148('0x19')]===undefined?!![]:![]:!![],'where':_0x54721d['options']?_0x54721d[_0x6148('0x18')][_0x6148('0x1a')]||null:null,'attributes':_0x54721d[_0x6148('0x18')]?_0x54721d[_0x6148('0x18')][_0x6148('0x1b')]||null:null,'limit':_0x54721d[_0x6148('0x18')]?_0x54721d[_0x6148('0x18')][_0x6148('0x1c')]||null:null,'include':_0x54721d[_0x6148('0x18')]?_0x54721d[_0x6148('0x18')][_0x6148('0x1d')]?_[_0x6148('0x1e')](_0x54721d[_0x6148('0x18')]['include'],function(_0x3b03c7){return{'model':db[_0x3b03c7['model']],'as':_0x3b03c7['as'],'attributes':_0x3b03c7['attributes'],'include':_0x3b03c7[_0x6148('0x1d')]?_[_0x6148('0x1e')](_0x3b03c7[_0x6148('0x1d')],function(_0x1d670d){return{'model':db[_0x1d670d['model']],'as':_0x1d670d['as'],'attributes':_0x1d670d['attributes'],'include':_0x1d670d[_0x6148('0x1d')]?_[_0x6148('0x1e')](_0x1d670d[_0x6148('0x1d')],function(_0x2f22f4){return{'model':db[_0x2f22f4[_0x6148('0x1f')]],'as':_0x2f22f4['as'],'attributes':_0x2f22f4[_0x6148('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6148('0xc')](function(_0xb3e962){logger[_0x6148('0xd')](_0x6148('0x16'),_0x54721d);logger[_0x6148('0xe')](_0x6148('0x16'),_0x54721d,JSON[_0x6148('0x11')](_0xb3e962));_0x104e85(_0xb3e962);})[_0x6148('0x20')](function(_0x2b67e2){logger[_0x6148('0x12')](_0x6148('0x16'),_0x2b67e2['message'],_0x54721d);_0x5e0526(_0x5e8953[_0x6148('0x12')](0x1f4,_0x2b67e2['message']));});});};exports[_0x6148('0x21')]=function(_0x4cf17c){var _0x4041d6=this;return new Promise(function(_0x4a8ada,_0x10d6f0){return db[_0x6148('0x22')][_0x6148('0x23')]({'raw':_0x4cf17c[_0x6148('0x18')]?_0x4cf17c[_0x6148('0x18')][_0x6148('0x19')]===undefined?!![]:![]:!![],'where':_0x4cf17c['options']?_0x4cf17c[_0x6148('0x18')][_0x6148('0x1a')]||null:null,'attributes':_0x4cf17c[_0x6148('0x18')]?_0x4cf17c[_0x6148('0x18')][_0x6148('0x1b')]||null:null,'include':_0x4cf17c[_0x6148('0x18')]?_0x4cf17c['options'][_0x6148('0x1d')]?_[_0x6148('0x1e')](_0x4cf17c['options'][_0x6148('0x1d')],function(_0x3711a8){return{'model':db[_0x3711a8[_0x6148('0x1f')]],'as':_0x3711a8['as'],'attributes':_0x3711a8[_0x6148('0x1b')],'include':_0x3711a8[_0x6148('0x1d')]?_[_0x6148('0x1e')](_0x3711a8[_0x6148('0x1d')],function(_0x4a3918){return{'model':db[_0x4a3918[_0x6148('0x1f')]],'as':_0x4a3918['as'],'attributes':_0x4a3918[_0x6148('0x1b')],'include':_0x4a3918[_0x6148('0x1d')]?_[_0x6148('0x1e')](_0x4a3918[_0x6148('0x1d')],function(_0x5c5355){return{'model':db[_0x5c5355['model']],'as':_0x5c5355['as'],'attributes':_0x5c5355[_0x6148('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12a5ea){logger[_0x6148('0xd')](_0x6148('0x21'),_0x4cf17c);logger[_0x6148('0xe')]('ShowDynamics365Account',_0x4cf17c,JSON['stringify'](_0x12a5ea));_0x4a8ada(_0x12a5ea);})[_0x6148('0x20')](function(_0x389e0b){logger['error'](_0x6148('0x21'),_0x389e0b[_0x6148('0x13')],_0x4cf17c);_0x10d6f0(_0x4041d6[_0x6148('0x12')](0x1f4,_0x389e0b[_0x6148('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1e0724b..dfb02f1 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 _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','multer','util'];(function(_0x4bdcb7,_0x263492){var _0x6b8866=function(_0x325083){while(--_0x325083){_0x4bdcb7['push'](_0x4bdcb7['shift']());}};_0x6b8866(++_0x263492);}(_0xb62e,0x1de));var _0xeb62=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb62e[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xeb62('0xc')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0xc')](_0xeb62('0x11'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x13')]('/',auth[_0xeb62('0xa')](),controller['create']);router[_0xeb62('0x14')](_0xeb62('0x15'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x16')]);router['delete'](_0xeb62('0x15'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x17')]);module['exports']=router; \ No newline at end of file +var _0xa051=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa051,0x189));var _0x1a05=function(_0x130c7e,_0x284884){_0x130c7e=_0x130c7e-0x0;var _0x581a42=_0xa051[_0x130c7e];return _0x581a42;};'use strict';var multer=require(_0x1a05('0x0'));var util=require(_0x1a05('0x1'));var path=require(_0x1a05('0x2'));var timeout=require(_0x1a05('0x3'));var express=require(_0x1a05('0x4'));var router=express[_0x1a05('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a05('0x6'));var interaction=require(_0x1a05('0x7'));var config=require(_0x1a05('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x1a05('0x9')]('/',auth[_0x1a05('0xa')](),controller[_0x1a05('0xb')]);router[_0x1a05('0x9')](_0x1a05('0xc'),auth[_0x1a05('0xa')](),controller[_0x1a05('0xd')]);router[_0x1a05('0x9')](_0x1a05('0xe'),auth['isAuthenticated'](),controller[_0x1a05('0xf')]);router[_0x1a05('0x9')](_0x1a05('0x10'),auth[_0x1a05('0xa')](),controller[_0x1a05('0x11')]);router[_0x1a05('0x9')](_0x1a05('0x12'),auth[_0x1a05('0xa')](),controller[_0x1a05('0x13')]);router['post']('/',auth[_0x1a05('0xa')](),controller['create']);router[_0x1a05('0x14')]('/:id',auth[_0x1a05('0xa')](),controller[_0x1a05('0x15')]);router[_0x1a05('0x16')](_0x1a05('0xc'),auth[_0x1a05('0xa')](),controller[_0x1a05('0x17')]);module[_0x1a05('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index cc9e7a8..3f3b779 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 _0x5570=['ENUM','contact','sequelize','exports','STRING','incident','phonecall'];(function(_0x3a02be,_0x2d3a7d){var _0x5e86e4=function(_0x27ce70){while(--_0x27ce70){_0x3a02be['push'](_0x3a02be['shift']());}};_0x5e86e4(++_0x2d3a7d);}(_0x5570,0x1bb));var _0x0557=function(_0x1f2422,_0x125fd2){_0x1f2422=_0x1f2422-0x0;var _0x4fb420=_0x5570[_0x1f2422];return _0x4fb420;};'use strict';var Sequelize=require(_0x0557('0x0'));module[_0x0557('0x1')]={'name':{'type':Sequelize[_0x0557('0x2')]},'description':{'type':Sequelize[_0x0557('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x0557('0x3'),_0x0557('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x0557('0x5')](_0x0557('0x6'),'nothing'),'defaultValue':_0x0557('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x4129=['exports','STRING','ENUM','incident','contact','nothing','sequelize'];(function(_0xd8768,_0x3fedcb){var _0x46228f=function(_0x65a836){while(--_0x65a836){_0xd8768['push'](_0xd8768['shift']());}};_0x46228f(++_0x3fedcb);}(_0x4129,0xdf));var _0x9412=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4129[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x9412('0x0'));module[_0x9412('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9412('0x2')]},'ticketType':{'type':Sequelize[_0x9412('0x3')](_0x9412('0x4'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x9412('0x3')](_0x9412('0x5'),_0x9412('0x6')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e93ed1c..88071a8 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 _0xa8c7=['then','destroy','sendStatus','error','stack','name','send','Dynamics365Configuration','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','Content-Range','save','update'];(function(_0x476ee3,_0x4e1617){var _0x14bd75=function(_0x31f362){while(--_0x31f362){_0x476ee3['push'](_0x476ee3['shift']());}};_0x14bd75(++_0x4e1617);}(_0xa8c7,0x160));var _0x7a8c=function(_0x4c7347,_0x2b14e2){_0x4c7347=_0x4c7347-0x0;var _0x106e28=_0xa8c7[_0x4c7347];return _0x106e28;};'use strict';var emlformat=require(_0x7a8c('0x0'));var rimraf=require(_0x7a8c('0x1'));var zipdir=require(_0x7a8c('0x2'));var jsonpatch=require(_0x7a8c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7a8c('0x4'));var Mustache=require(_0x7a8c('0x5'));var util=require(_0x7a8c('0x6'));var path=require(_0x7a8c('0x7'));var sox=require(_0x7a8c('0x8'));var csv=require(_0x7a8c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a8c('0xa'));var _=require('lodash');var squel=require(_0x7a8c('0xb'));var crypto=require(_0x7a8c('0xc'));var jsforce=require(_0x7a8c('0xd'));var deskjs=require(_0x7a8c('0xe'));var toCsv=require(_0x7a8c('0x9'));var querystring=require('querystring');var Papa=require(_0x7a8c('0xf'));var Redis=require(_0x7a8c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7a8c('0x11'));var hardwareService=require(_0x7a8c('0x12'));var logger=require('../../config/logger')(_0x7a8c('0x13'));var utils=require(_0x7a8c('0x14'));var config=require(_0x7a8c('0x15'));var licenseUtil=require(_0x7a8c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39f482,_0x1105a3){_0x1105a3=_0x1105a3||0xcc;return function(_0x77a304){if(_0x77a304){return _0x39f482['sendStatus'](_0x1105a3);}return _0x39f482['status'](_0x1105a3)[_0x7a8c('0x17')]();};}function respondWithResult(_0x143a46,_0x4b7b1c){_0x4b7b1c=_0x4b7b1c||0xc8;return function(_0x5a107e){if(_0x5a107e){return _0x143a46[_0x7a8c('0x18')](_0x4b7b1c)[_0x7a8c('0x19')](_0x5a107e);}};}function respondWithFilteredResult(_0x44f0d2,_0x1937f0){return function(_0x589231){if(_0x589231){var _0x18b650=typeof _0x1937f0['offset']===_0x7a8c('0x1a')&&typeof _0x1937f0[_0x7a8c('0x1b')]===_0x7a8c('0x1a');var _0x436622=_0x589231[_0x7a8c('0x1c')];var _0x1b0ac4=_0x18b650?0x0:_0x1937f0[_0x7a8c('0x1d')];var _0x5d24ca=_0x18b650?_0x589231['count']:_0x1937f0[_0x7a8c('0x1d')]+_0x1937f0[_0x7a8c('0x1b')];var _0x2e977a;if(_0x5d24ca>=_0x436622){_0x5d24ca=_0x436622;_0x2e977a=0xc8;}else{_0x2e977a=0xce;}_0x44f0d2[_0x7a8c('0x18')](_0x2e977a);return _0x44f0d2['set'](_0x7a8c('0x1e'),_0x1b0ac4+'-'+_0x5d24ca+'/'+_0x436622)['json'](_0x589231);}return null;};}function patchUpdates(_0x1f7688){return function(_0x2b107d){try{jsonpatch['apply'](_0x2b107d,_0x1f7688,!![]);}catch(_0xb8f85b){return BPromise['reject'](_0xb8f85b);}return _0x2b107d[_0x7a8c('0x1f')]();};}function saveUpdates(_0x1688c1,_0xdc40a2){return function(_0x575f3a){if(_0x575f3a){return _0x575f3a[_0x7a8c('0x20')](_0x1688c1)[_0x7a8c('0x21')](function(_0x22f6ac){return _0x22f6ac;});}return null;};}function removeEntity(_0x5c949c,_0x167149){return function(_0x5804ed){if(_0x5804ed){return _0x5804ed[_0x7a8c('0x22')]()[_0x7a8c('0x21')](function(){_0x5c949c[_0x7a8c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43d9f9,_0x2a0b2a){return function(_0x3ed858){if(!_0x3ed858){_0x43d9f9[_0x7a8c('0x23')](0x194);}return _0x3ed858;};}function handleError(_0x18295f,_0x5315b6){_0x5315b6=_0x5315b6||0x1f4;return function(_0x49a51d){logger[_0x7a8c('0x24')](_0x49a51d[_0x7a8c('0x25')]);if(_0x49a51d[_0x7a8c('0x26')]){delete _0x49a51d[_0x7a8c('0x26')];}_0x18295f[_0x7a8c('0x18')](_0x5315b6)[_0x7a8c('0x27')](_0x49a51d);};}exports['index']=function(_0x5a2bea,_0x2b8080){var _0x18e83e={},_0x3511da={},_0x5ede50={'count':0x0,'rows':[]};var _0x442c84=_['map'](db[_0x7a8c('0x28')]['rawAttributes'],function(_0x186e82){return{'name':_0x186e82[_0x7a8c('0x29')],'type':_0x186e82[_0x7a8c('0x2a')][_0x7a8c('0x2b')]};});_0x3511da[_0x7a8c('0x2c')]=_[_0x7a8c('0x2d')](_0x442c84,_0x7a8c('0x26'));_0x3511da[_0x7a8c('0x2e')]=_[_0x7a8c('0x2f')](_0x5a2bea['query']);_0x3511da[_0x7a8c('0x30')]=_[_0x7a8c('0x31')](_0x3511da[_0x7a8c('0x2c')],_0x3511da[_0x7a8c('0x2e')]);_0x18e83e['attributes']=_[_0x7a8c('0x31')](_0x3511da[_0x7a8c('0x2c')],qs[_0x7a8c('0x32')](_0x5a2bea['query'][_0x7a8c('0x32')]));_0x18e83e[_0x7a8c('0x33')]=_0x18e83e[_0x7a8c('0x33')][_0x7a8c('0x34')]?_0x18e83e[_0x7a8c('0x33')]:_0x3511da[_0x7a8c('0x2c')];if(!_0x5a2bea['query'][_0x7a8c('0x35')](_0x7a8c('0x36'))){_0x18e83e[_0x7a8c('0x1b')]=qs['limit'](_0x5a2bea['query'][_0x7a8c('0x1b')]);_0x18e83e['offset']=qs[_0x7a8c('0x1d')](_0x5a2bea[_0x7a8c('0x2e')]['offset']);}_0x18e83e[_0x7a8c('0x37')]=qs[_0x7a8c('0x38')](_0x5a2bea['query'][_0x7a8c('0x38')]);_0x18e83e[_0x7a8c('0x39')]=qs[_0x7a8c('0x30')](_[_0x7a8c('0x3a')](_0x5a2bea[_0x7a8c('0x2e')],_0x3511da[_0x7a8c('0x30')]),_0x442c84);if(_0x5a2bea[_0x7a8c('0x2e')]['filter']){_0x18e83e[_0x7a8c('0x39')]=_[_0x7a8c('0x3b')](_0x18e83e[_0x7a8c('0x39')],{'$or':_[_0x7a8c('0x2d')](_0x442c84,function(_0x360c6a){if(_0x360c6a[_0x7a8c('0x2a')]!=='VIRTUAL'){var _0x302a84={};_0x302a84[_0x360c6a[_0x7a8c('0x26')]]={'$like':'%'+_0x5a2bea[_0x7a8c('0x2e')][_0x7a8c('0x3c')]+'%'};return _0x302a84;}})});}_0x18e83e=_['merge']({},_0x18e83e,_0x5a2bea[_0x7a8c('0x3d')]);var _0x473b99={'where':_0x18e83e[_0x7a8c('0x39')]};return db['Dynamics365Configuration'][_0x7a8c('0x1c')](_0x473b99)[_0x7a8c('0x21')](function(_0x21b3ee){_0x5ede50[_0x7a8c('0x1c')]=_0x21b3ee;if(_0x5a2bea['query'][_0x7a8c('0x3e')]){_0x18e83e['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x7a8c('0x3f')](_0x18e83e);})['then'](function(_0x1dad4b){_0x5ede50[_0x7a8c('0x40')]=_0x1dad4b;return _0x5ede50;})[_0x7a8c('0x21')](respondWithFilteredResult(_0x2b8080,_0x18e83e))[_0x7a8c('0x41')](handleError(_0x2b8080,null));};exports['show']=function(_0x3fe68c,_0x7d73cd){var _0x11c025={'raw':![],'where':{'id':_0x3fe68c[_0x7a8c('0x42')]['id']}},_0x43d8e1={};_0x43d8e1[_0x7a8c('0x2c')]=_[_0x7a8c('0x2f')](db[_0x7a8c('0x28')][_0x7a8c('0x43')]);_0x43d8e1['query']=_[_0x7a8c('0x2f')](_0x3fe68c[_0x7a8c('0x2e')]);_0x43d8e1[_0x7a8c('0x30')]=_[_0x7a8c('0x31')](_0x43d8e1[_0x7a8c('0x2c')],_0x43d8e1[_0x7a8c('0x2e')]);_0x11c025[_0x7a8c('0x33')]=_[_0x7a8c('0x31')](_0x43d8e1['model'],qs['fields'](_0x3fe68c[_0x7a8c('0x2e')][_0x7a8c('0x32')]));_0x11c025[_0x7a8c('0x33')]=_0x11c025[_0x7a8c('0x33')][_0x7a8c('0x34')]?_0x11c025[_0x7a8c('0x33')]:_0x43d8e1[_0x7a8c('0x2c')];if(_0x3fe68c['query'][_0x7a8c('0x3e')]){_0x11c025[_0x7a8c('0x44')]=[{'all':!![]}];}_0x11c025=_['merge']({},_0x11c025,_0x3fe68c[_0x7a8c('0x3d')]);return db[_0x7a8c('0x28')][_0x7a8c('0x45')](_0x11c025)[_0x7a8c('0x21')](handleEntityNotFound(_0x7d73cd,null))[_0x7a8c('0x21')](respondWithResult(_0x7d73cd,null))[_0x7a8c('0x41')](handleError(_0x7d73cd,null));};exports[_0x7a8c('0x46')]=function(_0x599df7,_0x31a35d){return db[_0x7a8c('0x28')]['create'](_0x599df7[_0x7a8c('0x47')],{})[_0x7a8c('0x21')](respondWithResult(_0x31a35d,0xc9))[_0x7a8c('0x41')](handleError(_0x31a35d,null));};exports[_0x7a8c('0x20')]=function(_0x27811f,_0x358f90){if(_0x27811f[_0x7a8c('0x47')]['id']){delete _0x27811f[_0x7a8c('0x47')]['id'];}return db['Dynamics365Configuration'][_0x7a8c('0x45')]({'where':{'id':_0x27811f[_0x7a8c('0x42')]['id']}})[_0x7a8c('0x21')](handleEntityNotFound(_0x358f90,null))[_0x7a8c('0x21')](saveUpdates(_0x27811f[_0x7a8c('0x47')],null))[_0x7a8c('0x21')](respondWithResult(_0x358f90,null))[_0x7a8c('0x41')](handleError(_0x358f90,null));};exports[_0x7a8c('0x22')]=function(_0x227e13,_0x59326f){return db[_0x7a8c('0x28')][_0x7a8c('0x45')]({'where':{'id':_0x227e13[_0x7a8c('0x42')]['id']}})[_0x7a8c('0x21')](handleEntityNotFound(_0x59326f,null))[_0x7a8c('0x21')](removeEntity(_0x59326f,null))['catch'](handleError(_0x59326f,null));};exports['getFields']=function(_0x43bb6f,_0x5dfd8c,_0xb52b45){var _0x332134={};var _0x39df51={};var _0x201f0d;var _0x349ca9;return db[_0x7a8c('0x28')][_0x7a8c('0x48')]({'where':{'id':_0x43bb6f[_0x7a8c('0x42')]['id']}})[_0x7a8c('0x21')](handleEntityNotFound(_0x5dfd8c,null))['then'](function(_0xac422){if(_0xac422){_0x201f0d=_0xac422;_0x39df51[_0x7a8c('0x2c')]=_[_0x7a8c('0x2f')](db[_0x7a8c('0x49')][_0x7a8c('0x43')]);_0x39df51[_0x7a8c('0x2e')]=_[_0x7a8c('0x2f')](_0x43bb6f[_0x7a8c('0x2e')]);_0x39df51[_0x7a8c('0x30')]=_[_0x7a8c('0x31')](_0x39df51[_0x7a8c('0x2c')],_0x39df51[_0x7a8c('0x2e')]);_0x332134[_0x7a8c('0x33')]=_[_0x7a8c('0x31')](_0x39df51[_0x7a8c('0x2c')],qs[_0x7a8c('0x32')](_0x43bb6f['query'][_0x7a8c('0x32')]));_0x332134[_0x7a8c('0x33')]=_0x332134[_0x7a8c('0x33')][_0x7a8c('0x34')]?_0x332134[_0x7a8c('0x33')]:_0x39df51['model'];_0x332134[_0x7a8c('0x37')]=qs[_0x7a8c('0x38')](_0x43bb6f[_0x7a8c('0x2e')][_0x7a8c('0x38')]);_0x332134[_0x7a8c('0x39')]=qs['filters'](_[_0x7a8c('0x3a')](_0x43bb6f[_0x7a8c('0x2e')],_0x39df51[_0x7a8c('0x30')]));if(_0x43bb6f[_0x7a8c('0x2e')][_0x7a8c('0x3c')]){_0x332134[_0x7a8c('0x39')]=_[_0x7a8c('0x3b')](_0x332134[_0x7a8c('0x39')],{'$or':_['map'](_0x332134['attributes'],function(_0x1fc6ee){var _0x485259={};_0x485259[_0x1fc6ee]={'$like':'%'+_0x43bb6f[_0x7a8c('0x2e')][_0x7a8c('0x3c')]+'%'};return _0x485259;})});}_0x332134=_[_0x7a8c('0x3b')]({},_0x332134,_0x43bb6f[_0x7a8c('0x3d')]);return _0x201f0d[_0x7a8c('0x4a')](_0x332134);}})['then'](function(_0x2793a7){if(_0x2793a7){_0x349ca9=_0x2793a7['length'];if(!_0x43bb6f[_0x7a8c('0x2e')][_0x7a8c('0x35')](_0x7a8c('0x36'))){_0x332134['limit']=qs[_0x7a8c('0x1b')](_0x43bb6f[_0x7a8c('0x2e')]['limit']);_0x332134[_0x7a8c('0x1d')]=qs['offset'](_0x43bb6f[_0x7a8c('0x2e')][_0x7a8c('0x1d')]);}return _0x201f0d['getFields'](_0x332134);}})['then'](function(_0x1761ea){if(_0x1761ea){return _0x1761ea?{'count':_0x349ca9,'rows':_0x1761ea}:null;}})[_0x7a8c('0x21')](respondWithResult(_0x5dfd8c,null))[_0x7a8c('0x41')](handleError(_0x5dfd8c,null));};exports['getSubjects']=function(_0x428f17,_0x59462e,_0x58d00c){var _0x46d60b={};var _0x2394b0={};var _0x1d7926;var _0x1380f8;return db[_0x7a8c('0x28')][_0x7a8c('0x48')]({'where':{'id':_0x428f17[_0x7a8c('0x42')]['id']}})[_0x7a8c('0x21')](handleEntityNotFound(_0x59462e,null))[_0x7a8c('0x21')](function(_0x503558){if(_0x503558){_0x1d7926=_0x503558;_0x2394b0[_0x7a8c('0x2c')]=_['keys'](db[_0x7a8c('0x49')][_0x7a8c('0x43')]);_0x2394b0[_0x7a8c('0x2e')]=_[_0x7a8c('0x2f')](_0x428f17[_0x7a8c('0x2e')]);_0x2394b0[_0x7a8c('0x30')]=_[_0x7a8c('0x31')](_0x2394b0['model'],_0x2394b0[_0x7a8c('0x2e')]);_0x46d60b[_0x7a8c('0x33')]=_[_0x7a8c('0x31')](_0x2394b0[_0x7a8c('0x2c')],qs[_0x7a8c('0x32')](_0x428f17[_0x7a8c('0x2e')][_0x7a8c('0x32')]));_0x46d60b[_0x7a8c('0x33')]=_0x46d60b['attributes'][_0x7a8c('0x34')]?_0x46d60b[_0x7a8c('0x33')]:_0x2394b0['model'];_0x46d60b[_0x7a8c('0x37')]=qs['sort'](_0x428f17['query'][_0x7a8c('0x38')]);_0x46d60b[_0x7a8c('0x39')]=qs[_0x7a8c('0x30')](_['pick'](_0x428f17[_0x7a8c('0x2e')],_0x2394b0[_0x7a8c('0x30')]));if(_0x428f17[_0x7a8c('0x2e')][_0x7a8c('0x3c')]){_0x46d60b[_0x7a8c('0x39')]=_[_0x7a8c('0x3b')](_0x46d60b[_0x7a8c('0x39')],{'$or':_[_0x7a8c('0x2d')](_0x46d60b[_0x7a8c('0x33')],function(_0x20b4cf){var _0x15be86={};_0x15be86[_0x20b4cf]={'$like':'%'+_0x428f17[_0x7a8c('0x2e')][_0x7a8c('0x3c')]+'%'};return _0x15be86;})});}_0x46d60b=_[_0x7a8c('0x3b')]({},_0x46d60b,_0x428f17[_0x7a8c('0x3d')]);return _0x1d7926[_0x7a8c('0x4b')](_0x46d60b);}})['then'](function(_0xa7d40e){if(_0xa7d40e){_0x1380f8=_0xa7d40e[_0x7a8c('0x34')];if(!_0x428f17[_0x7a8c('0x2e')][_0x7a8c('0x35')](_0x7a8c('0x36'))){_0x46d60b[_0x7a8c('0x1b')]=qs['limit'](_0x428f17[_0x7a8c('0x2e')][_0x7a8c('0x1b')]);_0x46d60b[_0x7a8c('0x1d')]=qs[_0x7a8c('0x1d')](_0x428f17['query']['offset']);}return _0x1d7926[_0x7a8c('0x4b')](_0x46d60b);}})[_0x7a8c('0x21')](function(_0x5208bc){if(_0x5208bc){return _0x5208bc?{'count':_0x1380f8,'rows':_0x5208bc}:null;}})['then'](respondWithResult(_0x59462e,null))[_0x7a8c('0x41')](handleError(_0x59462e,null));};exports['getDescriptions']=function(_0x1555b9,_0x1695fa,_0x492e91){var _0x59b53b={};var _0x147c54={};var _0x568baa;var _0x417d7c;return db[_0x7a8c('0x28')]['findOne']({'where':{'id':_0x1555b9[_0x7a8c('0x42')]['id']}})[_0x7a8c('0x21')](handleEntityNotFound(_0x1695fa,null))[_0x7a8c('0x21')](function(_0x6fdf0e){if(_0x6fdf0e){_0x568baa=_0x6fdf0e;_0x147c54[_0x7a8c('0x2c')]=_['keys'](db[_0x7a8c('0x49')][_0x7a8c('0x43')]);_0x147c54['query']=_[_0x7a8c('0x2f')](_0x1555b9['query']);_0x147c54['filters']=_['intersection'](_0x147c54[_0x7a8c('0x2c')],_0x147c54['query']);_0x59b53b[_0x7a8c('0x33')]=_['intersection'](_0x147c54[_0x7a8c('0x2c')],qs[_0x7a8c('0x32')](_0x1555b9['query'][_0x7a8c('0x32')]));_0x59b53b[_0x7a8c('0x33')]=_0x59b53b[_0x7a8c('0x33')]['length']?_0x59b53b[_0x7a8c('0x33')]:_0x147c54['model'];_0x59b53b[_0x7a8c('0x37')]=qs[_0x7a8c('0x38')](_0x1555b9['query'][_0x7a8c('0x38')]);_0x59b53b[_0x7a8c('0x39')]=qs[_0x7a8c('0x30')](_[_0x7a8c('0x3a')](_0x1555b9[_0x7a8c('0x2e')],_0x147c54[_0x7a8c('0x30')]));if(_0x1555b9[_0x7a8c('0x2e')][_0x7a8c('0x3c')]){_0x59b53b['where']=_['merge'](_0x59b53b['where'],{'$or':_[_0x7a8c('0x2d')](_0x59b53b[_0x7a8c('0x33')],function(_0x4db3ab){var _0x5b3155={};_0x5b3155[_0x4db3ab]={'$like':'%'+_0x1555b9['query']['filter']+'%'};return _0x5b3155;})});}_0x59b53b=_['merge']({},_0x59b53b,_0x1555b9[_0x7a8c('0x3d')]);return _0x568baa[_0x7a8c('0x4c')](_0x59b53b);}})[_0x7a8c('0x21')](function(_0x27a16c){if(_0x27a16c){_0x417d7c=_0x27a16c[_0x7a8c('0x34')];if(!_0x1555b9[_0x7a8c('0x2e')][_0x7a8c('0x35')](_0x7a8c('0x36'))){_0x59b53b[_0x7a8c('0x1b')]=qs[_0x7a8c('0x1b')](_0x1555b9[_0x7a8c('0x2e')][_0x7a8c('0x1b')]);_0x59b53b[_0x7a8c('0x1d')]=qs['offset'](_0x1555b9[_0x7a8c('0x2e')][_0x7a8c('0x1d')]);}return _0x568baa[_0x7a8c('0x4c')](_0x59b53b);}})[_0x7a8c('0x21')](function(_0xaa0e46){if(_0xaa0e46){return _0xaa0e46?{'count':_0x417d7c,'rows':_0xaa0e46}:null;}})['then'](respondWithResult(_0x1695fa,null))[_0x7a8c('0x41')](handleError(_0x1695fa,null));}; \ No newline at end of file +var _0xb3eb=['reject','save','then','destroy','sendStatus','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getFields','findOne','Dynamics365Field','filter','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xb3eb,0x1af));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbb3e('0x0'));var rimraf=require(_0xbb3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb3e('0x2'));var rp=require(_0xbb3e('0x3'));var moment=require('moment');var BPromise=require(_0xbb3e('0x4'));var Mustache=require(_0xbb3e('0x5'));var util=require('util');var path=require(_0xbb3e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb3e('0x7'));var _=require(_0xbb3e('0x8'));var squel=require(_0xbb3e('0x9'));var crypto=require(_0xbb3e('0xa'));var jsforce=require(_0xbb3e('0xb'));var deskjs=require(_0xbb3e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb3e('0xd'));var Redis=require(_0xbb3e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbb3e('0xf'));var hardwareService=require(_0xbb3e('0x10'));var logger=require(_0xbb3e('0x11'))(_0xbb3e('0x12'));var utils=require(_0xbb3e('0x13'));var config=require(_0xbb3e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb3e('0x15'))['db'];function respondWithStatusCode(_0x5c4bd4,_0x4f9e09){_0x4f9e09=_0x4f9e09||0xcc;return function(_0x4cd56f){if(_0x4cd56f){return _0x5c4bd4['sendStatus'](_0x4f9e09);}return _0x5c4bd4[_0xbb3e('0x16')](_0x4f9e09)[_0xbb3e('0x17')]();};}function respondWithResult(_0x3e9fea,_0x5c7de5){_0x5c7de5=_0x5c7de5||0xc8;return function(_0x56866a){if(_0x56866a){return _0x3e9fea[_0xbb3e('0x16')](_0x5c7de5)[_0xbb3e('0x18')](_0x56866a);}};}function respondWithFilteredResult(_0x4bf32d,_0x1bf07e){return function(_0xc82706){if(_0xc82706){var _0x58d924=typeof _0x1bf07e[_0xbb3e('0x19')]===_0xbb3e('0x1a')&&typeof _0x1bf07e[_0xbb3e('0x1b')]==='undefined';var _0x188302=_0xc82706[_0xbb3e('0x1c')];var _0x2e45d7=_0x58d924?0x0:_0x1bf07e[_0xbb3e('0x19')];var _0x3a7958=_0x58d924?_0xc82706[_0xbb3e('0x1c')]:_0x1bf07e[_0xbb3e('0x19')]+_0x1bf07e[_0xbb3e('0x1b')];var _0x909613;if(_0x3a7958>=_0x188302){_0x3a7958=_0x188302;_0x909613=0xc8;}else{_0x909613=0xce;}_0x4bf32d['status'](_0x909613);return _0x4bf32d['set'](_0xbb3e('0x1d'),_0x2e45d7+'-'+_0x3a7958+'/'+_0x188302)[_0xbb3e('0x18')](_0xc82706);}return null;};}function patchUpdates(_0x311158){return function(_0xcf3c00){try{jsonpatch[_0xbb3e('0x1e')](_0xcf3c00,_0x311158,!![]);}catch(_0x2ce0d0){return BPromise[_0xbb3e('0x1f')](_0x2ce0d0);}return _0xcf3c00[_0xbb3e('0x20')]();};}function saveUpdates(_0x2d3c3a,_0x5a5c89){return function(_0x3442b4){if(_0x3442b4){return _0x3442b4['update'](_0x2d3c3a)[_0xbb3e('0x21')](function(_0x35b317){return _0x35b317;});}return null;};}function removeEntity(_0x343290,_0x5c3d41){return function(_0x387126){if(_0x387126){return _0x387126[_0xbb3e('0x22')]()[_0xbb3e('0x21')](function(){_0x343290[_0xbb3e('0x16')](0xcc)[_0xbb3e('0x17')]();});}};}function handleEntityNotFound(_0x4c98af,_0x12a722){return function(_0x334f9b){if(!_0x334f9b){_0x4c98af[_0xbb3e('0x23')](0x194);}return _0x334f9b;};}function handleError(_0x74fccd,_0x1f37fc){_0x1f37fc=_0x1f37fc||0x1f4;return function(_0x499ebb){logger['error'](_0x499ebb[_0xbb3e('0x24')]);if(_0x499ebb[_0xbb3e('0x25')]){delete _0x499ebb[_0xbb3e('0x25')];}_0x74fccd[_0xbb3e('0x16')](_0x1f37fc)[_0xbb3e('0x26')](_0x499ebb);};}exports['index']=function(_0x56c12f,_0x2e8c2e){var _0x5229a9={},_0x2229ad={},_0x503dd1={'count':0x0,'rows':[]};var _0x44bf79=_[_0xbb3e('0x27')](db[_0xbb3e('0x28')][_0xbb3e('0x29')],function(_0x2b8c8d){return{'name':_0x2b8c8d[_0xbb3e('0x2a')],'type':_0x2b8c8d[_0xbb3e('0x2b')][_0xbb3e('0x2c')]};});_0x2229ad[_0xbb3e('0x2d')]=_[_0xbb3e('0x27')](_0x44bf79,_0xbb3e('0x25'));_0x2229ad[_0xbb3e('0x2e')]=_[_0xbb3e('0x2f')](_0x56c12f[_0xbb3e('0x2e')]);_0x2229ad[_0xbb3e('0x30')]=_[_0xbb3e('0x31')](_0x2229ad['model'],_0x2229ad['query']);_0x5229a9[_0xbb3e('0x32')]=_[_0xbb3e('0x31')](_0x2229ad['model'],qs[_0xbb3e('0x33')](_0x56c12f[_0xbb3e('0x2e')]['fields']));_0x5229a9[_0xbb3e('0x32')]=_0x5229a9['attributes'][_0xbb3e('0x34')]?_0x5229a9[_0xbb3e('0x32')]:_0x2229ad[_0xbb3e('0x2d')];if(!_0x56c12f[_0xbb3e('0x2e')][_0xbb3e('0x35')](_0xbb3e('0x36'))){_0x5229a9[_0xbb3e('0x1b')]=qs[_0xbb3e('0x1b')](_0x56c12f[_0xbb3e('0x2e')]['limit']);_0x5229a9[_0xbb3e('0x19')]=qs[_0xbb3e('0x19')](_0x56c12f[_0xbb3e('0x2e')][_0xbb3e('0x19')]);}_0x5229a9[_0xbb3e('0x37')]=qs[_0xbb3e('0x38')](_0x56c12f[_0xbb3e('0x2e')][_0xbb3e('0x38')]);_0x5229a9['where']=qs[_0xbb3e('0x30')](_[_0xbb3e('0x39')](_0x56c12f[_0xbb3e('0x2e')],_0x2229ad[_0xbb3e('0x30')]),_0x44bf79);if(_0x56c12f['query']['filter']){_0x5229a9[_0xbb3e('0x3a')]=_['merge'](_0x5229a9[_0xbb3e('0x3a')],{'$or':_[_0xbb3e('0x27')](_0x44bf79,function(_0x430bb8){if(_0x430bb8[_0xbb3e('0x2b')]!==_0xbb3e('0x3b')){var _0x2198bb={};_0x2198bb[_0x430bb8['name']]={'$like':'%'+_0x56c12f[_0xbb3e('0x2e')]['filter']+'%'};return _0x2198bb;}})});}_0x5229a9=_[_0xbb3e('0x3c')]({},_0x5229a9,_0x56c12f['options']);var _0x3d1001={'where':_0x5229a9[_0xbb3e('0x3a')]};return db[_0xbb3e('0x28')][_0xbb3e('0x1c')](_0x3d1001)[_0xbb3e('0x21')](function(_0x1812f7){_0x503dd1[_0xbb3e('0x1c')]=_0x1812f7;if(_0x56c12f['query'][_0xbb3e('0x3d')]){_0x5229a9['include']=[{'all':!![]}];}return db[_0xbb3e('0x28')][_0xbb3e('0x3e')](_0x5229a9);})[_0xbb3e('0x21')](function(_0x5d190a){_0x503dd1[_0xbb3e('0x3f')]=_0x5d190a;return _0x503dd1;})[_0xbb3e('0x21')](respondWithFilteredResult(_0x2e8c2e,_0x5229a9))[_0xbb3e('0x40')](handleError(_0x2e8c2e,null));};exports[_0xbb3e('0x41')]=function(_0xe3b00f,_0x46eced){var _0x446df0={'raw':![],'where':{'id':_0xe3b00f[_0xbb3e('0x42')]['id']}},_0x594e1d={};_0x594e1d[_0xbb3e('0x2d')]=_[_0xbb3e('0x2f')](db[_0xbb3e('0x28')][_0xbb3e('0x29')]);_0x594e1d[_0xbb3e('0x2e')]=_[_0xbb3e('0x2f')](_0xe3b00f[_0xbb3e('0x2e')]);_0x594e1d[_0xbb3e('0x30')]=_[_0xbb3e('0x31')](_0x594e1d[_0xbb3e('0x2d')],_0x594e1d[_0xbb3e('0x2e')]);_0x446df0[_0xbb3e('0x32')]=_[_0xbb3e('0x31')](_0x594e1d[_0xbb3e('0x2d')],qs[_0xbb3e('0x33')](_0xe3b00f[_0xbb3e('0x2e')][_0xbb3e('0x33')]));_0x446df0[_0xbb3e('0x32')]=_0x446df0[_0xbb3e('0x32')][_0xbb3e('0x34')]?_0x446df0[_0xbb3e('0x32')]:_0x594e1d[_0xbb3e('0x2d')];if(_0xe3b00f[_0xbb3e('0x2e')]['includeAll']){_0x446df0[_0xbb3e('0x43')]=[{'all':!![]}];}_0x446df0=_[_0xbb3e('0x3c')]({},_0x446df0,_0xe3b00f[_0xbb3e('0x44')]);return db['Dynamics365Configuration'][_0xbb3e('0x45')](_0x446df0)['then'](handleEntityNotFound(_0x46eced,null))['then'](respondWithResult(_0x46eced,null))[_0xbb3e('0x40')](handleError(_0x46eced,null));};exports[_0xbb3e('0x46')]=function(_0x13d713,_0x511c75){return db[_0xbb3e('0x28')][_0xbb3e('0x46')](_0x13d713[_0xbb3e('0x47')],{})['then'](respondWithResult(_0x511c75,0xc9))['catch'](handleError(_0x511c75,null));};exports['update']=function(_0x45b2f7,_0x2bc4c9){if(_0x45b2f7['body']['id']){delete _0x45b2f7[_0xbb3e('0x47')]['id'];}return db['Dynamics365Configuration'][_0xbb3e('0x45')]({'where':{'id':_0x45b2f7['params']['id']}})[_0xbb3e('0x21')](handleEntityNotFound(_0x2bc4c9,null))['then'](saveUpdates(_0x45b2f7[_0xbb3e('0x47')],null))[_0xbb3e('0x21')](respondWithResult(_0x2bc4c9,null))[_0xbb3e('0x40')](handleError(_0x2bc4c9,null));};exports[_0xbb3e('0x22')]=function(_0x45e8eb,_0x1943f0){return db['Dynamics365Configuration'][_0xbb3e('0x45')]({'where':{'id':_0x45e8eb[_0xbb3e('0x42')]['id']}})[_0xbb3e('0x21')](handleEntityNotFound(_0x1943f0,null))[_0xbb3e('0x21')](removeEntity(_0x1943f0,null))['catch'](handleError(_0x1943f0,null));};exports[_0xbb3e('0x48')]=function(_0x5b9d6c,_0x6ea54e,_0x5aa052){var _0x49b342={};var _0x217864={};var _0xb99ea3;var _0x15925f;return db['Dynamics365Configuration'][_0xbb3e('0x49')]({'where':{'id':_0x5b9d6c['params']['id']}})[_0xbb3e('0x21')](handleEntityNotFound(_0x6ea54e,null))[_0xbb3e('0x21')](function(_0x2d4811){if(_0x2d4811){_0xb99ea3=_0x2d4811;_0x217864[_0xbb3e('0x2d')]=_['keys'](db[_0xbb3e('0x4a')]['rawAttributes']);_0x217864[_0xbb3e('0x2e')]=_[_0xbb3e('0x2f')](_0x5b9d6c['query']);_0x217864[_0xbb3e('0x30')]=_['intersection'](_0x217864[_0xbb3e('0x2d')],_0x217864[_0xbb3e('0x2e')]);_0x49b342[_0xbb3e('0x32')]=_['intersection'](_0x217864['model'],qs[_0xbb3e('0x33')](_0x5b9d6c[_0xbb3e('0x2e')][_0xbb3e('0x33')]));_0x49b342['attributes']=_0x49b342['attributes'][_0xbb3e('0x34')]?_0x49b342[_0xbb3e('0x32')]:_0x217864[_0xbb3e('0x2d')];_0x49b342[_0xbb3e('0x37')]=qs[_0xbb3e('0x38')](_0x5b9d6c[_0xbb3e('0x2e')]['sort']);_0x49b342[_0xbb3e('0x3a')]=qs['filters'](_[_0xbb3e('0x39')](_0x5b9d6c[_0xbb3e('0x2e')],_0x217864[_0xbb3e('0x30')]));if(_0x5b9d6c[_0xbb3e('0x2e')][_0xbb3e('0x4b')]){_0x49b342[_0xbb3e('0x3a')]=_[_0xbb3e('0x3c')](_0x49b342[_0xbb3e('0x3a')],{'$or':_[_0xbb3e('0x27')](_0x49b342[_0xbb3e('0x32')],function(_0x5be1d8){var _0x51ca2f={};_0x51ca2f[_0x5be1d8]={'$like':'%'+_0x5b9d6c[_0xbb3e('0x2e')]['filter']+'%'};return _0x51ca2f;})});}_0x49b342=_[_0xbb3e('0x3c')]({},_0x49b342,_0x5b9d6c[_0xbb3e('0x44')]);return _0xb99ea3['getFields'](_0x49b342);}})[_0xbb3e('0x21')](function(_0x8b0b01){if(_0x8b0b01){_0x15925f=_0x8b0b01[_0xbb3e('0x34')];if(!_0x5b9d6c[_0xbb3e('0x2e')]['hasOwnProperty']('nolimit')){_0x49b342[_0xbb3e('0x1b')]=qs[_0xbb3e('0x1b')](_0x5b9d6c['query'][_0xbb3e('0x1b')]);_0x49b342['offset']=qs['offset'](_0x5b9d6c[_0xbb3e('0x2e')]['offset']);}return _0xb99ea3[_0xbb3e('0x48')](_0x49b342);}})[_0xbb3e('0x21')](function(_0x5b6619){if(_0x5b6619){return _0x5b6619?{'count':_0x15925f,'rows':_0x5b6619}:null;}})[_0xbb3e('0x21')](respondWithResult(_0x6ea54e,null))['catch'](handleError(_0x6ea54e,null));};exports['getSubjects']=function(_0x50fb28,_0x5f1bf8,_0xa3822){var _0xe102be={};var _0x2e79ee={};var _0x3c5348;var _0x5b2f5c;return db[_0xbb3e('0x28')][_0xbb3e('0x49')]({'where':{'id':_0x50fb28[_0xbb3e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5f1bf8,null))['then'](function(_0x505f2c){if(_0x505f2c){_0x3c5348=_0x505f2c;_0x2e79ee[_0xbb3e('0x2d')]=_[_0xbb3e('0x2f')](db[_0xbb3e('0x4a')]['rawAttributes']);_0x2e79ee[_0xbb3e('0x2e')]=_[_0xbb3e('0x2f')](_0x50fb28[_0xbb3e('0x2e')]);_0x2e79ee[_0xbb3e('0x30')]=_[_0xbb3e('0x31')](_0x2e79ee[_0xbb3e('0x2d')],_0x2e79ee[_0xbb3e('0x2e')]);_0xe102be[_0xbb3e('0x32')]=_[_0xbb3e('0x31')](_0x2e79ee[_0xbb3e('0x2d')],qs[_0xbb3e('0x33')](_0x50fb28[_0xbb3e('0x2e')][_0xbb3e('0x33')]));_0xe102be[_0xbb3e('0x32')]=_0xe102be[_0xbb3e('0x32')]['length']?_0xe102be[_0xbb3e('0x32')]:_0x2e79ee[_0xbb3e('0x2d')];_0xe102be[_0xbb3e('0x37')]=qs[_0xbb3e('0x38')](_0x50fb28['query'][_0xbb3e('0x38')]);_0xe102be[_0xbb3e('0x3a')]=qs[_0xbb3e('0x30')](_['pick'](_0x50fb28['query'],_0x2e79ee[_0xbb3e('0x30')]));if(_0x50fb28['query']['filter']){_0xe102be[_0xbb3e('0x3a')]=_[_0xbb3e('0x3c')](_0xe102be['where'],{'$or':_[_0xbb3e('0x27')](_0xe102be[_0xbb3e('0x32')],function(_0x55bf96){var _0x49b178={};_0x49b178[_0x55bf96]={'$like':'%'+_0x50fb28[_0xbb3e('0x2e')][_0xbb3e('0x4b')]+'%'};return _0x49b178;})});}_0xe102be=_[_0xbb3e('0x3c')]({},_0xe102be,_0x50fb28[_0xbb3e('0x44')]);return _0x3c5348['getSubjects'](_0xe102be);}})[_0xbb3e('0x21')](function(_0x507224){if(_0x507224){_0x5b2f5c=_0x507224[_0xbb3e('0x34')];if(!_0x50fb28[_0xbb3e('0x2e')]['hasOwnProperty'](_0xbb3e('0x36'))){_0xe102be['limit']=qs[_0xbb3e('0x1b')](_0x50fb28['query']['limit']);_0xe102be[_0xbb3e('0x19')]=qs[_0xbb3e('0x19')](_0x50fb28[_0xbb3e('0x2e')][_0xbb3e('0x19')]);}return _0x3c5348['getSubjects'](_0xe102be);}})[_0xbb3e('0x21')](function(_0x46b249){if(_0x46b249){return _0x46b249?{'count':_0x5b2f5c,'rows':_0x46b249}:null;}})[_0xbb3e('0x21')](respondWithResult(_0x5f1bf8,null))[_0xbb3e('0x40')](handleError(_0x5f1bf8,null));};exports[_0xbb3e('0x4c')]=function(_0x5473c9,_0x23a468,_0x4a1c03){var _0x35f446={};var _0xe3e63b={};var _0x95c3ca;var _0x4b80a1;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5473c9[_0xbb3e('0x42')]['id']}})[_0xbb3e('0x21')](handleEntityNotFound(_0x23a468,null))[_0xbb3e('0x21')](function(_0x55a8e4){if(_0x55a8e4){_0x95c3ca=_0x55a8e4;_0xe3e63b[_0xbb3e('0x2d')]=_[_0xbb3e('0x2f')](db['Dynamics365Field']['rawAttributes']);_0xe3e63b[_0xbb3e('0x2e')]=_['keys'](_0x5473c9['query']);_0xe3e63b[_0xbb3e('0x30')]=_['intersection'](_0xe3e63b[_0xbb3e('0x2d')],_0xe3e63b[_0xbb3e('0x2e')]);_0x35f446[_0xbb3e('0x32')]=_['intersection'](_0xe3e63b[_0xbb3e('0x2d')],qs[_0xbb3e('0x33')](_0x5473c9[_0xbb3e('0x2e')]['fields']));_0x35f446[_0xbb3e('0x32')]=_0x35f446[_0xbb3e('0x32')][_0xbb3e('0x34')]?_0x35f446[_0xbb3e('0x32')]:_0xe3e63b['model'];_0x35f446[_0xbb3e('0x37')]=qs[_0xbb3e('0x38')](_0x5473c9[_0xbb3e('0x2e')][_0xbb3e('0x38')]);_0x35f446['where']=qs[_0xbb3e('0x30')](_['pick'](_0x5473c9[_0xbb3e('0x2e')],_0xe3e63b[_0xbb3e('0x30')]));if(_0x5473c9[_0xbb3e('0x2e')][_0xbb3e('0x4b')]){_0x35f446[_0xbb3e('0x3a')]=_[_0xbb3e('0x3c')](_0x35f446[_0xbb3e('0x3a')],{'$or':_['map'](_0x35f446[_0xbb3e('0x32')],function(_0x4c4a3e){var _0x2252a={};_0x2252a[_0x4c4a3e]={'$like':'%'+_0x5473c9[_0xbb3e('0x2e')][_0xbb3e('0x4b')]+'%'};return _0x2252a;})});}_0x35f446=_[_0xbb3e('0x3c')]({},_0x35f446,_0x5473c9[_0xbb3e('0x44')]);return _0x95c3ca[_0xbb3e('0x4c')](_0x35f446);}})[_0xbb3e('0x21')](function(_0x29311c){if(_0x29311c){_0x4b80a1=_0x29311c[_0xbb3e('0x34')];if(!_0x5473c9[_0xbb3e('0x2e')][_0xbb3e('0x35')]('nolimit')){_0x35f446['limit']=qs['limit'](_0x5473c9[_0xbb3e('0x2e')][_0xbb3e('0x1b')]);_0x35f446[_0xbb3e('0x19')]=qs['offset'](_0x5473c9['query'][_0xbb3e('0x19')]);}return _0x95c3ca[_0xbb3e('0x4c')](_0x35f446);}})[_0xbb3e('0x21')](function(_0x3d5893){if(_0x3d5893){return _0x3d5893?{'count':_0x4b80a1,'rows':_0x3d5893}:null;}})[_0xbb3e('0x21')](respondWithResult(_0x23a468,null))['catch'](handleError(_0x23a468,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index e41b42b..38a7fa5 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 _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x9f55dd,_0x4b7ecc){var _0x652424=function(_0x1e8a56){while(--_0x1e8a56){_0x9f55dd['push'](_0x9f55dd['shift']());}};_0x652424(++_0x4b7ecc);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xf3cd[_0x8c1005];return _0x175354;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x18f0bd,_0x2675c3){var _0x314678=function(_0x558bff){while(--_0x558bff){_0x18f0bd['push'](_0x18f0bd['shift']());}};_0x314678(++_0x2675c3);}(_0x008c,0x188));var _0xc008=function(_0x5f259c,_0x26127d){_0x5f259c=_0x5f259c-0x0;var _0xddcf04=_0x008c[_0x5f259c];return _0xddcf04;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'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 42e9e5f..8bc9390 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 _0xaa17=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x347d39,_0x32496e){var _0x3b0c07=function(_0x5aec4b){while(--_0x5aec4b){_0x347d39['push'](_0x347d39['shift']());}};_0x3b0c07(++_0x32496e);}(_0xaa17,0x168));var _0x7aa1=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xaa17[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x7aa1('0x0'));var util=require(_0x7aa1('0x1'));var moment=require('moment');var BPromise=require(_0x7aa1('0x2'));var rs=require(_0x7aa1('0x3'));var fs=require('fs');var Redis=require(_0x7aa1('0x4'));var db=require(_0x7aa1('0x5'))['db'];var utils=require(_0x7aa1('0x6'));var logger=require(_0x7aa1('0x7'))(_0x7aa1('0x8'));var config=require('../../config/environment');var jayson=require(_0x7aa1('0x9'));var client=jayson[_0x7aa1('0xa')][_0x7aa1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1af2c9,_0x39d139,_0x50d504){return new BPromise(function(_0x488e1c,_0x30c0a1){return client['request'](_0x1af2c9,_0x50d504)[_0x7aa1('0xc')](function(_0x27e8fd){logger[_0x7aa1('0xd')](_0x7aa1('0xe'),_0x39d139,_0x7aa1('0xf'));logger[_0x7aa1('0x10')](_0x7aa1('0x11'),_0x39d139,_0x7aa1('0xf'),JSON[_0x7aa1('0x12')](_0x27e8fd));if(_0x27e8fd[_0x7aa1('0x13')]){if(_0x27e8fd[_0x7aa1('0x13')]['code']===0x1f4){logger[_0x7aa1('0x13')](_0x7aa1('0xe'),_0x39d139,_0x27e8fd[_0x7aa1('0x13')]['message']);return _0x30c0a1(_0x27e8fd[_0x7aa1('0x13')][_0x7aa1('0x14')]);}logger[_0x7aa1('0x13')](_0x7aa1('0xe'),_0x39d139,_0x27e8fd['error']['message']);return _0x488e1c(_0x27e8fd[_0x7aa1('0x13')][_0x7aa1('0x14')]);}else{logger[_0x7aa1('0xd')](_0x7aa1('0xe'),_0x39d139,_0x7aa1('0xf'));_0x488e1c(_0x27e8fd['result'][_0x7aa1('0x14')]);}})[_0x7aa1('0x15')](function(_0x226637){logger[_0x7aa1('0x13')](_0x7aa1('0xe'),_0x39d139,_0x226637);_0x30c0a1(_0x226637);});});} \ No newline at end of file +var _0xb837=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0xb837,0x1ae));var _0x7b83=function(_0x1f1443,_0x5a76d3){_0x1f1443=_0x1f1443-0x0;var _0x1badbe=_0xb837[_0x1f1443];return _0x1badbe;};'use strict';var _=require(_0x7b83('0x0'));var util=require(_0x7b83('0x1'));var moment=require(_0x7b83('0x2'));var BPromise=require('bluebird');var rs=require(_0x7b83('0x3'));var fs=require('fs');var Redis=require(_0x7b83('0x4'));var db=require(_0x7b83('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b83('0x6'))(_0x7b83('0x7'));var config=require(_0x7b83('0x8'));var jayson=require(_0x7b83('0x9'));var client=jayson[_0x7b83('0xa')][_0x7b83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33de34,_0x27ed1c,_0x3e4e99){return new BPromise(function(_0x51d867,_0x23be16){return client[_0x7b83('0xc')](_0x33de34,_0x3e4e99)['then'](function(_0x5efb93){logger[_0x7b83('0xd')](_0x7b83('0xe'),_0x27ed1c,_0x7b83('0xf'));logger[_0x7b83('0x10')](_0x7b83('0x11'),_0x27ed1c,'request\x20sent',JSON[_0x7b83('0x12')](_0x5efb93));if(_0x5efb93[_0x7b83('0x13')]){if(_0x5efb93[_0x7b83('0x13')][_0x7b83('0x14')]===0x1f4){logger['error'](_0x7b83('0xe'),_0x27ed1c,_0x5efb93[_0x7b83('0x13')][_0x7b83('0x15')]);return _0x23be16(_0x5efb93['error']['message']);}logger[_0x7b83('0x13')](_0x7b83('0xe'),_0x27ed1c,_0x5efb93['error'][_0x7b83('0x15')]);return _0x51d867(_0x5efb93[_0x7b83('0x13')][_0x7b83('0x15')]);}else{logger[_0x7b83('0xd')](_0x7b83('0xe'),_0x27ed1c,_0x7b83('0xf'));_0x51d867(_0x5efb93[_0x7b83('0x16')][_0x7b83('0x15')]);}})[_0x7b83('0x17')](function(_0x4d5732){logger[_0x7b83('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x27ed1c,_0x4d5732);_0x23be16(_0x4d5732);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 382609e..1356c4d 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 _0x4c3f=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x4c3f,0x124));var _0xf4c3=function(_0x3b1c9a,_0x50c419){_0x3b1c9a=_0x3b1c9a-0x0;var _0x5ee955=_0x4c3f[_0x3b1c9a];return _0x5ee955;};'use strict';var multer=require(_0xf4c3('0x0'));var util=require(_0xf4c3('0x1'));var path=require(_0xf4c3('0x2'));var timeout=require(_0xf4c3('0x3'));var express=require(_0xf4c3('0x4'));var router=express[_0xf4c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf4c3('0x6'));var interaction=require(_0xf4c3('0x7'));var config=require(_0xf4c3('0x8'));var controller=require(_0xf4c3('0x9'));router[_0xf4c3('0xa')]('/',auth[_0xf4c3('0xb')](),controller[_0xf4c3('0xc')]);router[_0xf4c3('0xa')](_0xf4c3('0xd'),auth[_0xf4c3('0xb')](),controller[_0xf4c3('0xe')]);router[_0xf4c3('0xf')]('/',auth[_0xf4c3('0xb')](),controller[_0xf4c3('0x10')]);router[_0xf4c3('0x11')](_0xf4c3('0xd'),auth[_0xf4c3('0xb')](),controller[_0xf4c3('0x12')]);router[_0xf4c3('0x13')](_0xf4c3('0xd'),auth[_0xf4c3('0xb')](),controller[_0xf4c3('0x14')]);module[_0xf4c3('0x15')]=router; \ No newline at end of file +var _0xe42c=['post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0xe42c,0xb2));var _0xce42=function(_0x16ddab,_0x5f4394){_0x16ddab=_0x16ddab-0x0;var _0x316a43=_0xe42c[_0x16ddab];return _0x316a43;};'use strict';var multer=require(_0xce42('0x0'));var util=require(_0xce42('0x1'));var path=require(_0xce42('0x2'));var timeout=require('connect-timeout');var express=require(_0xce42('0x3'));var router=express[_0xce42('0x4')]();var fs_extra=require(_0xce42('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xce42('0x6'));var config=require(_0xce42('0x7'));var controller=require(_0xce42('0x8'));router[_0xce42('0x9')]('/',auth[_0xce42('0xa')](),controller[_0xce42('0xb')]);router['get']('/:id',auth[_0xce42('0xa')](),controller['show']);router[_0xce42('0xc')]('/',auth['isAuthenticated'](),controller[_0xce42('0xd')]);router['put'](_0xce42('0xe'),auth[_0xce42('0xa')](),controller[_0xce42('0xf')]);router[_0xce42('0x10')]('/:id',auth[_0xce42('0xa')](),controller[_0xce42('0x11')]);module[_0xce42('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a0a2d6f..124dd47 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 _0xf941=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0xe93730,_0x3ab741){var _0x4e05a0=function(_0x3fa3f0){while(--_0x3fa3f0){_0xe93730['push'](_0xe93730['shift']());}};_0x4e05a0(++_0x3ab741);}(_0xf941,0xb0));var _0x1f94=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf941[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x1f94('0x0'));module[_0x1f94('0x1')]={'type':{'type':Sequelize[_0x1f94('0x2')](_0x1f94('0x3'),_0x1f94('0x4'),_0x1f94('0x5'),_0x1f94('0x6'),_0x1f94('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1f94('0x8')]},'keyType':{'type':Sequelize[_0x1f94('0x2')](_0x1f94('0x3'),'variable',_0x1f94('0x5'))},'keyContent':{'type':Sequelize[_0x1f94('0x8')]},'idField':{'type':Sequelize[_0x1f94('0x8')]},'nameField':{'type':Sequelize[_0x1f94('0x8')]},'customField':{'type':Sequelize[_0x1f94('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f94('0x8')]}}; \ No newline at end of file +var _0xe030=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x58a92a,_0x4aaad0){var _0x45b8dc=function(_0x4077bc){while(--_0x4077bc){_0x58a92a['push'](_0x58a92a['shift']());}};_0x45b8dc(++_0x4aaad0);}(_0xe030,0x1d0));var _0x0e03=function(_0x261b97,_0x50c866){_0x261b97=_0x261b97-0x0;var _0x4f423f=_0xe030[_0x261b97];return _0x4f423f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0e03('0x0')](_0x0e03('0x1'),_0x0e03('0x2'),_0x0e03('0x3'),_0x0e03('0x4'),_0x0e03('0x5')),'defaultValue':_0x0e03('0x1')},'content':{'type':Sequelize[_0x0e03('0x6')]},'key':{'type':Sequelize[_0x0e03('0x6')]},'keyType':{'type':Sequelize[_0x0e03('0x0')](_0x0e03('0x1'),_0x0e03('0x2'),_0x0e03('0x3'))},'keyContent':{'type':Sequelize[_0x0e03('0x6')]},'idField':{'type':Sequelize[_0x0e03('0x6')]},'nameField':{'type':Sequelize[_0x0e03('0x6')]},'customField':{'type':Sequelize[_0x0e03('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 2b79570..8665a2a 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 _0x69f3=['attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x5e951b,_0x43e699){var _0x5ea88e=function(_0x4a8b88){while(--_0x4a8b88){_0x5e951b['push'](_0x5e951b['shift']());}};_0x5ea88e(++_0x43e699);}(_0x69f3,0x13a));var _0x369f=function(_0x5a4a80,_0x260d3f){_0x5a4a80=_0x5a4a80-0x0;var _0x17aa08=_0x69f3[_0x5a4a80];return _0x17aa08;};'use strict';var emlformat=require(_0x369f('0x0'));var rimraf=require(_0x369f('0x1'));var zipdir=require(_0x369f('0x2'));var jsonpatch=require(_0x369f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x369f('0x4'));var util=require(_0x369f('0x5'));var path=require('path');var sox=require(_0x369f('0x6'));var csv=require(_0x369f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x369f('0x8'));var _=require('lodash');var squel=require(_0x369f('0x9'));var crypto=require(_0x369f('0xa'));var jsforce=require(_0x369f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x369f('0x7'));var querystring=require(_0x369f('0xc'));var Papa=require('papaparse');var Redis=require(_0x369f('0xd'));var authService=require(_0x369f('0xe'));var qs=require(_0x369f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x369f('0x10'));var logger=require(_0x369f('0x11'))('api');var utils=require(_0x369f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x369f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa7c243,_0x56426e){_0x56426e=_0x56426e||0xcc;return function(_0x34aab2){if(_0x34aab2){return _0xa7c243[_0x369f('0x14')](_0x56426e);}return _0xa7c243[_0x369f('0x15')](_0x56426e)[_0x369f('0x16')]();};}function respondWithResult(_0x3ade73,_0x14124f){_0x14124f=_0x14124f||0xc8;return function(_0x593deb){if(_0x593deb){return _0x3ade73[_0x369f('0x15')](_0x14124f)[_0x369f('0x17')](_0x593deb);}};}function respondWithFilteredResult(_0x5b83c4,_0x486e42){return function(_0x3796e9){if(_0x3796e9){var _0x117620=typeof _0x486e42[_0x369f('0x18')]===_0x369f('0x19')&&typeof _0x486e42['limit']===_0x369f('0x19');var _0x31c201=_0x3796e9[_0x369f('0x1a')];var _0x76914c=_0x117620?0x0:_0x486e42[_0x369f('0x18')];var _0x232cd6=_0x117620?_0x3796e9[_0x369f('0x1a')]:_0x486e42[_0x369f('0x18')]+_0x486e42[_0x369f('0x1b')];var _0xa24e1e;if(_0x232cd6>=_0x31c201){_0x232cd6=_0x31c201;_0xa24e1e=0xc8;}else{_0xa24e1e=0xce;}_0x5b83c4[_0x369f('0x15')](_0xa24e1e);return _0x5b83c4[_0x369f('0x1c')](_0x369f('0x1d'),_0x76914c+'-'+_0x232cd6+'/'+_0x31c201)[_0x369f('0x17')](_0x3796e9);}return null;};}function patchUpdates(_0x30dbbf){return function(_0x5419e2){try{jsonpatch[_0x369f('0x1e')](_0x5419e2,_0x30dbbf,!![]);}catch(_0x1c69fa){return BPromise['reject'](_0x1c69fa);}return _0x5419e2[_0x369f('0x1f')]();};}function saveUpdates(_0xdd9f1b,_0x3f2baa){return function(_0x263fd1){if(_0x263fd1){return _0x263fd1[_0x369f('0x20')](_0xdd9f1b)[_0x369f('0x21')](function(_0x2d6e3e){return _0x2d6e3e;});}return null;};}function removeEntity(_0x3cbd68,_0x30a364){return function(_0x51695a){if(_0x51695a){return _0x51695a[_0x369f('0x22')]()[_0x369f('0x21')](function(){_0x3cbd68[_0x369f('0x15')](0xcc)[_0x369f('0x16')]();});}};}function handleEntityNotFound(_0x431fc1,_0x5e52e7){return function(_0x2e1a79){if(!_0x2e1a79){_0x431fc1[_0x369f('0x14')](0x194);}return _0x2e1a79;};}function handleError(_0x496acb,_0x454f1c){_0x454f1c=_0x454f1c||0x1f4;return function(_0x4efe89){logger[_0x369f('0x23')](_0x4efe89[_0x369f('0x24')]);if(_0x4efe89[_0x369f('0x25')]){delete _0x4efe89[_0x369f('0x25')];}_0x496acb['status'](_0x454f1c)[_0x369f('0x26')](_0x4efe89);};}exports[_0x369f('0x27')]=function(_0x35581f,_0x59f797){var _0x2f5a78={},_0x370586={},_0x5650df={'count':0x0,'rows':[]};var _0x5e65b4=_[_0x369f('0x28')](db[_0x369f('0x29')][_0x369f('0x2a')],function(_0x5a400f){return{'name':_0x5a400f[_0x369f('0x2b')],'type':_0x5a400f[_0x369f('0x2c')][_0x369f('0x2d')]};});_0x370586['model']=_['map'](_0x5e65b4,_0x369f('0x25'));_0x370586[_0x369f('0x2e')]=_[_0x369f('0x2f')](_0x35581f[_0x369f('0x2e')]);_0x370586[_0x369f('0x30')]=_[_0x369f('0x31')](_0x370586[_0x369f('0x32')],_0x370586[_0x369f('0x2e')]);_0x2f5a78[_0x369f('0x33')]=_[_0x369f('0x31')](_0x370586[_0x369f('0x32')],qs[_0x369f('0x34')](_0x35581f[_0x369f('0x2e')][_0x369f('0x34')]));_0x2f5a78['attributes']=_0x2f5a78[_0x369f('0x33')][_0x369f('0x35')]?_0x2f5a78['attributes']:_0x370586[_0x369f('0x32')];if(!_0x35581f[_0x369f('0x2e')]['hasOwnProperty'](_0x369f('0x36'))){_0x2f5a78[_0x369f('0x1b')]=qs[_0x369f('0x1b')](_0x35581f['query'][_0x369f('0x1b')]);_0x2f5a78['offset']=qs[_0x369f('0x18')](_0x35581f[_0x369f('0x2e')][_0x369f('0x18')]);}_0x2f5a78[_0x369f('0x37')]=qs[_0x369f('0x38')](_0x35581f[_0x369f('0x2e')][_0x369f('0x38')]);_0x2f5a78['where']=qs['filters'](_[_0x369f('0x39')](_0x35581f['query'],_0x370586['filters']),_0x5e65b4);if(_0x35581f[_0x369f('0x2e')][_0x369f('0x3a')]){_0x2f5a78[_0x369f('0x3b')]=_[_0x369f('0x3c')](_0x2f5a78[_0x369f('0x3b')],{'$or':_[_0x369f('0x28')](_0x5e65b4,function(_0xb87b8){if(_0xb87b8[_0x369f('0x2c')]!==_0x369f('0x3d')){var _0x3a3a8b={};_0x3a3a8b[_0xb87b8[_0x369f('0x25')]]={'$like':'%'+_0x35581f['query'][_0x369f('0x3a')]+'%'};return _0x3a3a8b;}})});}_0x2f5a78=_['merge']({},_0x2f5a78,_0x35581f[_0x369f('0x3e')]);var _0x1a3314={'where':_0x2f5a78[_0x369f('0x3b')]};return db['Dynamics365Field']['count'](_0x1a3314)[_0x369f('0x21')](function(_0x4547a5){_0x5650df[_0x369f('0x1a')]=_0x4547a5;if(_0x35581f[_0x369f('0x2e')][_0x369f('0x3f')]){_0x2f5a78[_0x369f('0x40')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x369f('0x41')](_0x2f5a78);})[_0x369f('0x21')](function(_0x5f19d6){_0x5650df[_0x369f('0x42')]=_0x5f19d6;return _0x5650df;})['then'](respondWithFilteredResult(_0x59f797,_0x2f5a78))['catch'](handleError(_0x59f797,null));};exports[_0x369f('0x43')]=function(_0x333e60,_0x7c8c0c){var _0x27fb58={'raw':!![],'where':{'id':_0x333e60[_0x369f('0x44')]['id']}},_0x20b712={};_0x20b712[_0x369f('0x32')]=_[_0x369f('0x2f')](db['Dynamics365Field'][_0x369f('0x2a')]);_0x20b712['query']=_['keys'](_0x333e60['query']);_0x20b712[_0x369f('0x30')]=_['intersection'](_0x20b712[_0x369f('0x32')],_0x20b712[_0x369f('0x2e')]);_0x27fb58['attributes']=_[_0x369f('0x31')](_0x20b712[_0x369f('0x32')],qs['fields'](_0x333e60[_0x369f('0x2e')]['fields']));_0x27fb58[_0x369f('0x33')]=_0x27fb58['attributes'][_0x369f('0x35')]?_0x27fb58[_0x369f('0x33')]:_0x20b712[_0x369f('0x32')];if(_0x333e60['query'][_0x369f('0x3f')]){_0x27fb58['include']=[{'all':!![]}];}_0x27fb58=_[_0x369f('0x3c')]({},_0x27fb58,_0x333e60[_0x369f('0x3e')]);return db[_0x369f('0x29')][_0x369f('0x45')](_0x27fb58)[_0x369f('0x21')](handleEntityNotFound(_0x7c8c0c,null))[_0x369f('0x21')](respondWithResult(_0x7c8c0c,null))[_0x369f('0x46')](handleError(_0x7c8c0c,null));};exports[_0x369f('0x47')]=function(_0xbfa8b6,_0x27055b){return db['Dynamics365Field'][_0x369f('0x47')](_0xbfa8b6[_0x369f('0x48')],{})['then'](respondWithResult(_0x27055b,0xc9))[_0x369f('0x46')](handleError(_0x27055b,null));};exports[_0x369f('0x20')]=function(_0x2d11ab,_0x209f69){if(_0x2d11ab[_0x369f('0x48')]['id']){delete _0x2d11ab[_0x369f('0x48')]['id'];}return db[_0x369f('0x29')]['find']({'where':{'id':_0x2d11ab[_0x369f('0x44')]['id']}})['then'](handleEntityNotFound(_0x209f69,null))[_0x369f('0x21')](saveUpdates(_0x2d11ab[_0x369f('0x48')],null))[_0x369f('0x21')](respondWithResult(_0x209f69,null))['catch'](handleError(_0x209f69,null));};exports[_0x369f('0x22')]=function(_0x58ac6c,_0x30d168){return db[_0x369f('0x29')][_0x369f('0x45')]({'where':{'id':_0x58ac6c[_0x369f('0x44')]['id']}})['then'](handleEntityNotFound(_0x30d168,null))[_0x369f('0x21')](removeEntity(_0x30d168,null))['catch'](handleError(_0x30d168,null));}; \ No newline at end of file +var _0x44b9=['VIRTUAL','filter','findAll','show','params','includeAll','include','options','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','end','error','stack','index','map','Dynamics365Field','rawAttributes','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge'];(function(_0x2a61b4,_0x2182eb){var _0x1150b4=function(_0x302140){while(--_0x302140){_0x2a61b4['push'](_0x2a61b4['shift']());}};_0x1150b4(++_0x2182eb);}(_0x44b9,0x175));var _0x944b=function(_0x20f586,_0x1165de){_0x20f586=_0x20f586-0x0;var _0x1c56e6=_0x44b9[_0x20f586];return _0x1c56e6;};'use strict';var emlformat=require(_0x944b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x944b('0x1'));var jsonpatch=require(_0x944b('0x2'));var rp=require(_0x944b('0x3'));var moment=require(_0x944b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x944b('0x5'));var util=require('util');var path=require(_0x944b('0x6'));var sox=require(_0x944b('0x7'));var csv=require(_0x944b('0x8'));var ejs=require(_0x944b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x944b('0xa'));var squel=require(_0x944b('0xb'));var crypto=require(_0x944b('0xc'));var jsforce=require(_0x944b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x944b('0xe'));var Papa=require(_0x944b('0xf'));var Redis=require(_0x944b('0x10'));var authService=require(_0x944b('0x11'));var qs=require(_0x944b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x944b('0x13'));var logger=require('../../config/logger')(_0x944b('0x14'));var utils=require(_0x944b('0x15'));var config=require(_0x944b('0x16'));var licenseUtil=require(_0x944b('0x17'));var db=require(_0x944b('0x18'))['db'];function respondWithStatusCode(_0x531c75,_0x9c835b){_0x9c835b=_0x9c835b||0xcc;return function(_0x6d6d24){if(_0x6d6d24){return _0x531c75[_0x944b('0x19')](_0x9c835b);}return _0x531c75[_0x944b('0x1a')](_0x9c835b)['end']();};}function respondWithResult(_0xfb9532,_0x5d19b6){_0x5d19b6=_0x5d19b6||0xc8;return function(_0x394c4f){if(_0x394c4f){return _0xfb9532[_0x944b('0x1a')](_0x5d19b6)[_0x944b('0x1b')](_0x394c4f);}};}function respondWithFilteredResult(_0xacff6c,_0x55e0b1){return function(_0x13c661){if(_0x13c661){var _0x1f95db=typeof _0x55e0b1[_0x944b('0x1c')]===_0x944b('0x1d')&&typeof _0x55e0b1[_0x944b('0x1e')]==='undefined';var _0x2147d7=_0x13c661[_0x944b('0x1f')];var _0x359195=_0x1f95db?0x0:_0x55e0b1[_0x944b('0x1c')];var _0xc79f66=_0x1f95db?_0x13c661[_0x944b('0x1f')]:_0x55e0b1[_0x944b('0x1c')]+_0x55e0b1['limit'];var _0x55f3e5;if(_0xc79f66>=_0x2147d7){_0xc79f66=_0x2147d7;_0x55f3e5=0xc8;}else{_0x55f3e5=0xce;}_0xacff6c[_0x944b('0x1a')](_0x55f3e5);return _0xacff6c['set'](_0x944b('0x20'),_0x359195+'-'+_0xc79f66+'/'+_0x2147d7)[_0x944b('0x1b')](_0x13c661);}return null;};}function patchUpdates(_0x542773){return function(_0x1fdd7e){try{jsonpatch['apply'](_0x1fdd7e,_0x542773,!![]);}catch(_0x4ab342){return BPromise['reject'](_0x4ab342);}return _0x1fdd7e[_0x944b('0x21')]();};}function saveUpdates(_0x2a9743,_0x2766af){return function(_0x3b28c8){if(_0x3b28c8){return _0x3b28c8[_0x944b('0x22')](_0x2a9743)['then'](function(_0x4aa255){return _0x4aa255;});}return null;};}function removeEntity(_0x3aa13f,_0x1bc387){return function(_0x2c7909){if(_0x2c7909){return _0x2c7909['destroy']()[_0x944b('0x23')](function(){_0x3aa13f[_0x944b('0x1a')](0xcc)[_0x944b('0x24')]();});}};}function handleEntityNotFound(_0x119aa1,_0x468bc2){return function(_0x1cca15){if(!_0x1cca15){_0x119aa1['sendStatus'](0x194);}return _0x1cca15;};}function handleError(_0x4f6bfa,_0x239289){_0x239289=_0x239289||0x1f4;return function(_0x24831d){logger[_0x944b('0x25')](_0x24831d[_0x944b('0x26')]);if(_0x24831d['name']){delete _0x24831d['name'];}_0x4f6bfa[_0x944b('0x1a')](_0x239289)['send'](_0x24831d);};}exports[_0x944b('0x27')]=function(_0x28edf6,_0x2c84e1){var _0x47fd95={},_0x2b6470={},_0x394704={'count':0x0,'rows':[]};var _0x20c88c=_[_0x944b('0x28')](db[_0x944b('0x29')][_0x944b('0x2a')],function(_0x3b5b0b){return{'name':_0x3b5b0b['fieldName'],'type':_0x3b5b0b[_0x944b('0x2b')]['key']};});_0x2b6470['model']=_[_0x944b('0x28')](_0x20c88c,_0x944b('0x2c'));_0x2b6470[_0x944b('0x2d')]=_[_0x944b('0x2e')](_0x28edf6[_0x944b('0x2d')]);_0x2b6470[_0x944b('0x2f')]=_[_0x944b('0x30')](_0x2b6470[_0x944b('0x31')],_0x2b6470['query']);_0x47fd95[_0x944b('0x32')]=_[_0x944b('0x30')](_0x2b6470['model'],qs[_0x944b('0x33')](_0x28edf6['query'][_0x944b('0x33')]));_0x47fd95['attributes']=_0x47fd95[_0x944b('0x32')][_0x944b('0x34')]?_0x47fd95[_0x944b('0x32')]:_0x2b6470['model'];if(!_0x28edf6[_0x944b('0x2d')][_0x944b('0x35')]('nolimit')){_0x47fd95[_0x944b('0x1e')]=qs[_0x944b('0x1e')](_0x28edf6[_0x944b('0x2d')][_0x944b('0x1e')]);_0x47fd95[_0x944b('0x1c')]=qs[_0x944b('0x1c')](_0x28edf6[_0x944b('0x2d')]['offset']);}_0x47fd95[_0x944b('0x36')]=qs[_0x944b('0x37')](_0x28edf6[_0x944b('0x2d')]['sort']);_0x47fd95[_0x944b('0x38')]=qs['filters'](_[_0x944b('0x39')](_0x28edf6[_0x944b('0x2d')],_0x2b6470[_0x944b('0x2f')]),_0x20c88c);if(_0x28edf6[_0x944b('0x2d')]['filter']){_0x47fd95[_0x944b('0x38')]=_[_0x944b('0x3a')](_0x47fd95['where'],{'$or':_[_0x944b('0x28')](_0x20c88c,function(_0x1bae07){if(_0x1bae07[_0x944b('0x2b')]!==_0x944b('0x3b')){var _0x4f7aad={};_0x4f7aad[_0x1bae07[_0x944b('0x2c')]]={'$like':'%'+_0x28edf6['query'][_0x944b('0x3c')]+'%'};return _0x4f7aad;}})});}_0x47fd95=_[_0x944b('0x3a')]({},_0x47fd95,_0x28edf6['options']);var _0x3ed88d={'where':_0x47fd95[_0x944b('0x38')]};return db[_0x944b('0x29')][_0x944b('0x1f')](_0x3ed88d)[_0x944b('0x23')](function(_0x1da8eb){_0x394704[_0x944b('0x1f')]=_0x1da8eb;if(_0x28edf6[_0x944b('0x2d')]['includeAll']){_0x47fd95['include']=[{'all':!![]}];}return db[_0x944b('0x29')][_0x944b('0x3d')](_0x47fd95);})[_0x944b('0x23')](function(_0x1c3a41){_0x394704['rows']=_0x1c3a41;return _0x394704;})[_0x944b('0x23')](respondWithFilteredResult(_0x2c84e1,_0x47fd95))['catch'](handleError(_0x2c84e1,null));};exports[_0x944b('0x3e')]=function(_0x47efb7,_0x3c05e4){var _0x106809={'raw':!![],'where':{'id':_0x47efb7[_0x944b('0x3f')]['id']}},_0xb19467={};_0xb19467[_0x944b('0x31')]=_[_0x944b('0x2e')](db[_0x944b('0x29')][_0x944b('0x2a')]);_0xb19467[_0x944b('0x2d')]=_[_0x944b('0x2e')](_0x47efb7[_0x944b('0x2d')]);_0xb19467[_0x944b('0x2f')]=_[_0x944b('0x30')](_0xb19467[_0x944b('0x31')],_0xb19467[_0x944b('0x2d')]);_0x106809['attributes']=_[_0x944b('0x30')](_0xb19467[_0x944b('0x31')],qs[_0x944b('0x33')](_0x47efb7[_0x944b('0x2d')]['fields']));_0x106809[_0x944b('0x32')]=_0x106809[_0x944b('0x32')][_0x944b('0x34')]?_0x106809[_0x944b('0x32')]:_0xb19467['model'];if(_0x47efb7[_0x944b('0x2d')][_0x944b('0x40')]){_0x106809[_0x944b('0x41')]=[{'all':!![]}];}_0x106809=_['merge']({},_0x106809,_0x47efb7[_0x944b('0x42')]);return db[_0x944b('0x29')][_0x944b('0x43')](_0x106809)[_0x944b('0x23')](handleEntityNotFound(_0x3c05e4,null))[_0x944b('0x23')](respondWithResult(_0x3c05e4,null))[_0x944b('0x44')](handleError(_0x3c05e4,null));};exports[_0x944b('0x45')]=function(_0x5a64d7,_0x19c134){return db['Dynamics365Field'][_0x944b('0x45')](_0x5a64d7[_0x944b('0x46')],{})['then'](respondWithResult(_0x19c134,0xc9))[_0x944b('0x44')](handleError(_0x19c134,null));};exports[_0x944b('0x22')]=function(_0x2fbf83,_0x4867f1){if(_0x2fbf83[_0x944b('0x46')]['id']){delete _0x2fbf83[_0x944b('0x46')]['id'];}return db[_0x944b('0x29')]['find']({'where':{'id':_0x2fbf83[_0x944b('0x3f')]['id']}})[_0x944b('0x23')](handleEntityNotFound(_0x4867f1,null))[_0x944b('0x23')](saveUpdates(_0x2fbf83[_0x944b('0x46')],null))[_0x944b('0x23')](respondWithResult(_0x4867f1,null))[_0x944b('0x44')](handleError(_0x4867f1,null));};exports[_0x944b('0x47')]=function(_0xbf3b5a,_0x2c4ec6){return db[_0x944b('0x29')]['find']({'where':{'id':_0xbf3b5a[_0x944b('0x3f')]['id']}})[_0x944b('0x23')](handleEntityNotFound(_0x2c4ec6,null))[_0x944b('0x23')](removeEntity(_0x2c4ec6,null))[_0x944b('0x44')](handleError(_0x2c4ec6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 428f485..c84984f 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 _0x24e8=['dynamics365_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','path','rimraf','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields'];(function(_0x194fa1,_0x598e89){var _0x150e41=function(_0x93aa0c){while(--_0x93aa0c){_0x194fa1['push'](_0x194fa1['shift']());}};_0x150e41(++_0x598e89);}(_0x24e8,0xb6));var _0x824e=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x24e8[_0x4702ee];return _0x62ca7d;};'use strict';var _=require(_0x824e('0x0'));var util=require('util');var logger=require(_0x824e('0x1'))('api');var moment=require(_0x824e('0x2'));var BPromise=require(_0x824e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x824e('0x4'));var rimraf=require(_0x824e('0x5'));var config=require('../../config/environment');var attributes=require(_0x824e('0x6'));module[_0x824e('0x7')]=function(_0x31ea7e,_0x4b854a){return _0x31ea7e['define'](_0x824e('0x8'),attributes,{'tableName':_0x824e('0x9'),'paranoid':![],'indexes':[{'name':_0x824e('0xa'),'fields':['idField',_0x824e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5039=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x53cc96,_0x11194f){var _0x27e510=function(_0x1c17b5){while(--_0x1c17b5){_0x53cc96['push'](_0x53cc96['shift']());}};_0x27e510(++_0x11194f);}(_0x5039,0x181));var _0x9503=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x5039[_0x43776a];return _0x18eb8f;};'use strict';var _=require(_0x9503('0x0'));var util=require(_0x9503('0x1'));var logger=require(_0x9503('0x2'))(_0x9503('0x3'));var moment=require(_0x9503('0x4'));var BPromise=require(_0x9503('0x5'));var rp=require(_0x9503('0x6'));var fs=require('fs');var path=require(_0x9503('0x7'));var rimraf=require(_0x9503('0x8'));var config=require(_0x9503('0x9'));var attributes=require(_0x9503('0xa'));module[_0x9503('0xb')]=function(_0x5e9c50,_0x402438){return _0x5e9c50[_0x9503('0xc')](_0x9503('0xd'),attributes,{'tableName':_0x9503('0xe'),'paranoid':![],'indexes':[{'name':_0x9503('0xf'),'fields':[_0x9503('0x10'),_0x9503('0x11')],'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 2411671..efec1b2 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 _0x6275=['request','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x13eec2,_0xe78b42){var _0x46c367=function(_0x3f399a){while(--_0x3f399a){_0x13eec2['push'](_0x13eec2['shift']());}};_0x46c367(++_0xe78b42);}(_0x6275,0x125));var _0x5627=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6275[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x5627('0x0'));var util=require('util');var moment=require(_0x5627('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5627('0x2'));var logger=require('../../config/logger')(_0x5627('0x3'));var config=require(_0x5627('0x4'));var jayson=require(_0x5627('0x5'));var client=jayson['client'][_0x5627('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xeeb59e,_0x20b32f,_0x508067){return new BPromise(function(_0x5f3e2c,_0x5f2115){return client[_0x5627('0x7')](_0xeeb59e,_0x508067)[_0x5627('0x8')](function(_0x16e208){logger[_0x5627('0x9')]('Dynamics365Field,\x20%s,\x20%s',_0x20b32f,'request\x20sent');logger[_0x5627('0xa')](_0x5627('0xb'),_0x20b32f,'request\x20sent',JSON[_0x5627('0xc')](_0x16e208));if(_0x16e208['error']){if(_0x16e208[_0x5627('0xd')][_0x5627('0xe')]===0x1f4){logger['error'](_0x5627('0xf'),_0x20b32f,_0x16e208['error'][_0x5627('0x10')]);return _0x5f2115(_0x16e208[_0x5627('0xd')][_0x5627('0x10')]);}logger[_0x5627('0xd')](_0x5627('0xf'),_0x20b32f,_0x16e208[_0x5627('0xd')][_0x5627('0x10')]);return _0x5f3e2c(_0x16e208[_0x5627('0xd')][_0x5627('0x10')]);}else{logger[_0x5627('0x9')](_0x5627('0xf'),_0x20b32f,_0x5627('0x11'));_0x5f3e2c(_0x16e208[_0x5627('0x12')][_0x5627('0x10')]);}})[_0x5627('0x13')](function(_0x4ca9d5){logger['error'](_0x5627('0xf'),_0x20b32f,_0x4ca9d5);_0x5f2115(_0x4ca9d5);});});} \ No newline at end of file +var _0xb359=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x582218,_0x387f43){var _0x41597=function(_0x6aabef){while(--_0x6aabef){_0x582218['push'](_0x582218['shift']());}};_0x41597(++_0x387f43);}(_0xb359,0xa8));var _0x9b35=function(_0x163c25,_0x1952a6){_0x163c25=_0x163c25-0x0;var _0x2cf45f=_0xb359[_0x163c25];return _0x2cf45f;};'use strict';var _=require('lodash');var util=require(_0x9b35('0x0'));var moment=require(_0x9b35('0x1'));var BPromise=require(_0x9b35('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b35('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b35('0x4'))(_0x9b35('0x5'));var config=require(_0x9b35('0x6'));var jayson=require(_0x9b35('0x7'));var client=jayson[_0x9b35('0x8')][_0x9b35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4562a2,_0x46e6fa,_0x3fda63){return new BPromise(function(_0x100544,_0x18e575){return client[_0x9b35('0xa')](_0x4562a2,_0x3fda63)[_0x9b35('0xb')](function(_0x334ae4){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x46e6fa,'request\x20sent');logger['debug'](_0x9b35('0xc'),_0x46e6fa,'request\x20sent',JSON[_0x9b35('0xd')](_0x334ae4));if(_0x334ae4[_0x9b35('0xe')]){if(_0x334ae4[_0x9b35('0xe')]['code']===0x1f4){logger[_0x9b35('0xe')](_0x9b35('0xf'),_0x46e6fa,_0x334ae4[_0x9b35('0xe')][_0x9b35('0x10')]);return _0x18e575(_0x334ae4[_0x9b35('0xe')]['message']);}logger[_0x9b35('0xe')](_0x9b35('0xf'),_0x46e6fa,_0x334ae4[_0x9b35('0xe')][_0x9b35('0x10')]);return _0x100544(_0x334ae4[_0x9b35('0xe')][_0x9b35('0x10')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x46e6fa,_0x9b35('0x11'));_0x100544(_0x334ae4[_0x9b35('0x12')][_0x9b35('0x10')]);}})[_0x9b35('0x13')](function(_0x37a0a1){logger[_0x9b35('0xe')](_0x9b35('0xf'),_0x46e6fa,_0x37a0a1);_0x18e575(_0x37a0a1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 4c62961..e03820a 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 _0xbbd7=['post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getFields'];(function(_0x2a7812,_0x1ce83a){var _0x3e1342=function(_0x3ff9fb){while(--_0x3ff9fb){_0x2a7812['push'](_0x2a7812['shift']());}};_0x3e1342(++_0x1ce83a);}(_0xbbd7,0x8b));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7bbd('0x0'));var util=require(_0x7bbd('0x1'));var path=require(_0x7bbd('0x2'));var timeout=require(_0x7bbd('0x3'));var express=require(_0x7bbd('0x4'));var router=express['Router']();var fs_extra=require(_0x7bbd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7bbd('0x6'));var controller=require(_0x7bbd('0x7'));router[_0x7bbd('0x8')]('/',auth['isAuthenticated'](),controller[_0x7bbd('0x9')]);router[_0x7bbd('0x8')](_0x7bbd('0xa'),auth[_0x7bbd('0xb')](),controller[_0x7bbd('0xc')]);router['get'](_0x7bbd('0xd'),auth[_0x7bbd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x7bbd('0xb')](),controller[_0x7bbd('0xe')]);router[_0x7bbd('0xf')]('/',auth['isAuthenticated'](),controller[_0x7bbd('0x10')]);router[_0x7bbd('0xf')]('/:id/configurations',auth[_0x7bbd('0xb')](),controller[_0x7bbd('0x11')]);router[_0x7bbd('0x12')]('/:id',auth[_0x7bbd('0xb')](),controller[_0x7bbd('0x13')]);router[_0x7bbd('0x14')]('/:id',auth[_0x7bbd('0xb')](),controller[_0x7bbd('0x15')]);module['exports']=router; \ No newline at end of file +var _0x79c5=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','put','update','delete','destroy'];(function(_0x339f67,_0x3eef63){var _0x9d6b2=function(_0x260f5c){while(--_0x260f5c){_0x339f67['push'](_0x339f67['shift']());}};_0x9d6b2(++_0x3eef63);}(_0x79c5,0x155));var _0x579c=function(_0x27889f,_0x4809b9){_0x27889f=_0x27889f-0x0;var _0x201713=_0x79c5[_0x27889f];return _0x201713;};'use strict';var multer=require(_0x579c('0x0'));var util=require(_0x579c('0x1'));var path=require(_0x579c('0x2'));var timeout=require(_0x579c('0x3'));var express=require(_0x579c('0x4'));var router=express[_0x579c('0x5')]();var fs_extra=require(_0x579c('0x6'));var auth=require(_0x579c('0x7'));var interaction=require(_0x579c('0x8'));var config=require(_0x579c('0x9'));var controller=require(_0x579c('0xa'));router[_0x579c('0xb')]('/',auth[_0x579c('0xc')](),controller['index']);router['get'](_0x579c('0xd'),auth[_0x579c('0xc')](),controller['show']);router['get'](_0x579c('0xe'),auth[_0x579c('0xc')](),controller['getConfigurations']);router[_0x579c('0xb')]('/:id/fields',auth[_0x579c('0xc')](),controller['getFields']);router['post']('/',auth[_0x579c('0xc')](),controller['create']);router['post'](_0x579c('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x579c('0xf')](_0x579c('0xd'),auth['isAuthenticated'](),controller[_0x579c('0x10')]);router[_0x579c('0x11')](_0x579c('0xd'),auth[_0x579c('0xc')](),controller[_0x579c('0x12')]);module[_0x579c('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 dad1c01..cf593a8 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 _0xffd6=['exports','STRING','username','sequelize'];(function(_0x2c0c49,_0x1e034c){var _0x48f9f2=function(_0x12d603){while(--_0x12d603){_0x2c0c49['push'](_0x2c0c49['shift']());}};_0x48f9f2(++_0x1e034c);}(_0xffd6,0x97));var _0x6ffd=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xffd6[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x312b06,_0x5ad05e){var _0x54dd60=function(_0x837599){while(--_0x837599){_0x312b06['push'](_0x312b06['shift']());}};_0x54dd60(++_0x5ad05e);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5c1dd7,_0x4b8b8c){_0x5c1dd7=_0x5c1dd7-0x0;var _0x60ca25=_0xaebd[_0x5c1dd7];return _0x60ca25;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 55fac98..1ff7ea1 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 _0xd0d5=['options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','base64','subject','agent','description','group','ticket_type','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','getConfigurations','findOne','FreshdeskConfiguration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd0d5,0x1ed));var _0x5d0d=function(_0x346d09,_0x2d4178){_0x346d09=_0x346d09-0x0;var _0x44c4e7=_0xd0d5[_0x346d09];return _0x44c4e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5d0d('0x0'));var BPromise=require(_0x5d0d('0x1'));var Mustache=require(_0x5d0d('0x2'));var util=require('util');var path=require('path');var sox=require(_0x5d0d('0x3'));var csv=require(_0x5d0d('0x4'));var ejs=require(_0x5d0d('0x5'));var fs=require('fs');var fs_extra=require(_0x5d0d('0x6'));var _=require('lodash');var squel=require(_0x5d0d('0x7'));var crypto=require(_0x5d0d('0x8'));var jsforce=require(_0x5d0d('0x9'));var deskjs=require(_0x5d0d('0xa'));var toCsv=require(_0x5d0d('0x4'));var querystring=require('querystring');var Papa=require(_0x5d0d('0xb'));var Redis=require('ioredis');var authService=require(_0x5d0d('0xc'));var qs=require(_0x5d0d('0xd'));var as=require(_0x5d0d('0xe'));var hardwareService=require(_0x5d0d('0xf'));var logger=require(_0x5d0d('0x10'))(_0x5d0d('0x11'));var utils=require(_0x5d0d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5d0d('0x13'));var db=require(_0x5d0d('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x581f0c,_0x222443){_0x222443=_0x222443||0xcc;return function(_0x25b895){if(_0x25b895){return _0x581f0c[_0x5d0d('0x15')](_0x222443);}return _0x581f0c[_0x5d0d('0x16')](_0x222443)[_0x5d0d('0x17')]();};}function respondWithResult(_0x2b9e0d,_0x352f7e){_0x352f7e=_0x352f7e||0xc8;return function(_0x36e7a2){if(_0x36e7a2){return _0x2b9e0d[_0x5d0d('0x16')](_0x352f7e)[_0x5d0d('0x18')](_0x36e7a2);}};}function respondWithFilteredResult(_0x28bbf7,_0x1cc7a0){return function(_0x23a69f){if(_0x23a69f){var _0x3dd721=typeof _0x1cc7a0['offset']===_0x5d0d('0x19')&&typeof _0x1cc7a0[_0x5d0d('0x1a')]==='undefined';var _0x1a5fd3=_0x23a69f[_0x5d0d('0x1b')];var _0x286dcb=_0x3dd721?0x0:_0x1cc7a0[_0x5d0d('0x1c')];var _0x161a8e=_0x3dd721?_0x23a69f[_0x5d0d('0x1b')]:_0x1cc7a0[_0x5d0d('0x1c')]+_0x1cc7a0[_0x5d0d('0x1a')];var _0x2a9652;if(_0x161a8e>=_0x1a5fd3){_0x161a8e=_0x1a5fd3;_0x2a9652=0xc8;}else{_0x2a9652=0xce;}_0x28bbf7['status'](_0x2a9652);return _0x28bbf7[_0x5d0d('0x1d')](_0x5d0d('0x1e'),_0x286dcb+'-'+_0x161a8e+'/'+_0x1a5fd3)[_0x5d0d('0x18')](_0x23a69f);}return null;};}function patchUpdates(_0x47bdf9){return function(_0x41ef82){try{jsonpatch[_0x5d0d('0x1f')](_0x41ef82,_0x47bdf9,!![]);}catch(_0x195588){return BPromise[_0x5d0d('0x20')](_0x195588);}return _0x41ef82['save']();};}function saveUpdates(_0x5a8e73,_0x86b7d3){return function(_0x9b6d){if(_0x9b6d){return _0x9b6d['update'](_0x5a8e73)[_0x5d0d('0x21')](function(_0x213e2f){return _0x213e2f;});}return null;};}function removeEntity(_0x7bb4c4,_0xea36ca){return function(_0x1d6c1d){if(_0x1d6c1d){return _0x1d6c1d[_0x5d0d('0x22')]()[_0x5d0d('0x21')](function(){_0x7bb4c4[_0x5d0d('0x16')](0xcc)[_0x5d0d('0x17')]();});}};}function handleEntityNotFound(_0x5008de,_0x3df4f0){return function(_0x25391e){if(!_0x25391e){_0x5008de[_0x5d0d('0x15')](0x194);}return _0x25391e;};}function handleError(_0x4394a5,_0x3ca0a9){_0x3ca0a9=_0x3ca0a9||0x1f4;return function(_0x28ee1a){logger[_0x5d0d('0x23')](_0x28ee1a[_0x5d0d('0x24')]);if(_0x28ee1a[_0x5d0d('0x25')]){delete _0x28ee1a[_0x5d0d('0x25')];}_0x4394a5[_0x5d0d('0x16')](_0x3ca0a9)[_0x5d0d('0x26')](_0x28ee1a);};}exports[_0x5d0d('0x27')]=function(_0x54dba0,_0x4ff56a){var _0x53eff4={},_0x2073c8={},_0x1d7b74={'count':0x0,'rows':[]};var _0x3bb2bf=_['map'](db[_0x5d0d('0x28')][_0x5d0d('0x29')],function(_0x421a6c){return{'name':_0x421a6c[_0x5d0d('0x2a')],'type':_0x421a6c[_0x5d0d('0x2b')][_0x5d0d('0x2c')]};});_0x2073c8[_0x5d0d('0x2d')]=_[_0x5d0d('0x2e')](_0x3bb2bf,'name');_0x2073c8[_0x5d0d('0x2f')]=_[_0x5d0d('0x30')](_0x54dba0[_0x5d0d('0x2f')]);_0x2073c8['filters']=_[_0x5d0d('0x31')](_0x2073c8[_0x5d0d('0x2d')],_0x2073c8[_0x5d0d('0x2f')]);_0x53eff4[_0x5d0d('0x32')]=_[_0x5d0d('0x31')](_0x2073c8['model'],qs[_0x5d0d('0x33')](_0x54dba0[_0x5d0d('0x2f')][_0x5d0d('0x33')]));_0x53eff4[_0x5d0d('0x32')]=_0x53eff4[_0x5d0d('0x32')][_0x5d0d('0x34')]?_0x53eff4[_0x5d0d('0x32')]:_0x2073c8[_0x5d0d('0x2d')];if(!_0x54dba0[_0x5d0d('0x2f')][_0x5d0d('0x35')](_0x5d0d('0x36'))){_0x53eff4[_0x5d0d('0x1a')]=qs[_0x5d0d('0x1a')](_0x54dba0[_0x5d0d('0x2f')][_0x5d0d('0x1a')]);_0x53eff4[_0x5d0d('0x1c')]=qs['offset'](_0x54dba0[_0x5d0d('0x2f')][_0x5d0d('0x1c')]);}_0x53eff4[_0x5d0d('0x37')]=qs[_0x5d0d('0x38')](_0x54dba0[_0x5d0d('0x2f')][_0x5d0d('0x38')]);_0x53eff4[_0x5d0d('0x39')]=qs[_0x5d0d('0x3a')](_[_0x5d0d('0x3b')](_0x54dba0[_0x5d0d('0x2f')],_0x2073c8[_0x5d0d('0x3a')]),_0x3bb2bf);if(_0x54dba0[_0x5d0d('0x2f')][_0x5d0d('0x3c')]){_0x53eff4['where']=_[_0x5d0d('0x3d')](_0x53eff4['where'],{'$or':_[_0x5d0d('0x2e')](_0x3bb2bf,function(_0x4e794e){if(_0x4e794e['type']!==_0x5d0d('0x3e')){var _0xa8252b={};_0xa8252b[_0x4e794e['name']]={'$like':'%'+_0x54dba0[_0x5d0d('0x2f')][_0x5d0d('0x3c')]+'%'};return _0xa8252b;}})});}_0x53eff4=_[_0x5d0d('0x3d')]({},_0x53eff4,_0x54dba0['options']);var _0x7185ff={'where':_0x53eff4[_0x5d0d('0x39')]};return db['FreshdeskAccount']['count'](_0x7185ff)[_0x5d0d('0x21')](function(_0x5b1fe8){_0x1d7b74[_0x5d0d('0x1b')]=_0x5b1fe8;if(_0x54dba0['query'][_0x5d0d('0x3f')]){_0x53eff4[_0x5d0d('0x40')]=[{'all':!![]}];}return db[_0x5d0d('0x28')][_0x5d0d('0x41')](_0x53eff4);})[_0x5d0d('0x21')](function(_0x107353){_0x1d7b74[_0x5d0d('0x42')]=_0x107353;return _0x1d7b74;})[_0x5d0d('0x21')](respondWithFilteredResult(_0x4ff56a,_0x53eff4))['catch'](handleError(_0x4ff56a,null));};exports[_0x5d0d('0x43')]=function(_0x3b9bf6,_0xed3cd0){var _0x24f363={'raw':![],'where':{'id':_0x3b9bf6[_0x5d0d('0x44')]['id']}},_0x300e79={};_0x300e79[_0x5d0d('0x2d')]=_[_0x5d0d('0x30')](db[_0x5d0d('0x28')][_0x5d0d('0x29')]);_0x300e79['query']=_[_0x5d0d('0x30')](_0x3b9bf6['query']);_0x300e79['filters']=_['intersection'](_0x300e79[_0x5d0d('0x2d')],_0x300e79[_0x5d0d('0x2f')]);_0x24f363[_0x5d0d('0x32')]=_['intersection'](_0x300e79[_0x5d0d('0x2d')],qs[_0x5d0d('0x33')](_0x3b9bf6[_0x5d0d('0x2f')][_0x5d0d('0x33')]));_0x24f363[_0x5d0d('0x32')]=_0x24f363[_0x5d0d('0x32')][_0x5d0d('0x34')]?_0x24f363[_0x5d0d('0x32')]:_0x300e79[_0x5d0d('0x2d')];if(_0x3b9bf6[_0x5d0d('0x2f')][_0x5d0d('0x3f')]){_0x24f363['include']=[{'all':!![]}];}_0x24f363=_[_0x5d0d('0x3d')]({},_0x24f363,_0x3b9bf6['options']);return db['FreshdeskAccount'][_0x5d0d('0x45')](_0x24f363)[_0x5d0d('0x21')](handleEntityNotFound(_0xed3cd0,null))[_0x5d0d('0x21')](respondWithResult(_0xed3cd0,null))[_0x5d0d('0x46')](handleError(_0xed3cd0,null));};exports['create']=function(_0x207087,_0x3cd96c){return db[_0x5d0d('0x28')][_0x5d0d('0x47')](_0x207087[_0x5d0d('0x48')],{})['then'](respondWithResult(_0x3cd96c,0xc9))[_0x5d0d('0x46')](handleError(_0x3cd96c,null));};exports[_0x5d0d('0x49')]=function(_0x1442ac,_0xa19bbf){if(_0x1442ac[_0x5d0d('0x48')]['id']){delete _0x1442ac[_0x5d0d('0x48')]['id'];}return db['FreshdeskAccount'][_0x5d0d('0x45')]({'where':{'id':_0x1442ac['params']['id']}})['then'](handleEntityNotFound(_0xa19bbf,null))[_0x5d0d('0x21')](saveUpdates(_0x1442ac[_0x5d0d('0x48')],null))['then'](respondWithResult(_0xa19bbf,null))[_0x5d0d('0x46')](handleError(_0xa19bbf,null));};exports[_0x5d0d('0x22')]=function(_0x5a0efb,_0x3dcf5a){return db['FreshdeskAccount'][_0x5d0d('0x45')]({'where':{'id':_0x5a0efb['params']['id']}})[_0x5d0d('0x21')](handleEntityNotFound(_0x3dcf5a,null))['then'](removeEntity(_0x3dcf5a,null))['catch'](handleError(_0x3dcf5a,null));};exports[_0x5d0d('0x4a')]=function(_0x1575ec,_0x5c3240,_0x168c2e){var _0x3e0e6c={};var _0x22945c={};var _0x4da612;var _0x44bf4f;return db['FreshdeskAccount'][_0x5d0d('0x4b')]({'where':{'id':_0x1575ec[_0x5d0d('0x44')]['id']}})[_0x5d0d('0x21')](handleEntityNotFound(_0x5c3240,null))[_0x5d0d('0x21')](function(_0x387dd8){if(_0x387dd8){_0x4da612=_0x387dd8;_0x22945c['model']=_[_0x5d0d('0x30')](db[_0x5d0d('0x4c')][_0x5d0d('0x29')]);_0x22945c[_0x5d0d('0x2f')]=_[_0x5d0d('0x30')](_0x1575ec[_0x5d0d('0x2f')]);_0x22945c[_0x5d0d('0x3a')]=_['intersection'](_0x22945c[_0x5d0d('0x2d')],_0x22945c[_0x5d0d('0x2f')]);_0x3e0e6c[_0x5d0d('0x32')]=_['intersection'](_0x22945c[_0x5d0d('0x2d')],qs['fields'](_0x1575ec[_0x5d0d('0x2f')][_0x5d0d('0x33')]));_0x3e0e6c[_0x5d0d('0x32')]=_0x3e0e6c[_0x5d0d('0x32')][_0x5d0d('0x34')]?_0x3e0e6c[_0x5d0d('0x32')]:_0x22945c[_0x5d0d('0x2d')];_0x3e0e6c[_0x5d0d('0x37')]=qs['sort'](_0x1575ec[_0x5d0d('0x2f')]['sort']);_0x3e0e6c[_0x5d0d('0x39')]=qs[_0x5d0d('0x3a')](_[_0x5d0d('0x3b')](_0x1575ec[_0x5d0d('0x2f')],_0x22945c['filters']));if(_0x1575ec[_0x5d0d('0x2f')][_0x5d0d('0x3c')]){_0x3e0e6c[_0x5d0d('0x39')]=_['merge'](_0x3e0e6c['where'],{'$or':_[_0x5d0d('0x2e')](_0x3e0e6c['attributes'],function(_0x16dbae){var _0x126702={};_0x126702[_0x16dbae]={'$like':'%'+_0x1575ec[_0x5d0d('0x2f')][_0x5d0d('0x3c')]+'%'};return _0x126702;})});}_0x3e0e6c=_['merge']({},_0x3e0e6c,_0x1575ec[_0x5d0d('0x4d')]);return _0x4da612['getConfigurations'](_0x3e0e6c);}})[_0x5d0d('0x21')](function(_0x3d891b){if(_0x3d891b){_0x44bf4f=_0x3d891b[_0x5d0d('0x34')];if(!_0x1575ec['query']['hasOwnProperty'](_0x5d0d('0x36'))){_0x3e0e6c[_0x5d0d('0x1a')]=qs['limit'](_0x1575ec['query'][_0x5d0d('0x1a')]);_0x3e0e6c['offset']=qs[_0x5d0d('0x1c')](_0x1575ec['query'][_0x5d0d('0x1c')]);}return _0x4da612['getConfigurations'](_0x3e0e6c);}})['then'](function(_0x5185e2){if(_0x5185e2){return _0x5185e2?{'count':_0x44bf4f,'rows':_0x5185e2}:null;}})['then'](respondWithResult(_0x5c3240,null))[_0x5d0d('0x46')](handleError(_0x5c3240,null));};exports[_0x5d0d('0x4e')]=function(_0x26036a,_0x13ab8f,_0x4f83e3){if(_0x26036a[_0x5d0d('0x48')]['id']){delete _0x26036a[_0x5d0d('0x48')]['id'];}return db['FreshdeskAccount'][_0x5d0d('0x4b')]({'where':{'id':_0x26036a[_0x5d0d('0x44')]['id']}})[_0x5d0d('0x21')](handleEntityNotFound(_0x13ab8f,null))[_0x5d0d('0x21')](function(_0x1378c9){if(_0x1378c9){_0x26036a[_0x5d0d('0x48')][_0x5d0d('0x4f')]=_0x1378c9['id'];_0x26036a['body'][_0x5d0d('0x50')]=integrations[_0x5d0d('0x51')](_0x26036a[_0x5d0d('0x48')][_0x5d0d('0x52')],_0x26036a[_0x5d0d('0x48')][_0x5d0d('0x2b')]);_0x26036a[_0x5d0d('0x48')][_0x5d0d('0x53')]=integrations[_0x5d0d('0x54')](_0x26036a[_0x5d0d('0x48')][_0x5d0d('0x52')],_0x26036a[_0x5d0d('0x48')]['type']);return db[_0x5d0d('0x4c')][_0x5d0d('0x47')](_0x26036a[_0x5d0d('0x48')],{'include':[{'model':db[_0x5d0d('0x55')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x5d0d('0x53')}]});}return null;})[_0x5d0d('0x21')](respondWithResult(_0x13ab8f,null))[_0x5d0d('0x46')](handleError(_0x13ab8f,null));};exports[_0x5d0d('0x56')]=function(_0x1207e9,_0x369392,_0x3493e2){var _0xe8310b='';return db[_0x5d0d('0x28')][_0x5d0d('0x4b')]({'where':{'id':_0x1207e9[_0x5d0d('0x44')]['id']},'attributes':['id',_0x5d0d('0x57'),_0x5d0d('0x58')]})[_0x5d0d('0x21')](handleEntityNotFound(_0x369392,null))[_0x5d0d('0x21')](function(_0x57c345){if(_0x57c345){_0xe8310b=_0x57c345['remoteUri'];var _0x310a5d=_0xe8310b[_0x5d0d('0x59')](-0x1);if(_0x310a5d==='/'){_0xe8310b=_0xe8310b[_0x5d0d('0x5a')](0x0,_0xe8310b[_0x5d0d('0x5b')](_0x310a5d));}return rp({'method':'GET','uri':util['format'](_0x5d0d('0x5c'),_0xe8310b,_0x5d0d('0x5d')),'headers':{'Authorization':util[_0x5d0d('0x5e')](_0x5d0d('0x5f'),new Buffer(util[_0x5d0d('0x5e')](_0x5d0d('0x60'),_0x57c345[_0x5d0d('0x58')]))['toString'](_0x5d0d('0x61')))},'json':!![]});}})[_0x5d0d('0x21')](function(_0x2d9337){if(_0x2d9337){var _0x19022c=['requester',_0x5d0d('0x62'),_0x5d0d('0x63'),_0x5d0d('0x64'),_0x5d0d('0x16'),'priority',_0x5d0d('0x65'),'source',_0x5d0d('0x66'),_0x5d0d('0x65'),'company'];_['remove'](_0x2d9337,function(_0x5ac2dc){return _0x19022c[_0x5d0d('0x67')](_0x5ac2dc['name'])||!_0x5ac2dc[_0x5d0d('0x68')]&&_0x5ac2dc[_0x5d0d('0x2b')]!==_0x5d0d('0x69')&&_0x5ac2dc[_0x5d0d('0x2b')]!==_0x5d0d('0x6a');});return{'count':_0x2d9337[_0x5d0d('0x34')],'rows':_['map'](_0x2d9337,function(_0x8a76dd){return{'id':_0x8a76dd[_0x5d0d('0x25')],'name':_0x8a76dd[_0x5d0d('0x6b')],'custom':!_0x8a76dd['default'],'options':_0x8a76dd['choices']?_[_0x5d0d('0x2e')](_0x8a76dd[_0x5d0d('0x6c')],function(_0x527a59){return{'name':_['capitalize'](_0x527a59),'value':_0x527a59};}):[]};})};}})['then'](respondWithResult(_0x369392,null))['catch'](function(_0x313bd1){var _0x25a837=_0x1207e9[_0x5d0d('0x2f')][_0x5d0d('0x6d')]?0x1f4:_0x313bd1[_0x5d0d('0x6e')]||0x1f4;logger['error'](_0x5d0d('0x6f'),_0x5d0d('0x56'),_0x25a837,JSON[_0x5d0d('0x70')](_0x313bd1));delete _0x313bd1[_0x5d0d('0x25')];if(_0x25a837===0x191){_0x25a837=0x190;}_0x369392['status'](_0x25a837)[_0x5d0d('0x26')](_0x1207e9[_0x5d0d('0x2f')]['test']?{'message':_0x5d0d('0x71'),'statusCode':_0x313bd1[_0x5d0d('0x6e')]}:_0x313bd1);});}; \ No newline at end of file +var _0x4e5c=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','then','error','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','FreshdeskAccount','rows','catch','show','params','include','create','body','update','destroy','find','findOne','FreshdeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','toString','base64','subject','agent','priority','group','ticket_type','company','remove','default','custom_text','choices','test','statusCode','getFields','stringify','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv'];(function(_0x57c67f,_0x5c491e){var _0x4b46d2=function(_0x5430b5){while(--_0x5430b5){_0x57c67f['push'](_0x57c67f['shift']());}};_0x4b46d2(++_0x5c491e);}(_0x4e5c,0x149));var _0xc4e5=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4e5c[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0xc4e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e5('0x2'));var moment=require(_0xc4e5('0x3'));var BPromise=require(_0xc4e5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc4e5('0x5'));var csv=require(_0xc4e5('0x6'));var ejs=require(_0xc4e5('0x7'));var fs=require('fs');var fs_extra=require(_0xc4e5('0x8'));var _=require(_0xc4e5('0x9'));var squel=require(_0xc4e5('0xa'));var crypto=require(_0xc4e5('0xb'));var jsforce=require(_0xc4e5('0xc'));var deskjs=require(_0xc4e5('0xd'));var toCsv=require(_0xc4e5('0x6'));var querystring=require(_0xc4e5('0xe'));var Papa=require(_0xc4e5('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e5('0x10'));var qs=require(_0xc4e5('0x11'));var as=require(_0xc4e5('0x12'));var hardwareService=require(_0xc4e5('0x13'));var logger=require('../../config/logger')(_0xc4e5('0x14'));var utils=require(_0xc4e5('0x15'));var config=require(_0xc4e5('0x16'));var licenseUtil=require(_0xc4e5('0x17'));var db=require(_0xc4e5('0x18'))['db'];var integrations=require(_0xc4e5('0x19'));function respondWithStatusCode(_0x3fa318,_0x54c5a7){_0x54c5a7=_0x54c5a7||0xcc;return function(_0x5f00d8){if(_0x5f00d8){return _0x3fa318[_0xc4e5('0x1a')](_0x54c5a7);}return _0x3fa318['status'](_0x54c5a7)[_0xc4e5('0x1b')]();};}function respondWithResult(_0x7cd002,_0x303037){_0x303037=_0x303037||0xc8;return function(_0x2404a7){if(_0x2404a7){return _0x7cd002['status'](_0x303037)[_0xc4e5('0x1c')](_0x2404a7);}};}function respondWithFilteredResult(_0x528de4,_0x338c37){return function(_0x3beb59){if(_0x3beb59){var _0x2937d9=typeof _0x338c37[_0xc4e5('0x1d')]===_0xc4e5('0x1e')&&typeof _0x338c37[_0xc4e5('0x1f')]===_0xc4e5('0x1e');var _0x1156ce=_0x3beb59[_0xc4e5('0x20')];var _0x57042c=_0x2937d9?0x0:_0x338c37[_0xc4e5('0x1d')];var _0x154486=_0x2937d9?_0x3beb59['count']:_0x338c37[_0xc4e5('0x1d')]+_0x338c37[_0xc4e5('0x1f')];var _0x5003e5;if(_0x154486>=_0x1156ce){_0x154486=_0x1156ce;_0x5003e5=0xc8;}else{_0x5003e5=0xce;}_0x528de4[_0xc4e5('0x21')](_0x5003e5);return _0x528de4['set']('Content-Range',_0x57042c+'-'+_0x154486+'/'+_0x1156ce)[_0xc4e5('0x1c')](_0x3beb59);}return null;};}function patchUpdates(_0x7dbe6d){return function(_0x4933b7){try{jsonpatch[_0xc4e5('0x22')](_0x4933b7,_0x7dbe6d,!![]);}catch(_0x5be68b){return BPromise[_0xc4e5('0x23')](_0x5be68b);}return _0x4933b7[_0xc4e5('0x24')]();};}function saveUpdates(_0x505078,_0x546949){return function(_0x45abe3){if(_0x45abe3){return _0x45abe3['update'](_0x505078)[_0xc4e5('0x25')](function(_0x41467f){return _0x41467f;});}return null;};}function removeEntity(_0x4bb973,_0x4ed1ff){return function(_0x44299a){if(_0x44299a){return _0x44299a['destroy']()[_0xc4e5('0x25')](function(){_0x4bb973['status'](0xcc)[_0xc4e5('0x1b')]();});}};}function handleEntityNotFound(_0x234b31,_0x53f7cd){return function(_0x5f48fc){if(!_0x5f48fc){_0x234b31['sendStatus'](0x194);}return _0x5f48fc;};}function handleError(_0x23889c,_0x183ec7){_0x183ec7=_0x183ec7||0x1f4;return function(_0x143e66){logger[_0xc4e5('0x26')](_0x143e66[_0xc4e5('0x27')]);if(_0x143e66[_0xc4e5('0x28')]){delete _0x143e66[_0xc4e5('0x28')];}_0x23889c[_0xc4e5('0x21')](_0x183ec7)['send'](_0x143e66);};}exports[_0xc4e5('0x29')]=function(_0x2ad4be,_0x261b88){var _0x23383b={},_0x94dcd0={},_0x4805b2={'count':0x0,'rows':[]};var _0x205f41=_[_0xc4e5('0x2a')](db['FreshdeskAccount'][_0xc4e5('0x2b')],function(_0x598212){return{'name':_0x598212[_0xc4e5('0x2c')],'type':_0x598212['type'][_0xc4e5('0x2d')]};});_0x94dcd0['model']=_[_0xc4e5('0x2a')](_0x205f41,'name');_0x94dcd0['query']=_[_0xc4e5('0x2e')](_0x2ad4be[_0xc4e5('0x2f')]);_0x94dcd0[_0xc4e5('0x30')]=_[_0xc4e5('0x31')](_0x94dcd0['model'],_0x94dcd0[_0xc4e5('0x2f')]);_0x23383b[_0xc4e5('0x32')]=_[_0xc4e5('0x31')](_0x94dcd0[_0xc4e5('0x33')],qs['fields'](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x34')]));_0x23383b[_0xc4e5('0x32')]=_0x23383b[_0xc4e5('0x32')][_0xc4e5('0x35')]?_0x23383b['attributes']:_0x94dcd0[_0xc4e5('0x33')];if(!_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x36')]('nolimit')){_0x23383b[_0xc4e5('0x1f')]=qs[_0xc4e5('0x1f')](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x1f')]);_0x23383b['offset']=qs['offset'](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x1d')]);}_0x23383b[_0xc4e5('0x37')]=qs[_0xc4e5('0x38')](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x38')]);_0x23383b[_0xc4e5('0x39')]=qs[_0xc4e5('0x30')](_[_0xc4e5('0x3a')](_0x2ad4be['query'],_0x94dcd0['filters']),_0x205f41);if(_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x3b')]){_0x23383b[_0xc4e5('0x39')]=_[_0xc4e5('0x3c')](_0x23383b[_0xc4e5('0x39')],{'$or':_['map'](_0x205f41,function(_0x2a77dd){if(_0x2a77dd[_0xc4e5('0x3d')]!==_0xc4e5('0x3e')){var _0x2c754b={};_0x2c754b[_0x2a77dd[_0xc4e5('0x28')]]={'$like':'%'+_0x2ad4be['query'][_0xc4e5('0x3b')]+'%'};return _0x2c754b;}})});}_0x23383b=_[_0xc4e5('0x3c')]({},_0x23383b,_0x2ad4be[_0xc4e5('0x3f')]);var _0x35f940={'where':_0x23383b['where']};return db['FreshdeskAccount']['count'](_0x35f940)[_0xc4e5('0x25')](function(_0x5292a4){_0x4805b2[_0xc4e5('0x20')]=_0x5292a4;if(_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x40')]){_0x23383b['include']=[{'all':!![]}];}return db[_0xc4e5('0x41')]['findAll'](_0x23383b);})[_0xc4e5('0x25')](function(_0x46184f){_0x4805b2[_0xc4e5('0x42')]=_0x46184f;return _0x4805b2;})['then'](respondWithFilteredResult(_0x261b88,_0x23383b))[_0xc4e5('0x43')](handleError(_0x261b88,null));};exports[_0xc4e5('0x44')]=function(_0x1117e1,_0xba5c47){var _0x2ea4a8={'raw':![],'where':{'id':_0x1117e1[_0xc4e5('0x45')]['id']}},_0x409a3f={};_0x409a3f[_0xc4e5('0x33')]=_['keys'](db[_0xc4e5('0x41')][_0xc4e5('0x2b')]);_0x409a3f[_0xc4e5('0x2f')]=_[_0xc4e5('0x2e')](_0x1117e1[_0xc4e5('0x2f')]);_0x409a3f[_0xc4e5('0x30')]=_[_0xc4e5('0x31')](_0x409a3f[_0xc4e5('0x33')],_0x409a3f[_0xc4e5('0x2f')]);_0x2ea4a8[_0xc4e5('0x32')]=_[_0xc4e5('0x31')](_0x409a3f[_0xc4e5('0x33')],qs['fields'](_0x1117e1['query'][_0xc4e5('0x34')]));_0x2ea4a8[_0xc4e5('0x32')]=_0x2ea4a8[_0xc4e5('0x32')][_0xc4e5('0x35')]?_0x2ea4a8['attributes']:_0x409a3f[_0xc4e5('0x33')];if(_0x1117e1['query']['includeAll']){_0x2ea4a8[_0xc4e5('0x46')]=[{'all':!![]}];}_0x2ea4a8=_[_0xc4e5('0x3c')]({},_0x2ea4a8,_0x1117e1['options']);return db[_0xc4e5('0x41')]['find'](_0x2ea4a8)[_0xc4e5('0x25')](handleEntityNotFound(_0xba5c47,null))[_0xc4e5('0x25')](respondWithResult(_0xba5c47,null))[_0xc4e5('0x43')](handleError(_0xba5c47,null));};exports[_0xc4e5('0x47')]=function(_0xd73e5c,_0x347d7c){return db[_0xc4e5('0x41')][_0xc4e5('0x47')](_0xd73e5c[_0xc4e5('0x48')],{})['then'](respondWithResult(_0x347d7c,0xc9))[_0xc4e5('0x43')](handleError(_0x347d7c,null));};exports[_0xc4e5('0x49')]=function(_0x452a5e,_0x14614b){if(_0x452a5e[_0xc4e5('0x48')]['id']){delete _0x452a5e[_0xc4e5('0x48')]['id'];}return db[_0xc4e5('0x41')]['find']({'where':{'id':_0x452a5e[_0xc4e5('0x45')]['id']}})['then'](handleEntityNotFound(_0x14614b,null))[_0xc4e5('0x25')](saveUpdates(_0x452a5e[_0xc4e5('0x48')],null))['then'](respondWithResult(_0x14614b,null))[_0xc4e5('0x43')](handleError(_0x14614b,null));};exports[_0xc4e5('0x4a')]=function(_0x5c536c,_0x51e1d6){return db[_0xc4e5('0x41')][_0xc4e5('0x4b')]({'where':{'id':_0x5c536c[_0xc4e5('0x45')]['id']}})[_0xc4e5('0x25')](handleEntityNotFound(_0x51e1d6,null))['then'](removeEntity(_0x51e1d6,null))[_0xc4e5('0x43')](handleError(_0x51e1d6,null));};exports['getConfigurations']=function(_0x15fb9c,_0x466da5,_0x235d25){var _0x37bed4={};var _0x42c752={};var _0x4a7244;var _0x2c067c;return db[_0xc4e5('0x41')][_0xc4e5('0x4c')]({'where':{'id':_0x15fb9c[_0xc4e5('0x45')]['id']}})[_0xc4e5('0x25')](handleEntityNotFound(_0x466da5,null))[_0xc4e5('0x25')](function(_0x465e27){if(_0x465e27){_0x4a7244=_0x465e27;_0x42c752['model']=_[_0xc4e5('0x2e')](db[_0xc4e5('0x4d')][_0xc4e5('0x2b')]);_0x42c752[_0xc4e5('0x2f')]=_[_0xc4e5('0x2e')](_0x15fb9c[_0xc4e5('0x2f')]);_0x42c752[_0xc4e5('0x30')]=_[_0xc4e5('0x31')](_0x42c752[_0xc4e5('0x33')],_0x42c752[_0xc4e5('0x2f')]);_0x37bed4[_0xc4e5('0x32')]=_['intersection'](_0x42c752['model'],qs[_0xc4e5('0x34')](_0x15fb9c['query']['fields']));_0x37bed4[_0xc4e5('0x32')]=_0x37bed4[_0xc4e5('0x32')][_0xc4e5('0x35')]?_0x37bed4['attributes']:_0x42c752[_0xc4e5('0x33')];_0x37bed4[_0xc4e5('0x37')]=qs[_0xc4e5('0x38')](_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x38')]);_0x37bed4['where']=qs[_0xc4e5('0x30')](_[_0xc4e5('0x3a')](_0x15fb9c[_0xc4e5('0x2f')],_0x42c752[_0xc4e5('0x30')]));if(_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x3b')]){_0x37bed4[_0xc4e5('0x39')]=_[_0xc4e5('0x3c')](_0x37bed4[_0xc4e5('0x39')],{'$or':_[_0xc4e5('0x2a')](_0x37bed4[_0xc4e5('0x32')],function(_0x237c7f){var _0x66c974={};_0x66c974[_0x237c7f]={'$like':'%'+_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x3b')]+'%'};return _0x66c974;})});}_0x37bed4=_[_0xc4e5('0x3c')]({},_0x37bed4,_0x15fb9c[_0xc4e5('0x3f')]);return _0x4a7244[_0xc4e5('0x4e')](_0x37bed4);}})[_0xc4e5('0x25')](function(_0x505aae){if(_0x505aae){_0x2c067c=_0x505aae['length'];if(!_0x15fb9c[_0xc4e5('0x2f')]['hasOwnProperty'](_0xc4e5('0x4f'))){_0x37bed4[_0xc4e5('0x1f')]=qs[_0xc4e5('0x1f')](_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x1f')]);_0x37bed4[_0xc4e5('0x1d')]=qs[_0xc4e5('0x1d')](_0x15fb9c['query'][_0xc4e5('0x1d')]);}return _0x4a7244['getConfigurations'](_0x37bed4);}})[_0xc4e5('0x25')](function(_0x5dbeee){if(_0x5dbeee){return _0x5dbeee?{'count':_0x2c067c,'rows':_0x5dbeee}:null;}})[_0xc4e5('0x25')](respondWithResult(_0x466da5,null))['catch'](handleError(_0x466da5,null));};exports[_0xc4e5('0x50')]=function(_0x23a43e,_0xf776e0,_0x4b5a6a){if(_0x23a43e[_0xc4e5('0x48')]['id']){delete _0x23a43e['body']['id'];}return db[_0xc4e5('0x41')][_0xc4e5('0x4c')]({'where':{'id':_0x23a43e[_0xc4e5('0x45')]['id']}})[_0xc4e5('0x25')](handleEntityNotFound(_0xf776e0,null))[_0xc4e5('0x25')](function(_0x2d528b){if(_0x2d528b){_0x23a43e['body'][_0xc4e5('0x51')]=_0x2d528b['id'];_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x52')]=integrations[_0xc4e5('0x53')](_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x54')],_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x3d')]);_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x55')]=integrations[_0xc4e5('0x56')](_0x23a43e['body'][_0xc4e5('0x54')],_0x23a43e[_0xc4e5('0x48')]['type']);return db[_0xc4e5('0x4d')][_0xc4e5('0x47')](_0x23a43e[_0xc4e5('0x48')],{'include':[{'model':db[_0xc4e5('0x57')],'as':_0xc4e5('0x52')},{'model':db[_0xc4e5('0x57')],'as':'Descriptions'}]});}return null;})[_0xc4e5('0x25')](respondWithResult(_0xf776e0,null))[_0xc4e5('0x43')](handleError(_0xf776e0,null));};exports['getFields']=function(_0x37da48,_0x267886,_0x5d953b){var _0x4bc266='';return db[_0xc4e5('0x41')][_0xc4e5('0x4c')]({'where':{'id':_0x37da48[_0xc4e5('0x45')]['id']},'attributes':['id',_0xc4e5('0x58'),_0xc4e5('0x59')]})[_0xc4e5('0x25')](handleEntityNotFound(_0x267886,null))['then'](function(_0x5ba867){if(_0x5ba867){_0x4bc266=_0x5ba867[_0xc4e5('0x58')];var _0xc14634=_0x4bc266[_0xc4e5('0x5a')](-0x1);if(_0xc14634==='/'){_0x4bc266=_0x4bc266[_0xc4e5('0x5b')](0x0,_0x4bc266[_0xc4e5('0x5c')](_0xc14634));}return rp({'method':'GET','uri':util[_0xc4e5('0x5d')](_0xc4e5('0x5e'),_0x4bc266,_0xc4e5('0x5f')),'headers':{'Authorization':util[_0xc4e5('0x5d')]('Basic\x20%s',new Buffer(util[_0xc4e5('0x5d')]('%s:X',_0x5ba867[_0xc4e5('0x59')]))[_0xc4e5('0x60')](_0xc4e5('0x61')))},'json':!![]});}})['then'](function(_0x52e2e5){if(_0x52e2e5){var _0x5ad018=['requester',_0xc4e5('0x62'),_0xc4e5('0x63'),'description','status',_0xc4e5('0x64'),_0xc4e5('0x65'),'source',_0xc4e5('0x66'),_0xc4e5('0x65'),_0xc4e5('0x67')];_[_0xc4e5('0x68')](_0x52e2e5,function(_0x255e96){return _0x5ad018['includes'](_0x255e96[_0xc4e5('0x28')])||!_0x255e96[_0xc4e5('0x69')]&&_0x255e96[_0xc4e5('0x3d')]!==_0xc4e5('0x6a')&&_0x255e96['type']!=='custom_dropdown';});return{'count':_0x52e2e5[_0xc4e5('0x35')],'rows':_[_0xc4e5('0x2a')](_0x52e2e5,function(_0xec7a48){return{'id':_0xec7a48['name'],'name':_0xec7a48['label'],'custom':!_0xec7a48[_0xc4e5('0x69')],'options':_0xec7a48[_0xc4e5('0x6b')]?_['map'](_0xec7a48[_0xc4e5('0x6b')],function(_0x44367f){return{'name':_['capitalize'](_0x44367f),'value':_0x44367f};}):[]};})};}})['then'](respondWithResult(_0x267886,null))[_0xc4e5('0x43')](function(_0x213aa7){var _0x3492e6=_0x37da48[_0xc4e5('0x2f')][_0xc4e5('0x6c')]?0x1f4:_0x213aa7[_0xc4e5('0x6d')]||0x1f4;logger[_0xc4e5('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xc4e5('0x6e'),_0x3492e6,JSON[_0xc4e5('0x6f')](_0x213aa7));delete _0x213aa7['name'];if(_0x3492e6===0x191){_0x3492e6=0x190;}_0x267886[_0xc4e5('0x21')](_0x3492e6)['send'](_0x37da48[_0xc4e5('0x2f')][_0xc4e5('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x213aa7[_0xc4e5('0x6d')]}:_0x213aa7);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 2eaf270..7e961fc 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 _0x6801=['../../components/integrations/configuration','define','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x495510,_0x300f11){var _0x330fc1=function(_0x4e9e87){while(--_0x4e9e87){_0x495510['push'](_0x495510['shift']());}};_0x330fc1(++_0x300f11);}(_0x6801,0xd3));var _0x1680=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6801[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1680('0x0'));var util=require(_0x1680('0x1'));var logger=require('../../config/logger')(_0x1680('0x2'));var moment=require(_0x1680('0x3'));var BPromise=require(_0x1680('0x4'));var rp=require(_0x1680('0x5'));var fs=require('fs');var path=require(_0x1680('0x6'));var rimraf=require(_0x1680('0x7'));var config=require(_0x1680('0x8'));var attributes=require(_0x1680('0x9'));var integrations=require(_0x1680('0xa'));module['exports']=function(_0x4f3185,_0x11f633){return _0x4f3185[_0x1680('0xb')]('FreshdeskAccount',attributes,{'tableName':_0x1680('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef53=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment','bluebird','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x2b0139,_0xc838f7){var _0x40d3ab=function(_0x4bbd1d){while(--_0x4bbd1d){_0x2b0139['push'](_0x2b0139['shift']());}};_0x40d3ab(++_0xc838f7);}(_0xef53,0x115));var _0x3ef5=function(_0x179039,_0x1fb713){_0x179039=_0x179039-0x0;var _0xeb427=_0xef53[_0x179039];return _0xeb427;};'use strict';var _=require(_0x3ef5('0x0'));var util=require(_0x3ef5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3ef5('0x2'));var BPromise=require(_0x3ef5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3ef5('0x4'));var config=require('../../config/environment');var attributes=require(_0x3ef5('0x5'));var integrations=require(_0x3ef5('0x6'));module[_0x3ef5('0x7')]=function(_0x5e17b4,_0x222360){return _0x5e17b4[_0x3ef5('0x8')](_0x3ef5('0x9'),attributes,{'tableName':_0x3ef5('0xa'),'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 cab0806..4d8b009 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 _0x0c10=['raw','attributes','include','model','map','debug','ShowFreshdeskAccount','FreshdeskAccount','find','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','findAll','options'];(function(_0x4a1353,_0x2fbe86){var _0x3805cc=function(_0x39a7ee){while(--_0x39a7ee){_0x4a1353['push'](_0x4a1353['shift']());}};_0x3805cc(++_0x2fbe86);}(_0x0c10,0xf0));var _0x00c1=function(_0x3322a0,_0xc75fc7){_0x3322a0=_0x3322a0-0x0;var _0x15be8e=_0x0c10[_0x3322a0];return _0x15be8e;};'use strict';var _=require('lodash');var util=require(_0x00c1('0x0'));var moment=require(_0x00c1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00c1('0x2'));var db=require(_0x00c1('0x3'))['db'];var utils=require(_0x00c1('0x4'));var logger=require(_0x00c1('0x5'))(_0x00c1('0x6'));var config=require(_0x00c1('0x7'));var jayson=require(_0x00c1('0x8'));var client=jayson[_0x00c1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b41b6,_0xf30419,_0x1ea414){return new BPromise(function(_0x19e4b5,_0x5b7c06){return client['request'](_0x2b41b6,_0x1ea414)[_0x00c1('0xa')](function(_0x455554){logger['info'](_0x00c1('0xb'),_0xf30419,_0x00c1('0xc'));logger['debug'](_0x00c1('0xd'),_0xf30419,_0x00c1('0xc'),JSON[_0x00c1('0xe')](_0x455554));if(_0x455554['error']){if(_0x455554[_0x00c1('0xf')][_0x00c1('0x10')]===0x1f4){logger[_0x00c1('0xf')](_0x00c1('0xb'),_0xf30419,_0x455554[_0x00c1('0xf')][_0x00c1('0x11')]);return _0x5b7c06(_0x455554[_0x00c1('0xf')][_0x00c1('0x11')]);}logger[_0x00c1('0xf')](_0x00c1('0xb'),_0xf30419,_0x455554['error'][_0x00c1('0x11')]);return _0x19e4b5(_0x455554[_0x00c1('0xf')][_0x00c1('0x11')]);}else{logger[_0x00c1('0x12')](_0x00c1('0xb'),_0xf30419,_0x00c1('0xc'));_0x19e4b5(_0x455554[_0x00c1('0x13')][_0x00c1('0x11')]);}})[_0x00c1('0x14')](function(_0xfacdad){logger[_0x00c1('0xf')](_0x00c1('0xb'),_0xf30419,_0xfacdad);_0x5b7c06(_0xfacdad);});});}exports[_0x00c1('0x15')]=function(_0x2082ab){var _0x15e862=this;return new Promise(function(_0x236446,_0x478f41){return db['FreshdeskAccount'][_0x00c1('0x16')]({'raw':_0x2082ab['options']?_0x2082ab[_0x00c1('0x17')][_0x00c1('0x18')]===undefined?!![]:![]:!![],'where':_0x2082ab['options']?_0x2082ab[_0x00c1('0x17')]['where']||null:null,'attributes':_0x2082ab[_0x00c1('0x17')]?_0x2082ab[_0x00c1('0x17')][_0x00c1('0x19')]||null:null,'limit':_0x2082ab[_0x00c1('0x17')]?_0x2082ab[_0x00c1('0x17')]['limit']||null:null,'include':_0x2082ab[_0x00c1('0x17')]?_0x2082ab[_0x00c1('0x17')]['include']?_['map'](_0x2082ab[_0x00c1('0x17')][_0x00c1('0x1a')],function(_0x1ce41b){return{'model':db[_0x1ce41b[_0x00c1('0x1b')]],'as':_0x1ce41b['as'],'attributes':_0x1ce41b[_0x00c1('0x19')],'include':_0x1ce41b[_0x00c1('0x1a')]?_['map'](_0x1ce41b[_0x00c1('0x1a')],function(_0x54ff2a){return{'model':db[_0x54ff2a['model']],'as':_0x54ff2a['as'],'attributes':_0x54ff2a['attributes'],'include':_0x54ff2a[_0x00c1('0x1a')]?_[_0x00c1('0x1c')](_0x54ff2a[_0x00c1('0x1a')],function(_0x174d27){return{'model':db[_0x174d27[_0x00c1('0x1b')]],'as':_0x174d27['as'],'attributes':_0x174d27[_0x00c1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe1583b){logger[_0x00c1('0x12')](_0x00c1('0x15'),_0x2082ab);logger[_0x00c1('0x1d')](_0x00c1('0x15'),_0x2082ab,JSON[_0x00c1('0xe')](_0xe1583b));_0x236446(_0xe1583b);})[_0x00c1('0x14')](function(_0x943d0c){logger[_0x00c1('0xf')](_0x00c1('0x15'),_0x943d0c[_0x00c1('0x11')],_0x2082ab);_0x478f41(_0x15e862[_0x00c1('0xf')](0x1f4,_0x943d0c[_0x00c1('0x11')]));});});};exports[_0x00c1('0x1e')]=function(_0x5d72d0){var _0x1d7b57=this;return new Promise(function(_0x1b31bc,_0x5b72a0){return db[_0x00c1('0x1f')][_0x00c1('0x20')]({'raw':_0x5d72d0[_0x00c1('0x17')]?_0x5d72d0['options'][_0x00c1('0x18')]===undefined?!![]:![]:!![],'where':_0x5d72d0[_0x00c1('0x17')]?_0x5d72d0[_0x00c1('0x17')]['where']||null:null,'attributes':_0x5d72d0[_0x00c1('0x17')]?_0x5d72d0[_0x00c1('0x17')][_0x00c1('0x19')]||null:null,'include':_0x5d72d0[_0x00c1('0x17')]?_0x5d72d0[_0x00c1('0x17')][_0x00c1('0x1a')]?_[_0x00c1('0x1c')](_0x5d72d0[_0x00c1('0x17')][_0x00c1('0x1a')],function(_0x31f17a){return{'model':db[_0x31f17a[_0x00c1('0x1b')]],'as':_0x31f17a['as'],'attributes':_0x31f17a[_0x00c1('0x19')],'include':_0x31f17a['include']?_[_0x00c1('0x1c')](_0x31f17a[_0x00c1('0x1a')],function(_0x349838){return{'model':db[_0x349838['model']],'as':_0x349838['as'],'attributes':_0x349838[_0x00c1('0x19')],'include':_0x349838[_0x00c1('0x1a')]?_['map'](_0x349838[_0x00c1('0x1a')],function(_0x4de542){return{'model':db[_0x4de542['model']],'as':_0x4de542['as'],'attributes':_0x4de542['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30e7ad){logger['info'](_0x00c1('0x1e'),_0x5d72d0);logger['debug'](_0x00c1('0x1e'),_0x5d72d0,JSON[_0x00c1('0xe')](_0x30e7ad));_0x1b31bc(_0x30e7ad);})[_0x00c1('0x14')](function(_0xd149c9){logger[_0x00c1('0xf')](_0x00c1('0x1e'),_0xd149c9[_0x00c1('0x11')],_0x5d72d0);_0x5b72a0(_0x1d7b57[_0x00c1('0xf')](0x1f4,_0xd149c9[_0x00c1('0x11')]));});});}; \ No newline at end of file +var _0x35f2=['find','stringify','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowFreshdeskAccount'];(function(_0x5d88a3,_0x5cfc68){var _0x1e05e8=function(_0x5ac1d0){while(--_0x5ac1d0){_0x5d88a3['push'](_0x5d88a3['shift']());}};_0x1e05e8(++_0x5cfc68);}(_0x35f2,0x68));var _0x235f=function(_0x329fb1,_0x298034){_0x329fb1=_0x329fb1-0x0;var _0x2ece71=_0x35f2[_0x329fb1];return _0x2ece71;};'use strict';var _=require('lodash');var util=require(_0x235f('0x0'));var moment=require(_0x235f('0x1'));var BPromise=require(_0x235f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x235f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x235f('0x4'))(_0x235f('0x5'));var config=require('../../config/environment');var jayson=require(_0x235f('0x6'));var client=jayson[_0x235f('0x7')][_0x235f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3518ea,_0x2cd07b,_0x3f99b6){return new BPromise(function(_0x4ca6c3,_0x277bb7){return client[_0x235f('0x9')](_0x3518ea,_0x3f99b6)[_0x235f('0xa')](function(_0x2831aa){logger[_0x235f('0xb')](_0x235f('0xc'),_0x2cd07b,_0x235f('0xd'));logger[_0x235f('0xe')](_0x235f('0xf'),_0x2cd07b,_0x235f('0xd'),JSON['stringify'](_0x2831aa));if(_0x2831aa[_0x235f('0x10')]){if(_0x2831aa['error'][_0x235f('0x11')]===0x1f4){logger['error'](_0x235f('0xc'),_0x2cd07b,_0x2831aa[_0x235f('0x10')][_0x235f('0x12')]);return _0x277bb7(_0x2831aa[_0x235f('0x10')][_0x235f('0x12')]);}logger[_0x235f('0x10')](_0x235f('0xc'),_0x2cd07b,_0x2831aa[_0x235f('0x10')][_0x235f('0x12')]);return _0x4ca6c3(_0x2831aa['error']['message']);}else{logger[_0x235f('0xb')](_0x235f('0xc'),_0x2cd07b,_0x235f('0xd'));_0x4ca6c3(_0x2831aa['result']['message']);}})['catch'](function(_0x41facc){logger[_0x235f('0x10')](_0x235f('0xc'),_0x2cd07b,_0x41facc);_0x277bb7(_0x41facc);});});}exports[_0x235f('0x13')]=function(_0x2039e0){var _0x54f226=this;return new Promise(function(_0x3cb305,_0x261416){return db[_0x235f('0x14')][_0x235f('0x15')]({'raw':_0x2039e0[_0x235f('0x16')]?_0x2039e0['options'][_0x235f('0x17')]===undefined?!![]:![]:!![],'where':_0x2039e0[_0x235f('0x16')]?_0x2039e0['options'][_0x235f('0x18')]||null:null,'attributes':_0x2039e0[_0x235f('0x16')]?_0x2039e0[_0x235f('0x16')][_0x235f('0x19')]||null:null,'limit':_0x2039e0['options']?_0x2039e0[_0x235f('0x16')][_0x235f('0x1a')]||null:null,'include':_0x2039e0[_0x235f('0x16')]?_0x2039e0['options'][_0x235f('0x1b')]?_[_0x235f('0x1c')](_0x2039e0[_0x235f('0x16')][_0x235f('0x1b')],function(_0x3ca783){return{'model':db[_0x3ca783[_0x235f('0x1d')]],'as':_0x3ca783['as'],'attributes':_0x3ca783[_0x235f('0x19')],'include':_0x3ca783[_0x235f('0x1b')]?_[_0x235f('0x1c')](_0x3ca783[_0x235f('0x1b')],function(_0x18ee49){return{'model':db[_0x18ee49[_0x235f('0x1d')]],'as':_0x18ee49['as'],'attributes':_0x18ee49[_0x235f('0x19')],'include':_0x18ee49['include']?_[_0x235f('0x1c')](_0x18ee49[_0x235f('0x1b')],function(_0x14ed7b){return{'model':db[_0x14ed7b[_0x235f('0x1d')]],'as':_0x14ed7b['as'],'attributes':_0x14ed7b[_0x235f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f8f79){logger[_0x235f('0xb')](_0x235f('0x13'),_0x2039e0);logger[_0x235f('0xe')](_0x235f('0x13'),_0x2039e0,JSON['stringify'](_0x4f8f79));_0x3cb305(_0x4f8f79);})[_0x235f('0x1e')](function(_0x14df03){logger[_0x235f('0x10')](_0x235f('0x13'),_0x14df03['message'],_0x2039e0);_0x261416(_0x54f226[_0x235f('0x10')](0x1f4,_0x14df03[_0x235f('0x12')]));});});};exports[_0x235f('0x1f')]=function(_0x32d109){var _0x34f9b0=this;return new Promise(function(_0x2f678c,_0x42f5b4){return db['FreshdeskAccount'][_0x235f('0x20')]({'raw':_0x32d109[_0x235f('0x16')]?_0x32d109[_0x235f('0x16')][_0x235f('0x17')]===undefined?!![]:![]:!![],'where':_0x32d109[_0x235f('0x16')]?_0x32d109[_0x235f('0x16')][_0x235f('0x18')]||null:null,'attributes':_0x32d109[_0x235f('0x16')]?_0x32d109['options'][_0x235f('0x19')]||null:null,'include':_0x32d109[_0x235f('0x16')]?_0x32d109[_0x235f('0x16')][_0x235f('0x1b')]?_[_0x235f('0x1c')](_0x32d109[_0x235f('0x16')]['include'],function(_0x4fb0e5){return{'model':db[_0x4fb0e5['model']],'as':_0x4fb0e5['as'],'attributes':_0x4fb0e5[_0x235f('0x19')],'include':_0x4fb0e5[_0x235f('0x1b')]?_[_0x235f('0x1c')](_0x4fb0e5[_0x235f('0x1b')],function(_0xe6f5f2){return{'model':db[_0xe6f5f2['model']],'as':_0xe6f5f2['as'],'attributes':_0xe6f5f2[_0x235f('0x19')],'include':_0xe6f5f2[_0x235f('0x1b')]?_[_0x235f('0x1c')](_0xe6f5f2['include'],function(_0x2615d9){return{'model':db[_0x2615d9[_0x235f('0x1d')]],'as':_0x2615d9['as'],'attributes':_0x2615d9[_0x235f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x235f('0xa')](function(_0x396429){logger[_0x235f('0xb')](_0x235f('0x1f'),_0x32d109);logger[_0x235f('0xe')](_0x235f('0x1f'),_0x32d109,JSON[_0x235f('0x21')](_0x396429));_0x2f678c(_0x396429);})[_0x235f('0x1e')](function(_0x189290){logger['error']('ShowFreshdeskAccount',_0x189290[_0x235f('0x12')],_0x32d109);_0x42f5b4(_0x34f9b0[_0x235f('0x10')](0x1f4,_0x189290[_0x235f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 28cd10f..399ac7d 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 _0x2489=['setTags','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/tags','getTags','create','post'];(function(_0x120802,_0x144dfd){var _0xd1e47f=function(_0x260645){while(--_0x260645){_0x120802['push'](_0x120802['shift']());}};_0xd1e47f(++_0x144dfd);}(_0x2489,0x10a));var _0x9248=function(_0x3d169c,_0xbec07d){_0x3d169c=_0x3d169c-0x0;var _0x468ffb=_0x2489[_0x3d169c];return _0x468ffb;};'use strict';var multer=require('multer');var util=require(_0x9248('0x0'));var path=require(_0x9248('0x1'));var timeout=require('connect-timeout');var express=require(_0x9248('0x2'));var router=express[_0x9248('0x3')]();var fs_extra=require(_0x9248('0x4'));var auth=require(_0x9248('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9248('0x6'));var controller=require(_0x9248('0x7'));router[_0x9248('0x8')]('/',auth[_0x9248('0x9')](),controller[_0x9248('0xa')]);router[_0x9248('0x8')](_0x9248('0xb'),auth[_0x9248('0x9')](),controller[_0x9248('0xc')]);router['get'](_0x9248('0xd'),auth[_0x9248('0x9')](),controller[_0x9248('0xe')]);router[_0x9248('0x8')](_0x9248('0xf'),auth[_0x9248('0x9')](),controller['getSubjects']);router[_0x9248('0x8')]('/:id/descriptions',auth[_0x9248('0x9')](),controller['getDescriptions']);router[_0x9248('0x8')](_0x9248('0x10'),auth[_0x9248('0x9')](),controller[_0x9248('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9248('0x12')]);router[_0x9248('0x13')](_0x9248('0x10'),auth['isAuthenticated'](),controller[_0x9248('0x14')]);router[_0x9248('0x15')]('/:id',auth[_0x9248('0x9')](),controller[_0x9248('0x16')]);router[_0x9248('0x17')](_0x9248('0xb'),auth[_0x9248('0x9')](),controller[_0x9248('0x18')]);module[_0x9248('0x19')]=router; \ No newline at end of file +var _0x54c3=['getDescriptions','getTags','create','post','/:id/tags','setTags','update','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions'];(function(_0x190d13,_0x1e1696){var _0x57f23f=function(_0x59125e){while(--_0x59125e){_0x190d13['push'](_0x190d13['shift']());}};_0x57f23f(++_0x1e1696);}(_0x54c3,0x80));var _0x354c=function(_0x86ba06,_0x2e50d9){_0x86ba06=_0x86ba06-0x0;var _0xafb44a=_0x54c3[_0x86ba06];return _0xafb44a;};'use strict';var multer=require(_0x354c('0x0'));var util=require('util');var path=require(_0x354c('0x1'));var timeout=require('connect-timeout');var express=require(_0x354c('0x2'));var router=express['Router']();var fs_extra=require(_0x354c('0x3'));var auth=require(_0x354c('0x4'));var interaction=require(_0x354c('0x5'));var config=require(_0x354c('0x6'));var controller=require(_0x354c('0x7'));router[_0x354c('0x8')]('/',auth[_0x354c('0x9')](),controller[_0x354c('0xa')]);router[_0x354c('0x8')](_0x354c('0xb'),auth[_0x354c('0x9')](),controller[_0x354c('0xc')]);router[_0x354c('0x8')]('/:id/fields',auth[_0x354c('0x9')](),controller[_0x354c('0xd')]);router[_0x354c('0x8')](_0x354c('0xe'),auth[_0x354c('0x9')](),controller['getSubjects']);router[_0x354c('0x8')](_0x354c('0xf'),auth['isAuthenticated'](),controller[_0x354c('0x10')]);router['get']('/:id/tags',auth[_0x354c('0x9')](),controller[_0x354c('0x11')]);router['post']('/',auth[_0x354c('0x9')](),controller[_0x354c('0x12')]);router[_0x354c('0x13')](_0x354c('0x14'),auth['isAuthenticated'](),controller[_0x354c('0x15')]);router['put'](_0x354c('0xb'),auth[_0x354c('0x9')](),controller[_0x354c('0x16')]);router['delete'](_0x354c('0xb'),auth['isAuthenticated'](),controller[_0x354c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index acd5229..afafe3a 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 _0x5ec9=['sequelize','STRING'];(function(_0x410371,_0x52ec52){var _0x49a12a=function(_0x29a2ec){while(--_0x29a2ec){_0x410371['push'](_0x410371['shift']());}};_0x49a12a(++_0x52ec52);}(_0x5ec9,0x1e0));var _0x95ec=function(_0x27ed33,_0x561998){_0x27ed33=_0x27ed33-0x0;var _0x3c42f1=_0x5ec9[_0x27ed33];return _0x3c42f1;};'use strict';var Sequelize=require(_0x95ec('0x0'));module['exports']={'name':{'type':Sequelize[_0x95ec('0x1')]},'description':{'type':Sequelize[_0x95ec('0x1')]}}; \ No newline at end of file +var _0xa592=['exports','STRING','sequelize'];(function(_0xd0f469,_0x705ea3){var _0x526851=function(_0x2048e9){while(--_0x2048e9){_0xd0f469['push'](_0xd0f469['shift']());}};_0x526851(++_0x705ea3);}(_0xa592,0x197));var _0x2a59=function(_0x5d0074,_0x1e1a0e){_0x5d0074=_0x5d0074-0x0;var _0x6a0e93=_0xa592[_0x5d0074];return _0x6a0e93;};'use strict';var Sequelize=require(_0x2a59('0x0'));module[_0x2a59('0x1')]={'name':{'type':Sequelize[_0x2a59('0x2')]},'description':{'type':Sequelize[_0x2a59('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 474b630..9449968 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 _0xf0a9=['end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','type','merge','FreshdeskConfiguration','includeAll','include','findAll','rows','show','keys','options','catch','body','find','params','findOne','rawAttributes','pick','getFields','hasOwnProperty','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0xf0a9,0xe3));var _0x9f0a=function(_0x5203d7,_0x207396){_0x5203d7=_0x5203d7-0x0;var _0x189ef6=_0xf0a9[_0x5203d7];return _0x189ef6;};'use strict';var emlformat=require(_0x9f0a('0x0'));var rimraf=require(_0x9f0a('0x1'));var zipdir=require(_0x9f0a('0x2'));var jsonpatch=require(_0x9f0a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f0a('0x4'));var path=require(_0x9f0a('0x5'));var sox=require(_0x9f0a('0x6'));var csv=require(_0x9f0a('0x7'));var ejs=require(_0x9f0a('0x8'));var fs=require('fs');var fs_extra=require(_0x9f0a('0x9'));var _=require(_0x9f0a('0xa'));var squel=require(_0x9f0a('0xb'));var crypto=require(_0x9f0a('0xc'));var jsforce=require(_0x9f0a('0xd'));var deskjs=require(_0x9f0a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9f0a('0xf'));var Papa=require('papaparse');var Redis=require(_0x9f0a('0x10'));var authService=require(_0x9f0a('0x11'));var qs=require(_0x9f0a('0x12'));var as=require(_0x9f0a('0x13'));var hardwareService=require(_0x9f0a('0x14'));var logger=require('../../config/logger')(_0x9f0a('0x15'));var utils=require(_0x9f0a('0x16'));var config=require(_0x9f0a('0x17'));var licenseUtil=require(_0x9f0a('0x18'));var db=require(_0x9f0a('0x19'))['db'];function respondWithStatusCode(_0x403ce8,_0x31b13f){_0x31b13f=_0x31b13f||0xcc;return function(_0xea2be3){if(_0xea2be3){return _0x403ce8[_0x9f0a('0x1a')](_0x31b13f);}return _0x403ce8[_0x9f0a('0x1b')](_0x31b13f)[_0x9f0a('0x1c')]();};}function respondWithResult(_0x3bb166,_0x868e82){_0x868e82=_0x868e82||0xc8;return function(_0x18b2b7){if(_0x18b2b7){return _0x3bb166[_0x9f0a('0x1b')](_0x868e82)[_0x9f0a('0x1d')](_0x18b2b7);}};}function respondWithFilteredResult(_0x7e5c6e,_0x33c807){return function(_0x327b67){if(_0x327b67){var _0x31420a=typeof _0x33c807[_0x9f0a('0x1e')]===_0x9f0a('0x1f')&&typeof _0x33c807[_0x9f0a('0x20')]==='undefined';var _0x1e0aab=_0x327b67[_0x9f0a('0x21')];var _0x51b343=_0x31420a?0x0:_0x33c807[_0x9f0a('0x1e')];var _0x10cd02=_0x31420a?_0x327b67[_0x9f0a('0x21')]:_0x33c807[_0x9f0a('0x1e')]+_0x33c807['limit'];var _0x232816;if(_0x10cd02>=_0x1e0aab){_0x10cd02=_0x1e0aab;_0x232816=0xc8;}else{_0x232816=0xce;}_0x7e5c6e[_0x9f0a('0x1b')](_0x232816);return _0x7e5c6e[_0x9f0a('0x22')](_0x9f0a('0x23'),_0x51b343+'-'+_0x10cd02+'/'+_0x1e0aab)[_0x9f0a('0x1d')](_0x327b67);}return null;};}function patchUpdates(_0x2a0f8d){return function(_0x31973c){try{jsonpatch[_0x9f0a('0x24')](_0x31973c,_0x2a0f8d,!![]);}catch(_0x4b79b6){return BPromise['reject'](_0x4b79b6);}return _0x31973c[_0x9f0a('0x25')]();};}function saveUpdates(_0x25c885,_0x2ee92b){return function(_0x368289){if(_0x368289){return _0x368289[_0x9f0a('0x26')](_0x25c885)[_0x9f0a('0x27')](function(_0x18d1da){return _0x18d1da;});}return null;};}function removeEntity(_0x1ede9d,_0x2562a4){return function(_0x830442){if(_0x830442){return _0x830442[_0x9f0a('0x28')]()[_0x9f0a('0x27')](function(){_0x1ede9d[_0x9f0a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4bc9,_0xc2462b){return function(_0x49a09e){if(!_0x49a09e){_0x1a4bc9[_0x9f0a('0x1a')](0x194);}return _0x49a09e;};}function handleError(_0x2a07bc,_0x46737d){_0x46737d=_0x46737d||0x1f4;return function(_0x9961c8){logger[_0x9f0a('0x29')](_0x9961c8[_0x9f0a('0x2a')]);if(_0x9961c8['name']){delete _0x9961c8[_0x9f0a('0x2b')];}_0x2a07bc[_0x9f0a('0x1b')](_0x46737d)['send'](_0x9961c8);};}exports[_0x9f0a('0x2c')]=function(_0x2f5c7b,_0x50b58e){var _0x2ccb8f={},_0x69d5f6={},_0x4d7578={'count':0x0,'rows':[]};var _0x4aee18=_[_0x9f0a('0x2d')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x5d160c){return{'name':_0x5d160c[_0x9f0a('0x2e')],'type':_0x5d160c['type'][_0x9f0a('0x2f')]};});_0x69d5f6[_0x9f0a('0x30')]=_[_0x9f0a('0x2d')](_0x4aee18,_0x9f0a('0x2b'));_0x69d5f6[_0x9f0a('0x31')]=_['keys'](_0x2f5c7b[_0x9f0a('0x31')]);_0x69d5f6[_0x9f0a('0x32')]=_['intersection'](_0x69d5f6[_0x9f0a('0x30')],_0x69d5f6[_0x9f0a('0x31')]);_0x2ccb8f['attributes']=_[_0x9f0a('0x33')](_0x69d5f6[_0x9f0a('0x30')],qs[_0x9f0a('0x34')](_0x2f5c7b[_0x9f0a('0x31')]['fields']));_0x2ccb8f[_0x9f0a('0x35')]=_0x2ccb8f[_0x9f0a('0x35')][_0x9f0a('0x36')]?_0x2ccb8f[_0x9f0a('0x35')]:_0x69d5f6['model'];if(!_0x2f5c7b[_0x9f0a('0x31')]['hasOwnProperty'](_0x9f0a('0x37'))){_0x2ccb8f[_0x9f0a('0x20')]=qs[_0x9f0a('0x20')](_0x2f5c7b[_0x9f0a('0x31')]['limit']);_0x2ccb8f['offset']=qs[_0x9f0a('0x1e')](_0x2f5c7b[_0x9f0a('0x31')][_0x9f0a('0x1e')]);}_0x2ccb8f[_0x9f0a('0x38')]=qs[_0x9f0a('0x39')](_0x2f5c7b[_0x9f0a('0x31')][_0x9f0a('0x39')]);_0x2ccb8f['where']=qs[_0x9f0a('0x32')](_['pick'](_0x2f5c7b['query'],_0x69d5f6[_0x9f0a('0x32')]),_0x4aee18);if(_0x2f5c7b[_0x9f0a('0x31')][_0x9f0a('0x3a')]){_0x2ccb8f['where']=_['merge'](_0x2ccb8f[_0x9f0a('0x3b')],{'$or':_[_0x9f0a('0x2d')](_0x4aee18,function(_0x15ba86){if(_0x15ba86[_0x9f0a('0x3c')]!=='VIRTUAL'){var _0x14120d={};_0x14120d[_0x15ba86[_0x9f0a('0x2b')]]={'$like':'%'+_0x2f5c7b[_0x9f0a('0x31')][_0x9f0a('0x3a')]+'%'};return _0x14120d;}})});}_0x2ccb8f=_[_0x9f0a('0x3d')]({},_0x2ccb8f,_0x2f5c7b['options']);var _0x4bb229={'where':_0x2ccb8f[_0x9f0a('0x3b')]};return db[_0x9f0a('0x3e')][_0x9f0a('0x21')](_0x4bb229)['then'](function(_0x232eab){_0x4d7578[_0x9f0a('0x21')]=_0x232eab;if(_0x2f5c7b[_0x9f0a('0x31')][_0x9f0a('0x3f')]){_0x2ccb8f[_0x9f0a('0x40')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x9f0a('0x41')](_0x2ccb8f);})[_0x9f0a('0x27')](function(_0x3bc77f){_0x4d7578[_0x9f0a('0x42')]=_0x3bc77f;return _0x4d7578;})[_0x9f0a('0x27')](respondWithFilteredResult(_0x50b58e,_0x2ccb8f))['catch'](handleError(_0x50b58e,null));};exports[_0x9f0a('0x43')]=function(_0x253e37,_0x283985){var _0x4ec34b={'raw':![],'where':{'id':_0x253e37['params']['id']}},_0x4b2377={};_0x4b2377['model']=_[_0x9f0a('0x44')](db[_0x9f0a('0x3e')]['rawAttributes']);_0x4b2377[_0x9f0a('0x31')]=_[_0x9f0a('0x44')](_0x253e37['query']);_0x4b2377[_0x9f0a('0x32')]=_[_0x9f0a('0x33')](_0x4b2377[_0x9f0a('0x30')],_0x4b2377[_0x9f0a('0x31')]);_0x4ec34b[_0x9f0a('0x35')]=_[_0x9f0a('0x33')](_0x4b2377[_0x9f0a('0x30')],qs[_0x9f0a('0x34')](_0x253e37[_0x9f0a('0x31')][_0x9f0a('0x34')]));_0x4ec34b[_0x9f0a('0x35')]=_0x4ec34b[_0x9f0a('0x35')][_0x9f0a('0x36')]?_0x4ec34b['attributes']:_0x4b2377['model'];if(_0x253e37[_0x9f0a('0x31')][_0x9f0a('0x3f')]){_0x4ec34b['include']=[{'all':!![]}];}_0x4ec34b=_[_0x9f0a('0x3d')]({},_0x4ec34b,_0x253e37[_0x9f0a('0x45')]);return db[_0x9f0a('0x3e')]['find'](_0x4ec34b)[_0x9f0a('0x27')](handleEntityNotFound(_0x283985,null))[_0x9f0a('0x27')](respondWithResult(_0x283985,null))[_0x9f0a('0x46')](handleError(_0x283985,null));};exports['create']=function(_0x3d782e,_0x3cc0bc){return db[_0x9f0a('0x3e')]['create'](_0x3d782e[_0x9f0a('0x47')],{})[_0x9f0a('0x27')](respondWithResult(_0x3cc0bc,0xc9))['catch'](handleError(_0x3cc0bc,null));};exports[_0x9f0a('0x26')]=function(_0x2feebb,_0xa6c7fe){if(_0x2feebb[_0x9f0a('0x47')]['id']){delete _0x2feebb[_0x9f0a('0x47')]['id'];}return db[_0x9f0a('0x3e')][_0x9f0a('0x48')]({'where':{'id':_0x2feebb[_0x9f0a('0x49')]['id']}})[_0x9f0a('0x27')](handleEntityNotFound(_0xa6c7fe,null))[_0x9f0a('0x27')](saveUpdates(_0x2feebb[_0x9f0a('0x47')],null))['then'](respondWithResult(_0xa6c7fe,null))[_0x9f0a('0x46')](handleError(_0xa6c7fe,null));};exports[_0x9f0a('0x28')]=function(_0x5273d9,_0x4d07ff){return db[_0x9f0a('0x3e')]['find']({'where':{'id':_0x5273d9['params']['id']}})[_0x9f0a('0x27')](handleEntityNotFound(_0x4d07ff,null))['then'](removeEntity(_0x4d07ff,null))[_0x9f0a('0x46')](handleError(_0x4d07ff,null));};exports['getFields']=function(_0x50dcd9,_0x1aa5ba,_0xa19382){var _0xc4b98b={};var _0x2f4d18={};var _0x7295f0;var _0x4ce754;return db[_0x9f0a('0x3e')][_0x9f0a('0x4a')]({'where':{'id':_0x50dcd9[_0x9f0a('0x49')]['id']}})[_0x9f0a('0x27')](handleEntityNotFound(_0x1aa5ba,null))[_0x9f0a('0x27')](function(_0x59f7cc){if(_0x59f7cc){_0x7295f0=_0x59f7cc;_0x2f4d18[_0x9f0a('0x30')]=_['keys'](db['FreshdeskField'][_0x9f0a('0x4b')]);_0x2f4d18['query']=_['keys'](_0x50dcd9[_0x9f0a('0x31')]);_0x2f4d18[_0x9f0a('0x32')]=_[_0x9f0a('0x33')](_0x2f4d18['model'],_0x2f4d18[_0x9f0a('0x31')]);_0xc4b98b['attributes']=_[_0x9f0a('0x33')](_0x2f4d18['model'],qs[_0x9f0a('0x34')](_0x50dcd9[_0x9f0a('0x31')][_0x9f0a('0x34')]));_0xc4b98b[_0x9f0a('0x35')]=_0xc4b98b[_0x9f0a('0x35')][_0x9f0a('0x36')]?_0xc4b98b['attributes']:_0x2f4d18['model'];_0xc4b98b[_0x9f0a('0x38')]=qs[_0x9f0a('0x39')](_0x50dcd9[_0x9f0a('0x31')][_0x9f0a('0x39')]);_0xc4b98b[_0x9f0a('0x3b')]=qs['filters'](_[_0x9f0a('0x4c')](_0x50dcd9[_0x9f0a('0x31')],_0x2f4d18['filters']));if(_0x50dcd9[_0x9f0a('0x31')][_0x9f0a('0x3a')]){_0xc4b98b[_0x9f0a('0x3b')]=_[_0x9f0a('0x3d')](_0xc4b98b['where'],{'$or':_[_0x9f0a('0x2d')](_0xc4b98b[_0x9f0a('0x35')],function(_0x55dc62){var _0x26f281={};_0x26f281[_0x55dc62]={'$like':'%'+_0x50dcd9[_0x9f0a('0x31')][_0x9f0a('0x3a')]+'%'};return _0x26f281;})});}_0xc4b98b=_['merge']({},_0xc4b98b,_0x50dcd9[_0x9f0a('0x45')]);return _0x7295f0[_0x9f0a('0x4d')](_0xc4b98b);}})['then'](function(_0x186b63){if(_0x186b63){_0x4ce754=_0x186b63[_0x9f0a('0x36')];if(!_0x50dcd9[_0x9f0a('0x31')][_0x9f0a('0x4e')]('nolimit')){_0xc4b98b[_0x9f0a('0x20')]=qs['limit'](_0x50dcd9[_0x9f0a('0x31')][_0x9f0a('0x20')]);_0xc4b98b[_0x9f0a('0x1e')]=qs[_0x9f0a('0x1e')](_0x50dcd9[_0x9f0a('0x31')][_0x9f0a('0x1e')]);}return _0x7295f0['getFields'](_0xc4b98b);}})[_0x9f0a('0x27')](function(_0x5b526e){if(_0x5b526e){return _0x5b526e?{'count':_0x4ce754,'rows':_0x5b526e}:null;}})[_0x9f0a('0x27')](respondWithResult(_0x1aa5ba,null))[_0x9f0a('0x46')](handleError(_0x1aa5ba,null));};exports[_0x9f0a('0x4f')]=function(_0x899503,_0x26073c,_0x59c6a4){var _0x1c7278={};var _0x3b5870={};var _0x315f47;var _0xf300df;return db[_0x9f0a('0x3e')][_0x9f0a('0x4a')]({'where':{'id':_0x899503[_0x9f0a('0x49')]['id']}})[_0x9f0a('0x27')](handleEntityNotFound(_0x26073c,null))[_0x9f0a('0x27')](function(_0x1818fd){if(_0x1818fd){_0x315f47=_0x1818fd;_0x3b5870[_0x9f0a('0x30')]=_[_0x9f0a('0x44')](db[_0x9f0a('0x50')]['rawAttributes']);_0x3b5870['query']=_[_0x9f0a('0x44')](_0x899503['query']);_0x3b5870[_0x9f0a('0x32')]=_['intersection'](_0x3b5870[_0x9f0a('0x30')],_0x3b5870['query']);_0x1c7278[_0x9f0a('0x35')]=_[_0x9f0a('0x33')](_0x3b5870[_0x9f0a('0x30')],qs[_0x9f0a('0x34')](_0x899503['query']['fields']));_0x1c7278[_0x9f0a('0x35')]=_0x1c7278[_0x9f0a('0x35')][_0x9f0a('0x36')]?_0x1c7278[_0x9f0a('0x35')]:_0x3b5870[_0x9f0a('0x30')];_0x1c7278[_0x9f0a('0x38')]=qs[_0x9f0a('0x39')](_0x899503[_0x9f0a('0x31')][_0x9f0a('0x39')]);_0x1c7278[_0x9f0a('0x3b')]=qs[_0x9f0a('0x32')](_[_0x9f0a('0x4c')](_0x899503[_0x9f0a('0x31')],_0x3b5870[_0x9f0a('0x32')]));if(_0x899503[_0x9f0a('0x31')][_0x9f0a('0x3a')]){_0x1c7278[_0x9f0a('0x3b')]=_[_0x9f0a('0x3d')](_0x1c7278[_0x9f0a('0x3b')],{'$or':_[_0x9f0a('0x2d')](_0x1c7278[_0x9f0a('0x35')],function(_0x36b210){var _0xa1fc6c={};_0xa1fc6c[_0x36b210]={'$like':'%'+_0x899503[_0x9f0a('0x31')][_0x9f0a('0x3a')]+'%'};return _0xa1fc6c;})});}_0x1c7278=_[_0x9f0a('0x3d')]({},_0x1c7278,_0x899503['options']);return _0x315f47[_0x9f0a('0x4f')](_0x1c7278);}})['then'](function(_0x2ae5f6){if(_0x2ae5f6){_0xf300df=_0x2ae5f6[_0x9f0a('0x36')];if(!_0x899503['query']['hasOwnProperty'](_0x9f0a('0x37'))){_0x1c7278[_0x9f0a('0x20')]=qs[_0x9f0a('0x20')](_0x899503['query'][_0x9f0a('0x20')]);_0x1c7278[_0x9f0a('0x1e')]=qs[_0x9f0a('0x1e')](_0x899503[_0x9f0a('0x31')][_0x9f0a('0x1e')]);}return _0x315f47[_0x9f0a('0x4f')](_0x1c7278);}})[_0x9f0a('0x27')](function(_0x50056f){if(_0x50056f){return _0x50056f?{'count':_0xf300df,'rows':_0x50056f}:null;}})[_0x9f0a('0x27')](respondWithResult(_0x26073c,null))[_0x9f0a('0x46')](handleError(_0x26073c,null));};exports['getDescriptions']=function(_0x24bf6d,_0x3d243d,_0xd8e80f){var _0x1bb4ea={};var _0x598809={};var _0x54dc34;var _0x546184;return db[_0x9f0a('0x3e')]['findOne']({'where':{'id':_0x24bf6d['params']['id']}})[_0x9f0a('0x27')](handleEntityNotFound(_0x3d243d,null))['then'](function(_0x35c451){if(_0x35c451){_0x54dc34=_0x35c451;_0x598809[_0x9f0a('0x30')]=_['keys'](db[_0x9f0a('0x50')]['rawAttributes']);_0x598809['query']=_['keys'](_0x24bf6d[_0x9f0a('0x31')]);_0x598809[_0x9f0a('0x32')]=_[_0x9f0a('0x33')](_0x598809[_0x9f0a('0x30')],_0x598809[_0x9f0a('0x31')]);_0x1bb4ea[_0x9f0a('0x35')]=_['intersection'](_0x598809[_0x9f0a('0x30')],qs[_0x9f0a('0x34')](_0x24bf6d[_0x9f0a('0x31')]['fields']));_0x1bb4ea[_0x9f0a('0x35')]=_0x1bb4ea[_0x9f0a('0x35')][_0x9f0a('0x36')]?_0x1bb4ea['attributes']:_0x598809[_0x9f0a('0x30')];_0x1bb4ea[_0x9f0a('0x38')]=qs['sort'](_0x24bf6d[_0x9f0a('0x31')][_0x9f0a('0x39')]);_0x1bb4ea[_0x9f0a('0x3b')]=qs[_0x9f0a('0x32')](_['pick'](_0x24bf6d[_0x9f0a('0x31')],_0x598809[_0x9f0a('0x32')]));if(_0x24bf6d[_0x9f0a('0x31')][_0x9f0a('0x3a')]){_0x1bb4ea[_0x9f0a('0x3b')]=_[_0x9f0a('0x3d')](_0x1bb4ea[_0x9f0a('0x3b')],{'$or':_[_0x9f0a('0x2d')](_0x1bb4ea[_0x9f0a('0x35')],function(_0x3326e9){var _0x30e5a6={};_0x30e5a6[_0x3326e9]={'$like':'%'+_0x24bf6d[_0x9f0a('0x31')][_0x9f0a('0x3a')]+'%'};return _0x30e5a6;})});}_0x1bb4ea=_[_0x9f0a('0x3d')]({},_0x1bb4ea,_0x24bf6d[_0x9f0a('0x45')]);return _0x54dc34[_0x9f0a('0x51')](_0x1bb4ea);}})[_0x9f0a('0x27')](function(_0x3ac766){if(_0x3ac766){_0x546184=_0x3ac766[_0x9f0a('0x36')];if(!_0x24bf6d[_0x9f0a('0x31')][_0x9f0a('0x4e')](_0x9f0a('0x37'))){_0x1bb4ea['limit']=qs[_0x9f0a('0x20')](_0x24bf6d[_0x9f0a('0x31')][_0x9f0a('0x20')]);_0x1bb4ea['offset']=qs[_0x9f0a('0x1e')](_0x24bf6d[_0x9f0a('0x31')][_0x9f0a('0x1e')]);}return _0x54dc34[_0x9f0a('0x51')](_0x1bb4ea);}})['then'](function(_0xce7427){if(_0xce7427){return _0xce7427?{'count':_0x546184,'rows':_0xce7427}:null;}})[_0x9f0a('0x27')](respondWithResult(_0x3d243d,null))[_0x9f0a('0x46')](handleError(_0x3d243d,null));};exports[_0x9f0a('0x52')]=function(_0x2c7be1,_0x273171,_0x10361a){var _0x253240={};var _0x306e77={};var _0x4d625f;var _0x3333c5;return db[_0x9f0a('0x3e')][_0x9f0a('0x4a')]({'where':{'id':_0x2c7be1[_0x9f0a('0x49')]['id']}})[_0x9f0a('0x27')](handleEntityNotFound(_0x273171,null))[_0x9f0a('0x27')](function(_0x2ae659){if(_0x2ae659){_0x4d625f=_0x2ae659;_0x306e77[_0x9f0a('0x30')]=_['keys'](db[_0x9f0a('0x53')][_0x9f0a('0x4b')]);_0x306e77['query']=_[_0x9f0a('0x44')](_0x2c7be1['query']);_0x306e77['filters']=_[_0x9f0a('0x33')](_0x306e77[_0x9f0a('0x30')],_0x306e77[_0x9f0a('0x31')]);_0x253240['attributes']=_[_0x9f0a('0x33')](_0x306e77['model'],qs[_0x9f0a('0x34')](_0x2c7be1['query'][_0x9f0a('0x34')]));_0x253240['attributes']=_0x253240['attributes'][_0x9f0a('0x36')]?_0x253240[_0x9f0a('0x35')]:_0x306e77[_0x9f0a('0x30')];_0x253240[_0x9f0a('0x38')]=qs[_0x9f0a('0x39')](_0x2c7be1[_0x9f0a('0x31')][_0x9f0a('0x39')]);_0x253240[_0x9f0a('0x3b')]=qs[_0x9f0a('0x32')](_['pick'](_0x2c7be1[_0x9f0a('0x31')],_0x306e77[_0x9f0a('0x32')]));if(_0x2c7be1[_0x9f0a('0x31')]['filter']){_0x253240['where']=_[_0x9f0a('0x3d')](_0x253240['where'],{'$or':_[_0x9f0a('0x2d')](_0x253240[_0x9f0a('0x35')],function(_0x4ac7ce){var _0xe394e8={};_0xe394e8[_0x4ac7ce]={'$like':'%'+_0x2c7be1[_0x9f0a('0x31')]['filter']+'%'};return _0xe394e8;})});}_0x253240=_[_0x9f0a('0x3d')]({},_0x253240,_0x2c7be1[_0x9f0a('0x45')]);return _0x4d625f[_0x9f0a('0x52')](_0x253240);}})[_0x9f0a('0x27')](function(_0x45ddef){if(_0x45ddef){_0x3333c5=_0x45ddef['length'];if(!_0x2c7be1[_0x9f0a('0x31')][_0x9f0a('0x4e')]('nolimit')){_0x253240[_0x9f0a('0x20')]=qs[_0x9f0a('0x20')](_0x2c7be1[_0x9f0a('0x31')][_0x9f0a('0x20')]);_0x253240[_0x9f0a('0x1e')]=qs[_0x9f0a('0x1e')](_0x2c7be1['query'][_0x9f0a('0x1e')]);}return _0x4d625f['getTags'](_0x253240);}})[_0x9f0a('0x27')](function(_0x27da2e){if(_0x27da2e){return _0x27da2e?{'count':_0x3333c5,'rows':_0x27da2e}:null;}})[_0x9f0a('0x27')](respondWithResult(_0x273171,null))['catch'](handleError(_0x273171,null));};exports[_0x9f0a('0x54')]=function(_0x13b528,_0x3e290d,_0x91966b){if(_0x13b528['body']['id']){delete _0x13b528['body']['id'];}return db['FreshdeskConfiguration'][_0x9f0a('0x4a')]({'where':{'id':_0x13b528[_0x9f0a('0x49')]['id']}})[_0x9f0a('0x27')](handleEntityNotFound(_0x3e290d,null))[_0x9f0a('0x27')](function(_0x33c32e){if(_0x33c32e){return _0x33c32e[_0x9f0a('0x54')](_0x13b528[_0x9f0a('0x47')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3e290d,null))[_0x9f0a('0x46')](handleError(_0x3e290d,null));}; \ No newline at end of file +var _0x2bd5=['getFields','findOne','FreshdeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','includeAll','include','show','params','keys','rawAttributes','options','find','catch','create','body','update'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x2bd5,0xaf));var _0x52bd=function(_0x517c2e,_0x3d4bf3){_0x517c2e=_0x517c2e-0x0;var _0x5d4029=_0x2bd5[_0x517c2e];return _0x5d4029;};'use strict';var emlformat=require(_0x52bd('0x0'));var rimraf=require(_0x52bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x52bd('0x2'));var rp=require(_0x52bd('0x3'));var moment=require(_0x52bd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x52bd('0x5'));var util=require(_0x52bd('0x6'));var path=require(_0x52bd('0x7'));var sox=require('sox');var csv=require(_0x52bd('0x8'));var ejs=require(_0x52bd('0x9'));var fs=require('fs');var fs_extra=require(_0x52bd('0xa'));var _=require(_0x52bd('0xb'));var squel=require(_0x52bd('0xc'));var crypto=require(_0x52bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x52bd('0xe'));var toCsv=require(_0x52bd('0x8'));var querystring=require(_0x52bd('0xf'));var Papa=require(_0x52bd('0x10'));var Redis=require(_0x52bd('0x11'));var authService=require(_0x52bd('0x12'));var qs=require(_0x52bd('0x13'));var as=require(_0x52bd('0x14'));var hardwareService=require(_0x52bd('0x15'));var logger=require('../../config/logger')(_0x52bd('0x16'));var utils=require(_0x52bd('0x17'));var config=require(_0x52bd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x52bd('0x19'))['db'];function respondWithStatusCode(_0x2e0cb6,_0x4225b4){_0x4225b4=_0x4225b4||0xcc;return function(_0x5f0d22){if(_0x5f0d22){return _0x2e0cb6['sendStatus'](_0x4225b4);}return _0x2e0cb6[_0x52bd('0x1a')](_0x4225b4)[_0x52bd('0x1b')]();};}function respondWithResult(_0x1d922a,_0x54aae6){_0x54aae6=_0x54aae6||0xc8;return function(_0x2671db){if(_0x2671db){return _0x1d922a[_0x52bd('0x1a')](_0x54aae6)[_0x52bd('0x1c')](_0x2671db);}};}function respondWithFilteredResult(_0x5d7154,_0x14c030){return function(_0x57f1a4){if(_0x57f1a4){var _0x20d37f=typeof _0x14c030[_0x52bd('0x1d')]===_0x52bd('0x1e')&&typeof _0x14c030['limit']==='undefined';var _0x276465=_0x57f1a4[_0x52bd('0x1f')];var _0x18e3c6=_0x20d37f?0x0:_0x14c030[_0x52bd('0x1d')];var _0xa97e86=_0x20d37f?_0x57f1a4[_0x52bd('0x1f')]:_0x14c030[_0x52bd('0x1d')]+_0x14c030[_0x52bd('0x20')];var _0x28c79a;if(_0xa97e86>=_0x276465){_0xa97e86=_0x276465;_0x28c79a=0xc8;}else{_0x28c79a=0xce;}_0x5d7154[_0x52bd('0x1a')](_0x28c79a);return _0x5d7154[_0x52bd('0x21')](_0x52bd('0x22'),_0x18e3c6+'-'+_0xa97e86+'/'+_0x276465)[_0x52bd('0x1c')](_0x57f1a4);}return null;};}function patchUpdates(_0x1d0907){return function(_0x776f20){try{jsonpatch[_0x52bd('0x23')](_0x776f20,_0x1d0907,!![]);}catch(_0x366c84){return BPromise[_0x52bd('0x24')](_0x366c84);}return _0x776f20[_0x52bd('0x25')]();};}function saveUpdates(_0xb159f5,_0x4ff735){return function(_0x2f7c16){if(_0x2f7c16){return _0x2f7c16['update'](_0xb159f5)['then'](function(_0x3f365d){return _0x3f365d;});}return null;};}function removeEntity(_0x7f5b49,_0x52df29){return function(_0x5e884d){if(_0x5e884d){return _0x5e884d[_0x52bd('0x26')]()[_0x52bd('0x27')](function(){_0x7f5b49[_0x52bd('0x1a')](0xcc)[_0x52bd('0x1b')]();});}};}function handleEntityNotFound(_0x418a95,_0x2e7c7e){return function(_0x256058){if(!_0x256058){_0x418a95[_0x52bd('0x28')](0x194);}return _0x256058;};}function handleError(_0xa5c0df,_0x1f8a94){_0x1f8a94=_0x1f8a94||0x1f4;return function(_0x35dfb9){logger['error'](_0x35dfb9[_0x52bd('0x29')]);if(_0x35dfb9[_0x52bd('0x2a')]){delete _0x35dfb9[_0x52bd('0x2a')];}_0xa5c0df[_0x52bd('0x1a')](_0x1f8a94)['send'](_0x35dfb9);};}exports[_0x52bd('0x2b')]=function(_0x1985c9,_0x1c4a46){var _0x2a456d={},_0x36f3e0={},_0x4fa8f7={'count':0x0,'rows':[]};var _0x53e9c7=_[_0x52bd('0x2c')](db[_0x52bd('0x2d')]['rawAttributes'],function(_0x17f00b){return{'name':_0x17f00b[_0x52bd('0x2e')],'type':_0x17f00b[_0x52bd('0x2f')][_0x52bd('0x30')]};});_0x36f3e0[_0x52bd('0x31')]=_[_0x52bd('0x2c')](_0x53e9c7,'name');_0x36f3e0['query']=_['keys'](_0x1985c9[_0x52bd('0x32')]);_0x36f3e0[_0x52bd('0x33')]=_[_0x52bd('0x34')](_0x36f3e0['model'],_0x36f3e0[_0x52bd('0x32')]);_0x2a456d['attributes']=_[_0x52bd('0x34')](_0x36f3e0[_0x52bd('0x31')],qs[_0x52bd('0x35')](_0x1985c9[_0x52bd('0x32')]['fields']));_0x2a456d['attributes']=_0x2a456d[_0x52bd('0x36')][_0x52bd('0x37')]?_0x2a456d[_0x52bd('0x36')]:_0x36f3e0['model'];if(!_0x1985c9[_0x52bd('0x32')]['hasOwnProperty'](_0x52bd('0x38'))){_0x2a456d[_0x52bd('0x20')]=qs[_0x52bd('0x20')](_0x1985c9['query'][_0x52bd('0x20')]);_0x2a456d[_0x52bd('0x1d')]=qs[_0x52bd('0x1d')](_0x1985c9[_0x52bd('0x32')][_0x52bd('0x1d')]);}_0x2a456d[_0x52bd('0x39')]=qs[_0x52bd('0x3a')](_0x1985c9[_0x52bd('0x32')]['sort']);_0x2a456d[_0x52bd('0x3b')]=qs['filters'](_['pick'](_0x1985c9['query'],_0x36f3e0[_0x52bd('0x33')]),_0x53e9c7);if(_0x1985c9[_0x52bd('0x32')][_0x52bd('0x3c')]){_0x2a456d[_0x52bd('0x3b')]=_[_0x52bd('0x3d')](_0x2a456d[_0x52bd('0x3b')],{'$or':_['map'](_0x53e9c7,function(_0x5af04f){if(_0x5af04f['type']!=='VIRTUAL'){var _0x4bf82a={};_0x4bf82a[_0x5af04f[_0x52bd('0x2a')]]={'$like':'%'+_0x1985c9[_0x52bd('0x32')][_0x52bd('0x3c')]+'%'};return _0x4bf82a;}})});}_0x2a456d=_[_0x52bd('0x3d')]({},_0x2a456d,_0x1985c9['options']);var _0x13afc0={'where':_0x2a456d[_0x52bd('0x3b')]};return db[_0x52bd('0x2d')]['count'](_0x13afc0)[_0x52bd('0x27')](function(_0x77cad8){_0x4fa8f7[_0x52bd('0x1f')]=_0x77cad8;if(_0x1985c9[_0x52bd('0x32')][_0x52bd('0x3e')]){_0x2a456d[_0x52bd('0x3f')]=[{'all':!![]}];}return db[_0x52bd('0x2d')]['findAll'](_0x2a456d);})[_0x52bd('0x27')](function(_0xd0b966){_0x4fa8f7['rows']=_0xd0b966;return _0x4fa8f7;})[_0x52bd('0x27')](respondWithFilteredResult(_0x1c4a46,_0x2a456d))['catch'](handleError(_0x1c4a46,null));};exports[_0x52bd('0x40')]=function(_0x35278b,_0x678f4d){var _0x52e8ea={'raw':![],'where':{'id':_0x35278b[_0x52bd('0x41')]['id']}},_0x57a6ef={};_0x57a6ef[_0x52bd('0x31')]=_[_0x52bd('0x42')](db[_0x52bd('0x2d')][_0x52bd('0x43')]);_0x57a6ef[_0x52bd('0x32')]=_[_0x52bd('0x42')](_0x35278b[_0x52bd('0x32')]);_0x57a6ef[_0x52bd('0x33')]=_['intersection'](_0x57a6ef[_0x52bd('0x31')],_0x57a6ef[_0x52bd('0x32')]);_0x52e8ea[_0x52bd('0x36')]=_[_0x52bd('0x34')](_0x57a6ef[_0x52bd('0x31')],qs['fields'](_0x35278b[_0x52bd('0x32')][_0x52bd('0x35')]));_0x52e8ea[_0x52bd('0x36')]=_0x52e8ea[_0x52bd('0x36')]['length']?_0x52e8ea[_0x52bd('0x36')]:_0x57a6ef['model'];if(_0x35278b['query'][_0x52bd('0x3e')]){_0x52e8ea[_0x52bd('0x3f')]=[{'all':!![]}];}_0x52e8ea=_['merge']({},_0x52e8ea,_0x35278b[_0x52bd('0x44')]);return db[_0x52bd('0x2d')][_0x52bd('0x45')](_0x52e8ea)['then'](handleEntityNotFound(_0x678f4d,null))[_0x52bd('0x27')](respondWithResult(_0x678f4d,null))[_0x52bd('0x46')](handleError(_0x678f4d,null));};exports[_0x52bd('0x47')]=function(_0x2e96d9,_0x66635){return db[_0x52bd('0x2d')]['create'](_0x2e96d9[_0x52bd('0x48')],{})[_0x52bd('0x27')](respondWithResult(_0x66635,0xc9))[_0x52bd('0x46')](handleError(_0x66635,null));};exports[_0x52bd('0x49')]=function(_0x2a43a8,_0x4344f5){if(_0x2a43a8[_0x52bd('0x48')]['id']){delete _0x2a43a8['body']['id'];}return db[_0x52bd('0x2d')][_0x52bd('0x45')]({'where':{'id':_0x2a43a8['params']['id']}})[_0x52bd('0x27')](handleEntityNotFound(_0x4344f5,null))['then'](saveUpdates(_0x2a43a8[_0x52bd('0x48')],null))[_0x52bd('0x27')](respondWithResult(_0x4344f5,null))[_0x52bd('0x46')](handleError(_0x4344f5,null));};exports[_0x52bd('0x26')]=function(_0x5d3396,_0x20c3f8){return db[_0x52bd('0x2d')][_0x52bd('0x45')]({'where':{'id':_0x5d3396[_0x52bd('0x41')]['id']}})[_0x52bd('0x27')](handleEntityNotFound(_0x20c3f8,null))[_0x52bd('0x27')](removeEntity(_0x20c3f8,null))[_0x52bd('0x46')](handleError(_0x20c3f8,null));};exports[_0x52bd('0x4a')]=function(_0x478445,_0x4c3a46,_0x5cf299){var _0xfd4c5a={};var _0x1de52c={};var _0x1a1b1a;var _0x4d7e21;return db['FreshdeskConfiguration'][_0x52bd('0x4b')]({'where':{'id':_0x478445[_0x52bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x4c3a46,null))[_0x52bd('0x27')](function(_0xa6a2ee){if(_0xa6a2ee){_0x1a1b1a=_0xa6a2ee;_0x1de52c[_0x52bd('0x31')]=_['keys'](db[_0x52bd('0x4c')][_0x52bd('0x43')]);_0x1de52c[_0x52bd('0x32')]=_[_0x52bd('0x42')](_0x478445[_0x52bd('0x32')]);_0x1de52c[_0x52bd('0x33')]=_[_0x52bd('0x34')](_0x1de52c[_0x52bd('0x31')],_0x1de52c[_0x52bd('0x32')]);_0xfd4c5a[_0x52bd('0x36')]=_[_0x52bd('0x34')](_0x1de52c[_0x52bd('0x31')],qs['fields'](_0x478445[_0x52bd('0x32')][_0x52bd('0x35')]));_0xfd4c5a['attributes']=_0xfd4c5a['attributes']['length']?_0xfd4c5a['attributes']:_0x1de52c['model'];_0xfd4c5a['order']=qs[_0x52bd('0x3a')](_0x478445['query'][_0x52bd('0x3a')]);_0xfd4c5a['where']=qs[_0x52bd('0x33')](_[_0x52bd('0x4d')](_0x478445[_0x52bd('0x32')],_0x1de52c['filters']));if(_0x478445['query'][_0x52bd('0x3c')]){_0xfd4c5a[_0x52bd('0x3b')]=_[_0x52bd('0x3d')](_0xfd4c5a[_0x52bd('0x3b')],{'$or':_['map'](_0xfd4c5a['attributes'],function(_0x4f8a93){var _0x5b01a0={};_0x5b01a0[_0x4f8a93]={'$like':'%'+_0x478445[_0x52bd('0x32')]['filter']+'%'};return _0x5b01a0;})});}_0xfd4c5a=_['merge']({},_0xfd4c5a,_0x478445[_0x52bd('0x44')]);return _0x1a1b1a['getFields'](_0xfd4c5a);}})['then'](function(_0x54e255){if(_0x54e255){_0x4d7e21=_0x54e255[_0x52bd('0x37')];if(!_0x478445[_0x52bd('0x32')][_0x52bd('0x4e')]('nolimit')){_0xfd4c5a[_0x52bd('0x20')]=qs[_0x52bd('0x20')](_0x478445['query']['limit']);_0xfd4c5a[_0x52bd('0x1d')]=qs[_0x52bd('0x1d')](_0x478445[_0x52bd('0x32')][_0x52bd('0x1d')]);}return _0x1a1b1a[_0x52bd('0x4a')](_0xfd4c5a);}})['then'](function(_0xfdb579){if(_0xfdb579){return _0xfdb579?{'count':_0x4d7e21,'rows':_0xfdb579}:null;}})['then'](respondWithResult(_0x4c3a46,null))[_0x52bd('0x46')](handleError(_0x4c3a46,null));};exports[_0x52bd('0x4f')]=function(_0x29ed51,_0x4df74f,_0x11fe66){var _0x52a578={};var _0x31610d={};var _0x37c9be;var _0x474dfa;return db[_0x52bd('0x2d')][_0x52bd('0x4b')]({'where':{'id':_0x29ed51[_0x52bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x4df74f,null))[_0x52bd('0x27')](function(_0x45607f){if(_0x45607f){_0x37c9be=_0x45607f;_0x31610d[_0x52bd('0x31')]=_[_0x52bd('0x42')](db[_0x52bd('0x4c')]['rawAttributes']);_0x31610d[_0x52bd('0x32')]=_[_0x52bd('0x42')](_0x29ed51[_0x52bd('0x32')]);_0x31610d[_0x52bd('0x33')]=_[_0x52bd('0x34')](_0x31610d[_0x52bd('0x31')],_0x31610d[_0x52bd('0x32')]);_0x52a578[_0x52bd('0x36')]=_[_0x52bd('0x34')](_0x31610d[_0x52bd('0x31')],qs['fields'](_0x29ed51['query'][_0x52bd('0x35')]));_0x52a578[_0x52bd('0x36')]=_0x52a578['attributes']['length']?_0x52a578[_0x52bd('0x36')]:_0x31610d['model'];_0x52a578[_0x52bd('0x39')]=qs[_0x52bd('0x3a')](_0x29ed51[_0x52bd('0x32')][_0x52bd('0x3a')]);_0x52a578[_0x52bd('0x3b')]=qs[_0x52bd('0x33')](_[_0x52bd('0x4d')](_0x29ed51[_0x52bd('0x32')],_0x31610d[_0x52bd('0x33')]));if(_0x29ed51['query'][_0x52bd('0x3c')]){_0x52a578[_0x52bd('0x3b')]=_[_0x52bd('0x3d')](_0x52a578[_0x52bd('0x3b')],{'$or':_[_0x52bd('0x2c')](_0x52a578[_0x52bd('0x36')],function(_0x5ec5e7){var _0x1f2417={};_0x1f2417[_0x5ec5e7]={'$like':'%'+_0x29ed51[_0x52bd('0x32')]['filter']+'%'};return _0x1f2417;})});}_0x52a578=_[_0x52bd('0x3d')]({},_0x52a578,_0x29ed51[_0x52bd('0x44')]);return _0x37c9be[_0x52bd('0x4f')](_0x52a578);}})[_0x52bd('0x27')](function(_0x3e7e6d){if(_0x3e7e6d){_0x474dfa=_0x3e7e6d['length'];if(!_0x29ed51[_0x52bd('0x32')]['hasOwnProperty'](_0x52bd('0x38'))){_0x52a578[_0x52bd('0x20')]=qs[_0x52bd('0x20')](_0x29ed51[_0x52bd('0x32')]['limit']);_0x52a578[_0x52bd('0x1d')]=qs[_0x52bd('0x1d')](_0x29ed51[_0x52bd('0x32')][_0x52bd('0x1d')]);}return _0x37c9be[_0x52bd('0x4f')](_0x52a578);}})['then'](function(_0x57c925){if(_0x57c925){return _0x57c925?{'count':_0x474dfa,'rows':_0x57c925}:null;}})[_0x52bd('0x27')](respondWithResult(_0x4df74f,null))[_0x52bd('0x46')](handleError(_0x4df74f,null));};exports[_0x52bd('0x50')]=function(_0x234814,_0xf52c4b,_0x232663){var _0x43da1a={};var _0x2899fe={};var _0x5176c5;var _0x3723ad;return db[_0x52bd('0x2d')][_0x52bd('0x4b')]({'where':{'id':_0x234814['params']['id']}})[_0x52bd('0x27')](handleEntityNotFound(_0xf52c4b,null))[_0x52bd('0x27')](function(_0x1c90ce){if(_0x1c90ce){_0x5176c5=_0x1c90ce;_0x2899fe[_0x52bd('0x31')]=_[_0x52bd('0x42')](db[_0x52bd('0x4c')][_0x52bd('0x43')]);_0x2899fe[_0x52bd('0x32')]=_['keys'](_0x234814['query']);_0x2899fe['filters']=_[_0x52bd('0x34')](_0x2899fe[_0x52bd('0x31')],_0x2899fe['query']);_0x43da1a[_0x52bd('0x36')]=_[_0x52bd('0x34')](_0x2899fe[_0x52bd('0x31')],qs[_0x52bd('0x35')](_0x234814[_0x52bd('0x32')][_0x52bd('0x35')]));_0x43da1a[_0x52bd('0x36')]=_0x43da1a[_0x52bd('0x36')][_0x52bd('0x37')]?_0x43da1a[_0x52bd('0x36')]:_0x2899fe['model'];_0x43da1a[_0x52bd('0x39')]=qs[_0x52bd('0x3a')](_0x234814[_0x52bd('0x32')][_0x52bd('0x3a')]);_0x43da1a[_0x52bd('0x3b')]=qs[_0x52bd('0x33')](_[_0x52bd('0x4d')](_0x234814[_0x52bd('0x32')],_0x2899fe[_0x52bd('0x33')]));if(_0x234814[_0x52bd('0x32')]['filter']){_0x43da1a['where']=_['merge'](_0x43da1a[_0x52bd('0x3b')],{'$or':_[_0x52bd('0x2c')](_0x43da1a[_0x52bd('0x36')],function(_0x1201d1){var _0x5518f1={};_0x5518f1[_0x1201d1]={'$like':'%'+_0x234814['query']['filter']+'%'};return _0x5518f1;})});}_0x43da1a=_[_0x52bd('0x3d')]({},_0x43da1a,_0x234814['options']);return _0x5176c5[_0x52bd('0x50')](_0x43da1a);}})[_0x52bd('0x27')](function(_0x2d21ef){if(_0x2d21ef){_0x3723ad=_0x2d21ef['length'];if(!_0x234814[_0x52bd('0x32')][_0x52bd('0x4e')](_0x52bd('0x38'))){_0x43da1a['limit']=qs['limit'](_0x234814[_0x52bd('0x32')][_0x52bd('0x20')]);_0x43da1a[_0x52bd('0x1d')]=qs[_0x52bd('0x1d')](_0x234814['query'][_0x52bd('0x1d')]);}return _0x5176c5[_0x52bd('0x50')](_0x43da1a);}})[_0x52bd('0x27')](function(_0x23bc5c){if(_0x23bc5c){return _0x23bc5c?{'count':_0x3723ad,'rows':_0x23bc5c}:null;}})[_0x52bd('0x27')](respondWithResult(_0xf52c4b,null))['catch'](handleError(_0xf52c4b,null));};exports['getTags']=function(_0x370a7a,_0x556a46,_0x2e34cf){var _0x1d0096={};var _0x1379f2={};var _0x3fd9ce;var _0xc4b946;return db['FreshdeskConfiguration'][_0x52bd('0x4b')]({'where':{'id':_0x370a7a[_0x52bd('0x41')]['id']}})[_0x52bd('0x27')](handleEntityNotFound(_0x556a46,null))['then'](function(_0x279377){if(_0x279377){_0x3fd9ce=_0x279377;_0x1379f2[_0x52bd('0x31')]=_[_0x52bd('0x42')](db['Tag'][_0x52bd('0x43')]);_0x1379f2[_0x52bd('0x32')]=_[_0x52bd('0x42')](_0x370a7a['query']);_0x1379f2['filters']=_['intersection'](_0x1379f2[_0x52bd('0x31')],_0x1379f2[_0x52bd('0x32')]);_0x1d0096[_0x52bd('0x36')]=_[_0x52bd('0x34')](_0x1379f2[_0x52bd('0x31')],qs[_0x52bd('0x35')](_0x370a7a[_0x52bd('0x32')][_0x52bd('0x35')]));_0x1d0096['attributes']=_0x1d0096[_0x52bd('0x36')][_0x52bd('0x37')]?_0x1d0096[_0x52bd('0x36')]:_0x1379f2[_0x52bd('0x31')];_0x1d0096[_0x52bd('0x39')]=qs[_0x52bd('0x3a')](_0x370a7a[_0x52bd('0x32')][_0x52bd('0x3a')]);_0x1d0096['where']=qs[_0x52bd('0x33')](_['pick'](_0x370a7a[_0x52bd('0x32')],_0x1379f2[_0x52bd('0x33')]));if(_0x370a7a[_0x52bd('0x32')]['filter']){_0x1d0096['where']=_[_0x52bd('0x3d')](_0x1d0096[_0x52bd('0x3b')],{'$or':_[_0x52bd('0x2c')](_0x1d0096[_0x52bd('0x36')],function(_0x23f9f4){var _0x5d0c12={};_0x5d0c12[_0x23f9f4]={'$like':'%'+_0x370a7a[_0x52bd('0x32')]['filter']+'%'};return _0x5d0c12;})});}_0x1d0096=_[_0x52bd('0x3d')]({},_0x1d0096,_0x370a7a[_0x52bd('0x44')]);return _0x3fd9ce[_0x52bd('0x51')](_0x1d0096);}})[_0x52bd('0x27')](function(_0x273005){if(_0x273005){_0xc4b946=_0x273005[_0x52bd('0x37')];if(!_0x370a7a[_0x52bd('0x32')]['hasOwnProperty'](_0x52bd('0x38'))){_0x1d0096[_0x52bd('0x20')]=qs[_0x52bd('0x20')](_0x370a7a[_0x52bd('0x32')][_0x52bd('0x20')]);_0x1d0096[_0x52bd('0x1d')]=qs[_0x52bd('0x1d')](_0x370a7a[_0x52bd('0x32')][_0x52bd('0x1d')]);}return _0x3fd9ce[_0x52bd('0x51')](_0x1d0096);}})[_0x52bd('0x27')](function(_0x4229ee){if(_0x4229ee){return _0x4229ee?{'count':_0xc4b946,'rows':_0x4229ee}:null;}})[_0x52bd('0x27')](respondWithResult(_0x556a46,null))[_0x52bd('0x46')](handleError(_0x556a46,null));};exports['setTags']=function(_0x359982,_0x3b536a,_0x124626){if(_0x359982[_0x52bd('0x48')]['id']){delete _0x359982[_0x52bd('0x48')]['id'];}return db[_0x52bd('0x2d')][_0x52bd('0x4b')]({'where':{'id':_0x359982[_0x52bd('0x41')]['id']}})[_0x52bd('0x27')](handleEntityNotFound(_0x3b536a,null))['then'](function(_0x1f5de4){if(_0x1f5de4){return _0x1f5de4['setTags'](_0x359982[_0x52bd('0x48')][_0x52bd('0x52')]||[]);}return null;})['then'](respondWithResult(_0x3b536a,null))['catch'](handleError(_0x3b536a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 4f870e9..9b1ad3b 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 _0x875f=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x875f,0xbb));var _0xf875=function(_0x11a79f,_0x16da3a){_0x11a79f=_0x11a79f-0x0;var _0x997c8d=_0x875f[_0x11a79f];return _0x997c8d;};'use strict';var _=require(_0xf875('0x0'));var util=require(_0xf875('0x1'));var logger=require(_0xf875('0x2'))(_0xf875('0x3'));var moment=require(_0xf875('0x4'));var BPromise=require(_0xf875('0x5'));var rp=require(_0xf875('0x6'));var fs=require('fs');var path=require(_0xf875('0x7'));var rimraf=require(_0xf875('0x8'));var config=require(_0xf875('0x9'));var attributes=require(_0xf875('0xa'));module[_0xf875('0xb')]=function(_0x45f56b,_0x2f9807){return _0x45f56b[_0xf875('0xc')](_0xf875('0xd'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ff1=['api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x23d053,_0x14efb6){var _0x15ae48=function(_0x6f44da){while(--_0x6f44da){_0x23d053['push'](_0x23d053['shift']());}};_0x15ae48(++_0x14efb6);}(_0x1ff1,0xc5));var _0x11ff=function(_0xd57c80,_0x463a28){_0xd57c80=_0xd57c80-0x0;var _0x1a4cb5=_0x1ff1[_0xd57c80];return _0x1a4cb5;};'use strict';var _=require(_0x11ff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x11ff('0x1'));var moment=require(_0x11ff('0x2'));var BPromise=require(_0x11ff('0x3'));var rp=require(_0x11ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x11ff('0x5'));var attributes=require(_0x11ff('0x6'));module['exports']=function(_0x210f80,_0x4606a5){return _0x210f80['define'](_0x11ff('0x7'),attributes,{'tableName':_0x11ff('0x8'),'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 1d4b20c..c4aeea7 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 _0x7760=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x7760,0x153));var _0x0776=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x7760[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x0776('0x0'));var util=require(_0x0776('0x1'));var moment=require('moment');var BPromise=require(_0x0776('0x2'));var rs=require(_0x0776('0x3'));var fs=require('fs');var Redis=require(_0x0776('0x4'));var db=require(_0x0776('0x5'))['db'];var utils=require(_0x0776('0x6'));var logger=require(_0x0776('0x7'))(_0x0776('0x8'));var config=require(_0x0776('0x9'));var jayson=require(_0x0776('0xa'));var client=jayson['client'][_0x0776('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c4c7e,_0x121773,_0x40a02d){return new BPromise(function(_0x1e12c1,_0x4555e7){return client[_0x0776('0xc')](_0x1c4c7e,_0x40a02d)[_0x0776('0xd')](function(_0xaa9a87){logger['info'](_0x0776('0xe'),_0x121773,_0x0776('0xf'));logger['debug'](_0x0776('0x10'),_0x121773,_0x0776('0xf'),JSON[_0x0776('0x11')](_0xaa9a87));if(_0xaa9a87[_0x0776('0x12')]){if(_0xaa9a87['error'][_0x0776('0x13')]===0x1f4){logger[_0x0776('0x12')](_0x0776('0xe'),_0x121773,_0xaa9a87[_0x0776('0x12')][_0x0776('0x14')]);return _0x4555e7(_0xaa9a87[_0x0776('0x12')]['message']);}logger['error'](_0x0776('0xe'),_0x121773,_0xaa9a87['error'][_0x0776('0x14')]);return _0x1e12c1(_0xaa9a87[_0x0776('0x12')][_0x0776('0x14')]);}else{logger[_0x0776('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x121773,_0x0776('0xf'));_0x1e12c1(_0xaa9a87['result'][_0x0776('0x14')]);}})[_0x0776('0x16')](function(_0x3409ed){logger[_0x0776('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x121773,_0x3409ed);_0x4555e7(_0x3409ed);});});} \ No newline at end of file +var _0x217a=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result'];(function(_0x206775,_0x4d6879){var _0x2617a6=function(_0x50d4a1){while(--_0x50d4a1){_0x206775['push'](_0x206775['shift']());}};_0x2617a6(++_0x4d6879);}(_0x217a,0x9a));var _0xa217=function(_0xeed874,_0x2683ab){_0xeed874=_0xeed874-0x0;var _0x407398=_0x217a[_0xeed874];return _0x407398;};'use strict';var _=require(_0xa217('0x0'));var util=require(_0xa217('0x1'));var moment=require(_0xa217('0x2'));var BPromise=require(_0xa217('0x3'));var rs=require(_0xa217('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa217('0x5'))['db'];var utils=require(_0xa217('0x6'));var logger=require(_0xa217('0x7'))('rpc');var config=require(_0xa217('0x8'));var jayson=require(_0xa217('0x9'));var client=jayson[_0xa217('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x79e51e,_0x4cd52c,_0xd4dfcd){return new BPromise(function(_0x1da10f,_0x17bc49){return client['request'](_0x79e51e,_0xd4dfcd)[_0xa217('0xb')](function(_0x368f4){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4cd52c,_0xa217('0xc'));logger[_0xa217('0xd')](_0xa217('0xe'),_0x4cd52c,_0xa217('0xc'),JSON[_0xa217('0xf')](_0x368f4));if(_0x368f4[_0xa217('0x10')]){if(_0x368f4[_0xa217('0x10')][_0xa217('0x11')]===0x1f4){logger[_0xa217('0x10')](_0xa217('0x12'),_0x4cd52c,_0x368f4[_0xa217('0x10')]['message']);return _0x17bc49(_0x368f4[_0xa217('0x10')][_0xa217('0x13')]);}logger[_0xa217('0x10')](_0xa217('0x12'),_0x4cd52c,_0x368f4['error']['message']);return _0x1da10f(_0x368f4[_0xa217('0x10')][_0xa217('0x13')]);}else{logger[_0xa217('0x14')](_0xa217('0x12'),_0x4cd52c,_0xa217('0xc'));_0x1da10f(_0x368f4[_0xa217('0x15')][_0xa217('0x13')]);}})['catch'](function(_0x4a851f){logger[_0xa217('0x10')](_0xa217('0x12'),_0x4cd52c,_0x4a851f);_0x17bc49(_0x4a851f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 95fa055..f41da13 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 _0x4e61=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','exports'];(function(_0x77b868,_0x45ea4b){var _0x1f54ea=function(_0x3cb8a6){while(--_0x3cb8a6){_0x77b868['push'](_0x77b868['shift']());}};_0x1f54ea(++_0x45ea4b);}(_0x4e61,0x110));var _0x14e6=function(_0x4ed17b,_0x2b1745){_0x4ed17b=_0x4ed17b-0x0;var _0x24b248=_0x4e61[_0x4ed17b];return _0x24b248;};'use strict';var multer=require('multer');var util=require(_0x14e6('0x0'));var path=require(_0x14e6('0x1'));var timeout=require(_0x14e6('0x2'));var express=require('express');var router=express[_0x14e6('0x3')]();var fs_extra=require(_0x14e6('0x4'));var auth=require(_0x14e6('0x5'));var interaction=require(_0x14e6('0x6'));var config=require(_0x14e6('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x14e6('0x8')]('/',auth[_0x14e6('0x9')](),controller[_0x14e6('0xa')]);router[_0x14e6('0x8')](_0x14e6('0xb'),auth[_0x14e6('0x9')](),controller['show']);router[_0x14e6('0xc')]('/',auth['isAuthenticated'](),controller[_0x14e6('0xd')]);router['put'](_0x14e6('0xb'),auth[_0x14e6('0x9')](),controller[_0x14e6('0xe')]);router['delete'](_0x14e6('0xb'),auth[_0x14e6('0x9')](),controller['destroy']);module[_0x14e6('0xf')]=router; \ No newline at end of file +var _0x9878=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated','create','put','/:id'];(function(_0x173f79,_0x3b2224){var _0x59ce8c=function(_0x4f317a){while(--_0x4f317a){_0x173f79['push'](_0x173f79['shift']());}};_0x59ce8c(++_0x3b2224);}(_0x9878,0x1a4));var _0x8987=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9878[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8987('0x0'));var util=require(_0x8987('0x1'));var path=require('path');var timeout=require(_0x8987('0x2'));var express=require(_0x8987('0x3'));var router=express[_0x8987('0x4')]();var fs_extra=require(_0x8987('0x5'));var auth=require(_0x8987('0x6'));var interaction=require(_0x8987('0x7'));var config=require(_0x8987('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x8987('0x9')]('/',auth['isAuthenticated'](),controller[_0x8987('0xa')]);router[_0x8987('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8987('0xb')]);router[_0x8987('0xc')]('/',auth[_0x8987('0xd')](),controller[_0x8987('0xe')]);router[_0x8987('0xf')](_0x8987('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x8987('0x11')]('/:id',auth[_0x8987('0xd')](),controller['destroy']);module[_0x8987('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 87bcc84..e9a67af 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 _0x4016=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x90ec2a,_0x59ee6e){var _0x29f242=function(_0x114598){while(--_0x114598){_0x90ec2a['push'](_0x90ec2a['shift']());}};_0x29f242(++_0x59ee6e);}(_0x4016,0x64));var _0x6401=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4016[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x6401('0x0'));module[_0x6401('0x1')]={'type':{'type':Sequelize[_0x6401('0x2')](_0x6401('0x3'),_0x6401('0x4'),_0x6401('0x5'),_0x6401('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x6401('0x7')]},'key':{'type':Sequelize[_0x6401('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6401('0x3'),_0x6401('0x4'),_0x6401('0x5'))},'keyContent':{'type':Sequelize[_0x6401('0x7')]},'idField':{'type':Sequelize[_0x6401('0x7')]},'nameField':{'type':Sequelize[_0x6401('0x7')]},'customField':{'type':Sequelize[_0x6401('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6401('0x7')]}}; \ No newline at end of file +var _0xd322=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1c9326,_0x4f65bd){var _0x33e2e4=function(_0x34bceb){while(--_0x34bceb){_0x1c9326['push'](_0x1c9326['shift']());}};_0x33e2e4(++_0x4f65bd);}(_0xd322,0x7e));var _0x2d32=function(_0x1b28de,_0x466873){_0x1b28de=_0x1b28de-0x0;var _0x3fe976=_0xd322[_0x1b28de];return _0x3fe976;};'use strict';var Sequelize=require(_0x2d32('0x0'));module[_0x2d32('0x1')]={'type':{'type':Sequelize[_0x2d32('0x2')](_0x2d32('0x3'),_0x2d32('0x4'),_0x2d32('0x5'),_0x2d32('0x6'),_0x2d32('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2d32('0x8')]},'key':{'type':Sequelize[_0x2d32('0x8')]},'keyType':{'type':Sequelize[_0x2d32('0x2')](_0x2d32('0x3'),'variable',_0x2d32('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2d32('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d32('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 915ae82..e6c4a37 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 _0x3eec=['include','findAll','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','includeAll'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x4feaa3,_0x425aa0){_0x4feaa3=_0x4feaa3-0x0;var _0x475704=_0x3eec[_0x4feaa3];return _0x475704;};'use strict';var emlformat=require(_0xc3ee('0x0'));var rimraf=require(_0xc3ee('0x1'));var zipdir=require(_0xc3ee('0x2'));var jsonpatch=require(_0xc3ee('0x3'));var rp=require('request-promise');var moment=require(_0xc3ee('0x4'));var BPromise=require(_0xc3ee('0x5'));var Mustache=require(_0xc3ee('0x6'));var util=require(_0xc3ee('0x7'));var path=require(_0xc3ee('0x8'));var sox=require(_0xc3ee('0x9'));var csv=require('to-csv');var ejs=require(_0xc3ee('0xa'));var fs=require('fs');var fs_extra=require(_0xc3ee('0xb'));var _=require(_0xc3ee('0xc'));var squel=require(_0xc3ee('0xd'));var crypto=require(_0xc3ee('0xe'));var jsforce=require(_0xc3ee('0xf'));var deskjs=require(_0xc3ee('0x10'));var toCsv=require(_0xc3ee('0x11'));var querystring=require(_0xc3ee('0x12'));var Papa=require(_0xc3ee('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc3ee('0x14'));var as=require(_0xc3ee('0x15'));var hardwareService=require(_0xc3ee('0x16'));var logger=require(_0xc3ee('0x17'))('api');var utils=require(_0xc3ee('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc3ee('0x19'));var db=require(_0xc3ee('0x1a'))['db'];function respondWithStatusCode(_0x4beb01,_0x5f2c3a){_0x5f2c3a=_0x5f2c3a||0xcc;return function(_0x2eb82e){if(_0x2eb82e){return _0x4beb01['sendStatus'](_0x5f2c3a);}return _0x4beb01[_0xc3ee('0x1b')](_0x5f2c3a)['end']();};}function respondWithResult(_0x19feb3,_0x58ebe7){_0x58ebe7=_0x58ebe7||0xc8;return function(_0x3d669d){if(_0x3d669d){return _0x19feb3[_0xc3ee('0x1b')](_0x58ebe7)[_0xc3ee('0x1c')](_0x3d669d);}};}function respondWithFilteredResult(_0x664bad,_0x476f8f){return function(_0xf63359){if(_0xf63359){var _0x277e11=typeof _0x476f8f['offset']===_0xc3ee('0x1d')&&typeof _0x476f8f['limit']===_0xc3ee('0x1d');var _0x1bf49a=_0xf63359[_0xc3ee('0x1e')];var _0x219db0=_0x277e11?0x0:_0x476f8f[_0xc3ee('0x1f')];var _0x3acb0c=_0x277e11?_0xf63359[_0xc3ee('0x1e')]:_0x476f8f[_0xc3ee('0x1f')]+_0x476f8f[_0xc3ee('0x20')];var _0x202a9a;if(_0x3acb0c>=_0x1bf49a){_0x3acb0c=_0x1bf49a;_0x202a9a=0xc8;}else{_0x202a9a=0xce;}_0x664bad[_0xc3ee('0x1b')](_0x202a9a);return _0x664bad[_0xc3ee('0x21')](_0xc3ee('0x22'),_0x219db0+'-'+_0x3acb0c+'/'+_0x1bf49a)[_0xc3ee('0x1c')](_0xf63359);}return null;};}function patchUpdates(_0x3e7224){return function(_0x46a8c9){try{jsonpatch[_0xc3ee('0x23')](_0x46a8c9,_0x3e7224,!![]);}catch(_0x30df3a){return BPromise[_0xc3ee('0x24')](_0x30df3a);}return _0x46a8c9[_0xc3ee('0x25')]();};}function saveUpdates(_0x11778f,_0x493fea){return function(_0x4d672e){if(_0x4d672e){return _0x4d672e[_0xc3ee('0x26')](_0x11778f)[_0xc3ee('0x27')](function(_0x3b8f75){return _0x3b8f75;});}return null;};}function removeEntity(_0x464ffc,_0x28bfeb){return function(_0x238df7){if(_0x238df7){return _0x238df7['destroy']()[_0xc3ee('0x27')](function(){_0x464ffc[_0xc3ee('0x1b')](0xcc)[_0xc3ee('0x28')]();});}};}function handleEntityNotFound(_0xfd03bd,_0x5c366e){return function(_0x525ae5){if(!_0x525ae5){_0xfd03bd['sendStatus'](0x194);}return _0x525ae5;};}function handleError(_0x383bd9,_0x28522d){_0x28522d=_0x28522d||0x1f4;return function(_0x3d8c79){logger[_0xc3ee('0x29')](_0x3d8c79[_0xc3ee('0x2a')]);if(_0x3d8c79['name']){delete _0x3d8c79['name'];}_0x383bd9['status'](_0x28522d)[_0xc3ee('0x2b')](_0x3d8c79);};}exports[_0xc3ee('0x2c')]=function(_0x44678b,_0x2fba96){var _0x2cdd85={},_0x50ffaa={},_0x13f30d={'count':0x0,'rows':[]};var _0xfa3111=_[_0xc3ee('0x2d')](db[_0xc3ee('0x2e')][_0xc3ee('0x2f')],function(_0x8bbe1e){return{'name':_0x8bbe1e[_0xc3ee('0x30')],'type':_0x8bbe1e['type'][_0xc3ee('0x31')]};});_0x50ffaa[_0xc3ee('0x32')]=_[_0xc3ee('0x2d')](_0xfa3111,'name');_0x50ffaa[_0xc3ee('0x33')]=_[_0xc3ee('0x34')](_0x44678b[_0xc3ee('0x33')]);_0x50ffaa[_0xc3ee('0x35')]=_[_0xc3ee('0x36')](_0x50ffaa[_0xc3ee('0x32')],_0x50ffaa[_0xc3ee('0x33')]);_0x2cdd85['attributes']=_[_0xc3ee('0x36')](_0x50ffaa['model'],qs[_0xc3ee('0x37')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x37')]));_0x2cdd85[_0xc3ee('0x38')]=_0x2cdd85[_0xc3ee('0x38')][_0xc3ee('0x39')]?_0x2cdd85['attributes']:_0x50ffaa[_0xc3ee('0x32')];if(!_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x3a')](_0xc3ee('0x3b'))){_0x2cdd85[_0xc3ee('0x20')]=qs[_0xc3ee('0x20')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x20')]);_0x2cdd85[_0xc3ee('0x1f')]=qs[_0xc3ee('0x1f')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x1f')]);}_0x2cdd85[_0xc3ee('0x3c')]=qs[_0xc3ee('0x3d')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x3d')]);_0x2cdd85[_0xc3ee('0x3e')]=qs[_0xc3ee('0x35')](_[_0xc3ee('0x3f')](_0x44678b[_0xc3ee('0x33')],_0x50ffaa[_0xc3ee('0x35')]),_0xfa3111);if(_0x44678b['query'][_0xc3ee('0x40')]){_0x2cdd85['where']=_[_0xc3ee('0x41')](_0x2cdd85[_0xc3ee('0x3e')],{'$or':_[_0xc3ee('0x2d')](_0xfa3111,function(_0x1544f3){if(_0x1544f3[_0xc3ee('0x42')]!==_0xc3ee('0x43')){var _0x5e7dcd={};_0x5e7dcd[_0x1544f3[_0xc3ee('0x44')]]={'$like':'%'+_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x40')]+'%'};return _0x5e7dcd;}})});}_0x2cdd85=_['merge']({},_0x2cdd85,_0x44678b[_0xc3ee('0x45')]);var _0x105ecc={'where':_0x2cdd85[_0xc3ee('0x3e')]};return db[_0xc3ee('0x2e')][_0xc3ee('0x1e')](_0x105ecc)[_0xc3ee('0x27')](function(_0x381e68){_0x13f30d[_0xc3ee('0x1e')]=_0x381e68;if(_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x46')]){_0x2cdd85[_0xc3ee('0x47')]=[{'all':!![]}];}return db['FreshdeskField'][_0xc3ee('0x48')](_0x2cdd85);})[_0xc3ee('0x27')](function(_0x4a89b7){_0x13f30d['rows']=_0x4a89b7;return _0x13f30d;})[_0xc3ee('0x27')](respondWithFilteredResult(_0x2fba96,_0x2cdd85))[_0xc3ee('0x49')](handleError(_0x2fba96,null));};exports[_0xc3ee('0x4a')]=function(_0x51c70e,_0x28b167){var _0x92a306={'raw':!![],'where':{'id':_0x51c70e[_0xc3ee('0x4b')]['id']}},_0x112e77={};_0x112e77[_0xc3ee('0x32')]=_[_0xc3ee('0x34')](db[_0xc3ee('0x2e')][_0xc3ee('0x2f')]);_0x112e77[_0xc3ee('0x33')]=_[_0xc3ee('0x34')](_0x51c70e[_0xc3ee('0x33')]);_0x112e77[_0xc3ee('0x35')]=_[_0xc3ee('0x36')](_0x112e77[_0xc3ee('0x32')],_0x112e77['query']);_0x92a306[_0xc3ee('0x38')]=_['intersection'](_0x112e77['model'],qs[_0xc3ee('0x37')](_0x51c70e[_0xc3ee('0x33')]['fields']));_0x92a306[_0xc3ee('0x38')]=_0x92a306[_0xc3ee('0x38')]['length']?_0x92a306[_0xc3ee('0x38')]:_0x112e77['model'];if(_0x51c70e[_0xc3ee('0x33')]['includeAll']){_0x92a306[_0xc3ee('0x47')]=[{'all':!![]}];}_0x92a306=_[_0xc3ee('0x41')]({},_0x92a306,_0x51c70e['options']);return db['FreshdeskField']['find'](_0x92a306)[_0xc3ee('0x27')](handleEntityNotFound(_0x28b167,null))[_0xc3ee('0x27')](respondWithResult(_0x28b167,null))[_0xc3ee('0x49')](handleError(_0x28b167,null));};exports[_0xc3ee('0x4c')]=function(_0x972860,_0x5b5f5c){return db['FreshdeskField'][_0xc3ee('0x4c')](_0x972860[_0xc3ee('0x4d')],{})['then'](respondWithResult(_0x5b5f5c,0xc9))[_0xc3ee('0x49')](handleError(_0x5b5f5c,null));};exports['update']=function(_0x60e36a,_0x5d0017){if(_0x60e36a[_0xc3ee('0x4d')]['id']){delete _0x60e36a[_0xc3ee('0x4d')]['id'];}return db[_0xc3ee('0x2e')][_0xc3ee('0x4e')]({'where':{'id':_0x60e36a[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x5d0017,null))[_0xc3ee('0x27')](saveUpdates(_0x60e36a['body'],null))[_0xc3ee('0x27')](respondWithResult(_0x5d0017,null))[_0xc3ee('0x49')](handleError(_0x5d0017,null));};exports[_0xc3ee('0x4f')]=function(_0x237aa8,_0x47d12c){return db[_0xc3ee('0x2e')][_0xc3ee('0x4e')]({'where':{'id':_0x237aa8[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x47d12c,null))[_0xc3ee('0x27')](removeEntity(_0x47d12c,null))[_0xc3ee('0x49')](handleError(_0x47d12c,null));}; \ No newline at end of file +var _0x6c76=['pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','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','offset','undefined','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskField','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c76,0x184));var _0x66c7=function(_0x2a73a7,_0x37029e){_0x2a73a7=_0x2a73a7-0x0;var _0x2e2268=_0x6c76[_0x2a73a7];return _0x2e2268;};'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'];function respondWithStatusCode(_0x5176a3,_0x18c309){_0x18c309=_0x18c309||0xcc;return function(_0x760e36){if(_0x760e36){return _0x5176a3[_0x66c7('0x17')](_0x18c309);}return _0x5176a3[_0x66c7('0x18')](_0x18c309)[_0x66c7('0x19')]();};}function respondWithResult(_0x1e91d1,_0x618bd7){_0x618bd7=_0x618bd7||0xc8;return function(_0xf3b04){if(_0xf3b04){return _0x1e91d1[_0x66c7('0x18')](_0x618bd7)['json'](_0xf3b04);}};}function respondWithFilteredResult(_0x110f6d,_0x4dd902){return function(_0x208010){if(_0x208010){var _0x39f951=typeof _0x4dd902[_0x66c7('0x1a')]===_0x66c7('0x1b')&&typeof _0x4dd902[_0x66c7('0x1c')]==='undefined';var _0x5cf913=_0x208010['count'];var _0x5129f6=_0x39f951?0x0:_0x4dd902[_0x66c7('0x1a')];var _0x19f29d=_0x39f951?_0x208010['count']:_0x4dd902['offset']+_0x4dd902[_0x66c7('0x1c')];var _0x9b65cf;if(_0x19f29d>=_0x5cf913){_0x19f29d=_0x5cf913;_0x9b65cf=0xc8;}else{_0x9b65cf=0xce;}_0x110f6d[_0x66c7('0x18')](_0x9b65cf);return _0x110f6d[_0x66c7('0x1d')]('Content-Range',_0x5129f6+'-'+_0x19f29d+'/'+_0x5cf913)['json'](_0x208010);}return null;};}function patchUpdates(_0x1853b2){return function(_0x237177){try{jsonpatch[_0x66c7('0x1e')](_0x237177,_0x1853b2,!![]);}catch(_0x1c43c4){return BPromise[_0x66c7('0x1f')](_0x1c43c4);}return _0x237177[_0x66c7('0x20')]();};}function saveUpdates(_0x4804cf,_0x4ddbd2){return function(_0x366e9b){if(_0x366e9b){return _0x366e9b['update'](_0x4804cf)[_0x66c7('0x21')](function(_0x8b96b1){return _0x8b96b1;});}return null;};}function removeEntity(_0x44bdef,_0x1fc9d3){return function(_0x5bfaf6){if(_0x5bfaf6){return _0x5bfaf6[_0x66c7('0x22')]()[_0x66c7('0x21')](function(){_0x44bdef['status'](0xcc)[_0x66c7('0x19')]();});}};}function handleEntityNotFound(_0x11a6b9,_0x2bb86d){return function(_0x2ef6a2){if(!_0x2ef6a2){_0x11a6b9[_0x66c7('0x17')](0x194);}return _0x2ef6a2;};}function handleError(_0x54d45d,_0x5bc4e6){_0x5bc4e6=_0x5bc4e6||0x1f4;return function(_0x4e514a){logger[_0x66c7('0x23')](_0x4e514a[_0x66c7('0x24')]);if(_0x4e514a['name']){delete _0x4e514a[_0x66c7('0x25')];}_0x54d45d[_0x66c7('0x18')](_0x5bc4e6)[_0x66c7('0x26')](_0x4e514a);};}exports[_0x66c7('0x27')]=function(_0x36a830,_0x27be81){var _0x570f0d={},_0xccefb2={},_0x2e2560={'count':0x0,'rows':[]};var _0xc4b2bf=_[_0x66c7('0x28')](db[_0x66c7('0x29')]['rawAttributes'],function(_0x263b48){return{'name':_0x263b48['fieldName'],'type':_0x263b48[_0x66c7('0x2a')]['key']};});_0xccefb2[_0x66c7('0x2b')]=_[_0x66c7('0x28')](_0xc4b2bf,_0x66c7('0x25'));_0xccefb2[_0x66c7('0x2c')]=_[_0x66c7('0x2d')](_0x36a830[_0x66c7('0x2c')]);_0xccefb2['filters']=_['intersection'](_0xccefb2[_0x66c7('0x2b')],_0xccefb2[_0x66c7('0x2c')]);_0x570f0d[_0x66c7('0x2e')]=_[_0x66c7('0x2f')](_0xccefb2[_0x66c7('0x2b')],qs[_0x66c7('0x30')](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x30')]));_0x570f0d[_0x66c7('0x2e')]=_0x570f0d[_0x66c7('0x2e')][_0x66c7('0x31')]?_0x570f0d[_0x66c7('0x2e')]:_0xccefb2['model'];if(!_0x36a830['query'][_0x66c7('0x32')](_0x66c7('0x33'))){_0x570f0d[_0x66c7('0x1c')]=qs[_0x66c7('0x1c')](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x1c')]);_0x570f0d[_0x66c7('0x1a')]=qs['offset'](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x1a')]);}_0x570f0d[_0x66c7('0x34')]=qs[_0x66c7('0x35')](_0x36a830[_0x66c7('0x2c')][_0x66c7('0x35')]);_0x570f0d[_0x66c7('0x36')]=qs[_0x66c7('0x37')](_[_0x66c7('0x38')](_0x36a830[_0x66c7('0x2c')],_0xccefb2[_0x66c7('0x37')]),_0xc4b2bf);if(_0x36a830['query']['filter']){_0x570f0d[_0x66c7('0x36')]=_[_0x66c7('0x39')](_0x570f0d[_0x66c7('0x36')],{'$or':_['map'](_0xc4b2bf,function(_0x4d46dd){if(_0x4d46dd[_0x66c7('0x2a')]!==_0x66c7('0x3a')){var _0x501771={};_0x501771[_0x4d46dd[_0x66c7('0x25')]]={'$like':'%'+_0x36a830[_0x66c7('0x2c')][_0x66c7('0x3b')]+'%'};return _0x501771;}})});}_0x570f0d=_['merge']({},_0x570f0d,_0x36a830[_0x66c7('0x3c')]);var _0x16b754={'where':_0x570f0d[_0x66c7('0x36')]};return db[_0x66c7('0x29')][_0x66c7('0x3d')](_0x16b754)[_0x66c7('0x21')](function(_0x21deb3){_0x2e2560[_0x66c7('0x3d')]=_0x21deb3;if(_0x36a830[_0x66c7('0x2c')]['includeAll']){_0x570f0d[_0x66c7('0x3e')]=[{'all':!![]}];}return db[_0x66c7('0x29')][_0x66c7('0x3f')](_0x570f0d);})[_0x66c7('0x21')](function(_0x3f169e){_0x2e2560[_0x66c7('0x40')]=_0x3f169e;return _0x2e2560;})[_0x66c7('0x21')](respondWithFilteredResult(_0x27be81,_0x570f0d))[_0x66c7('0x41')](handleError(_0x27be81,null));};exports[_0x66c7('0x42')]=function(_0x3d371a,_0x513317){var _0x5bb5fc={'raw':!![],'where':{'id':_0x3d371a[_0x66c7('0x43')]['id']}},_0x528f5c={};_0x528f5c[_0x66c7('0x2b')]=_['keys'](db['FreshdeskField'][_0x66c7('0x44')]);_0x528f5c[_0x66c7('0x2c')]=_[_0x66c7('0x2d')](_0x3d371a[_0x66c7('0x2c')]);_0x528f5c[_0x66c7('0x37')]=_['intersection'](_0x528f5c[_0x66c7('0x2b')],_0x528f5c['query']);_0x5bb5fc['attributes']=_[_0x66c7('0x2f')](_0x528f5c[_0x66c7('0x2b')],qs[_0x66c7('0x30')](_0x3d371a[_0x66c7('0x2c')]['fields']));_0x5bb5fc['attributes']=_0x5bb5fc[_0x66c7('0x2e')]['length']?_0x5bb5fc['attributes']:_0x528f5c[_0x66c7('0x2b')];if(_0x3d371a[_0x66c7('0x2c')][_0x66c7('0x45')]){_0x5bb5fc[_0x66c7('0x3e')]=[{'all':!![]}];}_0x5bb5fc=_['merge']({},_0x5bb5fc,_0x3d371a[_0x66c7('0x3c')]);return db[_0x66c7('0x29')][_0x66c7('0x46')](_0x5bb5fc)['then'](handleEntityNotFound(_0x513317,null))[_0x66c7('0x21')](respondWithResult(_0x513317,null))[_0x66c7('0x41')](handleError(_0x513317,null));};exports[_0x66c7('0x47')]=function(_0x3c45cd,_0x1b78a6){return db[_0x66c7('0x29')][_0x66c7('0x47')](_0x3c45cd[_0x66c7('0x48')],{})['then'](respondWithResult(_0x1b78a6,0xc9))[_0x66c7('0x41')](handleError(_0x1b78a6,null));};exports[_0x66c7('0x49')]=function(_0x23d0eb,_0x1386a2){if(_0x23d0eb[_0x66c7('0x48')]['id']){delete _0x23d0eb[_0x66c7('0x48')]['id'];}return db[_0x66c7('0x29')][_0x66c7('0x46')]({'where':{'id':_0x23d0eb[_0x66c7('0x43')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x1386a2,null))[_0x66c7('0x21')](saveUpdates(_0x23d0eb[_0x66c7('0x48')],null))[_0x66c7('0x21')](respondWithResult(_0x1386a2,null))[_0x66c7('0x41')](handleError(_0x1386a2,null));};exports['destroy']=function(_0x43d4db,_0x225fb6){return db[_0x66c7('0x29')][_0x66c7('0x46')]({'where':{'id':_0x43d4db['params']['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x225fb6,null))[_0x66c7('0x21')](removeEntity(_0x225fb6,null))['catch'](handleError(_0x225fb6,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index a1d1e56..67ffa74 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 _0x99e7=['request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x70b1b9,_0x4ce91b){var _0x22f790=function(_0x32438c){while(--_0x32438c){_0x70b1b9['push'](_0x70b1b9['shift']());}};_0x22f790(++_0x4ce91b);}(_0x99e7,0x96));var _0x799e=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x99e7[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x799e('0x0'));var util=require('util');var logger=require(_0x799e('0x1'))(_0x799e('0x2'));var moment=require(_0x799e('0x3'));var BPromise=require('bluebird');var rp=require(_0x799e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x799e('0x5'));var config=require(_0x799e('0x6'));var attributes=require(_0x799e('0x7'));module[_0x799e('0x8')]=function(_0x2e7715,_0x4ce90e){return _0x2e7715[_0x799e('0x9')]('FreshdeskField',attributes,{'tableName':_0x799e('0xa'),'paranoid':![],'indexes':[{'name':_0x799e('0xb'),'fields':[_0x799e('0xc'),_0x799e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63e1=['idField','lodash','util','api','moment','bluebird','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x2911e6,_0x3d3f16){var _0x151b66=function(_0x32a182){while(--_0x32a182){_0x2911e6['push'](_0x2911e6['shift']());}};_0x151b66(++_0x3d3f16);}(_0x63e1,0x6d));var _0x163e=function(_0x58e2e8,_0x345009){_0x58e2e8=_0x58e2e8-0x0;var _0x4af21b=_0x63e1[_0x58e2e8];return _0x4af21b;};'use strict';var _=require(_0x163e('0x0'));var util=require(_0x163e('0x1'));var logger=require('../../config/logger')(_0x163e('0x2'));var moment=require(_0x163e('0x3'));var BPromise=require(_0x163e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x163e('0x5'));var rimraf=require(_0x163e('0x6'));var config=require('../../config/environment');var attributes=require(_0x163e('0x7'));module[_0x163e('0x8')]=function(_0x260bd,_0x4e2ac6){return _0x260bd[_0x163e('0x9')](_0x163e('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x163e('0xb'),'FieldId'],'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 ade1693..c52531c 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 _0xccd2=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xccd2,0x1e2));var _0x2ccd=function(_0x420f63,_0x4b5efa){_0x420f63=_0x420f63-0x0;var _0x55064c=_0xccd2[_0x420f63];return _0x55064c;};'use strict';var _=require(_0x2ccd('0x0'));var util=require('util');var moment=require(_0x2ccd('0x1'));var BPromise=require(_0x2ccd('0x2'));var rs=require(_0x2ccd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ccd('0x4'))['db'];var utils=require(_0x2ccd('0x5'));var logger=require(_0x2ccd('0x6'))(_0x2ccd('0x7'));var config=require(_0x2ccd('0x8'));var jayson=require(_0x2ccd('0x9'));var client=jayson['client'][_0x2ccd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b955a,_0x35b9ac,_0x497af2){return new BPromise(function(_0x312cc0,_0x6c8006){return client['request'](_0x2b955a,_0x497af2)[_0x2ccd('0xb')](function(_0x50bd59){logger[_0x2ccd('0xc')](_0x2ccd('0xd'),_0x35b9ac,_0x2ccd('0xe'));logger[_0x2ccd('0xf')](_0x2ccd('0x10'),_0x35b9ac,_0x2ccd('0xe'),JSON['stringify'](_0x50bd59));if(_0x50bd59[_0x2ccd('0x11')]){if(_0x50bd59[_0x2ccd('0x11')]['code']===0x1f4){logger['error'](_0x2ccd('0xd'),_0x35b9ac,_0x50bd59[_0x2ccd('0x11')][_0x2ccd('0x12')]);return _0x6c8006(_0x50bd59[_0x2ccd('0x11')]['message']);}logger[_0x2ccd('0x11')](_0x2ccd('0xd'),_0x35b9ac,_0x50bd59[_0x2ccd('0x11')][_0x2ccd('0x12')]);return _0x312cc0(_0x50bd59['error'][_0x2ccd('0x12')]);}else{logger[_0x2ccd('0xc')](_0x2ccd('0xd'),_0x35b9ac,_0x2ccd('0xe'));_0x312cc0(_0x50bd59[_0x2ccd('0x13')][_0x2ccd('0x12')]);}})[_0x2ccd('0x14')](function(_0x5db639){logger[_0x2ccd('0x11')](_0x2ccd('0xd'),_0x35b9ac,_0x5db639);_0x6c8006(_0x5db639);});});} \ No newline at end of file +var _0x989f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FreshdeskField,\x20%s,\x20%s','result','catch','lodash'];(function(_0x309e38,_0x591a0d){var _0x1bc3a2=function(_0x236b35){while(--_0x236b35){_0x309e38['push'](_0x309e38['shift']());}};_0x1bc3a2(++_0x591a0d);}(_0x989f,0x1cb));var _0xf989=function(_0x18e4d2,_0x3298e8){_0x18e4d2=_0x18e4d2-0x0;var _0x17d106=_0x989f[_0x18e4d2];return _0x17d106;};'use strict';var _=require(_0xf989('0x0'));var util=require(_0xf989('0x1'));var moment=require(_0xf989('0x2'));var BPromise=require(_0xf989('0x3'));var rs=require(_0xf989('0x4'));var fs=require('fs');var Redis=require(_0xf989('0x5'));var db=require(_0xf989('0x6'))['db'];var utils=require(_0xf989('0x7'));var logger=require(_0xf989('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf989('0x9'));var client=jayson[_0xf989('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd4e130,_0x595f49,_0x3b330e){return new BPromise(function(_0x50d253,_0x5b9df1){return client[_0xf989('0xb')](_0xd4e130,_0x3b330e)[_0xf989('0xc')](function(_0xbfa39a){logger[_0xf989('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x595f49,'request\x20sent');logger[_0xf989('0xe')](_0xf989('0xf'),_0x595f49,_0xf989('0x10'),JSON['stringify'](_0xbfa39a));if(_0xbfa39a[_0xf989('0x11')]){if(_0xbfa39a[_0xf989('0x11')][_0xf989('0x12')]===0x1f4){logger[_0xf989('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x595f49,_0xbfa39a[_0xf989('0x11')][_0xf989('0x13')]);return _0x5b9df1(_0xbfa39a[_0xf989('0x11')][_0xf989('0x13')]);}logger['error'](_0xf989('0x14'),_0x595f49,_0xbfa39a[_0xf989('0x11')][_0xf989('0x13')]);return _0x50d253(_0xbfa39a['error'][_0xf989('0x13')]);}else{logger[_0xf989('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x595f49,'request\x20sent');_0x50d253(_0xbfa39a[_0xf989('0x15')][_0xf989('0x13')]);}})[_0xf989('0x16')](function(_0x548b92){logger['error'](_0xf989('0x14'),_0x595f49,_0x548b92);_0x5b9df1(_0x548b92);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 995f2f9..0fb2999 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 _0x351d=['index','/:id','/:id/configurations','getFields','create','put','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x351d,0x90));var _0xd351=function(_0x579d3f,_0x39e09b){_0x579d3f=_0x579d3f-0x0;var _0x22a9a6=_0x351d[_0x579d3f];return _0x22a9a6;};'use strict';var multer=require(_0xd351('0x0'));var util=require('util');var path=require(_0xd351('0x1'));var timeout=require(_0xd351('0x2'));var express=require(_0xd351('0x3'));var router=express['Router']();var fs_extra=require(_0xd351('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0xd351('0x7')]('/',auth[_0xd351('0x8')](),controller[_0xd351('0x9')]);router['get'](_0xd351('0xa'),auth[_0xd351('0x8')](),controller['show']);router[_0xd351('0x7')](_0xd351('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd351('0x7')]('/:id/fields',auth[_0xd351('0x8')](),controller[_0xd351('0xc')]);router['post']('/',auth[_0xd351('0x8')](),controller[_0xd351('0xd')]);router['post'](_0xd351('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xd351('0xe')](_0xd351('0xa'),auth[_0xd351('0x8')](),controller[_0xd351('0xf')]);router['delete'](_0xd351('0xa'),auth[_0xd351('0x8')](),controller['destroy']);module[_0xd351('0x10')]=router; \ No newline at end of file +var _0x0abf=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete'];(function(_0x3845fa,_0x42306b){var _0x1b1662=function(_0x47fef2){while(--_0x47fef2){_0x3845fa['push'](_0x3845fa['shift']());}};_0x1b1662(++_0x42306b);}(_0x0abf,0xe8));var _0xf0ab=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0abf[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xf0ab('0xe')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0xf')]);router[_0xf0ab('0xe')](_0xf0ab('0xb'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')](_0xf0ab('0x12'),auth['isAuthenticated'](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x12'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x15')]);module[_0xf0ab('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 34438e6..b855e6e 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 _0x33af=['exports','STRING','username','remoteUri'];(function(_0x1d36ae,_0x2d0e14){var _0x1759c3=function(_0x495250){while(--_0x495250){_0x1d36ae['push'](_0x1d36ae['shift']());}};_0x1759c3(++_0x2d0e14);}(_0x33af,0xec));var _0xf33a=function(_0x4aa7b8,_0xc69b67){_0x4aa7b8=_0x4aa7b8-0x0;var _0x310986=_0x33af[_0x4aa7b8];return _0x310986;};'use strict';var Sequelize=require('sequelize');module[_0xf33a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf33a('0x1')]},'username':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x2')},'apiKey':{'type':Sequelize[_0xf33a('0x1')]},'remoteUri':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa30a=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4018ba,_0x4212bf){var _0x37954b=function(_0x5e6d8f){while(--_0x5e6d8f){_0x4018ba['push'](_0x4018ba['shift']());}};_0x37954b(++_0x4212bf);}(_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')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x3')},'apiKey':{'type':Sequelize[_0xaa30('0x2')]},'remoteUri':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x4')},'serverUrl':{'type':Sequelize[_0xaa30('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 8c0fc26..d249da0 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 _0x9eaa=['offset','count','limit','set','apply','reject','then','destroy','end','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','create','body','update','find','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9eaa,0x1d2));var _0xa9ea=function(_0x1d9fcc,_0x3c14d6){_0x1d9fcc=_0x1d9fcc-0x0;var _0x3fbada=_0x9eaa[_0x1d9fcc];return _0x3fbada;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9ea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9ea('0x1'));var rp=require(_0xa9ea('0x2'));var moment=require(_0xa9ea('0x3'));var BPromise=require(_0xa9ea('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa9ea('0x5'));var sox=require(_0xa9ea('0x6'));var csv=require('to-csv');var ejs=require(_0xa9ea('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9ea('0x8'));var deskjs=require(_0xa9ea('0x9'));var toCsv=require('to-csv');var querystring=require(_0xa9ea('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa9ea('0xb'));var qs=require(_0xa9ea('0xc'));var as=require(_0xa9ea('0xd'));var hardwareService=require(_0xa9ea('0xe'));var logger=require('../../config/logger')(_0xa9ea('0xf'));var utils=require(_0xa9ea('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xa9ea('0x11'));var db=require(_0xa9ea('0x12'))['db'];var integrations=require(_0xa9ea('0x13'));function respondWithStatusCode(_0x21bc3e,_0x3c04b2){_0x3c04b2=_0x3c04b2||0xcc;return function(_0x57d7f5){if(_0x57d7f5){return _0x21bc3e[_0xa9ea('0x14')](_0x3c04b2);}return _0x21bc3e[_0xa9ea('0x15')](_0x3c04b2)['end']();};}function respondWithResult(_0x4b9671,_0x2f6dcd){_0x2f6dcd=_0x2f6dcd||0xc8;return function(_0x42d8d2){if(_0x42d8d2){return _0x4b9671[_0xa9ea('0x15')](_0x2f6dcd)[_0xa9ea('0x16')](_0x42d8d2);}};}function respondWithFilteredResult(_0x4e0544,_0x53db6e){return function(_0x3e4a53){if(_0x3e4a53){var _0x267908=typeof _0x53db6e['offset']==='undefined'&&typeof _0x53db6e['limit']===_0xa9ea('0x17');var _0x5dce42=_0x3e4a53['count'];var _0x1d1f02=_0x267908?0x0:_0x53db6e[_0xa9ea('0x18')];var _0x49a9b1=_0x267908?_0x3e4a53[_0xa9ea('0x19')]:_0x53db6e[_0xa9ea('0x18')]+_0x53db6e[_0xa9ea('0x1a')];var _0x3794e0;if(_0x49a9b1>=_0x5dce42){_0x49a9b1=_0x5dce42;_0x3794e0=0xc8;}else{_0x3794e0=0xce;}_0x4e0544['status'](_0x3794e0);return _0x4e0544[_0xa9ea('0x1b')]('Content-Range',_0x1d1f02+'-'+_0x49a9b1+'/'+_0x5dce42)[_0xa9ea('0x16')](_0x3e4a53);}return null;};}function patchUpdates(_0x1b16c5){return function(_0x46f78b){try{jsonpatch[_0xa9ea('0x1c')](_0x46f78b,_0x1b16c5,!![]);}catch(_0x1befa1){return BPromise[_0xa9ea('0x1d')](_0x1befa1);}return _0x46f78b['save']();};}function saveUpdates(_0x13d221,_0x2c1a01){return function(_0x15841a){if(_0x15841a){return _0x15841a['update'](_0x13d221)[_0xa9ea('0x1e')](function(_0x452704){return _0x452704;});}return null;};}function removeEntity(_0x4db2b4,_0x52c83d){return function(_0x151c27){if(_0x151c27){return _0x151c27[_0xa9ea('0x1f')]()[_0xa9ea('0x1e')](function(){_0x4db2b4[_0xa9ea('0x15')](0xcc)[_0xa9ea('0x20')]();});}};}function handleEntityNotFound(_0x32b214,_0x5a0aca){return function(_0x414c53){if(!_0x414c53){_0x32b214[_0xa9ea('0x14')](0x194);}return _0x414c53;};}function handleError(_0x4259f7,_0x46aafb){_0x46aafb=_0x46aafb||0x1f4;return function(_0x3abd89){logger[_0xa9ea('0x21')](_0x3abd89[_0xa9ea('0x22')]);if(_0x3abd89[_0xa9ea('0x23')]){delete _0x3abd89['name'];}_0x4259f7['status'](_0x46aafb)[_0xa9ea('0x24')](_0x3abd89);};}exports[_0xa9ea('0x25')]=function(_0x42421d,_0x3a9e36){var _0x5e6fb0={},_0x506143={},_0x8805a={'count':0x0,'rows':[]};var _0xcd117=_[_0xa9ea('0x26')](db[_0xa9ea('0x27')][_0xa9ea('0x28')],function(_0x15b8d9){return{'name':_0x15b8d9['fieldName'],'type':_0x15b8d9[_0xa9ea('0x29')][_0xa9ea('0x2a')]};});_0x506143[_0xa9ea('0x2b')]=_[_0xa9ea('0x26')](_0xcd117,_0xa9ea('0x23'));_0x506143[_0xa9ea('0x2c')]=_[_0xa9ea('0x2d')](_0x42421d[_0xa9ea('0x2c')]);_0x506143[_0xa9ea('0x2e')]=_[_0xa9ea('0x2f')](_0x506143[_0xa9ea('0x2b')],_0x506143[_0xa9ea('0x2c')]);_0x5e6fb0[_0xa9ea('0x30')]=_[_0xa9ea('0x2f')](_0x506143['model'],qs['fields'](_0x42421d[_0xa9ea('0x2c')][_0xa9ea('0x31')]));_0x5e6fb0[_0xa9ea('0x30')]=_0x5e6fb0[_0xa9ea('0x30')][_0xa9ea('0x32')]?_0x5e6fb0['attributes']:_0x506143[_0xa9ea('0x2b')];if(!_0x42421d[_0xa9ea('0x2c')][_0xa9ea('0x33')](_0xa9ea('0x34'))){_0x5e6fb0[_0xa9ea('0x1a')]=qs[_0xa9ea('0x1a')](_0x42421d[_0xa9ea('0x2c')][_0xa9ea('0x1a')]);_0x5e6fb0[_0xa9ea('0x18')]=qs[_0xa9ea('0x18')](_0x42421d[_0xa9ea('0x2c')][_0xa9ea('0x18')]);}_0x5e6fb0[_0xa9ea('0x35')]=qs[_0xa9ea('0x36')](_0x42421d[_0xa9ea('0x2c')]['sort']);_0x5e6fb0[_0xa9ea('0x37')]=qs[_0xa9ea('0x2e')](_[_0xa9ea('0x38')](_0x42421d[_0xa9ea('0x2c')],_0x506143[_0xa9ea('0x2e')]),_0xcd117);if(_0x42421d[_0xa9ea('0x2c')][_0xa9ea('0x39')]){_0x5e6fb0[_0xa9ea('0x37')]=_[_0xa9ea('0x3a')](_0x5e6fb0[_0xa9ea('0x37')],{'$or':_[_0xa9ea('0x26')](_0xcd117,function(_0x3a64f9){if(_0x3a64f9[_0xa9ea('0x29')]!=='VIRTUAL'){var _0x384117={};_0x384117[_0x3a64f9[_0xa9ea('0x23')]]={'$like':'%'+_0x42421d[_0xa9ea('0x2c')]['filter']+'%'};return _0x384117;}})});}_0x5e6fb0=_[_0xa9ea('0x3a')]({},_0x5e6fb0,_0x42421d[_0xa9ea('0x3b')]);var _0x1528a3={'where':_0x5e6fb0['where']};return db[_0xa9ea('0x27')]['count'](_0x1528a3)[_0xa9ea('0x1e')](function(_0x549c59){_0x8805a[_0xa9ea('0x19')]=_0x549c59;if(_0x42421d[_0xa9ea('0x2c')][_0xa9ea('0x3c')]){_0x5e6fb0['include']=[{'all':!![]}];}return db[_0xa9ea('0x27')][_0xa9ea('0x3d')](_0x5e6fb0);})[_0xa9ea('0x1e')](function(_0x3017bd){_0x8805a['rows']=_0x3017bd;return _0x8805a;})[_0xa9ea('0x1e')](respondWithFilteredResult(_0x3a9e36,_0x5e6fb0))[_0xa9ea('0x3e')](handleError(_0x3a9e36,null));};exports['show']=function(_0x54dd94,_0x251233){var _0x33f0cc={'raw':![],'where':{'id':_0x54dd94[_0xa9ea('0x3f')]['id']}},_0x258193={};_0x258193['model']=_[_0xa9ea('0x2d')](db[_0xa9ea('0x27')][_0xa9ea('0x28')]);_0x258193[_0xa9ea('0x2c')]=_[_0xa9ea('0x2d')](_0x54dd94[_0xa9ea('0x2c')]);_0x258193[_0xa9ea('0x2e')]=_['intersection'](_0x258193[_0xa9ea('0x2b')],_0x258193[_0xa9ea('0x2c')]);_0x33f0cc[_0xa9ea('0x30')]=_['intersection'](_0x258193[_0xa9ea('0x2b')],qs[_0xa9ea('0x31')](_0x54dd94['query'][_0xa9ea('0x31')]));_0x33f0cc[_0xa9ea('0x30')]=_0x33f0cc[_0xa9ea('0x30')][_0xa9ea('0x32')]?_0x33f0cc[_0xa9ea('0x30')]:_0x258193[_0xa9ea('0x2b')];if(_0x54dd94[_0xa9ea('0x2c')][_0xa9ea('0x3c')]){_0x33f0cc['include']=[{'all':!![]}];}_0x33f0cc=_[_0xa9ea('0x3a')]({},_0x33f0cc,_0x54dd94[_0xa9ea('0x3b')]);return db[_0xa9ea('0x27')]['find'](_0x33f0cc)[_0xa9ea('0x1e')](handleEntityNotFound(_0x251233,null))['then'](respondWithResult(_0x251233,null))[_0xa9ea('0x3e')](handleError(_0x251233,null));};exports[_0xa9ea('0x40')]=function(_0x24ac2b,_0x2e84d9){return db[_0xa9ea('0x27')][_0xa9ea('0x40')](_0x24ac2b[_0xa9ea('0x41')],{})['then'](respondWithResult(_0x2e84d9,0xc9))[_0xa9ea('0x3e')](handleError(_0x2e84d9,null));};exports[_0xa9ea('0x42')]=function(_0x5c246f,_0x2fd655){if(_0x5c246f[_0xa9ea('0x41')]['id']){delete _0x5c246f['body']['id'];}return db[_0xa9ea('0x27')]['find']({'where':{'id':_0x5c246f['params']['id']}})[_0xa9ea('0x1e')](handleEntityNotFound(_0x2fd655,null))[_0xa9ea('0x1e')](saveUpdates(_0x5c246f[_0xa9ea('0x41')],null))[_0xa9ea('0x1e')](respondWithResult(_0x2fd655,null))[_0xa9ea('0x3e')](handleError(_0x2fd655,null));};exports[_0xa9ea('0x1f')]=function(_0x355ec7,_0x3d8a08){return db[_0xa9ea('0x27')][_0xa9ea('0x43')]({'where':{'id':_0x355ec7['params']['id']}})[_0xa9ea('0x1e')](handleEntityNotFound(_0x3d8a08,null))[_0xa9ea('0x1e')](removeEntity(_0x3d8a08,null))[_0xa9ea('0x3e')](handleError(_0x3d8a08,null));};exports[_0xa9ea('0x44')]=function(_0x412e05,_0x5d6d72,_0x59fd7b){var _0x41ef7b={};var _0x1926a9={};var _0x533a17;var _0x3f9ea7;return db[_0xa9ea('0x27')][_0xa9ea('0x45')]({'where':{'id':_0x412e05['params']['id']}})[_0xa9ea('0x1e')](handleEntityNotFound(_0x5d6d72,null))['then'](function(_0x1de26a){if(_0x1de26a){_0x533a17=_0x1de26a;_0x1926a9[_0xa9ea('0x2b')]=_[_0xa9ea('0x2d')](db[_0xa9ea('0x46')]['rawAttributes']);_0x1926a9[_0xa9ea('0x2c')]=_[_0xa9ea('0x2d')](_0x412e05[_0xa9ea('0x2c')]);_0x1926a9[_0xa9ea('0x2e')]=_[_0xa9ea('0x2f')](_0x1926a9[_0xa9ea('0x2b')],_0x1926a9[_0xa9ea('0x2c')]);_0x41ef7b[_0xa9ea('0x30')]=_[_0xa9ea('0x2f')](_0x1926a9[_0xa9ea('0x2b')],qs[_0xa9ea('0x31')](_0x412e05['query'][_0xa9ea('0x31')]));_0x41ef7b[_0xa9ea('0x30')]=_0x41ef7b[_0xa9ea('0x30')][_0xa9ea('0x32')]?_0x41ef7b[_0xa9ea('0x30')]:_0x1926a9[_0xa9ea('0x2b')];_0x41ef7b['order']=qs[_0xa9ea('0x36')](_0x412e05['query']['sort']);_0x41ef7b['where']=qs['filters'](_[_0xa9ea('0x38')](_0x412e05[_0xa9ea('0x2c')],_0x1926a9['filters']));if(_0x412e05['query']['filter']){_0x41ef7b[_0xa9ea('0x37')]=_['merge'](_0x41ef7b[_0xa9ea('0x37')],{'$or':_[_0xa9ea('0x26')](_0x41ef7b[_0xa9ea('0x30')],function(_0x4ba3d8){var _0x372bd8={};_0x372bd8[_0x4ba3d8]={'$like':'%'+_0x412e05[_0xa9ea('0x2c')][_0xa9ea('0x39')]+'%'};return _0x372bd8;})});}_0x41ef7b=_[_0xa9ea('0x3a')]({},_0x41ef7b,_0x412e05[_0xa9ea('0x3b')]);return _0x533a17[_0xa9ea('0x44')](_0x41ef7b);}})[_0xa9ea('0x1e')](function(_0x27e935){if(_0x27e935){_0x3f9ea7=_0x27e935['length'];if(!_0x412e05[_0xa9ea('0x2c')][_0xa9ea('0x33')](_0xa9ea('0x34'))){_0x41ef7b[_0xa9ea('0x1a')]=qs[_0xa9ea('0x1a')](_0x412e05[_0xa9ea('0x2c')][_0xa9ea('0x1a')]);_0x41ef7b[_0xa9ea('0x18')]=qs[_0xa9ea('0x18')](_0x412e05['query']['offset']);}return _0x533a17[_0xa9ea('0x44')](_0x41ef7b);}})[_0xa9ea('0x1e')](function(_0x4fc7ae){if(_0x4fc7ae){return _0x4fc7ae?{'count':_0x3f9ea7,'rows':_0x4fc7ae}:null;}})['then'](respondWithResult(_0x5d6d72,null))[_0xa9ea('0x3e')](handleError(_0x5d6d72,null));};exports[_0xa9ea('0x47')]=function(_0x77d109,_0x521a92,_0x23f0bc){if(_0x77d109['body']['id']){delete _0x77d109[_0xa9ea('0x41')]['id'];}return db[_0xa9ea('0x27')]['findOne']({'where':{'id':_0x77d109[_0xa9ea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x521a92,null))[_0xa9ea('0x1e')](function(_0x20e9f1){if(_0x20e9f1){_0x77d109[_0xa9ea('0x41')][_0xa9ea('0x48')]=_0x20e9f1['id'];_0x77d109[_0xa9ea('0x41')][_0xa9ea('0x49')]=integrations[_0xa9ea('0x4a')](_0x77d109['body'][_0xa9ea('0x4b')],_0x77d109[_0xa9ea('0x41')][_0xa9ea('0x29')]);_0x77d109['body']['Descriptions']=integrations[_0xa9ea('0x4c')](_0x77d109[_0xa9ea('0x41')][_0xa9ea('0x4b')],_0x77d109[_0xa9ea('0x41')][_0xa9ea('0x29')]);return db[_0xa9ea('0x46')][_0xa9ea('0x40')](_0x77d109['body'],{'include':[{'model':db[_0xa9ea('0x4d')],'as':_0xa9ea('0x49')},{'model':db[_0xa9ea('0x4d')],'as':_0xa9ea('0x4e')}]});}return null;})[_0xa9ea('0x1e')](respondWithResult(_0x521a92,null))[_0xa9ea('0x3e')](handleError(_0x521a92,null));};exports[_0xa9ea('0x4f')]=function(_0x4a1193,_0x3f1025,_0x2a693b){var _0x19cfcc='';var _0x305380='';return db['FreshsalesAccount'][_0xa9ea('0x45')]({'where':{'id':_0x4a1193[_0xa9ea('0x3f')]['id']},'attributes':['id',_0xa9ea('0x50'),_0xa9ea('0x51'),_0xa9ea('0x52')]})[_0xa9ea('0x1e')](handleEntityNotFound(_0x3f1025,null))['then'](function(_0x4f07fa){if(_0x4f07fa){_0x305380=_0x4f07fa[_0xa9ea('0x50')];_0x19cfcc=_0x4f07fa[_0xa9ea('0x51')];var _0x5a9690=_0x4f07fa['remoteUri'][_0xa9ea('0x53')](-0x1);if(_0x5a9690==='/'){_0x19cfcc=_0x19cfcc['substring'](0x0,_0x19cfcc[_0xa9ea('0x54')](_0x5a9690));}return rp({'method':_0xa9ea('0x55'),'uri':util[_0xa9ea('0x56')](_0xa9ea('0x57'),_0x19cfcc,_0xa9ea('0x58')),'headers':{'Authorization':_0xa9ea('0x59')+_0x4f07fa['apiKey']},'json':!![]});}})['then'](function(_0x29fe7e){if(_0x29fe7e){var _0x20ca03=_0x29fe7e[_0xa9ea('0x5a')];var _0x571156=![];var _0x9e08e9=null;for(_0x9e08e9=0x0;_0x9e08e9<_0x20ca03['length'];_0x9e08e9++){if(_0x20ca03[_0x9e08e9][_0xa9ea('0x5b')]===_0x305380){_0x571156=!![];}}if(_0x571156){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa9ea('0x5c')});}}})[_0xa9ea('0x1e')](respondWithResult(_0x3f1025,null))[_0xa9ea('0x3e')](function(_0x4489a3){var _0x219279=_0x4a1193[_0xa9ea('0x2c')][_0xa9ea('0x5d')]?0x1f4:_0x4489a3[_0xa9ea('0x5e')]||0x1f4;logger[_0xa9ea('0x21')](_0xa9ea('0x5f'),_0xa9ea('0x4f'),_0x219279,JSON[_0xa9ea('0x60')](_0x4489a3));delete _0x4489a3[_0xa9ea('0x23')];if(_0x219279===0x191){_0x219279=0x190;}_0x3f1025[_0xa9ea('0x15')](_0x219279)['send'](_0x4a1193[_0xa9ea('0x2c')][_0xa9ea('0x5d')]?{'message':_0xa9ea('0x61'),'statusCode':_0x4489a3[_0xa9ea('0x5e')]}:_0x4489a3);});}; \ No newline at end of file +var _0x7ece=['index','FreshsalesAccount','fieldName','key','map','query','keys','filters','model','fields','attributes','hasOwnProperty','order','where','pick','filter','merge','type','include','findAll','rows','catch','rawAttributes','intersection','options','create','body','find','params','destroy','getConfigurations','findOne','FreshsalesConfiguration','sort','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','username','remoteUri','apiKey','slice','format','/api/selector/owners','Token\x20token=','users','length','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','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','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','end','name'];(function(_0x51a9b7,_0x5ce85a){var _0x4e8e07=function(_0x5f00b2){while(--_0x5f00b2){_0x51a9b7['push'](_0x51a9b7['shift']());}};_0x4e8e07(++_0x5ce85a);}(_0x7ece,0xf6));var _0xe7ec=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7ece[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe7ec('0x0'));var rp=require(_0xe7ec('0x1'));var moment=require('moment');var BPromise=require(_0xe7ec('0x2'));var Mustache=require(_0xe7ec('0x3'));var util=require(_0xe7ec('0x4'));var path=require('path');var sox=require(_0xe7ec('0x5'));var csv=require(_0xe7ec('0x6'));var ejs=require(_0xe7ec('0x7'));var fs=require('fs');var fs_extra=require(_0xe7ec('0x8'));var _=require(_0xe7ec('0x9'));var squel=require(_0xe7ec('0xa'));var crypto=require('crypto');var jsforce=require(_0xe7ec('0xb'));var deskjs=require(_0xe7ec('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7ec('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7ec('0xe'));var authService=require(_0xe7ec('0xf'));var qs=require(_0xe7ec('0x10'));var as=require(_0xe7ec('0x11'));var hardwareService=require(_0xe7ec('0x12'));var logger=require(_0xe7ec('0x13'))(_0xe7ec('0x14'));var utils=require(_0xe7ec('0x15'));var config=require(_0xe7ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ec('0x17'))['db'];var integrations=require(_0xe7ec('0x18'));function respondWithStatusCode(_0x2c0316,_0x990786){_0x990786=_0x990786||0xcc;return function(_0x57befe){if(_0x57befe){return _0x2c0316[_0xe7ec('0x19')](_0x990786);}return _0x2c0316[_0xe7ec('0x1a')](_0x990786)['end']();};}function respondWithResult(_0x36e7f2,_0x35fe3e){_0x35fe3e=_0x35fe3e||0xc8;return function(_0x2e8c6f){if(_0x2e8c6f){return _0x36e7f2[_0xe7ec('0x1a')](_0x35fe3e)[_0xe7ec('0x1b')](_0x2e8c6f);}};}function respondWithFilteredResult(_0x4cdaf6,_0x3c4546){return function(_0x2d99b8){if(_0x2d99b8){var _0x574a0c=typeof _0x3c4546['offset']===_0xe7ec('0x1c')&&typeof _0x3c4546[_0xe7ec('0x1d')]===_0xe7ec('0x1c');var _0x33c547=_0x2d99b8[_0xe7ec('0x1e')];var _0xc2e5a3=_0x574a0c?0x0:_0x3c4546[_0xe7ec('0x1f')];var _0x211fd0=_0x574a0c?_0x2d99b8[_0xe7ec('0x1e')]:_0x3c4546['offset']+_0x3c4546[_0xe7ec('0x1d')];var _0x2293aa;if(_0x211fd0>=_0x33c547){_0x211fd0=_0x33c547;_0x2293aa=0xc8;}else{_0x2293aa=0xce;}_0x4cdaf6[_0xe7ec('0x1a')](_0x2293aa);return _0x4cdaf6['set'](_0xe7ec('0x20'),_0xc2e5a3+'-'+_0x211fd0+'/'+_0x33c547)['json'](_0x2d99b8);}return null;};}function patchUpdates(_0x584781){return function(_0x3896f6){try{jsonpatch[_0xe7ec('0x21')](_0x3896f6,_0x584781,!![]);}catch(_0x23a53a){return BPromise['reject'](_0x23a53a);}return _0x3896f6[_0xe7ec('0x22')]();};}function saveUpdates(_0x3d6566,_0x454ba2){return function(_0x516afc){if(_0x516afc){return _0x516afc[_0xe7ec('0x23')](_0x3d6566)[_0xe7ec('0x24')](function(_0x5bb1be){return _0x5bb1be;});}return null;};}function removeEntity(_0x36de6e,_0x28ac52){return function(_0x1ce324){if(_0x1ce324){return _0x1ce324['destroy']()['then'](function(){_0x36de6e[_0xe7ec('0x1a')](0xcc)[_0xe7ec('0x25')]();});}};}function handleEntityNotFound(_0x35ea11,_0x37bd5a){return function(_0x310fbd){if(!_0x310fbd){_0x35ea11[_0xe7ec('0x19')](0x194);}return _0x310fbd;};}function handleError(_0x4bf75a,_0x5249d3){_0x5249d3=_0x5249d3||0x1f4;return function(_0x2881b3){logger['error'](_0x2881b3['stack']);if(_0x2881b3[_0xe7ec('0x26')]){delete _0x2881b3['name'];}_0x4bf75a[_0xe7ec('0x1a')](_0x5249d3)['send'](_0x2881b3);};}exports[_0xe7ec('0x27')]=function(_0x9fd117,_0x1d446e){var _0x10adf7={},_0x4511c2={},_0x4eae3b={'count':0x0,'rows':[]};var _0x27a18f=_['map'](db[_0xe7ec('0x28')]['rawAttributes'],function(_0x5efcf8){return{'name':_0x5efcf8[_0xe7ec('0x29')],'type':_0x5efcf8['type'][_0xe7ec('0x2a')]};});_0x4511c2['model']=_[_0xe7ec('0x2b')](_0x27a18f,_0xe7ec('0x26'));_0x4511c2[_0xe7ec('0x2c')]=_[_0xe7ec('0x2d')](_0x9fd117[_0xe7ec('0x2c')]);_0x4511c2[_0xe7ec('0x2e')]=_['intersection'](_0x4511c2[_0xe7ec('0x2f')],_0x4511c2['query']);_0x10adf7['attributes']=_['intersection'](_0x4511c2[_0xe7ec('0x2f')],qs['fields'](_0x9fd117['query'][_0xe7ec('0x30')]));_0x10adf7[_0xe7ec('0x31')]=_0x10adf7[_0xe7ec('0x31')]['length']?_0x10adf7[_0xe7ec('0x31')]:_0x4511c2[_0xe7ec('0x2f')];if(!_0x9fd117[_0xe7ec('0x2c')][_0xe7ec('0x32')]('nolimit')){_0x10adf7[_0xe7ec('0x1d')]=qs[_0xe7ec('0x1d')](_0x9fd117[_0xe7ec('0x2c')][_0xe7ec('0x1d')]);_0x10adf7[_0xe7ec('0x1f')]=qs['offset'](_0x9fd117[_0xe7ec('0x2c')]['offset']);}_0x10adf7[_0xe7ec('0x33')]=qs['sort'](_0x9fd117[_0xe7ec('0x2c')]['sort']);_0x10adf7[_0xe7ec('0x34')]=qs[_0xe7ec('0x2e')](_[_0xe7ec('0x35')](_0x9fd117[_0xe7ec('0x2c')],_0x4511c2[_0xe7ec('0x2e')]),_0x27a18f);if(_0x9fd117[_0xe7ec('0x2c')][_0xe7ec('0x36')]){_0x10adf7[_0xe7ec('0x34')]=_[_0xe7ec('0x37')](_0x10adf7['where'],{'$or':_[_0xe7ec('0x2b')](_0x27a18f,function(_0x5950b7){if(_0x5950b7[_0xe7ec('0x38')]!=='VIRTUAL'){var _0x1d5208={};_0x1d5208[_0x5950b7[_0xe7ec('0x26')]]={'$like':'%'+_0x9fd117[_0xe7ec('0x2c')][_0xe7ec('0x36')]+'%'};return _0x1d5208;}})});}_0x10adf7=_[_0xe7ec('0x37')]({},_0x10adf7,_0x9fd117['options']);var _0x3759e3={'where':_0x10adf7[_0xe7ec('0x34')]};return db[_0xe7ec('0x28')][_0xe7ec('0x1e')](_0x3759e3)[_0xe7ec('0x24')](function(_0xec15c5){_0x4eae3b[_0xe7ec('0x1e')]=_0xec15c5;if(_0x9fd117[_0xe7ec('0x2c')]['includeAll']){_0x10adf7[_0xe7ec('0x39')]=[{'all':!![]}];}return db[_0xe7ec('0x28')][_0xe7ec('0x3a')](_0x10adf7);})[_0xe7ec('0x24')](function(_0x17ef4d){_0x4eae3b[_0xe7ec('0x3b')]=_0x17ef4d;return _0x4eae3b;})[_0xe7ec('0x24')](respondWithFilteredResult(_0x1d446e,_0x10adf7))[_0xe7ec('0x3c')](handleError(_0x1d446e,null));};exports['show']=function(_0x2ce101,_0x176ac8){var _0x548989={'raw':![],'where':{'id':_0x2ce101['params']['id']}},_0x2c1c8e={};_0x2c1c8e['model']=_[_0xe7ec('0x2d')](db['FreshsalesAccount'][_0xe7ec('0x3d')]);_0x2c1c8e[_0xe7ec('0x2c')]=_[_0xe7ec('0x2d')](_0x2ce101['query']);_0x2c1c8e['filters']=_['intersection'](_0x2c1c8e['model'],_0x2c1c8e[_0xe7ec('0x2c')]);_0x548989[_0xe7ec('0x31')]=_[_0xe7ec('0x3e')](_0x2c1c8e['model'],qs[_0xe7ec('0x30')](_0x2ce101[_0xe7ec('0x2c')][_0xe7ec('0x30')]));_0x548989[_0xe7ec('0x31')]=_0x548989[_0xe7ec('0x31')]['length']?_0x548989[_0xe7ec('0x31')]:_0x2c1c8e[_0xe7ec('0x2f')];if(_0x2ce101[_0xe7ec('0x2c')]['includeAll']){_0x548989[_0xe7ec('0x39')]=[{'all':!![]}];}_0x548989=_[_0xe7ec('0x37')]({},_0x548989,_0x2ce101[_0xe7ec('0x3f')]);return db['FreshsalesAccount']['find'](_0x548989)[_0xe7ec('0x24')](handleEntityNotFound(_0x176ac8,null))[_0xe7ec('0x24')](respondWithResult(_0x176ac8,null))[_0xe7ec('0x3c')](handleError(_0x176ac8,null));};exports[_0xe7ec('0x40')]=function(_0x2a0708,_0x2c6f8b){return db[_0xe7ec('0x28')]['create'](_0x2a0708[_0xe7ec('0x41')],{})[_0xe7ec('0x24')](respondWithResult(_0x2c6f8b,0xc9))[_0xe7ec('0x3c')](handleError(_0x2c6f8b,null));};exports[_0xe7ec('0x23')]=function(_0x279b53,_0x296759){if(_0x279b53[_0xe7ec('0x41')]['id']){delete _0x279b53[_0xe7ec('0x41')]['id'];}return db['FreshsalesAccount'][_0xe7ec('0x42')]({'where':{'id':_0x279b53[_0xe7ec('0x43')]['id']}})[_0xe7ec('0x24')](handleEntityNotFound(_0x296759,null))[_0xe7ec('0x24')](saveUpdates(_0x279b53[_0xe7ec('0x41')],null))[_0xe7ec('0x24')](respondWithResult(_0x296759,null))[_0xe7ec('0x3c')](handleError(_0x296759,null));};exports[_0xe7ec('0x44')]=function(_0x3cc722,_0xe05488){return db['FreshsalesAccount'][_0xe7ec('0x42')]({'where':{'id':_0x3cc722[_0xe7ec('0x43')]['id']}})[_0xe7ec('0x24')](handleEntityNotFound(_0xe05488,null))[_0xe7ec('0x24')](removeEntity(_0xe05488,null))['catch'](handleError(_0xe05488,null));};exports[_0xe7ec('0x45')]=function(_0x875bad,_0x3ca937,_0x5cccb1){var _0x2d2c9c={};var _0xc46bba={};var _0x6c0c41;var _0x1528a8;return db[_0xe7ec('0x28')][_0xe7ec('0x46')]({'where':{'id':_0x875bad[_0xe7ec('0x43')]['id']}})[_0xe7ec('0x24')](handleEntityNotFound(_0x3ca937,null))[_0xe7ec('0x24')](function(_0x4f3930){if(_0x4f3930){_0x6c0c41=_0x4f3930;_0xc46bba[_0xe7ec('0x2f')]=_[_0xe7ec('0x2d')](db[_0xe7ec('0x47')][_0xe7ec('0x3d')]);_0xc46bba[_0xe7ec('0x2c')]=_[_0xe7ec('0x2d')](_0x875bad[_0xe7ec('0x2c')]);_0xc46bba[_0xe7ec('0x2e')]=_[_0xe7ec('0x3e')](_0xc46bba[_0xe7ec('0x2f')],_0xc46bba[_0xe7ec('0x2c')]);_0x2d2c9c[_0xe7ec('0x31')]=_[_0xe7ec('0x3e')](_0xc46bba[_0xe7ec('0x2f')],qs[_0xe7ec('0x30')](_0x875bad[_0xe7ec('0x2c')][_0xe7ec('0x30')]));_0x2d2c9c[_0xe7ec('0x31')]=_0x2d2c9c[_0xe7ec('0x31')]['length']?_0x2d2c9c[_0xe7ec('0x31')]:_0xc46bba['model'];_0x2d2c9c[_0xe7ec('0x33')]=qs['sort'](_0x875bad[_0xe7ec('0x2c')][_0xe7ec('0x48')]);_0x2d2c9c[_0xe7ec('0x34')]=qs[_0xe7ec('0x2e')](_[_0xe7ec('0x35')](_0x875bad['query'],_0xc46bba[_0xe7ec('0x2e')]));if(_0x875bad[_0xe7ec('0x2c')][_0xe7ec('0x36')]){_0x2d2c9c[_0xe7ec('0x34')]=_['merge'](_0x2d2c9c[_0xe7ec('0x34')],{'$or':_[_0xe7ec('0x2b')](_0x2d2c9c[_0xe7ec('0x31')],function(_0x11a958){var _0x4c9ad9={};_0x4c9ad9[_0x11a958]={'$like':'%'+_0x875bad[_0xe7ec('0x2c')][_0xe7ec('0x36')]+'%'};return _0x4c9ad9;})});}_0x2d2c9c=_[_0xe7ec('0x37')]({},_0x2d2c9c,_0x875bad[_0xe7ec('0x3f')]);return _0x6c0c41[_0xe7ec('0x45')](_0x2d2c9c);}})['then'](function(_0x532164){if(_0x532164){_0x1528a8=_0x532164['length'];if(!_0x875bad['query']['hasOwnProperty'](_0xe7ec('0x49'))){_0x2d2c9c[_0xe7ec('0x1d')]=qs['limit'](_0x875bad[_0xe7ec('0x2c')][_0xe7ec('0x1d')]);_0x2d2c9c[_0xe7ec('0x1f')]=qs['offset'](_0x875bad[_0xe7ec('0x2c')]['offset']);}return _0x6c0c41[_0xe7ec('0x45')](_0x2d2c9c);}})[_0xe7ec('0x24')](function(_0x21d3c2){if(_0x21d3c2){return _0x21d3c2?{'count':_0x1528a8,'rows':_0x21d3c2}:null;}})[_0xe7ec('0x24')](respondWithResult(_0x3ca937,null))['catch'](handleError(_0x3ca937,null));};exports[_0xe7ec('0x4a')]=function(_0x50b332,_0x463c21,_0xfbef07){if(_0x50b332['body']['id']){delete _0x50b332[_0xe7ec('0x41')]['id'];}return db[_0xe7ec('0x28')]['findOne']({'where':{'id':_0x50b332[_0xe7ec('0x43')]['id']}})[_0xe7ec('0x24')](handleEntityNotFound(_0x463c21,null))[_0xe7ec('0x24')](function(_0x2ede17){if(_0x2ede17){_0x50b332[_0xe7ec('0x41')][_0xe7ec('0x4b')]=_0x2ede17['id'];_0x50b332[_0xe7ec('0x41')][_0xe7ec('0x4c')]=integrations[_0xe7ec('0x4d')](_0x50b332[_0xe7ec('0x41')][_0xe7ec('0x4e')],_0x50b332[_0xe7ec('0x41')][_0xe7ec('0x38')]);_0x50b332['body'][_0xe7ec('0x4f')]=integrations['getDescriptions'](_0x50b332['body']['channel'],_0x50b332['body'][_0xe7ec('0x38')]);return db[_0xe7ec('0x47')][_0xe7ec('0x40')](_0x50b332[_0xe7ec('0x41')],{'include':[{'model':db[_0xe7ec('0x50')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0xe7ec('0x4f')}]});}return null;})[_0xe7ec('0x24')](respondWithResult(_0x463c21,null))[_0xe7ec('0x3c')](handleError(_0x463c21,null));};exports['getFields']=function(_0x42f874,_0x488eaf,_0x34e99f){var _0x2c81ee='';var _0x77ff50='';return db[_0xe7ec('0x28')][_0xe7ec('0x46')]({'where':{'id':_0x42f874[_0xe7ec('0x43')]['id']},'attributes':['id',_0xe7ec('0x51'),_0xe7ec('0x52'),_0xe7ec('0x53')]})[_0xe7ec('0x24')](handleEntityNotFound(_0x488eaf,null))['then'](function(_0x35f70c){if(_0x35f70c){_0x77ff50=_0x35f70c[_0xe7ec('0x51')];_0x2c81ee=_0x35f70c[_0xe7ec('0x52')];var _0x2c8128=_0x35f70c[_0xe7ec('0x52')][_0xe7ec('0x54')](-0x1);if(_0x2c8128==='/'){_0x2c81ee=_0x2c81ee['substring'](0x0,_0x2c81ee['lastIndexOf'](_0x2c8128));}return rp({'method':'GET','uri':util[_0xe7ec('0x55')]('%s%s',_0x2c81ee,_0xe7ec('0x56')),'headers':{'Authorization':_0xe7ec('0x57')+_0x35f70c[_0xe7ec('0x53')]},'json':!![]});}})[_0xe7ec('0x24')](function(_0x7300d3){if(_0x7300d3){var _0x280a2a=_0x7300d3[_0xe7ec('0x58')];var _0x296075=![];var _0x15e68d=null;for(_0x15e68d=0x0;_0x15e68d<_0x280a2a[_0xe7ec('0x59')];_0x15e68d++){if(_0x280a2a[_0x15e68d]['email']===_0x77ff50){_0x296075=!![];}}if(_0x296075){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe7ec('0x5a')});}}})[_0xe7ec('0x24')](respondWithResult(_0x488eaf,null))['catch'](function(_0x5ba616){var _0x41eb42=_0x42f874['query'][_0xe7ec('0x5b')]?0x1f4:_0x5ba616[_0xe7ec('0x5c')]||0x1f4;logger['error'](_0xe7ec('0x5d'),'getFields',_0x41eb42,JSON['stringify'](_0x5ba616));delete _0x5ba616[_0xe7ec('0x26')];if(_0x41eb42===0x191){_0x41eb42=0x190;}_0x488eaf[_0xe7ec('0x1a')](_0x41eb42)['send'](_0x42f874['query'][_0xe7ec('0x5b')]?{'message':_0xe7ec('0x5e'),'statusCode':_0x5ba616[_0xe7ec('0x5c')]}:_0x5ba616);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 323bac4..22e66a5 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 _0x6a55=['define','FreshsalesAccount','int_freshsales_accounts','lodash','moment','path','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0x6a55,0xdb));var _0x56a5=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x6a55[_0x390a19];return _0x5d8230;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x56a5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56a5('0x2'));var rimraf=require('rimraf');var config=require(_0x56a5('0x3'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x56a5('0x4'));module[_0x56a5('0x5')]=function(_0x42d164,_0x293ea1){return _0x42d164[_0x56a5('0x6')](_0x56a5('0x7'),attributes,{'tableName':_0x56a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesAccount.attributes','exports','int_freshsales_accounts'];(function(_0x25da4e,_0x578782){var _0x21d9d8=function(_0x5be9df){while(--_0x5be9df){_0x25da4e['push'](_0x25da4e['shift']());}};_0x21d9d8(++_0x578782);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0xfdbd[_0x5be7aa];return _0x215408;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xdfdb('0xa')]=function(_0x41bd5e,_0x489f19){return _0x41bd5e['define']('FreshsalesAccount',attributes,{'tableName':_0xdfdb('0xb'),'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 19cd09a..7f0e6db 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 _0x7046=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowFreshsalesAccount','FreshsalesAccount','find'];(function(_0x66d680,_0x11abda){var _0xd7ea03=function(_0xc6f7f7){while(--_0xc6f7f7){_0x66d680['push'](_0x66d680['shift']());}};_0xd7ea03(++_0x11abda);}(_0x7046,0x144));var _0x6704=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7046[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4badf8,_0x5ced8,_0x49b8b6){return new BPromise(function(_0x56b1ff,_0x390ace){return client['request'](_0x4badf8,_0x49b8b6)['then'](function(_0x3ca599){logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,_0x6704('0xe'));logger[_0x6704('0xf')](_0x6704('0x10'),_0x5ced8,_0x6704('0xe'),JSON[_0x6704('0x11')](_0x3ca599));if(_0x3ca599['error']){if(_0x3ca599[_0x6704('0x12')][_0x6704('0x13')]===0x1f4){logger['error'](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x390ace(_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);}logger[_0x6704('0x12')](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x56b1ff(_0x3ca599['error'][_0x6704('0x14')]);}else{logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,'request\x20sent');_0x56b1ff(_0x3ca599[_0x6704('0x15')][_0x6704('0x14')]);}})[_0x6704('0x16')](function(_0x29fa46){logger[_0x6704('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x5ced8,_0x29fa46);_0x390ace(_0x29fa46);});});}exports[_0x6704('0x17')]=function(_0x31d732){var _0x135f4b=this;return new Promise(function(_0xe49450,_0x344ed9){return db['FreshsalesAccount'][_0x6704('0x18')]({'raw':_0x31d732[_0x6704('0x19')]?_0x31d732[_0x6704('0x19')][_0x6704('0x1a')]===undefined?!![]:![]:!![],'where':_0x31d732[_0x6704('0x19')]?_0x31d732[_0x6704('0x19')][_0x6704('0x1b')]||null:null,'attributes':_0x31d732['options']?_0x31d732[_0x6704('0x19')][_0x6704('0x1c')]||null:null,'limit':_0x31d732[_0x6704('0x19')]?_0x31d732['options']['limit']||null:null,'include':_0x31d732[_0x6704('0x19')]?_0x31d732[_0x6704('0x19')][_0x6704('0x1d')]?_[_0x6704('0x1e')](_0x31d732[_0x6704('0x19')]['include'],function(_0xf2c459){return{'model':db[_0xf2c459[_0x6704('0x1f')]],'as':_0xf2c459['as'],'attributes':_0xf2c459[_0x6704('0x1c')],'include':_0xf2c459[_0x6704('0x1d')]?_[_0x6704('0x1e')](_0xf2c459[_0x6704('0x1d')],function(_0x2acafd){return{'model':db[_0x2acafd[_0x6704('0x1f')]],'as':_0x2acafd['as'],'attributes':_0x2acafd[_0x6704('0x1c')],'include':_0x2acafd[_0x6704('0x1d')]?_[_0x6704('0x1e')](_0x2acafd[_0x6704('0x1d')],function(_0x118d93){return{'model':db[_0x118d93['model']],'as':_0x118d93['as'],'attributes':_0x118d93['attributes']};}):[]};}):[]};}):[]:[]})[_0x6704('0x20')](function(_0xf875dc){logger[_0x6704('0xc')](_0x6704('0x17'),_0x31d732);logger['debug'](_0x6704('0x17'),_0x31d732,JSON[_0x6704('0x11')](_0xf875dc));_0xe49450(_0xf875dc);})['catch'](function(_0x588814){logger[_0x6704('0x12')]('GetFreshsalesAccount',_0x588814[_0x6704('0x14')],_0x31d732);_0x344ed9(_0x135f4b['error'](0x1f4,_0x588814['message']));});});};exports[_0x6704('0x21')]=function(_0x115514){var _0x45a286=this;return new Promise(function(_0x4ffa53,_0x1c7132){return db[_0x6704('0x22')][_0x6704('0x23')]({'raw':_0x115514[_0x6704('0x19')]?_0x115514[_0x6704('0x19')][_0x6704('0x1a')]===undefined?!![]:![]:!![],'where':_0x115514[_0x6704('0x19')]?_0x115514[_0x6704('0x19')][_0x6704('0x1b')]||null:null,'attributes':_0x115514[_0x6704('0x19')]?_0x115514[_0x6704('0x19')][_0x6704('0x1c')]||null:null,'include':_0x115514[_0x6704('0x19')]?_0x115514[_0x6704('0x19')][_0x6704('0x1d')]?_[_0x6704('0x1e')](_0x115514[_0x6704('0x19')][_0x6704('0x1d')],function(_0x219494){return{'model':db[_0x219494[_0x6704('0x1f')]],'as':_0x219494['as'],'attributes':_0x219494[_0x6704('0x1c')],'include':_0x219494[_0x6704('0x1d')]?_[_0x6704('0x1e')](_0x219494[_0x6704('0x1d')],function(_0x30b914){return{'model':db[_0x30b914['model']],'as':_0x30b914['as'],'attributes':_0x30b914['attributes'],'include':_0x30b914['include']?_[_0x6704('0x1e')](_0x30b914[_0x6704('0x1d')],function(_0x18222f){return{'model':db[_0x18222f['model']],'as':_0x18222f['as'],'attributes':_0x18222f[_0x6704('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15da25){logger[_0x6704('0xc')](_0x6704('0x21'),_0x115514);logger[_0x6704('0xf')](_0x6704('0x21'),_0x115514,JSON[_0x6704('0x11')](_0x15da25));_0x4ffa53(_0x15da25);})[_0x6704('0x16')](function(_0x2fba31){logger['error']('ShowFreshsalesAccount',_0x2fba31[_0x6704('0x14')],_0x115514);_0x1c7132(_0x45a286[_0x6704('0x12')](0x1f4,_0x2fba31['message']));});});}; \ No newline at end of file +var _0x5c3c=['find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','debug','catch','ShowFreshsalesAccount'];(function(_0x47ec60,_0x55f7d6){var _0x2c4cca=function(_0x294fa4){while(--_0x294fa4){_0x47ec60['push'](_0x47ec60['shift']());}};_0x2c4cca(++_0x55f7d6);}(_0x5c3c,0x132));var _0xc5c3=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x5c3c[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')]({'raw':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['attributes']||null:null,'limit':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1c')]||null:null,'include':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x2ff158['options']['include'],function(_0x45affe){return{'model':db[_0x45affe[_0xc5c3('0x1f')]],'as':_0x45affe['as'],'attributes':_0x45affe['attributes'],'include':_0x45affe['include']?_[_0xc5c3('0x1e')](_0x45affe[_0xc5c3('0x1d')],function(_0x38a3df){return{'model':db[_0x38a3df['model']],'as':_0x38a3df['as'],'attributes':_0x38a3df['attributes'],'include':_0x38a3df[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x38a3df[_0xc5c3('0x1d')],function(_0x29791c){return{'model':db[_0x29791c['model']],'as':_0x29791c['as'],'attributes':_0x29791c[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2eacec){logger['info'](_0xc5c3('0x17'),_0x2ff158);logger[_0xc5c3('0x21')](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x2eacec));_0x28bae6(_0x2eacec);})[_0xc5c3('0x22')](function(_0x2d07e1){logger[_0xc5c3('0x12')]('GetFreshsalesAccount',_0x2d07e1[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2d07e1[_0xc5c3('0x14')]));});});};exports[_0xc5c3('0x23')]=function(_0x5b26e9){var _0x4daa8b=this;return new Promise(function(_0x2e648f,_0x46f149){return db[_0xc5c3('0x18')][_0xc5c3('0x24')]({'raw':_0x5b26e9['options']?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x25')]===undefined?!![]:![]:!![],'where':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x20')]||null:null,'include':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9['options'][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1d')],function(_0x330391){return{'model':db[_0x330391[_0xc5c3('0x1f')]],'as':_0x330391['as'],'attributes':_0x330391[_0xc5c3('0x20')],'include':_0x330391['include']?_['map'](_0x330391[_0xc5c3('0x1d')],function(_0x55fccf){return{'model':db[_0x55fccf[_0xc5c3('0x1f')]],'as':_0x55fccf['as'],'attributes':_0x55fccf[_0xc5c3('0x20')],'include':_0x55fccf[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x55fccf[_0xc5c3('0x1d')],function(_0x498677){return{'model':db[_0x498677[_0xc5c3('0x1f')]],'as':_0x498677['as'],'attributes':_0x498677[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f57d){logger[_0xc5c3('0x15')](_0xc5c3('0x23'),_0x5b26e9);logger[_0xc5c3('0x21')](_0xc5c3('0x23'),_0x5b26e9,JSON[_0xc5c3('0x11')](_0x29f57d));_0x2e648f(_0x29f57d);})[_0xc5c3('0x22')](function(_0x2ad440){logger[_0xc5c3('0x12')](_0xc5c3('0x23'),_0x2ad440['message'],_0x5b26e9);_0x46f149(_0x4daa8b[_0xc5c3('0x12')](0x1f4,_0x2ad440['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 85ddab4..fae7bf7 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 _0x20eb=['isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','create','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','show'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x20eb,0xe4));var _0xb20e=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x20eb[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0xb20e('0x0'));var util=require(_0xb20e('0x1'));var path=require(_0xb20e('0x2'));var timeout=require(_0xb20e('0x3'));var express=require('express');var router=express[_0xb20e('0x4')]();var fs_extra=require(_0xb20e('0x5'));var auth=require(_0xb20e('0x6'));var interaction=require(_0xb20e('0x7'));var config=require(_0xb20e('0x8'));var controller=require(_0xb20e('0x9'));router[_0xb20e('0xa')]('/',auth['isAuthenticated'](),controller[_0xb20e('0xb')]);router[_0xb20e('0xa')](_0xb20e('0xc'),auth['isAuthenticated'](),controller[_0xb20e('0xd')]);router[_0xb20e('0xa')]('/:id/subjects',auth[_0xb20e('0xe')](),controller[_0xb20e('0xf')]);router['get'](_0xb20e('0x10'),auth['isAuthenticated'](),controller[_0xb20e('0x11')]);router[_0xb20e('0xa')](_0xb20e('0x12'),auth[_0xb20e('0xe')](),controller['getFields']);router['post']('/',auth[_0xb20e('0xe')](),controller[_0xb20e('0x13')]);router['put'](_0xb20e('0xc'),auth[_0xb20e('0xe')](),controller[_0xb20e('0x14')]);router['delete'](_0xb20e('0xc'),auth[_0xb20e('0xe')](),controller['destroy']);module[_0xb20e('0x15')]=router; \ No newline at end of file +var _0x9fb0=['put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/subjects','getDescriptions','getFields'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x9fb0,0x1e5));var _0x09fb=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x9fb0[_0x45d1fd];return _0xd0e542;};'use strict';var multer=require('multer');var util=require(_0x09fb('0x0'));var path=require(_0x09fb('0x1'));var timeout=require(_0x09fb('0x2'));var express=require(_0x09fb('0x3'));var router=express[_0x09fb('0x4')]();var fs_extra=require(_0x09fb('0x5'));var auth=require(_0x09fb('0x6'));var interaction=require(_0x09fb('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x09fb('0x8')]('/',auth[_0x09fb('0x9')](),controller[_0x09fb('0xa')]);router[_0x09fb('0x8')]('/:id',auth[_0x09fb('0x9')](),controller[_0x09fb('0xb')]);router[_0x09fb('0x8')](_0x09fb('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x09fb('0x8')]('/:id/descriptions',auth[_0x09fb('0x9')](),controller[_0x09fb('0xd')]);router[_0x09fb('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x09fb('0xe')]);router['post']('/',auth[_0x09fb('0x9')](),controller['create']);router[_0x09fb('0xf')](_0x09fb('0x10'),auth[_0x09fb('0x9')](),controller['update']);router[_0x09fb('0x11')](_0x09fb('0x10'),auth[_0x09fb('0x9')](),controller[_0x09fb('0x12')]);module[_0x09fb('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index e0655dd..7387405 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 _0x4044=['sequelize','STRING'];(function(_0x459fe2,_0x5a6244){var _0x24dfbd=function(_0x3e4097){while(--_0x3e4097){_0x459fe2['push'](_0x459fe2['shift']());}};_0x24dfbd(++_0x5a6244);}(_0x4044,0xb2));var _0x4404=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4044[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x4404('0x0'));module['exports']={'name':{'type':Sequelize[_0x4404('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3686=['STRING','sequelize','exports'];(function(_0x224953,_0x294a87){var _0x13dea0=function(_0x9f2e6b){while(--_0x9f2e6b){_0x224953['push'](_0x224953['shift']());}};_0x13dea0(++_0x294a87);}(_0x3686,0x85));var _0x6368=function(_0x141a8b,_0x1af879){_0x141a8b=_0x141a8b-0x0;var _0x397e81=_0x3686[_0x141a8b];return _0x397e81;};'use strict';var Sequelize=require(_0x6368('0x0'));module[_0x6368('0x1')]={'name':{'type':Sequelize[_0x6368('0x2')]},'description':{'type':Sequelize[_0x6368('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index e8361b6..8ee8022 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 _0x9d03=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','rows','catch','show','params','rawAttributes','includeAll','include','create','body','destroy','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x42d183,_0x551d38){var _0x16c8d7=function(_0x450e56){while(--_0x450e56){_0x42d183['push'](_0x42d183['shift']());}};_0x16c8d7(++_0x551d38);}(_0x9d03,0x1d3));var _0x39d0=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9d03[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0x39d0('0x0'));var rimraf=require(_0x39d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x39d0('0x2'));var rp=require(_0x39d0('0x3'));var moment=require(_0x39d0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x39d0('0x5'));var util=require(_0x39d0('0x6'));var path=require('path');var sox=require(_0x39d0('0x7'));var csv=require('to-csv');var ejs=require(_0x39d0('0x8'));var fs=require('fs');var fs_extra=require(_0x39d0('0x9'));var _=require(_0x39d0('0xa'));var squel=require(_0x39d0('0xb'));var crypto=require(_0x39d0('0xc'));var jsforce=require(_0x39d0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x39d0('0xe'));var querystring=require(_0x39d0('0xf'));var Papa=require(_0x39d0('0x10'));var Redis=require(_0x39d0('0x11'));var authService=require(_0x39d0('0x12'));var qs=require(_0x39d0('0x13'));var as=require(_0x39d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39d0('0x15'))(_0x39d0('0x16'));var utils=require(_0x39d0('0x17'));var config=require(_0x39d0('0x18'));var licenseUtil=require(_0x39d0('0x19'));var db=require(_0x39d0('0x1a'))['db'];function respondWithStatusCode(_0x3f5762,_0x1761dd){_0x1761dd=_0x1761dd||0xcc;return function(_0x5eda2e){if(_0x5eda2e){return _0x3f5762[_0x39d0('0x1b')](_0x1761dd);}return _0x3f5762['status'](_0x1761dd)[_0x39d0('0x1c')]();};}function respondWithResult(_0x365fc2,_0x3aaa5f){_0x3aaa5f=_0x3aaa5f||0xc8;return function(_0x5c76f7){if(_0x5c76f7){return _0x365fc2['status'](_0x3aaa5f)[_0x39d0('0x1d')](_0x5c76f7);}};}function respondWithFilteredResult(_0x33fdf5,_0x143cd0){return function(_0x975f7a){if(_0x975f7a){var _0xa84da7=typeof _0x143cd0[_0x39d0('0x1e')]===_0x39d0('0x1f')&&typeof _0x143cd0[_0x39d0('0x20')]===_0x39d0('0x1f');var _0x3b09be=_0x975f7a[_0x39d0('0x21')];var _0x4521cb=_0xa84da7?0x0:_0x143cd0[_0x39d0('0x1e')];var _0x14852c=_0xa84da7?_0x975f7a[_0x39d0('0x21')]:_0x143cd0[_0x39d0('0x1e')]+_0x143cd0[_0x39d0('0x20')];var _0x189aac;if(_0x14852c>=_0x3b09be){_0x14852c=_0x3b09be;_0x189aac=0xc8;}else{_0x189aac=0xce;}_0x33fdf5[_0x39d0('0x22')](_0x189aac);return _0x33fdf5[_0x39d0('0x23')]('Content-Range',_0x4521cb+'-'+_0x14852c+'/'+_0x3b09be)[_0x39d0('0x1d')](_0x975f7a);}return null;};}function patchUpdates(_0x229bc7){return function(_0x486e58){try{jsonpatch[_0x39d0('0x24')](_0x486e58,_0x229bc7,!![]);}catch(_0x90ea09){return BPromise[_0x39d0('0x25')](_0x90ea09);}return _0x486e58['save']();};}function saveUpdates(_0x19a848,_0x15272a){return function(_0x106f17){if(_0x106f17){return _0x106f17[_0x39d0('0x26')](_0x19a848)[_0x39d0('0x27')](function(_0x404d6f){return _0x404d6f;});}return null;};}function removeEntity(_0xf6d4e6,_0x52c83d){return function(_0x560203){if(_0x560203){return _0x560203['destroy']()[_0x39d0('0x27')](function(){_0xf6d4e6[_0x39d0('0x22')](0xcc)[_0x39d0('0x1c')]();});}};}function handleEntityNotFound(_0x1b30bd,_0x4c1215){return function(_0xfaf0cf){if(!_0xfaf0cf){_0x1b30bd[_0x39d0('0x1b')](0x194);}return _0xfaf0cf;};}function handleError(_0x52c4e1,_0x2cf93f){_0x2cf93f=_0x2cf93f||0x1f4;return function(_0x555acd){logger[_0x39d0('0x28')](_0x555acd[_0x39d0('0x29')]);if(_0x555acd[_0x39d0('0x2a')]){delete _0x555acd[_0x39d0('0x2a')];}_0x52c4e1['status'](_0x2cf93f)[_0x39d0('0x2b')](_0x555acd);};}exports[_0x39d0('0x2c')]=function(_0x1f7f46,_0x52cd96){var _0x300147={},_0x3c7065={},_0x50aeba={'count':0x0,'rows':[]};var _0xc7ca1f=_[_0x39d0('0x2d')](db[_0x39d0('0x2e')]['rawAttributes'],function(_0x55fa5c){return{'name':_0x55fa5c[_0x39d0('0x2f')],'type':_0x55fa5c['type'][_0x39d0('0x30')]};});_0x3c7065[_0x39d0('0x31')]=_['map'](_0xc7ca1f,_0x39d0('0x2a'));_0x3c7065['query']=_[_0x39d0('0x32')](_0x1f7f46['query']);_0x3c7065[_0x39d0('0x33')]=_[_0x39d0('0x34')](_0x3c7065[_0x39d0('0x31')],_0x3c7065[_0x39d0('0x35')]);_0x300147[_0x39d0('0x36')]=_['intersection'](_0x3c7065[_0x39d0('0x31')],qs['fields'](_0x1f7f46[_0x39d0('0x35')][_0x39d0('0x37')]));_0x300147['attributes']=_0x300147[_0x39d0('0x36')][_0x39d0('0x38')]?_0x300147['attributes']:_0x3c7065[_0x39d0('0x31')];if(!_0x1f7f46[_0x39d0('0x35')][_0x39d0('0x39')](_0x39d0('0x3a'))){_0x300147[_0x39d0('0x20')]=qs[_0x39d0('0x20')](_0x1f7f46[_0x39d0('0x35')][_0x39d0('0x20')]);_0x300147[_0x39d0('0x1e')]=qs[_0x39d0('0x1e')](_0x1f7f46[_0x39d0('0x35')][_0x39d0('0x1e')]);}_0x300147[_0x39d0('0x3b')]=qs[_0x39d0('0x3c')](_0x1f7f46[_0x39d0('0x35')][_0x39d0('0x3c')]);_0x300147[_0x39d0('0x3d')]=qs[_0x39d0('0x33')](_[_0x39d0('0x3e')](_0x1f7f46['query'],_0x3c7065[_0x39d0('0x33')]),_0xc7ca1f);if(_0x1f7f46[_0x39d0('0x35')][_0x39d0('0x3f')]){_0x300147['where']=_['merge'](_0x300147[_0x39d0('0x3d')],{'$or':_['map'](_0xc7ca1f,function(_0x53b322){if(_0x53b322[_0x39d0('0x40')]!=='VIRTUAL'){var _0xc42a83={};_0xc42a83[_0x53b322[_0x39d0('0x2a')]]={'$like':'%'+_0x1f7f46[_0x39d0('0x35')]['filter']+'%'};return _0xc42a83;}})});}_0x300147=_[_0x39d0('0x41')]({},_0x300147,_0x1f7f46[_0x39d0('0x42')]);var _0x410fdb={'where':_0x300147[_0x39d0('0x3d')]};return db[_0x39d0('0x2e')][_0x39d0('0x21')](_0x410fdb)[_0x39d0('0x27')](function(_0x326388){_0x50aeba[_0x39d0('0x21')]=_0x326388;if(_0x1f7f46[_0x39d0('0x35')]['includeAll']){_0x300147['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x300147);})[_0x39d0('0x27')](function(_0x226d58){_0x50aeba[_0x39d0('0x43')]=_0x226d58;return _0x50aeba;})[_0x39d0('0x27')](respondWithFilteredResult(_0x52cd96,_0x300147))[_0x39d0('0x44')](handleError(_0x52cd96,null));};exports[_0x39d0('0x45')]=function(_0x4202db,_0x35802c){var _0x18fe35={'raw':![],'where':{'id':_0x4202db[_0x39d0('0x46')]['id']}},_0x4470d0={};_0x4470d0[_0x39d0('0x31')]=_[_0x39d0('0x32')](db[_0x39d0('0x2e')][_0x39d0('0x47')]);_0x4470d0[_0x39d0('0x35')]=_['keys'](_0x4202db['query']);_0x4470d0[_0x39d0('0x33')]=_['intersection'](_0x4470d0[_0x39d0('0x31')],_0x4470d0[_0x39d0('0x35')]);_0x18fe35[_0x39d0('0x36')]=_[_0x39d0('0x34')](_0x4470d0['model'],qs[_0x39d0('0x37')](_0x4202db['query'][_0x39d0('0x37')]));_0x18fe35['attributes']=_0x18fe35[_0x39d0('0x36')][_0x39d0('0x38')]?_0x18fe35[_0x39d0('0x36')]:_0x4470d0[_0x39d0('0x31')];if(_0x4202db[_0x39d0('0x35')][_0x39d0('0x48')]){_0x18fe35[_0x39d0('0x49')]=[{'all':!![]}];}_0x18fe35=_[_0x39d0('0x41')]({},_0x18fe35,_0x4202db[_0x39d0('0x42')]);return db[_0x39d0('0x2e')]['find'](_0x18fe35)['then'](handleEntityNotFound(_0x35802c,null))[_0x39d0('0x27')](respondWithResult(_0x35802c,null))[_0x39d0('0x44')](handleError(_0x35802c,null));};exports[_0x39d0('0x4a')]=function(_0x194f87,_0x24f0b6){return db[_0x39d0('0x2e')][_0x39d0('0x4a')](_0x194f87[_0x39d0('0x4b')],{})[_0x39d0('0x27')](respondWithResult(_0x24f0b6,0xc9))[_0x39d0('0x44')](handleError(_0x24f0b6,null));};exports[_0x39d0('0x26')]=function(_0x28161b,_0x350a3f){if(_0x28161b[_0x39d0('0x4b')]['id']){delete _0x28161b[_0x39d0('0x4b')]['id'];}return db[_0x39d0('0x2e')]['find']({'where':{'id':_0x28161b['params']['id']}})[_0x39d0('0x27')](handleEntityNotFound(_0x350a3f,null))[_0x39d0('0x27')](saveUpdates(_0x28161b[_0x39d0('0x4b')],null))['then'](respondWithResult(_0x350a3f,null))[_0x39d0('0x44')](handleError(_0x350a3f,null));};exports[_0x39d0('0x4c')]=function(_0x48ef10,_0x470a8a){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x48ef10[_0x39d0('0x46')]['id']}})[_0x39d0('0x27')](handleEntityNotFound(_0x470a8a,null))[_0x39d0('0x27')](removeEntity(_0x470a8a,null))['catch'](handleError(_0x470a8a,null));};exports[_0x39d0('0x4d')]=function(_0x50b6dc,_0x2414f2,_0x4aa31f){var _0x5a12de={};var _0x26eba0={};var _0x4315e8;var _0x3942a;return db[_0x39d0('0x2e')]['findOne']({'where':{'id':_0x50b6dc[_0x39d0('0x46')]['id']}})[_0x39d0('0x27')](handleEntityNotFound(_0x2414f2,null))[_0x39d0('0x27')](function(_0x36d2b1){if(_0x36d2b1){_0x4315e8=_0x36d2b1;_0x26eba0[_0x39d0('0x31')]=_[_0x39d0('0x32')](db[_0x39d0('0x4e')][_0x39d0('0x47')]);_0x26eba0[_0x39d0('0x35')]=_['keys'](_0x50b6dc['query']);_0x26eba0[_0x39d0('0x33')]=_[_0x39d0('0x34')](_0x26eba0['model'],_0x26eba0[_0x39d0('0x35')]);_0x5a12de['attributes']=_['intersection'](_0x26eba0['model'],qs[_0x39d0('0x37')](_0x50b6dc[_0x39d0('0x35')][_0x39d0('0x37')]));_0x5a12de[_0x39d0('0x36')]=_0x5a12de['attributes']['length']?_0x5a12de[_0x39d0('0x36')]:_0x26eba0[_0x39d0('0x31')];_0x5a12de[_0x39d0('0x3b')]=qs[_0x39d0('0x3c')](_0x50b6dc[_0x39d0('0x35')][_0x39d0('0x3c')]);_0x5a12de[_0x39d0('0x3d')]=qs['filters'](_[_0x39d0('0x3e')](_0x50b6dc[_0x39d0('0x35')],_0x26eba0['filters']));if(_0x50b6dc['query'][_0x39d0('0x3f')]){_0x5a12de[_0x39d0('0x3d')]=_[_0x39d0('0x41')](_0x5a12de[_0x39d0('0x3d')],{'$or':_[_0x39d0('0x2d')](_0x5a12de['attributes'],function(_0x1882aa){var _0x1f8c4b={};_0x1f8c4b[_0x1882aa]={'$like':'%'+_0x50b6dc[_0x39d0('0x35')][_0x39d0('0x3f')]+'%'};return _0x1f8c4b;})});}_0x5a12de=_[_0x39d0('0x41')]({},_0x5a12de,_0x50b6dc[_0x39d0('0x42')]);return _0x4315e8[_0x39d0('0x4d')](_0x5a12de);}})[_0x39d0('0x27')](function(_0x20f72e){if(_0x20f72e){_0x3942a=_0x20f72e['length'];if(!_0x50b6dc[_0x39d0('0x35')]['hasOwnProperty'](_0x39d0('0x3a'))){_0x5a12de[_0x39d0('0x20')]=qs['limit'](_0x50b6dc['query'][_0x39d0('0x20')]);_0x5a12de[_0x39d0('0x1e')]=qs['offset'](_0x50b6dc[_0x39d0('0x35')][_0x39d0('0x1e')]);}return _0x4315e8[_0x39d0('0x4d')](_0x5a12de);}})[_0x39d0('0x27')](function(_0x4382d3){if(_0x4382d3){return _0x4382d3?{'count':_0x3942a,'rows':_0x4382d3}:null;}})[_0x39d0('0x27')](respondWithResult(_0x2414f2,null))[_0x39d0('0x44')](handleError(_0x2414f2,null));};exports[_0x39d0('0x4f')]=function(_0x8b15b6,_0x1b6f08,_0xc0e8e7){var _0x52436d={};var _0x4c971e={};var _0x367ebc;var _0x30d9a3;return db[_0x39d0('0x2e')][_0x39d0('0x50')]({'where':{'id':_0x8b15b6[_0x39d0('0x46')]['id']}})[_0x39d0('0x27')](handleEntityNotFound(_0x1b6f08,null))[_0x39d0('0x27')](function(_0x144a3b){if(_0x144a3b){_0x367ebc=_0x144a3b;_0x4c971e[_0x39d0('0x31')]=_[_0x39d0('0x32')](db[_0x39d0('0x4e')]['rawAttributes']);_0x4c971e[_0x39d0('0x35')]=_[_0x39d0('0x32')](_0x8b15b6[_0x39d0('0x35')]);_0x4c971e['filters']=_[_0x39d0('0x34')](_0x4c971e[_0x39d0('0x31')],_0x4c971e[_0x39d0('0x35')]);_0x52436d[_0x39d0('0x36')]=_[_0x39d0('0x34')](_0x4c971e[_0x39d0('0x31')],qs[_0x39d0('0x37')](_0x8b15b6['query'][_0x39d0('0x37')]));_0x52436d[_0x39d0('0x36')]=_0x52436d[_0x39d0('0x36')]['length']?_0x52436d[_0x39d0('0x36')]:_0x4c971e[_0x39d0('0x31')];_0x52436d[_0x39d0('0x3b')]=qs[_0x39d0('0x3c')](_0x8b15b6[_0x39d0('0x35')]['sort']);_0x52436d[_0x39d0('0x3d')]=qs[_0x39d0('0x33')](_[_0x39d0('0x3e')](_0x8b15b6['query'],_0x4c971e[_0x39d0('0x33')]));if(_0x8b15b6['query'][_0x39d0('0x3f')]){_0x52436d[_0x39d0('0x3d')]=_[_0x39d0('0x41')](_0x52436d[_0x39d0('0x3d')],{'$or':_[_0x39d0('0x2d')](_0x52436d[_0x39d0('0x36')],function(_0x116fb2){var _0x2fdeca={};_0x2fdeca[_0x116fb2]={'$like':'%'+_0x8b15b6[_0x39d0('0x35')][_0x39d0('0x3f')]+'%'};return _0x2fdeca;})});}_0x52436d=_[_0x39d0('0x41')]({},_0x52436d,_0x8b15b6[_0x39d0('0x42')]);return _0x367ebc[_0x39d0('0x4f')](_0x52436d);}})['then'](function(_0x54aeda){if(_0x54aeda){_0x30d9a3=_0x54aeda[_0x39d0('0x38')];if(!_0x8b15b6[_0x39d0('0x35')][_0x39d0('0x39')]('nolimit')){_0x52436d[_0x39d0('0x20')]=qs[_0x39d0('0x20')](_0x8b15b6['query'][_0x39d0('0x20')]);_0x52436d[_0x39d0('0x1e')]=qs['offset'](_0x8b15b6[_0x39d0('0x35')]['offset']);}return _0x367ebc[_0x39d0('0x4f')](_0x52436d);}})[_0x39d0('0x27')](function(_0x4ef4ff){if(_0x4ef4ff){return _0x4ef4ff?{'count':_0x30d9a3,'rows':_0x4ef4ff}:null;}})[_0x39d0('0x27')](respondWithResult(_0x1b6f08,null))[_0x39d0('0x44')](handleError(_0x1b6f08,null));};exports['getFields']=function(_0x33ce40,_0x551e28,_0x4dbdec){var _0x7184c5={};var _0x33953d={};var _0x184b25;var _0x242641;return db[_0x39d0('0x2e')][_0x39d0('0x50')]({'where':{'id':_0x33ce40[_0x39d0('0x46')]['id']}})[_0x39d0('0x27')](handleEntityNotFound(_0x551e28,null))[_0x39d0('0x27')](function(_0x5c14d9){if(_0x5c14d9){_0x184b25=_0x5c14d9;_0x33953d[_0x39d0('0x31')]=_[_0x39d0('0x32')](db[_0x39d0('0x4e')][_0x39d0('0x47')]);_0x33953d[_0x39d0('0x35')]=_[_0x39d0('0x32')](_0x33ce40[_0x39d0('0x35')]);_0x33953d[_0x39d0('0x33')]=_[_0x39d0('0x34')](_0x33953d['model'],_0x33953d[_0x39d0('0x35')]);_0x7184c5[_0x39d0('0x36')]=_[_0x39d0('0x34')](_0x33953d[_0x39d0('0x31')],qs['fields'](_0x33ce40[_0x39d0('0x35')]['fields']));_0x7184c5['attributes']=_0x7184c5[_0x39d0('0x36')][_0x39d0('0x38')]?_0x7184c5['attributes']:_0x33953d[_0x39d0('0x31')];_0x7184c5[_0x39d0('0x3b')]=qs['sort'](_0x33ce40['query'][_0x39d0('0x3c')]);_0x7184c5['where']=qs[_0x39d0('0x33')](_['pick'](_0x33ce40[_0x39d0('0x35')],_0x33953d[_0x39d0('0x33')]));if(_0x33ce40[_0x39d0('0x35')]['filter']){_0x7184c5[_0x39d0('0x3d')]=_[_0x39d0('0x41')](_0x7184c5[_0x39d0('0x3d')],{'$or':_['map'](_0x7184c5[_0x39d0('0x36')],function(_0x51ce32){var _0x3102fe={};_0x3102fe[_0x51ce32]={'$like':'%'+_0x33ce40[_0x39d0('0x35')][_0x39d0('0x3f')]+'%'};return _0x3102fe;})});}_0x7184c5=_[_0x39d0('0x41')]({},_0x7184c5,_0x33ce40['options']);return _0x184b25[_0x39d0('0x51')](_0x7184c5);}})[_0x39d0('0x27')](function(_0x2f0be4){if(_0x2f0be4){_0x242641=_0x2f0be4['length'];if(!_0x33ce40['query'][_0x39d0('0x39')](_0x39d0('0x3a'))){_0x7184c5[_0x39d0('0x20')]=qs[_0x39d0('0x20')](_0x33ce40['query']['limit']);_0x7184c5[_0x39d0('0x1e')]=qs['offset'](_0x33ce40['query'][_0x39d0('0x1e')]);}return _0x184b25[_0x39d0('0x51')](_0x7184c5);}})[_0x39d0('0x27')](function(_0xaf0566){if(_0xaf0566){return _0xaf0566?{'count':_0x242641,'rows':_0xaf0566}:null;}})[_0x39d0('0x27')](respondWithResult(_0x551e28,null))[_0x39d0('0x44')](handleError(_0x551e28,null));}; \ No newline at end of file +var _0x02ee=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','filter','where','includeAll','findAll','rows','catch','params','keys','include','merge','options','find','create','body','getSubjects','findOne','pick','nolimit','FreshsalesField','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3046f8,_0x34c7da){var _0x2cb81c=function(_0x3995ce){while(--_0x3995ce){_0x3046f8['push'](_0x3046f8['shift']());}};_0x2cb81c(++_0x34c7da);}(_0x02ee,0xde));var _0xe02e=function(_0x3a997f,_0x5390af){_0x3a997f=_0x3a997f-0x0;var _0x2e4fe4=_0x02ee[_0x3a997f];return _0x2e4fe4;};'use strict';var emlformat=require(_0xe02e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe02e('0x1'));var jsonpatch=require(_0xe02e('0x2'));var rp=require(_0xe02e('0x3'));var moment=require(_0xe02e('0x4'));var BPromise=require(_0xe02e('0x5'));var Mustache=require('mustache');var util=require(_0xe02e('0x6'));var path=require(_0xe02e('0x7'));var sox=require(_0xe02e('0x8'));var csv=require(_0xe02e('0x9'));var ejs=require(_0xe02e('0xa'));var fs=require('fs');var fs_extra=require(_0xe02e('0xb'));var _=require(_0xe02e('0xc'));var squel=require(_0xe02e('0xd'));var crypto=require('crypto');var jsforce=require(_0xe02e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe02e('0x9'));var querystring=require(_0xe02e('0xf'));var Papa=require(_0xe02e('0x10'));var Redis=require(_0xe02e('0x11'));var authService=require(_0xe02e('0x12'));var qs=require(_0xe02e('0x13'));var as=require(_0xe02e('0x14'));var hardwareService=require(_0xe02e('0x15'));var logger=require(_0xe02e('0x16'))('api');var utils=require(_0xe02e('0x17'));var config=require(_0xe02e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe02e('0x19'))['db'];function respondWithStatusCode(_0x2b2029,_0x368c67){_0x368c67=_0x368c67||0xcc;return function(_0x49cb14){if(_0x49cb14){return _0x2b2029[_0xe02e('0x1a')](_0x368c67);}return _0x2b2029[_0xe02e('0x1b')](_0x368c67)[_0xe02e('0x1c')]();};}function respondWithResult(_0x1a55d3,_0x3bc42e){_0x3bc42e=_0x3bc42e||0xc8;return function(_0x1d8193){if(_0x1d8193){return _0x1a55d3[_0xe02e('0x1b')](_0x3bc42e)[_0xe02e('0x1d')](_0x1d8193);}};}function respondWithFilteredResult(_0x2e444b,_0x3e1c5c){return function(_0x25f39f){if(_0x25f39f){var _0x49fba1=typeof _0x3e1c5c[_0xe02e('0x1e')]===_0xe02e('0x1f')&&typeof _0x3e1c5c[_0xe02e('0x20')]===_0xe02e('0x1f');var _0xded2e2=_0x25f39f['count'];var _0x393cff=_0x49fba1?0x0:_0x3e1c5c['offset'];var _0x3c2e2b=_0x49fba1?_0x25f39f[_0xe02e('0x21')]:_0x3e1c5c['offset']+_0x3e1c5c[_0xe02e('0x20')];var _0x4a0caf;if(_0x3c2e2b>=_0xded2e2){_0x3c2e2b=_0xded2e2;_0x4a0caf=0xc8;}else{_0x4a0caf=0xce;}_0x2e444b[_0xe02e('0x1b')](_0x4a0caf);return _0x2e444b['set'](_0xe02e('0x22'),_0x393cff+'-'+_0x3c2e2b+'/'+_0xded2e2)[_0xe02e('0x1d')](_0x25f39f);}return null;};}function patchUpdates(_0x40a21f){return function(_0x1ef6ea){try{jsonpatch[_0xe02e('0x23')](_0x1ef6ea,_0x40a21f,!![]);}catch(_0x50a8d1){return BPromise[_0xe02e('0x24')](_0x50a8d1);}return _0x1ef6ea[_0xe02e('0x25')]();};}function saveUpdates(_0x1437fd,_0x525226){return function(_0x405732){if(_0x405732){return _0x405732[_0xe02e('0x26')](_0x1437fd)[_0xe02e('0x27')](function(_0x18ef8c){return _0x18ef8c;});}return null;};}function removeEntity(_0x2148b3,_0x1711e5){return function(_0x2c47c6){if(_0x2c47c6){return _0x2c47c6[_0xe02e('0x28')]()['then'](function(){_0x2148b3[_0xe02e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b726d,_0x53c01d){return function(_0x10ca7f){if(!_0x10ca7f){_0x5b726d['sendStatus'](0x194);}return _0x10ca7f;};}function handleError(_0x58a0ec,_0x27fd96){_0x27fd96=_0x27fd96||0x1f4;return function(_0x293a07){logger['error'](_0x293a07[_0xe02e('0x29')]);if(_0x293a07['name']){delete _0x293a07[_0xe02e('0x2a')];}_0x58a0ec['status'](_0x27fd96)[_0xe02e('0x2b')](_0x293a07);};}exports['index']=function(_0x33ef2e,_0x78431c){var _0x3c628c={},_0x4b8892={},_0x16ed14={'count':0x0,'rows':[]};var _0xa28093=_[_0xe02e('0x2c')](db[_0xe02e('0x2d')][_0xe02e('0x2e')],function(_0x5e2df1){return{'name':_0x5e2df1[_0xe02e('0x2f')],'type':_0x5e2df1[_0xe02e('0x30')][_0xe02e('0x31')]};});_0x4b8892['model']=_[_0xe02e('0x2c')](_0xa28093,_0xe02e('0x2a'));_0x4b8892['query']=_['keys'](_0x33ef2e[_0xe02e('0x32')]);_0x4b8892['filters']=_['intersection'](_0x4b8892[_0xe02e('0x33')],_0x4b8892[_0xe02e('0x32')]);_0x3c628c['attributes']=_[_0xe02e('0x34')](_0x4b8892[_0xe02e('0x33')],qs[_0xe02e('0x35')](_0x33ef2e['query'][_0xe02e('0x35')]));_0x3c628c[_0xe02e('0x36')]=_0x3c628c[_0xe02e('0x36')][_0xe02e('0x37')]?_0x3c628c[_0xe02e('0x36')]:_0x4b8892[_0xe02e('0x33')];if(!_0x33ef2e[_0xe02e('0x32')][_0xe02e('0x38')]('nolimit')){_0x3c628c[_0xe02e('0x20')]=qs[_0xe02e('0x20')](_0x33ef2e[_0xe02e('0x32')][_0xe02e('0x20')]);_0x3c628c[_0xe02e('0x1e')]=qs['offset'](_0x33ef2e[_0xe02e('0x32')]['offset']);}_0x3c628c[_0xe02e('0x39')]=qs[_0xe02e('0x3a')](_0x33ef2e[_0xe02e('0x32')][_0xe02e('0x3a')]);_0x3c628c['where']=qs[_0xe02e('0x3b')](_['pick'](_0x33ef2e[_0xe02e('0x32')],_0x4b8892[_0xe02e('0x3b')]),_0xa28093);if(_0x33ef2e[_0xe02e('0x32')][_0xe02e('0x3c')]){_0x3c628c[_0xe02e('0x3d')]=_['merge'](_0x3c628c['where'],{'$or':_['map'](_0xa28093,function(_0x37ab61){if(_0x37ab61[_0xe02e('0x30')]!=='VIRTUAL'){var _0x4bf0b1={};_0x4bf0b1[_0x37ab61[_0xe02e('0x2a')]]={'$like':'%'+_0x33ef2e['query'][_0xe02e('0x3c')]+'%'};return _0x4bf0b1;}})});}_0x3c628c=_['merge']({},_0x3c628c,_0x33ef2e['options']);var _0x3093e6={'where':_0x3c628c[_0xe02e('0x3d')]};return db['FreshsalesConfiguration'][_0xe02e('0x21')](_0x3093e6)[_0xe02e('0x27')](function(_0x70e05e){_0x16ed14['count']=_0x70e05e;if(_0x33ef2e[_0xe02e('0x32')][_0xe02e('0x3e')]){_0x3c628c['include']=[{'all':!![]}];}return db[_0xe02e('0x2d')][_0xe02e('0x3f')](_0x3c628c);})[_0xe02e('0x27')](function(_0x339e20){_0x16ed14[_0xe02e('0x40')]=_0x339e20;return _0x16ed14;})[_0xe02e('0x27')](respondWithFilteredResult(_0x78431c,_0x3c628c))[_0xe02e('0x41')](handleError(_0x78431c,null));};exports['show']=function(_0x5a026a,_0x5c0747){var _0x3ffc13={'raw':![],'where':{'id':_0x5a026a[_0xe02e('0x42')]['id']}},_0x291f20={};_0x291f20[_0xe02e('0x33')]=_['keys'](db[_0xe02e('0x2d')][_0xe02e('0x2e')]);_0x291f20[_0xe02e('0x32')]=_[_0xe02e('0x43')](_0x5a026a[_0xe02e('0x32')]);_0x291f20[_0xe02e('0x3b')]=_[_0xe02e('0x34')](_0x291f20['model'],_0x291f20[_0xe02e('0x32')]);_0x3ffc13['attributes']=_[_0xe02e('0x34')](_0x291f20[_0xe02e('0x33')],qs[_0xe02e('0x35')](_0x5a026a[_0xe02e('0x32')][_0xe02e('0x35')]));_0x3ffc13['attributes']=_0x3ffc13[_0xe02e('0x36')]['length']?_0x3ffc13[_0xe02e('0x36')]:_0x291f20[_0xe02e('0x33')];if(_0x5a026a['query'][_0xe02e('0x3e')]){_0x3ffc13[_0xe02e('0x44')]=[{'all':!![]}];}_0x3ffc13=_[_0xe02e('0x45')]({},_0x3ffc13,_0x5a026a[_0xe02e('0x46')]);return db[_0xe02e('0x2d')][_0xe02e('0x47')](_0x3ffc13)[_0xe02e('0x27')](handleEntityNotFound(_0x5c0747,null))[_0xe02e('0x27')](respondWithResult(_0x5c0747,null))[_0xe02e('0x41')](handleError(_0x5c0747,null));};exports['create']=function(_0x2f696f,_0x47c8c8){return db['FreshsalesConfiguration'][_0xe02e('0x48')](_0x2f696f['body'],{})['then'](respondWithResult(_0x47c8c8,0xc9))[_0xe02e('0x41')](handleError(_0x47c8c8,null));};exports[_0xe02e('0x26')]=function(_0x200bdd,_0x5b28bb){if(_0x200bdd[_0xe02e('0x49')]['id']){delete _0x200bdd[_0xe02e('0x49')]['id'];}return db[_0xe02e('0x2d')]['find']({'where':{'id':_0x200bdd[_0xe02e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b28bb,null))['then'](saveUpdates(_0x200bdd[_0xe02e('0x49')],null))['then'](respondWithResult(_0x5b28bb,null))[_0xe02e('0x41')](handleError(_0x5b28bb,null));};exports[_0xe02e('0x28')]=function(_0x8b315c,_0x2e5c6a){return db[_0xe02e('0x2d')][_0xe02e('0x47')]({'where':{'id':_0x8b315c[_0xe02e('0x42')]['id']}})[_0xe02e('0x27')](handleEntityNotFound(_0x2e5c6a,null))['then'](removeEntity(_0x2e5c6a,null))[_0xe02e('0x41')](handleError(_0x2e5c6a,null));};exports[_0xe02e('0x4a')]=function(_0x39e386,_0xd98be9,_0x1b9939){var _0x502545={};var _0x28640e={};var _0x4ba84c;var _0x2aedbb;return db[_0xe02e('0x2d')][_0xe02e('0x4b')]({'where':{'id':_0x39e386['params']['id']}})[_0xe02e('0x27')](handleEntityNotFound(_0xd98be9,null))[_0xe02e('0x27')](function(_0x5845a0){if(_0x5845a0){_0x4ba84c=_0x5845a0;_0x28640e[_0xe02e('0x33')]=_[_0xe02e('0x43')](db['FreshsalesField'][_0xe02e('0x2e')]);_0x28640e[_0xe02e('0x32')]=_[_0xe02e('0x43')](_0x39e386[_0xe02e('0x32')]);_0x28640e[_0xe02e('0x3b')]=_[_0xe02e('0x34')](_0x28640e[_0xe02e('0x33')],_0x28640e[_0xe02e('0x32')]);_0x502545[_0xe02e('0x36')]=_[_0xe02e('0x34')](_0x28640e[_0xe02e('0x33')],qs[_0xe02e('0x35')](_0x39e386['query']['fields']));_0x502545[_0xe02e('0x36')]=_0x502545[_0xe02e('0x36')][_0xe02e('0x37')]?_0x502545[_0xe02e('0x36')]:_0x28640e[_0xe02e('0x33')];_0x502545['order']=qs['sort'](_0x39e386[_0xe02e('0x32')][_0xe02e('0x3a')]);_0x502545[_0xe02e('0x3d')]=qs['filters'](_[_0xe02e('0x4c')](_0x39e386[_0xe02e('0x32')],_0x28640e[_0xe02e('0x3b')]));if(_0x39e386[_0xe02e('0x32')][_0xe02e('0x3c')]){_0x502545[_0xe02e('0x3d')]=_['merge'](_0x502545['where'],{'$or':_['map'](_0x502545[_0xe02e('0x36')],function(_0x50e24c){var _0x195808={};_0x195808[_0x50e24c]={'$like':'%'+_0x39e386[_0xe02e('0x32')]['filter']+'%'};return _0x195808;})});}_0x502545=_['merge']({},_0x502545,_0x39e386['options']);return _0x4ba84c[_0xe02e('0x4a')](_0x502545);}})[_0xe02e('0x27')](function(_0x5bf7a6){if(_0x5bf7a6){_0x2aedbb=_0x5bf7a6[_0xe02e('0x37')];if(!_0x39e386[_0xe02e('0x32')][_0xe02e('0x38')](_0xe02e('0x4d'))){_0x502545[_0xe02e('0x20')]=qs[_0xe02e('0x20')](_0x39e386['query'][_0xe02e('0x20')]);_0x502545[_0xe02e('0x1e')]=qs[_0xe02e('0x1e')](_0x39e386[_0xe02e('0x32')][_0xe02e('0x1e')]);}return _0x4ba84c[_0xe02e('0x4a')](_0x502545);}})[_0xe02e('0x27')](function(_0x35d03f){if(_0x35d03f){return _0x35d03f?{'count':_0x2aedbb,'rows':_0x35d03f}:null;}})[_0xe02e('0x27')](respondWithResult(_0xd98be9,null))['catch'](handleError(_0xd98be9,null));};exports['getDescriptions']=function(_0x24ec9d,_0x3fcd1,_0x5c88ef){var _0x566045={};var _0x4cdc47={};var _0x379f99;var _0x3375f0;return db[_0xe02e('0x2d')][_0xe02e('0x4b')]({'where':{'id':_0x24ec9d[_0xe02e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3fcd1,null))['then'](function(_0x46d70f){if(_0x46d70f){_0x379f99=_0x46d70f;_0x4cdc47[_0xe02e('0x33')]=_[_0xe02e('0x43')](db[_0xe02e('0x4e')][_0xe02e('0x2e')]);_0x4cdc47[_0xe02e('0x32')]=_['keys'](_0x24ec9d[_0xe02e('0x32')]);_0x4cdc47[_0xe02e('0x3b')]=_[_0xe02e('0x34')](_0x4cdc47[_0xe02e('0x33')],_0x4cdc47[_0xe02e('0x32')]);_0x566045[_0xe02e('0x36')]=_[_0xe02e('0x34')](_0x4cdc47[_0xe02e('0x33')],qs[_0xe02e('0x35')](_0x24ec9d[_0xe02e('0x32')][_0xe02e('0x35')]));_0x566045['attributes']=_0x566045[_0xe02e('0x36')][_0xe02e('0x37')]?_0x566045[_0xe02e('0x36')]:_0x4cdc47['model'];_0x566045['order']=qs[_0xe02e('0x3a')](_0x24ec9d['query'][_0xe02e('0x3a')]);_0x566045['where']=qs[_0xe02e('0x3b')](_[_0xe02e('0x4c')](_0x24ec9d[_0xe02e('0x32')],_0x4cdc47[_0xe02e('0x3b')]));if(_0x24ec9d[_0xe02e('0x32')][_0xe02e('0x3c')]){_0x566045['where']=_[_0xe02e('0x45')](_0x566045[_0xe02e('0x3d')],{'$or':_['map'](_0x566045['attributes'],function(_0x45ae31){var _0x4ce101={};_0x4ce101[_0x45ae31]={'$like':'%'+_0x24ec9d[_0xe02e('0x32')][_0xe02e('0x3c')]+'%'};return _0x4ce101;})});}_0x566045=_['merge']({},_0x566045,_0x24ec9d[_0xe02e('0x46')]);return _0x379f99[_0xe02e('0x4f')](_0x566045);}})[_0xe02e('0x27')](function(_0x3b7b64){if(_0x3b7b64){_0x3375f0=_0x3b7b64[_0xe02e('0x37')];if(!_0x24ec9d[_0xe02e('0x32')][_0xe02e('0x38')](_0xe02e('0x4d'))){_0x566045[_0xe02e('0x20')]=qs[_0xe02e('0x20')](_0x24ec9d[_0xe02e('0x32')][_0xe02e('0x20')]);_0x566045['offset']=qs[_0xe02e('0x1e')](_0x24ec9d['query'][_0xe02e('0x1e')]);}return _0x379f99[_0xe02e('0x4f')](_0x566045);}})[_0xe02e('0x27')](function(_0x35d746){if(_0x35d746){return _0x35d746?{'count':_0x3375f0,'rows':_0x35d746}:null;}})[_0xe02e('0x27')](respondWithResult(_0x3fcd1,null))[_0xe02e('0x41')](handleError(_0x3fcd1,null));};exports[_0xe02e('0x50')]=function(_0x5beff0,_0x126f86,_0x5f3244){var _0x36687b={};var _0x42dc65={};var _0x534b83;var _0x2ca61c;return db[_0xe02e('0x2d')][_0xe02e('0x4b')]({'where':{'id':_0x5beff0[_0xe02e('0x42')]['id']}})[_0xe02e('0x27')](handleEntityNotFound(_0x126f86,null))['then'](function(_0x47263f){if(_0x47263f){_0x534b83=_0x47263f;_0x42dc65['model']=_[_0xe02e('0x43')](db[_0xe02e('0x4e')]['rawAttributes']);_0x42dc65[_0xe02e('0x32')]=_[_0xe02e('0x43')](_0x5beff0['query']);_0x42dc65[_0xe02e('0x3b')]=_[_0xe02e('0x34')](_0x42dc65[_0xe02e('0x33')],_0x42dc65[_0xe02e('0x32')]);_0x36687b['attributes']=_[_0xe02e('0x34')](_0x42dc65[_0xe02e('0x33')],qs[_0xe02e('0x35')](_0x5beff0[_0xe02e('0x32')][_0xe02e('0x35')]));_0x36687b[_0xe02e('0x36')]=_0x36687b[_0xe02e('0x36')][_0xe02e('0x37')]?_0x36687b[_0xe02e('0x36')]:_0x42dc65['model'];_0x36687b[_0xe02e('0x39')]=qs[_0xe02e('0x3a')](_0x5beff0['query'][_0xe02e('0x3a')]);_0x36687b[_0xe02e('0x3d')]=qs[_0xe02e('0x3b')](_['pick'](_0x5beff0[_0xe02e('0x32')],_0x42dc65[_0xe02e('0x3b')]));if(_0x5beff0[_0xe02e('0x32')][_0xe02e('0x3c')]){_0x36687b[_0xe02e('0x3d')]=_['merge'](_0x36687b[_0xe02e('0x3d')],{'$or':_[_0xe02e('0x2c')](_0x36687b[_0xe02e('0x36')],function(_0x2fff37){var _0x46b1a1={};_0x46b1a1[_0x2fff37]={'$like':'%'+_0x5beff0['query']['filter']+'%'};return _0x46b1a1;})});}_0x36687b=_[_0xe02e('0x45')]({},_0x36687b,_0x5beff0[_0xe02e('0x46')]);return _0x534b83['getFields'](_0x36687b);}})[_0xe02e('0x27')](function(_0x491c15){if(_0x491c15){_0x2ca61c=_0x491c15[_0xe02e('0x37')];if(!_0x5beff0[_0xe02e('0x32')][_0xe02e('0x38')](_0xe02e('0x4d'))){_0x36687b['limit']=qs[_0xe02e('0x20')](_0x5beff0[_0xe02e('0x32')][_0xe02e('0x20')]);_0x36687b[_0xe02e('0x1e')]=qs[_0xe02e('0x1e')](_0x5beff0[_0xe02e('0x32')][_0xe02e('0x1e')]);}return _0x534b83[_0xe02e('0x50')](_0x36687b);}})[_0xe02e('0x27')](function(_0x4131dc){if(_0x4131dc){return _0x4131dc?{'count':_0x2ca61c,'rows':_0x4131dc}:null;}})[_0xe02e('0x27')](respondWithResult(_0x126f86,null))[_0xe02e('0x41')](handleError(_0x126f86,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 7510fb8..28918ad 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 _0x02a6=['./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x273bc5,_0x3e94a6){var _0xbe65eb=function(_0x9442c1){while(--_0x9442c1){_0x273bc5['push'](_0x273bc5['shift']());}};_0xbe65eb(++_0x3e94a6);}(_0x02a6,0x9c));var _0x602a=function(_0x3b6d19,_0x155af9){_0x3b6d19=_0x3b6d19-0x0;var _0x86e3ab=_0x02a6[_0x3b6d19];return _0x86e3ab;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x602a('0x0'))('api');var moment=require('moment');var BPromise=require(_0x602a('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x602a('0x2'));var config=require(_0x602a('0x3'));var attributes=require(_0x602a('0x4'));module['exports']=function(_0x2071a3,_0x2a72dc){return _0x2071a3[_0x602a('0x5')](_0x602a('0x6'),attributes,{'tableName':_0x602a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7746=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','define'];(function(_0x4c196a,_0x4ae1bd){var _0x19612a=function(_0x4fca63){while(--_0x4fca63){_0x4c196a['push'](_0x4c196a['shift']());}};_0x19612a(++_0x4ae1bd);}(_0x7746,0x141));var _0x6774=function(_0x9d6bdd,_0x17d55d){_0x9d6bdd=_0x9d6bdd-0x0;var _0x1ca3ea=_0x7746[_0x9d6bdd];return _0x1ca3ea;};'use strict';var _=require(_0x6774('0x0'));var util=require(_0x6774('0x1'));var logger=require('../../config/logger')(_0x6774('0x2'));var moment=require('moment');var BPromise=require(_0x6774('0x3'));var rp=require(_0x6774('0x4'));var fs=require('fs');var path=require(_0x6774('0x5'));var rimraf=require(_0x6774('0x6'));var config=require('../../config/environment');var attributes=require(_0x6774('0x7'));module['exports']=function(_0x4d0394,_0x211f6b){return _0x4d0394[_0x6774('0x8')](_0x6774('0x9'),attributes,{'tableName':_0x6774('0xa'),'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 6262ecf..74fb9f0 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 _0xf416=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xf416,0x14a));var _0x6f41=function(_0x4a19d4,_0x1de192){_0x4a19d4=_0x4a19d4-0x0;var _0x5e30a2=_0xf416[_0x4a19d4];return _0x5e30a2;};'use strict';var _=require(_0x6f41('0x0'));var util=require(_0x6f41('0x1'));var moment=require(_0x6f41('0x2'));var BPromise=require(_0x6f41('0x3'));var rs=require(_0x6f41('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f41('0x5'))['db'];var utils=require(_0x6f41('0x6'));var logger=require(_0x6f41('0x7'))('rpc');var config=require(_0x6f41('0x8'));var jayson=require(_0x6f41('0x9'));var client=jayson[_0x6f41('0xa')][_0x6f41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b6e9f,_0x208fc9,_0x1a1760){return new BPromise(function(_0x2c86ae,_0x1d5b62){return client['request'](_0x3b6e9f,_0x1a1760)[_0x6f41('0xc')](function(_0x29fecb){logger[_0x6f41('0xd')](_0x6f41('0xe'),_0x208fc9,_0x6f41('0xf'));logger['debug'](_0x6f41('0x10'),_0x208fc9,_0x6f41('0xf'),JSON[_0x6f41('0x11')](_0x29fecb));if(_0x29fecb[_0x6f41('0x12')]){if(_0x29fecb['error'][_0x6f41('0x13')]===0x1f4){logger[_0x6f41('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x208fc9,_0x29fecb['error'][_0x6f41('0x14')]);return _0x1d5b62(_0x29fecb[_0x6f41('0x12')][_0x6f41('0x14')]);}logger[_0x6f41('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x208fc9,_0x29fecb[_0x6f41('0x12')][_0x6f41('0x14')]);return _0x2c86ae(_0x29fecb[_0x6f41('0x12')][_0x6f41('0x14')]);}else{logger[_0x6f41('0xd')](_0x6f41('0xe'),_0x208fc9,'request\x20sent');_0x2c86ae(_0x29fecb[_0x6f41('0x15')][_0x6f41('0x14')]);}})['catch'](function(_0x57e6a1){logger[_0x6f41('0x12')](_0x6f41('0xe'),_0x208fc9,_0x57e6a1);_0x1d5b62(_0x57e6a1);});});} \ No newline at end of file +var _0x7952=['rpc','../../config/environment','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1839fa,_0x2d18ba){var _0x599af0=function(_0x4b1afe){while(--_0x4b1afe){_0x1839fa['push'](_0x1839fa['shift']());}};_0x599af0(++_0x2d18ba);}(_0x7952,0x1c5));var _0x2795=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0x7952[_0x3f2d02];return _0x54092b;};'use strict';var _=require(_0x2795('0x0'));var util=require(_0x2795('0x1'));var moment=require(_0x2795('0x2'));var BPromise=require(_0x2795('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2795('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2795('0x5'));var logger=require(_0x2795('0x6'))(_0x2795('0x7'));var config=require(_0x2795('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2795('0x9')][_0x2795('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x296f65,_0x7a5353,_0x4a280e){return new BPromise(function(_0x2c0439,_0x536246){return client[_0x2795('0xb')](_0x296f65,_0x4a280e)[_0x2795('0xc')](function(_0xb1b06){logger[_0x2795('0xd')](_0x2795('0xe'),_0x7a5353,_0x2795('0xf'));logger[_0x2795('0x10')](_0x2795('0x11'),_0x7a5353,'request\x20sent',JSON[_0x2795('0x12')](_0xb1b06));if(_0xb1b06['error']){if(_0xb1b06[_0x2795('0x13')]['code']===0x1f4){logger['error'](_0x2795('0xe'),_0x7a5353,_0xb1b06[_0x2795('0x13')][_0x2795('0x14')]);return _0x536246(_0xb1b06[_0x2795('0x13')][_0x2795('0x14')]);}logger[_0x2795('0x13')](_0x2795('0xe'),_0x7a5353,_0xb1b06['error'][_0x2795('0x14')]);return _0x2c0439(_0xb1b06[_0x2795('0x13')][_0x2795('0x14')]);}else{logger[_0x2795('0xd')](_0x2795('0xe'),_0x7a5353,_0x2795('0xf'));_0x2c0439(_0xb1b06[_0x2795('0x15')]['message']);}})[_0x2795('0x16')](function(_0x328be3){logger[_0x2795('0x13')](_0x2795('0xe'),_0x7a5353,_0x328be3);_0x536246(_0x328be3);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index b6a47aa..6899c8e 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 _0xccdc=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xccdc,0x1c4));var _0xcccd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xccdc[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xcccd('0x0'));var util=require(_0xcccd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcccd('0x2'));var router=express[_0xcccd('0x3')]();var fs_extra=require(_0xcccd('0x4'));var auth=require(_0xcccd('0x5'));var interaction=require(_0xcccd('0x6'));var config=require(_0xcccd('0x7'));var controller=require(_0xcccd('0x8'));router[_0xcccd('0x9')]('/',auth[_0xcccd('0xa')](),controller[_0xcccd('0xb')]);router['get'](_0xcccd('0xc'),auth[_0xcccd('0xa')](),controller[_0xcccd('0xd')]);router[_0xcccd('0xe')]('/',auth[_0xcccd('0xa')](),controller[_0xcccd('0xf')]);router[_0xcccd('0x10')](_0xcccd('0xc'),auth['isAuthenticated'](),controller[_0xcccd('0x11')]);router[_0xcccd('0x12')](_0xcccd('0xc'),auth[_0xcccd('0xa')](),controller[_0xcccd('0x13')]);module[_0xcccd('0x14')]=router; \ No newline at end of file +var _0x40b5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xf6c1a6,_0x44fb66){var _0x495a8c=function(_0x309e93){while(--_0x309e93){_0xf6c1a6['push'](_0xf6c1a6['shift']());}};_0x495a8c(++_0x44fb66);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x540b('0x0'));var util=require(_0x540b('0x1'));var path=require(_0x540b('0x2'));var timeout=require(_0x540b('0x3'));var express=require(_0x540b('0x4'));var router=express[_0x540b('0x5')]();var fs_extra=require(_0x540b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x540b('0x7'));var config=require(_0x540b('0x8'));var controller=require(_0x540b('0x9'));router[_0x540b('0xa')]('/',auth[_0x540b('0xb')](),controller['index']);router[_0x540b('0xa')](_0x540b('0xc'),auth[_0x540b('0xb')](),controller[_0x540b('0xd')]);router['post']('/',auth[_0x540b('0xb')](),controller['create']);router['put']('/:id',auth[_0x540b('0xb')](),controller['update']);router[_0x540b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x540b('0xf')]);module[_0x540b('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 3afb59b..e3e308b 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 _0x424d=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0x19afb2,_0x31c806){var _0x43829d=function(_0x1fbd88){while(--_0x1fbd88){_0x19afb2['push'](_0x19afb2['shift']());}};_0x43829d(++_0x31c806);}(_0x424d,0x127));var _0xd424=function(_0x396e8c,_0x40b46f){_0x396e8c=_0x396e8c-0x0;var _0x1415c2=_0x424d[_0x396e8c];return _0x1415c2;};'use strict';var Sequelize=require(_0xd424('0x0'));module[_0xd424('0x1')]={'type':{'type':Sequelize[_0xd424('0x2')](_0xd424('0x3'),'variable',_0xd424('0x4'),_0xd424('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xd424('0x6')]},'key':{'type':Sequelize[_0xd424('0x6')]},'keyType':{'type':Sequelize[_0xd424('0x2')](_0xd424('0x3'),_0xd424('0x7'),_0xd424('0x4'))},'keyContent':{'type':Sequelize[_0xd424('0x6')]},'idField':{'type':Sequelize[_0xd424('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd424('0x6')]}}; \ No newline at end of file +var _0x389c=['sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN'];(function(_0x1acb07,_0x44fa67){var _0x4df84e=function(_0x108b55){while(--_0x108b55){_0x1acb07['push'](_0x1acb07['shift']());}};_0x4df84e(++_0x44fa67);}(_0x389c,0x78));var _0xc389=function(_0xf7c946,_0x42e5c7){_0xf7c946=_0xf7c946-0x0;var _0x1e89b2=_0x389c[_0xf7c946];return _0x1e89b2;};'use strict';var Sequelize=require(_0xc389('0x0'));module[_0xc389('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc389('0x2'),'variable',_0xc389('0x3'),_0xc389('0x4'),_0xc389('0x5')),'defaultValue':_0xc389('0x2')},'content':{'type':Sequelize[_0xc389('0x6')]},'key':{'type':Sequelize[_0xc389('0x6')]},'keyType':{'type':Sequelize[_0xc389('0x7')](_0xc389('0x2'),_0xc389('0x8'),_0xc389('0x3'))},'keyContent':{'type':Sequelize[_0xc389('0x6')]},'idField':{'type':Sequelize[_0xc389('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc389('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc389('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index bde1fc4..bcd725c 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 _0x1f90=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','map','rawAttributes','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','FreshsalesField','include','findAll','rows','show','params','keys','length','includeAll','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1f90,0xd2));var _0x01f9=function(_0x105e01,_0x199717){_0x105e01=_0x105e01-0x0;var _0x421f22=_0x1f90[_0x105e01];return _0x421f22;};'use strict';var emlformat=require(_0x01f9('0x0'));var rimraf=require(_0x01f9('0x1'));var zipdir=require(_0x01f9('0x2'));var jsonpatch=require(_0x01f9('0x3'));var rp=require(_0x01f9('0x4'));var moment=require(_0x01f9('0x5'));var BPromise=require(_0x01f9('0x6'));var Mustache=require(_0x01f9('0x7'));var util=require(_0x01f9('0x8'));var path=require(_0x01f9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01f9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01f9('0xb'));var squel=require(_0x01f9('0xc'));var crypto=require(_0x01f9('0xd'));var jsforce=require(_0x01f9('0xe'));var deskjs=require(_0x01f9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x01f9('0x10'));var Papa=require(_0x01f9('0x11'));var Redis=require(_0x01f9('0x12'));var authService=require(_0x01f9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x01f9('0x14'));var hardwareService=require(_0x01f9('0x15'));var logger=require(_0x01f9('0x16'))('api');var utils=require(_0x01f9('0x17'));var config=require(_0x01f9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x01f9('0x19'))['db'];function respondWithStatusCode(_0x4d51ff,_0x244765){_0x244765=_0x244765||0xcc;return function(_0x1bcc9d){if(_0x1bcc9d){return _0x4d51ff[_0x01f9('0x1a')](_0x244765);}return _0x4d51ff[_0x01f9('0x1b')](_0x244765)[_0x01f9('0x1c')]();};}function respondWithResult(_0x35ec3d,_0x1fc8ae){_0x1fc8ae=_0x1fc8ae||0xc8;return function(_0x71af11){if(_0x71af11){return _0x35ec3d[_0x01f9('0x1b')](_0x1fc8ae)['json'](_0x71af11);}};}function respondWithFilteredResult(_0x267cf6,_0x426718){return function(_0xcda746){if(_0xcda746){var _0x1578a1=typeof _0x426718[_0x01f9('0x1d')]===_0x01f9('0x1e')&&typeof _0x426718[_0x01f9('0x1f')]===_0x01f9('0x1e');var _0x528d3c=_0xcda746[_0x01f9('0x20')];var _0x2cdac7=_0x1578a1?0x0:_0x426718[_0x01f9('0x1d')];var _0x32507e=_0x1578a1?_0xcda746[_0x01f9('0x20')]:_0x426718[_0x01f9('0x1d')]+_0x426718['limit'];var _0x4538ed;if(_0x32507e>=_0x528d3c){_0x32507e=_0x528d3c;_0x4538ed=0xc8;}else{_0x4538ed=0xce;}_0x267cf6[_0x01f9('0x1b')](_0x4538ed);return _0x267cf6[_0x01f9('0x21')](_0x01f9('0x22'),_0x2cdac7+'-'+_0x32507e+'/'+_0x528d3c)[_0x01f9('0x23')](_0xcda746);}return null;};}function patchUpdates(_0x1319e4){return function(_0x5e3378){try{jsonpatch[_0x01f9('0x24')](_0x5e3378,_0x1319e4,!![]);}catch(_0xaab703){return BPromise[_0x01f9('0x25')](_0xaab703);}return _0x5e3378[_0x01f9('0x26')]();};}function saveUpdates(_0x436352,_0x1c537d){return function(_0x297939){if(_0x297939){return _0x297939[_0x01f9('0x27')](_0x436352)[_0x01f9('0x28')](function(_0x259159){return _0x259159;});}return null;};}function removeEntity(_0x1c86c9,_0x5cf965){return function(_0x2100a1){if(_0x2100a1){return _0x2100a1['destroy']()['then'](function(){_0x1c86c9[_0x01f9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32b8ab,_0x22369b){return function(_0x8a9cab){if(!_0x8a9cab){_0x32b8ab['sendStatus'](0x194);}return _0x8a9cab;};}function handleError(_0x8b38e8,_0x2f85fa){_0x2f85fa=_0x2f85fa||0x1f4;return function(_0x27c0c0){logger[_0x01f9('0x29')](_0x27c0c0[_0x01f9('0x2a')]);if(_0x27c0c0[_0x01f9('0x2b')]){delete _0x27c0c0[_0x01f9('0x2b')];}_0x8b38e8[_0x01f9('0x1b')](_0x2f85fa)['send'](_0x27c0c0);};}exports['index']=function(_0x88a5e8,_0x3ef74f){var _0x4ed761={},_0x422e47={},_0x41159f={'count':0x0,'rows':[]};var _0x309d24=_[_0x01f9('0x2c')](db['FreshsalesField'][_0x01f9('0x2d')],function(_0x27b273){return{'name':_0x27b273['fieldName'],'type':_0x27b273[_0x01f9('0x2e')][_0x01f9('0x2f')]};});_0x422e47[_0x01f9('0x30')]=_[_0x01f9('0x2c')](_0x309d24,_0x01f9('0x2b'));_0x422e47['query']=_['keys'](_0x88a5e8['query']);_0x422e47[_0x01f9('0x31')]=_[_0x01f9('0x32')](_0x422e47[_0x01f9('0x30')],_0x422e47[_0x01f9('0x33')]);_0x4ed761[_0x01f9('0x34')]=_[_0x01f9('0x32')](_0x422e47[_0x01f9('0x30')],qs['fields'](_0x88a5e8[_0x01f9('0x33')][_0x01f9('0x35')]));_0x4ed761[_0x01f9('0x34')]=_0x4ed761['attributes']['length']?_0x4ed761[_0x01f9('0x34')]:_0x422e47[_0x01f9('0x30')];if(!_0x88a5e8[_0x01f9('0x33')][_0x01f9('0x36')]('nolimit')){_0x4ed761['limit']=qs[_0x01f9('0x1f')](_0x88a5e8[_0x01f9('0x33')][_0x01f9('0x1f')]);_0x4ed761[_0x01f9('0x1d')]=qs[_0x01f9('0x1d')](_0x88a5e8[_0x01f9('0x33')][_0x01f9('0x1d')]);}_0x4ed761[_0x01f9('0x37')]=qs['sort'](_0x88a5e8['query'][_0x01f9('0x38')]);_0x4ed761[_0x01f9('0x39')]=qs['filters'](_['pick'](_0x88a5e8[_0x01f9('0x33')],_0x422e47['filters']),_0x309d24);if(_0x88a5e8['query'][_0x01f9('0x3a')]){_0x4ed761[_0x01f9('0x39')]=_[_0x01f9('0x3b')](_0x4ed761[_0x01f9('0x39')],{'$or':_[_0x01f9('0x2c')](_0x309d24,function(_0x28939c){if(_0x28939c[_0x01f9('0x2e')]!==_0x01f9('0x3c')){var _0x4cf4d3={};_0x4cf4d3[_0x28939c[_0x01f9('0x2b')]]={'$like':'%'+_0x88a5e8[_0x01f9('0x33')][_0x01f9('0x3a')]+'%'};return _0x4cf4d3;}})});}_0x4ed761=_[_0x01f9('0x3b')]({},_0x4ed761,_0x88a5e8[_0x01f9('0x3d')]);var _0x4c063d={'where':_0x4ed761[_0x01f9('0x39')]};return db[_0x01f9('0x3e')][_0x01f9('0x20')](_0x4c063d)[_0x01f9('0x28')](function(_0x421b57){_0x41159f['count']=_0x421b57;if(_0x88a5e8[_0x01f9('0x33')]['includeAll']){_0x4ed761[_0x01f9('0x3f')]=[{'all':!![]}];}return db[_0x01f9('0x3e')][_0x01f9('0x40')](_0x4ed761);})[_0x01f9('0x28')](function(_0x3dfbf7){_0x41159f[_0x01f9('0x41')]=_0x3dfbf7;return _0x41159f;})[_0x01f9('0x28')](respondWithFilteredResult(_0x3ef74f,_0x4ed761))['catch'](handleError(_0x3ef74f,null));};exports[_0x01f9('0x42')]=function(_0x1e73e2,_0x23fe31){var _0xb51d5f={'raw':!![],'where':{'id':_0x1e73e2[_0x01f9('0x43')]['id']}},_0x1bc5cf={};_0x1bc5cf[_0x01f9('0x30')]=_['keys'](db['FreshsalesField'][_0x01f9('0x2d')]);_0x1bc5cf[_0x01f9('0x33')]=_[_0x01f9('0x44')](_0x1e73e2[_0x01f9('0x33')]);_0x1bc5cf[_0x01f9('0x31')]=_['intersection'](_0x1bc5cf[_0x01f9('0x30')],_0x1bc5cf[_0x01f9('0x33')]);_0xb51d5f[_0x01f9('0x34')]=_[_0x01f9('0x32')](_0x1bc5cf[_0x01f9('0x30')],qs[_0x01f9('0x35')](_0x1e73e2['query'][_0x01f9('0x35')]));_0xb51d5f['attributes']=_0xb51d5f[_0x01f9('0x34')][_0x01f9('0x45')]?_0xb51d5f[_0x01f9('0x34')]:_0x1bc5cf[_0x01f9('0x30')];if(_0x1e73e2[_0x01f9('0x33')][_0x01f9('0x46')]){_0xb51d5f['include']=[{'all':!![]}];}_0xb51d5f=_[_0x01f9('0x3b')]({},_0xb51d5f,_0x1e73e2[_0x01f9('0x3d')]);return db[_0x01f9('0x3e')][_0x01f9('0x47')](_0xb51d5f)[_0x01f9('0x28')](handleEntityNotFound(_0x23fe31,null))[_0x01f9('0x28')](respondWithResult(_0x23fe31,null))[_0x01f9('0x48')](handleError(_0x23fe31,null));};exports[_0x01f9('0x49')]=function(_0x48f918,_0x3c4744){return db[_0x01f9('0x3e')][_0x01f9('0x49')](_0x48f918[_0x01f9('0x4a')],{})[_0x01f9('0x28')](respondWithResult(_0x3c4744,0xc9))['catch'](handleError(_0x3c4744,null));};exports[_0x01f9('0x27')]=function(_0x1cd96b,_0x183e4a){if(_0x1cd96b[_0x01f9('0x4a')]['id']){delete _0x1cd96b[_0x01f9('0x4a')]['id'];}return db[_0x01f9('0x3e')][_0x01f9('0x47')]({'where':{'id':_0x1cd96b[_0x01f9('0x43')]['id']}})[_0x01f9('0x28')](handleEntityNotFound(_0x183e4a,null))[_0x01f9('0x28')](saveUpdates(_0x1cd96b[_0x01f9('0x4a')],null))[_0x01f9('0x28')](respondWithResult(_0x183e4a,null))[_0x01f9('0x48')](handleError(_0x183e4a,null));};exports[_0x01f9('0x4b')]=function(_0x4fa00e,_0x15f544){return db[_0x01f9('0x3e')][_0x01f9('0x47')]({'where':{'id':_0x4fa00e[_0x01f9('0x43')]['id']}})[_0x01f9('0x28')](handleEntityNotFound(_0x15f544,null))['then'](removeEntity(_0x15f544,null))[_0x01f9('0x48')](handleError(_0x15f544,null));}; \ No newline at end of file +var _0x67bc=['error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','intersection','catch','create','body','find','params','eml-format','zip-dir','moment','bluebird','mustache','sox','to-csv','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3129c2,_0x537592){var _0x219f04=function(_0x4f9909){while(--_0x4f9909){_0x3129c2['push'](_0x3129c2['shift']());}};_0x219f04(++_0x537592);}(_0x67bc,0x69));var _0xc67b=function(_0x827d61,_0x127d23){_0x827d61=_0x827d61-0x0;var _0x3d2398=_0x67bc[_0x827d61];return _0x3d2398;};'use strict';var emlformat=require(_0xc67b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc67b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc67b('0x2'));var BPromise=require(_0xc67b('0x3'));var Mustache=require(_0xc67b('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc67b('0x5'));var csv=require(_0xc67b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc67b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc67b('0x8'));var deskjs=require(_0xc67b('0x9'));var toCsv=require(_0xc67b('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc67b('0xa'));var authService=require(_0xc67b('0xb'));var qs=require(_0xc67b('0xc'));var as=require(_0xc67b('0xd'));var hardwareService=require(_0xc67b('0xe'));var logger=require(_0xc67b('0xf'))(_0xc67b('0x10'));var utils=require(_0xc67b('0x11'));var config=require(_0xc67b('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2570e7,_0x35f046){_0x35f046=_0x35f046||0xcc;return function(_0x360f47){if(_0x360f47){return _0x2570e7[_0xc67b('0x13')](_0x35f046);}return _0x2570e7[_0xc67b('0x14')](_0x35f046)[_0xc67b('0x15')]();};}function respondWithResult(_0x13be74,_0x408330){_0x408330=_0x408330||0xc8;return function(_0x57a11d){if(_0x57a11d){return _0x13be74[_0xc67b('0x14')](_0x408330)['json'](_0x57a11d);}};}function respondWithFilteredResult(_0x26c0c4,_0x51d88b){return function(_0x456955){if(_0x456955){var _0x4025c8=typeof _0x51d88b[_0xc67b('0x16')]==='undefined'&&typeof _0x51d88b['limit']===_0xc67b('0x17');var _0x480fbc=_0x456955[_0xc67b('0x18')];var _0x2b0a48=_0x4025c8?0x0:_0x51d88b[_0xc67b('0x16')];var _0x48de92=_0x4025c8?_0x456955['count']:_0x51d88b[_0xc67b('0x16')]+_0x51d88b[_0xc67b('0x19')];var _0x1abbb8;if(_0x48de92>=_0x480fbc){_0x48de92=_0x480fbc;_0x1abbb8=0xc8;}else{_0x1abbb8=0xce;}_0x26c0c4[_0xc67b('0x14')](_0x1abbb8);return _0x26c0c4['set'](_0xc67b('0x1a'),_0x2b0a48+'-'+_0x48de92+'/'+_0x480fbc)['json'](_0x456955);}return null;};}function patchUpdates(_0x8784f){return function(_0x2a197f){try{jsonpatch[_0xc67b('0x1b')](_0x2a197f,_0x8784f,!![]);}catch(_0x7ad352){return BPromise[_0xc67b('0x1c')](_0x7ad352);}return _0x2a197f[_0xc67b('0x1d')]();};}function saveUpdates(_0x3a3d9d,_0xff16a){return function(_0x4a789c){if(_0x4a789c){return _0x4a789c[_0xc67b('0x1e')](_0x3a3d9d)[_0xc67b('0x1f')](function(_0x2d0f81){return _0x2d0f81;});}return null;};}function removeEntity(_0x315ffd,_0x2498b4){return function(_0x29f4b3){if(_0x29f4b3){return _0x29f4b3[_0xc67b('0x20')]()[_0xc67b('0x1f')](function(){_0x315ffd['status'](0xcc)[_0xc67b('0x15')]();});}};}function handleEntityNotFound(_0x1dd02c,_0xd6715c){return function(_0x5bec93){if(!_0x5bec93){_0x1dd02c[_0xc67b('0x13')](0x194);}return _0x5bec93;};}function handleError(_0x7b3a49,_0x211d4a){_0x211d4a=_0x211d4a||0x1f4;return function(_0x4b0b07){logger[_0xc67b('0x21')](_0x4b0b07[_0xc67b('0x22')]);if(_0x4b0b07[_0xc67b('0x23')]){delete _0x4b0b07['name'];}_0x7b3a49[_0xc67b('0x14')](_0x211d4a)[_0xc67b('0x24')](_0x4b0b07);};}exports[_0xc67b('0x25')]=function(_0x48ca52,_0x519e0f){var _0x4e2bed={},_0x472ec0={},_0x49fcbd={'count':0x0,'rows':[]};var _0x4ff518=_[_0xc67b('0x26')](db[_0xc67b('0x27')][_0xc67b('0x28')],function(_0x1cf7a2){return{'name':_0x1cf7a2[_0xc67b('0x29')],'type':_0x1cf7a2['type'][_0xc67b('0x2a')]};});_0x472ec0['model']=_[_0xc67b('0x26')](_0x4ff518,_0xc67b('0x23'));_0x472ec0['query']=_[_0xc67b('0x2b')](_0x48ca52[_0xc67b('0x2c')]);_0x472ec0[_0xc67b('0x2d')]=_['intersection'](_0x472ec0[_0xc67b('0x2e')],_0x472ec0[_0xc67b('0x2c')]);_0x4e2bed[_0xc67b('0x2f')]=_['intersection'](_0x472ec0[_0xc67b('0x2e')],qs[_0xc67b('0x30')](_0x48ca52[_0xc67b('0x2c')]['fields']));_0x4e2bed[_0xc67b('0x2f')]=_0x4e2bed[_0xc67b('0x2f')][_0xc67b('0x31')]?_0x4e2bed[_0xc67b('0x2f')]:_0x472ec0[_0xc67b('0x2e')];if(!_0x48ca52['query'][_0xc67b('0x32')](_0xc67b('0x33'))){_0x4e2bed['limit']=qs[_0xc67b('0x19')](_0x48ca52['query'][_0xc67b('0x19')]);_0x4e2bed[_0xc67b('0x16')]=qs[_0xc67b('0x16')](_0x48ca52[_0xc67b('0x2c')][_0xc67b('0x16')]);}_0x4e2bed['order']=qs[_0xc67b('0x34')](_0x48ca52[_0xc67b('0x2c')][_0xc67b('0x34')]);_0x4e2bed[_0xc67b('0x35')]=qs[_0xc67b('0x2d')](_[_0xc67b('0x36')](_0x48ca52[_0xc67b('0x2c')],_0x472ec0['filters']),_0x4ff518);if(_0x48ca52[_0xc67b('0x2c')][_0xc67b('0x37')]){_0x4e2bed[_0xc67b('0x35')]=_['merge'](_0x4e2bed[_0xc67b('0x35')],{'$or':_[_0xc67b('0x26')](_0x4ff518,function(_0x80db9e){if(_0x80db9e[_0xc67b('0x38')]!=='VIRTUAL'){var _0x4f93b2={};_0x4f93b2[_0x80db9e[_0xc67b('0x23')]]={'$like':'%'+_0x48ca52[_0xc67b('0x2c')][_0xc67b('0x37')]+'%'};return _0x4f93b2;}})});}_0x4e2bed=_[_0xc67b('0x39')]({},_0x4e2bed,_0x48ca52[_0xc67b('0x3a')]);var _0x3be14c={'where':_0x4e2bed['where']};return db[_0xc67b('0x27')][_0xc67b('0x18')](_0x3be14c)[_0xc67b('0x1f')](function(_0xed81b7){_0x49fcbd[_0xc67b('0x18')]=_0xed81b7;if(_0x48ca52[_0xc67b('0x2c')][_0xc67b('0x3b')]){_0x4e2bed[_0xc67b('0x3c')]=[{'all':!![]}];}return db[_0xc67b('0x27')][_0xc67b('0x3d')](_0x4e2bed);})[_0xc67b('0x1f')](function(_0x2243ef){_0x49fcbd[_0xc67b('0x3e')]=_0x2243ef;return _0x49fcbd;})[_0xc67b('0x1f')](respondWithFilteredResult(_0x519e0f,_0x4e2bed))['catch'](handleError(_0x519e0f,null));};exports['show']=function(_0x4aa436,_0x3c11a9){var _0x1e34a4={'raw':!![],'where':{'id':_0x4aa436['params']['id']}},_0x277c76={};_0x277c76[_0xc67b('0x2e')]=_[_0xc67b('0x2b')](db[_0xc67b('0x27')][_0xc67b('0x28')]);_0x277c76['query']=_[_0xc67b('0x2b')](_0x4aa436[_0xc67b('0x2c')]);_0x277c76[_0xc67b('0x2d')]=_[_0xc67b('0x3f')](_0x277c76['model'],_0x277c76[_0xc67b('0x2c')]);_0x1e34a4[_0xc67b('0x2f')]=_[_0xc67b('0x3f')](_0x277c76['model'],qs[_0xc67b('0x30')](_0x4aa436['query'][_0xc67b('0x30')]));_0x1e34a4[_0xc67b('0x2f')]=_0x1e34a4[_0xc67b('0x2f')][_0xc67b('0x31')]?_0x1e34a4['attributes']:_0x277c76[_0xc67b('0x2e')];if(_0x4aa436['query'][_0xc67b('0x3b')]){_0x1e34a4[_0xc67b('0x3c')]=[{'all':!![]}];}_0x1e34a4=_['merge']({},_0x1e34a4,_0x4aa436['options']);return db[_0xc67b('0x27')]['find'](_0x1e34a4)[_0xc67b('0x1f')](handleEntityNotFound(_0x3c11a9,null))['then'](respondWithResult(_0x3c11a9,null))[_0xc67b('0x40')](handleError(_0x3c11a9,null));};exports[_0xc67b('0x41')]=function(_0x2f971d,_0x3438df){return db[_0xc67b('0x27')][_0xc67b('0x41')](_0x2f971d[_0xc67b('0x42')],{})[_0xc67b('0x1f')](respondWithResult(_0x3438df,0xc9))[_0xc67b('0x40')](handleError(_0x3438df,null));};exports[_0xc67b('0x1e')]=function(_0x4da8d6,_0x37ecbb){if(_0x4da8d6[_0xc67b('0x42')]['id']){delete _0x4da8d6['body']['id'];}return db[_0xc67b('0x27')][_0xc67b('0x43')]({'where':{'id':_0x4da8d6[_0xc67b('0x44')]['id']}})[_0xc67b('0x1f')](handleEntityNotFound(_0x37ecbb,null))['then'](saveUpdates(_0x4da8d6['body'],null))[_0xc67b('0x1f')](respondWithResult(_0x37ecbb,null))['catch'](handleError(_0x37ecbb,null));};exports['destroy']=function(_0x435ddf,_0x5b8c85){return db[_0xc67b('0x27')][_0xc67b('0x43')]({'where':{'id':_0x435ddf['params']['id']}})['then'](handleEntityNotFound(_0x5b8c85,null))[_0xc67b('0x1f')](removeEntity(_0x5b8c85,null))['catch'](handleError(_0x5b8c85,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 780c4fc..b8b318c 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 _0x9f0e=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x3ff8f3,_0x354e15){var _0x3841c0=function(_0x41a469){while(--_0x41a469){_0x3ff8f3['push'](_0x3ff8f3['shift']());}};_0x3841c0(++_0x354e15);}(_0x9f0e,0x116));var _0xe9f0=function(_0x24cf90,_0x1de83d){_0x24cf90=_0x24cf90-0x0;var _0xede7b=_0x9f0e[_0x24cf90];return _0xede7b;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var logger=require(_0xe9f0('0x2'))(_0xe9f0('0x3'));var moment=require(_0xe9f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9f0('0x5'));var rimraf=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var attributes=require(_0xe9f0('0x8'));module[_0xe9f0('0x9')]=function(_0x50313d,_0x5b87c1){return _0x50313d[_0xe9f0('0xa')](_0xe9f0('0xb'),attributes,{'tableName':_0xe9f0('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xe9f0('0xd'),_0xe9f0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2e=['idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0xbc346f,_0x3db5c0){var _0x9f9260=function(_0x37e6b9){while(--_0x37e6b9){_0xbc346f['push'](_0xbc346f['shift']());}};_0x9f9260(++_0x3db5c0);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x37086d,_0x832e8d){_0x37086d=_0x37086d-0x0;var _0x4792b4=_0x4e2e[_0x37086d];return _0x4792b4;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[{'name':_0xe4e2('0xd'),'fields':[_0xe4e2('0xe'),_0xe4e2('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 c0dd5d7..85c71cc 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 _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x396698,_0x183c85){var _0x670fbc=function(_0x206fb5){while(--_0x206fb5){_0x396698['push'](_0x396698['shift']());}};_0x670fbc(++_0x183c85);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1116b6,_0x314f2b){_0x1116b6=_0x1116b6-0x0;var _0x23de54=_0xc1c6[_0x1116b6];return _0x23de54;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file +var _0xeda8=['debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x3a82b9,_0x311756){var _0x252884=function(_0x346cf9){while(--_0x346cf9){_0x3a82b9['push'](_0x3a82b9['shift']());}};_0x252884(++_0x311756);}(_0xeda8,0x104));var _0x8eda=function(_0x40617d,_0x41fafd){_0x40617d=_0x40617d-0x0;var _0x726049=_0xeda8[_0x40617d];return _0x726049;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 34b8268..ddd23c0 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(_0x1d84b3,_0x1ae59d){var _0x2ec82b=function(_0x2be5ae){while(--_0x2be5ae){_0x1d84b3['push'](_0x1d84b3['shift']());}};_0x2ec82b(++_0x1ae59d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x30a4a3,_0x5e7c7e){var _0x110768=function(_0x5e10a8){while(--_0x5e10a8){_0x30a4a3['push'](_0x30a4a3['shift']());}};_0x110768(++_0x5e7c7e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 c6d7031..a2acd4f 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 _0x7708=['integrationTab','newTab','sequelize','exports','STRING'];(function(_0x216550,_0x5bd28d){var _0x460cda=function(_0x321d46){while(--_0x321d46){_0x216550['push'](_0x216550['shift']());}};_0x460cda(++_0x5bd28d);}(_0x7708,0x188));var _0x8770=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7708[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8770('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x8770('0x2')]},'clientSecret':{'type':Sequelize[_0x8770('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x8770('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8770('0x3'),_0x8770('0x4')),'defaultValue':_0x8770('0x3')}}; \ No newline at end of file +var _0x151b=['integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x3ea625,_0x33990b){var _0x48fc1c=function(_0x3ca06d){while(--_0x3ca06d){_0x3ea625['push'](_0x3ea625['shift']());}};_0x48fc1c(++_0x33990b);}(_0x151b,0x152));var _0xb151=function(_0x55ba1e,_0xab82b3){_0x55ba1e=_0x55ba1e-0x0;var _0x1cdda2=_0x151b[_0x55ba1e];return _0x1cdda2;};'use strict';var Sequelize=require(_0xb151('0x0'));module[_0xb151('0x1')]={'name':{'type':Sequelize[_0xb151('0x2')]},'description':{'type':Sequelize[_0xb151('0x2')]},'username':{'type':Sequelize[_0xb151('0x2')],'unique':_0xb151('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb151('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xb151('0x2')]},'securityToken':{'type':Sequelize[_0xb151('0x2')]},'serverUrl':{'type':Sequelize[_0xb151('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb151('0x4'),_0xb151('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 02db90d..e6a6395 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 _0xec9d=['order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','rawAttributes','options','catch','body','update','find','params','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','create','SalesforceField','Descriptions','getFields','clientId','username','password','remoteUri','slice','substring','lastIndexOf','clientSecret','login','securityToken','ticketType','sobject','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','phone','remove','includes','label','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x534c4b,_0x2abb9e){var _0x4f6dc1=function(_0x8e6fd5){while(--_0x8e6fd5){_0x534c4b['push'](_0x534c4b['shift']());}};_0x4f6dc1(++_0x2abb9e);}(_0xec9d,0x133));var _0xdec9=function(_0x102996,_0x2f6efd){_0x102996=_0x102996-0x0;var _0x1d0db3=_0xec9d[_0x102996];return _0x1d0db3;};'use strict';var emlformat=require(_0xdec9('0x0'));var rimraf=require(_0xdec9('0x1'));var zipdir=require(_0xdec9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdec9('0x3'));var util=require(_0xdec9('0x4'));var path=require(_0xdec9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdec9('0x6'));var fs=require('fs');var fs_extra=require(_0xdec9('0x7'));var _=require(_0xdec9('0x8'));var squel=require('squel');var crypto=require(_0xdec9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xdec9('0xa'));var toCsv=require(_0xdec9('0xb'));var querystring=require(_0xdec9('0xc'));var Papa=require(_0xdec9('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdec9('0xe'));var as=require(_0xdec9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdec9('0x10'))(_0xdec9('0x11'));var utils=require(_0xdec9('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xdec9('0x13'));var db=require(_0xdec9('0x14'))['db'];var integrations=require(_0xdec9('0x15'));function respondWithStatusCode(_0x60f741,_0xd22793){_0xd22793=_0xd22793||0xcc;return function(_0x2ce2ec){if(_0x2ce2ec){return _0x60f741[_0xdec9('0x16')](_0xd22793);}return _0x60f741[_0xdec9('0x17')](_0xd22793)[_0xdec9('0x18')]();};}function respondWithResult(_0x12453a,_0x30d7d2){_0x30d7d2=_0x30d7d2||0xc8;return function(_0x222a69){if(_0x222a69){return _0x12453a[_0xdec9('0x17')](_0x30d7d2)[_0xdec9('0x19')](_0x222a69);}};}function respondWithFilteredResult(_0x9cdb79,_0x1197c8){return function(_0x302a24){if(_0x302a24){var _0x14f3b0=typeof _0x1197c8[_0xdec9('0x1a')]===_0xdec9('0x1b')&&typeof _0x1197c8[_0xdec9('0x1c')]==='undefined';var _0x5e21ca=_0x302a24[_0xdec9('0x1d')];var _0x312ba7=_0x14f3b0?0x0:_0x1197c8[_0xdec9('0x1a')];var _0x321676=_0x14f3b0?_0x302a24[_0xdec9('0x1d')]:_0x1197c8[_0xdec9('0x1a')]+_0x1197c8['limit'];var _0x3c7395;if(_0x321676>=_0x5e21ca){_0x321676=_0x5e21ca;_0x3c7395=0xc8;}else{_0x3c7395=0xce;}_0x9cdb79[_0xdec9('0x17')](_0x3c7395);return _0x9cdb79[_0xdec9('0x1e')](_0xdec9('0x1f'),_0x312ba7+'-'+_0x321676+'/'+_0x5e21ca)[_0xdec9('0x19')](_0x302a24);}return null;};}function patchUpdates(_0x571856){return function(_0x4db805){try{jsonpatch[_0xdec9('0x20')](_0x4db805,_0x571856,!![]);}catch(_0x2fe916){return BPromise[_0xdec9('0x21')](_0x2fe916);}return _0x4db805['save']();};}function saveUpdates(_0x4d9ba6,_0x4a3104){return function(_0x3260bd){if(_0x3260bd){return _0x3260bd['update'](_0x4d9ba6)[_0xdec9('0x22')](function(_0xb2e896){return _0xb2e896;});}return null;};}function removeEntity(_0x44006e,_0x2c95de){return function(_0x500ffd){if(_0x500ffd){return _0x500ffd[_0xdec9('0x23')]()[_0xdec9('0x22')](function(){_0x44006e[_0xdec9('0x17')](0xcc)[_0xdec9('0x18')]();});}};}function handleEntityNotFound(_0x393356,_0x4807f0){return function(_0x34f95e){if(!_0x34f95e){_0x393356[_0xdec9('0x16')](0x194);}return _0x34f95e;};}function handleError(_0x52cebd,_0x66995c){_0x66995c=_0x66995c||0x1f4;return function(_0x2ecb4e){logger[_0xdec9('0x24')](_0x2ecb4e[_0xdec9('0x25')]);if(_0x2ecb4e[_0xdec9('0x26')]){delete _0x2ecb4e[_0xdec9('0x26')];}_0x52cebd[_0xdec9('0x17')](_0x66995c)[_0xdec9('0x27')](_0x2ecb4e);};}exports[_0xdec9('0x28')]=function(_0x73375f,_0x3ed466){var _0x8ec62f={},_0x335c5e={},_0x677e0={'count':0x0,'rows':[]};var _0x402bed=_[_0xdec9('0x29')](db[_0xdec9('0x2a')]['rawAttributes'],function(_0x5b1341){return{'name':_0x5b1341[_0xdec9('0x2b')],'type':_0x5b1341[_0xdec9('0x2c')][_0xdec9('0x2d')]};});_0x335c5e[_0xdec9('0x2e')]=_[_0xdec9('0x29')](_0x402bed,_0xdec9('0x26'));_0x335c5e[_0xdec9('0x2f')]=_[_0xdec9('0x30')](_0x73375f[_0xdec9('0x2f')]);_0x335c5e[_0xdec9('0x31')]=_[_0xdec9('0x32')](_0x335c5e['model'],_0x335c5e['query']);_0x8ec62f[_0xdec9('0x33')]=_[_0xdec9('0x32')](_0x335c5e[_0xdec9('0x2e')],qs['fields'](_0x73375f['query'][_0xdec9('0x34')]));_0x8ec62f[_0xdec9('0x33')]=_0x8ec62f['attributes'][_0xdec9('0x35')]?_0x8ec62f[_0xdec9('0x33')]:_0x335c5e[_0xdec9('0x2e')];if(!_0x73375f[_0xdec9('0x2f')][_0xdec9('0x36')](_0xdec9('0x37'))){_0x8ec62f[_0xdec9('0x1c')]=qs[_0xdec9('0x1c')](_0x73375f[_0xdec9('0x2f')][_0xdec9('0x1c')]);_0x8ec62f[_0xdec9('0x1a')]=qs[_0xdec9('0x1a')](_0x73375f[_0xdec9('0x2f')]['offset']);}_0x8ec62f[_0xdec9('0x38')]=qs['sort'](_0x73375f[_0xdec9('0x2f')][_0xdec9('0x39')]);_0x8ec62f[_0xdec9('0x3a')]=qs[_0xdec9('0x31')](_[_0xdec9('0x3b')](_0x73375f['query'],_0x335c5e[_0xdec9('0x31')]),_0x402bed);if(_0x73375f[_0xdec9('0x2f')][_0xdec9('0x3c')]){_0x8ec62f[_0xdec9('0x3a')]=_['merge'](_0x8ec62f['where'],{'$or':_[_0xdec9('0x29')](_0x402bed,function(_0xfb3c11){if(_0xfb3c11['type']!==_0xdec9('0x3d')){var _0x35b931={};_0x35b931[_0xfb3c11['name']]={'$like':'%'+_0x73375f[_0xdec9('0x2f')][_0xdec9('0x3c')]+'%'};return _0x35b931;}})});}_0x8ec62f=_[_0xdec9('0x3e')]({},_0x8ec62f,_0x73375f['options']);var _0x14e27c={'where':_0x8ec62f[_0xdec9('0x3a')]};return db['SalesforceAccount'][_0xdec9('0x1d')](_0x14e27c)[_0xdec9('0x22')](function(_0x24c068){_0x677e0[_0xdec9('0x1d')]=_0x24c068;if(_0x73375f[_0xdec9('0x2f')][_0xdec9('0x3f')]){_0x8ec62f[_0xdec9('0x40')]=[{'all':!![]}];}return db[_0xdec9('0x2a')][_0xdec9('0x41')](_0x8ec62f);})[_0xdec9('0x22')](function(_0x415bd7){_0x677e0[_0xdec9('0x42')]=_0x415bd7;return _0x677e0;})['then'](respondWithFilteredResult(_0x3ed466,_0x8ec62f))['catch'](handleError(_0x3ed466,null));};exports[_0xdec9('0x43')]=function(_0xb0b7ad,_0x23a2b5){var _0x2e2964={'raw':![],'where':{'id':_0xb0b7ad['params']['id']}},_0x2a64ee={};_0x2a64ee[_0xdec9('0x2e')]=_[_0xdec9('0x30')](db[_0xdec9('0x2a')][_0xdec9('0x44')]);_0x2a64ee[_0xdec9('0x2f')]=_['keys'](_0xb0b7ad[_0xdec9('0x2f')]);_0x2a64ee[_0xdec9('0x31')]=_['intersection'](_0x2a64ee[_0xdec9('0x2e')],_0x2a64ee[_0xdec9('0x2f')]);_0x2e2964[_0xdec9('0x33')]=_[_0xdec9('0x32')](_0x2a64ee[_0xdec9('0x2e')],qs['fields'](_0xb0b7ad[_0xdec9('0x2f')][_0xdec9('0x34')]));_0x2e2964[_0xdec9('0x33')]=_0x2e2964[_0xdec9('0x33')]['length']?_0x2e2964[_0xdec9('0x33')]:_0x2a64ee[_0xdec9('0x2e')];if(_0xb0b7ad[_0xdec9('0x2f')][_0xdec9('0x3f')]){_0x2e2964[_0xdec9('0x40')]=[{'all':!![]}];}_0x2e2964=_['merge']({},_0x2e2964,_0xb0b7ad[_0xdec9('0x45')]);return db[_0xdec9('0x2a')]['find'](_0x2e2964)[_0xdec9('0x22')](handleEntityNotFound(_0x23a2b5,null))[_0xdec9('0x22')](respondWithResult(_0x23a2b5,null))[_0xdec9('0x46')](handleError(_0x23a2b5,null));};exports['create']=function(_0x1d6da8,_0x282498){return db[_0xdec9('0x2a')]['create'](_0x1d6da8[_0xdec9('0x47')],{})[_0xdec9('0x22')](respondWithResult(_0x282498,0xc9))[_0xdec9('0x46')](handleError(_0x282498,null));};exports[_0xdec9('0x48')]=function(_0x44d9e1,_0x2f5a37){if(_0x44d9e1[_0xdec9('0x47')]['id']){delete _0x44d9e1['body']['id'];}return db['SalesforceAccount'][_0xdec9('0x49')]({'where':{'id':_0x44d9e1[_0xdec9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f5a37,null))[_0xdec9('0x22')](saveUpdates(_0x44d9e1[_0xdec9('0x47')],null))['then'](respondWithResult(_0x2f5a37,null))[_0xdec9('0x46')](handleError(_0x2f5a37,null));};exports[_0xdec9('0x23')]=function(_0x5c2581,_0x54e002){return db['SalesforceAccount']['find']({'where':{'id':_0x5c2581[_0xdec9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x54e002,null))[_0xdec9('0x22')](removeEntity(_0x54e002,null))['catch'](handleError(_0x54e002,null));};exports[_0xdec9('0x4b')]=function(_0x1d4536,_0xf45e99,_0xf591df){var _0x33a442={};var _0x3136ce={};var _0x30c61e;var _0x28c094;return db[_0xdec9('0x2a')]['findOne']({'where':{'id':_0x1d4536['params']['id']}})[_0xdec9('0x22')](handleEntityNotFound(_0xf45e99,null))[_0xdec9('0x22')](function(_0x5ebe89){if(_0x5ebe89){_0x30c61e=_0x5ebe89;_0x3136ce[_0xdec9('0x2e')]=_[_0xdec9('0x30')](db['SalesforceConfiguration'][_0xdec9('0x44')]);_0x3136ce[_0xdec9('0x2f')]=_['keys'](_0x1d4536[_0xdec9('0x2f')]);_0x3136ce[_0xdec9('0x31')]=_[_0xdec9('0x32')](_0x3136ce[_0xdec9('0x2e')],_0x3136ce[_0xdec9('0x2f')]);_0x33a442[_0xdec9('0x33')]=_[_0xdec9('0x32')](_0x3136ce['model'],qs[_0xdec9('0x34')](_0x1d4536[_0xdec9('0x2f')]['fields']));_0x33a442[_0xdec9('0x33')]=_0x33a442[_0xdec9('0x33')][_0xdec9('0x35')]?_0x33a442[_0xdec9('0x33')]:_0x3136ce[_0xdec9('0x2e')];_0x33a442[_0xdec9('0x38')]=qs['sort'](_0x1d4536[_0xdec9('0x2f')][_0xdec9('0x39')]);_0x33a442[_0xdec9('0x3a')]=qs[_0xdec9('0x31')](_[_0xdec9('0x3b')](_0x1d4536[_0xdec9('0x2f')],_0x3136ce[_0xdec9('0x31')]));if(_0x1d4536['query'][_0xdec9('0x3c')]){_0x33a442[_0xdec9('0x3a')]=_[_0xdec9('0x3e')](_0x33a442[_0xdec9('0x3a')],{'$or':_['map'](_0x33a442[_0xdec9('0x33')],function(_0x386431){var _0x2694d6={};_0x2694d6[_0x386431]={'$like':'%'+_0x1d4536[_0xdec9('0x2f')]['filter']+'%'};return _0x2694d6;})});}_0x33a442=_['merge']({},_0x33a442,_0x1d4536['options']);return _0x30c61e[_0xdec9('0x4b')](_0x33a442);}})[_0xdec9('0x22')](function(_0x489aff){if(_0x489aff){_0x28c094=_0x489aff[_0xdec9('0x35')];if(!_0x1d4536[_0xdec9('0x2f')][_0xdec9('0x36')](_0xdec9('0x37'))){_0x33a442['limit']=qs['limit'](_0x1d4536['query'][_0xdec9('0x1c')]);_0x33a442[_0xdec9('0x1a')]=qs[_0xdec9('0x1a')](_0x1d4536['query'][_0xdec9('0x1a')]);}return _0x30c61e[_0xdec9('0x4b')](_0x33a442);}})[_0xdec9('0x22')](function(_0x750ede){if(_0x750ede){return _0x750ede?{'count':_0x28c094,'rows':_0x750ede}:null;}})['then'](respondWithResult(_0xf45e99,null))[_0xdec9('0x46')](handleError(_0xf45e99,null));};exports[_0xdec9('0x4c')]=function(_0x33aa64,_0x38c906,_0x46ba2a){if(_0x33aa64[_0xdec9('0x47')]['id']){delete _0x33aa64[_0xdec9('0x47')]['id'];}return db[_0xdec9('0x2a')][_0xdec9('0x4d')]({'where':{'id':_0x33aa64['params']['id']}})[_0xdec9('0x22')](handleEntityNotFound(_0x38c906,null))['then'](function(_0x3a9952){if(_0x3a9952){_0x33aa64[_0xdec9('0x47')][_0xdec9('0x4e')]=_0x3a9952['id'];_0x33aa64[_0xdec9('0x47')][_0xdec9('0x4f')]=integrations['getSubjects'](_0x33aa64[_0xdec9('0x47')][_0xdec9('0x50')],_0x33aa64[_0xdec9('0x47')][_0xdec9('0x2c')]);_0x33aa64[_0xdec9('0x47')]['Descriptions']=integrations['getDescriptions'](_0x33aa64[_0xdec9('0x47')]['channel'],_0x33aa64['body'][_0xdec9('0x2c')]);return db['SalesforceConfiguration'][_0xdec9('0x51')](_0x33aa64[_0xdec9('0x47')],{'include':[{'model':db[_0xdec9('0x52')],'as':_0xdec9('0x4f')},{'model':db[_0xdec9('0x52')],'as':_0xdec9('0x53')}]});}return null;})[_0xdec9('0x22')](respondWithResult(_0x38c906,null))[_0xdec9('0x46')](handleError(_0x38c906,null));};exports[_0xdec9('0x54')]=function(_0x3d4432,_0x18e237,_0x12611c){var _0x34bb8c;var _0x28b652='';var _0x2170d4='Task';return db[_0xdec9('0x2a')][_0xdec9('0x4d')]({'where':{'id':_0x3d4432['params']['id']},'attributes':['id','remoteUri',_0xdec9('0x55'),'clientSecret',_0xdec9('0x56'),_0xdec9('0x57'),'securityToken']})['then'](handleEntityNotFound(_0x18e237,null))['then'](function(_0x38ddb8){if(_0x38ddb8){_0x28b652=_0x38ddb8[_0xdec9('0x58')];var _0x4427b4=_0x28b652[_0xdec9('0x59')](-0x1);if(_0x4427b4==='/'){_0x28b652=_0x28b652[_0xdec9('0x5a')](0x0,_0x28b652[_0xdec9('0x5b')](_0x4427b4));}_0x34bb8c=new jsforce['Connection']({'oauth2':{'loginUrl':_0x28b652,'clientId':_0x38ddb8['clientId'],'clientSecret':_0x38ddb8[_0xdec9('0x5c')]}});return _0x34bb8c[_0xdec9('0x5d')](_0x38ddb8[_0xdec9('0x56')],_0x38ddb8[_0xdec9('0x57')]['concat'](_0x38ddb8[_0xdec9('0x5e')]));}})[_0xdec9('0x22')](function(_0x57088e){if(_0x57088e){if(!_['isNil'](_0x3d4432[_0xdec9('0x2f')][_0xdec9('0x5f')])){_0x2170d4=_0x3d4432[_0xdec9('0x2f')][_0xdec9('0x5f')];}return _0x34bb8c[_0xdec9('0x60')](_0x2170d4)['describe']();}})[_0xdec9('0x22')](function(_0x13192c){var _0x49f46e=[_0xdec9('0x61'),'ActivityDate',_0xdec9('0x62'),_0xdec9('0x63'),_0xdec9('0x64'),_0xdec9('0x65')];var _0x1c70e3=[_0xdec9('0x66'),_0xdec9('0x67'),_0xdec9('0x68'),_0xdec9('0x69'),_0xdec9('0x6a'),'textarea',_0xdec9('0x6b')];if(_0x13192c){_[_0xdec9('0x6c')](_0x13192c[_0xdec9('0x34')],function(_0x2c8f60){return _0x49f46e[_0xdec9('0x6d')](_0x2c8f60[_0xdec9('0x26')])||!_0x1c70e3[_0xdec9('0x6d')](_0x2c8f60[_0xdec9('0x2c')]);});return{'count':_0x13192c[_0xdec9('0x34')][_0xdec9('0x35')],'rows':_[_0xdec9('0x29')](_0x13192c['fields'],function(_0x2d8b84){return{'id':_0x2d8b84[_0xdec9('0x26')],'name':_0x2d8b84[_0xdec9('0x6e')],'custom':_0x2d8b84['custom'],'options':_0x2d8b84[_0xdec9('0x6f')][_0xdec9('0x35')]>0x0?_[_0xdec9('0x29')](_0x2d8b84[_0xdec9('0x6f')],function(_0x1d1925){return{'name':_0x1d1925[_0xdec9('0x6e')],'value':_0x1d1925['value']};}):_0x2d8b84[_0xdec9('0x2c')]==_0xdec9('0x69')?[{'name':_0xdec9('0x70'),'value':_0xdec9('0x71')},{'name':_0xdec9('0x72'),'value':_0xdec9('0x73')}]:[]};})};}})[_0xdec9('0x22')](respondWithResult(_0x18e237,null))[_0xdec9('0x46')](function(_0x895fef){var _0x3a29f5=_0x3d4432[_0xdec9('0x2f')][_0xdec9('0x74')]?0x1f4:_0x895fef[_0xdec9('0x75')]||0x1f4;logger[_0xdec9('0x24')](_0xdec9('0x76'),_0xdec9('0x54'),_0x3a29f5,JSON[_0xdec9('0x77')](_0x895fef));delete _0x895fef[_0xdec9('0x26')];if(_0x3a29f5===0x191){_0x3a29f5=0x190;}_0x18e237['status'](_0x3a29f5)['send'](_0x3d4432['query'][_0xdec9('0x74')]?{'message':_0xdec9('0x78'),'statusCode':_0x895fef[_0xdec9('0x75')]}:_0x895fef);});}; \ No newline at end of file +var _0x514c=['phone','includes','label','custom','picklistValues','value','boolean','True','true','False','false','test','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','filter','merge','options','SalesforceAccount','then','includeAll','include','catch','show','params','length','find','create','body','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','SalesforceField','getFields','Task','clientSecret','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','clientId','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','email','textarea'];(function(_0x22e3e7,_0x8d6b19){var _0x21250c=function(_0x55a497){while(--_0x55a497){_0x22e3e7['push'](_0x22e3e7['shift']());}};_0x21250c(++_0x8d6b19);}(_0x514c,0x189));var _0xc514=function(_0x56b557,_0x1da326){_0x56b557=_0x56b557-0x0;var _0x1102dd=_0x514c[_0x56b557];return _0x1102dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc514('0x0'));var zipdir=require(_0xc514('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc514('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc514('0x3'));var util=require(_0xc514('0x4'));var path=require(_0xc514('0x5'));var sox=require(_0xc514('0x6'));var csv=require(_0xc514('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc514('0x8'));var squel=require(_0xc514('0x9'));var crypto=require(_0xc514('0xa'));var jsforce=require(_0xc514('0xb'));var deskjs=require(_0xc514('0xc'));var toCsv=require(_0xc514('0x7'));var querystring=require(_0xc514('0xd'));var Papa=require(_0xc514('0xe'));var Redis=require(_0xc514('0xf'));var authService=require(_0xc514('0x10'));var qs=require(_0xc514('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc514('0x12'));var logger=require(_0xc514('0x13'))(_0xc514('0x14'));var utils=require(_0xc514('0x15'));var config=require(_0xc514('0x16'));var licenseUtil=require(_0xc514('0x17'));var db=require(_0xc514('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2f14df,_0x599811){_0x599811=_0x599811||0xcc;return function(_0x5cff31){if(_0x5cff31){return _0x2f14df['sendStatus'](_0x599811);}return _0x2f14df[_0xc514('0x19')](_0x599811)[_0xc514('0x1a')]();};}function respondWithResult(_0xfd01aa,_0x498f92){_0x498f92=_0x498f92||0xc8;return function(_0x3454f3){if(_0x3454f3){return _0xfd01aa[_0xc514('0x19')](_0x498f92)[_0xc514('0x1b')](_0x3454f3);}};}function respondWithFilteredResult(_0x27bd42,_0x5dd8e2){return function(_0x937456){if(_0x937456){var _0x2b8d98=typeof _0x5dd8e2[_0xc514('0x1c')]==='undefined'&&typeof _0x5dd8e2[_0xc514('0x1d')]===_0xc514('0x1e');var _0x46d76e=_0x937456['count'];var _0x53cae2=_0x2b8d98?0x0:_0x5dd8e2[_0xc514('0x1c')];var _0x13f38d=_0x2b8d98?_0x937456[_0xc514('0x1f')]:_0x5dd8e2[_0xc514('0x1c')]+_0x5dd8e2[_0xc514('0x1d')];var _0x54d350;if(_0x13f38d>=_0x46d76e){_0x13f38d=_0x46d76e;_0x54d350=0xc8;}else{_0x54d350=0xce;}_0x27bd42[_0xc514('0x19')](_0x54d350);return _0x27bd42[_0xc514('0x20')](_0xc514('0x21'),_0x53cae2+'-'+_0x13f38d+'/'+_0x46d76e)[_0xc514('0x1b')](_0x937456);}return null;};}function patchUpdates(_0x2a2142){return function(_0x3da600){try{jsonpatch[_0xc514('0x22')](_0x3da600,_0x2a2142,!![]);}catch(_0x16c1b0){return BPromise[_0xc514('0x23')](_0x16c1b0);}return _0x3da600[_0xc514('0x24')]();};}function saveUpdates(_0x41a583,_0x3b857){return function(_0x4b1cf2){if(_0x4b1cf2){return _0x4b1cf2[_0xc514('0x25')](_0x41a583)['then'](function(_0xc04f6){return _0xc04f6;});}return null;};}function removeEntity(_0x22593e,_0x47d405){return function(_0x2ccd05){if(_0x2ccd05){return _0x2ccd05[_0xc514('0x26')]()['then'](function(){_0x22593e[_0xc514('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bd5fa,_0x41ce54){return function(_0x569205){if(!_0x569205){_0x4bd5fa[_0xc514('0x27')](0x194);}return _0x569205;};}function handleError(_0x1e0301,_0x55fd62){_0x55fd62=_0x55fd62||0x1f4;return function(_0x12752b){logger[_0xc514('0x28')](_0x12752b[_0xc514('0x29')]);if(_0x12752b['name']){delete _0x12752b['name'];}_0x1e0301[_0xc514('0x19')](_0x55fd62)[_0xc514('0x2a')](_0x12752b);};}exports['index']=function(_0x58382e,_0xad944a){var _0x47d7a9={},_0xf7d370={},_0x3e9c7c={'count':0x0,'rows':[]};var _0x4c474a=_[_0xc514('0x2b')](db['SalesforceAccount'][_0xc514('0x2c')],function(_0x2439dd){return{'name':_0x2439dd[_0xc514('0x2d')],'type':_0x2439dd[_0xc514('0x2e')][_0xc514('0x2f')]};});_0xf7d370[_0xc514('0x30')]=_[_0xc514('0x2b')](_0x4c474a,_0xc514('0x31'));_0xf7d370[_0xc514('0x32')]=_[_0xc514('0x33')](_0x58382e[_0xc514('0x32')]);_0xf7d370['filters']=_['intersection'](_0xf7d370[_0xc514('0x30')],_0xf7d370[_0xc514('0x32')]);_0x47d7a9[_0xc514('0x34')]=_[_0xc514('0x35')](_0xf7d370[_0xc514('0x30')],qs[_0xc514('0x36')](_0x58382e[_0xc514('0x32')]['fields']));_0x47d7a9['attributes']=_0x47d7a9[_0xc514('0x34')]['length']?_0x47d7a9['attributes']:_0xf7d370[_0xc514('0x30')];if(!_0x58382e[_0xc514('0x32')][_0xc514('0x37')]('nolimit')){_0x47d7a9['limit']=qs[_0xc514('0x1d')](_0x58382e[_0xc514('0x32')][_0xc514('0x1d')]);_0x47d7a9[_0xc514('0x1c')]=qs[_0xc514('0x1c')](_0x58382e[_0xc514('0x32')]['offset']);}_0x47d7a9[_0xc514('0x38')]=qs[_0xc514('0x39')](_0x58382e[_0xc514('0x32')][_0xc514('0x39')]);_0x47d7a9[_0xc514('0x3a')]=qs['filters'](_['pick'](_0x58382e[_0xc514('0x32')],_0xf7d370[_0xc514('0x3b')]),_0x4c474a);if(_0x58382e[_0xc514('0x32')][_0xc514('0x3c')]){_0x47d7a9[_0xc514('0x3a')]=_['merge'](_0x47d7a9[_0xc514('0x3a')],{'$or':_['map'](_0x4c474a,function(_0x3280b6){if(_0x3280b6[_0xc514('0x2e')]!=='VIRTUAL'){var _0x266829={};_0x266829[_0x3280b6[_0xc514('0x31')]]={'$like':'%'+_0x58382e[_0xc514('0x32')][_0xc514('0x3c')]+'%'};return _0x266829;}})});}_0x47d7a9=_[_0xc514('0x3d')]({},_0x47d7a9,_0x58382e[_0xc514('0x3e')]);var _0x2f6641={'where':_0x47d7a9[_0xc514('0x3a')]};return db[_0xc514('0x3f')][_0xc514('0x1f')](_0x2f6641)[_0xc514('0x40')](function(_0x28c9c9){_0x3e9c7c[_0xc514('0x1f')]=_0x28c9c9;if(_0x58382e['query'][_0xc514('0x41')]){_0x47d7a9[_0xc514('0x42')]=[{'all':!![]}];}return db[_0xc514('0x3f')]['findAll'](_0x47d7a9);})['then'](function(_0x1114f4){_0x3e9c7c['rows']=_0x1114f4;return _0x3e9c7c;})[_0xc514('0x40')](respondWithFilteredResult(_0xad944a,_0x47d7a9))[_0xc514('0x43')](handleError(_0xad944a,null));};exports[_0xc514('0x44')]=function(_0x116d20,_0x12a8d9){var _0x157df6={'raw':![],'where':{'id':_0x116d20[_0xc514('0x45')]['id']}},_0x56a377={};_0x56a377[_0xc514('0x30')]=_[_0xc514('0x33')](db[_0xc514('0x3f')][_0xc514('0x2c')]);_0x56a377[_0xc514('0x32')]=_[_0xc514('0x33')](_0x116d20[_0xc514('0x32')]);_0x56a377[_0xc514('0x3b')]=_[_0xc514('0x35')](_0x56a377[_0xc514('0x30')],_0x56a377[_0xc514('0x32')]);_0x157df6[_0xc514('0x34')]=_[_0xc514('0x35')](_0x56a377[_0xc514('0x30')],qs['fields'](_0x116d20[_0xc514('0x32')][_0xc514('0x36')]));_0x157df6[_0xc514('0x34')]=_0x157df6['attributes'][_0xc514('0x46')]?_0x157df6['attributes']:_0x56a377[_0xc514('0x30')];if(_0x116d20[_0xc514('0x32')][_0xc514('0x41')]){_0x157df6[_0xc514('0x42')]=[{'all':!![]}];}_0x157df6=_[_0xc514('0x3d')]({},_0x157df6,_0x116d20['options']);return db[_0xc514('0x3f')][_0xc514('0x47')](_0x157df6)[_0xc514('0x40')](handleEntityNotFound(_0x12a8d9,null))[_0xc514('0x40')](respondWithResult(_0x12a8d9,null))[_0xc514('0x43')](handleError(_0x12a8d9,null));};exports[_0xc514('0x48')]=function(_0x38c372,_0x337763){return db['SalesforceAccount']['create'](_0x38c372[_0xc514('0x49')],{})[_0xc514('0x40')](respondWithResult(_0x337763,0xc9))[_0xc514('0x43')](handleError(_0x337763,null));};exports[_0xc514('0x25')]=function(_0x4f2bba,_0x336e2f){if(_0x4f2bba[_0xc514('0x49')]['id']){delete _0x4f2bba[_0xc514('0x49')]['id'];}return db['SalesforceAccount'][_0xc514('0x47')]({'where':{'id':_0x4f2bba[_0xc514('0x45')]['id']}})['then'](handleEntityNotFound(_0x336e2f,null))[_0xc514('0x40')](saveUpdates(_0x4f2bba['body'],null))['then'](respondWithResult(_0x336e2f,null))[_0xc514('0x43')](handleError(_0x336e2f,null));};exports[_0xc514('0x26')]=function(_0x516b89,_0x518e1a){return db[_0xc514('0x3f')][_0xc514('0x47')]({'where':{'id':_0x516b89[_0xc514('0x45')]['id']}})[_0xc514('0x40')](handleEntityNotFound(_0x518e1a,null))[_0xc514('0x40')](removeEntity(_0x518e1a,null))[_0xc514('0x43')](handleError(_0x518e1a,null));};exports['getConfigurations']=function(_0x1373f5,_0x40b7bf,_0x54222f){var _0x1da651={};var _0x4fbb36={};var _0x5cf577;var _0x2207ca;return db[_0xc514('0x3f')]['findOne']({'where':{'id':_0x1373f5[_0xc514('0x45')]['id']}})[_0xc514('0x40')](handleEntityNotFound(_0x40b7bf,null))['then'](function(_0x56b76e){if(_0x56b76e){_0x5cf577=_0x56b76e;_0x4fbb36['model']=_[_0xc514('0x33')](db['SalesforceConfiguration'][_0xc514('0x2c')]);_0x4fbb36[_0xc514('0x32')]=_[_0xc514('0x33')](_0x1373f5['query']);_0x4fbb36['filters']=_[_0xc514('0x35')](_0x4fbb36[_0xc514('0x30')],_0x4fbb36['query']);_0x1da651[_0xc514('0x34')]=_['intersection'](_0x4fbb36['model'],qs[_0xc514('0x36')](_0x1373f5['query']['fields']));_0x1da651[_0xc514('0x34')]=_0x1da651[_0xc514('0x34')][_0xc514('0x46')]?_0x1da651[_0xc514('0x34')]:_0x4fbb36[_0xc514('0x30')];_0x1da651['order']=qs[_0xc514('0x39')](_0x1373f5['query'][_0xc514('0x39')]);_0x1da651['where']=qs['filters'](_['pick'](_0x1373f5[_0xc514('0x32')],_0x4fbb36[_0xc514('0x3b')]));if(_0x1373f5['query']['filter']){_0x1da651['where']=_[_0xc514('0x3d')](_0x1da651[_0xc514('0x3a')],{'$or':_[_0xc514('0x2b')](_0x1da651['attributes'],function(_0x241122){var _0x20d05c={};_0x20d05c[_0x241122]={'$like':'%'+_0x1373f5[_0xc514('0x32')][_0xc514('0x3c')]+'%'};return _0x20d05c;})});}_0x1da651=_[_0xc514('0x3d')]({},_0x1da651,_0x1373f5[_0xc514('0x3e')]);return _0x5cf577[_0xc514('0x4a')](_0x1da651);}})['then'](function(_0x2b9413){if(_0x2b9413){_0x2207ca=_0x2b9413['length'];if(!_0x1373f5[_0xc514('0x32')][_0xc514('0x37')](_0xc514('0x4b'))){_0x1da651[_0xc514('0x1d')]=qs['limit'](_0x1373f5['query'][_0xc514('0x1d')]);_0x1da651[_0xc514('0x1c')]=qs['offset'](_0x1373f5[_0xc514('0x32')][_0xc514('0x1c')]);}return _0x5cf577[_0xc514('0x4a')](_0x1da651);}})['then'](function(_0x42e914){if(_0x42e914){return _0x42e914?{'count':_0x2207ca,'rows':_0x42e914}:null;}})[_0xc514('0x40')](respondWithResult(_0x40b7bf,null))[_0xc514('0x43')](handleError(_0x40b7bf,null));};exports[_0xc514('0x4c')]=function(_0x2d21f2,_0x4af297,_0xca47fb){if(_0x2d21f2[_0xc514('0x49')]['id']){delete _0x2d21f2[_0xc514('0x49')]['id'];}return db['SalesforceAccount'][_0xc514('0x4d')]({'where':{'id':_0x2d21f2[_0xc514('0x45')]['id']}})[_0xc514('0x40')](handleEntityNotFound(_0x4af297,null))[_0xc514('0x40')](function(_0x194a70){if(_0x194a70){_0x2d21f2[_0xc514('0x49')][_0xc514('0x4e')]=_0x194a70['id'];_0x2d21f2[_0xc514('0x49')][_0xc514('0x4f')]=integrations[_0xc514('0x50')](_0x2d21f2[_0xc514('0x49')]['channel'],_0x2d21f2['body'][_0xc514('0x2e')]);_0x2d21f2['body'][_0xc514('0x51')]=integrations['getDescriptions'](_0x2d21f2['body'][_0xc514('0x52')],_0x2d21f2['body'][_0xc514('0x2e')]);return db['SalesforceConfiguration']['create'](_0x2d21f2[_0xc514('0x49')],{'include':[{'model':db[_0xc514('0x53')],'as':_0xc514('0x4f')},{'model':db[_0xc514('0x53')],'as':_0xc514('0x51')}]});}return null;})['then'](respondWithResult(_0x4af297,null))[_0xc514('0x43')](handleError(_0x4af297,null));};exports[_0xc514('0x54')]=function(_0xb8c2d4,_0x511900,_0x45d430){var _0x496459;var _0xcba89a='';var _0x4cb80f=_0xc514('0x55');return db[_0xc514('0x3f')]['findOne']({'where':{'id':_0xb8c2d4[_0xc514('0x45')]['id']},'attributes':['id','remoteUri','clientId',_0xc514('0x56'),_0xc514('0x57'),_0xc514('0x58'),_0xc514('0x59')]})[_0xc514('0x40')](handleEntityNotFound(_0x511900,null))['then'](function(_0x2a7e15){if(_0x2a7e15){_0xcba89a=_0x2a7e15[_0xc514('0x5a')];var _0x56715b=_0xcba89a[_0xc514('0x5b')](-0x1);if(_0x56715b==='/'){_0xcba89a=_0xcba89a[_0xc514('0x5c')](0x0,_0xcba89a[_0xc514('0x5d')](_0x56715b));}_0x496459=new jsforce[(_0xc514('0x5e'))]({'oauth2':{'loginUrl':_0xcba89a,'clientId':_0x2a7e15[_0xc514('0x5f')],'clientSecret':_0x2a7e15[_0xc514('0x56')]}});return _0x496459[_0xc514('0x60')](_0x2a7e15[_0xc514('0x57')],_0x2a7e15[_0xc514('0x58')][_0xc514('0x61')](_0x2a7e15[_0xc514('0x59')]));}})['then'](function(_0x3dd41a){if(_0x3dd41a){if(!_[_0xc514('0x62')](_0xb8c2d4[_0xc514('0x32')][_0xc514('0x63')])){_0x4cb80f=_0xb8c2d4[_0xc514('0x32')][_0xc514('0x63')];}return _0x496459[_0xc514('0x64')](_0x4cb80f)['describe']();}})[_0xc514('0x40')](function(_0x587ed9){var _0x18ea67=[_0xc514('0x65'),_0xc514('0x66'),_0xc514('0x67'),_0xc514('0x68'),_0xc514('0x69'),'Description'];var _0x17c175=[_0xc514('0x6a'),_0xc514('0x6b'),_0xc514('0x6c'),'boolean',_0xc514('0x6d'),_0xc514('0x6e'),_0xc514('0x6f')];if(_0x587ed9){_['remove'](_0x587ed9[_0xc514('0x36')],function(_0x234b1c){return _0x18ea67['includes'](_0x234b1c[_0xc514('0x31')])||!_0x17c175[_0xc514('0x70')](_0x234b1c[_0xc514('0x2e')]);});return{'count':_0x587ed9['fields']['length'],'rows':_['map'](_0x587ed9['fields'],function(_0x90854e){return{'id':_0x90854e[_0xc514('0x31')],'name':_0x90854e[_0xc514('0x71')],'custom':_0x90854e[_0xc514('0x72')],'options':_0x90854e[_0xc514('0x73')][_0xc514('0x46')]>0x0?_['map'](_0x90854e[_0xc514('0x73')],function(_0xf3fce8){return{'name':_0xf3fce8[_0xc514('0x71')],'value':_0xf3fce8[_0xc514('0x74')]};}):_0x90854e['type']==_0xc514('0x75')?[{'name':_0xc514('0x76'),'value':_0xc514('0x77')},{'name':_0xc514('0x78'),'value':_0xc514('0x79')}]:[]};})};}})['then'](respondWithResult(_0x511900,null))[_0xc514('0x43')](function(_0x536568){var _0x54876f=_0xb8c2d4['query'][_0xc514('0x7a')]?0x1f4:_0x536568['statusCode']||0x1f4;logger[_0xc514('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xc514('0x54'),_0x54876f,JSON[_0xc514('0x7b')](_0x536568));delete _0x536568['name'];if(_0x54876f===0x191){_0x54876f=0x190;}_0x511900[_0xc514('0x19')](_0x54876f)['send'](_0xb8c2d4['query'][_0xc514('0x7a')]?{'message':_0xc514('0x7c'),'statusCode':_0x536568[_0xc514('0x7d')]}:_0x536568);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 2028afe..82e050f 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 _0x0897=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash'];(function(_0x5455b4,_0xa134fd){var _0x3636fd=function(_0x28453f){while(--_0x28453f){_0x5455b4['push'](_0x5455b4['shift']());}};_0x3636fd(++_0xa134fd);}(_0x0897,0x167));var _0x7089=function(_0x4c3fe4,_0x2acb23){_0x4c3fe4=_0x4c3fe4-0x0;var _0x4262fd=_0x0897[_0x4c3fe4];return _0x4262fd;};'use strict';var _=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var logger=require(_0x7089('0x2'))(_0x7089('0x3'));var moment=require('moment');var BPromise=require(_0x7089('0x4'));var rp=require(_0x7089('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7089('0x6'));var config=require(_0x7089('0x7'));var attributes=require(_0x7089('0x8'));var integrations=require(_0x7089('0x9'));module[_0x7089('0xa')]=function(_0x1910ac,_0x37a952){return _0x1910ac['define']('SalesforceAccount',attributes,{'tableName':_0x7089('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3ed=['exports','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xd3ed,0xf4));var _0xdd3e=function(_0x37d3ae,_0x2da2c5){_0x37d3ae=_0x37d3ae-0x0;var _0x4054e4=_0xd3ed[_0x37d3ae];return _0x4054e4;};'use strict';var _=require('lodash');var util=require(_0xdd3e('0x0'));var logger=require(_0xdd3e('0x1'))(_0xdd3e('0x2'));var moment=require(_0xdd3e('0x3'));var BPromise=require(_0xdd3e('0x4'));var rp=require(_0xdd3e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd3e('0x6'));var config=require('../../config/environment');var attributes=require(_0xdd3e('0x7'));var integrations=require(_0xdd3e('0x8'));module[_0xdd3e('0x9')]=function(_0x502137,_0x258d42){return _0x502137['define']('SalesforceAccount',attributes,{'tableName':_0xdd3e('0xa'),'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 4ac2be5..a967246 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 _0xdd22=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','model','map','where','ShowSalesforceAccount','util','moment'];(function(_0x4b5dda,_0x588402){var _0x3f28aa=function(_0x36d103){while(--_0x36d103){_0x4b5dda['push'](_0x4b5dda['shift']());}};_0x3f28aa(++_0x588402);}(_0xdd22,0x166));var _0x2dd2=function(_0x3be669,_0x2c46ad){_0x3be669=_0x3be669-0x0;var _0x22190f=_0xdd22[_0x3be669];return _0x22190f;};'use strict';var _=require('lodash');var util=require(_0x2dd2('0x0'));var moment=require(_0x2dd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x2dd2('0x2'));var fs=require('fs');var Redis=require(_0x2dd2('0x3'));var db=require(_0x2dd2('0x4'))['db'];var utils=require(_0x2dd2('0x5'));var logger=require(_0x2dd2('0x6'))('rpc');var config=require(_0x2dd2('0x7'));var jayson=require(_0x2dd2('0x8'));var client=jayson[_0x2dd2('0x9')][_0x2dd2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13c60c,_0x435ea3,_0x433fd5){return new BPromise(function(_0x436e25,_0x2a080d){return client[_0x2dd2('0xb')](_0x13c60c,_0x433fd5)[_0x2dd2('0xc')](function(_0x387f3e){logger[_0x2dd2('0xd')](_0x2dd2('0xe'),_0x435ea3,_0x2dd2('0xf'));logger[_0x2dd2('0x10')](_0x2dd2('0x11'),_0x435ea3,_0x2dd2('0xf'),JSON[_0x2dd2('0x12')](_0x387f3e));if(_0x387f3e[_0x2dd2('0x13')]){if(_0x387f3e[_0x2dd2('0x13')][_0x2dd2('0x14')]===0x1f4){logger['error'](_0x2dd2('0xe'),_0x435ea3,_0x387f3e[_0x2dd2('0x13')][_0x2dd2('0x15')]);return _0x2a080d(_0x387f3e[_0x2dd2('0x13')]['message']);}logger[_0x2dd2('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x435ea3,_0x387f3e[_0x2dd2('0x13')]['message']);return _0x436e25(_0x387f3e['error'][_0x2dd2('0x15')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x435ea3,_0x2dd2('0xf'));_0x436e25(_0x387f3e[_0x2dd2('0x16')][_0x2dd2('0x15')]);}})[_0x2dd2('0x17')](function(_0x2ffe8b){logger[_0x2dd2('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x435ea3,_0x2ffe8b);_0x2a080d(_0x2ffe8b);});});}exports[_0x2dd2('0x18')]=function(_0x333c1a){var _0x5a384b=this;return new Promise(function(_0x30ff51,_0x5d67a8){return db[_0x2dd2('0x19')][_0x2dd2('0x1a')]({'raw':_0x333c1a[_0x2dd2('0x1b')]?_0x333c1a['options'][_0x2dd2('0x1c')]===undefined?!![]:![]:!![],'where':_0x333c1a[_0x2dd2('0x1b')]?_0x333c1a[_0x2dd2('0x1b')]['where']||null:null,'attributes':_0x333c1a[_0x2dd2('0x1b')]?_0x333c1a[_0x2dd2('0x1b')][_0x2dd2('0x1d')]||null:null,'limit':_0x333c1a['options']?_0x333c1a[_0x2dd2('0x1b')][_0x2dd2('0x1e')]||null:null,'include':_0x333c1a[_0x2dd2('0x1b')]?_0x333c1a[_0x2dd2('0x1b')]['include']?_['map'](_0x333c1a[_0x2dd2('0x1b')][_0x2dd2('0x1f')],function(_0x4c2074){return{'model':db[_0x4c2074[_0x2dd2('0x20')]],'as':_0x4c2074['as'],'attributes':_0x4c2074[_0x2dd2('0x1d')],'include':_0x4c2074[_0x2dd2('0x1f')]?_[_0x2dd2('0x21')](_0x4c2074[_0x2dd2('0x1f')],function(_0x92de68){return{'model':db[_0x92de68[_0x2dd2('0x20')]],'as':_0x92de68['as'],'attributes':_0x92de68['attributes'],'include':_0x92de68[_0x2dd2('0x1f')]?_[_0x2dd2('0x21')](_0x92de68['include'],function(_0x31610b){return{'model':db[_0x31610b['model']],'as':_0x31610b['as'],'attributes':_0x31610b[_0x2dd2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2dd2('0xc')](function(_0x83b14d){logger[_0x2dd2('0xd')]('GetSalesforceAccount',_0x333c1a);logger[_0x2dd2('0x10')](_0x2dd2('0x18'),_0x333c1a,JSON[_0x2dd2('0x12')](_0x83b14d));_0x30ff51(_0x83b14d);})[_0x2dd2('0x17')](function(_0x2443e1){logger[_0x2dd2('0x13')](_0x2dd2('0x18'),_0x2443e1[_0x2dd2('0x15')],_0x333c1a);_0x5d67a8(_0x5a384b[_0x2dd2('0x13')](0x1f4,_0x2443e1[_0x2dd2('0x15')]));});});};exports['ShowSalesforceAccount']=function(_0x110c68){var _0x331606=this;return new Promise(function(_0xdf53b8,_0x15c050){return db[_0x2dd2('0x19')]['find']({'raw':_0x110c68[_0x2dd2('0x1b')]?_0x110c68['options'][_0x2dd2('0x1c')]===undefined?!![]:![]:!![],'where':_0x110c68[_0x2dd2('0x1b')]?_0x110c68[_0x2dd2('0x1b')][_0x2dd2('0x22')]||null:null,'attributes':_0x110c68[_0x2dd2('0x1b')]?_0x110c68[_0x2dd2('0x1b')][_0x2dd2('0x1d')]||null:null,'include':_0x110c68[_0x2dd2('0x1b')]?_0x110c68['options'][_0x2dd2('0x1f')]?_[_0x2dd2('0x21')](_0x110c68[_0x2dd2('0x1b')][_0x2dd2('0x1f')],function(_0x438044){return{'model':db[_0x438044[_0x2dd2('0x20')]],'as':_0x438044['as'],'attributes':_0x438044[_0x2dd2('0x1d')],'include':_0x438044[_0x2dd2('0x1f')]?_[_0x2dd2('0x21')](_0x438044[_0x2dd2('0x1f')],function(_0x21a310){return{'model':db[_0x21a310[_0x2dd2('0x20')]],'as':_0x21a310['as'],'attributes':_0x21a310[_0x2dd2('0x1d')],'include':_0x21a310[_0x2dd2('0x1f')]?_[_0x2dd2('0x21')](_0x21a310[_0x2dd2('0x1f')],function(_0x508878){return{'model':db[_0x508878[_0x2dd2('0x20')]],'as':_0x508878['as'],'attributes':_0x508878[_0x2dd2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x518e16){logger[_0x2dd2('0xd')]('ShowSalesforceAccount',_0x110c68);logger[_0x2dd2('0x10')](_0x2dd2('0x23'),_0x110c68,JSON[_0x2dd2('0x12')](_0x518e16));_0xdf53b8(_0x518e16);})['catch'](function(_0x3f7ee2){logger['error'](_0x2dd2('0x23'),_0x3f7ee2['message'],_0x110c68);_0x15c050(_0x331606[_0x2dd2('0x13')](0x1f4,_0x3f7ee2[_0x2dd2('0x15')]));});});}; \ No newline at end of file +var _0x14e7=['limit','include','map','model','attributes','then','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where'];(function(_0x14a84e,_0xffb06){var _0x2aca47=function(_0x5cdc00){while(--_0x5cdc00){_0x14a84e['push'](_0x14a84e['shift']());}};_0x2aca47(++_0xffb06);}(_0x14e7,0x166));var _0x714e=function(_0x5b7513,_0xd372c0){_0x5b7513=_0x5b7513-0x0;var _0x16e036=_0x14e7[_0x5b7513];return _0x16e036;};'use strict';var _=require('lodash');var util=require(_0x714e('0x0'));var moment=require(_0x714e('0x1'));var BPromise=require(_0x714e('0x2'));var rs=require(_0x714e('0x3'));var fs=require('fs');var Redis=require(_0x714e('0x4'));var db=require(_0x714e('0x5'))['db'];var utils=require(_0x714e('0x6'));var logger=require(_0x714e('0x7'))('rpc');var config=require(_0x714e('0x8'));var jayson=require(_0x714e('0x9'));var client=jayson['client'][_0x714e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27cb88,_0x1336bc,_0x1490ec){return new BPromise(function(_0x3b18ff,_0x44e528){return client['request'](_0x27cb88,_0x1490ec)['then'](function(_0x173a69){logger[_0x714e('0xb')](_0x714e('0xc'),_0x1336bc,_0x714e('0xd'));logger[_0x714e('0xe')](_0x714e('0xf'),_0x1336bc,'request\x20sent',JSON[_0x714e('0x10')](_0x173a69));if(_0x173a69[_0x714e('0x11')]){if(_0x173a69[_0x714e('0x11')][_0x714e('0x12')]===0x1f4){logger[_0x714e('0x11')](_0x714e('0xc'),_0x1336bc,_0x173a69[_0x714e('0x11')][_0x714e('0x13')]);return _0x44e528(_0x173a69[_0x714e('0x11')][_0x714e('0x13')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1336bc,_0x173a69[_0x714e('0x11')][_0x714e('0x13')]);return _0x3b18ff(_0x173a69[_0x714e('0x11')]['message']);}else{logger[_0x714e('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x1336bc,_0x714e('0xd'));_0x3b18ff(_0x173a69[_0x714e('0x14')][_0x714e('0x13')]);}})[_0x714e('0x15')](function(_0x468e67){logger[_0x714e('0x11')](_0x714e('0xc'),_0x1336bc,_0x468e67);_0x44e528(_0x468e67);});});}exports[_0x714e('0x16')]=function(_0x9d9fdf){var _0x4b2040=this;return new Promise(function(_0x5b38bf,_0x2417f5){return db[_0x714e('0x17')][_0x714e('0x18')]({'raw':_0x9d9fdf[_0x714e('0x19')]?_0x9d9fdf['options']['raw']===undefined?!![]:![]:!![],'where':_0x9d9fdf[_0x714e('0x19')]?_0x9d9fdf[_0x714e('0x19')][_0x714e('0x1a')]||null:null,'attributes':_0x9d9fdf[_0x714e('0x19')]?_0x9d9fdf[_0x714e('0x19')]['attributes']||null:null,'limit':_0x9d9fdf[_0x714e('0x19')]?_0x9d9fdf[_0x714e('0x19')][_0x714e('0x1b')]||null:null,'include':_0x9d9fdf[_0x714e('0x19')]?_0x9d9fdf[_0x714e('0x19')][_0x714e('0x1c')]?_[_0x714e('0x1d')](_0x9d9fdf[_0x714e('0x19')][_0x714e('0x1c')],function(_0x3d4b82){return{'model':db[_0x3d4b82[_0x714e('0x1e')]],'as':_0x3d4b82['as'],'attributes':_0x3d4b82[_0x714e('0x1f')],'include':_0x3d4b82[_0x714e('0x1c')]?_[_0x714e('0x1d')](_0x3d4b82[_0x714e('0x1c')],function(_0x140f05){return{'model':db[_0x140f05['model']],'as':_0x140f05['as'],'attributes':_0x140f05[_0x714e('0x1f')],'include':_0x140f05[_0x714e('0x1c')]?_['map'](_0x140f05[_0x714e('0x1c')],function(_0x114b91){return{'model':db[_0x114b91[_0x714e('0x1e')]],'as':_0x114b91['as'],'attributes':_0x114b91[_0x714e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x714e('0x20')](function(_0x1a13b5){logger[_0x714e('0xb')](_0x714e('0x16'),_0x9d9fdf);logger[_0x714e('0xe')](_0x714e('0x16'),_0x9d9fdf,JSON['stringify'](_0x1a13b5));_0x5b38bf(_0x1a13b5);})[_0x714e('0x15')](function(_0x5bb1e7){logger[_0x714e('0x11')](_0x714e('0x16'),_0x5bb1e7[_0x714e('0x13')],_0x9d9fdf);_0x2417f5(_0x4b2040[_0x714e('0x11')](0x1f4,_0x5bb1e7[_0x714e('0x13')]));});});};exports[_0x714e('0x21')]=function(_0x442491){var _0x434642=this;return new Promise(function(_0x125c56,_0x441bc9){return db[_0x714e('0x17')][_0x714e('0x22')]({'raw':_0x442491['options']?_0x442491[_0x714e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x442491[_0x714e('0x19')]?_0x442491['options'][_0x714e('0x1a')]||null:null,'attributes':_0x442491['options']?_0x442491[_0x714e('0x19')][_0x714e('0x1f')]||null:null,'include':_0x442491[_0x714e('0x19')]?_0x442491[_0x714e('0x19')]['include']?_[_0x714e('0x1d')](_0x442491[_0x714e('0x19')][_0x714e('0x1c')],function(_0x13711d){return{'model':db[_0x13711d[_0x714e('0x1e')]],'as':_0x13711d['as'],'attributes':_0x13711d['attributes'],'include':_0x13711d[_0x714e('0x1c')]?_[_0x714e('0x1d')](_0x13711d['include'],function(_0x43bab3){return{'model':db[_0x43bab3['model']],'as':_0x43bab3['as'],'attributes':_0x43bab3[_0x714e('0x1f')],'include':_0x43bab3[_0x714e('0x1c')]?_['map'](_0x43bab3['include'],function(_0x56b990){return{'model':db[_0x56b990[_0x714e('0x1e')]],'as':_0x56b990['as'],'attributes':_0x56b990['attributes']};}):[]};}):[]};}):[]:[]})[_0x714e('0x20')](function(_0x386829){logger[_0x714e('0xb')](_0x714e('0x21'),_0x442491);logger[_0x714e('0xe')](_0x714e('0x21'),_0x442491,JSON[_0x714e('0x10')](_0x386829));_0x125c56(_0x386829);})['catch'](function(_0x2978d4){logger[_0x714e('0x11')](_0x714e('0x21'),_0x2978d4['message'],_0x442491);_0x441bc9(_0x434642[_0x714e('0x11')](0x1f4,_0x2978d4[_0x714e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 49088b5..1ee4232 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xdb28,0x106));var _0x8db2=function(_0x3255c1,_0x2dbc5b){_0x3255c1=_0x3255c1-0x0;var _0x34369d=_0xdb28[_0x3255c1];return _0x34369d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=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(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x412818,_0xe8171a){_0x412818=_0x412818-0x0;var _0x2d40d1=_0x0b0e[_0x412818];return _0x2d40d1;};'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 37d511c..6fc1858 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 _0x45a6=['lead','account_contact_lead','account','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x3fc891,_0x37b12a){var _0x4f1935=function(_0x2395b2){while(--_0x2395b2){_0x3fc891['push'](_0x3fc891['shift']());}};_0x4f1935(++_0x37b12a);}(_0x45a6,0x116));var _0x645a=function(_0x2f15ea,_0x4c601c){_0x2f15ea=_0x2f15ea-0x0;var _0x424f61=_0x45a6[_0x2f15ea];return _0x424f61;};'use strict';var Sequelize=require(_0x645a('0x0'));module[_0x645a('0x1')]={'name':{'type':Sequelize[_0x645a('0x2')]},'description':{'type':Sequelize[_0x645a('0x2')]},'ticketType':{'type':Sequelize[_0x645a('0x3')](_0x645a('0x4'),_0x645a('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x645a('0x3')](_0x645a('0x6'),_0x645a('0x7'),_0x645a('0x8'),_0x645a('0x9'),_0x645a('0xa')),'defaultValue':_0x645a('0x6')},'moduleCreate':{'type':Sequelize[_0x645a('0x3')]('nothing',_0x645a('0x7'),_0x645a('0x8'),_0x645a('0xa')),'defaultValue':_0x645a('0x8')},'leadId':{'type':Sequelize[_0x645a('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x645a('0x2')]}}; \ No newline at end of file +var _0x1c81=['lead','account_contact_lead','account','contact_lead','nothing','contact','sequelize','exports','STRING','ENUM','Task','Case'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1c81,0x7e));var _0x11c8=function(_0x578d2b,_0x3d6d8e){_0x578d2b=_0x578d2b-0x0;var _0xc3d8b5=_0x1c81[_0x578d2b];return _0xc3d8b5;};'use strict';var Sequelize=require(_0x11c8('0x0'));module[_0x11c8('0x1')]={'name':{'type':Sequelize[_0x11c8('0x2')]},'description':{'type':Sequelize[_0x11c8('0x2')]},'ticketType':{'type':Sequelize[_0x11c8('0x3')](_0x11c8('0x4'),_0x11c8('0x5')),'defaultValue':_0x11c8('0x4')},'moduleSearch':{'type':Sequelize[_0x11c8('0x3')]('contact_lead','contact',_0x11c8('0x6'),_0x11c8('0x7'),_0x11c8('0x8')),'defaultValue':_0x11c8('0x9')},'moduleCreate':{'type':Sequelize[_0x11c8('0x3')](_0x11c8('0xa'),_0x11c8('0xb'),'lead',_0x11c8('0x8')),'defaultValue':_0x11c8('0x6')},'leadId':{'type':Sequelize[_0x11c8('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x11c8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 8ea4129..2cb2f2d 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 _0x383d=['offset','set','Content-Range','save','update','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','find','params','destroy','getFields','SalesforceField','getSubjects','findOne','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count'];(function(_0x4c2914,_0x44c1e3){var _0x3d5332=function(_0x3466aa){while(--_0x3466aa){_0x4c2914['push'](_0x4c2914['shift']());}};_0x3d5332(++_0x44c1e3);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd383('0x0'));var jsonpatch=require(_0xd383('0x1'));var rp=require(_0xd383('0x2'));var moment=require('moment');var BPromise=require(_0xd383('0x3'));var Mustache=require(_0xd383('0x4'));var util=require(_0xd383('0x5'));var path=require(_0xd383('0x6'));var sox=require(_0xd383('0x7'));var csv=require(_0xd383('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd383('0x9'));var _=require(_0xd383('0xa'));var squel=require(_0xd383('0xb'));var crypto=require(_0xd383('0xc'));var jsforce=require(_0xd383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd383('0xe'));var Papa=require(_0xd383('0xf'));var Redis=require('ioredis');var authService=require(_0xd383('0x10'));var qs=require(_0xd383('0x11'));var as=require(_0xd383('0x12'));var hardwareService=require(_0xd383('0x13'));var logger=require(_0xd383('0x14'))(_0xd383('0x15'));var utils=require('../../config/utils');var config=require(_0xd383('0x16'));var licenseUtil=require(_0xd383('0x17'));var db=require(_0xd383('0x18'))['db'];function respondWithStatusCode(_0x456180,_0x52db5a){_0x52db5a=_0x52db5a||0xcc;return function(_0x42143c){if(_0x42143c){return _0x456180[_0xd383('0x19')](_0x52db5a);}return _0x456180[_0xd383('0x1a')](_0x52db5a)[_0xd383('0x1b')]();};}function respondWithResult(_0x4ce386,_0x39985a){_0x39985a=_0x39985a||0xc8;return function(_0x58081c){if(_0x58081c){return _0x4ce386[_0xd383('0x1a')](_0x39985a)[_0xd383('0x1c')](_0x58081c);}};}function respondWithFilteredResult(_0xf2dcb6,_0x373876){return function(_0x387f5f){if(_0x387f5f){var _0x18690a=typeof _0x373876['offset']==='undefined'&&typeof _0x373876[_0xd383('0x1d')]===_0xd383('0x1e');var _0x8639e8=_0x387f5f[_0xd383('0x1f')];var _0x2c068a=_0x18690a?0x0:_0x373876[_0xd383('0x20')];var _0x21d2ed=_0x18690a?_0x387f5f[_0xd383('0x1f')]:_0x373876['offset']+_0x373876[_0xd383('0x1d')];var _0x3714c8;if(_0x21d2ed>=_0x8639e8){_0x21d2ed=_0x8639e8;_0x3714c8=0xc8;}else{_0x3714c8=0xce;}_0xf2dcb6[_0xd383('0x1a')](_0x3714c8);return _0xf2dcb6[_0xd383('0x21')](_0xd383('0x22'),_0x2c068a+'-'+_0x21d2ed+'/'+_0x8639e8)[_0xd383('0x1c')](_0x387f5f);}return null;};}function patchUpdates(_0x49799e){return function(_0x4650db){try{jsonpatch['apply'](_0x4650db,_0x49799e,!![]);}catch(_0x1a8e78){return BPromise['reject'](_0x1a8e78);}return _0x4650db[_0xd383('0x23')]();};}function saveUpdates(_0x39569f,_0x5ebcd9){return function(_0x10c054){if(_0x10c054){return _0x10c054[_0xd383('0x24')](_0x39569f)[_0xd383('0x25')](function(_0x58e47e){return _0x58e47e;});}return null;};}function removeEntity(_0x48d34b,_0x10e296){return function(_0x5a0799){if(_0x5a0799){return _0x5a0799['destroy']()[_0xd383('0x25')](function(){_0x48d34b['status'](0xcc)[_0xd383('0x1b')]();});}};}function handleEntityNotFound(_0x5b407e,_0x4c52c7){return function(_0x54afc4){if(!_0x54afc4){_0x5b407e[_0xd383('0x19')](0x194);}return _0x54afc4;};}function handleError(_0x40d989,_0x6de576){_0x6de576=_0x6de576||0x1f4;return function(_0x554758){logger[_0xd383('0x26')](_0x554758[_0xd383('0x27')]);if(_0x554758[_0xd383('0x28')]){delete _0x554758[_0xd383('0x28')];}_0x40d989[_0xd383('0x1a')](_0x6de576)[_0xd383('0x29')](_0x554758);};}exports[_0xd383('0x2a')]=function(_0x208247,_0x1981db){var _0x4f2ec6={},_0x2f1fea={},_0x12a3b3={'count':0x0,'rows':[]};var _0x13924e=_[_0xd383('0x2b')](db[_0xd383('0x2c')][_0xd383('0x2d')],function(_0x346514){return{'name':_0x346514[_0xd383('0x2e')],'type':_0x346514[_0xd383('0x2f')][_0xd383('0x30')]};});_0x2f1fea[_0xd383('0x31')]=_[_0xd383('0x2b')](_0x13924e,_0xd383('0x28'));_0x2f1fea[_0xd383('0x32')]=_[_0xd383('0x33')](_0x208247['query']);_0x2f1fea[_0xd383('0x34')]=_[_0xd383('0x35')](_0x2f1fea[_0xd383('0x31')],_0x2f1fea[_0xd383('0x32')]);_0x4f2ec6[_0xd383('0x36')]=_[_0xd383('0x35')](_0x2f1fea[_0xd383('0x31')],qs[_0xd383('0x37')](_0x208247[_0xd383('0x32')]['fields']));_0x4f2ec6[_0xd383('0x36')]=_0x4f2ec6['attributes'][_0xd383('0x38')]?_0x4f2ec6['attributes']:_0x2f1fea[_0xd383('0x31')];if(!_0x208247['query'][_0xd383('0x39')](_0xd383('0x3a'))){_0x4f2ec6['limit']=qs[_0xd383('0x1d')](_0x208247[_0xd383('0x32')][_0xd383('0x1d')]);_0x4f2ec6[_0xd383('0x20')]=qs[_0xd383('0x20')](_0x208247[_0xd383('0x32')][_0xd383('0x20')]);}_0x4f2ec6[_0xd383('0x3b')]=qs[_0xd383('0x3c')](_0x208247[_0xd383('0x32')]['sort']);_0x4f2ec6[_0xd383('0x3d')]=qs[_0xd383('0x34')](_[_0xd383('0x3e')](_0x208247[_0xd383('0x32')],_0x2f1fea[_0xd383('0x34')]),_0x13924e);if(_0x208247[_0xd383('0x32')][_0xd383('0x3f')]){_0x4f2ec6[_0xd383('0x3d')]=_[_0xd383('0x40')](_0x4f2ec6[_0xd383('0x3d')],{'$or':_[_0xd383('0x2b')](_0x13924e,function(_0x47cfb8){if(_0x47cfb8[_0xd383('0x2f')]!==_0xd383('0x41')){var _0x4345ec={};_0x4345ec[_0x47cfb8[_0xd383('0x28')]]={'$like':'%'+_0x208247[_0xd383('0x32')]['filter']+'%'};return _0x4345ec;}})});}_0x4f2ec6=_[_0xd383('0x40')]({},_0x4f2ec6,_0x208247[_0xd383('0x42')]);var _0x482965={'where':_0x4f2ec6['where']};return db[_0xd383('0x2c')][_0xd383('0x1f')](_0x482965)[_0xd383('0x25')](function(_0x43a5a1){_0x12a3b3[_0xd383('0x1f')]=_0x43a5a1;if(_0x208247[_0xd383('0x32')]['includeAll']){_0x4f2ec6[_0xd383('0x43')]=[{'all':!![]}];}return db[_0xd383('0x2c')][_0xd383('0x44')](_0x4f2ec6);})[_0xd383('0x25')](function(_0xcc3d42){_0x12a3b3[_0xd383('0x45')]=_0xcc3d42;return _0x12a3b3;})[_0xd383('0x25')](respondWithFilteredResult(_0x1981db,_0x4f2ec6))[_0xd383('0x46')](handleError(_0x1981db,null));};exports[_0xd383('0x47')]=function(_0x3ba4f9,_0x913c73){var _0x147b64={'raw':![],'where':{'id':_0x3ba4f9['params']['id']}},_0x57f81a={};_0x57f81a['model']=_[_0xd383('0x33')](db[_0xd383('0x2c')][_0xd383('0x2d')]);_0x57f81a['query']=_[_0xd383('0x33')](_0x3ba4f9[_0xd383('0x32')]);_0x57f81a[_0xd383('0x34')]=_[_0xd383('0x35')](_0x57f81a['model'],_0x57f81a[_0xd383('0x32')]);_0x147b64[_0xd383('0x36')]=_[_0xd383('0x35')](_0x57f81a[_0xd383('0x31')],qs[_0xd383('0x37')](_0x3ba4f9['query'][_0xd383('0x37')]));_0x147b64[_0xd383('0x36')]=_0x147b64['attributes'][_0xd383('0x38')]?_0x147b64[_0xd383('0x36')]:_0x57f81a[_0xd383('0x31')];if(_0x3ba4f9['query'][_0xd383('0x48')]){_0x147b64['include']=[{'all':!![]}];}_0x147b64=_[_0xd383('0x40')]({},_0x147b64,_0x3ba4f9[_0xd383('0x42')]);return db[_0xd383('0x2c')]['find'](_0x147b64)['then'](handleEntityNotFound(_0x913c73,null))[_0xd383('0x25')](respondWithResult(_0x913c73,null))[_0xd383('0x46')](handleError(_0x913c73,null));};exports['create']=function(_0x5b754d,_0x46e0f0){return db[_0xd383('0x2c')][_0xd383('0x49')](_0x5b754d[_0xd383('0x4a')],{})['then'](respondWithResult(_0x46e0f0,0xc9))[_0xd383('0x46')](handleError(_0x46e0f0,null));};exports[_0xd383('0x24')]=function(_0x36f2c2,_0x41bbc6){if(_0x36f2c2[_0xd383('0x4a')]['id']){delete _0x36f2c2[_0xd383('0x4a')]['id'];}return db[_0xd383('0x2c')][_0xd383('0x4b')]({'where':{'id':_0x36f2c2[_0xd383('0x4c')]['id']}})[_0xd383('0x25')](handleEntityNotFound(_0x41bbc6,null))[_0xd383('0x25')](saveUpdates(_0x36f2c2[_0xd383('0x4a')],null))[_0xd383('0x25')](respondWithResult(_0x41bbc6,null))['catch'](handleError(_0x41bbc6,null));};exports[_0xd383('0x4d')]=function(_0x219d8c,_0x48b729){return db[_0xd383('0x2c')][_0xd383('0x4b')]({'where':{'id':_0x219d8c[_0xd383('0x4c')]['id']}})[_0xd383('0x25')](handleEntityNotFound(_0x48b729,null))[_0xd383('0x25')](removeEntity(_0x48b729,null))[_0xd383('0x46')](handleError(_0x48b729,null));};exports[_0xd383('0x4e')]=function(_0x566d21,_0x5c32f2,_0x1b506d){var _0x24458e={};var _0x3dc478={};var _0x1ecbdc;var _0x1e4f53;return db[_0xd383('0x2c')]['findOne']({'where':{'id':_0x566d21[_0xd383('0x4c')]['id']}})[_0xd383('0x25')](handleEntityNotFound(_0x5c32f2,null))[_0xd383('0x25')](function(_0x2b4d5d){if(_0x2b4d5d){_0x1ecbdc=_0x2b4d5d;_0x3dc478[_0xd383('0x31')]=_[_0xd383('0x33')](db[_0xd383('0x4f')]['rawAttributes']);_0x3dc478[_0xd383('0x32')]=_[_0xd383('0x33')](_0x566d21[_0xd383('0x32')]);_0x3dc478[_0xd383('0x34')]=_[_0xd383('0x35')](_0x3dc478[_0xd383('0x31')],_0x3dc478[_0xd383('0x32')]);_0x24458e[_0xd383('0x36')]=_[_0xd383('0x35')](_0x3dc478[_0xd383('0x31')],qs['fields'](_0x566d21[_0xd383('0x32')][_0xd383('0x37')]));_0x24458e['attributes']=_0x24458e['attributes']['length']?_0x24458e['attributes']:_0x3dc478['model'];_0x24458e[_0xd383('0x3b')]=qs[_0xd383('0x3c')](_0x566d21[_0xd383('0x32')]['sort']);_0x24458e[_0xd383('0x3d')]=qs[_0xd383('0x34')](_[_0xd383('0x3e')](_0x566d21[_0xd383('0x32')],_0x3dc478[_0xd383('0x34')]));if(_0x566d21['query'][_0xd383('0x3f')]){_0x24458e[_0xd383('0x3d')]=_[_0xd383('0x40')](_0x24458e[_0xd383('0x3d')],{'$or':_[_0xd383('0x2b')](_0x24458e['attributes'],function(_0x2812d0){var _0xfd5625={};_0xfd5625[_0x2812d0]={'$like':'%'+_0x566d21[_0xd383('0x32')]['filter']+'%'};return _0xfd5625;})});}_0x24458e=_[_0xd383('0x40')]({},_0x24458e,_0x566d21[_0xd383('0x42')]);return _0x1ecbdc[_0xd383('0x4e')](_0x24458e);}})['then'](function(_0x20bcf4){if(_0x20bcf4){_0x1e4f53=_0x20bcf4['length'];if(!_0x566d21[_0xd383('0x32')]['hasOwnProperty'](_0xd383('0x3a'))){_0x24458e['limit']=qs[_0xd383('0x1d')](_0x566d21['query'][_0xd383('0x1d')]);_0x24458e[_0xd383('0x20')]=qs[_0xd383('0x20')](_0x566d21['query'][_0xd383('0x20')]);}return _0x1ecbdc[_0xd383('0x4e')](_0x24458e);}})[_0xd383('0x25')](function(_0x1274b4){if(_0x1274b4){return _0x1274b4?{'count':_0x1e4f53,'rows':_0x1274b4}:null;}})[_0xd383('0x25')](respondWithResult(_0x5c32f2,null))['catch'](handleError(_0x5c32f2,null));};exports[_0xd383('0x50')]=function(_0x2c12a0,_0x18a067,_0xba075f){var _0x48fa29={};var _0x324f01={};var _0x2e3218;var _0x1b3125;return db[_0xd383('0x2c')][_0xd383('0x51')]({'where':{'id':_0x2c12a0[_0xd383('0x4c')]['id']}})[_0xd383('0x25')](handleEntityNotFound(_0x18a067,null))[_0xd383('0x25')](function(_0x3ea070){if(_0x3ea070){_0x2e3218=_0x3ea070;_0x324f01[_0xd383('0x31')]=_[_0xd383('0x33')](db[_0xd383('0x4f')][_0xd383('0x2d')]);_0x324f01['query']=_[_0xd383('0x33')](_0x2c12a0[_0xd383('0x32')]);_0x324f01[_0xd383('0x34')]=_[_0xd383('0x35')](_0x324f01[_0xd383('0x31')],_0x324f01[_0xd383('0x32')]);_0x48fa29[_0xd383('0x36')]=_[_0xd383('0x35')](_0x324f01[_0xd383('0x31')],qs[_0xd383('0x37')](_0x2c12a0[_0xd383('0x32')][_0xd383('0x37')]));_0x48fa29['attributes']=_0x48fa29[_0xd383('0x36')][_0xd383('0x38')]?_0x48fa29['attributes']:_0x324f01['model'];_0x48fa29[_0xd383('0x3b')]=qs['sort'](_0x2c12a0['query'][_0xd383('0x3c')]);_0x48fa29[_0xd383('0x3d')]=qs[_0xd383('0x34')](_[_0xd383('0x3e')](_0x2c12a0[_0xd383('0x32')],_0x324f01[_0xd383('0x34')]));if(_0x2c12a0[_0xd383('0x32')][_0xd383('0x3f')]){_0x48fa29[_0xd383('0x3d')]=_['merge'](_0x48fa29[_0xd383('0x3d')],{'$or':_[_0xd383('0x2b')](_0x48fa29['attributes'],function(_0x2adcf4){var _0x13aff0={};_0x13aff0[_0x2adcf4]={'$like':'%'+_0x2c12a0[_0xd383('0x32')][_0xd383('0x3f')]+'%'};return _0x13aff0;})});}_0x48fa29=_[_0xd383('0x40')]({},_0x48fa29,_0x2c12a0[_0xd383('0x42')]);return _0x2e3218[_0xd383('0x50')](_0x48fa29);}})[_0xd383('0x25')](function(_0x3632cd){if(_0x3632cd){_0x1b3125=_0x3632cd[_0xd383('0x38')];if(!_0x2c12a0['query']['hasOwnProperty'](_0xd383('0x3a'))){_0x48fa29['limit']=qs[_0xd383('0x1d')](_0x2c12a0[_0xd383('0x32')][_0xd383('0x1d')]);_0x48fa29[_0xd383('0x20')]=qs[_0xd383('0x20')](_0x2c12a0['query'][_0xd383('0x20')]);}return _0x2e3218[_0xd383('0x50')](_0x48fa29);}})[_0xd383('0x25')](function(_0x5de5d4){if(_0x5de5d4){return _0x5de5d4?{'count':_0x1b3125,'rows':_0x5de5d4}:null;}})[_0xd383('0x25')](respondWithResult(_0x18a067,null))[_0xd383('0x46')](handleError(_0x18a067,null));};exports['getDescriptions']=function(_0x511e4f,_0x6b00e6,_0x55d181){var _0x11b086={};var _0x22ddb4={};var _0x142016;var _0x5ebf6f;return db[_0xd383('0x2c')]['findOne']({'where':{'id':_0x511e4f[_0xd383('0x4c')]['id']}})[_0xd383('0x25')](handleEntityNotFound(_0x6b00e6,null))[_0xd383('0x25')](function(_0x220156){if(_0x220156){_0x142016=_0x220156;_0x22ddb4['model']=_[_0xd383('0x33')](db[_0xd383('0x4f')][_0xd383('0x2d')]);_0x22ddb4['query']=_[_0xd383('0x33')](_0x511e4f[_0xd383('0x32')]);_0x22ddb4['filters']=_[_0xd383('0x35')](_0x22ddb4[_0xd383('0x31')],_0x22ddb4[_0xd383('0x32')]);_0x11b086[_0xd383('0x36')]=_['intersection'](_0x22ddb4['model'],qs[_0xd383('0x37')](_0x511e4f[_0xd383('0x32')][_0xd383('0x37')]));_0x11b086[_0xd383('0x36')]=_0x11b086[_0xd383('0x36')][_0xd383('0x38')]?_0x11b086[_0xd383('0x36')]:_0x22ddb4['model'];_0x11b086[_0xd383('0x3b')]=qs['sort'](_0x511e4f['query'][_0xd383('0x3c')]);_0x11b086['where']=qs[_0xd383('0x34')](_[_0xd383('0x3e')](_0x511e4f[_0xd383('0x32')],_0x22ddb4[_0xd383('0x34')]));if(_0x511e4f['query'][_0xd383('0x3f')]){_0x11b086[_0xd383('0x3d')]=_[_0xd383('0x40')](_0x11b086[_0xd383('0x3d')],{'$or':_[_0xd383('0x2b')](_0x11b086['attributes'],function(_0x2a19d3){var _0x3780f5={};_0x3780f5[_0x2a19d3]={'$like':'%'+_0x511e4f[_0xd383('0x32')]['filter']+'%'};return _0x3780f5;})});}_0x11b086=_['merge']({},_0x11b086,_0x511e4f[_0xd383('0x42')]);return _0x142016['getDescriptions'](_0x11b086);}})[_0xd383('0x25')](function(_0x116d81){if(_0x116d81){_0x5ebf6f=_0x116d81[_0xd383('0x38')];if(!_0x511e4f[_0xd383('0x32')][_0xd383('0x39')](_0xd383('0x3a'))){_0x11b086['limit']=qs[_0xd383('0x1d')](_0x511e4f[_0xd383('0x32')][_0xd383('0x1d')]);_0x11b086[_0xd383('0x20')]=qs[_0xd383('0x20')](_0x511e4f[_0xd383('0x32')][_0xd383('0x20')]);}return _0x142016[_0xd383('0x52')](_0x11b086);}})['then'](function(_0x4367d2){if(_0x4367d2){return _0x4367d2?{'count':_0x5ebf6f,'rows':_0x4367d2}:null;}})['then'](respondWithResult(_0x6b00e6,null))[_0xd383('0x46')](handleError(_0x6b00e6,null));}; \ No newline at end of file +var _0x06fb=['hasOwnProperty','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','then','sendStatus','error','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','attributes','include','find','body','update','destroy','findOne','SalesforceField','getFields'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x06fb,0xe9));var _0xb06f=function(_0x1174c0,_0x205c56){_0x1174c0=_0x1174c0-0x0;var _0x4a99fa=_0x06fb[_0x1174c0];return _0x4a99fa;};'use strict';var emlformat=require(_0xb06f('0x0'));var rimraf=require(_0xb06f('0x1'));var zipdir=require(_0xb06f('0x2'));var jsonpatch=require(_0xb06f('0x3'));var rp=require(_0xb06f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb06f('0x5'));var util=require(_0xb06f('0x6'));var path=require('path');var sox=require(_0xb06f('0x7'));var csv=require(_0xb06f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb06f('0x9'));var _=require(_0xb06f('0xa'));var squel=require(_0xb06f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb06f('0xc'));var toCsv=require(_0xb06f('0x8'));var querystring=require(_0xb06f('0xd'));var Papa=require(_0xb06f('0xe'));var Redis=require(_0xb06f('0xf'));var authService=require(_0xb06f('0x10'));var qs=require(_0xb06f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb06f('0x12'))(_0xb06f('0x13'));var utils=require('../../config/utils');var config=require(_0xb06f('0x14'));var licenseUtil=require(_0xb06f('0x15'));var db=require(_0xb06f('0x16'))['db'];function respondWithStatusCode(_0x28fb61,_0x2d6eaf){_0x2d6eaf=_0x2d6eaf||0xcc;return function(_0x3ac71b){if(_0x3ac71b){return _0x28fb61['sendStatus'](_0x2d6eaf);}return _0x28fb61[_0xb06f('0x17')](_0x2d6eaf)[_0xb06f('0x18')]();};}function respondWithResult(_0x5db59a,_0x1dd3a7){_0x1dd3a7=_0x1dd3a7||0xc8;return function(_0x362813){if(_0x362813){return _0x5db59a[_0xb06f('0x17')](_0x1dd3a7)['json'](_0x362813);}};}function respondWithFilteredResult(_0x11cb3f,_0x137bc6){return function(_0x2c520d){if(_0x2c520d){var _0x246a8d=typeof _0x137bc6[_0xb06f('0x19')]===_0xb06f('0x1a')&&typeof _0x137bc6[_0xb06f('0x1b')]===_0xb06f('0x1a');var _0x27978c=_0x2c520d['count'];var _0x7ae21b=_0x246a8d?0x0:_0x137bc6[_0xb06f('0x19')];var _0x5236be=_0x246a8d?_0x2c520d[_0xb06f('0x1c')]:_0x137bc6[_0xb06f('0x19')]+_0x137bc6['limit'];var _0x720801;if(_0x5236be>=_0x27978c){_0x5236be=_0x27978c;_0x720801=0xc8;}else{_0x720801=0xce;}_0x11cb3f[_0xb06f('0x17')](_0x720801);return _0x11cb3f['set']('Content-Range',_0x7ae21b+'-'+_0x5236be+'/'+_0x27978c)[_0xb06f('0x1d')](_0x2c520d);}return null;};}function patchUpdates(_0x3f8831){return function(_0x152d9f){try{jsonpatch[_0xb06f('0x1e')](_0x152d9f,_0x3f8831,!![]);}catch(_0x3d26d0){return BPromise[_0xb06f('0x1f')](_0x3d26d0);}return _0x152d9f['save']();};}function saveUpdates(_0x4f54ba,_0x13a2da){return function(_0x37b91b){if(_0x37b91b){return _0x37b91b['update'](_0x4f54ba)[_0xb06f('0x20')](function(_0x3e31f6){return _0x3e31f6;});}return null;};}function removeEntity(_0x14e76f,_0x1ddf3d){return function(_0x5ce30f){if(_0x5ce30f){return _0x5ce30f['destroy']()[_0xb06f('0x20')](function(){_0x14e76f[_0xb06f('0x17')](0xcc)[_0xb06f('0x18')]();});}};}function handleEntityNotFound(_0x4161e7,_0x22674e){return function(_0x13f154){if(!_0x13f154){_0x4161e7[_0xb06f('0x21')](0x194);}return _0x13f154;};}function handleError(_0x150e0a,_0x2fb74a){_0x2fb74a=_0x2fb74a||0x1f4;return function(_0x22467f){logger[_0xb06f('0x22')](_0x22467f[_0xb06f('0x23')]);if(_0x22467f['name']){delete _0x22467f[_0xb06f('0x24')];}_0x150e0a[_0xb06f('0x17')](_0x2fb74a)[_0xb06f('0x25')](_0x22467f);};}exports[_0xb06f('0x26')]=function(_0x822951,_0x1dd3b1){var _0x480dc4={},_0x378581={},_0x41f81e={'count':0x0,'rows':[]};var _0x26e4cb=_[_0xb06f('0x27')](db[_0xb06f('0x28')]['rawAttributes'],function(_0x227cd0){return{'name':_0x227cd0[_0xb06f('0x29')],'type':_0x227cd0[_0xb06f('0x2a')][_0xb06f('0x2b')]};});_0x378581[_0xb06f('0x2c')]=_['map'](_0x26e4cb,_0xb06f('0x24'));_0x378581[_0xb06f('0x2d')]=_[_0xb06f('0x2e')](_0x822951[_0xb06f('0x2d')]);_0x378581[_0xb06f('0x2f')]=_[_0xb06f('0x30')](_0x378581[_0xb06f('0x2c')],_0x378581[_0xb06f('0x2d')]);_0x480dc4['attributes']=_[_0xb06f('0x30')](_0x378581[_0xb06f('0x2c')],qs[_0xb06f('0x31')](_0x822951[_0xb06f('0x2d')]['fields']));_0x480dc4['attributes']=_0x480dc4['attributes'][_0xb06f('0x32')]?_0x480dc4['attributes']:_0x378581[_0xb06f('0x2c')];if(!_0x822951['query']['hasOwnProperty'](_0xb06f('0x33'))){_0x480dc4['limit']=qs[_0xb06f('0x1b')](_0x822951[_0xb06f('0x2d')][_0xb06f('0x1b')]);_0x480dc4[_0xb06f('0x19')]=qs[_0xb06f('0x19')](_0x822951['query'][_0xb06f('0x19')]);}_0x480dc4[_0xb06f('0x34')]=qs['sort'](_0x822951[_0xb06f('0x2d')][_0xb06f('0x35')]);_0x480dc4[_0xb06f('0x36')]=qs[_0xb06f('0x2f')](_[_0xb06f('0x37')](_0x822951[_0xb06f('0x2d')],_0x378581[_0xb06f('0x2f')]),_0x26e4cb);if(_0x822951['query']['filter']){_0x480dc4[_0xb06f('0x36')]=_[_0xb06f('0x38')](_0x480dc4[_0xb06f('0x36')],{'$or':_[_0xb06f('0x27')](_0x26e4cb,function(_0x98471d){if(_0x98471d[_0xb06f('0x2a')]!==_0xb06f('0x39')){var _0x73c4a0={};_0x73c4a0[_0x98471d['name']]={'$like':'%'+_0x822951[_0xb06f('0x2d')][_0xb06f('0x3a')]+'%'};return _0x73c4a0;}})});}_0x480dc4=_[_0xb06f('0x38')]({},_0x480dc4,_0x822951[_0xb06f('0x3b')]);var _0x1aaa1f={'where':_0x480dc4[_0xb06f('0x36')]};return db[_0xb06f('0x28')][_0xb06f('0x1c')](_0x1aaa1f)[_0xb06f('0x20')](function(_0x244920){_0x41f81e[_0xb06f('0x1c')]=_0x244920;if(_0x822951[_0xb06f('0x2d')][_0xb06f('0x3c')]){_0x480dc4['include']=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x480dc4);})['then'](function(_0x48d617){_0x41f81e[_0xb06f('0x3d')]=_0x48d617;return _0x41f81e;})['then'](respondWithFilteredResult(_0x1dd3b1,_0x480dc4))[_0xb06f('0x3e')](handleError(_0x1dd3b1,null));};exports[_0xb06f('0x3f')]=function(_0x405b38,_0x500ebd){var _0xa0bf73={'raw':![],'where':{'id':_0x405b38[_0xb06f('0x40')]['id']}},_0x2f0428={};_0x2f0428['model']=_[_0xb06f('0x2e')](db['SalesforceConfiguration'][_0xb06f('0x41')]);_0x2f0428[_0xb06f('0x2d')]=_[_0xb06f('0x2e')](_0x405b38[_0xb06f('0x2d')]);_0x2f0428['filters']=_['intersection'](_0x2f0428[_0xb06f('0x2c')],_0x2f0428[_0xb06f('0x2d')]);_0xa0bf73[_0xb06f('0x42')]=_['intersection'](_0x2f0428[_0xb06f('0x2c')],qs['fields'](_0x405b38[_0xb06f('0x2d')][_0xb06f('0x31')]));_0xa0bf73['attributes']=_0xa0bf73[_0xb06f('0x42')]['length']?_0xa0bf73[_0xb06f('0x42')]:_0x2f0428[_0xb06f('0x2c')];if(_0x405b38[_0xb06f('0x2d')][_0xb06f('0x3c')]){_0xa0bf73[_0xb06f('0x43')]=[{'all':!![]}];}_0xa0bf73=_[_0xb06f('0x38')]({},_0xa0bf73,_0x405b38[_0xb06f('0x3b')]);return db[_0xb06f('0x28')][_0xb06f('0x44')](_0xa0bf73)[_0xb06f('0x20')](handleEntityNotFound(_0x500ebd,null))[_0xb06f('0x20')](respondWithResult(_0x500ebd,null))[_0xb06f('0x3e')](handleError(_0x500ebd,null));};exports['create']=function(_0x445896,_0x34bb6f){return db[_0xb06f('0x28')]['create'](_0x445896[_0xb06f('0x45')],{})[_0xb06f('0x20')](respondWithResult(_0x34bb6f,0xc9))[_0xb06f('0x3e')](handleError(_0x34bb6f,null));};exports[_0xb06f('0x46')]=function(_0xcf3f74,_0x2cf6ab){if(_0xcf3f74[_0xb06f('0x45')]['id']){delete _0xcf3f74[_0xb06f('0x45')]['id'];}return db[_0xb06f('0x28')][_0xb06f('0x44')]({'where':{'id':_0xcf3f74['params']['id']}})[_0xb06f('0x20')](handleEntityNotFound(_0x2cf6ab,null))[_0xb06f('0x20')](saveUpdates(_0xcf3f74['body'],null))['then'](respondWithResult(_0x2cf6ab,null))[_0xb06f('0x3e')](handleError(_0x2cf6ab,null));};exports[_0xb06f('0x47')]=function(_0xe1362d,_0x89ab32){return db[_0xb06f('0x28')][_0xb06f('0x44')]({'where':{'id':_0xe1362d[_0xb06f('0x40')]['id']}})[_0xb06f('0x20')](handleEntityNotFound(_0x89ab32,null))[_0xb06f('0x20')](removeEntity(_0x89ab32,null))[_0xb06f('0x3e')](handleError(_0x89ab32,null));};exports['getFields']=function(_0x281cde,_0xcdb981,_0x33bdb4){var _0x3d756c={};var _0xb4444c={};var _0x3710f3;var _0x56b1ae;return db['SalesforceConfiguration'][_0xb06f('0x48')]({'where':{'id':_0x281cde[_0xb06f('0x40')]['id']}})[_0xb06f('0x20')](handleEntityNotFound(_0xcdb981,null))['then'](function(_0x1ebaa2){if(_0x1ebaa2){_0x3710f3=_0x1ebaa2;_0xb4444c[_0xb06f('0x2c')]=_['keys'](db[_0xb06f('0x49')]['rawAttributes']);_0xb4444c[_0xb06f('0x2d')]=_['keys'](_0x281cde[_0xb06f('0x2d')]);_0xb4444c[_0xb06f('0x2f')]=_['intersection'](_0xb4444c[_0xb06f('0x2c')],_0xb4444c[_0xb06f('0x2d')]);_0x3d756c[_0xb06f('0x42')]=_['intersection'](_0xb4444c[_0xb06f('0x2c')],qs[_0xb06f('0x31')](_0x281cde[_0xb06f('0x2d')][_0xb06f('0x31')]));_0x3d756c[_0xb06f('0x42')]=_0x3d756c[_0xb06f('0x42')][_0xb06f('0x32')]?_0x3d756c['attributes']:_0xb4444c[_0xb06f('0x2c')];_0x3d756c[_0xb06f('0x34')]=qs['sort'](_0x281cde['query'][_0xb06f('0x35')]);_0x3d756c[_0xb06f('0x36')]=qs[_0xb06f('0x2f')](_[_0xb06f('0x37')](_0x281cde[_0xb06f('0x2d')],_0xb4444c[_0xb06f('0x2f')]));if(_0x281cde['query'][_0xb06f('0x3a')]){_0x3d756c['where']=_[_0xb06f('0x38')](_0x3d756c[_0xb06f('0x36')],{'$or':_[_0xb06f('0x27')](_0x3d756c['attributes'],function(_0x419a32){var _0x384bc6={};_0x384bc6[_0x419a32]={'$like':'%'+_0x281cde['query']['filter']+'%'};return _0x384bc6;})});}_0x3d756c=_['merge']({},_0x3d756c,_0x281cde[_0xb06f('0x3b')]);return _0x3710f3[_0xb06f('0x4a')](_0x3d756c);}})['then'](function(_0x7e690d){if(_0x7e690d){_0x56b1ae=_0x7e690d[_0xb06f('0x32')];if(!_0x281cde['query'][_0xb06f('0x4b')](_0xb06f('0x33'))){_0x3d756c[_0xb06f('0x1b')]=qs['limit'](_0x281cde[_0xb06f('0x2d')][_0xb06f('0x1b')]);_0x3d756c[_0xb06f('0x19')]=qs[_0xb06f('0x19')](_0x281cde[_0xb06f('0x2d')][_0xb06f('0x19')]);}return _0x3710f3[_0xb06f('0x4a')](_0x3d756c);}})[_0xb06f('0x20')](function(_0x3318c4){if(_0x3318c4){return _0x3318c4?{'count':_0x56b1ae,'rows':_0x3318c4}:null;}})[_0xb06f('0x20')](respondWithResult(_0xcdb981,null))['catch'](handleError(_0xcdb981,null));};exports[_0xb06f('0x4c')]=function(_0xaa2c94,_0x52f136,_0x322c03){var _0x44e26e={};var _0x50af25={};var _0x176515;var _0x31092c;return db['SalesforceConfiguration'][_0xb06f('0x48')]({'where':{'id':_0xaa2c94[_0xb06f('0x40')]['id']}})[_0xb06f('0x20')](handleEntityNotFound(_0x52f136,null))[_0xb06f('0x20')](function(_0x1c6121){if(_0x1c6121){_0x176515=_0x1c6121;_0x50af25['model']=_[_0xb06f('0x2e')](db['SalesforceField'][_0xb06f('0x41')]);_0x50af25['query']=_[_0xb06f('0x2e')](_0xaa2c94[_0xb06f('0x2d')]);_0x50af25[_0xb06f('0x2f')]=_['intersection'](_0x50af25[_0xb06f('0x2c')],_0x50af25['query']);_0x44e26e['attributes']=_[_0xb06f('0x30')](_0x50af25[_0xb06f('0x2c')],qs[_0xb06f('0x31')](_0xaa2c94['query'][_0xb06f('0x31')]));_0x44e26e[_0xb06f('0x42')]=_0x44e26e[_0xb06f('0x42')][_0xb06f('0x32')]?_0x44e26e[_0xb06f('0x42')]:_0x50af25[_0xb06f('0x2c')];_0x44e26e[_0xb06f('0x34')]=qs['sort'](_0xaa2c94[_0xb06f('0x2d')][_0xb06f('0x35')]);_0x44e26e[_0xb06f('0x36')]=qs[_0xb06f('0x2f')](_[_0xb06f('0x37')](_0xaa2c94[_0xb06f('0x2d')],_0x50af25[_0xb06f('0x2f')]));if(_0xaa2c94[_0xb06f('0x2d')][_0xb06f('0x3a')]){_0x44e26e[_0xb06f('0x36')]=_[_0xb06f('0x38')](_0x44e26e[_0xb06f('0x36')],{'$or':_[_0xb06f('0x27')](_0x44e26e['attributes'],function(_0x78d203){var _0x1322d5={};_0x1322d5[_0x78d203]={'$like':'%'+_0xaa2c94['query']['filter']+'%'};return _0x1322d5;})});}_0x44e26e=_['merge']({},_0x44e26e,_0xaa2c94[_0xb06f('0x3b')]);return _0x176515['getSubjects'](_0x44e26e);}})['then'](function(_0x151a0d){if(_0x151a0d){_0x31092c=_0x151a0d[_0xb06f('0x32')];if(!_0xaa2c94[_0xb06f('0x2d')][_0xb06f('0x4b')](_0xb06f('0x33'))){_0x44e26e[_0xb06f('0x1b')]=qs[_0xb06f('0x1b')](_0xaa2c94[_0xb06f('0x2d')][_0xb06f('0x1b')]);_0x44e26e[_0xb06f('0x19')]=qs[_0xb06f('0x19')](_0xaa2c94[_0xb06f('0x2d')][_0xb06f('0x19')]);}return _0x176515[_0xb06f('0x4c')](_0x44e26e);}})[_0xb06f('0x20')](function(_0x1a8dfe){if(_0x1a8dfe){return _0x1a8dfe?{'count':_0x31092c,'rows':_0x1a8dfe}:null;}})[_0xb06f('0x20')](respondWithResult(_0x52f136,null))['catch'](handleError(_0x52f136,null));};exports['getDescriptions']=function(_0x228a89,_0x35317,_0x1c994c){var _0x40cdd4={};var _0x14d153={};var _0x429f00;var _0x25b388;return db[_0xb06f('0x28')][_0xb06f('0x48')]({'where':{'id':_0x228a89[_0xb06f('0x40')]['id']}})['then'](handleEntityNotFound(_0x35317,null))[_0xb06f('0x20')](function(_0x3b556a){if(_0x3b556a){_0x429f00=_0x3b556a;_0x14d153[_0xb06f('0x2c')]=_[_0xb06f('0x2e')](db[_0xb06f('0x49')][_0xb06f('0x41')]);_0x14d153[_0xb06f('0x2d')]=_[_0xb06f('0x2e')](_0x228a89[_0xb06f('0x2d')]);_0x14d153[_0xb06f('0x2f')]=_[_0xb06f('0x30')](_0x14d153[_0xb06f('0x2c')],_0x14d153[_0xb06f('0x2d')]);_0x40cdd4[_0xb06f('0x42')]=_['intersection'](_0x14d153[_0xb06f('0x2c')],qs[_0xb06f('0x31')](_0x228a89[_0xb06f('0x2d')][_0xb06f('0x31')]));_0x40cdd4[_0xb06f('0x42')]=_0x40cdd4['attributes'][_0xb06f('0x32')]?_0x40cdd4[_0xb06f('0x42')]:_0x14d153['model'];_0x40cdd4[_0xb06f('0x34')]=qs['sort'](_0x228a89[_0xb06f('0x2d')]['sort']);_0x40cdd4[_0xb06f('0x36')]=qs['filters'](_[_0xb06f('0x37')](_0x228a89[_0xb06f('0x2d')],_0x14d153[_0xb06f('0x2f')]));if(_0x228a89[_0xb06f('0x2d')][_0xb06f('0x3a')]){_0x40cdd4[_0xb06f('0x36')]=_[_0xb06f('0x38')](_0x40cdd4[_0xb06f('0x36')],{'$or':_[_0xb06f('0x27')](_0x40cdd4[_0xb06f('0x42')],function(_0x9b1fe1){var _0x60f695={};_0x60f695[_0x9b1fe1]={'$like':'%'+_0x228a89['query'][_0xb06f('0x3a')]+'%'};return _0x60f695;})});}_0x40cdd4=_[_0xb06f('0x38')]({},_0x40cdd4,_0x228a89[_0xb06f('0x3b')]);return _0x429f00['getDescriptions'](_0x40cdd4);}})[_0xb06f('0x20')](function(_0x12199a){if(_0x12199a){_0x25b388=_0x12199a['length'];if(!_0x228a89['query'][_0xb06f('0x4b')](_0xb06f('0x33'))){_0x40cdd4[_0xb06f('0x1b')]=qs[_0xb06f('0x1b')](_0x228a89[_0xb06f('0x2d')][_0xb06f('0x1b')]);_0x40cdd4[_0xb06f('0x19')]=qs[_0xb06f('0x19')](_0x228a89[_0xb06f('0x2d')]['offset']);}return _0x429f00['getDescriptions'](_0x40cdd4);}})[_0xb06f('0x20')](function(_0x2674b0){if(_0x2674b0){return _0x2674b0?{'count':_0x25b388,'rows':_0x2674b0}:null;}})[_0xb06f('0x20')](respondWithResult(_0x35317,null))[_0xb06f('0x3e')](handleError(_0x35317,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 95455b3..249117b 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 _0xa12e=['bluebird','request-promise','path','rimraf','../../config/environment','exports','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment'];(function(_0x43bac1,_0x1bff73){var _0x14aac9=function(_0x3a2731){while(--_0x3a2731){_0x43bac1['push'](_0x43bac1['shift']());}};_0x14aac9(++_0x1bff73);}(_0xa12e,0x8c));var _0xea12=function(_0x946e1b,_0x4f9f57){_0x946e1b=_0x946e1b-0x0;var _0x4db99b=_0xa12e[_0x946e1b];return _0x4db99b;};'use strict';var _=require('lodash');var util=require(_0xea12('0x0'));var logger=require(_0xea12('0x1'))(_0xea12('0x2'));var moment=require(_0xea12('0x3'));var BPromise=require(_0xea12('0x4'));var rp=require(_0xea12('0x5'));var fs=require('fs');var path=require(_0xea12('0x6'));var rimraf=require(_0xea12('0x7'));var config=require(_0xea12('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xea12('0x9')]=function(_0x3d2e2c,_0x55b551){return _0x3d2e2c['define'](_0xea12('0xa'),attributes,{'tableName':_0xea12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f38=['bluebird','path','rimraf','../../config/environment','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api'];(function(_0x2fc5a2,_0x2db6f7){var _0x266a22=function(_0x4fdece){while(--_0x4fdece){_0x2fc5a2['push'](_0x2fc5a2['shift']());}};_0x266a22(++_0x2db6f7);}(_0x4f38,0x15b));var _0x84f3=function(_0x45c2c8,_0xb9f1cb){_0x45c2c8=_0x45c2c8-0x0;var _0x106e7d=_0x4f38[_0x45c2c8];return _0x106e7d;};'use strict';var _=require(_0x84f3('0x0'));var util=require('util');var logger=require(_0x84f3('0x1'))(_0x84f3('0x2'));var moment=require('moment');var BPromise=require(_0x84f3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84f3('0x4'));var rimraf=require(_0x84f3('0x5'));var config=require(_0x84f3('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x84f3('0x7')]=function(_0x25dd92,_0x3e1e0e){return _0x25dd92['define'](_0x84f3('0x8'),attributes,{'tableName':_0x84f3('0x9'),'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 5745b2c..6e7a0cf 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 _0x5dca=['request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5fd9c,_0x2a6b1a){var _0x5c4578=function(_0x2fa2ce){while(--_0x2fa2ce){_0x5fd9c['push'](_0x5fd9c['shift']());}};_0x5c4578(++_0x2a6b1a);}(_0x5dca,0x145));var _0xa5dc=function(_0x16f01d,_0x205dea){_0x16f01d=_0x16f01d-0x0;var _0x130a49=_0x5dca[_0x16f01d];return _0x130a49;};'use strict';var _=require('lodash');var util=require(_0xa5dc('0x0'));var moment=require('moment');var BPromise=require(_0xa5dc('0x1'));var rs=require(_0xa5dc('0x2'));var fs=require('fs');var Redis=require(_0xa5dc('0x3'));var db=require(_0xa5dc('0x4'))['db'];var utils=require(_0xa5dc('0x5'));var logger=require(_0xa5dc('0x6'))(_0xa5dc('0x7'));var config=require('../../config/environment');var jayson=require(_0xa5dc('0x8'));var client=jayson[_0xa5dc('0x9')][_0xa5dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39c4b2,_0x1362e3,_0x21b5e2){return new BPromise(function(_0x287454,_0x488e35){return client[_0xa5dc('0xb')](_0x39c4b2,_0x21b5e2)[_0xa5dc('0xc')](function(_0x33a2da){logger[_0xa5dc('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1362e3,_0xa5dc('0xe'));logger[_0xa5dc('0xf')](_0xa5dc('0x10'),_0x1362e3,_0xa5dc('0xe'),JSON[_0xa5dc('0x11')](_0x33a2da));if(_0x33a2da[_0xa5dc('0x12')]){if(_0x33a2da[_0xa5dc('0x12')][_0xa5dc('0x13')]===0x1f4){logger[_0xa5dc('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1362e3,_0x33a2da['error']['message']);return _0x488e35(_0x33a2da[_0xa5dc('0x12')]['message']);}logger[_0xa5dc('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1362e3,_0x33a2da[_0xa5dc('0x12')][_0xa5dc('0x14')]);return _0x287454(_0x33a2da[_0xa5dc('0x12')][_0xa5dc('0x14')]);}else{logger[_0xa5dc('0xd')](_0xa5dc('0x15'),_0x1362e3,_0xa5dc('0xe'));_0x287454(_0x33a2da[_0xa5dc('0x16')][_0xa5dc('0x14')]);}})[_0xa5dc('0x17')](function(_0x481849){logger[_0xa5dc('0x12')](_0xa5dc('0x15'),_0x1362e3,_0x481849);_0x488e35(_0x481849);});});} \ No newline at end of file +var _0xc296=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3132c4,_0x321a8d){var _0xb0d3c=function(_0x18f4b6){while(--_0x18f4b6){_0x3132c4['push'](_0x3132c4['shift']());}};_0xb0d3c(++_0x321a8d);}(_0xc296,0xa1));var _0x6c29=function(_0x2ad97e,_0x46dd6f){_0x2ad97e=_0x2ad97e-0x0;var _0x328954=_0xc296[_0x2ad97e];return _0x328954;};'use strict';var _=require(_0x6c29('0x0'));var util=require('util');var moment=require(_0x6c29('0x1'));var BPromise=require(_0x6c29('0x2'));var rs=require(_0x6c29('0x3'));var fs=require('fs');var Redis=require(_0x6c29('0x4'));var db=require(_0x6c29('0x5'))['db'];var utils=require(_0x6c29('0x6'));var logger=require('../../config/logger')(_0x6c29('0x7'));var config=require(_0x6c29('0x8'));var jayson=require(_0x6c29('0x9'));var client=jayson[_0x6c29('0xa')][_0x6c29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d3ad8,_0x135056,_0xd1405e){return new BPromise(function(_0x56210f,_0x53a64e){return client[_0x6c29('0xc')](_0x2d3ad8,_0xd1405e)['then'](function(_0x4bdbed){logger['info'](_0x6c29('0xd'),_0x135056,_0x6c29('0xe'));logger['debug'](_0x6c29('0xf'),_0x135056,'request\x20sent',JSON[_0x6c29('0x10')](_0x4bdbed));if(_0x4bdbed[_0x6c29('0x11')]){if(_0x4bdbed[_0x6c29('0x11')][_0x6c29('0x12')]===0x1f4){logger['error'](_0x6c29('0xd'),_0x135056,_0x4bdbed[_0x6c29('0x11')]['message']);return _0x53a64e(_0x4bdbed[_0x6c29('0x11')]['message']);}logger['error'](_0x6c29('0xd'),_0x135056,_0x4bdbed[_0x6c29('0x11')]['message']);return _0x56210f(_0x4bdbed['error'][_0x6c29('0x13')]);}else{logger[_0x6c29('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x135056,'request\x20sent');_0x56210f(_0x4bdbed[_0x6c29('0x15')][_0x6c29('0x13')]);}})[_0x6c29('0x16')](function(_0x39f36e){logger[_0x6c29('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x135056,_0x39f36e);_0x53a64e(_0x39f36e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 201cb10..7557dc2 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 _0x3885=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','index','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x6b8629,_0x2162aa){var _0x2303ec=function(_0x49b7dd){while(--_0x49b7dd){_0x6b8629['push'](_0x6b8629['shift']());}};_0x2303ec(++_0x2162aa);}(_0x3885,0x13f));var _0x5388=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3885[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x5388('0x0'));var util=require(_0x5388('0x1'));var path=require(_0x5388('0x2'));var timeout=require(_0x5388('0x3'));var express=require(_0x5388('0x4'));var router=express['Router']();var fs_extra=require(_0x5388('0x5'));var auth=require(_0x5388('0x6'));var interaction=require(_0x5388('0x7'));var config=require('../../config/environment');var controller=require(_0x5388('0x8'));router[_0x5388('0x9')]('/',auth['isAuthenticated'](),controller[_0x5388('0xa')]);router[_0x5388('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5388('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5388('0xc')](_0x5388('0xd'),auth['isAuthenticated'](),controller[_0x5388('0xe')]);router[_0x5388('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5388('0x10')]);module['exports']=router; \ No newline at end of file +var _0xeb7b=['delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','post','create','/:id','update'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0xeb7b,0x1b3));var _0xbeb7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeb7b[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xbeb7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbeb7('0x1'));var express=require(_0xbeb7('0x2'));var router=express['Router']();var fs_extra=require(_0xbeb7('0x3'));var auth=require(_0xbeb7('0x4'));var interaction=require(_0xbeb7('0x5'));var config=require(_0xbeb7('0x6'));var controller=require(_0xbeb7('0x7'));router[_0xbeb7('0x8')]('/',auth[_0xbeb7('0x9')](),controller[_0xbeb7('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbeb7('0xb')]('/',auth['isAuthenticated'](),controller[_0xbeb7('0xc')]);router['put'](_0xbeb7('0xd'),auth[_0xbeb7('0x9')](),controller[_0xbeb7('0xe')]);router[_0xbeb7('0xf')](_0xbeb7('0xd'),auth[_0xbeb7('0x9')](),controller[_0xbeb7('0x10')]);module[_0xbeb7('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 26b2e6e..eedb36d 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 _0x5439=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0x35ddbc,_0x1e835a){var _0x5af0b2=function(_0x10858f){while(--_0x10858f){_0x35ddbc['push'](_0x35ddbc['shift']());}};_0x5af0b2(++_0x1e835a);}(_0x5439,0x6b));var _0x9543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5439[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9543('0x0'));module[_0x9543('0x1')]={'type':{'type':Sequelize[_0x9543('0x2')]('string',_0x9543('0x3'),_0x9543('0x4'),_0x9543('0x5'),_0x9543('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9543('0x7')]},'key':{'type':Sequelize[_0x9543('0x7')]},'keyType':{'type':Sequelize[_0x9543('0x2')](_0x9543('0x8'),_0x9543('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9543('0x7')]},'idField':{'type':Sequelize[_0x9543('0x7')]},'variableName':{'type':Sequelize[_0x9543('0x7')]}}; \ No newline at end of file +var _0xe86c=['variable','customVariable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xe86c,0x1cc));var _0xce86=function(_0x157f1c,_0x2adcf2){_0x157f1c=_0x157f1c-0x0;var _0xa5c6c0=_0xe86c[_0x157f1c];return _0xa5c6c0;};'use strict';var Sequelize=require(_0xce86('0x0'));module[_0xce86('0x1')]={'type':{'type':Sequelize[_0xce86('0x2')](_0xce86('0x3'),_0xce86('0x4'),_0xce86('0x5'),_0xce86('0x6'),'picklist'),'defaultValue':_0xce86('0x3')},'content':{'type':Sequelize[_0xce86('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xce86('0x2')](_0xce86('0x3'),_0xce86('0x4'),_0xce86('0x5'))},'keyContent':{'type':Sequelize[_0xce86('0x7')]},'idField':{'type':Sequelize[_0xce86('0x7')]},'variableName':{'type':Sequelize[_0xce86('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 07a1f90..8a5e549 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 _0x22e1=['where','merge','options','includeAll','catch','show','params','length','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../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','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x1e87ef,_0x320fc5){var _0x8f019f=function(_0x16d37d){while(--_0x16d37d){_0x1e87ef['push'](_0x1e87ef['shift']());}};_0x8f019f(++_0x320fc5);}(_0x22e1,0xa8));var _0x122e=function(_0x5ec686,_0x45adfe){_0x5ec686=_0x5ec686-0x0;var _0x366ba2=_0x22e1[_0x5ec686];return _0x366ba2;};'use strict';var emlformat=require(_0x122e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x122e('0x1'));var jsonpatch=require(_0x122e('0x2'));var rp=require(_0x122e('0x3'));var moment=require(_0x122e('0x4'));var BPromise=require(_0x122e('0x5'));var Mustache=require(_0x122e('0x6'));var util=require(_0x122e('0x7'));var path=require(_0x122e('0x8'));var sox=require(_0x122e('0x9'));var csv=require('to-csv');var ejs=require(_0x122e('0xa'));var fs=require('fs');var fs_extra=require(_0x122e('0xb'));var _=require(_0x122e('0xc'));var squel=require('squel');var crypto=require(_0x122e('0xd'));var jsforce=require(_0x122e('0xe'));var deskjs=require(_0x122e('0xf'));var toCsv=require(_0x122e('0x10'));var querystring=require(_0x122e('0x11'));var Papa=require('papaparse');var Redis=require(_0x122e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x122e('0x13'));var as=require(_0x122e('0x14'));var hardwareService=require(_0x122e('0x15'));var logger=require(_0x122e('0x16'))(_0x122e('0x17'));var utils=require(_0x122e('0x18'));var config=require(_0x122e('0x19'));var licenseUtil=require(_0x122e('0x1a'));var db=require(_0x122e('0x1b'))['db'];function respondWithStatusCode(_0x489bc5,_0x539afb){_0x539afb=_0x539afb||0xcc;return function(_0x12adaa){if(_0x12adaa){return _0x489bc5[_0x122e('0x1c')](_0x539afb);}return _0x489bc5['status'](_0x539afb)[_0x122e('0x1d')]();};}function respondWithResult(_0x5407ab,_0x254795){_0x254795=_0x254795||0xc8;return function(_0x5c6ed8){if(_0x5c6ed8){return _0x5407ab[_0x122e('0x1e')](_0x254795)[_0x122e('0x1f')](_0x5c6ed8);}};}function respondWithFilteredResult(_0x4aeecb,_0x588096){return function(_0x2f80a0){if(_0x2f80a0){var _0x24dbc9=typeof _0x588096[_0x122e('0x20')]===_0x122e('0x21')&&typeof _0x588096[_0x122e('0x22')]==='undefined';var _0x13233c=_0x2f80a0[_0x122e('0x23')];var _0x3b41a6=_0x24dbc9?0x0:_0x588096[_0x122e('0x20')];var _0x3d9651=_0x24dbc9?_0x2f80a0[_0x122e('0x23')]:_0x588096['offset']+_0x588096[_0x122e('0x22')];var _0x109f68;if(_0x3d9651>=_0x13233c){_0x3d9651=_0x13233c;_0x109f68=0xc8;}else{_0x109f68=0xce;}_0x4aeecb[_0x122e('0x1e')](_0x109f68);return _0x4aeecb[_0x122e('0x24')](_0x122e('0x25'),_0x3b41a6+'-'+_0x3d9651+'/'+_0x13233c)[_0x122e('0x1f')](_0x2f80a0);}return null;};}function patchUpdates(_0x3c3f9a){return function(_0x9f76b8){try{jsonpatch[_0x122e('0x26')](_0x9f76b8,_0x3c3f9a,!![]);}catch(_0x2effac){return BPromise[_0x122e('0x27')](_0x2effac);}return _0x9f76b8[_0x122e('0x28')]();};}function saveUpdates(_0x2677b9,_0xc9eeb7){return function(_0x28bd7f){if(_0x28bd7f){return _0x28bd7f[_0x122e('0x29')](_0x2677b9)[_0x122e('0x2a')](function(_0xdda4e7){return _0xdda4e7;});}return null;};}function removeEntity(_0x100683,_0x561237){return function(_0x5691a9){if(_0x5691a9){return _0x5691a9[_0x122e('0x2b')]()[_0x122e('0x2a')](function(){_0x100683[_0x122e('0x1e')](0xcc)[_0x122e('0x1d')]();});}};}function handleEntityNotFound(_0x503dd5,_0x369bcd){return function(_0x307843){if(!_0x307843){_0x503dd5[_0x122e('0x1c')](0x194);}return _0x307843;};}function handleError(_0x3deefe,_0x17ecb2){_0x17ecb2=_0x17ecb2||0x1f4;return function(_0x443311){logger[_0x122e('0x2c')](_0x443311[_0x122e('0x2d')]);if(_0x443311[_0x122e('0x2e')]){delete _0x443311[_0x122e('0x2e')];}_0x3deefe['status'](_0x17ecb2)[_0x122e('0x2f')](_0x443311);};}exports[_0x122e('0x30')]=function(_0x293551,_0x50e5d3){var _0x280ad5={},_0x17999d={},_0x321962={'count':0x0,'rows':[]};var _0x31f512=_[_0x122e('0x31')](db[_0x122e('0x32')][_0x122e('0x33')],function(_0x29fa92){return{'name':_0x29fa92['fieldName'],'type':_0x29fa92[_0x122e('0x34')][_0x122e('0x35')]};});_0x17999d[_0x122e('0x36')]=_[_0x122e('0x31')](_0x31f512,_0x122e('0x2e'));_0x17999d[_0x122e('0x37')]=_[_0x122e('0x38')](_0x293551[_0x122e('0x37')]);_0x17999d[_0x122e('0x39')]=_[_0x122e('0x3a')](_0x17999d[_0x122e('0x36')],_0x17999d['query']);_0x280ad5[_0x122e('0x3b')]=_[_0x122e('0x3a')](_0x17999d['model'],qs[_0x122e('0x3c')](_0x293551[_0x122e('0x37')][_0x122e('0x3c')]));_0x280ad5[_0x122e('0x3b')]=_0x280ad5[_0x122e('0x3b')]['length']?_0x280ad5[_0x122e('0x3b')]:_0x17999d[_0x122e('0x36')];if(!_0x293551[_0x122e('0x37')][_0x122e('0x3d')](_0x122e('0x3e'))){_0x280ad5[_0x122e('0x22')]=qs['limit'](_0x293551[_0x122e('0x37')][_0x122e('0x22')]);_0x280ad5[_0x122e('0x20')]=qs[_0x122e('0x20')](_0x293551[_0x122e('0x37')]['offset']);}_0x280ad5[_0x122e('0x3f')]=qs[_0x122e('0x40')](_0x293551['query']['sort']);_0x280ad5['where']=qs[_0x122e('0x39')](_['pick'](_0x293551[_0x122e('0x37')],_0x17999d[_0x122e('0x39')]),_0x31f512);if(_0x293551[_0x122e('0x37')][_0x122e('0x41')]){_0x280ad5[_0x122e('0x42')]=_[_0x122e('0x43')](_0x280ad5[_0x122e('0x42')],{'$or':_['map'](_0x31f512,function(_0x456638){if(_0x456638[_0x122e('0x34')]!=='VIRTUAL'){var _0x3d8199={};_0x3d8199[_0x456638[_0x122e('0x2e')]]={'$like':'%'+_0x293551[_0x122e('0x37')]['filter']+'%'};return _0x3d8199;}})});}_0x280ad5=_[_0x122e('0x43')]({},_0x280ad5,_0x293551[_0x122e('0x44')]);var _0x16b803={'where':_0x280ad5['where']};return db[_0x122e('0x32')][_0x122e('0x23')](_0x16b803)[_0x122e('0x2a')](function(_0x920a5c){_0x321962[_0x122e('0x23')]=_0x920a5c;if(_0x293551['query'][_0x122e('0x45')]){_0x280ad5['include']=[{'all':!![]}];}return db[_0x122e('0x32')]['findAll'](_0x280ad5);})[_0x122e('0x2a')](function(_0x498597){_0x321962['rows']=_0x498597;return _0x321962;})[_0x122e('0x2a')](respondWithFilteredResult(_0x50e5d3,_0x280ad5))[_0x122e('0x46')](handleError(_0x50e5d3,null));};exports[_0x122e('0x47')]=function(_0x3cb404,_0x4ce05b){var _0x2abe27={'raw':!![],'where':{'id':_0x3cb404[_0x122e('0x48')]['id']}},_0x1959d4={};_0x1959d4[_0x122e('0x36')]=_[_0x122e('0x38')](db[_0x122e('0x32')][_0x122e('0x33')]);_0x1959d4['query']=_[_0x122e('0x38')](_0x3cb404[_0x122e('0x37')]);_0x1959d4[_0x122e('0x39')]=_[_0x122e('0x3a')](_0x1959d4['model'],_0x1959d4[_0x122e('0x37')]);_0x2abe27[_0x122e('0x3b')]=_[_0x122e('0x3a')](_0x1959d4['model'],qs[_0x122e('0x3c')](_0x3cb404[_0x122e('0x37')][_0x122e('0x3c')]));_0x2abe27[_0x122e('0x3b')]=_0x2abe27[_0x122e('0x3b')][_0x122e('0x49')]?_0x2abe27['attributes']:_0x1959d4[_0x122e('0x36')];if(_0x3cb404[_0x122e('0x37')][_0x122e('0x45')]){_0x2abe27[_0x122e('0x4a')]=[{'all':!![]}];}_0x2abe27=_[_0x122e('0x43')]({},_0x2abe27,_0x3cb404['options']);return db['SalesforceField'][_0x122e('0x4b')](_0x2abe27)[_0x122e('0x2a')](handleEntityNotFound(_0x4ce05b,null))['then'](respondWithResult(_0x4ce05b,null))[_0x122e('0x46')](handleError(_0x4ce05b,null));};exports[_0x122e('0x4c')]=function(_0x5acc95,_0x39bc02){return db[_0x122e('0x32')][_0x122e('0x4c')](_0x5acc95['body'],{})[_0x122e('0x2a')](respondWithResult(_0x39bc02,0xc9))[_0x122e('0x46')](handleError(_0x39bc02,null));};exports[_0x122e('0x29')]=function(_0x326ee3,_0x4db499){if(_0x326ee3[_0x122e('0x4d')]['id']){delete _0x326ee3['body']['id'];}return db['SalesforceField'][_0x122e('0x4b')]({'where':{'id':_0x326ee3[_0x122e('0x48')]['id']}})[_0x122e('0x2a')](handleEntityNotFound(_0x4db499,null))[_0x122e('0x2a')](saveUpdates(_0x326ee3[_0x122e('0x4d')],null))['then'](respondWithResult(_0x4db499,null))['catch'](handleError(_0x4db499,null));};exports[_0x122e('0x2b')]=function(_0x20be34,_0x5dc8c4){return db[_0x122e('0x32')]['find']({'where':{'id':_0x20be34[_0x122e('0x48')]['id']}})[_0x122e('0x2a')](handleEntityNotFound(_0x5dc8c4,null))[_0x122e('0x2a')](removeEntity(_0x5dc8c4,null))[_0x122e('0x46')](handleError(_0x5dc8c4,null));}; \ No newline at end of file +var _0x3e2a=['lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','options','SalesforceField','includeAll','findAll','catch','show','params','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra'];(function(_0x5eb69b,_0x389959){var _0x30a130=function(_0x3a9d62){while(--_0x3a9d62){_0x5eb69b['push'](_0x5eb69b['shift']());}};_0x30a130(++_0x389959);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x31890d,_0x1433c3){_0x31890d=_0x31890d-0x0;var _0x449d06=_0x3e2a[_0x31890d];return _0x449d06;};'use strict';var emlformat=require(_0xa3e2('0x0'));var rimraf=require(_0xa3e2('0x1'));var zipdir=require(_0xa3e2('0x2'));var jsonpatch=require(_0xa3e2('0x3'));var rp=require(_0xa3e2('0x4'));var moment=require(_0xa3e2('0x5'));var BPromise=require(_0xa3e2('0x6'));var Mustache=require(_0xa3e2('0x7'));var util=require(_0xa3e2('0x8'));var path=require('path');var sox=require(_0xa3e2('0x9'));var csv=require('to-csv');var ejs=require(_0xa3e2('0xa'));var fs=require('fs');var fs_extra=require(_0xa3e2('0xb'));var _=require(_0xa3e2('0xc'));var squel=require(_0xa3e2('0xd'));var crypto=require(_0xa3e2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa3e2('0xf'));var toCsv=require(_0xa3e2('0x10'));var querystring=require('querystring');var Papa=require(_0xa3e2('0x11'));var Redis=require(_0xa3e2('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3e2('0x13'));var logger=require(_0xa3e2('0x14'))(_0xa3e2('0x15'));var utils=require('../../config/utils');var config=require(_0xa3e2('0x16'));var licenseUtil=require(_0xa3e2('0x17'));var db=require(_0xa3e2('0x18'))['db'];function respondWithStatusCode(_0x48627f,_0x3556e0){_0x3556e0=_0x3556e0||0xcc;return function(_0x3b6884){if(_0x3b6884){return _0x48627f['sendStatus'](_0x3556e0);}return _0x48627f[_0xa3e2('0x19')](_0x3556e0)[_0xa3e2('0x1a')]();};}function respondWithResult(_0x47aa71,_0x1f7ca2){_0x1f7ca2=_0x1f7ca2||0xc8;return function(_0x570cf2){if(_0x570cf2){return _0x47aa71['status'](_0x1f7ca2)[_0xa3e2('0x1b')](_0x570cf2);}};}function respondWithFilteredResult(_0x27e259,_0x3f2319){return function(_0x4d1c19){if(_0x4d1c19){var _0x2dd399=typeof _0x3f2319['offset']===_0xa3e2('0x1c')&&typeof _0x3f2319['limit']===_0xa3e2('0x1c');var _0xde7e29=_0x4d1c19[_0xa3e2('0x1d')];var _0x2486c1=_0x2dd399?0x0:_0x3f2319[_0xa3e2('0x1e')];var _0x3fb6d1=_0x2dd399?_0x4d1c19['count']:_0x3f2319[_0xa3e2('0x1e')]+_0x3f2319[_0xa3e2('0x1f')];var _0x7471c1;if(_0x3fb6d1>=_0xde7e29){_0x3fb6d1=_0xde7e29;_0x7471c1=0xc8;}else{_0x7471c1=0xce;}_0x27e259[_0xa3e2('0x19')](_0x7471c1);return _0x27e259[_0xa3e2('0x20')](_0xa3e2('0x21'),_0x2486c1+'-'+_0x3fb6d1+'/'+_0xde7e29)[_0xa3e2('0x1b')](_0x4d1c19);}return null;};}function patchUpdates(_0x1c697b){return function(_0x247003){try{jsonpatch['apply'](_0x247003,_0x1c697b,!![]);}catch(_0x3d8540){return BPromise['reject'](_0x3d8540);}return _0x247003[_0xa3e2('0x22')]();};}function saveUpdates(_0x36b93d,_0xbc7240){return function(_0x480b59){if(_0x480b59){return _0x480b59[_0xa3e2('0x23')](_0x36b93d)[_0xa3e2('0x24')](function(_0x5d63c4){return _0x5d63c4;});}return null;};}function removeEntity(_0x29559c,_0x416730){return function(_0x1c9411){if(_0x1c9411){return _0x1c9411['destroy']()['then'](function(){_0x29559c['status'](0xcc)[_0xa3e2('0x1a')]();});}};}function handleEntityNotFound(_0x32c1e7,_0x27c274){return function(_0x51c82b){if(!_0x51c82b){_0x32c1e7['sendStatus'](0x194);}return _0x51c82b;};}function handleError(_0x40348e,_0x3b06bb){_0x3b06bb=_0x3b06bb||0x1f4;return function(_0xd5af7b){logger['error'](_0xd5af7b['stack']);if(_0xd5af7b['name']){delete _0xd5af7b[_0xa3e2('0x25')];}_0x40348e[_0xa3e2('0x19')](_0x3b06bb)[_0xa3e2('0x26')](_0xd5af7b);};}exports[_0xa3e2('0x27')]=function(_0x4098a6,_0x217d0b){var _0xa260de={},_0x2d6d88={},_0x1535a8={'count':0x0,'rows':[]};var _0x46113e=_[_0xa3e2('0x28')](db['SalesforceField'][_0xa3e2('0x29')],function(_0x55a939){return{'name':_0x55a939[_0xa3e2('0x2a')],'type':_0x55a939[_0xa3e2('0x2b')]['key']};});_0x2d6d88[_0xa3e2('0x2c')]=_[_0xa3e2('0x28')](_0x46113e,'name');_0x2d6d88[_0xa3e2('0x2d')]=_[_0xa3e2('0x2e')](_0x4098a6[_0xa3e2('0x2d')]);_0x2d6d88[_0xa3e2('0x2f')]=_[_0xa3e2('0x30')](_0x2d6d88[_0xa3e2('0x2c')],_0x2d6d88[_0xa3e2('0x2d')]);_0xa260de[_0xa3e2('0x31')]=_['intersection'](_0x2d6d88[_0xa3e2('0x2c')],qs[_0xa3e2('0x32')](_0x4098a6[_0xa3e2('0x2d')][_0xa3e2('0x32')]));_0xa260de[_0xa3e2('0x31')]=_0xa260de['attributes']['length']?_0xa260de[_0xa3e2('0x31')]:_0x2d6d88[_0xa3e2('0x2c')];if(!_0x4098a6[_0xa3e2('0x2d')]['hasOwnProperty'](_0xa3e2('0x33'))){_0xa260de[_0xa3e2('0x1f')]=qs[_0xa3e2('0x1f')](_0x4098a6['query'][_0xa3e2('0x1f')]);_0xa260de['offset']=qs['offset'](_0x4098a6[_0xa3e2('0x2d')]['offset']);}_0xa260de['order']=qs[_0xa3e2('0x34')](_0x4098a6[_0xa3e2('0x2d')]['sort']);_0xa260de[_0xa3e2('0x35')]=qs['filters'](_[_0xa3e2('0x36')](_0x4098a6[_0xa3e2('0x2d')],_0x2d6d88[_0xa3e2('0x2f')]),_0x46113e);if(_0x4098a6[_0xa3e2('0x2d')][_0xa3e2('0x37')]){_0xa260de[_0xa3e2('0x35')]=_[_0xa3e2('0x38')](_0xa260de[_0xa3e2('0x35')],{'$or':_[_0xa3e2('0x28')](_0x46113e,function(_0x391062){if(_0x391062['type']!=='VIRTUAL'){var _0x3df635={};_0x3df635[_0x391062[_0xa3e2('0x25')]]={'$like':'%'+_0x4098a6['query']['filter']+'%'};return _0x3df635;}})});}_0xa260de=_[_0xa3e2('0x38')]({},_0xa260de,_0x4098a6[_0xa3e2('0x39')]);var _0x3346fc={'where':_0xa260de[_0xa3e2('0x35')]};return db[_0xa3e2('0x3a')][_0xa3e2('0x1d')](_0x3346fc)['then'](function(_0x248259){_0x1535a8[_0xa3e2('0x1d')]=_0x248259;if(_0x4098a6['query'][_0xa3e2('0x3b')]){_0xa260de['include']=[{'all':!![]}];}return db[_0xa3e2('0x3a')][_0xa3e2('0x3c')](_0xa260de);})[_0xa3e2('0x24')](function(_0x450656){_0x1535a8['rows']=_0x450656;return _0x1535a8;})[_0xa3e2('0x24')](respondWithFilteredResult(_0x217d0b,_0xa260de))[_0xa3e2('0x3d')](handleError(_0x217d0b,null));};exports[_0xa3e2('0x3e')]=function(_0xc8579f,_0x2bc8fc){var _0x4af843={'raw':!![],'where':{'id':_0xc8579f[_0xa3e2('0x3f')]['id']}},_0x30ab6f={};_0x30ab6f[_0xa3e2('0x2c')]=_['keys'](db[_0xa3e2('0x3a')][_0xa3e2('0x29')]);_0x30ab6f[_0xa3e2('0x2d')]=_[_0xa3e2('0x2e')](_0xc8579f[_0xa3e2('0x2d')]);_0x30ab6f['filters']=_[_0xa3e2('0x30')](_0x30ab6f[_0xa3e2('0x2c')],_0x30ab6f[_0xa3e2('0x2d')]);_0x4af843['attributes']=_['intersection'](_0x30ab6f[_0xa3e2('0x2c')],qs[_0xa3e2('0x32')](_0xc8579f['query'][_0xa3e2('0x32')]));_0x4af843[_0xa3e2('0x31')]=_0x4af843[_0xa3e2('0x31')][_0xa3e2('0x40')]?_0x4af843[_0xa3e2('0x31')]:_0x30ab6f[_0xa3e2('0x2c')];if(_0xc8579f[_0xa3e2('0x2d')][_0xa3e2('0x3b')]){_0x4af843[_0xa3e2('0x41')]=[{'all':!![]}];}_0x4af843=_[_0xa3e2('0x38')]({},_0x4af843,_0xc8579f[_0xa3e2('0x39')]);return db[_0xa3e2('0x3a')][_0xa3e2('0x42')](_0x4af843)[_0xa3e2('0x24')](handleEntityNotFound(_0x2bc8fc,null))[_0xa3e2('0x24')](respondWithResult(_0x2bc8fc,null))[_0xa3e2('0x3d')](handleError(_0x2bc8fc,null));};exports['create']=function(_0x495d93,_0x3439ab){return db['SalesforceField'][_0xa3e2('0x43')](_0x495d93[_0xa3e2('0x44')],{})['then'](respondWithResult(_0x3439ab,0xc9))[_0xa3e2('0x3d')](handleError(_0x3439ab,null));};exports[_0xa3e2('0x23')]=function(_0x326929,_0x4a8c51){if(_0x326929[_0xa3e2('0x44')]['id']){delete _0x326929['body']['id'];}return db[_0xa3e2('0x3a')][_0xa3e2('0x42')]({'where':{'id':_0x326929[_0xa3e2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a8c51,null))[_0xa3e2('0x24')](saveUpdates(_0x326929[_0xa3e2('0x44')],null))['then'](respondWithResult(_0x4a8c51,null))['catch'](handleError(_0x4a8c51,null));};exports[_0xa3e2('0x45')]=function(_0x1724dd,_0x1d5664){return db[_0xa3e2('0x3a')][_0xa3e2('0x42')]({'where':{'id':_0x1724dd[_0xa3e2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1d5664,null))[_0xa3e2('0x24')](removeEntity(_0x1d5664,null))['catch'](handleError(_0x1d5664,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 5a17fc5..d4def62 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 _0x8450=['moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','api'];(function(_0x2ed70b,_0x12ca04){var _0x54a649=function(_0x3d2d48){while(--_0x3d2d48){_0x2ed70b['push'](_0x2ed70b['shift']());}};_0x54a649(++_0x12ca04);}(_0x8450,0xf6));var _0x0845=function(_0x322306,_0x31fc80){_0x322306=_0x322306-0x0;var _0x4f9152=_0x8450[_0x322306];return _0x4f9152;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0845('0x0'));var moment=require(_0x0845('0x1'));var BPromise=require(_0x0845('0x2'));var rp=require(_0x0845('0x3'));var fs=require('fs');var path=require(_0x0845('0x4'));var rimraf=require(_0x0845('0x5'));var config=require('../../config/environment');var attributes=require(_0x0845('0x6'));module['exports']=function(_0x151e79,_0x5c9a96){return _0x151e79[_0x0845('0x7')](_0x0845('0x8'),attributes,{'tableName':_0x0845('0x9'),'paranoid':![],'indexes':[{'name':_0x0845('0xa'),'fields':[_0x0845('0xb'),_0x0845('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cf1=['./intSalesforceField.attributes','exports','define','salesforce_unique_index','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x54c09c,_0x8cf919){var _0x45d040=function(_0x31d45c){while(--_0x31d45c){_0x54c09c['push'](_0x54c09c['shift']());}};_0x45d040(++_0x8cf919);}(_0x1cf1,0x68));var _0x11cf=function(_0x2265e5,_0x1dcc80){_0x2265e5=_0x2265e5-0x0;var _0x5da3e2=_0x1cf1[_0x2265e5];return _0x5da3e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x11cf('0x0'));var moment=require(_0x11cf('0x1'));var BPromise=require(_0x11cf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11cf('0x3'));var rimraf=require(_0x11cf('0x4'));var config=require(_0x11cf('0x5'));var attributes=require(_0x11cf('0x6'));module[_0x11cf('0x7')]=function(_0x59942b,_0x5ec2e0){return _0x59942b[_0x11cf('0x8')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x11cf('0x9'),'fields':['idField','FieldId'],'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 225e8cc..0f6cacc 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 _0x7a9b=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x2d4469,_0x273d40){var _0x57cfff=function(_0x55a23d){while(--_0x55a23d){_0x2d4469['push'](_0x2d4469['shift']());}};_0x57cfff(++_0x273d40);}(_0x7a9b,0x1e3));var _0xb7a9=function(_0x2b64c6,_0x70bcce){_0x2b64c6=_0x2b64c6-0x0;var _0x59f26b=_0x7a9b[_0x2b64c6];return _0x59f26b;};'use strict';var _=require(_0xb7a9('0x0'));var util=require(_0xb7a9('0x1'));var moment=require('moment');var BPromise=require(_0xb7a9('0x2'));var rs=require(_0xb7a9('0x3'));var fs=require('fs');var Redis=require(_0xb7a9('0x4'));var db=require(_0xb7a9('0x5'))['db'];var utils=require(_0xb7a9('0x6'));var logger=require(_0xb7a9('0x7'))(_0xb7a9('0x8'));var config=require(_0xb7a9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb7a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc5e94f,_0x13715,_0xf44131){return new BPromise(function(_0x1315e5,_0xde3f77){return client['request'](_0xc5e94f,_0xf44131)[_0xb7a9('0xb')](function(_0x328f3f){logger['info'](_0xb7a9('0xc'),_0x13715,_0xb7a9('0xd'));logger[_0xb7a9('0xe')](_0xb7a9('0xf'),_0x13715,'request\x20sent',JSON['stringify'](_0x328f3f));if(_0x328f3f['error']){if(_0x328f3f[_0xb7a9('0x10')][_0xb7a9('0x11')]===0x1f4){logger[_0xb7a9('0x10')](_0xb7a9('0xc'),_0x13715,_0x328f3f[_0xb7a9('0x10')][_0xb7a9('0x12')]);return _0xde3f77(_0x328f3f['error'][_0xb7a9('0x12')]);}logger[_0xb7a9('0x10')]('SalesforceField,\x20%s,\x20%s',_0x13715,_0x328f3f[_0xb7a9('0x10')][_0xb7a9('0x12')]);return _0x1315e5(_0x328f3f['error'][_0xb7a9('0x12')]);}else{logger[_0xb7a9('0x13')](_0xb7a9('0xc'),_0x13715,'request\x20sent');_0x1315e5(_0x328f3f[_0xb7a9('0x14')]['message']);}})['catch'](function(_0x45fd0c){logger['error']('SalesforceField,\x20%s,\x20%s',_0x13715,_0x45fd0c);_0xde3f77(_0x45fd0c);});});} \ No newline at end of file +var _0x881a=['moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x27bd97,_0x557525){var _0x5ec4d0=function(_0x8eda58){while(--_0x8eda58){_0x27bd97['push'](_0x27bd97['shift']());}};_0x5ec4d0(++_0x557525);}(_0x881a,0xae));var _0xa881=function(_0x43f5c7,_0x118763){_0x43f5c7=_0x43f5c7-0x0;var _0x46be5f=_0x881a[_0x43f5c7];return _0x46be5f;};'use strict';var _=require(_0xa881('0x0'));var util=require(_0xa881('0x1'));var moment=require(_0xa881('0x2'));var BPromise=require(_0xa881('0x3'));var rs=require(_0xa881('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa881('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa881('0x6'));var config=require(_0xa881('0x7'));var jayson=require(_0xa881('0x8'));var client=jayson[_0xa881('0x9')][_0xa881('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ead1c,_0x460cd2,_0x468f06){return new BPromise(function(_0x2084bf,_0x423683){return client[_0xa881('0xb')](_0x4ead1c,_0x468f06)[_0xa881('0xc')](function(_0x59fb01){logger[_0xa881('0xd')](_0xa881('0xe'),_0x460cd2,'request\x20sent');logger['debug'](_0xa881('0xf'),_0x460cd2,_0xa881('0x10'),JSON[_0xa881('0x11')](_0x59fb01));if(_0x59fb01[_0xa881('0x12')]){if(_0x59fb01[_0xa881('0x12')]['code']===0x1f4){logger[_0xa881('0x12')]('SalesforceField,\x20%s,\x20%s',_0x460cd2,_0x59fb01[_0xa881('0x12')]['message']);return _0x423683(_0x59fb01[_0xa881('0x12')]['message']);}logger[_0xa881('0x12')]('SalesforceField,\x20%s,\x20%s',_0x460cd2,_0x59fb01[_0xa881('0x12')][_0xa881('0x13')]);return _0x2084bf(_0x59fb01['error']['message']);}else{logger[_0xa881('0xd')](_0xa881('0xe'),_0x460cd2,_0xa881('0x10'));_0x2084bf(_0x59fb01[_0xa881('0x14')][_0xa881('0x13')]);}})[_0xa881('0x15')](function(_0x12b05a){logger['error'](_0xa881('0xe'),_0x460cd2,_0x12b05a);_0x423683(_0x12b05a);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 66668ba..f873303 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 _0x4e0c=['./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3b4585,_0x16a9c2){var _0x551be9=function(_0x5cea93){while(--_0x5cea93){_0x3b4585['push'](_0x3b4585['shift']());}};_0x551be9(++_0x16a9c2);}(_0x4e0c,0x70));var _0xc4e0=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0x4e0c[_0x3e91a9];return _0x25c9ad;};'use strict';var multer=require('multer');var util=require(_0xc4e0('0x0'));var path=require(_0xc4e0('0x1'));var timeout=require('connect-timeout');var express=require(_0xc4e0('0x2'));var router=express[_0xc4e0('0x3')]();var fs_extra=require(_0xc4e0('0x4'));var auth=require(_0xc4e0('0x5'));var interaction=require(_0xc4e0('0x6'));var config=require(_0xc4e0('0x7'));var controller=require(_0xc4e0('0x8'));router[_0xc4e0('0x9')]('/',auth[_0xc4e0('0xa')](),controller['index']);router[_0xc4e0('0x9')]('/:id',auth[_0xc4e0('0xa')](),controller[_0xc4e0('0xb')]);router[_0xc4e0('0x9')](_0xc4e0('0xc'),auth['isAuthenticated'](),controller[_0xc4e0('0xd')]);router[_0xc4e0('0x9')](_0xc4e0('0xe'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0xf')]);router[_0xc4e0('0x10')]('/',auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x11')]);router[_0xc4e0('0x10')](_0xc4e0('0xc'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x12')]);router['put'](_0xc4e0('0x13'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x14')]);router[_0xc4e0('0x15')](_0xc4e0('0x13'),auth[_0xc4e0('0xa')](),controller[_0xc4e0('0x16')]);module[_0xc4e0('0x17')]=router; \ No newline at end of file +var _0x2f9e=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x2c6851,_0x159c7b){var _0x564875=function(_0x15befa){while(--_0x15befa){_0x2c6851['push'](_0x2c6851['shift']());}};_0x564875(++_0x159c7b);}(_0x2f9e,0x117));var _0xe2f9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2f9e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe2f9('0x0'));var util=require(_0xe2f9('0x1'));var path=require('path');var timeout=require(_0xe2f9('0x2'));var express=require(_0xe2f9('0x3'));var router=express[_0xe2f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe2f9('0x5'));var interaction=require(_0xe2f9('0x6'));var config=require(_0xe2f9('0x7'));var controller=require(_0xe2f9('0x8'));router[_0xe2f9('0x9')]('/',auth[_0xe2f9('0xa')](),controller['index']);router[_0xe2f9('0x9')](_0xe2f9('0xb'),auth['isAuthenticated'](),controller[_0xe2f9('0xc')]);router[_0xe2f9('0x9')](_0xe2f9('0xd'),auth['isAuthenticated'](),controller[_0xe2f9('0xe')]);router[_0xe2f9('0x9')](_0xe2f9('0xf'),auth[_0xe2f9('0xa')](),controller[_0xe2f9('0x10')]);router[_0xe2f9('0x11')]('/',auth[_0xe2f9('0xa')](),controller[_0xe2f9('0x12')]);router['post'](_0xe2f9('0xd'),auth['isAuthenticated'](),controller[_0xe2f9('0x13')]);router[_0xe2f9('0x14')](_0xe2f9('0xb'),auth['isAuthenticated'](),controller[_0xe2f9('0x15')]);router[_0xe2f9('0x16')](_0xe2f9('0xb'),auth[_0xe2f9('0xa')](),controller[_0xe2f9('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 8b8e188..2fa5ae3 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 _0xe6d8=['exports','STRING','username','remoteUri','sequelize'];(function(_0x3a8cce,_0x17c858){var _0x3582f8=function(_0x696839){while(--_0x696839){_0x3a8cce['push'](_0x3a8cce['shift']());}};_0x3582f8(++_0x17c858);}(_0xe6d8,0x126));var _0x8e6d=function(_0x2457ee,_0x13a6ea){_0x2457ee=_0x2457ee-0x0;var _0x1cf3f3=_0xe6d8[_0x2457ee];return _0x1cf3f3;};'use strict';var Sequelize=require(_0x8e6d('0x0'));module[_0x8e6d('0x1')]={'name':{'type':Sequelize[_0x8e6d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8e6d('0x2')],'unique':_0x8e6d('0x3')},'password':{'type':Sequelize[_0x8e6d('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8e6d('0x2')],'unique':_0x8e6d('0x4')},'serverUrl':{'type':Sequelize[_0x8e6d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc04d=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xc04d,0xec));var _0xdc04=function(_0x171e4d,_0x4f2493){_0x171e4d=_0x171e4d-0x0;var _0x2d2bf4=_0xc04d[_0x171e4d];return _0x2d2bf4;};'use strict';var Sequelize=require(_0xdc04('0x0'));module[_0xdc04('0x1')]={'name':{'type':Sequelize[_0xdc04('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xdc04('0x3')},'password':{'type':Sequelize[_0xdc04('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdc04('0x4')},'serverUrl':{'type':Sequelize[_0xdc04('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index c82f57f..89781e4 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 _0xeea1=['includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','length','options','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','parent','watch_list','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','resolved_at','caller_id','work_notes','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','location','username','password','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','remove','includes','internalType','push','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','all','concat','ServiceNow\x20error:\x20','statusCode','test','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL'];(function(_0x10d604,_0x9cc4c5){var _0x303c4a=function(_0x453c0c){while(--_0x453c0c){_0x10d604['push'](_0x10d604['shift']());}};_0x303c4a(++_0x9cc4c5);}(_0xeea1,0x12e));var _0x1eea=function(_0x4eb5c2,_0x3363b1){_0x4eb5c2=_0x4eb5c2-0x0;var _0x15bc2d=_0xeea1[_0x4eb5c2];return _0x15bc2d;};'use strict';var emlformat=require(_0x1eea('0x0'));var rimraf=require(_0x1eea('0x1'));var zipdir=require(_0x1eea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1eea('0x3'));var moment=require('moment');var BPromise=require(_0x1eea('0x4'));var Mustache=require(_0x1eea('0x5'));var util=require(_0x1eea('0x6'));var path=require(_0x1eea('0x7'));var sox=require(_0x1eea('0x8'));var csv=require(_0x1eea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1eea('0xa'));var _=require(_0x1eea('0xb'));var squel=require(_0x1eea('0xc'));var crypto=require(_0x1eea('0xd'));var jsforce=require(_0x1eea('0xe'));var deskjs=require(_0x1eea('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1eea('0x10'));var Redis=require(_0x1eea('0x11'));var authService=require(_0x1eea('0x12'));var qs=require(_0x1eea('0x13'));var as=require(_0x1eea('0x14'));var hardwareService=require(_0x1eea('0x15'));var logger=require(_0x1eea('0x16'))('api');var utils=require(_0x1eea('0x17'));var config=require(_0x1eea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1eea('0x19'))['db'];var integrations=require(_0x1eea('0x1a'));function respondWithStatusCode(_0x334a03,_0x4e8233){_0x4e8233=_0x4e8233||0xcc;return function(_0x128cdf){if(_0x128cdf){return _0x334a03[_0x1eea('0x1b')](_0x4e8233);}return _0x334a03['status'](_0x4e8233)[_0x1eea('0x1c')]();};}function respondWithResult(_0xe148f0,_0x2bb53b){_0x2bb53b=_0x2bb53b||0xc8;return function(_0x61d260){if(_0x61d260){return _0xe148f0[_0x1eea('0x1d')](_0x2bb53b)['json'](_0x61d260);}};}function respondWithFilteredResult(_0x51170b,_0x55f606){return function(_0x26a580){if(_0x26a580){var _0x56fc48=typeof _0x55f606[_0x1eea('0x1e')]===_0x1eea('0x1f')&&typeof _0x55f606[_0x1eea('0x20')]===_0x1eea('0x1f');var _0x12e33b=_0x26a580[_0x1eea('0x21')];var _0x470f08=_0x56fc48?0x0:_0x55f606['offset'];var _0x55dbb5=_0x56fc48?_0x26a580['count']:_0x55f606[_0x1eea('0x1e')]+_0x55f606[_0x1eea('0x20')];var _0x823b05;if(_0x55dbb5>=_0x12e33b){_0x55dbb5=_0x12e33b;_0x823b05=0xc8;}else{_0x823b05=0xce;}_0x51170b[_0x1eea('0x1d')](_0x823b05);return _0x51170b['set'](_0x1eea('0x22'),_0x470f08+'-'+_0x55dbb5+'/'+_0x12e33b)[_0x1eea('0x23')](_0x26a580);}return null;};}function patchUpdates(_0x521af4){return function(_0x44129b){try{jsonpatch[_0x1eea('0x24')](_0x44129b,_0x521af4,!![]);}catch(_0x321c58){return BPromise[_0x1eea('0x25')](_0x321c58);}return _0x44129b[_0x1eea('0x26')]();};}function saveUpdates(_0x410093,_0x28d8a5){return function(_0x1f4758){if(_0x1f4758){return _0x1f4758[_0x1eea('0x27')](_0x410093)['then'](function(_0xac7c23){return _0xac7c23;});}return null;};}function removeEntity(_0x18a569,_0x258deb){return function(_0x486e36){if(_0x486e36){return _0x486e36[_0x1eea('0x28')]()[_0x1eea('0x29')](function(){_0x18a569[_0x1eea('0x1d')](0xcc)[_0x1eea('0x1c')]();});}};}function handleEntityNotFound(_0xe23b7f,_0x1822ec){return function(_0x12412f){if(!_0x12412f){_0xe23b7f[_0x1eea('0x1b')](0x194);}return _0x12412f;};}function handleError(_0x2df319,_0x44e672){_0x44e672=_0x44e672||0x1f4;return function(_0x217085){logger['error'](_0x217085[_0x1eea('0x2a')]);if(_0x217085[_0x1eea('0x2b')]){delete _0x217085[_0x1eea('0x2b')];}_0x2df319['status'](_0x44e672)[_0x1eea('0x2c')](_0x217085);};}exports[_0x1eea('0x2d')]=function(_0x19eefa,_0x225b66){var _0x18a137={},_0x3aef5f={},_0x33ac4e={'count':0x0,'rows':[]};var _0x3fed33=_[_0x1eea('0x2e')](db[_0x1eea('0x2f')][_0x1eea('0x30')],function(_0x5a4cce){return{'name':_0x5a4cce[_0x1eea('0x31')],'type':_0x5a4cce['type'][_0x1eea('0x32')]};});_0x3aef5f[_0x1eea('0x33')]=_[_0x1eea('0x2e')](_0x3fed33,_0x1eea('0x2b'));_0x3aef5f[_0x1eea('0x34')]=_[_0x1eea('0x35')](_0x19eefa[_0x1eea('0x34')]);_0x3aef5f['filters']=_[_0x1eea('0x36')](_0x3aef5f['model'],_0x3aef5f['query']);_0x18a137[_0x1eea('0x37')]=_['intersection'](_0x3aef5f[_0x1eea('0x33')],qs[_0x1eea('0x38')](_0x19eefa[_0x1eea('0x34')][_0x1eea('0x38')]));_0x18a137['attributes']=_0x18a137[_0x1eea('0x37')]['length']?_0x18a137[_0x1eea('0x37')]:_0x3aef5f[_0x1eea('0x33')];if(!_0x19eefa[_0x1eea('0x34')][_0x1eea('0x39')](_0x1eea('0x3a'))){_0x18a137[_0x1eea('0x20')]=qs[_0x1eea('0x20')](_0x19eefa[_0x1eea('0x34')][_0x1eea('0x20')]);_0x18a137[_0x1eea('0x1e')]=qs[_0x1eea('0x1e')](_0x19eefa[_0x1eea('0x34')]['offset']);}_0x18a137[_0x1eea('0x3b')]=qs[_0x1eea('0x3c')](_0x19eefa[_0x1eea('0x34')]['sort']);_0x18a137['where']=qs[_0x1eea('0x3d')](_[_0x1eea('0x3e')](_0x19eefa[_0x1eea('0x34')],_0x3aef5f[_0x1eea('0x3d')]),_0x3fed33);if(_0x19eefa[_0x1eea('0x34')][_0x1eea('0x3f')]){_0x18a137[_0x1eea('0x40')]=_[_0x1eea('0x41')](_0x18a137[_0x1eea('0x40')],{'$or':_[_0x1eea('0x2e')](_0x3fed33,function(_0x20130b){if(_0x20130b[_0x1eea('0x42')]!==_0x1eea('0x43')){var _0x1ba10f={};_0x1ba10f[_0x20130b[_0x1eea('0x2b')]]={'$like':'%'+_0x19eefa[_0x1eea('0x34')][_0x1eea('0x3f')]+'%'};return _0x1ba10f;}})});}_0x18a137=_[_0x1eea('0x41')]({},_0x18a137,_0x19eefa['options']);var _0x8c389a={'where':_0x18a137[_0x1eea('0x40')]};return db[_0x1eea('0x2f')][_0x1eea('0x21')](_0x8c389a)['then'](function(_0x3d2e22){_0x33ac4e[_0x1eea('0x21')]=_0x3d2e22;if(_0x19eefa[_0x1eea('0x34')][_0x1eea('0x44')]){_0x18a137[_0x1eea('0x45')]=[{'all':!![]}];}return db[_0x1eea('0x2f')][_0x1eea('0x46')](_0x18a137);})[_0x1eea('0x29')](function(_0x2f289a){_0x33ac4e['rows']=_0x2f289a;return _0x33ac4e;})['then'](respondWithFilteredResult(_0x225b66,_0x18a137))[_0x1eea('0x47')](handleError(_0x225b66,null));};exports[_0x1eea('0x48')]=function(_0x4b9598,_0x2e302d){var _0x519ab2={'raw':![],'where':{'id':_0x4b9598[_0x1eea('0x49')]['id']}},_0x364340={};_0x364340[_0x1eea('0x33')]=_[_0x1eea('0x35')](db[_0x1eea('0x2f')][_0x1eea('0x30')]);_0x364340[_0x1eea('0x34')]=_['keys'](_0x4b9598[_0x1eea('0x34')]);_0x364340[_0x1eea('0x3d')]=_[_0x1eea('0x36')](_0x364340[_0x1eea('0x33')],_0x364340[_0x1eea('0x34')]);_0x519ab2[_0x1eea('0x37')]=_[_0x1eea('0x36')](_0x364340['model'],qs['fields'](_0x4b9598[_0x1eea('0x34')][_0x1eea('0x38')]));_0x519ab2[_0x1eea('0x37')]=_0x519ab2[_0x1eea('0x37')]['length']?_0x519ab2[_0x1eea('0x37')]:_0x364340[_0x1eea('0x33')];if(_0x4b9598[_0x1eea('0x34')]['includeAll']){_0x519ab2[_0x1eea('0x45')]=[{'all':!![]}];}_0x519ab2=_['merge']({},_0x519ab2,_0x4b9598['options']);return db['ServicenowAccount'][_0x1eea('0x4a')](_0x519ab2)[_0x1eea('0x29')](handleEntityNotFound(_0x2e302d,null))[_0x1eea('0x29')](respondWithResult(_0x2e302d,null))[_0x1eea('0x47')](handleError(_0x2e302d,null));};exports[_0x1eea('0x4b')]=function(_0x4155f5,_0x39e5ba){return db[_0x1eea('0x2f')][_0x1eea('0x4b')](_0x4155f5[_0x1eea('0x4c')],{})[_0x1eea('0x29')](respondWithResult(_0x39e5ba,0xc9))['catch'](handleError(_0x39e5ba,null));};exports[_0x1eea('0x27')]=function(_0x5c509a,_0x27856f){if(_0x5c509a[_0x1eea('0x4c')]['id']){delete _0x5c509a[_0x1eea('0x4c')]['id'];}return db[_0x1eea('0x2f')][_0x1eea('0x4a')]({'where':{'id':_0x5c509a[_0x1eea('0x49')]['id']}})[_0x1eea('0x29')](handleEntityNotFound(_0x27856f,null))['then'](saveUpdates(_0x5c509a[_0x1eea('0x4c')],null))[_0x1eea('0x29')](respondWithResult(_0x27856f,null))['catch'](handleError(_0x27856f,null));};exports[_0x1eea('0x28')]=function(_0x5eca7b,_0x2e3cc9){return db[_0x1eea('0x2f')][_0x1eea('0x4a')]({'where':{'id':_0x5eca7b[_0x1eea('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e3cc9,null))['then'](removeEntity(_0x2e3cc9,null))['catch'](handleError(_0x2e3cc9,null));};exports[_0x1eea('0x4d')]=function(_0x52969c,_0x4c539a,_0xd08fb1){var _0x19b5be={};var _0x17c0e5={};var _0x4bfbbf;var _0x14ce2c;return db['ServicenowAccount'][_0x1eea('0x4e')]({'where':{'id':_0x52969c['params']['id']}})[_0x1eea('0x29')](handleEntityNotFound(_0x4c539a,null))[_0x1eea('0x29')](function(_0x44937f){if(_0x44937f){_0x4bfbbf=_0x44937f;_0x17c0e5[_0x1eea('0x33')]=_['keys'](db[_0x1eea('0x4f')][_0x1eea('0x30')]);_0x17c0e5['query']=_[_0x1eea('0x35')](_0x52969c['query']);_0x17c0e5['filters']=_[_0x1eea('0x36')](_0x17c0e5[_0x1eea('0x33')],_0x17c0e5[_0x1eea('0x34')]);_0x19b5be['attributes']=_['intersection'](_0x17c0e5['model'],qs['fields'](_0x52969c['query'][_0x1eea('0x38')]));_0x19b5be[_0x1eea('0x37')]=_0x19b5be[_0x1eea('0x37')][_0x1eea('0x50')]?_0x19b5be[_0x1eea('0x37')]:_0x17c0e5[_0x1eea('0x33')];_0x19b5be[_0x1eea('0x3b')]=qs['sort'](_0x52969c[_0x1eea('0x34')][_0x1eea('0x3c')]);_0x19b5be[_0x1eea('0x40')]=qs[_0x1eea('0x3d')](_[_0x1eea('0x3e')](_0x52969c['query'],_0x17c0e5[_0x1eea('0x3d')]));if(_0x52969c[_0x1eea('0x34')][_0x1eea('0x3f')]){_0x19b5be[_0x1eea('0x40')]=_[_0x1eea('0x41')](_0x19b5be[_0x1eea('0x40')],{'$or':_[_0x1eea('0x2e')](_0x19b5be[_0x1eea('0x37')],function(_0x5a068c){var _0x3032d1={};_0x3032d1[_0x5a068c]={'$like':'%'+_0x52969c['query']['filter']+'%'};return _0x3032d1;})});}_0x19b5be=_[_0x1eea('0x41')]({},_0x19b5be,_0x52969c[_0x1eea('0x51')]);return _0x4bfbbf[_0x1eea('0x4d')](_0x19b5be);}})['then'](function(_0x481246){if(_0x481246){_0x14ce2c=_0x481246['length'];if(!_0x52969c[_0x1eea('0x34')]['hasOwnProperty'](_0x1eea('0x3a'))){_0x19b5be[_0x1eea('0x20')]=qs[_0x1eea('0x20')](_0x52969c[_0x1eea('0x34')]['limit']);_0x19b5be[_0x1eea('0x1e')]=qs[_0x1eea('0x1e')](_0x52969c[_0x1eea('0x34')][_0x1eea('0x1e')]);}return _0x4bfbbf['getConfigurations'](_0x19b5be);}})[_0x1eea('0x29')](function(_0x35a69f){if(_0x35a69f){return _0x35a69f?{'count':_0x14ce2c,'rows':_0x35a69f}:null;}})['then'](respondWithResult(_0x4c539a,null))[_0x1eea('0x47')](handleError(_0x4c539a,null));};exports[_0x1eea('0x52')]=function(_0x52b9a4,_0x50550c,_0x4a5ff0){if(_0x52b9a4[_0x1eea('0x4c')]['id']){delete _0x52b9a4['body']['id'];}return db[_0x1eea('0x2f')]['findOne']({'where':{'id':_0x52b9a4[_0x1eea('0x49')]['id']}})[_0x1eea('0x29')](handleEntityNotFound(_0x50550c,null))[_0x1eea('0x29')](function(_0x472e73){if(_0x472e73){_0x52b9a4[_0x1eea('0x4c')][_0x1eea('0x53')]=_0x472e73['id'];_0x52b9a4[_0x1eea('0x4c')][_0x1eea('0x54')]=integrations[_0x1eea('0x55')](_0x52b9a4['body']['channel'],_0x52b9a4[_0x1eea('0x4c')][_0x1eea('0x42')]);_0x52b9a4['body'][_0x1eea('0x56')]=integrations[_0x1eea('0x57')](_0x52b9a4[_0x1eea('0x4c')][_0x1eea('0x58')],_0x52b9a4[_0x1eea('0x4c')][_0x1eea('0x42')]);return db[_0x1eea('0x4f')]['create'](_0x52b9a4[_0x1eea('0x4c')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x1eea('0x59')],'as':'Descriptions'}]});}return null;})[_0x1eea('0x29')](respondWithResult(_0x50550c,null))[_0x1eea('0x47')](handleError(_0x50550c,null));};exports['getFields']=function(_0x5c1a61,_0x49249b,_0x20cf51){var _0x29704f=[_0x1eea('0x5a'),_0x1eea('0x5b'),_0x1eea('0x5c'),_0x1eea('0x5d'),_0x1eea('0x5e'),_0x1eea('0x5f'),'incident_state',_0x1eea('0x60'),'category'];var _0x381b50=[_0x1eea('0x61'),_0x1eea('0x5a'),'caused_by',_0x1eea('0x62'),'upon_reject',_0x1eea('0x63'),'child_incidents',_0x1eea('0x5b'),_0x1eea('0x64'),_0x1eea('0x65'),_0x1eea('0x66'),_0x1eea('0x67'),_0x1eea('0x68'),'user_input',_0x1eea('0x69'),'sys_domain',_0x1eea('0x6a'),_0x1eea('0x6b'),_0x1eea('0x5c'),_0x1eea('0x3b'),_0x1eea('0x6c'),_0x1eea('0x6d'),_0x1eea('0x6e'),_0x1eea('0x6f'),_0x1eea('0x70'),_0x1eea('0x71'),'work_notes_list',_0x1eea('0x72'),_0x1eea('0x73'),_0x1eea('0x74'),_0x1eea('0x75'),_0x1eea('0x76'),'expected_start',_0x1eea('0x77'),_0x1eea('0x78'),_0x1eea('0x79'),'work_end','reopened_time',_0x1eea('0x7a'),_0x1eea('0x7b'),'approval_set','subcategory',_0x1eea('0x7c'),'short_description',_0x1eea('0x5e'),'correlation_display',_0x1eea('0x7d'),_0x1eea('0x7e'),_0x1eea('0x7f'),_0x1eea('0x80'),_0x1eea('0x81'),_0x1eea('0x82'),_0x1eea('0x83'),_0x1eea('0x5f'),_0x1eea('0x84'),_0x1eea('0x85'),_0x1eea('0x86'),'follow_up','parent_incident','sys_id',_0x1eea('0x87'),_0x1eea('0x88'),_0x1eea('0x89'),_0x1eea('0x8a'),_0x1eea('0x8b'),_0x1eea('0x8c'),_0x1eea('0x8d'),_0x1eea('0x8e'),_0x1eea('0x8f'),_0x1eea('0x60'),_0x1eea('0x90'),'sla_due','approval',_0x1eea('0x91'),_0x1eea('0x92'),'sys_mod_count',_0x1eea('0x93'),_0x1eea('0x94'),_0x1eea('0x95'),_0x1eea('0x96'),'correlation_id',_0x1eea('0x97'),'category'];var _0x33c53c='';var _0x11778d='';var _0x30b999=[];var _0x3a5dd8='';var _0x4691ca='';var _0x2d1aea=[];var _0x3ef8ef='';var _0xee21d4='';var _0x12ffd8={};var _0x2a07fd='';return db[_0x1eea('0x2f')]['findOne']({'where':{'id':_0x5c1a61[_0x1eea('0x49')]['id']},'attributes':['id',_0x1eea('0x98'),_0x1eea('0x99'),'email',_0x1eea('0x9a'),_0x1eea('0x9b')]})[_0x1eea('0x29')](handleEntityNotFound(_0x49249b,null))[_0x1eea('0x29')](function(_0x3c423e){if(_0x3c423e){_0x2a07fd=_0x3c423e[_0x1eea('0x9a')];var _0x3d646b=_0x2a07fd['slice'](-0x1);if(_0x3d646b==='/'){_0x2a07fd=_0x2a07fd[_0x1eea('0x9c')](0x0,_0x2a07fd[_0x1eea('0x9d')](_0x3d646b));}_0xee21d4=util['format'](_0x1eea('0x9e'),_0x2a07fd);_0x3ef8ef=util[_0x1eea('0x9f')](_0x1eea('0xa0'),_0x2a07fd);_0x12ffd8={'user':_0x3c423e['username'],'pass':_0x3c423e['password']};var _0x28f19d={'method':_0x1eea('0xa1'),'uri':_0xee21d4+_0x1eea('0xa2'),'auth':_0x12ffd8,'json':!![]};return rp(_0x28f19d);}})[_0x1eea('0x29')](function(_0x3130da){if(_0x3130da['result'][_0x1eea('0x50')]>0x0){_0x33c53c=_0x3130da[_0x1eea('0xa3')];}console['log']('incident\x20table\x20objects',_0x33c53c);_0x2d1aea=[];_0x11778d=Object[_0x1eea('0xa4')]([],_0x33c53c);_[_0x1eea('0xa5')](_0x11778d,function(_0x4d2d6b){return!_0x29704f[_0x1eea('0xa6')](_0x4d2d6b[_0x1eea('0x2b')]);});_0x11778d['forEach'](function(_0x38e800){var _0x5b82d3=createFieldObject(_0x3ef8ef,_0x12ffd8,_0x38e800[_0x1eea('0xa7')],_0x38e800[_0x1eea('0x2b')],_0x38e800['label'],![]);_0x2d1aea[_0x1eea('0xa8')](_0x5b82d3);});return Promise['all'](_0x2d1aea);})[_0x1eea('0x29')](function(_0x49d380){_0x30b999=_0x49d380;_0x3a5dd8=Object[_0x1eea('0xa4')]([],_0x33c53c);console['log'](_0x1eea('0xa9'),_0x33c53c);_[_0x1eea('0xa5')](_0x3a5dd8,function(_0x7504fe){return _0x381b50[_0x1eea('0xa6')](_0x7504fe[_0x1eea('0x2b')]);});console[_0x1eea('0xaa')](_0x1eea('0xab'),_0x3a5dd8);_0x2d1aea=[];_0x3a5dd8[_0x1eea('0xac')](function(_0x481070){var _0x3be351=createFieldObject(_0x3ef8ef,_0x12ffd8,_0x481070[_0x1eea('0xa7')],_0x481070[_0x1eea('0x2b')],_0x481070[_0x1eea('0xad')],!![]);_0x2d1aea['push'](_0x3be351);});return Promise[_0x1eea('0xae')](_0x2d1aea);})['then'](function(_0x4ae1a3){_0x4691ca=_0x4ae1a3;var _0x1fc7ed=_0x30b999[_0x1eea('0xaf')](_0x4691ca);return{'count':_0x1fc7ed[_0x1eea('0x50')],'rows':_0x1fc7ed};})[_0x1eea('0x29')](respondWithResult(_0x49249b,null))['catch'](function(_0x4324d6){console[_0x1eea('0xaa')](_0x1eea('0xb0')+_0x4324d6);var _0x3dabe0=_0x5c1a61['query']['test']?0x1f4:_0x4324d6[_0x1eea('0xb1')]||0x1f4;logger['error'](_0x4324d6[_0x1eea('0x2a')]);delete _0x4324d6[_0x1eea('0x2b')];if(_0x3dabe0===0x191){_0x3dabe0=0x190;}_0x49249b['status'](_0x3dabe0)[_0x1eea('0x2c')](_0x5c1a61[_0x1eea('0x34')][_0x1eea('0xb2')]?{'message':'Wrong\x20credentials','statusCode':_0x4324d6[_0x1eea('0xb1')]}:_0x4324d6);});};function createFieldObject(_0x43189c,_0x4adb75,_0x4fc453,_0x5a5839,_0x4bc7c9,_0x468f7b){return new Promise(function(_0x4742db,_0x41317f){var _0x377dbb={'id':_0x5a5839,'name':_0x4bc7c9,'custom':_0x468f7b};if(_0x4fc453===_0x1eea('0xb3')){_0x377dbb[_0x1eea('0x51')]=[{'name':_0x1eea('0xb4'),'value':'true'},{'name':_0x1eea('0xb5'),'value':_0x1eea('0xb6')}];_0x4742db(_0x377dbb);}else{var _0x211074={'method':_0x1eea('0xa1'),'uri':_0x43189c+_0x1eea('0xb7')+_0x5a5839,'auth':_0x4adb75,'json':!![]};return rp(_0x211074)[_0x1eea('0x29')](function(_0x16695f){var _0x594842=[];if(_0x16695f[_0x1eea('0xa3')][_0x1eea('0x50')]>0x0){_0x16695f[_0x1eea('0xa3')][_0x1eea('0xac')](function(_0x35649f){if(_0x35649f[_0x1eea('0xb8')]===_0x1eea('0xb6')){var _0x54a002={'name':_0x35649f['label'],'value':_0x35649f['value']};_0x594842['push'](_0x54a002);}});}_0x377dbb['options']=_0x594842;if(_0x377dbb[_0x1eea('0x51')][_0x1eea('0x50')]>0x0){_0x4742db(_0x377dbb);}else{if(_0x468f7b==![]){_0x4742db();}else{_0x4742db(_0x377dbb);}}});}});} \ No newline at end of file +var _0x6258=['stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','fields','length','find','create','body','catch','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','ServicenowField','Subjects','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','watch_list','child_incidents','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','business_stc','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','sla_due','approval','due_date','reopen_count','sys_tags','escalation','correlation_id','location','category','password','email','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','fast-json-patch','request-promise','moment','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/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error'];(function(_0x5933cb,_0x2f19e5){var _0x339eb0=function(_0x2e6bfc){while(--_0x2e6bfc){_0x5933cb['push'](_0x5933cb['shift']());}};_0x339eb0(++_0x2f19e5);}(_0x6258,0x94));var _0x8625=function(_0x523a8b,_0x5a7f8d){_0x523a8b=_0x523a8b-0x0;var _0x45c38c=_0x6258[_0x523a8b];return _0x45c38c;};'use strict';var emlformat=require(_0x8625('0x0'));var rimraf=require(_0x8625('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8625('0x2'));var rp=require(_0x8625('0x3'));var moment=require(_0x8625('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8625('0x5'));var sox=require(_0x8625('0x6'));var csv=require(_0x8625('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8625('0x8'));var _=require(_0x8625('0x9'));var squel=require(_0x8625('0xa'));var crypto=require(_0x8625('0xb'));var jsforce=require(_0x8625('0xc'));var deskjs=require(_0x8625('0xd'));var toCsv=require(_0x8625('0x7'));var querystring=require(_0x8625('0xe'));var Papa=require(_0x8625('0xf'));var Redis=require(_0x8625('0x10'));var authService=require(_0x8625('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8625('0x12'));var hardwareService=require(_0x8625('0x13'));var logger=require('../../config/logger')(_0x8625('0x14'));var utils=require(_0x8625('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8625('0x16'));var db=require(_0x8625('0x17'))['db'];var integrations=require(_0x8625('0x18'));function respondWithStatusCode(_0x14c11d,_0x298e63){_0x298e63=_0x298e63||0xcc;return function(_0x44af0b){if(_0x44af0b){return _0x14c11d[_0x8625('0x19')](_0x298e63);}return _0x14c11d['status'](_0x298e63)['end']();};}function respondWithResult(_0x523d16,_0x187832){_0x187832=_0x187832||0xc8;return function(_0x3f19d1){if(_0x3f19d1){return _0x523d16[_0x8625('0x1a')](_0x187832)['json'](_0x3f19d1);}};}function respondWithFilteredResult(_0x29c338,_0x18d36a){return function(_0x31fc13){if(_0x31fc13){var _0x4a0bb8=typeof _0x18d36a['offset']===_0x8625('0x1b')&&typeof _0x18d36a[_0x8625('0x1c')]===_0x8625('0x1b');var _0x8441be=_0x31fc13[_0x8625('0x1d')];var _0x24b74e=_0x4a0bb8?0x0:_0x18d36a[_0x8625('0x1e')];var _0x363b91=_0x4a0bb8?_0x31fc13[_0x8625('0x1d')]:_0x18d36a[_0x8625('0x1e')]+_0x18d36a[_0x8625('0x1c')];var _0x2aae68;if(_0x363b91>=_0x8441be){_0x363b91=_0x8441be;_0x2aae68=0xc8;}else{_0x2aae68=0xce;}_0x29c338[_0x8625('0x1a')](_0x2aae68);return _0x29c338[_0x8625('0x1f')](_0x8625('0x20'),_0x24b74e+'-'+_0x363b91+'/'+_0x8441be)[_0x8625('0x21')](_0x31fc13);}return null;};}function patchUpdates(_0x1b2852){return function(_0x18b9ae){try{jsonpatch[_0x8625('0x22')](_0x18b9ae,_0x1b2852,!![]);}catch(_0x48d9cf){return BPromise[_0x8625('0x23')](_0x48d9cf);}return _0x18b9ae['save']();};}function saveUpdates(_0x20a898,_0x2d2dad){return function(_0x129e25){if(_0x129e25){return _0x129e25[_0x8625('0x24')](_0x20a898)[_0x8625('0x25')](function(_0x4577c6){return _0x4577c6;});}return null;};}function removeEntity(_0x368b56,_0x1eb60a){return function(_0x1e2c4b){if(_0x1e2c4b){return _0x1e2c4b[_0x8625('0x26')]()[_0x8625('0x25')](function(){_0x368b56['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a2a5,_0x2bcd4e){return function(_0x2e1dae){if(!_0x2e1dae){_0x59a2a5['sendStatus'](0x194);}return _0x2e1dae;};}function handleError(_0x2ac61c,_0x10f55d){_0x10f55d=_0x10f55d||0x1f4;return function(_0x8ef081){logger[_0x8625('0x27')](_0x8ef081[_0x8625('0x28')]);if(_0x8ef081[_0x8625('0x29')]){delete _0x8ef081[_0x8625('0x29')];}_0x2ac61c[_0x8625('0x1a')](_0x10f55d)[_0x8625('0x2a')](_0x8ef081);};}exports[_0x8625('0x2b')]=function(_0x111367,_0x1db611){var _0x1d8ed2={},_0x49c3fb={},_0x48d257={'count':0x0,'rows':[]};var _0x516853=_[_0x8625('0x2c')](db[_0x8625('0x2d')]['rawAttributes'],function(_0x57e7fc){return{'name':_0x57e7fc[_0x8625('0x2e')],'type':_0x57e7fc[_0x8625('0x2f')][_0x8625('0x30')]};});_0x49c3fb[_0x8625('0x31')]=_[_0x8625('0x2c')](_0x516853,_0x8625('0x29'));_0x49c3fb[_0x8625('0x32')]=_[_0x8625('0x33')](_0x111367[_0x8625('0x32')]);_0x49c3fb[_0x8625('0x34')]=_[_0x8625('0x35')](_0x49c3fb[_0x8625('0x31')],_0x49c3fb[_0x8625('0x32')]);_0x1d8ed2[_0x8625('0x36')]=_[_0x8625('0x35')](_0x49c3fb[_0x8625('0x31')],qs['fields'](_0x111367[_0x8625('0x32')]['fields']));_0x1d8ed2['attributes']=_0x1d8ed2[_0x8625('0x36')]['length']?_0x1d8ed2[_0x8625('0x36')]:_0x49c3fb[_0x8625('0x31')];if(!_0x111367['query'][_0x8625('0x37')](_0x8625('0x38'))){_0x1d8ed2['limit']=qs['limit'](_0x111367['query'][_0x8625('0x1c')]);_0x1d8ed2[_0x8625('0x1e')]=qs[_0x8625('0x1e')](_0x111367['query'][_0x8625('0x1e')]);}_0x1d8ed2[_0x8625('0x39')]=qs[_0x8625('0x3a')](_0x111367['query'][_0x8625('0x3a')]);_0x1d8ed2[_0x8625('0x3b')]=qs[_0x8625('0x34')](_[_0x8625('0x3c')](_0x111367[_0x8625('0x32')],_0x49c3fb['filters']),_0x516853);if(_0x111367['query'][_0x8625('0x3d')]){_0x1d8ed2[_0x8625('0x3b')]=_[_0x8625('0x3e')](_0x1d8ed2[_0x8625('0x3b')],{'$or':_['map'](_0x516853,function(_0x4d593d){if(_0x4d593d[_0x8625('0x2f')]!==_0x8625('0x3f')){var _0x398065={};_0x398065[_0x4d593d['name']]={'$like':'%'+_0x111367[_0x8625('0x32')]['filter']+'%'};return _0x398065;}})});}_0x1d8ed2=_[_0x8625('0x3e')]({},_0x1d8ed2,_0x111367[_0x8625('0x40')]);var _0x2a84d9={'where':_0x1d8ed2['where']};return db[_0x8625('0x2d')][_0x8625('0x1d')](_0x2a84d9)['then'](function(_0x3cabaa){_0x48d257[_0x8625('0x1d')]=_0x3cabaa;if(_0x111367[_0x8625('0x32')][_0x8625('0x41')]){_0x1d8ed2[_0x8625('0x42')]=[{'all':!![]}];}return db[_0x8625('0x2d')]['findAll'](_0x1d8ed2);})[_0x8625('0x25')](function(_0x5c318e){_0x48d257[_0x8625('0x43')]=_0x5c318e;return _0x48d257;})[_0x8625('0x25')](respondWithFilteredResult(_0x1db611,_0x1d8ed2))['catch'](handleError(_0x1db611,null));};exports[_0x8625('0x44')]=function(_0x241815,_0x3cb6a4){var _0x3f2f23={'raw':![],'where':{'id':_0x241815['params']['id']}},_0x3e837c={};_0x3e837c['model']=_[_0x8625('0x33')](db[_0x8625('0x2d')][_0x8625('0x45')]);_0x3e837c[_0x8625('0x32')]=_[_0x8625('0x33')](_0x241815[_0x8625('0x32')]);_0x3e837c['filters']=_['intersection'](_0x3e837c[_0x8625('0x31')],_0x3e837c[_0x8625('0x32')]);_0x3f2f23[_0x8625('0x36')]=_['intersection'](_0x3e837c[_0x8625('0x31')],qs[_0x8625('0x46')](_0x241815[_0x8625('0x32')][_0x8625('0x46')]));_0x3f2f23[_0x8625('0x36')]=_0x3f2f23[_0x8625('0x36')][_0x8625('0x47')]?_0x3f2f23[_0x8625('0x36')]:_0x3e837c['model'];if(_0x241815[_0x8625('0x32')][_0x8625('0x41')]){_0x3f2f23[_0x8625('0x42')]=[{'all':!![]}];}_0x3f2f23=_['merge']({},_0x3f2f23,_0x241815[_0x8625('0x40')]);return db[_0x8625('0x2d')][_0x8625('0x48')](_0x3f2f23)[_0x8625('0x25')](handleEntityNotFound(_0x3cb6a4,null))['then'](respondWithResult(_0x3cb6a4,null))['catch'](handleError(_0x3cb6a4,null));};exports[_0x8625('0x49')]=function(_0x28b9b6,_0x559cfe){return db['ServicenowAccount'][_0x8625('0x49')](_0x28b9b6[_0x8625('0x4a')],{})[_0x8625('0x25')](respondWithResult(_0x559cfe,0xc9))[_0x8625('0x4b')](handleError(_0x559cfe,null));};exports['update']=function(_0x5823c1,_0xfac45b){if(_0x5823c1[_0x8625('0x4a')]['id']){delete _0x5823c1[_0x8625('0x4a')]['id'];}return db[_0x8625('0x2d')][_0x8625('0x48')]({'where':{'id':_0x5823c1['params']['id']}})['then'](handleEntityNotFound(_0xfac45b,null))[_0x8625('0x25')](saveUpdates(_0x5823c1[_0x8625('0x4a')],null))['then'](respondWithResult(_0xfac45b,null))[_0x8625('0x4b')](handleError(_0xfac45b,null));};exports[_0x8625('0x26')]=function(_0x2be426,_0x519ab5){return db[_0x8625('0x2d')][_0x8625('0x48')]({'where':{'id':_0x2be426[_0x8625('0x4c')]['id']}})[_0x8625('0x25')](handleEntityNotFound(_0x519ab5,null))[_0x8625('0x25')](removeEntity(_0x519ab5,null))[_0x8625('0x4b')](handleError(_0x519ab5,null));};exports[_0x8625('0x4d')]=function(_0x16e2a8,_0x5d1823,_0x15d207){var _0x293c2c={};var _0x5a29cb={};var _0x41470;var _0x597dce;return db[_0x8625('0x2d')][_0x8625('0x4e')]({'where':{'id':_0x16e2a8['params']['id']}})[_0x8625('0x25')](handleEntityNotFound(_0x5d1823,null))[_0x8625('0x25')](function(_0x3b5248){if(_0x3b5248){_0x41470=_0x3b5248;_0x5a29cb[_0x8625('0x31')]=_[_0x8625('0x33')](db[_0x8625('0x4f')][_0x8625('0x45')]);_0x5a29cb[_0x8625('0x32')]=_[_0x8625('0x33')](_0x16e2a8['query']);_0x5a29cb['filters']=_[_0x8625('0x35')](_0x5a29cb[_0x8625('0x31')],_0x5a29cb['query']);_0x293c2c['attributes']=_[_0x8625('0x35')](_0x5a29cb[_0x8625('0x31')],qs[_0x8625('0x46')](_0x16e2a8['query'][_0x8625('0x46')]));_0x293c2c[_0x8625('0x36')]=_0x293c2c[_0x8625('0x36')][_0x8625('0x47')]?_0x293c2c['attributes']:_0x5a29cb[_0x8625('0x31')];_0x293c2c['order']=qs[_0x8625('0x3a')](_0x16e2a8['query'][_0x8625('0x3a')]);_0x293c2c[_0x8625('0x3b')]=qs['filters'](_[_0x8625('0x3c')](_0x16e2a8[_0x8625('0x32')],_0x5a29cb[_0x8625('0x34')]));if(_0x16e2a8[_0x8625('0x32')][_0x8625('0x3d')]){_0x293c2c[_0x8625('0x3b')]=_[_0x8625('0x3e')](_0x293c2c[_0x8625('0x3b')],{'$or':_[_0x8625('0x2c')](_0x293c2c[_0x8625('0x36')],function(_0x544923){var _0x88f1b4={};_0x88f1b4[_0x544923]={'$like':'%'+_0x16e2a8['query'][_0x8625('0x3d')]+'%'};return _0x88f1b4;})});}_0x293c2c=_['merge']({},_0x293c2c,_0x16e2a8['options']);return _0x41470['getConfigurations'](_0x293c2c);}})[_0x8625('0x25')](function(_0x441266){if(_0x441266){_0x597dce=_0x441266[_0x8625('0x47')];if(!_0x16e2a8[_0x8625('0x32')][_0x8625('0x37')](_0x8625('0x38'))){_0x293c2c[_0x8625('0x1c')]=qs['limit'](_0x16e2a8['query'][_0x8625('0x1c')]);_0x293c2c[_0x8625('0x1e')]=qs[_0x8625('0x1e')](_0x16e2a8['query'][_0x8625('0x1e')]);}return _0x41470[_0x8625('0x4d')](_0x293c2c);}})[_0x8625('0x25')](function(_0x5908a7){if(_0x5908a7){return _0x5908a7?{'count':_0x597dce,'rows':_0x5908a7}:null;}})['then'](respondWithResult(_0x5d1823,null))[_0x8625('0x4b')](handleError(_0x5d1823,null));};exports[_0x8625('0x50')]=function(_0x13fd4e,_0x5df0bd,_0x443e97){if(_0x13fd4e['body']['id']){delete _0x13fd4e[_0x8625('0x4a')]['id'];}return db[_0x8625('0x2d')][_0x8625('0x4e')]({'where':{'id':_0x13fd4e[_0x8625('0x4c')]['id']}})[_0x8625('0x25')](handleEntityNotFound(_0x5df0bd,null))[_0x8625('0x25')](function(_0x34759a){if(_0x34759a){_0x13fd4e[_0x8625('0x4a')][_0x8625('0x51')]=_0x34759a['id'];_0x13fd4e[_0x8625('0x4a')]['Subjects']=integrations[_0x8625('0x52')](_0x13fd4e[_0x8625('0x4a')]['channel'],_0x13fd4e['body'][_0x8625('0x2f')]);_0x13fd4e['body'][_0x8625('0x53')]=integrations[_0x8625('0x54')](_0x13fd4e[_0x8625('0x4a')]['channel'],_0x13fd4e[_0x8625('0x4a')][_0x8625('0x2f')]);return db[_0x8625('0x4f')]['create'](_0x13fd4e[_0x8625('0x4a')],{'include':[{'model':db[_0x8625('0x55')],'as':_0x8625('0x56')},{'model':db[_0x8625('0x55')],'as':_0x8625('0x53')}]});}return null;})['then'](respondWithResult(_0x5df0bd,null))['catch'](handleError(_0x5df0bd,null));};exports[_0x8625('0x57')]=function(_0x5d84ab,_0x590e66,_0x588a83){var _0x53d920=[_0x8625('0x58'),'hold_reason',_0x8625('0x59'),_0x8625('0x5a'),_0x8625('0x5b'),_0x8625('0x5c'),_0x8625('0x5d'),_0x8625('0x5e'),'category'];var _0x36151=[_0x8625('0x5f'),_0x8625('0x58'),_0x8625('0x60'),_0x8625('0x61'),'upon_reject','sys_updated_on',_0x8625('0x62'),_0x8625('0x63'),'approval_history',_0x8625('0x64'),_0x8625('0x65'),_0x8625('0x66'),_0x8625('0x67'),_0x8625('0x68'),_0x8625('0x69'),_0x8625('0x6a'),_0x8625('0x6b'),'sys_created_by',_0x8625('0x59'),_0x8625('0x39'),'calendar_stc',_0x8625('0x6c'),_0x8625('0x6d'),_0x8625('0x6e'),_0x8625('0x6f'),_0x8625('0x70'),_0x8625('0x71'),_0x8625('0x72'),_0x8625('0x73'),_0x8625('0x74'),_0x8625('0x75'),'time_worked',_0x8625('0x76'),_0x8625('0x77'),_0x8625('0x78'),'group_list',_0x8625('0x79'),_0x8625('0x7a'),_0x8625('0x7b'),'caller_id',_0x8625('0x7c'),_0x8625('0x5a'),_0x8625('0x7d'),_0x8625('0x7e'),_0x8625('0x5b'),_0x8625('0x7f'),_0x8625('0x80'),'work_start','assignment_group',_0x8625('0x81'),'additional_assignee_list','description',_0x8625('0x82'),'notify','sys_class_name',_0x8625('0x83'),_0x8625('0x84'),_0x8625('0x85'),_0x8625('0x86'),_0x8625('0x87'),_0x8625('0x88'),_0x8625('0x89'),_0x8625('0x5d'),_0x8625('0x8a'),_0x8625('0x8b'),'company',_0x8625('0x8c'),_0x8625('0x8d'),_0x8625('0x8e'),_0x8625('0x5e'),'comments',_0x8625('0x8f'),_0x8625('0x90'),'comments_and_work_notes',_0x8625('0x91'),'sys_mod_count',_0x8625('0x92'),_0x8625('0x93'),_0x8625('0x94'),'upon_approval',_0x8625('0x95'),_0x8625('0x96'),_0x8625('0x97')];var _0x4767bb='';var _0x202243='';var _0xc0ed8c=[];var _0x116587='';var _0x20e5c6='';var _0x3f352c=[];var _0x56abf0='';var _0x371a67='';var _0x5df485={};var _0x54684e='';return db[_0x8625('0x2d')][_0x8625('0x4e')]({'where':{'id':_0x5d84ab['params']['id']},'attributes':['id','username',_0x8625('0x98'),_0x8625('0x99'),'remoteUri',_0x8625('0x9a')]})[_0x8625('0x25')](handleEntityNotFound(_0x590e66,null))[_0x8625('0x25')](function(_0x3ea800){if(_0x3ea800){_0x54684e=_0x3ea800['remoteUri'];var _0x424767=_0x54684e[_0x8625('0x9b')](-0x1);if(_0x424767==='/'){_0x54684e=_0x54684e[_0x8625('0x9c')](0x0,_0x54684e['lastIndexOf'](_0x424767));}_0x371a67=util[_0x8625('0x9d')](_0x8625('0x9e'),_0x54684e);_0x56abf0=util[_0x8625('0x9d')](_0x8625('0x9f'),_0x54684e);_0x5df485={'user':_0x3ea800[_0x8625('0xa0')],'pass':_0x3ea800[_0x8625('0x98')]};var _0x3d1356={'method':_0x8625('0xa1'),'uri':_0x371a67+_0x8625('0xa2'),'auth':_0x5df485,'json':!![]};return rp(_0x3d1356);}})['then'](function(_0x3e6450){if(_0x3e6450[_0x8625('0xa3')]['length']>0x0){_0x4767bb=_0x3e6450[_0x8625('0xa3')];}console[_0x8625('0xa4')](_0x8625('0xa5'),_0x4767bb);_0x3f352c=[];_0x202243=Object[_0x8625('0xa6')]([],_0x4767bb);_[_0x8625('0xa7')](_0x202243,function(_0x216a56){return!_0x53d920[_0x8625('0xa8')](_0x216a56[_0x8625('0x29')]);});_0x202243[_0x8625('0xa9')](function(_0x69cd4){var _0x418a97=createFieldObject(_0x56abf0,_0x5df485,_0x69cd4[_0x8625('0xaa')],_0x69cd4[_0x8625('0x29')],_0x69cd4[_0x8625('0xab')],![]);_0x3f352c[_0x8625('0xac')](_0x418a97);});return Promise[_0x8625('0xad')](_0x3f352c);})[_0x8625('0x25')](function(_0x534273){_0xc0ed8c=_0x534273;_0x116587=Object[_0x8625('0xa6')]([],_0x4767bb);console[_0x8625('0xa4')](_0x8625('0xae'),_0x4767bb);_[_0x8625('0xa7')](_0x116587,function(_0x1b0de0){return _0x36151[_0x8625('0xa8')](_0x1b0de0[_0x8625('0x29')]);});console['log'](_0x8625('0xaf'),_0x116587);_0x3f352c=[];_0x116587[_0x8625('0xa9')](function(_0x1181a9){var _0xab7ece=createFieldObject(_0x56abf0,_0x5df485,_0x1181a9[_0x8625('0xaa')],_0x1181a9['name'],_0x1181a9[_0x8625('0xab')],!![]);_0x3f352c[_0x8625('0xac')](_0xab7ece);});return Promise[_0x8625('0xad')](_0x3f352c);})[_0x8625('0x25')](function(_0x41aa55){_0x20e5c6=_0x41aa55;var _0x105a41=_0xc0ed8c[_0x8625('0xb0')](_0x20e5c6);return{'count':_0x105a41[_0x8625('0x47')],'rows':_0x105a41};})['then'](respondWithResult(_0x590e66,null))['catch'](function(_0x49bc89){console['log'](_0x8625('0xb1')+_0x49bc89);var _0x40a2df=_0x5d84ab[_0x8625('0x32')]['test']?0x1f4:_0x49bc89[_0x8625('0xb2')]||0x1f4;logger['error'](_0x49bc89[_0x8625('0x28')]);delete _0x49bc89[_0x8625('0x29')];if(_0x40a2df===0x191){_0x40a2df=0x190;}_0x590e66[_0x8625('0x1a')](_0x40a2df)[_0x8625('0x2a')](_0x5d84ab[_0x8625('0x32')][_0x8625('0xb3')]?{'message':_0x8625('0xb4'),'statusCode':_0x49bc89[_0x8625('0xb2')]}:_0x49bc89);});};function createFieldObject(_0x75ea2,_0x3b61ef,_0x1f2eca,_0x22c6e8,_0x41f5b9,_0x2af77b){return new Promise(function(_0x3ff02a,_0x107b79){var _0x4e2299={'id':_0x22c6e8,'name':_0x41f5b9,'custom':_0x2af77b};if(_0x1f2eca===_0x8625('0xb5')){_0x4e2299['options']=[{'name':_0x8625('0xb6'),'value':_0x8625('0xb7')},{'name':_0x8625('0xb8'),'value':_0x8625('0xb9')}];_0x3ff02a(_0x4e2299);}else{var _0x15e2e8={'method':_0x8625('0xa1'),'uri':_0x75ea2+_0x8625('0xba')+_0x22c6e8,'auth':_0x3b61ef,'json':!![]};return rp(_0x15e2e8)[_0x8625('0x25')](function(_0x5054e3){var _0x2ff6ef=[];if(_0x5054e3[_0x8625('0xa3')][_0x8625('0x47')]>0x0){_0x5054e3[_0x8625('0xa3')][_0x8625('0xa9')](function(_0x13ef00){if(_0x13ef00[_0x8625('0xbb')]==='false'){var _0x117c6a={'name':_0x13ef00[_0x8625('0xab')],'value':_0x13ef00['value']};_0x2ff6ef['push'](_0x117c6a);}});}_0x4e2299[_0x8625('0x40')]=_0x2ff6ef;if(_0x4e2299['options'][_0x8625('0x47')]>0x0){_0x3ff02a(_0x4e2299);}else{if(_0x2af77b==![]){_0x3ff02a();}else{_0x3ff02a(_0x4e2299);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d5bcc61..5330ac5 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x5ea7a8,_0x257068){var _0x1b2e3a=function(_0x5d3cfa){while(--_0x5d3cfa){_0x5ea7a8['push'](_0x5ea7a8['shift']());}};_0x1b2e3a(++_0x257068);}(_0x1cb9,0x14e));var _0x91cb=function(_0x9a9772,_0x335249){_0x9a9772=_0x9a9772-0x0;var _0xde2ef3=_0x1cb9[_0x9a9772];return _0xde2ef3;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));var integrations=require(_0x91cb('0x8'));module[_0x91cb('0x9')]=function(_0x28543e,_0x3b9d98){return _0x28543e[_0x91cb('0xa')]('ServicenowAccount',attributes,{'tableName':_0x91cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x17314d,_0x9082f8){var _0x2d6750=function(_0x4cef61){while(--_0x4cef61){_0x17314d['push'](_0x17314d['shift']());}};_0x2d6750(++_0x9082f8);}(_0xeff8,0x186));var _0x8eff=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xeff8[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8eff('0x9')]=function(_0xb54063,_0x3409bc){return _0xb54063[_0x8eff('0xa')]('ServicenowAccount',attributes,{'tableName':_0x8eff('0xb'),'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 83b52d7..9e9a1fb 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 _0x89d3=['../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','ServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x60c0fc,_0x1e356e){var _0x87be36=function(_0x592ab7){while(--_0x592ab7){_0x60c0fc['push'](_0x60c0fc['shift']());}};_0x87be36(++_0x1e356e);}(_0x89d3,0x16a));var _0x389d=function(_0x26222d,_0x1d2de1){_0x26222d=_0x26222d-0x0;var _0x16bf9f=_0x89d3[_0x26222d];return _0x16bf9f;};'use strict';var _=require(_0x389d('0x0'));var util=require(_0x389d('0x1'));var moment=require('moment');var BPromise=require(_0x389d('0x2'));var rs=require(_0x389d('0x3'));var fs=require('fs');var Redis=require(_0x389d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x389d('0x5'));var logger=require(_0x389d('0x6'))(_0x389d('0x7'));var config=require(_0x389d('0x8'));var jayson=require(_0x389d('0x9'));var client=jayson[_0x389d('0xa')][_0x389d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42a79d,_0x4bfe22,_0xebfc0){return new BPromise(function(_0x18f3cd,_0x49cbe9){return client[_0x389d('0xc')](_0x42a79d,_0xebfc0)[_0x389d('0xd')](function(_0x1ee3b0){logger['info'](_0x389d('0xe'),_0x4bfe22,_0x389d('0xf'));logger[_0x389d('0x10')](_0x389d('0x11'),_0x4bfe22,_0x389d('0xf'),JSON[_0x389d('0x12')](_0x1ee3b0));if(_0x1ee3b0['error']){if(_0x1ee3b0[_0x389d('0x13')][_0x389d('0x14')]===0x1f4){logger[_0x389d('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x4bfe22,_0x1ee3b0[_0x389d('0x13')][_0x389d('0x15')]);return _0x49cbe9(_0x1ee3b0[_0x389d('0x13')][_0x389d('0x15')]);}logger[_0x389d('0x13')](_0x389d('0xe'),_0x4bfe22,_0x1ee3b0['error'][_0x389d('0x15')]);return _0x18f3cd(_0x1ee3b0[_0x389d('0x13')]['message']);}else{logger[_0x389d('0x16')](_0x389d('0xe'),_0x4bfe22,_0x389d('0xf'));_0x18f3cd(_0x1ee3b0['result'][_0x389d('0x15')]);}})[_0x389d('0x17')](function(_0x3802af){logger[_0x389d('0x13')](_0x389d('0xe'),_0x4bfe22,_0x3802af);_0x49cbe9(_0x3802af);});});}exports['GetServicenowAccount']=function(_0x18d6e5){var _0x24505e=this;return new Promise(function(_0x5e0848,_0xac83a0){return db['ServicenowAccount'][_0x389d('0x18')]({'raw':_0x18d6e5[_0x389d('0x19')]?_0x18d6e5[_0x389d('0x19')][_0x389d('0x1a')]===undefined?!![]:![]:!![],'where':_0x18d6e5['options']?_0x18d6e5[_0x389d('0x19')][_0x389d('0x1b')]||null:null,'attributes':_0x18d6e5['options']?_0x18d6e5[_0x389d('0x19')][_0x389d('0x1c')]||null:null,'limit':_0x18d6e5[_0x389d('0x19')]?_0x18d6e5[_0x389d('0x19')][_0x389d('0x1d')]||null:null,'include':_0x18d6e5[_0x389d('0x19')]?_0x18d6e5[_0x389d('0x19')][_0x389d('0x1e')]?_[_0x389d('0x1f')](_0x18d6e5[_0x389d('0x19')][_0x389d('0x1e')],function(_0x5ce205){return{'model':db[_0x5ce205[_0x389d('0x20')]],'as':_0x5ce205['as'],'attributes':_0x5ce205['attributes'],'include':_0x5ce205['include']?_[_0x389d('0x1f')](_0x5ce205[_0x389d('0x1e')],function(_0x3b1c04){return{'model':db[_0x3b1c04[_0x389d('0x20')]],'as':_0x3b1c04['as'],'attributes':_0x3b1c04[_0x389d('0x1c')],'include':_0x3b1c04[_0x389d('0x1e')]?_[_0x389d('0x1f')](_0x3b1c04[_0x389d('0x1e')],function(_0x2e431b){return{'model':db[_0x2e431b[_0x389d('0x20')]],'as':_0x2e431b['as'],'attributes':_0x2e431b[_0x389d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x389d('0xd')](function(_0x51d039){logger[_0x389d('0x16')](_0x389d('0x21'),_0x18d6e5);logger[_0x389d('0x10')](_0x389d('0x21'),_0x18d6e5,JSON['stringify'](_0x51d039));_0x5e0848(_0x51d039);})[_0x389d('0x17')](function(_0x4cb524){logger[_0x389d('0x13')](_0x389d('0x21'),_0x4cb524[_0x389d('0x15')],_0x18d6e5);_0xac83a0(_0x24505e[_0x389d('0x13')](0x1f4,_0x4cb524['message']));});});};exports[_0x389d('0x22')]=function(_0xf42d54){var _0x573b63=this;return new Promise(function(_0x1a00a1,_0x19692e){return db[_0x389d('0x23')][_0x389d('0x24')]({'raw':_0xf42d54[_0x389d('0x19')]?_0xf42d54[_0x389d('0x19')][_0x389d('0x1a')]===undefined?!![]:![]:!![],'where':_0xf42d54[_0x389d('0x19')]?_0xf42d54['options'][_0x389d('0x1b')]||null:null,'attributes':_0xf42d54[_0x389d('0x19')]?_0xf42d54['options'][_0x389d('0x1c')]||null:null,'include':_0xf42d54[_0x389d('0x19')]?_0xf42d54[_0x389d('0x19')]['include']?_['map'](_0xf42d54['options'][_0x389d('0x1e')],function(_0x26da0f){return{'model':db[_0x26da0f[_0x389d('0x20')]],'as':_0x26da0f['as'],'attributes':_0x26da0f[_0x389d('0x1c')],'include':_0x26da0f[_0x389d('0x1e')]?_[_0x389d('0x1f')](_0x26da0f['include'],function(_0x3fcec7){return{'model':db[_0x3fcec7[_0x389d('0x20')]],'as':_0x3fcec7['as'],'attributes':_0x3fcec7[_0x389d('0x1c')],'include':_0x3fcec7['include']?_[_0x389d('0x1f')](_0x3fcec7[_0x389d('0x1e')],function(_0x82f59){return{'model':db[_0x82f59[_0x389d('0x20')]],'as':_0x82f59['as'],'attributes':_0x82f59[_0x389d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x389d('0xd')](function(_0x38a0cf){logger[_0x389d('0x16')](_0x389d('0x22'),_0xf42d54);logger[_0x389d('0x10')](_0x389d('0x22'),_0xf42d54,JSON['stringify'](_0x38a0cf));_0x1a00a1(_0x38a0cf);})[_0x389d('0x17')](function(_0x75a181){logger[_0x389d('0x13')]('ShowServicenowAccount',_0x75a181[_0x389d('0x15')],_0xf42d54);_0x19692e(_0x573b63['error'](0x1f4,_0x75a181[_0x389d('0x15')]));});});}; \ No newline at end of file +var _0x9a83=['request\x20sent','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','include','map','model','debug','catch','ShowServicenowAccount','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2be585,_0x29ccc8){var _0x16d31f=function(_0x545ea7){while(--_0x545ea7){_0x2be585['push'](_0x2be585['shift']());}};_0x16d31f(++_0x29ccc8);}(_0x9a83,0x1e9));var _0x39a8=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0x9a83[_0xa5d9f9];return _0x40e9f6;};'use strict';var _=require(_0x39a8('0x0'));var util=require('util');var moment=require(_0x39a8('0x1'));var BPromise=require(_0x39a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39a8('0x3'));var db=require(_0x39a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39a8('0x5'))(_0x39a8('0x6'));var config=require(_0x39a8('0x7'));var jayson=require(_0x39a8('0x8'));var client=jayson[_0x39a8('0x9')][_0x39a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2afce9,_0x35075c,_0x397be3){return new BPromise(function(_0x3b7232,_0x55666d){return client[_0x39a8('0xb')](_0x2afce9,_0x397be3)[_0x39a8('0xc')](function(_0x39f029){logger[_0x39a8('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x35075c,'request\x20sent');logger['debug'](_0x39a8('0xe'),_0x35075c,_0x39a8('0xf'),JSON[_0x39a8('0x10')](_0x39f029));if(_0x39f029[_0x39a8('0x11')]){if(_0x39f029[_0x39a8('0x11')][_0x39a8('0x12')]===0x1f4){logger[_0x39a8('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x35075c,_0x39f029['error']['message']);return _0x55666d(_0x39f029[_0x39a8('0x11')][_0x39a8('0x13')]);}logger[_0x39a8('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x35075c,_0x39f029[_0x39a8('0x11')][_0x39a8('0x13')]);return _0x3b7232(_0x39f029[_0x39a8('0x11')]['message']);}else{logger[_0x39a8('0xd')](_0x39a8('0x14'),_0x35075c,_0x39a8('0xf'));_0x3b7232(_0x39f029[_0x39a8('0x15')][_0x39a8('0x13')]);}})['catch'](function(_0x16dfc5){logger['error'](_0x39a8('0x14'),_0x35075c,_0x16dfc5);_0x55666d(_0x16dfc5);});});}exports[_0x39a8('0x16')]=function(_0x5ed7bf){var _0x46468a=this;return new Promise(function(_0x54977d,_0xbf0ec){return db[_0x39a8('0x17')][_0x39a8('0x18')]({'raw':_0x5ed7bf[_0x39a8('0x19')]?_0x5ed7bf['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ed7bf[_0x39a8('0x19')]?_0x5ed7bf[_0x39a8('0x19')][_0x39a8('0x1a')]||null:null,'attributes':_0x5ed7bf['options']?_0x5ed7bf[_0x39a8('0x19')][_0x39a8('0x1b')]||null:null,'limit':_0x5ed7bf[_0x39a8('0x19')]?_0x5ed7bf[_0x39a8('0x19')]['limit']||null:null,'include':_0x5ed7bf['options']?_0x5ed7bf['options'][_0x39a8('0x1c')]?_[_0x39a8('0x1d')](_0x5ed7bf[_0x39a8('0x19')][_0x39a8('0x1c')],function(_0x238022){return{'model':db[_0x238022[_0x39a8('0x1e')]],'as':_0x238022['as'],'attributes':_0x238022[_0x39a8('0x1b')],'include':_0x238022[_0x39a8('0x1c')]?_[_0x39a8('0x1d')](_0x238022['include'],function(_0x16ad8d){return{'model':db[_0x16ad8d[_0x39a8('0x1e')]],'as':_0x16ad8d['as'],'attributes':_0x16ad8d[_0x39a8('0x1b')],'include':_0x16ad8d[_0x39a8('0x1c')]?_[_0x39a8('0x1d')](_0x16ad8d['include'],function(_0x3ad3a2){return{'model':db[_0x3ad3a2[_0x39a8('0x1e')]],'as':_0x3ad3a2['as'],'attributes':_0x3ad3a2[_0x39a8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x39a8('0xc')](function(_0xfdb2c5){logger[_0x39a8('0xd')](_0x39a8('0x16'),_0x5ed7bf);logger[_0x39a8('0x1f')](_0x39a8('0x16'),_0x5ed7bf,JSON[_0x39a8('0x10')](_0xfdb2c5));_0x54977d(_0xfdb2c5);})[_0x39a8('0x20')](function(_0x298f4c){logger[_0x39a8('0x11')]('GetServicenowAccount',_0x298f4c['message'],_0x5ed7bf);_0xbf0ec(_0x46468a[_0x39a8('0x11')](0x1f4,_0x298f4c[_0x39a8('0x13')]));});});};exports[_0x39a8('0x21')]=function(_0x9da5be){var _0x26e5b2=this;return new Promise(function(_0x58e357,_0xfb968f){return db['ServicenowAccount'][_0x39a8('0x22')]({'raw':_0x9da5be['options']?_0x9da5be[_0x39a8('0x19')][_0x39a8('0x23')]===undefined?!![]:![]:!![],'where':_0x9da5be[_0x39a8('0x19')]?_0x9da5be[_0x39a8('0x19')][_0x39a8('0x1a')]||null:null,'attributes':_0x9da5be[_0x39a8('0x19')]?_0x9da5be[_0x39a8('0x19')][_0x39a8('0x1b')]||null:null,'include':_0x9da5be[_0x39a8('0x19')]?_0x9da5be[_0x39a8('0x19')][_0x39a8('0x1c')]?_['map'](_0x9da5be[_0x39a8('0x19')][_0x39a8('0x1c')],function(_0x153375){return{'model':db[_0x153375[_0x39a8('0x1e')]],'as':_0x153375['as'],'attributes':_0x153375[_0x39a8('0x1b')],'include':_0x153375[_0x39a8('0x1c')]?_['map'](_0x153375['include'],function(_0x100bc6){return{'model':db[_0x100bc6['model']],'as':_0x100bc6['as'],'attributes':_0x100bc6[_0x39a8('0x1b')],'include':_0x100bc6[_0x39a8('0x1c')]?_[_0x39a8('0x1d')](_0x100bc6['include'],function(_0x1b7605){return{'model':db[_0x1b7605[_0x39a8('0x1e')]],'as':_0x1b7605['as'],'attributes':_0x1b7605['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bdba4){logger[_0x39a8('0xd')](_0x39a8('0x21'),_0x9da5be);logger[_0x39a8('0x1f')]('ShowServicenowAccount',_0x9da5be,JSON[_0x39a8('0x10')](_0x2bdba4));_0x58e357(_0x2bdba4);})[_0x39a8('0x20')](function(_0x52e926){logger['error'](_0x39a8('0x21'),_0x52e926['message'],_0x9da5be);_0xfb968f(_0x26e5b2[_0x39a8('0x11')](0x1f4,_0x52e926[_0x39a8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d21fc1e..9657e91 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 _0x615d=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','getSubjects','/:id/descriptions','post','create'];(function(_0x427f19,_0xd24cb6){var _0x1ae3ec=function(_0x396469){while(--_0x396469){_0x427f19['push'](_0x427f19['shift']());}};_0x1ae3ec(++_0xd24cb6);}(_0x615d,0x14e));var _0xd615=function(_0x30b547,_0x5b89e9){_0x30b547=_0x30b547-0x0;var _0xab9618=_0x615d[_0x30b547];return _0xab9618;};'use strict';var multer=require(_0xd615('0x0'));var util=require(_0xd615('0x1'));var path=require(_0xd615('0x2'));var timeout=require(_0xd615('0x3'));var express=require('express');var router=express[_0xd615('0x4')]();var fs_extra=require(_0xd615('0x5'));var auth=require(_0xd615('0x6'));var interaction=require(_0xd615('0x7'));var config=require(_0xd615('0x8'));var controller=require(_0xd615('0x9'));router['get']('/',auth[_0xd615('0xa')](),controller[_0xd615('0xb')]);router[_0xd615('0xc')](_0xd615('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xd615('0xc')]('/:id/fields',auth[_0xd615('0xa')](),controller['getFields']);router[_0xd615('0xc')]('/:id/subjects',auth[_0xd615('0xa')](),controller[_0xd615('0xe')]);router[_0xd615('0xc')](_0xd615('0xf'),auth[_0xd615('0xa')](),controller['getDescriptions']);router[_0xd615('0x10')]('/',auth['isAuthenticated'](),controller[_0xd615('0x11')]);router[_0xd615('0x12')](_0xd615('0xd'),auth['isAuthenticated'](),controller[_0xd615('0x13')]);router['delete'](_0xd615('0xd'),auth[_0xd615('0xa')](),controller[_0xd615('0x14')]);module[_0xd615('0x15')]=router; \ No newline at end of file +var _0xf744=['getSubjects','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x442540,_0x16c4f4){var _0x1ba860=function(_0xadc5d5){while(--_0xadc5d5){_0x442540['push'](_0x442540['shift']());}};_0x1ba860(++_0x16c4f4);}(_0xf744,0x177));var _0x4f74=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xf744[_0x368fb9];return _0x4892fb;};'use strict';var multer=require(_0x4f74('0x0'));var util=require('util');var path=require(_0x4f74('0x1'));var timeout=require(_0x4f74('0x2'));var express=require(_0x4f74('0x3'));var router=express[_0x4f74('0x4')]();var fs_extra=require(_0x4f74('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4f74('0x6'));var config=require('../../config/environment');var controller=require(_0x4f74('0x7'));router[_0x4f74('0x8')]('/',auth[_0x4f74('0x9')](),controller[_0x4f74('0xa')]);router[_0x4f74('0x8')](_0x4f74('0xb'),auth[_0x4f74('0x9')](),controller[_0x4f74('0xc')]);router[_0x4f74('0x8')](_0x4f74('0xd'),auth['isAuthenticated'](),controller[_0x4f74('0xe')]);router[_0x4f74('0x8')](_0x4f74('0xf'),auth['isAuthenticated'](),controller[_0x4f74('0x10')]);router['get']('/:id/descriptions',auth[_0x4f74('0x9')](),controller[_0x4f74('0x11')]);router['post']('/',auth[_0x4f74('0x9')](),controller['create']);router[_0x4f74('0x12')](_0x4f74('0xb'),auth[_0x4f74('0x9')](),controller[_0x4f74('0x13')]);router[_0x4f74('0x14')](_0x4f74('0xb'),auth[_0x4f74('0x9')](),controller[_0x4f74('0x15')]);module[_0x4f74('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d0218ee..87071e3 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 _0x453c=['STRING','sequelize','exports'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x453c,0xe8));var _0xc453=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x453c[_0x31b5a5];return _0x364cc9;};'use strict';var Sequelize=require(_0xc453('0x0'));module[_0xc453('0x1')]={'name':{'type':Sequelize[_0xc453('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb000=['sequelize','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb000,0x15c));var _0x0b00=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0xb000[_0x386525];return _0x14d015;};'use strict';var Sequelize=require(_0x0b00('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b00('0x1')]},'description':{'type':Sequelize[_0x0b00('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index c2e8c65..7ef221c 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 _0xc6e4=['fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','create','body','find','params','destroy','getFields','ServicenowField','order','getSubjects','nolimit','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x45f7c3,_0x7a179a){var _0x1207da=function(_0x421472){while(--_0x421472){_0x45f7c3['push'](_0x45f7c3['shift']());}};_0x1207da(++_0x7a179a);}(_0xc6e4,0x104));var _0x4c6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6e4[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4c6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c6e('0x1'));var jsonpatch=require(_0x4c6e('0x2'));var rp=require('request-promise');var moment=require(_0x4c6e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c6e('0x4'));var util=require(_0x4c6e('0x5'));var path=require(_0x4c6e('0x6'));var sox=require(_0x4c6e('0x7'));var csv=require('to-csv');var ejs=require(_0x4c6e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4c6e('0x9'));var crypto=require(_0x4c6e('0xa'));var jsforce=require(_0x4c6e('0xb'));var deskjs=require(_0x4c6e('0xc'));var toCsv=require(_0x4c6e('0xd'));var querystring=require('querystring');var Papa=require(_0x4c6e('0xe'));var Redis=require(_0x4c6e('0xf'));var authService=require(_0x4c6e('0x10'));var qs=require(_0x4c6e('0x11'));var as=require(_0x4c6e('0x12'));var hardwareService=require(_0x4c6e('0x13'));var logger=require(_0x4c6e('0x14'))('api');var utils=require(_0x4c6e('0x15'));var config=require(_0x4c6e('0x16'));var licenseUtil=require(_0x4c6e('0x17'));var db=require(_0x4c6e('0x18'))['db'];function respondWithStatusCode(_0x485391,_0x57d577){_0x57d577=_0x57d577||0xcc;return function(_0x4da264){if(_0x4da264){return _0x485391[_0x4c6e('0x19')](_0x57d577);}return _0x485391[_0x4c6e('0x1a')](_0x57d577)[_0x4c6e('0x1b')]();};}function respondWithResult(_0x1d4612,_0x918661){_0x918661=_0x918661||0xc8;return function(_0x2690de){if(_0x2690de){return _0x1d4612[_0x4c6e('0x1a')](_0x918661)[_0x4c6e('0x1c')](_0x2690de);}};}function respondWithFilteredResult(_0x4d6ad6,_0x18cdf1){return function(_0x5e8bea){if(_0x5e8bea){var _0x48e142=typeof _0x18cdf1[_0x4c6e('0x1d')]===_0x4c6e('0x1e')&&typeof _0x18cdf1[_0x4c6e('0x1f')]==='undefined';var _0x42fe30=_0x5e8bea[_0x4c6e('0x20')];var _0x1c38ef=_0x48e142?0x0:_0x18cdf1[_0x4c6e('0x1d')];var _0x592e45=_0x48e142?_0x5e8bea[_0x4c6e('0x20')]:_0x18cdf1[_0x4c6e('0x1d')]+_0x18cdf1[_0x4c6e('0x1f')];var _0x252a07;if(_0x592e45>=_0x42fe30){_0x592e45=_0x42fe30;_0x252a07=0xc8;}else{_0x252a07=0xce;}_0x4d6ad6['status'](_0x252a07);return _0x4d6ad6[_0x4c6e('0x21')](_0x4c6e('0x22'),_0x1c38ef+'-'+_0x592e45+'/'+_0x42fe30)[_0x4c6e('0x1c')](_0x5e8bea);}return null;};}function patchUpdates(_0x3119ad){return function(_0x247ef2){try{jsonpatch[_0x4c6e('0x23')](_0x247ef2,_0x3119ad,!![]);}catch(_0x3e6bcd){return BPromise[_0x4c6e('0x24')](_0x3e6bcd);}return _0x247ef2['save']();};}function saveUpdates(_0x17c8d0,_0x133d6c){return function(_0x2f90cb){if(_0x2f90cb){return _0x2f90cb['update'](_0x17c8d0)[_0x4c6e('0x25')](function(_0x5c6be8){return _0x5c6be8;});}return null;};}function removeEntity(_0x174ea8,_0x1a37ad){return function(_0x192d2c){if(_0x192d2c){return _0x192d2c['destroy']()[_0x4c6e('0x25')](function(){_0x174ea8[_0x4c6e('0x1a')](0xcc)[_0x4c6e('0x1b')]();});}};}function handleEntityNotFound(_0x46c5ea,_0x1dd372){return function(_0x4cd021){if(!_0x4cd021){_0x46c5ea[_0x4c6e('0x19')](0x194);}return _0x4cd021;};}function handleError(_0x123461,_0x56c364){_0x56c364=_0x56c364||0x1f4;return function(_0x4aa98d){logger[_0x4c6e('0x26')](_0x4aa98d['stack']);if(_0x4aa98d['name']){delete _0x4aa98d[_0x4c6e('0x27')];}_0x123461[_0x4c6e('0x1a')](_0x56c364)[_0x4c6e('0x28')](_0x4aa98d);};}exports[_0x4c6e('0x29')]=function(_0x4a3b06,_0x4c5bb5){var _0x3e688f={},_0x162090={},_0x48b246={'count':0x0,'rows':[]};var _0x254dd4=_[_0x4c6e('0x2a')](db[_0x4c6e('0x2b')][_0x4c6e('0x2c')],function(_0x4861d4){return{'name':_0x4861d4['fieldName'],'type':_0x4861d4[_0x4c6e('0x2d')][_0x4c6e('0x2e')]};});_0x162090['model']=_[_0x4c6e('0x2a')](_0x254dd4,_0x4c6e('0x27'));_0x162090[_0x4c6e('0x2f')]=_[_0x4c6e('0x30')](_0x4a3b06[_0x4c6e('0x2f')]);_0x162090[_0x4c6e('0x31')]=_[_0x4c6e('0x32')](_0x162090['model'],_0x162090[_0x4c6e('0x2f')]);_0x3e688f['attributes']=_[_0x4c6e('0x32')](_0x162090[_0x4c6e('0x33')],qs['fields'](_0x4a3b06[_0x4c6e('0x2f')][_0x4c6e('0x34')]));_0x3e688f[_0x4c6e('0x35')]=_0x3e688f['attributes'][_0x4c6e('0x36')]?_0x3e688f[_0x4c6e('0x35')]:_0x162090[_0x4c6e('0x33')];if(!_0x4a3b06['query'][_0x4c6e('0x37')]('nolimit')){_0x3e688f[_0x4c6e('0x1f')]=qs[_0x4c6e('0x1f')](_0x4a3b06[_0x4c6e('0x2f')]['limit']);_0x3e688f[_0x4c6e('0x1d')]=qs['offset'](_0x4a3b06[_0x4c6e('0x2f')][_0x4c6e('0x1d')]);}_0x3e688f['order']=qs[_0x4c6e('0x38')](_0x4a3b06[_0x4c6e('0x2f')][_0x4c6e('0x38')]);_0x3e688f[_0x4c6e('0x39')]=qs['filters'](_[_0x4c6e('0x3a')](_0x4a3b06[_0x4c6e('0x2f')],_0x162090[_0x4c6e('0x31')]),_0x254dd4);if(_0x4a3b06[_0x4c6e('0x2f')][_0x4c6e('0x3b')]){_0x3e688f[_0x4c6e('0x39')]=_[_0x4c6e('0x3c')](_0x3e688f[_0x4c6e('0x39')],{'$or':_[_0x4c6e('0x2a')](_0x254dd4,function(_0x301d63){if(_0x301d63[_0x4c6e('0x2d')]!=='VIRTUAL'){var _0x516cc5={};_0x516cc5[_0x301d63[_0x4c6e('0x27')]]={'$like':'%'+_0x4a3b06['query'][_0x4c6e('0x3b')]+'%'};return _0x516cc5;}})});}_0x3e688f=_['merge']({},_0x3e688f,_0x4a3b06[_0x4c6e('0x3d')]);var _0x300472={'where':_0x3e688f[_0x4c6e('0x39')]};return db['ServicenowConfiguration']['count'](_0x300472)['then'](function(_0xb28cbc){_0x48b246[_0x4c6e('0x20')]=_0xb28cbc;if(_0x4a3b06[_0x4c6e('0x2f')][_0x4c6e('0x3e')]){_0x3e688f[_0x4c6e('0x3f')]=[{'all':!![]}];}return db[_0x4c6e('0x2b')]['findAll'](_0x3e688f);})[_0x4c6e('0x25')](function(_0x37b93c){_0x48b246[_0x4c6e('0x40')]=_0x37b93c;return _0x48b246;})[_0x4c6e('0x25')](respondWithFilteredResult(_0x4c5bb5,_0x3e688f))[_0x4c6e('0x41')](handleError(_0x4c5bb5,null));};exports[_0x4c6e('0x42')]=function(_0x30f54b,_0x504261){var _0x9a7390={'raw':![],'where':{'id':_0x30f54b['params']['id']}},_0x10dba5={};_0x10dba5['model']=_[_0x4c6e('0x30')](db[_0x4c6e('0x2b')][_0x4c6e('0x2c')]);_0x10dba5[_0x4c6e('0x2f')]=_[_0x4c6e('0x30')](_0x30f54b[_0x4c6e('0x2f')]);_0x10dba5[_0x4c6e('0x31')]=_[_0x4c6e('0x32')](_0x10dba5['model'],_0x10dba5[_0x4c6e('0x2f')]);_0x9a7390[_0x4c6e('0x35')]=_[_0x4c6e('0x32')](_0x10dba5[_0x4c6e('0x33')],qs[_0x4c6e('0x34')](_0x30f54b[_0x4c6e('0x2f')]['fields']));_0x9a7390[_0x4c6e('0x35')]=_0x9a7390[_0x4c6e('0x35')]['length']?_0x9a7390[_0x4c6e('0x35')]:_0x10dba5['model'];if(_0x30f54b[_0x4c6e('0x2f')][_0x4c6e('0x3e')]){_0x9a7390[_0x4c6e('0x3f')]=[{'all':!![]}];}_0x9a7390=_[_0x4c6e('0x3c')]({},_0x9a7390,_0x30f54b[_0x4c6e('0x3d')]);return db[_0x4c6e('0x2b')]['find'](_0x9a7390)[_0x4c6e('0x25')](handleEntityNotFound(_0x504261,null))[_0x4c6e('0x25')](respondWithResult(_0x504261,null))[_0x4c6e('0x41')](handleError(_0x504261,null));};exports[_0x4c6e('0x43')]=function(_0x1239b2,_0x4f2717){return db[_0x4c6e('0x2b')][_0x4c6e('0x43')](_0x1239b2['body'],{})['then'](respondWithResult(_0x4f2717,0xc9))[_0x4c6e('0x41')](handleError(_0x4f2717,null));};exports['update']=function(_0x5f56f1,_0x4aa2b3){if(_0x5f56f1[_0x4c6e('0x44')]['id']){delete _0x5f56f1[_0x4c6e('0x44')]['id'];}return db[_0x4c6e('0x2b')][_0x4c6e('0x45')]({'where':{'id':_0x5f56f1[_0x4c6e('0x46')]['id']}})[_0x4c6e('0x25')](handleEntityNotFound(_0x4aa2b3,null))[_0x4c6e('0x25')](saveUpdates(_0x5f56f1[_0x4c6e('0x44')],null))[_0x4c6e('0x25')](respondWithResult(_0x4aa2b3,null))[_0x4c6e('0x41')](handleError(_0x4aa2b3,null));};exports[_0x4c6e('0x47')]=function(_0x37a4f1,_0x31eb70){return db['ServicenowConfiguration'][_0x4c6e('0x45')]({'where':{'id':_0x37a4f1[_0x4c6e('0x46')]['id']}})['then'](handleEntityNotFound(_0x31eb70,null))[_0x4c6e('0x25')](removeEntity(_0x31eb70,null))['catch'](handleError(_0x31eb70,null));};exports[_0x4c6e('0x48')]=function(_0x29bf7d,_0x472fad,_0x2f9847){var _0x375b68={};var _0x22bacc={};var _0x59bacb;var _0x3f9114;return db[_0x4c6e('0x2b')]['findOne']({'where':{'id':_0x29bf7d[_0x4c6e('0x46')]['id']}})[_0x4c6e('0x25')](handleEntityNotFound(_0x472fad,null))['then'](function(_0x2ac450){if(_0x2ac450){_0x59bacb=_0x2ac450;_0x22bacc[_0x4c6e('0x33')]=_[_0x4c6e('0x30')](db[_0x4c6e('0x49')]['rawAttributes']);_0x22bacc[_0x4c6e('0x2f')]=_[_0x4c6e('0x30')](_0x29bf7d[_0x4c6e('0x2f')]);_0x22bacc[_0x4c6e('0x31')]=_['intersection'](_0x22bacc[_0x4c6e('0x33')],_0x22bacc[_0x4c6e('0x2f')]);_0x375b68[_0x4c6e('0x35')]=_['intersection'](_0x22bacc['model'],qs[_0x4c6e('0x34')](_0x29bf7d[_0x4c6e('0x2f')][_0x4c6e('0x34')]));_0x375b68[_0x4c6e('0x35')]=_0x375b68[_0x4c6e('0x35')][_0x4c6e('0x36')]?_0x375b68[_0x4c6e('0x35')]:_0x22bacc['model'];_0x375b68[_0x4c6e('0x4a')]=qs[_0x4c6e('0x38')](_0x29bf7d['query'][_0x4c6e('0x38')]);_0x375b68[_0x4c6e('0x39')]=qs['filters'](_['pick'](_0x29bf7d['query'],_0x22bacc['filters']));if(_0x29bf7d[_0x4c6e('0x2f')][_0x4c6e('0x3b')]){_0x375b68[_0x4c6e('0x39')]=_[_0x4c6e('0x3c')](_0x375b68['where'],{'$or':_[_0x4c6e('0x2a')](_0x375b68[_0x4c6e('0x35')],function(_0x3bb209){var _0x406d85={};_0x406d85[_0x3bb209]={'$like':'%'+_0x29bf7d[_0x4c6e('0x2f')][_0x4c6e('0x3b')]+'%'};return _0x406d85;})});}_0x375b68=_[_0x4c6e('0x3c')]({},_0x375b68,_0x29bf7d[_0x4c6e('0x3d')]);return _0x59bacb[_0x4c6e('0x48')](_0x375b68);}})[_0x4c6e('0x25')](function(_0x2aa3e7){if(_0x2aa3e7){_0x3f9114=_0x2aa3e7[_0x4c6e('0x36')];if(!_0x29bf7d[_0x4c6e('0x2f')][_0x4c6e('0x37')]('nolimit')){_0x375b68[_0x4c6e('0x1f')]=qs[_0x4c6e('0x1f')](_0x29bf7d['query'][_0x4c6e('0x1f')]);_0x375b68[_0x4c6e('0x1d')]=qs[_0x4c6e('0x1d')](_0x29bf7d[_0x4c6e('0x2f')][_0x4c6e('0x1d')]);}return _0x59bacb['getFields'](_0x375b68);}})[_0x4c6e('0x25')](function(_0x40502b){if(_0x40502b){return _0x40502b?{'count':_0x3f9114,'rows':_0x40502b}:null;}})['then'](respondWithResult(_0x472fad,null))[_0x4c6e('0x41')](handleError(_0x472fad,null));};exports[_0x4c6e('0x4b')]=function(_0x4a9c5,_0x3cf464,_0x228b82){var _0x4cabc3={};var _0x1eaa98={};var _0xe98bd4;var _0x40eda1;return db[_0x4c6e('0x2b')]['findOne']({'where':{'id':_0x4a9c5[_0x4c6e('0x46')]['id']}})[_0x4c6e('0x25')](handleEntityNotFound(_0x3cf464,null))[_0x4c6e('0x25')](function(_0x3c09c6){if(_0x3c09c6){_0xe98bd4=_0x3c09c6;_0x1eaa98[_0x4c6e('0x33')]=_['keys'](db[_0x4c6e('0x49')][_0x4c6e('0x2c')]);_0x1eaa98[_0x4c6e('0x2f')]=_[_0x4c6e('0x30')](_0x4a9c5[_0x4c6e('0x2f')]);_0x1eaa98[_0x4c6e('0x31')]=_[_0x4c6e('0x32')](_0x1eaa98[_0x4c6e('0x33')],_0x1eaa98[_0x4c6e('0x2f')]);_0x4cabc3[_0x4c6e('0x35')]=_[_0x4c6e('0x32')](_0x1eaa98[_0x4c6e('0x33')],qs['fields'](_0x4a9c5['query'][_0x4c6e('0x34')]));_0x4cabc3[_0x4c6e('0x35')]=_0x4cabc3[_0x4c6e('0x35')][_0x4c6e('0x36')]?_0x4cabc3[_0x4c6e('0x35')]:_0x1eaa98[_0x4c6e('0x33')];_0x4cabc3['order']=qs[_0x4c6e('0x38')](_0x4a9c5[_0x4c6e('0x2f')][_0x4c6e('0x38')]);_0x4cabc3['where']=qs['filters'](_['pick'](_0x4a9c5[_0x4c6e('0x2f')],_0x1eaa98[_0x4c6e('0x31')]));if(_0x4a9c5[_0x4c6e('0x2f')][_0x4c6e('0x3b')]){_0x4cabc3[_0x4c6e('0x39')]=_['merge'](_0x4cabc3[_0x4c6e('0x39')],{'$or':_[_0x4c6e('0x2a')](_0x4cabc3[_0x4c6e('0x35')],function(_0x11559a){var _0x195dd4={};_0x195dd4[_0x11559a]={'$like':'%'+_0x4a9c5[_0x4c6e('0x2f')][_0x4c6e('0x3b')]+'%'};return _0x195dd4;})});}_0x4cabc3=_['merge']({},_0x4cabc3,_0x4a9c5[_0x4c6e('0x3d')]);return _0xe98bd4[_0x4c6e('0x4b')](_0x4cabc3);}})[_0x4c6e('0x25')](function(_0x4cf447){if(_0x4cf447){_0x40eda1=_0x4cf447['length'];if(!_0x4a9c5['query'][_0x4c6e('0x37')](_0x4c6e('0x4c'))){_0x4cabc3[_0x4c6e('0x1f')]=qs['limit'](_0x4a9c5['query'][_0x4c6e('0x1f')]);_0x4cabc3[_0x4c6e('0x1d')]=qs['offset'](_0x4a9c5[_0x4c6e('0x2f')][_0x4c6e('0x1d')]);}return _0xe98bd4['getSubjects'](_0x4cabc3);}})[_0x4c6e('0x25')](function(_0x3ba873){if(_0x3ba873){return _0x3ba873?{'count':_0x40eda1,'rows':_0x3ba873}:null;}})[_0x4c6e('0x25')](respondWithResult(_0x3cf464,null))[_0x4c6e('0x41')](handleError(_0x3cf464,null));};exports['getDescriptions']=function(_0x4d16e5,_0x2cd0e3,_0x458911){var _0xa51d84={};var _0x3dac41={};var _0x1176b8;var _0x265069;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x4d16e5[_0x4c6e('0x46')]['id']}})[_0x4c6e('0x25')](handleEntityNotFound(_0x2cd0e3,null))['then'](function(_0x150af6){if(_0x150af6){_0x1176b8=_0x150af6;_0x3dac41[_0x4c6e('0x33')]=_[_0x4c6e('0x30')](db['ServicenowField']['rawAttributes']);_0x3dac41['query']=_['keys'](_0x4d16e5['query']);_0x3dac41[_0x4c6e('0x31')]=_['intersection'](_0x3dac41[_0x4c6e('0x33')],_0x3dac41[_0x4c6e('0x2f')]);_0xa51d84[_0x4c6e('0x35')]=_[_0x4c6e('0x32')](_0x3dac41[_0x4c6e('0x33')],qs[_0x4c6e('0x34')](_0x4d16e5['query'][_0x4c6e('0x34')]));_0xa51d84[_0x4c6e('0x35')]=_0xa51d84['attributes'][_0x4c6e('0x36')]?_0xa51d84[_0x4c6e('0x35')]:_0x3dac41[_0x4c6e('0x33')];_0xa51d84[_0x4c6e('0x4a')]=qs[_0x4c6e('0x38')](_0x4d16e5[_0x4c6e('0x2f')][_0x4c6e('0x38')]);_0xa51d84[_0x4c6e('0x39')]=qs[_0x4c6e('0x31')](_[_0x4c6e('0x3a')](_0x4d16e5['query'],_0x3dac41[_0x4c6e('0x31')]));if(_0x4d16e5[_0x4c6e('0x2f')]['filter']){_0xa51d84[_0x4c6e('0x39')]=_[_0x4c6e('0x3c')](_0xa51d84[_0x4c6e('0x39')],{'$or':_['map'](_0xa51d84[_0x4c6e('0x35')],function(_0x1a0bc1){var _0xd22b43={};_0xd22b43[_0x1a0bc1]={'$like':'%'+_0x4d16e5[_0x4c6e('0x2f')]['filter']+'%'};return _0xd22b43;})});}_0xa51d84=_[_0x4c6e('0x3c')]({},_0xa51d84,_0x4d16e5['options']);return _0x1176b8[_0x4c6e('0x4d')](_0xa51d84);}})['then'](function(_0x216b90){if(_0x216b90){_0x265069=_0x216b90[_0x4c6e('0x36')];if(!_0x4d16e5[_0x4c6e('0x2f')][_0x4c6e('0x37')](_0x4c6e('0x4c'))){_0xa51d84['limit']=qs[_0x4c6e('0x1f')](_0x4d16e5[_0x4c6e('0x2f')]['limit']);_0xa51d84[_0x4c6e('0x1d')]=qs[_0x4c6e('0x1d')](_0x4d16e5['query'][_0x4c6e('0x1d')]);}return _0x1176b8[_0x4c6e('0x4d')](_0xa51d84);}})[_0x4c6e('0x25')](function(_0xb91590){if(_0xb91590){return _0xb91590?{'count':_0x265069,'rows':_0xb91590}:null;}})[_0x4c6e('0x25')](respondWithResult(_0x2cd0e3,null))['catch'](handleError(_0x2cd0e3,null));}; \ No newline at end of file +var _0x49eb=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','options','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x1decf6,_0x3170d3){var _0x2f3953=function(_0x503f6e){while(--_0x503f6e){_0x1decf6['push'](_0x1decf6['shift']());}};_0x2f3953(++_0x3170d3);}(_0x49eb,0x68));var _0xb49e=function(_0x56d15a,_0x1a8170){_0x56d15a=_0x56d15a-0x0;var _0x4af8b8=_0x49eb[_0x56d15a];return _0x4af8b8;};'use strict';var emlformat=require(_0xb49e('0x0'));var rimraf=require(_0xb49e('0x1'));var zipdir=require(_0xb49e('0x2'));var jsonpatch=require(_0xb49e('0x3'));var rp=require(_0xb49e('0x4'));var moment=require(_0xb49e('0x5'));var BPromise=require(_0xb49e('0x6'));var Mustache=require(_0xb49e('0x7'));var util=require(_0xb49e('0x8'));var path=require(_0xb49e('0x9'));var sox=require('sox');var csv=require(_0xb49e('0xa'));var ejs=require(_0xb49e('0xb'));var fs=require('fs');var fs_extra=require(_0xb49e('0xc'));var _=require('lodash');var squel=require(_0xb49e('0xd'));var crypto=require('crypto');var jsforce=require(_0xb49e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb49e('0xa'));var querystring=require(_0xb49e('0xf'));var Papa=require(_0xb49e('0x10'));var Redis=require(_0xb49e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb49e('0x12'));var as=require(_0xb49e('0x13'));var hardwareService=require(_0xb49e('0x14'));var logger=require(_0xb49e('0x15'))(_0xb49e('0x16'));var utils=require(_0xb49e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb49e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fb9a5,_0x5a82b0){_0x5a82b0=_0x5a82b0||0xcc;return function(_0x11819f){if(_0x11819f){return _0x4fb9a5['sendStatus'](_0x5a82b0);}return _0x4fb9a5[_0xb49e('0x19')](_0x5a82b0)[_0xb49e('0x1a')]();};}function respondWithResult(_0x10e462,_0x518929){_0x518929=_0x518929||0xc8;return function(_0x25886e){if(_0x25886e){return _0x10e462[_0xb49e('0x19')](_0x518929)[_0xb49e('0x1b')](_0x25886e);}};}function respondWithFilteredResult(_0x33b8e4,_0x563410){return function(_0x4d36e2){if(_0x4d36e2){var _0x1fc797=typeof _0x563410['offset']===_0xb49e('0x1c')&&typeof _0x563410[_0xb49e('0x1d')]===_0xb49e('0x1c');var _0x315772=_0x4d36e2[_0xb49e('0x1e')];var _0x5e7b17=_0x1fc797?0x0:_0x563410[_0xb49e('0x1f')];var _0x72553c=_0x1fc797?_0x4d36e2[_0xb49e('0x1e')]:_0x563410[_0xb49e('0x1f')]+_0x563410[_0xb49e('0x1d')];var _0x8b9e09;if(_0x72553c>=_0x315772){_0x72553c=_0x315772;_0x8b9e09=0xc8;}else{_0x8b9e09=0xce;}_0x33b8e4[_0xb49e('0x19')](_0x8b9e09);return _0x33b8e4['set'](_0xb49e('0x20'),_0x5e7b17+'-'+_0x72553c+'/'+_0x315772)[_0xb49e('0x1b')](_0x4d36e2);}return null;};}function patchUpdates(_0x1e258a){return function(_0x121648){try{jsonpatch[_0xb49e('0x21')](_0x121648,_0x1e258a,!![]);}catch(_0x43da02){return BPromise[_0xb49e('0x22')](_0x43da02);}return _0x121648['save']();};}function saveUpdates(_0x4d77df,_0x352ca3){return function(_0x5aabb1){if(_0x5aabb1){return _0x5aabb1[_0xb49e('0x23')](_0x4d77df)[_0xb49e('0x24')](function(_0x5056d6){return _0x5056d6;});}return null;};}function removeEntity(_0x395ebe,_0x37e391){return function(_0x1ae38c){if(_0x1ae38c){return _0x1ae38c['destroy']()[_0xb49e('0x24')](function(){_0x395ebe[_0xb49e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x338cc0,_0x54622d){return function(_0x5ab16c){if(!_0x5ab16c){_0x338cc0[_0xb49e('0x25')](0x194);}return _0x5ab16c;};}function handleError(_0x225e65,_0xfe7c46){_0xfe7c46=_0xfe7c46||0x1f4;return function(_0x3527d2){logger[_0xb49e('0x26')](_0x3527d2[_0xb49e('0x27')]);if(_0x3527d2[_0xb49e('0x28')]){delete _0x3527d2['name'];}_0x225e65[_0xb49e('0x19')](_0xfe7c46)[_0xb49e('0x29')](_0x3527d2);};}exports[_0xb49e('0x2a')]=function(_0x4b8d80,_0x192b95){var _0x29d25b={},_0x405250={},_0x316ed0={'count':0x0,'rows':[]};var _0x1ad2be=_[_0xb49e('0x2b')](db[_0xb49e('0x2c')][_0xb49e('0x2d')],function(_0xd7028f){return{'name':_0xd7028f['fieldName'],'type':_0xd7028f[_0xb49e('0x2e')][_0xb49e('0x2f')]};});_0x405250[_0xb49e('0x30')]=_[_0xb49e('0x2b')](_0x1ad2be,'name');_0x405250[_0xb49e('0x31')]=_[_0xb49e('0x32')](_0x4b8d80[_0xb49e('0x31')]);_0x405250[_0xb49e('0x33')]=_[_0xb49e('0x34')](_0x405250[_0xb49e('0x30')],_0x405250[_0xb49e('0x31')]);_0x29d25b['attributes']=_[_0xb49e('0x34')](_0x405250[_0xb49e('0x30')],qs[_0xb49e('0x35')](_0x4b8d80[_0xb49e('0x31')][_0xb49e('0x35')]));_0x29d25b[_0xb49e('0x36')]=_0x29d25b[_0xb49e('0x36')][_0xb49e('0x37')]?_0x29d25b[_0xb49e('0x36')]:_0x405250[_0xb49e('0x30')];if(!_0x4b8d80['query'][_0xb49e('0x38')](_0xb49e('0x39'))){_0x29d25b[_0xb49e('0x1d')]=qs['limit'](_0x4b8d80['query']['limit']);_0x29d25b[_0xb49e('0x1f')]=qs[_0xb49e('0x1f')](_0x4b8d80['query'][_0xb49e('0x1f')]);}_0x29d25b[_0xb49e('0x3a')]=qs[_0xb49e('0x3b')](_0x4b8d80[_0xb49e('0x31')][_0xb49e('0x3b')]);_0x29d25b[_0xb49e('0x3c')]=qs[_0xb49e('0x33')](_[_0xb49e('0x3d')](_0x4b8d80[_0xb49e('0x31')],_0x405250[_0xb49e('0x33')]),_0x1ad2be);if(_0x4b8d80['query'][_0xb49e('0x3e')]){_0x29d25b[_0xb49e('0x3c')]=_[_0xb49e('0x3f')](_0x29d25b['where'],{'$or':_[_0xb49e('0x2b')](_0x1ad2be,function(_0x257fad){if(_0x257fad[_0xb49e('0x2e')]!==_0xb49e('0x40')){var _0x6d7b52={};_0x6d7b52[_0x257fad[_0xb49e('0x28')]]={'$like':'%'+_0x4b8d80[_0xb49e('0x31')][_0xb49e('0x3e')]+'%'};return _0x6d7b52;}})});}_0x29d25b=_['merge']({},_0x29d25b,_0x4b8d80['options']);var _0x5502ee={'where':_0x29d25b[_0xb49e('0x3c')]};return db[_0xb49e('0x2c')]['count'](_0x5502ee)['then'](function(_0x236aec){_0x316ed0[_0xb49e('0x1e')]=_0x236aec;if(_0x4b8d80['query']['includeAll']){_0x29d25b[_0xb49e('0x41')]=[{'all':!![]}];}return db[_0xb49e('0x2c')][_0xb49e('0x42')](_0x29d25b);})['then'](function(_0x3fd0db){_0x316ed0[_0xb49e('0x43')]=_0x3fd0db;return _0x316ed0;})['then'](respondWithFilteredResult(_0x192b95,_0x29d25b))[_0xb49e('0x44')](handleError(_0x192b95,null));};exports[_0xb49e('0x45')]=function(_0x2af550,_0x569c75){var _0x2448d8={'raw':![],'where':{'id':_0x2af550[_0xb49e('0x46')]['id']}},_0x267f97={};_0x267f97['model']=_[_0xb49e('0x32')](db['ServicenowConfiguration'][_0xb49e('0x2d')]);_0x267f97[_0xb49e('0x31')]=_[_0xb49e('0x32')](_0x2af550[_0xb49e('0x31')]);_0x267f97[_0xb49e('0x33')]=_[_0xb49e('0x34')](_0x267f97[_0xb49e('0x30')],_0x267f97['query']);_0x2448d8[_0xb49e('0x36')]=_[_0xb49e('0x34')](_0x267f97['model'],qs[_0xb49e('0x35')](_0x2af550[_0xb49e('0x31')][_0xb49e('0x35')]));_0x2448d8['attributes']=_0x2448d8[_0xb49e('0x36')][_0xb49e('0x37')]?_0x2448d8[_0xb49e('0x36')]:_0x267f97['model'];if(_0x2af550['query']['includeAll']){_0x2448d8[_0xb49e('0x41')]=[{'all':!![]}];}_0x2448d8=_[_0xb49e('0x3f')]({},_0x2448d8,_0x2af550['options']);return db['ServicenowConfiguration'][_0xb49e('0x47')](_0x2448d8)[_0xb49e('0x24')](handleEntityNotFound(_0x569c75,null))[_0xb49e('0x24')](respondWithResult(_0x569c75,null))[_0xb49e('0x44')](handleError(_0x569c75,null));};exports['create']=function(_0x4f213d,_0x4de5d0){return db[_0xb49e('0x2c')][_0xb49e('0x48')](_0x4f213d[_0xb49e('0x49')],{})['then'](respondWithResult(_0x4de5d0,0xc9))[_0xb49e('0x44')](handleError(_0x4de5d0,null));};exports[_0xb49e('0x23')]=function(_0x25d568,_0x25fd8a){if(_0x25d568[_0xb49e('0x49')]['id']){delete _0x25d568[_0xb49e('0x49')]['id'];}return db[_0xb49e('0x2c')][_0xb49e('0x47')]({'where':{'id':_0x25d568[_0xb49e('0x46')]['id']}})[_0xb49e('0x24')](handleEntityNotFound(_0x25fd8a,null))[_0xb49e('0x24')](saveUpdates(_0x25d568[_0xb49e('0x49')],null))[_0xb49e('0x24')](respondWithResult(_0x25fd8a,null))[_0xb49e('0x44')](handleError(_0x25fd8a,null));};exports['destroy']=function(_0x20481c,_0x2d7a82){return db['ServicenowConfiguration'][_0xb49e('0x47')]({'where':{'id':_0x20481c[_0xb49e('0x46')]['id']}})[_0xb49e('0x24')](handleEntityNotFound(_0x2d7a82,null))[_0xb49e('0x24')](removeEntity(_0x2d7a82,null))[_0xb49e('0x44')](handleError(_0x2d7a82,null));};exports[_0xb49e('0x4a')]=function(_0x3f3186,_0x10bd59,_0x1fd0db){var _0x414983={};var _0x3bc932={};var _0x3fe6bd;var _0x416214;return db[_0xb49e('0x2c')][_0xb49e('0x4b')]({'where':{'id':_0x3f3186['params']['id']}})[_0xb49e('0x24')](handleEntityNotFound(_0x10bd59,null))[_0xb49e('0x24')](function(_0x4ae60f){if(_0x4ae60f){_0x3fe6bd=_0x4ae60f;_0x3bc932[_0xb49e('0x30')]=_[_0xb49e('0x32')](db['ServicenowField'][_0xb49e('0x2d')]);_0x3bc932[_0xb49e('0x31')]=_['keys'](_0x3f3186['query']);_0x3bc932[_0xb49e('0x33')]=_[_0xb49e('0x34')](_0x3bc932[_0xb49e('0x30')],_0x3bc932[_0xb49e('0x31')]);_0x414983[_0xb49e('0x36')]=_[_0xb49e('0x34')](_0x3bc932['model'],qs['fields'](_0x3f3186[_0xb49e('0x31')][_0xb49e('0x35')]));_0x414983[_0xb49e('0x36')]=_0x414983['attributes'][_0xb49e('0x37')]?_0x414983['attributes']:_0x3bc932['model'];_0x414983[_0xb49e('0x3a')]=qs[_0xb49e('0x3b')](_0x3f3186[_0xb49e('0x31')][_0xb49e('0x3b')]);_0x414983[_0xb49e('0x3c')]=qs[_0xb49e('0x33')](_[_0xb49e('0x3d')](_0x3f3186[_0xb49e('0x31')],_0x3bc932[_0xb49e('0x33')]));if(_0x3f3186[_0xb49e('0x31')][_0xb49e('0x3e')]){_0x414983[_0xb49e('0x3c')]=_[_0xb49e('0x3f')](_0x414983[_0xb49e('0x3c')],{'$or':_[_0xb49e('0x2b')](_0x414983[_0xb49e('0x36')],function(_0x1a0218){var _0x4f1282={};_0x4f1282[_0x1a0218]={'$like':'%'+_0x3f3186[_0xb49e('0x31')][_0xb49e('0x3e')]+'%'};return _0x4f1282;})});}_0x414983=_[_0xb49e('0x3f')]({},_0x414983,_0x3f3186[_0xb49e('0x4c')]);return _0x3fe6bd['getFields'](_0x414983);}})['then'](function(_0x3b6d1d){if(_0x3b6d1d){_0x416214=_0x3b6d1d[_0xb49e('0x37')];if(!_0x3f3186['query'][_0xb49e('0x38')]('nolimit')){_0x414983[_0xb49e('0x1d')]=qs[_0xb49e('0x1d')](_0x3f3186[_0xb49e('0x31')][_0xb49e('0x1d')]);_0x414983[_0xb49e('0x1f')]=qs[_0xb49e('0x1f')](_0x3f3186[_0xb49e('0x31')][_0xb49e('0x1f')]);}return _0x3fe6bd[_0xb49e('0x4a')](_0x414983);}})[_0xb49e('0x24')](function(_0x5ab5c9){if(_0x5ab5c9){return _0x5ab5c9?{'count':_0x416214,'rows':_0x5ab5c9}:null;}})[_0xb49e('0x24')](respondWithResult(_0x10bd59,null))[_0xb49e('0x44')](handleError(_0x10bd59,null));};exports['getSubjects']=function(_0x4069d5,_0x57cc0b,_0x336a10){var _0x4653e4={};var _0x1e3ff5={};var _0x45845e;var _0x4669a5;return db[_0xb49e('0x2c')][_0xb49e('0x4b')]({'where':{'id':_0x4069d5[_0xb49e('0x46')]['id']}})['then'](handleEntityNotFound(_0x57cc0b,null))['then'](function(_0x22cede){if(_0x22cede){_0x45845e=_0x22cede;_0x1e3ff5[_0xb49e('0x30')]=_[_0xb49e('0x32')](db[_0xb49e('0x4d')][_0xb49e('0x2d')]);_0x1e3ff5[_0xb49e('0x31')]=_[_0xb49e('0x32')](_0x4069d5[_0xb49e('0x31')]);_0x1e3ff5['filters']=_[_0xb49e('0x34')](_0x1e3ff5[_0xb49e('0x30')],_0x1e3ff5[_0xb49e('0x31')]);_0x4653e4[_0xb49e('0x36')]=_[_0xb49e('0x34')](_0x1e3ff5['model'],qs['fields'](_0x4069d5[_0xb49e('0x31')][_0xb49e('0x35')]));_0x4653e4[_0xb49e('0x36')]=_0x4653e4[_0xb49e('0x36')]['length']?_0x4653e4[_0xb49e('0x36')]:_0x1e3ff5['model'];_0x4653e4['order']=qs['sort'](_0x4069d5[_0xb49e('0x31')]['sort']);_0x4653e4[_0xb49e('0x3c')]=qs[_0xb49e('0x33')](_[_0xb49e('0x3d')](_0x4069d5[_0xb49e('0x31')],_0x1e3ff5[_0xb49e('0x33')]));if(_0x4069d5[_0xb49e('0x31')][_0xb49e('0x3e')]){_0x4653e4[_0xb49e('0x3c')]=_[_0xb49e('0x3f')](_0x4653e4['where'],{'$or':_['map'](_0x4653e4['attributes'],function(_0x4bb54b){var _0x59ea96={};_0x59ea96[_0x4bb54b]={'$like':'%'+_0x4069d5[_0xb49e('0x31')][_0xb49e('0x3e')]+'%'};return _0x59ea96;})});}_0x4653e4=_[_0xb49e('0x3f')]({},_0x4653e4,_0x4069d5[_0xb49e('0x4c')]);return _0x45845e[_0xb49e('0x4e')](_0x4653e4);}})[_0xb49e('0x24')](function(_0x3d743e){if(_0x3d743e){_0x4669a5=_0x3d743e[_0xb49e('0x37')];if(!_0x4069d5[_0xb49e('0x31')]['hasOwnProperty'](_0xb49e('0x39'))){_0x4653e4[_0xb49e('0x1d')]=qs[_0xb49e('0x1d')](_0x4069d5[_0xb49e('0x31')][_0xb49e('0x1d')]);_0x4653e4[_0xb49e('0x1f')]=qs[_0xb49e('0x1f')](_0x4069d5[_0xb49e('0x31')][_0xb49e('0x1f')]);}return _0x45845e['getSubjects'](_0x4653e4);}})[_0xb49e('0x24')](function(_0x20825c){if(_0x20825c){return _0x20825c?{'count':_0x4669a5,'rows':_0x20825c}:null;}})[_0xb49e('0x24')](respondWithResult(_0x57cc0b,null))[_0xb49e('0x44')](handleError(_0x57cc0b,null));};exports[_0xb49e('0x4f')]=function(_0x523fda,_0x5375e7,_0x49b23b){var _0x202237={};var _0x4f805b={};var _0xcac6af;var _0x5566aa;return db[_0xb49e('0x2c')]['findOne']({'where':{'id':_0x523fda['params']['id']}})['then'](handleEntityNotFound(_0x5375e7,null))[_0xb49e('0x24')](function(_0x21d648){if(_0x21d648){_0xcac6af=_0x21d648;_0x4f805b[_0xb49e('0x30')]=_[_0xb49e('0x32')](db[_0xb49e('0x4d')][_0xb49e('0x2d')]);_0x4f805b['query']=_[_0xb49e('0x32')](_0x523fda[_0xb49e('0x31')]);_0x4f805b[_0xb49e('0x33')]=_[_0xb49e('0x34')](_0x4f805b['model'],_0x4f805b['query']);_0x202237[_0xb49e('0x36')]=_[_0xb49e('0x34')](_0x4f805b[_0xb49e('0x30')],qs[_0xb49e('0x35')](_0x523fda['query'][_0xb49e('0x35')]));_0x202237[_0xb49e('0x36')]=_0x202237[_0xb49e('0x36')][_0xb49e('0x37')]?_0x202237[_0xb49e('0x36')]:_0x4f805b[_0xb49e('0x30')];_0x202237['order']=qs[_0xb49e('0x3b')](_0x523fda[_0xb49e('0x31')]['sort']);_0x202237[_0xb49e('0x3c')]=qs[_0xb49e('0x33')](_[_0xb49e('0x3d')](_0x523fda[_0xb49e('0x31')],_0x4f805b['filters']));if(_0x523fda[_0xb49e('0x31')][_0xb49e('0x3e')]){_0x202237[_0xb49e('0x3c')]=_[_0xb49e('0x3f')](_0x202237[_0xb49e('0x3c')],{'$or':_[_0xb49e('0x2b')](_0x202237['attributes'],function(_0x5bd713){var _0x4b2a14={};_0x4b2a14[_0x5bd713]={'$like':'%'+_0x523fda[_0xb49e('0x31')]['filter']+'%'};return _0x4b2a14;})});}_0x202237=_[_0xb49e('0x3f')]({},_0x202237,_0x523fda[_0xb49e('0x4c')]);return _0xcac6af[_0xb49e('0x4f')](_0x202237);}})[_0xb49e('0x24')](function(_0x13d285){if(_0x13d285){_0x5566aa=_0x13d285[_0xb49e('0x37')];if(!_0x523fda[_0xb49e('0x31')][_0xb49e('0x38')]('nolimit')){_0x202237[_0xb49e('0x1d')]=qs['limit'](_0x523fda[_0xb49e('0x31')][_0xb49e('0x1d')]);_0x202237[_0xb49e('0x1f')]=qs[_0xb49e('0x1f')](_0x523fda['query'][_0xb49e('0x1f')]);}return _0xcac6af[_0xb49e('0x4f')](_0x202237);}})[_0xb49e('0x24')](function(_0x147c1c){if(_0x147c1c){return _0x147c1c?{'count':_0x5566aa,'rows':_0x147c1c}:null;}})[_0xb49e('0x24')](respondWithResult(_0x5375e7,null))[_0xb49e('0x44')](handleError(_0x5375e7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index d227b07..3bcc26b 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 _0xaa5e=['moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api'];(function(_0x53479e,_0x55d2c4){var _0x555e11=function(_0x44517e){while(--_0x44517e){_0x53479e['push'](_0x53479e['shift']());}};_0x555e11(++_0x55d2c4);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x2673c7,_0x581b5d){_0x2673c7=_0x2673c7-0x0;var _0x3d831f=_0xaa5e[_0x2673c7];return _0x3d831f;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var logger=require('../../config/logger')(_0xeaa5('0x2'));var moment=require(_0xeaa5('0x3'));var BPromise=require(_0xeaa5('0x4'));var rp=require(_0xeaa5('0x5'));var fs=require('fs');var path=require(_0xeaa5('0x6'));var rimraf=require('rimraf');var config=require(_0xeaa5('0x7'));var attributes=require(_0xeaa5('0x8'));module[_0xeaa5('0x9')]=function(_0x382868,_0x553f20){return _0x382868['define'](_0xeaa5('0xa'),attributes,{'tableName':_0xeaa5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18f3=['define','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x18f3,0x19f));var _0x318f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x18f3[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x318f('0x0'));var logger=require(_0x318f('0x1'))(_0x318f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x318f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x318f('0x4'));var config=require(_0x318f('0x5'));var attributes=require(_0x318f('0x6'));module[_0x318f('0x7')]=function(_0x52e7bc,_0x5f7340){return _0x52e7bc[_0x318f('0x8')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','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 afced50..8cfadb3 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 _0x25ed=['error','code','message','request\x20sent','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','stringify'];(function(_0x7b884f,_0x411ebe){var _0x3fafac=function(_0x38ba86){while(--_0x38ba86){_0x7b884f['push'](_0x7b884f['shift']());}};_0x3fafac(++_0x411ebe);}(_0x25ed,0x1e8));var _0xd25e=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x25ed[_0x421263];return _0x34e4b5;};'use strict';var _=require(_0xd25e('0x0'));var util=require(_0xd25e('0x1'));var moment=require('moment');var BPromise=require(_0xd25e('0x2'));var rs=require(_0xd25e('0x3'));var fs=require('fs');var Redis=require(_0xd25e('0x4'));var db=require(_0xd25e('0x5'))['db'];var utils=require(_0xd25e('0x6'));var logger=require(_0xd25e('0x7'))(_0xd25e('0x8'));var config=require(_0xd25e('0x9'));var jayson=require(_0xd25e('0xa'));var client=jayson[_0xd25e('0xb')][_0xd25e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x220902,_0x15214e,_0x414c0a){return new BPromise(function(_0x33d8b6,_0x4d9280){return client[_0xd25e('0xd')](_0x220902,_0x414c0a)[_0xd25e('0xe')](function(_0x2dd2ff){logger[_0xd25e('0xf')](_0xd25e('0x10'),_0x15214e,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x15214e,'request\x20sent',JSON[_0xd25e('0x11')](_0x2dd2ff));if(_0x2dd2ff[_0xd25e('0x12')]){if(_0x2dd2ff[_0xd25e('0x12')][_0xd25e('0x13')]===0x1f4){logger[_0xd25e('0x12')](_0xd25e('0x10'),_0x15214e,_0x2dd2ff[_0xd25e('0x12')][_0xd25e('0x14')]);return _0x4d9280(_0x2dd2ff['error']['message']);}logger[_0xd25e('0x12')](_0xd25e('0x10'),_0x15214e,_0x2dd2ff['error'][_0xd25e('0x14')]);return _0x33d8b6(_0x2dd2ff[_0xd25e('0x12')][_0xd25e('0x14')]);}else{logger[_0xd25e('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x15214e,_0xd25e('0x15'));_0x33d8b6(_0x2dd2ff['result'][_0xd25e('0x14')]);}})['catch'](function(_0x2b8bb2){logger['error'](_0xd25e('0x10'),_0x15214e,_0x2b8bb2);_0x4d9280(_0x2b8bb2);});});} \ No newline at end of file +var _0x6f44=['request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f44,0x1ea));var _0x46f4=function(_0x512bb9,_0x539f62){_0x512bb9=_0x512bb9-0x0;var _0x137cb1=_0x6f44[_0x512bb9];return _0x137cb1;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var moment=require('moment');var BPromise=require(_0x46f4('0x2'));var rs=require(_0x46f4('0x3'));var fs=require('fs');var Redis=require(_0x46f4('0x4'));var db=require(_0x46f4('0x5'))['db'];var utils=require(_0x46f4('0x6'));var logger=require(_0x46f4('0x7'))(_0x46f4('0x8'));var config=require(_0x46f4('0x9'));var jayson=require(_0x46f4('0xa'));var client=jayson['client'][_0x46f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a50b1,_0x37d6a2,_0x4b791c){return new BPromise(function(_0x5ce344,_0x357069){return client[_0x46f4('0xc')](_0x2a50b1,_0x4b791c)['then'](function(_0x1eabea){logger['info'](_0x46f4('0xd'),_0x37d6a2,'request\x20sent');logger[_0x46f4('0xe')](_0x46f4('0xf'),_0x37d6a2,_0x46f4('0x10'),JSON[_0x46f4('0x11')](_0x1eabea));if(_0x1eabea[_0x46f4('0x12')]){if(_0x1eabea[_0x46f4('0x12')][_0x46f4('0x13')]===0x1f4){logger[_0x46f4('0x12')](_0x46f4('0xd'),_0x37d6a2,_0x1eabea[_0x46f4('0x12')][_0x46f4('0x14')]);return _0x357069(_0x1eabea[_0x46f4('0x12')]['message']);}logger[_0x46f4('0x12')](_0x46f4('0xd'),_0x37d6a2,_0x1eabea['error'][_0x46f4('0x14')]);return _0x5ce344(_0x1eabea[_0x46f4('0x12')][_0x46f4('0x14')]);}else{logger['info'](_0x46f4('0xd'),_0x37d6a2,'request\x20sent');_0x5ce344(_0x1eabea['result'][_0x46f4('0x14')]);}})[_0x46f4('0x15')](function(_0x39f902){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x37d6a2,_0x39f902);_0x357069(_0x39f902);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 21fc47f..fcb9c2f 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 _0xcdc4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x96516,_0x2ff31f){var _0x5b3c50=function(_0x4351e2){while(--_0x4351e2){_0x96516['push'](_0x96516['shift']());}};_0x5b3c50(++_0x2ff31f);}(_0xcdc4,0x151));var _0x4cdc=function(_0x5229a1,_0x5349f8){_0x5229a1=_0x5229a1-0x0;var _0xc4cb55=_0xcdc4[_0x5229a1];return _0xc4cb55;};'use strict';var multer=require(_0x4cdc('0x0'));var util=require('util');var path=require(_0x4cdc('0x1'));var timeout=require(_0x4cdc('0x2'));var express=require(_0x4cdc('0x3'));var router=express[_0x4cdc('0x4')]();var fs_extra=require(_0x4cdc('0x5'));var auth=require(_0x4cdc('0x6'));var interaction=require(_0x4cdc('0x7'));var config=require(_0x4cdc('0x8'));var controller=require('./intServicenowField.controller');router[_0x4cdc('0x9')]('/',auth['isAuthenticated'](),controller[_0x4cdc('0xa')]);router[_0x4cdc('0x9')](_0x4cdc('0xb'),auth['isAuthenticated'](),controller[_0x4cdc('0xc')]);router[_0x4cdc('0xd')]('/',auth[_0x4cdc('0xe')](),controller['create']);router[_0x4cdc('0xf')](_0x4cdc('0xb'),auth[_0x4cdc('0xe')](),controller[_0x4cdc('0x10')]);router[_0x4cdc('0x11')](_0x4cdc('0xb'),auth[_0x4cdc('0xe')](),controller[_0x4cdc('0x12')]);module[_0x4cdc('0x13')]=router; \ No newline at end of file +var _0x6ee4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','post','create','put','update','delete','exports','multer','util','connect-timeout'];(function(_0xf73390,_0x14c109){var _0x4b212f=function(_0x3e2b63){while(--_0x3e2b63){_0xf73390['push'](_0xf73390['shift']());}};_0x4b212f(++_0x14c109);}(_0x6ee4,0x173));var _0x46ee=function(_0x3957dc,_0x204315){_0x3957dc=_0x3957dc-0x0;var _0x52d61e=_0x6ee4[_0x3957dc];return _0x52d61e;};'use strict';var multer=require(_0x46ee('0x0'));var util=require(_0x46ee('0x1'));var path=require('path');var timeout=require(_0x46ee('0x2'));var express=require('express');var router=express[_0x46ee('0x3')]();var fs_extra=require(_0x46ee('0x4'));var auth=require(_0x46ee('0x5'));var interaction=require(_0x46ee('0x6'));var config=require(_0x46ee('0x7'));var controller=require('./intServicenowField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x46ee('0x8')]);router['get'](_0x46ee('0x9'),auth[_0x46ee('0xa')](),controller['show']);router[_0x46ee('0xb')]('/',auth[_0x46ee('0xa')](),controller[_0x46ee('0xc')]);router[_0x46ee('0xd')](_0x46ee('0x9'),auth['isAuthenticated'](),controller[_0x46ee('0xe')]);router[_0x46ee('0xf')](_0x46ee('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x46ee('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index dcaba59..70746a9 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 _0xdb71=['keyValue','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x178e71,_0x5c6c7d){var _0x3eec6c=function(_0x406d3f){while(--_0x406d3f){_0x178e71['push'](_0x178e71['shift']());}};_0x3eec6c(++_0x5c6c7d);}(_0xdb71,0x1b5));var _0x1db7=function(_0x3b5184,_0x32e53a){_0x3b5184=_0x3b5184-0x0;var _0xb75974=_0xdb71[_0x3b5184];return _0xb75974;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1db7('0x0')](_0x1db7('0x1'),_0x1db7('0x2'),_0x1db7('0x3'),_0x1db7('0x4'),'picklist'),'defaultValue':_0x1db7('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x1db7('0x1'),'variable',_0x1db7('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1db7('0x5')]},'customField':{'type':Sequelize[_0x1db7('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc9a1=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0xf5345a,_0x29b58f){var _0x327e30=function(_0x28f2b7){while(--_0x28f2b7){_0xf5345a['push'](_0xf5345a['shift']());}};_0x327e30(++_0x29b58f);}(_0xc9a1,0xe1));var _0x1c9a=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xc9a1[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require(_0x1c9a('0x0'));module[_0x1c9a('0x1')]={'type':{'type':Sequelize[_0x1c9a('0x2')](_0x1c9a('0x3'),'variable',_0x1c9a('0x4'),_0x1c9a('0x5'),'picklist'),'defaultValue':_0x1c9a('0x3')},'content':{'type':Sequelize[_0x1c9a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1c9a('0x2')]('string','variable',_0x1c9a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1c9a('0x6')]},'nameField':{'type':Sequelize[_0x1c9a('0x6')]},'customField':{'type':Sequelize[_0x1c9a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c9a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 2c29556..fd1c852 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 _0x1d23=['name','index','map','ServicenowField','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','show','params','keys','include','find','create','body','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error'];(function(_0x234061,_0x2c8318){var _0x4a7ff4=function(_0x54f17e){while(--_0x54f17e){_0x234061['push'](_0x234061['shift']());}};_0x4a7ff4(++_0x2c8318);}(_0x1d23,0xe9));var _0x31d2=function(_0x5acb6d,_0x533fcd){_0x5acb6d=_0x5acb6d-0x0;var _0x4901f0=_0x1d23[_0x5acb6d];return _0x4901f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31d2('0x0'));var zipdir=require(_0x31d2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31d2('0x2'));var moment=require('moment');var BPromise=require(_0x31d2('0x3'));var Mustache=require(_0x31d2('0x4'));var util=require(_0x31d2('0x5'));var path=require(_0x31d2('0x6'));var sox=require('sox');var csv=require(_0x31d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31d2('0x8'));var _=require('lodash');var squel=require(_0x31d2('0x9'));var crypto=require('crypto');var jsforce=require(_0x31d2('0xa'));var deskjs=require(_0x31d2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x31d2('0xc'));var Redis=require(_0x31d2('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x31d2('0xe'));var hardwareService=require(_0x31d2('0xf'));var logger=require(_0x31d2('0x10'))(_0x31d2('0x11'));var utils=require(_0x31d2('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x31d2('0x13'))['db'];function respondWithStatusCode(_0x9b8982,_0x522038){_0x522038=_0x522038||0xcc;return function(_0x5c5584){if(_0x5c5584){return _0x9b8982[_0x31d2('0x14')](_0x522038);}return _0x9b8982['status'](_0x522038)[_0x31d2('0x15')]();};}function respondWithResult(_0x4c71e5,_0x698c1a){_0x698c1a=_0x698c1a||0xc8;return function(_0x265c4e){if(_0x265c4e){return _0x4c71e5[_0x31d2('0x16')](_0x698c1a)[_0x31d2('0x17')](_0x265c4e);}};}function respondWithFilteredResult(_0x152d45,_0x7165c4){return function(_0x2e780b){if(_0x2e780b){var _0x5181e2=typeof _0x7165c4[_0x31d2('0x18')]===_0x31d2('0x19')&&typeof _0x7165c4[_0x31d2('0x1a')]===_0x31d2('0x19');var _0x3388f9=_0x2e780b[_0x31d2('0x1b')];var _0x3eec90=_0x5181e2?0x0:_0x7165c4[_0x31d2('0x18')];var _0x1e77c4=_0x5181e2?_0x2e780b[_0x31d2('0x1b')]:_0x7165c4['offset']+_0x7165c4[_0x31d2('0x1a')];var _0xd349c1;if(_0x1e77c4>=_0x3388f9){_0x1e77c4=_0x3388f9;_0xd349c1=0xc8;}else{_0xd349c1=0xce;}_0x152d45[_0x31d2('0x16')](_0xd349c1);return _0x152d45[_0x31d2('0x1c')](_0x31d2('0x1d'),_0x3eec90+'-'+_0x1e77c4+'/'+_0x3388f9)[_0x31d2('0x17')](_0x2e780b);}return null;};}function patchUpdates(_0x596c6e){return function(_0x27e427){try{jsonpatch['apply'](_0x27e427,_0x596c6e,!![]);}catch(_0x2597a6){return BPromise[_0x31d2('0x1e')](_0x2597a6);}return _0x27e427['save']();};}function saveUpdates(_0xbfac94,_0x57b35f){return function(_0x1afd56){if(_0x1afd56){return _0x1afd56[_0x31d2('0x1f')](_0xbfac94)[_0x31d2('0x20')](function(_0xa00383){return _0xa00383;});}return null;};}function removeEntity(_0x11256b,_0x5e61ec){return function(_0x281d39){if(_0x281d39){return _0x281d39[_0x31d2('0x21')]()['then'](function(){_0x11256b[_0x31d2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b0e0,_0x1d8c5d){return function(_0x52a50c){if(!_0x52a50c){_0x54b0e0[_0x31d2('0x14')](0x194);}return _0x52a50c;};}function handleError(_0x4e6894,_0x53d1db){_0x53d1db=_0x53d1db||0x1f4;return function(_0x11026f){logger[_0x31d2('0x22')](_0x11026f['stack']);if(_0x11026f[_0x31d2('0x23')]){delete _0x11026f[_0x31d2('0x23')];}_0x4e6894[_0x31d2('0x16')](_0x53d1db)['send'](_0x11026f);};}exports[_0x31d2('0x24')]=function(_0x50ba5a,_0x2ba6ef){var _0x3a5a3b={},_0x3cb29a={},_0x1b1ff7={'count':0x0,'rows':[]};var _0x5a7270=_[_0x31d2('0x25')](db[_0x31d2('0x26')]['rawAttributes'],function(_0x14d53f){return{'name':_0x14d53f[_0x31d2('0x27')],'type':_0x14d53f[_0x31d2('0x28')][_0x31d2('0x29')]};});_0x3cb29a[_0x31d2('0x2a')]=_['map'](_0x5a7270,_0x31d2('0x23'));_0x3cb29a[_0x31d2('0x2b')]=_['keys'](_0x50ba5a['query']);_0x3cb29a[_0x31d2('0x2c')]=_['intersection'](_0x3cb29a[_0x31d2('0x2a')],_0x3cb29a[_0x31d2('0x2b')]);_0x3a5a3b['attributes']=_[_0x31d2('0x2d')](_0x3cb29a[_0x31d2('0x2a')],qs[_0x31d2('0x2e')](_0x50ba5a[_0x31d2('0x2b')]['fields']));_0x3a5a3b[_0x31d2('0x2f')]=_0x3a5a3b['attributes'][_0x31d2('0x30')]?_0x3a5a3b['attributes']:_0x3cb29a[_0x31d2('0x2a')];if(!_0x50ba5a[_0x31d2('0x2b')][_0x31d2('0x31')]('nolimit')){_0x3a5a3b['limit']=qs[_0x31d2('0x1a')](_0x50ba5a[_0x31d2('0x2b')][_0x31d2('0x1a')]);_0x3a5a3b['offset']=qs[_0x31d2('0x18')](_0x50ba5a[_0x31d2('0x2b')][_0x31d2('0x18')]);}_0x3a5a3b[_0x31d2('0x32')]=qs[_0x31d2('0x33')](_0x50ba5a[_0x31d2('0x2b')][_0x31d2('0x33')]);_0x3a5a3b[_0x31d2('0x34')]=qs['filters'](_[_0x31d2('0x35')](_0x50ba5a['query'],_0x3cb29a[_0x31d2('0x2c')]),_0x5a7270);if(_0x50ba5a[_0x31d2('0x2b')][_0x31d2('0x36')]){_0x3a5a3b[_0x31d2('0x34')]=_['merge'](_0x3a5a3b[_0x31d2('0x34')],{'$or':_[_0x31d2('0x25')](_0x5a7270,function(_0x395393){if(_0x395393['type']!==_0x31d2('0x37')){var _0x1fbab0={};_0x1fbab0[_0x395393[_0x31d2('0x23')]]={'$like':'%'+_0x50ba5a[_0x31d2('0x2b')][_0x31d2('0x36')]+'%'};return _0x1fbab0;}})});}_0x3a5a3b=_[_0x31d2('0x38')]({},_0x3a5a3b,_0x50ba5a['options']);var _0x324575={'where':_0x3a5a3b[_0x31d2('0x34')]};return db[_0x31d2('0x26')]['count'](_0x324575)['then'](function(_0x48b466){_0x1b1ff7['count']=_0x48b466;if(_0x50ba5a[_0x31d2('0x2b')][_0x31d2('0x39')]){_0x3a5a3b['include']=[{'all':!![]}];}return db[_0x31d2('0x26')]['findAll'](_0x3a5a3b);})['then'](function(_0x5ba912){_0x1b1ff7[_0x31d2('0x3a')]=_0x5ba912;return _0x1b1ff7;})[_0x31d2('0x20')](respondWithFilteredResult(_0x2ba6ef,_0x3a5a3b))[_0x31d2('0x3b')](handleError(_0x2ba6ef,null));};exports[_0x31d2('0x3c')]=function(_0xc85ead,_0x82059c){var _0x4701cf={'raw':!![],'where':{'id':_0xc85ead[_0x31d2('0x3d')]['id']}},_0x4ee1b3={};_0x4ee1b3[_0x31d2('0x2a')]=_[_0x31d2('0x3e')](db[_0x31d2('0x26')]['rawAttributes']);_0x4ee1b3['query']=_['keys'](_0xc85ead[_0x31d2('0x2b')]);_0x4ee1b3[_0x31d2('0x2c')]=_[_0x31d2('0x2d')](_0x4ee1b3['model'],_0x4ee1b3['query']);_0x4701cf[_0x31d2('0x2f')]=_['intersection'](_0x4ee1b3['model'],qs['fields'](_0xc85ead[_0x31d2('0x2b')][_0x31d2('0x2e')]));_0x4701cf[_0x31d2('0x2f')]=_0x4701cf[_0x31d2('0x2f')][_0x31d2('0x30')]?_0x4701cf[_0x31d2('0x2f')]:_0x4ee1b3['model'];if(_0xc85ead['query']['includeAll']){_0x4701cf[_0x31d2('0x3f')]=[{'all':!![]}];}_0x4701cf=_[_0x31d2('0x38')]({},_0x4701cf,_0xc85ead['options']);return db[_0x31d2('0x26')][_0x31d2('0x40')](_0x4701cf)['then'](handleEntityNotFound(_0x82059c,null))[_0x31d2('0x20')](respondWithResult(_0x82059c,null))[_0x31d2('0x3b')](handleError(_0x82059c,null));};exports[_0x31d2('0x41')]=function(_0x1a5445,_0xb25065){return db['ServicenowField'][_0x31d2('0x41')](_0x1a5445[_0x31d2('0x42')],{})['then'](respondWithResult(_0xb25065,0xc9))[_0x31d2('0x3b')](handleError(_0xb25065,null));};exports[_0x31d2('0x1f')]=function(_0x2bb122,_0x376148){if(_0x2bb122[_0x31d2('0x42')]['id']){delete _0x2bb122[_0x31d2('0x42')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x2bb122[_0x31d2('0x3d')]['id']}})[_0x31d2('0x20')](handleEntityNotFound(_0x376148,null))['then'](saveUpdates(_0x2bb122[_0x31d2('0x42')],null))['then'](respondWithResult(_0x376148,null))['catch'](handleError(_0x376148,null));};exports[_0x31d2('0x21')]=function(_0xf496d8,_0x30058c){return db[_0x31d2('0x26')]['find']({'where':{'id':_0xf496d8[_0x31d2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x30058c,null))[_0x31d2('0x20')](removeEntity(_0x30058c,null))[_0x31d2('0x3b')](handleError(_0x30058c,null));}; \ No newline at end of file +var _0xb4de=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','catch','show','params','include','options','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key'];(function(_0x493b3d,_0x1724d5){var _0xd80ba=function(_0x5ebe9c){while(--_0x5ebe9c){_0x493b3d['push'](_0x493b3d['shift']());}};_0xd80ba(++_0x1724d5);}(_0xb4de,0xae));var _0xeb4d=function(_0x24763b,_0x4ae64e){_0x24763b=_0x24763b-0x0;var _0x74efe4=_0xb4de[_0x24763b];return _0x74efe4;};'use strict';var emlformat=require(_0xeb4d('0x0'));var rimraf=require(_0xeb4d('0x1'));var zipdir=require(_0xeb4d('0x2'));var jsonpatch=require(_0xeb4d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb4d('0x4'));var Mustache=require(_0xeb4d('0x5'));var util=require(_0xeb4d('0x6'));var path=require(_0xeb4d('0x7'));var sox=require(_0xeb4d('0x8'));var csv=require(_0xeb4d('0x9'));var ejs=require(_0xeb4d('0xa'));var fs=require('fs');var fs_extra=require(_0xeb4d('0xb'));var _=require(_0xeb4d('0xc'));var squel=require(_0xeb4d('0xd'));var crypto=require('crypto');var jsforce=require(_0xeb4d('0xe'));var deskjs=require(_0xeb4d('0xf'));var toCsv=require(_0xeb4d('0x9'));var querystring=require(_0xeb4d('0x10'));var Papa=require(_0xeb4d('0x11'));var Redis=require('ioredis');var authService=require(_0xeb4d('0x12'));var qs=require(_0xeb4d('0x13'));var as=require(_0xeb4d('0x14'));var hardwareService=require(_0xeb4d('0x15'));var logger=require(_0xeb4d('0x16'))(_0xeb4d('0x17'));var utils=require(_0xeb4d('0x18'));var config=require(_0xeb4d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x92917d,_0x4b7e24){_0x4b7e24=_0x4b7e24||0xcc;return function(_0x6d9d64){if(_0x6d9d64){return _0x92917d['sendStatus'](_0x4b7e24);}return _0x92917d[_0xeb4d('0x1a')](_0x4b7e24)['end']();};}function respondWithResult(_0x5a9071,_0xd8d015){_0xd8d015=_0xd8d015||0xc8;return function(_0x250cf8){if(_0x250cf8){return _0x5a9071[_0xeb4d('0x1a')](_0xd8d015)['json'](_0x250cf8);}};}function respondWithFilteredResult(_0x33507e,_0x4b6292){return function(_0x244fec){if(_0x244fec){var _0x139534=typeof _0x4b6292[_0xeb4d('0x1b')]==='undefined'&&typeof _0x4b6292['limit']===_0xeb4d('0x1c');var _0x8a4965=_0x244fec[_0xeb4d('0x1d')];var _0x33a5e7=_0x139534?0x0:_0x4b6292[_0xeb4d('0x1b')];var _0x20486a=_0x139534?_0x244fec[_0xeb4d('0x1d')]:_0x4b6292[_0xeb4d('0x1b')]+_0x4b6292[_0xeb4d('0x1e')];var _0x23f4e6;if(_0x20486a>=_0x8a4965){_0x20486a=_0x8a4965;_0x23f4e6=0xc8;}else{_0x23f4e6=0xce;}_0x33507e[_0xeb4d('0x1a')](_0x23f4e6);return _0x33507e[_0xeb4d('0x1f')](_0xeb4d('0x20'),_0x33a5e7+'-'+_0x20486a+'/'+_0x8a4965)[_0xeb4d('0x21')](_0x244fec);}return null;};}function patchUpdates(_0x13ee81){return function(_0x5c0e6f){try{jsonpatch[_0xeb4d('0x22')](_0x5c0e6f,_0x13ee81,!![]);}catch(_0x37ce51){return BPromise['reject'](_0x37ce51);}return _0x5c0e6f[_0xeb4d('0x23')]();};}function saveUpdates(_0x32522a,_0x1bdcec){return function(_0x3fc19f){if(_0x3fc19f){return _0x3fc19f['update'](_0x32522a)[_0xeb4d('0x24')](function(_0x579f97){return _0x579f97;});}return null;};}function removeEntity(_0x31c38f,_0x30c0c5){return function(_0x494cc2){if(_0x494cc2){return _0x494cc2[_0xeb4d('0x25')]()[_0xeb4d('0x24')](function(){_0x31c38f['status'](0xcc)[_0xeb4d('0x26')]();});}};}function handleEntityNotFound(_0x4e84e3,_0x2f25c1){return function(_0xed2006){if(!_0xed2006){_0x4e84e3[_0xeb4d('0x27')](0x194);}return _0xed2006;};}function handleError(_0x441e80,_0x2aa9ce){_0x2aa9ce=_0x2aa9ce||0x1f4;return function(_0x1b2f74){logger[_0xeb4d('0x28')](_0x1b2f74[_0xeb4d('0x29')]);if(_0x1b2f74['name']){delete _0x1b2f74[_0xeb4d('0x2a')];}_0x441e80[_0xeb4d('0x1a')](_0x2aa9ce)[_0xeb4d('0x2b')](_0x1b2f74);};}exports[_0xeb4d('0x2c')]=function(_0x15c78f,_0x551e70){var _0x5b04a4={},_0x338903={},_0x33cb47={'count':0x0,'rows':[]};var _0x20841b=_[_0xeb4d('0x2d')](db[_0xeb4d('0x2e')][_0xeb4d('0x2f')],function(_0x527470){return{'name':_0x527470[_0xeb4d('0x30')],'type':_0x527470[_0xeb4d('0x31')][_0xeb4d('0x32')]};});_0x338903[_0xeb4d('0x33')]=_['map'](_0x20841b,_0xeb4d('0x2a'));_0x338903[_0xeb4d('0x34')]=_[_0xeb4d('0x35')](_0x15c78f[_0xeb4d('0x34')]);_0x338903[_0xeb4d('0x36')]=_['intersection'](_0x338903['model'],_0x338903[_0xeb4d('0x34')]);_0x5b04a4[_0xeb4d('0x37')]=_[_0xeb4d('0x38')](_0x338903[_0xeb4d('0x33')],qs[_0xeb4d('0x39')](_0x15c78f['query'][_0xeb4d('0x39')]));_0x5b04a4[_0xeb4d('0x37')]=_0x5b04a4[_0xeb4d('0x37')][_0xeb4d('0x3a')]?_0x5b04a4['attributes']:_0x338903[_0xeb4d('0x33')];if(!_0x15c78f['query'][_0xeb4d('0x3b')]('nolimit')){_0x5b04a4['limit']=qs['limit'](_0x15c78f[_0xeb4d('0x34')]['limit']);_0x5b04a4[_0xeb4d('0x1b')]=qs[_0xeb4d('0x1b')](_0x15c78f[_0xeb4d('0x34')][_0xeb4d('0x1b')]);}_0x5b04a4[_0xeb4d('0x3c')]=qs['sort'](_0x15c78f[_0xeb4d('0x34')][_0xeb4d('0x3d')]);_0x5b04a4[_0xeb4d('0x3e')]=qs[_0xeb4d('0x36')](_['pick'](_0x15c78f['query'],_0x338903[_0xeb4d('0x36')]),_0x20841b);if(_0x15c78f[_0xeb4d('0x34')]['filter']){_0x5b04a4['where']=_[_0xeb4d('0x3f')](_0x5b04a4[_0xeb4d('0x3e')],{'$or':_[_0xeb4d('0x2d')](_0x20841b,function(_0x164fad){if(_0x164fad[_0xeb4d('0x31')]!==_0xeb4d('0x40')){var _0x238be9={};_0x238be9[_0x164fad[_0xeb4d('0x2a')]]={'$like':'%'+_0x15c78f[_0xeb4d('0x34')][_0xeb4d('0x41')]+'%'};return _0x238be9;}})});}_0x5b04a4=_['merge']({},_0x5b04a4,_0x15c78f['options']);var _0x61a2a9={'where':_0x5b04a4['where']};return db[_0xeb4d('0x2e')][_0xeb4d('0x1d')](_0x61a2a9)[_0xeb4d('0x24')](function(_0x34a2db){_0x33cb47[_0xeb4d('0x1d')]=_0x34a2db;if(_0x15c78f[_0xeb4d('0x34')][_0xeb4d('0x42')]){_0x5b04a4['include']=[{'all':!![]}];}return db[_0xeb4d('0x2e')][_0xeb4d('0x43')](_0x5b04a4);})[_0xeb4d('0x24')](function(_0x43844f){_0x33cb47['rows']=_0x43844f;return _0x33cb47;})[_0xeb4d('0x24')](respondWithFilteredResult(_0x551e70,_0x5b04a4))[_0xeb4d('0x44')](handleError(_0x551e70,null));};exports[_0xeb4d('0x45')]=function(_0x3bc0f7,_0x327715){var _0x445bbc={'raw':!![],'where':{'id':_0x3bc0f7[_0xeb4d('0x46')]['id']}},_0x5d6630={};_0x5d6630[_0xeb4d('0x33')]=_[_0xeb4d('0x35')](db[_0xeb4d('0x2e')][_0xeb4d('0x2f')]);_0x5d6630[_0xeb4d('0x34')]=_[_0xeb4d('0x35')](_0x3bc0f7[_0xeb4d('0x34')]);_0x5d6630[_0xeb4d('0x36')]=_['intersection'](_0x5d6630[_0xeb4d('0x33')],_0x5d6630[_0xeb4d('0x34')]);_0x445bbc['attributes']=_[_0xeb4d('0x38')](_0x5d6630[_0xeb4d('0x33')],qs[_0xeb4d('0x39')](_0x3bc0f7[_0xeb4d('0x34')][_0xeb4d('0x39')]));_0x445bbc[_0xeb4d('0x37')]=_0x445bbc[_0xeb4d('0x37')][_0xeb4d('0x3a')]?_0x445bbc[_0xeb4d('0x37')]:_0x5d6630['model'];if(_0x3bc0f7[_0xeb4d('0x34')][_0xeb4d('0x42')]){_0x445bbc[_0xeb4d('0x47')]=[{'all':!![]}];}_0x445bbc=_[_0xeb4d('0x3f')]({},_0x445bbc,_0x3bc0f7[_0xeb4d('0x48')]);return db[_0xeb4d('0x2e')]['find'](_0x445bbc)['then'](handleEntityNotFound(_0x327715,null))[_0xeb4d('0x24')](respondWithResult(_0x327715,null))['catch'](handleError(_0x327715,null));};exports[_0xeb4d('0x49')]=function(_0x364a75,_0x2df8c8){return db[_0xeb4d('0x2e')]['create'](_0x364a75[_0xeb4d('0x4a')],{})[_0xeb4d('0x24')](respondWithResult(_0x2df8c8,0xc9))['catch'](handleError(_0x2df8c8,null));};exports['update']=function(_0x1990b3,_0x50a3f6){if(_0x1990b3[_0xeb4d('0x4a')]['id']){delete _0x1990b3[_0xeb4d('0x4a')]['id'];}return db[_0xeb4d('0x2e')]['find']({'where':{'id':_0x1990b3[_0xeb4d('0x46')]['id']}})[_0xeb4d('0x24')](handleEntityNotFound(_0x50a3f6,null))['then'](saveUpdates(_0x1990b3[_0xeb4d('0x4a')],null))['then'](respondWithResult(_0x50a3f6,null))[_0xeb4d('0x44')](handleError(_0x50a3f6,null));};exports['destroy']=function(_0x27dfd6,_0x5289a2){return db[_0xeb4d('0x2e')]['find']({'where':{'id':_0x27dfd6[_0xeb4d('0x46')]['id']}})['then'](handleEntityNotFound(_0x5289a2,null))['then'](removeEntity(_0x5289a2,null))[_0xeb4d('0x44')](handleError(_0x5289a2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index b41902d..1da2500 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 _0xfab8=['int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField'];(function(_0x2aa957,_0x2a4228){var _0x16d718=function(_0x185e52){while(--_0x185e52){_0x2aa957['push'](_0x2aa957['shift']());}};_0x16d718(++_0x2a4228);}(_0xfab8,0x1c3));var _0x8fab=function(_0x25c863,_0x3e11d5){_0x25c863=_0x25c863-0x0;var _0x3cbb19=_0xfab8[_0x25c863];return _0x3cbb19;};'use strict';var _=require(_0x8fab('0x0'));var util=require(_0x8fab('0x1'));var logger=require(_0x8fab('0x2'))(_0x8fab('0x3'));var moment=require(_0x8fab('0x4'));var BPromise=require('bluebird');var rp=require(_0x8fab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fab('0x6'));var config=require(_0x8fab('0x7'));var attributes=require(_0x8fab('0x8'));module[_0x8fab('0x9')]=function(_0x47c171,_0x4d8bff){return _0x47c171['define'](_0x8fab('0xa'),attributes,{'tableName':_0x8fab('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x8fab('0xc'),_0x8fab('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8e8=['lodash','util','../../config/logger','api','request-promise','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd8e8,0x111));var _0x8d8e=function(_0x40aa85,_0x4ff59c){_0x40aa85=_0x40aa85-0x0;var _0xc7da06=_0xd8e8[_0x40aa85];return _0xc7da06;};'use strict';var _=require(_0x8d8e('0x0'));var util=require(_0x8d8e('0x1'));var logger=require(_0x8d8e('0x2'))(_0x8d8e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8d8e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d8e('0x5'));var attributes=require(_0x8d8e('0x6'));module[_0x8d8e('0x7')]=function(_0xfe5257,_0x272e28){return _0xfe5257[_0x8d8e('0x8')]('ServicenowField',attributes,{'tableName':_0x8d8e('0x9'),'paranoid':![],'indexes':[{'name':_0x8d8e('0xa'),'fields':[_0x8d8e('0xb'),_0x8d8e('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 30ac8bd..0d7fc78 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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x576e58,_0x335963){var _0x2dd0cd=function(_0x28b7e2){while(--_0x28b7e2){_0x576e58['push'](_0x576e58['shift']());}};_0x2dd0cd(++_0x335963);}(_0xe706,0xa3));var _0x6e70=function(_0x458f09,_0xf2ee90){_0x458f09=_0x458f09-0x0;var _0x1ca565=_0xe706[_0x458f09];return _0x1ca565;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ 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(_0x4db94c,_0x36d531){var _0x34d791=function(_0x374167){while(--_0x374167){_0x4db94c['push'](_0x4db94c['shift']());}};_0x34d791(++_0x36d531);}(_0xb43b,0x1b2));var _0xbb43=function(_0xf47851,_0x59b71f){_0xf47851=_0xf47851-0x0;var _0x172e6f=_0xb43b[_0xf47851];return _0x172e6f;};'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 f2440fc..1fca671 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(_0x2e49a3,_0x46b967){var _0x34d67e=function(_0xb9052f){while(--_0xb9052f){_0x2e49a3['push'](_0x2e49a3['shift']());}};_0x34d67e(++_0x46b967);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x1c93f3,_0x50a59b){var _0x4d6045=function(_0x157caa){while(--_0x157caa){_0x1c93f3['push'](_0x1c93f3['shift']());}};_0x4d6045(++_0x50a59b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 213019e..ce5719f 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(_0xdd7524,_0x3ed3d2){var _0x41fb51=function(_0x334f73){while(--_0x334f73){_0xdd7524['push'](_0xdd7524['shift']());}};_0x41fb51(++_0x3ed3d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x4808b0,_0x269688){var _0x38f062=function(_0x55e921){while(--_0x55e921){_0x4808b0['push'](_0x4808b0['shift']());}};_0x38f062(++_0x269688);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 72077c3..951b63c 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 _0xfc1e=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','findOne','SugarcrmConfiguration','nolimit','addConfiguration','channel','SugarcrmField','Descriptions','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3372e9,_0x5875e){var _0x2d04ba=function(_0x515f4f){while(--_0x515f4f){_0x3372e9['push'](_0x3372e9['shift']());}};_0x2d04ba(++_0x5875e);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xfc1e[_0x1a8f86];return _0x20d876;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xefc1('0x0'));var rp=require(_0xefc1('0x1'));var moment=require(_0xefc1('0x2'));var BPromise=require(_0xefc1('0x3'));var Mustache=require(_0xefc1('0x4'));var util=require('util');var path=require(_0xefc1('0x5'));var sox=require(_0xefc1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefc1('0x7'));var _=require(_0xefc1('0x8'));var squel=require(_0xefc1('0x9'));var crypto=require(_0xefc1('0xa'));var jsforce=require(_0xefc1('0xb'));var deskjs=require(_0xefc1('0xc'));var toCsv=require(_0xefc1('0xd'));var querystring=require(_0xefc1('0xe'));var Papa=require(_0xefc1('0xf'));var Redis=require(_0xefc1('0x10'));var authService=require(_0xefc1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xefc1('0x12'));var hardwareService=require(_0xefc1('0x13'));var logger=require(_0xefc1('0x14'))(_0xefc1('0x15'));var utils=require(_0xefc1('0x16'));var config=require(_0xefc1('0x17'));var licenseUtil=require(_0xefc1('0x18'));var db=require(_0xefc1('0x19'))['db'];var integrations=require(_0xefc1('0x1a'));function respondWithStatusCode(_0x139fbf,_0x3530d0){_0x3530d0=_0x3530d0||0xcc;return function(_0x55674a){if(_0x55674a){return _0x139fbf[_0xefc1('0x1b')](_0x3530d0);}return _0x139fbf[_0xefc1('0x1c')](_0x3530d0)[_0xefc1('0x1d')]();};}function respondWithResult(_0x36633f,_0x32372b){_0x32372b=_0x32372b||0xc8;return function(_0x120efb){if(_0x120efb){return _0x36633f[_0xefc1('0x1c')](_0x32372b)[_0xefc1('0x1e')](_0x120efb);}};}function respondWithFilteredResult(_0x4d42cd,_0x1e1418){return function(_0x1cc6d9){if(_0x1cc6d9){var _0x26d9de=typeof _0x1e1418['offset']===_0xefc1('0x1f')&&typeof _0x1e1418[_0xefc1('0x20')]===_0xefc1('0x1f');var _0x3aff0e=_0x1cc6d9[_0xefc1('0x21')];var _0x38923c=_0x26d9de?0x0:_0x1e1418[_0xefc1('0x22')];var _0x126052=_0x26d9de?_0x1cc6d9['count']:_0x1e1418[_0xefc1('0x22')]+_0x1e1418[_0xefc1('0x20')];var _0x2670a9;if(_0x126052>=_0x3aff0e){_0x126052=_0x3aff0e;_0x2670a9=0xc8;}else{_0x2670a9=0xce;}_0x4d42cd['status'](_0x2670a9);return _0x4d42cd['set'](_0xefc1('0x23'),_0x38923c+'-'+_0x126052+'/'+_0x3aff0e)['json'](_0x1cc6d9);}return null;};}function patchUpdates(_0x379c24){return function(_0x517a9c){try{jsonpatch[_0xefc1('0x24')](_0x517a9c,_0x379c24,!![]);}catch(_0x34bfdd){return BPromise['reject'](_0x34bfdd);}return _0x517a9c[_0xefc1('0x25')]();};}function saveUpdates(_0x2ea108,_0x102576){return function(_0x3d6532){if(_0x3d6532){return _0x3d6532[_0xefc1('0x26')](_0x2ea108)[_0xefc1('0x27')](function(_0x5db459){return _0x5db459;});}return null;};}function removeEntity(_0x2f4935,_0xd950ce){return function(_0x56b540){if(_0x56b540){return _0x56b540[_0xefc1('0x28')]()['then'](function(){_0x2f4935['status'](0xcc)[_0xefc1('0x1d')]();});}};}function handleEntityNotFound(_0x84a5c0,_0x3eb944){return function(_0x2913b4){if(!_0x2913b4){_0x84a5c0[_0xefc1('0x1b')](0x194);}return _0x2913b4;};}function handleError(_0x3ee133,_0x538145){_0x538145=_0x538145||0x1f4;return function(_0x5c2733){logger[_0xefc1('0x29')](_0x5c2733[_0xefc1('0x2a')]);if(_0x5c2733[_0xefc1('0x2b')]){delete _0x5c2733[_0xefc1('0x2b')];}_0x3ee133[_0xefc1('0x1c')](_0x538145)['send'](_0x5c2733);};}exports[_0xefc1('0x2c')]=function(_0x3f6e1a,_0x55f900){var _0x486a5b={},_0x1c58e7={},_0x344ce8={'count':0x0,'rows':[]};var _0x117d00=_['map'](db[_0xefc1('0x2d')][_0xefc1('0x2e')],function(_0x574390){return{'name':_0x574390[_0xefc1('0x2f')],'type':_0x574390[_0xefc1('0x30')][_0xefc1('0x31')]};});_0x1c58e7[_0xefc1('0x32')]=_[_0xefc1('0x33')](_0x117d00,'name');_0x1c58e7[_0xefc1('0x34')]=_[_0xefc1('0x35')](_0x3f6e1a[_0xefc1('0x34')]);_0x1c58e7[_0xefc1('0x36')]=_[_0xefc1('0x37')](_0x1c58e7[_0xefc1('0x32')],_0x1c58e7[_0xefc1('0x34')]);_0x486a5b[_0xefc1('0x38')]=_['intersection'](_0x1c58e7[_0xefc1('0x32')],qs[_0xefc1('0x39')](_0x3f6e1a[_0xefc1('0x34')][_0xefc1('0x39')]));_0x486a5b['attributes']=_0x486a5b[_0xefc1('0x38')]['length']?_0x486a5b[_0xefc1('0x38')]:_0x1c58e7[_0xefc1('0x32')];if(!_0x3f6e1a[_0xefc1('0x34')][_0xefc1('0x3a')]('nolimit')){_0x486a5b[_0xefc1('0x20')]=qs[_0xefc1('0x20')](_0x3f6e1a[_0xefc1('0x34')]['limit']);_0x486a5b[_0xefc1('0x22')]=qs['offset'](_0x3f6e1a['query'][_0xefc1('0x22')]);}_0x486a5b['order']=qs[_0xefc1('0x3b')](_0x3f6e1a[_0xefc1('0x34')][_0xefc1('0x3b')]);_0x486a5b[_0xefc1('0x3c')]=qs[_0xefc1('0x36')](_['pick'](_0x3f6e1a[_0xefc1('0x34')],_0x1c58e7[_0xefc1('0x36')]),_0x117d00);if(_0x3f6e1a['query'][_0xefc1('0x3d')]){_0x486a5b[_0xefc1('0x3c')]=_[_0xefc1('0x3e')](_0x486a5b[_0xefc1('0x3c')],{'$or':_['map'](_0x117d00,function(_0x5102b1){if(_0x5102b1[_0xefc1('0x30')]!==_0xefc1('0x3f')){var _0x228ee8={};_0x228ee8[_0x5102b1[_0xefc1('0x2b')]]={'$like':'%'+_0x3f6e1a[_0xefc1('0x34')][_0xefc1('0x3d')]+'%'};return _0x228ee8;}})});}_0x486a5b=_[_0xefc1('0x3e')]({},_0x486a5b,_0x3f6e1a[_0xefc1('0x40')]);var _0x5cece3={'where':_0x486a5b[_0xefc1('0x3c')]};return db[_0xefc1('0x2d')][_0xefc1('0x21')](_0x5cece3)[_0xefc1('0x27')](function(_0x3a7078){_0x344ce8[_0xefc1('0x21')]=_0x3a7078;if(_0x3f6e1a[_0xefc1('0x34')]['includeAll']){_0x486a5b[_0xefc1('0x41')]=[{'all':!![]}];}return db[_0xefc1('0x2d')][_0xefc1('0x42')](_0x486a5b);})[_0xefc1('0x27')](function(_0x4db686){_0x344ce8[_0xefc1('0x43')]=_0x4db686;return _0x344ce8;})[_0xefc1('0x27')](respondWithFilteredResult(_0x55f900,_0x486a5b))[_0xefc1('0x44')](handleError(_0x55f900,null));};exports['show']=function(_0x1cdb35,_0x1f3e8e){var _0x7ff13e={'raw':![],'where':{'id':_0x1cdb35[_0xefc1('0x45')]['id']}},_0x389e54={};_0x389e54['model']=_[_0xefc1('0x35')](db['SugarcrmAccount'][_0xefc1('0x2e')]);_0x389e54[_0xefc1('0x34')]=_[_0xefc1('0x35')](_0x1cdb35[_0xefc1('0x34')]);_0x389e54['filters']=_[_0xefc1('0x37')](_0x389e54['model'],_0x389e54[_0xefc1('0x34')]);_0x7ff13e[_0xefc1('0x38')]=_['intersection'](_0x389e54[_0xefc1('0x32')],qs[_0xefc1('0x39')](_0x1cdb35[_0xefc1('0x34')][_0xefc1('0x39')]));_0x7ff13e[_0xefc1('0x38')]=_0x7ff13e[_0xefc1('0x38')][_0xefc1('0x46')]?_0x7ff13e[_0xefc1('0x38')]:_0x389e54['model'];if(_0x1cdb35[_0xefc1('0x34')][_0xefc1('0x47')]){_0x7ff13e[_0xefc1('0x41')]=[{'all':!![]}];}_0x7ff13e=_['merge']({},_0x7ff13e,_0x1cdb35[_0xefc1('0x40')]);return db['SugarcrmAccount'][_0xefc1('0x48')](_0x7ff13e)[_0xefc1('0x27')](handleEntityNotFound(_0x1f3e8e,null))[_0xefc1('0x27')](respondWithResult(_0x1f3e8e,null))[_0xefc1('0x44')](handleError(_0x1f3e8e,null));};exports['create']=function(_0x28a6d1,_0x5a9a3c){return db[_0xefc1('0x2d')][_0xefc1('0x49')](_0x28a6d1[_0xefc1('0x4a')],{})[_0xefc1('0x27')](respondWithResult(_0x5a9a3c,0xc9))['catch'](handleError(_0x5a9a3c,null));};exports['update']=function(_0x3d37cd,_0x2d262c){if(_0x3d37cd[_0xefc1('0x4a')]['id']){delete _0x3d37cd[_0xefc1('0x4a')]['id'];}return db[_0xefc1('0x2d')][_0xefc1('0x48')]({'where':{'id':_0x3d37cd['params']['id']}})[_0xefc1('0x27')](handleEntityNotFound(_0x2d262c,null))[_0xefc1('0x27')](saveUpdates(_0x3d37cd[_0xefc1('0x4a')],null))[_0xefc1('0x27')](respondWithResult(_0x2d262c,null))[_0xefc1('0x44')](handleError(_0x2d262c,null));};exports['destroy']=function(_0x90bc06,_0xcaeb98){return db[_0xefc1('0x2d')][_0xefc1('0x48')]({'where':{'id':_0x90bc06[_0xefc1('0x45')]['id']}})['then'](handleEntityNotFound(_0xcaeb98,null))['then'](removeEntity(_0xcaeb98,null))[_0xefc1('0x44')](handleError(_0xcaeb98,null));};exports['getConfigurations']=function(_0x50994a,_0x10fa08,_0x23dbb1){var _0x1bf0c2={};var _0x36c7bf={};var _0x35ba8e;var _0x184596;return db['SugarcrmAccount'][_0xefc1('0x4b')]({'where':{'id':_0x50994a[_0xefc1('0x45')]['id']}})[_0xefc1('0x27')](handleEntityNotFound(_0x10fa08,null))['then'](function(_0x2392ed){if(_0x2392ed){_0x35ba8e=_0x2392ed;_0x36c7bf['model']=_[_0xefc1('0x35')](db[_0xefc1('0x4c')][_0xefc1('0x2e')]);_0x36c7bf[_0xefc1('0x34')]=_[_0xefc1('0x35')](_0x50994a[_0xefc1('0x34')]);_0x36c7bf[_0xefc1('0x36')]=_[_0xefc1('0x37')](_0x36c7bf[_0xefc1('0x32')],_0x36c7bf[_0xefc1('0x34')]);_0x1bf0c2[_0xefc1('0x38')]=_['intersection'](_0x36c7bf[_0xefc1('0x32')],qs[_0xefc1('0x39')](_0x50994a[_0xefc1('0x34')][_0xefc1('0x39')]));_0x1bf0c2[_0xefc1('0x38')]=_0x1bf0c2['attributes'][_0xefc1('0x46')]?_0x1bf0c2[_0xefc1('0x38')]:_0x36c7bf[_0xefc1('0x32')];_0x1bf0c2['order']=qs['sort'](_0x50994a[_0xefc1('0x34')][_0xefc1('0x3b')]);_0x1bf0c2[_0xefc1('0x3c')]=qs[_0xefc1('0x36')](_['pick'](_0x50994a[_0xefc1('0x34')],_0x36c7bf[_0xefc1('0x36')]));if(_0x50994a[_0xefc1('0x34')][_0xefc1('0x3d')]){_0x1bf0c2[_0xefc1('0x3c')]=_[_0xefc1('0x3e')](_0x1bf0c2[_0xefc1('0x3c')],{'$or':_['map'](_0x1bf0c2[_0xefc1('0x38')],function(_0x2fccc6){var _0x1ce2a5={};_0x1ce2a5[_0x2fccc6]={'$like':'%'+_0x50994a[_0xefc1('0x34')]['filter']+'%'};return _0x1ce2a5;})});}_0x1bf0c2=_[_0xefc1('0x3e')]({},_0x1bf0c2,_0x50994a[_0xefc1('0x40')]);return _0x35ba8e['getConfigurations'](_0x1bf0c2);}})[_0xefc1('0x27')](function(_0x1c04c2){if(_0x1c04c2){_0x184596=_0x1c04c2[_0xefc1('0x46')];if(!_0x50994a[_0xefc1('0x34')][_0xefc1('0x3a')](_0xefc1('0x4d'))){_0x1bf0c2[_0xefc1('0x20')]=qs[_0xefc1('0x20')](_0x50994a['query'][_0xefc1('0x20')]);_0x1bf0c2['offset']=qs[_0xefc1('0x22')](_0x50994a[_0xefc1('0x34')][_0xefc1('0x22')]);}return _0x35ba8e['getConfigurations'](_0x1bf0c2);}})[_0xefc1('0x27')](function(_0x48301c){if(_0x48301c){return _0x48301c?{'count':_0x184596,'rows':_0x48301c}:null;}})['then'](respondWithResult(_0x10fa08,null))[_0xefc1('0x44')](handleError(_0x10fa08,null));};exports[_0xefc1('0x4e')]=function(_0x4ed240,_0x25efc9,_0x59eaf0){if(_0x4ed240[_0xefc1('0x4a')]['id']){delete _0x4ed240['body']['id'];}return db['SugarcrmAccount'][_0xefc1('0x4b')]({'where':{'id':_0x4ed240[_0xefc1('0x45')]['id']}})[_0xefc1('0x27')](handleEntityNotFound(_0x25efc9,null))[_0xefc1('0x27')](function(_0x37d469){if(_0x37d469){_0x4ed240[_0xefc1('0x4a')]['AccountId']=_0x37d469['id'];_0x4ed240[_0xefc1('0x4a')]['Subjects']=integrations['getSubjects'](_0x4ed240['body']['channel'],_0x4ed240[_0xefc1('0x4a')][_0xefc1('0x30')]);_0x4ed240['body']['Descriptions']=integrations['getDescriptions'](_0x4ed240[_0xefc1('0x4a')][_0xefc1('0x4f')],_0x4ed240[_0xefc1('0x4a')][_0xefc1('0x30')]);return db[_0xefc1('0x4c')][_0xefc1('0x49')](_0x4ed240[_0xefc1('0x4a')],{'include':[{'model':db[_0xefc1('0x50')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xefc1('0x51')}]});}return null;})[_0xefc1('0x27')](respondWithResult(_0x25efc9,null))['catch'](handleError(_0x25efc9,null));};exports['getFields']=function(_0x5b7cab,_0x4525e7,_0x3bd1e4){var _0xf1bb64='';var _0x2c2f52=['id',_0xefc1('0x2b'),_0xefc1('0x52'),_0xefc1('0x53'),'description',_0xefc1('0x54'),_0xefc1('0x55'),_0xefc1('0x56'),_0xefc1('0x57'),'parent_type',_0xefc1('0x58'),_0xefc1('0x59')];return db[_0xefc1('0x2d')]['findOne']({'where':{'id':_0x5b7cab['params']['id']},'attributes':['id',_0xefc1('0x5a'),_0xefc1('0x5b'),_0xefc1('0x5c')]})[_0xefc1('0x27')](handleEntityNotFound(_0x4525e7,null))[_0xefc1('0x27')](function(_0x56a24f){if(_0x56a24f){_0xf1bb64=_0x56a24f[_0xefc1('0x5c')];var _0xfd7a4c=_0xf1bb64['slice'](-0x1);if(_0xfd7a4c==='/'){_0xf1bb64=_0xf1bb64[_0xefc1('0x5d')](0x0,_0xf1bb64[_0xefc1('0x5e')](_0xfd7a4c));}return rp({'method':_0xefc1('0x5f'),'uri':util['format'](_0xefc1('0x60'),_0xf1bb64,_0xefc1('0x61')),'json':!![],'form':{'method':_0xefc1('0x62'),'input_type':_0xefc1('0x63'),'response_type':_0xefc1('0x63'),'rest_data':JSON[_0xefc1('0x64')]({'user_auth':{'user_name':_0x56a24f['username'],'password':_0x56a24f[_0xefc1('0x5b')],'encryption':_0xefc1('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x42ee27){if(_0x42ee27&&_0x42ee27[_0xefc1('0x2b')]!==_0xefc1('0x66')&&_0x42ee27[_0xefc1('0x2b')]!==_0xefc1('0x67')){return rp({'method':_0xefc1('0x5f'),'uri':util[_0xefc1('0x68')](_0xefc1('0x60'),_0xf1bb64,_0xefc1('0x61')),'json':!![],'form':{'method':_0xefc1('0x69'),'input_type':_0xefc1('0x63'),'response_type':'JSON','rest_data':JSON[_0xefc1('0x64')]({'session':_0x42ee27['id'],'module_name':_0xefc1('0x6a')})}})['then'](function(_0xb5045){if(_0xb5045){var _0x3cbaa0=_['values'](_0xb5045[_0xefc1('0x6b')]);_[_0xefc1('0x6c')](_0x3cbaa0,function(_0x30a07b){return _0x2c2f52[_0xefc1('0x6d')](_0x30a07b['name']);});return{'count':_0x3cbaa0['length'],'rows':_[_0xefc1('0x33')](_0x3cbaa0,function(_0x503141){return{'id':_0x503141[_0xefc1('0x2b')],'name':_0x503141[_0xefc1('0x6e')],'custom':_[_0xefc1('0x6f')](_0x503141['name'],'_c')?!![]:![],'options':_0x503141[_0xefc1('0x40')]?_[_0xefc1('0x33')](_[_0xefc1('0x70')](_0x503141[_0xefc1('0x40')]),function(_0x5bfda2){return{'name':_0x5bfda2['value'],'value':_0x5bfda2[_0xefc1('0x2b')]};}):[]};})};}})[_0xefc1('0x27')](respondWithResult(_0x4525e7,null))[_0xefc1('0x44')](function(_0x5644e6){var _0x5b7510=_0x5b7cab[_0xefc1('0x34')][_0xefc1('0x71')]?0x1f4:_0x5644e6[_0xefc1('0x72')]||0x1f4;logger['error'](_0xefc1('0x73'),_0xefc1('0x74'),_0x5b7510,JSON['stringify'](_0x5644e6));delete _0x5644e6[_0xefc1('0x2b')];if(_0x5b7510===0x191){_0x5b7510=0x190;}_0x4525e7[_0xefc1('0x1c')](_0x5b7510)[_0xefc1('0x75')](_0x5b7cab[_0xefc1('0x34')][_0xefc1('0x71')]?{'message':_0xefc1('0x76'),'statusCode':_0x5644e6['statusCode']}:_0x5644e6);});}else{var _0x52e46b=0x1f4;_0x4525e7[_0xefc1('0x1c')](_0x52e46b)['send']({'message':_0xefc1('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x9f2a=['path','sox','to-csv','ejs','fs-extra','lodash','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','../../components/integrations/configuration','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','SugarcrmAccount','find','create','body','getConfigurations','rawAttributes','options','findOne','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','description','date_start','duration_hours','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','stringify','Calls','values','module_fields','remove','includes','label','endsWith','test','statusCode','Wrong\x20credentials','eml-format','moment','bluebird','mustache','util'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x9f2a,0x154));var _0xa9f2=function(_0x1d1942,_0x47dbb1){_0x1d1942=_0x1d1942-0x0;var _0x58b13b=_0x9f2a[_0x1d1942];return _0x58b13b;};'use strict';var emlformat=require(_0xa9f2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9f2('0x1'));var BPromise=require(_0xa9f2('0x2'));var Mustache=require(_0xa9f2('0x3'));var util=require(_0xa9f2('0x4'));var path=require(_0xa9f2('0x5'));var sox=require(_0xa9f2('0x6'));var csv=require(_0xa9f2('0x7'));var ejs=require(_0xa9f2('0x8'));var fs=require('fs');var fs_extra=require(_0xa9f2('0x9'));var _=require(_0xa9f2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9f2('0xb'));var deskjs=require(_0xa9f2('0xc'));var toCsv=require(_0xa9f2('0x7'));var querystring=require(_0xa9f2('0xd'));var Papa=require(_0xa9f2('0xe'));var Redis=require(_0xa9f2('0xf'));var authService=require(_0xa9f2('0x10'));var qs=require(_0xa9f2('0x11'));var as=require(_0xa9f2('0x12'));var hardwareService=require(_0xa9f2('0x13'));var logger=require(_0xa9f2('0x14'))(_0xa9f2('0x15'));var utils=require(_0xa9f2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa9f2('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa9f2('0x18'));function respondWithStatusCode(_0x58a0b6,_0x9c4fbe){_0x9c4fbe=_0x9c4fbe||0xcc;return function(_0x290613){if(_0x290613){return _0x58a0b6['sendStatus'](_0x9c4fbe);}return _0x58a0b6[_0xa9f2('0x19')](_0x9c4fbe)['end']();};}function respondWithResult(_0x20d3fc,_0x45d403){_0x45d403=_0x45d403||0xc8;return function(_0x534817){if(_0x534817){return _0x20d3fc[_0xa9f2('0x19')](_0x45d403)[_0xa9f2('0x1a')](_0x534817);}};}function respondWithFilteredResult(_0x2e3ab2,_0xcf5a81){return function(_0x24f8b8){if(_0x24f8b8){var _0xa839f6=typeof _0xcf5a81[_0xa9f2('0x1b')]===_0xa9f2('0x1c')&&typeof _0xcf5a81[_0xa9f2('0x1d')]===_0xa9f2('0x1c');var _0xdde2ab=_0x24f8b8[_0xa9f2('0x1e')];var _0x43c47a=_0xa839f6?0x0:_0xcf5a81[_0xa9f2('0x1b')];var _0x310b5b=_0xa839f6?_0x24f8b8['count']:_0xcf5a81['offset']+_0xcf5a81['limit'];var _0x11679e;if(_0x310b5b>=_0xdde2ab){_0x310b5b=_0xdde2ab;_0x11679e=0xc8;}else{_0x11679e=0xce;}_0x2e3ab2[_0xa9f2('0x19')](_0x11679e);return _0x2e3ab2['set'](_0xa9f2('0x1f'),_0x43c47a+'-'+_0x310b5b+'/'+_0xdde2ab)['json'](_0x24f8b8);}return null;};}function patchUpdates(_0x2e13b3){return function(_0x4a41a2){try{jsonpatch['apply'](_0x4a41a2,_0x2e13b3,!![]);}catch(_0x372d69){return BPromise[_0xa9f2('0x20')](_0x372d69);}return _0x4a41a2[_0xa9f2('0x21')]();};}function saveUpdates(_0x3783fa,_0xbc62f){return function(_0x28e77d){if(_0x28e77d){return _0x28e77d[_0xa9f2('0x22')](_0x3783fa)[_0xa9f2('0x23')](function(_0x1bee40){return _0x1bee40;});}return null;};}function removeEntity(_0x1af15b,_0x227ead){return function(_0x1dadfa){if(_0x1dadfa){return _0x1dadfa[_0xa9f2('0x24')]()[_0xa9f2('0x23')](function(){_0x1af15b[_0xa9f2('0x19')](0xcc)[_0xa9f2('0x25')]();});}};}function handleEntityNotFound(_0x32e5d8,_0x14cbe1){return function(_0x2f6d1c){if(!_0x2f6d1c){_0x32e5d8['sendStatus'](0x194);}return _0x2f6d1c;};}function handleError(_0x4aa255,_0x509401){_0x509401=_0x509401||0x1f4;return function(_0xe35321){logger['error'](_0xe35321[_0xa9f2('0x26')]);if(_0xe35321[_0xa9f2('0x27')]){delete _0xe35321['name'];}_0x4aa255[_0xa9f2('0x19')](_0x509401)[_0xa9f2('0x28')](_0xe35321);};}exports[_0xa9f2('0x29')]=function(_0x425d07,_0x2775a9){var _0xaf761e={},_0x561c6b={},_0x308b7c={'count':0x0,'rows':[]};var _0x2d4fe4=_['map'](db['SugarcrmAccount']['rawAttributes'],function(_0x49ff24){return{'name':_0x49ff24[_0xa9f2('0x2a')],'type':_0x49ff24[_0xa9f2('0x2b')][_0xa9f2('0x2c')]};});_0x561c6b[_0xa9f2('0x2d')]=_['map'](_0x2d4fe4,_0xa9f2('0x27'));_0x561c6b[_0xa9f2('0x2e')]=_[_0xa9f2('0x2f')](_0x425d07[_0xa9f2('0x2e')]);_0x561c6b[_0xa9f2('0x30')]=_[_0xa9f2('0x31')](_0x561c6b[_0xa9f2('0x2d')],_0x561c6b[_0xa9f2('0x2e')]);_0xaf761e[_0xa9f2('0x32')]=_['intersection'](_0x561c6b[_0xa9f2('0x2d')],qs[_0xa9f2('0x33')](_0x425d07[_0xa9f2('0x2e')][_0xa9f2('0x33')]));_0xaf761e['attributes']=_0xaf761e[_0xa9f2('0x32')][_0xa9f2('0x34')]?_0xaf761e['attributes']:_0x561c6b[_0xa9f2('0x2d')];if(!_0x425d07['query'][_0xa9f2('0x35')](_0xa9f2('0x36'))){_0xaf761e[_0xa9f2('0x1d')]=qs[_0xa9f2('0x1d')](_0x425d07['query'][_0xa9f2('0x1d')]);_0xaf761e[_0xa9f2('0x1b')]=qs[_0xa9f2('0x1b')](_0x425d07[_0xa9f2('0x2e')]['offset']);}_0xaf761e[_0xa9f2('0x37')]=qs[_0xa9f2('0x38')](_0x425d07['query']['sort']);_0xaf761e['where']=qs['filters'](_[_0xa9f2('0x39')](_0x425d07[_0xa9f2('0x2e')],_0x561c6b[_0xa9f2('0x30')]),_0x2d4fe4);if(_0x425d07[_0xa9f2('0x2e')][_0xa9f2('0x3a')]){_0xaf761e[_0xa9f2('0x3b')]=_['merge'](_0xaf761e[_0xa9f2('0x3b')],{'$or':_[_0xa9f2('0x3c')](_0x2d4fe4,function(_0x2e8596){if(_0x2e8596['type']!==_0xa9f2('0x3d')){var _0x57fd59={};_0x57fd59[_0x2e8596[_0xa9f2('0x27')]]={'$like':'%'+_0x425d07[_0xa9f2('0x2e')][_0xa9f2('0x3a')]+'%'};return _0x57fd59;}})});}_0xaf761e=_[_0xa9f2('0x3e')]({},_0xaf761e,_0x425d07['options']);var _0x18939b={'where':_0xaf761e[_0xa9f2('0x3b')]};return db['SugarcrmAccount'][_0xa9f2('0x1e')](_0x18939b)[_0xa9f2('0x23')](function(_0x3be6dc){_0x308b7c[_0xa9f2('0x1e')]=_0x3be6dc;if(_0x425d07[_0xa9f2('0x2e')][_0xa9f2('0x3f')]){_0xaf761e[_0xa9f2('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xa9f2('0x41')](_0xaf761e);})['then'](function(_0x2d9812){_0x308b7c['rows']=_0x2d9812;return _0x308b7c;})[_0xa9f2('0x23')](respondWithFilteredResult(_0x2775a9,_0xaf761e))[_0xa9f2('0x42')](handleError(_0x2775a9,null));};exports[_0xa9f2('0x43')]=function(_0x5524b7,_0x185d6d){var _0x3fc350={'raw':![],'where':{'id':_0x5524b7[_0xa9f2('0x44')]['id']}},_0xb15100={};_0xb15100[_0xa9f2('0x2d')]=_[_0xa9f2('0x2f')](db[_0xa9f2('0x45')]['rawAttributes']);_0xb15100[_0xa9f2('0x2e')]=_['keys'](_0x5524b7[_0xa9f2('0x2e')]);_0xb15100[_0xa9f2('0x30')]=_[_0xa9f2('0x31')](_0xb15100['model'],_0xb15100['query']);_0x3fc350[_0xa9f2('0x32')]=_[_0xa9f2('0x31')](_0xb15100[_0xa9f2('0x2d')],qs[_0xa9f2('0x33')](_0x5524b7['query'][_0xa9f2('0x33')]));_0x3fc350['attributes']=_0x3fc350['attributes']['length']?_0x3fc350[_0xa9f2('0x32')]:_0xb15100[_0xa9f2('0x2d')];if(_0x5524b7[_0xa9f2('0x2e')][_0xa9f2('0x3f')]){_0x3fc350[_0xa9f2('0x40')]=[{'all':!![]}];}_0x3fc350=_[_0xa9f2('0x3e')]({},_0x3fc350,_0x5524b7['options']);return db[_0xa9f2('0x45')][_0xa9f2('0x46')](_0x3fc350)[_0xa9f2('0x23')](handleEntityNotFound(_0x185d6d,null))[_0xa9f2('0x23')](respondWithResult(_0x185d6d,null))['catch'](handleError(_0x185d6d,null));};exports[_0xa9f2('0x47')]=function(_0x274ed2,_0x439bab){return db['SugarcrmAccount'][_0xa9f2('0x47')](_0x274ed2['body'],{})[_0xa9f2('0x23')](respondWithResult(_0x439bab,0xc9))[_0xa9f2('0x42')](handleError(_0x439bab,null));};exports['update']=function(_0x3bcadc,_0xa40e6){if(_0x3bcadc['body']['id']){delete _0x3bcadc[_0xa9f2('0x48')]['id'];}return db[_0xa9f2('0x45')][_0xa9f2('0x46')]({'where':{'id':_0x3bcadc['params']['id']}})[_0xa9f2('0x23')](handleEntityNotFound(_0xa40e6,null))['then'](saveUpdates(_0x3bcadc[_0xa9f2('0x48')],null))[_0xa9f2('0x23')](respondWithResult(_0xa40e6,null))[_0xa9f2('0x42')](handleError(_0xa40e6,null));};exports[_0xa9f2('0x24')]=function(_0x191b20,_0xa8579f){return db['SugarcrmAccount']['find']({'where':{'id':_0x191b20['params']['id']}})['then'](handleEntityNotFound(_0xa8579f,null))['then'](removeEntity(_0xa8579f,null))[_0xa9f2('0x42')](handleError(_0xa8579f,null));};exports[_0xa9f2('0x49')]=function(_0x3804ae,_0x3c2222,_0x3dedfa){var _0x2595ec={};var _0x887d9f={};var _0x25fee2;var _0x4ee84b;return db[_0xa9f2('0x45')]['findOne']({'where':{'id':_0x3804ae[_0xa9f2('0x44')]['id']}})[_0xa9f2('0x23')](handleEntityNotFound(_0x3c2222,null))[_0xa9f2('0x23')](function(_0x1f6d2c){if(_0x1f6d2c){_0x25fee2=_0x1f6d2c;_0x887d9f[_0xa9f2('0x2d')]=_[_0xa9f2('0x2f')](db['SugarcrmConfiguration'][_0xa9f2('0x4a')]);_0x887d9f['query']=_[_0xa9f2('0x2f')](_0x3804ae[_0xa9f2('0x2e')]);_0x887d9f[_0xa9f2('0x30')]=_['intersection'](_0x887d9f['model'],_0x887d9f[_0xa9f2('0x2e')]);_0x2595ec[_0xa9f2('0x32')]=_['intersection'](_0x887d9f[_0xa9f2('0x2d')],qs['fields'](_0x3804ae[_0xa9f2('0x2e')]['fields']));_0x2595ec[_0xa9f2('0x32')]=_0x2595ec[_0xa9f2('0x32')][_0xa9f2('0x34')]?_0x2595ec['attributes']:_0x887d9f[_0xa9f2('0x2d')];_0x2595ec[_0xa9f2('0x37')]=qs[_0xa9f2('0x38')](_0x3804ae[_0xa9f2('0x2e')][_0xa9f2('0x38')]);_0x2595ec[_0xa9f2('0x3b')]=qs[_0xa9f2('0x30')](_['pick'](_0x3804ae['query'],_0x887d9f['filters']));if(_0x3804ae[_0xa9f2('0x2e')][_0xa9f2('0x3a')]){_0x2595ec[_0xa9f2('0x3b')]=_[_0xa9f2('0x3e')](_0x2595ec['where'],{'$or':_[_0xa9f2('0x3c')](_0x2595ec['attributes'],function(_0x51c021){var _0x3de3bb={};_0x3de3bb[_0x51c021]={'$like':'%'+_0x3804ae[_0xa9f2('0x2e')][_0xa9f2('0x3a')]+'%'};return _0x3de3bb;})});}_0x2595ec=_['merge']({},_0x2595ec,_0x3804ae[_0xa9f2('0x4b')]);return _0x25fee2[_0xa9f2('0x49')](_0x2595ec);}})['then'](function(_0x57c8fc){if(_0x57c8fc){_0x4ee84b=_0x57c8fc[_0xa9f2('0x34')];if(!_0x3804ae[_0xa9f2('0x2e')][_0xa9f2('0x35')](_0xa9f2('0x36'))){_0x2595ec['limit']=qs[_0xa9f2('0x1d')](_0x3804ae['query']['limit']);_0x2595ec[_0xa9f2('0x1b')]=qs['offset'](_0x3804ae[_0xa9f2('0x2e')][_0xa9f2('0x1b')]);}return _0x25fee2[_0xa9f2('0x49')](_0x2595ec);}})[_0xa9f2('0x23')](function(_0x412ad9){if(_0x412ad9){return _0x412ad9?{'count':_0x4ee84b,'rows':_0x412ad9}:null;}})['then'](respondWithResult(_0x3c2222,null))[_0xa9f2('0x42')](handleError(_0x3c2222,null));};exports['addConfiguration']=function(_0x22ac4e,_0x4fa278,_0x303f96){if(_0x22ac4e['body']['id']){delete _0x22ac4e[_0xa9f2('0x48')]['id'];}return db[_0xa9f2('0x45')][_0xa9f2('0x4c')]({'where':{'id':_0x22ac4e[_0xa9f2('0x44')]['id']}})[_0xa9f2('0x23')](handleEntityNotFound(_0x4fa278,null))[_0xa9f2('0x23')](function(_0x36d2b6){if(_0x36d2b6){_0x22ac4e['body'][_0xa9f2('0x4d')]=_0x36d2b6['id'];_0x22ac4e[_0xa9f2('0x48')]['Subjects']=integrations[_0xa9f2('0x4e')](_0x22ac4e[_0xa9f2('0x48')][_0xa9f2('0x4f')],_0x22ac4e[_0xa9f2('0x48')][_0xa9f2('0x2b')]);_0x22ac4e[_0xa9f2('0x48')]['Descriptions']=integrations[_0xa9f2('0x50')](_0x22ac4e[_0xa9f2('0x48')][_0xa9f2('0x4f')],_0x22ac4e['body'][_0xa9f2('0x2b')]);return db['SugarcrmConfiguration']['create'](_0x22ac4e['body'],{'include':[{'model':db[_0xa9f2('0x51')],'as':_0xa9f2('0x52')},{'model':db[_0xa9f2('0x51')],'as':_0xa9f2('0x53')}]});}return null;})[_0xa9f2('0x23')](respondWithResult(_0x4fa278,null))[_0xa9f2('0x42')](handleError(_0x4fa278,null));};exports[_0xa9f2('0x54')]=function(_0x3399cb,_0x13240f,_0x4a4639){var _0x193cb0='';var _0x306527=['id',_0xa9f2('0x27'),'assigned_user_id','created_by',_0xa9f2('0x55'),_0xa9f2('0x56'),_0xa9f2('0x57'),'duration_minutes','parent_id','parent_type',_0xa9f2('0x58'),_0xa9f2('0x59')];return db[_0xa9f2('0x45')][_0xa9f2('0x4c')]({'where':{'id':_0x3399cb['params']['id']},'attributes':['id',_0xa9f2('0x5a'),_0xa9f2('0x5b'),_0xa9f2('0x5c')]})[_0xa9f2('0x23')](handleEntityNotFound(_0x13240f,null))['then'](function(_0x41efed){if(_0x41efed){_0x193cb0=_0x41efed[_0xa9f2('0x5c')];var _0x1a1149=_0x193cb0[_0xa9f2('0x5d')](-0x1);if(_0x1a1149==='/'){_0x193cb0=_0x193cb0['substring'](0x0,_0x193cb0[_0xa9f2('0x5e')](_0x1a1149));}return rp({'method':_0xa9f2('0x5f'),'uri':util['format'](_0xa9f2('0x60'),_0x193cb0,_0xa9f2('0x61')),'json':!![],'form':{'method':_0xa9f2('0x62'),'input_type':_0xa9f2('0x63'),'response_type':_0xa9f2('0x63'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x41efed[_0xa9f2('0x5a')],'password':_0x41efed[_0xa9f2('0x5b')],'encryption':'PLAIN'},'application':_0xa9f2('0x64')})}});}})[_0xa9f2('0x23')](function(_0x2bdefd){if(_0x2bdefd&&_0x2bdefd[_0xa9f2('0x27')]!==_0xa9f2('0x65')&&_0x2bdefd['name']!==_0xa9f2('0x66')){return rp({'method':'POST','uri':util[_0xa9f2('0x67')]('%s%s',_0x193cb0,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xa9f2('0x63'),'response_type':_0xa9f2('0x63'),'rest_data':JSON[_0xa9f2('0x68')]({'session':_0x2bdefd['id'],'module_name':_0xa9f2('0x69')})}})[_0xa9f2('0x23')](function(_0x2875ab){if(_0x2875ab){var _0x4afadc=_[_0xa9f2('0x6a')](_0x2875ab[_0xa9f2('0x6b')]);_[_0xa9f2('0x6c')](_0x4afadc,function(_0x305a20){return _0x306527[_0xa9f2('0x6d')](_0x305a20['name']);});return{'count':_0x4afadc[_0xa9f2('0x34')],'rows':_[_0xa9f2('0x3c')](_0x4afadc,function(_0x368163){return{'id':_0x368163[_0xa9f2('0x27')],'name':_0x368163[_0xa9f2('0x6e')],'custom':_[_0xa9f2('0x6f')](_0x368163['name'],'_c')?!![]:![],'options':_0x368163[_0xa9f2('0x4b')]?_[_0xa9f2('0x3c')](_[_0xa9f2('0x6a')](_0x368163['options']),function(_0x1c1cd4){return{'name':_0x1c1cd4['value'],'value':_0x1c1cd4['name']};}):[]};})};}})['then'](respondWithResult(_0x13240f,null))['catch'](function(_0x5c6902){var _0x16d754=_0x3399cb[_0xa9f2('0x2e')][_0xa9f2('0x70')]?0x1f4:_0x5c6902[_0xa9f2('0x71')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xa9f2('0x54'),_0x16d754,JSON[_0xa9f2('0x68')](_0x5c6902));delete _0x5c6902[_0xa9f2('0x27')];if(_0x16d754===0x191){_0x16d754=0x190;}_0x13240f[_0xa9f2('0x19')](_0x16d754)[_0xa9f2('0x28')](_0x3399cb[_0xa9f2('0x2e')][_0xa9f2('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x5c6902[_0xa9f2('0x71')]}:_0x5c6902);});}else{var _0x254a3d=0x1f4;_0x13240f[_0xa9f2('0x19')](_0x254a3d)[_0xa9f2('0x28')]({'message':_0xa9f2('0x72'),'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 7471629..c7bcaa1 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 _0xefb7=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','lodash','util','../../config/logger','api','moment'];(function(_0x24670e,_0x203068){var _0x5ae617=function(_0x3c6907){while(--_0x3c6907){_0x24670e['push'](_0x24670e['shift']());}};_0x5ae617(++_0x203068);}(_0xefb7,0x14b));var _0x7efb=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0xefb7[_0x544099];return _0x20ab09;};'use strict';var _=require(_0x7efb('0x0'));var util=require(_0x7efb('0x1'));var logger=require(_0x7efb('0x2'))(_0x7efb('0x3'));var moment=require(_0x7efb('0x4'));var BPromise=require(_0x7efb('0x5'));var rp=require(_0x7efb('0x6'));var fs=require('fs');var path=require(_0x7efb('0x7'));var rimraf=require(_0x7efb('0x8'));var config=require(_0x7efb('0x9'));var attributes=require(_0x7efb('0xa'));var integrations=require(_0x7efb('0xb'));module['exports']=function(_0x92d049,_0x6bb752){return _0x92d049[_0x7efb('0xc')](_0x7efb('0xd'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5761=['util','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0x5761,0x107));var _0x1576=function(_0x1fc4e9,_0x3c03a8){_0x1fc4e9=_0x1fc4e9-0x0;var _0x1f3a74=_0x5761[_0x1fc4e9];return _0x1f3a74;};'use strict';var _=require(_0x1576('0x0'));var util=require(_0x1576('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1576('0x2'));var BPromise=require('bluebird');var rp=require(_0x1576('0x3'));var fs=require('fs');var path=require(_0x1576('0x4'));var rimraf=require(_0x1576('0x5'));var config=require(_0x1576('0x6'));var attributes=require(_0x1576('0x7'));var integrations=require(_0x1576('0x8'));module['exports']=function(_0x4dfdf5,_0x30f503){return _0x4dfdf5[_0x1576('0x9')](_0x1576('0xa'),attributes,{'tableName':_0x1576('0xb'),'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 1ab6438..b605a9d 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 _0xdd15=['raw','limit','include','map','model','attributes','GetSugarcrmAccount','debug','catch','find','where','ShowSugarcrmAccount','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','SugarcrmAccount','findAll','options'];(function(_0x580b4e,_0x14b6b4){var _0x1fb18a=function(_0x5ca1c6){while(--_0x5ca1c6){_0x580b4e['push'](_0x580b4e['shift']());}};_0x1fb18a(++_0x14b6b4);}(_0xdd15,0x198));var _0x5dd1=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xdd15[_0x354164];return _0x5db9a8;};'use strict';var _=require(_0x5dd1('0x0'));var util=require('util');var moment=require(_0x5dd1('0x1'));var BPromise=require(_0x5dd1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dd1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dd1('0x4'));var logger=require('../../config/logger')(_0x5dd1('0x5'));var config=require('../../config/environment');var jayson=require(_0x5dd1('0x6'));var client=jayson['client'][_0x5dd1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bf6e9,_0x21e308,_0x15f4bb){return new BPromise(function(_0x1cff3e,_0x23193d){return client[_0x5dd1('0x8')](_0x5bf6e9,_0x15f4bb)[_0x5dd1('0x9')](function(_0x21d5bf){logger[_0x5dd1('0xa')]('SugarcrmAccount,\x20%s,\x20%s',_0x21e308,_0x5dd1('0xb'));logger['debug'](_0x5dd1('0xc'),_0x21e308,_0x5dd1('0xb'),JSON[_0x5dd1('0xd')](_0x21d5bf));if(_0x21d5bf[_0x5dd1('0xe')]){if(_0x21d5bf[_0x5dd1('0xe')][_0x5dd1('0xf')]===0x1f4){logger[_0x5dd1('0xe')](_0x5dd1('0x10'),_0x21e308,_0x21d5bf['error'][_0x5dd1('0x11')]);return _0x23193d(_0x21d5bf[_0x5dd1('0xe')]['message']);}logger[_0x5dd1('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x21e308,_0x21d5bf['error'][_0x5dd1('0x11')]);return _0x1cff3e(_0x21d5bf[_0x5dd1('0xe')]['message']);}else{logger[_0x5dd1('0xa')](_0x5dd1('0x10'),_0x21e308,_0x5dd1('0xb'));_0x1cff3e(_0x21d5bf['result'][_0x5dd1('0x11')]);}})['catch'](function(_0x3768d6){logger[_0x5dd1('0xe')](_0x5dd1('0x10'),_0x21e308,_0x3768d6);_0x23193d(_0x3768d6);});});}exports['GetSugarcrmAccount']=function(_0x1c2b73){var _0x302f8e=this;return new Promise(function(_0x2b8c61,_0x198d1e){return db[_0x5dd1('0x12')][_0x5dd1('0x13')]({'raw':_0x1c2b73[_0x5dd1('0x14')]?_0x1c2b73[_0x5dd1('0x14')][_0x5dd1('0x15')]===undefined?!![]:![]:!![],'where':_0x1c2b73['options']?_0x1c2b73[_0x5dd1('0x14')]['where']||null:null,'attributes':_0x1c2b73[_0x5dd1('0x14')]?_0x1c2b73[_0x5dd1('0x14')]['attributes']||null:null,'limit':_0x1c2b73[_0x5dd1('0x14')]?_0x1c2b73[_0x5dd1('0x14')][_0x5dd1('0x16')]||null:null,'include':_0x1c2b73[_0x5dd1('0x14')]?_0x1c2b73[_0x5dd1('0x14')][_0x5dd1('0x17')]?_[_0x5dd1('0x18')](_0x1c2b73[_0x5dd1('0x14')]['include'],function(_0x11c2b8){return{'model':db[_0x11c2b8[_0x5dd1('0x19')]],'as':_0x11c2b8['as'],'attributes':_0x11c2b8[_0x5dd1('0x1a')],'include':_0x11c2b8['include']?_[_0x5dd1('0x18')](_0x11c2b8['include'],function(_0x56b271){return{'model':db[_0x56b271['model']],'as':_0x56b271['as'],'attributes':_0x56b271[_0x5dd1('0x1a')],'include':_0x56b271['include']?_[_0x5dd1('0x18')](_0x56b271[_0x5dd1('0x17')],function(_0x4b62e3){return{'model':db[_0x4b62e3[_0x5dd1('0x19')]],'as':_0x4b62e3['as'],'attributes':_0x4b62e3[_0x5dd1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5dd1('0x9')](function(_0x24c252){logger[_0x5dd1('0xa')](_0x5dd1('0x1b'),_0x1c2b73);logger[_0x5dd1('0x1c')](_0x5dd1('0x1b'),_0x1c2b73,JSON[_0x5dd1('0xd')](_0x24c252));_0x2b8c61(_0x24c252);})[_0x5dd1('0x1d')](function(_0x5b826b){logger['error'](_0x5dd1('0x1b'),_0x5b826b['message'],_0x1c2b73);_0x198d1e(_0x302f8e['error'](0x1f4,_0x5b826b[_0x5dd1('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x14eefd){var _0xd8d396=this;return new Promise(function(_0x26619b,_0x30491e){return db[_0x5dd1('0x12')][_0x5dd1('0x1e')]({'raw':_0x14eefd[_0x5dd1('0x14')]?_0x14eefd[_0x5dd1('0x14')][_0x5dd1('0x15')]===undefined?!![]:![]:!![],'where':_0x14eefd[_0x5dd1('0x14')]?_0x14eefd[_0x5dd1('0x14')][_0x5dd1('0x1f')]||null:null,'attributes':_0x14eefd[_0x5dd1('0x14')]?_0x14eefd[_0x5dd1('0x14')][_0x5dd1('0x1a')]||null:null,'include':_0x14eefd[_0x5dd1('0x14')]?_0x14eefd[_0x5dd1('0x14')][_0x5dd1('0x17')]?_[_0x5dd1('0x18')](_0x14eefd[_0x5dd1('0x14')][_0x5dd1('0x17')],function(_0x32a5ea){return{'model':db[_0x32a5ea[_0x5dd1('0x19')]],'as':_0x32a5ea['as'],'attributes':_0x32a5ea[_0x5dd1('0x1a')],'include':_0x32a5ea['include']?_[_0x5dd1('0x18')](_0x32a5ea[_0x5dd1('0x17')],function(_0x583ec7){return{'model':db[_0x583ec7[_0x5dd1('0x19')]],'as':_0x583ec7['as'],'attributes':_0x583ec7['attributes'],'include':_0x583ec7[_0x5dd1('0x17')]?_['map'](_0x583ec7[_0x5dd1('0x17')],function(_0x448c18){return{'model':db[_0x448c18[_0x5dd1('0x19')]],'as':_0x448c18['as'],'attributes':_0x448c18[_0x5dd1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ae95c){logger['info'](_0x5dd1('0x20'),_0x14eefd);logger[_0x5dd1('0x1c')](_0x5dd1('0x20'),_0x14eefd,JSON[_0x5dd1('0xd')](_0x3ae95c));_0x26619b(_0x3ae95c);})[_0x5dd1('0x1d')](function(_0x36f652){logger[_0x5dd1('0xe')](_0x5dd1('0x20'),_0x36f652[_0x5dd1('0x11')],_0x14eefd);_0x30491e(_0xd8d396['error'](0x1f4,_0x36f652[_0x5dd1('0x11')]));});});}; \ No newline at end of file +var _0xf4fe=['client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','attributes','limit','map','include','model','stringify','ShowSugarcrmAccount','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x223487,_0x357a09){var _0x4b0a8b=function(_0x296f6f){while(--_0x296f6f){_0x223487['push'](_0x223487['shift']());}};_0x4b0a8b(++_0x357a09);}(_0xf4fe,0x1bd));var _0xef4f=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xf4fe[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0xef4f('0x0'));var util=require(_0xef4f('0x1'));var moment=require(_0xef4f('0x2'));var BPromise=require(_0xef4f('0x3'));var rs=require(_0xef4f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef4f('0x5'))['db'];var utils=require(_0xef4f('0x6'));var logger=require('../../config/logger')(_0xef4f('0x7'));var config=require(_0xef4f('0x8'));var jayson=require(_0xef4f('0x9'));var client=jayson[_0xef4f('0xa')][_0xef4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x298778,_0x3c4243,_0xede1f5){return new BPromise(function(_0x33438c,_0x22db2e){return client[_0xef4f('0xc')](_0x298778,_0xede1f5)[_0xef4f('0xd')](function(_0x3f74cb){logger[_0xef4f('0xe')](_0xef4f('0xf'),_0x3c4243,_0xef4f('0x10'));logger[_0xef4f('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x3c4243,_0xef4f('0x10'),JSON['stringify'](_0x3f74cb));if(_0x3f74cb[_0xef4f('0x12')]){if(_0x3f74cb['error']['code']===0x1f4){logger[_0xef4f('0x12')](_0xef4f('0xf'),_0x3c4243,_0x3f74cb[_0xef4f('0x12')][_0xef4f('0x13')]);return _0x22db2e(_0x3f74cb[_0xef4f('0x12')][_0xef4f('0x13')]);}logger[_0xef4f('0x12')](_0xef4f('0xf'),_0x3c4243,_0x3f74cb[_0xef4f('0x12')][_0xef4f('0x13')]);return _0x33438c(_0x3f74cb['error'][_0xef4f('0x13')]);}else{logger[_0xef4f('0xe')](_0xef4f('0xf'),_0x3c4243,_0xef4f('0x10'));_0x33438c(_0x3f74cb[_0xef4f('0x14')][_0xef4f('0x13')]);}})[_0xef4f('0x15')](function(_0x2e11e7){logger[_0xef4f('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x3c4243,_0x2e11e7);_0x22db2e(_0x2e11e7);});});}exports[_0xef4f('0x16')]=function(_0x94f680){var _0x3b617b=this;return new Promise(function(_0x446a96,_0x229715){return db[_0xef4f('0x17')][_0xef4f('0x18')]({'raw':_0x94f680[_0xef4f('0x19')]?_0x94f680[_0xef4f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x94f680[_0xef4f('0x19')]?_0x94f680[_0xef4f('0x19')]['where']||null:null,'attributes':_0x94f680[_0xef4f('0x19')]?_0x94f680['options'][_0xef4f('0x1a')]||null:null,'limit':_0x94f680[_0xef4f('0x19')]?_0x94f680[_0xef4f('0x19')][_0xef4f('0x1b')]||null:null,'include':_0x94f680[_0xef4f('0x19')]?_0x94f680[_0xef4f('0x19')]['include']?_[_0xef4f('0x1c')](_0x94f680[_0xef4f('0x19')][_0xef4f('0x1d')],function(_0x12dd4c){return{'model':db[_0x12dd4c[_0xef4f('0x1e')]],'as':_0x12dd4c['as'],'attributes':_0x12dd4c[_0xef4f('0x1a')],'include':_0x12dd4c[_0xef4f('0x1d')]?_[_0xef4f('0x1c')](_0x12dd4c['include'],function(_0x4e3cbc){return{'model':db[_0x4e3cbc[_0xef4f('0x1e')]],'as':_0x4e3cbc['as'],'attributes':_0x4e3cbc['attributes'],'include':_0x4e3cbc[_0xef4f('0x1d')]?_[_0xef4f('0x1c')](_0x4e3cbc[_0xef4f('0x1d')],function(_0xcfb796){return{'model':db[_0xcfb796[_0xef4f('0x1e')]],'as':_0xcfb796['as'],'attributes':_0xcfb796[_0xef4f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xef4f('0xd')](function(_0x483ab3){logger[_0xef4f('0xe')](_0xef4f('0x16'),_0x94f680);logger['debug'](_0xef4f('0x16'),_0x94f680,JSON[_0xef4f('0x1f')](_0x483ab3));_0x446a96(_0x483ab3);})[_0xef4f('0x15')](function(_0xa57702){logger[_0xef4f('0x12')](_0xef4f('0x16'),_0xa57702[_0xef4f('0x13')],_0x94f680);_0x229715(_0x3b617b[_0xef4f('0x12')](0x1f4,_0xa57702[_0xef4f('0x13')]));});});};exports[_0xef4f('0x20')]=function(_0x255647){var _0x4ad25a=this;return new Promise(function(_0x36cff0,_0x52c7a4){return db['SugarcrmAccount']['find']({'raw':_0x255647[_0xef4f('0x19')]?_0x255647[_0xef4f('0x19')][_0xef4f('0x21')]===undefined?!![]:![]:!![],'where':_0x255647['options']?_0x255647['options'][_0xef4f('0x22')]||null:null,'attributes':_0x255647[_0xef4f('0x19')]?_0x255647[_0xef4f('0x19')][_0xef4f('0x1a')]||null:null,'include':_0x255647[_0xef4f('0x19')]?_0x255647[_0xef4f('0x19')][_0xef4f('0x1d')]?_[_0xef4f('0x1c')](_0x255647[_0xef4f('0x19')][_0xef4f('0x1d')],function(_0x5b6d1b){return{'model':db[_0x5b6d1b['model']],'as':_0x5b6d1b['as'],'attributes':_0x5b6d1b[_0xef4f('0x1a')],'include':_0x5b6d1b['include']?_['map'](_0x5b6d1b[_0xef4f('0x1d')],function(_0x45cf95){return{'model':db[_0x45cf95[_0xef4f('0x1e')]],'as':_0x45cf95['as'],'attributes':_0x45cf95[_0xef4f('0x1a')],'include':_0x45cf95[_0xef4f('0x1d')]?_['map'](_0x45cf95['include'],function(_0x1b7368){return{'model':db[_0x1b7368['model']],'as':_0x1b7368['as'],'attributes':_0x1b7368[_0xef4f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xef4f('0xd')](function(_0x3eb540){logger[_0xef4f('0xe')](_0xef4f('0x20'),_0x255647);logger[_0xef4f('0x11')]('ShowSugarcrmAccount',_0x255647,JSON[_0xef4f('0x1f')](_0x3eb540));_0x36cff0(_0x3eb540);})['catch'](function(_0x1578e7){logger[_0xef4f('0x12')](_0xef4f('0x20'),_0x1578e7[_0xef4f('0x13')],_0x255647);_0x52c7a4(_0x4ad25a[_0xef4f('0x12')](0x1f4,_0x1578e7['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index bb94057..46b912b 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 _0x6fdc=['../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','exports','multer','connect-timeout','express','fs-extra'];(function(_0x17ae99,_0x31ed00){var _0x12d52c=function(_0x3ec379){while(--_0x3ec379){_0x17ae99['push'](_0x17ae99['shift']());}};_0x12d52c(++_0x31ed00);}(_0x6fdc,0x1b1));var _0xc6fd=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0x6fdc[_0xbebf50];return _0xce1496;};'use strict';var multer=require(_0xc6fd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc6fd('0x1'));var express=require(_0xc6fd('0x2'));var router=express['Router']();var fs_extra=require(_0xc6fd('0x3'));var auth=require(_0xc6fd('0x4'));var interaction=require(_0xc6fd('0x5'));var config=require('../../config/environment');var controller=require(_0xc6fd('0x6'));router[_0xc6fd('0x7')]('/',auth[_0xc6fd('0x8')](),controller[_0xc6fd('0x9')]);router[_0xc6fd('0x7')]('/:id',auth[_0xc6fd('0x8')](),controller[_0xc6fd('0xa')]);router[_0xc6fd('0x7')](_0xc6fd('0xb'),auth[_0xc6fd('0x8')](),controller[_0xc6fd('0xc')]);router['get'](_0xc6fd('0xd'),auth[_0xc6fd('0x8')](),controller[_0xc6fd('0xe')]);router[_0xc6fd('0x7')](_0xc6fd('0xf'),auth[_0xc6fd('0x8')](),controller[_0xc6fd('0x10')]);router['post']('/',auth[_0xc6fd('0x8')](),controller[_0xc6fd('0x11')]);router[_0xc6fd('0x12')](_0xc6fd('0x13'),auth[_0xc6fd('0x8')](),controller[_0xc6fd('0x14')]);router[_0xc6fd('0x15')](_0xc6fd('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xc6fd('0x16')]=router; \ No newline at end of file +var _0x60d5=['../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getDescriptions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x60d5,0x113));var _0x560d=function(_0xc18ee4,_0x3afdd2){_0xc18ee4=_0xc18ee4-0x0;var _0x534c37=_0x60d5[_0xc18ee4];return _0x534c37;};'use strict';var multer=require(_0x560d('0x0'));var util=require(_0x560d('0x1'));var path=require(_0x560d('0x2'));var timeout=require(_0x560d('0x3'));var express=require('express');var router=express[_0x560d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x560d('0x5'));var controller=require(_0x560d('0x6'));router['get']('/',auth[_0x560d('0x7')](),controller[_0x560d('0x8')]);router[_0x560d('0x9')](_0x560d('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x560d('0xb'),auth[_0x560d('0x7')](),controller[_0x560d('0xc')]);router[_0x560d('0x9')](_0x560d('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x560d('0x9')]('/:id/descriptions',auth[_0x560d('0x7')](),controller[_0x560d('0xe')]);router['post']('/',auth[_0x560d('0x7')](),controller['create']);router[_0x560d('0xf')](_0x560d('0xa'),auth[_0x560d('0x7')](),controller[_0x560d('0x10')]);router[_0x560d('0x11')](_0x560d('0xa'),auth[_0x560d('0x7')](),controller[_0x560d('0x12')]);module[_0x560d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index c2e7894..d117328 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 _0x58e1=['exports','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58e1,0x179));var _0x158e=function(_0x3e0326,_0x137e73){_0x3e0326=_0x3e0326-0x0;var _0x12b5ac=_0x58e1[_0x3e0326];return _0x12b5ac;};'use strict';var Sequelize=require(_0x158e('0x0'));module[_0x158e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda0f=['STRING','sequelize','exports'];(function(_0x3d24fb,_0xbb541a){var _0x216f1e=function(_0x531407){while(--_0x531407){_0x3d24fb['push'](_0x3d24fb['shift']());}};_0x216f1e(++_0xbb541a);}(_0xda0f,0xca));var _0xfda0=function(_0x45bcb1,_0x46cad0){_0x45bcb1=_0x45bcb1-0x0;var _0x4bd6a3=_0xda0f[_0x45bcb1];return _0x4bd6a3;};'use strict';var Sequelize=require(_0xfda0('0x0'));module[_0xfda0('0x1')]={'name':{'type':Sequelize[_0xfda0('0x2')]},'description':{'type':Sequelize[_0xfda0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 7dd90a2..ca4ef22 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 _0x81c3=['findOne','SugarcrmField','length','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','getFields'];(function(_0x61d891,_0x8478d6){var _0x1c3b3b=function(_0x4b2e99){while(--_0x4b2e99){_0x61d891['push'](_0x61d891['shift']());}};_0x1c3b3b(++_0x8478d6);}(_0x81c3,0x1eb));var _0x381c=function(_0x431bd4,_0x28de66){_0x431bd4=_0x431bd4-0x0;var _0x533e8b=_0x81c3[_0x431bd4];return _0x533e8b;};'use strict';var emlformat=require(_0x381c('0x0'));var rimraf=require(_0x381c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x381c('0x2'));var rp=require(_0x381c('0x3'));var moment=require(_0x381c('0x4'));var BPromise=require(_0x381c('0x5'));var Mustache=require(_0x381c('0x6'));var util=require(_0x381c('0x7'));var path=require(_0x381c('0x8'));var sox=require(_0x381c('0x9'));var csv=require(_0x381c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x381c('0xb'));var squel=require(_0x381c('0xc'));var crypto=require(_0x381c('0xd'));var jsforce=require(_0x381c('0xe'));var deskjs=require(_0x381c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x381c('0x10'));var Papa=require(_0x381c('0x11'));var Redis=require(_0x381c('0x12'));var authService=require(_0x381c('0x13'));var qs=require(_0x381c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x381c('0x15'));var logger=require(_0x381c('0x16'))(_0x381c('0x17'));var utils=require('../../config/utils');var config=require(_0x381c('0x18'));var licenseUtil=require(_0x381c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ffbd2,_0x5cbcd2){_0x5cbcd2=_0x5cbcd2||0xcc;return function(_0x364449){if(_0x364449){return _0x3ffbd2[_0x381c('0x1a')](_0x5cbcd2);}return _0x3ffbd2[_0x381c('0x1b')](_0x5cbcd2)[_0x381c('0x1c')]();};}function respondWithResult(_0x2264e4,_0x36dea2){_0x36dea2=_0x36dea2||0xc8;return function(_0x4e0bda){if(_0x4e0bda){return _0x2264e4[_0x381c('0x1b')](_0x36dea2)['json'](_0x4e0bda);}};}function respondWithFilteredResult(_0x4b8be4,_0x3289ee){return function(_0x58290c){if(_0x58290c){var _0x503491=typeof _0x3289ee[_0x381c('0x1d')]===_0x381c('0x1e')&&typeof _0x3289ee[_0x381c('0x1f')]===_0x381c('0x1e');var _0x390f4a=_0x58290c[_0x381c('0x20')];var _0x4e131c=_0x503491?0x0:_0x3289ee[_0x381c('0x1d')];var _0x82c9f6=_0x503491?_0x58290c['count']:_0x3289ee['offset']+_0x3289ee[_0x381c('0x1f')];var _0x4c9d2d;if(_0x82c9f6>=_0x390f4a){_0x82c9f6=_0x390f4a;_0x4c9d2d=0xc8;}else{_0x4c9d2d=0xce;}_0x4b8be4[_0x381c('0x1b')](_0x4c9d2d);return _0x4b8be4['set'](_0x381c('0x21'),_0x4e131c+'-'+_0x82c9f6+'/'+_0x390f4a)[_0x381c('0x22')](_0x58290c);}return null;};}function patchUpdates(_0x428285){return function(_0xcf2d02){try{jsonpatch[_0x381c('0x23')](_0xcf2d02,_0x428285,!![]);}catch(_0x524999){return BPromise[_0x381c('0x24')](_0x524999);}return _0xcf2d02[_0x381c('0x25')]();};}function saveUpdates(_0x525088,_0x896ab5){return function(_0x235583){if(_0x235583){return _0x235583[_0x381c('0x26')](_0x525088)[_0x381c('0x27')](function(_0x4c6272){return _0x4c6272;});}return null;};}function removeEntity(_0x7027d5,_0x37ac92){return function(_0x29dec1){if(_0x29dec1){return _0x29dec1[_0x381c('0x28')]()[_0x381c('0x27')](function(){_0x7027d5[_0x381c('0x1b')](0xcc)[_0x381c('0x1c')]();});}};}function handleEntityNotFound(_0x52507a,_0x54d46c){return function(_0x14b097){if(!_0x14b097){_0x52507a[_0x381c('0x1a')](0x194);}return _0x14b097;};}function handleError(_0x43f526,_0x49b361){_0x49b361=_0x49b361||0x1f4;return function(_0xfd4a3f){logger[_0x381c('0x29')](_0xfd4a3f['stack']);if(_0xfd4a3f['name']){delete _0xfd4a3f[_0x381c('0x2a')];}_0x43f526['status'](_0x49b361)['send'](_0xfd4a3f);};}exports[_0x381c('0x2b')]=function(_0x5a02e4,_0x3f2681){var _0x2d09f3={},_0x38ea84={},_0x5f6e79={'count':0x0,'rows':[]};var _0x2f737d=_[_0x381c('0x2c')](db[_0x381c('0x2d')][_0x381c('0x2e')],function(_0x3ca694){return{'name':_0x3ca694[_0x381c('0x2f')],'type':_0x3ca694['type'][_0x381c('0x30')]};});_0x38ea84[_0x381c('0x31')]=_[_0x381c('0x2c')](_0x2f737d,'name');_0x38ea84[_0x381c('0x32')]=_[_0x381c('0x33')](_0x5a02e4[_0x381c('0x32')]);_0x38ea84[_0x381c('0x34')]=_['intersection'](_0x38ea84[_0x381c('0x31')],_0x38ea84[_0x381c('0x32')]);_0x2d09f3['attributes']=_[_0x381c('0x35')](_0x38ea84[_0x381c('0x31')],qs[_0x381c('0x36')](_0x5a02e4[_0x381c('0x32')][_0x381c('0x36')]));_0x2d09f3['attributes']=_0x2d09f3['attributes']['length']?_0x2d09f3[_0x381c('0x37')]:_0x38ea84[_0x381c('0x31')];if(!_0x5a02e4[_0x381c('0x32')][_0x381c('0x38')](_0x381c('0x39'))){_0x2d09f3['limit']=qs[_0x381c('0x1f')](_0x5a02e4[_0x381c('0x32')][_0x381c('0x1f')]);_0x2d09f3['offset']=qs[_0x381c('0x1d')](_0x5a02e4[_0x381c('0x32')][_0x381c('0x1d')]);}_0x2d09f3[_0x381c('0x3a')]=qs['sort'](_0x5a02e4[_0x381c('0x32')][_0x381c('0x3b')]);_0x2d09f3[_0x381c('0x3c')]=qs[_0x381c('0x34')](_[_0x381c('0x3d')](_0x5a02e4[_0x381c('0x32')],_0x38ea84[_0x381c('0x34')]),_0x2f737d);if(_0x5a02e4['query'][_0x381c('0x3e')]){_0x2d09f3[_0x381c('0x3c')]=_[_0x381c('0x3f')](_0x2d09f3[_0x381c('0x3c')],{'$or':_[_0x381c('0x2c')](_0x2f737d,function(_0x5f5dbe){if(_0x5f5dbe[_0x381c('0x40')]!==_0x381c('0x41')){var _0x2ba116={};_0x2ba116[_0x5f5dbe[_0x381c('0x2a')]]={'$like':'%'+_0x5a02e4[_0x381c('0x32')][_0x381c('0x3e')]+'%'};return _0x2ba116;}})});}_0x2d09f3=_['merge']({},_0x2d09f3,_0x5a02e4[_0x381c('0x42')]);var _0x561cc6={'where':_0x2d09f3['where']};return db[_0x381c('0x2d')][_0x381c('0x20')](_0x561cc6)[_0x381c('0x27')](function(_0x2ed903){_0x5f6e79[_0x381c('0x20')]=_0x2ed903;if(_0x5a02e4['query']['includeAll']){_0x2d09f3[_0x381c('0x43')]=[{'all':!![]}];}return db[_0x381c('0x2d')]['findAll'](_0x2d09f3);})[_0x381c('0x27')](function(_0x13a2a4){_0x5f6e79[_0x381c('0x44')]=_0x13a2a4;return _0x5f6e79;})[_0x381c('0x27')](respondWithFilteredResult(_0x3f2681,_0x2d09f3))[_0x381c('0x45')](handleError(_0x3f2681,null));};exports[_0x381c('0x46')]=function(_0x110d55,_0x44101e){var _0x5edab6={'raw':![],'where':{'id':_0x110d55[_0x381c('0x47')]['id']}},_0x5ecf24={};_0x5ecf24['model']=_['keys'](db['SugarcrmConfiguration'][_0x381c('0x2e')]);_0x5ecf24[_0x381c('0x32')]=_['keys'](_0x110d55['query']);_0x5ecf24[_0x381c('0x34')]=_['intersection'](_0x5ecf24[_0x381c('0x31')],_0x5ecf24[_0x381c('0x32')]);_0x5edab6['attributes']=_[_0x381c('0x35')](_0x5ecf24[_0x381c('0x31')],qs[_0x381c('0x36')](_0x110d55[_0x381c('0x32')][_0x381c('0x36')]));_0x5edab6['attributes']=_0x5edab6[_0x381c('0x37')]['length']?_0x5edab6[_0x381c('0x37')]:_0x5ecf24['model'];if(_0x110d55['query'][_0x381c('0x48')]){_0x5edab6[_0x381c('0x43')]=[{'all':!![]}];}_0x5edab6=_['merge']({},_0x5edab6,_0x110d55['options']);return db[_0x381c('0x2d')]['find'](_0x5edab6)[_0x381c('0x27')](handleEntityNotFound(_0x44101e,null))[_0x381c('0x27')](respondWithResult(_0x44101e,null))['catch'](handleError(_0x44101e,null));};exports[_0x381c('0x49')]=function(_0x4de753,_0x48c6d1){return db[_0x381c('0x2d')][_0x381c('0x49')](_0x4de753[_0x381c('0x4a')],{})['then'](respondWithResult(_0x48c6d1,0xc9))['catch'](handleError(_0x48c6d1,null));};exports[_0x381c('0x26')]=function(_0x50142d,_0x3a09cc){if(_0x50142d['body']['id']){delete _0x50142d['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x50142d[_0x381c('0x47')]['id']}})[_0x381c('0x27')](handleEntityNotFound(_0x3a09cc,null))[_0x381c('0x27')](saveUpdates(_0x50142d['body'],null))[_0x381c('0x27')](respondWithResult(_0x3a09cc,null))[_0x381c('0x45')](handleError(_0x3a09cc,null));};exports[_0x381c('0x28')]=function(_0x77a42,_0x4b7d39){return db[_0x381c('0x2d')]['find']({'where':{'id':_0x77a42[_0x381c('0x47')]['id']}})[_0x381c('0x27')](handleEntityNotFound(_0x4b7d39,null))[_0x381c('0x27')](removeEntity(_0x4b7d39,null))[_0x381c('0x45')](handleError(_0x4b7d39,null));};exports[_0x381c('0x4b')]=function(_0x275edf,_0x12a6cf,_0x1b7ecd){var _0x375522={};var _0x473602={};var _0xc42c9b;var _0x356a42;return db[_0x381c('0x2d')][_0x381c('0x4c')]({'where':{'id':_0x275edf['params']['id']}})[_0x381c('0x27')](handleEntityNotFound(_0x12a6cf,null))[_0x381c('0x27')](function(_0x1b930a){if(_0x1b930a){_0xc42c9b=_0x1b930a;_0x473602['model']=_[_0x381c('0x33')](db[_0x381c('0x4d')]['rawAttributes']);_0x473602['query']=_[_0x381c('0x33')](_0x275edf[_0x381c('0x32')]);_0x473602[_0x381c('0x34')]=_[_0x381c('0x35')](_0x473602[_0x381c('0x31')],_0x473602['query']);_0x375522[_0x381c('0x37')]=_['intersection'](_0x473602[_0x381c('0x31')],qs[_0x381c('0x36')](_0x275edf[_0x381c('0x32')]['fields']));_0x375522['attributes']=_0x375522[_0x381c('0x37')][_0x381c('0x4e')]?_0x375522[_0x381c('0x37')]:_0x473602[_0x381c('0x31')];_0x375522[_0x381c('0x3a')]=qs['sort'](_0x275edf['query']['sort']);_0x375522['where']=qs[_0x381c('0x34')](_['pick'](_0x275edf['query'],_0x473602['filters']));if(_0x275edf['query'][_0x381c('0x3e')]){_0x375522[_0x381c('0x3c')]=_[_0x381c('0x3f')](_0x375522[_0x381c('0x3c')],{'$or':_[_0x381c('0x2c')](_0x375522[_0x381c('0x37')],function(_0x9af794){var _0x55e05e={};_0x55e05e[_0x9af794]={'$like':'%'+_0x275edf[_0x381c('0x32')][_0x381c('0x3e')]+'%'};return _0x55e05e;})});}_0x375522=_[_0x381c('0x3f')]({},_0x375522,_0x275edf['options']);return _0xc42c9b[_0x381c('0x4b')](_0x375522);}})[_0x381c('0x27')](function(_0x19f14f){if(_0x19f14f){_0x356a42=_0x19f14f[_0x381c('0x4e')];if(!_0x275edf['query']['hasOwnProperty'](_0x381c('0x39'))){_0x375522[_0x381c('0x1f')]=qs[_0x381c('0x1f')](_0x275edf[_0x381c('0x32')][_0x381c('0x1f')]);_0x375522[_0x381c('0x1d')]=qs['offset'](_0x275edf[_0x381c('0x32')][_0x381c('0x1d')]);}return _0xc42c9b[_0x381c('0x4b')](_0x375522);}})[_0x381c('0x27')](function(_0x27c527){if(_0x27c527){return _0x27c527?{'count':_0x356a42,'rows':_0x27c527}:null;}})[_0x381c('0x27')](respondWithResult(_0x12a6cf,null))[_0x381c('0x45')](handleError(_0x12a6cf,null));};exports[_0x381c('0x4f')]=function(_0x4ba695,_0x593088,_0x598594){var _0x23042b={};var _0x1ea10c={};var _0x4fab3e;var _0x820d0f;return db[_0x381c('0x2d')][_0x381c('0x4c')]({'where':{'id':_0x4ba695[_0x381c('0x47')]['id']}})[_0x381c('0x27')](handleEntityNotFound(_0x593088,null))[_0x381c('0x27')](function(_0x3da18b){if(_0x3da18b){_0x4fab3e=_0x3da18b;_0x1ea10c['model']=_[_0x381c('0x33')](db['SugarcrmField']['rawAttributes']);_0x1ea10c[_0x381c('0x32')]=_[_0x381c('0x33')](_0x4ba695[_0x381c('0x32')]);_0x1ea10c[_0x381c('0x34')]=_[_0x381c('0x35')](_0x1ea10c[_0x381c('0x31')],_0x1ea10c['query']);_0x23042b[_0x381c('0x37')]=_['intersection'](_0x1ea10c[_0x381c('0x31')],qs[_0x381c('0x36')](_0x4ba695[_0x381c('0x32')][_0x381c('0x36')]));_0x23042b[_0x381c('0x37')]=_0x23042b[_0x381c('0x37')][_0x381c('0x4e')]?_0x23042b[_0x381c('0x37')]:_0x1ea10c[_0x381c('0x31')];_0x23042b[_0x381c('0x3a')]=qs[_0x381c('0x3b')](_0x4ba695[_0x381c('0x32')][_0x381c('0x3b')]);_0x23042b[_0x381c('0x3c')]=qs[_0x381c('0x34')](_[_0x381c('0x3d')](_0x4ba695[_0x381c('0x32')],_0x1ea10c[_0x381c('0x34')]));if(_0x4ba695[_0x381c('0x32')]['filter']){_0x23042b[_0x381c('0x3c')]=_[_0x381c('0x3f')](_0x23042b[_0x381c('0x3c')],{'$or':_['map'](_0x23042b[_0x381c('0x37')],function(_0x970e47){var _0x452dc9={};_0x452dc9[_0x970e47]={'$like':'%'+_0x4ba695[_0x381c('0x32')][_0x381c('0x3e')]+'%'};return _0x452dc9;})});}_0x23042b=_[_0x381c('0x3f')]({},_0x23042b,_0x4ba695[_0x381c('0x42')]);return _0x4fab3e[_0x381c('0x4f')](_0x23042b);}})['then'](function(_0x35a0be){if(_0x35a0be){_0x820d0f=_0x35a0be[_0x381c('0x4e')];if(!_0x4ba695[_0x381c('0x32')]['hasOwnProperty'](_0x381c('0x39'))){_0x23042b['limit']=qs['limit'](_0x4ba695[_0x381c('0x32')][_0x381c('0x1f')]);_0x23042b[_0x381c('0x1d')]=qs['offset'](_0x4ba695[_0x381c('0x32')][_0x381c('0x1d')]);}return _0x4fab3e[_0x381c('0x4f')](_0x23042b);}})[_0x381c('0x27')](function(_0x45d581){if(_0x45d581){return _0x45d581?{'count':_0x820d0f,'rows':_0x45d581}:null;}})[_0x381c('0x27')](respondWithResult(_0x593088,null))['catch'](handleError(_0x593088,null));};exports[_0x381c('0x50')]=function(_0x78521b,_0x4a638b,_0x54c86b){var _0x1d6113={};var _0x43fc91={};var _0x8328da;var _0x2f0ef1;return db[_0x381c('0x2d')]['findOne']({'where':{'id':_0x78521b[_0x381c('0x47')]['id']}})[_0x381c('0x27')](handleEntityNotFound(_0x4a638b,null))[_0x381c('0x27')](function(_0x2a740a){if(_0x2a740a){_0x8328da=_0x2a740a;_0x43fc91[_0x381c('0x31')]=_['keys'](db['SugarcrmField'][_0x381c('0x2e')]);_0x43fc91[_0x381c('0x32')]=_[_0x381c('0x33')](_0x78521b['query']);_0x43fc91['filters']=_[_0x381c('0x35')](_0x43fc91[_0x381c('0x31')],_0x43fc91['query']);_0x1d6113[_0x381c('0x37')]=_[_0x381c('0x35')](_0x43fc91[_0x381c('0x31')],qs[_0x381c('0x36')](_0x78521b[_0x381c('0x32')][_0x381c('0x36')]));_0x1d6113[_0x381c('0x37')]=_0x1d6113[_0x381c('0x37')][_0x381c('0x4e')]?_0x1d6113[_0x381c('0x37')]:_0x43fc91[_0x381c('0x31')];_0x1d6113[_0x381c('0x3a')]=qs[_0x381c('0x3b')](_0x78521b[_0x381c('0x32')]['sort']);_0x1d6113[_0x381c('0x3c')]=qs[_0x381c('0x34')](_['pick'](_0x78521b[_0x381c('0x32')],_0x43fc91['filters']));if(_0x78521b[_0x381c('0x32')]['filter']){_0x1d6113[_0x381c('0x3c')]=_[_0x381c('0x3f')](_0x1d6113[_0x381c('0x3c')],{'$or':_[_0x381c('0x2c')](_0x1d6113[_0x381c('0x37')],function(_0x5640b4){var _0x1aa9e0={};_0x1aa9e0[_0x5640b4]={'$like':'%'+_0x78521b[_0x381c('0x32')][_0x381c('0x3e')]+'%'};return _0x1aa9e0;})});}_0x1d6113=_[_0x381c('0x3f')]({},_0x1d6113,_0x78521b[_0x381c('0x42')]);return _0x8328da[_0x381c('0x50')](_0x1d6113);}})[_0x381c('0x27')](function(_0x5d4499){if(_0x5d4499){_0x2f0ef1=_0x5d4499[_0x381c('0x4e')];if(!_0x78521b[_0x381c('0x32')]['hasOwnProperty'](_0x381c('0x39'))){_0x1d6113[_0x381c('0x1f')]=qs['limit'](_0x78521b[_0x381c('0x32')][_0x381c('0x1f')]);_0x1d6113[_0x381c('0x1d')]=qs[_0x381c('0x1d')](_0x78521b[_0x381c('0x32')][_0x381c('0x1d')]);}return _0x8328da['getDescriptions'](_0x1d6113);}})[_0x381c('0x27')](function(_0xb14bd1){if(_0xb14bd1){return _0xb14bd1?{'count':_0x2f0ef1,'rows':_0xb14bd1}:null;}})[_0x381c('0x27')](respondWithResult(_0x4a638b,null))['catch'](handleError(_0x4a638b,null));}; \ No newline at end of file +var _0x78da=['count','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','filter','SugarcrmConfiguration','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','order','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x887f85,_0xbdb19){var _0x51d741=function(_0x14c326){while(--_0x14c326){_0x887f85['push'](_0x887f85['shift']());}};_0x51d741(++_0xbdb19);}(_0x78da,0x1c5));var _0xa78d=function(_0x9cb672,_0x4477db){_0x9cb672=_0x9cb672-0x0;var _0x3fa783=_0x78da[_0x9cb672];return _0x3fa783;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa78d('0x0'));var zipdir=require(_0xa78d('0x1'));var jsonpatch=require(_0xa78d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa78d('0x3'));var Mustache=require('mustache');var util=require(_0xa78d('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa78d('0x5'));var ejs=require(_0xa78d('0x6'));var fs=require('fs');var fs_extra=require(_0xa78d('0x7'));var _=require(_0xa78d('0x8'));var squel=require(_0xa78d('0x9'));var crypto=require(_0xa78d('0xa'));var jsforce=require(_0xa78d('0xb'));var deskjs=require(_0xa78d('0xc'));var toCsv=require(_0xa78d('0x5'));var querystring=require('querystring');var Papa=require(_0xa78d('0xd'));var Redis=require(_0xa78d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa78d('0xf'));var as=require(_0xa78d('0x10'));var hardwareService=require(_0xa78d('0x11'));var logger=require(_0xa78d('0x12'))(_0xa78d('0x13'));var utils=require('../../config/utils');var config=require(_0xa78d('0x14'));var licenseUtil=require(_0xa78d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb5f7,_0x5c74f3){_0x5c74f3=_0x5c74f3||0xcc;return function(_0x3a3821){if(_0x3a3821){return _0x2eb5f7[_0xa78d('0x16')](_0x5c74f3);}return _0x2eb5f7[_0xa78d('0x17')](_0x5c74f3)['end']();};}function respondWithResult(_0x328e6c,_0x37635d){_0x37635d=_0x37635d||0xc8;return function(_0x2ca503){if(_0x2ca503){return _0x328e6c[_0xa78d('0x17')](_0x37635d)[_0xa78d('0x18')](_0x2ca503);}};}function respondWithFilteredResult(_0x357f14,_0x3ec82a){return function(_0x54ef41){if(_0x54ef41){var _0x1ab04e=typeof _0x3ec82a[_0xa78d('0x19')]===_0xa78d('0x1a')&&typeof _0x3ec82a['limit']==='undefined';var _0x18bb4c=_0x54ef41[_0xa78d('0x1b')];var _0x54423f=_0x1ab04e?0x0:_0x3ec82a[_0xa78d('0x19')];var _0x3acca7=_0x1ab04e?_0x54ef41[_0xa78d('0x1b')]:_0x3ec82a[_0xa78d('0x19')]+_0x3ec82a[_0xa78d('0x1c')];var _0x557f65;if(_0x3acca7>=_0x18bb4c){_0x3acca7=_0x18bb4c;_0x557f65=0xc8;}else{_0x557f65=0xce;}_0x357f14[_0xa78d('0x17')](_0x557f65);return _0x357f14[_0xa78d('0x1d')](_0xa78d('0x1e'),_0x54423f+'-'+_0x3acca7+'/'+_0x18bb4c)[_0xa78d('0x18')](_0x54ef41);}return null;};}function patchUpdates(_0x8a791a){return function(_0x343d7e){try{jsonpatch[_0xa78d('0x1f')](_0x343d7e,_0x8a791a,!![]);}catch(_0x1fc67c){return BPromise['reject'](_0x1fc67c);}return _0x343d7e[_0xa78d('0x20')]();};}function saveUpdates(_0xde7a01,_0x1ffcdc){return function(_0x4c34de){if(_0x4c34de){return _0x4c34de[_0xa78d('0x21')](_0xde7a01)[_0xa78d('0x22')](function(_0xeff7ee){return _0xeff7ee;});}return null;};}function removeEntity(_0x2c4b07,_0x478fb3){return function(_0x34df13){if(_0x34df13){return _0x34df13[_0xa78d('0x23')]()[_0xa78d('0x22')](function(){_0x2c4b07[_0xa78d('0x17')](0xcc)[_0xa78d('0x24')]();});}};}function handleEntityNotFound(_0x26298f,_0x1d860e){return function(_0x5c8771){if(!_0x5c8771){_0x26298f['sendStatus'](0x194);}return _0x5c8771;};}function handleError(_0x152908,_0x1485ac){_0x1485ac=_0x1485ac||0x1f4;return function(_0x413c93){logger[_0xa78d('0x25')](_0x413c93[_0xa78d('0x26')]);if(_0x413c93['name']){delete _0x413c93[_0xa78d('0x27')];}_0x152908[_0xa78d('0x17')](_0x1485ac)[_0xa78d('0x28')](_0x413c93);};}exports[_0xa78d('0x29')]=function(_0x29be0b,_0x2877bd){var _0xd897a={},_0x37e3ae={},_0xde0eeb={'count':0x0,'rows':[]};var _0xf3401a=_[_0xa78d('0x2a')](db['SugarcrmConfiguration'][_0xa78d('0x2b')],function(_0x585b13){return{'name':_0x585b13[_0xa78d('0x2c')],'type':_0x585b13[_0xa78d('0x2d')][_0xa78d('0x2e')]};});_0x37e3ae['model']=_[_0xa78d('0x2a')](_0xf3401a,_0xa78d('0x27'));_0x37e3ae['query']=_[_0xa78d('0x2f')](_0x29be0b[_0xa78d('0x30')]);_0x37e3ae[_0xa78d('0x31')]=_[_0xa78d('0x32')](_0x37e3ae[_0xa78d('0x33')],_0x37e3ae[_0xa78d('0x30')]);_0xd897a['attributes']=_[_0xa78d('0x32')](_0x37e3ae[_0xa78d('0x33')],qs[_0xa78d('0x34')](_0x29be0b[_0xa78d('0x30')]['fields']));_0xd897a[_0xa78d('0x35')]=_0xd897a[_0xa78d('0x35')]['length']?_0xd897a[_0xa78d('0x35')]:_0x37e3ae[_0xa78d('0x33')];if(!_0x29be0b['query'][_0xa78d('0x36')](_0xa78d('0x37'))){_0xd897a[_0xa78d('0x1c')]=qs[_0xa78d('0x1c')](_0x29be0b[_0xa78d('0x30')][_0xa78d('0x1c')]);_0xd897a[_0xa78d('0x19')]=qs[_0xa78d('0x19')](_0x29be0b[_0xa78d('0x30')][_0xa78d('0x19')]);}_0xd897a['order']=qs[_0xa78d('0x38')](_0x29be0b[_0xa78d('0x30')][_0xa78d('0x38')]);_0xd897a[_0xa78d('0x39')]=qs['filters'](_[_0xa78d('0x3a')](_0x29be0b[_0xa78d('0x30')],_0x37e3ae[_0xa78d('0x31')]),_0xf3401a);if(_0x29be0b[_0xa78d('0x30')]['filter']){_0xd897a['where']=_[_0xa78d('0x3b')](_0xd897a[_0xa78d('0x39')],{'$or':_[_0xa78d('0x2a')](_0xf3401a,function(_0x4a9192){if(_0x4a9192[_0xa78d('0x2d')]!=='VIRTUAL'){var _0x4f898a={};_0x4f898a[_0x4a9192[_0xa78d('0x27')]]={'$like':'%'+_0x29be0b[_0xa78d('0x30')][_0xa78d('0x3c')]+'%'};return _0x4f898a;}})});}_0xd897a=_[_0xa78d('0x3b')]({},_0xd897a,_0x29be0b['options']);var _0x1126e3={'where':_0xd897a['where']};return db[_0xa78d('0x3d')][_0xa78d('0x1b')](_0x1126e3)['then'](function(_0x535dad){_0xde0eeb[_0xa78d('0x1b')]=_0x535dad;if(_0x29be0b[_0xa78d('0x30')][_0xa78d('0x3e')]){_0xd897a[_0xa78d('0x3f')]=[{'all':!![]}];}return db[_0xa78d('0x3d')][_0xa78d('0x40')](_0xd897a);})[_0xa78d('0x22')](function(_0x2175ab){_0xde0eeb[_0xa78d('0x41')]=_0x2175ab;return _0xde0eeb;})['then'](respondWithFilteredResult(_0x2877bd,_0xd897a))['catch'](handleError(_0x2877bd,null));};exports[_0xa78d('0x42')]=function(_0x25cfb0,_0x2024cd){var _0x38304a={'raw':![],'where':{'id':_0x25cfb0[_0xa78d('0x43')]['id']}},_0x36ca9b={};_0x36ca9b[_0xa78d('0x33')]=_[_0xa78d('0x2f')](db[_0xa78d('0x3d')]['rawAttributes']);_0x36ca9b[_0xa78d('0x30')]=_[_0xa78d('0x2f')](_0x25cfb0[_0xa78d('0x30')]);_0x36ca9b[_0xa78d('0x31')]=_['intersection'](_0x36ca9b['model'],_0x36ca9b[_0xa78d('0x30')]);_0x38304a[_0xa78d('0x35')]=_['intersection'](_0x36ca9b[_0xa78d('0x33')],qs[_0xa78d('0x34')](_0x25cfb0[_0xa78d('0x30')][_0xa78d('0x34')]));_0x38304a[_0xa78d('0x35')]=_0x38304a['attributes'][_0xa78d('0x44')]?_0x38304a['attributes']:_0x36ca9b[_0xa78d('0x33')];if(_0x25cfb0[_0xa78d('0x30')]['includeAll']){_0x38304a[_0xa78d('0x3f')]=[{'all':!![]}];}_0x38304a=_[_0xa78d('0x3b')]({},_0x38304a,_0x25cfb0[_0xa78d('0x45')]);return db[_0xa78d('0x3d')][_0xa78d('0x46')](_0x38304a)['then'](handleEntityNotFound(_0x2024cd,null))[_0xa78d('0x22')](respondWithResult(_0x2024cd,null))[_0xa78d('0x47')](handleError(_0x2024cd,null));};exports['create']=function(_0x43e1f,_0x137965){return db[_0xa78d('0x3d')][_0xa78d('0x48')](_0x43e1f[_0xa78d('0x49')],{})[_0xa78d('0x22')](respondWithResult(_0x137965,0xc9))[_0xa78d('0x47')](handleError(_0x137965,null));};exports[_0xa78d('0x21')]=function(_0xb41248,_0x1536bd){if(_0xb41248['body']['id']){delete _0xb41248[_0xa78d('0x49')]['id'];}return db[_0xa78d('0x3d')]['find']({'where':{'id':_0xb41248[_0xa78d('0x43')]['id']}})[_0xa78d('0x22')](handleEntityNotFound(_0x1536bd,null))[_0xa78d('0x22')](saveUpdates(_0xb41248[_0xa78d('0x49')],null))[_0xa78d('0x22')](respondWithResult(_0x1536bd,null))['catch'](handleError(_0x1536bd,null));};exports[_0xa78d('0x23')]=function(_0x202f3b,_0x56f44f){return db[_0xa78d('0x3d')][_0xa78d('0x46')]({'where':{'id':_0x202f3b[_0xa78d('0x43')]['id']}})['then'](handleEntityNotFound(_0x56f44f,null))['then'](removeEntity(_0x56f44f,null))[_0xa78d('0x47')](handleError(_0x56f44f,null));};exports[_0xa78d('0x4a')]=function(_0x370f4c,_0x267be1,_0x362daa){var _0x4dd284={};var _0x1617ee={};var _0x3ac187;var _0x2a9423;return db[_0xa78d('0x3d')][_0xa78d('0x4b')]({'where':{'id':_0x370f4c[_0xa78d('0x43')]['id']}})[_0xa78d('0x22')](handleEntityNotFound(_0x267be1,null))['then'](function(_0x1f0e21){if(_0x1f0e21){_0x3ac187=_0x1f0e21;_0x1617ee[_0xa78d('0x33')]=_[_0xa78d('0x2f')](db[_0xa78d('0x4c')][_0xa78d('0x2b')]);_0x1617ee[_0xa78d('0x30')]=_['keys'](_0x370f4c[_0xa78d('0x30')]);_0x1617ee[_0xa78d('0x31')]=_['intersection'](_0x1617ee['model'],_0x1617ee[_0xa78d('0x30')]);_0x4dd284[_0xa78d('0x35')]=_[_0xa78d('0x32')](_0x1617ee[_0xa78d('0x33')],qs[_0xa78d('0x34')](_0x370f4c[_0xa78d('0x30')][_0xa78d('0x34')]));_0x4dd284[_0xa78d('0x35')]=_0x4dd284[_0xa78d('0x35')][_0xa78d('0x44')]?_0x4dd284[_0xa78d('0x35')]:_0x1617ee[_0xa78d('0x33')];_0x4dd284['order']=qs[_0xa78d('0x38')](_0x370f4c[_0xa78d('0x30')][_0xa78d('0x38')]);_0x4dd284[_0xa78d('0x39')]=qs[_0xa78d('0x31')](_[_0xa78d('0x3a')](_0x370f4c[_0xa78d('0x30')],_0x1617ee['filters']));if(_0x370f4c['query'][_0xa78d('0x3c')]){_0x4dd284[_0xa78d('0x39')]=_[_0xa78d('0x3b')](_0x4dd284[_0xa78d('0x39')],{'$or':_[_0xa78d('0x2a')](_0x4dd284['attributes'],function(_0x4e3fb1){var _0x2c8b09={};_0x2c8b09[_0x4e3fb1]={'$like':'%'+_0x370f4c[_0xa78d('0x30')][_0xa78d('0x3c')]+'%'};return _0x2c8b09;})});}_0x4dd284=_[_0xa78d('0x3b')]({},_0x4dd284,_0x370f4c[_0xa78d('0x45')]);return _0x3ac187[_0xa78d('0x4a')](_0x4dd284);}})[_0xa78d('0x22')](function(_0x296d2d){if(_0x296d2d){_0x2a9423=_0x296d2d[_0xa78d('0x44')];if(!_0x370f4c[_0xa78d('0x30')][_0xa78d('0x36')](_0xa78d('0x37'))){_0x4dd284[_0xa78d('0x1c')]=qs['limit'](_0x370f4c[_0xa78d('0x30')][_0xa78d('0x1c')]);_0x4dd284[_0xa78d('0x19')]=qs['offset'](_0x370f4c[_0xa78d('0x30')][_0xa78d('0x19')]);}return _0x3ac187[_0xa78d('0x4a')](_0x4dd284);}})['then'](function(_0x48c57c){if(_0x48c57c){return _0x48c57c?{'count':_0x2a9423,'rows':_0x48c57c}:null;}})[_0xa78d('0x22')](respondWithResult(_0x267be1,null))[_0xa78d('0x47')](handleError(_0x267be1,null));};exports[_0xa78d('0x4d')]=function(_0x5d06ca,_0x18a72c,_0x1c816f){var _0x17bc68={};var _0x3c5bd2={};var _0xe1f9b8;var _0x540eb1;return db[_0xa78d('0x3d')][_0xa78d('0x4b')]({'where':{'id':_0x5d06ca[_0xa78d('0x43')]['id']}})['then'](handleEntityNotFound(_0x18a72c,null))[_0xa78d('0x22')](function(_0x244769){if(_0x244769){_0xe1f9b8=_0x244769;_0x3c5bd2['model']=_[_0xa78d('0x2f')](db['SugarcrmField']['rawAttributes']);_0x3c5bd2[_0xa78d('0x30')]=_[_0xa78d('0x2f')](_0x5d06ca['query']);_0x3c5bd2[_0xa78d('0x31')]=_[_0xa78d('0x32')](_0x3c5bd2['model'],_0x3c5bd2[_0xa78d('0x30')]);_0x17bc68[_0xa78d('0x35')]=_['intersection'](_0x3c5bd2['model'],qs['fields'](_0x5d06ca[_0xa78d('0x30')][_0xa78d('0x34')]));_0x17bc68[_0xa78d('0x35')]=_0x17bc68[_0xa78d('0x35')][_0xa78d('0x44')]?_0x17bc68['attributes']:_0x3c5bd2[_0xa78d('0x33')];_0x17bc68['order']=qs['sort'](_0x5d06ca['query'][_0xa78d('0x38')]);_0x17bc68[_0xa78d('0x39')]=qs[_0xa78d('0x31')](_['pick'](_0x5d06ca[_0xa78d('0x30')],_0x3c5bd2[_0xa78d('0x31')]));if(_0x5d06ca[_0xa78d('0x30')][_0xa78d('0x3c')]){_0x17bc68[_0xa78d('0x39')]=_[_0xa78d('0x3b')](_0x17bc68[_0xa78d('0x39')],{'$or':_[_0xa78d('0x2a')](_0x17bc68[_0xa78d('0x35')],function(_0x35873b){var _0x3026b9={};_0x3026b9[_0x35873b]={'$like':'%'+_0x5d06ca['query'][_0xa78d('0x3c')]+'%'};return _0x3026b9;})});}_0x17bc68=_[_0xa78d('0x3b')]({},_0x17bc68,_0x5d06ca[_0xa78d('0x45')]);return _0xe1f9b8[_0xa78d('0x4d')](_0x17bc68);}})[_0xa78d('0x22')](function(_0x2f3970){if(_0x2f3970){_0x540eb1=_0x2f3970[_0xa78d('0x44')];if(!_0x5d06ca[_0xa78d('0x30')][_0xa78d('0x36')](_0xa78d('0x37'))){_0x17bc68[_0xa78d('0x1c')]=qs[_0xa78d('0x1c')](_0x5d06ca['query']['limit']);_0x17bc68[_0xa78d('0x19')]=qs['offset'](_0x5d06ca[_0xa78d('0x30')][_0xa78d('0x19')]);}return _0xe1f9b8['getSubjects'](_0x17bc68);}})[_0xa78d('0x22')](function(_0x2387f4){if(_0x2387f4){return _0x2387f4?{'count':_0x540eb1,'rows':_0x2387f4}:null;}})[_0xa78d('0x22')](respondWithResult(_0x18a72c,null))[_0xa78d('0x47')](handleError(_0x18a72c,null));};exports[_0xa78d('0x4e')]=function(_0x18be44,_0x11a24b,_0x363399){var _0x5f1250={};var _0x358588={};var _0x47c5db;var _0x54390a;return db[_0xa78d('0x3d')][_0xa78d('0x4b')]({'where':{'id':_0x18be44['params']['id']}})['then'](handleEntityNotFound(_0x11a24b,null))['then'](function(_0x529956){if(_0x529956){_0x47c5db=_0x529956;_0x358588[_0xa78d('0x33')]=_['keys'](db[_0xa78d('0x4c')][_0xa78d('0x2b')]);_0x358588[_0xa78d('0x30')]=_[_0xa78d('0x2f')](_0x18be44['query']);_0x358588[_0xa78d('0x31')]=_[_0xa78d('0x32')](_0x358588['model'],_0x358588['query']);_0x5f1250[_0xa78d('0x35')]=_[_0xa78d('0x32')](_0x358588['model'],qs[_0xa78d('0x34')](_0x18be44[_0xa78d('0x30')][_0xa78d('0x34')]));_0x5f1250[_0xa78d('0x35')]=_0x5f1250[_0xa78d('0x35')]['length']?_0x5f1250[_0xa78d('0x35')]:_0x358588[_0xa78d('0x33')];_0x5f1250[_0xa78d('0x4f')]=qs[_0xa78d('0x38')](_0x18be44[_0xa78d('0x30')][_0xa78d('0x38')]);_0x5f1250[_0xa78d('0x39')]=qs[_0xa78d('0x31')](_[_0xa78d('0x3a')](_0x18be44[_0xa78d('0x30')],_0x358588[_0xa78d('0x31')]));if(_0x18be44[_0xa78d('0x30')]['filter']){_0x5f1250[_0xa78d('0x39')]=_[_0xa78d('0x3b')](_0x5f1250['where'],{'$or':_['map'](_0x5f1250[_0xa78d('0x35')],function(_0x12172f){var _0x328671={};_0x328671[_0x12172f]={'$like':'%'+_0x18be44[_0xa78d('0x30')][_0xa78d('0x3c')]+'%'};return _0x328671;})});}_0x5f1250=_[_0xa78d('0x3b')]({},_0x5f1250,_0x18be44['options']);return _0x47c5db[_0xa78d('0x4e')](_0x5f1250);}})[_0xa78d('0x22')](function(_0x2ee292){if(_0x2ee292){_0x54390a=_0x2ee292[_0xa78d('0x44')];if(!_0x18be44[_0xa78d('0x30')]['hasOwnProperty'](_0xa78d('0x37'))){_0x5f1250['limit']=qs[_0xa78d('0x1c')](_0x18be44[_0xa78d('0x30')][_0xa78d('0x1c')]);_0x5f1250[_0xa78d('0x19')]=qs[_0xa78d('0x19')](_0x18be44[_0xa78d('0x30')][_0xa78d('0x19')]);}return _0x47c5db[_0xa78d('0x4e')](_0x5f1250);}})[_0xa78d('0x22')](function(_0x3f1d2a){if(_0x3f1d2a){return _0x3f1d2a?{'count':_0x54390a,'rows':_0x3f1d2a}:null;}})[_0xa78d('0x22')](respondWithResult(_0x11a24b,null))[_0xa78d('0x47')](handleError(_0x11a24b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index a8c4cfc..301546d 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 _0x013b=['rimraf','../../config/environment','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36d8ff,_0x224895){var _0x906ef5=function(_0x2c21f1){while(--_0x2c21f1){_0x36d8ff['push'](_0x36d8ff['shift']());}};_0x906ef5(++_0x224895);}(_0x013b,0xa1));var _0xb013=function(_0x5211cd,_0x266b93){_0x5211cd=_0x5211cd-0x0;var _0x366c0f=_0x013b[_0x5211cd];return _0x366c0f;};'use strict';var _=require(_0xb013('0x0'));var util=require(_0xb013('0x1'));var logger=require(_0xb013('0x2'))(_0xb013('0x3'));var moment=require(_0xb013('0x4'));var BPromise=require(_0xb013('0x5'));var rp=require(_0xb013('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb013('0x7'));var config=require(_0xb013('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xb013('0x9')]=function(_0x4ea9cc,_0x1fef3b){return _0x4ea9cc[_0xb013('0xa')](_0xb013('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x609a=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x5374eb,_0x4e5e18){var _0x406a25=function(_0x3dfa42){while(--_0x3dfa42){_0x5374eb['push'](_0x5374eb['shift']());}};_0x406a25(++_0x4e5e18);}(_0x609a,0x11d));var _0xa609=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x609a[_0x432682];return _0x463d05;};'use strict';var _=require(_0xa609('0x0'));var util=require('util');var logger=require(_0xa609('0x1'))(_0xa609('0x2'));var moment=require(_0xa609('0x3'));var BPromise=require(_0xa609('0x4'));var rp=require(_0xa609('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa609('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xa609('0x7')]=function(_0x14991b,_0x351220){return _0x14991b[_0xa609('0x8')](_0xa609('0x9'),attributes,{'tableName':_0xa609('0xa'),'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 b23a68c..09986bf 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 _0x5536=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x69c6c3,_0x106bfe){var _0x5c69c5=function(_0xb4a8f9){while(--_0xb4a8f9){_0x69c6c3['push'](_0x69c6c3['shift']());}};_0x5c69c5(++_0x106bfe);}(_0x5536,0xce));var _0x6553=function(_0x6cba9c,_0x7d836){_0x6cba9c=_0x6cba9c-0x0;var _0x43f5ef=_0x5536[_0x6cba9c];return _0x43f5ef;};'use strict';var _=require('lodash');var util=require(_0x6553('0x0'));var moment=require('moment');var BPromise=require(_0x6553('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6553('0x2'));var db=require(_0x6553('0x3'))['db'];var utils=require(_0x6553('0x4'));var logger=require(_0x6553('0x5'))(_0x6553('0x6'));var config=require(_0x6553('0x7'));var jayson=require(_0x6553('0x8'));var client=jayson[_0x6553('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17a800,_0x3af3f6,_0x73f7eb){return new BPromise(function(_0x2ba03e,_0x3256b8){return client[_0x6553('0xa')](_0x17a800,_0x73f7eb)[_0x6553('0xb')](function(_0x1389b5){logger[_0x6553('0xc')](_0x6553('0xd'),_0x3af3f6,'request\x20sent');logger['debug'](_0x6553('0xe'),_0x3af3f6,_0x6553('0xf'),JSON['stringify'](_0x1389b5));if(_0x1389b5[_0x6553('0x10')]){if(_0x1389b5[_0x6553('0x10')][_0x6553('0x11')]===0x1f4){logger[_0x6553('0x10')](_0x6553('0xd'),_0x3af3f6,_0x1389b5['error'][_0x6553('0x12')]);return _0x3256b8(_0x1389b5[_0x6553('0x10')][_0x6553('0x12')]);}logger[_0x6553('0x10')](_0x6553('0xd'),_0x3af3f6,_0x1389b5[_0x6553('0x10')][_0x6553('0x12')]);return _0x2ba03e(_0x1389b5[_0x6553('0x10')]['message']);}else{logger[_0x6553('0xc')](_0x6553('0xd'),_0x3af3f6,_0x6553('0xf'));_0x2ba03e(_0x1389b5['result'][_0x6553('0x12')]);}})[_0x6553('0x13')](function(_0x4a4ba2){logger['error'](_0x6553('0xd'),_0x3af3f6,_0x4a4ba2);_0x3256b8(_0x4a4ba2);});});} \ No newline at end of file +var _0x6316=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x140cca,_0x5c092c){var _0x4dbcde=function(_0x37e079){while(--_0x37e079){_0x140cca['push'](_0x140cca['shift']());}};_0x4dbcde(++_0x5c092c);}(_0x6316,0x160));var _0x6631=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6316[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6631('0x0'));var util=require(_0x6631('0x1'));var moment=require(_0x6631('0x2'));var BPromise=require(_0x6631('0x3'));var rs=require(_0x6631('0x4'));var fs=require('fs');var Redis=require(_0x6631('0x5'));var db=require(_0x6631('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6631('0x7'))('rpc');var config=require(_0x6631('0x8'));var jayson=require(_0x6631('0x9'));var client=jayson['client'][_0x6631('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c736f,_0x2ecede,_0x5337d7){return new BPromise(function(_0xc4874c,_0x345cf2){return client[_0x6631('0xb')](_0x3c736f,_0x5337d7)[_0x6631('0xc')](function(_0x198f2a){logger[_0x6631('0xd')](_0x6631('0xe'),_0x2ecede,_0x6631('0xf'));logger[_0x6631('0x10')](_0x6631('0x11'),_0x2ecede,_0x6631('0xf'),JSON[_0x6631('0x12')](_0x198f2a));if(_0x198f2a[_0x6631('0x13')]){if(_0x198f2a[_0x6631('0x13')]['code']===0x1f4){logger[_0x6631('0x13')](_0x6631('0xe'),_0x2ecede,_0x198f2a[_0x6631('0x13')][_0x6631('0x14')]);return _0x345cf2(_0x198f2a[_0x6631('0x13')][_0x6631('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2ecede,_0x198f2a[_0x6631('0x13')][_0x6631('0x14')]);return _0xc4874c(_0x198f2a['error'][_0x6631('0x14')]);}else{logger['info'](_0x6631('0xe'),_0x2ecede,_0x6631('0xf'));_0xc4874c(_0x198f2a['result'][_0x6631('0x14')]);}})[_0x6631('0x15')](function(_0x598c79){logger['error'](_0x6631('0xe'),_0x2ecede,_0x598c79);_0x345cf2(_0x598c79);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f9c426f..32eae95 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 _0x80f6=['../../config/environment','./intSugarcrmField.controller','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x171f61,_0x54f704){var _0x57e026=function(_0x42440d){while(--_0x42440d){_0x171f61['push'](_0x171f61['shift']());}};_0x57e026(++_0x54f704);}(_0x80f6,0xac));var _0x680f=function(_0x3759ac,_0x3976b4){_0x3759ac=_0x3759ac-0x0;var _0x28ab15=_0x80f6[_0x3759ac];return _0x28ab15;};'use strict';var multer=require('multer');var util=require(_0x680f('0x0'));var path=require(_0x680f('0x1'));var timeout=require(_0x680f('0x2'));var express=require(_0x680f('0x3'));var router=express[_0x680f('0x4')]();var fs_extra=require(_0x680f('0x5'));var auth=require(_0x680f('0x6'));var interaction=require(_0x680f('0x7'));var config=require(_0x680f('0x8'));var controller=require(_0x680f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x680f('0xa')]);router['get']('/:id',auth[_0x680f('0xb')](),controller[_0x680f('0xc')]);router[_0x680f('0xd')]('/',auth[_0x680f('0xb')](),controller[_0x680f('0xe')]);router['put'](_0x680f('0xf'),auth[_0x680f('0xb')](),controller[_0x680f('0x10')]);router[_0x680f('0x11')]('/:id',auth[_0x680f('0xb')](),controller[_0x680f('0x12')]);module[_0x680f('0x13')]=router; \ No newline at end of file +var _0xba4d=['isAuthenticated','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','/:id','show'];(function(_0x30da2e,_0x146e54){var _0x794139=function(_0x25bd28){while(--_0x25bd28){_0x30da2e['push'](_0x30da2e['shift']());}};_0x794139(++_0x146e54);}(_0xba4d,0x104));var _0xdba4=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0xba4d[_0x4a5494];return _0x57cbb5;};'use strict';var multer=require(_0xdba4('0x0'));var util=require(_0xdba4('0x1'));var path=require(_0xdba4('0x2'));var timeout=require(_0xdba4('0x3'));var express=require(_0xdba4('0x4'));var router=express[_0xdba4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdba4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdba4('0x7'));var controller=require(_0xdba4('0x8'));router[_0xdba4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdba4('0x9')](_0xdba4('0xa'),auth['isAuthenticated'](),controller[_0xdba4('0xb')]);router['post']('/',auth[_0xdba4('0xc')](),controller[_0xdba4('0xd')]);router[_0xdba4('0xe')](_0xdba4('0xa'),auth[_0xdba4('0xc')](),controller['update']);router[_0xdba4('0xf')](_0xdba4('0xa'),auth[_0xdba4('0xc')](),controller['destroy']);module[_0xdba4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8698be4..4dc6172 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 _0x9bfe=['keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x232e7a,_0x19997){var _0x445ddd=function(_0x43628d){while(--_0x43628d){_0x232e7a['push'](_0x232e7a['shift']());}};_0x445ddd(++_0x19997);}(_0x9bfe,0x67));var _0xe9bf=function(_0x38f54f,_0x42abec){_0x38f54f=_0x38f54f-0x0;var _0xc4c37d=_0x9bfe[_0x38f54f];return _0xc4c37d;};'use strict';var Sequelize=require(_0xe9bf('0x0'));module['exports']={'type':{'type':Sequelize[_0xe9bf('0x1')](_0xe9bf('0x2'),_0xe9bf('0x3'),_0xe9bf('0x4'),_0xe9bf('0x5'),_0xe9bf('0x6')),'defaultValue':_0xe9bf('0x2')},'content':{'type':Sequelize[_0xe9bf('0x7')]},'key':{'type':Sequelize[_0xe9bf('0x7')]},'keyType':{'type':Sequelize[_0xe9bf('0x1')](_0xe9bf('0x2'),_0xe9bf('0x3'),_0xe9bf('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe9bf('0x7')]},'nameField':{'type':Sequelize[_0xe9bf('0x7')]},'customField':{'type':Sequelize[_0xe9bf('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9f8c=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x1b7fa4,_0x4185f8){var _0x18146d=function(_0xae4871){while(--_0xae4871){_0x1b7fa4['push'](_0x1b7fa4['shift']());}};_0x18146d(++_0x4185f8);}(_0x9f8c,0x171));var _0xc9f8=function(_0x1adef0,_0x18b835){_0x1adef0=_0x1adef0-0x0;var _0xe84e92=_0x9f8c[_0x1adef0];return _0xe84e92;};'use strict';var Sequelize=require(_0xc9f8('0x0'));module['exports']={'type':{'type':Sequelize[_0xc9f8('0x1')]('string','variable',_0xc9f8('0x2'),_0xc9f8('0x3'),_0xc9f8('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc9f8('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xc9f8('0x2'))},'keyContent':{'type':Sequelize[_0xc9f8('0x5')]},'idField':{'type':Sequelize[_0xc9f8('0x5')]},'nameField':{'type':Sequelize[_0xc9f8('0x5')]},'customField':{'type':Sequelize[_0xc9f8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc9f8('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 55cdbc6..c4c3acf 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 _0x450e=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','SugarcrmField','findAll','catch','options','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x450e,0x174));var _0xe450=function(_0x3f79f2,_0x3ab4b7){_0x3f79f2=_0x3f79f2-0x0;var _0x21fa23=_0x450e[_0x3f79f2];return _0x21fa23;};'use strict';var emlformat=require(_0xe450('0x0'));var rimraf=require(_0xe450('0x1'));var zipdir=require(_0xe450('0x2'));var jsonpatch=require(_0xe450('0x3'));var rp=require(_0xe450('0x4'));var moment=require(_0xe450('0x5'));var BPromise=require(_0xe450('0x6'));var Mustache=require(_0xe450('0x7'));var util=require(_0xe450('0x8'));var path=require(_0xe450('0x9'));var sox=require('sox');var csv=require(_0xe450('0xa'));var ejs=require(_0xe450('0xb'));var fs=require('fs');var fs_extra=require(_0xe450('0xc'));var _=require(_0xe450('0xd'));var squel=require(_0xe450('0xe'));var crypto=require(_0xe450('0xf'));var jsforce=require(_0xe450('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe450('0xa'));var querystring=require(_0xe450('0x11'));var Papa=require(_0xe450('0x12'));var Redis=require(_0xe450('0x13'));var authService=require(_0xe450('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe450('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe450('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe450('0x17'));var db=require(_0xe450('0x18'))['db'];function respondWithStatusCode(_0x476f21,_0x5b3a67){_0x5b3a67=_0x5b3a67||0xcc;return function(_0x34fc18){if(_0x34fc18){return _0x476f21['sendStatus'](_0x5b3a67);}return _0x476f21[_0xe450('0x19')](_0x5b3a67)[_0xe450('0x1a')]();};}function respondWithResult(_0x2381fe,_0x1da31d){_0x1da31d=_0x1da31d||0xc8;return function(_0x3adc07){if(_0x3adc07){return _0x2381fe[_0xe450('0x19')](_0x1da31d)[_0xe450('0x1b')](_0x3adc07);}};}function respondWithFilteredResult(_0x3d5284,_0x557236){return function(_0x43e791){if(_0x43e791){var _0x38aef3=typeof _0x557236[_0xe450('0x1c')]===_0xe450('0x1d')&&typeof _0x557236[_0xe450('0x1e')]==='undefined';var _0x28fb3c=_0x43e791[_0xe450('0x1f')];var _0x493f52=_0x38aef3?0x0:_0x557236[_0xe450('0x1c')];var _0x5e902b=_0x38aef3?_0x43e791[_0xe450('0x1f')]:_0x557236[_0xe450('0x1c')]+_0x557236[_0xe450('0x1e')];var _0x3524fc;if(_0x5e902b>=_0x28fb3c){_0x5e902b=_0x28fb3c;_0x3524fc=0xc8;}else{_0x3524fc=0xce;}_0x3d5284[_0xe450('0x19')](_0x3524fc);return _0x3d5284['set']('Content-Range',_0x493f52+'-'+_0x5e902b+'/'+_0x28fb3c)['json'](_0x43e791);}return null;};}function patchUpdates(_0x576a0e){return function(_0x2cba9d){try{jsonpatch[_0xe450('0x20')](_0x2cba9d,_0x576a0e,!![]);}catch(_0x19f88e){return BPromise['reject'](_0x19f88e);}return _0x2cba9d[_0xe450('0x21')]();};}function saveUpdates(_0x566144,_0x56d71a){return function(_0x324624){if(_0x324624){return _0x324624[_0xe450('0x22')](_0x566144)[_0xe450('0x23')](function(_0x37e79c){return _0x37e79c;});}return null;};}function removeEntity(_0x406ade,_0x3e0945){return function(_0xf0222){if(_0xf0222){return _0xf0222['destroy']()['then'](function(){_0x406ade[_0xe450('0x19')](0xcc)[_0xe450('0x1a')]();});}};}function handleEntityNotFound(_0x5a4342,_0x11447a){return function(_0x1bce54){if(!_0x1bce54){_0x5a4342[_0xe450('0x24')](0x194);}return _0x1bce54;};}function handleError(_0x30d4b6,_0x4a34ee){_0x4a34ee=_0x4a34ee||0x1f4;return function(_0xd2d508){logger[_0xe450('0x25')](_0xd2d508[_0xe450('0x26')]);if(_0xd2d508[_0xe450('0x27')]){delete _0xd2d508[_0xe450('0x27')];}_0x30d4b6[_0xe450('0x19')](_0x4a34ee)[_0xe450('0x28')](_0xd2d508);};}exports[_0xe450('0x29')]=function(_0x39fd3f,_0x20f2b6){var _0x79cbb0={},_0x40dcc7={},_0x38e467={'count':0x0,'rows':[]};var _0x215ae2=_[_0xe450('0x2a')](db['SugarcrmField'][_0xe450('0x2b')],function(_0x14cd31){return{'name':_0x14cd31[_0xe450('0x2c')],'type':_0x14cd31[_0xe450('0x2d')][_0xe450('0x2e')]};});_0x40dcc7[_0xe450('0x2f')]=_[_0xe450('0x2a')](_0x215ae2,_0xe450('0x27'));_0x40dcc7[_0xe450('0x30')]=_[_0xe450('0x31')](_0x39fd3f[_0xe450('0x30')]);_0x40dcc7[_0xe450('0x32')]=_[_0xe450('0x33')](_0x40dcc7[_0xe450('0x2f')],_0x40dcc7[_0xe450('0x30')]);_0x79cbb0[_0xe450('0x34')]=_[_0xe450('0x33')](_0x40dcc7[_0xe450('0x2f')],qs['fields'](_0x39fd3f[_0xe450('0x30')][_0xe450('0x35')]));_0x79cbb0[_0xe450('0x34')]=_0x79cbb0[_0xe450('0x34')]['length']?_0x79cbb0[_0xe450('0x34')]:_0x40dcc7['model'];if(!_0x39fd3f[_0xe450('0x30')][_0xe450('0x36')](_0xe450('0x37'))){_0x79cbb0['limit']=qs['limit'](_0x39fd3f[_0xe450('0x30')][_0xe450('0x1e')]);_0x79cbb0[_0xe450('0x1c')]=qs[_0xe450('0x1c')](_0x39fd3f[_0xe450('0x30')][_0xe450('0x1c')]);}_0x79cbb0[_0xe450('0x38')]=qs[_0xe450('0x39')](_0x39fd3f[_0xe450('0x30')][_0xe450('0x39')]);_0x79cbb0[_0xe450('0x3a')]=qs[_0xe450('0x32')](_['pick'](_0x39fd3f['query'],_0x40dcc7[_0xe450('0x32')]),_0x215ae2);if(_0x39fd3f[_0xe450('0x30')][_0xe450('0x3b')]){_0x79cbb0[_0xe450('0x3a')]=_[_0xe450('0x3c')](_0x79cbb0[_0xe450('0x3a')],{'$or':_[_0xe450('0x2a')](_0x215ae2,function(_0xa94a81){if(_0xa94a81[_0xe450('0x2d')]!==_0xe450('0x3d')){var _0x3e3d4b={};_0x3e3d4b[_0xa94a81[_0xe450('0x27')]]={'$like':'%'+_0x39fd3f[_0xe450('0x30')]['filter']+'%'};return _0x3e3d4b;}})});}_0x79cbb0=_[_0xe450('0x3c')]({},_0x79cbb0,_0x39fd3f['options']);var _0x299262={'where':_0x79cbb0[_0xe450('0x3a')]};return db['SugarcrmField']['count'](_0x299262)[_0xe450('0x23')](function(_0x2b06d8){_0x38e467[_0xe450('0x1f')]=_0x2b06d8;if(_0x39fd3f['query'][_0xe450('0x3e')]){_0x79cbb0[_0xe450('0x3f')]=[{'all':!![]}];}return db[_0xe450('0x40')][_0xe450('0x41')](_0x79cbb0);})[_0xe450('0x23')](function(_0x312d38){_0x38e467['rows']=_0x312d38;return _0x38e467;})[_0xe450('0x23')](respondWithFilteredResult(_0x20f2b6,_0x79cbb0))[_0xe450('0x42')](handleError(_0x20f2b6,null));};exports['show']=function(_0x44188a,_0x1a8ec7){var _0x203ed2={'raw':!![],'where':{'id':_0x44188a['params']['id']}},_0x335dbe={};_0x335dbe[_0xe450('0x2f')]=_[_0xe450('0x31')](db[_0xe450('0x40')][_0xe450('0x2b')]);_0x335dbe[_0xe450('0x30')]=_[_0xe450('0x31')](_0x44188a[_0xe450('0x30')]);_0x335dbe[_0xe450('0x32')]=_[_0xe450('0x33')](_0x335dbe['model'],_0x335dbe[_0xe450('0x30')]);_0x203ed2[_0xe450('0x34')]=_[_0xe450('0x33')](_0x335dbe[_0xe450('0x2f')],qs['fields'](_0x44188a[_0xe450('0x30')][_0xe450('0x35')]));_0x203ed2['attributes']=_0x203ed2['attributes']['length']?_0x203ed2[_0xe450('0x34')]:_0x335dbe[_0xe450('0x2f')];if(_0x44188a[_0xe450('0x30')][_0xe450('0x3e')]){_0x203ed2[_0xe450('0x3f')]=[{'all':!![]}];}_0x203ed2=_['merge']({},_0x203ed2,_0x44188a[_0xe450('0x43')]);return db['SugarcrmField']['find'](_0x203ed2)[_0xe450('0x23')](handleEntityNotFound(_0x1a8ec7,null))['then'](respondWithResult(_0x1a8ec7,null))[_0xe450('0x42')](handleError(_0x1a8ec7,null));};exports[_0xe450('0x44')]=function(_0x32f9f0,_0x1d0e2d){return db[_0xe450('0x40')][_0xe450('0x44')](_0x32f9f0[_0xe450('0x45')],{})[_0xe450('0x23')](respondWithResult(_0x1d0e2d,0xc9))[_0xe450('0x42')](handleError(_0x1d0e2d,null));};exports[_0xe450('0x22')]=function(_0x3bc52e,_0x2fa6f1){if(_0x3bc52e[_0xe450('0x45')]['id']){delete _0x3bc52e['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x3bc52e[_0xe450('0x46')]['id']}})[_0xe450('0x23')](handleEntityNotFound(_0x2fa6f1,null))[_0xe450('0x23')](saveUpdates(_0x3bc52e[_0xe450('0x45')],null))[_0xe450('0x23')](respondWithResult(_0x2fa6f1,null))[_0xe450('0x42')](handleError(_0x2fa6f1,null));};exports['destroy']=function(_0x1f1acf,_0x1f9a5c){return db['SugarcrmField']['find']({'where':{'id':_0x1f1acf[_0xe450('0x46')]['id']}})[_0xe450('0x23')](handleEntityNotFound(_0x1f9a5c,null))[_0xe450('0x23')](removeEntity(_0x1f9a5c,null))[_0xe450('0x42')](handleError(_0x1f9a5c,null));}; \ No newline at end of file +var _0x0520=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','include','findAll','rows','catch','params','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','model','keys','query'];(function(_0x17ac77,_0x6e0ea){var _0x3cac8f=function(_0x2232db){while(--_0x2232db){_0x17ac77['push'](_0x17ac77['shift']());}};_0x3cac8f(++_0x6e0ea);}(_0x0520,0x1ce));var _0x0052=function(_0x4243aa,_0x208384){_0x4243aa=_0x4243aa-0x0;var _0x2582b6=_0x0520[_0x4243aa];return _0x2582b6;};'use strict';var emlformat=require(_0x0052('0x0'));var rimraf=require(_0x0052('0x1'));var zipdir=require(_0x0052('0x2'));var jsonpatch=require(_0x0052('0x3'));var rp=require(_0x0052('0x4'));var moment=require('moment');var BPromise=require(_0x0052('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0052('0x6'));var sox=require(_0x0052('0x7'));var csv=require(_0x0052('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0052('0x9'));var _=require(_0x0052('0xa'));var squel=require(_0x0052('0xb'));var crypto=require('crypto');var jsforce=require(_0x0052('0xc'));var deskjs=require(_0x0052('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0052('0xe'));var Papa=require(_0x0052('0xf'));var Redis=require(_0x0052('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0052('0x11'));var hardwareService=require(_0x0052('0x12'));var logger=require(_0x0052('0x13'))(_0x0052('0x14'));var utils=require('../../config/utils');var config=require(_0x0052('0x15'));var licenseUtil=require(_0x0052('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21927c,_0x199e16){_0x199e16=_0x199e16||0xcc;return function(_0xb2405a){if(_0xb2405a){return _0x21927c[_0x0052('0x17')](_0x199e16);}return _0x21927c[_0x0052('0x18')](_0x199e16)['end']();};}function respondWithResult(_0x38ea05,_0x1a3e0d){_0x1a3e0d=_0x1a3e0d||0xc8;return function(_0x1add00){if(_0x1add00){return _0x38ea05[_0x0052('0x18')](_0x1a3e0d)[_0x0052('0x19')](_0x1add00);}};}function respondWithFilteredResult(_0x20bfac,_0xf4cd24){return function(_0x2166e1){if(_0x2166e1){var _0x4490c7=typeof _0xf4cd24[_0x0052('0x1a')]===_0x0052('0x1b')&&typeof _0xf4cd24[_0x0052('0x1c')]===_0x0052('0x1b');var _0x47145f=_0x2166e1['count'];var _0x5e5bec=_0x4490c7?0x0:_0xf4cd24[_0x0052('0x1a')];var _0x20210e=_0x4490c7?_0x2166e1[_0x0052('0x1d')]:_0xf4cd24[_0x0052('0x1a')]+_0xf4cd24[_0x0052('0x1c')];var _0x30cd36;if(_0x20210e>=_0x47145f){_0x20210e=_0x47145f;_0x30cd36=0xc8;}else{_0x30cd36=0xce;}_0x20bfac[_0x0052('0x18')](_0x30cd36);return _0x20bfac[_0x0052('0x1e')](_0x0052('0x1f'),_0x5e5bec+'-'+_0x20210e+'/'+_0x47145f)[_0x0052('0x19')](_0x2166e1);}return null;};}function patchUpdates(_0x143d21){return function(_0x570d08){try{jsonpatch[_0x0052('0x20')](_0x570d08,_0x143d21,!![]);}catch(_0x558110){return BPromise[_0x0052('0x21')](_0x558110);}return _0x570d08[_0x0052('0x22')]();};}function saveUpdates(_0x3d4ebc,_0x20a9b4){return function(_0x5e7e4a){if(_0x5e7e4a){return _0x5e7e4a[_0x0052('0x23')](_0x3d4ebc)[_0x0052('0x24')](function(_0x3ffaf9){return _0x3ffaf9;});}return null;};}function removeEntity(_0x1f2e1f,_0x427e84){return function(_0x2ed67a){if(_0x2ed67a){return _0x2ed67a[_0x0052('0x25')]()[_0x0052('0x24')](function(){_0x1f2e1f[_0x0052('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bb1b,_0x1434ff){return function(_0x409863){if(!_0x409863){_0x11bb1b[_0x0052('0x17')](0x194);}return _0x409863;};}function handleError(_0x5db0ff,_0x3b4094){_0x3b4094=_0x3b4094||0x1f4;return function(_0x3471d6){logger[_0x0052('0x26')](_0x3471d6['stack']);if(_0x3471d6[_0x0052('0x27')]){delete _0x3471d6['name'];}_0x5db0ff['status'](_0x3b4094)[_0x0052('0x28')](_0x3471d6);};}exports[_0x0052('0x29')]=function(_0x2cb536,_0x5d6ff4){var _0x1766ed={},_0xb409fd={},_0x46f043={'count':0x0,'rows':[]};var _0x31c459=_[_0x0052('0x2a')](db[_0x0052('0x2b')][_0x0052('0x2c')],function(_0x4c2f84){return{'name':_0x4c2f84[_0x0052('0x2d')],'type':_0x4c2f84['type']['key']};});_0xb409fd[_0x0052('0x2e')]=_[_0x0052('0x2a')](_0x31c459,_0x0052('0x27'));_0xb409fd['query']=_[_0x0052('0x2f')](_0x2cb536[_0x0052('0x30')]);_0xb409fd['filters']=_[_0x0052('0x31')](_0xb409fd[_0x0052('0x2e')],_0xb409fd[_0x0052('0x30')]);_0x1766ed['attributes']=_[_0x0052('0x31')](_0xb409fd[_0x0052('0x2e')],qs['fields'](_0x2cb536['query'][_0x0052('0x32')]));_0x1766ed[_0x0052('0x33')]=_0x1766ed[_0x0052('0x33')][_0x0052('0x34')]?_0x1766ed[_0x0052('0x33')]:_0xb409fd['model'];if(!_0x2cb536[_0x0052('0x30')][_0x0052('0x35')](_0x0052('0x36'))){_0x1766ed[_0x0052('0x1c')]=qs[_0x0052('0x1c')](_0x2cb536['query'][_0x0052('0x1c')]);_0x1766ed[_0x0052('0x1a')]=qs[_0x0052('0x1a')](_0x2cb536[_0x0052('0x30')]['offset']);}_0x1766ed[_0x0052('0x37')]=qs[_0x0052('0x38')](_0x2cb536[_0x0052('0x30')][_0x0052('0x38')]);_0x1766ed[_0x0052('0x39')]=qs[_0x0052('0x3a')](_['pick'](_0x2cb536[_0x0052('0x30')],_0xb409fd[_0x0052('0x3a')]),_0x31c459);if(_0x2cb536['query'][_0x0052('0x3b')]){_0x1766ed[_0x0052('0x39')]=_[_0x0052('0x3c')](_0x1766ed[_0x0052('0x39')],{'$or':_['map'](_0x31c459,function(_0x2d7792){if(_0x2d7792[_0x0052('0x3d')]!==_0x0052('0x3e')){var _0x3a929e={};_0x3a929e[_0x2d7792['name']]={'$like':'%'+_0x2cb536[_0x0052('0x30')][_0x0052('0x3b')]+'%'};return _0x3a929e;}})});}_0x1766ed=_[_0x0052('0x3c')]({},_0x1766ed,_0x2cb536['options']);var _0x46e38e={'where':_0x1766ed[_0x0052('0x39')]};return db[_0x0052('0x2b')][_0x0052('0x1d')](_0x46e38e)[_0x0052('0x24')](function(_0x16de6b){_0x46f043['count']=_0x16de6b;if(_0x2cb536[_0x0052('0x30')]['includeAll']){_0x1766ed[_0x0052('0x3f')]=[{'all':!![]}];}return db['SugarcrmField'][_0x0052('0x40')](_0x1766ed);})[_0x0052('0x24')](function(_0x4056b2){_0x46f043[_0x0052('0x41')]=_0x4056b2;return _0x46f043;})['then'](respondWithFilteredResult(_0x5d6ff4,_0x1766ed))[_0x0052('0x42')](handleError(_0x5d6ff4,null));};exports['show']=function(_0x11c096,_0x62931e){var _0x27ffaf={'raw':!![],'where':{'id':_0x11c096[_0x0052('0x43')]['id']}},_0x57e91c={};_0x57e91c['model']=_[_0x0052('0x2f')](db[_0x0052('0x2b')][_0x0052('0x2c')]);_0x57e91c['query']=_[_0x0052('0x2f')](_0x11c096['query']);_0x57e91c[_0x0052('0x3a')]=_['intersection'](_0x57e91c[_0x0052('0x2e')],_0x57e91c[_0x0052('0x30')]);_0x27ffaf[_0x0052('0x33')]=_['intersection'](_0x57e91c['model'],qs[_0x0052('0x32')](_0x11c096[_0x0052('0x30')]['fields']));_0x27ffaf[_0x0052('0x33')]=_0x27ffaf['attributes'][_0x0052('0x34')]?_0x27ffaf[_0x0052('0x33')]:_0x57e91c[_0x0052('0x2e')];if(_0x11c096[_0x0052('0x30')][_0x0052('0x44')]){_0x27ffaf[_0x0052('0x3f')]=[{'all':!![]}];}_0x27ffaf=_[_0x0052('0x3c')]({},_0x27ffaf,_0x11c096[_0x0052('0x45')]);return db[_0x0052('0x2b')][_0x0052('0x46')](_0x27ffaf)['then'](handleEntityNotFound(_0x62931e,null))[_0x0052('0x24')](respondWithResult(_0x62931e,null))['catch'](handleError(_0x62931e,null));};exports[_0x0052('0x47')]=function(_0x1b35c6,_0x4051b3){return db[_0x0052('0x2b')][_0x0052('0x47')](_0x1b35c6[_0x0052('0x48')],{})['then'](respondWithResult(_0x4051b3,0xc9))[_0x0052('0x42')](handleError(_0x4051b3,null));};exports['update']=function(_0x154137,_0x536635){if(_0x154137['body']['id']){delete _0x154137['body']['id'];}return db[_0x0052('0x2b')][_0x0052('0x46')]({'where':{'id':_0x154137['params']['id']}})[_0x0052('0x24')](handleEntityNotFound(_0x536635,null))[_0x0052('0x24')](saveUpdates(_0x154137[_0x0052('0x48')],null))[_0x0052('0x24')](respondWithResult(_0x536635,null))[_0x0052('0x42')](handleError(_0x536635,null));};exports[_0x0052('0x25')]=function(_0xe971b8,_0x22af0d){return db[_0x0052('0x2b')][_0x0052('0x46')]({'where':{'id':_0xe971b8[_0x0052('0x43')]['id']}})[_0x0052('0x24')](handleEntityNotFound(_0x22af0d,null))[_0x0052('0x24')](removeEntity(_0x22af0d,null))[_0x0052('0x42')](handleError(_0x22af0d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8c1baed..728b2ee 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 _0x28bd=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','moment','bluebird','request-promise'];(function(_0x32aa7c,_0x4280f7){var _0xbbacae=function(_0x556c6f){while(--_0x556c6f){_0x32aa7c['push'](_0x32aa7c['shift']());}};_0xbbacae(++_0x4280f7);}(_0x28bd,0x19b));var _0xd28b=function(_0x3a5a3d,_0x3dd68d){_0x3a5a3d=_0x3a5a3d-0x0;var _0x31ae0a=_0x28bd[_0x3a5a3d];return _0x31ae0a;};'use strict';var _=require(_0xd28b('0x0'));var util=require(_0xd28b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd28b('0x2'));var BPromise=require(_0xd28b('0x3'));var rp=require(_0xd28b('0x4'));var fs=require('fs');var path=require(_0xd28b('0x5'));var rimraf=require(_0xd28b('0x6'));var config=require(_0xd28b('0x7'));var attributes=require(_0xd28b('0x8'));module['exports']=function(_0x128ae1,_0x170b5d){return _0x128ae1['define'](_0xd28b('0x9'),attributes,{'tableName':_0xd28b('0xa'),'paranoid':![],'indexes':[{'name':_0xd28b('0xb'),'fields':['idField',_0xd28b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d82=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x39377c,_0x2459a1){var _0x3cb2ee=function(_0x35aec6){while(--_0x35aec6){_0x39377c['push'](_0x39377c['shift']());}};_0x3cb2ee(++_0x2459a1);}(_0x5d82,0x8c));var _0x25d8=function(_0x5f58d5,_0x27acd3){_0x5f58d5=_0x5f58d5-0x0;var _0x53fcd8=_0x5d82[_0x5f58d5];return _0x53fcd8;};'use strict';var _=require(_0x25d8('0x0'));var util=require(_0x25d8('0x1'));var logger=require(_0x25d8('0x2'))(_0x25d8('0x3'));var moment=require('moment');var BPromise=require(_0x25d8('0x4'));var rp=require(_0x25d8('0x5'));var fs=require('fs');var path=require(_0x25d8('0x6'));var rimraf=require('rimraf');var config=require(_0x25d8('0x7'));var attributes=require(_0x25d8('0x8'));module[_0x25d8('0x9')]=function(_0x171fae,_0x40dd8a){return _0x171fae[_0x25d8('0xa')](_0x25d8('0xb'),attributes,{'tableName':_0x25d8('0xc'),'paranoid':![],'indexes':[{'name':_0x25d8('0xd'),'fields':[_0x25d8('0xe'),'FieldId'],'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 a91adb1..94d162d 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 _0xec93=['util','moment','bluebird','ioredis','../../config/utils','rpc','http','request','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','SugarcrmField,\x20%s,\x20%s','message','catch'];(function(_0x5c9f1e,_0x263026){var _0xabc778=function(_0x45ef20){while(--_0x45ef20){_0x5c9f1e['push'](_0x5c9f1e['shift']());}};_0xabc778(++_0x263026);}(_0xec93,0x170));var _0x3ec9=function(_0x5eb359,_0x24b212){_0x5eb359=_0x5eb359-0x0;var _0x225445=_0xec93[_0x5eb359];return _0x225445;};'use strict';var _=require('lodash');var util=require(_0x3ec9('0x0'));var moment=require(_0x3ec9('0x1'));var BPromise=require(_0x3ec9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ec9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ec9('0x4'));var logger=require('../../config/logger')(_0x3ec9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3ec9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5f3894,_0x3c6b9a,_0x471ebe){return new BPromise(function(_0xba7f14,_0x89ec89){return client[_0x3ec9('0x7')](_0x5f3894,_0x471ebe)['then'](function(_0x44d5da){logger[_0x3ec9('0x8')]('SugarcrmField,\x20%s,\x20%s',_0x3c6b9a,_0x3ec9('0x9'));logger[_0x3ec9('0xa')](_0x3ec9('0xb'),_0x3c6b9a,'request\x20sent',JSON['stringify'](_0x44d5da));if(_0x44d5da[_0x3ec9('0xc')]){if(_0x44d5da[_0x3ec9('0xc')]['code']===0x1f4){logger[_0x3ec9('0xc')](_0x3ec9('0xd'),_0x3c6b9a,_0x44d5da[_0x3ec9('0xc')]['message']);return _0x89ec89(_0x44d5da[_0x3ec9('0xc')][_0x3ec9('0xe')]);}logger[_0x3ec9('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3c6b9a,_0x44d5da['error']['message']);return _0xba7f14(_0x44d5da[_0x3ec9('0xc')][_0x3ec9('0xe')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x3c6b9a,_0x3ec9('0x9'));_0xba7f14(_0x44d5da['result']['message']);}})[_0x3ec9('0xf')](function(_0x24a43a){logger['error'](_0x3ec9('0xd'),_0x3c6b9a,_0x24a43a);_0x89ec89(_0x24a43a);});});} \ No newline at end of file +var _0x760d=['client','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3d274e,_0x3eab1c){var _0xaf9cfa=function(_0x4aee5f){while(--_0x4aee5f){_0x3d274e['push'](_0x3d274e['shift']());}};_0xaf9cfa(++_0x3eab1c);}(_0x760d,0x184));var _0xd760=function(_0xead5ea,_0x4a3a6e){_0xead5ea=_0xead5ea-0x0;var _0xd05933=_0x760d[_0xead5ea];return _0xd05933;};'use strict';var _=require(_0xd760('0x0'));var util=require('util');var moment=require(_0xd760('0x1'));var BPromise=require('bluebird');var rs=require(_0xd760('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd760('0x3'));var logger=require(_0xd760('0x4'))(_0xd760('0x5'));var config=require(_0xd760('0x6'));var jayson=require(_0xd760('0x7'));var client=jayson[_0xd760('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf61ee4,_0x4421e7,_0x10fcd1){return new BPromise(function(_0x102ee6,_0x3458f3){return client[_0xd760('0x9')](_0xf61ee4,_0x10fcd1)[_0xd760('0xa')](function(_0x29cfb4){logger[_0xd760('0xb')](_0xd760('0xc'),_0x4421e7,'request\x20sent');logger[_0xd760('0xd')](_0xd760('0xe'),_0x4421e7,_0xd760('0xf'),JSON[_0xd760('0x10')](_0x29cfb4));if(_0x29cfb4[_0xd760('0x11')]){if(_0x29cfb4['error'][_0xd760('0x12')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x4421e7,_0x29cfb4[_0xd760('0x11')][_0xd760('0x13')]);return _0x3458f3(_0x29cfb4[_0xd760('0x11')]['message']);}logger[_0xd760('0x11')](_0xd760('0xc'),_0x4421e7,_0x29cfb4['error']['message']);return _0x102ee6(_0x29cfb4[_0xd760('0x11')][_0xd760('0x13')]);}else{logger[_0xd760('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x4421e7,_0xd760('0xf'));_0x102ee6(_0x29cfb4[_0xd760('0x14')]['message']);}})[_0xd760('0x15')](function(_0x348de1){logger[_0xd760('0x11')](_0xd760('0xc'),_0x4421e7,_0x348de1);_0x3458f3(_0x348de1);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 88e71a2..b705599 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 _0x4d04=['index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x4d04,0xf3));var _0x44d0=function(_0x35f7bc,_0x37a77a){_0x35f7bc=_0x35f7bc-0x0;var _0x20f11a=_0x4d04[_0x35f7bc];return _0x20f11a;};'use strict';var multer=require('multer');var util=require(_0x44d0('0x0'));var path=require(_0x44d0('0x1'));var timeout=require(_0x44d0('0x2'));var express=require('express');var router=express[_0x44d0('0x3')]();var fs_extra=require(_0x44d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x44d0('0x5'));var config=require(_0x44d0('0x6'));var controller=require(_0x44d0('0x7'));router[_0x44d0('0x8')]('/',auth[_0x44d0('0x9')](),controller[_0x44d0('0xa')]);router[_0x44d0('0x8')](_0x44d0('0xb'),auth[_0x44d0('0x9')](),controller['show']);router['get'](_0x44d0('0xc'),auth[_0x44d0('0x9')](),controller[_0x44d0('0xd')]);router['get'](_0x44d0('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x44d0('0xf')]('/',auth['isAuthenticated'](),controller[_0x44d0('0x10')]);router[_0x44d0('0xf')](_0x44d0('0xc'),auth[_0x44d0('0x9')](),controller[_0x44d0('0x11')]);router[_0x44d0('0x12')](_0x44d0('0xb'),auth['isAuthenticated'](),controller[_0x44d0('0x13')]);router[_0x44d0('0x14')](_0x44d0('0xb'),auth['isAuthenticated'](),controller[_0x44d0('0x15')]);module[_0x44d0('0x16')]=router; \ No newline at end of file +var _0x5c71=['index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get'];(function(_0x1b457d,_0x517e00){var _0x181489=function(_0x1070c3){while(--_0x1070c3){_0x1b457d['push'](_0x1b457d['shift']());}};_0x181489(++_0x517e00);}(_0x5c71,0x188));var _0x15c7=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x5c71[_0x202c61];return _0x540691;};'use strict';var multer=require(_0x15c7('0x0'));var util=require(_0x15c7('0x1'));var path=require(_0x15c7('0x2'));var timeout=require(_0x15c7('0x3'));var express=require(_0x15c7('0x4'));var router=express[_0x15c7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x15c7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x15c7('0x7')]('/',auth['isAuthenticated'](),controller[_0x15c7('0x8')]);router[_0x15c7('0x7')](_0x15c7('0x9'),auth[_0x15c7('0xa')](),controller['show']);router[_0x15c7('0x7')](_0x15c7('0xb'),auth[_0x15c7('0xa')](),controller[_0x15c7('0xc')]);router[_0x15c7('0x7')](_0x15c7('0xd'),auth[_0x15c7('0xa')](),controller['getFields']);router['post']('/',auth[_0x15c7('0xa')](),controller[_0x15c7('0xe')]);router[_0x15c7('0xf')](_0x15c7('0xb'),auth['isAuthenticated'](),controller[_0x15c7('0x10')]);router[_0x15c7('0x11')](_0x15c7('0x9'),auth['isAuthenticated'](),controller[_0x15c7('0x12')]);router['delete'](_0x15c7('0x9'),auth[_0x15c7('0xa')](),controller[_0x15c7('0x13')]);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 1597917..94b7c2c 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 _0x7149=['sequelize','exports','STRING'];(function(_0x5ecac8,_0x246286){var _0x255862=function(_0x1a2d83){while(--_0x1a2d83){_0x5ecac8['push'](_0x5ecac8['shift']());}};_0x255862(++_0x246286);}(_0x7149,0x14d));var _0x9714=function(_0x1bdd48,_0x32d24c){_0x1bdd48=_0x1bdd48-0x0;var _0x3d7fbc=_0x7149[_0x1bdd48];return _0x3d7fbc;};'use strict';var Sequelize=require(_0x9714('0x0'));module[_0x9714('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9714('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x9714('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9714('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5660=['HelpDesk','sequelize','exports','STRING'];(function(_0xac1b75,_0x1a1114){var _0x41985d=function(_0xeff0bd){while(--_0xeff0bd){_0xac1b75['push'](_0xac1b75['shift']());}};_0x41985d(++_0x1a1114);}(_0x5660,0x1e5));var _0x0566=function(_0x9622fc,_0x436ce3){_0x9622fc=_0x9622fc-0x0;var _0x8a8cfa=_0x5660[_0x9622fc];return _0x8a8cfa;};'use strict';var Sequelize=require(_0x0566('0x0'));module[_0x0566('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0566('0x2')]},'username':{'type':Sequelize[_0x0566('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0566('0x2')],'allowNull':![],'defaultValue':_0x0566('0x3')},'remoteUri':{'type':Sequelize[_0x0566('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0566('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0566('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 4b758f3..620295f 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 _0x17d7=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key','name','keys','filters','intersection','model','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VtigerAccount','includeAll','include','findAll','catch','show','params','length','options','find','create','body','getConfigurations','VtigerConfiguration','hasOwnProperty','findOne','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','success','POST','result','describe','sessionName','autogenerated','owner','includes','remove','editable','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0x17d7,0x6f));var _0x717d=function(_0x38d3b5,_0x4cda){_0x38d3b5=_0x38d3b5-0x0;var _0x4529db=_0x17d7[_0x38d3b5];return _0x4529db;};'use strict';var emlformat=require(_0x717d('0x0'));var rimraf=require(_0x717d('0x1'));var zipdir=require(_0x717d('0x2'));var jsonpatch=require(_0x717d('0x3'));var rp=require('request-promise');var moment=require(_0x717d('0x4'));var BPromise=require(_0x717d('0x5'));var Mustache=require(_0x717d('0x6'));var util=require(_0x717d('0x7'));var path=require(_0x717d('0x8'));var sox=require(_0x717d('0x9'));var csv=require(_0x717d('0xa'));var ejs=require(_0x717d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x717d('0xc'));var jsforce=require(_0x717d('0xd'));var deskjs=require(_0x717d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x717d('0xf'));var Redis=require(_0x717d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x717d('0x11'));var hardwareService=require(_0x717d('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x717d('0x13'));var licenseUtil=require(_0x717d('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1dc930,_0x2c76ae){_0x2c76ae=_0x2c76ae||0xcc;return function(_0x3417e0){if(_0x3417e0){return _0x1dc930['sendStatus'](_0x2c76ae);}return _0x1dc930[_0x717d('0x15')](_0x2c76ae)['end']();};}function respondWithResult(_0x89ed2d,_0x2b88ad){_0x2b88ad=_0x2b88ad||0xc8;return function(_0x222eb7){if(_0x222eb7){return _0x89ed2d[_0x717d('0x15')](_0x2b88ad)['json'](_0x222eb7);}};}function respondWithFilteredResult(_0x3e9ab1,_0x23e6db){return function(_0x5b44f5){if(_0x5b44f5){var _0x3429d7=typeof _0x23e6db[_0x717d('0x16')]===_0x717d('0x17')&&typeof _0x23e6db[_0x717d('0x18')]==='undefined';var _0x437d1a=_0x5b44f5[_0x717d('0x19')];var _0x37f3bf=_0x3429d7?0x0:_0x23e6db[_0x717d('0x16')];var _0x23621f=_0x3429d7?_0x5b44f5['count']:_0x23e6db[_0x717d('0x16')]+_0x23e6db[_0x717d('0x18')];var _0x1d4ff4;if(_0x23621f>=_0x437d1a){_0x23621f=_0x437d1a;_0x1d4ff4=0xc8;}else{_0x1d4ff4=0xce;}_0x3e9ab1['status'](_0x1d4ff4);return _0x3e9ab1[_0x717d('0x1a')]('Content-Range',_0x37f3bf+'-'+_0x23621f+'/'+_0x437d1a)['json'](_0x5b44f5);}return null;};}function patchUpdates(_0x25f33f){return function(_0x278216){try{jsonpatch[_0x717d('0x1b')](_0x278216,_0x25f33f,!![]);}catch(_0x438b57){return BPromise[_0x717d('0x1c')](_0x438b57);}return _0x278216[_0x717d('0x1d')]();};}function saveUpdates(_0x4693dc,_0x2d156d){return function(_0x25d846){if(_0x25d846){return _0x25d846[_0x717d('0x1e')](_0x4693dc)[_0x717d('0x1f')](function(_0x4b513f){return _0x4b513f;});}return null;};}function removeEntity(_0x243177,_0x164e7e){return function(_0x2f439e){if(_0x2f439e){return _0x2f439e[_0x717d('0x20')]()[_0x717d('0x1f')](function(){_0x243177[_0x717d('0x15')](0xcc)[_0x717d('0x21')]();});}};}function handleEntityNotFound(_0xc6e8db,_0x34720e){return function(_0x309d4f){if(!_0x309d4f){_0xc6e8db[_0x717d('0x22')](0x194);}return _0x309d4f;};}function handleError(_0x28a91c,_0x17134b){_0x17134b=_0x17134b||0x1f4;return function(_0x3375eb){logger[_0x717d('0x23')](_0x3375eb['stack']);if(_0x3375eb['name']){delete _0x3375eb['name'];}_0x28a91c['status'](_0x17134b)[_0x717d('0x24')](_0x3375eb);};}exports[_0x717d('0x25')]=function(_0x11cf37,_0x1babde){var _0x379509={},_0x24b6d4={},_0x93702d={'count':0x0,'rows':[]};var _0x4c68ba=_[_0x717d('0x26')](db['VtigerAccount'][_0x717d('0x27')],function(_0xb2b395){return{'name':_0xb2b395[_0x717d('0x28')],'type':_0xb2b395[_0x717d('0x29')][_0x717d('0x2a')]};});_0x24b6d4['model']=_[_0x717d('0x26')](_0x4c68ba,_0x717d('0x2b'));_0x24b6d4['query']=_[_0x717d('0x2c')](_0x11cf37['query']);_0x24b6d4[_0x717d('0x2d')]=_[_0x717d('0x2e')](_0x24b6d4[_0x717d('0x2f')],_0x24b6d4[_0x717d('0x30')]);_0x379509[_0x717d('0x31')]=_[_0x717d('0x2e')](_0x24b6d4[_0x717d('0x2f')],qs[_0x717d('0x32')](_0x11cf37[_0x717d('0x30')][_0x717d('0x32')]));_0x379509[_0x717d('0x31')]=_0x379509[_0x717d('0x31')]['length']?_0x379509[_0x717d('0x31')]:_0x24b6d4[_0x717d('0x2f')];if(!_0x11cf37['query']['hasOwnProperty'](_0x717d('0x33'))){_0x379509['limit']=qs[_0x717d('0x18')](_0x11cf37[_0x717d('0x30')][_0x717d('0x18')]);_0x379509['offset']=qs[_0x717d('0x16')](_0x11cf37[_0x717d('0x30')][_0x717d('0x16')]);}_0x379509[_0x717d('0x34')]=qs[_0x717d('0x35')](_0x11cf37[_0x717d('0x30')][_0x717d('0x35')]);_0x379509[_0x717d('0x36')]=qs[_0x717d('0x2d')](_[_0x717d('0x37')](_0x11cf37[_0x717d('0x30')],_0x24b6d4[_0x717d('0x2d')]),_0x4c68ba);if(_0x11cf37[_0x717d('0x30')][_0x717d('0x38')]){_0x379509['where']=_[_0x717d('0x39')](_0x379509[_0x717d('0x36')],{'$or':_['map'](_0x4c68ba,function(_0x483e37){if(_0x483e37[_0x717d('0x29')]!=='VIRTUAL'){var _0x277ab3={};_0x277ab3[_0x483e37[_0x717d('0x2b')]]={'$like':'%'+_0x11cf37[_0x717d('0x30')][_0x717d('0x38')]+'%'};return _0x277ab3;}})});}_0x379509=_[_0x717d('0x39')]({},_0x379509,_0x11cf37['options']);var _0x5aac98={'where':_0x379509[_0x717d('0x36')]};return db[_0x717d('0x3a')][_0x717d('0x19')](_0x5aac98)['then'](function(_0x2f79b6){_0x93702d[_0x717d('0x19')]=_0x2f79b6;if(_0x11cf37[_0x717d('0x30')][_0x717d('0x3b')]){_0x379509[_0x717d('0x3c')]=[{'all':!![]}];}return db[_0x717d('0x3a')][_0x717d('0x3d')](_0x379509);})[_0x717d('0x1f')](function(_0x38a1ff){_0x93702d['rows']=_0x38a1ff;return _0x93702d;})[_0x717d('0x1f')](respondWithFilteredResult(_0x1babde,_0x379509))[_0x717d('0x3e')](handleError(_0x1babde,null));};exports[_0x717d('0x3f')]=function(_0x42d1dd,_0x5c413a){var _0x2fb1dc={'raw':![],'where':{'id':_0x42d1dd[_0x717d('0x40')]['id']}},_0x3171b0={};_0x3171b0['model']=_['keys'](db[_0x717d('0x3a')][_0x717d('0x27')]);_0x3171b0['query']=_[_0x717d('0x2c')](_0x42d1dd['query']);_0x3171b0[_0x717d('0x2d')]=_['intersection'](_0x3171b0[_0x717d('0x2f')],_0x3171b0[_0x717d('0x30')]);_0x2fb1dc[_0x717d('0x31')]=_[_0x717d('0x2e')](_0x3171b0[_0x717d('0x2f')],qs[_0x717d('0x32')](_0x42d1dd['query'][_0x717d('0x32')]));_0x2fb1dc[_0x717d('0x31')]=_0x2fb1dc[_0x717d('0x31')][_0x717d('0x41')]?_0x2fb1dc[_0x717d('0x31')]:_0x3171b0[_0x717d('0x2f')];if(_0x42d1dd[_0x717d('0x30')][_0x717d('0x3b')]){_0x2fb1dc[_0x717d('0x3c')]=[{'all':!![]}];}_0x2fb1dc=_[_0x717d('0x39')]({},_0x2fb1dc,_0x42d1dd[_0x717d('0x42')]);return db['VtigerAccount'][_0x717d('0x43')](_0x2fb1dc)[_0x717d('0x1f')](handleEntityNotFound(_0x5c413a,null))[_0x717d('0x1f')](respondWithResult(_0x5c413a,null))[_0x717d('0x3e')](handleError(_0x5c413a,null));};exports[_0x717d('0x44')]=function(_0x35a273,_0x55c23f){return db[_0x717d('0x3a')][_0x717d('0x44')](_0x35a273[_0x717d('0x45')],{})['then'](respondWithResult(_0x55c23f,0xc9))[_0x717d('0x3e')](handleError(_0x55c23f,null));};exports['update']=function(_0x46d6c6,_0x455ffb){if(_0x46d6c6[_0x717d('0x45')]['id']){delete _0x46d6c6[_0x717d('0x45')]['id'];}return db[_0x717d('0x3a')][_0x717d('0x43')]({'where':{'id':_0x46d6c6[_0x717d('0x40')]['id']}})['then'](handleEntityNotFound(_0x455ffb,null))[_0x717d('0x1f')](saveUpdates(_0x46d6c6[_0x717d('0x45')],null))[_0x717d('0x1f')](respondWithResult(_0x455ffb,null))[_0x717d('0x3e')](handleError(_0x455ffb,null));};exports[_0x717d('0x20')]=function(_0x1a73c5,_0x36efbd){return db[_0x717d('0x3a')][_0x717d('0x43')]({'where':{'id':_0x1a73c5[_0x717d('0x40')]['id']}})['then'](handleEntityNotFound(_0x36efbd,null))['then'](removeEntity(_0x36efbd,null))[_0x717d('0x3e')](handleError(_0x36efbd,null));};exports[_0x717d('0x46')]=function(_0x292911,_0x4d3408,_0x549bc4){var _0x141053={};var _0xd025ca={};var _0x534a66;var _0x2a6dc9;return db[_0x717d('0x3a')]['findOne']({'where':{'id':_0x292911[_0x717d('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d3408,null))[_0x717d('0x1f')](function(_0x274263){if(_0x274263){_0x534a66=_0x274263;_0xd025ca[_0x717d('0x2f')]=_['keys'](db[_0x717d('0x47')][_0x717d('0x27')]);_0xd025ca[_0x717d('0x30')]=_[_0x717d('0x2c')](_0x292911['query']);_0xd025ca[_0x717d('0x2d')]=_[_0x717d('0x2e')](_0xd025ca[_0x717d('0x2f')],_0xd025ca['query']);_0x141053['attributes']=_['intersection'](_0xd025ca[_0x717d('0x2f')],qs[_0x717d('0x32')](_0x292911[_0x717d('0x30')]['fields']));_0x141053['attributes']=_0x141053[_0x717d('0x31')][_0x717d('0x41')]?_0x141053[_0x717d('0x31')]:_0xd025ca[_0x717d('0x2f')];_0x141053[_0x717d('0x34')]=qs['sort'](_0x292911[_0x717d('0x30')]['sort']);_0x141053['where']=qs[_0x717d('0x2d')](_[_0x717d('0x37')](_0x292911[_0x717d('0x30')],_0xd025ca['filters']));if(_0x292911['query'][_0x717d('0x38')]){_0x141053['where']=_[_0x717d('0x39')](_0x141053[_0x717d('0x36')],{'$or':_[_0x717d('0x26')](_0x141053['attributes'],function(_0xf9ac1a){var _0x187594={};_0x187594[_0xf9ac1a]={'$like':'%'+_0x292911[_0x717d('0x30')]['filter']+'%'};return _0x187594;})});}_0x141053=_[_0x717d('0x39')]({},_0x141053,_0x292911[_0x717d('0x42')]);return _0x534a66[_0x717d('0x46')](_0x141053);}})[_0x717d('0x1f')](function(_0x428887){if(_0x428887){_0x2a6dc9=_0x428887[_0x717d('0x41')];if(!_0x292911['query'][_0x717d('0x48')](_0x717d('0x33'))){_0x141053[_0x717d('0x18')]=qs[_0x717d('0x18')](_0x292911[_0x717d('0x30')][_0x717d('0x18')]);_0x141053[_0x717d('0x16')]=qs[_0x717d('0x16')](_0x292911['query'][_0x717d('0x16')]);}return _0x534a66[_0x717d('0x46')](_0x141053);}})[_0x717d('0x1f')](function(_0x14b9c8){if(_0x14b9c8){return _0x14b9c8?{'count':_0x2a6dc9,'rows':_0x14b9c8}:null;}})[_0x717d('0x1f')](respondWithResult(_0x4d3408,null))[_0x717d('0x3e')](handleError(_0x4d3408,null));};exports['addConfiguration']=function(_0x4f51f7,_0x185233,_0x53ccd8){if(_0x4f51f7[_0x717d('0x45')]['id']){delete _0x4f51f7[_0x717d('0x45')]['id'];}return db[_0x717d('0x3a')][_0x717d('0x49')]({'where':{'id':_0x4f51f7[_0x717d('0x40')]['id']}})['then'](handleEntityNotFound(_0x185233,null))['then'](function(_0x3e951f){if(_0x3e951f){_0x4f51f7[_0x717d('0x45')]['AccountId']=_0x3e951f['id'];_0x4f51f7['body'][_0x717d('0x4a')]=integrations['getSubjects'](_0x4f51f7[_0x717d('0x45')][_0x717d('0x4b')],_0x4f51f7[_0x717d('0x45')][_0x717d('0x29')]);_0x4f51f7['body'][_0x717d('0x4c')]=integrations[_0x717d('0x4d')](_0x4f51f7[_0x717d('0x45')][_0x717d('0x4b')],_0x4f51f7[_0x717d('0x45')][_0x717d('0x29')]);return db[_0x717d('0x47')][_0x717d('0x44')](_0x4f51f7[_0x717d('0x45')],{'include':[{'model':db[_0x717d('0x4e')],'as':_0x717d('0x4a')},{'model':db[_0x717d('0x4e')],'as':_0x717d('0x4c')}]});}return null;})[_0x717d('0x1f')](respondWithResult(_0x185233,null))[_0x717d('0x3e')](handleError(_0x185233,null));};var md5=require(_0x717d('0x4f'));exports['getFields']=function(_0x17f635,_0x4c6175,_0x263a8b){var _0x33c06e=null;var _0x2907dc=null;var _0x4334fc=null;var _0x5c44d3=null;var _0x127903='';return db['VtigerAccount'][_0x717d('0x49')]({'where':{'id':_0x17f635['params']['id']},'attributes':['id',_0x717d('0x2b'),_0x717d('0x50'),_0x717d('0x51'),_0x717d('0x52'),_0x717d('0x53'),_0x717d('0x54'),_0x717d('0x55')]})[_0x717d('0x1f')](handleEntityNotFound(_0x4c6175,null))['then'](function(_0x28e1f8){if(_0x28e1f8){_0x33c06e=_0x28e1f8[_0x717d('0x50')];_0x2907dc=_0x28e1f8[_0x717d('0x55')];_0x4334fc=_0x28e1f8['moduleName'];_0x127903=_0x28e1f8[_0x717d('0x53')];var _0x59f722=_0x127903[_0x717d('0x56')](-0x1);if(_0x59f722==='/'){_0x127903=_0x127903[_0x717d('0x57')](0x0,_0x127903[_0x717d('0x58')](_0x59f722));}_0x5c44d3=util['format'](_0x717d('0x59'),_0x127903);var _0x1b1381={'method':_0x717d('0x5a'),'uri':_0x5c44d3,'qs':{'operation':'getchallenge','username':_0x28e1f8[_0x717d('0x50')]},'json':!![]};return rp(_0x1b1381);}})['then'](function(_0x56ba66){if(_0x56ba66[_0x717d('0x5b')]){var _0x430459={'method':_0x717d('0x5c'),'uri':_0x5c44d3,'form':{'operation':'login','username':_0x33c06e,'accessKey':md5(_0x56ba66[_0x717d('0x5d')]['token']+_0x2907dc)},'json':!![]};return rp(_0x430459);}})[_0x717d('0x1f')](function(_0x120025){if(_0x120025[_0x717d('0x5b')]){var _0x168c4f={'method':'GET','uri':_0x5c44d3,'qs':{'operation':_0x717d('0x5e'),'username':_0x33c06e,'sessionName':_0x120025[_0x717d('0x5d')][_0x717d('0x5f')],'elementType':_0x4334fc},'json':!![]};return rp(_0x168c4f);}})['then'](function(_0x4fc5cf){if(_0x4fc5cf[_0x717d('0x5b')]){var _0x518ff7=[_0x717d('0x60'),'reference',_0x717d('0x61')];_['remove'](_0x4fc5cf['result'][_0x717d('0x32')],function(_0x52bdb1){return _0x518ff7[_0x717d('0x62')](_0x52bdb1[_0x717d('0x29')][_0x717d('0x2b')]);});_[_0x717d('0x63')](_0x4fc5cf[_0x717d('0x5d')]['fields'],function(_0x3c7df0){return _0x3c7df0[_0x717d('0x64')]==='false';});return{'count':_0x4fc5cf[_0x717d('0x5d')]['fields'][_0x717d('0x41')],'rows':_[_0x717d('0x26')](_0x4fc5cf['result'][_0x717d('0x32')],function(_0x52aac1){return{'id':_0x52aac1[_0x717d('0x2b')],'name':_0x52aac1[_0x717d('0x65')],'custom':_[_0x717d('0x66')](_0x52aac1[_0x717d('0x2b')],_0x717d('0x67'))?!![]:![],'options':_0x52aac1[_0x717d('0x29')][_0x717d('0x2b')]===_0x717d('0x68')&&_0x52aac1['type'][_0x717d('0x69')]['length']>0x0?_['map'](_0x52aac1[_0x717d('0x29')]['picklistValues'],function(_0x3a8946){return{'name':_0x3a8946[_0x717d('0x65')],'value':_0x3a8946[_0x717d('0x6a')]};}):[]};})};}})['then'](respondWithResult(_0x4c6175,null))[_0x717d('0x3e')](function(_0x20d9a1){console[_0x717d('0x6b')](_0x717d('0x6c')+_0x20d9a1);var _0x31714b=_0x17f635['query'][_0x717d('0x6d')]?0x1f4:_0x20d9a1['statusCode']||0x1f4;logger[_0x717d('0x23')](_0x717d('0x6e'),_0x717d('0x6f'),_0x31714b,JSON['stringify'](_0x20d9a1));delete _0x20d9a1['name'];if(_0x31714b===0x191){_0x31714b=0x190;}_0x4c6175['status'](_0x31714b)[_0x717d('0x24')](_0x17f635[_0x717d('0x30')][_0x717d('0x6d')]?{'message':_0x717d('0x70'),'statusCode':_0x20d9a1['statusCode']}:_0x20d9a1);});}; \ No newline at end of file +var _0x2511=['name','index','VtigerAccount','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','destroy','getConfigurations','VtigerConfiguration','rawAttributes','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','GET','getchallenge','success','POST','login','result','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x170eb7,_0x1ac59b){var _0x4dfeac=function(_0x350592){while(--_0x350592){_0x170eb7['push'](_0x170eb7['shift']());}};_0x4dfeac(++_0x1ac59b);}(_0x2511,0x1be));var _0x1251=function(_0x3bd3c1,_0x2d1d04){_0x3bd3c1=_0x3bd3c1-0x0;var _0x4236f7=_0x2511[_0x3bd3c1];return _0x4236f7;};'use strict';var emlformat=require(_0x1251('0x0'));var rimraf=require(_0x1251('0x1'));var zipdir=require(_0x1251('0x2'));var jsonpatch=require(_0x1251('0x3'));var rp=require(_0x1251('0x4'));var moment=require(_0x1251('0x5'));var BPromise=require(_0x1251('0x6'));var Mustache=require(_0x1251('0x7'));var util=require(_0x1251('0x8'));var path=require(_0x1251('0x9'));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(_0x1251('0xa'));var squel=require(_0x1251('0xb'));var crypto=require(_0x1251('0xc'));var jsforce=require(_0x1251('0xd'));var deskjs=require(_0x1251('0xe'));var toCsv=require(_0x1251('0xf'));var querystring=require(_0x1251('0x10'));var Papa=require('papaparse');var Redis=require(_0x1251('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1251('0x12'));var logger=require(_0x1251('0x13'))(_0x1251('0x14'));var utils=require('../../config/utils');var config=require(_0x1251('0x15'));var licenseUtil=require(_0x1251('0x16'));var db=require(_0x1251('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x592c26,_0x293293){_0x293293=_0x293293||0xcc;return function(_0x23adbd){if(_0x23adbd){return _0x592c26[_0x1251('0x18')](_0x293293);}return _0x592c26[_0x1251('0x19')](_0x293293)['end']();};}function respondWithResult(_0x367dfe,_0x431a2a){_0x431a2a=_0x431a2a||0xc8;return function(_0x20de4b){if(_0x20de4b){return _0x367dfe['status'](_0x431a2a)[_0x1251('0x1a')](_0x20de4b);}};}function respondWithFilteredResult(_0x5ad8ff,_0x4bb577){return function(_0x1fe203){if(_0x1fe203){var _0x1a508d=typeof _0x4bb577[_0x1251('0x1b')]===_0x1251('0x1c')&&typeof _0x4bb577['limit']==='undefined';var _0x2d7eb1=_0x1fe203[_0x1251('0x1d')];var _0x47152c=_0x1a508d?0x0:_0x4bb577[_0x1251('0x1b')];var _0x25efee=_0x1a508d?_0x1fe203[_0x1251('0x1d')]:_0x4bb577['offset']+_0x4bb577['limit'];var _0x1b3f96;if(_0x25efee>=_0x2d7eb1){_0x25efee=_0x2d7eb1;_0x1b3f96=0xc8;}else{_0x1b3f96=0xce;}_0x5ad8ff[_0x1251('0x19')](_0x1b3f96);return _0x5ad8ff[_0x1251('0x1e')](_0x1251('0x1f'),_0x47152c+'-'+_0x25efee+'/'+_0x2d7eb1)['json'](_0x1fe203);}return null;};}function patchUpdates(_0x3125c1){return function(_0x4d28ff){try{jsonpatch[_0x1251('0x20')](_0x4d28ff,_0x3125c1,!![]);}catch(_0x2ae7c9){return BPromise[_0x1251('0x21')](_0x2ae7c9);}return _0x4d28ff[_0x1251('0x22')]();};}function saveUpdates(_0x35d0e0,_0x272b09){return function(_0x2bfa49){if(_0x2bfa49){return _0x2bfa49[_0x1251('0x23')](_0x35d0e0)[_0x1251('0x24')](function(_0x5ec3c0){return _0x5ec3c0;});}return null;};}function removeEntity(_0x225f95,_0x3e611d){return function(_0x3479e9){if(_0x3479e9){return _0x3479e9['destroy']()[_0x1251('0x24')](function(){_0x225f95[_0x1251('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4415a6,_0x1c8455){return function(_0x26cd0e){if(!_0x26cd0e){_0x4415a6[_0x1251('0x18')](0x194);}return _0x26cd0e;};}function handleError(_0x15ac4d,_0x13ff83){_0x13ff83=_0x13ff83||0x1f4;return function(_0x37a4cf){logger[_0x1251('0x25')](_0x37a4cf['stack']);if(_0x37a4cf['name']){delete _0x37a4cf[_0x1251('0x26')];}_0x15ac4d['status'](_0x13ff83)['send'](_0x37a4cf);};}exports[_0x1251('0x27')]=function(_0x2770e3,_0x398f33){var _0x5619c0={},_0x3892d8={},_0x11b3a2={'count':0x0,'rows':[]};var _0x319756=_['map'](db[_0x1251('0x28')]['rawAttributes'],function(_0x67f498){return{'name':_0x67f498['fieldName'],'type':_0x67f498[_0x1251('0x29')][_0x1251('0x2a')]};});_0x3892d8[_0x1251('0x2b')]=_[_0x1251('0x2c')](_0x319756,_0x1251('0x26'));_0x3892d8[_0x1251('0x2d')]=_['keys'](_0x2770e3['query']);_0x3892d8['filters']=_[_0x1251('0x2e')](_0x3892d8['model'],_0x3892d8[_0x1251('0x2d')]);_0x5619c0[_0x1251('0x2f')]=_[_0x1251('0x2e')](_0x3892d8[_0x1251('0x2b')],qs[_0x1251('0x30')](_0x2770e3[_0x1251('0x2d')][_0x1251('0x30')]));_0x5619c0[_0x1251('0x2f')]=_0x5619c0[_0x1251('0x2f')][_0x1251('0x31')]?_0x5619c0[_0x1251('0x2f')]:_0x3892d8[_0x1251('0x2b')];if(!_0x2770e3[_0x1251('0x2d')][_0x1251('0x32')](_0x1251('0x33'))){_0x5619c0[_0x1251('0x34')]=qs['limit'](_0x2770e3[_0x1251('0x2d')][_0x1251('0x34')]);_0x5619c0[_0x1251('0x1b')]=qs[_0x1251('0x1b')](_0x2770e3[_0x1251('0x2d')][_0x1251('0x1b')]);}_0x5619c0['order']=qs['sort'](_0x2770e3[_0x1251('0x2d')][_0x1251('0x35')]);_0x5619c0[_0x1251('0x36')]=qs[_0x1251('0x37')](_[_0x1251('0x38')](_0x2770e3[_0x1251('0x2d')],_0x3892d8[_0x1251('0x37')]),_0x319756);if(_0x2770e3['query']['filter']){_0x5619c0[_0x1251('0x36')]=_[_0x1251('0x39')](_0x5619c0['where'],{'$or':_[_0x1251('0x2c')](_0x319756,function(_0x49fc48){if(_0x49fc48[_0x1251('0x29')]!==_0x1251('0x3a')){var _0x4f36c3={};_0x4f36c3[_0x49fc48[_0x1251('0x26')]]={'$like':'%'+_0x2770e3[_0x1251('0x2d')][_0x1251('0x3b')]+'%'};return _0x4f36c3;}})});}_0x5619c0=_[_0x1251('0x39')]({},_0x5619c0,_0x2770e3[_0x1251('0x3c')]);var _0x4a05df={'where':_0x5619c0[_0x1251('0x36')]};return db[_0x1251('0x28')][_0x1251('0x1d')](_0x4a05df)[_0x1251('0x24')](function(_0x37140f){_0x11b3a2[_0x1251('0x1d')]=_0x37140f;if(_0x2770e3[_0x1251('0x2d')][_0x1251('0x3d')]){_0x5619c0[_0x1251('0x3e')]=[{'all':!![]}];}return db[_0x1251('0x28')][_0x1251('0x3f')](_0x5619c0);})[_0x1251('0x24')](function(_0x1093c4){_0x11b3a2[_0x1251('0x40')]=_0x1093c4;return _0x11b3a2;})['then'](respondWithFilteredResult(_0x398f33,_0x5619c0))[_0x1251('0x41')](handleError(_0x398f33,null));};exports['show']=function(_0x1dd564,_0x2847f3){var _0xe77322={'raw':![],'where':{'id':_0x1dd564['params']['id']}},_0xd80fde={};_0xd80fde['model']=_[_0x1251('0x42')](db[_0x1251('0x28')]['rawAttributes']);_0xd80fde['query']=_[_0x1251('0x42')](_0x1dd564[_0x1251('0x2d')]);_0xd80fde[_0x1251('0x37')]=_['intersection'](_0xd80fde[_0x1251('0x2b')],_0xd80fde['query']);_0xe77322[_0x1251('0x2f')]=_[_0x1251('0x2e')](_0xd80fde[_0x1251('0x2b')],qs[_0x1251('0x30')](_0x1dd564[_0x1251('0x2d')][_0x1251('0x30')]));_0xe77322['attributes']=_0xe77322[_0x1251('0x2f')]['length']?_0xe77322[_0x1251('0x2f')]:_0xd80fde['model'];if(_0x1dd564[_0x1251('0x2d')]['includeAll']){_0xe77322['include']=[{'all':!![]}];}_0xe77322=_['merge']({},_0xe77322,_0x1dd564['options']);return db[_0x1251('0x28')][_0x1251('0x43')](_0xe77322)[_0x1251('0x24')](handleEntityNotFound(_0x2847f3,null))['then'](respondWithResult(_0x2847f3,null))['catch'](handleError(_0x2847f3,null));};exports[_0x1251('0x44')]=function(_0x4abdff,_0x5e1aad){return db[_0x1251('0x28')]['create'](_0x4abdff['body'],{})['then'](respondWithResult(_0x5e1aad,0xc9))[_0x1251('0x41')](handleError(_0x5e1aad,null));};exports[_0x1251('0x23')]=function(_0x25f1fb,_0x41d74f){if(_0x25f1fb[_0x1251('0x45')]['id']){delete _0x25f1fb[_0x1251('0x45')]['id'];}return db[_0x1251('0x28')][_0x1251('0x43')]({'where':{'id':_0x25f1fb[_0x1251('0x46')]['id']}})[_0x1251('0x24')](handleEntityNotFound(_0x41d74f,null))['then'](saveUpdates(_0x25f1fb[_0x1251('0x45')],null))[_0x1251('0x24')](respondWithResult(_0x41d74f,null))[_0x1251('0x41')](handleError(_0x41d74f,null));};exports[_0x1251('0x47')]=function(_0x1256e5,_0x2f5f8e){return db[_0x1251('0x28')][_0x1251('0x43')]({'where':{'id':_0x1256e5['params']['id']}})[_0x1251('0x24')](handleEntityNotFound(_0x2f5f8e,null))['then'](removeEntity(_0x2f5f8e,null))[_0x1251('0x41')](handleError(_0x2f5f8e,null));};exports[_0x1251('0x48')]=function(_0x6d92d8,_0x380da4,_0x1f4828){var _0x14d909={};var _0x25de14={};var _0x20aaff;var _0x41772b;return db[_0x1251('0x28')]['findOne']({'where':{'id':_0x6d92d8[_0x1251('0x46')]['id']}})[_0x1251('0x24')](handleEntityNotFound(_0x380da4,null))[_0x1251('0x24')](function(_0x40abfe){if(_0x40abfe){_0x20aaff=_0x40abfe;_0x25de14[_0x1251('0x2b')]=_[_0x1251('0x42')](db[_0x1251('0x49')][_0x1251('0x4a')]);_0x25de14[_0x1251('0x2d')]=_[_0x1251('0x42')](_0x6d92d8[_0x1251('0x2d')]);_0x25de14[_0x1251('0x37')]=_[_0x1251('0x2e')](_0x25de14[_0x1251('0x2b')],_0x25de14['query']);_0x14d909[_0x1251('0x2f')]=_[_0x1251('0x2e')](_0x25de14[_0x1251('0x2b')],qs[_0x1251('0x30')](_0x6d92d8[_0x1251('0x2d')][_0x1251('0x30')]));_0x14d909[_0x1251('0x2f')]=_0x14d909[_0x1251('0x2f')][_0x1251('0x31')]?_0x14d909[_0x1251('0x2f')]:_0x25de14[_0x1251('0x2b')];_0x14d909[_0x1251('0x4b')]=qs[_0x1251('0x35')](_0x6d92d8[_0x1251('0x2d')][_0x1251('0x35')]);_0x14d909['where']=qs[_0x1251('0x37')](_[_0x1251('0x38')](_0x6d92d8[_0x1251('0x2d')],_0x25de14[_0x1251('0x37')]));if(_0x6d92d8[_0x1251('0x2d')][_0x1251('0x3b')]){_0x14d909['where']=_[_0x1251('0x39')](_0x14d909[_0x1251('0x36')],{'$or':_[_0x1251('0x2c')](_0x14d909[_0x1251('0x2f')],function(_0x23d510){var _0x3085a6={};_0x3085a6[_0x23d510]={'$like':'%'+_0x6d92d8[_0x1251('0x2d')]['filter']+'%'};return _0x3085a6;})});}_0x14d909=_['merge']({},_0x14d909,_0x6d92d8[_0x1251('0x3c')]);return _0x20aaff[_0x1251('0x48')](_0x14d909);}})['then'](function(_0x9701cf){if(_0x9701cf){_0x41772b=_0x9701cf['length'];if(!_0x6d92d8[_0x1251('0x2d')][_0x1251('0x32')]('nolimit')){_0x14d909[_0x1251('0x34')]=qs[_0x1251('0x34')](_0x6d92d8[_0x1251('0x2d')]['limit']);_0x14d909[_0x1251('0x1b')]=qs['offset'](_0x6d92d8['query'][_0x1251('0x1b')]);}return _0x20aaff[_0x1251('0x48')](_0x14d909);}})['then'](function(_0x341c0d){if(_0x341c0d){return _0x341c0d?{'count':_0x41772b,'rows':_0x341c0d}:null;}})[_0x1251('0x24')](respondWithResult(_0x380da4,null))[_0x1251('0x41')](handleError(_0x380da4,null));};exports[_0x1251('0x4c')]=function(_0x31e577,_0x7c7a26,_0x34a79a){if(_0x31e577['body']['id']){delete _0x31e577[_0x1251('0x45')]['id'];}return db['VtigerAccount'][_0x1251('0x4d')]({'where':{'id':_0x31e577[_0x1251('0x46')]['id']}})[_0x1251('0x24')](handleEntityNotFound(_0x7c7a26,null))[_0x1251('0x24')](function(_0x19f66e){if(_0x19f66e){_0x31e577[_0x1251('0x45')][_0x1251('0x4e')]=_0x19f66e['id'];_0x31e577[_0x1251('0x45')][_0x1251('0x4f')]=integrations[_0x1251('0x50')](_0x31e577[_0x1251('0x45')][_0x1251('0x51')],_0x31e577[_0x1251('0x45')][_0x1251('0x29')]);_0x31e577['body'][_0x1251('0x52')]=integrations[_0x1251('0x53')](_0x31e577[_0x1251('0x45')][_0x1251('0x51')],_0x31e577[_0x1251('0x45')][_0x1251('0x29')]);return db['VtigerConfiguration'][_0x1251('0x44')](_0x31e577[_0x1251('0x45')],{'include':[{'model':db[_0x1251('0x54')],'as':_0x1251('0x4f')},{'model':db['VtigerField'],'as':_0x1251('0x52')}]});}return null;})['then'](respondWithResult(_0x7c7a26,null))['catch'](handleError(_0x7c7a26,null));};var md5=require('md5');exports[_0x1251('0x55')]=function(_0x32aa3b,_0xd9f4b3,_0x1d54e6){var _0x37c255=null;var _0x3e3eb5=null;var _0x52dfa9=null;var _0x2221eb=null;var _0x208a68='';return db[_0x1251('0x28')][_0x1251('0x4d')]({'where':{'id':_0x32aa3b[_0x1251('0x46')]['id']},'attributes':['id',_0x1251('0x26'),_0x1251('0x56'),_0x1251('0x57'),_0x1251('0x58'),_0x1251('0x59'),_0x1251('0x5a'),'accessKey']})[_0x1251('0x24')](handleEntityNotFound(_0xd9f4b3,null))['then'](function(_0x53ddc8){if(_0x53ddc8){_0x37c255=_0x53ddc8[_0x1251('0x56')];_0x3e3eb5=_0x53ddc8[_0x1251('0x5b')];_0x52dfa9=_0x53ddc8[_0x1251('0x58')];_0x208a68=_0x53ddc8[_0x1251('0x59')];var _0x26c42a=_0x208a68[_0x1251('0x5c')](-0x1);if(_0x26c42a==='/'){_0x208a68=_0x208a68['substring'](0x0,_0x208a68['lastIndexOf'](_0x26c42a));}_0x2221eb=util['format']('%s/webservice.php',_0x208a68);var _0x50dc61={'method':_0x1251('0x5d'),'uri':_0x2221eb,'qs':{'operation':_0x1251('0x5e'),'username':_0x53ddc8['username']},'json':!![]};return rp(_0x50dc61);}})['then'](function(_0x18de8e){if(_0x18de8e[_0x1251('0x5f')]){var _0x23e146={'method':_0x1251('0x60'),'uri':_0x2221eb,'form':{'operation':_0x1251('0x61'),'username':_0x37c255,'accessKey':md5(_0x18de8e[_0x1251('0x62')]['token']+_0x3e3eb5)},'json':!![]};return rp(_0x23e146);}})[_0x1251('0x24')](function(_0x4fd11f){if(_0x4fd11f[_0x1251('0x5f')]){var _0x5959b6={'method':_0x1251('0x5d'),'uri':_0x2221eb,'qs':{'operation':_0x1251('0x63'),'username':_0x37c255,'sessionName':_0x4fd11f[_0x1251('0x62')][_0x1251('0x64')],'elementType':_0x52dfa9},'json':!![]};return rp(_0x5959b6);}})['then'](function(_0x5458f9){if(_0x5458f9[_0x1251('0x5f')]){var _0x28fbea=[_0x1251('0x65'),_0x1251('0x66'),_0x1251('0x67')];_[_0x1251('0x68')](_0x5458f9[_0x1251('0x62')][_0x1251('0x30')],function(_0xd16322){return _0x28fbea[_0x1251('0x69')](_0xd16322['type'][_0x1251('0x26')]);});_[_0x1251('0x68')](_0x5458f9[_0x1251('0x62')][_0x1251('0x30')],function(_0x160822){return _0x160822[_0x1251('0x6a')]===_0x1251('0x6b');});return{'count':_0x5458f9['result'][_0x1251('0x30')][_0x1251('0x31')],'rows':_[_0x1251('0x2c')](_0x5458f9[_0x1251('0x62')][_0x1251('0x30')],function(_0x39cb59){return{'id':_0x39cb59[_0x1251('0x26')],'name':_0x39cb59[_0x1251('0x6c')],'custom':_['startsWith'](_0x39cb59[_0x1251('0x26')],_0x1251('0x6d'))?!![]:![],'options':_0x39cb59['type'][_0x1251('0x26')]===_0x1251('0x6e')&&_0x39cb59[_0x1251('0x29')][_0x1251('0x6f')][_0x1251('0x31')]>0x0?_[_0x1251('0x2c')](_0x39cb59['type'][_0x1251('0x6f')],function(_0x524efc){return{'name':_0x524efc[_0x1251('0x6c')],'value':_0x524efc[_0x1251('0x70')]};}):[]};})};}})[_0x1251('0x24')](respondWithResult(_0xd9f4b3,null))[_0x1251('0x41')](function(_0xa83217){console[_0x1251('0x71')](_0x1251('0x72')+_0xa83217);var _0x24542c=_0x32aa3b[_0x1251('0x2d')][_0x1251('0x73')]?0x1f4:_0xa83217['statusCode']||0x1f4;logger[_0x1251('0x25')](_0x1251('0x74'),'getFields',_0x24542c,JSON[_0x1251('0x75')](_0xa83217));delete _0xa83217[_0x1251('0x26')];if(_0x24542c===0x191){_0x24542c=0x190;}_0xd9f4b3[_0x1251('0x19')](_0x24542c)[_0x1251('0x76')](_0x32aa3b[_0x1251('0x2d')][_0x1251('0x73')]?{'message':_0x1251('0x77'),'statusCode':_0xa83217[_0x1251('0x78')]}:_0xa83217);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a186cc6..b9c3426 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 _0xb68f=['api','moment','bluebird','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','util'];(function(_0x290884,_0x53a7cb){var _0xd36ef7=function(_0x177d00){while(--_0x177d00){_0x290884['push'](_0x290884['shift']());}};_0xd36ef7(++_0x53a7cb);}(_0xb68f,0x1e3));var _0xfb68=function(_0x5dc24b,_0x5dd6f3){_0x5dc24b=_0x5dc24b-0x0;var _0x58d64e=_0xb68f[_0x5dc24b];return _0x58d64e;};'use strict';var _=require('lodash');var util=require(_0xfb68('0x0'));var logger=require('../../config/logger')(_0xfb68('0x1'));var moment=require(_0xfb68('0x2'));var BPromise=require(_0xfb68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfb68('0x4'));var config=require(_0xfb68('0x5'));var attributes=require(_0xfb68('0x6'));var integrations=require(_0xfb68('0x7'));module[_0xfb68('0x8')]=function(_0x7f03b7,_0x138501){return _0x7f03b7['define'](_0xfb68('0x9'),attributes,{'tableName':_0xfb68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6749=['moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x56cccb,_0x205a85){var _0x259719=function(_0x4eca46){while(--_0x4eca46){_0x56cccb['push'](_0x56cccb['shift']());}};_0x259719(++_0x205a85);}(_0x6749,0xd5));var _0x9674=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6749[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9674('0x0'));var util=require(_0x9674('0x1'));var logger=require(_0x9674('0x2'))('api');var moment=require(_0x9674('0x3'));var BPromise=require(_0x9674('0x4'));var rp=require(_0x9674('0x5'));var fs=require('fs');var path=require(_0x9674('0x6'));var rimraf=require(_0x9674('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x9674('0x8'));module[_0x9674('0x9')]=function(_0x519a18,_0x5dd159){return _0x519a18[_0x9674('0xa')]('VtigerAccount',attributes,{'tableName':_0x9674('0xb'),'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 ee19d1b..a8362a0 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 _0x5423=['options','raw','where','limit','include','attributes','map','model','then','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll'];(function(_0x18ed8e,_0x3ac388){var _0x1f0566=function(_0x3cf009){while(--_0x3cf009){_0x18ed8e['push'](_0x18ed8e['shift']());}};_0x1f0566(++_0x3ac388);}(_0x5423,0xe3));var _0x3542=function(_0x239ba8,_0x1ca7d){_0x239ba8=_0x239ba8-0x0;var _0x2226d7=_0x5423[_0x239ba8];return _0x2226d7;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var moment=require('moment');var BPromise=require(_0x3542('0x2'));var rs=require(_0x3542('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3542('0x4'))['db'];var utils=require(_0x3542('0x5'));var logger=require(_0x3542('0x6'))(_0x3542('0x7'));var config=require('../../config/environment');var jayson=require(_0x3542('0x8'));var client=jayson[_0x3542('0x9')][_0x3542('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c3fa,_0x2e1a62,_0x55413c){return new BPromise(function(_0x4cdc86,_0xbc51ab){return client[_0x3542('0xb')](_0x29c3fa,_0x55413c)['then'](function(_0x681195){logger[_0x3542('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'));logger[_0x3542('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x2e1a62,_0x3542('0xd'),JSON[_0x3542('0xf')](_0x681195));if(_0x681195[_0x3542('0x10')]){if(_0x681195[_0x3542('0x10')][_0x3542('0x11')]===0x1f4){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195[_0x3542('0x10')][_0x3542('0x13')]);return _0xbc51ab(_0x681195[_0x3542('0x10')][_0x3542('0x13')]);}logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x681195['error'][_0x3542('0x13')]);return _0x4cdc86(_0x681195['error'][_0x3542('0x13')]);}else{logger[_0x3542('0xc')](_0x3542('0x12'),_0x2e1a62,'request\x20sent');_0x4cdc86(_0x681195[_0x3542('0x14')][_0x3542('0x13')]);}})[_0x3542('0x15')](function(_0x5726af){logger[_0x3542('0x10')](_0x3542('0x12'),_0x2e1a62,_0x5726af);_0xbc51ab(_0x5726af);});});}exports[_0x3542('0x16')]=function(_0x3d5199){var _0x493d95=this;return new Promise(function(_0x32df3f,_0x53d4aa){return db[_0x3542('0x17')][_0x3542('0x18')]({'raw':_0x3d5199['options']?_0x3d5199[_0x3542('0x19')][_0x3542('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d5199[_0x3542('0x19')]?_0x3d5199[_0x3542('0x19')][_0x3542('0x1b')]||null:null,'attributes':_0x3d5199['options']?_0x3d5199['options']['attributes']||null:null,'limit':_0x3d5199[_0x3542('0x19')]?_0x3d5199['options'][_0x3542('0x1c')]||null:null,'include':_0x3d5199['options']?_0x3d5199[_0x3542('0x19')]['include']?_['map'](_0x3d5199[_0x3542('0x19')][_0x3542('0x1d')],function(_0x5ae097){return{'model':db[_0x5ae097['model']],'as':_0x5ae097['as'],'attributes':_0x5ae097[_0x3542('0x1e')],'include':_0x5ae097['include']?_[_0x3542('0x1f')](_0x5ae097[_0x3542('0x1d')],function(_0x1e0723){return{'model':db[_0x1e0723[_0x3542('0x20')]],'as':_0x1e0723['as'],'attributes':_0x1e0723[_0x3542('0x1e')],'include':_0x1e0723[_0x3542('0x1d')]?_[_0x3542('0x1f')](_0x1e0723[_0x3542('0x1d')],function(_0x18dc6c){return{'model':db[_0x18dc6c[_0x3542('0x20')]],'as':_0x18dc6c['as'],'attributes':_0x18dc6c[_0x3542('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3542('0x21')](function(_0x220021){logger[_0x3542('0xc')](_0x3542('0x16'),_0x3d5199);logger[_0x3542('0xe')](_0x3542('0x16'),_0x3d5199,JSON[_0x3542('0xf')](_0x220021));_0x32df3f(_0x220021);})[_0x3542('0x15')](function(_0x5590a2){logger[_0x3542('0x10')](_0x3542('0x16'),_0x5590a2[_0x3542('0x13')],_0x3d5199);_0x53d4aa(_0x493d95['error'](0x1f4,_0x5590a2[_0x3542('0x13')]));});});};exports[_0x3542('0x22')]=function(_0x2e883a){var _0x30b5e8=this;return new Promise(function(_0x5c882f,_0x5a274b){return db[_0x3542('0x17')][_0x3542('0x23')]({'raw':_0x2e883a[_0x3542('0x19')]?_0x2e883a[_0x3542('0x19')][_0x3542('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e883a[_0x3542('0x19')]?_0x2e883a[_0x3542('0x19')]['where']||null:null,'attributes':_0x2e883a['options']?_0x2e883a[_0x3542('0x19')]['attributes']||null:null,'include':_0x2e883a['options']?_0x2e883a[_0x3542('0x19')]['include']?_['map'](_0x2e883a[_0x3542('0x19')][_0x3542('0x1d')],function(_0x1bf178){return{'model':db[_0x1bf178['model']],'as':_0x1bf178['as'],'attributes':_0x1bf178[_0x3542('0x1e')],'include':_0x1bf178['include']?_[_0x3542('0x1f')](_0x1bf178[_0x3542('0x1d')],function(_0x561fd0){return{'model':db[_0x561fd0[_0x3542('0x20')]],'as':_0x561fd0['as'],'attributes':_0x561fd0['attributes'],'include':_0x561fd0[_0x3542('0x1d')]?_[_0x3542('0x1f')](_0x561fd0[_0x3542('0x1d')],function(_0x4cfb8f){return{'model':db[_0x4cfb8f[_0x3542('0x20')]],'as':_0x4cfb8f['as'],'attributes':_0x4cfb8f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3542('0x21')](function(_0x1fe5c6){logger[_0x3542('0xc')](_0x3542('0x22'),_0x2e883a);logger[_0x3542('0xe')](_0x3542('0x22'),_0x2e883a,JSON[_0x3542('0xf')](_0x1fe5c6));_0x5c882f(_0x1fe5c6);})[_0x3542('0x15')](function(_0x110aa8){logger[_0x3542('0x10')](_0x3542('0x22'),_0x110aa8[_0x3542('0x13')],_0x2e883a);_0x5a274b(_0x30b5e8[_0x3542('0x10')](0x1f4,_0x110aa8['message']));});});}; \ No newline at end of file +var _0x9354=['catch','GetVtigerAccount','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowVtigerAccount','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x5185a8,_0x1fe687){var _0x2cf064=function(_0x1cbd07){while(--_0x1cbd07){_0x5185a8['push'](_0x5185a8['shift']());}};_0x2cf064(++_0x1fe687);}(_0x9354,0x96));var _0x4935=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0x9354[_0x5401ae];return _0x286068;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e47bd,_0x118d36,_0x2d735e){return new BPromise(function(_0x10793e,_0x4c9902){return client[_0x4935('0xb')](_0x2e47bd,_0x2d735e)['then'](function(_0x2aac9a){logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));logger[_0x4935('0xf')](_0x4935('0x10'),_0x118d36,'request\x20sent',JSON['stringify'](_0x2aac9a));if(_0x2aac9a[_0x4935('0x11')]){if(_0x2aac9a['error']['code']===0x1f4){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x4c9902(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x10793e(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}else{logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));_0x10793e(_0x2aac9a[_0x4935('0x13')]['message']);}})[_0x4935('0x14')](function(_0x46526a){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x46526a);_0x4c9902(_0x46526a);});});}exports[_0x4935('0x15')]=function(_0x429ef3){var _0x4ebc63=this;return new Promise(function(_0xd70eff,_0x145277){return db['VtigerAccount'][_0x4935('0x16')]({'raw':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x18')]||null:null,'attributes':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x19')]||null:null,'limit':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x1a')]||null:null,'include':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')],function(_0x53530f){return{'model':db[_0x53530f['model']],'as':_0x53530f['as'],'attributes':_0x53530f[_0x4935('0x19')],'include':_0x53530f[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x53530f[_0x4935('0x1b')],function(_0x344e51){return{'model':db[_0x344e51[_0x4935('0x1d')]],'as':_0x344e51['as'],'attributes':_0x344e51[_0x4935('0x19')],'include':_0x344e51[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x344e51[_0x4935('0x1b')],function(_0x1d08b5){return{'model':db[_0x1d08b5[_0x4935('0x1d')]],'as':_0x1d08b5['as'],'attributes':_0x1d08b5[_0x4935('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x359522){logger['info']('GetVtigerAccount',_0x429ef3);logger['debug'](_0x4935('0x15'),_0x429ef3,JSON[_0x4935('0x1f')](_0x359522));_0xd70eff(_0x359522);})['catch'](function(_0x3f0707){logger[_0x4935('0x11')](_0x4935('0x15'),_0x3f0707[_0x4935('0x12')],_0x429ef3);_0x145277(_0x4ebc63[_0x4935('0x11')](0x1f4,_0x3f0707[_0x4935('0x12')]));});});};exports[_0x4935('0x20')]=function(_0x2fe6da){var _0x5b3c8e=this;return new Promise(function(_0xb7fe2a,_0x2dcb0b){return db['VtigerAccount']['find']({'raw':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da['options'][_0x4935('0x21')]===undefined?!![]:![]:!![],'where':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da[_0x4935('0x17')]['where']||null:null,'attributes':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x19')]||null:null,'include':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')],function(_0x4a69bc){return{'model':db[_0x4a69bc['model']],'as':_0x4a69bc['as'],'attributes':_0x4a69bc[_0x4935('0x19')],'include':_0x4a69bc[_0x4935('0x1b')]?_['map'](_0x4a69bc['include'],function(_0xb3d934){return{'model':db[_0xb3d934['model']],'as':_0xb3d934['as'],'attributes':_0xb3d934[_0x4935('0x19')],'include':_0xb3d934[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0xb3d934[_0x4935('0x1b')],function(_0x1d77b8){return{'model':db[_0x1d77b8[_0x4935('0x1d')]],'as':_0x1d77b8['as'],'attributes':_0x1d77b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x51b7ac){logger[_0x4935('0xc')]('ShowVtigerAccount',_0x2fe6da);logger[_0x4935('0xf')]('ShowVtigerAccount',_0x2fe6da,JSON[_0x4935('0x1f')](_0x51b7ac));_0xb7fe2a(_0x51b7ac);})[_0x4935('0x14')](function(_0x352679){logger[_0x4935('0x11')](_0x4935('0x20'),_0x352679[_0x4935('0x12')],_0x2fe6da);_0x2dcb0b(_0x5b3c8e[_0x4935('0x11')](0x1f4,_0x352679['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 2a5530d..9f66a72 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 _0xd005=['index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x336c66,_0x1d1b0f){var _0x5ee5bc=function(_0x2b093d){while(--_0x2b093d){_0x336c66['push'](_0x336c66['shift']());}};_0x5ee5bc(++_0x1d1b0f);}(_0xd005,0x160));var _0x5d00=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd005[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5d00('0x0'));var util=require(_0x5d00('0x1'));var path=require(_0x5d00('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d00('0x3'));var router=express[_0x5d00('0x4')]();var fs_extra=require(_0x5d00('0x5'));var auth=require(_0x5d00('0x6'));var interaction=require(_0x5d00('0x7'));var config=require(_0x5d00('0x8'));var controller=require(_0x5d00('0x9'));router[_0x5d00('0xa')]('/',auth[_0x5d00('0xb')](),controller[_0x5d00('0xc')]);router['get'](_0x5d00('0xd'),auth[_0x5d00('0xb')](),controller[_0x5d00('0xe')]);router[_0x5d00('0xa')](_0x5d00('0xf'),auth['isAuthenticated'](),controller[_0x5d00('0x10')]);router['get'](_0x5d00('0x11'),auth[_0x5d00('0xb')](),controller[_0x5d00('0x12')]);router[_0x5d00('0xa')](_0x5d00('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x5d00('0x14')]('/',auth[_0x5d00('0xb')](),controller[_0x5d00('0x15')]);router[_0x5d00('0x16')](_0x5d00('0xd'),auth[_0x5d00('0xb')](),controller[_0x5d00('0x17')]);router['delete'](_0x5d00('0xd'),auth[_0x5d00('0xb')](),controller[_0x5d00('0x18')]);module[_0x5d00('0x19')]=router; \ No newline at end of file +var _0xcb40=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show'];(function(_0x20579c,_0xc6f3b2){var _0x594e57=function(_0x440303){while(--_0x440303){_0x20579c['push'](_0x20579c['shift']());}};_0x594e57(++_0xc6f3b2);}(_0xcb40,0x196));var _0x0cb4=function(_0x53cb6f,_0x46c2c8){_0x53cb6f=_0x53cb6f-0x0;var _0x6d39aa=_0xcb40[_0x53cb6f];return _0x6d39aa;};'use strict';var multer=require(_0x0cb4('0x0'));var util=require('util');var path=require(_0x0cb4('0x1'));var timeout=require(_0x0cb4('0x2'));var express=require(_0x0cb4('0x3'));var router=express['Router']();var fs_extra=require(_0x0cb4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0cb4('0x5'));var config=require(_0x0cb4('0x6'));var controller=require(_0x0cb4('0x7'));router[_0x0cb4('0x8')]('/',auth[_0x0cb4('0x9')](),controller['index']);router['get'](_0x0cb4('0xa'),auth[_0x0cb4('0x9')](),controller[_0x0cb4('0xb')]);router[_0x0cb4('0x8')](_0x0cb4('0xc'),auth[_0x0cb4('0x9')](),controller[_0x0cb4('0xd')]);router['get'](_0x0cb4('0xe'),auth[_0x0cb4('0x9')](),controller[_0x0cb4('0xf')]);router['get'](_0x0cb4('0x10'),auth[_0x0cb4('0x9')](),controller[_0x0cb4('0x11')]);router[_0x0cb4('0x12')]('/',auth['isAuthenticated'](),controller[_0x0cb4('0x13')]);router[_0x0cb4('0x14')](_0x0cb4('0xa'),auth[_0x0cb4('0x9')](),controller['update']);router['delete'](_0x0cb4('0xa'),auth[_0x0cb4('0x9')](),controller['destroy']);module[_0x0cb4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 2db2570..b613b12 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 _0x2832=['exports','STRING','sequelize'];(function(_0x31fd80,_0xa2dd3f){var _0xb0a917=function(_0x1034ce){while(--_0x1034ce){_0x31fd80['push'](_0x31fd80['shift']());}};_0xb0a917(++_0xa2dd3f);}(_0x2832,0xf2));var _0x2283=function(_0x570101,_0x42ee7e){_0x570101=_0x570101-0x0;var _0x2cf76e=_0x2832[_0x570101];return _0x2cf76e;};'use strict';var Sequelize=require(_0x2283('0x0'));module[_0x2283('0x1')]={'name':{'type':Sequelize[_0x2283('0x2')]},'description':{'type':Sequelize[_0x2283('0x2')]}}; \ No newline at end of file +var _0x0281=['sequelize','exports'];(function(_0x3a5e9f,_0x3c5d8b){var _0x37d7ce=function(_0x549f40){while(--_0x549f40){_0x3a5e9f['push'](_0x3a5e9f['shift']());}};_0x37d7ce(++_0x3c5d8b);}(_0x0281,0xde));var _0x1028=function(_0x1be0b8,_0x2fed13){_0x1be0b8=_0x1be0b8-0x0;var _0x5960fd=_0x0281[_0x1be0b8];return _0x5960fd;};'use strict';var Sequelize=require(_0x1028('0x0'));module[_0x1028('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 5425287..b361057 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 _0x95ce=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','VtigerConfiguration','includeAll','include','findAll','rows','show','params','catch','create','body','find','findOne','VtigerField','order','getFields','getSubjects','getDescriptions','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys'];(function(_0x53a6c0,_0x53df9a){var _0x30c452=function(_0x34f3ed){while(--_0x34f3ed){_0x53a6c0['push'](_0x53a6c0['shift']());}};_0x30c452(++_0x53df9a);}(_0x95ce,0x1e6));var _0xe95c=function(_0x591483,_0x2a82fb){_0x591483=_0x591483-0x0;var _0x31d6ea=_0x95ce[_0x591483];return _0x31d6ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe95c('0x0'));var zipdir=require(_0xe95c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe95c('0x2'));var BPromise=require(_0xe95c('0x3'));var Mustache=require(_0xe95c('0x4'));var util=require(_0xe95c('0x5'));var path=require(_0xe95c('0x6'));var sox=require(_0xe95c('0x7'));var csv=require(_0xe95c('0x8'));var ejs=require(_0xe95c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe95c('0xa'));var squel=require(_0xe95c('0xb'));var crypto=require(_0xe95c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe95c('0x8'));var querystring=require(_0xe95c('0xd'));var Papa=require(_0xe95c('0xe'));var Redis=require('ioredis');var authService=require(_0xe95c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe95c('0x10'));var logger=require(_0xe95c('0x11'))(_0xe95c('0x12'));var utils=require('../../config/utils');var config=require(_0xe95c('0x13'));var licenseUtil=require(_0xe95c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x878572,_0x302672){_0x302672=_0x302672||0xcc;return function(_0x1feba5){if(_0x1feba5){return _0x878572[_0xe95c('0x15')](_0x302672);}return _0x878572[_0xe95c('0x16')](_0x302672)[_0xe95c('0x17')]();};}function respondWithResult(_0x5b7eb6,_0x1e5f08){_0x1e5f08=_0x1e5f08||0xc8;return function(_0x241917){if(_0x241917){return _0x5b7eb6[_0xe95c('0x16')](_0x1e5f08)['json'](_0x241917);}};}function respondWithFilteredResult(_0x49248a,_0x5ac5db){return function(_0x42301d){if(_0x42301d){var _0x236b76=typeof _0x5ac5db[_0xe95c('0x18')]===_0xe95c('0x19')&&typeof _0x5ac5db[_0xe95c('0x1a')]===_0xe95c('0x19');var _0x16872b=_0x42301d[_0xe95c('0x1b')];var _0x17b96d=_0x236b76?0x0:_0x5ac5db[_0xe95c('0x18')];var _0x2a5fd8=_0x236b76?_0x42301d['count']:_0x5ac5db[_0xe95c('0x18')]+_0x5ac5db[_0xe95c('0x1a')];var _0x2d2d21;if(_0x2a5fd8>=_0x16872b){_0x2a5fd8=_0x16872b;_0x2d2d21=0xc8;}else{_0x2d2d21=0xce;}_0x49248a['status'](_0x2d2d21);return _0x49248a[_0xe95c('0x1c')]('Content-Range',_0x17b96d+'-'+_0x2a5fd8+'/'+_0x16872b)[_0xe95c('0x1d')](_0x42301d);}return null;};}function patchUpdates(_0x38f411){return function(_0x114fdb){try{jsonpatch[_0xe95c('0x1e')](_0x114fdb,_0x38f411,!![]);}catch(_0x1eb18e){return BPromise[_0xe95c('0x1f')](_0x1eb18e);}return _0x114fdb[_0xe95c('0x20')]();};}function saveUpdates(_0x15eda8,_0x2b60fc){return function(_0x21bad4){if(_0x21bad4){return _0x21bad4[_0xe95c('0x21')](_0x15eda8)[_0xe95c('0x22')](function(_0x5e2f4f){return _0x5e2f4f;});}return null;};}function removeEntity(_0x1ebc67,_0x1f9c5a){return function(_0x2795d9){if(_0x2795d9){return _0x2795d9[_0xe95c('0x23')]()[_0xe95c('0x22')](function(){_0x1ebc67[_0xe95c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc218,_0x121ed9){return function(_0x59a160){if(!_0x59a160){_0x2dc218[_0xe95c('0x15')](0x194);}return _0x59a160;};}function handleError(_0x511538,_0x1531b2){_0x1531b2=_0x1531b2||0x1f4;return function(_0x5d4c50){logger['error'](_0x5d4c50[_0xe95c('0x24')]);if(_0x5d4c50['name']){delete _0x5d4c50[_0xe95c('0x25')];}_0x511538[_0xe95c('0x16')](_0x1531b2)[_0xe95c('0x26')](_0x5d4c50);};}exports['index']=function(_0x187602,_0x22ea2a){var _0xdb56bf={},_0x298ff7={},_0x12b247={'count':0x0,'rows':[]};var _0x1f03f9=_[_0xe95c('0x27')](db['VtigerConfiguration'][_0xe95c('0x28')],function(_0x26c114){return{'name':_0x26c114[_0xe95c('0x29')],'type':_0x26c114[_0xe95c('0x2a')]['key']};});_0x298ff7[_0xe95c('0x2b')]=_['map'](_0x1f03f9,_0xe95c('0x25'));_0x298ff7[_0xe95c('0x2c')]=_[_0xe95c('0x2d')](_0x187602[_0xe95c('0x2c')]);_0x298ff7['filters']=_[_0xe95c('0x2e')](_0x298ff7[_0xe95c('0x2b')],_0x298ff7[_0xe95c('0x2c')]);_0xdb56bf[_0xe95c('0x2f')]=_[_0xe95c('0x2e')](_0x298ff7['model'],qs['fields'](_0x187602[_0xe95c('0x2c')][_0xe95c('0x30')]));_0xdb56bf[_0xe95c('0x2f')]=_0xdb56bf[_0xe95c('0x2f')][_0xe95c('0x31')]?_0xdb56bf['attributes']:_0x298ff7[_0xe95c('0x2b')];if(!_0x187602[_0xe95c('0x2c')][_0xe95c('0x32')](_0xe95c('0x33'))){_0xdb56bf['limit']=qs['limit'](_0x187602[_0xe95c('0x2c')][_0xe95c('0x1a')]);_0xdb56bf[_0xe95c('0x18')]=qs[_0xe95c('0x18')](_0x187602[_0xe95c('0x2c')][_0xe95c('0x18')]);}_0xdb56bf['order']=qs['sort'](_0x187602[_0xe95c('0x2c')][_0xe95c('0x34')]);_0xdb56bf[_0xe95c('0x35')]=qs[_0xe95c('0x36')](_[_0xe95c('0x37')](_0x187602[_0xe95c('0x2c')],_0x298ff7['filters']),_0x1f03f9);if(_0x187602[_0xe95c('0x2c')][_0xe95c('0x38')]){_0xdb56bf[_0xe95c('0x35')]=_['merge'](_0xdb56bf[_0xe95c('0x35')],{'$or':_['map'](_0x1f03f9,function(_0xd2c58a){if(_0xd2c58a[_0xe95c('0x2a')]!=='VIRTUAL'){var _0x5656b8={};_0x5656b8[_0xd2c58a[_0xe95c('0x25')]]={'$like':'%'+_0x187602['query'][_0xe95c('0x38')]+'%'};return _0x5656b8;}})});}_0xdb56bf=_[_0xe95c('0x39')]({},_0xdb56bf,_0x187602[_0xe95c('0x3a')]);var _0x5fb833={'where':_0xdb56bf[_0xe95c('0x35')]};return db[_0xe95c('0x3b')][_0xe95c('0x1b')](_0x5fb833)[_0xe95c('0x22')](function(_0x455469){_0x12b247[_0xe95c('0x1b')]=_0x455469;if(_0x187602['query'][_0xe95c('0x3c')]){_0xdb56bf[_0xe95c('0x3d')]=[{'all':!![]}];}return db[_0xe95c('0x3b')][_0xe95c('0x3e')](_0xdb56bf);})[_0xe95c('0x22')](function(_0x45b362){_0x12b247[_0xe95c('0x3f')]=_0x45b362;return _0x12b247;})[_0xe95c('0x22')](respondWithFilteredResult(_0x22ea2a,_0xdb56bf))['catch'](handleError(_0x22ea2a,null));};exports[_0xe95c('0x40')]=function(_0x27732a,_0x1888be){var _0x140bfb={'raw':![],'where':{'id':_0x27732a[_0xe95c('0x41')]['id']}},_0x3ba42f={};_0x3ba42f['model']=_[_0xe95c('0x2d')](db[_0xe95c('0x3b')][_0xe95c('0x28')]);_0x3ba42f['query']=_[_0xe95c('0x2d')](_0x27732a['query']);_0x3ba42f[_0xe95c('0x36')]=_['intersection'](_0x3ba42f[_0xe95c('0x2b')],_0x3ba42f[_0xe95c('0x2c')]);_0x140bfb['attributes']=_['intersection'](_0x3ba42f['model'],qs[_0xe95c('0x30')](_0x27732a[_0xe95c('0x2c')][_0xe95c('0x30')]));_0x140bfb[_0xe95c('0x2f')]=_0x140bfb['attributes']['length']?_0x140bfb[_0xe95c('0x2f')]:_0x3ba42f[_0xe95c('0x2b')];if(_0x27732a[_0xe95c('0x2c')][_0xe95c('0x3c')]){_0x140bfb[_0xe95c('0x3d')]=[{'all':!![]}];}_0x140bfb=_[_0xe95c('0x39')]({},_0x140bfb,_0x27732a['options']);return db[_0xe95c('0x3b')]['find'](_0x140bfb)[_0xe95c('0x22')](handleEntityNotFound(_0x1888be,null))[_0xe95c('0x22')](respondWithResult(_0x1888be,null))[_0xe95c('0x42')](handleError(_0x1888be,null));};exports[_0xe95c('0x43')]=function(_0x2377bb,_0x2fa75f){return db[_0xe95c('0x3b')]['create'](_0x2377bb[_0xe95c('0x44')],{})[_0xe95c('0x22')](respondWithResult(_0x2fa75f,0xc9))[_0xe95c('0x42')](handleError(_0x2fa75f,null));};exports[_0xe95c('0x21')]=function(_0x60a610,_0x233714){if(_0x60a610[_0xe95c('0x44')]['id']){delete _0x60a610[_0xe95c('0x44')]['id'];}return db[_0xe95c('0x3b')][_0xe95c('0x45')]({'where':{'id':_0x60a610[_0xe95c('0x41')]['id']}})[_0xe95c('0x22')](handleEntityNotFound(_0x233714,null))[_0xe95c('0x22')](saveUpdates(_0x60a610[_0xe95c('0x44')],null))[_0xe95c('0x22')](respondWithResult(_0x233714,null))['catch'](handleError(_0x233714,null));};exports['destroy']=function(_0x5394a9,_0x472dfd){return db['VtigerConfiguration'][_0xe95c('0x45')]({'where':{'id':_0x5394a9['params']['id']}})['then'](handleEntityNotFound(_0x472dfd,null))[_0xe95c('0x22')](removeEntity(_0x472dfd,null))[_0xe95c('0x42')](handleError(_0x472dfd,null));};exports['getFields']=function(_0x23db9f,_0x1a2227,_0x5ca673){var _0xd69e0d={};var _0x907800={};var _0x504014;var _0x516ef2;return db['VtigerConfiguration'][_0xe95c('0x46')]({'where':{'id':_0x23db9f[_0xe95c('0x41')]['id']}})[_0xe95c('0x22')](handleEntityNotFound(_0x1a2227,null))[_0xe95c('0x22')](function(_0x3ac7a2){if(_0x3ac7a2){_0x504014=_0x3ac7a2;_0x907800[_0xe95c('0x2b')]=_[_0xe95c('0x2d')](db[_0xe95c('0x47')][_0xe95c('0x28')]);_0x907800[_0xe95c('0x2c')]=_['keys'](_0x23db9f[_0xe95c('0x2c')]);_0x907800[_0xe95c('0x36')]=_['intersection'](_0x907800[_0xe95c('0x2b')],_0x907800[_0xe95c('0x2c')]);_0xd69e0d[_0xe95c('0x2f')]=_[_0xe95c('0x2e')](_0x907800[_0xe95c('0x2b')],qs[_0xe95c('0x30')](_0x23db9f[_0xe95c('0x2c')][_0xe95c('0x30')]));_0xd69e0d[_0xe95c('0x2f')]=_0xd69e0d[_0xe95c('0x2f')]['length']?_0xd69e0d[_0xe95c('0x2f')]:_0x907800[_0xe95c('0x2b')];_0xd69e0d[_0xe95c('0x48')]=qs[_0xe95c('0x34')](_0x23db9f[_0xe95c('0x2c')][_0xe95c('0x34')]);_0xd69e0d['where']=qs['filters'](_['pick'](_0x23db9f[_0xe95c('0x2c')],_0x907800[_0xe95c('0x36')]));if(_0x23db9f[_0xe95c('0x2c')][_0xe95c('0x38')]){_0xd69e0d['where']=_[_0xe95c('0x39')](_0xd69e0d[_0xe95c('0x35')],{'$or':_[_0xe95c('0x27')](_0xd69e0d[_0xe95c('0x2f')],function(_0x528310){var _0x1e5e47={};_0x1e5e47[_0x528310]={'$like':'%'+_0x23db9f[_0xe95c('0x2c')]['filter']+'%'};return _0x1e5e47;})});}_0xd69e0d=_[_0xe95c('0x39')]({},_0xd69e0d,_0x23db9f[_0xe95c('0x3a')]);return _0x504014[_0xe95c('0x49')](_0xd69e0d);}})[_0xe95c('0x22')](function(_0x26031e){if(_0x26031e){_0x516ef2=_0x26031e[_0xe95c('0x31')];if(!_0x23db9f[_0xe95c('0x2c')][_0xe95c('0x32')]('nolimit')){_0xd69e0d[_0xe95c('0x1a')]=qs[_0xe95c('0x1a')](_0x23db9f['query']['limit']);_0xd69e0d[_0xe95c('0x18')]=qs['offset'](_0x23db9f[_0xe95c('0x2c')][_0xe95c('0x18')]);}return _0x504014[_0xe95c('0x49')](_0xd69e0d);}})[_0xe95c('0x22')](function(_0x1aedad){if(_0x1aedad){return _0x1aedad?{'count':_0x516ef2,'rows':_0x1aedad}:null;}})[_0xe95c('0x22')](respondWithResult(_0x1a2227,null))['catch'](handleError(_0x1a2227,null));};exports[_0xe95c('0x4a')]=function(_0x4407f7,_0x4bb616,_0x4c1937){var _0x5b613a={};var _0x3727ac={};var _0x5cae96;var _0x582504;return db[_0xe95c('0x3b')][_0xe95c('0x46')]({'where':{'id':_0x4407f7[_0xe95c('0x41')]['id']}})[_0xe95c('0x22')](handleEntityNotFound(_0x4bb616,null))[_0xe95c('0x22')](function(_0x5bcfa2){if(_0x5bcfa2){_0x5cae96=_0x5bcfa2;_0x3727ac[_0xe95c('0x2b')]=_['keys'](db[_0xe95c('0x47')][_0xe95c('0x28')]);_0x3727ac[_0xe95c('0x2c')]=_[_0xe95c('0x2d')](_0x4407f7[_0xe95c('0x2c')]);_0x3727ac[_0xe95c('0x36')]=_['intersection'](_0x3727ac[_0xe95c('0x2b')],_0x3727ac[_0xe95c('0x2c')]);_0x5b613a['attributes']=_[_0xe95c('0x2e')](_0x3727ac[_0xe95c('0x2b')],qs[_0xe95c('0x30')](_0x4407f7[_0xe95c('0x2c')]['fields']));_0x5b613a[_0xe95c('0x2f')]=_0x5b613a[_0xe95c('0x2f')][_0xe95c('0x31')]?_0x5b613a[_0xe95c('0x2f')]:_0x3727ac['model'];_0x5b613a['order']=qs['sort'](_0x4407f7['query']['sort']);_0x5b613a[_0xe95c('0x35')]=qs[_0xe95c('0x36')](_['pick'](_0x4407f7[_0xe95c('0x2c')],_0x3727ac[_0xe95c('0x36')]));if(_0x4407f7[_0xe95c('0x2c')][_0xe95c('0x38')]){_0x5b613a['where']=_[_0xe95c('0x39')](_0x5b613a[_0xe95c('0x35')],{'$or':_[_0xe95c('0x27')](_0x5b613a[_0xe95c('0x2f')],function(_0x1bf35e){var _0x4c7fda={};_0x4c7fda[_0x1bf35e]={'$like':'%'+_0x4407f7['query'][_0xe95c('0x38')]+'%'};return _0x4c7fda;})});}_0x5b613a=_[_0xe95c('0x39')]({},_0x5b613a,_0x4407f7[_0xe95c('0x3a')]);return _0x5cae96[_0xe95c('0x4a')](_0x5b613a);}})[_0xe95c('0x22')](function(_0x3c45b1){if(_0x3c45b1){_0x582504=_0x3c45b1[_0xe95c('0x31')];if(!_0x4407f7[_0xe95c('0x2c')][_0xe95c('0x32')]('nolimit')){_0x5b613a['limit']=qs[_0xe95c('0x1a')](_0x4407f7[_0xe95c('0x2c')][_0xe95c('0x1a')]);_0x5b613a[_0xe95c('0x18')]=qs[_0xe95c('0x18')](_0x4407f7['query'][_0xe95c('0x18')]);}return _0x5cae96[_0xe95c('0x4a')](_0x5b613a);}})[_0xe95c('0x22')](function(_0x13d09a){if(_0x13d09a){return _0x13d09a?{'count':_0x582504,'rows':_0x13d09a}:null;}})[_0xe95c('0x22')](respondWithResult(_0x4bb616,null))['catch'](handleError(_0x4bb616,null));};exports[_0xe95c('0x4b')]=function(_0x7cefd7,_0x30d9f0,_0x28a212){var _0x5320e9={};var _0xccdc7f={};var _0x5bb8d4;var _0x2a785b;return db[_0xe95c('0x3b')]['findOne']({'where':{'id':_0x7cefd7[_0xe95c('0x41')]['id']}})[_0xe95c('0x22')](handleEntityNotFound(_0x30d9f0,null))[_0xe95c('0x22')](function(_0x26c635){if(_0x26c635){_0x5bb8d4=_0x26c635;_0xccdc7f[_0xe95c('0x2b')]=_[_0xe95c('0x2d')](db[_0xe95c('0x47')]['rawAttributes']);_0xccdc7f['query']=_[_0xe95c('0x2d')](_0x7cefd7[_0xe95c('0x2c')]);_0xccdc7f[_0xe95c('0x36')]=_['intersection'](_0xccdc7f[_0xe95c('0x2b')],_0xccdc7f[_0xe95c('0x2c')]);_0x5320e9['attributes']=_['intersection'](_0xccdc7f[_0xe95c('0x2b')],qs[_0xe95c('0x30')](_0x7cefd7[_0xe95c('0x2c')]['fields']));_0x5320e9[_0xe95c('0x2f')]=_0x5320e9[_0xe95c('0x2f')][_0xe95c('0x31')]?_0x5320e9[_0xe95c('0x2f')]:_0xccdc7f['model'];_0x5320e9[_0xe95c('0x48')]=qs[_0xe95c('0x34')](_0x7cefd7[_0xe95c('0x2c')][_0xe95c('0x34')]);_0x5320e9[_0xe95c('0x35')]=qs[_0xe95c('0x36')](_[_0xe95c('0x37')](_0x7cefd7[_0xe95c('0x2c')],_0xccdc7f['filters']));if(_0x7cefd7['query'][_0xe95c('0x38')]){_0x5320e9[_0xe95c('0x35')]=_[_0xe95c('0x39')](_0x5320e9['where'],{'$or':_[_0xe95c('0x27')](_0x5320e9['attributes'],function(_0x4ff083){var _0x4035ae={};_0x4035ae[_0x4ff083]={'$like':'%'+_0x7cefd7[_0xe95c('0x2c')]['filter']+'%'};return _0x4035ae;})});}_0x5320e9=_['merge']({},_0x5320e9,_0x7cefd7[_0xe95c('0x3a')]);return _0x5bb8d4['getDescriptions'](_0x5320e9);}})[_0xe95c('0x22')](function(_0x42d956){if(_0x42d956){_0x2a785b=_0x42d956[_0xe95c('0x31')];if(!_0x7cefd7[_0xe95c('0x2c')]['hasOwnProperty'](_0xe95c('0x33'))){_0x5320e9['limit']=qs['limit'](_0x7cefd7[_0xe95c('0x2c')][_0xe95c('0x1a')]);_0x5320e9['offset']=qs[_0xe95c('0x18')](_0x7cefd7[_0xe95c('0x2c')]['offset']);}return _0x5bb8d4[_0xe95c('0x4b')](_0x5320e9);}})['then'](function(_0x5a3111){if(_0x5a3111){return _0x5a3111?{'count':_0x2a785b,'rows':_0x5a3111}:null;}})['then'](respondWithResult(_0x30d9f0,null))[_0xe95c('0x42')](handleError(_0x30d9f0,null));}; \ No newline at end of file +var _0x852a=['lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','VtigerField','filter','nolimit','getSubjects','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x52edd0,_0x7319dc){var _0x42b12a=function(_0x11235e){while(--_0x11235e){_0x52edd0['push'](_0x52edd0['shift']());}};_0x42b12a(++_0x7319dc);}(_0x852a,0x1d5));var _0xa852=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x852a[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa852('0x0'));var zipdir=require(_0xa852('0x1'));var jsonpatch=require(_0xa852('0x2'));var rp=require('request-promise');var moment=require(_0xa852('0x3'));var BPromise=require(_0xa852('0x4'));var Mustache=require(_0xa852('0x5'));var util=require(_0xa852('0x6'));var path=require(_0xa852('0x7'));var sox=require('sox');var csv=require(_0xa852('0x8'));var ejs=require(_0xa852('0x9'));var fs=require('fs');var fs_extra=require(_0xa852('0xa'));var _=require(_0xa852('0xb'));var squel=require('squel');var crypto=require(_0xa852('0xc'));var jsforce=require(_0xa852('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa852('0xe'));var Papa=require(_0xa852('0xf'));var Redis=require(_0xa852('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa852('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa852('0x12'))('api');var utils=require(_0xa852('0x13'));var config=require(_0xa852('0x14'));var licenseUtil=require(_0xa852('0x15'));var db=require(_0xa852('0x16'))['db'];function respondWithStatusCode(_0x29f9fb,_0x375e01){_0x375e01=_0x375e01||0xcc;return function(_0xb8c97d){if(_0xb8c97d){return _0x29f9fb[_0xa852('0x17')](_0x375e01);}return _0x29f9fb[_0xa852('0x18')](_0x375e01)[_0xa852('0x19')]();};}function respondWithResult(_0x208af8,_0x1945ec){_0x1945ec=_0x1945ec||0xc8;return function(_0x3c88ed){if(_0x3c88ed){return _0x208af8[_0xa852('0x18')](_0x1945ec)['json'](_0x3c88ed);}};}function respondWithFilteredResult(_0x180b35,_0x29b57b){return function(_0x2edc28){if(_0x2edc28){var _0x40b7f3=typeof _0x29b57b['offset']===_0xa852('0x1a')&&typeof _0x29b57b[_0xa852('0x1b')]===_0xa852('0x1a');var _0x51e0be=_0x2edc28[_0xa852('0x1c')];var _0x5d162d=_0x40b7f3?0x0:_0x29b57b[_0xa852('0x1d')];var _0x352862=_0x40b7f3?_0x2edc28[_0xa852('0x1c')]:_0x29b57b[_0xa852('0x1d')]+_0x29b57b['limit'];var _0x3659d1;if(_0x352862>=_0x51e0be){_0x352862=_0x51e0be;_0x3659d1=0xc8;}else{_0x3659d1=0xce;}_0x180b35['status'](_0x3659d1);return _0x180b35['set'](_0xa852('0x1e'),_0x5d162d+'-'+_0x352862+'/'+_0x51e0be)[_0xa852('0x1f')](_0x2edc28);}return null;};}function patchUpdates(_0x33b9d0){return function(_0x177ca6){try{jsonpatch['apply'](_0x177ca6,_0x33b9d0,!![]);}catch(_0x8a5f25){return BPromise[_0xa852('0x20')](_0x8a5f25);}return _0x177ca6[_0xa852('0x21')]();};}function saveUpdates(_0x1691ff,_0x29d4bf){return function(_0x25ba9a){if(_0x25ba9a){return _0x25ba9a[_0xa852('0x22')](_0x1691ff)[_0xa852('0x23')](function(_0x41fda8){return _0x41fda8;});}return null;};}function removeEntity(_0x3aa5a1,_0x24f5ec){return function(_0x1fb2ac){if(_0x1fb2ac){return _0x1fb2ac[_0xa852('0x24')]()[_0xa852('0x23')](function(){_0x3aa5a1[_0xa852('0x18')](0xcc)[_0xa852('0x19')]();});}};}function handleEntityNotFound(_0x85f96c,_0x29f8aa){return function(_0x27a75c){if(!_0x27a75c){_0x85f96c[_0xa852('0x17')](0x194);}return _0x27a75c;};}function handleError(_0x37e578,_0x117720){_0x117720=_0x117720||0x1f4;return function(_0x11010e){logger[_0xa852('0x25')](_0x11010e[_0xa852('0x26')]);if(_0x11010e[_0xa852('0x27')]){delete _0x11010e[_0xa852('0x27')];}_0x37e578[_0xa852('0x18')](_0x117720)[_0xa852('0x28')](_0x11010e);};}exports[_0xa852('0x29')]=function(_0xe7b055,_0x3d2772){var _0x27b209={},_0x23faeb={},_0x5ebcc1={'count':0x0,'rows':[]};var _0x1d11bf=_[_0xa852('0x2a')](db[_0xa852('0x2b')][_0xa852('0x2c')],function(_0x2fd882){return{'name':_0x2fd882['fieldName'],'type':_0x2fd882[_0xa852('0x2d')][_0xa852('0x2e')]};});_0x23faeb['model']=_['map'](_0x1d11bf,_0xa852('0x27'));_0x23faeb[_0xa852('0x2f')]=_[_0xa852('0x30')](_0xe7b055[_0xa852('0x2f')]);_0x23faeb[_0xa852('0x31')]=_[_0xa852('0x32')](_0x23faeb[_0xa852('0x33')],_0x23faeb[_0xa852('0x2f')]);_0x27b209[_0xa852('0x34')]=_[_0xa852('0x32')](_0x23faeb['model'],qs[_0xa852('0x35')](_0xe7b055[_0xa852('0x2f')]['fields']));_0x27b209[_0xa852('0x34')]=_0x27b209[_0xa852('0x34')]['length']?_0x27b209[_0xa852('0x34')]:_0x23faeb['model'];if(!_0xe7b055[_0xa852('0x2f')]['hasOwnProperty']('nolimit')){_0x27b209[_0xa852('0x1b')]=qs['limit'](_0xe7b055[_0xa852('0x2f')][_0xa852('0x1b')]);_0x27b209['offset']=qs[_0xa852('0x1d')](_0xe7b055[_0xa852('0x2f')][_0xa852('0x1d')]);}_0x27b209[_0xa852('0x36')]=qs[_0xa852('0x37')](_0xe7b055[_0xa852('0x2f')]['sort']);_0x27b209[_0xa852('0x38')]=qs[_0xa852('0x31')](_[_0xa852('0x39')](_0xe7b055[_0xa852('0x2f')],_0x23faeb['filters']),_0x1d11bf);if(_0xe7b055[_0xa852('0x2f')]['filter']){_0x27b209[_0xa852('0x38')]=_[_0xa852('0x3a')](_0x27b209['where'],{'$or':_[_0xa852('0x2a')](_0x1d11bf,function(_0x59a594){if(_0x59a594[_0xa852('0x2d')]!==_0xa852('0x3b')){var _0x214bb9={};_0x214bb9[_0x59a594['name']]={'$like':'%'+_0xe7b055[_0xa852('0x2f')]['filter']+'%'};return _0x214bb9;}})});}_0x27b209=_[_0xa852('0x3a')]({},_0x27b209,_0xe7b055[_0xa852('0x3c')]);var _0x21d241={'where':_0x27b209[_0xa852('0x38')]};return db[_0xa852('0x2b')]['count'](_0x21d241)[_0xa852('0x23')](function(_0x4dc31e){_0x5ebcc1[_0xa852('0x1c')]=_0x4dc31e;if(_0xe7b055[_0xa852('0x2f')][_0xa852('0x3d')]){_0x27b209[_0xa852('0x3e')]=[{'all':!![]}];}return db[_0xa852('0x2b')][_0xa852('0x3f')](_0x27b209);})[_0xa852('0x23')](function(_0xf48542){_0x5ebcc1[_0xa852('0x40')]=_0xf48542;return _0x5ebcc1;})[_0xa852('0x23')](respondWithFilteredResult(_0x3d2772,_0x27b209))[_0xa852('0x41')](handleError(_0x3d2772,null));};exports[_0xa852('0x42')]=function(_0x3dd3e7,_0x5b8a06){var _0x4e91a2={'raw':![],'where':{'id':_0x3dd3e7[_0xa852('0x43')]['id']}},_0x321177={};_0x321177['model']=_['keys'](db['VtigerConfiguration'][_0xa852('0x2c')]);_0x321177[_0xa852('0x2f')]=_['keys'](_0x3dd3e7[_0xa852('0x2f')]);_0x321177['filters']=_['intersection'](_0x321177['model'],_0x321177[_0xa852('0x2f')]);_0x4e91a2['attributes']=_['intersection'](_0x321177[_0xa852('0x33')],qs[_0xa852('0x35')](_0x3dd3e7[_0xa852('0x2f')][_0xa852('0x35')]));_0x4e91a2[_0xa852('0x34')]=_0x4e91a2[_0xa852('0x34')][_0xa852('0x44')]?_0x4e91a2[_0xa852('0x34')]:_0x321177[_0xa852('0x33')];if(_0x3dd3e7[_0xa852('0x2f')][_0xa852('0x3d')]){_0x4e91a2[_0xa852('0x3e')]=[{'all':!![]}];}_0x4e91a2=_[_0xa852('0x3a')]({},_0x4e91a2,_0x3dd3e7['options']);return db[_0xa852('0x2b')][_0xa852('0x45')](_0x4e91a2)['then'](handleEntityNotFound(_0x5b8a06,null))[_0xa852('0x23')](respondWithResult(_0x5b8a06,null))[_0xa852('0x41')](handleError(_0x5b8a06,null));};exports[_0xa852('0x46')]=function(_0x3c9b02,_0x42ec77){return db[_0xa852('0x2b')][_0xa852('0x46')](_0x3c9b02[_0xa852('0x47')],{})[_0xa852('0x23')](respondWithResult(_0x42ec77,0xc9))[_0xa852('0x41')](handleError(_0x42ec77,null));};exports['update']=function(_0x599cad,_0x338da5){if(_0x599cad[_0xa852('0x47')]['id']){delete _0x599cad[_0xa852('0x47')]['id'];}return db[_0xa852('0x2b')]['find']({'where':{'id':_0x599cad['params']['id']}})[_0xa852('0x23')](handleEntityNotFound(_0x338da5,null))[_0xa852('0x23')](saveUpdates(_0x599cad[_0xa852('0x47')],null))['then'](respondWithResult(_0x338da5,null))[_0xa852('0x41')](handleError(_0x338da5,null));};exports[_0xa852('0x24')]=function(_0x57a550,_0x8082be){return db[_0xa852('0x2b')][_0xa852('0x45')]({'where':{'id':_0x57a550[_0xa852('0x43')]['id']}})[_0xa852('0x23')](handleEntityNotFound(_0x8082be,null))['then'](removeEntity(_0x8082be,null))[_0xa852('0x41')](handleError(_0x8082be,null));};exports[_0xa852('0x48')]=function(_0x135223,_0x34f531,_0x244f27){var _0xecb7db={};var _0x5bd435={};var _0x583707;var _0x42dfb4;return db[_0xa852('0x2b')][_0xa852('0x49')]({'where':{'id':_0x135223[_0xa852('0x43')]['id']}})[_0xa852('0x23')](handleEntityNotFound(_0x34f531,null))[_0xa852('0x23')](function(_0x53c144){if(_0x53c144){_0x583707=_0x53c144;_0x5bd435[_0xa852('0x33')]=_[_0xa852('0x30')](db[_0xa852('0x4a')]['rawAttributes']);_0x5bd435[_0xa852('0x2f')]=_['keys'](_0x135223[_0xa852('0x2f')]);_0x5bd435['filters']=_['intersection'](_0x5bd435[_0xa852('0x33')],_0x5bd435['query']);_0xecb7db[_0xa852('0x34')]=_['intersection'](_0x5bd435[_0xa852('0x33')],qs[_0xa852('0x35')](_0x135223[_0xa852('0x2f')]['fields']));_0xecb7db[_0xa852('0x34')]=_0xecb7db[_0xa852('0x34')][_0xa852('0x44')]?_0xecb7db[_0xa852('0x34')]:_0x5bd435['model'];_0xecb7db[_0xa852('0x36')]=qs['sort'](_0x135223[_0xa852('0x2f')][_0xa852('0x37')]);_0xecb7db[_0xa852('0x38')]=qs[_0xa852('0x31')](_[_0xa852('0x39')](_0x135223[_0xa852('0x2f')],_0x5bd435[_0xa852('0x31')]));if(_0x135223['query'][_0xa852('0x4b')]){_0xecb7db['where']=_[_0xa852('0x3a')](_0xecb7db[_0xa852('0x38')],{'$or':_[_0xa852('0x2a')](_0xecb7db[_0xa852('0x34')],function(_0x293547){var _0x4c3f8a={};_0x4c3f8a[_0x293547]={'$like':'%'+_0x135223[_0xa852('0x2f')][_0xa852('0x4b')]+'%'};return _0x4c3f8a;})});}_0xecb7db=_['merge']({},_0xecb7db,_0x135223[_0xa852('0x3c')]);return _0x583707[_0xa852('0x48')](_0xecb7db);}})[_0xa852('0x23')](function(_0x1d8a8e){if(_0x1d8a8e){_0x42dfb4=_0x1d8a8e[_0xa852('0x44')];if(!_0x135223[_0xa852('0x2f')]['hasOwnProperty'](_0xa852('0x4c'))){_0xecb7db[_0xa852('0x1b')]=qs[_0xa852('0x1b')](_0x135223[_0xa852('0x2f')][_0xa852('0x1b')]);_0xecb7db[_0xa852('0x1d')]=qs[_0xa852('0x1d')](_0x135223[_0xa852('0x2f')][_0xa852('0x1d')]);}return _0x583707[_0xa852('0x48')](_0xecb7db);}})['then'](function(_0x504542){if(_0x504542){return _0x504542?{'count':_0x42dfb4,'rows':_0x504542}:null;}})[_0xa852('0x23')](respondWithResult(_0x34f531,null))[_0xa852('0x41')](handleError(_0x34f531,null));};exports[_0xa852('0x4d')]=function(_0x1b94c6,_0x41f1f1,_0x282651){var _0x3f135f={};var _0x437012={};var _0x3e6a27;var _0xec7db5;return db[_0xa852('0x2b')]['findOne']({'where':{'id':_0x1b94c6[_0xa852('0x43')]['id']}})[_0xa852('0x23')](handleEntityNotFound(_0x41f1f1,null))[_0xa852('0x23')](function(_0x248a7d){if(_0x248a7d){_0x3e6a27=_0x248a7d;_0x437012[_0xa852('0x33')]=_[_0xa852('0x30')](db[_0xa852('0x4a')][_0xa852('0x2c')]);_0x437012[_0xa852('0x2f')]=_[_0xa852('0x30')](_0x1b94c6[_0xa852('0x2f')]);_0x437012[_0xa852('0x31')]=_['intersection'](_0x437012[_0xa852('0x33')],_0x437012[_0xa852('0x2f')]);_0x3f135f[_0xa852('0x34')]=_['intersection'](_0x437012['model'],qs['fields'](_0x1b94c6[_0xa852('0x2f')]['fields']));_0x3f135f[_0xa852('0x34')]=_0x3f135f['attributes']['length']?_0x3f135f[_0xa852('0x34')]:_0x437012[_0xa852('0x33')];_0x3f135f[_0xa852('0x36')]=qs['sort'](_0x1b94c6[_0xa852('0x2f')][_0xa852('0x37')]);_0x3f135f[_0xa852('0x38')]=qs[_0xa852('0x31')](_['pick'](_0x1b94c6['query'],_0x437012[_0xa852('0x31')]));if(_0x1b94c6['query']['filter']){_0x3f135f[_0xa852('0x38')]=_[_0xa852('0x3a')](_0x3f135f[_0xa852('0x38')],{'$or':_[_0xa852('0x2a')](_0x3f135f[_0xa852('0x34')],function(_0x17bc0b){var _0x51d51c={};_0x51d51c[_0x17bc0b]={'$like':'%'+_0x1b94c6[_0xa852('0x2f')][_0xa852('0x4b')]+'%'};return _0x51d51c;})});}_0x3f135f=_[_0xa852('0x3a')]({},_0x3f135f,_0x1b94c6['options']);return _0x3e6a27[_0xa852('0x4d')](_0x3f135f);}})[_0xa852('0x23')](function(_0x372e0e){if(_0x372e0e){_0xec7db5=_0x372e0e['length'];if(!_0x1b94c6[_0xa852('0x2f')]['hasOwnProperty'](_0xa852('0x4c'))){_0x3f135f['limit']=qs['limit'](_0x1b94c6['query']['limit']);_0x3f135f['offset']=qs['offset'](_0x1b94c6['query']['offset']);}return _0x3e6a27[_0xa852('0x4d')](_0x3f135f);}})[_0xa852('0x23')](function(_0x8719b9){if(_0x8719b9){return _0x8719b9?{'count':_0xec7db5,'rows':_0x8719b9}:null;}})['then'](respondWithResult(_0x41f1f1,null))[_0xa852('0x41')](handleError(_0x41f1f1,null));};exports['getDescriptions']=function(_0x14f87a,_0xa5376e,_0x3aaaba){var _0x1cf29a={};var _0x451b0b={};var _0x380791;var _0x17a04d;return db[_0xa852('0x2b')][_0xa852('0x49')]({'where':{'id':_0x14f87a[_0xa852('0x43')]['id']}})[_0xa852('0x23')](handleEntityNotFound(_0xa5376e,null))[_0xa852('0x23')](function(_0x259afb){if(_0x259afb){_0x380791=_0x259afb;_0x451b0b['model']=_['keys'](db['VtigerField'][_0xa852('0x2c')]);_0x451b0b['query']=_[_0xa852('0x30')](_0x14f87a[_0xa852('0x2f')]);_0x451b0b[_0xa852('0x31')]=_['intersection'](_0x451b0b['model'],_0x451b0b[_0xa852('0x2f')]);_0x1cf29a['attributes']=_[_0xa852('0x32')](_0x451b0b[_0xa852('0x33')],qs[_0xa852('0x35')](_0x14f87a['query'][_0xa852('0x35')]));_0x1cf29a[_0xa852('0x34')]=_0x1cf29a['attributes'][_0xa852('0x44')]?_0x1cf29a[_0xa852('0x34')]:_0x451b0b['model'];_0x1cf29a[_0xa852('0x36')]=qs[_0xa852('0x37')](_0x14f87a[_0xa852('0x2f')]['sort']);_0x1cf29a['where']=qs[_0xa852('0x31')](_['pick'](_0x14f87a[_0xa852('0x2f')],_0x451b0b['filters']));if(_0x14f87a[_0xa852('0x2f')][_0xa852('0x4b')]){_0x1cf29a[_0xa852('0x38')]=_[_0xa852('0x3a')](_0x1cf29a[_0xa852('0x38')],{'$or':_[_0xa852('0x2a')](_0x1cf29a[_0xa852('0x34')],function(_0x1692da){var _0xee0d02={};_0xee0d02[_0x1692da]={'$like':'%'+_0x14f87a[_0xa852('0x2f')]['filter']+'%'};return _0xee0d02;})});}_0x1cf29a=_['merge']({},_0x1cf29a,_0x14f87a[_0xa852('0x3c')]);return _0x380791['getDescriptions'](_0x1cf29a);}})[_0xa852('0x23')](function(_0x42f1d3){if(_0x42f1d3){_0x17a04d=_0x42f1d3[_0xa852('0x44')];if(!_0x14f87a['query'][_0xa852('0x4e')](_0xa852('0x4c'))){_0x1cf29a[_0xa852('0x1b')]=qs[_0xa852('0x1b')](_0x14f87a[_0xa852('0x2f')][_0xa852('0x1b')]);_0x1cf29a[_0xa852('0x1d')]=qs['offset'](_0x14f87a['query'][_0xa852('0x1d')]);}return _0x380791[_0xa852('0x4f')](_0x1cf29a);}})['then'](function(_0x4f4647){if(_0x4f4647){return _0x4f4647?{'count':_0x17a04d,'rows':_0x4f4647}:null;}})['then'](respondWithResult(_0xa5376e,null))[_0xa852('0x41')](handleError(_0xa5376e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 850c5df..49d5bf4 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 _0xad72=['./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3f52d9,_0x1d748c){var _0x21e01f=function(_0x22e584){while(--_0x22e584){_0x3f52d9['push'](_0x3f52d9['shift']());}};_0x21e01f(++_0x1d748c);}(_0xad72,0x1d8));var _0x2ad7=function(_0x3407f3,_0x48e50e){_0x3407f3=_0x3407f3-0x0;var _0xc0edd2=_0xad72[_0x3407f3];return _0xc0edd2;};'use strict';var _=require(_0x2ad7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ad7('0x1'));var moment=require(_0x2ad7('0x2'));var BPromise=require(_0x2ad7('0x3'));var rp=require(_0x2ad7('0x4'));var fs=require('fs');var path=require(_0x2ad7('0x5'));var rimraf=require(_0x2ad7('0x6'));var config=require(_0x2ad7('0x7'));var attributes=require(_0x2ad7('0x8'));module['exports']=function(_0x160756,_0x35a497){return _0x160756[_0x2ad7('0x9')](_0x2ad7('0xa'),attributes,{'tableName':_0x2ad7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dc6=['int_vtiger_configurations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0x1a65ed,_0x5dc9e9){var _0x376871=function(_0x298e6b){while(--_0x298e6b){_0x1a65ed['push'](_0x1a65ed['shift']());}};_0x376871(++_0x5dc9e9);}(_0x4dc6,0xd1));var _0x64dc=function(_0x161a13,_0x5a6fda){_0x161a13=_0x161a13-0x0;var _0x1b4fea=_0x4dc6[_0x161a13];return _0x1b4fea;};'use strict';var _=require(_0x64dc('0x0'));var util=require(_0x64dc('0x1'));var logger=require(_0x64dc('0x2'))(_0x64dc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64dc('0x4'));var fs=require('fs');var path=require(_0x64dc('0x5'));var rimraf=require(_0x64dc('0x6'));var config=require(_0x64dc('0x7'));var attributes=require(_0x64dc('0x8'));module[_0x64dc('0x9')]=function(_0x1e9f53,_0x33bf00){return _0x1e9f53[_0x64dc('0xa')](_0x64dc('0xb'),attributes,{'tableName':_0x64dc('0xc'),'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 b9cd96d..2d2682b 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 _0xac25=['request','then','info','debug','request\x20sent','error','code','message','VtigerConfiguration,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x466f2e,_0x5e2a7f){var _0x22dfbb=function(_0x308bbf){while(--_0x308bbf){_0x466f2e['push'](_0x466f2e['shift']());}};_0x22dfbb(++_0x5e2a7f);}(_0xac25,0x87));var _0x5ac2=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0xac25[_0x37a9d7];return _0x1343d3;};'use strict';var _=require(_0x5ac2('0x0'));var util=require(_0x5ac2('0x1'));var moment=require(_0x5ac2('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ac2('0x3'));var fs=require('fs');var Redis=require(_0x5ac2('0x4'));var db=require(_0x5ac2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ac2('0x6'))(_0x5ac2('0x7'));var config=require(_0x5ac2('0x8'));var jayson=require(_0x5ac2('0x9'));var client=jayson[_0x5ac2('0xa')][_0x5ac2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xccb9fd,_0x244785,_0x2b502b){return new BPromise(function(_0x248bf1,_0x19392d){return client[_0x5ac2('0xc')](_0xccb9fd,_0x2b502b)[_0x5ac2('0xd')](function(_0x5de1c8){logger[_0x5ac2('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x244785,'request\x20sent');logger[_0x5ac2('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x244785,_0x5ac2('0x10'),JSON['stringify'](_0x5de1c8));if(_0x5de1c8[_0x5ac2('0x11')]){if(_0x5de1c8[_0x5ac2('0x11')][_0x5ac2('0x12')]===0x1f4){logger[_0x5ac2('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x244785,_0x5de1c8[_0x5ac2('0x11')]['message']);return _0x19392d(_0x5de1c8[_0x5ac2('0x11')][_0x5ac2('0x13')]);}logger[_0x5ac2('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x244785,_0x5de1c8[_0x5ac2('0x11')][_0x5ac2('0x13')]);return _0x248bf1(_0x5de1c8[_0x5ac2('0x11')]['message']);}else{logger[_0x5ac2('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x244785,_0x5ac2('0x10'));_0x248bf1(_0x5de1c8['result'][_0x5ac2('0x13')]);}})['catch'](function(_0x24cab8){logger[_0x5ac2('0x11')](_0x5ac2('0x14'),_0x244785,_0x24cab8);_0x19392d(_0x24cab8);});});} \ No newline at end of file +var _0xbbd5=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x3cc3a1,_0x5aae62){var _0x396ea7=function(_0x3a8259){while(--_0x3a8259){_0x3cc3a1['push'](_0x3cc3a1['shift']());}};_0x396ea7(++_0x5aae62);}(_0xbbd5,0x1a2));var _0x5bbd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbbd5[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5bbd('0x0'));var util=require(_0x5bbd('0x1'));var moment=require(_0x5bbd('0x2'));var BPromise=require(_0x5bbd('0x3'));var rs=require(_0x5bbd('0x4'));var fs=require('fs');var Redis=require(_0x5bbd('0x5'));var db=require(_0x5bbd('0x6'))['db'];var utils=require(_0x5bbd('0x7'));var logger=require(_0x5bbd('0x8'))(_0x5bbd('0x9'));var config=require(_0x5bbd('0xa'));var jayson=require(_0x5bbd('0xb'));var client=jayson['client'][_0x5bbd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59f04a,_0x1840ec,_0x2a8e3d){return new BPromise(function(_0x15a655,_0x195458){return client[_0x5bbd('0xd')](_0x59f04a,_0x2a8e3d)[_0x5bbd('0xe')](function(_0x35b440){logger[_0x5bbd('0xf')](_0x5bbd('0x10'),_0x1840ec,'request\x20sent');logger[_0x5bbd('0x11')](_0x5bbd('0x12'),_0x1840ec,'request\x20sent',JSON[_0x5bbd('0x13')](_0x35b440));if(_0x35b440[_0x5bbd('0x14')]){if(_0x35b440[_0x5bbd('0x14')][_0x5bbd('0x15')]===0x1f4){logger[_0x5bbd('0x14')](_0x5bbd('0x10'),_0x1840ec,_0x35b440[_0x5bbd('0x14')]['message']);return _0x195458(_0x35b440[_0x5bbd('0x14')][_0x5bbd('0x16')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1840ec,_0x35b440[_0x5bbd('0x14')][_0x5bbd('0x16')]);return _0x15a655(_0x35b440[_0x5bbd('0x14')][_0x5bbd('0x16')]);}else{logger[_0x5bbd('0xf')](_0x5bbd('0x10'),_0x1840ec,_0x5bbd('0x17'));_0x15a655(_0x35b440[_0x5bbd('0x18')][_0x5bbd('0x16')]);}})[_0x5bbd('0x19')](function(_0x18a9f8){logger[_0x5bbd('0x14')](_0x5bbd('0x10'),_0x1840ec,_0x18a9f8);_0x195458(_0x18a9f8);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index e37d296..0fbedf6 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 _0xda5f=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xda5f,0x126));var _0xfda5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda5f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xfda5('0x0'));var path=require(_0xfda5('0x1'));var timeout=require(_0xfda5('0x2'));var express=require(_0xfda5('0x3'));var router=express['Router']();var fs_extra=require(_0xfda5('0x4'));var auth=require(_0xfda5('0x5'));var interaction=require(_0xfda5('0x6'));var config=require(_0xfda5('0x7'));var controller=require(_0xfda5('0x8'));router[_0xfda5('0x9')]('/',auth[_0xfda5('0xa')](),controller[_0xfda5('0xb')]);router[_0xfda5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfda5('0xc')]('/',auth[_0xfda5('0xa')](),controller[_0xfda5('0xd')]);router[_0xfda5('0xe')](_0xfda5('0xf'),auth['isAuthenticated'](),controller[_0xfda5('0x10')]);router[_0xfda5('0x11')](_0xfda5('0xf'),auth['isAuthenticated'](),controller[_0xfda5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x72d6=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x4597d8,_0x24235d){var _0x496beb=function(_0x5f51a1){while(--_0x5f51a1){_0x4597d8['push'](_0x4597d8['shift']());}};_0x496beb(++_0x24235d);}(_0x72d6,0x11d));var _0x672d=function(_0x118993,_0x482628){_0x118993=_0x118993-0x0;var _0x7dbf9a=_0x72d6[_0x118993];return _0x7dbf9a;};'use strict';var multer=require(_0x672d('0x0'));var util=require(_0x672d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x672d('0x2'));var router=express[_0x672d('0x3')]();var fs_extra=require(_0x672d('0x4'));var auth=require(_0x672d('0x5'));var interaction=require(_0x672d('0x6'));var config=require(_0x672d('0x7'));var controller=require(_0x672d('0x8'));router[_0x672d('0x9')]('/',auth['isAuthenticated'](),controller[_0x672d('0xa')]);router[_0x672d('0x9')](_0x672d('0xb'),auth[_0x672d('0xc')](),controller[_0x672d('0xd')]);router[_0x672d('0xe')]('/',auth[_0x672d('0xc')](),controller['create']);router[_0x672d('0xf')]('/:id',auth[_0x672d('0xc')](),controller[_0x672d('0x10')]);router[_0x672d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x672d('0x12')]);module[_0x672d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b331635..83d12d1 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 _0x80e3=['ENUM','string','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x184b1d,_0x1dea81){var _0x36ae4e=function(_0x30c64e){while(--_0x30c64e){_0x184b1d['push'](_0x184b1d['shift']());}};_0x36ae4e(++_0x1dea81);}(_0x80e3,0xbe));var _0x380e=function(_0x5cdcb3,_0x116bd2){_0x5cdcb3=_0x5cdcb3-0x0;var _0x51ccf8=_0x80e3[_0x5cdcb3];return _0x51ccf8;};'use strict';var Sequelize=require(_0x380e('0x0'));module[_0x380e('0x1')]={'type':{'type':Sequelize[_0x380e('0x2')](_0x380e('0x3'),'variable',_0x380e('0x4'),_0x380e('0x5'),_0x380e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x380e('0x3'),'variable',_0x380e('0x4'))},'keyContent':{'type':Sequelize[_0x380e('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x380e('0x7')]}}; \ No newline at end of file +var _0xdee4=['keyValue','picklist','STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x59a78e,_0x3d6d7f){var _0x43f685=function(_0x488c7c){while(--_0x488c7c){_0x59a78e['push'](_0x59a78e['shift']());}};_0x43f685(++_0x3d6d7f);}(_0xdee4,0x1c3));var _0x4dee=function(_0x2ea0a2,_0xeadd1a){_0x2ea0a2=_0x2ea0a2-0x0;var _0x3d8b3c=_0xdee4[_0x2ea0a2];return _0x3d8b3c;};'use strict';var Sequelize=require(_0x4dee('0x0'));module['exports']={'type':{'type':Sequelize[_0x4dee('0x1')](_0x4dee('0x2'),_0x4dee('0x3'),_0x4dee('0x4'),_0x4dee('0x5'),_0x4dee('0x6')),'defaultValue':_0x4dee('0x2')},'content':{'type':Sequelize[_0x4dee('0x7')]},'key':{'type':Sequelize[_0x4dee('0x7')]},'keyType':{'type':Sequelize[_0x4dee('0x1')]('string',_0x4dee('0x3'),_0x4dee('0x4'))},'keyContent':{'type':Sequelize[_0x4dee('0x7')]},'idField':{'type':Sequelize[_0x4dee('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4dee('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 9eb48b1..4642090 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 _0xacda=['count','offset','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','includeAll','findAll','rows','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','undefined','limit'];(function(_0x3e2480,_0x2eed70){var _0x652c0=function(_0xaae5d2){while(--_0xaae5d2){_0x3e2480['push'](_0x3e2480['shift']());}};_0x652c0(++_0x2eed70);}(_0xacda,0x10d));var _0xaacd=function(_0x18bf17,_0x418b64){_0x18bf17=_0x18bf17-0x0;var _0x3b7acd=_0xacda[_0x18bf17];return _0x3b7acd;};'use strict';var emlformat=require(_0xaacd('0x0'));var rimraf=require(_0xaacd('0x1'));var zipdir=require(_0xaacd('0x2'));var jsonpatch=require(_0xaacd('0x3'));var rp=require(_0xaacd('0x4'));var moment=require(_0xaacd('0x5'));var BPromise=require(_0xaacd('0x6'));var Mustache=require(_0xaacd('0x7'));var util=require(_0xaacd('0x8'));var path=require(_0xaacd('0x9'));var sox=require(_0xaacd('0xa'));var csv=require(_0xaacd('0xb'));var ejs=require(_0xaacd('0xc'));var fs=require('fs');var fs_extra=require(_0xaacd('0xd'));var _=require('lodash');var squel=require(_0xaacd('0xe'));var crypto=require(_0xaacd('0xf'));var jsforce=require(_0xaacd('0x10'));var deskjs=require(_0xaacd('0x11'));var toCsv=require(_0xaacd('0xb'));var querystring=require('querystring');var Papa=require(_0xaacd('0x12'));var Redis=require(_0xaacd('0x13'));var authService=require(_0xaacd('0x14'));var qs=require(_0xaacd('0x15'));var as=require(_0xaacd('0x16'));var hardwareService=require(_0xaacd('0x17'));var logger=require(_0xaacd('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaacd('0x19'))['db'];function respondWithStatusCode(_0x4b97f5,_0x2a935d){_0x2a935d=_0x2a935d||0xcc;return function(_0x2652f5){if(_0x2652f5){return _0x4b97f5[_0xaacd('0x1a')](_0x2a935d);}return _0x4b97f5[_0xaacd('0x1b')](_0x2a935d)[_0xaacd('0x1c')]();};}function respondWithResult(_0x189a19,_0x5ef165){_0x5ef165=_0x5ef165||0xc8;return function(_0x34be51){if(_0x34be51){return _0x189a19[_0xaacd('0x1b')](_0x5ef165)['json'](_0x34be51);}};}function respondWithFilteredResult(_0x40ec21,_0x230088){return function(_0xf21bd){if(_0xf21bd){var _0xf66e62=typeof _0x230088['offset']===_0xaacd('0x1d')&&typeof _0x230088[_0xaacd('0x1e')]===_0xaacd('0x1d');var _0x1e97de=_0xf21bd[_0xaacd('0x1f')];var _0x1d8f98=_0xf66e62?0x0:_0x230088[_0xaacd('0x20')];var _0x5bccac=_0xf66e62?_0xf21bd['count']:_0x230088[_0xaacd('0x20')]+_0x230088[_0xaacd('0x1e')];var _0x1b1eea;if(_0x5bccac>=_0x1e97de){_0x5bccac=_0x1e97de;_0x1b1eea=0xc8;}else{_0x1b1eea=0xce;}_0x40ec21[_0xaacd('0x1b')](_0x1b1eea);return _0x40ec21['set'](_0xaacd('0x21'),_0x1d8f98+'-'+_0x5bccac+'/'+_0x1e97de)[_0xaacd('0x22')](_0xf21bd);}return null;};}function patchUpdates(_0x73f2bf){return function(_0x1633f5){try{jsonpatch[_0xaacd('0x23')](_0x1633f5,_0x73f2bf,!![]);}catch(_0x31a8f0){return BPromise['reject'](_0x31a8f0);}return _0x1633f5[_0xaacd('0x24')]();};}function saveUpdates(_0x8e9fdd,_0x4bf62d){return function(_0x2dde4b){if(_0x2dde4b){return _0x2dde4b['update'](_0x8e9fdd)['then'](function(_0x5e056b){return _0x5e056b;});}return null;};}function removeEntity(_0x48b984,_0xc9225a){return function(_0x50e746){if(_0x50e746){return _0x50e746[_0xaacd('0x25')]()[_0xaacd('0x26')](function(){_0x48b984['status'](0xcc)[_0xaacd('0x1c')]();});}};}function handleEntityNotFound(_0x52d7a0,_0x4604ec){return function(_0x42a8e7){if(!_0x42a8e7){_0x52d7a0[_0xaacd('0x1a')](0x194);}return _0x42a8e7;};}function handleError(_0x2fcfc5,_0x5382a5){_0x5382a5=_0x5382a5||0x1f4;return function(_0x1a1677){logger[_0xaacd('0x27')](_0x1a1677[_0xaacd('0x28')]);if(_0x1a1677[_0xaacd('0x29')]){delete _0x1a1677[_0xaacd('0x29')];}_0x2fcfc5[_0xaacd('0x1b')](_0x5382a5)[_0xaacd('0x2a')](_0x1a1677);};}exports[_0xaacd('0x2b')]=function(_0x30b013,_0x84244d){var _0x25bbcc={},_0x41f85b={},_0x977979={'count':0x0,'rows':[]};var _0x4991ce=_[_0xaacd('0x2c')](db[_0xaacd('0x2d')][_0xaacd('0x2e')],function(_0x5d0020){return{'name':_0x5d0020[_0xaacd('0x2f')],'type':_0x5d0020[_0xaacd('0x30')]['key']};});_0x41f85b[_0xaacd('0x31')]=_[_0xaacd('0x2c')](_0x4991ce,_0xaacd('0x29'));_0x41f85b[_0xaacd('0x32')]=_[_0xaacd('0x33')](_0x30b013['query']);_0x41f85b[_0xaacd('0x34')]=_[_0xaacd('0x35')](_0x41f85b[_0xaacd('0x31')],_0x41f85b[_0xaacd('0x32')]);_0x25bbcc[_0xaacd('0x36')]=_[_0xaacd('0x35')](_0x41f85b['model'],qs[_0xaacd('0x37')](_0x30b013[_0xaacd('0x32')][_0xaacd('0x37')]));_0x25bbcc[_0xaacd('0x36')]=_0x25bbcc['attributes'][_0xaacd('0x38')]?_0x25bbcc['attributes']:_0x41f85b[_0xaacd('0x31')];if(!_0x30b013[_0xaacd('0x32')][_0xaacd('0x39')](_0xaacd('0x3a'))){_0x25bbcc[_0xaacd('0x1e')]=qs[_0xaacd('0x1e')](_0x30b013[_0xaacd('0x32')][_0xaacd('0x1e')]);_0x25bbcc[_0xaacd('0x20')]=qs[_0xaacd('0x20')](_0x30b013['query'][_0xaacd('0x20')]);}_0x25bbcc['order']=qs['sort'](_0x30b013[_0xaacd('0x32')][_0xaacd('0x3b')]);_0x25bbcc['where']=qs[_0xaacd('0x34')](_[_0xaacd('0x3c')](_0x30b013['query'],_0x41f85b[_0xaacd('0x34')]),_0x4991ce);if(_0x30b013['query']['filter']){_0x25bbcc[_0xaacd('0x3d')]=_[_0xaacd('0x3e')](_0x25bbcc[_0xaacd('0x3d')],{'$or':_['map'](_0x4991ce,function(_0x5c889f){if(_0x5c889f['type']!=='VIRTUAL'){var _0x15b707={};_0x15b707[_0x5c889f['name']]={'$like':'%'+_0x30b013[_0xaacd('0x32')][_0xaacd('0x3f')]+'%'};return _0x15b707;}})});}_0x25bbcc=_[_0xaacd('0x3e')]({},_0x25bbcc,_0x30b013[_0xaacd('0x40')]);var _0x25a78f={'where':_0x25bbcc[_0xaacd('0x3d')]};return db['VtigerField'][_0xaacd('0x1f')](_0x25a78f)[_0xaacd('0x26')](function(_0x20dd59){_0x977979[_0xaacd('0x1f')]=_0x20dd59;if(_0x30b013[_0xaacd('0x32')][_0xaacd('0x41')]){_0x25bbcc['include']=[{'all':!![]}];}return db[_0xaacd('0x2d')][_0xaacd('0x42')](_0x25bbcc);})['then'](function(_0x4bbde4){_0x977979[_0xaacd('0x43')]=_0x4bbde4;return _0x977979;})['then'](respondWithFilteredResult(_0x84244d,_0x25bbcc))['catch'](handleError(_0x84244d,null));};exports[_0xaacd('0x44')]=function(_0x44db7f,_0x36109d){var _0x1a57de={'raw':!![],'where':{'id':_0x44db7f[_0xaacd('0x45')]['id']}},_0x3aeea8={};_0x3aeea8[_0xaacd('0x31')]=_[_0xaacd('0x33')](db[_0xaacd('0x2d')][_0xaacd('0x2e')]);_0x3aeea8[_0xaacd('0x32')]=_[_0xaacd('0x33')](_0x44db7f[_0xaacd('0x32')]);_0x3aeea8[_0xaacd('0x34')]=_['intersection'](_0x3aeea8[_0xaacd('0x31')],_0x3aeea8[_0xaacd('0x32')]);_0x1a57de[_0xaacd('0x36')]=_[_0xaacd('0x35')](_0x3aeea8[_0xaacd('0x31')],qs[_0xaacd('0x37')](_0x44db7f[_0xaacd('0x32')][_0xaacd('0x37')]));_0x1a57de[_0xaacd('0x36')]=_0x1a57de[_0xaacd('0x36')][_0xaacd('0x38')]?_0x1a57de[_0xaacd('0x36')]:_0x3aeea8[_0xaacd('0x31')];if(_0x44db7f['query'][_0xaacd('0x41')]){_0x1a57de['include']=[{'all':!![]}];}_0x1a57de=_[_0xaacd('0x3e')]({},_0x1a57de,_0x44db7f['options']);return db[_0xaacd('0x2d')][_0xaacd('0x46')](_0x1a57de)['then'](handleEntityNotFound(_0x36109d,null))[_0xaacd('0x26')](respondWithResult(_0x36109d,null))[_0xaacd('0x47')](handleError(_0x36109d,null));};exports['create']=function(_0x23e4f5,_0x1c0010){return db[_0xaacd('0x2d')][_0xaacd('0x48')](_0x23e4f5[_0xaacd('0x49')],{})[_0xaacd('0x26')](respondWithResult(_0x1c0010,0xc9))[_0xaacd('0x47')](handleError(_0x1c0010,null));};exports[_0xaacd('0x4a')]=function(_0x4aec7c,_0x1c2dc9){if(_0x4aec7c[_0xaacd('0x49')]['id']){delete _0x4aec7c[_0xaacd('0x49')]['id'];}return db['VtigerField'][_0xaacd('0x46')]({'where':{'id':_0x4aec7c[_0xaacd('0x45')]['id']}})[_0xaacd('0x26')](handleEntityNotFound(_0x1c2dc9,null))[_0xaacd('0x26')](saveUpdates(_0x4aec7c[_0xaacd('0x49')],null))[_0xaacd('0x26')](respondWithResult(_0x1c2dc9,null))[_0xaacd('0x47')](handleError(_0x1c2dc9,null));};exports[_0xaacd('0x25')]=function(_0x1bf194,_0x3cd362){return db['VtigerField'][_0xaacd('0x46')]({'where':{'id':_0x1bf194[_0xaacd('0x45')]['id']}})[_0xaacd('0x26')](handleEntityNotFound(_0x3cd362,null))[_0xaacd('0x26')](removeEntity(_0x3cd362,null))[_0xaacd('0x47')](handleError(_0x3cd362,null));}; \ No newline at end of file +var _0xd13e=['../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','name','index','map','VtigerField','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','where','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x33025c,_0x13d823){var _0x1c56ed=function(_0x715170){while(--_0x715170){_0x33025c['push'](_0x33025c['shift']());}};_0x1c56ed(++_0x13d823);}(_0xd13e,0x193));var _0xed13=function(_0x4387f5,_0x170899){_0x4387f5=_0x4387f5-0x0;var _0x156524=_0xd13e[_0x4387f5];return _0x156524;};'use strict';var emlformat=require(_0xed13('0x0'));var rimraf=require(_0xed13('0x1'));var zipdir=require(_0xed13('0x2'));var jsonpatch=require(_0xed13('0x3'));var rp=require('request-promise');var moment=require(_0xed13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed13('0x5'));var util=require('util');var path=require(_0xed13('0x6'));var sox=require(_0xed13('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed13('0x8'));var squel=require(_0xed13('0x9'));var crypto=require(_0xed13('0xa'));var jsforce=require(_0xed13('0xb'));var deskjs=require(_0xed13('0xc'));var toCsv=require(_0xed13('0xd'));var querystring=require(_0xed13('0xe'));var Papa=require(_0xed13('0xf'));var Redis=require(_0xed13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed13('0x11'));var as=require(_0xed13('0x12'));var hardwareService=require(_0xed13('0x13'));var logger=require(_0xed13('0x14'))(_0xed13('0x15'));var utils=require('../../config/utils');var config=require(_0xed13('0x16'));var licenseUtil=require(_0xed13('0x17'));var db=require(_0xed13('0x18'))['db'];function respondWithStatusCode(_0x3c0b22,_0x936103){_0x936103=_0x936103||0xcc;return function(_0x3295ba){if(_0x3295ba){return _0x3c0b22['sendStatus'](_0x936103);}return _0x3c0b22[_0xed13('0x19')](_0x936103)['end']();};}function respondWithResult(_0x257074,_0x56fdc6){_0x56fdc6=_0x56fdc6||0xc8;return function(_0x6e2978){if(_0x6e2978){return _0x257074['status'](_0x56fdc6)[_0xed13('0x1a')](_0x6e2978);}};}function respondWithFilteredResult(_0x4d5435,_0x38901a){return function(_0xf900d2){if(_0xf900d2){var _0x1d3d67=typeof _0x38901a[_0xed13('0x1b')]===_0xed13('0x1c')&&typeof _0x38901a[_0xed13('0x1d')]===_0xed13('0x1c');var _0x1148a3=_0xf900d2[_0xed13('0x1e')];var _0x1e161f=_0x1d3d67?0x0:_0x38901a[_0xed13('0x1b')];var _0x31de07=_0x1d3d67?_0xf900d2[_0xed13('0x1e')]:_0x38901a[_0xed13('0x1b')]+_0x38901a[_0xed13('0x1d')];var _0x2f38c9;if(_0x31de07>=_0x1148a3){_0x31de07=_0x1148a3;_0x2f38c9=0xc8;}else{_0x2f38c9=0xce;}_0x4d5435['status'](_0x2f38c9);return _0x4d5435['set'](_0xed13('0x1f'),_0x1e161f+'-'+_0x31de07+'/'+_0x1148a3)[_0xed13('0x1a')](_0xf900d2);}return null;};}function patchUpdates(_0x4f455b){return function(_0x40dd86){try{jsonpatch['apply'](_0x40dd86,_0x4f455b,!![]);}catch(_0x4e9e3b){return BPromise[_0xed13('0x20')](_0x4e9e3b);}return _0x40dd86[_0xed13('0x21')]();};}function saveUpdates(_0x2d62cd,_0x192d12){return function(_0x1d7621){if(_0x1d7621){return _0x1d7621[_0xed13('0x22')](_0x2d62cd)['then'](function(_0x5c0daf){return _0x5c0daf;});}return null;};}function removeEntity(_0x5d7ae1,_0x19d51b){return function(_0x3b1f23){if(_0x3b1f23){return _0x3b1f23[_0xed13('0x23')]()[_0xed13('0x24')](function(){_0x5d7ae1[_0xed13('0x19')](0xcc)[_0xed13('0x25')]();});}};}function handleEntityNotFound(_0x1f0405,_0x276c57){return function(_0x2410e2){if(!_0x2410e2){_0x1f0405[_0xed13('0x26')](0x194);}return _0x2410e2;};}function handleError(_0x1f064c,_0x3bc666){_0x3bc666=_0x3bc666||0x1f4;return function(_0x2c6c33){logger[_0xed13('0x27')](_0x2c6c33['stack']);if(_0x2c6c33['name']){delete _0x2c6c33[_0xed13('0x28')];}_0x1f064c[_0xed13('0x19')](_0x3bc666)['send'](_0x2c6c33);};}exports[_0xed13('0x29')]=function(_0x40444a,_0x4ed119){var _0x7ce996={},_0x2066ca={},_0x323156={'count':0x0,'rows':[]};var _0x570929=_[_0xed13('0x2a')](db[_0xed13('0x2b')]['rawAttributes'],function(_0x433665){return{'name':_0x433665[_0xed13('0x2c')],'type':_0x433665['type'][_0xed13('0x2d')]};});_0x2066ca[_0xed13('0x2e')]=_[_0xed13('0x2a')](_0x570929,_0xed13('0x28'));_0x2066ca[_0xed13('0x2f')]=_[_0xed13('0x30')](_0x40444a[_0xed13('0x2f')]);_0x2066ca['filters']=_[_0xed13('0x31')](_0x2066ca['model'],_0x2066ca['query']);_0x7ce996[_0xed13('0x32')]=_[_0xed13('0x31')](_0x2066ca[_0xed13('0x2e')],qs['fields'](_0x40444a[_0xed13('0x2f')][_0xed13('0x33')]));_0x7ce996[_0xed13('0x32')]=_0x7ce996['attributes'][_0xed13('0x34')]?_0x7ce996[_0xed13('0x32')]:_0x2066ca[_0xed13('0x2e')];if(!_0x40444a[_0xed13('0x2f')]['hasOwnProperty'](_0xed13('0x35'))){_0x7ce996[_0xed13('0x1d')]=qs[_0xed13('0x1d')](_0x40444a[_0xed13('0x2f')][_0xed13('0x1d')]);_0x7ce996[_0xed13('0x1b')]=qs[_0xed13('0x1b')](_0x40444a[_0xed13('0x2f')][_0xed13('0x1b')]);}_0x7ce996[_0xed13('0x36')]=qs['sort'](_0x40444a[_0xed13('0x2f')][_0xed13('0x37')]);_0x7ce996['where']=qs['filters'](_['pick'](_0x40444a[_0xed13('0x2f')],_0x2066ca[_0xed13('0x38')]),_0x570929);if(_0x40444a['query']['filter']){_0x7ce996[_0xed13('0x39')]=_[_0xed13('0x3a')](_0x7ce996[_0xed13('0x39')],{'$or':_[_0xed13('0x2a')](_0x570929,function(_0x358098){if(_0x358098['type']!=='VIRTUAL'){var _0x1e943a={};_0x1e943a[_0x358098['name']]={'$like':'%'+_0x40444a[_0xed13('0x2f')]['filter']+'%'};return _0x1e943a;}})});}_0x7ce996=_[_0xed13('0x3a')]({},_0x7ce996,_0x40444a['options']);var _0x4d6429={'where':_0x7ce996['where']};return db[_0xed13('0x2b')][_0xed13('0x1e')](_0x4d6429)[_0xed13('0x24')](function(_0x42d5f7){_0x323156[_0xed13('0x1e')]=_0x42d5f7;if(_0x40444a['query'][_0xed13('0x3b')]){_0x7ce996[_0xed13('0x3c')]=[{'all':!![]}];}return db[_0xed13('0x2b')][_0xed13('0x3d')](_0x7ce996);})[_0xed13('0x24')](function(_0x5a8cfb){_0x323156[_0xed13('0x3e')]=_0x5a8cfb;return _0x323156;})[_0xed13('0x24')](respondWithFilteredResult(_0x4ed119,_0x7ce996))[_0xed13('0x3f')](handleError(_0x4ed119,null));};exports[_0xed13('0x40')]=function(_0x187e28,_0x2e43b5){var _0x535de7={'raw':!![],'where':{'id':_0x187e28[_0xed13('0x41')]['id']}},_0x2f04ef={};_0x2f04ef[_0xed13('0x2e')]=_[_0xed13('0x30')](db[_0xed13('0x2b')][_0xed13('0x42')]);_0x2f04ef[_0xed13('0x2f')]=_[_0xed13('0x30')](_0x187e28[_0xed13('0x2f')]);_0x2f04ef[_0xed13('0x38')]=_[_0xed13('0x31')](_0x2f04ef[_0xed13('0x2e')],_0x2f04ef[_0xed13('0x2f')]);_0x535de7[_0xed13('0x32')]=_['intersection'](_0x2f04ef[_0xed13('0x2e')],qs[_0xed13('0x33')](_0x187e28['query'][_0xed13('0x33')]));_0x535de7[_0xed13('0x32')]=_0x535de7[_0xed13('0x32')]['length']?_0x535de7[_0xed13('0x32')]:_0x2f04ef[_0xed13('0x2e')];if(_0x187e28[_0xed13('0x2f')]['includeAll']){_0x535de7['include']=[{'all':!![]}];}_0x535de7=_[_0xed13('0x3a')]({},_0x535de7,_0x187e28[_0xed13('0x43')]);return db['VtigerField'][_0xed13('0x44')](_0x535de7)[_0xed13('0x24')](handleEntityNotFound(_0x2e43b5,null))[_0xed13('0x24')](respondWithResult(_0x2e43b5,null))[_0xed13('0x3f')](handleError(_0x2e43b5,null));};exports['create']=function(_0x1df911,_0xf4ea89){return db[_0xed13('0x2b')][_0xed13('0x45')](_0x1df911['body'],{})[_0xed13('0x24')](respondWithResult(_0xf4ea89,0xc9))['catch'](handleError(_0xf4ea89,null));};exports[_0xed13('0x22')]=function(_0x50d12f,_0x5a0828){if(_0x50d12f[_0xed13('0x46')]['id']){delete _0x50d12f[_0xed13('0x46')]['id'];}return db['VtigerField'][_0xed13('0x44')]({'where':{'id':_0x50d12f[_0xed13('0x41')]['id']}})[_0xed13('0x24')](handleEntityNotFound(_0x5a0828,null))[_0xed13('0x24')](saveUpdates(_0x50d12f['body'],null))[_0xed13('0x24')](respondWithResult(_0x5a0828,null))['catch'](handleError(_0x5a0828,null));};exports[_0xed13('0x23')]=function(_0x365e50,_0x19762a){return db[_0xed13('0x2b')][_0xed13('0x44')]({'where':{'id':_0x365e50[_0xed13('0x41')]['id']}})[_0xed13('0x24')](handleEntityNotFound(_0x19762a,null))[_0xed13('0x24')](removeEntity(_0x19762a,null))['catch'](handleError(_0x19762a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index bb35e00..01bcccb 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 _0x49ce=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','VtigerField','vtiger_unique_index','idField','lodash','util'];(function(_0x747b32,_0x13a2b2){var _0x473852=function(_0x6e64bd){while(--_0x6e64bd){_0x747b32['push'](_0x747b32['shift']());}};_0x473852(++_0x13a2b2);}(_0x49ce,0xce));var _0xe49c=function(_0x895358,_0x32f914){_0x895358=_0x895358-0x0;var _0x26e26e=_0x49ce[_0x895358];return _0x26e26e;};'use strict';var _=require(_0xe49c('0x0'));var util=require(_0xe49c('0x1'));var logger=require(_0xe49c('0x2'))(_0xe49c('0x3'));var moment=require(_0xe49c('0x4'));var BPromise=require(_0xe49c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe49c('0x6'));var rimraf=require(_0xe49c('0x7'));var config=require(_0xe49c('0x8'));var attributes=require('./intVtigerField.attributes');module[_0xe49c('0x9')]=function(_0x13044d,_0x2f868f){return _0x13044d['define'](_0xe49c('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xe49c('0xb'),'fields':[_0xe49c('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf94b=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intVtigerField.attributes','exports','int_vtiger_fields'];(function(_0x40d67d,_0x1e4228){var _0x5f0edd=function(_0x3bc34f){while(--_0x3bc34f){_0x40d67d['push'](_0x40d67d['shift']());}};_0x5f0edd(++_0x1e4228);}(_0xf94b,0x1a3));var _0xbf94=function(_0x5abff6,_0x352e06){_0x5abff6=_0x5abff6-0x0;var _0x40a0ea=_0xf94b[_0x5abff6];return _0x40a0ea;};'use strict';var _=require(_0xbf94('0x0'));var util=require(_0xbf94('0x1'));var logger=require(_0xbf94('0x2'))(_0xbf94('0x3'));var moment=require(_0xbf94('0x4'));var BPromise=require(_0xbf94('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf94('0x6'));var attributes=require(_0xbf94('0x7'));module[_0xbf94('0x8')]=function(_0x487463,_0x74da9d){return _0x487463['define']('VtigerField',attributes,{'tableName':_0xbf94('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xbf94('0xa')],'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 e38e260..180b9e3 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 _0xecc6=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VtigerField,\x20%s,\x20%s','result'];(function(_0x272d4e,_0x4adf01){var _0x17863a=function(_0x1e7829){while(--_0x1e7829){_0x272d4e['push'](_0x272d4e['shift']());}};_0x17863a(++_0x4adf01);}(_0xecc6,0x199));var _0x6ecc=function(_0x520c05,_0x24a5f1){_0x520c05=_0x520c05-0x0;var _0x3055b4=_0xecc6[_0x520c05];return _0x3055b4;};'use strict';var _=require(_0x6ecc('0x0'));var util=require(_0x6ecc('0x1'));var moment=require(_0x6ecc('0x2'));var BPromise=require(_0x6ecc('0x3'));var rs=require(_0x6ecc('0x4'));var fs=require('fs');var Redis=require(_0x6ecc('0x5'));var db=require(_0x6ecc('0x6'))['db'];var utils=require(_0x6ecc('0x7'));var logger=require(_0x6ecc('0x8'))(_0x6ecc('0x9'));var config=require('../../config/environment');var jayson=require(_0x6ecc('0xa'));var client=jayson[_0x6ecc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a34b9,_0x39ef9e,_0x5d19b8){return new BPromise(function(_0x1954c7,_0x4eeeb7){return client[_0x6ecc('0xc')](_0x5a34b9,_0x5d19b8)[_0x6ecc('0xd')](function(_0x20ab99){logger[_0x6ecc('0xe')]('VtigerField,\x20%s,\x20%s',_0x39ef9e,'request\x20sent');logger[_0x6ecc('0xf')](_0x6ecc('0x10'),_0x39ef9e,_0x6ecc('0x11'),JSON[_0x6ecc('0x12')](_0x20ab99));if(_0x20ab99[_0x6ecc('0x13')]){if(_0x20ab99['error']['code']===0x1f4){logger[_0x6ecc('0x13')]('VtigerField,\x20%s,\x20%s',_0x39ef9e,_0x20ab99[_0x6ecc('0x13')]['message']);return _0x4eeeb7(_0x20ab99[_0x6ecc('0x13')][_0x6ecc('0x14')]);}logger['error'](_0x6ecc('0x15'),_0x39ef9e,_0x20ab99[_0x6ecc('0x13')]['message']);return _0x1954c7(_0x20ab99[_0x6ecc('0x13')][_0x6ecc('0x14')]);}else{logger['info'](_0x6ecc('0x15'),_0x39ef9e,'request\x20sent');_0x1954c7(_0x20ab99[_0x6ecc('0x16')][_0x6ecc('0x14')]);}})[_0x6ecc('0x17')](function(_0xa5b48f){logger[_0x6ecc('0x13')](_0x6ecc('0x15'),_0x39ef9e,_0xa5b48f);_0x4eeeb7(_0xa5b48f);});});} \ No newline at end of file +var _0xc07e=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x11865e,_0x2034dc){var _0x2b6737=function(_0x46bff1){while(--_0x46bff1){_0x11865e['push'](_0x11865e['shift']());}};_0x2b6737(++_0x2034dc);}(_0xc07e,0xb4));var _0xec07=function(_0x34ee5a,_0x4f2550){_0x34ee5a=_0x34ee5a-0x0;var _0x2eb2a3=_0xc07e[_0x34ee5a];return _0x2eb2a3;};'use strict';var _=require(_0xec07('0x0'));var util=require(_0xec07('0x1'));var moment=require(_0xec07('0x2'));var BPromise=require(_0xec07('0x3'));var rs=require(_0xec07('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec07('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec07('0x6'))(_0xec07('0x7'));var config=require(_0xec07('0x8'));var jayson=require(_0xec07('0x9'));var client=jayson[_0xec07('0xa')][_0xec07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c419e,_0x6ab562,_0xfacdbf){return new BPromise(function(_0x439974,_0x42be6f){return client[_0xec07('0xc')](_0x1c419e,_0xfacdbf)[_0xec07('0xd')](function(_0x335863){logger['info'](_0xec07('0xe'),_0x6ab562,'request\x20sent');logger[_0xec07('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x6ab562,_0xec07('0x10'),JSON['stringify'](_0x335863));if(_0x335863[_0xec07('0x11')]){if(_0x335863[_0xec07('0x11')][_0xec07('0x12')]===0x1f4){logger[_0xec07('0x11')](_0xec07('0xe'),_0x6ab562,_0x335863[_0xec07('0x11')][_0xec07('0x13')]);return _0x42be6f(_0x335863['error'][_0xec07('0x13')]);}logger[_0xec07('0x11')]('VtigerField,\x20%s,\x20%s',_0x6ab562,_0x335863['error'][_0xec07('0x13')]);return _0x439974(_0x335863[_0xec07('0x11')]['message']);}else{logger['info'](_0xec07('0xe'),_0x6ab562,_0xec07('0x10'));_0x439974(_0x335863[_0xec07('0x14')]['message']);}})[_0xec07('0x15')](function(_0x30b5fa){logger[_0xec07('0x11')](_0xec07('0xe'),_0x6ab562,_0x30b5fa);_0x42be6f(_0x30b5fa);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 9477297..bd5f725 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 _0x9ca0=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/configurations'];(function(_0x3b81e4,_0x287ad3){var _0x48acfd=function(_0xaf6fe5){while(--_0xaf6fe5){_0x3b81e4['push'](_0x3b81e4['shift']());}};_0x48acfd(++_0x287ad3);}(_0x9ca0,0xe4));var _0x09ca=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x9ca0[_0x30faec];return _0x29484f;};'use strict';var multer=require(_0x09ca('0x0'));var util=require(_0x09ca('0x1'));var path=require(_0x09ca('0x2'));var timeout=require(_0x09ca('0x3'));var express=require(_0x09ca('0x4'));var router=express['Router']();var fs_extra=require(_0x09ca('0x5'));var auth=require(_0x09ca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x09ca('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x09ca('0x8')]('/',auth[_0x09ca('0x9')](),controller['index']);router['get']('/:id',auth[_0x09ca('0x9')](),controller[_0x09ca('0xa')]);router['get'](_0x09ca('0xb'),auth['isAuthenticated'](),controller[_0x09ca('0xc')]);router['get'](_0x09ca('0xd'),auth[_0x09ca('0x9')](),controller[_0x09ca('0xe')]);router[_0x09ca('0xf')]('/',auth[_0x09ca('0x9')](),controller[_0x09ca('0x10')]);router[_0x09ca('0xf')]('/:id/configurations',auth[_0x09ca('0x9')](),controller[_0x09ca('0x11')]);router[_0x09ca('0x12')](_0x09ca('0x13'),auth[_0x09ca('0x9')](),controller[_0x09ca('0x14')]);router[_0x09ca('0x15')](_0x09ca('0x13'),auth[_0x09ca('0x9')](),controller[_0x09ca('0x16')]);module[_0x09ca('0x17')]=router; \ No newline at end of file +var _0x29dd=['/:id/fields','getFields','post','create','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations'];(function(_0x30b58,_0x48df3b){var _0x9d210d=function(_0x46fffd){while(--_0x46fffd){_0x30b58['push'](_0x30b58['shift']());}};_0x9d210d(++_0x48df3b);}(_0x29dd,0x1d3));var _0xd29d=function(_0x1a6231,_0x50280e){_0x1a6231=_0x1a6231-0x0;var _0x43ba67=_0x29dd[_0x1a6231];return _0x43ba67;};'use strict';var multer=require('multer');var util=require(_0xd29d('0x0'));var path=require(_0xd29d('0x1'));var timeout=require('connect-timeout');var express=require(_0xd29d('0x2'));var router=express[_0xd29d('0x3')]();var fs_extra=require(_0xd29d('0x4'));var auth=require(_0xd29d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd29d('0x6'));var controller=require(_0xd29d('0x7'));router[_0xd29d('0x8')]('/',auth[_0xd29d('0x9')](),controller['index']);router[_0xd29d('0x8')](_0xd29d('0xa'),auth[_0xd29d('0x9')](),controller['show']);router[_0xd29d('0x8')](_0xd29d('0xb'),auth[_0xd29d('0x9')](),controller[_0xd29d('0xc')]);router['get'](_0xd29d('0xd'),auth[_0xd29d('0x9')](),controller[_0xd29d('0xe')]);router[_0xd29d('0xf')]('/',auth['isAuthenticated'](),controller[_0xd29d('0x10')]);router[_0xd29d('0xf')](_0xd29d('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xd29d('0x11')](_0xd29d('0xa'),auth[_0xd29d('0x9')](),controller['update']);router[_0xd29d('0x12')](_0xd29d('0xa'),auth[_0xd29d('0x9')](),controller[_0xd29d('0x13')]);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 5a1d0b1..28ea220 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 _0xdeb3=['newTab','exports','STRING','remoteUri','ENUM','token','integrationTab'];(function(_0x3c03b5,_0x3fcfdc){var _0x4b731c=function(_0xd23591){while(--_0xd23591){_0x3c03b5['push'](_0x3c03b5['shift']());}};_0x4b731c(++_0x3fcfdc);}(_0xdeb3,0xb7));var _0x3deb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdeb3[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0x3deb('0x0')]={'name':{'type':Sequelize[_0x3deb('0x1')]},'description':{'type':Sequelize[_0x3deb('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x3deb('0x1')]},'token':{'type':Sequelize[_0x3deb('0x1')]},'remoteUri':{'type':Sequelize[_0x3deb('0x1')],'unique':_0x3deb('0x2')},'authType':{'type':Sequelize[_0x3deb('0x3')]('password',_0x3deb('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x3deb('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3deb('0x5'),_0x3deb('0x6')),'defaultValue':_0x3deb('0x5')}}; \ No newline at end of file +var _0x1b65=['remoteUri','ENUM','password','integrationTab','sequelize','exports','STRING','username'];(function(_0xdd00f,_0x571da6){var _0x151bd8=function(_0x1efccd){while(--_0x1efccd){_0xdd00f['push'](_0xdd00f['shift']());}};_0x151bd8(++_0x571da6);}(_0x1b65,0x1b4));var _0x51b6=function(_0x2c73fa,_0x41b660){_0x2c73fa=_0x2c73fa-0x0;var _0x201374=_0x1b65[_0x2c73fa];return _0x201374;};'use strict';var Sequelize=require(_0x51b6('0x0'));module[_0x51b6('0x1')]={'name':{'type':Sequelize[_0x51b6('0x2')]},'description':{'type':Sequelize[_0x51b6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x51b6('0x3')},'password':{'type':Sequelize[_0x51b6('0x2')]},'token':{'type':Sequelize[_0x51b6('0x2')]},'remoteUri':{'type':Sequelize[_0x51b6('0x2')],'unique':_0x51b6('0x4')},'authType':{'type':Sequelize[_0x51b6('0x5')](_0x51b6('0x6'),'token'),'defaultValue':_0x51b6('0x6')},'serverUrl':{'type':Sequelize[_0x51b6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x51b6('0x5')](_0x51b6('0x7'),'newTab'),'defaultValue':_0x51b6('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 8dcef04..5b2b3e5 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 _0xb7e7=['channel','getDescriptions','ZendeskField','Subjects','Descriptions','password','token','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','username','base64','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','ZendeskAccount','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','options','AccountId','getSubjects'];(function(_0x1dc0f5,_0x3f1a73){var _0x1d0590=function(_0x166f25){while(--_0x166f25){_0x1dc0f5['push'](_0x1dc0f5['shift']());}};_0x1d0590(++_0x3f1a73);}(_0xb7e7,0x121));var _0x7b7e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xb7e7[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];var integrations=require(_0x7b7e('0x19'));function respondWithStatusCode(_0x54d8ce,_0x267446){_0x267446=_0x267446||0xcc;return function(_0x430eab){if(_0x430eab){return _0x54d8ce['sendStatus'](_0x267446);}return _0x54d8ce[_0x7b7e('0x1a')](_0x267446)['end']();};}function respondWithResult(_0x4c6011,_0x2889ed){_0x2889ed=_0x2889ed||0xc8;return function(_0xd304f5){if(_0xd304f5){return _0x4c6011[_0x7b7e('0x1a')](_0x2889ed)[_0x7b7e('0x1b')](_0xd304f5);}};}function respondWithFilteredResult(_0x3d2fb2,_0x5703fd){return function(_0x51baf6){if(_0x51baf6){var _0xc7f087=typeof _0x5703fd[_0x7b7e('0x1c')]===_0x7b7e('0x1d')&&typeof _0x5703fd[_0x7b7e('0x1e')]===_0x7b7e('0x1d');var _0x3bf2f0=_0x51baf6[_0x7b7e('0x1f')];var _0x200ef7=_0xc7f087?0x0:_0x5703fd[_0x7b7e('0x1c')];var _0x429a0e=_0xc7f087?_0x51baf6[_0x7b7e('0x1f')]:_0x5703fd[_0x7b7e('0x1c')]+_0x5703fd[_0x7b7e('0x1e')];var _0x3bec7d;if(_0x429a0e>=_0x3bf2f0){_0x429a0e=_0x3bf2f0;_0x3bec7d=0xc8;}else{_0x3bec7d=0xce;}_0x3d2fb2[_0x7b7e('0x1a')](_0x3bec7d);return _0x3d2fb2[_0x7b7e('0x20')](_0x7b7e('0x21'),_0x200ef7+'-'+_0x429a0e+'/'+_0x3bf2f0)['json'](_0x51baf6);}return null;};}function patchUpdates(_0x69262b){return function(_0x43db4f){try{jsonpatch[_0x7b7e('0x22')](_0x43db4f,_0x69262b,!![]);}catch(_0x4c0647){return BPromise[_0x7b7e('0x23')](_0x4c0647);}return _0x43db4f[_0x7b7e('0x24')]();};}function saveUpdates(_0x14243b,_0x200156){return function(_0x2b7211){if(_0x2b7211){return _0x2b7211[_0x7b7e('0x25')](_0x14243b)[_0x7b7e('0x26')](function(_0x10a66a){return _0x10a66a;});}return null;};}function removeEntity(_0x53bbb3,_0x5d6215){return function(_0x4a836a){if(_0x4a836a){return _0x4a836a[_0x7b7e('0x27')]()[_0x7b7e('0x26')](function(){_0x53bbb3[_0x7b7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d3b1,_0x5dadbb){return function(_0x182245){if(!_0x182245){_0x51d3b1[_0x7b7e('0x28')](0x194);}return _0x182245;};}function handleError(_0x16a3c7,_0x7aa71){_0x7aa71=_0x7aa71||0x1f4;return function(_0x3ceaf5){logger['error'](_0x3ceaf5[_0x7b7e('0x29')]);if(_0x3ceaf5[_0x7b7e('0x2a')]){delete _0x3ceaf5['name'];}_0x16a3c7['status'](_0x7aa71)['send'](_0x3ceaf5);};}exports[_0x7b7e('0x2b')]=function(_0x423832,_0x503625){var _0x3db8c4={},_0x51d4b5={},_0x1b4341={'count':0x0,'rows':[]};var _0xb9b6bf=_[_0x7b7e('0x2c')](db['ZendeskAccount'][_0x7b7e('0x2d')],function(_0xe31336){return{'name':_0xe31336[_0x7b7e('0x2e')],'type':_0xe31336[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x51d4b5['model']=_[_0x7b7e('0x2c')](_0xb9b6bf,'name');_0x51d4b5[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x423832[_0x7b7e('0x31')]);_0x51d4b5[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x51d4b5[_0x7b7e('0x35')],_0x51d4b5[_0x7b7e('0x31')]);_0x3db8c4['attributes']=_['intersection'](_0x51d4b5[_0x7b7e('0x35')],qs[_0x7b7e('0x36')](_0x423832['query'][_0x7b7e('0x36')]));_0x3db8c4[_0x7b7e('0x37')]=_0x3db8c4[_0x7b7e('0x37')]['length']?_0x3db8c4[_0x7b7e('0x37')]:_0x51d4b5[_0x7b7e('0x35')];if(!_0x423832[_0x7b7e('0x31')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x3db8c4[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x3db8c4[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}_0x3db8c4[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x423832[_0x7b7e('0x31')]['sort']);_0x3db8c4[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x423832[_0x7b7e('0x31')],_0x51d4b5[_0x7b7e('0x33')]),_0xb9b6bf);if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x3db8c4[_0x7b7e('0x3c')]=_[_0x7b7e('0x3f')](_0x3db8c4[_0x7b7e('0x3c')],{'$or':_['map'](_0xb9b6bf,function(_0x3d6571){if(_0x3d6571[_0x7b7e('0x2f')]!==_0x7b7e('0x40')){var _0x1d43da={};_0x1d43da[_0x3d6571['name']]={'$like':'%'+_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x1d43da;}})});}_0x3db8c4=_[_0x7b7e('0x3f')]({},_0x3db8c4,_0x423832['options']);var _0x4a2888={'where':_0x3db8c4[_0x7b7e('0x3c')]};return db['ZendeskAccount'][_0x7b7e('0x1f')](_0x4a2888)[_0x7b7e('0x26')](function(_0x4de331){_0x1b4341[_0x7b7e('0x1f')]=_0x4de331;if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x41')]){_0x3db8c4[_0x7b7e('0x42')]=[{'all':!![]}];}return db[_0x7b7e('0x43')][_0x7b7e('0x44')](_0x3db8c4);})[_0x7b7e('0x26')](function(_0x1d9bb9){_0x1b4341[_0x7b7e('0x45')]=_0x1d9bb9;return _0x1b4341;})['then'](respondWithFilteredResult(_0x503625,_0x3db8c4))['catch'](handleError(_0x503625,null));};exports[_0x7b7e('0x46')]=function(_0x550ea6,_0x41c8a6){var _0x5e8b5d={'raw':![],'where':{'id':_0x550ea6[_0x7b7e('0x47')]['id']}},_0x48dd74={};_0x48dd74['model']=_[_0x7b7e('0x32')](db['ZendeskAccount'][_0x7b7e('0x2d')]);_0x48dd74[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x550ea6[_0x7b7e('0x31')]);_0x48dd74['filters']=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],_0x48dd74[_0x7b7e('0x31')]);_0x5e8b5d[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],qs['fields'](_0x550ea6['query']['fields']));_0x5e8b5d[_0x7b7e('0x37')]=_0x5e8b5d[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x5e8b5d[_0x7b7e('0x37')]:_0x48dd74[_0x7b7e('0x35')];if(_0x550ea6[_0x7b7e('0x31')]['includeAll']){_0x5e8b5d[_0x7b7e('0x42')]=[{'all':!![]}];}_0x5e8b5d=_[_0x7b7e('0x3f')]({},_0x5e8b5d,_0x550ea6['options']);return db['ZendeskAccount'][_0x7b7e('0x49')](_0x5e8b5d)[_0x7b7e('0x26')](handleEntityNotFound(_0x41c8a6,null))[_0x7b7e('0x26')](respondWithResult(_0x41c8a6,null))[_0x7b7e('0x4a')](handleError(_0x41c8a6,null));};exports[_0x7b7e('0x4b')]=function(_0xb46776,_0x590154){return db[_0x7b7e('0x43')]['create'](_0xb46776[_0x7b7e('0x4c')],{})[_0x7b7e('0x26')](respondWithResult(_0x590154,0xc9))[_0x7b7e('0x4a')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x58e4e6,_0x3b649e){if(_0x58e4e6[_0x7b7e('0x4c')]['id']){delete _0x58e4e6[_0x7b7e('0x4c')]['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x58e4e6['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3b649e,null))[_0x7b7e('0x26')](saveUpdates(_0x58e4e6[_0x7b7e('0x4c')],null))[_0x7b7e('0x26')](respondWithResult(_0x3b649e,null))[_0x7b7e('0x4a')](handleError(_0x3b649e,null));};exports['destroy']=function(_0x1d6d18,_0x29024e){return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x1d6d18[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x29024e,null))[_0x7b7e('0x26')](removeEntity(_0x29024e,null))['catch'](handleError(_0x29024e,null));};exports[_0x7b7e('0x4d')]=function(_0x5d7c89,_0x16730c,_0x766a54){var _0x570303={};var _0x36f1be={};var _0x44e3a0;var _0x16c81d;return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x5d7c89[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x16730c,null))['then'](function(_0xbf044d){if(_0xbf044d){_0x44e3a0=_0xbf044d;_0x36f1be[_0x7b7e('0x35')]=_[_0x7b7e('0x32')](db[_0x7b7e('0x4f')]['rawAttributes']);_0x36f1be['query']=_['keys'](_0x5d7c89[_0x7b7e('0x31')]);_0x36f1be[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x36f1be['model'],_0x36f1be['query']);_0x570303[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x36f1be['model'],qs[_0x7b7e('0x36')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x36')]));_0x570303['attributes']=_0x570303[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x570303['attributes']:_0x36f1be[_0x7b7e('0x35')];_0x570303[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3b')]);_0x570303[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x5d7c89[_0x7b7e('0x31')],_0x36f1be['filters']));if(_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x570303['where']=_[_0x7b7e('0x3f')](_0x570303[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x2c')](_0x570303['attributes'],function(_0x1729e0){var _0x4fc349={};_0x4fc349[_0x1729e0]={'$like':'%'+_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x4fc349;})});}_0x570303=_['merge']({},_0x570303,_0x5d7c89[_0x7b7e('0x50')]);return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})['then'](function(_0x2dcb35){if(_0x2dcb35){_0x16c81d=_0x2dcb35[_0x7b7e('0x48')];if(!_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x38')]('nolimit')){_0x570303[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x570303[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})[_0x7b7e('0x26')](function(_0x5b9010){if(_0x5b9010){return _0x5b9010?{'count':_0x16c81d,'rows':_0x5b9010}:null;}})[_0x7b7e('0x26')](respondWithResult(_0x16730c,null))['catch'](handleError(_0x16730c,null));};exports['addConfiguration']=function(_0x2b105a,_0x7cbe6c,_0x1eb4b1){if(_0x2b105a[_0x7b7e('0x4c')]['id']){delete _0x2b105a['body']['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x2b105a[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x7cbe6c,null))[_0x7b7e('0x26')](function(_0x2b2afd){if(_0x2b2afd){_0x2b105a['body'][_0x7b7e('0x51')]=_0x2b2afd['id'];_0x2b105a['body']['Subjects']=integrations[_0x7b7e('0x52')](_0x2b105a['body'][_0x7b7e('0x53')],_0x2b105a['body'][_0x7b7e('0x2f')]);_0x2b105a[_0x7b7e('0x4c')]['Descriptions']=integrations[_0x7b7e('0x54')](_0x2b105a[_0x7b7e('0x4c')]['channel'],_0x2b105a[_0x7b7e('0x4c')][_0x7b7e('0x2f')]);return db[_0x7b7e('0x4f')][_0x7b7e('0x4b')](_0x2b105a[_0x7b7e('0x4c')],{'include':[{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x56')},{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x57')}]});}return null;})[_0x7b7e('0x26')](respondWithResult(_0x7cbe6c,null))['catch'](handleError(_0x7cbe6c,null));};exports['getFields']=function(_0x34e7df,_0x46ac1f,_0x2c6e3a){var _0x348c77='';return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x34e7df[_0x7b7e('0x47')]['id']},'attributes':['id','username',_0x7b7e('0x58'),_0x7b7e('0x59'),'authType',_0x7b7e('0x5a')]})[_0x7b7e('0x26')](handleEntityNotFound(_0x46ac1f,null))[_0x7b7e('0x26')](function(_0x271318){if(_0x271318){_0x348c77=_0x271318[_0x7b7e('0x5a')];var _0x40f65e=_0x348c77[_0x7b7e('0x5b')](-0x1);if(_0x40f65e==='/'){_0x348c77=_0x348c77[_0x7b7e('0x5c')](0x0,_0x348c77[_0x7b7e('0x5d')](_0x40f65e));}var _0x3b6bc6={'method':_0x7b7e('0x5e'),'uri':util['format'](_0x7b7e('0x5f'),_0x348c77,_0x7b7e('0x60')),'json':!![]};switch(_0x271318[_0x7b7e('0x61')]){case _0x7b7e('0x58'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format'](_0x7b7e('0x65'),_0x271318[_0x7b7e('0x66')],_0x271318[_0x7b7e('0x58')]))['toString'](_0x7b7e('0x67')))};break;case _0x7b7e('0x59'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format']('%s/token:%s',_0x271318['username'],_0x271318[_0x7b7e('0x59')]))[_0x7b7e('0x68')](_0x7b7e('0x67')))};break;default:throw new db['Sequelize'][(_0x7b7e('0x69'))](_0x7b7e('0x6a'));}return rp(_0x3b6bc6);}})[_0x7b7e('0x26')](function(_0x5bf4d1){if(_0x5bf4d1){var _0x2983bf=[_0x7b7e('0x6b'),_0x7b7e('0x6c'),_0x7b7e('0x6d'),'assignee'];_[_0x7b7e('0x6e')](_0x5bf4d1[_0x7b7e('0x60')],function(_0xa52b93){return _0x2983bf[_0x7b7e('0x6f')](_0xa52b93['type']);});return{'count':_0x5bf4d1['ticket_fields'][_0x7b7e('0x48')],'rows':_['map'](_0x5bf4d1[_0x7b7e('0x60')],function(_0x4215b5){return{'id':_0x4215b5['id'],'name':_0x4215b5[_0x7b7e('0x70')]>0x7?_0x4215b5[_0x7b7e('0x71')]:_0x4215b5['type'],'custom':_0x4215b5[_0x7b7e('0x70')]>0x7?!![]:![],'options':_0x4215b5[_0x7b7e('0x72')]?_0x4215b5[_0x7b7e('0x72')]:_0x4215b5[_0x7b7e('0x73')]?_0x4215b5[_0x7b7e('0x73')]:[]};})};}})[_0x7b7e('0x26')](respondWithResult(_0x46ac1f,null))[_0x7b7e('0x4a')](function(_0x372478){var _0x44d8c4=_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?0x1f4:_0x372478[_0x7b7e('0x75')]||0x1f4;logger[_0x7b7e('0x76')](_0x7b7e('0x77'),_0x7b7e('0x78'),_0x44d8c4,JSON[_0x7b7e('0x79')](_0x372478));delete _0x372478['name'];if(_0x44d8c4===0x191){_0x44d8c4=0x190;}_0x46ac1f[_0x7b7e('0x1a')](_0x44d8c4)[_0x7b7e('0x7a')](_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?{'message':_0x7b7e('0x7b'),'statusCode':_0x372478[_0x7b7e('0x75')]}:_0x372478);});}; \ No newline at end of file +var _0xa74f=['Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','zip-dir','moment','bluebird','mustache','util','sox','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','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskAccount','findAll','rows','params','length','find','catch','create','body','findOne','getConfigurations','addConfiguration'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa74f,0x9a));var _0xfa74=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xa74f[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfa74('0x16'));function respondWithStatusCode(_0x998585,_0x78173f){_0x78173f=_0x78173f||0xcc;return function(_0x278e8b){if(_0x278e8b){return _0x998585['sendStatus'](_0x78173f);}return _0x998585[_0xfa74('0x17')](_0x78173f)[_0xfa74('0x18')]();};}function respondWithResult(_0x3eb49b,_0x3947ca){_0x3947ca=_0x3947ca||0xc8;return function(_0xe3c97e){if(_0xe3c97e){return _0x3eb49b['status'](_0x3947ca)[_0xfa74('0x19')](_0xe3c97e);}};}function respondWithFilteredResult(_0x13d911,_0x947da6){return function(_0x1f1de0){if(_0x1f1de0){var _0x3867f8=typeof _0x947da6[_0xfa74('0x1a')]===_0xfa74('0x1b')&&typeof _0x947da6['limit']===_0xfa74('0x1b');var _0xe0e33d=_0x1f1de0['count'];var _0x4928b6=_0x3867f8?0x0:_0x947da6[_0xfa74('0x1a')];var _0x25a36b=_0x3867f8?_0x1f1de0[_0xfa74('0x1c')]:_0x947da6['offset']+_0x947da6[_0xfa74('0x1d')];var _0x2edebb;if(_0x25a36b>=_0xe0e33d){_0x25a36b=_0xe0e33d;_0x2edebb=0xc8;}else{_0x2edebb=0xce;}_0x13d911[_0xfa74('0x17')](_0x2edebb);return _0x13d911['set'](_0xfa74('0x1e'),_0x4928b6+'-'+_0x25a36b+'/'+_0xe0e33d)[_0xfa74('0x19')](_0x1f1de0);}return null;};}function patchUpdates(_0x2e6c33){return function(_0x4a5ee4){try{jsonpatch['apply'](_0x4a5ee4,_0x2e6c33,!![]);}catch(_0x100851){return BPromise[_0xfa74('0x1f')](_0x100851);}return _0x4a5ee4[_0xfa74('0x20')]();};}function saveUpdates(_0xeaaa19,_0x1a453d){return function(_0x554e0e){if(_0x554e0e){return _0x554e0e['update'](_0xeaaa19)[_0xfa74('0x21')](function(_0x5aa8a7){return _0x5aa8a7;});}return null;};}function removeEntity(_0x48cbd3,_0x529810){return function(_0x42c439){if(_0x42c439){return _0x42c439[_0xfa74('0x22')]()[_0xfa74('0x21')](function(){_0x48cbd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9eb68c,_0xeb6c11){return function(_0x5ed1c8){if(!_0x5ed1c8){_0x9eb68c[_0xfa74('0x23')](0x194);}return _0x5ed1c8;};}function handleError(_0x5d3b26,_0x1a8cf7){_0x1a8cf7=_0x1a8cf7||0x1f4;return function(_0x153b2a){logger['error'](_0x153b2a[_0xfa74('0x24')]);if(_0x153b2a[_0xfa74('0x25')]){delete _0x153b2a[_0xfa74('0x25')];}_0x5d3b26[_0xfa74('0x17')](_0x1a8cf7)['send'](_0x153b2a);};}exports[_0xfa74('0x26')]=function(_0x2f7cd7,_0x204e01){var _0x57d90e={},_0x4d4bed={},_0x1322a4={'count':0x0,'rows':[]};var _0x8b706e=_['map'](db['ZendeskAccount'][_0xfa74('0x27')],function(_0x564060){return{'name':_0x564060[_0xfa74('0x28')],'type':_0x564060['type'][_0xfa74('0x29')]};});_0x4d4bed[_0xfa74('0x2a')]=_[_0xfa74('0x2b')](_0x8b706e,_0xfa74('0x25'));_0x4d4bed['query']=_[_0xfa74('0x2c')](_0x2f7cd7[_0xfa74('0x2d')]);_0x4d4bed[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x4d4bed[_0xfa74('0x2a')],_0x4d4bed[_0xfa74('0x2d')]);_0x57d90e[_0xfa74('0x30')]=_['intersection'](_0x4d4bed[_0xfa74('0x2a')],qs['fields'](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x57d90e[_0xfa74('0x30')]=_0x57d90e[_0xfa74('0x30')]['length']?_0x57d90e['attributes']:_0x4d4bed[_0xfa74('0x2a')];if(!_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x32')](_0xfa74('0x33'))){_0x57d90e['limit']=qs[_0xfa74('0x1d')](_0x2f7cd7[_0xfa74('0x2d')]['limit']);_0x57d90e['offset']=qs['offset'](_0x2f7cd7['query']['offset']);}_0x57d90e[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x57d90e[_0xfa74('0x36')]=qs[_0xfa74('0x2e')](_[_0xfa74('0x37')](_0x2f7cd7[_0xfa74('0x2d')],_0x4d4bed[_0xfa74('0x2e')]),_0x8b706e);if(_0x2f7cd7['query'][_0xfa74('0x38')]){_0x57d90e[_0xfa74('0x36')]=_[_0xfa74('0x39')](_0x57d90e[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x8b706e,function(_0x186126){if(_0x186126['type']!==_0xfa74('0x3a')){var _0x1f0806={};_0x1f0806[_0x186126[_0xfa74('0x25')]]={'$like':'%'+_0x2f7cd7[_0xfa74('0x2d')]['filter']+'%'};return _0x1f0806;}})});}_0x57d90e=_[_0xfa74('0x39')]({},_0x57d90e,_0x2f7cd7[_0xfa74('0x3b')]);var _0xe8491b={'where':_0x57d90e[_0xfa74('0x36')]};return db['ZendeskAccount'][_0xfa74('0x1c')](_0xe8491b)[_0xfa74('0x21')](function(_0x3dacc2){_0x1322a4['count']=_0x3dacc2;if(_0x2f7cd7['query'][_0xfa74('0x3c')]){_0x57d90e[_0xfa74('0x3d')]=[{'all':!![]}];}return db[_0xfa74('0x3e')][_0xfa74('0x3f')](_0x57d90e);})['then'](function(_0x1ab026){_0x1322a4[_0xfa74('0x40')]=_0x1ab026;return _0x1322a4;})['then'](respondWithFilteredResult(_0x204e01,_0x57d90e))['catch'](handleError(_0x204e01,null));};exports['show']=function(_0x492c7d,_0x95c891){var _0x3098ca={'raw':![],'where':{'id':_0x492c7d[_0xfa74('0x41')]['id']}},_0x3f92b2={};_0x3f92b2[_0xfa74('0x2a')]=_[_0xfa74('0x2c')](db[_0xfa74('0x3e')]['rawAttributes']);_0x3f92b2[_0xfa74('0x2d')]=_[_0xfa74('0x2c')](_0x492c7d[_0xfa74('0x2d')]);_0x3f92b2[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x3f92b2['model'],_0x3f92b2[_0xfa74('0x2d')]);_0x3098ca[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x3f92b2[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x492c7d[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x3098ca[_0xfa74('0x30')]=_0x3098ca[_0xfa74('0x30')][_0xfa74('0x42')]?_0x3098ca['attributes']:_0x3f92b2[_0xfa74('0x2a')];if(_0x492c7d['query'][_0xfa74('0x3c')]){_0x3098ca[_0xfa74('0x3d')]=[{'all':!![]}];}_0x3098ca=_[_0xfa74('0x39')]({},_0x3098ca,_0x492c7d[_0xfa74('0x3b')]);return db['ZendeskAccount'][_0xfa74('0x43')](_0x3098ca)[_0xfa74('0x21')](handleEntityNotFound(_0x95c891,null))['then'](respondWithResult(_0x95c891,null))[_0xfa74('0x44')](handleError(_0x95c891,null));};exports[_0xfa74('0x45')]=function(_0x5cbb70,_0x2be89f){return db[_0xfa74('0x3e')][_0xfa74('0x45')](_0x5cbb70[_0xfa74('0x46')],{})[_0xfa74('0x21')](respondWithResult(_0x2be89f,0xc9))['catch'](handleError(_0x2be89f,null));};exports['update']=function(_0x36f6ca,_0x91df44){if(_0x36f6ca['body']['id']){delete _0x36f6ca[_0xfa74('0x46')]['id'];}return db[_0xfa74('0x3e')][_0xfa74('0x43')]({'where':{'id':_0x36f6ca['params']['id']}})['then'](handleEntityNotFound(_0x91df44,null))[_0xfa74('0x21')](saveUpdates(_0x36f6ca[_0xfa74('0x46')],null))[_0xfa74('0x21')](respondWithResult(_0x91df44,null))[_0xfa74('0x44')](handleError(_0x91df44,null));};exports[_0xfa74('0x22')]=function(_0x3cb23d,_0x2d217d){return db[_0xfa74('0x3e')]['find']({'where':{'id':_0x3cb23d[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2d217d,null))[_0xfa74('0x21')](removeEntity(_0x2d217d,null))[_0xfa74('0x44')](handleError(_0x2d217d,null));};exports['getConfigurations']=function(_0x4ec218,_0x3146de,_0x5b3404){var _0x152eaa={};var _0x221dc7={};var _0x427469;var _0x33e31e;return db[_0xfa74('0x3e')][_0xfa74('0x47')]({'where':{'id':_0x4ec218[_0xfa74('0x41')]['id']}})['then'](handleEntityNotFound(_0x3146de,null))[_0xfa74('0x21')](function(_0x4bcee3){if(_0x4bcee3){_0x427469=_0x4bcee3;_0x221dc7[_0xfa74('0x2a')]=_['keys'](db['ZendeskConfiguration'][_0xfa74('0x27')]);_0x221dc7[_0xfa74('0x2d')]=_['keys'](_0x4ec218['query']);_0x221dc7[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],_0x221dc7[_0xfa74('0x2d')]);_0x152eaa[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x152eaa['attributes']=_0x152eaa[_0xfa74('0x30')][_0xfa74('0x42')]?_0x152eaa['attributes']:_0x221dc7['model'];_0x152eaa[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x152eaa[_0xfa74('0x36')]=qs['filters'](_[_0xfa74('0x37')](_0x4ec218['query'],_0x221dc7[_0xfa74('0x2e')]));if(_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]){_0x152eaa['where']=_['merge'](_0x152eaa[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x152eaa[_0xfa74('0x30')],function(_0x1b3484){var _0x53eca4={};_0x53eca4[_0x1b3484]={'$like':'%'+_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]+'%'};return _0x53eca4;})});}_0x152eaa=_['merge']({},_0x152eaa,_0x4ec218[_0xfa74('0x3b')]);return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x1681e7){if(_0x1681e7){_0x33e31e=_0x1681e7['length'];if(!_0x4ec218[_0xfa74('0x2d')]['hasOwnProperty'](_0xfa74('0x33'))){_0x152eaa[_0xfa74('0x1d')]=qs[_0xfa74('0x1d')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1d')]);_0x152eaa[_0xfa74('0x1a')]=qs[_0xfa74('0x1a')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1a')]);}return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x930728){if(_0x930728){return _0x930728?{'count':_0x33e31e,'rows':_0x930728}:null;}})[_0xfa74('0x21')](respondWithResult(_0x3146de,null))[_0xfa74('0x44')](handleError(_0x3146de,null));};exports[_0xfa74('0x49')]=function(_0x512b58,_0x2361d2,_0x3b0dd5){if(_0x512b58['body']['id']){delete _0x512b58['body']['id'];}return db[_0xfa74('0x3e')]['findOne']({'where':{'id':_0x512b58[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2361d2,null))[_0xfa74('0x21')](function(_0x529921){if(_0x529921){_0x512b58[_0xfa74('0x46')]['AccountId']=_0x529921['id'];_0x512b58['body'][_0xfa74('0x4a')]=integrations[_0xfa74('0x4b')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58[_0xfa74('0x46')][_0xfa74('0x4d')]);_0x512b58[_0xfa74('0x46')][_0xfa74('0x4e')]=integrations[_0xfa74('0x4f')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58['body'][_0xfa74('0x4d')]);return db['ZendeskConfiguration'][_0xfa74('0x45')](_0x512b58[_0xfa74('0x46')],{'include':[{'model':db[_0xfa74('0x50')],'as':'Subjects'},{'model':db[_0xfa74('0x50')],'as':_0xfa74('0x4e')}]});}return null;})[_0xfa74('0x21')](respondWithResult(_0x2361d2,null))['catch'](handleError(_0x2361d2,null));};exports[_0xfa74('0x51')]=function(_0x34e772,_0x474462,_0x1105e5){var _0x10e5f5='';return db['ZendeskAccount'][_0xfa74('0x47')]({'where':{'id':_0x34e772[_0xfa74('0x41')]['id']},'attributes':['id',_0xfa74('0x52'),_0xfa74('0x53'),_0xfa74('0x54'),_0xfa74('0x55'),_0xfa74('0x56')]})[_0xfa74('0x21')](handleEntityNotFound(_0x474462,null))[_0xfa74('0x21')](function(_0x3526d7){if(_0x3526d7){_0x10e5f5=_0x3526d7[_0xfa74('0x56')];var _0x30aec7=_0x10e5f5['slice'](-0x1);if(_0x30aec7==='/'){_0x10e5f5=_0x10e5f5[_0xfa74('0x57')](0x0,_0x10e5f5[_0xfa74('0x58')](_0x30aec7));}var _0xdffc88={'method':_0xfa74('0x59'),'uri':util[_0xfa74('0x5a')](_0xfa74('0x5b'),_0x10e5f5,_0xfa74('0x5c')),'json':!![]};switch(_0x3526d7[_0xfa74('0x55')]){case'password':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util[_0xfa74('0x5a')](_0xfa74('0x5e'),new Buffer(util[_0xfa74('0x5a')]('%s:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x53')]))[_0xfa74('0x5f')](_0xfa74('0x60')))};break;case'token':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xfa74('0x5a')]('%s/token:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x54')]))['toString']('base64'))};break;default:throw new db[(_0xfa74('0x61'))][(_0xfa74('0x62'))](_0xfa74('0x63'));}return rp(_0xdffc88);}})[_0xfa74('0x21')](function(_0x4f1acc){if(_0x4f1acc){var _0x5acb9b=['subject',_0xfa74('0x64'),_0xfa74('0x65'),_0xfa74('0x66')];_[_0xfa74('0x67')](_0x4f1acc[_0xfa74('0x5c')],function(_0x52e8ac){return _0x5acb9b[_0xfa74('0x68')](_0x52e8ac[_0xfa74('0x4d')]);});return{'count':_0x4f1acc[_0xfa74('0x5c')][_0xfa74('0x42')],'rows':_[_0xfa74('0x2b')](_0x4f1acc[_0xfa74('0x5c')],function(_0x358db2){return{'id':_0x358db2['id'],'name':_0x358db2[_0xfa74('0x69')]>0x7?_0x358db2[_0xfa74('0x6a')]:_0x358db2['type'],'custom':_0x358db2['position']>0x7?!![]:![],'options':_0x358db2['system_field_options']?_0x358db2[_0xfa74('0x6b')]:_0x358db2[_0xfa74('0x6c')]?_0x358db2[_0xfa74('0x6c')]:[]};})};}})[_0xfa74('0x21')](respondWithResult(_0x474462,null))[_0xfa74('0x44')](function(_0x533649){var _0x3e4323=_0x34e772[_0xfa74('0x2d')]['test']?0x1f4:_0x533649[_0xfa74('0x6d')]||0x1f4;logger['error'](_0xfa74('0x6e'),_0xfa74('0x51'),_0x3e4323,JSON[_0xfa74('0x6f')](_0x533649));delete _0x533649[_0xfa74('0x25')];if(_0x3e4323===0x191){_0x3e4323=0x190;}_0x474462[_0xfa74('0x17')](_0x3e4323)[_0xfa74('0x70')](_0x34e772[_0xfa74('0x2d')][_0xfa74('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x533649['statusCode']}:_0x533649);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 4e3bbcd..b3ba549 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 _0x0fb3=['moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x0fb3,0xb2));var _0x30fb=function(_0x57e5fc,_0xab31ba){_0x57e5fc=_0x57e5fc-0x0;var _0xd8d031=_0x0fb3[_0x57e5fc];return _0xd8d031;};'use strict';var _=require(_0x30fb('0x0'));var util=require(_0x30fb('0x1'));var logger=require(_0x30fb('0x2'))(_0x30fb('0x3'));var moment=require(_0x30fb('0x4'));var BPromise=require(_0x30fb('0x5'));var rp=require(_0x30fb('0x6'));var fs=require('fs');var path=require(_0x30fb('0x7'));var rimraf=require('rimraf');var config=require(_0x30fb('0x8'));var attributes=require(_0x30fb('0x9'));var integrations=require(_0x30fb('0xa'));module[_0x30fb('0xb')]=function(_0x49de6a,_0x517ca2){return _0x49de6a['define']('ZendeskAccount',attributes,{'tableName':_0x30fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54c6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','ZendeskAccount','../../config/logger'];(function(_0x1012e3,_0x152690){var _0x2d9c74=function(_0x40afe3){while(--_0x40afe3){_0x1012e3['push'](_0x1012e3['shift']());}};_0x2d9c74(++_0x152690);}(_0x54c6,0x15d));var _0x654c=function(_0x5d396c,_0x52ce0a){_0x5d396c=_0x5d396c-0x0;var _0x4e9542=_0x54c6[_0x5d396c];return _0x4e9542;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x654c('0x0'))('api');var moment=require(_0x654c('0x1'));var BPromise=require(_0x654c('0x2'));var rp=require(_0x654c('0x3'));var fs=require('fs');var path=require(_0x654c('0x4'));var rimraf=require(_0x654c('0x5'));var config=require(_0x654c('0x6'));var attributes=require(_0x654c('0x7'));var integrations=require(_0x654c('0x8'));module['exports']=function(_0x24d488,_0x4ce285){return _0x24d488['define'](_0x654c('0x9'),attributes,{'tableName':'int_zendesk_accounts','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 56031bc..c0e313f 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 _0x60a1=['raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ZendeskAccount','options'];(function(_0x19db4a,_0x39f04d){var _0x274fd4=function(_0x558813){while(--_0x558813){_0x19db4a['push'](_0x19db4a['shift']());}};_0x274fd4(++_0x39f04d);}(_0x60a1,0x8a));var _0x160a=function(_0xfb4f3,_0x30e16e){_0xfb4f3=_0xfb4f3-0x0;var _0x18b3d6=_0x60a1[_0xfb4f3];return _0x18b3d6;};'use strict';var _=require(_0x160a('0x0'));var util=require('util');var moment=require(_0x160a('0x1'));var BPromise=require(_0x160a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x160a('0x3'));var db=require(_0x160a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x160a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x160a('0x6'));var client=jayson[_0x160a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x728974,_0x4bf013,_0x1834c0){return new BPromise(function(_0x30aecc,_0x1e72f7){return client[_0x160a('0x8')](_0x728974,_0x1834c0)[_0x160a('0x9')](function(_0x9f9dfe){logger[_0x160a('0xa')](_0x160a('0xb'),_0x4bf013,_0x160a('0xc'));logger[_0x160a('0xd')](_0x160a('0xe'),_0x4bf013,_0x160a('0xc'),JSON['stringify'](_0x9f9dfe));if(_0x9f9dfe[_0x160a('0xf')]){if(_0x9f9dfe[_0x160a('0xf')][_0x160a('0x10')]===0x1f4){logger[_0x160a('0xf')](_0x160a('0xb'),_0x4bf013,_0x9f9dfe[_0x160a('0xf')][_0x160a('0x11')]);return _0x1e72f7(_0x9f9dfe[_0x160a('0xf')][_0x160a('0x11')]);}logger[_0x160a('0xf')](_0x160a('0xb'),_0x4bf013,_0x9f9dfe['error']['message']);return _0x30aecc(_0x9f9dfe[_0x160a('0xf')][_0x160a('0x11')]);}else{logger[_0x160a('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0x4bf013,_0x160a('0xc'));_0x30aecc(_0x9f9dfe[_0x160a('0x12')][_0x160a('0x11')]);}})[_0x160a('0x13')](function(_0x39dd62){logger[_0x160a('0xf')](_0x160a('0xb'),_0x4bf013,_0x39dd62);_0x1e72f7(_0x39dd62);});});}exports['GetZendeskAccount']=function(_0x27d183){var _0x494489=this;return new Promise(function(_0x195455,_0x38d580){return db[_0x160a('0x14')]['findAll']({'raw':_0x27d183[_0x160a('0x15')]?_0x27d183[_0x160a('0x15')][_0x160a('0x16')]===undefined?!![]:![]:!![],'where':_0x27d183['options']?_0x27d183[_0x160a('0x15')][_0x160a('0x17')]||null:null,'attributes':_0x27d183[_0x160a('0x15')]?_0x27d183[_0x160a('0x15')][_0x160a('0x18')]||null:null,'limit':_0x27d183['options']?_0x27d183['options'][_0x160a('0x19')]||null:null,'include':_0x27d183[_0x160a('0x15')]?_0x27d183[_0x160a('0x15')][_0x160a('0x1a')]?_[_0x160a('0x1b')](_0x27d183[_0x160a('0x15')][_0x160a('0x1a')],function(_0x26eb98){return{'model':db[_0x26eb98['model']],'as':_0x26eb98['as'],'attributes':_0x26eb98[_0x160a('0x18')],'include':_0x26eb98[_0x160a('0x1a')]?_[_0x160a('0x1b')](_0x26eb98[_0x160a('0x1a')],function(_0x508cde){return{'model':db[_0x508cde[_0x160a('0x1c')]],'as':_0x508cde['as'],'attributes':_0x508cde['attributes'],'include':_0x508cde[_0x160a('0x1a')]?_[_0x160a('0x1b')](_0x508cde[_0x160a('0x1a')],function(_0x5813be){return{'model':db[_0x5813be[_0x160a('0x1c')]],'as':_0x5813be['as'],'attributes':_0x5813be[_0x160a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x160a('0x9')](function(_0x523fa5){logger['info'](_0x160a('0x1d'),_0x27d183);logger[_0x160a('0xd')](_0x160a('0x1d'),_0x27d183,JSON['stringify'](_0x523fa5));_0x195455(_0x523fa5);})[_0x160a('0x13')](function(_0x51cc0f){logger['error']('GetZendeskAccount',_0x51cc0f['message'],_0x27d183);_0x38d580(_0x494489[_0x160a('0xf')](0x1f4,_0x51cc0f[_0x160a('0x11')]));});});};exports[_0x160a('0x1e')]=function(_0x293b91){var _0x21f6fc=this;return new Promise(function(_0x30bd66,_0x3ca8dc){return db[_0x160a('0x14')][_0x160a('0x1f')]({'raw':_0x293b91[_0x160a('0x15')]?_0x293b91[_0x160a('0x15')][_0x160a('0x16')]===undefined?!![]:![]:!![],'where':_0x293b91[_0x160a('0x15')]?_0x293b91[_0x160a('0x15')]['where']||null:null,'attributes':_0x293b91['options']?_0x293b91[_0x160a('0x15')][_0x160a('0x18')]||null:null,'include':_0x293b91[_0x160a('0x15')]?_0x293b91[_0x160a('0x15')][_0x160a('0x1a')]?_[_0x160a('0x1b')](_0x293b91[_0x160a('0x15')][_0x160a('0x1a')],function(_0x3d5fc6){return{'model':db[_0x3d5fc6['model']],'as':_0x3d5fc6['as'],'attributes':_0x3d5fc6['attributes'],'include':_0x3d5fc6[_0x160a('0x1a')]?_['map'](_0x3d5fc6[_0x160a('0x1a')],function(_0x5e7fcb){return{'model':db[_0x5e7fcb['model']],'as':_0x5e7fcb['as'],'attributes':_0x5e7fcb[_0x160a('0x18')],'include':_0x5e7fcb[_0x160a('0x1a')]?_['map'](_0x5e7fcb[_0x160a('0x1a')],function(_0x2059cb){return{'model':db[_0x2059cb['model']],'as':_0x2059cb['as'],'attributes':_0x2059cb[_0x160a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x160a('0x9')](function(_0x5dec5c){logger[_0x160a('0xa')](_0x160a('0x1e'),_0x293b91);logger[_0x160a('0xd')](_0x160a('0x1e'),_0x293b91,JSON['stringify'](_0x5dec5c));_0x30bd66(_0x5dec5c);})[_0x160a('0x13')](function(_0x338130){logger[_0x160a('0xf')](_0x160a('0x1e'),_0x338130[_0x160a('0x11')],_0x293b91);_0x3ca8dc(_0x21f6fc['error'](0x1f4,_0x338130[_0x160a('0x11')]));});});}; \ No newline at end of file +var _0x59f9=['findAll','options','raw','where','attributes','include','map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x5cd054,_0x2d3b5d){var _0x5a9331=function(_0x2b2a0b){while(--_0x2b2a0b){_0x5cd054['push'](_0x5cd054['shift']());}};_0x5a9331(++_0x2d3b5d);}(_0x59f9,0x1ea));var _0x959f=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0x59f9[_0x442f02];return _0xab6ef1;};'use strict';var _=require(_0x959f('0x0'));var util=require(_0x959f('0x1'));var moment=require(_0x959f('0x2'));var BPromise=require(_0x959f('0x3'));var rs=require(_0x959f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x959f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x959f('0x6'));var config=require(_0x959f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x959f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5c2e,_0x200f23,_0x17f705){return new BPromise(function(_0x10245d,_0x4fd44a){return client['request'](_0x5c5c2e,_0x17f705)[_0x959f('0x9')](function(_0x31674d){logger[_0x959f('0xa')](_0x959f('0xb'),_0x200f23,_0x959f('0xc'));logger[_0x959f('0xd')](_0x959f('0xe'),_0x200f23,'request\x20sent',JSON[_0x959f('0xf')](_0x31674d));if(_0x31674d['error']){if(_0x31674d['error']['code']===0x1f4){logger[_0x959f('0x10')](_0x959f('0xb'),_0x200f23,_0x31674d['error'][_0x959f('0x11')]);return _0x4fd44a(_0x31674d['error'][_0x959f('0x11')]);}logger['error'](_0x959f('0xb'),_0x200f23,_0x31674d['error'][_0x959f('0x11')]);return _0x10245d(_0x31674d['error']['message']);}else{logger[_0x959f('0xa')](_0x959f('0xb'),_0x200f23,_0x959f('0xc'));_0x10245d(_0x31674d[_0x959f('0x12')]['message']);}})[_0x959f('0x13')](function(_0x26e9c9){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x200f23,_0x26e9c9);_0x4fd44a(_0x26e9c9);});});}exports[_0x959f('0x14')]=function(_0x16713a){var _0x2b84ac=this;return new Promise(function(_0x1a4bc1,_0x4b1e63){return db[_0x959f('0x15')][_0x959f('0x16')]({'raw':_0x16713a['options']?_0x16713a[_0x959f('0x17')][_0x959f('0x18')]===undefined?!![]:![]:!![],'where':_0x16713a[_0x959f('0x17')]?_0x16713a[_0x959f('0x17')][_0x959f('0x19')]||null:null,'attributes':_0x16713a[_0x959f('0x17')]?_0x16713a['options'][_0x959f('0x1a')]||null:null,'limit':_0x16713a['options']?_0x16713a['options']['limit']||null:null,'include':_0x16713a['options']?_0x16713a[_0x959f('0x17')][_0x959f('0x1b')]?_[_0x959f('0x1c')](_0x16713a[_0x959f('0x17')]['include'],function(_0x14cbb5){return{'model':db[_0x14cbb5['model']],'as':_0x14cbb5['as'],'attributes':_0x14cbb5['attributes'],'include':_0x14cbb5[_0x959f('0x1b')]?_['map'](_0x14cbb5[_0x959f('0x1b')],function(_0x91a389){return{'model':db[_0x91a389[_0x959f('0x1d')]],'as':_0x91a389['as'],'attributes':_0x91a389[_0x959f('0x1a')],'include':_0x91a389['include']?_[_0x959f('0x1c')](_0x91a389[_0x959f('0x1b')],function(_0x3dcc77){return{'model':db[_0x3dcc77[_0x959f('0x1d')]],'as':_0x3dcc77['as'],'attributes':_0x3dcc77['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18146a){logger[_0x959f('0xa')](_0x959f('0x14'),_0x16713a);logger[_0x959f('0xd')]('GetZendeskAccount',_0x16713a,JSON[_0x959f('0xf')](_0x18146a));_0x1a4bc1(_0x18146a);})['catch'](function(_0x32b1d8){logger[_0x959f('0x10')](_0x959f('0x14'),_0x32b1d8[_0x959f('0x11')],_0x16713a);_0x4b1e63(_0x2b84ac[_0x959f('0x10')](0x1f4,_0x32b1d8['message']));});});};exports[_0x959f('0x1e')]=function(_0x12d582){var _0x50fbc3=this;return new Promise(function(_0x4cf8ae,_0x34d776){return db[_0x959f('0x15')][_0x959f('0x1f')]({'raw':_0x12d582[_0x959f('0x17')]?_0x12d582['options'][_0x959f('0x18')]===undefined?!![]:![]:!![],'where':_0x12d582['options']?_0x12d582['options'][_0x959f('0x19')]||null:null,'attributes':_0x12d582['options']?_0x12d582[_0x959f('0x17')]['attributes']||null:null,'include':_0x12d582[_0x959f('0x17')]?_0x12d582['options']['include']?_[_0x959f('0x1c')](_0x12d582[_0x959f('0x17')]['include'],function(_0x199d64){return{'model':db[_0x199d64['model']],'as':_0x199d64['as'],'attributes':_0x199d64[_0x959f('0x1a')],'include':_0x199d64[_0x959f('0x1b')]?_['map'](_0x199d64['include'],function(_0x54a61a){return{'model':db[_0x54a61a[_0x959f('0x1d')]],'as':_0x54a61a['as'],'attributes':_0x54a61a[_0x959f('0x1a')],'include':_0x54a61a[_0x959f('0x1b')]?_['map'](_0x54a61a[_0x959f('0x1b')],function(_0x1cc648){return{'model':db[_0x1cc648[_0x959f('0x1d')]],'as':_0x1cc648['as'],'attributes':_0x1cc648[_0x959f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d8edf){logger['info'](_0x959f('0x1e'),_0x12d582);logger[_0x959f('0xd')](_0x959f('0x1e'),_0x12d582,JSON[_0x959f('0xf')](_0x4d8edf));_0x4cf8ae(_0x4d8edf);})[_0x959f('0x13')](function(_0x4871e0){logger['error'](_0x959f('0x1e'),_0x4871e0[_0x959f('0x11')],_0x12d582);_0x34d776(_0x50fbc3[_0x959f('0x10')](0x1f4,_0x4871e0[_0x959f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index f0a4e56..f832e69 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 _0x153f=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x4a3b11,_0x5d478f){var _0x9db2df=function(_0x3483a7){while(--_0x3483a7){_0x4a3b11['push'](_0x4a3b11['shift']());}};_0x9db2df(++_0x5d478f);}(_0x153f,0x15b));var _0xf153=function(_0x39c4f9,_0x28a880){_0x39c4f9=_0x39c4f9-0x0;var _0x4da95d=_0x153f[_0x39c4f9];return _0x4da95d;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['get'](_0xf153('0x11'),auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router['get'](_0xf153('0x13'),auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);router[_0xf153('0x15')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x15')](_0xf153('0x13'),auth[_0xf153('0xa')](),controller['setTags']);router[_0xf153('0x17')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xbdb38,_0x503a9f){var _0x2187b9=function(_0x276823){while(--_0x276823){_0xbdb38['push'](_0xbdb38['shift']());}};_0x2187b9(++_0x503a9f);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x54c695,_0x5d6677){_0x54c695=_0x54c695-0x0;var _0x3ce06b=_0xe5b5[_0x54c695];return _0x3ce06b;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 24f74ea..0a47586 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 _0x0de0=['exports','STRING'];(function(_0x4331e2,_0x2f28ec){var _0x68106=function(_0x4b119e){while(--_0x4b119e){_0x4331e2['push'](_0x4331e2['shift']());}};_0x68106(++_0x2f28ec);}(_0x0de0,0xf2));var _0x00de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0de0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x00de('0x0')]={'name':{'type':Sequelize[_0x00de('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3699=['sequelize','exports','STRING'];(function(_0x513988,_0x562f89){var _0x19b0c0=function(_0x29fbe8){while(--_0x29fbe8){_0x513988['push'](_0x513988['shift']());}};_0x19b0c0(++_0x562f89);}(_0x3699,0xb1));var _0x9369=function(_0x30cbc5,_0x44fdee){_0x30cbc5=_0x30cbc5-0x0;var _0x5c506c=_0x3699[_0x30cbc5];return _0x5c506c;};'use strict';var Sequelize=require(_0x9369('0x0'));module[_0x9369('0x1')]={'name':{'type':Sequelize[_0x9369('0x2')]},'description':{'type':Sequelize[_0x9369('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 04a5d76..0596364 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 _0x4384=['type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','ZendeskField','sort','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','ZendeskConfiguration'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x4384,0x18d));var _0x4438=function(_0x14070a,_0x315465){_0x14070a=_0x14070a-0x0;var _0x4fc335=_0x4384[_0x14070a];return _0x4fc335;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4438('0x0'));var zipdir=require(_0x4438('0x1'));var jsonpatch=require(_0x4438('0x2'));var rp=require(_0x4438('0x3'));var moment=require(_0x4438('0x4'));var BPromise=require(_0x4438('0x5'));var Mustache=require(_0x4438('0x6'));var util=require(_0x4438('0x7'));var path=require(_0x4438('0x8'));var sox=require(_0x4438('0x9'));var csv=require(_0x4438('0xa'));var ejs=require(_0x4438('0xb'));var fs=require('fs');var fs_extra=require(_0x4438('0xc'));var _=require(_0x4438('0xd'));var squel=require(_0x4438('0xe'));var crypto=require(_0x4438('0xf'));var jsforce=require(_0x4438('0x10'));var deskjs=require(_0x4438('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4438('0x12'));var Redis=require(_0x4438('0x13'));var authService=require(_0x4438('0x14'));var qs=require(_0x4438('0x15'));var as=require(_0x4438('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4438('0x17'))(_0x4438('0x18'));var utils=require(_0x4438('0x19'));var config=require(_0x4438('0x1a'));var licenseUtil=require(_0x4438('0x1b'));var db=require(_0x4438('0x1c'))['db'];function respondWithStatusCode(_0x32dac8,_0x434651){_0x434651=_0x434651||0xcc;return function(_0x2ad2dd){if(_0x2ad2dd){return _0x32dac8[_0x4438('0x1d')](_0x434651);}return _0x32dac8['status'](_0x434651)[_0x4438('0x1e')]();};}function respondWithResult(_0x3c6d56,_0xadbba8){_0xadbba8=_0xadbba8||0xc8;return function(_0x57accc){if(_0x57accc){return _0x3c6d56[_0x4438('0x1f')](_0xadbba8)[_0x4438('0x20')](_0x57accc);}};}function respondWithFilteredResult(_0x59523b,_0x3ba3f2){return function(_0x103ef1){if(_0x103ef1){var _0x196ea2=typeof _0x3ba3f2[_0x4438('0x21')]===_0x4438('0x22')&&typeof _0x3ba3f2[_0x4438('0x23')]===_0x4438('0x22');var _0x50b591=_0x103ef1[_0x4438('0x24')];var _0x26ae98=_0x196ea2?0x0:_0x3ba3f2['offset'];var _0xb26485=_0x196ea2?_0x103ef1['count']:_0x3ba3f2['offset']+_0x3ba3f2[_0x4438('0x23')];var _0x306c1f;if(_0xb26485>=_0x50b591){_0xb26485=_0x50b591;_0x306c1f=0xc8;}else{_0x306c1f=0xce;}_0x59523b[_0x4438('0x1f')](_0x306c1f);return _0x59523b[_0x4438('0x25')](_0x4438('0x26'),_0x26ae98+'-'+_0xb26485+'/'+_0x50b591)[_0x4438('0x20')](_0x103ef1);}return null;};}function patchUpdates(_0x392e6b){return function(_0x57d005){try{jsonpatch['apply'](_0x57d005,_0x392e6b,!![]);}catch(_0x1c06f6){return BPromise[_0x4438('0x27')](_0x1c06f6);}return _0x57d005['save']();};}function saveUpdates(_0x5551a8,_0x4a2b41){return function(_0x27d22c){if(_0x27d22c){return _0x27d22c[_0x4438('0x28')](_0x5551a8)[_0x4438('0x29')](function(_0x1e2db7){return _0x1e2db7;});}return null;};}function removeEntity(_0xf6cd3,_0x435b94){return function(_0x1847bf){if(_0x1847bf){return _0x1847bf[_0x4438('0x2a')]()['then'](function(){_0xf6cd3['status'](0xcc)[_0x4438('0x1e')]();});}};}function handleEntityNotFound(_0x3562e1,_0x17feb5){return function(_0x3d849c){if(!_0x3d849c){_0x3562e1[_0x4438('0x1d')](0x194);}return _0x3d849c;};}function handleError(_0x13c409,_0x35f02d){_0x35f02d=_0x35f02d||0x1f4;return function(_0x5ee41e){logger['error'](_0x5ee41e[_0x4438('0x2b')]);if(_0x5ee41e[_0x4438('0x2c')]){delete _0x5ee41e[_0x4438('0x2c')];}_0x13c409[_0x4438('0x1f')](_0x35f02d)[_0x4438('0x2d')](_0x5ee41e);};}exports[_0x4438('0x2e')]=function(_0x438133,_0x36b2a7){var _0xea6dd0={},_0x51443a={},_0x2018f1={'count':0x0,'rows':[]};var _0x200890=_['map'](db[_0x4438('0x2f')]['rawAttributes'],function(_0x237d1b){return{'name':_0x237d1b['fieldName'],'type':_0x237d1b[_0x4438('0x30')][_0x4438('0x31')]};});_0x51443a[_0x4438('0x32')]=_[_0x4438('0x33')](_0x200890,_0x4438('0x2c'));_0x51443a['query']=_[_0x4438('0x34')](_0x438133[_0x4438('0x35')]);_0x51443a[_0x4438('0x36')]=_[_0x4438('0x37')](_0x51443a[_0x4438('0x32')],_0x51443a[_0x4438('0x35')]);_0xea6dd0[_0x4438('0x38')]=_[_0x4438('0x37')](_0x51443a['model'],qs['fields'](_0x438133[_0x4438('0x35')][_0x4438('0x39')]));_0xea6dd0['attributes']=_0xea6dd0['attributes'][_0x4438('0x3a')]?_0xea6dd0[_0x4438('0x38')]:_0x51443a[_0x4438('0x32')];if(!_0x438133[_0x4438('0x35')][_0x4438('0x3b')](_0x4438('0x3c'))){_0xea6dd0[_0x4438('0x23')]=qs['limit'](_0x438133[_0x4438('0x35')][_0x4438('0x23')]);_0xea6dd0[_0x4438('0x21')]=qs['offset'](_0x438133[_0x4438('0x35')][_0x4438('0x21')]);}_0xea6dd0[_0x4438('0x3d')]=qs['sort'](_0x438133[_0x4438('0x35')]['sort']);_0xea6dd0[_0x4438('0x3e')]=qs['filters'](_[_0x4438('0x3f')](_0x438133[_0x4438('0x35')],_0x51443a['filters']),_0x200890);if(_0x438133['query'][_0x4438('0x40')]){_0xea6dd0[_0x4438('0x3e')]=_[_0x4438('0x41')](_0xea6dd0[_0x4438('0x3e')],{'$or':_[_0x4438('0x33')](_0x200890,function(_0x30ce7c){if(_0x30ce7c['type']!==_0x4438('0x42')){var _0xda15e1={};_0xda15e1[_0x30ce7c['name']]={'$like':'%'+_0x438133['query'][_0x4438('0x40')]+'%'};return _0xda15e1;}})});}_0xea6dd0=_[_0x4438('0x41')]({},_0xea6dd0,_0x438133[_0x4438('0x43')]);var _0x500c3a={'where':_0xea6dd0[_0x4438('0x3e')]};return db[_0x4438('0x2f')][_0x4438('0x24')](_0x500c3a)[_0x4438('0x29')](function(_0x46baf8){_0x2018f1[_0x4438('0x24')]=_0x46baf8;if(_0x438133[_0x4438('0x35')][_0x4438('0x44')]){_0xea6dd0[_0x4438('0x45')]=[{'all':!![]}];}return db[_0x4438('0x2f')][_0x4438('0x46')](_0xea6dd0);})[_0x4438('0x29')](function(_0x431ac9){_0x2018f1[_0x4438('0x47')]=_0x431ac9;return _0x2018f1;})[_0x4438('0x29')](respondWithFilteredResult(_0x36b2a7,_0xea6dd0))[_0x4438('0x48')](handleError(_0x36b2a7,null));};exports[_0x4438('0x49')]=function(_0x3cecb0,_0x3f2d06){var _0x222c58={'raw':![],'where':{'id':_0x3cecb0[_0x4438('0x4a')]['id']}},_0x9cc8d0={};_0x9cc8d0[_0x4438('0x32')]=_[_0x4438('0x34')](db[_0x4438('0x2f')][_0x4438('0x4b')]);_0x9cc8d0[_0x4438('0x35')]=_[_0x4438('0x34')](_0x3cecb0['query']);_0x9cc8d0['filters']=_[_0x4438('0x37')](_0x9cc8d0[_0x4438('0x32')],_0x9cc8d0[_0x4438('0x35')]);_0x222c58[_0x4438('0x38')]=_['intersection'](_0x9cc8d0[_0x4438('0x32')],qs[_0x4438('0x39')](_0x3cecb0[_0x4438('0x35')]['fields']));_0x222c58[_0x4438('0x38')]=_0x222c58[_0x4438('0x38')]['length']?_0x222c58[_0x4438('0x38')]:_0x9cc8d0['model'];if(_0x3cecb0['query']['includeAll']){_0x222c58[_0x4438('0x45')]=[{'all':!![]}];}_0x222c58=_[_0x4438('0x41')]({},_0x222c58,_0x3cecb0[_0x4438('0x43')]);return db[_0x4438('0x2f')][_0x4438('0x4c')](_0x222c58)[_0x4438('0x29')](handleEntityNotFound(_0x3f2d06,null))[_0x4438('0x29')](respondWithResult(_0x3f2d06,null))[_0x4438('0x48')](handleError(_0x3f2d06,null));};exports['create']=function(_0x5cde2b,_0x47d772){return db[_0x4438('0x2f')][_0x4438('0x4d')](_0x5cde2b['body'],{})[_0x4438('0x29')](respondWithResult(_0x47d772,0xc9))['catch'](handleError(_0x47d772,null));};exports[_0x4438('0x28')]=function(_0x200846,_0x47f780){if(_0x200846[_0x4438('0x4e')]['id']){delete _0x200846[_0x4438('0x4e')]['id'];}return db[_0x4438('0x2f')][_0x4438('0x4c')]({'where':{'id':_0x200846['params']['id']}})[_0x4438('0x29')](handleEntityNotFound(_0x47f780,null))[_0x4438('0x29')](saveUpdates(_0x200846[_0x4438('0x4e')],null))[_0x4438('0x29')](respondWithResult(_0x47f780,null))['catch'](handleError(_0x47f780,null));};exports['destroy']=function(_0x2142db,_0x218a4b){return db[_0x4438('0x2f')][_0x4438('0x4c')]({'where':{'id':_0x2142db['params']['id']}})[_0x4438('0x29')](handleEntityNotFound(_0x218a4b,null))[_0x4438('0x29')](removeEntity(_0x218a4b,null))['catch'](handleError(_0x218a4b,null));};exports[_0x4438('0x4f')]=function(_0x444d9f,_0x2400b5,_0x1386b4){var _0x31c890={};var _0x54546e={};var _0xfd4933;var _0x49ab3c;return db[_0x4438('0x2f')][_0x4438('0x50')]({'where':{'id':_0x444d9f[_0x4438('0x4a')]['id']}})[_0x4438('0x29')](handleEntityNotFound(_0x2400b5,null))[_0x4438('0x29')](function(_0x576054){if(_0x576054){_0xfd4933=_0x576054;_0x54546e[_0x4438('0x32')]=_[_0x4438('0x34')](db[_0x4438('0x51')][_0x4438('0x4b')]);_0x54546e[_0x4438('0x35')]=_[_0x4438('0x34')](_0x444d9f[_0x4438('0x35')]);_0x54546e[_0x4438('0x36')]=_[_0x4438('0x37')](_0x54546e['model'],_0x54546e[_0x4438('0x35')]);_0x31c890['attributes']=_[_0x4438('0x37')](_0x54546e[_0x4438('0x32')],qs[_0x4438('0x39')](_0x444d9f[_0x4438('0x35')]['fields']));_0x31c890[_0x4438('0x38')]=_0x31c890['attributes']['length']?_0x31c890['attributes']:_0x54546e[_0x4438('0x32')];_0x31c890[_0x4438('0x3d')]=qs[_0x4438('0x52')](_0x444d9f['query'][_0x4438('0x52')]);_0x31c890['where']=qs[_0x4438('0x36')](_['pick'](_0x444d9f['query'],_0x54546e[_0x4438('0x36')]));if(_0x444d9f[_0x4438('0x35')][_0x4438('0x40')]){_0x31c890[_0x4438('0x3e')]=_[_0x4438('0x41')](_0x31c890[_0x4438('0x3e')],{'$or':_[_0x4438('0x33')](_0x31c890[_0x4438('0x38')],function(_0x2b3c0a){var _0x1ad1b3={};_0x1ad1b3[_0x2b3c0a]={'$like':'%'+_0x444d9f['query'][_0x4438('0x40')]+'%'};return _0x1ad1b3;})});}_0x31c890=_[_0x4438('0x41')]({},_0x31c890,_0x444d9f[_0x4438('0x43')]);return _0xfd4933[_0x4438('0x4f')](_0x31c890);}})['then'](function(_0x313b06){if(_0x313b06){_0x49ab3c=_0x313b06[_0x4438('0x3a')];if(!_0x444d9f['query'][_0x4438('0x3b')](_0x4438('0x3c'))){_0x31c890[_0x4438('0x23')]=qs['limit'](_0x444d9f[_0x4438('0x35')][_0x4438('0x23')]);_0x31c890[_0x4438('0x21')]=qs[_0x4438('0x21')](_0x444d9f[_0x4438('0x35')][_0x4438('0x21')]);}return _0xfd4933['getFields'](_0x31c890);}})[_0x4438('0x29')](function(_0x1117f5){if(_0x1117f5){return _0x1117f5?{'count':_0x49ab3c,'rows':_0x1117f5}:null;}})['then'](respondWithResult(_0x2400b5,null))[_0x4438('0x48')](handleError(_0x2400b5,null));};exports['getSubjects']=function(_0x4778dd,_0x4d8599,_0x5b684a){var _0x5203cc={};var _0x3edea1={};var _0x5f4a3d;var _0x29252d;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4778dd[_0x4438('0x4a')]['id']}})[_0x4438('0x29')](handleEntityNotFound(_0x4d8599,null))[_0x4438('0x29')](function(_0x48426f){if(_0x48426f){_0x5f4a3d=_0x48426f;_0x3edea1['model']=_[_0x4438('0x34')](db[_0x4438('0x51')][_0x4438('0x4b')]);_0x3edea1[_0x4438('0x35')]=_[_0x4438('0x34')](_0x4778dd[_0x4438('0x35')]);_0x3edea1['filters']=_[_0x4438('0x37')](_0x3edea1['model'],_0x3edea1[_0x4438('0x35')]);_0x5203cc['attributes']=_[_0x4438('0x37')](_0x3edea1['model'],qs['fields'](_0x4778dd[_0x4438('0x35')][_0x4438('0x39')]));_0x5203cc[_0x4438('0x38')]=_0x5203cc[_0x4438('0x38')]['length']?_0x5203cc['attributes']:_0x3edea1[_0x4438('0x32')];_0x5203cc[_0x4438('0x3d')]=qs['sort'](_0x4778dd[_0x4438('0x35')][_0x4438('0x52')]);_0x5203cc[_0x4438('0x3e')]=qs[_0x4438('0x36')](_['pick'](_0x4778dd[_0x4438('0x35')],_0x3edea1[_0x4438('0x36')]));if(_0x4778dd['query'][_0x4438('0x40')]){_0x5203cc[_0x4438('0x3e')]=_[_0x4438('0x41')](_0x5203cc['where'],{'$or':_[_0x4438('0x33')](_0x5203cc[_0x4438('0x38')],function(_0x12a917){var _0x1b22e2={};_0x1b22e2[_0x12a917]={'$like':'%'+_0x4778dd['query']['filter']+'%'};return _0x1b22e2;})});}_0x5203cc=_[_0x4438('0x41')]({},_0x5203cc,_0x4778dd['options']);return _0x5f4a3d['getSubjects'](_0x5203cc);}})[_0x4438('0x29')](function(_0x5fc4ed){if(_0x5fc4ed){_0x29252d=_0x5fc4ed['length'];if(!_0x4778dd[_0x4438('0x35')][_0x4438('0x3b')](_0x4438('0x3c'))){_0x5203cc[_0x4438('0x23')]=qs[_0x4438('0x23')](_0x4778dd[_0x4438('0x35')]['limit']);_0x5203cc[_0x4438('0x21')]=qs[_0x4438('0x21')](_0x4778dd[_0x4438('0x35')][_0x4438('0x21')]);}return _0x5f4a3d[_0x4438('0x53')](_0x5203cc);}})[_0x4438('0x29')](function(_0x4f9503){if(_0x4f9503){return _0x4f9503?{'count':_0x29252d,'rows':_0x4f9503}:null;}})[_0x4438('0x29')](respondWithResult(_0x4d8599,null))['catch'](handleError(_0x4d8599,null));};exports[_0x4438('0x54')]=function(_0x1b9804,_0x2f3abd,_0xbb435d){var _0x50ef01={};var _0x132c22={};var _0x13d5bb;var _0x2942f1;return db[_0x4438('0x2f')][_0x4438('0x50')]({'where':{'id':_0x1b9804[_0x4438('0x4a')]['id']}})[_0x4438('0x29')](handleEntityNotFound(_0x2f3abd,null))[_0x4438('0x29')](function(_0x145af1){if(_0x145af1){_0x13d5bb=_0x145af1;_0x132c22[_0x4438('0x32')]=_['keys'](db[_0x4438('0x51')][_0x4438('0x4b')]);_0x132c22['query']=_[_0x4438('0x34')](_0x1b9804[_0x4438('0x35')]);_0x132c22['filters']=_['intersection'](_0x132c22['model'],_0x132c22[_0x4438('0x35')]);_0x50ef01[_0x4438('0x38')]=_[_0x4438('0x37')](_0x132c22[_0x4438('0x32')],qs[_0x4438('0x39')](_0x1b9804[_0x4438('0x35')][_0x4438('0x39')]));_0x50ef01['attributes']=_0x50ef01['attributes'][_0x4438('0x3a')]?_0x50ef01[_0x4438('0x38')]:_0x132c22[_0x4438('0x32')];_0x50ef01[_0x4438('0x3d')]=qs[_0x4438('0x52')](_0x1b9804[_0x4438('0x35')][_0x4438('0x52')]);_0x50ef01[_0x4438('0x3e')]=qs[_0x4438('0x36')](_[_0x4438('0x3f')](_0x1b9804[_0x4438('0x35')],_0x132c22[_0x4438('0x36')]));if(_0x1b9804[_0x4438('0x35')][_0x4438('0x40')]){_0x50ef01[_0x4438('0x3e')]=_['merge'](_0x50ef01['where'],{'$or':_[_0x4438('0x33')](_0x50ef01[_0x4438('0x38')],function(_0xa72cd5){var _0x1642d0={};_0x1642d0[_0xa72cd5]={'$like':'%'+_0x1b9804[_0x4438('0x35')][_0x4438('0x40')]+'%'};return _0x1642d0;})});}_0x50ef01=_['merge']({},_0x50ef01,_0x1b9804['options']);return _0x13d5bb[_0x4438('0x54')](_0x50ef01);}})[_0x4438('0x29')](function(_0x4924c5){if(_0x4924c5){_0x2942f1=_0x4924c5[_0x4438('0x3a')];if(!_0x1b9804[_0x4438('0x35')][_0x4438('0x3b')](_0x4438('0x3c'))){_0x50ef01['limit']=qs['limit'](_0x1b9804[_0x4438('0x35')][_0x4438('0x23')]);_0x50ef01[_0x4438('0x21')]=qs[_0x4438('0x21')](_0x1b9804[_0x4438('0x35')]['offset']);}return _0x13d5bb['getDescriptions'](_0x50ef01);}})[_0x4438('0x29')](function(_0x2f6055){if(_0x2f6055){return _0x2f6055?{'count':_0x2942f1,'rows':_0x2f6055}:null;}})[_0x4438('0x29')](respondWithResult(_0x2f3abd,null))[_0x4438('0x48')](handleError(_0x2f3abd,null));};exports['getTags']=function(_0x4310bd,_0x27cd25,_0x5d7a3e){var _0x43420f={};var _0x542333={};var _0x53b8f0;var _0x212a2e;return db[_0x4438('0x2f')][_0x4438('0x50')]({'where':{'id':_0x4310bd['params']['id']}})['then'](handleEntityNotFound(_0x27cd25,null))['then'](function(_0x3430d6){if(_0x3430d6){_0x53b8f0=_0x3430d6;_0x542333[_0x4438('0x32')]=_[_0x4438('0x34')](db[_0x4438('0x55')][_0x4438('0x4b')]);_0x542333['query']=_[_0x4438('0x34')](_0x4310bd[_0x4438('0x35')]);_0x542333['filters']=_[_0x4438('0x37')](_0x542333[_0x4438('0x32')],_0x542333[_0x4438('0x35')]);_0x43420f[_0x4438('0x38')]=_[_0x4438('0x37')](_0x542333['model'],qs['fields'](_0x4310bd[_0x4438('0x35')][_0x4438('0x39')]));_0x43420f['attributes']=_0x43420f['attributes'][_0x4438('0x3a')]?_0x43420f['attributes']:_0x542333[_0x4438('0x32')];_0x43420f['order']=qs[_0x4438('0x52')](_0x4310bd[_0x4438('0x35')][_0x4438('0x52')]);_0x43420f['where']=qs[_0x4438('0x36')](_[_0x4438('0x3f')](_0x4310bd[_0x4438('0x35')],_0x542333[_0x4438('0x36')]));if(_0x4310bd['query'][_0x4438('0x40')]){_0x43420f['where']=_['merge'](_0x43420f['where'],{'$or':_['map'](_0x43420f[_0x4438('0x38')],function(_0x11293a){var _0x46da42={};_0x46da42[_0x11293a]={'$like':'%'+_0x4310bd[_0x4438('0x35')][_0x4438('0x40')]+'%'};return _0x46da42;})});}_0x43420f=_[_0x4438('0x41')]({},_0x43420f,_0x4310bd['options']);return _0x53b8f0[_0x4438('0x56')](_0x43420f);}})[_0x4438('0x29')](function(_0xeba6bc){if(_0xeba6bc){_0x212a2e=_0xeba6bc[_0x4438('0x3a')];if(!_0x4310bd[_0x4438('0x35')][_0x4438('0x3b')](_0x4438('0x3c'))){_0x43420f['limit']=qs[_0x4438('0x23')](_0x4310bd['query'][_0x4438('0x23')]);_0x43420f[_0x4438('0x21')]=qs[_0x4438('0x21')](_0x4310bd[_0x4438('0x35')][_0x4438('0x21')]);}return _0x53b8f0[_0x4438('0x56')](_0x43420f);}})['then'](function(_0x188a9e){if(_0x188a9e){return _0x188a9e?{'count':_0x212a2e,'rows':_0x188a9e}:null;}})[_0x4438('0x29')](respondWithResult(_0x27cd25,null))[_0x4438('0x48')](handleError(_0x27cd25,null));};exports[_0x4438('0x57')]=function(_0x2a3cda,_0x18439c,_0x301724){if(_0x2a3cda[_0x4438('0x4e')]['id']){delete _0x2a3cda['body']['id'];}return db[_0x4438('0x2f')][_0x4438('0x50')]({'where':{'id':_0x2a3cda[_0x4438('0x4a')]['id']}})[_0x4438('0x29')](handleEntityNotFound(_0x18439c,null))[_0x4438('0x29')](function(_0x83f576){if(_0x83f576){return _0x83f576[_0x4438('0x57')](_0x2a3cda[_0x4438('0x4e')][_0x4438('0x58')]||[]);}return null;})['then'](respondWithResult(_0x18439c,null))['catch'](handleError(_0x18439c,null));}; \ No newline at end of file +var _0x2d28=['squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','ZendeskConfiguration','length','find','create','body','update','params','destroy','findOne','pick','getFields','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs'];(function(_0x1b7578,_0x51780e){var _0x46fbae=function(_0x44709e){while(--_0x44709e){_0x1b7578['push'](_0x1b7578['shift']());}};_0x46fbae(++_0x51780e);}(_0x2d28,0x1c4));var _0x82d2=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0x2d28[_0x366e99];return _0x180bbe;};'use strict';var emlformat=require(_0x82d2('0x0'));var rimraf=require(_0x82d2('0x1'));var zipdir=require(_0x82d2('0x2'));var jsonpatch=require(_0x82d2('0x3'));var rp=require('request-promise');var moment=require(_0x82d2('0x4'));var BPromise=require(_0x82d2('0x5'));var Mustache=require(_0x82d2('0x6'));var util=require('util');var path=require(_0x82d2('0x7'));var sox=require(_0x82d2('0x8'));var csv=require('to-csv');var ejs=require(_0x82d2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82d2('0xa'));var crypto=require(_0x82d2('0xb'));var jsforce=require(_0x82d2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x82d2('0xd'));var querystring=require(_0x82d2('0xe'));var Papa=require(_0x82d2('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x82d2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82d2('0x11'));var logger=require(_0x82d2('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x82d2('0x13'));var licenseUtil=require(_0x82d2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ffbda,_0xed010d){_0xed010d=_0xed010d||0xcc;return function(_0x5e2b2d){if(_0x5e2b2d){return _0x1ffbda[_0x82d2('0x15')](_0xed010d);}return _0x1ffbda[_0x82d2('0x16')](_0xed010d)[_0x82d2('0x17')]();};}function respondWithResult(_0x195dd9,_0x8987f6){_0x8987f6=_0x8987f6||0xc8;return function(_0xd22cac){if(_0xd22cac){return _0x195dd9[_0x82d2('0x16')](_0x8987f6)['json'](_0xd22cac);}};}function respondWithFilteredResult(_0x12956d,_0x4351da){return function(_0x135a9a){if(_0x135a9a){var _0x335731=typeof _0x4351da[_0x82d2('0x18')]===_0x82d2('0x19')&&typeof _0x4351da[_0x82d2('0x1a')]===_0x82d2('0x19');var _0x621198=_0x135a9a[_0x82d2('0x1b')];var _0x3b2ef3=_0x335731?0x0:_0x4351da[_0x82d2('0x18')];var _0x4912a0=_0x335731?_0x135a9a['count']:_0x4351da['offset']+_0x4351da[_0x82d2('0x1a')];var _0x764309;if(_0x4912a0>=_0x621198){_0x4912a0=_0x621198;_0x764309=0xc8;}else{_0x764309=0xce;}_0x12956d[_0x82d2('0x16')](_0x764309);return _0x12956d[_0x82d2('0x1c')]('Content-Range',_0x3b2ef3+'-'+_0x4912a0+'/'+_0x621198)[_0x82d2('0x1d')](_0x135a9a);}return null;};}function patchUpdates(_0x272762){return function(_0x4aa855){try{jsonpatch[_0x82d2('0x1e')](_0x4aa855,_0x272762,!![]);}catch(_0x497eb7){return BPromise[_0x82d2('0x1f')](_0x497eb7);}return _0x4aa855['save']();};}function saveUpdates(_0x1dab12,_0x5ad97d){return function(_0x36b84c){if(_0x36b84c){return _0x36b84c['update'](_0x1dab12)[_0x82d2('0x20')](function(_0x533ecc){return _0x533ecc;});}return null;};}function removeEntity(_0x2525cf,_0x3a9be7){return function(_0x370a10){if(_0x370a10){return _0x370a10['destroy']()[_0x82d2('0x20')](function(){_0x2525cf[_0x82d2('0x16')](0xcc)[_0x82d2('0x17')]();});}};}function handleEntityNotFound(_0x5449ac,_0x2463a0){return function(_0x29ccf5){if(!_0x29ccf5){_0x5449ac[_0x82d2('0x15')](0x194);}return _0x29ccf5;};}function handleError(_0x260ebf,_0x30cc01){_0x30cc01=_0x30cc01||0x1f4;return function(_0x28cfe2){logger['error'](_0x28cfe2['stack']);if(_0x28cfe2[_0x82d2('0x21')]){delete _0x28cfe2['name'];}_0x260ebf[_0x82d2('0x16')](_0x30cc01)[_0x82d2('0x22')](_0x28cfe2);};}exports['index']=function(_0x55732a,_0x5551a0){var _0x455658={},_0x4bfa84={},_0x7531fb={'count':0x0,'rows':[]};var _0x45c8e3=_['map'](db['ZendeskConfiguration'][_0x82d2('0x23')],function(_0x20df4c){return{'name':_0x20df4c[_0x82d2('0x24')],'type':_0x20df4c[_0x82d2('0x25')][_0x82d2('0x26')]};});_0x4bfa84[_0x82d2('0x27')]=_[_0x82d2('0x28')](_0x45c8e3,_0x82d2('0x21'));_0x4bfa84[_0x82d2('0x29')]=_[_0x82d2('0x2a')](_0x55732a[_0x82d2('0x29')]);_0x4bfa84[_0x82d2('0x2b')]=_[_0x82d2('0x2c')](_0x4bfa84[_0x82d2('0x27')],_0x4bfa84[_0x82d2('0x29')]);_0x455658[_0x82d2('0x2d')]=_[_0x82d2('0x2c')](_0x4bfa84[_0x82d2('0x27')],qs['fields'](_0x55732a['query'][_0x82d2('0x2e')]));_0x455658[_0x82d2('0x2d')]=_0x455658[_0x82d2('0x2d')]['length']?_0x455658[_0x82d2('0x2d')]:_0x4bfa84[_0x82d2('0x27')];if(!_0x55732a[_0x82d2('0x29')][_0x82d2('0x2f')](_0x82d2('0x30'))){_0x455658[_0x82d2('0x1a')]=qs[_0x82d2('0x1a')](_0x55732a[_0x82d2('0x29')]['limit']);_0x455658[_0x82d2('0x18')]=qs[_0x82d2('0x18')](_0x55732a[_0x82d2('0x29')][_0x82d2('0x18')]);}_0x455658[_0x82d2('0x31')]=qs[_0x82d2('0x32')](_0x55732a[_0x82d2('0x29')][_0x82d2('0x32')]);_0x455658['where']=qs[_0x82d2('0x2b')](_['pick'](_0x55732a[_0x82d2('0x29')],_0x4bfa84[_0x82d2('0x2b')]),_0x45c8e3);if(_0x55732a[_0x82d2('0x29')][_0x82d2('0x33')]){_0x455658[_0x82d2('0x34')]=_[_0x82d2('0x35')](_0x455658[_0x82d2('0x34')],{'$or':_[_0x82d2('0x28')](_0x45c8e3,function(_0xeb4b2e){if(_0xeb4b2e[_0x82d2('0x25')]!=='VIRTUAL'){var _0x26b128={};_0x26b128[_0xeb4b2e[_0x82d2('0x21')]]={'$like':'%'+_0x55732a[_0x82d2('0x29')][_0x82d2('0x33')]+'%'};return _0x26b128;}})});}_0x455658=_[_0x82d2('0x35')]({},_0x455658,_0x55732a[_0x82d2('0x36')]);var _0x45f401={'where':_0x455658[_0x82d2('0x34')]};return db['ZendeskConfiguration'][_0x82d2('0x1b')](_0x45f401)['then'](function(_0x429273){_0x7531fb[_0x82d2('0x1b')]=_0x429273;if(_0x55732a['query'][_0x82d2('0x37')]){_0x455658['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x82d2('0x38')](_0x455658);})['then'](function(_0x4d71e1){_0x7531fb[_0x82d2('0x39')]=_0x4d71e1;return _0x7531fb;})['then'](respondWithFilteredResult(_0x5551a0,_0x455658))[_0x82d2('0x3a')](handleError(_0x5551a0,null));};exports[_0x82d2('0x3b')]=function(_0x45220c,_0x42e08a){var _0x454d39={'raw':![],'where':{'id':_0x45220c['params']['id']}},_0x4889f6={};_0x4889f6['model']=_[_0x82d2('0x2a')](db[_0x82d2('0x3c')][_0x82d2('0x23')]);_0x4889f6[_0x82d2('0x29')]=_[_0x82d2('0x2a')](_0x45220c['query']);_0x4889f6[_0x82d2('0x2b')]=_['intersection'](_0x4889f6['model'],_0x4889f6['query']);_0x454d39['attributes']=_[_0x82d2('0x2c')](_0x4889f6[_0x82d2('0x27')],qs[_0x82d2('0x2e')](_0x45220c['query'][_0x82d2('0x2e')]));_0x454d39['attributes']=_0x454d39['attributes'][_0x82d2('0x3d')]?_0x454d39[_0x82d2('0x2d')]:_0x4889f6[_0x82d2('0x27')];if(_0x45220c[_0x82d2('0x29')][_0x82d2('0x37')]){_0x454d39['include']=[{'all':!![]}];}_0x454d39=_[_0x82d2('0x35')]({},_0x454d39,_0x45220c['options']);return db[_0x82d2('0x3c')][_0x82d2('0x3e')](_0x454d39)[_0x82d2('0x20')](handleEntityNotFound(_0x42e08a,null))[_0x82d2('0x20')](respondWithResult(_0x42e08a,null))['catch'](handleError(_0x42e08a,null));};exports['create']=function(_0x3f16a2,_0x3ce50c){return db[_0x82d2('0x3c')][_0x82d2('0x3f')](_0x3f16a2[_0x82d2('0x40')],{})['then'](respondWithResult(_0x3ce50c,0xc9))[_0x82d2('0x3a')](handleError(_0x3ce50c,null));};exports[_0x82d2('0x41')]=function(_0x1acf40,_0x16c020){if(_0x1acf40[_0x82d2('0x40')]['id']){delete _0x1acf40[_0x82d2('0x40')]['id'];}return db[_0x82d2('0x3c')][_0x82d2('0x3e')]({'where':{'id':_0x1acf40[_0x82d2('0x42')]['id']}})['then'](handleEntityNotFound(_0x16c020,null))[_0x82d2('0x20')](saveUpdates(_0x1acf40[_0x82d2('0x40')],null))['then'](respondWithResult(_0x16c020,null))[_0x82d2('0x3a')](handleError(_0x16c020,null));};exports[_0x82d2('0x43')]=function(_0x24f343,_0x281653){return db[_0x82d2('0x3c')][_0x82d2('0x3e')]({'where':{'id':_0x24f343[_0x82d2('0x42')]['id']}})[_0x82d2('0x20')](handleEntityNotFound(_0x281653,null))[_0x82d2('0x20')](removeEntity(_0x281653,null))[_0x82d2('0x3a')](handleError(_0x281653,null));};exports['getFields']=function(_0x7b29ed,_0x3369af,_0x5a7cf8){var _0x1323d0={};var _0x28728b={};var _0x131c4f;var _0x17c40e;return db['ZendeskConfiguration'][_0x82d2('0x44')]({'where':{'id':_0x7b29ed[_0x82d2('0x42')]['id']}})['then'](handleEntityNotFound(_0x3369af,null))[_0x82d2('0x20')](function(_0x8ef43b){if(_0x8ef43b){_0x131c4f=_0x8ef43b;_0x28728b[_0x82d2('0x27')]=_[_0x82d2('0x2a')](db['ZendeskField'][_0x82d2('0x23')]);_0x28728b[_0x82d2('0x29')]=_[_0x82d2('0x2a')](_0x7b29ed[_0x82d2('0x29')]);_0x28728b[_0x82d2('0x2b')]=_[_0x82d2('0x2c')](_0x28728b[_0x82d2('0x27')],_0x28728b[_0x82d2('0x29')]);_0x1323d0[_0x82d2('0x2d')]=_[_0x82d2('0x2c')](_0x28728b[_0x82d2('0x27')],qs[_0x82d2('0x2e')](_0x7b29ed['query'][_0x82d2('0x2e')]));_0x1323d0['attributes']=_0x1323d0[_0x82d2('0x2d')][_0x82d2('0x3d')]?_0x1323d0[_0x82d2('0x2d')]:_0x28728b['model'];_0x1323d0[_0x82d2('0x31')]=qs[_0x82d2('0x32')](_0x7b29ed[_0x82d2('0x29')][_0x82d2('0x32')]);_0x1323d0[_0x82d2('0x34')]=qs[_0x82d2('0x2b')](_[_0x82d2('0x45')](_0x7b29ed['query'],_0x28728b[_0x82d2('0x2b')]));if(_0x7b29ed[_0x82d2('0x29')][_0x82d2('0x33')]){_0x1323d0[_0x82d2('0x34')]=_[_0x82d2('0x35')](_0x1323d0[_0x82d2('0x34')],{'$or':_[_0x82d2('0x28')](_0x1323d0[_0x82d2('0x2d')],function(_0x1abc48){var _0x3252d8={};_0x3252d8[_0x1abc48]={'$like':'%'+_0x7b29ed[_0x82d2('0x29')][_0x82d2('0x33')]+'%'};return _0x3252d8;})});}_0x1323d0=_[_0x82d2('0x35')]({},_0x1323d0,_0x7b29ed['options']);return _0x131c4f[_0x82d2('0x46')](_0x1323d0);}})[_0x82d2('0x20')](function(_0x547938){if(_0x547938){_0x17c40e=_0x547938[_0x82d2('0x3d')];if(!_0x7b29ed[_0x82d2('0x29')][_0x82d2('0x2f')]('nolimit')){_0x1323d0[_0x82d2('0x1a')]=qs['limit'](_0x7b29ed[_0x82d2('0x29')][_0x82d2('0x1a')]);_0x1323d0[_0x82d2('0x18')]=qs[_0x82d2('0x18')](_0x7b29ed[_0x82d2('0x29')]['offset']);}return _0x131c4f[_0x82d2('0x46')](_0x1323d0);}})[_0x82d2('0x20')](function(_0x13e707){if(_0x13e707){return _0x13e707?{'count':_0x17c40e,'rows':_0x13e707}:null;}})['then'](respondWithResult(_0x3369af,null))[_0x82d2('0x3a')](handleError(_0x3369af,null));};exports[_0x82d2('0x47')]=function(_0x54727d,_0x17db71,_0x1f4824){var _0xc97ac9={};var _0x3060dc={};var _0x590865;var _0x82c559;return db['ZendeskConfiguration'][_0x82d2('0x44')]({'where':{'id':_0x54727d['params']['id']}})[_0x82d2('0x20')](handleEntityNotFound(_0x17db71,null))[_0x82d2('0x20')](function(_0x46d7f6){if(_0x46d7f6){_0x590865=_0x46d7f6;_0x3060dc[_0x82d2('0x27')]=_[_0x82d2('0x2a')](db[_0x82d2('0x48')][_0x82d2('0x23')]);_0x3060dc[_0x82d2('0x29')]=_[_0x82d2('0x2a')](_0x54727d[_0x82d2('0x29')]);_0x3060dc[_0x82d2('0x2b')]=_[_0x82d2('0x2c')](_0x3060dc[_0x82d2('0x27')],_0x3060dc[_0x82d2('0x29')]);_0xc97ac9[_0x82d2('0x2d')]=_[_0x82d2('0x2c')](_0x3060dc[_0x82d2('0x27')],qs['fields'](_0x54727d['query']['fields']));_0xc97ac9['attributes']=_0xc97ac9[_0x82d2('0x2d')][_0x82d2('0x3d')]?_0xc97ac9[_0x82d2('0x2d')]:_0x3060dc['model'];_0xc97ac9[_0x82d2('0x31')]=qs[_0x82d2('0x32')](_0x54727d[_0x82d2('0x29')]['sort']);_0xc97ac9[_0x82d2('0x34')]=qs['filters'](_[_0x82d2('0x45')](_0x54727d[_0x82d2('0x29')],_0x3060dc[_0x82d2('0x2b')]));if(_0x54727d[_0x82d2('0x29')]['filter']){_0xc97ac9[_0x82d2('0x34')]=_[_0x82d2('0x35')](_0xc97ac9[_0x82d2('0x34')],{'$or':_['map'](_0xc97ac9[_0x82d2('0x2d')],function(_0x189056){var _0x5dfc22={};_0x5dfc22[_0x189056]={'$like':'%'+_0x54727d[_0x82d2('0x29')][_0x82d2('0x33')]+'%'};return _0x5dfc22;})});}_0xc97ac9=_[_0x82d2('0x35')]({},_0xc97ac9,_0x54727d['options']);return _0x590865[_0x82d2('0x47')](_0xc97ac9);}})[_0x82d2('0x20')](function(_0x317bef){if(_0x317bef){_0x82c559=_0x317bef[_0x82d2('0x3d')];if(!_0x54727d['query']['hasOwnProperty'](_0x82d2('0x30'))){_0xc97ac9[_0x82d2('0x1a')]=qs[_0x82d2('0x1a')](_0x54727d[_0x82d2('0x29')]['limit']);_0xc97ac9['offset']=qs[_0x82d2('0x18')](_0x54727d[_0x82d2('0x29')][_0x82d2('0x18')]);}return _0x590865[_0x82d2('0x47')](_0xc97ac9);}})[_0x82d2('0x20')](function(_0x5b0065){if(_0x5b0065){return _0x5b0065?{'count':_0x82c559,'rows':_0x5b0065}:null;}})[_0x82d2('0x20')](respondWithResult(_0x17db71,null))[_0x82d2('0x3a')](handleError(_0x17db71,null));};exports[_0x82d2('0x49')]=function(_0xca2e7,_0x39c3ea,_0x34207f){var _0x43f1ff={};var _0xc5288d={};var _0x4e062a;var _0x5a2c9b;return db[_0x82d2('0x3c')][_0x82d2('0x44')]({'where':{'id':_0xca2e7['params']['id']}})[_0x82d2('0x20')](handleEntityNotFound(_0x39c3ea,null))['then'](function(_0xea1c9){if(_0xea1c9){_0x4e062a=_0xea1c9;_0xc5288d[_0x82d2('0x27')]=_[_0x82d2('0x2a')](db['ZendeskField'][_0x82d2('0x23')]);_0xc5288d[_0x82d2('0x29')]=_[_0x82d2('0x2a')](_0xca2e7[_0x82d2('0x29')]);_0xc5288d[_0x82d2('0x2b')]=_['intersection'](_0xc5288d[_0x82d2('0x27')],_0xc5288d[_0x82d2('0x29')]);_0x43f1ff[_0x82d2('0x2d')]=_[_0x82d2('0x2c')](_0xc5288d[_0x82d2('0x27')],qs[_0x82d2('0x2e')](_0xca2e7[_0x82d2('0x29')][_0x82d2('0x2e')]));_0x43f1ff[_0x82d2('0x2d')]=_0x43f1ff['attributes'][_0x82d2('0x3d')]?_0x43f1ff[_0x82d2('0x2d')]:_0xc5288d[_0x82d2('0x27')];_0x43f1ff[_0x82d2('0x31')]=qs[_0x82d2('0x32')](_0xca2e7[_0x82d2('0x29')][_0x82d2('0x32')]);_0x43f1ff[_0x82d2('0x34')]=qs[_0x82d2('0x2b')](_[_0x82d2('0x45')](_0xca2e7[_0x82d2('0x29')],_0xc5288d[_0x82d2('0x2b')]));if(_0xca2e7[_0x82d2('0x29')][_0x82d2('0x33')]){_0x43f1ff['where']=_['merge'](_0x43f1ff['where'],{'$or':_[_0x82d2('0x28')](_0x43f1ff[_0x82d2('0x2d')],function(_0x1f6baa){var _0x434638={};_0x434638[_0x1f6baa]={'$like':'%'+_0xca2e7[_0x82d2('0x29')][_0x82d2('0x33')]+'%'};return _0x434638;})});}_0x43f1ff=_[_0x82d2('0x35')]({},_0x43f1ff,_0xca2e7['options']);return _0x4e062a[_0x82d2('0x49')](_0x43f1ff);}})[_0x82d2('0x20')](function(_0x4693f0){if(_0x4693f0){_0x5a2c9b=_0x4693f0[_0x82d2('0x3d')];if(!_0xca2e7[_0x82d2('0x29')][_0x82d2('0x2f')]('nolimit')){_0x43f1ff['limit']=qs[_0x82d2('0x1a')](_0xca2e7['query'][_0x82d2('0x1a')]);_0x43f1ff[_0x82d2('0x18')]=qs['offset'](_0xca2e7[_0x82d2('0x29')][_0x82d2('0x18')]);}return _0x4e062a[_0x82d2('0x49')](_0x43f1ff);}})['then'](function(_0x30c8cf){if(_0x30c8cf){return _0x30c8cf?{'count':_0x5a2c9b,'rows':_0x30c8cf}:null;}})['then'](respondWithResult(_0x39c3ea,null))['catch'](handleError(_0x39c3ea,null));};exports[_0x82d2('0x4a')]=function(_0x1a5681,_0x94368d,_0x5a52fa){var _0x4bca51={};var _0x3f6cdd={};var _0x3fc629;var _0x187726;return db['ZendeskConfiguration'][_0x82d2('0x44')]({'where':{'id':_0x1a5681[_0x82d2('0x42')]['id']}})[_0x82d2('0x20')](handleEntityNotFound(_0x94368d,null))['then'](function(_0x1b3f32){if(_0x1b3f32){_0x3fc629=_0x1b3f32;_0x3f6cdd[_0x82d2('0x27')]=_[_0x82d2('0x2a')](db[_0x82d2('0x4b')][_0x82d2('0x23')]);_0x3f6cdd['query']=_[_0x82d2('0x2a')](_0x1a5681[_0x82d2('0x29')]);_0x3f6cdd[_0x82d2('0x2b')]=_['intersection'](_0x3f6cdd[_0x82d2('0x27')],_0x3f6cdd['query']);_0x4bca51[_0x82d2('0x2d')]=_[_0x82d2('0x2c')](_0x3f6cdd[_0x82d2('0x27')],qs['fields'](_0x1a5681['query'][_0x82d2('0x2e')]));_0x4bca51[_0x82d2('0x2d')]=_0x4bca51[_0x82d2('0x2d')][_0x82d2('0x3d')]?_0x4bca51[_0x82d2('0x2d')]:_0x3f6cdd[_0x82d2('0x27')];_0x4bca51[_0x82d2('0x31')]=qs['sort'](_0x1a5681[_0x82d2('0x29')]['sort']);_0x4bca51[_0x82d2('0x34')]=qs[_0x82d2('0x2b')](_[_0x82d2('0x45')](_0x1a5681['query'],_0x3f6cdd['filters']));if(_0x1a5681[_0x82d2('0x29')][_0x82d2('0x33')]){_0x4bca51[_0x82d2('0x34')]=_[_0x82d2('0x35')](_0x4bca51[_0x82d2('0x34')],{'$or':_[_0x82d2('0x28')](_0x4bca51[_0x82d2('0x2d')],function(_0x1ffa3f){var _0x2466e1={};_0x2466e1[_0x1ffa3f]={'$like':'%'+_0x1a5681[_0x82d2('0x29')][_0x82d2('0x33')]+'%'};return _0x2466e1;})});}_0x4bca51=_[_0x82d2('0x35')]({},_0x4bca51,_0x1a5681['options']);return _0x3fc629[_0x82d2('0x4a')](_0x4bca51);}})[_0x82d2('0x20')](function(_0x52d72f){if(_0x52d72f){_0x187726=_0x52d72f[_0x82d2('0x3d')];if(!_0x1a5681[_0x82d2('0x29')][_0x82d2('0x2f')](_0x82d2('0x30'))){_0x4bca51[_0x82d2('0x1a')]=qs[_0x82d2('0x1a')](_0x1a5681[_0x82d2('0x29')][_0x82d2('0x1a')]);_0x4bca51[_0x82d2('0x18')]=qs[_0x82d2('0x18')](_0x1a5681[_0x82d2('0x29')][_0x82d2('0x18')]);}return _0x3fc629[_0x82d2('0x4a')](_0x4bca51);}})[_0x82d2('0x20')](function(_0x29ff62){if(_0x29ff62){return _0x29ff62?{'count':_0x187726,'rows':_0x29ff62}:null;}})[_0x82d2('0x20')](respondWithResult(_0x94368d,null))['catch'](handleError(_0x94368d,null));};exports['setTags']=function(_0x2107d1,_0x52db0d,_0x41bebe){if(_0x2107d1[_0x82d2('0x40')]['id']){delete _0x2107d1[_0x82d2('0x40')]['id'];}return db[_0x82d2('0x3c')][_0x82d2('0x44')]({'where':{'id':_0x2107d1['params']['id']}})[_0x82d2('0x20')](handleEntityNotFound(_0x52db0d,null))[_0x82d2('0x20')](function(_0x455e25){if(_0x455e25){return _0x455e25[_0x82d2('0x4c')](_0x2107d1[_0x82d2('0x40')]['ids']||[]);}return null;})[_0x82d2('0x20')](respondWithResult(_0x52db0d,null))[_0x82d2('0x3a')](handleError(_0x52db0d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 41d04c2..b8e5cae 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 _0xc900=['api','moment','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','../../config/logger'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0xc900,0xb3));var _0x0c90=function(_0x5df73b,_0x4025b2){_0x5df73b=_0x5df73b-0x0;var _0x50d979=_0xc900[_0x5df73b];return _0x50d979;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c90('0x0'))(_0x0c90('0x1'));var moment=require(_0x0c90('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c90('0x3'));var fs=require('fs');var path=require(_0x0c90('0x4'));var rimraf=require('rimraf');var config=require(_0x0c90('0x5'));var attributes=require(_0x0c90('0x6'));module[_0x0c90('0x7')]=function(_0x718a5c,_0x42f9a3){return _0x718a5c[_0x0c90('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x0c90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a95=['bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x278bd4,_0x58ae1f){var _0x33d724=function(_0x50c612){while(--_0x50c612){_0x278bd4['push'](_0x278bd4['shift']());}};_0x33d724(++_0x58ae1f);}(_0x6a95,0x1db));var _0x56a9=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x6a95[_0x934425];return _0x31d596;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var logger=require(_0x56a9('0x2'))(_0x56a9('0x3'));var moment=require(_0x56a9('0x4'));var BPromise=require(_0x56a9('0x5'));var rp=require(_0x56a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56a9('0x7'));var attributes=require(_0x56a9('0x8'));module[_0x56a9('0x9')]=function(_0x2eb132,_0x3c15b6){return _0x2eb132[_0x56a9('0xa')](_0x56a9('0xb'),attributes,{'tableName':'int_zendesk_configurations','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 22d4474..0188e13 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 _0xdee0=['code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x277a13,_0x482df4){var _0x232e2e=function(_0xf62bd5){while(--_0xf62bd5){_0x277a13['push'](_0x277a13['shift']());}};_0x232e2e(++_0x482df4);}(_0xdee0,0x179));var _0x0dee=function(_0x1ff803,_0x39e593){_0x1ff803=_0x1ff803-0x0;var _0x5471d9=_0xdee0[_0x1ff803];return _0x5471d9;};'use strict';var _=require(_0x0dee('0x0'));var util=require(_0x0dee('0x1'));var moment=require(_0x0dee('0x2'));var BPromise=require('bluebird');var rs=require(_0x0dee('0x3'));var fs=require('fs');var Redis=require(_0x0dee('0x4'));var db=require(_0x0dee('0x5'))['db'];var utils=require(_0x0dee('0x6'));var logger=require(_0x0dee('0x7'))(_0x0dee('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0dee('0x9')][_0x0dee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5edb3c,_0x3a8a37,_0x3f4084){return new BPromise(function(_0x16cccc,_0x2076c8){return client[_0x0dee('0xb')](_0x5edb3c,_0x3f4084)['then'](function(_0x5c022a){logger[_0x0dee('0xc')](_0x0dee('0xd'),_0x3a8a37,_0x0dee('0xe'));logger[_0x0dee('0xf')](_0x0dee('0x10'),_0x3a8a37,_0x0dee('0xe'),JSON[_0x0dee('0x11')](_0x5c022a));if(_0x5c022a[_0x0dee('0x12')]){if(_0x5c022a[_0x0dee('0x12')][_0x0dee('0x13')]===0x1f4){logger[_0x0dee('0x12')](_0x0dee('0xd'),_0x3a8a37,_0x5c022a[_0x0dee('0x12')][_0x0dee('0x14')]);return _0x2076c8(_0x5c022a[_0x0dee('0x12')][_0x0dee('0x14')]);}logger[_0x0dee('0x12')](_0x0dee('0xd'),_0x3a8a37,_0x5c022a[_0x0dee('0x12')][_0x0dee('0x14')]);return _0x16cccc(_0x5c022a[_0x0dee('0x12')]['message']);}else{logger[_0x0dee('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3a8a37,_0x0dee('0xe'));_0x16cccc(_0x5c022a['result'][_0x0dee('0x14')]);}})[_0x0dee('0x15')](function(_0x1f63fe){logger[_0x0dee('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3a8a37,_0x1f63fe);_0x2076c8(_0x1f63fe);});});} \ No newline at end of file +var _0xb8e5=['error','code','message','result','catch','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x904cb3,_0x37eecd){var _0xa8d609=function(_0xba03ba){while(--_0xba03ba){_0x904cb3['push'](_0x904cb3['shift']());}};_0xa8d609(++_0x37eecd);}(_0xb8e5,0x8d));var _0x5b8e=function(_0x207f62,_0x31e480){_0x207f62=_0x207f62-0x0;var _0x252a7c=_0xb8e5[_0x207f62];return _0x252a7c;};'use strict';var _=require('lodash');var util=require(_0x5b8e('0x0'));var moment=require(_0x5b8e('0x1'));var BPromise=require(_0x5b8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b8e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5b8e('0x4'));var config=require(_0x5b8e('0x5'));var jayson=require(_0x5b8e('0x6'));var client=jayson['client'][_0x5b8e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x138804,_0xa209ea,_0x54bd8d){return new BPromise(function(_0x3de9bc,_0x4a73e5){return client[_0x5b8e('0x8')](_0x138804,_0x54bd8d)[_0x5b8e('0x9')](function(_0x666e5b){logger['info'](_0x5b8e('0xa'),_0xa209ea,_0x5b8e('0xb'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xa209ea,'request\x20sent',JSON['stringify'](_0x666e5b));if(_0x666e5b[_0x5b8e('0xc')]){if(_0x666e5b[_0x5b8e('0xc')][_0x5b8e('0xd')]===0x1f4){logger['error'](_0x5b8e('0xa'),_0xa209ea,_0x666e5b[_0x5b8e('0xc')][_0x5b8e('0xe')]);return _0x4a73e5(_0x666e5b[_0x5b8e('0xc')][_0x5b8e('0xe')]);}logger['error'](_0x5b8e('0xa'),_0xa209ea,_0x666e5b[_0x5b8e('0xc')]['message']);return _0x3de9bc(_0x666e5b[_0x5b8e('0xc')][_0x5b8e('0xe')]);}else{logger['info'](_0x5b8e('0xa'),_0xa209ea,_0x5b8e('0xb'));_0x3de9bc(_0x666e5b[_0x5b8e('0xf')]['message']);}})[_0x5b8e('0x10')](function(_0x5793d9){logger[_0x5b8e('0xc')](_0x5b8e('0xa'),_0xa209ea,_0x5793d9);_0x4a73e5(_0x5793d9);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2089c41..ab8e5dc 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 _0x3a04=['show','post','create','put','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x3a04,0xc4));var _0x43a0=function(_0x819e48,_0x430040){_0x819e48=_0x819e48-0x0;var _0x522d4a=_0x3a04[_0x819e48];return _0x522d4a;};'use strict';var multer=require(_0x43a0('0x0'));var util=require(_0x43a0('0x1'));var path=require('path');var timeout=require(_0x43a0('0x2'));var express=require('express');var router=express[_0x43a0('0x3')]();var fs_extra=require(_0x43a0('0x4'));var auth=require(_0x43a0('0x5'));var interaction=require(_0x43a0('0x6'));var config=require(_0x43a0('0x7'));var controller=require(_0x43a0('0x8'));router['get']('/',auth[_0x43a0('0x9')](),controller[_0x43a0('0xa')]);router[_0x43a0('0xb')](_0x43a0('0xc'),auth[_0x43a0('0x9')](),controller[_0x43a0('0xd')]);router[_0x43a0('0xe')]('/',auth[_0x43a0('0x9')](),controller[_0x43a0('0xf')]);router[_0x43a0('0x10')](_0x43a0('0xc'),auth[_0x43a0('0x9')](),controller['update']);router[_0x43a0('0x11')](_0x43a0('0xc'),auth['isAuthenticated'](),controller[_0x43a0('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1fc3=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','create','put','destroy'];(function(_0xcc341a,_0x106ebd){var _0x2f8928=function(_0x579849){while(--_0x579849){_0xcc341a['push'](_0xcc341a['shift']());}};_0x2f8928(++_0x106ebd);}(_0x1fc3,0x1a9));var _0x31fc=function(_0x511742,_0x1add7f){_0x511742=_0x511742-0x0;var _0x1a260d=_0x1fc3[_0x511742];return _0x1a260d;};'use strict';var multer=require('multer');var util=require(_0x31fc('0x0'));var path=require(_0x31fc('0x1'));var timeout=require(_0x31fc('0x2'));var express=require('express');var router=express[_0x31fc('0x3')]();var fs_extra=require(_0x31fc('0x4'));var auth=require(_0x31fc('0x5'));var interaction=require(_0x31fc('0x6'));var config=require(_0x31fc('0x7'));var controller=require(_0x31fc('0x8'));router[_0x31fc('0x9')]('/',auth[_0x31fc('0xa')](),controller['index']);router['get'](_0x31fc('0xb'),auth['isAuthenticated'](),controller[_0x31fc('0xc')]);router[_0x31fc('0xd')]('/',auth[_0x31fc('0xa')](),controller[_0x31fc('0xe')]);router[_0x31fc('0xf')](_0x31fc('0xb'),auth[_0x31fc('0xa')](),controller['update']);router['delete'](_0x31fc('0xb'),auth[_0x31fc('0xa')](),controller[_0x31fc('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 2f4d945..2e0ebd5 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 _0x10b8=['exports','ENUM','string','variable','keyValue','STRING','BOOLEAN'];(function(_0xf48fd,_0x5f5c40){var _0x25bc88=function(_0x3ae66d){while(--_0x3ae66d){_0xf48fd['push'](_0xf48fd['shift']());}};_0x25bc88(++_0x5f5c40);}(_0x10b8,0x16c));var _0x810b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x10b8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0x810b('0x0')]={'type':{'type':Sequelize[_0x810b('0x1')](_0x810b('0x2'),_0x810b('0x3'),'customVariable',_0x810b('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x810b('0x5')]},'key':{'type':Sequelize[_0x810b('0x5')]},'keyType':{'type':Sequelize[_0x810b('0x1')](_0x810b('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x810b('0x5')]},'idField':{'type':Sequelize[_0x810b('0x5')]},'nameField':{'type':Sequelize[_0x810b('0x5')]},'customField':{'type':Sequelize[_0x810b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x810b('0x5')]}}; \ No newline at end of file +var _0x6fbd=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0x6fbd,0x1b8));var _0xd6fb=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x6fbd[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require('sequelize');module[_0xd6fb('0x0')]={'type':{'type':Sequelize[_0xd6fb('0x1')](_0xd6fb('0x2'),_0xd6fb('0x3'),_0xd6fb('0x4'),_0xd6fb('0x5'),_0xd6fb('0x6')),'defaultValue':_0xd6fb('0x2')},'content':{'type':Sequelize[_0xd6fb('0x7')]},'key':{'type':Sequelize[_0xd6fb('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xd6fb('0x3'),_0xd6fb('0x4'))},'keyContent':{'type':Sequelize[_0xd6fb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd6fb('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd6fb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 05a79be..94843c8 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 _0x397a=['include','rows','catch','show','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','apply','reject','update','then','destroy','error','stack','name','send','ZendeskField','rawAttributes','type','key','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll'];(function(_0x21a96a,_0x75e2d6){var _0x1d6986=function(_0x2a3f8d){while(--_0x2a3f8d){_0x21a96a['push'](_0x21a96a['shift']());}};_0x1d6986(++_0x75e2d6);}(_0x397a,0x9d));var _0xa397=function(_0x446185,_0x2fc688){_0x446185=_0x446185-0x0;var _0x2ec2cc=_0x397a[_0x446185];return _0x2ec2cc;};'use strict';var emlformat=require(_0xa397('0x0'));var rimraf=require(_0xa397('0x1'));var zipdir=require(_0xa397('0x2'));var jsonpatch=require(_0xa397('0x3'));var rp=require('request-promise');var moment=require(_0xa397('0x4'));var BPromise=require(_0xa397('0x5'));var Mustache=require(_0xa397('0x6'));var util=require(_0xa397('0x7'));var path=require(_0xa397('0x8'));var sox=require('sox');var csv=require(_0xa397('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa397('0xa'));var _=require(_0xa397('0xb'));var squel=require(_0xa397('0xc'));var crypto=require(_0xa397('0xd'));var jsforce=require(_0xa397('0xe'));var deskjs=require(_0xa397('0xf'));var toCsv=require(_0xa397('0x9'));var querystring=require(_0xa397('0x10'));var Papa=require(_0xa397('0x11'));var Redis=require(_0xa397('0x12'));var authService=require(_0xa397('0x13'));var qs=require(_0xa397('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa397('0x15'));var logger=require(_0xa397('0x16'))(_0xa397('0x17'));var utils=require(_0xa397('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa397('0x19'));var db=require(_0xa397('0x1a'))['db'];function respondWithStatusCode(_0xcb1bb9,_0x5caad6){_0x5caad6=_0x5caad6||0xcc;return function(_0x30202d){if(_0x30202d){return _0xcb1bb9[_0xa397('0x1b')](_0x5caad6);}return _0xcb1bb9['status'](_0x5caad6)[_0xa397('0x1c')]();};}function respondWithResult(_0x577435,_0x45d607){_0x45d607=_0x45d607||0xc8;return function(_0x491bf3){if(_0x491bf3){return _0x577435['status'](_0x45d607)[_0xa397('0x1d')](_0x491bf3);}};}function respondWithFilteredResult(_0x4e70a2,_0x222079){return function(_0x1f69b9){if(_0x1f69b9){var _0x325351=typeof _0x222079[_0xa397('0x1e')]==='undefined'&&typeof _0x222079[_0xa397('0x1f')]==='undefined';var _0x500dee=_0x1f69b9[_0xa397('0x20')];var _0x3edcb7=_0x325351?0x0:_0x222079[_0xa397('0x1e')];var _0xf01320=_0x325351?_0x1f69b9[_0xa397('0x20')]:_0x222079[_0xa397('0x1e')]+_0x222079[_0xa397('0x1f')];var _0x2e3cbf;if(_0xf01320>=_0x500dee){_0xf01320=_0x500dee;_0x2e3cbf=0xc8;}else{_0x2e3cbf=0xce;}_0x4e70a2[_0xa397('0x21')](_0x2e3cbf);return _0x4e70a2[_0xa397('0x22')]('Content-Range',_0x3edcb7+'-'+_0xf01320+'/'+_0x500dee)[_0xa397('0x1d')](_0x1f69b9);}return null;};}function patchUpdates(_0x252150){return function(_0xda064a){try{jsonpatch[_0xa397('0x23')](_0xda064a,_0x252150,!![]);}catch(_0x2ad4d8){return BPromise[_0xa397('0x24')](_0x2ad4d8);}return _0xda064a['save']();};}function saveUpdates(_0x2228c5,_0x8923d4){return function(_0xf8e228){if(_0xf8e228){return _0xf8e228[_0xa397('0x25')](_0x2228c5)[_0xa397('0x26')](function(_0x4fc56e){return _0x4fc56e;});}return null;};}function removeEntity(_0x5f2573,_0x35ee65){return function(_0x3da77c){if(_0x3da77c){return _0x3da77c[_0xa397('0x27')]()['then'](function(){_0x5f2573[_0xa397('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x407496,_0x2e1e6d){return function(_0x2af022){if(!_0x2af022){_0x407496[_0xa397('0x1b')](0x194);}return _0x2af022;};}function handleError(_0x3202bd,_0x4a48c6){_0x4a48c6=_0x4a48c6||0x1f4;return function(_0x50ddb2){logger[_0xa397('0x28')](_0x50ddb2[_0xa397('0x29')]);if(_0x50ddb2[_0xa397('0x2a')]){delete _0x50ddb2[_0xa397('0x2a')];}_0x3202bd[_0xa397('0x21')](_0x4a48c6)[_0xa397('0x2b')](_0x50ddb2);};}exports['index']=function(_0x5d8e27,_0x316127){var _0x4c5f9c={},_0x31a097={},_0xc4374c={'count':0x0,'rows':[]};var _0x18ccf4=_['map'](db[_0xa397('0x2c')][_0xa397('0x2d')],function(_0x5897a4){return{'name':_0x5897a4['fieldName'],'type':_0x5897a4[_0xa397('0x2e')][_0xa397('0x2f')]};});_0x31a097['model']=_[_0xa397('0x30')](_0x18ccf4,_0xa397('0x2a'));_0x31a097['query']=_[_0xa397('0x31')](_0x5d8e27[_0xa397('0x32')]);_0x31a097[_0xa397('0x33')]=_['intersection'](_0x31a097[_0xa397('0x34')],_0x31a097[_0xa397('0x32')]);_0x4c5f9c[_0xa397('0x35')]=_[_0xa397('0x36')](_0x31a097[_0xa397('0x34')],qs[_0xa397('0x37')](_0x5d8e27[_0xa397('0x32')]['fields']));_0x4c5f9c[_0xa397('0x35')]=_0x4c5f9c[_0xa397('0x35')][_0xa397('0x38')]?_0x4c5f9c[_0xa397('0x35')]:_0x31a097[_0xa397('0x34')];if(!_0x5d8e27[_0xa397('0x32')][_0xa397('0x39')](_0xa397('0x3a'))){_0x4c5f9c[_0xa397('0x1f')]=qs[_0xa397('0x1f')](_0x5d8e27[_0xa397('0x32')]['limit']);_0x4c5f9c[_0xa397('0x1e')]=qs['offset'](_0x5d8e27[_0xa397('0x32')][_0xa397('0x1e')]);}_0x4c5f9c['order']=qs['sort'](_0x5d8e27['query'][_0xa397('0x3b')]);_0x4c5f9c[_0xa397('0x3c')]=qs[_0xa397('0x33')](_[_0xa397('0x3d')](_0x5d8e27[_0xa397('0x32')],_0x31a097[_0xa397('0x33')]),_0x18ccf4);if(_0x5d8e27[_0xa397('0x32')][_0xa397('0x3e')]){_0x4c5f9c[_0xa397('0x3c')]=_['merge'](_0x4c5f9c[_0xa397('0x3c')],{'$or':_[_0xa397('0x30')](_0x18ccf4,function(_0x545469){if(_0x545469['type']!=='VIRTUAL'){var _0x25635d={};_0x25635d[_0x545469[_0xa397('0x2a')]]={'$like':'%'+_0x5d8e27[_0xa397('0x32')][_0xa397('0x3e')]+'%'};return _0x25635d;}})});}_0x4c5f9c=_[_0xa397('0x3f')]({},_0x4c5f9c,_0x5d8e27['options']);var _0x28c97d={'where':_0x4c5f9c['where']};return db[_0xa397('0x2c')]['count'](_0x28c97d)[_0xa397('0x26')](function(_0x16b81a){_0xc4374c[_0xa397('0x20')]=_0x16b81a;if(_0x5d8e27[_0xa397('0x32')][_0xa397('0x40')]){_0x4c5f9c[_0xa397('0x41')]=[{'all':!![]}];}return db[_0xa397('0x2c')]['findAll'](_0x4c5f9c);})['then'](function(_0x1aae05){_0xc4374c[_0xa397('0x42')]=_0x1aae05;return _0xc4374c;})[_0xa397('0x26')](respondWithFilteredResult(_0x316127,_0x4c5f9c))[_0xa397('0x43')](handleError(_0x316127,null));};exports[_0xa397('0x44')]=function(_0x2476b0,_0x199ab6){var _0x208cc3={'raw':!![],'where':{'id':_0x2476b0['params']['id']}},_0x379632={};_0x379632[_0xa397('0x34')]=_[_0xa397('0x31')](db[_0xa397('0x2c')][_0xa397('0x2d')]);_0x379632[_0xa397('0x32')]=_[_0xa397('0x31')](_0x2476b0[_0xa397('0x32')]);_0x379632['filters']=_[_0xa397('0x36')](_0x379632[_0xa397('0x34')],_0x379632[_0xa397('0x32')]);_0x208cc3[_0xa397('0x35')]=_[_0xa397('0x36')](_0x379632[_0xa397('0x34')],qs[_0xa397('0x37')](_0x2476b0[_0xa397('0x32')]['fields']));_0x208cc3[_0xa397('0x35')]=_0x208cc3[_0xa397('0x35')][_0xa397('0x38')]?_0x208cc3[_0xa397('0x35')]:_0x379632['model'];if(_0x2476b0['query'][_0xa397('0x40')]){_0x208cc3['include']=[{'all':!![]}];}_0x208cc3=_[_0xa397('0x3f')]({},_0x208cc3,_0x2476b0[_0xa397('0x45')]);return db[_0xa397('0x2c')]['find'](_0x208cc3)['then'](handleEntityNotFound(_0x199ab6,null))[_0xa397('0x26')](respondWithResult(_0x199ab6,null))['catch'](handleError(_0x199ab6,null));};exports['create']=function(_0x1982d9,_0x32df9f){return db[_0xa397('0x2c')][_0xa397('0x46')](_0x1982d9[_0xa397('0x47')],{})['then'](respondWithResult(_0x32df9f,0xc9))[_0xa397('0x43')](handleError(_0x32df9f,null));};exports['update']=function(_0x15ceef,_0x451c57){if(_0x15ceef[_0xa397('0x47')]['id']){delete _0x15ceef[_0xa397('0x47')]['id'];}return db[_0xa397('0x2c')][_0xa397('0x48')]({'where':{'id':_0x15ceef[_0xa397('0x49')]['id']}})['then'](handleEntityNotFound(_0x451c57,null))[_0xa397('0x26')](saveUpdates(_0x15ceef[_0xa397('0x47')],null))[_0xa397('0x26')](respondWithResult(_0x451c57,null))[_0xa397('0x43')](handleError(_0x451c57,null));};exports[_0xa397('0x27')]=function(_0x4bd3e6,_0x32b91c){return db[_0xa397('0x2c')]['find']({'where':{'id':_0x4bd3e6['params']['id']}})[_0xa397('0x26')](handleEntityNotFound(_0x32b91c,null))['then'](removeEntity(_0x32b91c,null))[_0xa397('0x43')](handleError(_0x32b91c,null));}; \ No newline at end of file +var _0x5ed3=['where','pick','map','ZendeskField','includeAll','include','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','stack','name','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5ed3,0x9e));var _0x35ed=function(_0x3b9dd2,_0x434ee1){_0x3b9dd2=_0x3b9dd2-0x0;var _0x34aa26=_0x5ed3[_0x3b9dd2];return _0x34aa26;};'use strict';var emlformat=require(_0x35ed('0x0'));var rimraf=require(_0x35ed('0x1'));var zipdir=require(_0x35ed('0x2'));var jsonpatch=require(_0x35ed('0x3'));var rp=require(_0x35ed('0x4'));var moment=require(_0x35ed('0x5'));var BPromise=require(_0x35ed('0x6'));var Mustache=require('mustache');var util=require(_0x35ed('0x7'));var path=require(_0x35ed('0x8'));var sox=require(_0x35ed('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35ed('0xa'));var _=require(_0x35ed('0xb'));var squel=require(_0x35ed('0xc'));var crypto=require(_0x35ed('0xd'));var jsforce=require(_0x35ed('0xe'));var deskjs=require(_0x35ed('0xf'));var toCsv=require(_0x35ed('0x10'));var querystring=require(_0x35ed('0x11'));var Papa=require(_0x35ed('0x12'));var Redis=require(_0x35ed('0x13'));var authService=require(_0x35ed('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x35ed('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35ed('0x16'))(_0x35ed('0x17'));var utils=require('../../config/utils');var config=require(_0x35ed('0x18'));var licenseUtil=require(_0x35ed('0x19'));var db=require(_0x35ed('0x1a'))['db'];function respondWithStatusCode(_0x1bf8b8,_0x4c038a){_0x4c038a=_0x4c038a||0xcc;return function(_0xf3be1c){if(_0xf3be1c){return _0x1bf8b8[_0x35ed('0x1b')](_0x4c038a);}return _0x1bf8b8['status'](_0x4c038a)[_0x35ed('0x1c')]();};}function respondWithResult(_0x1fbf4e,_0x2098cf){_0x2098cf=_0x2098cf||0xc8;return function(_0x579cec){if(_0x579cec){return _0x1fbf4e[_0x35ed('0x1d')](_0x2098cf)[_0x35ed('0x1e')](_0x579cec);}};}function respondWithFilteredResult(_0x2ba18c,_0x4f37e6){return function(_0x5f9537){if(_0x5f9537){var _0x174d9d=typeof _0x4f37e6['offset']===_0x35ed('0x1f')&&typeof _0x4f37e6[_0x35ed('0x20')]===_0x35ed('0x1f');var _0x502f7f=_0x5f9537[_0x35ed('0x21')];var _0x32859b=_0x174d9d?0x0:_0x4f37e6[_0x35ed('0x22')];var _0x2d8c07=_0x174d9d?_0x5f9537['count']:_0x4f37e6[_0x35ed('0x22')]+_0x4f37e6[_0x35ed('0x20')];var _0x294333;if(_0x2d8c07>=_0x502f7f){_0x2d8c07=_0x502f7f;_0x294333=0xc8;}else{_0x294333=0xce;}_0x2ba18c[_0x35ed('0x1d')](_0x294333);return _0x2ba18c[_0x35ed('0x23')](_0x35ed('0x24'),_0x32859b+'-'+_0x2d8c07+'/'+_0x502f7f)[_0x35ed('0x1e')](_0x5f9537);}return null;};}function patchUpdates(_0xbda1dd){return function(_0x4deb8f){try{jsonpatch[_0x35ed('0x25')](_0x4deb8f,_0xbda1dd,!![]);}catch(_0x455471){return BPromise[_0x35ed('0x26')](_0x455471);}return _0x4deb8f[_0x35ed('0x27')]();};}function saveUpdates(_0x3f632e,_0x1d2624){return function(_0xe54c64){if(_0xe54c64){return _0xe54c64['update'](_0x3f632e)[_0x35ed('0x28')](function(_0x1fa9f1){return _0x1fa9f1;});}return null;};}function removeEntity(_0x4a94c6,_0x61c667){return function(_0x14f18d){if(_0x14f18d){return _0x14f18d['destroy']()[_0x35ed('0x28')](function(){_0x4a94c6[_0x35ed('0x1d')](0xcc)[_0x35ed('0x1c')]();});}};}function handleEntityNotFound(_0x2852b8,_0x38b4ce){return function(_0x500f7e){if(!_0x500f7e){_0x2852b8[_0x35ed('0x1b')](0x194);}return _0x500f7e;};}function handleError(_0x5b3aa6,_0x5e783e){_0x5e783e=_0x5e783e||0x1f4;return function(_0x287ce7){logger['error'](_0x287ce7[_0x35ed('0x29')]);if(_0x287ce7['name']){delete _0x287ce7[_0x35ed('0x2a')];}_0x5b3aa6[_0x35ed('0x1d')](_0x5e783e)['send'](_0x287ce7);};}exports[_0x35ed('0x2b')]=function(_0x24abef,_0x3ce371){var _0x42fd0c={},_0x18a042={},_0x2d6c9f={'count':0x0,'rows':[]};var _0x22a615=_['map'](db['ZendeskField'][_0x35ed('0x2c')],function(_0x1092f8){return{'name':_0x1092f8[_0x35ed('0x2d')],'type':_0x1092f8[_0x35ed('0x2e')]['key']};});_0x18a042['model']=_['map'](_0x22a615,_0x35ed('0x2a'));_0x18a042[_0x35ed('0x2f')]=_[_0x35ed('0x30')](_0x24abef['query']);_0x18a042[_0x35ed('0x31')]=_[_0x35ed('0x32')](_0x18a042[_0x35ed('0x33')],_0x18a042[_0x35ed('0x2f')]);_0x42fd0c[_0x35ed('0x34')]=_[_0x35ed('0x32')](_0x18a042['model'],qs[_0x35ed('0x35')](_0x24abef[_0x35ed('0x2f')]['fields']));_0x42fd0c[_0x35ed('0x34')]=_0x42fd0c[_0x35ed('0x34')][_0x35ed('0x36')]?_0x42fd0c['attributes']:_0x18a042[_0x35ed('0x33')];if(!_0x24abef['query'][_0x35ed('0x37')](_0x35ed('0x38'))){_0x42fd0c['limit']=qs[_0x35ed('0x20')](_0x24abef['query'][_0x35ed('0x20')]);_0x42fd0c[_0x35ed('0x22')]=qs[_0x35ed('0x22')](_0x24abef[_0x35ed('0x2f')][_0x35ed('0x22')]);}_0x42fd0c[_0x35ed('0x39')]=qs['sort'](_0x24abef[_0x35ed('0x2f')]['sort']);_0x42fd0c[_0x35ed('0x3a')]=qs[_0x35ed('0x31')](_[_0x35ed('0x3b')](_0x24abef[_0x35ed('0x2f')],_0x18a042[_0x35ed('0x31')]),_0x22a615);if(_0x24abef[_0x35ed('0x2f')]['filter']){_0x42fd0c[_0x35ed('0x3a')]=_['merge'](_0x42fd0c[_0x35ed('0x3a')],{'$or':_[_0x35ed('0x3c')](_0x22a615,function(_0x597b47){if(_0x597b47[_0x35ed('0x2e')]!=='VIRTUAL'){var _0x470f16={};_0x470f16[_0x597b47[_0x35ed('0x2a')]]={'$like':'%'+_0x24abef['query']['filter']+'%'};return _0x470f16;}})});}_0x42fd0c=_['merge']({},_0x42fd0c,_0x24abef['options']);var _0xa41a7f={'where':_0x42fd0c[_0x35ed('0x3a')]};return db[_0x35ed('0x3d')][_0x35ed('0x21')](_0xa41a7f)['then'](function(_0x3d931d){_0x2d6c9f[_0x35ed('0x21')]=_0x3d931d;if(_0x24abef[_0x35ed('0x2f')][_0x35ed('0x3e')]){_0x42fd0c[_0x35ed('0x3f')]=[{'all':!![]}];}return db[_0x35ed('0x3d')]['findAll'](_0x42fd0c);})['then'](function(_0x2a733d){_0x2d6c9f['rows']=_0x2a733d;return _0x2d6c9f;})[_0x35ed('0x28')](respondWithFilteredResult(_0x3ce371,_0x42fd0c))[_0x35ed('0x40')](handleError(_0x3ce371,null));};exports[_0x35ed('0x41')]=function(_0x3df68b,_0x91f22a){var _0x3e24c5={'raw':!![],'where':{'id':_0x3df68b[_0x35ed('0x42')]['id']}},_0x3f2b69={};_0x3f2b69[_0x35ed('0x33')]=_['keys'](db[_0x35ed('0x3d')][_0x35ed('0x2c')]);_0x3f2b69[_0x35ed('0x2f')]=_[_0x35ed('0x30')](_0x3df68b['query']);_0x3f2b69[_0x35ed('0x31')]=_['intersection'](_0x3f2b69[_0x35ed('0x33')],_0x3f2b69[_0x35ed('0x2f')]);_0x3e24c5[_0x35ed('0x34')]=_[_0x35ed('0x32')](_0x3f2b69[_0x35ed('0x33')],qs[_0x35ed('0x35')](_0x3df68b[_0x35ed('0x2f')]['fields']));_0x3e24c5[_0x35ed('0x34')]=_0x3e24c5[_0x35ed('0x34')]['length']?_0x3e24c5[_0x35ed('0x34')]:_0x3f2b69[_0x35ed('0x33')];if(_0x3df68b[_0x35ed('0x2f')]['includeAll']){_0x3e24c5[_0x35ed('0x3f')]=[{'all':!![]}];}_0x3e24c5=_['merge']({},_0x3e24c5,_0x3df68b[_0x35ed('0x43')]);return db[_0x35ed('0x3d')][_0x35ed('0x44')](_0x3e24c5)[_0x35ed('0x28')](handleEntityNotFound(_0x91f22a,null))['then'](respondWithResult(_0x91f22a,null))[_0x35ed('0x40')](handleError(_0x91f22a,null));};exports['create']=function(_0xd3af76,_0x5f084c){return db[_0x35ed('0x3d')][_0x35ed('0x45')](_0xd3af76[_0x35ed('0x46')],{})[_0x35ed('0x28')](respondWithResult(_0x5f084c,0xc9))['catch'](handleError(_0x5f084c,null));};exports['update']=function(_0x46cc5d,_0x462617){if(_0x46cc5d['body']['id']){delete _0x46cc5d[_0x35ed('0x46')]['id'];}return db['ZendeskField'][_0x35ed('0x44')]({'where':{'id':_0x46cc5d[_0x35ed('0x42')]['id']}})[_0x35ed('0x28')](handleEntityNotFound(_0x462617,null))[_0x35ed('0x28')](saveUpdates(_0x46cc5d['body'],null))[_0x35ed('0x28')](respondWithResult(_0x462617,null))[_0x35ed('0x40')](handleError(_0x462617,null));};exports[_0x35ed('0x47')]=function(_0x4e990e,_0x37f852){return db[_0x35ed('0x3d')][_0x35ed('0x44')]({'where':{'id':_0x4e990e[_0x35ed('0x42')]['id']}})[_0x35ed('0x28')](handleEntityNotFound(_0x37f852,null))[_0x35ed('0x28')](removeEntity(_0x37f852,null))[_0x35ed('0x40')](handleError(_0x37f852,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index b98eefa..ee635d8 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 _0x5c6e=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','FieldId'];(function(_0x1c4597,_0x1eb997){var _0x2c0aa9=function(_0x3174d5){while(--_0x3174d5){_0x1c4597['push'](_0x1c4597['shift']());}};_0x2c0aa9(++_0x1eb997);}(_0x5c6e,0x16c));var _0xe5c6=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x5c6e[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require(_0xe5c6('0x0'));var util=require('util');var logger=require(_0xe5c6('0x1'))(_0xe5c6('0x2'));var moment=require(_0xe5c6('0x3'));var BPromise=require('bluebird');var rp=require(_0xe5c6('0x4'));var fs=require('fs');var path=require(_0xe5c6('0x5'));var rimraf=require(_0xe5c6('0x6'));var config=require('../../config/environment');var attributes=require(_0xe5c6('0x7'));module[_0xe5c6('0x8')]=function(_0x26536e,_0x2a75b1){return _0x26536e[_0xe5c6('0x9')](_0xe5c6('0xa'),attributes,{'tableName':_0xe5c6('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xe5c6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x00ef=['util','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x19af68,_0x5df52c){var _0x31fbdd=function(_0x309805){while(--_0x309805){_0x19af68['push'](_0x19af68['shift']());}};_0x31fbdd(++_0x5df52c);}(_0x00ef,0xdd));var _0xf00e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x00ef[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xf00e('0x0'));var logger=require('../../config/logger')(_0xf00e('0x1'));var moment=require(_0xf00e('0x2'));var BPromise=require(_0xf00e('0x3'));var rp=require(_0xf00e('0x4'));var fs=require('fs');var path=require(_0xf00e('0x5'));var rimraf=require('rimraf');var config=require(_0xf00e('0x6'));var attributes=require(_0xf00e('0x7'));module[_0xf00e('0x8')]=function(_0x14594c,_0x27fd3b){return _0x14594c['define'](_0xf00e('0x9'),attributes,{'tableName':_0xf00e('0xa'),'paranoid':![],'indexes':[{'name':_0xf00e('0xb'),'fields':[_0xf00e('0xc'),'FieldId'],'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 8005d51..4bfe8c3 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 _0x212b=['ZendeskField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x212b,0x1a7));var _0xb212=function(_0x1e82bb,_0x58fb15){_0x1e82bb=_0x1e82bb-0x0;var _0x9cffa3=_0x212b[_0x1e82bb];return _0x9cffa3;};'use strict';var _=require(_0xb212('0x0'));var util=require('util');var moment=require(_0xb212('0x1'));var BPromise=require(_0xb212('0x2'));var rs=require(_0xb212('0x3'));var fs=require('fs');var Redis=require(_0xb212('0x4'));var db=require(_0xb212('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb212('0x6'))(_0xb212('0x7'));var config=require('../../config/environment');var jayson=require(_0xb212('0x8'));var client=jayson[_0xb212('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x91d3ed,_0x2bdb52,_0x543f56){return new BPromise(function(_0x539722,_0x3324fc){return client['request'](_0x91d3ed,_0x543f56)[_0xb212('0xa')](function(_0x790bae){logger[_0xb212('0xb')]('ZendeskField,\x20%s,\x20%s',_0x2bdb52,_0xb212('0xc'));logger[_0xb212('0xd')](_0xb212('0xe'),_0x2bdb52,_0xb212('0xc'),JSON['stringify'](_0x790bae));if(_0x790bae[_0xb212('0xf')]){if(_0x790bae[_0xb212('0xf')][_0xb212('0x10')]===0x1f4){logger[_0xb212('0xf')](_0xb212('0x11'),_0x2bdb52,_0x790bae[_0xb212('0xf')]['message']);return _0x3324fc(_0x790bae[_0xb212('0xf')][_0xb212('0x12')]);}logger[_0xb212('0xf')](_0xb212('0x11'),_0x2bdb52,_0x790bae[_0xb212('0xf')]['message']);return _0x539722(_0x790bae['error'][_0xb212('0x12')]);}else{logger['info'](_0xb212('0x11'),_0x2bdb52,'request\x20sent');_0x539722(_0x790bae['result']['message']);}})[_0xb212('0x13')](function(_0x59a767){logger[_0xb212('0xf')]('ZendeskField,\x20%s,\x20%s',_0x2bdb52,_0x59a767);_0x3324fc(_0x59a767);});});} \ No newline at end of file +var _0x0cbd=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x2464e3,_0x3e33b3){var _0x20940d=function(_0x4c5c6c){while(--_0x4c5c6c){_0x2464e3['push'](_0x2464e3['shift']());}};_0x20940d(++_0x3e33b3);}(_0x0cbd,0x1b7));var _0xd0cb=function(_0x4fd1e4,_0xbe0758){_0x4fd1e4=_0x4fd1e4-0x0;var _0x34a738=_0x0cbd[_0x4fd1e4];return _0x34a738;};'use strict';var _=require(_0xd0cb('0x0'));var util=require(_0xd0cb('0x1'));var moment=require(_0xd0cb('0x2'));var BPromise=require(_0xd0cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0cb('0x4'))['db'];var utils=require(_0xd0cb('0x5'));var logger=require(_0xd0cb('0x6'))(_0xd0cb('0x7'));var config=require(_0xd0cb('0x8'));var jayson=require(_0xd0cb('0x9'));var client=jayson[_0xd0cb('0xa')][_0xd0cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a4b11,_0x2b02b0,_0x169259){return new BPromise(function(_0x47240e,_0x4333ad){return client[_0xd0cb('0xc')](_0x2a4b11,_0x169259)[_0xd0cb('0xd')](function(_0x2b1e38){logger[_0xd0cb('0xe')](_0xd0cb('0xf'),_0x2b02b0,_0xd0cb('0x10'));logger[_0xd0cb('0x11')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x2b02b0,_0xd0cb('0x10'),JSON['stringify'](_0x2b1e38));if(_0x2b1e38[_0xd0cb('0x12')]){if(_0x2b1e38[_0xd0cb('0x12')][_0xd0cb('0x13')]===0x1f4){logger['error'](_0xd0cb('0xf'),_0x2b02b0,_0x2b1e38[_0xd0cb('0x12')][_0xd0cb('0x14')]);return _0x4333ad(_0x2b1e38[_0xd0cb('0x12')][_0xd0cb('0x14')]);}logger[_0xd0cb('0x12')](_0xd0cb('0xf'),_0x2b02b0,_0x2b1e38['error'][_0xd0cb('0x14')]);return _0x47240e(_0x2b1e38[_0xd0cb('0x12')]['message']);}else{logger[_0xd0cb('0xe')](_0xd0cb('0xf'),_0x2b02b0,_0xd0cb('0x10'));_0x47240e(_0x2b1e38[_0xd0cb('0x15')][_0xd0cb('0x14')]);}})[_0xd0cb('0x16')](function(_0x1d3328){logger[_0xd0cb('0x12')](_0xd0cb('0xf'),_0x2b02b0,_0x1d3328);_0x4333ad(_0x1d3328);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 759a607..c24dbb8 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 _0xaa8f=['isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaa8f,0xc0));var _0xfaa8=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0xaa8f[_0x1bf809];return _0x1caa4e;};'use strict';var multer=require('multer');var util=require(_0xfaa8('0x0'));var path=require(_0xfaa8('0x1'));var timeout=require('connect-timeout');var express=require(_0xfaa8('0x2'));var router=express['Router']();var fs_extra=require(_0xfaa8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfaa8('0x4'));var config=require(_0xfaa8('0x5'));var controller=require(_0xfaa8('0x6'));router[_0xfaa8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfaa8('0x7')]('/:id',auth[_0xfaa8('0x8')](),controller[_0xfaa8('0x9')]);router['get']('/:id/configurations',auth[_0xfaa8('0x8')](),controller['getConfigurations']);router[_0xfaa8('0x7')](_0xfaa8('0xa'),auth[_0xfaa8('0x8')](),controller[_0xfaa8('0xb')]);router[_0xfaa8('0xc')]('/',auth[_0xfaa8('0x8')](),controller[_0xfaa8('0xd')]);router[_0xfaa8('0xc')](_0xfaa8('0xe'),auth[_0xfaa8('0x8')](),controller['addConfiguration']);router['put'](_0xfaa8('0xf'),auth[_0xfaa8('0x8')](),controller[_0xfaa8('0x10')]);router[_0xfaa8('0x11')]('/:id',auth[_0xfaa8('0x8')](),controller[_0xfaa8('0x12')]);module[_0xfaa8('0x13')]=router; \ No newline at end of file +var _0xebce=['./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5cee0a,_0x47c92f){var _0x14d010=function(_0x30a424){while(--_0x30a424){_0x5cee0a['push'](_0x5cee0a['shift']());}};_0x14d010(++_0x47c92f);}(_0xebce,0xf5));var _0xeebc=function(_0x49d40d,_0x30e0ea){_0x49d40d=_0x49d40d-0x0;var _0x5ec463=_0xebce[_0x49d40d];return _0x5ec463;};'use strict';var multer=require(_0xeebc('0x0'));var util=require(_0xeebc('0x1'));var path=require(_0xeebc('0x2'));var timeout=require(_0xeebc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeebc('0x4'));var auth=require(_0xeebc('0x5'));var interaction=require(_0xeebc('0x6'));var config=require(_0xeebc('0x7'));var controller=require(_0xeebc('0x8'));router[_0xeebc('0x9')]('/',auth[_0xeebc('0xa')](),controller['index']);router[_0xeebc('0x9')](_0xeebc('0xb'),auth[_0xeebc('0xa')](),controller[_0xeebc('0xc')]);router[_0xeebc('0x9')](_0xeebc('0xd'),auth[_0xeebc('0xa')](),controller['getConfigurations']);router[_0xeebc('0x9')](_0xeebc('0xe'),auth[_0xeebc('0xa')](),controller[_0xeebc('0xf')]);router[_0xeebc('0x10')]('/',auth[_0xeebc('0xa')](),controller[_0xeebc('0x11')]);router[_0xeebc('0x10')](_0xeebc('0xd'),auth[_0xeebc('0xa')](),controller['addConfiguration']);router[_0xeebc('0x12')](_0xeebc('0xb'),auth[_0xeebc('0xa')](),controller[_0xeebc('0x13')]);router[_0xeebc('0x14')](_0xeebc('0xb'),auth[_0xeebc('0xa')](),controller[_0xeebc('0x15')]);module[_0xeebc('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 ce6f6c0..0e82954 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 _0x70e0=['STRING','sequelize','exports'];(function(_0x4a9508,_0x304254){var _0x5ce784=function(_0x27c97d){while(--_0x27c97d){_0x4a9508['push'](_0x4a9508['shift']());}};_0x5ce784(++_0x304254);}(_0x70e0,0x17b));var _0x070e=function(_0x4ff9c4,_0x561073){_0x4ff9c4=_0x4ff9c4-0x0;var _0x16c8a9=_0x70e0[_0x4ff9c4];return _0x16c8a9;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}}; \ No newline at end of file +var _0xda55=['STRING','sequelize','exports'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xda55,0x6d));var _0x5da5=function(_0x2bfa06,_0x351e03){_0x2bfa06=_0x2bfa06-0x0;var _0x58811b=_0xda55[_0x2bfa06];return _0x58811b;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5da5('0x2')]},'zone':{'type':Sequelize[_0x5da5('0x2')]},'clientId':{'type':Sequelize[_0x5da5('0x2')]},'clientSecret':{'type':Sequelize[_0x5da5('0x2')]},'serverUrl':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x5da5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index e1e4f67..ed8662a 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 _0x9fce=['map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','getConfigurations','findOne','ZohoConfiguration','options','addConfiguration','AccountId','Subjects','getSubjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','api_name','system_mandatory','display_label','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index'];(function(_0x121f25,_0x1dfada){var _0x4c772c=function(_0x482656){while(--_0x482656){_0x121f25['push'](_0x121f25['shift']());}};_0x4c772c(++_0x1dfada);}(_0x9fce,0xd3));var _0xe9fc=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x9fce[_0x3cb6dc];return _0x47ec89;};'use strict';var emlformat=require(_0xe9fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9fc('0x2'));var moment=require(_0xe9fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe9fc('0x4'));var util=require(_0xe9fc('0x5'));var path=require(_0xe9fc('0x6'));var sox=require(_0xe9fc('0x7'));var csv=require(_0xe9fc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9fc('0x9'));var _=require(_0xe9fc('0xa'));var squel=require(_0xe9fc('0xb'));var crypto=require(_0xe9fc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe9fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe9fc('0xe'));var authService=require(_0xe9fc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe9fc('0x10'));var hardwareService=require(_0xe9fc('0x11'));var logger=require(_0xe9fc('0x12'))(_0xe9fc('0x13'));var utils=require(_0xe9fc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe9fc('0x15'));var db=require(_0xe9fc('0x16'))['db'];var integrations=require(_0xe9fc('0x17'));function respondWithStatusCode(_0x48af01,_0x2a63c7){_0x2a63c7=_0x2a63c7||0xcc;return function(_0x586b9c){if(_0x586b9c){return _0x48af01[_0xe9fc('0x18')](_0x2a63c7);}return _0x48af01[_0xe9fc('0x19')](_0x2a63c7)[_0xe9fc('0x1a')]();};}function respondWithResult(_0x42e829,_0x1eb0da){_0x1eb0da=_0x1eb0da||0xc8;return function(_0x37f19f){if(_0x37f19f){return _0x42e829['status'](_0x1eb0da)[_0xe9fc('0x1b')](_0x37f19f);}};}function respondWithFilteredResult(_0x561509,_0x300d3e){return function(_0x17885b){if(_0x17885b){var _0x274cce=typeof _0x300d3e['offset']==='undefined'&&typeof _0x300d3e['limit']===_0xe9fc('0x1c');var _0x167ae7=_0x17885b[_0xe9fc('0x1d')];var _0x2a8959=_0x274cce?0x0:_0x300d3e[_0xe9fc('0x1e')];var _0x562f4e=_0x274cce?_0x17885b['count']:_0x300d3e[_0xe9fc('0x1e')]+_0x300d3e[_0xe9fc('0x1f')];var _0x3a87a1;if(_0x562f4e>=_0x167ae7){_0x562f4e=_0x167ae7;_0x3a87a1=0xc8;}else{_0x3a87a1=0xce;}_0x561509['status'](_0x3a87a1);return _0x561509['set'](_0xe9fc('0x20'),_0x2a8959+'-'+_0x562f4e+'/'+_0x167ae7)[_0xe9fc('0x1b')](_0x17885b);}return null;};}function patchUpdates(_0x93ed53){return function(_0x1e5da2){try{jsonpatch[_0xe9fc('0x21')](_0x1e5da2,_0x93ed53,!![]);}catch(_0x788581){return BPromise[_0xe9fc('0x22')](_0x788581);}return _0x1e5da2['save']();};}function saveUpdates(_0x5e73fd,_0x3477d5){return function(_0x3dab1b){if(_0x3dab1b){return _0x3dab1b[_0xe9fc('0x23')](_0x5e73fd)[_0xe9fc('0x24')](function(_0x3f4716){return _0x3f4716;});}return null;};}function removeEntity(_0x533287,_0x158c62){return function(_0x14e23e){if(_0x14e23e){return _0x14e23e[_0xe9fc('0x25')]()[_0xe9fc('0x24')](function(){_0x533287['status'](0xcc)[_0xe9fc('0x1a')]();});}};}function handleEntityNotFound(_0x3133db,_0x53ddd2){return function(_0x52f12c){if(!_0x52f12c){_0x3133db[_0xe9fc('0x18')](0x194);}return _0x52f12c;};}function handleError(_0x5d91ed,_0x55db34){_0x55db34=_0x55db34||0x1f4;return function(_0x3ddd0b){logger[_0xe9fc('0x26')](_0x3ddd0b[_0xe9fc('0x27')]);if(_0x3ddd0b[_0xe9fc('0x28')]){delete _0x3ddd0b[_0xe9fc('0x28')];}_0x5d91ed[_0xe9fc('0x19')](_0x55db34)[_0xe9fc('0x29')](_0x3ddd0b);};}exports[_0xe9fc('0x2a')]=function(_0x21cbf3,_0x140ebc){var _0x34877d={},_0x271574={},_0x195b30={'count':0x0,'rows':[]};var _0x4d4483=_[_0xe9fc('0x2b')](db[_0xe9fc('0x2c')][_0xe9fc('0x2d')],function(_0x557d2b){return{'name':_0x557d2b[_0xe9fc('0x2e')],'type':_0x557d2b[_0xe9fc('0x2f')][_0xe9fc('0x30')]};});_0x271574[_0xe9fc('0x31')]=_[_0xe9fc('0x2b')](_0x4d4483,_0xe9fc('0x28'));_0x271574[_0xe9fc('0x32')]=_[_0xe9fc('0x33')](_0x21cbf3['query']);_0x271574[_0xe9fc('0x34')]=_[_0xe9fc('0x35')](_0x271574[_0xe9fc('0x31')],_0x271574['query']);_0x34877d[_0xe9fc('0x36')]=_[_0xe9fc('0x35')](_0x271574[_0xe9fc('0x31')],qs[_0xe9fc('0x37')](_0x21cbf3[_0xe9fc('0x32')][_0xe9fc('0x37')]));_0x34877d['attributes']=_0x34877d[_0xe9fc('0x36')]['length']?_0x34877d[_0xe9fc('0x36')]:_0x271574[_0xe9fc('0x31')];if(!_0x21cbf3[_0xe9fc('0x32')][_0xe9fc('0x38')](_0xe9fc('0x39'))){_0x34877d[_0xe9fc('0x1f')]=qs[_0xe9fc('0x1f')](_0x21cbf3[_0xe9fc('0x32')][_0xe9fc('0x1f')]);_0x34877d[_0xe9fc('0x1e')]=qs[_0xe9fc('0x1e')](_0x21cbf3['query']['offset']);}_0x34877d[_0xe9fc('0x3a')]=qs[_0xe9fc('0x3b')](_0x21cbf3[_0xe9fc('0x32')]['sort']);_0x34877d[_0xe9fc('0x3c')]=qs[_0xe9fc('0x34')](_[_0xe9fc('0x3d')](_0x21cbf3['query'],_0x271574[_0xe9fc('0x34')]),_0x4d4483);if(_0x21cbf3[_0xe9fc('0x32')][_0xe9fc('0x3e')]){_0x34877d[_0xe9fc('0x3c')]=_[_0xe9fc('0x3f')](_0x34877d['where'],{'$or':_['map'](_0x4d4483,function(_0x4c1881){if(_0x4c1881[_0xe9fc('0x2f')]!==_0xe9fc('0x40')){var _0x3f79a7={};_0x3f79a7[_0x4c1881[_0xe9fc('0x28')]]={'$like':'%'+_0x21cbf3['query']['filter']+'%'};return _0x3f79a7;}})});}_0x34877d=_['merge']({},_0x34877d,_0x21cbf3['options']);var _0x1af097={'where':_0x34877d[_0xe9fc('0x3c')]};return db[_0xe9fc('0x2c')]['count'](_0x1af097)[_0xe9fc('0x24')](function(_0x1686f6){_0x195b30[_0xe9fc('0x1d')]=_0x1686f6;if(_0x21cbf3[_0xe9fc('0x32')][_0xe9fc('0x41')]){_0x34877d[_0xe9fc('0x42')]=[{'all':!![]}];}return db[_0xe9fc('0x2c')][_0xe9fc('0x43')](_0x34877d);})[_0xe9fc('0x24')](function(_0x5bdfdf){_0x195b30[_0xe9fc('0x44')]=_0x5bdfdf;return _0x195b30;})[_0xe9fc('0x24')](respondWithFilteredResult(_0x140ebc,_0x34877d))[_0xe9fc('0x45')](handleError(_0x140ebc,null));};exports[_0xe9fc('0x46')]=function(_0x3a8299,_0x555ebb){var _0x4e136b={'raw':![],'where':{'id':_0x3a8299[_0xe9fc('0x47')]['id']}},_0x55c19c={};_0x55c19c['model']=_['keys'](db[_0xe9fc('0x2c')][_0xe9fc('0x2d')]);_0x55c19c[_0xe9fc('0x32')]=_[_0xe9fc('0x33')](_0x3a8299[_0xe9fc('0x32')]);_0x55c19c[_0xe9fc('0x34')]=_[_0xe9fc('0x35')](_0x55c19c[_0xe9fc('0x31')],_0x55c19c[_0xe9fc('0x32')]);_0x4e136b['attributes']=_[_0xe9fc('0x35')](_0x55c19c[_0xe9fc('0x31')],qs[_0xe9fc('0x37')](_0x3a8299['query']['fields']));_0x4e136b[_0xe9fc('0x36')]=_0x4e136b[_0xe9fc('0x36')][_0xe9fc('0x48')]?_0x4e136b[_0xe9fc('0x36')]:_0x55c19c[_0xe9fc('0x31')];if(_0x3a8299[_0xe9fc('0x32')][_0xe9fc('0x41')]){_0x4e136b['include']=[{'all':!![]}];}_0x4e136b=_[_0xe9fc('0x3f')]({},_0x4e136b,_0x3a8299['options']);return db[_0xe9fc('0x2c')]['find'](_0x4e136b)[_0xe9fc('0x24')](handleEntityNotFound(_0x555ebb,null))[_0xe9fc('0x24')](respondWithResult(_0x555ebb,null))['catch'](handleError(_0x555ebb,null));};exports[_0xe9fc('0x49')]=function(_0x27414c,_0x59ddb1){return db['ZohoAccount'][_0xe9fc('0x49')](_0x27414c[_0xe9fc('0x4a')],{})[_0xe9fc('0x24')](respondWithResult(_0x59ddb1,0xc9))[_0xe9fc('0x45')](handleError(_0x59ddb1,null));};exports[_0xe9fc('0x23')]=function(_0x3c6595,_0x5696a9){if(_0x3c6595[_0xe9fc('0x4a')]['id']){delete _0x3c6595[_0xe9fc('0x4a')]['id'];}return db[_0xe9fc('0x2c')][_0xe9fc('0x4b')]({'where':{'id':_0x3c6595[_0xe9fc('0x47')]['id']}})[_0xe9fc('0x24')](handleEntityNotFound(_0x5696a9,null))['then'](saveUpdates(_0x3c6595[_0xe9fc('0x4a')],null))['then'](respondWithResult(_0x5696a9,null))[_0xe9fc('0x45')](handleError(_0x5696a9,null));};exports[_0xe9fc('0x25')]=function(_0x3898f9,_0x2676d2){return db[_0xe9fc('0x2c')]['find']({'where':{'id':_0x3898f9[_0xe9fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x2676d2,null))[_0xe9fc('0x24')](removeEntity(_0x2676d2,null))[_0xe9fc('0x45')](handleError(_0x2676d2,null));};exports[_0xe9fc('0x4c')]=function(_0x396626,_0x1d60d5,_0x71844d){var _0x2486aa={};var _0x22f50c={};var _0x12d04d;var _0x1fd9cc;return db[_0xe9fc('0x2c')][_0xe9fc('0x4d')]({'where':{'id':_0x396626['params']['id']}})[_0xe9fc('0x24')](handleEntityNotFound(_0x1d60d5,null))[_0xe9fc('0x24')](function(_0x2472b0){if(_0x2472b0){_0x12d04d=_0x2472b0;_0x22f50c['model']=_[_0xe9fc('0x33')](db[_0xe9fc('0x4e')][_0xe9fc('0x2d')]);_0x22f50c['query']=_[_0xe9fc('0x33')](_0x396626[_0xe9fc('0x32')]);_0x22f50c['filters']=_[_0xe9fc('0x35')](_0x22f50c[_0xe9fc('0x31')],_0x22f50c['query']);_0x2486aa[_0xe9fc('0x36')]=_[_0xe9fc('0x35')](_0x22f50c[_0xe9fc('0x31')],qs[_0xe9fc('0x37')](_0x396626[_0xe9fc('0x32')][_0xe9fc('0x37')]));_0x2486aa[_0xe9fc('0x36')]=_0x2486aa[_0xe9fc('0x36')][_0xe9fc('0x48')]?_0x2486aa[_0xe9fc('0x36')]:_0x22f50c[_0xe9fc('0x31')];_0x2486aa[_0xe9fc('0x3a')]=qs[_0xe9fc('0x3b')](_0x396626[_0xe9fc('0x32')][_0xe9fc('0x3b')]);_0x2486aa[_0xe9fc('0x3c')]=qs[_0xe9fc('0x34')](_['pick'](_0x396626[_0xe9fc('0x32')],_0x22f50c[_0xe9fc('0x34')]));if(_0x396626['query'][_0xe9fc('0x3e')]){_0x2486aa[_0xe9fc('0x3c')]=_[_0xe9fc('0x3f')](_0x2486aa['where'],{'$or':_[_0xe9fc('0x2b')](_0x2486aa['attributes'],function(_0x433cd4){var _0xc0b8b={};_0xc0b8b[_0x433cd4]={'$like':'%'+_0x396626[_0xe9fc('0x32')][_0xe9fc('0x3e')]+'%'};return _0xc0b8b;})});}_0x2486aa=_[_0xe9fc('0x3f')]({},_0x2486aa,_0x396626[_0xe9fc('0x4f')]);return _0x12d04d[_0xe9fc('0x4c')](_0x2486aa);}})[_0xe9fc('0x24')](function(_0x51348d){if(_0x51348d){_0x1fd9cc=_0x51348d['length'];if(!_0x396626[_0xe9fc('0x32')][_0xe9fc('0x38')]('nolimit')){_0x2486aa[_0xe9fc('0x1f')]=qs[_0xe9fc('0x1f')](_0x396626[_0xe9fc('0x32')][_0xe9fc('0x1f')]);_0x2486aa[_0xe9fc('0x1e')]=qs[_0xe9fc('0x1e')](_0x396626[_0xe9fc('0x32')][_0xe9fc('0x1e')]);}return _0x12d04d['getConfigurations'](_0x2486aa);}})[_0xe9fc('0x24')](function(_0x51cc83){if(_0x51cc83){return _0x51cc83?{'count':_0x1fd9cc,'rows':_0x51cc83}:null;}})[_0xe9fc('0x24')](respondWithResult(_0x1d60d5,null))[_0xe9fc('0x45')](handleError(_0x1d60d5,null));};exports[_0xe9fc('0x50')]=function(_0x13edf9,_0x509756,_0x58a3b7){if(_0x13edf9[_0xe9fc('0x4a')]['id']){delete _0x13edf9['body']['id'];}return db[_0xe9fc('0x2c')][_0xe9fc('0x4d')]({'where':{'id':_0x13edf9[_0xe9fc('0x47')]['id']}})[_0xe9fc('0x24')](handleEntityNotFound(_0x509756,null))[_0xe9fc('0x24')](function(_0x9bd7f6){if(_0x9bd7f6){_0x13edf9[_0xe9fc('0x4a')][_0xe9fc('0x51')]=_0x9bd7f6['id'];_0x13edf9[_0xe9fc('0x4a')][_0xe9fc('0x52')]=integrations[_0xe9fc('0x53')](_0x13edf9[_0xe9fc('0x4a')][_0xe9fc('0x54')],_0x13edf9[_0xe9fc('0x4a')][_0xe9fc('0x2f')]);_0x13edf9[_0xe9fc('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x13edf9['body'][_0xe9fc('0x54')],_0x13edf9['body'][_0xe9fc('0x2f')]);return db[_0xe9fc('0x4e')][_0xe9fc('0x49')](_0x13edf9[_0xe9fc('0x4a')],{'include':[{'model':db[_0xe9fc('0x55')],'as':_0xe9fc('0x52')},{'model':db[_0xe9fc('0x55')],'as':_0xe9fc('0x56')}]});}return null;})[_0xe9fc('0x24')](respondWithResult(_0x509756,null))[_0xe9fc('0x45')](handleError(_0x509756,null));};function getAccessToken(_0x114921){return new Promise(function(_0x4fae42,_0x149a97){var _0x53c9a5;switch(_0x114921[_0xe9fc('0x57')]){case'US':_0x53c9a5=_0xe9fc('0x58');break;case'AU':_0x53c9a5=_0xe9fc('0x59');break;case'EU':_0x53c9a5=_0xe9fc('0x5a');break;case'IN':_0x53c9a5=_0xe9fc('0x5b');break;case'CN':_0x53c9a5='https://accounts.zoho.com.cn';break;default:_0x53c9a5=_0xe9fc('0x5a');break;}var _0x232853={'method':_0xe9fc('0x5c'),'uri':_0x53c9a5+_0xe9fc('0x5d'),'qs':{'refresh_token':_0x114921[_0xe9fc('0x5e')],'client_id':_0x114921[_0xe9fc('0x5f')],'client_secret':_0x114921[_0xe9fc('0x60')],'grant_type':_0xe9fc('0x61')},'json':!![]};return rp(_0x232853)[_0xe9fc('0x24')](function(_0x506458){if(_0x506458[_0xe9fc('0x62')]){_0x4fae42(_0x506458[_0xe9fc('0x62')]);}else{_0x149a97(_0xe9fc('0x63'));}})[_0xe9fc('0x45')](function(_0xa21708){_0x149a97(_0xa21708);});});}exports['getFields']=function(_0x176e9e,_0x90bcfa,_0x2e1e47){var _0xac0bb6,_0x94a3a0,_0x41f6e6,_0x224772,_0x4c6ade;return db[_0xe9fc('0x2c')]['findOne']({'where':{'id':_0x176e9e['params']['id']},'attributes':['id',_0xe9fc('0x64'),_0xe9fc('0x57'),_0xe9fc('0x5f'),'clientSecret',_0xe9fc('0x65'),_0xe9fc('0x66'),_0xe9fc('0x5e')]})[_0xe9fc('0x24')](handleEntityNotFound(_0x90bcfa,null))[_0xe9fc('0x24')](function(_0x5262eb){_0x4c6ade=_0x5262eb;_0xac0bb6=_0x4c6ade['host'];_0x94a3a0=_0xac0bb6==='zoho.eu'?'eu':'com';_0x41f6e6=_0x4c6ade[_0xe9fc('0x65')];var _0x4f3b33=_0x41f6e6['slice'](-0x1);if(_0x4f3b33==='/'||_0x4f3b33==='\x5c'||_0x4f3b33===':'){_0x41f6e6=_0x41f6e6[_0xe9fc('0x67')](0x0,_0x41f6e6[_0xe9fc('0x68')](_0x4f3b33));}if(!_0x4c6ade[_0xe9fc('0x5e')]){throw new Error(_0xe9fc('0x69'));}return getAccessToken(_0x4c6ade);})['then'](function(_0x1873bc){if(_0x1873bc){return rp({'method':'GET','uri':util['format'](_0xe9fc('0x6a'),_0x94a3a0),'qs':{'module':'Calls'},'headers':{'Authorization':_0xe9fc('0x6b')+_0x1873bc},'json':!![]});}})[_0xe9fc('0x24')](function(_0x5c611e){if(_0x5c611e){if(_0x5c611e[_0xe9fc('0x6c')]&&_0x5c611e['response'][_0xe9fc('0x26')]){throw new Error(_0x5c611e[_0xe9fc('0x6c')][_0xe9fc('0x26')]['message']);}var _0x5b9a9f=[];var _0xed548d=[];var _0x28f27c=['Owner',_0xe9fc('0x6d'),_0xe9fc('0x6e'),'WhoId',_0xe9fc('0x6f'),_0xe9fc('0x70'),_0xe9fc('0x71'),_0xe9fc('0x72')];_0xed548d=_['remove'](_0x5c611e[_0xe9fc('0x37')],function(_0x41ceb1){return _0x28f27c['includes'](_0x41ceb1[_0xe9fc('0x73')]);});for(var _0x157de6=0x0;_0x157de6<_0xed548d[_0xe9fc('0x48')];_0x157de6++){if(_0xed548d[_0x157de6][_0xe9fc('0x74')]===![]){_0x5b9a9f['push']({'id':_0xed548d[_0x157de6]['id'],'name':_0xed548d[_0x157de6][_0xe9fc('0x75')],'custom':_0xed548d[_0x157de6]['custom_field'],'options':_0xed548d[_0x157de6][_0xe9fc('0x76')]===_0xe9fc('0x77')&&_0xed548d[_0x157de6][_0xe9fc('0x78')][_0xe9fc('0x48')]>-0x1?_['map'](_0xed548d[_0x157de6]['pick_list_values'],function(_0x5aba6a){return{'name':_0x5aba6a,'value':_0x5aba6a};}):[]});}}return{'count':_0x5b9a9f['length'],'rows':_0x5b9a9f};}else{return{'count':0x0,'rows':[]};}})[_0xe9fc('0x24')](respondWithResult(_0x90bcfa,null))[_0xe9fc('0x45')](function(_0x264122){var _0x5058d8=_0x176e9e[_0xe9fc('0x32')][_0xe9fc('0x79')]?0x1f4:_0x264122['statusCode']||0x1f4;logger['error'](_0xe9fc('0x7a'),_0xe9fc('0x7b'),_0x5058d8,JSON[_0xe9fc('0x7c')](_0x264122));delete _0x264122[_0xe9fc('0x28')];if(_0x5058d8===0x191){_0x5058d8=0x190;}_0x90bcfa[_0xe9fc('0x19')](_0x5058d8)[_0xe9fc('0x29')](_0x176e9e[_0xe9fc('0x32')][_0xe9fc('0x79')]?{'message':_0xe9fc('0x7d'),'statusCode':_0x264122[_0xe9fc('0x7e')]}:_0x264122);});}; \ No newline at end of file +var _0x09e5=['/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','system_mandatory','push','custom_field','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','then','include','rows','catch','show','params','includeAll','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','length','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST'];(function(_0x20cd9e,_0x4c93d0){var _0xa936ef=function(_0x326388){while(--_0x326388){_0x20cd9e['push'](_0x20cd9e['shift']());}};_0xa936ef(++_0x4c93d0);}(_0x09e5,0x1a3));var _0x509e=function(_0x46de8f,_0x18623a){_0x46de8f=_0x46de8f-0x0;var _0x9560d1=_0x09e5[_0x46de8f];return _0x9560d1;};'use strict';var emlformat=require(_0x509e('0x0'));var rimraf=require(_0x509e('0x1'));var zipdir=require(_0x509e('0x2'));var jsonpatch=require(_0x509e('0x3'));var rp=require(_0x509e('0x4'));var moment=require(_0x509e('0x5'));var BPromise=require(_0x509e('0x6'));var Mustache=require(_0x509e('0x7'));var util=require(_0x509e('0x8'));var path=require(_0x509e('0x9'));var sox=require(_0x509e('0xa'));var csv=require('to-csv');var ejs=require(_0x509e('0xb'));var fs=require('fs');var fs_extra=require(_0x509e('0xc'));var _=require(_0x509e('0xd'));var squel=require('squel');var crypto=require(_0x509e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x509e('0xf'));var querystring=require(_0x509e('0x10'));var Papa=require(_0x509e('0x11'));var Redis=require(_0x509e('0x12'));var authService=require(_0x509e('0x13'));var qs=require(_0x509e('0x14'));var as=require(_0x509e('0x15'));var hardwareService=require(_0x509e('0x16'));var logger=require('../../config/logger')(_0x509e('0x17'));var utils=require('../../config/utils');var config=require(_0x509e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x509e('0x19'))['db'];var integrations=require(_0x509e('0x1a'));function respondWithStatusCode(_0x4270ac,_0x2f0fd6){_0x2f0fd6=_0x2f0fd6||0xcc;return function(_0x257ea){if(_0x257ea){return _0x4270ac[_0x509e('0x1b')](_0x2f0fd6);}return _0x4270ac[_0x509e('0x1c')](_0x2f0fd6)[_0x509e('0x1d')]();};}function respondWithResult(_0x3a8225,_0x4e7fda){_0x4e7fda=_0x4e7fda||0xc8;return function(_0x344fca){if(_0x344fca){return _0x3a8225[_0x509e('0x1c')](_0x4e7fda)[_0x509e('0x1e')](_0x344fca);}};}function respondWithFilteredResult(_0x57d6bb,_0x3c5f7b){return function(_0x1d7821){if(_0x1d7821){var _0x2f463a=typeof _0x3c5f7b[_0x509e('0x1f')]==='undefined'&&typeof _0x3c5f7b[_0x509e('0x20')]==='undefined';var _0x37542e=_0x1d7821[_0x509e('0x21')];var _0x10b1ee=_0x2f463a?0x0:_0x3c5f7b['offset'];var _0x54747d=_0x2f463a?_0x1d7821[_0x509e('0x21')]:_0x3c5f7b[_0x509e('0x1f')]+_0x3c5f7b['limit'];var _0x4acb41;if(_0x54747d>=_0x37542e){_0x54747d=_0x37542e;_0x4acb41=0xc8;}else{_0x4acb41=0xce;}_0x57d6bb[_0x509e('0x1c')](_0x4acb41);return _0x57d6bb[_0x509e('0x22')](_0x509e('0x23'),_0x10b1ee+'-'+_0x54747d+'/'+_0x37542e)[_0x509e('0x1e')](_0x1d7821);}return null;};}function patchUpdates(_0x272bd0){return function(_0x290858){try{jsonpatch['apply'](_0x290858,_0x272bd0,!![]);}catch(_0x489530){return BPromise[_0x509e('0x24')](_0x489530);}return _0x290858[_0x509e('0x25')]();};}function saveUpdates(_0x5c473b,_0x4f2b29){return function(_0x41aa8c){if(_0x41aa8c){return _0x41aa8c['update'](_0x5c473b)['then'](function(_0x31b6e1){return _0x31b6e1;});}return null;};}function removeEntity(_0xf94f25,_0x32f52d){return function(_0x15b1d3){if(_0x15b1d3){return _0x15b1d3['destroy']()['then'](function(){_0xf94f25[_0x509e('0x1c')](0xcc)[_0x509e('0x1d')]();});}};}function handleEntityNotFound(_0x3e1fcd,_0xe485cc){return function(_0x19b71a){if(!_0x19b71a){_0x3e1fcd[_0x509e('0x1b')](0x194);}return _0x19b71a;};}function handleError(_0x22ef46,_0x159f8c){_0x159f8c=_0x159f8c||0x1f4;return function(_0x42e3a5){logger[_0x509e('0x26')](_0x42e3a5[_0x509e('0x27')]);if(_0x42e3a5['name']){delete _0x42e3a5[_0x509e('0x28')];}_0x22ef46[_0x509e('0x1c')](_0x159f8c)['send'](_0x42e3a5);};}exports[_0x509e('0x29')]=function(_0x1e1dfe,_0x528c77){var _0x525ae0={},_0x431f0f={},_0x24a5eb={'count':0x0,'rows':[]};var _0x31fabd=_[_0x509e('0x2a')](db[_0x509e('0x2b')][_0x509e('0x2c')],function(_0x3610ef){return{'name':_0x3610ef[_0x509e('0x2d')],'type':_0x3610ef['type'][_0x509e('0x2e')]};});_0x431f0f[_0x509e('0x2f')]=_[_0x509e('0x2a')](_0x31fabd,_0x509e('0x28'));_0x431f0f[_0x509e('0x30')]=_[_0x509e('0x31')](_0x1e1dfe['query']);_0x431f0f[_0x509e('0x32')]=_[_0x509e('0x33')](_0x431f0f[_0x509e('0x2f')],_0x431f0f[_0x509e('0x30')]);_0x525ae0['attributes']=_['intersection'](_0x431f0f['model'],qs[_0x509e('0x34')](_0x1e1dfe[_0x509e('0x30')][_0x509e('0x34')]));_0x525ae0[_0x509e('0x35')]=_0x525ae0[_0x509e('0x35')]['length']?_0x525ae0[_0x509e('0x35')]:_0x431f0f[_0x509e('0x2f')];if(!_0x1e1dfe[_0x509e('0x30')][_0x509e('0x36')](_0x509e('0x37'))){_0x525ae0[_0x509e('0x20')]=qs[_0x509e('0x20')](_0x1e1dfe['query'][_0x509e('0x20')]);_0x525ae0[_0x509e('0x1f')]=qs['offset'](_0x1e1dfe[_0x509e('0x30')]['offset']);}_0x525ae0['order']=qs[_0x509e('0x38')](_0x1e1dfe[_0x509e('0x30')][_0x509e('0x38')]);_0x525ae0[_0x509e('0x39')]=qs[_0x509e('0x32')](_[_0x509e('0x3a')](_0x1e1dfe[_0x509e('0x30')],_0x431f0f[_0x509e('0x32')]),_0x31fabd);if(_0x1e1dfe[_0x509e('0x30')][_0x509e('0x3b')]){_0x525ae0[_0x509e('0x39')]=_['merge'](_0x525ae0[_0x509e('0x39')],{'$or':_[_0x509e('0x2a')](_0x31fabd,function(_0x4eeb7d){if(_0x4eeb7d[_0x509e('0x3c')]!==_0x509e('0x3d')){var _0x10c3ef={};_0x10c3ef[_0x4eeb7d[_0x509e('0x28')]]={'$like':'%'+_0x1e1dfe[_0x509e('0x30')]['filter']+'%'};return _0x10c3ef;}})});}_0x525ae0=_[_0x509e('0x3e')]({},_0x525ae0,_0x1e1dfe[_0x509e('0x3f')]);var _0x4927d9={'where':_0x525ae0[_0x509e('0x39')]};return db[_0x509e('0x2b')][_0x509e('0x21')](_0x4927d9)[_0x509e('0x40')](function(_0x1c5f6a){_0x24a5eb['count']=_0x1c5f6a;if(_0x1e1dfe['query']['includeAll']){_0x525ae0[_0x509e('0x41')]=[{'all':!![]}];}return db[_0x509e('0x2b')]['findAll'](_0x525ae0);})['then'](function(_0x37f6b8){_0x24a5eb[_0x509e('0x42')]=_0x37f6b8;return _0x24a5eb;})[_0x509e('0x40')](respondWithFilteredResult(_0x528c77,_0x525ae0))[_0x509e('0x43')](handleError(_0x528c77,null));};exports[_0x509e('0x44')]=function(_0x2e53e4,_0x3627df){var _0x5efa10={'raw':![],'where':{'id':_0x2e53e4[_0x509e('0x45')]['id']}},_0x39d64f={};_0x39d64f[_0x509e('0x2f')]=_['keys'](db['ZohoAccount'][_0x509e('0x2c')]);_0x39d64f[_0x509e('0x30')]=_[_0x509e('0x31')](_0x2e53e4[_0x509e('0x30')]);_0x39d64f[_0x509e('0x32')]=_[_0x509e('0x33')](_0x39d64f[_0x509e('0x2f')],_0x39d64f[_0x509e('0x30')]);_0x5efa10[_0x509e('0x35')]=_[_0x509e('0x33')](_0x39d64f['model'],qs[_0x509e('0x34')](_0x2e53e4[_0x509e('0x30')][_0x509e('0x34')]));_0x5efa10[_0x509e('0x35')]=_0x5efa10[_0x509e('0x35')]['length']?_0x5efa10[_0x509e('0x35')]:_0x39d64f[_0x509e('0x2f')];if(_0x2e53e4[_0x509e('0x30')][_0x509e('0x46')]){_0x5efa10['include']=[{'all':!![]}];}_0x5efa10=_[_0x509e('0x3e')]({},_0x5efa10,_0x2e53e4[_0x509e('0x3f')]);return db[_0x509e('0x2b')][_0x509e('0x47')](_0x5efa10)[_0x509e('0x40')](handleEntityNotFound(_0x3627df,null))[_0x509e('0x40')](respondWithResult(_0x3627df,null))[_0x509e('0x43')](handleError(_0x3627df,null));};exports[_0x509e('0x48')]=function(_0x59e032,_0x8d1fb4){return db['ZohoAccount'][_0x509e('0x48')](_0x59e032[_0x509e('0x49')],{})[_0x509e('0x40')](respondWithResult(_0x8d1fb4,0xc9))['catch'](handleError(_0x8d1fb4,null));};exports['update']=function(_0x5d0059,_0x3d2f48){if(_0x5d0059[_0x509e('0x49')]['id']){delete _0x5d0059[_0x509e('0x49')]['id'];}return db[_0x509e('0x2b')][_0x509e('0x47')]({'where':{'id':_0x5d0059['params']['id']}})['then'](handleEntityNotFound(_0x3d2f48,null))[_0x509e('0x40')](saveUpdates(_0x5d0059[_0x509e('0x49')],null))[_0x509e('0x40')](respondWithResult(_0x3d2f48,null))[_0x509e('0x43')](handleError(_0x3d2f48,null));};exports[_0x509e('0x4a')]=function(_0x52c387,_0x55d07f){return db[_0x509e('0x2b')][_0x509e('0x47')]({'where':{'id':_0x52c387[_0x509e('0x45')]['id']}})['then'](handleEntityNotFound(_0x55d07f,null))['then'](removeEntity(_0x55d07f,null))[_0x509e('0x43')](handleError(_0x55d07f,null));};exports[_0x509e('0x4b')]=function(_0x153cf1,_0x1225dd,_0x19ace5){var _0x4dd304={};var _0x1cf324={};var _0x113e25;var _0xf3d26b;return db['ZohoAccount'][_0x509e('0x4c')]({'where':{'id':_0x153cf1[_0x509e('0x45')]['id']}})[_0x509e('0x40')](handleEntityNotFound(_0x1225dd,null))[_0x509e('0x40')](function(_0x226f6d){if(_0x226f6d){_0x113e25=_0x226f6d;_0x1cf324['model']=_[_0x509e('0x31')](db[_0x509e('0x4d')]['rawAttributes']);_0x1cf324[_0x509e('0x30')]=_[_0x509e('0x31')](_0x153cf1['query']);_0x1cf324[_0x509e('0x32')]=_['intersection'](_0x1cf324[_0x509e('0x2f')],_0x1cf324['query']);_0x4dd304['attributes']=_[_0x509e('0x33')](_0x1cf324[_0x509e('0x2f')],qs[_0x509e('0x34')](_0x153cf1[_0x509e('0x30')][_0x509e('0x34')]));_0x4dd304[_0x509e('0x35')]=_0x4dd304[_0x509e('0x35')][_0x509e('0x4e')]?_0x4dd304[_0x509e('0x35')]:_0x1cf324[_0x509e('0x2f')];_0x4dd304[_0x509e('0x4f')]=qs[_0x509e('0x38')](_0x153cf1[_0x509e('0x30')][_0x509e('0x38')]);_0x4dd304['where']=qs[_0x509e('0x32')](_[_0x509e('0x3a')](_0x153cf1[_0x509e('0x30')],_0x1cf324[_0x509e('0x32')]));if(_0x153cf1[_0x509e('0x30')][_0x509e('0x3b')]){_0x4dd304[_0x509e('0x39')]=_[_0x509e('0x3e')](_0x4dd304['where'],{'$or':_[_0x509e('0x2a')](_0x4dd304['attributes'],function(_0x4449d9){var _0x936d4a={};_0x936d4a[_0x4449d9]={'$like':'%'+_0x153cf1[_0x509e('0x30')][_0x509e('0x3b')]+'%'};return _0x936d4a;})});}_0x4dd304=_[_0x509e('0x3e')]({},_0x4dd304,_0x153cf1[_0x509e('0x3f')]);return _0x113e25['getConfigurations'](_0x4dd304);}})[_0x509e('0x40')](function(_0x258c3b){if(_0x258c3b){_0xf3d26b=_0x258c3b[_0x509e('0x4e')];if(!_0x153cf1[_0x509e('0x30')][_0x509e('0x36')](_0x509e('0x37'))){_0x4dd304[_0x509e('0x20')]=qs[_0x509e('0x20')](_0x153cf1[_0x509e('0x30')][_0x509e('0x20')]);_0x4dd304[_0x509e('0x1f')]=qs[_0x509e('0x1f')](_0x153cf1['query'][_0x509e('0x1f')]);}return _0x113e25[_0x509e('0x4b')](_0x4dd304);}})[_0x509e('0x40')](function(_0x33a01d){if(_0x33a01d){return _0x33a01d?{'count':_0xf3d26b,'rows':_0x33a01d}:null;}})[_0x509e('0x40')](respondWithResult(_0x1225dd,null))[_0x509e('0x43')](handleError(_0x1225dd,null));};exports[_0x509e('0x50')]=function(_0x2a2ce5,_0x35b29a,_0x3de42e){if(_0x2a2ce5[_0x509e('0x49')]['id']){delete _0x2a2ce5[_0x509e('0x49')]['id'];}return db[_0x509e('0x2b')][_0x509e('0x4c')]({'where':{'id':_0x2a2ce5[_0x509e('0x45')]['id']}})[_0x509e('0x40')](handleEntityNotFound(_0x35b29a,null))[_0x509e('0x40')](function(_0x2290a6){if(_0x2290a6){_0x2a2ce5[_0x509e('0x49')][_0x509e('0x51')]=_0x2290a6['id'];_0x2a2ce5[_0x509e('0x49')][_0x509e('0x52')]=integrations[_0x509e('0x53')](_0x2a2ce5[_0x509e('0x49')][_0x509e('0x54')],_0x2a2ce5[_0x509e('0x49')][_0x509e('0x3c')]);_0x2a2ce5['body'][_0x509e('0x55')]=integrations[_0x509e('0x56')](_0x2a2ce5['body'][_0x509e('0x54')],_0x2a2ce5['body'][_0x509e('0x3c')]);return db[_0x509e('0x4d')][_0x509e('0x48')](_0x2a2ce5[_0x509e('0x49')],{'include':[{'model':db[_0x509e('0x57')],'as':_0x509e('0x52')},{'model':db[_0x509e('0x57')],'as':_0x509e('0x55')}]});}return null;})[_0x509e('0x40')](respondWithResult(_0x35b29a,null))[_0x509e('0x43')](handleError(_0x35b29a,null));};function getAccessToken(_0x2b16e4){return new Promise(function(_0x337723,_0x4672f6){var _0x2704e9;switch(_0x2b16e4['zone']){case'US':_0x2704e9=_0x509e('0x58');break;case'AU':_0x2704e9='https://accounts.zoho.com.au';break;case'EU':_0x2704e9=_0x509e('0x59');break;case'IN':_0x2704e9=_0x509e('0x5a');break;case'CN':_0x2704e9=_0x509e('0x5b');break;default:_0x2704e9=_0x509e('0x59');break;}var _0x17fa65={'method':_0x509e('0x5c'),'uri':_0x2704e9+_0x509e('0x5d'),'qs':{'refresh_token':_0x2b16e4[_0x509e('0x5e')],'client_id':_0x2b16e4[_0x509e('0x5f')],'client_secret':_0x2b16e4[_0x509e('0x60')],'grant_type':_0x509e('0x61')},'json':!![]};return rp(_0x17fa65)[_0x509e('0x40')](function(_0xd811f8){if(_0xd811f8['access_token']){_0x337723(_0xd811f8['access_token']);}else{_0x4672f6(_0x509e('0x62'));}})[_0x509e('0x43')](function(_0x4fcabc){_0x4672f6(_0x4fcabc);});});}exports[_0x509e('0x63')]=function(_0x5a0438,_0x498f8d,_0x3333de){var _0xa7d47d,_0x387541,_0x8a0fbe,_0x285345,_0x238e9c;return db['ZohoAccount']['findOne']({'where':{'id':_0x5a0438['params']['id']},'attributes':['id',_0x509e('0x64'),'zone',_0x509e('0x5f'),_0x509e('0x60'),_0x509e('0x65'),'code',_0x509e('0x5e')]})['then'](handleEntityNotFound(_0x498f8d,null))[_0x509e('0x40')](function(_0x130007){_0x238e9c=_0x130007;_0xa7d47d=_0x238e9c[_0x509e('0x64')];_0x387541=_0xa7d47d===_0x509e('0x66')?'eu':_0x509e('0x67');_0x8a0fbe=_0x238e9c[_0x509e('0x65')];var _0x37e358=_0x8a0fbe['slice'](-0x1);if(_0x37e358==='/'||_0x37e358==='\x5c'||_0x37e358===':'){_0x8a0fbe=_0x8a0fbe['substring'](0x0,_0x8a0fbe[_0x509e('0x68')](_0x37e358));}if(!_0x238e9c[_0x509e('0x5e')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x238e9c);})['then'](function(_0x214118){if(_0x214118){return rp({'method':_0x509e('0x69'),'uri':util[_0x509e('0x6a')](_0x509e('0x6b'),_0x387541),'qs':{'module':_0x509e('0x6c')},'headers':{'Authorization':_0x509e('0x6d')+_0x214118},'json':!![]});}})['then'](function(_0x485eaf){if(_0x485eaf){if(_0x485eaf[_0x509e('0x6e')]&&_0x485eaf['response'][_0x509e('0x26')]){throw new Error(_0x485eaf[_0x509e('0x6e')][_0x509e('0x26')]['message']);}var _0x2c2269=[];var _0x548111=[];var _0x40d4ee=[_0x509e('0x6f'),_0x509e('0x70'),_0x509e('0x71'),_0x509e('0x72'),'Call_Duration',_0x509e('0x73'),_0x509e('0x74'),_0x509e('0x75')];_0x548111=_[_0x509e('0x76')](_0x485eaf['fields'],function(_0x1caabb){return _0x40d4ee['includes'](_0x1caabb['api_name']);});for(var _0x43f45d=0x0;_0x43f45d<_0x548111['length'];_0x43f45d++){if(_0x548111[_0x43f45d][_0x509e('0x77')]===![]){_0x2c2269[_0x509e('0x78')]({'id':_0x548111[_0x43f45d]['id'],'name':_0x548111[_0x43f45d]['display_label'],'custom':_0x548111[_0x43f45d][_0x509e('0x79')],'options':_0x548111[_0x43f45d]['data_type']==='picklist'&&_0x548111[_0x43f45d][_0x509e('0x7a')][_0x509e('0x4e')]>-0x1?_['map'](_0x548111[_0x43f45d][_0x509e('0x7a')],function(_0x496fff){return{'name':_0x496fff,'value':_0x496fff};}):[]});}}return{'count':_0x2c2269[_0x509e('0x4e')],'rows':_0x2c2269};}else{return{'count':0x0,'rows':[]};}})[_0x509e('0x40')](respondWithResult(_0x498f8d,null))[_0x509e('0x43')](function(_0x5b1071){var _0x5d980c=_0x5a0438[_0x509e('0x30')]['test']?0x1f4:_0x5b1071[_0x509e('0x7b')]||0x1f4;logger['error'](_0x509e('0x7c'),_0x509e('0x63'),_0x5d980c,JSON[_0x509e('0x7d')](_0x5b1071));delete _0x5b1071['name'];if(_0x5d980c===0x191){_0x5d980c=0x190;}_0x498f8d[_0x509e('0x1c')](_0x5d980c)['send'](_0x5a0438[_0x509e('0x30')][_0x509e('0x7e')]?{'message':_0x509e('0x7f'),'statusCode':_0x5b1071['statusCode']}:_0x5b1071);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f83a6c1..3d79744 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 _0xdbd9=['https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','then','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com.cn','application/x-www-form-urlencoded','parse','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xdbd9,0x1e0));var _0x9dbd=function(_0x2485a4,_0x44d85a){_0x2485a4=_0x2485a4-0x0;var _0x42cb50=_0xdbd9[_0x2485a4];return _0x42cb50;};'use strict';var _=require(_0x9dbd('0x0'));var util=require(_0x9dbd('0x1'));var logger=require(_0x9dbd('0x2'))(_0x9dbd('0x3'));var moment=require(_0x9dbd('0x4'));var BPromise=require(_0x9dbd('0x5'));var rp=require(_0x9dbd('0x6'));var fs=require('fs');var path=require(_0x9dbd('0x7'));var rimraf=require(_0x9dbd('0x8'));var config=require(_0x9dbd('0x9'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x9dbd('0xa'));module[_0x9dbd('0xb')]=function(_0x57c889,_0x125644){return _0x57c889[_0x9dbd('0xc')](_0x9dbd('0xd'),attributes,{'tableName':_0x9dbd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1712af,_0x24dfa6,_0x1d7232){if(_0x1712af[_0x9dbd('0xf')](_0x9dbd('0x10'))||_0x1712af[_0x9dbd('0xf')](_0x9dbd('0x11'))||_0x1712af['changed']('clientId')||_0x1712af[_0x9dbd('0xf')](_0x9dbd('0x12'))||_0x1712af[_0x9dbd('0xf')](_0x9dbd('0x13'))||_0x1712af[_0x9dbd('0xf')]('host')){var _0xf36313,_0x3367f3;_0xf36313=_0x1712af[_0x9dbd('0x11')];var _0x291173=_0xf36313[_0x9dbd('0x14')](-0x1);if(_0x291173==='/'||_0x291173==='\x5c'||_0x291173===':'){_0xf36313=_0xf36313[_0x9dbd('0x15')](0x0,_0xf36313['lastIndexOf'](_0x291173));}switch(_0x1712af[_0x9dbd('0x10')]){case'US':_0x3367f3='https://accounts.zoho.com';break;case'AU':_0x3367f3=_0x9dbd('0x16');break;case'IN':_0x3367f3=_0x9dbd('0x17');break;case'CN':_0x3367f3='https://accounts.zoho.com.cn';break;default:_0x3367f3=_0x9dbd('0x18');break;}var _0x3e2d13={'method':_0x9dbd('0x19'),'uri':_0x3367f3+_0x9dbd('0x1a'),'form':{'grant_type':_0x9dbd('0x1b'),'client_id':_0x1712af['clientId'],'client_secret':_0x1712af[_0x9dbd('0x12')],'redirect_uri':_0x1712af[_0x9dbd('0x11')],'code':_0x1712af['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3e2d13)[_0x9dbd('0x1c')](function(_0x1da6d4){var _0x6e576d=JSON['parse'](_0x1da6d4);if(_0x6e576d[_0x9dbd('0x1d')]){_0x1712af['refreshToken']=_0x6e576d['refresh_token'];logger[_0x9dbd('0x1e')](util[_0x9dbd('0x1f')](_0x9dbd('0x20'),_0x1712af[_0x9dbd('0x21')],_0x1712af['id']));}else{logger[_0x9dbd('0x22')](util[_0x9dbd('0x1f')](_0x9dbd('0x23'),_0x1712af[_0x9dbd('0x21')],_0x1712af['id']),util[_0x9dbd('0x24')](_0x6e576d,{'showHidden':![],'depth':null}));}return _0x1d7232(null,_0x24dfa6);})[_0x9dbd('0x25')](function(_0x49507d){logger[_0x9dbd('0x22')](util[_0x9dbd('0x1f')](_0x9dbd('0x23'),_0x1712af[_0x9dbd('0x21')],_0x1712af['id']),util[_0x9dbd('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d7232(_0x49507d);});}else{return _0x1d7232(null,_0x24dfa6);}},'beforeUpdate':function(_0x141670,_0x271295,_0x507622){if(_0x141670[_0x9dbd('0xf')](_0x9dbd('0x10'))||_0x141670[_0x9dbd('0xf')](_0x9dbd('0x11'))||_0x141670[_0x9dbd('0xf')]('clientId')||_0x141670[_0x9dbd('0xf')](_0x9dbd('0x12'))||_0x141670[_0x9dbd('0xf')]('code')||_0x141670[_0x9dbd('0xf')]('host')){var _0xa26b49,_0x5960ae;_0xa26b49=_0x141670[_0x9dbd('0x11')];var _0x251364=_0xa26b49[_0x9dbd('0x14')](-0x1);if(_0x251364==='/'||_0x251364==='\x5c'||_0x251364===':'){_0xa26b49=_0xa26b49['substring'](0x0,_0xa26b49['lastIndexOf'](_0x251364));}switch(_0x141670[_0x9dbd('0x10')]){case'US':_0x5960ae='https://accounts.zoho.com';break;case'AU':_0x5960ae=_0x9dbd('0x16');break;case'IN':_0x5960ae=_0x9dbd('0x17');break;case'CN':_0x5960ae=_0x9dbd('0x26');break;default:_0x5960ae=_0x9dbd('0x18');break;}var _0x385b24={'method':_0x9dbd('0x19'),'uri':_0x5960ae+_0x9dbd('0x1a'),'form':{'grant_type':_0x9dbd('0x1b'),'client_id':_0x141670['clientId'],'client_secret':_0x141670[_0x9dbd('0x12')],'redirect_uri':_0x141670['serverUrl'],'code':_0x141670['code']},'headers':{'Content-Type':_0x9dbd('0x27')}};return rp(_0x385b24)[_0x9dbd('0x1c')](function(_0x3181da){var _0x49f093=JSON[_0x9dbd('0x28')](_0x3181da);if(_0x49f093['refresh_token']){_0x141670[_0x9dbd('0x29')]=_0x49f093[_0x9dbd('0x1d')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x141670[_0x9dbd('0x21')],_0x141670['id']));}else{logger[_0x9dbd('0x22')](util[_0x9dbd('0x1f')](_0x9dbd('0x23'),_0x141670['name'],_0x141670['id']),util['inspect'](_0x49f093,{'showHidden':![],'depth':null}));}return _0x507622(null,_0x271295);})[_0x9dbd('0x25')](function(_0x1b01c5){logger['error'](util[_0x9dbd('0x1f')](_0x9dbd('0x23'),_0x141670[_0x9dbd('0x21')],_0x141670['id']),util[_0x9dbd('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x507622(_0x1b01c5);});}else{return _0x507622(null,_0x271295);}}}});}; \ No newline at end of file +var _0x90bf=['POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','info','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','code','host','lastIndexOf','https://accounts.zoho.com.au','refreshToken','inspect','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','changed','zone','serverUrl','clientSecret','slice','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x90bf,0x92));var _0xf90b=function(_0x3471d0,_0x28de1c){_0x3471d0=_0x3471d0-0x0;var _0x154a18=_0x90bf[_0x3471d0];return _0x154a18;};'use strict';var _=require(_0xf90b('0x0'));var util=require(_0xf90b('0x1'));var logger=require(_0xf90b('0x2'))(_0xf90b('0x3'));var moment=require(_0xf90b('0x4'));var BPromise=require(_0xf90b('0x5'));var rp=require(_0xf90b('0x6'));var fs=require('fs');var path=require(_0xf90b('0x7'));var rimraf=require(_0xf90b('0x8'));var config=require('../../config/environment');var attributes=require(_0xf90b('0x9'));var integrations=require(_0xf90b('0xa'));module[_0xf90b('0xb')]=function(_0x10498e,_0x497979){return _0x10498e['define']('ZohoAccount',attributes,{'tableName':_0xf90b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10d5fb,_0x36f552,_0x31a044){if(_0x10d5fb[_0xf90b('0xd')](_0xf90b('0xe'))||_0x10d5fb[_0xf90b('0xd')](_0xf90b('0xf'))||_0x10d5fb[_0xf90b('0xd')]('clientId')||_0x10d5fb[_0xf90b('0xd')](_0xf90b('0x10'))||_0x10d5fb[_0xf90b('0xd')]('code')||_0x10d5fb[_0xf90b('0xd')]('host')){var _0x47d2ba,_0x452f0b;_0x47d2ba=_0x10d5fb['serverUrl'];var _0x5e29b2=_0x47d2ba[_0xf90b('0x11')](-0x1);if(_0x5e29b2==='/'||_0x5e29b2==='\x5c'||_0x5e29b2===':'){_0x47d2ba=_0x47d2ba['substring'](0x0,_0x47d2ba['lastIndexOf'](_0x5e29b2));}switch(_0x10d5fb[_0xf90b('0xe')]){case'US':_0x452f0b=_0xf90b('0x12');break;case'AU':_0x452f0b='https://accounts.zoho.com.au';break;case'IN':_0x452f0b=_0xf90b('0x13');break;case'CN':_0x452f0b=_0xf90b('0x14');break;default:_0x452f0b=_0xf90b('0x15');break;}var _0xb47d15={'method':_0xf90b('0x16'),'uri':_0x452f0b+_0xf90b('0x17'),'form':{'grant_type':_0xf90b('0x18'),'client_id':_0x10d5fb[_0xf90b('0x19')],'client_secret':_0x10d5fb[_0xf90b('0x10')],'redirect_uri':_0x10d5fb[_0xf90b('0xf')],'code':_0x10d5fb['code']},'headers':{'Content-Type':_0xf90b('0x1a')}};return rp(_0xb47d15)[_0xf90b('0x1b')](function(_0x379f7a){var _0x52017d=JSON[_0xf90b('0x1c')](_0x379f7a);if(_0x52017d[_0xf90b('0x1d')]){_0x10d5fb['refreshToken']=_0x52017d[_0xf90b('0x1d')];logger[_0xf90b('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10d5fb[_0xf90b('0x1f')],_0x10d5fb['id']));}else{logger[_0xf90b('0x20')](util[_0xf90b('0x21')](_0xf90b('0x22'),_0x10d5fb['name'],_0x10d5fb['id']),util['inspect'](_0x52017d,{'showHidden':![],'depth':null}));}return _0x31a044(null,_0x36f552);})['catch'](function(_0x1f3e27){logger[_0xf90b('0x20')](util['format'](_0xf90b('0x22'),_0x10d5fb[_0xf90b('0x1f')],_0x10d5fb['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x31a044(_0x1f3e27);});}else{return _0x31a044(null,_0x36f552);}},'beforeUpdate':function(_0x4f8c70,_0x1cc9ba,_0x59986d){if(_0x4f8c70[_0xf90b('0xd')](_0xf90b('0xe'))||_0x4f8c70['changed']('serverUrl')||_0x4f8c70[_0xf90b('0xd')](_0xf90b('0x19'))||_0x4f8c70[_0xf90b('0xd')](_0xf90b('0x10'))||_0x4f8c70[_0xf90b('0xd')](_0xf90b('0x23'))||_0x4f8c70[_0xf90b('0xd')](_0xf90b('0x24'))){var _0x2be466,_0x2cc6da;_0x2be466=_0x4f8c70[_0xf90b('0xf')];var _0xef24a8=_0x2be466['slice'](-0x1);if(_0xef24a8==='/'||_0xef24a8==='\x5c'||_0xef24a8===':'){_0x2be466=_0x2be466['substring'](0x0,_0x2be466[_0xf90b('0x25')](_0xef24a8));}switch(_0x4f8c70['zone']){case'US':_0x2cc6da=_0xf90b('0x12');break;case'AU':_0x2cc6da=_0xf90b('0x26');break;case'IN':_0x2cc6da='https://accounts.zoho.in';break;case'CN':_0x2cc6da=_0xf90b('0x14');break;default:_0x2cc6da=_0xf90b('0x15');break;}var _0x3a65c6={'method':_0xf90b('0x16'),'uri':_0x2cc6da+'/oauth/v2/token','form':{'grant_type':_0xf90b('0x18'),'client_id':_0x4f8c70['clientId'],'client_secret':_0x4f8c70[_0xf90b('0x10')],'redirect_uri':_0x4f8c70['serverUrl'],'code':_0x4f8c70[_0xf90b('0x23')]},'headers':{'Content-Type':_0xf90b('0x1a')}};return rp(_0x3a65c6)[_0xf90b('0x1b')](function(_0x9fb06d){var _0x71195e=JSON[_0xf90b('0x1c')](_0x9fb06d);if(_0x71195e[_0xf90b('0x1d')]){_0x4f8c70[_0xf90b('0x27')]=_0x71195e[_0xf90b('0x1d')];logger[_0xf90b('0x1e')](util[_0xf90b('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4f8c70[_0xf90b('0x1f')],_0x4f8c70['id']));}else{logger[_0xf90b('0x20')](util[_0xf90b('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4f8c70[_0xf90b('0x1f')],_0x4f8c70['id']),util[_0xf90b('0x28')](_0x71195e,{'showHidden':![],'depth':null}));}return _0x59986d(null,_0x1cc9ba);})[_0xf90b('0x29')](function(_0x2d3a59){logger[_0xf90b('0x20')](util[_0xf90b('0x21')](_0xf90b('0x22'),_0x4f8c70[_0xf90b('0x1f')],_0x4f8c70['id']),util[_0xf90b('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x59986d(_0x2d3a59);});}else{return _0x59986d(null,_0x1cc9ba);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 9ea3fa9..a80b37b 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 _0xf40b=['find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount'];(function(_0x11d0b7,_0x1ca85b){var _0x2c05fd=function(_0x5515db){while(--_0x5515db){_0x11d0b7['push'](_0x11d0b7['shift']());}};_0x2c05fd(++_0x1ca85b);}(_0xf40b,0xb0));var _0xbf40=function(_0x26c112,_0x41e2fd){_0x26c112=_0x26c112-0x0;var _0x4933d8=_0xf40b[_0x26c112];return _0x4933d8;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var moment=require(_0xbf40('0x1'));var BPromise=require(_0xbf40('0x2'));var rs=require(_0xbf40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf40('0x4'))['db'];var utils=require(_0xbf40('0x5'));var logger=require(_0xbf40('0x6'))(_0xbf40('0x7'));var config=require(_0xbf40('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf40('0x9')][_0xbf40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c6e1b,_0xe360e1,_0x1d5add){return new BPromise(function(_0x4c0875,_0x5f525c){return client[_0xbf40('0xb')](_0x1c6e1b,_0x1d5add)[_0xbf40('0xc')](function(_0x1ee6b1){logger[_0xbf40('0xd')](_0xbf40('0xe'),_0xe360e1,_0xbf40('0xf'));logger[_0xbf40('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xe360e1,_0xbf40('0xf'),JSON[_0xbf40('0x11')](_0x1ee6b1));if(_0x1ee6b1[_0xbf40('0x12')]){if(_0x1ee6b1[_0xbf40('0x12')][_0xbf40('0x13')]===0x1f4){logger[_0xbf40('0x12')](_0xbf40('0xe'),_0xe360e1,_0x1ee6b1[_0xbf40('0x12')]['message']);return _0x5f525c(_0x1ee6b1['error'][_0xbf40('0x14')]);}logger[_0xbf40('0x12')](_0xbf40('0xe'),_0xe360e1,_0x1ee6b1[_0xbf40('0x12')]['message']);return _0x4c0875(_0x1ee6b1[_0xbf40('0x12')][_0xbf40('0x14')]);}else{logger[_0xbf40('0xd')](_0xbf40('0xe'),_0xe360e1,_0xbf40('0xf'));_0x4c0875(_0x1ee6b1[_0xbf40('0x15')][_0xbf40('0x14')]);}})[_0xbf40('0x16')](function(_0x54c517){logger[_0xbf40('0x12')](_0xbf40('0xe'),_0xe360e1,_0x54c517);_0x5f525c(_0x54c517);});});}exports[_0xbf40('0x17')]=function(_0x1e50f9){var _0x391ea1=this;return new Promise(function(_0x414123,_0x325545){return db[_0xbf40('0x18')]['findAll']({'raw':_0x1e50f9[_0xbf40('0x19')]?_0x1e50f9[_0xbf40('0x19')][_0xbf40('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e50f9[_0xbf40('0x19')]?_0x1e50f9['options'][_0xbf40('0x1b')]||null:null,'attributes':_0x1e50f9[_0xbf40('0x19')]?_0x1e50f9[_0xbf40('0x19')][_0xbf40('0x1c')]||null:null,'limit':_0x1e50f9[_0xbf40('0x19')]?_0x1e50f9[_0xbf40('0x19')][_0xbf40('0x1d')]||null:null,'include':_0x1e50f9[_0xbf40('0x19')]?_0x1e50f9[_0xbf40('0x19')][_0xbf40('0x1e')]?_[_0xbf40('0x1f')](_0x1e50f9[_0xbf40('0x19')][_0xbf40('0x1e')],function(_0x1471ee){return{'model':db[_0x1471ee[_0xbf40('0x20')]],'as':_0x1471ee['as'],'attributes':_0x1471ee[_0xbf40('0x1c')],'include':_0x1471ee['include']?_[_0xbf40('0x1f')](_0x1471ee[_0xbf40('0x1e')],function(_0x2890e7){return{'model':db[_0x2890e7[_0xbf40('0x20')]],'as':_0x2890e7['as'],'attributes':_0x2890e7[_0xbf40('0x1c')],'include':_0x2890e7[_0xbf40('0x1e')]?_[_0xbf40('0x1f')](_0x2890e7[_0xbf40('0x1e')],function(_0x40f563){return{'model':db[_0x40f563[_0xbf40('0x20')]],'as':_0x40f563['as'],'attributes':_0x40f563[_0xbf40('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbf40('0xc')](function(_0x2af9ce){logger[_0xbf40('0xd')]('GetZohoAccount',_0x1e50f9);logger[_0xbf40('0x10')]('GetZohoAccount',_0x1e50f9,JSON[_0xbf40('0x11')](_0x2af9ce));_0x414123(_0x2af9ce);})[_0xbf40('0x16')](function(_0x1b7870){logger['error'](_0xbf40('0x17'),_0x1b7870[_0xbf40('0x14')],_0x1e50f9);_0x325545(_0x391ea1[_0xbf40('0x12')](0x1f4,_0x1b7870['message']));});});};exports[_0xbf40('0x21')]=function(_0x5b99ea){var _0x186dc1=this;return new Promise(function(_0x41cbe7,_0x2bf542){return db['ZohoAccount'][_0xbf40('0x22')]({'raw':_0x5b99ea[_0xbf40('0x19')]?_0x5b99ea[_0xbf40('0x19')][_0xbf40('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b99ea[_0xbf40('0x19')]?_0x5b99ea[_0xbf40('0x19')][_0xbf40('0x1b')]||null:null,'attributes':_0x5b99ea[_0xbf40('0x19')]?_0x5b99ea[_0xbf40('0x19')]['attributes']||null:null,'include':_0x5b99ea[_0xbf40('0x19')]?_0x5b99ea[_0xbf40('0x19')][_0xbf40('0x1e')]?_[_0xbf40('0x1f')](_0x5b99ea['options'][_0xbf40('0x1e')],function(_0x5dae1f){return{'model':db[_0x5dae1f[_0xbf40('0x20')]],'as':_0x5dae1f['as'],'attributes':_0x5dae1f[_0xbf40('0x1c')],'include':_0x5dae1f[_0xbf40('0x1e')]?_['map'](_0x5dae1f[_0xbf40('0x1e')],function(_0x45d073){return{'model':db[_0x45d073[_0xbf40('0x20')]],'as':_0x45d073['as'],'attributes':_0x45d073[_0xbf40('0x1c')],'include':_0x45d073[_0xbf40('0x1e')]?_['map'](_0x45d073[_0xbf40('0x1e')],function(_0x114d24){return{'model':db[_0x114d24[_0xbf40('0x20')]],'as':_0x114d24['as'],'attributes':_0x114d24['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf40('0xc')](function(_0xe2b70){logger[_0xbf40('0xd')]('ShowZohoAccount',_0x5b99ea);logger[_0xbf40('0x10')](_0xbf40('0x21'),_0x5b99ea,JSON[_0xbf40('0x11')](_0xe2b70));_0x41cbe7(_0xe2b70);})[_0xbf40('0x16')](function(_0x868fa5){logger[_0xbf40('0x12')](_0xbf40('0x21'),_0x868fa5[_0xbf40('0x14')],_0x5b99ea);_0x2bf542(_0x186dc1[_0xbf40('0x12')](0x1f4,_0x868fa5[_0xbf40('0x14')]));});});}; \ No newline at end of file +var _0x7382=['then','ShowZohoAccount','stringify','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','attributes','limit','include','map','model'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7382,0x111));var _0x2738=function(_0x32b00a,_0x3632cd){_0x32b00a=_0x32b00a-0x0;var _0x2e00ab=_0x7382[_0x32b00a];return _0x2e00ab;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}exports[_0x2738('0x12')]=function(_0x3c6810){var _0x1d0aca=this;return new Promise(function(_0x1e0f57,_0x42685a){return db[_0x2738('0x13')]['findAll']({'raw':_0x3c6810[_0x2738('0x14')]?_0x3c6810['options'][_0x2738('0x15')]===undefined?!![]:![]:!![],'where':_0x3c6810[_0x2738('0x14')]?_0x3c6810['options']['where']||null:null,'attributes':_0x3c6810[_0x2738('0x14')]?_0x3c6810[_0x2738('0x14')][_0x2738('0x16')]||null:null,'limit':_0x3c6810[_0x2738('0x14')]?_0x3c6810[_0x2738('0x14')][_0x2738('0x17')]||null:null,'include':_0x3c6810[_0x2738('0x14')]?_0x3c6810[_0x2738('0x14')][_0x2738('0x18')]?_[_0x2738('0x19')](_0x3c6810[_0x2738('0x14')]['include'],function(_0x347d10){return{'model':db[_0x347d10['model']],'as':_0x347d10['as'],'attributes':_0x347d10['attributes'],'include':_0x347d10[_0x2738('0x18')]?_[_0x2738('0x19')](_0x347d10[_0x2738('0x18')],function(_0x25c6e0){return{'model':db[_0x25c6e0[_0x2738('0x1a')]],'as':_0x25c6e0['as'],'attributes':_0x25c6e0[_0x2738('0x16')],'include':_0x25c6e0[_0x2738('0x18')]?_[_0x2738('0x19')](_0x25c6e0['include'],function(_0x24c8b9){return{'model':db[_0x24c8b9['model']],'as':_0x24c8b9['as'],'attributes':_0x24c8b9[_0x2738('0x16')]};}):[]};}):[]};}):[]:[]})[_0x2738('0x1b')](function(_0x513fb5){logger[_0x2738('0x8')](_0x2738('0x12'),_0x3c6810);logger['debug']('GetZohoAccount',_0x3c6810,JSON['stringify'](_0x513fb5));_0x1e0f57(_0x513fb5);})['catch'](function(_0x926abd){logger[_0x2738('0xd')](_0x2738('0x12'),_0x926abd[_0x2738('0xf')],_0x3c6810);_0x42685a(_0x1d0aca[_0x2738('0xd')](0x1f4,_0x926abd[_0x2738('0xf')]));});});};exports['ShowZohoAccount']=function(_0x351f46){var _0x57c313=this;return new Promise(function(_0x1a7395,_0x1bd1a0){return db[_0x2738('0x13')]['find']({'raw':_0x351f46[_0x2738('0x14')]?_0x351f46[_0x2738('0x14')][_0x2738('0x15')]===undefined?!![]:![]:!![],'where':_0x351f46[_0x2738('0x14')]?_0x351f46[_0x2738('0x14')]['where']||null:null,'attributes':_0x351f46[_0x2738('0x14')]?_0x351f46['options']['attributes']||null:null,'include':_0x351f46[_0x2738('0x14')]?_0x351f46[_0x2738('0x14')][_0x2738('0x18')]?_[_0x2738('0x19')](_0x351f46['options'][_0x2738('0x18')],function(_0x4013b2){return{'model':db[_0x4013b2[_0x2738('0x1a')]],'as':_0x4013b2['as'],'attributes':_0x4013b2[_0x2738('0x16')],'include':_0x4013b2[_0x2738('0x18')]?_['map'](_0x4013b2['include'],function(_0x151cdd){return{'model':db[_0x151cdd['model']],'as':_0x151cdd['as'],'attributes':_0x151cdd[_0x2738('0x16')],'include':_0x151cdd[_0x2738('0x18')]?_[_0x2738('0x19')](_0x151cdd[_0x2738('0x18')],function(_0x37de95){return{'model':db[_0x37de95[_0x2738('0x1a')]],'as':_0x37de95['as'],'attributes':_0x37de95[_0x2738('0x16')]};}):[]};}):[]};}):[]:[]})[_0x2738('0x1b')](function(_0x16b4f4){logger[_0x2738('0x8')](_0x2738('0x1c'),_0x351f46);logger[_0x2738('0xa')](_0x2738('0x1c'),_0x351f46,JSON[_0x2738('0x1d')](_0x16b4f4));_0x1a7395(_0x16b4f4);})[_0x2738('0x11')](function(_0x4956b6){logger[_0x2738('0xd')](_0x2738('0x1c'),_0x4956b6[_0x2738('0xf')],_0x351f46);_0x1bd1a0(_0x57c313[_0x2738('0xd')](0x1f4,_0x4956b6[_0x2738('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index bdf86a0..ecdad9e 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 _0x1773=['show','getFields','/:id/subjects','getSubjects','getDescriptions','post','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x130995,_0xbeee7e){var _0x20a119=function(_0x5abe72){while(--_0x5abe72){_0x130995['push'](_0x130995['shift']());}};_0x20a119(++_0xbeee7e);}(_0x1773,0x161));var _0x3177=function(_0x480032,_0x368cd8){_0x480032=_0x480032-0x0;var _0x28d998=_0x1773[_0x480032];return _0x28d998;};'use strict';var multer=require(_0x3177('0x0'));var util=require(_0x3177('0x1'));var path=require(_0x3177('0x2'));var timeout=require(_0x3177('0x3'));var express=require(_0x3177('0x4'));var router=express[_0x3177('0x5')]();var fs_extra=require(_0x3177('0x6'));var auth=require(_0x3177('0x7'));var interaction=require(_0x3177('0x8'));var config=require(_0x3177('0x9'));var controller=require(_0x3177('0xa'));router[_0x3177('0xb')]('/',auth[_0x3177('0xc')](),controller[_0x3177('0xd')]);router[_0x3177('0xb')](_0x3177('0xe'),auth[_0x3177('0xc')](),controller[_0x3177('0xf')]);router[_0x3177('0xb')]('/:id/fields',auth[_0x3177('0xc')](),controller[_0x3177('0x10')]);router[_0x3177('0xb')](_0x3177('0x11'),auth[_0x3177('0xc')](),controller[_0x3177('0x12')]);router[_0x3177('0xb')]('/:id/descriptions',auth[_0x3177('0xc')](),controller[_0x3177('0x13')]);router[_0x3177('0x14')]('/',auth[_0x3177('0xc')](),controller['create']);router['put']('/:id',auth[_0x3177('0xc')](),controller[_0x3177('0x15')]);router['delete'](_0x3177('0xe'),auth[_0x3177('0xc')](),controller[_0x3177('0x16')]);module['exports']=router; \ No newline at end of file +var _0x2e57=['getDescriptions','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x34d094,_0x9e339b){var _0x5472b1=function(_0x166163){while(--_0x166163){_0x34d094['push'](_0x34d094['shift']());}};_0x5472b1(++_0x9e339b);}(_0x2e57,0x16d));var _0x72e5=function(_0x286dfc,_0x273234){_0x286dfc=_0x286dfc-0x0;var _0x254ef9=_0x2e57[_0x286dfc];return _0x254ef9;};'use strict';var multer=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var path=require(_0x72e5('0x2'));var timeout=require(_0x72e5('0x3'));var express=require(_0x72e5('0x4'));var router=express[_0x72e5('0x5')]();var fs_extra=require(_0x72e5('0x6'));var auth=require(_0x72e5('0x7'));var interaction=require(_0x72e5('0x8'));var config=require(_0x72e5('0x9'));var controller=require('./intZohoConfiguration.controller');router[_0x72e5('0xa')]('/',auth['isAuthenticated'](),controller[_0x72e5('0xb')]);router[_0x72e5('0xa')](_0x72e5('0xc'),auth['isAuthenticated'](),controller[_0x72e5('0xd')]);router[_0x72e5('0xa')]('/:id/fields',auth[_0x72e5('0xe')](),controller[_0x72e5('0xf')]);router['get'](_0x72e5('0x10'),auth['isAuthenticated'](),controller[_0x72e5('0x11')]);router[_0x72e5('0xa')](_0x72e5('0x12'),auth['isAuthenticated'](),controller[_0x72e5('0x13')]);router[_0x72e5('0x14')]('/',auth['isAuthenticated'](),controller[_0x72e5('0x15')]);router['put'](_0x72e5('0xc'),auth[_0x72e5('0xe')](),controller['update']);router[_0x72e5('0x16')](_0x72e5('0xc'),auth['isAuthenticated'](),controller[_0x72e5('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9775956..073792b 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 _0x1f28=['contact_lead','sequelize','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x5ae820,_0x49cb50){var _0x1a70c2=function(_0x1fd2b7){while(--_0x1fd2b7){_0x5ae820['push'](_0x5ae820['shift']());}};_0x1a70c2(++_0x49cb50);}(_0x1f28,0x1b1));var _0x81f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1f28[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x81f2('0x0'));module[_0x81f2('0x1')]={'name':{'type':Sequelize[_0x81f2('0x2')]},'moduleCreate':{'type':Sequelize[_0x81f2('0x3')](_0x81f2('0x4'),_0x81f2('0x5'),_0x81f2('0x6')),'defaultValue':_0x81f2('0x4')},'moduleSearch':{'type':Sequelize[_0x81f2('0x3')]('contact_lead',_0x81f2('0x5'),_0x81f2('0x4')),'defaultValue':_0x81f2('0x7')},'description':{'type':Sequelize[_0x81f2('0x2')]}}; \ No newline at end of file +var _0x63a0=['contact_lead','sequelize','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x427847,_0x1dcdb2){var _0x2a8734=function(_0x3f6156){while(--_0x3f6156){_0x427847['push'](_0x427847['shift']());}};_0x2a8734(++_0x1dcdb2);}(_0x63a0,0xe1));var _0x063a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x63a0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x063a('0x0'));module[_0x063a('0x1')]={'name':{'type':Sequelize[_0x063a('0x2')]},'moduleCreate':{'type':Sequelize[_0x063a('0x3')](_0x063a('0x4'),_0x063a('0x5'),_0x063a('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x063a('0x3')](_0x063a('0x7'),_0x063a('0x5'),_0x063a('0x4')),'defaultValue':_0x063a('0x7')},'description':{'type':Sequelize[_0x063a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index b37ae3b..07b273a 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 _0x1b2d=['error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','order','pick','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy'];(function(_0xec8064,_0x4f9cec){var _0x46aa80=function(_0x1f9a96){while(--_0x1f9a96){_0xec8064['push'](_0xec8064['shift']());}};_0x46aa80(++_0x4f9cec);}(_0x1b2d,0x1b4));var _0xd1b2=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x1b2d[_0xabfec4];return _0x7bafa2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd1b2('0x0'));var jsonpatch=require(_0xd1b2('0x1'));var rp=require(_0xd1b2('0x2'));var moment=require(_0xd1b2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd1b2('0x4'));var util=require(_0xd1b2('0x5'));var path=require(_0xd1b2('0x6'));var sox=require('sox');var csv=require(_0xd1b2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1b2('0x8'));var _=require(_0xd1b2('0x9'));var squel=require(_0xd1b2('0xa'));var crypto=require(_0xd1b2('0xb'));var jsforce=require(_0xd1b2('0xc'));var deskjs=require(_0xd1b2('0xd'));var toCsv=require(_0xd1b2('0x7'));var querystring=require(_0xd1b2('0xe'));var Papa=require(_0xd1b2('0xf'));var Redis=require(_0xd1b2('0x10'));var authService=require(_0xd1b2('0x11'));var qs=require(_0xd1b2('0x12'));var as=require(_0xd1b2('0x13'));var hardwareService=require(_0xd1b2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd1b2('0x15'));var db=require(_0xd1b2('0x16'))['db'];function respondWithStatusCode(_0x53f4fa,_0x46d4e9){_0x46d4e9=_0x46d4e9||0xcc;return function(_0x4946c1){if(_0x4946c1){return _0x53f4fa[_0xd1b2('0x17')](_0x46d4e9);}return _0x53f4fa[_0xd1b2('0x18')](_0x46d4e9)[_0xd1b2('0x19')]();};}function respondWithResult(_0x56d400,_0x62f51e){_0x62f51e=_0x62f51e||0xc8;return function(_0x516d50){if(_0x516d50){return _0x56d400[_0xd1b2('0x18')](_0x62f51e)[_0xd1b2('0x1a')](_0x516d50);}};}function respondWithFilteredResult(_0x1655b1,_0x5d360d){return function(_0x1bc77c){if(_0x1bc77c){var _0x12142a=typeof _0x5d360d[_0xd1b2('0x1b')]===_0xd1b2('0x1c')&&typeof _0x5d360d['limit']==='undefined';var _0x415b87=_0x1bc77c[_0xd1b2('0x1d')];var _0x443808=_0x12142a?0x0:_0x5d360d[_0xd1b2('0x1b')];var _0x55339f=_0x12142a?_0x1bc77c['count']:_0x5d360d['offset']+_0x5d360d[_0xd1b2('0x1e')];var _0x3d3b23;if(_0x55339f>=_0x415b87){_0x55339f=_0x415b87;_0x3d3b23=0xc8;}else{_0x3d3b23=0xce;}_0x1655b1[_0xd1b2('0x18')](_0x3d3b23);return _0x1655b1['set'](_0xd1b2('0x1f'),_0x443808+'-'+_0x55339f+'/'+_0x415b87)[_0xd1b2('0x1a')](_0x1bc77c);}return null;};}function patchUpdates(_0x3d404d){return function(_0x14614e){try{jsonpatch[_0xd1b2('0x20')](_0x14614e,_0x3d404d,!![]);}catch(_0x2019b6){return BPromise[_0xd1b2('0x21')](_0x2019b6);}return _0x14614e[_0xd1b2('0x22')]();};}function saveUpdates(_0x148d70,_0x9f5fae){return function(_0x1d6ee7){if(_0x1d6ee7){return _0x1d6ee7[_0xd1b2('0x23')](_0x148d70)[_0xd1b2('0x24')](function(_0x324f33){return _0x324f33;});}return null;};}function removeEntity(_0x35b86e,_0x42aac5){return function(_0x318ac2){if(_0x318ac2){return _0x318ac2[_0xd1b2('0x25')]()[_0xd1b2('0x24')](function(){_0x35b86e[_0xd1b2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f5d3,_0x34bdab){return function(_0x384e1f){if(!_0x384e1f){_0x18f5d3[_0xd1b2('0x17')](0x194);}return _0x384e1f;};}function handleError(_0x4f2cfa,_0xe2d749){_0xe2d749=_0xe2d749||0x1f4;return function(_0x34b1ab){logger[_0xd1b2('0x26')](_0x34b1ab['stack']);if(_0x34b1ab[_0xd1b2('0x27')]){delete _0x34b1ab[_0xd1b2('0x27')];}_0x4f2cfa[_0xd1b2('0x18')](_0xe2d749)[_0xd1b2('0x28')](_0x34b1ab);};}exports[_0xd1b2('0x29')]=function(_0x460937,_0x30ea45){var _0x4c9996={},_0x15423d={},_0x45b6bb={'count':0x0,'rows':[]};var _0x405555=_[_0xd1b2('0x2a')](db[_0xd1b2('0x2b')][_0xd1b2('0x2c')],function(_0x26c36d){return{'name':_0x26c36d[_0xd1b2('0x2d')],'type':_0x26c36d['type']['key']};});_0x15423d[_0xd1b2('0x2e')]=_['map'](_0x405555,_0xd1b2('0x27'));_0x15423d[_0xd1b2('0x2f')]=_[_0xd1b2('0x30')](_0x460937['query']);_0x15423d[_0xd1b2('0x31')]=_[_0xd1b2('0x32')](_0x15423d[_0xd1b2('0x2e')],_0x15423d[_0xd1b2('0x2f')]);_0x4c9996[_0xd1b2('0x33')]=_[_0xd1b2('0x32')](_0x15423d['model'],qs[_0xd1b2('0x34')](_0x460937['query'][_0xd1b2('0x34')]));_0x4c9996['attributes']=_0x4c9996[_0xd1b2('0x33')]['length']?_0x4c9996[_0xd1b2('0x33')]:_0x15423d[_0xd1b2('0x2e')];if(!_0x460937[_0xd1b2('0x2f')]['hasOwnProperty'](_0xd1b2('0x35'))){_0x4c9996['limit']=qs[_0xd1b2('0x1e')](_0x460937[_0xd1b2('0x2f')][_0xd1b2('0x1e')]);_0x4c9996[_0xd1b2('0x1b')]=qs['offset'](_0x460937[_0xd1b2('0x2f')][_0xd1b2('0x1b')]);}_0x4c9996['order']=qs[_0xd1b2('0x36')](_0x460937['query'][_0xd1b2('0x36')]);_0x4c9996[_0xd1b2('0x37')]=qs[_0xd1b2('0x31')](_['pick'](_0x460937[_0xd1b2('0x2f')],_0x15423d[_0xd1b2('0x31')]),_0x405555);if(_0x460937[_0xd1b2('0x2f')][_0xd1b2('0x38')]){_0x4c9996[_0xd1b2('0x37')]=_['merge'](_0x4c9996[_0xd1b2('0x37')],{'$or':_[_0xd1b2('0x2a')](_0x405555,function(_0x46d12c){if(_0x46d12c[_0xd1b2('0x39')]!=='VIRTUAL'){var _0x2db816={};_0x2db816[_0x46d12c['name']]={'$like':'%'+_0x460937['query'][_0xd1b2('0x38')]+'%'};return _0x2db816;}})});}_0x4c9996=_[_0xd1b2('0x3a')]({},_0x4c9996,_0x460937[_0xd1b2('0x3b')]);var _0x44ea14={'where':_0x4c9996['where']};return db[_0xd1b2('0x2b')][_0xd1b2('0x1d')](_0x44ea14)[_0xd1b2('0x24')](function(_0x2eac94){_0x45b6bb[_0xd1b2('0x1d')]=_0x2eac94;if(_0x460937[_0xd1b2('0x2f')][_0xd1b2('0x3c')]){_0x4c9996[_0xd1b2('0x3d')]=[{'all':!![]}];}return db[_0xd1b2('0x2b')][_0xd1b2('0x3e')](_0x4c9996);})[_0xd1b2('0x24')](function(_0x395d29){_0x45b6bb[_0xd1b2('0x3f')]=_0x395d29;return _0x45b6bb;})[_0xd1b2('0x24')](respondWithFilteredResult(_0x30ea45,_0x4c9996))[_0xd1b2('0x40')](handleError(_0x30ea45,null));};exports[_0xd1b2('0x41')]=function(_0x29d4f8,_0x2d23c9){var _0x38fabd={'raw':![],'where':{'id':_0x29d4f8[_0xd1b2('0x42')]['id']}},_0x43bd18={};_0x43bd18['model']=_[_0xd1b2('0x30')](db['ZohoConfiguration'][_0xd1b2('0x2c')]);_0x43bd18[_0xd1b2('0x2f')]=_[_0xd1b2('0x30')](_0x29d4f8[_0xd1b2('0x2f')]);_0x43bd18[_0xd1b2('0x31')]=_[_0xd1b2('0x32')](_0x43bd18['model'],_0x43bd18[_0xd1b2('0x2f')]);_0x38fabd[_0xd1b2('0x33')]=_[_0xd1b2('0x32')](_0x43bd18['model'],qs[_0xd1b2('0x34')](_0x29d4f8[_0xd1b2('0x2f')][_0xd1b2('0x34')]));_0x38fabd['attributes']=_0x38fabd[_0xd1b2('0x33')][_0xd1b2('0x43')]?_0x38fabd[_0xd1b2('0x33')]:_0x43bd18[_0xd1b2('0x2e')];if(_0x29d4f8[_0xd1b2('0x2f')][_0xd1b2('0x3c')]){_0x38fabd[_0xd1b2('0x3d')]=[{'all':!![]}];}_0x38fabd=_[_0xd1b2('0x3a')]({},_0x38fabd,_0x29d4f8[_0xd1b2('0x3b')]);return db[_0xd1b2('0x2b')][_0xd1b2('0x44')](_0x38fabd)[_0xd1b2('0x24')](handleEntityNotFound(_0x2d23c9,null))['then'](respondWithResult(_0x2d23c9,null))[_0xd1b2('0x40')](handleError(_0x2d23c9,null));};exports[_0xd1b2('0x45')]=function(_0x3ccbe8,_0x5c63ce){return db[_0xd1b2('0x2b')]['create'](_0x3ccbe8['body'],{})[_0xd1b2('0x24')](respondWithResult(_0x5c63ce,0xc9))[_0xd1b2('0x40')](handleError(_0x5c63ce,null));};exports[_0xd1b2('0x23')]=function(_0x362fa6,_0x152af5){if(_0x362fa6[_0xd1b2('0x46')]['id']){delete _0x362fa6[_0xd1b2('0x46')]['id'];}return db['ZohoConfiguration'][_0xd1b2('0x44')]({'where':{'id':_0x362fa6[_0xd1b2('0x42')]['id']}})[_0xd1b2('0x24')](handleEntityNotFound(_0x152af5,null))[_0xd1b2('0x24')](saveUpdates(_0x362fa6[_0xd1b2('0x46')],null))[_0xd1b2('0x24')](respondWithResult(_0x152af5,null))[_0xd1b2('0x40')](handleError(_0x152af5,null));};exports[_0xd1b2('0x25')]=function(_0x286a7a,_0x5cf121){return db['ZohoConfiguration']['find']({'where':{'id':_0x286a7a[_0xd1b2('0x42')]['id']}})[_0xd1b2('0x24')](handleEntityNotFound(_0x5cf121,null))[_0xd1b2('0x24')](removeEntity(_0x5cf121,null))[_0xd1b2('0x40')](handleError(_0x5cf121,null));};exports[_0xd1b2('0x47')]=function(_0xccaa07,_0x4a436c,_0x51ba7d){var _0x413fd8={};var _0x2e4edb={};var _0x5c84a4;var _0xf8f653;return db[_0xd1b2('0x2b')][_0xd1b2('0x48')]({'where':{'id':_0xccaa07['params']['id']}})[_0xd1b2('0x24')](handleEntityNotFound(_0x4a436c,null))[_0xd1b2('0x24')](function(_0x4beca0){if(_0x4beca0){_0x5c84a4=_0x4beca0;_0x2e4edb[_0xd1b2('0x2e')]=_[_0xd1b2('0x30')](db[_0xd1b2('0x49')][_0xd1b2('0x2c')]);_0x2e4edb['query']=_[_0xd1b2('0x30')](_0xccaa07[_0xd1b2('0x2f')]);_0x2e4edb[_0xd1b2('0x31')]=_[_0xd1b2('0x32')](_0x2e4edb[_0xd1b2('0x2e')],_0x2e4edb[_0xd1b2('0x2f')]);_0x413fd8[_0xd1b2('0x33')]=_[_0xd1b2('0x32')](_0x2e4edb[_0xd1b2('0x2e')],qs[_0xd1b2('0x34')](_0xccaa07['query'][_0xd1b2('0x34')]));_0x413fd8[_0xd1b2('0x33')]=_0x413fd8[_0xd1b2('0x33')][_0xd1b2('0x43')]?_0x413fd8[_0xd1b2('0x33')]:_0x2e4edb['model'];_0x413fd8['order']=qs[_0xd1b2('0x36')](_0xccaa07[_0xd1b2('0x2f')][_0xd1b2('0x36')]);_0x413fd8[_0xd1b2('0x37')]=qs[_0xd1b2('0x31')](_['pick'](_0xccaa07[_0xd1b2('0x2f')],_0x2e4edb['filters']));if(_0xccaa07[_0xd1b2('0x2f')]['filter']){_0x413fd8[_0xd1b2('0x37')]=_[_0xd1b2('0x3a')](_0x413fd8[_0xd1b2('0x37')],{'$or':_[_0xd1b2('0x2a')](_0x413fd8[_0xd1b2('0x33')],function(_0x5f4391){var _0x3557e6={};_0x3557e6[_0x5f4391]={'$like':'%'+_0xccaa07[_0xd1b2('0x2f')][_0xd1b2('0x38')]+'%'};return _0x3557e6;})});}_0x413fd8=_['merge']({},_0x413fd8,_0xccaa07[_0xd1b2('0x3b')]);return _0x5c84a4[_0xd1b2('0x47')](_0x413fd8);}})['then'](function(_0x2c4c51){if(_0x2c4c51){_0xf8f653=_0x2c4c51[_0xd1b2('0x43')];if(!_0xccaa07[_0xd1b2('0x2f')][_0xd1b2('0x4a')]('nolimit')){_0x413fd8[_0xd1b2('0x1e')]=qs['limit'](_0xccaa07[_0xd1b2('0x2f')][_0xd1b2('0x1e')]);_0x413fd8[_0xd1b2('0x1b')]=qs['offset'](_0xccaa07[_0xd1b2('0x2f')][_0xd1b2('0x1b')]);}return _0x5c84a4[_0xd1b2('0x47')](_0x413fd8);}})['then'](function(_0x20c5c2){if(_0x20c5c2){return _0x20c5c2?{'count':_0xf8f653,'rows':_0x20c5c2}:null;}})['then'](respondWithResult(_0x4a436c,null))[_0xd1b2('0x40')](handleError(_0x4a436c,null));};exports[_0xd1b2('0x4b')]=function(_0x3ef81d,_0x131122,_0x12fb5b){var _0x4f2ada={};var _0x12e360={};var _0x452bc8;var _0x1d4ad9;return db[_0xd1b2('0x2b')][_0xd1b2('0x48')]({'where':{'id':_0x3ef81d[_0xd1b2('0x42')]['id']}})['then'](handleEntityNotFound(_0x131122,null))['then'](function(_0x3c4082){if(_0x3c4082){_0x452bc8=_0x3c4082;_0x12e360[_0xd1b2('0x2e')]=_[_0xd1b2('0x30')](db['ZohoField'][_0xd1b2('0x2c')]);_0x12e360[_0xd1b2('0x2f')]=_[_0xd1b2('0x30')](_0x3ef81d[_0xd1b2('0x2f')]);_0x12e360['filters']=_[_0xd1b2('0x32')](_0x12e360['model'],_0x12e360['query']);_0x4f2ada[_0xd1b2('0x33')]=_[_0xd1b2('0x32')](_0x12e360[_0xd1b2('0x2e')],qs[_0xd1b2('0x34')](_0x3ef81d[_0xd1b2('0x2f')][_0xd1b2('0x34')]));_0x4f2ada[_0xd1b2('0x33')]=_0x4f2ada[_0xd1b2('0x33')][_0xd1b2('0x43')]?_0x4f2ada[_0xd1b2('0x33')]:_0x12e360[_0xd1b2('0x2e')];_0x4f2ada[_0xd1b2('0x4c')]=qs[_0xd1b2('0x36')](_0x3ef81d['query'][_0xd1b2('0x36')]);_0x4f2ada['where']=qs[_0xd1b2('0x31')](_[_0xd1b2('0x4d')](_0x3ef81d[_0xd1b2('0x2f')],_0x12e360[_0xd1b2('0x31')]));if(_0x3ef81d['query']['filter']){_0x4f2ada[_0xd1b2('0x37')]=_[_0xd1b2('0x3a')](_0x4f2ada['where'],{'$or':_[_0xd1b2('0x2a')](_0x4f2ada[_0xd1b2('0x33')],function(_0x290f49){var _0x4b95a9={};_0x4b95a9[_0x290f49]={'$like':'%'+_0x3ef81d[_0xd1b2('0x2f')][_0xd1b2('0x38')]+'%'};return _0x4b95a9;})});}_0x4f2ada=_[_0xd1b2('0x3a')]({},_0x4f2ada,_0x3ef81d[_0xd1b2('0x3b')]);return _0x452bc8['getSubjects'](_0x4f2ada);}})['then'](function(_0x400c63){if(_0x400c63){_0x1d4ad9=_0x400c63['length'];if(!_0x3ef81d[_0xd1b2('0x2f')][_0xd1b2('0x4a')](_0xd1b2('0x35'))){_0x4f2ada[_0xd1b2('0x1e')]=qs[_0xd1b2('0x1e')](_0x3ef81d[_0xd1b2('0x2f')][_0xd1b2('0x1e')]);_0x4f2ada[_0xd1b2('0x1b')]=qs['offset'](_0x3ef81d[_0xd1b2('0x2f')]['offset']);}return _0x452bc8[_0xd1b2('0x4b')](_0x4f2ada);}})[_0xd1b2('0x24')](function(_0x108b6a){if(_0x108b6a){return _0x108b6a?{'count':_0x1d4ad9,'rows':_0x108b6a}:null;}})[_0xd1b2('0x24')](respondWithResult(_0x131122,null))[_0xd1b2('0x40')](handleError(_0x131122,null));};exports[_0xd1b2('0x4e')]=function(_0xa1c32a,_0x4399c6,_0x220ff5){var _0x3e6d46={};var _0xe344f9={};var _0x23ca43;var _0x2b3b25;return db[_0xd1b2('0x2b')][_0xd1b2('0x48')]({'where':{'id':_0xa1c32a[_0xd1b2('0x42')]['id']}})[_0xd1b2('0x24')](handleEntityNotFound(_0x4399c6,null))[_0xd1b2('0x24')](function(_0x49e1c1){if(_0x49e1c1){_0x23ca43=_0x49e1c1;_0xe344f9[_0xd1b2('0x2e')]=_[_0xd1b2('0x30')](db[_0xd1b2('0x49')]['rawAttributes']);_0xe344f9[_0xd1b2('0x2f')]=_['keys'](_0xa1c32a[_0xd1b2('0x2f')]);_0xe344f9[_0xd1b2('0x31')]=_[_0xd1b2('0x32')](_0xe344f9['model'],_0xe344f9[_0xd1b2('0x2f')]);_0x3e6d46[_0xd1b2('0x33')]=_['intersection'](_0xe344f9['model'],qs[_0xd1b2('0x34')](_0xa1c32a['query'][_0xd1b2('0x34')]));_0x3e6d46[_0xd1b2('0x33')]=_0x3e6d46[_0xd1b2('0x33')][_0xd1b2('0x43')]?_0x3e6d46[_0xd1b2('0x33')]:_0xe344f9[_0xd1b2('0x2e')];_0x3e6d46[_0xd1b2('0x4c')]=qs[_0xd1b2('0x36')](_0xa1c32a[_0xd1b2('0x2f')][_0xd1b2('0x36')]);_0x3e6d46['where']=qs[_0xd1b2('0x31')](_[_0xd1b2('0x4d')](_0xa1c32a[_0xd1b2('0x2f')],_0xe344f9[_0xd1b2('0x31')]));if(_0xa1c32a[_0xd1b2('0x2f')]['filter']){_0x3e6d46[_0xd1b2('0x37')]=_['merge'](_0x3e6d46[_0xd1b2('0x37')],{'$or':_[_0xd1b2('0x2a')](_0x3e6d46[_0xd1b2('0x33')],function(_0x38f224){var _0x282fd7={};_0x282fd7[_0x38f224]={'$like':'%'+_0xa1c32a[_0xd1b2('0x2f')][_0xd1b2('0x38')]+'%'};return _0x282fd7;})});}_0x3e6d46=_[_0xd1b2('0x3a')]({},_0x3e6d46,_0xa1c32a['options']);return _0x23ca43[_0xd1b2('0x4e')](_0x3e6d46);}})[_0xd1b2('0x24')](function(_0x117178){if(_0x117178){_0x2b3b25=_0x117178[_0xd1b2('0x43')];if(!_0xa1c32a[_0xd1b2('0x2f')][_0xd1b2('0x4a')]('nolimit')){_0x3e6d46[_0xd1b2('0x1e')]=qs[_0xd1b2('0x1e')](_0xa1c32a['query'][_0xd1b2('0x1e')]);_0x3e6d46[_0xd1b2('0x1b')]=qs['offset'](_0xa1c32a[_0xd1b2('0x2f')][_0xd1b2('0x1b')]);}return _0x23ca43[_0xd1b2('0x4e')](_0x3e6d46);}})[_0xd1b2('0x24')](function(_0x51fd29){if(_0x51fd29){return _0x51fd29?{'count':_0x2b3b25,'rows':_0x51fd29}:null;}})[_0xd1b2('0x24')](respondWithResult(_0x4399c6,null))[_0xd1b2('0x40')](handleError(_0x4399c6,null));}; \ No newline at end of file +var _0xa176=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','keys','length','options','find','create','body','catch','getFields','findOne','params','order','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x195271,_0x2ec2d4){var _0x23b7a5=function(_0x5d5a20){while(--_0x5d5a20){_0x195271['push'](_0x195271['shift']());}};_0x23b7a5(++_0x2ec2d4);}(_0xa176,0x90));var _0x6a17=function(_0x40009c,_0xace8b3){_0x40009c=_0x40009c-0x0;var _0x1f06e1=_0xa176[_0x40009c];return _0x1f06e1;};'use strict';var emlformat=require(_0x6a17('0x0'));var rimraf=require(_0x6a17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a17('0x2'));var rp=require(_0x6a17('0x3'));var moment=require('moment');var BPromise=require(_0x6a17('0x4'));var Mustache=require(_0x6a17('0x5'));var util=require(_0x6a17('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6a17('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a17('0x8'));var _=require(_0x6a17('0x9'));var squel=require(_0x6a17('0xa'));var crypto=require(_0x6a17('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6a17('0x7'));var querystring=require('querystring');var Papa=require(_0x6a17('0xc'));var Redis=require(_0x6a17('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6a17('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a17('0xf'));var logger=require('../../config/logger')(_0x6a17('0x10'));var utils=require(_0x6a17('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6a17('0x12'))['db'];function respondWithStatusCode(_0x5492d3,_0x3aa576){_0x3aa576=_0x3aa576||0xcc;return function(_0x175762){if(_0x175762){return _0x5492d3['sendStatus'](_0x3aa576);}return _0x5492d3[_0x6a17('0x13')](_0x3aa576)[_0x6a17('0x14')]();};}function respondWithResult(_0x1db53e,_0x5482c3){_0x5482c3=_0x5482c3||0xc8;return function(_0x5c62d3){if(_0x5c62d3){return _0x1db53e[_0x6a17('0x13')](_0x5482c3)[_0x6a17('0x15')](_0x5c62d3);}};}function respondWithFilteredResult(_0x2a961f,_0xd911c3){return function(_0x3d19ec){if(_0x3d19ec){var _0x48b979=typeof _0xd911c3[_0x6a17('0x16')]==='undefined'&&typeof _0xd911c3['limit']===_0x6a17('0x17');var _0x5d2308=_0x3d19ec[_0x6a17('0x18')];var _0x326589=_0x48b979?0x0:_0xd911c3['offset'];var _0x20fb47=_0x48b979?_0x3d19ec[_0x6a17('0x18')]:_0xd911c3[_0x6a17('0x16')]+_0xd911c3[_0x6a17('0x19')];var _0x5b49a4;if(_0x20fb47>=_0x5d2308){_0x20fb47=_0x5d2308;_0x5b49a4=0xc8;}else{_0x5b49a4=0xce;}_0x2a961f[_0x6a17('0x13')](_0x5b49a4);return _0x2a961f[_0x6a17('0x1a')](_0x6a17('0x1b'),_0x326589+'-'+_0x20fb47+'/'+_0x5d2308)[_0x6a17('0x15')](_0x3d19ec);}return null;};}function patchUpdates(_0x21c3b1){return function(_0x12326c){try{jsonpatch[_0x6a17('0x1c')](_0x12326c,_0x21c3b1,!![]);}catch(_0x1d2e9c){return BPromise[_0x6a17('0x1d')](_0x1d2e9c);}return _0x12326c[_0x6a17('0x1e')]();};}function saveUpdates(_0x224dc3,_0x54dfea){return function(_0x3ad5d4){if(_0x3ad5d4){return _0x3ad5d4[_0x6a17('0x1f')](_0x224dc3)[_0x6a17('0x20')](function(_0x5ecf9f){return _0x5ecf9f;});}return null;};}function removeEntity(_0x26cb2d,_0x310c2c){return function(_0xabb7bc){if(_0xabb7bc){return _0xabb7bc[_0x6a17('0x21')]()[_0x6a17('0x20')](function(){_0x26cb2d[_0x6a17('0x13')](0xcc)[_0x6a17('0x14')]();});}};}function handleEntityNotFound(_0x303533,_0x4c63fe){return function(_0x412746){if(!_0x412746){_0x303533[_0x6a17('0x22')](0x194);}return _0x412746;};}function handleError(_0xd57725,_0x54ccfe){_0x54ccfe=_0x54ccfe||0x1f4;return function(_0x16a08f){logger[_0x6a17('0x23')](_0x16a08f[_0x6a17('0x24')]);if(_0x16a08f[_0x6a17('0x25')]){delete _0x16a08f[_0x6a17('0x25')];}_0xd57725[_0x6a17('0x13')](_0x54ccfe)[_0x6a17('0x26')](_0x16a08f);};}exports[_0x6a17('0x27')]=function(_0x38cd1b,_0x24fcf3){var _0x3438c3={},_0x311f8a={},_0x2a161e={'count':0x0,'rows':[]};var _0x51f0f3=_[_0x6a17('0x28')](db[_0x6a17('0x29')][_0x6a17('0x2a')],function(_0x565654){return{'name':_0x565654[_0x6a17('0x2b')],'type':_0x565654[_0x6a17('0x2c')][_0x6a17('0x2d')]};});_0x311f8a[_0x6a17('0x2e')]=_[_0x6a17('0x28')](_0x51f0f3,'name');_0x311f8a['query']=_['keys'](_0x38cd1b[_0x6a17('0x2f')]);_0x311f8a[_0x6a17('0x30')]=_[_0x6a17('0x31')](_0x311f8a[_0x6a17('0x2e')],_0x311f8a[_0x6a17('0x2f')]);_0x3438c3[_0x6a17('0x32')]=_[_0x6a17('0x31')](_0x311f8a[_0x6a17('0x2e')],qs[_0x6a17('0x33')](_0x38cd1b[_0x6a17('0x2f')][_0x6a17('0x33')]));_0x3438c3[_0x6a17('0x32')]=_0x3438c3[_0x6a17('0x32')]['length']?_0x3438c3[_0x6a17('0x32')]:_0x311f8a[_0x6a17('0x2e')];if(!_0x38cd1b[_0x6a17('0x2f')][_0x6a17('0x34')](_0x6a17('0x35'))){_0x3438c3[_0x6a17('0x19')]=qs[_0x6a17('0x19')](_0x38cd1b['query'][_0x6a17('0x19')]);_0x3438c3[_0x6a17('0x16')]=qs['offset'](_0x38cd1b[_0x6a17('0x2f')][_0x6a17('0x16')]);}_0x3438c3['order']=qs[_0x6a17('0x36')](_0x38cd1b['query'][_0x6a17('0x36')]);_0x3438c3[_0x6a17('0x37')]=qs[_0x6a17('0x30')](_[_0x6a17('0x38')](_0x38cd1b[_0x6a17('0x2f')],_0x311f8a[_0x6a17('0x30')]),_0x51f0f3);if(_0x38cd1b[_0x6a17('0x2f')][_0x6a17('0x39')]){_0x3438c3[_0x6a17('0x37')]=_[_0x6a17('0x3a')](_0x3438c3[_0x6a17('0x37')],{'$or':_['map'](_0x51f0f3,function(_0x1c22a7){if(_0x1c22a7[_0x6a17('0x2c')]!==_0x6a17('0x3b')){var _0x19932c={};_0x19932c[_0x1c22a7[_0x6a17('0x25')]]={'$like':'%'+_0x38cd1b['query'][_0x6a17('0x39')]+'%'};return _0x19932c;}})});}_0x3438c3=_['merge']({},_0x3438c3,_0x38cd1b['options']);var _0x3686eb={'where':_0x3438c3[_0x6a17('0x37')]};return db[_0x6a17('0x29')][_0x6a17('0x18')](_0x3686eb)[_0x6a17('0x20')](function(_0x4593bb){_0x2a161e['count']=_0x4593bb;if(_0x38cd1b[_0x6a17('0x2f')][_0x6a17('0x3c')]){_0x3438c3[_0x6a17('0x3d')]=[{'all':!![]}];}return db[_0x6a17('0x29')]['findAll'](_0x3438c3);})[_0x6a17('0x20')](function(_0xefcfcf){_0x2a161e[_0x6a17('0x3e')]=_0xefcfcf;return _0x2a161e;})[_0x6a17('0x20')](respondWithFilteredResult(_0x24fcf3,_0x3438c3))['catch'](handleError(_0x24fcf3,null));};exports[_0x6a17('0x3f')]=function(_0x44dbe4,_0x471b5d){var _0x466138={'raw':![],'where':{'id':_0x44dbe4['params']['id']}},_0x1d2897={};_0x1d2897[_0x6a17('0x2e')]=_[_0x6a17('0x40')](db['ZohoConfiguration'][_0x6a17('0x2a')]);_0x1d2897[_0x6a17('0x2f')]=_[_0x6a17('0x40')](_0x44dbe4['query']);_0x1d2897[_0x6a17('0x30')]=_[_0x6a17('0x31')](_0x1d2897[_0x6a17('0x2e')],_0x1d2897[_0x6a17('0x2f')]);_0x466138['attributes']=_[_0x6a17('0x31')](_0x1d2897[_0x6a17('0x2e')],qs[_0x6a17('0x33')](_0x44dbe4[_0x6a17('0x2f')]['fields']));_0x466138['attributes']=_0x466138[_0x6a17('0x32')][_0x6a17('0x41')]?_0x466138[_0x6a17('0x32')]:_0x1d2897[_0x6a17('0x2e')];if(_0x44dbe4[_0x6a17('0x2f')][_0x6a17('0x3c')]){_0x466138[_0x6a17('0x3d')]=[{'all':!![]}];}_0x466138=_[_0x6a17('0x3a')]({},_0x466138,_0x44dbe4[_0x6a17('0x42')]);return db['ZohoConfiguration'][_0x6a17('0x43')](_0x466138)['then'](handleEntityNotFound(_0x471b5d,null))[_0x6a17('0x20')](respondWithResult(_0x471b5d,null))['catch'](handleError(_0x471b5d,null));};exports['create']=function(_0x166660,_0x19da30){return db['ZohoConfiguration'][_0x6a17('0x44')](_0x166660['body'],{})[_0x6a17('0x20')](respondWithResult(_0x19da30,0xc9))['catch'](handleError(_0x19da30,null));};exports[_0x6a17('0x1f')]=function(_0x23c12e,_0x4a579f){if(_0x23c12e[_0x6a17('0x45')]['id']){delete _0x23c12e[_0x6a17('0x45')]['id'];}return db[_0x6a17('0x29')][_0x6a17('0x43')]({'where':{'id':_0x23c12e['params']['id']}})[_0x6a17('0x20')](handleEntityNotFound(_0x4a579f,null))['then'](saveUpdates(_0x23c12e[_0x6a17('0x45')],null))[_0x6a17('0x20')](respondWithResult(_0x4a579f,null))[_0x6a17('0x46')](handleError(_0x4a579f,null));};exports[_0x6a17('0x21')]=function(_0x200006,_0x560a34){return db[_0x6a17('0x29')][_0x6a17('0x43')]({'where':{'id':_0x200006['params']['id']}})[_0x6a17('0x20')](handleEntityNotFound(_0x560a34,null))[_0x6a17('0x20')](removeEntity(_0x560a34,null))['catch'](handleError(_0x560a34,null));};exports[_0x6a17('0x47')]=function(_0x27c1a1,_0x367364,_0x562277){var _0x1d302b={};var _0x44f758={};var _0x16c895;var _0x341dbb;return db['ZohoConfiguration'][_0x6a17('0x48')]({'where':{'id':_0x27c1a1[_0x6a17('0x49')]['id']}})[_0x6a17('0x20')](handleEntityNotFound(_0x367364,null))[_0x6a17('0x20')](function(_0xaf3b4){if(_0xaf3b4){_0x16c895=_0xaf3b4;_0x44f758[_0x6a17('0x2e')]=_[_0x6a17('0x40')](db['ZohoField'][_0x6a17('0x2a')]);_0x44f758['query']=_[_0x6a17('0x40')](_0x27c1a1['query']);_0x44f758[_0x6a17('0x30')]=_[_0x6a17('0x31')](_0x44f758['model'],_0x44f758[_0x6a17('0x2f')]);_0x1d302b[_0x6a17('0x32')]=_[_0x6a17('0x31')](_0x44f758[_0x6a17('0x2e')],qs['fields'](_0x27c1a1['query'][_0x6a17('0x33')]));_0x1d302b[_0x6a17('0x32')]=_0x1d302b[_0x6a17('0x32')]['length']?_0x1d302b['attributes']:_0x44f758[_0x6a17('0x2e')];_0x1d302b[_0x6a17('0x4a')]=qs[_0x6a17('0x36')](_0x27c1a1[_0x6a17('0x2f')][_0x6a17('0x36')]);_0x1d302b['where']=qs[_0x6a17('0x30')](_[_0x6a17('0x38')](_0x27c1a1[_0x6a17('0x2f')],_0x44f758[_0x6a17('0x30')]));if(_0x27c1a1[_0x6a17('0x2f')][_0x6a17('0x39')]){_0x1d302b[_0x6a17('0x37')]=_[_0x6a17('0x3a')](_0x1d302b['where'],{'$or':_[_0x6a17('0x28')](_0x1d302b[_0x6a17('0x32')],function(_0x4ab91f){var _0x23650d={};_0x23650d[_0x4ab91f]={'$like':'%'+_0x27c1a1[_0x6a17('0x2f')][_0x6a17('0x39')]+'%'};return _0x23650d;})});}_0x1d302b=_[_0x6a17('0x3a')]({},_0x1d302b,_0x27c1a1[_0x6a17('0x42')]);return _0x16c895['getFields'](_0x1d302b);}})[_0x6a17('0x20')](function(_0x20cae7){if(_0x20cae7){_0x341dbb=_0x20cae7[_0x6a17('0x41')];if(!_0x27c1a1[_0x6a17('0x2f')][_0x6a17('0x34')](_0x6a17('0x35'))){_0x1d302b[_0x6a17('0x19')]=qs[_0x6a17('0x19')](_0x27c1a1['query']['limit']);_0x1d302b[_0x6a17('0x16')]=qs[_0x6a17('0x16')](_0x27c1a1[_0x6a17('0x2f')]['offset']);}return _0x16c895[_0x6a17('0x47')](_0x1d302b);}})[_0x6a17('0x20')](function(_0x1f3323){if(_0x1f3323){return _0x1f3323?{'count':_0x341dbb,'rows':_0x1f3323}:null;}})[_0x6a17('0x20')](respondWithResult(_0x367364,null))['catch'](handleError(_0x367364,null));};exports[_0x6a17('0x4b')]=function(_0x194fc7,_0x45c826,_0x32662b){var _0x5b6bde={};var _0x53ca12={};var _0x316a94;var _0x35a7a8;return db[_0x6a17('0x29')]['findOne']({'where':{'id':_0x194fc7['params']['id']}})[_0x6a17('0x20')](handleEntityNotFound(_0x45c826,null))['then'](function(_0x1d45e1){if(_0x1d45e1){_0x316a94=_0x1d45e1;_0x53ca12[_0x6a17('0x2e')]=_[_0x6a17('0x40')](db[_0x6a17('0x4c')][_0x6a17('0x2a')]);_0x53ca12[_0x6a17('0x2f')]=_[_0x6a17('0x40')](_0x194fc7[_0x6a17('0x2f')]);_0x53ca12[_0x6a17('0x30')]=_['intersection'](_0x53ca12['model'],_0x53ca12[_0x6a17('0x2f')]);_0x5b6bde[_0x6a17('0x32')]=_[_0x6a17('0x31')](_0x53ca12[_0x6a17('0x2e')],qs[_0x6a17('0x33')](_0x194fc7[_0x6a17('0x2f')][_0x6a17('0x33')]));_0x5b6bde[_0x6a17('0x32')]=_0x5b6bde[_0x6a17('0x32')]['length']?_0x5b6bde[_0x6a17('0x32')]:_0x53ca12['model'];_0x5b6bde[_0x6a17('0x4a')]=qs[_0x6a17('0x36')](_0x194fc7[_0x6a17('0x2f')][_0x6a17('0x36')]);_0x5b6bde[_0x6a17('0x37')]=qs[_0x6a17('0x30')](_[_0x6a17('0x38')](_0x194fc7[_0x6a17('0x2f')],_0x53ca12[_0x6a17('0x30')]));if(_0x194fc7[_0x6a17('0x2f')][_0x6a17('0x39')]){_0x5b6bde['where']=_[_0x6a17('0x3a')](_0x5b6bde[_0x6a17('0x37')],{'$or':_[_0x6a17('0x28')](_0x5b6bde['attributes'],function(_0x12a995){var _0x4fc698={};_0x4fc698[_0x12a995]={'$like':'%'+_0x194fc7[_0x6a17('0x2f')][_0x6a17('0x39')]+'%'};return _0x4fc698;})});}_0x5b6bde=_['merge']({},_0x5b6bde,_0x194fc7[_0x6a17('0x42')]);return _0x316a94['getSubjects'](_0x5b6bde);}})[_0x6a17('0x20')](function(_0x2cf0cb){if(_0x2cf0cb){_0x35a7a8=_0x2cf0cb[_0x6a17('0x41')];if(!_0x194fc7[_0x6a17('0x2f')][_0x6a17('0x34')]('nolimit')){_0x5b6bde['limit']=qs[_0x6a17('0x19')](_0x194fc7[_0x6a17('0x2f')][_0x6a17('0x19')]);_0x5b6bde[_0x6a17('0x16')]=qs[_0x6a17('0x16')](_0x194fc7[_0x6a17('0x2f')][_0x6a17('0x16')]);}return _0x316a94[_0x6a17('0x4b')](_0x5b6bde);}})['then'](function(_0x18621f){if(_0x18621f){return _0x18621f?{'count':_0x35a7a8,'rows':_0x18621f}:null;}})[_0x6a17('0x20')](respondWithResult(_0x45c826,null))[_0x6a17('0x46')](handleError(_0x45c826,null));};exports[_0x6a17('0x4d')]=function(_0x4262e6,_0x34b303,_0x96be21){var _0x15c761={};var _0xd4c4bd={};var _0x1bfac5;var _0x55eb35;return db['ZohoConfiguration'][_0x6a17('0x48')]({'where':{'id':_0x4262e6['params']['id']}})[_0x6a17('0x20')](handleEntityNotFound(_0x34b303,null))[_0x6a17('0x20')](function(_0x3dd3a5){if(_0x3dd3a5){_0x1bfac5=_0x3dd3a5;_0xd4c4bd[_0x6a17('0x2e')]=_[_0x6a17('0x40')](db['ZohoField'][_0x6a17('0x2a')]);_0xd4c4bd[_0x6a17('0x2f')]=_[_0x6a17('0x40')](_0x4262e6[_0x6a17('0x2f')]);_0xd4c4bd[_0x6a17('0x30')]=_['intersection'](_0xd4c4bd[_0x6a17('0x2e')],_0xd4c4bd[_0x6a17('0x2f')]);_0x15c761[_0x6a17('0x32')]=_['intersection'](_0xd4c4bd[_0x6a17('0x2e')],qs[_0x6a17('0x33')](_0x4262e6['query']['fields']));_0x15c761[_0x6a17('0x32')]=_0x15c761[_0x6a17('0x32')][_0x6a17('0x41')]?_0x15c761[_0x6a17('0x32')]:_0xd4c4bd[_0x6a17('0x2e')];_0x15c761[_0x6a17('0x4a')]=qs[_0x6a17('0x36')](_0x4262e6['query'][_0x6a17('0x36')]);_0x15c761[_0x6a17('0x37')]=qs[_0x6a17('0x30')](_[_0x6a17('0x38')](_0x4262e6[_0x6a17('0x2f')],_0xd4c4bd[_0x6a17('0x30')]));if(_0x4262e6[_0x6a17('0x2f')][_0x6a17('0x39')]){_0x15c761[_0x6a17('0x37')]=_[_0x6a17('0x3a')](_0x15c761[_0x6a17('0x37')],{'$or':_[_0x6a17('0x28')](_0x15c761[_0x6a17('0x32')],function(_0x29d137){var _0x303cd8={};_0x303cd8[_0x29d137]={'$like':'%'+_0x4262e6[_0x6a17('0x2f')][_0x6a17('0x39')]+'%'};return _0x303cd8;})});}_0x15c761=_[_0x6a17('0x3a')]({},_0x15c761,_0x4262e6[_0x6a17('0x42')]);return _0x1bfac5[_0x6a17('0x4d')](_0x15c761);}})[_0x6a17('0x20')](function(_0x5e32e8){if(_0x5e32e8){_0x55eb35=_0x5e32e8[_0x6a17('0x41')];if(!_0x4262e6[_0x6a17('0x2f')][_0x6a17('0x34')]('nolimit')){_0x15c761[_0x6a17('0x19')]=qs['limit'](_0x4262e6[_0x6a17('0x2f')]['limit']);_0x15c761[_0x6a17('0x16')]=qs[_0x6a17('0x16')](_0x4262e6['query'][_0x6a17('0x16')]);}return _0x1bfac5[_0x6a17('0x4d')](_0x15c761);}})['then'](function(_0x26bdab){if(_0x26bdab){return _0x26bdab?{'count':_0x55eb35,'rows':_0x26bdab}:null;}})['then'](respondWithResult(_0x34b303,null))[_0x6a17('0x46')](handleError(_0x34b303,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 13dd1c0..51bb56f 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 _0x4f88=['bluebird','path','rimraf','../../config/environment','ZohoConfiguration','util','../../config/logger','api','moment'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x4f88,0x125));var _0x84f8=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x4f88[_0xe1b5f6];return _0x44636e;};'use strict';var _=require('lodash');var util=require(_0x84f8('0x0'));var logger=require(_0x84f8('0x1'))(_0x84f8('0x2'));var moment=require(_0x84f8('0x3'));var BPromise=require(_0x84f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84f8('0x5'));var rimraf=require(_0x84f8('0x6'));var config=require(_0x84f8('0x7'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x11b7fd,_0x5e097e){return _0x11b7fd['define'](_0x84f8('0x8'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe16a=['int_zoho_configurations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration'];(function(_0x114665,_0x273cc2){var _0x4ad8fa=function(_0x45fe6b){while(--_0x45fe6b){_0x114665['push'](_0x114665['shift']());}};_0x4ad8fa(++_0x273cc2);}(_0xe16a,0x181));var _0xae16=function(_0xd749f3,_0x5f54a6){_0xd749f3=_0xd749f3-0x0;var _0x1734a8=_0xe16a[_0xd749f3];return _0x1734a8;};'use strict';var _=require('lodash');var util=require(_0xae16('0x0'));var logger=require(_0xae16('0x1'))('api');var moment=require(_0xae16('0x2'));var BPromise=require(_0xae16('0x3'));var rp=require(_0xae16('0x4'));var fs=require('fs');var path=require(_0xae16('0x5'));var rimraf=require(_0xae16('0x6'));var config=require(_0xae16('0x7'));var attributes=require(_0xae16('0x8'));module['exports']=function(_0x5d51b6,_0x2ec4f0){return _0x5d51b6[_0xae16('0x9')](_0xae16('0xa'),attributes,{'tableName':_0xae16('0xb'),'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 3baa9e7..9c01ad3 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 _0x744a=['../../config/utils','rpc','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x208134,_0x30f67f){var _0x38619e=function(_0x22ecaf){while(--_0x22ecaf){_0x208134['push'](_0x208134['shift']());}};_0x38619e(++_0x30f67f);}(_0x744a,0xea));var _0xa744=function(_0x313be9,_0x1de21d){_0x313be9=_0x313be9-0x0;var _0x2ebcd2=_0x744a[_0x313be9];return _0x2ebcd2;};'use strict';var _=require(_0xa744('0x0'));var util=require(_0xa744('0x1'));var moment=require(_0xa744('0x2'));var BPromise=require(_0xa744('0x3'));var rs=require(_0xa744('0x4'));var fs=require('fs');var Redis=require(_0xa744('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa744('0x6'));var logger=require('../../config/logger')(_0xa744('0x7'));var config=require('../../config/environment');var jayson=require(_0xa744('0x8'));var client=jayson[_0xa744('0x9')][_0xa744('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x544e14,_0x46aa61,_0x272ffe){return new BPromise(function(_0x13d440,_0xc73c72){return client[_0xa744('0xb')](_0x544e14,_0x272ffe)['then'](function(_0x5c7ddf){logger[_0xa744('0xc')](_0xa744('0xd'),_0x46aa61,_0xa744('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x46aa61,_0xa744('0xe'),JSON[_0xa744('0xf')](_0x5c7ddf));if(_0x5c7ddf['error']){if(_0x5c7ddf[_0xa744('0x10')][_0xa744('0x11')]===0x1f4){logger['error'](_0xa744('0xd'),_0x46aa61,_0x5c7ddf[_0xa744('0x10')]['message']);return _0xc73c72(_0x5c7ddf['error'][_0xa744('0x12')]);}logger['error'](_0xa744('0xd'),_0x46aa61,_0x5c7ddf[_0xa744('0x10')][_0xa744('0x12')]);return _0x13d440(_0x5c7ddf[_0xa744('0x10')][_0xa744('0x12')]);}else{logger[_0xa744('0xc')](_0xa744('0xd'),_0x46aa61,_0xa744('0xe'));_0x13d440(_0x5c7ddf[_0xa744('0x13')][_0xa744('0x12')]);}})['catch'](function(_0x3a77bc){logger[_0xa744('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x46aa61,_0x3a77bc);_0xc73c72(_0x3a77bc);});});} \ No newline at end of file +var _0x39b1=['http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x431388,_0x4cd840){var _0x495176=function(_0x36a1bc){while(--_0x36a1bc){_0x431388['push'](_0x431388['shift']());}};_0x495176(++_0x4cd840);}(_0x39b1,0x160));var _0x139b=function(_0x591a0a,_0x45796b){_0x591a0a=_0x591a0a-0x0;var _0x22453a=_0x39b1[_0x591a0a];return _0x22453a;};'use strict';var _=require(_0x139b('0x0'));var util=require(_0x139b('0x1'));var moment=require('moment');var BPromise=require(_0x139b('0x2'));var rs=require(_0x139b('0x3'));var fs=require('fs');var Redis=require(_0x139b('0x4'));var db=require(_0x139b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x139b('0x6'));var config=require('../../config/environment');var jayson=require(_0x139b('0x7'));var client=jayson['client'][_0x139b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xad2f0e,_0xdb40fb,_0x35a1c5){return new BPromise(function(_0x45f1de,_0x5d9364){return client[_0x139b('0x9')](_0xad2f0e,_0x35a1c5)[_0x139b('0xa')](function(_0x27b15e){logger['info'](_0x139b('0xb'),_0xdb40fb,_0x139b('0xc'));logger[_0x139b('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0xdb40fb,_0x139b('0xc'),JSON['stringify'](_0x27b15e));if(_0x27b15e[_0x139b('0xe')]){if(_0x27b15e[_0x139b('0xe')][_0x139b('0xf')]===0x1f4){logger[_0x139b('0xe')](_0x139b('0xb'),_0xdb40fb,_0x27b15e[_0x139b('0xe')][_0x139b('0x10')]);return _0x5d9364(_0x27b15e[_0x139b('0xe')]['message']);}logger['error'](_0x139b('0xb'),_0xdb40fb,_0x27b15e[_0x139b('0xe')][_0x139b('0x10')]);return _0x45f1de(_0x27b15e[_0x139b('0xe')]['message']);}else{logger[_0x139b('0x11')](_0x139b('0xb'),_0xdb40fb,'request\x20sent');_0x45f1de(_0x27b15e[_0x139b('0x12')][_0x139b('0x10')]);}})[_0x139b('0x13')](function(_0x158adb){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xdb40fb,_0x158adb);_0x5d9364(_0x158adb);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 86a3171..54359bf 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 _0xd8ed=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd8ed,0x138));var _0xdd8e=function(_0x2c3566,_0x106d53){_0x2c3566=_0x2c3566-0x0;var _0x4aebac=_0xd8ed[_0x2c3566];return _0x4aebac;};'use strict';var multer=require(_0xdd8e('0x0'));var util=require(_0xdd8e('0x1'));var path=require(_0xdd8e('0x2'));var timeout=require(_0xdd8e('0x3'));var express=require(_0xdd8e('0x4'));var router=express[_0xdd8e('0x5')]();var fs_extra=require(_0xdd8e('0x6'));var auth=require(_0xdd8e('0x7'));var interaction=require(_0xdd8e('0x8'));var config=require(_0xdd8e('0x9'));var controller=require('./intZohoField.controller');router[_0xdd8e('0xa')]('/',auth['isAuthenticated'](),controller[_0xdd8e('0xb')]);router[_0xdd8e('0xa')](_0xdd8e('0xc'),auth[_0xdd8e('0xd')](),controller[_0xdd8e('0xe')]);router[_0xdd8e('0xf')]('/',auth[_0xdd8e('0xd')](),controller['create']);router[_0xdd8e('0x10')](_0xdd8e('0xc'),auth['isAuthenticated'](),controller[_0xdd8e('0x11')]);router[_0xdd8e('0x12')](_0xdd8e('0xc'),auth[_0xdd8e('0xd')](),controller['destroy']);module[_0xdd8e('0x13')]=router; \ No newline at end of file +var _0xff25=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x1e3672,_0x3a51c1){var _0x294372=function(_0x104a17){while(--_0x104a17){_0x1e3672['push'](_0x1e3672['shift']());}};_0x294372(++_0x3a51c1);}(_0xff25,0x17a));var _0x5ff2=function(_0x133551,_0x2c0fa6){_0x133551=_0x133551-0x0;var _0x49f6ed=_0xff25[_0x133551];return _0x49f6ed;};'use strict';var multer=require(_0x5ff2('0x0'));var util=require(_0x5ff2('0x1'));var path=require('path');var timeout=require(_0x5ff2('0x2'));var express=require(_0x5ff2('0x3'));var router=express[_0x5ff2('0x4')]();var fs_extra=require(_0x5ff2('0x5'));var auth=require(_0x5ff2('0x6'));var interaction=require(_0x5ff2('0x7'));var config=require('../../config/environment');var controller=require(_0x5ff2('0x8'));router[_0x5ff2('0x9')]('/',auth['isAuthenticated'](),controller[_0x5ff2('0xa')]);router[_0x5ff2('0x9')]('/:id',auth[_0x5ff2('0xb')](),controller[_0x5ff2('0xc')]);router[_0x5ff2('0xd')]('/',auth['isAuthenticated'](),controller[_0x5ff2('0xe')]);router[_0x5ff2('0xf')](_0x5ff2('0x10'),auth[_0x5ff2('0xb')](),controller[_0x5ff2('0x11')]);router[_0x5ff2('0x12')](_0x5ff2('0x10'),auth['isAuthenticated'](),controller[_0x5ff2('0x13')]);module[_0x5ff2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 157a281..5758816 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 _0x4e87=['ENUM','variable','keyValue','picklist','string','STRING','customVariable','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4e87,0x1e4));var _0x74e8=function(_0x42fcb9,_0x8beed8){_0x42fcb9=_0x42fcb9-0x0;var _0x296ad2=_0x4e87[_0x42fcb9];return _0x296ad2;};'use strict';var Sequelize=require(_0x74e8('0x0'));module[_0x74e8('0x1')]={'type':{'type':Sequelize[_0x74e8('0x2')]('string',_0x74e8('0x3'),'customVariable',_0x74e8('0x4'),_0x74e8('0x5')),'defaultValue':_0x74e8('0x6')},'content':{'type':Sequelize[_0x74e8('0x7')]},'key':{'type':Sequelize[_0x74e8('0x7')]},'keyType':{'type':Sequelize[_0x74e8('0x2')]('string',_0x74e8('0x3'),_0x74e8('0x8'))},'keyContent':{'type':Sequelize[_0x74e8('0x7')]},'idField':{'type':Sequelize[_0x74e8('0x7')]},'nameField':{'type':Sequelize[_0x74e8('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x74e8('0x7')]}}; \ No newline at end of file +var _0xb1e9=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb1e9,0x9c));var _0x9b1e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb1e9[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x9b1e('0x0'));module[_0x9b1e('0x1')]={'type':{'type':Sequelize[_0x9b1e('0x2')](_0x9b1e('0x3'),_0x9b1e('0x4'),_0x9b1e('0x5'),'keyValue',_0x9b1e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9b1e('0x7')]},'key':{'type':Sequelize[_0x9b1e('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x9b1e('0x3'),'variable',_0x9b1e('0x5'))},'keyContent':{'type':Sequelize[_0x9b1e('0x7')]},'idField':{'type':Sequelize[_0x9b1e('0x7')]},'nameField':{'type':Sequelize[_0x9b1e('0x7')]},'customField':{'type':Sequelize[_0x9b1e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9b1e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 5531db8..8246fe9 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 _0xf4f2=['create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0xf4f2,0x12e));var _0x2f4f=function(_0x40f382,_0x4a3456){_0x40f382=_0x40f382-0x0;var _0x28757d=_0xf4f2[_0x40f382];return _0x28757d;};'use strict';var emlformat=require(_0x2f4f('0x0'));var rimraf=require(_0x2f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f4f('0x2'));var rp=require(_0x2f4f('0x3'));var moment=require('moment');var BPromise=require(_0x2f4f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2f4f('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f4f('0x6'));var _=require(_0x2f4f('0x7'));var squel=require('squel');var crypto=require(_0x2f4f('0x8'));var jsforce=require(_0x2f4f('0x9'));var deskjs=require(_0x2f4f('0xa'));var toCsv=require(_0x2f4f('0xb'));var querystring=require(_0x2f4f('0xc'));var Papa=require(_0x2f4f('0xd'));var Redis=require(_0x2f4f('0xe'));var authService=require(_0x2f4f('0xf'));var qs=require(_0x2f4f('0x10'));var as=require(_0x2f4f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f4f('0x12'))(_0x2f4f('0x13'));var utils=require(_0x2f4f('0x14'));var config=require(_0x2f4f('0x15'));var licenseUtil=require(_0x2f4f('0x16'));var db=require(_0x2f4f('0x17'))['db'];function respondWithStatusCode(_0x2c71b1,_0x42fccb){_0x42fccb=_0x42fccb||0xcc;return function(_0xca4e5){if(_0xca4e5){return _0x2c71b1[_0x2f4f('0x18')](_0x42fccb);}return _0x2c71b1[_0x2f4f('0x19')](_0x42fccb)['end']();};}function respondWithResult(_0xc286f1,_0x476afd){_0x476afd=_0x476afd||0xc8;return function(_0x5aae4c){if(_0x5aae4c){return _0xc286f1[_0x2f4f('0x19')](_0x476afd)['json'](_0x5aae4c);}};}function respondWithFilteredResult(_0x3668c0,_0x50fa62){return function(_0x4f09ad){if(_0x4f09ad){var _0xf27c75=typeof _0x50fa62[_0x2f4f('0x1a')]==='undefined'&&typeof _0x50fa62[_0x2f4f('0x1b')]===_0x2f4f('0x1c');var _0x234536=_0x4f09ad[_0x2f4f('0x1d')];var _0xe9d69b=_0xf27c75?0x0:_0x50fa62['offset'];var _0x1432bf=_0xf27c75?_0x4f09ad[_0x2f4f('0x1d')]:_0x50fa62[_0x2f4f('0x1a')]+_0x50fa62['limit'];var _0x41bd29;if(_0x1432bf>=_0x234536){_0x1432bf=_0x234536;_0x41bd29=0xc8;}else{_0x41bd29=0xce;}_0x3668c0[_0x2f4f('0x19')](_0x41bd29);return _0x3668c0[_0x2f4f('0x1e')](_0x2f4f('0x1f'),_0xe9d69b+'-'+_0x1432bf+'/'+_0x234536)['json'](_0x4f09ad);}return null;};}function patchUpdates(_0x2022f9){return function(_0x3a6d7f){try{jsonpatch['apply'](_0x3a6d7f,_0x2022f9,!![]);}catch(_0x7028b7){return BPromise[_0x2f4f('0x20')](_0x7028b7);}return _0x3a6d7f[_0x2f4f('0x21')]();};}function saveUpdates(_0x31feef,_0x196d86){return function(_0x11590){if(_0x11590){return _0x11590[_0x2f4f('0x22')](_0x31feef)[_0x2f4f('0x23')](function(_0x51b4b7){return _0x51b4b7;});}return null;};}function removeEntity(_0x482395,_0xa479b2){return function(_0x451933){if(_0x451933){return _0x451933[_0x2f4f('0x24')]()[_0x2f4f('0x23')](function(){_0x482395[_0x2f4f('0x19')](0xcc)[_0x2f4f('0x25')]();});}};}function handleEntityNotFound(_0x2e8d5b,_0x116cc1){return function(_0x506231){if(!_0x506231){_0x2e8d5b[_0x2f4f('0x18')](0x194);}return _0x506231;};}function handleError(_0x5e3862,_0x13e549){_0x13e549=_0x13e549||0x1f4;return function(_0x471ec8){logger[_0x2f4f('0x26')](_0x471ec8[_0x2f4f('0x27')]);if(_0x471ec8['name']){delete _0x471ec8[_0x2f4f('0x28')];}_0x5e3862['status'](_0x13e549)[_0x2f4f('0x29')](_0x471ec8);};}exports['index']=function(_0x24e788,_0x41727c){var _0x8a0bad={},_0x5f2841={},_0x157a12={'count':0x0,'rows':[]};var _0x3e15e6=_[_0x2f4f('0x2a')](db[_0x2f4f('0x2b')][_0x2f4f('0x2c')],function(_0x5a666c){return{'name':_0x5a666c[_0x2f4f('0x2d')],'type':_0x5a666c['type'][_0x2f4f('0x2e')]};});_0x5f2841['model']=_[_0x2f4f('0x2a')](_0x3e15e6,'name');_0x5f2841['query']=_[_0x2f4f('0x2f')](_0x24e788['query']);_0x5f2841[_0x2f4f('0x30')]=_[_0x2f4f('0x31')](_0x5f2841[_0x2f4f('0x32')],_0x5f2841['query']);_0x8a0bad[_0x2f4f('0x33')]=_['intersection'](_0x5f2841['model'],qs[_0x2f4f('0x34')](_0x24e788[_0x2f4f('0x35')]['fields']));_0x8a0bad[_0x2f4f('0x33')]=_0x8a0bad[_0x2f4f('0x33')][_0x2f4f('0x36')]?_0x8a0bad[_0x2f4f('0x33')]:_0x5f2841[_0x2f4f('0x32')];if(!_0x24e788['query'][_0x2f4f('0x37')](_0x2f4f('0x38'))){_0x8a0bad[_0x2f4f('0x1b')]=qs['limit'](_0x24e788[_0x2f4f('0x35')][_0x2f4f('0x1b')]);_0x8a0bad['offset']=qs['offset'](_0x24e788[_0x2f4f('0x35')]['offset']);}_0x8a0bad[_0x2f4f('0x39')]=qs[_0x2f4f('0x3a')](_0x24e788[_0x2f4f('0x35')][_0x2f4f('0x3a')]);_0x8a0bad[_0x2f4f('0x3b')]=qs['filters'](_[_0x2f4f('0x3c')](_0x24e788['query'],_0x5f2841[_0x2f4f('0x30')]),_0x3e15e6);if(_0x24e788[_0x2f4f('0x35')][_0x2f4f('0x3d')]){_0x8a0bad[_0x2f4f('0x3b')]=_[_0x2f4f('0x3e')](_0x8a0bad[_0x2f4f('0x3b')],{'$or':_[_0x2f4f('0x2a')](_0x3e15e6,function(_0x3c2723){if(_0x3c2723['type']!==_0x2f4f('0x3f')){var _0x1be92b={};_0x1be92b[_0x3c2723['name']]={'$like':'%'+_0x24e788[_0x2f4f('0x35')][_0x2f4f('0x3d')]+'%'};return _0x1be92b;}})});}_0x8a0bad=_[_0x2f4f('0x3e')]({},_0x8a0bad,_0x24e788[_0x2f4f('0x40')]);var _0x6cc505={'where':_0x8a0bad['where']};return db['ZohoField'][_0x2f4f('0x1d')](_0x6cc505)[_0x2f4f('0x23')](function(_0x4ad4b5){_0x157a12[_0x2f4f('0x1d')]=_0x4ad4b5;if(_0x24e788['query'][_0x2f4f('0x41')]){_0x8a0bad[_0x2f4f('0x42')]=[{'all':!![]}];}return db[_0x2f4f('0x2b')][_0x2f4f('0x43')](_0x8a0bad);})['then'](function(_0x571adf){_0x157a12[_0x2f4f('0x44')]=_0x571adf;return _0x157a12;})[_0x2f4f('0x23')](respondWithFilteredResult(_0x41727c,_0x8a0bad))[_0x2f4f('0x45')](handleError(_0x41727c,null));};exports[_0x2f4f('0x46')]=function(_0x5a07b6,_0x1b31e3){var _0x2626fd={'raw':!![],'where':{'id':_0x5a07b6[_0x2f4f('0x47')]['id']}},_0x2f2191={};_0x2f2191[_0x2f4f('0x32')]=_[_0x2f4f('0x2f')](db[_0x2f4f('0x2b')][_0x2f4f('0x2c')]);_0x2f2191[_0x2f4f('0x35')]=_[_0x2f4f('0x2f')](_0x5a07b6[_0x2f4f('0x35')]);_0x2f2191[_0x2f4f('0x30')]=_[_0x2f4f('0x31')](_0x2f2191[_0x2f4f('0x32')],_0x2f2191[_0x2f4f('0x35')]);_0x2626fd['attributes']=_['intersection'](_0x2f2191['model'],qs[_0x2f4f('0x34')](_0x5a07b6[_0x2f4f('0x35')][_0x2f4f('0x34')]));_0x2626fd[_0x2f4f('0x33')]=_0x2626fd[_0x2f4f('0x33')][_0x2f4f('0x36')]?_0x2626fd['attributes']:_0x2f2191[_0x2f4f('0x32')];if(_0x5a07b6[_0x2f4f('0x35')][_0x2f4f('0x41')]){_0x2626fd['include']=[{'all':!![]}];}_0x2626fd=_[_0x2f4f('0x3e')]({},_0x2626fd,_0x5a07b6[_0x2f4f('0x40')]);return db[_0x2f4f('0x2b')][_0x2f4f('0x48')](_0x2626fd)[_0x2f4f('0x23')](handleEntityNotFound(_0x1b31e3,null))['then'](respondWithResult(_0x1b31e3,null))[_0x2f4f('0x45')](handleError(_0x1b31e3,null));};exports[_0x2f4f('0x49')]=function(_0x31e868,_0x526bba){return db['ZohoField'][_0x2f4f('0x49')](_0x31e868[_0x2f4f('0x4a')],{})['then'](respondWithResult(_0x526bba,0xc9))[_0x2f4f('0x45')](handleError(_0x526bba,null));};exports[_0x2f4f('0x22')]=function(_0x5a254a,_0x5c6dc0){if(_0x5a254a[_0x2f4f('0x4a')]['id']){delete _0x5a254a[_0x2f4f('0x4a')]['id'];}return db[_0x2f4f('0x2b')][_0x2f4f('0x48')]({'where':{'id':_0x5a254a[_0x2f4f('0x47')]['id']}})[_0x2f4f('0x23')](handleEntityNotFound(_0x5c6dc0,null))[_0x2f4f('0x23')](saveUpdates(_0x5a254a[_0x2f4f('0x4a')],null))[_0x2f4f('0x23')](respondWithResult(_0x5c6dc0,null))[_0x2f4f('0x45')](handleError(_0x5c6dc0,null));};exports[_0x2f4f('0x24')]=function(_0x16d591,_0xf61f00){return db[_0x2f4f('0x2b')][_0x2f4f('0x48')]({'where':{'id':_0x16d591[_0x2f4f('0x47')]['id']}})[_0x2f4f('0x23')](handleEntityNotFound(_0xf61f00,null))[_0x2f4f('0x23')](removeEntity(_0xf61f00,null))[_0x2f4f('0x45')](handleError(_0xf61f00,null));}; \ No newline at end of file +var _0x6f9c=['rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','ZohoField','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x6f9c,0x1f2));var _0xc6f9=function(_0x5116b7,_0x174324){_0x5116b7=_0x5116b7-0x0;var _0x2d3d44=_0x6f9c[_0x5116b7];return _0x2d3d44;};'use strict';var emlformat=require(_0xc6f9('0x0'));var rimraf=require(_0xc6f9('0x1'));var zipdir=require(_0xc6f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6f9('0x3'));var moment=require(_0xc6f9('0x4'));var BPromise=require(_0xc6f9('0x5'));var Mustache=require('mustache');var util=require(_0xc6f9('0x6'));var path=require('path');var sox=require(_0xc6f9('0x7'));var csv=require('to-csv');var ejs=require(_0xc6f9('0x8'));var fs=require('fs');var fs_extra=require(_0xc6f9('0x9'));var _=require('lodash');var squel=require(_0xc6f9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc6f9('0xb'));var toCsv=require(_0xc6f9('0xc'));var querystring=require('querystring');var Papa=require(_0xc6f9('0xd'));var Redis=require(_0xc6f9('0xe'));var authService=require(_0xc6f9('0xf'));var qs=require(_0xc6f9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc6f9('0x11'));var utils=require('../../config/utils');var config=require(_0xc6f9('0x12'));var licenseUtil=require(_0xc6f9('0x13'));var db=require(_0xc6f9('0x14'))['db'];function respondWithStatusCode(_0xeb3b86,_0x18dab7){_0x18dab7=_0x18dab7||0xcc;return function(_0xbe0951){if(_0xbe0951){return _0xeb3b86['sendStatus'](_0x18dab7);}return _0xeb3b86[_0xc6f9('0x15')](_0x18dab7)[_0xc6f9('0x16')]();};}function respondWithResult(_0x188175,_0x4bdd3c){_0x4bdd3c=_0x4bdd3c||0xc8;return function(_0xe5484){if(_0xe5484){return _0x188175[_0xc6f9('0x15')](_0x4bdd3c)[_0xc6f9('0x17')](_0xe5484);}};}function respondWithFilteredResult(_0x25a4e0,_0x39b83f){return function(_0x1b5192){if(_0x1b5192){var _0x1cd30e=typeof _0x39b83f['offset']===_0xc6f9('0x18')&&typeof _0x39b83f[_0xc6f9('0x19')]===_0xc6f9('0x18');var _0x3bef9f=_0x1b5192['count'];var _0x5de467=_0x1cd30e?0x0:_0x39b83f[_0xc6f9('0x1a')];var _0x15474a=_0x1cd30e?_0x1b5192[_0xc6f9('0x1b')]:_0x39b83f['offset']+_0x39b83f['limit'];var _0x52552e;if(_0x15474a>=_0x3bef9f){_0x15474a=_0x3bef9f;_0x52552e=0xc8;}else{_0x52552e=0xce;}_0x25a4e0[_0xc6f9('0x15')](_0x52552e);return _0x25a4e0['set'](_0xc6f9('0x1c'),_0x5de467+'-'+_0x15474a+'/'+_0x3bef9f)[_0xc6f9('0x17')](_0x1b5192);}return null;};}function patchUpdates(_0x52b78b){return function(_0x238b47){try{jsonpatch['apply'](_0x238b47,_0x52b78b,!![]);}catch(_0x177017){return BPromise[_0xc6f9('0x1d')](_0x177017);}return _0x238b47[_0xc6f9('0x1e')]();};}function saveUpdates(_0x4f8309,_0x148bce){return function(_0x47acf2){if(_0x47acf2){return _0x47acf2[_0xc6f9('0x1f')](_0x4f8309)[_0xc6f9('0x20')](function(_0x597ed){return _0x597ed;});}return null;};}function removeEntity(_0x4d1eab,_0x5d37e7){return function(_0x2d089d){if(_0x2d089d){return _0x2d089d[_0xc6f9('0x21')]()[_0xc6f9('0x20')](function(){_0x4d1eab[_0xc6f9('0x15')](0xcc)[_0xc6f9('0x16')]();});}};}function handleEntityNotFound(_0x423b7c,_0x14672a){return function(_0x4d603b){if(!_0x4d603b){_0x423b7c[_0xc6f9('0x22')](0x194);}return _0x4d603b;};}function handleError(_0x1b1694,_0x2b25a8){_0x2b25a8=_0x2b25a8||0x1f4;return function(_0x16b168){logger[_0xc6f9('0x23')](_0x16b168[_0xc6f9('0x24')]);if(_0x16b168[_0xc6f9('0x25')]){delete _0x16b168['name'];}_0x1b1694[_0xc6f9('0x15')](_0x2b25a8)['send'](_0x16b168);};}exports[_0xc6f9('0x26')]=function(_0x2342f3,_0x5765d1){var _0x93c834={},_0x3e9924={},_0x2bf50a={'count':0x0,'rows':[]};var _0x4b8d62=_['map'](db[_0xc6f9('0x27')][_0xc6f9('0x28')],function(_0x1b6f15){return{'name':_0x1b6f15[_0xc6f9('0x29')],'type':_0x1b6f15['type'][_0xc6f9('0x2a')]};});_0x3e9924['model']=_[_0xc6f9('0x2b')](_0x4b8d62,_0xc6f9('0x25'));_0x3e9924[_0xc6f9('0x2c')]=_[_0xc6f9('0x2d')](_0x2342f3[_0xc6f9('0x2c')]);_0x3e9924[_0xc6f9('0x2e')]=_[_0xc6f9('0x2f')](_0x3e9924[_0xc6f9('0x30')],_0x3e9924[_0xc6f9('0x2c')]);_0x93c834[_0xc6f9('0x31')]=_[_0xc6f9('0x2f')](_0x3e9924['model'],qs[_0xc6f9('0x32')](_0x2342f3[_0xc6f9('0x2c')][_0xc6f9('0x32')]));_0x93c834[_0xc6f9('0x31')]=_0x93c834[_0xc6f9('0x31')][_0xc6f9('0x33')]?_0x93c834[_0xc6f9('0x31')]:_0x3e9924['model'];if(!_0x2342f3[_0xc6f9('0x2c')][_0xc6f9('0x34')](_0xc6f9('0x35'))){_0x93c834[_0xc6f9('0x19')]=qs[_0xc6f9('0x19')](_0x2342f3[_0xc6f9('0x2c')][_0xc6f9('0x19')]);_0x93c834[_0xc6f9('0x1a')]=qs['offset'](_0x2342f3[_0xc6f9('0x2c')][_0xc6f9('0x1a')]);}_0x93c834[_0xc6f9('0x36')]=qs['sort'](_0x2342f3[_0xc6f9('0x2c')]['sort']);_0x93c834[_0xc6f9('0x37')]=qs[_0xc6f9('0x2e')](_['pick'](_0x2342f3[_0xc6f9('0x2c')],_0x3e9924[_0xc6f9('0x2e')]),_0x4b8d62);if(_0x2342f3['query'][_0xc6f9('0x38')]){_0x93c834[_0xc6f9('0x37')]=_[_0xc6f9('0x39')](_0x93c834[_0xc6f9('0x37')],{'$or':_[_0xc6f9('0x2b')](_0x4b8d62,function(_0xca0bbe){if(_0xca0bbe[_0xc6f9('0x3a')]!==_0xc6f9('0x3b')){var _0x5e9f81={};_0x5e9f81[_0xca0bbe[_0xc6f9('0x25')]]={'$like':'%'+_0x2342f3[_0xc6f9('0x2c')][_0xc6f9('0x38')]+'%'};return _0x5e9f81;}})});}_0x93c834=_[_0xc6f9('0x39')]({},_0x93c834,_0x2342f3[_0xc6f9('0x3c')]);var _0x361121={'where':_0x93c834[_0xc6f9('0x37')]};return db[_0xc6f9('0x27')]['count'](_0x361121)['then'](function(_0x86594){_0x2bf50a['count']=_0x86594;if(_0x2342f3[_0xc6f9('0x2c')][_0xc6f9('0x3d')]){_0x93c834['include']=[{'all':!![]}];}return db[_0xc6f9('0x27')]['findAll'](_0x93c834);})[_0xc6f9('0x20')](function(_0x5a2856){_0x2bf50a[_0xc6f9('0x3e')]=_0x5a2856;return _0x2bf50a;})[_0xc6f9('0x20')](respondWithFilteredResult(_0x5765d1,_0x93c834))['catch'](handleError(_0x5765d1,null));};exports[_0xc6f9('0x3f')]=function(_0x50a4b9,_0x147bd2){var _0xb5fb09={'raw':!![],'where':{'id':_0x50a4b9[_0xc6f9('0x40')]['id']}},_0x1b56fc={};_0x1b56fc[_0xc6f9('0x30')]=_[_0xc6f9('0x2d')](db[_0xc6f9('0x27')]['rawAttributes']);_0x1b56fc[_0xc6f9('0x2c')]=_[_0xc6f9('0x2d')](_0x50a4b9[_0xc6f9('0x2c')]);_0x1b56fc[_0xc6f9('0x2e')]=_[_0xc6f9('0x2f')](_0x1b56fc[_0xc6f9('0x30')],_0x1b56fc['query']);_0xb5fb09[_0xc6f9('0x31')]=_[_0xc6f9('0x2f')](_0x1b56fc[_0xc6f9('0x30')],qs[_0xc6f9('0x32')](_0x50a4b9[_0xc6f9('0x2c')][_0xc6f9('0x32')]));_0xb5fb09[_0xc6f9('0x31')]=_0xb5fb09[_0xc6f9('0x31')]['length']?_0xb5fb09[_0xc6f9('0x31')]:_0x1b56fc[_0xc6f9('0x30')];if(_0x50a4b9[_0xc6f9('0x2c')]['includeAll']){_0xb5fb09[_0xc6f9('0x41')]=[{'all':!![]}];}_0xb5fb09=_[_0xc6f9('0x39')]({},_0xb5fb09,_0x50a4b9[_0xc6f9('0x3c')]);return db[_0xc6f9('0x27')][_0xc6f9('0x42')](_0xb5fb09)[_0xc6f9('0x20')](handleEntityNotFound(_0x147bd2,null))['then'](respondWithResult(_0x147bd2,null))[_0xc6f9('0x43')](handleError(_0x147bd2,null));};exports[_0xc6f9('0x44')]=function(_0x271389,_0x48a48d){return db['ZohoField'][_0xc6f9('0x44')](_0x271389[_0xc6f9('0x45')],{})['then'](respondWithResult(_0x48a48d,0xc9))[_0xc6f9('0x43')](handleError(_0x48a48d,null));};exports['update']=function(_0x529ff3,_0x9c7291){if(_0x529ff3[_0xc6f9('0x45')]['id']){delete _0x529ff3['body']['id'];}return db['ZohoField'][_0xc6f9('0x42')]({'where':{'id':_0x529ff3[_0xc6f9('0x40')]['id']}})['then'](handleEntityNotFound(_0x9c7291,null))['then'](saveUpdates(_0x529ff3[_0xc6f9('0x45')],null))['then'](respondWithResult(_0x9c7291,null))[_0xc6f9('0x43')](handleError(_0x9c7291,null));};exports[_0xc6f9('0x21')]=function(_0x2b536f,_0x21868d){return db[_0xc6f9('0x27')][_0xc6f9('0x42')]({'where':{'id':_0x2b536f['params']['id']}})['then'](handleEntityNotFound(_0x21868d,null))[_0xc6f9('0x20')](removeEntity(_0x21868d,null))[_0xc6f9('0x43')](handleError(_0x21868d,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0678997..969006b 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 _0x4975=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash'];(function(_0x38ecfa,_0x234324){var _0xb2d489=function(_0x4a373b){while(--_0x4a373b){_0x38ecfa['push'](_0x38ecfa['shift']());}};_0xb2d489(++_0x234324);}(_0x4975,0x86));var _0x5497=function(_0x2dc686,_0x17f441){_0x2dc686=_0x2dc686-0x0;var _0x56a59a=_0x4975[_0x2dc686];return _0x56a59a;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['idField',_0x5497('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x781d=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd781('0x2'));var BPromise=require(_0xd781('0x3'));var rp=require(_0xd781('0x4'));var fs=require('fs');var path=require(_0xd781('0x5'));var rimraf=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var attributes=require(_0xd781('0x8'));module[_0xd781('0x9')]=function(_0x830b,_0x2f98ee){return _0x830b['define'](_0xd781('0xa'),attributes,{'tableName':_0xd781('0xb'),'paranoid':![],'indexes':[{'name':_0xd781('0xc'),'fields':[_0xd781('0xd'),'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 93590b6..5542636 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 _0xb534=['code','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x2a1bac,_0x2a60c6){var _0x3335c2=function(_0x5497c9){while(--_0x5497c9){_0x2a1bac['push'](_0x2a1bac['shift']());}};_0x3335c2(++_0x2a60c6);}(_0xb534,0xf4));var _0x4b53=function(_0x17f6c2,_0x1f1a5d){_0x17f6c2=_0x17f6c2-0x0;var _0x4b930f=_0xb534[_0x17f6c2];return _0x4b930f;};'use strict';var _=require(_0x4b53('0x0'));var util=require('util');var moment=require(_0x4b53('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b53('0x2'))['db'];var utils=require(_0x4b53('0x3'));var logger=require(_0x4b53('0x4'))('rpc');var config=require(_0x4b53('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b53('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3de581,_0x1ad14b,_0x9c74c0){return new BPromise(function(_0x361d3e,_0x5598ac){return client['request'](_0x3de581,_0x9c74c0)['then'](function(_0x52e48f){logger[_0x4b53('0x7')](_0x4b53('0x8'),_0x1ad14b,_0x4b53('0x9'));logger[_0x4b53('0xa')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1ad14b,_0x4b53('0x9'),JSON['stringify'](_0x52e48f));if(_0x52e48f['error']){if(_0x52e48f[_0x4b53('0xb')][_0x4b53('0xc')]===0x1f4){logger[_0x4b53('0xb')](_0x4b53('0x8'),_0x1ad14b,_0x52e48f['error'][_0x4b53('0xd')]);return _0x5598ac(_0x52e48f['error']['message']);}logger[_0x4b53('0xb')](_0x4b53('0x8'),_0x1ad14b,_0x52e48f[_0x4b53('0xb')][_0x4b53('0xd')]);return _0x361d3e(_0x52e48f[_0x4b53('0xb')][_0x4b53('0xd')]);}else{logger[_0x4b53('0x7')](_0x4b53('0x8'),_0x1ad14b,_0x4b53('0x9'));_0x361d3e(_0x52e48f[_0x4b53('0xe')][_0x4b53('0xd')]);}})[_0x4b53('0xf')](function(_0x2ee38c){logger[_0x4b53('0xb')](_0x4b53('0x8'),_0x1ad14b,_0x2ee38c);_0x5598ac(_0x2ee38c);});});} \ No newline at end of file +var _0x6a98=['request\x20sent','error','code','ZohoField,\x20%s,\x20%s','message','catch','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x315adb,_0x524018){var _0x3de740=function(_0x5ad38f){while(--_0x5ad38f){_0x315adb['push'](_0x315adb['shift']());}};_0x3de740(++_0x524018);}(_0x6a98,0x138));var _0x86a9=function(_0x2ace95,_0x186b37){_0x2ace95=_0x2ace95-0x0;var _0x35ecfa=_0x6a98[_0x2ace95];return _0x35ecfa;};'use strict';var _=require('lodash');var util=require(_0x86a9('0x0'));var moment=require(_0x86a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86a9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x86a9('0x3'));var logger=require(_0x86a9('0x4'))('rpc');var config=require(_0x86a9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x86a9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40b1f1,_0xd125e6,_0x49594b){return new BPromise(function(_0x57dd59,_0x4dbffa){return client[_0x86a9('0x7')](_0x40b1f1,_0x49594b)[_0x86a9('0x8')](function(_0x60b6f8){logger[_0x86a9('0x9')]('ZohoField,\x20%s,\x20%s',_0xd125e6,'request\x20sent');logger[_0x86a9('0xa')](_0x86a9('0xb'),_0xd125e6,_0x86a9('0xc'),JSON['stringify'](_0x60b6f8));if(_0x60b6f8[_0x86a9('0xd')]){if(_0x60b6f8[_0x86a9('0xd')][_0x86a9('0xe')]===0x1f4){logger[_0x86a9('0xd')](_0x86a9('0xf'),_0xd125e6,_0x60b6f8[_0x86a9('0xd')]['message']);return _0x4dbffa(_0x60b6f8['error'][_0x86a9('0x10')]);}logger[_0x86a9('0xd')](_0x86a9('0xf'),_0xd125e6,_0x60b6f8[_0x86a9('0xd')][_0x86a9('0x10')]);return _0x57dd59(_0x60b6f8[_0x86a9('0xd')][_0x86a9('0x10')]);}else{logger[_0x86a9('0x9')](_0x86a9('0xf'),_0xd125e6,_0x86a9('0xc'));_0x57dd59(_0x60b6f8['result'][_0x86a9('0x10')]);}})[_0x86a9('0x11')](function(_0xec067c){logger['error'](_0x86a9('0xf'),_0xd125e6,_0xec067c);_0x4dbffa(_0xec067c);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 3d60718..b85eed7 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x19c0b7,_0x1a5c57){var _0x5d5770=function(_0x439447){while(--_0x439447){_0x19c0b7['push'](_0x19c0b7['shift']());}};_0x5d5770(++_0x1a5c57);}(_0xe706,0xa3));var _0x6e70=function(_0x4864f0,_0x5da8c5){_0x4864f0=_0x4864f0-0x0;var _0x55445a=_0xe706[_0x4864f0];return _0x55445a;};'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(_0x57d11b,_0x2a4299){var _0x63ad6e=function(_0x54b02d){while(--_0x54b02d){_0x57d11b['push'](_0x57d11b['shift']());}};_0x63ad6e(++_0x2a4299);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'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 c734524..f9967b1 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 _0xb346=['unique_name_and_version','STRING','state','sequelize','exports'];(function(_0x45d0c6,_0x13f497){var _0x1be8e7=function(_0x4a2b05){while(--_0x4a2b05){_0x45d0c6['push'](_0x45d0c6['shift']());}};_0x1be8e7(++_0x13f497);}(_0xb346,0xcb));var _0x6b34=function(_0xfa0909,_0xc673ef){_0xfa0909=_0xfa0909-0x0;var _0x3e75e2=_0xb346[_0xfa0909];return _0x3e75e2;};'use strict';var Sequelize=require(_0x6b34('0x0'));module[_0x6b34('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6b34('0x2')},'version':{'type':Sequelize[_0x6b34('0x3')],'allowNull':![],'unique':_0x6b34('0x2')},'main':{'type':Sequelize[_0x6b34('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x6b34('0x3')],'unique':_0x6b34('0x4')},'description':{'type':Sequelize[_0x6b34('0x3')]},'title':{'type':Sequelize[_0x6b34('0x3')]},'remoteUri':{'type':Sequelize[_0x6b34('0x3')]},'link':{'type':Sequelize[_0x6b34('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0xd770=['BOOLEAN','state','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x45948b,_0x5ef239){var _0x450e9f=function(_0x5c2867){while(--_0x5c2867){_0x45948b['push'](_0x45948b['shift']());}};_0x450e9f(++_0x5ef239);}(_0xd770,0x1e5));var _0x0d77=function(_0x45173a,_0x35da4f){_0x45173a=_0x45173a-0x0;var _0xdabac9=_0xd770[_0x45173a];return _0xdabac9;};'use strict';var Sequelize=require('sequelize');module[_0x0d77('0x0')]={'name':{'type':Sequelize[_0x0d77('0x1')],'allowNull':![],'unique':_0x0d77('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d77('0x2')},'main':{'type':Sequelize[_0x0d77('0x1')],'defaultValue':_0x0d77('0x3')},'filename':{'type':Sequelize[_0x0d77('0x1')]},'path':{'type':Sequelize[_0x0d77('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x0d77('0x4')]},'active':{'type':Sequelize[_0x0d77('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x0d77('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x0d77('0x6')},'description':{'type':Sequelize[_0x0d77('0x1')]},'title':{'type':Sequelize[_0x0d77('0x1')]},'remoteUri':{'type':Sequelize[_0x0d77('0x1')]},'link':{'type':Sequelize[_0x0d77('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 468a6d7..6acf48f 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 _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','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','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x524e,0x15e));var _0xe524=function(_0xaa5e25,_0x18c616){_0xaa5e25=_0xaa5e25-0x0;var _0x175b6c=_0x524e[_0xaa5e25];return _0x175b6c;};'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['Integration'][_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['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','Integration','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x1261,0x144));var _0x1126=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x1261[_0x2a0738];return _0x159679;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['Integration'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['Integration']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 2826c4f..797c4e3 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 _0x4ecd=['Integration','integrations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define'];(function(_0x4c2b96,_0x17ab0d){var _0x2a62bf=function(_0x6069bd){while(--_0x6069bd){_0x4c2b96['push'](_0x4c2b96['shift']());}};_0x2a62bf(++_0x17ab0d);}(_0x4ecd,0xc5));var _0xd4ec=function(_0x1b2bd2,_0x491f68){_0x1b2bd2=_0x1b2bd2-0x0;var _0x34a271=_0x4ecd[_0x1b2bd2];return _0x34a271;};'use strict';var _=require('lodash');var util=require(_0xd4ec('0x0'));var logger=require(_0xd4ec('0x1'))(_0xd4ec('0x2'));var moment=require(_0xd4ec('0x3'));var BPromise=require(_0xd4ec('0x4'));var rp=require(_0xd4ec('0x5'));var fs=require('fs');var path=require(_0xd4ec('0x6'));var rimraf=require(_0xd4ec('0x7'));var config=require('../../config/environment');var attributes=require(_0xd4ec('0x8'));module[_0xd4ec('0x9')]=function(_0x43dd63,_0x3d13a4){return _0x43dd63[_0xd4ec('0xa')](_0xd4ec('0xb'),attributes,{'tableName':_0xd4ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9d8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9d8,0x1ab));var _0x8e9d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe9d8[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x8e9d('0x0'));var logger=require(_0x8e9d('0x1'))('api');var moment=require(_0x8e9d('0x2'));var BPromise=require(_0x8e9d('0x3'));var rp=require(_0x8e9d('0x4'));var fs=require('fs');var path=require(_0x8e9d('0x5'));var rimraf=require(_0x8e9d('0x6'));var config=require(_0x8e9d('0x7'));var attributes=require(_0x8e9d('0x8'));module[_0x8e9d('0x9')]=function(_0x48ba4c,_0x59f488){return _0x48ba4c[_0x8e9d('0xa')]('Integration',attributes,{'tableName':'integrations','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 e903de3..b0e4c1c 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x83b4e,_0x47c407){var _0x2beec8=function(_0x48848f){while(--_0x48848f){_0x83b4e['push'](_0x83b4e['shift']());}};_0x2beec8(++_0x47c407);}(_0x2ef3,0xba));var _0x32ef=function(_0xfac249,_0x457f14){_0xfac249=_0xfac249-0x0;var _0x12c652=_0x2ef3[_0xfac249];return _0x12c652;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +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(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xc2c7,0x134));var _0x7c2c=function(_0x343e3f,_0x3b595a){_0x343e3f=_0x343e3f-0x0;var _0x589022=_0xc2c7[_0x343e3f];return _0x589022;};'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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9366a45..f0a0741 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 _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3e94d6,_0x3c76f1){var _0x22457f=function(_0x43e795){while(--_0x43e795){_0x3e94d6['push'](_0x3e94d6['shift']());}};_0x22457f(++_0x3c76f1);}(_0x7880,0x1f4));var _0x0788=function(_0x2081aa,_0x31d653){_0x2081aa=_0x2081aa-0x0;var _0x36485d=_0x7880[_0x2081aa];return _0x36485d;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x1d5f8b,_0x599c9e){var _0x13e275=function(_0x112909){while(--_0x112909){_0x1d5f8b['push'](_0x1d5f8b['shift']());}};_0x13e275(++_0x599c9e);}(_0xef0f,0x168));var _0xfef0=function(_0x458de9,_0x5a95e4){_0x458de9=_0x458de9-0x0;var _0xe86793=_0xef0f[_0x458de9];return _0xe86793;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 43fd495..0d43d81 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 _0x60a9=['exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize'];(function(_0x58ab22,_0x42c988){var _0x3bedba=function(_0x121f16){while(--_0x121f16){_0x58ab22['push'](_0x58ab22['shift']());}};_0x3bedba(++_0x42c988);}(_0x60a9,0x103));var _0x960a=function(_0x410226,_0x3e871d){_0x410226=_0x410226-0x0;var _0x548edd=_0x60a9[_0x410226];return _0x548edd;};'use strict';var Sequelize=require(_0x960a('0x0'));module[_0x960a('0x1')]={'integration':{'type':Sequelize[_0x960a('0x2')]},'eventChannel':{'type':Sequelize[_0x960a('0x2')]},'exitStatus':{'type':Sequelize[_0x960a('0x2')]},'ticketId':{'type':Sequelize[_0x960a('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x960a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x960a('0x2')]},'queue':{'type':Sequelize[_0x960a('0x2')]},'interface':{'type':Sequelize[_0x960a('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x960a('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x960a('0x4')]},'agentcomplete':{'type':Sequelize[_0x960a('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x960a('0x4')]},'agentacw':{'type':Sequelize[_0x960a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x960a('0x4')]},'reason':{'type':Sequelize[_0x960a('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x960a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x960a('0x3')]},'agentdump':{'type':Sequelize[_0x960a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x960a('0x2')]},'channel':{'type':Sequelize[_0x960a('0x2')]},'channelstate':{'type':Sequelize[_0x960a('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x960a('0x2')]},'language':{'type':Sequelize[_0x960a('0x2')]},'accountcode':{'type':Sequelize[_0x960a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x960a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x960a('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x960a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x960a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x960a('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x960a('0x2')]},'destexten':{'type':Sequelize[_0x960a('0x2')]},'destpriority':{'type':Sequelize[_0x960a('0x2')]},'destuniqueid':{'type':Sequelize[_0x960a('0x2')]},'messageId':{'type':Sequelize[_0x960a('0x2')]},'inReplyTo':{'type':Sequelize[_0x960a('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x960a('0x2')]},'to':{'type':Sequelize[_0x960a('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x960a('0x6')]},'html':{'type':Sequelize[_0x960a('0x6')]},'text':{'type':Sequelize[_0x960a('0x6')]},'status':{'type':Sequelize[_0x960a('0x7')]('SENT',_0x960a('0x8'),_0x960a('0x9'),'FAILED')},'url':{'type':Sequelize[_0x960a('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x960a('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x21f6=['exports','STRING','INTEGER','DATE','BOOLEAN','ENUM','SENT','SENDING','FAILED','sequelize'];(function(_0x39bf32,_0x588a52){var _0x415cb3=function(_0x20ab11){while(--_0x20ab11){_0x39bf32['push'](_0x39bf32['shift']());}};_0x415cb3(++_0x588a52);}(_0x21f6,0x149));var _0x621f=function(_0x2947e8,_0x224ded){_0x2947e8=_0x2947e8-0x0;var _0x472ef1=_0x21f6[_0x2947e8];return _0x472ef1;};'use strict';var Sequelize=require(_0x621f('0x0'));module[_0x621f('0x1')]={'integration':{'type':Sequelize[_0x621f('0x2')]},'eventChannel':{'type':Sequelize[_0x621f('0x2')]},'exitStatus':{'type':Sequelize[_0x621f('0x2')]},'ticketId':{'type':Sequelize[_0x621f('0x2')]},'integrationId':{'type':Sequelize[_0x621f('0x3')]},'contacts':{'type':Sequelize[_0x621f('0x2')]},'uniqueid':{'type':Sequelize[_0x621f('0x2')]},'calleridnum':{'type':Sequelize[_0x621f('0x2')]},'calleridname':{'type':Sequelize[_0x621f('0x2')]},'queue':{'type':Sequelize[_0x621f('0x2')]},'interface':{'type':Sequelize[_0x621f('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x621f('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x621f('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x621f('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x621f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x621f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x621f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x621f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x621f('0x4')]},'lastevent':{'type':Sequelize[_0x621f('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x621f('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x621f('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x621f('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x621f('0x2')]},'destchannel':{'type':Sequelize[_0x621f('0x2')]},'destchannelstate':{'type':Sequelize[_0x621f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x621f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x621f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x621f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x621f('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x621f('0x2')]},'destcontext':{'type':Sequelize[_0x621f('0x2')]},'destexten':{'type':Sequelize[_0x621f('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x621f('0x2')]},'messageId':{'type':Sequelize[_0x621f('0x2')]},'inReplyTo':{'type':Sequelize[_0x621f('0x2')]},'subject':{'type':Sequelize[_0x621f('0x2')]},'from':{'type':Sequelize[_0x621f('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x621f('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x621f('0x6')](_0x621f('0x7'),_0x621f('0x8'),'RECEIVED',_0x621f('0x9'))},'url':{'type':Sequelize[_0x621f('0x2')]},'app':{'type':Sequelize[_0x621f('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x621f('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c083885..53262d5 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 _0x6c83=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0x6c83,0xd7));var _0x36c8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6c83[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x36c8('0x0'));var jsonpatch=require(_0x36c8('0x1'));var rp=require(_0x36c8('0x2'));var moment=require('moment');var BPromise=require(_0x36c8('0x3'));var Mustache=require('mustache');var util=require(_0x36c8('0x4'));var path=require(_0x36c8('0x5'));var sox=require(_0x36c8('0x6'));var csv=require(_0x36c8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36c8('0x8'));var _=require(_0x36c8('0x9'));var squel=require(_0x36c8('0xa'));var crypto=require(_0x36c8('0xb'));var jsforce=require(_0x36c8('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x36c8('0xd'));var Papa=require(_0x36c8('0xe'));var Redis=require(_0x36c8('0xf'));var authService=require(_0x36c8('0x10'));var qs=require(_0x36c8('0x11'));var as=require(_0x36c8('0x12'));var hardwareService=require(_0x36c8('0x13'));var logger=require('../../config/logger')(_0x36c8('0x14'));var utils=require(_0x36c8('0x15'));var config=require(_0x36c8('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x89e4d9,_0x4b251a){_0x4b251a=_0x4b251a||0xcc;return function(_0x3b69cc){if(_0x3b69cc){return _0x89e4d9[_0x36c8('0x17')](_0x4b251a);}return _0x89e4d9[_0x36c8('0x18')](_0x4b251a)[_0x36c8('0x19')]();};}function respondWithResult(_0x4cc72a,_0x289625){_0x289625=_0x289625||0xc8;return function(_0x5111d7){if(_0x5111d7){return _0x4cc72a[_0x36c8('0x18')](_0x289625)['json'](_0x5111d7);}};}function respondWithFilteredResult(_0x425a1e,_0x589c6f){return function(_0x40cd66){if(_0x40cd66){var _0x2467c3=typeof _0x589c6f[_0x36c8('0x1a')]===_0x36c8('0x1b')&&typeof _0x589c6f[_0x36c8('0x1c')]===_0x36c8('0x1b');var _0x2525ba=_0x40cd66[_0x36c8('0x1d')];var _0x439463=_0x2467c3?0x0:_0x589c6f[_0x36c8('0x1a')];var _0x54b7cf=_0x2467c3?_0x40cd66['count']:_0x589c6f[_0x36c8('0x1a')]+_0x589c6f[_0x36c8('0x1c')];var _0x1829c7;if(_0x54b7cf>=_0x2525ba){_0x54b7cf=_0x2525ba;_0x1829c7=0xc8;}else{_0x1829c7=0xce;}_0x425a1e[_0x36c8('0x18')](_0x1829c7);return _0x425a1e[_0x36c8('0x1e')](_0x36c8('0x1f'),_0x439463+'-'+_0x54b7cf+'/'+_0x2525ba)[_0x36c8('0x20')](_0x40cd66);}return null;};}function patchUpdates(_0x2f1849){return function(_0x5a9490){try{jsonpatch[_0x36c8('0x21')](_0x5a9490,_0x2f1849,!![]);}catch(_0x26a579){return BPromise[_0x36c8('0x22')](_0x26a579);}return _0x5a9490['save']();};}function saveUpdates(_0x357844,_0x5a839e){return function(_0xb49d9d){if(_0xb49d9d){return _0xb49d9d[_0x36c8('0x23')](_0x357844)['then'](function(_0xb09e3d){return _0xb09e3d;});}return null;};}function removeEntity(_0x441315,_0x4044f8){return function(_0x3ec126){if(_0x3ec126){return _0x3ec126[_0x36c8('0x24')]()[_0x36c8('0x25')](function(){_0x441315[_0x36c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4974ee,_0x4bacae){return function(_0x188db2){if(!_0x188db2){_0x4974ee[_0x36c8('0x17')](0x194);}return _0x188db2;};}function handleError(_0x1ba91d,_0x55d91d){_0x55d91d=_0x55d91d||0x1f4;return function(_0x56f5dc){logger[_0x36c8('0x26')](_0x56f5dc[_0x36c8('0x27')]);if(_0x56f5dc[_0x36c8('0x28')]){delete _0x56f5dc[_0x36c8('0x28')];}_0x1ba91d[_0x36c8('0x18')](_0x55d91d)[_0x36c8('0x29')](_0x56f5dc);};}exports[_0x36c8('0x2a')]=function(_0x2cd17b,_0x23b88d){var _0x5f5cd0={},_0x320388={},_0x1d6a5f={'count':0x0,'rows':[]};var _0x320c59=_['map'](db[_0x36c8('0x2b')][_0x36c8('0x2c')],function(_0x41094e){return{'name':_0x41094e[_0x36c8('0x2d')],'type':_0x41094e[_0x36c8('0x2e')][_0x36c8('0x2f')]};});_0x320388[_0x36c8('0x30')]=_[_0x36c8('0x31')](_0x320c59,_0x36c8('0x28'));_0x320388[_0x36c8('0x32')]=_[_0x36c8('0x33')](_0x2cd17b[_0x36c8('0x32')]);_0x320388[_0x36c8('0x34')]=_[_0x36c8('0x35')](_0x320388[_0x36c8('0x30')],_0x320388[_0x36c8('0x32')]);_0x5f5cd0[_0x36c8('0x36')]=_[_0x36c8('0x35')](_0x320388[_0x36c8('0x30')],qs[_0x36c8('0x37')](_0x2cd17b[_0x36c8('0x32')][_0x36c8('0x37')]));_0x5f5cd0[_0x36c8('0x36')]=_0x5f5cd0['attributes']['length']?_0x5f5cd0[_0x36c8('0x36')]:_0x320388[_0x36c8('0x30')];if(!_0x2cd17b['query'][_0x36c8('0x38')]('nolimit')){_0x5f5cd0['limit']=qs[_0x36c8('0x1c')](_0x2cd17b[_0x36c8('0x32')][_0x36c8('0x1c')]);_0x5f5cd0[_0x36c8('0x1a')]=qs['offset'](_0x2cd17b[_0x36c8('0x32')][_0x36c8('0x1a')]);}_0x5f5cd0[_0x36c8('0x39')]=qs['sort'](_0x2cd17b['query'][_0x36c8('0x3a')]);_0x5f5cd0[_0x36c8('0x3b')]=qs['filters'](_[_0x36c8('0x3c')](_0x2cd17b[_0x36c8('0x32')],_0x320388[_0x36c8('0x34')]),_0x320c59);if(_0x2cd17b[_0x36c8('0x32')][_0x36c8('0x3d')]){_0x5f5cd0[_0x36c8('0x3b')]=_[_0x36c8('0x3e')](_0x5f5cd0[_0x36c8('0x3b')],{'$or':_['map'](_0x320c59,function(_0x27e0e0){if(_0x27e0e0['type']!==_0x36c8('0x3f')){var _0x32a5bb={};_0x32a5bb[_0x27e0e0[_0x36c8('0x28')]]={'$like':'%'+_0x2cd17b[_0x36c8('0x32')][_0x36c8('0x3d')]+'%'};return _0x32a5bb;}})});}_0x5f5cd0=_[_0x36c8('0x3e')]({},_0x5f5cd0,_0x2cd17b[_0x36c8('0x40')]);var _0x328285={'where':_0x5f5cd0[_0x36c8('0x3b')]};return db[_0x36c8('0x2b')][_0x36c8('0x1d')](_0x328285)[_0x36c8('0x25')](function(_0x51a114){_0x1d6a5f['count']=_0x51a114;if(_0x2cd17b['query']['includeAll']){_0x5f5cd0['include']=[{'all':!![]}];}return db[_0x36c8('0x2b')][_0x36c8('0x41')](_0x5f5cd0);})[_0x36c8('0x25')](function(_0x4db610){_0x1d6a5f[_0x36c8('0x42')]=_0x4db610;return _0x1d6a5f;})['then'](respondWithFilteredResult(_0x23b88d,_0x5f5cd0))[_0x36c8('0x43')](handleError(_0x23b88d,null));};exports[_0x36c8('0x44')]=function(_0xd51d7f,_0x256f7f){var _0x3b885c={'raw':![],'where':{'id':_0xd51d7f[_0x36c8('0x45')]['id']}},_0x3dc282={};_0x3dc282[_0x36c8('0x30')]=_['keys'](db[_0x36c8('0x2b')]['rawAttributes']);_0x3dc282[_0x36c8('0x32')]=_['keys'](_0xd51d7f[_0x36c8('0x32')]);_0x3dc282['filters']=_['intersection'](_0x3dc282['model'],_0x3dc282['query']);_0x3b885c[_0x36c8('0x36')]=_[_0x36c8('0x35')](_0x3dc282[_0x36c8('0x30')],qs[_0x36c8('0x37')](_0xd51d7f[_0x36c8('0x32')]['fields']));_0x3b885c[_0x36c8('0x36')]=_0x3b885c[_0x36c8('0x36')][_0x36c8('0x46')]?_0x3b885c[_0x36c8('0x36')]:_0x3dc282[_0x36c8('0x30')];if(_0xd51d7f['query'][_0x36c8('0x47')]){_0x3b885c['include']=[{'all':!![]}];}_0x3b885c=_['merge']({},_0x3b885c,_0xd51d7f[_0x36c8('0x40')]);return db[_0x36c8('0x2b')][_0x36c8('0x48')](_0x3b885c)[_0x36c8('0x25')](handleEntityNotFound(_0x256f7f,null))['then'](respondWithResult(_0x256f7f,null))[_0x36c8('0x43')](handleError(_0x256f7f,null));};exports[_0x36c8('0x49')]=function(_0xb9d094,_0x3e8264){return db[_0x36c8('0x2b')][_0x36c8('0x49')](_0xb9d094[_0x36c8('0x4a')],{})[_0x36c8('0x25')](respondWithResult(_0x3e8264,0xc9))[_0x36c8('0x43')](handleError(_0x3e8264,null));};exports[_0x36c8('0x23')]=function(_0xf18f19,_0x28ab28){if(_0xf18f19[_0x36c8('0x4a')]['id']){delete _0xf18f19[_0x36c8('0x4a')]['id'];}return db[_0x36c8('0x2b')][_0x36c8('0x48')]({'where':{'id':_0xf18f19[_0x36c8('0x45')]['id']}})[_0x36c8('0x25')](handleEntityNotFound(_0x28ab28,null))['then'](saveUpdates(_0xf18f19[_0x36c8('0x4a')],null))[_0x36c8('0x25')](respondWithResult(_0x28ab28,null))['catch'](handleError(_0x28ab28,null));};exports[_0x36c8('0x24')]=function(_0x10403c,_0x5b5804){return db[_0x36c8('0x2b')][_0x36c8('0x48')]({'where':{'id':_0x10403c[_0x36c8('0x45')]['id']}})[_0x36c8('0x25')](handleEntityNotFound(_0x5b5804,null))[_0x36c8('0x25')](removeEntity(_0x5b5804,null))['catch'](handleError(_0x5b5804,null));};exports[_0x36c8('0x4b')]=function(_0x2d0154,_0x494dea){return db['IntegrationReport'][_0x36c8('0x4b')]()[_0x36c8('0x25')](respondWithResult(_0x494dea,null))['catch'](handleError(_0x494dea,null));}; \ No newline at end of file +var _0x96e7=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','send','map','IntegrationReport','rawAttributes','type','name','query','keys','intersection'];(function(_0x1f7042,_0x3c6143){var _0x1dd271=function(_0x1616f6){while(--_0x1616f6){_0x1f7042['push'](_0x1f7042['shift']());}};_0x1dd271(++_0x3c6143);}(_0x96e7,0xf3));var _0x796e=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x96e7[_0x5cc3d4];return _0x17ca31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x796e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x796e('0x1'));var rp=require(_0x796e('0x2'));var moment=require(_0x796e('0x3'));var BPromise=require(_0x796e('0x4'));var Mustache=require(_0x796e('0x5'));var util=require(_0x796e('0x6'));var path=require('path');var sox=require(_0x796e('0x7'));var csv=require(_0x796e('0x8'));var ejs=require(_0x796e('0x9'));var fs=require('fs');var fs_extra=require(_0x796e('0xa'));var _=require(_0x796e('0xb'));var squel=require(_0x796e('0xc'));var crypto=require(_0x796e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x796e('0x8'));var querystring=require('querystring');var Papa=require(_0x796e('0xe'));var Redis=require(_0x796e('0xf'));var authService=require(_0x796e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x796e('0x11'));var hardwareService=require(_0x796e('0x12'));var logger=require(_0x796e('0x13'))(_0x796e('0x14'));var utils=require(_0x796e('0x15'));var config=require(_0x796e('0x16'));var licenseUtil=require(_0x796e('0x17'));var db=require(_0x796e('0x18'))['db'];function respondWithStatusCode(_0x36261e,_0x4b6747){_0x4b6747=_0x4b6747||0xcc;return function(_0x29aff4){if(_0x29aff4){return _0x36261e['sendStatus'](_0x4b6747);}return _0x36261e[_0x796e('0x19')](_0x4b6747)[_0x796e('0x1a')]();};}function respondWithResult(_0x1702e5,_0x14990c){_0x14990c=_0x14990c||0xc8;return function(_0x3f542c){if(_0x3f542c){return _0x1702e5[_0x796e('0x19')](_0x14990c)['json'](_0x3f542c);}};}function respondWithFilteredResult(_0x140ce9,_0x109d90){return function(_0x345f22){if(_0x345f22){var _0x31efeb=typeof _0x109d90[_0x796e('0x1b')]===_0x796e('0x1c')&&typeof _0x109d90[_0x796e('0x1d')]===_0x796e('0x1c');var _0x17f67a=_0x345f22[_0x796e('0x1e')];var _0x21c6d=_0x31efeb?0x0:_0x109d90[_0x796e('0x1b')];var _0x2f13d6=_0x31efeb?_0x345f22['count']:_0x109d90[_0x796e('0x1b')]+_0x109d90[_0x796e('0x1d')];var _0x46981f;if(_0x2f13d6>=_0x17f67a){_0x2f13d6=_0x17f67a;_0x46981f=0xc8;}else{_0x46981f=0xce;}_0x140ce9[_0x796e('0x19')](_0x46981f);return _0x140ce9[_0x796e('0x1f')](_0x796e('0x20'),_0x21c6d+'-'+_0x2f13d6+'/'+_0x17f67a)[_0x796e('0x21')](_0x345f22);}return null;};}function patchUpdates(_0x350862){return function(_0x2af905){try{jsonpatch[_0x796e('0x22')](_0x2af905,_0x350862,!![]);}catch(_0x2650f0){return BPromise[_0x796e('0x23')](_0x2650f0);}return _0x2af905['save']();};}function saveUpdates(_0x53c56b,_0x1145b8){return function(_0x364ae5){if(_0x364ae5){return _0x364ae5[_0x796e('0x24')](_0x53c56b)[_0x796e('0x25')](function(_0x5bf2f6){return _0x5bf2f6;});}return null;};}function removeEntity(_0x404982,_0x44d372){return function(_0x40cb71){if(_0x40cb71){return _0x40cb71[_0x796e('0x26')]()['then'](function(){_0x404982[_0x796e('0x19')](0xcc)[_0x796e('0x1a')]();});}};}function handleEntityNotFound(_0x1745bb,_0x34e7cf){return function(_0x3bf8a6){if(!_0x3bf8a6){_0x1745bb[_0x796e('0x27')](0x194);}return _0x3bf8a6;};}function handleError(_0x50b81f,_0x3783c7){_0x3783c7=_0x3783c7||0x1f4;return function(_0x35c118){logger['error'](_0x35c118['stack']);if(_0x35c118['name']){delete _0x35c118['name'];}_0x50b81f[_0x796e('0x19')](_0x3783c7)[_0x796e('0x28')](_0x35c118);};}exports['index']=function(_0x4ce5ba,_0x450edd){var _0x937178={},_0x305dc8={},_0x35cec6={'count':0x0,'rows':[]};var _0x1dde2c=_[_0x796e('0x29')](db[_0x796e('0x2a')][_0x796e('0x2b')],function(_0x29fa01){return{'name':_0x29fa01['fieldName'],'type':_0x29fa01[_0x796e('0x2c')]['key']};});_0x305dc8['model']=_['map'](_0x1dde2c,_0x796e('0x2d'));_0x305dc8[_0x796e('0x2e')]=_[_0x796e('0x2f')](_0x4ce5ba[_0x796e('0x2e')]);_0x305dc8['filters']=_[_0x796e('0x30')](_0x305dc8[_0x796e('0x31')],_0x305dc8[_0x796e('0x2e')]);_0x937178[_0x796e('0x32')]=_[_0x796e('0x30')](_0x305dc8[_0x796e('0x31')],qs['fields'](_0x4ce5ba['query'][_0x796e('0x33')]));_0x937178['attributes']=_0x937178[_0x796e('0x32')][_0x796e('0x34')]?_0x937178[_0x796e('0x32')]:_0x305dc8['model'];if(!_0x4ce5ba[_0x796e('0x2e')][_0x796e('0x35')](_0x796e('0x36'))){_0x937178[_0x796e('0x1d')]=qs[_0x796e('0x1d')](_0x4ce5ba[_0x796e('0x2e')][_0x796e('0x1d')]);_0x937178[_0x796e('0x1b')]=qs[_0x796e('0x1b')](_0x4ce5ba[_0x796e('0x2e')][_0x796e('0x1b')]);}_0x937178['order']=qs[_0x796e('0x37')](_0x4ce5ba[_0x796e('0x2e')][_0x796e('0x37')]);_0x937178['where']=qs[_0x796e('0x38')](_['pick'](_0x4ce5ba[_0x796e('0x2e')],_0x305dc8['filters']),_0x1dde2c);if(_0x4ce5ba[_0x796e('0x2e')][_0x796e('0x39')]){_0x937178[_0x796e('0x3a')]=_[_0x796e('0x3b')](_0x937178[_0x796e('0x3a')],{'$or':_[_0x796e('0x29')](_0x1dde2c,function(_0x2a3cdf){if(_0x2a3cdf[_0x796e('0x2c')]!==_0x796e('0x3c')){var _0x37c121={};_0x37c121[_0x2a3cdf[_0x796e('0x2d')]]={'$like':'%'+_0x4ce5ba[_0x796e('0x2e')][_0x796e('0x39')]+'%'};return _0x37c121;}})});}_0x937178=_[_0x796e('0x3b')]({},_0x937178,_0x4ce5ba[_0x796e('0x3d')]);var _0x3d5368={'where':_0x937178[_0x796e('0x3a')]};return db['IntegrationReport']['count'](_0x3d5368)[_0x796e('0x25')](function(_0x32d3f2){_0x35cec6[_0x796e('0x1e')]=_0x32d3f2;if(_0x4ce5ba[_0x796e('0x2e')][_0x796e('0x3e')]){_0x937178[_0x796e('0x3f')]=[{'all':!![]}];}return db[_0x796e('0x2a')][_0x796e('0x40')](_0x937178);})[_0x796e('0x25')](function(_0x412a0c){_0x35cec6[_0x796e('0x41')]=_0x412a0c;return _0x35cec6;})['then'](respondWithFilteredResult(_0x450edd,_0x937178))[_0x796e('0x42')](handleError(_0x450edd,null));};exports[_0x796e('0x43')]=function(_0x12bdd1,_0xd4dc9c){var _0x14a83a={'raw':![],'where':{'id':_0x12bdd1['params']['id']}},_0x305ffc={};_0x305ffc[_0x796e('0x31')]=_['keys'](db[_0x796e('0x2a')][_0x796e('0x2b')]);_0x305ffc[_0x796e('0x2e')]=_['keys'](_0x12bdd1['query']);_0x305ffc[_0x796e('0x38')]=_['intersection'](_0x305ffc[_0x796e('0x31')],_0x305ffc['query']);_0x14a83a[_0x796e('0x32')]=_[_0x796e('0x30')](_0x305ffc[_0x796e('0x31')],qs[_0x796e('0x33')](_0x12bdd1['query']['fields']));_0x14a83a['attributes']=_0x14a83a[_0x796e('0x32')][_0x796e('0x34')]?_0x14a83a[_0x796e('0x32')]:_0x305ffc[_0x796e('0x31')];if(_0x12bdd1['query'][_0x796e('0x3e')]){_0x14a83a[_0x796e('0x3f')]=[{'all':!![]}];}_0x14a83a=_[_0x796e('0x3b')]({},_0x14a83a,_0x12bdd1[_0x796e('0x3d')]);return db['IntegrationReport'][_0x796e('0x44')](_0x14a83a)[_0x796e('0x25')](handleEntityNotFound(_0xd4dc9c,null))[_0x796e('0x25')](respondWithResult(_0xd4dc9c,null))['catch'](handleError(_0xd4dc9c,null));};exports[_0x796e('0x45')]=function(_0xb0867e,_0x280e5c){return db[_0x796e('0x2a')][_0x796e('0x45')](_0xb0867e['body'],{})[_0x796e('0x25')](respondWithResult(_0x280e5c,0xc9))[_0x796e('0x42')](handleError(_0x280e5c,null));};exports['update']=function(_0x21e877,_0x994afc){if(_0x21e877[_0x796e('0x46')]['id']){delete _0x21e877[_0x796e('0x46')]['id'];}return db[_0x796e('0x2a')]['find']({'where':{'id':_0x21e877[_0x796e('0x47')]['id']}})[_0x796e('0x25')](handleEntityNotFound(_0x994afc,null))['then'](saveUpdates(_0x21e877[_0x796e('0x46')],null))['then'](respondWithResult(_0x994afc,null))['catch'](handleError(_0x994afc,null));};exports[_0x796e('0x26')]=function(_0x2a858d,_0x5204a5){return db['IntegrationReport'][_0x796e('0x44')]({'where':{'id':_0x2a858d[_0x796e('0x47')]['id']}})[_0x796e('0x25')](handleEntityNotFound(_0x5204a5,null))[_0x796e('0x25')](removeEntity(_0x5204a5,null))[_0x796e('0x42')](handleError(_0x5204a5,null));};exports[_0x796e('0x48')]=function(_0x4bd1ee,_0x57e4c8){return db[_0x796e('0x2a')][_0x796e('0x48')]()['then'](respondWithResult(_0x57e4c8,null))[_0x796e('0x42')](handleError(_0x57e4c8,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 4aa7592..d3fbbcc 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 _0x66d0=['report_integration','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','IntegrationReport'];(function(_0x2cd809,_0x4cdedd){var _0x5a1519=function(_0x510aaa){while(--_0x510aaa){_0x2cd809['push'](_0x2cd809['shift']());}};_0x5a1519(++_0x4cdedd);}(_0x66d0,0x181));var _0x066d=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x66d0[_0x5dee2a];return _0x31e98e;};'use strict';var _=require(_0x066d('0x0'));var util=require(_0x066d('0x1'));var logger=require('../../config/logger')(_0x066d('0x2'));var moment=require(_0x066d('0x3'));var BPromise=require(_0x066d('0x4'));var rp=require(_0x066d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x066d('0x6'));var config=require(_0x066d('0x7'));var attributes=require('./integrationReport.attributes');module[_0x066d('0x8')]=function(_0x50baca,_0x26ec4e){return _0x50baca[_0x066d('0x9')](_0x066d('0xa'),attributes,{'tableName':_0x066d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f9a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x11e0f2,_0x45f7fe){var _0xb707d=function(_0x486b55){while(--_0x486b55){_0x11e0f2['push'](_0x11e0f2['shift']());}};_0xb707d(++_0x45f7fe);}(_0x8f9a,0xfc));var _0xa8f9=function(_0x554a70,_0x40bee8){_0x554a70=_0x554a70-0x0;var _0x83d4ac=_0x8f9a[_0x554a70];return _0x83d4ac;};'use strict';var _=require(_0xa8f9('0x0'));var util=require(_0xa8f9('0x1'));var logger=require(_0xa8f9('0x2'))(_0xa8f9('0x3'));var moment=require(_0xa8f9('0x4'));var BPromise=require(_0xa8f9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa8f9('0x6'));var config=require(_0xa8f9('0x7'));var attributes=require(_0xa8f9('0x8'));module[_0xa8f9('0x9')]=function(_0x2d1e85,_0x50c6b4){return _0x2d1e85[_0xa8f9('0xa')](_0xa8f9('0xb'),attributes,{'tableName':'report_integration','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 502b8d4..296dc9f 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x19acd5,_0xa5ec90){var _0xa3dc43=function(_0x5d566c){while(--_0x5d566c){_0x19acd5['push'](_0x19acd5['shift']());}};_0xa3dc43(++_0xa5ec90);}(_0xabce,0x103));var _0xeabc=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xabce[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('IntegrationReport,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5925e9,_0x51b161){var _0x72efff=function(_0x428750){while(--_0x428750){_0x5925e9['push'](_0x5925e9['shift']());}};_0x72efff(++_0x51b161);}(_0x31f0,0xb7));var _0x031f=function(_0x2d0baf,_0x56f36c){_0x2d0baf=_0x2d0baf-0x0;var _0x43946a=_0x31f0[_0x2d0baf];return _0x43946a;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 9d043b9..d66e933 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 _0x4c41=['getIntervals','create','addInterval','post','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals'];(function(_0x1c2ae6,_0x48abfc){var _0x534f40=function(_0x59e59d){while(--_0x59e59d){_0x1c2ae6['push'](_0x1c2ae6['shift']());}};_0x534f40(++_0x48abfc);}(_0x4c41,0xda));var _0x14c4=function(_0x43efad,_0x23ab5e){_0x43efad=_0x43efad-0x0;var _0x323872=_0x4c41[_0x43efad];return _0x323872;};'use strict';var multer=require(_0x14c4('0x0'));var util=require(_0x14c4('0x1'));var path=require(_0x14c4('0x2'));var timeout=require(_0x14c4('0x3'));var express=require(_0x14c4('0x4'));var router=express['Router']();var fs_extra=require(_0x14c4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x14c4('0x6'));var controller=require(_0x14c4('0x7'));router[_0x14c4('0x8')]('/',auth[_0x14c4('0x9')](),controller[_0x14c4('0xa')]);router[_0x14c4('0x8')]('/:id',auth[_0x14c4('0x9')](),controller[_0x14c4('0xb')]);router['get'](_0x14c4('0xc'),auth[_0x14c4('0x9')](),controller[_0x14c4('0xd')]);router['post']('/',auth[_0x14c4('0x9')](),controller[_0x14c4('0xe')]);router['post'](_0x14c4('0xc'),auth[_0x14c4('0x9')](),controller[_0x14c4('0xf')]);router[_0x14c4('0x10')]('/:id/sub_intervals/create_many',auth[_0x14c4('0x9')](),controller['addIntervals']);router['put'](_0x14c4('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x14c4('0x12')](_0x14c4('0x11'),auth['isAuthenticated'](),controller[_0x14c4('0x13')]);module[_0x14c4('0x14')]=router; \ No newline at end of file +var _0xd819=['/:id/sub_intervals/create_many','addIntervals','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','post','create'];(function(_0x50859e,_0x2c958a){var _0x5847a2=function(_0x265a30){while(--_0x265a30){_0x50859e['push'](_0x50859e['shift']());}};_0x5847a2(++_0x2c958a);}(_0xd819,0x181));var _0x9d81=function(_0x141a2f,_0x58d944){_0x141a2f=_0x141a2f-0x0;var _0x1e84d3=_0xd819[_0x141a2f];return _0x1e84d3;};'use strict';var multer=require('multer');var util=require(_0x9d81('0x0'));var path=require(_0x9d81('0x1'));var timeout=require(_0x9d81('0x2'));var express=require(_0x9d81('0x3'));var router=express['Router']();var fs_extra=require(_0x9d81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9d81('0x5'));var config=require('../../config/environment');var controller=require(_0x9d81('0x6'));router[_0x9d81('0x7')]('/',auth[_0x9d81('0x8')](),controller['index']);router[_0x9d81('0x7')](_0x9d81('0x9'),auth[_0x9d81('0x8')](),controller[_0x9d81('0xa')]);router[_0x9d81('0x7')](_0x9d81('0xb'),auth[_0x9d81('0x8')](),controller[_0x9d81('0xc')]);router[_0x9d81('0xd')]('/',auth[_0x9d81('0x8')](),controller[_0x9d81('0xe')]);router[_0x9d81('0xd')](_0x9d81('0xb'),auth[_0x9d81('0x8')](),controller['addInterval']);router[_0x9d81('0xd')](_0x9d81('0xf'),auth['isAuthenticated'](),controller[_0x9d81('0x10')]);router[_0x9d81('0x11')](_0x9d81('0x9'),auth[_0x9d81('0x8')](),controller['update']);router[_0x9d81('0x12')]('/:id',auth[_0x9d81('0x8')](),controller['destroy']);module[_0x9d81('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 430cdf7..12c11e1 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 _0x350a=['STRING','exports'];(function(_0x4373f7,_0x5d774d){var _0x2f6064=function(_0x220c8b){while(--_0x220c8b){_0x4373f7['push'](_0x4373f7['shift']());}};_0x2f6064(++_0x5d774d);}(_0x350a,0xa1));var _0xa350=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x350a[_0x166d93];return _0xba708;};'use strict';var Sequelize=require('sequelize');module[_0xa350('0x0')]={'name':{'type':Sequelize[_0xa350('0x1')]},'description':{'type':Sequelize[_0xa350('0x1')]},'interval':{'type':Sequelize[_0xa350('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xc36e=['STRING','sequelize'];(function(_0x53b594,_0x559767){var _0x1e616f=function(_0x333eda){while(--_0x333eda){_0x53b594['push'](_0x53b594['shift']());}};_0x1e616f(++_0x559767);}(_0xc36e,0x127));var _0xec36=function(_0xf94fee,_0x44468e){_0xf94fee=_0xf94fee-0x0;var _0x5bf979=_0xc36e[_0xf94fee];return _0x5bf979;};'use strict';var Sequelize=require(_0xec36('0x0'));module['exports']={'name':{'type':Sequelize[_0xec36('0x1')]},'description':{'type':Sequelize[_0xec36('0x1')]},'interval':{'type':Sequelize[_0xec36('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 aef7143..3801e52 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 _0x74a6=['bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','name','send','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction'];(function(_0x324f7d,_0x3a0184){var _0x158d1e=function(_0x460f99){while(--_0x460f99){_0x324f7d['push'](_0x324f7d['shift']());}};_0x158d1e(++_0x3a0184);}(_0x74a6,0x179));var _0x674a=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x74a6[_0x3a7634];return _0x23bbe9;};'use strict';var emlformat=require(_0x674a('0x0'));var rimraf=require(_0x674a('0x1'));var zipdir=require(_0x674a('0x2'));var jsonpatch=require(_0x674a('0x3'));var rp=require(_0x674a('0x4'));var moment=require(_0x674a('0x5'));var BPromise=require(_0x674a('0x6'));var Mustache=require(_0x674a('0x7'));var util=require(_0x674a('0x8'));var path=require(_0x674a('0x9'));var sox=require(_0x674a('0xa'));var csv=require('to-csv');var ejs=require(_0x674a('0xb'));var fs=require('fs');var fs_extra=require(_0x674a('0xc'));var _=require('lodash');var squel=require(_0x674a('0xd'));var crypto=require(_0x674a('0xe'));var jsforce=require(_0x674a('0xf'));var deskjs=require(_0x674a('0x10'));var toCsv=require(_0x674a('0x11'));var querystring=require('querystring');var Papa=require(_0x674a('0x12'));var Redis=require(_0x674a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x674a('0x14'));var logger=require(_0x674a('0x15'))(_0x674a('0x16'));var utils=require(_0x674a('0x17'));var config=require(_0x674a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x674a('0x19'))['db'];var extensions=require(_0x674a('0x1a'));function respondWithStatusCode(_0x269bf5,_0x38af09){_0x38af09=_0x38af09||0xcc;return function(_0x32ca3a){if(_0x32ca3a){return _0x269bf5[_0x674a('0x1b')](_0x38af09);}return _0x269bf5[_0x674a('0x1c')](_0x38af09)['end']();};}function respondWithResult(_0x3c1cf9,_0x2f2eb7){_0x2f2eb7=_0x2f2eb7||0xc8;return function(_0x2d6d41){if(_0x2d6d41){return _0x3c1cf9['status'](_0x2f2eb7)[_0x674a('0x1d')](_0x2d6d41);}};}function respondWithFilteredResult(_0x27ddd0,_0x1ccbad){return function(_0x3a5c26){if(_0x3a5c26){var _0x1bf0bc=typeof _0x1ccbad[_0x674a('0x1e')]===_0x674a('0x1f')&&typeof _0x1ccbad[_0x674a('0x20')]==='undefined';var _0x26e521=_0x3a5c26[_0x674a('0x21')];var _0xd7b654=_0x1bf0bc?0x0:_0x1ccbad[_0x674a('0x1e')];var _0x2dec21=_0x1bf0bc?_0x3a5c26[_0x674a('0x21')]:_0x1ccbad[_0x674a('0x1e')]+_0x1ccbad[_0x674a('0x20')];var _0x228eaf;if(_0x2dec21>=_0x26e521){_0x2dec21=_0x26e521;_0x228eaf=0xc8;}else{_0x228eaf=0xce;}_0x27ddd0[_0x674a('0x1c')](_0x228eaf);return _0x27ddd0[_0x674a('0x22')](_0x674a('0x23'),_0xd7b654+'-'+_0x2dec21+'/'+_0x26e521)[_0x674a('0x1d')](_0x3a5c26);}return null;};}function patchUpdates(_0xf6d088){return function(_0x5c381b){try{jsonpatch[_0x674a('0x24')](_0x5c381b,_0xf6d088,!![]);}catch(_0x414548){return BPromise[_0x674a('0x25')](_0x414548);}return _0x5c381b[_0x674a('0x26')]();};}function saveUpdates(_0x4dccc7,_0x5e6776){return function(_0x382f04){if(_0x382f04){return _0x382f04[_0x674a('0x27')](_0x4dccc7)[_0x674a('0x28')](function(_0x2d3f12){return _0x2d3f12;});}return null;};}function removeEntity(_0x880b35,_0x443986){return function(_0x2df695){if(_0x2df695){return _0x2df695[_0x674a('0x29')]()[_0x674a('0x28')](function(){var _0x4a5657=_0x2df695[_0x674a('0x2a')]({'plain':!![]});var _0x414851='Intervals';return db[_0x674a('0x2b')]['destroy']({'where':{'type':_0x414851,'resourceId':_0x4a5657['id']}})['then'](function(){return _0x2df695;});})[_0x674a('0x28')](function(){_0x880b35[_0x674a('0x1c')](0xcc)[_0x674a('0x2c')]();});}};}function handleEntityNotFound(_0x326c55,_0x3b52d2){return function(_0x39918a){if(!_0x39918a){_0x326c55[_0x674a('0x1b')](0x194);}return _0x39918a;};}function handleError(_0x118a5e,_0x2ca06f){_0x2ca06f=_0x2ca06f||0x1f4;return function(_0x24edfb){logger['error'](_0x24edfb['stack']);if(_0x24edfb[_0x674a('0x2d')]){delete _0x24edfb['name'];}_0x118a5e[_0x674a('0x1c')](_0x2ca06f)[_0x674a('0x2e')](_0x24edfb);};}exports['index']=function(_0x1c4fb8,_0xc3481d){var _0xbf3278={},_0x50b403={},_0x237328={'count':0x0,'rows':[]};var _0x1315e6=_[_0x674a('0x2f')](db[_0x674a('0x30')][_0x674a('0x31')],function(_0x1627dc){return{'name':_0x1627dc[_0x674a('0x32')],'type':_0x1627dc[_0x674a('0x33')][_0x674a('0x34')]};});_0x50b403[_0x674a('0x35')]=_[_0x674a('0x2f')](_0x1315e6,_0x674a('0x2d'));_0x50b403[_0x674a('0x36')]=_[_0x674a('0x37')](_0x1c4fb8['query']);_0x50b403[_0x674a('0x38')]=_[_0x674a('0x39')](_0x50b403[_0x674a('0x35')],_0x50b403[_0x674a('0x36')]);_0xbf3278['attributes']=_[_0x674a('0x39')](_0x50b403[_0x674a('0x35')],qs[_0x674a('0x3a')](_0x1c4fb8['query']['fields']));_0xbf3278[_0x674a('0x3b')]=_0xbf3278['attributes']['length']?_0xbf3278[_0x674a('0x3b')]:_0x50b403[_0x674a('0x35')];if(!_0x1c4fb8['query'][_0x674a('0x3c')](_0x674a('0x3d'))){_0xbf3278[_0x674a('0x20')]=qs[_0x674a('0x20')](_0x1c4fb8[_0x674a('0x36')][_0x674a('0x20')]);_0xbf3278[_0x674a('0x1e')]=qs[_0x674a('0x1e')](_0x1c4fb8['query'][_0x674a('0x1e')]);}_0xbf3278[_0x674a('0x3e')]=qs[_0x674a('0x3f')](_0x1c4fb8[_0x674a('0x36')][_0x674a('0x3f')]);_0xbf3278[_0x674a('0x40')]=qs['filters'](_[_0x674a('0x41')](_0x1c4fb8[_0x674a('0x36')],_0x50b403[_0x674a('0x38')]),_0x1315e6);if(_0x1c4fb8['query'][_0x674a('0x42')]){_0xbf3278['where']=_[_0x674a('0x43')](_0xbf3278[_0x674a('0x40')],{'$or':_[_0x674a('0x2f')](_0x1315e6,function(_0x49f5e5){if(_0x49f5e5[_0x674a('0x33')]!==_0x674a('0x44')){var _0x5411bc={};_0x5411bc[_0x49f5e5[_0x674a('0x2d')]]={'$like':'%'+_0x1c4fb8[_0x674a('0x36')][_0x674a('0x42')]+'%'};return _0x5411bc;}})});}_0xbf3278=_[_0x674a('0x43')]({},_0xbf3278,_0x1c4fb8['options']);var _0x1eec53={'where':_0xbf3278[_0x674a('0x40')]};return db[_0x674a('0x30')][_0x674a('0x21')](_0x1eec53)[_0x674a('0x28')](function(_0xbbc6e9){_0x237328['count']=_0xbbc6e9;if(_0x1c4fb8[_0x674a('0x36')][_0x674a('0x45')]){_0xbf3278[_0x674a('0x46')]=[{'all':!![]}];}return db['Interval'][_0x674a('0x47')](_0xbf3278);})[_0x674a('0x28')](function(_0x1f899a){_0x237328[_0x674a('0x48')]=_0x1f899a;return _0x237328;})['then'](respondWithFilteredResult(_0xc3481d,_0xbf3278))[_0x674a('0x49')](handleError(_0xc3481d,null));};exports['show']=function(_0x413f0b,_0x2a12e1){var _0x5b68e3={'raw':!![],'where':{'id':_0x413f0b[_0x674a('0x4a')]['id']}},_0x4e64b4={};_0x4e64b4['model']=_[_0x674a('0x37')](db[_0x674a('0x30')][_0x674a('0x31')]);_0x4e64b4[_0x674a('0x36')]=_[_0x674a('0x37')](_0x413f0b[_0x674a('0x36')]);_0x4e64b4['filters']=_['intersection'](_0x4e64b4[_0x674a('0x35')],_0x4e64b4[_0x674a('0x36')]);_0x5b68e3[_0x674a('0x3b')]=_['intersection'](_0x4e64b4['model'],qs[_0x674a('0x3a')](_0x413f0b[_0x674a('0x36')][_0x674a('0x3a')]));_0x5b68e3[_0x674a('0x3b')]=_0x5b68e3[_0x674a('0x3b')][_0x674a('0x4b')]?_0x5b68e3[_0x674a('0x3b')]:_0x4e64b4[_0x674a('0x35')];if(_0x413f0b[_0x674a('0x36')][_0x674a('0x45')]){_0x5b68e3[_0x674a('0x46')]=[{'all':!![]}];}_0x5b68e3=_[_0x674a('0x43')]({},_0x5b68e3,_0x413f0b[_0x674a('0x4c')]);return db['Interval'][_0x674a('0x4d')](_0x5b68e3)['then'](handleEntityNotFound(_0x2a12e1,null))['then'](respondWithResult(_0x2a12e1,null))[_0x674a('0x49')](handleError(_0x2a12e1,null));};exports[_0x674a('0x4e')]=function(_0x5a819d,_0x1eec8a){return db[_0x674a('0x30')][_0x674a('0x4e')](_0x5a819d['body'],{})[_0x674a('0x28')](function(_0x5608df){var _0x32d906=_0x5a819d[_0x674a('0x4f')][_0x674a('0x2a')]({'plain':!![]});if(!_0x32d906)throw new Error(_0x674a('0x50'));if(_0x32d906[_0x674a('0x51')]==='user'){var _0x4a7385=_0x5608df['get']({'plain':!![]});var _0x1c3f2c=_0x674a('0x52');return db['UserProfileSection'][_0x674a('0x4d')]({'where':{'name':_0x1c3f2c,'userProfileId':_0x32d906['userProfileId']},'raw':!![]})[_0x674a('0x28')](function(_0x583ded){if(_0x583ded&&_0x583ded[_0x674a('0x53')]===0x0){return db[_0x674a('0x2b')][_0x674a('0x4e')]({'name':_0x4a7385[_0x674a('0x2d')],'resourceId':_0x4a7385['id'],'type':_0x583ded[_0x674a('0x2d')],'sectionId':_0x583ded['id']},{})['then'](function(){return _0x5608df;});}else{return _0x5608df;}})['catch'](function(_0x2ca7a3){logger[_0x674a('0x54')](_0x674a('0x55'),_0x2ca7a3);throw _0x2ca7a3;});}return _0x5608df;})['then'](respondWithResult(_0x1eec8a,0xc9))[_0x674a('0x49')](handleError(_0x1eec8a,null));};exports[_0x674a('0x27')]=function(_0x2e786f,_0xefb63d){if(_0x2e786f[_0x674a('0x56')]['id']){delete _0x2e786f[_0x674a('0x56')]['id'];}return db[_0x674a('0x30')][_0x674a('0x4d')]({'where':{'id':_0x2e786f[_0x674a('0x4a')]['id']}})[_0x674a('0x28')](handleEntityNotFound(_0xefb63d,null))[_0x674a('0x28')](saveUpdates(_0x2e786f[_0x674a('0x56')],null))[_0x674a('0x28')](respondWithResult(_0xefb63d,null))[_0x674a('0x49')](handleError(_0xefb63d,null));};exports[_0x674a('0x29')]=function(_0x47900a,_0x585eb1){return db[_0x674a('0x30')][_0x674a('0x4d')]({'where':{'id':_0x47900a['params']['id']}})[_0x674a('0x28')](handleEntityNotFound(_0x585eb1,null))[_0x674a('0x28')](removeEntity(_0x585eb1,null))[_0x674a('0x49')](handleError(_0x585eb1,null));};exports['addInterval']=function(_0x484d6e,_0x2830f2,_0x41ebf9){if(_0x484d6e[_0x674a('0x56')]['id']){delete _0x484d6e['body']['id'];}return db['Interval'][_0x674a('0x4d')]({'where':{'id':_0x484d6e[_0x674a('0x4a')]['id']}})[_0x674a('0x28')](handleEntityNotFound(_0x2830f2,null))[_0x674a('0x28')](function(_0x4d21dd){if(_0x4d21dd){_0x484d6e[_0x674a('0x56')][_0x674a('0x57')]=_0x4d21dd['id'];return db[_0x674a('0x30')][_0x674a('0x4e')](_0x484d6e[_0x674a('0x56')]);}})[_0x674a('0x28')](respondWithResult(_0x2830f2,null))[_0x674a('0x49')](handleError(_0x2830f2,null));};exports[_0x674a('0x58')]=function(_0x45027d,_0x67dad5,_0x1e668f){var _0x4069b5={};var _0x39d729={};var _0x51a149;var _0x50e79b;return db[_0x674a('0x30')]['findOne']({'where':{'id':_0x45027d[_0x674a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x67dad5,null))[_0x674a('0x28')](function(_0x50ca51){if(_0x50ca51){_0x51a149=_0x50ca51;_0x39d729[_0x674a('0x35')]=_[_0x674a('0x37')](db[_0x674a('0x30')][_0x674a('0x31')]);_0x39d729[_0x674a('0x36')]=_[_0x674a('0x37')](_0x45027d[_0x674a('0x36')]);_0x39d729[_0x674a('0x38')]=_[_0x674a('0x39')](_0x39d729[_0x674a('0x35')],_0x39d729[_0x674a('0x36')]);_0x4069b5[_0x674a('0x3b')]=_['intersection'](_0x39d729[_0x674a('0x35')],qs[_0x674a('0x3a')](_0x45027d[_0x674a('0x36')][_0x674a('0x3a')]));_0x4069b5[_0x674a('0x3b')]=_0x4069b5[_0x674a('0x3b')][_0x674a('0x4b')]?_0x4069b5[_0x674a('0x3b')]:_0x39d729[_0x674a('0x35')];_0x4069b5[_0x674a('0x3e')]=qs['sort'](_0x45027d[_0x674a('0x36')][_0x674a('0x3f')]);_0x4069b5[_0x674a('0x40')]=qs[_0x674a('0x38')](_[_0x674a('0x41')](_0x45027d[_0x674a('0x36')],_0x39d729[_0x674a('0x38')]));if(_0x45027d[_0x674a('0x36')]['filter']){_0x4069b5['where']=_[_0x674a('0x43')](_0x4069b5[_0x674a('0x40')],{'$or':_['map'](_0x4069b5[_0x674a('0x3b')],function(_0x5d22c6){var _0x3b0f5a={};_0x3b0f5a[_0x5d22c6]={'$like':'%'+_0x45027d[_0x674a('0x36')][_0x674a('0x42')]+'%'};return _0x3b0f5a;})});}_0x4069b5=_[_0x674a('0x43')]({},_0x4069b5,_0x45027d[_0x674a('0x4c')]);return _0x51a149[_0x674a('0x58')](_0x4069b5);}})[_0x674a('0x28')](function(_0x1f5c22){if(_0x1f5c22){_0x50e79b=_0x1f5c22['length'];if(!_0x45027d[_0x674a('0x36')][_0x674a('0x3c')](_0x674a('0x3d'))){_0x4069b5[_0x674a('0x20')]=qs[_0x674a('0x20')](_0x45027d[_0x674a('0x36')][_0x674a('0x20')]);_0x4069b5[_0x674a('0x1e')]=qs[_0x674a('0x1e')](_0x45027d[_0x674a('0x36')]['offset']);}return _0x51a149['getIntervals'](_0x4069b5);}})[_0x674a('0x28')](function(_0x477ddb){if(_0x477ddb){return _0x477ddb?{'count':_0x50e79b,'rows':_0x477ddb}:null;}})[_0x674a('0x28')](respondWithResult(_0x67dad5,null))[_0x674a('0x49')](handleError(_0x67dad5,null));};exports[_0x674a('0x59')]=function(_0x5da066,_0x37858d,_0x3c7439){return db[_0x674a('0x30')][_0x674a('0x5a')]({'where':{'id':_0x5da066[_0x674a('0x4a')]['id']}})[_0x674a('0x28')](handleEntityNotFound(_0x37858d,null))[_0x674a('0x28')](function(_0x130191){if(_0x130191){return db[_0x674a('0x5b')][_0x674a('0x5c')](function(_0x582fe5){return db[_0x674a('0x30')]['destroy']({'where':{'IntervalId':_0x5da066[_0x674a('0x4a')]['id']},'transaction':_0x582fe5})['then'](function(_0x5aeaa7){var _0x3be131=_[_0x674a('0x2f')](_0x5da066[_0x674a('0x56')],function(_0x78ab8b){delete _0x78ab8b['id'];_0x78ab8b[_0x674a('0x57')]=_0x5da066['params']['id'];return _0x78ab8b;});return db['Interval'][_0x674a('0x5d')](_0x3be131,{'transaction':_0x582fe5});});})['then'](function(){return db[_0x674a('0x30')]['findAll']({'where':{'IntervalId':_0x5da066[_0x674a('0x4a')]['id']}});});}})[_0x674a('0x28')](respondWithResult(_0x37858d,null))[_0x674a('0x49')](handleError(_0x37858d,null));}; \ No newline at end of file +var _0xaeac=['UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','bulkCreate','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Interval','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals'];(function(_0x484bc7,_0x50c9bd){var _0x3481ef=function(_0x26ca76){while(--_0x26ca76){_0x484bc7['push'](_0x484bc7['shift']());}};_0x3481ef(++_0x50c9bd);}(_0xaeac,0x1d4));var _0xcaea=function(_0xf32513,_0x1efd92){_0xf32513=_0xf32513-0x0;var _0x142e80=_0xaeac[_0xf32513];return _0x142e80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaea('0x0'));var zipdir=require(_0xcaea('0x1'));var jsonpatch=require(_0xcaea('0x2'));var rp=require(_0xcaea('0x3'));var moment=require(_0xcaea('0x4'));var BPromise=require(_0xcaea('0x5'));var Mustache=require(_0xcaea('0x6'));var util=require(_0xcaea('0x7'));var path=require(_0xcaea('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(_0xcaea('0x9'));var squel=require(_0xcaea('0xa'));var crypto=require('crypto');var jsforce=require(_0xcaea('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcaea('0xc'));var Papa=require(_0xcaea('0xd'));var Redis=require(_0xcaea('0xe'));var authService=require(_0xcaea('0xf'));var qs=require(_0xcaea('0x10'));var as=require(_0xcaea('0x11'));var hardwareService=require(_0xcaea('0x12'));var logger=require('../../config/logger')(_0xcaea('0x13'));var utils=require('../../config/utils');var config=require(_0xcaea('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcaea('0x15'))['db'];var extensions=require(_0xcaea('0x16'));function respondWithStatusCode(_0x2ef9e1,_0x488be6){_0x488be6=_0x488be6||0xcc;return function(_0x2d7a31){if(_0x2d7a31){return _0x2ef9e1['sendStatus'](_0x488be6);}return _0x2ef9e1[_0xcaea('0x17')](_0x488be6)[_0xcaea('0x18')]();};}function respondWithResult(_0x5f2a69,_0x404347){_0x404347=_0x404347||0xc8;return function(_0x4ae5b7){if(_0x4ae5b7){return _0x5f2a69[_0xcaea('0x17')](_0x404347)[_0xcaea('0x19')](_0x4ae5b7);}};}function respondWithFilteredResult(_0x189073,_0x234301){return function(_0x6afccd){if(_0x6afccd){var _0x563583=typeof _0x234301[_0xcaea('0x1a')]==='undefined'&&typeof _0x234301[_0xcaea('0x1b')]===_0xcaea('0x1c');var _0x220237=_0x6afccd[_0xcaea('0x1d')];var _0xd7fba3=_0x563583?0x0:_0x234301[_0xcaea('0x1a')];var _0x2d4816=_0x563583?_0x6afccd['count']:_0x234301[_0xcaea('0x1a')]+_0x234301['limit'];var _0x2af959;if(_0x2d4816>=_0x220237){_0x2d4816=_0x220237;_0x2af959=0xc8;}else{_0x2af959=0xce;}_0x189073[_0xcaea('0x17')](_0x2af959);return _0x189073['set'](_0xcaea('0x1e'),_0xd7fba3+'-'+_0x2d4816+'/'+_0x220237)['json'](_0x6afccd);}return null;};}function patchUpdates(_0x1d4452){return function(_0x4cf07a){try{jsonpatch[_0xcaea('0x1f')](_0x4cf07a,_0x1d4452,!![]);}catch(_0x933cea){return BPromise[_0xcaea('0x20')](_0x933cea);}return _0x4cf07a[_0xcaea('0x21')]();};}function saveUpdates(_0x32ed19,_0x8d9bd8){return function(_0x3ba407){if(_0x3ba407){return _0x3ba407[_0xcaea('0x22')](_0x32ed19)['then'](function(_0x31a6ab){return _0x31a6ab;});}return null;};}function removeEntity(_0x1a501e,_0x3bbf7b){return function(_0x4f1bdd){if(_0x4f1bdd){return _0x4f1bdd[_0xcaea('0x23')]()['then'](function(){var _0x136bf1=_0x4f1bdd[_0xcaea('0x24')]({'plain':!![]});var _0x24b28d='Intervals';return db[_0xcaea('0x25')][_0xcaea('0x23')]({'where':{'type':_0x24b28d,'resourceId':_0x136bf1['id']}})['then'](function(){return _0x4f1bdd;});})[_0xcaea('0x26')](function(){_0x1a501e[_0xcaea('0x17')](0xcc)[_0xcaea('0x18')]();});}};}function handleEntityNotFound(_0x1b3314,_0x9ce89f){return function(_0x1e10e6){if(!_0x1e10e6){_0x1b3314[_0xcaea('0x27')](0x194);}return _0x1e10e6;};}function handleError(_0x561b27,_0x42691f){_0x42691f=_0x42691f||0x1f4;return function(_0x70290f){logger[_0xcaea('0x28')](_0x70290f[_0xcaea('0x29')]);if(_0x70290f[_0xcaea('0x2a')]){delete _0x70290f[_0xcaea('0x2a')];}_0x561b27['status'](_0x42691f)[_0xcaea('0x2b')](_0x70290f);};}exports[_0xcaea('0x2c')]=function(_0x3c5926,_0x2ca0f6){var _0x17a906={},_0x3d2992={},_0x487429={'count':0x0,'rows':[]};var _0x25462e=_[_0xcaea('0x2d')](db['Interval'][_0xcaea('0x2e')],function(_0x36db87){return{'name':_0x36db87[_0xcaea('0x2f')],'type':_0x36db87[_0xcaea('0x30')][_0xcaea('0x31')]};});_0x3d2992[_0xcaea('0x32')]=_[_0xcaea('0x2d')](_0x25462e,'name');_0x3d2992[_0xcaea('0x33')]=_[_0xcaea('0x34')](_0x3c5926['query']);_0x3d2992[_0xcaea('0x35')]=_[_0xcaea('0x36')](_0x3d2992[_0xcaea('0x32')],_0x3d2992[_0xcaea('0x33')]);_0x17a906[_0xcaea('0x37')]=_[_0xcaea('0x36')](_0x3d2992[_0xcaea('0x32')],qs[_0xcaea('0x38')](_0x3c5926[_0xcaea('0x33')][_0xcaea('0x38')]));_0x17a906[_0xcaea('0x37')]=_0x17a906[_0xcaea('0x37')][_0xcaea('0x39')]?_0x17a906[_0xcaea('0x37')]:_0x3d2992[_0xcaea('0x32')];if(!_0x3c5926[_0xcaea('0x33')][_0xcaea('0x3a')](_0xcaea('0x3b'))){_0x17a906[_0xcaea('0x1b')]=qs[_0xcaea('0x1b')](_0x3c5926['query'][_0xcaea('0x1b')]);_0x17a906[_0xcaea('0x1a')]=qs['offset'](_0x3c5926[_0xcaea('0x33')]['offset']);}_0x17a906[_0xcaea('0x3c')]=qs[_0xcaea('0x3d')](_0x3c5926[_0xcaea('0x33')][_0xcaea('0x3d')]);_0x17a906['where']=qs[_0xcaea('0x35')](_[_0xcaea('0x3e')](_0x3c5926[_0xcaea('0x33')],_0x3d2992[_0xcaea('0x35')]),_0x25462e);if(_0x3c5926[_0xcaea('0x33')]['filter']){_0x17a906[_0xcaea('0x3f')]=_[_0xcaea('0x40')](_0x17a906['where'],{'$or':_['map'](_0x25462e,function(_0x3af469){if(_0x3af469[_0xcaea('0x30')]!==_0xcaea('0x41')){var _0x38bd4a={};_0x38bd4a[_0x3af469['name']]={'$like':'%'+_0x3c5926['query'][_0xcaea('0x42')]+'%'};return _0x38bd4a;}})});}_0x17a906=_[_0xcaea('0x40')]({},_0x17a906,_0x3c5926[_0xcaea('0x43')]);var _0x4ab831={'where':_0x17a906['where']};return db[_0xcaea('0x44')]['count'](_0x4ab831)[_0xcaea('0x26')](function(_0x2184d3){_0x487429[_0xcaea('0x1d')]=_0x2184d3;if(_0x3c5926['query'][_0xcaea('0x45')]){_0x17a906[_0xcaea('0x46')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x17a906);})[_0xcaea('0x26')](function(_0x121418){_0x487429['rows']=_0x121418;return _0x487429;})['then'](respondWithFilteredResult(_0x2ca0f6,_0x17a906))['catch'](handleError(_0x2ca0f6,null));};exports['show']=function(_0x7961d6,_0x4c712a){var _0x1b6e05={'raw':!![],'where':{'id':_0x7961d6['params']['id']}},_0x27b275={};_0x27b275[_0xcaea('0x32')]=_[_0xcaea('0x34')](db[_0xcaea('0x44')][_0xcaea('0x2e')]);_0x27b275[_0xcaea('0x33')]=_[_0xcaea('0x34')](_0x7961d6['query']);_0x27b275[_0xcaea('0x35')]=_['intersection'](_0x27b275['model'],_0x27b275[_0xcaea('0x33')]);_0x1b6e05[_0xcaea('0x37')]=_[_0xcaea('0x36')](_0x27b275[_0xcaea('0x32')],qs[_0xcaea('0x38')](_0x7961d6[_0xcaea('0x33')][_0xcaea('0x38')]));_0x1b6e05['attributes']=_0x1b6e05['attributes']['length']?_0x1b6e05[_0xcaea('0x37')]:_0x27b275[_0xcaea('0x32')];if(_0x7961d6['query'][_0xcaea('0x45')]){_0x1b6e05[_0xcaea('0x46')]=[{'all':!![]}];}_0x1b6e05=_[_0xcaea('0x40')]({},_0x1b6e05,_0x7961d6[_0xcaea('0x43')]);return db['Interval'][_0xcaea('0x47')](_0x1b6e05)[_0xcaea('0x26')](handleEntityNotFound(_0x4c712a,null))[_0xcaea('0x26')](respondWithResult(_0x4c712a,null))['catch'](handleError(_0x4c712a,null));};exports[_0xcaea('0x48')]=function(_0x16bce2,_0x10591a){return db[_0xcaea('0x44')]['create'](_0x16bce2[_0xcaea('0x49')],{})[_0xcaea('0x26')](function(_0x59cdb5){var _0x5bfba7=_0x16bce2[_0xcaea('0x4a')]['get']({'plain':!![]});if(!_0x5bfba7)throw new Error(_0xcaea('0x4b'));if(_0x5bfba7[_0xcaea('0x4c')]===_0xcaea('0x4a')){var _0x33501b=_0x59cdb5[_0xcaea('0x24')]({'plain':!![]});var _0x263c9a=_0xcaea('0x4d');return db[_0xcaea('0x4e')][_0xcaea('0x47')]({'where':{'name':_0x263c9a,'userProfileId':_0x5bfba7[_0xcaea('0x4f')]},'raw':!![]})[_0xcaea('0x26')](function(_0x5cd1a8){if(_0x5cd1a8&&_0x5cd1a8['autoAssociation']===0x0){return db[_0xcaea('0x25')][_0xcaea('0x48')]({'name':_0x33501b[_0xcaea('0x2a')],'resourceId':_0x33501b['id'],'type':_0x5cd1a8[_0xcaea('0x2a')],'sectionId':_0x5cd1a8['id']},{})['then'](function(){return _0x59cdb5;});}else{return _0x59cdb5;}})['catch'](function(_0x127a19){logger['error'](_0xcaea('0x50'),_0x127a19);throw _0x127a19;});}return _0x59cdb5;})[_0xcaea('0x26')](respondWithResult(_0x10591a,0xc9))[_0xcaea('0x51')](handleError(_0x10591a,null));};exports['update']=function(_0x49d912,_0x2c81e7){if(_0x49d912[_0xcaea('0x49')]['id']){delete _0x49d912[_0xcaea('0x49')]['id'];}return db['Interval'][_0xcaea('0x47')]({'where':{'id':_0x49d912[_0xcaea('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c81e7,null))['then'](saveUpdates(_0x49d912[_0xcaea('0x49')],null))[_0xcaea('0x26')](respondWithResult(_0x2c81e7,null))['catch'](handleError(_0x2c81e7,null));};exports[_0xcaea('0x23')]=function(_0x3509f5,_0x1430f9){return db[_0xcaea('0x44')][_0xcaea('0x47')]({'where':{'id':_0x3509f5[_0xcaea('0x52')]['id']}})[_0xcaea('0x26')](handleEntityNotFound(_0x1430f9,null))['then'](removeEntity(_0x1430f9,null))[_0xcaea('0x51')](handleError(_0x1430f9,null));};exports[_0xcaea('0x53')]=function(_0x57d2f7,_0x58f9e8,_0x3cfd89){if(_0x57d2f7[_0xcaea('0x49')]['id']){delete _0x57d2f7[_0xcaea('0x49')]['id'];}return db[_0xcaea('0x44')][_0xcaea('0x47')]({'where':{'id':_0x57d2f7[_0xcaea('0x52')]['id']}})['then'](handleEntityNotFound(_0x58f9e8,null))[_0xcaea('0x26')](function(_0x545e81){if(_0x545e81){_0x57d2f7[_0xcaea('0x49')][_0xcaea('0x54')]=_0x545e81['id'];return db[_0xcaea('0x44')]['create'](_0x57d2f7[_0xcaea('0x49')]);}})['then'](respondWithResult(_0x58f9e8,null))[_0xcaea('0x51')](handleError(_0x58f9e8,null));};exports['getIntervals']=function(_0x43c2fa,_0xab1c8b,_0x2df2c7){var _0x1e156b={};var _0x5f4d74={};var _0x376626;var _0x52a932;return db[_0xcaea('0x44')]['findOne']({'where':{'id':_0x43c2fa[_0xcaea('0x52')]['id']}})[_0xcaea('0x26')](handleEntityNotFound(_0xab1c8b,null))[_0xcaea('0x26')](function(_0x37a462){if(_0x37a462){_0x376626=_0x37a462;_0x5f4d74[_0xcaea('0x32')]=_['keys'](db[_0xcaea('0x44')][_0xcaea('0x2e')]);_0x5f4d74['query']=_[_0xcaea('0x34')](_0x43c2fa[_0xcaea('0x33')]);_0x5f4d74[_0xcaea('0x35')]=_[_0xcaea('0x36')](_0x5f4d74[_0xcaea('0x32')],_0x5f4d74[_0xcaea('0x33')]);_0x1e156b[_0xcaea('0x37')]=_[_0xcaea('0x36')](_0x5f4d74[_0xcaea('0x32')],qs[_0xcaea('0x38')](_0x43c2fa[_0xcaea('0x33')][_0xcaea('0x38')]));_0x1e156b[_0xcaea('0x37')]=_0x1e156b['attributes']['length']?_0x1e156b['attributes']:_0x5f4d74[_0xcaea('0x32')];_0x1e156b['order']=qs[_0xcaea('0x3d')](_0x43c2fa['query'][_0xcaea('0x3d')]);_0x1e156b[_0xcaea('0x3f')]=qs[_0xcaea('0x35')](_['pick'](_0x43c2fa[_0xcaea('0x33')],_0x5f4d74['filters']));if(_0x43c2fa[_0xcaea('0x33')][_0xcaea('0x42')]){_0x1e156b[_0xcaea('0x3f')]=_['merge'](_0x1e156b['where'],{'$or':_[_0xcaea('0x2d')](_0x1e156b[_0xcaea('0x37')],function(_0x38fa4b){var _0x46ae62={};_0x46ae62[_0x38fa4b]={'$like':'%'+_0x43c2fa[_0xcaea('0x33')]['filter']+'%'};return _0x46ae62;})});}_0x1e156b=_['merge']({},_0x1e156b,_0x43c2fa['options']);return _0x376626[_0xcaea('0x55')](_0x1e156b);}})[_0xcaea('0x26')](function(_0x599716){if(_0x599716){_0x52a932=_0x599716['length'];if(!_0x43c2fa[_0xcaea('0x33')][_0xcaea('0x3a')](_0xcaea('0x3b'))){_0x1e156b['limit']=qs[_0xcaea('0x1b')](_0x43c2fa[_0xcaea('0x33')][_0xcaea('0x1b')]);_0x1e156b[_0xcaea('0x1a')]=qs[_0xcaea('0x1a')](_0x43c2fa[_0xcaea('0x33')][_0xcaea('0x1a')]);}return _0x376626[_0xcaea('0x55')](_0x1e156b);}})[_0xcaea('0x26')](function(_0x5112e0){if(_0x5112e0){return _0x5112e0?{'count':_0x52a932,'rows':_0x5112e0}:null;}})[_0xcaea('0x26')](respondWithResult(_0xab1c8b,null))[_0xcaea('0x51')](handleError(_0xab1c8b,null));};exports[_0xcaea('0x56')]=function(_0x197478,_0x2e3710,_0x1b8716){return db[_0xcaea('0x44')][_0xcaea('0x57')]({'where':{'id':_0x197478[_0xcaea('0x52')]['id']}})[_0xcaea('0x26')](handleEntityNotFound(_0x2e3710,null))['then'](function(_0x1b31c9){if(_0x1b31c9){return db[_0xcaea('0x58')]['transaction'](function(_0x2fe4b8){return db[_0xcaea('0x44')][_0xcaea('0x23')]({'where':{'IntervalId':_0x197478['params']['id']},'transaction':_0x2fe4b8})[_0xcaea('0x26')](function(_0x131284){var _0xd3f216=_[_0xcaea('0x2d')](_0x197478[_0xcaea('0x49')],function(_0x5c6524){delete _0x5c6524['id'];_0x5c6524['IntervalId']=_0x197478[_0xcaea('0x52')]['id'];return _0x5c6524;});return db['Interval'][_0xcaea('0x59')](_0xd3f216,{'transaction':_0x2fe4b8});});})[_0xcaea('0x26')](function(){return db[_0xcaea('0x44')][_0xcaea('0x5a')]({'where':{'IntervalId':_0x197478[_0xcaea('0x52')]['id']}});});}})[_0xcaea('0x26')](respondWithResult(_0x2e3710,null))['catch'](handleError(_0x2e3710,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 11565c6..8689b32 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 _0x9d24=['./interval.attributes','../../components/extensions/rewrite','exports','define','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x9d24,0x155));var _0x49d2=function(_0x4860af,_0x289d80){_0x4860af=_0x4860af-0x0;var _0x2c3b51=_0x9d24[_0x4860af];return _0x2c3b51;};'use strict';var _=require(_0x49d2('0x0'));var util=require(_0x49d2('0x1'));var logger=require(_0x49d2('0x2'))(_0x49d2('0x3'));var moment=require(_0x49d2('0x4'));var BPromise=require(_0x49d2('0x5'));var rp=require(_0x49d2('0x6'));var fs=require('fs');var path=require(_0x49d2('0x7'));var rimraf=require(_0x49d2('0x8'));var config=require('../../config/environment');var attributes=require(_0x49d2('0x9'));var extensions=require(_0x49d2('0xa'));module[_0x49d2('0xb')]=function(_0x5569df,_0x5f4f15){return _0x5569df[_0x49d2('0xc')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e4429,_0x8610b){extensions[_0x49d2('0xd')](_0x5569df,_0x3e4429);},'afterBulkCreate':function(_0x119dbf,_0x555ff7,_0x3a8c9f){_0x3a8c9f();extensions[_0x49d2('0xd')](_0x5569df,_0x119dbf[0x0]);},'afterUpdate':function(_0x22f8b4,_0x8aac77){extensions[_0x49d2('0xd')](_0x5569df,_0x22f8b4);},'afterDestroy':function(_0x5d6d25,_0x2665c5){extensions[_0x49d2('0xd')](_0x5569df,_0x5d6d25);}}});}; \ No newline at end of file +var _0x253b=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0xc56c46,_0x3fc792){var _0x2055d6=function(_0x110ac3){while(--_0x110ac3){_0xc56c46['push'](_0xc56c46['shift']());}};_0x2055d6(++_0x3fc792);}(_0x253b,0x6c));var _0xb253=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x253b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb253('0x0'));var util=require(_0xb253('0x1'));var logger=require(_0xb253('0x2'))(_0xb253('0x3'));var moment=require(_0xb253('0x4'));var BPromise=require('bluebird');var rp=require(_0xb253('0x5'));var fs=require('fs');var path=require(_0xb253('0x6'));var rimraf=require(_0xb253('0x7'));var config=require(_0xb253('0x8'));var attributes=require(_0xb253('0x9'));var extensions=require(_0xb253('0xa'));module[_0xb253('0xb')]=function(_0x54d6e4,_0x4971c0){return _0x54d6e4['define'](_0xb253('0xc'),attributes,{'tableName':_0xb253('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x636e41,_0x5b6127){extensions[_0xb253('0xe')](_0x54d6e4,_0x636e41);},'afterBulkCreate':function(_0x338c87,_0x5cc49b,_0x35d8d9){_0x35d8d9();extensions[_0xb253('0xe')](_0x54d6e4,_0x338c87[0x0]);},'afterUpdate':function(_0x1d6397,_0x41faec){extensions[_0xb253('0xe')](_0x54d6e4,_0x1d6397);},'afterDestroy':function(_0x15fb33,_0x3d9079){extensions['rewrite'](_0x54d6e4,_0x15fb33);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 02a34b0..73ae59c 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 92dcffc..45adcc0 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x2b4bce,_0x52c5f3){var _0x679cd7=function(_0x1cc764){while(--_0x1cc764){_0x2b4bce['push'](_0x2b4bce['shift']());}};_0x679cd7(++_0x52c5f3);}(_0xadb5,0xad));var _0x5adb=function(_0x331304,_0x247651){_0x331304=_0x331304-0x0;var _0x57d1b6=_0xadb5[_0x331304];return _0x57d1b6;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0xaaad93,_0x2cb7af){var _0x575913=function(_0xa9adb7){while(--_0xa9adb7){_0xaaad93['push'](_0xaaad93['shift']());}};_0x575913(++_0x2cb7af);}(_0x2ef3,0xba));var _0x32ef=function(_0x47b127,_0x45a8af){_0x47b127=_0x47b127-0x0;var _0x7a304b=_0x2ef3[_0x47b127];return _0x7a304b;};'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 ca1582e..7d0240a 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 _0xfad3=['Report','\x20from\x20','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','application/json','Basic\x20','base64','request','setEncoding','utf8','data','end','statusCode','json','error','status','write','openIssue','send','headers','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xfad3,0xd3));var _0x3fad=function(_0x34ce8c,_0x526c3c){_0x34ce8c=_0x34ce8c-0x0;var _0x31bde5=_0xfad3[_0x34ce8c];return _0x31bde5;};'use strict';var BPromise=require(_0x3fad('0x0'));var https=require(_0x3fad('0x1'));var logger=require(_0x3fad('0x2'))(_0x3fad('0x3'));var USERNAME=_0x3fad('0x4');var PASSWORD=_0x3fad('0x5');function openIssue(_0x581d64,_0x55418e){var _0x5c691d={'fields':{'project':{'key':_0x581d64[_0x3fad('0x6')]||_0x3fad('0x7')},'summary':(_0x581d64[_0x3fad('0x8')]||_0x3fad('0x9'))+_0x3fad('0xa')+_0x581d64['ip'],'description':_0x581d64['description']||JSON[_0x3fad('0xb')](_0x581d64),'issuetype':{'name':_0x581d64[_0x3fad('0xc')]||_0x3fad('0xd')}}};_0x5c691d[_0x3fad('0xe')]['customfield_11500']=_0x581d64[_0x3fad('0xf')];_0x5c691d[_0x3fad('0xe')][_0x3fad('0x10')]=_0x581d64[_0x3fad('0x11')];_0x5c691d['fields'][_0x3fad('0x12')]=_0x581d64[_0x3fad('0x13')];_0x5c691d[_0x3fad('0xe')][_0x3fad('0x14')]=_0x581d64[_0x3fad('0x15')];_0x5c691d[_0x3fad('0xe')][_0x3fad('0x16')]=_0x581d64['reason'];_0x5c691d[_0x3fad('0xe')][_0x3fad('0x17')]=_0x581d64['ip'];var _0x2cd43f={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x3fad('0x18'),'Authorization':_0x3fad('0x19')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3fad('0x1a'))}};var _0x430862=JSON['stringify'](_0x5c691d);var _0x495ca0=https[_0x3fad('0x1b')](_0x2cd43f,function(_0x17c875){_0x17c875[_0x3fad('0x1c')](_0x3fad('0x1d'));var _0x25538d='';_0x17c875['on'](_0x3fad('0x1e'),function(_0x4315fe){_0x25538d+=_0x4315fe;});_0x17c875['on'](_0x3fad('0x1f'),function(){if(_0x55418e){return _0x55418e['status'](_0x17c875[_0x3fad('0x20')])[_0x3fad('0x21')](JSON['parse'](_0x25538d));}});});_0x495ca0['on'](_0x3fad('0x22'),function(_0x4c08a2){if(_0x55418e){return _0x55418e[_0x3fad('0x23')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x495ca0[_0x3fad('0x24')](_0x430862);_0x495ca0[_0x3fad('0x1f')]();}exports[_0x3fad('0x25')]=openIssue;exports[_0x3fad('0x26')]=function(_0x4002c5,_0x39ac18){_0x4002c5['body']['ip']=_0x4002c5[_0x3fad('0x27')]['x-forwarded-for']||_0x4002c5[_0x3fad('0x28')][_0x3fad('0x29')]||_0x4002c5[_0x3fad('0x2a')][_0x3fad('0x29')]||_0x4002c5[_0x3fad('0x28')]['socket']['remoteAddress'];return openIssue(_0x4002c5[_0x3fad('0x2b')],_0x39ac18);}; \ No newline at end of file +var _0xaa28=['customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','body','x-forwarded-for','remoteAddress','socket','connection','https','../../config/logger','support','3eAmWpBVP0','key','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','newToken','name','reason'];(function(_0x5d1541,_0x316017){var _0x1781b4=function(_0x297a27){while(--_0x297a27){_0x5d1541['push'](_0x5d1541['shift']());}};_0x1781b4(++_0x316017);}(_0xaa28,0x67));var _0x8aa2=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0xaa28[_0x28edda];return _0x21f4a4;};'use strict';var BPromise=require('bluebird');var https=require(_0x8aa2('0x0'));var logger=require(_0x8aa2('0x1'))('api');var USERNAME=_0x8aa2('0x2');var PASSWORD=_0x8aa2('0x3');function openIssue(_0xbf3f8c,_0x11c90b){var _0x1dcbb4={'fields':{'project':{'key':_0xbf3f8c[_0x8aa2('0x4')]||'MOTGUI'},'summary':(_0xbf3f8c['summary']||_0x8aa2('0x5'))+'\x20from\x20'+_0xbf3f8c['ip'],'description':_0xbf3f8c[_0x8aa2('0x6')]||JSON[_0x8aa2('0x7')](_0xbf3f8c),'issuetype':{'name':_0xbf3f8c[_0x8aa2('0x8')]||_0x8aa2('0x9')}}};_0x1dcbb4[_0x8aa2('0xa')][_0x8aa2('0xb')]=_0xbf3f8c[_0x8aa2('0xc')];_0x1dcbb4[_0x8aa2('0xa')]['customfield_11501']=_0xbf3f8c[_0x8aa2('0xd')];_0x1dcbb4['fields']['customfield_11502']=_0xbf3f8c[_0x8aa2('0xe')];_0x1dcbb4[_0x8aa2('0xa')]['customfield_11503']=_0xbf3f8c[_0x8aa2('0xf')];_0x1dcbb4['fields']['customfield_11504']=_0xbf3f8c[_0x8aa2('0x10')];_0x1dcbb4['fields'][_0x8aa2('0x11')]=_0xbf3f8c['ip'];var _0x2d500b={'host':_0x8aa2('0x12'),'port':0x1bb,'path':_0x8aa2('0x13'),'method':_0x8aa2('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x8aa2('0x15'),'Authorization':_0x8aa2('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x8aa2('0x17')]('base64')}};var _0x221f4c=JSON[_0x8aa2('0x7')](_0x1dcbb4);var _0x162660=https[_0x8aa2('0x18')](_0x2d500b,function(_0x15941e){_0x15941e[_0x8aa2('0x19')](_0x8aa2('0x1a'));var _0x6334d1='';_0x15941e['on'](_0x8aa2('0x1b'),function(_0x165a48){_0x6334d1+=_0x165a48;});_0x15941e['on'](_0x8aa2('0x1c'),function(){if(_0x11c90b){return _0x11c90b[_0x8aa2('0x1d')](_0x15941e['statusCode'])[_0x8aa2('0x1e')](JSON[_0x8aa2('0x1f')](_0x6334d1));}});});_0x162660['on'](_0x8aa2('0x20'),function(_0x4599d1){if(_0x11c90b){return _0x11c90b['status'](0x1f4)['json']({'errors':[{'message':_0x8aa2('0x21'),'type':_0x8aa2('0x22')}]});}});_0x162660['write'](_0x221f4c);_0x162660['end']();}exports['openIssue']=openIssue;exports['send']=function(_0x46e7e0,_0x17d4c8){_0x46e7e0[_0x8aa2('0x23')]['ip']=_0x46e7e0['headers'][_0x8aa2('0x24')]||_0x46e7e0['connection'][_0x8aa2('0x25')]||_0x46e7e0[_0x8aa2('0x26')][_0x8aa2('0x25')]||_0x46e7e0[_0x8aa2('0x27')][_0x8aa2('0x26')][_0x8aa2('0x25')];return openIssue(_0x46e7e0[_0x8aa2('0x23')],_0x17d4c8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 26fdd93..2967173 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 _0xb903=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','isAuthenticated','describe','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3c29f2,_0x5a253b){var _0x30633f=function(_0x5f589e){while(--_0x5f589e){_0x3c29f2['push'](_0x3c29f2['shift']());}};_0x30633f(++_0x5a253b);}(_0xb903,0x185));var _0x3b90=function(_0x4eff75,_0x59ce62){_0x4eff75=_0x4eff75-0x0;var _0x4655b=_0xb903[_0x4eff75];return _0x4655b;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var fs_extra=require(_0x3b90('0x5'));var auth=require(_0x3b90('0x6'));var interaction=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var controller=require(_0x3b90('0x9'));router[_0x3b90('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router['get']('/describe',auth[_0x3b90('0xc')](),controller[_0x3b90('0xd')]);router[_0x3b90('0xa')](_0x3b90('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3b90('0xe'),auth[_0x3b90('0xc')](),controller['update']);router[_0x3b90('0xf')](_0x3b90('0xe'),auth['isAuthenticated'](),controller[_0x3b90('0x10')]);module[_0x3b90('0x11')]=router; \ No newline at end of file +var _0x22fb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xbe05c8,_0x26be13){var _0xbd60ca=function(_0x202473){while(--_0x202473){_0xbe05c8['push'](_0xbe05c8['shift']());}};_0xbd60ca(++_0x26be13);}(_0x22fb,0x192));var _0xb22f=function(_0x2164e4,_0x2ae2b1){_0x2164e4=_0x2164e4-0x0;var _0x180e8b=_0x22fb[_0x2164e4];return _0x180e8b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb22f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index cac4dec..3426723 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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x2a5d9f,_0x37cb1a){_0x2a5d9f=_0x2a5d9f-0x0;var _0x1f9376=_0x7a54[_0x2a5d9f];return _0x1f9376;};'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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6d28,_0x39f36d){_0x5e6d28=_0x5e6d28-0x0;var _0x2394e3=_0x7a54[_0x5e6d28];return _0x2394e3;};'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 ae8e9dc..e27b10d 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 _0x304b=['JscriptyAnswerReport','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','name','filter'];(function(_0x1ccc0d,_0x1a3c98){var _0x345460=function(_0x3da681){while(--_0x3da681){_0x1ccc0d['push'](_0x1ccc0d['shift']());}};_0x345460(++_0x1a3c98);}(_0x304b,0xfb));var _0xb304=function(_0x35a9b5,_0x605845){_0x35a9b5=_0x35a9b5-0x0;var _0x5e250d=_0x304b[_0x35a9b5];return _0x5e250d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb304('0x0'));var zipdir=require(_0xb304('0x1'));var jsonpatch=require(_0xb304('0x2'));var rp=require(_0xb304('0x3'));var moment=require(_0xb304('0x4'));var BPromise=require(_0xb304('0x5'));var Mustache=require(_0xb304('0x6'));var util=require(_0xb304('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb304('0x8'));var ejs=require(_0xb304('0x9'));var fs=require('fs');var fs_extra=require(_0xb304('0xa'));var _=require(_0xb304('0xb'));var squel=require(_0xb304('0xc'));var crypto=require(_0xb304('0xd'));var jsforce=require(_0xb304('0xe'));var deskjs=require(_0xb304('0xf'));var toCsv=require(_0xb304('0x8'));var querystring=require('querystring');var Papa=require(_0xb304('0x10'));var Redis=require(_0xb304('0x11'));var authService=require(_0xb304('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb304('0x13'));var hardwareService=require(_0xb304('0x14'));var logger=require(_0xb304('0x15'))(_0xb304('0x16'));var utils=require(_0xb304('0x17'));var config=require(_0xb304('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb304('0x19'))['db'];function respondWithStatusCode(_0x1f4ddb,_0x2f8cae){_0x2f8cae=_0x2f8cae||0xcc;return function(_0x743f7d){if(_0x743f7d){return _0x1f4ddb['sendStatus'](_0x2f8cae);}return _0x1f4ddb[_0xb304('0x1a')](_0x2f8cae)[_0xb304('0x1b')]();};}function respondWithResult(_0x733030,_0x44b7a7){_0x44b7a7=_0x44b7a7||0xc8;return function(_0x1ba608){if(_0x1ba608){return _0x733030[_0xb304('0x1a')](_0x44b7a7)[_0xb304('0x1c')](_0x1ba608);}};}function respondWithFilteredResult(_0x1a15c9,_0x218d92){return function(_0x22ac4b){if(_0x22ac4b){var _0x3d20b5=typeof _0x218d92[_0xb304('0x1d')]===_0xb304('0x1e')&&typeof _0x218d92['limit']===_0xb304('0x1e');var _0x5166c5=_0x22ac4b['count'];var _0x79ca93=_0x3d20b5?0x0:_0x218d92[_0xb304('0x1d')];var _0x45f368=_0x3d20b5?_0x22ac4b[_0xb304('0x1f')]:_0x218d92[_0xb304('0x1d')]+_0x218d92['limit'];var _0x272b37;if(_0x45f368>=_0x5166c5){_0x45f368=_0x5166c5;_0x272b37=0xc8;}else{_0x272b37=0xce;}_0x1a15c9['status'](_0x272b37);return _0x1a15c9[_0xb304('0x20')](_0xb304('0x21'),_0x79ca93+'-'+_0x45f368+'/'+_0x5166c5)['json'](_0x22ac4b);}return null;};}function patchUpdates(_0x49d49e){return function(_0x586394){try{jsonpatch[_0xb304('0x22')](_0x586394,_0x49d49e,!![]);}catch(_0x1dab9e){return BPromise[_0xb304('0x23')](_0x1dab9e);}return _0x586394[_0xb304('0x24')]();};}function saveUpdates(_0x5cf81a,_0x218b9d){return function(_0x3694c4){if(_0x3694c4){return _0x3694c4[_0xb304('0x25')](_0x5cf81a)[_0xb304('0x26')](function(_0x4f10ab){return _0x4f10ab;});}return null;};}function removeEntity(_0x5802d5,_0x4ab7ed){return function(_0x2fd41b){if(_0x2fd41b){return _0x2fd41b['destroy']()[_0xb304('0x26')](function(){_0x5802d5['status'](0xcc)[_0xb304('0x1b')]();});}};}function handleEntityNotFound(_0x148f48,_0x2b5271){return function(_0x4de541){if(!_0x4de541){_0x148f48[_0xb304('0x27')](0x194);}return _0x4de541;};}function handleError(_0x4fcf90,_0x36444d){_0x36444d=_0x36444d||0x1f4;return function(_0x4f46d2){logger[_0xb304('0x28')](_0x4f46d2[_0xb304('0x29')]);if(_0x4f46d2['name']){delete _0x4f46d2['name'];}_0x4fcf90[_0xb304('0x1a')](_0x36444d)[_0xb304('0x2a')](_0x4f46d2);};}exports[_0xb304('0x2b')]=function(_0xdfe560,_0x1d468d){var _0x19ecc6={},_0x36af11={},_0x10fa7d={'count':0x0,'rows':[]};var _0x57bc7d=_[_0xb304('0x2c')](db['JscriptyAnswerReport'][_0xb304('0x2d')],function(_0xeba658){return{'name':_0xeba658['fieldName'],'type':_0xeba658['type'][_0xb304('0x2e')]};});_0x36af11[_0xb304('0x2f')]=_[_0xb304('0x2c')](_0x57bc7d,'name');_0x36af11[_0xb304('0x30')]=_[_0xb304('0x31')](_0xdfe560['query']);_0x36af11[_0xb304('0x32')]=_[_0xb304('0x33')](_0x36af11[_0xb304('0x2f')],_0x36af11[_0xb304('0x30')]);_0x19ecc6[_0xb304('0x34')]=_['intersection'](_0x36af11[_0xb304('0x2f')],qs[_0xb304('0x35')](_0xdfe560[_0xb304('0x30')][_0xb304('0x35')]));_0x19ecc6[_0xb304('0x34')]=_0x19ecc6[_0xb304('0x34')][_0xb304('0x36')]?_0x19ecc6[_0xb304('0x34')]:_0x36af11[_0xb304('0x2f')];if(!_0xdfe560[_0xb304('0x30')][_0xb304('0x37')](_0xb304('0x38'))){_0x19ecc6[_0xb304('0x39')]=qs[_0xb304('0x39')](_0xdfe560[_0xb304('0x30')][_0xb304('0x39')]);_0x19ecc6[_0xb304('0x1d')]=qs[_0xb304('0x1d')](_0xdfe560['query'][_0xb304('0x1d')]);}_0x19ecc6[_0xb304('0x3a')]=qs['sort'](_0xdfe560[_0xb304('0x30')]['sort']);_0x19ecc6[_0xb304('0x3b')]=qs[_0xb304('0x32')](_[_0xb304('0x3c')](_0xdfe560[_0xb304('0x30')],_0x36af11['filters']),_0x57bc7d);if(_0xdfe560[_0xb304('0x30')]['filter']){_0x19ecc6['where']=_[_0xb304('0x3d')](_0x19ecc6[_0xb304('0x3b')],{'$or':_[_0xb304('0x2c')](_0x57bc7d,function(_0x510748){if(_0x510748['type']!==_0xb304('0x3e')){var _0x470ac3={};_0x470ac3[_0x510748[_0xb304('0x3f')]]={'$like':'%'+_0xdfe560[_0xb304('0x30')][_0xb304('0x40')]+'%'};return _0x470ac3;}})});}_0x19ecc6=_[_0xb304('0x3d')]({},_0x19ecc6,_0xdfe560['options']);var _0x34eae5={'where':_0x19ecc6[_0xb304('0x3b')]};return db[_0xb304('0x41')]['count'](_0x34eae5)['then'](function(_0x49657c){_0x10fa7d['count']=_0x49657c;if(_0xdfe560[_0xb304('0x30')][_0xb304('0x42')]){_0x19ecc6['include']=[{'all':!![]}];}return db[_0xb304('0x41')][_0xb304('0x43')](_0x19ecc6);})[_0xb304('0x26')](function(_0xaf4872){_0x10fa7d[_0xb304('0x44')]=_0xaf4872;return _0x10fa7d;})[_0xb304('0x26')](respondWithFilteredResult(_0x1d468d,_0x19ecc6))[_0xb304('0x45')](handleError(_0x1d468d,null));};exports[_0xb304('0x46')]=function(_0x1a2823,_0x8008a8){var _0x364141={'raw':!![],'where':{'id':_0x1a2823[_0xb304('0x47')]['id']}},_0xd23f35={};_0xd23f35['model']=_[_0xb304('0x31')](db[_0xb304('0x41')]['rawAttributes']);_0xd23f35[_0xb304('0x30')]=_['keys'](_0x1a2823['query']);_0xd23f35[_0xb304('0x32')]=_['intersection'](_0xd23f35[_0xb304('0x2f')],_0xd23f35['query']);_0x364141[_0xb304('0x34')]=_[_0xb304('0x33')](_0xd23f35[_0xb304('0x2f')],qs[_0xb304('0x35')](_0x1a2823['query']['fields']));_0x364141[_0xb304('0x34')]=_0x364141[_0xb304('0x34')]['length']?_0x364141[_0xb304('0x34')]:_0xd23f35['model'];if(_0x1a2823[_0xb304('0x30')][_0xb304('0x42')]){_0x364141[_0xb304('0x48')]=[{'all':!![]}];}_0x364141=_[_0xb304('0x3d')]({},_0x364141,_0x1a2823[_0xb304('0x49')]);return db[_0xb304('0x41')][_0xb304('0x4a')](_0x364141)[_0xb304('0x26')](handleEntityNotFound(_0x8008a8,null))['then'](respondWithResult(_0x8008a8,null))[_0xb304('0x45')](handleError(_0x8008a8,null));};exports[_0xb304('0x4b')]=function(_0x439047,_0xf20d4e){return db['JscriptyAnswerReport'][_0xb304('0x4b')](_0x439047[_0xb304('0x4c')],{})[_0xb304('0x26')](respondWithResult(_0xf20d4e,0xc9))[_0xb304('0x45')](handleError(_0xf20d4e,null));};exports[_0xb304('0x25')]=function(_0x38ec58,_0x3a85a1){if(_0x38ec58[_0xb304('0x4c')]['id']){delete _0x38ec58[_0xb304('0x4c')]['id'];}return db[_0xb304('0x41')][_0xb304('0x4a')]({'where':{'id':_0x38ec58[_0xb304('0x47')]['id']}})[_0xb304('0x26')](handleEntityNotFound(_0x3a85a1,null))[_0xb304('0x26')](saveUpdates(_0x38ec58[_0xb304('0x4c')],null))[_0xb304('0x26')](respondWithResult(_0x3a85a1,null))[_0xb304('0x45')](handleError(_0x3a85a1,null));};exports[_0xb304('0x4d')]=function(_0x471b4d,_0x37efdb){return db[_0xb304('0x41')][_0xb304('0x4a')]({'where':{'id':_0x471b4d[_0xb304('0x47')]['id']}})[_0xb304('0x26')](handleEntityNotFound(_0x37efdb,null))[_0xb304('0x26')](removeEntity(_0x37efdb,null))['catch'](handleError(_0x37efdb,null));};exports[_0xb304('0x4e')]=function(_0x56391f,_0x1056ac){return db[_0xb304('0x41')]['describe']()['then'](respondWithResult(_0x1056ac,null))['catch'](handleError(_0x1056ac,null));}; \ No newline at end of file +var _0xac9d=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xac9d,0x14d));var _0xdac9=function(_0x1d1854,_0x4a83b1){_0x1d1854=_0x1d1854-0x0;var _0x5b2acb=_0xac9d[_0x1d1854];return _0x5b2acb;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b'));_0x3eed7a[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x170afd[_0xdac9('0x34')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a[_0xdac9('0x34')]);_0x4c4e21[_0xdac9('0x38')]=_['intersection'](_0x3eed7a['model'],qs[_0xdac9('0x39')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x39')]));_0x4c4e21[_0xdac9('0x38')]=_0x4c4e21[_0xdac9('0x38')]['length']?_0x4c4e21[_0xdac9('0x38')]:_0x3eed7a['model'];if(!_0x170afd[_0xdac9('0x34')][_0xdac9('0x3a')]('nolimit')){_0x4c4e21[_0xdac9('0x20')]=qs['limit'](_0x170afd['query'][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x1e')]);}_0x4c4e21[_0xdac9('0x3b')]=qs['sort'](_0x170afd[_0xdac9('0x34')][_0xdac9('0x3c')]);_0x4c4e21['where']=qs[_0xdac9('0x36')](_[_0xdac9('0x3d')](_0x170afd[_0xdac9('0x34')],_0x3eed7a[_0xdac9('0x36')]),_0x13efba);if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x3e')]){_0x4c4e21[_0xdac9('0x3f')]=_['merge'](_0x4c4e21[_0xdac9('0x3f')],{'$or':_[_0xdac9('0x2d')](_0x13efba,function(_0x238769){if(_0x238769['type']!==_0xdac9('0x40')){var _0x338e4a={};_0x338e4a[_0x238769[_0xdac9('0x2b')]]={'$like':'%'+_0x170afd[_0xdac9('0x34')]['filter']+'%'};return _0x338e4a;}})});}_0x4c4e21=_['merge']({},_0x4c4e21,_0x170afd[_0xdac9('0x41')]);var _0xe47a3c={'where':_0x4c4e21[_0xdac9('0x3f')]};return db[_0xdac9('0x2e')][_0xdac9('0x21')](_0xe47a3c)['then'](function(_0x8435e8){_0x3505c5['count']=_0x8435e8;if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x42')]){_0x4c4e21[_0xdac9('0x43')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x44')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x413fb1){_0x3505c5[_0xdac9('0x45')]=_0x413fb1;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x46')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x47')]=function(_0x24b570,_0x278826){var _0x441676={'raw':!![],'where':{'id':_0x24b570[_0xdac9('0x48')]['id']}},_0x5335ae={};_0x5335ae[_0xdac9('0x33')]=_['keys'](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x5335ae[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x24b570[_0xdac9('0x34')]);_0x5335ae[_0xdac9('0x36')]=_['intersection'](_0x5335ae[_0xdac9('0x33')],_0x5335ae['query']);_0x441676[_0xdac9('0x38')]=_[_0xdac9('0x37')](_0x5335ae[_0xdac9('0x33')],qs[_0xdac9('0x39')](_0x24b570['query']['fields']));_0x441676['attributes']=_0x441676[_0xdac9('0x38')]['length']?_0x441676['attributes']:_0x5335ae[_0xdac9('0x33')];if(_0x24b570[_0xdac9('0x34')]['includeAll']){_0x441676['include']=[{'all':!![]}];}_0x441676=_[_0xdac9('0x49')]({},_0x441676,_0x24b570[_0xdac9('0x41')]);return db[_0xdac9('0x2e')][_0xdac9('0x4a')](_0x441676)[_0xdac9('0x26')](handleEntityNotFound(_0x278826,null))[_0xdac9('0x26')](respondWithResult(_0x278826,null))[_0xdac9('0x46')](handleError(_0x278826,null));};exports[_0xdac9('0x4b')]=function(_0x5c008b,_0x621cf){return db[_0xdac9('0x2e')][_0xdac9('0x4b')](_0x5c008b[_0xdac9('0x4c')],{})[_0xdac9('0x26')](respondWithResult(_0x621cf,0xc9))[_0xdac9('0x46')](handleError(_0x621cf,null));};exports[_0xdac9('0x25')]=function(_0x37b498,_0x140dc5){if(_0x37b498[_0xdac9('0x4c')]['id']){delete _0x37b498[_0xdac9('0x4c')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4a')]({'where':{'id':_0x37b498[_0xdac9('0x48')]['id']}})['then'](handleEntityNotFound(_0x140dc5,null))['then'](saveUpdates(_0x37b498['body'],null))[_0xdac9('0x26')](respondWithResult(_0x140dc5,null))[_0xdac9('0x46')](handleError(_0x140dc5,null));};exports['destroy']=function(_0x2a60bd,_0x2843f2){return db[_0xdac9('0x2e')]['find']({'where':{'id':_0x2a60bd[_0xdac9('0x48')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x2843f2,null))['then'](removeEntity(_0x2843f2,null))['catch'](handleError(_0x2843f2,null));};exports[_0xdac9('0x4d')]=function(_0x4469d8,_0x222de9){return db[_0xdac9('0x2e')][_0xdac9('0x4d')]()[_0xdac9('0x26')](respondWithResult(_0x222de9,null))[_0xdac9('0x46')](handleError(_0x222de9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index bc79a96..3a5bc9a 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 _0xdb03=['./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xdb03,0x16c));var _0x3db0=function(_0x8600e6,_0x528bf0){_0x8600e6=_0x8600e6-0x0;var _0x25c453=_0xdb03[_0x8600e6];return _0x25c453;};'use strict';var _=require(_0x3db0('0x0'));var util=require(_0x3db0('0x1'));var logger=require(_0x3db0('0x2'))(_0x3db0('0x3'));var moment=require('moment');var BPromise=require(_0x3db0('0x4'));var rp=require(_0x3db0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3db0('0x6'));var config=require(_0x3db0('0x7'));var attributes=require(_0x3db0('0x8'));module[_0x3db0('0x9')]=function(_0x3319d9,_0x5df520){return _0x3319d9['define'](_0x3db0('0xa'),attributes,{'tableName':_0x3db0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9fc=['rimraf','../../config/environment','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0xe9fc,0x7d));var _0xce9f=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xe9fc[_0x382e89];return _0x3a1318;};'use strict';var _=require(_0xce9f('0x0'));var util=require(_0xce9f('0x1'));var logger=require(_0xce9f('0x2'))('api');var moment=require(_0xce9f('0x3'));var BPromise=require(_0xce9f('0x4'));var rp=require(_0xce9f('0x5'));var fs=require('fs');var path=require(_0xce9f('0x6'));var rimraf=require(_0xce9f('0x7'));var config=require(_0xce9f('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xce9f('0x9')]=function(_0x4314c2,_0x390eef){return _0x4314c2[_0xce9f('0xa')](_0xce9f('0xb'),attributes,{'tableName':'report_jscripty_answers','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 85ebd90..0a2f86d 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 _0x05bf=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x2738e4,_0x541e03){var _0x5c5fc2=function(_0x37af49){while(--_0x37af49){_0x2738e4['push'](_0x2738e4['shift']());}};_0x5c5fc2(++_0x541e03);}(_0x05bf,0xe5));var _0xf05b=function(_0xc7e3ba,_0x2e9a5b){_0xc7e3ba=_0xc7e3ba-0x0;var _0x5a7008=_0x05bf[_0xc7e3ba];return _0x5a7008;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var moment=require(_0xf05b('0x2'));var BPromise=require(_0xf05b('0x3'));var rs=require(_0xf05b('0x4'));var fs=require('fs');var Redis=require(_0xf05b('0x5'));var db=require(_0xf05b('0x6'))['db'];var utils=require(_0xf05b('0x7'));var logger=require(_0xf05b('0x8'))(_0xf05b('0x9'));var config=require('../../config/environment');var jayson=require(_0xf05b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x430dfe,_0x52e39a,_0x53f3a4){return new BPromise(function(_0x20db58,_0x2405cb){return client[_0xf05b('0xb')](_0x430dfe,_0x53f3a4)[_0xf05b('0xc')](function(_0x4a68cf){logger[_0xf05b('0xd')](_0xf05b('0xe'),_0x52e39a,'request\x20sent');logger[_0xf05b('0xf')](_0xf05b('0x10'),_0x52e39a,_0xf05b('0x11'),JSON[_0xf05b('0x12')](_0x4a68cf));if(_0x4a68cf[_0xf05b('0x13')]){if(_0x4a68cf[_0xf05b('0x13')][_0xf05b('0x14')]===0x1f4){logger[_0xf05b('0x13')](_0xf05b('0xe'),_0x52e39a,_0x4a68cf[_0xf05b('0x13')][_0xf05b('0x15')]);return _0x2405cb(_0x4a68cf[_0xf05b('0x13')][_0xf05b('0x15')]);}logger[_0xf05b('0x13')](_0xf05b('0xe'),_0x52e39a,_0x4a68cf['error'][_0xf05b('0x15')]);return _0x20db58(_0x4a68cf['error'][_0xf05b('0x15')]);}else{logger['info'](_0xf05b('0xe'),_0x52e39a,_0xf05b('0x11'));_0x20db58(_0x4a68cf[_0xf05b('0x16')][_0xf05b('0x15')]);}})['catch'](function(_0x161a75){logger[_0xf05b('0x13')](_0xf05b('0xe'),_0x52e39a,_0x161a75);_0x2405cb(_0x161a75);});});} \ No newline at end of file +var _0x5e87=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4fcb07,_0x4a77a4){var _0xf2eeb=function(_0x279b1a){while(--_0x279b1a){_0x4fcb07['push'](_0x4fcb07['shift']());}};_0xf2eeb(++_0x4a77a4);}(_0x5e87,0x119));var _0x75e8=function(_0x2659fd,_0x4d6342){_0x2659fd=_0x2659fd-0x0;var _0x3dc768=_0x5e87[_0x2659fd];return _0x3dc768;};'use strict';var _=require(_0x75e8('0x0'));var util=require('util');var moment=require(_0x75e8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75e8('0x2'));var db=require(_0x75e8('0x3'))['db'];var utils=require(_0x75e8('0x4'));var logger=require(_0x75e8('0x5'))('rpc');var config=require(_0x75e8('0x6'));var jayson=require(_0x75e8('0x7'));var client=jayson['client'][_0x75e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x458aad,_0x4f98d5,_0x5792ac){return new BPromise(function(_0x3857ca,_0x54577c){return client[_0x75e8('0x9')](_0x458aad,_0x5792ac)[_0x75e8('0xa')](function(_0x55ede3){logger[_0x75e8('0xb')](_0x75e8('0xc'),_0x4f98d5,_0x75e8('0xd'));logger[_0x75e8('0xe')](_0x75e8('0xf'),_0x4f98d5,'request\x20sent',JSON[_0x75e8('0x10')](_0x55ede3));if(_0x55ede3[_0x75e8('0x11')]){if(_0x55ede3[_0x75e8('0x11')][_0x75e8('0x12')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f98d5,_0x55ede3[_0x75e8('0x11')][_0x75e8('0x13')]);return _0x54577c(_0x55ede3['error'][_0x75e8('0x13')]);}logger[_0x75e8('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f98d5,_0x55ede3[_0x75e8('0x11')][_0x75e8('0x13')]);return _0x3857ca(_0x55ede3[_0x75e8('0x11')][_0x75e8('0x13')]);}else{logger['info'](_0x75e8('0xc'),_0x4f98d5,_0x75e8('0xd'));_0x3857ca(_0x55ede3[_0x75e8('0x14')][_0x75e8('0x13')]);}})[_0x75e8('0x15')](function(_0x161a82){logger[_0x75e8('0x11')](_0x75e8('0xc'),_0x4f98d5,_0x161a82);_0x54577c(_0x161a82);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index c981994..ea0dc03 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 _0x298c=['/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id/sessions','getSessions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x298c,0x1bf));var _0xc298=function(_0x2e0fc7,_0x581487){_0x2e0fc7=_0x2e0fc7-0x0;var _0x12b00a=_0x298c[_0x2e0fc7];return _0x12b00a;};'use strict';var multer=require(_0xc298('0x0'));var util=require(_0xc298('0x1'));var path=require(_0xc298('0x2'));var timeout=require(_0xc298('0x3'));var express=require(_0xc298('0x4'));var router=express[_0xc298('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc298('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc298('0x7'));var controller=require('./jscriptyProject.controller');router[_0xc298('0x8')]('/',auth[_0xc298('0x9')](),controller[_0xc298('0xa')]);router[_0xc298('0x8')]('/:id',auth[_0xc298('0x9')](),controller['show']);router[_0xc298('0x8')](_0xc298('0xb'),auth[_0xc298('0x9')](),controller[_0xc298('0xc')]);router[_0xc298('0x8')](_0xc298('0xd'),auth[_0xc298('0x9')](),controller[_0xc298('0xe')]);router[_0xc298('0x8')](_0xc298('0xf'),auth['isAuthenticated'](),timeout(_0xc298('0x10')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc298('0x11')](_0xc298('0x12'),auth['isAuthenticated'](),controller[_0xc298('0x13')]);router['put'](_0xc298('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xc298('0x15')](_0xc298('0x14'),auth[_0xc298('0x9')](),controller[_0xc298('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0eba=['clone','/:id','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone'];(function(_0x38d597,_0x46525d){var _0x53e5d8=function(_0x174b88){while(--_0x174b88){_0x38d597['push'](_0x38d597['shift']());}};_0x53e5d8(++_0x46525d);}(_0x0eba,0x171));var _0xa0eb=function(_0x55d956,_0x53b8f0){_0x55d956=_0x55d956-0x0;var _0x54b079=_0x0eba[_0x55d956];return _0x54b079;};'use strict';var multer=require(_0xa0eb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa0eb('0x1'));var express=require(_0xa0eb('0x2'));var router=express[_0xa0eb('0x3')]();var fs_extra=require(_0xa0eb('0x4'));var auth=require(_0xa0eb('0x5'));var interaction=require(_0xa0eb('0x6'));var config=require(_0xa0eb('0x7'));var controller=require(_0xa0eb('0x8'));router[_0xa0eb('0x9')]('/',auth[_0xa0eb('0xa')](),controller['index']);router[_0xa0eb('0x9')]('/:id',auth[_0xa0eb('0xa')](),controller[_0xa0eb('0xb')]);router['get']('/:id/sessions',auth[_0xa0eb('0xa')](),controller[_0xa0eb('0xc')]);router[_0xa0eb('0x9')](_0xa0eb('0xd'),auth[_0xa0eb('0xa')](),controller[_0xa0eb('0xe')]);router[_0xa0eb('0x9')](_0xa0eb('0xf'),auth[_0xa0eb('0xa')](),timeout(_0xa0eb('0x10')),controller[_0xa0eb('0x11')]);router[_0xa0eb('0x12')]('/',auth[_0xa0eb('0xa')](),controller[_0xa0eb('0x13')]);router[_0xa0eb('0x12')](_0xa0eb('0x14'),auth[_0xa0eb('0xa')](),controller[_0xa0eb('0x15')]);router['put'](_0xa0eb('0x16'),auth[_0xa0eb('0xa')](),controller[_0xa0eb('0x17')]);router[_0xa0eb('0x18')]('/:id',auth[_0xa0eb('0xa')](),controller['destroy']);module[_0xa0eb('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 1c5e99f..5629088 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 _0x3f00=['STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x3f00,0x10a));var _0x03f0=function(_0x2069a6,_0x1bb4e1){_0x2069a6=_0x2069a6-0x0;var _0x22a791=_0x3f00[_0x2069a6];return _0x22a791;};'use strict';var Sequelize=require(_0x03f0('0x0'));var _=require(_0x03f0('0x1'));var util=require(_0x03f0('0x2'));module[_0x03f0('0x3')]={'name':{'type':Sequelize[_0x03f0('0x4')],'unique':_0x03f0('0x5')},'description':{'type':Sequelize[_0x03f0('0x4')]},'formData':{'type':Sequelize[_0x03f0('0x6')](_0x03f0('0x7')),'set':function(_0xcd00b3){if(_[_0x03f0('0x8')](_0xcd00b3)){this[_0x03f0('0x9')](_0x03f0('0xa'),JSON[_0x03f0('0xb')](_0xcd00b3));}else if(_[_0x03f0('0xc')](_0xcd00b3)){this[_0x03f0('0x9')](_0x03f0('0xa'),_0xcd00b3);}else{this['setDataValue']('formData',util[_0x03f0('0xd')](_0x03f0('0xe'),this[_0x03f0('0xf')](_0x03f0('0x5'))||'',this[_0x03f0('0xf')](_0x03f0('0x10'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x03f0('0x11')],'defaultValue':![]}}; \ No newline at end of file +var _0x0ea5=['util','STRING','name','TEXT','isObjectLike','formData','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash'];(function(_0x27406c,_0x4bf526){var _0x37045a=function(_0x48d245){while(--_0x48d245){_0x27406c['push'](_0x27406c['shift']());}};_0x37045a(++_0x4bf526);}(_0x0ea5,0xe8));var _0x50ea=function(_0x30577b,_0x384cd1){_0x30577b=_0x30577b-0x0;var _0x10c4e0=_0x0ea5[_0x30577b];return _0x10c4e0;};'use strict';var Sequelize=require(_0x50ea('0x0'));var _=require(_0x50ea('0x1'));var util=require(_0x50ea('0x2'));module['exports']={'name':{'type':Sequelize[_0x50ea('0x3')],'unique':_0x50ea('0x4')},'description':{'type':Sequelize[_0x50ea('0x3')]},'formData':{'type':Sequelize[_0x50ea('0x5')]('long'),'set':function(_0x1e10e5){if(_[_0x50ea('0x6')](_0x1e10e5)){this['setDataValue'](_0x50ea('0x7'),JSON['stringify'](_0x1e10e5));}else if(_[_0x50ea('0x8')](_0x1e10e5)){this[_0x50ea('0x9')](_0x50ea('0x7'),_0x1e10e5);}else{this[_0x50ea('0x9')](_0x50ea('0x7'),util['format'](_0x50ea('0xa'),this[_0x50ea('0xb')](_0x50ea('0x4'))||'',this[_0x50ea('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x50ea('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x50ea('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index a089dfc..96eace6 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 _0x8f71=['text/csv','download','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','Projects','UserProfileResource','sendStatus','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','find','get','omit','createdAt','updatedAt','error','getSessions','findOne','JscriptySessionReport','ProjectId','include','getAnswers','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x8f71,0x1e6));var _0x18f7=function(_0x4f936a,_0x45d9f5){_0x4f936a=_0x4f936a-0x0;var _0xcdd220=_0x8f71[_0x4f936a];return _0xcdd220;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x18f7('0x0'));var zipdir=require(_0x18f7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18f7('0x2'));var moment=require('moment');var BPromise=require(_0x18f7('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x18f7('0x4'));var sox=require('sox');var csv=require(_0x18f7('0x5'));var ejs=require(_0x18f7('0x6'));var fs=require('fs');var fs_extra=require(_0x18f7('0x7'));var _=require(_0x18f7('0x8'));var squel=require(_0x18f7('0x9'));var crypto=require(_0x18f7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x18f7('0xb'));var toCsv=require(_0x18f7('0x5'));var querystring=require(_0x18f7('0xc'));var Papa=require(_0x18f7('0xd'));var Redis=require('ioredis');var authService=require(_0x18f7('0xe'));var qs=require(_0x18f7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18f7('0x10'));var logger=require(_0x18f7('0x11'))(_0x18f7('0x12'));var utils=require(_0x18f7('0x13'));var config=require(_0x18f7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x18f7('0x15'))['db'];function respondWithStatusCode(_0x1bb2ab,_0xc15b2b){_0xc15b2b=_0xc15b2b||0xcc;return function(_0x332bbe){if(_0x332bbe){return _0x1bb2ab['sendStatus'](_0xc15b2b);}return _0x1bb2ab[_0x18f7('0x16')](_0xc15b2b)[_0x18f7('0x17')]();};}function respondWithResult(_0x1a8b13,_0x34d912){_0x34d912=_0x34d912||0xc8;return function(_0x3f4802){if(_0x3f4802){return _0x1a8b13['status'](_0x34d912)[_0x18f7('0x18')](_0x3f4802);}};}function respondWithFilteredResult(_0x2ecef3,_0x3abd17){return function(_0x24db48){if(_0x24db48){var _0x3dbfb6=typeof _0x3abd17[_0x18f7('0x19')]===_0x18f7('0x1a')&&typeof _0x3abd17[_0x18f7('0x1b')]===_0x18f7('0x1a');var _0x4d4b8b=_0x24db48[_0x18f7('0x1c')];var _0x54f1d6=_0x3dbfb6?0x0:_0x3abd17[_0x18f7('0x19')];var _0x58e766=_0x3dbfb6?_0x24db48['count']:_0x3abd17[_0x18f7('0x19')]+_0x3abd17['limit'];var _0x56d9f4;if(_0x58e766>=_0x4d4b8b){_0x58e766=_0x4d4b8b;_0x56d9f4=0xc8;}else{_0x56d9f4=0xce;}_0x2ecef3['status'](_0x56d9f4);return _0x2ecef3[_0x18f7('0x1d')]('Content-Range',_0x54f1d6+'-'+_0x58e766+'/'+_0x4d4b8b)['json'](_0x24db48);}return null;};}function patchUpdates(_0x176c24){return function(_0x5c2613){try{jsonpatch[_0x18f7('0x1e')](_0x5c2613,_0x176c24,!![]);}catch(_0x3808ad){return BPromise[_0x18f7('0x1f')](_0x3808ad);}return _0x5c2613[_0x18f7('0x20')]();};}function saveUpdates(_0x242645,_0x5d4bfa){return function(_0x3d7811){if(_0x3d7811){return _0x3d7811[_0x18f7('0x21')](_0x242645)['then'](function(_0x3db919){return _0x3db919;});}return null;};}function removeEntity(_0x4beb1b,_0xd3e684){return function(_0x377c4f){if(_0x377c4f){return _0x377c4f[_0x18f7('0x22')]()[_0x18f7('0x23')](function(){var _0x2a4820=_0x377c4f['get']({'plain':!![]});var _0x1e4597=_0x18f7('0x24');return db[_0x18f7('0x25')][_0x18f7('0x22')]({'where':{'type':_0x1e4597,'resourceId':_0x2a4820['id']}})[_0x18f7('0x23')](function(){return _0x377c4f;});})['then'](function(){_0x4beb1b[_0x18f7('0x16')](0xcc)[_0x18f7('0x17')]();});}};}function handleEntityNotFound(_0x167b7e,_0x39db96){return function(_0x27da53){if(!_0x27da53){_0x167b7e[_0x18f7('0x26')](0x194);}return _0x27da53;};}function handleError(_0x501b20,_0x2e6039){_0x2e6039=_0x2e6039||0x1f4;return function(_0x132293){logger['error'](_0x132293['stack']);if(_0x132293[_0x18f7('0x27')]){delete _0x132293[_0x18f7('0x27')];}_0x501b20[_0x18f7('0x16')](_0x2e6039)['send'](_0x132293);};}exports[_0x18f7('0x28')]=function(_0x3479c6,_0x4d3c7e){var _0x39fae2={},_0x184079={},_0x2e4a84={'count':0x0,'rows':[]};var _0xb821e8=_[_0x18f7('0x29')](db['JscriptyProject'][_0x18f7('0x2a')],function(_0x411587){return{'name':_0x411587[_0x18f7('0x2b')],'type':_0x411587[_0x18f7('0x2c')][_0x18f7('0x2d')]};});_0x184079['model']=_[_0x18f7('0x29')](_0xb821e8,'name');_0x184079[_0x18f7('0x2e')]=_[_0x18f7('0x2f')](_0x3479c6['query']);_0x184079[_0x18f7('0x30')]=_['intersection'](_0x184079[_0x18f7('0x31')],_0x184079['query']);_0x39fae2['attributes']=_[_0x18f7('0x32')](_0x184079['model'],qs[_0x18f7('0x33')](_0x3479c6[_0x18f7('0x2e')]['fields']));_0x39fae2[_0x18f7('0x34')]=_0x39fae2['attributes']['length']?_0x39fae2[_0x18f7('0x34')]:_0x184079[_0x18f7('0x31')];if(!_0x3479c6[_0x18f7('0x2e')][_0x18f7('0x35')](_0x18f7('0x36'))){_0x39fae2[_0x18f7('0x1b')]=qs[_0x18f7('0x1b')](_0x3479c6['query'][_0x18f7('0x1b')]);_0x39fae2[_0x18f7('0x19')]=qs['offset'](_0x3479c6[_0x18f7('0x2e')][_0x18f7('0x19')]);}_0x39fae2[_0x18f7('0x37')]=qs[_0x18f7('0x38')](_0x3479c6[_0x18f7('0x2e')][_0x18f7('0x38')]);_0x39fae2[_0x18f7('0x39')]=qs[_0x18f7('0x30')](_[_0x18f7('0x3a')](_0x3479c6[_0x18f7('0x2e')],_0x184079[_0x18f7('0x30')]),_0xb821e8);if(_0x3479c6[_0x18f7('0x2e')][_0x18f7('0x3b')]){_0x39fae2[_0x18f7('0x39')]=_[_0x18f7('0x3c')](_0x39fae2[_0x18f7('0x39')],{'$or':_['map'](_0xb821e8,function(_0x428896){if(_0x428896[_0x18f7('0x2c')]!==_0x18f7('0x3d')){var _0x5d61a0={};_0x5d61a0[_0x428896[_0x18f7('0x27')]]={'$like':'%'+_0x3479c6[_0x18f7('0x2e')][_0x18f7('0x3b')]+'%'};return _0x5d61a0;}})});}_0x39fae2=_[_0x18f7('0x3c')]({},_0x39fae2,_0x3479c6[_0x18f7('0x3e')]);var _0x3ea5d9={'where':_0x39fae2[_0x18f7('0x39')]};return db[_0x18f7('0x3f')][_0x18f7('0x1c')](_0x3ea5d9)[_0x18f7('0x23')](function(_0x3d4b01){_0x2e4a84[_0x18f7('0x1c')]=_0x3d4b01;if(_0x3479c6['query'][_0x18f7('0x40')]){_0x39fae2['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x18f7('0x41')](_0x39fae2);})[_0x18f7('0x23')](function(_0x5e844a){_0x2e4a84[_0x18f7('0x42')]=_0x5e844a;return _0x2e4a84;})['then'](respondWithFilteredResult(_0x4d3c7e,_0x39fae2))[_0x18f7('0x43')](handleError(_0x4d3c7e,null));};exports[_0x18f7('0x44')]=function(_0x303e9e,_0x3792ea){var _0x201104={'raw':![],'where':{'id':_0x303e9e['params']['id']}},_0x4f5738={};_0x4f5738['model']=_[_0x18f7('0x2f')](db['JscriptyProject'][_0x18f7('0x2a')]);_0x4f5738['query']=_[_0x18f7('0x2f')](_0x303e9e[_0x18f7('0x2e')]);_0x4f5738[_0x18f7('0x30')]=_[_0x18f7('0x32')](_0x4f5738[_0x18f7('0x31')],_0x4f5738[_0x18f7('0x2e')]);_0x201104[_0x18f7('0x34')]=_[_0x18f7('0x32')](_0x4f5738['model'],qs[_0x18f7('0x33')](_0x303e9e[_0x18f7('0x2e')][_0x18f7('0x33')]));_0x201104[_0x18f7('0x34')]=_0x201104[_0x18f7('0x34')][_0x18f7('0x45')]?_0x201104['attributes']:_0x4f5738[_0x18f7('0x31')];if(_0x303e9e[_0x18f7('0x2e')][_0x18f7('0x40')]){_0x201104['include']=[{'all':!![]}];}_0x201104=_[_0x18f7('0x3c')]({},_0x201104,_0x303e9e[_0x18f7('0x3e')]);return db[_0x18f7('0x3f')]['find'](_0x201104)[_0x18f7('0x23')](handleEntityNotFound(_0x3792ea,null))[_0x18f7('0x23')](respondWithResult(_0x3792ea,null))[_0x18f7('0x43')](handleError(_0x3792ea,null));};exports[_0x18f7('0x46')]=function(_0x20beea,_0xaa6fda){return db[_0x18f7('0x3f')][_0x18f7('0x46')](_0x20beea[_0x18f7('0x47')],{})[_0x18f7('0x23')](function(_0x3c3a4d){var _0x702d75=_0x20beea[_0x18f7('0x48')]['get']({'plain':!![]});if(!_0x702d75)throw new Error(_0x18f7('0x49'));if(_0x702d75[_0x18f7('0x4a')]==='user'){var _0x415a32=_0x3c3a4d['get']({'plain':!![]});var _0x2c280b=_0x18f7('0x24');return db[_0x18f7('0x4b')]['find']({'where':{'name':_0x2c280b,'userProfileId':_0x702d75[_0x18f7('0x4c')]},'raw':!![]})[_0x18f7('0x23')](function(_0xa305c){if(_0xa305c&&_0xa305c[_0x18f7('0x4d')]===0x0){return db[_0x18f7('0x25')][_0x18f7('0x46')]({'name':_0x415a32[_0x18f7('0x27')],'resourceId':_0x415a32['id'],'type':_0xa305c[_0x18f7('0x27')],'sectionId':_0xa305c['id']},{})['then'](function(){return _0x3c3a4d;});}else{return _0x3c3a4d;}})['catch'](function(_0x1ed189){logger['error'](_0x18f7('0x4e'),_0x1ed189);throw _0x1ed189;});}return _0x3c3a4d;})[_0x18f7('0x23')](respondWithResult(_0xaa6fda,0xc9))[_0x18f7('0x43')](handleError(_0xaa6fda,null));};exports[_0x18f7('0x4f')]=function(_0x48fd2e,_0x1a008b){var _0x1ac1ea={'where':{'id':_0x48fd2e[_0x18f7('0x50')]['id']}},_0xb8912c={};_0xb8912c[_0x18f7('0x31')]=_[_0x18f7('0x2f')](db[_0x18f7('0x3f')][_0x18f7('0x2a')]);_0x1ac1ea[_0x18f7('0x34')]=_[_0x18f7('0x32')](_0xb8912c[_0x18f7('0x31')],qs[_0x18f7('0x33')](_0x48fd2e['query']['fields']));_0x1ac1ea['attributes']=_0x1ac1ea['attributes'][_0x18f7('0x45')]?_0x1ac1ea[_0x18f7('0x34')]:_0xb8912c[_0x18f7('0x31')];if(_0x48fd2e['query'][_0x18f7('0x40')]){_0x1ac1ea['include']=[{'all':!![]}];}_0x1ac1ea=_[_0x18f7('0x3c')]({},_0x1ac1ea,_0x48fd2e[_0x18f7('0x3e')]);return db[_0x18f7('0x3f')][_0x18f7('0x51')](_0x1ac1ea)['then'](handleEntityNotFound(_0x1a008b,null))['then'](function(_0x17aacb){if(_0x17aacb){var _0x950d58=_0x17aacb[_0x18f7('0x52')]({'plain':!![]});_0x950d58=qs[_0x18f7('0x53')](_0x950d58,['id',_0x18f7('0x54'),_0x18f7('0x55')]);_0x48fd2e[_0x18f7('0x47')]=_[_0x18f7('0x53')](_0x48fd2e[_0x18f7('0x47')],['id',_0x18f7('0x54'),_0x18f7('0x55')]);return db[_0x18f7('0x3f')][_0x18f7('0x46')](_[_0x18f7('0x3c')](_0x950d58,_0x48fd2e[_0x18f7('0x47')]),{'include':_0x48fd2e[_0x18f7('0x2e')][_0x18f7('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x37b690){var _0x588304=_0x48fd2e['user'][_0x18f7('0x52')]({'plain':!![]});if(!_0x588304)throw new Error(_0x18f7('0x49'));if(_0x588304['role']==='user'){var _0x1bb6e3=_0x37b690[_0x18f7('0x52')]({'plain':!![]});var _0x26a810='Projects';return db['UserProfileSection'][_0x18f7('0x51')]({'where':{'name':_0x26a810,'userProfileId':_0x588304[_0x18f7('0x4c')]},'raw':!![]})[_0x18f7('0x23')](function(_0x520504){if(_0x520504&&_0x520504[_0x18f7('0x4d')]===0x0){return db[_0x18f7('0x25')]['create']({'name':_0x1bb6e3[_0x18f7('0x27')],'resourceId':_0x1bb6e3['id'],'type':_0x520504[_0x18f7('0x27')],'sectionId':_0x520504['id']},{})[_0x18f7('0x23')](function(){return _0x37b690;});}else{return _0x37b690;}})[_0x18f7('0x43')](function(_0x4e3a9a){logger[_0x18f7('0x56')](_0x18f7('0x4e'),_0x4e3a9a);throw _0x4e3a9a;});}return _0x37b690;});}})[_0x18f7('0x23')](respondWithResult(_0x1a008b,0xc9))[_0x18f7('0x43')](handleError(_0x1a008b,null));};exports[_0x18f7('0x21')]=function(_0x1477c0,_0x269cbd){if(_0x1477c0[_0x18f7('0x47')]['id']){delete _0x1477c0[_0x18f7('0x47')]['id'];}return db[_0x18f7('0x3f')]['find']({'where':{'id':_0x1477c0['params']['id']}})[_0x18f7('0x23')](handleEntityNotFound(_0x269cbd,null))['then'](saveUpdates(_0x1477c0[_0x18f7('0x47')],null))[_0x18f7('0x23')](respondWithResult(_0x269cbd,null))[_0x18f7('0x43')](handleError(_0x269cbd,null));};exports[_0x18f7('0x22')]=function(_0x586dd3,_0x1edc91){return db[_0x18f7('0x3f')][_0x18f7('0x51')]({'where':{'id':_0x586dd3['params']['id']}})[_0x18f7('0x23')](handleEntityNotFound(_0x1edc91,null))[_0x18f7('0x23')](removeEntity(_0x1edc91,null))['catch'](handleError(_0x1edc91,null));};exports[_0x18f7('0x57')]=function(_0x327c17,_0x5ca68d,_0x43a82b){var _0x5f5c57={'raw':!![],'where':{}};var _0x5dd977={};var _0x2b540f={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x18f7('0x58')]({'where':{'id':_0x327c17['params']['id']}})[_0x18f7('0x23')](handleEntityNotFound(_0x5ca68d,null))[_0x18f7('0x23')](function(_0x2d1555){if(_0x2d1555){_0x5dd977[_0x18f7('0x31')]=_[_0x18f7('0x2f')](db[_0x18f7('0x59')][_0x18f7('0x2a')]);_0x5dd977[_0x18f7('0x2e')]=_[_0x18f7('0x2f')](_0x327c17['query']);_0x5dd977[_0x18f7('0x30')]=_['intersection'](_0x5dd977[_0x18f7('0x31')],_0x5dd977[_0x18f7('0x2e')]);_0x5f5c57[_0x18f7('0x34')]=_[_0x18f7('0x32')](_0x5dd977[_0x18f7('0x31')],qs[_0x18f7('0x33')](_0x327c17['query'][_0x18f7('0x33')]));_0x5f5c57[_0x18f7('0x34')]=_0x5f5c57[_0x18f7('0x34')]['length']?_0x5f5c57[_0x18f7('0x34')]:_0x5dd977['model'];if(!_0x327c17[_0x18f7('0x2e')]['hasOwnProperty'](_0x18f7('0x36'))){_0x5f5c57[_0x18f7('0x1b')]=qs[_0x18f7('0x1b')](_0x327c17['query'][_0x18f7('0x1b')]);_0x5f5c57[_0x18f7('0x19')]=qs[_0x18f7('0x19')](_0x327c17[_0x18f7('0x2e')][_0x18f7('0x19')]);}_0x5f5c57[_0x18f7('0x37')]=qs['sort'](_0x327c17[_0x18f7('0x2e')][_0x18f7('0x38')]);_0x5f5c57['where']=qs[_0x18f7('0x30')](_[_0x18f7('0x3a')](_0x327c17[_0x18f7('0x2e')],_0x5dd977[_0x18f7('0x30')]));_0x5f5c57[_0x18f7('0x39')][_0x18f7('0x5a')]=_0x2d1555['id'];if(_0x327c17[_0x18f7('0x2e')]['filter']){_0x5f5c57['where']=_[_0x18f7('0x3c')](_0x5f5c57[_0x18f7('0x39')],{'$or':_[_0x18f7('0x29')](_0x5f5c57['attributes'],function(_0x3a7b37){var _0x12024a={};_0x12024a[_0x3a7b37]={'$like':'%'+_0x327c17[_0x18f7('0x2e')][_0x18f7('0x3b')]+'%'};return _0x12024a;})});}_0x5f5c57=_[_0x18f7('0x3c')]({},_0x5f5c57,_0x327c17[_0x18f7('0x3e')]);return db[_0x18f7('0x59')][_0x18f7('0x1c')]({'where':_0x5f5c57[_0x18f7('0x39')]})['then'](function(_0xa9f214){_0x2b540f['count']=_0xa9f214;if(_0x327c17[_0x18f7('0x2e')]['includeAll']){_0x5f5c57[_0x18f7('0x5b')]=[{'all':!![]}];}return db[_0x18f7('0x59')][_0x18f7('0x41')](_0x5f5c57);})['then'](function(_0x1e3fe8){_0x2b540f['rows']=_0x1e3fe8;return _0x2b540f;});}})[_0x18f7('0x23')](respondWithFilteredResult(_0x5ca68d,_0x5f5c57))[_0x18f7('0x43')](handleError(_0x5ca68d,null));};exports[_0x18f7('0x5c')]=function(_0x35394a,_0x66caec,_0x463e5d){var _0x5ea619={'raw':!![],'where':{}};var _0x1b33a8={};var _0x244594={'count':0x0,'rows':[]};return db[_0x18f7('0x3f')][_0x18f7('0x58')]({'where':{'id':_0x35394a['params']['id']}})[_0x18f7('0x23')](handleEntityNotFound(_0x66caec,null))[_0x18f7('0x23')](function(_0x15d0e8){if(_0x15d0e8){_0x1b33a8[_0x18f7('0x31')]=_[_0x18f7('0x2f')](db['JscriptyAnswerReport'][_0x18f7('0x2a')]);_0x1b33a8['query']=_[_0x18f7('0x2f')](_0x35394a[_0x18f7('0x2e')]);_0x1b33a8[_0x18f7('0x30')]=_[_0x18f7('0x32')](_0x1b33a8[_0x18f7('0x31')],_0x1b33a8[_0x18f7('0x2e')]);_0x5ea619[_0x18f7('0x34')]=_[_0x18f7('0x32')](_0x1b33a8['model'],qs['fields'](_0x35394a[_0x18f7('0x2e')]['fields']));_0x5ea619[_0x18f7('0x34')]=_0x5ea619[_0x18f7('0x34')][_0x18f7('0x45')]?_0x5ea619[_0x18f7('0x34')]:_0x1b33a8[_0x18f7('0x31')];if(!_0x35394a[_0x18f7('0x2e')][_0x18f7('0x35')](_0x18f7('0x36'))){_0x5ea619[_0x18f7('0x1b')]=qs['limit'](_0x35394a[_0x18f7('0x2e')]['limit']);_0x5ea619[_0x18f7('0x19')]=qs[_0x18f7('0x19')](_0x35394a[_0x18f7('0x2e')][_0x18f7('0x19')]);}_0x5ea619[_0x18f7('0x37')]=qs['sort'](_0x35394a[_0x18f7('0x2e')]['sort']);_0x5ea619[_0x18f7('0x39')]=qs[_0x18f7('0x30')](_[_0x18f7('0x3a')](_0x35394a[_0x18f7('0x2e')],_0x1b33a8[_0x18f7('0x30')]));_0x5ea619[_0x18f7('0x39')][_0x18f7('0x5a')]=_0x15d0e8['id'];if(_0x35394a['query'][_0x18f7('0x3b')]){_0x5ea619[_0x18f7('0x39')]=_[_0x18f7('0x3c')](_0x5ea619[_0x18f7('0x39')],{'$or':_[_0x18f7('0x29')](_0x5ea619['attributes'],function(_0x55193e){var _0x405916={};_0x405916[_0x55193e]={'$like':'%'+_0x35394a['query'][_0x18f7('0x3b')]+'%'};return _0x405916;})});}_0x5ea619=_[_0x18f7('0x3c')]({},_0x5ea619,_0x35394a[_0x18f7('0x3e')]);return db[_0x18f7('0x5d')]['count']({'where':_0x5ea619[_0x18f7('0x39')]})[_0x18f7('0x23')](function(_0x27c3ef){_0x244594[_0x18f7('0x1c')]=_0x27c3ef;if(_0x35394a[_0x18f7('0x2e')][_0x18f7('0x40')]){_0x5ea619[_0x18f7('0x5b')]=[{'all':!![]}];}return db[_0x18f7('0x5d')][_0x18f7('0x41')](_0x5ea619);})['then'](function(_0x4ad81b){_0x244594[_0x18f7('0x42')]=_0x4ad81b;return _0x244594;});}})[_0x18f7('0x23')](respondWithFilteredResult(_0x66caec,_0x5ea619))[_0x18f7('0x43')](handleError(_0x66caec,null));};function char(_0x2e7d8f){return _0x18f7('0x5e')===typeof _0x2e7d8f?String[_0x18f7('0x5f')][_0x18f7('0x1e')](null,arguments):_0x2e7d8f;}function needsEncapsulation(_0x25d0d8){return!!_0x25d0d8&&(_0x25d0d8['toString']()[_0x18f7('0x60')](char(0xd))>=0x0||_0x25d0d8[_0x18f7('0x61')]()['indexOf'](char(0xa))>=0x0||_0x25d0d8['toString']()[_0x18f7('0x60')](char(0x2c))>=0x0||_0x25d0d8[_0x18f7('0x61')]()[_0x18f7('0x60')](char(0x22))>=0x0);}function encapsulate(_0x3cd3f2){var _0x223b15=char(0x22),_0x202f27='\x5c'+char(0x22),_0x29a89e=_0x3cd3f2[_0x18f7('0x61')]()[_0x18f7('0x62')](new RegExp(_0x223b15,'g'),_0x202f27);return _0x223b15+_0x29a89e+_0x223b15;}exports[_0x18f7('0x63')]=function(_0x4a9a11,_0x4a661f,_0x2b145a){var _0xd55c41,_0x19caed;var _0x1cc394={'where':{'ProjectId':_0x4a9a11[_0x18f7('0x50')]['id']}};if(_0x4a9a11[_0x18f7('0x2e')][_0x18f7('0x64')]){_0x1cc394[_0x18f7('0x39')][_0x18f7('0x65')]=JSON[_0x18f7('0x66')](_0x4a9a11[_0x18f7('0x2e')][_0x18f7('0x64')]);}return db[_0x18f7('0x59')][_0x18f7('0x41')](_0x1cc394)[_0x18f7('0x23')](handleEntityNotFound(_0x4a661f,null))[_0x18f7('0x23')](function(_0xa12d56){if(_0xa12d56){_0xd55c41=_0xa12d56;return db[_0x18f7('0x67')][_0x18f7('0x41')]({'where':{'SessionId':{'$in':_['map'](_0xd55c41,'id')},'ProjectId':_0x4a9a11[_0x18f7('0x50')]['id']},'order':_0x18f7('0x68')});}})[_0x18f7('0x23')](handleEntityNotFound(_0x4a661f,null))[_0x18f7('0x23')](function(_0x283bef){if(_0x283bef){_0x19caed=_0x283bef;var _0x295b8f={};for(var _0x3d5bf=0x0,_0x4da0b4=_0x19caed[_0x18f7('0x45')];_0x3d5bf<_0x4da0b4;_0x3d5bf++){if(!_0x295b8f[_0x18f7('0x35')](_0x19caed[_0x3d5bf][_0x18f7('0x69')])){_0x295b8f[_0x19caed[_0x3d5bf][_0x18f7('0x69')]]=needsEncapsulation(_0x19caed[_0x3d5bf]['question'])?encapsulate(_0x19caed[_0x3d5bf]['question']):_0x19caed[_0x3d5bf][_0x18f7('0x6a')];}}var _0xd0ab65=[],_0x53e45c={};for(var _0x8f0b08=0x0,_0x56a73a=_0xd55c41[_0x18f7('0x45')];_0x8f0b08<_0x56a73a;_0x8f0b08++){_0x53e45c={'ProjectId':_0x4a9a11[_0x18f7('0x50')]['id'],'SessionId':_0xd55c41[_0x8f0b08]['id'],'StartTime':moment(_0xd55c41[_0x8f0b08]['starttime'])[_0x18f7('0x6b')](_0x18f7('0x6c'))};for(var _0xe01942=0x0,_0xcc86fa=_0x19caed[_0x18f7('0x45')];_0xe01942<_0xcc86fa;_0xe01942++){if(_0x19caed[_0xe01942][_0x18f7('0x6d')]==_0xd55c41[_0x8f0b08]['id']&&_0x295b8f[_0x18f7('0x35')](_0x19caed[_0xe01942]['questionId'])){_0x53e45c[_0x295b8f[_0x19caed[_0xe01942][_0x18f7('0x69')]]]=_0x19caed[_0xe01942][_0x18f7('0x6e')];}}for(var _0x49e636 in _0x295b8f){if(!_0x53e45c[_0x18f7('0x35')](_0x295b8f[_0x49e636])){_0x53e45c[_0x295b8f[_0x49e636]]=null;}}_0xd0ab65[_0x18f7('0x6f')](_0x53e45c);}return _0xd0ab65;}})[_0x18f7('0x23')](function(_0x251c3){if(!_[_0x18f7('0x70')](_0x251c3)){var _0x5f4f1a=toCsv(_0x251c3);var _0x3cedde=Date[_0x18f7('0x71')]();fs['writeFileSync'](util[_0x18f7('0x6b')](_0x18f7('0x72'),_0x4a9a11[_0x18f7('0x50')]['id'],_0x3cedde),_0x5f4f1a);_0x4a661f['setHeader'](_0x18f7('0x73'),_0x18f7('0x74')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x4a9a11[_0x18f7('0x50')]['id'],_0x3cedde));_0x4a661f[_0x18f7('0x75')](_0x18f7('0x76'),_0x18f7('0x77'));return _0x4a661f[_0x18f7('0x78')](util[_0x18f7('0x6b')](_0x18f7('0x72'),_0x4a9a11[_0x18f7('0x50')]['id'],_0x3cedde));}else{return _0x4a661f[_0x18f7('0x26')](0xcc);}})[_0x18f7('0x43')](handleError(_0x4a661f,null));}; \ No newline at end of file +var _0x79d7=['params','omit','createdAt','updatedAt','body','autoAssociation','getSessions','findOne','JscriptySessionReport','pick','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','format','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','catch','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x79d7,0x9c));var _0x779d=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x79d7[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0x779d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x779d('0x1'));var jsonpatch=require(_0x779d('0x2'));var rp=require(_0x779d('0x3'));var moment=require(_0x779d('0x4'));var BPromise=require(_0x779d('0x5'));var Mustache=require(_0x779d('0x6'));var util=require('util');var path=require(_0x779d('0x7'));var sox=require(_0x779d('0x8'));var csv=require(_0x779d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x779d('0xa'));var squel=require('squel');var crypto=require(_0x779d('0xb'));var jsforce=require(_0x779d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x779d('0xd'));var authService=require(_0x779d('0xe'));var qs=require(_0x779d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x779d('0x10'));var logger=require('../../config/logger')(_0x779d('0x11'));var utils=require('../../config/utils');var config=require(_0x779d('0x12'));var licenseUtil=require(_0x779d('0x13'));var db=require(_0x779d('0x14'))['db'];function respondWithStatusCode(_0x54037e,_0x3a6a2f){_0x3a6a2f=_0x3a6a2f||0xcc;return function(_0x40495a){if(_0x40495a){return _0x54037e[_0x779d('0x15')](_0x3a6a2f);}return _0x54037e[_0x779d('0x16')](_0x3a6a2f)[_0x779d('0x17')]();};}function respondWithResult(_0x258e05,_0x4ae9c7){_0x4ae9c7=_0x4ae9c7||0xc8;return function(_0x3c12cb){if(_0x3c12cb){return _0x258e05[_0x779d('0x16')](_0x4ae9c7)[_0x779d('0x18')](_0x3c12cb);}};}function respondWithFilteredResult(_0x349220,_0x1c7ad7){return function(_0x49dbc6){if(_0x49dbc6){var _0x26dfa2=typeof _0x1c7ad7[_0x779d('0x19')]===_0x779d('0x1a')&&typeof _0x1c7ad7['limit']===_0x779d('0x1a');var _0x219106=_0x49dbc6[_0x779d('0x1b')];var _0x18900e=_0x26dfa2?0x0:_0x1c7ad7[_0x779d('0x19')];var _0x21102d=_0x26dfa2?_0x49dbc6[_0x779d('0x1b')]:_0x1c7ad7[_0x779d('0x19')]+_0x1c7ad7[_0x779d('0x1c')];var _0x4192c;if(_0x21102d>=_0x219106){_0x21102d=_0x219106;_0x4192c=0xc8;}else{_0x4192c=0xce;}_0x349220[_0x779d('0x16')](_0x4192c);return _0x349220[_0x779d('0x1d')](_0x779d('0x1e'),_0x18900e+'-'+_0x21102d+'/'+_0x219106)['json'](_0x49dbc6);}return null;};}function patchUpdates(_0x1ab255){return function(_0x57c5fd){try{jsonpatch[_0x779d('0x1f')](_0x57c5fd,_0x1ab255,!![]);}catch(_0x4d0f40){return BPromise[_0x779d('0x20')](_0x4d0f40);}return _0x57c5fd[_0x779d('0x21')]();};}function saveUpdates(_0xffa3e,_0x2d4e36){return function(_0x599ee3){if(_0x599ee3){return _0x599ee3[_0x779d('0x22')](_0xffa3e)[_0x779d('0x23')](function(_0xbe3028){return _0xbe3028;});}return null;};}function removeEntity(_0x10da0e,_0x101ec1){return function(_0x1ddfa5){if(_0x1ddfa5){return _0x1ddfa5[_0x779d('0x24')]()[_0x779d('0x23')](function(){var _0x1e2ab5=_0x1ddfa5[_0x779d('0x25')]({'plain':!![]});var _0x4cbd1d=_0x779d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x4cbd1d,'resourceId':_0x1e2ab5['id']}})[_0x779d('0x23')](function(){return _0x1ddfa5;});})[_0x779d('0x23')](function(){_0x10da0e['status'](0xcc)[_0x779d('0x17')]();});}};}function handleEntityNotFound(_0x842638,_0x151d35){return function(_0x5b2070){if(!_0x5b2070){_0x842638[_0x779d('0x15')](0x194);}return _0x5b2070;};}function handleError(_0x244bb4,_0x3e825a){_0x3e825a=_0x3e825a||0x1f4;return function(_0x1b7584){logger[_0x779d('0x27')](_0x1b7584[_0x779d('0x28')]);if(_0x1b7584['name']){delete _0x1b7584[_0x779d('0x29')];}_0x244bb4[_0x779d('0x16')](_0x3e825a)[_0x779d('0x2a')](_0x1b7584);};}exports[_0x779d('0x2b')]=function(_0x2a0982,_0x1ed423){var _0x22df77={},_0x2060d5={},_0xae6d6f={'count':0x0,'rows':[]};var _0xbaaec8=_['map'](db[_0x779d('0x2c')][_0x779d('0x2d')],function(_0x1d33c5){return{'name':_0x1d33c5[_0x779d('0x2e')],'type':_0x1d33c5[_0x779d('0x2f')][_0x779d('0x30')]};});_0x2060d5[_0x779d('0x31')]=_[_0x779d('0x32')](_0xbaaec8,_0x779d('0x29'));_0x2060d5['query']=_[_0x779d('0x33')](_0x2a0982[_0x779d('0x34')]);_0x2060d5[_0x779d('0x35')]=_['intersection'](_0x2060d5[_0x779d('0x31')],_0x2060d5[_0x779d('0x34')]);_0x22df77[_0x779d('0x36')]=_[_0x779d('0x37')](_0x2060d5[_0x779d('0x31')],qs[_0x779d('0x38')](_0x2a0982[_0x779d('0x34')]['fields']));_0x22df77[_0x779d('0x36')]=_0x22df77[_0x779d('0x36')][_0x779d('0x39')]?_0x22df77['attributes']:_0x2060d5[_0x779d('0x31')];if(!_0x2a0982['query'][_0x779d('0x3a')](_0x779d('0x3b'))){_0x22df77[_0x779d('0x1c')]=qs[_0x779d('0x1c')](_0x2a0982[_0x779d('0x34')][_0x779d('0x1c')]);_0x22df77[_0x779d('0x19')]=qs[_0x779d('0x19')](_0x2a0982[_0x779d('0x34')][_0x779d('0x19')]);}_0x22df77[_0x779d('0x3c')]=qs['sort'](_0x2a0982['query']['sort']);_0x22df77[_0x779d('0x3d')]=qs[_0x779d('0x35')](_['pick'](_0x2a0982[_0x779d('0x34')],_0x2060d5[_0x779d('0x35')]),_0xbaaec8);if(_0x2a0982['query'][_0x779d('0x3e')]){_0x22df77[_0x779d('0x3d')]=_[_0x779d('0x3f')](_0x22df77[_0x779d('0x3d')],{'$or':_[_0x779d('0x32')](_0xbaaec8,function(_0x3eb60e){if(_0x3eb60e['type']!==_0x779d('0x40')){var _0x51958e={};_0x51958e[_0x3eb60e[_0x779d('0x29')]]={'$like':'%'+_0x2a0982[_0x779d('0x34')][_0x779d('0x3e')]+'%'};return _0x51958e;}})});}_0x22df77=_[_0x779d('0x3f')]({},_0x22df77,_0x2a0982[_0x779d('0x41')]);var _0x5292e5={'where':_0x22df77[_0x779d('0x3d')]};return db[_0x779d('0x2c')][_0x779d('0x1b')](_0x5292e5)[_0x779d('0x23')](function(_0x44a83){_0xae6d6f[_0x779d('0x1b')]=_0x44a83;if(_0x2a0982[_0x779d('0x34')]['includeAll']){_0x22df77[_0x779d('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0x779d('0x43')](_0x22df77);})[_0x779d('0x23')](function(_0x1aea19){_0xae6d6f['rows']=_0x1aea19;return _0xae6d6f;})['then'](respondWithFilteredResult(_0x1ed423,_0x22df77))[_0x779d('0x44')](handleError(_0x1ed423,null));};exports['show']=function(_0x59dc0c,_0x311d6c){var _0x5a78fd={'raw':![],'where':{'id':_0x59dc0c['params']['id']}},_0x16ec97={};_0x16ec97[_0x779d('0x31')]=_['keys'](db[_0x779d('0x2c')][_0x779d('0x2d')]);_0x16ec97[_0x779d('0x34')]=_[_0x779d('0x33')](_0x59dc0c[_0x779d('0x34')]);_0x16ec97[_0x779d('0x35')]=_[_0x779d('0x37')](_0x16ec97[_0x779d('0x31')],_0x16ec97[_0x779d('0x34')]);_0x5a78fd[_0x779d('0x36')]=_[_0x779d('0x37')](_0x16ec97['model'],qs[_0x779d('0x38')](_0x59dc0c[_0x779d('0x34')]['fields']));_0x5a78fd['attributes']=_0x5a78fd[_0x779d('0x36')][_0x779d('0x39')]?_0x5a78fd['attributes']:_0x16ec97[_0x779d('0x31')];if(_0x59dc0c[_0x779d('0x34')][_0x779d('0x45')]){_0x5a78fd['include']=[{'all':!![]}];}_0x5a78fd=_[_0x779d('0x3f')]({},_0x5a78fd,_0x59dc0c[_0x779d('0x41')]);return db[_0x779d('0x2c')][_0x779d('0x46')](_0x5a78fd)[_0x779d('0x23')](handleEntityNotFound(_0x311d6c,null))[_0x779d('0x23')](respondWithResult(_0x311d6c,null))[_0x779d('0x44')](handleError(_0x311d6c,null));};exports[_0x779d('0x47')]=function(_0x4563a5,_0x3152f2){return db[_0x779d('0x2c')][_0x779d('0x47')](_0x4563a5['body'],{})['then'](function(_0x34ba86){var _0x4382e4=_0x4563a5['user']['get']({'plain':!![]});if(!_0x4382e4)throw new Error(_0x779d('0x48'));if(_0x4382e4[_0x779d('0x49')]===_0x779d('0x4a')){var _0x1dfa3e=_0x34ba86[_0x779d('0x25')]({'plain':!![]});var _0x56b015=_0x779d('0x26');return db[_0x779d('0x4b')][_0x779d('0x46')]({'where':{'name':_0x56b015,'userProfileId':_0x4382e4[_0x779d('0x4c')]},'raw':!![]})[_0x779d('0x23')](function(_0x14ca26){if(_0x14ca26&&_0x14ca26['autoAssociation']===0x0){return db[_0x779d('0x4d')][_0x779d('0x47')]({'name':_0x1dfa3e[_0x779d('0x29')],'resourceId':_0x1dfa3e['id'],'type':_0x14ca26[_0x779d('0x29')],'sectionId':_0x14ca26['id']},{})[_0x779d('0x23')](function(){return _0x34ba86;});}else{return _0x34ba86;}})[_0x779d('0x44')](function(_0x4d58de){logger[_0x779d('0x27')](_0x779d('0x4e'),_0x4d58de);throw _0x4d58de;});}return _0x34ba86;})[_0x779d('0x23')](respondWithResult(_0x3152f2,0xc9))[_0x779d('0x44')](handleError(_0x3152f2,null));};exports[_0x779d('0x4f')]=function(_0x265c98,_0x12c977){var _0x41e706={'where':{'id':_0x265c98[_0x779d('0x50')]['id']}},_0x1b72d7={};_0x1b72d7[_0x779d('0x31')]=_['keys'](db[_0x779d('0x2c')]['rawAttributes']);_0x41e706[_0x779d('0x36')]=_[_0x779d('0x37')](_0x1b72d7['model'],qs[_0x779d('0x38')](_0x265c98[_0x779d('0x34')]['fields']));_0x41e706[_0x779d('0x36')]=_0x41e706[_0x779d('0x36')]['length']?_0x41e706[_0x779d('0x36')]:_0x1b72d7[_0x779d('0x31')];if(_0x265c98['query']['includeAll']){_0x41e706['include']=[{'all':!![]}];}_0x41e706=_[_0x779d('0x3f')]({},_0x41e706,_0x265c98[_0x779d('0x41')]);return db[_0x779d('0x2c')][_0x779d('0x46')](_0x41e706)[_0x779d('0x23')](handleEntityNotFound(_0x12c977,null))[_0x779d('0x23')](function(_0x295f56){if(_0x295f56){var _0x29d952=_0x295f56[_0x779d('0x25')]({'plain':!![]});_0x29d952=qs[_0x779d('0x51')](_0x29d952,['id',_0x779d('0x52'),_0x779d('0x53')]);_0x265c98[_0x779d('0x54')]=_[_0x779d('0x51')](_0x265c98['body'],['id',_0x779d('0x52'),_0x779d('0x53')]);return db[_0x779d('0x2c')][_0x779d('0x47')](_[_0x779d('0x3f')](_0x29d952,_0x265c98[_0x779d('0x54')]),{'include':_0x265c98[_0x779d('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x5f5960){var _0x48ea4a=_0x265c98[_0x779d('0x4a')]['get']({'plain':!![]});if(!_0x48ea4a)throw new Error(_0x779d('0x48'));if(_0x48ea4a[_0x779d('0x49')]==='user'){var _0x4b9cef=_0x5f5960[_0x779d('0x25')]({'plain':!![]});var _0xec21ab=_0x779d('0x26');return db[_0x779d('0x4b')]['find']({'where':{'name':_0xec21ab,'userProfileId':_0x48ea4a[_0x779d('0x4c')]},'raw':!![]})['then'](function(_0x429779){if(_0x429779&&_0x429779[_0x779d('0x55')]===0x0){return db[_0x779d('0x4d')][_0x779d('0x47')]({'name':_0x4b9cef[_0x779d('0x29')],'resourceId':_0x4b9cef['id'],'type':_0x429779[_0x779d('0x29')],'sectionId':_0x429779['id']},{})[_0x779d('0x23')](function(){return _0x5f5960;});}else{return _0x5f5960;}})[_0x779d('0x44')](function(_0x4857a3){logger[_0x779d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4857a3);throw _0x4857a3;});}return _0x5f5960;});}})['then'](respondWithResult(_0x12c977,0xc9))[_0x779d('0x44')](handleError(_0x12c977,null));};exports['update']=function(_0x6f9eeb,_0x567a06){if(_0x6f9eeb['body']['id']){delete _0x6f9eeb[_0x779d('0x54')]['id'];}return db[_0x779d('0x2c')][_0x779d('0x46')]({'where':{'id':_0x6f9eeb['params']['id']}})[_0x779d('0x23')](handleEntityNotFound(_0x567a06,null))[_0x779d('0x23')](saveUpdates(_0x6f9eeb[_0x779d('0x54')],null))['then'](respondWithResult(_0x567a06,null))[_0x779d('0x44')](handleError(_0x567a06,null));};exports[_0x779d('0x24')]=function(_0x295fd3,_0x4586ff){return db[_0x779d('0x2c')][_0x779d('0x46')]({'where':{'id':_0x295fd3[_0x779d('0x50')]['id']}})[_0x779d('0x23')](handleEntityNotFound(_0x4586ff,null))[_0x779d('0x23')](removeEntity(_0x4586ff,null))[_0x779d('0x44')](handleError(_0x4586ff,null));};exports[_0x779d('0x56')]=function(_0x2c121b,_0x32db92,_0x374432){var _0x3cee21={'raw':!![],'where':{}};var _0x14dbe7={};var _0x4b91af={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x779d('0x57')]({'where':{'id':_0x2c121b[_0x779d('0x50')]['id']}})[_0x779d('0x23')](handleEntityNotFound(_0x32db92,null))[_0x779d('0x23')](function(_0x1218ad){if(_0x1218ad){_0x14dbe7[_0x779d('0x31')]=_['keys'](db[_0x779d('0x58')][_0x779d('0x2d')]);_0x14dbe7[_0x779d('0x34')]=_[_0x779d('0x33')](_0x2c121b[_0x779d('0x34')]);_0x14dbe7[_0x779d('0x35')]=_[_0x779d('0x37')](_0x14dbe7[_0x779d('0x31')],_0x14dbe7[_0x779d('0x34')]);_0x3cee21[_0x779d('0x36')]=_[_0x779d('0x37')](_0x14dbe7[_0x779d('0x31')],qs['fields'](_0x2c121b[_0x779d('0x34')][_0x779d('0x38')]));_0x3cee21[_0x779d('0x36')]=_0x3cee21[_0x779d('0x36')][_0x779d('0x39')]?_0x3cee21[_0x779d('0x36')]:_0x14dbe7[_0x779d('0x31')];if(!_0x2c121b[_0x779d('0x34')][_0x779d('0x3a')](_0x779d('0x3b'))){_0x3cee21['limit']=qs[_0x779d('0x1c')](_0x2c121b[_0x779d('0x34')]['limit']);_0x3cee21['offset']=qs['offset'](_0x2c121b[_0x779d('0x34')][_0x779d('0x19')]);}_0x3cee21[_0x779d('0x3c')]=qs['sort'](_0x2c121b[_0x779d('0x34')]['sort']);_0x3cee21[_0x779d('0x3d')]=qs[_0x779d('0x35')](_[_0x779d('0x59')](_0x2c121b[_0x779d('0x34')],_0x14dbe7[_0x779d('0x35')]));_0x3cee21[_0x779d('0x3d')][_0x779d('0x5a')]=_0x1218ad['id'];if(_0x2c121b['query'][_0x779d('0x3e')]){_0x3cee21[_0x779d('0x3d')]=_[_0x779d('0x3f')](_0x3cee21[_0x779d('0x3d')],{'$or':_[_0x779d('0x32')](_0x3cee21['attributes'],function(_0x2a1b69){var _0x54b84a={};_0x54b84a[_0x2a1b69]={'$like':'%'+_0x2c121b[_0x779d('0x34')][_0x779d('0x3e')]+'%'};return _0x54b84a;})});}_0x3cee21=_[_0x779d('0x3f')]({},_0x3cee21,_0x2c121b[_0x779d('0x41')]);return db[_0x779d('0x58')]['count']({'where':_0x3cee21['where']})[_0x779d('0x23')](function(_0x57c235){_0x4b91af[_0x779d('0x1b')]=_0x57c235;if(_0x2c121b['query'][_0x779d('0x45')]){_0x3cee21['include']=[{'all':!![]}];}return db[_0x779d('0x58')][_0x779d('0x43')](_0x3cee21);})[_0x779d('0x23')](function(_0x3acfb5){_0x4b91af[_0x779d('0x5b')]=_0x3acfb5;return _0x4b91af;});}})[_0x779d('0x23')](respondWithFilteredResult(_0x32db92,_0x3cee21))['catch'](handleError(_0x32db92,null));};exports[_0x779d('0x5c')]=function(_0x3fa3e4,_0x2e9fc9,_0x486233){var _0xf308c3={'raw':!![],'where':{}};var _0x54c9f1={};var _0xb3f34d={'count':0x0,'rows':[]};return db[_0x779d('0x2c')][_0x779d('0x57')]({'where':{'id':_0x3fa3e4['params']['id']}})[_0x779d('0x23')](handleEntityNotFound(_0x2e9fc9,null))[_0x779d('0x23')](function(_0x4eac41){if(_0x4eac41){_0x54c9f1[_0x779d('0x31')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x54c9f1[_0x779d('0x34')]=_[_0x779d('0x33')](_0x3fa3e4[_0x779d('0x34')]);_0x54c9f1['filters']=_[_0x779d('0x37')](_0x54c9f1[_0x779d('0x31')],_0x54c9f1[_0x779d('0x34')]);_0xf308c3[_0x779d('0x36')]=_[_0x779d('0x37')](_0x54c9f1['model'],qs['fields'](_0x3fa3e4['query'][_0x779d('0x38')]));_0xf308c3['attributes']=_0xf308c3[_0x779d('0x36')]['length']?_0xf308c3[_0x779d('0x36')]:_0x54c9f1[_0x779d('0x31')];if(!_0x3fa3e4['query'][_0x779d('0x3a')]('nolimit')){_0xf308c3[_0x779d('0x1c')]=qs['limit'](_0x3fa3e4[_0x779d('0x34')][_0x779d('0x1c')]);_0xf308c3[_0x779d('0x19')]=qs[_0x779d('0x19')](_0x3fa3e4[_0x779d('0x34')]['offset']);}_0xf308c3[_0x779d('0x3c')]=qs['sort'](_0x3fa3e4['query']['sort']);_0xf308c3[_0x779d('0x3d')]=qs['filters'](_[_0x779d('0x59')](_0x3fa3e4['query'],_0x54c9f1[_0x779d('0x35')]));_0xf308c3[_0x779d('0x3d')][_0x779d('0x5a')]=_0x4eac41['id'];if(_0x3fa3e4[_0x779d('0x34')][_0x779d('0x3e')]){_0xf308c3['where']=_['merge'](_0xf308c3['where'],{'$or':_[_0x779d('0x32')](_0xf308c3[_0x779d('0x36')],function(_0x1c81cb){var _0x14a630={};_0x14a630[_0x1c81cb]={'$like':'%'+_0x3fa3e4[_0x779d('0x34')][_0x779d('0x3e')]+'%'};return _0x14a630;})});}_0xf308c3=_[_0x779d('0x3f')]({},_0xf308c3,_0x3fa3e4[_0x779d('0x41')]);return db[_0x779d('0x5d')][_0x779d('0x1b')]({'where':_0xf308c3[_0x779d('0x3d')]})['then'](function(_0x34ba2a){_0xb3f34d[_0x779d('0x1b')]=_0x34ba2a;if(_0x3fa3e4[_0x779d('0x34')]['includeAll']){_0xf308c3[_0x779d('0x42')]=[{'all':!![]}];}return db[_0x779d('0x5d')][_0x779d('0x43')](_0xf308c3);})[_0x779d('0x23')](function(_0x383787){_0xb3f34d[_0x779d('0x5b')]=_0x383787;return _0xb3f34d;});}})['then'](respondWithFilteredResult(_0x2e9fc9,_0xf308c3))['catch'](handleError(_0x2e9fc9,null));};function char(_0x2d07be){return _0x779d('0x5e')===typeof _0x2d07be?String[_0x779d('0x5f')][_0x779d('0x1f')](null,arguments):_0x2d07be;}function needsEncapsulation(_0x5a7a95){return!!_0x5a7a95&&(_0x5a7a95[_0x779d('0x60')]()[_0x779d('0x61')](char(0xd))>=0x0||_0x5a7a95[_0x779d('0x60')]()[_0x779d('0x61')](char(0xa))>=0x0||_0x5a7a95['toString']()[_0x779d('0x61')](char(0x2c))>=0x0||_0x5a7a95['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x922149){var _0x810b9a=char(0x22),_0x5f1fff='\x5c'+char(0x22),_0x2a81d8=_0x922149[_0x779d('0x60')]()[_0x779d('0x62')](new RegExp(_0x810b9a,'g'),_0x5f1fff);return _0x810b9a+_0x2a81d8+_0x810b9a;}exports[_0x779d('0x63')]=function(_0x5176c3,_0x1b5752,_0x1ccef9){var _0x4243fc,_0x22e95d;var _0x5398e7={'where':{'ProjectId':_0x5176c3[_0x779d('0x50')]['id']}};if(_0x5176c3[_0x779d('0x34')][_0x779d('0x64')]){_0x5398e7['where'][_0x779d('0x65')]=JSON[_0x779d('0x66')](_0x5176c3[_0x779d('0x34')][_0x779d('0x64')]);}return db[_0x779d('0x58')][_0x779d('0x43')](_0x5398e7)[_0x779d('0x23')](handleEntityNotFound(_0x1b5752,null))[_0x779d('0x23')](function(_0x47e278){if(_0x47e278){_0x4243fc=_0x47e278;return db['JscriptyQuestionReport'][_0x779d('0x43')]({'where':{'SessionId':{'$in':_[_0x779d('0x32')](_0x4243fc,'id')},'ProjectId':_0x5176c3[_0x779d('0x50')]['id']},'order':'-createdAt'});}})[_0x779d('0x23')](handleEntityNotFound(_0x1b5752,null))[_0x779d('0x23')](function(_0x11e19d){if(_0x11e19d){_0x22e95d=_0x11e19d;var _0x4452ce={};for(var _0x523ba7=0x0,_0x41a1b6=_0x22e95d[_0x779d('0x39')];_0x523ba7<_0x41a1b6;_0x523ba7++){if(!_0x4452ce[_0x779d('0x3a')](_0x22e95d[_0x523ba7][_0x779d('0x67')])){_0x4452ce[_0x22e95d[_0x523ba7]['questionId']]=needsEncapsulation(_0x22e95d[_0x523ba7]['question'])?encapsulate(_0x22e95d[_0x523ba7][_0x779d('0x68')]):_0x22e95d[_0x523ba7][_0x779d('0x68')];}}var _0x122ed8=[],_0x12e8f3={};for(var _0xd72f62=0x0,_0xdb5dc5=_0x4243fc[_0x779d('0x39')];_0xd72f62<_0xdb5dc5;_0xd72f62++){_0x12e8f3={'ProjectId':_0x5176c3[_0x779d('0x50')]['id'],'SessionId':_0x4243fc[_0xd72f62]['id'],'StartTime':moment(_0x4243fc[_0xd72f62][_0x779d('0x65')])['format'](_0x779d('0x69'))};for(var _0x5d6e65=0x0,_0x156b54=_0x22e95d['length'];_0x5d6e65<_0x156b54;_0x5d6e65++){if(_0x22e95d[_0x5d6e65][_0x779d('0x6a')]==_0x4243fc[_0xd72f62]['id']&&_0x4452ce[_0x779d('0x3a')](_0x22e95d[_0x5d6e65][_0x779d('0x67')])){_0x12e8f3[_0x4452ce[_0x22e95d[_0x5d6e65][_0x779d('0x67')]]]=_0x22e95d[_0x5d6e65][_0x779d('0x6b')];}}for(var _0x3eba0f in _0x4452ce){if(!_0x12e8f3[_0x779d('0x3a')](_0x4452ce[_0x3eba0f])){_0x12e8f3[_0x4452ce[_0x3eba0f]]=null;}}_0x122ed8[_0x779d('0x6c')](_0x12e8f3);}return _0x122ed8;}})[_0x779d('0x23')](function(_0x371f3a){if(!_[_0x779d('0x6d')](_0x371f3a)){var _0xee5d48=toCsv(_0x371f3a);var _0x5301b1=Date[_0x779d('0x6e')]();fs[_0x779d('0x6f')](util[_0x779d('0x70')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5176c3[_0x779d('0x50')]['id'],_0x5301b1),_0xee5d48);_0x1b5752['setHeader']('Content-disposition',_0x779d('0x71')+util[_0x779d('0x70')](_0x779d('0x72'),_0x5176c3[_0x779d('0x50')]['id'],_0x5301b1));_0x1b5752[_0x779d('0x73')]('Content-type','text/csv');return _0x1b5752[_0x779d('0x74')](util[_0x779d('0x70')](_0x779d('0x75'),_0x5176c3[_0x779d('0x50')]['id'],_0x5301b1));}else{return _0x1b5752[_0x779d('0x15')](0xcc);}})[_0x779d('0x44')](handleError(_0x1b5752,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index f9a6a72..dc8d699 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 _0xb7a8=['request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','moment','bluebird'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb7a8,0xec));var _0x8b7a=function(_0x1b4c17,_0x3b605c){_0x1b4c17=_0x1b4c17-0x0;var _0x53f3ea=_0xb7a8[_0x1b4c17];return _0x53f3ea;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))('api');var moment=require(_0x8b7a('0x2'));var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var attributes=require(_0x8b7a('0x7'));module[_0x8b7a('0x8')]=function(_0x1d61f3,_0x42e4c1){return _0x1d61f3[_0x8b7a('0x9')](_0x8b7a('0xa'),attributes,{'tableName':_0x8b7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x251b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger'];(function(_0x29d2f7,_0x22308a){var _0x1c2fba=function(_0x19a4b0){while(--_0x19a4b0){_0x29d2f7['push'](_0x29d2f7['shift']());}};_0x1c2fba(++_0x22308a);}(_0x251b,0x185));var _0xb251=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x251b[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0xb251('0x0'));var util=require(_0xb251('0x1'));var logger=require(_0xb251('0x2'))(_0xb251('0x3'));var moment=require(_0xb251('0x4'));var BPromise=require(_0xb251('0x5'));var rp=require(_0xb251('0x6'));var fs=require('fs');var path=require(_0xb251('0x7'));var rimraf=require(_0xb251('0x8'));var config=require(_0xb251('0x9'));var attributes=require(_0xb251('0xa'));module[_0xb251('0xb')]=function(_0x5e96a7,_0x30797a){return _0x5e96a7['define'](_0xb251('0xc'),attributes,{'tableName':_0xb251('0xd'),'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 c793e1d..8732680 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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x426f88,_0x18e655){var _0x1a3fd7=function(_0x1469fb){while(--_0x1469fb){_0x426f88['push'](_0x426f88['shift']());}};_0x1a3fd7(++_0x18e655);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x2fac71,_0x2ae81d){var _0x28cb27=function(_0x348dc6){while(--_0x348dc6){_0x2fac71['push'](_0x2fac71['shift']());}};_0x28cb27(++_0x2ae81d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 2049d21..db11388 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 _0x5ff4=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','post'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5ff4,0x137));var _0x45ff=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x5ff4[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0x45ff('0x0'));var util=require(_0x45ff('0x1'));var path=require(_0x45ff('0x2'));var timeout=require(_0x45ff('0x3'));var express=require(_0x45ff('0x4'));var router=express[_0x45ff('0x5')]();var fs_extra=require(_0x45ff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x45ff('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x45ff('0x8')]('/',auth[_0x45ff('0x9')](),controller[_0x45ff('0xa')]);router['get'](_0x45ff('0xb'),auth[_0x45ff('0x9')](),controller['describe']);router[_0x45ff('0x8')]('/:id',auth[_0x45ff('0x9')](),controller['show']);router[_0x45ff('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x45ff('0xd')](_0x45ff('0xe'),auth['isAuthenticated'](),controller[_0x45ff('0xf')]);router['delete'](_0x45ff('0xe'),auth[_0x45ff('0x9')](),controller[_0x45ff('0x10')]);module[_0x45ff('0x11')]=router; \ No newline at end of file +var _0xe0c9=['post','create','put','update','exports','util','connect-timeout','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xe0c9,0x115));var _0x9e0c=function(_0x283e0b,_0x3af85f){_0x283e0b=_0x283e0b-0x0;var _0x19428d=_0xe0c9[_0x283e0b];return _0x19428d;};'use strict';var multer=require('multer');var util=require(_0x9e0c('0x0'));var path=require('path');var timeout=require(_0x9e0c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e0c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x9e0c('0x3'));var controller=require(_0x9e0c('0x4'));router[_0x9e0c('0x5')]('/',auth[_0x9e0c('0x6')](),controller[_0x9e0c('0x7')]);router[_0x9e0c('0x5')](_0x9e0c('0x8'),auth[_0x9e0c('0x6')](),controller[_0x9e0c('0x9')]);router[_0x9e0c('0x5')](_0x9e0c('0xa'),auth[_0x9e0c('0x6')](),controller[_0x9e0c('0xb')]);router[_0x9e0c('0xc')]('/',auth['isAuthenticated'](),controller[_0x9e0c('0xd')]);router[_0x9e0c('0xe')]('/:id',auth[_0x9e0c('0x6')](),controller[_0x9e0c('0xf')]);router['delete']('/:id',auth[_0x9e0c('0x6')](),controller['destroy']);module[_0x9e0c('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 67b6cc5..dda26e4 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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x33dd39,_0x1bc30b){_0x33dd39=_0x33dd39-0x0;var _0x27ae31=_0x7a54[_0x33dd39];return _0x27ae31;};'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(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7a54,0x106));var _0x47a5=function(_0x1c8eb5,_0x33ae58){_0x1c8eb5=_0x1c8eb5-0x0;var _0x24e2bf=_0x7a54[_0x1c8eb5];return _0x24e2bf;};'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 1802746..5033d06 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 _0xa861=['options','includeAll','include','findAll','rows','catch','show','intersection','length','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa861,0xab));var _0x1a86=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xa861[_0x243217];return _0x478029;};'use strict';var emlformat=require(_0x1a86('0x0'));var rimraf=require(_0x1a86('0x1'));var zipdir=require(_0x1a86('0x2'));var jsonpatch=require(_0x1a86('0x3'));var rp=require(_0x1a86('0x4'));var moment=require('moment');var BPromise=require(_0x1a86('0x5'));var Mustache=require(_0x1a86('0x6'));var util=require(_0x1a86('0x7'));var path=require(_0x1a86('0x8'));var sox=require(_0x1a86('0x9'));var csv=require('to-csv');var ejs=require(_0x1a86('0xa'));var fs=require('fs');var fs_extra=require(_0x1a86('0xb'));var _=require(_0x1a86('0xc'));var squel=require(_0x1a86('0xd'));var crypto=require(_0x1a86('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1a86('0xf'));var toCsv=require(_0x1a86('0x10'));var querystring=require(_0x1a86('0x11'));var Papa=require(_0x1a86('0x12'));var Redis=require(_0x1a86('0x13'));var authService=require(_0x1a86('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1a86('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a86('0x16'))(_0x1a86('0x17'));var utils=require(_0x1a86('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1a86('0x19'));var db=require(_0x1a86('0x1a'))['db'];function respondWithStatusCode(_0x3623f1,_0x470b91){_0x470b91=_0x470b91||0xcc;return function(_0x406202){if(_0x406202){return _0x3623f1[_0x1a86('0x1b')](_0x470b91);}return _0x3623f1[_0x1a86('0x1c')](_0x470b91)['end']();};}function respondWithResult(_0x3e0a61,_0x358e42){_0x358e42=_0x358e42||0xc8;return function(_0x5caa60){if(_0x5caa60){return _0x3e0a61[_0x1a86('0x1c')](_0x358e42)[_0x1a86('0x1d')](_0x5caa60);}};}function respondWithFilteredResult(_0x25cdba,_0x54c054){return function(_0x35a2c0){if(_0x35a2c0){var _0x3e34ca=typeof _0x54c054[_0x1a86('0x1e')]==='undefined'&&typeof _0x54c054[_0x1a86('0x1f')]===_0x1a86('0x20');var _0x3789d6=_0x35a2c0[_0x1a86('0x21')];var _0x2b701f=_0x3e34ca?0x0:_0x54c054[_0x1a86('0x1e')];var _0x18d891=_0x3e34ca?_0x35a2c0[_0x1a86('0x21')]:_0x54c054[_0x1a86('0x1e')]+_0x54c054[_0x1a86('0x1f')];var _0x6687a1;if(_0x18d891>=_0x3789d6){_0x18d891=_0x3789d6;_0x6687a1=0xc8;}else{_0x6687a1=0xce;}_0x25cdba[_0x1a86('0x1c')](_0x6687a1);return _0x25cdba['set'](_0x1a86('0x22'),_0x2b701f+'-'+_0x18d891+'/'+_0x3789d6)[_0x1a86('0x1d')](_0x35a2c0);}return null;};}function patchUpdates(_0x513d55){return function(_0x1db80f){try{jsonpatch[_0x1a86('0x23')](_0x1db80f,_0x513d55,!![]);}catch(_0x44a5ad){return BPromise['reject'](_0x44a5ad);}return _0x1db80f[_0x1a86('0x24')]();};}function saveUpdates(_0x3c9d9c,_0x56790c){return function(_0x1c770a){if(_0x1c770a){return _0x1c770a[_0x1a86('0x25')](_0x3c9d9c)[_0x1a86('0x26')](function(_0x51a0e4){return _0x51a0e4;});}return null;};}function removeEntity(_0x1d76d1,_0x3541df){return function(_0x14b9ef){if(_0x14b9ef){return _0x14b9ef['destroy']()[_0x1a86('0x26')](function(){_0x1d76d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ecd05,_0x54164c){return function(_0x1924d6){if(!_0x1924d6){_0x1ecd05[_0x1a86('0x1b')](0x194);}return _0x1924d6;};}function handleError(_0x1d33d9,_0x33a616){_0x33a616=_0x33a616||0x1f4;return function(_0x3ec859){logger[_0x1a86('0x27')](_0x3ec859[_0x1a86('0x28')]);if(_0x3ec859['name']){delete _0x3ec859[_0x1a86('0x29')];}_0x1d33d9['status'](_0x33a616)[_0x1a86('0x2a')](_0x3ec859);};}exports[_0x1a86('0x2b')]=function(_0x8570b,_0x5d77d6){var _0x4d8ebb={},_0x5dea19={},_0xaa2572={'count':0x0,'rows':[]};var _0x12a315=_[_0x1a86('0x2c')](db[_0x1a86('0x2d')][_0x1a86('0x2e')],function(_0x506f93){return{'name':_0x506f93['fieldName'],'type':_0x506f93[_0x1a86('0x2f')][_0x1a86('0x30')]};});_0x5dea19[_0x1a86('0x31')]=_[_0x1a86('0x2c')](_0x12a315,_0x1a86('0x29'));_0x5dea19[_0x1a86('0x32')]=_[_0x1a86('0x33')](_0x8570b['query']);_0x5dea19[_0x1a86('0x34')]=_['intersection'](_0x5dea19[_0x1a86('0x31')],_0x5dea19['query']);_0x4d8ebb[_0x1a86('0x35')]=_['intersection'](_0x5dea19['model'],qs[_0x1a86('0x36')](_0x8570b[_0x1a86('0x32')][_0x1a86('0x36')]));_0x4d8ebb[_0x1a86('0x35')]=_0x4d8ebb[_0x1a86('0x35')]['length']?_0x4d8ebb[_0x1a86('0x35')]:_0x5dea19[_0x1a86('0x31')];if(!_0x8570b[_0x1a86('0x32')]['hasOwnProperty'](_0x1a86('0x37'))){_0x4d8ebb[_0x1a86('0x1f')]=qs['limit'](_0x8570b[_0x1a86('0x32')]['limit']);_0x4d8ebb[_0x1a86('0x1e')]=qs['offset'](_0x8570b['query'][_0x1a86('0x1e')]);}_0x4d8ebb[_0x1a86('0x38')]=qs[_0x1a86('0x39')](_0x8570b['query'][_0x1a86('0x39')]);_0x4d8ebb[_0x1a86('0x3a')]=qs[_0x1a86('0x34')](_[_0x1a86('0x3b')](_0x8570b[_0x1a86('0x32')],_0x5dea19[_0x1a86('0x34')]),_0x12a315);if(_0x8570b[_0x1a86('0x32')][_0x1a86('0x3c')]){_0x4d8ebb[_0x1a86('0x3a')]=_[_0x1a86('0x3d')](_0x4d8ebb[_0x1a86('0x3a')],{'$or':_[_0x1a86('0x2c')](_0x12a315,function(_0x17c036){if(_0x17c036[_0x1a86('0x2f')]!==_0x1a86('0x3e')){var _0x2ec402={};_0x2ec402[_0x17c036[_0x1a86('0x29')]]={'$like':'%'+_0x8570b[_0x1a86('0x32')]['filter']+'%'};return _0x2ec402;}})});}_0x4d8ebb=_[_0x1a86('0x3d')]({},_0x4d8ebb,_0x8570b[_0x1a86('0x3f')]);var _0x17cedf={'where':_0x4d8ebb['where']};return db[_0x1a86('0x2d')][_0x1a86('0x21')](_0x17cedf)['then'](function(_0x3d08f4){_0xaa2572[_0x1a86('0x21')]=_0x3d08f4;if(_0x8570b[_0x1a86('0x32')][_0x1a86('0x40')]){_0x4d8ebb[_0x1a86('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x1a86('0x42')](_0x4d8ebb);})['then'](function(_0x2dfd57){_0xaa2572[_0x1a86('0x43')]=_0x2dfd57;return _0xaa2572;})[_0x1a86('0x26')](respondWithFilteredResult(_0x5d77d6,_0x4d8ebb))[_0x1a86('0x44')](handleError(_0x5d77d6,null));};exports[_0x1a86('0x45')]=function(_0x38bc30,_0x32dd74){var _0x319b28={'raw':!![],'where':{'id':_0x38bc30['params']['id']}},_0x49378f={};_0x49378f[_0x1a86('0x31')]=_[_0x1a86('0x33')](db[_0x1a86('0x2d')]['rawAttributes']);_0x49378f[_0x1a86('0x32')]=_[_0x1a86('0x33')](_0x38bc30[_0x1a86('0x32')]);_0x49378f[_0x1a86('0x34')]=_['intersection'](_0x49378f[_0x1a86('0x31')],_0x49378f[_0x1a86('0x32')]);_0x319b28['attributes']=_[_0x1a86('0x46')](_0x49378f[_0x1a86('0x31')],qs['fields'](_0x38bc30[_0x1a86('0x32')][_0x1a86('0x36')]));_0x319b28[_0x1a86('0x35')]=_0x319b28[_0x1a86('0x35')][_0x1a86('0x47')]?_0x319b28['attributes']:_0x49378f[_0x1a86('0x31')];if(_0x38bc30[_0x1a86('0x32')]['includeAll']){_0x319b28[_0x1a86('0x41')]=[{'all':!![]}];}_0x319b28=_['merge']({},_0x319b28,_0x38bc30[_0x1a86('0x3f')]);return db[_0x1a86('0x2d')]['find'](_0x319b28)[_0x1a86('0x26')](handleEntityNotFound(_0x32dd74,null))[_0x1a86('0x26')](respondWithResult(_0x32dd74,null))[_0x1a86('0x44')](handleError(_0x32dd74,null));};exports[_0x1a86('0x48')]=function(_0x168d05,_0x5d4b0e){return db[_0x1a86('0x2d')][_0x1a86('0x48')](_0x168d05['body'],{})[_0x1a86('0x26')](respondWithResult(_0x5d4b0e,0xc9))['catch'](handleError(_0x5d4b0e,null));};exports[_0x1a86('0x25')]=function(_0x37936a,_0x3e7c36){if(_0x37936a[_0x1a86('0x49')]['id']){delete _0x37936a[_0x1a86('0x49')]['id'];}return db[_0x1a86('0x2d')]['find']({'where':{'id':_0x37936a[_0x1a86('0x4a')]['id']}})[_0x1a86('0x26')](handleEntityNotFound(_0x3e7c36,null))['then'](saveUpdates(_0x37936a['body'],null))[_0x1a86('0x26')](respondWithResult(_0x3e7c36,null))[_0x1a86('0x44')](handleError(_0x3e7c36,null));};exports[_0x1a86('0x4b')]=function(_0x598290,_0x22efd9){return db[_0x1a86('0x2d')][_0x1a86('0x4c')]({'where':{'id':_0x598290['params']['id']}})[_0x1a86('0x26')](handleEntityNotFound(_0x22efd9,null))[_0x1a86('0x26')](removeEntity(_0x22efd9,null))[_0x1a86('0x44')](handleError(_0x22efd9,null));};exports[_0x1a86('0x4d')]=function(_0x280792,_0x3cec50){return db[_0x1a86('0x2d')][_0x1a86('0x4d')]()[_0x1a86('0x26')](respondWithResult(_0x3cec50,null))['catch'](handleError(_0x3cec50,null));}; \ No newline at end of file +var _0x7741=['options','includeAll','include','findAll','rows','catch','create','body','params','describe','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x240362,_0x156794){var _0x26de18=function(_0x4a4431){while(--_0x4a4431){_0x240362['push'](_0x240362['shift']());}};_0x26de18(++_0x156794);}(_0x7741,0xdf));var _0x1774=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x7741[_0x5037ab];return _0x512adb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1774('0x0'));var moment=require(_0x1774('0x1'));var BPromise=require(_0x1774('0x2'));var Mustache=require(_0x1774('0x3'));var util=require(_0x1774('0x4'));var path=require(_0x1774('0x5'));var sox=require(_0x1774('0x6'));var csv=require(_0x1774('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1774('0x8'));var _=require(_0x1774('0x9'));var squel=require(_0x1774('0xa'));var crypto=require(_0x1774('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1774('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1774('0xd'));var Papa=require(_0x1774('0xe'));var Redis=require(_0x1774('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1774('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1774('0x11'))(_0x1774('0x12'));var utils=require(_0x1774('0x13'));var config=require(_0x1774('0x14'));var licenseUtil=require(_0x1774('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ac6de,_0xc227d3){_0xc227d3=_0xc227d3||0xcc;return function(_0x1cd14e){if(_0x1cd14e){return _0x4ac6de[_0x1774('0x16')](_0xc227d3);}return _0x4ac6de['status'](_0xc227d3)[_0x1774('0x17')]();};}function respondWithResult(_0x14b575,_0x5cb563){_0x5cb563=_0x5cb563||0xc8;return function(_0x100639){if(_0x100639){return _0x14b575[_0x1774('0x18')](_0x5cb563)[_0x1774('0x19')](_0x100639);}};}function respondWithFilteredResult(_0x18d68d,_0xda8e42){return function(_0x2b1127){if(_0x2b1127){var _0x4cb39c=typeof _0xda8e42[_0x1774('0x1a')]===_0x1774('0x1b')&&typeof _0xda8e42[_0x1774('0x1c')]==='undefined';var _0x815007=_0x2b1127[_0x1774('0x1d')];var _0x15cfa2=_0x4cb39c?0x0:_0xda8e42[_0x1774('0x1a')];var _0x3c6241=_0x4cb39c?_0x2b1127[_0x1774('0x1d')]:_0xda8e42['offset']+_0xda8e42['limit'];var _0x35d1f9;if(_0x3c6241>=_0x815007){_0x3c6241=_0x815007;_0x35d1f9=0xc8;}else{_0x35d1f9=0xce;}_0x18d68d[_0x1774('0x18')](_0x35d1f9);return _0x18d68d[_0x1774('0x1e')]('Content-Range',_0x15cfa2+'-'+_0x3c6241+'/'+_0x815007)[_0x1774('0x19')](_0x2b1127);}return null;};}function patchUpdates(_0x5dc605){return function(_0xae04f9){try{jsonpatch[_0x1774('0x1f')](_0xae04f9,_0x5dc605,!![]);}catch(_0x50c17b){return BPromise['reject'](_0x50c17b);}return _0xae04f9['save']();};}function saveUpdates(_0x3ffe60,_0x521d65){return function(_0xec1598){if(_0xec1598){return _0xec1598[_0x1774('0x20')](_0x3ffe60)[_0x1774('0x21')](function(_0x1ab08d){return _0x1ab08d;});}return null;};}function removeEntity(_0x2e0b3c,_0x410356){return function(_0x726e10){if(_0x726e10){return _0x726e10[_0x1774('0x22')]()[_0x1774('0x21')](function(){_0x2e0b3c['status'](0xcc)[_0x1774('0x17')]();});}};}function handleEntityNotFound(_0x22f9a9,_0x306b96){return function(_0xa7c23){if(!_0xa7c23){_0x22f9a9[_0x1774('0x16')](0x194);}return _0xa7c23;};}function handleError(_0x350614,_0x3cf3fe){_0x3cf3fe=_0x3cf3fe||0x1f4;return function(_0x2fd39d){logger[_0x1774('0x23')](_0x2fd39d[_0x1774('0x24')]);if(_0x2fd39d['name']){delete _0x2fd39d[_0x1774('0x25')];}_0x350614[_0x1774('0x18')](_0x3cf3fe)['send'](_0x2fd39d);};}exports[_0x1774('0x26')]=function(_0x2ecc7c,_0x533604){var _0x1177c5={},_0x5a5959={},_0x49a218={'count':0x0,'rows':[]};var _0x553a81=_[_0x1774('0x27')](db[_0x1774('0x28')][_0x1774('0x29')],function(_0x2b9012){return{'name':_0x2b9012[_0x1774('0x2a')],'type':_0x2b9012[_0x1774('0x2b')][_0x1774('0x2c')]};});_0x5a5959['model']=_[_0x1774('0x27')](_0x553a81,_0x1774('0x25'));_0x5a5959[_0x1774('0x2d')]=_[_0x1774('0x2e')](_0x2ecc7c[_0x1774('0x2d')]);_0x5a5959[_0x1774('0x2f')]=_[_0x1774('0x30')](_0x5a5959[_0x1774('0x31')],_0x5a5959[_0x1774('0x2d')]);_0x1177c5[_0x1774('0x32')]=_[_0x1774('0x30')](_0x5a5959[_0x1774('0x31')],qs[_0x1774('0x33')](_0x2ecc7c[_0x1774('0x2d')][_0x1774('0x33')]));_0x1177c5[_0x1774('0x32')]=_0x1177c5[_0x1774('0x32')][_0x1774('0x34')]?_0x1177c5[_0x1774('0x32')]:_0x5a5959[_0x1774('0x31')];if(!_0x2ecc7c[_0x1774('0x2d')][_0x1774('0x35')](_0x1774('0x36'))){_0x1177c5[_0x1774('0x1c')]=qs[_0x1774('0x1c')](_0x2ecc7c[_0x1774('0x2d')][_0x1774('0x1c')]);_0x1177c5['offset']=qs[_0x1774('0x1a')](_0x2ecc7c[_0x1774('0x2d')][_0x1774('0x1a')]);}_0x1177c5[_0x1774('0x37')]=qs[_0x1774('0x38')](_0x2ecc7c[_0x1774('0x2d')]['sort']);_0x1177c5[_0x1774('0x39')]=qs[_0x1774('0x2f')](_[_0x1774('0x3a')](_0x2ecc7c[_0x1774('0x2d')],_0x5a5959[_0x1774('0x2f')]),_0x553a81);if(_0x2ecc7c[_0x1774('0x2d')][_0x1774('0x3b')]){_0x1177c5[_0x1774('0x39')]=_[_0x1774('0x3c')](_0x1177c5[_0x1774('0x39')],{'$or':_['map'](_0x553a81,function(_0xfc65a6){if(_0xfc65a6[_0x1774('0x2b')]!=='VIRTUAL'){var _0x60e227={};_0x60e227[_0xfc65a6[_0x1774('0x25')]]={'$like':'%'+_0x2ecc7c[_0x1774('0x2d')][_0x1774('0x3b')]+'%'};return _0x60e227;}})});}_0x1177c5=_[_0x1774('0x3c')]({},_0x1177c5,_0x2ecc7c[_0x1774('0x3d')]);var _0x3a0850={'where':_0x1177c5[_0x1774('0x39')]};return db['JscriptyQuestionReport'][_0x1774('0x1d')](_0x3a0850)['then'](function(_0x3ce3c8){_0x49a218[_0x1774('0x1d')]=_0x3ce3c8;if(_0x2ecc7c[_0x1774('0x2d')][_0x1774('0x3e')]){_0x1177c5[_0x1774('0x3f')]=[{'all':!![]}];}return db[_0x1774('0x28')][_0x1774('0x40')](_0x1177c5);})[_0x1774('0x21')](function(_0x2eaa77){_0x49a218[_0x1774('0x41')]=_0x2eaa77;return _0x49a218;})[_0x1774('0x21')](respondWithFilteredResult(_0x533604,_0x1177c5))[_0x1774('0x42')](handleError(_0x533604,null));};exports['show']=function(_0x39429c,_0x3eebca){var _0x2562dd={'raw':!![],'where':{'id':_0x39429c['params']['id']}},_0x4ac60f={};_0x4ac60f['model']=_['keys'](db[_0x1774('0x28')][_0x1774('0x29')]);_0x4ac60f[_0x1774('0x2d')]=_[_0x1774('0x2e')](_0x39429c[_0x1774('0x2d')]);_0x4ac60f[_0x1774('0x2f')]=_['intersection'](_0x4ac60f['model'],_0x4ac60f['query']);_0x2562dd[_0x1774('0x32')]=_[_0x1774('0x30')](_0x4ac60f[_0x1774('0x31')],qs['fields'](_0x39429c[_0x1774('0x2d')][_0x1774('0x33')]));_0x2562dd['attributes']=_0x2562dd['attributes'][_0x1774('0x34')]?_0x2562dd[_0x1774('0x32')]:_0x4ac60f[_0x1774('0x31')];if(_0x39429c[_0x1774('0x2d')][_0x1774('0x3e')]){_0x2562dd['include']=[{'all':!![]}];}_0x2562dd=_[_0x1774('0x3c')]({},_0x2562dd,_0x39429c[_0x1774('0x3d')]);return db['JscriptyQuestionReport']['find'](_0x2562dd)[_0x1774('0x21')](handleEntityNotFound(_0x3eebca,null))[_0x1774('0x21')](respondWithResult(_0x3eebca,null))[_0x1774('0x42')](handleError(_0x3eebca,null));};exports[_0x1774('0x43')]=function(_0x3ec11c,_0x844e33){return db['JscriptyQuestionReport'][_0x1774('0x43')](_0x3ec11c[_0x1774('0x44')],{})[_0x1774('0x21')](respondWithResult(_0x844e33,0xc9))[_0x1774('0x42')](handleError(_0x844e33,null));};exports['update']=function(_0x8f257,_0x335041){if(_0x8f257[_0x1774('0x44')]['id']){delete _0x8f257[_0x1774('0x44')]['id'];}return db[_0x1774('0x28')]['find']({'where':{'id':_0x8f257[_0x1774('0x45')]['id']}})['then'](handleEntityNotFound(_0x335041,null))[_0x1774('0x21')](saveUpdates(_0x8f257[_0x1774('0x44')],null))['then'](respondWithResult(_0x335041,null))['catch'](handleError(_0x335041,null));};exports[_0x1774('0x22')]=function(_0x467936,_0x16dce6){return db[_0x1774('0x28')]['find']({'where':{'id':_0x467936['params']['id']}})[_0x1774('0x21')](handleEntityNotFound(_0x16dce6,null))[_0x1774('0x21')](removeEntity(_0x16dce6,null))[_0x1774('0x42')](handleError(_0x16dce6,null));};exports[_0x1774('0x46')]=function(_0x5bdc52,_0x5174f0){return db[_0x1774('0x28')][_0x1774('0x46')]()['then'](respondWithResult(_0x5174f0,null))['catch'](handleError(_0x5174f0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 8c90bd1..75ba84a 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 _0x3c90=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x6fd56a,_0x21de39){var _0x1c960b=function(_0x4b1c7f){while(--_0x4b1c7f){_0x6fd56a['push'](_0x6fd56a['shift']());}};_0x1c960b(++_0x21de39);}(_0x3c90,0x11d));var _0x03c9=function(_0x2742e3,_0x1879fd){_0x2742e3=_0x2742e3-0x0;var _0x129e77=_0x3c90[_0x2742e3];return _0x129e77;};'use strict';var _=require(_0x03c9('0x0'));var util=require(_0x03c9('0x1'));var logger=require(_0x03c9('0x2'))(_0x03c9('0x3'));var moment=require(_0x03c9('0x4'));var BPromise=require(_0x03c9('0x5'));var rp=require(_0x03c9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03c9('0x7'));var config=require(_0x03c9('0x8'));var attributes=require(_0x03c9('0x9'));module[_0x03c9('0xa')]=function(_0x4e4658,_0x1035eb){return _0x4e4658[_0x03c9('0xb')](_0x03c9('0xc'),attributes,{'tableName':_0x03c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0932=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1846e2,_0xe66a3a){var _0x626282=function(_0x3c3e01){while(--_0x3c3e01){_0x1846e2['push'](_0x1846e2['shift']());}};_0x626282(++_0xe66a3a);}(_0x0932,0x1c7));var _0x2093=function(_0x22a558,_0x311a26){_0x22a558=_0x22a558-0x0;var _0x2c4d30=_0x0932[_0x22a558];return _0x2c4d30;};'use strict';var _=require(_0x2093('0x0'));var util=require(_0x2093('0x1'));var logger=require(_0x2093('0x2'))(_0x2093('0x3'));var moment=require(_0x2093('0x4'));var BPromise=require(_0x2093('0x5'));var rp=require(_0x2093('0x6'));var fs=require('fs');var path=require(_0x2093('0x7'));var rimraf=require(_0x2093('0x8'));var config=require(_0x2093('0x9'));var attributes=require(_0x2093('0xa'));module[_0x2093('0xb')]=function(_0x328a6a,_0x5dbdbe){return _0x328a6a[_0x2093('0xc')](_0x2093('0xd'),attributes,{'tableName':_0x2093('0xe'),'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 4b65c5e..7f136d2 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 _0x2be1=['request\x20sent','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug'];(function(_0x156bcc,_0x1d24dd){var _0x20b6fd=function(_0x53a373){while(--_0x53a373){_0x156bcc['push'](_0x156bcc['shift']());}};_0x20b6fd(++_0x1d24dd);}(_0x2be1,0xee));var _0x12be=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x2be1[_0x119b3e];return _0x1169ae;};'use strict';var _=require(_0x12be('0x0'));var util=require('util');var moment=require(_0x12be('0x1'));var BPromise=require(_0x12be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12be('0x3'));var db=require(_0x12be('0x4'))['db'];var utils=require(_0x12be('0x5'));var logger=require(_0x12be('0x6'))('rpc');var config=require(_0x12be('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x12be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdbde09,_0x1e02a8,_0x35cae6){return new BPromise(function(_0x560f21,_0x1735e4){return client[_0x12be('0x9')](_0xdbde09,_0x35cae6)[_0x12be('0xa')](function(_0x1c7106){logger[_0x12be('0xb')](_0x12be('0xc'),_0x1e02a8,'request\x20sent');logger[_0x12be('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1e02a8,_0x12be('0xe'),JSON['stringify'](_0x1c7106));if(_0x1c7106[_0x12be('0xf')]){if(_0x1c7106[_0x12be('0xf')][_0x12be('0x10')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e02a8,_0x1c7106[_0x12be('0xf')][_0x12be('0x11')]);return _0x1735e4(_0x1c7106['error'][_0x12be('0x11')]);}logger[_0x12be('0xf')](_0x12be('0xc'),_0x1e02a8,_0x1c7106[_0x12be('0xf')][_0x12be('0x11')]);return _0x560f21(_0x1c7106[_0x12be('0xf')]['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e02a8,'request\x20sent');_0x560f21(_0x1c7106['result'][_0x12be('0x11')]);}})['catch'](function(_0x186e18){logger[_0x12be('0xf')](_0x12be('0xc'),_0x1e02a8,_0x186e18);_0x1735e4(_0x186e18);});});} \ No newline at end of file +var _0x857e=['../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0x857e,0x8d));var _0xe857=function(_0x1820f1,_0x1403e7){_0x1820f1=_0x1820f1-0x0;var _0x167aed=_0x857e[_0x1820f1];return _0x167aed;};'use strict';var _=require(_0xe857('0x0'));var util=require(_0xe857('0x1'));var moment=require(_0xe857('0x2'));var BPromise=require(_0xe857('0x3'));var rs=require(_0xe857('0x4'));var fs=require('fs');var Redis=require(_0xe857('0x5'));var db=require(_0xe857('0x6'))['db'];var utils=require(_0xe857('0x7'));var logger=require(_0xe857('0x8'))('rpc');var config=require(_0xe857('0x9'));var jayson=require(_0xe857('0xa'));var client=jayson[_0xe857('0xb')][_0xe857('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe85532,_0x4dc4f3,_0x58622b){return new BPromise(function(_0x1f66e6,_0x1fe21a){return client[_0xe857('0xd')](_0xe85532,_0x58622b)[_0xe857('0xe')](function(_0x4970bc){logger['info'](_0xe857('0xf'),_0x4dc4f3,_0xe857('0x10'));logger[_0xe857('0x11')](_0xe857('0x12'),_0x4dc4f3,'request\x20sent',JSON[_0xe857('0x13')](_0x4970bc));if(_0x4970bc['error']){if(_0x4970bc[_0xe857('0x14')][_0xe857('0x15')]===0x1f4){logger[_0xe857('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4dc4f3,_0x4970bc[_0xe857('0x14')][_0xe857('0x16')]);return _0x1fe21a(_0x4970bc['error'][_0xe857('0x16')]);}logger[_0xe857('0x14')](_0xe857('0xf'),_0x4dc4f3,_0x4970bc['error'][_0xe857('0x16')]);return _0x1f66e6(_0x4970bc[_0xe857('0x14')][_0xe857('0x16')]);}else{logger['info'](_0xe857('0xf'),_0x4dc4f3,_0xe857('0x10'));_0x1f66e6(_0x4970bc[_0xe857('0x17')][_0xe857('0x16')]);}})[_0xe857('0x18')](function(_0x154261){logger[_0xe857('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4dc4f3,_0x154261);_0x1fe21a(_0x154261);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 5e0919f..290b2a6 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 _0x0d7b=['/:id','show','/:id/questions','getQuestions','post','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','isAuthenticated'];(function(_0x4f2ff7,_0x3ec3a1){var _0x3f9bd0=function(_0x2a9baa){while(--_0x2a9baa){_0x4f2ff7['push'](_0x4f2ff7['shift']());}};_0x3f9bd0(++_0x3ec3a1);}(_0x0d7b,0xdb));var _0xb0d7=function(_0x2d5b17,_0x5b99e7){_0x2d5b17=_0x2d5b17-0x0;var _0xd65fbc=_0x0d7b[_0x2d5b17];return _0xd65fbc;};'use strict';var multer=require('multer');var util=require(_0xb0d7('0x0'));var path=require(_0xb0d7('0x1'));var timeout=require('connect-timeout');var express=require(_0xb0d7('0x2'));var router=express[_0xb0d7('0x3')]();var fs_extra=require(_0xb0d7('0x4'));var auth=require(_0xb0d7('0x5'));var interaction=require(_0xb0d7('0x6'));var config=require(_0xb0d7('0x7'));var controller=require(_0xb0d7('0x8'));router[_0xb0d7('0x9')]('/',auth['isAuthenticated'](),controller[_0xb0d7('0xa')]);router[_0xb0d7('0x9')]('/describe',auth[_0xb0d7('0xb')](),controller['describe']);router[_0xb0d7('0x9')](_0xb0d7('0xc'),auth[_0xb0d7('0xb')](),controller[_0xb0d7('0xd')]);router['get'](_0xb0d7('0xe'),auth[_0xb0d7('0xb')](),controller[_0xb0d7('0xf')]);router[_0xb0d7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb0d7('0x11')](_0xb0d7('0xc'),auth[_0xb0d7('0xb')](),controller[_0xb0d7('0x12')]);router['delete'](_0xb0d7('0xc'),auth[_0xb0d7('0xb')](),controller[_0xb0d7('0x13')]);module[_0xb0d7('0x14')]=router; \ No newline at end of file +var _0x7481=['/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index'];(function(_0x4606f4,_0x8782d8){var _0x22f86e=function(_0x226b72){while(--_0x226b72){_0x4606f4['push'](_0x4606f4['shift']());}};_0x22f86e(++_0x8782d8);}(_0x7481,0x113));var _0x1748=function(_0x373817,_0x4a9f5d){_0x373817=_0x373817-0x0;var _0x49a5a3=_0x7481[_0x373817];return _0x49a5a3;};'use strict';var multer=require(_0x1748('0x0'));var util=require(_0x1748('0x1'));var path=require(_0x1748('0x2'));var timeout=require(_0x1748('0x3'));var express=require(_0x1748('0x4'));var router=express[_0x1748('0x5')]();var fs_extra=require(_0x1748('0x6'));var auth=require(_0x1748('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1748('0x8'));var controller=require(_0x1748('0x9'));router[_0x1748('0xa')]('/',auth[_0x1748('0xb')](),controller[_0x1748('0xc')]);router['get'](_0x1748('0xd'),auth[_0x1748('0xb')](),controller[_0x1748('0xe')]);router[_0x1748('0xa')](_0x1748('0xf'),auth[_0x1748('0xb')](),controller[_0x1748('0x10')]);router['get'](_0x1748('0x11'),auth['isAuthenticated'](),controller[_0x1748('0x12')]);router[_0x1748('0x13')]('/',auth[_0x1748('0xb')](),controller[_0x1748('0x14')]);router['put'](_0x1748('0xf'),auth[_0x1748('0xb')](),controller[_0x1748('0x15')]);router[_0x1748('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1748('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 2574112..3e4e382 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 _0x8b29=['DATE','setDataValue','endtime','format','STRING','BOOLEAN','moment'];(function(_0x1b2667,_0x279eb1){var _0x179ae8=function(_0x119262){while(--_0x119262){_0x1b2667['push'](_0x1b2667['shift']());}};_0x179ae8(++_0x279eb1);}(_0x8b29,0x14f));var _0x98b2=function(_0x36a6c9,_0x368075){_0x36a6c9=_0x36a6c9-0x0;var _0x27d4ad=_0x8b29[_0x36a6c9];return _0x27d4ad;};'use strict';var moment=require(_0x98b2('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x98b2('0x1')],'set':function(_0x285bb3){this[_0x98b2('0x2')]('starttime',_0x285bb3);this[_0x98b2('0x2')](_0x98b2('0x3'),moment()[_0x98b2('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x98b2('0x1')]},'membername':{'type':Sequelize[_0x98b2('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x98b2('0x5')]},'uniqueid':{'type':Sequelize[_0x98b2('0x5')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x98b2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x4442=['sequelize','exports','DATE','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x5a099f,_0x45c8c2){var _0x467756=function(_0x37ce82){while(--_0x37ce82){_0x5a099f['push'](_0x5a099f['shift']());}};_0x467756(++_0x45c8c2);}(_0x4442,0xce));var _0x2444=function(_0x53eacf,_0x2b893e){_0x53eacf=_0x53eacf-0x0;var _0x177673=_0x4442[_0x53eacf];return _0x177673;};'use strict';var moment=require(_0x2444('0x0'));var Sequelize=require(_0x2444('0x1'));module[_0x2444('0x2')]={'starttime':{'type':Sequelize[_0x2444('0x3')],'set':function(_0x261f66){this['setDataValue']('starttime',_0x261f66);this['setDataValue'](_0x2444('0x4'),moment()[_0x2444('0x5')](_0x2444('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2444('0x7')]},'projectname':{'type':Sequelize[_0x2444('0x7')]},'queue':{'type':Sequelize[_0x2444('0x7')]},'uniqueid':{'type':Sequelize[_0x2444('0x7')]},'calleridname':{'type':Sequelize[_0x2444('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x2444('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index d8718bc..3cebf27 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 _0xd912=['SessionId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','JscriptySessionReport','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','keys','rawAttributes','length','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick'];(function(_0x1de507,_0x1a87bd){var _0xfea7b0=function(_0x1997a9){while(--_0x1997a9){_0x1de507['push'](_0x1de507['shift']());}};_0xfea7b0(++_0x1a87bd);}(_0xd912,0xf8));var _0x2d91=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd912[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x2d91('0x0'));var rimraf=require(_0x2d91('0x1'));var zipdir=require(_0x2d91('0x2'));var jsonpatch=require(_0x2d91('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2d91('0x4'));var Mustache=require(_0x2d91('0x5'));var util=require(_0x2d91('0x6'));var path=require(_0x2d91('0x7'));var sox=require(_0x2d91('0x8'));var csv=require(_0x2d91('0x9'));var ejs=require(_0x2d91('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d91('0xb'));var squel=require('squel');var crypto=require(_0x2d91('0xc'));var jsforce=require(_0x2d91('0xd'));var deskjs=require(_0x2d91('0xe'));var toCsv=require(_0x2d91('0x9'));var querystring=require(_0x2d91('0xf'));var Papa=require(_0x2d91('0x10'));var Redis=require(_0x2d91('0x11'));var authService=require(_0x2d91('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d91('0x13'));var logger=require('../../config/logger')(_0x2d91('0x14'));var utils=require(_0x2d91('0x15'));var config=require(_0x2d91('0x16'));var licenseUtil=require(_0x2d91('0x17'));var db=require(_0x2d91('0x18'))['db'];function respondWithStatusCode(_0x405ef4,_0x52b9c7){_0x52b9c7=_0x52b9c7||0xcc;return function(_0x585553){if(_0x585553){return _0x405ef4[_0x2d91('0x19')](_0x52b9c7);}return _0x405ef4[_0x2d91('0x1a')](_0x52b9c7)['end']();};}function respondWithResult(_0x27cea3,_0x1d35cc){_0x1d35cc=_0x1d35cc||0xc8;return function(_0x1bd785){if(_0x1bd785){return _0x27cea3['status'](_0x1d35cc)[_0x2d91('0x1b')](_0x1bd785);}};}function respondWithFilteredResult(_0x4d3d4f,_0x504ae5){return function(_0x49248d){if(_0x49248d){var _0x30410d=typeof _0x504ae5['offset']===_0x2d91('0x1c')&&typeof _0x504ae5[_0x2d91('0x1d')]===_0x2d91('0x1c');var _0x5eabef=_0x49248d['count'];var _0x52a704=_0x30410d?0x0:_0x504ae5[_0x2d91('0x1e')];var _0x248b28=_0x30410d?_0x49248d['count']:_0x504ae5[_0x2d91('0x1e')]+_0x504ae5[_0x2d91('0x1d')];var _0x3ed60f;if(_0x248b28>=_0x5eabef){_0x248b28=_0x5eabef;_0x3ed60f=0xc8;}else{_0x3ed60f=0xce;}_0x4d3d4f[_0x2d91('0x1a')](_0x3ed60f);return _0x4d3d4f[_0x2d91('0x1f')](_0x2d91('0x20'),_0x52a704+'-'+_0x248b28+'/'+_0x5eabef)[_0x2d91('0x1b')](_0x49248d);}return null;};}function patchUpdates(_0x5c34fd){return function(_0x5b5341){try{jsonpatch[_0x2d91('0x21')](_0x5b5341,_0x5c34fd,!![]);}catch(_0x4a2bd1){return BPromise[_0x2d91('0x22')](_0x4a2bd1);}return _0x5b5341[_0x2d91('0x23')]();};}function saveUpdates(_0x5c0108,_0x3a8252){return function(_0x4cc0c7){if(_0x4cc0c7){return _0x4cc0c7[_0x2d91('0x24')](_0x5c0108)['then'](function(_0x1ce59f){return _0x1ce59f;});}return null;};}function removeEntity(_0x462156,_0x5015e6){return function(_0x35e10a){if(_0x35e10a){return _0x35e10a[_0x2d91('0x25')]()[_0x2d91('0x26')](function(){_0x462156[_0x2d91('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5832dd,_0x39276c){return function(_0x350e0f){if(!_0x350e0f){_0x5832dd[_0x2d91('0x19')](0x194);}return _0x350e0f;};}function handleError(_0x33f317,_0x1a1e5d){_0x1a1e5d=_0x1a1e5d||0x1f4;return function(_0x377cf2){logger[_0x2d91('0x27')](_0x377cf2[_0x2d91('0x28')]);if(_0x377cf2[_0x2d91('0x29')]){delete _0x377cf2['name'];}_0x33f317['status'](_0x1a1e5d)[_0x2d91('0x2a')](_0x377cf2);};}exports['index']=function(_0xf045a4,_0x49ed1d){var _0x3dc016={},_0x4408fb={},_0x311e1c={'count':0x0,'rows':[]};var _0x3d5754=_['map'](db[_0x2d91('0x2b')]['rawAttributes'],function(_0x44ac3b){return{'name':_0x44ac3b['fieldName'],'type':_0x44ac3b[_0x2d91('0x2c')][_0x2d91('0x2d')]};});_0x4408fb[_0x2d91('0x2e')]=_[_0x2d91('0x2f')](_0x3d5754,_0x2d91('0x29'));_0x4408fb[_0x2d91('0x30')]=_['keys'](_0xf045a4['query']);_0x4408fb[_0x2d91('0x31')]=_['intersection'](_0x4408fb[_0x2d91('0x2e')],_0x4408fb[_0x2d91('0x30')]);_0x3dc016['attributes']=_[_0x2d91('0x32')](_0x4408fb[_0x2d91('0x2e')],qs[_0x2d91('0x33')](_0xf045a4[_0x2d91('0x30')][_0x2d91('0x33')]));_0x3dc016[_0x2d91('0x34')]=_0x3dc016[_0x2d91('0x34')]['length']?_0x3dc016[_0x2d91('0x34')]:_0x4408fb['model'];if(!_0xf045a4[_0x2d91('0x30')][_0x2d91('0x35')]('nolimit')){_0x3dc016[_0x2d91('0x1d')]=qs[_0x2d91('0x1d')](_0xf045a4[_0x2d91('0x30')][_0x2d91('0x1d')]);_0x3dc016[_0x2d91('0x1e')]=qs['offset'](_0xf045a4['query'][_0x2d91('0x1e')]);}_0x3dc016[_0x2d91('0x36')]=qs[_0x2d91('0x37')](_0xf045a4[_0x2d91('0x30')][_0x2d91('0x37')]);_0x3dc016[_0x2d91('0x38')]=qs['filters'](_['pick'](_0xf045a4['query'],_0x4408fb[_0x2d91('0x31')]),_0x3d5754);if(_0xf045a4[_0x2d91('0x30')][_0x2d91('0x39')]){_0x3dc016[_0x2d91('0x38')]=_[_0x2d91('0x3a')](_0x3dc016[_0x2d91('0x38')],{'$or':_[_0x2d91('0x2f')](_0x3d5754,function(_0x59c114){if(_0x59c114['type']!==_0x2d91('0x3b')){var _0x11a189={};_0x11a189[_0x59c114['name']]={'$like':'%'+_0xf045a4[_0x2d91('0x30')][_0x2d91('0x39')]+'%'};return _0x11a189;}})});}_0x3dc016=_[_0x2d91('0x3a')]({},_0x3dc016,_0xf045a4[_0x2d91('0x3c')]);var _0x38cb84={'where':_0x3dc016[_0x2d91('0x38')]};return db[_0x2d91('0x2b')]['count'](_0x38cb84)[_0x2d91('0x26')](function(_0x365a5c){_0x311e1c[_0x2d91('0x3d')]=_0x365a5c;if(_0xf045a4[_0x2d91('0x30')][_0x2d91('0x3e')]){_0x3dc016[_0x2d91('0x3f')]=[{'all':!![]}];}return db[_0x2d91('0x2b')]['findAll'](_0x3dc016);})[_0x2d91('0x26')](function(_0xdd825e){_0x311e1c[_0x2d91('0x40')]=_0xdd825e;return _0x311e1c;})[_0x2d91('0x26')](respondWithFilteredResult(_0x49ed1d,_0x3dc016))[_0x2d91('0x41')](handleError(_0x49ed1d,null));};exports[_0x2d91('0x42')]=function(_0xb385c6,_0x1b70dc){var _0x112d6d={'raw':!![],'where':{'id':_0xb385c6['params']['id']}},_0x4b9a6f={};_0x4b9a6f[_0x2d91('0x2e')]=_[_0x2d91('0x43')](db['JscriptySessionReport'][_0x2d91('0x44')]);_0x4b9a6f[_0x2d91('0x30')]=_['keys'](_0xb385c6[_0x2d91('0x30')]);_0x4b9a6f[_0x2d91('0x31')]=_[_0x2d91('0x32')](_0x4b9a6f[_0x2d91('0x2e')],_0x4b9a6f['query']);_0x112d6d[_0x2d91('0x34')]=_[_0x2d91('0x32')](_0x4b9a6f[_0x2d91('0x2e')],qs[_0x2d91('0x33')](_0xb385c6[_0x2d91('0x30')][_0x2d91('0x33')]));_0x112d6d[_0x2d91('0x34')]=_0x112d6d[_0x2d91('0x34')][_0x2d91('0x45')]?_0x112d6d[_0x2d91('0x34')]:_0x4b9a6f['model'];if(_0xb385c6[_0x2d91('0x30')][_0x2d91('0x3e')]){_0x112d6d[_0x2d91('0x3f')]=[{'all':!![]}];}_0x112d6d=_['merge']({},_0x112d6d,_0xb385c6[_0x2d91('0x3c')]);return db[_0x2d91('0x2b')][_0x2d91('0x46')](_0x112d6d)[_0x2d91('0x26')](handleEntityNotFound(_0x1b70dc,null))[_0x2d91('0x26')](respondWithResult(_0x1b70dc,null))[_0x2d91('0x41')](handleError(_0x1b70dc,null));};exports[_0x2d91('0x47')]=function(_0x24fc15,_0x2a6c6b){return db[_0x2d91('0x2b')][_0x2d91('0x47')](_0x24fc15[_0x2d91('0x48')],{})['then'](respondWithResult(_0x2a6c6b,0xc9))['catch'](handleError(_0x2a6c6b,null));};exports[_0x2d91('0x24')]=function(_0x1b5bf5,_0x37bec2){if(_0x1b5bf5['body']['id']){delete _0x1b5bf5[_0x2d91('0x48')]['id'];}return db[_0x2d91('0x2b')][_0x2d91('0x46')]({'where':{'id':_0x1b5bf5[_0x2d91('0x49')]['id']}})['then'](handleEntityNotFound(_0x37bec2,null))[_0x2d91('0x26')](saveUpdates(_0x1b5bf5[_0x2d91('0x48')],null))[_0x2d91('0x26')](respondWithResult(_0x37bec2,null))['catch'](handleError(_0x37bec2,null));};exports[_0x2d91('0x25')]=function(_0x590655,_0x26cc14){return db[_0x2d91('0x2b')][_0x2d91('0x46')]({'where':{'id':_0x590655[_0x2d91('0x49')]['id']}})[_0x2d91('0x26')](handleEntityNotFound(_0x26cc14,null))['then'](removeEntity(_0x26cc14,null))[_0x2d91('0x41')](handleError(_0x26cc14,null));};exports[_0x2d91('0x4a')]=function(_0x222777,_0x35b8e4){return db[_0x2d91('0x2b')][_0x2d91('0x4a')]()[_0x2d91('0x26')](respondWithResult(_0x35b8e4,null))['catch'](handleError(_0x35b8e4,null));};exports[_0x2d91('0x4b')]=function(_0x4ffe43,_0x24cd84,_0x4c631a){var _0x5cc17c={'raw':!![],'where':{}};var _0x5c1894={};var _0x19cf88={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x2d91('0x4c')]({'where':{'id':_0x4ffe43['params']['id']}})[_0x2d91('0x26')](handleEntityNotFound(_0x24cd84,null))['then'](function(_0x32018f){if(_0x32018f){_0x5c1894['model']=_[_0x2d91('0x43')](db[_0x2d91('0x4d')]['rawAttributes']);_0x5c1894['query']=_[_0x2d91('0x43')](_0x4ffe43['query']);_0x5c1894['filters']=_[_0x2d91('0x32')](_0x5c1894[_0x2d91('0x2e')],_0x5c1894['query']);_0x5cc17c[_0x2d91('0x34')]=_[_0x2d91('0x32')](_0x5c1894['model'],qs['fields'](_0x4ffe43[_0x2d91('0x30')][_0x2d91('0x33')]));_0x5cc17c[_0x2d91('0x34')]=_0x5cc17c['attributes']['length']?_0x5cc17c[_0x2d91('0x34')]:_0x5c1894[_0x2d91('0x2e')];if(!_0x4ffe43[_0x2d91('0x30')][_0x2d91('0x35')](_0x2d91('0x4e'))){_0x5cc17c['limit']=qs[_0x2d91('0x1d')](_0x4ffe43[_0x2d91('0x30')][_0x2d91('0x1d')]);_0x5cc17c['offset']=qs[_0x2d91('0x1e')](_0x4ffe43['query'][_0x2d91('0x1e')]);}_0x5cc17c[_0x2d91('0x36')]=qs[_0x2d91('0x37')](_0x4ffe43[_0x2d91('0x30')][_0x2d91('0x37')]);_0x5cc17c[_0x2d91('0x38')]=qs[_0x2d91('0x31')](_[_0x2d91('0x4f')](_0x4ffe43['query'],_0x5c1894[_0x2d91('0x31')]));_0x5cc17c['where'][_0x2d91('0x50')]=_0x32018f['id'];if(_0x4ffe43[_0x2d91('0x30')][_0x2d91('0x39')]){_0x5cc17c[_0x2d91('0x38')]=_[_0x2d91('0x3a')](_0x5cc17c['where'],{'$or':_[_0x2d91('0x2f')](_0x5cc17c['attributes'],function(_0x2dcca7){var _0x241283={};_0x241283[_0x2dcca7]={'$like':'%'+_0x4ffe43['query']['filter']+'%'};return _0x241283;})});}_0x5cc17c=_[_0x2d91('0x3a')]({},_0x5cc17c,_0x4ffe43[_0x2d91('0x3c')]);return db['JscriptyQuestionReport'][_0x2d91('0x3d')]({'where':_0x5cc17c[_0x2d91('0x38')]})[_0x2d91('0x26')](function(_0xe662cc){_0x19cf88[_0x2d91('0x3d')]=_0xe662cc;if(_0x4ffe43[_0x2d91('0x30')]['includeAll']){_0x5cc17c['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x2d91('0x51')](_0x5cc17c);})['then'](function(_0x159577){_0x19cf88[_0x2d91('0x40')]=_0x159577;return _0x19cf88;});}})[_0x2d91('0x26')](respondWithFilteredResult(_0x24cd84,_0x5cc17c))[_0x2d91('0x41')](handleError(_0x24cd84,null));}; \ No newline at end of file +var _0x06d2=['merge','VIRTUAL','options','include','findAll','catch','show','params','keys','length','includeAll','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','SessionId','rows','eml-format','rimraf','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','stack','name','send','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','order','sort','where','pick','filter'];(function(_0xd6c010,_0x5355e6){var _0x15893b=function(_0x1b0a5a){while(--_0x1b0a5a){_0xd6c010['push'](_0xd6c010['shift']());}};_0x15893b(++_0x5355e6);}(_0x06d2,0x109));var _0x206d=function(_0x26dd68,_0x460586){_0x26dd68=_0x26dd68-0x0;var _0x487f3b=_0x06d2[_0x26dd68];return _0x487f3b;};'use strict';var emlformat=require(_0x206d('0x0'));var rimraf=require(_0x206d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x206d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x206d('0x3'));var util=require(_0x206d('0x4'));var path=require(_0x206d('0x5'));var sox=require('sox');var csv=require(_0x206d('0x6'));var ejs=require(_0x206d('0x7'));var fs=require('fs');var fs_extra=require(_0x206d('0x8'));var _=require(_0x206d('0x9'));var squel=require(_0x206d('0xa'));var crypto=require(_0x206d('0xb'));var jsforce=require(_0x206d('0xc'));var deskjs=require(_0x206d('0xd'));var toCsv=require(_0x206d('0x6'));var querystring=require(_0x206d('0xe'));var Papa=require(_0x206d('0xf'));var Redis=require(_0x206d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x206d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x206d('0x12'));var logger=require(_0x206d('0x13'))(_0x206d('0x14'));var utils=require(_0x206d('0x15'));var config=require(_0x206d('0x16'));var licenseUtil=require(_0x206d('0x17'));var db=require(_0x206d('0x18'))['db'];function respondWithStatusCode(_0x13ee83,_0xd6c396){_0xd6c396=_0xd6c396||0xcc;return function(_0x5eec56){if(_0x5eec56){return _0x13ee83[_0x206d('0x19')](_0xd6c396);}return _0x13ee83[_0x206d('0x1a')](_0xd6c396)[_0x206d('0x1b')]();};}function respondWithResult(_0x491f20,_0x1af006){_0x1af006=_0x1af006||0xc8;return function(_0x369f71){if(_0x369f71){return _0x491f20[_0x206d('0x1a')](_0x1af006)[_0x206d('0x1c')](_0x369f71);}};}function respondWithFilteredResult(_0x5e9389,_0x835e71){return function(_0xbc799f){if(_0xbc799f){var _0x20c190=typeof _0x835e71['offset']===_0x206d('0x1d')&&typeof _0x835e71[_0x206d('0x1e')]===_0x206d('0x1d');var _0x2072d4=_0xbc799f[_0x206d('0x1f')];var _0x2a5861=_0x20c190?0x0:_0x835e71[_0x206d('0x20')];var _0x3df3cb=_0x20c190?_0xbc799f[_0x206d('0x1f')]:_0x835e71[_0x206d('0x20')]+_0x835e71[_0x206d('0x1e')];var _0x1eac1b;if(_0x3df3cb>=_0x2072d4){_0x3df3cb=_0x2072d4;_0x1eac1b=0xc8;}else{_0x1eac1b=0xce;}_0x5e9389['status'](_0x1eac1b);return _0x5e9389['set'](_0x206d('0x21'),_0x2a5861+'-'+_0x3df3cb+'/'+_0x2072d4)['json'](_0xbc799f);}return null;};}function patchUpdates(_0x338342){return function(_0x593480){try{jsonpatch[_0x206d('0x22')](_0x593480,_0x338342,!![]);}catch(_0x204452){return BPromise[_0x206d('0x23')](_0x204452);}return _0x593480['save']();};}function saveUpdates(_0x31a19b,_0x54b0a0){return function(_0x47d876){if(_0x47d876){return _0x47d876[_0x206d('0x24')](_0x31a19b)[_0x206d('0x25')](function(_0x218c82){return _0x218c82;});}return null;};}function removeEntity(_0x3d264a,_0x4ea392){return function(_0xf1fbf7){if(_0xf1fbf7){return _0xf1fbf7[_0x206d('0x26')]()['then'](function(){_0x3d264a[_0x206d('0x1a')](0xcc)[_0x206d('0x1b')]();});}};}function handleEntityNotFound(_0x2d3875,_0x5bdfe7){return function(_0x211c59){if(!_0x211c59){_0x2d3875[_0x206d('0x19')](0x194);}return _0x211c59;};}function handleError(_0x511733,_0x4325d5){_0x4325d5=_0x4325d5||0x1f4;return function(_0xb55657){logger['error'](_0xb55657[_0x206d('0x27')]);if(_0xb55657[_0x206d('0x28')]){delete _0xb55657['name'];}_0x511733[_0x206d('0x1a')](_0x4325d5)[_0x206d('0x29')](_0xb55657);};}exports['index']=function(_0x1fe7c1,_0x12baff){var _0x3a7ad5={},_0xa1c50c={},_0xdb461c={'count':0x0,'rows':[]};var _0x1ae14a=_['map'](db[_0x206d('0x2a')][_0x206d('0x2b')],function(_0x3b5669){return{'name':_0x3b5669[_0x206d('0x2c')],'type':_0x3b5669[_0x206d('0x2d')][_0x206d('0x2e')]};});_0xa1c50c[_0x206d('0x2f')]=_[_0x206d('0x30')](_0x1ae14a,_0x206d('0x28'));_0xa1c50c[_0x206d('0x31')]=_['keys'](_0x1fe7c1[_0x206d('0x31')]);_0xa1c50c[_0x206d('0x32')]=_[_0x206d('0x33')](_0xa1c50c['model'],_0xa1c50c[_0x206d('0x31')]);_0x3a7ad5['attributes']=_[_0x206d('0x33')](_0xa1c50c[_0x206d('0x2f')],qs[_0x206d('0x34')](_0x1fe7c1[_0x206d('0x31')][_0x206d('0x34')]));_0x3a7ad5['attributes']=_0x3a7ad5[_0x206d('0x35')]['length']?_0x3a7ad5[_0x206d('0x35')]:_0xa1c50c[_0x206d('0x2f')];if(!_0x1fe7c1[_0x206d('0x31')]['hasOwnProperty']('nolimit')){_0x3a7ad5[_0x206d('0x1e')]=qs[_0x206d('0x1e')](_0x1fe7c1[_0x206d('0x31')][_0x206d('0x1e')]);_0x3a7ad5['offset']=qs[_0x206d('0x20')](_0x1fe7c1['query']['offset']);}_0x3a7ad5[_0x206d('0x36')]=qs[_0x206d('0x37')](_0x1fe7c1[_0x206d('0x31')][_0x206d('0x37')]);_0x3a7ad5[_0x206d('0x38')]=qs[_0x206d('0x32')](_[_0x206d('0x39')](_0x1fe7c1['query'],_0xa1c50c[_0x206d('0x32')]),_0x1ae14a);if(_0x1fe7c1[_0x206d('0x31')][_0x206d('0x3a')]){_0x3a7ad5[_0x206d('0x38')]=_[_0x206d('0x3b')](_0x3a7ad5[_0x206d('0x38')],{'$or':_[_0x206d('0x30')](_0x1ae14a,function(_0x10bf01){if(_0x10bf01['type']!==_0x206d('0x3c')){var _0x4acaf2={};_0x4acaf2[_0x10bf01[_0x206d('0x28')]]={'$like':'%'+_0x1fe7c1[_0x206d('0x31')][_0x206d('0x3a')]+'%'};return _0x4acaf2;}})});}_0x3a7ad5=_[_0x206d('0x3b')]({},_0x3a7ad5,_0x1fe7c1[_0x206d('0x3d')]);var _0x5eb077={'where':_0x3a7ad5[_0x206d('0x38')]};return db[_0x206d('0x2a')][_0x206d('0x1f')](_0x5eb077)[_0x206d('0x25')](function(_0x3fd820){_0xdb461c['count']=_0x3fd820;if(_0x1fe7c1[_0x206d('0x31')]['includeAll']){_0x3a7ad5[_0x206d('0x3e')]=[{'all':!![]}];}return db[_0x206d('0x2a')][_0x206d('0x3f')](_0x3a7ad5);})['then'](function(_0xb07157){_0xdb461c['rows']=_0xb07157;return _0xdb461c;})[_0x206d('0x25')](respondWithFilteredResult(_0x12baff,_0x3a7ad5))[_0x206d('0x40')](handleError(_0x12baff,null));};exports[_0x206d('0x41')]=function(_0x4bec33,_0x5c545a){var _0xe0c7d2={'raw':!![],'where':{'id':_0x4bec33[_0x206d('0x42')]['id']}},_0x225150={};_0x225150[_0x206d('0x2f')]=_[_0x206d('0x43')](db[_0x206d('0x2a')][_0x206d('0x2b')]);_0x225150[_0x206d('0x31')]=_['keys'](_0x4bec33['query']);_0x225150[_0x206d('0x32')]=_[_0x206d('0x33')](_0x225150[_0x206d('0x2f')],_0x225150[_0x206d('0x31')]);_0xe0c7d2[_0x206d('0x35')]=_[_0x206d('0x33')](_0x225150[_0x206d('0x2f')],qs[_0x206d('0x34')](_0x4bec33[_0x206d('0x31')][_0x206d('0x34')]));_0xe0c7d2['attributes']=_0xe0c7d2[_0x206d('0x35')][_0x206d('0x44')]?_0xe0c7d2['attributes']:_0x225150['model'];if(_0x4bec33[_0x206d('0x31')][_0x206d('0x45')]){_0xe0c7d2[_0x206d('0x3e')]=[{'all':!![]}];}_0xe0c7d2=_['merge']({},_0xe0c7d2,_0x4bec33[_0x206d('0x3d')]);return db[_0x206d('0x2a')][_0x206d('0x46')](_0xe0c7d2)[_0x206d('0x25')](handleEntityNotFound(_0x5c545a,null))[_0x206d('0x25')](respondWithResult(_0x5c545a,null))[_0x206d('0x40')](handleError(_0x5c545a,null));};exports[_0x206d('0x47')]=function(_0x158dec,_0x2ef5ed){return db[_0x206d('0x2a')]['create'](_0x158dec[_0x206d('0x48')],{})[_0x206d('0x25')](respondWithResult(_0x2ef5ed,0xc9))['catch'](handleError(_0x2ef5ed,null));};exports[_0x206d('0x24')]=function(_0x2d7541,_0x1fae40){if(_0x2d7541[_0x206d('0x48')]['id']){delete _0x2d7541[_0x206d('0x48')]['id'];}return db[_0x206d('0x2a')]['find']({'where':{'id':_0x2d7541[_0x206d('0x42')]['id']}})[_0x206d('0x25')](handleEntityNotFound(_0x1fae40,null))['then'](saveUpdates(_0x2d7541[_0x206d('0x48')],null))[_0x206d('0x25')](respondWithResult(_0x1fae40,null))['catch'](handleError(_0x1fae40,null));};exports[_0x206d('0x26')]=function(_0x128ab2,_0x584783){return db[_0x206d('0x2a')][_0x206d('0x46')]({'where':{'id':_0x128ab2[_0x206d('0x42')]['id']}})[_0x206d('0x25')](handleEntityNotFound(_0x584783,null))[_0x206d('0x25')](removeEntity(_0x584783,null))['catch'](handleError(_0x584783,null));};exports[_0x206d('0x49')]=function(_0x2f4199,_0x39fd42){return db[_0x206d('0x2a')][_0x206d('0x49')]()['then'](respondWithResult(_0x39fd42,null))['catch'](handleError(_0x39fd42,null));};exports[_0x206d('0x4a')]=function(_0x31bc82,_0x2e4f58,_0x19effc){var _0x211869={'raw':!![],'where':{}};var _0x26d996={};var _0x3ebd51={'count':0x0,'rows':[]};return db[_0x206d('0x2a')][_0x206d('0x4b')]({'where':{'id':_0x31bc82['params']['id']}})[_0x206d('0x25')](handleEntityNotFound(_0x2e4f58,null))[_0x206d('0x25')](function(_0x30c31a){if(_0x30c31a){_0x26d996[_0x206d('0x2f')]=_['keys'](db[_0x206d('0x4c')][_0x206d('0x2b')]);_0x26d996[_0x206d('0x31')]=_[_0x206d('0x43')](_0x31bc82[_0x206d('0x31')]);_0x26d996[_0x206d('0x32')]=_[_0x206d('0x33')](_0x26d996['model'],_0x26d996[_0x206d('0x31')]);_0x211869[_0x206d('0x35')]=_[_0x206d('0x33')](_0x26d996['model'],qs[_0x206d('0x34')](_0x31bc82['query']['fields']));_0x211869[_0x206d('0x35')]=_0x211869[_0x206d('0x35')][_0x206d('0x44')]?_0x211869[_0x206d('0x35')]:_0x26d996['model'];if(!_0x31bc82[_0x206d('0x31')][_0x206d('0x4d')](_0x206d('0x4e'))){_0x211869['limit']=qs[_0x206d('0x1e')](_0x31bc82[_0x206d('0x31')][_0x206d('0x1e')]);_0x211869[_0x206d('0x20')]=qs[_0x206d('0x20')](_0x31bc82[_0x206d('0x31')]['offset']);}_0x211869[_0x206d('0x36')]=qs[_0x206d('0x37')](_0x31bc82[_0x206d('0x31')][_0x206d('0x37')]);_0x211869[_0x206d('0x38')]=qs[_0x206d('0x32')](_[_0x206d('0x39')](_0x31bc82['query'],_0x26d996[_0x206d('0x32')]));_0x211869['where'][_0x206d('0x4f')]=_0x30c31a['id'];if(_0x31bc82[_0x206d('0x31')]['filter']){_0x211869[_0x206d('0x38')]=_[_0x206d('0x3b')](_0x211869[_0x206d('0x38')],{'$or':_['map'](_0x211869[_0x206d('0x35')],function(_0x4f54c9){var _0xf7b667={};_0xf7b667[_0x4f54c9]={'$like':'%'+_0x31bc82['query'][_0x206d('0x3a')]+'%'};return _0xf7b667;})});}_0x211869=_[_0x206d('0x3b')]({},_0x211869,_0x31bc82[_0x206d('0x3d')]);return db['JscriptyQuestionReport'][_0x206d('0x1f')]({'where':_0x211869['where']})[_0x206d('0x25')](function(_0x4d9790){_0x3ebd51[_0x206d('0x1f')]=_0x4d9790;if(_0x31bc82['query']['includeAll']){_0x211869[_0x206d('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x211869);})[_0x206d('0x25')](function(_0x4b6ad2){_0x3ebd51[_0x206d('0x50')]=_0x4b6ad2;return _0x3ebd51;});}})[_0x206d('0x25')](respondWithFilteredResult(_0x2e4f58,_0x211869))[_0x206d('0x40')](handleError(_0x2e4f58,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 48c5659..7712fe5 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 _0x1b20=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x4b7dd4,_0x294a14){var _0x2bf36f=function(_0x1b6ad7){while(--_0x1b6ad7){_0x4b7dd4['push'](_0x4b7dd4['shift']());}};_0x2bf36f(++_0x294a14);}(_0x1b20,0x66));var _0x01b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1b20[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var logger=require(_0x01b2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x01b2('0x2'));var rp=require(_0x01b2('0x3'));var fs=require('fs');var path=require(_0x01b2('0x4'));var rimraf=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var attributes=require(_0x01b2('0x7'));module[_0x01b2('0x8')]=function(_0x28de4a,_0x46e745){return _0x28de4a[_0x01b2('0x9')](_0x01b2('0xa'),attributes,{'tableName':_0x01b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0xf1e10f,_0x6ccfa8){var _0x277d74=function(_0x4fafad){while(--_0x4fafad){_0xf1e10f['push'](_0xf1e10f['shift']());}};_0x277d74(++_0x6ccfa8);}(_0x687b,0x14a));var _0xb687=function(_0x173eff,_0x55a7d0){_0x173eff=_0x173eff-0x0;var _0x119fbd=_0x687b[_0x173eff];return _0x119fbd;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('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 9b7299f..beb9ee8 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 _0x2da6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x2da6,0x1dd));var _0x62da=function(_0x4b3f66,_0x3c8361){_0x4b3f66=_0x4b3f66-0x0;var _0x321072=_0x2da6[_0x4b3f66];return _0x321072;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4777ae,_0x557fd2){var _0x2f12b9=function(_0x4b9a26){while(--_0x4b9a26){_0x4777ae['push'](_0x4777ae['shift']());}};_0x2f12b9(++_0x557fd2);}(_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 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')]('JscriptySessionReport,\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 diff --git a/server/api/license/index.js b/server/api/license/index.js index 5e023d8..a3e0e7b 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 _0x56da=['./license.controller','get','index','put','/:id','isAuthenticated','/download_log_file','downloadLogFile','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a537b,_0x55957b){var _0xfd244d=function(_0x435b68){while(--_0x435b68){_0x4a537b['push'](_0x4a537b['shift']());}};_0xfd244d(++_0x55957b);}(_0x56da,0x119));var _0xa56d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x56da[_0xac151d];return _0x111dba;};'use strict';var multer=require(_0xa56d('0x0'));var util=require('util');var path=require(_0xa56d('0x1'));var timeout=require(_0xa56d('0x2'));var express=require('express');var router=express[_0xa56d('0x3')]();var fs_extra=require(_0xa56d('0x4'));var auth=require(_0xa56d('0x5'));var interaction=require(_0xa56d('0x6'));var config=require(_0xa56d('0x7'));var controller=require(_0xa56d('0x8'));router[_0xa56d('0x9')]('/',controller[_0xa56d('0xa')]);router[_0xa56d('0xb')](_0xa56d('0xc'),auth[_0xa56d('0xd')](),controller['update']);router['get'](_0xa56d('0xe'),auth[_0xa56d('0xd')](),controller[_0xa56d('0xf')]);module[_0xa56d('0x10')]=router; \ No newline at end of file +var _0x6741=['put','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6741,0x136));var _0x1674=function(_0x176261,_0x3a9a67){_0x176261=_0x176261-0x0;var _0x263143=_0x6741[_0x176261];return _0x263143;};'use strict';var multer=require('multer');var util=require(_0x1674('0x0'));var path=require(_0x1674('0x1'));var timeout=require(_0x1674('0x2'));var express=require(_0x1674('0x3'));var router=express[_0x1674('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1674('0x5'));var interaction=require(_0x1674('0x6'));var config=require(_0x1674('0x7'));var controller=require(_0x1674('0x8'));router[_0x1674('0x9')]('/',controller['index']);router[_0x1674('0xa')]('/:id',auth[_0x1674('0xb')](),controller[_0x1674('0xc')]);router[_0x1674('0x9')](_0x1674('0xd'),auth[_0x1674('0xb')](),controller[_0x1674('0xe')]);module[_0x1674('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 940e9b2..e6e722f 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 _0xd9f2=['STRING','INTEGER','sequelize','exports'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0xd9f2,0x13e));var _0x2d9f=function(_0x29bc5e,_0x5868f2){_0x29bc5e=_0x29bc5e-0x0;var _0x33930c=_0xd9f2[_0x29bc5e];return _0x33930c;};'use strict';var Sequelize=require(_0x2d9f('0x0'));module[_0x2d9f('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x2d9f('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x2d9f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e4b=['exports','STRING','INTEGER','sequelize'];(function(_0x8573a9,_0x156ab0){var _0x22c371=function(_0xe3397a){while(--_0xe3397a){_0x8573a9['push'](_0x8573a9['shift']());}};_0x22c371(++_0x156ab0);}(_0x8e4b,0xa7));var _0xb8e4=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0x8e4b[_0x561771];return _0x54d16e;};'use strict';var Sequelize=require(_0xb8e4('0x0'));module[_0xb8e4('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xb8e4('0x2')]},'data2':{'type':Sequelize[_0xb8e4('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb8e4('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 cda3626..257ab9d 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 _0x792a=['sendStatus','error','name','send','index','model','keys','License','rawAttributes','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','key','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','destroy','then'];(function(_0x2110fe,_0x4bd0b3){var _0x5a97bf=function(_0x3a661a){while(--_0x3a661a){_0x2110fe['push'](_0x2110fe['shift']());}};_0x5a97bf(++_0x4bd0b3);}(_0x792a,0xea));var _0xa792=function(_0x367090,_0x43325e){_0x367090=_0x367090-0x0;var _0x27dd95=_0x792a[_0x367090];return _0x27dd95;};'use strict';var emlformat=require(_0xa792('0x0'));var rimraf=require(_0xa792('0x1'));var zipdir=require(_0xa792('0x2'));var jsonpatch=require(_0xa792('0x3'));var rp=require(_0xa792('0x4'));var moment=require(_0xa792('0x5'));var BPromise=require(_0xa792('0x6'));var Mustache=require(_0xa792('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa792('0x8'));var csv=require('to-csv');var ejs=require(_0xa792('0x9'));var fs=require('fs');var fs_extra=require(_0xa792('0xa'));var _=require('lodash');var squel=require(_0xa792('0xb'));var crypto=require(_0xa792('0xc'));var jsforce=require(_0xa792('0xd'));var deskjs=require(_0xa792('0xe'));var toCsv=require(_0xa792('0xf'));var querystring=require('querystring');var Papa=require(_0xa792('0x10'));var Redis=require(_0xa792('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa792('0x12'));var as=require(_0xa792('0x13'));var hardwareService=require(_0xa792('0x14'));var logger=require(_0xa792('0x15'))(_0xa792('0x16'));var utils=require(_0xa792('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa792('0x18'));var db=require(_0xa792('0x19'))['db'];function respondWithStatusCode(_0x32139d,_0x2a346c){_0x2a346c=_0x2a346c||0xcc;return function(_0x1e5df3){if(_0x1e5df3){return _0x32139d['sendStatus'](_0x2a346c);}return _0x32139d[_0xa792('0x1a')](_0x2a346c)[_0xa792('0x1b')]();};}function respondWithResult(_0x5ba50d,_0x4b4f6f){_0x4b4f6f=_0x4b4f6f||0xc8;return function(_0x229e3e){if(_0x229e3e){return _0x5ba50d[_0xa792('0x1a')](_0x4b4f6f)['json'](_0x229e3e);}};}function respondWithFilteredResult(_0x20e808,_0x239fc){return function(_0x30b8c7){if(_0x30b8c7){var _0x5d0df1=typeof _0x239fc[_0xa792('0x1c')]==='undefined'&&typeof _0x239fc[_0xa792('0x1d')]===_0xa792('0x1e');var _0x5510e7=_0x30b8c7[_0xa792('0x1f')];var _0xb322d1=_0x5d0df1?0x0:_0x239fc[_0xa792('0x1c')];var _0x2c60c8=_0x5d0df1?_0x30b8c7[_0xa792('0x1f')]:_0x239fc[_0xa792('0x1c')]+_0x239fc['limit'];var _0x1ffdcb;if(_0x2c60c8>=_0x5510e7){_0x2c60c8=_0x5510e7;_0x1ffdcb=0xc8;}else{_0x1ffdcb=0xce;}_0x20e808[_0xa792('0x1a')](_0x1ffdcb);return _0x20e808['set'](_0xa792('0x20'),_0xb322d1+'-'+_0x2c60c8+'/'+_0x5510e7)[_0xa792('0x21')](_0x30b8c7);}return null;};}function patchUpdates(_0x19c25d){return function(_0x517751){try{jsonpatch[_0xa792('0x22')](_0x517751,_0x19c25d,!![]);}catch(_0x3a4e8c){return BPromise['reject'](_0x3a4e8c);}return _0x517751[_0xa792('0x23')]();};}function saveUpdates(_0xc8a8bc,_0x120292){return function(_0x22c5ab){if(_0x22c5ab){return _0x22c5ab['update'](_0xc8a8bc)['then'](function(_0x12121f){return _0x12121f;});}return null;};}function removeEntity(_0x556c03,_0x34607c){return function(_0x3e1283){if(_0x3e1283){return _0x3e1283[_0xa792('0x24')]()[_0xa792('0x25')](function(){_0x556c03[_0xa792('0x1a')](0xcc)[_0xa792('0x1b')]();});}};}function handleEntityNotFound(_0x484a6f,_0x1975b0){return function(_0x228377){if(!_0x228377){_0x484a6f[_0xa792('0x26')](0x194);}return _0x228377;};}function handleError(_0x4f7108,_0x5ec178){_0x5ec178=_0x5ec178||0x1f4;return function(_0x17cad7){logger[_0xa792('0x27')](_0x17cad7['stack']);if(_0x17cad7[_0xa792('0x28')]){delete _0x17cad7['name'];}_0x4f7108[_0xa792('0x1a')](_0x5ec178)[_0xa792('0x29')](_0x17cad7);};}var utilLicense=require('../../config/license/util');exports[_0xa792('0x2a')]=function(_0x422862,_0x420533){var _0x2884c7={'raw':!![],'where':{'id':0x1}},_0x482b54={};_0x482b54[_0xa792('0x2b')]=_[_0xa792('0x2c')](db[_0xa792('0x2d')][_0xa792('0x2e')]);_0x482b54['query']=_['keys'](_0x422862[_0xa792('0x2f')]);_0x482b54['filters']=_[_0xa792('0x30')](_0x482b54['model'],_0x482b54[_0xa792('0x2f')]);_0x2884c7['attributes']=_[_0xa792('0x30')](_0x482b54[_0xa792('0x2b')],qs[_0xa792('0x31')](_0x422862[_0xa792('0x2f')][_0xa792('0x31')]));_0x2884c7[_0xa792('0x32')]=_0x2884c7[_0xa792('0x32')]['length']?_0x2884c7[_0xa792('0x32')]:_0x482b54[_0xa792('0x2b')];_0x2884c7=_[_0xa792('0x33')]({},_0x2884c7,_0x422862[_0xa792('0x34')]);return utilLicense[_0xa792('0x35')](_0x2884c7)[_0xa792('0x25')](respondWithResult(_0x420533,null))[_0xa792('0x36')](handleError(_0x420533,null));};exports['update']=function(_0x555e06,_0x4e1efe){if(_0x555e06[_0xa792('0x37')]['id']){delete _0x555e06[_0xa792('0x37')]['id'];}return db[_0xa792('0x2d')][_0xa792('0x38')]({'where':{'id':_0x555e06['params']['id']}})[_0xa792('0x25')](handleEntityNotFound(_0x4e1efe,null))[_0xa792('0x25')](function(_0x1216d2){var _0x478686=_0x1216d2['get']({'plain':!![]});return utilLicense['checkLicense'](_0x478686,_0x555e06['body'][_0xa792('0x39')]);})[_0xa792('0x25')](function(_0x27ab08){if(!_0x27ab08['demo']){return saveUpdates(_0x555e06[_0xa792('0x37')],null);}return _0x27ab08;})[_0xa792('0x25')](respondWithResult(_0x4e1efe,null))[_0xa792('0x36')](handleError(_0x4e1efe,null));};exports['downloadLogFile']=function(_0x5e1beb,_0x2ce92f){var _0x108cf3=_0xa792('0x3a');var _0x146f9e=path[_0xa792('0x3b')](_0xa792('0x3c'),_0xa792('0x3d'),'xcally',_0x108cf3);_0x2ce92f[_0xa792('0x3e')](_0xa792('0x3f'),_0xa792('0x40')+_0x108cf3);_0x2ce92f[_0xa792('0x41')](_0xa792('0x42'),_0xa792('0x43'));_0x2ce92f['download'](_0x146f9e);}; \ No newline at end of file +var _0xffb9=['/var','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','merge','getLicense','body','params','get','checkLicense','key','demo','license-info.log','join'];(function(_0xf5bb94,_0x5ba03b){var _0x17281f=function(_0x4441e7){while(--_0x4441e7){_0xf5bb94['push'](_0xf5bb94['shift']());}};_0x17281f(++_0x5ba03b);}(_0xffb9,0x9a));var _0x9ffb=function(_0x25d4d3,_0x2ad24d){_0x25d4d3=_0x25d4d3-0x0;var _0x55e639=_0xffb9[_0x25d4d3];return _0x55e639;};'use strict';var emlformat=require(_0x9ffb('0x0'));var rimraf=require(_0x9ffb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ffb('0x2'));var rp=require(_0x9ffb('0x3'));var moment=require(_0x9ffb('0x4'));var BPromise=require(_0x9ffb('0x5'));var Mustache=require(_0x9ffb('0x6'));var util=require(_0x9ffb('0x7'));var path=require(_0x9ffb('0x8'));var sox=require(_0x9ffb('0x9'));var csv=require(_0x9ffb('0xa'));var ejs=require(_0x9ffb('0xb'));var fs=require('fs');var fs_extra=require(_0x9ffb('0xc'));var _=require(_0x9ffb('0xd'));var squel=require(_0x9ffb('0xe'));var crypto=require(_0x9ffb('0xf'));var jsforce=require(_0x9ffb('0x10'));var deskjs=require(_0x9ffb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x9ffb('0x12'));var Papa=require(_0x9ffb('0x13'));var Redis=require(_0x9ffb('0x14'));var authService=require(_0x9ffb('0x15'));var qs=require(_0x9ffb('0x16'));var as=require(_0x9ffb('0x17'));var hardwareService=require(_0x9ffb('0x18'));var logger=require('../../config/logger')(_0x9ffb('0x19'));var utils=require(_0x9ffb('0x1a'));var config=require(_0x9ffb('0x1b'));var licenseUtil=require(_0x9ffb('0x1c'));var db=require(_0x9ffb('0x1d'))['db'];function respondWithStatusCode(_0xdcdb8,_0x1c1d31){_0x1c1d31=_0x1c1d31||0xcc;return function(_0x33da7a){if(_0x33da7a){return _0xdcdb8[_0x9ffb('0x1e')](_0x1c1d31);}return _0xdcdb8[_0x9ffb('0x1f')](_0x1c1d31)['end']();};}function respondWithResult(_0x6162ce,_0x4ea7f3){_0x4ea7f3=_0x4ea7f3||0xc8;return function(_0x4beb46){if(_0x4beb46){return _0x6162ce[_0x9ffb('0x1f')](_0x4ea7f3)['json'](_0x4beb46);}};}function respondWithFilteredResult(_0x4d7c66,_0x22f3a9){return function(_0x378e97){if(_0x378e97){var _0x346080=typeof _0x22f3a9[_0x9ffb('0x20')]===_0x9ffb('0x21')&&typeof _0x22f3a9[_0x9ffb('0x22')]===_0x9ffb('0x21');var _0x5100ef=_0x378e97['count'];var _0x34354d=_0x346080?0x0:_0x22f3a9[_0x9ffb('0x20')];var _0x12d389=_0x346080?_0x378e97['count']:_0x22f3a9[_0x9ffb('0x20')]+_0x22f3a9['limit'];var _0x355a49;if(_0x12d389>=_0x5100ef){_0x12d389=_0x5100ef;_0x355a49=0xc8;}else{_0x355a49=0xce;}_0x4d7c66[_0x9ffb('0x1f')](_0x355a49);return _0x4d7c66[_0x9ffb('0x23')](_0x9ffb('0x24'),_0x34354d+'-'+_0x12d389+'/'+_0x5100ef)['json'](_0x378e97);}return null;};}function patchUpdates(_0x32c447){return function(_0x5749c8){try{jsonpatch[_0x9ffb('0x25')](_0x5749c8,_0x32c447,!![]);}catch(_0x57b4c0){return BPromise[_0x9ffb('0x26')](_0x57b4c0);}return _0x5749c8[_0x9ffb('0x27')]();};}function saveUpdates(_0x961273,_0x197dbf){return function(_0x50a0a3){if(_0x50a0a3){return _0x50a0a3[_0x9ffb('0x28')](_0x961273)[_0x9ffb('0x29')](function(_0x1acdf2){return _0x1acdf2;});}return null;};}function removeEntity(_0x3768b6,_0x3aac11){return function(_0x266d44){if(_0x266d44){return _0x266d44[_0x9ffb('0x2a')]()[_0x9ffb('0x29')](function(){_0x3768b6[_0x9ffb('0x1f')](0xcc)[_0x9ffb('0x2b')]();});}};}function handleEntityNotFound(_0x546a71,_0x25e041){return function(_0x532229){if(!_0x532229){_0x546a71[_0x9ffb('0x1e')](0x194);}return _0x532229;};}function handleError(_0x3e1611,_0x1bc7e3){_0x1bc7e3=_0x1bc7e3||0x1f4;return function(_0x5bffab){logger[_0x9ffb('0x2c')](_0x5bffab[_0x9ffb('0x2d')]);if(_0x5bffab[_0x9ffb('0x2e')]){delete _0x5bffab[_0x9ffb('0x2e')];}_0x3e1611[_0x9ffb('0x1f')](_0x1bc7e3)[_0x9ffb('0x2f')](_0x5bffab);};}var utilLicense=require(_0x9ffb('0x1c'));exports[_0x9ffb('0x30')]=function(_0x407fd7,_0x39e298){var _0x1d7c72={'raw':!![],'where':{'id':0x1}},_0x5039b3={};_0x5039b3[_0x9ffb('0x31')]=_[_0x9ffb('0x32')](db[_0x9ffb('0x33')][_0x9ffb('0x34')]);_0x5039b3[_0x9ffb('0x35')]=_[_0x9ffb('0x32')](_0x407fd7[_0x9ffb('0x35')]);_0x5039b3[_0x9ffb('0x36')]=_[_0x9ffb('0x37')](_0x5039b3[_0x9ffb('0x31')],_0x5039b3[_0x9ffb('0x35')]);_0x1d7c72[_0x9ffb('0x38')]=_[_0x9ffb('0x37')](_0x5039b3[_0x9ffb('0x31')],qs['fields'](_0x407fd7['query'][_0x9ffb('0x39')]));_0x1d7c72['attributes']=_0x1d7c72['attributes']['length']?_0x1d7c72['attributes']:_0x5039b3[_0x9ffb('0x31')];_0x1d7c72=_[_0x9ffb('0x3a')]({},_0x1d7c72,_0x407fd7['options']);return utilLicense[_0x9ffb('0x3b')](_0x1d7c72)[_0x9ffb('0x29')](respondWithResult(_0x39e298,null))['catch'](handleError(_0x39e298,null));};exports[_0x9ffb('0x28')]=function(_0x4c0b63,_0x1b6ca4){if(_0x4c0b63['body']['id']){delete _0x4c0b63[_0x9ffb('0x3c')]['id'];}return db['License']['find']({'where':{'id':_0x4c0b63[_0x9ffb('0x3d')]['id']}})[_0x9ffb('0x29')](handleEntityNotFound(_0x1b6ca4,null))['then'](function(_0x32b1c0){var _0xc7b4dd=_0x32b1c0[_0x9ffb('0x3e')]({'plain':!![]});return utilLicense[_0x9ffb('0x3f')](_0xc7b4dd,_0x4c0b63[_0x9ffb('0x3c')][_0x9ffb('0x40')]);})['then'](function(_0x52446b){if(!_0x52446b[_0x9ffb('0x41')]){return saveUpdates(_0x4c0b63[_0x9ffb('0x3c')],null);}return _0x52446b;})[_0x9ffb('0x29')](respondWithResult(_0x1b6ca4,null))['catch'](handleError(_0x1b6ca4,null));};exports['downloadLogFile']=function(_0x411d91,_0x5bca4e){var _0x2ceb1c=_0x9ffb('0x42');var _0x4285ab=path[_0x9ffb('0x43')](_0x9ffb('0x44'),'log','xcally',_0x2ceb1c);_0x5bca4e['setHeader'](_0x9ffb('0x45'),_0x9ffb('0x46')+_0x2ceb1c);_0x5bca4e[_0x9ffb('0x23')](_0x9ffb('0x47'),_0x9ffb('0x48'));_0x5bca4e[_0x9ffb('0x49')](_0x4285ab);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e8145af..7ae9142 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 _0x832b=['License','license','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x832b,0x1ee));var _0xb832=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x832b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb832('0x0'));var util=require('util');var logger=require(_0xb832('0x1'))(_0xb832('0x2'));var moment=require('moment');var BPromise=require(_0xb832('0x3'));var rp=require(_0xb832('0x4'));var fs=require('fs');var path=require(_0xb832('0x5'));var rimraf=require('rimraf');var config=require(_0xb832('0x6'));var attributes=require(_0xb832('0x7'));module[_0xb832('0x8')]=function(_0x490e1d,_0x5046f5){return _0x490e1d[_0xb832('0x9')](_0xb832('0xa'),attributes,{'tableName':_0xb832('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d28=['request-promise','../../config/environment','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ec4f7,_0x568762){var _0x15b411=function(_0x3e89f7){while(--_0x3e89f7){_0x5ec4f7['push'](_0x5ec4f7['shift']());}};_0x15b411(++_0x568762);}(_0x9d28,0x8a));var _0x89d2=function(_0x4af5d9,_0x1198c8){_0x4af5d9=_0x4af5d9-0x0;var _0xf6a1fd=_0x9d28[_0x4af5d9];return _0xf6a1fd;};'use strict';var _=require(_0x89d2('0x0'));var util=require(_0x89d2('0x1'));var logger=require(_0x89d2('0x2'))(_0x89d2('0x3'));var moment=require(_0x89d2('0x4'));var BPromise=require(_0x89d2('0x5'));var rp=require(_0x89d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x89d2('0x7'));var attributes=require('./license.attributes');module[_0x89d2('0x8')]=function(_0x230962,_0x110cfc){return _0x230962[_0x89d2('0x9')](_0x89d2('0xa'),attributes,{'tableName':_0x89d2('0xb'),'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 158174e..4183299 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 _0xa362=['stringify','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x141c07,_0x2016b4){var _0x44d37b=function(_0xdb159a){while(--_0xdb159a){_0x141c07['push'](_0x141c07['shift']());}};_0x44d37b(++_0x2016b4);}(_0xa362,0x193));var _0x2a36=function(_0x30d914,_0x3357bd){_0x30d914=_0x30d914-0x0;var _0xe90924=_0xa362[_0x30d914];return _0xe90924;};'use strict';var _=require('lodash');var util=require(_0x2a36('0x0'));var moment=require(_0x2a36('0x1'));var BPromise=require(_0x2a36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a36('0x3'));var db=require(_0x2a36('0x4'))['db'];var utils=require(_0x2a36('0x5'));var logger=require(_0x2a36('0x6'))('rpc');var config=require(_0x2a36('0x7'));var jayson=require(_0x2a36('0x8'));var client=jayson[_0x2a36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b5159,_0x15f2f6,_0x2c0283){return new BPromise(function(_0x5ebf61,_0x634d14){return client[_0x2a36('0xa')](_0x2b5159,_0x2c0283)[_0x2a36('0xb')](function(_0xc081a1){logger[_0x2a36('0xc')](_0x2a36('0xd'),_0x15f2f6,_0x2a36('0xe'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x15f2f6,_0x2a36('0xe'),JSON[_0x2a36('0xf')](_0xc081a1));if(_0xc081a1['error']){if(_0xc081a1[_0x2a36('0x10')][_0x2a36('0x11')]===0x1f4){logger[_0x2a36('0x10')](_0x2a36('0xd'),_0x15f2f6,_0xc081a1[_0x2a36('0x10')][_0x2a36('0x12')]);return _0x634d14(_0xc081a1[_0x2a36('0x10')][_0x2a36('0x12')]);}logger[_0x2a36('0x10')]('License,\x20%s,\x20%s',_0x15f2f6,_0xc081a1[_0x2a36('0x10')][_0x2a36('0x12')]);return _0x5ebf61(_0xc081a1[_0x2a36('0x10')][_0x2a36('0x12')]);}else{logger[_0x2a36('0xc')]('License,\x20%s,\x20%s',_0x15f2f6,_0x2a36('0xe'));_0x5ebf61(_0xc081a1['result']['message']);}})['catch'](function(_0x1e5834){logger['error']('License,\x20%s,\x20%s',_0x15f2f6,_0x1e5834);_0x634d14(_0x1e5834);});});} \ No newline at end of file +var _0x67df=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x67df,0xc5));var _0xf67d=function(_0x11e288,_0x1d096e){_0x11e288=_0x11e288-0x0;var _0x247234=_0x67df[_0x11e288];return _0x247234;};'use strict';var _=require('lodash');var util=require(_0xf67d('0x0'));var moment=require(_0xf67d('0x1'));var BPromise=require(_0xf67d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf67d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf67d('0x4'));var logger=require(_0xf67d('0x5'))(_0xf67d('0x6'));var config=require(_0xf67d('0x7'));var jayson=require(_0xf67d('0x8'));var client=jayson[_0xf67d('0x9')][_0xf67d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x388360,_0x3fb53c,_0x36982d){return new BPromise(function(_0x2fd40e,_0x1a2332){return client[_0xf67d('0xb')](_0x388360,_0x36982d)[_0xf67d('0xc')](function(_0x212ffd){logger['info'](_0xf67d('0xd'),_0x3fb53c,_0xf67d('0xe'));logger[_0xf67d('0xf')](_0xf67d('0x10'),_0x3fb53c,_0xf67d('0xe'),JSON[_0xf67d('0x11')](_0x212ffd));if(_0x212ffd['error']){if(_0x212ffd[_0xf67d('0x12')]['code']===0x1f4){logger[_0xf67d('0x12')](_0xf67d('0xd'),_0x3fb53c,_0x212ffd[_0xf67d('0x12')][_0xf67d('0x13')]);return _0x1a2332(_0x212ffd['error'][_0xf67d('0x13')]);}logger[_0xf67d('0x12')](_0xf67d('0xd'),_0x3fb53c,_0x212ffd[_0xf67d('0x12')]['message']);return _0x2fd40e(_0x212ffd['error'][_0xf67d('0x13')]);}else{logger[_0xf67d('0x14')](_0xf67d('0xd'),_0x3fb53c,'request\x20sent');_0x2fd40e(_0x212ffd[_0xf67d('0x15')][_0xf67d('0x13')]);}})['catch'](function(_0x386a34){logger[_0xf67d('0x12')](_0xf67d('0xd'),_0x3fb53c,_0x386a34);_0x1a2332(_0x386a34);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 50c5f18..4fe013e 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 _0x50e3=['create','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','update','delete','removeDispositions','/:id/canned_answers','removeImap','destroy','removeAgents','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/verify','post','addDisposition','addAnswer'];(function(_0x1b24eb,_0x39029e){var _0x157b17=function(_0x2ddb83){while(--_0x2ddb83){_0x1b24eb['push'](_0x1b24eb['shift']());}};_0x157b17(++_0x39029e);}(_0x50e3,0x101));var _0x350e=function(_0x4c4041,_0x1162ae){_0x4c4041=_0x4c4041-0x0;var _0x454eae=_0x50e3[_0x4c4041];return _0x454eae;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x350e('0x0')]();var fs_extra=require(_0x350e('0x1'));var auth=require(_0x350e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x350e('0x3'));var controller=require('./mailAccount.controller');router[_0x350e('0x4')]('/',auth[_0x350e('0x5')](),controller['index']);router[_0x350e('0x4')](_0x350e('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x350e('0x4')](_0x350e('0x7'),auth[_0x350e('0x5')](),controller[_0x350e('0x8')]);router[_0x350e('0x4')](_0x350e('0x9'),auth[_0x350e('0x5')](),controller[_0x350e('0xa')]);router[_0x350e('0x4')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x350e('0xb')]);router[_0x350e('0x4')](_0x350e('0xc'),auth[_0x350e('0x5')](),controller[_0x350e('0xd')]);router[_0x350e('0x4')](_0x350e('0xe'),auth[_0x350e('0x5')](),controller[_0x350e('0xf')]);router[_0x350e('0x4')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x350e('0x10')]);router[_0x350e('0x4')](_0x350e('0x11'),auth['isAuthenticated'](),controller[_0x350e('0x12')]);router[_0x350e('0x4')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x350e('0x4')](_0x350e('0x13'),auth[_0x350e('0x5')](),controller['verifySmtp']);router[_0x350e('0x4')]('/:id/users',auth[_0x350e('0x5')](),controller['getAgents']);router[_0x350e('0x14')](_0x350e('0x9'),auth['isAuthenticated'](),controller[_0x350e('0x15')]);router[_0x350e('0x14')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x350e('0x16')]);router['post']('/',auth[_0x350e('0x5')](),controller[_0x350e('0x17')]);router[_0x350e('0x14')]('/:id/in_servers',auth['isAuthenticated'](),controller['addImap']);router['post']('/:id/out_servers',auth[_0x350e('0x5')](),controller[_0x350e('0x18')]);router[_0x350e('0x14')](_0x350e('0x19'),auth['isAuthenticated'](),controller[_0x350e('0x1a')]);router[_0x350e('0x14')]('/:id/applications',auth['isAuthenticated'](),controller[_0x350e('0x1b')]);router[_0x350e('0x14')](_0x350e('0x1c'),auth['isAuthenticated'](),controller[_0x350e('0x1d')]);router[_0x350e('0x14')](_0x350e('0x1e'),auth[_0x350e('0x5')](),controller[_0x350e('0x1f')]);router[_0x350e('0x20')](_0x350e('0x7'),auth[_0x350e('0x5')](),controller[_0x350e('0x21')]);router[_0x350e('0x22')]('/:id/dispositions',auth[_0x350e('0x5')](),controller[_0x350e('0x23')]);router[_0x350e('0x22')](_0x350e('0x24'),auth[_0x350e('0x5')](),controller['removeAnswers']);router[_0x350e('0x22')](_0x350e('0xc'),auth[_0x350e('0x5')](),controller[_0x350e('0x25')]);router[_0x350e('0x22')](_0x350e('0xe'),auth[_0x350e('0x5')](),controller['removeSmtp']);router[_0x350e('0x22')](_0x350e('0x7'),auth['isAuthenticated'](),controller[_0x350e('0x26')]);router[_0x350e('0x22')](_0x350e('0x1e'),auth['isAuthenticated'](),controller[_0x350e('0x27')]);module['exports']=router; \ No newline at end of file +var _0xd717=['isAuthenticated','describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','create','addImap','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe'];(function(_0x456faa,_0x4c0a13){var _0x180dc7=function(_0x378e05){while(--_0x378e05){_0x456faa['push'](_0x456faa['shift']());}};_0x180dc7(++_0x4c0a13);}(_0xd717,0x1f1));var _0x7d71=function(_0x53a032,_0x1db316){_0x53a032=_0x53a032-0x0;var _0x16c6f6=_0xd717[_0x53a032];return _0x16c6f6;};'use strict';var multer=require(_0x7d71('0x0'));var util=require(_0x7d71('0x1'));var path=require('path');var timeout=require(_0x7d71('0x2'));var express=require(_0x7d71('0x3'));var router=express[_0x7d71('0x4')]();var fs_extra=require(_0x7d71('0x5'));var auth=require(_0x7d71('0x6'));var interaction=require(_0x7d71('0x7'));var config=require(_0x7d71('0x8'));var controller=require(_0x7d71('0x9'));router[_0x7d71('0xa')]('/',auth['isAuthenticated'](),controller[_0x7d71('0xb')]);router[_0x7d71('0xa')](_0x7d71('0xc'),auth[_0x7d71('0xd')](),controller[_0x7d71('0xe')]);router[_0x7d71('0xa')](_0x7d71('0xf'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x10')]);router[_0x7d71('0xa')](_0x7d71('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x7d71('0xd')](),controller[_0x7d71('0x12')]);router['get'](_0x7d71('0x13'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x14')]);router['get'](_0x7d71('0x15'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x16')]);router[_0x7d71('0xa')](_0x7d71('0x17'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x18')]);router[_0x7d71('0xa')](_0x7d71('0x19'),auth[_0x7d71('0xd')](),controller['getApplications']);router['get'](_0x7d71('0x1a'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x1b')]);router[_0x7d71('0xa')](_0x7d71('0x1c'),auth['isAuthenticated'](),controller[_0x7d71('0x1d')]);router['get'](_0x7d71('0x1e'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x1f')]);router[_0x7d71('0x20')]('/:id/dispositions',auth[_0x7d71('0xd')](),controller[_0x7d71('0x21')]);router[_0x7d71('0x20')](_0x7d71('0x22'),auth[_0x7d71('0xd')](),controller['addAnswer']);router['post']('/',auth['isAuthenticated'](),controller[_0x7d71('0x23')]);router[_0x7d71('0x20')](_0x7d71('0x13'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x24')]);router[_0x7d71('0x20')](_0x7d71('0x15'),auth[_0x7d71('0xd')](),controller['addSmtp']);router[_0x7d71('0x20')](_0x7d71('0x17'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x25')]);router[_0x7d71('0x20')]('/:id/applications',auth[_0x7d71('0xd')](),controller[_0x7d71('0x26')]);router[_0x7d71('0x20')](_0x7d71('0x27'),auth['isAuthenticated'](),controller[_0x7d71('0x28')]);router[_0x7d71('0x20')](_0x7d71('0x1e'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x29')]);router[_0x7d71('0x2a')]('/:id',auth[_0x7d71('0xd')](),controller[_0x7d71('0x2b')]);router[_0x7d71('0x2c')](_0x7d71('0x11'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x2d')]);router[_0x7d71('0x2c')](_0x7d71('0x22'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x2e')]);router[_0x7d71('0x2c')](_0x7d71('0x13'),auth[_0x7d71('0xd')](),controller[_0x7d71('0x2f')]);router[_0x7d71('0x2c')]('/:id/out_servers',auth[_0x7d71('0xd')](),controller[_0x7d71('0x30')]);router[_0x7d71('0x2c')](_0x7d71('0xf'),auth['isAuthenticated'](),controller[_0x7d71('0x31')]);router['delete'](_0x7d71('0x1e'),auth['isAuthenticated'](),controller[_0x7d71('0x32')]);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 de73b0d..c4e457c 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 _0x54b3=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x54b3,0x113));var _0x354b=function(_0x3c6c68,_0x21de95){_0x3c6c68=_0x3c6c68-0x0;var _0xc5811c=_0x54b3[_0x3c6c68];return _0xc5811c;};'use strict';var Sequelize=require(_0x354b('0x0'));module[_0x354b('0x1')]={'description':{'type':Sequelize[_0x354b('0x2')]},'name':{'type':Sequelize[_0x354b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x354b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x354b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x354b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x354b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x354b('0x4')]},'markAsUnread':{'type':Sequelize[_0x354b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x354b('0x2')],'allowNull':![],'defaultValue':_0x354b('0x5')},'fontSize':{'type':Sequelize[_0x354b('0x6')](0x2)[_0x354b('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x354b('0x4')],'defaultValue':function(){return _0x354b('0x8');}},'notificationSound':{'type':Sequelize[_0x354b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x354b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x354b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x354b('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x354b('0x3')],'defaultValue':![],'comment':_0x354b('0xa'),'set':function(_0x4e37a9){if(!_0x4e37a9)this[_0x354b('0xb')](_0x354b('0xc'),null);this[_0x354b('0xb')](_0x354b('0xd'),_0x4e37a9);}},'provider':{'type':Sequelize[_0x354b('0xe')](_0x354b('0xf'),_0x354b('0x10'),_0x354b('0x11'),_0x354b('0x12')),'defaultValue':null,'get':function(){if(!this[_0x354b('0x13')](_0x354b('0x14')))return _0x354b('0x15');return this[_0x354b('0x13')]('provider');},'set':function(_0x1c91e3){if(_0x1c91e3===_0x354b('0x15'))_0x1c91e3=null;return this[_0x354b('0xb')](_0x354b('0x14'),_0x1c91e3);}}}; \ No newline at end of file +var _0xbf4b=['sequelize','exports','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','provider','custom','getDataValue'];(function(_0x1d90ca,_0x3bab16){var _0x28872b=function(_0x3ea71b){while(--_0x3ea71b){_0x1d90ca['push'](_0x1d90ca['shift']());}};_0x28872b(++_0x3bab16);}(_0xbf4b,0xdc));var _0xbbf4=function(_0x347541,_0x137cf){_0x347541=_0x347541-0x0;var _0x5c0e38=_0xbf4b[_0x347541];return _0x5c0e38;};'use strict';var Sequelize=require(_0xbbf4('0x0'));module[_0xbbf4('0x1')]={'description':{'type':Sequelize[_0xbbf4('0x2')]},'name':{'type':Sequelize[_0xbbf4('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xbbf4('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbbf4('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xbbf4('0x4')]},'markAsUnread':{'type':Sequelize[_0xbbf4('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbbf4('0x2')],'allowNull':![],'defaultValue':_0xbbf4('0x5')},'fontSize':{'type':Sequelize[_0xbbf4('0x6')](0x2)[_0xbbf4('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbbf4('0x4')],'defaultValue':function(){return _0xbbf4('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbbf4('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbbf4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbbf4('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xbbf4('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xbbf4('0x3')],'defaultValue':![],'comment':_0xbbf4('0xa'),'set':function(_0x11c3ba){if(!_0x11c3ba)this[_0xbbf4('0xb')](_0xbbf4('0xc'),null);this['setDataValue'](_0xbbf4('0xd'),_0x11c3ba);}},'provider':{'type':Sequelize[_0xbbf4('0xe')](_0xbbf4('0xf'),_0xbbf4('0x10'),_0xbbf4('0x11'),_0xbbf4('0x12')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xbbf4('0x13')))return _0xbbf4('0x14');return this[_0xbbf4('0x15')](_0xbbf4('0x13'));},'set':function(_0x53b6fd){if(_0x53b6fd==='custom')_0x53b6fd=null;return this['setDataValue']('provider',_0x53b6fd);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index be6eb35..5e5f254 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 _0x1b2f=['authentication','Imap','Smtp','MailServerIn','mandatoryDispositionPause','map','MailAccount','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','Pause','keys','options','find','body','provider','MailServerOut','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','findOne','include','findAll','removeDispositions','ids','addAnswer','create','CannedAnswer','pick','removeAnswers','custom','email','ListId','isNil','active','description','role','autoAssociation','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','color','tag','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','CmList','List','CmContact','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','juice','ioredis','../../components/parsers/qs','api','redis','defaults','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service'];(function(_0x40926b,_0x407e01){var _0x2dd0bd=function(_0x425db1){while(--_0x425db1){_0x40926b['push'](_0x40926b['shift']());}};_0x2dd0bd(++_0x407e01);}(_0x1b2f,0x136));var _0xf1b2=function(_0x2dbc6d,_0x3c99fc){_0x2dbc6d=_0x2dbc6d-0x0;var _0x52dd57=_0x1b2f[_0x2dbc6d];return _0x52dd57;};'use strict';var moment=require(_0xf1b2('0x0'));var BPromise=require(_0xf1b2('0x1'));var util=require('util');var path=require('path');var _=require('lodash');var juice=require(_0xf1b2('0x2'));var Redis=require(_0xf1b2('0x3'));var qs=require(_0xf1b2('0x4'));var logger=require('../../config/logger')(_0xf1b2('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf1b2('0x6')]=_[_0xf1b2('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf1b2('0x8'))(new Redis(config[_0xf1b2('0x6')]));require(_0xf1b2('0x9'))['register'](socket);var jayson=require(_0xf1b2('0xa'));var client=jayson[_0xf1b2('0xb')][_0xf1b2('0xc')]({'port':0x232b});function respondWithRpcPromise(_0x4f05bc,_0x5138dd,_0x1551cf,_0xa624a){return new BPromise(function(_0xab2cbe,_0x465dd7){var _0x3a4bce=_0xa624a||client;return _0x3a4bce[_0xf1b2('0xd')](_0x4f05bc,_0x1551cf)['then'](function(_0x8d1634){logger[_0xf1b2('0xe')]('MailAccount,\x20%s,\x20%s',_0x5138dd,_0xf1b2('0xf'));logger[_0xf1b2('0x10')](_0xf1b2('0x11'),_0x5138dd,_0xf1b2('0xf'),JSON['stringify'](_0x8d1634));if(_0x8d1634[_0xf1b2('0x12')]){if(_0x8d1634['error'][_0xf1b2('0x13')]===0x1f4){logger[_0xf1b2('0x12')](_0xf1b2('0x14'),_0x5138dd,_0x8d1634[_0xf1b2('0x12')][_0xf1b2('0x15')]);return _0x465dd7(_0x8d1634[_0xf1b2('0x12')][_0xf1b2('0x15')]);}logger['error'](_0xf1b2('0x14'),_0x5138dd,_0x8d1634[_0xf1b2('0x12')][_0xf1b2('0x15')]);return _0xab2cbe(_0x8d1634[_0xf1b2('0x12')][_0xf1b2('0x15')]);}else{logger[_0xf1b2('0xe')](_0xf1b2('0x14'),_0x5138dd,'request\x20sent');_0xab2cbe(_0x8d1634[_0xf1b2('0x16')][_0xf1b2('0x15')]);}})['catch'](function(_0x556d9e){logger[_0xf1b2('0x12')](_0xf1b2('0x14'),_0x5138dd,_0x556d9e);_0x465dd7(_0x556d9e);});});}function respondWithStatusCode(_0x137018,_0x4df9ed){_0x4df9ed=_0x4df9ed||0xcc;return function(_0x3310a6){if(_0x3310a6){return _0x137018[_0xf1b2('0x17')](_0x4df9ed);}return _0x137018['status'](_0x4df9ed)[_0xf1b2('0x18')]();};}function respondWithResult(_0x2f53a2,_0x2585bb){_0x2585bb=_0x2585bb||0xc8;return function(_0x9a4160){if(_0x9a4160){return _0x2f53a2[_0xf1b2('0x19')](_0x2585bb)[_0xf1b2('0x1a')](_0x9a4160);}};}function respondWithFilteredResult(_0x146e90,_0x2e51bc){return function(_0x4549ed){if(_0x4549ed){var _0x184e48=typeof _0x2e51bc[_0xf1b2('0x1b')]==='undefined'&&typeof _0x2e51bc[_0xf1b2('0x1c')]===_0xf1b2('0x1d');var _0x3bca47=_0x4549ed['count'];var _0x4c0065=_0x184e48?0x0:_0x2e51bc[_0xf1b2('0x1b')];var _0x300936=_0x184e48?_0x4549ed[_0xf1b2('0x1e')]:_0x2e51bc[_0xf1b2('0x1b')]+_0x2e51bc[_0xf1b2('0x1c')];var _0x1ca221;if(_0x300936>=_0x3bca47){_0x300936=_0x3bca47;_0x1ca221=0xc8;}else{_0x1ca221=0xce;}_0x146e90['status'](_0x1ca221);return _0x146e90['set'](_0xf1b2('0x1f'),_0x4c0065+'-'+_0x300936+'/'+_0x3bca47)[_0xf1b2('0x1a')](_0x4549ed);}return null;};}function saveUpdates(_0x226240){return function(_0x3b72ce){if(_0x3b72ce){return _0x3b72ce[_0xf1b2('0x20')](_0x226240)[_0xf1b2('0x21')](function(_0x39eb7c){return _0x39eb7c;});}return null;};}function removeEntity(_0x469ec0){return function(_0x3f1bbe){if(_0x3f1bbe){return _0x3f1bbe[_0xf1b2('0x22')]()['then'](function(){var _0x4ef156=_0x3f1bbe[_0xf1b2('0x23')]({'plain':!![]});var _0x51a5bb=_0xf1b2('0x24');return db[_0xf1b2('0x25')][_0xf1b2('0x22')]({'where':{'type':_0x51a5bb,'resourceId':_0x4ef156['id']}})[_0xf1b2('0x21')](function(){return _0x3f1bbe;});})[_0xf1b2('0x21')](function(){_0x469ec0[_0xf1b2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313448){return function(_0x44f4b8){if(!_0x44f4b8){_0x313448[_0xf1b2('0x17')](0x194);}return _0x44f4b8;};}function handleError(_0x3966a5,_0x323484){_0x323484=_0x323484||0x1f4;return function(_0x4c53e7){logger[_0xf1b2('0x12')](_0x4c53e7[_0xf1b2('0x26')]);if(_0x4c53e7[_0xf1b2('0x27')]){delete _0x4c53e7[_0xf1b2('0x27')];}_0x3966a5[_0xf1b2('0x19')](_0x323484)[_0xf1b2('0x28')](_0x4c53e7);};}function getImapHost(_0x1309b9){switch(_0x1309b9){case _0xf1b2('0x29'):return _0xf1b2('0x2a');case'yahoo':return _0xf1b2('0x2b');case _0xf1b2('0x2c'):return _0xf1b2('0x2d');case'outlook365':return _0xf1b2('0x2e');}throw new Error('Unknown\x20email\x20service\x20provider',_0x1309b9);}function getSmtpHost(_0x33f991){switch(_0x33f991){case _0xf1b2('0x29'):return _0xf1b2('0x2f');case _0xf1b2('0x30'):return _0xf1b2('0x31');case _0xf1b2('0x2c'):return'smtp-mail.outlook.com';case _0xf1b2('0x32'):return _0xf1b2('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0x33f991);}function getAuthenticationOptions(_0x589290,_0x42eaaf){var _0x28760a={};var _0x240b54={};if(_0x589290){_0x28760a[_0xf1b2('0x34')]=_0x240b54[_0xf1b2('0x34')]=_0x42eaaf[_0xf1b2('0x35')];_0x28760a[_0xf1b2('0x36')]=_0x240b54[_0xf1b2('0x37')]=_0x42eaaf[_0xf1b2('0x36')];if(_0x42eaaf[_0xf1b2('0x38')]){_0x28760a[_0xf1b2('0x38')]=_0x240b54['modernAuthentication']=!![];_0x28760a['CloudProviderId']=_0x240b54[_0xf1b2('0x39')]=_0x42eaaf[_0xf1b2('0x39')];_0x28760a[_0xf1b2('0x36')]=_0x240b54[_0xf1b2('0x37')]=null;}else{_0x28760a[_0xf1b2('0x39')]=_0x240b54[_0xf1b2('0x39')]=null;}_0x28760a[_0xf1b2('0x3a')]=getImapHost(_0x589290);_0x28760a['port']=0x3e1;_0x240b54[_0xf1b2('0x3a')]=getSmtpHost(_0x589290);_0x240b54[_0xf1b2('0x3b')]=0x24b;_0x240b54[_0xf1b2('0x3c')]=![];_0x28760a['service']=_0x240b54[_0xf1b2('0x3d')]=null;}else{if(_0x42eaaf['authentication']){_0x28760a[_0xf1b2('0x34')]=_0x240b54[_0xf1b2('0x34')]=_0x42eaaf[_0xf1b2('0x35')];_0x28760a[_0xf1b2('0x36')]=_0x240b54[_0xf1b2('0x37')]=_0x42eaaf[_0xf1b2('0x36')];}else{_0x28760a[_0xf1b2('0x3e')]=_0x240b54[_0xf1b2('0x3e')]=![];_0x28760a[_0xf1b2('0x34')]=_0x240b54['user']=null;_0x28760a[_0xf1b2('0x36')]=_0x240b54[_0xf1b2('0x37')]=null;}_0x28760a[_0xf1b2('0x3a')]=_0x42eaaf[_0xf1b2('0x3f')][_0xf1b2('0x3a')];_0x28760a[_0xf1b2('0x3b')]=_0x42eaaf[_0xf1b2('0x3f')]['port'];_0x240b54[_0xf1b2('0x3a')]=_0x42eaaf[_0xf1b2('0x40')][_0xf1b2('0x3a')];_0x240b54[_0xf1b2('0x3b')]=_0x42eaaf[_0xf1b2('0x40')][_0xf1b2('0x3b')];}return{'Imap':_0x28760a,'Smtp':_0x240b54};}exports['index']=function(_0x3cc9c8,_0x50cc46){var _0x14ee97={'include':[{'model':db[_0xf1b2('0x41')],'as':_0xf1b2('0x3f')},{'model':db['MailServerOut'],'as':_0xf1b2('0x40')},{'model':db['Pause'],'as':_0xf1b2('0x42')}]},_0x4b7c15={},_0x815719={'count':0x0,'rows':[]};var _0x14a718=_[_0xf1b2('0x43')](db[_0xf1b2('0x44')][_0xf1b2('0x45')],function(_0x5ea181){return{'name':_0x5ea181['fieldName'],'type':_0x5ea181['type'][_0xf1b2('0x46')]};});_0x4b7c15[_0xf1b2('0x47')]=_[_0xf1b2('0x43')](_0x14a718,_0xf1b2('0x27'));_0x4b7c15[_0xf1b2('0x48')]=_['keys'](_0x3cc9c8[_0xf1b2('0x48')]);_0x4b7c15[_0xf1b2('0x49')]=_[_0xf1b2('0x4a')](_0x4b7c15[_0xf1b2('0x47')],_0x4b7c15[_0xf1b2('0x48')]);_0x14ee97[_0xf1b2('0x4b')]=_[_0xf1b2('0x4a')](_0x4b7c15[_0xf1b2('0x47')],qs['fields'](_0x3cc9c8[_0xf1b2('0x48')][_0xf1b2('0x4c')]));_0x14ee97['attributes']=_0x14ee97[_0xf1b2('0x4b')][_0xf1b2('0x4d')]?_0x14ee97[_0xf1b2('0x4b')]:_0x4b7c15[_0xf1b2('0x47')];if(!_0x3cc9c8[_0xf1b2('0x48')][_0xf1b2('0x4e')](_0xf1b2('0x4f'))){_0x14ee97[_0xf1b2('0x1c')]=qs[_0xf1b2('0x1c')](_0x3cc9c8[_0xf1b2('0x48')][_0xf1b2('0x1c')]);_0x14ee97[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x3cc9c8[_0xf1b2('0x48')][_0xf1b2('0x1b')]);}_0x14ee97[_0xf1b2('0x50')]=qs[_0xf1b2('0x51')](_0x3cc9c8[_0xf1b2('0x48')]['sort']);_0x14ee97[_0xf1b2('0x52')]=qs[_0xf1b2('0x49')](_['pick'](_0x3cc9c8[_0xf1b2('0x48')],_0x4b7c15[_0xf1b2('0x49')]),_0x14a718);if(_0x3cc9c8[_0xf1b2('0x48')][_0xf1b2('0x53')]){_0x14ee97[_0xf1b2('0x52')]=_[_0xf1b2('0x54')](_0x14ee97['where'],{'$or':_[_0xf1b2('0x43')](_0x14a718,function(_0x33663c){if(_0x33663c[_0xf1b2('0x55')]!==_0xf1b2('0x56')){var _0x1ae37a={};_0x1ae37a[_0x33663c['name']]={'$like':'%'+_0x3cc9c8[_0xf1b2('0x48')][_0xf1b2('0x53')]+'%'};return _0x1ae37a;}})});}_0x14ee97=_['merge']({},_0x14ee97,_0x3cc9c8['options']);var _0x202191={'where':_0x14ee97[_0xf1b2('0x52')]};return db['MailAccount'][_0xf1b2('0x1e')](_0x202191)[_0xf1b2('0x21')](function(_0x2d3b21){_0x815719['count']=_0x2d3b21;if(_0x3cc9c8[_0xf1b2('0x48')][_0xf1b2('0x57')]){_0x14ee97['include']=[{'all':!![]}];}return db[_0xf1b2('0x44')]['findAll'](_0x14ee97);})[_0xf1b2('0x21')](function(_0x2a756a){_0x815719[_0xf1b2('0x58')]=_0x2a756a;return _0x815719;})[_0xf1b2('0x21')](respondWithFilteredResult(_0x50cc46,_0x14ee97))[_0xf1b2('0x59')](handleError(_0x50cc46,null));};exports[_0xf1b2('0x5a')]=function(_0x3ababa,_0xbd3a1f){var _0x169545={'raw':![],'where':{'id':_0x3ababa[_0xf1b2('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xf1b2('0x40')},{'model':db[_0xf1b2('0x5c')],'as':_0xf1b2('0x42')}]},_0x27851f={};_0x27851f['model']=_[_0xf1b2('0x5d')](db[_0xf1b2('0x44')][_0xf1b2('0x45')]);_0x27851f[_0xf1b2('0x48')]=_[_0xf1b2('0x5d')](_0x3ababa[_0xf1b2('0x48')]);_0x27851f['filters']=_[_0xf1b2('0x4a')](_0x27851f[_0xf1b2('0x47')],_0x27851f['query']);_0x169545[_0xf1b2('0x4b')]=_[_0xf1b2('0x4a')](_0x27851f[_0xf1b2('0x47')],qs[_0xf1b2('0x4c')](_0x3ababa[_0xf1b2('0x48')][_0xf1b2('0x4c')]));_0x169545[_0xf1b2('0x4b')]=_0x169545['attributes']['length']?_0x169545[_0xf1b2('0x4b')]:_0x27851f['model'];if(_0x3ababa[_0xf1b2('0x48')][_0xf1b2('0x57')]){_0x169545['include']=[{'all':!![]}];}_0x169545=_[_0xf1b2('0x54')]({},_0x169545,_0x3ababa[_0xf1b2('0x5e')]);return db[_0xf1b2('0x44')][_0xf1b2('0x5f')](_0x169545)[_0xf1b2('0x21')](handleEntityNotFound(_0xbd3a1f,null))[_0xf1b2('0x21')](respondWithResult(_0xbd3a1f,null))['catch'](handleError(_0xbd3a1f,null));};exports['update']=function(_0x41f75e,_0x886355){if(_0x41f75e[_0xf1b2('0x60')]['id']){delete _0x41f75e[_0xf1b2('0x60')]['id'];}var _0x54e3ae=_0x41f75e[_0xf1b2('0x60')]['provider']==='custom'?null:_0x41f75e[_0xf1b2('0x60')][_0xf1b2('0x61')];var _0x3ed79b=_0x41f75e[_0xf1b2('0x60')]['Imap']||{};var _0x3bd2d2=_0x41f75e[_0xf1b2('0x60')][_0xf1b2('0x40')]||{};if(_0x54e3ae){_0x3ed79b[_0xf1b2('0x3a')]=getImapHost(_0x54e3ae);_0x3ed79b[_0xf1b2('0x3b')]=0x3e1;_0x3bd2d2[_0xf1b2('0x3a')]=getSmtpHost(_0x54e3ae);_0x3bd2d2[_0xf1b2('0x3b')]=0x24b;_0x3bd2d2['secure']=![];}if(_0x3bd2d2['modernAuthentication']){_0x3bd2d2[_0xf1b2('0x3c')]=![];}else{_0x3bd2d2[_0xf1b2('0x39')]=null;}if(!_0x3ed79b['modernAuthentication'])_0x3ed79b[_0xf1b2('0x39')]=null;_0x41f75e[_0xf1b2('0x60')][_0xf1b2('0x3f')]=_0x3ed79b;_0x41f75e[_0xf1b2('0x60')][_0xf1b2('0x40')]=_0x3bd2d2;return db[_0xf1b2('0x44')]['find']({'where':{'id':_0x41f75e[_0xf1b2('0x5b')]['id']},'include':[{'model':db[_0xf1b2('0x41')],'as':_0xf1b2('0x3f')},{'model':db[_0xf1b2('0x62')],'as':_0xf1b2('0x40')},{'model':db[_0xf1b2('0x5c')],'as':_0xf1b2('0x42')}]})[_0xf1b2('0x21')](handleEntityNotFound(_0x886355,null))[_0xf1b2('0x21')](function(_0x3cbe8f){if(!_0x3cbe8f)throw new Error(_0xf1b2('0x63'));if(_0x3cbe8f['service'])delete _0x41f75e['body']['Imap'];return _0x3cbe8f;})['then'](saveUpdates(_0x41f75e['body'],null))['then'](function(_0xe0b3ca){if(!_0x41f75e[_0xf1b2('0x60')]['Imap'])return _0xe0b3ca;return db['MailServerIn'][_0xf1b2('0x20')](_0x41f75e[_0xf1b2('0x60')]['Imap'],{'where':{'MailAccountId':_0xe0b3ca['id']}})['then'](function(){return _0xe0b3ca;});})[_0xf1b2('0x21')](function(_0x5f4f7e){if(!_0x41f75e[_0xf1b2('0x60')][_0xf1b2('0x40')])return _0x5f4f7e;return db[_0xf1b2('0x62')][_0xf1b2('0x20')](_0x41f75e[_0xf1b2('0x60')][_0xf1b2('0x40')],{'where':{'MailAccountId':_0x5f4f7e['id']}})['then'](function(){return _0x5f4f7e;});})[_0xf1b2('0x21')](respondWithResult(_0x886355,null))[_0xf1b2('0x59')](handleError(_0x886355,null));};exports[_0xf1b2('0x64')]=function(_0x4c4c24,_0xeee9e7){return db[_0xf1b2('0x44')][_0xf1b2('0x64')]()[_0xf1b2('0x21')](respondWithResult(_0xeee9e7,null))[_0xf1b2('0x59')](handleError(_0xeee9e7,null));};exports[_0xf1b2('0x65')]=function(_0x2f8f2f,_0x48c715){if(_0x2f8f2f[_0xf1b2('0x60')]['id']){delete _0x2f8f2f[_0xf1b2('0x60')]['id'];}return db[_0xf1b2('0x44')]['find']({'where':{'id':_0x2f8f2f[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x48c715,null))['then'](function(_0x583ab4){if(_0x583ab4){_0x2f8f2f[_0xf1b2('0x60')][_0xf1b2('0x66')]=_0x583ab4['id'];return db[_0xf1b2('0x67')]['create'](_0x2f8f2f[_0xf1b2('0x60')]);}})[_0xf1b2('0x21')](respondWithResult(_0x48c715,null))['catch'](handleError(_0x48c715,null));};exports['getDispositions']=function(_0x3791df,_0x3d5609){var _0x424608={'raw':![],'where':{}};var _0x5ad68f={};var _0x303994={'count':0x0,'rows':[]};return db[_0xf1b2('0x44')][_0xf1b2('0x68')]({'where':{'id':_0x3791df[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x3d5609,null))['then'](function(_0xa3db16){if(_0xa3db16){_0x5ad68f[_0xf1b2('0x47')]=_[_0xf1b2('0x5d')](db[_0xf1b2('0x67')][_0xf1b2('0x45')]);_0x5ad68f['query']=_[_0xf1b2('0x5d')](_0x3791df['query']);_0x5ad68f[_0xf1b2('0x49')]=_[_0xf1b2('0x4a')](_0x5ad68f[_0xf1b2('0x47')],_0x5ad68f['query']);_0x424608[_0xf1b2('0x4b')]=_['intersection'](_0x5ad68f[_0xf1b2('0x47')],qs[_0xf1b2('0x4c')](_0x3791df[_0xf1b2('0x48')][_0xf1b2('0x4c')]));_0x424608['attributes']=_0x424608['attributes'][_0xf1b2('0x4d')]?_0x424608[_0xf1b2('0x4b')]:_0x5ad68f['model'];if(!_0x3791df[_0xf1b2('0x48')][_0xf1b2('0x4e')](_0xf1b2('0x4f'))){_0x424608['limit']=qs['limit'](_0x3791df[_0xf1b2('0x48')][_0xf1b2('0x1c')]);_0x424608[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x3791df[_0xf1b2('0x48')][_0xf1b2('0x1b')]);}_0x424608[_0xf1b2('0x50')]=qs[_0xf1b2('0x51')](_0x3791df[_0xf1b2('0x48')]['sort']);_0x424608['where']=qs[_0xf1b2('0x49')](_['pick'](_0x3791df[_0xf1b2('0x48')],_0x5ad68f[_0xf1b2('0x49')]));_0x424608['where'][_0xf1b2('0x66')]=_0xa3db16['id'];if(_0x3791df[_0xf1b2('0x48')]['filter']){_0x424608[_0xf1b2('0x52')]=_[_0xf1b2('0x54')](_0x424608[_0xf1b2('0x52')],{'$or':_[_0xf1b2('0x43')](_0x424608[_0xf1b2('0x4b')],function(_0x40cdbe){var _0x458747={};_0x458747[_0x40cdbe]={'$like':'%'+_0x3791df[_0xf1b2('0x48')][_0xf1b2('0x53')]+'%'};return _0x458747;})});}_0x424608=_[_0xf1b2('0x54')]({},_0x424608,_0x3791df[_0xf1b2('0x5e')]);return db[_0xf1b2('0x67')]['count']({'where':_0x424608[_0xf1b2('0x52')]})['then'](function(_0x3b14fd){_0x303994[_0xf1b2('0x1e')]=_0x3b14fd;if(_0x3791df[_0xf1b2('0x48')][_0xf1b2('0x57')]){_0x424608[_0xf1b2('0x69')]=[{'all':!![]}];}return db['Disposition'][_0xf1b2('0x6a')](_0x424608);})['then'](function(_0x5e78ad){_0x303994[_0xf1b2('0x58')]=_0x5e78ad;return _0x303994;});}})['then'](respondWithFilteredResult(_0x3d5609,_0x424608))[_0xf1b2('0x59')](handleError(_0x3d5609,null));};exports[_0xf1b2('0x6b')]=function(_0x5d86b0,_0x481362){return db['MailAccount'][_0xf1b2('0x5f')]({'where':{'id':_0x5d86b0[_0xf1b2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x481362,null))[_0xf1b2('0x21')](function(_0x5cb21b){if(_0x5cb21b){return _0x5cb21b[_0xf1b2('0x6b')](_0x5d86b0[_0xf1b2('0x48')][_0xf1b2('0x6c')]);}})[_0xf1b2('0x21')](respondWithStatusCode(_0x481362,null))['catch'](handleError(_0x481362,null));};exports[_0xf1b2('0x6d')]=function(_0x2de476,_0x1991d2){if(_0x2de476[_0xf1b2('0x60')]['id']){delete _0x2de476[_0xf1b2('0x60')]['id'];}return db[_0xf1b2('0x44')][_0xf1b2('0x5f')]({'where':{'id':_0x2de476[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x1991d2,null))[_0xf1b2('0x21')](function(_0x2fc140){if(_0x2fc140){_0x2de476['body']['MailAccountId']=_0x2fc140['id'];return db['CannedAnswer'][_0xf1b2('0x6e')](_0x2de476['body']);}})[_0xf1b2('0x21')](respondWithResult(_0x1991d2,null))['catch'](handleError(_0x1991d2,null));};exports['getAnswers']=function(_0x24a683,_0x4a1c16){var _0x5eebea={'raw':![],'where':{}};var _0x959438={};var _0x124ec4={'count':0x0,'rows':[]};return db[_0xf1b2('0x44')][_0xf1b2('0x68')]({'where':{'id':_0x24a683['params']['id']}})['then'](handleEntityNotFound(_0x4a1c16,null))['then'](function(_0x454a38){if(_0x454a38){_0x959438[_0xf1b2('0x47')]=_[_0xf1b2('0x5d')](db[_0xf1b2('0x6f')][_0xf1b2('0x45')]);_0x959438[_0xf1b2('0x48')]=_['keys'](_0x24a683['query']);_0x959438[_0xf1b2('0x49')]=_['intersection'](_0x959438[_0xf1b2('0x47')],_0x959438[_0xf1b2('0x48')]);_0x5eebea['attributes']=_[_0xf1b2('0x4a')](_0x959438['model'],qs[_0xf1b2('0x4c')](_0x24a683[_0xf1b2('0x48')]['fields']));_0x5eebea[_0xf1b2('0x4b')]=_0x5eebea[_0xf1b2('0x4b')]['length']?_0x5eebea['attributes']:_0x959438[_0xf1b2('0x47')];if(!_0x24a683[_0xf1b2('0x48')][_0xf1b2('0x4e')]('nolimit')){_0x5eebea[_0xf1b2('0x1c')]=qs['limit'](_0x24a683[_0xf1b2('0x48')][_0xf1b2('0x1c')]);_0x5eebea[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x24a683['query']['offset']);}_0x5eebea['order']=qs[_0xf1b2('0x51')](_0x24a683[_0xf1b2('0x48')]['sort']);_0x5eebea[_0xf1b2('0x52')]=qs[_0xf1b2('0x49')](_[_0xf1b2('0x70')](_0x24a683[_0xf1b2('0x48')],_0x959438[_0xf1b2('0x49')]));_0x5eebea['where']['MailAccountId']=_0x454a38['id'];if(_0x24a683[_0xf1b2('0x48')][_0xf1b2('0x53')]){_0x5eebea[_0xf1b2('0x52')]=_[_0xf1b2('0x54')](_0x5eebea[_0xf1b2('0x52')],{'$or':_['map'](_0x5eebea[_0xf1b2('0x4b')],function(_0x69dd60){var _0x5e31ce={};_0x5e31ce[_0x69dd60]={'$like':'%'+_0x24a683['query'][_0xf1b2('0x53')]+'%'};return _0x5e31ce;})});}_0x5eebea=_['merge']({},_0x5eebea,_0x24a683[_0xf1b2('0x5e')]);return db[_0xf1b2('0x6f')]['count']({'where':_0x5eebea[_0xf1b2('0x52')]})[_0xf1b2('0x21')](function(_0x97b5b5){_0x124ec4[_0xf1b2('0x1e')]=_0x97b5b5;if(_0x24a683['query'][_0xf1b2('0x57')]){_0x5eebea[_0xf1b2('0x69')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf1b2('0x6a')](_0x5eebea);})[_0xf1b2('0x21')](function(_0x272858){_0x124ec4[_0xf1b2('0x58')]=_0x272858;return _0x124ec4;});}})[_0xf1b2('0x21')](respondWithFilteredResult(_0x4a1c16,_0x5eebea))[_0xf1b2('0x59')](handleError(_0x4a1c16,null));};exports[_0xf1b2('0x71')]=function(_0x1dd0a9,_0x156712){return db[_0xf1b2('0x44')][_0xf1b2('0x5f')]({'where':{'id':_0x1dd0a9['params']['id']}})['then'](handleEntityNotFound(_0x156712,null))[_0xf1b2('0x21')](function(_0x374a84){if(_0x374a84){return _0x374a84[_0xf1b2('0x71')](_0x1dd0a9[_0xf1b2('0x48')][_0xf1b2('0x6c')]);}})['then'](respondWithStatusCode(_0x156712,null))[_0xf1b2('0x59')](handleError(_0x156712,null));};exports['create']=function(_0x58066f,_0xf5856d){var _0x336ce9={'name':_0x58066f['body']['name'],'key':_0x58066f[_0xf1b2('0x60')][_0xf1b2('0x46')],'provider':_0x58066f[_0xf1b2('0x60')][_0xf1b2('0x61')]===_0xf1b2('0x72')?null:_0x58066f[_0xf1b2('0x60')][_0xf1b2('0x61')],'email':_0x58066f['body'][_0xf1b2('0x73')],'ListId':_0x58066f['body'][_0xf1b2('0x74')],'active':!_[_0xf1b2('0x75')](_0x58066f[_0xf1b2('0x60')][_0xf1b2('0x76')])?_0x58066f[_0xf1b2('0x60')][_0xf1b2('0x76')]:!![],'description':_0x58066f[_0xf1b2('0x60')][_0xf1b2('0x77')]||null};var _0x342d23=getAuthenticationOptions(_0x336ce9['provider'],_0x58066f['body']);_0x336ce9['Imap']=_0x342d23[_0xf1b2('0x3f')];_0x336ce9[_0xf1b2('0x40')]=_0x342d23[_0xf1b2('0x40')];return db[_0xf1b2('0x44')][_0xf1b2('0x6e')](_0x336ce9,{'include':[{'model':db[_0xf1b2('0x62')],'as':'Smtp'},{'model':db[_0xf1b2('0x41')],'as':_0xf1b2('0x3f')}]})['then'](function(_0x5942fd){var _0x30939e=_0x58066f[_0xf1b2('0x34')][_0xf1b2('0x23')]({'plain':!![]});if(!_0x30939e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30939e[_0xf1b2('0x78')]===_0xf1b2('0x34')){var _0x1c4ceb=_0x5942fd[_0xf1b2('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xf1b2('0x5f')]({'where':{'name':'MailAccounts','userProfileId':_0x30939e['userProfileId']},'raw':!![]})[_0xf1b2('0x21')](function(_0x14dcda){if(_0x14dcda&&_0x14dcda[_0xf1b2('0x79')]===0x0){return db[_0xf1b2('0x25')][_0xf1b2('0x6e')]({'name':_0x1c4ceb[_0xf1b2('0x27')],'resourceId':_0x1c4ceb['id'],'type':_0x14dcda[_0xf1b2('0x27')],'sectionId':_0x14dcda['id']},{})[_0xf1b2('0x21')](function(){return _0x5942fd;});}else{return _0x5942fd;}})[_0xf1b2('0x59')](function(_0xc7785a){logger[_0xf1b2('0x12')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc7785a);throw _0xc7785a;});}return _0x5942fd;})[_0xf1b2('0x21')](respondWithResult(_0xf5856d,0xc9))[_0xf1b2('0x59')](handleError(_0xf5856d,null));};exports['getImap']=function(_0x3df7bc,_0x36fc06){return db['MailAccount'][_0xf1b2('0x68')]({'where':{'id':_0x3df7bc['params']['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x36fc06,null))[_0xf1b2('0x21')](function(_0x1c992e){if(_0x1c992e){return _0x1c992e['getImap']();}return null;})[_0xf1b2('0x21')](respondWithResult(_0x36fc06,null))['catch'](handleError(_0x36fc06,null));};exports[_0xf1b2('0x7a')]=function(_0x2517d0,_0x2afeff){if(_0x2517d0[_0xf1b2('0x60')]['id']){delete _0x2517d0[_0xf1b2('0x60')]['id'];}return db[_0xf1b2('0x44')][_0xf1b2('0x5f')]({'where':{'id':_0x2517d0[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x2afeff,null))['then'](function(_0x4259c9){if(_0x4259c9){_0x2517d0[_0xf1b2('0x60')][_0xf1b2('0x66')]=_0x4259c9['id'];return db['MailServerIn']['create'](_0x2517d0[_0xf1b2('0x60')]);}})[_0xf1b2('0x21')](respondWithResult(_0x2afeff,null))[_0xf1b2('0x59')](handleError(_0x2afeff,null));};exports[_0xf1b2('0x7b')]=function(_0x481297,_0x3d864b){return db[_0xf1b2('0x44')]['findOne']({'where':{'id':_0x481297[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x3d864b,null))[_0xf1b2('0x21')](function(_0x23934b){if(_0x23934b){return _0x23934b[_0xf1b2('0x7c')](null);}return null;})[_0xf1b2('0x21')](respondWithStatusCode(_0x3d864b,null))[_0xf1b2('0x59')](handleError(_0x3d864b,null));};exports[_0xf1b2('0x7d')]=function(_0x4957f4,_0x4638fe){return db['MailAccount'][_0xf1b2('0x68')]({'where':{'id':_0x4957f4[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x4638fe,null))['then'](function(_0x34ac72){if(_0x34ac72){return _0x34ac72[_0xf1b2('0x7d')]();}return null;})[_0xf1b2('0x21')](respondWithResult(_0x4638fe,null))['catch'](handleError(_0x4638fe,null));};exports['addSmtp']=function(_0x11bed3,_0x3a09e5){if(_0x11bed3[_0xf1b2('0x60')]['id']){delete _0x11bed3['body']['id'];}return db[_0xf1b2('0x44')][_0xf1b2('0x5f')]({'where':{'id':_0x11bed3[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x3a09e5,null))[_0xf1b2('0x21')](function(_0x40d227){if(_0x40d227){_0x11bed3[_0xf1b2('0x60')]['MailAccountId']=_0x40d227['id'];return db[_0xf1b2('0x62')][_0xf1b2('0x6e')](_0x11bed3['body']);}})[_0xf1b2('0x21')](respondWithResult(_0x3a09e5,null))['catch'](handleError(_0x3a09e5,null));};exports[_0xf1b2('0x7e')]=function(_0x237d6c,_0x3a92c2){return db[_0xf1b2('0x44')][_0xf1b2('0x68')]({'where':{'id':_0x237d6c[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x3a92c2,null))[_0xf1b2('0x21')](function(_0xdda6de){if(_0xdda6de){return _0xdda6de[_0xf1b2('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x3a92c2,null))[_0xf1b2('0x59')](handleError(_0x3a92c2,null));};exports[_0xf1b2('0x80')]=function(_0x11577c,_0x58f2c4){return db[_0xf1b2('0x81')][_0xf1b2('0x5f')]({'where':{'id':_0x11577c[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x58f2c4,null))[_0xf1b2('0x21')](function(_0x307140){if(_0x307140){return _0x307140[_0xf1b2('0x80')](_0x11577c['body'][_0xf1b2('0x6c')],_[_0xf1b2('0x82')](_0x11577c['body'],[_0xf1b2('0x6c'),'id'])||{});}})[_0xf1b2('0x21')](respondWithResult(_0x58f2c4,null))['catch'](handleError(_0x58f2c4,null));};exports[_0xf1b2('0x83')]=function(_0x2470a2,_0x443793){var _0x51db5a={'raw':![],'where':{}};var _0x289cda={};var _0x2c58ef={'count':0x0,'rows':[]};return db['MailAccount'][_0xf1b2('0x68')]({'where':{'id':_0x2470a2['params']['id']}})['then'](handleEntityNotFound(_0x443793,null))['then'](function(_0x184860){if(_0x184860){_0x289cda['model']=_['keys'](db['MailInteraction'][_0xf1b2('0x45')]);_0x289cda[_0xf1b2('0x48')]=_[_0xf1b2('0x5d')](_0x2470a2[_0xf1b2('0x48')]);_0x289cda[_0xf1b2('0x49')]=_[_0xf1b2('0x4a')](_0x289cda[_0xf1b2('0x47')],_0x289cda[_0xf1b2('0x48')]);_0x51db5a[_0xf1b2('0x4b')]=_['intersection'](_0x289cda[_0xf1b2('0x47')],qs['fields'](_0x2470a2[_0xf1b2('0x48')][_0xf1b2('0x4c')]));_0x51db5a[_0xf1b2('0x4b')]=_0x51db5a['attributes'][_0xf1b2('0x4d')]?_0x51db5a['attributes']:_0x289cda[_0xf1b2('0x47')];if(!_0x2470a2[_0xf1b2('0x48')][_0xf1b2('0x4e')](_0xf1b2('0x4f'))){_0x51db5a[_0xf1b2('0x1c')]=qs[_0xf1b2('0x1c')](_0x2470a2[_0xf1b2('0x48')]['limit']);_0x51db5a[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x2470a2[_0xf1b2('0x48')]['offset']);}_0x51db5a[_0xf1b2('0x50')]=qs[_0xf1b2('0x51')](_0x2470a2[_0xf1b2('0x48')]['sort']);_0x51db5a['where']=qs[_0xf1b2('0x49')](_['pick'](_0x2470a2['query'],_0x289cda[_0xf1b2('0x49')]));_0x51db5a['where'][_0xf1b2('0x66')]=_0x184860['id'];if(_0x2470a2[_0xf1b2('0x48')][_0xf1b2('0x53')]){_0x51db5a['where']=_['merge'](_0x51db5a['where'],{'$or':_[_0xf1b2('0x43')](_0x51db5a['attributes'],function(_0x331b3f){var _0x23a4fc={};_0x23a4fc[_0x331b3f]={'$like':'%'+_0x2470a2[_0xf1b2('0x48')][_0xf1b2('0x53')]+'%'};return _0x23a4fc;})});}_0x51db5a=_[_0xf1b2('0x54')]({},_0x51db5a,_0x2470a2[_0xf1b2('0x5e')]);return db['MailInteraction']['count']({'where':_0x51db5a[_0xf1b2('0x52')]})[_0xf1b2('0x21')](function(_0x5d0799){_0x2c58ef['count']=_0x5d0799;if(_0x2470a2[_0xf1b2('0x48')][_0xf1b2('0x57')]){_0x51db5a[_0xf1b2('0x69')]=[{'model':db['CmContact'],'as':_0xf1b2('0x84'),'required':![]},{'model':db[_0xf1b2('0x85')],'as':_0xf1b2('0x86'),'attributes':[_0xf1b2('0x27'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xf1b2('0x27'),_0xf1b2('0x87')],'where':_0x2470a2[_0xf1b2('0x48')][_0xf1b2('0x88')]?{'id':_0x2470a2[_0xf1b2('0x48')][_0xf1b2('0x88')]}:undefined,'required':_0x2470a2[_0xf1b2('0x48')]['tag']?!![]:![]}];}return db[_0xf1b2('0x81')][_0xf1b2('0x6a')](_0x51db5a);})[_0xf1b2('0x21')](function(_0x385e40){_0x2c58ef[_0xf1b2('0x58')]=_0x385e40;return _0x2c58ef;});}})[_0xf1b2('0x21')](respondWithFilteredResult(_0x443793,_0x51db5a))[_0xf1b2('0x59')](handleError(_0x443793,null));};exports[_0xf1b2('0x89')]=function addApplications(_0x5919a9,_0x39323a){var _0x4e5bf6=_0x5919a9[_0xf1b2('0x5b')]['id'];var _0x4975a0=_0x5919a9[_0xf1b2('0x60')];var _0x47d61e=0xc8;var _0x45b3f1=null;return db['sequelize'][_0xf1b2('0x8a')]({'isolationLevel':db['sequelize']['Transaction'][_0xf1b2('0x8b')][_0xf1b2('0x8c')]},function(_0x2c6411){return db[_0xf1b2('0x44')][_0xf1b2('0x68')]({'where':{'id':_0x4e5bf6},'transaction':_0x2c6411})[_0xf1b2('0x21')](function(_0x371350){if(_0x371350){return db[_0xf1b2('0x8d')][_0xf1b2('0x22')]({'where':{'MailAccountId':_0x4e5bf6},'transaction':_0x2c6411})[_0xf1b2('0x21')](function(){var _0x15970c=_[_0xf1b2('0x43')](_0x4975a0,function(_0x4a5e04){_0x4a5e04[_0xf1b2('0x66')]=_0x4e5bf6;return _0x4a5e04;});return db[_0xf1b2('0x8d')]['bulkCreate'](_0x15970c,{'transaction':_0x2c6411});});}else{_0x47d61e=0x194;_0x45b3f1=[];}});})[_0xf1b2('0x21')](function(){if(_0x47d61e!==0x194){return db[_0xf1b2('0x8d')][_0xf1b2('0x8e')]({'where':{'MailAccountId':_0x4e5bf6},'order':_0xf1b2('0x8f')})[_0xf1b2('0x21')](function(_0x51330b){_0x45b3f1=_0x51330b;});}})['catch'](function(_0x103876){_0x47d61e=0x1f4;logger[_0xf1b2('0x12')](_0x103876[_0xf1b2('0x26')]);if(_0x103876['name']){delete _0x103876[_0xf1b2('0x27')];}_0x45b3f1=_0x103876;})[_0xf1b2('0x90')](function(){if(_0x45b3f1===null){_0x39323a['sendStatus'](_0x47d61e);}else{if(_0x47d61e===0x1f4){_0x39323a[_0xf1b2('0x19')](_0x47d61e)[_0xf1b2('0x28')](_0x45b3f1);}else{_0x39323a[_0xf1b2('0x19')](_0x47d61e)[_0xf1b2('0x1a')](_0x45b3f1);}}});};exports[_0xf1b2('0x91')]=function(_0x3a4711,_0x7ebbd7){var _0x331f12={};var _0x16e2a1={};var _0x1841f1;var _0xb3c49c;return db['MailAccount']['findOne']({'where':{'id':_0x3a4711[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x7ebbd7,null))['then'](function(_0x4cb681){if(_0x4cb681){_0x1841f1=_0x4cb681;_0x16e2a1['model']=_[_0xf1b2('0x5d')](db[_0xf1b2('0x8d')][_0xf1b2('0x45')]);_0x16e2a1[_0xf1b2('0x48')]=_[_0xf1b2('0x5d')](_0x3a4711['query']);_0x16e2a1[_0xf1b2('0x49')]=_[_0xf1b2('0x4a')](_0x16e2a1[_0xf1b2('0x47')],_0x16e2a1['query']);_0x331f12[_0xf1b2('0x4b')]=_[_0xf1b2('0x4a')](_0x16e2a1[_0xf1b2('0x47')],qs['fields'](_0x3a4711[_0xf1b2('0x48')]['fields']));_0x331f12[_0xf1b2('0x4b')]=_0x331f12[_0xf1b2('0x4b')][_0xf1b2('0x4d')]?_0x331f12[_0xf1b2('0x4b')]:_0x16e2a1[_0xf1b2('0x47')];_0x331f12['order']=qs['sort'](_0x3a4711[_0xf1b2('0x48')][_0xf1b2('0x51')]);_0x331f12[_0xf1b2('0x52')]=qs[_0xf1b2('0x49')](_['pick'](_0x3a4711[_0xf1b2('0x48')],_0x16e2a1[_0xf1b2('0x49')]));if(_0x3a4711['query'][_0xf1b2('0x53')]){_0x331f12[_0xf1b2('0x52')]=_[_0xf1b2('0x54')](_0x331f12[_0xf1b2('0x52')],{'$or':_[_0xf1b2('0x43')](_0x331f12[_0xf1b2('0x4b')],function(_0x4931e0){var _0x546188={};_0x546188[_0x4931e0]={'$like':'%'+_0x3a4711['query'][_0xf1b2('0x53')]+'%'};return _0x546188;})});}_0x331f12=_[_0xf1b2('0x54')]({},_0x331f12,_0x3a4711['options']);return _0x1841f1[_0xf1b2('0x91')](_0x331f12);}})[_0xf1b2('0x21')](function(_0x279579){if(_0x279579){_0xb3c49c=_0x279579[_0xf1b2('0x4d')];if(!_0x3a4711[_0xf1b2('0x48')]['hasOwnProperty'](_0xf1b2('0x4f'))){_0x331f12[_0xf1b2('0x1c')]=qs[_0xf1b2('0x1c')](_0x3a4711[_0xf1b2('0x48')][_0xf1b2('0x1c')]);_0x331f12['offset']=qs[_0xf1b2('0x1b')](_0x3a4711['query'][_0xf1b2('0x1b')]);}return _0x1841f1[_0xf1b2('0x91')](_0x331f12);}})[_0xf1b2('0x21')](function(_0x1be456){if(_0x1be456){return _0x1be456?{'count':_0xb3c49c,'rows':_0x1be456}:null;}})['then'](respondWithResult(_0x7ebbd7,null))[_0xf1b2('0x59')](handleError(_0x7ebbd7,null));};exports[_0xf1b2('0x92')]=function(_0x123d1e,_0x40eb63){var _0x2b548={'raw':!![],'where':{}};var _0x32867b={};var _0x362e55={'count':0x0,'rows':[]};return db[_0xf1b2('0x44')][_0xf1b2('0x68')]({'where':{'id':_0x123d1e[_0xf1b2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x40eb63,null))[_0xf1b2('0x21')](function(_0x564d7d){if(_0x564d7d){_0x32867b[_0xf1b2('0x47')]=_[_0xf1b2('0x5d')](db[_0xf1b2('0x93')]['rawAttributes']);_0x32867b[_0xf1b2('0x48')]=_['keys'](_0x123d1e[_0xf1b2('0x48')]);_0x32867b[_0xf1b2('0x49')]=_['intersection'](_0x32867b[_0xf1b2('0x47')],_0x32867b['query']);_0x2b548[_0xf1b2('0x4b')]=_[_0xf1b2('0x4a')](_0x32867b[_0xf1b2('0x47')],qs[_0xf1b2('0x4c')](_0x123d1e[_0xf1b2('0x48')][_0xf1b2('0x4c')]));_0x2b548[_0xf1b2('0x4b')]=_0x2b548[_0xf1b2('0x4b')][_0xf1b2('0x4d')]?_0x2b548[_0xf1b2('0x4b')]:_0x32867b[_0xf1b2('0x47')];if(!_0x123d1e[_0xf1b2('0x48')][_0xf1b2('0x4e')](_0xf1b2('0x4f'))){_0x2b548[_0xf1b2('0x1c')]=qs[_0xf1b2('0x1c')](_0x123d1e['query'][_0xf1b2('0x1c')]);_0x2b548[_0xf1b2('0x1b')]=qs[_0xf1b2('0x1b')](_0x123d1e['query'][_0xf1b2('0x1b')]);}_0x2b548['order']=qs[_0xf1b2('0x51')](_0x123d1e[_0xf1b2('0x48')][_0xf1b2('0x51')]);_0x2b548['where']=qs[_0xf1b2('0x49')](_[_0xf1b2('0x70')](_0x123d1e[_0xf1b2('0x48')],_0x32867b[_0xf1b2('0x49')]));_0x2b548[_0xf1b2('0x52')][_0xf1b2('0x66')]=_0x564d7d['id'];if(_0x123d1e['query'][_0xf1b2('0x53')]){_0x2b548['where']=_['merge'](_0x2b548[_0xf1b2('0x52')],{'$or':_[_0xf1b2('0x43')](_0x2b548[_0xf1b2('0x4b')],function(_0x52b550){var _0x38609e={};_0x38609e[_0x52b550]={'$like':'%'+_0x123d1e['query'][_0xf1b2('0x53')]+'%'};return _0x38609e;})});}if(_0x123d1e[_0xf1b2('0x48')][_0xf1b2('0x94')]){var _0x540f81=_0x123d1e[_0xf1b2('0x48')][_0xf1b2('0x94')][_0xf1b2('0x95')](',');var _0x18e0e9={};_0x18e0e9[_0x540f81[0x0]]={'$gte':moment(_0x540f81[0x1])[_0xf1b2('0x96')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2b548[_0xf1b2('0x52')]=_[_0xf1b2('0x54')](_0x2b548['where'],_0x18e0e9);}_0x2b548=_[_0xf1b2('0x54')]({},_0x2b548,_0x123d1e['options']);return db['MailMessage'][_0xf1b2('0x1e')]({'where':_0x2b548['where']})[_0xf1b2('0x21')](function(_0x59412f){_0x362e55[_0xf1b2('0x1e')]=_0x59412f;if(_0x123d1e[_0xf1b2('0x48')][_0xf1b2('0x57')]){_0x2b548[_0xf1b2('0x69')]=[{'all':!![]}];}return db[_0xf1b2('0x93')][_0xf1b2('0x6a')](_0x2b548);})[_0xf1b2('0x21')](function(_0x4292b1){if(_0x123d1e[_0xf1b2('0x48')][_0xf1b2('0x97')]==='true'){for(var _0x2615a0=0x0;_0x2615a0<_0x4292b1['length'];_0x2615a0++){_0x4292b1[_0x2615a0]['body']=juice(_0x4292b1[_0x2615a0][_0xf1b2('0x60')]);}}_0x362e55[_0xf1b2('0x58')]=_0x4292b1;return _0x362e55;});}})[_0xf1b2('0x21')](respondWithFilteredResult(_0x40eb63,_0x2b548))[_0xf1b2('0x59')](handleError(_0x40eb63,null));};exports[_0xf1b2('0x28')]=function(_0x18893e,_0x29cd4d){var _0xcfe685,_0x4dd6f3={},_0x51e011;if(_0x18893e[_0xf1b2('0x60')]['to']){_0x51e011=_0x18893e['body']['to'][_0xf1b2('0x95')](',')[0x0];}return db['MailAccount'][_0xf1b2('0x5f')]({'where':{'id':_0x18893e[_0xf1b2('0x5b')]['id']},'include':[{'model':db[_0xf1b2('0x98')],'as':_0xf1b2('0x99'),'include':[{'model':db[_0xf1b2('0x9a')],'as':_0xf1b2('0x9b'),'where':{'email':_0x51e011},'limit':0x1,'order':[['updatedAt',_0xf1b2('0x9c')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf1b2('0x9d')],'as':_0xf1b2('0x9d'),'raw':!![]}]}]})[_0xf1b2('0x21')](handleEntityNotFound(_0x29cd4d,null))[_0xf1b2('0x21')](function(_0x21016a){if(!_0x21016a)return;_0xcfe685=_0x21016a;if(!_0x21016a[_0xf1b2('0x40')])throw new Error(_0xf1b2('0x9e'));if(_['isNil'](_0x18893e[_0xf1b2('0x60')][_0xf1b2('0x9f')])){_0x18893e[_0xf1b2('0x60')][_0xf1b2('0x9f')]=util[_0xf1b2('0x96')](_0xf1b2('0xa0'),_0x21016a['name'],_0x21016a[_0xf1b2('0x73')]||_0x21016a[_0xf1b2('0x40')][_0xf1b2('0x34')]);}if(_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xa1')]&&_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xa1')][_0xf1b2('0x4d')]){for(var _0x7eb87f=0x0;_0x7eb87f<_0x18893e['body']['attachments'][_0xf1b2('0x4d')];_0x7eb87f+=0x1){_0x18893e[_0xf1b2('0x60')]['attachments'][_0x7eb87f]={'filename':_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xa1')][_0x7eb87f][_0xf1b2('0x27')],'path':path[_0xf1b2('0xa2')](config['root'],_0xf1b2('0xa3'),_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xa1')][_0x7eb87f][_0xf1b2('0xa4')])};}}var _0x1929e2=_0x21016a[_0xf1b2('0xa5')]();return respondWithRpcPromise('SendMail',_0xf1b2('0xa6'),{'account':_0x1929e2,'message':_0x18893e['body']});})[_0xf1b2('0x21')](function(_0x36fa83){if(!_0x36fa83)return;_0x4dd6f3=_0x36fa83;if(!_0xcfe685[_0xf1b2('0x99')])throw new Error(_0xf1b2('0xa7'));if(_0xcfe685[_0xf1b2('0x99')][_0xf1b2('0x9b')][_0xf1b2('0x4d')])return _0xcfe685[_0xf1b2('0x99')]['Contacts'][0x0];return db[_0xf1b2('0x9a')][_0xf1b2('0x6e')](_[_0xf1b2('0x7')](_0x18893e[_0xf1b2('0x60')],{'firstName':_0x18893e[_0xf1b2('0x60')]['to'],'email':_0x18893e[_0xf1b2('0x60')]['to'],'phone':_0x18893e[_0xf1b2('0x60')]['to'],'ListId':_0xcfe685[_0xf1b2('0x74')]}));})[_0xf1b2('0x21')](function(_0x219df6){if(!_0x219df6)return;var _0x50f2ec={'UserId':_0x18893e[_0xf1b2('0x34')]['id'],'ContactId':_0x219df6['id'],'MailAccountId':_0xcfe685['id'],'inReplyTo':_0x4dd6f3[_0xf1b2('0xa8')],'to':_0x18893e[_0xf1b2('0x60')][_0xf1b2('0x9f')],'cc':_0x18893e[_0xf1b2('0x60')]['cc'],'subject':_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xa9')],'attach':_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xaa')],'firstMsgDirection':_0xf1b2('0xab'),'lastMsgAt':moment()['format'](_0xf1b2('0xac')),'lastMsgDirection':'out','Messages':[_[_0xf1b2('0x54')](_0x18893e[_0xf1b2('0x60')],{'messageId':_0x4dd6f3[_0xf1b2('0xa8')],'sentAt':moment()[_0xf1b2('0x96')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xcfe685['id'],'UserId':_0x18893e[_0xf1b2('0x34')]['id'],'ContactId':_0x219df6['id']})]};if(_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xad')]){_0x50f2ec=_[_0xf1b2('0x54')](_0x50f2ec,_0x18893e[_0xf1b2('0x60')][_0xf1b2('0xad')]);}return db[_0xf1b2('0x81')][_0xf1b2('0x6e')](_0x50f2ec,{'include':[{'model':db[_0xf1b2('0x93')],'as':_0xf1b2('0xae')}]});})[_0xf1b2('0x21')](respondWithResult(_0x29cd4d,null))[_0xf1b2('0x59')](handleError(_0x29cd4d,null));};exports[_0xf1b2('0xaf')]=function(_0x49fcab,_0x4c121a){return db[_0xf1b2('0x44')][_0xf1b2('0x5f')]({'where':{'id':_0x49fcab[_0xf1b2('0x5b')]['id']},'include':[{'model':db[_0xf1b2('0x62')],'as':_0xf1b2('0x40'),'raw':!![],'include':[{'model':db[_0xf1b2('0x9d')],'as':_0xf1b2('0x9d'),'raw':!![]}]}]})[_0xf1b2('0x21')](handleEntityNotFound(_0x4c121a,null))[_0xf1b2('0x21')](function(_0x368046){if(!_0x368046['Smtp'])return;var _0x1bb5ce=_0x368046[_0xf1b2('0xa5')]();return respondWithRpcPromise(_0xf1b2('0xb0'),_0xf1b2('0xaf'),{'account':_0x1bb5ce});})['then'](respondWithResult(_0x4c121a,null))[_0xf1b2('0x59')](handleError(_0x4c121a,null));};exports['destroy']=function(_0x18aa49,_0x209377){return db['MailAccount'][_0xf1b2('0x5f')]({'where':{'id':_0x18aa49[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x209377,null))[_0xf1b2('0x21')](function(_0x5bcfac){if(_0x5bcfac&&_0x5bcfac[_0xf1b2('0x3d')]){throw new db[(_0xf1b2('0xb1'))]['ValidationError'](_0xf1b2('0xb2'));}return _0x5bcfac;})['then'](removeEntity(_0x209377,null))[_0xf1b2('0x59')](handleError(_0x209377,null));};exports[_0xf1b2('0xb3')]=function(_0x459e10,_0x1bf378){return db[_0xf1b2('0x44')][_0xf1b2('0x5f')]({'where':{'id':_0x459e10[_0xf1b2('0x5b')]['id']}})[_0xf1b2('0x21')](handleEntityNotFound(_0x1bf378,null))[_0xf1b2('0x21')](function(_0x4ce094){if(_0x4ce094){return _0x4ce094[_0xf1b2('0xb3')](_0x459e10[_0xf1b2('0x60')][_0xf1b2('0x6c')],_[_0xf1b2('0x82')](_0x459e10['body'],[_0xf1b2('0x6c'),'id'])||{})['spread'](function(_0x56973a){for(var _0x3ce84c=0x0;_0x3ce84c<_0x459e10[_0xf1b2('0x60')][_0xf1b2('0x6c')][_0xf1b2('0x4d')];_0x3ce84c+=0x1){socket['emit'](_0xf1b2('0xb4'),{'UserId':Number(_0x459e10['body'][_0xf1b2('0x6c')][_0x3ce84c]),'MailAccountId':Number(_0x459e10['params']['id'])});}return _0x56973a;});}})[_0xf1b2('0x21')](respondWithResult(_0x1bf378,null))[_0xf1b2('0x59')](handleError(_0x1bf378,null));};exports[_0xf1b2('0xb5')]=function(_0x527766,_0x224a97){return db[_0xf1b2('0x44')]['find']({'where':{'id':_0x527766['params']['id']}})['then'](handleEntityNotFound(_0x224a97,null))[_0xf1b2('0x21')](function(_0x4bc2c8){if(_0x4bc2c8){return _0x4bc2c8[_0xf1b2('0xb5')](_0x527766['query'][_0xf1b2('0x6c')])[_0xf1b2('0x21')](function(){if(_[_0xf1b2('0xb6')](_0x527766[_0xf1b2('0x48')]['ids'])){for(var _0x3cf7ed=0x0;_0x3cf7ed<_0x527766[_0xf1b2('0x48')]['ids']['length'];_0x3cf7ed+=0x1){socket[_0xf1b2('0xb7')](_0xf1b2('0xb8'),{'UserId':Number(_0x527766[_0xf1b2('0x48')][_0xf1b2('0x6c')][_0x3cf7ed]),'MailAccountId':Number(_0x527766[_0xf1b2('0x5b')]['id'])});}}else{socket[_0xf1b2('0xb7')](_0xf1b2('0xb8'),{'UserId':Number(_0x527766[_0xf1b2('0x48')][_0xf1b2('0x6c')]),'MailAccountId':Number(_0x527766['params']['id'])});}});}})['then'](respondWithStatusCode(_0x224a97,null))[_0xf1b2('0x59')](handleError(_0x224a97,null));};exports[_0xf1b2('0xb9')]=function(_0x36acfa,_0x10fcc8){var _0x3dc4bd={};var _0x4f1365={};var _0x3b1bba;var _0x5d1e9b;return db['MailAccount']['findOne']({'where':{'id':_0x36acfa[_0xf1b2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x10fcc8,null))[_0xf1b2('0x21')](function(_0x291ecf){if(_0x291ecf){_0x3b1bba=_0x291ecf;_0x4f1365[_0xf1b2('0x47')]=_['keys'](db[_0xf1b2('0x85')]['rawAttributes']);_0x4f1365[_0xf1b2('0x48')]=_['keys'](_0x36acfa[_0xf1b2('0x48')]);_0x4f1365[_0xf1b2('0x49')]=_[_0xf1b2('0x4a')](_0x4f1365[_0xf1b2('0x47')],_0x4f1365[_0xf1b2('0x48')]);_0x3dc4bd['attributes']=_['intersection'](_0x4f1365[_0xf1b2('0x47')],qs[_0xf1b2('0x4c')](_0x36acfa[_0xf1b2('0x48')][_0xf1b2('0x4c')]));_0x3dc4bd[_0xf1b2('0x4b')]=_0x3dc4bd[_0xf1b2('0x4b')][_0xf1b2('0x4d')]?_0x3dc4bd[_0xf1b2('0x4b')]:_0x4f1365[_0xf1b2('0x47')];_0x3dc4bd['order']=qs[_0xf1b2('0x51')](_0x36acfa[_0xf1b2('0x48')][_0xf1b2('0x51')]);_0x3dc4bd[_0xf1b2('0x52')]=qs[_0xf1b2('0x49')](_[_0xf1b2('0x70')](_0x36acfa[_0xf1b2('0x48')],_0x4f1365[_0xf1b2('0x49')]));if(_0x36acfa['query'][_0xf1b2('0x53')]){_0x3dc4bd['where']=_[_0xf1b2('0x54')](_0x3dc4bd[_0xf1b2('0x52')],{'$or':_['map'](_0x3dc4bd[_0xf1b2('0x4b')],function(_0x57c5b2){var _0xb499f4={};_0xb499f4[_0x57c5b2]={'$like':'%'+_0x36acfa[_0xf1b2('0x48')][_0xf1b2('0x53')]+'%'};return _0xb499f4;})});}_0x3dc4bd=_['merge']({},_0x3dc4bd,_0x36acfa[_0xf1b2('0x5e')]);return _0x3b1bba[_0xf1b2('0xb9')](_0x3dc4bd);}})['then'](function(_0x19d5fc){if(_0x19d5fc){_0x5d1e9b=_0x19d5fc[_0xf1b2('0x4d')];if(!_0x36acfa['query'][_0xf1b2('0x4e')]('nolimit')){_0x3dc4bd[_0xf1b2('0x1c')]=qs[_0xf1b2('0x1c')](_0x36acfa[_0xf1b2('0x48')][_0xf1b2('0x1c')]);_0x3dc4bd['offset']=qs['offset'](_0x36acfa[_0xf1b2('0x48')][_0xf1b2('0x1b')]);}return _0x3b1bba[_0xf1b2('0xb9')](_0x3dc4bd);}})[_0xf1b2('0x21')](function(_0x36d875){if(_0x36d875){return _0x36d875?{'count':_0x5d1e9b,'rows':_0x36d875}:null;}})[_0xf1b2('0x21')](respondWithResult(_0x10fcc8,null))['catch'](handleError(_0x10fcc8,null));}; \ No newline at end of file +var _0x47d8=['tag','addApplications','transaction','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','stack','getApplications','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','server/files/attachments','getSmtpOptions','sendMail','Contacts','ListId','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','addAgents','spread','emit','removeAgents','getAgents','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','UserProfileResource','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','body','provider','find','Mail\x20Account\x20not\x20found','describe','Disposition','getDispositions','findOne','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','key','custom','email','isNil','active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','autoAssociation','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','getInteractions','rawAttributes','CmContact','User','fullname','internal','Tag','Tags','color'];(function(_0x547af,_0x17abff){var _0x22f7f4=function(_0x5f0384){while(--_0x5f0384){_0x547af['push'](_0x547af['shift']());}};_0x22f7f4(++_0x17abff);}(_0x47d8,0xe4));var _0x847d=function(_0x2be126,_0xaa6e09){_0x2be126=_0x2be126-0x0;var _0x251d06=_0x47d8[_0x2be126];return _0x251d06;};'use strict';var moment=require(_0x847d('0x0'));var BPromise=require(_0x847d('0x1'));var util=require(_0x847d('0x2'));var path=require(_0x847d('0x3'));var _=require('lodash');var juice=require(_0x847d('0x4'));var Redis=require(_0x847d('0x5'));var qs=require(_0x847d('0x6'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x847d('0x7'))['db'];config[_0x847d('0x8')]=_[_0x847d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x847d('0xa'))(new Redis(config[_0x847d('0x8')]));require(_0x847d('0xb'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x847d('0xc')][_0x847d('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x1fceff,_0x4785ae,_0x55c89c,_0x29541b){return new BPromise(function(_0x18a42b,_0x375652){var _0x3e54a1=_0x29541b||client;return _0x3e54a1[_0x847d('0xe')](_0x1fceff,_0x55c89c)[_0x847d('0xf')](function(_0x3ab3b2){logger['info'](_0x847d('0x10'),_0x4785ae,_0x847d('0x11'));logger['debug'](_0x847d('0x12'),_0x4785ae,_0x847d('0x11'),JSON[_0x847d('0x13')](_0x3ab3b2));if(_0x3ab3b2['error']){if(_0x3ab3b2['error']['code']===0x1f4){logger[_0x847d('0x14')]('MailAccount,\x20%s,\x20%s',_0x4785ae,_0x3ab3b2[_0x847d('0x14')]['message']);return _0x375652(_0x3ab3b2['error'][_0x847d('0x15')]);}logger[_0x847d('0x14')](_0x847d('0x10'),_0x4785ae,_0x3ab3b2[_0x847d('0x14')]['message']);return _0x18a42b(_0x3ab3b2[_0x847d('0x14')][_0x847d('0x15')]);}else{logger['info'](_0x847d('0x10'),_0x4785ae,'request\x20sent');_0x18a42b(_0x3ab3b2[_0x847d('0x16')][_0x847d('0x15')]);}})['catch'](function(_0xd35097){logger['error'](_0x847d('0x10'),_0x4785ae,_0xd35097);_0x375652(_0xd35097);});});}function respondWithStatusCode(_0x1a91b0,_0x9b36e9){_0x9b36e9=_0x9b36e9||0xcc;return function(_0x542697){if(_0x542697){return _0x1a91b0[_0x847d('0x17')](_0x9b36e9);}return _0x1a91b0['status'](_0x9b36e9)[_0x847d('0x18')]();};}function respondWithResult(_0x29c901,_0x1b44c8){_0x1b44c8=_0x1b44c8||0xc8;return function(_0x12ea83){if(_0x12ea83){return _0x29c901[_0x847d('0x19')](_0x1b44c8)[_0x847d('0x1a')](_0x12ea83);}};}function respondWithFilteredResult(_0x5e4f02,_0x1087c7){return function(_0x4c9d9a){if(_0x4c9d9a){var _0x279265=typeof _0x1087c7[_0x847d('0x1b')]===_0x847d('0x1c')&&typeof _0x1087c7[_0x847d('0x1d')]===_0x847d('0x1c');var _0xe3eb5f=_0x4c9d9a['count'];var _0x5b84d9=_0x279265?0x0:_0x1087c7[_0x847d('0x1b')];var _0x4cb8bd=_0x279265?_0x4c9d9a[_0x847d('0x1e')]:_0x1087c7[_0x847d('0x1b')]+_0x1087c7[_0x847d('0x1d')];var _0x37c52c;if(_0x4cb8bd>=_0xe3eb5f){_0x4cb8bd=_0xe3eb5f;_0x37c52c=0xc8;}else{_0x37c52c=0xce;}_0x5e4f02[_0x847d('0x19')](_0x37c52c);return _0x5e4f02[_0x847d('0x1f')](_0x847d('0x20'),_0x5b84d9+'-'+_0x4cb8bd+'/'+_0xe3eb5f)[_0x847d('0x1a')](_0x4c9d9a);}return null;};}function saveUpdates(_0x20dff4){return function(_0x21a41f){if(_0x21a41f){return _0x21a41f[_0x847d('0x21')](_0x20dff4)[_0x847d('0xf')](function(_0x20a68b){return _0x20a68b;});}return null;};}function removeEntity(_0x3b8419){return function(_0x3ba7d6){if(_0x3ba7d6){return _0x3ba7d6[_0x847d('0x22')]()['then'](function(){var _0x50e831=_0x3ba7d6['get']({'plain':!![]});var _0x351b1='MailAccounts';return db[_0x847d('0x23')][_0x847d('0x22')]({'where':{'type':_0x351b1,'resourceId':_0x50e831['id']}})['then'](function(){return _0x3ba7d6;});})[_0x847d('0xf')](function(){_0x3b8419[_0x847d('0x19')](0xcc)[_0x847d('0x18')]();});}};}function handleEntityNotFound(_0x2abfa7){return function(_0x28e2a6){if(!_0x28e2a6){_0x2abfa7['sendStatus'](0x194);}return _0x28e2a6;};}function handleError(_0x20afb3,_0x548a5b){_0x548a5b=_0x548a5b||0x1f4;return function(_0x19789d){logger['error'](_0x19789d['stack']);if(_0x19789d[_0x847d('0x24')]){delete _0x19789d[_0x847d('0x24')];}_0x20afb3[_0x847d('0x19')](_0x548a5b)[_0x847d('0x25')](_0x19789d);};}function getImapHost(_0x2a5d8b){switch(_0x2a5d8b){case _0x847d('0x26'):return _0x847d('0x27');case _0x847d('0x28'):return _0x847d('0x29');case _0x847d('0x2a'):return _0x847d('0x2b');case _0x847d('0x2c'):return'outlook.office365.com';}throw new Error(_0x847d('0x2d'),_0x2a5d8b);}function getSmtpHost(_0x35a3fe){switch(_0x35a3fe){case _0x847d('0x26'):return _0x847d('0x2e');case'yahoo':return _0x847d('0x2f');case _0x847d('0x2a'):return _0x847d('0x30');case'outlook365':return _0x847d('0x31');}throw new Error('Unknown\x20email\x20service\x20provider',_0x35a3fe);}function getAuthenticationOptions(_0x179d91,_0x5bff2d){var _0xb2d981={};var _0x511c07={};if(_0x179d91){_0xb2d981[_0x847d('0x32')]=_0x511c07['user']=_0x5bff2d[_0x847d('0x33')];_0xb2d981[_0x847d('0x34')]=_0x511c07['pass']=_0x5bff2d[_0x847d('0x34')];if(_0x5bff2d[_0x847d('0x35')]){_0xb2d981[_0x847d('0x35')]=_0x511c07[_0x847d('0x35')]=!![];_0xb2d981['CloudProviderId']=_0x511c07[_0x847d('0x36')]=_0x5bff2d[_0x847d('0x36')];_0xb2d981[_0x847d('0x34')]=_0x511c07[_0x847d('0x37')]=null;}else{_0xb2d981['CloudProviderId']=_0x511c07[_0x847d('0x36')]=null;}_0xb2d981[_0x847d('0x38')]=getImapHost(_0x179d91);_0xb2d981[_0x847d('0x39')]=0x3e1;_0x511c07['host']=getSmtpHost(_0x179d91);_0x511c07['port']=0x24b;_0x511c07[_0x847d('0x3a')]=![];_0xb2d981[_0x847d('0x3b')]=_0x511c07[_0x847d('0x3b')]=null;}else{if(_0x5bff2d[_0x847d('0x3c')]){_0xb2d981['user']=_0x511c07[_0x847d('0x32')]=_0x5bff2d[_0x847d('0x33')];_0xb2d981[_0x847d('0x34')]=_0x511c07[_0x847d('0x37')]=_0x5bff2d[_0x847d('0x34')];}else{_0xb2d981[_0x847d('0x3c')]=_0x511c07[_0x847d('0x3c')]=![];_0xb2d981[_0x847d('0x32')]=_0x511c07['user']=null;_0xb2d981['password']=_0x511c07[_0x847d('0x37')]=null;}_0xb2d981[_0x847d('0x38')]=_0x5bff2d[_0x847d('0x3d')][_0x847d('0x38')];_0xb2d981['port']=_0x5bff2d[_0x847d('0x3d')][_0x847d('0x39')];_0x511c07[_0x847d('0x38')]=_0x5bff2d['Smtp'][_0x847d('0x38')];_0x511c07[_0x847d('0x39')]=_0x5bff2d[_0x847d('0x3e')][_0x847d('0x39')];}return{'Imap':_0xb2d981,'Smtp':_0x511c07};}exports['index']=function(_0x353a25,_0x2335be){var _0x44aea6={'include':[{'model':db[_0x847d('0x3f')],'as':'Imap'},{'model':db[_0x847d('0x40')],'as':_0x847d('0x3e')},{'model':db[_0x847d('0x41')],'as':_0x847d('0x42')}]},_0x2f0c01={},_0x534623={'count':0x0,'rows':[]};var _0x29cac8=_[_0x847d('0x43')](db[_0x847d('0x44')]['rawAttributes'],function(_0x22b2b3){return{'name':_0x22b2b3[_0x847d('0x45')],'type':_0x22b2b3[_0x847d('0x46')]['key']};});_0x2f0c01['model']=_[_0x847d('0x43')](_0x29cac8,_0x847d('0x24'));_0x2f0c01[_0x847d('0x47')]=_[_0x847d('0x48')](_0x353a25[_0x847d('0x47')]);_0x2f0c01[_0x847d('0x49')]=_[_0x847d('0x4a')](_0x2f0c01['model'],_0x2f0c01['query']);_0x44aea6['attributes']=_['intersection'](_0x2f0c01[_0x847d('0x4b')],qs[_0x847d('0x4c')](_0x353a25[_0x847d('0x47')][_0x847d('0x4c')]));_0x44aea6[_0x847d('0x4d')]=_0x44aea6['attributes']['length']?_0x44aea6[_0x847d('0x4d')]:_0x2f0c01[_0x847d('0x4b')];if(!_0x353a25[_0x847d('0x47')][_0x847d('0x4e')](_0x847d('0x4f'))){_0x44aea6[_0x847d('0x1d')]=qs[_0x847d('0x1d')](_0x353a25[_0x847d('0x47')]['limit']);_0x44aea6['offset']=qs['offset'](_0x353a25['query'][_0x847d('0x1b')]);}_0x44aea6[_0x847d('0x50')]=qs[_0x847d('0x51')](_0x353a25[_0x847d('0x47')][_0x847d('0x51')]);_0x44aea6['where']=qs[_0x847d('0x49')](_[_0x847d('0x52')](_0x353a25[_0x847d('0x47')],_0x2f0c01[_0x847d('0x49')]),_0x29cac8);if(_0x353a25['query']['filter']){_0x44aea6[_0x847d('0x53')]=_[_0x847d('0x54')](_0x44aea6[_0x847d('0x53')],{'$or':_[_0x847d('0x43')](_0x29cac8,function(_0x16c28d){if(_0x16c28d[_0x847d('0x46')]!==_0x847d('0x55')){var _0x33f84c={};_0x33f84c[_0x16c28d[_0x847d('0x24')]]={'$like':'%'+_0x353a25[_0x847d('0x47')][_0x847d('0x56')]+'%'};return _0x33f84c;}})});}_0x44aea6=_[_0x847d('0x54')]({},_0x44aea6,_0x353a25[_0x847d('0x57')]);var _0x2726e6={'where':_0x44aea6['where']};return db['MailAccount'][_0x847d('0x1e')](_0x2726e6)['then'](function(_0x274925){_0x534623[_0x847d('0x1e')]=_0x274925;if(_0x353a25[_0x847d('0x47')][_0x847d('0x58')]){_0x44aea6['include']=[{'all':!![]}];}return db[_0x847d('0x44')][_0x847d('0x59')](_0x44aea6);})[_0x847d('0xf')](function(_0x258220){_0x534623[_0x847d('0x5a')]=_0x258220;return _0x534623;})[_0x847d('0xf')](respondWithFilteredResult(_0x2335be,_0x44aea6))[_0x847d('0x5b')](handleError(_0x2335be,null));};exports[_0x847d('0x5c')]=function(_0x3c89fb,_0x2668f5){var _0x171e39={'raw':![],'where':{'id':_0x3c89fb[_0x847d('0x5d')]['id']},'include':[{'model':db[_0x847d('0x3f')],'as':_0x847d('0x3d')},{'model':db[_0x847d('0x40')],'as':_0x847d('0x3e')},{'model':db[_0x847d('0x41')],'as':'mandatoryDispositionPause'}]},_0x64a188={};_0x64a188[_0x847d('0x4b')]=_[_0x847d('0x48')](db['MailAccount']['rawAttributes']);_0x64a188[_0x847d('0x47')]=_[_0x847d('0x48')](_0x3c89fb[_0x847d('0x47')]);_0x64a188[_0x847d('0x49')]=_['intersection'](_0x64a188['model'],_0x64a188[_0x847d('0x47')]);_0x171e39['attributes']=_['intersection'](_0x64a188['model'],qs[_0x847d('0x4c')](_0x3c89fb[_0x847d('0x47')][_0x847d('0x4c')]));_0x171e39['attributes']=_0x171e39[_0x847d('0x4d')][_0x847d('0x5e')]?_0x171e39[_0x847d('0x4d')]:_0x64a188[_0x847d('0x4b')];if(_0x3c89fb['query'][_0x847d('0x58')]){_0x171e39[_0x847d('0x5f')]=[{'all':!![]}];}_0x171e39=_[_0x847d('0x54')]({},_0x171e39,_0x3c89fb[_0x847d('0x57')]);return db[_0x847d('0x44')]['find'](_0x171e39)[_0x847d('0xf')](handleEntityNotFound(_0x2668f5,null))[_0x847d('0xf')](respondWithResult(_0x2668f5,null))[_0x847d('0x5b')](handleError(_0x2668f5,null));};exports[_0x847d('0x21')]=function(_0x3e48d3,_0x29698a){if(_0x3e48d3[_0x847d('0x60')]['id']){delete _0x3e48d3[_0x847d('0x60')]['id'];}var _0x289f32=_0x3e48d3[_0x847d('0x60')][_0x847d('0x61')]==='custom'?null:_0x3e48d3[_0x847d('0x60')][_0x847d('0x61')];var _0x5ad981=_0x3e48d3[_0x847d('0x60')][_0x847d('0x3d')]||{};var _0x988000=_0x3e48d3[_0x847d('0x60')]['Smtp']||{};if(_0x289f32){_0x5ad981[_0x847d('0x38')]=getImapHost(_0x289f32);_0x5ad981['port']=0x3e1;_0x988000['host']=getSmtpHost(_0x289f32);_0x988000[_0x847d('0x39')]=0x24b;_0x988000[_0x847d('0x3a')]=![];}if(_0x988000[_0x847d('0x35')]){_0x988000[_0x847d('0x3a')]=![];}else{_0x988000[_0x847d('0x36')]=null;}if(!_0x5ad981[_0x847d('0x35')])_0x5ad981[_0x847d('0x36')]=null;_0x3e48d3[_0x847d('0x60')][_0x847d('0x3d')]=_0x5ad981;_0x3e48d3[_0x847d('0x60')][_0x847d('0x3e')]=_0x988000;return db[_0x847d('0x44')][_0x847d('0x62')]({'where':{'id':_0x3e48d3[_0x847d('0x5d')]['id']},'include':[{'model':db[_0x847d('0x3f')],'as':_0x847d('0x3d')},{'model':db['MailServerOut'],'as':_0x847d('0x3e')},{'model':db[_0x847d('0x41')],'as':_0x847d('0x42')}]})['then'](handleEntityNotFound(_0x29698a,null))['then'](function(_0x43a017){if(!_0x43a017)throw new Error(_0x847d('0x63'));if(_0x43a017[_0x847d('0x3b')])delete _0x3e48d3[_0x847d('0x60')][_0x847d('0x3d')];return _0x43a017;})['then'](saveUpdates(_0x3e48d3['body'],null))[_0x847d('0xf')](function(_0x4530bd){if(!_0x3e48d3[_0x847d('0x60')]['Imap'])return _0x4530bd;return db[_0x847d('0x3f')]['update'](_0x3e48d3['body'][_0x847d('0x3d')],{'where':{'MailAccountId':_0x4530bd['id']}})[_0x847d('0xf')](function(){return _0x4530bd;});})[_0x847d('0xf')](function(_0x1df1db){if(!_0x3e48d3[_0x847d('0x60')][_0x847d('0x3e')])return _0x1df1db;return db['MailServerOut'][_0x847d('0x21')](_0x3e48d3[_0x847d('0x60')][_0x847d('0x3e')],{'where':{'MailAccountId':_0x1df1db['id']}})['then'](function(){return _0x1df1db;});})[_0x847d('0xf')](respondWithResult(_0x29698a,null))[_0x847d('0x5b')](handleError(_0x29698a,null));};exports[_0x847d('0x64')]=function(_0x2f8bee,_0xef490){return db[_0x847d('0x44')][_0x847d('0x64')]()['then'](respondWithResult(_0xef490,null))['catch'](handleError(_0xef490,null));};exports['addDisposition']=function(_0x5700de,_0x5964ed){if(_0x5700de['body']['id']){delete _0x5700de[_0x847d('0x60')]['id'];}return db['MailAccount'][_0x847d('0x62')]({'where':{'id':_0x5700de[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x5964ed,null))[_0x847d('0xf')](function(_0x37d4fe){if(_0x37d4fe){_0x5700de[_0x847d('0x60')]['MailAccountId']=_0x37d4fe['id'];return db[_0x847d('0x65')]['create'](_0x5700de['body']);}})[_0x847d('0xf')](respondWithResult(_0x5964ed,null))[_0x847d('0x5b')](handleError(_0x5964ed,null));};exports[_0x847d('0x66')]=function(_0x3555f4,_0x35b5d0){var _0x4b2f90={'raw':![],'where':{}};var _0x48f4de={};var _0x4ce191={'count':0x0,'rows':[]};return db['MailAccount'][_0x847d('0x67')]({'where':{'id':_0x3555f4[_0x847d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x35b5d0,null))['then'](function(_0x468e69){if(_0x468e69){_0x48f4de[_0x847d('0x4b')]=_[_0x847d('0x48')](db['Disposition']['rawAttributes']);_0x48f4de[_0x847d('0x47')]=_[_0x847d('0x48')](_0x3555f4[_0x847d('0x47')]);_0x48f4de[_0x847d('0x49')]=_['intersection'](_0x48f4de[_0x847d('0x4b')],_0x48f4de[_0x847d('0x47')]);_0x4b2f90[_0x847d('0x4d')]=_[_0x847d('0x4a')](_0x48f4de[_0x847d('0x4b')],qs[_0x847d('0x4c')](_0x3555f4['query'][_0x847d('0x4c')]));_0x4b2f90[_0x847d('0x4d')]=_0x4b2f90['attributes'][_0x847d('0x5e')]?_0x4b2f90[_0x847d('0x4d')]:_0x48f4de[_0x847d('0x4b')];if(!_0x3555f4[_0x847d('0x47')][_0x847d('0x4e')](_0x847d('0x4f'))){_0x4b2f90[_0x847d('0x1d')]=qs[_0x847d('0x1d')](_0x3555f4[_0x847d('0x47')][_0x847d('0x1d')]);_0x4b2f90[_0x847d('0x1b')]=qs[_0x847d('0x1b')](_0x3555f4[_0x847d('0x47')]['offset']);}_0x4b2f90[_0x847d('0x50')]=qs[_0x847d('0x51')](_0x3555f4[_0x847d('0x47')][_0x847d('0x51')]);_0x4b2f90[_0x847d('0x53')]=qs[_0x847d('0x49')](_[_0x847d('0x52')](_0x3555f4[_0x847d('0x47')],_0x48f4de[_0x847d('0x49')]));_0x4b2f90[_0x847d('0x53')][_0x847d('0x68')]=_0x468e69['id'];if(_0x3555f4[_0x847d('0x47')][_0x847d('0x56')]){_0x4b2f90[_0x847d('0x53')]=_[_0x847d('0x54')](_0x4b2f90[_0x847d('0x53')],{'$or':_[_0x847d('0x43')](_0x4b2f90[_0x847d('0x4d')],function(_0x2f5409){var _0x300b2d={};_0x300b2d[_0x2f5409]={'$like':'%'+_0x3555f4[_0x847d('0x47')]['filter']+'%'};return _0x300b2d;})});}_0x4b2f90=_[_0x847d('0x54')]({},_0x4b2f90,_0x3555f4['options']);return db[_0x847d('0x65')][_0x847d('0x1e')]({'where':_0x4b2f90[_0x847d('0x53')]})[_0x847d('0xf')](function(_0x9e0c5c){_0x4ce191['count']=_0x9e0c5c;if(_0x3555f4[_0x847d('0x47')][_0x847d('0x58')]){_0x4b2f90['include']=[{'all':!![]}];}return db[_0x847d('0x65')][_0x847d('0x59')](_0x4b2f90);})[_0x847d('0xf')](function(_0x25896b){_0x4ce191[_0x847d('0x5a')]=_0x25896b;return _0x4ce191;});}})[_0x847d('0xf')](respondWithFilteredResult(_0x35b5d0,_0x4b2f90))['catch'](handleError(_0x35b5d0,null));};exports[_0x847d('0x69')]=function(_0x179918,_0x3530b0){return db[_0x847d('0x44')]['find']({'where':{'id':_0x179918[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x3530b0,null))[_0x847d('0xf')](function(_0x29e095){if(_0x29e095){return _0x29e095[_0x847d('0x69')](_0x179918['query'][_0x847d('0x6a')]);}})[_0x847d('0xf')](respondWithStatusCode(_0x3530b0,null))[_0x847d('0x5b')](handleError(_0x3530b0,null));};exports[_0x847d('0x6b')]=function(_0x5dd1fe,_0x33de1b){if(_0x5dd1fe[_0x847d('0x60')]['id']){delete _0x5dd1fe[_0x847d('0x60')]['id'];}return db[_0x847d('0x44')]['find']({'where':{'id':_0x5dd1fe['params']['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x33de1b,null))[_0x847d('0xf')](function(_0x24d9df){if(_0x24d9df){_0x5dd1fe[_0x847d('0x60')][_0x847d('0x68')]=_0x24d9df['id'];return db[_0x847d('0x6c')][_0x847d('0x6d')](_0x5dd1fe[_0x847d('0x60')]);}})[_0x847d('0xf')](respondWithResult(_0x33de1b,null))[_0x847d('0x5b')](handleError(_0x33de1b,null));};exports[_0x847d('0x6e')]=function(_0x48b8a5,_0x5ba993){var _0x156039={'raw':![],'where':{}};var _0x5a73ed={};var _0x3bf5d7={'count':0x0,'rows':[]};return db['MailAccount'][_0x847d('0x67')]({'where':{'id':_0x48b8a5[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x5ba993,null))[_0x847d('0xf')](function(_0x3cbb47){if(_0x3cbb47){_0x5a73ed[_0x847d('0x4b')]=_[_0x847d('0x48')](db['CannedAnswer']['rawAttributes']);_0x5a73ed[_0x847d('0x47')]=_['keys'](_0x48b8a5['query']);_0x5a73ed[_0x847d('0x49')]=_[_0x847d('0x4a')](_0x5a73ed[_0x847d('0x4b')],_0x5a73ed[_0x847d('0x47')]);_0x156039[_0x847d('0x4d')]=_[_0x847d('0x4a')](_0x5a73ed['model'],qs[_0x847d('0x4c')](_0x48b8a5[_0x847d('0x47')][_0x847d('0x4c')]));_0x156039[_0x847d('0x4d')]=_0x156039[_0x847d('0x4d')][_0x847d('0x5e')]?_0x156039['attributes']:_0x5a73ed['model'];if(!_0x48b8a5['query'][_0x847d('0x4e')](_0x847d('0x4f'))){_0x156039[_0x847d('0x1d')]=qs[_0x847d('0x1d')](_0x48b8a5[_0x847d('0x47')][_0x847d('0x1d')]);_0x156039[_0x847d('0x1b')]=qs['offset'](_0x48b8a5[_0x847d('0x47')][_0x847d('0x1b')]);}_0x156039[_0x847d('0x50')]=qs[_0x847d('0x51')](_0x48b8a5['query']['sort']);_0x156039[_0x847d('0x53')]=qs[_0x847d('0x49')](_[_0x847d('0x52')](_0x48b8a5['query'],_0x5a73ed['filters']));_0x156039[_0x847d('0x53')]['MailAccountId']=_0x3cbb47['id'];if(_0x48b8a5[_0x847d('0x47')][_0x847d('0x56')]){_0x156039[_0x847d('0x53')]=_['merge'](_0x156039[_0x847d('0x53')],{'$or':_[_0x847d('0x43')](_0x156039[_0x847d('0x4d')],function(_0x379ffd){var _0x33ca4d={};_0x33ca4d[_0x379ffd]={'$like':'%'+_0x48b8a5[_0x847d('0x47')]['filter']+'%'};return _0x33ca4d;})});}_0x156039=_[_0x847d('0x54')]({},_0x156039,_0x48b8a5[_0x847d('0x57')]);return db[_0x847d('0x6c')][_0x847d('0x1e')]({'where':_0x156039['where']})[_0x847d('0xf')](function(_0x997a3a){_0x3bf5d7[_0x847d('0x1e')]=_0x997a3a;if(_0x48b8a5['query'][_0x847d('0x58')]){_0x156039[_0x847d('0x5f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x847d('0x59')](_0x156039);})[_0x847d('0xf')](function(_0x4f0326){_0x3bf5d7[_0x847d('0x5a')]=_0x4f0326;return _0x3bf5d7;});}})[_0x847d('0xf')](respondWithFilteredResult(_0x5ba993,_0x156039))[_0x847d('0x5b')](handleError(_0x5ba993,null));};exports[_0x847d('0x6f')]=function(_0x80dfae,_0x1b97e6){return db[_0x847d('0x44')][_0x847d('0x62')]({'where':{'id':_0x80dfae[_0x847d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1b97e6,null))[_0x847d('0xf')](function(_0x59d945){if(_0x59d945){return _0x59d945[_0x847d('0x6f')](_0x80dfae[_0x847d('0x47')][_0x847d('0x6a')]);}})[_0x847d('0xf')](respondWithStatusCode(_0x1b97e6,null))[_0x847d('0x5b')](handleError(_0x1b97e6,null));};exports[_0x847d('0x6d')]=function(_0x27d98a,_0x587a3d){var _0x7982d2={'name':_0x27d98a[_0x847d('0x60')][_0x847d('0x24')],'key':_0x27d98a[_0x847d('0x60')][_0x847d('0x70')],'provider':_0x27d98a[_0x847d('0x60')][_0x847d('0x61')]===_0x847d('0x71')?null:_0x27d98a[_0x847d('0x60')][_0x847d('0x61')],'email':_0x27d98a[_0x847d('0x60')][_0x847d('0x72')],'ListId':_0x27d98a[_0x847d('0x60')]['ListId'],'active':!_[_0x847d('0x73')](_0x27d98a[_0x847d('0x60')][_0x847d('0x74')])?_0x27d98a[_0x847d('0x60')][_0x847d('0x74')]:!![],'description':_0x27d98a['body'][_0x847d('0x75')]||null};var _0x338c36=getAuthenticationOptions(_0x7982d2[_0x847d('0x61')],_0x27d98a['body']);_0x7982d2[_0x847d('0x3d')]=_0x338c36[_0x847d('0x3d')];_0x7982d2[_0x847d('0x3e')]=_0x338c36[_0x847d('0x3e')];return db[_0x847d('0x44')][_0x847d('0x6d')](_0x7982d2,{'include':[{'model':db[_0x847d('0x40')],'as':_0x847d('0x3e')},{'model':db[_0x847d('0x3f')],'as':_0x847d('0x3d')}]})[_0x847d('0xf')](function(_0x3b4c4e){var _0x584ed6=_0x27d98a[_0x847d('0x32')][_0x847d('0x76')]({'plain':!![]});if(!_0x584ed6)throw new Error(_0x847d('0x77'));if(_0x584ed6[_0x847d('0x78')]===_0x847d('0x32')){var _0x12eb95=_0x3b4c4e['get']({'plain':!![]});return db[_0x847d('0x79')]['find']({'where':{'name':_0x847d('0x7a'),'userProfileId':_0x584ed6['userProfileId']},'raw':!![]})[_0x847d('0xf')](function(_0x3e60c6){if(_0x3e60c6&&_0x3e60c6[_0x847d('0x7b')]===0x0){return db[_0x847d('0x23')]['create']({'name':_0x12eb95['name'],'resourceId':_0x12eb95['id'],'type':_0x3e60c6[_0x847d('0x24')],'sectionId':_0x3e60c6['id']},{})[_0x847d('0xf')](function(){return _0x3b4c4e;});}else{return _0x3b4c4e;}})[_0x847d('0x5b')](function(_0x416287){logger[_0x847d('0x14')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x416287);throw _0x416287;});}return _0x3b4c4e;})['then'](respondWithResult(_0x587a3d,0xc9))[_0x847d('0x5b')](handleError(_0x587a3d,null));};exports[_0x847d('0x7c')]=function(_0x5f0376,_0x2b6693){return db[_0x847d('0x44')]['findOne']({'where':{'id':_0x5f0376[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x2b6693,null))[_0x847d('0xf')](function(_0x2ad4fd){if(_0x2ad4fd){return _0x2ad4fd[_0x847d('0x7c')]();}return null;})['then'](respondWithResult(_0x2b6693,null))[_0x847d('0x5b')](handleError(_0x2b6693,null));};exports[_0x847d('0x7d')]=function(_0x57f910,_0x409e87){if(_0x57f910[_0x847d('0x60')]['id']){delete _0x57f910[_0x847d('0x60')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x57f910[_0x847d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x409e87,null))[_0x847d('0xf')](function(_0xb8056d){if(_0xb8056d){_0x57f910[_0x847d('0x60')]['MailAccountId']=_0xb8056d['id'];return db[_0x847d('0x3f')][_0x847d('0x6d')](_0x57f910['body']);}})[_0x847d('0xf')](respondWithResult(_0x409e87,null))[_0x847d('0x5b')](handleError(_0x409e87,null));};exports['removeImap']=function(_0x3232c6,_0x28811d){return db[_0x847d('0x44')]['findOne']({'where':{'id':_0x3232c6['params']['id']}})['then'](handleEntityNotFound(_0x28811d,null))['then'](function(_0x1bc4c4){if(_0x1bc4c4){return _0x1bc4c4[_0x847d('0x7e')](null);}return null;})['then'](respondWithStatusCode(_0x28811d,null))[_0x847d('0x5b')](handleError(_0x28811d,null));};exports[_0x847d('0x7f')]=function(_0x22600c,_0xbacb14){return db[_0x847d('0x44')][_0x847d('0x67')]({'where':{'id':_0x22600c['params']['id']}})[_0x847d('0xf')](handleEntityNotFound(_0xbacb14,null))['then'](function(_0x5a4494){if(_0x5a4494){return _0x5a4494[_0x847d('0x7f')]();}return null;})[_0x847d('0xf')](respondWithResult(_0xbacb14,null))['catch'](handleError(_0xbacb14,null));};exports[_0x847d('0x80')]=function(_0x49bdca,_0x4de51f){if(_0x49bdca[_0x847d('0x60')]['id']){delete _0x49bdca[_0x847d('0x60')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x49bdca[_0x847d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4de51f,null))['then'](function(_0x407bfa){if(_0x407bfa){_0x49bdca[_0x847d('0x60')][_0x847d('0x68')]=_0x407bfa['id'];return db[_0x847d('0x40')][_0x847d('0x6d')](_0x49bdca['body']);}})[_0x847d('0xf')](respondWithResult(_0x4de51f,null))[_0x847d('0x5b')](handleError(_0x4de51f,null));};exports[_0x847d('0x81')]=function(_0x471a96,_0x2b8f4d){return db[_0x847d('0x44')][_0x847d('0x67')]({'where':{'id':_0x471a96[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x2b8f4d,null))[_0x847d('0xf')](function(_0x54798a){if(_0x54798a){return _0x54798a['setSmtp'](null);}return null;})[_0x847d('0xf')](respondWithStatusCode(_0x2b8f4d,null))[_0x847d('0x5b')](handleError(_0x2b8f4d,null));};exports['addInteraction']=function(_0x42d5d7,_0x1474e0){return db[_0x847d('0x82')][_0x847d('0x62')]({'where':{'id':_0x42d5d7[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x1474e0,null))[_0x847d('0xf')](function(_0x1df67d){if(_0x1df67d){return _0x1df67d[_0x847d('0x83')](_0x42d5d7[_0x847d('0x60')][_0x847d('0x6a')],_[_0x847d('0x84')](_0x42d5d7[_0x847d('0x60')],['ids','id'])||{});}})[_0x847d('0xf')](respondWithResult(_0x1474e0,null))[_0x847d('0x5b')](handleError(_0x1474e0,null));};exports[_0x847d('0x85')]=function(_0x2da802,_0x341952){var _0x314443={'raw':![],'where':{}};var _0x5f1377={};var _0x53b9e0={'count':0x0,'rows':[]};return db[_0x847d('0x44')][_0x847d('0x67')]({'where':{'id':_0x2da802[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x341952,null))[_0x847d('0xf')](function(_0xfd70c2){if(_0xfd70c2){_0x5f1377[_0x847d('0x4b')]=_[_0x847d('0x48')](db[_0x847d('0x82')][_0x847d('0x86')]);_0x5f1377[_0x847d('0x47')]=_['keys'](_0x2da802[_0x847d('0x47')]);_0x5f1377['filters']=_[_0x847d('0x4a')](_0x5f1377['model'],_0x5f1377[_0x847d('0x47')]);_0x314443[_0x847d('0x4d')]=_[_0x847d('0x4a')](_0x5f1377[_0x847d('0x4b')],qs[_0x847d('0x4c')](_0x2da802[_0x847d('0x47')][_0x847d('0x4c')]));_0x314443[_0x847d('0x4d')]=_0x314443['attributes'][_0x847d('0x5e')]?_0x314443[_0x847d('0x4d')]:_0x5f1377[_0x847d('0x4b')];if(!_0x2da802[_0x847d('0x47')][_0x847d('0x4e')](_0x847d('0x4f'))){_0x314443['limit']=qs[_0x847d('0x1d')](_0x2da802[_0x847d('0x47')][_0x847d('0x1d')]);_0x314443[_0x847d('0x1b')]=qs[_0x847d('0x1b')](_0x2da802[_0x847d('0x47')]['offset']);}_0x314443['order']=qs[_0x847d('0x51')](_0x2da802[_0x847d('0x47')]['sort']);_0x314443[_0x847d('0x53')]=qs[_0x847d('0x49')](_[_0x847d('0x52')](_0x2da802[_0x847d('0x47')],_0x5f1377[_0x847d('0x49')]));_0x314443[_0x847d('0x53')]['MailAccountId']=_0xfd70c2['id'];if(_0x2da802[_0x847d('0x47')][_0x847d('0x56')]){_0x314443[_0x847d('0x53')]=_[_0x847d('0x54')](_0x314443[_0x847d('0x53')],{'$or':_[_0x847d('0x43')](_0x314443[_0x847d('0x4d')],function(_0x148c3b){var _0x1ed6b2={};_0x1ed6b2[_0x148c3b]={'$like':'%'+_0x2da802[_0x847d('0x47')][_0x847d('0x56')]+'%'};return _0x1ed6b2;})});}_0x314443=_[_0x847d('0x54')]({},_0x314443,_0x2da802[_0x847d('0x57')]);return db[_0x847d('0x82')]['count']({'where':_0x314443[_0x847d('0x53')]})[_0x847d('0xf')](function(_0x32a563){_0x53b9e0[_0x847d('0x1e')]=_0x32a563;if(_0x2da802[_0x847d('0x47')][_0x847d('0x58')]){_0x314443['include']=[{'model':db[_0x847d('0x87')],'as':'Contact','required':![]},{'model':db[_0x847d('0x88')],'as':'Owner','attributes':[_0x847d('0x24'),_0x847d('0x89'),_0x847d('0x8a')],'required':![]},{'model':db[_0x847d('0x8b')],'as':_0x847d('0x8c'),'attributes':['id',_0x847d('0x24'),_0x847d('0x8d')],'where':_0x2da802['query'][_0x847d('0x8e')]?{'id':_0x2da802[_0x847d('0x47')]['tag']}:undefined,'required':_0x2da802[_0x847d('0x47')]['tag']?!![]:![]}];}return db[_0x847d('0x82')][_0x847d('0x59')](_0x314443);})['then'](function(_0x502757){_0x53b9e0[_0x847d('0x5a')]=_0x502757;return _0x53b9e0;});}})[_0x847d('0xf')](respondWithFilteredResult(_0x341952,_0x314443))[_0x847d('0x5b')](handleError(_0x341952,null));};exports[_0x847d('0x8f')]=function addApplications(_0x69e7fa,_0x1ccc64){var _0x4d80e8=_0x69e7fa[_0x847d('0x5d')]['id'];var _0x2b6d56=_0x69e7fa[_0x847d('0x60')];var _0x1e0c6f=0xc8;var _0x24f10c=null;return db['sequelize'][_0x847d('0x90')]({'isolationLevel':db['sequelize'][_0x847d('0x91')]['ISOLATION_LEVELS'][_0x847d('0x92')]},function(_0x29fa3a){return db['MailAccount'][_0x847d('0x67')]({'where':{'id':_0x4d80e8},'transaction':_0x29fa3a})[_0x847d('0xf')](function(_0x3203a0){if(_0x3203a0){return db['MailApplication'][_0x847d('0x22')]({'where':{'MailAccountId':_0x4d80e8},'transaction':_0x29fa3a})['then'](function(){var _0x365142=_[_0x847d('0x43')](_0x2b6d56,function(_0x5030c0){_0x5030c0[_0x847d('0x68')]=_0x4d80e8;return _0x5030c0;});return db['MailApplication']['bulkCreate'](_0x365142,{'transaction':_0x29fa3a});});}else{_0x1e0c6f=0x194;_0x24f10c=[];}});})['then'](function(){if(_0x1e0c6f!==0x194){return db[_0x847d('0x93')][_0x847d('0x94')]({'where':{'MailAccountId':_0x4d80e8},'order':_0x847d('0x95')})[_0x847d('0xf')](function(_0x21dcbd){_0x24f10c=_0x21dcbd;});}})[_0x847d('0x5b')](function(_0x3216bc){_0x1e0c6f=0x1f4;logger['error'](_0x3216bc[_0x847d('0x96')]);if(_0x3216bc['name']){delete _0x3216bc[_0x847d('0x24')];}_0x24f10c=_0x3216bc;})['finally'](function(){if(_0x24f10c===null){_0x1ccc64[_0x847d('0x17')](_0x1e0c6f);}else{if(_0x1e0c6f===0x1f4){_0x1ccc64[_0x847d('0x19')](_0x1e0c6f)[_0x847d('0x25')](_0x24f10c);}else{_0x1ccc64['status'](_0x1e0c6f)[_0x847d('0x1a')](_0x24f10c);}}});};exports[_0x847d('0x97')]=function(_0x51d0df,_0x972162){var _0x47eca3={};var _0x1ae9b0={};var _0xd95dfa;var _0x1ee859;return db[_0x847d('0x44')][_0x847d('0x67')]({'where':{'id':_0x51d0df[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x972162,null))[_0x847d('0xf')](function(_0x500987){if(_0x500987){_0xd95dfa=_0x500987;_0x1ae9b0['model']=_[_0x847d('0x48')](db['MailApplication'][_0x847d('0x86')]);_0x1ae9b0['query']=_[_0x847d('0x48')](_0x51d0df[_0x847d('0x47')]);_0x1ae9b0['filters']=_[_0x847d('0x4a')](_0x1ae9b0['model'],_0x1ae9b0[_0x847d('0x47')]);_0x47eca3[_0x847d('0x4d')]=_[_0x847d('0x4a')](_0x1ae9b0[_0x847d('0x4b')],qs[_0x847d('0x4c')](_0x51d0df[_0x847d('0x47')]['fields']));_0x47eca3['attributes']=_0x47eca3['attributes'][_0x847d('0x5e')]?_0x47eca3[_0x847d('0x4d')]:_0x1ae9b0[_0x847d('0x4b')];_0x47eca3[_0x847d('0x50')]=qs[_0x847d('0x51')](_0x51d0df[_0x847d('0x47')][_0x847d('0x51')]);_0x47eca3[_0x847d('0x53')]=qs[_0x847d('0x49')](_[_0x847d('0x52')](_0x51d0df[_0x847d('0x47')],_0x1ae9b0['filters']));if(_0x51d0df[_0x847d('0x47')]['filter']){_0x47eca3[_0x847d('0x53')]=_['merge'](_0x47eca3[_0x847d('0x53')],{'$or':_['map'](_0x47eca3[_0x847d('0x4d')],function(_0x8b1fff){var _0x1648b4={};_0x1648b4[_0x8b1fff]={'$like':'%'+_0x51d0df[_0x847d('0x47')][_0x847d('0x56')]+'%'};return _0x1648b4;})});}_0x47eca3=_['merge']({},_0x47eca3,_0x51d0df[_0x847d('0x57')]);return _0xd95dfa[_0x847d('0x97')](_0x47eca3);}})[_0x847d('0xf')](function(_0x4dc190){if(_0x4dc190){_0x1ee859=_0x4dc190[_0x847d('0x5e')];if(!_0x51d0df['query'][_0x847d('0x4e')](_0x847d('0x4f'))){_0x47eca3[_0x847d('0x1d')]=qs['limit'](_0x51d0df[_0x847d('0x47')][_0x847d('0x1d')]);_0x47eca3[_0x847d('0x1b')]=qs[_0x847d('0x1b')](_0x51d0df[_0x847d('0x47')][_0x847d('0x1b')]);}return _0xd95dfa[_0x847d('0x97')](_0x47eca3);}})[_0x847d('0xf')](function(_0xc11545){if(_0xc11545){return _0xc11545?{'count':_0x1ee859,'rows':_0xc11545}:null;}})[_0x847d('0xf')](respondWithResult(_0x972162,null))['catch'](handleError(_0x972162,null));};exports[_0x847d('0x98')]=function(_0x19172a,_0x1dbc50){var _0x1c9e4f={'raw':!![],'where':{}};var _0x272c5d={};var _0x73b011={'count':0x0,'rows':[]};return db[_0x847d('0x44')]['findOne']({'where':{'id':_0x19172a[_0x847d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1dbc50,null))[_0x847d('0xf')](function(_0x46a6a6){if(_0x46a6a6){_0x272c5d['model']=_[_0x847d('0x48')](db['MailMessage'][_0x847d('0x86')]);_0x272c5d[_0x847d('0x47')]=_[_0x847d('0x48')](_0x19172a[_0x847d('0x47')]);_0x272c5d[_0x847d('0x49')]=_[_0x847d('0x4a')](_0x272c5d['model'],_0x272c5d[_0x847d('0x47')]);_0x1c9e4f[_0x847d('0x4d')]=_['intersection'](_0x272c5d['model'],qs[_0x847d('0x4c')](_0x19172a['query'][_0x847d('0x4c')]));_0x1c9e4f[_0x847d('0x4d')]=_0x1c9e4f['attributes'][_0x847d('0x5e')]?_0x1c9e4f[_0x847d('0x4d')]:_0x272c5d[_0x847d('0x4b')];if(!_0x19172a[_0x847d('0x47')]['hasOwnProperty'](_0x847d('0x4f'))){_0x1c9e4f['limit']=qs[_0x847d('0x1d')](_0x19172a['query']['limit']);_0x1c9e4f['offset']=qs[_0x847d('0x1b')](_0x19172a[_0x847d('0x47')][_0x847d('0x1b')]);}_0x1c9e4f['order']=qs[_0x847d('0x51')](_0x19172a['query'][_0x847d('0x51')]);_0x1c9e4f[_0x847d('0x53')]=qs[_0x847d('0x49')](_[_0x847d('0x52')](_0x19172a[_0x847d('0x47')],_0x272c5d[_0x847d('0x49')]));_0x1c9e4f['where'][_0x847d('0x68')]=_0x46a6a6['id'];if(_0x19172a['query'][_0x847d('0x56')]){_0x1c9e4f[_0x847d('0x53')]=_[_0x847d('0x54')](_0x1c9e4f[_0x847d('0x53')],{'$or':_[_0x847d('0x43')](_0x1c9e4f[_0x847d('0x4d')],function(_0xc200cd){var _0x42aefb={};_0x42aefb[_0xc200cd]={'$like':'%'+_0x19172a[_0x847d('0x47')][_0x847d('0x56')]+'%'};return _0x42aefb;})});}if(_0x19172a[_0x847d('0x47')][_0x847d('0x99')]){var _0xe6b1d=_0x19172a[_0x847d('0x47')][_0x847d('0x99')]['split'](',');var _0x212924={};_0x212924[_0xe6b1d[0x0]]={'$gte':moment(_0xe6b1d[0x1])[_0x847d('0x9a')](_0x847d('0x9b'))};_0x1c9e4f['where']=_[_0x847d('0x54')](_0x1c9e4f['where'],_0x212924);}_0x1c9e4f=_[_0x847d('0x54')]({},_0x1c9e4f,_0x19172a[_0x847d('0x57')]);return db[_0x847d('0x9c')][_0x847d('0x1e')]({'where':_0x1c9e4f[_0x847d('0x53')]})['then'](function(_0x55c7e7){_0x73b011['count']=_0x55c7e7;if(_0x19172a[_0x847d('0x47')][_0x847d('0x58')]){_0x1c9e4f[_0x847d('0x5f')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x1c9e4f);})[_0x847d('0xf')](function(_0x258e55){if(_0x19172a[_0x847d('0x47')][_0x847d('0x9d')]===_0x847d('0x9e')){for(var _0x3a1fe6=0x0;_0x3a1fe6<_0x258e55[_0x847d('0x5e')];_0x3a1fe6++){_0x258e55[_0x3a1fe6][_0x847d('0x60')]=juice(_0x258e55[_0x3a1fe6][_0x847d('0x60')]);}}_0x73b011[_0x847d('0x5a')]=_0x258e55;return _0x73b011;});}})[_0x847d('0xf')](respondWithFilteredResult(_0x1dbc50,_0x1c9e4f))[_0x847d('0x5b')](handleError(_0x1dbc50,null));};exports['send']=function(_0x9098ec,_0x50076c){var _0x1940df,_0x3b59f8={},_0x8a755c;if(_0x9098ec[_0x847d('0x60')]['to']){_0x8a755c=_0x9098ec[_0x847d('0x60')]['to']['split'](',')[0x0];}return db[_0x847d('0x44')]['find']({'where':{'id':_0x9098ec[_0x847d('0x5d')]['id']},'include':[{'model':db[_0x847d('0x9f')],'as':_0x847d('0xa0'),'include':[{'model':db[_0x847d('0x87')],'as':'Contacts','where':{'email':_0x8a755c},'limit':0x1,'order':[[_0x847d('0xa1'),'DESC']]}]},{'model':db[_0x847d('0x40')],'as':_0x847d('0x3e'),'raw':!![],'include':[{'model':db[_0x847d('0xa2')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x50076c,null))['then'](function(_0x59749b){if(!_0x59749b)return;_0x1940df=_0x59749b;if(!_0x59749b[_0x847d('0x3e')])throw new Error(_0x847d('0xa3'));if(_[_0x847d('0x73')](_0x9098ec[_0x847d('0x60')][_0x847d('0xa4')])){_0x9098ec[_0x847d('0x60')]['from']=util[_0x847d('0x9a')](_0x847d('0xa5'),_0x59749b[_0x847d('0x24')],_0x59749b[_0x847d('0x72')]||_0x59749b[_0x847d('0x3e')][_0x847d('0x32')]);}if(_0x9098ec[_0x847d('0x60')][_0x847d('0xa6')]&&_0x9098ec['body']['attachments'][_0x847d('0x5e')]){for(var _0x2e4332=0x0;_0x2e4332<_0x9098ec[_0x847d('0x60')]['attachments'][_0x847d('0x5e')];_0x2e4332+=0x1){_0x9098ec[_0x847d('0x60')]['attachments'][_0x2e4332]={'filename':_0x9098ec[_0x847d('0x60')][_0x847d('0xa6')][_0x2e4332][_0x847d('0x24')],'path':path['join'](config['root'],_0x847d('0xa7'),_0x9098ec[_0x847d('0x60')][_0x847d('0xa6')][_0x2e4332]['basename'])};}}var _0x3025a4=_0x59749b[_0x847d('0xa8')]();return respondWithRpcPromise('SendMail',_0x847d('0xa9'),{'account':_0x3025a4,'message':_0x9098ec[_0x847d('0x60')]});})[_0x847d('0xf')](function(_0x58ddb3){if(!_0x58ddb3)return;_0x3b59f8=_0x58ddb3;if(!_0x1940df[_0x847d('0xa0')])throw new Error('List\x20not\x20found');if(_0x1940df[_0x847d('0xa0')][_0x847d('0xaa')][_0x847d('0x5e')])return _0x1940df[_0x847d('0xa0')][_0x847d('0xaa')][0x0];return db[_0x847d('0x87')][_0x847d('0x6d')](_[_0x847d('0x9')](_0x9098ec[_0x847d('0x60')],{'firstName':_0x9098ec[_0x847d('0x60')]['to'],'email':_0x9098ec[_0x847d('0x60')]['to'],'phone':_0x9098ec[_0x847d('0x60')]['to'],'ListId':_0x1940df[_0x847d('0xab')]}));})[_0x847d('0xf')](function(_0x1be5a6){if(!_0x1be5a6)return;var _0x182881={'UserId':_0x9098ec['user']['id'],'ContactId':_0x1be5a6['id'],'MailAccountId':_0x1940df['id'],'inReplyTo':_0x3b59f8[_0x847d('0xac')],'to':_0x9098ec[_0x847d('0x60')]['from'],'cc':_0x9098ec[_0x847d('0x60')]['cc'],'subject':_0x9098ec[_0x847d('0x60')]['subject'],'attach':_0x9098ec[_0x847d('0x60')][_0x847d('0xad')],'firstMsgDirection':_0x847d('0xae'),'lastMsgAt':moment()[_0x847d('0x9a')](_0x847d('0x9b')),'lastMsgDirection':_0x847d('0xae'),'Messages':[_[_0x847d('0x54')](_0x9098ec['body'],{'messageId':_0x3b59f8[_0x847d('0xac')],'sentAt':moment()[_0x847d('0x9a')](_0x847d('0x9b')),'read':!![],'MailAccountId':_0x1940df['id'],'UserId':_0x9098ec[_0x847d('0x32')]['id'],'ContactId':_0x1be5a6['id']})]};if(_0x9098ec['body'][_0x847d('0xaf')]){_0x182881=_['merge'](_0x182881,_0x9098ec['body'][_0x847d('0xaf')]);}return db[_0x847d('0x82')][_0x847d('0x6d')](_0x182881,{'include':[{'model':db[_0x847d('0x9c')],'as':_0x847d('0xb0')}]});})[_0x847d('0xf')](respondWithResult(_0x50076c,null))[_0x847d('0x5b')](handleError(_0x50076c,null));};exports[_0x847d('0xb1')]=function(_0x107e4f,_0x2f9e91){return db[_0x847d('0x44')]['find']({'where':{'id':_0x107e4f[_0x847d('0x5d')]['id']},'include':[{'model':db[_0x847d('0x40')],'as':_0x847d('0x3e'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x847d('0xa2'),'raw':!![]}]}]})[_0x847d('0xf')](handleEntityNotFound(_0x2f9e91,null))['then'](function(_0x3fe34a){if(!_0x3fe34a[_0x847d('0x3e')])return;var _0x187cbf=_0x3fe34a['getSmtpOptions']();return respondWithRpcPromise(_0x847d('0xb2'),'verifySmtp',{'account':_0x187cbf});})[_0x847d('0xf')](respondWithResult(_0x2f9e91,null))[_0x847d('0x5b')](handleError(_0x2f9e91,null));};exports[_0x847d('0x22')]=function(_0x5b8b7f,_0x47e0fe){return db[_0x847d('0x44')]['find']({'where':{'id':_0x5b8b7f[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x47e0fe,null))[_0x847d('0xf')](function(_0x3c6837){if(_0x3c6837&&_0x3c6837[_0x847d('0x3b')]){throw new db[(_0x847d('0xb3'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3c6837;})[_0x847d('0xf')](removeEntity(_0x47e0fe,null))[_0x847d('0x5b')](handleError(_0x47e0fe,null));};exports[_0x847d('0xb4')]=function(_0x5bbaed,_0x25cbaf){return db['MailAccount'][_0x847d('0x62')]({'where':{'id':_0x5bbaed[_0x847d('0x5d')]['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x25cbaf,null))['then'](function(_0x3f238c){if(_0x3f238c){return _0x3f238c[_0x847d('0xb4')](_0x5bbaed[_0x847d('0x60')]['ids'],_[_0x847d('0x84')](_0x5bbaed['body'],[_0x847d('0x6a'),'id'])||{})[_0x847d('0xb5')](function(_0x250570){for(var _0x6c56db=0x0;_0x6c56db<_0x5bbaed[_0x847d('0x60')][_0x847d('0x6a')]['length'];_0x6c56db+=0x1){socket[_0x847d('0xb6')]('userMailAccount:save',{'UserId':Number(_0x5bbaed[_0x847d('0x60')][_0x847d('0x6a')][_0x6c56db]),'MailAccountId':Number(_0x5bbaed[_0x847d('0x5d')]['id'])});}return _0x250570;});}})['then'](respondWithResult(_0x25cbaf,null))[_0x847d('0x5b')](handleError(_0x25cbaf,null));};exports[_0x847d('0xb7')]=function(_0x305b98,_0x548c32){return db['MailAccount'][_0x847d('0x62')]({'where':{'id':_0x305b98['params']['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x548c32,null))[_0x847d('0xf')](function(_0x46adfc){if(_0x46adfc){return _0x46adfc['removeAgents'](_0x305b98[_0x847d('0x47')][_0x847d('0x6a')])[_0x847d('0xf')](function(){if(_['isArray'](_0x305b98[_0x847d('0x47')]['ids'])){for(var _0x23cd26=0x0;_0x23cd26<_0x305b98[_0x847d('0x47')][_0x847d('0x6a')][_0x847d('0x5e')];_0x23cd26+=0x1){socket[_0x847d('0xb6')]('userMailAccount:remove',{'UserId':Number(_0x305b98[_0x847d('0x47')]['ids'][_0x23cd26]),'MailAccountId':Number(_0x305b98['params']['id'])});}}else{socket[_0x847d('0xb6')]('userMailAccount:remove',{'UserId':Number(_0x305b98['query'][_0x847d('0x6a')]),'MailAccountId':Number(_0x305b98[_0x847d('0x5d')]['id'])});}});}})[_0x847d('0xf')](respondWithStatusCode(_0x548c32,null))[_0x847d('0x5b')](handleError(_0x548c32,null));};exports[_0x847d('0xb8')]=function(_0x53f04f,_0x45f903){var _0x2d5b6a={};var _0xa51a11={};var _0x3cf694;var _0x544993;return db[_0x847d('0x44')][_0x847d('0x67')]({'where':{'id':_0x53f04f['params']['id']}})[_0x847d('0xf')](handleEntityNotFound(_0x45f903,null))[_0x847d('0xf')](function(_0x163266){if(_0x163266){_0x3cf694=_0x163266;_0xa51a11[_0x847d('0x4b')]=_[_0x847d('0x48')](db[_0x847d('0x88')][_0x847d('0x86')]);_0xa51a11[_0x847d('0x47')]=_[_0x847d('0x48')](_0x53f04f[_0x847d('0x47')]);_0xa51a11[_0x847d('0x49')]=_[_0x847d('0x4a')](_0xa51a11[_0x847d('0x4b')],_0xa51a11['query']);_0x2d5b6a[_0x847d('0x4d')]=_[_0x847d('0x4a')](_0xa51a11[_0x847d('0x4b')],qs[_0x847d('0x4c')](_0x53f04f['query'][_0x847d('0x4c')]));_0x2d5b6a[_0x847d('0x4d')]=_0x2d5b6a[_0x847d('0x4d')][_0x847d('0x5e')]?_0x2d5b6a[_0x847d('0x4d')]:_0xa51a11[_0x847d('0x4b')];_0x2d5b6a[_0x847d('0x50')]=qs['sort'](_0x53f04f[_0x847d('0x47')]['sort']);_0x2d5b6a[_0x847d('0x53')]=qs[_0x847d('0x49')](_[_0x847d('0x52')](_0x53f04f[_0x847d('0x47')],_0xa51a11[_0x847d('0x49')]));if(_0x53f04f[_0x847d('0x47')][_0x847d('0x56')]){_0x2d5b6a[_0x847d('0x53')]=_[_0x847d('0x54')](_0x2d5b6a[_0x847d('0x53')],{'$or':_[_0x847d('0x43')](_0x2d5b6a[_0x847d('0x4d')],function(_0x403bd3){var _0x142556={};_0x142556[_0x403bd3]={'$like':'%'+_0x53f04f[_0x847d('0x47')][_0x847d('0x56')]+'%'};return _0x142556;})});}_0x2d5b6a=_[_0x847d('0x54')]({},_0x2d5b6a,_0x53f04f[_0x847d('0x57')]);return _0x3cf694[_0x847d('0xb8')](_0x2d5b6a);}})[_0x847d('0xf')](function(_0x4d8941){if(_0x4d8941){_0x544993=_0x4d8941[_0x847d('0x5e')];if(!_0x53f04f[_0x847d('0x47')][_0x847d('0x4e')](_0x847d('0x4f'))){_0x2d5b6a[_0x847d('0x1d')]=qs[_0x847d('0x1d')](_0x53f04f[_0x847d('0x47')][_0x847d('0x1d')]);_0x2d5b6a[_0x847d('0x1b')]=qs[_0x847d('0x1b')](_0x53f04f['query'][_0x847d('0x1b')]);}return _0x3cf694[_0x847d('0xb8')](_0x2d5b6a);}})['then'](function(_0x5cfa27){if(_0x5cfa27){return _0x5cfa27?{'count':_0x544993,'rows':_0x5cfa27}:null;}})[_0x847d('0xf')](respondWithResult(_0x45f903,null))[_0x847d('0x5b')](handleError(_0x45f903,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5461b73..f8035d3 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 _0x6be2=['setMaxListeners','remove','emit','hook','exports','../../mysqldb','MailAccount'];(function(_0x10fa22,_0x1b4769){var _0x585fc5=function(_0x1b2b22){while(--_0x1b2b22){_0x10fa22['push'](_0x10fa22['shift']());}};_0x585fc5(++_0x1b4769);}(_0x6be2,0x1cc));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x26be('0x0'))['db'][_0x26be('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x26be('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x26be('0x3')};function emitEvent(_0x434c4b){return function(_0xa23647,_0x4c7bff,_0x27d672){MailAccountEvents[_0x26be('0x4')](_0x434c4b+':'+_0xa23647['id'],_0xa23647);MailAccountEvents[_0x26be('0x4')](_0x434c4b,_0xa23647);_0x27d672(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x26be('0x5')](e,emitEvent(event));}}module[_0x26be('0x6')]=MailAccountEvents; \ No newline at end of file +var _0x55c3=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x4e1564,_0x598b50){var _0x57e5a4=function(_0x21b59e){while(--_0x21b59e){_0x4e1564['push'](_0x4e1564['shift']());}};_0x57e5a4(++_0x598b50);}(_0x55c3,0x189));var _0x355c=function(_0x35ac32,_0xdfc515){_0x35ac32=_0x35ac32-0x0;var _0x5999dc=_0x55c3[_0x35ac32];return _0x5999dc;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x355c('0x0'))['db'][_0x355c('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x355c('0x2')](0x0);var events={'afterCreate':_0x355c('0x3'),'afterUpdate':_0x355c('0x4'),'afterDestroy':_0x355c('0x5')};function emitEvent(_0x1f5257){return function(_0x132c7a,_0x1655c1,_0x1c7a4f){MailAccountEvents[_0x355c('0x6')](_0x1f5257+':'+_0x132c7a['id'],_0x132c7a);MailAccountEvents[_0x355c('0x6')](_0x1f5257,_0x132c7a);_0x1c7a4f(null);};}for(var e in events){if(events[_0x355c('0x7')](e)){var event=events[e];MailAccount[_0x355c('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 517aa49..98be38c 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 _0xf2c2=['data5','auth','pass','./mailAccount.attributes','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xf2c2,0x135));var _0x2f2c=function(_0x540edc,_0x492a3c){_0x540edc=_0x540edc-0x0;var _0x5ceaa5=_0xf2c2[_0x540edc];return _0x5ceaa5;};'use strict';var attributes=require(_0x2f2c('0x0'));module['exports']=function(_0x12170b){return _0x12170b['define'](_0x2f2c('0x1'),attributes,{'tableName':_0x2f2c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1d1815=this;var _0xfcb478={'id':_0x1d1815['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1d1815[_0x2f2c('0x3')]!==_0x2f2c('0x4')){_0xfcb478[_0x2f2c('0x5')]=_0x1d1815[_0x2f2c('0x3')];}else{_0xfcb478[_0x2f2c('0x6')]=_0x1d1815[_0x2f2c('0x7')]['host'];_0xfcb478['port']=_0x1d1815[_0x2f2c('0x7')][_0x2f2c('0x8')];_0xfcb478[_0x2f2c('0x9')]=_0x1d1815[_0x2f2c('0x7')]['secure'];}if(_0x1d1815[_0x2f2c('0x7')][_0x2f2c('0xa')]){if(_0x1d1815[_0x2f2c('0x7')][_0x2f2c('0xb')]){if(!_0x1d1815[_0x2f2c('0x7')]['CloudProvider'])throw new Error(_0x2f2c('0xc'));_0xfcb478['auth']={'type':_0x2f2c('0xd'),'user':_0x1d1815[_0x2f2c('0x7')][_0x2f2c('0xe')],'accessToken':_0x1d1815['Smtp']['CloudProvider'][_0x2f2c('0xf')]};}else{_0xfcb478[_0x2f2c('0x10')]={'user':_0x1d1815[_0x2f2c('0x7')]['user'],'pass':_0x1d1815[_0x2f2c('0x7')][_0x2f2c('0x11')]};}}return _0xfcb478;}}});}; \ No newline at end of file +var _0xc17b=['./mailAccount.attributes','exports','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','auth','pass'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0xc17b,0x7e));var _0xbc17=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xc17b[_0x5608a3];return _0x1ed50a;};'use strict';var attributes=require(_0xbc17('0x0'));module[_0xbc17('0x1')]=function(_0x503a57){return _0x503a57['define']('MailAccount',attributes,{'tableName':_0xbc17('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x67ac42=this;var _0x59e9b8={'id':_0x67ac42['id'],'tls':{'rejectUnauthorized':![]}};if(_0x67ac42[_0xbc17('0x3')]!==_0xbc17('0x4')){_0x59e9b8[_0xbc17('0x5')]=_0x67ac42['provider'];}else{_0x59e9b8[_0xbc17('0x6')]=_0x67ac42[_0xbc17('0x7')][_0xbc17('0x6')];_0x59e9b8[_0xbc17('0x8')]=_0x67ac42['Smtp'][_0xbc17('0x8')];_0x59e9b8[_0xbc17('0x9')]=_0x67ac42[_0xbc17('0x7')][_0xbc17('0x9')];}if(_0x67ac42[_0xbc17('0x7')][_0xbc17('0xa')]){if(_0x67ac42['Smtp'][_0xbc17('0xb')]){if(!_0x67ac42[_0xbc17('0x7')][_0xbc17('0xc')])throw new Error(_0xbc17('0xd'));_0x59e9b8['auth']={'type':_0xbc17('0xe'),'user':_0x67ac42[_0xbc17('0x7')]['user'],'accessToken':_0x67ac42[_0xbc17('0x7')][_0xbc17('0xc')][_0xbc17('0xf')]};}else{_0x59e9b8[_0xbc17('0x10')]={'user':_0x67ac42[_0xbc17('0x7')]['user'],'pass':_0x67ac42['Smtp'][_0xbc17('0x11')]};}}return _0x59e9b8;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 3cff612..e9dc9b2 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 _0x6d38=['result','catch','findAll','options','raw','attributes','limit','map','include','model','then','GetMailAccount','debug','ShowMailAccount','find','smtp','setDataValue','smtpOptions','body','mail','difference','rawAttributes','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','CloudProvider','get','account','omit','getSmtpOptions','list','applications','orderBy','autoclose','push','length','close','create','List\x20not\x20found','messageId','generate','subject','attach','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','contact','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailAccount.socket','register','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6d38[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var moment=require(_0x86d3('0x0'));var BPromise=require(_0x86d3('0x1'));var rs=require(_0x86d3('0x2'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x86d3('0x3'))('rpc');var config=require(_0x86d3('0x4'));var jayson=require(_0x86d3('0x5'));var client=jayson[_0x86d3('0x6')]['http']({'port':0x232c});config[_0x86d3('0x7')]=_[_0x86d3('0x8')](config[_0x86d3('0x7')],{'host':_0x86d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x86d3('0xa'))[_0x86d3('0xb')](socket);function respondWithRpcPromise(_0xf273f5,_0x499640,_0x4a277e){return new BPromise(function(_0x3ed317,_0x555e6d){return client['request'](_0xf273f5,_0x4a277e)['then'](function(_0x4300e2){logger[_0x86d3('0xc')]('MailAccount,\x20%s,\x20%s',_0x499640,_0x86d3('0xd'));logger['debug'](_0x86d3('0xe'),_0x499640,_0x86d3('0xd'),JSON[_0x86d3('0xf')](_0x4300e2));if(_0x4300e2[_0x86d3('0x10')]){if(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x11')]===0x1f4){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2['error'][_0x86d3('0x13')]);return _0x555e6d(_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);}logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]);return _0x3ed317(_0x4300e2[_0x86d3('0x10')]['message']);}else{logger[_0x86d3('0xc')](_0x86d3('0x12'),_0x499640,_0x86d3('0xd'));_0x3ed317(_0x4300e2[_0x86d3('0x14')][_0x86d3('0x13')]);}})[_0x86d3('0x15')](function(_0x33e459){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x499640,_0x33e459);_0x555e6d(_0x33e459);});});}exports['GetMailAccount']=function(_0x191ba5){var _0x57c340=this;return new Promise(function(_0x6ced9e,_0x5c4d55){return db['MailAccount'][_0x86d3('0x16')]({'raw':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x18')]===undefined?!![]:![]:!![],'where':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')]['where']||null:null,'attributes':_0x191ba5[_0x86d3('0x17')]?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'limit':_0x191ba5['options']?_0x191ba5[_0x86d3('0x17')][_0x86d3('0x1a')]||null:null,'include':_0x191ba5[_0x86d3('0x17')]?_0x191ba5['options']['include']?_[_0x86d3('0x1b')](_0x191ba5['options'][_0x86d3('0x1c')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x1d')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x19')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x1c')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x19')],'include':_0x611764['include']?_[_0x86d3('0x1b')](_0x611764[_0x86d3('0x1c')],function(_0x287b96){return{'model':db[_0x287b96[_0x86d3('0x1d')]],'as':_0x287b96['as'],'attributes':_0x287b96[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x1f203e){logger[_0x86d3('0xc')](_0x86d3('0x1f'),_0x191ba5);logger[_0x86d3('0x20')](_0x86d3('0x1f'),_0x191ba5,JSON[_0x86d3('0xf')](_0x1f203e));_0x6ced9e(_0x1f203e);})[_0x86d3('0x15')](function(_0x28c25e){logger['error'](_0x86d3('0x1f'),_0x28c25e[_0x86d3('0x13')],_0x191ba5);_0x5c4d55(_0x57c340[_0x86d3('0x10')](0x1f4,_0x28c25e[_0x86d3('0x13')]));});});};exports[_0x86d3('0x21')]=function(_0x245e39){var _0x4a5ff0=this;return new Promise(function(_0xba2f49,_0x5c71df){return db['MailAccount'][_0x86d3('0x22')]({'raw':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')]['where']||null:null,'attributes':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x19')]||null:null,'include':_0x245e39[_0x86d3('0x17')]?_0x245e39[_0x86d3('0x17')][_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x245e39[_0x86d3('0x17')]['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x19')],'include':_0x4cdf45['include']?_[_0x86d3('0x1b')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x1d')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x19')],'include':_0x366943[_0x86d3('0x1c')]?_[_0x86d3('0x1b')](_0x366943[_0x86d3('0x1c')],function(_0x2d15b9){return{'model':db[_0x2d15b9['model']],'as':_0x2d15b9['as'],'attributes':_0x2d15b9[_0x86d3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0x1e')](function(_0x5e2519){if(_0x245e39[_0x86d3('0x17')][_0x86d3('0x23')]===!![])_0x5e2519[_0x86d3('0x24')](_0x86d3('0x25'),_0x5e2519['getSmtpOptions']());logger[_0x86d3('0xc')](_0x86d3('0x21'),_0x245e39);logger[_0x86d3('0x20')]('ShowMailAccount',_0x245e39,JSON[_0x86d3('0xf')](_0x5e2519));_0xba2f49(_0x5e2519);})[_0x86d3('0x15')](function(_0x1a1c06){logger[_0x86d3('0x10')](_0x86d3('0x21'),_0x1a1c06[_0x86d3('0x13')],_0x245e39);_0x5c71df(_0x4a5ff0[_0x86d3('0x10')](0x1f4,_0x1a1c06[_0x86d3('0x13')]));});});};exports['NotifyMailAccount']=function(_0x22bc98){var _0x470978=this;return new Promise(function(_0x2bdc67,_0x461052){var _0x5ebb4d={'body':_0x22bc98[_0x86d3('0x26')],'channel':_0x86d3('0x27')};var _0x6f72be=_[_0x86d3('0x28')](_['keys'](db['CmContact'][_0x86d3('0x29')]),['createdAt','updatedAt',_0x86d3('0x2a'),_0x86d3('0x2b')]);var _0x43490a=![];if(_0x22bc98[_0x86d3('0x26')]['id']){delete _0x22bc98[_0x86d3('0x26')]['id'];}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x86d3('0x2d')](_0x22bc98[_0x86d3('0x26')]['body'])||_0x22bc98[_0x86d3('0x26')][_0x86d3('0x26')]===''){return _0x461052(_0x470978['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x2f')+_0x6f72be));}if(!_[_0x86d3('0x30')](_0x6f72be,_0x22bc98[_0x86d3('0x26')]['mapKey'])){return _0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x86d3('0x31')+_0x6f72be));}var _0x5d9dad={};_0x5d9dad[_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2e')]]=_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')];return db[_0x86d3('0x32')][_0x86d3('0x22')]({'where':{'id':_0x22bc98['account']['id']},'include':[{'model':db[_0x86d3('0x33')],'as':_0x86d3('0x34'),'include':[{'model':db['CmContact'],'as':_0x86d3('0x35'),'where':_0x5d9dad,'limit':0x1,'order':[[_0x86d3('0x36'),_0x86d3('0x37')]]}]},{'model':db[_0x86d3('0x38')],'as':_0x86d3('0x39')},{'model':db['MailServerOut'],'as':_0x86d3('0x3a'),'include':[{'model':db[_0x86d3('0x3b')],'as':_0x86d3('0x3b')}]}]})[_0x86d3('0x1e')](function(_0x369b75){if(_0x369b75&&_0x369b75[_0x86d3('0x34')]){var _0x1a4345=_0x369b75[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x1a4345,[_0x86d3('0x39'),_0x86d3('0x34')]);_0x5ebb4d['account'][_0x86d3('0x25')]=_0x369b75[_0x86d3('0x3f')]();_0x5ebb4d['applications']=_0x1a4345[_0x86d3('0x39')];_0x5ebb4d[_0x86d3('0x40')]=_0x1a4345[_0x86d3('0x34')];_0x5ebb4d[_0x86d3('0x41')]=_[_0x86d3('0x42')](_0x5ebb4d[_0x86d3('0x41')],['priority'],['asc']);if(_0x5ebb4d['account']&&_0x5ebb4d['account'][_0x86d3('0x43')]){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x44')]({'id':0x0,'priority':_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x45')]+0x1,'app':_0x86d3('0x46'),'appdata':_0x86d3('0x43'),'interval':'*,*,*,*'});}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')]){delete _0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x39')];}if(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x34')]){delete _0x5ebb4d[_0x86d3('0x3d')]['List'];}if(_0x1a4345[_0x86d3('0x34')]['Contacts'][_0x86d3('0x45')]){return _0x1a4345[_0x86d3('0x34')][_0x86d3('0x35')][0x0];}var _0x3ffd22=_[_0x86d3('0x8')](_0x22bc98['body'],{'firstName':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x2c')],'ListId':_0x1a4345[_0x86d3('0x2b')]});_0x3ffd22[_0x22bc98['body']['mapKey']]=_0x22bc98['body'][_0x86d3('0x2c')];return db['CmContact'][_0x86d3('0x47')](_0x3ffd22);}else{throw new Error(_0x86d3('0x48'));}})[_0x86d3('0x1e')](function(_0x319ea0){_0x5ebb4d['contact']=_0x319ea0;if(_0x319ea0){if(!_0x22bc98['body']['message'][_0x86d3('0x49')]){_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')]=rs[_0x86d3('0x4a')]()+'\x20'+_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')];}var _0x5123fd={'ContactId':_0x319ea0['id'],'MailAccountId':_0x22bc98[_0x86d3('0x3d')]['id'],'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98['body'][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98['body'][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4c')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x86d3('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x22bc98['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x86d3('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x4f')]}}]})[_0x86d3('0x1e')](function(_0xa48003){if(_0xa48003){return[_0xa48003,![]];}return db['MailInteraction']['create'](_0x5123fd)[_0x86d3('0x1e')](function(_0xf2c179){return[_0xf2c179,!![]];});});}else{throw new Error(_0x86d3('0x50'));}})[_0x86d3('0x51')](function(_0x22d8eb,_0x1952af){if(_0x22d8eb){_0x43490a=_0x1952af;if(!_0x1952af){return _0x22d8eb[_0x86d3('0x52')]({'inReplyTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x49')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'cc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22d8eb['attach']?_0x22d8eb[_0x86d3('0x4c')]:_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgAt':moment()[_0x86d3('0x53')](_0x86d3('0x54')),'lastMsgDirection':'in'});}else{return _0x22d8eb;}}})['then'](function(_0x41d448){_0x5ebb4d['interaction']=_0x41d448[_0x86d3('0x3c')]({'plain':!![]});_0x5ebb4d[_0x86d3('0x55')][_0x86d3('0x56')]=_0x43490a;return db[_0x86d3('0x57')][_0x86d3('0x47')]({'body':_0x22bc98['body'][_0x86d3('0x26')],'MailAccountId':_0x22bc98['account']['id'],'MailInteractionId':_0x41d448['id'],'direction':'in','ContactId':_0x5ebb4d[_0x86d3('0x58')]['id'],'messageId':_0x22bc98[_0x86d3('0x26')]['message'][_0x86d3('0x49')],'from':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x2c')],'to':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['to'],'cc':_0x22bc98[_0x86d3('0x26')]['message']['cc'],'subject':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x4b')],'attach':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attach'],'Attachments':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['attachments'],'originTo':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x59')],'originCc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5a')],'bcc':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5b')],'ChatWebsiteId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5c')]||null,'originChannel':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')]['originChannel']||_0x86d3('0x5d'),'ChatOfflineMessageId':_0x22bc98[_0x86d3('0x26')][_0x86d3('0x13')][_0x86d3('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x86d3('0x5f')}]});})[_0x86d3('0x1e')](function(_0x1a97f3){_0x5ebb4d[_0x86d3('0x13')]=_0x1a97f3;if(_0x5ebb4d['interaction']['UserId']){return db[_0x86d3('0x60')]['find']({'attributes':['id',_0x86d3('0x61')],'where':{'id':_0x5ebb4d['interaction']['UserId']}})[_0x86d3('0x1e')](function(_0x28bd40){if(_0x28bd40){_0x5ebb4d[_0x86d3('0x41')][_0x86d3('0x62')]({'id':0x0,'priority':0x0,'app':_0x86d3('0x63'),'appdata':_0x28bd40['name']+','+(_0x5ebb4d[_0x86d3('0x3d')][_0x86d3('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x86d3('0x65'),_0x86d3('0x66'),_0x5ebb4d);});}return respondWithRpcPromise('Start',_0x86d3('0x66'),_0x5ebb4d);})['then'](function(_0x1867fc){_0x2bdc67(_0x1867fc);})['catch'](function(_0x5bb2e5){_0x461052(_0x470978[_0x86d3('0x10')](0x1f4,_0x5bb2e5['message']));});});}; \ No newline at end of file +var _0x1967=['getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','updatedAt','Applications','CloudProvider','List','get','applications','list','priority','asc','autoclose','push','close','*,*,*,*','Contacts','length','create','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','originCc','bcc','ChatOfflineMessageId','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailAccount','findAll','options','where','attributes','limit','map','include','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions'];(function(_0x83d48e,_0x507328){var _0x26f1d1=function(_0x252172){while(--_0x252172){_0x83d48e['push'](_0x83d48e['shift']());}};_0x26f1d1(++_0x507328);}(_0x1967,0x173));var _0x7196=function(_0x38737b,_0x365d1d){_0x38737b=_0x38737b-0x0;var _0x2848bb=_0x1967[_0x38737b];return _0x2848bb;};'use strict';var _=require('lodash');var moment=require(_0x7196('0x0'));var BPromise=require(_0x7196('0x1'));var rs=require(_0x7196('0x2'));var Redis=require(_0x7196('0x3'));var db=require(_0x7196('0x4'))['db'];var logger=require(_0x7196('0x5'))(_0x7196('0x6'));var config=require(_0x7196('0x7'));var jayson=require(_0x7196('0x8'));var client=jayson[_0x7196('0x9')]['http']({'port':0x232c});config[_0x7196('0xa')]=_[_0x7196('0xb')](config[_0x7196('0xa')],{'host':_0x7196('0xc'),'port':0x18eb});var socket=require(_0x7196('0xd'))(new Redis(config[_0x7196('0xa')]));require('./mailAccount.socket')[_0x7196('0xe')](socket);function respondWithRpcPromise(_0xc6366f,_0x3f846e,_0x259b18){return new BPromise(function(_0x1e862d,_0x503070){return client['request'](_0xc6366f,_0x259b18)[_0x7196('0xf')](function(_0x10459b){logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));logger[_0x7196('0x13')](_0x7196('0x14'),_0x3f846e,_0x7196('0x12'),JSON[_0x7196('0x15')](_0x10459b));if(_0x10459b[_0x7196('0x16')]){if(_0x10459b[_0x7196('0x16')]['code']===0x1f4){logger[_0x7196('0x16')](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x503070(_0x10459b['error'][_0x7196('0x17')]);}logger['error'](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x1e862d(_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);}else{logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));_0x1e862d(_0x10459b[_0x7196('0x18')][_0x7196('0x17')]);}})[_0x7196('0x19')](function(_0x5b716a){logger['error'](_0x7196('0x11'),_0x3f846e,_0x5b716a);_0x503070(_0x5b716a);});});}exports[_0x7196('0x1a')]=function(_0x40418d){var _0x517a3e=this;return new Promise(function(_0x39b944,_0x539d8b){return db['MailAccount'][_0x7196('0x1b')]({'raw':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1d')]||null:null,'attributes':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'limit':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')][_0x7196('0x1f')]||null:null,'include':_0x40418d['options']?_0x40418d[_0x7196('0x1c')]['include']?_[_0x7196('0x20')](_0x40418d[_0x7196('0x1c')][_0x7196('0x21')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x22')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x1e')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x21')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x22')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes'],'include':_0x2d284f['include']?_[_0x7196('0x20')](_0x2d284f[_0x7196('0x21')],function(_0x675e64){return{'model':db[_0x675e64['model']],'as':_0x675e64['as'],'attributes':_0x675e64[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fd339){logger['info'](_0x7196('0x1a'),_0x40418d);logger[_0x7196('0x13')](_0x7196('0x1a'),_0x40418d,JSON['stringify'](_0x4fd339));_0x39b944(_0x4fd339);})[_0x7196('0x19')](function(_0x45d567){logger[_0x7196('0x16')](_0x7196('0x1a'),_0x45d567['message'],_0x40418d);_0x539d8b(_0x517a3e[_0x7196('0x16')](0x1f4,_0x45d567[_0x7196('0x17')]));});});};exports[_0x7196('0x23')]=function(_0x651d7e){var _0x4780e1=this;return new Promise(function(_0x2786f3,_0x15c5f0){return db[_0x7196('0x24')][_0x7196('0x25')]({'raw':_0x651d7e[_0x7196('0x1c')]?_0x651d7e[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x651d7e[_0x7196('0x1c')]?_0x651d7e['options'][_0x7196('0x1d')]||null:null,'attributes':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'include':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')]?_[_0x7196('0x20')](_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x22')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x1e')],'include':_0x4a8580[_0x7196('0x21')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x21')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x1e')],'include':_0x123cad[_0x7196('0x21')]?_[_0x7196('0x20')](_0x123cad['include'],function(_0x33831a){return{'model':db[_0x33831a[_0x7196('0x22')]],'as':_0x33831a['as'],'attributes':_0x33831a[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xf')](function(_0x11d4ec){if(_0x651d7e[_0x7196('0x1c')][_0x7196('0x26')]===!![])_0x11d4ec[_0x7196('0x27')](_0x7196('0x28'),_0x11d4ec[_0x7196('0x29')]());logger['info'](_0x7196('0x23'),_0x651d7e);logger[_0x7196('0x13')]('ShowMailAccount',_0x651d7e,JSON[_0x7196('0x15')](_0x11d4ec));_0x2786f3(_0x11d4ec);})['catch'](function(_0x5bd701){logger[_0x7196('0x16')](_0x7196('0x23'),_0x5bd701['message'],_0x651d7e);_0x15c5f0(_0x4780e1['error'](0x1f4,_0x5bd701[_0x7196('0x17')]));});});};exports[_0x7196('0x2a')]=function(_0xed32cd){var _0x4c2341=this;return new Promise(function(_0x36a990,_0x2d13a5){var _0x29ba1c={'body':_0xed32cd[_0x7196('0x2b')],'channel':_0x7196('0x2c')};var _0x428d76=_[_0x7196('0x2d')](_[_0x7196('0x2e')](db['CmContact'][_0x7196('0x2f')]),[_0x7196('0x30'),'updatedAt',_0x7196('0x31'),_0x7196('0x32')]);var _0x48178f=![];if(_0xed32cd[_0x7196('0x2b')]['id']){delete _0xed32cd[_0x7196('0x2b')]['id'];}if(_[_0x7196('0x33')](_0xed32cd['body'][_0x7196('0x34')])){return _0x2d13a5(_0x4c2341[_0x7196('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x7196('0x33')](_0xed32cd[_0x7196('0x2b')]['body'])||_0xed32cd[_0x7196('0x2b')]['body']===''){return _0x2d13a5(_0x4c2341['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0xed32cd['body'][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x36')+_0x428d76));}if(!_[_0x7196('0x37')](_0x428d76,_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x38')+_0x428d76));}var _0x56ffdd={};_0x56ffdd[_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')]['from'];return db[_0x7196('0x24')][_0x7196('0x25')]({'where':{'id':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7196('0x3a')],'as':'Contacts','where':_0x56ffdd,'limit':0x1,'order':[[_0x7196('0x3b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x7196('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x7196('0x3d')}]}]})['then'](function(_0x48e3b5){if(_0x48e3b5&&_0x48e3b5[_0x7196('0x3e')]){var _0x182c8b=_0x48e3b5[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x39')]=_['omit'](_0x182c8b,[_0x7196('0x3c'),'List']);_0x29ba1c[_0x7196('0x39')][_0x7196('0x28')]=_0x48e3b5['getSmtpOptions']();_0x29ba1c[_0x7196('0x40')]=_0x182c8b[_0x7196('0x3c')];_0x29ba1c[_0x7196('0x41')]=_0x182c8b['List'];_0x29ba1c[_0x7196('0x40')]=_['orderBy'](_0x29ba1c[_0x7196('0x40')],[_0x7196('0x42')],[_0x7196('0x43')]);if(_0x29ba1c[_0x7196('0x39')]&&_0x29ba1c[_0x7196('0x39')][_0x7196('0x44')]){_0x29ba1c[_0x7196('0x40')][_0x7196('0x45')]({'id':0x0,'priority':_0x29ba1c['applications']['length']+0x1,'app':_0x7196('0x46'),'appdata':_0x7196('0x44'),'interval':_0x7196('0x47')});}if(_0x29ba1c[_0x7196('0x39')]['Applications']){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3c')];}if(_0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')]){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')];}if(_0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][_0x7196('0x49')]){return _0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][0x0];}var _0x4940a2=_[_0x7196('0xb')](_0xed32cd[_0x7196('0x2b')],{'firstName':_0xed32cd[_0x7196('0x2b')]['from'],'ListId':_0x182c8b[_0x7196('0x32')]});_0x4940a2[_0xed32cd['body'][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')][_0x7196('0x34')];return db[_0x7196('0x3a')][_0x7196('0x4a')](_0x4940a2);}else{throw new Error('List\x20not\x20found');}})[_0x7196('0xf')](function(_0x5b77fc){_0x29ba1c['contact']=_0x5b77fc;if(_0x5b77fc){if(!_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4b')]){_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')]=rs[_0x7196('0x4c')]()+'\x20'+_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x34')];}var _0x14dc43={'ContactId':_0x5b77fc['id'],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id'],'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['messageId'],'to':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x34')],'cc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['cc'],'subject':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x7196('0x50')][_0x7196('0x25')]({'where':{'closed':![],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db[_0x7196('0x51')],'as':'Messages','attributes':[_0x7196('0x4b')],'where':{'messageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x52')]}}]})[_0x7196('0xf')](function(_0x3c3d64){if(_0x3c3d64){return[_0x3c3d64,![]];}return db[_0x7196('0x50')]['create'](_0x14dc43)[_0x7196('0xf')](function(_0x2c5cba){return[_0x2c5cba,!![]];});});}else{throw new Error(_0x7196('0x53'));}})[_0x7196('0x54')](function(_0x52827f,_0x418a7a){if(_0x52827f){_0x48178f=_0x418a7a;if(!_0x418a7a){return _0x52827f[_0x7196('0x55')]({'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')],'to':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['from'],'cc':_0xed32cd['body']['message']['cc'],'subject':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x4d')],'attach':_0x52827f[_0x7196('0x4e')]?_0x52827f[_0x7196('0x4e')]:_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'substatus':null,'substatusAt':moment()[_0x7196('0x4f')](_0x7196('0x56')),'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x52827f;}}})['then'](function(_0x4542c1){_0x29ba1c[_0x7196('0x57')]=_0x4542c1[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x57')][_0x7196('0x58')]=_0x48178f;return db[_0x7196('0x51')][_0x7196('0x4a')]({'body':_0xed32cd[_0x7196('0x2b')]['body'],'MailAccountId':_0xed32cd['account']['id'],'MailInteractionId':_0x4542c1['id'],'direction':'in','ContactId':_0x29ba1c[_0x7196('0x59')]['id'],'messageId':_0xed32cd['body'][_0x7196('0x17')]['messageId'],'from':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x34')],'to':_0xed32cd[_0x7196('0x2b')]['message']['to'],'cc':_0xed32cd['body'][_0x7196('0x17')]['cc'],'subject':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'Attachments':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x5a')],'originTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5b')],'originCc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5c')],'bcc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5d')],'ChatWebsiteId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['ChatWebsiteId']||null,'originChannel':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['originChannel']||'Email','ChatOfflineMessageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x7196('0x5f')}]});})['then'](function(_0x218396){_0x29ba1c[_0x7196('0x17')]=_0x218396;if(_0x29ba1c['interaction'][_0x7196('0x60')]){return db['User']['find']({'attributes':['id',_0x7196('0x61')],'where':{'id':_0x29ba1c[_0x7196('0x57')][_0x7196('0x60')]}})['then'](function(_0x423b83){if(_0x423b83){_0x29ba1c['applications'][_0x7196('0x62')]({'id':0x0,'priority':0x0,'app':_0x7196('0x63'),'appdata':_0x423b83[_0x7196('0x61')]+','+(_0x29ba1c[_0x7196('0x39')][_0x7196('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);})[_0x7196('0xf')](function(_0x29bafd){_0x36a990(_0x29bafd);})[_0x7196('0x19')](function(_0x34633a){_0x2d13a5(_0x4c2341['error'](0x1f4,_0x34633a[_0x7196('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index a05178b..449c79a 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 _0x8b3b=['removeListener','register','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x1f1f3b,_0x227aa9){var _0x2e63aa=function(_0x165a34){while(--_0x165a34){_0x1f1f3b['push'](_0x1f1f3b['shift']());}};_0x2e63aa(++_0x227aa9);}(_0x8b3b,0x6c));var _0xb8b3=function(_0x5abdfc,_0x385c27){_0x5abdfc=_0x5abdfc-0x0;var _0x124657=_0x8b3b[_0x5abdfc];return _0x124657;};'use strict';var MailAccountEvents=require(_0xb8b3('0x0'));var events=[_0xb8b3('0x1'),_0xb8b3('0x2'),_0xb8b3('0x3')];function createListener(_0x5b40f3,_0x5a4c75){return function(_0x265438){_0x5a4c75['emit'](_0x5b40f3,_0x265438);};}function removeListener(_0x1a7e52,_0xed3888){return function(){MailAccountEvents[_0xb8b3('0x4')](_0x1a7e52,_0xed3888);};}exports[_0xb8b3('0x5')]=function(_0x40a038){for(var _0x622db1=0x0,_0x317075=events['length'];_0x622db1<_0x317075;_0x622db1++){var _0xcb58fc=events[_0x622db1];var _0x4cbc04=createListener(_0xb8b3('0x6')+_0xcb58fc,_0x40a038);MailAccountEvents['on'](_0xcb58fc,_0x4cbc04);}}; \ No newline at end of file +var _0x864e=['removeListener','register','mailAccount:','./mailAccount.events','remove','update'];(function(_0x2f7cb2,_0xc83fe6){var _0xbcb3e5=function(_0x19f4a5){while(--_0x19f4a5){_0x2f7cb2['push'](_0x2f7cb2['shift']());}};_0xbcb3e5(++_0xc83fe6);}(_0x864e,0x13b));var _0xe864=function(_0x386658,_0x49f7c5){_0x386658=_0x386658-0x0;var _0x146125=_0x864e[_0x386658];return _0x146125;};'use strict';var MailAccountEvents=require(_0xe864('0x0'));var events=['save',_0xe864('0x1'),_0xe864('0x2')];function createListener(_0x4ce537,_0x46a35d){return function(_0x45b563){_0x46a35d['emit'](_0x4ce537,_0x45b563);};}function removeListener(_0x26cb42,_0x16483e){return function(){MailAccountEvents[_0xe864('0x3')](_0x26cb42,_0x16483e);};}exports[_0xe864('0x4')]=function(_0x458f8c){for(var _0x4114a8=0x0,_0x192b78=events['length'];_0x4114a8<_0x192b78;_0x4114a8++){var _0x141284=events[_0x4114a8];var _0x2b187d=createListener(_0xe864('0x5')+_0x141284,_0x458f8c);MailAccountEvents['on'](_0x141284,_0x2b187d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 084b673..7304c74 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 _0x2398=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','show','put','isAuthenticated','update','delete','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2398,0xfc));var _0x8239=function(_0x52c06e,_0x47059f){_0x52c06e=_0x52c06e-0x0;var _0x340604=_0x2398[_0x52c06e];return _0x340604;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8239('0x0'));var express=require('express');var router=express[_0x8239('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8239('0x2'));var config=require(_0x8239('0x3'));var controller=require(_0x8239('0x4'));router['get'](_0x8239('0x5'),auth['isAuthenticated'](),controller[_0x8239('0x6')]);router[_0x8239('0x7')](_0x8239('0x5'),auth[_0x8239('0x8')](),controller[_0x8239('0x9')]);router[_0x8239('0xa')]('/:id',auth[_0x8239('0x8')](),controller['destroy']);module[_0x8239('0xb')]=router; \ No newline at end of file +var _0xe09e=['/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0xf4e19d,_0x1e2d95){var _0x2d5adf=function(_0x13130e){while(--_0x13130e){_0xf4e19d['push'](_0xf4e19d['shift']());}};_0x2d5adf(++_0x1e2d95);}(_0xe09e,0x196));var _0xee09=function(_0x165f36,_0x5917ed){_0x165f36=_0x165f36-0x0;var _0x5eb673=_0xe09e[_0x165f36];return _0x5eb673;};'use strict';var multer=require(_0xee09('0x0'));var util=require(_0xee09('0x1'));var path=require(_0xee09('0x2'));var timeout=require(_0xee09('0x3'));var express=require(_0xee09('0x4'));var router=express[_0xee09('0x5')]();var fs_extra=require(_0xee09('0x6'));var auth=require(_0xee09('0x7'));var interaction=require(_0xee09('0x8'));var config=require(_0xee09('0x9'));var controller=require(_0xee09('0xa'));router[_0xee09('0xb')](_0xee09('0xc'),auth[_0xee09('0xd')](),controller[_0xee09('0xe')]);router['put'](_0xee09('0xc'),auth['isAuthenticated'](),controller[_0xee09('0xf')]);router[_0xee09('0x10')](_0xee09('0xc'),auth['isAuthenticated'](),controller[_0xee09('0x11')]);module[_0xee09('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a114f37..73f13da 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 _0x7a21=['noop','*,*,*,*','STRING'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x7a21,0x1f1));var _0x17a2=function(_0x32f170,_0x18efab){_0x32f170=_0x32f170-0x0;var _0x2ee070=_0x7a21[_0x32f170];return _0x2ee070;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x17a2('0x0')],'allowNull':![],'defaultValue':_0x17a2('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x17a2('0x0')]},'interval':{'type':Sequelize[_0x17a2('0x0')],'defaultValue':_0x17a2('0x2')}}; \ No newline at end of file +var _0x4a80=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0xfc98cb,_0x3aa3f5){var _0x256e19=function(_0x7432f){while(--_0x7432f){_0xfc98cb['push'](_0xfc98cb['shift']());}};_0x256e19(++_0x3aa3f5);}(_0x4a80,0x120));var _0x04a8=function(_0x45a394,_0x139086){_0x45a394=_0x45a394-0x0;var _0x3ffd52=_0x4a80[_0x45a394];return _0x3ffd52;};'use strict';var Sequelize=require(_0x04a8('0x0'));module[_0x04a8('0x1')]={'priority':{'type':Sequelize[_0x04a8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x04a8('0x3')],'allowNull':![],'defaultValue':_0x04a8('0x4')},'appdata':{'type':Sequelize[_0x04a8('0x5')]()},'description':{'type':Sequelize[_0x04a8('0x3')]},'interval':{'type':Sequelize[_0x04a8('0x3')],'defaultValue':_0x04a8('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 0620247..7b5a623 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 _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x1b69d3,_0x538d0d){var _0x192d3f=function(_0x23817b){while(--_0x23817b){_0x1b69d3['push'](_0x1b69d3['shift']());}};_0x192d3f(++_0x538d0d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x58ee16,_0x138e8f){_0x58ee16=_0x58ee16-0x0;var _0x57a0d2=_0xb43b[_0x58ee16];return _0x57a0d2;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2d9a04,_0x5e864c){var _0x16ae57=function(_0x124863){while(--_0x124863){_0x2d9a04['push'](_0x2d9a04['shift']());}};_0x16ae57(++_0x5e864c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 17b4131..8f2bc71 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 _0xfe63=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xfe63,0x1da));var _0x3fe6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfe63[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x3fe6('0x0'));var util=require('util');var logger=require(_0x3fe6('0x1'))(_0x3fe6('0x2'));var moment=require(_0x3fe6('0x3'));var BPromise=require(_0x3fe6('0x4'));var rp=require(_0x3fe6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3fe6('0x6'));var config=require(_0x3fe6('0x7'));var attributes=require(_0x3fe6('0x8'));module[_0x3fe6('0x9')]=function(_0x25ca6f,_0x2b1974){return _0x25ca6f[_0x3fe6('0xa')](_0x3fe6('0xb'),attributes,{'tableName':_0x3fe6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fe6('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6a84=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications'];(function(_0xbde830,_0x3aeb59){var _0x4eeb2f=function(_0x53f58b){while(--_0x53f58b){_0xbde830['push'](_0xbde830['shift']());}};_0x4eeb2f(++_0x3aeb59);}(_0x6a84,0xe2));var _0x46a8=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x6a84[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x46a8('0x0'));var util=require(_0x46a8('0x1'));var logger=require(_0x46a8('0x2'))('api');var moment=require(_0x46a8('0x3'));var BPromise=require('bluebird');var rp=require(_0x46a8('0x4'));var fs=require('fs');var path=require(_0x46a8('0x5'));var rimraf=require(_0x46a8('0x6'));var config=require(_0x46a8('0x7'));var attributes=require(_0x46a8('0x8'));module['exports']=function(_0x2830dd,_0x2293a6){return _0x2830dd[_0x46a8('0x9')](_0x46a8('0xa'),attributes,{'tableName':_0x46a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46a8('0xc'),'collate':_0x46a8('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 8c998a7..7c74324 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 _0x64d9=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','body','options','where','attributes','limit','UpdateMailApplication','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x49b72c,_0x2d115d){var _0x3a4324=function(_0x2dcbc2){while(--_0x2dcbc2){_0x49b72c['push'](_0x49b72c['shift']());}};_0x3a4324(++_0x2d115d);}(_0x64d9,0xb2));var _0x964d=function(_0x4d3d7a,_0x30417f){_0x4d3d7a=_0x4d3d7a-0x0;var _0x189f73=_0x64d9[_0x4d3d7a];return _0x189f73;};'use strict';var _=require(_0x964d('0x0'));var util=require(_0x964d('0x1'));var moment=require('moment');var BPromise=require(_0x964d('0x2'));var rs=require(_0x964d('0x3'));var fs=require('fs');var Redis=require(_0x964d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x964d('0x5'));var logger=require('../../config/logger')(_0x964d('0x6'));var config=require(_0x964d('0x7'));var jayson=require(_0x964d('0x8'));var client=jayson[_0x964d('0x9')][_0x964d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x66760a,_0x258efb,_0x43f99c){return new BPromise(function(_0x3fbbaa,_0x49926b){return client['request'](_0x66760a,_0x43f99c)[_0x964d('0xb')](function(_0xd5eafb){logger[_0x964d('0xc')](_0x964d('0xd'),_0x258efb,_0x964d('0xe'));logger['debug'](_0x964d('0xf'),_0x258efb,'request\x20sent',JSON['stringify'](_0xd5eafb));if(_0xd5eafb[_0x964d('0x10')]){if(_0xd5eafb['error'][_0x964d('0x11')]===0x1f4){logger[_0x964d('0x10')]('MailApplication,\x20%s,\x20%s',_0x258efb,_0xd5eafb[_0x964d('0x10')][_0x964d('0x12')]);return _0x49926b(_0xd5eafb[_0x964d('0x10')][_0x964d('0x12')]);}logger[_0x964d('0x10')](_0x964d('0xd'),_0x258efb,_0xd5eafb[_0x964d('0x10')]['message']);return _0x3fbbaa(_0xd5eafb[_0x964d('0x10')][_0x964d('0x12')]);}else{logger[_0x964d('0xc')](_0x964d('0xd'),_0x258efb,_0x964d('0xe'));_0x3fbbaa(_0xd5eafb['result'][_0x964d('0x12')]);}})[_0x964d('0x13')](function(_0x120715){logger[_0x964d('0x10')](_0x964d('0xd'),_0x258efb,_0x120715);_0x49926b(_0x120715);});});}exports['UpdateMailApplication']=function(_0x33e84e){var _0x31a1ef=this;return new Promise(function(_0x2034ea,_0x4f52a4){return db['MailApplication']['update'](_0x33e84e[_0x964d('0x14')],{'raw':_0x33e84e[_0x964d('0x15')]?_0x33e84e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33e84e[_0x964d('0x15')]?_0x33e84e[_0x964d('0x15')][_0x964d('0x16')]||null:null,'attributes':_0x33e84e[_0x964d('0x15')]?_0x33e84e[_0x964d('0x15')][_0x964d('0x17')]||null:null,'limit':_0x33e84e[_0x964d('0x15')]?_0x33e84e[_0x964d('0x15')][_0x964d('0x18')]||null:null})[_0x964d('0xb')](function(_0x4832c2){logger[_0x964d('0xc')](_0x964d('0x19'),_0x33e84e);logger[_0x964d('0x1a')](_0x964d('0x19'),_0x33e84e,JSON['stringify'](_0x4832c2));_0x2034ea(_0x4832c2);})[_0x964d('0x13')](function(_0x2d0f59){logger[_0x964d('0x10')](_0x964d('0x19'),_0x2d0f59['message'],_0x33e84e);_0x4f52a4(_0x31a1ef[_0x964d('0x10')](0x1f4,_0x2d0f59[_0x964d('0x12')]));});});}; \ No newline at end of file +var _0xa6be=['message','UpdateMailApplication','MailApplication','body','options','raw','where','limit','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xa6be,0x7a));var _0xea6b=function(_0x47d526,_0x5ab74b){_0x47d526=_0x47d526-0x0;var _0x2aab7f=_0xa6be[_0x47d526];return _0x2aab7f;};'use strict';var _=require('lodash');var util=require(_0xea6b('0x0'));var moment=require(_0xea6b('0x1'));var BPromise=require('bluebird');var rs=require(_0xea6b('0x2'));var fs=require('fs');var Redis=require(_0xea6b('0x3'));var db=require(_0xea6b('0x4'))['db'];var utils=require(_0xea6b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xea6b('0x6'));var client=jayson[_0xea6b('0x7')][_0xea6b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e87e4,_0x306494,_0x382f6d){return new BPromise(function(_0x9f0376,_0x56503d){return client[_0xea6b('0x9')](_0x2e87e4,_0x382f6d)[_0xea6b('0xa')](function(_0x19fb39){logger['info'](_0xea6b('0xb'),_0x306494,_0xea6b('0xc'));logger[_0xea6b('0xd')](_0xea6b('0xe'),_0x306494,_0xea6b('0xc'),JSON[_0xea6b('0xf')](_0x19fb39));if(_0x19fb39[_0xea6b('0x10')]){if(_0x19fb39[_0xea6b('0x10')][_0xea6b('0x11')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x306494,_0x19fb39[_0xea6b('0x10')][_0xea6b('0x12')]);return _0x56503d(_0x19fb39[_0xea6b('0x10')][_0xea6b('0x12')]);}logger[_0xea6b('0x10')](_0xea6b('0xb'),_0x306494,_0x19fb39[_0xea6b('0x10')][_0xea6b('0x12')]);return _0x9f0376(_0x19fb39[_0xea6b('0x10')][_0xea6b('0x12')]);}else{logger['info'](_0xea6b('0xb'),_0x306494,'request\x20sent');_0x9f0376(_0x19fb39['result'][_0xea6b('0x12')]);}})['catch'](function(_0x3d4426){logger['error'](_0xea6b('0xb'),_0x306494,_0x3d4426);_0x56503d(_0x3d4426);});});}exports[_0xea6b('0x13')]=function(_0x529fb2){var _0x18959e=this;return new Promise(function(_0x59203d,_0x1f84c0){return db[_0xea6b('0x14')]['update'](_0x529fb2[_0xea6b('0x15')],{'raw':_0x529fb2['options']?_0x529fb2[_0xea6b('0x16')][_0xea6b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529fb2['options']?_0x529fb2['options'][_0xea6b('0x18')]||null:null,'attributes':_0x529fb2[_0xea6b('0x16')]?_0x529fb2['options']['attributes']||null:null,'limit':_0x529fb2[_0xea6b('0x16')]?_0x529fb2['options'][_0xea6b('0x19')]||null:null})[_0xea6b('0xa')](function(_0x24cbf8){logger[_0xea6b('0x1a')](_0xea6b('0x13'),_0x529fb2);logger['debug'](_0xea6b('0x13'),_0x529fb2,JSON[_0xea6b('0xf')](_0x24cbf8));_0x59203d(_0x24cbf8);})[_0xea6b('0x1b')](function(_0x1ce81e){logger[_0xea6b('0x10')](_0xea6b('0x13'),_0x1ce81e[_0xea6b('0x12')],_0x529fb2);_0x1f84c0(_0x18959e[_0xea6b('0x10')](0x1f4,_0x1ce81e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index fd55973..6c782d1 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 _0xbc38=['mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','mail','addTags','put','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbc38,0x93));var _0x8bc3=function(_0x51eecd,_0x352944){_0x51eecd=_0x51eecd-0x0;var _0x264a72=_0xbc38[_0x51eecd];return _0x264a72;};'use strict';var express=require(_0x8bc3('0x0'));var router=express[_0x8bc3('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x8bc3('0x2'));var controller=require(_0x8bc3('0x3'));router['get']('/',auth[_0x8bc3('0x4')](),controller[_0x8bc3('0x5')]);router[_0x8bc3('0x6')](_0x8bc3('0x7'),auth[_0x8bc3('0x4')](),controller['describe']);router[_0x8bc3('0x6')]('/:id',auth[_0x8bc3('0x4')](),controller[_0x8bc3('0x8')]);router['get'](_0x8bc3('0x9'),auth['isAuthenticated'](),controller[_0x8bc3('0xa')]);router['get'](_0x8bc3('0xb'),auth[_0x8bc3('0x4')](),controller['download']);router[_0x8bc3('0xc')]('/',auth[_0x8bc3('0x4')](),controller[_0x8bc3('0xd')]);router[_0x8bc3('0xc')](_0x8bc3('0x9'),auth[_0x8bc3('0x4')](),controller[_0x8bc3('0xe')]);router['post'](_0x8bc3('0xf'),auth[_0x8bc3('0x4')](),interaction[_0x8bc3('0x10')](_0x8bc3('0x11'),'mailinteraction:addtags'),controller[_0x8bc3('0x12')]);router[_0x8bc3('0x13')](_0x8bc3('0x14'),auth[_0x8bc3('0x4')](),interaction[_0x8bc3('0x10')](_0x8bc3('0x11'),_0x8bc3('0x15')),controller[_0x8bc3('0x16')]);router[_0x8bc3('0x17')](_0x8bc3('0x14'),auth[_0x8bc3('0x4')](),interaction['tracked'](_0x8bc3('0x11'),_0x8bc3('0x18')),controller[_0x8bc3('0x19')]);router[_0x8bc3('0x17')](_0x8bc3('0xf'),auth[_0x8bc3('0x4')](),controller[_0x8bc3('0x1a')]);module[_0x8bc3('0x1b')]=router; \ No newline at end of file +var _0x9a48=['/:id/download','download','post','addMessage','tracked','mail','addTags','put','delete','destroy','/:id/tags','removeTags','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages'];(function(_0x1af577,_0x1bd440){var _0x18ec4f=function(_0x4c9f95){while(--_0x4c9f95){_0x1af577['push'](_0x1af577['shift']());}};_0x18ec4f(++_0x1bd440);}(_0x9a48,0x114));var _0x89a4=function(_0x30099e,_0x1ee4b2){_0x30099e=_0x30099e-0x0;var _0x474f63=_0x9a48[_0x30099e];return _0x474f63;};'use strict';var express=require(_0x89a4('0x0'));var router=express['Router']();var auth=require(_0x89a4('0x1'));var interaction=require(_0x89a4('0x2'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x89a4('0x3')](),controller['index']);router[_0x89a4('0x4')](_0x89a4('0x5'),auth[_0x89a4('0x3')](),controller[_0x89a4('0x6')]);router[_0x89a4('0x4')](_0x89a4('0x7'),auth['isAuthenticated'](),controller[_0x89a4('0x8')]);router[_0x89a4('0x4')](_0x89a4('0x9'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x89a4('0xa'),auth[_0x89a4('0x3')](),controller[_0x89a4('0xb')]);router[_0x89a4('0xc')]('/',auth[_0x89a4('0x3')](),controller['create']);router[_0x89a4('0xc')](_0x89a4('0x9'),auth[_0x89a4('0x3')](),controller[_0x89a4('0xd')]);router['post']('/:id/tags',auth[_0x89a4('0x3')](),interaction[_0x89a4('0xe')](_0x89a4('0xf'),'mailinteraction:addtags'),controller[_0x89a4('0x10')]);router[_0x89a4('0x11')]('/:id',auth['isAuthenticated'](),interaction[_0x89a4('0xe')](_0x89a4('0xf'),'mailinteraction:update'),controller['update']);router[_0x89a4('0x12')](_0x89a4('0x7'),auth[_0x89a4('0x3')](),interaction[_0x89a4('0xe')](_0x89a4('0xf'),'mailinteraction:destroy'),controller[_0x89a4('0x13')]);router[_0x89a4('0x12')](_0x89a4('0x14'),auth[_0x89a4('0x3')](),controller[_0x89a4('0x15')]);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 616a999..d61a64d 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 _0xdb26=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb26,0xb7));var _0x6db2=function(_0x271a80,_0x268bac){_0x271a80=_0x271a80-0x0;var _0xf8233e=_0xdb26[_0x271a80];return _0xf8233e;};'use strict';var Sequelize=require(_0x6db2('0x0'));var iconv=require('iconv');module[_0x6db2('0x1')]={'closed':{'type':Sequelize[_0x6db2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6db2('0x3')]},'disposition':{'type':Sequelize[_0x6db2('0x4')]},'secondDisposition':{'type':Sequelize[_0x6db2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6db2('0x4')]},'note':{'type':Sequelize[_0x6db2('0x4')]},'inReplyTo':{'type':Sequelize[_0x6db2('0x4')](0x1fe)},'to':{'type':Sequelize[_0x6db2('0x4')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x6db2('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6db2('0x3')]},'substatus':{'type':Sequelize[_0x6db2('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x6db2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6db2('0x5')]('in',_0x6db2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6db2('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6db2('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6db2('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x03af=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0xda6d0f,_0x35e271){var _0x244540=function(_0x30f643){while(--_0x30f643){_0xda6d0f['push'](_0xda6d0f['shift']());}};_0x244540(++_0x35e271);}(_0x03af,0xaf));var _0xf03a=function(_0x2b69c8,_0x21e601){_0x2b69c8=_0x2b69c8-0x0;var _0x4d190a=_0x03af[_0x2b69c8];return _0x4d190a;};'use strict';var Sequelize=require(_0xf03a('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0xf03a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf03a('0x2')]},'disposition':{'type':Sequelize[_0xf03a('0x3')]},'secondDisposition':{'type':Sequelize[_0xf03a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf03a('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xf03a('0x3')](0x1fe)},'to':{'type':Sequelize[_0xf03a('0x3')]},'cc':{'type':Sequelize[_0xf03a('0x4')](_0xf03a('0x5'))},'subject':{'type':Sequelize[_0xf03a('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xf03a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf03a('0x6')]('in',_0xf03a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf03a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf03a('0x6')]('in',_0xf03a('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf03a('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index fed4cf3..d2affc3 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 _0xa23f=['buildExpression','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','rows','show','params','includeAll','include','merge','options','create','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','addTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','writeFileSync','message%d.eml','eml-format','rimraf','bluebird','util','path','lodash','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','update','then','error','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','push','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','MailInteraction','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0xa23f,0x7c));var _0xfa23=function(_0x3649cf,_0x5bec7a){_0x3649cf=_0x3649cf-0x0;var _0x52930a=_0xa23f[_0x3649cf];return _0x52930a;};'use strict';var emlformat=require(_0xfa23('0x0'));var rimraf=require(_0xfa23('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0xfa23('0x2'));var util=require(_0xfa23('0x3'));var path=require(_0xfa23('0x4'));var fs=require('fs');var _=require(_0xfa23('0x5'));var squel=require('squel');var juice=require(_0xfa23('0x6'));var Redis=require('ioredis');var qs=require(_0xfa23('0x7'));var as=require(_0xfa23('0x8'));var logger=require(_0xfa23('0x9'))(_0xfa23('0xa'));var config=require('../../config/environment');var db=require(_0xfa23('0xb'))['db'];var htmlEntities=require('html-entities');config[_0xfa23('0xc')]=_[_0xfa23('0xd')](config[_0xfa23('0xc')],{'host':_0xfa23('0xe'),'port':0x18eb});var socket=require(_0xfa23('0xf'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xfa23('0x10')](socket);function respondWithStatusCode(_0x4ea7a8,_0x3128d3){_0x3128d3=_0x3128d3||0xcc;return function(_0x5c0ec9){if(_0x5c0ec9){return _0x4ea7a8[_0xfa23('0x11')](_0x3128d3);}return _0x4ea7a8[_0xfa23('0x12')](_0x3128d3)[_0xfa23('0x13')]();};}function respondWithResult(_0x52ef2a,_0x1e5ffe){_0x1e5ffe=_0x1e5ffe||0xc8;return function(_0x42380){if(_0x42380){return _0x52ef2a[_0xfa23('0x12')](_0x1e5ffe)['json'](_0x42380);}};}function respondWithFilteredResult(_0x56f927,_0x17e782){return function(_0x23712b){if(_0x23712b){var _0x3f50f0=typeof _0x17e782[_0xfa23('0x14')]==='undefined'&&typeof _0x17e782[_0xfa23('0x15')]===_0xfa23('0x16');var _0x2095a5=_0x23712b[_0xfa23('0x17')];var _0x542d9a=_0x3f50f0?0x0:_0x17e782[_0xfa23('0x14')];var _0x39729e=_0x3f50f0?_0x23712b[_0xfa23('0x17')]:_0x17e782[_0xfa23('0x14')]+_0x17e782[_0xfa23('0x15')];var _0x4e5b77;if(_0x39729e>=_0x2095a5){_0x39729e=_0x2095a5;_0x4e5b77=0xc8;}else{_0x4e5b77=0xce;}_0x56f927['status'](_0x4e5b77);return _0x56f927['set'](_0xfa23('0x18'),_0x542d9a+'-'+_0x39729e+'/'+_0x2095a5)[_0xfa23('0x19')](_0x23712b);}return null;};}function saveUpdates(_0x4bd0e0){return function(_0x9effe6){if(_0x9effe6){return _0x9effe6[_0xfa23('0x1a')](_0x4bd0e0)[_0xfa23('0x1b')](function(_0x54bb04){return _0x54bb04;});}return null;};}function removeEntity(_0x1970ec){return function(_0x452604){if(_0x452604){return _0x452604['destroy']()[_0xfa23('0x1b')](function(){_0x1970ec[_0xfa23('0x12')](0xcc)[_0xfa23('0x13')]();});}};}function handleEntityNotFound(_0x1b9994){return function(_0x2ce89a){if(!_0x2ce89a){_0x1b9994[_0xfa23('0x11')](0x194);}return _0x2ce89a;};}function handleError(_0x31eedb,_0x485838){_0x485838=_0x485838||0x1f4;return function(_0x147228){logger[_0xfa23('0x1c')](_0x147228[_0xfa23('0x1d')]);if(_0x147228[_0xfa23('0x1e')]){delete _0x147228['name'];}_0x31eedb[_0xfa23('0x12')](_0x485838)['send'](_0x147228);};}function getInteractionUsers(_0x34ecab,_0x1abb42){return new BPromise(function(_0x2481e9,_0x26bdce){try{if(_0x1abb42[_0x34ecab['id']]){_0x34ecab[_0xfa23('0x1f')]=_[_0xfa23('0x20')](_0x1abb42[_0x34ecab['id']],function(_0x21bbc0){return{'id':_0x21bbc0['id'],'fullname':_0x21bbc0[_0xfa23('0x21')]};});}}catch(_0x5e1780){_0x26bdce(_0x5e1780);}_0x2481e9(_0x34ecab);});}function getInteractionTags(_0x2ae826,_0x4ab34d){return new BPromise(function(_0x1ae38a,_0x5de208){try{if(_0x2ae826['TagIds']){_0x2ae826[_0xfa23('0x22')]=[];_0x2ae826[_0xfa23('0x23')][_0xfa23('0x24')](',')[_0xfa23('0x25')](function(_0x374169){_0x2ae826[_0xfa23('0x22')][_0xfa23('0x26')](_0x4ab34d[_0x374169]);});}delete _0x2ae826['TagIds'];}catch(_0x591797){_0x5de208(_0x591797);}_0x1ae38a(_0x2ae826);});}function getLastMessageText(_0x47ced6){return new BPromise(function(_0x380d42,_0x6bf719){return db['MailMessage'][_0xfa23('0x27')]({'where':{'$and':[{'MailInteractionId':_0x47ced6['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xfa23('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xfa23('0x29')],'order':_0xfa23('0x2a'),'raw':!![]})[_0xfa23('0x1b')](function(_0x16393f){if(_0x16393f&&_0x16393f[_0xfa23('0x29')]){_0x47ced6[_0xfa23('0x2b')]=_[_0xfa23('0x2c')](_0x16393f['plainBody']);}_0x380d42(_0x47ced6);})[_0xfa23('0x2d')](function(_0x59c393){_0x6bf719(_0x59c393);});});}function updateMailInteraction(_0x9d0602,_0x41d235,_0x451e40,_0xaa1d77){return new BPromise(function(_0x1801f1,_0x8ac724){return getInteractionUsers(_0x9d0602,_0x451e40)[_0xfa23('0x1b')](function(_0x33aa43){return getInteractionTags(_0x33aa43,_0x41d235);})[_0xfa23('0x1b')](function(_0x59aa98){return getStateInteraction(_0x59aa98);})[_0xfa23('0x1b')](function(_0x4e82a3){if(_0xaa1d77){_0x1801f1(getLastMessageText(_0x4e82a3));}else{_0x1801f1(_0x4e82a3);}})[_0xfa23('0x2d')](function(_0x88a593){_0x8ac724(_0x88a593);});});}function getStateInteraction(_0x17c407){return new BPromise(function(_0x30ea1e){_0x17c407[_0xfa23('0x2e')]=0x0;_0x17c407[_0xfa23('0x2f')]=0x0;_0x17c407[_0xfa23('0x30')]=0x0;_0x17c407['unmanaged']=0x0;_0x17c407[_0xfa23('0x31')]=0x0;if(!_0x17c407[_0xfa23('0x32')]&&!_0x17c407[_0xfa23('0x33')]){_0x17c407[_0xfa23('0x2e')]+=0x1;}if(!_0x17c407['closed']&&_0x17c407['UserId']){_0x17c407['talking']+=0x1;if(_0x17c407[_0xfa23('0x2e')]){_0x17c407[_0xfa23('0x2e')]-=0x1;}}if(_0x17c407['closed']&&_0x17c407[_0xfa23('0x33')]){_0x17c407[_0xfa23('0x30')]+=0x1;if(_0x17c407[_0xfa23('0x2f')]){_0x17c407['talking']-=0x1;}}if(_0x17c407[_0xfa23('0x32')]&&!_0x17c407['UserId']){_0x17c407[_0xfa23('0x34')]+=0x1;if(_0x17c407[_0xfa23('0x2e')]){_0x17c407[_0xfa23('0x2e')]-=0x1;}}_0x17c407[_0xfa23('0x31')]+=0x1;_0x30ea1e(_0x17c407);});}exports[_0xfa23('0x35')]=function(_0x80827f,_0x58fc41){var _0xe546db={},_0x3c4743={},_0x43eb23={'count':0x0,'rows':[]};var _0x245f49=_['map'](db[_0xfa23('0x36')][_0xfa23('0x37')],function(_0x15480c){return{'name':_0x15480c[_0xfa23('0x38')],'type':_0x15480c[_0xfa23('0x39')][_0xfa23('0x3a')]};});_0x3c4743['model']=_[_0xfa23('0x20')](_0x245f49,'name');_0x3c4743['query']=_[_0xfa23('0x3b')](_0x80827f[_0xfa23('0x3c')]);_0x3c4743['filters']=_[_0xfa23('0x3d')](_0x3c4743[_0xfa23('0x3e')],_0x3c4743[_0xfa23('0x3c')]);_0xe546db['attributes']=_[_0xfa23('0x3d')](_0x3c4743[_0xfa23('0x3e')],qs[_0xfa23('0x3f')](_0x80827f['query']['fields']));_0xe546db[_0xfa23('0x40')]=_0xe546db['attributes'][_0xfa23('0x41')]?_0xe546db[_0xfa23('0x40')]:_0x3c4743[_0xfa23('0x3e')];if(!_0x80827f['query'][_0xfa23('0x42')](_0xfa23('0x43'))){_0xe546db[_0xfa23('0x15')]=qs[_0xfa23('0x15')](_0x80827f['query'][_0xfa23('0x15')]);_0xe546db[_0xfa23('0x14')]=qs[_0xfa23('0x14')](_0x80827f['query']['offset']);}_0xe546db[_0xfa23('0x44')]=qs['sort'](_0x80827f[_0xfa23('0x3c')][_0xfa23('0x45')]);_0xe546db[_0xfa23('0x46')]=qs[_0xfa23('0x47')](_[_0xfa23('0x48')](_0x80827f[_0xfa23('0x3c')],_0x3c4743['filters']),_0x245f49);var _0xd2345d=[];var _0x1ca7c3=squel[_0xfa23('0x49')]()[_0xfa23('0x4a')]('id')[_0xfa23('0x4a')](_0xfa23('0x1e'))['field'](_0xfa23('0x4b'))[_0xfa23('0x4c')](_0xfa23('0x4d'));var _0x2f6a37=squel[_0xfa23('0x49')]()['field'](_0xfa23('0x4e'))[_0xfa23('0x4a')](_0xfa23('0x4f'))['field'](_0xfa23('0x50'))[_0xfa23('0x4c')](_0xfa23('0x51'),'ui')[_0xfa23('0x52')](_0xfa23('0x53'),'u',_0xfa23('0x54'));var _0x709755=squel['select']()[_0xfa23('0x4c')]('mail_interactions','i')[_0xfa23('0x52')](_0xfa23('0x55'),'c',_0xfa23('0x56'))[_0xfa23('0x52')](_0xfa23('0x53'),'o',_0xfa23('0x57'))['left_join'](_0xfa23('0x58'),'a',_0xfa23('0x59'))[_0xfa23('0x52')](_0xfa23('0x5a'),'me',_0xfa23('0x5b'))[_0xfa23('0x52')](_0xfa23('0x5c'),'it','it.MailInteractionId\x20=\x20i.id')[_0xfa23('0x52')](_0xfa23('0x4d'),'t',_0xfa23('0x5d'));var _0xd64189=squel['expr']();var _0xbb8b7d=[];var _0x9bf852=squel[_0xfa23('0x5e')]();var _0x26e171;if(_0x80827f[_0xfa23('0x3c')][_0xfa23('0x5f')]){_0x26e171=as['parseSearch'](_0x80827f[_0xfa23('0x3c')]['search']);var _0x476fdc=_0x26e171[_0xfa23('0x60')];for(var _0x595cdb=0x0;_0x595cdb<_0x26e171[_0xfa23('0x61')][_0xfa23('0x41')];_0x595cdb++){var _0x5a5397=_0x26e171[_0xfa23('0x61')][_0x595cdb];var _0xb9b7d8='i';var _0x5d3777=_[_0xfa23('0x62')](_0x245f49,[_0xfa23('0x1e'),_0x5a5397[_0xfa23('0x4a')]]);if(!_0x5d3777){switch(_0x5a5397[_0xfa23('0x4a')]){case'unreadMessages':if(_0x5a5397[_0xfa23('0x63')]==0x1){_0x709755[_0xfa23('0x64')]('`'+_0x5a5397['field']+_0xfa23('0x65'));}else{_0x709755[_0xfa23('0x64')]('`'+_0x5a5397[_0xfa23('0x4a')]+_0xfa23('0x66'));}break;case _0xfa23('0x67'):if(_0x5a5397[_0xfa23('0x68')]==='$substring'){if(_0x5a5397[_0xfa23('0x63')][_0xfa23('0x24')]('\x20')[_0xfa23('0x41')]>0x1){_0xd64189[_0x476fdc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfa23('0x69')](_0x5a5397[_0xfa23('0x63')]),null);}else{var _0x1ea6a1='%'+_0x5a5397['value']+'%';_0xd64189[_0x476fdc](_0xfa23('0x6a'),_0x1ea6a1,_0x1ea6a1,_0x1ea6a1);}}else{_0x5d3777=_[_0xfa23('0x62')](_0x245f49,[_0xfa23('0x1e'),_0xfa23('0x6b')]);_0x5a5397[_0xfa23('0x4a')]='ContactId';_0x4c2103=as['buildExpression'](_0xb9b7d8,_0x5d3777[_0xfa23('0x39')],_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103[_0xfa23('0x6c')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x6d')],_0x4c2103['value']['end']);}break;case _0xfa23('0x6e'):var _0x303ee9=_0x5a5397[_0xfa23('0x63')][_0xfa23('0x24')](',')['map'](function(_0x41ac7a){return Number(_0x41ac7a);});_0x303ee9[_0xfa23('0x25')](function(_0x4b1545){_0x9bf852['or'](_0xfa23('0x6f'),'%,'+_0x4b1545+',%');});_0xbb8b7d=_[_0xfa23('0x70')](_0xbb8b7d,_0x303ee9);break;case'User':if(_0x5a5397[_0xfa23('0x68')]===_0xfa23('0x71')){_0xd64189[_0x476fdc](_0xfa23('0x72'),'%'+_0x5a5397[_0xfa23('0x63')]+'%',null);}else{_0x5d3777=_[_0xfa23('0x62')](_0x245f49,[_0xfa23('0x1e'),'UserId']);_0x5a5397[_0xfa23('0x4a')]='UserId';_0x4c2103=as[_0xfa23('0x73')](_0xb9b7d8,_0x5d3777[_0xfa23('0x39')],_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103[_0xfa23('0x6c')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x6d')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x13')]);}break;case _0xfa23('0x29'):_0x4c2103=as[_0xfa23('0x73')]('me',null,_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103['text'],_0x4c2103[_0xfa23('0x63')]['start'],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x13')]);break;}}else{var _0x4c2103=as['buildExpression'](_0xb9b7d8,_0x5d3777[_0xfa23('0x39')],_0x5a5397);_0xd64189[_0x476fdc](_0x4c2103['text'],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x6d')],_0x4c2103[_0xfa23('0x63')][_0xfa23('0x13')]);}}}else{var _0x3d0f94=_(_0x80827f[_0xfa23('0x3c')])[_0xfa23('0x3b')]()['map'](function(_0x57a71c){return _[_0xfa23('0x74')](_0x245f49,[_0xfa23('0x1e'),_0x57a71c])?_0x57a71c:undefined;})[_0xfa23('0x75')]()[_0xfa23('0x63')]();if(!_['isEmpty'](_0x3d0f94)){_0x3d0f94[_0xfa23('0x25')](function(_0x4d3144){if(_0x4d3144===_0xfa23('0x76')){_0x709755[_0xfa23('0x46')](_0xfa23('0x77'),[][_0xfa23('0x78')](_0x80827f[_0xfa23('0x3c')][_0x4d3144]));}else if(_0x4d3144===_0xfa23('0x79')){var _0x19c67f=JSON[_0xfa23('0x7a')](_0x80827f[_0xfa23('0x3c')][_0x4d3144])[_0xfa23('0x7b')];var _0x5c3a1e=JSON['parse'](_0x80827f[_0xfa23('0x3c')][_0x4d3144])['$lte'];_0x709755[_0xfa23('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19c67f,_0x5c3a1e);}else{if(_0x80827f[_0xfa23('0x3c')][_0x4d3144]===_0xfa23('0x7c')){_0x709755['where']('i.'+_0x4d3144+_0xfa23('0x7d'));}else{_0x709755['where']('i.'+_0x4d3144+'\x20=\x20?',_0x80827f[_0xfa23('0x3c')][_0x4d3144]);}}});}if(_0x80827f[_0xfa23('0x3c')]['read']){if(_0x80827f[_0xfa23('0x3c')][_0xfa23('0x7e')]==0x1){_0x709755[_0xfa23('0x64')](_0xfa23('0x7f'));}else{_0x709755[_0xfa23('0x64')](_0xfa23('0x80'));}}if(_0x80827f[_0xfa23('0x3c')]['tag']){_0xbb8b7d=_[_0xfa23('0x81')](_0x80827f[_0xfa23('0x3c')][_0xfa23('0x82')])?_0x80827f[_0xfa23('0x3c')][_0xfa23('0x82')]:new Array(_0x80827f['query'][_0xfa23('0x82')]);_0xbb8b7d['forEach'](function(_0x5bb05f){_0x9bf852['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5bb05f+',%');});}if(_0x80827f[_0xfa23('0x3c')][_0xfa23('0x83')]){var _0x1b12af=_0x80827f['query'][_0xfa23('0x83')][_0xfa23('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xfa23('0x85')](_0x1b12af)){_0xd64189['or'](_0xfa23('0x86'),_0x1b12af+'%');}else if(qs[_0xfa23('0x87')](_0x1b12af)){_0xd64189['or'](_0xfa23('0x88'),_0x1b12af+'%');}else{_0xd64189['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1b12af))['or'](_0xfa23('0x89'),qs['getFullTextValue'](_0x1b12af));}}}_0x709755[_0xfa23('0x46')](_0xd64189);_0x709755[_0xfa23('0x8a')](_0xfa23('0x8b'));var _0x4a77e5={'type':db[_0xfa23('0x8c')][_0xfa23('0x8d')][_0xfa23('0x8e')],'raw':!![]};var _0xcf4b16=_0x709755[_0xfa23('0x8f')]();_0xcf4b16[_0xfa23('0x4a')]('i.id');_0xcf4b16[_0xfa23('0x4a')](_0xfa23('0x90'),_0xfa23('0x91'));if(_0xe546db[_0xfa23('0x44')]){_0xe546db[_0xfa23('0x44')][_0xfa23('0x25')](function(_0x56b78d){var _0x11b3fa=_0x56b78d[0x0]===_0xfa23('0x92')?_0x56b78d[0x0]:'i.'+_0x56b78d[0x0];_0x709755['order'](_0x11b3fa,_0x56b78d[0x1]===_0xfa23('0x93')?![]:!![]);});}if(!_[_0xfa23('0x94')](_0xbb8b7d)){_0x709755[_0xfa23('0x64')](_0x9bf852);_0xcf4b16[_0xfa23('0x46')](_0xfa23('0x95'),_0xbb8b7d);}BPromise['resolve']()[_0xfa23('0x1b')](function(){if(!_0x26e171){if(_0x80827f['query']['MailAccountId'])return;_0xcf4b16['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x709755[_0xfa23('0x46')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x80827f[_0xfa23('0x96')][_0xfa23('0x97')]!==_0xfa23('0x98'))return;return _0x80827f[_0xfa23('0x96')][_0xfa23('0x99')]({'attributes':['id'],'raw':!![]})[_0xfa23('0x1b')](function(_0x23c6f4){if(_[_0xfa23('0x94')](_0x23c6f4)){_0xcf4b16['where'](_0xfa23('0x9a'));_0x709755['where'](_0xfa23('0x9a'));}else{_0xcf4b16[_0xfa23('0x46')]('i.MailAccountId\x20IN\x20?',_[_0xfa23('0x20')](_0x23c6f4,'id'));_0x709755[_0xfa23('0x46')]('i.MailAccountId\x20IN\x20?',_[_0xfa23('0x20')](_0x23c6f4,'id'));}});})['then'](function(){if(_0x80827f[_0xfa23('0x96')]['role']===_0xfa23('0x98')&&!_0x26e171&&!_0x80827f['query'][_0xfa23('0x76')])return[];return db[_0xfa23('0x9b')]['query'](_0xcf4b16[_0xfa23('0x9c')](),_0x4a77e5);})[_0xfa23('0x1b')](function(_0x1787b5){_0x43eb23['count']=_0x1787b5[_0xfa23('0x41')];if(_0x43eb23['count']===0x0)return[];return db[_0xfa23('0x9b')][_0xfa23('0x3c')](_0x1ca7c3[_0xfa23('0x9c')](),_0x4a77e5)[_0xfa23('0x1b')](function(_0x58f34e){_0xd2345d=_[_0xfa23('0x9d')](_0x58f34e,'id');_0x4a77e5=_['merge'](_0x4a77e5,{'model':db[_0xfa23('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x80827f['query'][_0xfa23('0x3f')]){_0xe546db[_0xfa23('0x40')][_0xfa23('0x25')](function(_0x376b22){_0x709755[_0xfa23('0x4a')]('i.'+_0x376b22);});}else{_0x709755['field'](_0xfa23('0x90'),'unreadMessages');_0x709755['field'](_0xfa23('0x9e'),_0xfa23('0x9f'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa0'),'Account.mandatoryDisposition');_0x709755[_0xfa23('0x4a')](_0xfa23('0xa1'),_0xfa23('0x92'));_0x709755[_0xfa23('0x4a')](_0xfa23('0x8b'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa2'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa3'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa4'));_0x709755[_0xfa23('0x4a')]('i.closedAt');_0x709755[_0xfa23('0x4a')](_0xfa23('0xa5'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa6'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa7'));_0x709755[_0xfa23('0x4a')]('i.subject');_0x709755[_0xfa23('0x4a')]('i.disposition');_0x709755['field']('i.secondDisposition');_0x709755['field'](_0xfa23('0xa8'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xa9'));_0x709755['field'](_0xfa23('0xaa'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xab'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xac'));_0x709755['field'](_0xfa23('0xad'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xae'),_0xfa23('0xaf'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xb0'),'Contact.lastName');_0x709755['field']('c.email','Contact.email');_0x709755[_0xfa23('0x4a')](_0xfa23('0xb1'),_0xfa23('0xb2'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xb3'),'Contact.mobile');_0x709755[_0xfa23('0x4a')](_0xfa23('0xb4'),_0xfa23('0xb5'));_0x709755['field'](_0xfa23('0xb6'),'Owner.fullname');_0x709755['field'](_0xfa23('0xb7'),_0xfa23('0xb8'));_0x709755[_0xfa23('0x4a')](_0xfa23('0xb9'),'TagIds');}if(_0xe546db[_0xfa23('0x15')])_0x709755[_0xfa23('0x15')](_0xe546db['limit']);if(_0xe546db[_0xfa23('0x14')])_0x709755[_0xfa23('0x14')](_0xe546db['offset']);return db['sequelize'][_0xfa23('0x3c')](_0x709755['toString'](),_0x4a77e5);})[_0xfa23('0x1b')](function(_0x3d5a10){if(_0x3d5a10[_0xfa23('0x41')]>0x0)_0x2f6a37[_0xfa23('0x46')](_0xfa23('0xba'),_[_0xfa23('0x20')](_0x3d5a10,'id'));return db[_0xfa23('0x9b')][_0xfa23('0x3c')](_0x2f6a37[_0xfa23('0x9c')](),_0x4a77e5)[_0xfa23('0x1b')](function(_0x11fce6){var _0x4c0059=_[_0xfa23('0xbb')](_0x11fce6,_0xfa23('0xbc'));var _0x48a314=[];return db[_0xfa23('0xbd')][_0xfa23('0x27')]({'attributes':[_0xfa23('0xbe')],'raw':!![]})[_0xfa23('0x1b')](function(_0x49ab16){var _0x55c627=_0x49ab16[_0xfa23('0xbe')];_0x3d5a10[_0xfa23('0x25')](function(_0x289e3b){_0x48a314[_0xfa23('0x26')](updateMailInteraction(_0x289e3b,_0xd2345d,_0x4c0059,_0x55c627));});return BPromise['all'](_0x48a314);});});});})['then'](function(_0x393695){_0x43eb23[_0xfa23('0xbf')]=_0x393695;return _0x43eb23;})[_0xfa23('0x1b')](respondWithFilteredResult(_0x58fc41,_0xe546db))['catch'](handleError(_0x58fc41,null));};exports[_0xfa23('0xc0')]=function(_0x123824,_0x4909a5){var _0x40f83b={'raw':![],'where':{'id':_0x123824[_0xfa23('0xc1')]['id']}},_0x56b6c8={};_0x56b6c8[_0xfa23('0x3e')]=_[_0xfa23('0x3b')](db[_0xfa23('0x36')][_0xfa23('0x37')]);_0x56b6c8[_0xfa23('0x3c')]=_[_0xfa23('0x3b')](_0x123824['query']);_0x56b6c8['filters']=_[_0xfa23('0x3d')](_0x56b6c8[_0xfa23('0x3e')],_0x56b6c8[_0xfa23('0x3c')]);_0x40f83b['attributes']=_[_0xfa23('0x3d')](_0x56b6c8[_0xfa23('0x3e')],qs[_0xfa23('0x3f')](_0x123824[_0xfa23('0x3c')][_0xfa23('0x3f')]));_0x40f83b[_0xfa23('0x40')]=_0x40f83b[_0xfa23('0x40')][_0xfa23('0x41')]?_0x40f83b['attributes']:_0x56b6c8[_0xfa23('0x3e')];if(_0x123824[_0xfa23('0x3c')][_0xfa23('0xc2')]){_0x40f83b[_0xfa23('0xc3')]=[{'all':!![]}];}_0x40f83b=_[_0xfa23('0xc4')]({},_0x40f83b,_0x123824[_0xfa23('0xc5')]);return db['MailInteraction'][_0xfa23('0x62')](_0x40f83b)[_0xfa23('0x1b')](handleEntityNotFound(_0x4909a5,null))['then'](respondWithResult(_0x4909a5,null))[_0xfa23('0x2d')](handleError(_0x4909a5,null));};exports[_0xfa23('0xc6')]=function(_0x88da46,_0x2229fe){return db[_0xfa23('0x36')][_0xfa23('0xc6')](_0x88da46[_0xfa23('0xc7')],{})[_0xfa23('0x1b')](respondWithResult(_0x2229fe,0xc9))[_0xfa23('0x2d')](handleError(_0x2229fe,null));};exports[_0xfa23('0x1a')]=function(_0x3c0c1a,_0xa57d4e){if(_0x3c0c1a[_0xfa23('0xc7')]['id']){delete _0x3c0c1a[_0xfa23('0xc7')]['id'];}return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x3c0c1a[_0xfa23('0xc1')]['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0xa57d4e,null))[_0xfa23('0x1b')](saveUpdates(_0x3c0c1a[_0xfa23('0xc7')],null))[_0xfa23('0x1b')](respondWithResult(_0xa57d4e,null))['catch'](handleError(_0xa57d4e,null));};exports[_0xfa23('0xc8')]=function(_0x37146b,_0x3116f6){return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x37146b['params']['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x3116f6,null))[_0xfa23('0x1b')](removeEntity(_0x3116f6,null))['catch'](handleError(_0x3116f6,null));};exports[_0xfa23('0xc9')]=function(_0x459318,_0xd1193a){return db[_0xfa23('0x36')][_0xfa23('0xc9')]()[_0xfa23('0x1b')](respondWithResult(_0xd1193a,null))['catch'](handleError(_0xd1193a,null));};exports[_0xfa23('0xca')]=function(_0x3ca789,_0x3b6730){return db[_0xfa23('0xcb')][_0xfa23('0x62')]({'where':{'id':_0x3ca789[_0xfa23('0xc1')]['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x3b6730,null))[_0xfa23('0x1b')](function(_0x17a179){if(_0x17a179){return _0x17a179['addMessage'](_0x3ca789[_0xfa23('0xc7')][_0xfa23('0xcc')],_[_0xfa23('0xcd')](_0x3ca789['body'],[_0xfa23('0xcc'),'id'])||{});}})[_0xfa23('0x1b')](respondWithResult(_0x3b6730,null))[_0xfa23('0x2d')](handleError(_0x3b6730,null));};exports[_0xfa23('0xce')]=function(_0x34c78d,_0x4542ed){var _0x288500={'raw':![],'where':{}};var _0x2c040d={};var _0x1c4467={'count':0x0,'rows':[]};return db[_0xfa23('0x36')]['findOne']({'where':{'id':_0x34c78d[_0xfa23('0xc1')]['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x4542ed,null))['then'](function(_0x48f2ee){if(_0x48f2ee){_0x2c040d[_0xfa23('0x3e')]=_[_0xfa23('0x3b')](db[_0xfa23('0xcb')][_0xfa23('0x37')]);_0x2c040d['query']=_[_0xfa23('0x3b')](_0x34c78d['query']);_0x2c040d[_0xfa23('0x47')]=_[_0xfa23('0x3d')](_0x2c040d[_0xfa23('0x3e')],_0x2c040d[_0xfa23('0x3c')]);_0x288500['attributes']=_[_0xfa23('0x3d')](_0x2c040d[_0xfa23('0x3e')],qs[_0xfa23('0x3f')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x3f')]));_0x288500[_0xfa23('0x40')]=_0x288500[_0xfa23('0x40')][_0xfa23('0x41')]?_0x288500['attributes']:_0x2c040d['model'];if(!_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x42')](_0xfa23('0x43'))){_0x288500[_0xfa23('0x15')]=qs[_0xfa23('0x15')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x15')]);_0x288500[_0xfa23('0x14')]=qs[_0xfa23('0x14')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x14')]);}_0x288500[_0xfa23('0x44')]=qs[_0xfa23('0x45')](_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x45')]);_0x288500['where']=qs['filters'](_['pick'](_0x34c78d[_0xfa23('0x3c')],_0x2c040d['filters']));_0x288500[_0xfa23('0x46')][_0xfa23('0xbc')]=_0x48f2ee['id'];if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x83')]){_0x288500['where']=_[_0xfa23('0xc4')](_0x288500['where'],{'$or':_[_0xfa23('0x20')](_0x288500['attributes'],function(_0x2fc119){var _0x274067={};_0x274067[_0x2fc119]={'$like':'%'+_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x83')]+'%'};return _0x274067;})});}if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0x7b')]){var _0x3a1762=_0x34c78d[_0xfa23('0x3c')]['$gte'][_0xfa23('0x24')](',');var _0xd31f63={};_0xd31f63[_0x3a1762[0x0]]={'$gte':moment(_0x3a1762[0x1])[_0xfa23('0xcf')](_0xfa23('0xd0'))};_0x288500['where']=_[_0xfa23('0xc4')](_0x288500[_0xfa23('0x46')],_0xd31f63);}_0x288500=_[_0xfa23('0xc4')]({},_0x288500,_0x34c78d[_0xfa23('0xc5')]);return db[_0xfa23('0xcb')][_0xfa23('0x17')]({'where':_0x288500[_0xfa23('0x46')]})[_0xfa23('0x1b')](function(_0x341fb7){_0x1c4467['count']=_0x341fb7;if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0xc2')]){_0x288500[_0xfa23('0xc3')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x288500);})[_0xfa23('0x1b')](function(_0x2d0233){if(_0x34c78d[_0xfa23('0x3c')][_0xfa23('0xd1')]===_0xfa23('0xd2')){for(var _0x3e0a20=0x0;_0x3e0a20<_0x2d0233['length'];_0x3e0a20++){_0x2d0233[_0x3e0a20][_0xfa23('0xc7')]=juice(_0x2d0233[_0x3e0a20][_0xfa23('0xc7')]);}}_0x1c4467['rows']=_0x2d0233;return _0x1c4467;});}})[_0xfa23('0x1b')](respondWithFilteredResult(_0x4542ed,_0x288500))[_0xfa23('0x2d')](handleError(_0x4542ed,null));};exports[_0xfa23('0xd3')]=function(_0x1a6be6,_0x415741){return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x1a6be6['params']['id']}})[_0xfa23('0x1b')](handleEntityNotFound(_0x415741,null))[_0xfa23('0x1b')](function(_0x468604){if(_0x468604){return _0x468604['setTags'](_0x1a6be6[_0xfa23('0xc7')]['ids'],_[_0xfa23('0xcd')](_0x1a6be6[_0xfa23('0xc7')],[_0xfa23('0xcc'),'id'])||{})[_0xfa23('0xd4')](function(){return db[_0xfa23('0x6e')]['findAll']({'attributes':['id',_0xfa23('0x1e'),_0xfa23('0x4b')],'where':{'id':_0x1a6be6[_0xfa23('0xc7')][_0xfa23('0xcc')]}});})[_0xfa23('0x1b')](function(_0x1a93ba){socket[_0xfa23('0xd5')](_0xfa23('0xd6'),{'id':Number(_0x1a6be6['params']['id']),'tags':_0x1a93ba||[]});return{'id':Number(_0x1a6be6[_0xfa23('0xc1')]['id']),'tags':_0x1a93ba||[]};});}})['then'](respondWithResult(_0x415741,null))[_0xfa23('0x2d')](handleError(_0x415741,null));};exports[_0xfa23('0xd7')]=function(_0x1e8cae,_0x45e847){return db[_0xfa23('0x36')]['find']({'where':{'id':_0x1e8cae[_0xfa23('0xc1')]['id']}})['then'](handleEntityNotFound(_0x45e847,null))[_0xfa23('0x1b')](function(_0x11bc79){if(_0x11bc79){return _0x11bc79[_0xfa23('0xd7')](_0x1e8cae[_0xfa23('0x3c')][_0xfa23('0xcc')]);}})[_0xfa23('0x1b')](respondWithStatusCode(_0x45e847,null))[_0xfa23('0x2d')](handleError(_0x45e847,null));};exports[_0xfa23('0xd8')]=function(_0x26581e,_0x18effe){var _0x55dd79=moment()[_0xfa23('0xd9')]()[_0xfa23('0x9c')]();var _0x1b0f19=path[_0xfa23('0xda')](config[_0xfa23('0xdb')],'server',_0xfa23('0xdc'),_0xfa23('0xdd'));var _0x20bb3a=path[_0xfa23('0xda')](config[_0xfa23('0xdb')],'server',_0xfa23('0xdc'),_0xfa23('0xde'));var _0x3ff523=path[_0xfa23('0xda')](_0x1b0f19,_0x55dd79);var _0x381290=util['format'](_0xfa23('0xdf'),_0x26581e['params']['id'],_0x55dd79);var _0x55dc5f=path['join'](_0x1b0f19,_0x381290);var _0x37ba1a=[];if(_0x26581e['query']['attachments']){_0x37ba1a[_0xfa23('0x26')]({'model':db[_0xfa23('0xe0')],'as':_0xfa23('0xe1'),'raw':!![]});}var _0xf39a18=[{'model':db[_0xfa23('0xcb')],'as':_0xfa23('0xe2'),'attributes':['id',_0xfa23('0xc7'),_0xfa23('0x4c'),'to','cc',_0xfa23('0xe3'),_0xfa23('0xe4'),_0xfa23('0x79')],'where':{'secret':![]},'order':qs[_0xfa23('0x45')]('id'),'include':_0x37ba1a}];return db[_0xfa23('0x36')][_0xfa23('0x62')]({'where':{'id':_0x26581e[_0xfa23('0xc1')]['id']},'include':_0xf39a18})[_0xfa23('0x1b')](handleEntityNotFound(_0x18effe,null))[_0xfa23('0x1b')](function(_0x4ec3c5){if(_0x4ec3c5&&_0x4ec3c5[_0xfa23('0xe2')]){var _0x48e4e0=_0x4ec3c5[_0xfa23('0xe5')]({'plain':!![]});fs[_0xfa23('0xe6')](_0x3ff523);return BPromise['each'](_0x48e4e0[_0xfa23('0xe2')],function(_0x19111c,_0x235ea6){var _0xdb3e45={'from':_0x19111c[_0xfa23('0x4c')],'to':_0x19111c['to'],'subject':_0x19111c[_0xfa23('0xe4')],'html':htmlEntities[_0xfa23('0xe7')](_0x19111c[_0xfa23('0xc7')]),'headers':{'Date':moment(_0x19111c[_0xfa23('0x79')])[_0xfa23('0xcf')](_0xfa23('0xe8'))},'attachments':[]};if(_0x19111c['cc']){_0xdb3e45[_0xfa23('0xe9')]['Cc']=_0x19111c['cc'];}if(_0x19111c[_0xfa23('0xe3')]){_0xdb3e45['headers'][_0xfa23('0xea')]=_0x19111c[_0xfa23('0xe3')];}return new BPromise(function(_0x1ed7c5,_0x550424){if(_0x19111c[_0xfa23('0xe1')]){for(var _0x2aa3a5=0x0;_0x2aa3a5<_0x19111c[_0xfa23('0xe1')][_0xfa23('0x41')];_0x2aa3a5++){var _0x1d50ef=_0x19111c[_0xfa23('0xe1')][_0x2aa3a5];var _0x55f89c=path[_0xfa23('0xda')](_0x20bb3a,_0x1d50ef['basename']);if(fs[_0xfa23('0xeb')](_0x55f89c)){_0xdb3e45[_0xfa23('0xde')]['push']({'name':_0x1d50ef[_0xfa23('0x1e')],'contentType':_0x1d50ef[_0xfa23('0x39')],'data':fs[_0xfa23('0xec')](_0x55f89c)});}}}emlformat['build'](_0xdb3e45,function(_0x796110,_0x47cb3e){if(_0x796110)return _0x550424(_0x796110);fs[_0xfa23('0xed')](path['join'](_0x3ff523,util[_0xfa23('0xcf')](_0xfa23('0xee'),_0x235ea6)),_0x47cb3e);return _0x1ed7c5(_0x47cb3e);});});})[_0xfa23('0x1b')](function(){return new BPromise(function(_0x14892d,_0x3c9c27){zipdir(_0x3ff523,{'saveTo':_0x55dc5f},function(_0x4e9855,_0x3d6b2f){if(_0x4e9855)return _0x3c9c27(_0x4e9855);return _0x14892d(_0x3d6b2f);});})[_0xfa23('0x1b')](function(){return new BPromise(function(_0xe2aa6c,_0xdf540f){rimraf(_0x3ff523,function(_0x244672){if(_0x244672)_0xdf540f(_0x244672);return _0xe2aa6c();});});})['then'](function(){return _0x18effe['download'](_0x55dc5f,_0x381290,function(_0x188ce1){if(!_0x188ce1)fs['unlinkSync'](_0x55dc5f);});});});}else{return _0x18effe['sendStatus'](0xc8);}})[_0xfa23('0x2d')](handleError(_0x18effe,null));}; \ No newline at end of file +var _0x7f05=['status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','end','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','contactName','isEmpty','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','sequelize','toString','fields','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','rawAttributes','includeAll','merge','options','create','body','destroy','describe','addMessage','ids','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','true','addTags','setTags','omit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','basename','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','path','lodash','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','socket.io-emitter','./mailInteraction.socket','register'];(function(_0x95d132,_0x5cd114){var _0x364ea4=function(_0x3ce44a){while(--_0x3ce44a){_0x95d132['push'](_0x95d132['shift']());}};_0x364ea4(++_0x5cd114);}(_0x7f05,0xdc));var _0x57f0=function(_0x9ba2e7,_0x1ae0ab){_0x9ba2e7=_0x9ba2e7-0x0;var _0xd67810=_0x7f05[_0x9ba2e7];return _0xd67810;};'use strict';var emlformat=require(_0x57f0('0x0'));var rimraf=require(_0x57f0('0x1'));var zipdir=require(_0x57f0('0x2'));var moment=require('moment');var BPromise=require(_0x57f0('0x3'));var util=require('util');var path=require(_0x57f0('0x4'));var fs=require('fs');var _=require(_0x57f0('0x5'));var squel=require('squel');var juice=require(_0x57f0('0x6'));var Redis=require(_0x57f0('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x57f0('0x8'));var logger=require(_0x57f0('0x9'))('api');var config=require(_0x57f0('0xa'));var db=require(_0x57f0('0xb'))['db'];var htmlEntities=require(_0x57f0('0xc'));config['redis']=_['defaults'](config[_0x57f0('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x57f0('0xe'))(new Redis(config[_0x57f0('0xd')]));require(_0x57f0('0xf'))[_0x57f0('0x10')](socket);function respondWithStatusCode(_0x5a715b,_0x4f61d3){_0x4f61d3=_0x4f61d3||0xcc;return function(_0x173e14){if(_0x173e14){return _0x5a715b['sendStatus'](_0x4f61d3);}return _0x5a715b['status'](_0x4f61d3)['end']();};}function respondWithResult(_0x523715,_0x5cd266){_0x5cd266=_0x5cd266||0xc8;return function(_0x5615ff){if(_0x5615ff){return _0x523715[_0x57f0('0x11')](_0x5cd266)[_0x57f0('0x12')](_0x5615ff);}};}function respondWithFilteredResult(_0x5987ed,_0xf35a91){return function(_0x599a6b){if(_0x599a6b){var _0x4d8d89=typeof _0xf35a91[_0x57f0('0x13')]===_0x57f0('0x14')&&typeof _0xf35a91[_0x57f0('0x15')]===_0x57f0('0x14');var _0x238245=_0x599a6b[_0x57f0('0x16')];var _0x555e18=_0x4d8d89?0x0:_0xf35a91['offset'];var _0x40a925=_0x4d8d89?_0x599a6b['count']:_0xf35a91['offset']+_0xf35a91['limit'];var _0x593fd7;if(_0x40a925>=_0x238245){_0x40a925=_0x238245;_0x593fd7=0xc8;}else{_0x593fd7=0xce;}_0x5987ed[_0x57f0('0x11')](_0x593fd7);return _0x5987ed[_0x57f0('0x17')](_0x57f0('0x18'),_0x555e18+'-'+_0x40a925+'/'+_0x238245)['json'](_0x599a6b);}return null;};}function saveUpdates(_0x38e7be){return function(_0xb2b918){if(_0xb2b918){return _0xb2b918[_0x57f0('0x19')](_0x38e7be)['then'](function(_0x2e3d15){return _0x2e3d15;});}return null;};}function removeEntity(_0xb04bf3){return function(_0x5ab625){if(_0x5ab625){return _0x5ab625['destroy']()[_0x57f0('0x1a')](function(){_0xb04bf3[_0x57f0('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e659){return function(_0x558de7){if(!_0x558de7){_0x28e659[_0x57f0('0x1b')](0x194);}return _0x558de7;};}function handleError(_0x9c498,_0x426a09){_0x426a09=_0x426a09||0x1f4;return function(_0x202dcb){logger['error'](_0x202dcb['stack']);if(_0x202dcb[_0x57f0('0x1c')]){delete _0x202dcb['name'];}_0x9c498[_0x57f0('0x11')](_0x426a09)[_0x57f0('0x1d')](_0x202dcb);};}function getInteractionUsers(_0x4156c4,_0x3f5d1e){return new BPromise(function(_0x1b0d2b,_0x1c2cae){try{if(_0x3f5d1e[_0x4156c4['id']]){_0x4156c4[_0x57f0('0x1e')]=_[_0x57f0('0x1f')](_0x3f5d1e[_0x4156c4['id']],function(_0x5a079e){return{'id':_0x5a079e['id'],'fullname':_0x5a079e[_0x57f0('0x20')]};});}}catch(_0x5a176f){_0x1c2cae(_0x5a176f);}_0x1b0d2b(_0x4156c4);});}function getInteractionTags(_0x563fa5,_0x43c975){return new BPromise(function(_0x58a529,_0x407829){try{if(_0x563fa5['TagIds']){_0x563fa5['Tags']=[];_0x563fa5[_0x57f0('0x21')][_0x57f0('0x22')](',')[_0x57f0('0x23')](function(_0x3ac9d3){_0x563fa5[_0x57f0('0x24')][_0x57f0('0x25')](_0x43c975[_0x3ac9d3]);});}delete _0x563fa5[_0x57f0('0x21')];}catch(_0x43699b){_0x407829(_0x43699b);}_0x58a529(_0x563fa5);});}function getLastMessageText(_0xc19b8e){return new BPromise(function(_0x41ef0f,_0x5c7095){return db[_0x57f0('0x26')][_0x57f0('0x27')]({'where':{'$and':[{'MailInteractionId':_0xc19b8e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x57f0('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x57f0('0x29')],'order':_0x57f0('0x2a'),'raw':!![]})[_0x57f0('0x1a')](function(_0x1c5789){if(_0x1c5789&&_0x1c5789[_0x57f0('0x29')]){_0xc19b8e[_0x57f0('0x2b')]=_[_0x57f0('0x2c')](_0x1c5789[_0x57f0('0x29')]);}_0x41ef0f(_0xc19b8e);})[_0x57f0('0x2d')](function(_0x12fb54){_0x5c7095(_0x12fb54);});});}function updateMailInteraction(_0x3a8e5f,_0x559440,_0x21a1c2,_0x31006a){return new BPromise(function(_0x15c01e,_0x3751d7){return getInteractionUsers(_0x3a8e5f,_0x21a1c2)['then'](function(_0x562247){return getInteractionTags(_0x562247,_0x559440);})['then'](function(_0x12b06c){return getStateInteraction(_0x12b06c);})['then'](function(_0xc88d03){if(_0x31006a){_0x15c01e(getLastMessageText(_0xc88d03));}else{_0x15c01e(_0xc88d03);}})[_0x57f0('0x2d')](function(_0x2f3f1b){_0x3751d7(_0x2f3f1b);});});}function getStateInteraction(_0x4d55b6){return new BPromise(function(_0x207668){_0x4d55b6[_0x57f0('0x2e')]=0x0;_0x4d55b6[_0x57f0('0x2f')]=0x0;_0x4d55b6[_0x57f0('0x30')]=0x0;_0x4d55b6[_0x57f0('0x31')]=0x0;_0x4d55b6[_0x57f0('0x32')]=0x0;if(!_0x4d55b6[_0x57f0('0x33')]&&!_0x4d55b6[_0x57f0('0x34')]){_0x4d55b6[_0x57f0('0x2e')]+=0x1;}if(!_0x4d55b6[_0x57f0('0x33')]&&_0x4d55b6[_0x57f0('0x34')]){_0x4d55b6[_0x57f0('0x2f')]+=0x1;if(_0x4d55b6[_0x57f0('0x2e')]){_0x4d55b6[_0x57f0('0x2e')]-=0x1;}}if(_0x4d55b6[_0x57f0('0x33')]&&_0x4d55b6[_0x57f0('0x34')]){_0x4d55b6[_0x57f0('0x30')]+=0x1;if(_0x4d55b6[_0x57f0('0x2f')]){_0x4d55b6[_0x57f0('0x2f')]-=0x1;}}if(_0x4d55b6['closed']&&!_0x4d55b6['UserId']){_0x4d55b6[_0x57f0('0x31')]+=0x1;if(_0x4d55b6[_0x57f0('0x2e')]){_0x4d55b6[_0x57f0('0x2e')]-=0x1;}}_0x4d55b6['total']+=0x1;_0x207668(_0x4d55b6);});}exports[_0x57f0('0x35')]=function(_0x294756,_0x3c40d1){var _0x1f4f7d={},_0x15d4ea={},_0xee1416={'count':0x0,'rows':[]};var _0x3f9197=_[_0x57f0('0x1f')](db[_0x57f0('0x36')]['rawAttributes'],function(_0x14fb80){return{'name':_0x14fb80[_0x57f0('0x37')],'type':_0x14fb80[_0x57f0('0x38')][_0x57f0('0x39')]};});_0x15d4ea['model']=_[_0x57f0('0x1f')](_0x3f9197,_0x57f0('0x1c'));_0x15d4ea['query']=_[_0x57f0('0x3a')](_0x294756[_0x57f0('0x3b')]);_0x15d4ea[_0x57f0('0x3c')]=_[_0x57f0('0x3d')](_0x15d4ea[_0x57f0('0x3e')],_0x15d4ea[_0x57f0('0x3b')]);_0x1f4f7d[_0x57f0('0x3f')]=_['intersection'](_0x15d4ea[_0x57f0('0x3e')],qs['fields'](_0x294756[_0x57f0('0x3b')]['fields']));_0x1f4f7d[_0x57f0('0x3f')]=_0x1f4f7d[_0x57f0('0x3f')][_0x57f0('0x40')]?_0x1f4f7d[_0x57f0('0x3f')]:_0x15d4ea[_0x57f0('0x3e')];if(!_0x294756[_0x57f0('0x3b')][_0x57f0('0x41')](_0x57f0('0x42'))){_0x1f4f7d[_0x57f0('0x15')]=qs[_0x57f0('0x15')](_0x294756[_0x57f0('0x3b')]['limit']);_0x1f4f7d[_0x57f0('0x13')]=qs[_0x57f0('0x13')](_0x294756['query']['offset']);}_0x1f4f7d[_0x57f0('0x43')]=qs['sort'](_0x294756[_0x57f0('0x3b')][_0x57f0('0x44')]);_0x1f4f7d[_0x57f0('0x45')]=qs['filters'](_[_0x57f0('0x46')](_0x294756[_0x57f0('0x3b')],_0x15d4ea['filters']),_0x3f9197);var _0x12abe2=[];var _0x3a2435=squel[_0x57f0('0x47')]()[_0x57f0('0x48')]('id')[_0x57f0('0x48')](_0x57f0('0x1c'))['field'](_0x57f0('0x49'))[_0x57f0('0x4a')]('tools_tags');var _0x2c957a=squel['select']()[_0x57f0('0x48')]('u.id')[_0x57f0('0x48')]('u.fullname')['field'](_0x57f0('0x4b'))[_0x57f0('0x4a')](_0x57f0('0x4c'),'ui')['left_join'](_0x57f0('0x4d'),'u',_0x57f0('0x4e'));var _0x1ec49e=squel[_0x57f0('0x47')]()[_0x57f0('0x4a')](_0x57f0('0x4f'),'i')[_0x57f0('0x50')](_0x57f0('0x51'),'c',_0x57f0('0x52'))['left_join'](_0x57f0('0x4d'),'o',_0x57f0('0x53'))['left_join'](_0x57f0('0x54'),'a',_0x57f0('0x55'))['left_join']('mail_messages','me',_0x57f0('0x56'))[_0x57f0('0x50')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x57f0('0x57'),'t',_0x57f0('0x58'));var _0x570739=squel[_0x57f0('0x59')]();var _0x4f4fe9=[];var _0x19632d=squel[_0x57f0('0x59')]();var _0x598d69;if(_0x294756[_0x57f0('0x3b')][_0x57f0('0x5a')]){_0x598d69=as['parseSearch'](_0x294756[_0x57f0('0x3b')][_0x57f0('0x5a')]);var _0x4e67a2=_0x598d69[_0x57f0('0x5b')];for(var _0x1eb05c=0x0;_0x1eb05c<_0x598d69[_0x57f0('0x5c')]['length'];_0x1eb05c++){var _0x40edee=_0x598d69[_0x57f0('0x5c')][_0x1eb05c];var _0x1585de='i';var _0x51293e=_[_0x57f0('0x5d')](_0x3f9197,[_0x57f0('0x1c'),_0x40edee[_0x57f0('0x48')]]);if(!_0x51293e){switch(_0x40edee[_0x57f0('0x48')]){case _0x57f0('0x5e'):if(_0x40edee[_0x57f0('0x5f')]==0x1){_0x1ec49e[_0x57f0('0x60')]('`'+_0x40edee[_0x57f0('0x48')]+_0x57f0('0x61'));}else{_0x1ec49e['having']('`'+_0x40edee[_0x57f0('0x48')]+_0x57f0('0x62'));}break;case _0x57f0('0x63'):if(_0x40edee[_0x57f0('0x64')]===_0x57f0('0x65')){if(_0x40edee[_0x57f0('0x5f')]['split']('\x20')[_0x57f0('0x40')]>0x1){_0x570739[_0x4e67a2](_0x57f0('0x66'),qs[_0x57f0('0x67')](_0x40edee['value']),null);}else{var _0xd64bc3='%'+_0x40edee[_0x57f0('0x5f')]+'%';_0x570739[_0x4e67a2](_0x57f0('0x68'),_0xd64bc3,_0xd64bc3,_0xd64bc3);}}else{_0x51293e=_[_0x57f0('0x5d')](_0x3f9197,[_0x57f0('0x1c'),_0x57f0('0x69')]);_0x40edee[_0x57f0('0x48')]=_0x57f0('0x69');_0x54068b=as[_0x57f0('0x6a')](_0x1585de,_0x51293e[_0x57f0('0x38')],_0x40edee);_0x570739[_0x4e67a2](_0x54068b[_0x57f0('0x6b')],_0x54068b[_0x57f0('0x5f')][_0x57f0('0x6c')],_0x54068b[_0x57f0('0x5f')][_0x57f0('0x6d')]);}break;case _0x57f0('0x6e'):var _0x2151b3=_0x40edee[_0x57f0('0x5f')][_0x57f0('0x22')](',')[_0x57f0('0x1f')](function(_0x47b938){return Number(_0x47b938);});_0x2151b3[_0x57f0('0x23')](function(_0x8d851a){_0x19632d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x8d851a+',%');});_0x4f4fe9=_[_0x57f0('0x6f')](_0x4f4fe9,_0x2151b3);break;case _0x57f0('0x70'):if(_0x40edee['operator']==='$substring'){_0x570739[_0x4e67a2](_0x57f0('0x71'),'%'+_0x40edee[_0x57f0('0x5f')]+'%',null);}else{_0x51293e=_[_0x57f0('0x5d')](_0x3f9197,['name',_0x57f0('0x34')]);_0x40edee[_0x57f0('0x48')]='UserId';_0x54068b=as['buildExpression'](_0x1585de,_0x51293e[_0x57f0('0x38')],_0x40edee);_0x570739[_0x4e67a2](_0x54068b[_0x57f0('0x6b')],_0x54068b['value'][_0x57f0('0x6c')],_0x54068b[_0x57f0('0x5f')][_0x57f0('0x6d')]);}break;case _0x57f0('0x29'):_0x54068b=as[_0x57f0('0x6a')]('me',null,_0x40edee);_0x570739[_0x4e67a2](_0x54068b[_0x57f0('0x6b')],_0x54068b[_0x57f0('0x5f')][_0x57f0('0x6c')],_0x54068b[_0x57f0('0x5f')][_0x57f0('0x6d')]);break;}}else{var _0x54068b=as['buildExpression'](_0x1585de,_0x51293e['type'],_0x40edee);_0x570739[_0x4e67a2](_0x54068b[_0x57f0('0x6b')],_0x54068b['value']['start'],_0x54068b[_0x57f0('0x5f')][_0x57f0('0x6d')]);}}}else{var _0x36e1f4=_(_0x294756['query'])['keys']()[_0x57f0('0x1f')](function(_0x48ffb6){return _[_0x57f0('0x72')](_0x3f9197,[_0x57f0('0x1c'),_0x48ffb6])?_0x48ffb6:undefined;})[_0x57f0('0x73')]()[_0x57f0('0x5f')]();if(!_['isEmpty'](_0x36e1f4)){_0x36e1f4[_0x57f0('0x23')](function(_0x5e5bc9){if(_0x5e5bc9===_0x57f0('0x74')){_0x1ec49e[_0x57f0('0x45')](_0x57f0('0x75'),[][_0x57f0('0x76')](_0x294756[_0x57f0('0x3b')][_0x5e5bc9]));}else if(_0x5e5bc9===_0x57f0('0x77')){var _0x3ec3e4=JSON[_0x57f0('0x78')](_0x294756[_0x57f0('0x3b')][_0x5e5bc9])['$gte'];var _0x1569c9=JSON[_0x57f0('0x78')](_0x294756[_0x57f0('0x3b')][_0x5e5bc9])[_0x57f0('0x79')];_0x1ec49e[_0x57f0('0x45')](_0x57f0('0x7a'),_0x3ec3e4,_0x1569c9);}else{if(_0x294756[_0x57f0('0x3b')][_0x5e5bc9]===_0x57f0('0x7b')){_0x1ec49e[_0x57f0('0x45')]('i.'+_0x5e5bc9+_0x57f0('0x7c'));}else{_0x1ec49e[_0x57f0('0x45')]('i.'+_0x5e5bc9+_0x57f0('0x7d'),_0x294756[_0x57f0('0x3b')][_0x5e5bc9]);}}});}if(_0x294756['query'][_0x57f0('0x7e')]){if(_0x294756[_0x57f0('0x3b')][_0x57f0('0x7e')]==0x1){_0x1ec49e['having'](_0x57f0('0x7f'));}else{_0x1ec49e[_0x57f0('0x60')](_0x57f0('0x80'));}}if(_0x294756[_0x57f0('0x3b')]['tag']){_0x4f4fe9=_['isArray'](_0x294756[_0x57f0('0x3b')]['tag'])?_0x294756['query'][_0x57f0('0x81')]:new Array(_0x294756[_0x57f0('0x3b')]['tag']);_0x4f4fe9[_0x57f0('0x23')](function(_0x54304d){_0x19632d['or'](_0x57f0('0x82'),'%,'+_0x54304d+',%');});}if(_0x294756['query'][_0x57f0('0x83')]){var _0x286713=_0x294756['query'][_0x57f0('0x83')]['replace']('\x5c','\x5c\x5c')[_0x57f0('0x84')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x286713)){_0x570739['or'](_0x57f0('0x85'),_0x286713+'%');}else if(qs[_0x57f0('0x86')](_0x286713)){_0x570739['or'](_0x57f0('0x87'),_0x286713+'%');}else{_0x570739['or'](_0x57f0('0x88'),qs[_0x57f0('0x67')](_0x286713))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x57f0('0x67')](_0x286713));}}}_0x1ec49e['where'](_0x570739);_0x1ec49e[_0x57f0('0x89')](_0x57f0('0x8a'));var _0x2618c9={'type':db[_0x57f0('0x8b')][_0x57f0('0x8c')]['SELECT'],'raw':!![]};var _0x1a11c2=_0x1ec49e[_0x57f0('0x8d')]();_0x1a11c2['field'](_0x57f0('0x8a'));_0x1a11c2[_0x57f0('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x57f0('0x5e'));if(_0x1f4f7d[_0x57f0('0x43')]){_0x1f4f7d[_0x57f0('0x43')][_0x57f0('0x23')](function(_0xc8ca53){var _0x48068d=_0xc8ca53[0x0]===_0x57f0('0x8e')?_0xc8ca53[0x0]:'i.'+_0xc8ca53[0x0];_0x1ec49e[_0x57f0('0x43')](_0x48068d,_0xc8ca53[0x1]==='DESC'?![]:!![]);});}if(!_[_0x57f0('0x8f')](_0x4f4fe9)){_0x1ec49e['having'](_0x19632d);_0x1a11c2[_0x57f0('0x45')](_0x57f0('0x90'),_0x4f4fe9);}BPromise['resolve']()[_0x57f0('0x1a')](function(){if(!_0x598d69){if(_0x294756[_0x57f0('0x3b')][_0x57f0('0x74')])return;_0x1a11c2[_0x57f0('0x45')](_0x57f0('0x91'));_0x1ec49e[_0x57f0('0x45')](_0x57f0('0x91'));return;}if(_0x294756[_0x57f0('0x92')][_0x57f0('0x93')]!=='agent')return;return _0x294756['user'][_0x57f0('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x541125){if(_[_0x57f0('0x8f')](_0x541125)){_0x1a11c2['where'](_0x57f0('0x95'));_0x1ec49e[_0x57f0('0x45')](_0x57f0('0x95'));}else{_0x1a11c2[_0x57f0('0x45')]('i.MailAccountId\x20IN\x20?',_[_0x57f0('0x1f')](_0x541125,'id'));_0x1ec49e[_0x57f0('0x45')](_0x57f0('0x75'),_[_0x57f0('0x1f')](_0x541125,'id'));}});})[_0x57f0('0x1a')](function(){if(_0x294756[_0x57f0('0x92')][_0x57f0('0x93')]===_0x57f0('0x96')&&!_0x598d69&&!_0x294756['query']['MailAccountId'])return[];return db[_0x57f0('0x97')][_0x57f0('0x3b')](_0x1a11c2[_0x57f0('0x98')](),_0x2618c9);})['then'](function(_0x5ac760){_0xee1416['count']=_0x5ac760['length'];if(_0xee1416[_0x57f0('0x16')]===0x0)return[];return db[_0x57f0('0x97')][_0x57f0('0x3b')](_0x3a2435[_0x57f0('0x98')](),_0x2618c9)[_0x57f0('0x1a')](function(_0x43f8dc){_0x12abe2=_['keyBy'](_0x43f8dc,'id');_0x2618c9=_['merge'](_0x2618c9,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x294756[_0x57f0('0x3b')][_0x57f0('0x99')]){_0x1f4f7d['attributes'][_0x57f0('0x23')](function(_0x2e029d){_0x1ec49e[_0x57f0('0x48')]('i.'+_0x2e029d);});}else{_0x1ec49e[_0x57f0('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x57f0('0x5e'));_0x1ec49e[_0x57f0('0x48')]('a.key',_0x57f0('0x9a'));_0x1ec49e['field'](_0x57f0('0x9b'),_0x57f0('0x9c'));_0x1ec49e['field'](_0x57f0('0x9d'),'contactName');_0x1ec49e[_0x57f0('0x48')]('i.id');_0x1ec49e[_0x57f0('0x48')](_0x57f0('0x9e'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0x9f'));_0x1ec49e[_0x57f0('0x48')]('i.closed');_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xa0'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xa1'));_0x1ec49e['field']('i.lastMsgAt');_0x1ec49e[_0x57f0('0x48')]('i.lastMsgDirection');_0x1ec49e['field'](_0x57f0('0xa2'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xa3'));_0x1ec49e['field'](_0x57f0('0xa4'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xa5'));_0x1ec49e['field'](_0x57f0('0xa6'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xa7'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xa8'));_0x1ec49e['field']('i.MailAccountId');_0x1ec49e[_0x57f0('0x48')]('i.UserId');_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xa9'),_0x57f0('0xaa'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xab'),_0x57f0('0xac'));_0x1ec49e[_0x57f0('0x48')]('c.email',_0x57f0('0xad'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xae'),_0x57f0('0xaf'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xb0'),'Contact.mobile');_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xb1'),_0x57f0('0xb2'));_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xb3'),_0x57f0('0xb4'));_0x1ec49e['field'](_0x57f0('0xb5'),'Owner.internal');_0x1ec49e[_0x57f0('0x48')](_0x57f0('0xb6'),'TagIds');}if(_0x1f4f7d['limit'])_0x1ec49e['limit'](_0x1f4f7d[_0x57f0('0x15')]);if(_0x1f4f7d[_0x57f0('0x13')])_0x1ec49e[_0x57f0('0x13')](_0x1f4f7d['offset']);return db[_0x57f0('0x97')][_0x57f0('0x3b')](_0x1ec49e[_0x57f0('0x98')](),_0x2618c9);})[_0x57f0('0x1a')](function(_0x19e694){if(_0x19e694['length']>0x0)_0x2c957a[_0x57f0('0x45')](_0x57f0('0xb7'),_[_0x57f0('0x1f')](_0x19e694,'id'));return db[_0x57f0('0x97')][_0x57f0('0x3b')](_0x2c957a[_0x57f0('0x98')](),_0x2618c9)[_0x57f0('0x1a')](function(_0x3dbafb){var _0x10164f=_[_0x57f0('0xb8')](_0x3dbafb,_0x57f0('0xb9'));var _0x1478b2=[];return db[_0x57f0('0xba')][_0x57f0('0x27')]({'attributes':[_0x57f0('0xbb')],'raw':!![]})[_0x57f0('0x1a')](function(_0x7af43a){var _0x3fa692=_0x7af43a['enableEmailPreview'];_0x19e694[_0x57f0('0x23')](function(_0x5ed310){_0x1478b2[_0x57f0('0x25')](updateMailInteraction(_0x5ed310,_0x12abe2,_0x10164f,_0x3fa692));});return BPromise[_0x57f0('0xbc')](_0x1478b2);});});});})[_0x57f0('0x1a')](function(_0x4a5d10){_0xee1416[_0x57f0('0xbd')]=_0x4a5d10;return _0xee1416;})[_0x57f0('0x1a')](respondWithFilteredResult(_0x3c40d1,_0x1f4f7d))[_0x57f0('0x2d')](handleError(_0x3c40d1,null));};exports[_0x57f0('0xbe')]=function(_0x58b196,_0x5c814d){var _0x51200a={'raw':![],'where':{'id':_0x58b196[_0x57f0('0xbf')]['id']}},_0x46b536={};_0x46b536['model']=_[_0x57f0('0x3a')](db[_0x57f0('0x36')][_0x57f0('0xc0')]);_0x46b536['query']=_['keys'](_0x58b196[_0x57f0('0x3b')]);_0x46b536[_0x57f0('0x3c')]=_[_0x57f0('0x3d')](_0x46b536[_0x57f0('0x3e')],_0x46b536[_0x57f0('0x3b')]);_0x51200a['attributes']=_[_0x57f0('0x3d')](_0x46b536[_0x57f0('0x3e')],qs[_0x57f0('0x99')](_0x58b196['query'][_0x57f0('0x99')]));_0x51200a[_0x57f0('0x3f')]=_0x51200a[_0x57f0('0x3f')][_0x57f0('0x40')]?_0x51200a['attributes']:_0x46b536[_0x57f0('0x3e')];if(_0x58b196[_0x57f0('0x3b')][_0x57f0('0xc1')]){_0x51200a['include']=[{'all':!![]}];}_0x51200a=_[_0x57f0('0xc2')]({},_0x51200a,_0x58b196[_0x57f0('0xc3')]);return db[_0x57f0('0x36')][_0x57f0('0x5d')](_0x51200a)[_0x57f0('0x1a')](handleEntityNotFound(_0x5c814d,null))[_0x57f0('0x1a')](respondWithResult(_0x5c814d,null))['catch'](handleError(_0x5c814d,null));};exports[_0x57f0('0xc4')]=function(_0x5ecacd,_0x516c4f){return db[_0x57f0('0x36')][_0x57f0('0xc4')](_0x5ecacd['body'],{})[_0x57f0('0x1a')](respondWithResult(_0x516c4f,0xc9))[_0x57f0('0x2d')](handleError(_0x516c4f,null));};exports[_0x57f0('0x19')]=function(_0x170933,_0x15444a){if(_0x170933[_0x57f0('0xc5')]['id']){delete _0x170933['body']['id'];}return db[_0x57f0('0x36')][_0x57f0('0x5d')]({'where':{'id':_0x170933[_0x57f0('0xbf')]['id']}})[_0x57f0('0x1a')](handleEntityNotFound(_0x15444a,null))['then'](saveUpdates(_0x170933[_0x57f0('0xc5')],null))['then'](respondWithResult(_0x15444a,null))['catch'](handleError(_0x15444a,null));};exports[_0x57f0('0xc6')]=function(_0x2f1c16,_0x527038){return db[_0x57f0('0x36')][_0x57f0('0x5d')]({'where':{'id':_0x2f1c16[_0x57f0('0xbf')]['id']}})[_0x57f0('0x1a')](handleEntityNotFound(_0x527038,null))['then'](removeEntity(_0x527038,null))['catch'](handleError(_0x527038,null));};exports[_0x57f0('0xc7')]=function(_0x3022db,_0x3f6264){return db['MailInteraction'][_0x57f0('0xc7')]()['then'](respondWithResult(_0x3f6264,null))[_0x57f0('0x2d')](handleError(_0x3f6264,null));};exports[_0x57f0('0xc8')]=function(_0x2038de,_0x4a4202){return db[_0x57f0('0x26')][_0x57f0('0x5d')]({'where':{'id':_0x2038de['params']['id']}})[_0x57f0('0x1a')](handleEntityNotFound(_0x4a4202,null))[_0x57f0('0x1a')](function(_0x21de68){if(_0x21de68){return _0x21de68[_0x57f0('0xc8')](_0x2038de['body'][_0x57f0('0xc9')],_['omit'](_0x2038de[_0x57f0('0xc5')],[_0x57f0('0xc9'),'id'])||{});}})[_0x57f0('0x1a')](respondWithResult(_0x4a4202,null))['catch'](handleError(_0x4a4202,null));};exports['getMessages']=function(_0x2843cf,_0x290e6a){var _0x530bf4={'raw':![],'where':{}};var _0x57c99d={};var _0x32f22b={'count':0x0,'rows':[]};return db[_0x57f0('0x36')]['findOne']({'where':{'id':_0x2843cf[_0x57f0('0xbf')]['id']}})[_0x57f0('0x1a')](handleEntityNotFound(_0x290e6a,null))['then'](function(_0x3b9a54){if(_0x3b9a54){_0x57c99d[_0x57f0('0x3e')]=_['keys'](db['MailMessage']['rawAttributes']);_0x57c99d['query']=_['keys'](_0x2843cf[_0x57f0('0x3b')]);_0x57c99d['filters']=_[_0x57f0('0x3d')](_0x57c99d['model'],_0x57c99d['query']);_0x530bf4[_0x57f0('0x3f')]=_['intersection'](_0x57c99d[_0x57f0('0x3e')],qs['fields'](_0x2843cf[_0x57f0('0x3b')][_0x57f0('0x99')]));_0x530bf4[_0x57f0('0x3f')]=_0x530bf4[_0x57f0('0x3f')][_0x57f0('0x40')]?_0x530bf4[_0x57f0('0x3f')]:_0x57c99d[_0x57f0('0x3e')];if(!_0x2843cf[_0x57f0('0x3b')][_0x57f0('0x41')](_0x57f0('0x42'))){_0x530bf4[_0x57f0('0x15')]=qs[_0x57f0('0x15')](_0x2843cf[_0x57f0('0x3b')]['limit']);_0x530bf4[_0x57f0('0x13')]=qs['offset'](_0x2843cf['query'][_0x57f0('0x13')]);}_0x530bf4['order']=qs['sort'](_0x2843cf[_0x57f0('0x3b')][_0x57f0('0x44')]);_0x530bf4[_0x57f0('0x45')]=qs[_0x57f0('0x3c')](_[_0x57f0('0x46')](_0x2843cf['query'],_0x57c99d['filters']));_0x530bf4['where'][_0x57f0('0xb9')]=_0x3b9a54['id'];if(_0x2843cf['query'][_0x57f0('0x83')]){_0x530bf4['where']=_['merge'](_0x530bf4[_0x57f0('0x45')],{'$or':_[_0x57f0('0x1f')](_0x530bf4[_0x57f0('0x3f')],function(_0x4429de){var _0x22071e={};_0x22071e[_0x4429de]={'$like':'%'+_0x2843cf[_0x57f0('0x3b')]['filter']+'%'};return _0x22071e;})});}if(_0x2843cf[_0x57f0('0x3b')][_0x57f0('0xca')]){var _0x3cf3c8=_0x2843cf[_0x57f0('0x3b')][_0x57f0('0xca')][_0x57f0('0x22')](',');var _0x41fd6a={};_0x41fd6a[_0x3cf3c8[0x0]]={'$gte':moment(_0x3cf3c8[0x1])[_0x57f0('0xcb')](_0x57f0('0xcc'))};_0x530bf4[_0x57f0('0x45')]=_[_0x57f0('0xc2')](_0x530bf4[_0x57f0('0x45')],_0x41fd6a);}_0x530bf4=_[_0x57f0('0xc2')]({},_0x530bf4,_0x2843cf[_0x57f0('0xc3')]);return db['MailMessage'][_0x57f0('0x16')]({'where':_0x530bf4[_0x57f0('0x45')]})[_0x57f0('0x1a')](function(_0x108b42){_0x32f22b[_0x57f0('0x16')]=_0x108b42;if(_0x2843cf['query']['includeAll']){_0x530bf4[_0x57f0('0xcd')]=[{'all':!![]}];}return db[_0x57f0('0x26')][_0x57f0('0xce')](_0x530bf4);})[_0x57f0('0x1a')](function(_0xd1295e){if(_0x2843cf[_0x57f0('0x3b')]['inlineCss']===_0x57f0('0xcf')){for(var _0x5b9f8e=0x0;_0x5b9f8e<_0xd1295e['length'];_0x5b9f8e++){_0xd1295e[_0x5b9f8e][_0x57f0('0xc5')]=juice(_0xd1295e[_0x5b9f8e][_0x57f0('0xc5')]);}}_0x32f22b['rows']=_0xd1295e;return _0x32f22b;});}})[_0x57f0('0x1a')](respondWithFilteredResult(_0x290e6a,_0x530bf4))['catch'](handleError(_0x290e6a,null));};exports[_0x57f0('0xd0')]=function(_0x303ec5,_0x3f7b08){return db[_0x57f0('0x36')][_0x57f0('0x5d')]({'where':{'id':_0x303ec5[_0x57f0('0xbf')]['id']}})[_0x57f0('0x1a')](handleEntityNotFound(_0x3f7b08,null))[_0x57f0('0x1a')](function(_0x46d9d5){if(_0x46d9d5){return _0x46d9d5[_0x57f0('0xd1')](_0x303ec5[_0x57f0('0xc5')][_0x57f0('0xc9')],_[_0x57f0('0xd2')](_0x303ec5[_0x57f0('0xc5')],[_0x57f0('0xc9'),'id'])||{})['spread'](function(){return db[_0x57f0('0x6e')][_0x57f0('0xce')]({'attributes':['id',_0x57f0('0x1c'),_0x57f0('0x49')],'where':{'id':_0x303ec5[_0x57f0('0xc5')][_0x57f0('0xc9')]}});})[_0x57f0('0x1a')](function(_0x20dbea){socket['emit']('mailInteractionTags:save',{'id':Number(_0x303ec5[_0x57f0('0xbf')]['id']),'tags':_0x20dbea||[]});return{'id':Number(_0x303ec5[_0x57f0('0xbf')]['id']),'tags':_0x20dbea||[]};});}})[_0x57f0('0x1a')](respondWithResult(_0x3f7b08,null))[_0x57f0('0x2d')](handleError(_0x3f7b08,null));};exports[_0x57f0('0xd3')]=function(_0x103f08,_0x50d4a3){return db[_0x57f0('0x36')][_0x57f0('0x5d')]({'where':{'id':_0x103f08[_0x57f0('0xbf')]['id']}})[_0x57f0('0x1a')](handleEntityNotFound(_0x50d4a3,null))[_0x57f0('0x1a')](function(_0x390765){if(_0x390765){return _0x390765[_0x57f0('0xd3')](_0x103f08['query'][_0x57f0('0xc9')]);}})[_0x57f0('0x1a')](respondWithStatusCode(_0x50d4a3,null))[_0x57f0('0x2d')](handleError(_0x50d4a3,null));};exports[_0x57f0('0xd4')]=function(_0x3e6be3,_0x10dd12){var _0x20a3a9=moment()[_0x57f0('0xd5')]()[_0x57f0('0x98')]();var _0x17b22f=path[_0x57f0('0xd6')](config[_0x57f0('0xd7')],_0x57f0('0xd8'),_0x57f0('0xd9'),_0x57f0('0xda'));var _0x46e049=path[_0x57f0('0xd6')](config[_0x57f0('0xd7')],_0x57f0('0xd8'),_0x57f0('0xd9'),_0x57f0('0xdb'));var _0x55951b=path[_0x57f0('0xd6')](_0x17b22f,_0x20a3a9);var _0x3d9984=util[_0x57f0('0xcb')](_0x57f0('0xdc'),_0x3e6be3[_0x57f0('0xbf')]['id'],_0x20a3a9);var _0x205c82=path[_0x57f0('0xd6')](_0x17b22f,_0x3d9984);var _0x522d4c=[];if(_0x3e6be3[_0x57f0('0x3b')][_0x57f0('0xdb')]){_0x522d4c[_0x57f0('0x25')]({'model':db[_0x57f0('0xdd')],'as':_0x57f0('0xde'),'raw':!![]});}var _0x10bd6f=[{'model':db[_0x57f0('0x26')],'as':_0x57f0('0xdf'),'attributes':['id',_0x57f0('0xc5'),_0x57f0('0x4a'),'to','cc','bcc',_0x57f0('0xe0'),_0x57f0('0x77')],'where':{'secret':![]},'order':qs[_0x57f0('0x44')]('id'),'include':_0x522d4c}];return db[_0x57f0('0x36')][_0x57f0('0x5d')]({'where':{'id':_0x3e6be3['params']['id']},'include':_0x10bd6f})[_0x57f0('0x1a')](handleEntityNotFound(_0x10dd12,null))['then'](function(_0x111486){if(_0x111486&&_0x111486['Messages']){var _0x8b6d0d=_0x111486[_0x57f0('0xe1')]({'plain':!![]});fs['mkdirSync'](_0x55951b);return BPromise[_0x57f0('0xe2')](_0x8b6d0d[_0x57f0('0xdf')],function(_0xec76a0,_0x26ecbb){var _0x1b7ed7={'from':_0xec76a0[_0x57f0('0x4a')],'to':_0xec76a0['to'],'subject':_0xec76a0['subject'],'html':htmlEntities[_0x57f0('0xe3')](_0xec76a0[_0x57f0('0xc5')]),'headers':{'Date':moment(_0xec76a0['createdAt'])[_0x57f0('0xcb')](_0x57f0('0xe4'))},'attachments':[]};if(_0xec76a0['cc']){_0x1b7ed7[_0x57f0('0xe5')]['Cc']=_0xec76a0['cc'];}if(_0xec76a0['bcc']){_0x1b7ed7[_0x57f0('0xe5')][_0x57f0('0xe6')]=_0xec76a0[_0x57f0('0xe7')];}return new BPromise(function(_0x34a312,_0x4b8f8c){if(_0xec76a0[_0x57f0('0xde')]){for(var _0x327815=0x0;_0x327815<_0xec76a0['Attachments'][_0x57f0('0x40')];_0x327815++){var _0x4d265f=_0xec76a0[_0x57f0('0xde')][_0x327815];var _0x3215fe=path['join'](_0x46e049,_0x4d265f[_0x57f0('0xe8')]);if(fs['existsSync'](_0x3215fe)){_0x1b7ed7['attachments'][_0x57f0('0x25')]({'name':_0x4d265f[_0x57f0('0x1c')],'contentType':_0x4d265f[_0x57f0('0x38')],'data':fs['readFileSync'](_0x3215fe)});}}}emlformat[_0x57f0('0xe9')](_0x1b7ed7,function(_0x1203e2,_0x57c433){if(_0x1203e2)return _0x4b8f8c(_0x1203e2);fs[_0x57f0('0xea')](path[_0x57f0('0xd6')](_0x55951b,util[_0x57f0('0xcb')](_0x57f0('0xeb'),_0x26ecbb)),_0x57c433);return _0x34a312(_0x57c433);});});})[_0x57f0('0x1a')](function(){return new BPromise(function(_0x59990a,_0x39ed0b){zipdir(_0x55951b,{'saveTo':_0x205c82},function(_0x4ca120,_0x395abb){if(_0x4ca120)return _0x39ed0b(_0x4ca120);return _0x59990a(_0x395abb);});})[_0x57f0('0x1a')](function(){return new BPromise(function(_0x53299a,_0x422433){rimraf(_0x55951b,function(_0x52d268){if(_0x52d268)_0x422433(_0x52d268);return _0x53299a();});});})['then'](function(){return _0x10dd12[_0x57f0('0xd4')](_0x205c82,_0x3d9984,function(_0x818a3c){if(!_0x818a3c)fs[_0x57f0('0xec')](_0x205c82);});});});}else{return _0x10dd12['sendStatus'](0xc8);}})[_0x57f0('0x2d')](handleError(_0x10dd12,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 145619b..48d84aa 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 _0x0e62=['remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','MailMessage','save','update'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x0e62,0x19f));var _0x20e6=function(_0xc78829,_0x21c544){_0xc78829=_0xc78829-0x0;var _0xcd776f=_0x0e62[_0xc78829];return _0xcd776f;};'use strict';var EventEmitter=require(_0x20e6('0x0'));var MailInteraction=require(_0x20e6('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x20e6('0x1'))['db'][_0x20e6('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x20e6('0x3'),'afterUpdate':_0x20e6('0x4'),'afterDestroy':_0x20e6('0x5')};function emitEvent(_0x5c9d34){return function(_0x4bc3c2,_0x17b86a,_0x183cea){_0x4bc3c2['getUsers']({'attributes':['id'],'raw':!![]})[_0x20e6('0x6')](function(_0x283d2d){_0x4bc3c2[_0x20e6('0x7')](_0x20e6('0x8'),_0x283d2d['map'](function(_0x3ac10e){return{'id':_0x3ac10e['id']};}));return MailMessage[_0x20e6('0x9')]({'where':{'MailInteractionId':_0x4bc3c2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4c19a0){_0x4bc3c2[_0x20e6('0x7')](_0x20e6('0xa'),_0x4c19a0[_0x20e6('0xb')]);MailInteractionEvents[_0x20e6('0xc')](_0x5c9d34+':'+_0x4bc3c2['id'],_0x4bc3c2);MailInteractionEvents['emit'](_0x5c9d34,_0x4bc3c2);_0x183cea(null);})[_0x20e6('0xd')](_0x183cea(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x20e6('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x1c1f=['hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','Users','findAll','then','setDataValue','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x215997,_0x1ac597){var _0x240031=function(_0x212363){while(--_0x212363){_0x215997['push'](_0x215997['shift']());}};_0x240031(++_0x1ac597);}(_0x1c1f,0x1f0));var _0xf1c1=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x1c1f[_0x2283dc];return _0x16db90;};'use strict';var EventEmitter=require(_0xf1c1('0x0'));var MailInteraction=require(_0xf1c1('0x1'))['db'][_0xf1c1('0x2')];var MailMessage=require(_0xf1c1('0x1'))['db'][_0xf1c1('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf1c1('0x4')](0x0);var events={'afterCreate':_0xf1c1('0x5'),'afterUpdate':_0xf1c1('0x6'),'afterDestroy':_0xf1c1('0x7')};function emitEvent(_0x2cb302){return function(_0xb442d9,_0x4ee4de,_0x2ceed9){_0xb442d9[_0xf1c1('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3996c){_0xb442d9['setDataValue'](_0xf1c1('0x9'),_0x3996c['map'](function(_0x59d606){return{'id':_0x59d606['id']};}));return MailMessage[_0xf1c1('0xa')]({'where':{'MailInteractionId':_0xb442d9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf1c1('0xb')](function(_0x2d3909){_0xb442d9[_0xf1c1('0xc')](_0xf1c1('0xd'),_0x2d3909['length']);MailInteractionEvents['emit'](_0x2cb302+':'+_0xb442d9['id'],_0xb442d9);MailInteractionEvents[_0xf1c1('0xe')](_0x2cb302,_0xb442d9);_0x2ceed9(null);})[_0xf1c1('0xf')](_0x2ceed9(null));};}for(var e in events){if(events[_0xf1c1('0x10')](e)){var event=events[e];MailInteraction[_0xf1c1('0x11')](e,emitEvent(event));}}module[_0xf1c1('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 4b0ea7d..c72e42c 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 _0x73e9=['YYYY-MM-DD\x20HH:mm:ss','closedAt','substatusAt','closed','models','MailMessage','update','then','catch','utf8mb4','lodash','util','moment','bluebird','path','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','format'];(function(_0x3f90f8,_0x305df8){var _0x102bbf=function(_0x3d15ad){while(--_0x3d15ad){_0x3f90f8['push'](_0x3f90f8['shift']());}};_0x102bbf(++_0x305df8);}(_0x73e9,0x12a));var _0x973e=function(_0xbf99dd,_0x255ca3){_0xbf99dd=_0xbf99dd-0x0;var _0x3f173d=_0x73e9[_0xbf99dd];return _0x3f173d;};'use strict';var _=require(_0x973e('0x0'));var util=require(_0x973e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x973e('0x2'));var BPromise=require(_0x973e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x973e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x973e('0x5'));module[_0x973e('0x6')]=function(_0x3b831c,_0x424bf2){return _0x3b831c[_0x973e('0x7')](_0x973e('0x8'),attributes,{'tableName':_0x973e('0x9'),'paranoid':![],'indexes':[{'name':_0x973e('0xa'),'fields':[_0x973e('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x34e2f1,_0x19b80c,_0x197038){if(_0x34e2f1[_0x973e('0xc')]){_0x34e2f1['substatusAt']=moment()[_0x973e('0xd')](_0x973e('0xe'));}if(_0x34e2f1['closed']){_0x34e2f1[_0x973e('0xf')]=moment()[_0x973e('0xd')](_0x973e('0xe'));}_0x197038(null,_0x19b80c);},'beforeUpdate':function(_0x42a02f,_0x54ca08,_0x5a29de){if(_0x42a02f['changed'](_0x973e('0xc'))){_0x42a02f[_0x973e('0x10')]=_0x42a02f[_0x973e('0xc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x42a02f['changed'](_0x973e('0x11'))){_0x42a02f['closedAt']=moment()[_0x973e('0xd')](_0x973e('0xe'));_0x42a02f[_0x973e('0xc')]=null;_0x42a02f[_0x973e('0x10')]=null;}_0x5a29de(null,_0x42a02f);},'afterUpdate':function(_0xb28f80,_0x2d216b,_0x458430){var _0x21bf99=_0x3b831c[_0x973e('0x12')];var _0x20985e=_0xb28f80['get']({'plain':!![]});if(_0x20985e[_0x973e('0x11')]){return _0x21bf99[_0x973e('0x13')][_0x973e('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x20985e['id']}})[_0x973e('0x15')](function(){_0x458430();})[_0x973e('0x16')](function(_0x47d354){_0x458430(_0x47d354);});}else{_0x458430();}}},'charset':_0x973e('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x651b=['define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closedAt','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes'];(function(_0x4c440b,_0x33fb6d){var _0x11b121=function(_0x2c5ce1){while(--_0x2c5ce1){_0x4c440b['push'](_0x4c440b['shift']());}};_0x11b121(++_0x33fb6d);}(_0x651b,0x66));var _0xb651=function(_0x250e6b,_0x125a75){_0x250e6b=_0x250e6b-0x0;var _0x1efb7f=_0x651b[_0x250e6b];return _0x1efb7f;};'use strict';var _=require(_0xb651('0x0'));var util=require(_0xb651('0x1'));var logger=require(_0xb651('0x2'))(_0xb651('0x3'));var moment=require(_0xb651('0x4'));var BPromise=require(_0xb651('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb651('0x6'));var rimraf=require(_0xb651('0x7'));var config=require(_0xb651('0x8'));var attributes=require(_0xb651('0x9'));module['exports']=function(_0x31bb2f,_0x44da47){return _0x31bb2f[_0xb651('0xa')](_0xb651('0xb'),attributes,{'tableName':_0xb651('0xc'),'paranoid':![],'indexes':[{'name':_0xb651('0xd'),'fields':[_0xb651('0xe'),'to'],'type':_0xb651('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c0baa,_0x4387e5,_0x4e32ab){if(_0x5c0baa['substatus']){_0x5c0baa[_0xb651('0x10')]=moment()[_0xb651('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5c0baa[_0xb651('0x12')]){_0x5c0baa['closedAt']=moment()[_0xb651('0x11')](_0xb651('0x13'));}_0x4e32ab(null,_0x4387e5);},'beforeUpdate':function(_0x4aba58,_0x5b6272,_0x4a0734){if(_0x4aba58[_0xb651('0x14')](_0xb651('0x15'))){_0x4aba58[_0xb651('0x10')]=_0x4aba58[_0xb651('0x15')]?moment()[_0xb651('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x4aba58[_0xb651('0x14')]('closed')){_0x4aba58[_0xb651('0x16')]=moment()[_0xb651('0x11')](_0xb651('0x13'));_0x4aba58[_0xb651('0x15')]=null;_0x4aba58[_0xb651('0x10')]=null;}_0x4a0734(null,_0x4aba58);},'afterUpdate':function(_0x19cc63,_0x2194ec,_0x48264d){var _0x92aabb=_0x31bb2f['models'];var _0x31bb11=_0x19cc63['get']({'plain':!![]});if(_0x31bb11[_0xb651('0x12')]){return _0x92aabb[_0xb651('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x31bb11['id']}})[_0xb651('0x18')](function(){_0x48264d();})[_0xb651('0x19')](function(_0xcf1b6e){_0x48264d(_0xcf1b6e);});}else{_0x48264d();}}},'charset':_0xb651('0x1a'),'collate':_0xb651('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 61431fa..1b693b6 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 _0x8a01=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','AddTags','util','moment'];(function(_0xfb99f0,_0xaee846){var _0x3dbfa3=function(_0x5a7f32){while(--_0x5a7f32){_0xfb99f0['push'](_0xfb99f0['shift']());}};_0x3dbfa3(++_0xaee846);}(_0x8a01,0x198));var _0x18a0=function(_0x3be64f,_0x4dc241){_0x3be64f=_0x3be64f-0x0;var _0x343a36=_0x8a01[_0x3be64f];return _0x343a36;};'use strict';var _=require('lodash');var util=require(_0x18a0('0x0'));var moment=require(_0x18a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x18a0('0x2'));var fs=require('fs');var Redis=require(_0x18a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x18a0('0x4'));var logger=require(_0x18a0('0x5'))(_0x18a0('0x6'));var config=require(_0x18a0('0x7'));var jayson=require(_0x18a0('0x8'));var client=jayson[_0x18a0('0x9')][_0x18a0('0xa')]({'port':0x232a});config[_0x18a0('0xb')]=_[_0x18a0('0xc')](config[_0x18a0('0xb')],{'host':_0x18a0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x18a0('0xb')]));require(_0x18a0('0xe'))[_0x18a0('0xf')](socket);function respondWithRpcPromise(_0x1d8f09,_0x47f043,_0x5f4daa){return new BPromise(function(_0x16849f,_0x331fea){return client['request'](_0x1d8f09,_0x5f4daa)[_0x18a0('0x10')](function(_0x9a4e2d){logger[_0x18a0('0x11')](_0x18a0('0x12'),_0x47f043,_0x18a0('0x13'));logger[_0x18a0('0x14')](_0x18a0('0x15'),_0x47f043,_0x18a0('0x13'),JSON[_0x18a0('0x16')](_0x9a4e2d));if(_0x9a4e2d[_0x18a0('0x17')]){if(_0x9a4e2d[_0x18a0('0x17')]['code']===0x1f4){logger[_0x18a0('0x17')](_0x18a0('0x12'),_0x47f043,_0x9a4e2d[_0x18a0('0x17')]['message']);return _0x331fea(_0x9a4e2d[_0x18a0('0x17')][_0x18a0('0x18')]);}logger[_0x18a0('0x17')]('MailInteraction,\x20%s,\x20%s',_0x47f043,_0x9a4e2d['error'][_0x18a0('0x18')]);return _0x16849f(_0x9a4e2d['error'][_0x18a0('0x18')]);}else{logger[_0x18a0('0x11')]('MailInteraction,\x20%s,\x20%s',_0x47f043,_0x18a0('0x13'));_0x16849f(_0x9a4e2d[_0x18a0('0x19')][_0x18a0('0x18')]);}})[_0x18a0('0x1a')](function(_0x33b58c){logger[_0x18a0('0x17')](_0x18a0('0x12'),_0x47f043,_0x33b58c);_0x331fea(_0x33b58c);});});}exports[_0x18a0('0x1b')]=function(_0x285581){var _0x42c0c9=this;return new Promise(function(_0x44fbcd,_0x2d98ca){return db[_0x18a0('0x1c')][_0x18a0('0x1d')](_0x285581[_0x18a0('0x1e')],{'raw':_0x285581[_0x18a0('0x1f')]?_0x285581[_0x18a0('0x1f')][_0x18a0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x285581['options']?_0x285581[_0x18a0('0x1f')][_0x18a0('0x21')]||null:null,'attributes':_0x285581[_0x18a0('0x1f')]?_0x285581[_0x18a0('0x1f')][_0x18a0('0x22')]||null:null,'limit':_0x285581['options']?_0x285581[_0x18a0('0x1f')][_0x18a0('0x23')]||null:null})[_0x18a0('0x10')](function(_0x250b2c){logger['info'](_0x18a0('0x1b'),_0x285581);logger[_0x18a0('0x14')](_0x18a0('0x1b'),_0x285581,JSON[_0x18a0('0x16')](_0x250b2c));_0x44fbcd(_0x250b2c);})[_0x18a0('0x1a')](function(_0x7fecea){logger['error'](_0x18a0('0x1b'),_0x7fecea[_0x18a0('0x18')],_0x285581);_0x2d98ca(_0x42c0c9['error'](0x1f4,_0x7fecea[_0x18a0('0x18')]));});});};exports[_0x18a0('0x24')]=function(_0x2ec9c6){return new Promise(function(_0x2ad1d7,_0x2c8d18){return db[_0x18a0('0x1c')]['find']({'where':_0x2ec9c6[_0x18a0('0x1f')]?_0x2ec9c6[_0x18a0('0x1f')]['where']||null:null})[_0x18a0('0x10')](function(_0x305eab){if(_0x305eab){return _0x305eab[_0x18a0('0x25')](_0x2ec9c6[_0x18a0('0x1e')][_0x18a0('0x26')],_[_0x18a0('0x27')](_0x2ec9c6['body'],['ids','id'])||{});}})['spread'](function(_0x1ba2e7){logger['info'](_0x18a0('0x28'),_0x2ec9c6);logger[_0x18a0('0x14')](_0x18a0('0x28'),_0x2ec9c6,JSON[_0x18a0('0x16')](_0x1ba2e7));_0x2ad1d7(_0x1ba2e7);})['catch'](function(_0x279261){logger[_0x18a0('0x17')](_0x18a0('0x28'),_0x279261[_0x18a0('0x18')],_0x2ec9c6);_0x2c8d18(_this[_0x18a0('0x17')](0x1f4,_0x279261[_0x18a0('0x18')]));});});}; \ No newline at end of file +var _0x3cc7=['then','stringify','AddTagsToMailInteraction','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cc7,0x11f));var _0x73cc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x3cc7[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x73cc('0x0'));var util=require(_0x73cc('0x1'));var moment=require(_0x73cc('0x2'));var BPromise=require(_0x73cc('0x3'));var rs=require(_0x73cc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73cc('0x6'))('rpc');var config=require(_0x73cc('0x7'));var jayson=require(_0x73cc('0x8'));var client=jayson[_0x73cc('0x9')]['http']({'port':0x232a});config[_0x73cc('0xa')]=_[_0x73cc('0xb')](config[_0x73cc('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x73cc('0xc'))[_0x73cc('0xd')](socket);function respondWithRpcPromise(_0x558ebc,_0x594eae,_0x338da6){return new BPromise(function(_0x459e0f,_0x4e9141){return client[_0x73cc('0xe')](_0x558ebc,_0x338da6)['then'](function(_0x570dab){logger['info'](_0x73cc('0xf'),_0x594eae,_0x73cc('0x10'));logger[_0x73cc('0x11')](_0x73cc('0x12'),_0x594eae,'request\x20sent',JSON['stringify'](_0x570dab));if(_0x570dab['error']){if(_0x570dab[_0x73cc('0x13')][_0x73cc('0x14')]===0x1f4){logger['error'](_0x73cc('0xf'),_0x594eae,_0x570dab['error'][_0x73cc('0x15')]);return _0x4e9141(_0x570dab[_0x73cc('0x13')][_0x73cc('0x15')]);}logger[_0x73cc('0x13')](_0x73cc('0xf'),_0x594eae,_0x570dab['error'][_0x73cc('0x15')]);return _0x459e0f(_0x570dab[_0x73cc('0x13')][_0x73cc('0x15')]);}else{logger[_0x73cc('0x16')](_0x73cc('0xf'),_0x594eae,_0x73cc('0x10'));_0x459e0f(_0x570dab[_0x73cc('0x17')][_0x73cc('0x15')]);}})[_0x73cc('0x18')](function(_0x568aaa){logger[_0x73cc('0x13')](_0x73cc('0xf'),_0x594eae,_0x568aaa);_0x4e9141(_0x568aaa);});});}exports[_0x73cc('0x19')]=function(_0xf8d02f){var _0x96db87=this;return new Promise(function(_0x23ecb8,_0x49527d){return db[_0x73cc('0x1a')]['update'](_0xf8d02f[_0x73cc('0x1b')],{'raw':_0xf8d02f[_0x73cc('0x1c')]?_0xf8d02f[_0x73cc('0x1c')][_0x73cc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf8d02f[_0x73cc('0x1c')]?_0xf8d02f[_0x73cc('0x1c')][_0x73cc('0x1e')]||null:null,'attributes':_0xf8d02f[_0x73cc('0x1c')]?_0xf8d02f['options'][_0x73cc('0x1f')]||null:null,'limit':_0xf8d02f[_0x73cc('0x1c')]?_0xf8d02f['options'][_0x73cc('0x20')]||null:null})[_0x73cc('0x21')](function(_0x122ee7){logger[_0x73cc('0x16')](_0x73cc('0x19'),_0xf8d02f);logger[_0x73cc('0x11')](_0x73cc('0x19'),_0xf8d02f,JSON[_0x73cc('0x22')](_0x122ee7));_0x23ecb8(_0x122ee7);})['catch'](function(_0x5ea80a){logger['error']('UpdateMailInteraction',_0x5ea80a[_0x73cc('0x15')],_0xf8d02f);_0x49527d(_0x96db87[_0x73cc('0x13')](0x1f4,_0x5ea80a[_0x73cc('0x15')]));});});};exports[_0x73cc('0x23')]=function(_0x4db816){return new Promise(function(_0x2fd716,_0x447ee7){return db[_0x73cc('0x1a')]['find']({'where':_0x4db816['options']?_0x4db816[_0x73cc('0x1c')][_0x73cc('0x1e')]||null:null})[_0x73cc('0x21')](function(_0x5120da){if(_0x5120da){return _0x5120da['addTags'](_0x4db816[_0x73cc('0x1b')][_0x73cc('0x24')],_[_0x73cc('0x25')](_0x4db816[_0x73cc('0x1b')],[_0x73cc('0x24'),'id'])||{});}})[_0x73cc('0x26')](function(_0x2e0158){logger[_0x73cc('0x16')](_0x73cc('0x27'),_0x4db816);logger[_0x73cc('0x11')](_0x73cc('0x27'),_0x4db816,JSON[_0x73cc('0x22')](_0x2e0158));_0x2fd716(_0x2e0158);})[_0x73cc('0x18')](function(_0x2a58c0){logger[_0x73cc('0x13')](_0x73cc('0x27'),_0x2a58c0['message'],_0x4db816);_0x447ee7(_this[_0x73cc('0x13')](0x1f4,_0x2a58c0[_0x73cc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index bfc9730..c98916a 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 _0xe583=['mailInteraction:','./mailInteraction.events','update','emit','register','length'];(function(_0x551479,_0x392384){var _0x394c55=function(_0x275865){while(--_0x275865){_0x551479['push'](_0x551479['shift']());}};_0x394c55(++_0x392384);}(_0xe583,0xc7));var _0x3e58=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe583[_0x543084];return _0x306a57;};'use strict';var MailInteractionEvents=require(_0x3e58('0x0'));var events=['save','remove',_0x3e58('0x1')];function createListener(_0x2ebfd5,_0x35abe3){return function(_0x3bb406){_0x35abe3[_0x3e58('0x2')](_0x2ebfd5,_0x3bb406);};}function removeListener(_0x14d712,_0x202424){return function(){MailInteractionEvents['removeListener'](_0x14d712,_0x202424);};}exports[_0x3e58('0x3')]=function(_0x3a7ca4){for(var _0x993a06=0x0,_0x191337=events[_0x3e58('0x4')];_0x993a06<_0x191337;_0x993a06++){var _0x411a2c=events[_0x993a06];var _0x577753=createListener(_0x3e58('0x5')+_0x411a2c,_0x3a7ca4);MailInteractionEvents['on'](_0x411a2c,_0x577753);}}; \ No newline at end of file +var _0xab3b=['emit','register','mailInteraction:','save','remove','update'];(function(_0x33bfda,_0x194603){var _0x46144a=function(_0x3350fb){while(--_0x3350fb){_0x33bfda['push'](_0x33bfda['shift']());}};_0x46144a(++_0x194603);}(_0xab3b,0x1a1));var _0xbab3=function(_0x97a6b6,_0x3c304c){_0x97a6b6=_0x97a6b6-0x0;var _0x5724be=_0xab3b[_0x97a6b6];return _0x5724be;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xbab3('0x0'),_0xbab3('0x1'),_0xbab3('0x2')];function createListener(_0x3a860a,_0x564003){return function(_0x3bb9ad){_0x564003[_0xbab3('0x3')](_0x3a860a,_0x3bb9ad);};}function removeListener(_0x1938cd,_0x4d052f){return function(){MailInteractionEvents['removeListener'](_0x1938cd,_0x4d052f);};}exports[_0xbab3('0x4')]=function(_0x3dab0c){for(var _0x244c5d=0x0,_0x518333=events['length'];_0x244c5d<_0x518333;_0x244c5d++){var _0x35937c=events[_0x244c5d];var _0x1b4156=createListener(_0xbab3('0x5')+_0x35937c,_0x3dab0c);MailInteractionEvents['on'](_0x35937c,_0x1b4156);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 89ffd0d..e0e55ff 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 _0xc1aa=['mail','mailmessage:create','put','/:id','accept','/:id/reject','reject','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id/download','download','post'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xc1aa,0xa9));var _0xac1a=function(_0x4f070a,_0x4e79d1){_0x4f070a=_0x4f070a-0x0;var _0xf0fe35=_0xc1aa[_0x4f070a];return _0xf0fe35;};'use strict';var multer=require(_0xac1a('0x0'));var util=require('util');var path=require(_0xac1a('0x1'));var timeout=require(_0xac1a('0x2'));var express=require(_0xac1a('0x3'));var router=express['Router']();var fs_extra=require(_0xac1a('0x4'));var auth=require(_0xac1a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac1a('0x6'));var controller=require('./mailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xac1a('0x7')]);router[_0xac1a('0x8')](_0xac1a('0x9'),auth[_0xac1a('0xa')](),controller[_0xac1a('0xb')]);router['get']('/:id',auth[_0xac1a('0xa')](),controller['show']);router[_0xac1a('0x8')](_0xac1a('0xc'),auth[_0xac1a('0xa')](),controller[_0xac1a('0xd')]);router[_0xac1a('0xe')]('/',auth[_0xac1a('0xa')](),interaction['tracked'](_0xac1a('0xf'),_0xac1a('0x10')),controller['create']);router[_0xac1a('0x11')](_0xac1a('0x12'),auth[_0xac1a('0xa')](),controller['update']);router[_0xac1a('0x11')]('/:id/accept',auth[_0xac1a('0xa')](),controller[_0xac1a('0x13')]);router[_0xac1a('0x11')](_0xac1a('0x14'),auth[_0xac1a('0xa')](),controller[_0xac1a('0x15')]);router['delete'](_0xac1a('0x12'),auth[_0xac1a('0xa')](),controller['destroy']);module[_0xac1a('0x16')]=router; \ No newline at end of file +var _0xca8e=['post','mail','create','put','update','/:id/accept','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','download'];(function(_0x44430e,_0x227e8e){var _0xeed171=function(_0x1523e5){while(--_0x1523e5){_0x44430e['push'](_0x44430e['shift']());}};_0xeed171(++_0x227e8e);}(_0xca8e,0xbd));var _0xeca8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca8e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeca8('0x0'));var timeout=require(_0xeca8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeca8('0x2'));var auth=require(_0xeca8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xeca8('0x4'));var controller=require('./mailMessage.controller');router[_0xeca8('0x5')]('/',auth[_0xeca8('0x6')](),controller['index']);router['get'](_0xeca8('0x7'),auth[_0xeca8('0x6')](),controller['describe']);router['get'](_0xeca8('0x8'),auth[_0xeca8('0x6')](),controller[_0xeca8('0x9')]);router[_0xeca8('0x5')]('/:id/download',auth[_0xeca8('0x6')](),controller[_0xeca8('0xa')]);router[_0xeca8('0xb')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xeca8('0xc'),'mailmessage:create'),controller[_0xeca8('0xd')]);router[_0xeca8('0xe')](_0xeca8('0x8'),auth[_0xeca8('0x6')](),controller[_0xeca8('0xf')]);router[_0xeca8('0xe')](_0xeca8('0x10'),auth['isAuthenticated'](),controller['accept']);router[_0xeca8('0xe')]('/:id/reject',auth[_0xeca8('0x6')](),controller['reject']);router[_0xeca8('0x11')]('/:id',auth[_0xeca8('0x6')](),controller[_0xeca8('0x12')]);module[_0xeca8('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index be4075e..b5d4c65 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 _0x7481=['INTEGER','ENUM','Email','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE'];(function(_0x28d253,_0x1d5465){var _0x48c65c=function(_0x31e23c){while(--_0x31e23c){_0x28d253['push'](_0x28d253['shift']());}};_0x48c65c(++_0x1d5465);}(_0x7481,0x155));var _0x1748=function(_0x502e43,_0x307f96){_0x502e43=_0x502e43-0x0;var _0x578ea7=_0x7481[_0x502e43];return _0x578ea7;};'use strict';var Sequelize=require(_0x1748('0x0'));var _=require(_0x1748('0x1'));module[_0x1748('0x2')]={'body':{'type':Sequelize[_0x1748('0x3')](_0x1748('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x1748('0x5'))},'read':{'type':Sequelize[_0x1748('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1748('0x7')),'defaultValue':_0x1748('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x1748('0x8')]},'to':{'type':Sequelize[_0x1748('0x3')](_0x1748('0x4'))},'cc':{'type':Sequelize[_0x1748('0x3')](_0x1748('0x4'))},'bcc':{'type':Sequelize[_0x1748('0x3')](_0x1748('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x1748('0x9')]},'attach':{'type':Sequelize[_0x1748('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1748('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1748('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x1748('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0x1748('0x4'))},'originChannel':{'type':Sequelize[_0x1748('0xb')](_0x1748('0xc'),'Chat'),'defaultValue':_0x1748('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x5893=['Chat','lodash','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','INTEGER','Email'];(function(_0x3f62c1,_0x2b1a48){var _0x12b740=function(_0x4dabe4){while(--_0x4dabe4){_0x3f62c1['push'](_0x3f62c1['shift']());}};_0x12b740(++_0x2b1a48);}(_0x5893,0xa6));var _0x3589=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5893[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3589('0x0'));module['exports']={'body':{'type':Sequelize[_0x3589('0x1')](_0x3589('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x3589('0x1')](_0x3589('0x3'))},'read':{'type':Sequelize[_0x3589('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3589('0x5')]('in',_0x3589('0x6')),'defaultValue':_0x3589('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x3589('0x7')]},'to':{'type':Sequelize['TEXT'](_0x3589('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x3589('0x2'))},'bcc':{'type':Sequelize[_0x3589('0x1')](_0x3589('0x2'))},'subject':{'type':Sequelize[_0x3589('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x3589('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x3589('0x1')]('long')},'originCc':{'type':Sequelize[_0x3589('0x1')](_0x3589('0x2'))},'originChannel':{'type':Sequelize[_0x3589('0x5')](_0x3589('0x9'),_0x3589('0xa')),'defaultValue':_0x3589('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 30d10c4..71edab8 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 _0xd932=['fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','MailMessage','includeAll','include','findAll','rows','show','params','keys','find','body','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','user','MailInteractionId','read1stAt','interaction','get','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','Sequelize','rejectmessage','download','toString','join','files','root','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','eml-format','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','json','offset','limit','undefined','count','status','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes'];(function(_0x56225f,_0x2522d7){var _0x1dfe3f=function(_0x1189e9){while(--_0x1189e9){_0x56225f['push'](_0x56225f['shift']());}};_0x1dfe3f(++_0x2522d7);}(_0xd932,0x10b));var _0x2d93=function(_0x48c164,_0x4d6c1a){_0x48c164=_0x48c164-0x0;var _0x1fe16f=_0xd932[_0x48c164];return _0x1fe16f;};'use strict';var emlformat=require(_0x2d93('0x0'));var moment=require('moment');var BPromise=require(_0x2d93('0x1'));var util=require(_0x2d93('0x2'));var path=require(_0x2d93('0x3'));var fs=require('fs');var _=require(_0x2d93('0x4'));var Redis=require(_0x2d93('0x5'));var htmlToText=require(_0x2d93('0x6'));var qs=require(_0x2d93('0x7'));var logger=require('../../config/logger')(_0x2d93('0x8'));var interaction_log=require(_0x2d93('0x9'))(_0x2d93('0xa'));var config=require(_0x2d93('0xb'));var db=require(_0x2d93('0xc'))['db'];config[_0x2d93('0xd')]=_[_0x2d93('0xe')](config[_0x2d93('0xd')],{'host':_0x2d93('0xf'),'port':0x18eb});var socket=require(_0x2d93('0x10'))(new Redis(config[_0x2d93('0xd')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')['register'](socket);var jayson=require(_0x2d93('0x11'));var client=jayson[_0x2d93('0x12')][_0x2d93('0x13')]({'port':0x232c});var client9003=jayson[_0x2d93('0x12')][_0x2d93('0x13')]({'port':0x232b});var client9002=jayson['client'][_0x2d93('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x249b17,_0x2b9a48,_0x554e62,_0x427507){return new BPromise(function(_0xd7a9fd,_0x35a609){var _0x3a1768=_0x427507||client;return _0x3a1768[_0x2d93('0x14')](_0x249b17,_0x554e62)[_0x2d93('0x15')](function(_0x54e863){logger[_0x2d93('0x16')](_0x2d93('0x17'),_0x2b9a48,_0x2d93('0x18'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x2b9a48,_0x2d93('0x18'),JSON[_0x2d93('0x19')](_0x54e863));if(_0x54e863[_0x2d93('0x1a')]){if(_0x54e863['error'][_0x2d93('0x1b')]===0x1f4){logger['error'](_0x2d93('0x17'),_0x2b9a48,_0x54e863[_0x2d93('0x1a')]['message']);return _0x35a609(_0x54e863[_0x2d93('0x1a')][_0x2d93('0x1c')]);}logger[_0x2d93('0x1a')]('MailMessage,\x20%s,\x20%s',_0x2b9a48,_0x54e863[_0x2d93('0x1a')][_0x2d93('0x1c')]);return _0xd7a9fd(_0x54e863[_0x2d93('0x1a')][_0x2d93('0x1c')]);}else{logger[_0x2d93('0x16')](_0x2d93('0x17'),_0x2b9a48,_0x2d93('0x18'));_0xd7a9fd(_0x54e863[_0x2d93('0x1d')][_0x2d93('0x1c')]);}})[_0x2d93('0x1e')](function(_0x5e12c4){logger[_0x2d93('0x1a')](_0x2d93('0x17'),_0x2b9a48,_0x5e12c4);_0x35a609(_0x5e12c4);});});}function respondWithResult(_0x3a120,_0x29c585){_0x29c585=_0x29c585||0xc8;return function(_0x4aab8a){if(_0x4aab8a){return _0x3a120['status'](_0x29c585)[_0x2d93('0x1f')](_0x4aab8a);}};}function respondWithFilteredResult(_0x3f28cb,_0x46e50b){return function(_0x335b04){if(_0x335b04){var _0x977dc2=typeof _0x46e50b[_0x2d93('0x20')]==='undefined'&&typeof _0x46e50b[_0x2d93('0x21')]===_0x2d93('0x22');var _0x5ee27a=_0x335b04[_0x2d93('0x23')];var _0x3ab96a=_0x977dc2?0x0:_0x46e50b[_0x2d93('0x20')];var _0x3f7dfc=_0x977dc2?_0x335b04['count']:_0x46e50b['offset']+_0x46e50b[_0x2d93('0x21')];var _0x4a42c8;if(_0x3f7dfc>=_0x5ee27a){_0x3f7dfc=_0x5ee27a;_0x4a42c8=0xc8;}else{_0x4a42c8=0xce;}_0x3f28cb[_0x2d93('0x24')](_0x4a42c8);return _0x3f28cb[_0x2d93('0x25')](_0x2d93('0x26'),_0x3ab96a+'-'+_0x3f7dfc+'/'+_0x5ee27a)[_0x2d93('0x1f')](_0x335b04);}return null;};}function saveUpdates(_0x54fc8f){return function(_0x237433){if(_0x237433){return _0x237433[_0x2d93('0x27')](_0x54fc8f)[_0x2d93('0x15')](function(_0x457777){return _0x457777;});}return null;};}function removeEntity(_0x421844){return function(_0x197c4f){if(_0x197c4f){return _0x197c4f[_0x2d93('0x28')]()[_0x2d93('0x15')](function(){_0x421844[_0x2d93('0x24')](0xcc)[_0x2d93('0x29')]();});}};}function handleEntityNotFound(_0x4dae5f){return function(_0x502de3){if(!_0x502de3){_0x4dae5f[_0x2d93('0x2a')](0x194);}return _0x502de3;};}function handleError(_0x2cc027,_0xfc710f){_0xfc710f=_0xfc710f||0x1f4;return function(_0x2147ff){logger[_0x2d93('0x1a')](_0x2147ff[_0x2d93('0x2b')]);if(_0x2147ff['name']){delete _0x2147ff[_0x2d93('0x2c')];}_0x2cc027[_0x2d93('0x24')](_0xfc710f)['send'](_0x2147ff);};}exports[_0x2d93('0x2d')]=function(_0xf5cb64,_0x1bd650){var _0x5d8e97={},_0x2f4fb9={},_0x38b57d={'count':0x0,'rows':[]};var _0x345f2a=_[_0x2d93('0x2e')](db['MailMessage'][_0x2d93('0x2f')],function(_0x2bbdb6){return{'name':_0x2bbdb6[_0x2d93('0x30')],'type':_0x2bbdb6['type'][_0x2d93('0x31')]};});_0x2f4fb9[_0x2d93('0x32')]=_[_0x2d93('0x2e')](_0x345f2a,'name');_0x2f4fb9[_0x2d93('0x33')]=_['keys'](_0xf5cb64[_0x2d93('0x33')]);_0x2f4fb9[_0x2d93('0x34')]=_[_0x2d93('0x35')](_0x2f4fb9[_0x2d93('0x32')],_0x2f4fb9[_0x2d93('0x33')]);_0x5d8e97[_0x2d93('0x36')]=_['intersection'](_0x2f4fb9[_0x2d93('0x32')],qs[_0x2d93('0x37')](_0xf5cb64[_0x2d93('0x33')][_0x2d93('0x37')]));_0x5d8e97[_0x2d93('0x36')]=_0x5d8e97['attributes'][_0x2d93('0x38')]?_0x5d8e97['attributes']:_0x2f4fb9[_0x2d93('0x32')];if(!_0xf5cb64[_0x2d93('0x33')]['hasOwnProperty'](_0x2d93('0x39'))){_0x5d8e97['limit']=qs[_0x2d93('0x21')](_0xf5cb64[_0x2d93('0x33')][_0x2d93('0x21')]);_0x5d8e97[_0x2d93('0x20')]=qs['offset'](_0xf5cb64['query']['offset']);}_0x5d8e97['order']=qs[_0x2d93('0x3a')](_0xf5cb64[_0x2d93('0x33')][_0x2d93('0x3a')]);_0x5d8e97[_0x2d93('0x3b')]=qs['filters'](_[_0x2d93('0x3c')](_0xf5cb64[_0x2d93('0x33')],_0x2f4fb9['filters']),_0x345f2a);if(_0xf5cb64[_0x2d93('0x33')]['filter']){_0x5d8e97['where']=_[_0x2d93('0x3d')](_0x5d8e97['where'],{'$or':_[_0x2d93('0x2e')](_0x345f2a,function(_0xd32b35){if(_0xd32b35[_0x2d93('0x3e')]!==_0x2d93('0x3f')){var _0x18514f={};_0x18514f[_0xd32b35['name']]={'$like':'%'+_0xf5cb64['query'][_0x2d93('0x40')]+'%'};return _0x18514f;}})});}_0x5d8e97=_[_0x2d93('0x3d')]({},_0x5d8e97,_0xf5cb64[_0x2d93('0x41')]);var _0x18ca57={'where':_0x5d8e97[_0x2d93('0x3b')]};return db[_0x2d93('0x42')][_0x2d93('0x23')](_0x18ca57)[_0x2d93('0x15')](function(_0x5182dc){_0x38b57d[_0x2d93('0x23')]=_0x5182dc;if(_0xf5cb64[_0x2d93('0x33')][_0x2d93('0x43')]){_0x5d8e97[_0x2d93('0x44')]=[{'all':!![]}];}return db['MailMessage'][_0x2d93('0x45')](_0x5d8e97);})[_0x2d93('0x15')](function(_0x45f8ad){_0x38b57d[_0x2d93('0x46')]=_0x45f8ad;return _0x38b57d;})['then'](respondWithFilteredResult(_0x1bd650,_0x5d8e97))['catch'](handleError(_0x1bd650,null));};exports[_0x2d93('0x47')]=function(_0x28f785,_0x34359a){var _0x33eea7={'raw':!![],'where':{'id':_0x28f785[_0x2d93('0x48')]['id']}},_0xe01712={};_0xe01712['model']=_[_0x2d93('0x49')](db[_0x2d93('0x42')][_0x2d93('0x2f')]);_0xe01712[_0x2d93('0x33')]=_['keys'](_0x28f785[_0x2d93('0x33')]);_0xe01712['filters']=_[_0x2d93('0x35')](_0xe01712[_0x2d93('0x32')],_0xe01712[_0x2d93('0x33')]);_0x33eea7[_0x2d93('0x36')]=_[_0x2d93('0x35')](_0xe01712[_0x2d93('0x32')],qs['fields'](_0x28f785[_0x2d93('0x33')]['fields']));_0x33eea7[_0x2d93('0x36')]=_0x33eea7[_0x2d93('0x36')][_0x2d93('0x38')]?_0x33eea7['attributes']:_0xe01712[_0x2d93('0x32')];if(_0x28f785['query'][_0x2d93('0x43')]){_0x33eea7[_0x2d93('0x44')]=[{'all':!![]}];}_0x33eea7=_[_0x2d93('0x3d')]({},_0x33eea7,_0x28f785[_0x2d93('0x41')]);return db['MailMessage'][_0x2d93('0x4a')](_0x33eea7)[_0x2d93('0x15')](handleEntityNotFound(_0x34359a,null))[_0x2d93('0x15')](respondWithResult(_0x34359a,null))['catch'](handleError(_0x34359a,null));};exports[_0x2d93('0x27')]=function(_0x583b6d,_0x56c5b9){if(_0x583b6d[_0x2d93('0x4b')]['id']){delete _0x583b6d[_0x2d93('0x4b')]['id'];}return db[_0x2d93('0x42')]['find']({'where':{'id':_0x583b6d[_0x2d93('0x48')]['id']}})[_0x2d93('0x15')](handleEntityNotFound(_0x56c5b9,null))[_0x2d93('0x15')](saveUpdates(_0x583b6d['body'],null))['then'](respondWithResult(_0x56c5b9,null))[_0x2d93('0x1e')](handleError(_0x56c5b9,null));};exports[_0x2d93('0x28')]=function(_0x3f38fd,_0x179580){return db['MailMessage'][_0x2d93('0x4a')]({'where':{'id':_0x3f38fd['params']['id']}})[_0x2d93('0x15')](handleEntityNotFound(_0x179580,null))['then'](removeEntity(_0x179580,null))[_0x2d93('0x1e')](handleError(_0x179580,null));};exports['describe']=function(_0x4b9782,_0x4384c7){return db['MailMessage']['describe']()[_0x2d93('0x15')](respondWithResult(_0x4384c7,null))[_0x2d93('0x1e')](handleError(_0x4384c7,null));};exports[_0x2d93('0x4c')]=function(_0x4de767,_0x4f471){return db[_0x2d93('0x42')][_0x2d93('0x4c')](_0x4de767[_0x2d93('0x4b')])[_0x2d93('0x15')](function(_0x9887da){if(_0x9887da){if(_0x9887da[_0x2d93('0x4d')]===_0x2d93('0x4e')&&!_0x9887da[_0x2d93('0x4f')]){var _0x243b95,_0x29df9f,_0x5aeb4f;if(_0x4de767[_0x2d93('0x4b')]['to']){_0x29df9f=_0x4de767['body']['to'][_0x2d93('0x50')](',')[0x0];}return db[_0x2d93('0x51')][_0x2d93('0x52')]({'where':{'id':_0x9887da[_0x2d93('0x53')]},'include':[{'model':db[_0x2d93('0x54')],'as':_0x2d93('0x55'),'include':[{'model':db[_0x2d93('0x56')],'as':_0x2d93('0x57'),'where':{'email':_0x29df9f},'limit':0x1,'order':[['updatedAt',_0x2d93('0x58')]]}]},{'model':db[_0x2d93('0x59')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2d93('0x5a')],'as':_0x2d93('0x5a'),'raw':!![]}]}]})[_0x2d93('0x15')](function(_0x279d83){_0x243b95=_0x279d83;if(!_0x243b95||!_0x243b95[_0x2d93('0x5b')])return;var _0xd7c3a5=_0x243b95[_0x2d93('0x5c')]();if(_0x4de767['body'][_0x2d93('0x5d')]&&_0x4de767[_0x2d93('0x4b')][_0x2d93('0x5d')][_0x2d93('0x38')]){for(var _0x1cabf7=0x0;_0x1cabf7<_0x4de767[_0x2d93('0x4b')][_0x2d93('0x5d')][_0x2d93('0x38')];_0x1cabf7+=0x1){_0x4de767['body'][_0x2d93('0x5d')][_0x1cabf7]={'filename':_0x4de767['body'][_0x2d93('0x5d')][_0x1cabf7][_0x2d93('0x2c')],'path':path['join'](config['root'],_0x2d93('0x5e'),_0x4de767[_0x2d93('0x4b')]['attachments'][_0x1cabf7][_0x2d93('0x5f')])};}}_0x5aeb4f={'account':_0xd7c3a5,'message':_0x4de767[_0x2d93('0x4b')]};return;})[_0x2d93('0x15')](function(){if(_0x243b95[_0x2d93('0x55')]){if(_0x243b95[_0x2d93('0x55')][_0x2d93('0x57')][_0x2d93('0x38')]){return _0x243b95[_0x2d93('0x55')][_0x2d93('0x57')][0x0];}else{return db[_0x2d93('0x56')][_0x2d93('0x4c')](_[_0x2d93('0xe')](_0x4de767[_0x2d93('0x4b')],{'firstName':_0x4de767[_0x2d93('0x4b')]['to'],'email':_0x4de767[_0x2d93('0x4b')]['to'],'phone':_0x4de767[_0x2d93('0x4b')]['to'],'ListId':_0x243b95['ListId']}));}}else{throw new Error(_0x2d93('0x60'));}})[_0x2d93('0x15')](function(){if(_0x5aeb4f){return respondWithRpcPromise(_0x2d93('0x61'),_0x2d93('0x62'),_0x5aeb4f,client9003)[_0x2d93('0x15')](function(_0x3be767){return _0x9887da[_0x2d93('0x27')]({'read':!![],'messageId':_0x3be767[_0x2d93('0x63')],'sentAt':moment()['format'](_0x2d93('0x64'))});})[_0x2d93('0x1e')](function(_0x17c28e){logger[_0x2d93('0x1a')]('%s',JSON[_0x2d93('0x19')](_0x17c28e));return _0x9887da;});}return _0x9887da;});}return _0x9887da;}})['then'](respondWithResult(_0x4f471,0xc9))[_0x2d93('0x1e')](handleError(_0x4f471,null));};exports[_0x2d93('0x65')]=function(_0x36b790,_0x5a5d9e){var _0x12ecfb={'agent':{},'channel':_0x2d93('0x66')};if(_0x36b790[_0x2d93('0x4b')]['id']){delete _0x36b790['body']['id'];}_0x36b790[_0x2d93('0x4b')]['read']=!![];_0x36b790[_0x2d93('0x4b')][_0x2d93('0x67')]=moment()[_0x2d93('0x68')](_0x2d93('0x64'));_0x36b790['body'][_0x2d93('0x69')]=_0x36b790['body'][_0x2d93('0x69')]||_0x36b790[_0x2d93('0x6a')]['id'];_0x12ecfb['agent']['id']=_0x36b790[_0x2d93('0x4b')][_0x2d93('0x69')];return db['MailMessage'][_0x2d93('0x4a')]({'where':{'id':_0x36b790[_0x2d93('0x48')]['id'],'UserId':null}})[_0x2d93('0x15')](handleEntityNotFound(_0x5a5d9e,null))[_0x2d93('0x15')](saveUpdates(_0x36b790[_0x2d93('0x4b')],null))['then'](function(_0x3910fb){if(_0x3910fb){_0x12ecfb[_0x2d93('0x1c')]=_0x3910fb['get']({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x3910fb[_0x2d93('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x5a5d9e,null))[_0x2d93('0x15')](function(_0x5d47e2){if(_0x5d47e2){return _0x5d47e2[_0x2d93('0x27')]({'UserId':_0x36b790['body']['UserId'],'read1stAt':_['isNil'](_0x5d47e2[_0x2d93('0x6c')])?moment()[_0x2d93('0x68')](_0x2d93('0x64')):undefined});}return null;})[_0x2d93('0x15')](function(_0x1a4fe7){if(_0x1a4fe7){_0x12ecfb[_0x2d93('0x6d')]=_0x1a4fe7[_0x2d93('0x6e')]({'plain':!![]});interaction_log[_0x2d93('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x36b790[_0x2d93('0x6a')]['id'],_0x36b790[_0x2d93('0x6a')]['name'],_0x36b790['user']['role'],_0x12ecfb[_0x2d93('0x6d')]['id'],_0x36b790['body']?JSON['stringify'](_0x36b790[_0x2d93('0x4b')]):_0x2d93('0x6f'));return respondWithRpcPromise(_0x2d93('0x70'),_0x2d93('0x71'),_0x12ecfb);}return null;})[_0x2d93('0x15')](function(_0x1338bd){var _0x1f70a6=_0x2d93('0x72')+_0x1338bd[_0x2d93('0x1c')][_0x2d93('0x73')];return db[_0x2d93('0x74')][_0x2d93('0x33')](_0x1f70a6,{'type':db['Sequelize'][_0x2d93('0x75')][_0x2d93('0x76')],'raw':!![]})[_0x2d93('0x15')](function(_0x21c308){return _0x21c308;});})[_0x2d93('0x15')](function(_0x2641f4){if(_0x2641f4){_0x12ecfb[_0x2d93('0x1c')][_0x2d93('0x77')]=_0x2641f4[0x0];if(!_0x36b790[_0x2d93('0x4b')][_0x2d93('0x69')])return;return db[_0x2d93('0x78')][_0x2d93('0x4a')]({'where':{'id':_0x36b790[_0x2d93('0x4b')][_0x2d93('0x69')],'role':_0x2d93('0x79')},'attributes':['id',_0x2d93('0x2c'),_0x2d93('0x7a'),_0x2d93('0x7b'),_0x2d93('0x7c')],'raw':!![]});}return null;})[_0x2d93('0x15')](function(_0x1b35cb){if(!_0x1b35cb)return null;_0x12ecfb[_0x2d93('0x1c')][_0x2d93('0x79')]=_0x1b35cb;return _0x12ecfb;})[_0x2d93('0x15')](function(_0x53dc55){if(_0x53dc55){if(_0x36b790[_0x2d93('0x4b')]['manual']){_0x12ecfb[_0x2d93('0x1c')][_0x2d93('0x7d')]=util['format'](_0x2d93('0x7e'),_0x36b790[_0x2d93('0x6a')][_0x2d93('0x2c')]);_0x12ecfb[_0x2d93('0x1c')][_0x2d93('0x7f')]=_0x12ecfb[_0x2d93('0x7f')];_0x12ecfb['message'][_0x2d93('0x80')]=_0x12ecfb[_0x2d93('0x7f')];_0x12ecfb[_0x2d93('0x1c')][_0x2d93('0x81')]=_0x2d93('0x65');_0x12ecfb[_0x2d93('0x1c')][_0x2d93('0x4b')]=htmlToText[_0x2d93('0x82')](_0x12ecfb[_0x2d93('0x1c')][_0x2d93('0x4b')]);return respondWithRpcPromise(_0x2d93('0x83'),'EventManager',{'event':_0x2d93('0x84'),'message':_0x12ecfb[_0x2d93('0x1c')]},client9002)[_0x2d93('0x15')](function(){return _0x12ecfb;});}return _0x12ecfb;}return null;})['then'](respondWithResult(_0x5a5d9e,null))['catch'](handleError(_0x5a5d9e,null));};exports[_0x2d93('0x85')]=function(_0x2a9282,_0x3cb5d9){var _0x2ce81c={'agent':{},'channel':_0x2d93('0x66')};if(_0x2a9282['body']['id']){delete _0x2a9282[_0x2d93('0x4b')]['id'];}_0x2a9282[_0x2d93('0x4b')][_0x2d93('0x69')]=_0x2a9282[_0x2d93('0x4b')][_0x2d93('0x69')]||_0x2a9282[_0x2d93('0x6a')]['id'];_0x2ce81c['agent']['id']=_0x2a9282['body'][_0x2d93('0x69')];return db[_0x2d93('0x42')][_0x2d93('0x4a')]({'where':{'id':_0x2a9282[_0x2d93('0x48')]['id'],'UserId':null}})[_0x2d93('0x15')](handleEntityNotFound(_0x3cb5d9,null))[_0x2d93('0x15')](function(_0x2805fe){if(_0x2805fe){_0x2ce81c[_0x2d93('0x1c')]=_0x2805fe[_0x2d93('0x6e')]({'plain':!![]});return db['MailInteraction'][_0x2d93('0x4a')]({'where':{'id':_0x2805fe[_0x2d93('0x6b')]}});}return null;})[_0x2d93('0x15')](handleEntityNotFound(_0x3cb5d9,null))[_0x2d93('0x15')](function(_0x19e721){if(_0x19e721){_0x2ce81c[_0x2d93('0x6d')]=_0x19e721[_0x2d93('0x6e')]({'plain':!![]});interaction_log[_0x2d93('0x16')](_0x2d93('0x86'),_0x2a9282['user']['id'],_0x2a9282['user']['name'],_0x2a9282[_0x2d93('0x6a')][_0x2d93('0x87')],_0x2ce81c['interaction']['id'],_0x2a9282[_0x2d93('0x4b')]?JSON[_0x2d93('0x19')](_0x2a9282['body']):_0x2d93('0x6f'));return respondWithRpcPromise(_0x2d93('0x88'),'rejectMessage',_0x2ce81c);}return null;})[_0x2d93('0x15')](function(_0x47e6c3){var _0x52b2b8=_0x2d93('0x72')+_0x47e6c3[_0x2d93('0x1c')][_0x2d93('0x73')];return db[_0x2d93('0x74')][_0x2d93('0x33')](_0x52b2b8,{'type':db[_0x2d93('0x89')][_0x2d93('0x75')][_0x2d93('0x76')],'raw':!![]})[_0x2d93('0x15')](function(_0x508405){return _0x508405;});})[_0x2d93('0x15')](function(_0x3d0096){if(_0x3d0096){_0x2ce81c[_0x2d93('0x1c')][_0x2d93('0x77')]=_0x3d0096[0x0];if(!_0x2a9282[_0x2d93('0x4b')][_0x2d93('0x69')])return;return db[_0x2d93('0x78')][_0x2d93('0x4a')]({'where':{'id':_0x2a9282[_0x2d93('0x4b')][_0x2d93('0x69')],'role':'agent'},'attributes':['id',_0x2d93('0x2c'),_0x2d93('0x7a'),'email','internal'],'raw':!![]});}return null;})[_0x2d93('0x15')](function(_0x4d2929){if(!_0x4d2929)return null;_0x2ce81c['message'][_0x2d93('0x79')]=_0x4d2929;return _0x2ce81c;})[_0x2d93('0x15')](function(_0x487942){if(_0x487942){_0x487942[_0x2d93('0x1c')][_0x2d93('0x7d')]=util[_0x2d93('0x68')](_0x2d93('0x7e'),_0x2a9282['user'][_0x2d93('0x2c')]);_0x487942[_0x2d93('0x1c')]['channel']=_0x2ce81c[_0x2d93('0x7f')];_0x487942[_0x2d93('0x1c')][_0x2d93('0x80')]=_0x2ce81c['channel'];_0x487942[_0x2d93('0x1c')][_0x2d93('0x81')]='reject';_0x487942[_0x2d93('0x1c')][_0x2d93('0x4b')]=htmlToText[_0x2d93('0x82')](_0x2ce81c[_0x2d93('0x1c')][_0x2d93('0x4b')]);respondWithRpcPromise(_0x2d93('0x83'),_0x2d93('0x83'),{'event':_0x2d93('0x8a'),'message':_0x487942[_0x2d93('0x1c')]},client9002);return _0x2ce81c;}return null;})[_0x2d93('0x15')](respondWithResult(_0x3cb5d9,null))[_0x2d93('0x1e')](handleError(_0x3cb5d9,null));};exports[_0x2d93('0x8b')]=function(_0x588e9b,_0x1b4f5d){var _0x546751=moment()['unix']()[_0x2d93('0x8c')]();var _0x3ea450=path[_0x2d93('0x8d')](config['root'],'server',_0x2d93('0x8e'),'tmp');var _0x4d2d54=path['join'](config[_0x2d93('0x8f')],_0x2d93('0x90'),_0x2d93('0x8e'),'attachments');var _0x8b95e9=util[_0x2d93('0x68')](_0x2d93('0x91'),_0x546751);return db[_0x2d93('0x42')]['find']({'where':{'id':_0x588e9b['params']['id']},'attributes':['id',_0x2d93('0x4b'),_0x2d93('0x92'),'to','cc',_0x2d93('0x93'),_0x2d93('0x94'),_0x2d93('0x95')],'include':_0x588e9b[_0x2d93('0x33')][_0x2d93('0x5d')]?[{'model':db[_0x2d93('0x96')],'as':_0x2d93('0x97')}]:undefined})[_0x2d93('0x15')](handleEntityNotFound(_0x1b4f5d,null))[_0x2d93('0x15')](function(_0x3cebfb){if(_0x3cebfb){var _0x39ec0d=_0x3cebfb;var _0x1b8908={'from':_0x39ec0d['from'],'to':_0x39ec0d['to'],'subject':_0x39ec0d[_0x2d93('0x94')],'html':htmlEntities[_0x2d93('0x98')](_0x39ec0d['body']),'headers':{'Date':moment(_0x39ec0d[_0x2d93('0x95')])[_0x2d93('0x68')](_0x2d93('0x99'))},'attachments':[]};if(_0x3cebfb['cc']){_0x1b8908['headers']['Cc']=_0x3cebfb['cc'];}if(_0x3cebfb[_0x2d93('0x93')]){_0x1b8908[_0x2d93('0x9a')][_0x2d93('0x9b')]=_0x3cebfb[_0x2d93('0x93')];}return new BPromise(function(_0x48ee26,_0x32efb4){if(_0x3cebfb[_0x2d93('0x97')]){for(var _0xf80c9=0x0;_0xf80c9<_0x3cebfb['Attachments'][_0x2d93('0x38')];_0xf80c9++){var _0x199a65=_0x3cebfb[_0x2d93('0x97')][_0xf80c9];var _0x22609=path[_0x2d93('0x8d')](_0x4d2d54,_0x199a65[_0x2d93('0x5f')]);if(fs[_0x2d93('0x9c')](_0x22609)){_0x1b8908[_0x2d93('0x5d')][_0x2d93('0x9d')]({'name':_0x199a65[_0x2d93('0x2c')],'contentType':_0x199a65['type'],'data':fs[_0x2d93('0x9e')](_0x22609)});}}}emlformat[_0x2d93('0x9f')](_0x1b8908,function(_0x196678,_0xd66047){if(_0x196678)return _0x32efb4(_0x196678);fs[_0x2d93('0xa0')](path[_0x2d93('0x8d')](_0x3ea450,_0x8b95e9),_0xd66047);return _0x48ee26(_0xd66047);});});}})[_0x2d93('0x15')](function(_0x4390cb){if(_0x4390cb){return _0x1b4f5d['download'](path[_0x2d93('0x8d')](_0x3ea450,_0x8b95e9),_0x8b95e9,function(_0x36b4e5){if(!_0x36b4e5)fs['unlinkSync'](path[_0x2d93('0x8d')](_0x3ea450,_0x8b95e9));});}})[_0x2d93('0x1e')](handleError(_0x1b4f5d,null));}; \ No newline at end of file +var _0xf5d6=['merge','options','MailMessage','includeAll','include','findAll','show','keys','length','find','body','params','describe','create','direction','out','MailAccount','findOne','List','CmContact','Contacts','DESC','Smtp','CloudProvider','attachments','join','root','server/files/attachments','defaults','ListId','sendMail','messageId','format','stringify','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','reject','rejectmessage','download','toString','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','unlinkSync','eml-format','bluebird','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','offset','undefined','count','limit','Content-Range','json','update','destroy','status','end','sendStatus','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf5d6,0xf8));var _0x6f5d=function(_0xc9f9a1,_0x35d583){_0xc9f9a1=_0xc9f9a1-0x0;var _0x21e19c=_0xf5d6[_0xc9f9a1];return _0x21e19c;};'use strict';var emlformat=require(_0x6f5d('0x0'));var moment=require('moment');var BPromise=require(_0x6f5d('0x1'));var util=require('util');var path=require(_0x6f5d('0x2'));var fs=require('fs');var _=require(_0x6f5d('0x3'));var Redis=require(_0x6f5d('0x4'));var htmlToText=require(_0x6f5d('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x6f5d('0x6'))(_0x6f5d('0x7'));var interaction_log=require(_0x6f5d('0x6'))(_0x6f5d('0x8'));var config=require(_0x6f5d('0x9'));var db=require('../../mysqldb')['db'];config[_0x6f5d('0xa')]=_['defaults'](config[_0x6f5d('0xa')],{'host':_0x6f5d('0xb'),'port':0x18eb});var socket=require(_0x6f5d('0xc'))(new Redis(config[_0x6f5d('0xa')]));var htmlEntities=require(_0x6f5d('0xd'));require(_0x6f5d('0xe'))['register'](socket);var jayson=require(_0x6f5d('0xf'));var client=jayson[_0x6f5d('0x10')][_0x6f5d('0x11')]({'port':0x232c});var client9003=jayson[_0x6f5d('0x10')][_0x6f5d('0x11')]({'port':0x232b});var client9002=jayson[_0x6f5d('0x10')][_0x6f5d('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x3310c6,_0x4dc3e0,_0x5c49d6,_0x3f7305){return new BPromise(function(_0x439fdc,_0xc9c3b){var _0x52420d=_0x3f7305||client;return _0x52420d[_0x6f5d('0x12')](_0x3310c6,_0x5c49d6)[_0x6f5d('0x13')](function(_0x1ad3da){logger[_0x6f5d('0x14')](_0x6f5d('0x15'),_0x4dc3e0,_0x6f5d('0x16'));logger[_0x6f5d('0x17')](_0x6f5d('0x18'),_0x4dc3e0,'request\x20sent',JSON['stringify'](_0x1ad3da));if(_0x1ad3da[_0x6f5d('0x19')]){if(_0x1ad3da[_0x6f5d('0x19')][_0x6f5d('0x1a')]===0x1f4){logger[_0x6f5d('0x19')](_0x6f5d('0x15'),_0x4dc3e0,_0x1ad3da[_0x6f5d('0x19')][_0x6f5d('0x1b')]);return _0xc9c3b(_0x1ad3da[_0x6f5d('0x19')][_0x6f5d('0x1b')]);}logger['error'](_0x6f5d('0x15'),_0x4dc3e0,_0x1ad3da['error'][_0x6f5d('0x1b')]);return _0x439fdc(_0x1ad3da[_0x6f5d('0x19')][_0x6f5d('0x1b')]);}else{logger['info'](_0x6f5d('0x15'),_0x4dc3e0,'request\x20sent');_0x439fdc(_0x1ad3da[_0x6f5d('0x1c')][_0x6f5d('0x1b')]);}})[_0x6f5d('0x1d')](function(_0x168753){logger[_0x6f5d('0x19')](_0x6f5d('0x15'),_0x4dc3e0,_0x168753);_0xc9c3b(_0x168753);});});}function respondWithResult(_0x120dd2,_0x181fe6){_0x181fe6=_0x181fe6||0xc8;return function(_0xaf75e0){if(_0xaf75e0){return _0x120dd2['status'](_0x181fe6)['json'](_0xaf75e0);}};}function respondWithFilteredResult(_0x5df6f8,_0x3ec077){return function(_0x2246dc){if(_0x2246dc){var _0x11a7c0=typeof _0x3ec077[_0x6f5d('0x1e')]===_0x6f5d('0x1f')&&typeof _0x3ec077['limit']===_0x6f5d('0x1f');var _0x357be6=_0x2246dc[_0x6f5d('0x20')];var _0xd35b86=_0x11a7c0?0x0:_0x3ec077[_0x6f5d('0x1e')];var _0x273d5d=_0x11a7c0?_0x2246dc['count']:_0x3ec077[_0x6f5d('0x1e')]+_0x3ec077[_0x6f5d('0x21')];var _0xe59a32;if(_0x273d5d>=_0x357be6){_0x273d5d=_0x357be6;_0xe59a32=0xc8;}else{_0xe59a32=0xce;}_0x5df6f8['status'](_0xe59a32);return _0x5df6f8['set'](_0x6f5d('0x22'),_0xd35b86+'-'+_0x273d5d+'/'+_0x357be6)[_0x6f5d('0x23')](_0x2246dc);}return null;};}function saveUpdates(_0x4fb508){return function(_0x528ecb){if(_0x528ecb){return _0x528ecb[_0x6f5d('0x24')](_0x4fb508)[_0x6f5d('0x13')](function(_0xfec1b8){return _0xfec1b8;});}return null;};}function removeEntity(_0xda63dc){return function(_0x49515c){if(_0x49515c){return _0x49515c[_0x6f5d('0x25')]()[_0x6f5d('0x13')](function(){_0xda63dc[_0x6f5d('0x26')](0xcc)[_0x6f5d('0x27')]();});}};}function handleEntityNotFound(_0x265c68){return function(_0x14a284){if(!_0x14a284){_0x265c68[_0x6f5d('0x28')](0x194);}return _0x14a284;};}function handleError(_0x469089,_0x34bbe7){_0x34bbe7=_0x34bbe7||0x1f4;return function(_0x26c234){logger['error'](_0x26c234['stack']);if(_0x26c234[_0x6f5d('0x29')]){delete _0x26c234['name'];}_0x469089[_0x6f5d('0x26')](_0x34bbe7)[_0x6f5d('0x2a')](_0x26c234);};}exports[_0x6f5d('0x2b')]=function(_0x10cb2f,_0xfffba1){var _0x57b406={},_0x576bf9={},_0x38e570={'count':0x0,'rows':[]};var _0x44e4c9=_[_0x6f5d('0x2c')](db['MailMessage'][_0x6f5d('0x2d')],function(_0x4b27a2){return{'name':_0x4b27a2[_0x6f5d('0x2e')],'type':_0x4b27a2['type'][_0x6f5d('0x2f')]};});_0x576bf9[_0x6f5d('0x30')]=_[_0x6f5d('0x2c')](_0x44e4c9,_0x6f5d('0x29'));_0x576bf9[_0x6f5d('0x31')]=_['keys'](_0x10cb2f['query']);_0x576bf9[_0x6f5d('0x32')]=_[_0x6f5d('0x33')](_0x576bf9[_0x6f5d('0x30')],_0x576bf9['query']);_0x57b406[_0x6f5d('0x34')]=_[_0x6f5d('0x33')](_0x576bf9['model'],qs[_0x6f5d('0x35')](_0x10cb2f[_0x6f5d('0x31')][_0x6f5d('0x35')]));_0x57b406[_0x6f5d('0x34')]=_0x57b406[_0x6f5d('0x34')]['length']?_0x57b406[_0x6f5d('0x34')]:_0x576bf9[_0x6f5d('0x30')];if(!_0x10cb2f[_0x6f5d('0x31')][_0x6f5d('0x36')](_0x6f5d('0x37'))){_0x57b406[_0x6f5d('0x21')]=qs['limit'](_0x10cb2f['query'][_0x6f5d('0x21')]);_0x57b406[_0x6f5d('0x1e')]=qs[_0x6f5d('0x1e')](_0x10cb2f[_0x6f5d('0x31')][_0x6f5d('0x1e')]);}_0x57b406[_0x6f5d('0x38')]=qs[_0x6f5d('0x39')](_0x10cb2f['query'][_0x6f5d('0x39')]);_0x57b406[_0x6f5d('0x3a')]=qs['filters'](_[_0x6f5d('0x3b')](_0x10cb2f[_0x6f5d('0x31')],_0x576bf9[_0x6f5d('0x32')]),_0x44e4c9);if(_0x10cb2f['query'][_0x6f5d('0x3c')]){_0x57b406[_0x6f5d('0x3a')]=_['merge'](_0x57b406[_0x6f5d('0x3a')],{'$or':_[_0x6f5d('0x2c')](_0x44e4c9,function(_0x244922){if(_0x244922[_0x6f5d('0x3d')]!=='VIRTUAL'){var _0x3ddab9={};_0x3ddab9[_0x244922[_0x6f5d('0x29')]]={'$like':'%'+_0x10cb2f[_0x6f5d('0x31')][_0x6f5d('0x3c')]+'%'};return _0x3ddab9;}})});}_0x57b406=_[_0x6f5d('0x3e')]({},_0x57b406,_0x10cb2f[_0x6f5d('0x3f')]);var _0x54c93b={'where':_0x57b406[_0x6f5d('0x3a')]};return db[_0x6f5d('0x40')][_0x6f5d('0x20')](_0x54c93b)[_0x6f5d('0x13')](function(_0x27d715){_0x38e570['count']=_0x27d715;if(_0x10cb2f[_0x6f5d('0x31')][_0x6f5d('0x41')]){_0x57b406[_0x6f5d('0x42')]=[{'all':!![]}];}return db[_0x6f5d('0x40')][_0x6f5d('0x43')](_0x57b406);})[_0x6f5d('0x13')](function(_0x314f4d){_0x38e570['rows']=_0x314f4d;return _0x38e570;})[_0x6f5d('0x13')](respondWithFilteredResult(_0xfffba1,_0x57b406))[_0x6f5d('0x1d')](handleError(_0xfffba1,null));};exports[_0x6f5d('0x44')]=function(_0x3a40f3,_0x2f4e33){var _0x3cce04={'raw':!![],'where':{'id':_0x3a40f3['params']['id']}},_0x1fb992={};_0x1fb992[_0x6f5d('0x30')]=_[_0x6f5d('0x45')](db[_0x6f5d('0x40')][_0x6f5d('0x2d')]);_0x1fb992['query']=_[_0x6f5d('0x45')](_0x3a40f3[_0x6f5d('0x31')]);_0x1fb992[_0x6f5d('0x32')]=_[_0x6f5d('0x33')](_0x1fb992[_0x6f5d('0x30')],_0x1fb992[_0x6f5d('0x31')]);_0x3cce04[_0x6f5d('0x34')]=_[_0x6f5d('0x33')](_0x1fb992[_0x6f5d('0x30')],qs[_0x6f5d('0x35')](_0x3a40f3[_0x6f5d('0x31')]['fields']));_0x3cce04['attributes']=_0x3cce04[_0x6f5d('0x34')][_0x6f5d('0x46')]?_0x3cce04['attributes']:_0x1fb992['model'];if(_0x3a40f3['query']['includeAll']){_0x3cce04['include']=[{'all':!![]}];}_0x3cce04=_[_0x6f5d('0x3e')]({},_0x3cce04,_0x3a40f3['options']);return db[_0x6f5d('0x40')][_0x6f5d('0x47')](_0x3cce04)[_0x6f5d('0x13')](handleEntityNotFound(_0x2f4e33,null))[_0x6f5d('0x13')](respondWithResult(_0x2f4e33,null))[_0x6f5d('0x1d')](handleError(_0x2f4e33,null));};exports[_0x6f5d('0x24')]=function(_0x4158c3,_0x3ca534){if(_0x4158c3['body']['id']){delete _0x4158c3[_0x6f5d('0x48')]['id'];}return db[_0x6f5d('0x40')][_0x6f5d('0x47')]({'where':{'id':_0x4158c3['params']['id']}})[_0x6f5d('0x13')](handleEntityNotFound(_0x3ca534,null))[_0x6f5d('0x13')](saveUpdates(_0x4158c3['body'],null))[_0x6f5d('0x13')](respondWithResult(_0x3ca534,null))[_0x6f5d('0x1d')](handleError(_0x3ca534,null));};exports[_0x6f5d('0x25')]=function(_0x2a56af,_0x43172c){return db[_0x6f5d('0x40')][_0x6f5d('0x47')]({'where':{'id':_0x2a56af[_0x6f5d('0x49')]['id']}})[_0x6f5d('0x13')](handleEntityNotFound(_0x43172c,null))[_0x6f5d('0x13')](removeEntity(_0x43172c,null))[_0x6f5d('0x1d')](handleError(_0x43172c,null));};exports['describe']=function(_0x1259ef,_0x31c163){return db[_0x6f5d('0x40')][_0x6f5d('0x4a')]()[_0x6f5d('0x13')](respondWithResult(_0x31c163,null))['catch'](handleError(_0x31c163,null));};exports[_0x6f5d('0x4b')]=function(_0x2f8882,_0x9cf859){return db[_0x6f5d('0x40')]['create'](_0x2f8882[_0x6f5d('0x48')])[_0x6f5d('0x13')](function(_0x43f899){if(_0x43f899){if(_0x43f899[_0x6f5d('0x4c')]===_0x6f5d('0x4d')&&!_0x43f899['secret']){var _0x4d9520,_0x5419ea,_0x5db74e;if(_0x2f8882['body']['to']){_0x5419ea=_0x2f8882['body']['to']['split'](',')[0x0];}return db[_0x6f5d('0x4e')][_0x6f5d('0x4f')]({'where':{'id':_0x43f899['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x6f5d('0x50'),'include':[{'model':db[_0x6f5d('0x51')],'as':_0x6f5d('0x52'),'where':{'email':_0x5419ea},'limit':0x1,'order':[['updatedAt',_0x6f5d('0x53')]]}]},{'model':db['MailServerOut'],'as':_0x6f5d('0x54'),'raw':!![],'include':[{'model':db[_0x6f5d('0x55')],'as':'CloudProvider','raw':!![]}]}]})[_0x6f5d('0x13')](function(_0x1fd23c){_0x4d9520=_0x1fd23c;if(!_0x4d9520||!_0x4d9520[_0x6f5d('0x54')])return;var _0x38f5be=_0x4d9520['getSmtpOptions']();if(_0x2f8882['body'][_0x6f5d('0x56')]&&_0x2f8882[_0x6f5d('0x48')]['attachments']['length']){for(var _0x1257f4=0x0;_0x1257f4<_0x2f8882[_0x6f5d('0x48')]['attachments'][_0x6f5d('0x46')];_0x1257f4+=0x1){_0x2f8882[_0x6f5d('0x48')]['attachments'][_0x1257f4]={'filename':_0x2f8882['body'][_0x6f5d('0x56')][_0x1257f4][_0x6f5d('0x29')],'path':path[_0x6f5d('0x57')](config[_0x6f5d('0x58')],_0x6f5d('0x59'),_0x2f8882[_0x6f5d('0x48')][_0x6f5d('0x56')][_0x1257f4]['basename'])};}}_0x5db74e={'account':_0x38f5be,'message':_0x2f8882['body']};return;})[_0x6f5d('0x13')](function(){if(_0x4d9520['List']){if(_0x4d9520['List']['Contacts'][_0x6f5d('0x46')]){return _0x4d9520[_0x6f5d('0x50')][_0x6f5d('0x52')][0x0];}else{return db[_0x6f5d('0x51')][_0x6f5d('0x4b')](_[_0x6f5d('0x5a')](_0x2f8882[_0x6f5d('0x48')],{'firstName':_0x2f8882[_0x6f5d('0x48')]['to'],'email':_0x2f8882[_0x6f5d('0x48')]['to'],'phone':_0x2f8882[_0x6f5d('0x48')]['to'],'ListId':_0x4d9520[_0x6f5d('0x5b')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x5db74e){return respondWithRpcPromise('SendMail',_0x6f5d('0x5c'),_0x5db74e,client9003)[_0x6f5d('0x13')](function(_0x133885){return _0x43f899[_0x6f5d('0x24')]({'read':!![],'messageId':_0x133885[_0x6f5d('0x5d')],'sentAt':moment()[_0x6f5d('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6f5d('0x1d')](function(_0x5f43a2){logger[_0x6f5d('0x19')]('%s',JSON[_0x6f5d('0x5f')](_0x5f43a2));return _0x43f899;});}return _0x43f899;});}return _0x43f899;}})['then'](respondWithResult(_0x9cf859,0xc9))[_0x6f5d('0x1d')](handleError(_0x9cf859,null));};exports[_0x6f5d('0x60')]=function(_0x11fb91,_0xff7c89){var _0x124cb8={'agent':{},'channel':'mail'};if(_0x11fb91[_0x6f5d('0x48')]['id']){delete _0x11fb91[_0x6f5d('0x48')]['id'];}_0x11fb91[_0x6f5d('0x48')][_0x6f5d('0x61')]=!![];_0x11fb91[_0x6f5d('0x48')][_0x6f5d('0x62')]=moment()[_0x6f5d('0x5e')](_0x6f5d('0x63'));_0x11fb91[_0x6f5d('0x48')][_0x6f5d('0x64')]=_0x11fb91[_0x6f5d('0x48')][_0x6f5d('0x64')]||_0x11fb91[_0x6f5d('0x65')]['id'];_0x124cb8['agent']['id']=_0x11fb91[_0x6f5d('0x48')][_0x6f5d('0x64')];return db[_0x6f5d('0x40')][_0x6f5d('0x47')]({'where':{'id':_0x11fb91[_0x6f5d('0x49')]['id'],'UserId':null}})[_0x6f5d('0x13')](handleEntityNotFound(_0xff7c89,null))['then'](saveUpdates(_0x11fb91[_0x6f5d('0x48')],null))[_0x6f5d('0x13')](function(_0x1c2f98){if(_0x1c2f98){_0x124cb8['message']=_0x1c2f98[_0x6f5d('0x66')]({'plain':!![]});return db['MailInteraction'][_0x6f5d('0x47')]({'where':{'id':_0x1c2f98['MailInteractionId']}});}return null;})[_0x6f5d('0x13')](handleEntityNotFound(_0xff7c89,null))[_0x6f5d('0x13')](function(_0x4b11fd){if(_0x4b11fd){return _0x4b11fd[_0x6f5d('0x24')]({'UserId':_0x11fb91['body'][_0x6f5d('0x64')],'read1stAt':_[_0x6f5d('0x67')](_0x4b11fd[_0x6f5d('0x68')])?moment()['format'](_0x6f5d('0x63')):undefined});}return null;})[_0x6f5d('0x13')](function(_0x34b2d0){if(_0x34b2d0){_0x124cb8['interaction']=_0x34b2d0[_0x6f5d('0x66')]({'plain':!![]});interaction_log[_0x6f5d('0x14')](_0x6f5d('0x69'),_0x11fb91[_0x6f5d('0x65')]['id'],_0x11fb91[_0x6f5d('0x65')][_0x6f5d('0x29')],_0x11fb91[_0x6f5d('0x65')][_0x6f5d('0x6a')],_0x124cb8[_0x6f5d('0x6b')]['id'],_0x11fb91[_0x6f5d('0x48')]?JSON[_0x6f5d('0x5f')](_0x11fb91[_0x6f5d('0x48')]):_0x6f5d('0x6c'));return respondWithRpcPromise(_0x6f5d('0x6d'),_0x6f5d('0x6e'),_0x124cb8);}return null;})['then'](function(_0x15b9db){var _0x38d325='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15b9db[_0x6f5d('0x1b')]['ContactId'];return db[_0x6f5d('0x6f')][_0x6f5d('0x31')](_0x38d325,{'type':db[_0x6f5d('0x70')][_0x6f5d('0x71')][_0x6f5d('0x72')],'raw':!![]})[_0x6f5d('0x13')](function(_0x195ce6){return _0x195ce6;});})[_0x6f5d('0x13')](function(_0x1f1d83){if(_0x1f1d83){_0x124cb8[_0x6f5d('0x1b')][_0x6f5d('0x73')]=_0x1f1d83[0x0];if(!_0x11fb91['body'][_0x6f5d('0x64')])return;return db[_0x6f5d('0x74')][_0x6f5d('0x47')]({'where':{'id':_0x11fb91[_0x6f5d('0x48')][_0x6f5d('0x64')],'role':_0x6f5d('0x75')},'attributes':['id',_0x6f5d('0x29'),_0x6f5d('0x76'),_0x6f5d('0x77'),_0x6f5d('0x78')],'raw':!![]});}return null;})[_0x6f5d('0x13')](function(_0x4beeef){if(!_0x4beeef)return null;_0x124cb8['message'][_0x6f5d('0x75')]=_0x4beeef;return _0x124cb8;})['then'](function(_0x17f8e0){if(_0x17f8e0){if(_0x11fb91['body']['manual']){_0x124cb8[_0x6f5d('0x1b')][_0x6f5d('0x79')]=util['format'](_0x6f5d('0x7a'),_0x11fb91['user']['name']);_0x124cb8[_0x6f5d('0x1b')][_0x6f5d('0x7b')]=_0x124cb8['channel'];_0x124cb8['message'][_0x6f5d('0x7c')]=_0x124cb8['channel'];_0x124cb8[_0x6f5d('0x1b')][_0x6f5d('0x7d')]=_0x6f5d('0x60');_0x124cb8[_0x6f5d('0x1b')][_0x6f5d('0x48')]=htmlToText[_0x6f5d('0x7e')](_0x124cb8['message']['body']);return respondWithRpcPromise('EventManager',_0x6f5d('0x7f'),{'event':_0x6f5d('0x80'),'message':_0x124cb8['message']},client9002)['then'](function(){return _0x124cb8;});}return _0x124cb8;}return null;})[_0x6f5d('0x13')](respondWithResult(_0xff7c89,null))[_0x6f5d('0x1d')](handleError(_0xff7c89,null));};exports['reject']=function(_0x39cfbb,_0x322e6e){var _0x51887e={'agent':{},'channel':_0x6f5d('0x81')};if(_0x39cfbb[_0x6f5d('0x48')]['id']){delete _0x39cfbb['body']['id'];}_0x39cfbb[_0x6f5d('0x48')]['UserId']=_0x39cfbb[_0x6f5d('0x48')][_0x6f5d('0x64')]||_0x39cfbb['user']['id'];_0x51887e[_0x6f5d('0x75')]['id']=_0x39cfbb[_0x6f5d('0x48')][_0x6f5d('0x64')];return db['MailMessage'][_0x6f5d('0x47')]({'where':{'id':_0x39cfbb[_0x6f5d('0x49')]['id'],'UserId':null}})[_0x6f5d('0x13')](handleEntityNotFound(_0x322e6e,null))['then'](function(_0x53e871){if(_0x53e871){_0x51887e[_0x6f5d('0x1b')]=_0x53e871[_0x6f5d('0x66')]({'plain':!![]});return db[_0x6f5d('0x82')]['find']({'where':{'id':_0x53e871['MailInteractionId']}});}return null;})[_0x6f5d('0x13')](handleEntityNotFound(_0x322e6e,null))[_0x6f5d('0x13')](function(_0x293424){if(_0x293424){_0x51887e['interaction']=_0x293424[_0x6f5d('0x66')]({'plain':!![]});interaction_log[_0x6f5d('0x14')](_0x6f5d('0x83'),_0x39cfbb['user']['id'],_0x39cfbb[_0x6f5d('0x65')][_0x6f5d('0x29')],_0x39cfbb[_0x6f5d('0x65')]['role'],_0x51887e[_0x6f5d('0x6b')]['id'],_0x39cfbb[_0x6f5d('0x48')]?JSON[_0x6f5d('0x5f')](_0x39cfbb['body']):_0x6f5d('0x6c'));return respondWithRpcPromise('RejectMessage',_0x6f5d('0x84'),_0x51887e);}return null;})[_0x6f5d('0x13')](function(_0x1e9daa){var _0x2faa00=_0x6f5d('0x85')+_0x1e9daa[_0x6f5d('0x1b')]['ContactId'];return db['sequelize']['query'](_0x2faa00,{'type':db[_0x6f5d('0x70')]['QueryTypes'][_0x6f5d('0x72')],'raw':!![]})['then'](function(_0x5b70b3){return _0x5b70b3;});})[_0x6f5d('0x13')](function(_0x4237f9){if(_0x4237f9){_0x51887e['message']['contact']=_0x4237f9[0x0];if(!_0x39cfbb[_0x6f5d('0x48')][_0x6f5d('0x64')])return;return db[_0x6f5d('0x74')][_0x6f5d('0x47')]({'where':{'id':_0x39cfbb[_0x6f5d('0x48')][_0x6f5d('0x64')],'role':'agent'},'attributes':['id',_0x6f5d('0x29'),_0x6f5d('0x76'),_0x6f5d('0x77'),_0x6f5d('0x78')],'raw':!![]});}return null;})[_0x6f5d('0x13')](function(_0x314b38){if(!_0x314b38)return null;_0x51887e[_0x6f5d('0x1b')][_0x6f5d('0x75')]=_0x314b38;return _0x51887e;})[_0x6f5d('0x13')](function(_0x765cfe){if(_0x765cfe){_0x765cfe['message'][_0x6f5d('0x79')]=util['format']('SIP/%s',_0x39cfbb[_0x6f5d('0x65')][_0x6f5d('0x29')]);_0x765cfe[_0x6f5d('0x1b')][_0x6f5d('0x7b')]=_0x51887e[_0x6f5d('0x7b')];_0x765cfe['message'][_0x6f5d('0x7c')]=_0x51887e[_0x6f5d('0x7b')];_0x765cfe['message']['event']=_0x6f5d('0x86');_0x765cfe[_0x6f5d('0x1b')][_0x6f5d('0x48')]=htmlToText['fromString'](_0x51887e[_0x6f5d('0x1b')][_0x6f5d('0x48')]);respondWithRpcPromise('EventManager',_0x6f5d('0x7f'),{'event':_0x6f5d('0x87'),'message':_0x765cfe[_0x6f5d('0x1b')]},client9002);return _0x51887e;}return null;})['then'](respondWithResult(_0x322e6e,null))[_0x6f5d('0x1d')](handleError(_0x322e6e,null));};exports[_0x6f5d('0x88')]=function(_0xd42761,_0x166662){var _0x242824=moment()['unix']()[_0x6f5d('0x89')]();var _0x378b06=path[_0x6f5d('0x57')](config[_0x6f5d('0x58')],_0x6f5d('0x8a'),_0x6f5d('0x8b'),_0x6f5d('0x8c'));var _0x4754d9=path[_0x6f5d('0x57')](config[_0x6f5d('0x58')],_0x6f5d('0x8a'),_0x6f5d('0x8b'),_0x6f5d('0x56'));var _0x3a2840=util[_0x6f5d('0x5e')](_0x6f5d('0x8d'),_0x242824);return db[_0x6f5d('0x40')][_0x6f5d('0x47')]({'where':{'id':_0xd42761['params']['id']},'attributes':['id',_0x6f5d('0x48'),_0x6f5d('0x8e'),'to','cc',_0x6f5d('0x8f'),'subject',_0x6f5d('0x90')],'include':_0xd42761[_0x6f5d('0x31')][_0x6f5d('0x56')]?[{'model':db['Attachment'],'as':_0x6f5d('0x91')}]:undefined})[_0x6f5d('0x13')](handleEntityNotFound(_0x166662,null))[_0x6f5d('0x13')](function(_0x4ea929){if(_0x4ea929){var _0x2f6ccd=_0x4ea929;var _0x4a9ff8={'from':_0x2f6ccd[_0x6f5d('0x8e')],'to':_0x2f6ccd['to'],'subject':_0x2f6ccd['subject'],'html':htmlEntities['decode'](_0x2f6ccd[_0x6f5d('0x48')]),'headers':{'Date':moment(_0x2f6ccd[_0x6f5d('0x90')])[_0x6f5d('0x5e')](_0x6f5d('0x92'))},'attachments':[]};if(_0x4ea929['cc']){_0x4a9ff8['headers']['Cc']=_0x4ea929['cc'];}if(_0x4ea929[_0x6f5d('0x8f')]){_0x4a9ff8[_0x6f5d('0x93')][_0x6f5d('0x94')]=_0x4ea929[_0x6f5d('0x8f')];}return new BPromise(function(_0xe11058,_0x4ce14a){if(_0x4ea929[_0x6f5d('0x91')]){for(var _0xcdd20b=0x0;_0xcdd20b<_0x4ea929[_0x6f5d('0x91')][_0x6f5d('0x46')];_0xcdd20b++){var _0x18afbf=_0x4ea929[_0x6f5d('0x91')][_0xcdd20b];var _0x5ea8f8=path['join'](_0x4754d9,_0x18afbf[_0x6f5d('0x95')]);if(fs[_0x6f5d('0x96')](_0x5ea8f8)){_0x4a9ff8[_0x6f5d('0x56')][_0x6f5d('0x97')]({'name':_0x18afbf[_0x6f5d('0x29')],'contentType':_0x18afbf[_0x6f5d('0x3d')],'data':fs[_0x6f5d('0x98')](_0x5ea8f8)});}}}emlformat[_0x6f5d('0x99')](_0x4a9ff8,function(_0x1448ed,_0x2ef615){if(_0x1448ed)return _0x4ce14a(_0x1448ed);fs['writeFileSync'](path[_0x6f5d('0x57')](_0x378b06,_0x3a2840),_0x2ef615);return _0xe11058(_0x2ef615);});});}})[_0x6f5d('0x13')](function(_0x18a454){if(_0x18a454){return _0x166662['download'](path[_0x6f5d('0x57')](_0x378b06,_0x3a2840),_0x3a2840,function(_0x14e765){if(!_0x14e765)fs[_0x6f5d('0x9a')](path[_0x6f5d('0x57')](_0x378b06,_0x3a2840));});}})[_0x6f5d('0x1d')](handleError(_0x166662,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 22a5790..a479dc8 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 _0xf9d1=['MailMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x40d790,_0x97fcbf){var _0x5bdeec=function(_0x35d6d3){while(--_0x35d6d3){_0x40d790['push'](_0x40d790['shift']());}};_0x5bdeec(++_0x97fcbf);}(_0xf9d1,0xf4));var _0x1f9d=function(_0x543cc,_0x2d3555){_0x543cc=_0x543cc-0x0;var _0x173c0a=_0xf9d1[_0x543cc];return _0x173c0a;};'use strict';var EventEmitter=require(_0x1f9d('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x1f9d('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1f9d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1f9d('0x3')};function emitEvent(_0x5c5c8b){return function(_0x2b8564,_0xbb9e79,_0x29dce9){MailMessageEvents[_0x1f9d('0x4')](_0x5c5c8b+':'+_0x2b8564['id'],_0x2b8564);MailMessageEvents['emit'](_0x5c5c8b,_0x2b8564);_0x29dce9(null);};}for(var e in events){if(events[_0x1f9d('0x5')](e)){var event=events[e];MailMessage[_0x1f9d('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xf99e=['hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4587bb,_0x128e7b){var _0x1a4c98=function(_0x2886a6){while(--_0x2886a6){_0x4587bb['push'](_0x4587bb['shift']());}};_0x1a4c98(++_0x128e7b);}(_0xf99e,0x67));var _0xef99=function(_0x4e9e24,_0x34b638){_0x4e9e24=_0x4e9e24-0x0;var _0x3ef905=_0xf99e[_0x4e9e24];return _0x3ef905;};'use strict';var EventEmitter=require(_0xef99('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xef99('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xef99('0x2')](0x0);var events={'afterCreate':_0xef99('0x3'),'afterUpdate':_0xef99('0x4'),'afterDestroy':_0xef99('0x5')};function emitEvent(_0x39950f){return function(_0x3090c7,_0x52c387,_0x36e3aa){MailMessageEvents['emit'](_0x39950f+':'+_0x3090c7['id'],_0x3090c7);MailMessageEvents[_0xef99('0x6')](_0x39950f,_0x3090c7);_0x36e3aa(null);};}for(var e in events){if(events[_0xef99('0x7')](e)){var event=events[e];MailMessage[_0xef99('0x8')](e,emitEvent(event));}}module[_0xef99('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 05e744c..3b2ce83 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 _0xd02a=['api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','lodash','util','../../config/logger'];(function(_0x6b7f91,_0x4de365){var _0x58acad=function(_0x599247){while(--_0x599247){_0x6b7f91['push'](_0x6b7f91['shift']());}};_0x58acad(++_0x4de365);}(_0xd02a,0x105));var _0xad02=function(_0x25421d,_0x1fa12a){_0x25421d=_0x25421d-0x0;var _0x596135=_0xd02a[_0x25421d];return _0x596135;};'use strict';var _=require(_0xad02('0x0'));var util=require(_0xad02('0x1'));var logger=require(_0xad02('0x2'))(_0xad02('0x3'));var moment=require(_0xad02('0x4'));var BPromise=require(_0xad02('0x5'));var rp=require(_0xad02('0x6'));var htmlToText=require(_0xad02('0x7'));var fs=require('fs');var path=require(_0xad02('0x8'));var rimraf=require(_0xad02('0x9'));var config=require('../../config/environment');var attributes=require(_0xad02('0xa'));module[_0xad02('0xb')]=function(_0x5d3ffd,_0x169ded){return _0x5d3ffd[_0xad02('0xc')]('MailMessage',attributes,{'tableName':_0xad02('0xd'),'paranoid':![],'indexes':[{'name':_0xad02('0xe'),'fields':[_0xad02('0xe')]},{'name':_0xad02('0xf'),'fields':[_0xad02('0x10'),'subject'],'type':_0xad02('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8dfffd,_0xec23b3,_0x4760d6){if(_0x8dfffd[_0xad02('0x12')]){_0x8dfffd[_0xad02('0x10')]=htmlToText['fromString'](_0x8dfffd['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4760d6(null,_0xec23b3);},'afterCreate':function(_0x509ad5,_0x17bc46,_0x11d7b2){var _0x2be4e6=_0x5d3ffd[_0xad02('0x13')];var _0x4d4458=_0x509ad5[_0xad02('0x14')]({'plain':!![]});if(_0x4d4458[_0xad02('0x15')][_0xad02('0x16')]()==='in'||_0x4d4458[_0xad02('0x15')][_0xad02('0x16')]()===_0xad02('0x17')&&!_0x4d4458[_0xad02('0x18')]&&!_[_0xad02('0x19')](_0x4d4458[_0xad02('0x1a')])){_0x2be4e6[_0xad02('0x1b')][_0xad02('0x1c')]({'where':{'id':_0x4d4458[_0xad02('0x1d')]}})[_0xad02('0x1e')](function(_0x3834be){if(_0x3834be){_0x3834be[_0xad02('0x1f')]({'lastMsgAt':_0x4d4458[_0xad02('0x20')],'lastMsgDirection':_0x4d4458[_0xad02('0x15')][_0xad02('0x16')]()});}})['catch'](function(_0x3ad15b){console['error'](_0x3ad15b);});}_0x11d7b2();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf794=['mail_messages','messageId','fti_mail_messages','body','fromString','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','./mailMessage.attributes','exports','define','MailMessage'];(function(_0x1d3b50,_0x54f49b){var _0x1bc623=function(_0x5aa7b9){while(--_0x5aa7b9){_0x1d3b50['push'](_0x1d3b50['shift']());}};_0x1bc623(++_0x54f49b);}(_0xf794,0x10c));var _0x4f79=function(_0x5629df,_0x526a42){_0x5629df=_0x5629df-0x0;var _0x458283=_0xf794[_0x5629df];return _0x458283;};'use strict';var _=require(_0x4f79('0x0'));var util=require(_0x4f79('0x1'));var logger=require('../../config/logger')(_0x4f79('0x2'));var moment=require(_0x4f79('0x3'));var BPromise=require(_0x4f79('0x4'));var rp=require(_0x4f79('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x4f79('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f79('0x7'));module[_0x4f79('0x8')]=function(_0x28d869,_0xce47be){return _0x28d869[_0x4f79('0x9')](_0x4f79('0xa'),attributes,{'tableName':_0x4f79('0xb'),'paranoid':![],'indexes':[{'name':_0x4f79('0xc'),'fields':[_0x4f79('0xc')]},{'name':_0x4f79('0xd'),'fields':['plainBody','subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xd7e066,_0x20abeb,_0x44552e){if(_0xd7e066[_0x4f79('0xe')]){_0xd7e066['plainBody']=htmlToText[_0x4f79('0xf')](_0xd7e066['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x44552e(null,_0x20abeb);},'afterCreate':function(_0x31fb76,_0x590d92,_0x5f04cb){var _0x13e285=_0x28d869['models'];var _0x216d25=_0x31fb76['get']({'plain':!![]});if(_0x216d25[_0x4f79('0x10')][_0x4f79('0x11')]()==='in'||_0x216d25['direction'][_0x4f79('0x11')]()===_0x4f79('0x12')&&!_0x216d25[_0x4f79('0x13')]&&!_[_0x4f79('0x14')](_0x216d25[_0x4f79('0x15')])){_0x13e285[_0x4f79('0x16')][_0x4f79('0x17')]({'where':{'id':_0x216d25[_0x4f79('0x18')]}})[_0x4f79('0x19')](function(_0x10cc99){if(_0x10cc99){_0x10cc99[_0x4f79('0x1a')]({'lastMsgAt':_0x216d25['createdAt'],'lastMsgDirection':_0x216d25[_0x4f79('0x10')][_0x4f79('0x11')]()});}})[_0x4f79('0x1b')](function(_0x1cec46){console[_0x4f79('0x1c')](_0x1cec46);});}_0x5f04cb();}},'charset':_0x4f79('0x1d'),'collate':_0x4f79('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index c4989d7..ec8a6e2 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 _0x3266=['result','catch','CreateMailMessage','MailMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x15a26e,_0x334582){var _0x25bef6=function(_0x2fab4f){while(--_0x2fab4f){_0x15a26e['push'](_0x15a26e['shift']());}};_0x25bef6(++_0x334582);}(_0x3266,0x6a));var _0x6326=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x3266[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});config[_0x6326('0xc')]=_['defaults'](config[_0x6326('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6326('0xd'))(new Redis(config[_0x6326('0xc')]));require(_0x6326('0xe'))[_0x6326('0xf')](socket);function respondWithRpcPromise(_0x37a23d,_0x53c3e1,_0x1b45a7){return new BPromise(function(_0x464a36,_0x3590ab){return client[_0x6326('0x10')](_0x37a23d,_0x1b45a7)[_0x6326('0x11')](function(_0x3b056c){logger[_0x6326('0x12')](_0x6326('0x13'),_0x53c3e1,_0x6326('0x14'));logger[_0x6326('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x53c3e1,'request\x20sent',JSON[_0x6326('0x16')](_0x3b056c));if(_0x3b056c[_0x6326('0x17')]){if(_0x3b056c['error'][_0x6326('0x18')]===0x1f4){logger['error'](_0x6326('0x13'),_0x53c3e1,_0x3b056c[_0x6326('0x17')][_0x6326('0x19')]);return _0x3590ab(_0x3b056c[_0x6326('0x17')][_0x6326('0x19')]);}logger[_0x6326('0x17')]('MailMessage,\x20%s,\x20%s',_0x53c3e1,_0x3b056c[_0x6326('0x17')]['message']);return _0x464a36(_0x3b056c['error']['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x53c3e1,'request\x20sent');_0x464a36(_0x3b056c[_0x6326('0x1a')][_0x6326('0x19')]);}})[_0x6326('0x1b')](function(_0x556c4e){logger['error'](_0x6326('0x13'),_0x53c3e1,_0x556c4e);_0x3590ab(_0x556c4e);});});}exports[_0x6326('0x1c')]=function(_0x272b5c){var _0x3db834=this;return new Promise(function(_0x3c08db,_0x25957a){return db[_0x6326('0x1d')]['create'](_0x272b5c[_0x6326('0x1e')],{'raw':_0x272b5c['options']?_0x272b5c[_0x6326('0x1f')][_0x6326('0x20')]===undefined?!![]:![]:!![]})[_0x6326('0x11')](function(_0x24fb78){logger[_0x6326('0x12')](_0x6326('0x1c'),_0x272b5c);logger[_0x6326('0x15')](_0x6326('0x1c'),_0x272b5c,JSON[_0x6326('0x16')](_0x24fb78));_0x3c08db(_0x24fb78);})[_0x6326('0x1b')](function(_0x34954b){logger['error'](_0x6326('0x1c'),_0x34954b[_0x6326('0x19')],_0x272b5c);_0x25957a(_0x3db834['error'](0x1f4,_0x34954b['message']));});});}; \ No newline at end of file +var _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body'];(function(_0x29033c,_0x243746){var _0x2f871e=function(_0x295ff5){while(--_0x295ff5){_0x29033c['push'](_0x29033c['shift']());}};_0x2f871e(++_0x243746);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a397d,_0x5bab1f){_0x4a397d=_0x4a397d-0x0;var _0x316571=_0xb10b[_0x4a397d];return _0x316571;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8e1d662..0c3f6d7 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 _0xeba1=['mailMessage:','./mailMessage.events','save','emit','removeListener'];(function(_0x2a8b1d,_0x1057e8){var _0x3d9ee9=function(_0x386cd2){while(--_0x386cd2){_0x2a8b1d['push'](_0x2a8b1d['shift']());}};_0x3d9ee9(++_0x1057e8);}(_0xeba1,0x182));var _0x1eba=function(_0x647e25,_0x42f0c8){_0x647e25=_0x647e25-0x0;var _0x1f674e=_0xeba1[_0x647e25];return _0x1f674e;};'use strict';var MailMessageEvents=require(_0x1eba('0x0'));var events=[_0x1eba('0x1'),'remove','update'];function createListener(_0x43b9c9,_0x4b6e6b){return function(_0x1525d2){_0x4b6e6b[_0x1eba('0x2')](_0x43b9c9,_0x1525d2);};}function removeListener(_0x20690e,_0x23cab6){return function(){MailMessageEvents[_0x1eba('0x3')](_0x20690e,_0x23cab6);};}exports['register']=function(_0x1a071a){for(var _0xe55f2c=0x0,_0x1f9c3b=events['length'];_0xe55f2c<_0x1f9c3b;_0xe55f2c++){var _0x2212da=events[_0xe55f2c];var _0x3732ff=createListener(_0x1eba('0x4')+_0x2212da,_0x1a071a);MailMessageEvents['on'](_0x2212da,_0x3732ff);}}; \ No newline at end of file +var _0xebf3=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0xebf3,0x114));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0x3ebf('0x0'));var events=[_0x3ebf('0x1'),_0x3ebf('0x2'),_0x3ebf('0x3')];function createListener(_0x3774b0,_0x5ef09b){return function(_0x46b69c){_0x5ef09b[_0x3ebf('0x4')](_0x3774b0,_0x46b69c);};}function removeListener(_0x219c40,_0x5e9b18){return function(){MailMessageEvents[_0x3ebf('0x5')](_0x219c40,_0x5e9b18);};}exports[_0x3ebf('0x6')]=function(_0x32b54d){for(var _0x13836e=0x0,_0x13889e=events[_0x3ebf('0x7')];_0x13836e<_0x13889e;_0x13836e++){var _0x473a34=events[_0x13836e];var _0x369739=createListener(_0x3ebf('0x8')+_0x473a34,_0x32b54d);MailMessageEvents['on'](_0x473a34,_0x369739);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6247ec7..2690653 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 _0x0314=['getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x391163,_0x4ae5c6){var _0x4dceba=function(_0x119e34){while(--_0x119e34){_0x391163['push'](_0x391163['shift']());}};_0x4dceba(++_0x4ae5c6);}(_0x0314,0x1dd));var _0x4031=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0314[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4031('0x0'));var util=require('util');var path=require(_0x4031('0x1'));var timeout=require(_0x4031('0x2'));var express=require(_0x4031('0x3'));var router=express[_0x4031('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4031('0x5'));var interaction=require(_0x4031('0x6'));var config=require(_0x4031('0x7'));var controller=require(_0x4031('0x8'));router[_0x4031('0x9')]('/',auth['isAuthenticated'](),controller[_0x4031('0xa')]);router[_0x4031('0x9')](_0x4031('0xb'),auth[_0x4031('0xc')](),controller[_0x4031('0xd')]);router[_0x4031('0x9')](_0x4031('0xe'),auth[_0x4031('0xc')](),controller[_0x4031('0xf')]);router[_0x4031('0x9')]('/:id/members',auth[_0x4031('0xc')](),controller[_0x4031('0x10')]);router[_0x4031('0x9')](_0x4031('0x11'),auth[_0x4031('0xc')](),controller['getTeams']);router['get'](_0x4031('0x12'),auth[_0x4031('0xc')](),controller[_0x4031('0x13')]);router[_0x4031('0x14')]('/',auth[_0x4031('0xc')](),controller[_0x4031('0x15')]);router['post'](_0x4031('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4031('0x14')](_0x4031('0x12'),auth['isAuthenticated'](),controller[_0x4031('0x16')]);router[_0x4031('0x17')](_0x4031('0xe'),auth[_0x4031('0xc')](),controller['update']);router[_0x4031('0x18')](_0x4031('0xe'),auth['isAuthenticated'](),controller[_0x4031('0x19')]);router[_0x4031('0x18')](_0x4031('0x11'),auth['isAuthenticated'](),controller[_0x4031('0x1a')]);router[_0x4031('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x4031('0x1b')]);module[_0x4031('0x1c')]=router; \ No newline at end of file +var _0x8ca9=['fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','util','express','Router'];(function(_0x375d23,_0x417f8f){var _0x4d0ec4=function(_0xea052c){while(--_0xea052c){_0x375d23['push'](_0x375d23['shift']());}};_0x4d0ec4(++_0x417f8f);}(_0x8ca9,0x192));var _0x98ca=function(_0x18cf8a,_0xcc5571){_0x18cf8a=_0x18cf8a-0x0;var _0x1f13c9=_0x8ca9[_0x18cf8a];return _0x1f13c9;};'use strict';var multer=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x98ca('0x2'));var router=express[_0x98ca('0x3')]();var fs_extra=require(_0x98ca('0x4'));var auth=require(_0x98ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x98ca('0x6'));var controller=require(_0x98ca('0x7'));router[_0x98ca('0x8')]('/',auth[_0x98ca('0x9')](),controller[_0x98ca('0xa')]);router[_0x98ca('0x8')](_0x98ca('0xb'),auth[_0x98ca('0x9')](),controller['describe']);router[_0x98ca('0x8')]('/:id',auth[_0x98ca('0x9')](),controller[_0x98ca('0xc')]);router['get'](_0x98ca('0xd'),auth['isAuthenticated'](),controller[_0x98ca('0xe')]);router[_0x98ca('0x8')](_0x98ca('0xf'),auth[_0x98ca('0x9')](),controller[_0x98ca('0x10')]);router[_0x98ca('0x8')]('/:id/users',auth[_0x98ca('0x9')](),controller[_0x98ca('0x11')]);router[_0x98ca('0x12')]('/',auth[_0x98ca('0x9')](),controller[_0x98ca('0x13')]);router[_0x98ca('0x12')](_0x98ca('0xf'),auth[_0x98ca('0x9')](),controller[_0x98ca('0x14')]);router[_0x98ca('0x12')](_0x98ca('0x15'),auth['isAuthenticated'](),controller['addAgents']);router[_0x98ca('0x16')](_0x98ca('0x17'),auth[_0x98ca('0x9')](),controller[_0x98ca('0x18')]);router[_0x98ca('0x19')](_0x98ca('0x17'),auth[_0x98ca('0x9')](),controller[_0x98ca('0x1a')]);router[_0x98ca('0x19')]('/:id/teams',auth[_0x98ca('0x9')](),controller[_0x98ca('0x1b')]);router[_0x98ca('0x19')]('/:id/users',auth[_0x98ca('0x9')](),controller[_0x98ca('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 9497c18..9807d59 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 _0x55cb=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x3a2855,_0x3495e1){var _0x1fc9cc=function(_0x3265f3){while(--_0x3265f3){_0x3a2855['push'](_0x3a2855['shift']());}};_0x1fc9cc(++_0x3495e1);}(_0x55cb,0xdd));var _0xb55c=function(_0xf25c17,_0x288f2c){_0xf25c17=_0xf25c17-0x0;var _0x429736=_0x55cb[_0xf25c17];return _0x429736;};'use strict';var Sequelize=require(_0xb55c('0x0'));module[_0xb55c('0x1')]={'name':{'type':Sequelize[_0xb55c('0x2')],'unique':_0xb55c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb55c('0x2')]},'timeout':{'type':Sequelize[_0xb55c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb55c('0x5')](_0xb55c('0x6'),_0xb55c('0x7'),_0xb55c('0x8'))}}; \ No newline at end of file +var _0x6175=['rrmemory','beepall','roundrobin','exports','STRING','name','ENUM'];(function(_0x2613f7,_0x1fbd7c){var _0x327f44=function(_0x36b5b1){while(--_0x36b5b1){_0x2613f7['push'](_0x2613f7['shift']());}};_0x327f44(++_0x1fbd7c);}(_0x6175,0x161));var _0x5617=function(_0x1b4865,_0x523fca){_0x1b4865=_0x1b4865-0x0;var _0x449566=_0x6175[_0x1b4865];return _0x449566;};'use strict';var Sequelize=require('sequelize');module[_0x5617('0x0')]={'name':{'type':Sequelize[_0x5617('0x1')],'unique':_0x5617('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5617('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5617('0x3')](_0x5617('0x4'),_0x5617('0x5'),_0x5617('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index e430044..756ef13 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 _0x0f68=['stack','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailQueue','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','rawAttributes','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','get','MailQueues','UserProfileResource','error'];(function(_0x151762,_0x17691f){var _0x27f596=function(_0x4ca750){while(--_0x4ca750){_0x151762['push'](_0x151762['shift']());}};_0x27f596(++_0x17691f);}(_0x0f68,0xea));var _0x80f6=function(_0x1ffde4,_0x481280){_0x1ffde4=_0x1ffde4-0x0;var _0x338769=_0x0f68[_0x1ffde4];return _0x338769;};'use strict';var emlformat=require(_0x80f6('0x0'));var rimraf=require(_0x80f6('0x1'));var zipdir=require(_0x80f6('0x2'));var jsonpatch=require(_0x80f6('0x3'));var rp=require(_0x80f6('0x4'));var moment=require('moment');var BPromise=require(_0x80f6('0x5'));var Mustache=require(_0x80f6('0x6'));var util=require('util');var path=require(_0x80f6('0x7'));var sox=require(_0x80f6('0x8'));var csv=require(_0x80f6('0x9'));var ejs=require(_0x80f6('0xa'));var fs=require('fs');var fs_extra=require(_0x80f6('0xb'));var _=require(_0x80f6('0xc'));var squel=require(_0x80f6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x80f6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x80f6('0xf'));var Papa=require('papaparse');var Redis=require(_0x80f6('0x10'));var authService=require(_0x80f6('0x11'));var qs=require(_0x80f6('0x12'));var as=require(_0x80f6('0x13'));var hardwareService=require(_0x80f6('0x14'));var logger=require(_0x80f6('0x15'))(_0x80f6('0x16'));var utils=require(_0x80f6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x80f6('0x18'));var db=require(_0x80f6('0x19'))['db'];config['redis']=_[_0x80f6('0x1a')](config[_0x80f6('0x1b')],{'host':_0x80f6('0x1c'),'port':0x18eb});var socket=require(_0x80f6('0x1d'))(new Redis(config[_0x80f6('0x1b')]));require(_0x80f6('0x1e'))[_0x80f6('0x1f')](socket);function respondWithStatusCode(_0x1809f4,_0x4759a5){_0x4759a5=_0x4759a5||0xcc;return function(_0xe487aa){if(_0xe487aa){return _0x1809f4[_0x80f6('0x20')](_0x4759a5);}return _0x1809f4[_0x80f6('0x21')](_0x4759a5)[_0x80f6('0x22')]();};}function respondWithResult(_0x2e9c7e,_0x18852d){_0x18852d=_0x18852d||0xc8;return function(_0x4d3589){if(_0x4d3589){return _0x2e9c7e[_0x80f6('0x21')](_0x18852d)[_0x80f6('0x23')](_0x4d3589);}};}function respondWithFilteredResult(_0x2f23ab,_0x590734){return function(_0x1f1df1){if(_0x1f1df1){var _0x56a1fb=typeof _0x590734[_0x80f6('0x24')]===_0x80f6('0x25')&&typeof _0x590734[_0x80f6('0x26')]===_0x80f6('0x25');var _0x138eab=_0x1f1df1[_0x80f6('0x27')];var _0x1f1ee5=_0x56a1fb?0x0:_0x590734[_0x80f6('0x24')];var _0x44472d=_0x56a1fb?_0x1f1df1[_0x80f6('0x27')]:_0x590734[_0x80f6('0x24')]+_0x590734[_0x80f6('0x26')];var _0x546c6d;if(_0x44472d>=_0x138eab){_0x44472d=_0x138eab;_0x546c6d=0xc8;}else{_0x546c6d=0xce;}_0x2f23ab[_0x80f6('0x21')](_0x546c6d);return _0x2f23ab['set']('Content-Range',_0x1f1ee5+'-'+_0x44472d+'/'+_0x138eab)[_0x80f6('0x23')](_0x1f1df1);}return null;};}function patchUpdates(_0x493264){return function(_0x5b5358){try{jsonpatch[_0x80f6('0x28')](_0x5b5358,_0x493264,!![]);}catch(_0x10ea1b){return BPromise[_0x80f6('0x29')](_0x10ea1b);}return _0x5b5358[_0x80f6('0x2a')]();};}function saveUpdates(_0x1e0f7c,_0x3b4e72){return function(_0x369fe3){if(_0x369fe3){return _0x369fe3[_0x80f6('0x2b')](_0x1e0f7c)['then'](function(_0x579a21){return _0x579a21;});}return null;};}function removeEntity(_0x540cc0,_0x17a441){return function(_0x542521){if(_0x542521){return _0x542521[_0x80f6('0x2c')]()[_0x80f6('0x2d')](function(){var _0x5b0e4e=_0x542521[_0x80f6('0x2e')]({'plain':!![]});var _0xc27df6=_0x80f6('0x2f');return db[_0x80f6('0x30')][_0x80f6('0x2c')]({'where':{'type':_0xc27df6,'resourceId':_0x5b0e4e['id']}})['then'](function(){return _0x542521;});})['then'](function(){_0x540cc0[_0x80f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28c254,_0x1c91bb){return function(_0x4ab23e){if(!_0x4ab23e){_0x28c254[_0x80f6('0x20')](0x194);}return _0x4ab23e;};}function handleError(_0x45f8eb,_0x4a8d94){_0x4a8d94=_0x4a8d94||0x1f4;return function(_0x5094fe){logger[_0x80f6('0x31')](_0x5094fe[_0x80f6('0x32')]);if(_0x5094fe[_0x80f6('0x33')]){delete _0x5094fe[_0x80f6('0x33')];}_0x45f8eb[_0x80f6('0x21')](_0x4a8d94)['send'](_0x5094fe);};}exports[_0x80f6('0x34')]=function(_0x48c6f2,_0x4f729f){var _0x53c13b={},_0x49c8f5={},_0x3e5a54={'count':0x0,'rows':[]};var _0x17857e=_[_0x80f6('0x35')](db['MailQueue']['rawAttributes'],function(_0x754c25){return{'name':_0x754c25['fieldName'],'type':_0x754c25[_0x80f6('0x36')][_0x80f6('0x37')]};});_0x49c8f5[_0x80f6('0x38')]=_[_0x80f6('0x35')](_0x17857e,_0x80f6('0x33'));_0x49c8f5[_0x80f6('0x39')]=_['keys'](_0x48c6f2[_0x80f6('0x39')]);_0x49c8f5[_0x80f6('0x3a')]=_[_0x80f6('0x3b')](_0x49c8f5[_0x80f6('0x38')],_0x49c8f5[_0x80f6('0x39')]);_0x53c13b[_0x80f6('0x3c')]=_[_0x80f6('0x3b')](_0x49c8f5[_0x80f6('0x38')],qs[_0x80f6('0x3d')](_0x48c6f2[_0x80f6('0x39')]['fields']));_0x53c13b[_0x80f6('0x3c')]=_0x53c13b[_0x80f6('0x3c')][_0x80f6('0x3e')]?_0x53c13b[_0x80f6('0x3c')]:_0x49c8f5[_0x80f6('0x38')];if(!_0x48c6f2['query'][_0x80f6('0x3f')](_0x80f6('0x40'))){_0x53c13b[_0x80f6('0x26')]=qs['limit'](_0x48c6f2[_0x80f6('0x39')][_0x80f6('0x26')]);_0x53c13b[_0x80f6('0x24')]=qs[_0x80f6('0x24')](_0x48c6f2[_0x80f6('0x39')][_0x80f6('0x24')]);}_0x53c13b[_0x80f6('0x41')]=qs['sort'](_0x48c6f2[_0x80f6('0x39')][_0x80f6('0x42')]);_0x53c13b['where']=qs['filters'](_[_0x80f6('0x43')](_0x48c6f2[_0x80f6('0x39')],_0x49c8f5[_0x80f6('0x3a')]),_0x17857e);if(_0x48c6f2['query'][_0x80f6('0x44')]){_0x53c13b[_0x80f6('0x45')]=_[_0x80f6('0x46')](_0x53c13b['where'],{'$or':_[_0x80f6('0x35')](_0x17857e,function(_0x54d7b1){if(_0x54d7b1[_0x80f6('0x36')]!==_0x80f6('0x47')){var _0x38c816={};_0x38c816[_0x54d7b1[_0x80f6('0x33')]]={'$like':'%'+_0x48c6f2['query'][_0x80f6('0x44')]+'%'};return _0x38c816;}})});}_0x53c13b=_[_0x80f6('0x46')]({},_0x53c13b,_0x48c6f2[_0x80f6('0x48')]);var _0xb04a0d={'where':_0x53c13b['where']};return db[_0x80f6('0x49')][_0x80f6('0x27')](_0xb04a0d)[_0x80f6('0x2d')](function(_0x58c6f4){_0x3e5a54[_0x80f6('0x27')]=_0x58c6f4;if(_0x48c6f2['query'][_0x80f6('0x4a')]){_0x53c13b[_0x80f6('0x4b')]=[{'all':!![]}];}return db[_0x80f6('0x49')][_0x80f6('0x4c')](_0x53c13b);})[_0x80f6('0x2d')](function(_0x85ae9c){_0x3e5a54[_0x80f6('0x4d')]=_0x85ae9c;return _0x3e5a54;})['then'](respondWithFilteredResult(_0x4f729f,_0x53c13b))[_0x80f6('0x4e')](handleError(_0x4f729f,null));};exports[_0x80f6('0x4f')]=function(_0x4dc64e,_0xeb719f){var _0x2fbf69={'raw':!![],'where':{'id':_0x4dc64e[_0x80f6('0x50')]['id']}},_0x498f0c={};_0x498f0c['model']=_[_0x80f6('0x51')](db[_0x80f6('0x49')]['rawAttributes']);_0x498f0c[_0x80f6('0x39')]=_[_0x80f6('0x51')](_0x4dc64e[_0x80f6('0x39')]);_0x498f0c[_0x80f6('0x3a')]=_[_0x80f6('0x3b')](_0x498f0c[_0x80f6('0x38')],_0x498f0c[_0x80f6('0x39')]);_0x2fbf69['attributes']=_[_0x80f6('0x3b')](_0x498f0c[_0x80f6('0x38')],qs[_0x80f6('0x3d')](_0x4dc64e[_0x80f6('0x39')][_0x80f6('0x3d')]));_0x2fbf69[_0x80f6('0x3c')]=_0x2fbf69['attributes'][_0x80f6('0x3e')]?_0x2fbf69['attributes']:_0x498f0c[_0x80f6('0x38')];if(_0x4dc64e[_0x80f6('0x39')][_0x80f6('0x4a')]){_0x2fbf69['include']=[{'all':!![]}];}_0x2fbf69=_['merge']({},_0x2fbf69,_0x4dc64e[_0x80f6('0x48')]);return db[_0x80f6('0x49')]['find'](_0x2fbf69)[_0x80f6('0x2d')](handleEntityNotFound(_0xeb719f,null))[_0x80f6('0x2d')](respondWithResult(_0xeb719f,null))[_0x80f6('0x4e')](handleError(_0xeb719f,null));};exports[_0x80f6('0x52')]=function(_0x5b4f6d,_0x4abf27){return db[_0x80f6('0x49')]['create'](_0x5b4f6d[_0x80f6('0x53')],{})[_0x80f6('0x2d')](function(_0x3ee1e2){var _0x44ccf6=_0x5b4f6d[_0x80f6('0x54')][_0x80f6('0x2e')]({'plain':!![]});if(!_0x44ccf6)throw new Error(_0x80f6('0x55'));if(_0x44ccf6[_0x80f6('0x56')]===_0x80f6('0x54')){var _0x2f70d2=_0x3ee1e2[_0x80f6('0x2e')]({'plain':!![]});var _0x24b169=_0x80f6('0x2f');return db[_0x80f6('0x57')][_0x80f6('0x58')]({'where':{'name':_0x24b169,'userProfileId':_0x44ccf6['userProfileId']},'raw':!![]})[_0x80f6('0x2d')](function(_0x1799b9){if(_0x1799b9&&_0x1799b9[_0x80f6('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x2f70d2['name'],'resourceId':_0x2f70d2['id'],'type':_0x1799b9['name'],'sectionId':_0x1799b9['id']},{})[_0x80f6('0x2d')](function(){return _0x3ee1e2;});}else{return _0x3ee1e2;}})[_0x80f6('0x4e')](function(_0x1a6417){logger[_0x80f6('0x31')](_0x80f6('0x5a'),_0x1a6417);throw _0x1a6417;});}return _0x3ee1e2;})[_0x80f6('0x2d')](respondWithResult(_0x4abf27,0xc9))[_0x80f6('0x4e')](handleError(_0x4abf27,null));};exports[_0x80f6('0x2b')]=function(_0x21499e,_0x2849cd){if(_0x21499e[_0x80f6('0x53')]['id']){delete _0x21499e['body']['id'];}return db[_0x80f6('0x49')]['find']({'where':{'id':_0x21499e[_0x80f6('0x50')]['id']}})[_0x80f6('0x2d')](handleEntityNotFound(_0x2849cd,null))[_0x80f6('0x2d')](saveUpdates(_0x21499e[_0x80f6('0x53')],null))[_0x80f6('0x2d')](respondWithResult(_0x2849cd,null))[_0x80f6('0x4e')](handleError(_0x2849cd,null));};exports[_0x80f6('0x2c')]=function(_0x5510b6,_0x5a63d7){return db[_0x80f6('0x49')][_0x80f6('0x58')]({'where':{'id':_0x5510b6[_0x80f6('0x50')]['id']}})[_0x80f6('0x2d')](handleEntityNotFound(_0x5a63d7,null))[_0x80f6('0x2d')](removeEntity(_0x5a63d7,null))[_0x80f6('0x4e')](handleError(_0x5a63d7,null));};exports[_0x80f6('0x5b')]=function(_0x247225,_0x888595){return db[_0x80f6('0x49')][_0x80f6('0x5b')]()[_0x80f6('0x2d')](respondWithResult(_0x888595,null))[_0x80f6('0x4e')](handleError(_0x888595,null));};exports[_0x80f6('0x5c')]=function(_0x4013ee,_0xff20a6,_0x3a9e6f){var _0x3d9a11={'raw':!![],'where':{}},_0x2c8a8d={},_0x634986;return db[_0x80f6('0x49')][_0x80f6('0x5d')]({'where':{'id':_0x4013ee['params']['id']}})[_0x80f6('0x2d')](handleEntityNotFound(_0xff20a6,null))['then'](function(_0x3eb2cd){if(_0x3eb2cd){_0x634986=_0x3eb2cd['get']({'plain':!![]});_0x2c8a8d[_0x80f6('0x38')]=_[_0x80f6('0x51')](db[_0x80f6('0x5e')][_0x80f6('0x5f')]);_0x2c8a8d['query']=_[_0x80f6('0x51')](_0x4013ee[_0x80f6('0x39')]);_0x2c8a8d[_0x80f6('0x3a')]=_['intersection'](_0x2c8a8d[_0x80f6('0x38')],_0x2c8a8d[_0x80f6('0x39')]);_0x3d9a11[_0x80f6('0x3c')]=_[_0x80f6('0x3b')](_0x2c8a8d[_0x80f6('0x38')],qs[_0x80f6('0x3d')](_0x4013ee[_0x80f6('0x39')][_0x80f6('0x3d')]));_0x3d9a11[_0x80f6('0x3c')]=_0x3d9a11[_0x80f6('0x3c')][_0x80f6('0x3e')]?_0x3d9a11['attributes']:_0x2c8a8d[_0x80f6('0x38')];if(!_0x4013ee[_0x80f6('0x39')][_0x80f6('0x3f')]('nolimit')){_0x3d9a11[_0x80f6('0x26')]=qs[_0x80f6('0x26')](_0x4013ee['query'][_0x80f6('0x26')]);_0x3d9a11[_0x80f6('0x24')]=qs[_0x80f6('0x24')](_0x4013ee[_0x80f6('0x39')][_0x80f6('0x24')]);}_0x3d9a11[_0x80f6('0x41')]=qs[_0x80f6('0x42')](_0x4013ee[_0x80f6('0x39')]['sort']);_0x3d9a11[_0x80f6('0x45')]=qs[_0x80f6('0x3a')](_[_0x80f6('0x43')](_0x4013ee[_0x80f6('0x39')],_0x2c8a8d[_0x80f6('0x3a')]));_0x3d9a11[_0x80f6('0x45')]['MailQueueId']=_0x3eb2cd['id'];if(_0x4013ee[_0x80f6('0x39')][_0x80f6('0x44')]){_0x3d9a11[_0x80f6('0x45')]=_[_0x80f6('0x46')](_0x3d9a11[_0x80f6('0x45')],{'$or':_[_0x80f6('0x35')](_0x3d9a11[_0x80f6('0x3c')],function(_0x1b5f6b){var _0x12a897={};_0x12a897[_0x1b5f6b]={'$like':'%'+_0x4013ee['query'][_0x80f6('0x44')]+'%'};return _0x12a897;})});}_0x3d9a11=_[_0x80f6('0x46')]({},_0x3d9a11,_0x4013ee['options']);return db[_0x80f6('0x5e')][_0x80f6('0x4c')](_0x3d9a11);}})[_0x80f6('0x2d')](function(_0x56c006){if(_0x56c006){return db[_0x80f6('0x60')][_0x80f6('0x61')]({'where':{'id':_[_0x80f6('0x35')](_0x56c006,'UserId'),'role':_0x80f6('0x62')},'attributes':['id',_0x80f6('0x33'),_0x80f6('0x63'),_0x80f6('0x64'),_0x80f6('0x65')]});}})[_0x80f6('0x2d')](function(_0x39155a){if(_0x39155a){return{'count':_0x39155a[_0x80f6('0x27')],'rows':_[_0x80f6('0x35')](_0x39155a['rows'],function(_0x3b14e0){return{'membername':_0x3b14e0[_0x80f6('0x33')],'UserId':_0x3b14e0['id'],'queue_name':_0x634986['name'],'MailQueueId':_0x634986['id'],'interface':util[_0x80f6('0x66')](_0x80f6('0x67'),'SIP',_0x3b14e0[_0x80f6('0x33')]),'penalty':0x0,'paused':_0x3b14e0[_0x80f6('0x63')],'createdAt':_0x3b14e0[_0x80f6('0x65')],'updatedAt':_0x3b14e0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xff20a6,_0x3d9a11))[_0x80f6('0x4e')](handleError(_0xff20a6,null));};exports[_0x80f6('0x68')]=function(_0x910352,_0x4656f3,_0x2b75fd){var _0x5ba0c8={};var _0x31e1fa={};var _0x56c4fc;var _0x359e0a;return db[_0x80f6('0x49')]['findOne']({'where':{'id':_0x910352[_0x80f6('0x50')]['id']}})[_0x80f6('0x2d')](handleEntityNotFound(_0x4656f3,null))[_0x80f6('0x2d')](function(_0x14f009){if(_0x14f009){_0x56c4fc=_0x14f009;_0x31e1fa[_0x80f6('0x38')]=_[_0x80f6('0x51')](db[_0x80f6('0x69')]['rawAttributes']);_0x31e1fa[_0x80f6('0x39')]=_[_0x80f6('0x51')](_0x910352[_0x80f6('0x39')]);_0x31e1fa[_0x80f6('0x3a')]=_['intersection'](_0x31e1fa['model'],_0x31e1fa['query']);_0x5ba0c8[_0x80f6('0x3c')]=_[_0x80f6('0x3b')](_0x31e1fa[_0x80f6('0x38')],qs[_0x80f6('0x3d')](_0x910352[_0x80f6('0x39')][_0x80f6('0x3d')]));_0x5ba0c8[_0x80f6('0x3c')]=_0x5ba0c8[_0x80f6('0x3c')][_0x80f6('0x3e')]?_0x5ba0c8[_0x80f6('0x3c')]:_0x31e1fa['model'];_0x5ba0c8[_0x80f6('0x41')]=qs['sort'](_0x910352['query'][_0x80f6('0x42')]);_0x5ba0c8['where']=qs[_0x80f6('0x3a')](_['pick'](_0x910352[_0x80f6('0x39')],_0x31e1fa[_0x80f6('0x3a')]));if(_0x910352['query'][_0x80f6('0x44')]){_0x5ba0c8['where']=_['merge'](_0x5ba0c8[_0x80f6('0x45')],{'$or':_[_0x80f6('0x35')](_0x5ba0c8[_0x80f6('0x3c')],function(_0x130be5){var _0x127220={};_0x127220[_0x130be5]={'$like':'%'+_0x910352['query']['filter']+'%'};return _0x127220;})});}_0x5ba0c8=_[_0x80f6('0x46')]({},_0x5ba0c8,_0x910352[_0x80f6('0x48')]);return _0x56c4fc['getTeams'](_0x5ba0c8);}})[_0x80f6('0x2d')](function(_0x65207a){if(_0x65207a){_0x359e0a=_0x65207a[_0x80f6('0x3e')];if(!_0x910352[_0x80f6('0x39')][_0x80f6('0x3f')](_0x80f6('0x40'))){_0x5ba0c8[_0x80f6('0x26')]=qs[_0x80f6('0x26')](_0x910352['query'][_0x80f6('0x26')]);_0x5ba0c8[_0x80f6('0x24')]=qs['offset'](_0x910352[_0x80f6('0x39')][_0x80f6('0x24')]);}return _0x56c4fc['getTeams'](_0x5ba0c8);}})[_0x80f6('0x2d')](function(_0x4a3ded){if(_0x4a3ded){return _0x4a3ded?{'count':_0x359e0a,'rows':_0x4a3ded}:null;}})[_0x80f6('0x2d')](respondWithResult(_0x4656f3,null))['catch'](handleError(_0x4656f3,null));};exports[_0x80f6('0x6a')]=function(_0x52ed54,_0x1cddbb,_0x132552){var _0x25764b=_0x52ed54['body'][_0x80f6('0x6b')];return db[_0x80f6('0x69')][_0x80f6('0x4c')]({'where':{'id':_0x25764b},'attributes':['id'],'include':[{'model':db[_0x80f6('0x60')],'as':_0x80f6('0x6c'),'attributes':['id','name',_0x80f6('0x6d'),_0x80f6('0x6e'),'interface'],'raw':!![]}]})['then'](function(_0x526365){if(_0x526365){var _0x39a495=_[_0x80f6('0x6f')](_0x526365,function(_0x3d9432){var _0x5310c4=_0x3d9432['get']({'plain':!![]});return _0x5310c4[_0x80f6('0x6c')];});return db[_0x80f6('0x49')]['find']({'where':{'id':_0x52ed54[_0x80f6('0x50')]['id']}})['then'](function(_0x446642){return db[_0x80f6('0x70')][_0x80f6('0x71')](function(_0x317260){return _0x446642[_0x80f6('0x6a')](_0x25764b,{'transaction':_0x317260})[_0x80f6('0x2d')](function(){return BPromise['each'](_0x39a495,function(_0x1845cc){return db['UserMailQueue'][_0x80f6('0x72')]({'where':{'UserId':_0x1845cc['id'],'MailQueueId':_0x52ed54['params']['id']},'transaction':_0x317260});});})[_0x80f6('0x2d')](function(){_0x39a495[_0x80f6('0x73')](function(_0x521b4f){socket[_0x80f6('0x74')](_0x80f6('0x75'),{'UserId':_0x521b4f['id'],'MailQueueId':_0x446642['id']});});});});});}})['then'](respondWithStatusCode(_0x1cddbb,null))[_0x80f6('0x4e')](handleError(_0x1cddbb,null));};exports[_0x80f6('0x76')]=function(_0xf7cc8d,_0x41f50b,_0x4f4b83){return db[_0x80f6('0x69')]['findAll']({'where':{'id':_0xf7cc8d[_0x80f6('0x39')][_0x80f6('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x80f6('0x60')],'as':_0x80f6('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x80f6('0x2d')](handleEntityNotFound(_0x41f50b,null))[_0x80f6('0x2d')](function(_0x33aa6a){var _0x46c071=_[_0x80f6('0x35')](_0x33aa6a,'id');var _0x31a078=[];var _0x4118c8=[];var _0x21f214=squel[_0x80f6('0x77')]();_0x21f214[_0x80f6('0x78')]('tq.TeamId')['from'](_0x80f6('0x79'),'tq')['join'](_0x80f6('0x7a'),'ut',_0x80f6('0x7b'))[_0x80f6('0x45')](_0x80f6('0x7c'),_0xf7cc8d[_0x80f6('0x50')]['id']);for(var _0x159f02=0x0;_0x159f02<_0x33aa6a['length'];_0x159f02+=0x1){let _0x4eb6fd=_0x33aa6a[_0x159f02];for(var _0x270753=0x0;_0x270753<_0x4eb6fd[_0x80f6('0x6c')][_0x80f6('0x3e')];_0x270753+=0x1){let _0x1cbf15=_0x4eb6fd[_0x80f6('0x6c')][_0x270753];var _0x12254a=_0x21f214[_0x80f6('0x7d')]();_0x12254a[_0x80f6('0x45')](_0x80f6('0x7e'),_0x1cbf15['id']);_0x4118c8['push'](db[_0x80f6('0x70')]['query'](_0x12254a[_0x80f6('0x7f')](),{'type':db[_0x80f6('0x70')][_0x80f6('0x80')]['SELECT']})[_0x80f6('0x2d')](function(_0x11d18c){if(_0x11d18c[_0x80f6('0x3e')]===0x1){return _0x1cbf15['id'];}else{var _0x4b901a=_[_0x80f6('0x81')](_[_0x80f6('0x35')](_0x11d18c,_0x80f6('0x82')),function(_0x4a7799){return _[_0x80f6('0x83')](_0x46c071,_0x4a7799);});if(_0x4b901a){return _0x1cbf15['id'];}}}));}}return BPromise[_0x80f6('0x84')](_0x4118c8)[_0x80f6('0x2d')](function(_0x592b89){_0x31a078=_(_0x31a078)['union'](_0x592b89)[_0x80f6('0x85')]()[_0x80f6('0x86')]();return db['MailQueue'][_0x80f6('0x58')]({'where':{'id':_0xf7cc8d[_0x80f6('0x50')]['id']}})[_0x80f6('0x2d')](function(_0x540b85){return db['sequelize'][_0x80f6('0x71')](function(_0x92742b){return _0x540b85[_0x80f6('0x76')](_0xf7cc8d[_0x80f6('0x39')][_0x80f6('0x6b')],{'transaction':_0x92742b})[_0x80f6('0x2d')](function(){if(!_[_0x80f6('0x87')](_0x31a078)){return _0x540b85[_0x80f6('0x88')](_0x31a078,{'transaction':_0x92742b});}})[_0x80f6('0x2d')](function(){_0x31a078[_0x80f6('0x73')](function(_0x13690b){socket[_0x80f6('0x74')](_0x80f6('0x89'),{'UserId':_0x13690b,'MailQueueId':_0x540b85['id']});});});});});});})[_0x80f6('0x2d')](respondWithStatusCode(_0x41f50b,null))['catch'](handleError(_0x41f50b,null));};exports[_0x80f6('0x8a')]=function(_0x395675,_0x6eabde,_0x2b9ed7){return db[_0x80f6('0x49')][_0x80f6('0x58')]({'where':{'id':_0x395675[_0x80f6('0x50')]['id']}})['then'](handleEntityNotFound(_0x6eabde,null))[_0x80f6('0x2d')](function(_0x46113c){if(_0x46113c){return _0x46113c[_0x80f6('0x8a')](_0x395675[_0x80f6('0x53')][_0x80f6('0x6b')],_[_0x80f6('0x8b')](_0x395675[_0x80f6('0x53')],['ids','id'])||{})[_0x80f6('0x8c')](function(_0x1f874b){for(var _0xb3e0be=0x0;_0xb3e0be<_0x395675['body'][_0x80f6('0x6b')][_0x80f6('0x3e')];_0xb3e0be+=0x1){socket[_0x80f6('0x74')](_0x80f6('0x75'),{'UserId':Number(_0x395675[_0x80f6('0x53')]['ids'][_0xb3e0be]),'MailQueueId':Number(_0x395675['params']['id'])});}return _0x1f874b;});}})[_0x80f6('0x2d')](respondWithResult(_0x6eabde,null))['catch'](handleError(_0x6eabde,null));};exports['removeAgents']=function(_0x5f4f97,_0x355750,_0x4d595a){return db[_0x80f6('0x49')][_0x80f6('0x58')]({'where':{'id':_0x5f4f97[_0x80f6('0x50')]['id']}})[_0x80f6('0x2d')](handleEntityNotFound(_0x355750,null))['then'](function(_0x263dd2){if(_0x263dd2){return _0x263dd2[_0x80f6('0x88')](_0x5f4f97[_0x80f6('0x39')]['ids'])[_0x80f6('0x2d')](function(){if(_['isArray'](_0x5f4f97[_0x80f6('0x39')][_0x80f6('0x6b')])){for(var _0x31baf3=0x0;_0x31baf3<_0x5f4f97['query'][_0x80f6('0x6b')][_0x80f6('0x3e')];_0x31baf3+=0x1){socket[_0x80f6('0x74')]('userMailQueue:remove',{'UserId':Number(_0x5f4f97['query'][_0x80f6('0x6b')][_0x31baf3]),'MailQueueId':Number(_0x5f4f97['params']['id'])});}}else{socket[_0x80f6('0x74')](_0x80f6('0x89'),{'UserId':Number(_0x5f4f97[_0x80f6('0x39')]['ids']),'MailQueueId':Number(_0x5f4f97['params']['id'])});}});}})[_0x80f6('0x2d')](respondWithStatusCode(_0x355750,null))['catch'](handleError(_0x355750,null));};exports[_0x80f6('0x8d')]=function(_0x3b13a5,_0x2c2741,_0x14580c){var _0x39ec69={};var _0x23055e={};var _0x1a7bd5;var _0x20b188;return db[_0x80f6('0x49')][_0x80f6('0x5d')]({'where':{'id':_0x3b13a5[_0x80f6('0x50')]['id']}})[_0x80f6('0x2d')](handleEntityNotFound(_0x2c2741,null))[_0x80f6('0x2d')](function(_0x3c9e37){if(_0x3c9e37){_0x1a7bd5=_0x3c9e37;_0x23055e[_0x80f6('0x38')]=_[_0x80f6('0x51')](db[_0x80f6('0x60')][_0x80f6('0x5f')]);_0x23055e['query']=_['keys'](_0x3b13a5[_0x80f6('0x39')]);_0x23055e[_0x80f6('0x3a')]=_[_0x80f6('0x3b')](_0x23055e[_0x80f6('0x38')],_0x23055e['query']);_0x39ec69[_0x80f6('0x3c')]=_['intersection'](_0x23055e['model'],qs[_0x80f6('0x3d')](_0x3b13a5[_0x80f6('0x39')][_0x80f6('0x3d')]));_0x39ec69[_0x80f6('0x3c')]=_0x39ec69[_0x80f6('0x3c')][_0x80f6('0x3e')]?_0x39ec69['attributes']:_0x23055e[_0x80f6('0x38')];_0x39ec69[_0x80f6('0x41')]=qs[_0x80f6('0x42')](_0x3b13a5[_0x80f6('0x39')][_0x80f6('0x42')]);_0x39ec69[_0x80f6('0x45')]=qs[_0x80f6('0x3a')](_['pick'](_0x3b13a5['query'],_0x23055e['filters']));if(_0x3b13a5['query']['filter']){_0x39ec69[_0x80f6('0x45')]=_['merge'](_0x39ec69['where'],{'$or':_[_0x80f6('0x35')](_0x39ec69[_0x80f6('0x3c')],function(_0x59a236){var _0x1b790={};_0x1b790[_0x59a236]={'$like':'%'+_0x3b13a5['query'][_0x80f6('0x44')]+'%'};return _0x1b790;})});}_0x39ec69=_['merge']({},_0x39ec69,_0x3b13a5[_0x80f6('0x48')]);return _0x1a7bd5[_0x80f6('0x8d')](_0x39ec69);}})[_0x80f6('0x2d')](function(_0x3b6fb1){if(_0x3b6fb1){_0x20b188=_0x3b6fb1[_0x80f6('0x3e')];if(!_0x3b13a5[_0x80f6('0x39')][_0x80f6('0x3f')](_0x80f6('0x40'))){_0x39ec69['limit']=qs['limit'](_0x3b13a5[_0x80f6('0x39')][_0x80f6('0x26')]);_0x39ec69[_0x80f6('0x24')]=qs[_0x80f6('0x24')](_0x3b13a5[_0x80f6('0x39')]['offset']);}return _0x1a7bd5[_0x80f6('0x8d')](_0x39ec69);}})[_0x80f6('0x2d')](function(_0xdda552){if(_0xdda552){return _0xdda552?{'count':_0x20b188,'rows':_0xdda552}:null;}})['then'](respondWithResult(_0x2c2741,null))[_0x80f6('0x4e')](handleError(_0x2c2741,null));}; \ No newline at end of file +var _0x2ce9=['save','update','then','destroy','get','MailQueues','UserProfileResource','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','MailQueue','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','hasOwnProperty','nolimit','order','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','transaction','each','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply'];(function(_0x39f99d,_0x32ffb8){var _0xd6158e=function(_0xeaf8c8){while(--_0xeaf8c8){_0x39f99d['push'](_0x39f99d['shift']());}};_0xd6158e(++_0x32ffb8);}(_0x2ce9,0x65));var _0x92ce=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x2ce9[_0x211fef];return _0x5447bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x92ce('0x0'));var jsonpatch=require(_0x92ce('0x1'));var rp=require(_0x92ce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x92ce('0x3'));var util=require(_0x92ce('0x4'));var path=require('path');var sox=require(_0x92ce('0x5'));var csv=require('to-csv');var ejs=require(_0x92ce('0x6'));var fs=require('fs');var fs_extra=require(_0x92ce('0x7'));var _=require(_0x92ce('0x8'));var squel=require(_0x92ce('0x9'));var crypto=require(_0x92ce('0xa'));var jsforce=require(_0x92ce('0xb'));var deskjs=require(_0x92ce('0xc'));var toCsv=require('to-csv');var querystring=require(_0x92ce('0xd'));var Papa=require('papaparse');var Redis=require(_0x92ce('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92ce('0xf'));var logger=require(_0x92ce('0x10'))(_0x92ce('0x11'));var utils=require('../../config/utils');var config=require(_0x92ce('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x92ce('0x13'))['db'];config[_0x92ce('0x14')]=_[_0x92ce('0x15')](config[_0x92ce('0x14')],{'host':_0x92ce('0x16'),'port':0x18eb});var socket=require(_0x92ce('0x17'))(new Redis(config[_0x92ce('0x14')]));require(_0x92ce('0x18'))[_0x92ce('0x19')](socket);function respondWithStatusCode(_0x13e84e,_0x210287){_0x210287=_0x210287||0xcc;return function(_0x62fa7a){if(_0x62fa7a){return _0x13e84e[_0x92ce('0x1a')](_0x210287);}return _0x13e84e[_0x92ce('0x1b')](_0x210287)[_0x92ce('0x1c')]();};}function respondWithResult(_0x319caf,_0x10088e){_0x10088e=_0x10088e||0xc8;return function(_0x4d6ad5){if(_0x4d6ad5){return _0x319caf[_0x92ce('0x1b')](_0x10088e)[_0x92ce('0x1d')](_0x4d6ad5);}};}function respondWithFilteredResult(_0xb487cb,_0x46f465){return function(_0x4b0a08){if(_0x4b0a08){var _0x310390=typeof _0x46f465['offset']===_0x92ce('0x1e')&&typeof _0x46f465[_0x92ce('0x1f')]===_0x92ce('0x1e');var _0x186c20=_0x4b0a08[_0x92ce('0x20')];var _0x50b203=_0x310390?0x0:_0x46f465[_0x92ce('0x21')];var _0x3278e9=_0x310390?_0x4b0a08[_0x92ce('0x20')]:_0x46f465[_0x92ce('0x21')]+_0x46f465['limit'];var _0x5655ff;if(_0x3278e9>=_0x186c20){_0x3278e9=_0x186c20;_0x5655ff=0xc8;}else{_0x5655ff=0xce;}_0xb487cb[_0x92ce('0x1b')](_0x5655ff);return _0xb487cb[_0x92ce('0x22')]('Content-Range',_0x50b203+'-'+_0x3278e9+'/'+_0x186c20)['json'](_0x4b0a08);}return null;};}function patchUpdates(_0x37e9d4){return function(_0x4ca522){try{jsonpatch[_0x92ce('0x23')](_0x4ca522,_0x37e9d4,!![]);}catch(_0x440e45){return BPromise['reject'](_0x440e45);}return _0x4ca522[_0x92ce('0x24')]();};}function saveUpdates(_0x42caf6,_0x575c12){return function(_0x1067c3){if(_0x1067c3){return _0x1067c3[_0x92ce('0x25')](_0x42caf6)[_0x92ce('0x26')](function(_0x5c753c){return _0x5c753c;});}return null;};}function removeEntity(_0x56ab0f,_0x569efb){return function(_0x5eda79){if(_0x5eda79){return _0x5eda79[_0x92ce('0x27')]()[_0x92ce('0x26')](function(){var _0x5d0efc=_0x5eda79[_0x92ce('0x28')]({'plain':!![]});var _0x2ace96=_0x92ce('0x29');return db[_0x92ce('0x2a')][_0x92ce('0x27')]({'where':{'type':_0x2ace96,'resourceId':_0x5d0efc['id']}})[_0x92ce('0x26')](function(){return _0x5eda79;});})[_0x92ce('0x26')](function(){_0x56ab0f[_0x92ce('0x1b')](0xcc)[_0x92ce('0x1c')]();});}};}function handleEntityNotFound(_0x258bb2,_0x1d9ced){return function(_0x3d8f68){if(!_0x3d8f68){_0x258bb2[_0x92ce('0x1a')](0x194);}return _0x3d8f68;};}function handleError(_0x54938b,_0x3d5f9c){_0x3d5f9c=_0x3d5f9c||0x1f4;return function(_0x13d83c){logger['error'](_0x13d83c[_0x92ce('0x2b')]);if(_0x13d83c['name']){delete _0x13d83c[_0x92ce('0x2c')];}_0x54938b[_0x92ce('0x1b')](_0x3d5f9c)['send'](_0x13d83c);};}exports[_0x92ce('0x2d')]=function(_0x3dc17b,_0x42f2fe){var _0xdf8aca={},_0xbdd9d4={},_0x478f2e={'count':0x0,'rows':[]};var _0x56358e=_['map'](db['MailQueue'][_0x92ce('0x2e')],function(_0x2e7bb){return{'name':_0x2e7bb[_0x92ce('0x2f')],'type':_0x2e7bb[_0x92ce('0x30')][_0x92ce('0x31')]};});_0xbdd9d4[_0x92ce('0x32')]=_['map'](_0x56358e,_0x92ce('0x2c'));_0xbdd9d4[_0x92ce('0x33')]=_[_0x92ce('0x34')](_0x3dc17b[_0x92ce('0x33')]);_0xbdd9d4['filters']=_[_0x92ce('0x35')](_0xbdd9d4[_0x92ce('0x32')],_0xbdd9d4[_0x92ce('0x33')]);_0xdf8aca[_0x92ce('0x36')]=_[_0x92ce('0x35')](_0xbdd9d4[_0x92ce('0x32')],qs[_0x92ce('0x37')](_0x3dc17b[_0x92ce('0x33')][_0x92ce('0x37')]));_0xdf8aca[_0x92ce('0x36')]=_0xdf8aca[_0x92ce('0x36')]['length']?_0xdf8aca[_0x92ce('0x36')]:_0xbdd9d4[_0x92ce('0x32')];if(!_0x3dc17b[_0x92ce('0x33')]['hasOwnProperty']('nolimit')){_0xdf8aca['limit']=qs[_0x92ce('0x1f')](_0x3dc17b['query']['limit']);_0xdf8aca[_0x92ce('0x21')]=qs[_0x92ce('0x21')](_0x3dc17b['query'][_0x92ce('0x21')]);}_0xdf8aca['order']=qs[_0x92ce('0x38')](_0x3dc17b[_0x92ce('0x33')]['sort']);_0xdf8aca[_0x92ce('0x39')]=qs[_0x92ce('0x3a')](_[_0x92ce('0x3b')](_0x3dc17b['query'],_0xbdd9d4[_0x92ce('0x3a')]),_0x56358e);if(_0x3dc17b[_0x92ce('0x33')][_0x92ce('0x3c')]){_0xdf8aca[_0x92ce('0x39')]=_[_0x92ce('0x3d')](_0xdf8aca['where'],{'$or':_[_0x92ce('0x3e')](_0x56358e,function(_0x1f4088){if(_0x1f4088['type']!==_0x92ce('0x3f')){var _0x314a11={};_0x314a11[_0x1f4088['name']]={'$like':'%'+_0x3dc17b['query'][_0x92ce('0x3c')]+'%'};return _0x314a11;}})});}_0xdf8aca=_[_0x92ce('0x3d')]({},_0xdf8aca,_0x3dc17b[_0x92ce('0x40')]);var _0x10fc7c={'where':_0xdf8aca['where']};return db[_0x92ce('0x41')][_0x92ce('0x20')](_0x10fc7c)[_0x92ce('0x26')](function(_0x18f83d){_0x478f2e[_0x92ce('0x20')]=_0x18f83d;if(_0x3dc17b['query'][_0x92ce('0x42')]){_0xdf8aca[_0x92ce('0x43')]=[{'all':!![]}];}return db[_0x92ce('0x41')][_0x92ce('0x44')](_0xdf8aca);})['then'](function(_0x1ebe33){_0x478f2e[_0x92ce('0x45')]=_0x1ebe33;return _0x478f2e;})[_0x92ce('0x26')](respondWithFilteredResult(_0x42f2fe,_0xdf8aca))[_0x92ce('0x46')](handleError(_0x42f2fe,null));};exports[_0x92ce('0x47')]=function(_0x21af2e,_0x3cdddc){var _0x4ee99e={'raw':!![],'where':{'id':_0x21af2e[_0x92ce('0x48')]['id']}},_0x256d2d={};_0x256d2d['model']=_[_0x92ce('0x34')](db[_0x92ce('0x41')]['rawAttributes']);_0x256d2d[_0x92ce('0x33')]=_['keys'](_0x21af2e['query']);_0x256d2d[_0x92ce('0x3a')]=_[_0x92ce('0x35')](_0x256d2d[_0x92ce('0x32')],_0x256d2d[_0x92ce('0x33')]);_0x4ee99e[_0x92ce('0x36')]=_[_0x92ce('0x35')](_0x256d2d[_0x92ce('0x32')],qs['fields'](_0x21af2e[_0x92ce('0x33')]['fields']));_0x4ee99e[_0x92ce('0x36')]=_0x4ee99e[_0x92ce('0x36')][_0x92ce('0x49')]?_0x4ee99e[_0x92ce('0x36')]:_0x256d2d['model'];if(_0x21af2e[_0x92ce('0x33')][_0x92ce('0x42')]){_0x4ee99e[_0x92ce('0x43')]=[{'all':!![]}];}_0x4ee99e=_['merge']({},_0x4ee99e,_0x21af2e['options']);return db[_0x92ce('0x41')][_0x92ce('0x4a')](_0x4ee99e)[_0x92ce('0x26')](handleEntityNotFound(_0x3cdddc,null))[_0x92ce('0x26')](respondWithResult(_0x3cdddc,null))[_0x92ce('0x46')](handleError(_0x3cdddc,null));};exports['create']=function(_0x5da4ea,_0x290a9e){return db[_0x92ce('0x41')][_0x92ce('0x4b')](_0x5da4ea[_0x92ce('0x4c')],{})[_0x92ce('0x26')](function(_0x2e4898){var _0x38e9f0=_0x5da4ea[_0x92ce('0x4d')][_0x92ce('0x28')]({'plain':!![]});if(!_0x38e9f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38e9f0[_0x92ce('0x4e')]===_0x92ce('0x4d')){var _0x239918=_0x2e4898[_0x92ce('0x28')]({'plain':!![]});var _0x26e9db=_0x92ce('0x29');return db[_0x92ce('0x4f')][_0x92ce('0x4a')]({'where':{'name':_0x26e9db,'userProfileId':_0x38e9f0[_0x92ce('0x50')]},'raw':!![]})[_0x92ce('0x26')](function(_0x2131aa){if(_0x2131aa&&_0x2131aa[_0x92ce('0x51')]===0x0){return db[_0x92ce('0x2a')]['create']({'name':_0x239918[_0x92ce('0x2c')],'resourceId':_0x239918['id'],'type':_0x2131aa[_0x92ce('0x2c')],'sectionId':_0x2131aa['id']},{})[_0x92ce('0x26')](function(){return _0x2e4898;});}else{return _0x2e4898;}})[_0x92ce('0x46')](function(_0x306c6e){logger['error'](_0x92ce('0x52'),_0x306c6e);throw _0x306c6e;});}return _0x2e4898;})[_0x92ce('0x26')](respondWithResult(_0x290a9e,0xc9))[_0x92ce('0x46')](handleError(_0x290a9e,null));};exports[_0x92ce('0x25')]=function(_0x40bf14,_0xeaa3a3){if(_0x40bf14[_0x92ce('0x4c')]['id']){delete _0x40bf14[_0x92ce('0x4c')]['id'];}return db[_0x92ce('0x41')]['find']({'where':{'id':_0x40bf14[_0x92ce('0x48')]['id']}})['then'](handleEntityNotFound(_0xeaa3a3,null))[_0x92ce('0x26')](saveUpdates(_0x40bf14[_0x92ce('0x4c')],null))['then'](respondWithResult(_0xeaa3a3,null))[_0x92ce('0x46')](handleError(_0xeaa3a3,null));};exports[_0x92ce('0x27')]=function(_0x384013,_0xf9233d){return db[_0x92ce('0x41')][_0x92ce('0x4a')]({'where':{'id':_0x384013[_0x92ce('0x48')]['id']}})[_0x92ce('0x26')](handleEntityNotFound(_0xf9233d,null))['then'](removeEntity(_0xf9233d,null))[_0x92ce('0x46')](handleError(_0xf9233d,null));};exports[_0x92ce('0x53')]=function(_0x3d757e,_0x5a15ca){return db['MailQueue'][_0x92ce('0x53')]()[_0x92ce('0x26')](respondWithResult(_0x5a15ca,null))[_0x92ce('0x46')](handleError(_0x5a15ca,null));};exports[_0x92ce('0x54')]=function(_0x344955,_0x4101ef,_0x3b8268){var _0x43e07d={'raw':!![],'where':{}},_0x58db5d={},_0x5493aa;return db[_0x92ce('0x41')]['findOne']({'where':{'id':_0x344955['params']['id']}})[_0x92ce('0x26')](handleEntityNotFound(_0x4101ef,null))['then'](function(_0x103268){if(_0x103268){_0x5493aa=_0x103268[_0x92ce('0x28')]({'plain':!![]});_0x58db5d[_0x92ce('0x32')]=_[_0x92ce('0x34')](db[_0x92ce('0x55')][_0x92ce('0x2e')]);_0x58db5d[_0x92ce('0x33')]=_[_0x92ce('0x34')](_0x344955[_0x92ce('0x33')]);_0x58db5d[_0x92ce('0x3a')]=_[_0x92ce('0x35')](_0x58db5d[_0x92ce('0x32')],_0x58db5d[_0x92ce('0x33')]);_0x43e07d['attributes']=_[_0x92ce('0x35')](_0x58db5d['model'],qs[_0x92ce('0x37')](_0x344955[_0x92ce('0x33')][_0x92ce('0x37')]));_0x43e07d[_0x92ce('0x36')]=_0x43e07d[_0x92ce('0x36')][_0x92ce('0x49')]?_0x43e07d[_0x92ce('0x36')]:_0x58db5d['model'];if(!_0x344955[_0x92ce('0x33')][_0x92ce('0x56')](_0x92ce('0x57'))){_0x43e07d[_0x92ce('0x1f')]=qs['limit'](_0x344955['query'][_0x92ce('0x1f')]);_0x43e07d[_0x92ce('0x21')]=qs[_0x92ce('0x21')](_0x344955[_0x92ce('0x33')][_0x92ce('0x21')]);}_0x43e07d[_0x92ce('0x58')]=qs[_0x92ce('0x38')](_0x344955['query']['sort']);_0x43e07d['where']=qs['filters'](_[_0x92ce('0x3b')](_0x344955[_0x92ce('0x33')],_0x58db5d[_0x92ce('0x3a')]));_0x43e07d[_0x92ce('0x39')][_0x92ce('0x59')]=_0x103268['id'];if(_0x344955['query'][_0x92ce('0x3c')]){_0x43e07d[_0x92ce('0x39')]=_[_0x92ce('0x3d')](_0x43e07d[_0x92ce('0x39')],{'$or':_[_0x92ce('0x3e')](_0x43e07d[_0x92ce('0x36')],function(_0x5baff3){var _0x1cc9c2={};_0x1cc9c2[_0x5baff3]={'$like':'%'+_0x344955[_0x92ce('0x33')][_0x92ce('0x3c')]+'%'};return _0x1cc9c2;})});}_0x43e07d=_[_0x92ce('0x3d')]({},_0x43e07d,_0x344955[_0x92ce('0x40')]);return db[_0x92ce('0x55')][_0x92ce('0x44')](_0x43e07d);}})[_0x92ce('0x26')](function(_0x535fe0){if(_0x535fe0){return db[_0x92ce('0x5a')][_0x92ce('0x5b')]({'where':{'id':_[_0x92ce('0x3e')](_0x535fe0,_0x92ce('0x5c')),'role':_0x92ce('0x5d')},'attributes':['id','name',_0x92ce('0x5e'),_0x92ce('0x5f'),_0x92ce('0x60')]});}})[_0x92ce('0x26')](function(_0x5a94ca){if(_0x5a94ca){return{'count':_0x5a94ca[_0x92ce('0x20')],'rows':_[_0x92ce('0x3e')](_0x5a94ca[_0x92ce('0x45')],function(_0x3536d6){return{'membername':_0x3536d6['name'],'UserId':_0x3536d6['id'],'queue_name':_0x5493aa[_0x92ce('0x2c')],'MailQueueId':_0x5493aa['id'],'interface':util['format']('%s/%s','SIP',_0x3536d6['name']),'penalty':0x0,'paused':_0x3536d6[_0x92ce('0x5e')],'createdAt':_0x3536d6[_0x92ce('0x60')],'updatedAt':_0x3536d6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x92ce('0x26')](respondWithFilteredResult(_0x4101ef,_0x43e07d))[_0x92ce('0x46')](handleError(_0x4101ef,null));};exports[_0x92ce('0x61')]=function(_0x5b9b33,_0x4ffa89,_0x28a4b4){var _0xa21601={};var _0x22aa8e={};var _0x5dc118;var _0x57c0d6;return db[_0x92ce('0x41')]['findOne']({'where':{'id':_0x5b9b33[_0x92ce('0x48')]['id']}})[_0x92ce('0x26')](handleEntityNotFound(_0x4ffa89,null))['then'](function(_0x1ef4a2){if(_0x1ef4a2){_0x5dc118=_0x1ef4a2;_0x22aa8e[_0x92ce('0x32')]=_[_0x92ce('0x34')](db['Team'][_0x92ce('0x2e')]);_0x22aa8e[_0x92ce('0x33')]=_[_0x92ce('0x34')](_0x5b9b33[_0x92ce('0x33')]);_0x22aa8e[_0x92ce('0x3a')]=_[_0x92ce('0x35')](_0x22aa8e[_0x92ce('0x32')],_0x22aa8e[_0x92ce('0x33')]);_0xa21601['attributes']=_[_0x92ce('0x35')](_0x22aa8e[_0x92ce('0x32')],qs['fields'](_0x5b9b33[_0x92ce('0x33')][_0x92ce('0x37')]));_0xa21601[_0x92ce('0x36')]=_0xa21601['attributes'][_0x92ce('0x49')]?_0xa21601[_0x92ce('0x36')]:_0x22aa8e[_0x92ce('0x32')];_0xa21601[_0x92ce('0x58')]=qs[_0x92ce('0x38')](_0x5b9b33[_0x92ce('0x33')]['sort']);_0xa21601['where']=qs[_0x92ce('0x3a')](_[_0x92ce('0x3b')](_0x5b9b33['query'],_0x22aa8e[_0x92ce('0x3a')]));if(_0x5b9b33['query']['filter']){_0xa21601[_0x92ce('0x39')]=_[_0x92ce('0x3d')](_0xa21601[_0x92ce('0x39')],{'$or':_['map'](_0xa21601[_0x92ce('0x36')],function(_0xf55c98){var _0x48e96b={};_0x48e96b[_0xf55c98]={'$like':'%'+_0x5b9b33[_0x92ce('0x33')][_0x92ce('0x3c')]+'%'};return _0x48e96b;})});}_0xa21601=_['merge']({},_0xa21601,_0x5b9b33[_0x92ce('0x40')]);return _0x5dc118['getTeams'](_0xa21601);}})[_0x92ce('0x26')](function(_0x401208){if(_0x401208){_0x57c0d6=_0x401208[_0x92ce('0x49')];if(!_0x5b9b33['query'][_0x92ce('0x56')]('nolimit')){_0xa21601[_0x92ce('0x1f')]=qs[_0x92ce('0x1f')](_0x5b9b33['query'][_0x92ce('0x1f')]);_0xa21601[_0x92ce('0x21')]=qs[_0x92ce('0x21')](_0x5b9b33[_0x92ce('0x33')][_0x92ce('0x21')]);}return _0x5dc118[_0x92ce('0x61')](_0xa21601);}})[_0x92ce('0x26')](function(_0x10edbf){if(_0x10edbf){return _0x10edbf?{'count':_0x57c0d6,'rows':_0x10edbf}:null;}})[_0x92ce('0x26')](respondWithResult(_0x4ffa89,null))[_0x92ce('0x46')](handleError(_0x4ffa89,null));};exports[_0x92ce('0x62')]=function(_0x109bc2,_0xef942b,_0x3c6ddb){var _0x22d2bd=_0x109bc2[_0x92ce('0x4c')][_0x92ce('0x63')];return db[_0x92ce('0x64')][_0x92ce('0x44')]({'where':{'id':_0x22d2bd},'attributes':['id'],'include':[{'model':db[_0x92ce('0x5a')],'as':_0x92ce('0x65'),'attributes':['id','name',_0x92ce('0x66'),'voicePause',_0x92ce('0x67')],'raw':!![]}]})['then'](function(_0xf080b7){if(_0xf080b7){var _0x3bc891=_[_0x92ce('0x68')](_0xf080b7,function(_0x1602c1){var _0x2049f1=_0x1602c1[_0x92ce('0x28')]({'plain':!![]});return _0x2049f1['Agents'];});return db[_0x92ce('0x41')][_0x92ce('0x4a')]({'where':{'id':_0x109bc2[_0x92ce('0x48')]['id']}})[_0x92ce('0x26')](function(_0x268a63){return db['sequelize'][_0x92ce('0x69')](function(_0x4a7ff5){return _0x268a63[_0x92ce('0x62')](_0x22d2bd,{'transaction':_0x4a7ff5})[_0x92ce('0x26')](function(){return BPromise[_0x92ce('0x6a')](_0x3bc891,function(_0x47c676){return db[_0x92ce('0x55')]['findOrCreate']({'where':{'UserId':_0x47c676['id'],'MailQueueId':_0x109bc2['params']['id']},'transaction':_0x4a7ff5});});})['then'](function(){_0x3bc891['forEach'](function(_0x8386c8){socket[_0x92ce('0x6b')](_0x92ce('0x6c'),{'UserId':_0x8386c8['id'],'MailQueueId':_0x268a63['id']});});});});});}})[_0x92ce('0x26')](respondWithStatusCode(_0xef942b,null))[_0x92ce('0x46')](handleError(_0xef942b,null));};exports[_0x92ce('0x6d')]=function(_0x1bf70b,_0x4d1cf0,_0x27aa67){return db[_0x92ce('0x64')][_0x92ce('0x44')]({'where':{'id':_0x1bf70b[_0x92ce('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x92ce('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x92ce('0x26')](handleEntityNotFound(_0x4d1cf0,null))[_0x92ce('0x26')](function(_0x229251){var _0x41a1ca=_[_0x92ce('0x3e')](_0x229251,'id');var _0x186aef=[];var _0x4d574d=[];var _0x4ab538=squel[_0x92ce('0x6e')]();_0x4ab538[_0x92ce('0x6f')](_0x92ce('0x70'))[_0x92ce('0x71')](_0x92ce('0x72'),'tq')['join']('user_has_teams','ut',_0x92ce('0x73'))['where']('MailQueueId\x20=\x20?',_0x1bf70b['params']['id']);for(var _0x28887d=0x0;_0x28887d<_0x229251[_0x92ce('0x49')];_0x28887d+=0x1){let _0x1b98dc=_0x229251[_0x28887d];for(var _0x4e06ea=0x0;_0x4e06ea<_0x1b98dc['Agents'][_0x92ce('0x49')];_0x4e06ea+=0x1){let _0x1741fa=_0x1b98dc[_0x92ce('0x65')][_0x4e06ea];var _0x4c222e=_0x4ab538[_0x92ce('0x74')]();_0x4c222e[_0x92ce('0x39')](_0x92ce('0x75'),_0x1741fa['id']);_0x4d574d[_0x92ce('0x76')](db[_0x92ce('0x77')][_0x92ce('0x33')](_0x4c222e[_0x92ce('0x78')](),{'type':db[_0x92ce('0x77')]['QueryTypes'][_0x92ce('0x79')]})[_0x92ce('0x26')](function(_0x1907f4){if(_0x1907f4[_0x92ce('0x49')]===0x1){return _0x1741fa['id'];}else{var _0x12112d=_[_0x92ce('0x7a')](_['map'](_0x1907f4,_0x92ce('0x7b')),function(_0x43ceb5){return _[_0x92ce('0x7c')](_0x41a1ca,_0x43ceb5);});if(_0x12112d){return _0x1741fa['id'];}}}));}}return BPromise['all'](_0x4d574d)['then'](function(_0x39e4eb){_0x186aef=_(_0x186aef)[_0x92ce('0x7d')](_0x39e4eb)[_0x92ce('0x7e')]()[_0x92ce('0x7f')]();return db[_0x92ce('0x41')]['find']({'where':{'id':_0x1bf70b[_0x92ce('0x48')]['id']}})[_0x92ce('0x26')](function(_0x433004){return db[_0x92ce('0x77')][_0x92ce('0x69')](function(_0x1e5117){return _0x433004[_0x92ce('0x6d')](_0x1bf70b[_0x92ce('0x33')][_0x92ce('0x63')],{'transaction':_0x1e5117})[_0x92ce('0x26')](function(){if(!_[_0x92ce('0x80')](_0x186aef)){return _0x433004[_0x92ce('0x81')](_0x186aef,{'transaction':_0x1e5117});}})['then'](function(){_0x186aef['forEach'](function(_0x59ff7f){socket[_0x92ce('0x6b')](_0x92ce('0x82'),{'UserId':_0x59ff7f,'MailQueueId':_0x433004['id']});});});});});});})[_0x92ce('0x26')](respondWithStatusCode(_0x4d1cf0,null))[_0x92ce('0x46')](handleError(_0x4d1cf0,null));};exports['addAgents']=function(_0x5a791b,_0x5c1962,_0x1842d6){return db[_0x92ce('0x41')]['find']({'where':{'id':_0x5a791b[_0x92ce('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c1962,null))['then'](function(_0x4c0db8){if(_0x4c0db8){return _0x4c0db8[_0x92ce('0x83')](_0x5a791b[_0x92ce('0x4c')]['ids'],_[_0x92ce('0x84')](_0x5a791b['body'],[_0x92ce('0x63'),'id'])||{})[_0x92ce('0x85')](function(_0x2391d3){for(var _0x3ae041=0x0;_0x3ae041<_0x5a791b[_0x92ce('0x4c')][_0x92ce('0x63')]['length'];_0x3ae041+=0x1){socket[_0x92ce('0x6b')]('userMailQueue:save',{'UserId':Number(_0x5a791b[_0x92ce('0x4c')][_0x92ce('0x63')][_0x3ae041]),'MailQueueId':Number(_0x5a791b[_0x92ce('0x48')]['id'])});}return _0x2391d3;});}})[_0x92ce('0x26')](respondWithResult(_0x5c1962,null))[_0x92ce('0x46')](handleError(_0x5c1962,null));};exports[_0x92ce('0x81')]=function(_0x32a528,_0x53c473,_0x12cec0){return db[_0x92ce('0x41')][_0x92ce('0x4a')]({'where':{'id':_0x32a528[_0x92ce('0x48')]['id']}})[_0x92ce('0x26')](handleEntityNotFound(_0x53c473,null))[_0x92ce('0x26')](function(_0x5c4f14){if(_0x5c4f14){return _0x5c4f14[_0x92ce('0x81')](_0x32a528[_0x92ce('0x33')]['ids'])['then'](function(){if(_[_0x92ce('0x86')](_0x32a528['query'][_0x92ce('0x63')])){for(var _0x4905a3=0x0;_0x4905a3<_0x32a528['query'][_0x92ce('0x63')]['length'];_0x4905a3+=0x1){socket[_0x92ce('0x6b')](_0x92ce('0x82'),{'UserId':Number(_0x32a528[_0x92ce('0x33')][_0x92ce('0x63')][_0x4905a3]),'MailQueueId':Number(_0x32a528[_0x92ce('0x48')]['id'])});}}else{socket[_0x92ce('0x6b')](_0x92ce('0x82'),{'UserId':Number(_0x32a528['query'][_0x92ce('0x63')]),'MailQueueId':Number(_0x32a528['params']['id'])});}});}})[_0x92ce('0x26')](respondWithStatusCode(_0x53c473,null))[_0x92ce('0x46')](handleError(_0x53c473,null));};exports[_0x92ce('0x87')]=function(_0x491b81,_0x29461b,_0x40b1db){var _0x5aeed6={};var _0x4e9c9c={};var _0xa2c11d;var _0x4bed85;return db[_0x92ce('0x41')][_0x92ce('0x88')]({'where':{'id':_0x491b81[_0x92ce('0x48')]['id']}})[_0x92ce('0x26')](handleEntityNotFound(_0x29461b,null))[_0x92ce('0x26')](function(_0x5f2a07){if(_0x5f2a07){_0xa2c11d=_0x5f2a07;_0x4e9c9c[_0x92ce('0x32')]=_[_0x92ce('0x34')](db['User'][_0x92ce('0x2e')]);_0x4e9c9c[_0x92ce('0x33')]=_[_0x92ce('0x34')](_0x491b81[_0x92ce('0x33')]);_0x4e9c9c[_0x92ce('0x3a')]=_[_0x92ce('0x35')](_0x4e9c9c['model'],_0x4e9c9c[_0x92ce('0x33')]);_0x5aeed6['attributes']=_[_0x92ce('0x35')](_0x4e9c9c[_0x92ce('0x32')],qs[_0x92ce('0x37')](_0x491b81[_0x92ce('0x33')]['fields']));_0x5aeed6[_0x92ce('0x36')]=_0x5aeed6[_0x92ce('0x36')][_0x92ce('0x49')]?_0x5aeed6[_0x92ce('0x36')]:_0x4e9c9c[_0x92ce('0x32')];_0x5aeed6[_0x92ce('0x58')]=qs[_0x92ce('0x38')](_0x491b81[_0x92ce('0x33')][_0x92ce('0x38')]);_0x5aeed6['where']=qs[_0x92ce('0x3a')](_[_0x92ce('0x3b')](_0x491b81[_0x92ce('0x33')],_0x4e9c9c[_0x92ce('0x3a')]));if(_0x491b81[_0x92ce('0x33')][_0x92ce('0x3c')]){_0x5aeed6[_0x92ce('0x39')]=_[_0x92ce('0x3d')](_0x5aeed6[_0x92ce('0x39')],{'$or':_[_0x92ce('0x3e')](_0x5aeed6[_0x92ce('0x36')],function(_0x3e2de7){var _0x14b9e0={};_0x14b9e0[_0x3e2de7]={'$like':'%'+_0x491b81['query'][_0x92ce('0x3c')]+'%'};return _0x14b9e0;})});}_0x5aeed6=_[_0x92ce('0x3d')]({},_0x5aeed6,_0x491b81['options']);return _0xa2c11d[_0x92ce('0x87')](_0x5aeed6);}})[_0x92ce('0x26')](function(_0x388d72){if(_0x388d72){_0x4bed85=_0x388d72['length'];if(!_0x491b81[_0x92ce('0x33')][_0x92ce('0x56')](_0x92ce('0x57'))){_0x5aeed6['limit']=qs[_0x92ce('0x1f')](_0x491b81[_0x92ce('0x33')][_0x92ce('0x1f')]);_0x5aeed6[_0x92ce('0x21')]=qs['offset'](_0x491b81['query']['offset']);}return _0xa2c11d[_0x92ce('0x87')](_0x5aeed6);}})['then'](function(_0x115a42){if(_0x115a42){return _0x115a42?{'count':_0x4bed85,'rows':_0x115a42}:null;}})[_0x92ce('0x26')](respondWithResult(_0x29461b,null))[_0x92ce('0x46')](handleError(_0x29461b,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index e4e695a..fa076e2 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 _0xf8dc=['setMaxListeners','save','update','emit','exports','events','../../mysqldb','MailQueue'];(function(_0x29aae5,_0x1c8a1c){var _0x297189=function(_0x1f8216){while(--_0x1f8216){_0x29aae5['push'](_0x29aae5['shift']());}};_0x297189(++_0x1c8a1c);}(_0xf8dc,0xd5));var _0xcf8d=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xf8dc[_0x1b349a];return _0x5d1f7c;};'use strict';var EventEmitter=require(_0xcf8d('0x0'));var MailQueue=require(_0xcf8d('0x1'))['db'][_0xcf8d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcf8d('0x3')](0x0);var events={'afterCreate':_0xcf8d('0x4'),'afterUpdate':_0xcf8d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a9984){return function(_0x1359ac,_0x529a70,_0x3da020){MailQueueEvents['emit'](_0x1a9984+':'+_0x1359ac['id'],_0x1359ac);MailQueueEvents[_0xcf8d('0x6')](_0x1a9984,_0x1359ac);_0x3da020(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xcf8d('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xca24=['setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb','MailQueue'];(function(_0x2918a2,_0x255bd5){var _0x39828a=function(_0x659fc6){while(--_0x659fc6){_0x2918a2['push'](_0x2918a2['shift']());}};_0x39828a(++_0x255bd5);}(_0xca24,0x16e));var _0x4ca2=function(_0x28d2b0,_0x4f0ee8){_0x28d2b0=_0x28d2b0-0x0;var _0x175511=_0xca24[_0x28d2b0];return _0x175511;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x4ca2('0x0'))['db'][_0x4ca2('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4ca2('0x2')](0x0);var events={'afterCreate':_0x4ca2('0x3'),'afterUpdate':_0x4ca2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1905a4){return function(_0x544741,_0x3c6bcb,_0x37470a){MailQueueEvents[_0x4ca2('0x5')](_0x1905a4+':'+_0x544741['id'],_0x544741);MailQueueEvents[_0x4ca2('0x5')](_0x1905a4,_0x544741);_0x37470a(null);};}for(var e in events){if(events[_0x4ca2('0x6')](e)){var event=events[e];MailQueue[_0x4ca2('0x7')](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 cd860fa..f2f3142 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 _0x7e00=['exports','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x48e86c,_0x9f034d){var _0x54fa11=function(_0x199705){while(--_0x199705){_0x48e86c['push'](_0x48e86c['shift']());}};_0x54fa11(++_0x9f034d);}(_0x7e00,0x18e));var _0x07e0=function(_0x42b192,_0x36c475){_0x42b192=_0x42b192-0x0;var _0x142439=_0x7e00[_0x42b192];return _0x142439;};'use strict';var _=require(_0x07e0('0x0'));var util=require(_0x07e0('0x1'));var logger=require('../../config/logger')(_0x07e0('0x2'));var moment=require(_0x07e0('0x3'));var BPromise=require(_0x07e0('0x4'));var rp=require(_0x07e0('0x5'));var fs=require('fs');var path=require(_0x07e0('0x6'));var rimraf=require(_0x07e0('0x7'));var config=require(_0x07e0('0x8'));var attributes=require('./mailQueue.attributes');module[_0x07e0('0x9')]=function(_0x424ede,_0x2fe95e){return _0x424ede[_0x07e0('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ad4=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x18ecf7,_0x34f6bc){var _0x5a7f4e=function(_0x591fc2){while(--_0x591fc2){_0x18ecf7['push'](_0x18ecf7['shift']());}};_0x5a7f4e(++_0x34f6bc);}(_0x4ad4,0x15f));var _0x44ad=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x4ad4[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44ad('0x0'))(_0x44ad('0x1'));var moment=require(_0x44ad('0x2'));var BPromise=require(_0x44ad('0x3'));var rp=require(_0x44ad('0x4'));var fs=require('fs');var path=require(_0x44ad('0x5'));var rimraf=require('rimraf');var config=require(_0x44ad('0x6'));var attributes=require('./mailQueue.attributes');module[_0x44ad('0x7')]=function(_0x37c0e3,_0x3bf429){return _0x37c0e3[_0x44ad('0x8')]('MailQueue',attributes,{'tableName':'mail_queues','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 97ec90b..0f840fe 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 _0x41cb=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','MailQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetMailQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowMailQueue','MailQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x184b9c,_0x28e9d8){var _0x518056=function(_0x11f0c9){while(--_0x11f0c9){_0x184b9c['push'](_0x184b9c['shift']());}};_0x518056(++_0x28e9d8);}(_0x41cb,0x1e6));var _0xb41c=function(_0x42df42,_0x25ae30){_0x42df42=_0x42df42-0x0;var _0x1f8dd0=_0x41cb[_0x42df42];return _0x1f8dd0;};'use strict';var _=require(_0xb41c('0x0'));var util=require(_0xb41c('0x1'));var moment=require('moment');var BPromise=require(_0xb41c('0x2'));var rs=require(_0xb41c('0x3'));var fs=require('fs');var Redis=require(_0xb41c('0x4'));var db=require(_0xb41c('0x5'))['db'];var utils=require(_0xb41c('0x6'));var logger=require('../../config/logger')(_0xb41c('0x7'));var config=require(_0xb41c('0x8'));var jayson=require(_0xb41c('0x9'));var client=jayson[_0xb41c('0xa')][_0xb41c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb41c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb41c('0xd'))(new Redis(config['redis']));require(_0xb41c('0xe'))[_0xb41c('0xf')](socket);function respondWithRpcPromise(_0x23a910,_0x20165e,_0x274d4){return new BPromise(function(_0x560d68,_0x5e4a3d){return client[_0xb41c('0x10')](_0x23a910,_0x274d4)[_0xb41c('0x11')](function(_0x1f0c9e){logger[_0xb41c('0x12')]('MailQueue,\x20%s,\x20%s',_0x20165e,'request\x20sent');logger['debug'](_0xb41c('0x13'),_0x20165e,'request\x20sent',JSON[_0xb41c('0x14')](_0x1f0c9e));if(_0x1f0c9e['error']){if(_0x1f0c9e['error'][_0xb41c('0x15')]===0x1f4){logger[_0xb41c('0x16')](_0xb41c('0x17'),_0x20165e,_0x1f0c9e[_0xb41c('0x16')][_0xb41c('0x18')]);return _0x5e4a3d(_0x1f0c9e['error'][_0xb41c('0x18')]);}logger[_0xb41c('0x16')](_0xb41c('0x17'),_0x20165e,_0x1f0c9e[_0xb41c('0x16')][_0xb41c('0x18')]);return _0x560d68(_0x1f0c9e['error'][_0xb41c('0x18')]);}else{logger[_0xb41c('0x12')](_0xb41c('0x17'),_0x20165e,_0xb41c('0x19'));_0x560d68(_0x1f0c9e[_0xb41c('0x1a')]['message']);}})[_0xb41c('0x1b')](function(_0x43b56a){logger[_0xb41c('0x16')](_0xb41c('0x17'),_0x20165e,_0x43b56a);_0x5e4a3d(_0x43b56a);});});}exports[_0xb41c('0x1c')]=function(_0x48fdcc){var _0x29c0d=this;return new Promise(function(_0x335f12,_0x333b81){return db['MailQueue']['findAll']({'raw':_0x48fdcc[_0xb41c('0x1d')]?_0x48fdcc['options'][_0xb41c('0x1e')]===undefined?!![]:![]:!![],'where':_0x48fdcc['options']?_0x48fdcc[_0xb41c('0x1d')][_0xb41c('0x1f')]||null:null,'attributes':_0x48fdcc[_0xb41c('0x1d')]?_0x48fdcc[_0xb41c('0x1d')][_0xb41c('0x20')]||null:null,'limit':_0x48fdcc[_0xb41c('0x1d')]?_0x48fdcc[_0xb41c('0x1d')][_0xb41c('0x21')]||null:null,'include':_0x48fdcc['options']?_0x48fdcc[_0xb41c('0x1d')][_0xb41c('0x22')]?_[_0xb41c('0x23')](_0x48fdcc[_0xb41c('0x1d')][_0xb41c('0x22')],function(_0x2a75a5){return{'model':db[_0x2a75a5[_0xb41c('0x24')]],'as':_0x2a75a5['as'],'attributes':_0x2a75a5[_0xb41c('0x20')],'include':_0x2a75a5['include']?_['map'](_0x2a75a5[_0xb41c('0x22')],function(_0x4f0b90){return{'model':db[_0x4f0b90[_0xb41c('0x24')]],'as':_0x4f0b90['as'],'attributes':_0x4f0b90[_0xb41c('0x20')],'include':_0x4f0b90[_0xb41c('0x22')]?_[_0xb41c('0x23')](_0x4f0b90[_0xb41c('0x22')],function(_0x4487f9){return{'model':db[_0x4487f9[_0xb41c('0x24')]],'as':_0x4487f9['as'],'attributes':_0x4487f9[_0xb41c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb41c('0x11')](function(_0xaef73b){logger[_0xb41c('0x12')](_0xb41c('0x1c'),_0x48fdcc);logger[_0xb41c('0x25')](_0xb41c('0x1c'),_0x48fdcc,JSON[_0xb41c('0x14')](_0xaef73b));_0x335f12(_0xaef73b);})[_0xb41c('0x1b')](function(_0xf4a53c){logger[_0xb41c('0x16')](_0xb41c('0x1c'),_0xf4a53c[_0xb41c('0x18')],_0x48fdcc);_0x333b81(_0x29c0d['error'](0x1f4,_0xf4a53c[_0xb41c('0x18')]));});});};exports[_0xb41c('0x26')]=function(_0x188b32){var _0x3ab7c5=this;return new Promise(function(_0x1607dc,_0x420379){return db[_0xb41c('0x27')][_0xb41c('0x28')]({'raw':_0x188b32[_0xb41c('0x1d')]?_0x188b32[_0xb41c('0x1d')][_0xb41c('0x1e')]===undefined?!![]:![]:!![],'where':_0x188b32[_0xb41c('0x1d')]?_0x188b32['options'][_0xb41c('0x1f')]||null:null,'attributes':_0x188b32[_0xb41c('0x1d')]?_0x188b32[_0xb41c('0x1d')][_0xb41c('0x20')]||null:null,'include':_0x188b32[_0xb41c('0x1d')]?_0x188b32['options']['include']?_['map'](_0x188b32[_0xb41c('0x1d')][_0xb41c('0x22')],function(_0x9b7b47){return{'model':db[_0x9b7b47[_0xb41c('0x24')]],'as':_0x9b7b47['as'],'attributes':_0x9b7b47[_0xb41c('0x20')],'include':_0x9b7b47[_0xb41c('0x22')]?_[_0xb41c('0x23')](_0x9b7b47['include'],function(_0x4d58e9){return{'model':db[_0x4d58e9[_0xb41c('0x24')]],'as':_0x4d58e9['as'],'attributes':_0x4d58e9[_0xb41c('0x20')],'include':_0x4d58e9[_0xb41c('0x22')]?_[_0xb41c('0x23')](_0x4d58e9[_0xb41c('0x22')],function(_0x349e3e){return{'model':db[_0x349e3e[_0xb41c('0x24')]],'as':_0x349e3e['as'],'attributes':_0x349e3e[_0xb41c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb41c('0x11')](function(_0x5bb48e){logger['info'](_0xb41c('0x26'),_0x188b32);logger[_0xb41c('0x25')](_0xb41c('0x26'),_0x188b32,JSON[_0xb41c('0x14')](_0x5bb48e));_0x1607dc(_0x5bb48e);})['catch'](function(_0x3753aa){logger[_0xb41c('0x16')]('ShowMailQueue',_0x3753aa[_0xb41c('0x18')],_0x188b32);_0x420379(_0x3ab7c5['error'](0x1f4,_0x3753aa[_0xb41c('0x18')]));});});}; \ No newline at end of file +var _0xb01a=['../../config/environment','redis','localhost','socket.io-emitter','./mailQueue.socket','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','info','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x414cfe,_0x13a252){var _0x5bf4f0=function(_0x166946){while(--_0x166946){_0x414cfe['push'](_0x414cfe['shift']());}};_0x5bf4f0(++_0x13a252);}(_0xb01a,0xe0));var _0xab01=function(_0x3ed4d7,_0x3783e0){_0x3ed4d7=_0x3ed4d7-0x0;var _0x2be1a4=_0xb01a[_0x3ed4d7];return _0x2be1a4;};'use strict';var _=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var moment=require(_0xab01('0x2'));var BPromise=require(_0xab01('0x3'));var rs=require(_0xab01('0x4'));var fs=require('fs');var Redis=require(_0xab01('0x5'));var db=require(_0xab01('0x6'))['db'];var utils=require(_0xab01('0x7'));var logger=require(_0xab01('0x8'))(_0xab01('0x9'));var config=require(_0xab01('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xab01('0xb')]=_['defaults'](config[_0xab01('0xb')],{'host':_0xab01('0xc'),'port':0x18eb});var socket=require(_0xab01('0xd'))(new Redis(config[_0xab01('0xb')]));require(_0xab01('0xe'))['register'](socket);function respondWithRpcPromise(_0x8db7eb,_0x3ee077,_0x428412){return new BPromise(function(_0x355c13,_0x440bae){return client[_0xab01('0xf')](_0x8db7eb,_0x428412)['then'](function(_0x1bad5e){logger['info'](_0xab01('0x10'),_0x3ee077,_0xab01('0x11'));logger[_0xab01('0x12')](_0xab01('0x13'),_0x3ee077,_0xab01('0x11'),JSON[_0xab01('0x14')](_0x1bad5e));if(_0x1bad5e[_0xab01('0x15')]){if(_0x1bad5e['error'][_0xab01('0x16')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x3ee077,_0x1bad5e[_0xab01('0x15')][_0xab01('0x17')]);return _0x440bae(_0x1bad5e[_0xab01('0x15')]['message']);}logger[_0xab01('0x15')](_0xab01('0x10'),_0x3ee077,_0x1bad5e['error'][_0xab01('0x17')]);return _0x355c13(_0x1bad5e['error'][_0xab01('0x17')]);}else{logger['info'](_0xab01('0x10'),_0x3ee077,'request\x20sent');_0x355c13(_0x1bad5e['result'][_0xab01('0x17')]);}})[_0xab01('0x18')](function(_0x12f6cd){logger['error']('MailQueue,\x20%s,\x20%s',_0x3ee077,_0x12f6cd);_0x440bae(_0x12f6cd);});});}exports[_0xab01('0x19')]=function(_0x19508b){var _0x5e78bc=this;return new Promise(function(_0x3a9d02,_0x45afbf){return db[_0xab01('0x1a')][_0xab01('0x1b')]({'raw':_0x19508b['options']?_0x19508b[_0xab01('0x1c')][_0xab01('0x1d')]===undefined?!![]:![]:!![],'where':_0x19508b[_0xab01('0x1c')]?_0x19508b[_0xab01('0x1c')][_0xab01('0x1e')]||null:null,'attributes':_0x19508b[_0xab01('0x1c')]?_0x19508b[_0xab01('0x1c')][_0xab01('0x1f')]||null:null,'limit':_0x19508b[_0xab01('0x1c')]?_0x19508b[_0xab01('0x1c')][_0xab01('0x20')]||null:null,'include':_0x19508b['options']?_0x19508b[_0xab01('0x1c')][_0xab01('0x21')]?_[_0xab01('0x22')](_0x19508b[_0xab01('0x1c')][_0xab01('0x21')],function(_0x30e8f9){return{'model':db[_0x30e8f9[_0xab01('0x23')]],'as':_0x30e8f9['as'],'attributes':_0x30e8f9[_0xab01('0x1f')],'include':_0x30e8f9[_0xab01('0x21')]?_['map'](_0x30e8f9[_0xab01('0x21')],function(_0x9ba56){return{'model':db[_0x9ba56[_0xab01('0x23')]],'as':_0x9ba56['as'],'attributes':_0x9ba56[_0xab01('0x1f')],'include':_0x9ba56[_0xab01('0x21')]?_[_0xab01('0x22')](_0x9ba56['include'],function(_0x38b41a){return{'model':db[_0x38b41a[_0xab01('0x23')]],'as':_0x38b41a['as'],'attributes':_0x38b41a[_0xab01('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xab01('0x24')](function(_0x100375){logger[_0xab01('0x25')]('GetMailQueue',_0x19508b);logger[_0xab01('0x12')](_0xab01('0x19'),_0x19508b,JSON[_0xab01('0x14')](_0x100375));_0x3a9d02(_0x100375);})[_0xab01('0x18')](function(_0x127275){logger[_0xab01('0x15')]('GetMailQueue',_0x127275['message'],_0x19508b);_0x45afbf(_0x5e78bc['error'](0x1f4,_0x127275[_0xab01('0x17')]));});});};exports[_0xab01('0x26')]=function(_0x10ac67){var _0xd90c33=this;return new Promise(function(_0x1cae4f,_0x406e8d){return db[_0xab01('0x1a')]['find']({'raw':_0x10ac67[_0xab01('0x1c')]?_0x10ac67[_0xab01('0x1c')][_0xab01('0x1d')]===undefined?!![]:![]:!![],'where':_0x10ac67['options']?_0x10ac67[_0xab01('0x1c')][_0xab01('0x1e')]||null:null,'attributes':_0x10ac67[_0xab01('0x1c')]?_0x10ac67[_0xab01('0x1c')]['attributes']||null:null,'include':_0x10ac67[_0xab01('0x1c')]?_0x10ac67[_0xab01('0x1c')][_0xab01('0x21')]?_[_0xab01('0x22')](_0x10ac67['options'][_0xab01('0x21')],function(_0x5e6747){return{'model':db[_0x5e6747[_0xab01('0x23')]],'as':_0x5e6747['as'],'attributes':_0x5e6747[_0xab01('0x1f')],'include':_0x5e6747['include']?_[_0xab01('0x22')](_0x5e6747[_0xab01('0x21')],function(_0x461c0c){return{'model':db[_0x461c0c['model']],'as':_0x461c0c['as'],'attributes':_0x461c0c['attributes'],'include':_0x461c0c[_0xab01('0x21')]?_[_0xab01('0x22')](_0x461c0c[_0xab01('0x21')],function(_0xcc2ffb){return{'model':db[_0xcc2ffb[_0xab01('0x23')]],'as':_0xcc2ffb['as'],'attributes':_0xcc2ffb[_0xab01('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xab01('0x24')](function(_0x273601){logger[_0xab01('0x25')](_0xab01('0x26'),_0x10ac67);logger[_0xab01('0x12')](_0xab01('0x26'),_0x10ac67,JSON[_0xab01('0x14')](_0x273601));_0x1cae4f(_0x273601);})['catch'](function(_0x8e7284){logger[_0xab01('0x15')]('ShowMailQueue',_0x8e7284[_0xab01('0x17')],_0x10ac67);_0x406e8d(_0xd90c33[_0xab01('0x15')](0x1f4,_0x8e7284[_0xab01('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9930ac8..c58c137 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 _0x1dc3=['register','length','mailQueue:','./mailQueue.events','save','update','emit','removeListener'];(function(_0x344e70,_0x3bca66){var _0x47447a=function(_0x413f7a){while(--_0x413f7a){_0x344e70['push'](_0x344e70['shift']());}};_0x47447a(++_0x3bca66);}(_0x1dc3,0x13b));var _0x31dc=function(_0x48a924,_0x1f0f90){_0x48a924=_0x48a924-0x0;var _0x288c0d=_0x1dc3[_0x48a924];return _0x288c0d;};'use strict';var MailQueueEvents=require(_0x31dc('0x0'));var events=[_0x31dc('0x1'),'remove',_0x31dc('0x2')];function createListener(_0x7c39f5,_0x36aa96){return function(_0x2c35c4){_0x36aa96[_0x31dc('0x3')](_0x7c39f5,_0x2c35c4);};}function removeListener(_0x435a7a,_0x43a3e0){return function(){MailQueueEvents[_0x31dc('0x4')](_0x435a7a,_0x43a3e0);};}exports[_0x31dc('0x5')]=function(_0x105742){for(var _0x48ef29=0x0,_0x98cd20=events[_0x31dc('0x6')];_0x48ef29<_0x98cd20;_0x48ef29++){var _0x5449b7=events[_0x48ef29];var _0x4f8254=createListener(_0x31dc('0x7')+_0x5449b7,_0x105742);MailQueueEvents['on'](_0x5449b7,_0x4f8254);}}; \ No newline at end of file +var _0xeddd=['register','length','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xeddd,0x1aa));var _0xdedd=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xeddd[_0x51020b];return _0x371e47;};'use strict';var MailQueueEvents=require(_0xdedd('0x0'));var events=[_0xdedd('0x1'),_0xdedd('0x2'),_0xdedd('0x3')];function createListener(_0x4b2b57,_0x39175e){return function(_0x2bbd6f){_0x39175e[_0xdedd('0x4')](_0x4b2b57,_0x2bbd6f);};}function removeListener(_0x396de1,_0x29e64d){return function(){MailQueueEvents[_0xdedd('0x5')](_0x396de1,_0x29e64d);};}exports[_0xdedd('0x6')]=function(_0x141384){for(var _0x2e28a8=0x0,_0x2545d5=events[_0xdedd('0x7')];_0x2e28a8<_0x2545d5;_0x2e28a8++){var _0x5b5617=events[_0x2e28a8];var _0x5aae70=createListener(_0xdedd('0x8')+_0x5b5617,_0x141384);MailQueueEvents['on'](_0x5b5617,_0x5aae70);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 927f674..33ced69 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 _0xc35f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','destroy','exports','multer','util','path','express'];(function(_0x4642a3,_0x34c388){var _0x1c249e=function(_0x253b60){while(--_0x253b60){_0x4642a3['push'](_0x4642a3['shift']());}};_0x1c249e(++_0x34c388);}(_0xc35f,0x176));var _0xfc35=function(_0x4713ed,_0x547d8d){_0x4713ed=_0x4713ed-0x0;var _0x3b62ab=_0xc35f[_0x4713ed];return _0x3b62ab;};'use strict';var multer=require(_0xfc35('0x0'));var util=require(_0xfc35('0x1'));var path=require(_0xfc35('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc35('0x3'));var router=express[_0xfc35('0x4')]();var fs_extra=require(_0xfc35('0x5'));var auth=require(_0xfc35('0x6'));var interaction=require(_0xfc35('0x7'));var config=require('../../config/environment');var controller=require(_0xfc35('0x8'));router['get']('/',auth[_0xfc35('0x9')](),controller[_0xfc35('0xa')]);router[_0xfc35('0xb')](_0xfc35('0xc'),auth[_0xfc35('0x9')](),controller[_0xfc35('0xd')]);router[_0xfc35('0xb')](_0xfc35('0xe'),auth['isAuthenticated'](),controller[_0xfc35('0xf')]);router['post']('/',auth[_0xfc35('0x9')](),controller['create']);router['put'](_0xfc35('0xe'),auth[_0xfc35('0x9')](),controller['update']);router['delete']('/:id',auth[_0xfc35('0x9')](),controller[_0xfc35('0x10')]);module[_0xfc35('0x11')]=router; \ No newline at end of file +var _0x03fd=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x18bccf,_0x515956){var _0x3d07bd=function(_0x394cb2){while(--_0x394cb2){_0x18bccf['push'](_0x18bccf['shift']());}};_0x3d07bd(++_0x515956);}(_0x03fd,0xb4));var _0xd03f=function(_0x4712f9,_0x406bcd){_0x4712f9=_0x4712f9-0x0;var _0x182c1e=_0x03fd[_0x4712f9];return _0x182c1e;};'use strict';var multer=require(_0xd03f('0x0'));var util=require('util');var path=require(_0xd03f('0x1'));var timeout=require(_0xd03f('0x2'));var express=require(_0xd03f('0x3'));var router=express[_0xd03f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd03f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd03f('0x6'));var controller=require(_0xd03f('0x7'));router[_0xd03f('0x8')]('/',auth[_0xd03f('0x9')](),controller[_0xd03f('0xa')]);router[_0xd03f('0x8')](_0xd03f('0xb'),auth['isAuthenticated'](),controller[_0xd03f('0xc')]);router['get'](_0xd03f('0xd'),auth['isAuthenticated'](),controller[_0xd03f('0xe')]);router[_0xd03f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd03f('0x10')](_0xd03f('0xd'),auth['isAuthenticated'](),controller[_0xd03f('0x11')]);router[_0xd03f('0x12')](_0xd03f('0xd'),auth['isAuthenticated'](),controller[_0xd03f('0x13')]);module[_0xd03f('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ae9eefc..99fd91b 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 _0x672d=['STRING','DATE','moment','exports'];(function(_0x401c58,_0x22620d){var _0x2e7943=function(_0x2154f3){while(--_0x2154f3){_0x401c58['push'](_0x401c58['shift']());}};_0x2e7943(++_0x22620d);}(_0x672d,0x166));var _0xd672=function(_0x11fc2c,_0x8dfa82){_0x11fc2c=_0x11fc2c-0x0;var _0x3df667=_0x672d[_0x11fc2c];return _0x3df667;};'use strict';var moment=require(_0xd672('0x0'));var Sequelize=require('sequelize');module[_0xd672('0x1')]={'uniqueid':{'type':Sequelize[_0xd672('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd672('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd672('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd672('0x3')]},'reason':{'type':Sequelize[_0xd672('0x2')]}}; \ No newline at end of file +var _0x0caf=['STRING','DATE','moment','sequelize'];(function(_0xd89ff9,_0x677aa1){var _0x31e848=function(_0x4a7f6c){while(--_0x4a7f6c){_0xd89ff9['push'](_0xd89ff9['shift']());}};_0x31e848(++_0x677aa1);}(_0x0caf,0x8a));var _0xf0ca=function(_0x19f6f4,_0x1c717e){_0x19f6f4=_0x19f6f4-0x0;var _0x557642=_0x0caf[_0x19f6f4];return _0x557642;};'use strict';var moment=require(_0xf0ca('0x0'));var Sequelize=require(_0xf0ca('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf0ca('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf0ca('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf0ca('0x3')]},'acceptAt':{'type':Sequelize[_0xf0ca('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf0ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d70ced0..ff49744 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 _0x93e9=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','MailQueueReport','includeAll','include','findAll','catch','show','params','keys','fields','length','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x25261a,_0x3739bd){var _0x4578c6=function(_0x367b45){while(--_0x367b45){_0x25261a['push'](_0x25261a['shift']());}};_0x4578c6(++_0x3739bd);}(_0x93e9,0xcc));var _0x993e=function(_0x42be13,_0x64e7b9){_0x42be13=_0x42be13-0x0;var _0x248fea=_0x93e9[_0x42be13];return _0x248fea;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];function respondWithStatusCode(_0x5d5c0d,_0x4c2707){_0x4c2707=_0x4c2707||0xcc;return function(_0x31ece2){if(_0x31ece2){return _0x5d5c0d[_0x993e('0x19')](_0x4c2707);}return _0x5d5c0d[_0x993e('0x1a')](_0x4c2707)[_0x993e('0x1b')]();};}function respondWithResult(_0x3e082b,_0x397b42){_0x397b42=_0x397b42||0xc8;return function(_0x34ddda){if(_0x34ddda){return _0x3e082b[_0x993e('0x1a')](_0x397b42)[_0x993e('0x1c')](_0x34ddda);}};}function respondWithFilteredResult(_0xa43a4e,_0x1a7726){return function(_0x135771){if(_0x135771){var _0x3df0e7=typeof _0x1a7726[_0x993e('0x1d')]===_0x993e('0x1e')&&typeof _0x1a7726[_0x993e('0x1f')]===_0x993e('0x1e');var _0x526e06=_0x135771[_0x993e('0x20')];var _0x1acd21=_0x3df0e7?0x0:_0x1a7726[_0x993e('0x1d')];var _0x3d6109=_0x3df0e7?_0x135771[_0x993e('0x20')]:_0x1a7726[_0x993e('0x1d')]+_0x1a7726['limit'];var _0x11cd41;if(_0x3d6109>=_0x526e06){_0x3d6109=_0x526e06;_0x11cd41=0xc8;}else{_0x11cd41=0xce;}_0xa43a4e[_0x993e('0x1a')](_0x11cd41);return _0xa43a4e[_0x993e('0x21')](_0x993e('0x22'),_0x1acd21+'-'+_0x3d6109+'/'+_0x526e06)[_0x993e('0x1c')](_0x135771);}return null;};}function patchUpdates(_0x425ab4){return function(_0x29e48d){try{jsonpatch[_0x993e('0x23')](_0x29e48d,_0x425ab4,!![]);}catch(_0x4bbe9c){return BPromise[_0x993e('0x24')](_0x4bbe9c);}return _0x29e48d['save']();};}function saveUpdates(_0x11f6f4,_0x37ff57){return function(_0x32b09e){if(_0x32b09e){return _0x32b09e['update'](_0x11f6f4)[_0x993e('0x25')](function(_0x13db4e){return _0x13db4e;});}return null;};}function removeEntity(_0xfba00f,_0x1c52fd){return function(_0x3b45ef){if(_0x3b45ef){return _0x3b45ef[_0x993e('0x26')]()[_0x993e('0x25')](function(){_0xfba00f[_0x993e('0x1a')](0xcc)[_0x993e('0x1b')]();});}};}function handleEntityNotFound(_0x18f6ac,_0x3fe099){return function(_0x3603fa){if(!_0x3603fa){_0x18f6ac['sendStatus'](0x194);}return _0x3603fa;};}function handleError(_0x2756a7,_0x279bb8){_0x279bb8=_0x279bb8||0x1f4;return function(_0x52b727){logger[_0x993e('0x27')](_0x52b727['stack']);if(_0x52b727[_0x993e('0x28')]){delete _0x52b727[_0x993e('0x28')];}_0x2756a7[_0x993e('0x1a')](_0x279bb8)[_0x993e('0x29')](_0x52b727);};}exports['index']=function(_0x48d457,_0x32e332){var _0x466d63={},_0x4a4f00={},_0x223af0={'count':0x0,'rows':[]};var _0x46670a=_[_0x993e('0x2a')](db['MailQueueReport'][_0x993e('0x2b')],function(_0x9e0309){return{'name':_0x9e0309[_0x993e('0x2c')],'type':_0x9e0309[_0x993e('0x2d')][_0x993e('0x2e')]};});_0x4a4f00['model']=_[_0x993e('0x2a')](_0x46670a,'name');_0x4a4f00[_0x993e('0x2f')]=_['keys'](_0x48d457[_0x993e('0x2f')]);_0x4a4f00['filters']=_[_0x993e('0x30')](_0x4a4f00[_0x993e('0x31')],_0x4a4f00[_0x993e('0x2f')]);_0x466d63[_0x993e('0x32')]=_[_0x993e('0x30')](_0x4a4f00[_0x993e('0x31')],qs['fields'](_0x48d457[_0x993e('0x2f')]['fields']));_0x466d63['attributes']=_0x466d63[_0x993e('0x32')]['length']?_0x466d63[_0x993e('0x32')]:_0x4a4f00[_0x993e('0x31')];if(!_0x48d457[_0x993e('0x2f')][_0x993e('0x33')](_0x993e('0x34'))){_0x466d63[_0x993e('0x1f')]=qs[_0x993e('0x1f')](_0x48d457[_0x993e('0x2f')][_0x993e('0x1f')]);_0x466d63[_0x993e('0x1d')]=qs[_0x993e('0x1d')](_0x48d457[_0x993e('0x2f')][_0x993e('0x1d')]);}_0x466d63[_0x993e('0x35')]=qs[_0x993e('0x36')](_0x48d457['query'][_0x993e('0x36')]);_0x466d63[_0x993e('0x37')]=qs[_0x993e('0x38')](_[_0x993e('0x39')](_0x48d457[_0x993e('0x2f')],_0x4a4f00[_0x993e('0x38')]),_0x46670a);if(_0x48d457[_0x993e('0x2f')][_0x993e('0x3a')]){_0x466d63[_0x993e('0x37')]=_['merge'](_0x466d63[_0x993e('0x37')],{'$or':_['map'](_0x46670a,function(_0xf79f29){if(_0xf79f29[_0x993e('0x2d')]!==_0x993e('0x3b')){var _0x406f14={};_0x406f14[_0xf79f29[_0x993e('0x28')]]={'$like':'%'+_0x48d457[_0x993e('0x2f')][_0x993e('0x3a')]+'%'};return _0x406f14;}})});}_0x466d63=_[_0x993e('0x3c')]({},_0x466d63,_0x48d457['options']);var _0x186d55={'where':_0x466d63['where']};return db[_0x993e('0x3d')]['count'](_0x186d55)[_0x993e('0x25')](function(_0xbd9983){_0x223af0[_0x993e('0x20')]=_0xbd9983;if(_0x48d457[_0x993e('0x2f')][_0x993e('0x3e')]){_0x466d63[_0x993e('0x3f')]=[{'all':!![]}];}return db[_0x993e('0x3d')][_0x993e('0x40')](_0x466d63);})['then'](function(_0xe64c){_0x223af0['rows']=_0xe64c;return _0x223af0;})['then'](respondWithFilteredResult(_0x32e332,_0x466d63))[_0x993e('0x41')](handleError(_0x32e332,null));};exports[_0x993e('0x42')]=function(_0x1f058f,_0x5ed497){var _0x620b26={'raw':!![],'where':{'id':_0x1f058f[_0x993e('0x43')]['id']}},_0x40719d={};_0x40719d['model']=_['keys'](db['MailQueueReport'][_0x993e('0x2b')]);_0x40719d[_0x993e('0x2f')]=_[_0x993e('0x44')](_0x1f058f['query']);_0x40719d[_0x993e('0x38')]=_[_0x993e('0x30')](_0x40719d['model'],_0x40719d[_0x993e('0x2f')]);_0x620b26[_0x993e('0x32')]=_['intersection'](_0x40719d[_0x993e('0x31')],qs[_0x993e('0x45')](_0x1f058f[_0x993e('0x2f')]['fields']));_0x620b26['attributes']=_0x620b26['attributes'][_0x993e('0x46')]?_0x620b26[_0x993e('0x32')]:_0x40719d[_0x993e('0x31')];if(_0x1f058f[_0x993e('0x2f')]['includeAll']){_0x620b26[_0x993e('0x3f')]=[{'all':!![]}];}_0x620b26=_[_0x993e('0x3c')]({},_0x620b26,_0x1f058f[_0x993e('0x47')]);return db[_0x993e('0x3d')][_0x993e('0x48')](_0x620b26)[_0x993e('0x25')](handleEntityNotFound(_0x5ed497,null))['then'](respondWithResult(_0x5ed497,null))['catch'](handleError(_0x5ed497,null));};exports[_0x993e('0x49')]=function(_0x416f9f,_0x4d560d){return db['MailQueueReport'][_0x993e('0x49')](_0x416f9f[_0x993e('0x4a')],{})[_0x993e('0x25')](respondWithResult(_0x4d560d,0xc9))[_0x993e('0x41')](handleError(_0x4d560d,null));};exports[_0x993e('0x4b')]=function(_0x256ce3,_0x5b18e3){if(_0x256ce3[_0x993e('0x4a')]['id']){delete _0x256ce3['body']['id'];}return db[_0x993e('0x3d')][_0x993e('0x48')]({'where':{'id':_0x256ce3[_0x993e('0x43')]['id']}})[_0x993e('0x25')](handleEntityNotFound(_0x5b18e3,null))[_0x993e('0x25')](saveUpdates(_0x256ce3[_0x993e('0x4a')],null))[_0x993e('0x25')](respondWithResult(_0x5b18e3,null))[_0x993e('0x41')](handleError(_0x5b18e3,null));};exports['destroy']=function(_0x23f09c,_0x66ee65){return db[_0x993e('0x3d')]['find']({'where':{'id':_0x23f09c[_0x993e('0x43')]['id']}})['then'](handleEntityNotFound(_0x66ee65,null))[_0x993e('0x25')](removeEntity(_0x66ee65,null))[_0x993e('0x41')](handleError(_0x66ee65,null));};exports['describe']=function(_0xb2508b,_0xef78a1){return db['MailQueueReport'][_0x993e('0x4c')]()[_0x993e('0x25')](respondWithResult(_0xef78a1,null))[_0x993e('0x41')](handleError(_0xef78a1,null));}; \ No newline at end of file +var _0xc6ac=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','MailQueueReport','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4e9250,_0x1ea685){_0x4e9250=_0x4e9250-0x0;var _0x3a1d53=_0xc6ac[_0x4e9250];return _0x3a1d53;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':!![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));};exports[_0xcc6a('0x4f')]=function(_0x34531d,_0x14f5e5){return db[_0xcc6a('0x2d')]['describe']()['then'](respondWithResult(_0x14f5e5,null))[_0xcc6a('0x4b')](handleError(_0x14f5e5,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ef57a8c..9a95a58 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 _0x94a1=['api','bluebird','rimraf','../../config/environment','./mailQueueReport.attributes','exports','report_mail_queue','uniqueid','lodash'];(function(_0x56f756,_0x4f3cf0){var _0x415c87=function(_0x5254bd){while(--_0x5254bd){_0x56f756['push'](_0x56f756['shift']());}};_0x415c87(++_0x4f3cf0);}(_0x94a1,0x10d));var _0x194a=function(_0x1bf04f,_0x27fb33){_0x1bf04f=_0x1bf04f-0x0;var _0x12c46f=_0x94a1[_0x1bf04f];return _0x12c46f;};'use strict';var _=require(_0x194a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x194a('0x1'));var moment=require('moment');var BPromise=require(_0x194a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x194a('0x3'));var config=require(_0x194a('0x4'));var attributes=require(_0x194a('0x5'));module[_0x194a('0x6')]=function(_0x109dc2,_0x30f7cf){return _0x109dc2['define']('MailQueueReport',attributes,{'tableName':_0x194a('0x7'),'paranoid':![],'indexes':[{'name':_0x194a('0x8'),'fields':[_0x194a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa9c=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x5b0582,_0x44f98a){var _0x59cc5c=function(_0x413f92){while(--_0x413f92){_0x5b0582['push'](_0x5b0582['shift']());}};_0x59cc5c(++_0x44f98a);}(_0xfa9c,0x11e));var _0xcfa9=function(_0x30ca23,_0x51634c){_0x30ca23=_0x30ca23-0x0;var _0x2bd935=_0xfa9c[_0x30ca23];return _0x2bd935;};'use strict';var _=require(_0xcfa9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfa9('0x1'));var moment=require(_0xcfa9('0x2'));var BPromise=require(_0xcfa9('0x3'));var rp=require(_0xcfa9('0x4'));var fs=require('fs');var path=require(_0xcfa9('0x5'));var rimraf=require(_0xcfa9('0x6'));var config=require(_0xcfa9('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0xcfa9('0x8')]=function(_0x53f459,_0x25e295){return _0x53f459[_0xcfa9('0x9')](_0xcfa9('0xa'),attributes,{'tableName':_0xcfa9('0xb'),'paranoid':![],'indexes':[{'name':_0xcfa9('0xc'),'fields':[_0xcfa9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 49c4b7f..223e321 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(_0xa68a09,_0x1cf8ff){var _0x1cd623=function(_0x27d5b2){while(--_0x27d5b2){_0xa68a09['push'](_0xa68a09['shift']());}};_0x1cd623(++_0x1cf8ff);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'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 _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x7a5a39,_0x32e4ee){var _0x2a000e=function(_0xef016e){while(--_0xef016e){_0x7a5a39['push'](_0x7a5a39['shift']());}};_0x2a000e(++_0x32e4ee);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5714be,_0x13fed0){_0x5714be=_0x5714be-0x0;var _0x341da2=_0x5f2f[_0x5714be];return _0x341da2;};'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')]('MailQueueReport,\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')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index e690edc..a65d60d 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1c5abd,_0x41eccb){var _0x8f39c3=function(_0x26f2c1){while(--_0x26f2c1){_0x1c5abd['push'](_0x1c5abd['shift']());}};_0x8f39c3(++_0x41eccb);}(_0xe706,0xa3));var _0x6e70=function(_0x1569fc,_0x115095){_0x1569fc=_0x1569fc-0x0;var _0x277783=_0xe706[_0x1569fc];return _0x277783;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x22e513,_0x53d375){var _0x55d29b=function(_0x2ccff5){while(--_0x2ccff5){_0x22e513['push'](_0x22e513['shift']());}};_0x55d29b(++_0x53d375);}(_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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 4b8f5a2..22f71ea 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 _0x4819=['exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x4819,0xcd));var _0x9481=function(_0x93c171,_0x2b3a4c){_0x93c171=_0x93c171-0x0;var _0x4970d9=_0x4819[_0x93c171];return _0x4970d9;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'description':{'type':Sequelize[_0x9481('0x1')]},'host':{'type':Sequelize[_0x9481('0x1')]},'authentication':{'type':Sequelize[_0x9481('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9481('0x1')]},'password':{'type':Sequelize[_0x9481('0x1')]},'port':{'type':Sequelize[_0x9481('0x3')]},'tls':{'type':Sequelize[_0x9481('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9481('0x1')],'defaultValue':_0x9481('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9481('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4aff=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x501876,_0x2984ad){var _0x13691a=function(_0x3fa719){while(--_0x3fa719){_0x501876['push'](_0x501876['shift']());}};_0x13691a(++_0x2984ad);}(_0x4aff,0x18c));var _0xf4af=function(_0x31021e,_0x248900){_0x31021e=_0x31021e-0x0;var _0x1e6fe5=_0x4aff[_0x31021e];return _0x1e6fe5;};'use strict';var Sequelize=require(_0xf4af('0x0'));module[_0xf4af('0x1')]={'description':{'type':Sequelize[_0xf4af('0x2')]},'host':{'type':Sequelize[_0xf4af('0x2')]},'authentication':{'type':Sequelize[_0xf4af('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf4af('0x2')]},'password':{'type':Sequelize[_0xf4af('0x2')]},'port':{'type':Sequelize[_0xf4af('0x4')]},'tls':{'type':Sequelize[_0xf4af('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xf4af('0x5')},'connTimeout':{'type':Sequelize[_0xf4af('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf4af('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf4af('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c7891be..3c25a95 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 _0xb51c=['moment','bluebird','request-promise','rimraf','./mailServerIn.attributes','exports','define','mail_servers_in','util','../../config/logger','api'];(function(_0x5da5b1,_0x416be4){var _0x476405=function(_0x47dc1f){while(--_0x47dc1f){_0x5da5b1['push'](_0x5da5b1['shift']());}};_0x476405(++_0x416be4);}(_0xb51c,0x110));var _0xcb51=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xb51c[_0x45e98e];return _0x374dba;};'use strict';var _=require('lodash');var util=require(_0xcb51('0x0'));var logger=require(_0xcb51('0x1'))(_0xcb51('0x2'));var moment=require(_0xcb51('0x3'));var BPromise=require(_0xcb51('0x4'));var rp=require(_0xcb51('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb51('0x6'));var config=require('../../config/environment');var attributes=require(_0xcb51('0x7'));module[_0xcb51('0x8')]=function(_0x4fb8b0,_0x37ff25){return _0x4fb8b0[_0xcb51('0x9')]('MailServerIn',attributes,{'tableName':_0xcb51('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb383=['path','../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42a209,_0x521c51){var _0xf54c5b=function(_0x115e17){while(--_0x115e17){_0x42a209['push'](_0x42a209['shift']());}};_0xf54c5b(++_0x521c51);}(_0xb383,0x161));var _0x3b38=function(_0x35bbd3,_0x593502){_0x35bbd3=_0x35bbd3-0x0;var _0x2b3aed=_0xb383[_0x35bbd3];return _0x2b3aed;};'use strict';var _=require(_0x3b38('0x0'));var util=require(_0x3b38('0x1'));var logger=require(_0x3b38('0x2'))(_0x3b38('0x3'));var moment=require(_0x3b38('0x4'));var BPromise=require(_0x3b38('0x5'));var rp=require(_0x3b38('0x6'));var fs=require('fs');var path=require(_0x3b38('0x7'));var rimraf=require('rimraf');var config=require(_0x3b38('0x8'));var attributes=require(_0x3b38('0x9'));module['exports']=function(_0x1f489f,_0x3a5324){return _0x1f489f['define'](_0x3b38('0xa'),attributes,{'tableName':_0x3b38('0xb'),'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 4cd79a1..ba2994d 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 _0x0897=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','map','include','model','lodash'];(function(_0x363b89,_0x2f2e75){var _0x2ffc54=function(_0x314260){while(--_0x314260){_0x363b89['push'](_0x363b89['shift']());}};_0x2ffc54(++_0x2f2e75);}(_0x0897,0x167));var _0x7089=function(_0x2de237,_0x4e97bc){_0x2de237=_0x2de237-0x0;var _0x1b1cf6=_0x0897[_0x2de237];return _0x1b1cf6;};'use strict';var _=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var moment=require(_0x7089('0x2'));var BPromise=require(_0x7089('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7089('0x4'));var db=require(_0x7089('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7089('0x6'))(_0x7089('0x7'));var config=require(_0x7089('0x8'));var jayson=require(_0x7089('0x9'));var client=jayson[_0x7089('0xa')][_0x7089('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37a952,_0x546550,_0x576f4b){return new BPromise(function(_0xa1fc16,_0x16d9a7){return client[_0x7089('0xc')](_0x37a952,_0x576f4b)[_0x7089('0xd')](function(_0x11d095){logger[_0x7089('0xe')](_0x7089('0xf'),_0x546550,'request\x20sent');logger[_0x7089('0x10')](_0x7089('0x11'),_0x546550,_0x7089('0x12'),JSON[_0x7089('0x13')](_0x11d095));if(_0x11d095[_0x7089('0x14')]){if(_0x11d095['error'][_0x7089('0x15')]===0x1f4){logger[_0x7089('0x14')]('MailServerIn,\x20%s,\x20%s',_0x546550,_0x11d095['error'][_0x7089('0x16')]);return _0x16d9a7(_0x11d095[_0x7089('0x14')][_0x7089('0x16')]);}logger[_0x7089('0x14')](_0x7089('0xf'),_0x546550,_0x11d095['error'][_0x7089('0x16')]);return _0xa1fc16(_0x11d095[_0x7089('0x14')]['message']);}else{logger['info'](_0x7089('0xf'),_0x546550,'request\x20sent');_0xa1fc16(_0x11d095[_0x7089('0x17')][_0x7089('0x16')]);}})[_0x7089('0x18')](function(_0x53f578){logger[_0x7089('0x14')](_0x7089('0xf'),_0x546550,_0x53f578);_0x16d9a7(_0x53f578);});});}exports[_0x7089('0x19')]=function(_0x1a6da2){var _0x343c0c=this;return new Promise(function(_0x394307,_0x5c2dcd){return db[_0x7089('0x1a')][_0x7089('0x1b')]({'raw':_0x1a6da2[_0x7089('0x1c')]?_0x1a6da2[_0x7089('0x1c')][_0x7089('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a6da2[_0x7089('0x1c')]?_0x1a6da2['options'][_0x7089('0x1e')]||null:null,'attributes':_0x1a6da2[_0x7089('0x1c')]?_0x1a6da2[_0x7089('0x1c')][_0x7089('0x1f')]||null:null,'limit':_0x1a6da2[_0x7089('0x1c')]?_0x1a6da2['options'][_0x7089('0x20')]||null:null,'include':_0x1a6da2['options']?_0x1a6da2[_0x7089('0x1c')]['include']?_[_0x7089('0x21')](_0x1a6da2['options'][_0x7089('0x22')],function(_0x4dd79d){return{'model':db[_0x4dd79d[_0x7089('0x23')]],'as':_0x4dd79d['as'],'attributes':_0x4dd79d['attributes'],'include':_0x4dd79d['include']?_[_0x7089('0x21')](_0x4dd79d[_0x7089('0x22')],function(_0x37790c){return{'model':db[_0x37790c['model']],'as':_0x37790c['as'],'attributes':_0x37790c[_0x7089('0x1f')],'include':_0x37790c[_0x7089('0x22')]?_['map'](_0x37790c[_0x7089('0x22')],function(_0x385518){return{'model':db[_0x385518[_0x7089('0x23')]],'as':_0x385518['as'],'attributes':_0x385518[_0x7089('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7089('0xd')](function(_0x4444f9){logger[_0x7089('0xe')](_0x7089('0x19'),_0x1a6da2);logger[_0x7089('0x10')](_0x7089('0x19'),_0x1a6da2,JSON[_0x7089('0x13')](_0x4444f9));_0x394307(_0x4444f9);})[_0x7089('0x18')](function(_0x20f088){logger[_0x7089('0x14')](_0x7089('0x19'),_0x20f088[_0x7089('0x16')],_0x1a6da2);_0x5c2dcd(_0x343c0c[_0x7089('0x14')](0x1f4,_0x20f088[_0x7089('0x16')]));});});}; \ No newline at end of file +var _0x7df8=['randomstring','ioredis','../../config/logger','rpc','request','info','MailServerIn,\x20%s,\x20%s','error','code','message','request\x20sent','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','attributes','then','stringify','lodash','util','moment','bluebird'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x7df8,0x1a0));var _0x87df=function(_0x5358e4,_0x25d7b8){_0x5358e4=_0x5358e4-0x0;var _0x3d69d3=_0x7df8[_0x5358e4];return _0x3d69d3;};'use strict';var _=require(_0x87df('0x0'));var util=require(_0x87df('0x1'));var moment=require(_0x87df('0x2'));var BPromise=require(_0x87df('0x3'));var rs=require(_0x87df('0x4'));var fs=require('fs');var Redis=require(_0x87df('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x87df('0x6'))(_0x87df('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49f565,_0x2a83f1,_0x41b41f){return new BPromise(function(_0x3daa75,_0x2612e4){return client[_0x87df('0x8')](_0x49f565,_0x41b41f)['then'](function(_0x529c79){logger[_0x87df('0x9')](_0x87df('0xa'),_0x2a83f1,'request\x20sent');logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2a83f1,'request\x20sent',JSON['stringify'](_0x529c79));if(_0x529c79[_0x87df('0xb')]){if(_0x529c79[_0x87df('0xb')][_0x87df('0xc')]===0x1f4){logger[_0x87df('0xb')](_0x87df('0xa'),_0x2a83f1,_0x529c79[_0x87df('0xb')][_0x87df('0xd')]);return _0x2612e4(_0x529c79[_0x87df('0xb')]['message']);}logger['error'](_0x87df('0xa'),_0x2a83f1,_0x529c79[_0x87df('0xb')][_0x87df('0xd')]);return _0x3daa75(_0x529c79[_0x87df('0xb')][_0x87df('0xd')]);}else{logger[_0x87df('0x9')](_0x87df('0xa'),_0x2a83f1,_0x87df('0xe'));_0x3daa75(_0x529c79['result'][_0x87df('0xd')]);}})[_0x87df('0xf')](function(_0x15a429){logger['error']('MailServerIn,\x20%s,\x20%s',_0x2a83f1,_0x15a429);_0x2612e4(_0x15a429);});});}exports[_0x87df('0x10')]=function(_0x24807d){var _0x59b38e=this;return new Promise(function(_0x588640,_0x436db9){return db[_0x87df('0x11')][_0x87df('0x12')]({'raw':_0x24807d['options']?_0x24807d[_0x87df('0x13')][_0x87df('0x14')]===undefined?!![]:![]:!![],'where':_0x24807d[_0x87df('0x13')]?_0x24807d[_0x87df('0x13')][_0x87df('0x15')]||null:null,'attributes':_0x24807d['options']?_0x24807d[_0x87df('0x13')]['attributes']||null:null,'limit':_0x24807d[_0x87df('0x13')]?_0x24807d[_0x87df('0x13')][_0x87df('0x16')]||null:null,'include':_0x24807d[_0x87df('0x13')]?_0x24807d['options'][_0x87df('0x17')]?_[_0x87df('0x18')](_0x24807d[_0x87df('0x13')][_0x87df('0x17')],function(_0x43b7ca){return{'model':db[_0x43b7ca['model']],'as':_0x43b7ca['as'],'attributes':_0x43b7ca[_0x87df('0x19')],'include':_0x43b7ca[_0x87df('0x17')]?_[_0x87df('0x18')](_0x43b7ca[_0x87df('0x17')],function(_0x2af5df){return{'model':db[_0x2af5df['model']],'as':_0x2af5df['as'],'attributes':_0x2af5df[_0x87df('0x19')],'include':_0x2af5df[_0x87df('0x17')]?_[_0x87df('0x18')](_0x2af5df[_0x87df('0x17')],function(_0x2e446d){return{'model':db[_0x2e446d['model']],'as':_0x2e446d['as'],'attributes':_0x2e446d['attributes']};}):[]};}):[]};}):[]:[]})[_0x87df('0x1a')](function(_0x403665){logger[_0x87df('0x9')](_0x87df('0x10'),_0x24807d);logger['debug'](_0x87df('0x10'),_0x24807d,JSON[_0x87df('0x1b')](_0x403665));_0x588640(_0x403665);})[_0x87df('0xf')](function(_0x3de455){logger['error'](_0x87df('0x10'),_0x3de455[_0x87df('0xd')],_0x24807d);_0x436db9(_0x59b38e[_0x87df('0xb')](0x1f4,_0x3de455[_0x87df('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index c9db490..2dee3c6 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(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x32b9b8,_0x1a22a8){_0x32b9b8=_0x32b9b8-0x0;var _0x15b259=_0x7a54[_0x32b9b8];return _0x15b259;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index b5fbaf9..5d4c16d 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 _0x58a4=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x48dfc7,_0x28410f){var _0x553cbf=function(_0x56f3f7){while(--_0x56f3f7){_0x48dfc7['push'](_0x48dfc7['shift']());}};_0x553cbf(++_0x28410f);}(_0x58a4,0xbf));var _0x458a=function(_0x41da6,_0x42431b){_0x41da6=_0x41da6-0x0;var _0x282340=_0x58a4[_0x41da6];return _0x282340;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'description':{'type':Sequelize[_0x458a('0x2')]},'host':{'type':Sequelize[_0x458a('0x2')]},'user':{'type':Sequelize[_0x458a('0x2')]},'pass':{'type':Sequelize[_0x458a('0x2')]},'port':{'type':Sequelize[_0x458a('0x3')]},'secure':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x458a('0x2')]},'authentication':{'type':Sequelize[_0x458a('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x2547=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x2547,0x1cd));var _0x7254=function(_0x2098cc,_0x30b52d){_0x2098cc=_0x2098cc-0x0;var _0x1df3b7=_0x2547[_0x2098cc];return _0x1df3b7;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'description':{'type':Sequelize[_0x7254('0x1')]},'host':{'type':Sequelize[_0x7254('0x1')]},'user':{'type':Sequelize[_0x7254('0x1')]},'pass':{'type':Sequelize[_0x7254('0x1')]},'port':{'type':Sequelize[_0x7254('0x2')]},'secure':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x7254('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 07eed63..fa27fe9 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 _0xefde=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','findAll','then','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','MailServerOut','rawAttributes','fieldName','key','model','query'];(function(_0xda0910,_0x5274d1){var _0x41e6e5=function(_0x2c2a61){while(--_0x2c2a61){_0xda0910['push'](_0xda0910['shift']());}};_0x41e6e5(++_0x5274d1);}(_0xefde,0xb5));var _0xeefd=function(_0x371228,_0x584774){_0x371228=_0x371228-0x0;var _0x5859ed=_0xefde[_0x371228];return _0x5859ed;};'use strict';var emlformat=require(_0xeefd('0x0'));var rimraf=require(_0xeefd('0x1'));var zipdir=require(_0xeefd('0x2'));var jsonpatch=require(_0xeefd('0x3'));var rp=require(_0xeefd('0x4'));var moment=require(_0xeefd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeefd('0x6'));var util=require(_0xeefd('0x7'));var path=require(_0xeefd('0x8'));var sox=require(_0xeefd('0x9'));var csv=require(_0xeefd('0xa'));var ejs=require(_0xeefd('0xb'));var fs=require('fs');var fs_extra=require(_0xeefd('0xc'));var _=require(_0xeefd('0xd'));var squel=require(_0xeefd('0xe'));var crypto=require(_0xeefd('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeefd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeefd('0x11'));var qs=require(_0xeefd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeefd('0x13'));var logger=require('../../config/logger')(_0xeefd('0x14'));var utils=require(_0xeefd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeefd('0x16'))['db'];function respondWithStatusCode(_0x30f9eb,_0x5b336f){_0x5b336f=_0x5b336f||0xcc;return function(_0x35c924){if(_0x35c924){return _0x30f9eb[_0xeefd('0x17')](_0x5b336f);}return _0x30f9eb['status'](_0x5b336f)['end']();};}function respondWithResult(_0x38d99b,_0x5cf94f){_0x5cf94f=_0x5cf94f||0xc8;return function(_0x1a4f62){if(_0x1a4f62){return _0x38d99b[_0xeefd('0x18')](_0x5cf94f)['json'](_0x1a4f62);}};}function respondWithFilteredResult(_0x531b59,_0xa51203){return function(_0x16077c){if(_0x16077c){var _0x475249=typeof _0xa51203['offset']==='undefined'&&typeof _0xa51203[_0xeefd('0x19')]===_0xeefd('0x1a');var _0x2ec53f=_0x16077c[_0xeefd('0x1b')];var _0x279d28=_0x475249?0x0:_0xa51203[_0xeefd('0x1c')];var _0x4c0e85=_0x475249?_0x16077c[_0xeefd('0x1b')]:_0xa51203['offset']+_0xa51203['limit'];var _0x3e1b54;if(_0x4c0e85>=_0x2ec53f){_0x4c0e85=_0x2ec53f;_0x3e1b54=0xc8;}else{_0x3e1b54=0xce;}_0x531b59['status'](_0x3e1b54);return _0x531b59[_0xeefd('0x1d')](_0xeefd('0x1e'),_0x279d28+'-'+_0x4c0e85+'/'+_0x2ec53f)[_0xeefd('0x1f')](_0x16077c);}return null;};}function patchUpdates(_0x40e52d){return function(_0x359837){try{jsonpatch[_0xeefd('0x20')](_0x359837,_0x40e52d,!![]);}catch(_0x27b05f){return BPromise[_0xeefd('0x21')](_0x27b05f);}return _0x359837[_0xeefd('0x22')]();};}function saveUpdates(_0x1ea107,_0x411691){return function(_0x3ff0f5){if(_0x3ff0f5){return _0x3ff0f5[_0xeefd('0x23')](_0x1ea107)['then'](function(_0x4bdac4){return _0x4bdac4;});}return null;};}function removeEntity(_0x3587ad,_0x1f0734){return function(_0x32c157){if(_0x32c157){return _0x32c157[_0xeefd('0x24')]()['then'](function(){_0x3587ad[_0xeefd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb5c9a7,_0x3496a4){return function(_0x187812){if(!_0x187812){_0xb5c9a7['sendStatus'](0x194);}return _0x187812;};}function handleError(_0x2db6f6,_0x3bd510){_0x3bd510=_0x3bd510||0x1f4;return function(_0x42e609){logger[_0xeefd('0x25')](_0x42e609[_0xeefd('0x26')]);if(_0x42e609[_0xeefd('0x27')]){delete _0x42e609[_0xeefd('0x27')];}_0x2db6f6['status'](_0x3bd510)[_0xeefd('0x28')](_0x42e609);};}exports['index']=function(_0xad439c,_0x5e0a7a){var _0xfed7eb={},_0xe880e1={},_0x7fe54e={'count':0x0,'rows':[]};var _0xbbfa77=_['map'](db[_0xeefd('0x29')][_0xeefd('0x2a')],function(_0x41d30e){return{'name':_0x41d30e[_0xeefd('0x2b')],'type':_0x41d30e['type'][_0xeefd('0x2c')]};});_0xe880e1[_0xeefd('0x2d')]=_['map'](_0xbbfa77,'name');_0xe880e1[_0xeefd('0x2e')]=_[_0xeefd('0x2f')](_0xad439c['query']);_0xe880e1[_0xeefd('0x30')]=_[_0xeefd('0x31')](_0xe880e1[_0xeefd('0x2d')],_0xe880e1[_0xeefd('0x2e')]);_0xfed7eb['attributes']=_['intersection'](_0xe880e1[_0xeefd('0x2d')],qs[_0xeefd('0x32')](_0xad439c['query']['fields']));_0xfed7eb[_0xeefd('0x33')]=_0xfed7eb[_0xeefd('0x33')][_0xeefd('0x34')]?_0xfed7eb[_0xeefd('0x33')]:_0xe880e1[_0xeefd('0x2d')];if(!_0xad439c[_0xeefd('0x2e')][_0xeefd('0x35')](_0xeefd('0x36'))){_0xfed7eb['limit']=qs[_0xeefd('0x19')](_0xad439c[_0xeefd('0x2e')]['limit']);_0xfed7eb[_0xeefd('0x1c')]=qs[_0xeefd('0x1c')](_0xad439c[_0xeefd('0x2e')]['offset']);}_0xfed7eb[_0xeefd('0x37')]=qs[_0xeefd('0x38')](_0xad439c['query']['sort']);_0xfed7eb[_0xeefd('0x39')]=qs[_0xeefd('0x30')](_[_0xeefd('0x3a')](_0xad439c['query'],_0xe880e1[_0xeefd('0x30')]),_0xbbfa77);if(_0xad439c['query'][_0xeefd('0x3b')]){_0xfed7eb['where']=_['merge'](_0xfed7eb[_0xeefd('0x39')],{'$or':_[_0xeefd('0x3c')](_0xbbfa77,function(_0xb7093f){if(_0xb7093f[_0xeefd('0x3d')]!==_0xeefd('0x3e')){var _0x1339de={};_0x1339de[_0xb7093f[_0xeefd('0x27')]]={'$like':'%'+_0xad439c[_0xeefd('0x2e')][_0xeefd('0x3b')]+'%'};return _0x1339de;}})});}_0xfed7eb=_[_0xeefd('0x3f')]({},_0xfed7eb,_0xad439c[_0xeefd('0x40')]);var _0x58f188={'where':_0xfed7eb[_0xeefd('0x39')]};return db[_0xeefd('0x29')][_0xeefd('0x1b')](_0x58f188)['then'](function(_0x141191){_0x7fe54e[_0xeefd('0x1b')]=_0x141191;if(_0xad439c[_0xeefd('0x2e')][_0xeefd('0x41')]){_0xfed7eb['include']=[{'all':!![]}];}return db[_0xeefd('0x29')][_0xeefd('0x42')](_0xfed7eb);})[_0xeefd('0x43')](function(_0x12057b){_0x7fe54e[_0xeefd('0x44')]=_0x12057b;return _0x7fe54e;})[_0xeefd('0x43')](respondWithFilteredResult(_0x5e0a7a,_0xfed7eb))[_0xeefd('0x45')](handleError(_0x5e0a7a,null));};exports[_0xeefd('0x46')]=function(_0x50e72c,_0x51034f){var _0x3f02d7={'raw':!![],'where':{'id':_0x50e72c[_0xeefd('0x47')]['id']}},_0x69edd1={};_0x69edd1[_0xeefd('0x2d')]=_['keys'](db[_0xeefd('0x29')]['rawAttributes']);_0x69edd1[_0xeefd('0x2e')]=_[_0xeefd('0x2f')](_0x50e72c[_0xeefd('0x2e')]);_0x69edd1[_0xeefd('0x30')]=_[_0xeefd('0x31')](_0x69edd1[_0xeefd('0x2d')],_0x69edd1[_0xeefd('0x2e')]);_0x3f02d7['attributes']=_[_0xeefd('0x31')](_0x69edd1['model'],qs[_0xeefd('0x32')](_0x50e72c[_0xeefd('0x2e')]['fields']));_0x3f02d7[_0xeefd('0x33')]=_0x3f02d7['attributes'][_0xeefd('0x34')]?_0x3f02d7[_0xeefd('0x33')]:_0x69edd1[_0xeefd('0x2d')];if(_0x50e72c[_0xeefd('0x2e')]['includeAll']){_0x3f02d7[_0xeefd('0x48')]=[{'all':!![]}];}_0x3f02d7=_[_0xeefd('0x3f')]({},_0x3f02d7,_0x50e72c['options']);return db[_0xeefd('0x29')]['find'](_0x3f02d7)[_0xeefd('0x43')](handleEntityNotFound(_0x51034f,null))[_0xeefd('0x43')](respondWithResult(_0x51034f,null))[_0xeefd('0x45')](handleError(_0x51034f,null));};exports[_0xeefd('0x49')]=function(_0x2436bb,_0x496992){return db[_0xeefd('0x29')][_0xeefd('0x49')](_0x2436bb[_0xeefd('0x4a')],{})['then'](respondWithResult(_0x496992,0xc9))[_0xeefd('0x45')](handleError(_0x496992,null));};exports[_0xeefd('0x23')]=function(_0x57bbb6,_0x342188){if(_0x57bbb6[_0xeefd('0x4a')]['id']){delete _0x57bbb6['body']['id'];}return db[_0xeefd('0x29')]['find']({'where':{'id':_0x57bbb6[_0xeefd('0x47')]['id']}})['then'](handleEntityNotFound(_0x342188,null))[_0xeefd('0x43')](saveUpdates(_0x57bbb6[_0xeefd('0x4a')],null))[_0xeefd('0x43')](respondWithResult(_0x342188,null))[_0xeefd('0x45')](handleError(_0x342188,null));};exports['destroy']=function(_0x44884e,_0x1bffee){return db[_0xeefd('0x29')][_0xeefd('0x4b')]({'where':{'id':_0x44884e['params']['id']}})[_0xeefd('0x43')](handleEntityNotFound(_0x1bffee,null))[_0xeefd('0x43')](removeEntity(_0x1bffee,null))[_0xeefd('0x45')](handleError(_0x1bffee,null));}; \ No newline at end of file +var _0xe4d1=['error','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','MailServerOut','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','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','undefined','limit','count','set','Content-Range','apply','reject','update','then'];(function(_0x36d0e4,_0x370b14){var _0x30244c=function(_0x3eae10){while(--_0x3eae10){_0x36d0e4['push'](_0x36d0e4['shift']());}};_0x30244c(++_0x370b14);}(_0xe4d1,0xba));var _0x1e4d=function(_0x4c5785,_0x5e27ec){_0x4c5785=_0x4c5785-0x0;var _0x566e62=_0xe4d1[_0x4c5785];return _0x566e62;};'use strict';var emlformat=require(_0x1e4d('0x0'));var rimraf=require(_0x1e4d('0x1'));var zipdir=require(_0x1e4d('0x2'));var jsonpatch=require(_0x1e4d('0x3'));var rp=require('request-promise');var moment=require(_0x1e4d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e4d('0x5'));var util=require(_0x1e4d('0x6'));var path=require(_0x1e4d('0x7'));var sox=require(_0x1e4d('0x8'));var csv=require(_0x1e4d('0x9'));var ejs=require(_0x1e4d('0xa'));var fs=require('fs');var fs_extra=require(_0x1e4d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e4d('0xc'));var jsforce=require(_0x1e4d('0xd'));var deskjs=require(_0x1e4d('0xe'));var toCsv=require(_0x1e4d('0x9'));var querystring=require('querystring');var Papa=require(_0x1e4d('0xf'));var Redis=require(_0x1e4d('0x10'));var authService=require(_0x1e4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1e4d('0x12'));var hardwareService=require(_0x1e4d('0x13'));var logger=require('../../config/logger')(_0x1e4d('0x14'));var utils=require(_0x1e4d('0x15'));var config=require(_0x1e4d('0x16'));var licenseUtil=require(_0x1e4d('0x17'));var db=require(_0x1e4d('0x18'))['db'];function respondWithStatusCode(_0x284193,_0x29c0a2){_0x29c0a2=_0x29c0a2||0xcc;return function(_0x134c45){if(_0x134c45){return _0x284193[_0x1e4d('0x19')](_0x29c0a2);}return _0x284193[_0x1e4d('0x1a')](_0x29c0a2)[_0x1e4d('0x1b')]();};}function respondWithResult(_0x3ebf0a,_0x48b445){_0x48b445=_0x48b445||0xc8;return function(_0x4bd43d){if(_0x4bd43d){return _0x3ebf0a[_0x1e4d('0x1a')](_0x48b445)[_0x1e4d('0x1c')](_0x4bd43d);}};}function respondWithFilteredResult(_0x5ed17e,_0x184bef){return function(_0x3b8d4d){if(_0x3b8d4d){var _0x3db783=typeof _0x184bef[_0x1e4d('0x1d')]===_0x1e4d('0x1e')&&typeof _0x184bef[_0x1e4d('0x1f')]===_0x1e4d('0x1e');var _0x5c1d6e=_0x3b8d4d[_0x1e4d('0x20')];var _0x1df0a2=_0x3db783?0x0:_0x184bef[_0x1e4d('0x1d')];var _0x1602bb=_0x3db783?_0x3b8d4d[_0x1e4d('0x20')]:_0x184bef[_0x1e4d('0x1d')]+_0x184bef[_0x1e4d('0x1f')];var _0xef6e30;if(_0x1602bb>=_0x5c1d6e){_0x1602bb=_0x5c1d6e;_0xef6e30=0xc8;}else{_0xef6e30=0xce;}_0x5ed17e['status'](_0xef6e30);return _0x5ed17e[_0x1e4d('0x21')](_0x1e4d('0x22'),_0x1df0a2+'-'+_0x1602bb+'/'+_0x5c1d6e)[_0x1e4d('0x1c')](_0x3b8d4d);}return null;};}function patchUpdates(_0x4aa97f){return function(_0x415950){try{jsonpatch[_0x1e4d('0x23')](_0x415950,_0x4aa97f,!![]);}catch(_0x3bd0cb){return BPromise[_0x1e4d('0x24')](_0x3bd0cb);}return _0x415950['save']();};}function saveUpdates(_0x850678,_0x2c5bec){return function(_0x3bef66){if(_0x3bef66){return _0x3bef66[_0x1e4d('0x25')](_0x850678)[_0x1e4d('0x26')](function(_0x42171c){return _0x42171c;});}return null;};}function removeEntity(_0x391f97,_0x10f4ab){return function(_0x4343b8){if(_0x4343b8){return _0x4343b8['destroy']()['then'](function(){_0x391f97['status'](0xcc)[_0x1e4d('0x1b')]();});}};}function handleEntityNotFound(_0x17d416,_0x47d828){return function(_0x33d194){if(!_0x33d194){_0x17d416[_0x1e4d('0x19')](0x194);}return _0x33d194;};}function handleError(_0x414dbe,_0x296b1a){_0x296b1a=_0x296b1a||0x1f4;return function(_0x2fdab9){logger[_0x1e4d('0x27')](_0x2fdab9['stack']);if(_0x2fdab9[_0x1e4d('0x28')]){delete _0x2fdab9[_0x1e4d('0x28')];}_0x414dbe[_0x1e4d('0x1a')](_0x296b1a)[_0x1e4d('0x29')](_0x2fdab9);};}exports[_0x1e4d('0x2a')]=function(_0x2eac4a,_0x61d45){var _0x305e5a={},_0x3c9bfc={},_0x4b43d7={'count':0x0,'rows':[]};var _0x40bf19=_[_0x1e4d('0x2b')](db['MailServerOut']['rawAttributes'],function(_0x5a822a){return{'name':_0x5a822a[_0x1e4d('0x2c')],'type':_0x5a822a['type'][_0x1e4d('0x2d')]};});_0x3c9bfc[_0x1e4d('0x2e')]=_[_0x1e4d('0x2b')](_0x40bf19,_0x1e4d('0x28'));_0x3c9bfc['query']=_[_0x1e4d('0x2f')](_0x2eac4a[_0x1e4d('0x30')]);_0x3c9bfc[_0x1e4d('0x31')]=_[_0x1e4d('0x32')](_0x3c9bfc[_0x1e4d('0x2e')],_0x3c9bfc['query']);_0x305e5a[_0x1e4d('0x33')]=_[_0x1e4d('0x32')](_0x3c9bfc[_0x1e4d('0x2e')],qs[_0x1e4d('0x34')](_0x2eac4a['query'][_0x1e4d('0x34')]));_0x305e5a[_0x1e4d('0x33')]=_0x305e5a[_0x1e4d('0x33')]['length']?_0x305e5a[_0x1e4d('0x33')]:_0x3c9bfc[_0x1e4d('0x2e')];if(!_0x2eac4a[_0x1e4d('0x30')][_0x1e4d('0x35')](_0x1e4d('0x36'))){_0x305e5a[_0x1e4d('0x1f')]=qs[_0x1e4d('0x1f')](_0x2eac4a[_0x1e4d('0x30')][_0x1e4d('0x1f')]);_0x305e5a[_0x1e4d('0x1d')]=qs[_0x1e4d('0x1d')](_0x2eac4a[_0x1e4d('0x30')][_0x1e4d('0x1d')]);}_0x305e5a[_0x1e4d('0x37')]=qs[_0x1e4d('0x38')](_0x2eac4a[_0x1e4d('0x30')][_0x1e4d('0x38')]);_0x305e5a[_0x1e4d('0x39')]=qs[_0x1e4d('0x31')](_[_0x1e4d('0x3a')](_0x2eac4a[_0x1e4d('0x30')],_0x3c9bfc[_0x1e4d('0x31')]),_0x40bf19);if(_0x2eac4a['query'][_0x1e4d('0x3b')]){_0x305e5a[_0x1e4d('0x39')]=_[_0x1e4d('0x3c')](_0x305e5a['where'],{'$or':_[_0x1e4d('0x2b')](_0x40bf19,function(_0x3a7133){if(_0x3a7133['type']!==_0x1e4d('0x3d')){var _0x2803bb={};_0x2803bb[_0x3a7133['name']]={'$like':'%'+_0x2eac4a[_0x1e4d('0x30')][_0x1e4d('0x3b')]+'%'};return _0x2803bb;}})});}_0x305e5a=_['merge']({},_0x305e5a,_0x2eac4a['options']);var _0x197992={'where':_0x305e5a['where']};return db['MailServerOut'][_0x1e4d('0x20')](_0x197992)[_0x1e4d('0x26')](function(_0x497169){_0x4b43d7[_0x1e4d('0x20')]=_0x497169;if(_0x2eac4a[_0x1e4d('0x30')]['includeAll']){_0x305e5a[_0x1e4d('0x3e')]=[{'all':!![]}];}return db[_0x1e4d('0x3f')][_0x1e4d('0x40')](_0x305e5a);})[_0x1e4d('0x26')](function(_0x5f09cc){_0x4b43d7[_0x1e4d('0x41')]=_0x5f09cc;return _0x4b43d7;})[_0x1e4d('0x26')](respondWithFilteredResult(_0x61d45,_0x305e5a))[_0x1e4d('0x42')](handleError(_0x61d45,null));};exports[_0x1e4d('0x43')]=function(_0x5c9f58,_0x167363){var _0x151ad1={'raw':!![],'where':{'id':_0x5c9f58['params']['id']}},_0x1292d2={};_0x1292d2[_0x1e4d('0x2e')]=_[_0x1e4d('0x2f')](db[_0x1e4d('0x3f')][_0x1e4d('0x44')]);_0x1292d2[_0x1e4d('0x30')]=_[_0x1e4d('0x2f')](_0x5c9f58['query']);_0x1292d2[_0x1e4d('0x31')]=_[_0x1e4d('0x32')](_0x1292d2['model'],_0x1292d2[_0x1e4d('0x30')]);_0x151ad1['attributes']=_['intersection'](_0x1292d2[_0x1e4d('0x2e')],qs[_0x1e4d('0x34')](_0x5c9f58[_0x1e4d('0x30')][_0x1e4d('0x34')]));_0x151ad1[_0x1e4d('0x33')]=_0x151ad1[_0x1e4d('0x33')][_0x1e4d('0x45')]?_0x151ad1[_0x1e4d('0x33')]:_0x1292d2[_0x1e4d('0x2e')];if(_0x5c9f58[_0x1e4d('0x30')][_0x1e4d('0x46')]){_0x151ad1[_0x1e4d('0x3e')]=[{'all':!![]}];}_0x151ad1=_[_0x1e4d('0x3c')]({},_0x151ad1,_0x5c9f58['options']);return db[_0x1e4d('0x3f')][_0x1e4d('0x47')](_0x151ad1)[_0x1e4d('0x26')](handleEntityNotFound(_0x167363,null))[_0x1e4d('0x26')](respondWithResult(_0x167363,null))[_0x1e4d('0x42')](handleError(_0x167363,null));};exports[_0x1e4d('0x48')]=function(_0x1f6491,_0x2579c9){return db['MailServerOut'][_0x1e4d('0x48')](_0x1f6491[_0x1e4d('0x49')],{})[_0x1e4d('0x26')](respondWithResult(_0x2579c9,0xc9))['catch'](handleError(_0x2579c9,null));};exports[_0x1e4d('0x25')]=function(_0x16fc7c,_0x3d11b1){if(_0x16fc7c[_0x1e4d('0x49')]['id']){delete _0x16fc7c[_0x1e4d('0x49')]['id'];}return db[_0x1e4d('0x3f')][_0x1e4d('0x47')]({'where':{'id':_0x16fc7c[_0x1e4d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d11b1,null))[_0x1e4d('0x26')](saveUpdates(_0x16fc7c['body'],null))[_0x1e4d('0x26')](respondWithResult(_0x3d11b1,null))['catch'](handleError(_0x3d11b1,null));};exports['destroy']=function(_0x685ea9,_0x54f1a0){return db['MailServerOut'][_0x1e4d('0x47')]({'where':{'id':_0x685ea9['params']['id']}})[_0x1e4d('0x26')](handleEntityNotFound(_0x54f1a0,null))[_0x1e4d('0x26')](removeEntity(_0x54f1a0,null))[_0x1e4d('0x42')](handleError(_0x54f1a0,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 4f8b773..dd6487e 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 _0xdb8e=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x64d238,_0x11c120){var _0x567682=function(_0x202bba){while(--_0x202bba){_0x64d238['push'](_0x64d238['shift']());}};_0x567682(++_0x11c120);}(_0xdb8e,0x162));var _0xedb8=function(_0x4bf0bc,_0x2c6490){_0x4bf0bc=_0x4bf0bc-0x0;var _0x223837=_0xdb8e[_0x4bf0bc];return _0x223837;};'use strict';var _=require(_0xedb8('0x0'));var util=require(_0xedb8('0x1'));var logger=require(_0xedb8('0x2'))(_0xedb8('0x3'));var moment=require(_0xedb8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xedb8('0x5'));var rimraf=require(_0xedb8('0x6'));var config=require(_0xedb8('0x7'));var attributes=require(_0xedb8('0x8'));module[_0xedb8('0x9')]=function(_0x2c3631,_0x3236f2){return _0x2c3631[_0xedb8('0xa')](_0xedb8('0xb'),attributes,{'tableName':_0xedb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee25=['define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','request-promise','path','./mailServerOut.attributes','exports'];(function(_0x32e8fb,_0x218104){var _0xf31e16=function(_0x37ea32){while(--_0x37ea32){_0x32e8fb['push'](_0x32e8fb['shift']());}};_0xf31e16(++_0x218104);}(_0xee25,0x71));var _0x5ee2=function(_0x4eca02,_0x213386){_0x4eca02=_0x4eca02-0x0;var _0x597d3a=_0xee25[_0x4eca02];return _0x597d3a;};'use strict';var _=require(_0x5ee2('0x0'));var util=require('util');var logger=require(_0x5ee2('0x1'))(_0x5ee2('0x2'));var moment=require(_0x5ee2('0x3'));var BPromise=require('bluebird');var rp=require(_0x5ee2('0x4'));var fs=require('fs');var path=require(_0x5ee2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5ee2('0x6'));module[_0x5ee2('0x7')]=function(_0x33dc9e,_0x13a05a){return _0x33dc9e[_0x5ee2('0x8')](_0x5ee2('0x9'),attributes,{'tableName':_0x5ee2('0xa'),'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 775f925..e1abdf6 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x886860,_0x3b1ec1){var _0x563634=function(_0x4bd206){while(--_0x4bd206){_0x886860['push'](_0x886860['shift']());}};_0x563634(++_0x3b1ec1);}(_0xdb28,0x106));var _0x8db2=function(_0x2bf7a0,_0x32c308){_0x2bf7a0=_0x2bf7a0-0x0;var _0x3c0c94=_0xdb28[_0x2bf7a0];return _0x3c0c94;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5732d6,_0x2c9500){var _0x3a1a0f=function(_0x5ae05e){while(--_0x5ae05e){_0x5732d6['push'](_0x5732d6['shift']());}};_0x3a1a0f(++_0x2c9500);}(_0xadb5,0xad));var _0x5adb=function(_0x368741,_0x1f02af){_0x368741=_0x368741-0x0;var _0x585bef=_0xadb5[_0x368741];return _0x585bef;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 690f24a..4e5768c 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 _0x9eb2=['get','describe','/:id','show','post','isAuthenticated','create','put','delete','exports','util','path','connect-timeout','Router','../../config/environment','./mailSubstatus.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9eb2,0x1aa));var _0x29eb=function(_0x5baa02,_0x540223){_0x5baa02=_0x5baa02-0x0;var _0x995244=_0x9eb2[_0x5baa02];return _0x995244;};'use strict';var multer=require('multer');var util=require(_0x29eb('0x0'));var path=require(_0x29eb('0x1'));var timeout=require(_0x29eb('0x2'));var express=require('express');var router=express[_0x29eb('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29eb('0x4'));var controller=require(_0x29eb('0x5'));router[_0x29eb('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x29eb('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x29eb('0x7')]);router[_0x29eb('0x6')](_0x29eb('0x8'),auth['isAuthenticated'](),controller[_0x29eb('0x9')]);router[_0x29eb('0xa')]('/',auth[_0x29eb('0xb')](),controller[_0x29eb('0xc')]);router[_0x29eb('0xd')](_0x29eb('0x8'),auth[_0x29eb('0xb')](),controller['update']);router[_0x29eb('0xe')](_0x29eb('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x29eb('0xf')]=router; \ No newline at end of file +var _0x1669=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','/describe','/:id','isAuthenticated','show','post','put','update','destroy'];(function(_0x562a9b,_0xca4c46){var _0x5089c1=function(_0x339651){while(--_0x339651){_0x562a9b['push'](_0x562a9b['shift']());}};_0x5089c1(++_0xca4c46);}(_0x1669,0x1b5));var _0x9166=function(_0x3bb19e,_0x405fe4){_0x3bb19e=_0x3bb19e-0x0;var _0x2fae7c=_0x1669[_0x3bb19e];return _0x2fae7c;};'use strict';var multer=require(_0x9166('0x0'));var util=require(_0x9166('0x1'));var path=require(_0x9166('0x2'));var timeout=require('connect-timeout');var express=require(_0x9166('0x3'));var router=express[_0x9166('0x4')]();var fs_extra=require(_0x9166('0x5'));var auth=require(_0x9166('0x6'));var interaction=require(_0x9166('0x7'));var config=require(_0x9166('0x8'));var controller=require(_0x9166('0x9'));router[_0x9166('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9166('0xa')](_0x9166('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9166('0xc'),auth[_0x9166('0xd')](),controller[_0x9166('0xe')]);router[_0x9166('0xf')]('/',auth[_0x9166('0xd')](),controller['create']);router[_0x9166('0x10')](_0x9166('0xc'),auth[_0x9166('0xd')](),controller[_0x9166('0x11')]);router['delete']('/:id',auth[_0x9166('0xd')](),controller[_0x9166('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 253bd7e..242e844 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 _0x0618=['name','STRING','sequelize','exports'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x0618,0x1c6));var _0x8061=function(_0x15025f,_0x375738){_0x15025f=_0x15025f-0x0;var _0x1aa205=_0x0618[_0x15025f];return _0x1aa205;};'use strict';var Sequelize=require(_0x8061('0x0'));module[_0x8061('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8061('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8061('0x3')]}}; \ No newline at end of file +var _0x8b8e=['sequelize','STRING'];(function(_0x1dabc9,_0x5bc0a6){var _0x2c0e64=function(_0x243a26){while(--_0x243a26){_0x1dabc9['push'](_0x1dabc9['shift']());}};_0x2c0e64(++_0x5bc0a6);}(_0x8b8e,0x108));var _0xe8b8=function(_0x23961e,_0x67308b){_0x23961e=_0x23961e-0x0;var _0x3f9fbf=_0x8b8e[_0x23961e];return _0x3f9fbf;};'use strict';var Sequelize=require(_0xe8b8('0x0'));module['exports']={'name':{'type':Sequelize[_0xe8b8('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe8b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index a7bae2f..e380988 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 _0xdff6=['squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','set','apply','update','then','error','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','sort','where','filters','filter','merge','includeAll','findAll','rows','show','params','include','options','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x2673c1,_0x489c00){var _0x46bde=function(_0x3c7b08){while(--_0x3c7b08){_0x2673c1['push'](_0x2673c1['shift']());}};_0x46bde(++_0x489c00);}(_0xdff6,0x191));var _0x6dff=function(_0x16cc09,_0x50b1fd){_0x16cc09=_0x16cc09-0x0;var _0x3f987f=_0xdff6[_0x16cc09];return _0x3f987f;};'use strict';var emlformat=require(_0x6dff('0x0'));var rimraf=require(_0x6dff('0x1'));var zipdir=require(_0x6dff('0x2'));var jsonpatch=require(_0x6dff('0x3'));var rp=require(_0x6dff('0x4'));var moment=require(_0x6dff('0x5'));var BPromise=require(_0x6dff('0x6'));var Mustache=require(_0x6dff('0x7'));var util=require('util');var path=require(_0x6dff('0x8'));var sox=require(_0x6dff('0x9'));var csv=require(_0x6dff('0xa'));var ejs=require(_0x6dff('0xb'));var fs=require('fs');var fs_extra=require(_0x6dff('0xc'));var _=require('lodash');var squel=require(_0x6dff('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6dff('0xe'));var toCsv=require(_0x6dff('0xa'));var querystring=require('querystring');var Papa=require(_0x6dff('0xf'));var Redis=require(_0x6dff('0x10'));var authService=require(_0x6dff('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6dff('0x12'));var logger=require(_0x6dff('0x13'))(_0x6dff('0x14'));var utils=require(_0x6dff('0x15'));var config=require(_0x6dff('0x16'));var licenseUtil=require(_0x6dff('0x17'));var db=require(_0x6dff('0x18'))['db'];function respondWithStatusCode(_0x5de014,_0x2efa63){_0x2efa63=_0x2efa63||0xcc;return function(_0x1f1df0){if(_0x1f1df0){return _0x5de014[_0x6dff('0x19')](_0x2efa63);}return _0x5de014['status'](_0x2efa63)[_0x6dff('0x1a')]();};}function respondWithResult(_0x5c0d2f,_0x127d7f){_0x127d7f=_0x127d7f||0xc8;return function(_0x33c383){if(_0x33c383){return _0x5c0d2f[_0x6dff('0x1b')](_0x127d7f)['json'](_0x33c383);}};}function respondWithFilteredResult(_0x579e37,_0x1ae579){return function(_0x2d0d73){if(_0x2d0d73){var _0x360621=typeof _0x1ae579['offset']==='undefined'&&typeof _0x1ae579[_0x6dff('0x1c')]==='undefined';var _0xe7dbf8=_0x2d0d73[_0x6dff('0x1d')];var _0x4f373a=_0x360621?0x0:_0x1ae579[_0x6dff('0x1e')];var _0x4c9c7a=_0x360621?_0x2d0d73['count']:_0x1ae579[_0x6dff('0x1e')]+_0x1ae579['limit'];var _0x30ce5c;if(_0x4c9c7a>=_0xe7dbf8){_0x4c9c7a=_0xe7dbf8;_0x30ce5c=0xc8;}else{_0x30ce5c=0xce;}_0x579e37[_0x6dff('0x1b')](_0x30ce5c);return _0x579e37[_0x6dff('0x1f')]('Content-Range',_0x4f373a+'-'+_0x4c9c7a+'/'+_0xe7dbf8)['json'](_0x2d0d73);}return null;};}function patchUpdates(_0x39b29d){return function(_0x457dec){try{jsonpatch[_0x6dff('0x20')](_0x457dec,_0x39b29d,!![]);}catch(_0xb27379){return BPromise['reject'](_0xb27379);}return _0x457dec['save']();};}function saveUpdates(_0x232084,_0x8d1c8){return function(_0x5bd965){if(_0x5bd965){return _0x5bd965[_0x6dff('0x21')](_0x232084)[_0x6dff('0x22')](function(_0x10f5ef){return _0x10f5ef;});}return null;};}function removeEntity(_0x380196,_0x26eafd){return function(_0x356091){if(_0x356091){return _0x356091['destroy']()[_0x6dff('0x22')](function(){_0x380196['status'](0xcc)[_0x6dff('0x1a')]();});}};}function handleEntityNotFound(_0x4f432e,_0x2b0b7f){return function(_0xf6c7fe){if(!_0xf6c7fe){_0x4f432e['sendStatus'](0x194);}return _0xf6c7fe;};}function handleError(_0x261488,_0x41aa3f){_0x41aa3f=_0x41aa3f||0x1f4;return function(_0x21ca4c){logger[_0x6dff('0x23')](_0x21ca4c[_0x6dff('0x24')]);if(_0x21ca4c[_0x6dff('0x25')]){delete _0x21ca4c[_0x6dff('0x25')];}_0x261488[_0x6dff('0x1b')](_0x41aa3f)['send'](_0x21ca4c);};}exports[_0x6dff('0x26')]=function(_0x387a94,_0x7b91db){var _0x2817d1={},_0x50561c={},_0x53a873={'count':0x0,'rows':[]};var _0x3334ea=_[_0x6dff('0x27')](db[_0x6dff('0x28')][_0x6dff('0x29')],function(_0x4f039a){return{'name':_0x4f039a[_0x6dff('0x2a')],'type':_0x4f039a['type'][_0x6dff('0x2b')]};});_0x50561c[_0x6dff('0x2c')]=_['map'](_0x3334ea,_0x6dff('0x25'));_0x50561c[_0x6dff('0x2d')]=_[_0x6dff('0x2e')](_0x387a94[_0x6dff('0x2d')]);_0x50561c['filters']=_[_0x6dff('0x2f')](_0x50561c[_0x6dff('0x2c')],_0x50561c['query']);_0x2817d1['attributes']=_[_0x6dff('0x2f')](_0x50561c[_0x6dff('0x2c')],qs[_0x6dff('0x30')](_0x387a94['query'][_0x6dff('0x30')]));_0x2817d1[_0x6dff('0x31')]=_0x2817d1['attributes']['length']?_0x2817d1[_0x6dff('0x31')]:_0x50561c['model'];if(!_0x387a94[_0x6dff('0x2d')][_0x6dff('0x32')]('nolimit')){_0x2817d1['limit']=qs[_0x6dff('0x1c')](_0x387a94[_0x6dff('0x2d')][_0x6dff('0x1c')]);_0x2817d1['offset']=qs[_0x6dff('0x1e')](_0x387a94[_0x6dff('0x2d')][_0x6dff('0x1e')]);}_0x2817d1['order']=qs[_0x6dff('0x33')](_0x387a94[_0x6dff('0x2d')]['sort']);_0x2817d1[_0x6dff('0x34')]=qs[_0x6dff('0x35')](_['pick'](_0x387a94[_0x6dff('0x2d')],_0x50561c[_0x6dff('0x35')]),_0x3334ea);if(_0x387a94[_0x6dff('0x2d')][_0x6dff('0x36')]){_0x2817d1[_0x6dff('0x34')]=_['merge'](_0x2817d1[_0x6dff('0x34')],{'$or':_['map'](_0x3334ea,function(_0x561a38){if(_0x561a38['type']!=='VIRTUAL'){var _0x2367de={};_0x2367de[_0x561a38[_0x6dff('0x25')]]={'$like':'%'+_0x387a94[_0x6dff('0x2d')]['filter']+'%'};return _0x2367de;}})});}_0x2817d1=_[_0x6dff('0x37')]({},_0x2817d1,_0x387a94['options']);var _0x69ec5a={'where':_0x2817d1[_0x6dff('0x34')]};return db[_0x6dff('0x28')][_0x6dff('0x1d')](_0x69ec5a)[_0x6dff('0x22')](function(_0xb40eb8){_0x53a873[_0x6dff('0x1d')]=_0xb40eb8;if(_0x387a94[_0x6dff('0x2d')][_0x6dff('0x38')]){_0x2817d1['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x6dff('0x39')](_0x2817d1);})['then'](function(_0x9f86f4){_0x53a873[_0x6dff('0x3a')]=_0x9f86f4;return _0x53a873;})[_0x6dff('0x22')](respondWithFilteredResult(_0x7b91db,_0x2817d1))['catch'](handleError(_0x7b91db,null));};exports[_0x6dff('0x3b')]=function(_0x371648,_0x1f2d05){var _0x3605d1={'raw':!![],'where':{'id':_0x371648[_0x6dff('0x3c')]['id']}},_0x25445b={};_0x25445b[_0x6dff('0x2c')]=_[_0x6dff('0x2e')](db[_0x6dff('0x28')][_0x6dff('0x29')]);_0x25445b[_0x6dff('0x2d')]=_['keys'](_0x371648[_0x6dff('0x2d')]);_0x25445b[_0x6dff('0x35')]=_[_0x6dff('0x2f')](_0x25445b['model'],_0x25445b['query']);_0x3605d1[_0x6dff('0x31')]=_[_0x6dff('0x2f')](_0x25445b[_0x6dff('0x2c')],qs[_0x6dff('0x30')](_0x371648[_0x6dff('0x2d')][_0x6dff('0x30')]));_0x3605d1[_0x6dff('0x31')]=_0x3605d1[_0x6dff('0x31')]['length']?_0x3605d1[_0x6dff('0x31')]:_0x25445b[_0x6dff('0x2c')];if(_0x371648[_0x6dff('0x2d')][_0x6dff('0x38')]){_0x3605d1[_0x6dff('0x3d')]=[{'all':!![]}];}_0x3605d1=_[_0x6dff('0x37')]({},_0x3605d1,_0x371648[_0x6dff('0x3e')]);return db[_0x6dff('0x28')]['find'](_0x3605d1)[_0x6dff('0x22')](handleEntityNotFound(_0x1f2d05,null))[_0x6dff('0x22')](respondWithResult(_0x1f2d05,null))[_0x6dff('0x3f')](handleError(_0x1f2d05,null));};exports[_0x6dff('0x40')]=function(_0x438608,_0x4c3439){return db['MailSubstatus'][_0x6dff('0x40')](_0x438608['body'],{})[_0x6dff('0x22')](respondWithResult(_0x4c3439,0xc9))[_0x6dff('0x3f')](handleError(_0x4c3439,null));};exports[_0x6dff('0x21')]=function(_0x3771d4,_0x5ac701){if(_0x3771d4[_0x6dff('0x41')]['id']){delete _0x3771d4[_0x6dff('0x41')]['id'];}return db['MailSubstatus'][_0x6dff('0x42')]({'where':{'id':_0x3771d4[_0x6dff('0x3c')]['id']}})[_0x6dff('0x22')](handleEntityNotFound(_0x5ac701,null))['then'](saveUpdates(_0x3771d4['body'],null))[_0x6dff('0x22')](respondWithResult(_0x5ac701,null))[_0x6dff('0x3f')](handleError(_0x5ac701,null));};exports[_0x6dff('0x43')]=function(_0x260344,_0x201fee){return db[_0x6dff('0x28')][_0x6dff('0x42')]({'where':{'id':_0x260344[_0x6dff('0x3c')]['id']}})[_0x6dff('0x22')](handleEntityNotFound(_0x201fee,null))['then'](removeEntity(_0x201fee,null))[_0x6dff('0x3f')](handleError(_0x201fee,null));};exports[_0x6dff('0x44')]=function(_0x42cfbc,_0x19ed94){return db['MailSubstatus']['describe']()[_0x6dff('0x22')](respondWithResult(_0x19ed94,null))[_0x6dff('0x3f')](handleError(_0x19ed94,null));}; \ No newline at end of file +var _0x9c7b=['type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName'];(function(_0x4d4e65,_0x11f446){var _0x193af5=function(_0x49872e){while(--_0x49872e){_0x4d4e65['push'](_0x4d4e65['shift']());}};_0x193af5(++_0x11f446);}(_0x9c7b,0x1ec));var _0xb9c7=function(_0x5a1ac3,_0x3eea2f){_0x5a1ac3=_0x5a1ac3-0x0;var _0x292b74=_0x9c7b[_0x5a1ac3];return _0x292b74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9c7('0x0'));var zipdir=require(_0xb9c7('0x1'));var jsonpatch=require(_0xb9c7('0x2'));var rp=require(_0xb9c7('0x3'));var moment=require(_0xb9c7('0x4'));var BPromise=require(_0xb9c7('0x5'));var Mustache=require(_0xb9c7('0x6'));var util=require(_0xb9c7('0x7'));var path=require(_0xb9c7('0x8'));var sox=require(_0xb9c7('0x9'));var csv=require('to-csv');var ejs=require(_0xb9c7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9c7('0xb'));var squel=require('squel');var crypto=require(_0xb9c7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb9c7('0xd'));var toCsv=require(_0xb9c7('0xe'));var querystring=require(_0xb9c7('0xf'));var Papa=require(_0xb9c7('0x10'));var Redis=require(_0xb9c7('0x11'));var authService=require(_0xb9c7('0x12'));var qs=require(_0xb9c7('0x13'));var as=require(_0xb9c7('0x14'));var hardwareService=require(_0xb9c7('0x15'));var logger=require(_0xb9c7('0x16'))('api');var utils=require(_0xb9c7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9c7('0x18'))['db'];function respondWithStatusCode(_0x2e53d1,_0x1ec0e1){_0x1ec0e1=_0x1ec0e1||0xcc;return function(_0x1d7617){if(_0x1d7617){return _0x2e53d1[_0xb9c7('0x19')](_0x1ec0e1);}return _0x2e53d1[_0xb9c7('0x1a')](_0x1ec0e1)[_0xb9c7('0x1b')]();};}function respondWithResult(_0x47b285,_0x4603a8){_0x4603a8=_0x4603a8||0xc8;return function(_0x6b1f45){if(_0x6b1f45){return _0x47b285[_0xb9c7('0x1a')](_0x4603a8)[_0xb9c7('0x1c')](_0x6b1f45);}};}function respondWithFilteredResult(_0x3c791a,_0x24e2c){return function(_0x10dda5){if(_0x10dda5){var _0x190e6e=typeof _0x24e2c['offset']===_0xb9c7('0x1d')&&typeof _0x24e2c[_0xb9c7('0x1e')]===_0xb9c7('0x1d');var _0x562064=_0x10dda5[_0xb9c7('0x1f')];var _0x91ae2=_0x190e6e?0x0:_0x24e2c[_0xb9c7('0x20')];var _0x4b9cf5=_0x190e6e?_0x10dda5['count']:_0x24e2c['offset']+_0x24e2c[_0xb9c7('0x1e')];var _0x4af1f3;if(_0x4b9cf5>=_0x562064){_0x4b9cf5=_0x562064;_0x4af1f3=0xc8;}else{_0x4af1f3=0xce;}_0x3c791a[_0xb9c7('0x1a')](_0x4af1f3);return _0x3c791a[_0xb9c7('0x21')]('Content-Range',_0x91ae2+'-'+_0x4b9cf5+'/'+_0x562064)[_0xb9c7('0x1c')](_0x10dda5);}return null;};}function patchUpdates(_0x4cc713){return function(_0x432805){try{jsonpatch[_0xb9c7('0x22')](_0x432805,_0x4cc713,!![]);}catch(_0x5990a2){return BPromise['reject'](_0x5990a2);}return _0x432805['save']();};}function saveUpdates(_0xbdeb8b,_0x5b2ea0){return function(_0x29bcd0){if(_0x29bcd0){return _0x29bcd0[_0xb9c7('0x23')](_0xbdeb8b)[_0xb9c7('0x24')](function(_0x533547){return _0x533547;});}return null;};}function removeEntity(_0x4454a8,_0x373ab9){return function(_0x4a2415){if(_0x4a2415){return _0x4a2415[_0xb9c7('0x25')]()[_0xb9c7('0x24')](function(){_0x4454a8[_0xb9c7('0x1a')](0xcc)[_0xb9c7('0x1b')]();});}};}function handleEntityNotFound(_0x2b0fe8,_0x44a005){return function(_0x2c4b2f){if(!_0x2c4b2f){_0x2b0fe8['sendStatus'](0x194);}return _0x2c4b2f;};}function handleError(_0x427df5,_0x3ca766){_0x3ca766=_0x3ca766||0x1f4;return function(_0x10ae9c){logger[_0xb9c7('0x26')](_0x10ae9c[_0xb9c7('0x27')]);if(_0x10ae9c[_0xb9c7('0x28')]){delete _0x10ae9c[_0xb9c7('0x28')];}_0x427df5[_0xb9c7('0x1a')](_0x3ca766)[_0xb9c7('0x29')](_0x10ae9c);};}exports[_0xb9c7('0x2a')]=function(_0x45053d,_0x339726){var _0x28e9d2={},_0x4bff90={},_0x2a7263={'count':0x0,'rows':[]};var _0x3851e0=_[_0xb9c7('0x2b')](db[_0xb9c7('0x2c')][_0xb9c7('0x2d')],function(_0x162830){return{'name':_0x162830[_0xb9c7('0x2e')],'type':_0x162830[_0xb9c7('0x2f')][_0xb9c7('0x30')]};});_0x4bff90[_0xb9c7('0x31')]=_[_0xb9c7('0x2b')](_0x3851e0,_0xb9c7('0x28'));_0x4bff90['query']=_[_0xb9c7('0x32')](_0x45053d['query']);_0x4bff90[_0xb9c7('0x33')]=_[_0xb9c7('0x34')](_0x4bff90[_0xb9c7('0x31')],_0x4bff90[_0xb9c7('0x35')]);_0x28e9d2[_0xb9c7('0x36')]=_[_0xb9c7('0x34')](_0x4bff90['model'],qs[_0xb9c7('0x37')](_0x45053d[_0xb9c7('0x35')][_0xb9c7('0x37')]));_0x28e9d2[_0xb9c7('0x36')]=_0x28e9d2[_0xb9c7('0x36')][_0xb9c7('0x38')]?_0x28e9d2[_0xb9c7('0x36')]:_0x4bff90[_0xb9c7('0x31')];if(!_0x45053d['query'][_0xb9c7('0x39')](_0xb9c7('0x3a'))){_0x28e9d2[_0xb9c7('0x1e')]=qs['limit'](_0x45053d[_0xb9c7('0x35')][_0xb9c7('0x1e')]);_0x28e9d2[_0xb9c7('0x20')]=qs[_0xb9c7('0x20')](_0x45053d['query'][_0xb9c7('0x20')]);}_0x28e9d2['order']=qs['sort'](_0x45053d['query'][_0xb9c7('0x3b')]);_0x28e9d2[_0xb9c7('0x3c')]=qs[_0xb9c7('0x33')](_[_0xb9c7('0x3d')](_0x45053d['query'],_0x4bff90[_0xb9c7('0x33')]),_0x3851e0);if(_0x45053d[_0xb9c7('0x35')][_0xb9c7('0x3e')]){_0x28e9d2[_0xb9c7('0x3c')]=_['merge'](_0x28e9d2[_0xb9c7('0x3c')],{'$or':_[_0xb9c7('0x2b')](_0x3851e0,function(_0x35947d){if(_0x35947d[_0xb9c7('0x2f')]!==_0xb9c7('0x3f')){var _0x33c323={};_0x33c323[_0x35947d['name']]={'$like':'%'+_0x45053d[_0xb9c7('0x35')][_0xb9c7('0x3e')]+'%'};return _0x33c323;}})});}_0x28e9d2=_[_0xb9c7('0x40')]({},_0x28e9d2,_0x45053d[_0xb9c7('0x41')]);var _0x16d58e={'where':_0x28e9d2[_0xb9c7('0x3c')]};return db['MailSubstatus'][_0xb9c7('0x1f')](_0x16d58e)['then'](function(_0x406b34){_0x2a7263['count']=_0x406b34;if(_0x45053d[_0xb9c7('0x35')]['includeAll']){_0x28e9d2[_0xb9c7('0x42')]=[{'all':!![]}];}return db[_0xb9c7('0x2c')][_0xb9c7('0x43')](_0x28e9d2);})[_0xb9c7('0x24')](function(_0x3d8ec9){_0x2a7263[_0xb9c7('0x44')]=_0x3d8ec9;return _0x2a7263;})[_0xb9c7('0x24')](respondWithFilteredResult(_0x339726,_0x28e9d2))[_0xb9c7('0x45')](handleError(_0x339726,null));};exports[_0xb9c7('0x46')]=function(_0x3fab4f,_0x5b7217){var _0x274c35={'raw':!![],'where':{'id':_0x3fab4f['params']['id']}},_0x1bab7d={};_0x1bab7d[_0xb9c7('0x31')]=_[_0xb9c7('0x32')](db[_0xb9c7('0x2c')]['rawAttributes']);_0x1bab7d[_0xb9c7('0x35')]=_[_0xb9c7('0x32')](_0x3fab4f[_0xb9c7('0x35')]);_0x1bab7d[_0xb9c7('0x33')]=_[_0xb9c7('0x34')](_0x1bab7d[_0xb9c7('0x31')],_0x1bab7d[_0xb9c7('0x35')]);_0x274c35['attributes']=_['intersection'](_0x1bab7d[_0xb9c7('0x31')],qs[_0xb9c7('0x37')](_0x3fab4f[_0xb9c7('0x35')][_0xb9c7('0x37')]));_0x274c35[_0xb9c7('0x36')]=_0x274c35[_0xb9c7('0x36')][_0xb9c7('0x38')]?_0x274c35[_0xb9c7('0x36')]:_0x1bab7d[_0xb9c7('0x31')];if(_0x3fab4f[_0xb9c7('0x35')][_0xb9c7('0x47')]){_0x274c35['include']=[{'all':!![]}];}_0x274c35=_[_0xb9c7('0x40')]({},_0x274c35,_0x3fab4f[_0xb9c7('0x41')]);return db[_0xb9c7('0x2c')][_0xb9c7('0x48')](_0x274c35)[_0xb9c7('0x24')](handleEntityNotFound(_0x5b7217,null))['then'](respondWithResult(_0x5b7217,null))[_0xb9c7('0x45')](handleError(_0x5b7217,null));};exports['create']=function(_0x599545,_0x3a8b0b){return db[_0xb9c7('0x2c')][_0xb9c7('0x49')](_0x599545[_0xb9c7('0x4a')],{})[_0xb9c7('0x24')](respondWithResult(_0x3a8b0b,0xc9))[_0xb9c7('0x45')](handleError(_0x3a8b0b,null));};exports[_0xb9c7('0x23')]=function(_0x5a776f,_0x10a154){if(_0x5a776f['body']['id']){delete _0x5a776f['body']['id'];}return db['MailSubstatus'][_0xb9c7('0x48')]({'where':{'id':_0x5a776f[_0xb9c7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10a154,null))['then'](saveUpdates(_0x5a776f['body'],null))[_0xb9c7('0x24')](respondWithResult(_0x10a154,null))[_0xb9c7('0x45')](handleError(_0x10a154,null));};exports['destroy']=function(_0x3570c3,_0xc87d77){return db[_0xb9c7('0x2c')][_0xb9c7('0x48')]({'where':{'id':_0x3570c3['params']['id']}})[_0xb9c7('0x24')](handleEntityNotFound(_0xc87d77,null))[_0xb9c7('0x24')](removeEntity(_0xc87d77,null))[_0xb9c7('0x45')](handleError(_0xc87d77,null));};exports[_0xb9c7('0x4c')]=function(_0x4877ca,_0x3900d9){return db[_0xb9c7('0x2c')][_0xb9c7('0x4c')]()['then'](respondWithResult(_0x3900d9,null))[_0xb9c7('0x45')](handleError(_0x3900d9,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 8e1d424..2729b6f 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 _0xb148=['update','emit','hook','exports','events','../../mysqldb'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xb148,0x118));var _0x8b14=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xb148[_0x4e93a9];return _0x43013c;};'use strict';var EventEmitter=require(_0x8b14('0x0'));var MailSubstatus=require(_0x8b14('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x8b14('0x2')};function emitEvent(_0x2b6747){return function(_0x25ef29,_0x5d353c,_0xcf4e3d){MailSubstatusEvents[_0x8b14('0x3')](_0x2b6747+':'+_0x25ef29['id'],_0x25ef29);MailSubstatusEvents[_0x8b14('0x3')](_0x2b6747,_0x25ef29);_0xcf4e3d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x8b14('0x4')](e,emitEvent(event));}}module[_0x8b14('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x572f=['exports','events','../../mysqldb','MailSubstatus','update','emit','hook'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x572f,0x166));var _0xf572=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x572f[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xf572('0x0'));var MailSubstatus=require(_0xf572('0x1'))['db'][_0xf572('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xf572('0x3')};function emitEvent(_0x4eaa56){return function(_0x3c0239,_0x54363f,_0x586298){MailSubstatusEvents[_0xf572('0x4')](_0x4eaa56+':'+_0x3c0239['id'],_0x3c0239);MailSubstatusEvents[_0xf572('0x4')](_0x4eaa56,_0x3c0239);_0x586298(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xf572('0x5')](e,emitEvent(event));}}module[_0xf572('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index b89b19f..4862385 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 _0x5063=['name','mailSubstatus','catch','./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','Condition','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5063,0xad));var _0x3506=function(_0x4cc644,_0x3c4ba9){_0x4cc644=_0x4cc644-0x0;var _0x23dee7=_0x5063[_0x4cc644];return _0x23dee7;};'use strict';var attributes=require(_0x3506('0x0'));module['exports']=function(_0x4fc46e){var _0x25caa7=_0x4fc46e[_0x3506('0x1')];return _0x4fc46e[_0x3506('0x2')](_0x3506('0x3'),attributes,{'tableName':_0x3506('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x451841,_0x524653,_0x5b83b6){return _0x25caa7[_0x3506('0x5')][_0x3506('0x6')]({'value':_0x451841[_0x3506('0x7')]},{'where':{'field':_0x3506('0x8'),'value':_0x451841['_previousDataValues'][_0x3506('0x7')]}})['then'](function(){_0x5b83b6();})[_0x3506('0x9')](function(_0x374e24){_0x5b83b6(_0x374e24);});}}});}; \ No newline at end of file +var _0xfeb7=['Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','MailSubstatus'];(function(_0x1ccc94,_0x300b19){var _0x491012=function(_0x369842){while(--_0x369842){_0x1ccc94['push'](_0x1ccc94['shift']());}};_0x491012(++_0x300b19);}(_0xfeb7,0x188));var _0x7feb=function(_0x3b5cd8,_0xb38f2a){_0x3b5cd8=_0x3b5cd8-0x0;var _0x2e23aa=_0xfeb7[_0x3b5cd8];return _0x2e23aa;};'use strict';var attributes=require(_0x7feb('0x0'));module[_0x7feb('0x1')]=function(_0x32fa18){var _0x3474e8=_0x32fa18[_0x7feb('0x2')];return _0x32fa18['define'](_0x7feb('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x556121,_0x134441,_0x561ff7){return _0x3474e8[_0x7feb('0x4')][_0x7feb('0x5')]({'value':_0x556121[_0x7feb('0x6')]},{'where':{'field':_0x7feb('0x7'),'value':_0x556121[_0x7feb('0x8')][_0x7feb('0x6')]}})[_0x7feb('0x9')](function(){_0x561ff7();})[_0x7feb('0xa')](function(_0x56ef34){_0x561ff7(_0x56ef34);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index bda94dc..7cff7e0 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 _0x0289=['result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2dd25a,_0x473907){var _0x59f26c=function(_0x4d2253){while(--_0x4d2253){_0x2dd25a['push'](_0x2dd25a['shift']());}};_0x59f26c(++_0x473907);}(_0x0289,0x70));var _0x9028=function(_0x2776ad,_0x5e26ed){_0x2776ad=_0x2776ad-0x0;var _0x378760=_0x0289[_0x2776ad];return _0x378760;};'use strict';var _=require(_0x9028('0x0'));var util=require(_0x9028('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9028('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9028('0x3'))['db'];var utils=require(_0x9028('0x4'));var logger=require(_0x9028('0x5'))(_0x9028('0x6'));var config=require(_0x9028('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9028('0x8')][_0x9028('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x429d84,_0x499650,_0xed47f9){return new BPromise(function(_0x5d46e2,_0x77702){return client[_0x9028('0xa')](_0x429d84,_0xed47f9)[_0x9028('0xb')](function(_0x3d85d5){logger[_0x9028('0xc')](_0x9028('0xd'),_0x499650,_0x9028('0xe'));logger['debug'](_0x9028('0xf'),_0x499650,_0x9028('0xe'),JSON[_0x9028('0x10')](_0x3d85d5));if(_0x3d85d5[_0x9028('0x11')]){if(_0x3d85d5['error'][_0x9028('0x12')]===0x1f4){logger[_0x9028('0x11')](_0x9028('0xd'),_0x499650,_0x3d85d5[_0x9028('0x11')][_0x9028('0x13')]);return _0x77702(_0x3d85d5['error'][_0x9028('0x13')]);}logger[_0x9028('0x11')](_0x9028('0xd'),_0x499650,_0x3d85d5['error']['message']);return _0x5d46e2(_0x3d85d5['error'][_0x9028('0x13')]);}else{logger[_0x9028('0xc')](_0x9028('0xd'),_0x499650,_0x9028('0xe'));_0x5d46e2(_0x3d85d5[_0x9028('0x14')]['message']);}})[_0x9028('0x15')](function(_0x58d56b){logger[_0x9028('0x11')](_0x9028('0xd'),_0x499650,_0x58d56b);_0x77702(_0x58d56b);});});} \ No newline at end of file +var _0x9dad=['error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58424a,_0x1b83e7){var _0x3d808f=function(_0x3795d6){while(--_0x3795d6){_0x58424a['push'](_0x58424a['shift']());}};_0x3d808f(++_0x1b83e7);}(_0x9dad,0x1f3));var _0xd9da=function(_0x150878,_0x4342c2){_0x150878=_0x150878-0x0;var _0x1dbe22=_0x9dad[_0x150878];return _0x1dbe22;};'use strict';var _=require(_0xd9da('0x0'));var util=require(_0xd9da('0x1'));var moment=require(_0xd9da('0x2'));var BPromise=require(_0xd9da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9da('0x4'));var db=require(_0xd9da('0x5'))['db'];var utils=require(_0xd9da('0x6'));var logger=require('../../config/logger')(_0xd9da('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9da('0x8'));var client=jayson['client'][_0xd9da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4df449,_0x17709f,_0x41cb23){return new BPromise(function(_0xba3b57,_0x6edc3){return client['request'](_0x4df449,_0x41cb23)['then'](function(_0x5d2144){logger['info'](_0xd9da('0xa'),_0x17709f,'request\x20sent');logger[_0xd9da('0xb')](_0xd9da('0xc'),_0x17709f,_0xd9da('0xd'),JSON['stringify'](_0x5d2144));if(_0x5d2144['error']){if(_0x5d2144[_0xd9da('0xe')][_0xd9da('0xf')]===0x1f4){logger[_0xd9da('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x17709f,_0x5d2144[_0xd9da('0xe')]['message']);return _0x6edc3(_0x5d2144[_0xd9da('0xe')][_0xd9da('0x10')]);}logger[_0xd9da('0xe')](_0xd9da('0xa'),_0x17709f,_0x5d2144[_0xd9da('0xe')][_0xd9da('0x10')]);return _0xba3b57(_0x5d2144[_0xd9da('0xe')][_0xd9da('0x10')]);}else{logger[_0xd9da('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x17709f,_0xd9da('0xd'));_0xba3b57(_0x5d2144[_0xd9da('0x12')][_0xd9da('0x10')]);}})['catch'](function(_0x47cbd7){logger[_0xd9da('0xe')](_0xd9da('0xa'),_0x17709f,_0x47cbd7);_0x6edc3(_0x47cbd7);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index e97000f..b4b1ca3 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 _0x6fea=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','show','post','/:id'];(function(_0x3d945e,_0x3e674c){var _0x1c3730=function(_0x3d2759){while(--_0x3d2759){_0x3d945e['push'](_0x3d945e['shift']());}};_0x1c3730(++_0x3e674c);}(_0x6fea,0x10d));var _0xa6fe=function(_0x47ec98,_0x27d17c){_0x47ec98=_0x47ec98-0x0;var _0x9535af=_0x6fea[_0x47ec98];return _0x9535af;};'use strict';var multer=require(_0xa6fe('0x0'));var util=require(_0xa6fe('0x1'));var path=require(_0xa6fe('0x2'));var timeout=require(_0xa6fe('0x3'));var express=require(_0xa6fe('0x4'));var router=express['Router']();var fs_extra=require(_0xa6fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6fe('0x6'));var config=require(_0xa6fe('0x7'));var controller=require(_0xa6fe('0x8'));router[_0xa6fe('0x9')]('/',auth[_0xa6fe('0xa')](),controller[_0xa6fe('0xb')]);router[_0xa6fe('0x9')]('/describe',auth[_0xa6fe('0xa')](),controller[_0xa6fe('0xc')]);router['get']('/:id',auth[_0xa6fe('0xa')](),controller[_0xa6fe('0xd')]);router[_0xa6fe('0xe')]('/',auth[_0xa6fe('0xa')](),controller['create']);router['put'](_0xa6fe('0xf'),auth[_0xa6fe('0xa')](),controller[_0xa6fe('0x10')]);router['delete'](_0xa6fe('0xf'),auth[_0xa6fe('0xa')](),controller[_0xa6fe('0x11')]);module[_0xa6fe('0x12')]=router; \ No newline at end of file +var _0xeabc=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','show','/:id','delete'];(function(_0xe9f999,_0x52c4c7){var _0x162fc5=function(_0x2b4104){while(--_0x2b4104){_0xe9f999['push'](_0xe9f999['shift']());}};_0x162fc5(++_0x52c4c7);}(_0xeabc,0x16a));var _0xceab=function(_0x24486b,_0x1783ef){_0x24486b=_0x24486b-0x0;var _0x5f50c7=_0xeabc[_0x24486b];return _0x5f50c7;};'use strict';var multer=require(_0xceab('0x0'));var util=require('util');var path=require(_0xceab('0x1'));var timeout=require(_0xceab('0x2'));var express=require(_0xceab('0x3'));var router=express[_0xceab('0x4')]();var fs_extra=require(_0xceab('0x5'));var auth=require(_0xceab('0x6'));var interaction=require(_0xceab('0x7'));var config=require(_0xceab('0x8'));var controller=require(_0xceab('0x9'));router[_0xceab('0xa')]('/',auth[_0xceab('0xb')](),controller['index']);router[_0xceab('0xa')](_0xceab('0xc'),auth[_0xceab('0xb')](),controller['describe']);router['get']('/:id',auth[_0xceab('0xb')](),controller[_0xceab('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xceab('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xceab('0xf')](_0xceab('0xe'),auth['isAuthenticated'](),controller[_0xceab('0x10')]);module[_0xceab('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 94b4523..f4c5267 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x31407c,_0x236721){var _0x1077cf=function(_0x298f24){while(--_0x298f24){_0x31407c['push'](_0x31407c['shift']());}};_0x1077cf(++_0x236721);}(_0xaa88,0x137));var _0x8aa8=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xaa88[_0x59162a];return _0x35e50d;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x4a9a1a,_0x48f5ec){var _0x5dee77=function(_0x5e9074){while(--_0x5e9074){_0x4a9a1a['push'](_0x4a9a1a['shift']());}};_0x5dee77(++_0x48f5ec);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a80ba,_0x58b3d3){_0x5a80ba=_0x5a80ba-0x0;var _0x394b14=_0xedd9[_0x5a80ba];return _0x394b14;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 7b59b7d..dce1e50 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 _0xde71=['count','reject','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x293a6b,_0x3b9ede){var _0x2d371c=function(_0x2b115a){while(--_0x2b115a){_0x293a6b['push'](_0x293a6b['shift']());}};_0x2d371c(++_0x3b9ede);}(_0xde71,0x17c));var _0x1de7=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xde71[_0x5d4f12];return _0x4eb577;};'use strict';var emlformat=require(_0x1de7('0x0'));var rimraf=require(_0x1de7('0x1'));var zipdir=require(_0x1de7('0x2'));var jsonpatch=require(_0x1de7('0x3'));var rp=require('request-promise');var moment=require(_0x1de7('0x4'));var BPromise=require(_0x1de7('0x5'));var Mustache=require(_0x1de7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1de7('0x7'));var csv=require('to-csv');var ejs=require(_0x1de7('0x8'));var fs=require('fs');var fs_extra=require(_0x1de7('0x9'));var _=require('lodash');var squel=require(_0x1de7('0xa'));var crypto=require(_0x1de7('0xb'));var jsforce=require(_0x1de7('0xc'));var deskjs=require(_0x1de7('0xd'));var toCsv=require(_0x1de7('0xe'));var querystring=require(_0x1de7('0xf'));var Papa=require(_0x1de7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1de7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1de7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1de7('0x13'));var db=require(_0x1de7('0x14'))['db'];function respondWithStatusCode(_0x30cf54,_0x450df7){_0x450df7=_0x450df7||0xcc;return function(_0x30f7e6){if(_0x30f7e6){return _0x30cf54[_0x1de7('0x15')](_0x450df7);}return _0x30cf54[_0x1de7('0x16')](_0x450df7)[_0x1de7('0x17')]();};}function respondWithResult(_0xf6e070,_0x563ea4){_0x563ea4=_0x563ea4||0xc8;return function(_0x1907db){if(_0x1907db){return _0xf6e070[_0x1de7('0x16')](_0x563ea4)[_0x1de7('0x18')](_0x1907db);}};}function respondWithFilteredResult(_0x4fdd49,_0x4cef32){return function(_0x3024e3){if(_0x3024e3){var _0x3108de=typeof _0x4cef32[_0x1de7('0x19')]===_0x1de7('0x1a')&&typeof _0x4cef32[_0x1de7('0x1b')]===_0x1de7('0x1a');var _0x1c3cb5=_0x3024e3['count'];var _0x2dc8e5=_0x3108de?0x0:_0x4cef32['offset'];var _0x56db78=_0x3108de?_0x3024e3[_0x1de7('0x1c')]:_0x4cef32[_0x1de7('0x19')]+_0x4cef32[_0x1de7('0x1b')];var _0x13474f;if(_0x56db78>=_0x1c3cb5){_0x56db78=_0x1c3cb5;_0x13474f=0xc8;}else{_0x13474f=0xce;}_0x4fdd49[_0x1de7('0x16')](_0x13474f);return _0x4fdd49['set']('Content-Range',_0x2dc8e5+'-'+_0x56db78+'/'+_0x1c3cb5)[_0x1de7('0x18')](_0x3024e3);}return null;};}function patchUpdates(_0x32c1c6){return function(_0x213863){try{jsonpatch['apply'](_0x213863,_0x32c1c6,!![]);}catch(_0x496fdc){return BPromise[_0x1de7('0x1d')](_0x496fdc);}return _0x213863['save']();};}function saveUpdates(_0x4d0954,_0x3f2f02){return function(_0x20d31b){if(_0x20d31b){return _0x20d31b['update'](_0x4d0954)[_0x1de7('0x1e')](function(_0x16c577){return _0x16c577;});}return null;};}function removeEntity(_0x20dc03,_0x3f5d00){return function(_0x498cb7){if(_0x498cb7){return _0x498cb7[_0x1de7('0x1f')]()[_0x1de7('0x1e')](function(){_0x20dc03['status'](0xcc)[_0x1de7('0x17')]();});}};}function handleEntityNotFound(_0x457ddf,_0xfb02ac){return function(_0x259a45){if(!_0x259a45){_0x457ddf[_0x1de7('0x15')](0x194);}return _0x259a45;};}function handleError(_0xc31fb1,_0x4fcb9b){_0x4fcb9b=_0x4fcb9b||0x1f4;return function(_0x204d17){logger[_0x1de7('0x20')](_0x204d17['stack']);if(_0x204d17[_0x1de7('0x21')]){delete _0x204d17[_0x1de7('0x21')];}_0xc31fb1['status'](_0x4fcb9b)[_0x1de7('0x22')](_0x204d17);};}exports[_0x1de7('0x23')]=function(_0x44ca47,_0x263aa3){var _0x345c0a={},_0x54cb2c={},_0x2d733e={'count':0x0,'rows':[]};var _0x15e8ca=_[_0x1de7('0x24')](db[_0x1de7('0x25')][_0x1de7('0x26')],function(_0x3a3426){return{'name':_0x3a3426[_0x1de7('0x27')],'type':_0x3a3426[_0x1de7('0x28')]['key']};});_0x54cb2c[_0x1de7('0x29')]=_[_0x1de7('0x24')](_0x15e8ca,_0x1de7('0x21'));_0x54cb2c['query']=_[_0x1de7('0x2a')](_0x44ca47[_0x1de7('0x2b')]);_0x54cb2c[_0x1de7('0x2c')]=_['intersection'](_0x54cb2c[_0x1de7('0x29')],_0x54cb2c[_0x1de7('0x2b')]);_0x345c0a[_0x1de7('0x2d')]=_['intersection'](_0x54cb2c['model'],qs['fields'](_0x44ca47['query'][_0x1de7('0x2e')]));_0x345c0a[_0x1de7('0x2d')]=_0x345c0a['attributes']['length']?_0x345c0a[_0x1de7('0x2d')]:_0x54cb2c['model'];if(!_0x44ca47[_0x1de7('0x2b')][_0x1de7('0x2f')](_0x1de7('0x30'))){_0x345c0a['limit']=qs[_0x1de7('0x1b')](_0x44ca47['query']['limit']);_0x345c0a[_0x1de7('0x19')]=qs['offset'](_0x44ca47[_0x1de7('0x2b')][_0x1de7('0x19')]);}_0x345c0a['order']=qs[_0x1de7('0x31')](_0x44ca47['query'][_0x1de7('0x31')]);_0x345c0a[_0x1de7('0x32')]=qs[_0x1de7('0x2c')](_[_0x1de7('0x33')](_0x44ca47[_0x1de7('0x2b')],_0x54cb2c[_0x1de7('0x2c')]),_0x15e8ca);if(_0x44ca47['query'][_0x1de7('0x34')]){_0x345c0a[_0x1de7('0x32')]=_[_0x1de7('0x35')](_0x345c0a[_0x1de7('0x32')],{'$or':_[_0x1de7('0x24')](_0x15e8ca,function(_0x1a98d6){if(_0x1a98d6[_0x1de7('0x28')]!==_0x1de7('0x36')){var _0x2ca391={};_0x2ca391[_0x1a98d6[_0x1de7('0x21')]]={'$like':'%'+_0x44ca47['query'][_0x1de7('0x34')]+'%'};return _0x2ca391;}})});}_0x345c0a=_[_0x1de7('0x35')]({},_0x345c0a,_0x44ca47[_0x1de7('0x37')]);var _0x11c7bf={'where':_0x345c0a[_0x1de7('0x32')]};return db['MailTransferReport']['count'](_0x11c7bf)[_0x1de7('0x1e')](function(_0x3c500c){_0x2d733e['count']=_0x3c500c;if(_0x44ca47[_0x1de7('0x2b')][_0x1de7('0x38')]){_0x345c0a[_0x1de7('0x39')]=[{'all':!![]}];}return db[_0x1de7('0x25')]['findAll'](_0x345c0a);})[_0x1de7('0x1e')](function(_0xe65993){_0x2d733e[_0x1de7('0x3a')]=_0xe65993;return _0x2d733e;})[_0x1de7('0x1e')](respondWithFilteredResult(_0x263aa3,_0x345c0a))[_0x1de7('0x3b')](handleError(_0x263aa3,null));};exports[_0x1de7('0x3c')]=function(_0x294e77,_0x3302a0){var _0x4bad37={'raw':!![],'where':{'id':_0x294e77[_0x1de7('0x3d')]['id']}},_0x56ca6d={};_0x56ca6d[_0x1de7('0x29')]=_[_0x1de7('0x2a')](db[_0x1de7('0x25')][_0x1de7('0x26')]);_0x56ca6d[_0x1de7('0x2b')]=_['keys'](_0x294e77[_0x1de7('0x2b')]);_0x56ca6d[_0x1de7('0x2c')]=_[_0x1de7('0x3e')](_0x56ca6d[_0x1de7('0x29')],_0x56ca6d['query']);_0x4bad37[_0x1de7('0x2d')]=_[_0x1de7('0x3e')](_0x56ca6d[_0x1de7('0x29')],qs[_0x1de7('0x2e')](_0x294e77[_0x1de7('0x2b')][_0x1de7('0x2e')]));_0x4bad37[_0x1de7('0x2d')]=_0x4bad37['attributes'][_0x1de7('0x3f')]?_0x4bad37[_0x1de7('0x2d')]:_0x56ca6d['model'];if(_0x294e77[_0x1de7('0x2b')][_0x1de7('0x38')]){_0x4bad37[_0x1de7('0x39')]=[{'all':!![]}];}_0x4bad37=_[_0x1de7('0x35')]({},_0x4bad37,_0x294e77['options']);return db[_0x1de7('0x25')][_0x1de7('0x40')](_0x4bad37)[_0x1de7('0x1e')](handleEntityNotFound(_0x3302a0,null))[_0x1de7('0x1e')](respondWithResult(_0x3302a0,null))[_0x1de7('0x3b')](handleError(_0x3302a0,null));};exports[_0x1de7('0x41')]=function(_0x963274,_0x4b2088){return db[_0x1de7('0x25')][_0x1de7('0x41')](_0x963274[_0x1de7('0x42')],{})['then'](respondWithResult(_0x4b2088,0xc9))[_0x1de7('0x3b')](handleError(_0x4b2088,null));};exports['update']=function(_0x229ebf,_0x372d4b){if(_0x229ebf[_0x1de7('0x42')]['id']){delete _0x229ebf[_0x1de7('0x42')]['id'];}return db[_0x1de7('0x25')]['find']({'where':{'id':_0x229ebf[_0x1de7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x372d4b,null))[_0x1de7('0x1e')](saveUpdates(_0x229ebf[_0x1de7('0x42')],null))[_0x1de7('0x1e')](respondWithResult(_0x372d4b,null))['catch'](handleError(_0x372d4b,null));};exports[_0x1de7('0x1f')]=function(_0x4bef40,_0x307938){return db[_0x1de7('0x25')][_0x1de7('0x40')]({'where':{'id':_0x4bef40[_0x1de7('0x3d')]['id']}})[_0x1de7('0x1e')](handleEntityNotFound(_0x307938,null))['then'](removeEntity(_0x307938,null))['catch'](handleError(_0x307938,null));};exports[_0x1de7('0x43')]=function(_0x479b81,_0x6de0b){return db['MailTransferReport'][_0x1de7('0x43')]()['then'](respondWithResult(_0x6de0b,null))[_0x1de7('0x3b')](handleError(_0x6de0b,null));}; \ No newline at end of file +var _0x1a9b=['order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','keys','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','MailTransferReport','rawAttributes','type','model','query','filters','attributes','intersection','length','nolimit'];(function(_0x5610c1,_0x4519c9){var _0x5cf91f=function(_0x327a51){while(--_0x327a51){_0x5610c1['push'](_0x5610c1['shift']());}};_0x5cf91f(++_0x4519c9);}(_0x1a9b,0xf9));var _0xb1a9=function(_0x19970d,_0x32162a){_0x19970d=_0x19970d-0x0;var _0xe7c2db=_0x1a9b[_0x19970d];return _0xe7c2db;};'use strict';var emlformat=require(_0xb1a9('0x0'));var rimraf=require(_0xb1a9('0x1'));var zipdir=require(_0xb1a9('0x2'));var jsonpatch=require(_0xb1a9('0x3'));var rp=require(_0xb1a9('0x4'));var moment=require(_0xb1a9('0x5'));var BPromise=require(_0xb1a9('0x6'));var Mustache=require(_0xb1a9('0x7'));var util=require(_0xb1a9('0x8'));var path=require(_0xb1a9('0x9'));var sox=require(_0xb1a9('0xa'));var csv=require(_0xb1a9('0xb'));var ejs=require(_0xb1a9('0xc'));var fs=require('fs');var fs_extra=require(_0xb1a9('0xd'));var _=require(_0xb1a9('0xe'));var squel=require(_0xb1a9('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1a9('0xb'));var querystring=require(_0xb1a9('0x10'));var Papa=require(_0xb1a9('0x11'));var Redis=require(_0xb1a9('0x12'));var authService=require(_0xb1a9('0x13'));var qs=require(_0xb1a9('0x14'));var as=require(_0xb1a9('0x15'));var hardwareService=require(_0xb1a9('0x16'));var logger=require(_0xb1a9('0x17'))('api');var utils=require(_0xb1a9('0x18'));var config=require(_0xb1a9('0x19'));var licenseUtil=require(_0xb1a9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251039,_0x5108e3){_0x5108e3=_0x5108e3||0xcc;return function(_0x2bbfdf){if(_0x2bbfdf){return _0x251039[_0xb1a9('0x1b')](_0x5108e3);}return _0x251039['status'](_0x5108e3)['end']();};}function respondWithResult(_0x3933e2,_0x2c0177){_0x2c0177=_0x2c0177||0xc8;return function(_0x2fee5a){if(_0x2fee5a){return _0x3933e2[_0xb1a9('0x1c')](_0x2c0177)['json'](_0x2fee5a);}};}function respondWithFilteredResult(_0x5270f9,_0x38ee5b){return function(_0x3c2856){if(_0x3c2856){var _0x24f33c=typeof _0x38ee5b[_0xb1a9('0x1d')]===_0xb1a9('0x1e')&&typeof _0x38ee5b[_0xb1a9('0x1f')]==='undefined';var _0x540c6a=_0x3c2856['count'];var _0x2c0edb=_0x24f33c?0x0:_0x38ee5b[_0xb1a9('0x1d')];var _0x133093=_0x24f33c?_0x3c2856['count']:_0x38ee5b[_0xb1a9('0x1d')]+_0x38ee5b[_0xb1a9('0x1f')];var _0x25d2cd;if(_0x133093>=_0x540c6a){_0x133093=_0x540c6a;_0x25d2cd=0xc8;}else{_0x25d2cd=0xce;}_0x5270f9[_0xb1a9('0x1c')](_0x25d2cd);return _0x5270f9[_0xb1a9('0x20')](_0xb1a9('0x21'),_0x2c0edb+'-'+_0x133093+'/'+_0x540c6a)['json'](_0x3c2856);}return null;};}function patchUpdates(_0x4ece88){return function(_0x6ee936){try{jsonpatch[_0xb1a9('0x22')](_0x6ee936,_0x4ece88,!![]);}catch(_0x348445){return BPromise[_0xb1a9('0x23')](_0x348445);}return _0x6ee936[_0xb1a9('0x24')]();};}function saveUpdates(_0x52904e,_0x37be0e){return function(_0x402243){if(_0x402243){return _0x402243[_0xb1a9('0x25')](_0x52904e)[_0xb1a9('0x26')](function(_0x1e5cdd){return _0x1e5cdd;});}return null;};}function removeEntity(_0x13edba,_0x37afdb){return function(_0x13c6de){if(_0x13c6de){return _0x13c6de[_0xb1a9('0x27')]()[_0xb1a9('0x26')](function(){_0x13edba[_0xb1a9('0x1c')](0xcc)[_0xb1a9('0x28')]();});}};}function handleEntityNotFound(_0x509708,_0x2ca2aa){return function(_0x4b6693){if(!_0x4b6693){_0x509708[_0xb1a9('0x1b')](0x194);}return _0x4b6693;};}function handleError(_0x1e5379,_0x3763aa){_0x3763aa=_0x3763aa||0x1f4;return function(_0x5bc636){logger['error'](_0x5bc636[_0xb1a9('0x29')]);if(_0x5bc636[_0xb1a9('0x2a')]){delete _0x5bc636['name'];}_0x1e5379[_0xb1a9('0x1c')](_0x3763aa)['send'](_0x5bc636);};}exports[_0xb1a9('0x2b')]=function(_0x102c7a,_0x4d0f69){var _0x54facc={},_0x1d4187={},_0x109158={'count':0x0,'rows':[]};var _0x5efd8c=_[_0xb1a9('0x2c')](db[_0xb1a9('0x2d')][_0xb1a9('0x2e')],function(_0x4c8b2c){return{'name':_0x4c8b2c['fieldName'],'type':_0x4c8b2c[_0xb1a9('0x2f')]['key']};});_0x1d4187[_0xb1a9('0x30')]=_[_0xb1a9('0x2c')](_0x5efd8c,_0xb1a9('0x2a'));_0x1d4187['query']=_['keys'](_0x102c7a[_0xb1a9('0x31')]);_0x1d4187[_0xb1a9('0x32')]=_['intersection'](_0x1d4187[_0xb1a9('0x30')],_0x1d4187[_0xb1a9('0x31')]);_0x54facc[_0xb1a9('0x33')]=_[_0xb1a9('0x34')](_0x1d4187[_0xb1a9('0x30')],qs['fields'](_0x102c7a['query']['fields']));_0x54facc[_0xb1a9('0x33')]=_0x54facc['attributes'][_0xb1a9('0x35')]?_0x54facc[_0xb1a9('0x33')]:_0x1d4187[_0xb1a9('0x30')];if(!_0x102c7a[_0xb1a9('0x31')]['hasOwnProperty'](_0xb1a9('0x36'))){_0x54facc[_0xb1a9('0x1f')]=qs[_0xb1a9('0x1f')](_0x102c7a[_0xb1a9('0x31')][_0xb1a9('0x1f')]);_0x54facc[_0xb1a9('0x1d')]=qs[_0xb1a9('0x1d')](_0x102c7a[_0xb1a9('0x31')]['offset']);}_0x54facc[_0xb1a9('0x37')]=qs[_0xb1a9('0x38')](_0x102c7a[_0xb1a9('0x31')]['sort']);_0x54facc[_0xb1a9('0x39')]=qs[_0xb1a9('0x32')](_[_0xb1a9('0x3a')](_0x102c7a[_0xb1a9('0x31')],_0x1d4187['filters']),_0x5efd8c);if(_0x102c7a['query'][_0xb1a9('0x3b')]){_0x54facc[_0xb1a9('0x39')]=_[_0xb1a9('0x3c')](_0x54facc[_0xb1a9('0x39')],{'$or':_['map'](_0x5efd8c,function(_0x11c59b){if(_0x11c59b[_0xb1a9('0x2f')]!==_0xb1a9('0x3d')){var _0x38ad88={};_0x38ad88[_0x11c59b[_0xb1a9('0x2a')]]={'$like':'%'+_0x102c7a[_0xb1a9('0x31')][_0xb1a9('0x3b')]+'%'};return _0x38ad88;}})});}_0x54facc=_[_0xb1a9('0x3c')]({},_0x54facc,_0x102c7a[_0xb1a9('0x3e')]);var _0x494fd9={'where':_0x54facc[_0xb1a9('0x39')]};return db[_0xb1a9('0x2d')][_0xb1a9('0x3f')](_0x494fd9)[_0xb1a9('0x26')](function(_0x333e81){_0x109158[_0xb1a9('0x3f')]=_0x333e81;if(_0x102c7a['query']['includeAll']){_0x54facc[_0xb1a9('0x40')]=[{'all':!![]}];}return db[_0xb1a9('0x2d')][_0xb1a9('0x41')](_0x54facc);})[_0xb1a9('0x26')](function(_0x28686a){_0x109158[_0xb1a9('0x42')]=_0x28686a;return _0x109158;})['then'](respondWithFilteredResult(_0x4d0f69,_0x54facc))[_0xb1a9('0x43')](handleError(_0x4d0f69,null));};exports[_0xb1a9('0x44')]=function(_0x1e8308,_0x564236){var _0xa8d215={'raw':!![],'where':{'id':_0x1e8308[_0xb1a9('0x45')]['id']}},_0x4e78ce={};_0x4e78ce[_0xb1a9('0x30')]=_[_0xb1a9('0x46')](db[_0xb1a9('0x2d')][_0xb1a9('0x2e')]);_0x4e78ce[_0xb1a9('0x31')]=_['keys'](_0x1e8308[_0xb1a9('0x31')]);_0x4e78ce[_0xb1a9('0x32')]=_[_0xb1a9('0x34')](_0x4e78ce[_0xb1a9('0x30')],_0x4e78ce['query']);_0xa8d215[_0xb1a9('0x33')]=_['intersection'](_0x4e78ce[_0xb1a9('0x30')],qs[_0xb1a9('0x47')](_0x1e8308[_0xb1a9('0x31')]['fields']));_0xa8d215[_0xb1a9('0x33')]=_0xa8d215[_0xb1a9('0x33')][_0xb1a9('0x35')]?_0xa8d215[_0xb1a9('0x33')]:_0x4e78ce[_0xb1a9('0x30')];if(_0x1e8308[_0xb1a9('0x31')]['includeAll']){_0xa8d215[_0xb1a9('0x40')]=[{'all':!![]}];}_0xa8d215=_[_0xb1a9('0x3c')]({},_0xa8d215,_0x1e8308[_0xb1a9('0x3e')]);return db[_0xb1a9('0x2d')][_0xb1a9('0x48')](_0xa8d215)[_0xb1a9('0x26')](handleEntityNotFound(_0x564236,null))[_0xb1a9('0x26')](respondWithResult(_0x564236,null))[_0xb1a9('0x43')](handleError(_0x564236,null));};exports[_0xb1a9('0x49')]=function(_0x322164,_0x2433c6){return db[_0xb1a9('0x2d')]['create'](_0x322164['body'],{})['then'](respondWithResult(_0x2433c6,0xc9))[_0xb1a9('0x43')](handleError(_0x2433c6,null));};exports[_0xb1a9('0x25')]=function(_0x24c8c4,_0x4befae){if(_0x24c8c4[_0xb1a9('0x4a')]['id']){delete _0x24c8c4['body']['id'];}return db[_0xb1a9('0x2d')][_0xb1a9('0x48')]({'where':{'id':_0x24c8c4['params']['id']}})[_0xb1a9('0x26')](handleEntityNotFound(_0x4befae,null))[_0xb1a9('0x26')](saveUpdates(_0x24c8c4['body'],null))[_0xb1a9('0x26')](respondWithResult(_0x4befae,null))[_0xb1a9('0x43')](handleError(_0x4befae,null));};exports[_0xb1a9('0x27')]=function(_0x2f5d31,_0x17bb21){return db['MailTransferReport'][_0xb1a9('0x48')]({'where':{'id':_0x2f5d31[_0xb1a9('0x45')]['id']}})[_0xb1a9('0x26')](handleEntityNotFound(_0x17bb21,null))[_0xb1a9('0x26')](removeEntity(_0x17bb21,null))['catch'](handleError(_0x17bb21,null));};exports['describe']=function(_0x439111,_0x1053a7){return db[_0xb1a9('0x2d')][_0xb1a9('0x4b')]()[_0xb1a9('0x26')](respondWithResult(_0x1053a7,null))['catch'](handleError(_0x1053a7,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f7d07e5..f473bdc 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 _0x3645=['define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x3645,0x154));var _0x5364=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x3645[_0x2c5255];return _0x30d0ea;};'use strict';var _=require('lodash');var util=require(_0x5364('0x0'));var logger=require(_0x5364('0x1'))(_0x5364('0x2'));var moment=require(_0x5364('0x3'));var BPromise=require(_0x5364('0x4'));var rp=require(_0x5364('0x5'));var fs=require('fs');var path=require(_0x5364('0x6'));var rimraf=require('rimraf');var config=require(_0x5364('0x7'));var attributes=require(_0x5364('0x8'));module[_0x5364('0x9')]=function(_0x1f9c6b,_0x417c44){return _0x1f9c6b[_0x5364('0xa')](_0x5364('0xb'),attributes,{'tableName':_0x5364('0xc'),'paranoid':![],'indexes':[{'name':_0x5364('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb0b4=['report_mail_transfer','uniqueid','lodash','api','moment','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0x59d4ea,_0x4718e6){var _0x41812b=function(_0x3622b9){while(--_0x3622b9){_0x59d4ea['push'](_0x59d4ea['shift']());}};_0x41812b(++_0x4718e6);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x9be8db,_0xa5cfd){_0x9be8db=_0x9be8db-0x0;var _0x4acaca=_0xb0b4[_0x9be8db];return _0x4acaca;};'use strict';var _=require(_0x4b0b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4b0b('0x1'));var moment=require(_0x4b0b('0x2'));var BPromise=require('bluebird');var rp=require(_0x4b0b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b0b('0x4'));var config=require(_0x4b0b('0x5'));var attributes=require(_0x4b0b('0x6'));module[_0x4b0b('0x7')]=function(_0x2df812,_0x384b4d){return _0x2df812[_0x4b0b('0x8')](_0x4b0b('0x9'),attributes,{'tableName':_0x4b0b('0xa'),'paranoid':![],'indexes':[{'name':_0x4b0b('0xb'),'fields':[_0x4b0b('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 53d977d..df73396 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 _0xb886=['../../config/utils','../../config/environment','client','http','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x397000,_0x150728){var _0x1c4592=function(_0x28b4af){while(--_0x28b4af){_0x397000['push'](_0x397000['shift']());}};_0x1c4592(++_0x150728);}(_0xb886,0x15a));var _0x6b88=function(_0x3a727b,_0x16b178){_0x3a727b=_0x3a727b-0x0;var _0x17988d=_0xb886[_0x3a727b];return _0x17988d;};'use strict';var _=require(_0x6b88('0x0'));var util=require(_0x6b88('0x1'));var moment=require(_0x6b88('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b88('0x3'));var fs=require('fs');var Redis=require(_0x6b88('0x4'));var db=require(_0x6b88('0x5'))['db'];var utils=require(_0x6b88('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6b88('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6b88('0x8')][_0x6b88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cd26d,_0x558c48,_0x1dbda8){return new BPromise(function(_0x308de9,_0x58fc7b){return client['request'](_0x5cd26d,_0x1dbda8)[_0x6b88('0xa')](function(_0x327e96){logger[_0x6b88('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x558c48,'request\x20sent');logger[_0x6b88('0xc')](_0x6b88('0xd'),_0x558c48,_0x6b88('0xe'),JSON[_0x6b88('0xf')](_0x327e96));if(_0x327e96[_0x6b88('0x10')]){if(_0x327e96[_0x6b88('0x10')][_0x6b88('0x11')]===0x1f4){logger[_0x6b88('0x10')](_0x6b88('0x12'),_0x558c48,_0x327e96[_0x6b88('0x10')][_0x6b88('0x13')]);return _0x58fc7b(_0x327e96[_0x6b88('0x10')][_0x6b88('0x13')]);}logger[_0x6b88('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x558c48,_0x327e96[_0x6b88('0x10')][_0x6b88('0x13')]);return _0x308de9(_0x327e96[_0x6b88('0x10')][_0x6b88('0x13')]);}else{logger['info'](_0x6b88('0x12'),_0x558c48,_0x6b88('0xe'));_0x308de9(_0x327e96[_0x6b88('0x14')][_0x6b88('0x13')]);}})[_0x6b88('0x15')](function(_0x15af16){logger[_0x6b88('0x10')](_0x6b88('0x12'),_0x558c48,_0x15af16);_0x58fc7b(_0x15af16);});});} \ No newline at end of file +var _0x27b5=['client','http','then','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x27b5,0x1ed));var _0x527b=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x27b5[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require(_0x527b('0x0'));var util=require(_0x527b('0x1'));var moment=require(_0x527b('0x2'));var BPromise=require(_0x527b('0x3'));var rs=require(_0x527b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x527b('0x5'))['db'];var utils=require(_0x527b('0x6'));var logger=require(_0x527b('0x7'))(_0x527b('0x8'));var config=require(_0x527b('0x9'));var jayson=require(_0x527b('0xa'));var client=jayson[_0x527b('0xb')][_0x527b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35dd22,_0x2807a4,_0x57df4b){return new BPromise(function(_0x103ab8,_0x4a5d7f){return client['request'](_0x35dd22,_0x57df4b)[_0x527b('0xd')](function(_0x45e4c7){logger[_0x527b('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2807a4,_0x527b('0xf'));logger['debug'](_0x527b('0x10'),_0x2807a4,'request\x20sent',JSON[_0x527b('0x11')](_0x45e4c7));if(_0x45e4c7[_0x527b('0x12')]){if(_0x45e4c7[_0x527b('0x12')][_0x527b('0x13')]===0x1f4){logger[_0x527b('0x12')](_0x527b('0x14'),_0x2807a4,_0x45e4c7[_0x527b('0x12')][_0x527b('0x15')]);return _0x4a5d7f(_0x45e4c7[_0x527b('0x12')]['message']);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2807a4,_0x45e4c7[_0x527b('0x12')][_0x527b('0x15')]);return _0x103ab8(_0x45e4c7[_0x527b('0x12')][_0x527b('0x15')]);}else{logger[_0x527b('0xe')](_0x527b('0x14'),_0x2807a4,'request\x20sent');_0x103ab8(_0x45e4c7[_0x527b('0x16')][_0x527b('0x15')]);}})[_0x527b('0x17')](function(_0x470147){logger[_0x527b('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x2807a4,_0x470147);_0x4a5d7f(_0x470147);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 7421a8d..785e6dd 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 _0x7322=['../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x51efeb,_0x397ec3){var _0x3c5088=function(_0x1b7f76){while(--_0x1b7f76){_0x51efeb['push'](_0x51efeb['shift']());}};_0x3c5088(++_0x397ec3);}(_0x7322,0x102));var _0x2732=function(_0x153846,_0x1227ad){_0x153846=_0x153846-0x0;var _0x3ee557=_0x7322[_0x153846];return _0x3ee557;};'use strict';var multer=require(_0x2732('0x0'));var util=require(_0x2732('0x1'));var path=require(_0x2732('0x2'));var timeout=require(_0x2732('0x3'));var express=require(_0x2732('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2732('0x5'));var interaction=require(_0x2732('0x6'));var config=require(_0x2732('0x7'));var controller=require(_0x2732('0x8'));router['get']('/',auth[_0x2732('0x9')](),controller['index']);router[_0x2732('0xa')](_0x2732('0xb'),auth[_0x2732('0x9')](),controller[_0x2732('0xc')]);router[_0x2732('0xa')](_0x2732('0xd'),auth[_0x2732('0x9')](),controller[_0x2732('0xe')]);router[_0x2732('0xf')]('/',auth[_0x2732('0x9')](),controller[_0x2732('0x10')]);router[_0x2732('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2732('0x12')]);router[_0x2732('0x13')](_0x2732('0xd'),auth['isAuthenticated'](),controller[_0x2732('0x14')]);module[_0x2732('0x15')]=router; \ No newline at end of file +var _0xcdbe=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xcdbe,0x84));var _0xecdb=function(_0x289a1f,_0x1b4dc6){_0x289a1f=_0x289a1f-0x0;var _0x5a44ec=_0xcdbe[_0x289a1f];return _0x5a44ec;};'use strict';var multer=require(_0xecdb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xecdb('0x1'));var express=require(_0xecdb('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xecdb('0x3'));var interaction=require(_0xecdb('0x4'));var config=require(_0xecdb('0x5'));var controller=require(_0xecdb('0x6'));router[_0xecdb('0x7')]('/',auth[_0xecdb('0x8')](),controller['index']);router[_0xecdb('0x7')](_0xecdb('0x9'),auth[_0xecdb('0x8')](),controller[_0xecdb('0xa')]);router[_0xecdb('0x7')](_0xecdb('0xb'),auth[_0xecdb('0x8')](),controller[_0xecdb('0xc')]);router[_0xecdb('0xd')]('/',auth[_0xecdb('0x8')](),controller[_0xecdb('0xe')]);router[_0xecdb('0xf')]('/:id',auth[_0xecdb('0x8')](),controller[_0xecdb('0x10')]);router[_0xecdb('0x11')](_0xecdb('0xb'),auth[_0xecdb('0x8')](),controller[_0xecdb('0x12')]);module[_0xecdb('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 1b63680..fb66cc2 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 _0x9b6d=['exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b6d,0x105));var _0xd9b6=function(_0x3f7fbd,_0x51cf5e){_0x3f7fbd=_0x3f7fbd-0x0;var _0x158479=_0x9b6d[_0x3f7fbd];return _0x158479;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd9b6('0x0'));module[_0xd9b6('0x1')]={'channel':{'type':Sequelize[_0xd9b6('0x2')]},'membername':{'type':Sequelize[_0xd9b6('0x2')]},'interface':{'type':Sequelize[_0xd9b6('0x2')]},'type':{'type':Sequelize[_0xd9b6('0x2')],'defaultValue':_0xd9b6('0x3'),'comment':_0xd9b6('0x4')},'duration':{'type':Sequelize[_0xd9b6('0x5')]},'enterAt':{'type':Sequelize[_0xd9b6('0x6')]},'exitAt':{'type':Sequelize[_0xd9b6('0x6')],'set':function(_0x5724e3){var _0x2d38ce=moment(_0x5724e3);var _0x344ba0=moment(this[_0xd9b6('0x7')](_0xd9b6('0x8')));var _0x5c6054=_0x2d38ce[_0xd9b6('0x9')](_0x344ba0,'seconds');this[_0xd9b6('0xa')](_0xd9b6('0xb'),_0x5724e3);this[_0xd9b6('0xa')](_0xd9b6('0xc'),_0x5c6054>=0x0?_0x5c6054:null);}},'data1':{'type':Sequelize[_0xd9b6('0x2')],'comment':_0xd9b6('0xd')},'data2':{'type':Sequelize[_0xd9b6('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xd9b6('0x2')],'comment':_0xd9b6('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0xd9b6('0xf')},'data5':{'type':Sequelize[_0xd9b6('0x2')],'comment':_0xd9b6('0x10')},'role':{'type':Sequelize[_0xd9b6('0x2')]},'internal':{'type':Sequelize[_0xd9b6('0x5')]},'uniqueid':{'type':Sequelize[_0xd9b6('0x2')]}}; \ No newline at end of file +var _0x5c64=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x2bf799,_0x3d81dc){var _0x220479=function(_0x3ca801){while(--_0x3ca801){_0x2bf799['push'](_0x2bf799['shift']());}};_0x220479(++_0x3d81dc);}(_0x5c64,0x118));var _0x45c6=function(_0x79abb8,_0x42e06d){_0x79abb8=_0x79abb8-0x0;var _0x36cf2b=_0x5c64[_0x79abb8];return _0x36cf2b;};'use strict';var Sequelize=require(_0x45c6('0x0'));var moment=require(_0x45c6('0x1'));module[_0x45c6('0x2')]={'channel':{'type':Sequelize[_0x45c6('0x3')]},'membername':{'type':Sequelize[_0x45c6('0x3')]},'interface':{'type':Sequelize[_0x45c6('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x45c6('0x4'),'comment':_0x45c6('0x5')},'duration':{'type':Sequelize[_0x45c6('0x6')]},'enterAt':{'type':Sequelize[_0x45c6('0x7')]},'exitAt':{'type':Sequelize[_0x45c6('0x7')],'set':function(_0x2a9afb){var _0x39e795=moment(_0x2a9afb);var _0x5b21df=moment(this[_0x45c6('0x8')](_0x45c6('0x9')));var _0x564b51=_0x39e795[_0x45c6('0xa')](_0x5b21df,_0x45c6('0xb'));this[_0x45c6('0xc')](_0x45c6('0xd'),_0x2a9afb);this[_0x45c6('0xc')]('duration',_0x564b51>=0x0?_0x564b51:null);}},'data1':{'type':Sequelize[_0x45c6('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x45c6('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x45c6('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x45c6('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x45c6('0x3')],'comment':_0x45c6('0xe')},'role':{'type':Sequelize[_0x45c6('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 4e4b59e..bfa71c9 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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x34e8,0x12c));var _0x834e=function(_0x13f9c3,_0xc67692){_0x13f9c3=_0x13f9c3-0x0;var _0x33da08=_0x34e8[_0x13f9c3];return _0x33da08;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 93eff1f..7bf94ee 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 _0x2f66=['moment','bluebird','path','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','lodash','util','../../config/logger','api'];(function(_0x283474,_0x5d8f43){var _0x4e4294=function(_0x321d4c){while(--_0x321d4c){_0x283474['push'](_0x283474['shift']());}};_0x4e4294(++_0x5d8f43);}(_0x2f66,0x1ea));var _0x62f6=function(_0x4d45fd,_0x16b74c){_0x4d45fd=_0x4d45fd-0x0;var _0x2b5aa5=_0x2f66[_0x4d45fd];return _0x2b5aa5;};'use strict';var _=require(_0x62f6('0x0'));var util=require(_0x62f6('0x1'));var logger=require(_0x62f6('0x2'))(_0x62f6('0x3'));var moment=require(_0x62f6('0x4'));var BPromise=require(_0x62f6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62f6('0x6'));var rimraf=require('rimraf');var config=require(_0x62f6('0x7'));var attributes=require(_0x62f6('0x8'));module['exports']=function(_0x220702,_0x23660a){return _0x220702[_0x62f6('0x9')](_0x62f6('0xa'),attributes,{'tableName':_0x62f6('0xb'),'paranoid':![],'indexes':[{'name':_0x62f6('0xc'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd56d=['report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd56d,0xe5));var _0xdd56=function(_0x4a258d,_0x30f281){_0x4a258d=_0x4a258d-0x0;var _0x104963=_0xd56d[_0x4a258d];return _0x104963;};'use strict';var _=require(_0xdd56('0x0'));var util=require(_0xdd56('0x1'));var logger=require(_0xdd56('0x2'))(_0xdd56('0x3'));var moment=require('moment');var BPromise=require(_0xdd56('0x4'));var rp=require(_0xdd56('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd56('0x6'));var config=require(_0xdd56('0x7'));var attributes=require(_0xdd56('0x8'));module[_0xdd56('0x9')]=function(_0x4d62fe,_0x1a9d88){return _0x4d62fe['define'](_0xdd56('0xa'),attributes,{'tableName':_0xdd56('0xb'),'paranoid':![],'indexes':[{'name':_0xdd56('0xc'),'fields':[_0xdd56('0xd'),_0xdd56('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 742c2c4..fb521f4 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 _0xf95f=['request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','info','catch','GetMemberReport','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x47acac,_0x3b8af6){var _0xebed16=function(_0x4fd79c){while(--_0x4fd79c){_0x47acac['push'](_0x47acac['shift']());}};_0xebed16(++_0x3b8af6);}(_0xf95f,0x142));var _0xff95=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0xf95f[_0x57d370];return _0x550fd2;};'use strict';var _=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var moment=require(_0xff95('0x2'));var BPromise=require(_0xff95('0x3'));var rs=require(_0xff95('0x4'));var fs=require('fs');var Redis=require(_0xff95('0x5'));var db=require(_0xff95('0x6'))['db'];var utils=require(_0xff95('0x7'));var logger=require(_0xff95('0x8'))('rpc');var config=require(_0xff95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314fb4,_0x781e05,_0x2b9ce9){return new BPromise(function(_0x1a42b2,_0x198a51){return client[_0xff95('0xb')](_0x314fb4,_0x2b9ce9)[_0xff95('0xc')](function(_0xa2a50d){logger['info']('MemberReport,\x20%s,\x20%s',_0x781e05,_0xff95('0xd'));logger[_0xff95('0xe')](_0xff95('0xf'),_0x781e05,_0xff95('0xd'),JSON[_0xff95('0x10')](_0xa2a50d));if(_0xa2a50d[_0xff95('0x11')]){if(_0xa2a50d[_0xff95('0x11')]['code']===0x1f4){logger['error'](_0xff95('0x12'),_0x781e05,_0xa2a50d[_0xff95('0x11')]['message']);return _0x198a51(_0xa2a50d[_0xff95('0x11')]['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x781e05,_0xa2a50d[_0xff95('0x11')][_0xff95('0x13')]);return _0x1a42b2(_0xa2a50d[_0xff95('0x11')][_0xff95('0x13')]);}else{logger[_0xff95('0x14')](_0xff95('0x12'),_0x781e05,'request\x20sent');_0x1a42b2(_0xa2a50d['result'][_0xff95('0x13')]);}})[_0xff95('0x15')](function(_0x83e644){logger[_0xff95('0x11')](_0xff95('0x12'),_0x781e05,_0x83e644);_0x198a51(_0x83e644);});});}exports[_0xff95('0x16')]=function(_0x56e19e){var _0x3daf80=this;return new Promise(function(_0x10cfe5,_0x46fe3f){return db['MemberReport']['findAll']({'raw':_0x56e19e[_0xff95('0x17')]?_0x56e19e['options'][_0xff95('0x18')]===undefined?!![]:![]:!![],'where':_0x56e19e[_0xff95('0x17')]?_0x56e19e[_0xff95('0x17')][_0xff95('0x19')]||null:null,'attributes':_0x56e19e[_0xff95('0x17')]?_0x56e19e[_0xff95('0x17')][_0xff95('0x1a')]||null:null,'limit':_0x56e19e[_0xff95('0x17')]?_0x56e19e[_0xff95('0x17')][_0xff95('0x1b')]||null:null,'include':_0x56e19e[_0xff95('0x17')]?_0x56e19e['options'][_0xff95('0x1c')]?_[_0xff95('0x1d')](_0x56e19e[_0xff95('0x17')][_0xff95('0x1c')],function(_0x2a02ff){return{'model':db[_0x2a02ff[_0xff95('0x1e')]],'as':_0x2a02ff['as'],'attributes':_0x2a02ff[_0xff95('0x1a')],'include':_0x2a02ff[_0xff95('0x1c')]?_[_0xff95('0x1d')](_0x2a02ff[_0xff95('0x1c')],function(_0x4e7e5e){return{'model':db[_0x4e7e5e['model']],'as':_0x4e7e5e['as'],'attributes':_0x4e7e5e['attributes'],'include':_0x4e7e5e['include']?_[_0xff95('0x1d')](_0x4e7e5e[_0xff95('0x1c')],function(_0x373ce7){return{'model':db[_0x373ce7[_0xff95('0x1e')]],'as':_0x373ce7['as'],'attributes':_0x373ce7[_0xff95('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23e40b){logger[_0xff95('0x14')](_0xff95('0x16'),_0x56e19e);logger[_0xff95('0xe')](_0xff95('0x16'),_0x56e19e,JSON[_0xff95('0x10')](_0x23e40b));_0x10cfe5(_0x23e40b);})[_0xff95('0x15')](function(_0x35834a){logger[_0xff95('0x11')]('GetMemberReport',_0x35834a[_0xff95('0x13')],_0x56e19e);_0x46fe3f(_0x3daf80[_0xff95('0x11')](0x1f4,_0x35834a['message']));});});};exports[_0xff95('0x1f')]=function(_0x54bf87){var _0x369036=this;return new Promise(function(_0x5217de,_0x495f01){return db[_0xff95('0x20')][_0xff95('0x21')](_0x54bf87[_0xff95('0x22')],{'raw':_0x54bf87[_0xff95('0x17')]?_0x54bf87[_0xff95('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x393289){logger['info'](_0xff95('0x1f'),_0x54bf87);logger['debug'](_0xff95('0x1f'),_0x54bf87,JSON['stringify'](_0x393289));_0x5217de(_0x393289);})[_0xff95('0x15')](function(_0x55c3f5){logger[_0xff95('0x11')](_0xff95('0x1f'),_0x55c3f5[_0xff95('0x13')],_0x54bf87);_0x495f01(_0x369036[_0xff95('0x11')](0x1f4,_0x55c3f5[_0xff95('0x13')]));});});};exports[_0xff95('0x23')]=function(_0x207def){var _0x29153f=this;return new Promise(function(_0x1cc54f,_0x641993){return db[_0xff95('0x20')][_0xff95('0x24')](_0x207def[_0xff95('0x22')],{'raw':_0x207def[_0xff95('0x17')]?_0x207def[_0xff95('0x17')][_0xff95('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x207def['options']?_0x207def[_0xff95('0x17')][_0xff95('0x19')]||null:null,'attributes':_0x207def[_0xff95('0x17')]?_0x207def[_0xff95('0x17')][_0xff95('0x1a')]||null:null,'limit':_0x207def['options']?_0x207def['options'][_0xff95('0x1b')]||null:null})[_0xff95('0xc')](function(_0x38262d){logger[_0xff95('0x14')]('UpdateMemberReport',_0x207def);logger[_0xff95('0xe')](_0xff95('0x23'),_0x207def,JSON[_0xff95('0x10')](_0x38262d));_0x1cc54f(_0x38262d);})['catch'](function(_0x203f48){logger[_0xff95('0x11')](_0xff95('0x23'),_0x203f48[_0xff95('0x13')],_0x207def);_0x641993(_0x29153f[_0xff95('0x11')](0x1f4,_0x203f48[_0xff95('0x13')]));});});}; \ No newline at end of file +var _0x2709=['request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','findAll','options','raw','attributes','limit','include','map','model','GetMemberReport','catch','CreateMemberReport','MemberReport','body','update','where','UpdateMemberReport','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s'];(function(_0xc31c30,_0x288567){var _0x1274e3=function(_0x3f097a){while(--_0x3f097a){_0xc31c30['push'](_0xc31c30['shift']());}};_0x1274e3(++_0x288567);}(_0x2709,0x189));var _0x9270=function(_0x465470,_0x2443ad){_0x465470=_0x465470-0x0;var _0x1c5dc2=_0x2709[_0x465470];return _0x1c5dc2;};'use strict';var _=require(_0x9270('0x0'));var util=require('util');var moment=require(_0x9270('0x1'));var BPromise=require(_0x9270('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9270('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9270('0x4'));var logger=require(_0x9270('0x5'))(_0x9270('0x6'));var config=require(_0x9270('0x7'));var jayson=require(_0x9270('0x8'));var client=jayson[_0x9270('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421b84,_0xc9dee5,_0x1927c){return new BPromise(function(_0x28e580,_0x4996ed){return client[_0x9270('0xa')](_0x421b84,_0x1927c)[_0x9270('0xb')](function(_0xa28b35){logger[_0x9270('0xc')](_0x9270('0xd'),_0xc9dee5,_0x9270('0xe'));logger[_0x9270('0xf')](_0x9270('0x10'),_0xc9dee5,_0x9270('0xe'),JSON[_0x9270('0x11')](_0xa28b35));if(_0xa28b35['error']){if(_0xa28b35[_0x9270('0x12')][_0x9270('0x13')]===0x1f4){logger[_0x9270('0x12')]('MemberReport,\x20%s,\x20%s',_0xc9dee5,_0xa28b35['error'][_0x9270('0x14')]);return _0x4996ed(_0xa28b35[_0x9270('0x12')][_0x9270('0x14')]);}logger['error'](_0x9270('0xd'),_0xc9dee5,_0xa28b35[_0x9270('0x12')][_0x9270('0x14')]);return _0x28e580(_0xa28b35[_0x9270('0x12')]['message']);}else{logger['info'](_0x9270('0xd'),_0xc9dee5,_0x9270('0xe'));_0x28e580(_0xa28b35['result'][_0x9270('0x14')]);}})['catch'](function(_0x45432f){logger[_0x9270('0x12')](_0x9270('0xd'),_0xc9dee5,_0x45432f);_0x4996ed(_0x45432f);});});}exports['GetMemberReport']=function(_0x589e86){var _0x3fdc6e=this;return new Promise(function(_0x1af93b,_0x3f16cd){return db['MemberReport'][_0x9270('0x15')]({'raw':_0x589e86[_0x9270('0x16')]?_0x589e86[_0x9270('0x16')][_0x9270('0x17')]===undefined?!![]:![]:!![],'where':_0x589e86[_0x9270('0x16')]?_0x589e86[_0x9270('0x16')]['where']||null:null,'attributes':_0x589e86[_0x9270('0x16')]?_0x589e86[_0x9270('0x16')][_0x9270('0x18')]||null:null,'limit':_0x589e86[_0x9270('0x16')]?_0x589e86['options'][_0x9270('0x19')]||null:null,'include':_0x589e86[_0x9270('0x16')]?_0x589e86[_0x9270('0x16')][_0x9270('0x1a')]?_[_0x9270('0x1b')](_0x589e86['options'][_0x9270('0x1a')],function(_0x452ef9){return{'model':db[_0x452ef9['model']],'as':_0x452ef9['as'],'attributes':_0x452ef9[_0x9270('0x18')],'include':_0x452ef9[_0x9270('0x1a')]?_[_0x9270('0x1b')](_0x452ef9[_0x9270('0x1a')],function(_0x35e372){return{'model':db[_0x35e372[_0x9270('0x1c')]],'as':_0x35e372['as'],'attributes':_0x35e372[_0x9270('0x18')],'include':_0x35e372[_0x9270('0x1a')]?_[_0x9270('0x1b')](_0x35e372[_0x9270('0x1a')],function(_0x47354){return{'model':db[_0x47354[_0x9270('0x1c')]],'as':_0x47354['as'],'attributes':_0x47354['attributes']};}):[]};}):[]};}):[]:[]})[_0x9270('0xb')](function(_0x5272a8){logger['info'](_0x9270('0x1d'),_0x589e86);logger[_0x9270('0xf')]('GetMemberReport',_0x589e86,JSON[_0x9270('0x11')](_0x5272a8));_0x1af93b(_0x5272a8);})[_0x9270('0x1e')](function(_0x153b3a){logger[_0x9270('0x12')]('GetMemberReport',_0x153b3a[_0x9270('0x14')],_0x589e86);_0x3f16cd(_0x3fdc6e[_0x9270('0x12')](0x1f4,_0x153b3a['message']));});});};exports[_0x9270('0x1f')]=function(_0x1cb8eb){var _0x38f17f=this;return new Promise(function(_0x183b71,_0x15f276){return db[_0x9270('0x20')]['create'](_0x1cb8eb[_0x9270('0x21')],{'raw':_0x1cb8eb['options']?_0x1cb8eb[_0x9270('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x41e4df){logger[_0x9270('0xc')](_0x9270('0x1f'),_0x1cb8eb);logger[_0x9270('0xf')](_0x9270('0x1f'),_0x1cb8eb,JSON['stringify'](_0x41e4df));_0x183b71(_0x41e4df);})[_0x9270('0x1e')](function(_0x59c8eb){logger[_0x9270('0x12')](_0x9270('0x1f'),_0x59c8eb[_0x9270('0x14')],_0x1cb8eb);_0x15f276(_0x38f17f[_0x9270('0x12')](0x1f4,_0x59c8eb['message']));});});};exports['UpdateMemberReport']=function(_0x4bcae1){var _0x4361cc=this;return new Promise(function(_0x105c30,_0x423c73){return db[_0x9270('0x20')][_0x9270('0x22')](_0x4bcae1[_0x9270('0x21')],{'raw':_0x4bcae1[_0x9270('0x16')]?_0x4bcae1[_0x9270('0x16')][_0x9270('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bcae1['options']?_0x4bcae1[_0x9270('0x16')][_0x9270('0x23')]||null:null,'attributes':_0x4bcae1[_0x9270('0x16')]?_0x4bcae1['options'][_0x9270('0x18')]||null:null,'limit':_0x4bcae1[_0x9270('0x16')]?_0x4bcae1[_0x9270('0x16')]['limit']||null:null})['then'](function(_0x8279ed){logger[_0x9270('0xc')](_0x9270('0x24'),_0x4bcae1);logger[_0x9270('0xf')](_0x9270('0x24'),_0x4bcae1,JSON[_0x9270('0x11')](_0x8279ed));_0x105c30(_0x8279ed);})[_0x9270('0x1e')](function(_0x17abd5){logger['error']('UpdateMemberReport',_0x17abd5['message'],_0x4bcae1);_0x423c73(_0x4361cc[_0x9270('0x12')](0x1f4,_0x17abd5[_0x9270('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 88234e2..aa34816 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 _0xd0e2=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x3c021f,_0x1c9f65){var _0x2f364a=function(_0x378c52){while(--_0x378c52){_0x3c021f['push'](_0x3c021f['shift']());}};_0x2f364a(++_0x1c9f65);}(_0xd0e2,0xb7));var _0x2d0e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd0e2[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x2d0e('0x0'));var util=require(_0x2d0e('0x1'));var path=require(_0x2d0e('0x2'));var timeout=require(_0x2d0e('0x3'));var express=require(_0x2d0e('0x4'));var router=express[_0x2d0e('0x5')]();var fs_extra=require(_0x2d0e('0x6'));var auth=require(_0x2d0e('0x7'));var interaction=require(_0x2d0e('0x8'));var config=require(_0x2d0e('0x9'));var controller=require(_0x2d0e('0xa'));router[_0x2d0e('0xb')]('/',controller['index']);module[_0x2d0e('0xc')]=router; \ No newline at end of file +var _0xf70f=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x2cdad9,_0x163ef5){var _0x5b9ac9=function(_0x15b36f){while(--_0x15b36f){_0x2cdad9['push'](_0x2cdad9['shift']());}};_0x5b9ac9(++_0x163ef5);}(_0xf70f,0x9c));var _0xff70=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0xf70f[_0x44268d];return _0x4be92d;};'use strict';var multer=require(_0xff70('0x0'));var util=require(_0xff70('0x1'));var path=require(_0xff70('0x2'));var timeout=require('connect-timeout');var express=require(_0xff70('0x3'));var router=express[_0xff70('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff70('0x5'));var interaction=require(_0xff70('0x6'));var config=require(_0xff70('0x7'));var controller=require(_0xff70('0x8'));router[_0xff70('0x9')]('/',controller[_0xff70('0xa')]);module[_0xff70('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 b0245ff..fd9a90e 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 _0xa825=['version','sequelize','STRING'];(function(_0x478d18,_0x4c64dd){var _0xbce9de=function(_0x9e868f){while(--_0x9e868f){_0x478d18['push'](_0x478d18['shift']());}};_0xbce9de(++_0x4c64dd);}(_0xa825,0x6d));var _0x5a82=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa825[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x5a82('0x0'));module['exports']={'version':{'type':Sequelize[_0x5a82('0x1')],'unique':_0x5a82('0x2')}}; \ No newline at end of file +var _0x8812=['exports','STRING','sequelize'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x8812,0x143));var _0x2881=function(_0xb46908,_0x3292a7){_0xb46908=_0xb46908-0x0;var _0x1b2575=_0x8812[_0xb46908];return _0x1b2575;};'use strict';var Sequelize=require(_0x2881('0x0'));module[_0x2881('0x1')]={'version':{'type':Sequelize[_0x2881('0x2')],'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 2ea2845..237a100 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 _0xf32f=['rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','status','end','stack','name','send','index','map','Migration','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf32f,0x14c));var _0xff32=function(_0x5e49ed,_0x484560){_0x5e49ed=_0x5e49ed-0x0;var _0x23fa3d=_0xf32f[_0x5e49ed];return _0x23fa3d;};'use strict';var emlformat=require(_0xff32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff32('0x1'));var jsonpatch=require(_0xff32('0x2'));var rp=require(_0xff32('0x3'));var moment=require(_0xff32('0x4'));var BPromise=require(_0xff32('0x5'));var Mustache=require(_0xff32('0x6'));var util=require(_0xff32('0x7'));var path=require('path');var sox=require(_0xff32('0x8'));var csv=require(_0xff32('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xff32('0xa'));var jsforce=require(_0xff32('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xff32('0x9'));var querystring=require(_0xff32('0xc'));var Papa=require('papaparse');var Redis=require(_0xff32('0xd'));var authService=require(_0xff32('0xe'));var qs=require(_0xff32('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff32('0x10'));var logger=require(_0xff32('0x11'))(_0xff32('0x12'));var utils=require(_0xff32('0x13'));var config=require(_0xff32('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xff32('0x15'))['db'];function respondWithStatusCode(_0x37c61c,_0x25497d){_0x25497d=_0x25497d||0xcc;return function(_0x133497){if(_0x133497){return _0x37c61c[_0xff32('0x16')](_0x25497d);}return _0x37c61c['status'](_0x25497d)['end']();};}function respondWithResult(_0x1d88a6,_0x3b11fd){_0x3b11fd=_0x3b11fd||0xc8;return function(_0x36bded){if(_0x36bded){return _0x1d88a6['status'](_0x3b11fd)[_0xff32('0x17')](_0x36bded);}};}function respondWithFilteredResult(_0x159c35,_0x1bd080){return function(_0x4288ef){if(_0x4288ef){var _0x434619=typeof _0x1bd080[_0xff32('0x18')]===_0xff32('0x19')&&typeof _0x1bd080[_0xff32('0x1a')]===_0xff32('0x19');var _0x56c8e6=_0x4288ef[_0xff32('0x1b')];var _0x3f46d8=_0x434619?0x0:_0x1bd080[_0xff32('0x18')];var _0x10b8d7=_0x434619?_0x4288ef[_0xff32('0x1b')]:_0x1bd080[_0xff32('0x18')]+_0x1bd080[_0xff32('0x1a')];var _0x1be566;if(_0x10b8d7>=_0x56c8e6){_0x10b8d7=_0x56c8e6;_0x1be566=0xc8;}else{_0x1be566=0xce;}_0x159c35['status'](_0x1be566);return _0x159c35[_0xff32('0x1c')](_0xff32('0x1d'),_0x3f46d8+'-'+_0x10b8d7+'/'+_0x56c8e6)[_0xff32('0x17')](_0x4288ef);}return null;};}function patchUpdates(_0x130c37){return function(_0x4ac420){try{jsonpatch['apply'](_0x4ac420,_0x130c37,!![]);}catch(_0x373d80){return BPromise[_0xff32('0x1e')](_0x373d80);}return _0x4ac420[_0xff32('0x1f')]();};}function saveUpdates(_0x3ae3ce,_0x2ad6f1){return function(_0x546b90){if(_0x546b90){return _0x546b90[_0xff32('0x20')](_0x3ae3ce)[_0xff32('0x21')](function(_0x196e62){return _0x196e62;});}return null;};}function removeEntity(_0x42d116,_0x23eb9a){return function(_0x6659d1){if(_0x6659d1){return _0x6659d1[_0xff32('0x22')]()[_0xff32('0x21')](function(){_0x42d116[_0xff32('0x23')](0xcc)[_0xff32('0x24')]();});}};}function handleEntityNotFound(_0x40682f,_0x11e1ec){return function(_0x2bd6d3){if(!_0x2bd6d3){_0x40682f[_0xff32('0x16')](0x194);}return _0x2bd6d3;};}function handleError(_0x510ef9,_0xe9b44c){_0xe9b44c=_0xe9b44c||0x1f4;return function(_0x2080e1){logger['error'](_0x2080e1[_0xff32('0x25')]);if(_0x2080e1[_0xff32('0x26')]){delete _0x2080e1[_0xff32('0x26')];}_0x510ef9[_0xff32('0x23')](_0xe9b44c)[_0xff32('0x27')](_0x2080e1);};}exports[_0xff32('0x28')]=function(_0x4c80a0,_0x281afe){var _0xfe296a={},_0x1f4745={},_0x219997={'count':0x0,'rows':[]};var _0x509da2=_[_0xff32('0x29')](db[_0xff32('0x2a')][_0xff32('0x2b')],function(_0x2ffc96){return{'name':_0x2ffc96['fieldName'],'type':_0x2ffc96[_0xff32('0x2c')][_0xff32('0x2d')]};});_0x1f4745['model']=_[_0xff32('0x29')](_0x509da2,_0xff32('0x26'));_0x1f4745[_0xff32('0x2e')]=_['keys'](_0x4c80a0[_0xff32('0x2e')]);_0x1f4745['filters']=_[_0xff32('0x2f')](_0x1f4745[_0xff32('0x30')],_0x1f4745['query']);_0xfe296a[_0xff32('0x31')]=_[_0xff32('0x2f')](_0x1f4745[_0xff32('0x30')],qs[_0xff32('0x32')](_0x4c80a0[_0xff32('0x2e')][_0xff32('0x32')]));_0xfe296a[_0xff32('0x31')]=_0xfe296a[_0xff32('0x31')][_0xff32('0x33')]?_0xfe296a[_0xff32('0x31')]:_0x1f4745[_0xff32('0x30')];if(!_0x4c80a0[_0xff32('0x2e')][_0xff32('0x34')](_0xff32('0x35'))){_0xfe296a['limit']=qs[_0xff32('0x1a')](_0x4c80a0[_0xff32('0x2e')]['limit']);_0xfe296a[_0xff32('0x18')]=qs['offset'](_0x4c80a0[_0xff32('0x2e')]['offset']);}_0xfe296a[_0xff32('0x36')]=qs[_0xff32('0x37')](_0x4c80a0['query'][_0xff32('0x37')]);_0xfe296a[_0xff32('0x38')]=qs[_0xff32('0x39')](_['pick'](_0x4c80a0[_0xff32('0x2e')],_0x1f4745[_0xff32('0x39')]),_0x509da2);if(_0x4c80a0['query'][_0xff32('0x3a')]){_0xfe296a[_0xff32('0x38')]=_['merge'](_0xfe296a[_0xff32('0x38')],{'$or':_[_0xff32('0x29')](_0x509da2,function(_0x589dfb){if(_0x589dfb[_0xff32('0x2c')]!==_0xff32('0x3b')){var _0x567edf={};_0x567edf[_0x589dfb[_0xff32('0x26')]]={'$like':'%'+_0x4c80a0[_0xff32('0x2e')]['filter']+'%'};return _0x567edf;}})});}_0xfe296a=_[_0xff32('0x3c')]({},_0xfe296a,_0x4c80a0[_0xff32('0x3d')]);var _0x49ae85={'where':_0xfe296a[_0xff32('0x38')]};return db[_0xff32('0x2a')]['count'](_0x49ae85)['then'](function(_0x3c2903){_0x219997['count']=_0x3c2903;if(_0x4c80a0[_0xff32('0x2e')][_0xff32('0x3e')]){_0xfe296a['include']=[{'all':!![]}];}return db[_0xff32('0x2a')][_0xff32('0x3f')](_0xfe296a);})[_0xff32('0x21')](function(_0x3f9139){_0x219997[_0xff32('0x40')]=_0x3f9139;return _0x219997;})[_0xff32('0x21')](respondWithFilteredResult(_0x281afe,_0xfe296a))[_0xff32('0x41')](handleError(_0x281afe,null));}; \ No newline at end of file +var _0x6bfb=['../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x263d96,_0x24e367){var _0x602e7d=function(_0x5bda90){while(--_0x5bda90){_0x263d96['push'](_0x263d96['shift']());}};_0x602e7d(++_0x24e367);}(_0x6bfb,0x14f));var _0xb6bf=function(_0x219ec1,_0x34796f){_0x219ec1=_0x219ec1-0x0;var _0x478f3d=_0x6bfb[_0x219ec1];return _0x478f3d;};'use strict';var emlformat=require(_0xb6bf('0x0'));var rimraf=require(_0xb6bf('0x1'));var zipdir=require(_0xb6bf('0x2'));var jsonpatch=require(_0xb6bf('0x3'));var rp=require(_0xb6bf('0x4'));var moment=require(_0xb6bf('0x5'));var BPromise=require(_0xb6bf('0x6'));var Mustache=require(_0xb6bf('0x7'));var util=require(_0xb6bf('0x8'));var path=require('path');var sox=require(_0xb6bf('0x9'));var csv=require(_0xb6bf('0xa'));var ejs=require(_0xb6bf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb6bf('0xc'));var squel=require('squel');var crypto=require(_0xb6bf('0xd'));var jsforce=require(_0xb6bf('0xe'));var deskjs=require(_0xb6bf('0xf'));var toCsv=require(_0xb6bf('0xa'));var querystring=require(_0xb6bf('0x10'));var Papa=require(_0xb6bf('0x11'));var Redis=require('ioredis');var authService=require(_0xb6bf('0x12'));var qs=require(_0xb6bf('0x13'));var as=require(_0xb6bf('0x14'));var hardwareService=require(_0xb6bf('0x15'));var logger=require(_0xb6bf('0x16'))(_0xb6bf('0x17'));var utils=require('../../config/utils');var config=require(_0xb6bf('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb6bf('0x19'))['db'];function respondWithStatusCode(_0x50eee5,_0x79de93){_0x79de93=_0x79de93||0xcc;return function(_0x52aea8){if(_0x52aea8){return _0x50eee5['sendStatus'](_0x79de93);}return _0x50eee5[_0xb6bf('0x1a')](_0x79de93)['end']();};}function respondWithResult(_0x5d05f8,_0x5ab7b4){_0x5ab7b4=_0x5ab7b4||0xc8;return function(_0x344851){if(_0x344851){return _0x5d05f8['status'](_0x5ab7b4)[_0xb6bf('0x1b')](_0x344851);}};}function respondWithFilteredResult(_0x3600c2,_0x1af8c2){return function(_0x29238d){if(_0x29238d){var _0x3244c4=typeof _0x1af8c2[_0xb6bf('0x1c')]===_0xb6bf('0x1d')&&typeof _0x1af8c2[_0xb6bf('0x1e')]===_0xb6bf('0x1d');var _0x4d2429=_0x29238d[_0xb6bf('0x1f')];var _0x3638c2=_0x3244c4?0x0:_0x1af8c2[_0xb6bf('0x1c')];var _0x3e0dc9=_0x3244c4?_0x29238d[_0xb6bf('0x1f')]:_0x1af8c2[_0xb6bf('0x1c')]+_0x1af8c2[_0xb6bf('0x1e')];var _0x4227c4;if(_0x3e0dc9>=_0x4d2429){_0x3e0dc9=_0x4d2429;_0x4227c4=0xc8;}else{_0x4227c4=0xce;}_0x3600c2['status'](_0x4227c4);return _0x3600c2[_0xb6bf('0x20')](_0xb6bf('0x21'),_0x3638c2+'-'+_0x3e0dc9+'/'+_0x4d2429)[_0xb6bf('0x1b')](_0x29238d);}return null;};}function patchUpdates(_0x5309f3){return function(_0x355067){try{jsonpatch[_0xb6bf('0x22')](_0x355067,_0x5309f3,!![]);}catch(_0x2f48b4){return BPromise['reject'](_0x2f48b4);}return _0x355067['save']();};}function saveUpdates(_0x33bada,_0x321af3){return function(_0x45bad7){if(_0x45bad7){return _0x45bad7[_0xb6bf('0x23')](_0x33bada)[_0xb6bf('0x24')](function(_0x2bcdfa){return _0x2bcdfa;});}return null;};}function removeEntity(_0x3cfe72,_0x1b4c66){return function(_0x13018f){if(_0x13018f){return _0x13018f[_0xb6bf('0x25')]()[_0xb6bf('0x24')](function(){_0x3cfe72[_0xb6bf('0x1a')](0xcc)[_0xb6bf('0x26')]();});}};}function handleEntityNotFound(_0x56eb2d,_0x289058){return function(_0x496b12){if(!_0x496b12){_0x56eb2d[_0xb6bf('0x27')](0x194);}return _0x496b12;};}function handleError(_0xa25fda,_0x2080ae){_0x2080ae=_0x2080ae||0x1f4;return function(_0x1dc472){logger[_0xb6bf('0x28')](_0x1dc472[_0xb6bf('0x29')]);if(_0x1dc472[_0xb6bf('0x2a')]){delete _0x1dc472[_0xb6bf('0x2a')];}_0xa25fda[_0xb6bf('0x1a')](_0x2080ae)[_0xb6bf('0x2b')](_0x1dc472);};}exports[_0xb6bf('0x2c')]=function(_0x46439f,_0x4de01d){var _0x2137e7={},_0x472072={},_0xbf9e63={'count':0x0,'rows':[]};var _0x5dd58d=_[_0xb6bf('0x2d')](db[_0xb6bf('0x2e')][_0xb6bf('0x2f')],function(_0x54cbb2){return{'name':_0x54cbb2[_0xb6bf('0x30')],'type':_0x54cbb2[_0xb6bf('0x31')][_0xb6bf('0x32')]};});_0x472072[_0xb6bf('0x33')]=_['map'](_0x5dd58d,_0xb6bf('0x2a'));_0x472072[_0xb6bf('0x34')]=_[_0xb6bf('0x35')](_0x46439f['query']);_0x472072[_0xb6bf('0x36')]=_[_0xb6bf('0x37')](_0x472072[_0xb6bf('0x33')],_0x472072[_0xb6bf('0x34')]);_0x2137e7[_0xb6bf('0x38')]=_[_0xb6bf('0x37')](_0x472072[_0xb6bf('0x33')],qs[_0xb6bf('0x39')](_0x46439f['query']['fields']));_0x2137e7['attributes']=_0x2137e7[_0xb6bf('0x38')][_0xb6bf('0x3a')]?_0x2137e7[_0xb6bf('0x38')]:_0x472072[_0xb6bf('0x33')];if(!_0x46439f['query']['hasOwnProperty'](_0xb6bf('0x3b'))){_0x2137e7['limit']=qs[_0xb6bf('0x1e')](_0x46439f[_0xb6bf('0x34')]['limit']);_0x2137e7[_0xb6bf('0x1c')]=qs[_0xb6bf('0x1c')](_0x46439f[_0xb6bf('0x34')]['offset']);}_0x2137e7['order']=qs[_0xb6bf('0x3c')](_0x46439f['query'][_0xb6bf('0x3c')]);_0x2137e7[_0xb6bf('0x3d')]=qs['filters'](_[_0xb6bf('0x3e')](_0x46439f[_0xb6bf('0x34')],_0x472072['filters']),_0x5dd58d);if(_0x46439f[_0xb6bf('0x34')][_0xb6bf('0x3f')]){_0x2137e7[_0xb6bf('0x3d')]=_['merge'](_0x2137e7[_0xb6bf('0x3d')],{'$or':_['map'](_0x5dd58d,function(_0x164aad){if(_0x164aad[_0xb6bf('0x31')]!==_0xb6bf('0x40')){var _0x5436b9={};_0x5436b9[_0x164aad[_0xb6bf('0x2a')]]={'$like':'%'+_0x46439f['query'][_0xb6bf('0x3f')]+'%'};return _0x5436b9;}})});}_0x2137e7=_[_0xb6bf('0x41')]({},_0x2137e7,_0x46439f[_0xb6bf('0x42')]);var _0x3ec364={'where':_0x2137e7[_0xb6bf('0x3d')]};return db[_0xb6bf('0x2e')][_0xb6bf('0x1f')](_0x3ec364)[_0xb6bf('0x24')](function(_0x4632b6){_0xbf9e63[_0xb6bf('0x1f')]=_0x4632b6;if(_0x46439f[_0xb6bf('0x34')][_0xb6bf('0x43')]){_0x2137e7[_0xb6bf('0x44')]=[{'all':!![]}];}return db[_0xb6bf('0x2e')][_0xb6bf('0x45')](_0x2137e7);})['then'](function(_0x44e371){_0xbf9e63[_0xb6bf('0x46')]=_0x44e371;return _0xbf9e63;})['then'](respondWithFilteredResult(_0x4de01d,_0x2137e7))[_0xb6bf('0x47')](handleError(_0x4de01d,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 162ca47..fc70d5a 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 _0xbe29=['moment','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util','api'];(function(_0x1495fc,_0x5f4236){var _0x312f23=function(_0x324651){while(--_0x324651){_0x1495fc['push'](_0x1495fc['shift']());}};_0x312f23(++_0x5f4236);}(_0xbe29,0xd9));var _0x9be2=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0xbe29[_0x555b2f];return _0x81c0a6;};'use strict';var _=require(_0x9be2('0x0'));var util=require(_0x9be2('0x1'));var logger=require('../../config/logger')(_0x9be2('0x2'));var moment=require(_0x9be2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9be2('0x4'));var config=require(_0x9be2('0x5'));var attributes=require(_0x9be2('0x6'));module[_0x9be2('0x7')]=function(_0x1c22d9,_0x2c8926){return _0x1c22d9[_0x9be2('0x8')](_0x9be2('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29a1=['bluebird','request-promise','path','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29a1,0x71));var _0x129a=function(_0x2e3cfe,_0x52bde4){_0x2e3cfe=_0x2e3cfe-0x0;var _0x55591b=_0x29a1[_0x2e3cfe];return _0x55591b;};'use strict';var _=require(_0x129a('0x0'));var util=require(_0x129a('0x1'));var logger=require('../../config/logger')(_0x129a('0x2'));var moment=require(_0x129a('0x3'));var BPromise=require(_0x129a('0x4'));var rp=require(_0x129a('0x5'));var fs=require('fs');var path=require(_0x129a('0x6'));var rimraf=require(_0x129a('0x7'));var config=require('../../config/environment');var attributes=require(_0x129a('0x8'));module[_0x129a('0x9')]=function(_0x275d18,_0x13c1a1){return _0x275d18[_0x129a('0xa')](_0x129a('0xb'),attributes,{'tableName':_0x129a('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 a9481c5..6ec85fe 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 _0x18a5=['../../config/logger','rpc','../../config/environment','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x18a5,0x164));var _0x518a=function(_0x11d670,_0x211d99){_0x11d670=_0x11d670-0x0;var _0x3aaf9b=_0x18a5[_0x11d670];return _0x3aaf9b;};'use strict';var _=require(_0x518a('0x0'));var util=require(_0x518a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x518a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x518a('0x3'))['db'];var utils=require(_0x518a('0x4'));var logger=require(_0x518a('0x5'))(_0x518a('0x6'));var config=require(_0x518a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea311,_0x1d4199,_0x19a2df){return new BPromise(function(_0x2a5fa6,_0x8bd966){return client[_0x518a('0x8')](_0x2ea311,_0x19a2df)[_0x518a('0x9')](function(_0xb996c3){logger[_0x518a('0xa')](_0x518a('0xb'),_0x1d4199,_0x518a('0xc'));logger[_0x518a('0xd')](_0x518a('0xe'),_0x1d4199,_0x518a('0xc'),JSON[_0x518a('0xf')](_0xb996c3));if(_0xb996c3['error']){if(_0xb996c3[_0x518a('0x10')]['code']===0x1f4){logger[_0x518a('0x10')]('Migration,\x20%s,\x20%s',_0x1d4199,_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);return _0x8bd966(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}logger[_0x518a('0x10')](_0x518a('0xb'),_0x1d4199,_0xb996c3[_0x518a('0x10')]['message']);return _0x2a5fa6(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}else{logger[_0x518a('0xa')]('Migration,\x20%s,\x20%s',_0x1d4199,_0x518a('0xc'));_0x2a5fa6(_0xb996c3[_0x518a('0x12')]['message']);}})['catch'](function(_0x177882){logger['error'](_0x518a('0xb'),_0x1d4199,_0x177882);_0x8bd966(_0x177882);});});} \ No newline at end of file +var _0x220b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x32b5bc,_0x4be802){var _0x3af795=function(_0x38f7f2){while(--_0x38f7f2){_0x32b5bc['push'](_0x32b5bc['shift']());}};_0x3af795(++_0x4be802);}(_0x220b,0x1a2));var _0xb220=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x220b[_0x28669c];return _0x4a3af6;};'use strict';var _=require('lodash');var util=require(_0xb220('0x0'));var moment=require(_0xb220('0x1'));var BPromise=require(_0xb220('0x2'));var rs=require(_0xb220('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb220('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb220('0x5'))('rpc');var config=require(_0xb220('0x6'));var jayson=require(_0xb220('0x7'));var client=jayson[_0xb220('0x8')][_0xb220('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d7d19,_0x23631f,_0x7fa0dd){return new BPromise(function(_0x5b83b9,_0x12c68c){return client[_0xb220('0xa')](_0x5d7d19,_0x7fa0dd)[_0xb220('0xb')](function(_0x2821a6){logger[_0xb220('0xc')](_0xb220('0xd'),_0x23631f,_0xb220('0xe'));logger[_0xb220('0xf')](_0xb220('0x10'),_0x23631f,'request\x20sent',JSON[_0xb220('0x11')](_0x2821a6));if(_0x2821a6[_0xb220('0x12')]){if(_0x2821a6['error']['code']===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x23631f,_0x2821a6['error'][_0xb220('0x13')]);return _0x12c68c(_0x2821a6['error'][_0xb220('0x13')]);}logger[_0xb220('0x12')](_0xb220('0xd'),_0x23631f,_0x2821a6[_0xb220('0x12')]['message']);return _0x5b83b9(_0x2821a6['error'][_0xb220('0x13')]);}else{logger[_0xb220('0xc')](_0xb220('0xd'),_0x23631f,_0xb220('0xe'));_0x5b83b9(_0x2821a6[_0xb220('0x14')][_0xb220('0x13')]);}})[_0xb220('0x15')](function(_0x269c52){logger[_0xb220('0x12')](_0xb220('0xd'),_0x23631f,_0x269c52);_0x12c68c(_0x269c52);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 1ad98a4..8b6eddb 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 _0x29b3=['../../config/environment','./network.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3c68e4,_0x20e968){var _0x2b35e7=function(_0x1732a7){while(--_0x1732a7){_0x3c68e4['push'](_0x3c68e4['shift']());}};_0x2b35e7(++_0x20e968);}(_0x29b3,0x160));var _0x329b=function(_0x22bd06,_0x2322e4){_0x22bd06=_0x22bd06-0x0;var _0x3a02c6=_0x29b3[_0x22bd06];return _0x3a02c6;};'use strict';var multer=require(_0x329b('0x0'));var util=require(_0x329b('0x1'));var path=require(_0x329b('0x2'));var timeout=require('connect-timeout');var express=require(_0x329b('0x3'));var router=express[_0x329b('0x4')]();var fs_extra=require(_0x329b('0x5'));var auth=require(_0x329b('0x6'));var interaction=require(_0x329b('0x7'));var config=require(_0x329b('0x8'));var controller=require(_0x329b('0x9'));router[_0x329b('0xa')]('/',auth[_0x329b('0xb')](),controller[_0x329b('0xc')]);router[_0x329b('0xa')]('/:id',auth[_0x329b('0xb')](),controller[_0x329b('0xd')]);router[_0x329b('0xe')]('/',auth['isAuthenticated'](),controller[_0x329b('0xf')]);router['put'](_0x329b('0x10'),auth['isAuthenticated'](),controller[_0x329b('0x11')]);router[_0x329b('0x12')](_0x329b('0x10'),auth['isAuthenticated'](),controller[_0x329b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4baa=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','path'];(function(_0x587c93,_0x210802){var _0x407d78=function(_0x8655a0){while(--_0x8655a0){_0x587c93['push'](_0x587c93['shift']());}};_0x407d78(++_0x210802);}(_0x4baa,0x14f));var _0xa4ba=function(_0x60878f,_0x1166d3){_0x60878f=_0x60878f-0x0;var _0x1fbefb=_0x4baa[_0x60878f];return _0x1fbefb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa4ba('0x0'));var timeout=require('connect-timeout');var express=require(_0xa4ba('0x1'));var router=express[_0xa4ba('0x2')]();var fs_extra=require(_0xa4ba('0x3'));var auth=require(_0xa4ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa4ba('0x5'));var controller=require(_0xa4ba('0x6'));router[_0xa4ba('0x7')]('/',auth[_0xa4ba('0x8')](),controller[_0xa4ba('0x9')]);router[_0xa4ba('0x7')](_0xa4ba('0xa'),auth[_0xa4ba('0x8')](),controller[_0xa4ba('0xb')]);router['post']('/',auth[_0xa4ba('0x8')](),controller[_0xa4ba('0xc')]);router['put'](_0xa4ba('0xa'),auth['isAuthenticated'](),controller[_0xa4ba('0xd')]);router['delete'](_0xa4ba('0xa'),auth[_0xa4ba('0x8')](),controller[_0xa4ba('0xe')]);module[_0xa4ba('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d3525c3..7311a2a 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 _0xe22e=['STRING','sequelize','exports','externip','stun'];(function(_0x13eec2,_0xe78b42){var _0x46c367=function(_0x3f399a){while(--_0x3f399a){_0x13eec2['push'](_0x13eec2['shift']());}};_0x46c367(++_0xe78b42);}(_0xe22e,0xc4));var _0xee22=function(_0xa7879c,_0x4dc1d9){_0xa7879c=_0xa7879c-0x0;var _0x576d61=_0xe22e[_0xa7879c];return _0x576d61;};'use strict';var Sequelize=require(_0xee22('0x0'));module[_0xee22('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0xee22('0x2'),_0xee22('0x3'),'turn')},'value':{'type':Sequelize[_0xee22('0x4')]},'username':{'type':Sequelize[_0xee22('0x4')]},'password':{'type':Sequelize[_0xee22('0x4')]}}; \ No newline at end of file +var _0xa771=['localnet','stun','turn','STRING','sequelize'];(function(_0x2e1620,_0x44e6ae){var _0x5f257f=function(_0x5d1239){while(--_0x5d1239){_0x2e1620['push'](_0x2e1620['shift']());}};_0x5f257f(++_0x44e6ae);}(_0xa771,0x90));var _0x1a77=function(_0x34c4fe,_0x22a148){_0x34c4fe=_0x34c4fe-0x0;var _0x18e196=_0xa771[_0x34c4fe];return _0x18e196;};'use strict';var Sequelize=require(_0x1a77('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1a77('0x1'),'externip',_0x1a77('0x2'),_0x1a77('0x3'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1a77('0x4')]},'password':{'type':Sequelize[_0x1a77('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index daac645..28a4991 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 _0xcf1c=['index','Network','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','options','create','sequelize','body','STUN','readFileSync','join','root','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','utf8','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','Reload','transaction','find','params','server/files/templates/stun_multiple.ejs','TURN','toLowerCase','chan_sip.so','toUpperCase','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcf1c,0x18d));var _0xccf1=function(_0x23e5ce,_0x57584d){_0x23e5ce=_0x23e5ce-0x0;var _0x2ce19b=_0xcf1c[_0x23e5ce];return _0x2ce19b;};'use strict';var emlformat=require(_0xccf1('0x0'));var rimraf=require(_0xccf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xccf1('0x2'));var rp=require(_0xccf1('0x3'));var moment=require(_0xccf1('0x4'));var BPromise=require(_0xccf1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xccf1('0x6'));var csv=require('to-csv');var ejs=require(_0xccf1('0x7'));var fs=require('fs');var fs_extra=require(_0xccf1('0x8'));var _=require(_0xccf1('0x9'));var squel=require(_0xccf1('0xa'));var crypto=require(_0xccf1('0xb'));var jsforce=require(_0xccf1('0xc'));var deskjs=require(_0xccf1('0xd'));var toCsv=require(_0xccf1('0xe'));var querystring=require(_0xccf1('0xf'));var Papa=require(_0xccf1('0x10'));var Redis=require(_0xccf1('0x11'));var authService=require(_0xccf1('0x12'));var qs=require(_0xccf1('0x13'));var as=require(_0xccf1('0x14'));var hardwareService=require(_0xccf1('0x15'));var logger=require(_0xccf1('0x16'))(_0xccf1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xccf1('0x18'));var db=require(_0xccf1('0x19'))['db'];var jayson=require(_0xccf1('0x1a'));var client=jayson[_0xccf1('0x1b')][_0xccf1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x568b81,_0x592a7e,_0x41b3e4,_0x5578a6){return new BPromise(function(_0x1170e1,_0x44b68a){var _0x95a852=_0x5578a6||client;return _0x95a852['request'](_0x568b81,_0x41b3e4)[_0xccf1('0x1d')](function(_0x537996){logger['info'](_0xccf1('0x1e'),_0x592a7e,_0xccf1('0x1f'));logger[_0xccf1('0x20')](_0xccf1('0x21'),_0x592a7e,_0xccf1('0x1f'),JSON[_0xccf1('0x22')](_0x537996));if(_0x537996[_0xccf1('0x23')]){if(_0x537996['error'][_0xccf1('0x24')]===0x1f4){logger['error'](_0xccf1('0x1e'),_0x592a7e,_0x537996['error'][_0xccf1('0x25')]);return _0x44b68a(_0x537996[_0xccf1('0x23')]['message']);}logger[_0xccf1('0x23')](_0xccf1('0x1e'),_0x592a7e,_0x537996['error']['message']);return _0x1170e1(_0x537996['error'][_0xccf1('0x25')]);}else{logger[_0xccf1('0x26')]('Network,\x20%s,\x20%s',_0x592a7e,'request\x20sent');_0x1170e1(_0x537996[_0xccf1('0x27')][_0xccf1('0x25')]);}})[_0xccf1('0x28')](function(_0xe8c94){logger[_0xccf1('0x23')](_0xccf1('0x1e'),_0x592a7e,_0xe8c94);_0x44b68a(_0xe8c94);});});}function respondWithStatusCode(_0x2aa979,_0x396bcb){_0x396bcb=_0x396bcb||0xcc;return function(_0x75b9f6){if(_0x75b9f6){return _0x2aa979['sendStatus'](_0x396bcb);}return _0x2aa979[_0xccf1('0x29')](_0x396bcb)[_0xccf1('0x2a')]();};}function respondWithResult(_0x13be17,_0x2c9e07){_0x2c9e07=_0x2c9e07||0xc8;return function(_0x17f5a9){if(_0x17f5a9){return _0x13be17[_0xccf1('0x29')](_0x2c9e07)[_0xccf1('0x2b')](_0x17f5a9);}};}function respondWithFilteredResult(_0x29f095,_0x34799e){return function(_0xec56ce){if(_0xec56ce){var _0x40b762=typeof _0x34799e[_0xccf1('0x2c')]===_0xccf1('0x2d')&&typeof _0x34799e['limit']===_0xccf1('0x2d');var _0x183319=_0xec56ce[_0xccf1('0x2e')];var _0x32b8e0=_0x40b762?0x0:_0x34799e['offset'];var _0x2b069f=_0x40b762?_0xec56ce[_0xccf1('0x2e')]:_0x34799e[_0xccf1('0x2c')]+_0x34799e[_0xccf1('0x2f')];var _0x2abc80;if(_0x2b069f>=_0x183319){_0x2b069f=_0x183319;_0x2abc80=0xc8;}else{_0x2abc80=0xce;}_0x29f095[_0xccf1('0x29')](_0x2abc80);return _0x29f095[_0xccf1('0x30')](_0xccf1('0x31'),_0x32b8e0+'-'+_0x2b069f+'/'+_0x183319)[_0xccf1('0x2b')](_0xec56ce);}return null;};}function patchUpdates(_0x59a194){return function(_0x1082b5){try{jsonpatch[_0xccf1('0x32')](_0x1082b5,_0x59a194,!![]);}catch(_0x47034f){return BPromise[_0xccf1('0x33')](_0x47034f);}return _0x1082b5[_0xccf1('0x34')]();};}function saveUpdates(_0x5954bc,_0x3b7638){return function(_0x32f248){if(_0x32f248){return _0x32f248[_0xccf1('0x35')](_0x5954bc)[_0xccf1('0x1d')](function(_0x3c0526){return _0x3c0526;});}return null;};}function removeEntity(_0x5bba2e,_0x5dd1df){return function(_0x22c20d){if(_0x22c20d){return _0x22c20d[_0xccf1('0x36')]()[_0xccf1('0x1d')](function(){_0x5bba2e[_0xccf1('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbff534,_0x27bcc7){return function(_0x8b3f47){if(!_0x8b3f47){_0xbff534[_0xccf1('0x37')](0x194);}return _0x8b3f47;};}function handleError(_0x1ba5e9,_0x23513f){_0x23513f=_0x23513f||0x1f4;return function(_0x31436a){logger['error'](_0x31436a[_0xccf1('0x38')]);if(_0x31436a[_0xccf1('0x39')]){delete _0x31436a[_0xccf1('0x39')];}_0x1ba5e9[_0xccf1('0x29')](_0x23513f)[_0xccf1('0x3a')](_0x31436a);};}exports[_0xccf1('0x3b')]=function(_0x269737,_0x24a88f){var _0x3ec19f={},_0x8aaaf0={},_0x3a4cac={'count':0x0,'rows':[]};var _0x297201=_['map'](db[_0xccf1('0x3c')][_0xccf1('0x3d')],function(_0x4ffd1f){return{'name':_0x4ffd1f[_0xccf1('0x3e')],'type':_0x4ffd1f[_0xccf1('0x3f')][_0xccf1('0x40')]};});_0x8aaaf0[_0xccf1('0x41')]=_[_0xccf1('0x42')](_0x297201,_0xccf1('0x39'));_0x8aaaf0[_0xccf1('0x43')]=_[_0xccf1('0x44')](_0x269737[_0xccf1('0x43')]);_0x8aaaf0[_0xccf1('0x45')]=_['intersection'](_0x8aaaf0[_0xccf1('0x41')],_0x8aaaf0['query']);_0x3ec19f['attributes']=_[_0xccf1('0x46')](_0x8aaaf0[_0xccf1('0x41')],qs['fields'](_0x269737[_0xccf1('0x43')][_0xccf1('0x47')]));_0x3ec19f['attributes']=_0x3ec19f['attributes'][_0xccf1('0x48')]?_0x3ec19f[_0xccf1('0x49')]:_0x8aaaf0[_0xccf1('0x41')];if(!_0x269737[_0xccf1('0x43')][_0xccf1('0x4a')](_0xccf1('0x4b'))){_0x3ec19f[_0xccf1('0x2f')]=qs[_0xccf1('0x2f')](_0x269737['query'][_0xccf1('0x2f')]);_0x3ec19f[_0xccf1('0x2c')]=qs[_0xccf1('0x2c')](_0x269737[_0xccf1('0x43')]['offset']);}_0x3ec19f[_0xccf1('0x4c')]=qs[_0xccf1('0x4d')](_0x269737[_0xccf1('0x43')]['sort']);_0x3ec19f['where']=qs[_0xccf1('0x45')](_[_0xccf1('0x4e')](_0x269737['query'],_0x8aaaf0[_0xccf1('0x45')]),_0x297201);if(_0x269737['query'][_0xccf1('0x4f')]){_0x3ec19f[_0xccf1('0x50')]=_[_0xccf1('0x51')](_0x3ec19f[_0xccf1('0x50')],{'$or':_[_0xccf1('0x42')](_0x297201,function(_0x26705a){if(_0x26705a[_0xccf1('0x3f')]!==_0xccf1('0x52')){var _0xe72564={};_0xe72564[_0x26705a[_0xccf1('0x39')]]={'$like':'%'+_0x269737[_0xccf1('0x43')][_0xccf1('0x4f')]+'%'};return _0xe72564;}})});}_0x3ec19f=_[_0xccf1('0x51')]({},_0x3ec19f,_0x269737['options']);var _0x2fcc6e={'where':_0x3ec19f[_0xccf1('0x50')]};return db[_0xccf1('0x3c')][_0xccf1('0x2e')](_0x2fcc6e)[_0xccf1('0x1d')](function(_0x3f6a92){_0x3a4cac[_0xccf1('0x2e')]=_0x3f6a92;if(_0x269737[_0xccf1('0x43')][_0xccf1('0x53')]){_0x3ec19f[_0xccf1('0x54')]=[{'all':!![]}];}return db['Network'][_0xccf1('0x55')](_0x3ec19f);})[_0xccf1('0x1d')](function(_0x2d14f1){_0x3a4cac[_0xccf1('0x56')]=_0x2d14f1;return _0x3a4cac;})[_0xccf1('0x1d')](respondWithFilteredResult(_0x24a88f,_0x3ec19f))[_0xccf1('0x28')](handleError(_0x24a88f,null));};exports['show']=function(_0x599f21,_0x36c9fb){var _0x1c11bf={'raw':!![],'where':{'id':_0x599f21['params']['id']}},_0x4955a2={};_0x4955a2[_0xccf1('0x41')]=_[_0xccf1('0x44')](db[_0xccf1('0x3c')][_0xccf1('0x3d')]);_0x4955a2[_0xccf1('0x43')]=_[_0xccf1('0x44')](_0x599f21['query']);_0x4955a2['filters']=_[_0xccf1('0x46')](_0x4955a2[_0xccf1('0x41')],_0x4955a2['query']);_0x1c11bf[_0xccf1('0x49')]=_[_0xccf1('0x46')](_0x4955a2[_0xccf1('0x41')],qs['fields'](_0x599f21[_0xccf1('0x43')]['fields']));_0x1c11bf['attributes']=_0x1c11bf[_0xccf1('0x49')][_0xccf1('0x48')]?_0x1c11bf[_0xccf1('0x49')]:_0x4955a2[_0xccf1('0x41')];if(_0x599f21[_0xccf1('0x43')][_0xccf1('0x53')]){_0x1c11bf['include']=[{'all':!![]}];}_0x1c11bf=_[_0xccf1('0x51')]({},_0x1c11bf,_0x599f21[_0xccf1('0x57')]);return db[_0xccf1('0x3c')]['find'](_0x1c11bf)[_0xccf1('0x1d')](handleEntityNotFound(_0x36c9fb,null))[_0xccf1('0x1d')](respondWithResult(_0x36c9fb,null))[_0xccf1('0x28')](handleError(_0x36c9fb,null));};exports[_0xccf1('0x58')]=function(_0x5e779b,_0x3c5eb5,_0x3123ac){var _0x1c043c;return db[_0xccf1('0x59')]['transaction'](function(_0x4b1858){return db[_0xccf1('0x3c')][_0xccf1('0x58')](_0x5e779b[_0xccf1('0x5a')],{'raw':!![]})[_0xccf1('0x1d')](function(_0x4255d8){_0x1c043c=_0x4255d8;return db[_0xccf1('0x3c')]['findAll']({'where':{'type':_0x5e779b[_0xccf1('0x5a')][_0xccf1('0x3f')]},'raw':!![]});})[_0xccf1('0x1d')](function(_0x57ba0b){if(_0x1c043c[_0xccf1('0x3f')]['toUpperCase']()==_0xccf1('0x5b')){var _0x12e3c0=fs[_0xccf1('0x5c')](path[_0xccf1('0x5d')](config[_0xccf1('0x5e')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x4e4f30=ejs['render'](_0x12e3c0,{'networks':_0x57ba0b||[]});fs['writeFileSync'](_0xccf1('0x5f'),_0x4e4f30);return respondWithRpcPromise('Reload',_0xccf1('0x58'),{'module':_0xccf1('0x60')});}else if(_0x1c043c['type']['toUpperCase']()=='TURN'){var _0x49ca79=fs[_0xccf1('0x5c')](path['join'](config[_0xccf1('0x5e')],_0xccf1('0x61')),_0xccf1('0x62'));var _0xf4fdae=ejs[_0xccf1('0x63')](_0x49ca79,{'networks':_0x57ba0b||[]});fs['writeFileSync'](_0xccf1('0x64'),_0xf4fdae);return respondWithRpcPromise('Reload',_0xccf1('0x58'),{'module':_0xccf1('0x60')});}else{var _0x46cb0e=fs[_0xccf1('0x5c')](path[_0xccf1('0x5d')](config['root'],_0xccf1('0x65')),_0xccf1('0x62'));var _0x4029ea=ejs[_0xccf1('0x63')](_0x46cb0e,{'networks':_0x57ba0b||[]});fs[_0xccf1('0x66')](util['format'](_0xccf1('0x67'),_0x5e779b[_0xccf1('0x5a')][_0xccf1('0x3f')]['toLowerCase']()),_0x4029ea);return respondWithRpcPromise(_0xccf1('0x68'),_0xccf1('0x58'),{'module':'chan_sip.so'});}return null;})['then'](function(){return _0x1c043c;});})[_0xccf1('0x1d')](respondWithResult(_0x3c5eb5,0xc9))[_0xccf1('0x28')](handleError(_0x3c5eb5,null));};exports[_0xccf1('0x35')]=function(_0x21c025,_0xc800be,_0x603a4f){var _0x3f6f06;return db[_0xccf1('0x59')][_0xccf1('0x69')](function(_0xeb3ad8){return db[_0xccf1('0x3c')][_0xccf1('0x6a')]({'where':{'id':_0x21c025[_0xccf1('0x6b')]['id']}})['then'](handleEntityNotFound(_0xc800be,null))[_0xccf1('0x1d')](saveUpdates(_0x21c025[_0xccf1('0x5a')],null))[_0xccf1('0x1d')](function(_0x47cd9a){if(_0x47cd9a){_0x3f6f06=_0x47cd9a;return db[_0xccf1('0x3c')][_0xccf1('0x55')]({'where':{'type':_0x3f6f06[_0xccf1('0x3f')]},'raw':!![]});}return null;})[_0xccf1('0x1d')](function(_0x286476){if(_0x3f6f06['type']['toUpperCase']()==_0xccf1('0x5b')){var _0x51d6c5=fs['readFileSync'](path[_0xccf1('0x5d')](config[_0xccf1('0x5e')],_0xccf1('0x6c')),_0xccf1('0x62'));var _0x52f108=ejs[_0xccf1('0x63')](_0x51d6c5,{'networks':_0x286476||[]});fs['writeFileSync'](_0xccf1('0x5f'),_0x52f108);return respondWithRpcPromise('Reload',_0xccf1('0x35'),{'module':'res_stun_monitor.so'});}else if(_0x3f6f06['type']['toUpperCase']()==_0xccf1('0x6d')){var _0x52e272=fs['readFileSync'](path[_0xccf1('0x5d')](config[_0xccf1('0x5e')],_0xccf1('0x61')),_0xccf1('0x62'));var _0x213ae7=ejs['render'](_0x52e272,{'networks':_0x286476||[]});fs[_0xccf1('0x66')](_0xccf1('0x64'),_0x213ae7);return respondWithRpcPromise(_0xccf1('0x68'),_0xccf1('0x35'),{'module':_0xccf1('0x60')});}else{var _0x2f59c7=fs[_0xccf1('0x5c')](path[_0xccf1('0x5d')](config['root'],_0xccf1('0x65')),'utf8');var _0x5bef5e=ejs[_0xccf1('0x63')](_0x2f59c7,{'networks':_0x286476||[]});fs['writeFileSync'](util['format'](_0xccf1('0x67'),_0x21c025[_0xccf1('0x5a')][_0xccf1('0x3f')][_0xccf1('0x6e')]()),_0x5bef5e);return respondWithRpcPromise('Reload',_0xccf1('0x35'),{'module':_0xccf1('0x6f')});}return null;})['then'](function(_0x8d5b39){if(_0x8d5b39){return _0x3f6f06;}return null;});})[_0xccf1('0x1d')](respondWithResult(_0xc800be,null))['catch'](handleError(_0xc800be,null));};exports['destroy']=function(_0xb6fe13,_0x4a9bc2,_0x5c8e3e){var _0x53db62;return db[_0xccf1('0x3c')][_0xccf1('0x6a')]({'where':{'id':_0xb6fe13[_0xccf1('0x6b')]['id']}})['then'](function(_0x117280){_0x53db62=_0x117280;return _0x117280;})[_0xccf1('0x1d')](handleEntityNotFound(_0x4a9bc2,null))[_0xccf1('0x1d')](removeEntity(_0x4a9bc2,null))['then'](function(){if(_0x53db62){return db[_0xccf1('0x3c')][_0xccf1('0x55')]({'where':{'type':_0x53db62[_0xccf1('0x3f')]},'raw':!![]});}})[_0xccf1('0x1d')](function(_0x38d988){if(_0x53db62[_0xccf1('0x3f')][_0xccf1('0x70')]()==_0xccf1('0x5b')){var _0x1f4dad=fs['readFileSync'](path[_0xccf1('0x5d')](config[_0xccf1('0x5e')],_0xccf1('0x6c')),'utf8');var _0x42dc38=ejs['render'](_0x1f4dad,{'networks':_0x38d988||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x42dc38);return respondWithRpcPromise(_0xccf1('0x68'),_0xccf1('0x36'),{'module':_0xccf1('0x60')});}else if(_0x53db62[_0xccf1('0x3f')][_0xccf1('0x70')]()==_0xccf1('0x6d')){var _0x51fd96=fs[_0xccf1('0x5c')](path[_0xccf1('0x5d')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xccf1('0x62'));var _0x3c58f2=ejs[_0xccf1('0x63')](_0x51fd96,{'networks':_0x38d988||[]});fs[_0xccf1('0x66')](_0xccf1('0x64'),_0x3c58f2);return respondWithRpcPromise('Reload',_0xccf1('0x36'),{'module':_0xccf1('0x60')});}else{var _0x29be8d=fs['readFileSync'](path['join'](config[_0xccf1('0x5e')],_0xccf1('0x65')),_0xccf1('0x62'));var _0x49f6b6=ejs[_0xccf1('0x63')](_0x29be8d,{'networks':_0x38d988||[]});fs[_0xccf1('0x66')](util[_0xccf1('0x71')](_0xccf1('0x67'),_0xb6fe13[_0xccf1('0x5a')][_0xccf1('0x3f')][_0xccf1('0x6e')]()),_0x49f6b6);return respondWithRpcPromise(_0xccf1('0x68'),_0xccf1('0x36'),{'module':_0xccf1('0x6f')});}return null;})[_0xccf1('0x28')](handleError(_0x4a9bc2,null));}; \ No newline at end of file +var _0x4567=['create','sequelize','toUpperCase','STUN','readFileSync','join','root','utf8','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','type','TURN','server/files/templates/turn_multiple.ejs','render','writeFileSync','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','transaction','server/files/templates/stun_multiple.ejs','server/files/templates/network.ejs','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','Network','rawAttributes','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','intersection','find'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4567,0x14e));var _0x7456=function(_0xa1e1e,_0x39d0cd){_0xa1e1e=_0xa1e1e-0x0;var _0x22c71a=_0x4567[_0xa1e1e];return _0x22c71a;};'use strict';var emlformat=require(_0x7456('0x0'));var rimraf=require(_0x7456('0x1'));var zipdir=require(_0x7456('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7456('0x3'));var moment=require(_0x7456('0x4'));var BPromise=require(_0x7456('0x5'));var Mustache=require(_0x7456('0x6'));var util=require(_0x7456('0x7'));var path=require(_0x7456('0x8'));var sox=require(_0x7456('0x9'));var csv=require('to-csv');var ejs=require(_0x7456('0xa'));var fs=require('fs');var fs_extra=require(_0x7456('0xb'));var _=require(_0x7456('0xc'));var squel=require('squel');var crypto=require(_0x7456('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7456('0xe'));var toCsv=require(_0x7456('0xf'));var querystring=require(_0x7456('0x10'));var Papa=require(_0x7456('0x11'));var Redis=require(_0x7456('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7456('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7456('0x14'));var config=require(_0x7456('0x15'));var licenseUtil=require(_0x7456('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7456('0x17'));var client=jayson['client'][_0x7456('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x473e6,_0x2b1cb9,_0x55fd33,_0x3e44d1){return new BPromise(function(_0xd997c8,_0x4ed0b8){var _0x2f9282=_0x3e44d1||client;return _0x2f9282['request'](_0x473e6,_0x55fd33)['then'](function(_0x4800f7){logger['info'](_0x7456('0x19'),_0x2b1cb9,_0x7456('0x1a'));logger[_0x7456('0x1b')](_0x7456('0x1c'),_0x2b1cb9,'request\x20sent',JSON['stringify'](_0x4800f7));if(_0x4800f7['error']){if(_0x4800f7[_0x7456('0x1d')][_0x7456('0x1e')]===0x1f4){logger[_0x7456('0x1d')](_0x7456('0x19'),_0x2b1cb9,_0x4800f7[_0x7456('0x1d')][_0x7456('0x1f')]);return _0x4ed0b8(_0x4800f7[_0x7456('0x1d')][_0x7456('0x1f')]);}logger[_0x7456('0x1d')]('Network,\x20%s,\x20%s',_0x2b1cb9,_0x4800f7[_0x7456('0x1d')][_0x7456('0x1f')]);return _0xd997c8(_0x4800f7[_0x7456('0x1d')][_0x7456('0x1f')]);}else{logger['info'](_0x7456('0x19'),_0x2b1cb9,_0x7456('0x1a'));_0xd997c8(_0x4800f7[_0x7456('0x20')][_0x7456('0x1f')]);}})[_0x7456('0x21')](function(_0x6dcb52){logger['error'](_0x7456('0x19'),_0x2b1cb9,_0x6dcb52);_0x4ed0b8(_0x6dcb52);});});}function respondWithStatusCode(_0x44d67a,_0x189ed9){_0x189ed9=_0x189ed9||0xcc;return function(_0x343bc5){if(_0x343bc5){return _0x44d67a[_0x7456('0x22')](_0x189ed9);}return _0x44d67a[_0x7456('0x23')](_0x189ed9)[_0x7456('0x24')]();};}function respondWithResult(_0x407b69,_0x210a95){_0x210a95=_0x210a95||0xc8;return function(_0x419547){if(_0x419547){return _0x407b69[_0x7456('0x23')](_0x210a95)[_0x7456('0x25')](_0x419547);}};}function respondWithFilteredResult(_0x385071,_0x49f22f){return function(_0x2c45b3){if(_0x2c45b3){var _0x590ee0=typeof _0x49f22f[_0x7456('0x26')]==='undefined'&&typeof _0x49f22f[_0x7456('0x27')]===_0x7456('0x28');var _0x237c24=_0x2c45b3[_0x7456('0x29')];var _0x2951a9=_0x590ee0?0x0:_0x49f22f[_0x7456('0x26')];var _0x431249=_0x590ee0?_0x2c45b3['count']:_0x49f22f[_0x7456('0x26')]+_0x49f22f[_0x7456('0x27')];var _0x531afc;if(_0x431249>=_0x237c24){_0x431249=_0x237c24;_0x531afc=0xc8;}else{_0x531afc=0xce;}_0x385071[_0x7456('0x23')](_0x531afc);return _0x385071[_0x7456('0x2a')](_0x7456('0x2b'),_0x2951a9+'-'+_0x431249+'/'+_0x237c24)[_0x7456('0x25')](_0x2c45b3);}return null;};}function patchUpdates(_0x54ca21){return function(_0x1bf1c8){try{jsonpatch[_0x7456('0x2c')](_0x1bf1c8,_0x54ca21,!![]);}catch(_0x35ec1a){return BPromise[_0x7456('0x2d')](_0x35ec1a);}return _0x1bf1c8[_0x7456('0x2e')]();};}function saveUpdates(_0x3096c3,_0x397a4d){return function(_0x3c96a7){if(_0x3c96a7){return _0x3c96a7[_0x7456('0x2f')](_0x3096c3)[_0x7456('0x30')](function(_0xf47347){return _0xf47347;});}return null;};}function removeEntity(_0x136a58,_0x38da2f){return function(_0x5d0d1b){if(_0x5d0d1b){return _0x5d0d1b[_0x7456('0x31')]()[_0x7456('0x30')](function(){_0x136a58[_0x7456('0x23')](0xcc)[_0x7456('0x24')]();});}};}function handleEntityNotFound(_0x4cb77c,_0x43f795){return function(_0x490289){if(!_0x490289){_0x4cb77c[_0x7456('0x22')](0x194);}return _0x490289;};}function handleError(_0x5d6234,_0x482c55){_0x482c55=_0x482c55||0x1f4;return function(_0x23134f){logger[_0x7456('0x1d')](_0x23134f[_0x7456('0x32')]);if(_0x23134f[_0x7456('0x33')]){delete _0x23134f['name'];}_0x5d6234[_0x7456('0x23')](_0x482c55)[_0x7456('0x34')](_0x23134f);};}exports['index']=function(_0x3903c1,_0x4b3d2a){var _0x45439f={},_0x26fe5d={},_0x37ab87={'count':0x0,'rows':[]};var _0x116f18=_[_0x7456('0x35')](db[_0x7456('0x36')][_0x7456('0x37')],function(_0x1b8b4d){return{'name':_0x1b8b4d['fieldName'],'type':_0x1b8b4d['type']['key']};});_0x26fe5d[_0x7456('0x38')]=_['map'](_0x116f18,'name');_0x26fe5d['query']=_['keys'](_0x3903c1[_0x7456('0x39')]);_0x26fe5d[_0x7456('0x3a')]=_['intersection'](_0x26fe5d[_0x7456('0x38')],_0x26fe5d[_0x7456('0x39')]);_0x45439f[_0x7456('0x3b')]=_['intersection'](_0x26fe5d[_0x7456('0x38')],qs[_0x7456('0x3c')](_0x3903c1[_0x7456('0x39')][_0x7456('0x3c')]));_0x45439f['attributes']=_0x45439f[_0x7456('0x3b')][_0x7456('0x3d')]?_0x45439f['attributes']:_0x26fe5d[_0x7456('0x38')];if(!_0x3903c1[_0x7456('0x39')][_0x7456('0x3e')]('nolimit')){_0x45439f['limit']=qs['limit'](_0x3903c1[_0x7456('0x39')][_0x7456('0x27')]);_0x45439f[_0x7456('0x26')]=qs[_0x7456('0x26')](_0x3903c1[_0x7456('0x39')][_0x7456('0x26')]);}_0x45439f['order']=qs['sort'](_0x3903c1[_0x7456('0x39')][_0x7456('0x3f')]);_0x45439f[_0x7456('0x40')]=qs[_0x7456('0x3a')](_['pick'](_0x3903c1[_0x7456('0x39')],_0x26fe5d[_0x7456('0x3a')]),_0x116f18);if(_0x3903c1[_0x7456('0x39')]['filter']){_0x45439f[_0x7456('0x40')]=_[_0x7456('0x41')](_0x45439f[_0x7456('0x40')],{'$or':_[_0x7456('0x35')](_0x116f18,function(_0x2c4e8e){if(_0x2c4e8e['type']!==_0x7456('0x42')){var _0x114dc1={};_0x114dc1[_0x2c4e8e[_0x7456('0x33')]]={'$like':'%'+_0x3903c1[_0x7456('0x39')][_0x7456('0x43')]+'%'};return _0x114dc1;}})});}_0x45439f=_[_0x7456('0x41')]({},_0x45439f,_0x3903c1[_0x7456('0x44')]);var _0x46e88f={'where':_0x45439f[_0x7456('0x40')]};return db[_0x7456('0x36')][_0x7456('0x29')](_0x46e88f)[_0x7456('0x30')](function(_0x445358){_0x37ab87[_0x7456('0x29')]=_0x445358;if(_0x3903c1[_0x7456('0x39')][_0x7456('0x45')]){_0x45439f[_0x7456('0x46')]=[{'all':!![]}];}return db[_0x7456('0x36')][_0x7456('0x47')](_0x45439f);})[_0x7456('0x30')](function(_0x17dad4){_0x37ab87[_0x7456('0x48')]=_0x17dad4;return _0x37ab87;})[_0x7456('0x30')](respondWithFilteredResult(_0x4b3d2a,_0x45439f))['catch'](handleError(_0x4b3d2a,null));};exports[_0x7456('0x49')]=function(_0x3c8214,_0x52fbb8){var _0x402a7f={'raw':!![],'where':{'id':_0x3c8214[_0x7456('0x4a')]['id']}},_0x56ecbe={};_0x56ecbe[_0x7456('0x38')]=_[_0x7456('0x4b')](db[_0x7456('0x36')][_0x7456('0x37')]);_0x56ecbe[_0x7456('0x39')]=_[_0x7456('0x4b')](_0x3c8214[_0x7456('0x39')]);_0x56ecbe[_0x7456('0x3a')]=_['intersection'](_0x56ecbe[_0x7456('0x38')],_0x56ecbe[_0x7456('0x39')]);_0x402a7f['attributes']=_[_0x7456('0x4c')](_0x56ecbe['model'],qs['fields'](_0x3c8214['query'][_0x7456('0x3c')]));_0x402a7f['attributes']=_0x402a7f[_0x7456('0x3b')][_0x7456('0x3d')]?_0x402a7f[_0x7456('0x3b')]:_0x56ecbe[_0x7456('0x38')];if(_0x3c8214[_0x7456('0x39')][_0x7456('0x45')]){_0x402a7f[_0x7456('0x46')]=[{'all':!![]}];}_0x402a7f=_[_0x7456('0x41')]({},_0x402a7f,_0x3c8214[_0x7456('0x44')]);return db[_0x7456('0x36')][_0x7456('0x4d')](_0x402a7f)[_0x7456('0x30')](handleEntityNotFound(_0x52fbb8,null))[_0x7456('0x30')](respondWithResult(_0x52fbb8,null))[_0x7456('0x21')](handleError(_0x52fbb8,null));};exports[_0x7456('0x4e')]=function(_0x11e4bd,_0x27a282,_0x314014){var _0x281454;return db[_0x7456('0x4f')]['transaction'](function(_0x28e841){return db[_0x7456('0x36')][_0x7456('0x4e')](_0x11e4bd['body'],{'raw':!![]})['then'](function(_0x4f2045){_0x281454=_0x4f2045;return db[_0x7456('0x36')]['findAll']({'where':{'type':_0x11e4bd['body']['type']},'raw':!![]});})[_0x7456('0x30')](function(_0x50b27e){if(_0x281454['type'][_0x7456('0x50')]()==_0x7456('0x51')){var _0x4116a7=fs[_0x7456('0x52')](path[_0x7456('0x53')](config[_0x7456('0x54')],'server/files/templates/stun_multiple.ejs'),_0x7456('0x55'));var _0x300392=ejs['render'](_0x4116a7,{'networks':_0x50b27e||[]});fs['writeFileSync'](_0x7456('0x56'),_0x300392);return respondWithRpcPromise(_0x7456('0x57'),_0x7456('0x4e'),{'module':_0x7456('0x58')});}else if(_0x281454[_0x7456('0x59')][_0x7456('0x50')]()==_0x7456('0x5a')){var _0x320269=fs[_0x7456('0x52')](path[_0x7456('0x53')](config[_0x7456('0x54')],_0x7456('0x5b')),_0x7456('0x55'));var _0x338a04=ejs[_0x7456('0x5c')](_0x320269,{'networks':_0x50b27e||[]});fs[_0x7456('0x5d')](_0x7456('0x5e'),_0x338a04);return respondWithRpcPromise(_0x7456('0x57'),_0x7456('0x4e'),{'module':'res_stun_monitor.so'});}else{var _0x426160=fs['readFileSync'](path[_0x7456('0x53')](config[_0x7456('0x54')],'server/files/templates/network.ejs'),_0x7456('0x55'));var _0x240cba=ejs['render'](_0x426160,{'networks':_0x50b27e||[]});fs[_0x7456('0x5d')](util[_0x7456('0x5f')](_0x7456('0x60'),_0x11e4bd[_0x7456('0x61')][_0x7456('0x59')][_0x7456('0x62')]()),_0x240cba);return respondWithRpcPromise(_0x7456('0x57'),_0x7456('0x4e'),{'module':_0x7456('0x63')});}return null;})['then'](function(){return _0x281454;});})[_0x7456('0x30')](respondWithResult(_0x27a282,0xc9))['catch'](handleError(_0x27a282,null));};exports[_0x7456('0x2f')]=function(_0x1e7507,_0x471915,_0x4c2386){var _0x1562b5;return db[_0x7456('0x4f')][_0x7456('0x64')](function(_0x3cc592){return db[_0x7456('0x36')][_0x7456('0x4d')]({'where':{'id':_0x1e7507[_0x7456('0x4a')]['id']}})[_0x7456('0x30')](handleEntityNotFound(_0x471915,null))[_0x7456('0x30')](saveUpdates(_0x1e7507['body'],null))['then'](function(_0x407c1e){if(_0x407c1e){_0x1562b5=_0x407c1e;return db['Network'][_0x7456('0x47')]({'where':{'type':_0x1562b5[_0x7456('0x59')]},'raw':!![]});}return null;})[_0x7456('0x30')](function(_0x118a7a){if(_0x1562b5[_0x7456('0x59')][_0x7456('0x50')]()=='STUN'){var _0x52d0f5=fs[_0x7456('0x52')](path['join'](config[_0x7456('0x54')],_0x7456('0x65')),_0x7456('0x55'));var _0x7b45=ejs[_0x7456('0x5c')](_0x52d0f5,{'networks':_0x118a7a||[]});fs[_0x7456('0x5d')](_0x7456('0x56'),_0x7b45);return respondWithRpcPromise('Reload','update',{'module':_0x7456('0x58')});}else if(_0x1562b5[_0x7456('0x59')][_0x7456('0x50')]()=='TURN'){var _0xcc7e91=fs[_0x7456('0x52')](path[_0x7456('0x53')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x7456('0x55'));var _0x4943ec=ejs[_0x7456('0x5c')](_0xcc7e91,{'networks':_0x118a7a||[]});fs['writeFileSync'](_0x7456('0x5e'),_0x4943ec);return respondWithRpcPromise(_0x7456('0x57'),'update',{'module':'res_stun_monitor.so'});}else{var _0x11af9a=fs[_0x7456('0x52')](path[_0x7456('0x53')](config['root'],_0x7456('0x66')),_0x7456('0x55'));var _0x4fdb45=ejs['render'](_0x11af9a,{'networks':_0x118a7a||[]});fs[_0x7456('0x5d')](util[_0x7456('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x1e7507[_0x7456('0x61')][_0x7456('0x59')][_0x7456('0x62')]()),_0x4fdb45);return respondWithRpcPromise(_0x7456('0x57'),_0x7456('0x2f'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x5e20c0){if(_0x5e20c0){return _0x1562b5;}return null;});})[_0x7456('0x30')](respondWithResult(_0x471915,null))[_0x7456('0x21')](handleError(_0x471915,null));};exports[_0x7456('0x31')]=function(_0x42e712,_0x6ddc6d,_0x1189cd){var _0x267023;return db[_0x7456('0x36')]['find']({'where':{'id':_0x42e712[_0x7456('0x4a')]['id']}})[_0x7456('0x30')](function(_0x416dcc){_0x267023=_0x416dcc;return _0x416dcc;})[_0x7456('0x30')](handleEntityNotFound(_0x6ddc6d,null))[_0x7456('0x30')](removeEntity(_0x6ddc6d,null))[_0x7456('0x30')](function(){if(_0x267023){return db['Network'][_0x7456('0x47')]({'where':{'type':_0x267023[_0x7456('0x59')]},'raw':!![]});}})[_0x7456('0x30')](function(_0x3bb7a8){if(_0x267023[_0x7456('0x59')][_0x7456('0x50')]()=='STUN'){var _0xbf89d5=fs[_0x7456('0x52')](path[_0x7456('0x53')](config[_0x7456('0x54')],'server/files/templates/stun_multiple.ejs'),_0x7456('0x55'));var _0x311053=ejs[_0x7456('0x5c')](_0xbf89d5,{'networks':_0x3bb7a8||[]});fs['writeFileSync'](_0x7456('0x56'),_0x311053);return respondWithRpcPromise(_0x7456('0x57'),_0x7456('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x267023[_0x7456('0x59')][_0x7456('0x50')]()=='TURN'){var _0x3f50d4=fs[_0x7456('0x52')](path[_0x7456('0x53')](config[_0x7456('0x54')],_0x7456('0x5b')),_0x7456('0x55'));var _0x5c6b56=ejs[_0x7456('0x5c')](_0x3f50d4,{'networks':_0x3bb7a8||[]});fs[_0x7456('0x5d')](_0x7456('0x5e'),_0x5c6b56);return respondWithRpcPromise(_0x7456('0x57'),_0x7456('0x31'),{'module':_0x7456('0x58')});}else{var _0x23fe84=fs[_0x7456('0x52')](path[_0x7456('0x53')](config['root'],'server/files/templates/network.ejs'),_0x7456('0x55'));var _0x177d5e=ejs['render'](_0x23fe84,{'networks':_0x3bb7a8||[]});fs[_0x7456('0x5d')](util[_0x7456('0x5f')](_0x7456('0x60'),_0x42e712[_0x7456('0x61')][_0x7456('0x59')][_0x7456('0x62')]()),_0x177d5e);return respondWithRpcPromise(_0x7456('0x57'),_0x7456('0x31'),{'module':_0x7456('0x63')});}return null;})[_0x7456('0x21')](handleError(_0x6ddc6d,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index ae81f9f..7938822 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 _0x4746=['rimraf','../../config/environment','exports','define','Network','network','lodash','util','api','bluebird','request-promise','path'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x4746,0xc6));var _0x6474=function(_0x42160c,_0x30e856){_0x42160c=_0x42160c-0x0;var _0xdba9cb=_0x4746[_0x42160c];return _0xdba9cb;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var logger=require('../../config/logger')(_0x6474('0x2'));var moment=require('moment');var BPromise=require(_0x6474('0x3'));var rp=require(_0x6474('0x4'));var fs=require('fs');var path=require(_0x6474('0x5'));var rimraf=require(_0x6474('0x6'));var config=require(_0x6474('0x7'));var attributes=require('./network.attributes');module[_0x6474('0x8')]=function(_0x2bcf7c,_0x4cadd7){return _0x2bcf7c[_0x6474('0x9')](_0x6474('0xa'),attributes,{'tableName':_0x6474('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x049e=['Network','network','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x189679,_0x385d1a){var _0x167b3a=function(_0xc6bfae){while(--_0xc6bfae){_0x189679['push'](_0x189679['shift']());}};_0x167b3a(++_0x385d1a);}(_0x049e,0x16a));var _0xe049=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x049e[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var logger=require('../../config/logger')(_0xe049('0x2'));var moment=require('moment');var BPromise=require(_0xe049('0x3'));var rp=require(_0xe049('0x4'));var fs=require('fs');var path=require(_0xe049('0x5'));var rimraf=require(_0xe049('0x6'));var config=require(_0xe049('0x7'));var attributes=require('./network.attributes');module[_0xe049('0x8')]=function(_0x196af2,_0x22e8f5){return _0x196af2[_0xe049('0x9')](_0xe049('0xa'),attributes,{'tableName':_0xe049('0xb'),'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 aeb612f..64b1d3c 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(_0x1a854a,_0x1f14a4){var _0x3e3a80=function(_0x360460){while(--_0x360460){_0x1a854a['push'](_0x1a854a['shift']());}};_0x3e3a80(++_0x1f14a4);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x25e6e8,_0x4cf4b6){_0x25e6e8=_0x25e6e8-0x0;var _0x153a48=_0x7a54[_0x25e6e8];return _0x153a48;};'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 671a9d8..833c55a 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 _0x30dd=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','/:id/send','send','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout'];(function(_0x201ca0,_0x126288){var _0x19f6cb=function(_0x16e60c){while(--_0x16e60c){_0x201ca0['push'](_0x201ca0['shift']());}};_0x19f6cb(++_0x126288);}(_0x30dd,0xb6));var _0xd30d=function(_0x1dc3fb,_0x170250){_0x1dc3fb=_0x1dc3fb-0x0;var _0x3423fa=_0x30dd[_0x1dc3fb];return _0x3423fa;};'use strict';var multer=require('multer');var util=require(_0xd30d('0x0'));var path=require(_0xd30d('0x1'));var timeout=require(_0xd30d('0x2'));var express=require(_0xd30d('0x3'));var router=express['Router']();var fs_extra=require(_0xd30d('0x4'));var auth=require(_0xd30d('0x5'));var interaction=require(_0xd30d('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xd30d('0x7')]('/',auth[_0xd30d('0x8')](),controller['index']);router['get'](_0xd30d('0x9'),auth[_0xd30d('0x8')](),controller[_0xd30d('0xa')]);router[_0xd30d('0x7')]('/:id',auth[_0xd30d('0x8')](),controller[_0xd30d('0xb')]);router['get'](_0xd30d('0xc'),auth[_0xd30d('0x8')](),controller[_0xd30d('0xd')]);router[_0xd30d('0x7')]('/:id/canned_answers',auth[_0xd30d('0x8')](),controller[_0xd30d('0xe')]);router['get'](_0xd30d('0xf'),auth[_0xd30d('0x8')](),controller['getApplications']);router[_0xd30d('0x7')](_0xd30d('0x10'),auth[_0xd30d('0x8')](),controller[_0xd30d('0x11')]);router[_0xd30d('0x7')](_0xd30d('0x12'),auth[_0xd30d('0x8')](),controller[_0xd30d('0x13')]);router[_0xd30d('0x14')]('/',auth[_0xd30d('0x8')](),controller[_0xd30d('0x15')]);router['post'](_0xd30d('0xc'),auth['isAuthenticated'](),controller[_0xd30d('0x16')]);router[_0xd30d('0x14')](_0xd30d('0x17'),auth['isAuthenticated'](),controller[_0xd30d('0x18')]);router['post'](_0xd30d('0x19'),controller['notify']);router[_0xd30d('0x14')]('/:id/applications',auth['isAuthenticated'](),controller[_0xd30d('0x1a')]);router[_0xd30d('0x14')](_0xd30d('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0xd30d('0x14')](_0xd30d('0x1b'),auth[_0xd30d('0x8')](),controller[_0xd30d('0x1c')]);router[_0xd30d('0x1d')](_0xd30d('0x1e'),auth['isAuthenticated'](),controller[_0xd30d('0x1f')]);router[_0xd30d('0x20')](_0xd30d('0x1e'),auth['isAuthenticated'](),controller['destroy']);router[_0xd30d('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd30d('0x21')]);router[_0xd30d('0x20')](_0xd30d('0x17'),auth[_0xd30d('0x8')](),controller[_0xd30d('0x22')]);router['delete']('/:id/users',auth[_0xd30d('0x8')](),controller[_0xd30d('0x23')]);module[_0xd30d('0x24')]=router; \ No newline at end of file +var _0x8034=['describe','get','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./openchannelAccount.controller','isAuthenticated','index','/describe'];(function(_0x4d9f9b,_0x3fb3b9){var _0x8114a3=function(_0x426a53){while(--_0x426a53){_0x4d9f9b['push'](_0x4d9f9b['shift']());}};_0x8114a3(++_0x3fb3b9);}(_0x8034,0xda));var _0x4803=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x8034[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0x4803('0x0'));var util=require(_0x4803('0x1'));var path=require(_0x4803('0x2'));var timeout=require(_0x4803('0x3'));var express=require('express');var router=express[_0x4803('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4803('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4803('0x6'));router['get']('/',auth[_0x4803('0x7')](),controller[_0x4803('0x8')]);router['get'](_0x4803('0x9'),auth['isAuthenticated'](),controller[_0x4803('0xa')]);router[_0x4803('0xb')](_0x4803('0xc'),auth[_0x4803('0x7')](),controller['show']);router[_0x4803('0xb')](_0x4803('0xd'),auth[_0x4803('0x7')](),controller[_0x4803('0xe')]);router[_0x4803('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4803('0xf')]);router[_0x4803('0xb')](_0x4803('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x4803('0xb')](_0x4803('0x11'),auth[_0x4803('0x7')](),controller[_0x4803('0x12')]);router[_0x4803('0xb')]('/:id/users',auth[_0x4803('0x7')](),controller[_0x4803('0x13')]);router[_0x4803('0x14')]('/',auth['isAuthenticated'](),controller[_0x4803('0x15')]);router['post'](_0x4803('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x4803('0x14')](_0x4803('0x16'),auth[_0x4803('0x7')](),controller[_0x4803('0x17')]);router[_0x4803('0x14')](_0x4803('0x18'),controller[_0x4803('0x19')]);router[_0x4803('0x14')](_0x4803('0x10'),auth[_0x4803('0x7')](),controller[_0x4803('0x1a')]);router[_0x4803('0x14')](_0x4803('0x1b'),auth[_0x4803('0x7')](),controller[_0x4803('0x1c')]);router[_0x4803('0x14')](_0x4803('0x1d'),auth['isAuthenticated'](),controller[_0x4803('0x1e')]);router[_0x4803('0x1f')](_0x4803('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4803('0x20')](_0x4803('0xc'),auth[_0x4803('0x7')](),controller[_0x4803('0x21')]);router['delete'](_0x4803('0xd'),auth['isAuthenticated'](),controller[_0x4803('0x22')]);router[_0x4803('0x20')](_0x4803('0x16'),auth[_0x4803('0x7')](),controller[_0x4803('0x23')]);router[_0x4803('0x20')]('/:id/users',auth[_0x4803('0x7')](),controller[_0x4803('0x24')]);module[_0x4803('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2a4ad31..398cc7e 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 _0x88d0=['name','STRING','generate','TEXT','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0x88d0,0x128));var _0x088d=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x88d0[_0x391c55];return _0xa434e0;};'use strict';var Sequelize=require(_0x088d('0x0'));var rs=require(_0x088d('0x1'));module[_0x088d('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x088d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x088d('0x4')]},'token':{'type':Sequelize[_0x088d('0x4')],'defaultValue':function(){return rs[_0x088d('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x088d('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x088d('0x6')],'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['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x088d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x088d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x088d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x088d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x088d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x088d('0x8')],'defaultValue':![],'comment':_0x088d('0x9'),'set':function(_0x15f27f){if(!_0x15f27f)this[_0x088d('0xa')](_0x088d('0xb'),null);this[_0x088d('0xa')](_0x088d('0xc'),_0x15f27f);}}}; \ No newline at end of file +var _0x7570=['exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring'];(function(_0x3779eb,_0xc19002){var _0x50423a=function(_0x16e841){while(--_0x16e841){_0x3779eb['push'](_0x3779eb['shift']());}};_0x50423a(++_0xc19002);}(_0x7570,0xe3));var _0x0757=function(_0x175e5a,_0x1e4bda){_0x175e5a=_0x175e5a-0x0;var _0xd1f7e=_0x7570[_0x175e5a];return _0xd1f7e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0757('0x0'));module[_0x0757('0x1')]={'name':{'type':Sequelize[_0x0757('0x2')],'unique':_0x0757('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0757('0x2')]},'token':{'type':Sequelize[_0x0757('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x0757('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0757('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0757('0x4')],'defaultValue':function(){return _0x0757('0x5');}},'notificationSound':{'type':Sequelize[_0x0757('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0757('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0757('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0757('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0757('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0757('0x6')],'defaultValue':![],'comment':_0x0757('0x8'),'set':function(_0x5c9df2){if(!_0x5c9df2)this[_0x0757('0x9')](_0x0757('0xa'),null);this[_0x0757('0x9')](_0x0757('0xb'),_0x5c9df2);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 5588e28..cd2bf47 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 _0x0628=['addDisposition','Disposition','getDispositions','findOne','nolimit','order','OpenchannelAccountId','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','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','CmContact','Contacts','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','asc','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./openchannelAccount.socket','register','http','client','request\x20sent','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','OpenchannelAccounts','UserProfileResource','destroy','end','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','mandatoryDispositionPause','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe'];(function(_0x11c975,_0x369382){var _0x4043ac=function(_0xd9671c){while(--_0xd9671c){_0x11c975['push'](_0x11c975['shift']());}};_0x4043ac(++_0x369382);}(_0x0628,0x116));var _0x8062=function(_0x502589,_0x2f27d2){_0x502589=_0x502589-0x0;var _0x1d9f52=_0x0628[_0x502589];return _0x1d9f52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8062('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8062('0x1'));var rp=require('request-promise');var moment=require(_0x8062('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8062('0x3'));var path=require(_0x8062('0x4'));var sox=require(_0x8062('0x5'));var csv=require(_0x8062('0x6'));var ejs=require(_0x8062('0x7'));var fs=require('fs');var fs_extra=require(_0x8062('0x8'));var _=require(_0x8062('0x9'));var squel=require('squel');var crypto=require(_0x8062('0xa'));var jsforce=require(_0x8062('0xb'));var deskjs=require(_0x8062('0xc'));var toCsv=require(_0x8062('0x6'));var querystring=require(_0x8062('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8062('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8062('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8062('0x10'))(_0x8062('0x11'));var utils=require(_0x8062('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8062('0x13'))['db'];config['redis']=_[_0x8062('0x14')](config[_0x8062('0x15')],{'host':_0x8062('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8062('0x15')]));require(_0x8062('0x17'))[_0x8062('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8062('0x19')]({'port':0x232c});var client9002=jayson[_0x8062('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484af9,_0x3928c1,_0x36e9b6,_0x2517dd){return new BPromise(function(_0x97e0d,_0x3d0f4a){var _0x4accc1=_0x2517dd||client;return _0x4accc1['request'](_0x484af9,_0x36e9b6)['then'](function(_0x33c1e0){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3928c1,_0x8062('0x1b'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3928c1,_0x8062('0x1b'),JSON['stringify'](_0x33c1e0));if(_0x33c1e0[_0x8062('0x1c')]){if(_0x33c1e0[_0x8062('0x1c')][_0x8062('0x1d')]===0x1f4){logger['error'](_0x8062('0x1e'),_0x3928c1,_0x33c1e0[_0x8062('0x1c')][_0x8062('0x1f')]);return _0x3d0f4a(_0x33c1e0[_0x8062('0x1c')][_0x8062('0x1f')]);}logger[_0x8062('0x1c')](_0x8062('0x1e'),_0x3928c1,_0x33c1e0[_0x8062('0x1c')][_0x8062('0x1f')]);return _0x97e0d(_0x33c1e0[_0x8062('0x1c')][_0x8062('0x1f')]);}else{logger[_0x8062('0x20')](_0x8062('0x1e'),_0x3928c1,_0x8062('0x1b'));_0x97e0d(_0x33c1e0[_0x8062('0x21')][_0x8062('0x1f')]);}})[_0x8062('0x22')](function(_0x1f6f76){logger[_0x8062('0x1c')](_0x8062('0x1e'),_0x3928c1,_0x1f6f76);_0x3d0f4a(_0x1f6f76);});});}function respondWithStatusCode(_0x1d07cf,_0x536105){_0x536105=_0x536105||0xcc;return function(_0x11522b){if(_0x11522b){return _0x1d07cf[_0x8062('0x23')](_0x536105);}return _0x1d07cf[_0x8062('0x24')](_0x536105)['end']();};}function respondWithResult(_0x1f3850,_0x1c0328){_0x1c0328=_0x1c0328||0xc8;return function(_0x4111aa){if(_0x4111aa){return _0x1f3850[_0x8062('0x24')](_0x1c0328)[_0x8062('0x25')](_0x4111aa);}};}function respondWithFilteredResult(_0x595335,_0x136274){return function(_0x1c7898){if(_0x1c7898){var _0x53f295=typeof _0x136274[_0x8062('0x26')]===_0x8062('0x27')&&typeof _0x136274[_0x8062('0x28')]===_0x8062('0x27');var _0x23079a=_0x1c7898[_0x8062('0x29')];var _0x52a587=_0x53f295?0x0:_0x136274[_0x8062('0x26')];var _0x2c7edb=_0x53f295?_0x1c7898[_0x8062('0x29')]:_0x136274[_0x8062('0x26')]+_0x136274[_0x8062('0x28')];var _0x421085;if(_0x2c7edb>=_0x23079a){_0x2c7edb=_0x23079a;_0x421085=0xc8;}else{_0x421085=0xce;}_0x595335[_0x8062('0x24')](_0x421085);return _0x595335[_0x8062('0x2a')](_0x8062('0x2b'),_0x52a587+'-'+_0x2c7edb+'/'+_0x23079a)[_0x8062('0x25')](_0x1c7898);}return null;};}function patchUpdates(_0x35687f){return function(_0x47fab9){try{jsonpatch['apply'](_0x47fab9,_0x35687f,!![]);}catch(_0xb76352){return BPromise[_0x8062('0x2c')](_0xb76352);}return _0x47fab9['save']();};}function saveUpdates(_0x2ed868,_0x2fe68c){return function(_0x2e79e5){if(_0x2e79e5){return _0x2e79e5[_0x8062('0x2d')](_0x2ed868)[_0x8062('0x2e')](function(_0x148820){return _0x148820;});}return null;};}function removeEntity(_0x5a0dc0,_0x3d26a3){return function(_0x4914e6){if(_0x4914e6){return _0x4914e6['destroy']()[_0x8062('0x2e')](function(){var _0x2feb46=_0x4914e6['get']({'plain':!![]});var _0x4789a0=_0x8062('0x2f');return db[_0x8062('0x30')][_0x8062('0x31')]({'where':{'type':_0x4789a0,'resourceId':_0x2feb46['id']}})[_0x8062('0x2e')](function(){return _0x4914e6;});})[_0x8062('0x2e')](function(){_0x5a0dc0[_0x8062('0x24')](0xcc)[_0x8062('0x32')]();});}};}function handleEntityNotFound(_0x953134,_0x2bfd37){return function(_0x56ae86){if(!_0x56ae86){_0x953134[_0x8062('0x23')](0x194);}return _0x56ae86;};}function handleError(_0x3c0f56,_0x54e9ca){_0x54e9ca=_0x54e9ca||0x1f4;return function(_0x3840e6){logger['error'](_0x3840e6[_0x8062('0x33')]);if(_0x3840e6[_0x8062('0x34')]){delete _0x3840e6[_0x8062('0x34')];}_0x3c0f56['status'](_0x54e9ca)[_0x8062('0x35')](_0x3840e6);};}exports[_0x8062('0x36')]=function(_0x2b3051,_0x3bc9ac){var _0x16d3cf={'include':[{'model':db[_0x8062('0x37')],'as':'mandatoryDispositionPause'}]},_0xb47fff={},_0x4a0109={'count':0x0,'rows':[]};var _0xf3e0d2=_[_0x8062('0x38')](db[_0x8062('0x39')][_0x8062('0x3a')],function(_0x216359){return{'name':_0x216359[_0x8062('0x3b')],'type':_0x216359[_0x8062('0x3c')][_0x8062('0x3d')]};});_0xb47fff['model']=_[_0x8062('0x38')](_0xf3e0d2,'name');_0xb47fff[_0x8062('0x3e')]=_[_0x8062('0x3f')](_0x2b3051[_0x8062('0x3e')]);_0xb47fff[_0x8062('0x40')]=_[_0x8062('0x41')](_0xb47fff[_0x8062('0x42')],_0xb47fff[_0x8062('0x3e')]);_0x16d3cf[_0x8062('0x43')]=_[_0x8062('0x41')](_0xb47fff[_0x8062('0x42')],qs['fields'](_0x2b3051[_0x8062('0x3e')][_0x8062('0x44')]));_0x16d3cf[_0x8062('0x43')]=_0x16d3cf[_0x8062('0x43')][_0x8062('0x45')]?_0x16d3cf[_0x8062('0x43')]:_0xb47fff[_0x8062('0x42')];if(!_0x2b3051['query'][_0x8062('0x46')]('nolimit')){_0x16d3cf[_0x8062('0x28')]=qs[_0x8062('0x28')](_0x2b3051[_0x8062('0x3e')][_0x8062('0x28')]);_0x16d3cf['offset']=qs[_0x8062('0x26')](_0x2b3051[_0x8062('0x3e')]['offset']);}_0x16d3cf['order']=qs[_0x8062('0x47')](_0x2b3051['query'][_0x8062('0x47')]);_0x16d3cf[_0x8062('0x48')]=qs[_0x8062('0x40')](_[_0x8062('0x49')](_0x2b3051[_0x8062('0x3e')],_0xb47fff[_0x8062('0x40')]),_0xf3e0d2);if(_0x2b3051['query'][_0x8062('0x4a')]){_0x16d3cf['where']=_[_0x8062('0x4b')](_0x16d3cf[_0x8062('0x48')],{'$or':_[_0x8062('0x38')](_0xf3e0d2,function(_0x3e26b8){if(_0x3e26b8['type']!==_0x8062('0x4c')){var _0x343d3a={};_0x343d3a[_0x3e26b8[_0x8062('0x34')]]={'$like':'%'+_0x2b3051[_0x8062('0x3e')][_0x8062('0x4a')]+'%'};return _0x343d3a;}})});}_0x16d3cf=_[_0x8062('0x4b')]({},_0x16d3cf,_0x2b3051[_0x8062('0x4d')]);var _0x4e948a={'where':_0x16d3cf[_0x8062('0x48')]};return db[_0x8062('0x39')][_0x8062('0x29')](_0x4e948a)['then'](function(_0x2a2713){_0x4a0109[_0x8062('0x29')]=_0x2a2713;if(_0x2b3051[_0x8062('0x3e')]['includeAll']){_0x16d3cf[_0x8062('0x4e')]=[{'all':!![]}];}return db[_0x8062('0x39')]['findAll'](_0x16d3cf);})[_0x8062('0x2e')](function(_0x445e17){_0x4a0109[_0x8062('0x4f')]=_0x445e17;return _0x4a0109;})[_0x8062('0x2e')](respondWithFilteredResult(_0x3bc9ac,_0x16d3cf))['catch'](handleError(_0x3bc9ac,null));};exports[_0x8062('0x50')]=function(_0x32a1d3,_0x30d075){var _0x3aa81c={'raw':![],'where':{'id':_0x32a1d3['params']['id']},'include':[{'model':db[_0x8062('0x37')],'as':_0x8062('0x51')}]},_0x5ec01b={};_0x5ec01b[_0x8062('0x42')]=_[_0x8062('0x3f')](db[_0x8062('0x39')]['rawAttributes']);_0x5ec01b[_0x8062('0x3e')]=_[_0x8062('0x3f')](_0x32a1d3[_0x8062('0x3e')]);_0x5ec01b['filters']=_['intersection'](_0x5ec01b[_0x8062('0x42')],_0x5ec01b[_0x8062('0x3e')]);_0x3aa81c['attributes']=_['intersection'](_0x5ec01b[_0x8062('0x42')],qs[_0x8062('0x44')](_0x32a1d3[_0x8062('0x3e')][_0x8062('0x44')]));_0x3aa81c[_0x8062('0x43')]=_0x3aa81c['attributes']['length']?_0x3aa81c[_0x8062('0x43')]:_0x5ec01b['model'];if(_0x32a1d3[_0x8062('0x3e')][_0x8062('0x52')]){_0x3aa81c[_0x8062('0x4e')]=[{'all':!![]}];}_0x3aa81c=_[_0x8062('0x4b')]({},_0x3aa81c,_0x32a1d3['options']);return db[_0x8062('0x39')]['find'](_0x3aa81c)[_0x8062('0x2e')](handleEntityNotFound(_0x30d075,null))[_0x8062('0x2e')](respondWithResult(_0x30d075,null))[_0x8062('0x22')](handleError(_0x30d075,null));};exports[_0x8062('0x53')]=function(_0x563601,_0x989c8){return db[_0x8062('0x39')][_0x8062('0x53')](_0x563601['body'],{})[_0x8062('0x2e')](function(_0x782b4f){var _0x119408=_0x563601['user']['get']({'plain':!![]});if(!_0x119408)throw new Error(_0x8062('0x54'));if(_0x119408[_0x8062('0x55')]===_0x8062('0x56')){var _0x263403=_0x782b4f[_0x8062('0x57')]({'plain':!![]});var _0x1d0912=_0x8062('0x2f');return db['UserProfileSection'][_0x8062('0x58')]({'where':{'name':_0x1d0912,'userProfileId':_0x119408[_0x8062('0x59')]},'raw':!![]})[_0x8062('0x2e')](function(_0x65b7dc){if(_0x65b7dc&&_0x65b7dc['autoAssociation']===0x0){return db[_0x8062('0x30')][_0x8062('0x53')]({'name':_0x263403['name'],'resourceId':_0x263403['id'],'type':_0x65b7dc[_0x8062('0x34')],'sectionId':_0x65b7dc['id']},{})[_0x8062('0x2e')](function(){return _0x782b4f;});}else{return _0x782b4f;}})[_0x8062('0x22')](function(_0x1630f3){logger['error'](_0x8062('0x5a'),_0x1630f3);throw _0x1630f3;});}return _0x782b4f;})[_0x8062('0x2e')](respondWithResult(_0x989c8,0xc9))['catch'](handleError(_0x989c8,null));};exports[_0x8062('0x2d')]=function(_0x392d6e,_0x59b76d){if(_0x392d6e[_0x8062('0x5b')]['id']){delete _0x392d6e[_0x8062('0x5b')]['id'];}return db[_0x8062('0x39')][_0x8062('0x58')]({'where':{'id':_0x392d6e['params']['id']},'include':[{'model':db[_0x8062('0x37')],'as':_0x8062('0x51')}]})['then'](handleEntityNotFound(_0x59b76d,null))[_0x8062('0x2e')](saveUpdates(_0x392d6e[_0x8062('0x5b')],null))[_0x8062('0x2e')](respondWithResult(_0x59b76d,null))[_0x8062('0x22')](handleError(_0x59b76d,null));};exports[_0x8062('0x31')]=function(_0x516fdd,_0x53db91){return db['OpenchannelAccount'][_0x8062('0x58')]({'where':{'id':_0x516fdd[_0x8062('0x5c')]['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x53db91,null))['then'](removeEntity(_0x53db91,null))[_0x8062('0x22')](handleError(_0x53db91,null));};exports[_0x8062('0x5d')]=function(_0x24928d,_0x20737b){return db[_0x8062('0x39')][_0x8062('0x5d')]()[_0x8062('0x2e')](respondWithResult(_0x20737b,null))[_0x8062('0x22')](handleError(_0x20737b,null));};exports[_0x8062('0x5e')]=function(_0x1238b6,_0x196058,_0x3b66d5){if(_0x1238b6[_0x8062('0x5b')]['id']){delete _0x1238b6[_0x8062('0x5b')]['id'];}return db[_0x8062('0x39')][_0x8062('0x58')]({'where':{'id':_0x1238b6[_0x8062('0x5c')]['id']}})['then'](handleEntityNotFound(_0x196058,null))[_0x8062('0x2e')](function(_0x577dff){if(_0x577dff){_0x1238b6[_0x8062('0x5b')]['OpenchannelAccountId']=_0x577dff['id'];return db[_0x8062('0x5f')][_0x8062('0x53')](_0x1238b6[_0x8062('0x5b')]);}})[_0x8062('0x2e')](respondWithResult(_0x196058,null))[_0x8062('0x22')](handleError(_0x196058,null));};exports[_0x8062('0x60')]=function(_0x473562,_0x1a61e9,_0x26168b){var _0x30c49f={'raw':![],'where':{}};var _0x1c17bd={};var _0x1520ab={'count':0x0,'rows':[]};return db[_0x8062('0x39')][_0x8062('0x61')]({'where':{'id':_0x473562[_0x8062('0x5c')]['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x1a61e9,null))['then'](function(_0xa391f0){if(_0xa391f0){_0x1c17bd[_0x8062('0x42')]=_[_0x8062('0x3f')](db[_0x8062('0x5f')][_0x8062('0x3a')]);_0x1c17bd['query']=_[_0x8062('0x3f')](_0x473562[_0x8062('0x3e')]);_0x1c17bd[_0x8062('0x40')]=_[_0x8062('0x41')](_0x1c17bd['model'],_0x1c17bd[_0x8062('0x3e')]);_0x30c49f[_0x8062('0x43')]=_[_0x8062('0x41')](_0x1c17bd['model'],qs[_0x8062('0x44')](_0x473562[_0x8062('0x3e')][_0x8062('0x44')]));_0x30c49f[_0x8062('0x43')]=_0x30c49f[_0x8062('0x43')][_0x8062('0x45')]?_0x30c49f[_0x8062('0x43')]:_0x1c17bd[_0x8062('0x42')];if(!_0x473562['query'][_0x8062('0x46')](_0x8062('0x62'))){_0x30c49f[_0x8062('0x28')]=qs['limit'](_0x473562[_0x8062('0x3e')]['limit']);_0x30c49f[_0x8062('0x26')]=qs['offset'](_0x473562['query'][_0x8062('0x26')]);}_0x30c49f[_0x8062('0x63')]=qs[_0x8062('0x47')](_0x473562[_0x8062('0x3e')][_0x8062('0x47')]);_0x30c49f[_0x8062('0x48')]=qs[_0x8062('0x40')](_[_0x8062('0x49')](_0x473562[_0x8062('0x3e')],_0x1c17bd[_0x8062('0x40')]));_0x30c49f['where'][_0x8062('0x64')]=_0xa391f0['id'];if(_0x473562[_0x8062('0x3e')][_0x8062('0x4a')]){_0x30c49f['where']=_[_0x8062('0x4b')](_0x30c49f[_0x8062('0x48')],{'$or':_['map'](_0x30c49f[_0x8062('0x43')],function(_0x52fd8f){var _0x580231={};_0x580231[_0x52fd8f]={'$like':'%'+_0x473562[_0x8062('0x3e')][_0x8062('0x4a')]+'%'};return _0x580231;})});}_0x30c49f=_['merge']({},_0x30c49f,_0x473562['options']);return db[_0x8062('0x5f')]['count']({'where':_0x30c49f[_0x8062('0x48')]})[_0x8062('0x2e')](function(_0xdd9a05){_0x1520ab['count']=_0xdd9a05;if(_0x473562[_0x8062('0x3e')][_0x8062('0x52')]){_0x30c49f['include']=[{'all':!![]}];}return db[_0x8062('0x5f')][_0x8062('0x65')](_0x30c49f);})[_0x8062('0x2e')](function(_0x448172){_0x1520ab[_0x8062('0x4f')]=_0x448172;return _0x1520ab;});}})['then'](respondWithFilteredResult(_0x1a61e9,_0x30c49f))[_0x8062('0x22')](handleError(_0x1a61e9,null));};exports[_0x8062('0x66')]=function(_0x213b18,_0x150f33,_0x3a6371){return db['OpenchannelAccount'][_0x8062('0x58')]({'where':{'id':_0x213b18['params']['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x150f33,null))[_0x8062('0x2e')](function(_0x258d49){if(_0x258d49){return _0x258d49[_0x8062('0x66')](_0x213b18[_0x8062('0x3e')][_0x8062('0x67')]);}})[_0x8062('0x2e')](respondWithStatusCode(_0x150f33,null))[_0x8062('0x22')](handleError(_0x150f33,null));};exports['addAnswer']=function(_0x35851c,_0x14cd7b,_0x4e557b){if(_0x35851c[_0x8062('0x5b')]['id']){delete _0x35851c[_0x8062('0x5b')]['id'];}return db[_0x8062('0x39')][_0x8062('0x58')]({'where':{'id':_0x35851c['params']['id']}})['then'](handleEntityNotFound(_0x14cd7b,null))[_0x8062('0x2e')](function(_0x3509e9){if(_0x3509e9){_0x35851c[_0x8062('0x5b')][_0x8062('0x64')]=_0x3509e9['id'];return db[_0x8062('0x68')][_0x8062('0x53')](_0x35851c[_0x8062('0x5b')]);}})[_0x8062('0x2e')](respondWithResult(_0x14cd7b,null))[_0x8062('0x22')](handleError(_0x14cd7b,null));};exports[_0x8062('0x69')]=function(_0x9e5c85,_0x1f1ddb,_0x38af46){var _0x276eb8={'raw':![],'where':{}};var _0x34dfe3={};var _0x577735={'count':0x0,'rows':[]};return db[_0x8062('0x39')][_0x8062('0x61')]({'where':{'id':_0x9e5c85[_0x8062('0x5c')]['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x1f1ddb,null))[_0x8062('0x2e')](function(_0x1de63d){if(_0x1de63d){_0x34dfe3[_0x8062('0x42')]=_[_0x8062('0x3f')](db[_0x8062('0x68')][_0x8062('0x3a')]);_0x34dfe3['query']=_[_0x8062('0x3f')](_0x9e5c85[_0x8062('0x3e')]);_0x34dfe3[_0x8062('0x40')]=_['intersection'](_0x34dfe3[_0x8062('0x42')],_0x34dfe3[_0x8062('0x3e')]);_0x276eb8[_0x8062('0x43')]=_[_0x8062('0x41')](_0x34dfe3[_0x8062('0x42')],qs[_0x8062('0x44')](_0x9e5c85[_0x8062('0x3e')][_0x8062('0x44')]));_0x276eb8['attributes']=_0x276eb8['attributes'][_0x8062('0x45')]?_0x276eb8[_0x8062('0x43')]:_0x34dfe3[_0x8062('0x42')];if(!_0x9e5c85['query'][_0x8062('0x46')](_0x8062('0x62'))){_0x276eb8[_0x8062('0x28')]=qs[_0x8062('0x28')](_0x9e5c85[_0x8062('0x3e')][_0x8062('0x28')]);_0x276eb8[_0x8062('0x26')]=qs['offset'](_0x9e5c85[_0x8062('0x3e')][_0x8062('0x26')]);}_0x276eb8['order']=qs[_0x8062('0x47')](_0x9e5c85['query'][_0x8062('0x47')]);_0x276eb8['where']=qs['filters'](_[_0x8062('0x49')](_0x9e5c85['query'],_0x34dfe3[_0x8062('0x40')]));_0x276eb8[_0x8062('0x48')][_0x8062('0x64')]=_0x1de63d['id'];if(_0x9e5c85['query'][_0x8062('0x4a')]){_0x276eb8['where']=_[_0x8062('0x4b')](_0x276eb8[_0x8062('0x48')],{'$or':_[_0x8062('0x38')](_0x276eb8[_0x8062('0x43')],function(_0x4cb318){var _0x47ed8b={};_0x47ed8b[_0x4cb318]={'$like':'%'+_0x9e5c85[_0x8062('0x3e')][_0x8062('0x4a')]+'%'};return _0x47ed8b;})});}_0x276eb8=_[_0x8062('0x4b')]({},_0x276eb8,_0x9e5c85[_0x8062('0x4d')]);return db[_0x8062('0x68')]['count']({'where':_0x276eb8[_0x8062('0x48')]})[_0x8062('0x2e')](function(_0x431aef){_0x577735[_0x8062('0x29')]=_0x431aef;if(_0x9e5c85[_0x8062('0x3e')][_0x8062('0x52')]){_0x276eb8[_0x8062('0x4e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8062('0x65')](_0x276eb8);})[_0x8062('0x2e')](function(_0x1574b5){_0x577735['rows']=_0x1574b5;return _0x577735;});}})['then'](respondWithFilteredResult(_0x1f1ddb,_0x276eb8))[_0x8062('0x22')](handleError(_0x1f1ddb,null));};exports[_0x8062('0x6a')]=function(_0x154eb1,_0x42888f,_0x4d7f21){return db[_0x8062('0x39')]['find']({'where':{'id':_0x154eb1['params']['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x42888f,null))[_0x8062('0x2e')](function(_0x24efec){if(_0x24efec){return _0x24efec['removeAnswers'](_0x154eb1[_0x8062('0x3e')][_0x8062('0x67')]);}})[_0x8062('0x2e')](respondWithStatusCode(_0x42888f,null))[_0x8062('0x22')](handleError(_0x42888f,null));};exports[_0x8062('0x6b')]=function(_0x5e0bbc,_0x38307f,_0x6efde5){var _0x36d7cb={'body':_0x5e0bbc[_0x8062('0x5b')],'channel':_0x8062('0x6c')};var _0x5150ae=[];var _0x3b4d5d=[];var _0x30ea99={};var _0x381a20=![];return db['CmContact'][_0x8062('0x5d')]()[_0x8062('0x2e')](function(_0x15ddff){if(!_0x15ddff){throw new db[(_0x8062('0x6d'))][(_0x8062('0x6e'))](_0x8062('0x6f'));}_0x5150ae=_[_0x8062('0x70')](_[_0x8062('0x3f')](_0x15ddff),[_0x8062('0x71'),_0x8062('0x72')]);_0x3b4d5d=_[_0x8062('0x70')](_['keys'](_0x15ddff),[_0x8062('0x71'),'updatedAt',_0x8062('0x73'),_0x8062('0x74')]);if(_0x5e0bbc[_0x8062('0x5b')]['id']){delete _0x5e0bbc[_0x8062('0x5b')]['id'];}if(_[_0x8062('0x75')](_0x5e0bbc[_0x8062('0x5b')]['from'])){throw new db[(_0x8062('0x6d'))]['ValidationError'](_0x8062('0x76'));}if(_[_0x8062('0x75')](_0x5e0bbc['body'][_0x8062('0x5b')])||_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x5b')]===''){throw new db[(_0x8062('0x6d'))]['ValidationError'](_0x8062('0x77'));}if(_[_0x8062('0x75')](_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x78')])){throw new db[(_0x8062('0x6d'))][(_0x8062('0x6e'))](_0x8062('0x79')+_0x3b4d5d);}if(!_[_0x8062('0x7a')](_0x3b4d5d,_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x78')])){throw new db[(_0x8062('0x6d'))][(_0x8062('0x6e'))](_0x8062('0x7b')+_0x3b4d5d);}_0x30ea99[_0x5e0bbc['body'][_0x8062('0x78')]]=_0x5e0bbc[_0x8062('0x5b')]['from'];})[_0x8062('0x2e')](function(){return db['OpenchannelAccount'][_0x8062('0x58')]({'where':{'id':_0x5e0bbc[_0x8062('0x5c')]['id']},'include':[{'model':db[_0x8062('0x7c')],'as':'List','include':[{'model':db[_0x8062('0x7d')],'as':_0x8062('0x7e'),'where':_0x30ea99,'limit':0x1,'order':[[_0x8062('0x72'),'DESC']]}]},{'model':db[_0x8062('0x7f')],'as':_0x8062('0x80')}]});})['then'](handleEntityNotFound(_0x38307f,null))[_0x8062('0x2e')](function(_0x3b0331){if(_0x3b0331&&_0x3b0331[_0x8062('0x81')]){_0x36d7cb[_0x8062('0x82')]=_0x3b0331;_0x36d7cb[_0x8062('0x83')]=_0x3b0331['Applications'];_0x36d7cb['list']=_0x3b0331[_0x8062('0x81')];_0x36d7cb[_0x8062('0x83')]=_[_0x8062('0x84')](_0x36d7cb[_0x8062('0x83')],[_0x8062('0x85')],[_0x8062('0x86')]);if(_0x36d7cb[_0x8062('0x82')]['Applications']){delete _0x36d7cb[_0x8062('0x82')][_0x8062('0x80')];}if(_0x36d7cb[_0x8062('0x82')][_0x8062('0x81')]&&_0x36d7cb[_0x8062('0x82')]['List'][_0x8062('0x7e')]['length']){return _0x36d7cb[_0x8062('0x82')][_0x8062('0x81')]['Contacts'][0x0];}var _0x45d776=_['defaults'](_0x5e0bbc[_0x8062('0x5b')],{'firstName':_0x5e0bbc[_0x8062('0x5b')]['from'],'ListId':_0x3b0331[_0x8062('0x74')]});_0x45d776[_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x78')]]=_0x5e0bbc['body'][_0x8062('0x87')];return db[_0x8062('0x7d')][_0x8062('0x53')](_0x45d776,{'fields':_0x5150ae,'raw':!![]});}})[_0x8062('0x2e')](handleEntityNotFound(_0x38307f,null))[_0x8062('0x2e')](function(_0x341d34){_0x36d7cb[_0x8062('0x88')]=_0x341d34;if(_0x341d34){var _0x3d2e54={'ContactId':_0x341d34['id'],'OpenchannelAccountId':_0x5e0bbc['params']['id'],'from':(_0x341d34[_0x8062('0x89')]||'')+'\x20'+(_0x341d34[_0x8062('0x8a')]||'')};var _0x16d55e={'OpenchannelAccountId':_0x5e0bbc[_0x8062('0x5c')]['id'],'closed':![]};if(_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x8b')]){_0x16d55e['threadId']=_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x8b')];return db[_0x8062('0x8c')][_0x8062('0x58')]({'where':_0x16d55e})[_0x8062('0x2e')](function(_0x177e46){if(_0x177e46){return[_0x177e46,![]];}_0x3d2e54['threadId']=_0x5e0bbc['body'][_0x8062('0x8b')];_0x3d2e54[_0x8062('0x8d')]=_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x8d')];return db[_0x8062('0x8c')][_0x8062('0x53')](_0x3d2e54)['then'](function(_0x1079b9){return[_0x1079b9,!![]];});});}else{_0x16d55e['threadId']=null;}_0x16d55e[_0x8062('0x8e')]=_0x341d34['id'];return db['OpenchannelInteraction']['find']({'where':_0x16d55e})[_0x8062('0x2e')](function(_0x205ece){if(_0x205ece){return[_0x205ece,![]];}return db[_0x8062('0x8c')][_0x8062('0x53')](_0x3d2e54)['then'](function(_0x37841f){return[_0x37841f,!![]];});});}})[_0x8062('0x8f')](function(_0x55a8dc,_0x1937c8){if(_0x55a8dc){_0x381a20=_0x1937c8;if(!_0x1937c8){var _0x155094={'from':(_0x36d7cb[_0x8062('0x88')][_0x8062('0x89')]||'')+'\x20'+(_0x36d7cb[_0x8062('0x88')][_0x8062('0x8a')]||'')};if(_0x5e0bbc['body'][_0x8062('0x8b')]&&_0x5e0bbc['body']['messageId']&&_0x5e0bbc['body'][_0x8062('0x8b')]!=_0x5e0bbc[_0x8062('0x5b')]['messageId']){_0x155094['threadId']=_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x90')];}return _0x55a8dc['update'](_0x155094);}else{return _0x55a8dc;}}})['then'](function(_0x17649b){_0x36d7cb[_0x8062('0x91')]=_0x17649b[_0x8062('0x57')]({'plain':!![]});_0x36d7cb[_0x8062('0x91')][_0x8062('0x92')]=_0x381a20;if(_0x36d7cb[_0x8062('0x91')][_0x8062('0x92')]){if(_0x36d7cb['account'][_0x8062('0x93')]){_0x36d7cb[_0x8062('0x83')]['push']({'id':0x0,'priority':_0x36d7cb[_0x8062('0x83')][_0x8062('0x45')]+0x1,'app':_0x8062('0x94'),'appdata':_0x8062('0x95'),'interval':'*,*,*,*'});}}return db[_0x8062('0x96')]['create']({'body':_0x5e0bbc['body'][_0x8062('0x5b')],'OpenchannelAccountId':_0x5e0bbc[_0x8062('0x5c')]['id'],'OpenchannelInteractionId':_0x17649b['id'],'direction':'in','ContactId':_0x36d7cb[_0x8062('0x88')]['id'],'AttachmentId':_0x5e0bbc[_0x8062('0x5b')][_0x8062('0x97')]});})['then'](function(_0x30bfb2){_0x36d7cb[_0x8062('0x1f')]=_0x30bfb2;if(_0x36d7cb[_0x8062('0x91')][_0x8062('0x98')]){return db[_0x8062('0x99')][_0x8062('0x58')]({'attributes':['id',_0x8062('0x34')],'where':{'id':_0x36d7cb[_0x8062('0x91')][_0x8062('0x98')]}})[_0x8062('0x2e')](function(_0x345cce){if(_0x345cce){_0x36d7cb[_0x8062('0x83')][_0x8062('0x9a')]({'id':0x0,'priority':0x0,'app':_0x8062('0x9b'),'appdata':_0x345cce[_0x8062('0x34')]+','+(_0x36d7cb[_0x8062('0x82')][_0x8062('0x9c')]||0xa),'interval':_0x8062('0x9d')});_0x36d7cb['forcedOwnership']=![];}return respondWithRpcPromise(_0x8062('0x9e'),_0x8062('0x9f'),_0x36d7cb);});}return respondWithRpcPromise(_0x8062('0x9e'),_0x8062('0x9f'),_0x36d7cb);})[_0x8062('0x2e')](function(_0x377ae6){respondWithRpcPromise('EventManager',_0x8062('0xa0'),{'event':_0x8062('0x6b'),'message':_0x377ae6},client9002);return _0x377ae6;})[_0x8062('0x2e')](respondWithResult(_0x38307f,null))[_0x8062('0x22')](handleError(_0x38307f,null));};exports[_0x8062('0xa1')]=function(_0x9ad0ed,_0x465689){var _0x172606=_0x9ad0ed[_0x8062('0x5c')]['id'];var _0x5d876f=_0x9ad0ed[_0x8062('0x5b')];var _0x529e3c=0xc8;var _0x4006da=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x8062('0xa2')][_0x8062('0xa3')][_0x8062('0xa4')][_0x8062('0xa5')]},function(_0x53f95a){return db['OpenchannelAccount'][_0x8062('0x61')]({'where':{'id':_0x172606},'transaction':_0x53f95a})['then'](function(_0x3caac3){if(_0x3caac3){return db[_0x8062('0x7f')]['destroy']({'where':{'OpenchannelAccountId':_0x172606},'transaction':_0x53f95a})['then'](function(){var _0x4d380b=_[_0x8062('0x38')](_0x5d876f,function(_0xf5c246){_0xf5c246[_0x8062('0x64')]=_0x172606;return _0xf5c246;});return db['OpenchannelApplication']['bulkCreate'](_0x4d380b,{'transaction':_0x53f95a});});}else{_0x529e3c=0x194;_0x4006da=[];}});})[_0x8062('0x2e')](function(){if(_0x529e3c!==0x194){return db[_0x8062('0x7f')][_0x8062('0xa6')]({'where':{'OpenchannelAccountId':_0x172606},'order':_0x8062('0x85')})[_0x8062('0x2e')](function(_0x4ba6c9){_0x4006da=_0x4ba6c9;});}})['catch'](function(_0x23c869){_0x529e3c=0x1f4;logger[_0x8062('0x1c')](_0x23c869[_0x8062('0x33')]);if(_0x23c869[_0x8062('0x34')]){delete _0x23c869[_0x8062('0x34')];}_0x4006da=_0x23c869;})[_0x8062('0xa7')](function(){if(_0x4006da===null){_0x465689[_0x8062('0x23')](_0x529e3c);}else{if(_0x529e3c===0x1f4){_0x465689[_0x8062('0x24')](_0x529e3c)[_0x8062('0x35')](_0x4006da);}else{_0x465689[_0x8062('0x24')](_0x529e3c)[_0x8062('0x25')](_0x4006da);}}});};exports['getApplications']=function(_0x3ac9e9,_0x22ef1f,_0x596277){var _0x58e2dc={};var _0x2a3a37={};var _0x2fb5c8;var _0x5f0cec;return db['OpenchannelAccount'][_0x8062('0x61')]({'where':{'id':_0x3ac9e9[_0x8062('0x5c')]['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x22ef1f,null))[_0x8062('0x2e')](function(_0x5b8475){if(_0x5b8475){_0x2fb5c8=_0x5b8475;_0x2a3a37[_0x8062('0x42')]=_[_0x8062('0x3f')](db[_0x8062('0x7f')][_0x8062('0x3a')]);_0x2a3a37['query']=_[_0x8062('0x3f')](_0x3ac9e9[_0x8062('0x3e')]);_0x2a3a37[_0x8062('0x40')]=_[_0x8062('0x41')](_0x2a3a37['model'],_0x2a3a37[_0x8062('0x3e')]);_0x58e2dc['attributes']=_[_0x8062('0x41')](_0x2a3a37['model'],qs[_0x8062('0x44')](_0x3ac9e9[_0x8062('0x3e')]['fields']));_0x58e2dc[_0x8062('0x43')]=_0x58e2dc[_0x8062('0x43')][_0x8062('0x45')]?_0x58e2dc['attributes']:_0x2a3a37['model'];_0x58e2dc[_0x8062('0x63')]=qs['sort'](_0x3ac9e9[_0x8062('0x3e')][_0x8062('0x47')]);_0x58e2dc[_0x8062('0x48')]=qs['filters'](_[_0x8062('0x49')](_0x3ac9e9[_0x8062('0x3e')],_0x2a3a37[_0x8062('0x40')]));if(_0x3ac9e9['query'][_0x8062('0x4a')]){_0x58e2dc['where']=_[_0x8062('0x4b')](_0x58e2dc[_0x8062('0x48')],{'$or':_['map'](_0x58e2dc['attributes'],function(_0x47e97b){var _0x24ef9d={};_0x24ef9d[_0x47e97b]={'$like':'%'+_0x3ac9e9[_0x8062('0x3e')]['filter']+'%'};return _0x24ef9d;})});}_0x58e2dc=_['merge']({},_0x58e2dc,_0x3ac9e9['options']);return _0x2fb5c8[_0x8062('0xa8')](_0x58e2dc);}})[_0x8062('0x2e')](function(_0x29c8d3){if(_0x29c8d3){_0x5f0cec=_0x29c8d3[_0x8062('0x45')];if(!_0x3ac9e9[_0x8062('0x3e')][_0x8062('0x46')](_0x8062('0x62'))){_0x58e2dc[_0x8062('0x28')]=qs['limit'](_0x3ac9e9[_0x8062('0x3e')]['limit']);_0x58e2dc[_0x8062('0x26')]=qs[_0x8062('0x26')](_0x3ac9e9[_0x8062('0x3e')]['offset']);}return _0x2fb5c8[_0x8062('0xa8')](_0x58e2dc);}})[_0x8062('0x2e')](function(_0x40a213){if(_0x40a213){return _0x40a213?{'count':_0x5f0cec,'rows':_0x40a213}:null;}})[_0x8062('0x2e')](respondWithResult(_0x22ef1f,null))[_0x8062('0x22')](handleError(_0x22ef1f,null));};exports[_0x8062('0xa9')]=function(_0x46965f,_0x2464f1,_0x2621b3){var _0x479f1e={'raw':![],'where':{}};var _0x53d577={};var _0xcc527={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8062('0x61')]({'where':{'id':_0x46965f[_0x8062('0x5c')]['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x2464f1,null))['then'](function(_0x439c41){if(_0x439c41){_0x53d577[_0x8062('0x42')]=_[_0x8062('0x3f')](db['OpenchannelInteraction']['rawAttributes']);_0x53d577[_0x8062('0x3e')]=_[_0x8062('0x3f')](_0x46965f[_0x8062('0x3e')]);_0x53d577[_0x8062('0x40')]=_[_0x8062('0x41')](_0x53d577[_0x8062('0x42')],_0x53d577[_0x8062('0x3e')]);_0x479f1e[_0x8062('0x43')]=_[_0x8062('0x41')](_0x53d577[_0x8062('0x42')],qs[_0x8062('0x44')](_0x46965f[_0x8062('0x3e')][_0x8062('0x44')]));_0x479f1e[_0x8062('0x43')]=_0x479f1e['attributes']['length']?_0x479f1e[_0x8062('0x43')]:_0x53d577[_0x8062('0x42')];if(!_0x46965f[_0x8062('0x3e')][_0x8062('0x46')](_0x8062('0x62'))){_0x479f1e[_0x8062('0x28')]=qs[_0x8062('0x28')](_0x46965f[_0x8062('0x3e')]['limit']);_0x479f1e[_0x8062('0x26')]=qs['offset'](_0x46965f['query'][_0x8062('0x26')]);}_0x479f1e[_0x8062('0x63')]=qs[_0x8062('0x47')](_0x46965f[_0x8062('0x3e')][_0x8062('0x47')]);_0x479f1e[_0x8062('0x48')]=qs['filters'](_[_0x8062('0x49')](_0x46965f['query'],_0x53d577['filters']));_0x479f1e[_0x8062('0x48')][_0x8062('0x64')]=_0x439c41['id'];if(_0x46965f[_0x8062('0x3e')][_0x8062('0x4a')]){_0x479f1e[_0x8062('0x48')]=_['merge'](_0x479f1e[_0x8062('0x48')],{'$or':_['map'](_0x479f1e['attributes'],function(_0x4f2560){var _0x21df4f={};_0x21df4f[_0x4f2560]={'$like':'%'+_0x46965f[_0x8062('0x3e')][_0x8062('0x4a')]+'%'};return _0x21df4f;})});}_0x479f1e=_['merge']({},_0x479f1e,_0x46965f[_0x8062('0x4d')]);return db[_0x8062('0x8c')][_0x8062('0x29')]({'where':_0x479f1e[_0x8062('0x48')]})['then'](function(_0x14b596){_0xcc527[_0x8062('0x29')]=_0x14b596;if(_0x46965f[_0x8062('0x3e')][_0x8062('0x52')]){_0x479f1e[_0x8062('0x4e')]=[{'model':db[_0x8062('0x7d')],'as':_0x8062('0xaa'),'required':![]},{'model':db[_0x8062('0x99')],'as':_0x8062('0xab'),'attributes':[_0x8062('0x34'),_0x8062('0xac'),_0x8062('0xad')],'required':![]},{'model':db[_0x8062('0xae')],'as':'Tags','attributes':['id','name',_0x8062('0xaf')],'where':_0x46965f['query'][_0x8062('0xb0')]?{'id':_0x46965f[_0x8062('0x3e')][_0x8062('0xb0')]}:undefined,'required':_0x46965f[_0x8062('0x3e')][_0x8062('0xb0')]?!![]:![]}];}return db[_0x8062('0x8c')]['findAll'](_0x479f1e);})[_0x8062('0x2e')](function(_0xc713fc){_0xcc527[_0x8062('0x4f')]=_0xc713fc;return _0xcc527;});}})[_0x8062('0x2e')](respondWithFilteredResult(_0x2464f1,_0x479f1e))[_0x8062('0x22')](handleError(_0x2464f1,null));};exports['addAgents']=function(_0x31c7ad,_0x4e976e,_0x419bbf){return db[_0x8062('0x39')][_0x8062('0x58')]({'where':{'id':_0x31c7ad[_0x8062('0x5c')]['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x4e976e,null))[_0x8062('0x2e')](function(_0x3e54e7){if(_0x3e54e7){return _0x3e54e7['addAgents'](_0x31c7ad['body'][_0x8062('0x67')],_[_0x8062('0xb1')](_0x31c7ad[_0x8062('0x5b')],['ids','id'])||{})[_0x8062('0x8f')](function(_0x43d954){for(var _0x27bd40=0x0;_0x27bd40<_0x31c7ad[_0x8062('0x5b')][_0x8062('0x67')][_0x8062('0x45')];_0x27bd40+=0x1){socket[_0x8062('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0x31c7ad[_0x8062('0x5b')][_0x8062('0x67')][_0x27bd40]),'OpenchannelAccountId':Number(_0x31c7ad[_0x8062('0x5c')]['id'])});}return _0x43d954;});}})[_0x8062('0x2e')](respondWithResult(_0x4e976e,null))['catch'](handleError(_0x4e976e,null));};exports[_0x8062('0xb3')]=function(_0x9d38f4,_0x47c9f7,_0x19b00d){return db[_0x8062('0x39')][_0x8062('0x58')]({'where':{'id':_0x9d38f4[_0x8062('0x5c')]['id']}})['then'](handleEntityNotFound(_0x47c9f7,null))[_0x8062('0x2e')](function(_0x41f1a2){if(_0x41f1a2){return _0x41f1a2[_0x8062('0xb3')](_0x9d38f4[_0x8062('0x3e')][_0x8062('0x67')])['then'](function(){if(_[_0x8062('0xb4')](_0x9d38f4[_0x8062('0x3e')][_0x8062('0x67')])){for(var _0x5989bc=0x0;_0x5989bc<_0x9d38f4[_0x8062('0x3e')]['ids'][_0x8062('0x45')];_0x5989bc+=0x1){socket[_0x8062('0xb2')](_0x8062('0xb5'),{'UserId':Number(_0x9d38f4[_0x8062('0x3e')][_0x8062('0x67')][_0x5989bc]),'OpenchannelAccountId':Number(_0x9d38f4[_0x8062('0x5c')]['id'])});}}else{socket[_0x8062('0xb2')](_0x8062('0xb5'),{'UserId':Number(_0x9d38f4[_0x8062('0x3e')][_0x8062('0x67')]),'OpenchannelAccountId':Number(_0x9d38f4[_0x8062('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x47c9f7,null))[_0x8062('0x22')](handleError(_0x47c9f7,null));};exports['getAgents']=function(_0x41ee27,_0x54d257,_0x1854de){var _0x4f0c4d={};var _0x18ab25={};var _0x2441bf;var _0x37986c;return db[_0x8062('0x39')][_0x8062('0x61')]({'where':{'id':_0x41ee27['params']['id']}})[_0x8062('0x2e')](handleEntityNotFound(_0x54d257,null))[_0x8062('0x2e')](function(_0x49114f){if(_0x49114f){_0x2441bf=_0x49114f;_0x18ab25[_0x8062('0x42')]=_['keys'](db['User']['rawAttributes']);_0x18ab25[_0x8062('0x3e')]=_[_0x8062('0x3f')](_0x41ee27[_0x8062('0x3e')]);_0x18ab25['filters']=_['intersection'](_0x18ab25[_0x8062('0x42')],_0x18ab25['query']);_0x4f0c4d[_0x8062('0x43')]=_['intersection'](_0x18ab25[_0x8062('0x42')],qs[_0x8062('0x44')](_0x41ee27['query'][_0x8062('0x44')]));_0x4f0c4d[_0x8062('0x43')]=_0x4f0c4d[_0x8062('0x43')][_0x8062('0x45')]?_0x4f0c4d[_0x8062('0x43')]:_0x18ab25[_0x8062('0x42')];_0x4f0c4d[_0x8062('0x63')]=qs[_0x8062('0x47')](_0x41ee27[_0x8062('0x3e')][_0x8062('0x47')]);_0x4f0c4d[_0x8062('0x48')]=qs[_0x8062('0x40')](_[_0x8062('0x49')](_0x41ee27[_0x8062('0x3e')],_0x18ab25[_0x8062('0x40')]));if(_0x41ee27[_0x8062('0x3e')][_0x8062('0x4a')]){_0x4f0c4d[_0x8062('0x48')]=_[_0x8062('0x4b')](_0x4f0c4d[_0x8062('0x48')],{'$or':_[_0x8062('0x38')](_0x4f0c4d[_0x8062('0x43')],function(_0x4fa87d){var _0x5f1822={};_0x5f1822[_0x4fa87d]={'$like':'%'+_0x41ee27[_0x8062('0x3e')][_0x8062('0x4a')]+'%'};return _0x5f1822;})});}_0x4f0c4d=_[_0x8062('0x4b')]({},_0x4f0c4d,_0x41ee27[_0x8062('0x4d')]);return _0x2441bf[_0x8062('0xb6')](_0x4f0c4d);}})['then'](function(_0x2dfad0){if(_0x2dfad0){_0x37986c=_0x2dfad0[_0x8062('0x45')];if(!_0x41ee27['query'][_0x8062('0x46')](_0x8062('0x62'))){_0x4f0c4d['limit']=qs[_0x8062('0x28')](_0x41ee27[_0x8062('0x3e')][_0x8062('0x28')]);_0x4f0c4d['offset']=qs['offset'](_0x41ee27[_0x8062('0x3e')][_0x8062('0x26')]);}return _0x2441bf[_0x8062('0xb6')](_0x4f0c4d);}})['then'](function(_0xe916be){if(_0xe916be){return _0xe916be?{'count':_0x37986c,'rows':_0xe916be}:null;}})['then'](respondWithResult(_0x54d257,null))[_0x8062('0x22')](handleError(_0x54d257,null));};exports[_0x8062('0x35')]=function(_0x509b8c,_0x16b28e,_0x562ce3){var _0x5c20f9,_0x540209,_0x690131;if(_[_0x8062('0x75')](_0x509b8c[_0x8062('0x5b')][_0x8062('0x5b')])||_0x509b8c[_0x8062('0x5b')][_0x8062('0x5b')]===''){throw new db[(_0x8062('0x6d'))][(_0x8062('0x6e'))](_0x8062('0x77'));}if(_[_0x8062('0x75')](_0x509b8c[_0x8062('0x5b')]['to'])){}_0x5c20f9=_0x509b8c[_0x8062('0x5b')]['to'];return db[_0x8062('0x39')]['findOne']({'where':{'id':_0x509b8c[_0x8062('0x5c')]['id']}})['then'](handleEntityNotFound(_0x16b28e,null))[_0x8062('0x2e')](function(_0x521f19){if(_0x521f19){return db[_0x8062('0x39')][_0x8062('0x58')]({'where':{'id':_0x521f19['id']},'include':[{'model':db[_0x8062('0x7c')],'as':_0x8062('0x81'),'include':[{'model':db[_0x8062('0x7d')],'as':_0x8062('0x7e'),'where':{[_0x521f19[_0x8062('0x78')]]:_0x5c20f9},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x16b28e,null))['then'](function(_0x4c7c4a){if(_0x4c7c4a&&_0x4c7c4a[_0x8062('0x81')]){_0x540209=_0x4c7c4a[_0x8062('0x57')]({'plain':!![]});if(_0x540209[_0x8062('0x81')]&&_0x540209[_0x8062('0x81')][_0x8062('0x7e')][_0x8062('0x45')]){return _0x540209[_0x8062('0x81')]['Contacts'][0x0];}return db[_0x8062('0x7d')][_0x8062('0x53')](_[_0x8062('0x14')](_0x509b8c[_0x8062('0x5b')],{'firstName':_0x5c20f9,[_0x4c7c4a[_0x8062('0x78')]]:_0x5c20f9,'phone':_0x5c20f9,'ListId':_0x540209[_0x8062('0x74')]}));}})[_0x8062('0x2e')](handleEntityNotFound(_0x16b28e,null))[_0x8062('0x2e')](function(_0xfb58ca){if(_0xfb58ca){_0x690131=_0xfb58ca;return db[_0x8062('0x8c')][_0x8062('0x58')]({'where':{'ContactId':_0x690131['id'],'closed':![],'OpenchannelAccountId':_0x540209['id']}})[_0x8062('0x2e')](function(_0x43e64a){if(_0x43e64a){return[_0x43e64a,![]];}return db[_0x8062('0x8c')][_0x8062('0x53')]({'UserId':_0x509b8c[_0x8062('0x56')]['id'],'ContactId':_0x690131['id'],'OpenchannelAccountId':_0x540209['id'],'lastMsgDirection':_0x8062('0xb7'),'Messages':[_[_0x8062('0x4b')](_0x509b8c[_0x8062('0x5b')],{'read':![],'body':_0x509b8c[_0x8062('0x5b')]['body'],'OpenchannelAccountId':_0x540209['id'],'UserId':_0x509b8c[_0x8062('0x56')]['id'],'ContactId':_0x690131['id']})]},{'include':[{'model':db[_0x8062('0x96')],'as':_0x8062('0xb8')}]})['then'](function(_0x3a460f){return[_0x3a460f,!![]];});});}})[_0x8062('0x8f')](function(_0x1d0066,_0x4514c5){if(_0x4514c5){return _0x1d0066;}return db['OpenchannelMessage'][_0x8062('0x53')](_['merge'](_0x509b8c[_0x8062('0x5b')],{'read':![],'body':_0x509b8c[_0x8062('0x5b')][_0x8062('0x5b')],'OpenchannelAccountId':_0x540209['id'],'OpenchannelInteractionId':_0x1d0066['id'],'UserId':_0x509b8c[_0x8062('0x56')]['id'],'ContactId':_0x690131['id']}))['then'](function(_0x3b1393){_0x1d0066[_0x8062('0xb9')][_0x8062('0xb8')]=[];_0x1d0066[_0x8062('0xb9')][_0x8062('0xb8')]['push'](_0x3b1393[_0x8062('0xb9')]);return _0x1d0066;});});}})[_0x8062('0x2e')](respondWithResult(_0x16b28e,null))['catch'](handleError(_0x16b28e,null));}; \ No newline at end of file +var _0xd527=['autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','sequelize','ISOLATION_LEVELS','bulkCreate','findAndCountAll','sendStatus','send','getApplications','User','Owner','fullname','internal','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelAccount.socket','register','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','mandatoryDispositionPause','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','openchannel','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','OpenchannelApplication','applications','Applications','list','orderBy','asc','account','defaults','from','CmContact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created'];(function(_0x30081d,_0x37d7ab){var _0x7af3e0=function(_0x461d54){while(--_0x461d54){_0x30081d['push'](_0x30081d['shift']());}};_0x7af3e0(++_0x37d7ab);}(_0xd527,0xe7));var _0x7d52=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0xd527[_0x11d684];return _0x78a301;};'use strict';var emlformat=require(_0x7d52('0x0'));var rimraf=require(_0x7d52('0x1'));var zipdir=require(_0x7d52('0x2'));var jsonpatch=require(_0x7d52('0x3'));var rp=require(_0x7d52('0x4'));var moment=require(_0x7d52('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d52('0x6'));var path=require(_0x7d52('0x7'));var sox=require(_0x7d52('0x8'));var csv=require(_0x7d52('0x9'));var ejs=require(_0x7d52('0xa'));var fs=require('fs');var fs_extra=require(_0x7d52('0xb'));var _=require(_0x7d52('0xc'));var squel=require('squel');var crypto=require(_0x7d52('0xd'));var jsforce=require(_0x7d52('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d52('0xf'));var Papa=require(_0x7d52('0x10'));var Redis=require(_0x7d52('0x11'));var authService=require(_0x7d52('0x12'));var qs=require(_0x7d52('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7d52('0x14'));var config=require(_0x7d52('0x15'));var licenseUtil=require(_0x7d52('0x16'));var db=require(_0x7d52('0x17'))['db'];config['redis']=_['defaults'](config[_0x7d52('0x18')],{'host':_0x7d52('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d52('0x18')]));require(_0x7d52('0x1a'))[_0x7d52('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7d52('0x1c')][_0x7d52('0x1d')]({'port':0x232c});var client9002=jayson[_0x7d52('0x1c')][_0x7d52('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x317b70,_0x12e61d,_0x18c128,_0x55cca6){return new BPromise(function(_0x438ca5,_0x1d0adc){var _0x4cff36=_0x55cca6||client;return _0x4cff36[_0x7d52('0x1e')](_0x317b70,_0x18c128)[_0x7d52('0x1f')](function(_0x3d0e1e){logger[_0x7d52('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x12e61d,_0x7d52('0x21'));logger[_0x7d52('0x22')](_0x7d52('0x23'),_0x12e61d,_0x7d52('0x21'),JSON[_0x7d52('0x24')](_0x3d0e1e));if(_0x3d0e1e[_0x7d52('0x25')]){if(_0x3d0e1e[_0x7d52('0x25')][_0x7d52('0x26')]===0x1f4){logger[_0x7d52('0x25')](_0x7d52('0x27'),_0x12e61d,_0x3d0e1e[_0x7d52('0x25')]['message']);return _0x1d0adc(_0x3d0e1e['error'][_0x7d52('0x28')]);}logger['error'](_0x7d52('0x27'),_0x12e61d,_0x3d0e1e[_0x7d52('0x25')][_0x7d52('0x28')]);return _0x438ca5(_0x3d0e1e[_0x7d52('0x25')]['message']);}else{logger['info'](_0x7d52('0x27'),_0x12e61d,_0x7d52('0x21'));_0x438ca5(_0x3d0e1e[_0x7d52('0x29')][_0x7d52('0x28')]);}})[_0x7d52('0x2a')](function(_0x544f58){logger[_0x7d52('0x25')](_0x7d52('0x27'),_0x12e61d,_0x544f58);_0x1d0adc(_0x544f58);});});}function respondWithStatusCode(_0x51f02d,_0x593c2c){_0x593c2c=_0x593c2c||0xcc;return function(_0x231f17){if(_0x231f17){return _0x51f02d['sendStatus'](_0x593c2c);}return _0x51f02d[_0x7d52('0x2b')](_0x593c2c)[_0x7d52('0x2c')]();};}function respondWithResult(_0x5481fc,_0x393dae){_0x393dae=_0x393dae||0xc8;return function(_0x26470b){if(_0x26470b){return _0x5481fc[_0x7d52('0x2b')](_0x393dae)['json'](_0x26470b);}};}function respondWithFilteredResult(_0x46f42d,_0x34cbe1){return function(_0x100e8e){if(_0x100e8e){var _0x413dc4=typeof _0x34cbe1[_0x7d52('0x2d')]==='undefined'&&typeof _0x34cbe1['limit']===_0x7d52('0x2e');var _0x3f7314=_0x100e8e[_0x7d52('0x2f')];var _0xea1685=_0x413dc4?0x0:_0x34cbe1['offset'];var _0x2f00c3=_0x413dc4?_0x100e8e[_0x7d52('0x2f')]:_0x34cbe1[_0x7d52('0x2d')]+_0x34cbe1[_0x7d52('0x30')];var _0x1b7459;if(_0x2f00c3>=_0x3f7314){_0x2f00c3=_0x3f7314;_0x1b7459=0xc8;}else{_0x1b7459=0xce;}_0x46f42d[_0x7d52('0x2b')](_0x1b7459);return _0x46f42d[_0x7d52('0x31')](_0x7d52('0x32'),_0xea1685+'-'+_0x2f00c3+'/'+_0x3f7314)[_0x7d52('0x33')](_0x100e8e);}return null;};}function patchUpdates(_0x5bd34c){return function(_0x7d297c){try{jsonpatch['apply'](_0x7d297c,_0x5bd34c,!![]);}catch(_0x502b77){return BPromise[_0x7d52('0x34')](_0x502b77);}return _0x7d297c[_0x7d52('0x35')]();};}function saveUpdates(_0x2f97f8,_0x206dd9){return function(_0x4028a4){if(_0x4028a4){return _0x4028a4['update'](_0x2f97f8)[_0x7d52('0x1f')](function(_0x3be055){return _0x3be055;});}return null;};}function removeEntity(_0x2dd2e4,_0x5e0d2b){return function(_0x456c88){if(_0x456c88){return _0x456c88[_0x7d52('0x36')]()[_0x7d52('0x1f')](function(){var _0x2abf59=_0x456c88[_0x7d52('0x37')]({'plain':!![]});var _0x7ac6b3=_0x7d52('0x38');return db[_0x7d52('0x39')][_0x7d52('0x36')]({'where':{'type':_0x7ac6b3,'resourceId':_0x2abf59['id']}})['then'](function(){return _0x456c88;});})[_0x7d52('0x1f')](function(){_0x2dd2e4['status'](0xcc)[_0x7d52('0x2c')]();});}};}function handleEntityNotFound(_0x3292e3,_0x10387f){return function(_0x59ffd9){if(!_0x59ffd9){_0x3292e3['sendStatus'](0x194);}return _0x59ffd9;};}function handleError(_0x7f0c5b,_0x412383){_0x412383=_0x412383||0x1f4;return function(_0x486370){logger[_0x7d52('0x25')](_0x486370[_0x7d52('0x3a')]);if(_0x486370['name']){delete _0x486370[_0x7d52('0x3b')];}_0x7f0c5b[_0x7d52('0x2b')](_0x412383)['send'](_0x486370);};}exports['index']=function(_0x71782f,_0x598fb6){var _0x3b1076={'include':[{'model':db['Pause'],'as':_0x7d52('0x3c')}]},_0x43b7d4={},_0x19f7a7={'count':0x0,'rows':[]};var _0x1048be=_[_0x7d52('0x3d')](db['OpenchannelAccount']['rawAttributes'],function(_0x5d3d7e){return{'name':_0x5d3d7e['fieldName'],'type':_0x5d3d7e[_0x7d52('0x3e')][_0x7d52('0x3f')]};});_0x43b7d4[_0x7d52('0x40')]=_['map'](_0x1048be,_0x7d52('0x3b'));_0x43b7d4[_0x7d52('0x41')]=_[_0x7d52('0x42')](_0x71782f[_0x7d52('0x41')]);_0x43b7d4[_0x7d52('0x43')]=_[_0x7d52('0x44')](_0x43b7d4[_0x7d52('0x40')],_0x43b7d4['query']);_0x3b1076[_0x7d52('0x45')]=_[_0x7d52('0x44')](_0x43b7d4[_0x7d52('0x40')],qs[_0x7d52('0x46')](_0x71782f[_0x7d52('0x41')]['fields']));_0x3b1076[_0x7d52('0x45')]=_0x3b1076[_0x7d52('0x45')][_0x7d52('0x47')]?_0x3b1076[_0x7d52('0x45')]:_0x43b7d4[_0x7d52('0x40')];if(!_0x71782f['query'][_0x7d52('0x48')](_0x7d52('0x49'))){_0x3b1076[_0x7d52('0x30')]=qs[_0x7d52('0x30')](_0x71782f[_0x7d52('0x41')]['limit']);_0x3b1076[_0x7d52('0x2d')]=qs[_0x7d52('0x2d')](_0x71782f[_0x7d52('0x41')]['offset']);}_0x3b1076['order']=qs[_0x7d52('0x4a')](_0x71782f[_0x7d52('0x41')]['sort']);_0x3b1076['where']=qs[_0x7d52('0x43')](_[_0x7d52('0x4b')](_0x71782f[_0x7d52('0x41')],_0x43b7d4[_0x7d52('0x43')]),_0x1048be);if(_0x71782f[_0x7d52('0x41')][_0x7d52('0x4c')]){_0x3b1076[_0x7d52('0x4d')]=_[_0x7d52('0x4e')](_0x3b1076[_0x7d52('0x4d')],{'$or':_[_0x7d52('0x3d')](_0x1048be,function(_0x43b0da){if(_0x43b0da[_0x7d52('0x3e')]!==_0x7d52('0x4f')){var _0xf3aca7={};_0xf3aca7[_0x43b0da['name']]={'$like':'%'+_0x71782f['query'][_0x7d52('0x4c')]+'%'};return _0xf3aca7;}})});}_0x3b1076=_[_0x7d52('0x4e')]({},_0x3b1076,_0x71782f[_0x7d52('0x50')]);var _0x2b1581={'where':_0x3b1076[_0x7d52('0x4d')]};return db[_0x7d52('0x51')][_0x7d52('0x2f')](_0x2b1581)[_0x7d52('0x1f')](function(_0x28e221){_0x19f7a7[_0x7d52('0x2f')]=_0x28e221;if(_0x71782f[_0x7d52('0x41')][_0x7d52('0x52')]){_0x3b1076[_0x7d52('0x53')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x7d52('0x54')](_0x3b1076);})['then'](function(_0x248b51){_0x19f7a7['rows']=_0x248b51;return _0x19f7a7;})[_0x7d52('0x1f')](respondWithFilteredResult(_0x598fb6,_0x3b1076))[_0x7d52('0x2a')](handleError(_0x598fb6,null));};exports[_0x7d52('0x55')]=function(_0x560276,_0x78f66){var _0x2677ab={'raw':![],'where':{'id':_0x560276[_0x7d52('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5f17ae={};_0x5f17ae['model']=_[_0x7d52('0x42')](db['OpenchannelAccount'][_0x7d52('0x57')]);_0x5f17ae[_0x7d52('0x41')]=_[_0x7d52('0x42')](_0x560276[_0x7d52('0x41')]);_0x5f17ae['filters']=_[_0x7d52('0x44')](_0x5f17ae[_0x7d52('0x40')],_0x5f17ae[_0x7d52('0x41')]);_0x2677ab['attributes']=_['intersection'](_0x5f17ae[_0x7d52('0x40')],qs['fields'](_0x560276[_0x7d52('0x41')][_0x7d52('0x46')]));_0x2677ab['attributes']=_0x2677ab['attributes']['length']?_0x2677ab['attributes']:_0x5f17ae[_0x7d52('0x40')];if(_0x560276[_0x7d52('0x41')][_0x7d52('0x52')]){_0x2677ab[_0x7d52('0x53')]=[{'all':!![]}];}_0x2677ab=_[_0x7d52('0x4e')]({},_0x2677ab,_0x560276[_0x7d52('0x50')]);return db['OpenchannelAccount']['find'](_0x2677ab)[_0x7d52('0x1f')](handleEntityNotFound(_0x78f66,null))[_0x7d52('0x1f')](respondWithResult(_0x78f66,null))['catch'](handleError(_0x78f66,null));};exports[_0x7d52('0x58')]=function(_0x376164,_0x28eacc){return db[_0x7d52('0x51')][_0x7d52('0x58')](_0x376164[_0x7d52('0x59')],{})[_0x7d52('0x1f')](function(_0x4b2ca5){var _0x359a28=_0x376164['user'][_0x7d52('0x37')]({'plain':!![]});if(!_0x359a28)throw new Error(_0x7d52('0x5a'));if(_0x359a28['role']===_0x7d52('0x5b')){var _0x4a0399=_0x4b2ca5[_0x7d52('0x37')]({'plain':!![]});var _0x27866c='OpenchannelAccounts';return db['UserProfileSection'][_0x7d52('0x5c')]({'where':{'name':_0x27866c,'userProfileId':_0x359a28[_0x7d52('0x5d')]},'raw':!![]})[_0x7d52('0x1f')](function(_0x284292){if(_0x284292&&_0x284292[_0x7d52('0x5e')]===0x0){return db['UserProfileResource'][_0x7d52('0x58')]({'name':_0x4a0399['name'],'resourceId':_0x4a0399['id'],'type':_0x284292['name'],'sectionId':_0x284292['id']},{})[_0x7d52('0x1f')](function(){return _0x4b2ca5;});}else{return _0x4b2ca5;}})['catch'](function(_0x17865d){logger[_0x7d52('0x25')](_0x7d52('0x5f'),_0x17865d);throw _0x17865d;});}return _0x4b2ca5;})[_0x7d52('0x1f')](respondWithResult(_0x28eacc,0xc9))[_0x7d52('0x2a')](handleError(_0x28eacc,null));};exports[_0x7d52('0x60')]=function(_0x3a5c73,_0x3463c2){if(_0x3a5c73[_0x7d52('0x59')]['id']){delete _0x3a5c73[_0x7d52('0x59')]['id'];}return db[_0x7d52('0x51')][_0x7d52('0x5c')]({'where':{'id':_0x3a5c73['params']['id']},'include':[{'model':db[_0x7d52('0x61')],'as':'mandatoryDispositionPause'}]})[_0x7d52('0x1f')](handleEntityNotFound(_0x3463c2,null))[_0x7d52('0x1f')](saveUpdates(_0x3a5c73[_0x7d52('0x59')],null))[_0x7d52('0x1f')](respondWithResult(_0x3463c2,null))['catch'](handleError(_0x3463c2,null));};exports[_0x7d52('0x36')]=function(_0x40f8cf,_0x1badb1){return db[_0x7d52('0x51')]['find']({'where':{'id':_0x40f8cf['params']['id']}})['then'](handleEntityNotFound(_0x1badb1,null))['then'](removeEntity(_0x1badb1,null))[_0x7d52('0x2a')](handleError(_0x1badb1,null));};exports[_0x7d52('0x62')]=function(_0x357115,_0x291ac8){return db[_0x7d52('0x51')][_0x7d52('0x62')]()['then'](respondWithResult(_0x291ac8,null))['catch'](handleError(_0x291ac8,null));};exports[_0x7d52('0x63')]=function(_0xfe4a9e,_0x433d83,_0x41368a){if(_0xfe4a9e[_0x7d52('0x59')]['id']){delete _0xfe4a9e[_0x7d52('0x59')]['id'];}return db[_0x7d52('0x51')]['find']({'where':{'id':_0xfe4a9e['params']['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x433d83,null))[_0x7d52('0x1f')](function(_0x17c082){if(_0x17c082){_0xfe4a9e[_0x7d52('0x59')][_0x7d52('0x64')]=_0x17c082['id'];return db[_0x7d52('0x65')]['create'](_0xfe4a9e['body']);}})[_0x7d52('0x1f')](respondWithResult(_0x433d83,null))[_0x7d52('0x2a')](handleError(_0x433d83,null));};exports[_0x7d52('0x66')]=function(_0x1bdd73,_0x4120ec,_0x380519){var _0x187c58={'raw':![],'where':{}};var _0x11b8a8={};var _0x121219={'count':0x0,'rows':[]};return db[_0x7d52('0x51')][_0x7d52('0x67')]({'where':{'id':_0x1bdd73[_0x7d52('0x56')]['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x4120ec,null))[_0x7d52('0x1f')](function(_0x369cfa){if(_0x369cfa){_0x11b8a8[_0x7d52('0x40')]=_[_0x7d52('0x42')](db[_0x7d52('0x65')]['rawAttributes']);_0x11b8a8['query']=_['keys'](_0x1bdd73[_0x7d52('0x41')]);_0x11b8a8[_0x7d52('0x43')]=_[_0x7d52('0x44')](_0x11b8a8[_0x7d52('0x40')],_0x11b8a8['query']);_0x187c58['attributes']=_[_0x7d52('0x44')](_0x11b8a8[_0x7d52('0x40')],qs['fields'](_0x1bdd73[_0x7d52('0x41')][_0x7d52('0x46')]));_0x187c58[_0x7d52('0x45')]=_0x187c58[_0x7d52('0x45')][_0x7d52('0x47')]?_0x187c58[_0x7d52('0x45')]:_0x11b8a8[_0x7d52('0x40')];if(!_0x1bdd73['query'][_0x7d52('0x48')](_0x7d52('0x49'))){_0x187c58[_0x7d52('0x30')]=qs[_0x7d52('0x30')](_0x1bdd73['query'][_0x7d52('0x30')]);_0x187c58['offset']=qs[_0x7d52('0x2d')](_0x1bdd73['query'][_0x7d52('0x2d')]);}_0x187c58[_0x7d52('0x68')]=qs['sort'](_0x1bdd73[_0x7d52('0x41')][_0x7d52('0x4a')]);_0x187c58[_0x7d52('0x4d')]=qs[_0x7d52('0x43')](_[_0x7d52('0x4b')](_0x1bdd73[_0x7d52('0x41')],_0x11b8a8[_0x7d52('0x43')]));_0x187c58[_0x7d52('0x4d')]['OpenchannelAccountId']=_0x369cfa['id'];if(_0x1bdd73[_0x7d52('0x41')]['filter']){_0x187c58[_0x7d52('0x4d')]=_['merge'](_0x187c58[_0x7d52('0x4d')],{'$or':_[_0x7d52('0x3d')](_0x187c58[_0x7d52('0x45')],function(_0x308064){var _0x485b4c={};_0x485b4c[_0x308064]={'$like':'%'+_0x1bdd73[_0x7d52('0x41')][_0x7d52('0x4c')]+'%'};return _0x485b4c;})});}_0x187c58=_[_0x7d52('0x4e')]({},_0x187c58,_0x1bdd73['options']);return db[_0x7d52('0x65')][_0x7d52('0x2f')]({'where':_0x187c58[_0x7d52('0x4d')]})[_0x7d52('0x1f')](function(_0x239331){_0x121219['count']=_0x239331;if(_0x1bdd73['query']['includeAll']){_0x187c58[_0x7d52('0x53')]=[{'all':!![]}];}return db[_0x7d52('0x65')][_0x7d52('0x54')](_0x187c58);})['then'](function(_0x22fad5){_0x121219['rows']=_0x22fad5;return _0x121219;});}})[_0x7d52('0x1f')](respondWithFilteredResult(_0x4120ec,_0x187c58))[_0x7d52('0x2a')](handleError(_0x4120ec,null));};exports[_0x7d52('0x69')]=function(_0x166e35,_0x13ae67,_0x3949dc){return db[_0x7d52('0x51')][_0x7d52('0x5c')]({'where':{'id':_0x166e35[_0x7d52('0x56')]['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x13ae67,null))[_0x7d52('0x1f')](function(_0x212d09){if(_0x212d09){return _0x212d09['removeDispositions'](_0x166e35[_0x7d52('0x41')][_0x7d52('0x6a')]);}})[_0x7d52('0x1f')](respondWithStatusCode(_0x13ae67,null))[_0x7d52('0x2a')](handleError(_0x13ae67,null));};exports[_0x7d52('0x6b')]=function(_0x10144f,_0x3b19fe,_0x521e20){if(_0x10144f[_0x7d52('0x59')]['id']){delete _0x10144f[_0x7d52('0x59')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x10144f[_0x7d52('0x56')]['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x3b19fe,null))['then'](function(_0x4c7677){if(_0x4c7677){_0x10144f[_0x7d52('0x59')]['OpenchannelAccountId']=_0x4c7677['id'];return db['CannedAnswer'][_0x7d52('0x58')](_0x10144f['body']);}})[_0x7d52('0x1f')](respondWithResult(_0x3b19fe,null))[_0x7d52('0x2a')](handleError(_0x3b19fe,null));};exports['getAnswers']=function(_0x3c5457,_0x3dbd2b,_0x232c54){var _0x1c532f={'raw':![],'where':{}};var _0xfa6bcc={};var _0x232867={'count':0x0,'rows':[]};return db[_0x7d52('0x51')]['findOne']({'where':{'id':_0x3c5457['params']['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x3dbd2b,null))[_0x7d52('0x1f')](function(_0x499520){if(_0x499520){_0xfa6bcc[_0x7d52('0x40')]=_[_0x7d52('0x42')](db[_0x7d52('0x6c')]['rawAttributes']);_0xfa6bcc[_0x7d52('0x41')]=_['keys'](_0x3c5457['query']);_0xfa6bcc[_0x7d52('0x43')]=_[_0x7d52('0x44')](_0xfa6bcc[_0x7d52('0x40')],_0xfa6bcc['query']);_0x1c532f[_0x7d52('0x45')]=_[_0x7d52('0x44')](_0xfa6bcc['model'],qs[_0x7d52('0x46')](_0x3c5457['query'][_0x7d52('0x46')]));_0x1c532f[_0x7d52('0x45')]=_0x1c532f[_0x7d52('0x45')][_0x7d52('0x47')]?_0x1c532f[_0x7d52('0x45')]:_0xfa6bcc[_0x7d52('0x40')];if(!_0x3c5457[_0x7d52('0x41')][_0x7d52('0x48')]('nolimit')){_0x1c532f[_0x7d52('0x30')]=qs['limit'](_0x3c5457['query'][_0x7d52('0x30')]);_0x1c532f[_0x7d52('0x2d')]=qs['offset'](_0x3c5457['query'][_0x7d52('0x2d')]);}_0x1c532f[_0x7d52('0x68')]=qs[_0x7d52('0x4a')](_0x3c5457[_0x7d52('0x41')][_0x7d52('0x4a')]);_0x1c532f[_0x7d52('0x4d')]=qs[_0x7d52('0x43')](_['pick'](_0x3c5457['query'],_0xfa6bcc[_0x7d52('0x43')]));_0x1c532f['where'][_0x7d52('0x64')]=_0x499520['id'];if(_0x3c5457[_0x7d52('0x41')][_0x7d52('0x4c')]){_0x1c532f[_0x7d52('0x4d')]=_[_0x7d52('0x4e')](_0x1c532f[_0x7d52('0x4d')],{'$or':_[_0x7d52('0x3d')](_0x1c532f[_0x7d52('0x45')],function(_0x1d708b){var _0x5b510c={};_0x5b510c[_0x1d708b]={'$like':'%'+_0x3c5457['query'][_0x7d52('0x4c')]+'%'};return _0x5b510c;})});}_0x1c532f=_[_0x7d52('0x4e')]({},_0x1c532f,_0x3c5457[_0x7d52('0x50')]);return db[_0x7d52('0x6c')][_0x7d52('0x2f')]({'where':_0x1c532f[_0x7d52('0x4d')]})['then'](function(_0x4d6d12){_0x232867[_0x7d52('0x2f')]=_0x4d6d12;if(_0x3c5457['query'][_0x7d52('0x52')]){_0x1c532f[_0x7d52('0x53')]=[{'all':!![]}];}return db[_0x7d52('0x6c')][_0x7d52('0x54')](_0x1c532f);})[_0x7d52('0x1f')](function(_0x95c40b){_0x232867[_0x7d52('0x6d')]=_0x95c40b;return _0x232867;});}})['then'](respondWithFilteredResult(_0x3dbd2b,_0x1c532f))[_0x7d52('0x2a')](handleError(_0x3dbd2b,null));};exports[_0x7d52('0x6e')]=function(_0x4fdcb2,_0x5034f8,_0x479bc8){return db[_0x7d52('0x51')][_0x7d52('0x5c')]({'where':{'id':_0x4fdcb2['params']['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x5034f8,null))[_0x7d52('0x1f')](function(_0xb19642){if(_0xb19642){return _0xb19642[_0x7d52('0x6e')](_0x4fdcb2['query'][_0x7d52('0x6a')]);}})['then'](respondWithStatusCode(_0x5034f8,null))['catch'](handleError(_0x5034f8,null));};exports['notify']=function(_0x2f6718,_0x33ab42,_0x317d4d){var _0x29e91b={'body':_0x2f6718[_0x7d52('0x59')],'channel':_0x7d52('0x6f')};var _0x16717f=[];var _0x957e8b=[];var _0x130759={};var _0x23d497=![];return db['CmContact']['describe']()[_0x7d52('0x1f')](function(_0x6b3b44){if(!_0x6b3b44){throw new db['Sequelize'][(_0x7d52('0x70'))](_0x7d52('0x71'));}_0x16717f=_[_0x7d52('0x72')](_[_0x7d52('0x42')](_0x6b3b44),['createdAt','updatedAt']);_0x957e8b=_[_0x7d52('0x72')](_[_0x7d52('0x42')](_0x6b3b44),[_0x7d52('0x73'),_0x7d52('0x74'),'CompanyId',_0x7d52('0x75')]);if(_0x2f6718['body']['id']){delete _0x2f6718[_0x7d52('0x59')]['id'];}if(_['isNil'](_0x2f6718[_0x7d52('0x59')]['from'])){throw new db[(_0x7d52('0x76'))][(_0x7d52('0x70'))](_0x7d52('0x77'));}if(_[_0x7d52('0x78')](_0x2f6718[_0x7d52('0x59')][_0x7d52('0x59')])||_0x2f6718[_0x7d52('0x59')][_0x7d52('0x59')]===''){throw new db[(_0x7d52('0x76'))][(_0x7d52('0x70'))](_0x7d52('0x79'));}if(_[_0x7d52('0x78')](_0x2f6718[_0x7d52('0x59')]['mapKey'])){throw new db[(_0x7d52('0x76'))][(_0x7d52('0x70'))](_0x7d52('0x7a')+_0x957e8b);}if(!_[_0x7d52('0x7b')](_0x957e8b,_0x2f6718[_0x7d52('0x59')]['mapKey'])){throw new db[(_0x7d52('0x76'))][(_0x7d52('0x70'))](_0x7d52('0x7c')+_0x957e8b);}_0x130759[_0x2f6718[_0x7d52('0x59')][_0x7d52('0x7d')]]=_0x2f6718[_0x7d52('0x59')]['from'];})[_0x7d52('0x1f')](function(){return db[_0x7d52('0x51')][_0x7d52('0x5c')]({'where':{'id':_0x2f6718[_0x7d52('0x56')]['id']},'include':[{'model':db[_0x7d52('0x7e')],'as':_0x7d52('0x7f'),'include':[{'model':db['CmContact'],'as':_0x7d52('0x80'),'where':_0x130759,'limit':0x1,'order':[['updatedAt',_0x7d52('0x81')]]}]},{'model':db[_0x7d52('0x82')],'as':'Applications'}]});})[_0x7d52('0x1f')](handleEntityNotFound(_0x33ab42,null))[_0x7d52('0x1f')](function(_0x1588ee){if(_0x1588ee&&_0x1588ee[_0x7d52('0x7f')]){_0x29e91b['account']=_0x1588ee;_0x29e91b[_0x7d52('0x83')]=_0x1588ee[_0x7d52('0x84')];_0x29e91b[_0x7d52('0x85')]=_0x1588ee['List'];_0x29e91b['applications']=_[_0x7d52('0x86')](_0x29e91b[_0x7d52('0x83')],['priority'],[_0x7d52('0x87')]);if(_0x29e91b['account']['Applications']){delete _0x29e91b[_0x7d52('0x88')]['Applications'];}if(_0x29e91b[_0x7d52('0x88')][_0x7d52('0x7f')]&&_0x29e91b[_0x7d52('0x88')]['List'][_0x7d52('0x80')][_0x7d52('0x47')]){return _0x29e91b[_0x7d52('0x88')][_0x7d52('0x7f')][_0x7d52('0x80')][0x0];}var _0x131059=_[_0x7d52('0x89')](_0x2f6718[_0x7d52('0x59')],{'firstName':_0x2f6718['body']['from'],'ListId':_0x1588ee[_0x7d52('0x75')]});_0x131059[_0x2f6718[_0x7d52('0x59')][_0x7d52('0x7d')]]=_0x2f6718[_0x7d52('0x59')][_0x7d52('0x8a')];return db[_0x7d52('0x8b')][_0x7d52('0x58')](_0x131059,{'fields':_0x16717f,'raw':!![]});}})[_0x7d52('0x1f')](handleEntityNotFound(_0x33ab42,null))[_0x7d52('0x1f')](function(_0x3503d1){_0x29e91b['contact']=_0x3503d1;if(_0x3503d1){var _0x3dd9dd={'ContactId':_0x3503d1['id'],'OpenchannelAccountId':_0x2f6718[_0x7d52('0x56')]['id'],'from':(_0x3503d1[_0x7d52('0x8c')]||'')+'\x20'+(_0x3503d1[_0x7d52('0x8d')]||'')};var _0x4d2a7a={'OpenchannelAccountId':_0x2f6718[_0x7d52('0x56')]['id'],'closed':![]};if(_0x2f6718['body']['threadId']){_0x4d2a7a[_0x7d52('0x8e')]=_0x2f6718['body'][_0x7d52('0x8e')];return db[_0x7d52('0x8f')][_0x7d52('0x5c')]({'where':_0x4d2a7a})[_0x7d52('0x1f')](function(_0x3026ae){if(_0x3026ae){return[_0x3026ae,![]];}_0x3dd9dd[_0x7d52('0x8e')]=_0x2f6718[_0x7d52('0x59')]['threadId'];_0x3dd9dd[_0x7d52('0x90')]=_0x2f6718[_0x7d52('0x59')]['externalUrl'];return db[_0x7d52('0x8f')][_0x7d52('0x58')](_0x3dd9dd)['then'](function(_0x1cafdc){return[_0x1cafdc,!![]];});});}else{_0x4d2a7a['threadId']=null;}_0x4d2a7a[_0x7d52('0x91')]=_0x3503d1['id'];return db[_0x7d52('0x8f')][_0x7d52('0x5c')]({'where':_0x4d2a7a})[_0x7d52('0x1f')](function(_0x16b317){if(_0x16b317){return[_0x16b317,![]];}return db[_0x7d52('0x8f')][_0x7d52('0x58')](_0x3dd9dd)[_0x7d52('0x1f')](function(_0x5452e2){return[_0x5452e2,!![]];});});}})[_0x7d52('0x92')](function(_0x5a8c8d,_0x152fb9){if(_0x5a8c8d){_0x23d497=_0x152fb9;if(!_0x152fb9){var _0x1a9c19={'from':(_0x29e91b[_0x7d52('0x93')][_0x7d52('0x8c')]||'')+'\x20'+(_0x29e91b[_0x7d52('0x93')][_0x7d52('0x8d')]||'')};if(_0x2f6718[_0x7d52('0x59')][_0x7d52('0x8e')]&&_0x2f6718[_0x7d52('0x59')][_0x7d52('0x94')]&&_0x2f6718[_0x7d52('0x59')]['threadId']!=_0x2f6718[_0x7d52('0x59')][_0x7d52('0x94')]){_0x1a9c19[_0x7d52('0x8e')]=_0x2f6718[_0x7d52('0x59')][_0x7d52('0x94')];}return _0x5a8c8d[_0x7d52('0x60')](_0x1a9c19);}else{return _0x5a8c8d;}}})[_0x7d52('0x1f')](function(_0x288b7b){_0x29e91b['interaction']=_0x288b7b[_0x7d52('0x37')]({'plain':!![]});_0x29e91b[_0x7d52('0x95')][_0x7d52('0x96')]=_0x23d497;if(_0x29e91b[_0x7d52('0x95')][_0x7d52('0x96')]){if(_0x29e91b[_0x7d52('0x88')][_0x7d52('0x97')]){_0x29e91b[_0x7d52('0x83')][_0x7d52('0x98')]({'id':0x0,'priority':_0x29e91b[_0x7d52('0x83')]['length']+0x1,'app':_0x7d52('0x99'),'appdata':_0x7d52('0x9a'),'interval':_0x7d52('0x9b')});}}return db[_0x7d52('0x9c')]['create']({'body':_0x2f6718[_0x7d52('0x59')][_0x7d52('0x59')],'OpenchannelAccountId':_0x2f6718[_0x7d52('0x56')]['id'],'OpenchannelInteractionId':_0x288b7b['id'],'direction':'in','ContactId':_0x29e91b[_0x7d52('0x93')]['id'],'AttachmentId':_0x2f6718[_0x7d52('0x59')]['AttachmentId']});})['then'](function(_0x4d6b50){_0x29e91b['message']=_0x4d6b50;if(_0x29e91b['interaction'][_0x7d52('0x9d')]){return db['User'][_0x7d52('0x5c')]({'attributes':['id',_0x7d52('0x3b')],'where':{'id':_0x29e91b['interaction']['UserId']}})[_0x7d52('0x1f')](function(_0x2f75ea){if(_0x2f75ea){_0x29e91b[_0x7d52('0x83')][_0x7d52('0x9e')]({'id':0x0,'priority':0x0,'app':_0x7d52('0x9f'),'appdata':_0x2f75ea[_0x7d52('0x3b')]+','+(_0x29e91b[_0x7d52('0x88')][_0x7d52('0xa0')]||0xa),'interval':_0x7d52('0x9b')});_0x29e91b[_0x7d52('0xa1')]=![];}return respondWithRpcPromise(_0x7d52('0xa2'),_0x7d52('0xa3'),_0x29e91b);});}return respondWithRpcPromise(_0x7d52('0xa2'),_0x7d52('0xa3'),_0x29e91b);})['then'](function(_0x29e02a){respondWithRpcPromise(_0x7d52('0xa4'),_0x7d52('0xa4'),{'event':'notify','message':_0x29e02a},client9002);return _0x29e02a;})[_0x7d52('0x1f')](respondWithResult(_0x33ab42,null))[_0x7d52('0x2a')](handleError(_0x33ab42,null));};exports[_0x7d52('0xa5')]=function(_0x34d3e7,_0x1cf79f){var _0x268b3f=_0x34d3e7['params']['id'];var _0x1f755e=_0x34d3e7[_0x7d52('0x59')];var _0x28df85=0xc8;var _0x190bb8=null;return db['sequelize'][_0x7d52('0xa6')]({'isolationLevel':db[_0x7d52('0xa7')]['Transaction'][_0x7d52('0xa8')]['READ_COMMITTED']},function(_0x44eefc){return db[_0x7d52('0x51')][_0x7d52('0x67')]({'where':{'id':_0x268b3f},'transaction':_0x44eefc})['then'](function(_0x525d13){if(_0x525d13){return db['OpenchannelApplication'][_0x7d52('0x36')]({'where':{'OpenchannelAccountId':_0x268b3f},'transaction':_0x44eefc})[_0x7d52('0x1f')](function(){var _0x5f2aa7=_['map'](_0x1f755e,function(_0x59c73c){_0x59c73c[_0x7d52('0x64')]=_0x268b3f;return _0x59c73c;});return db[_0x7d52('0x82')][_0x7d52('0xa9')](_0x5f2aa7,{'transaction':_0x44eefc});});}else{_0x28df85=0x194;_0x190bb8=[];}});})[_0x7d52('0x1f')](function(){if(_0x28df85!==0x194){return db[_0x7d52('0x82')][_0x7d52('0xaa')]({'where':{'OpenchannelAccountId':_0x268b3f},'order':'priority'})[_0x7d52('0x1f')](function(_0x39a29b){_0x190bb8=_0x39a29b;});}})[_0x7d52('0x2a')](function(_0x3945f2){_0x28df85=0x1f4;logger[_0x7d52('0x25')](_0x3945f2[_0x7d52('0x3a')]);if(_0x3945f2[_0x7d52('0x3b')]){delete _0x3945f2[_0x7d52('0x3b')];}_0x190bb8=_0x3945f2;})['finally'](function(){if(_0x190bb8===null){_0x1cf79f[_0x7d52('0xab')](_0x28df85);}else{if(_0x28df85===0x1f4){_0x1cf79f[_0x7d52('0x2b')](_0x28df85)[_0x7d52('0xac')](_0x190bb8);}else{_0x1cf79f[_0x7d52('0x2b')](_0x28df85)[_0x7d52('0x33')](_0x190bb8);}}});};exports[_0x7d52('0xad')]=function(_0x4c885c,_0x170470,_0x213ea7){var _0x1c5374={};var _0x267548={};var _0x9be11a;var _0x416dc4;return db[_0x7d52('0x51')][_0x7d52('0x67')]({'where':{'id':_0x4c885c[_0x7d52('0x56')]['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x170470,null))[_0x7d52('0x1f')](function(_0x5ee41c){if(_0x5ee41c){_0x9be11a=_0x5ee41c;_0x267548[_0x7d52('0x40')]=_[_0x7d52('0x42')](db['OpenchannelApplication'][_0x7d52('0x57')]);_0x267548[_0x7d52('0x41')]=_[_0x7d52('0x42')](_0x4c885c[_0x7d52('0x41')]);_0x267548[_0x7d52('0x43')]=_[_0x7d52('0x44')](_0x267548['model'],_0x267548[_0x7d52('0x41')]);_0x1c5374['attributes']=_[_0x7d52('0x44')](_0x267548[_0x7d52('0x40')],qs[_0x7d52('0x46')](_0x4c885c[_0x7d52('0x41')][_0x7d52('0x46')]));_0x1c5374['attributes']=_0x1c5374[_0x7d52('0x45')][_0x7d52('0x47')]?_0x1c5374[_0x7d52('0x45')]:_0x267548[_0x7d52('0x40')];_0x1c5374[_0x7d52('0x68')]=qs[_0x7d52('0x4a')](_0x4c885c[_0x7d52('0x41')][_0x7d52('0x4a')]);_0x1c5374[_0x7d52('0x4d')]=qs['filters'](_[_0x7d52('0x4b')](_0x4c885c['query'],_0x267548[_0x7d52('0x43')]));if(_0x4c885c[_0x7d52('0x41')][_0x7d52('0x4c')]){_0x1c5374[_0x7d52('0x4d')]=_[_0x7d52('0x4e')](_0x1c5374[_0x7d52('0x4d')],{'$or':_[_0x7d52('0x3d')](_0x1c5374['attributes'],function(_0x165a4b){var _0x1dee8a={};_0x1dee8a[_0x165a4b]={'$like':'%'+_0x4c885c[_0x7d52('0x41')][_0x7d52('0x4c')]+'%'};return _0x1dee8a;})});}_0x1c5374=_['merge']({},_0x1c5374,_0x4c885c['options']);return _0x9be11a[_0x7d52('0xad')](_0x1c5374);}})['then'](function(_0x39b318){if(_0x39b318){_0x416dc4=_0x39b318['length'];if(!_0x4c885c['query'][_0x7d52('0x48')](_0x7d52('0x49'))){_0x1c5374['limit']=qs['limit'](_0x4c885c[_0x7d52('0x41')]['limit']);_0x1c5374['offset']=qs['offset'](_0x4c885c[_0x7d52('0x41')][_0x7d52('0x2d')]);}return _0x9be11a[_0x7d52('0xad')](_0x1c5374);}})['then'](function(_0x1702b3){if(_0x1702b3){return _0x1702b3?{'count':_0x416dc4,'rows':_0x1702b3}:null;}})[_0x7d52('0x1f')](respondWithResult(_0x170470,null))[_0x7d52('0x2a')](handleError(_0x170470,null));};exports['getInteractions']=function(_0x115023,_0x14a511,_0x14e140){var _0x129616={'raw':![],'where':{}};var _0x2b0170={};var _0x52c61a={'count':0x0,'rows':[]};return db[_0x7d52('0x51')][_0x7d52('0x67')]({'where':{'id':_0x115023[_0x7d52('0x56')]['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x14a511,null))[_0x7d52('0x1f')](function(_0x330fc0){if(_0x330fc0){_0x2b0170[_0x7d52('0x40')]=_[_0x7d52('0x42')](db['OpenchannelInteraction'][_0x7d52('0x57')]);_0x2b0170[_0x7d52('0x41')]=_[_0x7d52('0x42')](_0x115023[_0x7d52('0x41')]);_0x2b0170[_0x7d52('0x43')]=_[_0x7d52('0x44')](_0x2b0170[_0x7d52('0x40')],_0x2b0170[_0x7d52('0x41')]);_0x129616[_0x7d52('0x45')]=_[_0x7d52('0x44')](_0x2b0170['model'],qs[_0x7d52('0x46')](_0x115023['query']['fields']));_0x129616['attributes']=_0x129616[_0x7d52('0x45')]['length']?_0x129616['attributes']:_0x2b0170[_0x7d52('0x40')];if(!_0x115023[_0x7d52('0x41')][_0x7d52('0x48')]('nolimit')){_0x129616[_0x7d52('0x30')]=qs[_0x7d52('0x30')](_0x115023[_0x7d52('0x41')][_0x7d52('0x30')]);_0x129616[_0x7d52('0x2d')]=qs[_0x7d52('0x2d')](_0x115023[_0x7d52('0x41')][_0x7d52('0x2d')]);}_0x129616[_0x7d52('0x68')]=qs[_0x7d52('0x4a')](_0x115023[_0x7d52('0x41')][_0x7d52('0x4a')]);_0x129616[_0x7d52('0x4d')]=qs['filters'](_[_0x7d52('0x4b')](_0x115023['query'],_0x2b0170[_0x7d52('0x43')]));_0x129616[_0x7d52('0x4d')][_0x7d52('0x64')]=_0x330fc0['id'];if(_0x115023[_0x7d52('0x41')][_0x7d52('0x4c')]){_0x129616[_0x7d52('0x4d')]=_[_0x7d52('0x4e')](_0x129616[_0x7d52('0x4d')],{'$or':_[_0x7d52('0x3d')](_0x129616[_0x7d52('0x45')],function(_0x3c8e00){var _0xa6dd2c={};_0xa6dd2c[_0x3c8e00]={'$like':'%'+_0x115023['query']['filter']+'%'};return _0xa6dd2c;})});}_0x129616=_[_0x7d52('0x4e')]({},_0x129616,_0x115023['options']);return db[_0x7d52('0x8f')][_0x7d52('0x2f')]({'where':_0x129616[_0x7d52('0x4d')]})['then'](function(_0x9a056b){_0x52c61a[_0x7d52('0x2f')]=_0x9a056b;if(_0x115023[_0x7d52('0x41')][_0x7d52('0x52')]){_0x129616[_0x7d52('0x53')]=[{'model':db[_0x7d52('0x8b')],'as':'Contact','required':![]},{'model':db[_0x7d52('0xae')],'as':_0x7d52('0xaf'),'attributes':[_0x7d52('0x3b'),_0x7d52('0xb0'),_0x7d52('0xb1')],'required':![]},{'model':db['Tag'],'as':_0x7d52('0xb2'),'attributes':['id','name','color'],'where':_0x115023['query'][_0x7d52('0xb3')]?{'id':_0x115023[_0x7d52('0x41')]['tag']}:undefined,'required':_0x115023[_0x7d52('0x41')][_0x7d52('0xb3')]?!![]:![]}];}return db[_0x7d52('0x8f')][_0x7d52('0x54')](_0x129616);})[_0x7d52('0x1f')](function(_0x247fc0){_0x52c61a[_0x7d52('0x6d')]=_0x247fc0;return _0x52c61a;});}})['then'](respondWithFilteredResult(_0x14a511,_0x129616))[_0x7d52('0x2a')](handleError(_0x14a511,null));};exports[_0x7d52('0xb4')]=function(_0x2dd243,_0x4b11ff,_0x4c4749){return db[_0x7d52('0x51')]['find']({'where':{'id':_0x2dd243[_0x7d52('0x56')]['id']}})['then'](handleEntityNotFound(_0x4b11ff,null))[_0x7d52('0x1f')](function(_0x27f9d6){if(_0x27f9d6){return _0x27f9d6['addAgents'](_0x2dd243[_0x7d52('0x59')][_0x7d52('0x6a')],_[_0x7d52('0xb5')](_0x2dd243[_0x7d52('0x59')],['ids','id'])||{})[_0x7d52('0x92')](function(_0x5b22c4){for(var _0xc5266a=0x0;_0xc5266a<_0x2dd243['body'][_0x7d52('0x6a')][_0x7d52('0x47')];_0xc5266a+=0x1){socket[_0x7d52('0xb6')](_0x7d52('0xb7'),{'UserId':Number(_0x2dd243[_0x7d52('0x59')]['ids'][_0xc5266a]),'OpenchannelAccountId':Number(_0x2dd243[_0x7d52('0x56')]['id'])});}return _0x5b22c4;});}})['then'](respondWithResult(_0x4b11ff,null))[_0x7d52('0x2a')](handleError(_0x4b11ff,null));};exports[_0x7d52('0xb8')]=function(_0x2672d0,_0x15b646,_0xd7d72e){return db['OpenchannelAccount'][_0x7d52('0x5c')]({'where':{'id':_0x2672d0[_0x7d52('0x56')]['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0x15b646,null))[_0x7d52('0x1f')](function(_0x561eba){if(_0x561eba){return _0x561eba[_0x7d52('0xb8')](_0x2672d0[_0x7d52('0x41')][_0x7d52('0x6a')])[_0x7d52('0x1f')](function(){if(_[_0x7d52('0xb9')](_0x2672d0[_0x7d52('0x41')][_0x7d52('0x6a')])){for(var _0x3b1dab=0x0;_0x3b1dab<_0x2672d0['query'][_0x7d52('0x6a')][_0x7d52('0x47')];_0x3b1dab+=0x1){socket['emit'](_0x7d52('0xba'),{'UserId':Number(_0x2672d0[_0x7d52('0x41')]['ids'][_0x3b1dab]),'OpenchannelAccountId':Number(_0x2672d0['params']['id'])});}}else{socket['emit'](_0x7d52('0xba'),{'UserId':Number(_0x2672d0[_0x7d52('0x41')][_0x7d52('0x6a')]),'OpenchannelAccountId':Number(_0x2672d0[_0x7d52('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x15b646,null))[_0x7d52('0x2a')](handleError(_0x15b646,null));};exports['getAgents']=function(_0x4e482e,_0xb15c95,_0x631030){var _0x422f54={};var _0xf635df={};var _0x50b99b;var _0x28c3ce;return db[_0x7d52('0x51')][_0x7d52('0x67')]({'where':{'id':_0x4e482e[_0x7d52('0x56')]['id']}})[_0x7d52('0x1f')](handleEntityNotFound(_0xb15c95,null))[_0x7d52('0x1f')](function(_0x2c4c4b){if(_0x2c4c4b){_0x50b99b=_0x2c4c4b;_0xf635df[_0x7d52('0x40')]=_[_0x7d52('0x42')](db['User']['rawAttributes']);_0xf635df[_0x7d52('0x41')]=_['keys'](_0x4e482e[_0x7d52('0x41')]);_0xf635df['filters']=_[_0x7d52('0x44')](_0xf635df[_0x7d52('0x40')],_0xf635df[_0x7d52('0x41')]);_0x422f54['attributes']=_[_0x7d52('0x44')](_0xf635df['model'],qs[_0x7d52('0x46')](_0x4e482e[_0x7d52('0x41')][_0x7d52('0x46')]));_0x422f54[_0x7d52('0x45')]=_0x422f54[_0x7d52('0x45')][_0x7d52('0x47')]?_0x422f54[_0x7d52('0x45')]:_0xf635df[_0x7d52('0x40')];_0x422f54[_0x7d52('0x68')]=qs[_0x7d52('0x4a')](_0x4e482e[_0x7d52('0x41')]['sort']);_0x422f54[_0x7d52('0x4d')]=qs[_0x7d52('0x43')](_[_0x7d52('0x4b')](_0x4e482e[_0x7d52('0x41')],_0xf635df[_0x7d52('0x43')]));if(_0x4e482e[_0x7d52('0x41')][_0x7d52('0x4c')]){_0x422f54[_0x7d52('0x4d')]=_['merge'](_0x422f54[_0x7d52('0x4d')],{'$or':_[_0x7d52('0x3d')](_0x422f54['attributes'],function(_0x1935ea){var _0x446f3a={};_0x446f3a[_0x1935ea]={'$like':'%'+_0x4e482e[_0x7d52('0x41')][_0x7d52('0x4c')]+'%'};return _0x446f3a;})});}_0x422f54=_[_0x7d52('0x4e')]({},_0x422f54,_0x4e482e['options']);return _0x50b99b[_0x7d52('0xbb')](_0x422f54);}})['then'](function(_0x51071d){if(_0x51071d){_0x28c3ce=_0x51071d['length'];if(!_0x4e482e[_0x7d52('0x41')][_0x7d52('0x48')](_0x7d52('0x49'))){_0x422f54[_0x7d52('0x30')]=qs[_0x7d52('0x30')](_0x4e482e[_0x7d52('0x41')][_0x7d52('0x30')]);_0x422f54[_0x7d52('0x2d')]=qs[_0x7d52('0x2d')](_0x4e482e[_0x7d52('0x41')]['offset']);}return _0x50b99b[_0x7d52('0xbb')](_0x422f54);}})[_0x7d52('0x1f')](function(_0xa36865){if(_0xa36865){return _0xa36865?{'count':_0x28c3ce,'rows':_0xa36865}:null;}})[_0x7d52('0x1f')](respondWithResult(_0xb15c95,null))['catch'](handleError(_0xb15c95,null));};exports[_0x7d52('0xac')]=function(_0x3d5bd9,_0x5819cc,_0x47593e){var _0x15c9de,_0x418b2e,_0x3cce1b;if(_[_0x7d52('0x78')](_0x3d5bd9[_0x7d52('0x59')][_0x7d52('0x59')])||_0x3d5bd9[_0x7d52('0x59')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7d52('0x78')](_0x3d5bd9[_0x7d52('0x59')]['to'])){}_0x15c9de=_0x3d5bd9[_0x7d52('0x59')]['to'];return db[_0x7d52('0x51')][_0x7d52('0x67')]({'where':{'id':_0x3d5bd9['params']['id']}})['then'](handleEntityNotFound(_0x5819cc,null))[_0x7d52('0x1f')](function(_0x597638){if(_0x597638){return db[_0x7d52('0x51')][_0x7d52('0x5c')]({'where':{'id':_0x597638['id']},'include':[{'model':db[_0x7d52('0x7e')],'as':_0x7d52('0x7f'),'include':[{'model':db[_0x7d52('0x8b')],'as':_0x7d52('0x80'),'where':{[_0x597638['mapKey']]:_0x15c9de},'limit':0x1,'order':[[_0x7d52('0x74'),_0x7d52('0x81')]]}]}]})[_0x7d52('0x1f')](handleEntityNotFound(_0x5819cc,null))[_0x7d52('0x1f')](function(_0x231091){if(_0x231091&&_0x231091[_0x7d52('0x7f')]){_0x418b2e=_0x231091[_0x7d52('0x37')]({'plain':!![]});if(_0x418b2e[_0x7d52('0x7f')]&&_0x418b2e[_0x7d52('0x7f')][_0x7d52('0x80')][_0x7d52('0x47')]){return _0x418b2e[_0x7d52('0x7f')][_0x7d52('0x80')][0x0];}return db['CmContact']['create'](_['defaults'](_0x3d5bd9[_0x7d52('0x59')],{'firstName':_0x15c9de,[_0x231091['mapKey']]:_0x15c9de,'phone':_0x15c9de,'ListId':_0x418b2e[_0x7d52('0x75')]}));}})[_0x7d52('0x1f')](handleEntityNotFound(_0x5819cc,null))[_0x7d52('0x1f')](function(_0xb813de){if(_0xb813de){_0x3cce1b=_0xb813de;return db[_0x7d52('0x8f')][_0x7d52('0x5c')]({'where':{'ContactId':_0x3cce1b['id'],'closed':![],'OpenchannelAccountId':_0x418b2e['id']}})[_0x7d52('0x1f')](function(_0x2cb44a){if(_0x2cb44a){return[_0x2cb44a,![]];}return db[_0x7d52('0x8f')][_0x7d52('0x58')]({'UserId':_0x3d5bd9[_0x7d52('0x5b')]['id'],'ContactId':_0x3cce1b['id'],'OpenchannelAccountId':_0x418b2e['id'],'lastMsgDirection':_0x7d52('0xbc'),'Messages':[_[_0x7d52('0x4e')](_0x3d5bd9['body'],{'read':![],'body':_0x3d5bd9[_0x7d52('0x59')][_0x7d52('0x59')],'OpenchannelAccountId':_0x418b2e['id'],'UserId':_0x3d5bd9[_0x7d52('0x5b')]['id'],'ContactId':_0x3cce1b['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x7d52('0xbd')}]})[_0x7d52('0x1f')](function(_0x130825){return[_0x130825,!![]];});});}})[_0x7d52('0x92')](function(_0x4c1349,_0x2b141b){if(_0x2b141b){return _0x4c1349;}return db[_0x7d52('0x9c')][_0x7d52('0x58')](_['merge'](_0x3d5bd9[_0x7d52('0x59')],{'read':![],'body':_0x3d5bd9['body'][_0x7d52('0x59')],'OpenchannelAccountId':_0x418b2e['id'],'OpenchannelInteractionId':_0x4c1349['id'],'UserId':_0x3d5bd9[_0x7d52('0x5b')]['id'],'ContactId':_0x3cce1b['id']}))[_0x7d52('0x1f')](function(_0x4f8c5f){_0x4c1349['dataValues'][_0x7d52('0xbd')]=[];_0x4c1349[_0x7d52('0xbe')][_0x7d52('0xbd')][_0x7d52('0x98')](_0x4f8c5f[_0x7d52('0xbe')]);return _0x4c1349;});});}})[_0x7d52('0x1f')](respondWithResult(_0x5819cc,null))[_0x7d52('0x2a')](handleError(_0x5819cc,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c76a743..1b7c304 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 _0xf4eb=['hook','events','update','emit','hasOwnProperty'];(function(_0x1bda7b,_0x5af05c){var _0x451ca3=function(_0x348f26){while(--_0x348f26){_0x1bda7b['push'](_0x1bda7b['shift']());}};_0x451ca3(++_0x5af05c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1e0b74,_0x41ad50){_0x1e0b74=_0x1e0b74-0x0;var _0xc6f398=_0xf4eb[_0x1e0b74];return _0xc6f398;};'use strict';var EventEmitter=require(_0xbf4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf4e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4e7fa7){return function(_0x2e3070,_0x1c7606,_0x32d1d7){OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7+':'+_0x2e3070['id'],_0x2e3070);OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070);_0x32d1d7(null);};}for(var e in events){if(events[_0xbf4e('0x3')](e)){var event=events[e];OpenchannelAccount[_0xbf4e('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x65efc5,_0x5d978c){var _0x4c387a=function(_0x4a106e){while(--_0x4a106e){_0x65efc5['push'](_0x65efc5['shift']());}};_0x4c387a(++_0x5d978c);}(_0x5b02,0xe9));var _0x25b0=function(_0x3a28c8,_0x27eba9){_0x3a28c8=_0x3a28c8-0x0;var _0x4a30e7=_0x5b02[_0x3a28c8];return _0x4a30e7;};'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 551c3bd..2f02709 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(_0x2c8cf5,_0xd24ea2){var _0x4ff8b9=function(_0x13d387){while(--_0x13d387){_0x2c8cf5['push'](_0x2c8cf5['shift']());}};_0x4ff8b9(++_0xd24ea2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x339f77,_0xf5ba3e){var _0x1e5a45=function(_0x2977fc){while(--_0x2977fc){_0x339f77['push'](_0x339f77['shift']());}};_0x1e5a45(++_0xf5ba3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 bf9b1d6..69e87e5 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 _0x13f6=['code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x43228e,_0x5eb746){var _0x146a85=function(_0x46e83a){while(--_0x46e83a){_0x43228e['push'](_0x43228e['shift']());}};_0x146a85(++_0x5eb746);}(_0x13f6,0x124));var _0x613f=function(_0x4e5216,_0x4f9e39){_0x4e5216=_0x4e5216-0x0;var _0x3a3f5c=_0x13f6[_0x4e5216];return _0x3a3f5c;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x613f('0xa'))(new Redis(config[_0x613f('0xb')]));require(_0x613f('0xc'))[_0x613f('0xd')](socket);function respondWithRpcPromise(_0x4e98ce,_0x1a8dd0,_0x40d7f5){return new BPromise(function(_0xcd514c,_0x5210a0){return client[_0x613f('0xe')](_0x4e98ce,_0x40d7f5)[_0x613f('0xf')](function(_0x31875a){logger['info'](_0x613f('0x10'),_0x1a8dd0,_0x613f('0x11'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1a8dd0,'request\x20sent',JSON[_0x613f('0x12')](_0x31875a));if(_0x31875a[_0x613f('0x13')]){if(_0x31875a[_0x613f('0x13')][_0x613f('0x14')]===0x1f4){logger[_0x613f('0x13')](_0x613f('0x10'),_0x1a8dd0,_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);return _0x5210a0(_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);}logger['error'](_0x613f('0x10'),_0x1a8dd0,_0x31875a['error']['message']);return _0xcd514c(_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);}else{logger['info'](_0x613f('0x10'),_0x1a8dd0,'request\x20sent');_0xcd514c(_0x31875a[_0x613f('0x16')][_0x613f('0x15')]);}})[_0x613f('0x17')](function(_0x2a47f4){logger[_0x613f('0x13')](_0x613f('0x10'),_0x1a8dd0,_0x2a47f4);_0x5210a0(_0x2a47f4);});});} \ No newline at end of file +var _0x04b8=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x40f0df,_0x149a66){var _0x53dc94=function(_0x238dee){while(--_0x238dee){_0x40f0df['push'](_0x40f0df['shift']());}};_0x53dc94(++_0x149a66);}(_0x04b8,0x159));var _0x804b=function(_0x16c2e0,_0x3dc335){_0x16c2e0=_0x16c2e0-0x0;var _0x49b690=_0x04b8[_0x16c2e0];return _0x49b690;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});config[_0x804b('0x9')]=_[_0x804b('0xa')](config['redis'],{'host':_0x804b('0xb'),'port':0x18eb});var socket=require(_0x804b('0xc'))(new Redis(config['redis']));require(_0x804b('0xd'))[_0x804b('0xe')](socket);function respondWithRpcPromise(_0x222487,_0x22c59a,_0x1c5c15){return new BPromise(function(_0x5c1a40,_0x22c98d){return client[_0x804b('0xf')](_0x222487,_0x1c5c15)[_0x804b('0x10')](function(_0x7029e7){logger[_0x804b('0x11')](_0x804b('0x12'),_0x22c59a,'request\x20sent');logger[_0x804b('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x22c59a,_0x804b('0x14'),JSON[_0x804b('0x15')](_0x7029e7));if(_0x7029e7[_0x804b('0x16')]){if(_0x7029e7[_0x804b('0x16')]['code']===0x1f4){logger[_0x804b('0x16')](_0x804b('0x12'),_0x22c59a,_0x7029e7[_0x804b('0x16')][_0x804b('0x17')]);return _0x22c98d(_0x7029e7['error'][_0x804b('0x17')]);}logger[_0x804b('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x22c59a,_0x7029e7[_0x804b('0x16')]['message']);return _0x5c1a40(_0x7029e7[_0x804b('0x16')][_0x804b('0x17')]);}else{logger[_0x804b('0x11')](_0x804b('0x12'),_0x22c59a,_0x804b('0x14'));_0x5c1a40(_0x7029e7['result'][_0x804b('0x17')]);}})['catch'](function(_0x247380){logger[_0x804b('0x16')](_0x804b('0x12'),_0x22c59a,_0x247380);_0x22c98d(_0x247380);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 47aa530..c8024b4 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 _0x5e14=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x4fb5ce,_0x3a79f9){var _0x3c07b5=function(_0x5aed51){while(--_0x5aed51){_0x4fb5ce['push'](_0x4fb5ce['shift']());}};_0x3c07b5(++_0x3a79f9);}(_0x5e14,0x164));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0x45e1('0x0'));var events=[_0x45e1('0x1'),_0x45e1('0x2'),_0x45e1('0x3')];function createListener(_0x12c02b,_0x1af150){return function(_0xfb5d5e){_0x1af150[_0x45e1('0x4')](_0x12c02b,_0xfb5d5e);};}function removeListener(_0x1f8823,_0x33ce6c){return function(){OpenchannelAccountEvents[_0x45e1('0x5')](_0x1f8823,_0x33ce6c);};}exports[_0x45e1('0x6')]=function(_0xc25c34){for(var _0x41b13c=0x0,_0x26ee2e=events[_0x45e1('0x7')];_0x41b13c<_0x26ee2e;_0x41b13c++){var _0x111f7c=events[_0x41b13c];var _0x4062de=createListener(_0x45e1('0x8')+_0x111f7c,_0xc25c34);OpenchannelAccountEvents['on'](_0x111f7c,_0x4062de);}}; \ No newline at end of file +var _0x6b19=['emit','removeListener','./openchannelAccount.events','save','update'];(function(_0x443558,_0x1604d8){var _0x30b0a3=function(_0x3852f3){while(--_0x3852f3){_0x443558['push'](_0x443558['shift']());}};_0x30b0a3(++_0x1604d8);}(_0x6b19,0xe8));var _0x96b1=function(_0x15f22b,_0x265f02){_0x15f22b=_0x15f22b-0x0;var _0x4297e4=_0x6b19[_0x15f22b];return _0x4297e4;};'use strict';var OpenchannelAccountEvents=require(_0x96b1('0x0'));var events=[_0x96b1('0x1'),'remove',_0x96b1('0x2')];function createListener(_0x582556,_0x573f03){return function(_0x2cf16d){_0x573f03[_0x96b1('0x3')](_0x582556,_0x2cf16d);};}function removeListener(_0x1a104c,_0x31332a){return function(){OpenchannelAccountEvents[_0x96b1('0x4')](_0x1a104c,_0x31332a);};}exports['register']=function(_0x8b5ab8){for(var _0x546193=0x0,_0x3e3e1a=events['length'];_0x546193<_0x3e3e1a;_0x546193++){var _0x57a23a=events[_0x546193];var _0x307e65=createListener('openchannelAccount:'+_0x57a23a,_0x8b5ab8);OpenchannelAccountEvents['on'](_0x57a23a,_0x307e65);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 27de688..a7c6306 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 _0x557f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','util'];(function(_0x47396f,_0x48ecca){var _0x3c4e36=function(_0x2f65eb){while(--_0x2f65eb){_0x47396f['push'](_0x47396f['shift']());}};_0x3c4e36(++_0x48ecca);}(_0x557f,0xbd));var _0xf557=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x557f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf557('0x0'));var path=require(_0xf557('0x1'));var timeout=require(_0xf557('0x2'));var express=require(_0xf557('0x3'));var router=express[_0xf557('0x4')]();var fs_extra=require(_0xf557('0x5'));var auth=require(_0xf557('0x6'));var interaction=require(_0xf557('0x7'));var config=require(_0xf557('0x8'));var controller=require('./openchannelApplication.controller');router[_0xf557('0x9')]('/',auth[_0xf557('0xa')](),controller[_0xf557('0xb')]);router[_0xf557('0x9')](_0xf557('0xc'),auth[_0xf557('0xa')](),controller['show']);router[_0xf557('0xd')]('/',auth[_0xf557('0xa')](),controller['create']);router[_0xf557('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf557('0xf')]);router[_0xf557('0x10')]('/:id',auth[_0xf557('0xa')](),controller[_0xf557('0x11')]);module[_0xf557('0x12')]=router; \ No newline at end of file +var _0x495b=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0x495b,0x1be));var _0xb495=function(_0x147bb3,_0x4dd9ac){_0x147bb3=_0x147bb3-0x0;var _0x30cfeb=_0x495b[_0x147bb3];return _0x30cfeb;};'use strict';var multer=require(_0xb495('0x0'));var util=require('util');var path=require(_0xb495('0x1'));var timeout=require('connect-timeout');var express=require(_0xb495('0x2'));var router=express[_0xb495('0x3')]();var fs_extra=require(_0xb495('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb495('0x5'));var config=require(_0xb495('0x6'));var controller=require(_0xb495('0x7'));router[_0xb495('0x8')]('/',auth[_0xb495('0x9')](),controller[_0xb495('0xa')]);router[_0xb495('0x8')](_0xb495('0xb'),auth[_0xb495('0x9')](),controller['show']);router[_0xb495('0xc')]('/',auth[_0xb495('0x9')](),controller['create']);router[_0xb495('0xd')](_0xb495('0xb'),auth[_0xb495('0x9')](),controller[_0xb495('0xe')]);router[_0xb495('0xf')](_0xb495('0xb'),auth[_0xb495('0x9')](),controller[_0xb495('0x10')]);module[_0xb495('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3483af5..d471b22 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 _0x03ac=['*,*,*,*','sequelize','STRING'];(function(_0x52b281,_0x5a59cd){var _0x3dd40e=function(_0xac26f3){while(--_0xac26f3){_0x52b281['push'](_0x52b281['shift']());}};_0x3dd40e(++_0x5a59cd);}(_0x03ac,0x7c));var _0xc03a=function(_0x233831,_0x12f365){_0x233831=_0x233831-0x0;var _0x1c0d8f=_0x03ac[_0x233831];return _0x1c0d8f;};'use strict';var Sequelize=require(_0xc03a('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc03a('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc03a('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc03a('0x2')}}; \ No newline at end of file +var _0xf64a=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf64a,0x106));var _0xaf64=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0xf64a[_0x1fd9e7];return _0x1781f2;};'use strict';var Sequelize=require('sequelize');module[_0xaf64('0x0')]={'priority':{'type':Sequelize[_0xaf64('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xaf64('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xaf64('0x3')]()},'description':{'type':Sequelize[_0xaf64('0x2')]},'interval':{'type':Sequelize[_0xaf64('0x2')],'defaultValue':_0xaf64('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9dbf0bd..5fa616f 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 _0x1b60=['find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','end','error','index','map','OpenchannelApplication','rawAttributes','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','rows','catch'];(function(_0x4cdfaf,_0x386557){var _0x298da7=function(_0x477735){while(--_0x477735){_0x4cdfaf['push'](_0x4cdfaf['shift']());}};_0x298da7(++_0x386557);}(_0x1b60,0x191));var _0x01b6=function(_0x3f6f93,_0x220787){_0x3f6f93=_0x3f6f93-0x0;var _0x51e57c=_0x1b60[_0x3f6f93];return _0x51e57c;};'use strict';var emlformat=require(_0x01b6('0x0'));var rimraf=require(_0x01b6('0x1'));var zipdir=require(_0x01b6('0x2'));var jsonpatch=require(_0x01b6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x01b6('0x4'));var Mustache=require(_0x01b6('0x5'));var util=require(_0x01b6('0x6'));var path=require(_0x01b6('0x7'));var sox=require(_0x01b6('0x8'));var csv=require(_0x01b6('0x9'));var ejs=require(_0x01b6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x01b6('0xb'));var crypto=require(_0x01b6('0xc'));var jsforce=require(_0x01b6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x01b6('0x9'));var querystring=require(_0x01b6('0xe'));var Papa=require(_0x01b6('0xf'));var Redis=require(_0x01b6('0x10'));var authService=require(_0x01b6('0x11'));var qs=require(_0x01b6('0x12'));var as=require(_0x01b6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x01b6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01b6('0x15'))['db'];function respondWithStatusCode(_0x5a65c,_0x426664){_0x426664=_0x426664||0xcc;return function(_0xa24fe5){if(_0xa24fe5){return _0x5a65c[_0x01b6('0x16')](_0x426664);}return _0x5a65c[_0x01b6('0x17')](_0x426664)['end']();};}function respondWithResult(_0x437871,_0x409b08){_0x409b08=_0x409b08||0xc8;return function(_0x376c51){if(_0x376c51){return _0x437871[_0x01b6('0x17')](_0x409b08)[_0x01b6('0x18')](_0x376c51);}};}function respondWithFilteredResult(_0x24457c,_0x2242f7){return function(_0x380b5b){if(_0x380b5b){var _0x5dcdba=typeof _0x2242f7['offset']==='undefined'&&typeof _0x2242f7[_0x01b6('0x19')]===_0x01b6('0x1a');var _0x75a932=_0x380b5b[_0x01b6('0x1b')];var _0x5fbb64=_0x5dcdba?0x0:_0x2242f7[_0x01b6('0x1c')];var _0x3f06e4=_0x5dcdba?_0x380b5b[_0x01b6('0x1b')]:_0x2242f7['offset']+_0x2242f7[_0x01b6('0x19')];var _0xad6ed4;if(_0x3f06e4>=_0x75a932){_0x3f06e4=_0x75a932;_0xad6ed4=0xc8;}else{_0xad6ed4=0xce;}_0x24457c[_0x01b6('0x17')](_0xad6ed4);return _0x24457c['set'](_0x01b6('0x1d'),_0x5fbb64+'-'+_0x3f06e4+'/'+_0x75a932)[_0x01b6('0x18')](_0x380b5b);}return null;};}function patchUpdates(_0x4c3788){return function(_0x2b6e96){try{jsonpatch[_0x01b6('0x1e')](_0x2b6e96,_0x4c3788,!![]);}catch(_0x4a8d60){return BPromise[_0x01b6('0x1f')](_0x4a8d60);}return _0x2b6e96[_0x01b6('0x20')]();};}function saveUpdates(_0x5ad833,_0xcd49b7){return function(_0x233840){if(_0x233840){return _0x233840['update'](_0x5ad833)[_0x01b6('0x21')](function(_0x484325){return _0x484325;});}return null;};}function removeEntity(_0xc87ab9,_0x504759){return function(_0x101d74){if(_0x101d74){return _0x101d74['destroy']()[_0x01b6('0x21')](function(){_0xc87ab9[_0x01b6('0x17')](0xcc)[_0x01b6('0x22')]();});}};}function handleEntityNotFound(_0x4175c4,_0x56f02e){return function(_0x193dba){if(!_0x193dba){_0x4175c4[_0x01b6('0x16')](0x194);}return _0x193dba;};}function handleError(_0x578288,_0x49f2ab){_0x49f2ab=_0x49f2ab||0x1f4;return function(_0x15da39){logger[_0x01b6('0x23')](_0x15da39['stack']);if(_0x15da39['name']){delete _0x15da39['name'];}_0x578288['status'](_0x49f2ab)['send'](_0x15da39);};}exports[_0x01b6('0x24')]=function(_0xd059cf,_0xfd2081){var _0x285e99={},_0x1175fc={},_0x51b8ec={'count':0x0,'rows':[]};var _0x11af23=_[_0x01b6('0x25')](db[_0x01b6('0x26')][_0x01b6('0x27')],function(_0x215ee7){return{'name':_0x215ee7['fieldName'],'type':_0x215ee7['type']['key']};});_0x1175fc[_0x01b6('0x28')]=_[_0x01b6('0x25')](_0x11af23,_0x01b6('0x29'));_0x1175fc[_0x01b6('0x2a')]=_[_0x01b6('0x2b')](_0xd059cf[_0x01b6('0x2a')]);_0x1175fc[_0x01b6('0x2c')]=_[_0x01b6('0x2d')](_0x1175fc['model'],_0x1175fc[_0x01b6('0x2a')]);_0x285e99['attributes']=_[_0x01b6('0x2d')](_0x1175fc['model'],qs[_0x01b6('0x2e')](_0xd059cf['query'][_0x01b6('0x2e')]));_0x285e99['attributes']=_0x285e99[_0x01b6('0x2f')][_0x01b6('0x30')]?_0x285e99[_0x01b6('0x2f')]:_0x1175fc[_0x01b6('0x28')];if(!_0xd059cf[_0x01b6('0x2a')]['hasOwnProperty'](_0x01b6('0x31'))){_0x285e99[_0x01b6('0x19')]=qs['limit'](_0xd059cf['query'][_0x01b6('0x19')]);_0x285e99[_0x01b6('0x1c')]=qs[_0x01b6('0x1c')](_0xd059cf['query'][_0x01b6('0x1c')]);}_0x285e99[_0x01b6('0x32')]=qs[_0x01b6('0x33')](_0xd059cf[_0x01b6('0x2a')]['sort']);_0x285e99[_0x01b6('0x34')]=qs[_0x01b6('0x2c')](_['pick'](_0xd059cf[_0x01b6('0x2a')],_0x1175fc[_0x01b6('0x2c')]),_0x11af23);if(_0xd059cf[_0x01b6('0x2a')][_0x01b6('0x35')]){_0x285e99['where']=_[_0x01b6('0x36')](_0x285e99[_0x01b6('0x34')],{'$or':_[_0x01b6('0x25')](_0x11af23,function(_0x1c1425){if(_0x1c1425[_0x01b6('0x37')]!==_0x01b6('0x38')){var _0x49a894={};_0x49a894[_0x1c1425['name']]={'$like':'%'+_0xd059cf[_0x01b6('0x2a')][_0x01b6('0x35')]+'%'};return _0x49a894;}})});}_0x285e99=_[_0x01b6('0x36')]({},_0x285e99,_0xd059cf[_0x01b6('0x39')]);var _0x3fbfa9={'where':_0x285e99[_0x01b6('0x34')]};return db[_0x01b6('0x26')][_0x01b6('0x1b')](_0x3fbfa9)[_0x01b6('0x21')](function(_0x3bd001){_0x51b8ec['count']=_0x3bd001;if(_0xd059cf['query']['includeAll']){_0x285e99[_0x01b6('0x3a')]=[{'all':!![]}];}return db[_0x01b6('0x26')]['findAll'](_0x285e99);})[_0x01b6('0x21')](function(_0x53b863){_0x51b8ec[_0x01b6('0x3b')]=_0x53b863;return _0x51b8ec;})['then'](respondWithFilteredResult(_0xfd2081,_0x285e99))[_0x01b6('0x3c')](handleError(_0xfd2081,null));};exports['show']=function(_0x45f160,_0x75849){var _0x3755d1={'raw':!![],'where':{'id':_0x45f160['params']['id']}},_0x3603ff={};_0x3603ff[_0x01b6('0x28')]=_['keys'](db[_0x01b6('0x26')][_0x01b6('0x27')]);_0x3603ff['query']=_['keys'](_0x45f160['query']);_0x3603ff[_0x01b6('0x2c')]=_[_0x01b6('0x2d')](_0x3603ff['model'],_0x3603ff[_0x01b6('0x2a')]);_0x3755d1[_0x01b6('0x2f')]=_[_0x01b6('0x2d')](_0x3603ff[_0x01b6('0x28')],qs['fields'](_0x45f160[_0x01b6('0x2a')][_0x01b6('0x2e')]));_0x3755d1['attributes']=_0x3755d1['attributes'][_0x01b6('0x30')]?_0x3755d1[_0x01b6('0x2f')]:_0x3603ff[_0x01b6('0x28')];if(_0x45f160[_0x01b6('0x2a')]['includeAll']){_0x3755d1['include']=[{'all':!![]}];}_0x3755d1=_[_0x01b6('0x36')]({},_0x3755d1,_0x45f160[_0x01b6('0x39')]);return db[_0x01b6('0x26')][_0x01b6('0x3d')](_0x3755d1)[_0x01b6('0x21')](handleEntityNotFound(_0x75849,null))[_0x01b6('0x21')](respondWithResult(_0x75849,null))[_0x01b6('0x3c')](handleError(_0x75849,null));};exports[_0x01b6('0x3e')]=function(_0x44cda6,_0x37496e){return db[_0x01b6('0x26')][_0x01b6('0x3e')](_0x44cda6[_0x01b6('0x3f')],{})['then'](respondWithResult(_0x37496e,0xc9))[_0x01b6('0x3c')](handleError(_0x37496e,null));};exports['update']=function(_0x4f69e2,_0xfde504){if(_0x4f69e2[_0x01b6('0x3f')]['id']){delete _0x4f69e2[_0x01b6('0x3f')]['id'];}return db['OpenchannelApplication'][_0x01b6('0x3d')]({'where':{'id':_0x4f69e2[_0x01b6('0x40')]['id']}})[_0x01b6('0x21')](handleEntityNotFound(_0xfde504,null))[_0x01b6('0x21')](saveUpdates(_0x4f69e2[_0x01b6('0x3f')],null))[_0x01b6('0x21')](respondWithResult(_0xfde504,null))[_0x01b6('0x3c')](handleError(_0xfde504,null));};exports[_0x01b6('0x41')]=function(_0x84a0c6,_0x3245e3){return db['OpenchannelApplication']['find']({'where':{'id':_0x84a0c6['params']['id']}})[_0x01b6('0x21')](handleEntityNotFound(_0x3245e3,null))[_0x01b6('0x21')](removeEntity(_0x3245e3,null))[_0x01b6('0x3c')](handleError(_0x3245e3,null));}; \ No newline at end of file +var _0xd273=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd273,0x82));var _0x3d27=function(_0x2aac57,_0x5e0b8e){_0x2aac57=_0x2aac57-0x0;var _0x4f4e62=_0xd273[_0x2aac57];return _0x4f4e62;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d27('0x0'));var zipdir=require(_0x3d27('0x1'));var jsonpatch=require(_0x3d27('0x2'));var rp=require(_0x3d27('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3d27('0x4'));var path=require('path');var sox=require(_0x3d27('0x5'));var csv=require(_0x3d27('0x6'));var ejs=require(_0x3d27('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d27('0x8'));var squel=require(_0x3d27('0x9'));var crypto=require(_0x3d27('0xa'));var jsforce=require(_0x3d27('0xb'));var deskjs=require(_0x3d27('0xc'));var toCsv=require(_0x3d27('0x6'));var querystring=require(_0x3d27('0xd'));var Papa=require(_0x3d27('0xe'));var Redis=require(_0x3d27('0xf'));var authService=require(_0x3d27('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3d27('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d27('0x12'))('api');var utils=require(_0x3d27('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3d27('0x14'));var db=require(_0x3d27('0x15'))['db'];function respondWithStatusCode(_0x192d42,_0x486371){_0x486371=_0x486371||0xcc;return function(_0xab1493){if(_0xab1493){return _0x192d42[_0x3d27('0x16')](_0x486371);}return _0x192d42[_0x3d27('0x17')](_0x486371)['end']();};}function respondWithResult(_0x58a91e,_0x12c4c9){_0x12c4c9=_0x12c4c9||0xc8;return function(_0x4f9161){if(_0x4f9161){return _0x58a91e['status'](_0x12c4c9)[_0x3d27('0x18')](_0x4f9161);}};}function respondWithFilteredResult(_0x44bd86,_0x30977e){return function(_0x459f60){if(_0x459f60){var _0x3bd830=typeof _0x30977e[_0x3d27('0x19')]===_0x3d27('0x1a')&&typeof _0x30977e['limit']===_0x3d27('0x1a');var _0xfea147=_0x459f60['count'];var _0x1bb73b=_0x3bd830?0x0:_0x30977e[_0x3d27('0x19')];var _0xc7de8d=_0x3bd830?_0x459f60[_0x3d27('0x1b')]:_0x30977e['offset']+_0x30977e[_0x3d27('0x1c')];var _0x262b8a;if(_0xc7de8d>=_0xfea147){_0xc7de8d=_0xfea147;_0x262b8a=0xc8;}else{_0x262b8a=0xce;}_0x44bd86[_0x3d27('0x17')](_0x262b8a);return _0x44bd86['set'](_0x3d27('0x1d'),_0x1bb73b+'-'+_0xc7de8d+'/'+_0xfea147)[_0x3d27('0x18')](_0x459f60);}return null;};}function patchUpdates(_0x4cba9f){return function(_0x4d0dfd){try{jsonpatch[_0x3d27('0x1e')](_0x4d0dfd,_0x4cba9f,!![]);}catch(_0x394253){return BPromise['reject'](_0x394253);}return _0x4d0dfd[_0x3d27('0x1f')]();};}function saveUpdates(_0xa43585,_0x24a768){return function(_0x2d99d2){if(_0x2d99d2){return _0x2d99d2[_0x3d27('0x20')](_0xa43585)[_0x3d27('0x21')](function(_0x4decaf){return _0x4decaf;});}return null;};}function removeEntity(_0x3a9ac4,_0x18fba6){return function(_0x133146){if(_0x133146){return _0x133146[_0x3d27('0x22')]()['then'](function(){_0x3a9ac4[_0x3d27('0x17')](0xcc)[_0x3d27('0x23')]();});}};}function handleEntityNotFound(_0x1eb76d,_0x423e85){return function(_0x432a02){if(!_0x432a02){_0x1eb76d[_0x3d27('0x16')](0x194);}return _0x432a02;};}function handleError(_0x27c6e4,_0x2201a0){_0x2201a0=_0x2201a0||0x1f4;return function(_0x216608){logger[_0x3d27('0x24')](_0x216608[_0x3d27('0x25')]);if(_0x216608['name']){delete _0x216608[_0x3d27('0x26')];}_0x27c6e4[_0x3d27('0x17')](_0x2201a0)[_0x3d27('0x27')](_0x216608);};}exports[_0x3d27('0x28')]=function(_0x2969eb,_0x5cd8f1){var _0x4d1836={},_0x41aeb0={},_0x2a3f9a={'count':0x0,'rows':[]};var _0x18a140=_[_0x3d27('0x29')](db[_0x3d27('0x2a')][_0x3d27('0x2b')],function(_0x21c083){return{'name':_0x21c083[_0x3d27('0x2c')],'type':_0x21c083[_0x3d27('0x2d')][_0x3d27('0x2e')]};});_0x41aeb0[_0x3d27('0x2f')]=_[_0x3d27('0x29')](_0x18a140,'name');_0x41aeb0[_0x3d27('0x30')]=_[_0x3d27('0x31')](_0x2969eb[_0x3d27('0x30')]);_0x41aeb0['filters']=_[_0x3d27('0x32')](_0x41aeb0[_0x3d27('0x2f')],_0x41aeb0[_0x3d27('0x30')]);_0x4d1836['attributes']=_[_0x3d27('0x32')](_0x41aeb0[_0x3d27('0x2f')],qs['fields'](_0x2969eb[_0x3d27('0x30')][_0x3d27('0x33')]));_0x4d1836[_0x3d27('0x34')]=_0x4d1836['attributes'][_0x3d27('0x35')]?_0x4d1836[_0x3d27('0x34')]:_0x41aeb0[_0x3d27('0x2f')];if(!_0x2969eb[_0x3d27('0x30')][_0x3d27('0x36')]('nolimit')){_0x4d1836[_0x3d27('0x1c')]=qs[_0x3d27('0x1c')](_0x2969eb[_0x3d27('0x30')]['limit']);_0x4d1836[_0x3d27('0x19')]=qs['offset'](_0x2969eb[_0x3d27('0x30')][_0x3d27('0x19')]);}_0x4d1836[_0x3d27('0x37')]=qs['sort'](_0x2969eb[_0x3d27('0x30')]['sort']);_0x4d1836[_0x3d27('0x38')]=qs[_0x3d27('0x39')](_[_0x3d27('0x3a')](_0x2969eb['query'],_0x41aeb0[_0x3d27('0x39')]),_0x18a140);if(_0x2969eb[_0x3d27('0x30')]['filter']){_0x4d1836[_0x3d27('0x38')]=_[_0x3d27('0x3b')](_0x4d1836['where'],{'$or':_[_0x3d27('0x29')](_0x18a140,function(_0x4f7132){if(_0x4f7132['type']!==_0x3d27('0x3c')){var _0x4e03a5={};_0x4e03a5[_0x4f7132['name']]={'$like':'%'+_0x2969eb[_0x3d27('0x30')][_0x3d27('0x3d')]+'%'};return _0x4e03a5;}})});}_0x4d1836=_['merge']({},_0x4d1836,_0x2969eb[_0x3d27('0x3e')]);var _0x237f74={'where':_0x4d1836[_0x3d27('0x38')]};return db[_0x3d27('0x2a')]['count'](_0x237f74)[_0x3d27('0x21')](function(_0x285668){_0x2a3f9a['count']=_0x285668;if(_0x2969eb[_0x3d27('0x30')][_0x3d27('0x3f')]){_0x4d1836[_0x3d27('0x40')]=[{'all':!![]}];}return db[_0x3d27('0x2a')]['findAll'](_0x4d1836);})[_0x3d27('0x21')](function(_0x4fce6f){_0x2a3f9a[_0x3d27('0x41')]=_0x4fce6f;return _0x2a3f9a;})[_0x3d27('0x21')](respondWithFilteredResult(_0x5cd8f1,_0x4d1836))[_0x3d27('0x42')](handleError(_0x5cd8f1,null));};exports['show']=function(_0x26a672,_0xbb30d){var _0xa31dd9={'raw':!![],'where':{'id':_0x26a672[_0x3d27('0x43')]['id']}},_0x26d867={};_0x26d867[_0x3d27('0x2f')]=_[_0x3d27('0x31')](db['OpenchannelApplication'][_0x3d27('0x2b')]);_0x26d867['query']=_['keys'](_0x26a672[_0x3d27('0x30')]);_0x26d867[_0x3d27('0x39')]=_['intersection'](_0x26d867[_0x3d27('0x2f')],_0x26d867[_0x3d27('0x30')]);_0xa31dd9[_0x3d27('0x34')]=_[_0x3d27('0x32')](_0x26d867[_0x3d27('0x2f')],qs[_0x3d27('0x33')](_0x26a672['query'][_0x3d27('0x33')]));_0xa31dd9[_0x3d27('0x34')]=_0xa31dd9[_0x3d27('0x34')][_0x3d27('0x35')]?_0xa31dd9[_0x3d27('0x34')]:_0x26d867[_0x3d27('0x2f')];if(_0x26a672[_0x3d27('0x30')][_0x3d27('0x3f')]){_0xa31dd9[_0x3d27('0x40')]=[{'all':!![]}];}_0xa31dd9=_['merge']({},_0xa31dd9,_0x26a672['options']);return db[_0x3d27('0x2a')][_0x3d27('0x44')](_0xa31dd9)[_0x3d27('0x21')](handleEntityNotFound(_0xbb30d,null))['then'](respondWithResult(_0xbb30d,null))[_0x3d27('0x42')](handleError(_0xbb30d,null));};exports[_0x3d27('0x45')]=function(_0x4d7102,_0x8b7bff){return db['OpenchannelApplication']['create'](_0x4d7102[_0x3d27('0x46')],{})['then'](respondWithResult(_0x8b7bff,0xc9))[_0x3d27('0x42')](handleError(_0x8b7bff,null));};exports[_0x3d27('0x20')]=function(_0x40c3f8,_0x548194){if(_0x40c3f8[_0x3d27('0x46')]['id']){delete _0x40c3f8[_0x3d27('0x46')]['id'];}return db[_0x3d27('0x2a')][_0x3d27('0x44')]({'where':{'id':_0x40c3f8[_0x3d27('0x43')]['id']}})[_0x3d27('0x21')](handleEntityNotFound(_0x548194,null))[_0x3d27('0x21')](saveUpdates(_0x40c3f8[_0x3d27('0x46')],null))[_0x3d27('0x21')](respondWithResult(_0x548194,null))[_0x3d27('0x42')](handleError(_0x548194,null));};exports[_0x3d27('0x22')]=function(_0x3eb539,_0x3e5c5e){return db[_0x3d27('0x2a')]['find']({'where':{'id':_0x3eb539[_0x3d27('0x43')]['id']}})[_0x3d27('0x21')](handleEntityNotFound(_0x3e5c5e,null))[_0x3d27('0x21')](removeEntity(_0x3e5c5e,null))[_0x3d27('0x42')](handleError(_0x3e5c5e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index fc009dc..460b7ce 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 _0xb023=['api','moment','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','lodash','../../config/logger'];(function(_0x2b4c49,_0x5a3e8a){var _0x18b246=function(_0x1d4c2f){while(--_0x1d4c2f){_0x2b4c49['push'](_0x2b4c49['shift']());}};_0x18b246(++_0x5a3e8a);}(_0xb023,0x9a));var _0x3b02=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0xb023[_0x1ed116];return _0x574066;};'use strict';var _=require(_0x3b02('0x0'));var util=require('util');var logger=require(_0x3b02('0x1'))(_0x3b02('0x2'));var moment=require(_0x3b02('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b02('0x4'));var rimraf=require(_0x3b02('0x5'));var config=require(_0x3b02('0x6'));var attributes=require(_0x3b02('0x7'));module[_0x3b02('0x8')]=function(_0x104052,_0x2d548b){return _0x104052[_0x3b02('0x9')](_0x3b02('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b02('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb66a=['./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x48a2e6,_0x14a1e9){var _0x2bc896=function(_0x47252c){while(--_0x47252c){_0x48a2e6['push'](_0x48a2e6['shift']());}};_0x2bc896(++_0x14a1e9);}(_0xb66a,0xd6));var _0xab66=function(_0x53ccf2,_0x5d8507){_0x53ccf2=_0x53ccf2-0x0;var _0x15f33b=_0xb66a[_0x53ccf2];return _0x15f33b;};'use strict';var _=require(_0xab66('0x0'));var util=require(_0xab66('0x1'));var logger=require(_0xab66('0x2'))(_0xab66('0x3'));var moment=require(_0xab66('0x4'));var BPromise=require('bluebird');var rp=require(_0xab66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab66('0x6'));var config=require('../../config/environment');var attributes=require(_0xab66('0x7'));module[_0xab66('0x8')]=function(_0x3c0a3c,_0x525b5f){return _0x3c0a3c['define'](_0xab66('0x9'),attributes,{'tableName':_0xab66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab66('0xb'),'collate':_0xab66('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index f841d6b..503a3aa 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 _0xabea=['info','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','then','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x37b0da,_0x42982f){var _0x18c5b6=function(_0x742ed3){while(--_0x742ed3){_0x37b0da['push'](_0x37b0da['shift']());}};_0x18c5b6(++_0x42982f);}(_0xabea,0x1bb));var _0xaabe=function(_0x32eb93,_0x1c0e79){_0x32eb93=_0x32eb93-0x0;var _0x2aeee3=_0xabea[_0x32eb93];return _0x2aeee3;};'use strict';var _=require(_0xaabe('0x0'));var util=require('util');var moment=require(_0xaabe('0x1'));var BPromise=require(_0xaabe('0x2'));var rs=require(_0xaabe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaabe('0x4'))['db'];var utils=require(_0xaabe('0x5'));var logger=require(_0xaabe('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaabe('0x7')][_0xaabe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34a2eb,_0x48e973,_0x1a64e2){return new BPromise(function(_0x16ed32,_0x511442){return client[_0xaabe('0x9')](_0x34a2eb,_0x1a64e2)['then'](function(_0x7636ad){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x48e973,'request\x20sent');logger['debug'](_0xaabe('0xa'),_0x48e973,'request\x20sent',JSON[_0xaabe('0xb')](_0x7636ad));if(_0x7636ad['error']){if(_0x7636ad['error'][_0xaabe('0xc')]===0x1f4){logger[_0xaabe('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x48e973,_0x7636ad['error'][_0xaabe('0xe')]);return _0x511442(_0x7636ad[_0xaabe('0xd')]['message']);}logger[_0xaabe('0xd')](_0xaabe('0xf'),_0x48e973,_0x7636ad[_0xaabe('0xd')]['message']);return _0x16ed32(_0x7636ad[_0xaabe('0xd')][_0xaabe('0xe')]);}else{logger[_0xaabe('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x48e973,'request\x20sent');_0x16ed32(_0x7636ad['result'][_0xaabe('0xe')]);}})['catch'](function(_0x291005){logger[_0xaabe('0xd')](_0xaabe('0xf'),_0x48e973,_0x291005);_0x511442(_0x291005);});});}exports[_0xaabe('0x11')]=function(_0x5528bc){var _0x3da15e=this;return new Promise(function(_0xdc6382,_0x190bcf){return db['OpenchannelApplication'][_0xaabe('0x12')](_0x5528bc[_0xaabe('0x13')],{'raw':_0x5528bc[_0xaabe('0x14')]?_0x5528bc['options'][_0xaabe('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5528bc['options']?_0x5528bc[_0xaabe('0x14')][_0xaabe('0x16')]||null:null,'attributes':_0x5528bc['options']?_0x5528bc[_0xaabe('0x14')][_0xaabe('0x17')]||null:null,'limit':_0x5528bc[_0xaabe('0x14')]?_0x5528bc[_0xaabe('0x14')][_0xaabe('0x18')]||null:null})[_0xaabe('0x19')](function(_0x28c4a6){logger['info'](_0xaabe('0x11'),_0x5528bc);logger['debug'](_0xaabe('0x11'),_0x5528bc,JSON['stringify'](_0x28c4a6));_0xdc6382(_0x28c4a6);})[_0xaabe('0x1a')](function(_0x176236){logger[_0xaabe('0xd')](_0xaabe('0x11'),_0x176236[_0xaabe('0xe')],_0x5528bc);_0x190bcf(_0x3da15e[_0xaabe('0xd')](0x1f4,_0x176236['message']));});});}; \ No newline at end of file +var _0x31fc=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xd59e48,_0x523446){var _0x21dbfe=function(_0x3e5e6e){while(--_0x3e5e6e){_0xd59e48['push'](_0xd59e48['shift']());}};_0x21dbfe(++_0x523446);}(_0x31fc,0x16d));var _0xc31f=function(_0x2688dc,_0x2cad45){_0x2688dc=_0x2688dc-0x0;var _0x4e5f02=_0x31fc[_0x2688dc];return _0x4e5f02;};'use strict';var _=require('lodash');var util=require(_0xc31f('0x0'));var moment=require(_0xc31f('0x1'));var BPromise=require(_0xc31f('0x2'));var rs=require(_0xc31f('0x3'));var fs=require('fs');var Redis=require(_0xc31f('0x4'));var db=require(_0xc31f('0x5'))['db'];var utils=require(_0xc31f('0x6'));var logger=require(_0xc31f('0x7'))('rpc');var config=require(_0xc31f('0x8'));var jayson=require(_0xc31f('0x9'));var client=jayson[_0xc31f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320ccb,_0x520654,_0x294edb){return new BPromise(function(_0x45f760,_0x4b05c4){return client[_0xc31f('0xb')](_0x320ccb,_0x294edb)[_0xc31f('0xc')](function(_0x222fbf){logger[_0xc31f('0xd')](_0xc31f('0xe'),_0x520654,'request\x20sent');logger[_0xc31f('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x520654,_0xc31f('0x10'),JSON[_0xc31f('0x11')](_0x222fbf));if(_0x222fbf[_0xc31f('0x12')]){if(_0x222fbf[_0xc31f('0x12')][_0xc31f('0x13')]===0x1f4){logger['error'](_0xc31f('0xe'),_0x520654,_0x222fbf[_0xc31f('0x12')]['message']);return _0x4b05c4(_0x222fbf[_0xc31f('0x12')][_0xc31f('0x14')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x520654,_0x222fbf[_0xc31f('0x12')][_0xc31f('0x14')]);return _0x45f760(_0x222fbf[_0xc31f('0x12')][_0xc31f('0x14')]);}else{logger[_0xc31f('0xd')](_0xc31f('0xe'),_0x520654,'request\x20sent');_0x45f760(_0x222fbf[_0xc31f('0x15')][_0xc31f('0x14')]);}})[_0xc31f('0x16')](function(_0x14ccdf){logger[_0xc31f('0x12')](_0xc31f('0xe'),_0x520654,_0x14ccdf);_0x4b05c4(_0x14ccdf);});});}exports[_0xc31f('0x17')]=function(_0x26eef5){var _0x57a829=this;return new Promise(function(_0x7cd384,_0x4c4308){return db[_0xc31f('0x18')]['update'](_0x26eef5[_0xc31f('0x19')],{'raw':_0x26eef5[_0xc31f('0x1a')]?_0x26eef5['options'][_0xc31f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26eef5['options']?_0x26eef5[_0xc31f('0x1a')][_0xc31f('0x1c')]||null:null,'attributes':_0x26eef5[_0xc31f('0x1a')]?_0x26eef5[_0xc31f('0x1a')][_0xc31f('0x1d')]||null:null,'limit':_0x26eef5['options']?_0x26eef5['options'][_0xc31f('0x1e')]||null:null})[_0xc31f('0xc')](function(_0x475ff1){logger[_0xc31f('0xd')](_0xc31f('0x17'),_0x26eef5);logger[_0xc31f('0xf')](_0xc31f('0x17'),_0x26eef5,JSON['stringify'](_0x475ff1));_0x7cd384(_0x475ff1);})[_0xc31f('0x16')](function(_0x40a4fa){logger[_0xc31f('0x12')]('UpdateOpenchannelApplication',_0x40a4fa[_0xc31f('0x14')],_0x26eef5);_0x4c4308(_0x57a829[_0xc31f('0x12')](0x1f4,_0x40a4fa[_0xc31f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 48f0d17..9fe283d 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 _0xb5e6=['isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','openchannelinteraction:addtags','addTags','put','tracked','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb5e6,0x106));var _0x6b5e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb5e6[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6b5e('0x0'));var util=require('util');var path=require(_0x6b5e('0x1'));var timeout=require(_0x6b5e('0x2'));var express=require(_0x6b5e('0x3'));var router=express[_0x6b5e('0x4')]();var fs_extra=require(_0x6b5e('0x5'));var auth=require(_0x6b5e('0x6'));var interaction=require(_0x6b5e('0x7'));var config=require(_0x6b5e('0x8'));var controller=require('./openchannelInteraction.controller');router[_0x6b5e('0x9')]('/',auth[_0x6b5e('0xa')](),controller[_0x6b5e('0xb')]);router[_0x6b5e('0x9')](_0x6b5e('0xc'),auth[_0x6b5e('0xa')](),controller[_0x6b5e('0xd')]);router[_0x6b5e('0x9')](_0x6b5e('0xe'),auth[_0x6b5e('0xa')](),controller[_0x6b5e('0xf')]);router[_0x6b5e('0x9')]('/:id/messages',auth[_0x6b5e('0xa')](),controller['getMessages']);router[_0x6b5e('0x9')](_0x6b5e('0x10'),auth[_0x6b5e('0xa')](),controller[_0x6b5e('0x11')]);router[_0x6b5e('0x12')]('/',auth[_0x6b5e('0xa')](),controller[_0x6b5e('0x13')]);router[_0x6b5e('0x12')](_0x6b5e('0x14'),auth[_0x6b5e('0xa')](),controller[_0x6b5e('0x15')]);router[_0x6b5e('0x12')](_0x6b5e('0x16'),auth[_0x6b5e('0xa')](),interaction['tracked']('openchannel',_0x6b5e('0x17')),controller[_0x6b5e('0x18')]);router[_0x6b5e('0x19')](_0x6b5e('0xe'),auth[_0x6b5e('0xa')](),interaction[_0x6b5e('0x1a')](_0x6b5e('0x1b'),_0x6b5e('0x1c')),controller['update']);router[_0x6b5e('0x1d')]('/:id',auth[_0x6b5e('0xa')](),interaction[_0x6b5e('0x1a')](_0x6b5e('0x1b'),_0x6b5e('0x1e')),controller[_0x6b5e('0x1f')]);router[_0x6b5e('0x1d')](_0x6b5e('0x16'),auth[_0x6b5e('0xa')](),controller[_0x6b5e('0x20')]);module[_0x6b5e('0x21')]=router; \ No newline at end of file +var _0x090c=['/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','/:id','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get'];(function(_0x2d4da2,_0xa91f87){var _0x49aaa5=function(_0x2e0481){while(--_0x2e0481){_0x2d4da2['push'](_0x2d4da2['shift']());}};_0x49aaa5(++_0xa91f87);}(_0x090c,0xc4));var _0xc090=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x090c[_0x34d346];return _0x122d76;};'use strict';var multer=require(_0xc090('0x0'));var util=require(_0xc090('0x1'));var path=require(_0xc090('0x2'));var timeout=require(_0xc090('0x3'));var express=require(_0xc090('0x4'));var router=express[_0xc090('0x5')]();var fs_extra=require(_0xc090('0x6'));var auth=require(_0xc090('0x7'));var interaction=require(_0xc090('0x8'));var config=require(_0xc090('0x9'));var controller=require(_0xc090('0xa'));router['get']('/',auth[_0xc090('0xb')](),controller[_0xc090('0xc')]);router[_0xc090('0xd')](_0xc090('0xe'),auth[_0xc090('0xb')](),controller[_0xc090('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc090('0x10')]);router['get'](_0xc090('0x11'),auth[_0xc090('0xb')](),controller[_0xc090('0x12')]);router['get'](_0xc090('0x13'),auth[_0xc090('0xb')](),controller['download']);router[_0xc090('0x14')]('/',auth[_0xc090('0xb')](),controller[_0xc090('0x15')]);router[_0xc090('0x14')](_0xc090('0x11'),auth[_0xc090('0xb')](),controller[_0xc090('0x16')]);router[_0xc090('0x14')](_0xc090('0x17'),auth['isAuthenticated'](),interaction[_0xc090('0x18')](_0xc090('0x19'),'openchannelinteraction:addtags'),controller[_0xc090('0x1a')]);router[_0xc090('0x1b')](_0xc090('0x1c'),auth[_0xc090('0xb')](),interaction['tracked'](_0xc090('0x19'),'openchannelinteraction:update'),controller[_0xc090('0x1d')]);router[_0xc090('0x1e')]('/:id',auth[_0xc090('0xb')](),interaction[_0xc090('0x18')](_0xc090('0x19'),_0xc090('0x1f')),controller[_0xc090('0x20')]);router[_0xc090('0x1e')](_0xc090('0x17'),auth[_0xc090('0xb')](),controller[_0xc090('0x21')]);module[_0xc090('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 9b8c1bb..20385c6 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 _0x18b8=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x241596,_0x209dab){var _0x3e05f5=function(_0x33dea3){while(--_0x33dea3){_0x241596['push'](_0x241596['shift']());}};_0x3e05f5(++_0x209dab);}(_0x18b8,0xff));var _0x818b=function(_0x1750ad,_0x2d891b){_0x1750ad=_0x1750ad-0x0;var _0x407c74=_0x18b8[_0x1750ad];return _0x407c74;};'use strict';var Sequelize=require(_0x818b('0x0'));module[_0x818b('0x1')]={'closed':{'type':Sequelize[_0x818b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x818b('0x3')]},'disposition':{'type':Sequelize[_0x818b('0x4')]},'secondDisposition':{'type':Sequelize[_0x818b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x818b('0x4')]},'note':{'type':Sequelize[_0x818b('0x4')]},'read1stAt':{'type':Sequelize[_0x818b('0x3')]},'threadId':{'type':Sequelize[_0x818b('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x818b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x818b('0x5')]('in',_0x818b('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x818b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x818b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xaf9b=['out','sequelize','BOOLEAN','STRING','DATE'];(function(_0x20925d,_0x1fcdd7){var _0x4bac97=function(_0x305299){while(--_0x305299){_0x20925d['push'](_0x20925d['shift']());}};_0x4bac97(++_0x1fcdd7);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x3b3e1c,_0x59ba9b){_0x3b3e1c=_0x3b3e1c-0x0;var _0x441644=_0xaf9b[_0x3b3e1c];return _0x441644;};'use strict';var Sequelize=require(_0xbaf9('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbaf9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbaf9('0x2')]},'secondDisposition':{'type':Sequelize[_0xbaf9('0x2')]},'thirdDisposition':{'type':Sequelize[_0xbaf9('0x2')]},'note':{'type':Sequelize[_0xbaf9('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xbaf9('0x2')]},'externalUrl':{'type':Sequelize[_0xbaf9('0x2')]},'lastMsgAt':{'type':Sequelize[_0xbaf9('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbaf9('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbaf9('0x2')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 7740768..3f00091 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 _0xf91b=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','agent','sequelize','toString','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','all','rows','show','params','include','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','color','removeTags','download','unix','root','server','tmp','join','attachments','format','transcript-%d-%s.zip','fullname','firstName','lastName','Attachment','Messages','direction','secret','Account','Openchannel','Owner','N.A.','closedAt','disposition','threadId','Private','basename','createReadStream','createWriteStream','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','OpenchannelInteraction','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','body','start','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt'];(function(_0x4c93e5,_0x4d8883){var _0x5ccca1=function(_0x367ff2){while(--_0x367ff2){_0x4c93e5['push'](_0x4c93e5['shift']());}};_0x5ccca1(++_0x4d8883);}(_0xf91b,0x69));var _0xbf91=function(_0x329e2d,_0x40403b){_0x329e2d=_0x329e2d-0x0;var _0x4389e2=_0xf91b[_0x329e2d];return _0x4389e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf91('0x0'));var zipdir=require(_0xbf91('0x1'));var jsonpatch=require(_0xbf91('0x2'));var rp=require(_0xbf91('0x3'));var moment=require(_0xbf91('0x4'));var BPromise=require(_0xbf91('0x5'));var Mustache=require(_0xbf91('0x6'));var util=require(_0xbf91('0x7'));var path=require(_0xbf91('0x8'));var sox=require(_0xbf91('0x9'));var csv=require(_0xbf91('0xa'));var ejs=require(_0xbf91('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf91('0xc'));var squel=require(_0xbf91('0xd'));var crypto=require(_0xbf91('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbf91('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbf91('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbf91('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbf91('0x12'));var hardwareService=require(_0xbf91('0x13'));var logger=require(_0xbf91('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xbf91('0x15'));var licenseUtil=require(_0xbf91('0x16'));var db=require(_0xbf91('0x17'))['db'];config[_0xbf91('0x18')]=_[_0xbf91('0x19')](config[_0xbf91('0x18')],{'host':_0xbf91('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf91('0x18')]));require(_0xbf91('0x1b'))[_0xbf91('0x1c')](socket);function respondWithStatusCode(_0xf8ec3a,_0x46fae2){_0x46fae2=_0x46fae2||0xcc;return function(_0x53f0d8){if(_0x53f0d8){return _0xf8ec3a['sendStatus'](_0x46fae2);}return _0xf8ec3a[_0xbf91('0x1d')](_0x46fae2)[_0xbf91('0x1e')]();};}function respondWithResult(_0x22f8cd,_0x582cc0){_0x582cc0=_0x582cc0||0xc8;return function(_0x4c2616){if(_0x4c2616){return _0x22f8cd['status'](_0x582cc0)[_0xbf91('0x1f')](_0x4c2616);}};}function respondWithFilteredResult(_0x916ddd,_0x474985){return function(_0x55f419){if(_0x55f419){var _0xb76779=typeof _0x474985[_0xbf91('0x20')]===_0xbf91('0x21')&&typeof _0x474985[_0xbf91('0x22')]===_0xbf91('0x21');var _0x16e810=_0x55f419[_0xbf91('0x23')];var _0x1db010=_0xb76779?0x0:_0x474985[_0xbf91('0x20')];var _0x3b7c6c=_0xb76779?_0x55f419[_0xbf91('0x23')]:_0x474985[_0xbf91('0x20')]+_0x474985[_0xbf91('0x22')];var _0x5016df;if(_0x3b7c6c>=_0x16e810){_0x3b7c6c=_0x16e810;_0x5016df=0xc8;}else{_0x5016df=0xce;}_0x916ddd['status'](_0x5016df);return _0x916ddd[_0xbf91('0x24')](_0xbf91('0x25'),_0x1db010+'-'+_0x3b7c6c+'/'+_0x16e810)[_0xbf91('0x1f')](_0x55f419);}return null;};}function patchUpdates(_0x2c72d6){return function(_0x157b8b){try{jsonpatch['apply'](_0x157b8b,_0x2c72d6,!![]);}catch(_0x1feb3e){return BPromise['reject'](_0x1feb3e);}return _0x157b8b[_0xbf91('0x26')]();};}function saveUpdates(_0x543e5b,_0x23c095){return function(_0x18d114){if(_0x18d114){return _0x18d114[_0xbf91('0x27')](_0x543e5b)['then'](function(_0x1a0f4c){return _0x1a0f4c;});}return null;};}function removeEntity(_0x52434a,_0x330b95){return function(_0x3ee255){if(_0x3ee255){return _0x3ee255[_0xbf91('0x28')]()[_0xbf91('0x29')](function(){_0x52434a[_0xbf91('0x1d')](0xcc)[_0xbf91('0x1e')]();});}};}function handleEntityNotFound(_0x2adf22,_0x1b826e){return function(_0x2291a0){if(!_0x2291a0){_0x2adf22['sendStatus'](0x194);}return _0x2291a0;};}function handleError(_0x33d83f,_0x5fdfda){_0x5fdfda=_0x5fdfda||0x1f4;return function(_0x1a62fd){logger[_0xbf91('0x2a')](_0x1a62fd[_0xbf91('0x2b')]);if(_0x1a62fd[_0xbf91('0x2c')]){delete _0x1a62fd['name'];}_0x33d83f[_0xbf91('0x1d')](_0x5fdfda)[_0xbf91('0x2d')](_0x1a62fd);};}function getInteractionUsers(_0x274ae5,_0xab2c50){return new BPromise(function(_0x20b24f,_0x4d77e2){try{if(_0xab2c50[_0x274ae5['id']]){_0x274ae5[_0xbf91('0x2e')]=_[_0xbf91('0x2f')](_0xab2c50[_0x274ae5['id']],function(_0x22ce54){return{'id':_0x22ce54['id'],'fullname':_0x22ce54['fullname']};});}}catch(_0x465b83){_0x4d77e2(_0x465b83);}_0x20b24f(_0x274ae5);});}function getInteractionTags(_0x26c8a3,_0x53c8b9){return new BPromise(function(_0x2e12ee,_0x395021){try{if(_0x26c8a3['TagIds']){_0x26c8a3[_0xbf91('0x30')]=[];_0x26c8a3[_0xbf91('0x31')][_0xbf91('0x32')](',')[_0xbf91('0x33')](function(_0x53457f){_0x26c8a3[_0xbf91('0x30')][_0xbf91('0x34')](_0x53c8b9[_0x53457f]);});}delete _0x26c8a3['TagIds'];}catch(_0x411238){_0x395021(_0x411238);}_0x2e12ee(_0x26c8a3);});}function updateOpenchannelInteraction(_0x4ced5d,_0x3c7671,_0xdf0991){return new BPromise(function(_0x579ff2,_0x20c2f7){return getInteractionUsers(_0x4ced5d,_0xdf0991)[_0xbf91('0x29')](function(_0x48ab9b){return getInteractionTags(_0x48ab9b,_0x3c7671);})[_0xbf91('0x29')](function(_0x702e5f){return getStateInteraction(_0x702e5f);})['then'](function(_0x33e1b0){_0x579ff2(_0x33e1b0);})[_0xbf91('0x35')](function(_0x278dd5){_0x20c2f7(_0x278dd5);});});}function getStateInteraction(_0x32c4e0){return new BPromise(function(_0x376876){_0x32c4e0[_0xbf91('0x36')]=0x0;_0x32c4e0[_0xbf91('0x37')]=0x0;_0x32c4e0[_0xbf91('0x38')]=0x0;_0x32c4e0[_0xbf91('0x39')]=0x0;_0x32c4e0[_0xbf91('0x3a')]=0x0;if(!_0x32c4e0[_0xbf91('0x3b')]&&!_0x32c4e0['UserId']){_0x32c4e0[_0xbf91('0x36')]+=0x1;}if(!_0x32c4e0[_0xbf91('0x3b')]&&_0x32c4e0[_0xbf91('0x3c')]){_0x32c4e0[_0xbf91('0x37')]+=0x1;if(_0x32c4e0[_0xbf91('0x36')]){_0x32c4e0['waiting']-=0x1;}}if(_0x32c4e0[_0xbf91('0x3b')]&&_0x32c4e0['UserId']){_0x32c4e0['answered']+=0x1;if(_0x32c4e0[_0xbf91('0x37')]){_0x32c4e0['talking']-=0x1;}}if(_0x32c4e0[_0xbf91('0x3b')]&&!_0x32c4e0[_0xbf91('0x3c')]){_0x32c4e0['unmanaged']+=0x1;if(_0x32c4e0['waiting']){_0x32c4e0['waiting']-=0x1;}}_0x32c4e0['total']+=0x1;_0x376876(_0x32c4e0);});}exports[_0xbf91('0x3d')]=function(_0xceab01,_0x33588c){var _0x2006bd={},_0x3ec8b9={},_0x580727={'count':0x0,'rows':[]};var _0x46286d=_[_0xbf91('0x2f')](db[_0xbf91('0x3e')]['rawAttributes'],function(_0x5be8e3){return{'name':_0x5be8e3['fieldName'],'type':_0x5be8e3[_0xbf91('0x3f')][_0xbf91('0x40')]};});_0x3ec8b9[_0xbf91('0x41')]=_['map'](_0x46286d,_0xbf91('0x2c'));_0x3ec8b9['query']=_[_0xbf91('0x42')](_0xceab01[_0xbf91('0x43')]);_0x3ec8b9['filters']=_[_0xbf91('0x44')](_0x3ec8b9['model'],_0x3ec8b9[_0xbf91('0x43')]);_0x2006bd['attributes']=_[_0xbf91('0x44')](_0x3ec8b9[_0xbf91('0x41')],qs[_0xbf91('0x45')](_0xceab01['query'][_0xbf91('0x45')]));_0x2006bd[_0xbf91('0x46')]=_0x2006bd[_0xbf91('0x46')][_0xbf91('0x47')]?_0x2006bd['attributes']:_0x3ec8b9[_0xbf91('0x41')];if(!_0xceab01['query'][_0xbf91('0x48')](_0xbf91('0x49'))){_0x2006bd[_0xbf91('0x22')]=qs[_0xbf91('0x22')](_0xceab01['query']['limit']);_0x2006bd[_0xbf91('0x20')]=qs[_0xbf91('0x20')](_0xceab01[_0xbf91('0x43')][_0xbf91('0x20')]);}_0x2006bd['order']=qs[_0xbf91('0x4a')](_0xceab01[_0xbf91('0x43')][_0xbf91('0x4a')]);_0x2006bd[_0xbf91('0x4b')]=qs[_0xbf91('0x4c')](_[_0xbf91('0x4d')](_0xceab01['query'],_0x3ec8b9[_0xbf91('0x4c')]),_0x46286d);var _0x136975=[];var _0xc07970=squel['select']()[_0xbf91('0x4e')]('id')['field'](_0xbf91('0x2c'))['field']('color')[_0xbf91('0x4f')](_0xbf91('0x50'));var _0x2d2092=squel['select']()[_0xbf91('0x4e')](_0xbf91('0x51'))['field'](_0xbf91('0x52'))[_0xbf91('0x4e')](_0xbf91('0x53'))['from'](_0xbf91('0x54'),'ui')[_0xbf91('0x55')](_0xbf91('0x56'),'u',_0xbf91('0x57'));var _0x3faa48=squel['select']()['from'](_0xbf91('0x58'),'i')['left_join'](_0xbf91('0x59'),'c',_0xbf91('0x5a'))[_0xbf91('0x55')](_0xbf91('0x56'),'o',_0xbf91('0x5b'))[_0xbf91('0x55')](_0xbf91('0x5c'),'a',_0xbf91('0x5d'))[_0xbf91('0x55')](_0xbf91('0x5e'),'me',_0xbf91('0x5f'))['left_join']('openchannel_interaction_has_tags','it',_0xbf91('0x60'))['left_join'](_0xbf91('0x50'),'t','t.id\x20=\x20it.TagId');var _0x1b7329=squel[_0xbf91('0x61')]();var _0x55c008=[];var _0x17eacd=squel[_0xbf91('0x61')]();var _0x7541fc;if(_0xceab01[_0xbf91('0x43')]['search']){_0x7541fc=as[_0xbf91('0x62')](_0xceab01['query'][_0xbf91('0x63')]);var _0x313b67=_0x7541fc[_0xbf91('0x64')];for(var _0x3e5580=0x0;_0x3e5580<_0x7541fc[_0xbf91('0x65')][_0xbf91('0x47')];_0x3e5580++){var _0x376bed=_0x7541fc[_0xbf91('0x65')][_0x3e5580];var _0x587177='i';var _0x28af5d=_[_0xbf91('0x66')](_0x46286d,[_0xbf91('0x2c'),_0x376bed[_0xbf91('0x4e')]]);if(!_0x28af5d){switch(_0x376bed['field']){case _0xbf91('0x67'):if(_0x376bed['value']==0x1){_0x3faa48[_0xbf91('0x68')]('`'+_0x376bed[_0xbf91('0x4e')]+'`\x20=\x200');}else{_0x3faa48[_0xbf91('0x68')]('`'+_0x376bed[_0xbf91('0x4e')]+_0xbf91('0x69'));}break;case _0xbf91('0x6a'):if(_0x376bed[_0xbf91('0x6b')]===_0xbf91('0x6c')){if(_0x376bed[_0xbf91('0x6d')][_0xbf91('0x32')]('\x20')[_0xbf91('0x47')]>0x1){_0x1b7329[_0x313b67](_0xbf91('0x6e'),qs[_0xbf91('0x6f')](_0x376bed['value']),null);}else{var _0x32e73a='%'+_0x376bed[_0xbf91('0x6d')]+'%';_0x1b7329[_0x313b67](_0xbf91('0x70'),_0x32e73a,_0x32e73a,_0x32e73a);}}else{_0x28af5d=_['find'](_0x46286d,[_0xbf91('0x2c'),_0xbf91('0x71')]);_0x376bed[_0xbf91('0x4e')]=_0xbf91('0x71');_0x3a95ff=as[_0xbf91('0x72')](_0x587177,_0x28af5d[_0xbf91('0x3f')],_0x376bed);_0x1b7329[_0x313b67](_0x3a95ff[_0xbf91('0x73')],_0x3a95ff[_0xbf91('0x6d')]['start'],_0x3a95ff[_0xbf91('0x6d')][_0xbf91('0x1e')]);}break;case'Tag':var _0x586dad=_0x376bed['value'][_0xbf91('0x32')](',')['map'](function(_0x372cdb){return Number(_0x372cdb);});_0x586dad[_0xbf91('0x33')](function(_0x3d72a9){_0x17eacd['or'](_0xbf91('0x74'),'%,'+_0x3d72a9+',%');});_0x55c008=_[_0xbf91('0x75')](_0x55c008,_0x586dad);break;case _0xbf91('0x76'):if(_0x376bed[_0xbf91('0x6b')]===_0xbf91('0x6c')){_0x1b7329[_0x313b67]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x376bed[_0xbf91('0x6d')]+'%',null);}else{_0x28af5d=_['find'](_0x46286d,[_0xbf91('0x2c'),_0xbf91('0x3c')]);_0x376bed[_0xbf91('0x4e')]=_0xbf91('0x3c');_0x3a95ff=as[_0xbf91('0x72')](_0x587177,_0x28af5d[_0xbf91('0x3f')],_0x376bed);_0x1b7329[_0x313b67](_0x3a95ff[_0xbf91('0x73')],_0x3a95ff[_0xbf91('0x6d')]['start'],_0x3a95ff[_0xbf91('0x6d')]['end']);}break;case _0xbf91('0x77'):_0x3a95ff=as['buildExpression']('me',null,_0x376bed);_0x1b7329[_0x313b67](_0x3a95ff['text'],_0x3a95ff[_0xbf91('0x6d')][_0xbf91('0x78')],_0x3a95ff[_0xbf91('0x6d')][_0xbf91('0x1e')]);break;}}else{var _0x3a95ff=as['buildExpression'](_0x587177,_0x28af5d[_0xbf91('0x3f')],_0x376bed);_0x1b7329[_0x313b67](_0x3a95ff['text'],_0x3a95ff[_0xbf91('0x6d')][_0xbf91('0x78')],_0x3a95ff['value'][_0xbf91('0x1e')]);}}}else{var _0x4f933c=_(_0xceab01['query'])['keys']()[_0xbf91('0x2f')](function(_0x46b047){return _[_0xbf91('0x79')](_0x46286d,['name',_0x46b047])?_0x46b047:undefined;})[_0xbf91('0x7a')]()['value']();if(!_[_0xbf91('0x7b')](_0x4f933c)){_0x4f933c[_0xbf91('0x33')](function(_0x2b531e){if(_0x2b531e===_0xbf91('0x7c')){_0x3faa48[_0xbf91('0x4b')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xbf91('0x7d')](_0xceab01[_0xbf91('0x43')][_0x2b531e]));}else if(_0x2b531e===_0xbf91('0x7e')){var _0x7da646=JSON[_0xbf91('0x7f')](_0xceab01[_0xbf91('0x43')][_0x2b531e])[_0xbf91('0x80')];var _0x6a638c=JSON[_0xbf91('0x7f')](_0xceab01[_0xbf91('0x43')][_0x2b531e])[_0xbf91('0x81')];_0x3faa48[_0xbf91('0x4b')](_0xbf91('0x82'),_0x7da646,_0x6a638c);}else{if(_0xceab01[_0xbf91('0x43')][_0x2b531e]==='null'){_0x3faa48[_0xbf91('0x4b')]('i.'+_0x2b531e+_0xbf91('0x83'));}else{_0x3faa48['where']('i.'+_0x2b531e+_0xbf91('0x84'),_0xceab01[_0xbf91('0x43')][_0x2b531e]);}}});}if(_0xceab01['query'][_0xbf91('0x85')]){if(_0xceab01[_0xbf91('0x43')][_0xbf91('0x85')]==0x1){_0x3faa48['having'](_0xbf91('0x86'));}else{_0x3faa48['having'](_0xbf91('0x87'));}}if(_0xceab01[_0xbf91('0x43')][_0xbf91('0x88')]){_0x55c008=_[_0xbf91('0x89')](_0xceab01[_0xbf91('0x43')][_0xbf91('0x88')])?_0xceab01['query'][_0xbf91('0x88')]:new Array(_0xceab01[_0xbf91('0x43')][_0xbf91('0x88')]);_0x55c008[_0xbf91('0x33')](function(_0x263863){_0x17eacd['or'](_0xbf91('0x74'),'%,'+_0x263863+',%');});}if(_0xceab01[_0xbf91('0x43')]['filter']){var _0x5581c8=_0xceab01[_0xbf91('0x43')][_0xbf91('0x8a')][_0xbf91('0x8b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbf91('0x8c')](_0x5581c8)){_0x1b7329['or']('i.id\x20LIKE\x20?',_0x5581c8+'%');}else{_0x1b7329['or'](_0xbf91('0x8d'),qs['getFullTextValue'](_0x5581c8))['or'](_0xbf91('0x8e'),_0x5581c8+'%')['or'](_0xbf91('0x8f'),_0x5581c8+'%');}}}_0x3faa48['where'](_0x1b7329);_0x3faa48['group'](_0xbf91('0x90'));var _0x42019f={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x4644b9=_0x3faa48[_0xbf91('0x91')]();_0x4644b9[_0xbf91('0x4e')](_0xbf91('0x90'));_0x4644b9[_0xbf91('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x2006bd['order']){_0x2006bd[_0xbf91('0x92')][_0xbf91('0x33')](function(_0xdc1e28){var _0x56ab94=_0xdc1e28[0x0]===_0xbf91('0x93')?_0xdc1e28[0x0]:'i.'+_0xdc1e28[0x0];_0x3faa48[_0xbf91('0x92')](_0x56ab94,_0xdc1e28[0x1]===_0xbf91('0x94')?![]:!![]);});}if(!_[_0xbf91('0x7b')](_0x55c008)){_0x3faa48[_0xbf91('0x68')](_0x17eacd);_0x4644b9[_0xbf91('0x4b')](_0xbf91('0x95'),_0x55c008);}BPromise[_0xbf91('0x96')]()[_0xbf91('0x29')](function(){if(!_0x7541fc){if(_0xceab01['query'][_0xbf91('0x7c')])return;_0x4644b9[_0xbf91('0x4b')](_0xbf91('0x97'));_0x3faa48[_0xbf91('0x4b')](_0xbf91('0x97'));return;}if(_0xceab01['user']['role']!=='agent')return;return _0xceab01[_0xbf91('0x98')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xbf91('0x29')](function(_0x1bc7f8){if(_[_0xbf91('0x7b')](_0x1bc7f8)){_0x4644b9[_0xbf91('0x4b')](_0xbf91('0x99'));_0x3faa48[_0xbf91('0x4b')](_0xbf91('0x99'));}else{_0x4644b9[_0xbf91('0x4b')](_0xbf91('0x9a'),_['map'](_0x1bc7f8,'id'));_0x3faa48[_0xbf91('0x4b')](_0xbf91('0x9a'),_[_0xbf91('0x2f')](_0x1bc7f8,'id'));}});})['then'](function(){if(_0xceab01['user']['role']===_0xbf91('0x9b')&&!_0x7541fc&&!_0xceab01['query'][_0xbf91('0x7c')])return[];return db[_0xbf91('0x9c')][_0xbf91('0x43')](_0x4644b9['toString'](),_0x42019f);})['then'](function(_0x3e19a7){_0x580727[_0xbf91('0x23')]=_0x3e19a7[_0xbf91('0x47')];if(_0x580727[_0xbf91('0x23')]===0x0)return[];return db[_0xbf91('0x9c')]['query'](_0xc07970[_0xbf91('0x9d')](),_0x42019f)[_0xbf91('0x29')](function(_0x14401c){_0x136975=_['keyBy'](_0x14401c,'id');_0x42019f=_[_0xbf91('0x9e')](_0x42019f,{'model':db[_0xbf91('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xceab01[_0xbf91('0x43')][_0xbf91('0x45')]){_0x2006bd[_0xbf91('0x46')][_0xbf91('0x33')](function(_0x2c72b8){_0x3faa48[_0xbf91('0x4e')]('i.'+_0x2c72b8);});}else{_0x3faa48[_0xbf91('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbf91('0x67'));_0x3faa48['field']('a.key',_0xbf91('0x9f'));_0x3faa48[_0xbf91('0x4e')](_0xbf91('0xa0'),'Account.mandatoryDisposition');_0x3faa48['field'](_0xbf91('0xa1'),'contactName');_0x3faa48[_0xbf91('0x4e')]('i.*');_0x3faa48[_0xbf91('0x4e')](_0xbf91('0xa2'),'Contact.firstName');_0x3faa48[_0xbf91('0x4e')]('c.lastName','Contact.lastName');_0x3faa48['field'](_0xbf91('0xa3'),_0xbf91('0xa4'));_0x3faa48[_0xbf91('0x4e')](_0xbf91('0xa5'),_0xbf91('0xa6'));_0x3faa48[_0xbf91('0x4e')](_0xbf91('0xa7'),_0xbf91('0xa8'));_0x3faa48[_0xbf91('0x4e')](_0xbf91('0xa9'),_0xbf91('0xaa'));_0x3faa48[_0xbf91('0x4e')](_0xbf91('0xab'),_0xbf91('0xac'));_0x3faa48[_0xbf91('0x4e')]('o.internal',_0xbf91('0xad'));_0x3faa48[_0xbf91('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2006bd[_0xbf91('0x22')])_0x3faa48[_0xbf91('0x22')](_0x2006bd[_0xbf91('0x22')]);if(_0x2006bd[_0xbf91('0x20')])_0x3faa48[_0xbf91('0x20')](_0x2006bd['offset']);return db[_0xbf91('0x9c')][_0xbf91('0x43')](_0x3faa48[_0xbf91('0x9d')](),_0x42019f);})[_0xbf91('0x29')](function(_0x231e1b){if(_0x231e1b[_0xbf91('0x47')]>0x0)_0x2d2092['where']('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x231e1b,'id'));return db[_0xbf91('0x9c')][_0xbf91('0x43')](_0x2d2092[_0xbf91('0x9d')](),_0x42019f)[_0xbf91('0x29')](function(_0x3abf39){var _0x3ae92f=_[_0xbf91('0xae')](_0x3abf39,'OpenchannelInteractionId');var _0x21da6f=[];_0x231e1b['forEach'](function(_0x587202){_0x21da6f['push'](updateOpenchannelInteraction(_0x587202,_0x136975,_0x3ae92f));});return BPromise[_0xbf91('0xaf')](_0x21da6f);});});})[_0xbf91('0x29')](function(_0x58d172){_0x580727[_0xbf91('0xb0')]=_0x58d172;return _0x580727;})[_0xbf91('0x29')](respondWithFilteredResult(_0x33588c,_0x2006bd))[_0xbf91('0x35')](handleError(_0x33588c,null));};exports[_0xbf91('0xb1')]=function(_0x8c0776,_0x89fe8a){var _0x4426d3={};if(_0x8c0776[_0xbf91('0x43')][_0xbf91('0x3f')]&&_0x8c0776[_0xbf91('0x43')][_0xbf91('0x3f')]==='from'){_0x4426d3[_0xbf91('0x4f')]=_0x8c0776['params']['id'];}else{_0x4426d3['id']=_0x8c0776[_0xbf91('0xb2')]['id'];}var _0x4d3c46={'raw':![],'where':_0x4426d3},_0x4216fc={};_0x4216fc[_0xbf91('0x41')]=_['keys'](db[_0xbf91('0x3e')]['rawAttributes']);_0x4216fc['query']=_['keys'](_0x8c0776[_0xbf91('0x43')]);_0x4216fc[_0xbf91('0x4c')]=_[_0xbf91('0x44')](_0x4216fc[_0xbf91('0x41')],_0x4216fc[_0xbf91('0x43')]);_0x4d3c46[_0xbf91('0x46')]=_['intersection'](_0x4216fc[_0xbf91('0x41')],qs[_0xbf91('0x45')](_0x8c0776[_0xbf91('0x43')][_0xbf91('0x45')]));_0x4d3c46[_0xbf91('0x46')]=_0x4d3c46['attributes']['length']?_0x4d3c46[_0xbf91('0x46')]:_0x4216fc[_0xbf91('0x41')];if(_0x8c0776[_0xbf91('0x43')]['includeAll']){_0x4d3c46[_0xbf91('0xb3')]=[{'all':!![]}];}_0x4d3c46=_[_0xbf91('0x9e')]({},_0x4d3c46,_0x8c0776['options']);return db[_0xbf91('0x3e')][_0xbf91('0x66')](_0x4d3c46)[_0xbf91('0x29')](handleEntityNotFound(_0x89fe8a,null))[_0xbf91('0x29')](respondWithResult(_0x89fe8a,null))['catch'](handleError(_0x89fe8a,null));};exports['create']=function(_0xd16bfd,_0x4a3289){return db['OpenchannelInteraction']['create'](_0xd16bfd['body'],{})['then'](respondWithResult(_0x4a3289,0xc9))[_0xbf91('0x35')](handleError(_0x4a3289,null));};exports[_0xbf91('0x27')]=function(_0x1f4171,_0x161169){if(_0x1f4171[_0xbf91('0x77')]['id']){delete _0x1f4171['body']['id'];}return db[_0xbf91('0x3e')][_0xbf91('0x66')]({'where':{'id':_0x1f4171[_0xbf91('0xb2')]['id']}})[_0xbf91('0x29')](handleEntityNotFound(_0x161169,null))[_0xbf91('0x29')](saveUpdates(_0x1f4171['body'],null))[_0xbf91('0x29')](respondWithResult(_0x161169,null))[_0xbf91('0x35')](handleError(_0x161169,null));};exports[_0xbf91('0x28')]=function(_0x14dbcf,_0x55985f){return db[_0xbf91('0x3e')][_0xbf91('0x66')]({'where':{'id':_0x14dbcf[_0xbf91('0xb2')]['id']}})[_0xbf91('0x29')](handleEntityNotFound(_0x55985f,null))[_0xbf91('0x29')](removeEntity(_0x55985f,null))[_0xbf91('0x35')](handleError(_0x55985f,null));};exports[_0xbf91('0xb4')]=function(_0x556335,_0x167cbc){return db[_0xbf91('0x3e')][_0xbf91('0xb4')]()['then'](respondWithResult(_0x167cbc,null))[_0xbf91('0x35')](handleError(_0x167cbc,null));};exports[_0xbf91('0xb5')]=function(_0x23b079,_0x14c434,_0x43ef9a){return db[_0xbf91('0xb6')]['find']({'where':{'id':_0x23b079[_0xbf91('0xb2')]['id']}})[_0xbf91('0x29')](handleEntityNotFound(_0x14c434,null))[_0xbf91('0x29')](function(_0xb5537f){if(_0xb5537f){return _0xb5537f[_0xbf91('0xb5')](_0x23b079[_0xbf91('0x77')]['ids'],_[_0xbf91('0xb7')](_0x23b079[_0xbf91('0x77')],[_0xbf91('0xb8'),'id'])||{});}})[_0xbf91('0x29')](respondWithResult(_0x14c434,null))[_0xbf91('0x35')](handleError(_0x14c434,null));};exports[_0xbf91('0xb9')]=function(_0x435263,_0xfdff2b,_0x3fd4b4){var _0x5016ff={'raw':![],'where':{}};var _0x3d157b={};var _0x47c087={'count':0x0,'rows':[]};return db[_0xbf91('0x3e')][_0xbf91('0xba')]({'where':{'id':_0x435263[_0xbf91('0xb2')]['id']}})[_0xbf91('0x29')](handleEntityNotFound(_0xfdff2b,null))['then'](function(_0x1b787f){if(_0x1b787f){_0x3d157b['model']=_[_0xbf91('0x42')](db[_0xbf91('0xb6')]['rawAttributes']);_0x3d157b['query']=_['keys'](_0x435263[_0xbf91('0x43')]);_0x3d157b[_0xbf91('0x4c')]=_['intersection'](_0x3d157b[_0xbf91('0x41')],_0x3d157b['query']);_0x5016ff[_0xbf91('0x46')]=_[_0xbf91('0x44')](_0x3d157b[_0xbf91('0x41')],qs[_0xbf91('0x45')](_0x435263['query'][_0xbf91('0x45')]));_0x5016ff[_0xbf91('0x46')]=_0x5016ff['attributes'][_0xbf91('0x47')]?_0x5016ff[_0xbf91('0x46')]:_0x3d157b[_0xbf91('0x41')];if(!_0x435263[_0xbf91('0x43')][_0xbf91('0x48')](_0xbf91('0x49'))){_0x5016ff['limit']=qs['limit'](_0x435263[_0xbf91('0x43')][_0xbf91('0x22')]);_0x5016ff[_0xbf91('0x20')]=qs[_0xbf91('0x20')](_0x435263[_0xbf91('0x43')][_0xbf91('0x20')]);}_0x5016ff[_0xbf91('0x92')]=qs['sort'](_0x435263['query'][_0xbf91('0x4a')]);_0x5016ff[_0xbf91('0x4b')]=qs['filters'](_[_0xbf91('0x4d')](_0x435263[_0xbf91('0x43')],_0x3d157b['filters']));_0x5016ff[_0xbf91('0x4b')][_0xbf91('0xbb')]=_0x1b787f['id'];if(_0x435263[_0xbf91('0x43')][_0xbf91('0x8a')]){_0x5016ff[_0xbf91('0x4b')]=_[_0xbf91('0x9e')](_0x5016ff['where'],{'$or':_[_0xbf91('0x2f')](_0x5016ff[_0xbf91('0x46')],function(_0x3c43b5){var _0x2d291d={};_0x2d291d[_0x3c43b5]={'$like':'%'+_0x435263[_0xbf91('0x43')][_0xbf91('0x8a')]+'%'};return _0x2d291d;})});}if(_0x435263[_0xbf91('0x43')][_0xbf91('0x80')]){var _0x19c9cb=_0x435263['query']['$gte'][_0xbf91('0x32')](',');var _0x5795df={};_0x5795df[_0x19c9cb[0x0]]={'$gte':moment(_0x19c9cb[0x1])['format'](_0xbf91('0xbc'))};_0x5016ff[_0xbf91('0x4b')]=_[_0xbf91('0x9e')](_0x5016ff[_0xbf91('0x4b')],_0x5795df);}_0x5016ff=_[_0xbf91('0x9e')]({},_0x5016ff,_0x435263[_0xbf91('0xbd')]);return db['OpenchannelMessage'][_0xbf91('0x23')]({'where':_0x5016ff[_0xbf91('0x4b')]})[_0xbf91('0x29')](function(_0xc8837){_0x47c087[_0xbf91('0x23')]=_0xc8837;if(_0x435263[_0xbf91('0x43')][_0xbf91('0xbe')]){_0x5016ff[_0xbf91('0xb3')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xbf91('0xbf')](_0x5016ff);})[_0xbf91('0x29')](function(_0x21cdde){_0x47c087[_0xbf91('0xb0')]=_0x21cdde;return _0x47c087;});}})[_0xbf91('0x29')](respondWithFilteredResult(_0xfdff2b,_0x5016ff))[_0xbf91('0x35')](handleError(_0xfdff2b,null));};exports[_0xbf91('0xc0')]=function(_0xabdffc,_0x2a66d5,_0xad9448){return db[_0xbf91('0x3e')][_0xbf91('0x66')]({'where':{'id':_0xabdffc[_0xbf91('0xb2')]['id']}})[_0xbf91('0x29')](handleEntityNotFound(_0x2a66d5,null))['then'](function(_0x3a74bd){if(_0x3a74bd){return _0x3a74bd['setTags'](_0xabdffc[_0xbf91('0x77')][_0xbf91('0xb8')],_['omit'](_0xabdffc[_0xbf91('0x77')],[_0xbf91('0xb8'),'id'])||{})['spread'](function(){return db['Tag'][_0xbf91('0xbf')]({'attributes':['id',_0xbf91('0x2c'),_0xbf91('0xc1')],'where':{'id':_0xabdffc[_0xbf91('0x77')][_0xbf91('0xb8')]}});})[_0xbf91('0x29')](function(_0xe4a417){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0xabdffc[_0xbf91('0xb2')]['id']),'tags':_0xe4a417||[]});return{'id':Number(_0xabdffc[_0xbf91('0xb2')]['id']),'tags':_0xe4a417||[]};});}})[_0xbf91('0x29')](respondWithResult(_0x2a66d5,null))[_0xbf91('0x35')](handleError(_0x2a66d5,null));};exports[_0xbf91('0xc2')]=function(_0x346bb4,_0x395ee4,_0x42a4fb){return db[_0xbf91('0x3e')]['find']({'where':{'id':_0x346bb4[_0xbf91('0xb2')]['id']}})['then'](handleEntityNotFound(_0x395ee4,null))[_0xbf91('0x29')](function(_0x133e12){if(_0x133e12){return _0x133e12[_0xbf91('0xc2')](_0x346bb4[_0xbf91('0x43')][_0xbf91('0xb8')]);}})[_0xbf91('0x29')](respondWithStatusCode(_0x395ee4,null))[_0xbf91('0x35')](handleError(_0x395ee4,null));};exports[_0xbf91('0xc3')]=function(_0x381016,_0x1acbdd){var _0x37bc38=moment()[_0xbf91('0xc4')]()['toString']();var _0x2d1166=path['join'](config[_0xbf91('0xc5')],_0xbf91('0xc6'),'files',_0xbf91('0xc7'));var _0x2774b2=path[_0xbf91('0xc8')](config['root'],'server','files',_0xbf91('0xc9'));var _0x4d0446=path['join'](_0x2d1166,_0x37bc38);var _0x57ef1c=util[_0xbf91('0xca')](_0xbf91('0xcb'),_0x381016[_0xbf91('0xb2')]['id'],_0x37bc38);var _0x57126c=path[_0xbf91('0xc8')](_0x2d1166,_0x57ef1c);var _0x3d31b3=[];_0x3d31b3['push']({'model':db[_0xbf91('0x76')],'as':_0xbf91('0x76'),'attributes':['id',_0xbf91('0xcc')],'raw':!![]});_0x3d31b3[_0xbf91('0x34')]({'model':db['CmContact'],'as':_0xbf91('0x6a'),'attributes':['id',_0xbf91('0xcd'),_0xbf91('0xce')],'raw':!![]});if(_0x381016['query'][_0xbf91('0xc9')]){_0x3d31b3[_0xbf91('0x34')]({'model':db[_0xbf91('0xcf')],'as':_0xbf91('0xcf'),'raw':!![]});}var _0x1a29b1=[{'model':db[_0xbf91('0xb6')],'as':_0xbf91('0xd0'),'attributes':['id','body','createdAt',_0xbf91('0xd1'),_0xbf91('0xd2'),_0xbf91('0x85')],'include':_0x3d31b3}];_0x1a29b1['push']({'model':db['OpenchannelAccount'],'as':_0xbf91('0xd3'),'attributes':['id',_0xbf91('0x2c')]});_0x1a29b1[_0xbf91('0x34')]({'model':db[_0xbf91('0x76')],'as':'Owner','attributes':['id',_0xbf91('0xcc')]});return db[_0xbf91('0x3e')][_0xbf91('0x66')]({'where':{'id':_0x381016[_0xbf91('0xb2')]['id']},'include':_0x1a29b1})[_0xbf91('0x29')](handleEntityNotFound(_0x1acbdd,null))['then'](function(_0x301563){if(_0x301563){var _0xb4f95a=_0x301563['get']({'plain':!![]});fs['mkdirSync'](_0x4d0446);var _0x1c0918={'channel':_0xbf91('0xd4'),'account':_0xb4f95a[_0xbf91('0xd3')][_0xbf91('0x2c')],'agent':_0xb4f95a[_0xbf91('0xd5')]?_0xb4f95a[_0xbf91('0xd5')][_0xbf91('0xcc')]:_0xbf91('0xd6'),'createdAt':moment(_0xb4f95a[_0xbf91('0x7e')])[_0xbf91('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbf91('0x9d')](),'closedAt':_0xb4f95a[_0xbf91('0x3b')]?moment(_0xb4f95a[_0xbf91('0xd7')])[_0xbf91('0xca')](_0xbf91('0xbc'))['toString']():'','disposition':_0xb4f95a[_0xbf91('0xd8')],'visibility':_0xb4f95a[_0xbf91('0xd9')]?'Public':_0xbf91('0xda'),'messages':_(_0xb4f95a[_0xbf91('0xd0')])[_0xbf91('0x8a')]({'secret':![]})[_0xbf91('0x2f')](function(_0x4c5d1f){if(_0x4c5d1f[_0xbf91('0xcf')]){var _0x45d8fe=path[_0xbf91('0xc8')](_0x2774b2,_0x4c5d1f[_0xbf91('0xcf')][_0xbf91('0xdb')]);if(fs['existsSync'](_0x45d8fe)){fs[_0xbf91('0xdc')](_0x45d8fe)['pipe'](fs[_0xbf91('0xdd')](path[_0xbf91('0xc8')](_0x4d0446,_0x4c5d1f[_0xbf91('0xcf')]['basename'])));}}return{'date':moment(_0x4c5d1f[_0xbf91('0x7e')])[_0xbf91('0xca')](_0xbf91('0xbc'))[_0xbf91('0x9d')](),'sender':_0x4c5d1f[_0xbf91('0xd1')]===_0xbf91('0xde')?_0x4c5d1f[_0xbf91('0x76')]?_0x4c5d1f[_0xbf91('0x76')][_0xbf91('0xcc')]:_0xbf91('0xdf'):_0x4c5d1f[_0xbf91('0x6a')][_0xbf91('0xcd')]+(_0x4c5d1f[_0xbf91('0x6a')]['lastName']?'\x20'+_0x4c5d1f[_0xbf91('0x6a')]['lastName']:''),'body':_0x4c5d1f[_0xbf91('0xcf')]?_0x4c5d1f[_0xbf91('0xcf')][_0xbf91('0xdb')]:_0x4c5d1f['body'],'direction':_0x4c5d1f[_0xbf91('0xd1')]===_0xbf91('0xde')?'A':'C','secret':_0x4c5d1f[_0xbf91('0xd2')],'read':_0x4c5d1f[_0xbf91('0x85')],'attachment':_0x4c5d1f[_0xbf91('0xcf')]};})['value']()};return ejs[_0xbf91('0xe0')](path['join'](config['root'],_0xbf91('0xc6'),'views',_0xbf91('0xe1')),{'interaction':_0x1c0918})[_0xbf91('0x29')](function(_0x3ffab6){var _0xebbd55=path['join'](_0x4d0446,_0xbf91('0xe2')+_0xb4f95a['id']+'-'+_0x37bc38+_0xbf91('0xe3'));var _0x65d80d={'path':_0xebbd55,'channel':_0xbf91('0xd4'),'interactionId':_0xb4f95a['id']};return pdf[_0xbf91('0xe4')](_0x3ffab6,_0x65d80d);})[_0xbf91('0x29')](function(){return new BPromise(function(_0x13f162,_0x4d46aa){zipdir(_0x4d0446,{'saveTo':_0x57126c},function(_0x29e820,_0x508932){if(_0x29e820)return _0x4d46aa(_0x29e820);return _0x13f162(_0x508932);});})[_0xbf91('0x29')](function(){return new BPromise(function(_0x2465d1,_0x2f5ad1){rimraf(_0x4d0446,function(_0x1ed348){if(_0x1ed348)_0x2f5ad1(_0x1ed348);return _0x2465d1();});});})[_0xbf91('0x29')](function(){return _0x1acbdd[_0xbf91('0xc3')](_0x57126c,_0x57ef1c,function(_0x4352eb){if(_0x4352eb){console[_0xbf91('0xe5')](_0xbf91('0xe6'),_0x4352eb);}else{fs[_0xbf91('0xe7')](_0x57126c);}});});});}else{return _0x1acbdd['sendStatus'](0xc8);}})[_0xbf91('0x35')](handleError(_0x1acbdd,null));}; \ No newline at end of file +var _0xcab7=['rows','show','params','include','options','create','body','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','$gte','format','includeAll','findAll','addTags','setTags','spread','Tag','emit','openchannelInteractionTags:save','removeTags','unix','join','root','tmp','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','download','log','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','status','offset','limit','undefined','count','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','Users','fullname','TagIds','Tags','split','push','catch','waiting','talking','unmanaged','closed','UserId','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','users','select','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','compact','OpenchannelAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','role','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0xcab7,0x131));var _0x7cab=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0xcab7[_0x45d1fd];return _0xd0e542;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7cab('0x0'));var zipdir=require(_0x7cab('0x1'));var jsonpatch=require(_0x7cab('0x2'));var rp=require(_0x7cab('0x3'));var moment=require('moment');var BPromise=require(_0x7cab('0x4'));var Mustache=require('mustache');var util=require(_0x7cab('0x5'));var path=require(_0x7cab('0x6'));var sox=require('sox');var csv=require(_0x7cab('0x7'));var ejs=require(_0x7cab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7cab('0x9'));var squel=require(_0x7cab('0xa'));var crypto=require(_0x7cab('0xb'));var jsforce=require(_0x7cab('0xc'));var deskjs=require(_0x7cab('0xd'));var toCsv=require(_0x7cab('0x7'));var querystring=require('querystring');var Papa=require(_0x7cab('0xe'));var Redis=require(_0x7cab('0xf'));var authService=require(_0x7cab('0x10'));var qs=require(_0x7cab('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x7cab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cab('0x13'))(_0x7cab('0x14'));var utils=require(_0x7cab('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7cab('0x16'))['db'];config[_0x7cab('0x17')]=_[_0x7cab('0x18')](config[_0x7cab('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7cab('0x19'))(new Redis(config[_0x7cab('0x17')]));require(_0x7cab('0x1a'))[_0x7cab('0x1b')](socket);function respondWithStatusCode(_0x35b564,_0x477956){_0x477956=_0x477956||0xcc;return function(_0xaf0c4){if(_0xaf0c4){return _0x35b564['sendStatus'](_0x477956);}return _0x35b564[_0x7cab('0x1c')](_0x477956)['end']();};}function respondWithResult(_0x9cd5e2,_0x139b0a){_0x139b0a=_0x139b0a||0xc8;return function(_0x506a0d){if(_0x506a0d){return _0x9cd5e2[_0x7cab('0x1c')](_0x139b0a)['json'](_0x506a0d);}};}function respondWithFilteredResult(_0x1c5729,_0x1f6464){return function(_0x501011){if(_0x501011){var _0x8bdfdb=typeof _0x1f6464[_0x7cab('0x1d')]==='undefined'&&typeof _0x1f6464[_0x7cab('0x1e')]===_0x7cab('0x1f');var _0x13b321=_0x501011[_0x7cab('0x20')];var _0x3bfd2a=_0x8bdfdb?0x0:_0x1f6464[_0x7cab('0x1d')];var _0x52cd94=_0x8bdfdb?_0x501011[_0x7cab('0x20')]:_0x1f6464[_0x7cab('0x1d')]+_0x1f6464['limit'];var _0x5d80c3;if(_0x52cd94>=_0x13b321){_0x52cd94=_0x13b321;_0x5d80c3=0xc8;}else{_0x5d80c3=0xce;}_0x1c5729[_0x7cab('0x1c')](_0x5d80c3);return _0x1c5729['set']('Content-Range',_0x3bfd2a+'-'+_0x52cd94+'/'+_0x13b321)['json'](_0x501011);}return null;};}function patchUpdates(_0x537259){return function(_0x37c292){try{jsonpatch[_0x7cab('0x21')](_0x37c292,_0x537259,!![]);}catch(_0x4dc511){return BPromise[_0x7cab('0x22')](_0x4dc511);}return _0x37c292[_0x7cab('0x23')]();};}function saveUpdates(_0x255cfd,_0x16a127){return function(_0x2b2bbf){if(_0x2b2bbf){return _0x2b2bbf[_0x7cab('0x24')](_0x255cfd)[_0x7cab('0x25')](function(_0x55ea68){return _0x55ea68;});}return null;};}function removeEntity(_0x41a907,_0x2aa939){return function(_0x16244b){if(_0x16244b){return _0x16244b[_0x7cab('0x26')]()[_0x7cab('0x25')](function(){_0x41a907[_0x7cab('0x1c')](0xcc)[_0x7cab('0x27')]();});}};}function handleEntityNotFound(_0x1d5686,_0x56cebc){return function(_0x50c41b){if(!_0x50c41b){_0x1d5686[_0x7cab('0x28')](0x194);}return _0x50c41b;};}function handleError(_0x35c06d,_0x13a545){_0x13a545=_0x13a545||0x1f4;return function(_0x58ec57){logger['error'](_0x58ec57[_0x7cab('0x29')]);if(_0x58ec57[_0x7cab('0x2a')]){delete _0x58ec57[_0x7cab('0x2a')];}_0x35c06d[_0x7cab('0x1c')](_0x13a545)['send'](_0x58ec57);};}function getInteractionUsers(_0x4f3a64,_0x40c53f){return new BPromise(function(_0xbe853d,_0x7c404a){try{if(_0x40c53f[_0x4f3a64['id']]){_0x4f3a64[_0x7cab('0x2b')]=_['map'](_0x40c53f[_0x4f3a64['id']],function(_0x5dd949){return{'id':_0x5dd949['id'],'fullname':_0x5dd949[_0x7cab('0x2c')]};});}}catch(_0x9c6eb6){_0x7c404a(_0x9c6eb6);}_0xbe853d(_0x4f3a64);});}function getInteractionTags(_0x437bb6,_0x20e10b){return new BPromise(function(_0x5d55f7,_0x495140){try{if(_0x437bb6[_0x7cab('0x2d')]){_0x437bb6[_0x7cab('0x2e')]=[];_0x437bb6[_0x7cab('0x2d')][_0x7cab('0x2f')](',')['forEach'](function(_0x544458){_0x437bb6[_0x7cab('0x2e')][_0x7cab('0x30')](_0x20e10b[_0x544458]);});}delete _0x437bb6[_0x7cab('0x2d')];}catch(_0xf65fba){_0x495140(_0xf65fba);}_0x5d55f7(_0x437bb6);});}function updateOpenchannelInteraction(_0x580558,_0x23f83a,_0x556c5d){return new BPromise(function(_0x3e3377,_0x21b144){return getInteractionUsers(_0x580558,_0x556c5d)['then'](function(_0x37a623){return getInteractionTags(_0x37a623,_0x23f83a);})[_0x7cab('0x25')](function(_0x25709e){return getStateInteraction(_0x25709e);})[_0x7cab('0x25')](function(_0x12baf4){_0x3e3377(_0x12baf4);})[_0x7cab('0x31')](function(_0x2cb862){_0x21b144(_0x2cb862);});});}function getStateInteraction(_0x237481){return new BPromise(function(_0x118c3a){_0x237481[_0x7cab('0x32')]=0x0;_0x237481[_0x7cab('0x33')]=0x0;_0x237481['answered']=0x0;_0x237481[_0x7cab('0x34')]=0x0;_0x237481['total']=0x0;if(!_0x237481[_0x7cab('0x35')]&&!_0x237481[_0x7cab('0x36')]){_0x237481[_0x7cab('0x32')]+=0x1;}if(!_0x237481[_0x7cab('0x35')]&&_0x237481[_0x7cab('0x36')]){_0x237481['talking']+=0x1;if(_0x237481[_0x7cab('0x32')]){_0x237481[_0x7cab('0x32')]-=0x1;}}if(_0x237481[_0x7cab('0x35')]&&_0x237481[_0x7cab('0x36')]){_0x237481['answered']+=0x1;if(_0x237481['talking']){_0x237481[_0x7cab('0x33')]-=0x1;}}if(_0x237481[_0x7cab('0x35')]&&!_0x237481[_0x7cab('0x36')]){_0x237481[_0x7cab('0x34')]+=0x1;if(_0x237481[_0x7cab('0x32')]){_0x237481['waiting']-=0x1;}}_0x237481['total']+=0x1;_0x118c3a(_0x237481);});}exports[_0x7cab('0x37')]=function(_0x42ebce,_0x18d6c0){var _0x1ccc2a={},_0x3f5dd9={},_0x3fc6fc={'count':0x0,'rows':[]};var _0x30b2cb=_[_0x7cab('0x38')](db[_0x7cab('0x39')][_0x7cab('0x3a')],function(_0x1e7520){return{'name':_0x1e7520[_0x7cab('0x3b')],'type':_0x1e7520[_0x7cab('0x3c')][_0x7cab('0x3d')]};});_0x3f5dd9[_0x7cab('0x3e')]=_['map'](_0x30b2cb,'name');_0x3f5dd9[_0x7cab('0x3f')]=_[_0x7cab('0x40')](_0x42ebce[_0x7cab('0x3f')]);_0x3f5dd9[_0x7cab('0x41')]=_[_0x7cab('0x42')](_0x3f5dd9[_0x7cab('0x3e')],_0x3f5dd9[_0x7cab('0x3f')]);_0x1ccc2a['attributes']=_[_0x7cab('0x42')](_0x3f5dd9['model'],qs['fields'](_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x43')]));_0x1ccc2a[_0x7cab('0x44')]=_0x1ccc2a['attributes'][_0x7cab('0x45')]?_0x1ccc2a[_0x7cab('0x44')]:_0x3f5dd9['model'];if(!_0x42ebce[_0x7cab('0x3f')]['hasOwnProperty'](_0x7cab('0x46'))){_0x1ccc2a[_0x7cab('0x1e')]=qs[_0x7cab('0x1e')](_0x42ebce['query'][_0x7cab('0x1e')]);_0x1ccc2a[_0x7cab('0x1d')]=qs[_0x7cab('0x1d')](_0x42ebce[_0x7cab('0x3f')]['offset']);}_0x1ccc2a[_0x7cab('0x47')]=qs[_0x7cab('0x48')](_0x42ebce['query'][_0x7cab('0x48')]);_0x1ccc2a[_0x7cab('0x49')]=qs[_0x7cab('0x41')](_[_0x7cab('0x4a')](_0x42ebce['query'],_0x3f5dd9['filters']),_0x30b2cb);var _0xb5d022=[];var _0x493b44=squel['select']()[_0x7cab('0x4b')]('id')['field'](_0x7cab('0x2a'))[_0x7cab('0x4b')](_0x7cab('0x4c'))[_0x7cab('0x4d')](_0x7cab('0x4e'));var _0x5cf798=squel['select']()[_0x7cab('0x4b')](_0x7cab('0x4f'))['field'](_0x7cab('0x50'))[_0x7cab('0x4b')](_0x7cab('0x51'))[_0x7cab('0x4d')]('user_has_openchannel_interactions','ui')['left_join'](_0x7cab('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x4b3f84=squel[_0x7cab('0x53')]()['from'](_0x7cab('0x54'),'i')[_0x7cab('0x55')](_0x7cab('0x56'),'c',_0x7cab('0x57'))[_0x7cab('0x55')](_0x7cab('0x52'),'o',_0x7cab('0x58'))['left_join']('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x7cab('0x55')](_0x7cab('0x59'),'me',_0x7cab('0x5a'))['left_join']('openchannel_interaction_has_tags','it',_0x7cab('0x5b'))['left_join'](_0x7cab('0x4e'),'t',_0x7cab('0x5c'));var _0x42c415=squel[_0x7cab('0x5d')]();var _0x34c0c6=[];var _0x371300=squel[_0x7cab('0x5d')]();var _0x5bb3d5;if(_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x5e')]){_0x5bb3d5=as['parseSearch'](_0x42ebce['query'][_0x7cab('0x5e')]);var _0x5c47a9=_0x5bb3d5[_0x7cab('0x5f')];for(var _0x3d2e5f=0x0;_0x3d2e5f<_0x5bb3d5[_0x7cab('0x60')]['length'];_0x3d2e5f++){var _0x36769e=_0x5bb3d5[_0x7cab('0x60')][_0x3d2e5f];var _0x551fa6='i';var _0x2a16fa=_[_0x7cab('0x61')](_0x30b2cb,[_0x7cab('0x2a'),_0x36769e['field']]);if(!_0x2a16fa){switch(_0x36769e['field']){case'unreadMessages':if(_0x36769e[_0x7cab('0x62')]==0x1){_0x4b3f84[_0x7cab('0x63')]('`'+_0x36769e[_0x7cab('0x4b')]+_0x7cab('0x64'));}else{_0x4b3f84[_0x7cab('0x63')]('`'+_0x36769e[_0x7cab('0x4b')]+_0x7cab('0x65'));}break;case _0x7cab('0x66'):if(_0x36769e[_0x7cab('0x67')]===_0x7cab('0x68')){if(_0x36769e[_0x7cab('0x62')][_0x7cab('0x2f')]('\x20')[_0x7cab('0x45')]>0x1){_0x42c415[_0x5c47a9]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7cab('0x69')](_0x36769e[_0x7cab('0x62')]),null);}else{var _0x120dca='%'+_0x36769e[_0x7cab('0x62')]+'%';_0x42c415[_0x5c47a9](_0x7cab('0x6a'),_0x120dca,_0x120dca,_0x120dca);}}else{_0x2a16fa=_['find'](_0x30b2cb,[_0x7cab('0x2a'),'ContactId']);_0x36769e[_0x7cab('0x4b')]='ContactId';_0x3e7e5e=as[_0x7cab('0x6b')](_0x551fa6,_0x2a16fa['type'],_0x36769e);_0x42c415[_0x5c47a9](_0x3e7e5e[_0x7cab('0x6c')],_0x3e7e5e['value'][_0x7cab('0x6d')],_0x3e7e5e['value']['end']);}break;case'Tag':var _0xa03741=_0x36769e[_0x7cab('0x62')]['split'](',')[_0x7cab('0x38')](function(_0x27037f){return Number(_0x27037f);});_0xa03741[_0x7cab('0x6e')](function(_0x81cee2){_0x371300['or'](_0x7cab('0x6f'),'%,'+_0x81cee2+',%');});_0x34c0c6=_[_0x7cab('0x70')](_0x34c0c6,_0xa03741);break;case _0x7cab('0x71'):if(_0x36769e[_0x7cab('0x67')]==='$substring'){_0x42c415[_0x5c47a9](_0x7cab('0x72'),'%'+_0x36769e[_0x7cab('0x62')]+'%',null);}else{_0x2a16fa=_[_0x7cab('0x61')](_0x30b2cb,[_0x7cab('0x2a'),_0x7cab('0x36')]);_0x36769e[_0x7cab('0x4b')]='UserId';_0x3e7e5e=as[_0x7cab('0x6b')](_0x551fa6,_0x2a16fa[_0x7cab('0x3c')],_0x36769e);_0x42c415[_0x5c47a9](_0x3e7e5e[_0x7cab('0x6c')],_0x3e7e5e[_0x7cab('0x62')][_0x7cab('0x6d')],_0x3e7e5e['value'][_0x7cab('0x27')]);}break;case'body':_0x3e7e5e=as['buildExpression']('me',null,_0x36769e);_0x42c415[_0x5c47a9](_0x3e7e5e[_0x7cab('0x6c')],_0x3e7e5e[_0x7cab('0x62')]['start'],_0x3e7e5e[_0x7cab('0x62')][_0x7cab('0x27')]);break;}}else{var _0x3e7e5e=as[_0x7cab('0x6b')](_0x551fa6,_0x2a16fa['type'],_0x36769e);_0x42c415[_0x5c47a9](_0x3e7e5e[_0x7cab('0x6c')],_0x3e7e5e[_0x7cab('0x62')][_0x7cab('0x6d')],_0x3e7e5e[_0x7cab('0x62')][_0x7cab('0x27')]);}}}else{var _0x3bb240=_(_0x42ebce[_0x7cab('0x3f')])[_0x7cab('0x40')]()[_0x7cab('0x38')](function(_0x1e083c){return _['some'](_0x30b2cb,['name',_0x1e083c])?_0x1e083c:undefined;})[_0x7cab('0x73')]()[_0x7cab('0x62')]();if(!_['isEmpty'](_0x3bb240)){_0x3bb240[_0x7cab('0x6e')](function(_0x35fa74){if(_0x35fa74===_0x7cab('0x74')){_0x4b3f84['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x7cab('0x75')](_0x42ebce[_0x7cab('0x3f')][_0x35fa74]));}else if(_0x35fa74===_0x7cab('0x76')){var _0x113577=JSON[_0x7cab('0x77')](_0x42ebce[_0x7cab('0x3f')][_0x35fa74])['$gte'];var _0x24ee2e=JSON[_0x7cab('0x77')](_0x42ebce[_0x7cab('0x3f')][_0x35fa74])[_0x7cab('0x78')];_0x4b3f84['where'](_0x7cab('0x79'),_0x113577,_0x24ee2e);}else{if(_0x42ebce[_0x7cab('0x3f')][_0x35fa74]===_0x7cab('0x7a')){_0x4b3f84[_0x7cab('0x49')]('i.'+_0x35fa74+_0x7cab('0x7b'));}else{_0x4b3f84[_0x7cab('0x49')]('i.'+_0x35fa74+_0x7cab('0x7c'),_0x42ebce[_0x7cab('0x3f')][_0x35fa74]);}}});}if(_0x42ebce['query'][_0x7cab('0x7d')]){if(_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x7d')]==0x1){_0x4b3f84['having'](_0x7cab('0x7e'));}else{_0x4b3f84['having'](_0x7cab('0x7f'));}}if(_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x80')]){_0x34c0c6=_[_0x7cab('0x81')](_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x80')])?_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x80')]:new Array(_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x80')]);_0x34c0c6['forEach'](function(_0xf91382){_0x371300['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf91382+',%');});}if(_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x82')]){var _0xc379ce=_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x82')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xc379ce)){_0x42c415['or'](_0x7cab('0x83'),_0xc379ce+'%');}else{_0x42c415['or'](_0x7cab('0x84'),qs[_0x7cab('0x69')](_0xc379ce))['or'](_0x7cab('0x85'),_0xc379ce+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xc379ce+'%');}}}_0x4b3f84[_0x7cab('0x49')](_0x42c415);_0x4b3f84[_0x7cab('0x86')](_0x7cab('0x87'));var _0x2c0ad3={'type':db[_0x7cab('0x88')][_0x7cab('0x89')]['SELECT'],'raw':!![]};var _0x52e196=_0x4b3f84[_0x7cab('0x8a')]();_0x52e196[_0x7cab('0x4b')]('i.id');_0x52e196[_0x7cab('0x4b')](_0x7cab('0x8b'),_0x7cab('0x8c'));if(_0x1ccc2a[_0x7cab('0x47')]){_0x1ccc2a[_0x7cab('0x47')][_0x7cab('0x6e')](function(_0x26e307){var _0x14434f=_0x26e307[0x0]===_0x7cab('0x8d')?_0x26e307[0x0]:'i.'+_0x26e307[0x0];_0x4b3f84[_0x7cab('0x47')](_0x14434f,_0x26e307[0x1]==='DESC'?![]:!![]);});}if(!_[_0x7cab('0x8e')](_0x34c0c6)){_0x4b3f84[_0x7cab('0x63')](_0x371300);_0x52e196[_0x7cab('0x49')](_0x7cab('0x8f'),_0x34c0c6);}BPromise[_0x7cab('0x90')]()[_0x7cab('0x25')](function(){if(!_0x5bb3d5){if(_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x74')])return;_0x52e196[_0x7cab('0x49')](_0x7cab('0x91'));_0x4b3f84[_0x7cab('0x49')](_0x7cab('0x91'));return;}if(_0x42ebce[_0x7cab('0x92')]['role']!=='agent')return;return _0x42ebce[_0x7cab('0x92')][_0x7cab('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0xa548cc){if(_[_0x7cab('0x8e')](_0xa548cc)){_0x52e196[_0x7cab('0x49')](_0x7cab('0x94'));_0x4b3f84['where'](_0x7cab('0x94'));}else{_0x52e196['where'](_0x7cab('0x95'),_[_0x7cab('0x38')](_0xa548cc,'id'));_0x4b3f84[_0x7cab('0x49')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0xa548cc,'id'));}});})[_0x7cab('0x25')](function(){if(_0x42ebce[_0x7cab('0x92')][_0x7cab('0x96')]===_0x7cab('0x97')&&!_0x5bb3d5&&!_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x74')])return[];return db[_0x7cab('0x98')][_0x7cab('0x3f')](_0x52e196[_0x7cab('0x99')](),_0x2c0ad3);})[_0x7cab('0x25')](function(_0x34d9b1){_0x3fc6fc[_0x7cab('0x20')]=_0x34d9b1[_0x7cab('0x45')];if(_0x3fc6fc[_0x7cab('0x20')]===0x0)return[];return db[_0x7cab('0x98')]['query'](_0x493b44[_0x7cab('0x99')](),_0x2c0ad3)['then'](function(_0x1895e1){_0xb5d022=_[_0x7cab('0x9a')](_0x1895e1,'id');_0x2c0ad3=_[_0x7cab('0x9b')](_0x2c0ad3,{'model':db[_0x7cab('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x42ebce[_0x7cab('0x3f')][_0x7cab('0x43')]){_0x1ccc2a[_0x7cab('0x44')][_0x7cab('0x6e')](function(_0x540981){_0x4b3f84[_0x7cab('0x4b')]('i.'+_0x540981);});}else{_0x4b3f84[_0x7cab('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7cab('0x8c'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0x9c'),_0x7cab('0x9d'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0x9e'),_0x7cab('0x9f'));_0x4b3f84['field'](_0x7cab('0xa0'),_0x7cab('0x8d'));_0x4b3f84[_0x7cab('0x4b')]('i.*');_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xa1'),'Contact.firstName');_0x4b3f84[_0x7cab('0x4b')]('c.lastName',_0x7cab('0xa2'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xa3'),'Contact.email');_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xa4'),_0x7cab('0xa5'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xa6'),_0x7cab('0xa7'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xa8'),_0x7cab('0xa9'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xaa'),_0x7cab('0xab'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xac'),_0x7cab('0xad'));_0x4b3f84[_0x7cab('0x4b')](_0x7cab('0xae'),'TagIds');}if(_0x1ccc2a['limit'])_0x4b3f84[_0x7cab('0x1e')](_0x1ccc2a[_0x7cab('0x1e')]);if(_0x1ccc2a[_0x7cab('0x1d')])_0x4b3f84[_0x7cab('0x1d')](_0x1ccc2a[_0x7cab('0x1d')]);return db[_0x7cab('0x98')][_0x7cab('0x3f')](_0x4b3f84[_0x7cab('0x99')](),_0x2c0ad3);})[_0x7cab('0x25')](function(_0x5470e5){if(_0x5470e5[_0x7cab('0x45')]>0x0)_0x5cf798[_0x7cab('0x49')](_0x7cab('0xaf'),_[_0x7cab('0x38')](_0x5470e5,'id'));return db['sequelize'][_0x7cab('0x3f')](_0x5cf798['toString'](),_0x2c0ad3)[_0x7cab('0x25')](function(_0x199870){var _0x496402=_[_0x7cab('0xb0')](_0x199870,_0x7cab('0xb1'));var _0x5594a4=[];_0x5470e5[_0x7cab('0x6e')](function(_0x4c1bb3){_0x5594a4[_0x7cab('0x30')](updateOpenchannelInteraction(_0x4c1bb3,_0xb5d022,_0x496402));});return BPromise[_0x7cab('0xb2')](_0x5594a4);});});})[_0x7cab('0x25')](function(_0x43d1ec){_0x3fc6fc[_0x7cab('0xb3')]=_0x43d1ec;return _0x3fc6fc;})['then'](respondWithFilteredResult(_0x18d6c0,_0x1ccc2a))[_0x7cab('0x31')](handleError(_0x18d6c0,null));};exports[_0x7cab('0xb4')]=function(_0x422761,_0x2b7bca){var _0x1cc1eb={};if(_0x422761[_0x7cab('0x3f')][_0x7cab('0x3c')]&&_0x422761[_0x7cab('0x3f')][_0x7cab('0x3c')]===_0x7cab('0x4d')){_0x1cc1eb['from']=_0x422761['params']['id'];}else{_0x1cc1eb['id']=_0x422761[_0x7cab('0xb5')]['id'];}var _0x274620={'raw':![],'where':_0x1cc1eb},_0x4b780d={};_0x4b780d['model']=_[_0x7cab('0x40')](db[_0x7cab('0x39')][_0x7cab('0x3a')]);_0x4b780d[_0x7cab('0x3f')]=_['keys'](_0x422761['query']);_0x4b780d[_0x7cab('0x41')]=_[_0x7cab('0x42')](_0x4b780d[_0x7cab('0x3e')],_0x4b780d[_0x7cab('0x3f')]);_0x274620[_0x7cab('0x44')]=_['intersection'](_0x4b780d[_0x7cab('0x3e')],qs[_0x7cab('0x43')](_0x422761[_0x7cab('0x3f')]['fields']));_0x274620[_0x7cab('0x44')]=_0x274620[_0x7cab('0x44')]['length']?_0x274620[_0x7cab('0x44')]:_0x4b780d[_0x7cab('0x3e')];if(_0x422761[_0x7cab('0x3f')]['includeAll']){_0x274620[_0x7cab('0xb6')]=[{'all':!![]}];}_0x274620=_[_0x7cab('0x9b')]({},_0x274620,_0x422761[_0x7cab('0xb7')]);return db[_0x7cab('0x39')][_0x7cab('0x61')](_0x274620)[_0x7cab('0x25')](handleEntityNotFound(_0x2b7bca,null))[_0x7cab('0x25')](respondWithResult(_0x2b7bca,null))['catch'](handleError(_0x2b7bca,null));};exports[_0x7cab('0xb8')]=function(_0xe7c69e,_0x53f476){return db['OpenchannelInteraction'][_0x7cab('0xb8')](_0xe7c69e[_0x7cab('0xb9')],{})['then'](respondWithResult(_0x53f476,0xc9))[_0x7cab('0x31')](handleError(_0x53f476,null));};exports['update']=function(_0x482982,_0x8ed1b7){if(_0x482982[_0x7cab('0xb9')]['id']){delete _0x482982[_0x7cab('0xb9')]['id'];}return db['OpenchannelInteraction'][_0x7cab('0x61')]({'where':{'id':_0x482982[_0x7cab('0xb5')]['id']}})[_0x7cab('0x25')](handleEntityNotFound(_0x8ed1b7,null))[_0x7cab('0x25')](saveUpdates(_0x482982[_0x7cab('0xb9')],null))[_0x7cab('0x25')](respondWithResult(_0x8ed1b7,null))[_0x7cab('0x31')](handleError(_0x8ed1b7,null));};exports['destroy']=function(_0x25977c,_0x5d8cdb){return db[_0x7cab('0x39')][_0x7cab('0x61')]({'where':{'id':_0x25977c['params']['id']}})[_0x7cab('0x25')](handleEntityNotFound(_0x5d8cdb,null))[_0x7cab('0x25')](removeEntity(_0x5d8cdb,null))[_0x7cab('0x31')](handleError(_0x5d8cdb,null));};exports['describe']=function(_0x4712d2,_0x399daa){return db[_0x7cab('0x39')]['describe']()[_0x7cab('0x25')](respondWithResult(_0x399daa,null))[_0x7cab('0x31')](handleError(_0x399daa,null));};exports[_0x7cab('0xba')]=function(_0x20426b,_0x41918c,_0x49ea36){return db[_0x7cab('0xbb')][_0x7cab('0x61')]({'where':{'id':_0x20426b[_0x7cab('0xb5')]['id']}})['then'](handleEntityNotFound(_0x41918c,null))[_0x7cab('0x25')](function(_0x1b8646){if(_0x1b8646){return _0x1b8646[_0x7cab('0xba')](_0x20426b[_0x7cab('0xb9')][_0x7cab('0xbc')],_[_0x7cab('0xbd')](_0x20426b['body'],[_0x7cab('0xbc'),'id'])||{});}})[_0x7cab('0x25')](respondWithResult(_0x41918c,null))['catch'](handleError(_0x41918c,null));};exports[_0x7cab('0xbe')]=function(_0x142e99,_0x2364e9,_0x481f20){var _0x4a3ba7={'raw':![],'where':{}};var _0x477a66={};var _0x22b850={'count':0x0,'rows':[]};return db[_0x7cab('0x39')]['findOne']({'where':{'id':_0x142e99[_0x7cab('0xb5')]['id']}})[_0x7cab('0x25')](handleEntityNotFound(_0x2364e9,null))[_0x7cab('0x25')](function(_0x8ea9b5){if(_0x8ea9b5){_0x477a66['model']=_[_0x7cab('0x40')](db[_0x7cab('0xbb')][_0x7cab('0x3a')]);_0x477a66['query']=_[_0x7cab('0x40')](_0x142e99[_0x7cab('0x3f')]);_0x477a66[_0x7cab('0x41')]=_[_0x7cab('0x42')](_0x477a66['model'],_0x477a66['query']);_0x4a3ba7[_0x7cab('0x44')]=_[_0x7cab('0x42')](_0x477a66[_0x7cab('0x3e')],qs[_0x7cab('0x43')](_0x142e99['query']['fields']));_0x4a3ba7[_0x7cab('0x44')]=_0x4a3ba7['attributes'][_0x7cab('0x45')]?_0x4a3ba7['attributes']:_0x477a66[_0x7cab('0x3e')];if(!_0x142e99[_0x7cab('0x3f')][_0x7cab('0xbf')](_0x7cab('0x46'))){_0x4a3ba7[_0x7cab('0x1e')]=qs['limit'](_0x142e99['query'][_0x7cab('0x1e')]);_0x4a3ba7['offset']=qs[_0x7cab('0x1d')](_0x142e99[_0x7cab('0x3f')][_0x7cab('0x1d')]);}_0x4a3ba7['order']=qs[_0x7cab('0x48')](_0x142e99[_0x7cab('0x3f')]['sort']);_0x4a3ba7[_0x7cab('0x49')]=qs[_0x7cab('0x41')](_[_0x7cab('0x4a')](_0x142e99['query'],_0x477a66['filters']));_0x4a3ba7[_0x7cab('0x49')][_0x7cab('0xb1')]=_0x8ea9b5['id'];if(_0x142e99['query'][_0x7cab('0x82')]){_0x4a3ba7[_0x7cab('0x49')]=_['merge'](_0x4a3ba7[_0x7cab('0x49')],{'$or':_['map'](_0x4a3ba7[_0x7cab('0x44')],function(_0x50b712){var _0x5593e8={};_0x5593e8[_0x50b712]={'$like':'%'+_0x142e99[_0x7cab('0x3f')][_0x7cab('0x82')]+'%'};return _0x5593e8;})});}if(_0x142e99['query']['$gte']){var _0x16869e=_0x142e99[_0x7cab('0x3f')][_0x7cab('0xc0')][_0x7cab('0x2f')](',');var _0x54faf0={};_0x54faf0[_0x16869e[0x0]]={'$gte':moment(_0x16869e[0x1])[_0x7cab('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4a3ba7[_0x7cab('0x49')]=_[_0x7cab('0x9b')](_0x4a3ba7[_0x7cab('0x49')],_0x54faf0);}_0x4a3ba7=_[_0x7cab('0x9b')]({},_0x4a3ba7,_0x142e99[_0x7cab('0xb7')]);return db[_0x7cab('0xbb')]['count']({'where':_0x4a3ba7[_0x7cab('0x49')]})[_0x7cab('0x25')](function(_0x4f65e4){_0x22b850[_0x7cab('0x20')]=_0x4f65e4;if(_0x142e99[_0x7cab('0x3f')][_0x7cab('0xc2')]){_0x4a3ba7[_0x7cab('0xb6')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x7cab('0xc3')](_0x4a3ba7);})[_0x7cab('0x25')](function(_0x5eeee5){_0x22b850['rows']=_0x5eeee5;return _0x22b850;});}})[_0x7cab('0x25')](respondWithFilteredResult(_0x2364e9,_0x4a3ba7))['catch'](handleError(_0x2364e9,null));};exports[_0x7cab('0xc4')]=function(_0x6c5df5,_0x571ed6,_0x43fec0){return db[_0x7cab('0x39')][_0x7cab('0x61')]({'where':{'id':_0x6c5df5[_0x7cab('0xb5')]['id']}})[_0x7cab('0x25')](handleEntityNotFound(_0x571ed6,null))[_0x7cab('0x25')](function(_0x135823){if(_0x135823){return _0x135823[_0x7cab('0xc5')](_0x6c5df5[_0x7cab('0xb9')][_0x7cab('0xbc')],_['omit'](_0x6c5df5[_0x7cab('0xb9')],[_0x7cab('0xbc'),'id'])||{})[_0x7cab('0xc6')](function(){return db[_0x7cab('0xc7')][_0x7cab('0xc3')]({'attributes':['id',_0x7cab('0x2a'),_0x7cab('0x4c')],'where':{'id':_0x6c5df5[_0x7cab('0xb9')][_0x7cab('0xbc')]}});})[_0x7cab('0x25')](function(_0x2f7652){socket[_0x7cab('0xc8')](_0x7cab('0xc9'),{'id':Number(_0x6c5df5['params']['id']),'tags':_0x2f7652||[]});return{'id':Number(_0x6c5df5[_0x7cab('0xb5')]['id']),'tags':_0x2f7652||[]};});}})['then'](respondWithResult(_0x571ed6,null))[_0x7cab('0x31')](handleError(_0x571ed6,null));};exports[_0x7cab('0xca')]=function(_0x1386fe,_0x2482be,_0x24ce29){return db[_0x7cab('0x39')][_0x7cab('0x61')]({'where':{'id':_0x1386fe[_0x7cab('0xb5')]['id']}})[_0x7cab('0x25')](handleEntityNotFound(_0x2482be,null))[_0x7cab('0x25')](function(_0xa22c2e){if(_0xa22c2e){return _0xa22c2e['removeTags'](_0x1386fe[_0x7cab('0x3f')][_0x7cab('0xbc')]);}})[_0x7cab('0x25')](respondWithStatusCode(_0x2482be,null))[_0x7cab('0x31')](handleError(_0x2482be,null));};exports['download']=function(_0x8f73eb,_0x56ae63){var _0x367e10=moment()[_0x7cab('0xcb')]()[_0x7cab('0x99')]();var _0x4a9aed=path[_0x7cab('0xcc')](config[_0x7cab('0xcd')],'server','files',_0x7cab('0xce'));var _0x1bb321=path[_0x7cab('0xcc')](config[_0x7cab('0xcd')],_0x7cab('0xcf'),'files',_0x7cab('0xd0'));var _0x4bfe44=path[_0x7cab('0xcc')](_0x4a9aed,_0x367e10);var _0x1e33ed=util[_0x7cab('0xc1')](_0x7cab('0xd1'),_0x8f73eb[_0x7cab('0xb5')]['id'],_0x367e10);var _0x48beae=path['join'](_0x4a9aed,_0x1e33ed);var _0xdfffc5=[];_0xdfffc5[_0x7cab('0x30')]({'model':db[_0x7cab('0x71')],'as':_0x7cab('0x71'),'attributes':['id','fullname'],'raw':!![]});_0xdfffc5[_0x7cab('0x30')]({'model':db[_0x7cab('0xd2')],'as':_0x7cab('0x66'),'attributes':['id',_0x7cab('0xd3'),_0x7cab('0xd4')],'raw':!![]});if(_0x8f73eb[_0x7cab('0x3f')][_0x7cab('0xd0')]){_0xdfffc5[_0x7cab('0x30')]({'model':db[_0x7cab('0xd5')],'as':_0x7cab('0xd5'),'raw':!![]});}var _0x3cfeef=[{'model':db[_0x7cab('0xbb')],'as':_0x7cab('0xd6'),'attributes':['id',_0x7cab('0xb9'),_0x7cab('0x76'),_0x7cab('0xd7'),_0x7cab('0xd8'),_0x7cab('0x7d')],'include':_0xdfffc5}];_0x3cfeef[_0x7cab('0x30')]({'model':db[_0x7cab('0xd9')],'as':_0x7cab('0xda'),'attributes':['id',_0x7cab('0x2a')]});_0x3cfeef[_0x7cab('0x30')]({'model':db['User'],'as':_0x7cab('0xdb'),'attributes':['id',_0x7cab('0x2c')]});return db[_0x7cab('0x39')][_0x7cab('0x61')]({'where':{'id':_0x8f73eb[_0x7cab('0xb5')]['id']},'include':_0x3cfeef})[_0x7cab('0x25')](handleEntityNotFound(_0x56ae63,null))[_0x7cab('0x25')](function(_0xb0a91b){if(_0xb0a91b){var _0x2d3f3c=_0xb0a91b['get']({'plain':!![]});fs['mkdirSync'](_0x4bfe44);var _0x3df4ac={'channel':_0x7cab('0xdc'),'account':_0x2d3f3c['Account'][_0x7cab('0x2a')],'agent':_0x2d3f3c[_0x7cab('0xdb')]?_0x2d3f3c[_0x7cab('0xdb')][_0x7cab('0x2c')]:_0x7cab('0xdd'),'createdAt':moment(_0x2d3f3c[_0x7cab('0x76')])[_0x7cab('0xc1')](_0x7cab('0xde'))[_0x7cab('0x99')](),'closedAt':_0x2d3f3c['closed']?moment(_0x2d3f3c[_0x7cab('0xdf')])[_0x7cab('0xc1')](_0x7cab('0xde'))[_0x7cab('0x99')]():'','disposition':_0x2d3f3c[_0x7cab('0xe0')],'visibility':_0x2d3f3c[_0x7cab('0xe1')]?_0x7cab('0xe2'):_0x7cab('0xe3'),'messages':_(_0x2d3f3c[_0x7cab('0xd6')])[_0x7cab('0x82')]({'secret':![]})[_0x7cab('0x38')](function(_0xa5acf8){if(_0xa5acf8[_0x7cab('0xd5')]){var _0xeb2e08=path['join'](_0x1bb321,_0xa5acf8[_0x7cab('0xd5')][_0x7cab('0xe4')]);if(fs[_0x7cab('0xe5')](_0xeb2e08)){fs[_0x7cab('0xe6')](_0xeb2e08)[_0x7cab('0xe7')](fs[_0x7cab('0xe8')](path[_0x7cab('0xcc')](_0x4bfe44,_0xa5acf8[_0x7cab('0xd5')][_0x7cab('0xe4')])));}}return{'date':moment(_0xa5acf8[_0x7cab('0x76')])['format'](_0x7cab('0xde'))[_0x7cab('0x99')](),'sender':_0xa5acf8[_0x7cab('0xd7')]===_0x7cab('0xe9')?_0xa5acf8[_0x7cab('0x71')]?_0xa5acf8[_0x7cab('0x71')][_0x7cab('0x2c')]:_0x7cab('0xea'):_0xa5acf8[_0x7cab('0x66')]['firstName']+(_0xa5acf8[_0x7cab('0x66')]['lastName']?'\x20'+_0xa5acf8[_0x7cab('0x66')][_0x7cab('0xd4')]:''),'body':_0xa5acf8['Attachment']?_0xa5acf8['Attachment']['basename']:_0xa5acf8[_0x7cab('0xb9')],'direction':_0xa5acf8[_0x7cab('0xd7')]==='out'?'A':'C','secret':_0xa5acf8[_0x7cab('0xd8')],'read':_0xa5acf8['read'],'attachment':_0xa5acf8[_0x7cab('0xd5')]};})[_0x7cab('0x62')]()};return ejs[_0x7cab('0xeb')](path['join'](config[_0x7cab('0xcd')],_0x7cab('0xcf'),_0x7cab('0xec'),_0x7cab('0xed')),{'interaction':_0x3df4ac})[_0x7cab('0x25')](function(_0x222180){var _0x2c767a=path[_0x7cab('0xcc')](_0x4bfe44,_0x7cab('0xee')+_0x2d3f3c['id']+'-'+_0x367e10+'.pdf');var _0x47826b={'path':_0x2c767a,'channel':_0x7cab('0xdc'),'interactionId':_0x2d3f3c['id']};return pdf['createPdfFromHTML'](_0x222180,_0x47826b);})['then'](function(){return new BPromise(function(_0x5757d1,_0x87df7d){zipdir(_0x4bfe44,{'saveTo':_0x48beae},function(_0x2e15ec,_0x6f2e69){if(_0x2e15ec)return _0x87df7d(_0x2e15ec);return _0x5757d1(_0x6f2e69);});})[_0x7cab('0x25')](function(){return new BPromise(function(_0x43d5db,_0xe73d91){rimraf(_0x4bfe44,function(_0x273082){if(_0x273082)_0xe73d91(_0x273082);return _0x43d5db();});});})[_0x7cab('0x25')](function(){return _0x56ae63[_0x7cab('0xef')](_0x48beae,_0x1e33ed,function(_0x54b0ba){if(_0x54b0ba){console[_0x7cab('0xf0')]('err',_0x54b0ba);}else{fs[_0x7cab('0xf1')](_0x48beae);}});});});}else{return _0x56ae63[_0x7cab('0x28')](0xc8);}})[_0x7cab('0x31')](handleError(_0x56ae63,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 083fcf7..c6438b7 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 _0x8038=['exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','hook'];(function(_0x282acb,_0x3b4c70){var _0x417490=function(_0x1b2c5c){while(--_0x1b2c5c){_0x282acb['push'](_0x282acb['shift']());}};_0x417490(++_0x3b4c70);}(_0x8038,0x145));var _0x8803=function(_0x785e7f,_0x1455c8){_0x785e7f=_0x785e7f-0x0;var _0x455072=_0x8038[_0x785e7f];return _0x455072;};'use strict';var EventEmitter=require(_0x8803('0x0'));var OpenchannelInteraction=require(_0x8803('0x1'))['db'][_0x8803('0x2')];var OpenchannelMessage=require(_0x8803('0x1'))['db'][_0x8803('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8803('0x4')](0x0);var events={'afterCreate':_0x8803('0x5'),'afterUpdate':_0x8803('0x6'),'afterDestroy':_0x8803('0x7')};function emitEvent(_0x1f9e23){return function(_0x209c40,_0x4e6566,_0x4d215f){_0x209c40['getUsers']({'attributes':['id'],'raw':!![]})[_0x8803('0x8')](function(_0x2937ec){_0x209c40[_0x8803('0x9')](_0x8803('0xa'),_0x2937ec[_0x8803('0xb')](function(_0x9b4682){return{'id':_0x9b4682['id']};}));return OpenchannelMessage[_0x8803('0xc')]({'where':{'OpenchannelInteractionId':_0x209c40['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8803('0x8')](function(_0x363a77){_0x209c40[_0x8803('0x9')](_0x8803('0xd'),_0x363a77['length']);OpenchannelInteractionEvents['emit'](_0x1f9e23+':'+_0x209c40['id'],_0x209c40);OpenchannelInteractionEvents[_0x8803('0xe')](_0x1f9e23,_0x209c40);_0x4d215f(null);})['catch'](_0x4d215f(null));};}for(var e in events){if(events[_0x8803('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x8803('0x10')](e,emitEvent(event));}}module[_0x8803('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x2efa=['OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb'];(function(_0x3d2899,_0x3133c7){var _0x2f0f7f=function(_0x4dbf96){while(--_0x4dbf96){_0x3d2899['push'](_0x3d2899['shift']());}};_0x2f0f7f(++_0x3133c7);}(_0x2efa,0x87));var _0xa2ef=function(_0x6a16c7,_0x2b9622){_0x6a16c7=_0x6a16c7-0x0;var _0xd05f43=_0x2efa[_0x6a16c7];return _0xd05f43;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xa2ef('0x0'))['db'][_0xa2ef('0x1')];var OpenchannelMessage=require(_0xa2ef('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xa2ef('0x2')](0x0);var events={'afterCreate':_0xa2ef('0x3'),'afterUpdate':_0xa2ef('0x4'),'afterDestroy':_0xa2ef('0x5')};function emitEvent(_0x36207d){return function(_0x3b7111,_0x243d41,_0x537bde){_0x3b7111[_0xa2ef('0x6')]({'attributes':['id'],'raw':!![]})[_0xa2ef('0x7')](function(_0x16a039){_0x3b7111['setDataValue'](_0xa2ef('0x8'),_0x16a039[_0xa2ef('0x9')](function(_0x4ae576){return{'id':_0x4ae576['id']};}));return OpenchannelMessage[_0xa2ef('0xa')]({'where':{'OpenchannelInteractionId':_0x3b7111['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa2ef('0x7')](function(_0x37f23f){_0x3b7111['setDataValue'](_0xa2ef('0xb'),_0x37f23f[_0xa2ef('0xc')]);OpenchannelInteractionEvents[_0xa2ef('0xd')](_0x36207d+':'+_0x3b7111['id'],_0x3b7111);OpenchannelInteractionEvents[_0xa2ef('0xd')](_0x36207d,_0x3b7111);_0x537bde(null);})[_0xa2ef('0xe')](_0x537bde(null));};}for(var e in events){if(events[_0xa2ef('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xa2ef('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index bc029c4..24a246c 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 _0x4ec0=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','define'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0x4ec0,0xf7));var _0x04ec=function(_0x5a3428,_0x31f15c){_0x5a3428=_0x5a3428-0x0;var _0x1c614d=_0x4ec0[_0x5a3428];return _0x1c614d;};'use strict';var _=require(_0x04ec('0x0'));var util=require('util');var logger=require(_0x04ec('0x1'))('api');var moment=require(_0x04ec('0x2'));var BPromise=require(_0x04ec('0x3'));var rp=require(_0x04ec('0x4'));var fs=require('fs');var path=require(_0x04ec('0x5'));var rimraf=require(_0x04ec('0x6'));var config=require('../../config/environment');var attributes=require(_0x04ec('0x7'));module['exports']=function(_0x2e6515,_0x2ea572){return _0x2e6515[_0x04ec('0x8')](_0x04ec('0x9'),attributes,{'tableName':_0x04ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x04ec('0xb'),'collate':_0x04ec('0xc'),'hooks':{'beforeUpdate':function(_0x170b6c,_0x4430b5,_0x2a022d){if(_0x170b6c['changed'](_0x04ec('0xd'))){_0x170b6c[_0x04ec('0xe')]=moment()[_0x04ec('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2a022d(null,_0x170b6c);}}});}; \ No newline at end of file +var _0xd447=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','define','OpenchannelInteraction'];(function(_0x23d9c,_0x2e536d){var _0x386f1b=function(_0x821f7){while(--_0x821f7){_0x23d9c['push'](_0x23d9c['shift']());}};_0x386f1b(++_0x2e536d);}(_0xd447,0xc8));var _0x7d44=function(_0x42b928,_0x157680){_0x42b928=_0x42b928-0x0;var _0xf15ebb=_0xd447[_0x42b928];return _0xf15ebb;};'use strict';var _=require('lodash');var util=require(_0x7d44('0x0'));var logger=require('../../config/logger')(_0x7d44('0x1'));var moment=require(_0x7d44('0x2'));var BPromise=require(_0x7d44('0x3'));var rp=require(_0x7d44('0x4'));var fs=require('fs');var path=require(_0x7d44('0x5'));var rimraf=require(_0x7d44('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d44('0x7'));module['exports']=function(_0x16ce5c,_0x13c3ad){return _0x16ce5c[_0x7d44('0x8')](_0x7d44('0x9'),attributes,{'tableName':_0x7d44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d44('0xb'),'collate':_0x7d44('0xc'),'hooks':{'beforeUpdate':function(_0x371bb0,_0x292683,_0x427e43){if(_0x371bb0['changed']('closed')){_0x371bb0[_0x7d44('0xd')]=moment()['format'](_0x7d44('0xe'));}_0x427e43(null,_0x371bb0);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index d7b32fd..1f4fa4d 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 _0x6c9c=['where','attributes','then','AddTagsToOpenchannelInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options'];(function(_0x38d0fd,_0x5e7575){var _0x5d5b6f=function(_0x1cb2ac){while(--_0x1cb2ac){_0x38d0fd['push'](_0x38d0fd['shift']());}};_0x5d5b6f(++_0x5e7575);}(_0x6c9c,0xd2));var _0xc6c9=function(_0x3c7a73,_0x404687){_0x3c7a73=_0x3c7a73-0x0;var _0x3dd066=_0x6c9c[_0x3c7a73];return _0x3dd066;};'use strict';var _=require(_0xc6c9('0x0'));var util=require(_0xc6c9('0x1'));var moment=require('moment');var BPromise=require(_0xc6c9('0x2'));var rs=require(_0xc6c9('0x3'));var fs=require('fs');var Redis=require(_0xc6c9('0x4'));var db=require(_0xc6c9('0x5'))['db'];var utils=require(_0xc6c9('0x6'));var logger=require(_0xc6c9('0x7'))(_0xc6c9('0x8'));var config=require(_0xc6c9('0x9'));var jayson=require(_0xc6c9('0xa'));var client=jayson[_0xc6c9('0xb')]['http']({'port':0x232a});config[_0xc6c9('0xc')]=_[_0xc6c9('0xd')](config[_0xc6c9('0xc')],{'host':_0xc6c9('0xe'),'port':0x18eb});var socket=require(_0xc6c9('0xf'))(new Redis(config[_0xc6c9('0xc')]));require('./openchannelInteraction.socket')[_0xc6c9('0x10')](socket);function respondWithRpcPromise(_0x6aae0b,_0x57ad00,_0x153a61){return new BPromise(function(_0x3a5a52,_0x1061fd){return client['request'](_0x6aae0b,_0x153a61)['then'](function(_0x458f17){logger[_0xc6c9('0x11')](_0xc6c9('0x12'),_0x57ad00,'request\x20sent');logger[_0xc6c9('0x13')](_0xc6c9('0x14'),_0x57ad00,_0xc6c9('0x15'),JSON[_0xc6c9('0x16')](_0x458f17));if(_0x458f17[_0xc6c9('0x17')]){if(_0x458f17[_0xc6c9('0x17')][_0xc6c9('0x18')]===0x1f4){logger[_0xc6c9('0x17')](_0xc6c9('0x12'),_0x57ad00,_0x458f17[_0xc6c9('0x17')][_0xc6c9('0x19')]);return _0x1061fd(_0x458f17[_0xc6c9('0x17')][_0xc6c9('0x19')]);}logger['error'](_0xc6c9('0x12'),_0x57ad00,_0x458f17[_0xc6c9('0x17')][_0xc6c9('0x19')]);return _0x3a5a52(_0x458f17[_0xc6c9('0x17')][_0xc6c9('0x19')]);}else{logger['info'](_0xc6c9('0x12'),_0x57ad00,_0xc6c9('0x15'));_0x3a5a52(_0x458f17['result'][_0xc6c9('0x19')]);}})[_0xc6c9('0x1a')](function(_0xa6a0f5){logger[_0xc6c9('0x17')](_0xc6c9('0x12'),_0x57ad00,_0xa6a0f5);_0x1061fd(_0xa6a0f5);});});}exports[_0xc6c9('0x1b')]=function(_0x5148f2){var _0x2d88f3=this;return new Promise(function(_0x1e0eeb,_0x53f5f8){return db[_0xc6c9('0x1c')]['update'](_0x5148f2['body'],{'raw':_0x5148f2[_0xc6c9('0x1d')]?_0x5148f2[_0xc6c9('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5148f2[_0xc6c9('0x1d')]?_0x5148f2[_0xc6c9('0x1d')][_0xc6c9('0x1e')]||null:null,'attributes':_0x5148f2[_0xc6c9('0x1d')]?_0x5148f2[_0xc6c9('0x1d')][_0xc6c9('0x1f')]||null:null,'limit':_0x5148f2[_0xc6c9('0x1d')]?_0x5148f2[_0xc6c9('0x1d')]['limit']||null:null})[_0xc6c9('0x20')](function(_0x489887){logger[_0xc6c9('0x11')](_0xc6c9('0x1b'),_0x5148f2);logger[_0xc6c9('0x13')](_0xc6c9('0x1b'),_0x5148f2,JSON[_0xc6c9('0x16')](_0x489887));_0x1e0eeb(_0x489887);})[_0xc6c9('0x1a')](function(_0x37c5d8){logger[_0xc6c9('0x17')](_0xc6c9('0x1b'),_0x37c5d8[_0xc6c9('0x19')],_0x5148f2);_0x53f5f8(_0x2d88f3[_0xc6c9('0x17')](0x1f4,_0x37c5d8[_0xc6c9('0x19')]));});});};exports[_0xc6c9('0x21')]=function(_0x38b5d8){return new Promise(function(_0xf3dd67,_0x1270bd){return db[_0xc6c9('0x1c')]['find']({'where':_0x38b5d8[_0xc6c9('0x1d')]?_0x38b5d8['options'][_0xc6c9('0x1e')]||null:null})['then'](function(_0x1a300e){if(_0x1a300e){return _0x1a300e[_0xc6c9('0x22')](_0x38b5d8[_0xc6c9('0x23')][_0xc6c9('0x24')],_[_0xc6c9('0x25')](_0x38b5d8['body'],[_0xc6c9('0x24'),'id'])||{});}})[_0xc6c9('0x26')](function(_0x33e630){logger[_0xc6c9('0x11')](_0xc6c9('0x27'),_0x38b5d8);logger[_0xc6c9('0x13')](_0xc6c9('0x27'),_0x38b5d8,JSON[_0xc6c9('0x16')](_0x33e630));_0xf3dd67(_0x33e630);})[_0xc6c9('0x1a')](function(_0x1f3a11){logger['error'](_0xc6c9('0x27'),_0x1f3a11['message'],_0x38b5d8);_0x1270bd(_this['error'](0x1f4,_0x1f3a11[_0xc6c9('0x19')]));});});}; \ No newline at end of file +var _0xf68c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','find','where','addTags','omit','ids','AddTags','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x3b9617,_0x3194cb){var _0x590400=function(_0x6d0f4f){while(--_0x6d0f4f){_0x3b9617['push'](_0x3b9617['shift']());}};_0x590400(++_0x3194cb);}(_0xf68c,0x82));var _0xcf68=function(_0x22037e,_0x2440ff){_0x22037e=_0x22037e-0x0;var _0x1f1d86=_0xf68c[_0x22037e];return _0x1f1d86;};'use strict';var _=require(_0xcf68('0x0'));var util=require(_0xcf68('0x1'));var moment=require(_0xcf68('0x2'));var BPromise=require(_0xcf68('0x3'));var rs=require(_0xcf68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf68('0x6'))(_0xcf68('0x7'));var config=require(_0xcf68('0x8'));var jayson=require(_0xcf68('0x9'));var client=jayson[_0xcf68('0xa')][_0xcf68('0xb')]({'port':0x232a});config['redis']=_[_0xcf68('0xc')](config[_0xcf68('0xd')],{'host':_0xcf68('0xe'),'port':0x18eb});var socket=require(_0xcf68('0xf'))(new Redis(config[_0xcf68('0xd')]));require(_0xcf68('0x10'))[_0xcf68('0x11')](socket);function respondWithRpcPromise(_0x7f049d,_0x210b8b,_0x530c8b){return new BPromise(function(_0x453937,_0x5c340b){return client[_0xcf68('0x12')](_0x7f049d,_0x530c8b)['then'](function(_0x574a11){logger[_0xcf68('0x13')](_0xcf68('0x14'),_0x210b8b,'request\x20sent');logger['debug'](_0xcf68('0x15'),_0x210b8b,_0xcf68('0x16'),JSON[_0xcf68('0x17')](_0x574a11));if(_0x574a11[_0xcf68('0x18')]){if(_0x574a11[_0xcf68('0x18')][_0xcf68('0x19')]===0x1f4){logger[_0xcf68('0x18')](_0xcf68('0x14'),_0x210b8b,_0x574a11[_0xcf68('0x18')]['message']);return _0x5c340b(_0x574a11[_0xcf68('0x18')]['message']);}logger[_0xcf68('0x18')](_0xcf68('0x14'),_0x210b8b,_0x574a11[_0xcf68('0x18')][_0xcf68('0x1a')]);return _0x453937(_0x574a11[_0xcf68('0x18')]['message']);}else{logger[_0xcf68('0x13')](_0xcf68('0x14'),_0x210b8b,'request\x20sent');_0x453937(_0x574a11[_0xcf68('0x1b')][_0xcf68('0x1a')]);}})[_0xcf68('0x1c')](function(_0x228e74){logger[_0xcf68('0x18')](_0xcf68('0x14'),_0x210b8b,_0x228e74);_0x5c340b(_0x228e74);});});}exports[_0xcf68('0x1d')]=function(_0x303132){var _0x123be3=this;return new Promise(function(_0x4bfb99,_0x59cc34){return db[_0xcf68('0x1e')][_0xcf68('0x1f')](_0x303132[_0xcf68('0x20')],{'raw':_0x303132[_0xcf68('0x21')]?_0x303132[_0xcf68('0x21')][_0xcf68('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x303132[_0xcf68('0x21')]?_0x303132['options']['where']||null:null,'attributes':_0x303132[_0xcf68('0x21')]?_0x303132[_0xcf68('0x21')][_0xcf68('0x23')]||null:null,'limit':_0x303132[_0xcf68('0x21')]?_0x303132[_0xcf68('0x21')][_0xcf68('0x24')]||null:null})['then'](function(_0x574494){logger[_0xcf68('0x13')](_0xcf68('0x1d'),_0x303132);logger['debug'](_0xcf68('0x1d'),_0x303132,JSON[_0xcf68('0x17')](_0x574494));_0x4bfb99(_0x574494);})[_0xcf68('0x1c')](function(_0x3351ca){logger[_0xcf68('0x18')]('UpdateOpenchannelInteraction',_0x3351ca[_0xcf68('0x1a')],_0x303132);_0x59cc34(_0x123be3[_0xcf68('0x18')](0x1f4,_0x3351ca[_0xcf68('0x1a')]));});});};exports[_0xcf68('0x25')]=function(_0x4fe86a){return new Promise(function(_0x2a5d1c,_0x2467c5){return db[_0xcf68('0x1e')][_0xcf68('0x26')]({'where':_0x4fe86a[_0xcf68('0x21')]?_0x4fe86a['options'][_0xcf68('0x27')]||null:null})['then'](function(_0x2ab02a){if(_0x2ab02a){return _0x2ab02a[_0xcf68('0x28')](_0x4fe86a[_0xcf68('0x20')]['ids'],_[_0xcf68('0x29')](_0x4fe86a[_0xcf68('0x20')],[_0xcf68('0x2a'),'id'])||{});}})['spread'](function(_0x7c2b52){logger[_0xcf68('0x13')](_0xcf68('0x2b'),_0x4fe86a);logger[_0xcf68('0x2c')](_0xcf68('0x2b'),_0x4fe86a,JSON['stringify'](_0x7c2b52));_0x2a5d1c(_0x7c2b52);})['catch'](function(_0x4d08fe){logger[_0xcf68('0x18')]('AddTags',_0x4d08fe['message'],_0x4fe86a);_0x2467c5(_this[_0xcf68('0x18')](0x1f4,_0x4d08fe[_0xcf68('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 547239c..46b2514 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 _0x7a3d=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x5201b5,_0x24513c){var _0x57c9c4=function(_0x2e48a3){while(--_0x2e48a3){_0x5201b5['push'](_0x5201b5['shift']());}};_0x57c9c4(++_0x24513c);}(_0x7a3d,0x97));var _0xd7a3=function(_0x3b0eb5,_0x2f028e){_0x3b0eb5=_0x3b0eb5-0x0;var _0x16415f=_0x7a3d[_0x3b0eb5];return _0x16415f;};'use strict';var OpenchannelInteractionEvents=require(_0xd7a3('0x0'));var events=[_0xd7a3('0x1'),_0xd7a3('0x2'),'update'];function createListener(_0x4dc9cb,_0x366da5){return function(_0xe2ad3a){_0x366da5['emit'](_0x4dc9cb,_0xe2ad3a);};}function removeListener(_0x471143,_0x3277ab){return function(){OpenchannelInteractionEvents[_0xd7a3('0x3')](_0x471143,_0x3277ab);};}exports[_0xd7a3('0x4')]=function(_0x6fbfe3){for(var _0x11826b=0x0,_0x3cdd15=events[_0xd7a3('0x5')];_0x11826b<_0x3cdd15;_0x11826b++){var _0x184818=events[_0x11826b];var _0x3f3b23=createListener(_0xd7a3('0x6')+_0x184818,_0x6fbfe3);OpenchannelInteractionEvents['on'](_0x184818,_0x3f3b23);}}; \ No newline at end of file +var _0xf235=['register','length','./openchannelInteraction.events','remove','update','emit'];(function(_0x29a5ea,_0x41a558){var _0xc9cc8b=function(_0x164bc4){while(--_0x164bc4){_0x29a5ea['push'](_0x29a5ea['shift']());}};_0xc9cc8b(++_0x41a558);}(_0xf235,0x170));var _0x5f23=function(_0x46d992,_0x4ac0dc){_0x46d992=_0x46d992-0x0;var _0x8d6adf=_0xf235[_0x46d992];return _0x8d6adf;};'use strict';var OpenchannelInteractionEvents=require(_0x5f23('0x0'));var events=['save',_0x5f23('0x1'),_0x5f23('0x2')];function createListener(_0x509f2b,_0x4723b1){return function(_0x1768b8){_0x4723b1[_0x5f23('0x3')](_0x509f2b,_0x1768b8);};}function removeListener(_0x3c9e08,_0x106fe1){return function(){OpenchannelInteractionEvents['removeListener'](_0x3c9e08,_0x106fe1);};}exports[_0x5f23('0x4')]=function(_0x458735){for(var _0xa293d5=0x0,_0x59035a=events[_0x5f23('0x5')];_0xa293d5<_0x59035a;_0xa293d5++){var _0x3cc9a9=events[_0xa293d5];var _0x577755=createListener('openchannelInteraction:'+_0x3cc9a9,_0x458735);OpenchannelInteractionEvents['on'](_0x3cc9a9,_0x577755);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e4d99f9..360f276 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(_0xe6f4ef,_0x4e34cc){var _0x4f3447=function(_0x1538ff){while(--_0x1538ff){_0xe6f4ef['push'](_0xe6f4ef['shift']());}};_0x4f3447(++_0x4e34cc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0xcb91[_0x41ee16];return _0x1f60de;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x5cc0b7,_0x94b26b){_0x5cc0b7=_0x5cc0b7-0x0;var _0x2cf1da=_0x70e0[_0x5cc0b7];return _0x2cf1da;};'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 411c437..b8488a1 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 _0xd139=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x9c305d,_0x5618a5){var _0x1b8f08=function(_0x2398bd){while(--_0x2398bd){_0x9c305d['push'](_0x9c305d['shift']());}};_0x1b8f08(++_0x5618a5);}(_0xd139,0x14e));var _0x9d13=function(_0x4f5148,_0x46447f){_0x4f5148=_0x4f5148-0x0;var _0x19c117=_0xd139[_0x4f5148];return _0x19c117;};'use strict';var Sequelize=require(_0x9d13('0x0'));module[_0x9d13('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9d13('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9d13('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9d13('0x3')]('in',_0x9d13('0x4')),'defaultValue':_0x9d13('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9d13('0x5')]},'providerName':{'type':Sequelize[_0x9d13('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb846=['STRING','TEXT','sequelize','medium','BOOLEAN','ENUM','DATE'];(function(_0x3159c0,_0x592776){var _0x12411f=function(_0x3b7d17){while(--_0x3b7d17){_0x3159c0['push'](_0x3159c0['shift']());}};_0x12411f(++_0x592776);}(_0xb846,0x1d0));var _0x6b84=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb846[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x6b84('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x6b84('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6b84('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6b84('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b84('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x6b84('0x4')]},'providerName':{'type':Sequelize[_0x6b84('0x5')]},'providerResponse':{'type':Sequelize[_0x6b84('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b636c65..3f121c0 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 _0xc6e5=['openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','event','accept','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','Sequelize','QueryTypes','email','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','offset','undefined','limit','count','reject','save','destroy','end','stack','name','send','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','filter','options','OpenchannelMessage','includeAll','include','findAll','then','rows','show','params','rawAttributes','merge','find','create','body','update','describe','openchannel-interactions'];(function(_0x58cf2b,_0x1196d0){var _0x808b7f=function(_0x33d4e6){while(--_0x33d4e6){_0x58cf2b['push'](_0x58cf2b['shift']());}};_0x808b7f(++_0x1196d0);}(_0xc6e5,0x192));var _0x5c6e=function(_0x36f2db,_0x28526f){_0x36f2db=_0x36f2db-0x0;var _0x844db1=_0xc6e5[_0x36f2db];return _0x844db1;};'use strict';var emlformat=require(_0x5c6e('0x0'));var rimraf=require(_0x5c6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c6e('0x2'));var rp=require(_0x5c6e('0x3'));var moment=require(_0x5c6e('0x4'));var BPromise=require(_0x5c6e('0x5'));var Mustache=require('mustache');var util=require(_0x5c6e('0x6'));var path=require('path');var sox=require(_0x5c6e('0x7'));var csv=require('to-csv');var ejs=require(_0x5c6e('0x8'));var fs=require('fs');var fs_extra=require(_0x5c6e('0x9'));var _=require(_0x5c6e('0xa'));var squel=require(_0x5c6e('0xb'));var crypto=require(_0x5c6e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5c6e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5c6e('0xe'));var Redis=require(_0x5c6e('0xf'));var authService=require(_0x5c6e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5c6e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c6e('0x12'))(_0x5c6e('0x13'));var utils=require(_0x5c6e('0x14'));var config=require(_0x5c6e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5c6e('0x16')]=_[_0x5c6e('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5c6e('0x18'))(new Redis(config[_0x5c6e('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x5c6e('0x19'));var client=jayson[_0x5c6e('0x1a')][_0x5c6e('0x1b')]({'port':0x232c});var client9002=jayson[_0x5c6e('0x1a')][_0x5c6e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2c433a,_0x58081b,_0x194547,_0x4ba434){return new BPromise(function(_0x31b288,_0x480a3e){var _0x3e7aab=_0x4ba434||client;return _0x3e7aab[_0x5c6e('0x1c')](_0x2c433a,_0x194547)['then'](function(_0x448f73){logger[_0x5c6e('0x1d')](_0x5c6e('0x1e'),_0x58081b,_0x5c6e('0x1f'));logger[_0x5c6e('0x20')](_0x5c6e('0x21'),_0x58081b,'request\x20sent',JSON[_0x5c6e('0x22')](_0x448f73));if(_0x448f73[_0x5c6e('0x23')]){if(_0x448f73['error']['code']===0x1f4){logger['error'](_0x5c6e('0x1e'),_0x58081b,_0x448f73[_0x5c6e('0x23')][_0x5c6e('0x24')]);return _0x480a3e(_0x448f73[_0x5c6e('0x23')][_0x5c6e('0x24')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x58081b,_0x448f73[_0x5c6e('0x23')][_0x5c6e('0x24')]);return _0x31b288(_0x448f73[_0x5c6e('0x23')][_0x5c6e('0x24')]);}else{logger['info'](_0x5c6e('0x1e'),_0x58081b,'request\x20sent');_0x31b288(_0x448f73['result'][_0x5c6e('0x24')]);}})[_0x5c6e('0x25')](function(_0x4b3a1c){logger['error'](_0x5c6e('0x1e'),_0x58081b,_0x4b3a1c);_0x480a3e(_0x4b3a1c);});});}function respondWithStatusCode(_0x523fe8,_0x4b55cb){_0x4b55cb=_0x4b55cb||0xcc;return function(_0x2b58f8){if(_0x2b58f8){return _0x523fe8['sendStatus'](_0x4b55cb);}return _0x523fe8[_0x5c6e('0x26')](_0x4b55cb)['end']();};}function respondWithResult(_0x3981a9,_0x484788){_0x484788=_0x484788||0xc8;return function(_0x5eb973){if(_0x5eb973){return _0x3981a9['status'](_0x484788)[_0x5c6e('0x27')](_0x5eb973);}};}function respondWithFilteredResult(_0x293538,_0x7d4ba0){return function(_0x39d94e){if(_0x39d94e){var _0x5914c2=typeof _0x7d4ba0[_0x5c6e('0x28')]===_0x5c6e('0x29')&&typeof _0x7d4ba0[_0x5c6e('0x2a')]===_0x5c6e('0x29');var _0x2d9e5f=_0x39d94e['count'];var _0x895a42=_0x5914c2?0x0:_0x7d4ba0[_0x5c6e('0x28')];var _0xb2faee=_0x5914c2?_0x39d94e[_0x5c6e('0x2b')]:_0x7d4ba0[_0x5c6e('0x28')]+_0x7d4ba0[_0x5c6e('0x2a')];var _0x30982c;if(_0xb2faee>=_0x2d9e5f){_0xb2faee=_0x2d9e5f;_0x30982c=0xc8;}else{_0x30982c=0xce;}_0x293538[_0x5c6e('0x26')](_0x30982c);return _0x293538['set']('Content-Range',_0x895a42+'-'+_0xb2faee+'/'+_0x2d9e5f)[_0x5c6e('0x27')](_0x39d94e);}return null;};}function patchUpdates(_0x58bbe2){return function(_0x1f5e96){try{jsonpatch['apply'](_0x1f5e96,_0x58bbe2,!![]);}catch(_0x522138){return BPromise[_0x5c6e('0x2c')](_0x522138);}return _0x1f5e96[_0x5c6e('0x2d')]();};}function saveUpdates(_0x3d93e5,_0x4e58f6){return function(_0x2d228d){if(_0x2d228d){return _0x2d228d['update'](_0x3d93e5)['then'](function(_0x8b697d){return _0x8b697d;});}return null;};}function removeEntity(_0x3132b5,_0xb498ef){return function(_0x1d1d1b){if(_0x1d1d1b){return _0x1d1d1b[_0x5c6e('0x2e')]()['then'](function(){_0x3132b5[_0x5c6e('0x26')](0xcc)[_0x5c6e('0x2f')]();});}};}function handleEntityNotFound(_0x1edaae,_0x281f57){return function(_0x35c977){if(!_0x35c977){_0x1edaae['sendStatus'](0x194);}return _0x35c977;};}function handleError(_0x5bdfff,_0x57ea2a){_0x57ea2a=_0x57ea2a||0x1f4;return function(_0xac0314){logger[_0x5c6e('0x23')](_0xac0314[_0x5c6e('0x30')]);if(_0xac0314[_0x5c6e('0x31')]){delete _0xac0314['name'];}_0x5bdfff[_0x5c6e('0x26')](_0x57ea2a)[_0x5c6e('0x32')](_0xac0314);};}exports['index']=function(_0xbd3099,_0x419737){var _0x2a155f={},_0x3267ea={},_0x4d3e45={'count':0x0,'rows':[]};var _0x1ee3c4=_['map'](db['OpenchannelMessage']['rawAttributes'],function(_0x22ff18){return{'name':_0x22ff18['fieldName'],'type':_0x22ff18[_0x5c6e('0x33')][_0x5c6e('0x34')]};});_0x3267ea['model']=_['map'](_0x1ee3c4,_0x5c6e('0x31'));_0x3267ea[_0x5c6e('0x35')]=_[_0x5c6e('0x36')](_0xbd3099[_0x5c6e('0x35')]);_0x3267ea[_0x5c6e('0x37')]=_[_0x5c6e('0x38')](_0x3267ea[_0x5c6e('0x39')],_0x3267ea[_0x5c6e('0x35')]);_0x2a155f[_0x5c6e('0x3a')]=_[_0x5c6e('0x38')](_0x3267ea[_0x5c6e('0x39')],qs['fields'](_0xbd3099[_0x5c6e('0x35')][_0x5c6e('0x3b')]));_0x2a155f[_0x5c6e('0x3a')]=_0x2a155f[_0x5c6e('0x3a')][_0x5c6e('0x3c')]?_0x2a155f['attributes']:_0x3267ea[_0x5c6e('0x39')];if(!_0xbd3099[_0x5c6e('0x35')][_0x5c6e('0x3d')]('nolimit')){_0x2a155f[_0x5c6e('0x2a')]=qs[_0x5c6e('0x2a')](_0xbd3099[_0x5c6e('0x35')][_0x5c6e('0x2a')]);_0x2a155f[_0x5c6e('0x28')]=qs[_0x5c6e('0x28')](_0xbd3099[_0x5c6e('0x35')][_0x5c6e('0x28')]);}_0x2a155f[_0x5c6e('0x3e')]=qs[_0x5c6e('0x3f')](_0xbd3099[_0x5c6e('0x35')][_0x5c6e('0x3f')]);_0x2a155f[_0x5c6e('0x40')]=qs[_0x5c6e('0x37')](_[_0x5c6e('0x41')](_0xbd3099[_0x5c6e('0x35')],_0x3267ea[_0x5c6e('0x37')]),_0x1ee3c4);if(_0xbd3099[_0x5c6e('0x35')]['filter']){_0x2a155f[_0x5c6e('0x40')]=_['merge'](_0x2a155f[_0x5c6e('0x40')],{'$or':_[_0x5c6e('0x42')](_0x1ee3c4,function(_0x309e26){if(_0x309e26[_0x5c6e('0x33')]!==_0x5c6e('0x43')){var _0x53d9ea={};_0x53d9ea[_0x309e26[_0x5c6e('0x31')]]={'$like':'%'+_0xbd3099[_0x5c6e('0x35')][_0x5c6e('0x44')]+'%'};return _0x53d9ea;}})});}_0x2a155f=_['merge']({},_0x2a155f,_0xbd3099[_0x5c6e('0x45')]);var _0x17f928={'where':_0x2a155f['where']};return db[_0x5c6e('0x46')][_0x5c6e('0x2b')](_0x17f928)['then'](function(_0x288c44){_0x4d3e45['count']=_0x288c44;if(_0xbd3099[_0x5c6e('0x35')][_0x5c6e('0x47')]){_0x2a155f[_0x5c6e('0x48')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x5c6e('0x49')](_0x2a155f);})[_0x5c6e('0x4a')](function(_0x21e590){_0x4d3e45[_0x5c6e('0x4b')]=_0x21e590;return _0x4d3e45;})[_0x5c6e('0x4a')](respondWithFilteredResult(_0x419737,_0x2a155f))[_0x5c6e('0x25')](handleError(_0x419737,null));};exports[_0x5c6e('0x4c')]=function(_0x429c12,_0x3b2acf){var _0x541022={'raw':!![],'where':{'id':_0x429c12[_0x5c6e('0x4d')]['id']}},_0x40b78a={};_0x40b78a[_0x5c6e('0x39')]=_[_0x5c6e('0x36')](db[_0x5c6e('0x46')][_0x5c6e('0x4e')]);_0x40b78a[_0x5c6e('0x35')]=_[_0x5c6e('0x36')](_0x429c12[_0x5c6e('0x35')]);_0x40b78a[_0x5c6e('0x37')]=_[_0x5c6e('0x38')](_0x40b78a[_0x5c6e('0x39')],_0x40b78a[_0x5c6e('0x35')]);_0x541022['attributes']=_[_0x5c6e('0x38')](_0x40b78a[_0x5c6e('0x39')],qs[_0x5c6e('0x3b')](_0x429c12[_0x5c6e('0x35')][_0x5c6e('0x3b')]));_0x541022[_0x5c6e('0x3a')]=_0x541022[_0x5c6e('0x3a')][_0x5c6e('0x3c')]?_0x541022['attributes']:_0x40b78a[_0x5c6e('0x39')];if(_0x429c12[_0x5c6e('0x35')][_0x5c6e('0x47')]){_0x541022[_0x5c6e('0x48')]=[{'all':!![]}];}_0x541022=_[_0x5c6e('0x4f')]({},_0x541022,_0x429c12[_0x5c6e('0x45')]);return db[_0x5c6e('0x46')][_0x5c6e('0x50')](_0x541022)['then'](handleEntityNotFound(_0x3b2acf,null))[_0x5c6e('0x4a')](respondWithResult(_0x3b2acf,null))['catch'](handleError(_0x3b2acf,null));};exports[_0x5c6e('0x51')]=function(_0x23bc64,_0x3ec226){return db[_0x5c6e('0x46')][_0x5c6e('0x51')](_0x23bc64[_0x5c6e('0x52')],{})[_0x5c6e('0x4a')](respondWithResult(_0x3ec226,0xc9))['catch'](handleError(_0x3ec226,null));};exports[_0x5c6e('0x53')]=function(_0x4f3364,_0x2a574a){if(_0x4f3364[_0x5c6e('0x52')]['id']){delete _0x4f3364[_0x5c6e('0x52')]['id'];}return db[_0x5c6e('0x46')][_0x5c6e('0x50')]({'where':{'id':_0x4f3364['params']['id']}})[_0x5c6e('0x4a')](handleEntityNotFound(_0x2a574a,null))[_0x5c6e('0x4a')](saveUpdates(_0x4f3364[_0x5c6e('0x52')],null))[_0x5c6e('0x4a')](respondWithResult(_0x2a574a,null))['catch'](handleError(_0x2a574a,null));};exports[_0x5c6e('0x2e')]=function(_0x1c747e,_0x1e77d4){return db[_0x5c6e('0x46')][_0x5c6e('0x50')]({'where':{'id':_0x1c747e[_0x5c6e('0x4d')]['id']}})[_0x5c6e('0x4a')](handleEntityNotFound(_0x1e77d4,null))[_0x5c6e('0x4a')](removeEntity(_0x1e77d4,null))[_0x5c6e('0x25')](handleError(_0x1e77d4,null));};exports[_0x5c6e('0x54')]=function(_0x186239,_0x1eb979){return db[_0x5c6e('0x46')][_0x5c6e('0x54')]()[_0x5c6e('0x4a')](respondWithResult(_0x1eb979,null))[_0x5c6e('0x25')](handleError(_0x1eb979,null));};var interaction_log=require(_0x5c6e('0x12'))(_0x5c6e('0x55'));exports['accept']=function(_0x126c69,_0x2c3d57,_0x1af935){var _0x17621e={'agent':{},'channel':_0x5c6e('0x56')};if(_0x126c69[_0x5c6e('0x52')]['id']){delete _0x126c69[_0x5c6e('0x52')]['id'];}_0x126c69[_0x5c6e('0x52')][_0x5c6e('0x57')]=!![];_0x126c69[_0x5c6e('0x52')][_0x5c6e('0x58')]=moment()[_0x5c6e('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x126c69[_0x5c6e('0x52')][_0x5c6e('0x5a')]=_0x126c69[_0x5c6e('0x52')]['UserId']||_0x126c69[_0x5c6e('0x5b')]['id'];_0x17621e[_0x5c6e('0x5c')]['id']=_0x126c69[_0x5c6e('0x52')][_0x5c6e('0x5a')];return db[_0x5c6e('0x46')][_0x5c6e('0x50')]({'where':{'id':_0x126c69[_0x5c6e('0x4d')]['id'],'UserId':null}})[_0x5c6e('0x4a')](handleEntityNotFound(_0x2c3d57,null))[_0x5c6e('0x4a')](saveUpdates(_0x126c69['body'],null))[_0x5c6e('0x4a')](function(_0x373be4){if(_0x373be4){_0x17621e[_0x5c6e('0x24')]=_0x373be4[_0x5c6e('0x5d')]({'plain':!![]});return db[_0x5c6e('0x5e')]['find']({'where':{'id':_0x373be4[_0x5c6e('0x5f')]}});}return null;})[_0x5c6e('0x4a')](handleEntityNotFound(_0x2c3d57,null))[_0x5c6e('0x4a')](function(_0x475c2c){if(_0x475c2c){return _0x475c2c[_0x5c6e('0x53')]({'UserId':_0x126c69[_0x5c6e('0x52')][_0x5c6e('0x5a')],'read1stAt':_[_0x5c6e('0x60')](_0x475c2c[_0x5c6e('0x61')])?moment()[_0x5c6e('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5c6e('0x4a')](function(_0x1a3cf2){if(_0x1a3cf2){_0x17621e[_0x5c6e('0x62')]=_0x1a3cf2[_0x5c6e('0x5d')]({'plain':!![]});interaction_log[_0x5c6e('0x1d')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x126c69[_0x5c6e('0x5b')]['id'],_0x126c69['user'][_0x5c6e('0x31')],_0x126c69[_0x5c6e('0x5b')][_0x5c6e('0x63')],_0x17621e[_0x5c6e('0x62')]['id'],_0x126c69[_0x5c6e('0x52')]?JSON[_0x5c6e('0x22')](_0x126c69[_0x5c6e('0x52')]):_0x5c6e('0x64'));return respondWithRpcPromise('AcceptMessage',_0x5c6e('0x65'),_0x17621e);}return null;})[_0x5c6e('0x4a')](function(_0x207923){var _0x28dbfb=_0x5c6e('0x66')+_0x207923[_0x5c6e('0x24')][_0x5c6e('0x67')];return db[_0x5c6e('0x68')][_0x5c6e('0x35')](_0x28dbfb,{'type':db['Sequelize']['QueryTypes'][_0x5c6e('0x69')],'raw':!![]})[_0x5c6e('0x4a')](function(_0x8fffb){return _0x8fffb;});})['then'](function(_0x3a1282){if(_0x3a1282){_0x17621e['message'][_0x5c6e('0x6a')]=_0x3a1282[0x0];if(!_0x126c69['body']['UserId'])return;return db[_0x5c6e('0x6b')]['find']({'where':{'id':_0x126c69[_0x5c6e('0x52')][_0x5c6e('0x5a')],'role':_0x5c6e('0x5c')},'attributes':['id',_0x5c6e('0x31'),_0x5c6e('0x6c'),'email',_0x5c6e('0x6d')],'raw':!![]});}return null;})[_0x5c6e('0x4a')](function(_0x5f5ade){if(!_0x5f5ade)return null;_0x17621e['message'][_0x5c6e('0x5c')]=_0x5f5ade;return _0x17621e;})['then'](function(_0x29133b){if(_0x29133b){if(_0x126c69[_0x5c6e('0x52')]['manual']){_0x17621e[_0x5c6e('0x24')][_0x5c6e('0x6e')]=util[_0x5c6e('0x59')](_0x5c6e('0x6f'),_0x126c69['user'][_0x5c6e('0x31')]);_0x17621e[_0x5c6e('0x24')]['channel']=_0x17621e[_0x5c6e('0x70')];_0x17621e[_0x5c6e('0x24')]['motionChannel']=_0x17621e[_0x5c6e('0x70')];_0x17621e[_0x5c6e('0x24')][_0x5c6e('0x71')]=_0x5c6e('0x72');return respondWithRpcPromise('EventManager',_0x5c6e('0x73'),{'event':'acceptmessage','message':_0x17621e[_0x5c6e('0x24')]},client9002)['then'](function(){return _0x17621e;});}return _0x17621e;}return null;})[_0x5c6e('0x4a')](respondWithResult(_0x2c3d57,null))[_0x5c6e('0x25')](handleError(_0x2c3d57,null));};var interaction_log=require('../../config/logger')(_0x5c6e('0x55'));exports[_0x5c6e('0x2c')]=function(_0x3f8818,_0x3b9246,_0x4c6d06){var _0x137011={'agent':{},'channel':_0x5c6e('0x56')};if(_0x3f8818['body']['id']){delete _0x3f8818[_0x5c6e('0x52')]['id'];}_0x3f8818[_0x5c6e('0x52')][_0x5c6e('0x5a')]=_0x3f8818[_0x5c6e('0x52')]['UserId']||_0x3f8818[_0x5c6e('0x5b')]['id'];_0x137011[_0x5c6e('0x5c')]['id']=_0x3f8818[_0x5c6e('0x52')][_0x5c6e('0x5a')];return db['OpenchannelMessage'][_0x5c6e('0x50')]({'where':{'id':_0x3f8818[_0x5c6e('0x4d')]['id'],'UserId':null}})[_0x5c6e('0x4a')](handleEntityNotFound(_0x3b9246,null))[_0x5c6e('0x4a')](function(_0x375453){if(_0x375453){_0x137011[_0x5c6e('0x24')]=_0x375453['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x375453['OpenchannelInteractionId']}});}return null;})[_0x5c6e('0x4a')](handleEntityNotFound(_0x3b9246,null))[_0x5c6e('0x4a')](function(_0x22232e){if(_0x22232e){_0x137011['interaction']=_0x22232e[_0x5c6e('0x5d')]({'plain':!![]});interaction_log[_0x5c6e('0x1d')](_0x5c6e('0x74'),_0x3f8818['user']['id'],_0x3f8818[_0x5c6e('0x5b')]['name'],_0x3f8818[_0x5c6e('0x5b')]['role'],_0x137011[_0x5c6e('0x62')]['id'],_0x3f8818[_0x5c6e('0x52')]?JSON['stringify'](_0x3f8818[_0x5c6e('0x52')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x137011);}return null;})['then'](function(_0xe84a97){var _0x3db301=_0x5c6e('0x66')+_0xe84a97[_0x5c6e('0x24')][_0x5c6e('0x67')];return db[_0x5c6e('0x68')][_0x5c6e('0x35')](_0x3db301,{'type':db[_0x5c6e('0x75')][_0x5c6e('0x76')][_0x5c6e('0x69')],'raw':!![]})[_0x5c6e('0x4a')](function(_0x12e7db){return _0x12e7db;});})[_0x5c6e('0x4a')](function(_0x451f0f){if(_0x451f0f){_0x137011[_0x5c6e('0x24')][_0x5c6e('0x6a')]=_0x451f0f[0x0];if(!_0x3f8818[_0x5c6e('0x52')][_0x5c6e('0x5a')])return;return db[_0x5c6e('0x6b')][_0x5c6e('0x50')]({'where':{'id':_0x3f8818[_0x5c6e('0x52')][_0x5c6e('0x5a')],'role':_0x5c6e('0x5c')},'attributes':['id',_0x5c6e('0x31'),_0x5c6e('0x6c'),_0x5c6e('0x77'),_0x5c6e('0x6d')],'raw':!![]});}return null;})[_0x5c6e('0x4a')](function(_0x8527a9){if(!_0x8527a9)return null;_0x137011['message'][_0x5c6e('0x5c')]=_0x8527a9;return _0x137011;})[_0x5c6e('0x4a')](function(_0x12ba25){if(_0x12ba25){_0x12ba25['message'][_0x5c6e('0x6e')]=util[_0x5c6e('0x59')](_0x5c6e('0x6f'),_0x3f8818[_0x5c6e('0x5b')]['name']);_0x12ba25[_0x5c6e('0x24')]['channel']=_0x137011[_0x5c6e('0x70')];_0x12ba25[_0x5c6e('0x24')][_0x5c6e('0x78')]=_0x137011[_0x5c6e('0x70')];_0x12ba25[_0x5c6e('0x24')]['event']=_0x5c6e('0x2c');respondWithRpcPromise('EventManager',_0x5c6e('0x73'),{'event':_0x5c6e('0x79'),'message':_0x12ba25['message']},client9002);return _0x137011;}return null;})[_0x5c6e('0x4a')](respondWithResult(_0x3b9246,null))[_0x5c6e('0x25')](handleError(_0x3b9246,null));}; \ No newline at end of file +var _0xbe22=['motionChannel','rejectmessage','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','name','index','OpenchannelMessage','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','fullname'];(function(_0x2a04,_0x434f07){var _0x2c7007=function(_0x24fd20){while(--_0x24fd20){_0x2a04['push'](_0x2a04['shift']());}};_0x2c7007(++_0x434f07);}(_0xbe22,0x86));var _0x2be2=function(_0xffec92,_0x23a84b){_0xffec92=_0xffec92-0x0;var _0x2ac53a=_0xbe22[_0xffec92];return _0x2ac53a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2be2('0x0'));var zipdir=require(_0x2be2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2be2('0x2'));var BPromise=require(_0x2be2('0x3'));var Mustache=require(_0x2be2('0x4'));var util=require(_0x2be2('0x5'));var path=require(_0x2be2('0x6'));var sox=require('sox');var csv=require(_0x2be2('0x7'));var ejs=require(_0x2be2('0x8'));var fs=require('fs');var fs_extra=require(_0x2be2('0x9'));var _=require(_0x2be2('0xa'));var squel=require(_0x2be2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2be2('0x7'));var querystring=require(_0x2be2('0xc'));var Papa=require(_0x2be2('0xd'));var Redis=require(_0x2be2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2be2('0xf'));var as=require(_0x2be2('0x10'));var hardwareService=require(_0x2be2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x2be2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2be2('0x13'));var db=require(_0x2be2('0x14'))['db'];config[_0x2be2('0x15')]=_['defaults'](config[_0x2be2('0x15')],{'host':_0x2be2('0x16'),'port':0x18eb});var socket=require(_0x2be2('0x17'))(new Redis(config['redis']));require(_0x2be2('0x18'))[_0x2be2('0x19')](socket);var jayson=require(_0x2be2('0x1a'));var client=jayson[_0x2be2('0x1b')][_0x2be2('0x1c')]({'port':0x232c});var client9002=jayson[_0x2be2('0x1b')][_0x2be2('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x278321,_0x3c92fd,_0x6e9da7,_0x89c89f){return new BPromise(function(_0x1e157c,_0xeb563d){var _0x133dc5=_0x89c89f||client;return _0x133dc5[_0x2be2('0x1d')](_0x278321,_0x6e9da7)[_0x2be2('0x1e')](function(_0x58f4bf){logger[_0x2be2('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x3c92fd,_0x2be2('0x20'));logger[_0x2be2('0x21')](_0x2be2('0x22'),_0x3c92fd,_0x2be2('0x20'),JSON[_0x2be2('0x23')](_0x58f4bf));if(_0x58f4bf['error']){if(_0x58f4bf[_0x2be2('0x24')][_0x2be2('0x25')]===0x1f4){logger[_0x2be2('0x24')](_0x2be2('0x26'),_0x3c92fd,_0x58f4bf[_0x2be2('0x24')][_0x2be2('0x27')]);return _0xeb563d(_0x58f4bf[_0x2be2('0x24')][_0x2be2('0x27')]);}logger[_0x2be2('0x24')](_0x2be2('0x26'),_0x3c92fd,_0x58f4bf[_0x2be2('0x24')][_0x2be2('0x27')]);return _0x1e157c(_0x58f4bf['error'][_0x2be2('0x27')]);}else{logger['info'](_0x2be2('0x26'),_0x3c92fd,_0x2be2('0x20'));_0x1e157c(_0x58f4bf[_0x2be2('0x28')][_0x2be2('0x27')]);}})[_0x2be2('0x29')](function(_0x42edef){logger[_0x2be2('0x24')](_0x2be2('0x26'),_0x3c92fd,_0x42edef);_0xeb563d(_0x42edef);});});}function respondWithStatusCode(_0x223c17,_0x5638eb){_0x5638eb=_0x5638eb||0xcc;return function(_0x91aee4){if(_0x91aee4){return _0x223c17[_0x2be2('0x2a')](_0x5638eb);}return _0x223c17[_0x2be2('0x2b')](_0x5638eb)[_0x2be2('0x2c')]();};}function respondWithResult(_0x4ccec3,_0x565d47){_0x565d47=_0x565d47||0xc8;return function(_0x1d729e){if(_0x1d729e){return _0x4ccec3[_0x2be2('0x2b')](_0x565d47)[_0x2be2('0x2d')](_0x1d729e);}};}function respondWithFilteredResult(_0x319a66,_0x13e3fd){return function(_0x1cd466){if(_0x1cd466){var _0x31b0d6=typeof _0x13e3fd[_0x2be2('0x2e')]===_0x2be2('0x2f')&&typeof _0x13e3fd['limit']==='undefined';var _0x280804=_0x1cd466[_0x2be2('0x30')];var _0x56658f=_0x31b0d6?0x0:_0x13e3fd[_0x2be2('0x2e')];var _0x4b5145=_0x31b0d6?_0x1cd466[_0x2be2('0x30')]:_0x13e3fd[_0x2be2('0x2e')]+_0x13e3fd[_0x2be2('0x31')];var _0x2cee26;if(_0x4b5145>=_0x280804){_0x4b5145=_0x280804;_0x2cee26=0xc8;}else{_0x2cee26=0xce;}_0x319a66[_0x2be2('0x2b')](_0x2cee26);return _0x319a66[_0x2be2('0x32')](_0x2be2('0x33'),_0x56658f+'-'+_0x4b5145+'/'+_0x280804)[_0x2be2('0x2d')](_0x1cd466);}return null;};}function patchUpdates(_0x5e7933){return function(_0x38a703){try{jsonpatch[_0x2be2('0x34')](_0x38a703,_0x5e7933,!![]);}catch(_0xa09700){return BPromise['reject'](_0xa09700);}return _0x38a703[_0x2be2('0x35')]();};}function saveUpdates(_0x8b7230,_0x2afe2e){return function(_0x46512c){if(_0x46512c){return _0x46512c[_0x2be2('0x36')](_0x8b7230)[_0x2be2('0x1e')](function(_0x50159a){return _0x50159a;});}return null;};}function removeEntity(_0x2c38db,_0x3a789d){return function(_0x5ec71d){if(_0x5ec71d){return _0x5ec71d[_0x2be2('0x37')]()[_0x2be2('0x1e')](function(){_0x2c38db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x354e94,_0x3c9025){return function(_0x488b9a){if(!_0x488b9a){_0x354e94[_0x2be2('0x2a')](0x194);}return _0x488b9a;};}function handleError(_0x275a56,_0x1f740b){_0x1f740b=_0x1f740b||0x1f4;return function(_0x1724c2){logger[_0x2be2('0x24')](_0x1724c2['stack']);if(_0x1724c2[_0x2be2('0x38')]){delete _0x1724c2[_0x2be2('0x38')];}_0x275a56[_0x2be2('0x2b')](_0x1f740b)['send'](_0x1724c2);};}exports[_0x2be2('0x39')]=function(_0x495331,_0x32f4f8){var _0x7b45a={},_0x3be044={},_0x121ea1={'count':0x0,'rows':[]};var _0x2decc1=_['map'](db[_0x2be2('0x3a')][_0x2be2('0x3b')],function(_0x43f667){return{'name':_0x43f667[_0x2be2('0x3c')],'type':_0x43f667[_0x2be2('0x3d')][_0x2be2('0x3e')]};});_0x3be044['model']=_[_0x2be2('0x3f')](_0x2decc1,'name');_0x3be044['query']=_[_0x2be2('0x40')](_0x495331[_0x2be2('0x41')]);_0x3be044['filters']=_[_0x2be2('0x42')](_0x3be044[_0x2be2('0x43')],_0x3be044[_0x2be2('0x41')]);_0x7b45a[_0x2be2('0x44')]=_[_0x2be2('0x42')](_0x3be044[_0x2be2('0x43')],qs[_0x2be2('0x45')](_0x495331['query'][_0x2be2('0x45')]));_0x7b45a[_0x2be2('0x44')]=_0x7b45a[_0x2be2('0x44')][_0x2be2('0x46')]?_0x7b45a[_0x2be2('0x44')]:_0x3be044[_0x2be2('0x43')];if(!_0x495331[_0x2be2('0x41')][_0x2be2('0x47')](_0x2be2('0x48'))){_0x7b45a[_0x2be2('0x31')]=qs[_0x2be2('0x31')](_0x495331[_0x2be2('0x41')][_0x2be2('0x31')]);_0x7b45a[_0x2be2('0x2e')]=qs['offset'](_0x495331[_0x2be2('0x41')][_0x2be2('0x2e')]);}_0x7b45a['order']=qs[_0x2be2('0x49')](_0x495331[_0x2be2('0x41')]['sort']);_0x7b45a[_0x2be2('0x4a')]=qs[_0x2be2('0x4b')](_['pick'](_0x495331[_0x2be2('0x41')],_0x3be044[_0x2be2('0x4b')]),_0x2decc1);if(_0x495331['query']['filter']){_0x7b45a['where']=_['merge'](_0x7b45a[_0x2be2('0x4a')],{'$or':_[_0x2be2('0x3f')](_0x2decc1,function(_0x53657c){if(_0x53657c[_0x2be2('0x3d')]!==_0x2be2('0x4c')){var _0xa0ab6a={};_0xa0ab6a[_0x53657c['name']]={'$like':'%'+_0x495331[_0x2be2('0x41')][_0x2be2('0x4d')]+'%'};return _0xa0ab6a;}})});}_0x7b45a=_[_0x2be2('0x4e')]({},_0x7b45a,_0x495331[_0x2be2('0x4f')]);var _0x1ed859={'where':_0x7b45a['where']};return db[_0x2be2('0x3a')]['count'](_0x1ed859)[_0x2be2('0x1e')](function(_0x5f392b){_0x121ea1['count']=_0x5f392b;if(_0x495331[_0x2be2('0x41')][_0x2be2('0x50')]){_0x7b45a[_0x2be2('0x51')]=[{'all':!![]}];}return db[_0x2be2('0x3a')][_0x2be2('0x52')](_0x7b45a);})[_0x2be2('0x1e')](function(_0x1e49c4){_0x121ea1[_0x2be2('0x53')]=_0x1e49c4;return _0x121ea1;})['then'](respondWithFilteredResult(_0x32f4f8,_0x7b45a))[_0x2be2('0x29')](handleError(_0x32f4f8,null));};exports[_0x2be2('0x54')]=function(_0x3025b9,_0x17e63f){var _0x2d449b={'raw':!![],'where':{'id':_0x3025b9[_0x2be2('0x55')]['id']}},_0x5f4555={};_0x5f4555[_0x2be2('0x43')]=_[_0x2be2('0x40')](db['OpenchannelMessage'][_0x2be2('0x3b')]);_0x5f4555[_0x2be2('0x41')]=_['keys'](_0x3025b9[_0x2be2('0x41')]);_0x5f4555['filters']=_[_0x2be2('0x42')](_0x5f4555[_0x2be2('0x43')],_0x5f4555[_0x2be2('0x41')]);_0x2d449b[_0x2be2('0x44')]=_[_0x2be2('0x42')](_0x5f4555['model'],qs[_0x2be2('0x45')](_0x3025b9[_0x2be2('0x41')][_0x2be2('0x45')]));_0x2d449b[_0x2be2('0x44')]=_0x2d449b['attributes']['length']?_0x2d449b[_0x2be2('0x44')]:_0x5f4555['model'];if(_0x3025b9['query'][_0x2be2('0x50')]){_0x2d449b[_0x2be2('0x51')]=[{'all':!![]}];}_0x2d449b=_[_0x2be2('0x4e')]({},_0x2d449b,_0x3025b9[_0x2be2('0x4f')]);return db['OpenchannelMessage']['find'](_0x2d449b)[_0x2be2('0x1e')](handleEntityNotFound(_0x17e63f,null))['then'](respondWithResult(_0x17e63f,null))[_0x2be2('0x29')](handleError(_0x17e63f,null));};exports[_0x2be2('0x56')]=function(_0x58c9d1,_0x32914a){return db[_0x2be2('0x3a')][_0x2be2('0x56')](_0x58c9d1[_0x2be2('0x57')],{})[_0x2be2('0x1e')](respondWithResult(_0x32914a,0xc9))[_0x2be2('0x29')](handleError(_0x32914a,null));};exports['update']=function(_0x57fb91,_0x370442){if(_0x57fb91[_0x2be2('0x57')]['id']){delete _0x57fb91['body']['id'];}return db[_0x2be2('0x3a')][_0x2be2('0x58')]({'where':{'id':_0x57fb91[_0x2be2('0x55')]['id']}})[_0x2be2('0x1e')](handleEntityNotFound(_0x370442,null))[_0x2be2('0x1e')](saveUpdates(_0x57fb91['body'],null))[_0x2be2('0x1e')](respondWithResult(_0x370442,null))[_0x2be2('0x29')](handleError(_0x370442,null));};exports[_0x2be2('0x37')]=function(_0xde3cf9,_0x5a5df8){return db[_0x2be2('0x3a')]['find']({'where':{'id':_0xde3cf9['params']['id']}})[_0x2be2('0x1e')](handleEntityNotFound(_0x5a5df8,null))[_0x2be2('0x1e')](removeEntity(_0x5a5df8,null))[_0x2be2('0x29')](handleError(_0x5a5df8,null));};exports['describe']=function(_0x4bbbe2,_0x4d17dd){return db[_0x2be2('0x3a')][_0x2be2('0x59')]()['then'](respondWithResult(_0x4d17dd,null))['catch'](handleError(_0x4d17dd,null));};var interaction_log=require(_0x2be2('0x5a'))(_0x2be2('0x5b'));exports[_0x2be2('0x5c')]=function(_0x45690b,_0x584ccc,_0x83898a){var _0x2b94a9={'agent':{},'channel':_0x2be2('0x5d')};if(_0x45690b[_0x2be2('0x57')]['id']){delete _0x45690b[_0x2be2('0x57')]['id'];}_0x45690b[_0x2be2('0x57')][_0x2be2('0x5e')]=!![];_0x45690b['body'][_0x2be2('0x5f')]=moment()[_0x2be2('0x60')](_0x2be2('0x61'));_0x45690b['body']['UserId']=_0x45690b['body'][_0x2be2('0x62')]||_0x45690b[_0x2be2('0x63')]['id'];_0x2b94a9[_0x2be2('0x64')]['id']=_0x45690b[_0x2be2('0x57')][_0x2be2('0x62')];return db[_0x2be2('0x3a')][_0x2be2('0x58')]({'where':{'id':_0x45690b[_0x2be2('0x55')]['id'],'UserId':null}})[_0x2be2('0x1e')](handleEntityNotFound(_0x584ccc,null))[_0x2be2('0x1e')](saveUpdates(_0x45690b['body'],null))[_0x2be2('0x1e')](function(_0xee2cf8){if(_0xee2cf8){_0x2b94a9[_0x2be2('0x27')]=_0xee2cf8[_0x2be2('0x65')]({'plain':!![]});return db[_0x2be2('0x66')][_0x2be2('0x58')]({'where':{'id':_0xee2cf8[_0x2be2('0x67')]}});}return null;})[_0x2be2('0x1e')](handleEntityNotFound(_0x584ccc,null))[_0x2be2('0x1e')](function(_0x215cfb){if(_0x215cfb){return _0x215cfb[_0x2be2('0x36')]({'UserId':_0x45690b[_0x2be2('0x57')][_0x2be2('0x62')],'read1stAt':_['isNil'](_0x215cfb[_0x2be2('0x68')])?moment()[_0x2be2('0x60')](_0x2be2('0x61')):undefined});}return null;})[_0x2be2('0x1e')](function(_0x11e26c){if(_0x11e26c){_0x2b94a9[_0x2be2('0x69')]=_0x11e26c[_0x2be2('0x65')]({'plain':!![]});interaction_log[_0x2be2('0x1f')](_0x2be2('0x6a'),_0x45690b[_0x2be2('0x63')]['id'],_0x45690b[_0x2be2('0x63')][_0x2be2('0x38')],_0x45690b[_0x2be2('0x63')][_0x2be2('0x6b')],_0x2b94a9['interaction']['id'],_0x45690b[_0x2be2('0x57')]?JSON[_0x2be2('0x23')](_0x45690b['body']):_0x2be2('0x6c'));return respondWithRpcPromise(_0x2be2('0x6d'),'acceptMessage',_0x2b94a9);}return null;})[_0x2be2('0x1e')](function(_0x396407){var _0x4ed904=_0x2be2('0x6e')+_0x396407[_0x2be2('0x27')][_0x2be2('0x6f')];return db['sequelize'][_0x2be2('0x41')](_0x4ed904,{'type':db[_0x2be2('0x70')][_0x2be2('0x71')][_0x2be2('0x72')],'raw':!![]})['then'](function(_0x4a42a5){return _0x4a42a5;});})[_0x2be2('0x1e')](function(_0x169b92){if(_0x169b92){_0x2b94a9[_0x2be2('0x27')]['contact']=_0x169b92[0x0];if(!_0x45690b[_0x2be2('0x57')][_0x2be2('0x62')])return;return db[_0x2be2('0x73')][_0x2be2('0x58')]({'where':{'id':_0x45690b[_0x2be2('0x57')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0x2be2('0x74'),_0x2be2('0x75')],'raw':!![]});}return null;})[_0x2be2('0x1e')](function(_0x10add8){if(!_0x10add8)return null;_0x2b94a9[_0x2be2('0x27')][_0x2be2('0x64')]=_0x10add8;return _0x2b94a9;})[_0x2be2('0x1e')](function(_0x5898d0){if(_0x5898d0){if(_0x45690b[_0x2be2('0x57')]['manual']){_0x2b94a9[_0x2be2('0x27')][_0x2be2('0x76')]=util[_0x2be2('0x60')](_0x2be2('0x77'),_0x45690b[_0x2be2('0x63')][_0x2be2('0x38')]);_0x2b94a9[_0x2be2('0x27')][_0x2be2('0x78')]=_0x2b94a9[_0x2be2('0x78')];_0x2b94a9[_0x2be2('0x27')]['motionChannel']=_0x2b94a9[_0x2be2('0x78')];_0x2b94a9['message'][_0x2be2('0x79')]=_0x2be2('0x5c');return respondWithRpcPromise('EventManager',_0x2be2('0x7a'),{'event':_0x2be2('0x7b'),'message':_0x2b94a9[_0x2be2('0x27')]},client9002)[_0x2be2('0x1e')](function(){return _0x2b94a9;});}return _0x2b94a9;}return null;})[_0x2be2('0x1e')](respondWithResult(_0x584ccc,null))[_0x2be2('0x29')](handleError(_0x584ccc,null));};var interaction_log=require(_0x2be2('0x5a'))(_0x2be2('0x5b'));exports[_0x2be2('0x7c')]=function(_0x5b841d,_0x4182f4,_0x421bf7){var _0xdc283a={'agent':{},'channel':'openchannel'};if(_0x5b841d[_0x2be2('0x57')]['id']){delete _0x5b841d[_0x2be2('0x57')]['id'];}_0x5b841d[_0x2be2('0x57')][_0x2be2('0x62')]=_0x5b841d[_0x2be2('0x57')]['UserId']||_0x5b841d[_0x2be2('0x63')]['id'];_0xdc283a[_0x2be2('0x64')]['id']=_0x5b841d['body'][_0x2be2('0x62')];return db['OpenchannelMessage']['find']({'where':{'id':_0x5b841d[_0x2be2('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4182f4,null))[_0x2be2('0x1e')](function(_0x152502){if(_0x152502){_0xdc283a[_0x2be2('0x27')]=_0x152502[_0x2be2('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2be2('0x58')]({'where':{'id':_0x152502[_0x2be2('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x4182f4,null))[_0x2be2('0x1e')](function(_0x45720c){if(_0x45720c){_0xdc283a[_0x2be2('0x69')]=_0x45720c[_0x2be2('0x65')]({'plain':!![]});interaction_log[_0x2be2('0x1f')](_0x2be2('0x7d'),_0x5b841d[_0x2be2('0x63')]['id'],_0x5b841d[_0x2be2('0x63')][_0x2be2('0x38')],_0x5b841d[_0x2be2('0x63')][_0x2be2('0x6b')],_0xdc283a[_0x2be2('0x69')]['id'],_0x5b841d[_0x2be2('0x57')]?JSON['stringify'](_0x5b841d[_0x2be2('0x57')]):'null');return respondWithRpcPromise(_0x2be2('0x7e'),_0x2be2('0x7f'),_0xdc283a);}return null;})[_0x2be2('0x1e')](function(_0x1d8cd8){var _0x349b3b=_0x2be2('0x6e')+_0x1d8cd8['message'][_0x2be2('0x6f')];return db[_0x2be2('0x80')]['query'](_0x349b3b,{'type':db[_0x2be2('0x70')][_0x2be2('0x71')][_0x2be2('0x72')],'raw':!![]})['then'](function(_0x17e87d){return _0x17e87d;});})[_0x2be2('0x1e')](function(_0x32b47f){if(_0x32b47f){_0xdc283a[_0x2be2('0x27')]['contact']=_0x32b47f[0x0];if(!_0x5b841d[_0x2be2('0x57')][_0x2be2('0x62')])return;return db[_0x2be2('0x73')][_0x2be2('0x58')]({'where':{'id':_0x5b841d[_0x2be2('0x57')][_0x2be2('0x62')],'role':'agent'},'attributes':['id',_0x2be2('0x38'),_0x2be2('0x81'),_0x2be2('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1937d6){if(!_0x1937d6)return null;_0xdc283a['message'][_0x2be2('0x64')]=_0x1937d6;return _0xdc283a;})[_0x2be2('0x1e')](function(_0x228219){if(_0x228219){_0x228219['message'][_0x2be2('0x76')]=util[_0x2be2('0x60')]('SIP/%s',_0x5b841d[_0x2be2('0x63')][_0x2be2('0x38')]);_0x228219[_0x2be2('0x27')][_0x2be2('0x78')]=_0xdc283a['channel'];_0x228219[_0x2be2('0x27')][_0x2be2('0x82')]=_0xdc283a['channel'];_0x228219[_0x2be2('0x27')][_0x2be2('0x79')]=_0x2be2('0x7c');respondWithRpcPromise(_0x2be2('0x7a'),_0x2be2('0x7a'),{'event':_0x2be2('0x83'),'message':_0x228219[_0x2be2('0x27')]},client9002);return _0xdc283a;}return null;})[_0x2be2('0x1e')](respondWithResult(_0x4182f4,null))['catch'](handleError(_0x4182f4,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 94634cb..bcb6d49 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 _0xa3ad=['hook','exports','events','update','remove','emit','hasOwnProperty'];(function(_0x55a58f,_0x44aa22){var _0x38d669=function(_0x156f51){while(--_0x156f51){_0x55a58f['push'](_0x55a58f['shift']());}};_0x38d669(++_0x44aa22);}(_0xa3ad,0x191));var _0xda3a=function(_0x309a79,_0x1ab8d7){_0x309a79=_0x309a79-0x0;var _0x531852=_0xa3ad[_0x309a79];return _0x531852;};'use strict';var EventEmitter=require(_0xda3a('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xda3a('0x1'),'afterDestroy':_0xda3a('0x2')};function emitEvent(_0x513b64){return function(_0x1662fb,_0x2ca366,_0x27ed0c){OpenchannelMessageEvents['emit'](_0x513b64+':'+_0x1662fb['id'],_0x1662fb);OpenchannelMessageEvents[_0xda3a('0x3')](_0x513b64,_0x1662fb);_0x27ed0c(null);};}for(var e in events){if(events[_0xda3a('0x4')](e)){var event=events[e];OpenchannelMessage[_0xda3a('0x5')](e,emitEvent(event));}}module[_0xda3a('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x1b0a=['remove','emit','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update'];(function(_0x19ef2b,_0x354f66){var _0x4df537=function(_0x576738){while(--_0x576738){_0x19ef2b['push'](_0x19ef2b['shift']());}};_0x4df537(++_0x354f66);}(_0x1b0a,0x113));var _0xa1b0=function(_0x2d0bee,_0x12f902){_0x2d0bee=_0x2d0bee-0x0;var _0x5b264f=_0x1b0a[_0x2d0bee];return _0x5b264f;};'use strict';var EventEmitter=require(_0xa1b0('0x0'));var OpenchannelMessage=require(_0xa1b0('0x1'))['db'][_0xa1b0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa1b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa1b0('0x4'),'afterDestroy':_0xa1b0('0x5')};function emitEvent(_0x1a78c9){return function(_0x2ca106,_0x43f958,_0x41eaef){OpenchannelMessageEvents[_0xa1b0('0x6')](_0x1a78c9+':'+_0x2ca106['id'],_0x2ca106);OpenchannelMessageEvents[_0xa1b0('0x6')](_0x1a78c9,_0x2ca106);_0x41eaef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xa1b0('0x7')](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 4bd0b56..b022deb 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 _0x8952=['POST','GET','threadId','inspect','finally','utf8mb4','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','toLowerCase','direction','secret','isNil','OpenchannelInteraction','findOne','update','catch','error','out','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','omit','Contact'];(function(_0x140923,_0x492f05){var _0x4e42e0=function(_0x4e2f6e){while(--_0x4e2f6e){_0x140923['push'](_0x140923['shift']());}};_0x4e42e0(++_0x492f05);}(_0x8952,0x17e));var _0x2895=function(_0x19837f,_0x3376ff){_0x19837f=_0x19837f-0x0;var _0x31822e=_0x8952[_0x19837f];return _0x31822e;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('OpenchannelMessage',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xb')],'type':_0x2895('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x384cc6,_0x4952fa,_0x14fb67){var _0x5f2632=_0x73c245[_0x2895('0xd')];var _0x5af454=_0x384cc6['get']({'plain':!![]});if(_0x5af454['direction'][_0x2895('0xe')]()==='in'||_0x5af454[_0x2895('0xf')][_0x2895('0xe')]()==='out'&&!_0x5af454[_0x2895('0x10')]&&!_[_0x2895('0x11')](_0x5af454['UserId'])){_0x5f2632[_0x2895('0x12')][_0x2895('0x13')]({'where':{'id':_0x5af454['OpenchannelInteractionId']}})['then'](function(_0x1d1493){if(_0x1d1493){_0x1d1493[_0x2895('0x14')]({'lastMsgAt':_0x5af454['createdAt'],'lastMsgDirection':_0x5af454[_0x2895('0xf')][_0x2895('0xe')]()});}})[_0x2895('0x15')](function(_0x1ae013){console[_0x2895('0x16')](_0x1ae013);});}if(_0x5af454[_0x2895('0xf')]===_0x2895('0x17')&&!_0x5af454[_0x2895('0x10')]){var _0x3e96d7;_0x5f2632[_0x2895('0x18')][_0x2895('0x19')]()[_0x2895('0x1a')](function(_0xbf8b63){return _0x5f2632[_0x2895('0x1b')][_0x2895('0x1c')]({'where':{'id':_0x5af454[_0x2895('0x1d')]},'include':[{'model':_0x5f2632[_0x2895('0x12')],'as':_0x2895('0x1e'),'where':{'id':_0x5af454['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x5f2632['CmContact'],'as':'Contact','attributes':_[_0x2895('0x1f')](_0xbf8b63)}]}]});})[_0x2895('0x1a')](function(_0x3ec4da){_0x3e96d7=_0x3ec4da['get']({'plain':!![]});if(_0x3e96d7&&_0x3e96d7[_0x2895('0x20')]){logger[_0x2895('0x21')](_0x2895('0x22'),_0x2895('0x23'),util[_0x2895('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5af454['id'],_0x3e96d7[_0x2895('0x20')]));if(_0x3e96d7[_0x2895('0x1e')]&&_0x3e96d7['Interactions'][_0x2895('0x25')]){_0x5af454[_0x2895('0x26')]=_[_0x2895('0x27')](_0x3e96d7['Interactions'][0x0],'Contact');_0x5af454[_0x2895('0x28')]=_0x3e96d7[_0x2895('0x1e')][0x0][_0x2895('0x28')];}var _0x4952fa={'method':_0x2895('0x29'),'uri':encodeURI(_0x3e96d7[_0x2895('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4952fa['method']){case _0x2895('0x2a'):_0x4952fa['qs']=_0x5af454;break;case _0x2895('0x29'):_0x4952fa[_0x2895('0xb')]=_0x5af454;break;}return rp(_0x4952fa)['then'](function(_0x320661){logger[_0x2895('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x2895('0x23'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x5af454['id'],_0x3e96d7[_0x2895('0x20')]));if(_0x320661['body'][_0x2895('0x2b')]&&_0x320661[_0x2895('0xb')]['threadId']!=_0x5af454['Interaction'][_0x2895('0x2b')]){return _0x5f2632[_0x2895('0x12')][_0x2895('0x14')]({'threadId':_0x320661[_0x2895('0xb')][_0x2895('0x2b')]},{'logging':!![],'where':{'id':_0x5af454[_0x2895('0x26')]['id']}});}else{return;}})[_0x2895('0x1a')](function(){return _0x384cc6['update']({'read':!![]});})[_0x2895('0x15')](function(_0xd45db5){logger[_0x2895('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x2895('0x23'),util[_0x2895('0x2c')](_0xd45db5,{'showHidden':![],'depth':null}));_0x14fb67();});}else{_0x14fb67();}})[_0x2895('0x2d')](function(){_0x14fb67();});}else{_0x14fb67();}}},'charset':_0x2895('0x2e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb10b=['OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','method','GET','POST','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','out','CmContact','describe','then'];(function(_0x1f25ce,_0x5aa578){var _0x31fef5=function(_0x38503a){while(--_0x38503a){_0x1f25ce['push'](_0x1f25ce['shift']());}};_0x31fef5(++_0x5aa578);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0xb10b[_0x5c84a6];return _0xb8c5f0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('OpenchannelMessage',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd')],'type':_0xbb10('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2353ef,_0x1ce33e,_0x229887){var _0xa3adc8=_0x481979['models'];var _0x4e47f8=_0x2353ef[_0xbb10('0xf')]({'plain':!![]});if(_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()==='in'||_0x4e47f8['direction'][_0xbb10('0x11')]()==='out'&&!_0x4e47f8[_0xbb10('0x12')]&&!_[_0xbb10('0x13')](_0x4e47f8[_0xbb10('0x14')])){_0xa3adc8[_0xbb10('0x15')][_0xbb10('0x16')]({'where':{'id':_0x4e47f8[_0xbb10('0x17')]}})['then'](function(_0x26e021){if(_0x26e021){_0x26e021[_0xbb10('0x18')]({'lastMsgAt':_0x4e47f8[_0xbb10('0x19')],'lastMsgDirection':_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()});}})[_0xbb10('0x1a')](function(_0x24a57b){console[_0xbb10('0x1b')](_0x24a57b);});}if(_0x4e47f8[_0xbb10('0x10')]===_0xbb10('0x1c')&&!_0x4e47f8['secret']){var _0x2eca0f;_0xa3adc8[_0xbb10('0x1d')][_0xbb10('0x1e')]()[_0xbb10('0x1f')](function(_0x378da8){return _0xa3adc8[_0xbb10('0x20')][_0xbb10('0x21')]({'where':{'id':_0x4e47f8[_0xbb10('0x22')]},'include':[{'model':_0xa3adc8[_0xbb10('0x15')],'as':_0xbb10('0x23'),'where':{'id':_0x4e47f8['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xa3adc8[_0xbb10('0x1d')],'as':_0xbb10('0x24'),'attributes':_[_0xbb10('0x25')](_0x378da8)}]}]});})[_0xbb10('0x1f')](function(_0xdf237d){_0x2eca0f=_0xdf237d[_0xbb10('0xf')]({'plain':!![]});if(_0x2eca0f&&_0x2eca0f['replyUri']){logger[_0xbb10('0x26')](_0xbb10('0x27'),'afterCreate',util['format'](_0xbb10('0x28'),_0x4e47f8['id'],_0x2eca0f[_0xbb10('0x29')]));if(_0x2eca0f[_0xbb10('0x23')]&&_0x2eca0f[_0xbb10('0x23')][_0xbb10('0x2a')]){_0x4e47f8[_0xbb10('0x2b')]=_[_0xbb10('0x2c')](_0x2eca0f[_0xbb10('0x23')][0x0],_0xbb10('0x24'));_0x4e47f8[_0xbb10('0x24')]=_0x2eca0f[_0xbb10('0x23')][0x0][_0xbb10('0x24')];}var _0x1ce33e={'method':'POST','uri':encodeURI(_0x2eca0f['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1ce33e[_0xbb10('0x2d')]){case _0xbb10('0x2e'):_0x1ce33e['qs']=_0x4e47f8;break;case _0xbb10('0x2f'):_0x1ce33e['body']=_0x4e47f8;break;}return rp(_0x1ce33e)[_0xbb10('0x1f')](function(_0x24d586){logger[_0xbb10('0x26')](_0xbb10('0x27'),_0xbb10('0x30'),util[_0xbb10('0x31')](_0xbb10('0x32'),_0x4e47f8['id'],_0x2eca0f['replyUri']));if(_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]&&_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]!=_0x4e47f8[_0xbb10('0x2b')][_0xbb10('0x33')]){return _0xa3adc8['OpenchannelInteraction'][_0xbb10('0x18')]({'threadId':_0x24d586['body'][_0xbb10('0x33')]},{'logging':!![],'where':{'id':_0x4e47f8['Interaction']['id']}});}else{return;}})[_0xbb10('0x1f')](function(){return _0x2353ef[_0xbb10('0x18')]({'read':!![]});})[_0xbb10('0x1a')](function(_0x491db4){logger['error'](_0xbb10('0x27'),_0xbb10('0x30'),util['inspect'](_0x491db4,{'showHidden':![],'depth':null}));_0x229887();});}else{_0x229887();}})[_0xbb10('0x34')](function(){_0x229887();});}else{_0x229887();}}},'charset':_0xbb10('0x35'),'collate':_0xbb10('0x36')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index db6bf92..77870e7 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 _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(_0xa3cf2c,_0x2daed9){var _0x2b8340=function(_0x5e3a27){while(--_0x5e3a27){_0xa3cf2c['push'](_0xa3cf2c['shift']());}};_0x2b8340(++_0x2daed9);}(_0x1261,0x144));var _0x1126=function(_0x397004,_0x7949f){_0x397004=_0x397004-0x0;var _0xa7a10=_0x1261[_0x397004];return _0xa7a10;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _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(_0x3b9e02,_0x394b1c){var _0xee324e=function(_0x40f80a){while(--_0x40f80a){_0x3b9e02['push'](_0x3b9e02['shift']());}};_0xee324e(++_0x394b1c);}(_0x1261,0x144));var _0x1126=function(_0xed01eb,_0x275edb){_0xed01eb=_0xed01eb-0x0;var _0x25b9de=_0x1261[_0xed01eb];return _0x25b9de;};'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 2746c0f..0f4c739 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 _0x8289=['emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x4d2e82,_0x1d6ddf){var _0x5a4b7b=function(_0x45ab03){while(--_0x45ab03){_0x4d2e82['push'](_0x4d2e82['shift']());}};_0x5a4b7b(++_0x1d6ddf);}(_0x8289,0xf8));var _0x9828=function(_0x5620e8,_0x7a8024){_0x5620e8=_0x5620e8-0x0;var _0x2c607e=_0x8289[_0x5620e8];return _0x2c607e;};'use strict';var OpenchannelMessageEvents=require(_0x9828('0x0'));var events=[_0x9828('0x1'),_0x9828('0x2'),_0x9828('0x3')];function createListener(_0x28d6ee,_0x2e4fa1){return function(_0x10c220){_0x2e4fa1[_0x9828('0x4')](_0x28d6ee,_0x10c220);};}function removeListener(_0x5b5139,_0x3e5a97){return function(){OpenchannelMessageEvents[_0x9828('0x5')](_0x5b5139,_0x3e5a97);};}exports[_0x9828('0x6')]=function(_0x200696){for(var _0x182e6f=0x0,_0x1d4ea5=events[_0x9828('0x7')];_0x182e6f<_0x1d4ea5;_0x182e6f++){var _0x2eae3a=events[_0x182e6f];var _0x399a88=createListener(_0x9828('0x8')+_0x2eae3a,_0x200696);OpenchannelMessageEvents['on'](_0x2eae3a,_0x399a88);}}; \ No newline at end of file +var _0xf228=['./openchannelMessage.events','save','update','emit','register'];(function(_0x53ca01,_0x29e0fa){var _0x3f32be=function(_0x4ea0eb){while(--_0x4ea0eb){_0x53ca01['push'](_0x53ca01['shift']());}};_0x3f32be(++_0x29e0fa);}(_0xf228,0x1a9));var _0x8f22=function(_0x5a8017,_0x4f31c4){_0x5a8017=_0x5a8017-0x0;var _0x4de132=_0xf228[_0x5a8017];return _0x4de132;};'use strict';var OpenchannelMessageEvents=require(_0x8f22('0x0'));var events=[_0x8f22('0x1'),'remove',_0x8f22('0x2')];function createListener(_0x23a1ac,_0x2162cf){return function(_0x33cabb){_0x2162cf[_0x8f22('0x3')](_0x23a1ac,_0x33cabb);};}function removeListener(_0x134ed2,_0x569710){return function(){OpenchannelMessageEvents['removeListener'](_0x134ed2,_0x569710);};}exports[_0x8f22('0x4')]=function(_0x56124f){for(var _0x239169=0x0,_0xcf8bf8=events['length'];_0x239169<_0xcf8bf8;_0x239169++){var _0x2f65b7=events[_0x239169];var _0x22c45d=createListener('openchannelMessage:'+_0x2f65b7,_0x56124f);OpenchannelMessageEvents['on'](_0x2f65b7,_0x22c45d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 2ad2a6f..d4a4d24 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 _0x58a0=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members'];(function(_0x41d9a8,_0x386c27){var _0x146498=function(_0x5c399c){while(--_0x5c399c){_0x41d9a8['push'](_0x41d9a8['shift']());}};_0x146498(++_0x386c27);}(_0x58a0,0xf6));var _0x058a=function(_0x4dd943,_0x5f379e){_0x4dd943=_0x4dd943-0x0;var _0x4e06ee=_0x58a0[_0x4dd943];return _0x4e06ee;};'use strict';var multer=require(_0x058a('0x0'));var util=require(_0x058a('0x1'));var path=require(_0x058a('0x2'));var timeout=require(_0x058a('0x3'));var express=require('express');var router=express[_0x058a('0x4')]();var fs_extra=require(_0x058a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x058a('0x6'));var controller=require(_0x058a('0x7'));router[_0x058a('0x8')]('/',auth[_0x058a('0x9')](),controller[_0x058a('0xa')]);router[_0x058a('0x8')](_0x058a('0xb'),auth['isAuthenticated'](),controller[_0x058a('0xc')]);router[_0x058a('0x8')](_0x058a('0xd'),auth[_0x058a('0x9')](),controller['show']);router[_0x058a('0x8')](_0x058a('0xe'),auth['isAuthenticated'](),controller[_0x058a('0xf')]);router[_0x058a('0x8')](_0x058a('0x10'),auth[_0x058a('0x9')](),controller[_0x058a('0x11')]);router[_0x058a('0x8')](_0x058a('0x12'),auth[_0x058a('0x9')](),controller[_0x058a('0x13')]);router['post']('/',auth[_0x058a('0x9')](),controller[_0x058a('0x14')]);router['post'](_0x058a('0x10'),auth[_0x058a('0x9')](),controller[_0x058a('0x15')]);router[_0x058a('0x16')](_0x058a('0x12'),auth[_0x058a('0x9')](),controller['addAgents']);router[_0x058a('0x17')](_0x058a('0xd'),auth[_0x058a('0x9')](),controller[_0x058a('0x18')]);router['delete'](_0x058a('0xd'),auth[_0x058a('0x9')](),controller[_0x058a('0x19')]);router[_0x058a('0x1a')]('/:id/teams',auth[_0x058a('0x9')](),controller['removeTeams']);router[_0x058a('0x1a')]('/:id/users',auth['isAuthenticated'](),controller[_0x058a('0x1b')]);module[_0x058a('0x1c')]=router; \ No newline at end of file +var _0xc51e=['/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','/:id','delete','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers'];(function(_0x7065cd,_0x5ef896){var _0x39fb25=function(_0x2fb0b1){while(--_0x2fb0b1){_0x7065cd['push'](_0x7065cd['shift']());}};_0x39fb25(++_0x5ef896);}(_0xc51e,0x108));var _0xec51=function(_0x10f50d,_0x1b200c){_0x10f50d=_0x10f50d-0x0;var _0x24128c=_0xc51e[_0x10f50d];return _0x24128c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xec51('0x0'));var timeout=require(_0xec51('0x1'));var express=require(_0xec51('0x2'));var router=express[_0xec51('0x3')]();var fs_extra=require(_0xec51('0x4'));var auth=require(_0xec51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec51('0x6'));var controller=require(_0xec51('0x7'));router[_0xec51('0x8')]('/',auth[_0xec51('0x9')](),controller[_0xec51('0xa')]);router[_0xec51('0x8')](_0xec51('0xb'),auth[_0xec51('0x9')](),controller[_0xec51('0xc')]);router[_0xec51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xec51('0xd')]);router[_0xec51('0x8')](_0xec51('0xe'),auth[_0xec51('0x9')](),controller[_0xec51('0xf')]);router[_0xec51('0x8')](_0xec51('0x10'),auth[_0xec51('0x9')](),controller[_0xec51('0x11')]);router[_0xec51('0x8')](_0xec51('0x12'),auth[_0xec51('0x9')](),controller['getAgents']);router[_0xec51('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xec51('0x13')](_0xec51('0x10'),auth['isAuthenticated'](),controller[_0xec51('0x14')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xec51('0x15')]);router[_0xec51('0x16')](_0xec51('0x17'),auth[_0xec51('0x9')](),controller['update']);router[_0xec51('0x18')](_0xec51('0x17'),auth['isAuthenticated'](),controller['destroy']);router[_0xec51('0x18')]('/:id/teams',auth[_0xec51('0x9')](),controller[_0xec51('0x19')]);router[_0xec51('0x18')]('/:id/users',auth[_0xec51('0x9')](),controller[_0xec51('0x1a')]);module[_0xec51('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index fdd5ad3..2a200d7 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 _0xab79=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x140931,_0x2ffeba){var _0x4718ab=function(_0x1f08f7){while(--_0x1f08f7){_0x140931['push'](_0x140931['shift']());}};_0x4718ab(++_0x2ffeba);}(_0xab79,0x78));var _0x9ab7=function(_0x155560,_0x4c641b){_0x155560=_0x155560-0x0;var _0x40c47a=_0xab79[_0x155560];return _0x40c47a;};'use strict';var Sequelize=require(_0x9ab7('0x0'));module[_0x9ab7('0x1')]={'name':{'type':Sequelize[_0x9ab7('0x2')],'unique':_0x9ab7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9ab7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9ab7('0x5')](_0x9ab7('0x6'),_0x9ab7('0x7'),_0x9ab7('0x8'))}}; \ No newline at end of file +var _0x9d5b=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x4793ab,_0x1dc508){var _0x595a70=function(_0x2b00df){while(--_0x2b00df){_0x4793ab['push'](_0x4793ab['shift']());}};_0x595a70(++_0x1dc508);}(_0x9d5b,0x96));var _0xb9d5=function(_0x5d86c6,_0x59b424){_0x5d86c6=_0x5d86c6-0x0;var _0x114d51=_0x9d5b[_0x5d86c6];return _0x114d51;};'use strict';var Sequelize=require(_0xb9d5('0x0'));module[_0xb9d5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb9d5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb9d5('0x3')]},'timeout':{'type':Sequelize[_0xb9d5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9d5('0x5')](_0xb9d5('0x6'),_0xb9d5('0x7'),_0xb9d5('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 0fca62c..8debad6 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 _0x31ad=['merge','map','type','VIRTUAL','options','OpenchannelQueue','count','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','userProfileId','autoAssociation','body','destroy','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','findAll','User','findAndCountAll','UserId','agent','openchannelPause','format','%s/%s','createdAt','updatedAt','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','ids','from','team_has_openchannel_queues','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','value','removeTeams','removeAgents','userOpenchannelQueue:remove','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','get','UserProfileResource','error','stack','name','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter'];(function(_0x1e1f28,_0x1f2476){var _0x18848f=function(_0x1bdde4){while(--_0x1bdde4){_0x1e1f28['push'](_0x1e1f28['shift']());}};_0x18848f(++_0x1f2476);}(_0x31ad,0xca));var _0xd31a=function(_0x2e3340,_0x48c219){_0x2e3340=_0x2e3340-0x0;var _0x420acb=_0x31ad[_0x2e3340];return _0x420acb;};'use strict';var emlformat=require(_0xd31a('0x0'));var rimraf=require(_0xd31a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd31a('0x2'));var rp=require(_0xd31a('0x3'));var moment=require(_0xd31a('0x4'));var BPromise=require(_0xd31a('0x5'));var Mustache=require(_0xd31a('0x6'));var util=require('util');var path=require(_0xd31a('0x7'));var sox=require('sox');var csv=require(_0xd31a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd31a('0x9'));var _=require(_0xd31a('0xa'));var squel=require(_0xd31a('0xb'));var crypto=require(_0xd31a('0xc'));var jsforce=require(_0xd31a('0xd'));var deskjs=require(_0xd31a('0xe'));var toCsv=require(_0xd31a('0x8'));var querystring=require(_0xd31a('0xf'));var Papa=require(_0xd31a('0x10'));var Redis=require(_0xd31a('0x11'));var authService=require(_0xd31a('0x12'));var qs=require(_0xd31a('0x13'));var as=require(_0xd31a('0x14'));var hardwareService=require(_0xd31a('0x15'));var logger=require(_0xd31a('0x16'))('api');var utils=require(_0xd31a('0x17'));var config=require(_0xd31a('0x18'));var licenseUtil=require(_0xd31a('0x19'));var db=require('../../mysqldb')['db'];config[_0xd31a('0x1a')]=_['defaults'](config['redis'],{'host':_0xd31a('0x1b'),'port':0x18eb});var socket=require(_0xd31a('0x1c'))(new Redis(config[_0xd31a('0x1a')]));require(_0xd31a('0x1d'))[_0xd31a('0x1e')](socket);function respondWithStatusCode(_0x3730bf,_0x1c70a3){_0x1c70a3=_0x1c70a3||0xcc;return function(_0x417ef2){if(_0x417ef2){return _0x3730bf[_0xd31a('0x1f')](_0x1c70a3);}return _0x3730bf[_0xd31a('0x20')](_0x1c70a3)[_0xd31a('0x21')]();};}function respondWithResult(_0x5cbb9f,_0x27e26a){_0x27e26a=_0x27e26a||0xc8;return function(_0x52449e){if(_0x52449e){return _0x5cbb9f[_0xd31a('0x20')](_0x27e26a)[_0xd31a('0x22')](_0x52449e);}};}function respondWithFilteredResult(_0x2b1588,_0x220f33){return function(_0x5d8765){if(_0x5d8765){var _0x4489a6=typeof _0x220f33[_0xd31a('0x23')]===_0xd31a('0x24')&&typeof _0x220f33['limit']===_0xd31a('0x24');var _0xabf5ff=_0x5d8765['count'];var _0x158cc8=_0x4489a6?0x0:_0x220f33[_0xd31a('0x23')];var _0x15a32c=_0x4489a6?_0x5d8765['count']:_0x220f33[_0xd31a('0x23')]+_0x220f33[_0xd31a('0x25')];var _0x1c3784;if(_0x15a32c>=_0xabf5ff){_0x15a32c=_0xabf5ff;_0x1c3784=0xc8;}else{_0x1c3784=0xce;}_0x2b1588[_0xd31a('0x20')](_0x1c3784);return _0x2b1588[_0xd31a('0x26')]('Content-Range',_0x158cc8+'-'+_0x15a32c+'/'+_0xabf5ff)[_0xd31a('0x22')](_0x5d8765);}return null;};}function patchUpdates(_0x5700d7){return function(_0x32cbf9){try{jsonpatch[_0xd31a('0x27')](_0x32cbf9,_0x5700d7,!![]);}catch(_0x4acddf){return BPromise[_0xd31a('0x28')](_0x4acddf);}return _0x32cbf9[_0xd31a('0x29')]();};}function saveUpdates(_0xb6888,_0x526d33){return function(_0x111256){if(_0x111256){return _0x111256['update'](_0xb6888)[_0xd31a('0x2a')](function(_0x503946){return _0x503946;});}return null;};}function removeEntity(_0x312786,_0x25471f){return function(_0x268bba){if(_0x268bba){return _0x268bba['destroy']()[_0xd31a('0x2a')](function(){var _0x2737f7=_0x268bba[_0xd31a('0x2b')]({'plain':!![]});var _0x4412d3='OpenchannelQueues';return db[_0xd31a('0x2c')]['destroy']({'where':{'type':_0x4412d3,'resourceId':_0x2737f7['id']}})[_0xd31a('0x2a')](function(){return _0x268bba;});})['then'](function(){_0x312786[_0xd31a('0x20')](0xcc)[_0xd31a('0x21')]();});}};}function handleEntityNotFound(_0x518f3d,_0x286af9){return function(_0x3292ae){if(!_0x3292ae){_0x518f3d[_0xd31a('0x1f')](0x194);}return _0x3292ae;};}function handleError(_0x31a9d6,_0x2fce76){_0x2fce76=_0x2fce76||0x1f4;return function(_0x24f396){logger[_0xd31a('0x2d')](_0x24f396[_0xd31a('0x2e')]);if(_0x24f396[_0xd31a('0x2f')]){delete _0x24f396[_0xd31a('0x2f')];}_0x31a9d6['status'](_0x2fce76)['send'](_0x24f396);};}exports['index']=function(_0x23d393,_0x5d8760){var _0x43a0f2={},_0x2c3e96={},_0x59026f={'count':0x0,'rows':[]};var _0x31614c=_['map'](db['OpenchannelQueue'][_0xd31a('0x30')],function(_0x5e0f3c){return{'name':_0x5e0f3c[_0xd31a('0x31')],'type':_0x5e0f3c['type']['key']};});_0x2c3e96[_0xd31a('0x32')]=_['map'](_0x31614c,_0xd31a('0x2f'));_0x2c3e96[_0xd31a('0x33')]=_[_0xd31a('0x34')](_0x23d393[_0xd31a('0x33')]);_0x2c3e96['filters']=_['intersection'](_0x2c3e96[_0xd31a('0x32')],_0x2c3e96['query']);_0x43a0f2[_0xd31a('0x35')]=_[_0xd31a('0x36')](_0x2c3e96[_0xd31a('0x32')],qs[_0xd31a('0x37')](_0x23d393[_0xd31a('0x33')][_0xd31a('0x37')]));_0x43a0f2[_0xd31a('0x35')]=_0x43a0f2[_0xd31a('0x35')][_0xd31a('0x38')]?_0x43a0f2['attributes']:_0x2c3e96['model'];if(!_0x23d393[_0xd31a('0x33')]['hasOwnProperty'](_0xd31a('0x39'))){_0x43a0f2['limit']=qs['limit'](_0x23d393['query']['limit']);_0x43a0f2[_0xd31a('0x23')]=qs['offset'](_0x23d393[_0xd31a('0x33')][_0xd31a('0x23')]);}_0x43a0f2[_0xd31a('0x3a')]=qs[_0xd31a('0x3b')](_0x23d393['query']['sort']);_0x43a0f2[_0xd31a('0x3c')]=qs[_0xd31a('0x3d')](_[_0xd31a('0x3e')](_0x23d393[_0xd31a('0x33')],_0x2c3e96['filters']),_0x31614c);if(_0x23d393['query'][_0xd31a('0x3f')]){_0x43a0f2[_0xd31a('0x3c')]=_[_0xd31a('0x40')](_0x43a0f2['where'],{'$or':_[_0xd31a('0x41')](_0x31614c,function(_0x410899){if(_0x410899[_0xd31a('0x42')]!==_0xd31a('0x43')){var _0x1356b2={};_0x1356b2[_0x410899[_0xd31a('0x2f')]]={'$like':'%'+_0x23d393[_0xd31a('0x33')][_0xd31a('0x3f')]+'%'};return _0x1356b2;}})});}_0x43a0f2=_['merge']({},_0x43a0f2,_0x23d393[_0xd31a('0x44')]);var _0x213b6a={'where':_0x43a0f2[_0xd31a('0x3c')]};return db[_0xd31a('0x45')][_0xd31a('0x46')](_0x213b6a)[_0xd31a('0x2a')](function(_0x8eb7f7){_0x59026f[_0xd31a('0x46')]=_0x8eb7f7;if(_0x23d393[_0xd31a('0x33')]['includeAll']){_0x43a0f2[_0xd31a('0x47')]=[{'all':!![]}];}return db[_0xd31a('0x45')]['findAll'](_0x43a0f2);})['then'](function(_0x541332){_0x59026f[_0xd31a('0x48')]=_0x541332;return _0x59026f;})['then'](respondWithFilteredResult(_0x5d8760,_0x43a0f2))[_0xd31a('0x49')](handleError(_0x5d8760,null));};exports[_0xd31a('0x4a')]=function(_0xb5ecf8,_0xbc9a23){var _0x3f323c={'raw':!![],'where':{'id':_0xb5ecf8[_0xd31a('0x4b')]['id']}},_0x634d87={};_0x634d87['model']=_[_0xd31a('0x34')](db['OpenchannelQueue']['rawAttributes']);_0x634d87['query']=_['keys'](_0xb5ecf8[_0xd31a('0x33')]);_0x634d87[_0xd31a('0x3d')]=_[_0xd31a('0x36')](_0x634d87[_0xd31a('0x32')],_0x634d87['query']);_0x3f323c[_0xd31a('0x35')]=_[_0xd31a('0x36')](_0x634d87['model'],qs[_0xd31a('0x37')](_0xb5ecf8[_0xd31a('0x33')]['fields']));_0x3f323c[_0xd31a('0x35')]=_0x3f323c[_0xd31a('0x35')]['length']?_0x3f323c[_0xd31a('0x35')]:_0x634d87['model'];if(_0xb5ecf8['query']['includeAll']){_0x3f323c['include']=[{'all':!![]}];}_0x3f323c=_[_0xd31a('0x40')]({},_0x3f323c,_0xb5ecf8[_0xd31a('0x44')]);return db[_0xd31a('0x45')][_0xd31a('0x4c')](_0x3f323c)[_0xd31a('0x2a')](handleEntityNotFound(_0xbc9a23,null))[_0xd31a('0x2a')](respondWithResult(_0xbc9a23,null))[_0xd31a('0x49')](handleError(_0xbc9a23,null));};exports[_0xd31a('0x4d')]=function(_0x3e6a75,_0x2ca641){return db[_0xd31a('0x45')][_0xd31a('0x4d')](_0x3e6a75['body'],{})[_0xd31a('0x2a')](function(_0x525179){var _0x4a5d17=_0x3e6a75[_0xd31a('0x4e')][_0xd31a('0x2b')]({'plain':!![]});if(!_0x4a5d17)throw new Error(_0xd31a('0x4f'));if(_0x4a5d17[_0xd31a('0x50')]===_0xd31a('0x4e')){var _0x5d1965=_0x525179[_0xd31a('0x2b')]({'plain':!![]});var _0xa8d7b9=_0xd31a('0x51');return db['UserProfileSection']['find']({'where':{'name':_0xa8d7b9,'userProfileId':_0x4a5d17[_0xd31a('0x52')]},'raw':!![]})['then'](function(_0x1ea1b1){if(_0x1ea1b1&&_0x1ea1b1[_0xd31a('0x53')]===0x0){return db[_0xd31a('0x2c')]['create']({'name':_0x5d1965[_0xd31a('0x2f')],'resourceId':_0x5d1965['id'],'type':_0x1ea1b1['name'],'sectionId':_0x1ea1b1['id']},{})[_0xd31a('0x2a')](function(){return _0x525179;});}else{return _0x525179;}})[_0xd31a('0x49')](function(_0x17bcff){logger[_0xd31a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17bcff);throw _0x17bcff;});}return _0x525179;})[_0xd31a('0x2a')](respondWithResult(_0x2ca641,0xc9))[_0xd31a('0x49')](handleError(_0x2ca641,null));};exports['update']=function(_0x215f1f,_0x2de13d){if(_0x215f1f[_0xd31a('0x54')]['id']){delete _0x215f1f[_0xd31a('0x54')]['id'];}return db[_0xd31a('0x45')][_0xd31a('0x4c')]({'where':{'id':_0x215f1f[_0xd31a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2de13d,null))['then'](saveUpdates(_0x215f1f['body'],null))[_0xd31a('0x2a')](respondWithResult(_0x2de13d,null))[_0xd31a('0x49')](handleError(_0x2de13d,null));};exports[_0xd31a('0x55')]=function(_0x25686e,_0x513c3d){return db['OpenchannelQueue'][_0xd31a('0x4c')]({'where':{'id':_0x25686e[_0xd31a('0x4b')]['id']}})[_0xd31a('0x2a')](handleEntityNotFound(_0x513c3d,null))[_0xd31a('0x2a')](removeEntity(_0x513c3d,null))[_0xd31a('0x49')](handleError(_0x513c3d,null));};exports[_0xd31a('0x56')]=function(_0x723f68,_0x37e12f){return db[_0xd31a('0x45')][_0xd31a('0x56')]()[_0xd31a('0x2a')](respondWithResult(_0x37e12f,null))['catch'](handleError(_0x37e12f,null));};exports[_0xd31a('0x57')]=function(_0x1c9576,_0x31e78b,_0x4042f3){var _0x12f44b={'raw':!![],'where':{}},_0x536aec={},_0x2556c8;return db[_0xd31a('0x45')][_0xd31a('0x58')]({'where':{'id':_0x1c9576['params']['id']}})['then'](handleEntityNotFound(_0x31e78b,null))['then'](function(_0x116348){if(_0x116348){_0x2556c8=_0x116348[_0xd31a('0x2b')]({'plain':!![]});_0x536aec['model']=_[_0xd31a('0x34')](db[_0xd31a('0x59')][_0xd31a('0x30')]);_0x536aec['query']=_[_0xd31a('0x34')](_0x1c9576[_0xd31a('0x33')]);_0x536aec[_0xd31a('0x3d')]=_[_0xd31a('0x36')](_0x536aec[_0xd31a('0x32')],_0x536aec[_0xd31a('0x33')]);_0x12f44b[_0xd31a('0x35')]=_[_0xd31a('0x36')](_0x536aec['model'],qs[_0xd31a('0x37')](_0x1c9576[_0xd31a('0x33')][_0xd31a('0x37')]));_0x12f44b['attributes']=_0x12f44b[_0xd31a('0x35')][_0xd31a('0x38')]?_0x12f44b[_0xd31a('0x35')]:_0x536aec[_0xd31a('0x32')];if(!_0x1c9576[_0xd31a('0x33')][_0xd31a('0x5a')](_0xd31a('0x39'))){_0x12f44b['limit']=qs[_0xd31a('0x25')](_0x1c9576[_0xd31a('0x33')]['limit']);_0x12f44b[_0xd31a('0x23')]=qs[_0xd31a('0x23')](_0x1c9576[_0xd31a('0x33')]['offset']);}_0x12f44b[_0xd31a('0x3a')]=qs[_0xd31a('0x3b')](_0x1c9576[_0xd31a('0x33')][_0xd31a('0x3b')]);_0x12f44b[_0xd31a('0x3c')]=qs[_0xd31a('0x3d')](_[_0xd31a('0x3e')](_0x1c9576[_0xd31a('0x33')],_0x536aec[_0xd31a('0x3d')]));_0x12f44b['where']['OpenchannelQueueId']=_0x116348['id'];if(_0x1c9576[_0xd31a('0x33')]['filter']){_0x12f44b['where']=_['merge'](_0x12f44b[_0xd31a('0x3c')],{'$or':_[_0xd31a('0x41')](_0x12f44b[_0xd31a('0x35')],function(_0x5c33cb){var _0x3e3ae8={};_0x3e3ae8[_0x5c33cb]={'$like':'%'+_0x1c9576[_0xd31a('0x33')][_0xd31a('0x3f')]+'%'};return _0x3e3ae8;})});}_0x12f44b=_['merge']({},_0x12f44b,_0x1c9576[_0xd31a('0x44')]);return db[_0xd31a('0x59')][_0xd31a('0x5b')](_0x12f44b);}})[_0xd31a('0x2a')](function(_0x874120){if(_0x874120){return db[_0xd31a('0x5c')][_0xd31a('0x5d')]({'where':{'id':_[_0xd31a('0x41')](_0x874120,_0xd31a('0x5e')),'role':_0xd31a('0x5f')},'attributes':['id',_0xd31a('0x2f'),_0xd31a('0x60'),'updatedAt','createdAt']});}})['then'](function(_0x21e140){if(_0x21e140){return{'count':_0x21e140['count'],'rows':_[_0xd31a('0x41')](_0x21e140[_0xd31a('0x48')],function(_0x44a86b){return{'membername':_0x44a86b[_0xd31a('0x2f')],'UserId':_0x44a86b['id'],'queue_name':_0x2556c8[_0xd31a('0x2f')],'OpenchannelQueueId':_0x2556c8['id'],'interface':util[_0xd31a('0x61')](_0xd31a('0x62'),'SIP',_0x44a86b[_0xd31a('0x2f')]),'penalty':0x0,'paused':_0x44a86b[_0xd31a('0x60')],'createdAt':_0x44a86b[_0xd31a('0x63')],'updatedAt':_0x44a86b[_0xd31a('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31e78b,_0x12f44b))[_0xd31a('0x49')](handleError(_0x31e78b,null));};exports[_0xd31a('0x65')]=function(_0x915bba,_0x26e764,_0x2939b8){var _0x1e35ee={};var _0x588d06={};var _0x2efd37;var _0x1d13c1;return db['OpenchannelQueue'][_0xd31a('0x58')]({'where':{'id':_0x915bba['params']['id']}})[_0xd31a('0x2a')](handleEntityNotFound(_0x26e764,null))['then'](function(_0x9eb3){if(_0x9eb3){_0x2efd37=_0x9eb3;_0x588d06[_0xd31a('0x32')]=_[_0xd31a('0x34')](db[_0xd31a('0x66')][_0xd31a('0x30')]);_0x588d06[_0xd31a('0x33')]=_[_0xd31a('0x34')](_0x915bba['query']);_0x588d06['filters']=_[_0xd31a('0x36')](_0x588d06[_0xd31a('0x32')],_0x588d06['query']);_0x1e35ee[_0xd31a('0x35')]=_[_0xd31a('0x36')](_0x588d06['model'],qs['fields'](_0x915bba[_0xd31a('0x33')][_0xd31a('0x37')]));_0x1e35ee['attributes']=_0x1e35ee[_0xd31a('0x35')][_0xd31a('0x38')]?_0x1e35ee['attributes']:_0x588d06[_0xd31a('0x32')];_0x1e35ee[_0xd31a('0x3a')]=qs[_0xd31a('0x3b')](_0x915bba[_0xd31a('0x33')][_0xd31a('0x3b')]);_0x1e35ee[_0xd31a('0x3c')]=qs[_0xd31a('0x3d')](_[_0xd31a('0x3e')](_0x915bba[_0xd31a('0x33')],_0x588d06[_0xd31a('0x3d')]));if(_0x915bba[_0xd31a('0x33')][_0xd31a('0x3f')]){_0x1e35ee[_0xd31a('0x3c')]=_[_0xd31a('0x40')](_0x1e35ee[_0xd31a('0x3c')],{'$or':_[_0xd31a('0x41')](_0x1e35ee[_0xd31a('0x35')],function(_0x1f6b68){var _0x58d391={};_0x58d391[_0x1f6b68]={'$like':'%'+_0x915bba['query'][_0xd31a('0x3f')]+'%'};return _0x58d391;})});}_0x1e35ee=_[_0xd31a('0x40')]({},_0x1e35ee,_0x915bba[_0xd31a('0x44')]);return _0x2efd37['getTeams'](_0x1e35ee);}})['then'](function(_0x179ad4){if(_0x179ad4){_0x1d13c1=_0x179ad4['length'];if(!_0x915bba[_0xd31a('0x33')][_0xd31a('0x5a')](_0xd31a('0x39'))){_0x1e35ee[_0xd31a('0x25')]=qs[_0xd31a('0x25')](_0x915bba[_0xd31a('0x33')]['limit']);_0x1e35ee[_0xd31a('0x23')]=qs[_0xd31a('0x23')](_0x915bba['query'][_0xd31a('0x23')]);}return _0x2efd37[_0xd31a('0x65')](_0x1e35ee);}})[_0xd31a('0x2a')](function(_0x5e2fc7){if(_0x5e2fc7){return _0x5e2fc7?{'count':_0x1d13c1,'rows':_0x5e2fc7}:null;}})[_0xd31a('0x2a')](respondWithResult(_0x26e764,null))['catch'](handleError(_0x26e764,null));};exports[_0xd31a('0x67')]=function(_0x10b8a0,_0x72f4f0,_0xc7a686){var _0x1e8c8d=_0x10b8a0['body']['ids'];return db[_0xd31a('0x66')][_0xd31a('0x5b')]({'where':{'id':_0x1e8c8d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd31a('0x68'),'attributes':['id','name','online',_0xd31a('0x69'),_0xd31a('0x6a')],'raw':!![]}]})[_0xd31a('0x2a')](function(_0x2e441f){if(_0x2e441f){var _0xc355a8=_[_0xd31a('0x6b')](_0x2e441f,function(_0x3bb516){var _0x4c720c=_0x3bb516[_0xd31a('0x2b')]({'plain':!![]});return _0x4c720c[_0xd31a('0x68')];});return db[_0xd31a('0x45')]['find']({'where':{'id':_0x10b8a0[_0xd31a('0x4b')]['id']}})['then'](function(_0x51245c){return db[_0xd31a('0x6c')][_0xd31a('0x6d')](function(_0x36a231){return _0x51245c['addTeams'](_0x1e8c8d,{'transaction':_0x36a231})[_0xd31a('0x2a')](function(){return BPromise['each'](_0xc355a8,function(_0x3003ce){return db[_0xd31a('0x59')][_0xd31a('0x6e')]({'where':{'UserId':_0x3003ce['id'],'OpenchannelQueueId':_0x10b8a0[_0xd31a('0x4b')]['id']},'transaction':_0x36a231});});})['then'](function(){_0xc355a8[_0xd31a('0x6f')](function(_0x3c931e){socket[_0xd31a('0x70')]('userOpenchannelQueue:save',{'UserId':_0x3c931e['id'],'OpenchannelQueueId':_0x51245c['id']});});});});});}})[_0xd31a('0x2a')](respondWithStatusCode(_0x72f4f0,null))[_0xd31a('0x49')](handleError(_0x72f4f0,null));};exports['removeTeams']=function(_0x25e279,_0x46d7a8,_0x292895){return db[_0xd31a('0x66')][_0xd31a('0x5b')]({'where':{'id':_0x25e279[_0xd31a('0x33')][_0xd31a('0x71')]},'attributes':['id'],'include':[{'model':db[_0xd31a('0x5c')],'as':_0xd31a('0x68'),'attributes':['id'],'raw':!![]}]})[_0xd31a('0x2a')](handleEntityNotFound(_0x46d7a8,null))['then'](function(_0x2c57ae){var _0x1ef5c5=_[_0xd31a('0x41')](_0x2c57ae,'id');var _0xbaf4a0=[];var _0x131e4e=[];var _0x38c30d=squel['select']();_0x38c30d['field']('tq.TeamId')[_0xd31a('0x72')](_0xd31a('0x73'),'tq')['join'](_0xd31a('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd31a('0x75'),_0x25e279[_0xd31a('0x4b')]['id']);for(var _0x42c62c=0x0;_0x42c62c<_0x2c57ae[_0xd31a('0x38')];_0x42c62c+=0x1){let _0x518502=_0x2c57ae[_0x42c62c];for(var _0x5af7a8=0x0;_0x5af7a8<_0x518502[_0xd31a('0x68')][_0xd31a('0x38')];_0x5af7a8+=0x1){let _0x5a8035=_0x518502['Agents'][_0x5af7a8];var _0x1465a0=_0x38c30d['clone']();_0x1465a0[_0xd31a('0x3c')](_0xd31a('0x76'),_0x5a8035['id']);_0x131e4e[_0xd31a('0x77')](db[_0xd31a('0x6c')][_0xd31a('0x33')](_0x1465a0[_0xd31a('0x78')](),{'type':db[_0xd31a('0x6c')]['QueryTypes'][_0xd31a('0x79')]})[_0xd31a('0x2a')](function(_0x1b8c98){if(_0x1b8c98[_0xd31a('0x38')]===0x1){return _0x5a8035['id'];}else{var _0x5a00b2=_[_0xd31a('0x7a')](_[_0xd31a('0x41')](_0x1b8c98,_0xd31a('0x7b')),function(_0x926284){return _[_0xd31a('0x7c')](_0x1ef5c5,_0x926284);});if(_0x5a00b2){return _0x5a8035['id'];}}}));}}return BPromise[_0xd31a('0x7d')](_0x131e4e)[_0xd31a('0x2a')](function(_0xfe606d){_0xbaf4a0=_(_0xbaf4a0)['union'](_0xfe606d)['compact']()[_0xd31a('0x7e')]();return db['OpenchannelQueue'][_0xd31a('0x4c')]({'where':{'id':_0x25e279['params']['id']}})[_0xd31a('0x2a')](function(_0x376d12){return db[_0xd31a('0x6c')][_0xd31a('0x6d')](function(_0x4861de){return _0x376d12[_0xd31a('0x7f')](_0x25e279['query'][_0xd31a('0x71')],{'transaction':_0x4861de})[_0xd31a('0x2a')](function(){if(!_['isEmpty'](_0xbaf4a0)){return _0x376d12[_0xd31a('0x80')](_0xbaf4a0,{'transaction':_0x4861de});}})[_0xd31a('0x2a')](function(){_0xbaf4a0[_0xd31a('0x6f')](function(_0x5b58e0){socket[_0xd31a('0x70')](_0xd31a('0x81'),{'UserId':_0x5b58e0,'OpenchannelQueueId':_0x376d12['id']});});});});});});})[_0xd31a('0x2a')](respondWithStatusCode(_0x46d7a8,null))[_0xd31a('0x49')](handleError(_0x46d7a8,null));};exports['addAgents']=function(_0x465c02,_0x7c32a9,_0x16ce63){return db[_0xd31a('0x45')][_0xd31a('0x4c')]({'where':{'id':_0x465c02['params']['id']}})[_0xd31a('0x2a')](handleEntityNotFound(_0x7c32a9,null))[_0xd31a('0x2a')](function(_0x55dd26){if(_0x55dd26){return _0x55dd26['addAgents'](_0x465c02[_0xd31a('0x54')][_0xd31a('0x71')],_[_0xd31a('0x82')](_0x465c02[_0xd31a('0x54')],[_0xd31a('0x71'),'id'])||{})[_0xd31a('0x83')](function(_0x338f4f){for(var _0x4758f6=0x0;_0x4758f6<_0x465c02[_0xd31a('0x54')]['ids'][_0xd31a('0x38')];_0x4758f6+=0x1){socket[_0xd31a('0x70')]('userOpenchannelQueue:save',{'UserId':Number(_0x465c02[_0xd31a('0x54')][_0xd31a('0x71')][_0x4758f6]),'OpenchannelQueueId':Number(_0x465c02[_0xd31a('0x4b')]['id'])});}return _0x338f4f;});}})[_0xd31a('0x2a')](respondWithResult(_0x7c32a9,null))[_0xd31a('0x49')](handleError(_0x7c32a9,null));};exports[_0xd31a('0x80')]=function(_0x4ac7e0,_0x2a5e4a,_0x214b15){return db[_0xd31a('0x45')][_0xd31a('0x4c')]({'where':{'id':_0x4ac7e0[_0xd31a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a5e4a,null))[_0xd31a('0x2a')](function(_0x295cec){if(_0x295cec){return _0x295cec[_0xd31a('0x80')](_0x4ac7e0[_0xd31a('0x33')][_0xd31a('0x71')])[_0xd31a('0x2a')](function(){if(_['isArray'](_0x4ac7e0['query'][_0xd31a('0x71')])){for(var _0x4ea4f7=0x0;_0x4ea4f7<_0x4ac7e0[_0xd31a('0x33')][_0xd31a('0x71')]['length'];_0x4ea4f7+=0x1){socket[_0xd31a('0x70')](_0xd31a('0x81'),{'UserId':Number(_0x4ac7e0[_0xd31a('0x33')][_0xd31a('0x71')][_0x4ea4f7]),'OpenchannelQueueId':Number(_0x4ac7e0[_0xd31a('0x4b')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x4ac7e0[_0xd31a('0x33')][_0xd31a('0x71')]),'OpenchannelQueueId':Number(_0x4ac7e0[_0xd31a('0x4b')]['id'])});}});}})[_0xd31a('0x2a')](respondWithStatusCode(_0x2a5e4a,null))[_0xd31a('0x49')](handleError(_0x2a5e4a,null));};exports[_0xd31a('0x84')]=function(_0x2bc422,_0x1d394e,_0x4a6ced){var _0x1f729e={};var _0x29d0bd={};var _0x22a479;var _0x5c33e9;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x2bc422[_0xd31a('0x4b')]['id']}})[_0xd31a('0x2a')](handleEntityNotFound(_0x1d394e,null))[_0xd31a('0x2a')](function(_0x35fa4d){if(_0x35fa4d){_0x22a479=_0x35fa4d;_0x29d0bd['model']=_['keys'](db[_0xd31a('0x5c')]['rawAttributes']);_0x29d0bd[_0xd31a('0x33')]=_['keys'](_0x2bc422['query']);_0x29d0bd[_0xd31a('0x3d')]=_[_0xd31a('0x36')](_0x29d0bd['model'],_0x29d0bd[_0xd31a('0x33')]);_0x1f729e[_0xd31a('0x35')]=_[_0xd31a('0x36')](_0x29d0bd[_0xd31a('0x32')],qs[_0xd31a('0x37')](_0x2bc422[_0xd31a('0x33')][_0xd31a('0x37')]));_0x1f729e[_0xd31a('0x35')]=_0x1f729e[_0xd31a('0x35')][_0xd31a('0x38')]?_0x1f729e[_0xd31a('0x35')]:_0x29d0bd[_0xd31a('0x32')];_0x1f729e[_0xd31a('0x3a')]=qs[_0xd31a('0x3b')](_0x2bc422[_0xd31a('0x33')][_0xd31a('0x3b')]);_0x1f729e['where']=qs['filters'](_[_0xd31a('0x3e')](_0x2bc422[_0xd31a('0x33')],_0x29d0bd[_0xd31a('0x3d')]));if(_0x2bc422[_0xd31a('0x33')][_0xd31a('0x3f')]){_0x1f729e[_0xd31a('0x3c')]=_[_0xd31a('0x40')](_0x1f729e['where'],{'$or':_[_0xd31a('0x41')](_0x1f729e[_0xd31a('0x35')],function(_0x29244c){var _0x37ea68={};_0x37ea68[_0x29244c]={'$like':'%'+_0x2bc422[_0xd31a('0x33')][_0xd31a('0x3f')]+'%'};return _0x37ea68;})});}_0x1f729e=_[_0xd31a('0x40')]({},_0x1f729e,_0x2bc422[_0xd31a('0x44')]);return _0x22a479[_0xd31a('0x84')](_0x1f729e);}})['then'](function(_0x1fffb5){if(_0x1fffb5){_0x5c33e9=_0x1fffb5['length'];if(!_0x2bc422[_0xd31a('0x33')]['hasOwnProperty'](_0xd31a('0x39'))){_0x1f729e[_0xd31a('0x25')]=qs['limit'](_0x2bc422['query'][_0xd31a('0x25')]);_0x1f729e[_0xd31a('0x23')]=qs[_0xd31a('0x23')](_0x2bc422[_0xd31a('0x33')][_0xd31a('0x23')]);}return _0x22a479[_0xd31a('0x84')](_0x1f729e);}})['then'](function(_0x1399fd){if(_0x1399fd){return _0x1399fd?{'count':_0x5c33e9,'rows':_0x1399fd}:null;}})['then'](respondWithResult(_0x1d394e,null))[_0xd31a('0x49')](handleError(_0x1d394e,null));}; \ No newline at end of file +var _0x3f9d=['filter','merge','VIRTUAL','options','OpenchannelQueue','includeAll','findAll','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','every','all','union','compact','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','emit','getAgents','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','OpenchannelQueues','end','error','stack','send','index','map','rawAttributes','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x3cbd4f,_0x1eaf24){var _0x4ed6f2=function(_0x15f36d){while(--_0x15f36d){_0x3cbd4f['push'](_0x3cbd4f['shift']());}};_0x4ed6f2(++_0x1eaf24);}(_0x3f9d,0x15e));var _0xd3f9=function(_0x400d28,_0x368388){_0x400d28=_0x400d28-0x0;var _0x44808a=_0x3f9d[_0x400d28];return _0x44808a;};'use strict';var emlformat=require(_0xd3f9('0x0'));var rimraf=require(_0xd3f9('0x1'));var zipdir=require(_0xd3f9('0x2'));var jsonpatch=require(_0xd3f9('0x3'));var rp=require(_0xd3f9('0x4'));var moment=require(_0xd3f9('0x5'));var BPromise=require(_0xd3f9('0x6'));var Mustache=require(_0xd3f9('0x7'));var util=require(_0xd3f9('0x8'));var path=require(_0xd3f9('0x9'));var sox=require(_0xd3f9('0xa'));var csv=require(_0xd3f9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd3f9('0xc'));var crypto=require(_0xd3f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd3f9('0xe'));var toCsv=require(_0xd3f9('0xb'));var querystring=require(_0xd3f9('0xf'));var Papa=require(_0xd3f9('0x10'));var Redis=require('ioredis');var authService=require(_0xd3f9('0x11'));var qs=require(_0xd3f9('0x12'));var as=require(_0xd3f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3f9('0x14'))(_0xd3f9('0x15'));var utils=require(_0xd3f9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd3f9('0x17'));var db=require('../../mysqldb')['db'];config[_0xd3f9('0x18')]=_[_0xd3f9('0x19')](config[_0xd3f9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd3f9('0x1a'))(new Redis(config[_0xd3f9('0x18')]));require(_0xd3f9('0x1b'))[_0xd3f9('0x1c')](socket);function respondWithStatusCode(_0x4c93d0,_0x4b65ae){_0x4b65ae=_0x4b65ae||0xcc;return function(_0x3b9867){if(_0x3b9867){return _0x4c93d0[_0xd3f9('0x1d')](_0x4b65ae);}return _0x4c93d0['status'](_0x4b65ae)['end']();};}function respondWithResult(_0x2a75e4,_0x1d6847){_0x1d6847=_0x1d6847||0xc8;return function(_0x418fea){if(_0x418fea){return _0x2a75e4[_0xd3f9('0x1e')](_0x1d6847)[_0xd3f9('0x1f')](_0x418fea);}};}function respondWithFilteredResult(_0x405ddc,_0x59fb63){return function(_0x16fa8c){if(_0x16fa8c){var _0x4d7d89=typeof _0x59fb63[_0xd3f9('0x20')]===_0xd3f9('0x21')&&typeof _0x59fb63[_0xd3f9('0x22')]===_0xd3f9('0x21');var _0xdac6e6=_0x16fa8c[_0xd3f9('0x23')];var _0x3ae715=_0x4d7d89?0x0:_0x59fb63[_0xd3f9('0x20')];var _0x43f545=_0x4d7d89?_0x16fa8c['count']:_0x59fb63['offset']+_0x59fb63[_0xd3f9('0x22')];var _0x499c81;if(_0x43f545>=_0xdac6e6){_0x43f545=_0xdac6e6;_0x499c81=0xc8;}else{_0x499c81=0xce;}_0x405ddc[_0xd3f9('0x1e')](_0x499c81);return _0x405ddc[_0xd3f9('0x24')](_0xd3f9('0x25'),_0x3ae715+'-'+_0x43f545+'/'+_0xdac6e6)[_0xd3f9('0x1f')](_0x16fa8c);}return null;};}function patchUpdates(_0x4f5c67){return function(_0x1337ce){try{jsonpatch[_0xd3f9('0x26')](_0x1337ce,_0x4f5c67,!![]);}catch(_0x14af2e){return BPromise[_0xd3f9('0x27')](_0x14af2e);}return _0x1337ce['save']();};}function saveUpdates(_0x591367,_0x2562ed){return function(_0xf113b){if(_0xf113b){return _0xf113b[_0xd3f9('0x28')](_0x591367)[_0xd3f9('0x29')](function(_0x1fc58d){return _0x1fc58d;});}return null;};}function removeEntity(_0x10e915,_0x496578){return function(_0xce0443){if(_0xce0443){return _0xce0443[_0xd3f9('0x2a')]()[_0xd3f9('0x29')](function(){var _0x393e44=_0xce0443[_0xd3f9('0x2b')]({'plain':!![]});var _0x1ac497=_0xd3f9('0x2c');return db['UserProfileResource'][_0xd3f9('0x2a')]({'where':{'type':_0x1ac497,'resourceId':_0x393e44['id']}})[_0xd3f9('0x29')](function(){return _0xce0443;});})[_0xd3f9('0x29')](function(){_0x10e915[_0xd3f9('0x1e')](0xcc)[_0xd3f9('0x2d')]();});}};}function handleEntityNotFound(_0x56cd30,_0x3f140a){return function(_0x950efc){if(!_0x950efc){_0x56cd30[_0xd3f9('0x1d')](0x194);}return _0x950efc;};}function handleError(_0xba5332,_0x44b85e){_0x44b85e=_0x44b85e||0x1f4;return function(_0x3b7d12){logger[_0xd3f9('0x2e')](_0x3b7d12[_0xd3f9('0x2f')]);if(_0x3b7d12['name']){delete _0x3b7d12['name'];}_0xba5332[_0xd3f9('0x1e')](_0x44b85e)[_0xd3f9('0x30')](_0x3b7d12);};}exports[_0xd3f9('0x31')]=function(_0x10e2bc,_0x589201){var _0x50f3da={},_0x5a8428={},_0x2d3c2e={'count':0x0,'rows':[]};var _0x34e776=_[_0xd3f9('0x32')](db['OpenchannelQueue'][_0xd3f9('0x33')],function(_0x1c4b96){return{'name':_0x1c4b96['fieldName'],'type':_0x1c4b96[_0xd3f9('0x34')][_0xd3f9('0x35')]};});_0x5a8428[_0xd3f9('0x36')]=_['map'](_0x34e776,_0xd3f9('0x37'));_0x5a8428['query']=_[_0xd3f9('0x38')](_0x10e2bc[_0xd3f9('0x39')]);_0x5a8428[_0xd3f9('0x3a')]=_[_0xd3f9('0x3b')](_0x5a8428[_0xd3f9('0x36')],_0x5a8428[_0xd3f9('0x39')]);_0x50f3da['attributes']=_[_0xd3f9('0x3b')](_0x5a8428[_0xd3f9('0x36')],qs[_0xd3f9('0x3c')](_0x10e2bc['query'][_0xd3f9('0x3c')]));_0x50f3da[_0xd3f9('0x3d')]=_0x50f3da[_0xd3f9('0x3d')][_0xd3f9('0x3e')]?_0x50f3da[_0xd3f9('0x3d')]:_0x5a8428[_0xd3f9('0x36')];if(!_0x10e2bc[_0xd3f9('0x39')][_0xd3f9('0x3f')]('nolimit')){_0x50f3da[_0xd3f9('0x22')]=qs['limit'](_0x10e2bc['query']['limit']);_0x50f3da[_0xd3f9('0x20')]=qs[_0xd3f9('0x20')](_0x10e2bc[_0xd3f9('0x39')][_0xd3f9('0x20')]);}_0x50f3da[_0xd3f9('0x40')]=qs[_0xd3f9('0x41')](_0x10e2bc[_0xd3f9('0x39')][_0xd3f9('0x41')]);_0x50f3da[_0xd3f9('0x42')]=qs[_0xd3f9('0x3a')](_['pick'](_0x10e2bc[_0xd3f9('0x39')],_0x5a8428[_0xd3f9('0x3a')]),_0x34e776);if(_0x10e2bc[_0xd3f9('0x39')][_0xd3f9('0x43')]){_0x50f3da[_0xd3f9('0x42')]=_[_0xd3f9('0x44')](_0x50f3da['where'],{'$or':_[_0xd3f9('0x32')](_0x34e776,function(_0x4d07d6){if(_0x4d07d6[_0xd3f9('0x34')]!==_0xd3f9('0x45')){var _0x3334be={};_0x3334be[_0x4d07d6[_0xd3f9('0x37')]]={'$like':'%'+_0x10e2bc[_0xd3f9('0x39')][_0xd3f9('0x43')]+'%'};return _0x3334be;}})});}_0x50f3da=_[_0xd3f9('0x44')]({},_0x50f3da,_0x10e2bc[_0xd3f9('0x46')]);var _0x570378={'where':_0x50f3da[_0xd3f9('0x42')]};return db[_0xd3f9('0x47')][_0xd3f9('0x23')](_0x570378)[_0xd3f9('0x29')](function(_0x59ee0d){_0x2d3c2e[_0xd3f9('0x23')]=_0x59ee0d;if(_0x10e2bc[_0xd3f9('0x39')][_0xd3f9('0x48')]){_0x50f3da['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0xd3f9('0x49')](_0x50f3da);})[_0xd3f9('0x29')](function(_0x2eb2b7){_0x2d3c2e['rows']=_0x2eb2b7;return _0x2d3c2e;})[_0xd3f9('0x29')](respondWithFilteredResult(_0x589201,_0x50f3da))[_0xd3f9('0x4a')](handleError(_0x589201,null));};exports['show']=function(_0x41d7b6,_0x3ade0f){var _0x40490e={'raw':!![],'where':{'id':_0x41d7b6[_0xd3f9('0x4b')]['id']}},_0x2754de={};_0x2754de[_0xd3f9('0x36')]=_[_0xd3f9('0x38')](db['OpenchannelQueue'][_0xd3f9('0x33')]);_0x2754de[_0xd3f9('0x39')]=_['keys'](_0x41d7b6['query']);_0x2754de[_0xd3f9('0x3a')]=_['intersection'](_0x2754de[_0xd3f9('0x36')],_0x2754de[_0xd3f9('0x39')]);_0x40490e[_0xd3f9('0x3d')]=_[_0xd3f9('0x3b')](_0x2754de['model'],qs[_0xd3f9('0x3c')](_0x41d7b6[_0xd3f9('0x39')][_0xd3f9('0x3c')]));_0x40490e[_0xd3f9('0x3d')]=_0x40490e[_0xd3f9('0x3d')][_0xd3f9('0x3e')]?_0x40490e[_0xd3f9('0x3d')]:_0x2754de[_0xd3f9('0x36')];if(_0x41d7b6[_0xd3f9('0x39')][_0xd3f9('0x48')]){_0x40490e[_0xd3f9('0x4c')]=[{'all':!![]}];}_0x40490e=_[_0xd3f9('0x44')]({},_0x40490e,_0x41d7b6[_0xd3f9('0x46')]);return db[_0xd3f9('0x47')][_0xd3f9('0x4d')](_0x40490e)[_0xd3f9('0x29')](handleEntityNotFound(_0x3ade0f,null))[_0xd3f9('0x29')](respondWithResult(_0x3ade0f,null))[_0xd3f9('0x4a')](handleError(_0x3ade0f,null));};exports[_0xd3f9('0x4e')]=function(_0xa285ae,_0x912850){return db[_0xd3f9('0x47')][_0xd3f9('0x4e')](_0xa285ae[_0xd3f9('0x4f')],{})[_0xd3f9('0x29')](function(_0x5caee1){var _0x5ee9eb=_0xa285ae[_0xd3f9('0x50')][_0xd3f9('0x2b')]({'plain':!![]});if(!_0x5ee9eb)throw new Error(_0xd3f9('0x51'));if(_0x5ee9eb[_0xd3f9('0x52')]==='user'){var _0x327e65=_0x5caee1['get']({'plain':!![]});var _0x449a85=_0xd3f9('0x2c');return db[_0xd3f9('0x53')][_0xd3f9('0x4d')]({'where':{'name':_0x449a85,'userProfileId':_0x5ee9eb['userProfileId']},'raw':!![]})[_0xd3f9('0x29')](function(_0x1686c1){if(_0x1686c1&&_0x1686c1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x327e65['name'],'resourceId':_0x327e65['id'],'type':_0x1686c1['name'],'sectionId':_0x1686c1['id']},{})['then'](function(){return _0x5caee1;});}else{return _0x5caee1;}})[_0xd3f9('0x4a')](function(_0x1ad4b2){logger[_0xd3f9('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ad4b2);throw _0x1ad4b2;});}return _0x5caee1;})[_0xd3f9('0x29')](respondWithResult(_0x912850,0xc9))[_0xd3f9('0x4a')](handleError(_0x912850,null));};exports['update']=function(_0x490470,_0x5508eb){if(_0x490470['body']['id']){delete _0x490470[_0xd3f9('0x4f')]['id'];}return db[_0xd3f9('0x47')]['find']({'where':{'id':_0x490470[_0xd3f9('0x4b')]['id']}})[_0xd3f9('0x29')](handleEntityNotFound(_0x5508eb,null))[_0xd3f9('0x29')](saveUpdates(_0x490470['body'],null))[_0xd3f9('0x29')](respondWithResult(_0x5508eb,null))['catch'](handleError(_0x5508eb,null));};exports[_0xd3f9('0x2a')]=function(_0x3bef43,_0x48b38a){return db[_0xd3f9('0x47')][_0xd3f9('0x4d')]({'where':{'id':_0x3bef43['params']['id']}})[_0xd3f9('0x29')](handleEntityNotFound(_0x48b38a,null))[_0xd3f9('0x29')](removeEntity(_0x48b38a,null))[_0xd3f9('0x4a')](handleError(_0x48b38a,null));};exports[_0xd3f9('0x54')]=function(_0x24d439,_0x3da2b5){return db[_0xd3f9('0x47')]['describe']()[_0xd3f9('0x29')](respondWithResult(_0x3da2b5,null))['catch'](handleError(_0x3da2b5,null));};exports[_0xd3f9('0x55')]=function(_0x275c57,_0x488f8a,_0x393cf7){var _0x8b55ee={'raw':!![],'where':{}},_0x529567={},_0x6cb1af;return db[_0xd3f9('0x47')][_0xd3f9('0x56')]({'where':{'id':_0x275c57['params']['id']}})[_0xd3f9('0x29')](handleEntityNotFound(_0x488f8a,null))[_0xd3f9('0x29')](function(_0x55f617){if(_0x55f617){_0x6cb1af=_0x55f617[_0xd3f9('0x2b')]({'plain':!![]});_0x529567['model']=_[_0xd3f9('0x38')](db[_0xd3f9('0x57')]['rawAttributes']);_0x529567[_0xd3f9('0x39')]=_['keys'](_0x275c57[_0xd3f9('0x39')]);_0x529567[_0xd3f9('0x3a')]=_[_0xd3f9('0x3b')](_0x529567[_0xd3f9('0x36')],_0x529567['query']);_0x8b55ee[_0xd3f9('0x3d')]=_['intersection'](_0x529567[_0xd3f9('0x36')],qs[_0xd3f9('0x3c')](_0x275c57[_0xd3f9('0x39')][_0xd3f9('0x3c')]));_0x8b55ee[_0xd3f9('0x3d')]=_0x8b55ee[_0xd3f9('0x3d')][_0xd3f9('0x3e')]?_0x8b55ee[_0xd3f9('0x3d')]:_0x529567[_0xd3f9('0x36')];if(!_0x275c57[_0xd3f9('0x39')]['hasOwnProperty'](_0xd3f9('0x58'))){_0x8b55ee[_0xd3f9('0x22')]=qs[_0xd3f9('0x22')](_0x275c57['query']['limit']);_0x8b55ee[_0xd3f9('0x20')]=qs['offset'](_0x275c57[_0xd3f9('0x39')][_0xd3f9('0x20')]);}_0x8b55ee[_0xd3f9('0x40')]=qs[_0xd3f9('0x41')](_0x275c57['query'][_0xd3f9('0x41')]);_0x8b55ee[_0xd3f9('0x42')]=qs['filters'](_['pick'](_0x275c57[_0xd3f9('0x39')],_0x529567[_0xd3f9('0x3a')]));_0x8b55ee[_0xd3f9('0x42')][_0xd3f9('0x59')]=_0x55f617['id'];if(_0x275c57['query'][_0xd3f9('0x43')]){_0x8b55ee['where']=_['merge'](_0x8b55ee[_0xd3f9('0x42')],{'$or':_[_0xd3f9('0x32')](_0x8b55ee[_0xd3f9('0x3d')],function(_0x4ae17b){var _0xd7d4fa={};_0xd7d4fa[_0x4ae17b]={'$like':'%'+_0x275c57[_0xd3f9('0x39')][_0xd3f9('0x43')]+'%'};return _0xd7d4fa;})});}_0x8b55ee=_[_0xd3f9('0x44')]({},_0x8b55ee,_0x275c57[_0xd3f9('0x46')]);return db[_0xd3f9('0x57')][_0xd3f9('0x49')](_0x8b55ee);}})[_0xd3f9('0x29')](function(_0x1790ef){if(_0x1790ef){return db[_0xd3f9('0x5a')][_0xd3f9('0x5b')]({'where':{'id':_[_0xd3f9('0x32')](_0x1790ef,_0xd3f9('0x5c')),'role':_0xd3f9('0x5d')},'attributes':['id',_0xd3f9('0x37'),_0xd3f9('0x5e'),_0xd3f9('0x5f'),_0xd3f9('0x60')]});}})[_0xd3f9('0x29')](function(_0x160dab){if(_0x160dab){return{'count':_0x160dab['count'],'rows':_[_0xd3f9('0x32')](_0x160dab[_0xd3f9('0x61')],function(_0x225c2e){return{'membername':_0x225c2e[_0xd3f9('0x37')],'UserId':_0x225c2e['id'],'queue_name':_0x6cb1af[_0xd3f9('0x37')],'OpenchannelQueueId':_0x6cb1af['id'],'interface':util[_0xd3f9('0x62')](_0xd3f9('0x63'),_0xd3f9('0x64'),_0x225c2e[_0xd3f9('0x37')]),'penalty':0x0,'paused':_0x225c2e[_0xd3f9('0x5e')],'createdAt':_0x225c2e[_0xd3f9('0x60')],'updatedAt':_0x225c2e[_0xd3f9('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd3f9('0x29')](respondWithFilteredResult(_0x488f8a,_0x8b55ee))[_0xd3f9('0x4a')](handleError(_0x488f8a,null));};exports[_0xd3f9('0x65')]=function(_0x54e22a,_0x715c5c,_0x349aeb){var _0x4be470={};var _0x47d6b6={};var _0x384217;var _0x3c8a61;return db[_0xd3f9('0x47')]['findOne']({'where':{'id':_0x54e22a[_0xd3f9('0x4b')]['id']}})[_0xd3f9('0x29')](handleEntityNotFound(_0x715c5c,null))[_0xd3f9('0x29')](function(_0xe39655){if(_0xe39655){_0x384217=_0xe39655;_0x47d6b6['model']=_[_0xd3f9('0x38')](db['Team'][_0xd3f9('0x33')]);_0x47d6b6[_0xd3f9('0x39')]=_[_0xd3f9('0x38')](_0x54e22a[_0xd3f9('0x39')]);_0x47d6b6['filters']=_['intersection'](_0x47d6b6[_0xd3f9('0x36')],_0x47d6b6[_0xd3f9('0x39')]);_0x4be470[_0xd3f9('0x3d')]=_['intersection'](_0x47d6b6[_0xd3f9('0x36')],qs[_0xd3f9('0x3c')](_0x54e22a[_0xd3f9('0x39')][_0xd3f9('0x3c')]));_0x4be470[_0xd3f9('0x3d')]=_0x4be470[_0xd3f9('0x3d')][_0xd3f9('0x3e')]?_0x4be470['attributes']:_0x47d6b6[_0xd3f9('0x36')];_0x4be470[_0xd3f9('0x40')]=qs[_0xd3f9('0x41')](_0x54e22a[_0xd3f9('0x39')]['sort']);_0x4be470['where']=qs['filters'](_['pick'](_0x54e22a[_0xd3f9('0x39')],_0x47d6b6[_0xd3f9('0x3a')]));if(_0x54e22a[_0xd3f9('0x39')]['filter']){_0x4be470[_0xd3f9('0x42')]=_[_0xd3f9('0x44')](_0x4be470[_0xd3f9('0x42')],{'$or':_[_0xd3f9('0x32')](_0x4be470['attributes'],function(_0x10745b){var _0x28876c={};_0x28876c[_0x10745b]={'$like':'%'+_0x54e22a[_0xd3f9('0x39')]['filter']+'%'};return _0x28876c;})});}_0x4be470=_[_0xd3f9('0x44')]({},_0x4be470,_0x54e22a[_0xd3f9('0x46')]);return _0x384217[_0xd3f9('0x65')](_0x4be470);}})[_0xd3f9('0x29')](function(_0x4a133c){if(_0x4a133c){_0x3c8a61=_0x4a133c[_0xd3f9('0x3e')];if(!_0x54e22a[_0xd3f9('0x39')][_0xd3f9('0x3f')](_0xd3f9('0x58'))){_0x4be470[_0xd3f9('0x22')]=qs[_0xd3f9('0x22')](_0x54e22a['query'][_0xd3f9('0x22')]);_0x4be470[_0xd3f9('0x20')]=qs[_0xd3f9('0x20')](_0x54e22a[_0xd3f9('0x39')][_0xd3f9('0x20')]);}return _0x384217[_0xd3f9('0x65')](_0x4be470);}})['then'](function(_0x567b89){if(_0x567b89){return _0x567b89?{'count':_0x3c8a61,'rows':_0x567b89}:null;}})[_0xd3f9('0x29')](respondWithResult(_0x715c5c,null))['catch'](handleError(_0x715c5c,null));};exports[_0xd3f9('0x66')]=function(_0x32d3e8,_0x25531e,_0x8aa178){var _0x42ee34=_0x32d3e8[_0xd3f9('0x4f')][_0xd3f9('0x67')];return db[_0xd3f9('0x68')][_0xd3f9('0x49')]({'where':{'id':_0x42ee34},'attributes':['id'],'include':[{'model':db[_0xd3f9('0x5a')],'as':_0xd3f9('0x69'),'attributes':['id',_0xd3f9('0x37'),_0xd3f9('0x6a'),_0xd3f9('0x6b'),_0xd3f9('0x6c')],'raw':!![]}]})[_0xd3f9('0x29')](function(_0x20341d){if(_0x20341d){var _0x5765fb=_[_0xd3f9('0x6d')](_0x20341d,function(_0x5dad97){var _0x23aa4a=_0x5dad97[_0xd3f9('0x2b')]({'plain':!![]});return _0x23aa4a['Agents'];});return db['OpenchannelQueue'][_0xd3f9('0x4d')]({'where':{'id':_0x32d3e8[_0xd3f9('0x4b')]['id']}})[_0xd3f9('0x29')](function(_0x4290f7){return db[_0xd3f9('0x6e')][_0xd3f9('0x6f')](function(_0x55d059){return _0x4290f7['addTeams'](_0x42ee34,{'transaction':_0x55d059})['then'](function(){return BPromise[_0xd3f9('0x70')](_0x5765fb,function(_0x73a2ac){return db[_0xd3f9('0x57')][_0xd3f9('0x71')]({'where':{'UserId':_0x73a2ac['id'],'OpenchannelQueueId':_0x32d3e8[_0xd3f9('0x4b')]['id']},'transaction':_0x55d059});});})[_0xd3f9('0x29')](function(){_0x5765fb[_0xd3f9('0x72')](function(_0x58c2e2){socket['emit'](_0xd3f9('0x73'),{'UserId':_0x58c2e2['id'],'OpenchannelQueueId':_0x4290f7['id']});});});});});}})[_0xd3f9('0x29')](respondWithStatusCode(_0x25531e,null))['catch'](handleError(_0x25531e,null));};exports['removeTeams']=function(_0xf8b184,_0x340e06,_0x4903da){return db[_0xd3f9('0x68')][_0xd3f9('0x49')]({'where':{'id':_0xf8b184[_0xd3f9('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd3f9('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x340e06,null))[_0xd3f9('0x29')](function(_0x1d17ac){var _0x7c3de3=_['map'](_0x1d17ac,'id');var _0x37155f=[];var _0x270365=[];var _0x11c1e3=squel[_0xd3f9('0x74')]();_0x11c1e3['field'](_0xd3f9('0x75'))[_0xd3f9('0x76')](_0xd3f9('0x77'),'tq')[_0xd3f9('0x78')](_0xd3f9('0x79'),'ut',_0xd3f9('0x7a'))[_0xd3f9('0x42')]('OpenchannelQueueId\x20=\x20?',_0xf8b184['params']['id']);for(var _0x2e895e=0x0;_0x2e895e<_0x1d17ac[_0xd3f9('0x3e')];_0x2e895e+=0x1){let _0x4a0b6f=_0x1d17ac[_0x2e895e];for(var _0x4f5bdf=0x0;_0x4f5bdf<_0x4a0b6f[_0xd3f9('0x69')][_0xd3f9('0x3e')];_0x4f5bdf+=0x1){let _0x50f288=_0x4a0b6f[_0xd3f9('0x69')][_0x4f5bdf];var _0x281329=_0x11c1e3[_0xd3f9('0x7b')]();_0x281329[_0xd3f9('0x42')]('ut.UserId\x20=\x20?',_0x50f288['id']);_0x270365[_0xd3f9('0x7c')](db['sequelize'][_0xd3f9('0x39')](_0x281329['toString'](),{'type':db[_0xd3f9('0x6e')]['QueryTypes']['SELECT']})[_0xd3f9('0x29')](function(_0x5467a5){if(_0x5467a5[_0xd3f9('0x3e')]===0x1){return _0x50f288['id'];}else{var _0x13ae90=_[_0xd3f9('0x7d')](_['map'](_0x5467a5,'TeamId'),function(_0x574c85){return _['includes'](_0x7c3de3,_0x574c85);});if(_0x13ae90){return _0x50f288['id'];}}}));}}return BPromise[_0xd3f9('0x7e')](_0x270365)['then'](function(_0x3751b2){_0x37155f=_(_0x37155f)[_0xd3f9('0x7f')](_0x3751b2)[_0xd3f9('0x80')]()['value']();return db[_0xd3f9('0x47')]['find']({'where':{'id':_0xf8b184[_0xd3f9('0x4b')]['id']}})[_0xd3f9('0x29')](function(_0x3afe5e){return db['sequelize']['transaction'](function(_0x310b4f){return _0x3afe5e[_0xd3f9('0x81')](_0xf8b184[_0xd3f9('0x39')]['ids'],{'transaction':_0x310b4f})[_0xd3f9('0x29')](function(){if(!_[_0xd3f9('0x82')](_0x37155f)){return _0x3afe5e[_0xd3f9('0x83')](_0x37155f,{'transaction':_0x310b4f});}})[_0xd3f9('0x29')](function(){_0x37155f[_0xd3f9('0x72')](function(_0x4cb972){socket['emit'](_0xd3f9('0x84'),{'UserId':_0x4cb972,'OpenchannelQueueId':_0x3afe5e['id']});});});});});});})[_0xd3f9('0x29')](respondWithStatusCode(_0x340e06,null))[_0xd3f9('0x4a')](handleError(_0x340e06,null));};exports[_0xd3f9('0x85')]=function(_0x2f4a01,_0x5b89e4,_0x58ea82){return db['OpenchannelQueue'][_0xd3f9('0x4d')]({'where':{'id':_0x2f4a01['params']['id']}})[_0xd3f9('0x29')](handleEntityNotFound(_0x5b89e4,null))['then'](function(_0x7e7777){if(_0x7e7777){return _0x7e7777[_0xd3f9('0x85')](_0x2f4a01[_0xd3f9('0x4f')][_0xd3f9('0x67')],_[_0xd3f9('0x86')](_0x2f4a01[_0xd3f9('0x4f')],['ids','id'])||{})[_0xd3f9('0x87')](function(_0x43781a){for(var _0x4aecc7=0x0;_0x4aecc7<_0x2f4a01[_0xd3f9('0x4f')][_0xd3f9('0x67')][_0xd3f9('0x3e')];_0x4aecc7+=0x1){socket[_0xd3f9('0x88')](_0xd3f9('0x73'),{'UserId':Number(_0x2f4a01[_0xd3f9('0x4f')][_0xd3f9('0x67')][_0x4aecc7]),'OpenchannelQueueId':Number(_0x2f4a01[_0xd3f9('0x4b')]['id'])});}return _0x43781a;});}})[_0xd3f9('0x29')](respondWithResult(_0x5b89e4,null))[_0xd3f9('0x4a')](handleError(_0x5b89e4,null));};exports[_0xd3f9('0x83')]=function(_0x42cf60,_0x2c7149,_0x23b8a1){return db[_0xd3f9('0x47')][_0xd3f9('0x4d')]({'where':{'id':_0x42cf60[_0xd3f9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c7149,null))[_0xd3f9('0x29')](function(_0x3772db){if(_0x3772db){return _0x3772db[_0xd3f9('0x83')](_0x42cf60[_0xd3f9('0x39')][_0xd3f9('0x67')])[_0xd3f9('0x29')](function(){if(_['isArray'](_0x42cf60[_0xd3f9('0x39')]['ids'])){for(var _0x242ba1=0x0;_0x242ba1<_0x42cf60[_0xd3f9('0x39')]['ids'][_0xd3f9('0x3e')];_0x242ba1+=0x1){socket[_0xd3f9('0x88')](_0xd3f9('0x84'),{'UserId':Number(_0x42cf60[_0xd3f9('0x39')][_0xd3f9('0x67')][_0x242ba1]),'OpenchannelQueueId':Number(_0x42cf60['params']['id'])});}}else{socket[_0xd3f9('0x88')]('userOpenchannelQueue:remove',{'UserId':Number(_0x42cf60[_0xd3f9('0x39')]['ids']),'OpenchannelQueueId':Number(_0x42cf60['params']['id'])});}});}})[_0xd3f9('0x29')](respondWithStatusCode(_0x2c7149,null))[_0xd3f9('0x4a')](handleError(_0x2c7149,null));};exports[_0xd3f9('0x89')]=function(_0x1a94af,_0x116f34,_0x3f7011){var _0x39876b={};var _0x460f84={};var _0x5e455d;var _0x195d52;return db[_0xd3f9('0x47')][_0xd3f9('0x56')]({'where':{'id':_0x1a94af[_0xd3f9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x116f34,null))[_0xd3f9('0x29')](function(_0x333dfa){if(_0x333dfa){_0x5e455d=_0x333dfa;_0x460f84['model']=_[_0xd3f9('0x38')](db[_0xd3f9('0x5a')][_0xd3f9('0x33')]);_0x460f84['query']=_[_0xd3f9('0x38')](_0x1a94af[_0xd3f9('0x39')]);_0x460f84[_0xd3f9('0x3a')]=_[_0xd3f9('0x3b')](_0x460f84[_0xd3f9('0x36')],_0x460f84[_0xd3f9('0x39')]);_0x39876b[_0xd3f9('0x3d')]=_[_0xd3f9('0x3b')](_0x460f84['model'],qs[_0xd3f9('0x3c')](_0x1a94af['query']['fields']));_0x39876b[_0xd3f9('0x3d')]=_0x39876b[_0xd3f9('0x3d')][_0xd3f9('0x3e')]?_0x39876b['attributes']:_0x460f84[_0xd3f9('0x36')];_0x39876b[_0xd3f9('0x40')]=qs[_0xd3f9('0x41')](_0x1a94af[_0xd3f9('0x39')][_0xd3f9('0x41')]);_0x39876b[_0xd3f9('0x42')]=qs[_0xd3f9('0x3a')](_[_0xd3f9('0x8a')](_0x1a94af[_0xd3f9('0x39')],_0x460f84['filters']));if(_0x1a94af[_0xd3f9('0x39')][_0xd3f9('0x43')]){_0x39876b[_0xd3f9('0x42')]=_[_0xd3f9('0x44')](_0x39876b[_0xd3f9('0x42')],{'$or':_[_0xd3f9('0x32')](_0x39876b['attributes'],function(_0x249ca0){var _0x2a5819={};_0x2a5819[_0x249ca0]={'$like':'%'+_0x1a94af[_0xd3f9('0x39')]['filter']+'%'};return _0x2a5819;})});}_0x39876b=_[_0xd3f9('0x44')]({},_0x39876b,_0x1a94af[_0xd3f9('0x46')]);return _0x5e455d[_0xd3f9('0x89')](_0x39876b);}})[_0xd3f9('0x29')](function(_0x4e9168){if(_0x4e9168){_0x195d52=_0x4e9168['length'];if(!_0x1a94af['query']['hasOwnProperty'](_0xd3f9('0x58'))){_0x39876b['limit']=qs['limit'](_0x1a94af[_0xd3f9('0x39')][_0xd3f9('0x22')]);_0x39876b[_0xd3f9('0x20')]=qs[_0xd3f9('0x20')](_0x1a94af['query'][_0xd3f9('0x20')]);}return _0x5e455d[_0xd3f9('0x89')](_0x39876b);}})[_0xd3f9('0x29')](function(_0x162c1c){if(_0x162c1c){return _0x162c1c?{'count':_0x195d52,'rows':_0x162c1c}:null;}})[_0xd3f9('0x29')](respondWithResult(_0x116f34,null))[_0xd3f9('0x4a')](handleError(_0x116f34,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 36fc6ea..49d54ca 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 _0x8ea7=['OpenchannelQueue','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1b25ae,_0x22a327){var _0x3d795a=function(_0x189fb5){while(--_0x189fb5){_0x1b25ae['push'](_0x1b25ae['shift']());}};_0x3d795a(++_0x22a327);}(_0x8ea7,0x1ae));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x78ea('0x0'));var OpenchannelQueue=require(_0x78ea('0x1'))['db'][_0x78ea('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x78ea('0x3'),'afterDestroy':_0x78ea('0x4')};function emitEvent(_0x10c9c1){return function(_0x56a066,_0x1c862e,_0x5293f0){OpenchannelQueueEvents['emit'](_0x10c9c1+':'+_0x56a066['id'],_0x56a066);OpenchannelQueueEvents[_0x78ea('0x5')](_0x10c9c1,_0x56a066);_0x5293f0(null);};}for(var e in events){if(events[_0x78ea('0x6')](e)){var event=events[e];OpenchannelQueue[_0x78ea('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xeb10=['emit','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','update'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xeb10,0x15e));var _0x0eb1=function(_0x31c0f4,_0x29ec4e){_0x31c0f4=_0x31c0f4-0x0;var _0xce6cf7=_0xeb10[_0x31c0f4];return _0xce6cf7;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x0eb1('0x0'))['db'][_0x0eb1('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0eb1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0eb1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x94950d){return function(_0x38d2e0,_0x5df80e,_0x3ffc01){OpenchannelQueueEvents[_0x0eb1('0x4')](_0x94950d+':'+_0x38d2e0['id'],_0x38d2e0);OpenchannelQueueEvents[_0x0eb1('0x4')](_0x94950d,_0x38d2e0);_0x3ffc01(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x0eb1('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 f4ffcab..347349f 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 _0xe157=['path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','api','moment','bluebird'];(function(_0x3101e8,_0x11d23f){var _0x4d63a3=function(_0x3235e4){while(--_0x3235e4){_0x3101e8['push'](_0x3101e8['shift']());}};_0x4d63a3(++_0x11d23f);}(_0xe157,0xee));var _0x7e15=function(_0x184591,_0x569adb){_0x184591=_0x184591-0x0;var _0x52bf9f=_0xe157[_0x184591];return _0x52bf9f;};'use strict';var _=require(_0x7e15('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7e15('0x1'));var moment=require(_0x7e15('0x2'));var BPromise=require(_0x7e15('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e15('0x4'));var rimraf=require(_0x7e15('0x5'));var config=require(_0x7e15('0x6'));var attributes=require(_0x7e15('0x7'));module['exports']=function(_0x59077f,_0x5ca282){return _0x59077f[_0x7e15('0x8')](_0x7e15('0x9'),attributes,{'tableName':_0x7e15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x059d=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define'];(function(_0x46ddd1,_0xb6dddc){var _0x476980=function(_0x4c18af){while(--_0x4c18af){_0x46ddd1['push'](_0x46ddd1['shift']());}};_0x476980(++_0xb6dddc);}(_0x059d,0x64));var _0xd059=function(_0x53ffe5,_0xd74e12){_0x53ffe5=_0x53ffe5-0x0;var _0x54708f=_0x059d[_0x53ffe5];return _0x54708f;};'use strict';var _=require(_0xd059('0x0'));var util=require(_0xd059('0x1'));var logger=require(_0xd059('0x2'))(_0xd059('0x3'));var moment=require(_0xd059('0x4'));var BPromise=require(_0xd059('0x5'));var rp=require(_0xd059('0x6'));var fs=require('fs');var path=require(_0xd059('0x7'));var rimraf=require(_0xd059('0x8'));var config=require(_0xd059('0x9'));var attributes=require(_0xd059('0xa'));module['exports']=function(_0x2ecccc,_0x32dd41){return _0x2ecccc[_0xd059('0xb')](_0xd059('0xc'),attributes,{'tableName':_0xd059('0xd'),'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 f4bf5ac..9a58b0a 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 _0xd40d=['error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','OpenchannelQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3115c5,_0x2d4092){var _0x3d7b38=function(_0xd0352b){while(--_0xd0352b){_0x3115c5['push'](_0x3115c5['shift']());}};_0x3d7b38(++_0x2d4092);}(_0xd40d,0x167));var _0xdd40=function(_0x1488b8,_0xb615c4){_0x1488b8=_0x1488b8-0x0;var _0x338852=_0xd40d[_0x1488b8];return _0x338852;};'use strict';var _=require('lodash');var util=require(_0xdd40('0x0'));var moment=require(_0xdd40('0x1'));var BPromise=require(_0xdd40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd40('0x3'));var db=require(_0xdd40('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd40('0x5'))('rpc');var config=require(_0xdd40('0x6'));var jayson=require(_0xdd40('0x7'));var client=jayson['client'][_0xdd40('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xdd40('0x9')],{'host':_0xdd40('0xa'),'port':0x18eb});var socket=require(_0xdd40('0xb'))(new Redis(config['redis']));require(_0xdd40('0xc'))[_0xdd40('0xd')](socket);function respondWithRpcPromise(_0x59a97d,_0x339154,_0x256f11){return new BPromise(function(_0x4f9300,_0x17c301){return client['request'](_0x59a97d,_0x256f11)[_0xdd40('0xe')](function(_0x2437e1){logger[_0xdd40('0xf')](_0xdd40('0x10'),_0x339154,'request\x20sent');logger[_0xdd40('0x11')](_0xdd40('0x12'),_0x339154,_0xdd40('0x13'),JSON[_0xdd40('0x14')](_0x2437e1));if(_0x2437e1[_0xdd40('0x15')]){if(_0x2437e1[_0xdd40('0x15')][_0xdd40('0x16')]===0x1f4){logger[_0xdd40('0x15')](_0xdd40('0x10'),_0x339154,_0x2437e1[_0xdd40('0x15')]['message']);return _0x17c301(_0x2437e1[_0xdd40('0x15')]['message']);}logger[_0xdd40('0x15')](_0xdd40('0x10'),_0x339154,_0x2437e1['error'][_0xdd40('0x17')]);return _0x4f9300(_0x2437e1[_0xdd40('0x15')][_0xdd40('0x17')]);}else{logger[_0xdd40('0xf')](_0xdd40('0x10'),_0x339154,_0xdd40('0x13'));_0x4f9300(_0x2437e1[_0xdd40('0x18')][_0xdd40('0x17')]);}})[_0xdd40('0x19')](function(_0x49a1ab){logger[_0xdd40('0x15')](_0xdd40('0x10'),_0x339154,_0x49a1ab);_0x17c301(_0x49a1ab);});});}exports[_0xdd40('0x1a')]=function(_0x1daa46){var _0x2a86d6=this;return new Promise(function(_0x334d85,_0x5c56bf){return db['OpenchannelQueue'][_0xdd40('0x1b')]({'raw':_0x1daa46[_0xdd40('0x1c')]?_0x1daa46[_0xdd40('0x1c')][_0xdd40('0x1d')]===undefined?!![]:![]:!![],'where':_0x1daa46[_0xdd40('0x1c')]?_0x1daa46['options'][_0xdd40('0x1e')]||null:null,'attributes':_0x1daa46[_0xdd40('0x1c')]?_0x1daa46['options'][_0xdd40('0x1f')]||null:null,'limit':_0x1daa46[_0xdd40('0x1c')]?_0x1daa46[_0xdd40('0x1c')][_0xdd40('0x20')]||null:null,'include':_0x1daa46[_0xdd40('0x1c')]?_0x1daa46[_0xdd40('0x1c')][_0xdd40('0x21')]?_[_0xdd40('0x22')](_0x1daa46[_0xdd40('0x1c')][_0xdd40('0x21')],function(_0x5c8e8c){return{'model':db[_0x5c8e8c['model']],'as':_0x5c8e8c['as'],'attributes':_0x5c8e8c[_0xdd40('0x1f')],'include':_0x5c8e8c[_0xdd40('0x21')]?_[_0xdd40('0x22')](_0x5c8e8c[_0xdd40('0x21')],function(_0x5017e3){return{'model':db[_0x5017e3['model']],'as':_0x5017e3['as'],'attributes':_0x5017e3[_0xdd40('0x1f')],'include':_0x5017e3[_0xdd40('0x21')]?_[_0xdd40('0x22')](_0x5017e3[_0xdd40('0x21')],function(_0x20ed61){return{'model':db[_0x20ed61[_0xdd40('0x23')]],'as':_0x20ed61['as'],'attributes':_0x20ed61[_0xdd40('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdd40('0xe')](function(_0x525b9e){logger[_0xdd40('0xf')](_0xdd40('0x1a'),_0x1daa46);logger['debug'](_0xdd40('0x1a'),_0x1daa46,JSON['stringify'](_0x525b9e));_0x334d85(_0x525b9e);})['catch'](function(_0xdabe7){logger[_0xdd40('0x15')]('GetOpenchannelQueue',_0xdabe7[_0xdd40('0x17')],_0x1daa46);_0x5c56bf(_0x2a86d6[_0xdd40('0x15')](0x1f4,_0xdabe7[_0xdd40('0x17')]));});});};exports[_0xdd40('0x24')]=function(_0x45214e){var _0x82b1a=this;return new Promise(function(_0x4a19ef,_0x15fb1f){return db[_0xdd40('0x25')]['find']({'raw':_0x45214e['options']?_0x45214e['options'][_0xdd40('0x1d')]===undefined?!![]:![]:!![],'where':_0x45214e[_0xdd40('0x1c')]?_0x45214e[_0xdd40('0x1c')]['where']||null:null,'attributes':_0x45214e[_0xdd40('0x1c')]?_0x45214e[_0xdd40('0x1c')][_0xdd40('0x1f')]||null:null,'include':_0x45214e[_0xdd40('0x1c')]?_0x45214e[_0xdd40('0x1c')][_0xdd40('0x21')]?_[_0xdd40('0x22')](_0x45214e[_0xdd40('0x1c')][_0xdd40('0x21')],function(_0x10dae9){return{'model':db[_0x10dae9['model']],'as':_0x10dae9['as'],'attributes':_0x10dae9['attributes'],'include':_0x10dae9['include']?_[_0xdd40('0x22')](_0x10dae9[_0xdd40('0x21')],function(_0x189590){return{'model':db[_0x189590[_0xdd40('0x23')]],'as':_0x189590['as'],'attributes':_0x189590[_0xdd40('0x1f')],'include':_0x189590[_0xdd40('0x21')]?_[_0xdd40('0x22')](_0x189590[_0xdd40('0x21')],function(_0x273fea){return{'model':db[_0x273fea[_0xdd40('0x23')]],'as':_0x273fea['as'],'attributes':_0x273fea[_0xdd40('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22be5c){logger['info'](_0xdd40('0x24'),_0x45214e);logger[_0xdd40('0x11')](_0xdd40('0x24'),_0x45214e,JSON[_0xdd40('0x14')](_0x22be5c));_0x4a19ef(_0x22be5c);})[_0xdd40('0x19')](function(_0x5d2bad){logger[_0xdd40('0x15')](_0xdd40('0x24'),_0x5d2bad['message'],_0x45214e);_0x15fb1f(_0x82b1a[_0xdd40('0x15')](0x1f4,_0x5d2bad['message']));});});}; \ No newline at end of file +var _0xe939=['where','limit','include','map','attributes','GetOpenchannelQueue','ShowOpenchannelQueue','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','request\x20sent','debug','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','info','result','catch','OpenchannelQueue','findAll','options','raw'];(function(_0x331f80,_0x796943){var _0x242266=function(_0x14f4f5){while(--_0x14f4f5){_0x331f80['push'](_0x331f80['shift']());}};_0x242266(++_0x796943);}(_0xe939,0x148));var _0x9e93=function(_0x5c23c9,_0x3d1bf6){_0x5c23c9=_0x5c23c9-0x0;var _0x4b63d4=_0xe939[_0x5c23c9];return _0x4b63d4;};'use strict';var _=require(_0x9e93('0x0'));var util=require(_0x9e93('0x1'));var moment=require(_0x9e93('0x2'));var BPromise=require(_0x9e93('0x3'));var rs=require(_0x9e93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e93('0x5'))['db'];var utils=require(_0x9e93('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9e93('0x7'));var jayson=require(_0x9e93('0x8'));var client=jayson[_0x9e93('0x9')][_0x9e93('0xa')]({'port':0x232a});config[_0x9e93('0xb')]=_[_0x9e93('0xc')](config['redis'],{'host':_0x9e93('0xd'),'port':0x18eb});var socket=require(_0x9e93('0xe'))(new Redis(config[_0x9e93('0xb')]));require(_0x9e93('0xf'))['register'](socket);function respondWithRpcPromise(_0x61ae06,_0x5b7001,_0x395d35){return new BPromise(function(_0x5e93f3,_0x300e16){return client[_0x9e93('0x10')](_0x61ae06,_0x395d35)[_0x9e93('0x11')](function(_0x21f18d){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x5b7001,_0x9e93('0x12'));logger[_0x9e93('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5b7001,_0x9e93('0x12'),JSON[_0x9e93('0x14')](_0x21f18d));if(_0x21f18d[_0x9e93('0x15')]){if(_0x21f18d[_0x9e93('0x15')][_0x9e93('0x16')]===0x1f4){logger[_0x9e93('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x5b7001,_0x21f18d['error'][_0x9e93('0x17')]);return _0x300e16(_0x21f18d[_0x9e93('0x15')]['message']);}logger['error'](_0x9e93('0x18'),_0x5b7001,_0x21f18d[_0x9e93('0x15')]['message']);return _0x5e93f3(_0x21f18d[_0x9e93('0x15')]['message']);}else{logger[_0x9e93('0x19')](_0x9e93('0x18'),_0x5b7001,'request\x20sent');_0x5e93f3(_0x21f18d[_0x9e93('0x1a')][_0x9e93('0x17')]);}})[_0x9e93('0x1b')](function(_0x21d14b){logger[_0x9e93('0x15')](_0x9e93('0x18'),_0x5b7001,_0x21d14b);_0x300e16(_0x21d14b);});});}exports['GetOpenchannelQueue']=function(_0x30a8e0){var _0x29af2e=this;return new Promise(function(_0x298b2d,_0x6cd5ac){return db[_0x9e93('0x1c')][_0x9e93('0x1d')]({'raw':_0x30a8e0[_0x9e93('0x1e')]?_0x30a8e0[_0x9e93('0x1e')][_0x9e93('0x1f')]===undefined?!![]:![]:!![],'where':_0x30a8e0[_0x9e93('0x1e')]?_0x30a8e0[_0x9e93('0x1e')][_0x9e93('0x20')]||null:null,'attributes':_0x30a8e0[_0x9e93('0x1e')]?_0x30a8e0['options']['attributes']||null:null,'limit':_0x30a8e0[_0x9e93('0x1e')]?_0x30a8e0['options'][_0x9e93('0x21')]||null:null,'include':_0x30a8e0[_0x9e93('0x1e')]?_0x30a8e0['options'][_0x9e93('0x22')]?_[_0x9e93('0x23')](_0x30a8e0['options'][_0x9e93('0x22')],function(_0x584af7){return{'model':db[_0x584af7['model']],'as':_0x584af7['as'],'attributes':_0x584af7[_0x9e93('0x24')],'include':_0x584af7['include']?_['map'](_0x584af7[_0x9e93('0x22')],function(_0x35710c){return{'model':db[_0x35710c['model']],'as':_0x35710c['as'],'attributes':_0x35710c[_0x9e93('0x24')],'include':_0x35710c[_0x9e93('0x22')]?_[_0x9e93('0x23')](_0x35710c[_0x9e93('0x22')],function(_0x1bbe97){return{'model':db[_0x1bbe97['model']],'as':_0x1bbe97['as'],'attributes':_0x1bbe97['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e93('0x11')](function(_0x25ad79){logger[_0x9e93('0x19')](_0x9e93('0x25'),_0x30a8e0);logger[_0x9e93('0x13')]('GetOpenchannelQueue',_0x30a8e0,JSON[_0x9e93('0x14')](_0x25ad79));_0x298b2d(_0x25ad79);})['catch'](function(_0x5b76ab){logger['error']('GetOpenchannelQueue',_0x5b76ab[_0x9e93('0x17')],_0x30a8e0);_0x6cd5ac(_0x29af2e[_0x9e93('0x15')](0x1f4,_0x5b76ab['message']));});});};exports[_0x9e93('0x26')]=function(_0x197047){var _0x1ebf5a=this;return new Promise(function(_0x3ed949,_0x1289bb){return db[_0x9e93('0x1c')]['find']({'raw':_0x197047[_0x9e93('0x1e')]?_0x197047['options'][_0x9e93('0x1f')]===undefined?!![]:![]:!![],'where':_0x197047[_0x9e93('0x1e')]?_0x197047['options'][_0x9e93('0x20')]||null:null,'attributes':_0x197047['options']?_0x197047[_0x9e93('0x1e')][_0x9e93('0x24')]||null:null,'include':_0x197047[_0x9e93('0x1e')]?_0x197047[_0x9e93('0x1e')][_0x9e93('0x22')]?_['map'](_0x197047['options'][_0x9e93('0x22')],function(_0x17e535){return{'model':db[_0x17e535[_0x9e93('0x27')]],'as':_0x17e535['as'],'attributes':_0x17e535[_0x9e93('0x24')],'include':_0x17e535[_0x9e93('0x22')]?_[_0x9e93('0x23')](_0x17e535[_0x9e93('0x22')],function(_0x594c8d){return{'model':db[_0x594c8d[_0x9e93('0x27')]],'as':_0x594c8d['as'],'attributes':_0x594c8d[_0x9e93('0x24')],'include':_0x594c8d[_0x9e93('0x22')]?_[_0x9e93('0x23')](_0x594c8d[_0x9e93('0x22')],function(_0x5969a0){return{'model':db[_0x5969a0[_0x9e93('0x27')]],'as':_0x5969a0['as'],'attributes':_0x5969a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e93('0x11')](function(_0x4b1bfb){logger['info'](_0x9e93('0x26'),_0x197047);logger[_0x9e93('0x13')]('ShowOpenchannelQueue',_0x197047,JSON[_0x9e93('0x14')](_0x4b1bfb));_0x3ed949(_0x4b1bfb);})[_0x9e93('0x1b')](function(_0x8c04a0){logger['error'](_0x9e93('0x26'),_0x8c04a0[_0x9e93('0x17')],_0x197047);_0x1289bb(_0x1ebf5a[_0x9e93('0x15')](0x1f4,_0x8c04a0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 0ab5d64..242f29c 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 _0x2150=['length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','register'];(function(_0x48be4e,_0x348220){var _0x26684b=function(_0x4b9179){while(--_0x4b9179){_0x48be4e['push'](_0x48be4e['shift']());}};_0x26684b(++_0x348220);}(_0x2150,0x1e5));var _0x0215=function(_0x400766,_0x368660){_0x400766=_0x400766-0x0;var _0x3ae58b=_0x2150[_0x400766];return _0x3ae58b;};'use strict';var OpenchannelQueueEvents=require(_0x0215('0x0'));var events=['save',_0x0215('0x1'),_0x0215('0x2')];function createListener(_0x3a754c,_0x507933){return function(_0x427036){_0x507933[_0x0215('0x3')](_0x3a754c,_0x427036);};}function removeListener(_0x3e1385,_0x34d266){return function(){OpenchannelQueueEvents['removeListener'](_0x3e1385,_0x34d266);};}exports[_0x0215('0x4')]=function(_0x16f0b3){for(var _0x1f2bc2=0x0,_0x405be0=events[_0x0215('0x5')];_0x1f2bc2<_0x405be0;_0x1f2bc2++){var _0x2d3f36=events[_0x1f2bc2];var _0x5cdf83=createListener(_0x0215('0x6')+_0x2d3f36,_0x16f0b3);OpenchannelQueueEvents['on'](_0x2d3f36,_0x5cdf83);}}; \ No newline at end of file +var _0x9d0a=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','remove','update','emit'];(function(_0x2cc72a,_0x33958b){var _0xe61bc=function(_0xba0648){while(--_0xba0648){_0x2cc72a['push'](_0x2cc72a['shift']());}};_0xe61bc(++_0x33958b);}(_0x9d0a,0x134));var _0xa9d0=function(_0x24c564,_0x49afff){_0x24c564=_0x24c564-0x0;var _0x3a5538=_0x9d0a[_0x24c564];return _0x3a5538;};'use strict';var OpenchannelQueueEvents=require(_0xa9d0('0x0'));var events=['save',_0xa9d0('0x1'),_0xa9d0('0x2')];function createListener(_0x5016d6,_0x2d5666){return function(_0x2fc47b){_0x2d5666[_0xa9d0('0x3')](_0x5016d6,_0x2fc47b);};}function removeListener(_0x5cb021,_0x591e0d){return function(){OpenchannelQueueEvents[_0xa9d0('0x4')](_0x5cb021,_0x591e0d);};}exports[_0xa9d0('0x5')]=function(_0x3e9256){for(var _0x56770b=0x0,_0xdde03a=events[_0xa9d0('0x6')];_0x56770b<_0xdde03a;_0x56770b++){var _0x570fc1=events[_0x56770b];var _0x2bf6d8=createListener(_0xa9d0('0x7')+_0x570fc1,_0x3e9256);OpenchannelQueueEvents['on'](_0x570fc1,_0x2bf6d8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 9d180a1..f70e803 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 _0x604c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x4a321c,_0x3ab7d5){var _0x108e52=function(_0x3e5e3b){while(--_0x3e5e3b){_0x4a321c['push'](_0x4a321c['shift']());}};_0x108e52(++_0x3ab7d5);}(_0x604c,0x18b));var _0xc604=function(_0x294470,_0x2396a9){_0x294470=_0x294470-0x0;var _0x31a0c5=_0x604c[_0x294470];return _0x31a0c5;};'use strict';var multer=require(_0xc604('0x0'));var util=require(_0xc604('0x1'));var path=require(_0xc604('0x2'));var timeout=require(_0xc604('0x3'));var express=require(_0xc604('0x4'));var router=express[_0xc604('0x5')]();var fs_extra=require(_0xc604('0x6'));var auth=require(_0xc604('0x7'));var interaction=require(_0xc604('0x8'));var config=require(_0xc604('0x9'));var controller=require(_0xc604('0xa'));router[_0xc604('0xb')]('/',auth[_0xc604('0xc')](),controller['index']);router[_0xc604('0xb')]('/describe',auth[_0xc604('0xc')](),controller[_0xc604('0xd')]);router['get'](_0xc604('0xe'),auth[_0xc604('0xc')](),controller[_0xc604('0xf')]);router[_0xc604('0x10')]('/',auth[_0xc604('0xc')](),controller[_0xc604('0x11')]);router[_0xc604('0x12')]('/:id',auth[_0xc604('0xc')](),controller[_0xc604('0x13')]);router[_0xc604('0x14')](_0xc604('0xe'),auth[_0xc604('0xc')](),controller['destroy']);module[_0xc604('0x15')]=router; \ No newline at end of file +var _0x54da=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x48d5a5,_0x2c6004){var _0x5548e9=function(_0x3d876d){while(--_0x3d876d){_0x48d5a5['push'](_0x48d5a5['shift']());}};_0x5548e9(++_0x2c6004);}(_0x54da,0x174));var _0xa54d=function(_0x5abb00,_0x342d70){_0x5abb00=_0x5abb00-0x0;var _0xf9b854=_0x54da[_0x5abb00];return _0xf9b854;};'use strict';var multer=require(_0xa54d('0x0'));var util=require(_0xa54d('0x1'));var path=require(_0xa54d('0x2'));var timeout=require(_0xa54d('0x3'));var express=require('express');var router=express[_0xa54d('0x4')]();var fs_extra=require(_0xa54d('0x5'));var auth=require(_0xa54d('0x6'));var interaction=require(_0xa54d('0x7'));var config=require(_0xa54d('0x8'));var controller=require(_0xa54d('0x9'));router[_0xa54d('0xa')]('/',auth[_0xa54d('0xb')](),controller['index']);router[_0xa54d('0xa')](_0xa54d('0xc'),auth[_0xa54d('0xb')](),controller[_0xa54d('0xd')]);router[_0xa54d('0xa')]('/:id',auth[_0xa54d('0xb')](),controller[_0xa54d('0xe')]);router[_0xa54d('0xf')]('/',auth[_0xa54d('0xb')](),controller[_0xa54d('0x10')]);router[_0xa54d('0x11')](_0xa54d('0x12'),auth[_0xa54d('0xb')](),controller['update']);router[_0xa54d('0x13')](_0xa54d('0x12'),auth[_0xa54d('0xb')](),controller[_0xa54d('0x14')]);module[_0xa54d('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 406f05e..b553f07 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 _0x6162=['exports','STRING','DATE','moment','sequelize'];(function(_0x1a9b94,_0x4d763e){var _0x379102=function(_0x1d9e7c){while(--_0x1d9e7c){_0x1a9b94['push'](_0x1a9b94['shift']());}};_0x379102(++_0x4d763e);}(_0x6162,0x1c0));var _0x2616=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6162[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0x2616('0x0'));var Sequelize=require(_0x2616('0x1'));module[_0x2616('0x2')]={'uniqueid':{'type':Sequelize[_0x2616('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2616('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2616('0x4')]},'exitAt':{'type':Sequelize[_0x2616('0x4')]},'reason':{'type':Sequelize[_0x2616('0x3')]}}; \ No newline at end of file +var _0x597a=['moment','STRING','DATE'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x597a,0x180));var _0xa597=function(_0x5a3ec5,_0x71ae0f){_0x5a3ec5=_0x5a3ec5-0x0;var _0x5749de=_0x597a[_0x5a3ec5];return _0x5749de;};'use strict';var moment=require(_0xa597('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa597('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa597('0x2')]},'leaveAt':{'type':Sequelize[_0xa597('0x2')]},'acceptAt':{'type':Sequelize[_0xa597('0x2')]},'exitAt':{'type':Sequelize[_0xa597('0x2')]},'reason':{'type':Sequelize[_0xa597('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 32da6c0..1e816d3 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 _0x5a4a=['create','body','destroy','find','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params'];(function(_0x5b7636,_0x153573){var _0xa21b37=function(_0x3408dc){while(--_0x3408dc){_0x5b7636['push'](_0x5b7636['shift']());}};_0xa21b37(++_0x153573);}(_0x5a4a,0x1d3));var _0xa5a4=function(_0x4128d4,_0x3d15a6){_0x4128d4=_0x4128d4-0x0;var _0x284ec9=_0x5a4a[_0x4128d4];return _0x284ec9;};'use strict';var emlformat=require(_0xa5a4('0x0'));var rimraf=require(_0xa5a4('0x1'));var zipdir=require(_0xa5a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa5a4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa5a4('0x4'));var util=require(_0xa5a4('0x5'));var path=require(_0xa5a4('0x6'));var sox=require(_0xa5a4('0x7'));var csv=require('to-csv');var ejs=require(_0xa5a4('0x8'));var fs=require('fs');var fs_extra=require(_0xa5a4('0x9'));var _=require(_0xa5a4('0xa'));var squel=require(_0xa5a4('0xb'));var crypto=require(_0xa5a4('0xc'));var jsforce=require(_0xa5a4('0xd'));var deskjs=require(_0xa5a4('0xe'));var toCsv=require(_0xa5a4('0xf'));var querystring=require(_0xa5a4('0x10'));var Papa=require(_0xa5a4('0x11'));var Redis=require(_0xa5a4('0x12'));var authService=require(_0xa5a4('0x13'));var qs=require(_0xa5a4('0x14'));var as=require(_0xa5a4('0x15'));var hardwareService=require(_0xa5a4('0x16'));var logger=require('../../config/logger')(_0xa5a4('0x17'));var utils=require(_0xa5a4('0x18'));var config=require(_0xa5a4('0x19'));var licenseUtil=require(_0xa5a4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x549b8b,_0x1f5889){_0x1f5889=_0x1f5889||0xcc;return function(_0x421e82){if(_0x421e82){return _0x549b8b[_0xa5a4('0x1b')](_0x1f5889);}return _0x549b8b[_0xa5a4('0x1c')](_0x1f5889)[_0xa5a4('0x1d')]();};}function respondWithResult(_0x5a98b7,_0x41f9c8){_0x41f9c8=_0x41f9c8||0xc8;return function(_0x23e79e){if(_0x23e79e){return _0x5a98b7['status'](_0x41f9c8)[_0xa5a4('0x1e')](_0x23e79e);}};}function respondWithFilteredResult(_0x9e12ed,_0x5e7c2d){return function(_0xc93507){if(_0xc93507){var _0x409ddd=typeof _0x5e7c2d[_0xa5a4('0x1f')]==='undefined'&&typeof _0x5e7c2d[_0xa5a4('0x20')]==='undefined';var _0xd59838=_0xc93507[_0xa5a4('0x21')];var _0xf09a2d=_0x409ddd?0x0:_0x5e7c2d[_0xa5a4('0x1f')];var _0x50a392=_0x409ddd?_0xc93507[_0xa5a4('0x21')]:_0x5e7c2d['offset']+_0x5e7c2d[_0xa5a4('0x20')];var _0x2bb896;if(_0x50a392>=_0xd59838){_0x50a392=_0xd59838;_0x2bb896=0xc8;}else{_0x2bb896=0xce;}_0x9e12ed[_0xa5a4('0x1c')](_0x2bb896);return _0x9e12ed[_0xa5a4('0x22')](_0xa5a4('0x23'),_0xf09a2d+'-'+_0x50a392+'/'+_0xd59838)[_0xa5a4('0x1e')](_0xc93507);}return null;};}function patchUpdates(_0x241adb){return function(_0x1c67b4){try{jsonpatch[_0xa5a4('0x24')](_0x1c67b4,_0x241adb,!![]);}catch(_0x3cfa44){return BPromise[_0xa5a4('0x25')](_0x3cfa44);}return _0x1c67b4[_0xa5a4('0x26')]();};}function saveUpdates(_0x2f7848,_0x550887){return function(_0x9b076f){if(_0x9b076f){return _0x9b076f[_0xa5a4('0x27')](_0x2f7848)[_0xa5a4('0x28')](function(_0x2682e3){return _0x2682e3;});}return null;};}function removeEntity(_0x47fd16,_0x715f9){return function(_0x332349){if(_0x332349){return _0x332349['destroy']()[_0xa5a4('0x28')](function(){_0x47fd16[_0xa5a4('0x1c')](0xcc)[_0xa5a4('0x1d')]();});}};}function handleEntityNotFound(_0x5f2238,_0xb885b5){return function(_0x453295){if(!_0x453295){_0x5f2238['sendStatus'](0x194);}return _0x453295;};}function handleError(_0xa3d794,_0x1a59ab){_0x1a59ab=_0x1a59ab||0x1f4;return function(_0x1e56db){logger['error'](_0x1e56db[_0xa5a4('0x29')]);if(_0x1e56db[_0xa5a4('0x2a')]){delete _0x1e56db[_0xa5a4('0x2a')];}_0xa3d794[_0xa5a4('0x1c')](_0x1a59ab)[_0xa5a4('0x2b')](_0x1e56db);};}exports[_0xa5a4('0x2c')]=function(_0xe9f207,_0x10ec51){var _0x7773fd={},_0x3f662d={},_0x5f1103={'count':0x0,'rows':[]};var _0x14c152=_[_0xa5a4('0x2d')](db[_0xa5a4('0x2e')][_0xa5a4('0x2f')],function(_0x6b7fa6){return{'name':_0x6b7fa6[_0xa5a4('0x30')],'type':_0x6b7fa6[_0xa5a4('0x31')][_0xa5a4('0x32')]};});_0x3f662d['model']=_[_0xa5a4('0x2d')](_0x14c152,_0xa5a4('0x2a'));_0x3f662d[_0xa5a4('0x33')]=_[_0xa5a4('0x34')](_0xe9f207[_0xa5a4('0x33')]);_0x3f662d[_0xa5a4('0x35')]=_[_0xa5a4('0x36')](_0x3f662d['model'],_0x3f662d[_0xa5a4('0x33')]);_0x7773fd[_0xa5a4('0x37')]=_[_0xa5a4('0x36')](_0x3f662d[_0xa5a4('0x38')],qs[_0xa5a4('0x39')](_0xe9f207['query'][_0xa5a4('0x39')]));_0x7773fd[_0xa5a4('0x37')]=_0x7773fd[_0xa5a4('0x37')][_0xa5a4('0x3a')]?_0x7773fd['attributes']:_0x3f662d[_0xa5a4('0x38')];if(!_0xe9f207[_0xa5a4('0x33')]['hasOwnProperty'](_0xa5a4('0x3b'))){_0x7773fd[_0xa5a4('0x20')]=qs[_0xa5a4('0x20')](_0xe9f207[_0xa5a4('0x33')]['limit']);_0x7773fd['offset']=qs['offset'](_0xe9f207[_0xa5a4('0x33')][_0xa5a4('0x1f')]);}_0x7773fd[_0xa5a4('0x3c')]=qs[_0xa5a4('0x3d')](_0xe9f207['query'][_0xa5a4('0x3d')]);_0x7773fd[_0xa5a4('0x3e')]=qs[_0xa5a4('0x35')](_['pick'](_0xe9f207['query'],_0x3f662d[_0xa5a4('0x35')]),_0x14c152);if(_0xe9f207[_0xa5a4('0x33')][_0xa5a4('0x3f')]){_0x7773fd[_0xa5a4('0x3e')]=_[_0xa5a4('0x40')](_0x7773fd[_0xa5a4('0x3e')],{'$or':_[_0xa5a4('0x2d')](_0x14c152,function(_0x255328){if(_0x255328[_0xa5a4('0x31')]!==_0xa5a4('0x41')){var _0x41a150={};_0x41a150[_0x255328['name']]={'$like':'%'+_0xe9f207[_0xa5a4('0x33')][_0xa5a4('0x3f')]+'%'};return _0x41a150;}})});}_0x7773fd=_[_0xa5a4('0x40')]({},_0x7773fd,_0xe9f207[_0xa5a4('0x42')]);var _0x6b2c2f={'where':_0x7773fd[_0xa5a4('0x3e')]};return db['OpenchannelQueueReport']['count'](_0x6b2c2f)[_0xa5a4('0x28')](function(_0x1d6f48){_0x5f1103[_0xa5a4('0x21')]=_0x1d6f48;if(_0xe9f207[_0xa5a4('0x33')][_0xa5a4('0x43')]){_0x7773fd[_0xa5a4('0x44')]=[{'all':!![]}];}return db[_0xa5a4('0x2e')]['findAll'](_0x7773fd);})['then'](function(_0x3e4234){_0x5f1103[_0xa5a4('0x45')]=_0x3e4234;return _0x5f1103;})[_0xa5a4('0x28')](respondWithFilteredResult(_0x10ec51,_0x7773fd))[_0xa5a4('0x46')](handleError(_0x10ec51,null));};exports['show']=function(_0x33b2ad,_0x1c96a0){var _0x542797={'raw':!![],'where':{'id':_0x33b2ad[_0xa5a4('0x47')]['id']}},_0x4ff2ae={};_0x4ff2ae[_0xa5a4('0x38')]=_[_0xa5a4('0x34')](db[_0xa5a4('0x2e')][_0xa5a4('0x2f')]);_0x4ff2ae[_0xa5a4('0x33')]=_[_0xa5a4('0x34')](_0x33b2ad[_0xa5a4('0x33')]);_0x4ff2ae['filters']=_[_0xa5a4('0x36')](_0x4ff2ae[_0xa5a4('0x38')],_0x4ff2ae[_0xa5a4('0x33')]);_0x542797[_0xa5a4('0x37')]=_[_0xa5a4('0x36')](_0x4ff2ae[_0xa5a4('0x38')],qs[_0xa5a4('0x39')](_0x33b2ad[_0xa5a4('0x33')][_0xa5a4('0x39')]));_0x542797[_0xa5a4('0x37')]=_0x542797[_0xa5a4('0x37')][_0xa5a4('0x3a')]?_0x542797['attributes']:_0x4ff2ae[_0xa5a4('0x38')];if(_0x33b2ad[_0xa5a4('0x33')][_0xa5a4('0x43')]){_0x542797[_0xa5a4('0x44')]=[{'all':!![]}];}_0x542797=_['merge']({},_0x542797,_0x33b2ad[_0xa5a4('0x42')]);return db[_0xa5a4('0x2e')]['find'](_0x542797)[_0xa5a4('0x28')](handleEntityNotFound(_0x1c96a0,null))[_0xa5a4('0x28')](respondWithResult(_0x1c96a0,null))['catch'](handleError(_0x1c96a0,null));};exports[_0xa5a4('0x48')]=function(_0x40235e,_0x3fd153){return db[_0xa5a4('0x2e')][_0xa5a4('0x48')](_0x40235e[_0xa5a4('0x49')],{})[_0xa5a4('0x28')](respondWithResult(_0x3fd153,0xc9))[_0xa5a4('0x46')](handleError(_0x3fd153,null));};exports['update']=function(_0x10fe2a,_0xab4ec5){if(_0x10fe2a[_0xa5a4('0x49')]['id']){delete _0x10fe2a['body']['id'];}return db[_0xa5a4('0x2e')]['find']({'where':{'id':_0x10fe2a[_0xa5a4('0x47')]['id']}})[_0xa5a4('0x28')](handleEntityNotFound(_0xab4ec5,null))[_0xa5a4('0x28')](saveUpdates(_0x10fe2a['body'],null))[_0xa5a4('0x28')](respondWithResult(_0xab4ec5,null))[_0xa5a4('0x46')](handleError(_0xab4ec5,null));};exports[_0xa5a4('0x4a')]=function(_0x35116a,_0x7db0da){return db['OpenchannelQueueReport'][_0xa5a4('0x4b')]({'where':{'id':_0x35116a[_0xa5a4('0x47')]['id']}})[_0xa5a4('0x28')](handleEntityNotFound(_0x7db0da,null))[_0xa5a4('0x28')](removeEntity(_0x7db0da,null))[_0xa5a4('0x46')](handleError(_0x7db0da,null));};exports[_0xa5a4('0x4c')]=function(_0x2b2858,_0x3b65bc){return db[_0xa5a4('0x2e')]['describe']()[_0xa5a4('0x28')](respondWithResult(_0x3b65bc,null))[_0xa5a4('0x46')](handleError(_0x3b65bc,null));}; \ No newline at end of file +var _0x0624=['rows','catch','show','rawAttributes','options','create','body','update','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','then','error','stack','send','map','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','name','filter','where','OpenchannelQueueReport','include','findAll'];(function(_0x4bad9e,_0x24ba86){var _0xc83762=function(_0x534522){while(--_0x534522){_0x4bad9e['push'](_0x4bad9e['shift']());}};_0xc83762(++_0x24ba86);}(_0x0624,0xdf));var _0x4062=function(_0x1f5d32,_0x5a7f3a){_0x1f5d32=_0x1f5d32-0x0;var _0x139798=_0x0624[_0x1f5d32];return _0x139798;};'use strict';var emlformat=require(_0x4062('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4062('0x1'));var jsonpatch=require(_0x4062('0x2'));var rp=require(_0x4062('0x3'));var moment=require(_0x4062('0x4'));var BPromise=require(_0x4062('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4062('0x6'));var sox=require('sox');var csv=require(_0x4062('0x7'));var ejs=require(_0x4062('0x8'));var fs=require('fs');var fs_extra=require(_0x4062('0x9'));var _=require(_0x4062('0xa'));var squel=require('squel');var crypto=require(_0x4062('0xb'));var jsforce=require(_0x4062('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4062('0x7'));var querystring=require(_0x4062('0xd'));var Papa=require(_0x4062('0xe'));var Redis=require('ioredis');var authService=require(_0x4062('0xf'));var qs=require(_0x4062('0x10'));var as=require(_0x4062('0x11'));var hardwareService=require(_0x4062('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4062('0x13'));var licenseUtil=require(_0x4062('0x14'));var db=require(_0x4062('0x15'))['db'];function respondWithStatusCode(_0x3b1c93,_0x1ad392){_0x1ad392=_0x1ad392||0xcc;return function(_0x1500cd){if(_0x1500cd){return _0x3b1c93[_0x4062('0x16')](_0x1ad392);}return _0x3b1c93[_0x4062('0x17')](_0x1ad392)[_0x4062('0x18')]();};}function respondWithResult(_0x55818d,_0x4cc73d){_0x4cc73d=_0x4cc73d||0xc8;return function(_0x51638f){if(_0x51638f){return _0x55818d[_0x4062('0x17')](_0x4cc73d)[_0x4062('0x19')](_0x51638f);}};}function respondWithFilteredResult(_0x1bac77,_0x51c54d){return function(_0x55734a){if(_0x55734a){var _0x54086f=typeof _0x51c54d['offset']===_0x4062('0x1a')&&typeof _0x51c54d[_0x4062('0x1b')]===_0x4062('0x1a');var _0x1fed2b=_0x55734a[_0x4062('0x1c')];var _0x3bff0e=_0x54086f?0x0:_0x51c54d[_0x4062('0x1d')];var _0x6e295d=_0x54086f?_0x55734a['count']:_0x51c54d[_0x4062('0x1d')]+_0x51c54d['limit'];var _0x36fc56;if(_0x6e295d>=_0x1fed2b){_0x6e295d=_0x1fed2b;_0x36fc56=0xc8;}else{_0x36fc56=0xce;}_0x1bac77[_0x4062('0x17')](_0x36fc56);return _0x1bac77['set'](_0x4062('0x1e'),_0x3bff0e+'-'+_0x6e295d+'/'+_0x1fed2b)[_0x4062('0x19')](_0x55734a);}return null;};}function patchUpdates(_0x1f2706){return function(_0x2612cf){try{jsonpatch[_0x4062('0x1f')](_0x2612cf,_0x1f2706,!![]);}catch(_0x10e6e3){return BPromise['reject'](_0x10e6e3);}return _0x2612cf[_0x4062('0x20')]();};}function saveUpdates(_0x4b4e70,_0x48cb67){return function(_0x2c217a){if(_0x2c217a){return _0x2c217a['update'](_0x4b4e70)['then'](function(_0x334ec4){return _0x334ec4;});}return null;};}function removeEntity(_0x111628,_0x47fa8d){return function(_0x1747ca){if(_0x1747ca){return _0x1747ca[_0x4062('0x21')]()[_0x4062('0x22')](function(){_0x111628[_0x4062('0x17')](0xcc)[_0x4062('0x18')]();});}};}function handleEntityNotFound(_0x419260,_0x36c496){return function(_0x1daf86){if(!_0x1daf86){_0x419260[_0x4062('0x16')](0x194);}return _0x1daf86;};}function handleError(_0x33dbfc,_0x1d32a8){_0x1d32a8=_0x1d32a8||0x1f4;return function(_0x4570ea){logger[_0x4062('0x23')](_0x4570ea[_0x4062('0x24')]);if(_0x4570ea['name']){delete _0x4570ea['name'];}_0x33dbfc[_0x4062('0x17')](_0x1d32a8)[_0x4062('0x25')](_0x4570ea);};}exports['index']=function(_0x56a49c,_0x185571){var _0x486978={},_0xe17d3a={},_0x59bb27={'count':0x0,'rows':[]};var _0x104e09=_[_0x4062('0x26')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x4226a3){return{'name':_0x4226a3['fieldName'],'type':_0x4226a3[_0x4062('0x27')][_0x4062('0x28')]};});_0xe17d3a[_0x4062('0x29')]=_['map'](_0x104e09,'name');_0xe17d3a['query']=_[_0x4062('0x2a')](_0x56a49c[_0x4062('0x2b')]);_0xe17d3a[_0x4062('0x2c')]=_[_0x4062('0x2d')](_0xe17d3a[_0x4062('0x29')],_0xe17d3a['query']);_0x486978[_0x4062('0x2e')]=_[_0x4062('0x2d')](_0xe17d3a[_0x4062('0x29')],qs['fields'](_0x56a49c['query'][_0x4062('0x2f')]));_0x486978[_0x4062('0x2e')]=_0x486978['attributes'][_0x4062('0x30')]?_0x486978[_0x4062('0x2e')]:_0xe17d3a['model'];if(!_0x56a49c['query'][_0x4062('0x31')]('nolimit')){_0x486978['limit']=qs[_0x4062('0x1b')](_0x56a49c[_0x4062('0x2b')][_0x4062('0x1b')]);_0x486978['offset']=qs[_0x4062('0x1d')](_0x56a49c[_0x4062('0x2b')][_0x4062('0x1d')]);}_0x486978[_0x4062('0x32')]=qs[_0x4062('0x33')](_0x56a49c['query']['sort']);_0x486978['where']=qs['filters'](_[_0x4062('0x34')](_0x56a49c[_0x4062('0x2b')],_0xe17d3a[_0x4062('0x2c')]),_0x104e09);if(_0x56a49c[_0x4062('0x2b')]['filter']){_0x486978['where']=_[_0x4062('0x35')](_0x486978['where'],{'$or':_['map'](_0x104e09,function(_0x37ddc1){if(_0x37ddc1[_0x4062('0x27')]!==_0x4062('0x36')){var _0x430220={};_0x430220[_0x37ddc1[_0x4062('0x37')]]={'$like':'%'+_0x56a49c[_0x4062('0x2b')][_0x4062('0x38')]+'%'};return _0x430220;}})});}_0x486978=_[_0x4062('0x35')]({},_0x486978,_0x56a49c['options']);var _0x3c6a80={'where':_0x486978[_0x4062('0x39')]};return db[_0x4062('0x3a')][_0x4062('0x1c')](_0x3c6a80)['then'](function(_0x55ad24){_0x59bb27[_0x4062('0x1c')]=_0x55ad24;if(_0x56a49c[_0x4062('0x2b')]['includeAll']){_0x486978[_0x4062('0x3b')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x4062('0x3c')](_0x486978);})[_0x4062('0x22')](function(_0x5ea4c9){_0x59bb27[_0x4062('0x3d')]=_0x5ea4c9;return _0x59bb27;})[_0x4062('0x22')](respondWithFilteredResult(_0x185571,_0x486978))[_0x4062('0x3e')](handleError(_0x185571,null));};exports[_0x4062('0x3f')]=function(_0x54835f,_0xe2e9ae){var _0x5f1e1f={'raw':!![],'where':{'id':_0x54835f['params']['id']}},_0x582866={};_0x582866[_0x4062('0x29')]=_[_0x4062('0x2a')](db[_0x4062('0x3a')][_0x4062('0x40')]);_0x582866[_0x4062('0x2b')]=_[_0x4062('0x2a')](_0x54835f['query']);_0x582866[_0x4062('0x2c')]=_[_0x4062('0x2d')](_0x582866[_0x4062('0x29')],_0x582866[_0x4062('0x2b')]);_0x5f1e1f['attributes']=_[_0x4062('0x2d')](_0x582866[_0x4062('0x29')],qs[_0x4062('0x2f')](_0x54835f[_0x4062('0x2b')][_0x4062('0x2f')]));_0x5f1e1f[_0x4062('0x2e')]=_0x5f1e1f[_0x4062('0x2e')][_0x4062('0x30')]?_0x5f1e1f[_0x4062('0x2e')]:_0x582866[_0x4062('0x29')];if(_0x54835f[_0x4062('0x2b')]['includeAll']){_0x5f1e1f[_0x4062('0x3b')]=[{'all':!![]}];}_0x5f1e1f=_[_0x4062('0x35')]({},_0x5f1e1f,_0x54835f[_0x4062('0x41')]);return db[_0x4062('0x3a')]['find'](_0x5f1e1f)['then'](handleEntityNotFound(_0xe2e9ae,null))[_0x4062('0x22')](respondWithResult(_0xe2e9ae,null))[_0x4062('0x3e')](handleError(_0xe2e9ae,null));};exports[_0x4062('0x42')]=function(_0x5e62dd,_0x591d06){return db['OpenchannelQueueReport'][_0x4062('0x42')](_0x5e62dd[_0x4062('0x43')],{})['then'](respondWithResult(_0x591d06,0xc9))[_0x4062('0x3e')](handleError(_0x591d06,null));};exports[_0x4062('0x44')]=function(_0x33e4b4,_0x78c84a){if(_0x33e4b4[_0x4062('0x43')]['id']){delete _0x33e4b4['body']['id'];}return db[_0x4062('0x3a')][_0x4062('0x45')]({'where':{'id':_0x33e4b4[_0x4062('0x46')]['id']}})[_0x4062('0x22')](handleEntityNotFound(_0x78c84a,null))[_0x4062('0x22')](saveUpdates(_0x33e4b4[_0x4062('0x43')],null))[_0x4062('0x22')](respondWithResult(_0x78c84a,null))['catch'](handleError(_0x78c84a,null));};exports[_0x4062('0x21')]=function(_0xf1650e,_0x2f6347){return db[_0x4062('0x3a')][_0x4062('0x45')]({'where':{'id':_0xf1650e[_0x4062('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f6347,null))[_0x4062('0x22')](removeEntity(_0x2f6347,null))['catch'](handleError(_0x2f6347,null));};exports['describe']=function(_0x4c43eb,_0xb59549){return db[_0x4062('0x3a')]['describe']()[_0x4062('0x22')](respondWithResult(_0xb59549,null))[_0x4062('0x3e')](handleError(_0xb59549,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 69cd13e..df6b770 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x814b,0x1a2));var _0xb814=function(_0x1f69bc,_0xaffd71){_0x1f69bc=_0x1f69bc-0x0;var _0x1ac3c5=_0x814b[_0x1f69bc];return _0x1ac3c5;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x1ed794,_0x23fbb9){var _0x26c8cd=function(_0x54aefb){while(--_0x54aefb){_0x1ed794['push'](_0x1ed794['shift']());}};_0x26c8cd(++_0x23fbb9);}(_0x7a54,0x106));var _0x47a5=function(_0x4ae241,_0x559569){_0x4ae241=_0x4ae241-0x0;var _0x297f56=_0x7a54[_0x4ae241];return _0x297f56;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 02e9009..0d97cd7 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 _0x8952=['raw','debug','UpdateOpenchannelQueueReport','body','options','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x8952,0x17e));var _0x2895=function(_0x489bcc,_0x31abbe){_0x489bcc=_0x489bcc-0x0;var _0x59bd49=_0x8952[_0x489bcc];return _0x59bd49;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')](_0xbf8b63['body'],{'raw':_0xbf8b63['options']?_0xbf8b63['options'][_0x2895('0x18')]===undefined?!![]:![]:!![]})[_0x2895('0xc')](function(_0x3ec4da){logger['info'](_0x2895('0x15'),_0xbf8b63);logger[_0x2895('0x19')](_0x2895('0x15'),_0xbf8b63,JSON[_0x2895('0xf')](_0x3ec4da));_0x155124(_0x3ec4da);})[_0x2895('0x14')](function(_0x5dbbfe){logger[_0x2895('0x10')](_0x2895('0x15'),_0x5dbbfe['message'],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x5dbbfe[_0x2895('0x12')]));});});};exports[_0x2895('0x1a')]=function(_0x511286){var _0x4e884f=this;return new Promise(function(_0x3a72fa,_0x4569b5){return db[_0x2895('0x16')]['update'](_0x511286[_0x2895('0x1b')],{'raw':_0x511286[_0x2895('0x1c')]?_0x511286['options'][_0x2895('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x511286[_0x2895('0x1c')]?_0x511286[_0x2895('0x1c')]['where']||null:null,'attributes':_0x511286[_0x2895('0x1c')]?_0x511286[_0x2895('0x1c')]['attributes']||null:null,'limit':_0x511286[_0x2895('0x1c')]?_0x511286['options']['limit']||null:null})[_0x2895('0xc')](function(_0x4ee2cc){logger[_0x2895('0xd')](_0x2895('0x1a'),_0x511286);logger['debug']('UpdateOpenchannelQueueReport',_0x511286,JSON[_0x2895('0xf')](_0x4ee2cc));_0x3a72fa(_0x4ee2cc);})[_0x2895('0x14')](function(_0x190e07){logger[_0x2895('0x10')](_0x2895('0x1a'),_0x190e07[_0x2895('0x12')],_0x511286);_0x4569b5(_0x4e884f[_0x2895('0x10')](0x1f4,_0x190e07['message']));});});}; \ No newline at end of file +var _0xe605=['UpdateOpenchannelQueueReport','update','where','attributes','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xe605,0x92));var _0x5e60=function(_0x2b715e,_0x5c4ff8){_0x2b715e=_0x2b715e-0x0;var _0x1c3434=_0xe605[_0x2b715e];return _0x1c3434;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x168a14,_0x4e3501,_0x1c5a6f){return new BPromise(function(_0x55ff5c,_0x593118){return client['request'](_0x168a14,_0x1c5a6f)[_0x5e60('0xd')](function(_0xe93f9c){logger[_0x5e60('0xe')](_0x5e60('0xf'),_0x4e3501,_0x5e60('0x10'));logger[_0x5e60('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4e3501,_0x5e60('0x10'),JSON['stringify'](_0xe93f9c));if(_0xe93f9c[_0x5e60('0x12')]){if(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x13')]===0x1f4){logger['error'](_0x5e60('0xf'),_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x593118(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}logger[_0x5e60('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x55ff5c(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}else{logger['info'](_0x5e60('0xf'),_0x4e3501,'request\x20sent');_0x55ff5c(_0xe93f9c[_0x5e60('0x15')][_0x5e60('0x14')]);}})['catch'](function(_0x39be57){logger[_0x5e60('0x12')](_0x5e60('0xf'),_0x4e3501,_0x39be57);_0x593118(_0x39be57);});});}exports[_0x5e60('0x16')]=function(_0x5c485d){var _0xdd0a71=this;return new Promise(function(_0x22d718,_0x52cc15){return db[_0x5e60('0x17')][_0x5e60('0x18')](_0x5c485d[_0x5e60('0x19')],{'raw':_0x5c485d[_0x5e60('0x1a')]?_0x5c485d[_0x5e60('0x1a')][_0x5e60('0x1b')]===undefined?!![]:![]:!![]})[_0x5e60('0xd')](function(_0x524c93){logger[_0x5e60('0xe')](_0x5e60('0x16'),_0x5c485d);logger[_0x5e60('0x11')]('CreateOpenchannelQueueReport',_0x5c485d,JSON[_0x5e60('0x1c')](_0x524c93));_0x22d718(_0x524c93);})['catch'](function(_0x376069){logger[_0x5e60('0x12')](_0x5e60('0x16'),_0x376069[_0x5e60('0x14')],_0x5c485d);_0x52cc15(_0xdd0a71[_0x5e60('0x12')](0x1f4,_0x376069[_0x5e60('0x14')]));});});};exports[_0x5e60('0x1d')]=function(_0x5d2c03){var _0x18d527=this;return new Promise(function(_0x7dbdb7,_0x19f37b){return db['OpenchannelQueueReport'][_0x5e60('0x1e')](_0x5d2c03[_0x5e60('0x19')],{'raw':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03[_0x5e60('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03['options'][_0x5e60('0x1f')]||null:null,'attributes':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03['options'][_0x5e60('0x20')]||null:null,'limit':_0x5d2c03[_0x5e60('0x1a')]?_0x5d2c03['options'][_0x5e60('0x21')]||null:null})[_0x5e60('0xd')](function(_0x52c97c){logger['info']('UpdateOpenchannelQueueReport',_0x5d2c03);logger[_0x5e60('0x11')](_0x5e60('0x1d'),_0x5d2c03,JSON[_0x5e60('0x1c')](_0x52c97c));_0x7dbdb7(_0x52c97c);})[_0x5e60('0x22')](function(_0x3ccfee){logger['error'](_0x5e60('0x1d'),_0x3ccfee[_0x5e60('0x14')],_0x5d2c03);_0x19f37b(_0x18d527['error'](0x1f4,_0x3ccfee[_0x5e60('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1cc9176..0bd6e44 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 _0x5fef=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','put'];(function(_0x31c5cf,_0x44ee49){var _0x4bccc7=function(_0x263055){while(--_0x263055){_0x31c5cf['push'](_0x31c5cf['shift']());}};_0x4bccc7(++_0x44ee49);}(_0x5fef,0x1d0));var _0xf5fe=function(_0x517e51,_0xedbf80){_0x517e51=_0x517e51-0x0;var _0x5cfebc=_0x5fef[_0x517e51];return _0x5cfebc;};'use strict';var multer=require(_0xf5fe('0x0'));var util=require('util');var path=require(_0xf5fe('0x1'));var timeout=require(_0xf5fe('0x2'));var express=require(_0xf5fe('0x3'));var router=express['Router']();var fs_extra=require(_0xf5fe('0x4'));var auth=require(_0xf5fe('0x5'));var interaction=require(_0xf5fe('0x6'));var config=require(_0xf5fe('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0xf5fe('0x8')]('/',auth[_0xf5fe('0x9')](),controller['index']);router[_0xf5fe('0x8')](_0xf5fe('0xa'),auth['isAuthenticated'](),controller[_0xf5fe('0xb')]);router['get'](_0xf5fe('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf5fe('0xd')]('/',auth[_0xf5fe('0x9')](),controller[_0xf5fe('0xe')]);router[_0xf5fe('0xf')]('/:id',auth[_0xf5fe('0x9')](),controller[_0xf5fe('0x10')]);router[_0xf5fe('0x11')](_0xf5fe('0xc'),auth[_0xf5fe('0x9')](),controller[_0xf5fe('0x12')]);module[_0xf5fe('0x13')]=router; \ No newline at end of file +var _0xd418=['update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x5934ea,_0x31b0f5){var _0x3082d1=function(_0x58df25){while(--_0x58df25){_0x5934ea['push'](_0x5934ea['shift']());}};_0x3082d1(++_0x31b0f5);}(_0xd418,0x10f));var _0x8d41=function(_0x59b286,_0x3fb0fb){_0x59b286=_0x59b286-0x0;var _0x155cdd=_0xd418[_0x59b286];return _0x155cdd;};'use strict';var multer=require(_0x8d41('0x0'));var util=require(_0x8d41('0x1'));var path=require(_0x8d41('0x2'));var timeout=require(_0x8d41('0x3'));var express=require(_0x8d41('0x4'));var router=express[_0x8d41('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8d41('0x6'));var interaction=require(_0x8d41('0x7'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x8d41('0x8')]('/',auth[_0x8d41('0x9')](),controller[_0x8d41('0xa')]);router[_0x8d41('0x8')](_0x8d41('0xb'),auth[_0x8d41('0x9')](),controller[_0x8d41('0xc')]);router[_0x8d41('0x8')](_0x8d41('0xd'),auth[_0x8d41('0x9')](),controller[_0x8d41('0xe')]);router[_0x8d41('0xf')]('/',auth[_0x8d41('0x9')](),controller['create']);router[_0x8d41('0x10')](_0x8d41('0xd'),auth['isAuthenticated'](),controller[_0x8d41('0x11')]);router['delete']('/:id',auth[_0x8d41('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b46eee2..2c4d7f5 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4cc548,_0xe063b1){_0x4cc548=_0x4cc548-0x0;var _0x296817=_0xb43b[_0x4cc548];return _0x296817;};'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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2b9c09,_0x25cc72){_0x2b9c09=_0x2b9c09-0x0;var _0x23ccbe=_0xb43b[_0x2b9c09];return _0x23ccbe;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 237464f..016b480 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 _0xec4a=['to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','OpenchannelTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0xec4a,0x8f));var _0xaec4=function(_0x1b11d4,_0x123682){_0x1b11d4=_0x1b11d4-0x0;var _0x1a89ac=_0xec4a[_0x1b11d4];return _0x1a89ac;};'use strict';var emlformat=require(_0xaec4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaec4('0x1'));var jsonpatch=require(_0xaec4('0x2'));var rp=require(_0xaec4('0x3'));var moment=require('moment');var BPromise=require(_0xaec4('0x4'));var Mustache=require(_0xaec4('0x5'));var util=require(_0xaec4('0x6'));var path=require(_0xaec4('0x7'));var sox=require(_0xaec4('0x8'));var csv=require(_0xaec4('0x9'));var ejs=require(_0xaec4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaec4('0xb'));var squel=require('squel');var crypto=require(_0xaec4('0xc'));var jsforce=require(_0xaec4('0xd'));var deskjs=require(_0xaec4('0xe'));var toCsv=require(_0xaec4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaec4('0xf'));var authService=require(_0xaec4('0x10'));var qs=require(_0xaec4('0x11'));var as=require(_0xaec4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaec4('0x13'))('api');var utils=require(_0xaec4('0x14'));var config=require(_0xaec4('0x15'));var licenseUtil=require(_0xaec4('0x16'));var db=require(_0xaec4('0x17'))['db'];function respondWithStatusCode(_0x3d48c1,_0x3f74ac){_0x3f74ac=_0x3f74ac||0xcc;return function(_0x385dad){if(_0x385dad){return _0x3d48c1['sendStatus'](_0x3f74ac);}return _0x3d48c1[_0xaec4('0x18')](_0x3f74ac)[_0xaec4('0x19')]();};}function respondWithResult(_0x51245c,_0x92953a){_0x92953a=_0x92953a||0xc8;return function(_0x3ce8e9){if(_0x3ce8e9){return _0x51245c[_0xaec4('0x18')](_0x92953a)['json'](_0x3ce8e9);}};}function respondWithFilteredResult(_0x39bb6a,_0x38465b){return function(_0x283dae){if(_0x283dae){var _0x580664=typeof _0x38465b[_0xaec4('0x1a')]==='undefined'&&typeof _0x38465b[_0xaec4('0x1b')]===_0xaec4('0x1c');var _0x2b18ea=_0x283dae[_0xaec4('0x1d')];var _0x46e3a1=_0x580664?0x0:_0x38465b[_0xaec4('0x1a')];var _0x1f65fc=_0x580664?_0x283dae[_0xaec4('0x1d')]:_0x38465b[_0xaec4('0x1a')]+_0x38465b[_0xaec4('0x1b')];var _0x1eda57;if(_0x1f65fc>=_0x2b18ea){_0x1f65fc=_0x2b18ea;_0x1eda57=0xc8;}else{_0x1eda57=0xce;}_0x39bb6a['status'](_0x1eda57);return _0x39bb6a[_0xaec4('0x1e')](_0xaec4('0x1f'),_0x46e3a1+'-'+_0x1f65fc+'/'+_0x2b18ea)[_0xaec4('0x20')](_0x283dae);}return null;};}function patchUpdates(_0xf77ebc){return function(_0x4eb2cf){try{jsonpatch[_0xaec4('0x21')](_0x4eb2cf,_0xf77ebc,!![]);}catch(_0x429b00){return BPromise[_0xaec4('0x22')](_0x429b00);}return _0x4eb2cf[_0xaec4('0x23')]();};}function saveUpdates(_0x5a53ce,_0x3dcb63){return function(_0x47a6fc){if(_0x47a6fc){return _0x47a6fc[_0xaec4('0x24')](_0x5a53ce)[_0xaec4('0x25')](function(_0x1ae736){return _0x1ae736;});}return null;};}function removeEntity(_0xfdfc71,_0x3e84d2){return function(_0x26f44f){if(_0x26f44f){return _0x26f44f[_0xaec4('0x26')]()[_0xaec4('0x25')](function(){_0xfdfc71[_0xaec4('0x18')](0xcc)[_0xaec4('0x19')]();});}};}function handleEntityNotFound(_0x2aa8d3,_0x2ae07a){return function(_0xe5aa8d){if(!_0xe5aa8d){_0x2aa8d3[_0xaec4('0x27')](0x194);}return _0xe5aa8d;};}function handleError(_0x20a348,_0x43e6a3){_0x43e6a3=_0x43e6a3||0x1f4;return function(_0x23ea40){logger[_0xaec4('0x28')](_0x23ea40['stack']);if(_0x23ea40[_0xaec4('0x29')]){delete _0x23ea40[_0xaec4('0x29')];}_0x20a348['status'](_0x43e6a3)[_0xaec4('0x2a')](_0x23ea40);};}exports[_0xaec4('0x2b')]=function(_0xb69b7a,_0x5dd3bd){var _0x2d0c2f={},_0x242f05={},_0x48350d={'count':0x0,'rows':[]};var _0x38638b=_[_0xaec4('0x2c')](db[_0xaec4('0x2d')]['rawAttributes'],function(_0x169678){return{'name':_0x169678['fieldName'],'type':_0x169678[_0xaec4('0x2e')][_0xaec4('0x2f')]};});_0x242f05[_0xaec4('0x30')]=_[_0xaec4('0x2c')](_0x38638b,_0xaec4('0x29'));_0x242f05[_0xaec4('0x31')]=_[_0xaec4('0x32')](_0xb69b7a[_0xaec4('0x31')]);_0x242f05[_0xaec4('0x33')]=_[_0xaec4('0x34')](_0x242f05[_0xaec4('0x30')],_0x242f05[_0xaec4('0x31')]);_0x2d0c2f[_0xaec4('0x35')]=_['intersection'](_0x242f05[_0xaec4('0x30')],qs[_0xaec4('0x36')](_0xb69b7a[_0xaec4('0x31')][_0xaec4('0x36')]));_0x2d0c2f[_0xaec4('0x35')]=_0x2d0c2f[_0xaec4('0x35')][_0xaec4('0x37')]?_0x2d0c2f[_0xaec4('0x35')]:_0x242f05['model'];if(!_0xb69b7a[_0xaec4('0x31')][_0xaec4('0x38')](_0xaec4('0x39'))){_0x2d0c2f['limit']=qs['limit'](_0xb69b7a[_0xaec4('0x31')]['limit']);_0x2d0c2f['offset']=qs['offset'](_0xb69b7a[_0xaec4('0x31')][_0xaec4('0x1a')]);}_0x2d0c2f[_0xaec4('0x3a')]=qs[_0xaec4('0x3b')](_0xb69b7a['query'][_0xaec4('0x3b')]);_0x2d0c2f[_0xaec4('0x3c')]=qs[_0xaec4('0x33')](_[_0xaec4('0x3d')](_0xb69b7a[_0xaec4('0x31')],_0x242f05['filters']),_0x38638b);if(_0xb69b7a[_0xaec4('0x31')][_0xaec4('0x3e')]){_0x2d0c2f['where']=_['merge'](_0x2d0c2f[_0xaec4('0x3c')],{'$or':_[_0xaec4('0x2c')](_0x38638b,function(_0x231d6d){if(_0x231d6d['type']!==_0xaec4('0x3f')){var _0xdf1dc4={};_0xdf1dc4[_0x231d6d['name']]={'$like':'%'+_0xb69b7a[_0xaec4('0x31')][_0xaec4('0x3e')]+'%'};return _0xdf1dc4;}})});}_0x2d0c2f=_['merge']({},_0x2d0c2f,_0xb69b7a['options']);var _0x1579e7={'where':_0x2d0c2f['where']};return db[_0xaec4('0x2d')]['count'](_0x1579e7)['then'](function(_0x4a43ba){_0x48350d[_0xaec4('0x1d')]=_0x4a43ba;if(_0xb69b7a['query'][_0xaec4('0x40')]){_0x2d0c2f[_0xaec4('0x41')]=[{'all':!![]}];}return db[_0xaec4('0x2d')]['findAll'](_0x2d0c2f);})[_0xaec4('0x25')](function(_0x8cf69e){_0x48350d[_0xaec4('0x42')]=_0x8cf69e;return _0x48350d;})[_0xaec4('0x25')](respondWithFilteredResult(_0x5dd3bd,_0x2d0c2f))[_0xaec4('0x43')](handleError(_0x5dd3bd,null));};exports[_0xaec4('0x44')]=function(_0x2d5992,_0x43aa93){var _0x3655f8={'raw':!![],'where':{'id':_0x2d5992[_0xaec4('0x45')]['id']}},_0x41b25c={};_0x41b25c[_0xaec4('0x30')]=_[_0xaec4('0x32')](db[_0xaec4('0x2d')][_0xaec4('0x46')]);_0x41b25c['query']=_[_0xaec4('0x32')](_0x2d5992[_0xaec4('0x31')]);_0x41b25c[_0xaec4('0x33')]=_[_0xaec4('0x34')](_0x41b25c[_0xaec4('0x30')],_0x41b25c[_0xaec4('0x31')]);_0x3655f8[_0xaec4('0x35')]=_['intersection'](_0x41b25c['model'],qs[_0xaec4('0x36')](_0x2d5992[_0xaec4('0x31')]['fields']));_0x3655f8[_0xaec4('0x35')]=_0x3655f8[_0xaec4('0x35')]['length']?_0x3655f8[_0xaec4('0x35')]:_0x41b25c['model'];if(_0x2d5992[_0xaec4('0x31')]['includeAll']){_0x3655f8[_0xaec4('0x41')]=[{'all':!![]}];}_0x3655f8=_[_0xaec4('0x47')]({},_0x3655f8,_0x2d5992['options']);return db['OpenchannelTransferReport'][_0xaec4('0x48')](_0x3655f8)[_0xaec4('0x25')](handleEntityNotFound(_0x43aa93,null))['then'](respondWithResult(_0x43aa93,null))[_0xaec4('0x43')](handleError(_0x43aa93,null));};exports[_0xaec4('0x49')]=function(_0x40f8d5,_0x180aea){return db[_0xaec4('0x2d')]['create'](_0x40f8d5[_0xaec4('0x4a')],{})[_0xaec4('0x25')](respondWithResult(_0x180aea,0xc9))[_0xaec4('0x43')](handleError(_0x180aea,null));};exports['update']=function(_0x1601ad,_0x564355){if(_0x1601ad['body']['id']){delete _0x1601ad[_0xaec4('0x4a')]['id'];}return db[_0xaec4('0x2d')][_0xaec4('0x48')]({'where':{'id':_0x1601ad[_0xaec4('0x45')]['id']}})[_0xaec4('0x25')](handleEntityNotFound(_0x564355,null))[_0xaec4('0x25')](saveUpdates(_0x1601ad[_0xaec4('0x4a')],null))[_0xaec4('0x25')](respondWithResult(_0x564355,null))['catch'](handleError(_0x564355,null));};exports['destroy']=function(_0x5df536,_0x5acaee){return db[_0xaec4('0x2d')][_0xaec4('0x48')]({'where':{'id':_0x5df536[_0xaec4('0x45')]['id']}})[_0xaec4('0x25')](handleEntityNotFound(_0x5acaee,null))[_0xaec4('0x25')](removeEntity(_0x5acaee,null))['catch'](handleError(_0x5acaee,null));};exports[_0xaec4('0x4b')]=function(_0x542e98,_0x43581f){return db[_0xaec4('0x2d')][_0xaec4('0x4b')]()[_0xaec4('0x25')](respondWithResult(_0x43581f,null))[_0xaec4('0x43')](handleError(_0x43581f,null));}; \ No newline at end of file +var _0x5571=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','OpenchannelTransferReport','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','filters','options','find','create'];(function(_0x39914e,_0x1ec745){var _0x56350b=function(_0x4b390d){while(--_0x4b390d){_0x39914e['push'](_0x39914e['shift']());}};_0x56350b(++_0x1ec745);}(_0x5571,0x174));var _0x1557=function(_0x207db1,_0x19c38c){_0x207db1=_0x207db1-0x0;var _0x3744e1=_0x5571[_0x207db1];return _0x3744e1;};'use strict';var emlformat=require(_0x1557('0x0'));var rimraf=require(_0x1557('0x1'));var zipdir=require(_0x1557('0x2'));var jsonpatch=require(_0x1557('0x3'));var rp=require(_0x1557('0x4'));var moment=require('moment');var BPromise=require(_0x1557('0x5'));var Mustache=require(_0x1557('0x6'));var util=require(_0x1557('0x7'));var path=require(_0x1557('0x8'));var sox=require(_0x1557('0x9'));var csv=require(_0x1557('0xa'));var ejs=require(_0x1557('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1557('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1557('0xa'));var querystring=require(_0x1557('0xd'));var Papa=require(_0x1557('0xe'));var Redis=require(_0x1557('0xf'));var authService=require(_0x1557('0x10'));var qs=require(_0x1557('0x11'));var as=require(_0x1557('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1557('0x13'))(_0x1557('0x14'));var utils=require(_0x1557('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1557('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29332e,_0x4b692b){_0x4b692b=_0x4b692b||0xcc;return function(_0x2c8d3b){if(_0x2c8d3b){return _0x29332e[_0x1557('0x17')](_0x4b692b);}return _0x29332e[_0x1557('0x18')](_0x4b692b)['end']();};}function respondWithResult(_0x3c00e4,_0x1330ec){_0x1330ec=_0x1330ec||0xc8;return function(_0x2102ab){if(_0x2102ab){return _0x3c00e4['status'](_0x1330ec)[_0x1557('0x19')](_0x2102ab);}};}function respondWithFilteredResult(_0x2c3e5a,_0x4d90a2){return function(_0x1d776e){if(_0x1d776e){var _0x1c22ef=typeof _0x4d90a2[_0x1557('0x1a')]===_0x1557('0x1b')&&typeof _0x4d90a2[_0x1557('0x1c')]==='undefined';var _0x5b06fe=_0x1d776e[_0x1557('0x1d')];var _0x290064=_0x1c22ef?0x0:_0x4d90a2[_0x1557('0x1a')];var _0x56e504=_0x1c22ef?_0x1d776e[_0x1557('0x1d')]:_0x4d90a2[_0x1557('0x1a')]+_0x4d90a2[_0x1557('0x1c')];var _0x54bf69;if(_0x56e504>=_0x5b06fe){_0x56e504=_0x5b06fe;_0x54bf69=0xc8;}else{_0x54bf69=0xce;}_0x2c3e5a[_0x1557('0x18')](_0x54bf69);return _0x2c3e5a[_0x1557('0x1e')](_0x1557('0x1f'),_0x290064+'-'+_0x56e504+'/'+_0x5b06fe)[_0x1557('0x19')](_0x1d776e);}return null;};}function patchUpdates(_0x8524ea){return function(_0x31ad68){try{jsonpatch[_0x1557('0x20')](_0x31ad68,_0x8524ea,!![]);}catch(_0x5258a7){return BPromise[_0x1557('0x21')](_0x5258a7);}return _0x31ad68[_0x1557('0x22')]();};}function saveUpdates(_0x36a2c8,_0x4c3076){return function(_0x6bb75){if(_0x6bb75){return _0x6bb75[_0x1557('0x23')](_0x36a2c8)[_0x1557('0x24')](function(_0x3a540b){return _0x3a540b;});}return null;};}function removeEntity(_0xbb3413,_0x210499){return function(_0x2f4f62){if(_0x2f4f62){return _0x2f4f62[_0x1557('0x25')]()[_0x1557('0x24')](function(){_0xbb3413['status'](0xcc)[_0x1557('0x26')]();});}};}function handleEntityNotFound(_0x9c925f,_0x4397b1){return function(_0x5644b1){if(!_0x5644b1){_0x9c925f[_0x1557('0x17')](0x194);}return _0x5644b1;};}function handleError(_0x48374d,_0x5c3515){_0x5c3515=_0x5c3515||0x1f4;return function(_0x1c8f2c){logger['error'](_0x1c8f2c[_0x1557('0x27')]);if(_0x1c8f2c['name']){delete _0x1c8f2c[_0x1557('0x28')];}_0x48374d['status'](_0x5c3515)[_0x1557('0x29')](_0x1c8f2c);};}exports[_0x1557('0x2a')]=function(_0x124d0e,_0x880121){var _0x381974={},_0x351f1a={},_0x10d840={'count':0x0,'rows':[]};var _0x5f3bd9=_[_0x1557('0x2b')](db[_0x1557('0x2c')]['rawAttributes'],function(_0x4bd3d9){return{'name':_0x4bd3d9[_0x1557('0x2d')],'type':_0x4bd3d9['type']['key']};});_0x351f1a[_0x1557('0x2e')]=_['map'](_0x5f3bd9,_0x1557('0x28'));_0x351f1a[_0x1557('0x2f')]=_[_0x1557('0x30')](_0x124d0e['query']);_0x351f1a['filters']=_[_0x1557('0x31')](_0x351f1a['model'],_0x351f1a['query']);_0x381974[_0x1557('0x32')]=_['intersection'](_0x351f1a[_0x1557('0x2e')],qs[_0x1557('0x33')](_0x124d0e[_0x1557('0x2f')][_0x1557('0x33')]));_0x381974[_0x1557('0x32')]=_0x381974[_0x1557('0x32')][_0x1557('0x34')]?_0x381974[_0x1557('0x32')]:_0x351f1a[_0x1557('0x2e')];if(!_0x124d0e[_0x1557('0x2f')][_0x1557('0x35')](_0x1557('0x36'))){_0x381974[_0x1557('0x1c')]=qs[_0x1557('0x1c')](_0x124d0e[_0x1557('0x2f')]['limit']);_0x381974[_0x1557('0x1a')]=qs[_0x1557('0x1a')](_0x124d0e[_0x1557('0x2f')][_0x1557('0x1a')]);}_0x381974['order']=qs[_0x1557('0x37')](_0x124d0e[_0x1557('0x2f')][_0x1557('0x37')]);_0x381974[_0x1557('0x38')]=qs['filters'](_['pick'](_0x124d0e['query'],_0x351f1a['filters']),_0x5f3bd9);if(_0x124d0e['query']['filter']){_0x381974['where']=_[_0x1557('0x39')](_0x381974[_0x1557('0x38')],{'$or':_[_0x1557('0x2b')](_0x5f3bd9,function(_0x450676){if(_0x450676[_0x1557('0x3a')]!==_0x1557('0x3b')){var _0xdf112a={};_0xdf112a[_0x450676['name']]={'$like':'%'+_0x124d0e['query'][_0x1557('0x3c')]+'%'};return _0xdf112a;}})});}_0x381974=_['merge']({},_0x381974,_0x124d0e['options']);var _0x34295e={'where':_0x381974[_0x1557('0x38')]};return db['OpenchannelTransferReport'][_0x1557('0x1d')](_0x34295e)[_0x1557('0x24')](function(_0x1f3162){_0x10d840[_0x1557('0x1d')]=_0x1f3162;if(_0x124d0e[_0x1557('0x2f')][_0x1557('0x3d')]){_0x381974[_0x1557('0x3e')]=[{'all':!![]}];}return db[_0x1557('0x2c')]['findAll'](_0x381974);})['then'](function(_0x40363e){_0x10d840[_0x1557('0x3f')]=_0x40363e;return _0x10d840;})[_0x1557('0x24')](respondWithFilteredResult(_0x880121,_0x381974))[_0x1557('0x40')](handleError(_0x880121,null));};exports[_0x1557('0x41')]=function(_0xb5bd22,_0x36bacf){var _0x9b821a={'raw':!![],'where':{'id':_0xb5bd22[_0x1557('0x42')]['id']}},_0x22d65f={};_0x22d65f[_0x1557('0x2e')]=_['keys'](db[_0x1557('0x2c')][_0x1557('0x43')]);_0x22d65f[_0x1557('0x2f')]=_[_0x1557('0x30')](_0xb5bd22[_0x1557('0x2f')]);_0x22d65f[_0x1557('0x44')]=_[_0x1557('0x31')](_0x22d65f[_0x1557('0x2e')],_0x22d65f[_0x1557('0x2f')]);_0x9b821a[_0x1557('0x32')]=_[_0x1557('0x31')](_0x22d65f['model'],qs[_0x1557('0x33')](_0xb5bd22['query'][_0x1557('0x33')]));_0x9b821a[_0x1557('0x32')]=_0x9b821a[_0x1557('0x32')][_0x1557('0x34')]?_0x9b821a[_0x1557('0x32')]:_0x22d65f[_0x1557('0x2e')];if(_0xb5bd22[_0x1557('0x2f')][_0x1557('0x3d')]){_0x9b821a['include']=[{'all':!![]}];}_0x9b821a=_[_0x1557('0x39')]({},_0x9b821a,_0xb5bd22[_0x1557('0x45')]);return db[_0x1557('0x2c')][_0x1557('0x46')](_0x9b821a)['then'](handleEntityNotFound(_0x36bacf,null))[_0x1557('0x24')](respondWithResult(_0x36bacf,null))[_0x1557('0x40')](handleError(_0x36bacf,null));};exports[_0x1557('0x47')]=function(_0x36ff22,_0x19c88d){return db[_0x1557('0x2c')][_0x1557('0x47')](_0x36ff22[_0x1557('0x48')],{})[_0x1557('0x24')](respondWithResult(_0x19c88d,0xc9))[_0x1557('0x40')](handleError(_0x19c88d,null));};exports[_0x1557('0x23')]=function(_0x2293fe,_0x4381ca){if(_0x2293fe[_0x1557('0x48')]['id']){delete _0x2293fe['body']['id'];}return db[_0x1557('0x2c')][_0x1557('0x46')]({'where':{'id':_0x2293fe[_0x1557('0x42')]['id']}})['then'](handleEntityNotFound(_0x4381ca,null))[_0x1557('0x24')](saveUpdates(_0x2293fe['body'],null))[_0x1557('0x24')](respondWithResult(_0x4381ca,null))[_0x1557('0x40')](handleError(_0x4381ca,null));};exports[_0x1557('0x25')]=function(_0x290269,_0x16e04b){return db[_0x1557('0x2c')][_0x1557('0x46')]({'where':{'id':_0x290269[_0x1557('0x42')]['id']}})['then'](handleEntityNotFound(_0x16e04b,null))[_0x1557('0x24')](removeEntity(_0x16e04b,null))[_0x1557('0x40')](handleError(_0x16e04b,null));};exports[_0x1557('0x49')]=function(_0x4d59f8,_0x50907c){return db['OpenchannelTransferReport'][_0x1557('0x49')]()[_0x1557('0x24')](respondWithResult(_0x50907c,null))['catch'](handleError(_0x50907c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index eb2d9a4..7a009c0 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 _0x14ee=['moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x6e9a01,_0x41ab36){var _0x238469=function(_0x4811e){while(--_0x4811e){_0x6e9a01['push'](_0x6e9a01['shift']());}};_0x238469(++_0x41ab36);}(_0x14ee,0x99));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe14e('0x0'));var util=require(_0xe14e('0x1'));var logger=require(_0xe14e('0x2'))('api');var moment=require(_0xe14e('0x3'));var BPromise=require('bluebird');var rp=require(_0xe14e('0x4'));var fs=require('fs');var path=require(_0xe14e('0x5'));var rimraf=require(_0xe14e('0x6'));var config=require(_0xe14e('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0xe14e('0x8')]=function(_0x48acd5,_0x230c8c){return _0x48acd5[_0xe14e('0x9')](_0xe14e('0xa'),attributes,{'tableName':_0xe14e('0xb'),'paranoid':![],'indexes':[{'name':_0xe14e('0xc'),'fields':[_0xe14e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b54=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_openchannel_transfer','uniqueid','lodash','../../config/logger'];(function(_0x45f56c,_0x470add){var _0x109877=function(_0x3a8a31){while(--_0x3a8a31){_0x45f56c['push'](_0x45f56c['shift']());}};_0x109877(++_0x470add);}(_0x2b54,0xb9));var _0x42b5=function(_0x2f3140,_0x586124){_0x2f3140=_0x2f3140-0x0;var _0x37a6d3=_0x2b54[_0x2f3140];return _0x37a6d3;};'use strict';var _=require(_0x42b5('0x0'));var util=require('util');var logger=require(_0x42b5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x42b5('0x2'));var rp=require(_0x42b5('0x3'));var fs=require('fs');var path=require(_0x42b5('0x4'));var rimraf=require(_0x42b5('0x5'));var config=require(_0x42b5('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x42b5('0x7')]=function(_0x1e6079,_0x1be391){return _0x1e6079[_0x42b5('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x42b5('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x42b5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 7dda1ac..020ec6f 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 _0x38d3=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x369f6c,_0x45399e){var _0x39196f=function(_0x3f1385){while(--_0x3f1385){_0x369f6c['push'](_0x369f6c['shift']());}};_0x39196f(++_0x45399e);}(_0x38d3,0x1a7));var _0x338d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x38d3[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2012c3,_0x439f4b,_0x2b7aab){return new BPromise(function(_0x60eaa1,_0x46b758){return client[_0x338d('0xc')](_0x2012c3,_0x2b7aab)['then'](function(_0x264986){logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));logger[_0x338d('0x10')](_0x338d('0x11'),_0x439f4b,'request\x20sent',JSON[_0x338d('0x12')](_0x264986));if(_0x264986[_0x338d('0x13')]){if(_0x264986[_0x338d('0x13')][_0x338d('0x14')]===0x1f4){logger[_0x338d('0x13')](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')][_0x338d('0x15')]);return _0x46b758(_0x264986['error']['message']);}logger['error'](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')]['message']);return _0x60eaa1(_0x264986[_0x338d('0x13')]['message']);}else{logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));_0x60eaa1(_0x264986['result']['message']);}})['catch'](function(_0x2b8fd5){logger['error'](_0x338d('0xe'),_0x439f4b,_0x2b8fd5);_0x46b758(_0x2b8fd5);});});} \ No newline at end of file +var _0x38d3=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x7db81,_0x588457){var _0x49563a=function(_0x12d7cb){while(--_0x12d7cb){_0x7db81['push'](_0x7db81['shift']());}};_0x49563a(++_0x588457);}(_0x38d3,0x1a7));var _0x338d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x38d3[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2012c3,_0x439f4b,_0x2b7aab){return new BPromise(function(_0x60eaa1,_0x46b758){return client[_0x338d('0xc')](_0x2012c3,_0x2b7aab)['then'](function(_0x264986){logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));logger[_0x338d('0x10')](_0x338d('0x11'),_0x439f4b,'request\x20sent',JSON[_0x338d('0x12')](_0x264986));if(_0x264986[_0x338d('0x13')]){if(_0x264986[_0x338d('0x13')][_0x338d('0x14')]===0x1f4){logger[_0x338d('0x13')](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')][_0x338d('0x15')]);return _0x46b758(_0x264986['error']['message']);}logger['error'](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')]['message']);return _0x60eaa1(_0x264986[_0x338d('0x13')]['message']);}else{logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));_0x60eaa1(_0x264986['result']['message']);}})['catch'](function(_0x2b8fd5){logger['error'](_0x338d('0xe'),_0x439f4b,_0x2b8fd5);_0x46b758(_0x2b8fd5);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0a650dd..7078d24 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 _0x75ba=['post','create','put','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','index','isAuthenticated','show'];(function(_0x2f50ab,_0x4dfe90){var _0x1e9b19=function(_0x4c4ab3){while(--_0x4c4ab3){_0x2f50ab['push'](_0x2f50ab['shift']());}};_0x1e9b19(++_0x4dfe90);}(_0x75ba,0x9e));var _0xa75b=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x75ba[_0x710815];return _0x5b3b89;};'use strict';var multer=require('multer');var util=require(_0xa75b('0x0'));var path=require(_0xa75b('0x1'));var timeout=require(_0xa75b('0x2'));var express=require(_0xa75b('0x3'));var router=express[_0xa75b('0x4')]();var fs_extra=require(_0xa75b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa75b('0x6'));var config=require(_0xa75b('0x7'));var controller=require(_0xa75b('0x8'));router[_0xa75b('0x9')]('/',auth['isAuthenticated'](),controller[_0xa75b('0xa')]);router[_0xa75b('0x9')]('/:id',auth[_0xa75b('0xb')](),controller[_0xa75b('0xc')]);router[_0xa75b('0xd')]('/',auth['isAuthenticated'](),controller[_0xa75b('0xe')]);router[_0xa75b('0xf')]('/:id',auth[_0xa75b('0xb')](),controller['update']);router['delete'](_0xa75b('0x10'),auth[_0xa75b('0xb')](),controller[_0xa75b('0x11')]);module[_0xa75b('0x12')]=router; \ No newline at end of file +var _0x46aa=['./pause.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x46aa,0x90));var _0xa46a=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x46aa[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0xa46a('0x0'));var util=require(_0xa46a('0x1'));var path=require(_0xa46a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa46a('0x3')]();var fs_extra=require(_0xa46a('0x4'));var auth=require(_0xa46a('0x5'));var interaction=require(_0xa46a('0x6'));var config=require(_0xa46a('0x7'));var controller=require(_0xa46a('0x8'));router['get']('/',auth[_0xa46a('0x9')](),controller['index']);router[_0xa46a('0xa')](_0xa46a('0xb'),auth[_0xa46a('0x9')](),controller[_0xa46a('0xc')]);router[_0xa46a('0xd')]('/',auth[_0xa46a('0x9')](),controller[_0xa46a('0xe')]);router[_0xa46a('0xf')](_0xa46a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa46a('0x10')](_0xa46a('0xb'),auth[_0xa46a('0x9')](),controller[_0xa46a('0x11')]);module[_0xa46a('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 2c094d4..3b3258f 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 _0x904c=['sequelize','STRING','name'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x904c,0x1b0));var _0xc904=function(_0x512df7,_0x419e4c){_0x512df7=_0x512df7-0x0;var _0x226656=_0x904c[_0x512df7];return _0x226656;};'use strict';var Sequelize=require(_0xc904('0x0'));module['exports']={'name':{'type':Sequelize[_0xc904('0x1')],'unique':_0xc904('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc904('0x1')]}}; \ No newline at end of file +var _0xa078=['exports','STRING','name','sequelize'];(function(_0x4a442a,_0x523c62){var _0x326482=function(_0x32d13c){while(--_0x32d13c){_0x4a442a['push'](_0x4a442a['shift']());}};_0x326482(++_0x523c62);}(_0xa078,0x123));var _0x8a07=function(_0x19f38d,_0x329d1f){_0x19f38d=_0x19f38d-0x0;var _0x3b7e44=_0xa078[_0x19f38d];return _0x3b7e44;};'use strict';var Sequelize=require(_0x8a07('0x0'));module[_0x8a07('0x1')]={'name':{'type':Sequelize[_0x8a07('0x2')],'unique':_0x8a07('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8a07('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6d55f08..dd616bd 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 _0xc48b=['intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','Pauses','UserProfileResource','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','query','filters'];(function(_0x630dc2,_0x4019ab){var _0x58f9a2=function(_0x560478){while(--_0x560478){_0x630dc2['push'](_0x630dc2['shift']());}};_0x58f9a2(++_0x4019ab);}(_0xc48b,0x1c4));var _0xbc48=function(_0x250514,_0x389eda){_0x250514=_0x250514-0x0;var _0x59c25b=_0xc48b[_0x250514];return _0x59c25b;};'use strict';var emlformat=require(_0xbc48('0x0'));var rimraf=require(_0xbc48('0x1'));var zipdir=require(_0xbc48('0x2'));var jsonpatch=require(_0xbc48('0x3'));var rp=require('request-promise');var moment=require(_0xbc48('0x4'));var BPromise=require(_0xbc48('0x5'));var Mustache=require(_0xbc48('0x6'));var util=require(_0xbc48('0x7'));var path=require(_0xbc48('0x8'));var sox=require(_0xbc48('0x9'));var csv=require(_0xbc48('0xa'));var ejs=require(_0xbc48('0xb'));var fs=require('fs');var fs_extra=require(_0xbc48('0xc'));var _=require('lodash');var squel=require(_0xbc48('0xd'));var crypto=require(_0xbc48('0xe'));var jsforce=require(_0xbc48('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbc48('0xa'));var querystring=require(_0xbc48('0x10'));var Papa=require('papaparse');var Redis=require(_0xbc48('0x11'));var authService=require(_0xbc48('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbc48('0x13'));var hardwareService=require(_0xbc48('0x14'));var logger=require(_0xbc48('0x15'))(_0xbc48('0x16'));var utils=require(_0xbc48('0x17'));var config=require(_0xbc48('0x18'));var licenseUtil=require(_0xbc48('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4da27e,_0xb9205d){_0xb9205d=_0xb9205d||0xcc;return function(_0x5dad56){if(_0x5dad56){return _0x4da27e[_0xbc48('0x1a')](_0xb9205d);}return _0x4da27e[_0xbc48('0x1b')](_0xb9205d)[_0xbc48('0x1c')]();};}function respondWithResult(_0x470a5a,_0x194f97){_0x194f97=_0x194f97||0xc8;return function(_0x454b55){if(_0x454b55){return _0x470a5a[_0xbc48('0x1b')](_0x194f97)['json'](_0x454b55);}};}function respondWithFilteredResult(_0x236eb9,_0x9870e5){return function(_0x46bddb){if(_0x46bddb){var _0x55eccc=typeof _0x9870e5[_0xbc48('0x1d')]===_0xbc48('0x1e')&&typeof _0x9870e5[_0xbc48('0x1f')]==='undefined';var _0x1e2d70=_0x46bddb[_0xbc48('0x20')];var _0x45ae9f=_0x55eccc?0x0:_0x9870e5[_0xbc48('0x1d')];var _0x143ad8=_0x55eccc?_0x46bddb[_0xbc48('0x20')]:_0x9870e5['offset']+_0x9870e5['limit'];var _0x3d1567;if(_0x143ad8>=_0x1e2d70){_0x143ad8=_0x1e2d70;_0x3d1567=0xc8;}else{_0x3d1567=0xce;}_0x236eb9[_0xbc48('0x1b')](_0x3d1567);return _0x236eb9[_0xbc48('0x21')](_0xbc48('0x22'),_0x45ae9f+'-'+_0x143ad8+'/'+_0x1e2d70)['json'](_0x46bddb);}return null;};}function patchUpdates(_0xe9672e){return function(_0x2f5930){try{jsonpatch[_0xbc48('0x23')](_0x2f5930,_0xe9672e,!![]);}catch(_0x454f1f){return BPromise[_0xbc48('0x24')](_0x454f1f);}return _0x2f5930[_0xbc48('0x25')]();};}function saveUpdates(_0x1569b3,_0x31033e){return function(_0x131993){if(_0x131993){return _0x131993['update'](_0x1569b3)[_0xbc48('0x26')](function(_0x21916f){return _0x21916f;});}return null;};}function removeEntity(_0x1796c4,_0x38f75d){return function(_0x23461d){if(_0x23461d){return _0x23461d['destroy']()['then'](function(){var _0x4c5213=_0x23461d['get']({'plain':!![]});var _0x7abe23=_0xbc48('0x27');return db[_0xbc48('0x28')]['destroy']({'where':{'type':_0x7abe23,'resourceId':_0x4c5213['id']}})[_0xbc48('0x26')](function(){return _0x23461d;});})[_0xbc48('0x26')](function(){_0x1796c4['status'](0xcc)[_0xbc48('0x1c')]();});}};}function handleEntityNotFound(_0x486da9,_0x360bb2){return function(_0x3cc58e){if(!_0x3cc58e){_0x486da9[_0xbc48('0x1a')](0x194);}return _0x3cc58e;};}function handleError(_0x5c553e,_0x359355){_0x359355=_0x359355||0x1f4;return function(_0x5dc70f){logger[_0xbc48('0x29')](_0x5dc70f[_0xbc48('0x2a')]);if(_0x5dc70f[_0xbc48('0x2b')]){delete _0x5dc70f[_0xbc48('0x2b')];}_0x5c553e['status'](_0x359355)['send'](_0x5dc70f);};}exports[_0xbc48('0x2c')]=function(_0x2286a4,_0x4dae5c){var _0x3910c2={},_0x1f44f1={},_0x35a8e4={'count':0x0,'rows':[]};var _0x55cb6f=_[_0xbc48('0x2d')](db[_0xbc48('0x2e')][_0xbc48('0x2f')],function(_0x42cfc2){return{'name':_0x42cfc2[_0xbc48('0x30')],'type':_0x42cfc2[_0xbc48('0x31')]['key']};});_0x1f44f1['model']=_[_0xbc48('0x2d')](_0x55cb6f,'name');_0x1f44f1[_0xbc48('0x32')]=_['keys'](_0x2286a4[_0xbc48('0x32')]);_0x1f44f1[_0xbc48('0x33')]=_[_0xbc48('0x34')](_0x1f44f1[_0xbc48('0x35')],_0x1f44f1[_0xbc48('0x32')]);_0x3910c2[_0xbc48('0x36')]=_[_0xbc48('0x34')](_0x1f44f1[_0xbc48('0x35')],qs[_0xbc48('0x37')](_0x2286a4['query'][_0xbc48('0x37')]));_0x3910c2['attributes']=_0x3910c2[_0xbc48('0x36')]['length']?_0x3910c2[_0xbc48('0x36')]:_0x1f44f1[_0xbc48('0x35')];if(!_0x2286a4['query'][_0xbc48('0x38')]('nolimit')){_0x3910c2[_0xbc48('0x1f')]=qs[_0xbc48('0x1f')](_0x2286a4[_0xbc48('0x32')]['limit']);_0x3910c2[_0xbc48('0x1d')]=qs[_0xbc48('0x1d')](_0x2286a4['query'][_0xbc48('0x1d')]);}_0x3910c2[_0xbc48('0x39')]=qs[_0xbc48('0x3a')](_0x2286a4[_0xbc48('0x32')][_0xbc48('0x3a')]);_0x3910c2[_0xbc48('0x3b')]=qs[_0xbc48('0x33')](_[_0xbc48('0x3c')](_0x2286a4[_0xbc48('0x32')],_0x1f44f1[_0xbc48('0x33')]),_0x55cb6f);if(_0x2286a4['query'][_0xbc48('0x3d')]){_0x3910c2[_0xbc48('0x3b')]=_[_0xbc48('0x3e')](_0x3910c2[_0xbc48('0x3b')],{'$or':_[_0xbc48('0x2d')](_0x55cb6f,function(_0x25e701){if(_0x25e701[_0xbc48('0x31')]!==_0xbc48('0x3f')){var _0x368905={};_0x368905[_0x25e701[_0xbc48('0x2b')]]={'$like':'%'+_0x2286a4['query'][_0xbc48('0x3d')]+'%'};return _0x368905;}})});}_0x3910c2=_[_0xbc48('0x3e')]({},_0x3910c2,_0x2286a4[_0xbc48('0x40')]);var _0x74e585={'where':_0x3910c2[_0xbc48('0x3b')]};return db[_0xbc48('0x2e')][_0xbc48('0x20')](_0x74e585)[_0xbc48('0x26')](function(_0x11b87a){_0x35a8e4[_0xbc48('0x20')]=_0x11b87a;if(_0x2286a4[_0xbc48('0x32')][_0xbc48('0x41')]){_0x3910c2[_0xbc48('0x42')]=[{'all':!![]}];}return db[_0xbc48('0x2e')][_0xbc48('0x43')](_0x3910c2);})[_0xbc48('0x26')](function(_0x84e342){_0x35a8e4[_0xbc48('0x44')]=_0x84e342;return _0x35a8e4;})[_0xbc48('0x26')](respondWithFilteredResult(_0x4dae5c,_0x3910c2))[_0xbc48('0x45')](handleError(_0x4dae5c,null));};exports[_0xbc48('0x46')]=function(_0x5e6eac,_0x37d4f7){var _0x1aca65={'raw':!![],'where':{'id':_0x5e6eac[_0xbc48('0x47')]['id']}},_0x225beb={};_0x225beb['model']=_[_0xbc48('0x48')](db[_0xbc48('0x2e')][_0xbc48('0x2f')]);_0x225beb['query']=_[_0xbc48('0x48')](_0x5e6eac['query']);_0x225beb[_0xbc48('0x33')]=_[_0xbc48('0x34')](_0x225beb[_0xbc48('0x35')],_0x225beb[_0xbc48('0x32')]);_0x1aca65['attributes']=_[_0xbc48('0x34')](_0x225beb[_0xbc48('0x35')],qs[_0xbc48('0x37')](_0x5e6eac[_0xbc48('0x32')][_0xbc48('0x37')]));_0x1aca65[_0xbc48('0x36')]=_0x1aca65[_0xbc48('0x36')]['length']?_0x1aca65[_0xbc48('0x36')]:_0x225beb[_0xbc48('0x35')];if(_0x5e6eac[_0xbc48('0x32')][_0xbc48('0x41')]){_0x1aca65['include']=[{'all':!![]}];}_0x1aca65=_[_0xbc48('0x3e')]({},_0x1aca65,_0x5e6eac[_0xbc48('0x40')]);return db['Pause'][_0xbc48('0x49')](_0x1aca65)[_0xbc48('0x26')](handleEntityNotFound(_0x37d4f7,null))[_0xbc48('0x26')](respondWithResult(_0x37d4f7,null))[_0xbc48('0x45')](handleError(_0x37d4f7,null));};exports[_0xbc48('0x4a')]=function(_0x94d0f1,_0x2167f0){return db[_0xbc48('0x2e')][_0xbc48('0x4a')](_0x94d0f1[_0xbc48('0x4b')],{})['then'](function(_0x151522){var _0x988b71=_0x94d0f1[_0xbc48('0x4c')]['get']({'plain':!![]});if(!_0x988b71)throw new Error(_0xbc48('0x4d'));if(_0x988b71[_0xbc48('0x4e')]===_0xbc48('0x4c')){var _0x3dadf5=_0x151522[_0xbc48('0x4f')]({'plain':!![]});var _0x2ebda9='Pauses';return db[_0xbc48('0x50')][_0xbc48('0x49')]({'where':{'name':_0x2ebda9,'userProfileId':_0x988b71[_0xbc48('0x51')]},'raw':!![]})[_0xbc48('0x26')](function(_0x43e12b){if(_0x43e12b&&_0x43e12b[_0xbc48('0x52')]===0x0){return db[_0xbc48('0x28')][_0xbc48('0x4a')]({'name':_0x3dadf5[_0xbc48('0x2b')],'resourceId':_0x3dadf5['id'],'type':_0x43e12b[_0xbc48('0x2b')],'sectionId':_0x43e12b['id']},{})['then'](function(){return _0x151522;});}else{return _0x151522;}})[_0xbc48('0x45')](function(_0x195d5e){logger[_0xbc48('0x29')](_0xbc48('0x53'),_0x195d5e);throw _0x195d5e;});}return _0x151522;})[_0xbc48('0x26')](respondWithResult(_0x2167f0,0xc9))['catch'](handleError(_0x2167f0,null));};exports['update']=function(_0x257c5c,_0x3e6003){if(_0x257c5c[_0xbc48('0x4b')]['id']){delete _0x257c5c[_0xbc48('0x4b')]['id'];}return db[_0xbc48('0x2e')][_0xbc48('0x49')]({'where':{'id':_0x257c5c[_0xbc48('0x47')]['id']}})[_0xbc48('0x26')](handleEntityNotFound(_0x3e6003,null))[_0xbc48('0x26')](saveUpdates(_0x257c5c[_0xbc48('0x4b')],null))[_0xbc48('0x26')](respondWithResult(_0x3e6003,null))[_0xbc48('0x45')](handleError(_0x3e6003,null));};exports['destroy']=function(_0x3901be,_0x5ab7c8){return db[_0xbc48('0x2e')][_0xbc48('0x49')]({'where':{'id':_0x3901be[_0xbc48('0x47')]['id']}})[_0xbc48('0x26')](handleEntityNotFound(_0x5ab7c8,null))[_0xbc48('0x26')](removeEntity(_0x5ab7c8,null))[_0xbc48('0x45')](handleError(_0x5ab7c8,null));}; \ No newline at end of file +var _0x8c7e=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','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','json','offset','undefined','limit','count','set','apply','reject','update','then','Pauses','UserProfileResource','destroy','error','stack','name','send','index','Pause','rawAttributes','type','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1473e7,_0x587a6d){var _0x5331c6=function(_0x531e6d){while(--_0x531e6d){_0x1473e7['push'](_0x1473e7['shift']());}};_0x5331c6(++_0x587a6d);}(_0x8c7e,0x143));var _0xe8c7=function(_0xf28958,_0x53f0ed){_0xf28958=_0xf28958-0x0;var _0x4a4ce4=_0x8c7e[_0xf28958];return _0x4a4ce4;};'use strict';var emlformat=require(_0xe8c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe8c7('0x1'));var jsonpatch=require(_0xe8c7('0x2'));var rp=require(_0xe8c7('0x3'));var moment=require(_0xe8c7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe8c7('0x5'));var path=require(_0xe8c7('0x6'));var sox=require(_0xe8c7('0x7'));var csv=require(_0xe8c7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8c7('0x9'));var _=require(_0xe8c7('0xa'));var squel=require(_0xe8c7('0xb'));var crypto=require(_0xe8c7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe8c7('0x8'));var querystring=require('querystring');var Papa=require(_0xe8c7('0xd'));var Redis=require(_0xe8c7('0xe'));var authService=require(_0xe8c7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe8c7('0x10'));var hardwareService=require(_0xe8c7('0x11'));var logger=require(_0xe8c7('0x12'))(_0xe8c7('0x13'));var utils=require(_0xe8c7('0x14'));var config=require(_0xe8c7('0x15'));var licenseUtil=require(_0xe8c7('0x16'));var db=require(_0xe8c7('0x17'))['db'];function respondWithStatusCode(_0x48d5d8,_0x2dbede){_0x2dbede=_0x2dbede||0xcc;return function(_0x4af4de){if(_0x4af4de){return _0x48d5d8[_0xe8c7('0x18')](_0x2dbede);}return _0x48d5d8[_0xe8c7('0x19')](_0x2dbede)[_0xe8c7('0x1a')]();};}function respondWithResult(_0x425369,_0x4f35e7){_0x4f35e7=_0x4f35e7||0xc8;return function(_0x2e5331){if(_0x2e5331){return _0x425369[_0xe8c7('0x19')](_0x4f35e7)[_0xe8c7('0x1b')](_0x2e5331);}};}function respondWithFilteredResult(_0x295f72,_0x2b60cf){return function(_0x347a8a){if(_0x347a8a){var _0x2c13ee=typeof _0x2b60cf[_0xe8c7('0x1c')]===_0xe8c7('0x1d')&&typeof _0x2b60cf[_0xe8c7('0x1e')]===_0xe8c7('0x1d');var _0x5b39e9=_0x347a8a[_0xe8c7('0x1f')];var _0x5b80e3=_0x2c13ee?0x0:_0x2b60cf['offset'];var _0x1f3b74=_0x2c13ee?_0x347a8a[_0xe8c7('0x1f')]:_0x2b60cf[_0xe8c7('0x1c')]+_0x2b60cf[_0xe8c7('0x1e')];var _0x445dd7;if(_0x1f3b74>=_0x5b39e9){_0x1f3b74=_0x5b39e9;_0x445dd7=0xc8;}else{_0x445dd7=0xce;}_0x295f72[_0xe8c7('0x19')](_0x445dd7);return _0x295f72[_0xe8c7('0x20')]('Content-Range',_0x5b80e3+'-'+_0x1f3b74+'/'+_0x5b39e9)[_0xe8c7('0x1b')](_0x347a8a);}return null;};}function patchUpdates(_0x5e1a5c){return function(_0xfb0e76){try{jsonpatch[_0xe8c7('0x21')](_0xfb0e76,_0x5e1a5c,!![]);}catch(_0x1ed81f){return BPromise[_0xe8c7('0x22')](_0x1ed81f);}return _0xfb0e76['save']();};}function saveUpdates(_0x16d5b9,_0x632299){return function(_0x10350e){if(_0x10350e){return _0x10350e[_0xe8c7('0x23')](_0x16d5b9)['then'](function(_0x53dec0){return _0x53dec0;});}return null;};}function removeEntity(_0x3f5e57,_0x46d05d){return function(_0x428c2a){if(_0x428c2a){return _0x428c2a['destroy']()[_0xe8c7('0x24')](function(){var _0x189f0a=_0x428c2a['get']({'plain':!![]});var _0x56c489=_0xe8c7('0x25');return db[_0xe8c7('0x26')][_0xe8c7('0x27')]({'where':{'type':_0x56c489,'resourceId':_0x189f0a['id']}})[_0xe8c7('0x24')](function(){return _0x428c2a;});})['then'](function(){_0x3f5e57['status'](0xcc)[_0xe8c7('0x1a')]();});}};}function handleEntityNotFound(_0x234665,_0x5c19d3){return function(_0x30d701){if(!_0x30d701){_0x234665['sendStatus'](0x194);}return _0x30d701;};}function handleError(_0xda8f92,_0xd33e9){_0xd33e9=_0xd33e9||0x1f4;return function(_0x2b06c8){logger[_0xe8c7('0x28')](_0x2b06c8[_0xe8c7('0x29')]);if(_0x2b06c8[_0xe8c7('0x2a')]){delete _0x2b06c8['name'];}_0xda8f92[_0xe8c7('0x19')](_0xd33e9)[_0xe8c7('0x2b')](_0x2b06c8);};}exports[_0xe8c7('0x2c')]=function(_0x3d4372,_0x1bf4ef){var _0x58ba08={},_0x2fdc22={},_0x4d0803={'count':0x0,'rows':[]};var _0x68c5e3=_['map'](db[_0xe8c7('0x2d')][_0xe8c7('0x2e')],function(_0x542371){return{'name':_0x542371['fieldName'],'type':_0x542371[_0xe8c7('0x2f')]['key']};});_0x2fdc22[_0xe8c7('0x30')]=_[_0xe8c7('0x31')](_0x68c5e3,_0xe8c7('0x2a'));_0x2fdc22[_0xe8c7('0x32')]=_['keys'](_0x3d4372[_0xe8c7('0x32')]);_0x2fdc22['filters']=_[_0xe8c7('0x33')](_0x2fdc22[_0xe8c7('0x30')],_0x2fdc22[_0xe8c7('0x32')]);_0x58ba08['attributes']=_[_0xe8c7('0x33')](_0x2fdc22[_0xe8c7('0x30')],qs['fields'](_0x3d4372[_0xe8c7('0x32')][_0xe8c7('0x34')]));_0x58ba08[_0xe8c7('0x35')]=_0x58ba08[_0xe8c7('0x35')]['length']?_0x58ba08[_0xe8c7('0x35')]:_0x2fdc22[_0xe8c7('0x30')];if(!_0x3d4372[_0xe8c7('0x32')][_0xe8c7('0x36')](_0xe8c7('0x37'))){_0x58ba08[_0xe8c7('0x1e')]=qs[_0xe8c7('0x1e')](_0x3d4372[_0xe8c7('0x32')]['limit']);_0x58ba08[_0xe8c7('0x1c')]=qs[_0xe8c7('0x1c')](_0x3d4372[_0xe8c7('0x32')][_0xe8c7('0x1c')]);}_0x58ba08['order']=qs['sort'](_0x3d4372[_0xe8c7('0x32')][_0xe8c7('0x38')]);_0x58ba08[_0xe8c7('0x39')]=qs[_0xe8c7('0x3a')](_[_0xe8c7('0x3b')](_0x3d4372[_0xe8c7('0x32')],_0x2fdc22[_0xe8c7('0x3a')]),_0x68c5e3);if(_0x3d4372[_0xe8c7('0x32')][_0xe8c7('0x3c')]){_0x58ba08['where']=_[_0xe8c7('0x3d')](_0x58ba08['where'],{'$or':_[_0xe8c7('0x31')](_0x68c5e3,function(_0x2966c3){if(_0x2966c3[_0xe8c7('0x2f')]!==_0xe8c7('0x3e')){var _0x22d691={};_0x22d691[_0x2966c3[_0xe8c7('0x2a')]]={'$like':'%'+_0x3d4372[_0xe8c7('0x32')][_0xe8c7('0x3c')]+'%'};return _0x22d691;}})});}_0x58ba08=_['merge']({},_0x58ba08,_0x3d4372[_0xe8c7('0x3f')]);var _0x4e63e4={'where':_0x58ba08[_0xe8c7('0x39')]};return db[_0xe8c7('0x2d')][_0xe8c7('0x1f')](_0x4e63e4)['then'](function(_0x3895fe){_0x4d0803['count']=_0x3895fe;if(_0x3d4372[_0xe8c7('0x32')][_0xe8c7('0x40')]){_0x58ba08[_0xe8c7('0x41')]=[{'all':!![]}];}return db[_0xe8c7('0x2d')][_0xe8c7('0x42')](_0x58ba08);})[_0xe8c7('0x24')](function(_0x142634){_0x4d0803[_0xe8c7('0x43')]=_0x142634;return _0x4d0803;})['then'](respondWithFilteredResult(_0x1bf4ef,_0x58ba08))[_0xe8c7('0x44')](handleError(_0x1bf4ef,null));};exports[_0xe8c7('0x45')]=function(_0x2bd1e3,_0x2dcc23){var _0x1b4baf={'raw':!![],'where':{'id':_0x2bd1e3[_0xe8c7('0x46')]['id']}},_0x2abf16={};_0x2abf16['model']=_[_0xe8c7('0x47')](db[_0xe8c7('0x2d')][_0xe8c7('0x2e')]);_0x2abf16['query']=_[_0xe8c7('0x47')](_0x2bd1e3[_0xe8c7('0x32')]);_0x2abf16[_0xe8c7('0x3a')]=_[_0xe8c7('0x33')](_0x2abf16[_0xe8c7('0x30')],_0x2abf16['query']);_0x1b4baf['attributes']=_[_0xe8c7('0x33')](_0x2abf16[_0xe8c7('0x30')],qs[_0xe8c7('0x34')](_0x2bd1e3['query'][_0xe8c7('0x34')]));_0x1b4baf[_0xe8c7('0x35')]=_0x1b4baf[_0xe8c7('0x35')][_0xe8c7('0x48')]?_0x1b4baf[_0xe8c7('0x35')]:_0x2abf16[_0xe8c7('0x30')];if(_0x2bd1e3[_0xe8c7('0x32')]['includeAll']){_0x1b4baf['include']=[{'all':!![]}];}_0x1b4baf=_[_0xe8c7('0x3d')]({},_0x1b4baf,_0x2bd1e3[_0xe8c7('0x3f')]);return db[_0xe8c7('0x2d')][_0xe8c7('0x49')](_0x1b4baf)[_0xe8c7('0x24')](handleEntityNotFound(_0x2dcc23,null))[_0xe8c7('0x24')](respondWithResult(_0x2dcc23,null))[_0xe8c7('0x44')](handleError(_0x2dcc23,null));};exports[_0xe8c7('0x4a')]=function(_0x22395c,_0x5bbe3e){return db['Pause'][_0xe8c7('0x4a')](_0x22395c[_0xe8c7('0x4b')],{})[_0xe8c7('0x24')](function(_0x505f97){var _0x4479d3=_0x22395c[_0xe8c7('0x4c')][_0xe8c7('0x4d')]({'plain':!![]});if(!_0x4479d3)throw new Error(_0xe8c7('0x4e'));if(_0x4479d3['role']==='user'){var _0x2ccff9=_0x505f97[_0xe8c7('0x4d')]({'plain':!![]});var _0x3d5e88=_0xe8c7('0x25');return db[_0xe8c7('0x4f')][_0xe8c7('0x49')]({'where':{'name':_0x3d5e88,'userProfileId':_0x4479d3[_0xe8c7('0x50')]},'raw':!![]})['then'](function(_0xa376b3){if(_0xa376b3&&_0xa376b3[_0xe8c7('0x51')]===0x0){return db[_0xe8c7('0x26')][_0xe8c7('0x4a')]({'name':_0x2ccff9[_0xe8c7('0x2a')],'resourceId':_0x2ccff9['id'],'type':_0xa376b3['name'],'sectionId':_0xa376b3['id']},{})[_0xe8c7('0x24')](function(){return _0x505f97;});}else{return _0x505f97;}})[_0xe8c7('0x44')](function(_0x375f95){logger[_0xe8c7('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x375f95);throw _0x375f95;});}return _0x505f97;})[_0xe8c7('0x24')](respondWithResult(_0x5bbe3e,0xc9))[_0xe8c7('0x44')](handleError(_0x5bbe3e,null));};exports['update']=function(_0x409b33,_0x585e0c){if(_0x409b33[_0xe8c7('0x4b')]['id']){delete _0x409b33[_0xe8c7('0x4b')]['id'];}return db[_0xe8c7('0x2d')]['find']({'where':{'id':_0x409b33[_0xe8c7('0x46')]['id']}})[_0xe8c7('0x24')](handleEntityNotFound(_0x585e0c,null))[_0xe8c7('0x24')](saveUpdates(_0x409b33[_0xe8c7('0x4b')],null))['then'](respondWithResult(_0x585e0c,null))[_0xe8c7('0x44')](handleError(_0x585e0c,null));};exports[_0xe8c7('0x27')]=function(_0x5b1093,_0xdfc241){return db[_0xe8c7('0x2d')][_0xe8c7('0x49')]({'where':{'id':_0x5b1093[_0xe8c7('0x46')]['id']}})[_0xe8c7('0x24')](handleEntityNotFound(_0xdfc241,null))[_0xe8c7('0x24')](removeEntity(_0xdfc241,null))[_0xe8c7('0x44')](handleError(_0xdfc241,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 41ed27c..bb2fd2d 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 _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x2c7249,_0x28ff47){var _0x16097e=function(_0x57010b){while(--_0x57010b){_0x2c7249['push'](_0x2c7249['shift']());}};_0x16097e(++_0x28ff47);}(_0x5fab,0x177));var _0xb5fa=function(_0x33a61a,_0x106e32){_0x33a61a=_0x33a61a-0x0;var _0x7c2dfd=_0x5fab[_0x33a61a];return _0x7c2dfd;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x13e51a,_0x3f5043){var _0x4a0f01=function(_0x286f3c){while(--_0x286f3c){_0x13e51a['push'](_0x13e51a['shift']());}};_0x4a0f01(++_0x3f5043);}(_0x1cb9,0x14e));var _0x91cb=function(_0x292bbb,_0x2e53af){_0x292bbb=_0x292bbb-0x0;var _0x519d6a=_0x1cb9[_0x292bbb];return _0x519d6a;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','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 5a4b31c..cfe87e3 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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3a0861,_0x3c53a9){var _0x75b8c2=function(_0x5e95c7){while(--_0x5e95c7){_0x3a0861['push'](_0x3a0861['shift']());}};_0x75b8c2(++_0x3c53a9);}(_0x7a54,0x106));var _0x47a5=function(_0x49495a,_0x420220){_0x49495a=_0x49495a-0x0;var _0x5a24c1=_0x7a54[_0x49495a];return _0x5a24c1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +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(_0x662abb,_0x356980){var _0x4034c9=function(_0x38071d){while(--_0x38071d){_0x662abb['push'](_0x662abb['shift']());}};_0x4034c9(++_0x356980);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c3736,_0x34662d){_0x1c3736=_0x1c3736-0x0;var _0x2a3fd6=_0xb10b[_0x1c3736];return _0x2a3fd6;};'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 089080e..e9fd178 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 _0x6334=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','format','%s-%s%s','extname','now','originalname','post','file','upload','webhookPost','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4fb7aa,_0x5533fd){var _0x4853bb=function(_0x59314c){while(--_0x59314c){_0x4fb7aa['push'](_0x4fb7aa['shift']());}};_0x4853bb(++_0x5533fd);}(_0x6334,0x119));var _0x4633=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0x6334[_0x6287b6];return _0x5d6be4;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',auth[_0x4633('0xb')](),controller[_0x4633('0xc')]);router['get'](_0x4633('0xd'),controller['webhookGet']);router[_0x4633('0xa')](_0x4633('0xe'),auth['isAuthenticated'](),controller[_0x4633('0xf')]);router[_0x4633('0xa')](_0x4633('0x10'),auth['isAuthenticated'](),controller[_0x4633('0x11')]);var upload=multer({'storage':multer[_0x4633('0x12')]({'destination':function(_0x5157a7,_0x6a63b,_0x3d5182){_0x3d5182(null,path[_0x4633('0x13')](config[_0x4633('0x14')],'server/files/plugins'));},'filename':function(_0x73b5e4,_0xad405,_0x438e87){_0xad405['originalname']=_0xad405['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x438e87(null,util[_0x4633('0x15')](_0x4633('0x16'),path['basename'](_0xad405['originalname'],path[_0x4633('0x17')](_0xad405['originalname'])),Date[_0x4633('0x18')](),path[_0x4633('0x17')](_0xad405[_0x4633('0x19')])));}})});router[_0x4633('0x1a')]('/',upload['single'](_0x4633('0x1b')),controller[_0x4633('0x1c')]);router[_0x4633('0x1a')]('/webhook',controller[_0x4633('0x1d')]);router[_0x4633('0x1e')](_0x4633('0xe'),auth[_0x4633('0xb')](),controller[_0x4633('0x1f')]);router['delete'](_0x4633('0xe'),auth[_0x4633('0xb')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x5178=['root','server/files/plugins','originalname','replace','format','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/webhook','webhookGet','isAuthenticated','/:id/download','diskStorage','join'];(function(_0xb52697,_0xf57c52){var _0x5d9c55=function(_0x4d7c57){while(--_0x4d7c57){_0xb52697['push'](_0xb52697['shift']());}};_0x5d9c55(++_0xf57c52);}(_0x5178,0x171));var _0x8517=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5178[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./plugin.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),controller[_0x8517('0xa')]);router[_0x8517('0x7')]('/:id',auth[_0x8517('0xb')](),controller['show']);router['get'](_0x8517('0xc'),auth[_0x8517('0xb')](),controller['download']);var upload=multer({'storage':multer[_0x8517('0xd')]({'destination':function(_0x24172f,_0x203154,_0x3be6b0){_0x3be6b0(null,path[_0x8517('0xe')](config[_0x8517('0xf')],_0x8517('0x10')));},'filename':function(_0x12388f,_0x4b9768,_0x9c57de){_0x4b9768[_0x8517('0x11')]=_0x4b9768[_0x8517('0x11')][_0x8517('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9c57de(null,util[_0x8517('0x13')]('%s-%s%s',path[_0x8517('0x14')](_0x4b9768[_0x8517('0x11')],path[_0x8517('0x15')](_0x4b9768[_0x8517('0x11')])),Date[_0x8517('0x16')](),path[_0x8517('0x15')](_0x4b9768[_0x8517('0x11')])));}})});router[_0x8517('0x17')]('/',upload[_0x8517('0x18')](_0x8517('0x19')),controller[_0x8517('0x1a')]);router[_0x8517('0x17')]('/webhook',controller[_0x8517('0x1b')]);router[_0x8517('0x1c')](_0x8517('0x1d'),auth[_0x8517('0xb')](),controller[_0x8517('0x1e')]);router[_0x8517('0x1f')](_0x8517('0x1d'),auth['isAuthenticated'](),controller[_0x8517('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 53560bd..2071bfd 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 _0x2678=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','ENUM','html','script','TEXT','STRING','BOOLEAN'];(function(_0x3fcc96,_0x214bf9){var _0x2357e0=function(_0x210534){while(--_0x210534){_0x3fcc96['push'](_0x3fcc96['shift']());}};_0x2357e0(++_0x214bf9);}(_0x2678,0x1a6));var _0x8267=function(_0x10a7f2,_0x24d4b8){_0x10a7f2=_0x10a7f2-0x0;var _0x25b668=_0x2678[_0x10a7f2];return _0x25b668;};'use strict';var Sequelize=require(_0x8267('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8267('0x1')](_0x8267('0x2'),_0x8267('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x8267('0x4')]},'path':{'type':Sequelize[_0x8267('0x5')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x8267('0x6')],'defaultValue':0x0,'comment':_0x8267('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x8267('0x8'),_0x8267('0x9'),'always',_0x8267('0xa')),'defaultValue':_0x8267('0xb'),'comment':_0x8267('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x8267('0x5')]},'agentUrl':{'type':Sequelize[_0x8267('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x8267('0x5')]}}; \ No newline at end of file +var _0xcfe4=['STRING','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script','TEXT'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0xcfe4,0x191));var _0x4cfe=function(_0x3aeae3,_0x363a84){_0x3aeae3=_0x3aeae3-0x0;var _0x22d7cd=_0xcfe4[_0x3aeae3];return _0x22d7cd;};'use strict';var Sequelize=require(_0x4cfe('0x0'));module[_0x4cfe('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4cfe('0x2')](_0x4cfe('0x3'),_0x4cfe('0x4'))},'description':{'type':Sequelize[_0x4cfe('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x4cfe('0x6')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4cfe('0x7')},'sidebar':{'type':Sequelize[_0x4cfe('0x2')](_0x4cfe('0x8'),'agentOnly',_0x4cfe('0x9'),'never'),'defaultValue':_0x4cfe('0x9'),'comment':_0x4cfe('0xa')},'icon':{'type':Sequelize[_0x4cfe('0x6')]},'adminUrl':{'type':Sequelize[_0x4cfe('0x6')]},'agentUrl':{'type':Sequelize[_0x4cfe('0x6')]},'scriptName':{'type':Sequelize[_0x4cfe('0x6')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5c4720a..5db4038 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 _0xa457=['VIRTUAL','name','options','includeAll','include','findAll','rows','show','find','catch','download','params','join','root','format','%s.zip','basename','zip','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','Error','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','admin','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','send','Extracted\x20folder\x20removed','update','webhookGet','port','http://localhost:','json','encoding','method','%s%s','headers','content-length','content-type','statusCode','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','Plugins','UserProfileResource','error','stack','index','map','Plugin','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge'];(function(_0x1be757,_0x381778){var _0x50ce0c=function(_0x5c692d){while(--_0x5c692d){_0x1be757['push'](_0x1be757['shift']());}};_0x50ce0c(++_0x381778);}(_0xa457,0x1af));var _0x7a45=function(_0x2d039b,_0x2978ec){_0x2d039b=_0x2d039b-0x0;var _0x440110=_0xa457[_0x2d039b];return _0x440110;};'use strict';var emlformat=require(_0x7a45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7a45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a45('0x2'));var BPromise=require(_0x7a45('0x3'));var Mustache=require(_0x7a45('0x4'));var util=require(_0x7a45('0x5'));var path=require(_0x7a45('0x6'));var sox=require(_0x7a45('0x7'));var csv=require('to-csv');var ejs=require(_0x7a45('0x8'));var fs=require('fs');var fs_extra=require(_0x7a45('0x9'));var _=require(_0x7a45('0xa'));var squel=require(_0x7a45('0xb'));var crypto=require('crypto');var jsforce=require(_0x7a45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7a45('0xd'));var querystring=require(_0x7a45('0xe'));var Papa=require(_0x7a45('0xf'));var extract=require(_0x7a45('0x10'));var rimraf=require(_0x7a45('0x11'));var archiver=require(_0x7a45('0x12'));var Redis=require(_0x7a45('0x13'));var authService=require(_0x7a45('0x14'));var qs=require(_0x7a45('0x15'));var as=require(_0x7a45('0x16'));var hardwareService=require(_0x7a45('0x17'));var logger=require(_0x7a45('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7a45('0x19'));var db=require(_0x7a45('0x1a'))['db'];config['redis']=_['defaults'](config[_0x7a45('0x1b')],{'host':_0x7a45('0x1c'),'port':0x18eb});var socket=require(_0x7a45('0x1d'))(new Redis(config[_0x7a45('0x1b')]));require(_0x7a45('0x1e'))[_0x7a45('0x1f')](socket);function respondWithStatusCode(_0x17735d,_0x563996){_0x563996=_0x563996||0xcc;return function(_0x1d72a3){if(_0x1d72a3){return _0x17735d[_0x7a45('0x20')](_0x563996);}return _0x17735d[_0x7a45('0x21')](_0x563996)[_0x7a45('0x22')]();};}function respondWithResult(_0x4cb8d1,_0x6a6746){_0x6a6746=_0x6a6746||0xc8;return function(_0x899a1d){if(_0x899a1d){return _0x4cb8d1[_0x7a45('0x21')](_0x6a6746)['json'](_0x899a1d);}};}function respondWithFilteredResult(_0x20b3a2,_0x4de121){return function(_0x33a7ba){if(_0x33a7ba){var _0x57dad7=typeof _0x4de121[_0x7a45('0x23')]===_0x7a45('0x24')&&typeof _0x4de121['limit']===_0x7a45('0x24');var _0x2dd234=_0x33a7ba[_0x7a45('0x25')];var _0x2eb544=_0x57dad7?0x0:_0x4de121[_0x7a45('0x23')];var _0x3d8730=_0x57dad7?_0x33a7ba[_0x7a45('0x25')]:_0x4de121[_0x7a45('0x23')]+_0x4de121[_0x7a45('0x26')];var _0x42accb;if(_0x3d8730>=_0x2dd234){_0x3d8730=_0x2dd234;_0x42accb=0xc8;}else{_0x42accb=0xce;}_0x20b3a2[_0x7a45('0x21')](_0x42accb);return _0x20b3a2[_0x7a45('0x27')](_0x7a45('0x28'),_0x2eb544+'-'+_0x3d8730+'/'+_0x2dd234)['json'](_0x33a7ba);}return null;};}function patchUpdates(_0x20e022){return function(_0x4ccfbe){try{jsonpatch[_0x7a45('0x29')](_0x4ccfbe,_0x20e022,!![]);}catch(_0xb0a0c5){return BPromise[_0x7a45('0x2a')](_0xb0a0c5);}return _0x4ccfbe['save']();};}function saveUpdates(_0x43847f,_0x71418e){return function(_0x4eebbc){if(_0x4eebbc){return _0x4eebbc['update'](_0x43847f)[_0x7a45('0x2b')](function(_0x52cf35){return _0x52cf35;});}return null;};}function removeEntity(_0x5861a0,_0x297d6f){return function(_0x5f1db5){if(_0x5f1db5){return _0x5f1db5[_0x7a45('0x2c')]()[_0x7a45('0x2b')](function(){var _0x3d6862=_0x5f1db5['get']({'plain':!![]});var _0x4d0815=_0x7a45('0x2d');return db[_0x7a45('0x2e')][_0x7a45('0x2c')]({'where':{'type':_0x4d0815,'resourceId':_0x3d6862['id']}})[_0x7a45('0x2b')](function(){return _0x5f1db5;});})[_0x7a45('0x2b')](function(){_0x5861a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee4f4,_0x2dc218){return function(_0x36f823){if(!_0x36f823){_0x1ee4f4[_0x7a45('0x20')](0x194);}return _0x36f823;};}function handleError(_0x52273e,_0x5ac4a6){_0x5ac4a6=_0x5ac4a6||0x1f4;return function(_0x248eae){logger[_0x7a45('0x2f')](_0x248eae[_0x7a45('0x30')]);if(_0x248eae['name']){delete _0x248eae['name'];}_0x52273e['status'](_0x5ac4a6)['send'](_0x248eae);};}exports[_0x7a45('0x31')]=function(_0x482cc4,_0x5830cd){var _0x53fb3e={},_0xe98274={},_0x53fa21={'count':0x0,'rows':[]};var _0x516f35=_[_0x7a45('0x32')](db[_0x7a45('0x33')][_0x7a45('0x34')],function(_0x190776){return{'name':_0x190776[_0x7a45('0x35')],'type':_0x190776[_0x7a45('0x36')][_0x7a45('0x37')]};});_0xe98274['model']=_[_0x7a45('0x32')](_0x516f35,'name');_0xe98274[_0x7a45('0x38')]=_['keys'](_0x482cc4[_0x7a45('0x38')]);_0xe98274[_0x7a45('0x39')]=_['intersection'](_0xe98274['model'],_0xe98274['query']);_0x53fb3e[_0x7a45('0x3a')]=_[_0x7a45('0x3b')](_0xe98274[_0x7a45('0x3c')],qs[_0x7a45('0x3d')](_0x482cc4[_0x7a45('0x38')][_0x7a45('0x3d')]));_0x53fb3e[_0x7a45('0x3a')]=_0x53fb3e['attributes'][_0x7a45('0x3e')]?_0x53fb3e[_0x7a45('0x3a')]:_0xe98274[_0x7a45('0x3c')];if(!_0x482cc4[_0x7a45('0x38')][_0x7a45('0x3f')](_0x7a45('0x40'))){_0x53fb3e[_0x7a45('0x26')]=qs[_0x7a45('0x26')](_0x482cc4[_0x7a45('0x38')][_0x7a45('0x26')]);_0x53fb3e['offset']=qs[_0x7a45('0x23')](_0x482cc4[_0x7a45('0x38')]['offset']);}_0x53fb3e[_0x7a45('0x41')]=qs[_0x7a45('0x42')](_0x482cc4[_0x7a45('0x38')]['sort']);_0x53fb3e['where']=qs[_0x7a45('0x39')](_['pick'](_0x482cc4[_0x7a45('0x38')],_0xe98274['filters']),_0x516f35);if(_0x482cc4[_0x7a45('0x38')][_0x7a45('0x43')]){_0x53fb3e[_0x7a45('0x44')]=_[_0x7a45('0x45')](_0x53fb3e[_0x7a45('0x44')],{'$or':_[_0x7a45('0x32')](_0x516f35,function(_0x3b3c8d){if(_0x3b3c8d[_0x7a45('0x36')]!==_0x7a45('0x46')){var _0x149257={};_0x149257[_0x3b3c8d[_0x7a45('0x47')]]={'$like':'%'+_0x482cc4[_0x7a45('0x38')][_0x7a45('0x43')]+'%'};return _0x149257;}})});}_0x53fb3e=_['merge']({},_0x53fb3e,_0x482cc4[_0x7a45('0x48')]);var _0x31c6be={'where':_0x53fb3e['where']};return db[_0x7a45('0x33')][_0x7a45('0x25')](_0x31c6be)[_0x7a45('0x2b')](function(_0xc3965d){_0x53fa21[_0x7a45('0x25')]=_0xc3965d;if(_0x482cc4[_0x7a45('0x38')][_0x7a45('0x49')]){_0x53fb3e[_0x7a45('0x4a')]=[{'all':!![]}];}return db[_0x7a45('0x33')][_0x7a45('0x4b')](_0x53fb3e);})[_0x7a45('0x2b')](function(_0x58d339){_0x53fa21[_0x7a45('0x4c')]=_0x58d339;return _0x53fa21;})['then'](respondWithFilteredResult(_0x5830cd,_0x53fb3e))['catch'](handleError(_0x5830cd,null));};exports[_0x7a45('0x4d')]=function(_0x4e814d,_0xed1079){var _0x3da5e8={'raw':!![],'where':{'id':_0x4e814d['params']['id']}},_0x491089={};_0x491089['model']=_['keys'](db[_0x7a45('0x33')][_0x7a45('0x34')]);_0x491089[_0x7a45('0x38')]=_['keys'](_0x4e814d['query']);_0x491089[_0x7a45('0x39')]=_[_0x7a45('0x3b')](_0x491089[_0x7a45('0x3c')],_0x491089['query']);_0x3da5e8[_0x7a45('0x3a')]=_['intersection'](_0x491089[_0x7a45('0x3c')],qs[_0x7a45('0x3d')](_0x4e814d['query']['fields']));_0x3da5e8[_0x7a45('0x3a')]=_0x3da5e8[_0x7a45('0x3a')][_0x7a45('0x3e')]?_0x3da5e8['attributes']:_0x491089[_0x7a45('0x3c')];if(_0x4e814d[_0x7a45('0x38')][_0x7a45('0x49')]){_0x3da5e8[_0x7a45('0x4a')]=[{'all':!![]}];}_0x3da5e8=_['merge']({},_0x3da5e8,_0x4e814d[_0x7a45('0x48')]);return db['Plugin'][_0x7a45('0x4e')](_0x3da5e8)[_0x7a45('0x2b')](handleEntityNotFound(_0xed1079,null))[_0x7a45('0x2b')](respondWithResult(_0xed1079,null))[_0x7a45('0x4f')](handleError(_0xed1079,null));};exports[_0x7a45('0x50')]=function(_0x29c29,_0x464741,_0x58acc7){return db[_0x7a45('0x33')][_0x7a45('0x4e')]({'where':{'id':_0x29c29[_0x7a45('0x51')]['id']},'attributes':[_0x7a45('0x47'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x464741,null))[_0x7a45('0x2b')](function(_0x1818a3){if(_0x1818a3){var _0x5c9df9=path[_0x7a45('0x52')](config[_0x7a45('0x53')],'server/files/plugins',util[_0x7a45('0x54')](_0x7a45('0x55'),path[_0x7a45('0x56')](_0x1818a3[_0x7a45('0x6')])));var _0x30e3cc=fs['createWriteStream'](_0x5c9df9);var _0x110231=archiver(_0x7a45('0x57'),{'zlib':{'level':0x9}});_0x110231['on']('warning',function(_0x51e285){if(_0x51e285['code']===_0x7a45('0x58')){logger[_0x7a45('0x2f')](_0x51e285);}else{throw new db[(_0x7a45('0x59'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x110231['on'](_0x7a45('0x2f'),function(_0xe58990){throw new db[(_0x7a45('0x59'))]['Error'](_0x7a45('0x5a'));});_0x110231[_0x7a45('0x5b')](_0x30e3cc);_0x110231[_0x7a45('0x5c')](_0x7a45('0x5d'),{'cwd':path[_0x7a45('0x52')](config[_0x7a45('0x53')],'server/files/plugins',path[_0x7a45('0x5e')](_0x1818a3[_0x7a45('0x6')])),'ignore':[path[_0x7a45('0x52')](path[_0x7a45('0x56')](_0x1818a3[_0x7a45('0x6')]),_0x7a45('0x5f')),path[_0x7a45('0x52')](path['basename'](_0x1818a3[_0x7a45('0x6')]),_0x7a45('0x60'))],'nodir':!![]})['finalize']();_0x30e3cc['on']('close',function(){if(!fs['existsSync'](_0x5c9df9)){throw new db[(_0x7a45('0x59'))]['Error']('Plugin\x20not\x20found');}return _0x464741[_0x7a45('0x50')](_0x5c9df9,util['format'](_0x7a45('0x55'),path['basename'](_0x1818a3[_0x7a45('0x6')])),function(_0x5e963f){if(_0x5e963f){throw new db[(_0x7a45('0x59'))][(_0x7a45('0x61'))](_0x7a45('0x62'));}fs[_0x7a45('0x63')](_0x5c9df9);logger[_0x7a45('0x64')](_0x7a45('0x65'));logger[_0x7a45('0x64')](_0x7a45('0x66'));});});}return null;})[_0x7a45('0x4f')](handleError(_0x464741,null));};exports[_0x7a45('0x67')]=function(_0x350744,_0x274b38,_0x55049e){var _0x5f64db=path[_0x7a45('0x56')](_0x350744['file'][_0x7a45('0x68')],path[_0x7a45('0x69')](_0x350744[_0x7a45('0x6a')][_0x7a45('0x68')]));var _0x2507e7=path['join'](config[_0x7a45('0x53')],_0x7a45('0x6b'),_0x350744[_0x7a45('0x6a')][_0x7a45('0x68')]);var _0x583fd1=path[_0x7a45('0x52')](config[_0x7a45('0x53')],'server/files/plugins',_0x5f64db);logger[_0x7a45('0x64')](_0x7a45('0x6c'),_0x2507e7);logger[_0x7a45('0x64')](_0x7a45('0x6d'),_0x583fd1);try{fs[_0x7a45('0x6e')](_0x2507e7,parseInt('0777',0x8));extract(_0x2507e7,{'dir':_0x583fd1},function(_0x2dd46b){if(_0x2dd46b){logger['error'](_0x2dd46b);handleError(_0x2dd46b,!![]);};var _0x3969b4=fs[_0x7a45('0x6f')](_0x583fd1);if(_0x3969b4[_0x7a45('0x3e')]>0x1){removeReferences(_0x2507e7,_0x583fd1);logger[_0x7a45('0x2f')](_0x7a45('0x70'));return _0x55049e(new Error(_0x7a45('0x70')));}var _0x4587f4=fs[_0x7a45('0x71')](path[_0x7a45('0x52')](_0x583fd1,_0x3969b4[0x0]));if(_0x4587f4[_0x7a45('0x72')]()){removeReferences(_0x2507e7,_0x583fd1);logger[_0x7a45('0x2f')](_0x7a45('0x70'));return _0x55049e(new Error('Invalid\x20plugin\x20structure'));}if(_0x4587f4['isDirectory']()){var _0x4a2f04=fs[_0x7a45('0x6f')](path[_0x7a45('0x52')](_0x583fd1,_0x3969b4[0x0]));if(_0x4a2f04[_0x7a45('0x3e')]===0x0){removeReferences(_0x2507e7,_0x583fd1);logger['error'](_0x7a45('0x70'));return _0x55049e(new Error('Invalid\x20plugin\x20structure'));}var _0x16b3b1=_0x4a2f04['some'](function(_0x49a67f){return _0x49a67f===_0x7a45('0x73');});if(!_0x16b3b1){return _0x55049e(new Error(_0x7a45('0x74')));}var _0x588389=fs[_0x7a45('0x75')](path[_0x7a45('0x52')](_0x583fd1,_0x3969b4[0x0],'manifest.json'));var _0x58bcff=JSON['parse'](_0x588389);if(_0x7a45('0x24')==typeof _0x58bcff[_0x7a45('0x47')]){return _0x55049e(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x7a45('0x24')==typeof _0x58bcff['type']){return _0x55049e(new Error(_0x7a45('0x76')));}if(_0x7a45('0x24')==typeof _0x58bcff[_0x7a45('0x77')]){return _0x55049e(new Error(_0x7a45('0x78')));}if(_0x7a45('0x24')==typeof _0x58bcff[_0x7a45('0x79')]){return _0x55049e(new Error(_0x7a45('0x7a')));}if(_0x58bcff[_0x7a45('0x36')]==='html'){if(_0x7a45('0x24')==typeof _0x58bcff[_0x7a45('0x79')]['views']){return _0x55049e(new Error(_0x7a45('0x7b')));}if('undefined'==typeof _0x58bcff[_0x7a45('0x79')]['views'][_0x7a45('0x7c')]&&_0x7a45('0x24')==typeof _0x58bcff[_0x7a45('0x79')][_0x7a45('0x7d')][_0x7a45('0x7e')]){return _0x55049e(new Error(_0x7a45('0x7f')));}}else if(_0x58bcff['type']===_0x7a45('0x80')){if(_0x7a45('0x24')==typeof _0x58bcff[_0x7a45('0x79')][_0x7a45('0x81')]){return _0x55049e(new Error(_0x7a45('0x82')));}if(_0x7a45('0x24')==typeof _0x58bcff[_0x7a45('0x79')][_0x7a45('0x83')]){return _0x55049e(new Error(_0x7a45('0x84')));}}else{return _0x55049e(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x48fadd=_0x58bcff[_0x7a45('0x47')];var _0x5673f3=_0x58bcff[_0x7a45('0x85')];var _0x43cc7b=_0x58bcff['type'];var _0x2ece92=_0x58bcff[_0x7a45('0x86')]?_0x58bcff['sidebar']:'always';var _0x13a79c=_0x58bcff[_0x7a45('0x87')]?_0x58bcff['icon']:_0x7a45('0x88');var _0x37efa1='';var _0x9bef='';var _0x203f99='';var _0x1f3f74='';var _0x16ebe6=_0x58bcff[_0x7a45('0x77')];if(_0x43cc7b===_0x7a45('0x89')){if('undefined'!=typeof _0x58bcff['parameters']['views']['admin']){var _0x10166b=_0x58bcff[_0x7a45('0x79')][_0x7a45('0x7d')][_0x7a45('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x10166b)){_0x37efa1=path[_0x7a45('0x52')](_0x7a45('0x8a'),_0x5f64db,_0x3969b4[0x0],_0x10166b);}else{_0x37efa1=_0x10166b;}}else{logger[_0x7a45('0x64')](_0x7a45('0x8b'));}if(_0x7a45('0x24')!=typeof _0x58bcff[_0x7a45('0x79')]['views'][_0x7a45('0x7e')]){var _0xdf8a50=_0x58bcff['parameters'][_0x7a45('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7a45('0x8c')](_0xdf8a50)){_0x9bef=path['join'](_0x7a45('0x8a'),_0x5f64db,_0x3969b4[0x0],_0xdf8a50);}else{_0x9bef=_0xdf8a50;}}else{logger[_0x7a45('0x64')](_0x7a45('0x8d'));}}else if(_0x43cc7b==='script'){_0x203f99=_0x58bcff[_0x7a45('0x79')]['scriptName'];_0x1f3f74=_0x58bcff[_0x7a45('0x79')][_0x7a45('0x83')];if(_0x7a45('0x24')!=typeof _0x58bcff['parameters'][_0x7a45('0x7d')]){if('undefined'!=typeof _0x58bcff[_0x7a45('0x79')][_0x7a45('0x7d')][_0x7a45('0x7c')]){var _0x10166b=_0x58bcff[_0x7a45('0x79')][_0x7a45('0x7d')][_0x7a45('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x7a45('0x8c')](_0x10166b)){_0x37efa1=path[_0x7a45('0x52')](_0x7a45('0x8a'),_0x5f64db,_0x3969b4[0x0],_0x10166b);}else{_0x37efa1=_0x10166b;}}if(_0x7a45('0x24')!=typeof _0x58bcff[_0x7a45('0x79')][_0x7a45('0x7d')][_0x7a45('0x7e')]){var _0xdf8a50=_0x58bcff[_0x7a45('0x79')][_0x7a45('0x7d')][_0x7a45('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x7a45('0x8c')](_0xdf8a50)){_0x9bef=path[_0x7a45('0x52')]('plugins',_0x5f64db,_0x3969b4[0x0],_0xdf8a50);}else{_0x9bef=_0xdf8a50;}}}}var _0x93dee5={'name':_0x48fadd,'description':_0x5673f3,'path':path['join'](_0x5f64db,_0x3969b4[0x0]),'type':_0x43cc7b,'sidebar':_0x2ece92,'icon':_0x13a79c,'adminUrl':_0x37efa1,'agentUrl':_0x9bef,'scriptName':_0x203f99,'scriptPath':_0x1f3f74,'version':_0x16ebe6};removeReferences(_0x2507e7,null);return db['Plugin'][_0x7a45('0x8e')](_0x93dee5)[_0x7a45('0x2b')](function(_0x487a73){var _0x236125={'role':_0x350744[_0x7a45('0x8f')][_0x7a45('0x90')],'userProfileId':_0x350744[_0x7a45('0x8f')][_0x7a45('0x91')]};if(!_0x236125)throw new Error(_0x7a45('0x92'));if(_0x236125[_0x7a45('0x90')]===_0x7a45('0x93')){var _0x5d59f0=_0x487a73[_0x7a45('0x94')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x7a45('0x2d'),'userProfileId':_0x236125[_0x7a45('0x91')]},'raw':!![]})['then'](function(_0x30857d){if(_0x30857d&&_0x30857d['autoAssociation']===0x0){return db['UserProfileResource'][_0x7a45('0x8e')]({'name':_0x5d59f0['name'],'resourceId':_0x5d59f0['id'],'type':_0x30857d[_0x7a45('0x47')],'sectionId':_0x30857d['id']},{})['then'](function(){return _0x487a73;});}else{return _0x487a73;}})[_0x7a45('0x4f')](function(_0x159bbd){logger[_0x7a45('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x159bbd);throw _0x159bbd;});}return _0x487a73;})[_0x7a45('0x2b')](respondWithResult(_0x274b38,null))[_0x7a45('0x4f')](handleError(_0x274b38,null));}});}catch(_0x18bb8b){_0x274b38[_0x7a45('0x21')](0x1f4)[_0x7a45('0x95')](_0x18bb8b);}};function removeReferences(_0x1a32af,_0x1faba8){try{if(_0x1a32af){fs[_0x7a45('0x63')](_0x1a32af);logger[_0x7a45('0x64')]('Zip\x20archive\x20removed');}if(_0x1faba8){rimraf(_0x1faba8,function(){});logger['info'](_0x7a45('0x96'));}}catch(_0x8290b1){logger[_0x7a45('0x2f')](_0x8290b1);}}exports[_0x7a45('0x97')]=function(_0x5147f4,_0x35418e,_0xd7d5d4){return db[_0x7a45('0x33')][_0x7a45('0x4e')]({'where':{'id':_0x5147f4['params']['id']}})[_0x7a45('0x2b')](handleEntityNotFound(_0x35418e,null))[_0x7a45('0x2b')](saveUpdates(_0x5147f4['body'],null))[_0x7a45('0x2b')](respondWithResult(_0x35418e,null))['catch'](handleError(_0x35418e,null));};exports['delete']=function(_0x4a22c2,_0x22ff91,_0x27c5d6){return db[_0x7a45('0x33')][_0x7a45('0x4e')]({'where':{'id':_0x4a22c2[_0x7a45('0x51')]['id']}})[_0x7a45('0x2b')](function(_0x4e83f4){if(_0x4e83f4){return _0x4e83f4[_0x7a45('0x2c')]();}})[_0x7a45('0x2b')](function(_0x16f1ac){rimraf(path[_0x7a45('0x52')](config[_0x7a45('0x53')],_0x7a45('0x6b'),path[_0x7a45('0x5e')](_0x16f1ac['path'])),function(){});return _0x16f1ac;})['then'](handleEntityNotFound(_0x22ff91,null))[_0x7a45('0x2b')](respondWithStatusCode(_0x22ff91,null))['catch'](handleError(_0x22ff91,null));};exports[_0x7a45('0x98')]=function(_0x37fde4,_0x24916f,_0x21918e){return BPromise['resolve']()['then'](function(){if(!_0x37fde4[_0x7a45('0x38')][_0x7a45('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x37fde4['query'][_0x7a45('0x99')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5500c6=_0x37fde4[_0x7a45('0x38')]['hostname']?_0x37fde4[_0x7a45('0x38')]['hostname']+':'+_0x37fde4['query'][_0x7a45('0x99')]:_0x7a45('0x9a')+_0x37fde4['query'][_0x7a45('0x99')];var _0x14fd1d=_0x37fde4[_0x7a45('0x38')][_0x7a45('0x9b')]?_0x37fde4[_0x7a45('0x38')][_0x7a45('0x9b')]:!![];var _0x59dcd3=_0x37fde4[_0x7a45('0x38')]['encoding']?_0x37fde4[_0x7a45('0x38')][_0x7a45('0x9c')]:null;var _0x17f948={'method':_0x37fde4[_0x7a45('0x9d')],'uri':util[_0x7a45('0x54')](_0x7a45('0x9e'),_0x5500c6,_0x37fde4['query'][_0x7a45('0x6')]),'json':_0x14fd1d,'resolveWithFullResponse':!![],'encoding':_0x59dcd3,'qs':_0x37fde4['query']};if(_0x37fde4['headers']){_0x17f948[_0x7a45('0x9f')]=_0x37fde4[_0x7a45('0x9f')];if(_0x17f948[_0x7a45('0x9f')][_0x7a45('0xa0')]){delete _0x17f948[_0x7a45('0x9f')]['content-length'];}}if(_0x17f948['headers'][_0x7a45('0xa1')]){delete _0x17f948['headers'][_0x7a45('0xa1')];}return rp(_0x17f948);})['then'](function(_0x2c81b5){if(_0x2c81b5){_0x24916f[_0x7a45('0x27')](_0x2c81b5[_0x7a45('0x9f')]);logger[_0x7a45('0x64')](_0x2c81b5['body']);if(_['endsWith'](_0x37fde4[_0x7a45('0x38')][_0x7a45('0x6')],_0x7a45('0x50'))&&_0x2c81b5[_0x7a45('0xa2')]==0x1f4){return _0x24916f['sendStatus'](_0x2c81b5[_0x7a45('0xa2')]);}else{return _0x24916f[_0x7a45('0x21')](_0x2c81b5[_0x7a45('0xa2')])[_0x7a45('0x95')](_0x2c81b5[_0x7a45('0x8f')]);}}else{return _0x24916f[_0x7a45('0x20')](0xc8);}})['catch'](handleError(_0x24916f,null));};exports['webhookPost']=function(_0x3ad7ca,_0x20e8ef,_0x304b45){return BPromise[_0x7a45('0xa3')]()[_0x7a45('0x2b')](function(){if(!_0x3ad7ca[_0x7a45('0x38')]['path']){throw new Error(_0x7a45('0xa4'));}if(!_0x3ad7ca[_0x7a45('0x38')][_0x7a45('0x99')]){throw new Error(_0x7a45('0xa5'));}var _0x26f4be=_0x3ad7ca[_0x7a45('0x38')]['hostname']?_0x3ad7ca[_0x7a45('0x38')][_0x7a45('0xa6')]+':'+_0x3ad7ca[_0x7a45('0x38')][_0x7a45('0x99')]:_0x7a45('0x9a')+_0x3ad7ca[_0x7a45('0x38')][_0x7a45('0x99')];var _0x1ee46e=_0x3ad7ca[_0x7a45('0x38')][_0x7a45('0x9b')]?_0x3ad7ca[_0x7a45('0x38')][_0x7a45('0x9b')]:!![];var _0x298ef2=_0x3ad7ca['query'][_0x7a45('0x9c')]?_0x3ad7ca['query'][_0x7a45('0x9c')]:null;var _0x454b50={'method':_0x3ad7ca['method'],'uri':util[_0x7a45('0x54')](_0x7a45('0x9e'),_0x26f4be,_0x3ad7ca[_0x7a45('0x38')][_0x7a45('0x6')]),'json':_0x1ee46e,'resolveWithFullResponse':!![],'encoding':_0x298ef2,'body':_0x3ad7ca['body']};if(_0x3ad7ca[_0x7a45('0x9f')]){_0x454b50['headers']=_0x3ad7ca[_0x7a45('0x9f')];if(_0x454b50[_0x7a45('0x9f')][_0x7a45('0xa0')]){delete _0x454b50[_0x7a45('0x9f')][_0x7a45('0xa0')];}}if(_0x454b50[_0x7a45('0x9f')]['content-type']){delete _0x454b50[_0x7a45('0x9f')]['content-type'];}return rp(_0x454b50);})[_0x7a45('0x2b')](function(_0x3a128c){if(_0x3a128c){_0x20e8ef['set'](_0x3a128c[_0x7a45('0x9f')]);logger[_0x7a45('0x64')](_0x3a128c[_0x7a45('0x8f')]);return _0x20e8ef[_0x7a45('0x21')](_0x3a128c[_0x7a45('0xa2')])['send'](_0x3a128c[_0x7a45('0x8f')]);}else{return _0x20e8ef[_0x7a45('0x20')](0xc8);}})[_0x7a45('0x4f')](handleError(_0x20e8ef,null));}; \ No newline at end of file +var _0x69b2=['options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','join','root','%s.zip','basename','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','html','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','scriptPath','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','update','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','body','endsWith','statusCode','content-length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./plugin.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','Plugins','UserProfileResource','error','stack','name','send','map','Plugin','fieldName','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x2055ea,_0x47351e){var _0x353184=function(_0x5eda62){while(--_0x5eda62){_0x2055ea['push'](_0x2055ea['shift']());}};_0x353184(++_0x47351e);}(_0x69b2,0x10c));var _0x269b=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x69b2[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require(_0x269b('0x0'));var rimraf=require(_0x269b('0x1'));var zipdir=require(_0x269b('0x2'));var jsonpatch=require(_0x269b('0x3'));var rp=require(_0x269b('0x4'));var moment=require(_0x269b('0x5'));var BPromise=require(_0x269b('0x6'));var Mustache=require(_0x269b('0x7'));var util=require(_0x269b('0x8'));var path=require(_0x269b('0x9'));var sox=require('sox');var csv=require(_0x269b('0xa'));var ejs=require(_0x269b('0xb'));var fs=require('fs');var fs_extra=require(_0x269b('0xc'));var _=require('lodash');var squel=require(_0x269b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x269b('0xe'));var toCsv=require(_0x269b('0xa'));var querystring=require(_0x269b('0xf'));var Papa=require(_0x269b('0x10'));var extract=require(_0x269b('0x11'));var rimraf=require(_0x269b('0x1'));var archiver=require(_0x269b('0x12'));var Redis=require('ioredis');var authService=require(_0x269b('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x269b('0x14'))(_0x269b('0x15'));var utils=require('../../config/utils');var config=require(_0x269b('0x16'));var licenseUtil=require(_0x269b('0x17'));var db=require(_0x269b('0x18'))['db'];config['redis']=_[_0x269b('0x19')](config[_0x269b('0x1a')],{'host':_0x269b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x269b('0x1a')]));require(_0x269b('0x1c'))['register'](socket);function respondWithStatusCode(_0x4c9a01,_0x2eb16c){_0x2eb16c=_0x2eb16c||0xcc;return function(_0x37eab7){if(_0x37eab7){return _0x4c9a01[_0x269b('0x1d')](_0x2eb16c);}return _0x4c9a01[_0x269b('0x1e')](_0x2eb16c)[_0x269b('0x1f')]();};}function respondWithResult(_0x3483d2,_0x5d3a91){_0x5d3a91=_0x5d3a91||0xc8;return function(_0x3e1882){if(_0x3e1882){return _0x3483d2['status'](_0x5d3a91)[_0x269b('0x20')](_0x3e1882);}};}function respondWithFilteredResult(_0x5563a3,_0x392bc4){return function(_0x4f34bb){if(_0x4f34bb){var _0x594630=typeof _0x392bc4[_0x269b('0x21')]===_0x269b('0x22')&&typeof _0x392bc4['limit']===_0x269b('0x22');var _0x341e92=_0x4f34bb[_0x269b('0x23')];var _0x18ae68=_0x594630?0x0:_0x392bc4['offset'];var _0x121c63=_0x594630?_0x4f34bb[_0x269b('0x23')]:_0x392bc4[_0x269b('0x21')]+_0x392bc4[_0x269b('0x24')];var _0x14368a;if(_0x121c63>=_0x341e92){_0x121c63=_0x341e92;_0x14368a=0xc8;}else{_0x14368a=0xce;}_0x5563a3[_0x269b('0x1e')](_0x14368a);return _0x5563a3[_0x269b('0x25')](_0x269b('0x26'),_0x18ae68+'-'+_0x121c63+'/'+_0x341e92)[_0x269b('0x20')](_0x4f34bb);}return null;};}function patchUpdates(_0x23b97f){return function(_0x509e78){try{jsonpatch['apply'](_0x509e78,_0x23b97f,!![]);}catch(_0x40b4b2){return BPromise[_0x269b('0x27')](_0x40b4b2);}return _0x509e78[_0x269b('0x28')]();};}function saveUpdates(_0x566ec2,_0x5a76eb){return function(_0x265ca7){if(_0x265ca7){return _0x265ca7['update'](_0x566ec2)[_0x269b('0x29')](function(_0x75919d){return _0x75919d;});}return null;};}function removeEntity(_0x1f60a9,_0x4c22ba){return function(_0xe2dd89){if(_0xe2dd89){return _0xe2dd89[_0x269b('0x2a')]()[_0x269b('0x29')](function(){var _0x31fd88=_0xe2dd89['get']({'plain':!![]});var _0x3c9773=_0x269b('0x2b');return db[_0x269b('0x2c')]['destroy']({'where':{'type':_0x3c9773,'resourceId':_0x31fd88['id']}})['then'](function(){return _0xe2dd89;});})['then'](function(){_0x1f60a9[_0x269b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x182583,_0x3c9357){return function(_0x56db5c){if(!_0x56db5c){_0x182583[_0x269b('0x1d')](0x194);}return _0x56db5c;};}function handleError(_0x3e6b47,_0x2df1a8){_0x2df1a8=_0x2df1a8||0x1f4;return function(_0x8259ae){logger[_0x269b('0x2d')](_0x8259ae[_0x269b('0x2e')]);if(_0x8259ae[_0x269b('0x2f')]){delete _0x8259ae[_0x269b('0x2f')];}_0x3e6b47['status'](_0x2df1a8)[_0x269b('0x30')](_0x8259ae);};}exports['index']=function(_0x3f2ee9,_0x49257c){var _0x754b71={},_0x183c5f={},_0x2ccecd={'count':0x0,'rows':[]};var _0x5cfbaf=_[_0x269b('0x31')](db[_0x269b('0x32')]['rawAttributes'],function(_0x552d22){return{'name':_0x552d22[_0x269b('0x33')],'type':_0x552d22['type'][_0x269b('0x34')]};});_0x183c5f[_0x269b('0x35')]=_['map'](_0x5cfbaf,_0x269b('0x2f'));_0x183c5f[_0x269b('0x36')]=_[_0x269b('0x37')](_0x3f2ee9[_0x269b('0x36')]);_0x183c5f[_0x269b('0x38')]=_[_0x269b('0x39')](_0x183c5f['model'],_0x183c5f[_0x269b('0x36')]);_0x754b71['attributes']=_[_0x269b('0x39')](_0x183c5f['model'],qs[_0x269b('0x3a')](_0x3f2ee9[_0x269b('0x36')][_0x269b('0x3a')]));_0x754b71['attributes']=_0x754b71['attributes']['length']?_0x754b71[_0x269b('0x3b')]:_0x183c5f[_0x269b('0x35')];if(!_0x3f2ee9[_0x269b('0x36')]['hasOwnProperty']('nolimit')){_0x754b71['limit']=qs[_0x269b('0x24')](_0x3f2ee9[_0x269b('0x36')]['limit']);_0x754b71[_0x269b('0x21')]=qs[_0x269b('0x21')](_0x3f2ee9[_0x269b('0x36')]['offset']);}_0x754b71[_0x269b('0x3c')]=qs[_0x269b('0x3d')](_0x3f2ee9[_0x269b('0x36')]['sort']);_0x754b71[_0x269b('0x3e')]=qs[_0x269b('0x38')](_[_0x269b('0x3f')](_0x3f2ee9[_0x269b('0x36')],_0x183c5f[_0x269b('0x38')]),_0x5cfbaf);if(_0x3f2ee9[_0x269b('0x36')][_0x269b('0x40')]){_0x754b71[_0x269b('0x3e')]=_[_0x269b('0x41')](_0x754b71[_0x269b('0x3e')],{'$or':_[_0x269b('0x31')](_0x5cfbaf,function(_0x138ffe){if(_0x138ffe[_0x269b('0x42')]!==_0x269b('0x43')){var _0xa4bce9={};_0xa4bce9[_0x138ffe[_0x269b('0x2f')]]={'$like':'%'+_0x3f2ee9[_0x269b('0x36')][_0x269b('0x40')]+'%'};return _0xa4bce9;}})});}_0x754b71=_[_0x269b('0x41')]({},_0x754b71,_0x3f2ee9[_0x269b('0x44')]);var _0xbc7e0e={'where':_0x754b71['where']};return db['Plugin'][_0x269b('0x23')](_0xbc7e0e)[_0x269b('0x29')](function(_0xd7ad0c){_0x2ccecd[_0x269b('0x23')]=_0xd7ad0c;if(_0x3f2ee9[_0x269b('0x36')][_0x269b('0x45')]){_0x754b71[_0x269b('0x46')]=[{'all':!![]}];}return db[_0x269b('0x32')][_0x269b('0x47')](_0x754b71);})[_0x269b('0x29')](function(_0x2a3313){_0x2ccecd[_0x269b('0x48')]=_0x2a3313;return _0x2ccecd;})[_0x269b('0x29')](respondWithFilteredResult(_0x49257c,_0x754b71))[_0x269b('0x49')](handleError(_0x49257c,null));};exports['show']=function(_0x2dbd1a,_0x308a72){var _0x219b5f={'raw':!![],'where':{'id':_0x2dbd1a[_0x269b('0x4a')]['id']}},_0x16c7f1={};_0x16c7f1[_0x269b('0x35')]=_['keys'](db[_0x269b('0x32')][_0x269b('0x4b')]);_0x16c7f1[_0x269b('0x36')]=_[_0x269b('0x37')](_0x2dbd1a[_0x269b('0x36')]);_0x16c7f1[_0x269b('0x38')]=_[_0x269b('0x39')](_0x16c7f1[_0x269b('0x35')],_0x16c7f1[_0x269b('0x36')]);_0x219b5f[_0x269b('0x3b')]=_['intersection'](_0x16c7f1[_0x269b('0x35')],qs[_0x269b('0x3a')](_0x2dbd1a[_0x269b('0x36')]['fields']));_0x219b5f['attributes']=_0x219b5f[_0x269b('0x3b')][_0x269b('0x4c')]?_0x219b5f[_0x269b('0x3b')]:_0x16c7f1[_0x269b('0x35')];if(_0x2dbd1a['query'][_0x269b('0x45')]){_0x219b5f['include']=[{'all':!![]}];}_0x219b5f=_[_0x269b('0x41')]({},_0x219b5f,_0x2dbd1a['options']);return db[_0x269b('0x32')][_0x269b('0x4d')](_0x219b5f)[_0x269b('0x29')](handleEntityNotFound(_0x308a72,null))[_0x269b('0x29')](respondWithResult(_0x308a72,null))['catch'](handleError(_0x308a72,null));};exports['download']=function(_0x2ee556,_0x7515db,_0x2d3af6){return db[_0x269b('0x32')][_0x269b('0x4d')]({'where':{'id':_0x2ee556['params']['id']},'attributes':[_0x269b('0x2f'),_0x269b('0x9')],'raw':!![]})[_0x269b('0x29')](handleEntityNotFound(_0x7515db,null))[_0x269b('0x29')](function(_0xc5f582){if(_0xc5f582){var _0x46faff=path[_0x269b('0x4e')](config[_0x269b('0x4f')],'server/files/plugins',util['format'](_0x269b('0x50'),path[_0x269b('0x51')](_0xc5f582[_0x269b('0x9')])));var _0xea9314=fs['createWriteStream'](_0x46faff);var _0x55801f=archiver('zip',{'zlib':{'level':0x9}});_0x55801f['on']('warning',function(_0xa7effc){if(_0xa7effc[_0x269b('0x52')]===_0x269b('0x53')){logger['error'](_0xa7effc);}else{throw new db[(_0x269b('0x54'))][(_0x269b('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x55801f['on']('error',function(_0x2f6c4b){throw new db[(_0x269b('0x54'))]['Error'](_0x269b('0x56'));});_0x55801f[_0x269b('0x57')](_0xea9314);_0x55801f[_0x269b('0x58')](_0x269b('0x59'),{'cwd':path[_0x269b('0x4e')](config[_0x269b('0x4f')],_0x269b('0x5a'),path[_0x269b('0x5b')](_0xc5f582[_0x269b('0x9')])),'ignore':[path[_0x269b('0x4e')](path[_0x269b('0x51')](_0xc5f582['path']),_0x269b('0x5c')),path[_0x269b('0x4e')](path['basename'](_0xc5f582[_0x269b('0x9')]),_0x269b('0x5d'))],'nodir':!![]})[_0x269b('0x5e')]();_0xea9314['on']('close',function(){if(!fs[_0x269b('0x5f')](_0x46faff)){throw new db[(_0x269b('0x54'))][(_0x269b('0x55'))](_0x269b('0x60'));}return _0x7515db[_0x269b('0x61')](_0x46faff,util[_0x269b('0x62')](_0x269b('0x50'),path[_0x269b('0x51')](_0xc5f582[_0x269b('0x9')])),function(_0x19cd82){if(_0x19cd82){throw new db['Sequelize'][(_0x269b('0x55'))](_0x269b('0x63'));}fs['unlinkSync'](_0x46faff);logger[_0x269b('0x64')](_0x269b('0x65'));logger[_0x269b('0x64')]('Temporary\x20file\x20removed');});});}return null;})[_0x269b('0x49')](handleError(_0x7515db,null));};exports[_0x269b('0x66')]=function(_0x456d37,_0x46efd2,_0x4dc507){var _0x476cf8=path[_0x269b('0x51')](_0x456d37[_0x269b('0x67')][_0x269b('0x68')],path['extname'](_0x456d37[_0x269b('0x67')][_0x269b('0x68')]));var _0x5e246a=path[_0x269b('0x4e')](config[_0x269b('0x4f')],'server/files/plugins',_0x456d37[_0x269b('0x67')][_0x269b('0x68')]);var _0x436d37=path[_0x269b('0x4e')](config['root'],_0x269b('0x5a'),_0x476cf8);logger[_0x269b('0x64')]('Plugin\x20upload\x20filepath:\x20%s',_0x5e246a);logger[_0x269b('0x64')](_0x269b('0x69'),_0x436d37);try{fs[_0x269b('0x6a')](_0x5e246a,parseInt(_0x269b('0x6b'),0x8));extract(_0x5e246a,{'dir':_0x436d37},function(_0x58ce88){if(_0x58ce88){logger[_0x269b('0x2d')](_0x58ce88);handleError(_0x58ce88,!![]);};var _0x2e782e=fs[_0x269b('0x6c')](_0x436d37);if(_0x2e782e[_0x269b('0x4c')]>0x1){removeReferences(_0x5e246a,_0x436d37);logger['error']('Invalid\x20plugin\x20structure');return _0x4dc507(new Error(_0x269b('0x6d')));}var _0x5b615e=fs[_0x269b('0x6e')](path['join'](_0x436d37,_0x2e782e[0x0]));if(_0x5b615e[_0x269b('0x6f')]()){removeReferences(_0x5e246a,_0x436d37);logger[_0x269b('0x2d')](_0x269b('0x6d'));return _0x4dc507(new Error(_0x269b('0x6d')));}if(_0x5b615e['isDirectory']()){var _0x3bef36=fs['readdirSync'](path[_0x269b('0x4e')](_0x436d37,_0x2e782e[0x0]));if(_0x3bef36[_0x269b('0x4c')]===0x0){removeReferences(_0x5e246a,_0x436d37);logger[_0x269b('0x2d')]('Invalid\x20plugin\x20structure');return _0x4dc507(new Error('Invalid\x20plugin\x20structure'));}var _0x1372b4=_0x3bef36[_0x269b('0x70')](function(_0x16a13f){return _0x16a13f===_0x269b('0x71');});if(!_0x1372b4){return _0x4dc507(new Error(_0x269b('0x72')));}var _0xe67f68=fs[_0x269b('0x73')](path[_0x269b('0x4e')](_0x436d37,_0x2e782e[0x0],_0x269b('0x71')));var _0x9dfc7a=JSON[_0x269b('0x74')](_0xe67f68);if(_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x2f')]){return _0x4dc507(new Error(_0x269b('0x75')));}if('undefined'==typeof _0x9dfc7a[_0x269b('0x42')]){return _0x4dc507(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x76')]){return _0x4dc507(new Error(_0x269b('0x77')));}if(_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x78')]){return _0x4dc507(new Error(_0x269b('0x79')));}if(_0x9dfc7a[_0x269b('0x42')]==='html'){if(_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x78')][_0x269b('0x7a')]){return _0x4dc507(new Error(_0x269b('0x7b')));}if(_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x78')]['views'][_0x269b('0x7c')]&&_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x78')]['views']['agent']){return _0x4dc507(new Error(_0x269b('0x7d')));}}else if(_0x9dfc7a['type']===_0x269b('0x7e')){if(_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x78')][_0x269b('0x7f')]){return _0x4dc507(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x269b('0x22')==typeof _0x9dfc7a[_0x269b('0x78')]['scriptPath']){return _0x4dc507(new Error(_0x269b('0x80')));}}else{return _0x4dc507(new Error(_0x269b('0x81')));}var _0x53c267=_0x9dfc7a[_0x269b('0x2f')];var _0x5bf22f=_0x9dfc7a[_0x269b('0x82')];var _0x21a920=_0x9dfc7a['type'];var _0x5ab575=_0x9dfc7a[_0x269b('0x83')]?_0x9dfc7a[_0x269b('0x83')]:'always';var _0x4836e7=_0x9dfc7a[_0x269b('0x84')]?_0x9dfc7a[_0x269b('0x84')]:_0x269b('0x85');var _0x1ddc81='';var _0x19f149='';var _0x51b637='';var _0x18a201='';var _0x54835c=_0x9dfc7a[_0x269b('0x76')];if(_0x21a920===_0x269b('0x86')){if(_0x269b('0x22')!=typeof _0x9dfc7a[_0x269b('0x78')][_0x269b('0x7a')][_0x269b('0x7c')]){var _0x438f73=_0x9dfc7a['parameters'][_0x269b('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x269b('0x87')](_0x438f73)){_0x1ddc81=path[_0x269b('0x4e')]('plugins',_0x476cf8,_0x2e782e[0x0],_0x438f73);}else{_0x1ddc81=_0x438f73;}}else{logger[_0x269b('0x64')](_0x269b('0x88'));}if(_0x269b('0x22')!=typeof _0x9dfc7a[_0x269b('0x78')][_0x269b('0x7a')][_0x269b('0x89')]){var _0x1d87ba=_0x9dfc7a['parameters'][_0x269b('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1d87ba)){_0x19f149=path['join'](_0x269b('0x8a'),_0x476cf8,_0x2e782e[0x0],_0x1d87ba);}else{_0x19f149=_0x1d87ba;}}else{logger[_0x269b('0x64')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x21a920==='script'){_0x51b637=_0x9dfc7a[_0x269b('0x78')][_0x269b('0x7f')];_0x18a201=_0x9dfc7a[_0x269b('0x78')][_0x269b('0x8b')];if(_0x269b('0x22')!=typeof _0x9dfc7a[_0x269b('0x78')][_0x269b('0x7a')]){if(_0x269b('0x22')!=typeof _0x9dfc7a[_0x269b('0x78')][_0x269b('0x7a')][_0x269b('0x7c')]){var _0x438f73=_0x9dfc7a[_0x269b('0x78')][_0x269b('0x7a')][_0x269b('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x269b('0x87')](_0x438f73)){_0x1ddc81=path[_0x269b('0x4e')](_0x269b('0x8a'),_0x476cf8,_0x2e782e[0x0],_0x438f73);}else{_0x1ddc81=_0x438f73;}}if(_0x269b('0x22')!=typeof _0x9dfc7a[_0x269b('0x78')]['views']['agent']){var _0x1d87ba=_0x9dfc7a['parameters'][_0x269b('0x7a')][_0x269b('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1d87ba)){_0x19f149=path[_0x269b('0x4e')](_0x269b('0x8a'),_0x476cf8,_0x2e782e[0x0],_0x1d87ba);}else{_0x19f149=_0x1d87ba;}}}}var _0x557337={'name':_0x53c267,'description':_0x5bf22f,'path':path['join'](_0x476cf8,_0x2e782e[0x0]),'type':_0x21a920,'sidebar':_0x5ab575,'icon':_0x4836e7,'adminUrl':_0x1ddc81,'agentUrl':_0x19f149,'scriptName':_0x51b637,'scriptPath':_0x18a201,'version':_0x54835c};removeReferences(_0x5e246a,null);return db['Plugin'][_0x269b('0x8c')](_0x557337)['then'](function(_0x524a6a){var _0x534ef4={'role':_0x456d37['body'][_0x269b('0x8d')],'userProfileId':_0x456d37['body'][_0x269b('0x8e')]};if(!_0x534ef4)throw new Error(_0x269b('0x8f'));if(_0x534ef4['role']===_0x269b('0x90')){var _0x503fe1=_0x524a6a[_0x269b('0x91')]({'plain':!![]});return db[_0x269b('0x92')][_0x269b('0x4d')]({'where':{'name':_0x269b('0x2b'),'userProfileId':_0x534ef4[_0x269b('0x8e')]},'raw':!![]})[_0x269b('0x29')](function(_0x15da79){if(_0x15da79&&_0x15da79[_0x269b('0x93')]===0x0){return db['UserProfileResource'][_0x269b('0x8c')]({'name':_0x503fe1[_0x269b('0x2f')],'resourceId':_0x503fe1['id'],'type':_0x15da79[_0x269b('0x2f')],'sectionId':_0x15da79['id']},{})[_0x269b('0x29')](function(){return _0x524a6a;});}else{return _0x524a6a;}})[_0x269b('0x49')](function(_0x4dbbdf){logger['error'](_0x269b('0x94'),_0x4dbbdf);throw _0x4dbbdf;});}return _0x524a6a;})['then'](respondWithResult(_0x46efd2,null))['catch'](handleError(_0x46efd2,null));}});}catch(_0x13c372){_0x46efd2['status'](0x1f4)['send'](_0x13c372);}};function removeReferences(_0x335b19,_0x4d8413){try{if(_0x335b19){fs[_0x269b('0x95')](_0x335b19);logger['info'](_0x269b('0x96'));}if(_0x4d8413){rimraf(_0x4d8413,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x10af06){logger['error'](_0x10af06);}}exports[_0x269b('0x97')]=function(_0x496b89,_0x625a93,_0x2d157b){return db[_0x269b('0x32')]['find']({'where':{'id':_0x496b89[_0x269b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x625a93,null))[_0x269b('0x29')](saveUpdates(_0x496b89['body'],null))[_0x269b('0x29')](respondWithResult(_0x625a93,null))[_0x269b('0x49')](handleError(_0x625a93,null));};exports['delete']=function(_0x1784a4,_0xa17cd,_0x83cde3){return db[_0x269b('0x32')][_0x269b('0x4d')]({'where':{'id':_0x1784a4[_0x269b('0x4a')]['id']}})['then'](function(_0x57a4b4){if(_0x57a4b4){return _0x57a4b4[_0x269b('0x2a')]();}})[_0x269b('0x29')](function(_0x1cfb48){rimraf(path[_0x269b('0x4e')](config[_0x269b('0x4f')],'server/files/plugins',path[_0x269b('0x5b')](_0x1cfb48['path'])),function(){});return _0x1cfb48;})[_0x269b('0x29')](handleEntityNotFound(_0xa17cd,null))['then'](respondWithStatusCode(_0xa17cd,null))['catch'](handleError(_0xa17cd,null));};exports[_0x269b('0x98')]=function(_0x5325b5,_0xe0d99d,_0x981984){return BPromise[_0x269b('0x99')]()[_0x269b('0x29')](function(){if(!_0x5325b5[_0x269b('0x36')][_0x269b('0x9')]){throw new Error(_0x269b('0x9a'));}if(!_0x5325b5[_0x269b('0x36')][_0x269b('0x9b')]){throw new Error(_0x269b('0x9c'));}var _0x2f5ab3=_0x5325b5[_0x269b('0x36')][_0x269b('0x9d')]?_0x5325b5[_0x269b('0x36')][_0x269b('0x9d')]+':'+_0x5325b5[_0x269b('0x36')]['port']:_0x269b('0x9e')+_0x5325b5['query']['port'];var _0x1f66cc=_0x5325b5[_0x269b('0x36')][_0x269b('0x20')]?_0x5325b5['query'][_0x269b('0x20')]:!![];var _0x5a4e88=_0x5325b5['query'][_0x269b('0x9f')]?_0x5325b5[_0x269b('0x36')][_0x269b('0x9f')]:null;var _0x41169d={'method':_0x5325b5[_0x269b('0xa0')],'uri':util['format'](_0x269b('0xa1'),_0x2f5ab3,_0x5325b5[_0x269b('0x36')][_0x269b('0x9')]),'json':_0x1f66cc,'resolveWithFullResponse':!![],'encoding':_0x5a4e88,'qs':_0x5325b5[_0x269b('0x36')]};if(_0x5325b5[_0x269b('0xa2')]){_0x41169d[_0x269b('0xa2')]=_0x5325b5['headers'];if(_0x41169d[_0x269b('0xa2')]['content-length']){delete _0x41169d[_0x269b('0xa2')]['content-length'];}}if(_0x41169d[_0x269b('0xa2')][_0x269b('0xa3')]){delete _0x41169d['headers'][_0x269b('0xa3')];}return rp(_0x41169d);})['then'](function(_0x3c4e8d){if(_0x3c4e8d){_0xe0d99d[_0x269b('0x25')](_0x3c4e8d[_0x269b('0xa2')]);logger[_0x269b('0x64')](_0x3c4e8d[_0x269b('0xa4')]);if(_[_0x269b('0xa5')](_0x5325b5['query']['path'],'download')&&_0x3c4e8d[_0x269b('0xa6')]==0x1f4){return _0xe0d99d[_0x269b('0x1d')](_0x3c4e8d['statusCode']);}else{return _0xe0d99d[_0x269b('0x1e')](_0x3c4e8d['statusCode'])['send'](_0x3c4e8d[_0x269b('0xa4')]);}}else{return _0xe0d99d['sendStatus'](0xc8);}})[_0x269b('0x49')](handleError(_0xe0d99d,null));};exports['webhookPost']=function(_0x2e55d8,_0xdbfe80,_0xe3061e){return BPromise['resolve']()[_0x269b('0x29')](function(){if(!_0x2e55d8['query'][_0x269b('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2e55d8[_0x269b('0x36')][_0x269b('0x9b')]){throw new Error(_0x269b('0x9c'));}var _0x14a39f=_0x2e55d8['query'][_0x269b('0x9d')]?_0x2e55d8[_0x269b('0x36')][_0x269b('0x9d')]+':'+_0x2e55d8[_0x269b('0x36')][_0x269b('0x9b')]:_0x269b('0x9e')+_0x2e55d8[_0x269b('0x36')][_0x269b('0x9b')];var _0x19f95b=_0x2e55d8[_0x269b('0x36')]['json']?_0x2e55d8[_0x269b('0x36')][_0x269b('0x20')]:!![];var _0x828e7=_0x2e55d8[_0x269b('0x36')][_0x269b('0x9f')]?_0x2e55d8[_0x269b('0x36')][_0x269b('0x9f')]:null;var _0x22fcc4={'method':_0x2e55d8[_0x269b('0xa0')],'uri':util[_0x269b('0x62')]('%s%s',_0x14a39f,_0x2e55d8[_0x269b('0x36')][_0x269b('0x9')]),'json':_0x19f95b,'resolveWithFullResponse':!![],'encoding':_0x828e7,'body':_0x2e55d8['body']};if(_0x2e55d8['headers']){_0x22fcc4['headers']=_0x2e55d8[_0x269b('0xa2')];if(_0x22fcc4[_0x269b('0xa2')]['content-length']){delete _0x22fcc4[_0x269b('0xa2')][_0x269b('0xa7')];}}if(_0x22fcc4[_0x269b('0xa2')]['content-type']){delete _0x22fcc4[_0x269b('0xa2')][_0x269b('0xa3')];}return rp(_0x22fcc4);})['then'](function(_0xe06342){if(_0xe06342){_0xdbfe80[_0x269b('0x25')](_0xe06342[_0x269b('0xa2')]);logger['info'](_0xe06342['body']);return _0xdbfe80[_0x269b('0x1e')](_0xe06342[_0x269b('0xa6')])[_0x269b('0x30')](_0xe06342[_0x269b('0xa4')]);}else{return _0xdbfe80[_0x269b('0x1d')](0xc8);}})['catch'](handleError(_0xdbfe80,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 5bad2e8..d5f5fd6 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 _0xe7de=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x31838,_0x2b09ba){var _0x46ab95=function(_0x4b63ef){while(--_0x4b63ef){_0x31838['push'](_0x31838['shift']());}};_0x46ab95(++_0x2b09ba);}(_0xe7de,0x165));var _0xee7d=function(_0x12061e,_0x1eff49){_0x12061e=_0x12061e-0x0;var _0x4f369f=_0xe7de[_0x12061e];return _0x4f369f;};'use strict';var EventEmitter=require(_0xee7d('0x0'));var Plugin=require(_0xee7d('0x1'))['db'][_0xee7d('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xee7d('0x3'),'afterDestroy':_0xee7d('0x4')};function emitEvent(_0x2e646b){return function(_0x3f1c6d,_0x3afa35,_0x3ce970){PluginEvents[_0xee7d('0x5')](_0x2e646b+':'+_0x3f1c6d['id'],_0x3f1c6d);PluginEvents[_0xee7d('0x5')](_0x2e646b,_0x3f1c6d);_0x3ce970(null);};}for(var e in events){if(events[_0xee7d('0x6')](e)){var event=events[e];Plugin[_0xee7d('0x7')](e,emitEvent(event));}}module[_0xee7d('0x8')]=PluginEvents; \ No newline at end of file +var _0x37a7=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1ba074,_0x40b49f){var _0x1290c4=function(_0x47a560){while(--_0x47a560){_0x1ba074['push'](_0x1ba074['shift']());}};_0x1290c4(++_0x40b49f);}(_0x37a7,0x6f));var _0x737a=function(_0x51c140,_0x496261){_0x51c140=_0x51c140-0x0;var _0xd8e7a9=_0x37a7[_0x51c140];return _0xd8e7a9;};'use strict';var EventEmitter=require(_0x737a('0x0'));var Plugin=require(_0x737a('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x737a('0x2'),'afterDestroy':_0x737a('0x3')};function emitEvent(_0x53a261){return function(_0x524516,_0x4af128,_0x245e59){PluginEvents[_0x737a('0x4')](_0x53a261+':'+_0x524516['id'],_0x524516);PluginEvents[_0x737a('0x4')](_0x53a261,_0x524516);_0x245e59(null);};}for(var e in events){if(events[_0x737a('0x5')](e)){var event=events[e];Plugin[_0x737a('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index eca9d1d..6ea9228 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 _0xef39=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x18f79c,_0x16520a){var _0x1d27a9=function(_0x2d8b3c){while(--_0x2d8b3c){_0x18f79c['push'](_0x18f79c['shift']());}};_0x1d27a9(++_0x16520a);}(_0xef39,0x92));var _0x9ef3=function(_0x59a4e1,_0x542ff8){_0x59a4e1=_0x59a4e1-0x0;var _0x2227b0=_0xef39[_0x59a4e1];return _0x2227b0;};'use strict';var _=require('lodash');var util=require(_0x9ef3('0x0'));var logger=require(_0x9ef3('0x1'))(_0x9ef3('0x2'));var moment=require(_0x9ef3('0x3'));var BPromise=require(_0x9ef3('0x4'));var rp=require(_0x9ef3('0x5'));var fs=require('fs');var path=require(_0x9ef3('0x6'));var rimraf=require(_0x9ef3('0x7'));var config=require(_0x9ef3('0x8'));var attributes=require(_0x9ef3('0x9'));module[_0x9ef3('0xa')]=function(_0x42911f,_0x50b950){return _0x42911f[_0x9ef3('0xb')](_0x9ef3('0xc'),attributes,{'tableName':_0x9ef3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6ee=['rimraf','exports','Plugin','lodash','util','bluebird','path'];(function(_0x4874ee,_0x21fe35){var _0x581328=function(_0x516895){while(--_0x516895){_0x4874ee['push'](_0x4874ee['shift']());}};_0x581328(++_0x21fe35);}(_0xa6ee,0x1ed));var _0xea6e=function(_0x1ad1ea,_0x35cc9d){_0x1ad1ea=_0x1ad1ea-0x0;var _0x165960=_0xa6ee[_0x1ad1ea];return _0x165960;};'use strict';var _=require(_0xea6e('0x0'));var util=require(_0xea6e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xea6e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea6e('0x3'));var rimraf=require(_0xea6e('0x4'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0xea6e('0x5')]=function(_0x4de7fd,_0x107ec3){return _0x4de7fd['define'](_0xea6e('0x6'),attributes,{'tableName':'plugins','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 5cba67d..dc4a246 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 _0x70e2=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreatePlugin','Plugin','create','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x25389f,_0x2a72b7){var _0x55af9f=function(_0x1bfb35){while(--_0x1bfb35){_0x25389f['push'](_0x25389f['shift']());}};_0x55af9f(++_0x2a72b7);}(_0x70e2,0x7f));var _0x270e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x70e2[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x270e('0x0'));var util=require(_0x270e('0x1'));var moment=require(_0x270e('0x2'));var BPromise=require(_0x270e('0x3'));var rs=require(_0x270e('0x4'));var fs=require('fs');var Redis=require(_0x270e('0x5'));var db=require(_0x270e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x270e('0x7'))(_0x270e('0x8'));var config=require(_0x270e('0x9'));var jayson=require(_0x270e('0xa'));var client=jayson['client'][_0x270e('0xb')]({'port':0x232a});config[_0x270e('0xc')]=_[_0x270e('0xd')](config[_0x270e('0xc')],{'host':_0x270e('0xe'),'port':0x18eb});var socket=require(_0x270e('0xf'))(new Redis(config[_0x270e('0xc')]));require(_0x270e('0x10'))['register'](socket);function respondWithRpcPromise(_0x5ebcdf,_0x1ac7b0,_0x1712cc){return new BPromise(function(_0x566b27,_0x1f8e8){return client[_0x270e('0x11')](_0x5ebcdf,_0x1712cc)[_0x270e('0x12')](function(_0x2fee7d){logger[_0x270e('0x13')](_0x270e('0x14'),_0x1ac7b0,_0x270e('0x15'));logger[_0x270e('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1ac7b0,'request\x20sent',JSON[_0x270e('0x17')](_0x2fee7d));if(_0x2fee7d[_0x270e('0x18')]){if(_0x2fee7d[_0x270e('0x18')][_0x270e('0x19')]===0x1f4){logger[_0x270e('0x18')](_0x270e('0x14'),_0x1ac7b0,_0x2fee7d[_0x270e('0x18')][_0x270e('0x1a')]);return _0x1f8e8(_0x2fee7d[_0x270e('0x18')][_0x270e('0x1a')]);}logger[_0x270e('0x18')]('Plugin,\x20%s,\x20%s',_0x1ac7b0,_0x2fee7d[_0x270e('0x18')][_0x270e('0x1a')]);return _0x566b27(_0x2fee7d[_0x270e('0x18')][_0x270e('0x1a')]);}else{logger[_0x270e('0x13')](_0x270e('0x14'),_0x1ac7b0,_0x270e('0x15'));_0x566b27(_0x2fee7d['result'][_0x270e('0x1a')]);}})[_0x270e('0x1b')](function(_0x25ff8b){logger[_0x270e('0x18')]('Plugin,\x20%s,\x20%s',_0x1ac7b0,_0x25ff8b);_0x1f8e8(_0x25ff8b);});});}exports[_0x270e('0x1c')]=function(_0x59dac6){var _0x192ae7=this;return new Promise(function(_0x5a7d33,_0x492b48){return db[_0x270e('0x1d')][_0x270e('0x1e')](_0x59dac6['body'],{'raw':_0x59dac6['options']?_0x59dac6[_0x270e('0x1f')][_0x270e('0x20')]===undefined?!![]:![]:!![]})[_0x270e('0x12')](function(_0x45722a){logger[_0x270e('0x13')](_0x270e('0x1c'),_0x59dac6);logger[_0x270e('0x16')](_0x270e('0x1c'),_0x59dac6,JSON[_0x270e('0x17')](_0x45722a));_0x5a7d33(_0x45722a);})[_0x270e('0x1b')](function(_0x54e177){logger['error'](_0x270e('0x1c'),_0x54e177[_0x270e('0x1a')],_0x59dac6);_0x492b48(_0x192ae7[_0x270e('0x18')](0x1f4,_0x54e177[_0x270e('0x1a')]));});});}; \ No newline at end of file +var _0xf93f=['debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s'];(function(_0x16295e,_0x4a9b05){var _0x2d9e54=function(_0x396291){while(--_0x396291){_0x16295e['push'](_0x16295e['shift']());}};_0x2d9e54(++_0x4a9b05);}(_0xf93f,0x97));var _0xff93=function(_0x37c3e8,_0x5ee4a5){_0x37c3e8=_0x37c3e8-0x0;var _0x759fb=_0xf93f[_0x37c3e8];return _0x759fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff93('0x0'));var BPromise=require(_0xff93('0x1'));var rs=require(_0xff93('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xff93('0x3'));var logger=require(_0xff93('0x4'))(_0xff93('0x5'));var config=require(_0xff93('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xff93('0x7')][_0xff93('0x8')]({'port':0x232a});config['redis']=_[_0xff93('0x9')](config[_0xff93('0xa')],{'host':_0xff93('0xb'),'port':0x18eb});var socket=require(_0xff93('0xc'))(new Redis(config[_0xff93('0xa')]));require(_0xff93('0xd'))[_0xff93('0xe')](socket);function respondWithRpcPromise(_0x353899,_0x597c82,_0x401404){return new BPromise(function(_0x3f0421,_0x5beaa8){return client[_0xff93('0xf')](_0x353899,_0x401404)[_0xff93('0x10')](function(_0x5f5980){logger[_0xff93('0x11')](_0xff93('0x12'),_0x597c82,'request\x20sent');logger[_0xff93('0x13')](_0xff93('0x14'),_0x597c82,_0xff93('0x15'),JSON[_0xff93('0x16')](_0x5f5980));if(_0x5f5980['error']){if(_0x5f5980[_0xff93('0x17')][_0xff93('0x18')]===0x1f4){logger[_0xff93('0x17')](_0xff93('0x12'),_0x597c82,_0x5f5980['error'][_0xff93('0x19')]);return _0x5beaa8(_0x5f5980[_0xff93('0x17')][_0xff93('0x19')]);}logger[_0xff93('0x17')](_0xff93('0x12'),_0x597c82,_0x5f5980[_0xff93('0x17')][_0xff93('0x19')]);return _0x3f0421(_0x5f5980['error'][_0xff93('0x19')]);}else{logger[_0xff93('0x11')](_0xff93('0x12'),_0x597c82,_0xff93('0x15'));_0x3f0421(_0x5f5980[_0xff93('0x1a')]['message']);}})[_0xff93('0x1b')](function(_0x585b34){logger[_0xff93('0x17')](_0xff93('0x12'),_0x597c82,_0x585b34);_0x5beaa8(_0x585b34);});});}exports['CreatePlugin']=function(_0x4bcdac){var _0x2406d0=this;return new Promise(function(_0x28aeeb,_0x1ad2f5){return db[_0xff93('0x1c')][_0xff93('0x1d')](_0x4bcdac[_0xff93('0x1e')],{'raw':_0x4bcdac[_0xff93('0x1f')]?_0x4bcdac[_0xff93('0x1f')][_0xff93('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x39e812){logger[_0xff93('0x11')]('CreatePlugin',_0x4bcdac);logger[_0xff93('0x13')](_0xff93('0x21'),_0x4bcdac,JSON['stringify'](_0x39e812));_0x28aeeb(_0x39e812);})['catch'](function(_0xe3f838){logger[_0xff93('0x17')](_0xff93('0x21'),_0xe3f838[_0xff93('0x19')],_0x4bcdac);_0x1ad2f5(_0x2406d0['error'](0x1f4,_0xe3f838[_0xff93('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index b0546ec..9c1000d 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 _0xf696=['remove','update','emit','removeListener','register','plugin:','save'];(function(_0x20b105,_0x330d35){var _0x228964=function(_0x5700dd){while(--_0x5700dd){_0x20b105['push'](_0x20b105['shift']());}};_0x228964(++_0x330d35);}(_0xf696,0x1a3));var _0x6f69=function(_0x5c4ac1,_0x231fad){_0x5c4ac1=_0x5c4ac1-0x0;var _0x381d13=_0xf696[_0x5c4ac1];return _0x381d13;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x6f69('0x0'),_0x6f69('0x1'),_0x6f69('0x2')];function createListener(_0xdda219,_0x404283){return function(_0x4e38f1){_0x404283[_0x6f69('0x3')](_0xdda219,_0x4e38f1);};}function removeListener(_0x193691,_0x3f1ecc){return function(){PluginEvents[_0x6f69('0x4')](_0x193691,_0x3f1ecc);};}exports[_0x6f69('0x5')]=function(_0x1d45f7){for(var _0x48f1b9=0x0,_0x152a1a=events['length'];_0x48f1b9<_0x152a1a;_0x48f1b9++){var _0x38a72c=events[_0x48f1b9];var _0x462b1f=createListener(_0x6f69('0x6')+_0x38a72c,_0x1d45f7);PluginEvents['on'](_0x38a72c,_0x462b1f);}}; \ No newline at end of file +var _0x08fb=['./plugin.events','remove','emit','length','plugin:'];(function(_0x967072,_0x507265){var _0x39bd07=function(_0x3c6236){while(--_0x3c6236){_0x967072['push'](_0x967072['shift']());}};_0x39bd07(++_0x507265);}(_0x08fb,0x122));var _0xb08f=function(_0x5096ac,_0x3ebd43){_0x5096ac=_0x5096ac-0x0;var _0x1db7c1=_0x08fb[_0x5096ac];return _0x1db7c1;};'use strict';var PluginEvents=require(_0xb08f('0x0'));var events=['save',_0xb08f('0x1'),'update'];function createListener(_0x6ad5b3,_0x48f572){return function(_0x4aebfe){_0x48f572[_0xb08f('0x2')](_0x6ad5b3,_0x4aebfe);};}function removeListener(_0x44fa6e,_0x59a5aa){return function(){PluginEvents['removeListener'](_0x44fa6e,_0x59a5aa);};}exports['register']=function(_0x1a204d){for(var _0x588390=0x0,_0x44ebc3=events[_0xb08f('0x3')];_0x588390<_0x44ebc3;_0x588390++){var _0x3b9afd=events[_0x588390];var _0x204fb7=createListener(_0xb08f('0x4')+_0x3b9afd,_0x1a204d);PluginEvents['on'](_0x3b9afd,_0x204fb7);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 8b3daa9..926f6f1 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(_0x425fa4,_0x57779f){var _0x2802d5=function(_0xefd94a){while(--_0xefd94a){_0x425fa4['push'](_0x425fa4['shift']());}};_0x2802d5(++_0x57779f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x557259,_0x1412ce){var _0x1918b4=function(_0x30dc2b){while(--_0x30dc2b){_0x557259['push'](_0x557259['shift']());}};_0x1918b4(++_0x1412ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 23d1efd..c7a6fe2 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 _0xec56=['reject','express','length','then','catch','show','describe','params','create','body','join','../../files/plugins','script','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list'];(function(_0x4a49e3,_0xa04db3){var _0x126278=function(_0x535242){while(--_0x535242){_0x4a49e3['push'](_0x4a49e3['shift']());}};_0x126278(++_0xa04db3);}(_0xec56,0x1bd));var _0x6ec5=function(_0x242e92,_0x511113){_0x242e92=_0x242e92-0x0;var _0x39764b=_0xec56[_0x242e92];return _0x39764b;};'use strict';var _=require(_0x6ec5('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x6ec5('0x1'));var path=require(_0x6ec5('0x2'));var exec=require(_0x6ec5('0x3'))[_0x6ec5('0x4')];var BPromise=require(_0x6ec5('0x5'));function handleEntityNotFound(_0x399441,_0x469679){return function(_0x173aeb){if(!_0x173aeb){_0x399441[_0x6ec5('0x6')](0x194);;}return _0x173aeb;};}function respondWithResult(_0x28b12b,_0x2d0a93){_0x2d0a93=_0x2d0a93||0xc8;return function(_0x3bb683){if(_0x3bb683){return _0x28b12b[_0x6ec5('0x7')](_0x2d0a93)[_0x6ec5('0x8')](_0x3bb683);}return null;};}function handleError(_0x3dd891,_0x225d2f){_0x225d2f=_0x225d2f||0x1f4;return function(_0x17bcf0){logger[_0x6ec5('0x9')](_0x17bcf0[_0x6ec5('0xa')]);if(_0x17bcf0['name']){delete _0x17bcf0[_0x6ec5('0xb')];}_0x3dd891[_0x6ec5('0x7')](_0x225d2f)[_0x6ec5('0xc')](_0x17bcf0);};}function execChildProcess(){return new BPromise(function(_0x1964ae,_0x143b09){exec(_0x6ec5('0xd'),function(_0x1d5b76,_0x50eb2d,_0x2d4eca){logger[_0x6ec5('0xe')](_0x50eb2d);logger[_0x6ec5('0xe')](_0x2d4eca);if(_0x1d5b76){logger[_0x6ec5('0x9')](_0x1d5b76);return _0x143b09(_0x1d5b76);}return _0x1964ae(_0x50eb2d);});});}exports[_0x6ec5('0xf')]=function(_0x2890fb,_0x2f4c5d){return pm2[_0x6ec5('0x10')]()['then'](function(_0x3ed07a){if(_0x3ed07a){var _0x4d1510=_[_0x6ec5('0x11')](_0x3ed07a,function(_0x287542){return _0x287542[_0x6ec5('0xb')]===_0x6ec5('0x12')||_0x287542[_0x6ec5('0xb')]==='motion2';});return{'rows':_0x4d1510,'count':_0x4d1510[_0x6ec5('0x13')]};}return null;})[_0x6ec5('0x14')](respondWithResult(_0x2f4c5d,null))[_0x6ec5('0x15')](handleError(_0x2f4c5d,null));};exports[_0x6ec5('0x16')]=function(_0x23b3e3,_0x42b690){return pm2[_0x6ec5('0x17')](_0x23b3e3[_0x6ec5('0x18')]['id'])[_0x6ec5('0x14')](respondWithResult(_0x42b690,null))[_0x6ec5('0x14')](handleEntityNotFound(_0x42b690,null))[_0x6ec5('0x15')](handleError(_0x42b690,null));};exports[_0x6ec5('0x19')]=function(_0x437f0f,_0x2228dd){if(_0x437f0f[_0x6ec5('0x1a')][_0x6ec5('0xb')]&&_0x437f0f[_0x6ec5('0x1a')]['script']){var _0x272532=path[_0x6ec5('0x1b')](__dirname,_0x6ec5('0x1c'),_0x437f0f[_0x6ec5('0x1a')][_0x6ec5('0x1d')]);var _0x38a821=process[_0x6ec5('0x1e')]();process['chdir'](path[_0x6ec5('0x1f')](_0x272532));return execChildProcess()[_0x6ec5('0x14')](function(_0x358d18){process[_0x6ec5('0x20')](_0x38a821);return pm2['start']({'name':_0x437f0f[_0x6ec5('0x1a')][_0x6ec5('0xb')],'script':_0x272532});})['then'](function(_0x2dc0a7){pm2[_0x6ec5('0x21')]();return _0x2dc0a7[0x0];})[_0x6ec5('0x14')](respondWithResult(_0x2228dd,0xc9))['catch'](handleError(_0x2228dd,null));}else{return _0x2228dd[_0x6ec5('0x7')](0x1f4)[_0x6ec5('0xc')]({'message':_0x6ec5('0x22')});}};exports[_0x6ec5('0x23')]=function(_0x425fac,_0x484847){if(_0x425fac[_0x6ec5('0x1a')]['id']){delete _0x425fac[_0x6ec5('0x1a')]['id'];}var _0x4a9860={'online':_0x6ec5('0x24'),'stopped':_0x6ec5('0x25')};if(_0x4a9860['hasOwnProperty'](_0x425fac[_0x6ec5('0x1a')][_0x6ec5('0x7')])){return pm2[_0x4a9860[_0x425fac[_0x6ec5('0x1a')][_0x6ec5('0x7')]]](_0x425fac[_0x6ec5('0x18')]['id'])['then'](respondWithResult(_0x484847,0xc8))[_0x6ec5('0x15')](handleError(_0x484847,null));}else{return _0x484847[_0x6ec5('0x7')](0x1f4)[_0x6ec5('0xc')]({'message':_0x6ec5('0x26')});}};exports[_0x6ec5('0x27')]=function(_0x22c3d3,_0x394132){if(_0x22c3d3['body']['id']){delete _0x22c3d3[_0x6ec5('0x1a')]['id'];}if(_0x22c3d3['params']['id']){return pm2[_0x6ec5('0x28')](_0x22c3d3['params']['id'])[_0x6ec5('0x14')](function(_0x3115e3){pm2['dump']();return _0x3115e3[0x0];})['then'](respondWithResult(_0x394132,null))[_0x6ec5('0x15')](handleError(_0x394132,null));}else{return _0x394132[_0x6ec5('0x7')](0x1f4)['send']({'message':_0x6ec5('0x29')});}}; \ No newline at end of file +var _0x5ff3=['Unknown\x20id','../../config/pm2','api','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','delete'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x5ff3,0x17d));var _0x35ff=function(_0x1e54e3,_0x102de8){_0x1e54e3=_0x1e54e3-0x0;var _0x19ae29=_0x5ff3[_0x1e54e3];return _0x19ae29;};'use strict';var _=require('lodash');var pm2=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var path=require('path');var exec=require(_0x35ff('0x2'))[_0x35ff('0x3')];var BPromise=require(_0x35ff('0x4'));function handleEntityNotFound(_0xd0846d,_0x551514){return function(_0x2fcb74){if(!_0x2fcb74){_0xd0846d[_0x35ff('0x5')](0x194);;}return _0x2fcb74;};}function respondWithResult(_0x2e9873,_0x11e738){_0x11e738=_0x11e738||0xc8;return function(_0x30c3ff){if(_0x30c3ff){return _0x2e9873['status'](_0x11e738)[_0x35ff('0x6')](_0x30c3ff);}return null;};}function handleError(_0x4c9fab,_0x2e7470){_0x2e7470=_0x2e7470||0x1f4;return function(_0xfcec34){logger[_0x35ff('0x7')](_0xfcec34['stack']);if(_0xfcec34[_0x35ff('0x8')]){delete _0xfcec34['name'];}_0x4c9fab[_0x35ff('0x9')](_0x2e7470)[_0x35ff('0xa')](_0xfcec34);};}function execChildProcess(){return new BPromise(function(_0x57ad20,_0x5c3131){exec(_0x35ff('0xb'),function(_0x574c81,_0x592295,_0x567080){logger[_0x35ff('0xc')](_0x592295);logger[_0x35ff('0xc')](_0x567080);if(_0x574c81){logger[_0x35ff('0x7')](_0x574c81);return _0x5c3131(_0x574c81);}return _0x57ad20(_0x592295);});});}exports[_0x35ff('0xd')]=function(_0x559e33,_0x33154f){return pm2[_0x35ff('0xe')]()[_0x35ff('0xf')](function(_0x4d1d41){if(_0x4d1d41){var _0xff8ac=_[_0x35ff('0x10')](_0x4d1d41,function(_0x254975){return _0x254975[_0x35ff('0x8')]===_0x35ff('0x11')||_0x254975[_0x35ff('0x8')]===_0x35ff('0x12');});return{'rows':_0xff8ac,'count':_0xff8ac[_0x35ff('0x13')]};}return null;})[_0x35ff('0xf')](respondWithResult(_0x33154f,null))[_0x35ff('0x14')](handleError(_0x33154f,null));};exports[_0x35ff('0x15')]=function(_0x3430e2,_0x37ea06){return pm2[_0x35ff('0x16')](_0x3430e2[_0x35ff('0x17')]['id'])['then'](respondWithResult(_0x37ea06,null))[_0x35ff('0xf')](handleEntityNotFound(_0x37ea06,null))[_0x35ff('0x14')](handleError(_0x37ea06,null));};exports[_0x35ff('0x18')]=function(_0x1c0d8c,_0x567bcb){if(_0x1c0d8c['body'][_0x35ff('0x8')]&&_0x1c0d8c[_0x35ff('0x19')]['script']){var _0x238f65=path[_0x35ff('0x1a')](__dirname,_0x35ff('0x1b'),_0x1c0d8c[_0x35ff('0x19')]['script']);var _0x3d60b4=process['cwd']();process[_0x35ff('0x1c')](path[_0x35ff('0x1d')](_0x238f65));return execChildProcess()[_0x35ff('0xf')](function(_0x16a5a0){process[_0x35ff('0x1c')](_0x3d60b4);return pm2[_0x35ff('0x1e')]({'name':_0x1c0d8c[_0x35ff('0x19')]['name'],'script':_0x238f65});})[_0x35ff('0xf')](function(_0x2ffcb){pm2['dump']();return _0x2ffcb[0x0];})[_0x35ff('0xf')](respondWithResult(_0x567bcb,0xc9))['catch'](handleError(_0x567bcb,null));}else{return _0x567bcb['status'](0x1f4)[_0x35ff('0xa')]({'message':_0x35ff('0x1f')});}};exports[_0x35ff('0x20')]=function(_0x11a5eb,_0x302d5a){if(_0x11a5eb['body']['id']){delete _0x11a5eb[_0x35ff('0x19')]['id'];}var _0x412873={'online':_0x35ff('0x21'),'stopped':'stop'};if(_0x412873[_0x35ff('0x22')](_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')])){return pm2[_0x412873[_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')]]](_0x11a5eb[_0x35ff('0x17')]['id'])[_0x35ff('0xf')](respondWithResult(_0x302d5a,0xc8))[_0x35ff('0x14')](handleError(_0x302d5a,null));}else{return _0x302d5a[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x23')});}};exports['destroy']=function(_0x1cb370,_0x257501){if(_0x1cb370[_0x35ff('0x19')]['id']){delete _0x1cb370[_0x35ff('0x19')]['id'];}if(_0x1cb370['params']['id']){return pm2[_0x35ff('0x24')](_0x1cb370['params']['id'])[_0x35ff('0xf')](function(_0xf88865){pm2['dump']();return _0xf88865[0x0];})['then'](respondWithResult(_0x257501,null))[_0x35ff('0x14')](handleError(_0x257501,null));}else{return _0x257501[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 479efc8..1d2ed69 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 _0x9e9d=['get','isAuthenticated','getAgents','getQueues','exports','express','../../components/auth/service','./realtime.controller'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x9e9d,0xc5));var _0xd9e9=function(_0x17d4a1,_0x4c19eb){_0x17d4a1=_0x17d4a1-0x0;var _0x162616=_0x9e9d[_0x17d4a1];return _0x162616;};'use strict';var express=require(_0xd9e9('0x0'));var router=express['Router']();var auth=require(_0xd9e9('0x1'));var controller=require(_0xd9e9('0x2'));router[_0xd9e9('0x3')]('/agents',auth[_0xd9e9('0x4')](),controller[_0xd9e9('0x5')]);router[_0xd9e9('0x3')]('/queues',auth['isAuthenticated'](),controller[_0xd9e9('0x6')]);module[_0xd9e9('0x7')]=router; \ No newline at end of file +var _0xb4d4=['./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','express','Router','../../components/auth/service'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb4d4,0x153));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x4b4d('0x0'));var router=express[_0x4b4d('0x1')]();var auth=require(_0x4b4d('0x2'));var controller=require(_0x4b4d('0x3'));router[_0x4b4d('0x4')](_0x4b4d('0x5'),auth[_0x4b4d('0x6')](),controller[_0x4b4d('0x7')]);router[_0x4b4d('0x4')](_0x4b4d('0x8'),auth[_0x4b4d('0x6')](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index fd2992b..30727d2 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 _0xaa0e=['role','getOptions','raw','where','isEmpty','user','userProfileId','nolimit','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','resolve','type','QueueCampaigns','Queues','UserProfile','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','count','offset','limit','status','Content-Range','stack','name','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','paused','outbound','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','loggedInDb','talking','busy','find','queue','length','some','connectedlinenum','internal','getMembers','UserId','accountcode','online','User','Queue','Pause','findAll','startCase','QueueId','agents','unknown','ringing','isNil','faxPause','mailPause','openchannelPause','smsPause','voicePause','every','filter','voiceStatus','idle','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','pause','*pause','mail','sms','openchannel','fax','whatsapp','includes','toLowerCase','Invalid\x20channel','findOne','getAgents','all','flatten','uniq','split','fields','globalStatus','order','startsWith','DESC','ASC','pauseType','userpic','lastLoginAt','lastPauseAt','address','chatPause','whatsappPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','query','channel','sort','join','globalQueueFilter','rawAttributes','fieldName','key'];(function(_0x17479d,_0x593129){var _0x2d461c=function(_0x347164){while(--_0x347164){_0x17479d['push'](_0x17479d['shift']());}};_0x2d461c(++_0x593129);}(_0xaa0e,0x15f));var _0xeaa0=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xaa0e[_0x5d8018];return _0x151ac4;};'use strict';var util=require(_0xeaa0('0x0'));var _=require('lodash');var jayson=require(_0xeaa0('0x1'));var qs=require(_0xeaa0('0x2'));var logger=require(_0xeaa0('0x3'))(_0xeaa0('0x4'));var db=require(_0xeaa0('0x5'))['db'];var amiClient=jayson[_0xeaa0('0x6')][_0xeaa0('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0xeaa0('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x264882,_0x3f6166){return function(_0x79cd17){if(_0x79cd17){var _0x448d1d=typeof _0x3f6166['offset']==='undefined'&&typeof _0x3f6166['limit']===_0xeaa0('0x8');var _0x4fe322=_0x79cd17[_0xeaa0('0x9')];var _0x29d461=_0x448d1d?0x0:_0x3f6166[_0xeaa0('0xa')];var _0x4d3dfc=_0x448d1d?_0x79cd17['count']:_0x3f6166[_0xeaa0('0xa')]+_0x3f6166[_0xeaa0('0xb')];var _0x4a7cbd;if(_0x4d3dfc>=_0x4fe322){_0x4d3dfc=_0x4fe322;_0x4a7cbd=0xc8;}else{_0x4a7cbd=0xce;}_0x264882[_0xeaa0('0xc')](_0x4a7cbd);return _0x264882['set'](_0xeaa0('0xd'),_0x29d461+'-'+_0x4d3dfc+'/'+_0x4fe322)['json'](_0x79cd17);}return null;};}function handleError(_0x58ec19,_0x39493e){_0x39493e=_0x39493e||0x1f4;return function(_0x305215){logger['error'](_0x305215[_0xeaa0('0xe')]);if(_0x305215[_0xeaa0('0xf')]){delete _0x305215['name'];}_0x58ec19[_0xeaa0('0xc')](_0x39493e)['send'](_0x305215);};}function getRealtimeAgents(){return new Promise(function(_0x1e2448,_0x232db2){return amiClient[_0xeaa0('0x10')]('Agents',{})[_0xeaa0('0x11')](function(_0x13171f){if(_0x13171f[_0xeaa0('0x12')])throw new Error(_0xeaa0('0x13'));var _0x3dd528=_0x13171f[_0xeaa0('0x14')];return routingClient[_0xeaa0('0x10')](_0xeaa0('0x15'),{})[_0xeaa0('0x11')](function(_0x43e38c){if(_0x43e38c[_0xeaa0('0x12')])throw new Error(_0xeaa0('0x16'));var _0x3ece33=_0x43e38c[_0xeaa0('0x14')];return _0x1e2448(_[_0xeaa0('0x17')]({},_0x3dd528,_0x3ece33));});})[_0xeaa0('0x18')](function(_0x3d3ae0){_0x232db2(_0x3d3ae0);});});}function getRealtimeQueues(_0xac6325,_0x5a7cfb){return new Promise(function(_0x15855e,_0x387a8b){var _0x2cf4b9=_0x5a7cfb===_0xeaa0('0x19')?amiClient:routingClient;return _0x2cf4b9['request'](_['startCase'](_0x5a7cfb)+'Queues',_0xac6325)[_0xeaa0('0x11')](function(_0x49e9f1){if(_0x49e9f1['error'])throw new Error(util[_0xeaa0('0x1a')](_0xeaa0('0x1b'),_0x5a7cfb));return _0x15855e(_0x49e9f1[_0xeaa0('0x14')]);})['catch'](function(_0x20de99){_0x387a8b(_0x20de99);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x42fbf2,_0x45194a){return amiClient[_0xeaa0('0x10')](_0xeaa0('0x1c'),{})[_0xeaa0('0x11')](function(_0x35622d){if(_0x35622d['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x42fbf2(_0x35622d[_0xeaa0('0x14')]);})['catch'](function(_0xa03b){_0x45194a(_0xa03b);});});}function initializeQueues(_0x31b503,_0x2b4049,_0x1be3d2,_0x4852db){var _0x4d854b=[_0xeaa0('0x1d'),_0xeaa0('0x1e'),_0xeaa0('0x1f'),'talking',_0xeaa0('0x20')];if(_0x1be3d2===_0xeaa0('0x19')&&_0x4852db===_0xeaa0('0x21')){_0x4d854b[_0xeaa0('0x22')](_0xeaa0('0x23'),'originated',_0xeaa0('0x24'),_0xeaa0('0x25'),_0xeaa0('0x26'),_0xeaa0('0x27'),_0xeaa0('0x28'),_0xeaa0('0x29'),_0xeaa0('0x2a'),_0xeaa0('0x2b'),_0xeaa0('0x2c'),_0xeaa0('0x2d'),_0xeaa0('0x2e'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xeaa0('0x2f'),_0xeaa0('0x30'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0xeaa0('0x31'),_0xeaa0('0x32'),_0xeaa0('0x33'));}return _0x31b503[_0xeaa0('0x34')](function(_0xe95346){var _0x232eed=_0xe95346['get']({'plain':!![]});_0x232eed['agents']=[];_0x232eed[_0xeaa0('0x20')]=0x0;_0x232eed[_0xeaa0('0x35')]=0x0;_0x232eed[_0xeaa0('0x1d')]=0x0;_0x232eed[_0xeaa0('0x1e')]=0x0;_0x232eed[_0xeaa0('0x1f')]=0x0;if(_0x1be3d2===_0xeaa0('0x19')){_0x232eed[_0xeaa0('0x36')]=0x0;_0x232eed[_0xeaa0('0x37')]=0x0;if(_0x4852db===_0xeaa0('0x21')){_0x232eed[_0xeaa0('0x23')]=0x0;_0x232eed['originated']=0x0;}}var _0x59d1f4=_[_0xeaa0('0x38')](_0x2b4049,['id',_0x232eed['id']]);if(_0x59d1f4)_[_0xeaa0('0x17')](_0x232eed,_['pick'](_0x59d1f4,_0x4d854b));return _0x232eed;});}function updateAgentVoiceStatus(_0x420ceb,_0x2c55d6,_0x229433){var _0x2c6f7a=_['filter'](_0x229433,[_0xeaa0('0x39'),_0x2c55d6[_0xeaa0('0xf')]]);if(_0x2c6f7a[_0xeaa0('0x3a')]===0x0)return _0x420ceb['busy']=!![];if(_[_0xeaa0('0x3b')](_0x2c6f7a,[_0xeaa0('0x3c'),_0x420ceb[_0xeaa0('0x3d')]['toString']()]))return _0x420ceb[_0xeaa0('0x36')]=!![];if(!_0x420ceb[_0xeaa0('0x36')])return _0x420ceb[_0xeaa0('0x37')]=!![];}function getVoiceQueueAgents(_0x4d0650,_0xa8b99a,_0x2606f2,_0x208ba6){var _0x8274ec=_[_0xeaa0('0x38')](_0xa8b99a,['id',_0x4d0650['id']]);if(!_0x8274ec)return _0x4d0650;return _0x8274ec[_0xeaa0('0x3e')]({'raw':!![]})[_0xeaa0('0x11')](function(_0x4ace4c){for(var _0x5ab6bf=0x0;_0x5ab6bf<_0x4ace4c[_0xeaa0('0x3a')];_0x5ab6bf++){var _0x5932e7=_['find'](_0x2606f2,['id',_0x4ace4c[_0x5ab6bf][_0xeaa0('0x3f')]]);if(!_0x5932e7){_0x5932e7={'id':_0x4ace4c[_0x5ab6bf][_0xeaa0('0x3f')],'name':_0x4ace4c[_0x5ab6bf][_0xeaa0('0x3f')],'accountcode':'','online':![]};}var _0x4e6157={'id':_0x5932e7['id'],'name':_0x5932e7['name'],'internal':_0x5932e7[_0xeaa0('0x40')],'online':Boolean(_0x5932e7[_0xeaa0('0x41')]),'paused':Boolean(_0x4ace4c[_0x5ab6bf][_0xeaa0('0x20')])};if(_0x5932e7['voiceStatus']===_0xeaa0('0x36'))updateAgentVoiceStatus(_0x4e6157,_0x4d0650,_0x208ba6);if(_0x4e6157[_0xeaa0('0x41')])_0x4d0650['loggedInDb']++;if(_0x4e6157[_0xeaa0('0x37')])_0x4d0650[_0xeaa0('0x37')]++;if(_0x4e6157['paused']&&!_0x4e6157[_0xeaa0('0x37')]&&!_0x4e6157[_0xeaa0('0x36')])_0x4d0650[_0xeaa0('0x20')]++;_0x4d0650['agents'][_0xeaa0('0x22')](_0x4e6157);}return _0x4d0650;});}function getQueueAgents(_0x56a509,_0x3cefbd,_0x4fe299){var _0x309fce=_0xeaa0('0x42')+_['startCase'](_0x4fe299)+_0xeaa0('0x43');var _0x5a7560=_0x4fe299+_0xeaa0('0x44');return db[_0x309fce][_0xeaa0('0x45')]({'where':{[_[_0xeaa0('0x46')](_0x4fe299)+_0xeaa0('0x47')]:_0x56a509['id']},'raw':!![]})[_0xeaa0('0x11')](function(_0x5b75b8){for(var _0x293a08=0x0;_0x293a08<_0x5b75b8[_0xeaa0('0x3a')];_0x293a08++){var _0xebc904=_['find'](_0x3cefbd,['id',_0x5b75b8[_0x293a08][_0xeaa0('0x3f')]]);if(!_0xebc904){_0xebc904={'id':_0x5b75b8[_0x293a08][_0xeaa0('0x3f')],'name':_0x5b75b8[_0x293a08][_0xeaa0('0x3f')],'online':![],['pauseField']:![]};}var _0x436641={'id':_0xebc904['id'],'name':_0xebc904[_0xeaa0('0xf')],'online':Boolean(_0xebc904['online']),'paused':Boolean(_0xebc904[_0x5a7560])};if(_0x436641[_0xeaa0('0x41')])_0x56a509[_0xeaa0('0x35')]++;_0x56a509[_0xeaa0('0x48')][_0xeaa0('0x22')](_0x436641);}return _0x56a509;});}function isIdle(_0x4fb1b8){return _0x4fb1b8==='idle'||_0x4fb1b8===_0xeaa0('0x49')||_0x4fb1b8==='unavailable'||_0x4fb1b8===_0xeaa0('0x4a')||_[_0xeaa0('0x4b')](_0x4fb1b8);}function isAgentPaused(_0x3c6f6a,_0x354b7b){var _0x1b8670=[_0x3c6f6a['chatPause'],_0x3c6f6a[_0xeaa0('0x4c')],_0x3c6f6a[_0xeaa0('0x4d')],_0x3c6f6a[_0xeaa0('0x4e')],_0x3c6f6a[_0xeaa0('0x4f')],_0x3c6f6a[_0xeaa0('0x50')],_0x3c6f6a['whatsappPause']];if(!_0x354b7b)return _[_0xeaa0('0x51')](_0x1b8670);var _0x1f0542=_[_0xeaa0('0x52')](_0x1b8670);return _0x1f0542['length']>0x0&&_0x1f0542[_0xeaa0('0x3a')]<_0x1b8670[_0xeaa0('0x3a')]?!![]:![];}function isAgentIdle(_0x2bd661){if(_0x2bd661[_0xeaa0('0x53')]!==_0xeaa0('0x54')&&_0x2bd661[_0xeaa0('0x50')]){_0x2bd661[_0xeaa0('0x53')]='pause';return![];}return _['every']([_0x2bd661['chatStatus'],_0x2bd661[_0xeaa0('0x55')],_0x2bd661[_0xeaa0('0x56')],_0x2bd661[_0xeaa0('0x57')],_0x2bd661[_0xeaa0('0x58')],_0x2bd661[_0xeaa0('0x53')],_0x2bd661[_0xeaa0('0x59')]],isIdle);}function getAgentStatus(_0x22b7cc){var _0xfc1446='unknown';if(isAgentPaused(_0x22b7cc))_0xfc1446=_0xeaa0('0x5a');else if(isAgentPaused(_0x22b7cc,!![]))_0xfc1446=_0xeaa0('0x5b');else if(isAgentIdle(_0x22b7cc))_0xfc1446=_0xeaa0('0x54');else _0xfc1446=_0xeaa0('0x37');return _0xfc1446;}function validateChannel(_0x450a67){var _0x4295f2=[_0xeaa0('0x5c'),'chat',_0xeaa0('0x5d'),_0xeaa0('0x5e'),_0xeaa0('0x5f'),_0xeaa0('0x60'),'voice'];if(!_[_0xeaa0('0x61')](_0x4295f2,_0x450a67[_0xeaa0('0x62')]()))throw new Error(_0xeaa0('0x63'));return _0x450a67[_0xeaa0('0x62')]();}function getFilteredAgentIds(_0x57d39a,_0x4479cd){var _0x4b7240=_['isArray'](_0x57d39a)?_0x57d39a:[_0x57d39a];var _0x3b17ca=_[_0xeaa0('0x34')](_0x4b7240,function(_0x480703){return db[_0x4479cd][_0xeaa0('0x64')]({'where':{'name':_0x480703}})[_0xeaa0('0x11')](function(_0x25bd76){if(!_0x25bd76)return[];return _0x25bd76[_0xeaa0('0x65')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xeaa0('0x66')](_0x3b17ca)[_0xeaa0('0x11')](function(_0x278e57){var _0x16d6d6=_(_0x278e57)[_0xeaa0('0x67')]()[_0xeaa0('0x34')]('id')[_0xeaa0('0x68')]()['value']();return _0x16d6d6;});}function getUpdatedSortOptions(_0x472200){var _0x553ac1={'fields':[],'order':null};var _0x21b3b4=_0x472200[_0xeaa0('0x69')](',');_0x553ac1[_0xeaa0('0x6a')]=_[_0xeaa0('0x52')](_0x21b3b4,function(_0xdc34c1){if(!_0xdc34c1[_0xeaa0('0x61')](_0xeaa0('0x6b')))return!![];_0x553ac1[_0xeaa0('0x6c')]=_[_0xeaa0('0x6d')](_0xdc34c1,'-')?_0xeaa0('0x6e'):_0xeaa0('0x6f');return![];});return _0x553ac1;}function orderAgentsByStatus(_0x1ceae6,_0x37044b){return _0x1ceae6['sort'](function(_0x83e4e2,_0x236d08){if(_0x83e4e2[_0xeaa0('0x6b')]===_0x236d08[_0xeaa0('0x6b')]&&_0x83e4e2['globalStatus']===_0xeaa0('0x5a')){if(_0x37044b===_0xeaa0('0x6e'))return(_0x83e4e2[_0xeaa0('0x70')]||'')<(_0x236d08['pauseType']||'')?0x1:-0x1;return _0x83e4e2[_0xeaa0('0x70')]<_0x236d08[_0xeaa0('0x70')]?-0x1:0x1;}else{if(_0x37044b===_0xeaa0('0x6e'))return _0x83e4e2[_0xeaa0('0x6b')]<_0x236d08[_0xeaa0('0x6b')]?0x1:-0x1;return _0x83e4e2[_0xeaa0('0x6b')]<_0x236d08[_0xeaa0('0x6b')]?-0x1:0x1;}});}exports[_0xeaa0('0x65')]=function(_0x1ee363,_0x1c2434){var _0x1b2ba3={'count':0x0,'rows':[]},_0xac8e04={},_0x38f0fb,_0x41a05e,_0x2f33df,_0x34fc50,_0x295078=[_0xeaa0('0x71'),_0xeaa0('0x41'),_0xeaa0('0x72'),_0xeaa0('0x73'),'pauseType',_0xeaa0('0x73'),_0xeaa0('0x3d'),_0xeaa0('0x74'),_0xeaa0('0x75'),_0xeaa0('0x4e'),_0xeaa0('0x4d'),_0xeaa0('0x4f'),_0xeaa0('0x76'),_0xeaa0('0x4c'),_0xeaa0('0x50'),_0xeaa0('0x77'),_0xeaa0('0x78'),_0xeaa0('0x79'),'smsCapacity',_0xeaa0('0x7a'),_0xeaa0('0x7b'),'chatCurrentCapacity',_0xeaa0('0x7c'),'mailCurrentCapacity',_0xeaa0('0x7d'),_0xeaa0('0x7e'),_0xeaa0('0x7f'),_0xeaa0('0x80'),_0xeaa0('0x57'),_0xeaa0('0x56'),'smsStatus',_0xeaa0('0x59'),_0xeaa0('0x55'),'voiceStatus',_0xeaa0('0x81'),'openchannelStatusTime',_0xeaa0('0x82'),_0xeaa0('0x83'),_0xeaa0('0x84'),_0xeaa0('0x85'),_0xeaa0('0x86'),_0xeaa0('0x39'),_0xeaa0('0x87'),_0xeaa0('0x88'),_0xeaa0('0x89'),'phoneBarEnableAutomaticScreenRecording',_0xeaa0('0x8a')],_0x67dbf6=['chatPause',_0xeaa0('0x4e'),_0xeaa0('0x4d'),_0xeaa0('0x4f'),_0xeaa0('0x76'),_0xeaa0('0x4c'),'voicePause',_0xeaa0('0x41')];Promise['resolve']()[_0xeaa0('0x11')](function(){if(_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0x8c')])_0x38f0fb=validateChannel(_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0x8c')]);if(!_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0x8d')]||!_0x1ee363['query'][_0xeaa0('0x8d')][_0xeaa0('0x61')](_0xeaa0('0x6b')))return;var _0x45dad9=getUpdatedSortOptions(_0x1ee363['query'][_0xeaa0('0x8d')]);_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0x8d')]=_0x45dad9[_0xeaa0('0x6a')][_0xeaa0('0x8e')](',');_0x41a05e=_0x45dad9[_0xeaa0('0x6c')];})['then'](function(){if(!_0x1ee363['query'][_0xeaa0('0x8f')])return[];var _0x385dc5=_[_0xeaa0('0x46')](_0x38f0fb)+_0xeaa0('0x43');return getFilteredAgentIds(_0x1ee363[_0xeaa0('0x8b')]['globalQueueFilter'],_0x385dc5);})[_0xeaa0('0x11')](function(_0x144aa6){var _0x4428f8=_['map'](db['User'][_0xeaa0('0x90')],function(_0x100f97){return{'name':_0x100f97[_0xeaa0('0x91')],'type':_0x100f97['type'][_0xeaa0('0x92')]};});_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0x93')]='agent';_0x1ee363[_0xeaa0('0x8b')]['online']=!![];_0xac8e04=qs[_0xeaa0('0x94')](_0x4428f8,_0x1ee363);_0xac8e04[_0xeaa0('0x95')]=!![];if(!_['isEmpty'](_0x144aa6)){_0xac8e04[_0xeaa0('0x96')]=_['merge'](_0xac8e04[_0xeaa0('0x96')],{'$and':[{'id':{'$in':_0x144aa6}}]});}else if(!_[_0xeaa0('0x97')](_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0x8f')])){return _0x1b2ba3;}if(_0x1ee363[_0xeaa0('0x98')][_0xeaa0('0x93')]===_0xeaa0('0x98')){var _0x8a424a={'params':{'id':_0x1ee363[_0xeaa0('0x98')][_0xeaa0('0x99')]},'query':{'section':'Agents','role':'agent','online':!![],'nolimit':_0x1ee363['query'][_0xeaa0('0x9a')],'sort':_0x1ee363['query']['sort'],'filter':_0x1ee363['query'][_0xeaa0('0x52')],'raw':!![],'ids':_0x144aa6}};return db['UserProfile'][_0xeaa0('0x9b')](_0x8a424a);}return db[_0xeaa0('0x42')][_0xeaa0('0x9c')](_0xac8e04);})[_0xeaa0('0x11')](function(_0x414d6a){_0x1b2ba3[_0xeaa0('0x9')]=_0x414d6a[_0xeaa0('0x9')];_0x2f33df=_0x414d6a[_0xeaa0('0x9d')];return getRealtimeAgents();})[_0xeaa0('0x11')](function(_0xa18179){_0x34fc50=_0xa18179[_0xeaa0('0x9d')];return _0x2f33df['map'](function(_0xfae751){var _0x3bf212=_[_0xeaa0('0x38')](_0x34fc50,['id',_0xfae751['id']]);if(_0x3bf212)_[_0xeaa0('0x17')](_0xfae751,_['pick'](_[_0xeaa0('0x9e')](_0x3bf212,_0x67dbf6),_0x295078));_0xfae751[_0xeaa0('0x6b')]=getAgentStatus(_0xfae751);return _0xfae751;});})[_0xeaa0('0x11')](function(_0x44c648){var _0x18f4da;if(_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0x9f')]){_0x18f4da=_['filter'](_0x44c648,[_0xeaa0('0x6b'),_0x1ee363['query'][_0xeaa0('0x9f')]]);if(_0x1ee363[_0xeaa0('0x8b')]['pauseTypeFilter']){_0x18f4da=_[_0xeaa0('0x52')](_0x18f4da,['pauseType',_0x1ee363[_0xeaa0('0x8b')][_0xeaa0('0xa0')]]);}}if(_0x18f4da)_0x44c648=_0x18f4da;if(!_0x41a05e)return _0x44c648;return orderAgentsByStatus(_0x44c648,_0x41a05e);})['then'](function(_0xa25cfa){_0x1b2ba3[_0xeaa0('0x9d')]=_0xa25cfa;return _0x1b2ba3;})[_0xeaa0('0x11')](respondWithFilteredResult(_0x1c2434,_0xac8e04))[_0xeaa0('0x18')](handleError(_0x1c2434,null));};exports['getQueues']=function(_0x2328c0,_0xf93684){var _0x584eea={'count':0x0,'rows':[]},_0x36fc42={},_0x348f4c,_0x121f94,_0x1dc64a,_0x50d432,_0x2ba7f0;Promise[_0xeaa0('0xa1')]()[_0xeaa0('0x11')](function(){if(_0x2328c0[_0xeaa0('0x8b')][_0xeaa0('0x8c')])_0x348f4c=validateChannel(_0x2328c0[_0xeaa0('0x8b')][_0xeaa0('0x8c')]);var _0x1072c9=_[_0xeaa0('0x46')](_0x348f4c)+_0xeaa0('0x43');var _0x4a4d8f=_[_0xeaa0('0x34')](db[_0x1072c9][_0xeaa0('0x90')],function(_0x17e4cd){return{'name':_0x17e4cd[_0xeaa0('0x91')],'type':_0x17e4cd[_0xeaa0('0xa2')][_0xeaa0('0x92')]};});_0x36fc42=qs['getOptions'](_0x4a4d8f,_0x2328c0);if(_0x2328c0[_0xeaa0('0x98')][_0xeaa0('0x93')]===_0xeaa0('0x98')){var _0x54a7ac={'params':{'id':_0x2328c0['user'][_0xeaa0('0x99')]},'query':{'section':_0x348f4c==='voice'&&_0x2328c0[_0xeaa0('0x8b')][_0xeaa0('0xa2')]===_0xeaa0('0x21')?_0xeaa0('0xa3'):_[_0xeaa0('0x46')](_0x348f4c)+_0xeaa0('0xa4'),'type':_0x2328c0[_0xeaa0('0x8b')][_0xeaa0('0xa2')],'nolimit':!![],'sort':_0xeaa0('0xf'),'filter':_0x2328c0['query']['filter']}};return db[_0xeaa0('0xa5')][_0xeaa0('0x9b')](_0x54a7ac);}return db[_0x1072c9]['findAndCountAll'](_0x36fc42);})[_0xeaa0('0x11')](function(_0x3c3b0e){_0x584eea[_0xeaa0('0x9')]=_0x3c3b0e[_0xeaa0('0x9')];_0x121f94=_0x3c3b0e[_0xeaa0('0x9d')];return getRealtimeQueues(_0x2328c0,_0x348f4c);})[_0xeaa0('0x11')](function(_0x23bd95){_0x50d432=_0x23bd95[_0xeaa0('0x9d')];return getRealtimeAgents();})[_0xeaa0('0x11')](function(_0x403fd4){_0x1dc64a=_0x403fd4['rows'];if(_0x348f4c!=_0xeaa0('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0xeaa0('0x11')](function(_0x1136d4){_0x2ba7f0=_0x1136d4?_0x1136d4[_0xeaa0('0x9d')]:[];return initializeQueues(_0x121f94,_0x50d432,_0x348f4c,_0x2328c0[_0xeaa0('0x8b')][_0xeaa0('0xa2')]);})[_0xeaa0('0x11')](function(_0x2aeefa){var _0x462796=_0x2aeefa[_0xeaa0('0x34')](function(_0x31246b){if(_0x348f4c===_0xeaa0('0x19'))return getVoiceQueueAgents(_0x31246b,_0x121f94,_0x1dc64a,_0x2ba7f0);else return getQueueAgents(_0x31246b,_0x1dc64a,_0x348f4c);});return Promise[_0xeaa0('0x66')](_0x462796);})[_0xeaa0('0x11')](function(_0x49ea8c){_0x584eea[_0xeaa0('0x9d')]=_0x49ea8c;return _0x584eea;})[_0xeaa0('0x11')](respondWithFilteredResult(_0xf93684,_0x36fc42))['catch'](handleError(_0xf93684,null));}; \ No newline at end of file +var _0x9223=['faxPause','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','query','channel','sort','join','order','globalQueueFilter','Queue','rawAttributes','fieldName','key','agent','getOptions','raw','isEmpty','where','user','userProfileId','nolimit','UserProfile','rows','pick','omit','globalStatusFilter','pauseTypeFilter','getQueues','type','QueueCampaigns','findAndCountAll','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','count','limit','set','json','stack','name','send','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','paused','voice','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','get','agents','loggedInDb','filter','queue','length','some','connectedlinenum','internal','toString','find','getMembers','UserId','online','busy','User','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','mailPause','openchannelPause','smsPause','voicePause','every','voiceStatus','pause','faxStatus','mailStatus','smsStatus','whatsappStatus','*pause','mail','chat','openchannel','fax','whatsapp','includes','Invalid\x20channel','toLowerCase','isArray','map','findOne','getAgents','all','flatten','uniq','globalStatus','startsWith','DESC','ASC','pauseType','userpic','lastLoginAt','lastPauseAt','address'];(function(_0x592cbc,_0x5ec030){var _0x39b8d9=function(_0x39055c){while(--_0x39055c){_0x592cbc['push'](_0x592cbc['shift']());}};_0x39b8d9(++_0x5ec030);}(_0x9223,0x17d));var _0x3922=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9223[_0x334841];return _0x5beb4b;};'use strict';var util=require('util');var _=require(_0x3922('0x0'));var jayson=require(_0x3922('0x1'));var qs=require(_0x3922('0x2'));var logger=require(_0x3922('0x3'))(_0x3922('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x3922('0x5')][_0x3922('0x6')]({'port':0x232a});var routingClient=jayson[_0x3922('0x5')][_0x3922('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x1d9a95,_0x4e0d97){return function(_0x5bfb3d){if(_0x5bfb3d){var _0x180a3b=typeof _0x4e0d97[_0x3922('0x7')]==='undefined'&&typeof _0x4e0d97['limit']===_0x3922('0x8');var _0x122367=_0x5bfb3d[_0x3922('0x9')];var _0x90b54f=_0x180a3b?0x0:_0x4e0d97[_0x3922('0x7')];var _0x46f287=_0x180a3b?_0x5bfb3d[_0x3922('0x9')]:_0x4e0d97['offset']+_0x4e0d97[_0x3922('0xa')];var _0x347735;if(_0x46f287>=_0x122367){_0x46f287=_0x122367;_0x347735=0xc8;}else{_0x347735=0xce;}_0x1d9a95['status'](_0x347735);return _0x1d9a95[_0x3922('0xb')]('Content-Range',_0x90b54f+'-'+_0x46f287+'/'+_0x122367)[_0x3922('0xc')](_0x5bfb3d);}return null;};}function handleError(_0x18107a,_0x4a3995){_0x4a3995=_0x4a3995||0x1f4;return function(_0x12d60e){logger['error'](_0x12d60e[_0x3922('0xd')]);if(_0x12d60e[_0x3922('0xe')]){delete _0x12d60e[_0x3922('0xe')];}_0x18107a['status'](_0x4a3995)[_0x3922('0xf')](_0x12d60e);};}function getRealtimeAgents(){return new Promise(function(_0x396036,_0x780a8e){return amiClient[_0x3922('0x10')](_0x3922('0x11'),{})[_0x3922('0x12')](function(_0x19b454){if(_0x19b454[_0x3922('0x13')])throw new Error(_0x3922('0x14'));var _0x4e8c0f=_0x19b454[_0x3922('0x15')];return routingClient[_0x3922('0x10')]('Agents',{})['then'](function(_0x3c7a1a){if(_0x3c7a1a['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x147844=_0x3c7a1a['result'];return _0x396036(_[_0x3922('0x16')]({},_0x4e8c0f,_0x147844));});})[_0x3922('0x17')](function(_0x15e89f){_0x780a8e(_0x15e89f);});});}function getRealtimeQueues(_0x1a68c2,_0x42d07e){return new Promise(function(_0x1f5f60,_0x122b56){var _0x1cd774=_0x42d07e==='voice'?amiClient:routingClient;return _0x1cd774[_0x3922('0x10')](_[_0x3922('0x18')](_0x42d07e)+_0x3922('0x19'),_0x1a68c2)[_0x3922('0x12')](function(_0x296a00){if(_0x296a00['error'])throw new Error(util[_0x3922('0x1a')](_0x3922('0x1b'),_0x42d07e));return _0x1f5f60(_0x296a00['result']);})[_0x3922('0x17')](function(_0x464fb9){_0x122b56(_0x464fb9);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x176416,_0x472183){return amiClient[_0x3922('0x10')]('VoiceQueuesChannels',{})['then'](function(_0x31577d){if(_0x31577d[_0x3922('0x13')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x176416(_0x31577d['result']);})['catch'](function(_0x4cda75){_0x472183(_0x4cda75);});});}function initializeQueues(_0x28fc14,_0x1a5850,_0x37c521,_0x92fda9){var _0x118daf=[_0x3922('0x1c'),_0x3922('0x1d'),_0x3922('0x1e'),_0x3922('0x1f'),_0x3922('0x20')];if(_0x37c521===_0x3922('0x21')&&_0x92fda9===_0x3922('0x22')){_0x118daf[_0x3922('0x23')](_0x3922('0x24'),_0x3922('0x25'),_0x3922('0x26'),_0x3922('0x27'),_0x3922('0x28'),_0x3922('0x29'),_0x3922('0x2a'),_0x3922('0x2b'),_0x3922('0x2c'),_0x3922('0x2d'),_0x3922('0x2e'),_0x3922('0x2f'),_0x3922('0x30'),_0x3922('0x31'),_0x3922('0x32'),_0x3922('0x33'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x3922('0x34'),'predictiveIntervalDroppedCallsCallersExit',_0x3922('0x35'),'predictiveIntervalAvgTalktime');}return _0x28fc14['map'](function(_0x13e2ca){var _0x5a49b1=_0x13e2ca[_0x3922('0x36')]({'plain':!![]});_0x5a49b1[_0x3922('0x37')]=[];_0x5a49b1[_0x3922('0x20')]=0x0;_0x5a49b1[_0x3922('0x38')]=0x0;_0x5a49b1[_0x3922('0x1c')]=0x0;_0x5a49b1[_0x3922('0x1d')]=0x0;_0x5a49b1[_0x3922('0x1e')]=0x0;if(_0x37c521===_0x3922('0x21')){_0x5a49b1[_0x3922('0x1f')]=0x0;_0x5a49b1['busy']=0x0;if(_0x92fda9===_0x3922('0x22')){_0x5a49b1[_0x3922('0x24')]=0x0;_0x5a49b1[_0x3922('0x25')]=0x0;}}var _0x165559=_['find'](_0x1a5850,['id',_0x5a49b1['id']]);if(_0x165559)_[_0x3922('0x16')](_0x5a49b1,_['pick'](_0x165559,_0x118daf));return _0x5a49b1;});}function updateAgentVoiceStatus(_0x335082,_0x3cd8ad,_0x3b9f9b){var _0x138861=_[_0x3922('0x39')](_0x3b9f9b,[_0x3922('0x3a'),_0x3cd8ad['name']]);if(_0x138861[_0x3922('0x3b')]===0x0)return _0x335082['busy']=!![];if(_[_0x3922('0x3c')](_0x138861,[_0x3922('0x3d'),_0x335082[_0x3922('0x3e')][_0x3922('0x3f')]()]))return _0x335082[_0x3922('0x1f')]=!![];if(!_0x335082['talking'])return _0x335082['busy']=!![];}function getVoiceQueueAgents(_0x28564b,_0x145c1c,_0x53b2d7,_0x2f73d3){var _0x5247b7=_[_0x3922('0x40')](_0x145c1c,['id',_0x28564b['id']]);if(!_0x5247b7)return _0x28564b;return _0x5247b7[_0x3922('0x41')]({'raw':!![]})[_0x3922('0x12')](function(_0x37e43d){for(var _0x1ef7ba=0x0;_0x1ef7ba<_0x37e43d[_0x3922('0x3b')];_0x1ef7ba++){var _0x9f28f3=_[_0x3922('0x40')](_0x53b2d7,['id',_0x37e43d[_0x1ef7ba]['UserId']]);if(!_0x9f28f3){_0x9f28f3={'id':_0x37e43d[_0x1ef7ba][_0x3922('0x42')],'name':_0x37e43d[_0x1ef7ba][_0x3922('0x42')],'accountcode':'','online':![]};}var _0x597565={'id':_0x9f28f3['id'],'name':_0x9f28f3['name'],'internal':_0x9f28f3['accountcode'],'online':Boolean(_0x9f28f3[_0x3922('0x43')]),'paused':Boolean(_0x37e43d[_0x1ef7ba]['paused'])};if(_0x9f28f3['voiceStatus']===_0x3922('0x1f'))updateAgentVoiceStatus(_0x597565,_0x28564b,_0x2f73d3);if(_0x597565[_0x3922('0x43')])_0x28564b[_0x3922('0x38')]++;if(_0x597565[_0x3922('0x44')])_0x28564b[_0x3922('0x44')]++;if(_0x597565['paused']&&!_0x597565[_0x3922('0x44')]&&!_0x597565[_0x3922('0x1f')])_0x28564b[_0x3922('0x20')]++;_0x28564b[_0x3922('0x37')][_0x3922('0x23')](_0x597565);}return _0x28564b;});}function getQueueAgents(_0x5c9f10,_0x3ca0e3,_0x2aa5c9){var _0x3633af=_0x3922('0x45')+_['startCase'](_0x2aa5c9)+'Queue';var _0xbe2875=_0x2aa5c9+'Pause';return db[_0x3633af][_0x3922('0x46')]({'where':{[_[_0x3922('0x18')](_0x2aa5c9)+_0x3922('0x47')]:_0x5c9f10['id']},'raw':!![]})[_0x3922('0x12')](function(_0x250be8){for(var _0x11aeaa=0x0;_0x11aeaa<_0x250be8['length'];_0x11aeaa++){var _0x34427a=_[_0x3922('0x40')](_0x3ca0e3,['id',_0x250be8[_0x11aeaa][_0x3922('0x42')]]);if(!_0x34427a){_0x34427a={'id':_0x250be8[_0x11aeaa][_0x3922('0x42')],'name':_0x250be8[_0x11aeaa][_0x3922('0x42')],'online':![],['pauseField']:![]};}var _0x14fa10={'id':_0x34427a['id'],'name':_0x34427a['name'],'online':Boolean(_0x34427a['online']),'paused':Boolean(_0x34427a[_0xbe2875])};if(_0x14fa10[_0x3922('0x43')])_0x5c9f10[_0x3922('0x38')]++;_0x5c9f10[_0x3922('0x37')][_0x3922('0x23')](_0x14fa10);}return _0x5c9f10;});}function isIdle(_0xffc24e){return _0xffc24e===_0x3922('0x48')||_0xffc24e===_0x3922('0x49')||_0xffc24e===_0x3922('0x4a')||_0xffc24e===_0x3922('0x4b')||_[_0x3922('0x4c')](_0xffc24e);}function isAgentPaused(_0x4f0914,_0x3567f2){var _0x46b17d=[_0x4f0914[_0x3922('0x4d')],_0x4f0914['faxPause'],_0x4f0914[_0x3922('0x4e')],_0x4f0914[_0x3922('0x4f')],_0x4f0914[_0x3922('0x50')],_0x4f0914[_0x3922('0x51')],_0x4f0914['whatsappPause']];if(!_0x3567f2)return _[_0x3922('0x52')](_0x46b17d);var _0xd639fe=_['filter'](_0x46b17d);return _0xd639fe['length']>0x0&&_0xd639fe[_0x3922('0x3b')]<_0x46b17d[_0x3922('0x3b')]?!![]:![];}function isAgentIdle(_0x3ccbca){if(_0x3ccbca['voiceStatus']!=='idle'&&_0x3ccbca['voicePause']){_0x3ccbca[_0x3922('0x53')]=_0x3922('0x54');return![];}return _[_0x3922('0x52')]([_0x3ccbca['chatStatus'],_0x3ccbca[_0x3922('0x55')],_0x3ccbca[_0x3922('0x56')],_0x3ccbca['openchannelStatus'],_0x3ccbca[_0x3922('0x57')],_0x3ccbca[_0x3922('0x53')],_0x3ccbca[_0x3922('0x58')]],isIdle);}function getAgentStatus(_0x4c1925){var _0x3b373f=_0x3922('0x49');if(isAgentPaused(_0x4c1925))_0x3b373f=_0x3922('0x54');else if(isAgentPaused(_0x4c1925,!![]))_0x3b373f=_0x3922('0x59');else if(isAgentIdle(_0x4c1925))_0x3b373f=_0x3922('0x48');else _0x3b373f=_0x3922('0x44');return _0x3b373f;}function validateChannel(_0x4333d7){var _0x588ff1=[_0x3922('0x5a'),_0x3922('0x5b'),'sms',_0x3922('0x5c'),_0x3922('0x5d'),_0x3922('0x5e'),'voice'];if(!_[_0x3922('0x5f')](_0x588ff1,_0x4333d7['toLowerCase']()))throw new Error(_0x3922('0x60'));return _0x4333d7[_0x3922('0x61')]();}function getFilteredAgentIds(_0x24c0d1,_0x2e4893){var _0x4259cd=_[_0x3922('0x62')](_0x24c0d1)?_0x24c0d1:[_0x24c0d1];var _0x346020=_[_0x3922('0x63')](_0x4259cd,function(_0x46d6fb){return db[_0x2e4893][_0x3922('0x64')]({'where':{'name':_0x46d6fb}})[_0x3922('0x12')](function(_0x1bf123){if(!_0x1bf123)return[];return _0x1bf123[_0x3922('0x65')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x3922('0x66')](_0x346020)[_0x3922('0x12')](function(_0x514046){var _0x122add=_(_0x514046)[_0x3922('0x67')]()[_0x3922('0x63')]('id')[_0x3922('0x68')]()['value']();return _0x122add;});}function getUpdatedSortOptions(_0x2b436b){var _0x39b0e1={'fields':[],'order':null};var _0x9138ec=_0x2b436b['split'](',');_0x39b0e1['fields']=_[_0x3922('0x39')](_0x9138ec,function(_0x1ceaa4){if(!_0x1ceaa4[_0x3922('0x5f')](_0x3922('0x69')))return!![];_0x39b0e1['order']=_[_0x3922('0x6a')](_0x1ceaa4,'-')?_0x3922('0x6b'):_0x3922('0x6c');return![];});return _0x39b0e1;}function orderAgentsByStatus(_0x5750f6,_0x541da5){return _0x5750f6['sort'](function(_0x15cd4e,_0x1e5cd0){if(_0x15cd4e[_0x3922('0x69')]===_0x1e5cd0['globalStatus']&&_0x15cd4e[_0x3922('0x69')]===_0x3922('0x54')){if(_0x541da5===_0x3922('0x6b'))return(_0x15cd4e[_0x3922('0x6d')]||'')<(_0x1e5cd0[_0x3922('0x6d')]||'')?0x1:-0x1;return _0x15cd4e[_0x3922('0x6d')]<_0x1e5cd0[_0x3922('0x6d')]?-0x1:0x1;}else{if(_0x541da5==='DESC')return _0x15cd4e[_0x3922('0x69')]<_0x1e5cd0[_0x3922('0x69')]?0x1:-0x1;return _0x15cd4e['globalStatus']<_0x1e5cd0[_0x3922('0x69')]?-0x1:0x1;}});}exports[_0x3922('0x65')]=function(_0x38c530,_0x50b703){var _0x1a8d4f={'count':0x0,'rows':[]},_0x3ef027={},_0x4df49c,_0x3b546a,_0x1bdd42,_0xb11cfc,_0x32d017=[_0x3922('0x6e'),'online',_0x3922('0x6f'),_0x3922('0x70'),_0x3922('0x6d'),'lastPauseAt',_0x3922('0x3e'),_0x3922('0x71'),_0x3922('0x4d'),_0x3922('0x4f'),_0x3922('0x4e'),_0x3922('0x50'),'whatsappPause',_0x3922('0x72'),'voicePause',_0x3922('0x73'),_0x3922('0x74'),_0x3922('0x75'),'smsCapacity','whatsappCapacity',_0x3922('0x76'),_0x3922('0x77'),_0x3922('0x78'),'mailCurrentCapacity',_0x3922('0x79'),_0x3922('0x7a'),_0x3922('0x7b'),'chatStatus',_0x3922('0x7c'),'mailStatus',_0x3922('0x57'),'whatsappStatus','faxStatus',_0x3922('0x53'),_0x3922('0x7d'),_0x3922('0x7e'),_0x3922('0x7f'),_0x3922('0x80'),_0x3922('0x81'),_0x3922('0x82'),_0x3922('0x83'),_0x3922('0x3a'),_0x3922('0x84'),_0x3922('0x85'),_0x3922('0x86'),_0x3922('0x87'),'routealias'],_0x192d2f=['chatPause',_0x3922('0x4f'),'mailPause',_0x3922('0x50'),'whatsappPause',_0x3922('0x72'),_0x3922('0x51'),'online'];Promise[_0x3922('0x88')]()[_0x3922('0x12')](function(){if(_0x38c530[_0x3922('0x89')][_0x3922('0x8a')])_0x4df49c=validateChannel(_0x38c530['query']['channel']);if(!_0x38c530[_0x3922('0x89')][_0x3922('0x8b')]||!_0x38c530['query'][_0x3922('0x8b')][_0x3922('0x5f')](_0x3922('0x69')))return;var _0x432231=getUpdatedSortOptions(_0x38c530[_0x3922('0x89')][_0x3922('0x8b')]);_0x38c530[_0x3922('0x89')][_0x3922('0x8b')]=_0x432231['fields'][_0x3922('0x8c')](',');_0x3b546a=_0x432231[_0x3922('0x8d')];})[_0x3922('0x12')](function(){if(!_0x38c530[_0x3922('0x89')][_0x3922('0x8e')])return[];var _0x392218=_[_0x3922('0x18')](_0x4df49c)+_0x3922('0x8f');return getFilteredAgentIds(_0x38c530['query']['globalQueueFilter'],_0x392218);})[_0x3922('0x12')](function(_0x57596f){var _0x3577a2=_[_0x3922('0x63')](db[_0x3922('0x45')][_0x3922('0x90')],function(_0x5925b5){return{'name':_0x5925b5[_0x3922('0x91')],'type':_0x5925b5['type'][_0x3922('0x92')]};});_0x38c530[_0x3922('0x89')]['role']=_0x3922('0x93');_0x38c530[_0x3922('0x89')]['online']=!![];_0x3ef027=qs[_0x3922('0x94')](_0x3577a2,_0x38c530);_0x3ef027[_0x3922('0x95')]=!![];if(!_[_0x3922('0x96')](_0x57596f)){_0x3ef027[_0x3922('0x97')]=_[_0x3922('0x16')](_0x3ef027['where'],{'$and':[{'id':{'$in':_0x57596f}}]});}else if(!_[_0x3922('0x96')](_0x38c530[_0x3922('0x89')][_0x3922('0x8e')])){return _0x1a8d4f;}if(_0x38c530[_0x3922('0x98')]['role']===_0x3922('0x98')){var _0x47563f={'params':{'id':_0x38c530[_0x3922('0x98')][_0x3922('0x99')]},'query':{'section':_0x3922('0x11'),'role':_0x3922('0x93'),'online':!![],'nolimit':_0x38c530[_0x3922('0x89')][_0x3922('0x9a')],'sort':_0x38c530[_0x3922('0x89')][_0x3922('0x8b')],'filter':_0x38c530[_0x3922('0x89')][_0x3922('0x39')],'raw':!![],'ids':_0x57596f}};return db[_0x3922('0x9b')]['getResources'](_0x47563f);}return db[_0x3922('0x45')]['findAndCountAll'](_0x3ef027);})['then'](function(_0x28495b){_0x1a8d4f['count']=_0x28495b[_0x3922('0x9')];_0x1bdd42=_0x28495b[_0x3922('0x9c')];return getRealtimeAgents();})[_0x3922('0x12')](function(_0x266528){_0xb11cfc=_0x266528[_0x3922('0x9c')];return _0x1bdd42[_0x3922('0x63')](function(_0x5f5b69){var _0x25ca0e=_['find'](_0xb11cfc,['id',_0x5f5b69['id']]);if(_0x25ca0e)_['merge'](_0x5f5b69,_[_0x3922('0x9d')](_[_0x3922('0x9e')](_0x25ca0e,_0x192d2f),_0x32d017));_0x5f5b69[_0x3922('0x69')]=getAgentStatus(_0x5f5b69);return _0x5f5b69;});})[_0x3922('0x12')](function(_0x5b4e4c){var _0x25a720;if(_0x38c530[_0x3922('0x89')]['globalStatusFilter']){_0x25a720=_[_0x3922('0x39')](_0x5b4e4c,[_0x3922('0x69'),_0x38c530[_0x3922('0x89')][_0x3922('0x9f')]]);if(_0x38c530[_0x3922('0x89')]['pauseTypeFilter']){_0x25a720=_['filter'](_0x25a720,['pauseType',_0x38c530[_0x3922('0x89')][_0x3922('0xa0')]]);}}if(_0x25a720)_0x5b4e4c=_0x25a720;if(!_0x3b546a)return _0x5b4e4c;return orderAgentsByStatus(_0x5b4e4c,_0x3b546a);})[_0x3922('0x12')](function(_0x2f619d){_0x1a8d4f[_0x3922('0x9c')]=_0x2f619d;return _0x1a8d4f;})[_0x3922('0x12')](respondWithFilteredResult(_0x50b703,_0x3ef027))[_0x3922('0x17')](handleError(_0x50b703,null));};exports[_0x3922('0xa1')]=function(_0x42aee6,_0x41b7e0){var _0xff2893={'count':0x0,'rows':[]},_0x4e34eb={},_0x257ed1,_0x101801,_0x59a244,_0x125bca,_0x5c7a66;Promise[_0x3922('0x88')]()[_0x3922('0x12')](function(){if(_0x42aee6['query'][_0x3922('0x8a')])_0x257ed1=validateChannel(_0x42aee6[_0x3922('0x89')]['channel']);var _0x492858=_['startCase'](_0x257ed1)+'Queue';var _0x37a92b=_[_0x3922('0x63')](db[_0x492858][_0x3922('0x90')],function(_0x222d9e){return{'name':_0x222d9e[_0x3922('0x91')],'type':_0x222d9e[_0x3922('0xa2')][_0x3922('0x92')]};});_0x4e34eb=qs['getOptions'](_0x37a92b,_0x42aee6);if(_0x42aee6['user']['role']===_0x3922('0x98')){var _0x166cf0={'params':{'id':_0x42aee6[_0x3922('0x98')][_0x3922('0x99')]},'query':{'section':_0x257ed1===_0x3922('0x21')&&_0x42aee6[_0x3922('0x89')][_0x3922('0xa2')]===_0x3922('0x22')?_0x3922('0xa3'):_['startCase'](_0x257ed1)+_0x3922('0x19'),'type':_0x42aee6[_0x3922('0x89')][_0x3922('0xa2')],'nolimit':!![],'sort':'name','filter':_0x42aee6[_0x3922('0x89')]['filter']}};return db[_0x3922('0x9b')]['getResources'](_0x166cf0);}return db[_0x492858][_0x3922('0xa4')](_0x4e34eb);})[_0x3922('0x12')](function(_0x419852){_0xff2893[_0x3922('0x9')]=_0x419852[_0x3922('0x9')];_0x101801=_0x419852['rows'];return getRealtimeQueues(_0x42aee6,_0x257ed1);})[_0x3922('0x12')](function(_0x14f8f4){_0x125bca=_0x14f8f4[_0x3922('0x9c')];return getRealtimeAgents();})[_0x3922('0x12')](function(_0x1a1cc9){_0x59a244=_0x1a1cc9['rows'];if(_0x257ed1!=_0x3922('0x21'))return;return getRealtimeVoiceQueueChannels();})[_0x3922('0x12')](function(_0x40378c){_0x5c7a66=_0x40378c?_0x40378c[_0x3922('0x9c')]:[];return initializeQueues(_0x101801,_0x125bca,_0x257ed1,_0x42aee6[_0x3922('0x89')][_0x3922('0xa2')]);})['then'](function(_0x249f30){var _0x5dba28=_0x249f30[_0x3922('0x63')](function(_0x1a2fd6){if(_0x257ed1===_0x3922('0x21'))return getVoiceQueueAgents(_0x1a2fd6,_0x101801,_0x59a244,_0x5c7a66);else return getQueueAgents(_0x1a2fd6,_0x59a244,_0x257ed1);});return Promise['all'](_0x5dba28);})[_0x3922('0x12')](function(_0x3ade81){_0xff2893[_0x3922('0x9c')]=_0x3ade81;return _0xff2893;})[_0x3922('0x12')](respondWithFilteredResult(_0x41b7e0,_0x4e34eb))['catch'](handleError(_0x41b7e0,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 95fab3e..9fb8aa2 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x310196,_0x2e76d7){var _0x35aa0a=function(_0x468dfc){while(--_0x468dfc){_0x310196['push'](_0x310196['shift']());}};_0x35aa0a(++_0x2e76d7);}(_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'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4e62d7,_0x4b89c7){var _0x52923f=function(_0x3c05d3){while(--_0x3c05d3){_0x4e62d7['push'](_0x4e62d7['shift']());}};_0x52923f(++_0x4b89c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e2456c3..86510c3 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 _0x176c=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0xb45733,_0x2400ca){var _0x5117f0=function(_0x4c4ff4){while(--_0x4c4ff4){_0xb45733['push'](_0xb45733['shift']());}};_0x5117f0(++_0x2400ca);}(_0x176c,0x134));var _0xc176=function(_0x443cf3,_0x106f66){_0x443cf3=_0x443cf3-0x0;var _0xef7537=_0x176c[_0x443cf3];return _0xef7537;};'use strict';var Sequelize=require(_0xc176('0x0'));module[_0xc176('0x1')]={'state':{'type':Sequelize[_0xc176('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc176('0x3')]},'scheduledat':{'type':Sequelize[_0xc176('0x4')]},'uniqueid':{'type':Sequelize[_0xc176('0x3')]},'starttime':{'type':Sequelize[_0xc176('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc176('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc176('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc176('0x3')]}}; \ No newline at end of file +var _0x3ca4=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x5a37c0,_0x4cf047){var _0x3acce8=function(_0x1c901a){while(--_0x1c901a){_0x5a37c0['push'](_0x5a37c0['shift']());}};_0x3acce8(++_0x4cf047);}(_0x3ca4,0x17d));var _0x43ca=function(_0x16d37a,_0xd4d62c){_0x16d37a=_0x16d37a-0x0;var _0x24881d=_0x3ca4[_0x16d37a];return _0x24881d;};'use strict';var Sequelize=require(_0x43ca('0x0'));module[_0x43ca('0x1')]={'state':{'type':Sequelize[_0x43ca('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x43ca('0x3')]},'starttime':{'type':Sequelize[_0x43ca('0x4')]},'responsetime':{'type':Sequelize[_0x43ca('0x4')]},'ringtime':{'type':Sequelize[_0x43ca('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x43ca('0x3')]},'campaigntype':{'type':Sequelize[_0x43ca('0x3')]},'membername':{'type':Sequelize[_0x43ca('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 988485a..ae6fa39 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 _0xee9a=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x3aa7dc,_0x56378a){var _0x3ba37f=function(_0x49bfc7){while(--_0x49bfc7){_0x3aa7dc['push'](_0x3aa7dc['shift']());}};_0x3ba37f(++_0x56378a);}(_0xee9a,0x134));var _0xaee9=function(_0x23f277,_0x358ce7){_0x23f277=_0x23f277-0x0;var _0x48450c=_0xee9a[_0x23f277];return _0x48450c;};'use strict';var _=require('lodash');var util=require(_0xaee9('0x0'));var logger=require(_0xaee9('0x1'))('api');var moment=require(_0xaee9('0x2'));var BPromise=require('bluebird');var rp=require(_0xaee9('0x3'));var fs=require('fs');var path=require(_0xaee9('0x4'));var rimraf=require(_0xaee9('0x5'));var config=require(_0xaee9('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0xaee9('0x7')]=function(_0x3a72df,_0x3af837){return _0x3a72df[_0xaee9('0x8')](_0xaee9('0x9'),attributes,{'tableName':_0xaee9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe551=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1544e1,_0x2a881b){var _0x6d37a9=function(_0x96b4c1){while(--_0x96b4c1){_0x1544e1['push'](_0x1544e1['shift']());}};_0x6d37a9(++_0x2a881b);}(_0xe551,0x9f));var _0x1e55=function(_0x507645,_0x383bc9){_0x507645=_0x507645-0x0;var _0x540ab1=_0xe551[_0x507645];return _0x540ab1;};'use strict';var _=require(_0x1e55('0x0'));var util=require(_0x1e55('0x1'));var logger=require(_0x1e55('0x2'))(_0x1e55('0x3'));var moment=require(_0x1e55('0x4'));var BPromise=require(_0x1e55('0x5'));var rp=require(_0x1e55('0x6'));var fs=require('fs');var path=require(_0x1e55('0x7'));var rimraf=require(_0x1e55('0x8'));var config=require(_0x1e55('0x9'));var attributes=require(_0x1e55('0xa'));module[_0x1e55('0xb')]=function(_0x21b6a2,_0x59979f){return _0x21b6a2[_0x1e55('0xc')](_0x1e55('0xd'),attributes,{'tableName':_0x1e55('0xe'),'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 7dfdfd0..2e5e7b1 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 _0x34b2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x46324d,_0x2c6a12){var _0x365472=function(_0x1eed95){while(--_0x1eed95){_0x46324d['push'](_0x46324d['shift']());}};_0x365472(++_0x2c6a12);}(_0x34b2,0x87));var _0x234b=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0x34b2[_0x5a92ad];return _0x2466f8;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var moment=require(_0x234b('0x2'));var BPromise=require(_0x234b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x234b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x234b('0x5'))(_0x234b('0x6'));var config=require(_0x234b('0x7'));var jayson=require(_0x234b('0x8'));var client=jayson[_0x234b('0x9')][_0x234b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43ccfc,_0x449d72,_0x2853cc){return new BPromise(function(_0x30f366,_0x118d7d){return client[_0x234b('0xb')](_0x43ccfc,_0x2853cc)['then'](function(_0x169cff){logger[_0x234b('0xc')](_0x234b('0xd'),_0x449d72,_0x234b('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x449d72,_0x234b('0xe'),JSON[_0x234b('0xf')](_0x169cff));if(_0x169cff[_0x234b('0x10')]){if(_0x169cff[_0x234b('0x10')][_0x234b('0x11')]===0x1f4){logger[_0x234b('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x449d72,_0x169cff[_0x234b('0x10')]['message']);return _0x118d7d(_0x169cff[_0x234b('0x10')][_0x234b('0x12')]);}logger[_0x234b('0x10')](_0x234b('0xd'),_0x449d72,_0x169cff[_0x234b('0x10')][_0x234b('0x12')]);return _0x30f366(_0x169cff['error'][_0x234b('0x12')]);}else{logger[_0x234b('0xc')](_0x234b('0xd'),_0x449d72,_0x234b('0xe'));_0x30f366(_0x169cff[_0x234b('0x13')][_0x234b('0x12')]);}})['catch'](function(_0x4c140b){logger[_0x234b('0x10')](_0x234b('0xd'),_0x449d72,_0x4c140b);_0x118d7d(_0x4c140b);});});}exports[_0x234b('0x14')]=function(_0x4d7f58){var _0x15e5fc=this;return new Promise(function(_0x4f29e2,_0x57960e){return db[_0x234b('0x15')][_0x234b('0x16')](_0x4d7f58[_0x234b('0x17')],{'raw':_0x4d7f58[_0x234b('0x18')]?_0x4d7f58['options'][_0x234b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x572f89){logger[_0x234b('0xc')]('CreateReportAgentPreview',_0x4d7f58);logger[_0x234b('0x1a')](_0x234b('0x14'),_0x4d7f58,JSON[_0x234b('0xf')](_0x572f89));_0x4f29e2(_0x572f89);})[_0x234b('0x1b')](function(_0x174a0a){logger[_0x234b('0x10')](_0x234b('0x14'),_0x174a0a['message'],_0x4d7f58);_0x57960e(_0x15e5fc['error'](0x1f4,_0x174a0a['message']));});});}; \ No newline at end of file +var _0x88e8=['rpc','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4cced8,_0x351660){var _0xfe6f60=function(_0x132c41){while(--_0x132c41){_0x4cced8['push'](_0x4cced8['shift']());}};_0xfe6f60(++_0x351660);}(_0x88e8,0x13d));var _0x888e=function(_0x4fcfbe,_0x107dc6){_0x4fcfbe=_0x4fcfbe-0x0;var _0x50b203=_0x88e8[_0x4fcfbe];return _0x50b203;};'use strict';var _=require(_0x888e('0x0'));var util=require(_0x888e('0x1'));var moment=require(_0x888e('0x2'));var BPromise=require(_0x888e('0x3'));var rs=require(_0x888e('0x4'));var fs=require('fs');var Redis=require(_0x888e('0x5'));var db=require(_0x888e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x888e('0x7'))(_0x888e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x888e('0x9')][_0x888e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d667a,_0x394008,_0x24c4d0){return new BPromise(function(_0x2ec486,_0x5bbe30){return client['request'](_0x2d667a,_0x24c4d0)[_0x888e('0xb')](function(_0x3ed43c){logger[_0x888e('0xc')](_0x888e('0xd'),_0x394008,_0x888e('0xe'));logger['debug'](_0x888e('0xf'),_0x394008,_0x888e('0xe'),JSON['stringify'](_0x3ed43c));if(_0x3ed43c[_0x888e('0x10')]){if(_0x3ed43c[_0x888e('0x10')][_0x888e('0x11')]===0x1f4){logger['error'](_0x888e('0xd'),_0x394008,_0x3ed43c[_0x888e('0x10')][_0x888e('0x12')]);return _0x5bbe30(_0x3ed43c['error'][_0x888e('0x12')]);}logger['error'](_0x888e('0xd'),_0x394008,_0x3ed43c[_0x888e('0x10')][_0x888e('0x12')]);return _0x2ec486(_0x3ed43c[_0x888e('0x10')][_0x888e('0x12')]);}else{logger[_0x888e('0xc')](_0x888e('0xd'),_0x394008,_0x888e('0xe'));_0x2ec486(_0x3ed43c[_0x888e('0x13')]['message']);}})[_0x888e('0x14')](function(_0x3c8f1b){logger[_0x888e('0x10')](_0x888e('0xd'),_0x394008,_0x3c8f1b);_0x5bbe30(_0x3c8f1b);});});}exports[_0x888e('0x15')]=function(_0x406b8f){var _0x473449=this;return new Promise(function(_0x24d7bb,_0x16c524){return db['ReportAgentPreview']['create'](_0x406b8f['body'],{'raw':_0x406b8f['options']?_0x406b8f[_0x888e('0x16')][_0x888e('0x17')]===undefined?!![]:![]:!![]})[_0x888e('0xb')](function(_0x2bdea5){logger[_0x888e('0xc')](_0x888e('0x15'),_0x406b8f);logger[_0x888e('0x18')](_0x888e('0x15'),_0x406b8f,JSON['stringify'](_0x2bdea5));_0x24d7bb(_0x2bdea5);})[_0x888e('0x14')](function(_0x4c171c){logger[_0x888e('0x10')](_0x888e('0x15'),_0x4c171c[_0x888e('0x12')],_0x406b8f);_0x16c524(_0x473449[_0x888e('0x10')](0x1f4,_0x4c171c['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 3358bd8..e0a5561 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 _0xf917=['put','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','/fax/queues','faxQueues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues'];(function(_0xa31594,_0x1269d1){var _0x55de32=function(_0x2c8a97){while(--_0x2c8a97){_0xa31594['push'](_0xa31594['shift']());}};_0x55de32(++_0x1269d1);}(_0xf917,0x176));var _0x7f91=function(_0xa522f,_0x5debbc){_0xa522f=_0xa522f-0x0;var _0x2083b0=_0xf917[_0xa522f];return _0x2083b0;};'use strict';var multer=require('multer');var util=require(_0x7f91('0x0'));var path=require('path');var express=require(_0x7f91('0x1'));var router=express[_0x7f91('0x2')]();var auth=require(_0x7f91('0x3'));var controller=require(_0x7f91('0x4'));router[_0x7f91('0x5')](_0x7f91('0x6'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x8')]);router[_0x7f91('0x5')](_0x7f91('0x9'),auth['isAuthenticated'](),controller[_0x7f91('0xa')]);router[_0x7f91('0x5')](_0x7f91('0xb'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x7f91('0x5')](_0x7f91('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x7f91('0x5')](_0x7f91('0xd'),auth[_0x7f91('0x7')](),controller[_0x7f91('0xe')]);router[_0x7f91('0x5')]('/mail/queues',auth[_0x7f91('0x7')](),controller[_0x7f91('0xf')]);router[_0x7f91('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x7f91('0x10')]);router[_0x7f91('0x5')](_0x7f91('0x11'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x12')]);router[_0x7f91('0x5')](_0x7f91('0x13'),auth[_0x7f91('0x7')](),controller['smsQueues']);router[_0x7f91('0x5')](_0x7f91('0x14'),auth[_0x7f91('0x7')](),controller['whatsappQueues']);router[_0x7f91('0x5')](_0x7f91('0x15'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x16')]);router[_0x7f91('0x5')]('/voice/queues/preview/:id',auth[_0x7f91('0x7')](),controller[_0x7f91('0x17')]);router[_0x7f91('0x5')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x7f91('0x18')]);router['get'](_0x7f91('0x19'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x1a')]);router[_0x7f91('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x7f91('0x1b')]);router[_0x7f91('0x5')](_0x7f91('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x7f91('0x5')](_0x7f91('0x1d'),auth['isAuthenticated'](),controller[_0x7f91('0x1e')]);router[_0x7f91('0x1f')]('/voice/queues/:id',auth[_0x7f91('0x7')](),controller['updateVoiceQueue']);router[_0x7f91('0x5')](_0x7f91('0x20'),auth[_0x7f91('0x7')](),controller['outbound']);router[_0x7f91('0x5')](_0x7f91('0x21'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x22')]);router[_0x7f91('0x5')](_0x7f91('0x23'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x24')]);router[_0x7f91('0x1f')](_0x7f91('0x25'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x26')]);router[_0x7f91('0x5')](_0x7f91('0x27'),auth[_0x7f91('0x7')](),controller['telephones']);router[_0x7f91('0x5')](_0x7f91('0x28'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x29')]);router[_0x7f91('0x5')]('/campaigns',auth[_0x7f91('0x7')](),controller[_0x7f91('0x2a')]);router[_0x7f91('0x5')](_0x7f91('0x2b'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x2c')]);router[_0x7f91('0x5')](_0x7f91('0x2d'),auth['isAuthenticated'](),controller[_0x7f91('0x2e')]);router[_0x7f91('0x5')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x7f91('0x2f')]);router[_0x7f91('0x5')](_0x7f91('0x30'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x31')]);router[_0x7f91('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x7f91('0x7')](),controller[_0x7f91('0x32')]);router[_0x7f91('0x5')]('/sms/queues/waitinginteractions',auth[_0x7f91('0x7')](),controller[_0x7f91('0x33')]);router['get'](_0x7f91('0x34'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x35')]);router[_0x7f91('0x5')](_0x7f91('0x36'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x37')]);router[_0x7f91('0x38')]('/mail/queues/:id/notify',auth[_0x7f91('0x7')](),controller[_0x7f91('0x39')](_0x7f91('0x3a')));router[_0x7f91('0x5')](_0x7f91('0x3b'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x3c')]);router['post'](_0x7f91('0x3d'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x39')](_0x7f91('0x3e')));router['get']('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x7f91('0x3f')]);router[_0x7f91('0x38')](_0x7f91('0x40'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x39')](_0x7f91('0x41')));router['get'](_0x7f91('0x42'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x43')]);router[_0x7f91('0x38')]('/openchannel/queues/:id/notify',auth[_0x7f91('0x7')](),controller[_0x7f91('0x39')](_0x7f91('0x44')));router[_0x7f91('0x5')]('/openchannel/queues/:id',auth[_0x7f91('0x7')](),controller[_0x7f91('0x45')]);router[_0x7f91('0x38')](_0x7f91('0x46'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x39')](_0x7f91('0x47')));router['post'](_0x7f91('0x48'),auth['isAuthenticated'](),controller[_0x7f91('0x39')](_0x7f91('0x49')));router['get'](_0x7f91('0x4a'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x4b')]);router[_0x7f91('0x5')](_0x7f91('0x4c'),auth['isAuthenticated'](),controller[_0x7f91('0x4d')]);router['post'](_0x7f91('0x4e'),auth[_0x7f91('0x7')](),controller[_0x7f91('0x4f')]);module[_0x7f91('0x50')]=router; \ No newline at end of file +var _0x63a2=['mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/queues','voiceQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound/channels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions'];(function(_0xb0469e,_0x57edb5){var _0x3a8da5=function(_0x5b3f5d){while(--_0x5b3f5d){_0xb0469e['push'](_0xb0469e['shift']());}};_0x3a8da5(++_0x57edb5);}(_0x63a2,0x1e1));var _0x263a=function(_0x5dd654,_0x9677bd){_0x5dd654=_0x5dd654-0x0;var _0x548940=_0x63a2[_0x5dd654];return _0x548940;};'use strict';var multer=require(_0x263a('0x0'));var util=require(_0x263a('0x1'));var path=require('path');var express=require(_0x263a('0x2'));var router=express['Router']();var auth=require(_0x263a('0x3'));var controller=require(_0x263a('0x4'));router[_0x263a('0x5')](_0x263a('0x6'),auth[_0x263a('0x7')](),controller['voiceChannels']);router[_0x263a('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x263a('0x8')]);router[_0x263a('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x263a('0x7')](),controller['voiceChannelStopMixMonitor']);router[_0x263a('0x5')](_0x263a('0x9'),auth[_0x263a('0x7')](),controller[_0x263a('0xa')]);router[_0x263a('0x5')]('/chat/queues',auth[_0x263a('0x7')](),controller['chatQueues']);router[_0x263a('0x5')]('/mail/queues',auth[_0x263a('0x7')](),controller['mailQueues']);router['get']('/mail/accounts',auth[_0x263a('0x7')](),controller[_0x263a('0xb')]);router[_0x263a('0x5')](_0x263a('0xc'),auth[_0x263a('0x7')](),controller[_0x263a('0xd')]);router[_0x263a('0x5')](_0x263a('0xe'),auth['isAuthenticated'](),controller[_0x263a('0xf')]);router['get']('/whatsapp/queues',auth[_0x263a('0x7')](),controller['whatsappQueues']);router[_0x263a('0x5')](_0x263a('0x10'),auth[_0x263a('0x7')](),controller[_0x263a('0x11')]);router[_0x263a('0x5')](_0x263a('0x12'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x263a('0x5')](_0x263a('0x13'),auth[_0x263a('0x7')](),controller[_0x263a('0x14')]);router[_0x263a('0x5')](_0x263a('0x15'),auth[_0x263a('0x7')](),controller[_0x263a('0x16')]);router[_0x263a('0x5')](_0x263a('0x17'),auth[_0x263a('0x7')](),controller[_0x263a('0x18')]);router[_0x263a('0x5')](_0x263a('0x19'),auth['isAuthenticated'](),controller[_0x263a('0x1a')]);router[_0x263a('0x5')]('/voice/queues/:id',auth[_0x263a('0x7')](),controller[_0x263a('0x1b')]);router[_0x263a('0x1c')](_0x263a('0x1d'),auth[_0x263a('0x7')](),controller[_0x263a('0x1e')]);router[_0x263a('0x5')]('/outbound',auth['isAuthenticated'](),controller['outbound']);router['get'](_0x263a('0x1f'),auth[_0x263a('0x7')](),controller['outboundChannels']);router[_0x263a('0x5')](_0x263a('0x20'),auth['isAuthenticated'](),controller[_0x263a('0x21')]);router[_0x263a('0x1c')]('/agents/:id/capacity',auth[_0x263a('0x7')](),controller[_0x263a('0x22')]);router['get'](_0x263a('0x23'),auth[_0x263a('0x7')](),controller[_0x263a('0x24')]);router[_0x263a('0x5')](_0x263a('0x25'),auth[_0x263a('0x7')](),controller[_0x263a('0x26')]);router[_0x263a('0x5')]('/campaigns',auth[_0x263a('0x7')](),controller[_0x263a('0x27')]);router[_0x263a('0x5')]('/fax/accounts',auth[_0x263a('0x7')](),controller[_0x263a('0x28')]);router[_0x263a('0x5')](_0x263a('0x29'),auth[_0x263a('0x7')](),controller[_0x263a('0x2a')]);router['get'](_0x263a('0x2b'),auth[_0x263a('0x7')](),controller[_0x263a('0x2c')]);router[_0x263a('0x5')](_0x263a('0x2d'),auth[_0x263a('0x7')](),controller[_0x263a('0x2e')]);router[_0x263a('0x5')](_0x263a('0x2f'),auth[_0x263a('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x263a('0x5')](_0x263a('0x30'),auth[_0x263a('0x7')](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x263a('0x7')](),controller[_0x263a('0x31')]);router[_0x263a('0x5')](_0x263a('0x32'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x263a('0x33')](_0x263a('0x34'),auth[_0x263a('0x7')](),controller[_0x263a('0x35')](_0x263a('0x36')));router[_0x263a('0x5')](_0x263a('0x37'),auth['isAuthenticated'](),controller[_0x263a('0x38')]);router[_0x263a('0x33')](_0x263a('0x39'),auth[_0x263a('0x7')](),controller['queueNotify'](_0x263a('0x3a')));router[_0x263a('0x5')](_0x263a('0x3b'),auth['isAuthenticated'](),controller[_0x263a('0x3c')]);router[_0x263a('0x33')](_0x263a('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x263a('0x3e')));router['get'](_0x263a('0x3f'),auth[_0x263a('0x7')](),controller[_0x263a('0x40')]);router['post']('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x263a('0x35')]('openchannel'));router[_0x263a('0x5')](_0x263a('0x41'),auth[_0x263a('0x7')](),controller[_0x263a('0x42')]);router['post'](_0x263a('0x43'),auth[_0x263a('0x7')](),controller[_0x263a('0x35')]('sms'));router[_0x263a('0x33')]('/whatsapp/queues/:id/notify',auth[_0x263a('0x7')](),controller['queueNotify'](_0x263a('0x44')));router['get'](_0x263a('0x45'),auth['isAuthenticated'](),controller[_0x263a('0x46')]);router[_0x263a('0x5')]('/whatsapp/queues/:id',auth[_0x263a('0x7')](),controller[_0x263a('0x47')]);router[_0x263a('0x33')](_0x263a('0x48'),auth[_0x263a('0x7')](),controller[_0x263a('0x49')]);module[_0x263a('0x4a')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 4bf3918..9873679 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 _0xac9d=['SIP/%s','INTERACTION','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq','indexOf','queue_id','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','find','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','findOrCreate','interface','format'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0xac9d,0x14d));var _0xdac9=function(_0x57e50b,_0x16e856){_0x57e50b=_0x57e50b-0x0;var _0x4a1016=_0xac9d[_0x57e50b];return _0x4a1016;};'use strict';var BPromise=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var _=require(_0xdac9('0x2'));var util=require(_0xdac9('0x3'));var db=require(_0xdac9('0x4'))['db'];var logger=require(_0xdac9('0x5'))(_0xdac9('0x6'));var jayson=require(_0xdac9('0x7'));var amiClient=jayson['client'][_0xdac9('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0xdac9('0x8')]({'port':0x232b});var routingClient=jayson[_0xdac9('0x9')][_0xdac9('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){var _0x47d9fd=_0x39f560?_0x39f560:amiClient;return _0x47d9fd[_0xdac9('0xa')](_0x776b6c,_0x1c78c5)[_0xdac9('0xb')](function(_0x39c92c){if(_0x39c92c[_0xdac9('0xc')]){if(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xd')]===0x1f4){return _0x2b1d6f(_0x39c92c[_0xdac9('0xc')][_0xdac9('0xe')]);}return _0x5531af(_0x39c92c[_0xdac9('0xc')]['message']);}else{_0x5531af(_0x39c92c[_0xdac9('0xf')]);}})[_0xdac9('0x10')](function(_0x5a9bde){_0x2b1d6f(_0x5a9bde);});});}function respondWithResult(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xc8;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['status'](_0xeddbc1)[_0xdac9('0x11')](_0xbfe6d8);}return _0x3d8e97[_0xdac9('0x12')](0x194);};}function handleError(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0x1f4;return function(_0x5dd536){logger[_0xdac9('0xc')](_0x5dd536[_0xdac9('0x13')]);if(_0x5dd536['name']){delete _0x5dd536[_0xdac9('0x14')];}_0x9e1bf6[_0xdac9('0x15')](_0x5f0bbd)[_0xdac9('0x16')](_0x5dd536);};}function findById(_0x5b2f1b){return function(_0x2221f8){if(!_[_0xdac9('0x17')](_0x5b2f1b)&&!_[_0xdac9('0x17')](_0x2221f8)&&!_[_0xdac9('0x17')](_0x2221f8['rows'])){return _[_0xdac9('0x18')](_0x2221f8[_0xdac9('0x19')],function(_0x571e07){return _0x571e07['id']==_0x5b2f1b;});}return null;};}exports[_0xdac9('0x1a')]=function(_0xa57f2d,_0x171df1){return respondWithRpcPromise(_0xdac9('0x1b'),_0xa57f2d['query'])['then'](respondWithResult(_0x171df1,null))[_0xdac9('0x10')](handleError(_0x171df1,null));};exports[_0xdac9('0x1c')]=function(_0x2b9d91,_0x395ec7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xdac9('0x1d')](_0x2b9d91[_0xdac9('0x1e')],_0x2b9d91[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x395ec7,null))[_0xdac9('0x10')](handleError(_0x395ec7,null));};exports[_0xdac9('0x20')]=function(_0x41335a,_0xa1f726){return respondWithRpcPromise(_0xdac9('0x21'),_[_0xdac9('0x1d')](_0x41335a['query'],_0x41335a[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0xa1f726,null))[_0xdac9('0x10')](handleError(_0xa1f726,null));};exports[_0xdac9('0x22')]=function(_0x5ca076,_0x1e631a){return respondWithRpcPromise('VoiceQueues',_0x5ca076[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x1e631a,null))['catch'](handleError(_0x1e631a,null));};exports[_0xdac9('0x23')]=function(_0x5105f1,_0x450f91){return respondWithRpcPromise(_0xdac9('0x24'),_0x5105f1[_0xdac9('0x1e')])[_0xdac9('0xb')](findById(_0x5105f1['params']['id']))['then'](respondWithResult(_0x450f91,null))[_0xdac9('0x10')](handleError(_0x450f91,null));};exports[_0xdac9('0x25')]=function(_0x4fe3bd,_0x4c4e21){return respondWithRpcPromise(_0xdac9('0x26'),_[_0xdac9('0x1d')](_0x4fe3bd[_0xdac9('0x27')],_0x4fe3bd[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x4c4e21,null))[_0xdac9('0x10')](handleError(_0x4c4e21,null));};exports[_0xdac9('0x28')]=function(_0x2cda4d,_0x406ed0){return respondWithRpcPromise(_0xdac9('0x29'),_[_0xdac9('0x1d')](_0x2cda4d[_0xdac9('0x1e')],_0x2cda4d[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x406ed0,null))[_0xdac9('0x10')](handleError(_0x406ed0,null));};exports[_0xdac9('0x2a')]=function(_0x372f02,_0x44eff2){return respondWithRpcPromise(_0xdac9('0x2b'),_0x372f02[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x44eff2,null))['catch'](handleError(_0x44eff2,null));};exports['voiceQueuesChannel']=function(_0x1e6832,_0x416501){return respondWithRpcPromise(_0xdac9('0x2c'),_[_0xdac9('0x1d')](_0x1e6832[_0xdac9('0x1e')],_0x1e6832['params']))[_0xdac9('0xb')](respondWithResult(_0x416501,null))['catch'](handleError(_0x416501,null));};exports[_0xdac9('0x2d')]=function(_0x2a611e,_0x5cfebf){return respondWithRpcPromise(_0xdac9('0x2e'),_['merge'](_0x2a611e['query'],_0x2a611e[_0xdac9('0x1f')]))[_0xdac9('0xb')](respondWithResult(_0x5cfebf,null))[_0xdac9('0x10')](handleError(_0x5cfebf,null));};exports[_0xdac9('0x2f')]=function(_0x3bab10,_0x363d93){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xdac9('0x1d')](_0x3bab10[_0xdac9('0x1e')],_0x3bab10['params']))[_0xdac9('0xb')](respondWithResult(_0x363d93,null))[_0xdac9('0x10')](handleError(_0x363d93,null));};exports[_0xdac9('0x30')]=function(_0x27bdfb,_0x35aa58){return respondWithRpcPromise(_0xdac9('0x31'),_0x27bdfb[_0xdac9('0x1e')])['then'](respondWithResult(_0x35aa58,null))[_0xdac9('0x10')](handleError(_0x35aa58,null));};exports[_0xdac9('0x32')]=function(_0x238769,_0x4b6b09){return respondWithRpcPromise(_0xdac9('0x33'),_0x238769[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4b6b09,null))[_0xdac9('0x10')](handleError(_0x4b6b09,null));};exports['agents']=function(_0x58fd14,_0x1d0243){var _0xe47a3c;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14[_0xdac9('0x1e')])[_0xdac9('0xb')](function(_0x579581){_0xe47a3c=_0x579581;return respondWithRpcPromise(_0xdac9('0x34'),_0x58fd14['query'],routingClient);})[_0xdac9('0xb')](function(_0xaca43c){return _[_0xdac9('0x1d')]({},_0xaca43c,_0xe47a3c);})[_0xdac9('0xb')](respondWithResult(_0x1d0243,null))[_0xdac9('0x10')](handleError(_0x1d0243,null));};exports[_0xdac9('0x35')]=function(_0x413fb1,_0xb176e0){if(_0x413fb1[_0xdac9('0x27')]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]&&_0x413fb1[_0xdac9('0x37')]&&_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]){for(var _0x5335ae in _0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')]){if(_0x413fb1['body'][_0xdac9('0x36')][_0xdac9('0x38')](_0x5335ae)){db[_0xdac9('0x39')][_0xdac9('0x3a')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]&&_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')]?{'$notIn':_0x413fb1[_0xdac9('0x27')]['interaction'][_0x5335ae]}:{'$ne':null}}})['then'](function(_0x585f08){var _0xcb7b82=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4159fd=0x0,_0x15c332=_0x585f08['length'];_0x4159fd<_0x15c332;_0x4159fd+=0x1){_0x585f08[_0x4159fd]['updateAttributes']({'exitAt':_0xcb7b82});}});for(var _0x1666c5=0x0;_0x1666c5<_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0xdac9('0x3b')];_0x1666c5+=0x1){db[_0xdac9('0x39')][_0xdac9('0x3c')]({'where':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'type':'INTERACTION','uniqueid':_0x413fb1[_0xdac9('0x27')][_0xdac9('0x36')][_0x5335ae][_0x1666c5],'exitAt':null},'defaults':{'channel':_0x5335ae,'membername':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')],'interface':_[_0xdac9('0x17')](_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')])?util[_0xdac9('0x3e')](_0xdac9('0x3f'),_0x413fb1[_0xdac9('0x37')][_0xdac9('0x14')]):_0x413fb1[_0xdac9('0x37')][_0xdac9('0x3d')],'type':_0xdac9('0x40'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x413fb1[_0xdac9('0x37')][_0xdac9('0x41')],'uniqueid':_0x413fb1['body'][_0xdac9('0x36')][_0x5335ae][_0x1666c5]}});}}}}return respondWithRpcPromise(_0xdac9('0x42'),{'id':_0x413fb1[_0xdac9('0x1f')]['id'],'capacity':_0x413fb1['body'][_0xdac9('0x43')]},routingClient)[_0xdac9('0xb')](respondWithResult(_0xb176e0,null))['catch'](handleError(_0xb176e0,null));};exports['telephones']=function(_0x46f1c0,_0x4469d8){return respondWithRpcPromise(_0xdac9('0x44'),_0x46f1c0[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x4469d8,null))[_0xdac9('0x10')](handleError(_0x4469d8,null));};exports[_0xdac9('0x45')]=function(_0x3a77e3,_0x298c72){return respondWithRpcPromise(_0xdac9('0x46'),_0x3a77e3[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x298c72,null))[_0xdac9('0x10')](handleError(_0x298c72,null));};exports[_0xdac9('0x47')]=function(_0x35a378,_0x5d0b43){return respondWithRpcPromise(_0xdac9('0x48'),_0x35a378[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x5d0b43,null))[_0xdac9('0x10')](handleError(_0x5d0b43,null));};exports[_0xdac9('0x49')]=function(_0x3a391a,_0x4b118e){return respondWithRpcPromise(_0xdac9('0x4a'),_0x3a391a[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x4b118e,null))[_0xdac9('0x10')](handleError(_0x4b118e,null));};exports[_0xdac9('0x4b')]=function(_0x2a5bf9,_0x1eec39){return respondWithRpcPromise(_0xdac9('0x4a'),_0x2a5bf9[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2a5bf9[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x1eec39,null))[_0xdac9('0x10')](handleError(_0x1eec39,null));};exports[_0xdac9('0x4c')]=function(_0x2ca15d,_0x21ab3d){return respondWithRpcPromise('MailQueues',_0x2ca15d['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x21ab3d,null))[_0xdac9('0x10')](handleError(_0x21ab3d,null));};exports[_0xdac9('0x4d')]=function(_0x46017d,_0x1c1f5f){return respondWithRpcPromise(_0xdac9('0x4e'),_0x46017d['query'],routingClient)['then'](findById(_0x46017d['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x1c1f5f,null))[_0xdac9('0x10')](handleError(_0x1c1f5f,null));};exports[_0xdac9('0x4f')]=function(_0x2f581b,_0x52ad7b){return respondWithRpcPromise(_0xdac9('0x50'),_0x2f581b[_0xdac9('0x1e')],mailClient)[_0xdac9('0xb')](respondWithResult(_0x52ad7b,null))[_0xdac9('0x10')](handleError(_0x52ad7b,null));};exports[_0xdac9('0x51')]=function(_0x496d9c,_0x19a46e){return respondWithRpcPromise('OpenchannelQueues',_0x496d9c[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x19a46e,null))[_0xdac9('0x10')](handleError(_0x19a46e,null));};exports[_0xdac9('0x52')]=function(_0x2fd7c8,_0x360499){return respondWithRpcPromise(_0xdac9('0x53'),_0x2fd7c8[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x2fd7c8['params']['id']))['then'](respondWithResult(_0x360499,null))['catch'](handleError(_0x360499,null));};exports[_0xdac9('0x54')]=function(_0x42ba53,_0x830d54){return respondWithRpcPromise(_0xdac9('0x55'),_0x42ba53[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x830d54,null))[_0xdac9('0x10')](handleError(_0x830d54,null));};exports['showSmsQueues']=function(_0x2d81fc,_0x5b63d8){return respondWithRpcPromise('SmsQueues',_0x2d81fc[_0xdac9('0x1e')],routingClient)['then'](findById(_0x2d81fc['params']['id']))[_0xdac9('0xb')](respondWithResult(_0x5b63d8,null))[_0xdac9('0x10')](handleError(_0x5b63d8,null));};exports[_0xdac9('0x56')]=function(_0x55ce14,_0x552cac){return respondWithRpcPromise(_0xdac9('0x57'),_0x55ce14[_0xdac9('0x1e')],routingClient)['then'](respondWithResult(_0x552cac,null))[_0xdac9('0x10')](handleError(_0x552cac,null));};exports[_0xdac9('0x58')]=function(_0x26b9b5,_0x272f14){return respondWithRpcPromise(_0xdac9('0x57'),_0x26b9b5[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x26b9b5[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x272f14,null))[_0xdac9('0x10')](handleError(_0x272f14,null));};exports[_0xdac9('0x59')]=function(_0x1e2e7b,_0x5401e6){return respondWithRpcPromise(_0xdac9('0x5a'),_0x1e2e7b['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x5401e6,null))[_0xdac9('0x10')](handleError(_0x5401e6,null));};exports['showFaxQueues']=function(_0x3a6c78,_0x3bee81){return respondWithRpcPromise(_0xdac9('0x5a'),_0x3a6c78[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](findById(_0x3a6c78[_0xdac9('0x1f')]['id']))[_0xdac9('0xb')](respondWithResult(_0x3bee81,null))[_0xdac9('0x10')](handleError(_0x3bee81,null));};exports[_0xdac9('0x5b')]=function(_0x45f183,_0x263b84){return respondWithRpcPromise(_0xdac9('0x5c'),_0x45f183[_0xdac9('0x1e')])[_0xdac9('0xb')](respondWithResult(_0x263b84,null))[_0xdac9('0x10')](handleError(_0x263b84,null));};exports[_0xdac9('0x5d')]=function(_0x4c4a7b,_0x3a457b){return respondWithRpcPromise(_0xdac9('0x5e'),_0x4c4a7b[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x3a457b,null))['catch'](handleError(_0x3a457b,null));};exports[_0xdac9('0x5f')]=function(_0x31f56e,_0x1b6a68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x31f56e[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x1b6a68,null))['catch'](handleError(_0x1b6a68,null));};exports[_0xdac9('0x60')]=function(_0x1b8ad9,_0x2a4d12){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1b8ad9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x2a4d12,null))[_0xdac9('0x10')](handleError(_0x2a4d12,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5c39e9,_0x108e03){return respondWithRpcPromise(_0xdac9('0x61'),_0x5c39e9[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](function(_0x4110da){if(_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')]!==undefined){var _0x2de535=_(_0x4110da[_0xdac9('0x19')])[_0xdac9('0x63')]([_0x5c39e9[_0xdac9('0x1e')][_0xdac9('0x62')],_0x5c39e9[_0xdac9('0x1f')]['id']])['map']('queue_id')[_0xdac9('0x64')]()['value']();return _0x4110da['rows'][_0xdac9('0x63')](function(_0x199518){return _0x2de535[_0xdac9('0x65')](_0x199518[_0xdac9('0x66')])>-0x1;});}else{return _0x4110da['rows'][_0xdac9('0x63')](function(_0xff5be){return _0xff5be[_0xdac9('0x66')]===parseInt(_0x5c39e9['params']['id']);});}})[_0xdac9('0xb')](respondWithResult(_0x108e03,null))[_0xdac9('0x10')](handleError(_0x108e03,null));};exports['smsQueuesWaitingInteractions']=function(_0x3cc0f9,_0x59b5b2){return respondWithRpcPromise(_0xdac9('0x67'),_0x3cc0f9['query'],routingClient)[_0xdac9('0xb')](respondWithResult(_0x59b5b2,null))[_0xdac9('0x10')](handleError(_0x59b5b2,null));};exports[_0xdac9('0x68')]=function(_0x251011,_0x9981f){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x251011[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x9981f,null))[_0xdac9('0x10')](handleError(_0x9981f,null));};exports[_0xdac9('0x69')]=function(_0x13be64,_0x227857){return respondWithRpcPromise(_0xdac9('0x6a'),_0x13be64[_0xdac9('0x1e')],routingClient)[_0xdac9('0xb')](respondWithResult(_0x227857,null))['catch'](handleError(_0x227857,null));};exports[_0xdac9('0x6b')]=function(_0x300738){return function(_0x12c15b,_0x4f7f63){var _0x571130,_0x5650d1;var _0x5adc83=_['capitalize'](_0x300738);var _0x325407=_0x300738===_0xdac9('0x6c')?_0xdac9('0x6d'):_0xdac9('0x6e');return db[_0x5adc83+'Queue'][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x12c15b['params']['id']}})[_0xdac9('0xb')](function(_0x750de7){if(_[_0xdac9('0x17')](_0x750de7)){throw new Error(_0x5adc83+_0xdac9('0x70'));}_0x571130=_0x750de7;return db[_0x5adc83+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x12c15b[_0xdac9('0x27')][_0xdac9('0x71')]},'include':[{'model':db[_0x5adc83+_0xdac9('0x72')],'as':'Interaction'},{'model':db[_0x5adc83+_0x325407],'as':'Account'}]});})[_0xdac9('0xb')](function(_0x414f8a){if(_[_0xdac9('0x17')](_0x414f8a)){throw new Error(_0x5adc83+'\x20Message\x20not\x20found');}_0x5650d1=_0x414f8a;return _0x414f8a['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x111bff={'uniqueid':_0x300738+'.'+_0x5650d1['id']+'.'+_0x5650d1[_0xdac9('0x72')]['id'],'FromUserId':_0x12c15b[_0xdac9('0x37')]['id'],'type':_0xdac9('0x73')};_0x111bff[_0x5adc83+_0xdac9('0x74')]=_0x5650d1['id'];_0x111bff[_0x5adc83+_0xdac9('0x75')]=_0x5650d1[_0xdac9('0x72')]['id'];_0x111bff[_0xdac9('0x76')+_0x5adc83+_0x325407+'Id']=_0x5650d1[_0xdac9('0x6e')]['id'];_0x111bff['To'+_0x5adc83+_0xdac9('0x77')]=_0x571130['id'];return db[_0x5adc83+_0xdac9('0x78')][_0xdac9('0x79')](_0x111bff);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x300738,'interaction':_0x5650d1[_0xdac9('0x72')],'message':_0x5650d1,'account':_0x5650d1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xdac9('0x73'),'appdata':_0x571130['name']+','+(_0x5650d1[_0xdac9('0x6e')][_0xdac9('0x7b')]||0x12c),'interval':_0xdac9('0x7c')}]},routingClient);})[_0xdac9('0xb')](respondWithResult(_0x4f7f63,null))[_0xdac9('0x10')](handleError(_0x4f7f63,null));};};exports[_0xdac9('0x7d')]=function(_0x232876,_0x4463ca){var _0x171d38,_0x328fa2;if(_[_0xdac9('0x17')](_0x232876['body'][_0xdac9('0x7e')])){throw new Error(_0xdac9('0x7f'));}var _0x284247=_0x232876[_0xdac9('0x27')][_0xdac9('0x7e')];var _0x4d7208=_['capitalize'](_0x284247);var _0x363541=_0x284247==='chat'?'Website':_0xdac9('0x6e');return db[_0xdac9('0x80')][_0xdac9('0x6f')]({'raw':!![],'where':{'id':_0x232876[_0xdac9('0x1f')]['id'],'role':'agent'}})[_0xdac9('0xb')](function(_0x8f37df){if(_[_0xdac9('0x17')](_0x8f37df)){throw new Error('Agent\x20not\x20found');}_0x171d38=_0x8f37df;return db[_0x4d7208+'Message'][_0xdac9('0x6f')]({'where':{'id':_0x232876[_0xdac9('0x27')]['messageId']},'include':[{'model':db[_0x4d7208+'Interaction'],'as':'Interaction'},{'model':db[_0x4d7208+_0x363541],'as':_0xdac9('0x6e')}]});})[_0xdac9('0xb')](function(_0x131c78){if(_['isNil'](_0x131c78)){throw new Error(_0x4d7208+_0xdac9('0x81'));}_0x328fa2=_0x131c78;return _0x131c78[_0xdac9('0x82')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdac9('0xb')](function(){var _0x2ab89f={'uniqueid':_0x284247+'.'+_0x328fa2['id']+'.'+_0x328fa2[_0xdac9('0x72')]['id'],'FromUserId':_0x232876['user']['id'],'type':_0xdac9('0x73'),'ToUserId':_0x171d38['id']};_0x2ab89f[_0x4d7208+_0xdac9('0x74')]=_0x328fa2['id'];_0x2ab89f[_0x4d7208+'InteractionId']=_0x328fa2[_0xdac9('0x72')]['id'];_0x2ab89f[_0xdac9('0x76')+_0x4d7208+_0x363541+'Id']=_0x328fa2[_0xdac9('0x6e')]['id'];return db[_0x4d7208+_0xdac9('0x78')]['create'](_0x2ab89f);})['then'](function(){return respondWithRpcPromise(_0xdac9('0x7a'),{'channel':_0x284247,'interaction':_0x328fa2[_0xdac9('0x72')],'message':_0x328fa2,'account':_0x328fa2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x171d38[_0xdac9('0x14')]+','+(_0x328fa2['Account'][_0xdac9('0x83')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x4463ca,null))[_0xdac9('0x10')](handleError(_0x4463ca,null));}; \ No newline at end of file +var _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x24502f,_0x134350){var _0x402fd9=function(_0x5e90b2){while(--_0x5e90b2){_0x24502f['push'](_0x24502f['shift']());}};_0x402fd9(++_0x134350);}(_0xa630,0xbe));var _0x0a63=function(_0xda95eb,_0x362c18){_0xda95eb=_0xda95eb-0x0;var _0x28c8d9=_0xa630[_0xda95eb];return _0x28c8d9;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index afd8298..ad52271 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 _0x3b6e=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','show','run','post','create','put','update'];(function(_0x4e5f1d,_0x55d29a){var _0x69a2aa=function(_0x49b643){while(--_0x49b643){_0x4e5f1d['push'](_0x4e5f1d['shift']());}};_0x69a2aa(++_0x55d29a);}(_0x3b6e,0x191));var _0xe3b6=function(_0x2ef12d,_0x103abb){_0x2ef12d=_0x2ef12d-0x0;var _0x9d49ce=_0x3b6e[_0x2ef12d];return _0x9d49ce;};'use strict';var multer=require(_0xe3b6('0x0'));var util=require(_0xe3b6('0x1'));var path=require(_0xe3b6('0x2'));var timeout=require(_0xe3b6('0x3'));var express=require('express');var router=express[_0xe3b6('0x4')]();var fs_extra=require(_0xe3b6('0x5'));var auth=require(_0xe3b6('0x6'));var interaction=require(_0xe3b6('0x7'));var config=require(_0xe3b6('0x8'));var controller=require(_0xe3b6('0x9'));router['get']('/',auth[_0xe3b6('0xa')](),controller[_0xe3b6('0xb')]);router[_0xe3b6('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xe3b6('0xd')]);router[_0xe3b6('0xc')]('/:id/run',auth[_0xe3b6('0xa')](),controller[_0xe3b6('0xe')]);router[_0xe3b6('0xf')]('/',auth[_0xe3b6('0xa')](),controller[_0xe3b6('0x10')]);router[_0xe3b6('0x11')]('/:id',auth[_0xe3b6('0xa')](),controller[_0xe3b6('0x12')]);router[_0xe3b6('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe3b6('0x14')]=router; \ No newline at end of file +var _0x21ac=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','create','put','delete','destroy','multer'];(function(_0x2d5c6a,_0x5b0183){var _0xcdf17b=function(_0x5e8445){while(--_0x5e8445){_0x2d5c6a['push'](_0x2d5c6a['shift']());}};_0xcdf17b(++_0x5b0183);}(_0x21ac,0x1cd));var _0xc21a=function(_0x24f6e5,_0x525899){_0x24f6e5=_0x24f6e5-0x0;var _0x251351=_0x21ac[_0x24f6e5];return _0x251351;};'use strict';var multer=require(_0xc21a('0x0'));var util=require(_0xc21a('0x1'));var path=require(_0xc21a('0x2'));var timeout=require(_0xc21a('0x3'));var express=require(_0xc21a('0x4'));var router=express[_0xc21a('0x5')]();var fs_extra=require(_0xc21a('0x6'));var auth=require(_0xc21a('0x7'));var interaction=require(_0xc21a('0x8'));var config=require(_0xc21a('0x9'));var controller=require(_0xc21a('0xa'));router[_0xc21a('0xb')]('/',auth[_0xc21a('0xc')](),controller[_0xc21a('0xd')]);router[_0xc21a('0xb')](_0xc21a('0xe'),auth[_0xc21a('0xc')](),controller[_0xc21a('0xf')]);router['get'](_0xc21a('0x10'),auth[_0xc21a('0xc')](),controller[_0xc21a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc21a('0x12')]);router[_0xc21a('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc21a('0x14')](_0xc21a('0xe'),auth[_0xc21a('0xc')](),controller[_0xc21a('0x15')]);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 84c10ee..b4bf6db 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 _0xbfe8=['STRING','DATE','INTEGER','years','quarters','months','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','BOOLEAN','TEXT','sequelize','exports'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0xbfe8,0xe8));var _0x8bfe=function(_0x53d4a5,_0x5ce304){_0x53d4a5=_0x53d4a5-0x0;var _0x466e00=_0xbfe8[_0x53d4a5];return _0x466e00;};'use strict';var Sequelize=require(_0x8bfe('0x0'));module[_0x8bfe('0x1')]={'name':{'type':Sequelize[_0x8bfe('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8bfe('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x8bfe('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8bfe('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8bfe('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x8bfe('0x5'),_0x8bfe('0x6'),_0x8bfe('0x7'),'weeks',_0x8bfe('0x8'),_0x8bfe('0x9'),_0x8bfe('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x8bfe('0xb')](_0x8bfe('0xc'),_0x8bfe('0xd'),_0x8bfe('0xe')),'allowNull':![],'defaultValue':_0x8bfe('0xc')},'type':{'type':Sequelize[_0x8bfe('0xb')](_0x8bfe('0xf'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x8bfe('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x8bfe('0x2')]},'cc':{'type':Sequelize[_0x8bfe('0x11')]},'bcc':{'type':Sequelize[_0x8bfe('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4e25=['TEXT','BOOLEAN','sequelize','exports','STRING','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','xlsx','default','custom'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e25,0x158));var _0x54e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4e25[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x54e2('0x0'));module[_0x54e2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x54e2('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x54e2('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x54e2('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x54e2('0x5')](_0x54e2('0x6'),_0x54e2('0x7'),_0x54e2('0x8'),_0x54e2('0x9'),_0x54e2('0xa'),_0x54e2('0xb'),_0x54e2('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x54e2('0xd'),'pdf',_0x54e2('0xe')),'allowNull':![],'defaultValue':_0x54e2('0xd')},'type':{'type':Sequelize[_0x54e2('0x5')]('custom',_0x54e2('0xf')),'allowNull':![],'defaultValue':_0x54e2('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x54e2('0x2')]},'cc':{'type':Sequelize[_0x54e2('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x54e2('0x12')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 4b2e1a7..375c97e 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 _0x8ce6=['catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','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','undefined','limit','count','offset','Content-Range','save','update','then','destroy','get','error','name','send','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Schedule','findAll','rows'];(function(_0xef0251,_0x3d0a27){var _0x5dc5d8=function(_0x3bfe19){while(--_0x3bfe19){_0xef0251['push'](_0xef0251['shift']());}};_0x5dc5d8(++_0x3d0a27);}(_0x8ce6,0xbc));var _0x68ce=function(_0x5e8221,_0x2cd969){_0x5e8221=_0x5e8221-0x0;var _0x462b7d=_0x8ce6[_0x5e8221];return _0x462b7d;};'use strict';var emlformat=require(_0x68ce('0x0'));var rimraf=require(_0x68ce('0x1'));var zipdir=require(_0x68ce('0x2'));var jsonpatch=require(_0x68ce('0x3'));var rp=require(_0x68ce('0x4'));var moment=require(_0x68ce('0x5'));var BPromise=require(_0x68ce('0x6'));var Mustache=require(_0x68ce('0x7'));var util=require('util');var path=require(_0x68ce('0x8'));var sox=require(_0x68ce('0x9'));var csv=require(_0x68ce('0xa'));var ejs=require(_0x68ce('0xb'));var fs=require('fs');var fs_extra=require(_0x68ce('0xc'));var _=require(_0x68ce('0xd'));var squel=require('squel');var crypto=require(_0x68ce('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x68ce('0xf'));var Papa=require(_0x68ce('0x10'));var Redis=require(_0x68ce('0x11'));var authService=require(_0x68ce('0x12'));var qs=require(_0x68ce('0x13'));var as=require(_0x68ce('0x14'));var hardwareService=require(_0x68ce('0x15'));var logger=require(_0x68ce('0x16'))(_0x68ce('0x17'));var utils=require(_0x68ce('0x18'));var config=require(_0x68ce('0x19'));var licenseUtil=require(_0x68ce('0x1a'));var db=require(_0x68ce('0x1b'))['db'];function respondWithStatusCode(_0x1fa08f,_0x42c485){_0x42c485=_0x42c485||0xcc;return function(_0x4191c2){if(_0x4191c2){return _0x1fa08f[_0x68ce('0x1c')](_0x42c485);}return _0x1fa08f[_0x68ce('0x1d')](_0x42c485)[_0x68ce('0x1e')]();};}function respondWithResult(_0x326173,_0x2addb2){_0x2addb2=_0x2addb2||0xc8;return function(_0xfb8f87){if(_0xfb8f87){return _0x326173[_0x68ce('0x1d')](_0x2addb2)[_0x68ce('0x1f')](_0xfb8f87);}};}function respondWithFilteredResult(_0x91a5d1,_0x3b2bb2){return function(_0x678809){if(_0x678809){var _0x1e6b7b=typeof _0x3b2bb2['offset']===_0x68ce('0x20')&&typeof _0x3b2bb2[_0x68ce('0x21')]===_0x68ce('0x20');var _0x3ece8f=_0x678809[_0x68ce('0x22')];var _0x15f443=_0x1e6b7b?0x0:_0x3b2bb2[_0x68ce('0x23')];var _0x270543=_0x1e6b7b?_0x678809['count']:_0x3b2bb2[_0x68ce('0x23')]+_0x3b2bb2[_0x68ce('0x21')];var _0x18020e;if(_0x270543>=_0x3ece8f){_0x270543=_0x3ece8f;_0x18020e=0xc8;}else{_0x18020e=0xce;}_0x91a5d1[_0x68ce('0x1d')](_0x18020e);return _0x91a5d1['set'](_0x68ce('0x24'),_0x15f443+'-'+_0x270543+'/'+_0x3ece8f)['json'](_0x678809);}return null;};}function patchUpdates(_0x151e95){return function(_0x2e4e2e){try{jsonpatch['apply'](_0x2e4e2e,_0x151e95,!![]);}catch(_0x5f16a3){return BPromise['reject'](_0x5f16a3);}return _0x2e4e2e[_0x68ce('0x25')]();};}function saveUpdates(_0x2f5711,_0x37ccd1){return function(_0x3ca072){if(_0x3ca072){return _0x3ca072[_0x68ce('0x26')](_0x2f5711)[_0x68ce('0x27')](function(_0x588125){return _0x588125;});}return null;};}function removeEntity(_0x1a01fe,_0x49a6c2){return function(_0x5f330d){if(_0x5f330d){return _0x5f330d[_0x68ce('0x28')]()[_0x68ce('0x27')](function(){var _0x417e83=_0x5f330d[_0x68ce('0x29')]({'plain':!![]});var _0x18738d='Scheduler';return db['UserProfileResource'][_0x68ce('0x28')]({'where':{'type':_0x18738d,'resourceId':_0x417e83['id']}})[_0x68ce('0x27')](function(){return _0x5f330d;});})['then'](function(){_0x1a01fe['status'](0xcc)[_0x68ce('0x1e')]();});}};}function handleEntityNotFound(_0x4ba032,_0x242bf4){return function(_0x55dd49){if(!_0x55dd49){_0x4ba032['sendStatus'](0x194);}return _0x55dd49;};}function handleError(_0x572703,_0x6fe512){_0x6fe512=_0x6fe512||0x1f4;return function(_0x18bb50){logger[_0x68ce('0x2a')](_0x18bb50['stack']);if(_0x18bb50[_0x68ce('0x2b')]){delete _0x18bb50[_0x68ce('0x2b')];}_0x572703[_0x68ce('0x1d')](_0x6fe512)[_0x68ce('0x2c')](_0x18bb50);};}exports['index']=function(_0x1751e7,_0xc51c2c){var _0x49ca8f={},_0x2f8c2d={},_0x2b3973={'count':0x0,'rows':[]};var _0x9cdb4b=_[_0x68ce('0x2d')](db['Schedule'][_0x68ce('0x2e')],function(_0x3dc774){return{'name':_0x3dc774['fieldName'],'type':_0x3dc774[_0x68ce('0x2f')]['key']};});_0x2f8c2d[_0x68ce('0x30')]=_[_0x68ce('0x2d')](_0x9cdb4b,_0x68ce('0x2b'));_0x2f8c2d[_0x68ce('0x31')]=_[_0x68ce('0x32')](_0x1751e7[_0x68ce('0x31')]);_0x2f8c2d[_0x68ce('0x33')]=_[_0x68ce('0x34')](_0x2f8c2d['model'],_0x2f8c2d[_0x68ce('0x31')]);_0x49ca8f[_0x68ce('0x35')]=_['intersection'](_0x2f8c2d[_0x68ce('0x30')],qs[_0x68ce('0x36')](_0x1751e7[_0x68ce('0x31')][_0x68ce('0x36')]));_0x49ca8f[_0x68ce('0x35')]=_0x49ca8f[_0x68ce('0x35')][_0x68ce('0x37')]?_0x49ca8f[_0x68ce('0x35')]:_0x2f8c2d[_0x68ce('0x30')];if(!_0x1751e7['query']['hasOwnProperty'](_0x68ce('0x38'))){_0x49ca8f['limit']=qs[_0x68ce('0x21')](_0x1751e7[_0x68ce('0x31')]['limit']);_0x49ca8f[_0x68ce('0x23')]=qs[_0x68ce('0x23')](_0x1751e7[_0x68ce('0x31')][_0x68ce('0x23')]);}_0x49ca8f[_0x68ce('0x39')]=qs[_0x68ce('0x3a')](_0x1751e7['query'][_0x68ce('0x3a')]);_0x49ca8f[_0x68ce('0x3b')]=qs[_0x68ce('0x33')](_[_0x68ce('0x3c')](_0x1751e7[_0x68ce('0x31')],_0x2f8c2d[_0x68ce('0x33')]),_0x9cdb4b);if(_0x1751e7[_0x68ce('0x31')]['filter']){_0x49ca8f[_0x68ce('0x3b')]=_[_0x68ce('0x3d')](_0x49ca8f[_0x68ce('0x3b')],{'$or':_[_0x68ce('0x2d')](_0x9cdb4b,function(_0x3c8b05){if(_0x3c8b05['type']!==_0x68ce('0x3e')){var _0x3dcb37={};_0x3dcb37[_0x3c8b05[_0x68ce('0x2b')]]={'$like':'%'+_0x1751e7[_0x68ce('0x31')][_0x68ce('0x3f')]+'%'};return _0x3dcb37;}})});}_0x49ca8f=_[_0x68ce('0x3d')]({},_0x49ca8f,_0x1751e7[_0x68ce('0x40')]);var _0x123b48={'where':_0x49ca8f[_0x68ce('0x3b')]};return db['Schedule'][_0x68ce('0x22')](_0x123b48)['then'](function(_0x27ad82){_0x2b3973[_0x68ce('0x22')]=_0x27ad82;if(_0x1751e7['query'][_0x68ce('0x41')]){_0x49ca8f[_0x68ce('0x42')]=[{'all':!![]}];}return db[_0x68ce('0x43')][_0x68ce('0x44')](_0x49ca8f);})[_0x68ce('0x27')](function(_0x5496d4){_0x2b3973[_0x68ce('0x45')]=_0x5496d4;return _0x2b3973;})[_0x68ce('0x27')](respondWithFilteredResult(_0xc51c2c,_0x49ca8f))[_0x68ce('0x46')](handleError(_0xc51c2c,null));};exports['show']=function(_0x217a75,_0x4ada76){var _0x7182ad={'raw':![],'where':{'id':_0x217a75[_0x68ce('0x47')]['id']}},_0x5da04c={};_0x5da04c[_0x68ce('0x30')]=_[_0x68ce('0x32')](db['Schedule'][_0x68ce('0x2e')]);_0x5da04c['query']=_[_0x68ce('0x32')](_0x217a75[_0x68ce('0x31')]);_0x5da04c[_0x68ce('0x33')]=_[_0x68ce('0x34')](_0x5da04c[_0x68ce('0x30')],_0x5da04c[_0x68ce('0x31')]);_0x7182ad[_0x68ce('0x35')]=_[_0x68ce('0x34')](_0x5da04c['model'],qs[_0x68ce('0x36')](_0x217a75['query'][_0x68ce('0x36')]));_0x7182ad[_0x68ce('0x35')]=_0x7182ad[_0x68ce('0x35')][_0x68ce('0x37')]?_0x7182ad['attributes']:_0x5da04c[_0x68ce('0x30')];if(_0x217a75[_0x68ce('0x31')][_0x68ce('0x41')]){_0x7182ad['include']=[{'all':!![]}];}_0x7182ad=_[_0x68ce('0x3d')]({},_0x7182ad,_0x217a75[_0x68ce('0x40')]);return db[_0x68ce('0x43')]['find'](_0x7182ad)['then'](handleEntityNotFound(_0x4ada76,null))['then'](respondWithResult(_0x4ada76,null))[_0x68ce('0x46')](handleError(_0x4ada76,null));};exports[_0x68ce('0x48')]=function(_0x13d117,_0x6133fc){return db['Schedule']['create'](_0x13d117['body'],{})['then'](function(_0x459c72){var _0x415817=_0x13d117[_0x68ce('0x49')][_0x68ce('0x29')]({'plain':!![]});if(!_0x415817)throw new Error(_0x68ce('0x4a'));if(_0x415817[_0x68ce('0x4b')]===_0x68ce('0x49')){var _0x4789c3=_0x459c72[_0x68ce('0x29')]({'plain':!![]});var _0x16e416=_0x68ce('0x4c');return db[_0x68ce('0x4d')][_0x68ce('0x4e')]({'where':{'name':_0x16e416,'userProfileId':_0x415817[_0x68ce('0x4f')]},'raw':!![]})[_0x68ce('0x27')](function(_0x4e7b0a){if(_0x4e7b0a&&_0x4e7b0a[_0x68ce('0x50')]===0x0){return db[_0x68ce('0x51')][_0x68ce('0x48')]({'name':_0x4789c3[_0x68ce('0x2b')],'resourceId':_0x4789c3['id'],'type':_0x4e7b0a['name'],'sectionId':_0x4e7b0a['id']},{})[_0x68ce('0x27')](function(){return _0x459c72;});}else{return _0x459c72;}})[_0x68ce('0x46')](function(_0x28fbbb){logger[_0x68ce('0x2a')](_0x68ce('0x52'),_0x28fbbb);throw _0x28fbbb;});}return _0x459c72;})[_0x68ce('0x27')](respondWithResult(_0x6133fc,0xc9))[_0x68ce('0x46')](handleError(_0x6133fc,null));};exports[_0x68ce('0x26')]=function(_0x35b44a,_0x31b81d){if(_0x35b44a['body']['id']){delete _0x35b44a[_0x68ce('0x53')]['id'];}return db[_0x68ce('0x43')][_0x68ce('0x4e')]({'where':{'id':_0x35b44a['params']['id']}})[_0x68ce('0x27')](handleEntityNotFound(_0x31b81d,null))[_0x68ce('0x27')](saveUpdates(_0x35b44a[_0x68ce('0x53')],null))[_0x68ce('0x27')](respondWithResult(_0x31b81d,null))[_0x68ce('0x46')](handleError(_0x31b81d,null));};exports[_0x68ce('0x28')]=function(_0x5c6bb4,_0x596c5f){return db[_0x68ce('0x43')]['find']({'where':{'id':_0x5c6bb4[_0x68ce('0x47')]['id']}})['then'](handleEntityNotFound(_0x596c5f,null))[_0x68ce('0x27')](removeEntity(_0x596c5f,null))[_0x68ce('0x46')](handleError(_0x596c5f,null));};exports[_0x68ce('0x54')]=function(_0x52b4a5,_0x1e2116,_0x5daae1){var _0x4db66c=require(_0x68ce('0x55'));return db[_0x68ce('0x43')][_0x68ce('0x4e')]({'where':{'id':_0x52b4a5['params']['id']},'raw':!![]})[_0x68ce('0x27')](handleEntityNotFound(_0x1e2116,null))[_0x68ce('0x27')](function(){_0x4db66c[_0x68ce('0x54')](_0x52b4a5['params']['id']);})[_0x68ce('0x27')](respondWithStatusCode(_0x1e2116,null))[_0x68ce('0x46')](handleError(_0x1e2116,null));}; \ No newline at end of file +var _0x67c6=['order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','params','keys','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','update','run','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','Schedule','rawAttributes','fieldName','key','map','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0x67c6,0x1d9));var _0x667c=function(_0x3de274,_0x2d08bd){_0x3de274=_0x3de274-0x0;var _0x2749bc=_0x67c6[_0x3de274];return _0x2749bc;};'use strict';var emlformat=require(_0x667c('0x0'));var rimraf=require(_0x667c('0x1'));var zipdir=require(_0x667c('0x2'));var jsonpatch=require(_0x667c('0x3'));var rp=require(_0x667c('0x4'));var moment=require(_0x667c('0x5'));var BPromise=require(_0x667c('0x6'));var Mustache=require(_0x667c('0x7'));var util=require(_0x667c('0x8'));var path=require(_0x667c('0x9'));var sox=require(_0x667c('0xa'));var csv=require(_0x667c('0xb'));var ejs=require(_0x667c('0xc'));var fs=require('fs');var fs_extra=require(_0x667c('0xd'));var _=require(_0x667c('0xe'));var squel=require(_0x667c('0xf'));var crypto=require('crypto');var jsforce=require(_0x667c('0x10'));var deskjs=require(_0x667c('0x11'));var toCsv=require('to-csv');var querystring=require(_0x667c('0x12'));var Papa=require(_0x667c('0x13'));var Redis=require(_0x667c('0x14'));var authService=require(_0x667c('0x15'));var qs=require(_0x667c('0x16'));var as=require(_0x667c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x667c('0x18'));var config=require(_0x667c('0x19'));var licenseUtil=require(_0x667c('0x1a'));var db=require(_0x667c('0x1b'))['db'];function respondWithStatusCode(_0x34129b,_0x251b6a){_0x251b6a=_0x251b6a||0xcc;return function(_0x406109){if(_0x406109){return _0x34129b[_0x667c('0x1c')](_0x251b6a);}return _0x34129b['status'](_0x251b6a)['end']();};}function respondWithResult(_0x150b07,_0x49be38){_0x49be38=_0x49be38||0xc8;return function(_0xc3535e){if(_0xc3535e){return _0x150b07[_0x667c('0x1d')](_0x49be38)[_0x667c('0x1e')](_0xc3535e);}};}function respondWithFilteredResult(_0x14c943,_0x143c3b){return function(_0x18abb7){if(_0x18abb7){var _0x593e87=typeof _0x143c3b[_0x667c('0x1f')]==='undefined'&&typeof _0x143c3b[_0x667c('0x20')]===_0x667c('0x21');var _0x37c371=_0x18abb7[_0x667c('0x22')];var _0x39833b=_0x593e87?0x0:_0x143c3b[_0x667c('0x1f')];var _0xc5b2c6=_0x593e87?_0x18abb7[_0x667c('0x22')]:_0x143c3b[_0x667c('0x1f')]+_0x143c3b[_0x667c('0x20')];var _0x3827be;if(_0xc5b2c6>=_0x37c371){_0xc5b2c6=_0x37c371;_0x3827be=0xc8;}else{_0x3827be=0xce;}_0x14c943[_0x667c('0x1d')](_0x3827be);return _0x14c943[_0x667c('0x23')]('Content-Range',_0x39833b+'-'+_0xc5b2c6+'/'+_0x37c371)['json'](_0x18abb7);}return null;};}function patchUpdates(_0x357313){return function(_0x38077b){try{jsonpatch['apply'](_0x38077b,_0x357313,!![]);}catch(_0x4805df){return BPromise[_0x667c('0x24')](_0x4805df);}return _0x38077b[_0x667c('0x25')]();};}function saveUpdates(_0x51c030,_0x3d9712){return function(_0x5eeff9){if(_0x5eeff9){return _0x5eeff9['update'](_0x51c030)[_0x667c('0x26')](function(_0x1b68ed){return _0x1b68ed;});}return null;};}function removeEntity(_0x1f0297,_0x57f3b6){return function(_0xa16a69){if(_0xa16a69){return _0xa16a69[_0x667c('0x27')]()[_0x667c('0x26')](function(){var _0x657cc4=_0xa16a69[_0x667c('0x28')]({'plain':!![]});var _0x4100df='Scheduler';return db[_0x667c('0x29')][_0x667c('0x27')]({'where':{'type':_0x4100df,'resourceId':_0x657cc4['id']}})[_0x667c('0x26')](function(){return _0xa16a69;});})[_0x667c('0x26')](function(){_0x1f0297[_0x667c('0x1d')](0xcc)[_0x667c('0x2a')]();});}};}function handleEntityNotFound(_0x29e4f9,_0x20716c){return function(_0x59145a){if(!_0x59145a){_0x29e4f9[_0x667c('0x1c')](0x194);}return _0x59145a;};}function handleError(_0x1e99cd,_0x483a5d){_0x483a5d=_0x483a5d||0x1f4;return function(_0x56726a){logger[_0x667c('0x2b')](_0x56726a[_0x667c('0x2c')]);if(_0x56726a['name']){delete _0x56726a[_0x667c('0x2d')];}_0x1e99cd[_0x667c('0x1d')](_0x483a5d)[_0x667c('0x2e')](_0x56726a);};}exports[_0x667c('0x2f')]=function(_0x5bb20e,_0x72b217){var _0x359e05={},_0x1e0e17={},_0x3911d2={'count':0x0,'rows':[]};var _0x22d281=_['map'](db[_0x667c('0x30')][_0x667c('0x31')],function(_0x520802){return{'name':_0x520802[_0x667c('0x32')],'type':_0x520802['type'][_0x667c('0x33')]};});_0x1e0e17['model']=_[_0x667c('0x34')](_0x22d281,_0x667c('0x2d'));_0x1e0e17[_0x667c('0x35')]=_['keys'](_0x5bb20e['query']);_0x1e0e17[_0x667c('0x36')]=_['intersection'](_0x1e0e17['model'],_0x1e0e17[_0x667c('0x35')]);_0x359e05[_0x667c('0x37')]=_['intersection'](_0x1e0e17[_0x667c('0x38')],qs[_0x667c('0x39')](_0x5bb20e['query'][_0x667c('0x39')]));_0x359e05[_0x667c('0x37')]=_0x359e05[_0x667c('0x37')][_0x667c('0x3a')]?_0x359e05['attributes']:_0x1e0e17[_0x667c('0x38')];if(!_0x5bb20e['query'][_0x667c('0x3b')](_0x667c('0x3c'))){_0x359e05[_0x667c('0x20')]=qs[_0x667c('0x20')](_0x5bb20e[_0x667c('0x35')]['limit']);_0x359e05[_0x667c('0x1f')]=qs[_0x667c('0x1f')](_0x5bb20e['query'][_0x667c('0x1f')]);}_0x359e05[_0x667c('0x3d')]=qs[_0x667c('0x3e')](_0x5bb20e[_0x667c('0x35')]['sort']);_0x359e05[_0x667c('0x3f')]=qs[_0x667c('0x36')](_[_0x667c('0x40')](_0x5bb20e[_0x667c('0x35')],_0x1e0e17['filters']),_0x22d281);if(_0x5bb20e[_0x667c('0x35')][_0x667c('0x41')]){_0x359e05[_0x667c('0x3f')]=_[_0x667c('0x42')](_0x359e05[_0x667c('0x3f')],{'$or':_[_0x667c('0x34')](_0x22d281,function(_0x476570){if(_0x476570[_0x667c('0x43')]!==_0x667c('0x44')){var _0x3c28ed={};_0x3c28ed[_0x476570[_0x667c('0x2d')]]={'$like':'%'+_0x5bb20e[_0x667c('0x35')][_0x667c('0x41')]+'%'};return _0x3c28ed;}})});}_0x359e05=_['merge']({},_0x359e05,_0x5bb20e['options']);var _0x6dd67c={'where':_0x359e05[_0x667c('0x3f')]};return db[_0x667c('0x30')][_0x667c('0x22')](_0x6dd67c)[_0x667c('0x26')](function(_0x322e2a){_0x3911d2[_0x667c('0x22')]=_0x322e2a;if(_0x5bb20e[_0x667c('0x35')][_0x667c('0x45')]){_0x359e05[_0x667c('0x46')]=[{'all':!![]}];}return db[_0x667c('0x30')]['findAll'](_0x359e05);})[_0x667c('0x26')](function(_0x280221){_0x3911d2[_0x667c('0x47')]=_0x280221;return _0x3911d2;})[_0x667c('0x26')](respondWithFilteredResult(_0x72b217,_0x359e05))[_0x667c('0x48')](handleError(_0x72b217,null));};exports['show']=function(_0x4754a4,_0x378b50){var _0x5a6ed4={'raw':![],'where':{'id':_0x4754a4[_0x667c('0x49')]['id']}},_0x46b7c7={};_0x46b7c7[_0x667c('0x38')]=_[_0x667c('0x4a')](db[_0x667c('0x30')][_0x667c('0x31')]);_0x46b7c7[_0x667c('0x35')]=_['keys'](_0x4754a4[_0x667c('0x35')]);_0x46b7c7[_0x667c('0x36')]=_[_0x667c('0x4b')](_0x46b7c7[_0x667c('0x38')],_0x46b7c7[_0x667c('0x35')]);_0x5a6ed4[_0x667c('0x37')]=_[_0x667c('0x4b')](_0x46b7c7[_0x667c('0x38')],qs['fields'](_0x4754a4[_0x667c('0x35')][_0x667c('0x39')]));_0x5a6ed4[_0x667c('0x37')]=_0x5a6ed4[_0x667c('0x37')][_0x667c('0x3a')]?_0x5a6ed4[_0x667c('0x37')]:_0x46b7c7[_0x667c('0x38')];if(_0x4754a4[_0x667c('0x35')]['includeAll']){_0x5a6ed4['include']=[{'all':!![]}];}_0x5a6ed4=_[_0x667c('0x42')]({},_0x5a6ed4,_0x4754a4[_0x667c('0x4c')]);return db[_0x667c('0x30')][_0x667c('0x4d')](_0x5a6ed4)[_0x667c('0x26')](handleEntityNotFound(_0x378b50,null))['then'](respondWithResult(_0x378b50,null))[_0x667c('0x48')](handleError(_0x378b50,null));};exports[_0x667c('0x4e')]=function(_0x160e36,_0xde036c){return db[_0x667c('0x30')][_0x667c('0x4e')](_0x160e36[_0x667c('0x4f')],{})['then'](function(_0x518845){var _0x22e62b=_0x160e36[_0x667c('0x50')]['get']({'plain':!![]});if(!_0x22e62b)throw new Error(_0x667c('0x51'));if(_0x22e62b[_0x667c('0x52')]===_0x667c('0x50')){var _0x310662=_0x518845[_0x667c('0x28')]({'plain':!![]});var _0x338d20=_0x667c('0x53');return db[_0x667c('0x54')][_0x667c('0x4d')]({'where':{'name':_0x338d20,'userProfileId':_0x22e62b[_0x667c('0x55')]},'raw':!![]})[_0x667c('0x26')](function(_0x5929f1){if(_0x5929f1&&_0x5929f1[_0x667c('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x310662[_0x667c('0x2d')],'resourceId':_0x310662['id'],'type':_0x5929f1['name'],'sectionId':_0x5929f1['id']},{})[_0x667c('0x26')](function(){return _0x518845;});}else{return _0x518845;}})[_0x667c('0x48')](function(_0x21a6fa){logger[_0x667c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21a6fa);throw _0x21a6fa;});}return _0x518845;})[_0x667c('0x26')](respondWithResult(_0xde036c,0xc9))[_0x667c('0x48')](handleError(_0xde036c,null));};exports[_0x667c('0x57')]=function(_0x43caec,_0xf1b1a9){if(_0x43caec[_0x667c('0x4f')]['id']){delete _0x43caec[_0x667c('0x4f')]['id'];}return db['Schedule'][_0x667c('0x4d')]({'where':{'id':_0x43caec[_0x667c('0x49')]['id']}})['then'](handleEntityNotFound(_0xf1b1a9,null))['then'](saveUpdates(_0x43caec[_0x667c('0x4f')],null))[_0x667c('0x26')](respondWithResult(_0xf1b1a9,null))['catch'](handleError(_0xf1b1a9,null));};exports[_0x667c('0x27')]=function(_0x4eeec7,_0x3f2e43){return db[_0x667c('0x30')][_0x667c('0x4d')]({'where':{'id':_0x4eeec7[_0x667c('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f2e43,null))[_0x667c('0x26')](removeEntity(_0x3f2e43,null))[_0x667c('0x48')](handleError(_0x3f2e43,null));};exports['run']=function(_0xa6ef43,_0x25fe09,_0x37c333){var _0x1c37fc=require('../../config/schedule');return db[_0x667c('0x30')]['find']({'where':{'id':_0xa6ef43[_0x667c('0x49')]['id']},'raw':!![]})[_0x667c('0x26')](handleEntityNotFound(_0x25fe09,null))[_0x667c('0x26')](function(){_0x1c37fc[_0x667c('0x58')](_0xa6ef43[_0x667c('0x49')]['id']);})[_0x667c('0x26')](respondWithStatusCode(_0x25fe09,null))[_0x667c('0x48')](handleError(_0x25fe09,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index b5a5605..f12dbad 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 _0xfdd4=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','tools_schedules','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfdd4,0xd1));var _0x4fdd=function(_0x19737b,_0x212909){_0x19737b=_0x19737b-0x0;var _0x16329e=_0xfdd4[_0x19737b];return _0x16329e;};'use strict';var _=require(_0x4fdd('0x0'));var util=require(_0x4fdd('0x1'));var logger=require(_0x4fdd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4fdd('0x3'));var rp=require(_0x4fdd('0x4'));var fs=require('fs');var path=require(_0x4fdd('0x5'));var rimraf=require(_0x4fdd('0x6'));var config=require(_0x4fdd('0x7'));var attributes=require(_0x4fdd('0x8'));module['exports']=function(_0x5ef109,_0x7bd8a8){return _0x5ef109['define']('Schedule',attributes,{'tableName':_0x4fdd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x127e=['bluebird','request-promise','path','../../config/environment','exports','define','tools_schedules','lodash','../../config/logger','api','moment'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0x127e,0x146));var _0xe127=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x127e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe127('0x0'));var util=require('util');var logger=require(_0xe127('0x1'))(_0xe127('0x2'));var moment=require(_0xe127('0x3'));var BPromise=require(_0xe127('0x4'));var rp=require(_0xe127('0x5'));var fs=require('fs');var path=require(_0xe127('0x6'));var rimraf=require('rimraf');var config=require(_0xe127('0x7'));var attributes=require('./schedule.attributes');module[_0xe127('0x8')]=function(_0x237b63,_0x1ebb41){return _0x237b63[_0xe127('0x9')]('Schedule',attributes,{'tableName':_0xe127('0xa'),'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 3e3a899..8e9a723 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 _0x46d6=['info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x46d6,0x9d));var _0x646d=function(_0x49adfd,_0x136735){_0x49adfd=_0x49adfd-0x0;var _0x518e53=_0x46d6[_0x49adfd];return _0x518e53;};'use strict';var _=require('lodash');var util=require(_0x646d('0x0'));var moment=require('moment');var BPromise=require(_0x646d('0x1'));var rs=require(_0x646d('0x2'));var fs=require('fs');var Redis=require(_0x646d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x646d('0x4'));var logger=require(_0x646d('0x5'))(_0x646d('0x6'));var config=require(_0x646d('0x7'));var jayson=require(_0x646d('0x8'));var client=jayson[_0x646d('0x9')][_0x646d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16689a,_0x1c85a1,_0x1e8290){return new BPromise(function(_0x5b56dc,_0x573d44){return client[_0x646d('0xb')](_0x16689a,_0x1e8290)[_0x646d('0xc')](function(_0x586387){logger['info'](_0x646d('0xd'),_0x1c85a1,_0x646d('0xe'));logger[_0x646d('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1c85a1,'request\x20sent',JSON['stringify'](_0x586387));if(_0x586387[_0x646d('0x10')]){if(_0x586387[_0x646d('0x10')][_0x646d('0x11')]===0x1f4){logger[_0x646d('0x10')](_0x646d('0xd'),_0x1c85a1,_0x586387[_0x646d('0x10')][_0x646d('0x12')]);return _0x573d44(_0x586387[_0x646d('0x10')][_0x646d('0x12')]);}logger[_0x646d('0x10')](_0x646d('0xd'),_0x1c85a1,_0x586387[_0x646d('0x10')][_0x646d('0x12')]);return _0x5b56dc(_0x586387[_0x646d('0x10')][_0x646d('0x12')]);}else{logger[_0x646d('0x13')](_0x646d('0xd'),_0x1c85a1,_0x646d('0xe'));_0x5b56dc(_0x586387[_0x646d('0x14')][_0x646d('0x12')]);}})[_0x646d('0x15')](function(_0xb34d13){logger[_0x646d('0x10')](_0x646d('0xd'),_0x1c85a1,_0xb34d13);_0x573d44(_0xb34d13);});});} \ No newline at end of file +var _0x2e10=['jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x2e10,0xf5));var _0x02e1=function(_0x521068,_0x3ae14e){_0x521068=_0x521068-0x0;var _0x26180e=_0x2e10[_0x521068];return _0x26180e;};'use strict';var _=require(_0x02e1('0x0'));var util=require(_0x02e1('0x1'));var moment=require(_0x02e1('0x2'));var BPromise=require('bluebird');var rs=require(_0x02e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02e1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x02e1('0x5'))(_0x02e1('0x6'));var config=require(_0x02e1('0x7'));var jayson=require(_0x02e1('0x8'));var client=jayson[_0x02e1('0x9')][_0x02e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10c381,_0xf6a079,_0x29a7f5){return new BPromise(function(_0x333ffb,_0x2c3b87){return client[_0x02e1('0xb')](_0x10c381,_0x29a7f5)['then'](function(_0x5866db){logger[_0x02e1('0xc')](_0x02e1('0xd'),_0xf6a079,'request\x20sent');logger[_0x02e1('0xe')](_0x02e1('0xf'),_0xf6a079,_0x02e1('0x10'),JSON[_0x02e1('0x11')](_0x5866db));if(_0x5866db['error']){if(_0x5866db[_0x02e1('0x12')][_0x02e1('0x13')]===0x1f4){logger[_0x02e1('0x12')](_0x02e1('0xd'),_0xf6a079,_0x5866db[_0x02e1('0x12')][_0x02e1('0x14')]);return _0x2c3b87(_0x5866db[_0x02e1('0x12')][_0x02e1('0x14')]);}logger[_0x02e1('0x12')](_0x02e1('0xd'),_0xf6a079,_0x5866db[_0x02e1('0x12')][_0x02e1('0x14')]);return _0x333ffb(_0x5866db[_0x02e1('0x12')][_0x02e1('0x14')]);}else{logger[_0x02e1('0xc')](_0x02e1('0xd'),_0xf6a079,'request\x20sent');_0x333ffb(_0x5866db[_0x02e1('0x15')][_0x02e1('0x14')]);}})[_0x02e1('0x16')](function(_0x5992b9){logger[_0x02e1('0x12')]('Schedule,\x20%s,\x20%s',_0xf6a079,_0x5992b9);_0x2c3b87(_0x5992b9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 9a93490..676fef5 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 _0x3179=['download','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./screenRecording.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x12fe24,_0x4061cd){var _0x309501=function(_0x2c91d8){while(--_0x2c91d8){_0x12fe24['push'](_0x12fe24['shift']());}};_0x309501(++_0x4061cd);}(_0x3179,0x7f));var _0x9317=function(_0xbd5ecb,_0x2c73a9){_0xbd5ecb=_0xbd5ecb-0x0;var _0x19d7f9=_0x3179[_0xbd5ecb];return _0x19d7f9;};'use strict';var multer=require('multer');var util=require(_0x9317('0x0'));var path=require('path');var timeout=require(_0x9317('0x1'));var express=require(_0x9317('0x2'));var router=express[_0x9317('0x3')]();var fs_extra=require(_0x9317('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9317('0x5'));var controller=require(_0x9317('0x6'));router['get']('/',auth[_0x9317('0x7')](),controller['index']);router[_0x9317('0x8')](_0x9317('0x9'),auth[_0x9317('0x7')](),controller[_0x9317('0xa')]);router[_0x9317('0x8')](_0x9317('0xb'),auth[_0x9317('0x7')](),controller[_0x9317('0xc')]);router[_0x9317('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x9317('0xd')]);router[_0x9317('0xe')]('/',auth[_0x9317('0x7')](),controller[_0x9317('0xf')]);router['put']('/:id',auth[_0x9317('0x7')](),controller[_0x9317('0x10')]);router[_0x9317('0x11')](_0x9317('0xb'),auth[_0x9317('0x7')](),controller[_0x9317('0x12')]);module[_0x9317('0x13')]=router; \ No newline at end of file +var _0x671d=['show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','describe'];(function(_0x1fa526,_0x1af739){var _0x4bf195=function(_0x3fa692){while(--_0x3fa692){_0x1fa526['push'](_0x1fa526['shift']());}};_0x4bf195(++_0x1af739);}(_0x671d,0xb0));var _0xd671=function(_0x496e54,_0x575c5d){_0x496e54=_0x496e54-0x0;var _0x41ab42=_0x671d[_0x496e54];return _0x41ab42;};'use strict';var multer=require(_0xd671('0x0'));var util=require(_0xd671('0x1'));var path=require(_0xd671('0x2'));var timeout=require(_0xd671('0x3'));var express=require(_0xd671('0x4'));var router=express[_0xd671('0x5')]();var fs_extra=require(_0xd671('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd671('0x7'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router['get']('/',auth[_0xd671('0x8')](),controller[_0xd671('0x9')]);router[_0xd671('0xa')](_0xd671('0xb'),auth[_0xd671('0x8')](),controller[_0xd671('0xc')]);router[_0xd671('0xa')]('/:id',auth[_0xd671('0x8')](),controller[_0xd671('0xd')]);router[_0xd671('0xa')]('/:id/download',auth[_0xd671('0x8')](),controller['download']);router[_0xd671('0xe')]('/',auth[_0xd671('0x8')](),controller[_0xd671('0xf')]);router[_0xd671('0x10')](_0xd671('0x11'),auth[_0xd671('0x8')](),controller[_0xd671('0x12')]);router[_0xd671('0x13')](_0xd671('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xd671('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 6fab3b4..b0b102e 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 _0xabad=['getDataValue','value','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','format','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xabad,0x150));var _0xdaba=function(_0x5634d2,_0x40ec38){_0x5634d2=_0x5634d2-0x0;var _0x4150b5=_0xabad[_0x5634d2];return _0x4150b5;};'use strict';var Sequelize=require(_0xdaba('0x0'));var moment=require('moment');var path=require(_0xdaba('0x1'));var config=require(_0xdaba('0x2'));module[_0xdaba('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xdaba('0x4')](_0xdaba('0x5'))?path['extname'](this[_0xdaba('0x4')](_0xdaba('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xdaba('0x6')]},'channel':{'type':Sequelize[_0xdaba('0x6')]},'value':{'type':Sequelize[_0xdaba('0x6')],'set':function(_0x23ae0f){var _0x4045f5=_0x23ae0f[_0xdaba('0x7')](/\\/g,'/');this['setDataValue'](_0xdaba('0x5'),_0x4045f5);}},'rating':{'type':Sequelize[_0xdaba('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdaba('0x8')],'set':function(_0x1e22ba){this['setDataValue'](_0xdaba('0x9'),moment()[_0xdaba('0xa')](_0x1e22ba,'ms'));this[_0xdaba('0xb')](_0xdaba('0xc'),moment());this[_0xdaba('0xb')](_0xdaba('0xd'),_0x1e22ba);}},'startedAt':{'type':Sequelize[_0xdaba('0xe')],'get':function(){return moment(this[_0xdaba('0x4')](_0xdaba('0x9')))['format'](_0xdaba('0xf'))['toString']();}},'closedAt':{'type':Sequelize[_0xdaba('0xe')],'get':function(){return moment(this[_0xdaba('0x4')](_0xdaba('0xc')))[_0xdaba('0x10')](_0xdaba('0xf'))[_0xdaba('0x11')]();}},'createdAt':{'type':Sequelize[_0xdaba('0xe')],'get':function(){return moment(this['getDataValue'](_0xdaba('0x12')))[_0xdaba('0x10')](_0xdaba('0xf'))[_0xdaba('0x11')]();}},'updatedAt':{'type':Sequelize[_0xdaba('0xe')],'get':function(){return moment(this[_0xdaba('0x4')](_0xdaba('0x13')))['format'](_0xdaba('0xf'))[_0xdaba('0x11')]();}}}; \ No newline at end of file +var _0x50a5=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt'];(function(_0x3e6e97,_0x3ffdc7){var _0x3c127c=function(_0x2751c1){while(--_0x2751c1){_0x3e6e97['push'](_0x3e6e97['shift']());}};_0x3c127c(++_0x3ffdc7);}(_0x50a5,0xd1));var _0x550a=function(_0x30236c,_0x71b80a){_0x30236c=_0x30236c-0x0;var _0x494426=_0x50a5[_0x30236c];return _0x494426;};'use strict';var Sequelize=require(_0x550a('0x0'));var moment=require(_0x550a('0x1'));var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x550a('0x2')]('value')?path[_0x550a('0x3')](this[_0x550a('0x2')](_0x550a('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x550a('0x5')]},'channel':{'type':Sequelize[_0x550a('0x5')]},'value':{'type':Sequelize[_0x550a('0x5')],'set':function(_0x1983bf){var _0x2596b7=_0x1983bf[_0x550a('0x6')](/\\/g,'/');this[_0x550a('0x7')](_0x550a('0x4'),_0x2596b7);}},'rating':{'type':Sequelize[_0x550a('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x550a('0x8')],'set':function(_0x5247ac){this[_0x550a('0x7')](_0x550a('0x9'),moment()[_0x550a('0xa')](_0x5247ac,'ms'));this[_0x550a('0x7')](_0x550a('0xb'),moment());this[_0x550a('0x7')]('duration',_0x5247ac);}},'startedAt':{'type':Sequelize[_0x550a('0xc')],'get':function(){return moment(this[_0x550a('0x2')](_0x550a('0x9')))[_0x550a('0xd')](_0x550a('0xe'))[_0x550a('0xf')]();}},'closedAt':{'type':Sequelize[_0x550a('0xc')],'get':function(){return moment(this[_0x550a('0x2')]('closedAt'))[_0x550a('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x550a('0xc')],'get':function(){return moment(this[_0x550a('0x2')]('createdAt'))[_0x550a('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x550a('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x550a('0x2')](_0x550a('0x10')))[_0x550a('0xd')](_0x550a('0xe'))[_0x550a('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 59bbfff..45c05af 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 _0x2bd8=['unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x39e2ca,_0x5e00f2){var _0x219cfd=function(_0xfabd0c){while(--_0xfabd0c){_0x39e2ca['push'](_0x39e2ca['shift']());}};_0x219cfd(++_0x5e00f2);}(_0x2bd8,0x130));var _0x82bd=function(_0x5ae574,_0x482324){_0x5ae574=_0x5ae574-0x0;var _0x1dc236=_0x2bd8[_0x5ae574];return _0x1dc236;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file +var _0x2bd8=['unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x4da497,_0x279d93){var _0x364480=function(_0x4f293d){while(--_0x4f293d){_0x4da497['push'](_0x4da497['shift']());}};_0x364480(++_0x279d93);}(_0x2bd8,0x130));var _0x82bd=function(_0x4f17c4,_0x3fffab){_0x4f17c4=_0x4f17c4-0x0;var _0x5e4c7f=_0x2bd8[_0x4f17c4];return _0x5e4c7f;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5658d0e..1add2d5 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 _0xc289=['./screenRecording.attributes','exports','define','ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xc289,0x16d));var _0x9c28=function(_0x26ed41,_0x337994){_0x26ed41=_0x26ed41-0x0;var _0x401b88=_0xc289[_0x26ed41];return _0x401b88;};'use strict';var _=require(_0x9c28('0x0'));var util=require(_0x9c28('0x1'));var logger=require(_0x9c28('0x2'))(_0x9c28('0x3'));var moment=require(_0x9c28('0x4'));var BPromise=require(_0x9c28('0x5'));var rp=require(_0x9c28('0x6'));var fs=require('fs');var path=require(_0x9c28('0x7'));var rimraf=require(_0x9c28('0x8'));var config=require(_0x9c28('0x9'));var attributes=require(_0x9c28('0xa'));module[_0x9c28('0xb')]=function(_0x16eb17,_0x4fdf0d){return _0x16eb17[_0x9c28('0xc')](_0x9c28('0xd'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x9c28('0xe'),'fields':[_0x9c28('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08e5=['bluebird','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','moment'];(function(_0x1e9890,_0x48fc89){var _0x457976=function(_0x52fad9){while(--_0x52fad9){_0x1e9890['push'](_0x1e9890['shift']());}};_0x457976(++_0x48fc89);}(_0x08e5,0x1c5));var _0x508e=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x08e5[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x508e('0x0'));var util=require('util');var logger=require(_0x508e('0x1'))('api');var moment=require(_0x508e('0x2'));var BPromise=require(_0x508e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x508e('0x4'));var rimraf=require('rimraf');var config=require(_0x508e('0x5'));var attributes=require(_0x508e('0x6'));module[_0x508e('0x7')]=function(_0x261536,_0xbdf2c7){return _0x261536[_0x508e('0x8')](_0x508e('0x9'),attributes,{'tableName':_0x508e('0xa'),'paranoid':![],'indexes':[{'name':_0x508e('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 5a15c9a..c7b2977 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 _0x7ce5=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x40b91a,_0x14414e){var _0x636d75=function(_0xac52e2){while(--_0xac52e2){_0x40b91a['push'](_0x40b91a['shift']());}};_0x636d75(++_0x14414e);}(_0x7ce5,0x1e2));var _0x57ce=function(_0x44b114,_0x46ebb3){_0x44b114=_0x44b114-0x0;var _0x5e7c46=_0x7ce5[_0x44b114];return _0x5e7c46;};'use strict';var _=require(_0x57ce('0x0'));var util=require(_0x57ce('0x1'));var moment=require(_0x57ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x57ce('0x3'));var fs=require('fs');var Redis=require(_0x57ce('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57ce('0x5'));var logger=require(_0x57ce('0x6'))(_0x57ce('0x7'));var config=require('../../config/environment');var jayson=require(_0x57ce('0x8'));var client=jayson[_0x57ce('0x9')][_0x57ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d7456,_0x45e4d7,_0x1c27f2){return new BPromise(function(_0x341a7c,_0x28d43f){return client[_0x57ce('0xb')](_0x5d7456,_0x1c27f2)[_0x57ce('0xc')](function(_0x44cb70){logger[_0x57ce('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x45e4d7,'request\x20sent');logger['debug'](_0x57ce('0xe'),_0x45e4d7,_0x57ce('0xf'),JSON[_0x57ce('0x10')](_0x44cb70));if(_0x44cb70[_0x57ce('0x11')]){if(_0x44cb70['error'][_0x57ce('0x12')]===0x1f4){logger[_0x57ce('0x11')](_0x57ce('0x13'),_0x45e4d7,_0x44cb70[_0x57ce('0x11')][_0x57ce('0x14')]);return _0x28d43f(_0x44cb70[_0x57ce('0x11')]['message']);}logger[_0x57ce('0x11')](_0x57ce('0x13'),_0x45e4d7,_0x44cb70['error']['message']);return _0x341a7c(_0x44cb70['error'][_0x57ce('0x14')]);}else{logger['info'](_0x57ce('0x13'),_0x45e4d7,_0x57ce('0xf'));_0x341a7c(_0x44cb70[_0x57ce('0x15')]['message']);}})[_0x57ce('0x16')](function(_0x5daaac){logger[_0x57ce('0x11')](_0x57ce('0x13'),_0x45e4d7,_0x5daaac);_0x28d43f(_0x5daaac);});});} \ No newline at end of file +var _0x3e26=['client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1572db,_0x447a7b){var _0x1dbd57=function(_0x118587){while(--_0x118587){_0x1572db['push'](_0x1572db['shift']());}};_0x1dbd57(++_0x447a7b);}(_0x3e26,0x121));var _0x63e2=function(_0x1f9309,_0x1b9b8e){_0x1f9309=_0x1f9309-0x0;var _0x5f380e=_0x3e26[_0x1f9309];return _0x5f380e;};'use strict';var _=require(_0x63e2('0x0'));var util=require(_0x63e2('0x1'));var moment=require(_0x63e2('0x2'));var BPromise=require(_0x63e2('0x3'));var rs=require(_0x63e2('0x4'));var fs=require('fs');var Redis=require(_0x63e2('0x5'));var db=require(_0x63e2('0x6'))['db'];var utils=require(_0x63e2('0x7'));var logger=require(_0x63e2('0x8'))(_0x63e2('0x9'));var config=require('../../config/environment');var jayson=require(_0x63e2('0xa'));var client=jayson[_0x63e2('0xb')][_0x63e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bedfa,_0x93e3c7,_0x46f213){return new BPromise(function(_0x1fd068,_0x1d64fd){return client[_0x63e2('0xd')](_0x2bedfa,_0x46f213)[_0x63e2('0xe')](function(_0x41da4c){logger[_0x63e2('0xf')](_0x63e2('0x10'),_0x93e3c7,_0x63e2('0x11'));logger[_0x63e2('0x12')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x93e3c7,_0x63e2('0x11'),JSON[_0x63e2('0x13')](_0x41da4c));if(_0x41da4c[_0x63e2('0x14')]){if(_0x41da4c[_0x63e2('0x14')][_0x63e2('0x15')]===0x1f4){logger[_0x63e2('0x14')](_0x63e2('0x10'),_0x93e3c7,_0x41da4c['error'][_0x63e2('0x16')]);return _0x1d64fd(_0x41da4c['error'][_0x63e2('0x16')]);}logger[_0x63e2('0x14')](_0x63e2('0x10'),_0x93e3c7,_0x41da4c[_0x63e2('0x14')]['message']);return _0x1fd068(_0x41da4c[_0x63e2('0x14')]['message']);}else{logger[_0x63e2('0xf')](_0x63e2('0x10'),_0x93e3c7,'request\x20sent');_0x1fd068(_0x41da4c[_0x63e2('0x17')][_0x63e2('0x16')]);}})[_0x63e2('0x18')](function(_0x52e0f6){logger[_0x63e2('0x14')](_0x63e2('0x10'),_0x93e3c7,_0x52e0f6);_0x1d64fd(_0x52e0f6);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6579b97..03d7b5e 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 _0x122c=['single','file','addLogo','server/files/images/logos/','logologin','/:id/logo_login','addLogoLogin','%s%s','originalname','/:id/preferred','addPreferred','favicon','addFavicon','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','/:id','show','getLogo','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','logo','extname','post','/:id/logo'];(function(_0x25ce33,_0x595d76){var _0x45c699=function(_0x3c7297){while(--_0x3c7297){_0x25ce33['push'](_0x25ce33['shift']());}};_0x45c699(++_0x595d76);}(_0x122c,0x1dd));var _0xc122=function(_0x362840,_0x549143){_0x362840=_0x362840-0x0;var _0x433ac8=_0x122c[_0x362840];return _0x433ac8;};'use strict';var multer=require(_0xc122('0x0'));var util=require(_0xc122('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc122('0x2'));var router=express[_0xc122('0x3')]();var fs_extra=require(_0xc122('0x4'));var auth=require(_0xc122('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc122('0x6'));var controller=require(_0xc122('0x7'));router[_0xc122('0x8')]('/',auth[_0xc122('0x9')](),controller['index']);router[_0xc122('0x8')](_0xc122('0xa'),controller['getDate']);router[_0xc122('0x8')](_0xc122('0xb'),controller[_0xc122('0xc')]);router[_0xc122('0x8')]('/:id/logo',controller[_0xc122('0xd')]);router[_0xc122('0x8')]('/:id/logo_login',controller[_0xc122('0xe')]);router['get'](_0xc122('0xf'),controller['gdpr']);router[_0xc122('0x8')]('/:id/preferred',controller[_0xc122('0x10')]);router[_0xc122('0x8')](_0xc122('0x11'),controller[_0xc122('0x12')]);var upload=multer({'storage':multer[_0xc122('0x13')]({'destination':function(_0x5c42c9,_0x2f0dba,_0x31369f){_0x31369f(null,path[_0xc122('0x14')](config[_0xc122('0x15')],'server/files/images/logos/'));},'filename':function(_0x3169cd,_0x1a3cf7,_0x386f4c){_0x386f4c(null,util[_0xc122('0x16')]('%s%s',_0xc122('0x17'),path[_0xc122('0x18')](_0x1a3cf7['originalname'])));}})});router[_0xc122('0x19')](_0xc122('0x1a'),upload[_0xc122('0x1b')](_0xc122('0x1c')),controller[_0xc122('0x1d')]);var upload=multer({'storage':multer[_0xc122('0x13')]({'destination':function(_0x2d994c,_0x47c82b,_0x3be326){_0x3be326(null,path['join'](config['root'],_0xc122('0x1e')));},'filename':function(_0xf9fbd6,_0x3348c1,_0x1bb533){_0x1bb533(null,util[_0xc122('0x16')]('%s%s',_0xc122('0x1f'),path[_0xc122('0x18')](_0x3348c1['originalname'])));}})});router[_0xc122('0x19')](_0xc122('0x20'),upload[_0xc122('0x1b')](_0xc122('0x1c')),controller[_0xc122('0x21')]);var upload=multer({'storage':multer[_0xc122('0x13')]({'destination':function(_0x512b8b,_0x4ee22e,_0x1bb363){_0x1bb363(null,path['join'](config[_0xc122('0x15')],_0xc122('0x1e')));},'filename':function(_0x4c517d,_0x46afea,_0x5437b0){_0x5437b0(null,util[_0xc122('0x16')](_0xc122('0x22'),'preferred',path[_0xc122('0x18')](_0x46afea[_0xc122('0x23')])));}})});router['post'](_0xc122('0x24'),upload['single']('file'),controller[_0xc122('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5cc03b,_0x489262,_0x1c9eb7){_0x1c9eb7(null,path['join'](config[_0xc122('0x15')],_0xc122('0x1e')));},'filename':function(_0x2b05c0,_0x54909c,_0x34f704){_0x34f704(null,util[_0xc122('0x16')](_0xc122('0x22'),_0xc122('0x26'),path['extname'](_0x54909c[_0xc122('0x23')])));}})});router[_0xc122('0x19')]('/:id/favicon',upload[_0xc122('0x1b')]('file'),controller[_0xc122('0x27')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc122('0x28')]);module[_0xc122('0x29')]=router; \ No newline at end of file +var _0xbd1e=['addFavicon','put','update','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','%s%s','logo','extname','post','/:id/logo','single','file','addLogo','diskStorage','logologin','addLogoLogin','format','preferred','originalname','addPreferred','favicon'];(function(_0xb50c66,_0x39bf36){var _0x415dd6=function(_0x1a1aed){while(--_0x1a1aed){_0xb50c66['push'](_0xb50c66['shift']());}};_0x415dd6(++_0x39bf36);}(_0xbd1e,0x105));var _0xebd1=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0xbd1e[_0x37e845];return _0x59e55b;};'use strict';var multer=require(_0xebd1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xebd1('0x1'));var express=require(_0xebd1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xebd1('0x3'));var interaction=require(_0xebd1('0x4'));var config=require(_0xebd1('0x5'));var controller=require(_0xebd1('0x6'));router[_0xebd1('0x7')]('/',auth[_0xebd1('0x8')](),controller[_0xebd1('0x9')]);router[_0xebd1('0x7')](_0xebd1('0xa'),controller[_0xebd1('0xb')]);router[_0xebd1('0x7')](_0xebd1('0xc'),controller[_0xebd1('0xd')]);router[_0xebd1('0x7')]('/:id/logo',controller['getLogo']);router['get'](_0xebd1('0xe'),controller[_0xebd1('0xf')]);router[_0xebd1('0x7')](_0xebd1('0x10'),controller[_0xebd1('0x11')]);router[_0xebd1('0x7')](_0xebd1('0x12'),controller[_0xebd1('0x13')]);router['get'](_0xebd1('0x14'),controller[_0xebd1('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x360522,_0x27226f,_0x2fdf46){_0x2fdf46(null,path[_0xebd1('0x16')](config[_0xebd1('0x17')],'server/files/images/logos/'));},'filename':function(_0x3b8242,_0x272b8d,_0x25b572){_0x25b572(null,util['format'](_0xebd1('0x18'),_0xebd1('0x19'),path[_0xebd1('0x1a')](_0x272b8d['originalname'])));}})});router[_0xebd1('0x1b')](_0xebd1('0x1c'),upload[_0xebd1('0x1d')](_0xebd1('0x1e')),controller[_0xebd1('0x1f')]);var upload=multer({'storage':multer[_0xebd1('0x20')]({'destination':function(_0x500206,_0x56c10b,_0x498f6d){_0x498f6d(null,path['join'](config[_0xebd1('0x17')],'server/files/images/logos/'));},'filename':function(_0x158c4e,_0x4ea42f,_0x3a8d31){_0x3a8d31(null,util['format'](_0xebd1('0x18'),_0xebd1('0x21'),path[_0xebd1('0x1a')](_0x4ea42f['originalname'])));}})});router[_0xebd1('0x1b')](_0xebd1('0xe'),upload['single'](_0xebd1('0x1e')),controller[_0xebd1('0x22')]);var upload=multer({'storage':multer[_0xebd1('0x20')]({'destination':function(_0x2a8f9d,_0x3f8f69,_0x36257c){_0x36257c(null,path['join'](config[_0xebd1('0x17')],'server/files/images/logos/'));},'filename':function(_0x3d6a9b,_0x2d6150,_0x164946){_0x164946(null,util[_0xebd1('0x23')](_0xebd1('0x18'),_0xebd1('0x24'),path[_0xebd1('0x1a')](_0x2d6150[_0xebd1('0x25')])));}})});router['post']('/:id/preferred',upload[_0xebd1('0x1d')](_0xebd1('0x1e')),controller[_0xebd1('0x26')]);var upload=multer({'storage':multer[_0xebd1('0x20')]({'destination':function(_0x10ae6a,_0x44c375,_0x5a9035){_0x5a9035(null,path[_0xebd1('0x16')](config[_0xebd1('0x17')],'server/files/images/logos/'));},'filename':function(_0x3fcf7b,_0x16667a,_0x3e16a7){_0x3e16a7(null,util['format']('%s%s',_0xebd1('0x27'),path[_0xebd1('0x1a')](_0x16667a[_0xebd1('0x25')])));}})});router[_0xebd1('0x1b')](_0xebd1('0x14'),upload[_0xebd1('0x1d')](_0xebd1('0x1e')),controller[_0xebd1('0x28')]);router[_0xebd1('0x29')](_0xebd1('0xc'),auth['isAuthenticated'](),controller[_0xebd1('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index fd3782f..02bcc70 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 _0xe35d=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','UNSIGNED','sequelize','exports','INTEGER'];(function(_0x1f41e4,_0x33d1ec){var _0x4de347=function(_0x3a8468){while(--_0x3a8468){_0x1f41e4['push'](_0x1f41e4['shift']());}};_0x4de347(++_0x33d1ec);}(_0xe35d,0xd5));var _0xde35=function(_0x20b399,_0x3554f0){_0x20b399=_0x20b399-0x0;var _0x21691f=_0xe35d[_0x20b399];return _0x21691f;};'use strict';var Sequelize=require(_0xde35('0x0'));module[_0xde35('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xde35('0x2')](0xb),'unique':_0xde35('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xde35('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xde35('0x4')],'defaultValue':_0xde35('0x5')},'logo':{'type':Sequelize[_0xde35('0x4')]},'defaultLogo':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xde35('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xde35('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xde35('0x4')]},'turnaddr':{'type':Sequelize[_0xde35('0x4')]},'turnusername':{'type':Sequelize[_0xde35('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xde35('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xde35('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xde35('0x4')]},'defaultFavicon':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xde35('0x2')]},'transcribeRegion':{'type':Sequelize[_0xde35('0x4')]},'sentiment':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xde35('0x2')]},'sentimentRegion':{'type':Sequelize[_0xde35('0x4')]},'language':{'type':Sequelize[_0xde35('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xde35('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xde35('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xde35('0x2')](0x2)[_0xde35('0x7')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xde35('0x2')](0x2)[_0xde35('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xde35('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xde35('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xde35('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xabf9=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x5f45f0,_0x9f9837){var _0x8487d=function(_0x5d7ee3){while(--_0x5d7ee3){_0x5f45f0['push'](_0x5f45f0['shift']());}};_0x8487d(++_0x9f9837);}(_0xabf9,0x1e4));var _0x9abf=function(_0x5cd1bc,_0xeadc4a){_0x5cd1bc=_0x5cd1bc-0x0;var _0x21cd92=_0xabf9[_0x5cd1bc];return _0x21cd92;};'use strict';var Sequelize=require(_0x9abf('0x0'));module[_0x9abf('0x1')]={'min_internal':{'type':Sequelize[_0x9abf('0x2')](0xb),'unique':_0x9abf('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x9abf('0x2')](0xb),'unique':_0x9abf('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x9abf('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x9abf('0x5')],'defaultValue':_0x9abf('0x6')},'logo':{'type':Sequelize[_0x9abf('0x5')]},'defaultLogo':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x9abf('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x9abf('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x9abf('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x9abf('0x5')]},'pageTitle':{'type':Sequelize[_0x9abf('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x9abf('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x9abf('0x5')],'defaultValue':_0x9abf('0x8')},'enableEmailPreview':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x9abf('0x5')],'defaultValue':_0x9abf('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x9abf('0x5')]},'defaultPreferred':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x9abf('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x9abf('0x5')]},'defaultFavicon':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x9abf('0x5')]},'sentiment':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x9abf('0x2')]},'sentimentRegion':{'type':Sequelize[_0x9abf('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x9abf('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x9abf('0x2')](0x2)[_0x9abf('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x9abf('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x9abf('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x9abf('0x2')](0x2)[_0x9abf('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x9abf('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x9abf('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 4ecd9d8..503f631 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 _0x13ad=['update','destroy','stack','name','send','index','Setting','fieldName','key','model','map','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','show','keys','rawAttributes','length','merge','find','body','params','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','preferred','default_loginLogo.svg','securePassword','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x57001f,_0xdc14e7){var _0x3bcc3b=function(_0x5107c2){while(--_0x5107c2){_0x57001f['push'](_0x57001f['shift']());}};_0x3bcc3b(++_0xdc14e7);}(_0x13ad,0x142));var _0xd13a=function(_0x54a081,_0x1fda89){_0x54a081=_0x54a081-0x0;var _0x58a652=_0x13ad[_0x54a081];return _0x58a652;};'use strict';var emlformat=require(_0xd13a('0x0'));var rimraf=require(_0xd13a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd13a('0x2'));var rp=require(_0xd13a('0x3'));var moment=require(_0xd13a('0x4'));var BPromise=require(_0xd13a('0x5'));var Mustache=require(_0xd13a('0x6'));var util=require('util');var path=require(_0xd13a('0x7'));var sox=require(_0xd13a('0x8'));var csv=require(_0xd13a('0x9'));var ejs=require(_0xd13a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd13a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd13a('0xc'));var toCsv=require(_0xd13a('0x9'));var querystring=require('querystring');var Papa=require(_0xd13a('0xd'));var Redis=require('ioredis');var authService=require(_0xd13a('0xe'));var qs=require(_0xd13a('0xf'));var as=require(_0xd13a('0x10'));var hardwareService=require(_0xd13a('0x11'));var logger=require(_0xd13a('0x12'))(_0xd13a('0x13'));var utils=require(_0xd13a('0x14'));var config=require(_0xd13a('0x15'));var licenseUtil=require(_0xd13a('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd13a('0x17'));var client=jayson[_0xd13a('0x18')][_0xd13a('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3dc68e,_0x34ee52,_0x35869b,_0x23ce90){return new BPromise(function(_0x46a04f,_0x4a59e1){var _0x173a8b=_0x23ce90||client;return _0x173a8b[_0xd13a('0x1a')](_0x3dc68e,_0x35869b)[_0xd13a('0x1b')](function(_0x568a6d){logger[_0xd13a('0x1c')](_0xd13a('0x1d'),_0x34ee52,_0xd13a('0x1e'));logger[_0xd13a('0x1f')](_0xd13a('0x20'),_0x34ee52,'request\x20sent',JSON[_0xd13a('0x21')](_0x568a6d));if(_0x568a6d['error']){if(_0x568a6d[_0xd13a('0x22')][_0xd13a('0x23')]===0x1f4){logger['error'](_0xd13a('0x1d'),_0x34ee52,_0x568a6d[_0xd13a('0x22')][_0xd13a('0x24')]);return _0x4a59e1(_0x568a6d['error'][_0xd13a('0x24')]);}logger[_0xd13a('0x22')](_0xd13a('0x1d'),_0x34ee52,_0x568a6d['error']['message']);return _0x46a04f(_0x568a6d[_0xd13a('0x22')][_0xd13a('0x24')]);}else{logger[_0xd13a('0x1c')]('Setting,\x20%s,\x20%s',_0x34ee52,_0xd13a('0x1e'));_0x46a04f(_0x568a6d[_0xd13a('0x25')][_0xd13a('0x24')]);}})[_0xd13a('0x26')](function(_0x46b061){logger[_0xd13a('0x22')](_0xd13a('0x1d'),_0x34ee52,_0x46b061);_0x4a59e1(_0x46b061);});});}function respondWithStatusCode(_0x368efc,_0x4a06cc){_0x4a06cc=_0x4a06cc||0xcc;return function(_0x452885){if(_0x452885){return _0x368efc[_0xd13a('0x27')](_0x4a06cc);}return _0x368efc[_0xd13a('0x28')](_0x4a06cc)[_0xd13a('0x29')]();};}function respondWithResult(_0x445268,_0x52652b){_0x52652b=_0x52652b||0xc8;return function(_0x2376b4){if(_0x2376b4){return _0x445268['status'](_0x52652b)[_0xd13a('0x2a')](_0x2376b4);}};}function respondWithFilteredResult(_0x4d3aec,_0x4e7bf2){return function(_0x412755){if(_0x412755){var _0x1ee631=typeof _0x4e7bf2['offset']===_0xd13a('0x2b')&&typeof _0x4e7bf2[_0xd13a('0x2c')]==='undefined';var _0x3eb21d=_0x412755[_0xd13a('0x2d')];var _0x5bc796=_0x1ee631?0x0:_0x4e7bf2[_0xd13a('0x2e')];var _0x586c31=_0x1ee631?_0x412755[_0xd13a('0x2d')]:_0x4e7bf2[_0xd13a('0x2e')]+_0x4e7bf2['limit'];var _0x5cea1c;if(_0x586c31>=_0x3eb21d){_0x586c31=_0x3eb21d;_0x5cea1c=0xc8;}else{_0x5cea1c=0xce;}_0x4d3aec[_0xd13a('0x28')](_0x5cea1c);return _0x4d3aec['set'](_0xd13a('0x2f'),_0x5bc796+'-'+_0x586c31+'/'+_0x3eb21d)[_0xd13a('0x2a')](_0x412755);}return null;};}function patchUpdates(_0x54a3ef){return function(_0x7a23b3){try{jsonpatch[_0xd13a('0x30')](_0x7a23b3,_0x54a3ef,!![]);}catch(_0x1ed131){return BPromise[_0xd13a('0x31')](_0x1ed131);}return _0x7a23b3['save']();};}function saveUpdates(_0x410510,_0x548b32){return function(_0x3ee377){if(_0x3ee377){return _0x3ee377[_0xd13a('0x32')](_0x410510)[_0xd13a('0x1b')](function(_0x2357d9){return _0x2357d9;});}return null;};}function removeEntity(_0x5a4323,_0x437a3c){return function(_0x4bfee7){if(_0x4bfee7){return _0x4bfee7[_0xd13a('0x33')]()['then'](function(){_0x5a4323[_0xd13a('0x28')](0xcc)[_0xd13a('0x29')]();});}};}function handleEntityNotFound(_0x469938,_0x3ea609){return function(_0xa02508){if(!_0xa02508){_0x469938[_0xd13a('0x27')](0x194);}return _0xa02508;};}function handleError(_0x48f391,_0xadeb85){_0xadeb85=_0xadeb85||0x1f4;return function(_0x1be02f){logger[_0xd13a('0x22')](_0x1be02f[_0xd13a('0x34')]);if(_0x1be02f['name']){delete _0x1be02f[_0xd13a('0x35')];}_0x48f391[_0xd13a('0x28')](_0xadeb85)[_0xd13a('0x36')](_0x1be02f);};}exports[_0xd13a('0x37')]=function(_0x503a6a,_0x2e3484){var _0x509a48={},_0x1cd45b={},_0x5daa37={'count':0x0,'rows':[]};var _0x51c479=_['map'](db[_0xd13a('0x38')]['rawAttributes'],function(_0x44945b){return{'name':_0x44945b[_0xd13a('0x39')],'type':_0x44945b['type'][_0xd13a('0x3a')]};});_0x1cd45b[_0xd13a('0x3b')]=_[_0xd13a('0x3c')](_0x51c479,_0xd13a('0x35'));_0x1cd45b[_0xd13a('0x3d')]=_['keys'](_0x503a6a[_0xd13a('0x3d')]);_0x1cd45b['filters']=_[_0xd13a('0x3e')](_0x1cd45b[_0xd13a('0x3b')],_0x1cd45b['query']);_0x509a48['attributes']=_[_0xd13a('0x3e')](_0x1cd45b['model'],qs[_0xd13a('0x3f')](_0x503a6a[_0xd13a('0x3d')][_0xd13a('0x3f')]));_0x509a48['attributes']=_0x509a48[_0xd13a('0x40')]['length']?_0x509a48['attributes']:_0x1cd45b['model'];if(!_0x503a6a['query']['hasOwnProperty'](_0xd13a('0x41'))){_0x509a48['limit']=qs['limit'](_0x503a6a[_0xd13a('0x3d')][_0xd13a('0x2c')]);_0x509a48[_0xd13a('0x2e')]=qs[_0xd13a('0x2e')](_0x503a6a['query'][_0xd13a('0x2e')]);}_0x509a48[_0xd13a('0x42')]=qs[_0xd13a('0x43')](_0x503a6a[_0xd13a('0x3d')]['sort']);_0x509a48[_0xd13a('0x44')]=qs[_0xd13a('0x45')](_[_0xd13a('0x46')](_0x503a6a[_0xd13a('0x3d')],_0x1cd45b['filters']),_0x51c479);if(_0x503a6a['query'][_0xd13a('0x47')]){_0x509a48[_0xd13a('0x44')]=_['merge'](_0x509a48[_0xd13a('0x44')],{'$or':_[_0xd13a('0x3c')](_0x51c479,function(_0x309961){if(_0x309961[_0xd13a('0x48')]!==_0xd13a('0x49')){var _0x36f9df={};_0x36f9df[_0x309961[_0xd13a('0x35')]]={'$like':'%'+_0x503a6a[_0xd13a('0x3d')][_0xd13a('0x47')]+'%'};return _0x36f9df;}})});}_0x509a48=_['merge']({},_0x509a48,_0x503a6a['options']);var _0x541099={'where':_0x509a48[_0xd13a('0x44')]};return db[_0xd13a('0x38')][_0xd13a('0x2d')](_0x541099)[_0xd13a('0x1b')](function(_0x157e1d){_0x5daa37['count']=_0x157e1d;if(_0x503a6a[_0xd13a('0x3d')][_0xd13a('0x4a')]){_0x509a48[_0xd13a('0x4b')]=[{'all':!![]}];}return db['Setting'][_0xd13a('0x4c')](_0x509a48);})[_0xd13a('0x1b')](function(_0x1c18cf){_0x5daa37[_0xd13a('0x4d')]=_0x1c18cf;return _0x5daa37;})[_0xd13a('0x1b')](respondWithFilteredResult(_0x2e3484,_0x509a48))['catch'](handleError(_0x2e3484,null));};exports[_0xd13a('0x4e')]=function(_0x3939c8,_0x5221f1){var _0x8c388a={'raw':![],'where':{'id':_0x3939c8['params']['id']}},_0x4f92bb={};_0x4f92bb[_0xd13a('0x3b')]=_[_0xd13a('0x4f')](db[_0xd13a('0x38')][_0xd13a('0x50')]);_0x4f92bb[_0xd13a('0x3d')]=_[_0xd13a('0x4f')](_0x3939c8[_0xd13a('0x3d')]);_0x4f92bb[_0xd13a('0x45')]=_['intersection'](_0x4f92bb['model'],_0x4f92bb[_0xd13a('0x3d')]);_0x8c388a['attributes']=_['intersection'](_0x4f92bb[_0xd13a('0x3b')],qs[_0xd13a('0x3f')](_0x3939c8[_0xd13a('0x3d')][_0xd13a('0x3f')]));_0x8c388a[_0xd13a('0x40')]=_0x8c388a[_0xd13a('0x40')][_0xd13a('0x51')]?_0x8c388a[_0xd13a('0x40')]:_0x4f92bb[_0xd13a('0x3b')];if(_0x3939c8[_0xd13a('0x3d')][_0xd13a('0x4a')]){_0x8c388a[_0xd13a('0x4b')]=[{'all':!![]}];}_0x8c388a=_[_0xd13a('0x52')]({},_0x8c388a,_0x3939c8['options']);return db[_0xd13a('0x38')][_0xd13a('0x53')](_0x8c388a)['then'](handleEntityNotFound(_0x5221f1,null))[_0xd13a('0x1b')](respondWithResult(_0x5221f1,null))[_0xd13a('0x26')](handleError(_0x5221f1,null));};exports[_0xd13a('0x32')]=function(_0x5475e1,_0x541eea){if(_0x5475e1[_0xd13a('0x54')]['id']){delete _0x5475e1[_0xd13a('0x54')]['id'];}return db[_0xd13a('0x38')][_0xd13a('0x53')]({'where':{'id':_0x5475e1[_0xd13a('0x55')]['id']}})['then'](handleEntityNotFound(_0x541eea,null))[_0xd13a('0x1b')](saveUpdates(_0x5475e1[_0xd13a('0x54')],null))['then'](respondWithResult(_0x541eea,null))[_0xd13a('0x26')](handleError(_0x541eea,null));};exports[_0xd13a('0x56')]=function(_0x59ddd3,_0x2d93c6,_0x5c9d7e){if(_0x59ddd3['file']&&_0x59ddd3[_0xd13a('0x57')]['filename']){_0x59ddd3[_0xd13a('0x54')][_0xd13a('0x58')]=_0x59ddd3['file'][_0xd13a('0x59')];}return db[_0xd13a('0x38')][_0xd13a('0x53')]({'where':{'id':_0x59ddd3[_0xd13a('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d93c6,null))['then'](saveUpdates(_0x59ddd3[_0xd13a('0x54')],null))[_0xd13a('0x1b')](respondWithResult(_0x2d93c6,null))[_0xd13a('0x26')](handleError(_0x2d93c6,null));};exports[_0xd13a('0x5a')]=function(_0x50ec91,_0x55aa44,_0x1305e1){if(_0x50ec91[_0xd13a('0x57')]&&_0x50ec91[_0xd13a('0x57')][_0xd13a('0x59')]){_0x50ec91[_0xd13a('0x54')][_0xd13a('0x5b')]=_0x50ec91[_0xd13a('0x57')][_0xd13a('0x59')];}return db[_0xd13a('0x38')]['find']({'where':{'id':_0x50ec91[_0xd13a('0x55')]['id']}})[_0xd13a('0x1b')](handleEntityNotFound(_0x55aa44,null))['then'](saveUpdates(_0x50ec91[_0xd13a('0x54')],null))[_0xd13a('0x1b')](respondWithResult(_0x55aa44,null))[_0xd13a('0x26')](handleError(_0x55aa44,null));};var utilLicense=require(_0xd13a('0x16'));exports[_0xd13a('0x5c')]=function(_0x2b1350,_0xdb485d,_0x3148ff){var _0x1a30c3=_0xd13a('0x5d');var _0x4d14ca={'custom':![]};return utilLicense[_0xd13a('0x5e')]()['then'](function(_0x182ba2){if(_0x182ba2){_0x4d14ca=_0x182ba2;}return db[_0xd13a('0x38')][_0xd13a('0x53')]({'where':{'id':_0x2b1350[_0xd13a('0x55')]['id']},'attributes':[_0xd13a('0x58'),'loginLogo','preferred',_0xd13a('0x5f'),_0xd13a('0x60'),_0xd13a('0x61'),_0xd13a('0x62'),_0xd13a('0x63')],'raw':!![]});})[_0xd13a('0x1b')](handleEntityNotFound(_0xdb485d,null))[_0xd13a('0x1b')](function(_0x268d6a){if(_0x268d6a){var _0x439aa5=_0x268d6a[_0xd13a('0x58')]&&fs[_0xd13a('0x64')](path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x1a30c3,_[_0xd13a('0x67')](_0x268d6a['logo'])))?path[_0xd13a('0x65')](config['root'],_0x1a30c3,_[_0xd13a('0x67')](_0x268d6a[_0xd13a('0x58')])):path['join'](config['root'],_0x1a30c3,_[_0xd13a('0x67')]('default_logo.svg'));var _0xaa5a93=_0xd13a('0x68')+_[_0xd13a('0x69')](_0xd13a('0x58'));if(_0x268d6a[_0xaa5a93]||!_0x4d14ca[_0xd13a('0x6a')]){_0x439aa5=path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x1a30c3,_[_0xd13a('0x67')](_0xd13a('0x6b')));}if(!fs[_0xd13a('0x64')](_0x439aa5)){throw new db[(_0xd13a('0x6c'))][(_0xd13a('0x6d'))](_['upperFirst'](_0xd13a('0x58'))+_0xd13a('0x6e'));}return _0xdb485d[_0xd13a('0x6f')](_0x439aa5);}})['catch'](handleError(_0xdb485d,null));};var utilLicense=require(_0xd13a('0x16'));exports['getLogoLogin']=function(_0x117bb0,_0x3020de,_0x8bd00b){var _0x4bdb75=_0xd13a('0x5d');var _0x31db3d={'custom':![]};return utilLicense[_0xd13a('0x5e')]()[_0xd13a('0x1b')](function(_0x17242d){if(_0x17242d){_0x31db3d=_0x17242d;}return db[_0xd13a('0x38')]['find']({'where':{'id':_0x117bb0[_0xd13a('0x55')]['id']},'attributes':[_0xd13a('0x58'),_0xd13a('0x5b'),_0xd13a('0x70'),_0xd13a('0x5f'),_0xd13a('0x60'),_0xd13a('0x61'),_0xd13a('0x62'),_0xd13a('0x63')],'raw':!![]});})[_0xd13a('0x1b')](handleEntityNotFound(_0x3020de,null))[_0xd13a('0x1b')](function(_0x1c74a4){if(_0x1c74a4){var _0x1ac821=_0x1c74a4[_0xd13a('0x5b')]&&fs[_0xd13a('0x64')](path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x4bdb75,_[_0xd13a('0x67')](_0x1c74a4[_0xd13a('0x5b')])))?path['join'](config[_0xd13a('0x66')],_0x4bdb75,_[_0xd13a('0x67')](_0x1c74a4[_0xd13a('0x5b')])):path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x4bdb75,_['toLower'](_0xd13a('0x71')));var _0x396631=_0xd13a('0x68')+_[_0xd13a('0x69')](_0xd13a('0x5b'));if(_0x1c74a4[_0x396631]||!_0x31db3d['custom']){_0x1ac821=path[_0xd13a('0x65')](config['root'],_0x4bdb75,_[_0xd13a('0x67')](_0xd13a('0x71')));}if(!fs[_0xd13a('0x64')](_0x1ac821)){throw new db[(_0xd13a('0x6c'))][(_0xd13a('0x6d'))](_[_0xd13a('0x69')](_0xd13a('0x5b'))+_0xd13a('0x6e'));}return _0x3020de[_0xd13a('0x6f')](_0x1ac821);}})[_0xd13a('0x26')](handleError(_0x3020de,null));};exports['gdpr']=function(_0xa5ce39,_0x40427f){return db['Setting'][_0xd13a('0x53')]({'where':{'id':_0xa5ce39[_0xd13a('0x55')]['id']},'attributes':[_0xd13a('0x72')]})['then'](respondWithResult(_0x40427f,null))['catch'](handleError(_0x40427f,null));};exports['addPreferred']=function(_0x508120,_0x50f194,_0xc56b7d){if(_0x508120[_0xd13a('0x57')]&&_0x508120[_0xd13a('0x57')]['filename']){_0x508120[_0xd13a('0x54')][_0xd13a('0x70')]=_0x508120['file'][_0xd13a('0x59')];}return db[_0xd13a('0x38')][_0xd13a('0x53')]({'where':{'id':_0x508120[_0xd13a('0x55')]['id']}})[_0xd13a('0x1b')](handleEntityNotFound(_0x50f194,null))[_0xd13a('0x1b')](saveUpdates(_0x508120[_0xd13a('0x54')],null))[_0xd13a('0x1b')](respondWithResult(_0x50f194,null))['catch'](handleError(_0x50f194,null));};var utilLicense=require(_0xd13a('0x16'));exports[_0xd13a('0x73')]=function(_0x2a84ed,_0x55bdc4,_0x40610e){var _0x462f0e=_0xd13a('0x5d');var _0x3516d1={'custom':![]};return utilLicense[_0xd13a('0x5e')]()['then'](function(_0xe90ba6){if(_0xe90ba6){_0x3516d1=_0xe90ba6;}return db['Setting'][_0xd13a('0x53')]({'where':{'id':_0x2a84ed[_0xd13a('0x55')]['id']},'attributes':[_0xd13a('0x58'),_0xd13a('0x5b'),'preferred',_0xd13a('0x5f'),_0xd13a('0x60'),'defaultLoginLogo',_0xd13a('0x62'),_0xd13a('0x63')],'raw':!![]});})[_0xd13a('0x1b')](handleEntityNotFound(_0x55bdc4,null))[_0xd13a('0x1b')](function(_0xc4977b){if(_0xc4977b){var _0x77eff=_0xc4977b['preferred']&&fs[_0xd13a('0x64')](path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x462f0e,_[_0xd13a('0x67')](_0xc4977b['preferred'])))?path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x462f0e,_[_0xd13a('0x67')](_0xc4977b[_0xd13a('0x70')])):path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x462f0e,_[_0xd13a('0x67')]('default_preferred.png'));var _0x8ceacc=_0xd13a('0x68')+_['upperFirst'](_0xd13a('0x70'));if(_0xc4977b[_0x8ceacc]||!_0x3516d1[_0xd13a('0x6a')]||!_0x3516d1[_0xd13a('0x70')]){_0x77eff=path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x462f0e,_['toLower'](_0xd13a('0x74')));}if(!fs[_0xd13a('0x64')](_0x77eff)){throw new db[(_0xd13a('0x6c'))]['ValidationError'](_[_0xd13a('0x69')](_0xd13a('0x70'))+_0xd13a('0x6e'));}return _0x55bdc4[_0xd13a('0x6f')](_0x77eff);}})['catch'](handleError(_0x55bdc4,null));};exports[_0xd13a('0x75')]=function(_0x428ed3,_0x31e0b1,_0x148dcf){if(_0x428ed3[_0xd13a('0x57')]&&_0x428ed3[_0xd13a('0x57')][_0xd13a('0x59')]){_0x428ed3[_0xd13a('0x54')][_0xd13a('0x5f')]=_0x428ed3[_0xd13a('0x57')][_0xd13a('0x59')];}return db[_0xd13a('0x38')][_0xd13a('0x53')]({'where':{'id':_0x428ed3[_0xd13a('0x55')]['id']}})[_0xd13a('0x1b')](handleEntityNotFound(_0x31e0b1,null))[_0xd13a('0x1b')](saveUpdates(_0x428ed3['body'],null))[_0xd13a('0x1b')](respondWithResult(_0x31e0b1,null))['catch'](handleError(_0x31e0b1,null));};var utilLicense=require(_0xd13a('0x16'));exports[_0xd13a('0x76')]=function(_0x2a9bc4,_0x45c7bb,_0x3f310f){var _0x723516=_0xd13a('0x5d');var _0x45dc15={'custom':![]};return utilLicense[_0xd13a('0x5e')]()[_0xd13a('0x1b')](function(_0xec8cfb){if(_0xec8cfb){_0x45dc15=_0xec8cfb;}return db[_0xd13a('0x38')][_0xd13a('0x53')]({'where':{'id':_0x2a9bc4[_0xd13a('0x55')]['id']},'attributes':[_0xd13a('0x58'),'loginLogo',_0xd13a('0x70'),_0xd13a('0x5f'),_0xd13a('0x60'),_0xd13a('0x61'),'defaultPreferred',_0xd13a('0x63')],'raw':!![]});})[_0xd13a('0x1b')](handleEntityNotFound(_0x45c7bb,null))[_0xd13a('0x1b')](function(_0x5881d1){if(_0x5881d1){var _0x468e20=_0x5881d1[_0xd13a('0x5f')]&&fs['existsSync'](path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x723516,_[_0xd13a('0x67')](_0x5881d1[_0xd13a('0x5f')])))?path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x723516,_[_0xd13a('0x67')](_0x5881d1[_0xd13a('0x5f')])):path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x723516,_['toLower'](_0xd13a('0x77')));var _0x3b6eec='default'+_[_0xd13a('0x69')](_0xd13a('0x5f'));if(_0x5881d1[_0x3b6eec]||!_0x45dc15['custom']){_0x468e20=path[_0xd13a('0x65')](config[_0xd13a('0x66')],_0x723516,_[_0xd13a('0x67')]('default_favicon.ico'));}if(!fs[_0xd13a('0x64')](_0x468e20)){throw new db[(_0xd13a('0x6c'))]['ValidationError'](_[_0xd13a('0x69')](_0xd13a('0x5f'))+_0xd13a('0x6e'));}return _0x45c7bb[_0xd13a('0x6f')](_0x468e20);}})[_0xd13a('0x26')](handleError(_0x45c7bb,null));};exports[_0xd13a('0x78')]=function(_0x4eb4d6,_0x7110b1){var _0x5362d7={'offset':moment()[_0xd13a('0x79')]()};_0x5362d7['now']=moment()[_0xd13a('0x79')](_0x5362d7[_0xd13a('0x2e')])[_0xd13a('0x7a')](_0xd13a('0x7b'));return _0x7110b1[_0xd13a('0x28')](0xc8)[_0xd13a('0x36')](_0x5362d7);}; \ No newline at end of file +var _0xb957=['crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','body','find','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','upperFirst','\x20not\x20found','download','getLogoLogin','defaultLoginLogo','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','Sequelize','addFavicon','getFavicon','default_favicon.ico','ValidationError','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x154efd,_0x27c90d){var _0x331e99=function(_0x3458ad){while(--_0x3458ad){_0x154efd['push'](_0x154efd['shift']());}};_0x331e99(++_0x27c90d);}(_0xb957,0x6d));var _0x7b95=function(_0x395c78,_0x516779){_0x395c78=_0x395c78-0x0;var _0x15442a=_0xb957[_0x395c78];return _0x15442a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7b95('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b95('0x1'));var moment=require(_0x7b95('0x2'));var BPromise=require(_0x7b95('0x3'));var Mustache=require('mustache');var util=require(_0x7b95('0x4'));var path=require(_0x7b95('0x5'));var sox=require(_0x7b95('0x6'));var csv=require(_0x7b95('0x7'));var ejs=require(_0x7b95('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b95('0x9'));var squel=require(_0x7b95('0xa'));var crypto=require(_0x7b95('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7b95('0x7'));var querystring=require(_0x7b95('0xc'));var Papa=require(_0x7b95('0xd'));var Redis=require(_0x7b95('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b95('0xf'));var logger=require(_0x7b95('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x7b95('0x11'));var licenseUtil=require(_0x7b95('0x12'));var db=require(_0x7b95('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x7b95('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x48fcb0,_0x1a1da9,_0xc4f33a,_0x7e63d3){return new BPromise(function(_0x3818bd,_0x5dedf2){var _0x4d503a=_0x7e63d3||client;return _0x4d503a[_0x7b95('0x15')](_0x48fcb0,_0xc4f33a)[_0x7b95('0x16')](function(_0x241ccf){logger[_0x7b95('0x17')](_0x7b95('0x18'),_0x1a1da9,_0x7b95('0x19'));logger[_0x7b95('0x1a')](_0x7b95('0x1b'),_0x1a1da9,_0x7b95('0x19'),JSON[_0x7b95('0x1c')](_0x241ccf));if(_0x241ccf[_0x7b95('0x1d')]){if(_0x241ccf['error'][_0x7b95('0x1e')]===0x1f4){logger[_0x7b95('0x1d')](_0x7b95('0x18'),_0x1a1da9,_0x241ccf[_0x7b95('0x1d')][_0x7b95('0x1f')]);return _0x5dedf2(_0x241ccf[_0x7b95('0x1d')][_0x7b95('0x1f')]);}logger[_0x7b95('0x1d')]('Setting,\x20%s,\x20%s',_0x1a1da9,_0x241ccf[_0x7b95('0x1d')][_0x7b95('0x1f')]);return _0x3818bd(_0x241ccf[_0x7b95('0x1d')][_0x7b95('0x1f')]);}else{logger[_0x7b95('0x17')](_0x7b95('0x18'),_0x1a1da9,_0x7b95('0x19'));_0x3818bd(_0x241ccf[_0x7b95('0x20')][_0x7b95('0x1f')]);}})[_0x7b95('0x21')](function(_0x1d44c4){logger[_0x7b95('0x1d')](_0x7b95('0x18'),_0x1a1da9,_0x1d44c4);_0x5dedf2(_0x1d44c4);});});}function respondWithStatusCode(_0x41d7cf,_0x4acc74){_0x4acc74=_0x4acc74||0xcc;return function(_0x1c0a41){if(_0x1c0a41){return _0x41d7cf[_0x7b95('0x22')](_0x4acc74);}return _0x41d7cf['status'](_0x4acc74)[_0x7b95('0x23')]();};}function respondWithResult(_0x39b5fe,_0x184d4f){_0x184d4f=_0x184d4f||0xc8;return function(_0x6edd4f){if(_0x6edd4f){return _0x39b5fe[_0x7b95('0x24')](_0x184d4f)[_0x7b95('0x25')](_0x6edd4f);}};}function respondWithFilteredResult(_0x3b9d60,_0x578169){return function(_0x293ce3){if(_0x293ce3){var _0x58ea1d=typeof _0x578169[_0x7b95('0x26')]===_0x7b95('0x27')&&typeof _0x578169[_0x7b95('0x28')]===_0x7b95('0x27');var _0x43504f=_0x293ce3[_0x7b95('0x29')];var _0x492752=_0x58ea1d?0x0:_0x578169[_0x7b95('0x26')];var _0x1ea19b=_0x58ea1d?_0x293ce3['count']:_0x578169[_0x7b95('0x26')]+_0x578169[_0x7b95('0x28')];var _0xcf7caf;if(_0x1ea19b>=_0x43504f){_0x1ea19b=_0x43504f;_0xcf7caf=0xc8;}else{_0xcf7caf=0xce;}_0x3b9d60[_0x7b95('0x24')](_0xcf7caf);return _0x3b9d60['set'](_0x7b95('0x2a'),_0x492752+'-'+_0x1ea19b+'/'+_0x43504f)[_0x7b95('0x25')](_0x293ce3);}return null;};}function patchUpdates(_0x45ffb5){return function(_0x5a9488){try{jsonpatch['apply'](_0x5a9488,_0x45ffb5,!![]);}catch(_0x57def4){return BPromise[_0x7b95('0x2b')](_0x57def4);}return _0x5a9488['save']();};}function saveUpdates(_0x324f02,_0x50c3b5){return function(_0x1d42a1){if(_0x1d42a1){return _0x1d42a1[_0x7b95('0x2c')](_0x324f02)['then'](function(_0x5c6c3c){return _0x5c6c3c;});}return null;};}function removeEntity(_0x2b3120,_0x1e6d7a){return function(_0x1140e0){if(_0x1140e0){return _0x1140e0[_0x7b95('0x2d')]()[_0x7b95('0x16')](function(){_0x2b3120[_0x7b95('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29eaa1,_0xeff6b6){return function(_0x1e6176){if(!_0x1e6176){_0x29eaa1[_0x7b95('0x22')](0x194);}return _0x1e6176;};}function handleError(_0x4f05eb,_0x5ad107){_0x5ad107=_0x5ad107||0x1f4;return function(_0xb0ebf1){logger[_0x7b95('0x1d')](_0xb0ebf1[_0x7b95('0x2e')]);if(_0xb0ebf1[_0x7b95('0x2f')]){delete _0xb0ebf1[_0x7b95('0x2f')];}_0x4f05eb[_0x7b95('0x24')](_0x5ad107)[_0x7b95('0x30')](_0xb0ebf1);};}exports[_0x7b95('0x31')]=function(_0x4b87d,_0x405ea9){var _0x1005b8={},_0x248b95={},_0x39eca8={'count':0x0,'rows':[]};var _0x590483=_[_0x7b95('0x32')](db[_0x7b95('0x33')][_0x7b95('0x34')],function(_0x2fce22){return{'name':_0x2fce22[_0x7b95('0x35')],'type':_0x2fce22[_0x7b95('0x36')][_0x7b95('0x37')]};});_0x248b95[_0x7b95('0x38')]=_['map'](_0x590483,'name');_0x248b95[_0x7b95('0x39')]=_[_0x7b95('0x3a')](_0x4b87d[_0x7b95('0x39')]);_0x248b95[_0x7b95('0x3b')]=_[_0x7b95('0x3c')](_0x248b95['model'],_0x248b95[_0x7b95('0x39')]);_0x1005b8[_0x7b95('0x3d')]=_['intersection'](_0x248b95['model'],qs[_0x7b95('0x3e')](_0x4b87d[_0x7b95('0x39')]['fields']));_0x1005b8[_0x7b95('0x3d')]=_0x1005b8[_0x7b95('0x3d')][_0x7b95('0x3f')]?_0x1005b8[_0x7b95('0x3d')]:_0x248b95['model'];if(!_0x4b87d['query'][_0x7b95('0x40')](_0x7b95('0x41'))){_0x1005b8['limit']=qs[_0x7b95('0x28')](_0x4b87d['query'][_0x7b95('0x28')]);_0x1005b8[_0x7b95('0x26')]=qs[_0x7b95('0x26')](_0x4b87d['query']['offset']);}_0x1005b8['order']=qs[_0x7b95('0x42')](_0x4b87d[_0x7b95('0x39')][_0x7b95('0x42')]);_0x1005b8[_0x7b95('0x43')]=qs[_0x7b95('0x3b')](_[_0x7b95('0x44')](_0x4b87d[_0x7b95('0x39')],_0x248b95[_0x7b95('0x3b')]),_0x590483);if(_0x4b87d[_0x7b95('0x39')][_0x7b95('0x45')]){_0x1005b8[_0x7b95('0x43')]=_['merge'](_0x1005b8['where'],{'$or':_[_0x7b95('0x32')](_0x590483,function(_0x34f9aa){if(_0x34f9aa[_0x7b95('0x36')]!=='VIRTUAL'){var _0x27e448={};_0x27e448[_0x34f9aa[_0x7b95('0x2f')]]={'$like':'%'+_0x4b87d[_0x7b95('0x39')]['filter']+'%'};return _0x27e448;}})});}_0x1005b8=_[_0x7b95('0x46')]({},_0x1005b8,_0x4b87d['options']);var _0x3973f8={'where':_0x1005b8[_0x7b95('0x43')]};return db[_0x7b95('0x33')][_0x7b95('0x29')](_0x3973f8)[_0x7b95('0x16')](function(_0x1ef3a0){_0x39eca8[_0x7b95('0x29')]=_0x1ef3a0;if(_0x4b87d[_0x7b95('0x39')][_0x7b95('0x47')]){_0x1005b8[_0x7b95('0x48')]=[{'all':!![]}];}return db[_0x7b95('0x33')][_0x7b95('0x49')](_0x1005b8);})['then'](function(_0x29211c){_0x39eca8[_0x7b95('0x4a')]=_0x29211c;return _0x39eca8;})['then'](respondWithFilteredResult(_0x405ea9,_0x1005b8))[_0x7b95('0x21')](handleError(_0x405ea9,null));};exports[_0x7b95('0x4b')]=function(_0x47b072,_0x4b1fd1){var _0x13e25c={'raw':![],'where':{'id':_0x47b072[_0x7b95('0x4c')]['id']}},_0x30d7e3={};_0x30d7e3[_0x7b95('0x38')]=_[_0x7b95('0x3a')](db[_0x7b95('0x33')][_0x7b95('0x34')]);_0x30d7e3[_0x7b95('0x39')]=_[_0x7b95('0x3a')](_0x47b072[_0x7b95('0x39')]);_0x30d7e3[_0x7b95('0x3b')]=_[_0x7b95('0x3c')](_0x30d7e3['model'],_0x30d7e3[_0x7b95('0x39')]);_0x13e25c[_0x7b95('0x3d')]=_['intersection'](_0x30d7e3[_0x7b95('0x38')],qs[_0x7b95('0x3e')](_0x47b072[_0x7b95('0x39')]['fields']));_0x13e25c[_0x7b95('0x3d')]=_0x13e25c['attributes'][_0x7b95('0x3f')]?_0x13e25c[_0x7b95('0x3d')]:_0x30d7e3[_0x7b95('0x38')];if(_0x47b072[_0x7b95('0x39')][_0x7b95('0x47')]){_0x13e25c[_0x7b95('0x48')]=[{'all':!![]}];}_0x13e25c=_[_0x7b95('0x46')]({},_0x13e25c,_0x47b072[_0x7b95('0x4d')]);return db[_0x7b95('0x33')]['find'](_0x13e25c)[_0x7b95('0x16')](handleEntityNotFound(_0x4b1fd1,null))[_0x7b95('0x16')](respondWithResult(_0x4b1fd1,null))[_0x7b95('0x21')](handleError(_0x4b1fd1,null));};exports['update']=function(_0x2a27d0,_0x29b974){if(_0x2a27d0[_0x7b95('0x4e')]['id']){delete _0x2a27d0[_0x7b95('0x4e')]['id'];}return db[_0x7b95('0x33')][_0x7b95('0x4f')]({'where':{'id':_0x2a27d0['params']['id']}})[_0x7b95('0x16')](handleEntityNotFound(_0x29b974,null))['then'](saveUpdates(_0x2a27d0[_0x7b95('0x4e')],null))[_0x7b95('0x16')](respondWithResult(_0x29b974,null))[_0x7b95('0x21')](handleError(_0x29b974,null));};exports['addLogo']=function(_0x207a10,_0x345e4a,_0x149779){if(_0x207a10[_0x7b95('0x50')]&&_0x207a10['file'][_0x7b95('0x51')]){_0x207a10[_0x7b95('0x4e')][_0x7b95('0x52')]=_0x207a10[_0x7b95('0x50')][_0x7b95('0x51')];}return db['Setting'][_0x7b95('0x4f')]({'where':{'id':_0x207a10[_0x7b95('0x4c')]['id']}})[_0x7b95('0x16')](handleEntityNotFound(_0x345e4a,null))['then'](saveUpdates(_0x207a10['body'],null))[_0x7b95('0x16')](respondWithResult(_0x345e4a,null))['catch'](handleError(_0x345e4a,null));};exports[_0x7b95('0x53')]=function(_0x19be7b,_0x1fad8b,_0x4e6b9f){if(_0x19be7b['file']&&_0x19be7b[_0x7b95('0x50')][_0x7b95('0x51')]){_0x19be7b[_0x7b95('0x4e')][_0x7b95('0x54')]=_0x19be7b['file'][_0x7b95('0x51')];}return db[_0x7b95('0x33')][_0x7b95('0x4f')]({'where':{'id':_0x19be7b['params']['id']}})[_0x7b95('0x16')](handleEntityNotFound(_0x1fad8b,null))[_0x7b95('0x16')](saveUpdates(_0x19be7b['body'],null))['then'](respondWithResult(_0x1fad8b,null))[_0x7b95('0x21')](handleError(_0x1fad8b,null));};var utilLicense=require(_0x7b95('0x12'));exports[_0x7b95('0x55')]=function(_0x37bc0f,_0x104f54,_0x2c2e6f){var _0x2f9cb1=_0x7b95('0x56');var _0x5b9d4d={'custom':![]};return utilLicense[_0x7b95('0x57')]()[_0x7b95('0x16')](function(_0x421205){if(_0x421205){_0x5b9d4d=_0x421205;}return db[_0x7b95('0x33')][_0x7b95('0x4f')]({'where':{'id':_0x37bc0f[_0x7b95('0x4c')]['id']},'attributes':[_0x7b95('0x52'),'loginLogo',_0x7b95('0x58'),_0x7b95('0x59'),_0x7b95('0x5a'),'defaultLoginLogo',_0x7b95('0x5b'),_0x7b95('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x104f54,null))['then'](function(_0x19abf9){if(_0x19abf9){var _0x4a5093=_0x19abf9[_0x7b95('0x52')]&&fs[_0x7b95('0x5d')](path[_0x7b95('0x5e')](config['root'],_0x2f9cb1,_['toLower'](_0x19abf9[_0x7b95('0x52')])))?path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x2f9cb1,_[_0x7b95('0x60')](_0x19abf9[_0x7b95('0x52')])):path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x2f9cb1,_['toLower'](_0x7b95('0x61')));var _0x17d8cd=_0x7b95('0x62')+_['upperFirst']('logo');if(_0x19abf9[_0x17d8cd]||!_0x5b9d4d[_0x7b95('0x63')]){_0x4a5093=path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x2f9cb1,_['toLower']('default_logo.svg'));}if(!fs[_0x7b95('0x5d')](_0x4a5093)){throw new db['Sequelize']['ValidationError'](_[_0x7b95('0x64')](_0x7b95('0x52'))+_0x7b95('0x65'));}return _0x104f54[_0x7b95('0x66')](_0x4a5093);}})['catch'](handleError(_0x104f54,null));};var utilLicense=require(_0x7b95('0x12'));exports[_0x7b95('0x67')]=function(_0x48a70e,_0x412391,_0x501b0d){var _0x1cbcc4='server/files/images/logos';var _0x3858ec={'custom':![]};return utilLicense[_0x7b95('0x57')]()[_0x7b95('0x16')](function(_0x5da8cb){if(_0x5da8cb){_0x3858ec=_0x5da8cb;}return db[_0x7b95('0x33')]['find']({'where':{'id':_0x48a70e[_0x7b95('0x4c')]['id']},'attributes':[_0x7b95('0x52'),_0x7b95('0x54'),_0x7b95('0x58'),_0x7b95('0x59'),_0x7b95('0x5a'),_0x7b95('0x68'),_0x7b95('0x5b'),_0x7b95('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x412391,null))['then'](function(_0x653e1b){if(_0x653e1b){var _0x4da299=_0x653e1b[_0x7b95('0x54')]&&fs[_0x7b95('0x5d')](path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x1cbcc4,_[_0x7b95('0x60')](_0x653e1b[_0x7b95('0x54')])))?path['join'](config['root'],_0x1cbcc4,_[_0x7b95('0x60')](_0x653e1b['loginLogo'])):path[_0x7b95('0x5e')](config['root'],_0x1cbcc4,_[_0x7b95('0x60')](_0x7b95('0x69')));var _0x26f072=_0x7b95('0x62')+_[_0x7b95('0x64')](_0x7b95('0x54'));if(_0x653e1b[_0x26f072]||!_0x3858ec[_0x7b95('0x63')]){_0x4da299=path['join'](config[_0x7b95('0x5f')],_0x1cbcc4,_[_0x7b95('0x60')](_0x7b95('0x69')));}if(!fs[_0x7b95('0x5d')](_0x4da299)){throw new db['Sequelize']['ValidationError'](_[_0x7b95('0x64')](_0x7b95('0x54'))+_0x7b95('0x65'));}return _0x412391['download'](_0x4da299);}})[_0x7b95('0x21')](handleError(_0x412391,null));};exports[_0x7b95('0x6a')]=function(_0x30cc1f,_0x4fbbbd){return db[_0x7b95('0x33')][_0x7b95('0x4f')]({'where':{'id':_0x30cc1f[_0x7b95('0x4c')]['id']},'attributes':['securePassword']})[_0x7b95('0x16')](respondWithResult(_0x4fbbbd,null))[_0x7b95('0x21')](handleError(_0x4fbbbd,null));};exports[_0x7b95('0x6b')]=function(_0x1c461f,_0xb8e769,_0x2cfccb){if(_0x1c461f[_0x7b95('0x50')]&&_0x1c461f[_0x7b95('0x50')]['filename']){_0x1c461f[_0x7b95('0x4e')][_0x7b95('0x58')]=_0x1c461f[_0x7b95('0x50')][_0x7b95('0x51')];}return db[_0x7b95('0x33')]['find']({'where':{'id':_0x1c461f[_0x7b95('0x4c')]['id']}})[_0x7b95('0x16')](handleEntityNotFound(_0xb8e769,null))[_0x7b95('0x16')](saveUpdates(_0x1c461f[_0x7b95('0x4e')],null))[_0x7b95('0x16')](respondWithResult(_0xb8e769,null))[_0x7b95('0x21')](handleError(_0xb8e769,null));};var utilLicense=require(_0x7b95('0x12'));exports[_0x7b95('0x6c')]=function(_0x17fa3c,_0x26966d,_0x11e864){var _0x23b7ee=_0x7b95('0x56');var _0x4f4cdd={'custom':![]};return utilLicense[_0x7b95('0x57')]()[_0x7b95('0x16')](function(_0x172fb4){if(_0x172fb4){_0x4f4cdd=_0x172fb4;}return db['Setting'][_0x7b95('0x4f')]({'where':{'id':_0x17fa3c[_0x7b95('0x4c')]['id']},'attributes':['logo',_0x7b95('0x54'),_0x7b95('0x58'),_0x7b95('0x59'),_0x7b95('0x5a'),_0x7b95('0x68'),_0x7b95('0x5b'),_0x7b95('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x26966d,null))[_0x7b95('0x16')](function(_0x5b3290){if(_0x5b3290){var _0x4b1012=_0x5b3290[_0x7b95('0x58')]&&fs[_0x7b95('0x5d')](path[_0x7b95('0x5e')](config['root'],_0x23b7ee,_['toLower'](_0x5b3290[_0x7b95('0x58')])))?path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x23b7ee,_[_0x7b95('0x60')](_0x5b3290[_0x7b95('0x58')])):path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x23b7ee,_[_0x7b95('0x60')](_0x7b95('0x6d')));var _0x581d98=_0x7b95('0x62')+_[_0x7b95('0x64')]('preferred');if(_0x5b3290[_0x581d98]||!_0x4f4cdd['custom']||!_0x4f4cdd[_0x7b95('0x58')]){_0x4b1012=path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x23b7ee,_[_0x7b95('0x60')](_0x7b95('0x6d')));}if(!fs[_0x7b95('0x5d')](_0x4b1012)){throw new db[(_0x7b95('0x6e'))]['ValidationError'](_[_0x7b95('0x64')](_0x7b95('0x58'))+_0x7b95('0x65'));}return _0x26966d[_0x7b95('0x66')](_0x4b1012);}})['catch'](handleError(_0x26966d,null));};exports[_0x7b95('0x6f')]=function(_0x45099c,_0xa92c22,_0x530e8f){if(_0x45099c[_0x7b95('0x50')]&&_0x45099c['file'][_0x7b95('0x51')]){_0x45099c['body'][_0x7b95('0x59')]=_0x45099c[_0x7b95('0x50')]['filename'];}return db[_0x7b95('0x33')][_0x7b95('0x4f')]({'where':{'id':_0x45099c[_0x7b95('0x4c')]['id']}})[_0x7b95('0x16')](handleEntityNotFound(_0xa92c22,null))[_0x7b95('0x16')](saveUpdates(_0x45099c[_0x7b95('0x4e')],null))[_0x7b95('0x16')](respondWithResult(_0xa92c22,null))[_0x7b95('0x21')](handleError(_0xa92c22,null));};var utilLicense=require(_0x7b95('0x12'));exports[_0x7b95('0x70')]=function(_0x55ce5a,_0x540b3e,_0x2dd108){var _0x3f40c4='server/files/images/logos';var _0x3c3bc8={'custom':![]};return utilLicense[_0x7b95('0x57')]()[_0x7b95('0x16')](function(_0x5ba7eb){if(_0x5ba7eb){_0x3c3bc8=_0x5ba7eb;}return db[_0x7b95('0x33')][_0x7b95('0x4f')]({'where':{'id':_0x55ce5a[_0x7b95('0x4c')]['id']},'attributes':[_0x7b95('0x52'),_0x7b95('0x54'),_0x7b95('0x58'),_0x7b95('0x59'),'defaultLogo','defaultLoginLogo',_0x7b95('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x7b95('0x16')](handleEntityNotFound(_0x540b3e,null))[_0x7b95('0x16')](function(_0x35bd83){if(_0x35bd83){var _0x5cd175=_0x35bd83[_0x7b95('0x59')]&&fs['existsSync'](path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x3f40c4,_[_0x7b95('0x60')](_0x35bd83[_0x7b95('0x59')])))?path['join'](config[_0x7b95('0x5f')],_0x3f40c4,_[_0x7b95('0x60')](_0x35bd83[_0x7b95('0x59')])):path[_0x7b95('0x5e')](config[_0x7b95('0x5f')],_0x3f40c4,_[_0x7b95('0x60')]('default_favicon.ico'));var _0x193fbe=_0x7b95('0x62')+_['upperFirst']('favicon');if(_0x35bd83[_0x193fbe]||!_0x3c3bc8[_0x7b95('0x63')]){_0x5cd175=path[_0x7b95('0x5e')](config['root'],_0x3f40c4,_[_0x7b95('0x60')](_0x7b95('0x71')));}if(!fs[_0x7b95('0x5d')](_0x5cd175)){throw new db[(_0x7b95('0x6e'))][(_0x7b95('0x72'))](_[_0x7b95('0x64')](_0x7b95('0x59'))+_0x7b95('0x65'));}return _0x540b3e[_0x7b95('0x66')](_0x5cd175);}})[_0x7b95('0x21')](handleError(_0x540b3e,null));};exports[_0x7b95('0x73')]=function(_0x59c43f,_0x2b5eaa){var _0x2076d4={'offset':moment()[_0x7b95('0x74')]()};_0x2076d4[_0x7b95('0x75')]=moment()[_0x7b95('0x74')](_0x2076d4[_0x7b95('0x26')])[_0x7b95('0x76')](_0x7b95('0x77'));return _0x2b5eaa[_0x7b95('0x24')](0xc8)['send'](_0x2076d4);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 49e5c6d..bec4da8 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x345464,_0x3af6a2){var _0x44ef63=function(_0x921f4e){while(--_0x921f4e){_0x345464['push'](_0x345464['shift']());}};_0x44ef63(++_0x3af6a2);}(_0xe14b,0x93));var _0xbe14=function(_0x48c13b,_0x268956){_0x48c13b=_0x48c13b-0x0;var _0x580009=_0xe14b[_0x48c13b];return _0x580009;};'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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x008c,0x188));var _0xc008=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x008c[_0x9fd887];return _0x1a54ab;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 2b104e3..5c39adf 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 _0x26fd=['attributes','info','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','find','options','raw','where','include','map','model'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x26fd,0x13e));var _0xd26f=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x26fd[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0xd26f('0x0'));var util=require(_0xd26f('0x1'));var moment=require(_0xd26f('0x2'));var BPromise=require(_0xd26f('0x3'));var rs=require(_0xd26f('0x4'));var fs=require('fs');var Redis=require(_0xd26f('0x5'));var db=require(_0xd26f('0x6'))['db'];var utils=require(_0xd26f('0x7'));var logger=require(_0xd26f('0x8'))(_0xd26f('0x9'));var config=require(_0xd26f('0xa'));var jayson=require(_0xd26f('0xb'));var client=jayson[_0xd26f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad0d7,_0x24c0c1,_0x10c3b3){return new BPromise(function(_0x1cdd5a,_0x1a6f5e){return client[_0xd26f('0xd')](_0x1ad0d7,_0x10c3b3)[_0xd26f('0xe')](function(_0x4d31fb){logger['info'](_0xd26f('0xf'),_0x24c0c1,_0xd26f('0x10'));logger['debug'](_0xd26f('0x11'),_0x24c0c1,'request\x20sent',JSON[_0xd26f('0x12')](_0x4d31fb));if(_0x4d31fb[_0xd26f('0x13')]){if(_0x4d31fb[_0xd26f('0x13')][_0xd26f('0x14')]===0x1f4){logger[_0xd26f('0x13')](_0xd26f('0xf'),_0x24c0c1,_0x4d31fb['error'][_0xd26f('0x15')]);return _0x1a6f5e(_0x4d31fb[_0xd26f('0x13')]['message']);}logger['error'](_0xd26f('0xf'),_0x24c0c1,_0x4d31fb[_0xd26f('0x13')][_0xd26f('0x15')]);return _0x1cdd5a(_0x4d31fb[_0xd26f('0x13')]['message']);}else{logger['info'](_0xd26f('0xf'),_0x24c0c1,_0xd26f('0x10'));_0x1cdd5a(_0x4d31fb['result'][_0xd26f('0x15')]);}})[_0xd26f('0x16')](function(_0x24f990){logger[_0xd26f('0x13')](_0xd26f('0xf'),_0x24c0c1,_0x24f990);_0x1a6f5e(_0x24f990);});});}exports[_0xd26f('0x17')]=function(_0x3f0350){var _0x5e77d7=this;return new Promise(function(_0x1b0282,_0x20e8a0){return db[_0xd26f('0x18')][_0xd26f('0x19')]({'raw':_0x3f0350[_0xd26f('0x1a')]?_0x3f0350[_0xd26f('0x1a')][_0xd26f('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f0350[_0xd26f('0x1a')]?_0x3f0350[_0xd26f('0x1a')][_0xd26f('0x1c')]||null:null,'attributes':_0x3f0350[_0xd26f('0x1a')]?_0x3f0350[_0xd26f('0x1a')]['attributes']||null:null,'include':_0x3f0350[_0xd26f('0x1a')]?_0x3f0350['options'][_0xd26f('0x1d')]?_[_0xd26f('0x1e')](_0x3f0350[_0xd26f('0x1a')][_0xd26f('0x1d')],function(_0xb620a3){return{'model':db[_0xb620a3[_0xd26f('0x1f')]],'as':_0xb620a3['as'],'attributes':_0xb620a3[_0xd26f('0x20')],'include':_0xb620a3['include']?_[_0xd26f('0x1e')](_0xb620a3[_0xd26f('0x1d')],function(_0x1d556e){return{'model':db[_0x1d556e[_0xd26f('0x1f')]],'as':_0x1d556e['as'],'attributes':_0x1d556e[_0xd26f('0x20')],'include':_0x1d556e[_0xd26f('0x1d')]?_['map'](_0x1d556e['include'],function(_0x597bd4){return{'model':db[_0x597bd4['model']],'as':_0x597bd4['as'],'attributes':_0x597bd4[_0xd26f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd26f('0xe')](function(_0x2a5b6e){logger[_0xd26f('0x21')]('ShowSetting',_0x3f0350);logger[_0xd26f('0x22')]('ShowSetting',_0x3f0350,JSON[_0xd26f('0x12')](_0x2a5b6e));_0x1b0282(_0x2a5b6e);})[_0xd26f('0x16')](function(_0x2cae4d){logger[_0xd26f('0x13')](_0xd26f('0x17'),_0x2cae4d[_0xd26f('0x15')],_0x3f0350);_0x20e8a0(_0x5e77d7[_0xd26f('0x13')](0x1f4,_0x2cae4d[_0xd26f('0x15')]));});});}; \ No newline at end of file +var _0x1261=['../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1261,0x18f));var _0x1126=function(_0x302d0b,_0x2c7dbb){_0x302d0b=_0x302d0b-0x0;var _0x3b9e1d=_0x1261[_0x302d0b];return _0x3b9e1d;};'use strict';var _=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var moment=require(_0x1126('0x2'));var BPromise=require(_0x1126('0x3'));var rs=require(_0x1126('0x4'));var fs=require('fs');var Redis=require('ioredis');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(_0x1126('0xa'));var client=jayson[_0x1126('0xb')][_0x1126('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x124a59,_0x4b9790,_0x283690){return new BPromise(function(_0x504ee,_0xeb133b){return client['request'](_0x124a59,_0x283690)[_0x1126('0xd')](function(_0x574b7b){logger[_0x1126('0xe')](_0x1126('0xf'),_0x4b9790,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x4b9790,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x574b7b));if(_0x574b7b[_0x1126('0x14')]){if(_0x574b7b['error'][_0x1126('0x15')]===0x1f4){logger[_0x1126('0x14')]('Setting,\x20%s,\x20%s',_0x4b9790,_0x574b7b[_0x1126('0x14')][_0x1126('0x16')]);return _0xeb133b(_0x574b7b[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')](_0x1126('0xf'),_0x4b9790,_0x574b7b[_0x1126('0x14')][_0x1126('0x16')]);return _0x504ee(_0x574b7b[_0x1126('0x14')][_0x1126('0x16')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x4b9790,_0x1126('0x10'));_0x504ee(_0x574b7b[_0x1126('0x17')]['message']);}})[_0x1126('0x18')](function(_0x4c2e28){logger[_0x1126('0x14')](_0x1126('0xf'),_0x4b9790,_0x4c2e28);_0xeb133b(_0x4c2e28);});});}exports[_0x1126('0x19')]=function(_0xc2f370){var _0x465eed=this;return new Promise(function(_0x5ea73e,_0x551aef){return db[_0x1126('0x1a')][_0x1126('0x1b')]({'raw':_0xc2f370[_0x1126('0x1c')]?_0xc2f370[_0x1126('0x1c')][_0x1126('0x1d')]===undefined?!![]:![]:!![],'where':_0xc2f370[_0x1126('0x1c')]?_0xc2f370[_0x1126('0x1c')]['where']||null:null,'attributes':_0xc2f370[_0x1126('0x1c')]?_0xc2f370[_0x1126('0x1c')][_0x1126('0x1e')]||null:null,'include':_0xc2f370[_0x1126('0x1c')]?_0xc2f370[_0x1126('0x1c')][_0x1126('0x1f')]?_[_0x1126('0x20')](_0xc2f370[_0x1126('0x1c')][_0x1126('0x1f')],function(_0x545231){return{'model':db[_0x545231[_0x1126('0x21')]],'as':_0x545231['as'],'attributes':_0x545231[_0x1126('0x1e')],'include':_0x545231[_0x1126('0x1f')]?_[_0x1126('0x20')](_0x545231[_0x1126('0x1f')],function(_0x40ecd5){return{'model':db[_0x40ecd5[_0x1126('0x21')]],'as':_0x40ecd5['as'],'attributes':_0x40ecd5[_0x1126('0x1e')],'include':_0x40ecd5[_0x1126('0x1f')]?_[_0x1126('0x20')](_0x40ecd5[_0x1126('0x1f')],function(_0x996133){return{'model':db[_0x996133[_0x1126('0x21')]],'as':_0x996133['as'],'attributes':_0x996133[_0x1126('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xd')](function(_0x5d3136){logger[_0x1126('0xe')](_0x1126('0x19'),_0xc2f370);logger[_0x1126('0x11')](_0x1126('0x19'),_0xc2f370,JSON[_0x1126('0x13')](_0x5d3136));_0x5ea73e(_0x5d3136);})[_0x1126('0x18')](function(_0x17a88f){logger['error']('ShowSetting',_0x17a88f[_0x1126('0x16')],_0xc2f370);_0x551aef(_0x465eed['error'](0x1f4,_0x17a88f[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d20bc93..825396f 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x18ebc1,_0x278109){var _0x6fd6=function(_0x2544a5){while(--_0x2544a5){_0x18ebc1['push'](_0x18ebc1['shift']());}};_0x6fd6(++_0x278109);}(_0x8ef6,0xf2));var _0x68ef=function(_0xe62ac5,_0x4487bd){_0xe62ac5=_0xe62ac5-0x0;var _0xdcf4a1=_0x8ef6[_0xe62ac5];return _0xdcf4a1;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7217,0x19e));var _0x7721=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7217[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 454e5dc..2829e80 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 _0xcd72=['STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','infobip','intelepeer','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','exports','name'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xcd72,0x6c));var _0x2cd7=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xcd72[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x2cd7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2cd7('0x1'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2cd7('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x2cd7('0x2')],'defaultValue':function(){return rs[_0x2cd7('0x3')]();}},'phone':{'type':Sequelize[_0x2cd7('0x2')]},'type':{'type':Sequelize[_0x2cd7('0x4')](_0x2cd7('0x5'),_0x2cd7('0x6'),_0x2cd7('0x7'),_0x2cd7('0x8'),_0x2cd7('0x9'),_0x2cd7('0xa'),'bandwidth','csc',_0x2cd7('0xb'),_0x2cd7('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x2cd7('0x2')]},'authToken':{'type':Sequelize[_0x2cd7('0x2')]},'smsMethod':{'type':Sequelize[_0x2cd7('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2cd7('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x2cd7('0x2')]},'accountId':{'type':Sequelize[_0x2cd7('0x2')]},'senderString':{'type':Sequelize[_0x2cd7('0x2')]},'deliveryReport':{'type':Sequelize[_0x2cd7('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x2cd7('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2cd7('0xe')],'defaultValue':function(){return _0x2cd7('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2cd7('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2cd7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2cd7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2cd7('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2cd7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2cd7('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x2cd7('0xd')],'defaultValue':![],'comment':_0x2cd7('0x12'),'set':function(_0x2ba011){if(!_0x2ba011)this[_0x2cd7('0x13')](_0x2cd7('0x14'),null);this[_0x2cd7('0x13')](_0x2cd7('0x15'),_0x2ba011);}}}; \ No newline at end of file +var _0xa6b1=['bandwidth','csc','infobip','intelepeer','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','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell'];(function(_0xec4fe4,_0x475e9a){var _0x3c46c6=function(_0x33b570){while(--_0x33b570){_0xec4fe4['push'](_0xec4fe4['shift']());}};_0x3c46c6(++_0x475e9a);}(_0xa6b1,0xb4));var _0x1a6b=function(_0x550d0d,_0x238948){_0x550d0d=_0x550d0d-0x0;var _0x5972a0=_0xa6b1[_0x550d0d];return _0x5972a0;};'use strict';var Sequelize=require(_0x1a6b('0x0'));var rs=require(_0x1a6b('0x1'));module[_0x1a6b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x1a6b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x1a6b('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x1a6b('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1a6b('0x5')]();}},'phone':{'type':Sequelize[_0x1a6b('0x4')]},'type':{'type':Sequelize[_0x1a6b('0x6')](_0x1a6b('0x7'),_0x1a6b('0x8'),'connectel',_0x1a6b('0x9'),_0x1a6b('0xa'),_0x1a6b('0xb'),_0x1a6b('0xc'),_0x1a6b('0xd'),_0x1a6b('0xe'),_0x1a6b('0xf'))},'accountSid':{'type':Sequelize[_0x1a6b('0x4')]},'authId':{'type':Sequelize[_0x1a6b('0x4')]},'authToken':{'type':Sequelize[_0x1a6b('0x4')]},'smsMethod':{'type':Sequelize[_0x1a6b('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1a6b('0x4')]},'password':{'type':Sequelize[_0x1a6b('0x4')]},'apiKey':{'type':Sequelize[_0x1a6b('0x4')]},'applicationId':{'type':Sequelize[_0x1a6b('0x4')]},'accountId':{'type':Sequelize[_0x1a6b('0x4')]},'senderString':{'type':Sequelize[_0x1a6b('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x1a6b('0x4')]},'notificationTemplate':{'type':Sequelize[_0x1a6b('0x10')],'defaultValue':function(){return _0x1a6b('0x11');}},'notificationSound':{'type':Sequelize[_0x1a6b('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1a6b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1a6b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1a6b('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1a6b('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1a6b('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a6b('0x13')],'comment':_0x1a6b('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1a6b('0x15'),'set':function(_0x3a27e7){if(!_0x3a27e7)this[_0x1a6b('0x16')]('mandatoryDispositionPauseId',null);this[_0x1a6b('0x16')](_0x1a6b('0x17'),_0x3a27e7);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 8c48068..b8ba592 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 _0x3c4f=['client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','SmsAccounts','UserProfileResource','destroy','name','send','Pause','map','SmsAccount','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','rawAttributes','include','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','mandatoryDispositionPause','params','describe','addDisposition','SmsAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','applications','orderBy','Applications','priority','account','CmContact','Sequelize','ValidationError','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','MessageSid','skebby','sender','text','connectel','clicksend','plivo','messageId','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','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','CmList','ListId','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','\x0a','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','message_id','DELIVERED','groupName','bandwidth','redif','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x52ef17,_0x296d33){var _0x25c950=function(_0x200929){while(--_0x200929){_0x52ef17['push'](_0x52ef17['shift']());}};_0x25c950(++_0x296d33);}(_0x3c4f,0x1af));var _0xf3c4=function(_0x3b0b76,_0x58815d){_0x3b0b76=_0x3b0b76-0x0;var _0x4a34ea=_0x3c4f[_0x3b0b76];return _0x4a34ea;};'use strict';var emlformat=require(_0xf3c4('0x0'));var rimraf=require(_0xf3c4('0x1'));var zipdir=require(_0xf3c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3c4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3c4('0x4'));var util=require(_0xf3c4('0x5'));var path=require('path');var sox=require(_0xf3c4('0x6'));var csv=require(_0xf3c4('0x7'));var ejs=require(_0xf3c4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3c4('0x9'));var squel=require(_0xf3c4('0xa'));var crypto=require(_0xf3c4('0xb'));var jsforce=require(_0xf3c4('0xc'));var deskjs=require(_0xf3c4('0xd'));var toCsv=require(_0xf3c4('0x7'));var querystring=require(_0xf3c4('0xe'));var Papa=require(_0xf3c4('0xf'));var Redis=require(_0xf3c4('0x10'));var authService=require(_0xf3c4('0x11'));var qs=require(_0xf3c4('0x12'));var as=require(_0xf3c4('0x13'));var hardwareService=require(_0xf3c4('0x14'));var logger=require(_0xf3c4('0x15'))(_0xf3c4('0x16'));var utils=require(_0xf3c4('0x17'));var config=require(_0xf3c4('0x18'));var licenseUtil=require(_0xf3c4('0x19'));var db=require(_0xf3c4('0x1a'))['db'];config[_0xf3c4('0x1b')]=_[_0xf3c4('0x1c')](config[_0xf3c4('0x1b')],{'host':_0xf3c4('0x1d'),'port':0x18eb});var socket=require(_0xf3c4('0x1e'))(new Redis(config['redis']));require(_0xf3c4('0x1f'))[_0xf3c4('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf3c4('0x21')][_0xf3c4('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x233ee3,_0xc2abb4,_0x31f046,_0x28fd57){return new BPromise(function(_0x51b530,_0xdc542d){var _0x55ea97=_0x28fd57||client;return _0x55ea97['request'](_0x233ee3,_0x31f046)[_0xf3c4('0x23')](function(_0x183151){logger[_0xf3c4('0x24')](_0xf3c4('0x25'),_0xc2abb4,_0xf3c4('0x26'));logger[_0xf3c4('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc2abb4,_0xf3c4('0x26'),JSON[_0xf3c4('0x28')](_0x183151));if(_0x183151['error']){if(_0x183151[_0xf3c4('0x29')][_0xf3c4('0x2a')]===0x1f4){logger[_0xf3c4('0x29')](_0xf3c4('0x25'),_0xc2abb4,_0x183151[_0xf3c4('0x29')][_0xf3c4('0x2b')]);return _0xdc542d(_0x183151['error']['message']);}logger[_0xf3c4('0x29')](_0xf3c4('0x25'),_0xc2abb4,_0x183151[_0xf3c4('0x29')]['message']);return _0x51b530(_0x183151[_0xf3c4('0x29')]['message']);}else{logger[_0xf3c4('0x24')](_0xf3c4('0x25'),_0xc2abb4,_0xf3c4('0x26'));_0x51b530(_0x183151[_0xf3c4('0x2c')][_0xf3c4('0x2b')]);}})[_0xf3c4('0x2d')](function(_0x275d27){logger[_0xf3c4('0x29')]('SmsAccount,\x20%s,\x20%s',_0xc2abb4,_0x275d27);_0xdc542d(_0x275d27);});});}function respondWithStatusCode(_0x4c6188,_0x45ecc2){_0x45ecc2=_0x45ecc2||0xcc;return function(_0x2664a2){if(_0x2664a2){return _0x4c6188[_0xf3c4('0x2e')](_0x45ecc2);}return _0x4c6188['status'](_0x45ecc2)['end']();};}function respondWithResult(_0x2367a0,_0x1f1f74){_0x1f1f74=_0x1f1f74||0xc8;return function(_0x149d75){if(_0x149d75){return _0x2367a0[_0xf3c4('0x2f')](_0x1f1f74)[_0xf3c4('0x30')](_0x149d75);}};}function respondWithFilteredResult(_0x523993,_0x46ddf3){return function(_0x5c4b04){if(_0x5c4b04){var _0x5547fa=typeof _0x46ddf3[_0xf3c4('0x31')]===_0xf3c4('0x32')&&typeof _0x46ddf3[_0xf3c4('0x33')]===_0xf3c4('0x32');var _0xfac2cf=_0x5c4b04['count'];var _0x571938=_0x5547fa?0x0:_0x46ddf3[_0xf3c4('0x31')];var _0xb353cf=_0x5547fa?_0x5c4b04[_0xf3c4('0x34')]:_0x46ddf3[_0xf3c4('0x31')]+_0x46ddf3[_0xf3c4('0x33')];var _0x14ff9e;if(_0xb353cf>=_0xfac2cf){_0xb353cf=_0xfac2cf;_0x14ff9e=0xc8;}else{_0x14ff9e=0xce;}_0x523993[_0xf3c4('0x2f')](_0x14ff9e);return _0x523993[_0xf3c4('0x35')](_0xf3c4('0x36'),_0x571938+'-'+_0xb353cf+'/'+_0xfac2cf)[_0xf3c4('0x30')](_0x5c4b04);}return null;};}function patchUpdates(_0xb6e530){return function(_0x3952fa){try{jsonpatch['apply'](_0x3952fa,_0xb6e530,!![]);}catch(_0x563ab4){return BPromise[_0xf3c4('0x37')](_0x563ab4);}return _0x3952fa['save']();};}function saveUpdates(_0x1c0d68,_0x345901){return function(_0x13b20f){if(_0x13b20f){return _0x13b20f[_0xf3c4('0x38')](_0x1c0d68)[_0xf3c4('0x23')](function(_0x548bdd){return _0x548bdd;});}return null;};}function removeEntity(_0x1dc2b9,_0x54c92){return function(_0x31c37c){if(_0x31c37c){return _0x31c37c['destroy']()[_0xf3c4('0x23')](function(){var _0x22158f=_0x31c37c['get']({'plain':!![]});var _0x5f170b=_0xf3c4('0x39');return db[_0xf3c4('0x3a')][_0xf3c4('0x3b')]({'where':{'type':_0x5f170b,'resourceId':_0x22158f['id']}})[_0xf3c4('0x23')](function(){return _0x31c37c;});})['then'](function(){_0x1dc2b9[_0xf3c4('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f26e,_0x828e3){return function(_0x2c0ed9){if(!_0x2c0ed9){_0x40f26e[_0xf3c4('0x2e')](0x194);}return _0x2c0ed9;};}function handleError(_0x921d42,_0x48e6eb){_0x48e6eb=_0x48e6eb||0x1f4;return function(_0x6095cf){logger[_0xf3c4('0x29')](_0x6095cf['stack']);if(_0x6095cf[_0xf3c4('0x3c')]){delete _0x6095cf[_0xf3c4('0x3c')];}_0x921d42[_0xf3c4('0x2f')](_0x48e6eb)[_0xf3c4('0x3d')](_0x6095cf);};}exports['index']=function(_0x484711,_0x349553){var _0x47b5d2={'include':[{'model':db[_0xf3c4('0x3e')],'as':'mandatoryDispositionPause'}]},_0x48a9b8={},_0x595b00={'count':0x0,'rows':[]};var _0x11de73=_[_0xf3c4('0x3f')](db[_0xf3c4('0x40')]['rawAttributes'],function(_0x24f41c){return{'name':_0x24f41c[_0xf3c4('0x41')],'type':_0x24f41c['type'][_0xf3c4('0x42')]};});_0x48a9b8[_0xf3c4('0x43')]=_[_0xf3c4('0x3f')](_0x11de73,_0xf3c4('0x3c'));_0x48a9b8['query']=_[_0xf3c4('0x44')](_0x484711['query']);_0x48a9b8[_0xf3c4('0x45')]=_[_0xf3c4('0x46')](_0x48a9b8[_0xf3c4('0x43')],_0x48a9b8[_0xf3c4('0x47')]);_0x47b5d2[_0xf3c4('0x48')]=_[_0xf3c4('0x46')](_0x48a9b8[_0xf3c4('0x43')],qs[_0xf3c4('0x49')](_0x484711['query']['fields']));_0x47b5d2['attributes']=_0x47b5d2[_0xf3c4('0x48')][_0xf3c4('0x4a')]?_0x47b5d2['attributes']:_0x48a9b8['model'];if(!_0x484711[_0xf3c4('0x47')][_0xf3c4('0x4b')](_0xf3c4('0x4c'))){_0x47b5d2[_0xf3c4('0x33')]=qs[_0xf3c4('0x33')](_0x484711['query']['limit']);_0x47b5d2[_0xf3c4('0x31')]=qs[_0xf3c4('0x31')](_0x484711[_0xf3c4('0x47')]['offset']);}_0x47b5d2['order']=qs[_0xf3c4('0x4d')](_0x484711[_0xf3c4('0x47')][_0xf3c4('0x4d')]);_0x47b5d2[_0xf3c4('0x4e')]=qs[_0xf3c4('0x45')](_[_0xf3c4('0x4f')](_0x484711['query'],_0x48a9b8[_0xf3c4('0x45')]),_0x11de73);if(_0x484711['query'][_0xf3c4('0x50')]){_0x47b5d2['where']=_[_0xf3c4('0x51')](_0x47b5d2[_0xf3c4('0x4e')],{'$or':_['map'](_0x11de73,function(_0x39e2d7){if(_0x39e2d7[_0xf3c4('0x52')]!==_0xf3c4('0x53')){var _0x50932a={};_0x50932a[_0x39e2d7['name']]={'$like':'%'+_0x484711[_0xf3c4('0x47')][_0xf3c4('0x50')]+'%'};return _0x50932a;}})});}_0x47b5d2=_[_0xf3c4('0x51')]({},_0x47b5d2,_0x484711['options']);var _0x24b797={'where':_0x47b5d2[_0xf3c4('0x4e')]};return db['SmsAccount'][_0xf3c4('0x34')](_0x24b797)['then'](function(_0x2b9136){_0x595b00['count']=_0x2b9136;if(_0x484711[_0xf3c4('0x47')][_0xf3c4('0x54')]){_0x47b5d2['include']=[{'all':!![]}];}return db[_0xf3c4('0x40')][_0xf3c4('0x55')](_0x47b5d2);})[_0xf3c4('0x23')](function(_0x1959fc){_0x595b00[_0xf3c4('0x56')]=_0x1959fc;return _0x595b00;})[_0xf3c4('0x23')](respondWithFilteredResult(_0x349553,_0x47b5d2))[_0xf3c4('0x2d')](handleError(_0x349553,null));};exports[_0xf3c4('0x57')]=function(_0x4c04f1,_0x45fc21){var _0x5cbd68={'raw':![],'where':{'id':_0x4c04f1['params']['id']},'include':[{'model':db[_0xf3c4('0x3e')],'as':'mandatoryDispositionPause'}]},_0x31f14c={};_0x31f14c['model']=_['keys'](db[_0xf3c4('0x40')][_0xf3c4('0x58')]);_0x31f14c[_0xf3c4('0x47')]=_[_0xf3c4('0x44')](_0x4c04f1['query']);_0x31f14c[_0xf3c4('0x45')]=_[_0xf3c4('0x46')](_0x31f14c[_0xf3c4('0x43')],_0x31f14c[_0xf3c4('0x47')]);_0x5cbd68[_0xf3c4('0x48')]=_['intersection'](_0x31f14c[_0xf3c4('0x43')],qs['fields'](_0x4c04f1[_0xf3c4('0x47')][_0xf3c4('0x49')]));_0x5cbd68['attributes']=_0x5cbd68['attributes'][_0xf3c4('0x4a')]?_0x5cbd68[_0xf3c4('0x48')]:_0x31f14c[_0xf3c4('0x43')];if(_0x4c04f1[_0xf3c4('0x47')][_0xf3c4('0x54')]){_0x5cbd68[_0xf3c4('0x59')]=[{'all':!![]}];}_0x5cbd68=_[_0xf3c4('0x51')]({},_0x5cbd68,_0x4c04f1[_0xf3c4('0x5a')]);return db['SmsAccount']['find'](_0x5cbd68)[_0xf3c4('0x23')](handleEntityNotFound(_0x45fc21,null))['then'](respondWithResult(_0x45fc21,null))['catch'](handleError(_0x45fc21,null));};exports[_0xf3c4('0x5b')]=function(_0x39bd07,_0x5cf7b1){return db[_0xf3c4('0x40')][_0xf3c4('0x5b')](_0x39bd07[_0xf3c4('0x5c')],{})[_0xf3c4('0x23')](function(_0x5e80f3){var _0x227816=_0x39bd07[_0xf3c4('0x5d')][_0xf3c4('0x5e')]({'plain':!![]});if(!_0x227816)throw new Error(_0xf3c4('0x5f'));if(_0x227816[_0xf3c4('0x60')]===_0xf3c4('0x5d')){var _0x25304d=_0x5e80f3[_0xf3c4('0x5e')]({'plain':!![]});var _0x50126c=_0xf3c4('0x39');return db[_0xf3c4('0x61')][_0xf3c4('0x62')]({'where':{'name':_0x50126c,'userProfileId':_0x227816[_0xf3c4('0x63')]},'raw':!![]})['then'](function(_0x2a46e9){if(_0x2a46e9&&_0x2a46e9[_0xf3c4('0x64')]===0x0){return db[_0xf3c4('0x3a')][_0xf3c4('0x5b')]({'name':_0x25304d[_0xf3c4('0x3c')],'resourceId':_0x25304d['id'],'type':_0x2a46e9[_0xf3c4('0x3c')],'sectionId':_0x2a46e9['id']},{})[_0xf3c4('0x23')](function(){return _0x5e80f3;});}else{return _0x5e80f3;}})[_0xf3c4('0x2d')](function(_0x399677){logger[_0xf3c4('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x399677);throw _0x399677;});}return _0x5e80f3;})[_0xf3c4('0x23')](respondWithResult(_0x5cf7b1,0xc9))[_0xf3c4('0x2d')](handleError(_0x5cf7b1,null));};exports[_0xf3c4('0x38')]=function(_0x4447cf,_0x373a88){if(_0x4447cf['body']['id']){delete _0x4447cf[_0xf3c4('0x5c')]['id'];}return db[_0xf3c4('0x40')]['find']({'where':{'id':_0x4447cf['params']['id']},'include':[{'model':db['Pause'],'as':_0xf3c4('0x65')}]})[_0xf3c4('0x23')](handleEntityNotFound(_0x373a88,null))[_0xf3c4('0x23')](saveUpdates(_0x4447cf[_0xf3c4('0x5c')],null))['then'](respondWithResult(_0x373a88,null))[_0xf3c4('0x2d')](handleError(_0x373a88,null));};exports[_0xf3c4('0x3b')]=function(_0x51e3cf,_0x4e4a29){return db[_0xf3c4('0x40')]['find']({'where':{'id':_0x51e3cf[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x4e4a29,null))[_0xf3c4('0x23')](removeEntity(_0x4e4a29,null))['catch'](handleError(_0x4e4a29,null));};exports['describe']=function(_0xb48cd5,_0x11daaf){return db[_0xf3c4('0x40')][_0xf3c4('0x67')]()[_0xf3c4('0x23')](respondWithResult(_0x11daaf,null))[_0xf3c4('0x2d')](handleError(_0x11daaf,null));};exports[_0xf3c4('0x68')]=function(_0x20d137,_0x365da8,_0x6c84d0){if(_0x20d137[_0xf3c4('0x5c')]['id']){delete _0x20d137[_0xf3c4('0x5c')]['id'];}return db[_0xf3c4('0x40')]['find']({'where':{'id':_0x20d137[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x365da8,null))['then'](function(_0x5af501){if(_0x5af501){_0x20d137['body'][_0xf3c4('0x69')]=_0x5af501['id'];return db[_0xf3c4('0x6a')][_0xf3c4('0x5b')](_0x20d137['body']);}})[_0xf3c4('0x23')](respondWithResult(_0x365da8,null))['catch'](handleError(_0x365da8,null));};exports['getDispositions']=function(_0xda307a,_0x5cdd78,_0x2948be){var _0x4f132d={'raw':![],'where':{}};var _0x123812={};var _0x3e51af={'count':0x0,'rows':[]};return db[_0xf3c4('0x40')][_0xf3c4('0x6b')]({'where':{'id':_0xda307a[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x5cdd78,null))['then'](function(_0x16c8a1){if(_0x16c8a1){_0x123812['model']=_[_0xf3c4('0x44')](db[_0xf3c4('0x6a')]['rawAttributes']);_0x123812[_0xf3c4('0x47')]=_[_0xf3c4('0x44')](_0xda307a[_0xf3c4('0x47')]);_0x123812[_0xf3c4('0x45')]=_['intersection'](_0x123812[_0xf3c4('0x43')],_0x123812['query']);_0x4f132d[_0xf3c4('0x48')]=_[_0xf3c4('0x46')](_0x123812[_0xf3c4('0x43')],qs['fields'](_0xda307a[_0xf3c4('0x47')]['fields']));_0x4f132d[_0xf3c4('0x48')]=_0x4f132d[_0xf3c4('0x48')][_0xf3c4('0x4a')]?_0x4f132d[_0xf3c4('0x48')]:_0x123812['model'];if(!_0xda307a['query'][_0xf3c4('0x4b')](_0xf3c4('0x4c'))){_0x4f132d['limit']=qs['limit'](_0xda307a[_0xf3c4('0x47')]['limit']);_0x4f132d[_0xf3c4('0x31')]=qs[_0xf3c4('0x31')](_0xda307a['query']['offset']);}_0x4f132d[_0xf3c4('0x6c')]=qs[_0xf3c4('0x4d')](_0xda307a[_0xf3c4('0x47')][_0xf3c4('0x4d')]);_0x4f132d[_0xf3c4('0x4e')]=qs[_0xf3c4('0x45')](_['pick'](_0xda307a[_0xf3c4('0x47')],_0x123812[_0xf3c4('0x45')]));_0x4f132d[_0xf3c4('0x4e')]['SmsAccountId']=_0x16c8a1['id'];if(_0xda307a['query'][_0xf3c4('0x50')]){_0x4f132d[_0xf3c4('0x4e')]=_[_0xf3c4('0x51')](_0x4f132d[_0xf3c4('0x4e')],{'$or':_[_0xf3c4('0x3f')](_0x4f132d[_0xf3c4('0x48')],function(_0x1a017a){var _0x50fb23={};_0x50fb23[_0x1a017a]={'$like':'%'+_0xda307a['query'][_0xf3c4('0x50')]+'%'};return _0x50fb23;})});}_0x4f132d=_['merge']({},_0x4f132d,_0xda307a[_0xf3c4('0x5a')]);return db[_0xf3c4('0x6a')]['count']({'where':_0x4f132d[_0xf3c4('0x4e')]})[_0xf3c4('0x23')](function(_0x4d9948){_0x3e51af['count']=_0x4d9948;if(_0xda307a[_0xf3c4('0x47')][_0xf3c4('0x54')]){_0x4f132d[_0xf3c4('0x59')]=[{'all':!![]}];}return db[_0xf3c4('0x6a')]['findAll'](_0x4f132d);})[_0xf3c4('0x23')](function(_0x54b327){_0x3e51af[_0xf3c4('0x56')]=_0x54b327;return _0x3e51af;});}})[_0xf3c4('0x23')](respondWithFilteredResult(_0x5cdd78,_0x4f132d))['catch'](handleError(_0x5cdd78,null));};exports['removeDispositions']=function(_0x4244b1,_0x4414d5,_0x5c2b51){return db[_0xf3c4('0x40')][_0xf3c4('0x62')]({'where':{'id':_0x4244b1[_0xf3c4('0x66')]['id']}})['then'](handleEntityNotFound(_0x4414d5,null))[_0xf3c4('0x23')](function(_0x3f7868){if(_0x3f7868){return _0x3f7868[_0xf3c4('0x6d')](_0x4244b1['query'][_0xf3c4('0x6e')]);}})[_0xf3c4('0x23')](respondWithStatusCode(_0x4414d5,null))[_0xf3c4('0x2d')](handleError(_0x4414d5,null));};exports[_0xf3c4('0x6f')]=function(_0x1904f2,_0x5b0005,_0xdeaf41){if(_0x1904f2[_0xf3c4('0x5c')]['id']){delete _0x1904f2['body']['id'];}return db[_0xf3c4('0x40')][_0xf3c4('0x62')]({'where':{'id':_0x1904f2[_0xf3c4('0x66')]['id']}})['then'](handleEntityNotFound(_0x5b0005,null))[_0xf3c4('0x23')](function(_0x51d29c){if(_0x51d29c){_0x1904f2['body'][_0xf3c4('0x69')]=_0x51d29c['id'];return db['CannedAnswer'][_0xf3c4('0x5b')](_0x1904f2['body']);}})[_0xf3c4('0x23')](respondWithResult(_0x5b0005,null))['catch'](handleError(_0x5b0005,null));};exports[_0xf3c4('0x70')]=function(_0x44f5ef,_0x358bcf,_0x1ea18c){var _0x346709={'raw':![],'where':{}};var _0x364e64={};var _0x3cd7a5={'count':0x0,'rows':[]};return db[_0xf3c4('0x40')][_0xf3c4('0x6b')]({'where':{'id':_0x44f5ef[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x358bcf,null))['then'](function(_0x3ffaa3){if(_0x3ffaa3){_0x364e64[_0xf3c4('0x43')]=_[_0xf3c4('0x44')](db[_0xf3c4('0x71')][_0xf3c4('0x58')]);_0x364e64[_0xf3c4('0x47')]=_[_0xf3c4('0x44')](_0x44f5ef[_0xf3c4('0x47')]);_0x364e64['filters']=_[_0xf3c4('0x46')](_0x364e64[_0xf3c4('0x43')],_0x364e64['query']);_0x346709[_0xf3c4('0x48')]=_[_0xf3c4('0x46')](_0x364e64[_0xf3c4('0x43')],qs[_0xf3c4('0x49')](_0x44f5ef['query'][_0xf3c4('0x49')]));_0x346709[_0xf3c4('0x48')]=_0x346709[_0xf3c4('0x48')][_0xf3c4('0x4a')]?_0x346709[_0xf3c4('0x48')]:_0x364e64[_0xf3c4('0x43')];if(!_0x44f5ef[_0xf3c4('0x47')][_0xf3c4('0x4b')]('nolimit')){_0x346709['limit']=qs['limit'](_0x44f5ef['query'][_0xf3c4('0x33')]);_0x346709['offset']=qs[_0xf3c4('0x31')](_0x44f5ef[_0xf3c4('0x47')][_0xf3c4('0x31')]);}_0x346709[_0xf3c4('0x6c')]=qs[_0xf3c4('0x4d')](_0x44f5ef['query'][_0xf3c4('0x4d')]);_0x346709[_0xf3c4('0x4e')]=qs[_0xf3c4('0x45')](_['pick'](_0x44f5ef['query'],_0x364e64['filters']));_0x346709[_0xf3c4('0x4e')][_0xf3c4('0x69')]=_0x3ffaa3['id'];if(_0x44f5ef['query'][_0xf3c4('0x50')]){_0x346709[_0xf3c4('0x4e')]=_['merge'](_0x346709[_0xf3c4('0x4e')],{'$or':_[_0xf3c4('0x3f')](_0x346709[_0xf3c4('0x48')],function(_0x55d558){var _0x4e7881={};_0x4e7881[_0x55d558]={'$like':'%'+_0x44f5ef[_0xf3c4('0x47')][_0xf3c4('0x50')]+'%'};return _0x4e7881;})});}_0x346709=_[_0xf3c4('0x51')]({},_0x346709,_0x44f5ef[_0xf3c4('0x5a')]);return db[_0xf3c4('0x71')]['count']({'where':_0x346709['where']})[_0xf3c4('0x23')](function(_0x51f961){_0x3cd7a5[_0xf3c4('0x34')]=_0x51f961;if(_0x44f5ef[_0xf3c4('0x47')]['includeAll']){_0x346709['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf3c4('0x55')](_0x346709);})['then'](function(_0x38a7cd){_0x3cd7a5['rows']=_0x38a7cd;return _0x3cd7a5;});}})[_0xf3c4('0x23')](respondWithFilteredResult(_0x358bcf,_0x346709))[_0xf3c4('0x2d')](handleError(_0x358bcf,null));};exports[_0xf3c4('0x72')]=function(_0x592956,_0x40bf4d,_0x6324df){return db[_0xf3c4('0x40')][_0xf3c4('0x62')]({'where':{'id':_0x592956[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x40bf4d,null))[_0xf3c4('0x23')](function(_0x431869){if(_0x431869){return _0x431869[_0xf3c4('0x72')](_0x592956['query'][_0xf3c4('0x6e')]);}})['then'](respondWithStatusCode(_0x40bf4d,null))[_0xf3c4('0x2d')](handleError(_0x40bf4d,null));};exports[_0xf3c4('0x73')]=function(_0x13b390,_0x2e0b80,_0x1f1b43){var _0x432abf={'channel':_0xf3c4('0x74')};var _0x1b8cb1=[];var _0x363b3e=[];var _0x35f8e2={};return db[_0xf3c4('0x40')][_0xf3c4('0x62')]({'where':{'id':_0x13b390[_0xf3c4('0x66')]['id']},'include':[{'model':db[_0xf3c4('0x75')],'as':'Applications'}]})[_0xf3c4('0x23')](handleEntityNotFound(_0x2e0b80,null))[_0xf3c4('0x23')](function(_0x118953){_0x432abf['account']=_0x118953;_0x432abf[_0xf3c4('0x76')]=_[_0xf3c4('0x77')](_0x118953[_0xf3c4('0x78')],[_0xf3c4('0x79')],['asc']);if(_0x432abf['account'][_0xf3c4('0x78')]){delete _0x432abf[_0xf3c4('0x7a')][_0xf3c4('0x78')];}return db[_0xf3c4('0x7b')]['describe']();})[_0xf3c4('0x23')](function(_0x4b18ae){if(!_0x4b18ae){throw new db[(_0xf3c4('0x7c'))][(_0xf3c4('0x7d'))]('no\x20available\x20attributes');}_0x1b8cb1=_['difference'](_['keys'](_0x4b18ae),[_0xf3c4('0x7e'),_0xf3c4('0x7f')]);_0x363b3e=_['difference'](_[_0xf3c4('0x44')](_0x4b18ae),[_0xf3c4('0x7e'),'updatedAt',_0xf3c4('0x80'),'ListId']);_0x432abf[_0xf3c4('0x5c')]={'mapKey':_0xf3c4('0x81')};if(_0x432abf[_0xf3c4('0x7a')][_0xf3c4('0x52')]){switch(_0x432abf[_0xf3c4('0x7a')][_0xf3c4('0x52')]){case _0xf3c4('0x82'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x84')];_0x432abf[_0xf3c4('0x5c')]['body']=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x85')];_0x432abf[_0xf3c4('0x5c')]['messageId']=_0x13b390['body'][_0xf3c4('0x86')];break;case _0xf3c4('0x87'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]='+'+_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x88')];_0x432abf[_0xf3c4('0x5c')]['body']=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x89')];break;case _0xf3c4('0x8a'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x83')];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x2b')];break;case _0xf3c4('0x8b'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x83')];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')]=_0x13b390['body'][_0xf3c4('0x5c')];_0x432abf[_0xf3c4('0x5c')]['messageId']=_0x13b390[_0xf3c4('0x5c')]['message_id'];break;case _0xf3c4('0x8c'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x84')];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')]=_0x13b390[_0xf3c4('0x5c')]['Text'];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x8d')]=_0x13b390[_0xf3c4('0x5c')]['MessageUUID'];break;case _0xf3c4('0x8e'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]='+'+_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x8f')][0x0][_0xf3c4('0x83')];_0x432abf['body'][_0xf3c4('0x5c')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x8f')][0x0][_0xf3c4('0x89')];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x8d')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x8f')][0x0][_0xf3c4('0x8d')];break;case _0xf3c4('0x90'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x91')];_0x432abf['body'][_0xf3c4('0x5c')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x92')][_0xf3c4('0x2b')];break;case _0xf3c4('0x93'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x94')];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')]=_0x13b390['body'][_0xf3c4('0x89')];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x8d')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x95')];break;case'bandwidth':_0x432abf['body']['messageId']=_0x13b390[_0xf3c4('0x5c')][0x0][_0xf3c4('0x2b')]['id'];_0x432abf[_0xf3c4('0x5c')]['from']=_0x13b390['body'][0x0]['message']['from'];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')]=_0x13b390[_0xf3c4('0x5c')][0x0][_0xf3c4('0x2b')][_0xf3c4('0x89')];break;case _0xf3c4('0x96'):_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')]=_0x13b390[_0xf3c4('0x5c')][_0xf3c4('0x83')];_0x432abf[_0xf3c4('0x5c')]['body']=_0x13b390['body']['message'];_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x8d')]=_0x13b390['body']['refid'];break;}}if(_0x432abf[_0xf3c4('0x5c')]['id']){delete _0x432abf[_0xf3c4('0x5c')]['id'];}if(_[_0xf3c4('0x97')](_0x432abf[_0xf3c4('0x5c')]['from'])){throw new db['Sequelize'][(_0xf3c4('0x7d'))]('from\x20is\x20mandatory');}if(_[_0xf3c4('0x97')](_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')])||_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')]===''){throw new db[(_0xf3c4('0x7c'))][(_0xf3c4('0x7d'))](_0xf3c4('0x98'));}if(_['isNil'](_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x99')])){throw new db[(_0xf3c4('0x7c'))][(_0xf3c4('0x7d'))](_0xf3c4('0x9a')+_0x363b3e);}if(!_['includes'](_0x363b3e,_0x432abf['body'][_0xf3c4('0x99')])){throw new db[(_0xf3c4('0x7c'))]['ValidationError'](_0xf3c4('0x9b')+_0x363b3e);}_0x35f8e2[_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x99')]]=_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x83')];return db[_0xf3c4('0x9c')]['find']({'where':{'id':_0x432abf[_0xf3c4('0x7a')][_0xf3c4('0x9d')]},'include':[{'model':db[_0xf3c4('0x7b')],'as':_0xf3c4('0x9e'),'where':_0x35f8e2,'limit':0x1,'order':[['updatedAt',_0xf3c4('0x9f')]]}]});})['then'](handleEntityNotFound(_0x2e0b80,null))[_0xf3c4('0x23')](function(_0x423497){if(_0x423497){_0x432abf[_0xf3c4('0xa0')]=_[_0xf3c4('0xa1')](_0x423497,[_0xf3c4('0x9e')]);if(_0x423497['Contacts'][_0xf3c4('0x4a')]){return _0x423497[_0xf3c4('0x9e')][0x0];}var _0x1310c9=_[_0xf3c4('0x1c')](_0x432abf[_0xf3c4('0x5c')],{'firstName':_0x432abf['body'][_0xf3c4('0x83')],'ListId':_0x423497['id']});_0x1310c9[_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x99')]]=_0x432abf['body'][_0xf3c4('0x83')];return db[_0xf3c4('0x7b')]['create'](_0x1310c9,{'fields':_0x1b8cb1,'raw':!![]});}})[_0xf3c4('0x23')](handleEntityNotFound(_0x2e0b80,null))[_0xf3c4('0x23')](function(_0x4cd02e){if(_0x4cd02e){_0x432abf['contact']=_0x4cd02e;var _0x57a94f={'ContactId':_0x4cd02e['id'],'phone':_0x432abf['body'][_0xf3c4('0x83')],'SmsAccountId':_0x13b390['params']['id']};var _0x56e9da={'ContactId':_0x4cd02e['id'],'SmsAccountId':_0x13b390[_0xf3c4('0x66')]['id'],'closed':![]};return db['SmsInteraction'][_0xf3c4('0x62')]({'where':_0x56e9da})['then'](function(_0x2a71e9){if(_0x2a71e9){return[_0x2a71e9,![]];}return db[_0xf3c4('0xa2')]['create'](_0x57a94f)[_0xf3c4('0x23')](function(_0x286d2b){return[_0x286d2b,!![]];});});}})[_0xf3c4('0xa3')](function(_0x153228,_0x913961){_0x432abf[_0xf3c4('0xa4')]=_0x153228[_0xf3c4('0x5e')]({'plain':!![]});_0x432abf[_0xf3c4('0xa4')]['created']=![];if(_0x913961){if(_0x432abf[_0xf3c4('0x7a')][_0xf3c4('0xa5')]){_0x432abf['applications'][_0xf3c4('0xa6')]({'id':0x0,'priority':_0x432abf[_0xf3c4('0x76')]['length']+0x1,'app':_0xf3c4('0xa7'),'appdata':_0xf3c4('0xa8'),'interval':_0xf3c4('0xa9')});}_0x432abf[_0xf3c4('0xa4')]['created']=!![];}return db[_0xf3c4('0xaa')]['create']({'phone':_0x432abf[_0xf3c4('0x5c')]['from'],'messageId':_0x432abf['body'][_0xf3c4('0x8d')],'body':_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0x5c')],'SmsAccountId':_0x13b390[_0xf3c4('0x66')]['id'],'SmsInteractionId':_0x153228['id'],'direction':'in','ContactId':_0x153228[_0xf3c4('0xab')],'AttachmentId':_0x432abf[_0xf3c4('0x5c')][_0xf3c4('0xac')]});})[_0xf3c4('0x23')](function(_0x2fa608){_0x432abf['message']=_0x2fa608;if(_0x432abf[_0xf3c4('0xa4')][_0xf3c4('0xad')]){return db[_0xf3c4('0xae')][_0xf3c4('0x62')]({'attributes':['id',_0xf3c4('0x3c')],'where':{'id':_0x432abf[_0xf3c4('0xa4')][_0xf3c4('0xad')]}})[_0xf3c4('0x23')](function(_0x4f1e2f){if(_0x4f1e2f){_0x432abf[_0xf3c4('0x76')][_0xf3c4('0xaf')]({'id':0x0,'priority':0x0,'app':_0xf3c4('0xb0'),'appdata':_0x4f1e2f[_0xf3c4('0x3c')]+','+(_0x432abf[_0xf3c4('0x7a')][_0xf3c4('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf3c4('0xb2'),'startRouting',_0x432abf);});}return respondWithRpcPromise(_0xf3c4('0xb2'),_0xf3c4('0xb3'),_0x432abf);})[_0xf3c4('0x23')](function(_0x2fc27e){if(_0x2fc27e){var _0x36eb5d=0xc8;var _0x1f7ac5=_0xf3c4('0xb4');logger[_0xf3c4('0x24')](_0xf3c4('0xb5'),_0x1f7ac5,_0x36eb5d,_0xf3c4('0xb6'));logger['debug'](_0xf3c4('0xb7'),_0x1f7ac5,_0x36eb5d,_0xf3c4('0xb6'),JSON[_0xf3c4('0x28')](_0x2fc27e));if(_0x432abf[_0xf3c4('0x7a')][_0xf3c4('0x52')]===_0xf3c4('0x82')){return _0x2e0b80[_0xf3c4('0x2f')](_0x36eb5d)[_0xf3c4('0x35')]('Content-Type','text/xml')['send'](_0xf3c4('0xb8'));}else{return _0x2e0b80['status'](_0x36eb5d)['json'](_0x2fc27e);}}})[_0xf3c4('0x2d')](handleError(_0x2e0b80,null));};exports['addApplications']=function(_0xb57adb,_0x2b9d6e){var _0x4274a5=_0xb57adb[_0xf3c4('0x66')]['id'];var _0x213486=_0xb57adb['body'];var _0x51fbdb=0xc8;var _0x72933b=null;return db['sequelize'][_0xf3c4('0xb9')]({'isolationLevel':db[_0xf3c4('0xba')][_0xf3c4('0xbb')][_0xf3c4('0xbc')][_0xf3c4('0xbd')]},function(_0x57c5c4){return db['SmsAccount'][_0xf3c4('0x6b')]({'where':{'id':_0x4274a5},'transaction':_0x57c5c4})[_0xf3c4('0x23')](function(_0x1454db){if(_0x1454db){return db['SmsApplication'][_0xf3c4('0x3b')]({'where':{'SmsAccountId':_0x4274a5},'transaction':_0x57c5c4})['then'](function(){var _0x502f67=_[_0xf3c4('0x3f')](_0x213486,function(_0x3588eb){_0x3588eb[_0xf3c4('0x69')]=_0x4274a5;return _0x3588eb;});return db[_0xf3c4('0x75')][_0xf3c4('0xbe')](_0x502f67,{'transaction':_0x57c5c4});});}else{_0x51fbdb=0x194;_0x72933b=[];}});})[_0xf3c4('0x23')](function(){if(_0x51fbdb!==0x194){return db[_0xf3c4('0x75')]['findAndCountAll']({'where':{'SmsAccountId':_0x4274a5},'order':_0xf3c4('0x79')})[_0xf3c4('0x23')](function(_0x27f065){_0x72933b=_0x27f065;});}})[_0xf3c4('0x2d')](function(_0x38240d){_0x51fbdb=0x1f4;logger[_0xf3c4('0x29')](_0x38240d[_0xf3c4('0xbf')]);if(_0x38240d[_0xf3c4('0x3c')]){delete _0x38240d[_0xf3c4('0x3c')];}_0x72933b=_0x38240d;})[_0xf3c4('0xc0')](function(){if(_0x72933b===null){_0x2b9d6e['sendStatus'](_0x51fbdb);}else{if(_0x51fbdb===0x1f4){_0x2b9d6e['status'](_0x51fbdb)[_0xf3c4('0x3d')](_0x72933b);}else{_0x2b9d6e[_0xf3c4('0x2f')](_0x51fbdb)[_0xf3c4('0x30')](_0x72933b);}}});};exports[_0xf3c4('0xc1')]=function(_0x197693,_0x4fdddc,_0x547bff){var _0x3bba9c={};var _0x525306={};var _0x3b083b;var _0x581661;return db[_0xf3c4('0x40')][_0xf3c4('0x6b')]({'where':{'id':_0x197693[_0xf3c4('0x66')]['id']}})['then'](handleEntityNotFound(_0x4fdddc,null))[_0xf3c4('0x23')](function(_0x2810ce){if(_0x2810ce){_0x3b083b=_0x2810ce;_0x525306['model']=_['keys'](db[_0xf3c4('0x75')][_0xf3c4('0x58')]);_0x525306[_0xf3c4('0x47')]=_[_0xf3c4('0x44')](_0x197693[_0xf3c4('0x47')]);_0x525306[_0xf3c4('0x45')]=_[_0xf3c4('0x46')](_0x525306[_0xf3c4('0x43')],_0x525306[_0xf3c4('0x47')]);_0x3bba9c[_0xf3c4('0x48')]=_[_0xf3c4('0x46')](_0x525306[_0xf3c4('0x43')],qs[_0xf3c4('0x49')](_0x197693[_0xf3c4('0x47')][_0xf3c4('0x49')]));_0x3bba9c['attributes']=_0x3bba9c['attributes'][_0xf3c4('0x4a')]?_0x3bba9c['attributes']:_0x525306[_0xf3c4('0x43')];_0x3bba9c['order']=qs[_0xf3c4('0x4d')](_0x197693['query'][_0xf3c4('0x4d')]);_0x3bba9c['where']=qs[_0xf3c4('0x45')](_[_0xf3c4('0x4f')](_0x197693['query'],_0x525306[_0xf3c4('0x45')]));if(_0x197693['query'][_0xf3c4('0x50')]){_0x3bba9c[_0xf3c4('0x4e')]=_['merge'](_0x3bba9c['where'],{'$or':_[_0xf3c4('0x3f')](_0x3bba9c['attributes'],function(_0x23a9b5){var _0x18e737={};_0x18e737[_0x23a9b5]={'$like':'%'+_0x197693[_0xf3c4('0x47')]['filter']+'%'};return _0x18e737;})});}_0x3bba9c=_[_0xf3c4('0x51')]({},_0x3bba9c,_0x197693[_0xf3c4('0x5a')]);return _0x3b083b['getApplications'](_0x3bba9c);}})[_0xf3c4('0x23')](function(_0x2401d5){if(_0x2401d5){_0x581661=_0x2401d5[_0xf3c4('0x4a')];if(!_0x197693[_0xf3c4('0x47')][_0xf3c4('0x4b')]('nolimit')){_0x3bba9c[_0xf3c4('0x33')]=qs[_0xf3c4('0x33')](_0x197693[_0xf3c4('0x47')][_0xf3c4('0x33')]);_0x3bba9c[_0xf3c4('0x31')]=qs[_0xf3c4('0x31')](_0x197693[_0xf3c4('0x47')][_0xf3c4('0x31')]);}return _0x3b083b[_0xf3c4('0xc1')](_0x3bba9c);}})[_0xf3c4('0x23')](function(_0x11c4a5){if(_0x11c4a5){return _0x11c4a5?{'count':_0x581661,'rows':_0x11c4a5}:null;}})['then'](respondWithResult(_0x4fdddc,null))[_0xf3c4('0x2d')](handleError(_0x4fdddc,null));};exports[_0xf3c4('0xc2')]=function(_0x16565e,_0x498be1,_0x58d739){var _0xd45162={'raw':![],'where':{}};var _0x34b77c={};var _0x26a7a9={'count':0x0,'rows':[]};return db[_0xf3c4('0x40')][_0xf3c4('0x6b')]({'where':{'id':_0x16565e[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x498be1,null))[_0xf3c4('0x23')](function(_0x33cc97){if(_0x33cc97){_0x34b77c[_0xf3c4('0x43')]=_['keys'](db['SmsInteraction'][_0xf3c4('0x58')]);_0x34b77c['query']=_['keys'](_0x16565e[_0xf3c4('0x47')]);_0x34b77c[_0xf3c4('0x45')]=_[_0xf3c4('0x46')](_0x34b77c[_0xf3c4('0x43')],_0x34b77c[_0xf3c4('0x47')]);_0xd45162[_0xf3c4('0x48')]=_['intersection'](_0x34b77c[_0xf3c4('0x43')],qs[_0xf3c4('0x49')](_0x16565e[_0xf3c4('0x47')][_0xf3c4('0x49')]));_0xd45162['attributes']=_0xd45162[_0xf3c4('0x48')][_0xf3c4('0x4a')]?_0xd45162[_0xf3c4('0x48')]:_0x34b77c[_0xf3c4('0x43')];if(!_0x16565e[_0xf3c4('0x47')]['hasOwnProperty'](_0xf3c4('0x4c'))){_0xd45162[_0xf3c4('0x33')]=qs[_0xf3c4('0x33')](_0x16565e['query'][_0xf3c4('0x33')]);_0xd45162[_0xf3c4('0x31')]=qs[_0xf3c4('0x31')](_0x16565e['query'][_0xf3c4('0x31')]);}_0xd45162['order']=qs[_0xf3c4('0x4d')](_0x16565e[_0xf3c4('0x47')][_0xf3c4('0x4d')]);_0xd45162['where']=qs[_0xf3c4('0x45')](_['pick'](_0x16565e['query'],_0x34b77c[_0xf3c4('0x45')]));_0xd45162['where'][_0xf3c4('0x69')]=_0x33cc97['id'];if(_0x16565e['query'][_0xf3c4('0x50')]){_0xd45162[_0xf3c4('0x4e')]=_[_0xf3c4('0x51')](_0xd45162[_0xf3c4('0x4e')],{'$or':_[_0xf3c4('0x3f')](_0xd45162['attributes'],function(_0xc4693){var _0x5c32a7={};_0x5c32a7[_0xc4693]={'$like':'%'+_0x16565e[_0xf3c4('0x47')]['filter']+'%'};return _0x5c32a7;})});}_0xd45162=_[_0xf3c4('0x51')]({},_0xd45162,_0x16565e[_0xf3c4('0x5a')]);return db[_0xf3c4('0xa2')][_0xf3c4('0x34')]({'where':_0xd45162[_0xf3c4('0x4e')]})[_0xf3c4('0x23')](function(_0xc5d061){_0x26a7a9[_0xf3c4('0x34')]=_0xc5d061;if(_0x16565e['query'][_0xf3c4('0x54')]){_0xd45162[_0xf3c4('0x59')]=[{'model':db[_0xf3c4('0x7b')],'as':_0xf3c4('0xc3'),'required':![]},{'model':db[_0xf3c4('0xae')],'as':_0xf3c4('0xc4'),'attributes':[_0xf3c4('0x3c'),_0xf3c4('0xc5'),'internal'],'required':![]},{'model':db[_0xf3c4('0xc6')],'as':_0xf3c4('0xc7'),'attributes':['id','name',_0xf3c4('0xc8')],'where':_0x16565e[_0xf3c4('0x47')][_0xf3c4('0xc9')]?{'id':_0x16565e[_0xf3c4('0x47')][_0xf3c4('0xc9')]}:undefined,'required':_0x16565e[_0xf3c4('0x47')]['tag']?!![]:![]}];}return db[_0xf3c4('0xa2')]['findAll'](_0xd45162);})[_0xf3c4('0x23')](function(_0x370210){_0x26a7a9['rows']=_0x370210;return _0x26a7a9;});}})[_0xf3c4('0x23')](respondWithFilteredResult(_0x498be1,_0xd45162))[_0xf3c4('0x2d')](handleError(_0x498be1,null));};exports[_0xf3c4('0x3d')]=function(_0x1ba5ed,_0x4a7d05,_0x20db77){var _0x1df245,_0x15164a,_0x586761;if(_['isNil'](_0x1ba5ed[_0xf3c4('0x5c')][_0xf3c4('0x5c')])||_0x1ba5ed[_0xf3c4('0x5c')][_0xf3c4('0x5c')]===''){throw new db[(_0xf3c4('0x7c'))][(_0xf3c4('0x7d'))](_0xf3c4('0x98'));}if(_[_0xf3c4('0x97')](_0x1ba5ed['body']['to'])){throw new db['Sequelize'][(_0xf3c4('0x7d'))](_0xf3c4('0xca'));}_0x1df245=_0x1ba5ed['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0x1ba5ed['params']['id']},'include':[{'model':db['CmList'],'as':_0xf3c4('0xcb'),'include':[{'model':db[_0xf3c4('0x7b')],'as':_0xf3c4('0x9e'),'where':{'mobile':_0x1df245},'limit':0x1,'order':[[_0xf3c4('0x7f'),'DESC']]}]}]})[_0xf3c4('0x23')](handleEntityNotFound(_0x4a7d05,null))[_0xf3c4('0x23')](function(_0x432e6d){if(_0x432e6d&&_0x432e6d[_0xf3c4('0xcb')]){_0x15164a=_0x432e6d[_0xf3c4('0x5e')]({'plain':!![]});if(_0x15164a[_0xf3c4('0xcb')]&&_0x15164a[_0xf3c4('0xcb')][_0xf3c4('0x9e')][_0xf3c4('0x4a')]){return _0x15164a[_0xf3c4('0xcb')][_0xf3c4('0x9e')][0x0];}return db['CmContact'][_0xf3c4('0x5b')](_[_0xf3c4('0x1c')](_0x1ba5ed[_0xf3c4('0x5c')],{'firstName':_0x1df245,'mobile':_0x1df245,'phone':_0x1df245,'ListId':_0x15164a[_0xf3c4('0x9d')]}));}})[_0xf3c4('0x23')](handleEntityNotFound(_0x4a7d05,null))[_0xf3c4('0x23')](function(_0x6f897e){if(_0x6f897e){_0x586761=_0x6f897e;return db[_0xf3c4('0xa2')][_0xf3c4('0x62')]({'where':{'ContactId':_0x586761['id'],'closed':![],'SmsAccountId':_0x15164a['id']}})[_0xf3c4('0x23')](function(_0x48c973){if(_0x48c973){return[_0x48c973,![]];}return db[_0xf3c4('0xa2')][_0xf3c4('0x5b')]({'UserId':_0x1ba5ed[_0xf3c4('0x5d')]['id'],'ContactId':_0x586761['id'],'SmsAccountId':_0x15164a['id'],'phone':_0x1df245,'firstMsgDirection':_0xf3c4('0xcc'),'Messages':[_[_0xf3c4('0x51')](_0x1ba5ed[_0xf3c4('0x5c')],{'read':![],'body':_0x1ba5ed['body'][_0xf3c4('0x5c')],'phone':_0x1df245,'SmsAccountId':_0x15164a['id'],'UserId':_0x1ba5ed[_0xf3c4('0x5d')]['id'],'ContactId':_0x586761['id']})]},{'include':[{'model':db[_0xf3c4('0xaa')],'as':_0xf3c4('0xcd')}]})[_0xf3c4('0x23')](function(_0x11a9c6){return[_0x11a9c6,!![]];});});}})['spread'](function(_0x4f4b47,_0x270f90){if(_0x270f90){return _0x4f4b47;}return db[_0xf3c4('0xaa')][_0xf3c4('0x5b')](_[_0xf3c4('0x51')](_0x1ba5ed[_0xf3c4('0x5c')],{'read':![],'body':_0x1ba5ed[_0xf3c4('0x5c')][_0xf3c4('0x5c')],'phone':_0x1df245,'SmsAccountId':_0x15164a['id'],'SmsInteractionId':_0x4f4b47['id'],'UserId':_0x1ba5ed[_0xf3c4('0x5d')]['id'],'ContactId':_0x586761['id']}))[_0xf3c4('0x23')](function(_0x59389c){_0x4f4b47[_0xf3c4('0xce')][_0xf3c4('0xcd')]=[];_0x4f4b47[_0xf3c4('0xce')][_0xf3c4('0xcd')][_0xf3c4('0xa6')](_0x59389c['dataValues']);return _0x4f4b47;});})['then'](respondWithResult(_0x4a7d05,null))['catch'](handleError(_0x4a7d05,null));};exports[_0xf3c4('0x2f')]=function(_0x4c5073,_0x59e37e,_0x531d33){if(_0x4c5073['body']['id']){delete _0x4c5073[_0xf3c4('0x5c')]['id'];}var _0x473e9b,_0x241c0b,_0x1eecbc;return db[_0xf3c4('0x40')][_0xf3c4('0x62')]({'where':{'id':_0x4c5073[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x59e37e,null))['then'](function(_0x1dcd1b){if(_0x1dcd1b){_0x1eecbc=_0x1dcd1b;logger[_0xf3c4('0x27')](_0xf3c4('0xb5'),_0xf3c4('0x2f'),_0xf3c4('0xcf'),_0x1dcd1b[_0xf3c4('0x52')],util[_0xf3c4('0xd0')](_0x4c5073['body'],{'showHidden':![],'depth':null}));switch(_0x1dcd1b[_0xf3c4('0x52')]){case'skebby':if(_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd1')]&&_0x4c5073['body']['status']){_0x241c0b=_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0x2f')];return db[_0xf3c4('0xaa')][_0xf3c4('0x62')]({'where':{'messageId':_0x4c5073[_0xf3c4('0x5c')]['skebby_dispatch_id']}});}break;case _0xf3c4('0x8a'):if(_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd2')]&&_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd3')]){_0x241c0b=_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd3')];return db[_0xf3c4('0xaa')][_0xf3c4('0x62')]({'where':{'messageId':_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd2')]}});}break;case _0xf3c4('0x8b'):if(_0x4c5073[_0xf3c4('0x5c')]['message_id']&&_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd4')]){_0x241c0b=_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd4')];return db[_0xf3c4('0xaa')]['find']({'where':{'messageId':_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0xd5')]}});}break;case'infobip':var _0x16b611=_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0x8f')][0x0];if(_0x16b611[_0xf3c4('0x8d')]&&_0x16b611[_0xf3c4('0x2f')]['groupName']===_0xf3c4('0xd6')){_0x241c0b=_0x16b611['status'][_0xf3c4('0xd7')];return db[_0xf3c4('0xaa')][_0xf3c4('0x62')]({'where':{'messageId':_0x16b611[_0xf3c4('0x8d')]}});}break;case _0xf3c4('0x93'):if(_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0x8d')]&&_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0x2f')]){_0x241c0b=_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x4c5073['body'][_0xf3c4('0x8d')]}});}break;case _0xf3c4('0xd8'):if(_0x4c5073[_0xf3c4('0x5c')][0x0][_0xf3c4('0x2b')]['id']){_0x241c0b=_0x4c5073['body'][0x0]['type'];return db[_0xf3c4('0xaa')][_0xf3c4('0x62')]({'where':{'messageId':_0x4c5073[_0xf3c4('0x5c')][0x0][_0xf3c4('0x2b')]['id']}});}break;case'intelepeer':if(_0x4c5073['body'][_0xf3c4('0xd9')]&&_0x4c5073[_0xf3c4('0x5c')]['status']){_0x241c0b=_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0x2f')];return db[_0xf3c4('0xaa')]['find']({'where':{'messageId':_0x4c5073['body'][_0xf3c4('0xd9')]}});}break;}}})[_0xf3c4('0x23')](handleEntityNotFound(_0x59e37e,null))[_0xf3c4('0x23')](function(_0x2e8851){if(_0x2e8851){_0x473e9b=_0x2e8851;switch(_0x1eecbc[_0xf3c4('0x52')]){case _0xf3c4('0x87'):if(_0x241c0b==='DELIVERED'){return _0x473e9b['update']({'read':!![]});}else{logger[_0xf3c4('0x29')](_0xf3c4('0xb5'),_0xf3c4('0x2f'),_0xf3c4('0x87'),util[_0xf3c4('0xd0')](_0x4c5073[_0xf3c4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xf3c4('0x8a'):if(_0x241c0b==='1'){return _0x473e9b[_0xf3c4('0x38')]({'read':!![]});}else{logger[_0xf3c4('0x29')](_0xf3c4('0xb5'),_0xf3c4('0x2f'),_0xf3c4('0x87'),util[_0xf3c4('0xd0')](_0x4c5073['body'],{'showHidden':![],'depth':null}));}break;case _0xf3c4('0x8b'):if(!_0x4c5073[_0xf3c4('0x5c')]['error_code']&&_0x241c0b>=0xc8&&_0x241c0b<=0xce){return _0x473e9b['update']({'read':!![]});}else{logger[_0xf3c4('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf3c4('0x2f'),_0xf3c4('0x8b'),util[_0xf3c4('0xd0')](_0x4c5073[_0xf3c4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xf3c4('0x8e'):var _0x15bf1a=_0x4c5073[_0xf3c4('0x5c')][_0xf3c4('0x8f')][0x0];if(_0x15bf1a[_0xf3c4('0x2f')][_0xf3c4('0xd7')]==='DELIVERED'){return _0x473e9b['update']({'read':!![]});}else{logger[_0xf3c4('0x29')](_0xf3c4('0xb5'),'status',_0xf3c4('0x8e'),util[_0xf3c4('0xd0')](_0x4c5073['body'],{'showHidden':![],'depth':null}));}break;case _0xf3c4('0x93'):if(_0x241c0b==_0xf3c4('0xda')||_0x241c0b=='RECEIVED_BY_RECIPIENT'){return _0x473e9b['update']({'read':!![]});}else{logger[_0xf3c4('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf3c4('0x93'),util[_0xf3c4('0xd0')](_0x4c5073['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x241c0b==_0xf3c4('0xdb')){return _0x473e9b[_0xf3c4('0x38')]({'read':!![]});}else{logger[_0xf3c4('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf3c4('0x2f'),_0xf3c4('0xd8'),util[_0xf3c4('0xd0')](_0x4c5073['body'],{'showHidden':![],'depth':null}));}break;case _0xf3c4('0x96'):if(_0x241c0b===_0xf3c4('0xdc')||_0x241c0b===_0xf3c4('0xdd')){return _0x473e9b[_0xf3c4('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf3c4('0x96'),util['inspect'](_0x4c5073[_0xf3c4('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x473e9b;}})[_0xf3c4('0x23')](respondWithResult(_0x59e37e,null))[_0xf3c4('0x2d')](handleError(_0x59e37e,null));};exports[_0xf3c4('0xde')]=function(_0x105481,_0x54d6e2,_0x4a4a11){var _0x5d5247,_0x10f1b6,_0x23eedb;return db[_0xf3c4('0x40')][_0xf3c4('0x62')]({'where':{'id':_0x105481[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x54d6e2,null))['then'](function(_0x15b62b){if(_0x15b62b){_0x23eedb=_0x15b62b;logger[_0xf3c4('0x27')](_0xf3c4('0xb5'),_0xf3c4('0x2f'),'received\x20delivery\x20report\x20from',_0x15b62b[_0xf3c4('0x52')],util['inspect'](_0x105481[_0xf3c4('0x47')],{'showHidden':![],'depth':null}));switch(_0x15b62b[_0xf3c4('0x52')]){case _0xf3c4('0x90'):if(_0x105481[_0xf3c4('0x47')][_0xf3c4('0xdf')]&&_0x105481[_0xf3c4('0x47')][_0xf3c4('0xe0')]){_0x10f1b6=_0x105481[_0xf3c4('0x47')][_0xf3c4('0xe0')];return db['SmsMessage']['find']({'where':{'messageId':_0x105481[_0xf3c4('0x47')][_0xf3c4('0xdf')]}});}break;}}})[_0xf3c4('0x23')](handleEntityNotFound(_0x54d6e2,null))[_0xf3c4('0x23')](function(_0x39559e){if(_0x39559e){_0x5d5247=_0x39559e;switch(_0x23eedb[_0xf3c4('0x52')]){case _0xf3c4('0x90'):if(_0x10f1b6==='2'||_0x10f1b6==='6'){return _0x5d5247[_0xf3c4('0x38')]({'read':!![]});}else{logger[_0xf3c4('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xf3c4('0x90'),util[_0xf3c4('0xd0')](_0x105481['query'],{'showHidden':![],'depth':null}));};break;}return _0x5d5247;}})[_0xf3c4('0x23')](respondWithResult(_0x54d6e2,null))[_0xf3c4('0x2d')](handleError(_0x54d6e2,null));};exports['addAgents']=function(_0x1da3bd,_0x5d107b,_0x2c7e0e){return db['SmsAccount']['find']({'where':{'id':_0x1da3bd[_0xf3c4('0x66')]['id']}})['then'](handleEntityNotFound(_0x5d107b,null))[_0xf3c4('0x23')](function(_0x302318){if(_0x302318){return _0x302318[_0xf3c4('0xe1')](_0x1da3bd[_0xf3c4('0x5c')][_0xf3c4('0x6e')],_[_0xf3c4('0xa1')](_0x1da3bd['body'],[_0xf3c4('0x6e'),'id'])||{})[_0xf3c4('0xa3')](function(_0x4f2218){for(var _0x267187=0x0;_0x267187<_0x1da3bd[_0xf3c4('0x5c')][_0xf3c4('0x6e')]['length'];_0x267187+=0x1){socket[_0xf3c4('0xe2')](_0xf3c4('0xe3'),{'UserId':Number(_0x1da3bd['body'][_0xf3c4('0x6e')][_0x267187]),'SmsAccountId':Number(_0x1da3bd[_0xf3c4('0x66')]['id'])});}return _0x4f2218;});}})['then'](respondWithResult(_0x5d107b,null))[_0xf3c4('0x2d')](handleError(_0x5d107b,null));};exports['removeAgents']=function(_0x5f4f5b,_0x52a956,_0xb0504f){return db[_0xf3c4('0x40')][_0xf3c4('0x62')]({'where':{'id':_0x5f4f5b[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x52a956,null))[_0xf3c4('0x23')](function(_0x1d637f){if(_0x1d637f){return _0x1d637f[_0xf3c4('0xe4')](_0x5f4f5b[_0xf3c4('0x47')]['ids'])[_0xf3c4('0x23')](function(){if(_[_0xf3c4('0xe5')](_0x5f4f5b[_0xf3c4('0x47')][_0xf3c4('0x6e')])){for(var _0x1238eb=0x0;_0x1238eb<_0x5f4f5b['query']['ids'][_0xf3c4('0x4a')];_0x1238eb+=0x1){socket[_0xf3c4('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0x5f4f5b[_0xf3c4('0x47')][_0xf3c4('0x6e')][_0x1238eb]),'SmsAccountId':Number(_0x5f4f5b[_0xf3c4('0x66')]['id'])});}}else{socket['emit'](_0xf3c4('0xe6'),{'UserId':Number(_0x5f4f5b[_0xf3c4('0x47')][_0xf3c4('0x6e')]),'SmsAccountId':Number(_0x5f4f5b[_0xf3c4('0x66')]['id'])});}});}})[_0xf3c4('0x23')](respondWithStatusCode(_0x52a956,null))[_0xf3c4('0x2d')](handleError(_0x52a956,null));};exports[_0xf3c4('0xe7')]=function(_0x282b55,_0x2371dd,_0x591c0b){var _0x1212d7={};var _0x34b2ad={};var _0x5ed2d8;var _0xf15b5f;return db[_0xf3c4('0x40')][_0xf3c4('0x6b')]({'where':{'id':_0x282b55[_0xf3c4('0x66')]['id']}})[_0xf3c4('0x23')](handleEntityNotFound(_0x2371dd,null))[_0xf3c4('0x23')](function(_0x461259){if(_0x461259){_0x5ed2d8=_0x461259;_0x34b2ad[_0xf3c4('0x43')]=_[_0xf3c4('0x44')](db['User'][_0xf3c4('0x58')]);_0x34b2ad[_0xf3c4('0x47')]=_['keys'](_0x282b55[_0xf3c4('0x47')]);_0x34b2ad[_0xf3c4('0x45')]=_[_0xf3c4('0x46')](_0x34b2ad[_0xf3c4('0x43')],_0x34b2ad[_0xf3c4('0x47')]);_0x1212d7['attributes']=_['intersection'](_0x34b2ad[_0xf3c4('0x43')],qs[_0xf3c4('0x49')](_0x282b55[_0xf3c4('0x47')][_0xf3c4('0x49')]));_0x1212d7[_0xf3c4('0x48')]=_0x1212d7['attributes'][_0xf3c4('0x4a')]?_0x1212d7[_0xf3c4('0x48')]:_0x34b2ad[_0xf3c4('0x43')];_0x1212d7['order']=qs[_0xf3c4('0x4d')](_0x282b55[_0xf3c4('0x47')][_0xf3c4('0x4d')]);_0x1212d7['where']=qs[_0xf3c4('0x45')](_[_0xf3c4('0x4f')](_0x282b55['query'],_0x34b2ad['filters']));if(_0x282b55[_0xf3c4('0x47')][_0xf3c4('0x50')]){_0x1212d7['where']=_[_0xf3c4('0x51')](_0x1212d7['where'],{'$or':_['map'](_0x1212d7[_0xf3c4('0x48')],function(_0x40320c){var _0x3758b7={};_0x3758b7[_0x40320c]={'$like':'%'+_0x282b55['query']['filter']+'%'};return _0x3758b7;})});}_0x1212d7=_['merge']({},_0x1212d7,_0x282b55[_0xf3c4('0x5a')]);return _0x5ed2d8['getAgents'](_0x1212d7);}})[_0xf3c4('0x23')](function(_0x20b4fa){if(_0x20b4fa){_0xf15b5f=_0x20b4fa[_0xf3c4('0x4a')];if(!_0x282b55[_0xf3c4('0x47')][_0xf3c4('0x4b')](_0xf3c4('0x4c'))){_0x1212d7[_0xf3c4('0x33')]=qs[_0xf3c4('0x33')](_0x282b55[_0xf3c4('0x47')][_0xf3c4('0x33')]);_0x1212d7[_0xf3c4('0x31')]=qs[_0xf3c4('0x31')](_0x282b55[_0xf3c4('0x47')][_0xf3c4('0x31')]);}return _0x5ed2d8[_0xf3c4('0xe7')](_0x1212d7);}})[_0xf3c4('0x23')](function(_0x491469){if(_0x491469){return _0x491469?{'count':_0xf15b5f,'rows':_0x491469}:null;}})[_0xf3c4('0x23')](respondWithResult(_0x2371dd,null))['catch'](handleError(_0x2371dd,null));}; \ No newline at end of file +var _0xd6b2=['localhost','socket.io-emitter','register','jayson/promise','client','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','SmsAccountId','Disposition','getDispositions','nolimit','order','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','text','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','updatedAt','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','autoclose','push','close','*,*,*,*','created','ContactId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','List','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif','skebby','infobip','clickatell','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','csc','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','zip-dir','request-promise','moment','mustache','path','sox','fs-extra','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x1822ae,_0x492bae){var _0x3c8a03=function(_0x5ae0f3){while(--_0x5ae0f3){_0x1822ae['push'](_0x1822ae['shift']());}};_0x3c8a03(++_0x492bae);}(_0xd6b2,0xcc));var _0x2d6b=function(_0x369b95,_0x3ad73c){_0x369b95=_0x369b95-0x0;var _0x21854b=_0xd6b2[_0x369b95];return _0x21854b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d6b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d6b('0x1'));var moment=require(_0x2d6b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d6b('0x3'));var util=require('util');var path=require(_0x2d6b('0x4'));var sox=require(_0x2d6b('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d6b('0x6'));var _=require(_0x2d6b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2d6b('0x8'));var querystring=require(_0x2d6b('0x9'));var Papa=require(_0x2d6b('0xa'));var Redis=require(_0x2d6b('0xb'));var authService=require(_0x2d6b('0xc'));var qs=require(_0x2d6b('0xd'));var as=require(_0x2d6b('0xe'));var hardwareService=require(_0x2d6b('0xf'));var logger=require(_0x2d6b('0x10'))(_0x2d6b('0x11'));var utils=require(_0x2d6b('0x12'));var config=require(_0x2d6b('0x13'));var licenseUtil=require(_0x2d6b('0x14'));var db=require(_0x2d6b('0x15'))['db'];config[_0x2d6b('0x16')]=_[_0x2d6b('0x17')](config['redis'],{'host':_0x2d6b('0x18'),'port':0x18eb});var socket=require(_0x2d6b('0x19'))(new Redis(config[_0x2d6b('0x16')]));require('./smsAccount.socket')[_0x2d6b('0x1a')](socket);var jayson=require(_0x2d6b('0x1b'));var client=jayson[_0x2d6b('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4b094d,_0x45e29c,_0x20d230,_0x53c235){return new BPromise(function(_0x570e45,_0x49f943){var _0x3cd3fe=_0x53c235||client;return _0x3cd3fe['request'](_0x4b094d,_0x20d230)[_0x2d6b('0x1d')](function(_0x2dc14c){logger[_0x2d6b('0x1e')](_0x2d6b('0x1f'),_0x45e29c,_0x2d6b('0x20'));logger[_0x2d6b('0x21')](_0x2d6b('0x22'),_0x45e29c,_0x2d6b('0x20'),JSON[_0x2d6b('0x23')](_0x2dc14c));if(_0x2dc14c[_0x2d6b('0x24')]){if(_0x2dc14c[_0x2d6b('0x24')][_0x2d6b('0x25')]===0x1f4){logger[_0x2d6b('0x24')](_0x2d6b('0x1f'),_0x45e29c,_0x2dc14c[_0x2d6b('0x24')]['message']);return _0x49f943(_0x2dc14c['error'][_0x2d6b('0x26')]);}logger['error'](_0x2d6b('0x1f'),_0x45e29c,_0x2dc14c[_0x2d6b('0x24')][_0x2d6b('0x26')]);return _0x570e45(_0x2dc14c[_0x2d6b('0x24')]['message']);}else{logger[_0x2d6b('0x1e')](_0x2d6b('0x1f'),_0x45e29c,_0x2d6b('0x20'));_0x570e45(_0x2dc14c[_0x2d6b('0x27')]['message']);}})[_0x2d6b('0x28')](function(_0x4bf808){logger['error'](_0x2d6b('0x1f'),_0x45e29c,_0x4bf808);_0x49f943(_0x4bf808);});});}function respondWithStatusCode(_0x41f332,_0x24cda7){_0x24cda7=_0x24cda7||0xcc;return function(_0x2e2a04){if(_0x2e2a04){return _0x41f332['sendStatus'](_0x24cda7);}return _0x41f332[_0x2d6b('0x29')](_0x24cda7)[_0x2d6b('0x2a')]();};}function respondWithResult(_0x21df4f,_0x2daba0){_0x2daba0=_0x2daba0||0xc8;return function(_0x22f3c3){if(_0x22f3c3){return _0x21df4f[_0x2d6b('0x29')](_0x2daba0)[_0x2d6b('0x2b')](_0x22f3c3);}};}function respondWithFilteredResult(_0x457ea2,_0x2fb94a){return function(_0x5774bd){if(_0x5774bd){var _0x522d90=typeof _0x2fb94a[_0x2d6b('0x2c')]===_0x2d6b('0x2d')&&typeof _0x2fb94a[_0x2d6b('0x2e')]===_0x2d6b('0x2d');var _0x1375cc=_0x5774bd[_0x2d6b('0x2f')];var _0x5e6498=_0x522d90?0x0:_0x2fb94a[_0x2d6b('0x2c')];var _0x18c9ec=_0x522d90?_0x5774bd[_0x2d6b('0x2f')]:_0x2fb94a['offset']+_0x2fb94a['limit'];var _0x56094f;if(_0x18c9ec>=_0x1375cc){_0x18c9ec=_0x1375cc;_0x56094f=0xc8;}else{_0x56094f=0xce;}_0x457ea2[_0x2d6b('0x29')](_0x56094f);return _0x457ea2['set'](_0x2d6b('0x30'),_0x5e6498+'-'+_0x18c9ec+'/'+_0x1375cc)['json'](_0x5774bd);}return null;};}function patchUpdates(_0xc5846a){return function(_0x27cb68){try{jsonpatch[_0x2d6b('0x31')](_0x27cb68,_0xc5846a,!![]);}catch(_0x54bc23){return BPromise[_0x2d6b('0x32')](_0x54bc23);}return _0x27cb68[_0x2d6b('0x33')]();};}function saveUpdates(_0x152ee3,_0x37564e){return function(_0x58ae25){if(_0x58ae25){return _0x58ae25['update'](_0x152ee3)[_0x2d6b('0x1d')](function(_0x4a4774){return _0x4a4774;});}return null;};}function removeEntity(_0xa491c4,_0x336942){return function(_0x42c17c){if(_0x42c17c){return _0x42c17c[_0x2d6b('0x34')]()[_0x2d6b('0x1d')](function(){var _0x135929=_0x42c17c[_0x2d6b('0x35')]({'plain':!![]});var _0x51f12b=_0x2d6b('0x36');return db[_0x2d6b('0x37')][_0x2d6b('0x34')]({'where':{'type':_0x51f12b,'resourceId':_0x135929['id']}})[_0x2d6b('0x1d')](function(){return _0x42c17c;});})[_0x2d6b('0x1d')](function(){_0xa491c4['status'](0xcc)[_0x2d6b('0x2a')]();});}};}function handleEntityNotFound(_0x126e54,_0x9bf3ac){return function(_0x11c41b){if(!_0x11c41b){_0x126e54[_0x2d6b('0x38')](0x194);}return _0x11c41b;};}function handleError(_0x19b94b,_0x568c6d){_0x568c6d=_0x568c6d||0x1f4;return function(_0x19d77a){logger[_0x2d6b('0x24')](_0x19d77a['stack']);if(_0x19d77a[_0x2d6b('0x39')]){delete _0x19d77a[_0x2d6b('0x39')];}_0x19b94b[_0x2d6b('0x29')](_0x568c6d)[_0x2d6b('0x3a')](_0x19d77a);};}exports[_0x2d6b('0x3b')]=function(_0x278c64,_0x1563fe){var _0x508627={'include':[{'model':db[_0x2d6b('0x3c')],'as':_0x2d6b('0x3d')}]},_0x84e8a={},_0x192f34={'count':0x0,'rows':[]};var _0x229fe3=_[_0x2d6b('0x3e')](db[_0x2d6b('0x3f')][_0x2d6b('0x40')],function(_0x1adb60){return{'name':_0x1adb60['fieldName'],'type':_0x1adb60[_0x2d6b('0x41')][_0x2d6b('0x42')]};});_0x84e8a[_0x2d6b('0x43')]=_[_0x2d6b('0x3e')](_0x229fe3,'name');_0x84e8a[_0x2d6b('0x44')]=_[_0x2d6b('0x45')](_0x278c64[_0x2d6b('0x44')]);_0x84e8a[_0x2d6b('0x46')]=_[_0x2d6b('0x47')](_0x84e8a[_0x2d6b('0x43')],_0x84e8a[_0x2d6b('0x44')]);_0x508627['attributes']=_[_0x2d6b('0x47')](_0x84e8a[_0x2d6b('0x43')],qs['fields'](_0x278c64[_0x2d6b('0x44')]['fields']));_0x508627[_0x2d6b('0x48')]=_0x508627[_0x2d6b('0x48')][_0x2d6b('0x49')]?_0x508627[_0x2d6b('0x48')]:_0x84e8a['model'];if(!_0x278c64['query'][_0x2d6b('0x4a')]('nolimit')){_0x508627['limit']=qs[_0x2d6b('0x2e')](_0x278c64['query'][_0x2d6b('0x2e')]);_0x508627[_0x2d6b('0x2c')]=qs[_0x2d6b('0x2c')](_0x278c64[_0x2d6b('0x44')]['offset']);}_0x508627['order']=qs[_0x2d6b('0x4b')](_0x278c64[_0x2d6b('0x44')][_0x2d6b('0x4b')]);_0x508627[_0x2d6b('0x4c')]=qs[_0x2d6b('0x46')](_['pick'](_0x278c64[_0x2d6b('0x44')],_0x84e8a[_0x2d6b('0x46')]),_0x229fe3);if(_0x278c64['query'][_0x2d6b('0x4d')]){_0x508627[_0x2d6b('0x4c')]=_[_0x2d6b('0x4e')](_0x508627[_0x2d6b('0x4c')],{'$or':_[_0x2d6b('0x3e')](_0x229fe3,function(_0x25efd2){if(_0x25efd2[_0x2d6b('0x41')]!==_0x2d6b('0x4f')){var _0x4d7a5f={};_0x4d7a5f[_0x25efd2[_0x2d6b('0x39')]]={'$like':'%'+_0x278c64[_0x2d6b('0x44')][_0x2d6b('0x4d')]+'%'};return _0x4d7a5f;}})});}_0x508627=_[_0x2d6b('0x4e')]({},_0x508627,_0x278c64[_0x2d6b('0x50')]);var _0x3c7dc0={'where':_0x508627[_0x2d6b('0x4c')]};return db[_0x2d6b('0x3f')][_0x2d6b('0x2f')](_0x3c7dc0)[_0x2d6b('0x1d')](function(_0x16fdd9){_0x192f34[_0x2d6b('0x2f')]=_0x16fdd9;if(_0x278c64[_0x2d6b('0x44')][_0x2d6b('0x51')]){_0x508627[_0x2d6b('0x52')]=[{'all':!![]}];}return db[_0x2d6b('0x3f')][_0x2d6b('0x53')](_0x508627);})['then'](function(_0xc0b16f){_0x192f34[_0x2d6b('0x54')]=_0xc0b16f;return _0x192f34;})[_0x2d6b('0x1d')](respondWithFilteredResult(_0x1563fe,_0x508627))['catch'](handleError(_0x1563fe,null));};exports[_0x2d6b('0x55')]=function(_0x34fb09,_0x2daa40){var _0x5e4092={'raw':![],'where':{'id':_0x34fb09[_0x2d6b('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x2d6b('0x3d')}]},_0x15836e={};_0x15836e[_0x2d6b('0x43')]=_[_0x2d6b('0x45')](db[_0x2d6b('0x3f')][_0x2d6b('0x40')]);_0x15836e[_0x2d6b('0x44')]=_[_0x2d6b('0x45')](_0x34fb09[_0x2d6b('0x44')]);_0x15836e[_0x2d6b('0x46')]=_['intersection'](_0x15836e[_0x2d6b('0x43')],_0x15836e['query']);_0x5e4092[_0x2d6b('0x48')]=_[_0x2d6b('0x47')](_0x15836e['model'],qs[_0x2d6b('0x57')](_0x34fb09[_0x2d6b('0x44')][_0x2d6b('0x57')]));_0x5e4092[_0x2d6b('0x48')]=_0x5e4092[_0x2d6b('0x48')][_0x2d6b('0x49')]?_0x5e4092[_0x2d6b('0x48')]:_0x15836e['model'];if(_0x34fb09['query']['includeAll']){_0x5e4092[_0x2d6b('0x52')]=[{'all':!![]}];}_0x5e4092=_[_0x2d6b('0x4e')]({},_0x5e4092,_0x34fb09['options']);return db[_0x2d6b('0x3f')][_0x2d6b('0x58')](_0x5e4092)[_0x2d6b('0x1d')](handleEntityNotFound(_0x2daa40,null))[_0x2d6b('0x1d')](respondWithResult(_0x2daa40,null))['catch'](handleError(_0x2daa40,null));};exports['create']=function(_0x411615,_0x109426){return db['SmsAccount'][_0x2d6b('0x59')](_0x411615[_0x2d6b('0x5a')],{})['then'](function(_0x2d07b4){var _0x2d4b58=_0x411615[_0x2d6b('0x5b')][_0x2d6b('0x35')]({'plain':!![]});if(!_0x2d4b58)throw new Error(_0x2d6b('0x5c'));if(_0x2d4b58[_0x2d6b('0x5d')]===_0x2d6b('0x5b')){var _0x5d88a2=_0x2d07b4[_0x2d6b('0x35')]({'plain':!![]});var _0xde2476=_0x2d6b('0x36');return db[_0x2d6b('0x5e')][_0x2d6b('0x58')]({'where':{'name':_0xde2476,'userProfileId':_0x2d4b58[_0x2d6b('0x5f')]},'raw':!![]})[_0x2d6b('0x1d')](function(_0x19d40e){if(_0x19d40e&&_0x19d40e[_0x2d6b('0x60')]===0x0){return db[_0x2d6b('0x37')]['create']({'name':_0x5d88a2['name'],'resourceId':_0x5d88a2['id'],'type':_0x19d40e[_0x2d6b('0x39')],'sectionId':_0x19d40e['id']},{})['then'](function(){return _0x2d07b4;});}else{return _0x2d07b4;}})[_0x2d6b('0x28')](function(_0x2ab3cb){logger[_0x2d6b('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ab3cb);throw _0x2ab3cb;});}return _0x2d07b4;})[_0x2d6b('0x1d')](respondWithResult(_0x109426,0xc9))[_0x2d6b('0x28')](handleError(_0x109426,null));};exports[_0x2d6b('0x61')]=function(_0x9408c5,_0x53d1f2){if(_0x9408c5[_0x2d6b('0x5a')]['id']){delete _0x9408c5[_0x2d6b('0x5a')]['id'];}return db[_0x2d6b('0x3f')]['find']({'where':{'id':_0x9408c5[_0x2d6b('0x56')]['id']},'include':[{'model':db[_0x2d6b('0x3c')],'as':_0x2d6b('0x3d')}]})[_0x2d6b('0x1d')](handleEntityNotFound(_0x53d1f2,null))[_0x2d6b('0x1d')](saveUpdates(_0x9408c5[_0x2d6b('0x5a')],null))['then'](respondWithResult(_0x53d1f2,null))[_0x2d6b('0x28')](handleError(_0x53d1f2,null));};exports[_0x2d6b('0x34')]=function(_0x30f14a,_0xce5417){return db['SmsAccount'][_0x2d6b('0x58')]({'where':{'id':_0x30f14a['params']['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0xce5417,null))[_0x2d6b('0x1d')](removeEntity(_0xce5417,null))[_0x2d6b('0x28')](handleError(_0xce5417,null));};exports[_0x2d6b('0x62')]=function(_0x3b58ca,_0x2850c6){return db[_0x2d6b('0x3f')][_0x2d6b('0x62')]()[_0x2d6b('0x1d')](respondWithResult(_0x2850c6,null))[_0x2d6b('0x28')](handleError(_0x2850c6,null));};exports['addDisposition']=function(_0x24b1bb,_0x1c29a4,_0x5b8822){if(_0x24b1bb[_0x2d6b('0x5a')]['id']){delete _0x24b1bb[_0x2d6b('0x5a')]['id'];}return db['SmsAccount'][_0x2d6b('0x58')]({'where':{'id':_0x24b1bb[_0x2d6b('0x56')]['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x1c29a4,null))[_0x2d6b('0x1d')](function(_0x135af5){if(_0x135af5){_0x24b1bb['body'][_0x2d6b('0x63')]=_0x135af5['id'];return db[_0x2d6b('0x64')]['create'](_0x24b1bb[_0x2d6b('0x5a')]);}})[_0x2d6b('0x1d')](respondWithResult(_0x1c29a4,null))[_0x2d6b('0x28')](handleError(_0x1c29a4,null));};exports[_0x2d6b('0x65')]=function(_0x2c88f9,_0x8d10f5,_0x254246){var _0x20cb62={'raw':![],'where':{}};var _0x193ae0={};var _0x1048ac={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2c88f9[_0x2d6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x8d10f5,null))[_0x2d6b('0x1d')](function(_0x27585d){if(_0x27585d){_0x193ae0[_0x2d6b('0x43')]=_[_0x2d6b('0x45')](db[_0x2d6b('0x64')][_0x2d6b('0x40')]);_0x193ae0[_0x2d6b('0x44')]=_[_0x2d6b('0x45')](_0x2c88f9[_0x2d6b('0x44')]);_0x193ae0[_0x2d6b('0x46')]=_[_0x2d6b('0x47')](_0x193ae0[_0x2d6b('0x43')],_0x193ae0[_0x2d6b('0x44')]);_0x20cb62[_0x2d6b('0x48')]=_[_0x2d6b('0x47')](_0x193ae0['model'],qs[_0x2d6b('0x57')](_0x2c88f9[_0x2d6b('0x44')][_0x2d6b('0x57')]));_0x20cb62[_0x2d6b('0x48')]=_0x20cb62[_0x2d6b('0x48')][_0x2d6b('0x49')]?_0x20cb62['attributes']:_0x193ae0[_0x2d6b('0x43')];if(!_0x2c88f9[_0x2d6b('0x44')][_0x2d6b('0x4a')](_0x2d6b('0x66'))){_0x20cb62[_0x2d6b('0x2e')]=qs[_0x2d6b('0x2e')](_0x2c88f9[_0x2d6b('0x44')][_0x2d6b('0x2e')]);_0x20cb62['offset']=qs[_0x2d6b('0x2c')](_0x2c88f9['query'][_0x2d6b('0x2c')]);}_0x20cb62[_0x2d6b('0x67')]=qs[_0x2d6b('0x4b')](_0x2c88f9[_0x2d6b('0x44')][_0x2d6b('0x4b')]);_0x20cb62[_0x2d6b('0x4c')]=qs['filters'](_[_0x2d6b('0x68')](_0x2c88f9[_0x2d6b('0x44')],_0x193ae0[_0x2d6b('0x46')]));_0x20cb62['where'][_0x2d6b('0x63')]=_0x27585d['id'];if(_0x2c88f9[_0x2d6b('0x44')][_0x2d6b('0x4d')]){_0x20cb62['where']=_[_0x2d6b('0x4e')](_0x20cb62[_0x2d6b('0x4c')],{'$or':_['map'](_0x20cb62[_0x2d6b('0x48')],function(_0x1a75d5){var _0x281c9d={};_0x281c9d[_0x1a75d5]={'$like':'%'+_0x2c88f9['query'][_0x2d6b('0x4d')]+'%'};return _0x281c9d;})});}_0x20cb62=_[_0x2d6b('0x4e')]({},_0x20cb62,_0x2c88f9[_0x2d6b('0x50')]);return db[_0x2d6b('0x64')]['count']({'where':_0x20cb62[_0x2d6b('0x4c')]})[_0x2d6b('0x1d')](function(_0x485abf){_0x1048ac[_0x2d6b('0x2f')]=_0x485abf;if(_0x2c88f9['query']['includeAll']){_0x20cb62['include']=[{'all':!![]}];}return db[_0x2d6b('0x64')][_0x2d6b('0x53')](_0x20cb62);})[_0x2d6b('0x1d')](function(_0x3d7de5){_0x1048ac['rows']=_0x3d7de5;return _0x1048ac;});}})[_0x2d6b('0x1d')](respondWithFilteredResult(_0x8d10f5,_0x20cb62))['catch'](handleError(_0x8d10f5,null));};exports[_0x2d6b('0x69')]=function(_0x5f4ddf,_0x106b50,_0x440db7){return db[_0x2d6b('0x3f')][_0x2d6b('0x58')]({'where':{'id':_0x5f4ddf[_0x2d6b('0x56')]['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x106b50,null))[_0x2d6b('0x1d')](function(_0x51ec84){if(_0x51ec84){return _0x51ec84[_0x2d6b('0x69')](_0x5f4ddf['query'][_0x2d6b('0x6a')]);}})[_0x2d6b('0x1d')](respondWithStatusCode(_0x106b50,null))[_0x2d6b('0x28')](handleError(_0x106b50,null));};exports[_0x2d6b('0x6b')]=function(_0x6c9b05,_0x455a2e,_0x136470){if(_0x6c9b05['body']['id']){delete _0x6c9b05[_0x2d6b('0x5a')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x6c9b05[_0x2d6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x455a2e,null))[_0x2d6b('0x1d')](function(_0x2493f3){if(_0x2493f3){_0x6c9b05[_0x2d6b('0x5a')]['SmsAccountId']=_0x2493f3['id'];return db['CannedAnswer'][_0x2d6b('0x59')](_0x6c9b05[_0x2d6b('0x5a')]);}})[_0x2d6b('0x1d')](respondWithResult(_0x455a2e,null))[_0x2d6b('0x28')](handleError(_0x455a2e,null));};exports[_0x2d6b('0x6c')]=function(_0x4aaa89,_0x2ab275,_0x5871b7){var _0xecf4bf={'raw':![],'where':{}};var _0x178d48={};var _0x251d9b={'count':0x0,'rows':[]};return db[_0x2d6b('0x3f')][_0x2d6b('0x6d')]({'where':{'id':_0x4aaa89['params']['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x2ab275,null))[_0x2d6b('0x1d')](function(_0x1e6d58){if(_0x1e6d58){_0x178d48[_0x2d6b('0x43')]=_[_0x2d6b('0x45')](db[_0x2d6b('0x6e')][_0x2d6b('0x40')]);_0x178d48[_0x2d6b('0x44')]=_[_0x2d6b('0x45')](_0x4aaa89['query']);_0x178d48[_0x2d6b('0x46')]=_['intersection'](_0x178d48[_0x2d6b('0x43')],_0x178d48[_0x2d6b('0x44')]);_0xecf4bf[_0x2d6b('0x48')]=_['intersection'](_0x178d48[_0x2d6b('0x43')],qs[_0x2d6b('0x57')](_0x4aaa89[_0x2d6b('0x44')][_0x2d6b('0x57')]));_0xecf4bf['attributes']=_0xecf4bf[_0x2d6b('0x48')][_0x2d6b('0x49')]?_0xecf4bf[_0x2d6b('0x48')]:_0x178d48[_0x2d6b('0x43')];if(!_0x4aaa89[_0x2d6b('0x44')][_0x2d6b('0x4a')](_0x2d6b('0x66'))){_0xecf4bf[_0x2d6b('0x2e')]=qs[_0x2d6b('0x2e')](_0x4aaa89[_0x2d6b('0x44')]['limit']);_0xecf4bf[_0x2d6b('0x2c')]=qs[_0x2d6b('0x2c')](_0x4aaa89[_0x2d6b('0x44')][_0x2d6b('0x2c')]);}_0xecf4bf[_0x2d6b('0x67')]=qs[_0x2d6b('0x4b')](_0x4aaa89[_0x2d6b('0x44')][_0x2d6b('0x4b')]);_0xecf4bf[_0x2d6b('0x4c')]=qs[_0x2d6b('0x46')](_[_0x2d6b('0x68')](_0x4aaa89['query'],_0x178d48[_0x2d6b('0x46')]));_0xecf4bf[_0x2d6b('0x4c')][_0x2d6b('0x63')]=_0x1e6d58['id'];if(_0x4aaa89[_0x2d6b('0x44')][_0x2d6b('0x4d')]){_0xecf4bf['where']=_[_0x2d6b('0x4e')](_0xecf4bf[_0x2d6b('0x4c')],{'$or':_[_0x2d6b('0x3e')](_0xecf4bf[_0x2d6b('0x48')],function(_0xa6908f){var _0x436125={};_0x436125[_0xa6908f]={'$like':'%'+_0x4aaa89['query'][_0x2d6b('0x4d')]+'%'};return _0x436125;})});}_0xecf4bf=_[_0x2d6b('0x4e')]({},_0xecf4bf,_0x4aaa89['options']);return db[_0x2d6b('0x6e')]['count']({'where':_0xecf4bf[_0x2d6b('0x4c')]})[_0x2d6b('0x1d')](function(_0x23f4c2){_0x251d9b[_0x2d6b('0x2f')]=_0x23f4c2;if(_0x4aaa89['query'][_0x2d6b('0x51')]){_0xecf4bf[_0x2d6b('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2d6b('0x53')](_0xecf4bf);})['then'](function(_0x109116){_0x251d9b[_0x2d6b('0x54')]=_0x109116;return _0x251d9b;});}})[_0x2d6b('0x1d')](respondWithFilteredResult(_0x2ab275,_0xecf4bf))[_0x2d6b('0x28')](handleError(_0x2ab275,null));};exports['removeAnswers']=function(_0x540ceb,_0x14dbb6,_0x15b81c){return db['SmsAccount'][_0x2d6b('0x58')]({'where':{'id':_0x540ceb['params']['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x14dbb6,null))[_0x2d6b('0x1d')](function(_0xc94715){if(_0xc94715){return _0xc94715[_0x2d6b('0x6f')](_0x540ceb['query'][_0x2d6b('0x6a')]);}})[_0x2d6b('0x1d')](respondWithStatusCode(_0x14dbb6,null))[_0x2d6b('0x28')](handleError(_0x14dbb6,null));};exports[_0x2d6b('0x70')]=function(_0x2d6083,_0x596716,_0x41e6bb){var _0x3872f4={'channel':'sms'};var _0xf76de5=[];var _0x4f0a15=[];var _0x2258ac={};return db['SmsAccount']['find']({'where':{'id':_0x2d6083[_0x2d6b('0x56')]['id']},'include':[{'model':db[_0x2d6b('0x71')],'as':_0x2d6b('0x72')}]})[_0x2d6b('0x1d')](handleEntityNotFound(_0x596716,null))[_0x2d6b('0x1d')](function(_0x19c247){_0x3872f4[_0x2d6b('0x73')]=_0x19c247;_0x3872f4[_0x2d6b('0x74')]=_[_0x2d6b('0x75')](_0x19c247[_0x2d6b('0x72')],['priority'],['asc']);if(_0x3872f4[_0x2d6b('0x73')][_0x2d6b('0x72')]){delete _0x3872f4['account']['Applications'];}return db[_0x2d6b('0x76')][_0x2d6b('0x62')]();})[_0x2d6b('0x1d')](function(_0x157d9b){if(!_0x157d9b){throw new db[(_0x2d6b('0x77'))][(_0x2d6b('0x78'))](_0x2d6b('0x79'));}_0xf76de5=_[_0x2d6b('0x7a')](_[_0x2d6b('0x45')](_0x157d9b),[_0x2d6b('0x7b'),'updatedAt']);_0x4f0a15=_[_0x2d6b('0x7a')](_[_0x2d6b('0x45')](_0x157d9b),[_0x2d6b('0x7b'),'updatedAt','CompanyId',_0x2d6b('0x7c')]);_0x3872f4[_0x2d6b('0x5a')]={'mapKey':_0x2d6b('0x7d')};if(_0x3872f4['account'][_0x2d6b('0x41')]){switch(_0x3872f4[_0x2d6b('0x73')][_0x2d6b('0x41')]){case _0x2d6b('0x7e'):_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x80')];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083['body'][_0x2d6b('0x81')];_0x3872f4['body'][_0x2d6b('0x82')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x83')];break;case'skebby':_0x3872f4['body'][_0x2d6b('0x7f')]='+'+_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x84')];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083[_0x2d6b('0x5a')]['text'];break;case _0x2d6b('0x85'):_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x7f')];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083['body'][_0x2d6b('0x26')];break;case _0x2d6b('0x86'):_0x3872f4['body'][_0x2d6b('0x7f')]=_0x2d6083[_0x2d6b('0x5a')]['from'];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x5a')];_0x3872f4[_0x2d6b('0x5a')]['messageId']=_0x2d6083['body'][_0x2d6b('0x87')];break;case _0x2d6b('0x88'):_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x80')];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x89')];_0x3872f4[_0x2d6b('0x5a')]['messageId']=_0x2d6083['body'][_0x2d6b('0x8a')];break;case'infobip':_0x3872f4['body']['from']='+'+_0x2d6083[_0x2d6b('0x5a')]['results'][0x0][_0x2d6b('0x7f')];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x8b')][0x0][_0x2d6b('0x8c')];_0x3872f4['body'][_0x2d6b('0x82')]=_0x2d6083[_0x2d6b('0x5a')]['results'][0x0][_0x2d6b('0x82')];break;case'csc':_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x8d')];_0x3872f4['body'][_0x2d6b('0x5a')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x8e')][_0x2d6b('0x26')];break;case'clickatell':_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x8f')];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083[_0x2d6b('0x5a')]['text'];_0x3872f4[_0x2d6b('0x5a')]['messageId']=_0x2d6083['body'][_0x2d6b('0x90')];break;case _0x2d6b('0x91'):_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x82')]=_0x2d6083['body'][0x0][_0x2d6b('0x26')]['id'];_0x3872f4[_0x2d6b('0x5a')]['from']=_0x2d6083[_0x2d6b('0x5a')][0x0][_0x2d6b('0x26')][_0x2d6b('0x7f')];_0x3872f4[_0x2d6b('0x5a')]['body']=_0x2d6083['body'][0x0][_0x2d6b('0x26')]['text'];break;case _0x2d6b('0x92'):_0x3872f4[_0x2d6b('0x5a')]['from']=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x7f')];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')]=_0x2d6083['body']['message'];_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x82')]=_0x2d6083[_0x2d6b('0x5a')][_0x2d6b('0x93')];break;}}if(_0x3872f4[_0x2d6b('0x5a')]['id']){delete _0x3872f4[_0x2d6b('0x5a')]['id'];}if(_[_0x2d6b('0x94')](_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')])){throw new db[(_0x2d6b('0x77'))][(_0x2d6b('0x78'))](_0x2d6b('0x95'));}if(_['isNil'](_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')])||_0x3872f4['body'][_0x2d6b('0x5a')]===''){throw new db[(_0x2d6b('0x77'))]['ValidationError'](_0x2d6b('0x96'));}if(_[_0x2d6b('0x94')](_0x3872f4[_0x2d6b('0x5a')]['mapKey'])){throw new db[(_0x2d6b('0x77'))][(_0x2d6b('0x78'))](_0x2d6b('0x97')+_0x4f0a15);}if(!_[_0x2d6b('0x98')](_0x4f0a15,_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x99')])){throw new db['Sequelize'][(_0x2d6b('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f0a15);}_0x2258ac[_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x99')]]=_0x3872f4[_0x2d6b('0x5a')]['from'];return db['CmList'][_0x2d6b('0x58')]({'where':{'id':_0x3872f4[_0x2d6b('0x73')][_0x2d6b('0x7c')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2258ac,'limit':0x1,'order':[[_0x2d6b('0x9a'),_0x2d6b('0x9b')]]}]});})[_0x2d6b('0x1d')](handleEntityNotFound(_0x596716,null))[_0x2d6b('0x1d')](function(_0x26b69e){if(_0x26b69e){_0x3872f4[_0x2d6b('0x9c')]=_[_0x2d6b('0x9d')](_0x26b69e,[_0x2d6b('0x9e')]);if(_0x26b69e[_0x2d6b('0x9e')]['length']){return _0x26b69e[_0x2d6b('0x9e')][0x0];}var _0x1690ce=_[_0x2d6b('0x17')](_0x3872f4[_0x2d6b('0x5a')],{'firstName':_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')],'ListId':_0x26b69e['id']});_0x1690ce[_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x99')]]=_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')];return db['CmContact'][_0x2d6b('0x59')](_0x1690ce,{'fields':_0xf76de5,'raw':!![]});}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x596716,null))['then'](function(_0x3540b1){if(_0x3540b1){_0x3872f4['contact']=_0x3540b1;var _0x576ce0={'ContactId':_0x3540b1['id'],'phone':_0x3872f4['body'][_0x2d6b('0x7f')],'SmsAccountId':_0x2d6083[_0x2d6b('0x56')]['id']};var _0x33358e={'ContactId':_0x3540b1['id'],'SmsAccountId':_0x2d6083['params']['id'],'closed':![]};return db[_0x2d6b('0x9f')][_0x2d6b('0x58')]({'where':_0x33358e})[_0x2d6b('0x1d')](function(_0x286ab4){if(_0x286ab4){return[_0x286ab4,![]];}return db[_0x2d6b('0x9f')][_0x2d6b('0x59')](_0x576ce0)['then'](function(_0x1e1299){return[_0x1e1299,!![]];});});}})[_0x2d6b('0xa0')](function(_0x272693,_0x46bf94){_0x3872f4[_0x2d6b('0xa1')]=_0x272693['get']({'plain':!![]});_0x3872f4['interaction']['created']=![];if(_0x46bf94){if(_0x3872f4[_0x2d6b('0x73')][_0x2d6b('0xa2')]){_0x3872f4[_0x2d6b('0x74')][_0x2d6b('0xa3')]({'id':0x0,'priority':_0x3872f4[_0x2d6b('0x74')]['length']+0x1,'app':_0x2d6b('0xa4'),'appdata':'unmanaged','interval':_0x2d6b('0xa5')});}_0x3872f4['interaction'][_0x2d6b('0xa6')]=!![];}return db['SmsMessage'][_0x2d6b('0x59')]({'phone':_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x7f')],'messageId':_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x82')],'body':_0x3872f4[_0x2d6b('0x5a')][_0x2d6b('0x5a')],'SmsAccountId':_0x2d6083[_0x2d6b('0x56')]['id'],'SmsInteractionId':_0x272693['id'],'direction':'in','ContactId':_0x272693[_0x2d6b('0xa7')],'AttachmentId':_0x3872f4[_0x2d6b('0x5a')]['AttachmentId']});})['then'](function(_0x5f13f8){_0x3872f4[_0x2d6b('0x26')]=_0x5f13f8;if(_0x3872f4[_0x2d6b('0xa1')][_0x2d6b('0xa8')]){return db[_0x2d6b('0xa9')][_0x2d6b('0x58')]({'attributes':['id',_0x2d6b('0x39')],'where':{'id':_0x3872f4[_0x2d6b('0xa1')][_0x2d6b('0xa8')]}})[_0x2d6b('0x1d')](function(_0x3961f1){if(_0x3961f1){_0x3872f4[_0x2d6b('0x74')][_0x2d6b('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3961f1[_0x2d6b('0x39')]+','+(_0x3872f4['account'][_0x2d6b('0xab')]||0xa),'interval':_0x2d6b('0xa5')});}return respondWithRpcPromise(_0x2d6b('0xac'),_0x2d6b('0xad'),_0x3872f4);});}return respondWithRpcPromise('Start',_0x2d6b('0xad'),_0x3872f4);})[_0x2d6b('0x1d')](function(_0x1f60c7){if(_0x1f60c7){var _0x248362=0xc8;var _0x4cf811=_0x2d6b('0xae');logger[_0x2d6b('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4cf811,_0x248362,_0x2d6b('0xaf'));logger['debug'](_0x2d6b('0xb0'),_0x4cf811,_0x248362,'entity\x20found',JSON[_0x2d6b('0x23')](_0x1f60c7));if(_0x3872f4['account']['type']==='twilio'){return _0x596716[_0x2d6b('0x29')](_0x248362)[_0x2d6b('0xb1')]('Content-Type',_0x2d6b('0xb2'))[_0x2d6b('0x3a')](_0x2d6b('0xb3'));}else{return _0x596716[_0x2d6b('0x29')](_0x248362)[_0x2d6b('0x2b')](_0x1f60c7);}}})['catch'](handleError(_0x596716,null));};exports[_0x2d6b('0xb4')]=function(_0x250968,_0x4d537a){var _0x25c139=_0x250968['params']['id'];var _0x439493=_0x250968[_0x2d6b('0x5a')];var _0x2c3deb=0xc8;var _0x2d6a79=null;return db[_0x2d6b('0xb5')]['transaction']({'isolationLevel':db[_0x2d6b('0xb5')][_0x2d6b('0xb6')][_0x2d6b('0xb7')]['READ_COMMITTED']},function(_0x52c86f){return db[_0x2d6b('0x3f')][_0x2d6b('0x6d')]({'where':{'id':_0x25c139},'transaction':_0x52c86f})[_0x2d6b('0x1d')](function(_0x354f7e){if(_0x354f7e){return db[_0x2d6b('0x71')][_0x2d6b('0x34')]({'where':{'SmsAccountId':_0x25c139},'transaction':_0x52c86f})[_0x2d6b('0x1d')](function(){var _0x1fd791=_[_0x2d6b('0x3e')](_0x439493,function(_0x1b3ed1){_0x1b3ed1[_0x2d6b('0x63')]=_0x25c139;return _0x1b3ed1;});return db[_0x2d6b('0x71')]['bulkCreate'](_0x1fd791,{'transaction':_0x52c86f});});}else{_0x2c3deb=0x194;_0x2d6a79=[];}});})[_0x2d6b('0x1d')](function(){if(_0x2c3deb!==0x194){return db[_0x2d6b('0x71')][_0x2d6b('0xb8')]({'where':{'SmsAccountId':_0x25c139},'order':_0x2d6b('0xb9')})['then'](function(_0x1cd3e0){_0x2d6a79=_0x1cd3e0;});}})[_0x2d6b('0x28')](function(_0x35d741){_0x2c3deb=0x1f4;logger[_0x2d6b('0x24')](_0x35d741[_0x2d6b('0xba')]);if(_0x35d741[_0x2d6b('0x39')]){delete _0x35d741[_0x2d6b('0x39')];}_0x2d6a79=_0x35d741;})[_0x2d6b('0xbb')](function(){if(_0x2d6a79===null){_0x4d537a[_0x2d6b('0x38')](_0x2c3deb);}else{if(_0x2c3deb===0x1f4){_0x4d537a[_0x2d6b('0x29')](_0x2c3deb)[_0x2d6b('0x3a')](_0x2d6a79);}else{_0x4d537a[_0x2d6b('0x29')](_0x2c3deb)[_0x2d6b('0x2b')](_0x2d6a79);}}});};exports[_0x2d6b('0xbc')]=function(_0x28627c,_0x36b4ec,_0x5b30aa){var _0x126869={};var _0xf719cd={};var _0x51b5a9;var _0x3f9cb8;return db[_0x2d6b('0x3f')]['findOne']({'where':{'id':_0x28627c[_0x2d6b('0x56')]['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x36b4ec,null))['then'](function(_0x4c604f){if(_0x4c604f){_0x51b5a9=_0x4c604f;_0xf719cd[_0x2d6b('0x43')]=_[_0x2d6b('0x45')](db[_0x2d6b('0x71')][_0x2d6b('0x40')]);_0xf719cd['query']=_[_0x2d6b('0x45')](_0x28627c['query']);_0xf719cd['filters']=_[_0x2d6b('0x47')](_0xf719cd[_0x2d6b('0x43')],_0xf719cd[_0x2d6b('0x44')]);_0x126869[_0x2d6b('0x48')]=_[_0x2d6b('0x47')](_0xf719cd[_0x2d6b('0x43')],qs[_0x2d6b('0x57')](_0x28627c[_0x2d6b('0x44')]['fields']));_0x126869[_0x2d6b('0x48')]=_0x126869[_0x2d6b('0x48')][_0x2d6b('0x49')]?_0x126869['attributes']:_0xf719cd[_0x2d6b('0x43')];_0x126869[_0x2d6b('0x67')]=qs[_0x2d6b('0x4b')](_0x28627c[_0x2d6b('0x44')][_0x2d6b('0x4b')]);_0x126869[_0x2d6b('0x4c')]=qs[_0x2d6b('0x46')](_['pick'](_0x28627c[_0x2d6b('0x44')],_0xf719cd[_0x2d6b('0x46')]));if(_0x28627c[_0x2d6b('0x44')][_0x2d6b('0x4d')]){_0x126869['where']=_[_0x2d6b('0x4e')](_0x126869[_0x2d6b('0x4c')],{'$or':_[_0x2d6b('0x3e')](_0x126869['attributes'],function(_0x243c54){var _0x2ebf92={};_0x2ebf92[_0x243c54]={'$like':'%'+_0x28627c[_0x2d6b('0x44')][_0x2d6b('0x4d')]+'%'};return _0x2ebf92;})});}_0x126869=_[_0x2d6b('0x4e')]({},_0x126869,_0x28627c[_0x2d6b('0x50')]);return _0x51b5a9[_0x2d6b('0xbc')](_0x126869);}})[_0x2d6b('0x1d')](function(_0x2453b8){if(_0x2453b8){_0x3f9cb8=_0x2453b8['length'];if(!_0x28627c[_0x2d6b('0x44')][_0x2d6b('0x4a')]('nolimit')){_0x126869[_0x2d6b('0x2e')]=qs[_0x2d6b('0x2e')](_0x28627c[_0x2d6b('0x44')][_0x2d6b('0x2e')]);_0x126869[_0x2d6b('0x2c')]=qs[_0x2d6b('0x2c')](_0x28627c['query'][_0x2d6b('0x2c')]);}return _0x51b5a9['getApplications'](_0x126869);}})[_0x2d6b('0x1d')](function(_0xbc359e){if(_0xbc359e){return _0xbc359e?{'count':_0x3f9cb8,'rows':_0xbc359e}:null;}})[_0x2d6b('0x1d')](respondWithResult(_0x36b4ec,null))[_0x2d6b('0x28')](handleError(_0x36b4ec,null));};exports[_0x2d6b('0xbd')]=function(_0x4fb596,_0x13612a,_0x3fa0f1){var _0x4aad26={'raw':![],'where':{}};var _0x3c3b2c={};var _0x1a631c={'count':0x0,'rows':[]};return db[_0x2d6b('0x3f')][_0x2d6b('0x6d')]({'where':{'id':_0x4fb596[_0x2d6b('0x56')]['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x13612a,null))[_0x2d6b('0x1d')](function(_0x22ca71){if(_0x22ca71){_0x3c3b2c[_0x2d6b('0x43')]=_[_0x2d6b('0x45')](db[_0x2d6b('0x9f')]['rawAttributes']);_0x3c3b2c[_0x2d6b('0x44')]=_[_0x2d6b('0x45')](_0x4fb596[_0x2d6b('0x44')]);_0x3c3b2c['filters']=_['intersection'](_0x3c3b2c[_0x2d6b('0x43')],_0x3c3b2c['query']);_0x4aad26[_0x2d6b('0x48')]=_['intersection'](_0x3c3b2c[_0x2d6b('0x43')],qs[_0x2d6b('0x57')](_0x4fb596[_0x2d6b('0x44')][_0x2d6b('0x57')]));_0x4aad26['attributes']=_0x4aad26[_0x2d6b('0x48')]['length']?_0x4aad26[_0x2d6b('0x48')]:_0x3c3b2c['model'];if(!_0x4fb596[_0x2d6b('0x44')][_0x2d6b('0x4a')](_0x2d6b('0x66'))){_0x4aad26[_0x2d6b('0x2e')]=qs[_0x2d6b('0x2e')](_0x4fb596['query'][_0x2d6b('0x2e')]);_0x4aad26['offset']=qs[_0x2d6b('0x2c')](_0x4fb596['query'][_0x2d6b('0x2c')]);}_0x4aad26[_0x2d6b('0x67')]=qs['sort'](_0x4fb596['query'][_0x2d6b('0x4b')]);_0x4aad26[_0x2d6b('0x4c')]=qs[_0x2d6b('0x46')](_[_0x2d6b('0x68')](_0x4fb596[_0x2d6b('0x44')],_0x3c3b2c[_0x2d6b('0x46')]));_0x4aad26['where'][_0x2d6b('0x63')]=_0x22ca71['id'];if(_0x4fb596[_0x2d6b('0x44')]['filter']){_0x4aad26[_0x2d6b('0x4c')]=_[_0x2d6b('0x4e')](_0x4aad26[_0x2d6b('0x4c')],{'$or':_[_0x2d6b('0x3e')](_0x4aad26[_0x2d6b('0x48')],function(_0x523858){var _0x598bee={};_0x598bee[_0x523858]={'$like':'%'+_0x4fb596['query'][_0x2d6b('0x4d')]+'%'};return _0x598bee;})});}_0x4aad26=_[_0x2d6b('0x4e')]({},_0x4aad26,_0x4fb596[_0x2d6b('0x50')]);return db[_0x2d6b('0x9f')][_0x2d6b('0x2f')]({'where':_0x4aad26[_0x2d6b('0x4c')]})[_0x2d6b('0x1d')](function(_0x518171){_0x1a631c[_0x2d6b('0x2f')]=_0x518171;if(_0x4fb596[_0x2d6b('0x44')][_0x2d6b('0x51')]){_0x4aad26['include']=[{'model':db[_0x2d6b('0x76')],'as':_0x2d6b('0xbe'),'required':![]},{'model':db[_0x2d6b('0xa9')],'as':_0x2d6b('0xbf'),'attributes':['name',_0x2d6b('0xc0'),_0x2d6b('0xc1')],'required':![]},{'model':db[_0x2d6b('0xc2')],'as':_0x2d6b('0xc3'),'attributes':['id',_0x2d6b('0x39'),_0x2d6b('0xc4')],'where':_0x4fb596[_0x2d6b('0x44')]['tag']?{'id':_0x4fb596[_0x2d6b('0x44')][_0x2d6b('0xc5')]}:undefined,'required':_0x4fb596[_0x2d6b('0x44')][_0x2d6b('0xc5')]?!![]:![]}];}return db[_0x2d6b('0x9f')][_0x2d6b('0x53')](_0x4aad26);})[_0x2d6b('0x1d')](function(_0xcbf013){_0x1a631c[_0x2d6b('0x54')]=_0xcbf013;return _0x1a631c;});}})['then'](respondWithFilteredResult(_0x13612a,_0x4aad26))[_0x2d6b('0x28')](handleError(_0x13612a,null));};exports[_0x2d6b('0x3a')]=function(_0x25631e,_0x1b384f,_0x537970){var _0x337173,_0x4e2bba,_0x5607a7;if(_[_0x2d6b('0x94')](_0x25631e[_0x2d6b('0x5a')][_0x2d6b('0x5a')])||_0x25631e[_0x2d6b('0x5a')][_0x2d6b('0x5a')]===''){throw new db['Sequelize'][(_0x2d6b('0x78'))](_0x2d6b('0x96'));}if(_['isNil'](_0x25631e[_0x2d6b('0x5a')]['to'])){throw new db['Sequelize'][(_0x2d6b('0x78'))]('to\x20is\x20mandatory');}_0x337173=_0x25631e[_0x2d6b('0x5a')]['to'];return db[_0x2d6b('0x3f')]['find']({'where':{'id':_0x25631e[_0x2d6b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x2d6b('0xc6'),'include':[{'model':db['CmContact'],'as':_0x2d6b('0x9e'),'where':{'mobile':_0x337173},'limit':0x1,'order':[[_0x2d6b('0x9a'),_0x2d6b('0x9b')]]}]}]})[_0x2d6b('0x1d')](handleEntityNotFound(_0x1b384f,null))[_0x2d6b('0x1d')](function(_0x4d4476){if(_0x4d4476&&_0x4d4476[_0x2d6b('0xc6')]){_0x4e2bba=_0x4d4476['get']({'plain':!![]});if(_0x4e2bba[_0x2d6b('0xc6')]&&_0x4e2bba['List'][_0x2d6b('0x9e')][_0x2d6b('0x49')]){return _0x4e2bba['List'][_0x2d6b('0x9e')][0x0];}return db['CmContact']['create'](_[_0x2d6b('0x17')](_0x25631e[_0x2d6b('0x5a')],{'firstName':_0x337173,'mobile':_0x337173,'phone':_0x337173,'ListId':_0x4e2bba[_0x2d6b('0x7c')]}));}})['then'](handleEntityNotFound(_0x1b384f,null))[_0x2d6b('0x1d')](function(_0x101d30){if(_0x101d30){_0x5607a7=_0x101d30;return db[_0x2d6b('0x9f')][_0x2d6b('0x58')]({'where':{'ContactId':_0x5607a7['id'],'closed':![],'SmsAccountId':_0x4e2bba['id']}})[_0x2d6b('0x1d')](function(_0xa0f1ca){if(_0xa0f1ca){return[_0xa0f1ca,![]];}return db[_0x2d6b('0x9f')]['create']({'UserId':_0x25631e[_0x2d6b('0x5b')]['id'],'ContactId':_0x5607a7['id'],'SmsAccountId':_0x4e2bba['id'],'phone':_0x337173,'firstMsgDirection':'out','Messages':[_[_0x2d6b('0x4e')](_0x25631e[_0x2d6b('0x5a')],{'read':![],'body':_0x25631e['body'][_0x2d6b('0x5a')],'phone':_0x337173,'SmsAccountId':_0x4e2bba['id'],'UserId':_0x25631e[_0x2d6b('0x5b')]['id'],'ContactId':_0x5607a7['id']})]},{'include':[{'model':db[_0x2d6b('0xc7')],'as':_0x2d6b('0xc8')}]})[_0x2d6b('0x1d')](function(_0x5d9aad){return[_0x5d9aad,!![]];});});}})['spread'](function(_0x2be486,_0xeb3734){if(_0xeb3734){return _0x2be486;}return db[_0x2d6b('0xc7')][_0x2d6b('0x59')](_[_0x2d6b('0x4e')](_0x25631e['body'],{'read':![],'body':_0x25631e[_0x2d6b('0x5a')][_0x2d6b('0x5a')],'phone':_0x337173,'SmsAccountId':_0x4e2bba['id'],'SmsInteractionId':_0x2be486['id'],'UserId':_0x25631e[_0x2d6b('0x5b')]['id'],'ContactId':_0x5607a7['id']}))[_0x2d6b('0x1d')](function(_0x60a7ab){_0x2be486[_0x2d6b('0xc9')][_0x2d6b('0xc8')]=[];_0x2be486[_0x2d6b('0xc9')]['Messages'][_0x2d6b('0xa3')](_0x60a7ab[_0x2d6b('0xc9')]);return _0x2be486;});})[_0x2d6b('0x1d')](respondWithResult(_0x1b384f,null))['catch'](handleError(_0x1b384f,null));};exports[_0x2d6b('0x29')]=function(_0x5b06fb,_0x190a09,_0x47ed0c){if(_0x5b06fb['body']['id']){delete _0x5b06fb[_0x2d6b('0x5a')]['id'];}var _0x54be30,_0xecc018,_0x5537a;return db['SmsAccount']['find']({'where':{'id':_0x5b06fb[_0x2d6b('0x56')]['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x190a09,null))[_0x2d6b('0x1d')](function(_0x242214){if(_0x242214){_0x5537a=_0x242214;logger['debug'](_0x2d6b('0x22'),_0x2d6b('0x29'),_0x2d6b('0xca'),_0x242214['type'],util[_0x2d6b('0xcb')](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));switch(_0x242214['type']){case'skebby':if(_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0xcc')]&&_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0x29')]){_0xecc018=_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0x29')];return db[_0x2d6b('0xc7')]['find']({'where':{'messageId':_0x5b06fb['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x5b06fb['body']['requestid']&&_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0xcd')]){_0xecc018=_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0xcd')];return db[_0x2d6b('0xc7')][_0x2d6b('0x58')]({'where':{'messageId':_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0xce')]}});}break;case'clicksend':if(_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0x87')]&&_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0xcf')]){_0xecc018=_0x5b06fb[_0x2d6b('0x5a')]['status_code'];return db['SmsMessage'][_0x2d6b('0x58')]({'where':{'messageId':_0x5b06fb[_0x2d6b('0x5a')]['message_id']}});}break;case'infobip':var _0x8a9ae8=_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0x8b')][0x0];if(_0x8a9ae8[_0x2d6b('0x82')]&&_0x8a9ae8[_0x2d6b('0x29')][_0x2d6b('0xd0')]===_0x2d6b('0xd1')){_0xecc018=_0x8a9ae8[_0x2d6b('0x29')][_0x2d6b('0xd0')];return db[_0x2d6b('0xc7')][_0x2d6b('0x58')]({'where':{'messageId':_0x8a9ae8[_0x2d6b('0x82')]}});}break;case'clickatell':if(_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0x82')]&&_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0x29')]){_0xecc018=_0x5b06fb['body'][_0x2d6b('0x29')];return db[_0x2d6b('0xc7')][_0x2d6b('0x58')]({'where':{'messageId':_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0x82')]}});}break;case _0x2d6b('0x91'):if(_0x5b06fb['body'][0x0][_0x2d6b('0x26')]['id']){_0xecc018=_0x5b06fb[_0x2d6b('0x5a')][0x0][_0x2d6b('0x41')];return db[_0x2d6b('0xc7')][_0x2d6b('0x58')]({'where':{'messageId':_0x5b06fb[_0x2d6b('0x5a')][0x0]['message']['id']}});}break;case _0x2d6b('0x92'):if(_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0xd2')]&&_0x5b06fb['body']['status']){_0xecc018=_0x5b06fb['body'][_0x2d6b('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x5b06fb[_0x2d6b('0x5a')][_0x2d6b('0xd2')]}});}break;}}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x190a09,null))[_0x2d6b('0x1d')](function(_0x384f43){if(_0x384f43){_0x54be30=_0x384f43;switch(_0x5537a[_0x2d6b('0x41')]){case'skebby':if(_0xecc018===_0x2d6b('0xd1')){return _0x54be30[_0x2d6b('0x61')]({'read':!![]});}else{logger[_0x2d6b('0x24')](_0x2d6b('0x22'),_0x2d6b('0x29'),_0x2d6b('0xd3'),util[_0x2d6b('0xcb')](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2d6b('0x85'):if(_0xecc018==='1'){return _0x54be30[_0x2d6b('0x61')]({'read':!![]});}else{logger[_0x2d6b('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d6b('0x29'),'skebby',util[_0x2d6b('0xcb')](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2d6b('0x86'):if(!_0x5b06fb[_0x2d6b('0x5a')]['error_code']&&_0xecc018>=0xc8&&_0xecc018<=0xce){return _0x54be30[_0x2d6b('0x61')]({'read':!![]});}else{logger[_0x2d6b('0x24')](_0x2d6b('0x22'),_0x2d6b('0x29'),_0x2d6b('0x86'),util['inspect'](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2d6b('0xd4'):var _0x2fdfab=_0x5b06fb['body'][_0x2d6b('0x8b')][0x0];if(_0x2fdfab[_0x2d6b('0x29')][_0x2d6b('0xd0')]===_0x2d6b('0xd1')){return _0x54be30[_0x2d6b('0x61')]({'read':!![]});}else{logger[_0x2d6b('0x24')](_0x2d6b('0x22'),_0x2d6b('0x29'),'infobip',util[_0x2d6b('0xcb')](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2d6b('0xd5'):if(_0xecc018=='DELIVERED_TO_GATEWAY'||_0xecc018==_0x2d6b('0xd6')){return _0x54be30[_0x2d6b('0x61')]({'read':!![]});}else{logger[_0x2d6b('0x24')](_0x2d6b('0x22'),_0x2d6b('0x29'),_0x2d6b('0xd5'),util['inspect'](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2d6b('0x91'):if(_0xecc018==_0x2d6b('0xd7')){return _0x54be30[_0x2d6b('0x61')]({'read':!![]});}else{logger['error'](_0x2d6b('0x22'),_0x2d6b('0x29'),_0x2d6b('0x91'),util[_0x2d6b('0xcb')](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2d6b('0x92'):if(_0xecc018===_0x2d6b('0xd8')||_0xecc018===_0x2d6b('0xd9')){return _0x54be30[_0x2d6b('0x61')]({'read':!![]});}else{logger[_0x2d6b('0x24')](_0x2d6b('0x22'),_0x2d6b('0x29'),_0x2d6b('0x92'),util[_0x2d6b('0xcb')](_0x5b06fb[_0x2d6b('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x54be30;}})[_0x2d6b('0x1d')](respondWithResult(_0x190a09,null))['catch'](handleError(_0x190a09,null));};exports['statusGet']=function(_0x19bf4b,_0x5c42e2,_0x457d18){var _0x3b9418,_0x2e15a3,_0x5658e8;return db['SmsAccount'][_0x2d6b('0x58')]({'where':{'id':_0x19bf4b[_0x2d6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x5c42e2,null))[_0x2d6b('0x1d')](function(_0x34d37f){if(_0x34d37f){_0x5658e8=_0x34d37f;logger[_0x2d6b('0x21')](_0x2d6b('0x22'),_0x2d6b('0x29'),'received\x20delivery\x20report\x20from',_0x34d37f['type'],util['inspect'](_0x19bf4b[_0x2d6b('0x44')],{'showHidden':![],'depth':null}));switch(_0x34d37f[_0x2d6b('0x41')]){case _0x2d6b('0xda'):if(_0x19bf4b['query']['message-id']&&_0x19bf4b['query'][_0x2d6b('0xdb')]){_0x2e15a3=_0x19bf4b[_0x2d6b('0x44')][_0x2d6b('0xdb')];return db[_0x2d6b('0xc7')][_0x2d6b('0x58')]({'where':{'messageId':_0x19bf4b['query'][_0x2d6b('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x5c42e2,null))[_0x2d6b('0x1d')](function(_0x1208d1){if(_0x1208d1){_0x3b9418=_0x1208d1;switch(_0x5658e8[_0x2d6b('0x41')]){case _0x2d6b('0xda'):if(_0x2e15a3==='2'||_0x2e15a3==='6'){return _0x3b9418[_0x2d6b('0x61')]({'read':!![]});}else{logger[_0x2d6b('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2d6b('0xda'),util[_0x2d6b('0xcb')](_0x19bf4b[_0x2d6b('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x3b9418;}})[_0x2d6b('0x1d')](respondWithResult(_0x5c42e2,null))[_0x2d6b('0x28')](handleError(_0x5c42e2,null));};exports['addAgents']=function(_0x31b8bb,_0x1f9fac,_0x4280db){return db[_0x2d6b('0x3f')]['find']({'where':{'id':_0x31b8bb['params']['id']}})['then'](handleEntityNotFound(_0x1f9fac,null))[_0x2d6b('0x1d')](function(_0x2b3238){if(_0x2b3238){return _0x2b3238[_0x2d6b('0xdd')](_0x31b8bb[_0x2d6b('0x5a')]['ids'],_[_0x2d6b('0x9d')](_0x31b8bb[_0x2d6b('0x5a')],['ids','id'])||{})[_0x2d6b('0xa0')](function(_0x10a805){for(var _0x1f57a3=0x0;_0x1f57a3<_0x31b8bb[_0x2d6b('0x5a')][_0x2d6b('0x6a')][_0x2d6b('0x49')];_0x1f57a3+=0x1){socket[_0x2d6b('0xde')](_0x2d6b('0xdf'),{'UserId':Number(_0x31b8bb[_0x2d6b('0x5a')][_0x2d6b('0x6a')][_0x1f57a3]),'SmsAccountId':Number(_0x31b8bb[_0x2d6b('0x56')]['id'])});}return _0x10a805;});}})['then'](respondWithResult(_0x1f9fac,null))[_0x2d6b('0x28')](handleError(_0x1f9fac,null));};exports['removeAgents']=function(_0xe81cd7,_0x47c989,_0x5537d2){return db[_0x2d6b('0x3f')][_0x2d6b('0x58')]({'where':{'id':_0xe81cd7[_0x2d6b('0x56')]['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x47c989,null))[_0x2d6b('0x1d')](function(_0x3635bf){if(_0x3635bf){return _0x3635bf[_0x2d6b('0xe0')](_0xe81cd7[_0x2d6b('0x44')][_0x2d6b('0x6a')])[_0x2d6b('0x1d')](function(){if(_[_0x2d6b('0xe1')](_0xe81cd7[_0x2d6b('0x44')][_0x2d6b('0x6a')])){for(var _0x49a6a4=0x0;_0x49a6a4<_0xe81cd7[_0x2d6b('0x44')][_0x2d6b('0x6a')][_0x2d6b('0x49')];_0x49a6a4+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0xe81cd7['query'][_0x2d6b('0x6a')][_0x49a6a4]),'SmsAccountId':Number(_0xe81cd7['params']['id'])});}}else{socket[_0x2d6b('0xde')](_0x2d6b('0xe2'),{'UserId':Number(_0xe81cd7[_0x2d6b('0x44')][_0x2d6b('0x6a')]),'SmsAccountId':Number(_0xe81cd7['params']['id'])});}});}})[_0x2d6b('0x1d')](respondWithStatusCode(_0x47c989,null))[_0x2d6b('0x28')](handleError(_0x47c989,null));};exports[_0x2d6b('0xe3')]=function(_0x5ce0c3,_0x619aea,_0x50aaec){var _0x4abdc5={};var _0x21247d={};var _0x3214bd;var _0x28c883;return db['SmsAccount'][_0x2d6b('0x6d')]({'where':{'id':_0x5ce0c3[_0x2d6b('0x56')]['id']}})[_0x2d6b('0x1d')](handleEntityNotFound(_0x619aea,null))['then'](function(_0x490762){if(_0x490762){_0x3214bd=_0x490762;_0x21247d['model']=_[_0x2d6b('0x45')](db['User'][_0x2d6b('0x40')]);_0x21247d[_0x2d6b('0x44')]=_[_0x2d6b('0x45')](_0x5ce0c3[_0x2d6b('0x44')]);_0x21247d[_0x2d6b('0x46')]=_['intersection'](_0x21247d[_0x2d6b('0x43')],_0x21247d['query']);_0x4abdc5[_0x2d6b('0x48')]=_[_0x2d6b('0x47')](_0x21247d[_0x2d6b('0x43')],qs[_0x2d6b('0x57')](_0x5ce0c3[_0x2d6b('0x44')]['fields']));_0x4abdc5[_0x2d6b('0x48')]=_0x4abdc5[_0x2d6b('0x48')][_0x2d6b('0x49')]?_0x4abdc5[_0x2d6b('0x48')]:_0x21247d['model'];_0x4abdc5[_0x2d6b('0x67')]=qs[_0x2d6b('0x4b')](_0x5ce0c3[_0x2d6b('0x44')][_0x2d6b('0x4b')]);_0x4abdc5[_0x2d6b('0x4c')]=qs[_0x2d6b('0x46')](_[_0x2d6b('0x68')](_0x5ce0c3[_0x2d6b('0x44')],_0x21247d[_0x2d6b('0x46')]));if(_0x5ce0c3[_0x2d6b('0x44')][_0x2d6b('0x4d')]){_0x4abdc5['where']=_['merge'](_0x4abdc5['where'],{'$or':_['map'](_0x4abdc5[_0x2d6b('0x48')],function(_0x23fe1a){var _0x4ca08d={};_0x4ca08d[_0x23fe1a]={'$like':'%'+_0x5ce0c3['query'][_0x2d6b('0x4d')]+'%'};return _0x4ca08d;})});}_0x4abdc5=_[_0x2d6b('0x4e')]({},_0x4abdc5,_0x5ce0c3[_0x2d6b('0x50')]);return _0x3214bd['getAgents'](_0x4abdc5);}})['then'](function(_0x468788){if(_0x468788){_0x28c883=_0x468788[_0x2d6b('0x49')];if(!_0x5ce0c3[_0x2d6b('0x44')][_0x2d6b('0x4a')](_0x2d6b('0x66'))){_0x4abdc5['limit']=qs[_0x2d6b('0x2e')](_0x5ce0c3[_0x2d6b('0x44')][_0x2d6b('0x2e')]);_0x4abdc5[_0x2d6b('0x2c')]=qs['offset'](_0x5ce0c3[_0x2d6b('0x44')][_0x2d6b('0x2c')]);}return _0x3214bd['getAgents'](_0x4abdc5);}})[_0x2d6b('0x1d')](function(_0x151677){if(_0x151677){return _0x151677?{'count':_0x28c883,'rows':_0x151677}:null;}})[_0x2d6b('0x1d')](respondWithResult(_0x619aea,null))[_0x2d6b('0x28')](handleError(_0x619aea,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2abb1cb..1089390 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 _0x9255=['exports','events','../../mysqldb','SmsAccount','save','update','emit','hasOwnProperty','hook'];(function(_0x53082d,_0x3ec95d){var _0x318a04=function(_0x35a2e6){while(--_0x35a2e6){_0x53082d['push'](_0x53082d['shift']());}};_0x318a04(++_0x3ec95d);}(_0x9255,0x88));var _0x5925=function(_0x13d9bb,_0x2399b1){_0x13d9bb=_0x13d9bb-0x0;var _0x288829=_0x9255[_0x13d9bb];return _0x288829;};'use strict';var EventEmitter=require(_0x5925('0x0'));var SmsAccount=require(_0x5925('0x1'))['db'][_0x5925('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5925('0x3'),'afterUpdate':_0x5925('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc779f9){return function(_0xa75240,_0x1a2bf7,_0x404cee){SmsAccountEvents['emit'](_0xc779f9+':'+_0xa75240['id'],_0xa75240);SmsAccountEvents[_0x5925('0x5')](_0xc779f9,_0xa75240);_0x404cee(null);};}for(var e in events){if(events[_0x5925('0x6')](e)){var event=events[e];SmsAccount[_0x5925('0x7')](e,emitEvent(event));}}module[_0x5925('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x8f72=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','SmsAccount'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x8f72,0x1d3));var _0x28f7=function(_0x150615,_0x43d041){_0x150615=_0x150615-0x0;var _0x204318=_0x8f72[_0x150615];return _0x204318;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0x28f7('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x28f7('0x1')](0x0);var events={'afterCreate':_0x28f7('0x2'),'afterUpdate':_0x28f7('0x3'),'afterDestroy':_0x28f7('0x4')};function emitEvent(_0x25e56c){return function(_0x7d25dc,_0x327684,_0x4d38fd){SmsAccountEvents[_0x28f7('0x5')](_0x25e56c+':'+_0x7d25dc['id'],_0x7d25dc);SmsAccountEvents[_0x28f7('0x5')](_0x25e56c,_0x7d25dc);_0x4d38fd(null);};}for(var e in events){if(events[_0x28f7('0x6')](e)){var event=events[e];SmsAccount[_0x28f7('0x7')](e,emitEvent(event));}}module[_0x28f7('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d3e6642..117d77b 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 _0x0fc7=['rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x559e63,_0x7a1ac7){var _0xe01233=function(_0x509cc2){while(--_0x509cc2){_0x559e63['push'](_0x559e63['shift']());}};_0xe01233(++_0x7a1ac7);}(_0x0fc7,0x95));var _0x70fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0fc7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70fc('0x0'));var util=require('util');var logger=require(_0x70fc('0x1'))(_0x70fc('0x2'));var moment=require(_0x70fc('0x3'));var BPromise=require(_0x70fc('0x4'));var rp=require(_0x70fc('0x5'));var fs=require('fs');var path=require(_0x70fc('0x6'));var rimraf=require(_0x70fc('0x7'));var config=require('../../config/environment');var attributes=require(_0x70fc('0x8'));module[_0x70fc('0x9')]=function(_0x201757,_0x5152c3){return _0x201757[_0x70fc('0xa')](_0x70fc('0xb'),attributes,{'tableName':_0x70fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9127=['SmsAccount','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x375c2d,_0x4db954){var _0x19e1f8=function(_0x104094){while(--_0x104094){_0x375c2d['push'](_0x375c2d['shift']());}};_0x19e1f8(++_0x4db954);}(_0x9127,0x1b9));var _0x7912=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x9127[_0x1cfa0d];return _0xe33279;};'use strict';var _=require('lodash');var util=require(_0x7912('0x0'));var logger=require(_0x7912('0x1'))(_0x7912('0x2'));var moment=require('moment');var BPromise=require(_0x7912('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7912('0x4'));var rimraf=require(_0x7912('0x5'));var config=require(_0x7912('0x6'));var attributes=require('./smsAccount.attributes');module[_0x7912('0x7')]=function(_0x181067,_0x35db67){return _0x181067[_0x7912('0x8')](_0x7912('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 0ab9345..fe8ea29 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 _0x9a02=['SmsAccount,\x20%s,\x20%s','result','find','options','raw','where','attributes','map','include','model','ShowSmsAccount','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','stringify','error','code','message'];(function(_0x3932d3,_0x2c360b){var _0x975b77=function(_0x11a97e){while(--_0x11a97e){_0x3932d3['push'](_0x3932d3['shift']());}};_0x975b77(++_0x2c360b);}(_0x9a02,0x182));var _0x29a0=function(_0x4fa771,_0x255dd8){_0x4fa771=_0x4fa771-0x0;var _0x3e22d5=_0x9a02[_0x4fa771];return _0x3e22d5;};'use strict';var _=require('lodash');var util=require(_0x29a0('0x0'));var moment=require('moment');var BPromise=require(_0x29a0('0x1'));var rs=require(_0x29a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29a0('0x3'))['db'];var utils=require(_0x29a0('0x4'));var logger=require(_0x29a0('0x5'))(_0x29a0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x29a0('0x7')]['http']({'port':0x232a});config[_0x29a0('0x8')]=_[_0x29a0('0x9')](config[_0x29a0('0x8')],{'host':_0x29a0('0xa'),'port':0x18eb});var socket=require(_0x29a0('0xb'))(new Redis(config[_0x29a0('0x8')]));require(_0x29a0('0xc'))[_0x29a0('0xd')](socket);function respondWithRpcPromise(_0x435c15,_0x587468,_0x49af79){return new BPromise(function(_0x24b3d2,_0x324672){return client[_0x29a0('0xe')](_0x435c15,_0x49af79)[_0x29a0('0xf')](function(_0x429f32){logger[_0x29a0('0x10')]('SmsAccount,\x20%s,\x20%s',_0x587468,_0x29a0('0x11'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x587468,'request\x20sent',JSON[_0x29a0('0x12')](_0x429f32));if(_0x429f32['error']){if(_0x429f32[_0x29a0('0x13')][_0x29a0('0x14')]===0x1f4){logger[_0x29a0('0x13')]('SmsAccount,\x20%s,\x20%s',_0x587468,_0x429f32[_0x29a0('0x13')][_0x29a0('0x15')]);return _0x324672(_0x429f32['error']['message']);}logger[_0x29a0('0x13')](_0x29a0('0x16'),_0x587468,_0x429f32['error'][_0x29a0('0x15')]);return _0x24b3d2(_0x429f32[_0x29a0('0x13')][_0x29a0('0x15')]);}else{logger[_0x29a0('0x10')](_0x29a0('0x16'),_0x587468,_0x29a0('0x11'));_0x24b3d2(_0x429f32[_0x29a0('0x17')][_0x29a0('0x15')]);}})['catch'](function(_0x1f26c0){logger[_0x29a0('0x13')](_0x29a0('0x16'),_0x587468,_0x1f26c0);_0x324672(_0x1f26c0);});});}exports['ShowSmsAccount']=function(_0x3a2303){var _0xecf6e1=this;return new Promise(function(_0x67b30,_0x49e201){return db['SmsAccount'][_0x29a0('0x18')]({'raw':_0x3a2303[_0x29a0('0x19')]?_0x3a2303[_0x29a0('0x19')][_0x29a0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a2303[_0x29a0('0x19')]?_0x3a2303[_0x29a0('0x19')][_0x29a0('0x1b')]||null:null,'attributes':_0x3a2303[_0x29a0('0x19')]?_0x3a2303['options'][_0x29a0('0x1c')]||null:null,'include':_0x3a2303[_0x29a0('0x19')]?_0x3a2303['options']['include']?_[_0x29a0('0x1d')](_0x3a2303[_0x29a0('0x19')][_0x29a0('0x1e')],function(_0x375c6d){return{'model':db[_0x375c6d['model']],'as':_0x375c6d['as'],'attributes':_0x375c6d[_0x29a0('0x1c')],'include':_0x375c6d[_0x29a0('0x1e')]?_[_0x29a0('0x1d')](_0x375c6d[_0x29a0('0x1e')],function(_0x266524){return{'model':db[_0x266524[_0x29a0('0x1f')]],'as':_0x266524['as'],'attributes':_0x266524[_0x29a0('0x1c')],'include':_0x266524[_0x29a0('0x1e')]?_[_0x29a0('0x1d')](_0x266524[_0x29a0('0x1e')],function(_0x221c4b){return{'model':db[_0x221c4b[_0x29a0('0x1f')]],'as':_0x221c4b['as'],'attributes':_0x221c4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x29a0('0xf')](function(_0x23f505){logger[_0x29a0('0x10')]('ShowSmsAccount',_0x3a2303);logger['debug'](_0x29a0('0x20'),_0x3a2303,JSON[_0x29a0('0x12')](_0x23f505));_0x67b30(_0x23f505);})[_0x29a0('0x21')](function(_0x3c4ad7){logger[_0x29a0('0x13')](_0x29a0('0x20'),_0x3c4ad7[_0x29a0('0x15')],_0x3a2303);_0x49e201(_0xecf6e1[_0x29a0('0x13')](0x1f4,_0x3c4ad7[_0x29a0('0x15')]));});});}; \ No newline at end of file +var _0xbe4e=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','lodash','moment','bluebird'];(function(_0x5efb5c,_0x33a03e){var _0x10ae27=function(_0x583a4a){while(--_0x583a4a){_0x5efb5c['push'](_0x5efb5c['shift']());}};_0x10ae27(++_0x33a03e);}(_0xbe4e,0x19f));var _0xebe4=function(_0x3cba5e,_0x15dac9){_0x3cba5e=_0x3cba5e-0x0;var _0x312d63=_0xbe4e[_0x3cba5e];return _0x312d63;};'use strict';var _=require(_0xebe4('0x0'));var util=require('util');var moment=require(_0xebe4('0x1'));var BPromise=require(_0xebe4('0x2'));var rs=require(_0xebe4('0x3'));var fs=require('fs');var Redis=require(_0xebe4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xebe4('0x5'));var logger=require(_0xebe4('0x6'))(_0xebe4('0x7'));var config=require('../../config/environment');var jayson=require(_0xebe4('0x8'));var client=jayson[_0xebe4('0x9')][_0xebe4('0xa')]({'port':0x232a});config[_0xebe4('0xb')]=_[_0xebe4('0xc')](config['redis'],{'host':_0xebe4('0xd'),'port':0x18eb});var socket=require(_0xebe4('0xe'))(new Redis(config['redis']));require(_0xebe4('0xf'))[_0xebe4('0x10')](socket);function respondWithRpcPromise(_0x4a5f31,_0x249ea1,_0x4fc08f){return new BPromise(function(_0x24a2ea,_0xde20db){return client['request'](_0x4a5f31,_0x4fc08f)[_0xebe4('0x11')](function(_0x57f384){logger[_0xebe4('0x12')](_0xebe4('0x13'),_0x249ea1,_0xebe4('0x14'));logger[_0xebe4('0x15')](_0xebe4('0x16'),_0x249ea1,_0xebe4('0x14'),JSON[_0xebe4('0x17')](_0x57f384));if(_0x57f384[_0xebe4('0x18')]){if(_0x57f384[_0xebe4('0x18')][_0xebe4('0x19')]===0x1f4){logger[_0xebe4('0x18')](_0xebe4('0x13'),_0x249ea1,_0x57f384[_0xebe4('0x18')][_0xebe4('0x1a')]);return _0xde20db(_0x57f384[_0xebe4('0x18')][_0xebe4('0x1a')]);}logger[_0xebe4('0x18')](_0xebe4('0x13'),_0x249ea1,_0x57f384[_0xebe4('0x18')][_0xebe4('0x1a')]);return _0x24a2ea(_0x57f384[_0xebe4('0x18')][_0xebe4('0x1a')]);}else{logger[_0xebe4('0x12')](_0xebe4('0x13'),_0x249ea1,_0xebe4('0x14'));_0x24a2ea(_0x57f384[_0xebe4('0x1b')]['message']);}})['catch'](function(_0x2d1566){logger[_0xebe4('0x18')](_0xebe4('0x13'),_0x249ea1,_0x2d1566);_0xde20db(_0x2d1566);});});}exports[_0xebe4('0x1c')]=function(_0x1a7755){var _0x5e699c=this;return new Promise(function(_0x114f4b,_0x464cbe){return db[_0xebe4('0x1d')][_0xebe4('0x1e')]({'raw':_0x1a7755[_0xebe4('0x1f')]?_0x1a7755['options'][_0xebe4('0x20')]===undefined?!![]:![]:!![],'where':_0x1a7755[_0xebe4('0x1f')]?_0x1a7755['options'][_0xebe4('0x21')]||null:null,'attributes':_0x1a7755[_0xebe4('0x1f')]?_0x1a7755[_0xebe4('0x1f')][_0xebe4('0x22')]||null:null,'include':_0x1a7755[_0xebe4('0x1f')]?_0x1a7755[_0xebe4('0x1f')][_0xebe4('0x23')]?_['map'](_0x1a7755[_0xebe4('0x1f')]['include'],function(_0x16803b){return{'model':db[_0x16803b[_0xebe4('0x24')]],'as':_0x16803b['as'],'attributes':_0x16803b[_0xebe4('0x22')],'include':_0x16803b[_0xebe4('0x23')]?_['map'](_0x16803b[_0xebe4('0x23')],function(_0x537c91){return{'model':db[_0x537c91[_0xebe4('0x24')]],'as':_0x537c91['as'],'attributes':_0x537c91[_0xebe4('0x22')],'include':_0x537c91[_0xebe4('0x23')]?_[_0xebe4('0x25')](_0x537c91[_0xebe4('0x23')],function(_0x5966d8){return{'model':db[_0x5966d8['model']],'as':_0x5966d8['as'],'attributes':_0x5966d8[_0xebe4('0x22')]};}):[]};}):[]};}):[]:[]})[_0xebe4('0x11')](function(_0x3d1bf4){logger[_0xebe4('0x12')](_0xebe4('0x1c'),_0x1a7755);logger['debug']('ShowSmsAccount',_0x1a7755,JSON['stringify'](_0x3d1bf4));_0x114f4b(_0x3d1bf4);})['catch'](function(_0x38b05d){logger['error']('ShowSmsAccount',_0x38b05d['message'],_0x1a7755);_0x464cbe(_0x5e699c['error'](0x1f4,_0x38b05d[_0xebe4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 266ca12..3a614fa 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 e7dec34..248f52d 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55527b,_0x293c9a){var _0xd2577b=function(_0x23c7f3){while(--_0x23c7f3){_0x55527b['push'](_0x55527b['shift']());}};_0xd2577b(++_0x293c9a);}(_0x34e8,0x12c));var _0x834e=function(_0x42aaee,_0x43d485){_0x42aaee=_0x42aaee-0x0;var _0x46fcbd=_0x34e8[_0x42aaee];return _0x46fcbd;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x324bcf,_0xd2b221){var _0x21a347=function(_0x55e64f){while(--_0x55e64f){_0x324bcf['push'](_0x324bcf['shift']());}};_0x21a347(++_0xd2b221);}(_0x008c,0x188));var _0xc008=function(_0x56feee,_0x4d26c7){_0x56feee=_0x56feee-0x0;var _0x554d3e=_0x008c[_0x56feee];return _0x554d3e;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index a267605..9c64484 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 _0x5ec9=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x5ec9,0x19e));var _0x95ec=function(_0x32f30e,_0xff22d0){_0x32f30e=_0x32f30e-0x0;var _0x450285=_0x5ec9[_0x32f30e];return _0x450285;};'use strict';var Sequelize=require(_0x95ec('0x0'));module[_0x95ec('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x95ec('0x2')],'allowNull':![],'defaultValue':_0x95ec('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x95ec('0x2')]},'interval':{'type':Sequelize[_0x95ec('0x2')],'defaultValue':_0x95ec('0x4')}}; \ No newline at end of file +var _0xfd2f=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x119c1d,_0x37891c){var _0x29f7d6=function(_0x36dae6){while(--_0x36dae6){_0x119c1d['push'](_0x119c1d['shift']());}};_0x29f7d6(++_0x37891c);}(_0xfd2f,0xbd));var _0xffd2=function(_0x57c82e,_0x1b9226){_0x57c82e=_0x57c82e-0x0;var _0x5755b5=_0xfd2f[_0x57c82e];return _0x5755b5;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'priority':{'type':Sequelize[_0xffd2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xffd2('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xffd2('0x4')]()},'description':{'type':Sequelize[_0xffd2('0x3')]},'interval':{'type':Sequelize[_0xffd2('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 1a9513e..4d0d837 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 _0x0ebd=['params','options','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SmsApplication','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0x0ebd,0x176));var _0xd0eb=function(_0x4f0373,_0x48f6ba){_0x4f0373=_0x4f0373-0x0;var _0x8b5fa6=_0x0ebd[_0x4f0373];return _0x8b5fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0eb('0x0'));var zipdir=require(_0xd0eb('0x1'));var jsonpatch=require(_0xd0eb('0x2'));var rp=require(_0xd0eb('0x3'));var moment=require('moment');var BPromise=require(_0xd0eb('0x4'));var Mustache=require(_0xd0eb('0x5'));var util=require('util');var path=require(_0xd0eb('0x6'));var sox=require(_0xd0eb('0x7'));var csv=require(_0xd0eb('0x8'));var ejs=require(_0xd0eb('0x9'));var fs=require('fs');var fs_extra=require(_0xd0eb('0xa'));var _=require('lodash');var squel=require(_0xd0eb('0xb'));var crypto=require(_0xd0eb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd0eb('0x8'));var querystring=require(_0xd0eb('0xd'));var Papa=require(_0xd0eb('0xe'));var Redis=require(_0xd0eb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd0eb('0x10'));var as=require(_0xd0eb('0x11'));var hardwareService=require(_0xd0eb('0x12'));var logger=require(_0xd0eb('0x13'))(_0xd0eb('0x14'));var utils=require('../../config/utils');var config=require(_0xd0eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0eb('0x16'))['db'];function respondWithStatusCode(_0x556f16,_0x11a795){_0x11a795=_0x11a795||0xcc;return function(_0x2f7fe3){if(_0x2f7fe3){return _0x556f16[_0xd0eb('0x17')](_0x11a795);}return _0x556f16[_0xd0eb('0x18')](_0x11a795)[_0xd0eb('0x19')]();};}function respondWithResult(_0x36877d,_0x23dbd7){_0x23dbd7=_0x23dbd7||0xc8;return function(_0x46c3b4){if(_0x46c3b4){return _0x36877d[_0xd0eb('0x18')](_0x23dbd7)[_0xd0eb('0x1a')](_0x46c3b4);}};}function respondWithFilteredResult(_0x47205e,_0x306b5f){return function(_0x723d22){if(_0x723d22){var _0x563713=typeof _0x306b5f[_0xd0eb('0x1b')]==='undefined'&&typeof _0x306b5f[_0xd0eb('0x1c')]===_0xd0eb('0x1d');var _0x3ef6aa=_0x723d22[_0xd0eb('0x1e')];var _0x2d104e=_0x563713?0x0:_0x306b5f[_0xd0eb('0x1b')];var _0x107b4d=_0x563713?_0x723d22[_0xd0eb('0x1e')]:_0x306b5f[_0xd0eb('0x1b')]+_0x306b5f[_0xd0eb('0x1c')];var _0x18f501;if(_0x107b4d>=_0x3ef6aa){_0x107b4d=_0x3ef6aa;_0x18f501=0xc8;}else{_0x18f501=0xce;}_0x47205e['status'](_0x18f501);return _0x47205e[_0xd0eb('0x1f')](_0xd0eb('0x20'),_0x2d104e+'-'+_0x107b4d+'/'+_0x3ef6aa)[_0xd0eb('0x1a')](_0x723d22);}return null;};}function patchUpdates(_0x2a891e){return function(_0xc020d7){try{jsonpatch['apply'](_0xc020d7,_0x2a891e,!![]);}catch(_0x18c93a){return BPromise[_0xd0eb('0x21')](_0x18c93a);}return _0xc020d7[_0xd0eb('0x22')]();};}function saveUpdates(_0x53cecf,_0x4c3777){return function(_0x3874b2){if(_0x3874b2){return _0x3874b2[_0xd0eb('0x23')](_0x53cecf)[_0xd0eb('0x24')](function(_0x5c441b){return _0x5c441b;});}return null;};}function removeEntity(_0x41a944,_0x3e067d){return function(_0x27139b){if(_0x27139b){return _0x27139b[_0xd0eb('0x25')]()[_0xd0eb('0x24')](function(){_0x41a944[_0xd0eb('0x18')](0xcc)[_0xd0eb('0x19')]();});}};}function handleEntityNotFound(_0xb6ac13,_0x15e69e){return function(_0x392c1){if(!_0x392c1){_0xb6ac13['sendStatus'](0x194);}return _0x392c1;};}function handleError(_0x3e9f03,_0x3a0acc){_0x3a0acc=_0x3a0acc||0x1f4;return function(_0x2e7db1){logger[_0xd0eb('0x26')](_0x2e7db1[_0xd0eb('0x27')]);if(_0x2e7db1[_0xd0eb('0x28')]){delete _0x2e7db1[_0xd0eb('0x28')];}_0x3e9f03[_0xd0eb('0x18')](_0x3a0acc)[_0xd0eb('0x29')](_0x2e7db1);};}exports[_0xd0eb('0x2a')]=function(_0x1f6661,_0x39b52b){var _0x5dfc07={},_0x5b92bd={},_0x23611f={'count':0x0,'rows':[]};var _0x253ffa=_['map'](db[_0xd0eb('0x2b')][_0xd0eb('0x2c')],function(_0x1afae7){return{'name':_0x1afae7['fieldName'],'type':_0x1afae7[_0xd0eb('0x2d')]['key']};});_0x5b92bd['model']=_['map'](_0x253ffa,_0xd0eb('0x28'));_0x5b92bd[_0xd0eb('0x2e')]=_[_0xd0eb('0x2f')](_0x1f6661[_0xd0eb('0x2e')]);_0x5b92bd[_0xd0eb('0x30')]=_[_0xd0eb('0x31')](_0x5b92bd[_0xd0eb('0x32')],_0x5b92bd[_0xd0eb('0x2e')]);_0x5dfc07[_0xd0eb('0x33')]=_['intersection'](_0x5b92bd['model'],qs['fields'](_0x1f6661['query'][_0xd0eb('0x34')]));_0x5dfc07['attributes']=_0x5dfc07[_0xd0eb('0x33')][_0xd0eb('0x35')]?_0x5dfc07['attributes']:_0x5b92bd[_0xd0eb('0x32')];if(!_0x1f6661[_0xd0eb('0x2e')][_0xd0eb('0x36')](_0xd0eb('0x37'))){_0x5dfc07['limit']=qs[_0xd0eb('0x1c')](_0x1f6661[_0xd0eb('0x2e')]['limit']);_0x5dfc07['offset']=qs[_0xd0eb('0x1b')](_0x1f6661[_0xd0eb('0x2e')]['offset']);}_0x5dfc07[_0xd0eb('0x38')]=qs[_0xd0eb('0x39')](_0x1f6661[_0xd0eb('0x2e')]['sort']);_0x5dfc07[_0xd0eb('0x3a')]=qs[_0xd0eb('0x30')](_[_0xd0eb('0x3b')](_0x1f6661[_0xd0eb('0x2e')],_0x5b92bd[_0xd0eb('0x30')]),_0x253ffa);if(_0x1f6661[_0xd0eb('0x2e')][_0xd0eb('0x3c')]){_0x5dfc07[_0xd0eb('0x3a')]=_[_0xd0eb('0x3d')](_0x5dfc07[_0xd0eb('0x3a')],{'$or':_[_0xd0eb('0x3e')](_0x253ffa,function(_0x501a63){if(_0x501a63[_0xd0eb('0x2d')]!==_0xd0eb('0x3f')){var _0x39843a={};_0x39843a[_0x501a63[_0xd0eb('0x28')]]={'$like':'%'+_0x1f6661[_0xd0eb('0x2e')][_0xd0eb('0x3c')]+'%'};return _0x39843a;}})});}_0x5dfc07=_[_0xd0eb('0x3d')]({},_0x5dfc07,_0x1f6661['options']);var _0x4bf3dd={'where':_0x5dfc07[_0xd0eb('0x3a')]};return db[_0xd0eb('0x2b')][_0xd0eb('0x1e')](_0x4bf3dd)[_0xd0eb('0x24')](function(_0x13d579){_0x23611f[_0xd0eb('0x1e')]=_0x13d579;if(_0x1f6661[_0xd0eb('0x2e')][_0xd0eb('0x40')]){_0x5dfc07[_0xd0eb('0x41')]=[{'all':!![]}];}return db[_0xd0eb('0x2b')][_0xd0eb('0x42')](_0x5dfc07);})[_0xd0eb('0x24')](function(_0x1df0b9){_0x23611f[_0xd0eb('0x43')]=_0x1df0b9;return _0x23611f;})['then'](respondWithFilteredResult(_0x39b52b,_0x5dfc07))[_0xd0eb('0x44')](handleError(_0x39b52b,null));};exports[_0xd0eb('0x45')]=function(_0x41fa83,_0x311c7e){var _0x1d0b5a={'raw':!![],'where':{'id':_0x41fa83[_0xd0eb('0x46')]['id']}},_0x2031e0={};_0x2031e0[_0xd0eb('0x32')]=_['keys'](db[_0xd0eb('0x2b')][_0xd0eb('0x2c')]);_0x2031e0[_0xd0eb('0x2e')]=_[_0xd0eb('0x2f')](_0x41fa83[_0xd0eb('0x2e')]);_0x2031e0['filters']=_[_0xd0eb('0x31')](_0x2031e0['model'],_0x2031e0[_0xd0eb('0x2e')]);_0x1d0b5a['attributes']=_['intersection'](_0x2031e0[_0xd0eb('0x32')],qs['fields'](_0x41fa83[_0xd0eb('0x2e')][_0xd0eb('0x34')]));_0x1d0b5a[_0xd0eb('0x33')]=_0x1d0b5a[_0xd0eb('0x33')]['length']?_0x1d0b5a[_0xd0eb('0x33')]:_0x2031e0['model'];if(_0x41fa83[_0xd0eb('0x2e')]['includeAll']){_0x1d0b5a[_0xd0eb('0x41')]=[{'all':!![]}];}_0x1d0b5a=_[_0xd0eb('0x3d')]({},_0x1d0b5a,_0x41fa83[_0xd0eb('0x47')]);return db['SmsApplication']['find'](_0x1d0b5a)['then'](handleEntityNotFound(_0x311c7e,null))[_0xd0eb('0x24')](respondWithResult(_0x311c7e,null))[_0xd0eb('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x5acf6d,_0x18e662){return db[_0xd0eb('0x2b')]['create'](_0x5acf6d[_0xd0eb('0x48')],{})[_0xd0eb('0x24')](respondWithResult(_0x18e662,0xc9))[_0xd0eb('0x44')](handleError(_0x18e662,null));};exports[_0xd0eb('0x23')]=function(_0x145b21,_0x2df668){if(_0x145b21[_0xd0eb('0x48')]['id']){delete _0x145b21[_0xd0eb('0x48')]['id'];}return db[_0xd0eb('0x2b')][_0xd0eb('0x49')]({'where':{'id':_0x145b21['params']['id']}})[_0xd0eb('0x24')](handleEntityNotFound(_0x2df668,null))[_0xd0eb('0x24')](saveUpdates(_0x145b21[_0xd0eb('0x48')],null))[_0xd0eb('0x24')](respondWithResult(_0x2df668,null))[_0xd0eb('0x44')](handleError(_0x2df668,null));};exports['destroy']=function(_0x107f30,_0x2f5dd7){return db[_0xd0eb('0x2b')][_0xd0eb('0x49')]({'where':{'id':_0x107f30[_0xd0eb('0x46')]['id']}})[_0xd0eb('0x24')](handleEntityNotFound(_0x2f5dd7,null))[_0xd0eb('0x24')](removeEntity(_0x2f5dd7,null))[_0xd0eb('0x44')](handleError(_0x2f5dd7,null));}; \ No newline at end of file +var _0x8ee4=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','model','attributes','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','SmsApplication','includeAll','include','findAll','rows','show','intersection','fields','length','catch','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x972085,_0x326033){var _0x298ece=function(_0x280e7e){while(--_0x280e7e){_0x972085['push'](_0x972085['shift']());}};_0x298ece(++_0x326033);}(_0x8ee4,0x19e));var _0x48ee=function(_0x4a37b4,_0x2aff74){_0x4a37b4=_0x4a37b4-0x0;var _0x1dc99c=_0x8ee4[_0x4a37b4];return _0x1dc99c;};'use strict';var emlformat=require(_0x48ee('0x0'));var rimraf=require(_0x48ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48ee('0x2'));var rp=require(_0x48ee('0x3'));var moment=require(_0x48ee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x48ee('0x5'));var util=require(_0x48ee('0x6'));var path=require('path');var sox=require(_0x48ee('0x7'));var csv=require(_0x48ee('0x8'));var ejs=require(_0x48ee('0x9'));var fs=require('fs');var fs_extra=require(_0x48ee('0xa'));var _=require(_0x48ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x48ee('0xc'));var deskjs=require(_0x48ee('0xd'));var toCsv=require(_0x48ee('0x8'));var querystring=require(_0x48ee('0xe'));var Papa=require(_0x48ee('0xf'));var Redis=require(_0x48ee('0x10'));var authService=require(_0x48ee('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48ee('0x12'));var logger=require(_0x48ee('0x13'))(_0x48ee('0x14'));var utils=require(_0x48ee('0x15'));var config=require(_0x48ee('0x16'));var licenseUtil=require(_0x48ee('0x17'));var db=require(_0x48ee('0x18'))['db'];function respondWithStatusCode(_0x37036b,_0x4e7cc9){_0x4e7cc9=_0x4e7cc9||0xcc;return function(_0x413770){if(_0x413770){return _0x37036b[_0x48ee('0x19')](_0x4e7cc9);}return _0x37036b[_0x48ee('0x1a')](_0x4e7cc9)[_0x48ee('0x1b')]();};}function respondWithResult(_0x359376,_0x43cb93){_0x43cb93=_0x43cb93||0xc8;return function(_0x3b5241){if(_0x3b5241){return _0x359376[_0x48ee('0x1a')](_0x43cb93)[_0x48ee('0x1c')](_0x3b5241);}};}function respondWithFilteredResult(_0x3a46d1,_0x2fea4a){return function(_0x2345c4){if(_0x2345c4){var _0x30ad13=typeof _0x2fea4a[_0x48ee('0x1d')]==='undefined'&&typeof _0x2fea4a[_0x48ee('0x1e')]==='undefined';var _0x1ebf8a=_0x2345c4[_0x48ee('0x1f')];var _0x6c4005=_0x30ad13?0x0:_0x2fea4a[_0x48ee('0x1d')];var _0x5fffd7=_0x30ad13?_0x2345c4[_0x48ee('0x1f')]:_0x2fea4a[_0x48ee('0x1d')]+_0x2fea4a['limit'];var _0x30a3f9;if(_0x5fffd7>=_0x1ebf8a){_0x5fffd7=_0x1ebf8a;_0x30a3f9=0xc8;}else{_0x30a3f9=0xce;}_0x3a46d1['status'](_0x30a3f9);return _0x3a46d1[_0x48ee('0x20')](_0x48ee('0x21'),_0x6c4005+'-'+_0x5fffd7+'/'+_0x1ebf8a)[_0x48ee('0x1c')](_0x2345c4);}return null;};}function patchUpdates(_0x5a03eb){return function(_0x3f14f5){try{jsonpatch[_0x48ee('0x22')](_0x3f14f5,_0x5a03eb,!![]);}catch(_0x46f2ed){return BPromise[_0x48ee('0x23')](_0x46f2ed);}return _0x3f14f5['save']();};}function saveUpdates(_0x4f1f20,_0x11f4eb){return function(_0x136a78){if(_0x136a78){return _0x136a78[_0x48ee('0x24')](_0x4f1f20)['then'](function(_0x200dc9){return _0x200dc9;});}return null;};}function removeEntity(_0x2631ec,_0x4e6a42){return function(_0x526876){if(_0x526876){return _0x526876[_0x48ee('0x25')]()[_0x48ee('0x26')](function(){_0x2631ec[_0x48ee('0x1a')](0xcc)[_0x48ee('0x1b')]();});}};}function handleEntityNotFound(_0x2bb058,_0x4b40af){return function(_0x25f2d7){if(!_0x25f2d7){_0x2bb058['sendStatus'](0x194);}return _0x25f2d7;};}function handleError(_0x34956a,_0x3e9461){_0x3e9461=_0x3e9461||0x1f4;return function(_0x329e95){logger['error'](_0x329e95[_0x48ee('0x27')]);if(_0x329e95[_0x48ee('0x28')]){delete _0x329e95[_0x48ee('0x28')];}_0x34956a[_0x48ee('0x1a')](_0x3e9461)[_0x48ee('0x29')](_0x329e95);};}exports[_0x48ee('0x2a')]=function(_0x257e0e,_0x520302){var _0xc69df9={},_0x390687={},_0x5c2c6f={'count':0x0,'rows':[]};var _0x561abe=_['map'](db['SmsApplication'][_0x48ee('0x2b')],function(_0x19f7df){return{'name':_0x19f7df[_0x48ee('0x2c')],'type':_0x19f7df[_0x48ee('0x2d')]['key']};});_0x390687['model']=_[_0x48ee('0x2e')](_0x561abe,'name');_0x390687[_0x48ee('0x2f')]=_[_0x48ee('0x30')](_0x257e0e[_0x48ee('0x2f')]);_0x390687['filters']=_['intersection'](_0x390687[_0x48ee('0x31')],_0x390687[_0x48ee('0x2f')]);_0xc69df9[_0x48ee('0x32')]=_['intersection'](_0x390687[_0x48ee('0x31')],qs['fields'](_0x257e0e['query']['fields']));_0xc69df9[_0x48ee('0x32')]=_0xc69df9['attributes']['length']?_0xc69df9[_0x48ee('0x32')]:_0x390687['model'];if(!_0x257e0e[_0x48ee('0x2f')]['hasOwnProperty']('nolimit')){_0xc69df9[_0x48ee('0x1e')]=qs[_0x48ee('0x1e')](_0x257e0e[_0x48ee('0x2f')][_0x48ee('0x1e')]);_0xc69df9[_0x48ee('0x1d')]=qs[_0x48ee('0x1d')](_0x257e0e[_0x48ee('0x2f')]['offset']);}_0xc69df9[_0x48ee('0x33')]=qs['sort'](_0x257e0e[_0x48ee('0x2f')][_0x48ee('0x34')]);_0xc69df9[_0x48ee('0x35')]=qs[_0x48ee('0x36')](_[_0x48ee('0x37')](_0x257e0e[_0x48ee('0x2f')],_0x390687[_0x48ee('0x36')]),_0x561abe);if(_0x257e0e['query']['filter']){_0xc69df9[_0x48ee('0x35')]=_['merge'](_0xc69df9['where'],{'$or':_[_0x48ee('0x2e')](_0x561abe,function(_0x47e106){if(_0x47e106[_0x48ee('0x2d')]!==_0x48ee('0x38')){var _0x500622={};_0x500622[_0x47e106[_0x48ee('0x28')]]={'$like':'%'+_0x257e0e['query'][_0x48ee('0x39')]+'%'};return _0x500622;}})});}_0xc69df9=_[_0x48ee('0x3a')]({},_0xc69df9,_0x257e0e[_0x48ee('0x3b')]);var _0x429391={'where':_0xc69df9['where']};return db[_0x48ee('0x3c')][_0x48ee('0x1f')](_0x429391)['then'](function(_0x1cd524){_0x5c2c6f[_0x48ee('0x1f')]=_0x1cd524;if(_0x257e0e[_0x48ee('0x2f')][_0x48ee('0x3d')]){_0xc69df9[_0x48ee('0x3e')]=[{'all':!![]}];}return db[_0x48ee('0x3c')][_0x48ee('0x3f')](_0xc69df9);})[_0x48ee('0x26')](function(_0x44ea71){_0x5c2c6f[_0x48ee('0x40')]=_0x44ea71;return _0x5c2c6f;})[_0x48ee('0x26')](respondWithFilteredResult(_0x520302,_0xc69df9))['catch'](handleError(_0x520302,null));};exports[_0x48ee('0x41')]=function(_0x2a7437,_0xb9f048){var _0x5bbd41={'raw':!![],'where':{'id':_0x2a7437['params']['id']}},_0x3299e8={};_0x3299e8[_0x48ee('0x31')]=_[_0x48ee('0x30')](db[_0x48ee('0x3c')][_0x48ee('0x2b')]);_0x3299e8[_0x48ee('0x2f')]=_[_0x48ee('0x30')](_0x2a7437['query']);_0x3299e8[_0x48ee('0x36')]=_[_0x48ee('0x42')](_0x3299e8[_0x48ee('0x31')],_0x3299e8[_0x48ee('0x2f')]);_0x5bbd41[_0x48ee('0x32')]=_[_0x48ee('0x42')](_0x3299e8[_0x48ee('0x31')],qs['fields'](_0x2a7437['query'][_0x48ee('0x43')]));_0x5bbd41[_0x48ee('0x32')]=_0x5bbd41['attributes'][_0x48ee('0x44')]?_0x5bbd41[_0x48ee('0x32')]:_0x3299e8[_0x48ee('0x31')];if(_0x2a7437['query']['includeAll']){_0x5bbd41[_0x48ee('0x3e')]=[{'all':!![]}];}_0x5bbd41=_[_0x48ee('0x3a')]({},_0x5bbd41,_0x2a7437[_0x48ee('0x3b')]);return db[_0x48ee('0x3c')]['find'](_0x5bbd41)[_0x48ee('0x26')](handleEntityNotFound(_0xb9f048,null))[_0x48ee('0x26')](respondWithResult(_0xb9f048,null))[_0x48ee('0x45')](handleError(_0xb9f048,null));};exports['create']=function(_0x96634a,_0xd5ecbf){return db[_0x48ee('0x3c')]['create'](_0x96634a[_0x48ee('0x46')],{})[_0x48ee('0x26')](respondWithResult(_0xd5ecbf,0xc9))[_0x48ee('0x45')](handleError(_0xd5ecbf,null));};exports[_0x48ee('0x24')]=function(_0x13d69e,_0x2eda62){if(_0x13d69e[_0x48ee('0x46')]['id']){delete _0x13d69e[_0x48ee('0x46')]['id'];}return db[_0x48ee('0x3c')][_0x48ee('0x47')]({'where':{'id':_0x13d69e[_0x48ee('0x48')]['id']}})[_0x48ee('0x26')](handleEntityNotFound(_0x2eda62,null))[_0x48ee('0x26')](saveUpdates(_0x13d69e['body'],null))['then'](respondWithResult(_0x2eda62,null))[_0x48ee('0x45')](handleError(_0x2eda62,null));};exports[_0x48ee('0x25')]=function(_0xb682ed,_0x462f34){return db[_0x48ee('0x3c')][_0x48ee('0x47')]({'where':{'id':_0xb682ed[_0x48ee('0x48')]['id']}})[_0x48ee('0x26')](handleEntityNotFound(_0x462f34,null))[_0x48ee('0x26')](removeEntity(_0x462f34,null))[_0x48ee('0x45')](handleError(_0x462f34,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c6d9219..3fa4cd9 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 _0x4172=['moment','bluebird','request-promise','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x2c92f5,_0x46280b){var _0x3b3a97=function(_0x49a4c0){while(--_0x49a4c0){_0x2c92f5['push'](_0x2c92f5['shift']());}};_0x3b3a97(++_0x46280b);}(_0x4172,0x1aa));var _0x2417=function(_0x5fa802,_0x1a3e50){_0x5fa802=_0x5fa802-0x0;var _0x4eb6cf=_0x4172[_0x5fa802];return _0x4eb6cf;};'use strict';var _=require(_0x2417('0x0'));var util=require('util');var logger=require(_0x2417('0x1'))(_0x2417('0x2'));var moment=require(_0x2417('0x3'));var BPromise=require(_0x2417('0x4'));var rp=require(_0x2417('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2417('0x6'));var attributes=require(_0x2417('0x7'));module[_0x2417('0x8')]=function(_0x4424b6,_0x4a35de){return _0x4424b6[_0x2417('0x9')](_0x2417('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2417('0xb'),'collate':_0x2417('0xc')});}; \ No newline at end of file +var _0x2e1a=['./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x235753,_0x4295a4){var _0x39c4e1=function(_0x281ddd){while(--_0x281ddd){_0x235753['push'](_0x235753['shift']());}};_0x39c4e1(++_0x4295a4);}(_0x2e1a,0xd6));var _0xa2e1=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x2e1a[_0x5a19fc];return _0x34b413;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2e1('0x0'))(_0xa2e1('0x1'));var moment=require('moment');var BPromise=require(_0xa2e1('0x2'));var rp=require(_0xa2e1('0x3'));var fs=require('fs');var path=require(_0xa2e1('0x4'));var rimraf=require(_0xa2e1('0x5'));var config=require(_0xa2e1('0x6'));var attributes=require(_0xa2e1('0x7'));module[_0xa2e1('0x8')]=function(_0x4d534c,_0x4428a9){return _0x4d534c[_0xa2e1('0x9')](_0xa2e1('0xa'),attributes,{'tableName':_0xa2e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa2e1('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 900ddd0..c7cd91f 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 _0xda20=['http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda20,0x1d9));var _0x0da2=function(_0xfbb23a,_0x38425c){_0xfbb23a=_0xfbb23a-0x0;var _0x3054be=_0xda20[_0xfbb23a];return _0x3054be;};'use strict';var _=require(_0x0da2('0x0'));var util=require('util');var moment=require(_0x0da2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0da2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0da2('0x3'));var logger=require(_0x0da2('0x4'))('rpc');var config=require(_0x0da2('0x5'));var jayson=require(_0x0da2('0x6'));var client=jayson['client'][_0x0da2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x292ede,_0x166a32,_0x3aa0c5){return new BPromise(function(_0x1e5150,_0x1069a6){return client[_0x0da2('0x8')](_0x292ede,_0x3aa0c5)[_0x0da2('0x9')](function(_0x248bce){logger['info'](_0x0da2('0xa'),_0x166a32,_0x0da2('0xb'));logger[_0x0da2('0xc')](_0x0da2('0xd'),_0x166a32,'request\x20sent',JSON['stringify'](_0x248bce));if(_0x248bce[_0x0da2('0xe')]){if(_0x248bce[_0x0da2('0xe')][_0x0da2('0xf')]===0x1f4){logger[_0x0da2('0xe')](_0x0da2('0xa'),_0x166a32,_0x248bce[_0x0da2('0xe')][_0x0da2('0x10')]);return _0x1069a6(_0x248bce['error'][_0x0da2('0x10')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x166a32,_0x248bce['error'][_0x0da2('0x10')]);return _0x1e5150(_0x248bce['error'][_0x0da2('0x10')]);}else{logger[_0x0da2('0x11')]('SmsApplication,\x20%s,\x20%s',_0x166a32,_0x0da2('0xb'));_0x1e5150(_0x248bce[_0x0da2('0x12')]['message']);}})[_0x0da2('0x13')](function(_0x192772){logger[_0x0da2('0xe')]('SmsApplication,\x20%s,\x20%s',_0x166a32,_0x192772);_0x1069a6(_0x192772);});});} \ No newline at end of file +var _0x6a0b=['info','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message'];(function(_0x35445f,_0x43826f){var _0x436788=function(_0xc64a1){while(--_0xc64a1){_0x35445f['push'](_0x35445f['shift']());}};_0x436788(++_0x43826f);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x2f9aac,_0x33cebe){_0x2f9aac=_0x2f9aac-0x0;var _0x112bc5=_0x6a0b[_0x2f9aac];return _0x112bc5;};'use strict';var _=require(_0xb6a0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb6a0('0x1'));var rs=require(_0xb6a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6a0('0x3'))['db'];var utils=require(_0xb6a0('0x4'));var logger=require(_0xb6a0('0x5'))(_0xb6a0('0x6'));var config=require(_0xb6a0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb6a0('0x8')][_0xb6a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41bec1,_0xef4451,_0xb107bd){return new BPromise(function(_0x434911,_0x4357a5){return client[_0xb6a0('0xa')](_0x41bec1,_0xb107bd)[_0xb6a0('0xb')](function(_0x4e3aaf){logger['info']('SmsApplication,\x20%s,\x20%s',_0xef4451,'request\x20sent');logger['debug'](_0xb6a0('0xc'),_0xef4451,'request\x20sent',JSON[_0xb6a0('0xd')](_0x4e3aaf));if(_0x4e3aaf[_0xb6a0('0xe')]){if(_0x4e3aaf['error'][_0xb6a0('0xf')]===0x1f4){logger[_0xb6a0('0xe')](_0xb6a0('0x10'),_0xef4451,_0x4e3aaf[_0xb6a0('0xe')][_0xb6a0('0x11')]);return _0x4357a5(_0x4e3aaf[_0xb6a0('0xe')][_0xb6a0('0x11')]);}logger[_0xb6a0('0xe')](_0xb6a0('0x10'),_0xef4451,_0x4e3aaf[_0xb6a0('0xe')]['message']);return _0x434911(_0x4e3aaf[_0xb6a0('0xe')][_0xb6a0('0x11')]);}else{logger[_0xb6a0('0x12')](_0xb6a0('0x10'),_0xef4451,_0xb6a0('0x13'));_0x434911(_0x4e3aaf[_0xb6a0('0x14')][_0xb6a0('0x11')]);}})[_0xb6a0('0x15')](function(_0x1cb284){logger['error'](_0xb6a0('0x10'),_0xef4451,_0x1cb284);_0x4357a5(_0x1cb284);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 694c198..f35212b 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 _0x6cb4=['./smsInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','create','post','/:id/messages','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x155c33,_0x2f1435){var _0x561178=function(_0x4d148b){while(--_0x4d148b){_0x155c33['push'](_0x155c33['shift']());}};_0x561178(++_0x2f1435);}(_0x6cb4,0xff));var _0x46cb=function(_0x2307e3,_0xceaeb3){_0x2307e3=_0x2307e3-0x0;var _0x3cf492=_0x6cb4[_0x2307e3];return _0x3cf492;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xb')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0xf')]);router[_0x46cb('0xb')]('/:id/messages',auth[_0x46cb('0xa')](),controller[_0x46cb('0x10')]);router['get'](_0x46cb('0x11'),auth[_0x46cb('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x46cb('0x12')]);router[_0x46cb('0x13')](_0x46cb('0x14'),auth[_0x46cb('0xa')](),controller['addMessage']);router[_0x46cb('0x13')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')](_0x46cb('0x17'),_0x46cb('0x18')),controller[_0x46cb('0x19')]);router[_0x46cb('0x1a')](_0x46cb('0xe'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')]('sms',_0x46cb('0x1b')),controller['update']);router[_0x46cb('0x1c')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x46cb('0x17'),_0x46cb('0x1d')),controller[_0x46cb('0x1e')]);router[_0x46cb('0x1c')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),controller[_0x46cb('0x1f')]);module[_0x46cb('0x20')]=router; \ No newline at end of file +var _0xa571=['get','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xa571,0x107));var _0x1a57=function(_0x1cb18a,_0x2d1af6){_0x1cb18a=_0x1cb18a-0x0;var _0x81e247=_0xa571[_0x1cb18a];return _0x81e247;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./smsInteraction.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['describe']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')](_0x1a57('0xc'),auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),interaction['tracked'](_0x1a57('0x13'),_0x1a57('0x14')),controller[_0x1a57('0x15')]);router[_0x1a57('0x16')]('/:id',auth[_0x1a57('0x8')](),interaction['tracked']('sms',_0x1a57('0x17')),controller[_0x1a57('0x18')]);router[_0x1a57('0x19')]('/:id',auth[_0x1a57('0x8')](),interaction[_0x1a57('0x1a')](_0x1a57('0x13'),'smsinteraction:destroy'),controller[_0x1a57('0x1b')]);router[_0x1a57('0x19')](_0x1a57('0x1c'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 7eb32ed..75c9af5 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 _0x11e5=['exports','BOOLEAN','STRING','out','DATE','ENUM','sequelize'];(function(_0x30f772,_0x2e981b){var _0x48296d=function(_0x403ee9){while(--_0x403ee9){_0x30f772['push'](_0x30f772['shift']());}};_0x48296d(++_0x2e981b);}(_0x11e5,0x8b));var _0x511e=function(_0x1abe83,_0x461d88){_0x1abe83=_0x1abe83-0x0;var _0x29ee41=_0x11e5[_0x1abe83];return _0x29ee41;};'use strict';var Sequelize=require(_0x511e('0x0'));var moment=require('moment');module[_0x511e('0x1')]={'closed':{'type':Sequelize[_0x511e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x511e('0x3')]},'secondDisposition':{'type':Sequelize[_0x511e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x511e('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x511e('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x511e('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x511e('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x511e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xdcc4=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x298f7c,_0x350b2c){var _0x337757=function(_0x59d2b1){while(--_0x59d2b1){_0x298f7c['push'](_0x298f7c['shift']());}};_0x337757(++_0x350b2c);}(_0xdcc4,0xea));var _0x4dcc=function(_0x321fb0,_0x1e69ad){_0x321fb0=_0x321fb0-0x0;var _0x54421d=_0xdcc4[_0x321fb0];return _0x54421d;};'use strict';var Sequelize=require(_0x4dcc('0x0'));var moment=require(_0x4dcc('0x1'));module[_0x4dcc('0x2')]={'closed':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4dcc('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4dcc('0x5')]},'note':{'type':Sequelize[_0x4dcc('0x5')]},'phone':{'type':Sequelize[_0x4dcc('0x5')]},'read1stAt':{'type':Sequelize[_0x4dcc('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4dcc('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4dcc('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4dcc('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4dcc('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 3e3d95b..b635aac 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 _0x7a86=['root','server','tmp','join','files','attachments','transcript-%d-%s.zip','lastName','Messages','createdAt','direction','secret','SmsAccount','Owner','get','mkdirSync','Account','N.A.','closedAt','disposition','out','renderFile','views','downloadInteraction.ejs','transcript-','Sms','log','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','unmanaged','total','closed','UserId','SmsInteraction','rawAttributes','fieldName','type','key','map','keys','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','start','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','group','i.id','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','push','all','rows','show','params','includeAll','include','options','create','update','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','download','unix'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x7a86,0xfc));var _0x67a8=function(_0x403b88,_0xfa3d65){_0x403b88=_0x403b88-0x0;var _0x242234=_0x7a86[_0x403b88];return _0x242234;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67a8('0x1'));var rp=require(_0x67a8('0x2'));var moment=require(_0x67a8('0x3'));var BPromise=require(_0x67a8('0x4'));var Mustache=require('mustache');var util=require(_0x67a8('0x5'));var path=require(_0x67a8('0x6'));var sox=require('sox');var csv=require(_0x67a8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67a8('0x8'));var _=require(_0x67a8('0x9'));var squel=require('squel');var crypto=require(_0x67a8('0xa'));var jsforce=require(_0x67a8('0xb'));var deskjs=require(_0x67a8('0xc'));var toCsv=require(_0x67a8('0x7'));var querystring=require(_0x67a8('0xd'));var Papa=require(_0x67a8('0xe'));var Redis=require(_0x67a8('0xf'));var authService=require(_0x67a8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x67a8('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x67a8('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x67a8('0x13'));var config=require(_0x67a8('0x14'));var licenseUtil=require(_0x67a8('0x15'));var db=require(_0x67a8('0x16'))['db'];config['redis']=_[_0x67a8('0x17')](config[_0x67a8('0x18')],{'host':_0x67a8('0x19'),'port':0x18eb});var socket=require(_0x67a8('0x1a'))(new Redis(config['redis']));require(_0x67a8('0x1b'))[_0x67a8('0x1c')](socket);function respondWithStatusCode(_0x310cc5,_0x4d8fab){_0x4d8fab=_0x4d8fab||0xcc;return function(_0x87eb64){if(_0x87eb64){return _0x310cc5[_0x67a8('0x1d')](_0x4d8fab);}return _0x310cc5['status'](_0x4d8fab)['end']();};}function respondWithResult(_0xb0dd9d,_0x2c761b){_0x2c761b=_0x2c761b||0xc8;return function(_0x56cd33){if(_0x56cd33){return _0xb0dd9d[_0x67a8('0x1e')](_0x2c761b)[_0x67a8('0x1f')](_0x56cd33);}};}function respondWithFilteredResult(_0x2c4dd0,_0x16b14f){return function(_0x33f7e1){if(_0x33f7e1){var _0xd4ad89=typeof _0x16b14f[_0x67a8('0x20')]===_0x67a8('0x21')&&typeof _0x16b14f[_0x67a8('0x22')]===_0x67a8('0x21');var _0x9e5b56=_0x33f7e1[_0x67a8('0x23')];var _0x398286=_0xd4ad89?0x0:_0x16b14f['offset'];var _0x405c2a=_0xd4ad89?_0x33f7e1[_0x67a8('0x23')]:_0x16b14f[_0x67a8('0x20')]+_0x16b14f[_0x67a8('0x22')];var _0x33c1ce;if(_0x405c2a>=_0x9e5b56){_0x405c2a=_0x9e5b56;_0x33c1ce=0xc8;}else{_0x33c1ce=0xce;}_0x2c4dd0[_0x67a8('0x1e')](_0x33c1ce);return _0x2c4dd0[_0x67a8('0x24')](_0x67a8('0x25'),_0x398286+'-'+_0x405c2a+'/'+_0x9e5b56)[_0x67a8('0x1f')](_0x33f7e1);}return null;};}function patchUpdates(_0x515383){return function(_0x1c8de8){try{jsonpatch['apply'](_0x1c8de8,_0x515383,!![]);}catch(_0x2717a1){return BPromise[_0x67a8('0x26')](_0x2717a1);}return _0x1c8de8[_0x67a8('0x27')]();};}function saveUpdates(_0x240d13,_0x2ef943){return function(_0x47a42b){if(_0x47a42b){return _0x47a42b['update'](_0x240d13)[_0x67a8('0x28')](function(_0x328ce7){return _0x328ce7;});}return null;};}function removeEntity(_0xe9ec9b,_0x568d20){return function(_0x5eebec){if(_0x5eebec){return _0x5eebec['destroy']()[_0x67a8('0x28')](function(){_0xe9ec9b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x70d70d,_0x1905dd){return function(_0xd5fabc){if(!_0xd5fabc){_0x70d70d[_0x67a8('0x1d')](0x194);}return _0xd5fabc;};}function handleError(_0x3c83e8,_0x4f67d3){_0x4f67d3=_0x4f67d3||0x1f4;return function(_0x3a7fbc){logger[_0x67a8('0x29')](_0x3a7fbc[_0x67a8('0x2a')]);if(_0x3a7fbc[_0x67a8('0x2b')]){delete _0x3a7fbc['name'];}_0x3c83e8['status'](_0x4f67d3)[_0x67a8('0x2c')](_0x3a7fbc);};}function getInteractionUsers(_0x40f1b0,_0x58271f){return new BPromise(function(_0x1e824f,_0x15009e){try{if(_0x58271f[_0x40f1b0['id']]){_0x40f1b0[_0x67a8('0x2d')]=_['map'](_0x58271f[_0x40f1b0['id']],function(_0x55ea0a){return{'id':_0x55ea0a['id'],'fullname':_0x55ea0a[_0x67a8('0x2e')]};});}}catch(_0x18e209){_0x15009e(_0x18e209);}_0x1e824f(_0x40f1b0);});}function getInteractionTags(_0x4b736a,_0x3a1c5c){return new BPromise(function(_0x3fd376,_0x111531){try{if(_0x4b736a[_0x67a8('0x2f')]){_0x4b736a[_0x67a8('0x30')]=[];_0x4b736a[_0x67a8('0x2f')][_0x67a8('0x31')](',')[_0x67a8('0x32')](function(_0x114afb){_0x4b736a[_0x67a8('0x30')]['push'](_0x3a1c5c[_0x114afb]);});}delete _0x4b736a['TagIds'];}catch(_0x4a1b55){_0x111531(_0x4a1b55);}_0x3fd376(_0x4b736a);});}function updateSmsInteraction(_0x1d7759,_0x571ffa,_0x3a1942){return new BPromise(function(_0x1bb322,_0x9c2d6){return getInteractionUsers(_0x1d7759,_0x3a1942)[_0x67a8('0x28')](function(_0x5df099){return getInteractionTags(_0x5df099,_0x571ffa);})[_0x67a8('0x28')](function(_0x1f5d26){return getStateInteraction(_0x1f5d26);})[_0x67a8('0x28')](function(_0x35c59d){_0x1bb322(_0x35c59d);})[_0x67a8('0x33')](function(_0x20d319){_0x9c2d6(_0x20d319);});});}function getStateInteraction(_0xd4a26){return new BPromise(function(_0x294094){_0xd4a26[_0x67a8('0x34')]=0x0;_0xd4a26[_0x67a8('0x35')]=0x0;_0xd4a26['answered']=0x0;_0xd4a26[_0x67a8('0x36')]=0x0;_0xd4a26[_0x67a8('0x37')]=0x0;if(!_0xd4a26[_0x67a8('0x38')]&&!_0xd4a26[_0x67a8('0x39')]){_0xd4a26[_0x67a8('0x34')]+=0x1;}if(!_0xd4a26['closed']&&_0xd4a26[_0x67a8('0x39')]){_0xd4a26['talking']+=0x1;if(_0xd4a26[_0x67a8('0x34')]){_0xd4a26['waiting']-=0x1;}}if(_0xd4a26[_0x67a8('0x38')]&&_0xd4a26[_0x67a8('0x39')]){_0xd4a26['answered']+=0x1;if(_0xd4a26[_0x67a8('0x35')]){_0xd4a26[_0x67a8('0x35')]-=0x1;}}if(_0xd4a26[_0x67a8('0x38')]&&!_0xd4a26[_0x67a8('0x39')]){_0xd4a26[_0x67a8('0x36')]+=0x1;if(_0xd4a26['waiting']){_0xd4a26[_0x67a8('0x34')]-=0x1;}}_0xd4a26[_0x67a8('0x37')]+=0x1;_0x294094(_0xd4a26);});}exports['index']=function(_0x57c7ad,_0x2380a1){var _0x7376af={},_0x409b6d={},_0x17bf83={'count':0x0,'rows':[]};var _0x1494ef=_['map'](db[_0x67a8('0x3a')][_0x67a8('0x3b')],function(_0x5f2a6b){return{'name':_0x5f2a6b[_0x67a8('0x3c')],'type':_0x5f2a6b[_0x67a8('0x3d')][_0x67a8('0x3e')]};});_0x409b6d['model']=_[_0x67a8('0x3f')](_0x1494ef,'name');_0x409b6d['query']=_[_0x67a8('0x40')](_0x57c7ad['query']);_0x409b6d['filters']=_['intersection'](_0x409b6d[_0x67a8('0x41')],_0x409b6d[_0x67a8('0x42')]);_0x7376af[_0x67a8('0x43')]=_[_0x67a8('0x44')](_0x409b6d[_0x67a8('0x41')],qs[_0x67a8('0x45')](_0x57c7ad[_0x67a8('0x42')][_0x67a8('0x45')]));_0x7376af[_0x67a8('0x43')]=_0x7376af[_0x67a8('0x43')][_0x67a8('0x46')]?_0x7376af[_0x67a8('0x43')]:_0x409b6d[_0x67a8('0x41')];if(!_0x57c7ad[_0x67a8('0x42')][_0x67a8('0x47')](_0x67a8('0x48'))){_0x7376af[_0x67a8('0x22')]=qs['limit'](_0x57c7ad[_0x67a8('0x42')]['limit']);_0x7376af[_0x67a8('0x20')]=qs['offset'](_0x57c7ad[_0x67a8('0x42')][_0x67a8('0x20')]);}_0x7376af[_0x67a8('0x49')]=qs[_0x67a8('0x4a')](_0x57c7ad[_0x67a8('0x42')]['sort']);_0x7376af[_0x67a8('0x4b')]=qs[_0x67a8('0x4c')](_[_0x67a8('0x4d')](_0x57c7ad[_0x67a8('0x42')],_0x409b6d[_0x67a8('0x4c')]),_0x1494ef);var _0x188665=[];var _0x492c15=squel[_0x67a8('0x4e')]()[_0x67a8('0x4f')]('id')[_0x67a8('0x4f')]('name')[_0x67a8('0x4f')](_0x67a8('0x50'))[_0x67a8('0x51')](_0x67a8('0x52'));var _0x10dbb2=squel['select']()[_0x67a8('0x4f')]('u.id')['field']('u.fullname')[_0x67a8('0x4f')]('ui.SmsInteractionId')[_0x67a8('0x51')](_0x67a8('0x53'),'ui')[_0x67a8('0x54')](_0x67a8('0x55'),'u','u.id\x20=\x20ui.UserId');var _0x4ff38a=squel[_0x67a8('0x4e')]()['from'](_0x67a8('0x56'),'i')[_0x67a8('0x54')](_0x67a8('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x67a8('0x54')](_0x67a8('0x55'),'o',_0x67a8('0x58'))[_0x67a8('0x54')](_0x67a8('0x59'),'a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me',_0x67a8('0x5a'))[_0x67a8('0x54')]('sms_interaction_has_tags','it',_0x67a8('0x5b'))[_0x67a8('0x54')](_0x67a8('0x52'),'t',_0x67a8('0x5c'));var _0x2b2b87=squel['expr']();var _0x456b97=[];var _0x2db136=squel[_0x67a8('0x5d')]();var _0x25fe3c;if(_0x57c7ad[_0x67a8('0x42')][_0x67a8('0x5e')]){_0x25fe3c=as[_0x67a8('0x5f')](_0x57c7ad[_0x67a8('0x42')]['search']);var _0x414691=_0x25fe3c[_0x67a8('0x60')];for(var _0x419ab7=0x0;_0x419ab7<_0x25fe3c[_0x67a8('0x61')][_0x67a8('0x46')];_0x419ab7++){var _0x2babc7=_0x25fe3c[_0x67a8('0x61')][_0x419ab7];var _0x3928f1='i';var _0x33d9e7=_[_0x67a8('0x62')](_0x1494ef,[_0x67a8('0x2b'),_0x2babc7[_0x67a8('0x4f')]]);if(!_0x33d9e7){switch(_0x2babc7['field']){case _0x67a8('0x63'):if(_0x2babc7[_0x67a8('0x64')]==0x1){_0x4ff38a[_0x67a8('0x65')]('`'+_0x2babc7['field']+_0x67a8('0x66'));}else{_0x4ff38a[_0x67a8('0x65')]('`'+_0x2babc7[_0x67a8('0x4f')]+_0x67a8('0x67'));}break;case _0x67a8('0x68'):if(_0x2babc7[_0x67a8('0x69')]===_0x67a8('0x6a')){if(_0x2babc7['value'][_0x67a8('0x31')]('\x20')['length']>0x1){_0x2b2b87[_0x414691](_0x67a8('0x6b'),qs[_0x67a8('0x6c')](_0x2babc7[_0x67a8('0x64')]),null);}else{var _0x371ea0='%'+_0x2babc7['value']+'%';_0x2b2b87[_0x414691]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x371ea0,_0x371ea0,_0x371ea0);}}else{_0x33d9e7=_[_0x67a8('0x62')](_0x1494ef,[_0x67a8('0x2b'),_0x67a8('0x6d')]);_0x2babc7[_0x67a8('0x4f')]=_0x67a8('0x6d');_0x3dd7b2=as[_0x67a8('0x6e')](_0x3928f1,_0x33d9e7[_0x67a8('0x3d')],_0x2babc7);_0x2b2b87[_0x414691](_0x3dd7b2[_0x67a8('0x6f')],_0x3dd7b2[_0x67a8('0x64')]['start'],_0x3dd7b2[_0x67a8('0x64')][_0x67a8('0x70')]);}break;case _0x67a8('0x71'):var _0x2765f6=_0x2babc7[_0x67a8('0x64')][_0x67a8('0x31')](',')[_0x67a8('0x3f')](function(_0x55d359){return Number(_0x55d359);});_0x2765f6['forEach'](function(_0x208cd6){_0x2db136['or'](_0x67a8('0x72'),'%,'+_0x208cd6+',%');});_0x456b97=_['union'](_0x456b97,_0x2765f6);break;case _0x67a8('0x73'):if(_0x2babc7[_0x67a8('0x69')]==='$substring'){_0x2b2b87[_0x414691]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2babc7[_0x67a8('0x64')]+'%',null);}else{_0x33d9e7=_[_0x67a8('0x62')](_0x1494ef,[_0x67a8('0x2b'),'UserId']);_0x2babc7['field']=_0x67a8('0x39');_0x3dd7b2=as['buildExpression'](_0x3928f1,_0x33d9e7['type'],_0x2babc7);_0x2b2b87[_0x414691](_0x3dd7b2[_0x67a8('0x6f')],_0x3dd7b2[_0x67a8('0x64')][_0x67a8('0x74')],_0x3dd7b2['value'][_0x67a8('0x70')]);}break;case _0x67a8('0x75'):_0x3dd7b2=as[_0x67a8('0x6e')]('me',null,_0x2babc7);_0x2b2b87[_0x414691](_0x3dd7b2[_0x67a8('0x6f')],_0x3dd7b2[_0x67a8('0x64')][_0x67a8('0x74')],_0x3dd7b2[_0x67a8('0x64')][_0x67a8('0x70')]);break;}}else{var _0x3dd7b2=as[_0x67a8('0x6e')](_0x3928f1,_0x33d9e7[_0x67a8('0x3d')],_0x2babc7);_0x2b2b87[_0x414691](_0x3dd7b2[_0x67a8('0x6f')],_0x3dd7b2[_0x67a8('0x64')][_0x67a8('0x74')],_0x3dd7b2[_0x67a8('0x64')][_0x67a8('0x70')]);}}}else{var _0x59faa0=_(_0x57c7ad[_0x67a8('0x42')])[_0x67a8('0x40')]()[_0x67a8('0x3f')](function(_0x2d9c9d){return _['some'](_0x1494ef,[_0x67a8('0x2b'),_0x2d9c9d])?_0x2d9c9d:undefined;})[_0x67a8('0x76')]()[_0x67a8('0x64')]();if(!_[_0x67a8('0x77')](_0x59faa0)){_0x59faa0[_0x67a8('0x32')](function(_0x15be7f){if(_0x15be7f===_0x67a8('0x78')){_0x4ff38a['where'](_0x67a8('0x79'),[][_0x67a8('0x7a')](_0x57c7ad[_0x67a8('0x42')][_0x15be7f]));}else if(_0x15be7f==='createdAt'){var _0x29a060=JSON[_0x67a8('0x7b')](_0x57c7ad[_0x67a8('0x42')][_0x15be7f])[_0x67a8('0x7c')];var _0x37131b=JSON[_0x67a8('0x7b')](_0x57c7ad[_0x67a8('0x42')][_0x15be7f])[_0x67a8('0x7d')];_0x4ff38a[_0x67a8('0x4b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x29a060,_0x37131b);}else{if(_0x57c7ad[_0x67a8('0x42')][_0x15be7f]===_0x67a8('0x7e')){_0x4ff38a[_0x67a8('0x4b')]('i.'+_0x15be7f+_0x67a8('0x7f'));}else{_0x4ff38a['where']('i.'+_0x15be7f+_0x67a8('0x80'),_0x57c7ad['query'][_0x15be7f]);}}});}if(_0x57c7ad[_0x67a8('0x42')]['read']){if(_0x57c7ad[_0x67a8('0x42')][_0x67a8('0x81')]==0x1){_0x4ff38a[_0x67a8('0x65')](_0x67a8('0x82'));}else{_0x4ff38a[_0x67a8('0x65')](_0x67a8('0x83'));}}if(_0x57c7ad['query']['tag']){_0x456b97=_['isArray'](_0x57c7ad[_0x67a8('0x42')][_0x67a8('0x84')])?_0x57c7ad[_0x67a8('0x42')]['tag']:new Array(_0x57c7ad['query'][_0x67a8('0x84')]);_0x456b97[_0x67a8('0x32')](function(_0x3da316){_0x2db136['or'](_0x67a8('0x72'),'%,'+_0x3da316+',%');});}if(_0x57c7ad['query'][_0x67a8('0x85')]){var _0x22b355=_0x57c7ad[_0x67a8('0x42')]['filter'][_0x67a8('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x67a8('0x87')](_0x22b355)){_0x2b2b87['or']('i.id\x20LIKE\x20?',_0x22b355+'%')['or']('i.phone\x20LIKE\x20?',_0x22b355+'%');}else{_0x2b2b87['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x22b355))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x22b355+'%');}}}_0x4ff38a['where'](_0x2b2b87);_0x4ff38a[_0x67a8('0x88')](_0x67a8('0x89'));var _0x5f1c85={'type':db['Sequelize'][_0x67a8('0x8a')][_0x67a8('0x8b')],'raw':!![]};var _0x2eb2f5=_0x4ff38a[_0x67a8('0x8c')]();_0x2eb2f5['field'](_0x67a8('0x89'));_0x2eb2f5[_0x67a8('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x7376af[_0x67a8('0x49')]){_0x7376af[_0x67a8('0x49')][_0x67a8('0x32')](function(_0xd4ffc5){var _0x3d7ff0=_0xd4ffc5[0x0]===_0x67a8('0x8d')?_0xd4ffc5[0x0]:'i.'+_0xd4ffc5[0x0];_0x4ff38a[_0x67a8('0x49')](_0x3d7ff0,_0xd4ffc5[0x1]===_0x67a8('0x8e')?![]:!![]);});}if(!_[_0x67a8('0x77')](_0x456b97)){_0x4ff38a[_0x67a8('0x65')](_0x2db136);_0x2eb2f5[_0x67a8('0x4b')](_0x67a8('0x8f'),_0x456b97);}BPromise[_0x67a8('0x90')]()[_0x67a8('0x28')](function(){if(!_0x25fe3c){if(_0x57c7ad['query'][_0x67a8('0x78')])return;_0x2eb2f5[_0x67a8('0x4b')](_0x67a8('0x91'));_0x4ff38a[_0x67a8('0x4b')](_0x67a8('0x91'));return;}if(_0x57c7ad[_0x67a8('0x92')][_0x67a8('0x93')]!==_0x67a8('0x94'))return;return _0x57c7ad[_0x67a8('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x67a8('0x28')](function(_0x2c2434){if(_[_0x67a8('0x77')](_0x2c2434)){_0x2eb2f5['where'](_0x67a8('0x95'));_0x4ff38a['where'](_0x67a8('0x95'));}else{_0x2eb2f5[_0x67a8('0x4b')](_0x67a8('0x79'),_['map'](_0x2c2434,'id'));_0x4ff38a['where'](_0x67a8('0x79'),_[_0x67a8('0x3f')](_0x2c2434,'id'));}});})['then'](function(){if(_0x57c7ad[_0x67a8('0x92')][_0x67a8('0x93')]==='agent'&&!_0x25fe3c&&!_0x57c7ad['query']['SmsAccountId'])return[];return db[_0x67a8('0x96')][_0x67a8('0x42')](_0x2eb2f5['toString'](),_0x5f1c85);})[_0x67a8('0x28')](function(_0x338cc4){_0x17bf83[_0x67a8('0x23')]=_0x338cc4[_0x67a8('0x46')];if(_0x17bf83[_0x67a8('0x23')]===0x0)return[];return db[_0x67a8('0x96')][_0x67a8('0x42')](_0x492c15[_0x67a8('0x97')](),_0x5f1c85)['then'](function(_0x6b6be8){_0x188665=_[_0x67a8('0x98')](_0x6b6be8,'id');_0x5f1c85=_[_0x67a8('0x99')](_0x5f1c85,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57c7ad[_0x67a8('0x42')][_0x67a8('0x45')]){_0x7376af[_0x67a8('0x43')][_0x67a8('0x32')](function(_0x271140){_0x4ff38a[_0x67a8('0x4f')]('i.'+_0x271140);});}else{_0x4ff38a[_0x67a8('0x4f')](_0x67a8('0x9a'),_0x67a8('0x63'));_0x4ff38a[_0x67a8('0x4f')]('a.key',_0x67a8('0x9b'));_0x4ff38a[_0x67a8('0x4f')]('a.mandatoryDisposition',_0x67a8('0x9c'));_0x4ff38a[_0x67a8('0x4f')]('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',_0x67a8('0x8d'));_0x4ff38a['field']('i.*');_0x4ff38a[_0x67a8('0x4f')](_0x67a8('0x9d'),'Contact.firstName');_0x4ff38a[_0x67a8('0x4f')]('c.lastName',_0x67a8('0x9e'));_0x4ff38a[_0x67a8('0x4f')](_0x67a8('0x9f'),_0x67a8('0xa0'));_0x4ff38a['field'](_0x67a8('0xa1'),'Contact.phone');_0x4ff38a[_0x67a8('0x4f')](_0x67a8('0xa2'),_0x67a8('0xa3'));_0x4ff38a[_0x67a8('0x4f')](_0x67a8('0xa4'),_0x67a8('0xa5'));_0x4ff38a[_0x67a8('0x4f')](_0x67a8('0xa6'),'Owner.fullname');_0x4ff38a[_0x67a8('0x4f')]('o.internal','Owner.internal');_0x4ff38a[_0x67a8('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x7376af[_0x67a8('0x22')])_0x4ff38a[_0x67a8('0x22')](_0x7376af[_0x67a8('0x22')]);if(_0x7376af['offset'])_0x4ff38a[_0x67a8('0x20')](_0x7376af['offset']);return db['sequelize'][_0x67a8('0x42')](_0x4ff38a[_0x67a8('0x97')](),_0x5f1c85);})[_0x67a8('0x28')](function(_0xffd03e){if(_0xffd03e[_0x67a8('0x46')]>0x0)_0x10dbb2[_0x67a8('0x4b')](_0x67a8('0xa7'),_[_0x67a8('0x3f')](_0xffd03e,'id'));return db['sequelize']['query'](_0x10dbb2[_0x67a8('0x97')](),_0x5f1c85)[_0x67a8('0x28')](function(_0x42ea17){var _0x1a8082=_['groupBy'](_0x42ea17,_0x67a8('0xa8'));var _0x2da55d=[];_0xffd03e[_0x67a8('0x32')](function(_0x19180b){_0x2da55d[_0x67a8('0xa9')](updateSmsInteraction(_0x19180b,_0x188665,_0x1a8082));});return BPromise[_0x67a8('0xaa')](_0x2da55d);});});})[_0x67a8('0x28')](function(_0x352633){_0x17bf83[_0x67a8('0xab')]=_0x352633;return _0x17bf83;})[_0x67a8('0x28')](respondWithFilteredResult(_0x2380a1,_0x7376af))[_0x67a8('0x33')](handleError(_0x2380a1,null));};exports[_0x67a8('0xac')]=function(_0x1c1824,_0x23beaa){var _0x1fa8bb={'raw':![],'where':{'id':_0x1c1824[_0x67a8('0xad')]['id']}},_0x4b5822={};_0x4b5822[_0x67a8('0x41')]=_[_0x67a8('0x40')](db[_0x67a8('0x3a')][_0x67a8('0x3b')]);_0x4b5822[_0x67a8('0x42')]=_[_0x67a8('0x40')](_0x1c1824[_0x67a8('0x42')]);_0x4b5822[_0x67a8('0x4c')]=_[_0x67a8('0x44')](_0x4b5822[_0x67a8('0x41')],_0x4b5822[_0x67a8('0x42')]);_0x1fa8bb[_0x67a8('0x43')]=_[_0x67a8('0x44')](_0x4b5822[_0x67a8('0x41')],qs[_0x67a8('0x45')](_0x1c1824[_0x67a8('0x42')][_0x67a8('0x45')]));_0x1fa8bb['attributes']=_0x1fa8bb[_0x67a8('0x43')][_0x67a8('0x46')]?_0x1fa8bb[_0x67a8('0x43')]:_0x4b5822['model'];if(_0x1c1824[_0x67a8('0x42')][_0x67a8('0xae')]){_0x1fa8bb[_0x67a8('0xaf')]=[{'all':!![]}];}_0x1fa8bb=_[_0x67a8('0x99')]({},_0x1fa8bb,_0x1c1824[_0x67a8('0xb0')]);return db[_0x67a8('0x3a')][_0x67a8('0x62')](_0x1fa8bb)['then'](handleEntityNotFound(_0x23beaa,null))[_0x67a8('0x28')](respondWithResult(_0x23beaa,null))['catch'](handleError(_0x23beaa,null));};exports[_0x67a8('0xb1')]=function(_0x3af947,_0x31cca1){return db[_0x67a8('0x3a')][_0x67a8('0xb1')](_0x3af947['body'],{})[_0x67a8('0x28')](respondWithResult(_0x31cca1,0xc9))['catch'](handleError(_0x31cca1,null));};exports[_0x67a8('0xb2')]=function(_0x2c4cea,_0x240584){if(_0x2c4cea['body']['id']){delete _0x2c4cea[_0x67a8('0x75')]['id'];}return db[_0x67a8('0x3a')][_0x67a8('0x62')]({'where':{'id':_0x2c4cea[_0x67a8('0xad')]['id']}})[_0x67a8('0x28')](handleEntityNotFound(_0x240584,null))[_0x67a8('0x28')](saveUpdates(_0x2c4cea[_0x67a8('0x75')],null))[_0x67a8('0x28')](respondWithResult(_0x240584,null))[_0x67a8('0x33')](handleError(_0x240584,null));};exports[_0x67a8('0xb3')]=function(_0x24b9dc,_0x4ac885){return db['SmsInteraction']['find']({'where':{'id':_0x24b9dc[_0x67a8('0xad')]['id']}})['then'](handleEntityNotFound(_0x4ac885,null))[_0x67a8('0x28')](removeEntity(_0x4ac885,null))[_0x67a8('0x33')](handleError(_0x4ac885,null));};exports[_0x67a8('0xb4')]=function(_0x21cb4f,_0x33e8fd){return db['SmsInteraction'][_0x67a8('0xb4')]()[_0x67a8('0x28')](respondWithResult(_0x33e8fd,null))[_0x67a8('0x33')](handleError(_0x33e8fd,null));};exports[_0x67a8('0xb5')]=function(_0x16674f,_0x4d75d2,_0x2bc809){return db[_0x67a8('0xb6')][_0x67a8('0x62')]({'where':{'id':_0x16674f[_0x67a8('0xad')]['id']}})[_0x67a8('0x28')](handleEntityNotFound(_0x4d75d2,null))[_0x67a8('0x28')](function(_0x323c86){if(_0x323c86){return _0x323c86[_0x67a8('0xb5')](_0x16674f[_0x67a8('0x75')][_0x67a8('0xb7')],_[_0x67a8('0xb8')](_0x16674f[_0x67a8('0x75')],['ids','id'])||{});}})[_0x67a8('0x28')](respondWithResult(_0x4d75d2,null))[_0x67a8('0x33')](handleError(_0x4d75d2,null));};exports[_0x67a8('0xb9')]=function(_0x4a0ef9,_0x535c79,_0x494b10){var _0x51fb3c={'raw':![],'where':{}};var _0x2152d3={};var _0x5e0d2b={'count':0x0,'rows':[]};return db[_0x67a8('0x3a')][_0x67a8('0xba')]({'where':{'id':_0x4a0ef9[_0x67a8('0xad')]['id']}})[_0x67a8('0x28')](handleEntityNotFound(_0x535c79,null))[_0x67a8('0x28')](function(_0x4705ea){if(_0x4705ea){_0x2152d3['model']=_[_0x67a8('0x40')](db['SmsMessage'][_0x67a8('0x3b')]);_0x2152d3['query']=_[_0x67a8('0x40')](_0x4a0ef9[_0x67a8('0x42')]);_0x2152d3[_0x67a8('0x4c')]=_[_0x67a8('0x44')](_0x2152d3['model'],_0x2152d3[_0x67a8('0x42')]);_0x51fb3c[_0x67a8('0x43')]=_['intersection'](_0x2152d3[_0x67a8('0x41')],qs['fields'](_0x4a0ef9[_0x67a8('0x42')]['fields']));_0x51fb3c[_0x67a8('0x43')]=_0x51fb3c['attributes'][_0x67a8('0x46')]?_0x51fb3c[_0x67a8('0x43')]:_0x2152d3[_0x67a8('0x41')];if(!_0x4a0ef9['query'][_0x67a8('0x47')](_0x67a8('0x48'))){_0x51fb3c[_0x67a8('0x22')]=qs[_0x67a8('0x22')](_0x4a0ef9['query'][_0x67a8('0x22')]);_0x51fb3c[_0x67a8('0x20')]=qs[_0x67a8('0x20')](_0x4a0ef9[_0x67a8('0x42')][_0x67a8('0x20')]);}_0x51fb3c['order']=qs['sort'](_0x4a0ef9[_0x67a8('0x42')][_0x67a8('0x4a')]);_0x51fb3c[_0x67a8('0x4b')]=qs[_0x67a8('0x4c')](_[_0x67a8('0x4d')](_0x4a0ef9[_0x67a8('0x42')],_0x2152d3[_0x67a8('0x4c')]));_0x51fb3c[_0x67a8('0x4b')][_0x67a8('0xa8')]=_0x4705ea['id'];if(_0x4a0ef9[_0x67a8('0x42')][_0x67a8('0x85')]){_0x51fb3c[_0x67a8('0x4b')]=_[_0x67a8('0x99')](_0x51fb3c[_0x67a8('0x4b')],{'$or':_[_0x67a8('0x3f')](_0x51fb3c[_0x67a8('0x43')],function(_0x4d89ec){var _0x388b0a={};_0x388b0a[_0x4d89ec]={'$like':'%'+_0x4a0ef9[_0x67a8('0x42')][_0x67a8('0x85')]+'%'};return _0x388b0a;})});}if(_0x4a0ef9[_0x67a8('0x42')][_0x67a8('0x7c')]){var _0x55cb02=_0x4a0ef9['query'][_0x67a8('0x7c')][_0x67a8('0x31')](',');var _0x568324={};_0x568324[_0x55cb02[0x0]]={'$gte':moment(_0x55cb02[0x1])[_0x67a8('0xbb')](_0x67a8('0xbc'))};_0x51fb3c[_0x67a8('0x4b')]=_[_0x67a8('0x99')](_0x51fb3c[_0x67a8('0x4b')],_0x568324);}_0x51fb3c=_[_0x67a8('0x99')]({},_0x51fb3c,_0x4a0ef9[_0x67a8('0xb0')]);return db[_0x67a8('0xb6')][_0x67a8('0x23')]({'where':_0x51fb3c['where']})[_0x67a8('0x28')](function(_0x245559){_0x5e0d2b[_0x67a8('0x23')]=_0x245559;if(_0x4a0ef9[_0x67a8('0x42')][_0x67a8('0xae')]){_0x51fb3c[_0x67a8('0xaf')]=[{'all':!![]}];}return db[_0x67a8('0xb6')][_0x67a8('0xbd')](_0x51fb3c);})['then'](function(_0xd49180){_0x5e0d2b[_0x67a8('0xab')]=_0xd49180;return _0x5e0d2b;});}})[_0x67a8('0x28')](respondWithFilteredResult(_0x535c79,_0x51fb3c))[_0x67a8('0x33')](handleError(_0x535c79,null));};exports[_0x67a8('0xbe')]=function(_0x19bc70,_0xdca005,_0x179101){return db[_0x67a8('0x3a')][_0x67a8('0x62')]({'where':{'id':_0x19bc70[_0x67a8('0xad')]['id']}})['then'](handleEntityNotFound(_0xdca005,null))[_0x67a8('0x28')](function(_0x41e655){if(_0x41e655){return _0x41e655['setTags'](_0x19bc70[_0x67a8('0x75')]['ids'],_[_0x67a8('0xb8')](_0x19bc70['body'],[_0x67a8('0xb7'),'id'])||{})[_0x67a8('0xbf')](function(){return db[_0x67a8('0x71')][_0x67a8('0xbd')]({'attributes':['id','name',_0x67a8('0x50')],'where':{'id':_0x19bc70[_0x67a8('0x75')][_0x67a8('0xb7')]}});})['then'](function(_0x1cb31f){socket[_0x67a8('0xc0')]('smsInteractionTags:save',{'id':Number(_0x19bc70[_0x67a8('0xad')]['id']),'tags':_0x1cb31f||[]});return{'id':Number(_0x19bc70['params']['id']),'tags':_0x1cb31f||[]};});}})[_0x67a8('0x28')](respondWithResult(_0xdca005,null))[_0x67a8('0x33')](handleError(_0xdca005,null));};exports['removeTags']=function(_0x2363ca,_0xef7f79,_0x35225c){return db['SmsInteraction'][_0x67a8('0x62')]({'where':{'id':_0x2363ca[_0x67a8('0xad')]['id']}})[_0x67a8('0x28')](handleEntityNotFound(_0xef7f79,null))[_0x67a8('0x28')](function(_0x2462df){if(_0x2462df){return _0x2462df[_0x67a8('0xc1')](_0x2363ca[_0x67a8('0x42')][_0x67a8('0xb7')]);}})[_0x67a8('0x28')](respondWithStatusCode(_0xef7f79,null))[_0x67a8('0x33')](handleError(_0xef7f79,null));};exports[_0x67a8('0xc2')]=function(_0x4959ea,_0x58fdbe){var _0x2e1244=moment()[_0x67a8('0xc3')]()[_0x67a8('0x97')]();var _0x2b5386=path['join'](config[_0x67a8('0xc4')],_0x67a8('0xc5'),'files',_0x67a8('0xc6'));var _0x3d7f91=path[_0x67a8('0xc7')](config['root'],_0x67a8('0xc5'),_0x67a8('0xc8'),_0x67a8('0xc9'));var _0x322904=path[_0x67a8('0xc7')](_0x2b5386,_0x2e1244);var _0x3b8ded=util['format'](_0x67a8('0xca'),_0x4959ea[_0x67a8('0xad')]['id'],_0x2e1244);var _0x1180fe=path['join'](_0x2b5386,_0x3b8ded);var _0x13f300=[];_0x13f300[_0x67a8('0xa9')]({'model':db[_0x67a8('0x73')],'as':'User','attributes':['id',_0x67a8('0x2e')],'raw':!![]});_0x13f300[_0x67a8('0xa9')]({'model':db['CmContact'],'as':_0x67a8('0x68'),'attributes':['id','firstName',_0x67a8('0xcb')],'raw':!![]});var _0x3e6999=[{'model':db[_0x67a8('0xb6')],'as':_0x67a8('0xcc'),'attributes':['id',_0x67a8('0x75'),_0x67a8('0xcd'),_0x67a8('0xce'),_0x67a8('0xcf'),_0x67a8('0x81')],'include':_0x13f300}];_0x3e6999['push']({'model':db[_0x67a8('0xd0')],'as':'Account','attributes':['id',_0x67a8('0x2b')]});_0x3e6999[_0x67a8('0xa9')]({'model':db['User'],'as':_0x67a8('0xd1'),'attributes':['id',_0x67a8('0x2e')]});return db[_0x67a8('0x3a')][_0x67a8('0x62')]({'where':{'id':_0x4959ea[_0x67a8('0xad')]['id']},'include':_0x3e6999})['then'](handleEntityNotFound(_0x58fdbe,null))[_0x67a8('0x28')](function(_0x5865b1){if(_0x5865b1){var _0x17fece=_0x5865b1[_0x67a8('0xd2')]({'plain':!![]});fs[_0x67a8('0xd3')](_0x322904);var _0x288338={'channel':'Sms','account':_0x17fece[_0x67a8('0xd4')][_0x67a8('0x2b')],'agent':_0x17fece[_0x67a8('0xd1')]?_0x17fece[_0x67a8('0xd1')][_0x67a8('0x2e')]:_0x67a8('0xd5'),'createdAt':moment(_0x17fece[_0x67a8('0xcd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x67a8('0x97')](),'closedAt':_0x17fece['closed']?moment(_0x17fece[_0x67a8('0xd6')])[_0x67a8('0xbb')](_0x67a8('0xbc'))[_0x67a8('0x97')]():'','disposition':_0x17fece[_0x67a8('0xd7')],'messages':_(_0x17fece[_0x67a8('0xcc')])[_0x67a8('0x85')]({'secret':![]})[_0x67a8('0x3f')](function(_0x5dd307){return{'date':moment(_0x5dd307[_0x67a8('0xcd')])['format'](_0x67a8('0xbc'))['toString'](),'sender':_0x5dd307[_0x67a8('0xce')]==='out'?_0x5dd307['User']?_0x5dd307['User'][_0x67a8('0x2e')]:'System':_0x5dd307[_0x67a8('0x68')]['firstName']+(_0x5dd307[_0x67a8('0x68')][_0x67a8('0xcb')]?'\x20'+_0x5dd307[_0x67a8('0x68')][_0x67a8('0xcb')]:''),'body':_0x5dd307[_0x67a8('0x75')],'direction':_0x5dd307[_0x67a8('0xce')]===_0x67a8('0xd8')?'A':'C','secret':_0x5dd307['secret'],'read':_0x5dd307['read']};})['value']()};return ejs[_0x67a8('0xd9')](path['join'](config['root'],_0x67a8('0xc5'),_0x67a8('0xda'),_0x67a8('0xdb')),{'interaction':_0x288338})[_0x67a8('0x28')](function(_0x44fb2c){var _0x318edd=path[_0x67a8('0xc7')](_0x322904,_0x67a8('0xdc')+_0x17fece['id']+'-'+_0x2e1244+'.pdf');var _0x199314={'path':_0x318edd,'channel':_0x67a8('0xdd'),'interactionId':_0x17fece['id']};return pdf['createPdfFromHTML'](_0x44fb2c,_0x199314);})[_0x67a8('0x28')](function(){return new BPromise(function(_0x2c6263,_0x25a252){zipdir(_0x322904,{'saveTo':_0x1180fe},function(_0x5a66e5,_0xaf7807){if(_0x5a66e5)return _0x25a252(_0x5a66e5);return _0x2c6263(_0xaf7807);});})[_0x67a8('0x28')](function(){return new BPromise(function(_0x1d2cdd,_0x11d8b8){rimraf(_0x322904,function(_0x333f7f){if(_0x333f7f)_0x11d8b8(_0x333f7f);return _0x1d2cdd();});});})[_0x67a8('0x28')](function(){return _0x58fdbe[_0x67a8('0xc2')](_0x1180fe,_0x3b8ded,function(_0x11af43){if(_0x11af43){console[_0x67a8('0xde')]('err',_0x11af43);}else{fs[_0x67a8('0xdf')](_0x1180fe);}});});});}else{return _0x58fdbe[_0x67a8('0x1d')](0xc8);}})[_0x67a8('0x33')](handleError(_0x58fdbe,null));}; \ No newline at end of file +var _0x44da=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','split','union','User','body','compact','isEmpty','forEach','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','merge','options','create','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','rawAttributes','SmsInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','removeTags','download','unix','root','server','files','tmp','attachments','join','format','transcript-%d-%s.zip','CmContact','lastName','Messages','secret','SmsAccount','Account','Owner','get','N.A.','closedAt','disposition','direction','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util'];(function(_0x3f5f08,_0x1ccd7f){var _0x566dd9=function(_0x952e6a){while(--_0x952e6a){_0x3f5f08['push'](_0x3f5f08['shift']());}};_0x566dd9(++_0x1ccd7f);}(_0x44da,0x1d9));var _0xa44d=function(_0x2e1e46,_0x5f4cf0){_0x2e1e46=_0x2e1e46-0x0;var _0x4bf4f6=_0x44da[_0x2e1e46];return _0x4bf4f6;};'use strict';var emlformat=require(_0xa44d('0x0'));var rimraf=require(_0xa44d('0x1'));var zipdir=require(_0xa44d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa44d('0x3'));var BPromise=require(_0xa44d('0x4'));var Mustache=require(_0xa44d('0x5'));var util=require(_0xa44d('0x6'));var path=require(_0xa44d('0x7'));var sox=require(_0xa44d('0x8'));var csv=require(_0xa44d('0x9'));var ejs=require(_0xa44d('0xa'));var fs=require('fs');var fs_extra=require(_0xa44d('0xb'));var _=require(_0xa44d('0xc'));var squel=require(_0xa44d('0xd'));var crypto=require(_0xa44d('0xe'));var jsforce=require(_0xa44d('0xf'));var deskjs=require(_0xa44d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa44d('0x11'));var Papa=require('papaparse');var Redis=require(_0xa44d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa44d('0x13'));var as=require(_0xa44d('0x14'));var pdf=require(_0xa44d('0x15'));var hardwareService=require(_0xa44d('0x16'));var logger=require(_0xa44d('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xa44d('0x18'));var licenseUtil=require(_0xa44d('0x19'));var db=require(_0xa44d('0x1a'))['db'];config['redis']=_[_0xa44d('0x1b')](config[_0xa44d('0x1c')],{'host':_0xa44d('0x1d'),'port':0x18eb});var socket=require(_0xa44d('0x1e'))(new Redis(config[_0xa44d('0x1c')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4add1e,_0x54f93e){_0x54f93e=_0x54f93e||0xcc;return function(_0x192d07){if(_0x192d07){return _0x4add1e[_0xa44d('0x1f')](_0x54f93e);}return _0x4add1e[_0xa44d('0x20')](_0x54f93e)[_0xa44d('0x21')]();};}function respondWithResult(_0x303cce,_0x16fdc0){_0x16fdc0=_0x16fdc0||0xc8;return function(_0x516bcd){if(_0x516bcd){return _0x303cce[_0xa44d('0x20')](_0x16fdc0)[_0xa44d('0x22')](_0x516bcd);}};}function respondWithFilteredResult(_0x528072,_0x308b0c){return function(_0x53af37){if(_0x53af37){var _0x125397=typeof _0x308b0c['offset']===_0xa44d('0x23')&&typeof _0x308b0c[_0xa44d('0x24')]===_0xa44d('0x23');var _0x36c933=_0x53af37[_0xa44d('0x25')];var _0x5c8795=_0x125397?0x0:_0x308b0c[_0xa44d('0x26')];var _0x7e98d7=_0x125397?_0x53af37[_0xa44d('0x25')]:_0x308b0c['offset']+_0x308b0c[_0xa44d('0x24')];var _0x28b0f9;if(_0x7e98d7>=_0x36c933){_0x7e98d7=_0x36c933;_0x28b0f9=0xc8;}else{_0x28b0f9=0xce;}_0x528072[_0xa44d('0x20')](_0x28b0f9);return _0x528072['set']('Content-Range',_0x5c8795+'-'+_0x7e98d7+'/'+_0x36c933)[_0xa44d('0x22')](_0x53af37);}return null;};}function patchUpdates(_0x29073b){return function(_0x1bc443){try{jsonpatch[_0xa44d('0x27')](_0x1bc443,_0x29073b,!![]);}catch(_0x5d4f07){return BPromise[_0xa44d('0x28')](_0x5d4f07);}return _0x1bc443['save']();};}function saveUpdates(_0x4e4519,_0x3585aa){return function(_0x57608b){if(_0x57608b){return _0x57608b[_0xa44d('0x29')](_0x4e4519)[_0xa44d('0x2a')](function(_0xadb98a){return _0xadb98a;});}return null;};}function removeEntity(_0x4e0304,_0x1734a8){return function(_0x576c20){if(_0x576c20){return _0x576c20[_0xa44d('0x2b')]()[_0xa44d('0x2a')](function(){_0x4e0304[_0xa44d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d925,_0xe2568b){return function(_0x334408){if(!_0x334408){_0x45d925[_0xa44d('0x1f')](0x194);}return _0x334408;};}function handleError(_0x513822,_0x365a0e){_0x365a0e=_0x365a0e||0x1f4;return function(_0x204139){logger[_0xa44d('0x2c')](_0x204139[_0xa44d('0x2d')]);if(_0x204139['name']){delete _0x204139[_0xa44d('0x2e')];}_0x513822['status'](_0x365a0e)[_0xa44d('0x2f')](_0x204139);};}function getInteractionUsers(_0xc8abb,_0x5f08e7){return new BPromise(function(_0x27412a,_0x289001){try{if(_0x5f08e7[_0xc8abb['id']]){_0xc8abb[_0xa44d('0x30')]=_[_0xa44d('0x31')](_0x5f08e7[_0xc8abb['id']],function(_0x417707){return{'id':_0x417707['id'],'fullname':_0x417707[_0xa44d('0x32')]};});}}catch(_0x300c36){_0x289001(_0x300c36);}_0x27412a(_0xc8abb);});}function getInteractionTags(_0x3f4606,_0x26e399){return new BPromise(function(_0x3d33c2,_0x39e554){try{if(_0x3f4606[_0xa44d('0x33')]){_0x3f4606[_0xa44d('0x34')]=[];_0x3f4606[_0xa44d('0x33')]['split'](',')['forEach'](function(_0x45c29f){_0x3f4606[_0xa44d('0x34')][_0xa44d('0x35')](_0x26e399[_0x45c29f]);});}delete _0x3f4606[_0xa44d('0x33')];}catch(_0x39441c){_0x39e554(_0x39441c);}_0x3d33c2(_0x3f4606);});}function updateSmsInteraction(_0x495a65,_0x48ed95,_0xcda992){return new BPromise(function(_0x898355,_0x2a674f){return getInteractionUsers(_0x495a65,_0xcda992)[_0xa44d('0x2a')](function(_0x3a5ec3){return getInteractionTags(_0x3a5ec3,_0x48ed95);})[_0xa44d('0x2a')](function(_0x184b9d){return getStateInteraction(_0x184b9d);})['then'](function(_0x45abcc){_0x898355(_0x45abcc);})[_0xa44d('0x36')](function(_0x2dc072){_0x2a674f(_0x2dc072);});});}function getStateInteraction(_0x44d76c){return new BPromise(function(_0x192926){_0x44d76c[_0xa44d('0x37')]=0x0;_0x44d76c[_0xa44d('0x38')]=0x0;_0x44d76c[_0xa44d('0x39')]=0x0;_0x44d76c[_0xa44d('0x3a')]=0x0;_0x44d76c[_0xa44d('0x3b')]=0x0;if(!_0x44d76c[_0xa44d('0x3c')]&&!_0x44d76c[_0xa44d('0x3d')]){_0x44d76c[_0xa44d('0x37')]+=0x1;}if(!_0x44d76c[_0xa44d('0x3c')]&&_0x44d76c['UserId']){_0x44d76c[_0xa44d('0x38')]+=0x1;if(_0x44d76c[_0xa44d('0x37')]){_0x44d76c[_0xa44d('0x37')]-=0x1;}}if(_0x44d76c['closed']&&_0x44d76c[_0xa44d('0x3d')]){_0x44d76c[_0xa44d('0x39')]+=0x1;if(_0x44d76c['talking']){_0x44d76c[_0xa44d('0x38')]-=0x1;}}if(_0x44d76c[_0xa44d('0x3c')]&&!_0x44d76c[_0xa44d('0x3d')]){_0x44d76c[_0xa44d('0x3a')]+=0x1;if(_0x44d76c['waiting']){_0x44d76c[_0xa44d('0x37')]-=0x1;}}_0x44d76c['total']+=0x1;_0x192926(_0x44d76c);});}exports[_0xa44d('0x3e')]=function(_0x5b76c0,_0x479288){var _0x522369={},_0x71103d={},_0x425c37={'count':0x0,'rows':[]};var _0x17cf49=_[_0xa44d('0x31')](db[_0xa44d('0x3f')]['rawAttributes'],function(_0x476738){return{'name':_0x476738[_0xa44d('0x40')],'type':_0x476738[_0xa44d('0x41')][_0xa44d('0x42')]};});_0x71103d['model']=_[_0xa44d('0x31')](_0x17cf49,_0xa44d('0x2e'));_0x71103d[_0xa44d('0x43')]=_[_0xa44d('0x44')](_0x5b76c0[_0xa44d('0x43')]);_0x71103d[_0xa44d('0x45')]=_[_0xa44d('0x46')](_0x71103d[_0xa44d('0x47')],_0x71103d[_0xa44d('0x43')]);_0x522369[_0xa44d('0x48')]=_[_0xa44d('0x46')](_0x71103d[_0xa44d('0x47')],qs['fields'](_0x5b76c0['query'][_0xa44d('0x49')]));_0x522369[_0xa44d('0x48')]=_0x522369[_0xa44d('0x48')][_0xa44d('0x4a')]?_0x522369[_0xa44d('0x48')]:_0x71103d[_0xa44d('0x47')];if(!_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x4b')](_0xa44d('0x4c'))){_0x522369[_0xa44d('0x24')]=qs[_0xa44d('0x24')](_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x24')]);_0x522369[_0xa44d('0x26')]=qs[_0xa44d('0x26')](_0x5b76c0['query'][_0xa44d('0x26')]);}_0x522369['order']=qs[_0xa44d('0x4d')](_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x4d')]);_0x522369[_0xa44d('0x4e')]=qs[_0xa44d('0x45')](_['pick'](_0x5b76c0[_0xa44d('0x43')],_0x71103d['filters']),_0x17cf49);var _0x4bf353=[];var _0x1dcd20=squel['select']()[_0xa44d('0x4f')]('id')[_0xa44d('0x4f')](_0xa44d('0x2e'))[_0xa44d('0x4f')](_0xa44d('0x50'))[_0xa44d('0x51')](_0xa44d('0x52'));var _0xbeb000=squel[_0xa44d('0x53')]()['field']('u.id')[_0xa44d('0x4f')](_0xa44d('0x54'))[_0xa44d('0x4f')](_0xa44d('0x55'))[_0xa44d('0x51')](_0xa44d('0x56'),'ui')[_0xa44d('0x57')](_0xa44d('0x58'),'u',_0xa44d('0x59'));var _0x300b46=squel[_0xa44d('0x53')]()['from'](_0xa44d('0x5a'),'i')[_0xa44d('0x57')](_0xa44d('0x5b'),'c',_0xa44d('0x5c'))['left_join']('users','o',_0xa44d('0x5d'))[_0xa44d('0x57')]('sms_accounts','a',_0xa44d('0x5e'))[_0xa44d('0x57')]('sms_messages','me',_0xa44d('0x5f'))[_0xa44d('0x57')]('sms_interaction_has_tags','it',_0xa44d('0x60'))[_0xa44d('0x57')](_0xa44d('0x52'),'t',_0xa44d('0x61'));var _0x150dbe=squel[_0xa44d('0x62')]();var _0x531fea=[];var _0x1d2a7c=squel[_0xa44d('0x62')]();var _0x9c751f;if(_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x63')]){_0x9c751f=as[_0xa44d('0x64')](_0x5b76c0['query'][_0xa44d('0x63')]);var _0x2a3bca=_0x9c751f[_0xa44d('0x65')];for(var _0xe9ffe9=0x0;_0xe9ffe9<_0x9c751f[_0xa44d('0x66')]['length'];_0xe9ffe9++){var _0x2e2573=_0x9c751f[_0xa44d('0x66')][_0xe9ffe9];var _0xd3a698='i';var _0x209255=_['find'](_0x17cf49,['name',_0x2e2573[_0xa44d('0x4f')]]);if(!_0x209255){switch(_0x2e2573['field']){case'unreadMessages':if(_0x2e2573[_0xa44d('0x67')]==0x1){_0x300b46[_0xa44d('0x68')]('`'+_0x2e2573['field']+_0xa44d('0x69'));}else{_0x300b46[_0xa44d('0x68')]('`'+_0x2e2573[_0xa44d('0x4f')]+_0xa44d('0x6a'));}break;case _0xa44d('0x6b'):if(_0x2e2573[_0xa44d('0x6c')]===_0xa44d('0x6d')){if(_0x2e2573[_0xa44d('0x67')]['split']('\x20')[_0xa44d('0x4a')]>0x1){_0x150dbe[_0x2a3bca](_0xa44d('0x6e'),qs[_0xa44d('0x6f')](_0x2e2573['value']),null);}else{var _0x466609='%'+_0x2e2573['value']+'%';_0x150dbe[_0x2a3bca](_0xa44d('0x70'),_0x466609,_0x466609,_0x466609);}}else{_0x209255=_[_0xa44d('0x71')](_0x17cf49,[_0xa44d('0x2e'),_0xa44d('0x72')]);_0x2e2573[_0xa44d('0x4f')]='ContactId';_0x3a4583=as[_0xa44d('0x73')](_0xd3a698,_0x209255[_0xa44d('0x41')],_0x2e2573);_0x150dbe[_0x2a3bca](_0x3a4583[_0xa44d('0x74')],_0x3a4583[_0xa44d('0x67')][_0xa44d('0x75')],_0x3a4583[_0xa44d('0x67')][_0xa44d('0x21')]);}break;case'Tag':var _0x1d495f=_0x2e2573['value'][_0xa44d('0x76')](',')[_0xa44d('0x31')](function(_0x1325fa){return Number(_0x1325fa);});_0x1d495f['forEach'](function(_0x488277){_0x1d2a7c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x488277+',%');});_0x531fea=_[_0xa44d('0x77')](_0x531fea,_0x1d495f);break;case _0xa44d('0x78'):if(_0x2e2573[_0xa44d('0x6c')]==='$substring'){_0x150dbe[_0x2a3bca]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2e2573[_0xa44d('0x67')]+'%',null);}else{_0x209255=_[_0xa44d('0x71')](_0x17cf49,[_0xa44d('0x2e'),_0xa44d('0x3d')]);_0x2e2573[_0xa44d('0x4f')]='UserId';_0x3a4583=as[_0xa44d('0x73')](_0xd3a698,_0x209255[_0xa44d('0x41')],_0x2e2573);_0x150dbe[_0x2a3bca](_0x3a4583[_0xa44d('0x74')],_0x3a4583[_0xa44d('0x67')]['start'],_0x3a4583['value'][_0xa44d('0x21')]);}break;case _0xa44d('0x79'):_0x3a4583=as[_0xa44d('0x73')]('me',null,_0x2e2573);_0x150dbe[_0x2a3bca](_0x3a4583[_0xa44d('0x74')],_0x3a4583[_0xa44d('0x67')][_0xa44d('0x75')],_0x3a4583[_0xa44d('0x67')][_0xa44d('0x21')]);break;}}else{var _0x3a4583=as['buildExpression'](_0xd3a698,_0x209255[_0xa44d('0x41')],_0x2e2573);_0x150dbe[_0x2a3bca](_0x3a4583[_0xa44d('0x74')],_0x3a4583[_0xa44d('0x67')][_0xa44d('0x75')],_0x3a4583['value'][_0xa44d('0x21')]);}}}else{var _0x3c191e=_(_0x5b76c0['query'])[_0xa44d('0x44')]()['map'](function(_0x9ad340){return _['some'](_0x17cf49,['name',_0x9ad340])?_0x9ad340:undefined;})[_0xa44d('0x7a')]()['value']();if(!_[_0xa44d('0x7b')](_0x3c191e)){_0x3c191e[_0xa44d('0x7c')](function(_0x289b6f){if(_0x289b6f===_0xa44d('0x7d')){_0x300b46[_0xa44d('0x4e')](_0xa44d('0x7e'),[]['concat'](_0x5b76c0['query'][_0x289b6f]));}else if(_0x289b6f===_0xa44d('0x7f')){var _0x1be365=JSON[_0xa44d('0x80')](_0x5b76c0[_0xa44d('0x43')][_0x289b6f])['$gte'];var _0xf52fa2=JSON[_0xa44d('0x80')](_0x5b76c0[_0xa44d('0x43')][_0x289b6f])['$lte'];_0x300b46[_0xa44d('0x4e')](_0xa44d('0x81'),_0x1be365,_0xf52fa2);}else{if(_0x5b76c0[_0xa44d('0x43')][_0x289b6f]===_0xa44d('0x82')){_0x300b46['where']('i.'+_0x289b6f+_0xa44d('0x83'));}else{_0x300b46[_0xa44d('0x4e')]('i.'+_0x289b6f+_0xa44d('0x84'),_0x5b76c0[_0xa44d('0x43')][_0x289b6f]);}}});}if(_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x85')]){if(_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x85')]==0x1){_0x300b46[_0xa44d('0x68')](_0xa44d('0x86'));}else{_0x300b46[_0xa44d('0x68')](_0xa44d('0x87'));}}if(_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x88')]){_0x531fea=_[_0xa44d('0x89')](_0x5b76c0['query'][_0xa44d('0x88')])?_0x5b76c0['query'][_0xa44d('0x88')]:new Array(_0x5b76c0['query'][_0xa44d('0x88')]);_0x531fea[_0xa44d('0x7c')](function(_0x2cf48c){_0x1d2a7c['or'](_0xa44d('0x8a'),'%,'+_0x2cf48c+',%');});}if(_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x8b')]){var _0x2dc2ac=_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x8b')][_0xa44d('0x8c')]('\x5c','\x5c\x5c')[_0xa44d('0x8c')](/'/g,'\x27\x27');if(qs[_0xa44d('0x8d')](_0x2dc2ac)){_0x150dbe['or'](_0xa44d('0x8e'),_0x2dc2ac+'%')['or'](_0xa44d('0x8f'),_0x2dc2ac+'%');}else{_0x150dbe['or'](_0xa44d('0x90'),qs[_0xa44d('0x6f')](_0x2dc2ac))['or'](_0xa44d('0x91'),_0x2dc2ac+'%');}}}_0x300b46['where'](_0x150dbe);_0x300b46[_0xa44d('0x92')](_0xa44d('0x93'));var _0x1d8671={'type':db[_0xa44d('0x94')][_0xa44d('0x95')][_0xa44d('0x96')],'raw':!![]};var _0x35cc84=_0x300b46[_0xa44d('0x97')]();_0x35cc84[_0xa44d('0x4f')](_0xa44d('0x93'));_0x35cc84['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa44d('0x98'));if(_0x522369[_0xa44d('0x99')]){_0x522369['order'][_0xa44d('0x7c')](function(_0x26eaa8){var _0x5404f4=_0x26eaa8[0x0]===_0xa44d('0x9a')?_0x26eaa8[0x0]:'i.'+_0x26eaa8[0x0];_0x300b46['order'](_0x5404f4,_0x26eaa8[0x1]===_0xa44d('0x9b')?![]:!![]);});}if(!_[_0xa44d('0x7b')](_0x531fea)){_0x300b46[_0xa44d('0x68')](_0x1d2a7c);_0x35cc84[_0xa44d('0x4e')](_0xa44d('0x9c'),_0x531fea);}BPromise[_0xa44d('0x9d')]()[_0xa44d('0x2a')](function(){if(!_0x9c751f){if(_0x5b76c0[_0xa44d('0x43')]['SmsAccountId'])return;_0x35cc84[_0xa44d('0x4e')](_0xa44d('0x9e'));_0x300b46[_0xa44d('0x4e')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5b76c0[_0xa44d('0x9f')][_0xa44d('0xa0')]!==_0xa44d('0xa1'))return;return _0x5b76c0[_0xa44d('0x9f')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3758a8){if(_[_0xa44d('0x7b')](_0x3758a8)){_0x35cc84[_0xa44d('0x4e')](_0xa44d('0xa2'));_0x300b46[_0xa44d('0x4e')](_0xa44d('0xa2'));}else{_0x35cc84[_0xa44d('0x4e')](_0xa44d('0x7e'),_['map'](_0x3758a8,'id'));_0x300b46['where']('i.SmsAccountId\x20IN\x20?',_['map'](_0x3758a8,'id'));}});})[_0xa44d('0x2a')](function(){if(_0x5b76c0['user'][_0xa44d('0xa0')]===_0xa44d('0xa1')&&!_0x9c751f&&!_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x7d')])return[];return db['sequelize'][_0xa44d('0x43')](_0x35cc84[_0xa44d('0xa3')](),_0x1d8671);})[_0xa44d('0x2a')](function(_0x3ba5bd){_0x425c37[_0xa44d('0x25')]=_0x3ba5bd[_0xa44d('0x4a')];if(_0x425c37[_0xa44d('0x25')]===0x0)return[];return db['sequelize'][_0xa44d('0x43')](_0x1dcd20[_0xa44d('0xa3')](),_0x1d8671)[_0xa44d('0x2a')](function(_0x47881e){_0x4bf353=_['keyBy'](_0x47881e,'id');_0x1d8671=_['merge'](_0x1d8671,{'model':db[_0xa44d('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b76c0[_0xa44d('0x43')][_0xa44d('0x49')]){_0x522369[_0xa44d('0x48')][_0xa44d('0x7c')](function(_0x196c5b){_0x300b46[_0xa44d('0x4f')]('i.'+_0x196c5b);});}else{_0x300b46[_0xa44d('0x4f')](_0xa44d('0xa4'),_0xa44d('0x98'));_0x300b46[_0xa44d('0x4f')](_0xa44d('0xa5'),'Account.key');_0x300b46[_0xa44d('0x4f')](_0xa44d('0xa6'),_0xa44d('0xa7'));_0x300b46[_0xa44d('0x4f')](_0xa44d('0xa8'),_0xa44d('0x9a'));_0x300b46[_0xa44d('0x4f')]('i.*');_0x300b46[_0xa44d('0x4f')](_0xa44d('0xa9'),_0xa44d('0xaa'));_0x300b46[_0xa44d('0x4f')]('c.lastName','Contact.lastName');_0x300b46['field'](_0xa44d('0xab'),'Contact.email');_0x300b46[_0xa44d('0x4f')](_0xa44d('0xac'),_0xa44d('0xad'));_0x300b46[_0xa44d('0x4f')](_0xa44d('0xae'),_0xa44d('0xaf'));_0x300b46['field'](_0xa44d('0xb0'),_0xa44d('0xb1'));_0x300b46[_0xa44d('0x4f')](_0xa44d('0xb2'),'Owner.fullname');_0x300b46['field'](_0xa44d('0xb3'),_0xa44d('0xb4'));_0x300b46[_0xa44d('0x4f')](_0xa44d('0xb5'),_0xa44d('0x33'));}if(_0x522369['limit'])_0x300b46['limit'](_0x522369[_0xa44d('0x24')]);if(_0x522369[_0xa44d('0x26')])_0x300b46['offset'](_0x522369[_0xa44d('0x26')]);return db[_0xa44d('0xb6')][_0xa44d('0x43')](_0x300b46[_0xa44d('0xa3')](),_0x1d8671);})[_0xa44d('0x2a')](function(_0x51299b){if(_0x51299b['length']>0x0)_0xbeb000[_0xa44d('0x4e')](_0xa44d('0xb7'),_[_0xa44d('0x31')](_0x51299b,'id'));return db[_0xa44d('0xb6')]['query'](_0xbeb000['toString'](),_0x1d8671)[_0xa44d('0x2a')](function(_0x51c136){var _0x523c4a=_[_0xa44d('0xb8')](_0x51c136,'SmsInteractionId');var _0x18fc1b=[];_0x51299b[_0xa44d('0x7c')](function(_0x2c292f){_0x18fc1b['push'](updateSmsInteraction(_0x2c292f,_0x4bf353,_0x523c4a));});return BPromise[_0xa44d('0xb9')](_0x18fc1b);});});})[_0xa44d('0x2a')](function(_0x2ef71a){_0x425c37[_0xa44d('0xba')]=_0x2ef71a;return _0x425c37;})[_0xa44d('0x2a')](respondWithFilteredResult(_0x479288,_0x522369))[_0xa44d('0x36')](handleError(_0x479288,null));};exports[_0xa44d('0xbb')]=function(_0x207458,_0x42f9f1){var _0x4a5846={'raw':![],'where':{'id':_0x207458[_0xa44d('0xbc')]['id']}},_0x5b295c={};_0x5b295c[_0xa44d('0x47')]=_['keys'](db[_0xa44d('0x3f')]['rawAttributes']);_0x5b295c[_0xa44d('0x43')]=_['keys'](_0x207458['query']);_0x5b295c['filters']=_[_0xa44d('0x46')](_0x5b295c[_0xa44d('0x47')],_0x5b295c['query']);_0x4a5846['attributes']=_[_0xa44d('0x46')](_0x5b295c[_0xa44d('0x47')],qs[_0xa44d('0x49')](_0x207458['query'][_0xa44d('0x49')]));_0x4a5846[_0xa44d('0x48')]=_0x4a5846[_0xa44d('0x48')][_0xa44d('0x4a')]?_0x4a5846[_0xa44d('0x48')]:_0x5b295c[_0xa44d('0x47')];if(_0x207458[_0xa44d('0x43')][_0xa44d('0xbd')]){_0x4a5846[_0xa44d('0xbe')]=[{'all':!![]}];}_0x4a5846=_[_0xa44d('0xbf')]({},_0x4a5846,_0x207458[_0xa44d('0xc0')]);return db['SmsInteraction'][_0xa44d('0x71')](_0x4a5846)[_0xa44d('0x2a')](handleEntityNotFound(_0x42f9f1,null))[_0xa44d('0x2a')](respondWithResult(_0x42f9f1,null))['catch'](handleError(_0x42f9f1,null));};exports[_0xa44d('0xc1')]=function(_0x67e363,_0x33d353){return db[_0xa44d('0x3f')][_0xa44d('0xc1')](_0x67e363['body'],{})['then'](respondWithResult(_0x33d353,0xc9))[_0xa44d('0x36')](handleError(_0x33d353,null));};exports[_0xa44d('0x29')]=function(_0x2af171,_0xafcf2d){if(_0x2af171[_0xa44d('0x79')]['id']){delete _0x2af171[_0xa44d('0x79')]['id'];}return db[_0xa44d('0x3f')]['find']({'where':{'id':_0x2af171[_0xa44d('0xbc')]['id']}})['then'](handleEntityNotFound(_0xafcf2d,null))['then'](saveUpdates(_0x2af171['body'],null))[_0xa44d('0x2a')](respondWithResult(_0xafcf2d,null))[_0xa44d('0x36')](handleError(_0xafcf2d,null));};exports['destroy']=function(_0x4c6eee,_0x448e6d){return db[_0xa44d('0x3f')][_0xa44d('0x71')]({'where':{'id':_0x4c6eee[_0xa44d('0xbc')]['id']}})[_0xa44d('0x2a')](handleEntityNotFound(_0x448e6d,null))[_0xa44d('0x2a')](removeEntity(_0x448e6d,null))['catch'](handleError(_0x448e6d,null));};exports[_0xa44d('0xc2')]=function(_0x2fa8e2,_0xde475e){return db[_0xa44d('0x3f')][_0xa44d('0xc2')]()[_0xa44d('0x2a')](respondWithResult(_0xde475e,null))[_0xa44d('0x36')](handleError(_0xde475e,null));};exports['addMessage']=function(_0x36ced0,_0x307b82,_0x20ed17){return db['SmsMessage'][_0xa44d('0x71')]({'where':{'id':_0x36ced0['params']['id']}})[_0xa44d('0x2a')](handleEntityNotFound(_0x307b82,null))[_0xa44d('0x2a')](function(_0x3cdfa2){if(_0x3cdfa2){return _0x3cdfa2[_0xa44d('0xc3')](_0x36ced0[_0xa44d('0x79')][_0xa44d('0xc4')],_[_0xa44d('0xc5')](_0x36ced0[_0xa44d('0x79')],[_0xa44d('0xc4'),'id'])||{});}})[_0xa44d('0x2a')](respondWithResult(_0x307b82,null))[_0xa44d('0x36')](handleError(_0x307b82,null));};exports[_0xa44d('0xc6')]=function(_0x74ec55,_0x2f7635,_0x24d9db){var _0x5cf0ee={'raw':![],'where':{}};var _0x2b79f={};var _0xa3516e={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xa44d('0xc7')]({'where':{'id':_0x74ec55['params']['id']}})[_0xa44d('0x2a')](handleEntityNotFound(_0x2f7635,null))[_0xa44d('0x2a')](function(_0x38b2d2){if(_0x38b2d2){_0x2b79f['model']=_[_0xa44d('0x44')](db[_0xa44d('0xc8')][_0xa44d('0xc9')]);_0x2b79f[_0xa44d('0x43')]=_[_0xa44d('0x44')](_0x74ec55['query']);_0x2b79f[_0xa44d('0x45')]=_[_0xa44d('0x46')](_0x2b79f[_0xa44d('0x47')],_0x2b79f[_0xa44d('0x43')]);_0x5cf0ee[_0xa44d('0x48')]=_[_0xa44d('0x46')](_0x2b79f[_0xa44d('0x47')],qs[_0xa44d('0x49')](_0x74ec55[_0xa44d('0x43')][_0xa44d('0x49')]));_0x5cf0ee[_0xa44d('0x48')]=_0x5cf0ee[_0xa44d('0x48')]['length']?_0x5cf0ee[_0xa44d('0x48')]:_0x2b79f[_0xa44d('0x47')];if(!_0x74ec55[_0xa44d('0x43')][_0xa44d('0x4b')](_0xa44d('0x4c'))){_0x5cf0ee[_0xa44d('0x24')]=qs[_0xa44d('0x24')](_0x74ec55[_0xa44d('0x43')][_0xa44d('0x24')]);_0x5cf0ee[_0xa44d('0x26')]=qs[_0xa44d('0x26')](_0x74ec55[_0xa44d('0x43')][_0xa44d('0x26')]);}_0x5cf0ee[_0xa44d('0x99')]=qs[_0xa44d('0x4d')](_0x74ec55['query'][_0xa44d('0x4d')]);_0x5cf0ee[_0xa44d('0x4e')]=qs[_0xa44d('0x45')](_['pick'](_0x74ec55[_0xa44d('0x43')],_0x2b79f['filters']));_0x5cf0ee['where'][_0xa44d('0xca')]=_0x38b2d2['id'];if(_0x74ec55[_0xa44d('0x43')][_0xa44d('0x8b')]){_0x5cf0ee[_0xa44d('0x4e')]=_[_0xa44d('0xbf')](_0x5cf0ee['where'],{'$or':_[_0xa44d('0x31')](_0x5cf0ee['attributes'],function(_0x95c09f){var _0x1b9a2f={};_0x1b9a2f[_0x95c09f]={'$like':'%'+_0x74ec55[_0xa44d('0x43')]['filter']+'%'};return _0x1b9a2f;})});}if(_0x74ec55[_0xa44d('0x43')][_0xa44d('0xcb')]){var _0x481ed8=_0x74ec55[_0xa44d('0x43')][_0xa44d('0xcb')][_0xa44d('0x76')](',');var _0x2980c8={};_0x2980c8[_0x481ed8[0x0]]={'$gte':moment(_0x481ed8[0x1])['format'](_0xa44d('0xcc'))};_0x5cf0ee[_0xa44d('0x4e')]=_[_0xa44d('0xbf')](_0x5cf0ee[_0xa44d('0x4e')],_0x2980c8);}_0x5cf0ee=_[_0xa44d('0xbf')]({},_0x5cf0ee,_0x74ec55['options']);return db[_0xa44d('0xc8')][_0xa44d('0x25')]({'where':_0x5cf0ee[_0xa44d('0x4e')]})[_0xa44d('0x2a')](function(_0xa295ce){_0xa3516e['count']=_0xa295ce;if(_0x74ec55[_0xa44d('0x43')][_0xa44d('0xbd')]){_0x5cf0ee[_0xa44d('0xbe')]=[{'all':!![]}];}return db[_0xa44d('0xc8')][_0xa44d('0xcd')](_0x5cf0ee);})[_0xa44d('0x2a')](function(_0x535fba){_0xa3516e[_0xa44d('0xba')]=_0x535fba;return _0xa3516e;});}})['then'](respondWithFilteredResult(_0x2f7635,_0x5cf0ee))[_0xa44d('0x36')](handleError(_0x2f7635,null));};exports['addTags']=function(_0x2c1370,_0x514e6e,_0x42ca98){return db[_0xa44d('0x3f')][_0xa44d('0x71')]({'where':{'id':_0x2c1370[_0xa44d('0xbc')]['id']}})['then'](handleEntityNotFound(_0x514e6e,null))['then'](function(_0xf5574){if(_0xf5574){return _0xf5574[_0xa44d('0xce')](_0x2c1370['body'][_0xa44d('0xc4')],_[_0xa44d('0xc5')](_0x2c1370[_0xa44d('0x79')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xa44d('0x2e'),_0xa44d('0x50')],'where':{'id':_0x2c1370[_0xa44d('0x79')]['ids']}});})[_0xa44d('0x2a')](function(_0x3273d2){socket['emit']('smsInteractionTags:save',{'id':Number(_0x2c1370[_0xa44d('0xbc')]['id']),'tags':_0x3273d2||[]});return{'id':Number(_0x2c1370[_0xa44d('0xbc')]['id']),'tags':_0x3273d2||[]};});}})['then'](respondWithResult(_0x514e6e,null))[_0xa44d('0x36')](handleError(_0x514e6e,null));};exports[_0xa44d('0xcf')]=function(_0x2229ae,_0x1d3555,_0x1dff44){return db[_0xa44d('0x3f')][_0xa44d('0x71')]({'where':{'id':_0x2229ae['params']['id']}})[_0xa44d('0x2a')](handleEntityNotFound(_0x1d3555,null))['then'](function(_0x1e46c4){if(_0x1e46c4){return _0x1e46c4['removeTags'](_0x2229ae['query'][_0xa44d('0xc4')]);}})[_0xa44d('0x2a')](respondWithStatusCode(_0x1d3555,null))[_0xa44d('0x36')](handleError(_0x1d3555,null));};exports[_0xa44d('0xd0')]=function(_0x2d3b2e,_0x2c802f){var _0x6d03de=moment()[_0xa44d('0xd1')]()[_0xa44d('0xa3')]();var _0x1f992f=path['join'](config[_0xa44d('0xd2')],_0xa44d('0xd3'),_0xa44d('0xd4'),_0xa44d('0xd5'));var _0x202e64=path['join'](config['root'],_0xa44d('0xd3'),'files',_0xa44d('0xd6'));var _0x400f42=path[_0xa44d('0xd7')](_0x1f992f,_0x6d03de);var _0x191031=util[_0xa44d('0xd8')](_0xa44d('0xd9'),_0x2d3b2e[_0xa44d('0xbc')]['id'],_0x6d03de);var _0x5f0f04=path[_0xa44d('0xd7')](_0x1f992f,_0x191031);var _0x2bc95b=[];_0x2bc95b[_0xa44d('0x35')]({'model':db['User'],'as':_0xa44d('0x78'),'attributes':['id',_0xa44d('0x32')],'raw':!![]});_0x2bc95b['push']({'model':db[_0xa44d('0xda')],'as':_0xa44d('0x6b'),'attributes':['id','firstName',_0xa44d('0xdb')],'raw':!![]});var _0x3ea0f9=[{'model':db[_0xa44d('0xc8')],'as':_0xa44d('0xdc'),'attributes':['id','body',_0xa44d('0x7f'),'direction',_0xa44d('0xdd'),_0xa44d('0x85')],'include':_0x2bc95b}];_0x3ea0f9['push']({'model':db[_0xa44d('0xde')],'as':_0xa44d('0xdf'),'attributes':['id',_0xa44d('0x2e')]});_0x3ea0f9[_0xa44d('0x35')]({'model':db[_0xa44d('0x78')],'as':_0xa44d('0xe0'),'attributes':['id',_0xa44d('0x32')]});return db[_0xa44d('0x3f')][_0xa44d('0x71')]({'where':{'id':_0x2d3b2e[_0xa44d('0xbc')]['id']},'include':_0x3ea0f9})[_0xa44d('0x2a')](handleEntityNotFound(_0x2c802f,null))[_0xa44d('0x2a')](function(_0xc97c0b){if(_0xc97c0b){var _0x456295=_0xc97c0b[_0xa44d('0xe1')]({'plain':!![]});fs['mkdirSync'](_0x400f42);var _0x3cb827={'channel':'Sms','account':_0x456295[_0xa44d('0xdf')][_0xa44d('0x2e')],'agent':_0x456295[_0xa44d('0xe0')]?_0x456295[_0xa44d('0xe0')][_0xa44d('0x32')]:_0xa44d('0xe2'),'createdAt':moment(_0x456295[_0xa44d('0x7f')])[_0xa44d('0xd8')](_0xa44d('0xcc'))[_0xa44d('0xa3')](),'closedAt':_0x456295[_0xa44d('0x3c')]?moment(_0x456295[_0xa44d('0xe3')])[_0xa44d('0xd8')](_0xa44d('0xcc'))[_0xa44d('0xa3')]():'','disposition':_0x456295[_0xa44d('0xe4')],'messages':_(_0x456295[_0xa44d('0xdc')])[_0xa44d('0x8b')]({'secret':![]})[_0xa44d('0x31')](function(_0x4336ac){return{'date':moment(_0x4336ac[_0xa44d('0x7f')])[_0xa44d('0xd8')](_0xa44d('0xcc'))[_0xa44d('0xa3')](),'sender':_0x4336ac[_0xa44d('0xe5')]===_0xa44d('0xe6')?_0x4336ac[_0xa44d('0x78')]?_0x4336ac[_0xa44d('0x78')][_0xa44d('0x32')]:_0xa44d('0xe7'):_0x4336ac['Contact']['firstName']+(_0x4336ac[_0xa44d('0x6b')][_0xa44d('0xdb')]?'\x20'+_0x4336ac[_0xa44d('0x6b')][_0xa44d('0xdb')]:''),'body':_0x4336ac[_0xa44d('0x79')],'direction':_0x4336ac[_0xa44d('0xe5')]===_0xa44d('0xe6')?'A':'C','secret':_0x4336ac['secret'],'read':_0x4336ac[_0xa44d('0x85')]};})['value']()};return ejs[_0xa44d('0xe8')](path['join'](config[_0xa44d('0xd2')],_0xa44d('0xd3'),_0xa44d('0xe9'),_0xa44d('0xea')),{'interaction':_0x3cb827})[_0xa44d('0x2a')](function(_0x1d2e48){var _0x2672eb=path[_0xa44d('0xd7')](_0x400f42,'transcript-'+_0x456295['id']+'-'+_0x6d03de+_0xa44d('0xeb'));var _0x1cbf8f={'path':_0x2672eb,'channel':'Sms','interactionId':_0x456295['id']};return pdf[_0xa44d('0xec')](_0x1d2e48,_0x1cbf8f);})[_0xa44d('0x2a')](function(){return new BPromise(function(_0x21f9b6,_0x412e0d){zipdir(_0x400f42,{'saveTo':_0x5f0f04},function(_0x36c065,_0x3eccac){if(_0x36c065)return _0x412e0d(_0x36c065);return _0x21f9b6(_0x3eccac);});})[_0xa44d('0x2a')](function(){return new BPromise(function(_0x2ac098,_0x43bf3e){rimraf(_0x400f42,function(_0x38df07){if(_0x38df07)_0x43bf3e(_0x38df07);return _0x2ac098();});});})[_0xa44d('0x2a')](function(){return _0x2c802f[_0xa44d('0xd0')](_0x5f0f04,_0x191031,function(_0x3350e9){if(_0x3350e9){console[_0xa44d('0xed')](_0xa44d('0xee'),_0x3350e9);}else{fs[_0xa44d('0xef')](_0x5f0f04);}});});});}else{return _0x2c802f[_0xa44d('0x1f')](0xc8);}})[_0xa44d('0x36')](handleError(_0x2c802f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 115c691..9581cae 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 _0x1893=['SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0xea72b0,_0x460e89){var _0x47a9a6=function(_0x2a22e3){while(--_0x2a22e3){_0xea72b0['push'](_0xea72b0['shift']());}};_0x47a9a6(++_0x460e89);}(_0x1893,0xa2));var _0x3189=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x1893[_0x2f0057];return _0x17f2c3;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x3189('0x0')];var SmsMessage=require(_0x3189('0x1'))['db'][_0x3189('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3189('0x3')](0x0);var events={'afterCreate':_0x3189('0x4'),'afterUpdate':_0x3189('0x5'),'afterDestroy':_0x3189('0x6')};function emitEvent(_0x5371db){return function(_0x27445,_0x4faebf,_0x2333e6){_0x27445[_0x3189('0x7')]({'attributes':['id'],'raw':!![]})[_0x3189('0x8')](function(_0x118970){_0x27445[_0x3189('0x9')](_0x3189('0xa'),_0x118970['map'](function(_0x1d5f6a){return{'id':_0x1d5f6a['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x27445['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3189('0x8')](function(_0x4ac683){_0x27445[_0x3189('0x9')](_0x3189('0xb'),_0x4ac683[_0x3189('0xc')]);SmsInteractionEvents[_0x3189('0xd')](_0x5371db+':'+_0x27445['id'],_0x27445);SmsInteractionEvents['emit'](_0x5371db,_0x27445);_0x2333e6(null);})[_0x3189('0xe')](_0x2333e6(null));};}for(var e in events){if(events[_0x3189('0xf')](e)){var event=events[e];SmsInteraction[_0x3189('0x10')](e,emitEvent(event));}}module[_0x3189('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x4325=['Users','map','findAll','then','setDataValue','length','emit','catch','exports','events','../../mysqldb','SmsMessage','setMaxListeners','remove','getUsers'];(function(_0x43a5f1,_0x3bdecc){var _0x46e6b8=function(_0x4c9208){while(--_0x4c9208){_0x43a5f1['push'](_0x43a5f1['shift']());}};_0x46e6b8(++_0x3bdecc);}(_0x4325,0x1da));var _0x5432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4325[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5432('0x0'));var SmsInteraction=require(_0x5432('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x5432('0x1'))['db'][_0x5432('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5432('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5432('0x4')};function emitEvent(_0x36ce53){return function(_0xad26e9,_0x4acbe4,_0x209e2e){_0xad26e9[_0x5432('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x106ec9){_0xad26e9['setDataValue'](_0x5432('0x6'),_0x106ec9[_0x5432('0x7')](function(_0x40e756){return{'id':_0x40e756['id']};}));return SmsMessage[_0x5432('0x8')]({'where':{'SmsInteractionId':_0xad26e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5432('0x9')](function(_0x4a9a51){_0xad26e9[_0x5432('0xa')]('unreadMessages',_0x4a9a51[_0x5432('0xb')]);SmsInteractionEvents[_0x5432('0xc')](_0x36ce53+':'+_0xad26e9['id'],_0xad26e9);SmsInteractionEvents[_0x5432('0xc')](_0x36ce53,_0xad26e9);_0x209e2e(null);})[_0x5432('0xd')](_0x209e2e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5432('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index f508b52..df3f477 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 _0x0d3f=['util','../../config/logger','api','bluebird','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','format','lodash'];(function(_0x190e8c,_0x1522d8){var _0x1aac4b=function(_0x296b18){while(--_0x296b18){_0x190e8c['push'](_0x190e8c['shift']());}};_0x1aac4b(++_0x1522d8);}(_0x0d3f,0x14f));var _0xf0d3=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x0d3f[_0x1e06f1];return _0x34f77e;};'use strict';var _=require(_0xf0d3('0x0'));var util=require(_0xf0d3('0x1'));var logger=require(_0xf0d3('0x2'))(_0xf0d3('0x3'));var moment=require('moment');var BPromise=require(_0xf0d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0d3('0x5'));var rimraf=require('rimraf');var config=require(_0xf0d3('0x6'));var attributes=require(_0xf0d3('0x7'));module[_0xf0d3('0x8')]=function(_0x1c80cc,_0x312d53){return _0x1c80cc[_0xf0d3('0x9')](_0xf0d3('0xa'),attributes,{'tableName':_0xf0d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x369ead,_0x244d54,_0x607a68){if(_0x369ead[_0xf0d3('0xc')]('closed')){_0x369ead['closedAt']=moment()[_0xf0d3('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x607a68(null,_0x369ead);}}});}; \ No newline at end of file +var _0xb589=['sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','SmsInteraction'];(function(_0x53174f,_0x986a3b){var _0x1cbd1c=function(_0x5bbcb1){while(--_0x5bbcb1){_0x53174f['push'](_0x53174f['shift']());}};_0x1cbd1c(++_0x986a3b);}(_0xb589,0x1af));var _0x9b58=function(_0x2d015c,_0x31bb7e){_0x2d015c=_0x2d015c-0x0;var _0x403093=_0xb589[_0x2d015c];return _0x403093;};'use strict';var _=require(_0x9b58('0x0'));var util=require(_0x9b58('0x1'));var logger=require(_0x9b58('0x2'))(_0x9b58('0x3'));var moment=require(_0x9b58('0x4'));var BPromise=require(_0x9b58('0x5'));var rp=require(_0x9b58('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b58('0x7'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x9b58('0x8')]=function(_0x470d2c,_0x5351fd){return _0x470d2c[_0x9b58('0x9')](_0x9b58('0xa'),attributes,{'tableName':_0x9b58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d1275,_0x1f9a89,_0x35fa24){if(_0x2d1275[_0x9b58('0xc')](_0x9b58('0xd'))){_0x2d1275[_0x9b58('0xe')]=moment()[_0x9b58('0xf')](_0x9b58('0x10'));}_0x35fa24(null,_0x2d1275);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 50e2fc2..cbf43e1 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 _0xf666=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsInteraction','update','body','options','raw','where','limit','then','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsInteraction.socket','request','SmsInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xf666,0x71));var _0x6f66=function(_0x1da173,_0x26fd7c){_0x1da173=_0x1da173-0x0;var _0x1e448b=_0xf666[_0x1da173];return _0x1e448b;};'use strict';var _=require('lodash');var util=require(_0x6f66('0x0'));var moment=require(_0x6f66('0x1'));var BPromise=require(_0x6f66('0x2'));var rs=require(_0x6f66('0x3'));var fs=require('fs');var Redis=require(_0x6f66('0x4'));var db=require(_0x6f66('0x5'))['db'];var utils=require(_0x6f66('0x6'));var logger=require(_0x6f66('0x7'))('rpc');var config=require(_0x6f66('0x8'));var jayson=require(_0x6f66('0x9'));var client=jayson[_0x6f66('0xa')][_0x6f66('0xb')]({'port':0x232a});config['redis']=_[_0x6f66('0xc')](config[_0x6f66('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f66('0xe'))(new Redis(config[_0x6f66('0xd')]));require(_0x6f66('0xf'))['register'](socket);function respondWithRpcPromise(_0x3e36ed,_0x32df65,_0x2678c3){return new BPromise(function(_0xdab5cd,_0x3cf8a6){return client[_0x6f66('0x10')](_0x3e36ed,_0x2678c3)['then'](function(_0x1ec5ff){logger['info'](_0x6f66('0x11'),_0x32df65,_0x6f66('0x12'));logger[_0x6f66('0x13')](_0x6f66('0x14'),_0x32df65,'request\x20sent',JSON[_0x6f66('0x15')](_0x1ec5ff));if(_0x1ec5ff[_0x6f66('0x16')]){if(_0x1ec5ff['error'][_0x6f66('0x17')]===0x1f4){logger[_0x6f66('0x16')](_0x6f66('0x11'),_0x32df65,_0x1ec5ff[_0x6f66('0x16')][_0x6f66('0x18')]);return _0x3cf8a6(_0x1ec5ff['error'][_0x6f66('0x18')]);}logger[_0x6f66('0x16')](_0x6f66('0x11'),_0x32df65,_0x1ec5ff[_0x6f66('0x16')][_0x6f66('0x18')]);return _0xdab5cd(_0x1ec5ff['error'][_0x6f66('0x18')]);}else{logger[_0x6f66('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x32df65,_0x6f66('0x12'));_0xdab5cd(_0x1ec5ff[_0x6f66('0x1a')]['message']);}})[_0x6f66('0x1b')](function(_0x30dac3){logger[_0x6f66('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x32df65,_0x30dac3);_0x3cf8a6(_0x30dac3);});});}exports['UpdateSmsInteraction']=function(_0x32652c){var _0x322494=this;return new Promise(function(_0x31d00e,_0x589668){return db[_0x6f66('0x1c')][_0x6f66('0x1d')](_0x32652c[_0x6f66('0x1e')],{'raw':_0x32652c[_0x6f66('0x1f')]?_0x32652c[_0x6f66('0x1f')][_0x6f66('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32652c[_0x6f66('0x1f')]?_0x32652c[_0x6f66('0x1f')][_0x6f66('0x21')]||null:null,'attributes':_0x32652c[_0x6f66('0x1f')]?_0x32652c[_0x6f66('0x1f')]['attributes']||null:null,'limit':_0x32652c[_0x6f66('0x1f')]?_0x32652c[_0x6f66('0x1f')][_0x6f66('0x22')]||null:null})[_0x6f66('0x23')](function(_0x3086d8){logger[_0x6f66('0x19')](_0x6f66('0x24'),_0x32652c);logger[_0x6f66('0x13')](_0x6f66('0x24'),_0x32652c,JSON[_0x6f66('0x15')](_0x3086d8));_0x31d00e(_0x3086d8);})['catch'](function(_0x5eb66e){logger[_0x6f66('0x16')](_0x6f66('0x24'),_0x5eb66e['message'],_0x32652c);_0x589668(_0x322494[_0x6f66('0x16')](0x1f4,_0x5eb66e[_0x6f66('0x18')]));});});};exports[_0x6f66('0x25')]=function(_0x44bd50){return new Promise(function(_0xb20b4d,_0x2b330f){return db[_0x6f66('0x1c')][_0x6f66('0x26')]({'where':_0x44bd50[_0x6f66('0x1f')]?_0x44bd50['options'][_0x6f66('0x21')]||null:null})[_0x6f66('0x23')](function(_0x5c9fb6){if(_0x5c9fb6){return _0x5c9fb6[_0x6f66('0x27')](_0x44bd50['body'][_0x6f66('0x28')],_[_0x6f66('0x29')](_0x44bd50[_0x6f66('0x1e')],['ids','id'])||{});}})[_0x6f66('0x2a')](function(_0x243d7b){logger[_0x6f66('0x19')](_0x6f66('0x2b'),_0x44bd50);logger[_0x6f66('0x13')](_0x6f66('0x2b'),_0x44bd50,JSON[_0x6f66('0x15')](_0x243d7b));_0xb20b4d(_0x243d7b);})[_0x6f66('0x1b')](function(_0x1fc41a){logger[_0x6f66('0x16')](_0x6f66('0x2b'),_0x1fc41a[_0x6f66('0x18')],_0x44bd50);_0x2b330f(_this[_0x6f66('0x16')](0x1f4,_0x1fc41a[_0x6f66('0x18')]));});});}; \ No newline at end of file +var _0x8bb9=['catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','then','info','stringify','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x8bb9,0xb6));var _0x98bb=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0x8bb9[_0x30c7c5];return _0x29e24e;};'use strict';var _=require(_0x98bb('0x0'));var util=require(_0x98bb('0x1'));var moment=require(_0x98bb('0x2'));var BPromise=require(_0x98bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x98bb('0x5'));var logger=require('../../config/logger')(_0x98bb('0x6'));var config=require(_0x98bb('0x7'));var jayson=require(_0x98bb('0x8'));var client=jayson[_0x98bb('0x9')][_0x98bb('0xa')]({'port':0x232a});config['redis']=_[_0x98bb('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x98bb('0xc'))(new Redis(config[_0x98bb('0xd')]));require('./smsInteraction.socket')[_0x98bb('0xe')](socket);function respondWithRpcPromise(_0x5d1107,_0x2a8b25,_0x3360aa){return new BPromise(function(_0x1ec225,_0x2f2f33){return client[_0x98bb('0xf')](_0x5d1107,_0x3360aa)['then'](function(_0x1cba2a){logger['info'](_0x98bb('0x10'),_0x2a8b25,_0x98bb('0x11'));logger[_0x98bb('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2a8b25,_0x98bb('0x11'),JSON['stringify'](_0x1cba2a));if(_0x1cba2a[_0x98bb('0x13')]){if(_0x1cba2a[_0x98bb('0x13')][_0x98bb('0x14')]===0x1f4){logger[_0x98bb('0x13')](_0x98bb('0x10'),_0x2a8b25,_0x1cba2a[_0x98bb('0x13')][_0x98bb('0x15')]);return _0x2f2f33(_0x1cba2a[_0x98bb('0x13')][_0x98bb('0x15')]);}logger['error'](_0x98bb('0x10'),_0x2a8b25,_0x1cba2a[_0x98bb('0x13')][_0x98bb('0x15')]);return _0x1ec225(_0x1cba2a[_0x98bb('0x13')][_0x98bb('0x15')]);}else{logger['info'](_0x98bb('0x10'),_0x2a8b25,_0x98bb('0x11'));_0x1ec225(_0x1cba2a[_0x98bb('0x16')][_0x98bb('0x15')]);}})[_0x98bb('0x17')](function(_0x1c5f1f){logger[_0x98bb('0x13')](_0x98bb('0x10'),_0x2a8b25,_0x1c5f1f);_0x2f2f33(_0x1c5f1f);});});}exports[_0x98bb('0x18')]=function(_0xf7d2b4){var _0x54e6fc=this;return new Promise(function(_0x33b793,_0x22f346){return db['SmsInteraction'][_0x98bb('0x19')](_0xf7d2b4[_0x98bb('0x1a')],{'raw':_0xf7d2b4[_0x98bb('0x1b')]?_0xf7d2b4[_0x98bb('0x1b')][_0x98bb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf7d2b4[_0x98bb('0x1b')]?_0xf7d2b4[_0x98bb('0x1b')][_0x98bb('0x1d')]||null:null,'attributes':_0xf7d2b4[_0x98bb('0x1b')]?_0xf7d2b4[_0x98bb('0x1b')][_0x98bb('0x1e')]||null:null,'limit':_0xf7d2b4[_0x98bb('0x1b')]?_0xf7d2b4['options']['limit']||null:null})[_0x98bb('0x1f')](function(_0x542057){logger[_0x98bb('0x20')](_0x98bb('0x18'),_0xf7d2b4);logger[_0x98bb('0x12')]('UpdateSmsInteraction',_0xf7d2b4,JSON[_0x98bb('0x21')](_0x542057));_0x33b793(_0x542057);})['catch'](function(_0x235a2a){logger[_0x98bb('0x13')](_0x98bb('0x18'),_0x235a2a[_0x98bb('0x15')],_0xf7d2b4);_0x22f346(_0x54e6fc['error'](0x1f4,_0x235a2a['message']));});});};exports[_0x98bb('0x22')]=function(_0x554068){return new Promise(function(_0x5f0d51,_0x207efb){return db[_0x98bb('0x23')]['find']({'where':_0x554068[_0x98bb('0x1b')]?_0x554068[_0x98bb('0x1b')][_0x98bb('0x1d')]||null:null})[_0x98bb('0x1f')](function(_0x23f79f){if(_0x23f79f){return _0x23f79f[_0x98bb('0x24')](_0x554068[_0x98bb('0x1a')][_0x98bb('0x25')],_[_0x98bb('0x26')](_0x554068[_0x98bb('0x1a')],[_0x98bb('0x25'),'id'])||{});}})[_0x98bb('0x27')](function(_0x2efe38){logger[_0x98bb('0x20')]('AddTags',_0x554068);logger[_0x98bb('0x12')](_0x98bb('0x28'),_0x554068,JSON[_0x98bb('0x21')](_0x2efe38));_0x5f0d51(_0x2efe38);})[_0x98bb('0x17')](function(_0x11d165){logger[_0x98bb('0x13')](_0x98bb('0x28'),_0x11d165['message'],_0x554068);_0x207efb(_this[_0x98bb('0x13')](0x1f4,_0x11d165[_0x98bb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index c829a41..b7f9efd 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 _0x647a=['remove','update','emit','removeListener','register','smsInteraction:','./smsInteraction.events','save'];(function(_0x226eac,_0x1c47de){var _0x355dc8=function(_0x1834b9){while(--_0x1834b9){_0x226eac['push'](_0x226eac['shift']());}};_0x355dc8(++_0x1c47de);}(_0x647a,0x76));var _0xa647=function(_0x37e8e8,_0x1be63e){_0x37e8e8=_0x37e8e8-0x0;var _0x2c3c9e=_0x647a[_0x37e8e8];return _0x2c3c9e;};'use strict';var SmsInteractionEvents=require(_0xa647('0x0'));var events=[_0xa647('0x1'),_0xa647('0x2'),_0xa647('0x3')];function createListener(_0x3f336b,_0x5835d6){return function(_0x2abd86){_0x5835d6[_0xa647('0x4')](_0x3f336b,_0x2abd86);};}function removeListener(_0x1dd309,_0x483a8d){return function(){SmsInteractionEvents[_0xa647('0x5')](_0x1dd309,_0x483a8d);};}exports[_0xa647('0x6')]=function(_0x111818){for(var _0xe9a2c=0x0,_0x5a321c=events['length'];_0xe9a2c<_0x5a321c;_0xe9a2c++){var _0x56d56b=events[_0xe9a2c];var _0x361d0b=createListener(_0xa647('0x7')+_0x56d56b,_0x111818);SmsInteractionEvents['on'](_0x56d56b,_0x361d0b);}}; \ No newline at end of file +var _0xddd2=['smsInteraction:','emit','removeListener','length'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0xddd2,0x1c1));var _0x2ddd=function(_0x2bb20b,_0x5dbba1){_0x2bb20b=_0x2bb20b-0x0;var _0x1b732d=_0xddd2[_0x2bb20b];return _0x1b732d;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save','remove','update'];function createListener(_0x25535a,_0x47314f){return function(_0x2a0cfc){_0x47314f[_0x2ddd('0x0')](_0x25535a,_0x2a0cfc);};}function removeListener(_0x3bdfd4,_0xdf0cf5){return function(){SmsInteractionEvents[_0x2ddd('0x1')](_0x3bdfd4,_0xdf0cf5);};}exports['register']=function(_0x1ddeef){for(var _0x130fd4=0x0,_0x4a46d9=events[_0x2ddd('0x2')];_0x130fd4<_0x4a46d9;_0x130fd4++){var _0x44edd4=events[_0x130fd4];var _0x1ec242=createListener(_0x2ddd('0x3')+_0x44edd4,_0x1ddeef);SmsInteractionEvents['on'](_0x44edd4,_0x1ec242);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c802f97..1bbe446 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 _0xd456=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','smsmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','express'];(function(_0x4bb096,_0x2c323c){var _0x4ccc4f=function(_0x96d414){while(--_0x96d414){_0x4bb096['push'](_0x4bb096['shift']());}};_0x4ccc4f(++_0x2c323c);}(_0xd456,0x12a));var _0x6d45=function(_0xaf2a94,_0x1e4a07){_0xaf2a94=_0xaf2a94-0x0;var _0x5d0a8e=_0xd456[_0xaf2a94];return _0x5d0a8e;};'use strict';var multer=require(_0x6d45('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6d45('0x1'));var router=express[_0x6d45('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6d45('0x3'));var interaction=require(_0x6d45('0x4'));var config=require(_0x6d45('0x5'));var controller=require(_0x6d45('0x6'));router[_0x6d45('0x7')]('/',auth['isAuthenticated'](),controller[_0x6d45('0x8')]);router['get'](_0x6d45('0x9'),auth['isAuthenticated'](),controller[_0x6d45('0xa')]);router['get'](_0x6d45('0xb'),auth[_0x6d45('0xc')](),controller[_0x6d45('0xd')]);router[_0x6d45('0xe')]('/',auth[_0x6d45('0xc')](),interaction[_0x6d45('0xf')]('sms',_0x6d45('0x10')),controller['create']);router[_0x6d45('0xe')](_0x6d45('0x11'),controller[_0x6d45('0x12')]);router[_0x6d45('0x13')](_0x6d45('0xb'),auth[_0x6d45('0xc')](),controller['update']);router[_0x6d45('0x13')](_0x6d45('0x14'),auth['isAuthenticated'](),controller[_0x6d45('0x15')]);router['put'](_0x6d45('0x16'),auth[_0x6d45('0xc')](),controller['reject']);router[_0x6d45('0x17')](_0x6d45('0xb'),auth[_0x6d45('0xc')](),controller[_0x6d45('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb2ed=['reject','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','create','/:id/status','put','update','/:id/accept','accept','/:id/reject'];(function(_0x212135,_0x3b2e27){var _0x24cf00=function(_0x23ff0e){while(--_0x23ff0e){_0x212135['push'](_0x212135['shift']());}};_0x24cf00(++_0x3b2e27);}(_0xb2ed,0x120));var _0xdb2e=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xb2ed[_0x1a8f86];return _0x20d876;};'use strict';var multer=require('multer');var util=require(_0xdb2e('0x0'));var path=require('path');var timeout=require(_0xdb2e('0x1'));var express=require(_0xdb2e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdb2e('0x3'));var interaction=require(_0xdb2e('0x4'));var config=require(_0xdb2e('0x5'));var controller=require(_0xdb2e('0x6'));router[_0xdb2e('0x7')]('/',auth[_0xdb2e('0x8')](),controller[_0xdb2e('0x9')]);router[_0xdb2e('0x7')](_0xdb2e('0xa'),auth['isAuthenticated'](),controller[_0xdb2e('0xb')]);router[_0xdb2e('0x7')](_0xdb2e('0xc'),auth[_0xdb2e('0x8')](),controller[_0xdb2e('0xd')]);router[_0xdb2e('0xe')]('/',auth[_0xdb2e('0x8')](),interaction[_0xdb2e('0xf')](_0xdb2e('0x10'),'smsmessage:create'),controller[_0xdb2e('0x11')]);router[_0xdb2e('0xe')](_0xdb2e('0x12'),controller['status']);router[_0xdb2e('0x13')]('/:id',auth[_0xdb2e('0x8')](),controller[_0xdb2e('0x14')]);router[_0xdb2e('0x13')](_0xdb2e('0x15'),auth[_0xdb2e('0x8')](),controller[_0xdb2e('0x16')]);router[_0xdb2e('0x13')](_0xdb2e('0x17'),auth[_0xdb2e('0x8')](),controller[_0xdb2e('0x18')]);router['delete'](_0xdb2e('0xc'),auth[_0xdb2e('0x8')](),controller['destroy']);module[_0xdb2e('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index dd2d417..b29f890 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 _0x903b=['BOOLEAN','ENUM','STRING','TEXT'];(function(_0x19e202,_0x4b86f1){var _0x22e490=function(_0xbf9c62){while(--_0xbf9c62){_0x19e202['push'](_0x19e202['shift']());}};_0x22e490(++_0x4b86f1);}(_0x903b,0x104));var _0xb903=function(_0xa3a538,_0x156684){_0xa3a538=_0xa3a538-0x0;var _0x3bdbbb=_0x903b[_0xa3a538];return _0x3bdbbb;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb903('0x0')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb903('0x1')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb903('0x2')](0xbe)},'phone':{'type':Sequelize[_0xb903('0x2')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xb903('0x0')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb903('0x2')]},'providerResponse':{'type':Sequelize[_0xb903('0x3')]}}; \ No newline at end of file +var _0x6459=['STRING','DATE','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x5009b5,_0x4a5de4){var _0x3fa34a=function(_0x3d104e){while(--_0x3d104e){_0x5009b5['push'](_0x5009b5['shift']());}};_0x3fa34a(++_0x4a5de4);}(_0x6459,0x1c2));var _0x9645=function(_0x596b6f,_0x525ea5){_0x596b6f=_0x596b6f-0x0;var _0xf38433=_0x6459[_0x596b6f];return _0xf38433;};'use strict';var Sequelize=require(_0x9645('0x0'));module[_0x9645('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9645('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9645('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9645('0x4')]('in','out'),'defaultValue':_0x9645('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9645('0x6')](0xbe)},'phone':{'type':Sequelize[_0x9645('0x6')]},'readAt':{'type':Sequelize[_0x9645('0x7')]},'secret':{'type':Sequelize[_0x9645('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9645('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index bc243a9..98e1d33 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 _0x49d9=['EventManager','acceptmessage','sms-interactions','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','fullname','email','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','http','client','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','includeAll','include','SmsMessage','findAll','options','find','create','body','params','describe','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','isNil','read1stAt','format','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','internal','manual','interface','SIP/%s','channel','motionChannel'];(function(_0x50e67a,_0x1784b8){var _0x34ff8d=function(_0xb93fbc){while(--_0xb93fbc){_0x50e67a['push'](_0x50e67a['shift']());}};_0x34ff8d(++_0x1784b8);}(_0x49d9,0x13e));var _0x949d=function(_0x151b2f,_0x39d04c){_0x151b2f=_0x151b2f-0x0;var _0x1d1101=_0x49d9[_0x151b2f];return _0x1d1101;};'use strict';var emlformat=require(_0x949d('0x0'));var rimraf=require(_0x949d('0x1'));var zipdir=require(_0x949d('0x2'));var jsonpatch=require(_0x949d('0x3'));var rp=require(_0x949d('0x4'));var moment=require('moment');var BPromise=require(_0x949d('0x5'));var Mustache=require(_0x949d('0x6'));var util=require(_0x949d('0x7'));var path=require(_0x949d('0x8'));var sox=require(_0x949d('0x9'));var csv=require('to-csv');var ejs=require(_0x949d('0xa'));var fs=require('fs');var fs_extra=require(_0x949d('0xb'));var _=require(_0x949d('0xc'));var squel=require(_0x949d('0xd'));var crypto=require(_0x949d('0xe'));var jsforce=require(_0x949d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x949d('0x10'));var querystring=require(_0x949d('0x11'));var Papa=require(_0x949d('0x12'));var Redis=require('ioredis');var authService=require(_0x949d('0x13'));var qs=require(_0x949d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x949d('0x15'));var logger=require(_0x949d('0x16'))(_0x949d('0x17'));var utils=require(_0x949d('0x18'));var config=require(_0x949d('0x19'));var licenseUtil=require(_0x949d('0x1a'));var db=require(_0x949d('0x1b'))['db'];config[_0x949d('0x1c')]=_['defaults'](config['redis'],{'host':_0x949d('0x1d'),'port':0x18eb});var socket=require(_0x949d('0x1e'))(new Redis(config[_0x949d('0x1c')]));require(_0x949d('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x949d('0x20')]({'port':0x232c});var client9002=jayson[_0x949d('0x21')][_0x949d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1fa673,_0x198fd1,_0x156007,_0x28c004){return new BPromise(function(_0xf4a980,_0x2628d8){var _0x220288=_0x28c004||client;return _0x220288[_0x949d('0x22')](_0x1fa673,_0x156007)[_0x949d('0x23')](function(_0x4597d0){logger[_0x949d('0x24')]('SmsMessage,\x20%s,\x20%s',_0x198fd1,_0x949d('0x25'));logger[_0x949d('0x26')](_0x949d('0x27'),_0x198fd1,_0x949d('0x25'),JSON[_0x949d('0x28')](_0x4597d0));if(_0x4597d0[_0x949d('0x29')]){if(_0x4597d0[_0x949d('0x29')][_0x949d('0x2a')]===0x1f4){logger['error'](_0x949d('0x2b'),_0x198fd1,_0x4597d0[_0x949d('0x29')]['message']);return _0x2628d8(_0x4597d0[_0x949d('0x29')][_0x949d('0x2c')]);}logger[_0x949d('0x29')]('SmsMessage,\x20%s,\x20%s',_0x198fd1,_0x4597d0[_0x949d('0x29')][_0x949d('0x2c')]);return _0xf4a980(_0x4597d0[_0x949d('0x29')][_0x949d('0x2c')]);}else{logger[_0x949d('0x24')](_0x949d('0x2b'),_0x198fd1,_0x949d('0x25'));_0xf4a980(_0x4597d0[_0x949d('0x2d')][_0x949d('0x2c')]);}})[_0x949d('0x2e')](function(_0x156362){logger[_0x949d('0x29')](_0x949d('0x2b'),_0x198fd1,_0x156362);_0x2628d8(_0x156362);});});}function respondWithStatusCode(_0xf4d4c7,_0x279460){_0x279460=_0x279460||0xcc;return function(_0x19f75d){if(_0x19f75d){return _0xf4d4c7['sendStatus'](_0x279460);}return _0xf4d4c7[_0x949d('0x2f')](_0x279460)[_0x949d('0x30')]();};}function respondWithResult(_0xd250b,_0x2adc4a){_0x2adc4a=_0x2adc4a||0xc8;return function(_0x4f9aa3){if(_0x4f9aa3){return _0xd250b[_0x949d('0x2f')](_0x2adc4a)[_0x949d('0x31')](_0x4f9aa3);}};}function respondWithFilteredResult(_0xf20d1f,_0x16e63a){return function(_0x5c9930){if(_0x5c9930){var _0x4cfb04=typeof _0x16e63a[_0x949d('0x32')]===_0x949d('0x33')&&typeof _0x16e63a[_0x949d('0x34')]===_0x949d('0x33');var _0x362b0c=_0x5c9930[_0x949d('0x35')];var _0x30e71f=_0x4cfb04?0x0:_0x16e63a[_0x949d('0x32')];var _0x5c54a0=_0x4cfb04?_0x5c9930[_0x949d('0x35')]:_0x16e63a[_0x949d('0x32')]+_0x16e63a[_0x949d('0x34')];var _0x11039f;if(_0x5c54a0>=_0x362b0c){_0x5c54a0=_0x362b0c;_0x11039f=0xc8;}else{_0x11039f=0xce;}_0xf20d1f['status'](_0x11039f);return _0xf20d1f[_0x949d('0x36')](_0x949d('0x37'),_0x30e71f+'-'+_0x5c54a0+'/'+_0x362b0c)[_0x949d('0x31')](_0x5c9930);}return null;};}function patchUpdates(_0x6a14f4){return function(_0x3e06d9){try{jsonpatch[_0x949d('0x38')](_0x3e06d9,_0x6a14f4,!![]);}catch(_0x1d7736){return BPromise[_0x949d('0x39')](_0x1d7736);}return _0x3e06d9[_0x949d('0x3a')]();};}function saveUpdates(_0x5bcc58,_0x152188){return function(_0x3820e9){if(_0x3820e9){return _0x3820e9[_0x949d('0x3b')](_0x5bcc58)['then'](function(_0x262057){return _0x262057;});}return null;};}function removeEntity(_0x2c75de,_0x5eebb8){return function(_0x3ac990){if(_0x3ac990){return _0x3ac990[_0x949d('0x3c')]()['then'](function(){_0x2c75de[_0x949d('0x2f')](0xcc)[_0x949d('0x30')]();});}};}function handleEntityNotFound(_0x246713,_0x373002){return function(_0x204295){if(!_0x204295){_0x246713['sendStatus'](0x194);}return _0x204295;};}function handleError(_0xc108a3,_0x42f5fd){_0x42f5fd=_0x42f5fd||0x1f4;return function(_0x4b261d){logger[_0x949d('0x29')](_0x4b261d['stack']);if(_0x4b261d[_0x949d('0x3d')]){delete _0x4b261d['name'];}_0xc108a3[_0x949d('0x2f')](_0x42f5fd)[_0x949d('0x3e')](_0x4b261d);};}exports[_0x949d('0x3f')]=function(_0x105e04,_0x357cd5){var _0x5f20d4={},_0x6572df={},_0x13e8d8={'count':0x0,'rows':[]};var _0x15db02=_[_0x949d('0x40')](db['SmsMessage'][_0x949d('0x41')],function(_0x4c622d){return{'name':_0x4c622d[_0x949d('0x42')],'type':_0x4c622d[_0x949d('0x43')][_0x949d('0x44')]};});_0x6572df[_0x949d('0x45')]=_[_0x949d('0x40')](_0x15db02,_0x949d('0x3d'));_0x6572df[_0x949d('0x46')]=_[_0x949d('0x47')](_0x105e04['query']);_0x6572df[_0x949d('0x48')]=_[_0x949d('0x49')](_0x6572df[_0x949d('0x45')],_0x6572df['query']);_0x5f20d4[_0x949d('0x4a')]=_['intersection'](_0x6572df[_0x949d('0x45')],qs[_0x949d('0x4b')](_0x105e04[_0x949d('0x46')][_0x949d('0x4b')]));_0x5f20d4[_0x949d('0x4a')]=_0x5f20d4['attributes'][_0x949d('0x4c')]?_0x5f20d4[_0x949d('0x4a')]:_0x6572df[_0x949d('0x45')];if(!_0x105e04[_0x949d('0x46')]['hasOwnProperty'](_0x949d('0x4d'))){_0x5f20d4[_0x949d('0x34')]=qs[_0x949d('0x34')](_0x105e04[_0x949d('0x46')][_0x949d('0x34')]);_0x5f20d4[_0x949d('0x32')]=qs[_0x949d('0x32')](_0x105e04[_0x949d('0x46')][_0x949d('0x32')]);}_0x5f20d4['order']=qs[_0x949d('0x4e')](_0x105e04['query'][_0x949d('0x4e')]);_0x5f20d4[_0x949d('0x4f')]=qs[_0x949d('0x48')](_['pick'](_0x105e04['query'],_0x6572df['filters']),_0x15db02);if(_0x105e04[_0x949d('0x46')][_0x949d('0x50')]){_0x5f20d4['where']=_[_0x949d('0x51')](_0x5f20d4[_0x949d('0x4f')],{'$or':_['map'](_0x15db02,function(_0x42fe45){if(_0x42fe45[_0x949d('0x43')]!=='VIRTUAL'){var _0xac37ec={};_0xac37ec[_0x42fe45[_0x949d('0x3d')]]={'$like':'%'+_0x105e04[_0x949d('0x46')][_0x949d('0x50')]+'%'};return _0xac37ec;}})});}_0x5f20d4=_['merge']({},_0x5f20d4,_0x105e04['options']);var _0x504c6b={'where':_0x5f20d4['where']};return db['SmsMessage'][_0x949d('0x35')](_0x504c6b)['then'](function(_0x5e9f7e){_0x13e8d8[_0x949d('0x35')]=_0x5e9f7e;if(_0x105e04[_0x949d('0x46')][_0x949d('0x52')]){_0x5f20d4[_0x949d('0x53')]=[{'all':!![]}];}return db[_0x949d('0x54')][_0x949d('0x55')](_0x5f20d4);})[_0x949d('0x23')](function(_0x3caf2e){_0x13e8d8['rows']=_0x3caf2e;return _0x13e8d8;})[_0x949d('0x23')](respondWithFilteredResult(_0x357cd5,_0x5f20d4))[_0x949d('0x2e')](handleError(_0x357cd5,null));};exports['show']=function(_0x22da6d,_0x537b8b){var _0x4f6ed3={'raw':!![],'where':{'id':_0x22da6d['params']['id']}},_0x237e3f={};_0x237e3f[_0x949d('0x45')]=_[_0x949d('0x47')](db[_0x949d('0x54')][_0x949d('0x41')]);_0x237e3f[_0x949d('0x46')]=_[_0x949d('0x47')](_0x22da6d[_0x949d('0x46')]);_0x237e3f['filters']=_[_0x949d('0x49')](_0x237e3f[_0x949d('0x45')],_0x237e3f[_0x949d('0x46')]);_0x4f6ed3[_0x949d('0x4a')]=_[_0x949d('0x49')](_0x237e3f[_0x949d('0x45')],qs['fields'](_0x22da6d[_0x949d('0x46')][_0x949d('0x4b')]));_0x4f6ed3[_0x949d('0x4a')]=_0x4f6ed3[_0x949d('0x4a')][_0x949d('0x4c')]?_0x4f6ed3['attributes']:_0x237e3f[_0x949d('0x45')];if(_0x22da6d[_0x949d('0x46')][_0x949d('0x52')]){_0x4f6ed3['include']=[{'all':!![]}];}_0x4f6ed3=_[_0x949d('0x51')]({},_0x4f6ed3,_0x22da6d[_0x949d('0x56')]);return db[_0x949d('0x54')][_0x949d('0x57')](_0x4f6ed3)[_0x949d('0x23')](handleEntityNotFound(_0x537b8b,null))['then'](respondWithResult(_0x537b8b,null))[_0x949d('0x2e')](handleError(_0x537b8b,null));};exports[_0x949d('0x58')]=function(_0xab6e5,_0x491966){return db['SmsMessage']['create'](_0xab6e5[_0x949d('0x59')],{})[_0x949d('0x23')](respondWithResult(_0x491966,0xc9))[_0x949d('0x2e')](handleError(_0x491966,null));};exports[_0x949d('0x3b')]=function(_0x2f6f51,_0x1ddd63){if(_0x2f6f51[_0x949d('0x59')]['id']){delete _0x2f6f51[_0x949d('0x59')]['id'];}return db[_0x949d('0x54')]['find']({'where':{'id':_0x2f6f51[_0x949d('0x5a')]['id']}})[_0x949d('0x23')](handleEntityNotFound(_0x1ddd63,null))[_0x949d('0x23')](saveUpdates(_0x2f6f51['body'],null))[_0x949d('0x23')](respondWithResult(_0x1ddd63,null))[_0x949d('0x2e')](handleError(_0x1ddd63,null));};exports[_0x949d('0x3c')]=function(_0x72a035,_0x3255ff){return db['SmsMessage']['find']({'where':{'id':_0x72a035[_0x949d('0x5a')]['id']}})[_0x949d('0x23')](handleEntityNotFound(_0x3255ff,null))[_0x949d('0x23')](removeEntity(_0x3255ff,null))[_0x949d('0x2e')](handleError(_0x3255ff,null));};exports[_0x949d('0x5b')]=function(_0x136285,_0x58448a){return db['SmsMessage'][_0x949d('0x5b')]()['then'](respondWithResult(_0x58448a,null))[_0x949d('0x2e')](handleError(_0x58448a,null));};var interaction_log=require(_0x949d('0x16'))('sms-interactions');exports[_0x949d('0x5c')]=function(_0x258f55,_0x59caea,_0x8036aa){var _0x293e7b={'agent':{},'channel':_0x949d('0x5d')};if(_0x258f55[_0x949d('0x59')]['id']){delete _0x258f55[_0x949d('0x59')]['id'];}_0x258f55[_0x949d('0x59')][_0x949d('0x5e')]=!![];_0x258f55[_0x949d('0x59')][_0x949d('0x5f')]=moment()['format'](_0x949d('0x60'));_0x258f55['body'][_0x949d('0x61')]=_0x258f55[_0x949d('0x59')][_0x949d('0x61')]||_0x258f55[_0x949d('0x62')]['id'];_0x293e7b[_0x949d('0x63')]['id']=_0x258f55['body'][_0x949d('0x61')];return db[_0x949d('0x54')][_0x949d('0x57')]({'where':{'id':_0x258f55[_0x949d('0x5a')]['id'],'UserId':null}})[_0x949d('0x23')](handleEntityNotFound(_0x59caea,null))[_0x949d('0x23')](saveUpdates(_0x258f55[_0x949d('0x59')],null))[_0x949d('0x23')](function(_0x139c71){if(_0x139c71){_0x293e7b[_0x949d('0x2c')]=_0x139c71['get']({'plain':!![]});return db[_0x949d('0x64')][_0x949d('0x57')]({'where':{'id':_0x139c71['SmsInteractionId']}});}return null;})[_0x949d('0x23')](handleEntityNotFound(_0x59caea,null))[_0x949d('0x23')](function(_0x3f0994){if(_0x3f0994){return _0x3f0994[_0x949d('0x3b')]({'UserId':_0x258f55[_0x949d('0x59')][_0x949d('0x61')],'read1stAt':_[_0x949d('0x65')](_0x3f0994[_0x949d('0x66')])?moment()[_0x949d('0x67')](_0x949d('0x60')):undefined});}return null;})[_0x949d('0x23')](function(_0x3892f3){if(_0x3892f3){_0x293e7b[_0x949d('0x68')]=_0x3892f3[_0x949d('0x69')]({'plain':!![]});interaction_log['info'](_0x949d('0x6a'),_0x258f55['user']['id'],_0x258f55[_0x949d('0x62')]['name'],_0x258f55[_0x949d('0x62')]['role'],_0x293e7b[_0x949d('0x68')]['id'],_0x258f55[_0x949d('0x59')]?JSON[_0x949d('0x28')](_0x258f55[_0x949d('0x59')]):_0x949d('0x6b'));return respondWithRpcPromise(_0x949d('0x6c'),_0x949d('0x6d'),_0x293e7b);}return null;})[_0x949d('0x23')](function(_0x12ced6){var _0x4783c5=_0x949d('0x6e')+_0x12ced6[_0x949d('0x2c')][_0x949d('0x6f')];return db[_0x949d('0x70')][_0x949d('0x46')](_0x4783c5,{'type':db[_0x949d('0x71')][_0x949d('0x72')][_0x949d('0x73')],'raw':!![]})[_0x949d('0x23')](function(_0x23368b){return _0x23368b;});})[_0x949d('0x23')](function(_0x57ec85){if(_0x57ec85){_0x293e7b['message']['contact']=_0x57ec85[0x0];if(!_0x258f55[_0x949d('0x59')][_0x949d('0x61')])return;return db[_0x949d('0x74')][_0x949d('0x57')]({'where':{'id':_0x258f55[_0x949d('0x59')][_0x949d('0x61')],'role':_0x949d('0x63')},'attributes':['id','name','fullname','email',_0x949d('0x75')],'raw':!![]});}return null;})['then'](function(_0x471ff9){if(!_0x471ff9)return null;_0x293e7b[_0x949d('0x2c')][_0x949d('0x63')]=_0x471ff9;return _0x293e7b;})[_0x949d('0x23')](function(_0x421143){if(_0x421143){if(_0x258f55[_0x949d('0x59')][_0x949d('0x76')]){_0x293e7b['message'][_0x949d('0x77')]=util[_0x949d('0x67')](_0x949d('0x78'),_0x258f55[_0x949d('0x62')]['name']);_0x293e7b[_0x949d('0x2c')][_0x949d('0x79')]=_0x293e7b[_0x949d('0x79')];_0x293e7b[_0x949d('0x2c')][_0x949d('0x7a')]=_0x293e7b[_0x949d('0x79')];_0x293e7b[_0x949d('0x2c')]['event']=_0x949d('0x5c');return respondWithRpcPromise(_0x949d('0x7b'),_0x949d('0x7b'),{'event':_0x949d('0x7c'),'message':_0x293e7b[_0x949d('0x2c')]},client9002)[_0x949d('0x23')](function(){return _0x293e7b;});}return _0x293e7b;}return null;})[_0x949d('0x23')](respondWithResult(_0x59caea,null))[_0x949d('0x2e')](handleError(_0x59caea,null));};var interaction_log=require('../../config/logger')(_0x949d('0x7d'));exports[_0x949d('0x39')]=function(_0x57a461,_0x371130,_0x3cd779){var _0x2e2701={'agent':{},'channel':_0x949d('0x5d')};if(_0x57a461['body']['id']){delete _0x57a461[_0x949d('0x59')]['id'];}_0x57a461[_0x949d('0x59')][_0x949d('0x61')]=_0x57a461[_0x949d('0x59')][_0x949d('0x61')]||_0x57a461['user']['id'];_0x2e2701['agent']['id']=_0x57a461[_0x949d('0x59')]['UserId'];return db['SmsMessage'][_0x949d('0x57')]({'where':{'id':_0x57a461[_0x949d('0x5a')]['id'],'UserId':null}})[_0x949d('0x23')](handleEntityNotFound(_0x371130,null))[_0x949d('0x23')](function(_0x4de398){if(_0x4de398){_0x2e2701[_0x949d('0x2c')]=_0x4de398['get']({'plain':!![]});return db[_0x949d('0x64')]['find']({'where':{'id':_0x4de398[_0x949d('0x7e')]}});}return null;})[_0x949d('0x23')](handleEntityNotFound(_0x371130,null))[_0x949d('0x23')](function(_0x3dfff9){if(_0x3dfff9){_0x2e2701[_0x949d('0x68')]=_0x3dfff9[_0x949d('0x69')]({'plain':!![]});interaction_log[_0x949d('0x24')](_0x949d('0x7f'),_0x57a461[_0x949d('0x62')]['id'],_0x57a461[_0x949d('0x62')][_0x949d('0x3d')],_0x57a461[_0x949d('0x62')]['role'],_0x2e2701[_0x949d('0x68')]['id'],_0x57a461[_0x949d('0x59')]?JSON[_0x949d('0x28')](_0x57a461[_0x949d('0x59')]):'null');return respondWithRpcPromise(_0x949d('0x80'),_0x949d('0x81'),_0x2e2701);}return null;})[_0x949d('0x23')](function(_0x6bd7b9){var _0x3247b0=_0x949d('0x6e')+_0x6bd7b9['message'][_0x949d('0x6f')];return db['sequelize']['query'](_0x3247b0,{'type':db['Sequelize'][_0x949d('0x72')][_0x949d('0x73')],'raw':!![]})[_0x949d('0x23')](function(_0x437e94){return _0x437e94;});})[_0x949d('0x23')](function(_0x3ba11c){if(_0x3ba11c){_0x2e2701[_0x949d('0x2c')][_0x949d('0x82')]=_0x3ba11c[0x0];if(!_0x57a461['body'][_0x949d('0x61')])return;return db[_0x949d('0x74')]['find']({'where':{'id':_0x57a461[_0x949d('0x59')][_0x949d('0x61')],'role':_0x949d('0x63')},'attributes':['id',_0x949d('0x3d'),_0x949d('0x83'),_0x949d('0x84'),_0x949d('0x75')],'raw':!![]});}return null;})[_0x949d('0x23')](function(_0x33a24d){if(!_0x33a24d)return null;_0x2e2701[_0x949d('0x2c')]['agent']=_0x33a24d;return _0x2e2701;})[_0x949d('0x23')](function(_0x1ef297){if(_0x1ef297){_0x1ef297[_0x949d('0x2c')][_0x949d('0x77')]=util[_0x949d('0x67')]('SIP/%s',_0x57a461['user']['name']);_0x1ef297['message']['channel']=_0x2e2701['channel'];_0x1ef297[_0x949d('0x2c')]['motionChannel']=_0x2e2701['channel'];_0x1ef297[_0x949d('0x2c')]['event']=_0x949d('0x39');respondWithRpcPromise(_0x949d('0x7b'),_0x949d('0x7b'),{'event':'rejectmessage','message':_0x1ef297['message']},client9002);return _0x2e2701;}return null;})[_0x949d('0x23')](respondWithResult(_0x371130,null))[_0x949d('0x2e')](handleError(_0x371130,null));};exports['status']=function(_0x4a8e45,_0x40b452,_0x7526a4){if(_0x4a8e45[_0x949d('0x59')]['id']){delete _0x4a8e45[_0x949d('0x59')]['id'];}var _0x1f7288;return db['SmsMessage'][_0x949d('0x57')]({'where':{'id':_0x4a8e45[_0x949d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x40b452,null))[_0x949d('0x23')](function(_0x2bb965){if(_0x2bb965){_0x1f7288=_0x2bb965;return db[_0x949d('0x85')][_0x949d('0x57')]({'where':{'id':_0x2bb965['SmsAccountId']}});}})[_0x949d('0x23')](handleEntityNotFound(_0x40b452,null))[_0x949d('0x23')](function(_0x3ec1c3){if(_0x3ec1c3){logger['debug'](_0x949d('0x27'),_0x949d('0x2f'),_0x949d('0x86'),_0x3ec1c3[_0x949d('0x43')],util[_0x949d('0x87')](_0x4a8e45[_0x949d('0x59')],{'showHidden':![],'depth':null}));switch(_0x3ec1c3[_0x949d('0x43')]){case _0x949d('0x88'):if(_0x4a8e45[_0x949d('0x59')][_0x949d('0x89')]&&_0x4a8e45['body'][_0x949d('0x89')]===_0x1f7288[_0x949d('0x8a')]){return _0x1f7288[_0x949d('0x3b')]({'read':!![]});}else{logger['error'](_0x949d('0x8b'),_0x949d('0x2f'),_0x949d('0x88'),util[_0x949d('0x87')](_0x4a8e45[_0x949d('0x59')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x4a8e45[_0x949d('0x59')][_0x949d('0x8c')]&&_0x4a8e45[_0x949d('0x59')][_0x949d('0x8c')]===_0x1f7288[_0x949d('0x8a')]&&_['indexOf']([_0x949d('0x8d'),'delivered'],_0x4a8e45[_0x949d('0x59')]['Status'])>=0x0){return _0x1f7288[_0x949d('0x3b')]({'read':!![]});}else{logger[_0x949d('0x29')](_0x949d('0x8b'),_0x949d('0x2f'),_0x949d('0x8e'),util[_0x949d('0x87')](_0x4a8e45[_0x949d('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5036ac=_0x4a8e45[_0x949d('0x59')][_0x949d('0x8f')][0x0];if(_0x5036ac[_0x949d('0x2f')][_0x949d('0x90')]===_0x949d('0x91')){return _0x1f7288[_0x949d('0x3b')]({'read':!![]});}else{logger[_0x949d('0x29')](_0x949d('0x8b'),_0x949d('0x2f'),_0x949d('0x92'),util['inspect'](_0x4a8e45[_0x949d('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1f7288;}})[_0x949d('0x23')](respondWithResult(_0x40b452,null))[_0x949d('0x2e')](handleError(_0x40b452,null));}; \ No newline at end of file +var _0x4815=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','send','index','map','rawAttributes','fieldName','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','options','SmsMessage','includeAll','findAll','rows','show','params','keys','include','find','create','body','describe','sms-interactions','sms','read','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','SmsInteractionId','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','event','EventManager','acceptmessage','SmsInteraction','rejectMessage','email','SIP/%s','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','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/environment','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','request','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json'];(function(_0x3baf31,_0xfc7ee4){var _0x29d6ee=function(_0x1e9fdb){while(--_0x1e9fdb){_0x3baf31['push'](_0x3baf31['shift']());}};_0x29d6ee(++_0xfc7ee4);}(_0x4815,0xff));var _0x5481=function(_0x19d206,_0x309693){_0x19d206=_0x19d206-0x0;var _0x2924fb=_0x4815[_0x19d206];return _0x2924fb;};'use strict';var emlformat=require(_0x5481('0x0'));var rimraf=require(_0x5481('0x1'));var zipdir=require(_0x5481('0x2'));var jsonpatch=require(_0x5481('0x3'));var rp=require(_0x5481('0x4'));var moment=require(_0x5481('0x5'));var BPromise=require(_0x5481('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5481('0x7'));var sox=require(_0x5481('0x8'));var csv=require(_0x5481('0x9'));var ejs=require(_0x5481('0xa'));var fs=require('fs');var fs_extra=require(_0x5481('0xb'));var _=require(_0x5481('0xc'));var squel=require(_0x5481('0xd'));var crypto=require(_0x5481('0xe'));var jsforce=require(_0x5481('0xf'));var deskjs=require(_0x5481('0x10'));var toCsv=require(_0x5481('0x9'));var querystring=require(_0x5481('0x11'));var Papa=require(_0x5481('0x12'));var Redis=require(_0x5481('0x13'));var authService=require(_0x5481('0x14'));var qs=require(_0x5481('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5481('0x16'))(_0x5481('0x17'));var utils=require(_0x5481('0x18'));var config=require(_0x5481('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5481('0x1a'))['db'];config['redis']=_[_0x5481('0x1b')](config[_0x5481('0x1c')],{'host':_0x5481('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5481('0x1c')]));require('./smsMessage.socket')[_0x5481('0x1e')](socket);var jayson=require(_0x5481('0x1f'));var client=jayson[_0x5481('0x20')][_0x5481('0x21')]({'port':0x232c});var client9002=jayson[_0x5481('0x20')][_0x5481('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x31b8c9,_0x2deceb,_0x667928,_0x981a4d){return new BPromise(function(_0x5ac688,_0x31c4bc){var _0x2e9d46=_0x981a4d||client;return _0x2e9d46[_0x5481('0x22')](_0x31b8c9,_0x667928)['then'](function(_0x4bf038){logger['info']('SmsMessage,\x20%s,\x20%s',_0x2deceb,_0x5481('0x23'));logger[_0x5481('0x24')](_0x5481('0x25'),_0x2deceb,'request\x20sent',JSON['stringify'](_0x4bf038));if(_0x4bf038['error']){if(_0x4bf038[_0x5481('0x26')][_0x5481('0x27')]===0x1f4){logger[_0x5481('0x26')](_0x5481('0x28'),_0x2deceb,_0x4bf038[_0x5481('0x26')][_0x5481('0x29')]);return _0x31c4bc(_0x4bf038[_0x5481('0x26')][_0x5481('0x29')]);}logger[_0x5481('0x26')](_0x5481('0x28'),_0x2deceb,_0x4bf038[_0x5481('0x26')]['message']);return _0x5ac688(_0x4bf038[_0x5481('0x26')]['message']);}else{logger[_0x5481('0x2a')](_0x5481('0x28'),_0x2deceb,_0x5481('0x23'));_0x5ac688(_0x4bf038[_0x5481('0x2b')][_0x5481('0x29')]);}})[_0x5481('0x2c')](function(_0x2ac321){logger[_0x5481('0x26')](_0x5481('0x28'),_0x2deceb,_0x2ac321);_0x31c4bc(_0x2ac321);});});}function respondWithStatusCode(_0x59986b,_0x50c4f9){_0x50c4f9=_0x50c4f9||0xcc;return function(_0x2a1674){if(_0x2a1674){return _0x59986b[_0x5481('0x2d')](_0x50c4f9);}return _0x59986b['status'](_0x50c4f9)[_0x5481('0x2e')]();};}function respondWithResult(_0x16730b,_0x145baf){_0x145baf=_0x145baf||0xc8;return function(_0x39dc47){if(_0x39dc47){return _0x16730b[_0x5481('0x2f')](_0x145baf)[_0x5481('0x30')](_0x39dc47);}};}function respondWithFilteredResult(_0x235327,_0x230b5f){return function(_0x347cac){if(_0x347cac){var _0x47cbd2=typeof _0x230b5f[_0x5481('0x31')]===_0x5481('0x32')&&typeof _0x230b5f[_0x5481('0x33')]===_0x5481('0x32');var _0x4297f0=_0x347cac[_0x5481('0x34')];var _0x2d0c32=_0x47cbd2?0x0:_0x230b5f['offset'];var _0x719fc3=_0x47cbd2?_0x347cac['count']:_0x230b5f['offset']+_0x230b5f['limit'];var _0x3264e1;if(_0x719fc3>=_0x4297f0){_0x719fc3=_0x4297f0;_0x3264e1=0xc8;}else{_0x3264e1=0xce;}_0x235327['status'](_0x3264e1);return _0x235327[_0x5481('0x35')](_0x5481('0x36'),_0x2d0c32+'-'+_0x719fc3+'/'+_0x4297f0)[_0x5481('0x30')](_0x347cac);}return null;};}function patchUpdates(_0x2d5c6b){return function(_0x3d1737){try{jsonpatch[_0x5481('0x37')](_0x3d1737,_0x2d5c6b,!![]);}catch(_0x50ec36){return BPromise[_0x5481('0x38')](_0x50ec36);}return _0x3d1737[_0x5481('0x39')]();};}function saveUpdates(_0x4ec2fd,_0x1db3da){return function(_0x4646c6){if(_0x4646c6){return _0x4646c6[_0x5481('0x3a')](_0x4ec2fd)['then'](function(_0xfe5f2c){return _0xfe5f2c;});}return null;};}function removeEntity(_0x307b8e,_0x3dc9fe){return function(_0x4105f3){if(_0x4105f3){return _0x4105f3[_0x5481('0x3b')]()[_0x5481('0x3c')](function(){_0x307b8e[_0x5481('0x2f')](0xcc)[_0x5481('0x2e')]();});}};}function handleEntityNotFound(_0x104f3f,_0x30075b){return function(_0x2dfbfc){if(!_0x2dfbfc){_0x104f3f[_0x5481('0x2d')](0x194);}return _0x2dfbfc;};}function handleError(_0x2b0bbb,_0x6f42c2){_0x6f42c2=_0x6f42c2||0x1f4;return function(_0x4f2c57){logger[_0x5481('0x26')](_0x4f2c57['stack']);if(_0x4f2c57['name']){delete _0x4f2c57['name'];}_0x2b0bbb['status'](_0x6f42c2)[_0x5481('0x3d')](_0x4f2c57);};}exports[_0x5481('0x3e')]=function(_0x4ceba9,_0x5f4e0c){var _0x5438cb={},_0x2292b8={},_0x2e2c80={'count':0x0,'rows':[]};var _0x49e77c=_[_0x5481('0x3f')](db['SmsMessage'][_0x5481('0x40')],function(_0x3b84df){return{'name':_0x3b84df[_0x5481('0x41')],'type':_0x3b84df['type']['key']};});_0x2292b8[_0x5481('0x42')]=_['map'](_0x49e77c,_0x5481('0x43'));_0x2292b8[_0x5481('0x44')]=_['keys'](_0x4ceba9[_0x5481('0x44')]);_0x2292b8['filters']=_[_0x5481('0x45')](_0x2292b8['model'],_0x2292b8['query']);_0x5438cb[_0x5481('0x46')]=_[_0x5481('0x45')](_0x2292b8[_0x5481('0x42')],qs[_0x5481('0x47')](_0x4ceba9[_0x5481('0x44')][_0x5481('0x47')]));_0x5438cb[_0x5481('0x46')]=_0x5438cb[_0x5481('0x46')][_0x5481('0x48')]?_0x5438cb['attributes']:_0x2292b8[_0x5481('0x42')];if(!_0x4ceba9[_0x5481('0x44')][_0x5481('0x49')](_0x5481('0x4a'))){_0x5438cb[_0x5481('0x33')]=qs['limit'](_0x4ceba9[_0x5481('0x44')][_0x5481('0x33')]);_0x5438cb['offset']=qs[_0x5481('0x31')](_0x4ceba9[_0x5481('0x44')][_0x5481('0x31')]);}_0x5438cb['order']=qs[_0x5481('0x4b')](_0x4ceba9[_0x5481('0x44')][_0x5481('0x4b')]);_0x5438cb[_0x5481('0x4c')]=qs['filters'](_[_0x5481('0x4d')](_0x4ceba9['query'],_0x2292b8[_0x5481('0x4e')]),_0x49e77c);if(_0x4ceba9[_0x5481('0x44')][_0x5481('0x4f')]){_0x5438cb[_0x5481('0x4c')]=_['merge'](_0x5438cb['where'],{'$or':_[_0x5481('0x3f')](_0x49e77c,function(_0x3093dc){if(_0x3093dc['type']!==_0x5481('0x50')){var _0x5e7f66={};_0x5e7f66[_0x3093dc['name']]={'$like':'%'+_0x4ceba9['query']['filter']+'%'};return _0x5e7f66;}})});}_0x5438cb=_['merge']({},_0x5438cb,_0x4ceba9[_0x5481('0x51')]);var _0x30e57d={'where':_0x5438cb[_0x5481('0x4c')]};return db[_0x5481('0x52')][_0x5481('0x34')](_0x30e57d)[_0x5481('0x3c')](function(_0x211b7b){_0x2e2c80[_0x5481('0x34')]=_0x211b7b;if(_0x4ceba9[_0x5481('0x44')][_0x5481('0x53')]){_0x5438cb['include']=[{'all':!![]}];}return db[_0x5481('0x52')][_0x5481('0x54')](_0x5438cb);})[_0x5481('0x3c')](function(_0x1b057b){_0x2e2c80[_0x5481('0x55')]=_0x1b057b;return _0x2e2c80;})[_0x5481('0x3c')](respondWithFilteredResult(_0x5f4e0c,_0x5438cb))[_0x5481('0x2c')](handleError(_0x5f4e0c,null));};exports[_0x5481('0x56')]=function(_0x2a8a61,_0x5572dd){var _0x5ad67a={'raw':!![],'where':{'id':_0x2a8a61[_0x5481('0x57')]['id']}},_0x3f588f={};_0x3f588f[_0x5481('0x42')]=_[_0x5481('0x58')](db['SmsMessage'][_0x5481('0x40')]);_0x3f588f[_0x5481('0x44')]=_[_0x5481('0x58')](_0x2a8a61['query']);_0x3f588f[_0x5481('0x4e')]=_[_0x5481('0x45')](_0x3f588f[_0x5481('0x42')],_0x3f588f['query']);_0x5ad67a[_0x5481('0x46')]=_[_0x5481('0x45')](_0x3f588f[_0x5481('0x42')],qs[_0x5481('0x47')](_0x2a8a61[_0x5481('0x44')][_0x5481('0x47')]));_0x5ad67a['attributes']=_0x5ad67a[_0x5481('0x46')][_0x5481('0x48')]?_0x5ad67a[_0x5481('0x46')]:_0x3f588f[_0x5481('0x42')];if(_0x2a8a61[_0x5481('0x44')][_0x5481('0x53')]){_0x5ad67a[_0x5481('0x59')]=[{'all':!![]}];}_0x5ad67a=_['merge']({},_0x5ad67a,_0x2a8a61['options']);return db[_0x5481('0x52')][_0x5481('0x5a')](_0x5ad67a)[_0x5481('0x3c')](handleEntityNotFound(_0x5572dd,null))[_0x5481('0x3c')](respondWithResult(_0x5572dd,null))['catch'](handleError(_0x5572dd,null));};exports[_0x5481('0x5b')]=function(_0x599745,_0x8bea45){return db['SmsMessage'][_0x5481('0x5b')](_0x599745[_0x5481('0x5c')],{})[_0x5481('0x3c')](respondWithResult(_0x8bea45,0xc9))[_0x5481('0x2c')](handleError(_0x8bea45,null));};exports[_0x5481('0x3a')]=function(_0x13d20b,_0x391ad4){if(_0x13d20b['body']['id']){delete _0x13d20b[_0x5481('0x5c')]['id'];}return db['SmsMessage'][_0x5481('0x5a')]({'where':{'id':_0x13d20b[_0x5481('0x57')]['id']}})[_0x5481('0x3c')](handleEntityNotFound(_0x391ad4,null))[_0x5481('0x3c')](saveUpdates(_0x13d20b[_0x5481('0x5c')],null))[_0x5481('0x3c')](respondWithResult(_0x391ad4,null))[_0x5481('0x2c')](handleError(_0x391ad4,null));};exports[_0x5481('0x3b')]=function(_0x10970,_0x4795b1){return db[_0x5481('0x52')][_0x5481('0x5a')]({'where':{'id':_0x10970[_0x5481('0x57')]['id']}})[_0x5481('0x3c')](handleEntityNotFound(_0x4795b1,null))[_0x5481('0x3c')](removeEntity(_0x4795b1,null))['catch'](handleError(_0x4795b1,null));};exports['describe']=function(_0x42950a,_0x47ab1a){return db[_0x5481('0x52')][_0x5481('0x5d')]()[_0x5481('0x3c')](respondWithResult(_0x47ab1a,null))['catch'](handleError(_0x47ab1a,null));};var interaction_log=require(_0x5481('0x16'))(_0x5481('0x5e'));exports['accept']=function(_0x3dd0e3,_0xc9aebe,_0x4b1d85){var _0x4e1ce8={'agent':{},'channel':_0x5481('0x5f')};if(_0x3dd0e3[_0x5481('0x5c')]['id']){delete _0x3dd0e3[_0x5481('0x5c')]['id'];}_0x3dd0e3[_0x5481('0x5c')][_0x5481('0x60')]=!![];_0x3dd0e3['body']['readAt']=moment()['format'](_0x5481('0x61'));_0x3dd0e3[_0x5481('0x5c')]['UserId']=_0x3dd0e3['body']['UserId']||_0x3dd0e3[_0x5481('0x62')]['id'];_0x4e1ce8[_0x5481('0x63')]['id']=_0x3dd0e3[_0x5481('0x5c')][_0x5481('0x64')];return db[_0x5481('0x52')]['find']({'where':{'id':_0x3dd0e3['params']['id'],'UserId':null}})[_0x5481('0x3c')](handleEntityNotFound(_0xc9aebe,null))[_0x5481('0x3c')](saveUpdates(_0x3dd0e3[_0x5481('0x5c')],null))[_0x5481('0x3c')](function(_0x57be4a){if(_0x57be4a){_0x4e1ce8[_0x5481('0x29')]=_0x57be4a[_0x5481('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x5481('0x5a')]({'where':{'id':_0x57be4a[_0x5481('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xc9aebe,null))[_0x5481('0x3c')](function(_0x428b44){if(_0x428b44){return _0x428b44[_0x5481('0x3a')]({'UserId':_0x3dd0e3[_0x5481('0x5c')][_0x5481('0x64')],'read1stAt':_['isNil'](_0x428b44['read1stAt'])?moment()[_0x5481('0x67')](_0x5481('0x61')):undefined});}return null;})[_0x5481('0x3c')](function(_0x46f576){if(_0x46f576){_0x4e1ce8[_0x5481('0x68')]=_0x46f576[_0x5481('0x65')]({'plain':!![]});interaction_log['info'](_0x5481('0x69'),_0x3dd0e3[_0x5481('0x62')]['id'],_0x3dd0e3[_0x5481('0x62')][_0x5481('0x43')],_0x3dd0e3[_0x5481('0x62')][_0x5481('0x6a')],_0x4e1ce8[_0x5481('0x68')]['id'],_0x3dd0e3[_0x5481('0x5c')]?JSON[_0x5481('0x6b')](_0x3dd0e3['body']):_0x5481('0x6c'));return respondWithRpcPromise(_0x5481('0x6d'),_0x5481('0x6e'),_0x4e1ce8);}return null;})['then'](function(_0xe0b9ad){var _0x24db02='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe0b9ad[_0x5481('0x29')][_0x5481('0x6f')];return db[_0x5481('0x70')]['query'](_0x24db02,{'type':db[_0x5481('0x71')][_0x5481('0x72')][_0x5481('0x73')],'raw':!![]})[_0x5481('0x3c')](function(_0x617b89){return _0x617b89;});})[_0x5481('0x3c')](function(_0x2dd285){if(_0x2dd285){_0x4e1ce8[_0x5481('0x29')][_0x5481('0x74')]=_0x2dd285[0x0];if(!_0x3dd0e3[_0x5481('0x5c')][_0x5481('0x64')])return;return db[_0x5481('0x75')][_0x5481('0x5a')]({'where':{'id':_0x3dd0e3[_0x5481('0x5c')][_0x5481('0x64')],'role':_0x5481('0x63')},'attributes':['id',_0x5481('0x43'),_0x5481('0x76'),'email',_0x5481('0x77')],'raw':!![]});}return null;})[_0x5481('0x3c')](function(_0x19f085){if(!_0x19f085)return null;_0x4e1ce8[_0x5481('0x29')][_0x5481('0x63')]=_0x19f085;return _0x4e1ce8;})[_0x5481('0x3c')](function(_0x30d20b){if(_0x30d20b){if(_0x3dd0e3['body'][_0x5481('0x78')]){_0x4e1ce8[_0x5481('0x29')][_0x5481('0x79')]=util[_0x5481('0x67')]('SIP/%s',_0x3dd0e3[_0x5481('0x62')][_0x5481('0x43')]);_0x4e1ce8[_0x5481('0x29')]['channel']=_0x4e1ce8[_0x5481('0x7a')];_0x4e1ce8[_0x5481('0x29')]['motionChannel']=_0x4e1ce8[_0x5481('0x7a')];_0x4e1ce8[_0x5481('0x29')][_0x5481('0x7b')]='accept';return respondWithRpcPromise(_0x5481('0x7c'),'EventManager',{'event':_0x5481('0x7d'),'message':_0x4e1ce8['message']},client9002)[_0x5481('0x3c')](function(){return _0x4e1ce8;});}return _0x4e1ce8;}return null;})[_0x5481('0x3c')](respondWithResult(_0xc9aebe,null))[_0x5481('0x2c')](handleError(_0xc9aebe,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x5481('0x38')]=function(_0x32f104,_0x3fe580,_0x1ea409){var _0x1d75d8={'agent':{},'channel':'sms'};if(_0x32f104[_0x5481('0x5c')]['id']){delete _0x32f104['body']['id'];}_0x32f104[_0x5481('0x5c')][_0x5481('0x64')]=_0x32f104[_0x5481('0x5c')][_0x5481('0x64')]||_0x32f104[_0x5481('0x62')]['id'];_0x1d75d8[_0x5481('0x63')]['id']=_0x32f104[_0x5481('0x5c')]['UserId'];return db[_0x5481('0x52')][_0x5481('0x5a')]({'where':{'id':_0x32f104[_0x5481('0x57')]['id'],'UserId':null}})[_0x5481('0x3c')](handleEntityNotFound(_0x3fe580,null))[_0x5481('0x3c')](function(_0x23f219){if(_0x23f219){_0x1d75d8[_0x5481('0x29')]=_0x23f219[_0x5481('0x65')]({'plain':!![]});return db[_0x5481('0x7e')][_0x5481('0x5a')]({'where':{'id':_0x23f219[_0x5481('0x66')]}});}return null;})[_0x5481('0x3c')](handleEntityNotFound(_0x3fe580,null))[_0x5481('0x3c')](function(_0x9d3028){if(_0x9d3028){_0x1d75d8[_0x5481('0x68')]=_0x9d3028['get']({'plain':!![]});interaction_log[_0x5481('0x2a')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x32f104[_0x5481('0x62')]['id'],_0x32f104['user'][_0x5481('0x43')],_0x32f104['user'][_0x5481('0x6a')],_0x1d75d8[_0x5481('0x68')]['id'],_0x32f104[_0x5481('0x5c')]?JSON[_0x5481('0x6b')](_0x32f104[_0x5481('0x5c')]):_0x5481('0x6c'));return respondWithRpcPromise('RejectMessage',_0x5481('0x7f'),_0x1d75d8);}return null;})[_0x5481('0x3c')](function(_0x4715d7){var _0x1f8e11='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4715d7[_0x5481('0x29')][_0x5481('0x6f')];return db['sequelize'][_0x5481('0x44')](_0x1f8e11,{'type':db[_0x5481('0x71')][_0x5481('0x72')][_0x5481('0x73')],'raw':!![]})[_0x5481('0x3c')](function(_0x3d58cc){return _0x3d58cc;});})[_0x5481('0x3c')](function(_0x5d13db){if(_0x5d13db){_0x1d75d8[_0x5481('0x29')][_0x5481('0x74')]=_0x5d13db[0x0];if(!_0x32f104[_0x5481('0x5c')]['UserId'])return;return db['User'][_0x5481('0x5a')]({'where':{'id':_0x32f104[_0x5481('0x5c')][_0x5481('0x64')],'role':_0x5481('0x63')},'attributes':['id','name',_0x5481('0x76'),_0x5481('0x80'),_0x5481('0x77')],'raw':!![]});}return null;})[_0x5481('0x3c')](function(_0x1808e4){if(!_0x1808e4)return null;_0x1d75d8[_0x5481('0x29')][_0x5481('0x63')]=_0x1808e4;return _0x1d75d8;})['then'](function(_0x58028b){if(_0x58028b){_0x58028b[_0x5481('0x29')][_0x5481('0x79')]=util[_0x5481('0x67')](_0x5481('0x81'),_0x32f104[_0x5481('0x62')][_0x5481('0x43')]);_0x58028b[_0x5481('0x29')][_0x5481('0x7a')]=_0x1d75d8[_0x5481('0x7a')];_0x58028b[_0x5481('0x29')][_0x5481('0x82')]=_0x1d75d8['channel'];_0x58028b[_0x5481('0x29')][_0x5481('0x7b')]=_0x5481('0x38');respondWithRpcPromise(_0x5481('0x7c'),_0x5481('0x7c'),{'event':_0x5481('0x83'),'message':_0x58028b[_0x5481('0x29')]},client9002);return _0x1d75d8;}return null;})[_0x5481('0x3c')](respondWithResult(_0x3fe580,null))['catch'](handleError(_0x3fe580,null));};exports[_0x5481('0x2f')]=function(_0x154d5a,_0x5415df,_0x2f8656){if(_0x154d5a[_0x5481('0x5c')]['id']){delete _0x154d5a[_0x5481('0x5c')]['id'];}var _0x461691;return db[_0x5481('0x52')][_0x5481('0x5a')]({'where':{'id':_0x154d5a[_0x5481('0x57')]['id']}})[_0x5481('0x3c')](handleEntityNotFound(_0x5415df,null))[_0x5481('0x3c')](function(_0x2937e4){if(_0x2937e4){_0x461691=_0x2937e4;return db[_0x5481('0x84')][_0x5481('0x5a')]({'where':{'id':_0x2937e4[_0x5481('0x85')]}});}})[_0x5481('0x3c')](handleEntityNotFound(_0x5415df,null))[_0x5481('0x3c')](function(_0x239ed4){if(_0x239ed4){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5481('0x2f'),_0x5481('0x86'),_0x239ed4[_0x5481('0x87')],util[_0x5481('0x88')](_0x154d5a[_0x5481('0x5c')],{'showHidden':![],'depth':null}));switch(_0x239ed4[_0x5481('0x87')]){case _0x5481('0x89'):if(_0x154d5a[_0x5481('0x5c')]['MessageSid']&&_0x154d5a[_0x5481('0x5c')][_0x5481('0x8a')]===_0x461691[_0x5481('0x8b')]){return _0x461691[_0x5481('0x3a')]({'read':!![]});}else{logger[_0x5481('0x26')](_0x5481('0x8c'),_0x5481('0x2f'),_0x5481('0x89'),util[_0x5481('0x88')](_0x154d5a['body'],{'showHidden':![],'depth':null}));}break;case _0x5481('0x8d'):if(_0x154d5a[_0x5481('0x5c')][_0x5481('0x8e')]&&_0x154d5a[_0x5481('0x5c')][_0x5481('0x8e')]===_0x461691[_0x5481('0x8b')]&&_[_0x5481('0x8f')]([_0x5481('0x90'),_0x5481('0x91')],_0x154d5a[_0x5481('0x5c')][_0x5481('0x92')])>=0x0){return _0x461691[_0x5481('0x3a')]({'read':!![]});}else{logger['error'](_0x5481('0x8c'),_0x5481('0x2f'),_0x5481('0x93'),util['inspect'](_0x154d5a['body'],{'showHidden':![],'depth':null}));}break;case _0x5481('0x94'):var _0x40d0fe=_0x154d5a[_0x5481('0x5c')][_0x5481('0x95')][0x0];if(_0x40d0fe[_0x5481('0x2f')][_0x5481('0x96')]===_0x5481('0x97')){return _0x461691['update']({'read':!![]});}else{logger[_0x5481('0x26')](_0x5481('0x8c'),'status',_0x5481('0x94'),util[_0x5481('0x88')](_0x154d5a[_0x5481('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x461691;}})[_0x5481('0x3c')](respondWithResult(_0x5415df,null))['catch'](handleError(_0x5415df,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 3d4a4c1..30bb6ff 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 _0xdfcd=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsMessage'];(function(_0xe763da,_0x163779){var _0x3c9d29=function(_0x5af254){while(--_0x5af254){_0xe763da['push'](_0xe763da['shift']());}};_0x3c9d29(++_0x163779);}(_0xdfcd,0x13e));var _0xddfc=function(_0x2fe2db,_0x50366e){_0x2fe2db=_0x2fe2db-0x0;var _0x48d43f=_0xdfcd[_0x2fe2db];return _0x48d43f;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xddfc('0x0'))['db'][_0xddfc('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xddfc('0x2')](0x0);var events={'afterCreate':_0xddfc('0x3'),'afterUpdate':_0xddfc('0x4'),'afterDestroy':_0xddfc('0x5')};function emitEvent(_0x6f6d60){return function(_0x18a7d4,_0x584db9,_0x67a908){SmsMessageEvents[_0xddfc('0x6')](_0x6f6d60+':'+_0x18a7d4['id'],_0x18a7d4);SmsMessageEvents[_0xddfc('0x6')](_0x6f6d60,_0x18a7d4);_0x67a908(null);};}for(var e in events){if(events[_0xddfc('0x7')](e)){var event=events[e];SmsMessage[_0xddfc('0x8')](e,emitEvent(event));}}module[_0xddfc('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xfbfe=['hook','exports','events','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1c6a78,_0x3af403){var _0x125a4e=function(_0x4e1206){while(--_0x4e1206){_0x1c6a78['push'](_0x1c6a78['shift']());}};_0x125a4e(++_0x3af403);}(_0xfbfe,0x17e));var _0xefbf=function(_0xf8f71b,_0x2cc6b8){_0xf8f71b=_0xf8f71b-0x0;var _0x187a29=_0xfbfe[_0xf8f71b];return _0x187a29;};'use strict';var EventEmitter=require(_0xefbf('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xefbf('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xefbf('0x2')](0x0);var events={'afterCreate':_0xefbf('0x3'),'afterUpdate':_0xefbf('0x4'),'afterDestroy':_0xefbf('0x5')};function emitEvent(_0x584525){return function(_0x3e3b73,_0x291f9f,_0x219e53){SmsMessageEvents[_0xefbf('0x6')](_0x584525+':'+_0x3e3b73['id'],_0x3e3b73);SmsMessageEvents['emit'](_0x584525,_0x3e3b73);_0x219e53(null);};}for(var e in events){if(events[_0xefbf('0x7')](e)){var event=events[e];SmsMessage[_0xefbf('0x8')](e,emitEvent(event));}}module[_0xefbf('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 1051a76..b6236a2 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 _0x0e90=['/auth/1/session','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','createHash','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','Bearer\x20','message','status','refid','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','secret','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','requestid','connectel','Missing\x20parameters:\x20authToken','%s:%s','format','toString','base64','http_code','queued_count','head','clickSend','/api/sms/messages/','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl'];(function(_0x131d5d,_0xacd10c){var _0x15d827=function(_0x7bb657){while(--_0x7bb657){_0x131d5d['push'](_0x131d5d['shift']());}};_0x15d827(++_0xacd10c);}(_0x0e90,0x10c));var _0x00e9=function(_0x35645d,_0x58ab56){_0x35645d=_0x35645d-0x0;var _0x34e946=_0x0e90[_0x35645d];return _0x34e946;};'use strict';var _=require(_0x00e9('0x0'));var util=require(_0x00e9('0x1'));var logger=require(_0x00e9('0x2'))(_0x00e9('0x3'));var moment=require('moment');var BPromise=require(_0x00e9('0x4'));var rp=require(_0x00e9('0x5'));var fs=require('fs');var path=require(_0x00e9('0x6'));var rimraf=require('rimraf');var config=require(_0x00e9('0x7'));var attributes=require(_0x00e9('0x8'));module['exports']=function(_0x300a4e,_0x573aa5){return _0x300a4e[_0x00e9('0x9')](_0x00e9('0xa'),attributes,{'tableName':_0x00e9('0xb'),'paranoid':![],'indexes':[{'name':_0x00e9('0xc'),'fields':[_0x00e9('0xc')]},{'name':'fti_sms_messages','fields':[_0x00e9('0xd')],'type':_0x00e9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34ed8a,_0xe0cc56,_0x3049d7){var _0x2d0dc0=_0x300a4e[_0x00e9('0xf')];var _0x15a480=_0x34ed8a['get']({'plain':!![]});if(_0x15a480[_0x00e9('0x10')][_0x00e9('0x11')]()==='in'||_0x15a480[_0x00e9('0x10')][_0x00e9('0x11')]()==='out'&&!_0x15a480[_0x00e9('0x12')]&&!_['isNil'](_0x15a480[_0x00e9('0x13')])&&!_['isNil'](_0x15a480[_0x00e9('0x14')])){_0x2d0dc0['SmsInteraction'][_0x00e9('0x15')]({'where':{'id':_0x15a480['SmsInteractionId']}})[_0x00e9('0x16')](function(_0x1b74d6){if(_0x1b74d6){_0x1b74d6[_0x00e9('0x17')]({'lastMsgAt':_0x15a480[_0x00e9('0x18')],'lastMsgDirection':_0x15a480[_0x00e9('0x10')][_0x00e9('0x11')]()});}})[_0x00e9('0x19')](function(_0x3031f4){console[_0x00e9('0x1a')](_0x3031f4);});}if(_0x15a480['direction']===_0x00e9('0x1b')&&!_0x15a480[_0x00e9('0x12')]){var _0x3893cb;_0x2d0dc0[_0x00e9('0x1c')][_0x00e9('0x1d')]({'where':{'id':_0x15a480[_0x00e9('0x1e')]},'raw':!![]})[_0x00e9('0x16')](function(_0x4d8d94){_0x3893cb=_0x4d8d94;if(_0x3893cb&&_0x3893cb['type']){switch(_0x3893cb['type']){case _0x00e9('0x1f'):var _0xbc8a13=require('twilio');if(_0x3893cb[_0x00e9('0x20')]&&_0x3893cb[_0x00e9('0x21')]&&_0x3893cb[_0x00e9('0x22')]){var _0x5daf16=new _0xbc8a13(_0x3893cb[_0x00e9('0x20')],_0x3893cb['authToken']);_0x5daf16[_0x00e9('0x23')][_0x00e9('0x24')]({'body':_0x15a480[_0x00e9('0xd')],'to':_0x15a480[_0x00e9('0x22')],'from':_0x3893cb['phone'],'statusCallback':_0x3893cb[_0x00e9('0x25')]+'/api/sms/messages/'+_0x15a480['id']+_0x00e9('0x26')+_0x3893cb[_0x00e9('0x27')]})['then'](function(_0x135cf9){if(_0x135cf9[_0x00e9('0x28')]){return _0x34ed8a[_0x00e9('0x17')]({'messageId':_0x135cf9[_0x00e9('0x28')]});}})[_0x00e9('0x19')](function(_0xff0458){logger['error'](_0x00e9('0x29'),'afterCreate',_0x00e9('0x1f'),util[_0x00e9('0x2a')](_0xff0458,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x1f'),_0x00e9('0x2c'));}break;case _0x00e9('0x2d'):var _0x2dff04='https://api.skebby.it/API/v1.0/REST/';if(_0x3893cb['username']&&_0x3893cb[_0x00e9('0x2e')]){var _0x1c7177={'recipient':[_0x15a480[_0x00e9('0x22')]],'message':_0x15a480[_0x00e9('0xd')],'message_type':_0x3893cb[_0x00e9('0x2f')]};if(_0x3893cb['smsMethod']&&_0x3893cb[_0x00e9('0x2f')]!=='SI'){_0x1c7177[_0x00e9('0x30')]=_0x3893cb[_0x00e9('0x22')];}var _0x5c6b54={'url':_0x2dff04+_0x00e9('0x31')+_0x3893cb[_0x00e9('0x32')]+_0x00e9('0x33')+_0x3893cb[_0x00e9('0x2e')],'method':_0x00e9('0x34')};rp(_0x5c6b54)[_0x00e9('0x16')](function(_0x262f56){var _0x3444bc=_0x262f56[_0x00e9('0x35')](';');var _0x628ab5={'user_key':_0x3444bc[0x0],'session_key':_0x3444bc[0x1]};_0x5c6b54={'url':_0x2dff04+_0x00e9('0x36'),'method':_0x00e9('0x37'),'headers':{'user_key':_0x628ab5['user_key'],'Session_key':_0x628ab5['session_key']},'json':!![],'body':_0x1c7177};return rp(_0x5c6b54);})[_0x00e9('0x16')](function(_0x42d9a4){if(_0x42d9a4['total_sent']>=0x1){var _0xdf67ef={'messageId':_0x42d9a4[_0x00e9('0x38')]};if(_0x3893cb[_0x00e9('0x2f')]!=='GP'||!_0x3893cb[_0x00e9('0x39')]){_0xdf67ef[_0x00e9('0x3a')]=!![];}return _0x34ed8a['update'](_0xdf67ef);}else{return logger[_0x00e9('0x1a')](_0x00e9('0x29'),'afterCreate',_0x00e9('0x2d'),util['inspect'](_0x42d9a4,{'showHidden':![],'depth':null}));}})[_0x00e9('0x19')](function(_0x589137){return logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x2d'),util['inspect'](_0x589137,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x00e9('0x2d'),_0x00e9('0x3b'));}break;case'connectel':if(_0x3893cb[_0x00e9('0x21')]){var _0x1fa6b3={'recipient':_0x15a480[_0x00e9('0x22')],'message':_0x15a480[_0x00e9('0xd')],'sender':_0x3893cb[_0x00e9('0x3c')]||_0x3893cb[_0x00e9('0x22')],'authorization':_0x3893cb[_0x00e9('0x21')]};var _0xe0cc56={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1fa6b3,'json':!![]};rp(_0xe0cc56)[_0x00e9('0x16')](function(_0x2f58bb){var _0x3f0735={'messageId':_0x2f58bb[_0x00e9('0x3d')]};if(!_0x3893cb[_0x00e9('0x39')]){_0x3f0735['read']=!![];}return _0x34ed8a[_0x00e9('0x17')](_0x3f0735);})[_0x00e9('0x19')](function(_0x19899a){logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x3e'),util[_0x00e9('0x2a')](_0x19899a,{'showHidden':![],'depth':null}));});}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),'connectel',_0x00e9('0x3f'));}break;case'clicksend':if(_0x3893cb['username']&&_0x3893cb[_0x00e9('0x2e')]){var _0x1fa6b3={'messages':[{'source':'xCALLY\x20Motion','to':_0x15a480[_0x00e9('0x22')],'body':_0x15a480['body'],'from':_0x3893cb[_0x00e9('0x3c')]||_0x3893cb[_0x00e9('0x22')]}]};var _0x2b8168=util['format'](_0x00e9('0x40'),_0x3893cb[_0x00e9('0x32')],_0x3893cb[_0x00e9('0x2e')]);var _0xe0cc56={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1fa6b3,'headers':{'Authorization':util[_0x00e9('0x41')]('Basic\x20%s',new Buffer(_0x2b8168)[_0x00e9('0x42')](_0x00e9('0x43')))},'json':!![]};rp(_0xe0cc56)[_0x00e9('0x16')](function(_0x2155c8){if(_0x2155c8[_0x00e9('0x44')]>=0xc8&&_0x2155c8['http_code']<=0xce){if(_0x2155c8['data']&&_0x2155c8['data'][_0x00e9('0x45')]>0x0){var _0x283095=_[_0x00e9('0x46')](_0x2155c8['data'][_0x00e9('0x23')]);var _0x3a28ec={'messageId':_0x283095['message_id']};if(!_0x3893cb['deliveryReport']){_0x3a28ec['read']=!![];}return _0x34ed8a[_0x00e9('0x17')](_0x3a28ec);}else{logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x47'),util['inspect'](_0x2155c8,{'showHidden':![],'depth':null}));}}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x47'),util[_0x00e9('0x2a')](_0x2155c8,{'showHidden':![],'depth':null}));}})[_0x00e9('0x19')](function(_0x312c08){logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x47'),util['inspect'](_0x312c08,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x47'),_0x00e9('0x3b'));}break;case'plivo':if(_0x3893cb['authId']&&_0x3893cb[_0x00e9('0x21')]){var _0x1fa6b3={'dst':_0x15a480[_0x00e9('0x22')],'text':_0x15a480['body'],'src':_0x3893cb[_0x00e9('0x3c')]||_0x3893cb[_0x00e9('0x22')],'url':_0x3893cb[_0x00e9('0x25')]+_0x00e9('0x48')+_0x15a480['id']+_0x00e9('0x26')+_0x3893cb['token']};var _0x2b8168=util['format']('%s:%s',_0x3893cb[_0x00e9('0x49')],_0x3893cb['authToken']);var _0xe0cc56={'method':_0x00e9('0x37'),'uri':util['format'](_0x00e9('0x4a'),_0x3893cb['authId']),'body':_0x1fa6b3,'headers':{'Authorization':util[_0x00e9('0x41')](_0x00e9('0x4b'),new Buffer(_0x2b8168)[_0x00e9('0x42')](_0x00e9('0x43')))},'json':!![]};rp(_0xe0cc56)[_0x00e9('0x16')](function(_0x22f28f){var _0x6b8b20={'messageId':_0x22f28f[_0x00e9('0x4c')][0x0]};return _0x34ed8a[_0x00e9('0x17')](_0x6b8b20);})['catch'](function(_0xc099fe){logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),'plivo',util[_0x00e9('0x2a')](_0xc099fe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x4d'),_0x00e9('0x4e'));}break;case'infobip':if(_0x3893cb[_0x00e9('0x32')]&&_0x3893cb['password']){if(_0x3893cb[_0x00e9('0x4f')]){var _0x5c9285={'method':'POST','uri':_0x3893cb['baseUrl']+_0x00e9('0x50'),'body':{'username':_0x3893cb['username'],'password':_0x3893cb['password']},'json':!![]};return rp(_0x5c9285)[_0x00e9('0x16')](function(_0x334583){var _0x479d1f={'method':_0x00e9('0x37'),'uri':_0x3893cb[_0x00e9('0x4f')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3893cb['phone'],'destinations':[{'to':_0x15a480[_0x00e9('0x22')]}],'text':_0x15a480[_0x00e9('0xd')],'notifyUrl':_0x3893cb[_0x00e9('0x25')]+_0x00e9('0x48')+_0x15a480['id']+_0x00e9('0x26')+_0x3893cb[_0x00e9('0x27')],'notifyContentType':'application/json','callbackData':_0x3893cb[_0x00e9('0x22')]+';'+_0x15a480[_0x00e9('0xd')]}]},'headers':{'Authorization':_0x00e9('0x51')+_0x334583[_0x00e9('0x27')]},'json':!![]};return rp(_0x479d1f)[_0x00e9('0x16')](function(_0x47d194){if(_0x47d194[_0x00e9('0x23')]){var _0x57c834={'messageId':_0x47d194[_0x00e9('0x23')][0x0]['messageId']};if(!_0x3893cb['deliveryReport']){_0x57c834[_0x00e9('0x3a')]=!![];}return _0x34ed8a['update'](_0x57c834);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x00e9('0x2b'),'infobip',util[_0x00e9('0x2a')](_0x47d194,{'showHidden':![],'depth':null}));}});})[_0x00e9('0x19')](function(_0x2bdba0){return logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x52'),util[_0x00e9('0x2a')](_0x2bdba0,{'showHidden':![],'depth':null}));});}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),'infobip',_0x00e9('0x53'));}}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x00e9('0x54'):var _0x273c92=require(_0x00e9('0x55'));if(_0x3893cb[_0x00e9('0x56')]){var _0x8879b1={};_0x8879b1[_0x00e9('0x57')]=_0x3893cb[_0x00e9('0x32')];_0x8879b1[_0x00e9('0x22')]=_0x15a480['phone'];_0x8879b1[_0x00e9('0x30')]=_0x3893cb[_0x00e9('0x22')];_0x8879b1[_0x00e9('0x58')]=_0x15a480['body'];_0x8879b1[_0x00e9('0x59')]=+new Date();var _0x20b89f='';var _0x34c62b='';var _0x30e0da=Object[_0x00e9('0x5a')](_0x8879b1);_0x30e0da['sort']();for(var _0x36aae7=0x0;_0x36aae7<_0x30e0da[_0x00e9('0x5b')];_0x36aae7++){if(_0x20b89f!=''){_0x20b89f+='&';}_0x20b89f+=_0x30e0da[_0x36aae7]+'='+encodeURIComponent(_0x8879b1[_0x30e0da[_0x36aae7]]);_0x34c62b+=_0x8879b1[_0x30e0da[_0x36aae7]];}_0x34c62b+=_0x3893cb[_0x00e9('0x56')];_0x34c62b=_0x273c92[_0x00e9('0x5c')]('md5')[_0x00e9('0x17')](_0x34c62b)[_0x00e9('0x5d')]('hex');if(_0x20b89f!==''){_0x20b89f+='&';}_0x20b89f+=_0x00e9('0x5e')+_0x34c62b;var _0x5c6b54={'method':_0x00e9('0x34'),'uri':_0x3893cb[_0x00e9('0x4f')]+'/external/get/send.php?'+_0x20b89f,'json':!![]};return rp(_0x5c6b54)['then'](function(_0xbc83b6){var _0x376ada=Object[_0x00e9('0x5a')](_0xbc83b6);if(_0xbc83b6[_0x376ada[0x0]]['error']&&parseInt(_0xbc83b6[_0x376ada[0x0]][_0x00e9('0x1a')])===0x0){var _0x22566a={'messageId':_0xbc83b6[_0x376ada[0x0]][_0x00e9('0x5f')]};if(!_0x3893cb[_0x00e9('0x39')]){_0x22566a[_0x00e9('0x3a')]=!![];}return _0x34ed8a[_0x00e9('0x17')](_0x22566a);}else{return logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),'csc',util['inspect'](_0xbc83b6[_0x00e9('0x1a')],{'showHidden':![],'depth':null}));}})[_0x00e9('0x19')](function(_0x22c584){return logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),'csc',util[_0x00e9('0x2a')](_0x22c584,{'showHidden':![],'depth':null}));});}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x54'),_0x00e9('0x60'));}break;case _0x00e9('0x61'):if(_0x3893cb[_0x00e9('0x56')]){var _0x172fd1={'method':_0x00e9('0x37'),'uri':_0x00e9('0x62'),'headers':{'Authorization':_0x3893cb[_0x00e9('0x56')]},'body':{'content':_0x15a480[_0x00e9('0xd')],'to':[_0x15a480[_0x00e9('0x22')]],'from':_0x3893cb[_0x00e9('0x22')],'binary':![],'clientMessageId':_0x00e9('0x63'),'charset':'UTF-8'},'json':!![]};rp(_0x172fd1)[_0x00e9('0x16')](function(_0x429f0b){if(!_0x429f0b[_0x00e9('0x1a')]){var _0x3a13a7={'messageId':_0x429f0b[_0x00e9('0x23')][0x0][_0x00e9('0x64')]};if(!_0x3893cb['deliveryReport']){_0x3a13a7['read']=!![];}return _0x34ed8a['update'](_0x3a13a7);}else{return logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),'clickatell',util[_0x00e9('0x2a')](_0x429f0b['error'],{'showHidden':![],'depth':null}));}})[_0x00e9('0x19')](function(_0x458a97){return logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x61'),util[_0x00e9('0x2a')](_0x458a97,{'showHidden':![],'depth':null}));});}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x61'),_0x00e9('0x60'));}break;case _0x00e9('0x65'):if(_0x3893cb[_0x00e9('0x32')]&&_0x3893cb['password']){var _0x2b8168=util[_0x00e9('0x41')]('%s:%s',_0x3893cb[_0x00e9('0x32')],_0x3893cb[_0x00e9('0x2e')]);var _0xe0cc56={'method':_0x00e9('0x37'),'uri':_0x00e9('0x66')+_0x3893cb['accountId']+_0x00e9('0x67'),'body':{'to':[_0x15a480[_0x00e9('0x22')]],'text':_0x15a480['body'],'from':_0x3893cb['phone'],'applicationId':_0x3893cb[_0x00e9('0x68')]},'headers':{'Authorization':util[_0x00e9('0x41')]('Basic\x20%s',new Buffer(_0x2b8168)[_0x00e9('0x42')](_0x00e9('0x43')))},'json':!![]};rp(_0xe0cc56)[_0x00e9('0x16')](function(_0x2af1e0){if(_0x2af1e0['id']){var _0x44a868={'messageId':_0x2af1e0['id']};return _0x34ed8a[_0x00e9('0x17')](_0x44a868);}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x65'),util[_0x00e9('0x2a')](_0x2af1e0,{'showHidden':![],'depth':null}));}})[_0x00e9('0x19')](function(_0x359b3f){logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x65'),util[_0x00e9('0x2a')](_0x359b3f,{'showHidden':![],'depth':null}));});}else{logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),'bandwidth',_0x00e9('0x3b'));}break;case _0x00e9('0x69'):if(_0x3893cb[_0x00e9('0x56')]){var _0x3d0dd7={};var _0x5c6b54={'method':_0x00e9('0x37'),'uri':_0x00e9('0x6a'),'headers':{'Authorization':'Bearer\x20'+_0x3893cb['apiKey'],'Content-Type':_0x00e9('0x6b')},'body':{'from':_0x3893cb[_0x00e9('0x22')],'to':_0x15a480[_0x00e9('0x22')],'text':_0x15a480[_0x00e9('0xd')]},'json':!![]};return rp(_0x5c6b54)[_0x00e9('0x16')](function(_0x1b3562){if(_0x1b3562[_0x00e9('0x6c')]==0xca){_0x3d0dd7['message']=_0x1b3562;var _0x2e0143={'method':_0x00e9('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x00e9('0x6d')+_0x3893cb[_0x00e9('0x56')],'Content-Type':_0x00e9('0x6b')},'body':{'refid':_0x3d0dd7[_0x00e9('0x6e')]['refid']},'json':!![]};return rp(_0x2e0143)[_0x00e9('0x16')](function(_0x9469a){_0x3d0dd7[_0x00e9('0x6f')]=_0x9469a;var _0x1cc89b={'messageId':_0x3d0dd7[_0x00e9('0x6e')][_0x00e9('0x70')],'read':!![]};return _0x34ed8a[_0x00e9('0x17')](_0x1cc89b);});}else{return logger[_0x00e9('0x1a')](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x69'),util[_0x00e9('0x2a')](_0x1b3562,{'showHidden':![],'depth':null}));}})[_0x00e9('0x19')](function(_0x499b54){return logger[_0x00e9('0x1a')](_0x00e9('0x29'),'afterCreate','intelepeer',util[_0x00e9('0x2a')](_0x499b54,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x00e9('0x29'),_0x00e9('0x2b'),_0x00e9('0x69'),_0x00e9('0x71'));}break;}}})['finally'](function(){_0x3049d7();});}else{_0x3049d7();}}},'charset':_0x00e9('0x72'),'collate':_0x00e9('0x73')});}; \ No newline at end of file +var _0xf13e=['models','get','toLowerCase','out','secret','isNil','SmsInteractionId','update','catch','error','direction','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','create','body','phone','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','user_key','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','xCALLY\x20Motion','%s:%s','POST','format','Basic\x20%s','toString','http_code','data','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','finally','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT'];(function(_0x2161e,_0x30f769){var _0x377e75=function(_0x46b708){while(--_0x46b708){_0x2161e['push'](_0x2161e['shift']());}};_0x377e75(++_0x30f769);}(_0xf13e,0x15c));var _0xef13=function(_0x54f73e,_0x4946c1){_0x54f73e=_0x54f73e-0x0;var _0x5ed7cd=_0xf13e[_0x54f73e];return _0x5ed7cd;};'use strict';var _=require(_0xef13('0x0'));var util=require(_0xef13('0x1'));var logger=require('../../config/logger')(_0xef13('0x2'));var moment=require(_0xef13('0x3'));var BPromise=require(_0xef13('0x4'));var rp=require(_0xef13('0x5'));var fs=require('fs');var path=require(_0xef13('0x6'));var rimraf=require(_0xef13('0x7'));var config=require(_0xef13('0x8'));var attributes=require(_0xef13('0x9'));module['exports']=function(_0x5ea551,_0x25eb9f){return _0x5ea551['define'](_0xef13('0xa'),attributes,{'tableName':_0xef13('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xef13('0xc')]},{'name':_0xef13('0xd'),'fields':['body'],'type':_0xef13('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50cc07,_0x4e5b87,_0x10c5f5){var _0x3f466d=_0x5ea551[_0xef13('0xf')];var _0x136eb3=_0x50cc07[_0xef13('0x10')]({'plain':!![]});if(_0x136eb3['direction'][_0xef13('0x11')]()==='in'||_0x136eb3['direction'][_0xef13('0x11')]()===_0xef13('0x12')&&!_0x136eb3[_0xef13('0x13')]&&!_[_0xef13('0x14')](_0x136eb3['UserId'])&&!_[_0xef13('0x14')](_0x136eb3[_0xef13('0x15')])){_0x3f466d['SmsInteraction']['findOne']({'where':{'id':_0x136eb3[_0xef13('0x15')]}})['then'](function(_0x13f7ef){if(_0x13f7ef){_0x13f7ef[_0xef13('0x16')]({'lastMsgAt':_0x136eb3['createdAt'],'lastMsgDirection':_0x136eb3['direction'][_0xef13('0x11')]()});}})[_0xef13('0x17')](function(_0x2c9586){console[_0xef13('0x18')](_0x2c9586);});}if(_0x136eb3[_0xef13('0x19')]===_0xef13('0x12')&&!_0x136eb3[_0xef13('0x13')]){var _0x351130;_0x3f466d[_0xef13('0x1a')][_0xef13('0x1b')]({'where':{'id':_0x136eb3[_0xef13('0x1c')]},'raw':!![]})[_0xef13('0x1d')](function(_0x513b2f){_0x351130=_0x513b2f;if(_0x351130&&_0x351130[_0xef13('0x1e')]){switch(_0x351130[_0xef13('0x1e')]){case _0xef13('0x1f'):var _0x2f853c=require(_0xef13('0x1f'));if(_0x351130[_0xef13('0x20')]&&_0x351130['authToken']&&_0x351130['phone']){var _0xc8450=new _0x2f853c(_0x351130['accountSid'],_0x351130[_0xef13('0x21')]);_0xc8450['messages'][_0xef13('0x22')]({'body':_0x136eb3[_0xef13('0x23')],'to':_0x136eb3[_0xef13('0x24')],'from':_0x351130['phone'],'statusCallback':_0x351130[_0xef13('0x25')]+_0xef13('0x26')+_0x136eb3['id']+_0xef13('0x27')+_0x351130[_0xef13('0x28')]})[_0xef13('0x1d')](function(_0x5771fd){if(_0x5771fd['sid']){return _0x50cc07[_0xef13('0x16')]({'messageId':_0x5771fd[_0xef13('0x29')]});}})[_0xef13('0x17')](function(_0x5ed831){logger[_0xef13('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xef13('0x2a'),_0xef13('0x1f'),util[_0xef13('0x2b')](_0x5ed831,{'showHidden':![],'depth':null}));});}else{logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xef13('0x2d'):var _0xd3bc5a=_0xef13('0x2e');if(_0x351130[_0xef13('0x2f')]&&_0x351130[_0xef13('0x30')]){var _0x48ac62={'recipient':[_0x136eb3[_0xef13('0x24')]],'message':_0x136eb3[_0xef13('0x23')],'message_type':_0x351130[_0xef13('0x31')]};if(_0x351130['smsMethod']&&_0x351130['smsMethod']!=='SI'){_0x48ac62[_0xef13('0x32')]=_0x351130['phone'];}var _0x377709={'url':_0xd3bc5a+_0xef13('0x33')+_0x351130[_0xef13('0x2f')]+_0xef13('0x34')+_0x351130[_0xef13('0x30')],'method':_0xef13('0x35')};rp(_0x377709)[_0xef13('0x1d')](function(_0x3c980b){var _0xef0fbb=_0x3c980b[_0xef13('0x36')](';');var _0x589a9b={'user_key':_0xef0fbb[0x0],'session_key':_0xef0fbb[0x1]};_0x377709={'url':_0xd3bc5a+_0xef13('0x37'),'method':'POST','headers':{'user_key':_0x589a9b[_0xef13('0x38')],'Session_key':_0x589a9b['session_key']},'json':!![],'body':_0x48ac62};return rp(_0x377709);})[_0xef13('0x1d')](function(_0x15f7b6){if(_0x15f7b6['total_sent']>=0x1){var _0x3ab427={'messageId':_0x15f7b6['internal_order_id']};if(_0x351130[_0xef13('0x31')]!=='GP'||!_0x351130['deliveryReport']){_0x3ab427[_0xef13('0x39')]=!![];}return _0x50cc07[_0xef13('0x16')](_0x3ab427);}else{return logger[_0xef13('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xef13('0x2a'),_0xef13('0x2d'),util[_0xef13('0x2b')](_0x15f7b6,{'showHidden':![],'depth':null}));}})['catch'](function(_0x260aa0){return logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),'skebby',util['inspect'](_0x260aa0,{'showHidden':![],'depth':null}));});}else{logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),'skebby',_0xef13('0x3a'));}break;case'connectel':if(_0x351130[_0xef13('0x21')]){var _0xcaaa47={'recipient':_0x136eb3['phone'],'message':_0x136eb3['body'],'sender':_0x351130[_0xef13('0x3b')]||_0x351130[_0xef13('0x24')],'authorization':_0x351130['authToken']};var _0x4e5b87={'method':'POST','uri':_0xef13('0x3c'),'body':_0xcaaa47,'json':!![]};rp(_0x4e5b87)[_0xef13('0x1d')](function(_0x2aade1){var _0x42dcac={'messageId':_0x2aade1[_0xef13('0x3d')]};if(!_0x351130[_0xef13('0x3e')]){_0x42dcac['read']=!![];}return _0x50cc07['update'](_0x42dcac);})['catch'](function(_0x3ade6d){logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x3f'),util[_0xef13('0x2b')](_0x3ade6d,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xef13('0x2a'),_0xef13('0x3f'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x351130[_0xef13('0x2f')]&&_0x351130['password']){var _0xcaaa47={'messages':[{'source':_0xef13('0x40'),'to':_0x136eb3[_0xef13('0x24')],'body':_0x136eb3[_0xef13('0x23')],'from':_0x351130[_0xef13('0x3b')]||_0x351130[_0xef13('0x24')]}]};var _0xddd971=util['format'](_0xef13('0x41'),_0x351130[_0xef13('0x2f')],_0x351130['password']);var _0x4e5b87={'method':_0xef13('0x42'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0xcaaa47,'headers':{'Authorization':util[_0xef13('0x43')](_0xef13('0x44'),new Buffer(_0xddd971)[_0xef13('0x45')]('base64'))},'json':!![]};rp(_0x4e5b87)['then'](function(_0x1d8eea){if(_0x1d8eea[_0xef13('0x46')]>=0xc8&&_0x1d8eea[_0xef13('0x46')]<=0xce){if(_0x1d8eea[_0xef13('0x47')]&&_0x1d8eea[_0xef13('0x47')]['queued_count']>0x0){var _0x2dc07e=_[_0xef13('0x48')](_0x1d8eea[_0xef13('0x47')][_0xef13('0x49')]);var _0x416a76={'messageId':_0x2dc07e[_0xef13('0x4a')]};if(!_0x351130[_0xef13('0x3e')]){_0x416a76[_0xef13('0x39')]=!![];}return _0x50cc07[_0xef13('0x16')](_0x416a76);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0xef13('0x2b')](_0x1d8eea,{'showHidden':![],'depth':null}));}}else{logger[_0xef13('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xef13('0x2a'),_0xef13('0x4b'),util[_0xef13('0x2b')](_0x1d8eea,{'showHidden':![],'depth':null}));}})[_0xef13('0x17')](function(_0x3c8e44){logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),'clickSend',util['inspect'](_0x3c8e44,{'showHidden':![],'depth':null}));});}else{logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xef13('0x4c'):if(_0x351130[_0xef13('0x4d')]&&_0x351130[_0xef13('0x21')]){var _0xcaaa47={'dst':_0x136eb3[_0xef13('0x24')],'text':_0x136eb3['body'],'src':_0x351130[_0xef13('0x3b')]||_0x351130[_0xef13('0x24')],'url':_0x351130[_0xef13('0x25')]+_0xef13('0x26')+_0x136eb3['id']+_0xef13('0x27')+_0x351130[_0xef13('0x28')]};var _0xddd971=util[_0xef13('0x43')](_0xef13('0x41'),_0x351130[_0xef13('0x4d')],_0x351130['authToken']);var _0x4e5b87={'method':_0xef13('0x42'),'uri':util['format'](_0xef13('0x4e'),_0x351130[_0xef13('0x4d')]),'body':_0xcaaa47,'headers':{'Authorization':util[_0xef13('0x43')](_0xef13('0x44'),new Buffer(_0xddd971)[_0xef13('0x45')](_0xef13('0x4f')))},'json':!![]};rp(_0x4e5b87)[_0xef13('0x1d')](function(_0xdbf246){var _0x2ac55d={'messageId':_0xdbf246[_0xef13('0x50')][0x0]};return _0x50cc07[_0xef13('0x16')](_0x2ac55d);})[_0xef13('0x17')](function(_0x310b1d){logger[_0xef13('0x18')](_0xef13('0x2c'),'afterCreate','plivo',util['inspect'](_0x310b1d,{'showHidden':![],'depth':null}));});}else{logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x4c'),_0xef13('0x51'));}break;case _0xef13('0x52'):if(_0x351130['username']&&_0x351130[_0xef13('0x30')]){if(_0x351130[_0xef13('0x53')]){var _0x5001fc={'method':_0xef13('0x42'),'uri':_0x351130[_0xef13('0x53')]+_0xef13('0x54'),'body':{'username':_0x351130['username'],'password':_0x351130[_0xef13('0x30')]},'json':!![]};return rp(_0x5001fc)[_0xef13('0x1d')](function(_0x275204){var _0x483931={'method':_0xef13('0x42'),'uri':_0x351130['baseUrl']+_0xef13('0x55'),'body':{'messages':[{'from':_0x351130[_0xef13('0x24')],'destinations':[{'to':_0x136eb3[_0xef13('0x24')]}],'text':_0x136eb3[_0xef13('0x23')],'notifyUrl':_0x351130[_0xef13('0x25')]+_0xef13('0x26')+_0x136eb3['id']+_0xef13('0x27')+_0x351130[_0xef13('0x28')],'notifyContentType':_0xef13('0x56'),'callbackData':_0x351130[_0xef13('0x24')]+';'+_0x136eb3[_0xef13('0x23')]}]},'headers':{'Authorization':_0xef13('0x57')+_0x275204[_0xef13('0x28')]},'json':!![]};return rp(_0x483931)[_0xef13('0x1d')](function(_0x4cfb48){if(_0x4cfb48[_0xef13('0x49')]){var _0x12a983={'messageId':_0x4cfb48[_0xef13('0x49')][0x0][_0xef13('0xc')]};if(!_0x351130[_0xef13('0x3e')]){_0x12a983[_0xef13('0x39')]=!![];}return _0x50cc07[_0xef13('0x16')](_0x12a983);}else{return logger[_0xef13('0x18')](_0xef13('0x2c'),'afterCreate',_0xef13('0x52'),util[_0xef13('0x2b')](_0x4cfb48,{'showHidden':![],'depth':null}));}});})[_0xef13('0x17')](function(_0x10104b){return logger[_0xef13('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xef13('0x2a'),_0xef13('0x52'),util['inspect'](_0x10104b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),'infobip',_0xef13('0x3a'));}break;case _0xef13('0x58'):var _0x2ae762=require(_0xef13('0x59'));if(_0x351130[_0xef13('0x5a')]){var _0x1fcfa9={};_0x1fcfa9[_0xef13('0x5b')]=_0x351130[_0xef13('0x2f')];_0x1fcfa9[_0xef13('0x24')]=_0x136eb3[_0xef13('0x24')];_0x1fcfa9[_0xef13('0x32')]=_0x351130[_0xef13('0x24')];_0x1fcfa9[_0xef13('0x5c')]=_0x136eb3[_0xef13('0x23')];_0x1fcfa9[_0xef13('0x5d')]=+new Date();var _0x4aa22b='';var _0x516ba4='';var _0x4c679b=Object[_0xef13('0x5e')](_0x1fcfa9);_0x4c679b[_0xef13('0x5f')]();for(var _0xd231ad=0x0;_0xd231ad<_0x4c679b[_0xef13('0x60')];_0xd231ad++){if(_0x4aa22b!=''){_0x4aa22b+='&';}_0x4aa22b+=_0x4c679b[_0xd231ad]+'='+encodeURIComponent(_0x1fcfa9[_0x4c679b[_0xd231ad]]);_0x516ba4+=_0x1fcfa9[_0x4c679b[_0xd231ad]];}_0x516ba4+=_0x351130[_0xef13('0x5a')];_0x516ba4=_0x2ae762[_0xef13('0x61')](_0xef13('0x62'))['update'](_0x516ba4)['digest'](_0xef13('0x63'));if(_0x4aa22b!==''){_0x4aa22b+='&';}_0x4aa22b+=_0xef13('0x64')+_0x516ba4;var _0x377709={'method':_0xef13('0x35'),'uri':_0x351130[_0xef13('0x53')]+_0xef13('0x65')+_0x4aa22b,'json':!![]};return rp(_0x377709)['then'](function(_0x16e1b5){var _0x56e501=Object['keys'](_0x16e1b5);if(_0x16e1b5[_0x56e501[0x0]]['error']&&parseInt(_0x16e1b5[_0x56e501[0x0]][_0xef13('0x18')])===0x0){var _0x4a7759={'messageId':_0x16e1b5[_0x56e501[0x0]]['id_sms']};if(!_0x351130['deliveryReport']){_0x4a7759[_0xef13('0x39')]=!![];}return _0x50cc07['update'](_0x4a7759);}else{return logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),'csc',util[_0xef13('0x2b')](_0x16e1b5[_0xef13('0x18')],{'showHidden':![],'depth':null}));}})[_0xef13('0x17')](function(_0x43d448){return logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x58'),util[_0xef13('0x2b')](_0x43d448,{'showHidden':![],'depth':null}));});}else{logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x58'),_0xef13('0x66'));}break;case'clickatell':if(_0x351130[_0xef13('0x5a')]){var _0x19b2d7={'method':_0xef13('0x42'),'uri':_0xef13('0x67'),'headers':{'Authorization':_0x351130[_0xef13('0x5a')]},'body':{'content':_0x136eb3['body'],'to':[_0x136eb3[_0xef13('0x24')]],'from':_0x351130[_0xef13('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0xef13('0x68')},'json':!![]};rp(_0x19b2d7)['then'](function(_0x44cff2){if(!_0x44cff2[_0xef13('0x18')]){var _0x1b5e42={'messageId':_0x44cff2[_0xef13('0x49')][0x0][_0xef13('0x69')]};if(!_0x351130[_0xef13('0x3e')]){_0x1b5e42['read']=!![];}return _0x50cc07[_0xef13('0x16')](_0x1b5e42);}else{return logger[_0xef13('0x18')](_0xef13('0x2c'),'afterCreate',_0xef13('0x6a'),util[_0xef13('0x2b')](_0x44cff2['error'],{'showHidden':![],'depth':null}));}})[_0xef13('0x17')](function(_0x236fe7){return logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x6a'),util[_0xef13('0x2b')](_0x236fe7,{'showHidden':![],'depth':null}));});}else{logger[_0xef13('0x18')](_0xef13('0x2c'),'afterCreate','clickatell',_0xef13('0x66'));}break;case _0xef13('0x6b'):if(_0x351130['username']&&_0x351130['password']){var _0xddd971=util['format'](_0xef13('0x41'),_0x351130[_0xef13('0x2f')],_0x351130[_0xef13('0x30')]);var _0x4e5b87={'method':_0xef13('0x42'),'uri':_0xef13('0x6c')+_0x351130[_0xef13('0x6d')]+_0xef13('0x6e'),'body':{'to':[_0x136eb3[_0xef13('0x24')]],'text':_0x136eb3[_0xef13('0x23')],'from':_0x351130[_0xef13('0x24')],'applicationId':_0x351130[_0xef13('0x6f')]},'headers':{'Authorization':util[_0xef13('0x43')](_0xef13('0x44'),new Buffer(_0xddd971)[_0xef13('0x45')]('base64'))},'json':!![]};rp(_0x4e5b87)[_0xef13('0x1d')](function(_0x571287){if(_0x571287['id']){var _0x1ab985={'messageId':_0x571287['id']};return _0x50cc07[_0xef13('0x16')](_0x1ab985);}else{logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x6b'),util['inspect'](_0x571287,{'showHidden':![],'depth':null}));}})[_0xef13('0x17')](function(_0x1016cd){logger['error'](_0xef13('0x2c'),_0xef13('0x2a'),'bandwidth',util['inspect'](_0x1016cd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x351130['apiKey']){var _0x359b1b={};var _0x377709={'method':_0xef13('0x42'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xef13('0x70')+_0x351130[_0xef13('0x5a')],'Content-Type':'application/json'},'body':{'from':_0x351130[_0xef13('0x24')],'to':_0x136eb3['phone'],'text':_0x136eb3[_0xef13('0x23')]},'json':!![]};return rp(_0x377709)[_0xef13('0x1d')](function(_0x356a10){if(_0x356a10[_0xef13('0x71')]==0xca){_0x359b1b[_0xef13('0x72')]=_0x356a10;var _0x4eafbe={'method':_0xef13('0x42'),'uri':_0xef13('0x73'),'headers':{'Authorization':_0xef13('0x70')+_0x351130[_0xef13('0x5a')],'Content-Type':_0xef13('0x56')},'body':{'refid':_0x359b1b[_0xef13('0x72')][_0xef13('0x74')]},'json':!![]};return rp(_0x4eafbe)[_0xef13('0x1d')](function(_0x3143eb){_0x359b1b[_0xef13('0x75')]=_0x3143eb;var _0x328a5d={'messageId':_0x359b1b['message']['refid'],'read':!![]};return _0x50cc07[_0xef13('0x16')](_0x328a5d);});}else{return logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),_0xef13('0x76'),util['inspect'](_0x356a10,{'showHidden':![],'depth':null}));}})[_0xef13('0x17')](function(_0x2bd419){return logger[_0xef13('0x18')](_0xef13('0x2c'),'afterCreate',_0xef13('0x76'),util[_0xef13('0x2b')](_0x2bd419,{'showHidden':![],'depth':null}));});}else{return logger[_0xef13('0x18')](_0xef13('0x2c'),_0xef13('0x2a'),'intelepeer','Token\x20not\x20received');}break;}}})[_0xef13('0x77')](function(){_0x10c5f5();});}else{_0x10c5f5();}}},'charset':_0xef13('0x78'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 9639acc..5cc8008 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 _0x49c4=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSmsMessage','SmsMessage','body','options','raw','util','bluebird'];(function(_0x553b74,_0x2120fc){var _0x5a3031=function(_0x35b0b3){while(--_0x35b0b3){_0x553b74['push'](_0x553b74['shift']());}};_0x5a3031(++_0x2120fc);}(_0x49c4,0x8a));var _0x449c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x49c4[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x449c('0x0'));var moment=require('moment');var BPromise=require(_0x449c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x449c('0x2'))['db'];var utils=require(_0x449c('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x449c('0x4'));var jayson=require(_0x449c('0x5'));var client=jayson[_0x449c('0x6')]['http']({'port':0x232a});config[_0x449c('0x7')]=_[_0x449c('0x8')](config['redis'],{'host':_0x449c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x449c('0x7')]));require(_0x449c('0xa'))[_0x449c('0xb')](socket);function respondWithRpcPromise(_0x344e2,_0x55337a,_0x43dd35){return new BPromise(function(_0x3ebb36,_0x460dff){return client[_0x449c('0xc')](_0x344e2,_0x43dd35)[_0x449c('0xd')](function(_0x56f08d){logger['info'](_0x449c('0xe'),_0x55337a,_0x449c('0xf'));logger['debug'](_0x449c('0x10'),_0x55337a,'request\x20sent',JSON[_0x449c('0x11')](_0x56f08d));if(_0x56f08d[_0x449c('0x12')]){if(_0x56f08d[_0x449c('0x12')][_0x449c('0x13')]===0x1f4){logger[_0x449c('0x12')](_0x449c('0xe'),_0x55337a,_0x56f08d[_0x449c('0x12')][_0x449c('0x14')]);return _0x460dff(_0x56f08d['error'][_0x449c('0x14')]);}logger[_0x449c('0x12')](_0x449c('0xe'),_0x55337a,_0x56f08d['error'][_0x449c('0x14')]);return _0x3ebb36(_0x56f08d['error'][_0x449c('0x14')]);}else{logger[_0x449c('0x15')](_0x449c('0xe'),_0x55337a,_0x449c('0xf'));_0x3ebb36(_0x56f08d[_0x449c('0x16')][_0x449c('0x14')]);}})['catch'](function(_0x3013c1){logger['error'](_0x449c('0xe'),_0x55337a,_0x3013c1);_0x460dff(_0x3013c1);});});}exports[_0x449c('0x17')]=function(_0x1cb4dd){var _0x198b0c=this;return new Promise(function(_0x385a90,_0xe03adf){return db[_0x449c('0x18')]['create'](_0x1cb4dd[_0x449c('0x19')],{'raw':_0x1cb4dd['options']?_0x1cb4dd[_0x449c('0x1a')][_0x449c('0x1b')]===undefined?!![]:![]:!![]})[_0x449c('0xd')](function(_0x16a399){logger[_0x449c('0x15')](_0x449c('0x17'),_0x1cb4dd);logger['debug'](_0x449c('0x17'),_0x1cb4dd,JSON[_0x449c('0x11')](_0x16a399));_0x385a90(_0x16a399);})['catch'](function(_0x357e5d){logger[_0x449c('0x12')](_0x449c('0x17'),_0x357e5d['message'],_0x1cb4dd);_0xe03adf(_0x198b0c['error'](0x1f4,_0x357e5d[_0x449c('0x14')]));});});}; \ No newline at end of file +var _0xbb8a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','CreateSmsMessage','SmsMessage','create','body','options','raw','util'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xbb8a,0x8b));var _0xabb8=function(_0xb39a56,_0x8afdf6){_0xb39a56=_0xb39a56-0x0;var _0x5b210e=_0xbb8a[_0xb39a56];return _0x5b210e;};'use strict';var _=require('lodash');var util=require(_0xabb8('0x0'));var moment=require(_0xabb8('0x1'));var BPromise=require('bluebird');var rs=require(_0xabb8('0x2'));var fs=require('fs');var Redis=require(_0xabb8('0x3'));var db=require(_0xabb8('0x4'))['db'];var utils=require(_0xabb8('0x5'));var logger=require(_0xabb8('0x6'))(_0xabb8('0x7'));var config=require('../../config/environment');var jayson=require(_0xabb8('0x8'));var client=jayson[_0xabb8('0x9')][_0xabb8('0xa')]({'port':0x232a});config[_0xabb8('0xb')]=_[_0xabb8('0xc')](config[_0xabb8('0xb')],{'host':_0xabb8('0xd'),'port':0x18eb});var socket=require(_0xabb8('0xe'))(new Redis(config[_0xabb8('0xb')]));require(_0xabb8('0xf'))[_0xabb8('0x10')](socket);function respondWithRpcPromise(_0x54a400,_0x193a38,_0x1edf36){return new BPromise(function(_0x5cccd6,_0x8fb4a8){return client[_0xabb8('0x11')](_0x54a400,_0x1edf36)[_0xabb8('0x12')](function(_0x1e70c6){logger['info'](_0xabb8('0x13'),_0x193a38,'request\x20sent');logger[_0xabb8('0x14')](_0xabb8('0x15'),_0x193a38,_0xabb8('0x16'),JSON[_0xabb8('0x17')](_0x1e70c6));if(_0x1e70c6['error']){if(_0x1e70c6['error'][_0xabb8('0x18')]===0x1f4){logger[_0xabb8('0x19')](_0xabb8('0x13'),_0x193a38,_0x1e70c6[_0xabb8('0x19')][_0xabb8('0x1a')]);return _0x8fb4a8(_0x1e70c6['error'][_0xabb8('0x1a')]);}logger['error'](_0xabb8('0x13'),_0x193a38,_0x1e70c6[_0xabb8('0x19')][_0xabb8('0x1a')]);return _0x5cccd6(_0x1e70c6[_0xabb8('0x19')][_0xabb8('0x1a')]);}else{logger[_0xabb8('0x1b')]('SmsMessage,\x20%s,\x20%s',_0x193a38,'request\x20sent');_0x5cccd6(_0x1e70c6[_0xabb8('0x1c')][_0xabb8('0x1a')]);}})['catch'](function(_0x227a6c){logger[_0xabb8('0x19')](_0xabb8('0x13'),_0x193a38,_0x227a6c);_0x8fb4a8(_0x227a6c);});});}exports[_0xabb8('0x1d')]=function(_0x46d8b5){var _0x44c9d8=this;return new Promise(function(_0x2cbbda,_0x525ade){return db[_0xabb8('0x1e')][_0xabb8('0x1f')](_0x46d8b5[_0xabb8('0x20')],{'raw':_0x46d8b5[_0xabb8('0x21')]?_0x46d8b5['options'][_0xabb8('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x18fc57){logger['info'](_0xabb8('0x1d'),_0x46d8b5);logger[_0xabb8('0x14')](_0xabb8('0x1d'),_0x46d8b5,JSON['stringify'](_0x18fc57));_0x2cbbda(_0x18fc57);})['catch'](function(_0xd99f62){logger['error'](_0xabb8('0x1d'),_0xd99f62[_0xabb8('0x1a')],_0x46d8b5);_0x525ade(_0x44c9d8['error'](0x1f4,_0xd99f62[_0xabb8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 52c7688..bbc98f3 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 _0xb65f=['remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x28e6eb,_0x2d2ec1){var _0x4377f1=function(_0x298b68){while(--_0x298b68){_0x28e6eb['push'](_0x28e6eb['shift']());}};_0x4377f1(++_0x2d2ec1);}(_0xb65f,0x127));var _0xfb65=function(_0x2f8cb4,_0x2958d5){_0x2f8cb4=_0x2f8cb4-0x0;var _0x16dd55=_0xb65f[_0x2f8cb4];return _0x16dd55;};'use strict';var SmsMessageEvents=require(_0xfb65('0x0'));var events=['save',_0xfb65('0x1'),_0xfb65('0x2')];function createListener(_0x19ad82,_0x19d763){return function(_0x3c9e79){_0x19d763[_0xfb65('0x3')](_0x19ad82,_0x3c9e79);};}function removeListener(_0x5eb12e,_0x38f4ef){return function(){SmsMessageEvents[_0xfb65('0x4')](_0x5eb12e,_0x38f4ef);};}exports[_0xfb65('0x5')]=function(_0x4d49b6){for(var _0x663144=0x0,_0x4d2221=events[_0xfb65('0x6')];_0x663144<_0x4d2221;_0x663144++){var _0x2ce5c0=events[_0x663144];var _0xed307=createListener(_0xfb65('0x7')+_0x2ce5c0,_0x4d49b6);SmsMessageEvents['on'](_0x2ce5c0,_0xed307);}}; \ No newline at end of file +var _0x9c69=['update','register','save','remove'];(function(_0x133e37,_0xbe3667){var _0x4942d8=function(_0x49ea56){while(--_0x49ea56){_0x133e37['push'](_0x133e37['shift']());}};_0x4942d8(++_0xbe3667);}(_0x9c69,0x6a));var _0x99c6=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0x9c69[_0x2d0d9f];return _0x30243d;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x99c6('0x0'),_0x99c6('0x1'),_0x99c6('0x2')];function createListener(_0x3703a3,_0x7df444){return function(_0x4ab390){_0x7df444['emit'](_0x3703a3,_0x4ab390);};}function removeListener(_0x33bf5b,_0x1fbf06){return function(){SmsMessageEvents['removeListener'](_0x33bf5b,_0x1fbf06);};}exports[_0x99c6('0x3')]=function(_0x33c08a){for(var _0x2f2f1e=0x0,_0x4c8913=events['length'];_0x2f2f1e<_0x4c8913;_0x2f2f1e++){var _0x1e34b3=events[_0x2f2f1e];var _0x290061=createListener('smsMessage:'+_0x1e34b3,_0x33c08a);SmsMessageEvents['on'](_0x1e34b3,_0x290061);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index cac3c3e..8c3ba45 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 _0x564c=['/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','put','delete','/:id','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','show','getMembers'];(function(_0x3d3973,_0x1d532c){var _0x32ed9b=function(_0x136edc){while(--_0x136edc){_0x3d3973['push'](_0x3d3973['shift']());}};_0x32ed9b(++_0x1d532c);}(_0x564c,0x8f));var _0xc564=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x564c[_0x172ed7];return _0xfa8f61;};'use strict';var multer=require(_0xc564('0x0'));var util=require(_0xc564('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc564('0x2'));var router=express[_0xc564('0x3')]();var fs_extra=require(_0xc564('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc564('0x5'));var config=require(_0xc564('0x6'));var controller=require('./smsQueue.controller');router[_0xc564('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc564('0x7')](_0xc564('0x8'),auth[_0xc564('0x9')](),controller[_0xc564('0xa')]);router['get']('/:id',auth[_0xc564('0x9')](),controller[_0xc564('0xb')]);router['get']('/:id/members',auth[_0xc564('0x9')](),controller[_0xc564('0xc')]);router['get'](_0xc564('0xd'),auth['isAuthenticated'](),controller[_0xc564('0xe')]);router[_0xc564('0x7')]('/:id/users',auth[_0xc564('0x9')](),controller[_0xc564('0xf')]);router['post']('/',auth[_0xc564('0x9')](),controller[_0xc564('0x10')]);router[_0xc564('0x11')](_0xc564('0xd'),auth['isAuthenticated'](),controller[_0xc564('0x12')]);router[_0xc564('0x11')](_0xc564('0x13'),auth['isAuthenticated'](),controller[_0xc564('0x14')]);router[_0xc564('0x15')]('/:id',auth[_0xc564('0x9')](),controller['update']);router[_0xc564('0x16')](_0xc564('0x17'),auth[_0xc564('0x9')](),controller['destroy']);router[_0xc564('0x16')](_0xc564('0xd'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xc564('0x16')](_0xc564('0x13'),auth[_0xc564('0x9')](),controller[_0xc564('0x18')]);module[_0xc564('0x19')]=router; \ No newline at end of file +var _0x40c3=['post','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','/describe','isAuthenticated','get','/:id','show','getMembers','getTeams','/:id/users','create'];(function(_0x331e77,_0x114123){var _0x5b1b95=function(_0x1691ae){while(--_0x1691ae){_0x331e77['push'](_0x331e77['shift']());}};_0x5b1b95(++_0x114123);}(_0x40c3,0x118));var _0x340c=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x40c3[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0x340c('0x0'));var util=require(_0x340c('0x1'));var path=require(_0x340c('0x2'));var timeout=require(_0x340c('0x3'));var express=require(_0x340c('0x4'));var router=express[_0x340c('0x5')]();var fs_extra=require(_0x340c('0x6'));var auth=require(_0x340c('0x7'));var interaction=require(_0x340c('0x8'));var config=require(_0x340c('0x9'));var controller=require(_0x340c('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x340c('0xb'),auth[_0x340c('0xc')](),controller['describe']);router[_0x340c('0xd')](_0x340c('0xe'),auth[_0x340c('0xc')](),controller[_0x340c('0xf')]);router[_0x340c('0xd')]('/:id/members',auth[_0x340c('0xc')](),controller[_0x340c('0x10')]);router[_0x340c('0xd')]('/:id/teams',auth['isAuthenticated'](),controller[_0x340c('0x11')]);router[_0x340c('0xd')](_0x340c('0x12'),auth[_0x340c('0xc')](),controller['getAgents']);router['post']('/',auth[_0x340c('0xc')](),controller[_0x340c('0x13')]);router[_0x340c('0x14')](_0x340c('0x15'),auth[_0x340c('0xc')](),controller[_0x340c('0x16')]);router['post'](_0x340c('0x12'),auth[_0x340c('0xc')](),controller[_0x340c('0x17')]);router[_0x340c('0x18')](_0x340c('0xe'),auth[_0x340c('0xc')](),controller[_0x340c('0x19')]);router[_0x340c('0x1a')](_0x340c('0xe'),auth['isAuthenticated'](),controller[_0x340c('0x1b')]);router[_0x340c('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0x340c('0x1c')]);router[_0x340c('0x1a')]('/:id/users',auth[_0x340c('0xc')](),controller['removeAgents']);module[_0x340c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index ccc852e..24598b6 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 _0x7691=['sequelize','exports','STRING','rrmemory','roundrobin'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x7691,0x1c7));var _0x1769=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7691[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x1769('0x0'));module[_0x1769('0x1')]={'name':{'type':Sequelize[_0x1769('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1769('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1769('0x3'),'beepall',_0x1769('0x4'))}}; \ No newline at end of file +var _0x84b7=['roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3ac18a,_0x54b80a){var _0x245f49=function(_0x5d8046){while(--_0x5d8046){_0x3ac18a['push'](_0x3ac18a['shift']());}};_0x245f49(++_0x54b80a);}(_0x84b7,0x133));var _0x784b=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x84b7[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x784b('0x0'));module[_0x784b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x784b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x784b('0x3')]},'timeout':{'type':Sequelize[_0x784b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x784b('0x5')](_0x784b('0x6'),_0x784b('0x7'),_0x784b('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 37fbd9d..a350077 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 _0x4f03=['flatMap','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','order','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','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','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','end','stack','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','interface'];(function(_0x276ce9,_0x3d194a){var _0x430d30=function(_0x3e7482){while(--_0x3e7482){_0x276ce9['push'](_0x276ce9['shift']());}};_0x430d30(++_0x3d194a);}(_0x4f03,0xb9));var _0x34f0=function(_0x4f1ff3,_0x2736a1){_0x4f1ff3=_0x4f1ff3-0x0;var _0x1768a5=_0x4f03[_0x4f1ff3];return _0x1768a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34f0('0x0'));var zipdir=require(_0x34f0('0x1'));var jsonpatch=require(_0x34f0('0x2'));var rp=require(_0x34f0('0x3'));var moment=require('moment');var BPromise=require(_0x34f0('0x4'));var Mustache=require(_0x34f0('0x5'));var util=require(_0x34f0('0x6'));var path=require(_0x34f0('0x7'));var sox=require(_0x34f0('0x8'));var csv=require(_0x34f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x34f0('0xa'));var _=require(_0x34f0('0xb'));var squel=require('squel');var crypto=require(_0x34f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x34f0('0xd'));var toCsv=require(_0x34f0('0x9'));var querystring=require(_0x34f0('0xe'));var Papa=require(_0x34f0('0xf'));var Redis=require(_0x34f0('0x10'));var authService=require(_0x34f0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x34f0('0x12'));var hardwareService=require(_0x34f0('0x13'));var logger=require(_0x34f0('0x14'))(_0x34f0('0x15'));var utils=require(_0x34f0('0x16'));var config=require(_0x34f0('0x17'));var licenseUtil=require(_0x34f0('0x18'));var db=require(_0x34f0('0x19'))['db'];config[_0x34f0('0x1a')]=_['defaults'](config[_0x34f0('0x1a')],{'host':_0x34f0('0x1b'),'port':0x18eb});var socket=require(_0x34f0('0x1c'))(new Redis(config[_0x34f0('0x1a')]));require(_0x34f0('0x1d'))[_0x34f0('0x1e')](socket);function respondWithStatusCode(_0x38f3c1,_0x3be516){_0x3be516=_0x3be516||0xcc;return function(_0x36bc22){if(_0x36bc22){return _0x38f3c1[_0x34f0('0x1f')](_0x3be516);}return _0x38f3c1[_0x34f0('0x20')](_0x3be516)['end']();};}function respondWithResult(_0x22fb6b,_0x18c803){_0x18c803=_0x18c803||0xc8;return function(_0x22600e){if(_0x22600e){return _0x22fb6b[_0x34f0('0x20')](_0x18c803)[_0x34f0('0x21')](_0x22600e);}};}function respondWithFilteredResult(_0x558cb3,_0x53970a){return function(_0x2eaff0){if(_0x2eaff0){var _0x35c83a=typeof _0x53970a[_0x34f0('0x22')]===_0x34f0('0x23')&&typeof _0x53970a[_0x34f0('0x24')]===_0x34f0('0x23');var _0x4302b3=_0x2eaff0[_0x34f0('0x25')];var _0x2a4fd8=_0x35c83a?0x0:_0x53970a[_0x34f0('0x22')];var _0x3306da=_0x35c83a?_0x2eaff0[_0x34f0('0x25')]:_0x53970a[_0x34f0('0x22')]+_0x53970a[_0x34f0('0x24')];var _0x17776c;if(_0x3306da>=_0x4302b3){_0x3306da=_0x4302b3;_0x17776c=0xc8;}else{_0x17776c=0xce;}_0x558cb3[_0x34f0('0x20')](_0x17776c);return _0x558cb3[_0x34f0('0x26')](_0x34f0('0x27'),_0x2a4fd8+'-'+_0x3306da+'/'+_0x4302b3)[_0x34f0('0x21')](_0x2eaff0);}return null;};}function patchUpdates(_0x20f483){return function(_0x4a436a){try{jsonpatch['apply'](_0x4a436a,_0x20f483,!![]);}catch(_0x508a47){return BPromise[_0x34f0('0x28')](_0x508a47);}return _0x4a436a[_0x34f0('0x29')]();};}function saveUpdates(_0x5251b5,_0x4c8c0d){return function(_0x4724d8){if(_0x4724d8){return _0x4724d8[_0x34f0('0x2a')](_0x5251b5)[_0x34f0('0x2b')](function(_0x10cccd){return _0x10cccd;});}return null;};}function removeEntity(_0x522693,_0x5af53d){return function(_0x1a8d78){if(_0x1a8d78){return _0x1a8d78['destroy']()[_0x34f0('0x2b')](function(){var _0x15ec6b=_0x1a8d78[_0x34f0('0x2c')]({'plain':!![]});var _0x914e5f='SmsQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x914e5f,'resourceId':_0x15ec6b['id']}})[_0x34f0('0x2b')](function(){return _0x1a8d78;});})[_0x34f0('0x2b')](function(){_0x522693[_0x34f0('0x20')](0xcc)[_0x34f0('0x2d')]();});}};}function handleEntityNotFound(_0x2c7427,_0x161806){return function(_0x8b7111){if(!_0x8b7111){_0x2c7427[_0x34f0('0x1f')](0x194);}return _0x8b7111;};}function handleError(_0x523edf,_0x2d6468){_0x2d6468=_0x2d6468||0x1f4;return function(_0x37627a){logger['error'](_0x37627a[_0x34f0('0x2e')]);if(_0x37627a['name']){delete _0x37627a['name'];}_0x523edf[_0x34f0('0x20')](_0x2d6468)[_0x34f0('0x2f')](_0x37627a);};}exports[_0x34f0('0x30')]=function(_0x1495ff,_0x30ca4e){var _0x389aef={},_0x3d0347={},_0x13419a={'count':0x0,'rows':[]};var _0x4426af=_[_0x34f0('0x31')](db[_0x34f0('0x32')][_0x34f0('0x33')],function(_0x5e330e){return{'name':_0x5e330e[_0x34f0('0x34')],'type':_0x5e330e[_0x34f0('0x35')][_0x34f0('0x36')]};});_0x3d0347[_0x34f0('0x37')]=_[_0x34f0('0x31')](_0x4426af,_0x34f0('0x38'));_0x3d0347[_0x34f0('0x39')]=_[_0x34f0('0x3a')](_0x1495ff[_0x34f0('0x39')]);_0x3d0347[_0x34f0('0x3b')]=_[_0x34f0('0x3c')](_0x3d0347[_0x34f0('0x37')],_0x3d0347[_0x34f0('0x39')]);_0x389aef[_0x34f0('0x3d')]=_[_0x34f0('0x3c')](_0x3d0347['model'],qs[_0x34f0('0x3e')](_0x1495ff[_0x34f0('0x39')]['fields']));_0x389aef['attributes']=_0x389aef['attributes']['length']?_0x389aef[_0x34f0('0x3d')]:_0x3d0347[_0x34f0('0x37')];if(!_0x1495ff[_0x34f0('0x39')][_0x34f0('0x3f')](_0x34f0('0x40'))){_0x389aef['limit']=qs[_0x34f0('0x24')](_0x1495ff['query'][_0x34f0('0x24')]);_0x389aef[_0x34f0('0x22')]=qs[_0x34f0('0x22')](_0x1495ff[_0x34f0('0x39')][_0x34f0('0x22')]);}_0x389aef['order']=qs[_0x34f0('0x41')](_0x1495ff['query'][_0x34f0('0x41')]);_0x389aef[_0x34f0('0x42')]=qs[_0x34f0('0x3b')](_[_0x34f0('0x43')](_0x1495ff['query'],_0x3d0347['filters']),_0x4426af);if(_0x1495ff[_0x34f0('0x39')]['filter']){_0x389aef['where']=_['merge'](_0x389aef[_0x34f0('0x42')],{'$or':_[_0x34f0('0x31')](_0x4426af,function(_0x1ee6bb){if(_0x1ee6bb[_0x34f0('0x35')]!==_0x34f0('0x44')){var _0x4fcbcb={};_0x4fcbcb[_0x1ee6bb[_0x34f0('0x38')]]={'$like':'%'+_0x1495ff[_0x34f0('0x39')][_0x34f0('0x45')]+'%'};return _0x4fcbcb;}})});}_0x389aef=_['merge']({},_0x389aef,_0x1495ff[_0x34f0('0x46')]);var _0x3ad0f9={'where':_0x389aef[_0x34f0('0x42')]};return db[_0x34f0('0x32')]['count'](_0x3ad0f9)[_0x34f0('0x2b')](function(_0x451da2){_0x13419a[_0x34f0('0x25')]=_0x451da2;if(_0x1495ff['query'][_0x34f0('0x47')]){_0x389aef[_0x34f0('0x48')]=[{'all':!![]}];}return db[_0x34f0('0x32')][_0x34f0('0x49')](_0x389aef);})[_0x34f0('0x2b')](function(_0x138c40){_0x13419a[_0x34f0('0x4a')]=_0x138c40;return _0x13419a;})[_0x34f0('0x2b')](respondWithFilteredResult(_0x30ca4e,_0x389aef))[_0x34f0('0x4b')](handleError(_0x30ca4e,null));};exports[_0x34f0('0x4c')]=function(_0x1e4017,_0x5affbf){var _0x19d5c6={'raw':!![],'where':{'id':_0x1e4017[_0x34f0('0x4d')]['id']}},_0x39640d={};_0x39640d['model']=_[_0x34f0('0x3a')](db['SmsQueue'][_0x34f0('0x33')]);_0x39640d['query']=_[_0x34f0('0x3a')](_0x1e4017[_0x34f0('0x39')]);_0x39640d[_0x34f0('0x3b')]=_[_0x34f0('0x3c')](_0x39640d[_0x34f0('0x37')],_0x39640d[_0x34f0('0x39')]);_0x19d5c6[_0x34f0('0x3d')]=_[_0x34f0('0x3c')](_0x39640d[_0x34f0('0x37')],qs[_0x34f0('0x3e')](_0x1e4017[_0x34f0('0x39')][_0x34f0('0x3e')]));_0x19d5c6[_0x34f0('0x3d')]=_0x19d5c6['attributes'][_0x34f0('0x4e')]?_0x19d5c6[_0x34f0('0x3d')]:_0x39640d[_0x34f0('0x37')];if(_0x1e4017[_0x34f0('0x39')]['includeAll']){_0x19d5c6[_0x34f0('0x48')]=[{'all':!![]}];}_0x19d5c6=_[_0x34f0('0x4f')]({},_0x19d5c6,_0x1e4017[_0x34f0('0x46')]);return db[_0x34f0('0x32')][_0x34f0('0x50')](_0x19d5c6)[_0x34f0('0x2b')](handleEntityNotFound(_0x5affbf,null))[_0x34f0('0x2b')](respondWithResult(_0x5affbf,null))[_0x34f0('0x4b')](handleError(_0x5affbf,null));};exports[_0x34f0('0x51')]=function(_0x3cfb94,_0xbc9124){return db[_0x34f0('0x32')][_0x34f0('0x51')](_0x3cfb94[_0x34f0('0x52')],{})['then'](function(_0x57a627){var _0x51e29b=_0x3cfb94[_0x34f0('0x53')]['get']({'plain':!![]});if(!_0x51e29b)throw new Error(_0x34f0('0x54'));if(_0x51e29b['role']===_0x34f0('0x53')){var _0x23a462=_0x57a627['get']({'plain':!![]});var _0x52dcb4=_0x34f0('0x55');return db[_0x34f0('0x56')][_0x34f0('0x50')]({'where':{'name':_0x52dcb4,'userProfileId':_0x51e29b[_0x34f0('0x57')]},'raw':!![]})[_0x34f0('0x2b')](function(_0x49c606){if(_0x49c606&&_0x49c606[_0x34f0('0x58')]===0x0){return db[_0x34f0('0x59')][_0x34f0('0x51')]({'name':_0x23a462[_0x34f0('0x38')],'resourceId':_0x23a462['id'],'type':_0x49c606[_0x34f0('0x38')],'sectionId':_0x49c606['id']},{})[_0x34f0('0x2b')](function(){return _0x57a627;});}else{return _0x57a627;}})['catch'](function(_0x5c83a9){logger[_0x34f0('0x5a')](_0x34f0('0x5b'),_0x5c83a9);throw _0x5c83a9;});}return _0x57a627;})[_0x34f0('0x2b')](respondWithResult(_0xbc9124,0xc9))[_0x34f0('0x4b')](handleError(_0xbc9124,null));};exports['update']=function(_0x2ea991,_0xe449af){if(_0x2ea991[_0x34f0('0x52')]['id']){delete _0x2ea991[_0x34f0('0x52')]['id'];}return db[_0x34f0('0x32')][_0x34f0('0x50')]({'where':{'id':_0x2ea991[_0x34f0('0x4d')]['id']}})[_0x34f0('0x2b')](handleEntityNotFound(_0xe449af,null))[_0x34f0('0x2b')](saveUpdates(_0x2ea991[_0x34f0('0x52')],null))[_0x34f0('0x2b')](respondWithResult(_0xe449af,null))[_0x34f0('0x4b')](handleError(_0xe449af,null));};exports[_0x34f0('0x5c')]=function(_0x5c4d8d,_0x4fc1a5){return db[_0x34f0('0x32')][_0x34f0('0x50')]({'where':{'id':_0x5c4d8d['params']['id']}})[_0x34f0('0x2b')](handleEntityNotFound(_0x4fc1a5,null))[_0x34f0('0x2b')](removeEntity(_0x4fc1a5,null))['catch'](handleError(_0x4fc1a5,null));};exports['describe']=function(_0x53c36a,_0x1c35ce){return db[_0x34f0('0x32')][_0x34f0('0x5d')]()[_0x34f0('0x2b')](respondWithResult(_0x1c35ce,null))[_0x34f0('0x4b')](handleError(_0x1c35ce,null));};exports[_0x34f0('0x5e')]=function(_0x5d800b,_0x4034bc,_0x56c904){var _0x816c3e={'raw':!![],'where':{}},_0x343012={},_0x5d1517;return db[_0x34f0('0x32')][_0x34f0('0x5f')]({'where':{'id':_0x5d800b[_0x34f0('0x4d')]['id']}})[_0x34f0('0x2b')](handleEntityNotFound(_0x4034bc,null))[_0x34f0('0x2b')](function(_0x4efc33){if(_0x4efc33){_0x5d1517=_0x4efc33[_0x34f0('0x2c')]({'plain':!![]});_0x343012['model']=_[_0x34f0('0x3a')](db[_0x34f0('0x60')][_0x34f0('0x33')]);_0x343012[_0x34f0('0x39')]=_[_0x34f0('0x3a')](_0x5d800b[_0x34f0('0x39')]);_0x343012[_0x34f0('0x3b')]=_[_0x34f0('0x3c')](_0x343012['model'],_0x343012[_0x34f0('0x39')]);_0x816c3e[_0x34f0('0x3d')]=_[_0x34f0('0x3c')](_0x343012['model'],qs['fields'](_0x5d800b['query'][_0x34f0('0x3e')]));_0x816c3e[_0x34f0('0x3d')]=_0x816c3e[_0x34f0('0x3d')][_0x34f0('0x4e')]?_0x816c3e[_0x34f0('0x3d')]:_0x343012[_0x34f0('0x37')];if(!_0x5d800b[_0x34f0('0x39')][_0x34f0('0x3f')](_0x34f0('0x40'))){_0x816c3e[_0x34f0('0x24')]=qs[_0x34f0('0x24')](_0x5d800b[_0x34f0('0x39')][_0x34f0('0x24')]);_0x816c3e[_0x34f0('0x22')]=qs['offset'](_0x5d800b[_0x34f0('0x39')][_0x34f0('0x22')]);}_0x816c3e['order']=qs['sort'](_0x5d800b[_0x34f0('0x39')][_0x34f0('0x41')]);_0x816c3e[_0x34f0('0x42')]=qs[_0x34f0('0x3b')](_[_0x34f0('0x43')](_0x5d800b[_0x34f0('0x39')],_0x343012[_0x34f0('0x3b')]));_0x816c3e[_0x34f0('0x42')][_0x34f0('0x61')]=_0x4efc33['id'];if(_0x5d800b[_0x34f0('0x39')][_0x34f0('0x45')]){_0x816c3e[_0x34f0('0x42')]=_[_0x34f0('0x4f')](_0x816c3e[_0x34f0('0x42')],{'$or':_['map'](_0x816c3e[_0x34f0('0x3d')],function(_0x31ffe3){var _0x483989={};_0x483989[_0x31ffe3]={'$like':'%'+_0x5d800b['query'][_0x34f0('0x45')]+'%'};return _0x483989;})});}_0x816c3e=_['merge']({},_0x816c3e,_0x5d800b['options']);return db[_0x34f0('0x60')]['findAll'](_0x816c3e);}})[_0x34f0('0x2b')](function(_0x512407){if(_0x512407){return db[_0x34f0('0x62')][_0x34f0('0x63')]({'where':{'id':_[_0x34f0('0x31')](_0x512407,_0x34f0('0x64')),'role':_0x34f0('0x65')},'attributes':['id',_0x34f0('0x38'),_0x34f0('0x66'),_0x34f0('0x67'),_0x34f0('0x68')]});}})[_0x34f0('0x2b')](function(_0x1e4fe4){if(_0x1e4fe4){return{'count':_0x1e4fe4[_0x34f0('0x25')],'rows':_[_0x34f0('0x31')](_0x1e4fe4[_0x34f0('0x4a')],function(_0x1af612){return{'membername':_0x1af612[_0x34f0('0x38')],'UserId':_0x1af612['id'],'queue_name':_0x5d1517[_0x34f0('0x38')],'SmsQueueId':_0x5d1517['id'],'interface':util[_0x34f0('0x69')](_0x34f0('0x6a'),_0x34f0('0x6b'),_0x1af612[_0x34f0('0x38')]),'penalty':0x0,'paused':_0x1af612[_0x34f0('0x66')],'createdAt':_0x1af612[_0x34f0('0x68')],'updatedAt':_0x1af612['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x34f0('0x2b')](respondWithFilteredResult(_0x4034bc,_0x816c3e))[_0x34f0('0x4b')](handleError(_0x4034bc,null));};exports['getTeams']=function(_0x1cf1df,_0x29a569,_0x4e8a75){var _0x259093={};var _0x1edefc={};var _0x3d5080;var _0x18e787;return db['SmsQueue'][_0x34f0('0x5f')]({'where':{'id':_0x1cf1df[_0x34f0('0x4d')]['id']}})[_0x34f0('0x2b')](handleEntityNotFound(_0x29a569,null))['then'](function(_0xe5ca69){if(_0xe5ca69){_0x3d5080=_0xe5ca69;_0x1edefc[_0x34f0('0x37')]=_[_0x34f0('0x3a')](db[_0x34f0('0x6c')][_0x34f0('0x33')]);_0x1edefc[_0x34f0('0x39')]=_[_0x34f0('0x3a')](_0x1cf1df['query']);_0x1edefc[_0x34f0('0x3b')]=_['intersection'](_0x1edefc[_0x34f0('0x37')],_0x1edefc[_0x34f0('0x39')]);_0x259093[_0x34f0('0x3d')]=_['intersection'](_0x1edefc[_0x34f0('0x37')],qs[_0x34f0('0x3e')](_0x1cf1df[_0x34f0('0x39')][_0x34f0('0x3e')]));_0x259093['attributes']=_0x259093['attributes']['length']?_0x259093[_0x34f0('0x3d')]:_0x1edefc[_0x34f0('0x37')];_0x259093['order']=qs[_0x34f0('0x41')](_0x1cf1df['query'][_0x34f0('0x41')]);_0x259093[_0x34f0('0x42')]=qs[_0x34f0('0x3b')](_[_0x34f0('0x43')](_0x1cf1df[_0x34f0('0x39')],_0x1edefc[_0x34f0('0x3b')]));if(_0x1cf1df[_0x34f0('0x39')]['filter']){_0x259093[_0x34f0('0x42')]=_[_0x34f0('0x4f')](_0x259093[_0x34f0('0x42')],{'$or':_[_0x34f0('0x31')](_0x259093['attributes'],function(_0x499bb6){var _0x199666={};_0x199666[_0x499bb6]={'$like':'%'+_0x1cf1df[_0x34f0('0x39')][_0x34f0('0x45')]+'%'};return _0x199666;})});}_0x259093=_[_0x34f0('0x4f')]({},_0x259093,_0x1cf1df[_0x34f0('0x46')]);return _0x3d5080[_0x34f0('0x6d')](_0x259093);}})['then'](function(_0x1fd50b){if(_0x1fd50b){_0x18e787=_0x1fd50b[_0x34f0('0x4e')];if(!_0x1cf1df[_0x34f0('0x39')][_0x34f0('0x3f')]('nolimit')){_0x259093['limit']=qs[_0x34f0('0x24')](_0x1cf1df['query'][_0x34f0('0x24')]);_0x259093[_0x34f0('0x22')]=qs[_0x34f0('0x22')](_0x1cf1df[_0x34f0('0x39')][_0x34f0('0x22')]);}return _0x3d5080['getTeams'](_0x259093);}})[_0x34f0('0x2b')](function(_0x5e23b9){if(_0x5e23b9){return _0x5e23b9?{'count':_0x18e787,'rows':_0x5e23b9}:null;}})[_0x34f0('0x2b')](respondWithResult(_0x29a569,null))[_0x34f0('0x4b')](handleError(_0x29a569,null));};exports[_0x34f0('0x6e')]=function(_0x2183b5,_0x215929,_0x2e26d9){var _0x520df4=_0x2183b5[_0x34f0('0x52')][_0x34f0('0x6f')];return db[_0x34f0('0x6c')][_0x34f0('0x49')]({'where':{'id':_0x520df4},'attributes':['id'],'include':[{'model':db[_0x34f0('0x62')],'as':_0x34f0('0x70'),'attributes':['id',_0x34f0('0x38'),_0x34f0('0x71'),'voicePause',_0x34f0('0x72')],'raw':!![]}]})['then'](function(_0x295d04){if(_0x295d04){var _0x11cd3b=_[_0x34f0('0x73')](_0x295d04,function(_0x5bab61){var _0x24bb07=_0x5bab61[_0x34f0('0x2c')]({'plain':!![]});return _0x24bb07[_0x34f0('0x70')];});return db['SmsQueue'][_0x34f0('0x50')]({'where':{'id':_0x2183b5[_0x34f0('0x4d')]['id']}})[_0x34f0('0x2b')](function(_0x3584a4){return db[_0x34f0('0x74')]['transaction'](function(_0x294c3e){return _0x3584a4[_0x34f0('0x6e')](_0x520df4,{'transaction':_0x294c3e})[_0x34f0('0x2b')](function(){return BPromise[_0x34f0('0x75')](_0x11cd3b,function(_0x5a3b3b){return db[_0x34f0('0x60')][_0x34f0('0x76')]({'where':{'UserId':_0x5a3b3b['id'],'SmsQueueId':_0x2183b5[_0x34f0('0x4d')]['id']},'transaction':_0x294c3e});});})[_0x34f0('0x2b')](function(){_0x11cd3b[_0x34f0('0x77')](function(_0x45908f){socket['emit'](_0x34f0('0x78'),{'UserId':_0x45908f['id'],'SmsQueueId':_0x3584a4['id']});});});});});}})[_0x34f0('0x2b')](respondWithStatusCode(_0x215929,null))[_0x34f0('0x4b')](handleError(_0x215929,null));};exports[_0x34f0('0x79')]=function(_0x242ed1,_0x2832c5,_0x3ed4c9){return db[_0x34f0('0x6c')][_0x34f0('0x49')]({'where':{'id':_0x242ed1[_0x34f0('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x34f0('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2832c5,null))[_0x34f0('0x2b')](function(_0x5f3d04){var _0x109d6b=_['map'](_0x5f3d04,'id');var _0xa0b939=[];var _0x2f79fd=[];var _0x2263f0=squel[_0x34f0('0x7a')]();_0x2263f0[_0x34f0('0x7b')](_0x34f0('0x7c'))[_0x34f0('0x7d')](_0x34f0('0x7e'),'tq')['join'](_0x34f0('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x34f0('0x42')](_0x34f0('0x80'),_0x242ed1[_0x34f0('0x4d')]['id']);for(var _0x163d46=0x0;_0x163d46<_0x5f3d04[_0x34f0('0x4e')];_0x163d46+=0x1){let _0x4990f6=_0x5f3d04[_0x163d46];for(var _0x4939f2=0x0;_0x4939f2<_0x4990f6['Agents']['length'];_0x4939f2+=0x1){let _0x2a8c63=_0x4990f6[_0x34f0('0x70')][_0x4939f2];var _0x358886=_0x2263f0[_0x34f0('0x81')]();_0x358886[_0x34f0('0x42')](_0x34f0('0x82'),_0x2a8c63['id']);_0x2f79fd['push'](db[_0x34f0('0x74')][_0x34f0('0x39')](_0x358886[_0x34f0('0x83')](),{'type':db[_0x34f0('0x74')][_0x34f0('0x84')][_0x34f0('0x85')]})[_0x34f0('0x2b')](function(_0x4e16fd){if(_0x4e16fd['length']===0x1){return _0x2a8c63['id'];}else{var _0xe27b78=_['every'](_[_0x34f0('0x31')](_0x4e16fd,_0x34f0('0x86')),function(_0x2d2662){return _['includes'](_0x109d6b,_0x2d2662);});if(_0xe27b78){return _0x2a8c63['id'];}}}));}}return BPromise[_0x34f0('0x87')](_0x2f79fd)[_0x34f0('0x2b')](function(_0x12447a){_0xa0b939=_(_0xa0b939)[_0x34f0('0x88')](_0x12447a)[_0x34f0('0x89')]()[_0x34f0('0x8a')]();return db[_0x34f0('0x32')][_0x34f0('0x50')]({'where':{'id':_0x242ed1[_0x34f0('0x4d')]['id']}})[_0x34f0('0x2b')](function(_0x30e3cd){return db[_0x34f0('0x74')][_0x34f0('0x8b')](function(_0x1f7946){return _0x30e3cd['removeTeams'](_0x242ed1[_0x34f0('0x39')][_0x34f0('0x6f')],{'transaction':_0x1f7946})[_0x34f0('0x2b')](function(){if(!_[_0x34f0('0x8c')](_0xa0b939)){return _0x30e3cd[_0x34f0('0x8d')](_0xa0b939,{'transaction':_0x1f7946});}})[_0x34f0('0x2b')](function(){_0xa0b939['forEach'](function(_0x5ad77d){socket[_0x34f0('0x8e')](_0x34f0('0x8f'),{'UserId':_0x5ad77d,'SmsQueueId':_0x30e3cd['id']});});});});});});})['then'](respondWithStatusCode(_0x2832c5,null))[_0x34f0('0x4b')](handleError(_0x2832c5,null));};exports[_0x34f0('0x90')]=function(_0xd58e8a,_0x42ffa4,_0xc21ae6){return db['SmsQueue']['find']({'where':{'id':_0xd58e8a[_0x34f0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42ffa4,null))[_0x34f0('0x2b')](function(_0x3e2ca1){if(_0x3e2ca1){return _0x3e2ca1[_0x34f0('0x90')](_0xd58e8a[_0x34f0('0x52')][_0x34f0('0x6f')],_[_0x34f0('0x91')](_0xd58e8a[_0x34f0('0x52')],[_0x34f0('0x6f'),'id'])||{})[_0x34f0('0x92')](function(_0x2a000a){for(var _0x3d9d3b=0x0;_0x3d9d3b<_0xd58e8a[_0x34f0('0x52')][_0x34f0('0x6f')][_0x34f0('0x4e')];_0x3d9d3b+=0x1){socket[_0x34f0('0x8e')](_0x34f0('0x78'),{'UserId':Number(_0xd58e8a[_0x34f0('0x52')][_0x34f0('0x6f')][_0x3d9d3b]),'SmsQueueId':Number(_0xd58e8a[_0x34f0('0x4d')]['id'])});}return _0x2a000a;});}})[_0x34f0('0x2b')](respondWithResult(_0x42ffa4,null))[_0x34f0('0x4b')](handleError(_0x42ffa4,null));};exports[_0x34f0('0x8d')]=function(_0x1887f9,_0x90b8a5,_0x301f3a){return db['SmsQueue'][_0x34f0('0x50')]({'where':{'id':_0x1887f9['params']['id']}})[_0x34f0('0x2b')](handleEntityNotFound(_0x90b8a5,null))[_0x34f0('0x2b')](function(_0x530317){if(_0x530317){return _0x530317[_0x34f0('0x8d')](_0x1887f9[_0x34f0('0x39')][_0x34f0('0x6f')])[_0x34f0('0x2b')](function(){if(_[_0x34f0('0x93')](_0x1887f9[_0x34f0('0x39')][_0x34f0('0x6f')])){for(var _0x297733=0x0;_0x297733<_0x1887f9[_0x34f0('0x39')][_0x34f0('0x6f')][_0x34f0('0x4e')];_0x297733+=0x1){socket['emit'](_0x34f0('0x8f'),{'UserId':Number(_0x1887f9['query'][_0x34f0('0x6f')][_0x297733]),'SmsQueueId':Number(_0x1887f9['params']['id'])});}}else{socket[_0x34f0('0x8e')](_0x34f0('0x8f'),{'UserId':Number(_0x1887f9['query'][_0x34f0('0x6f')]),'SmsQueueId':Number(_0x1887f9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x90b8a5,null))[_0x34f0('0x4b')](handleError(_0x90b8a5,null));};exports[_0x34f0('0x94')]=function(_0x376572,_0x3ef57f,_0x40bf8e){var _0x4ac12d={};var _0x144fed={};var _0x4add37;var _0xa8ca45;return db[_0x34f0('0x32')]['findOne']({'where':{'id':_0x376572[_0x34f0('0x4d')]['id']}})[_0x34f0('0x2b')](handleEntityNotFound(_0x3ef57f,null))[_0x34f0('0x2b')](function(_0x50136d){if(_0x50136d){_0x4add37=_0x50136d;_0x144fed['model']=_[_0x34f0('0x3a')](db[_0x34f0('0x62')]['rawAttributes']);_0x144fed[_0x34f0('0x39')]=_[_0x34f0('0x3a')](_0x376572[_0x34f0('0x39')]);_0x144fed['filters']=_['intersection'](_0x144fed[_0x34f0('0x37')],_0x144fed[_0x34f0('0x39')]);_0x4ac12d[_0x34f0('0x3d')]=_[_0x34f0('0x3c')](_0x144fed[_0x34f0('0x37')],qs[_0x34f0('0x3e')](_0x376572[_0x34f0('0x39')][_0x34f0('0x3e')]));_0x4ac12d[_0x34f0('0x3d')]=_0x4ac12d[_0x34f0('0x3d')][_0x34f0('0x4e')]?_0x4ac12d[_0x34f0('0x3d')]:_0x144fed[_0x34f0('0x37')];_0x4ac12d[_0x34f0('0x95')]=qs['sort'](_0x376572[_0x34f0('0x39')]['sort']);_0x4ac12d[_0x34f0('0x42')]=qs['filters'](_[_0x34f0('0x43')](_0x376572['query'],_0x144fed[_0x34f0('0x3b')]));if(_0x376572[_0x34f0('0x39')][_0x34f0('0x45')]){_0x4ac12d[_0x34f0('0x42')]=_[_0x34f0('0x4f')](_0x4ac12d[_0x34f0('0x42')],{'$or':_['map'](_0x4ac12d[_0x34f0('0x3d')],function(_0x7719cf){var _0x27337a={};_0x27337a[_0x7719cf]={'$like':'%'+_0x376572[_0x34f0('0x39')][_0x34f0('0x45')]+'%'};return _0x27337a;})});}_0x4ac12d=_['merge']({},_0x4ac12d,_0x376572[_0x34f0('0x46')]);return _0x4add37[_0x34f0('0x94')](_0x4ac12d);}})[_0x34f0('0x2b')](function(_0x29591f){if(_0x29591f){_0xa8ca45=_0x29591f['length'];if(!_0x376572[_0x34f0('0x39')][_0x34f0('0x3f')](_0x34f0('0x40'))){_0x4ac12d[_0x34f0('0x24')]=qs[_0x34f0('0x24')](_0x376572[_0x34f0('0x39')]['limit']);_0x4ac12d['offset']=qs[_0x34f0('0x22')](_0x376572[_0x34f0('0x39')][_0x34f0('0x22')]);}return _0x4add37['getAgents'](_0x4ac12d);}})[_0x34f0('0x2b')](function(_0x347acb){if(_0x347acb){return _0x347acb?{'count':_0xa8ca45,'rows':_0x347acb}:null;}})['then'](respondWithResult(_0x3ef57f,null))['catch'](handleError(_0x3ef57f,null));}; \ No newline at end of file +var _0x0c45=['show','params','rawAttributes','keys','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','getAgents','eml-format','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','save','update','destroy','get','SmsQueues','UserProfileResource','then','error','stack','name','index','map','SmsQueue','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','findAll','rows','catch'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0c45,0x1ec));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x50c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50c4('0x1'));var rp=require(_0x50c4('0x2'));var moment=require(_0x50c4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x50c4('0x4'));var sox=require(_0x50c4('0x5'));var csv=require(_0x50c4('0x6'));var ejs=require(_0x50c4('0x7'));var fs=require('fs');var fs_extra=require(_0x50c4('0x8'));var _=require(_0x50c4('0x9'));var squel=require('squel');var crypto=require(_0x50c4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x50c4('0xb'));var toCsv=require(_0x50c4('0x6'));var querystring=require(_0x50c4('0xc'));var Papa=require(_0x50c4('0xd'));var Redis=require(_0x50c4('0xe'));var authService=require(_0x50c4('0xf'));var qs=require(_0x50c4('0x10'));var as=require(_0x50c4('0x11'));var hardwareService=require(_0x50c4('0x12'));var logger=require(_0x50c4('0x13'))(_0x50c4('0x14'));var utils=require(_0x50c4('0x15'));var config=require(_0x50c4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x50c4('0x17'))['db'];config[_0x50c4('0x18')]=_[_0x50c4('0x19')](config['redis'],{'host':_0x50c4('0x1a'),'port':0x18eb});var socket=require(_0x50c4('0x1b'))(new Redis(config['redis']));require(_0x50c4('0x1c'))[_0x50c4('0x1d')](socket);function respondWithStatusCode(_0x1448d3,_0x2a7034){_0x2a7034=_0x2a7034||0xcc;return function(_0x76f895){if(_0x76f895){return _0x1448d3[_0x50c4('0x1e')](_0x2a7034);}return _0x1448d3[_0x50c4('0x1f')](_0x2a7034)[_0x50c4('0x20')]();};}function respondWithResult(_0xc2af68,_0x4d4f6d){_0x4d4f6d=_0x4d4f6d||0xc8;return function(_0x2f3f5e){if(_0x2f3f5e){return _0xc2af68[_0x50c4('0x1f')](_0x4d4f6d)[_0x50c4('0x21')](_0x2f3f5e);}};}function respondWithFilteredResult(_0x4f02a5,_0x520c04){return function(_0x9d542e){if(_0x9d542e){var _0x2ebf9d=typeof _0x520c04[_0x50c4('0x22')]==='undefined'&&typeof _0x520c04[_0x50c4('0x23')]==='undefined';var _0x2d9663=_0x9d542e['count'];var _0x457899=_0x2ebf9d?0x0:_0x520c04[_0x50c4('0x22')];var _0x36ec25=_0x2ebf9d?_0x9d542e[_0x50c4('0x24')]:_0x520c04[_0x50c4('0x22')]+_0x520c04[_0x50c4('0x23')];var _0x306545;if(_0x36ec25>=_0x2d9663){_0x36ec25=_0x2d9663;_0x306545=0xc8;}else{_0x306545=0xce;}_0x4f02a5[_0x50c4('0x1f')](_0x306545);return _0x4f02a5['set'](_0x50c4('0x25'),_0x457899+'-'+_0x36ec25+'/'+_0x2d9663)['json'](_0x9d542e);}return null;};}function patchUpdates(_0x55b1a6){return function(_0x32b673){try{jsonpatch['apply'](_0x32b673,_0x55b1a6,!![]);}catch(_0x102e72){return BPromise['reject'](_0x102e72);}return _0x32b673[_0x50c4('0x26')]();};}function saveUpdates(_0xb7b990,_0x294599){return function(_0x57aaf4){if(_0x57aaf4){return _0x57aaf4[_0x50c4('0x27')](_0xb7b990)['then'](function(_0x5dfee7){return _0x5dfee7;});}return null;};}function removeEntity(_0x58001c,_0x2b57e7){return function(_0x59c0d0){if(_0x59c0d0){return _0x59c0d0[_0x50c4('0x28')]()['then'](function(){var _0x345177=_0x59c0d0[_0x50c4('0x29')]({'plain':!![]});var _0x5dae72=_0x50c4('0x2a');return db[_0x50c4('0x2b')][_0x50c4('0x28')]({'where':{'type':_0x5dae72,'resourceId':_0x345177['id']}})[_0x50c4('0x2c')](function(){return _0x59c0d0;});})[_0x50c4('0x2c')](function(){_0x58001c['status'](0xcc)[_0x50c4('0x20')]();});}};}function handleEntityNotFound(_0x55f78f,_0x3064bf){return function(_0x2c77fc){if(!_0x2c77fc){_0x55f78f[_0x50c4('0x1e')](0x194);}return _0x2c77fc;};}function handleError(_0x5368e1,_0x28f950){_0x28f950=_0x28f950||0x1f4;return function(_0x40ffcb){logger[_0x50c4('0x2d')](_0x40ffcb[_0x50c4('0x2e')]);if(_0x40ffcb[_0x50c4('0x2f')]){delete _0x40ffcb[_0x50c4('0x2f')];}_0x5368e1[_0x50c4('0x1f')](_0x28f950)['send'](_0x40ffcb);};}exports[_0x50c4('0x30')]=function(_0x3df594,_0x3a135c){var _0x872312={},_0xd2da47={},_0x560b22={'count':0x0,'rows':[]};var _0x5d31e5=_[_0x50c4('0x31')](db[_0x50c4('0x32')]['rawAttributes'],function(_0x2eca75){return{'name':_0x2eca75[_0x50c4('0x33')],'type':_0x2eca75[_0x50c4('0x34')][_0x50c4('0x35')]};});_0xd2da47[_0x50c4('0x36')]=_[_0x50c4('0x31')](_0x5d31e5,'name');_0xd2da47['query']=_['keys'](_0x3df594['query']);_0xd2da47[_0x50c4('0x37')]=_[_0x50c4('0x38')](_0xd2da47[_0x50c4('0x36')],_0xd2da47[_0x50c4('0x39')]);_0x872312[_0x50c4('0x3a')]=_[_0x50c4('0x38')](_0xd2da47['model'],qs[_0x50c4('0x3b')](_0x3df594[_0x50c4('0x39')][_0x50c4('0x3b')]));_0x872312['attributes']=_0x872312[_0x50c4('0x3a')]['length']?_0x872312[_0x50c4('0x3a')]:_0xd2da47['model'];if(!_0x3df594[_0x50c4('0x39')][_0x50c4('0x3c')]('nolimit')){_0x872312[_0x50c4('0x23')]=qs['limit'](_0x3df594[_0x50c4('0x39')]['limit']);_0x872312[_0x50c4('0x22')]=qs[_0x50c4('0x22')](_0x3df594[_0x50c4('0x39')][_0x50c4('0x22')]);}_0x872312[_0x50c4('0x3d')]=qs[_0x50c4('0x3e')](_0x3df594['query'][_0x50c4('0x3e')]);_0x872312['where']=qs[_0x50c4('0x37')](_[_0x50c4('0x3f')](_0x3df594[_0x50c4('0x39')],_0xd2da47['filters']),_0x5d31e5);if(_0x3df594[_0x50c4('0x39')]['filter']){_0x872312['where']=_[_0x50c4('0x40')](_0x872312[_0x50c4('0x41')],{'$or':_[_0x50c4('0x31')](_0x5d31e5,function(_0x945b98){if(_0x945b98['type']!==_0x50c4('0x42')){var _0x13773e={};_0x13773e[_0x945b98[_0x50c4('0x2f')]]={'$like':'%'+_0x3df594[_0x50c4('0x39')][_0x50c4('0x43')]+'%'};return _0x13773e;}})});}_0x872312=_[_0x50c4('0x40')]({},_0x872312,_0x3df594[_0x50c4('0x44')]);var _0x5eb58c={'where':_0x872312['where']};return db[_0x50c4('0x32')][_0x50c4('0x24')](_0x5eb58c)[_0x50c4('0x2c')](function(_0x1fded6){_0x560b22['count']=_0x1fded6;if(_0x3df594[_0x50c4('0x39')]['includeAll']){_0x872312['include']=[{'all':!![]}];}return db[_0x50c4('0x32')][_0x50c4('0x45')](_0x872312);})[_0x50c4('0x2c')](function(_0x2394b3){_0x560b22[_0x50c4('0x46')]=_0x2394b3;return _0x560b22;})[_0x50c4('0x2c')](respondWithFilteredResult(_0x3a135c,_0x872312))[_0x50c4('0x47')](handleError(_0x3a135c,null));};exports[_0x50c4('0x48')]=function(_0x31699c,_0x33ef77){var _0x26581b={'raw':!![],'where':{'id':_0x31699c[_0x50c4('0x49')]['id']}},_0x4a55e1={};_0x4a55e1[_0x50c4('0x36')]=_['keys'](db[_0x50c4('0x32')][_0x50c4('0x4a')]);_0x4a55e1[_0x50c4('0x39')]=_[_0x50c4('0x4b')](_0x31699c[_0x50c4('0x39')]);_0x4a55e1[_0x50c4('0x37')]=_[_0x50c4('0x38')](_0x4a55e1[_0x50c4('0x36')],_0x4a55e1['query']);_0x26581b[_0x50c4('0x3a')]=_[_0x50c4('0x38')](_0x4a55e1[_0x50c4('0x36')],qs[_0x50c4('0x3b')](_0x31699c[_0x50c4('0x39')][_0x50c4('0x3b')]));_0x26581b[_0x50c4('0x3a')]=_0x26581b[_0x50c4('0x3a')][_0x50c4('0x4c')]?_0x26581b[_0x50c4('0x3a')]:_0x4a55e1['model'];if(_0x31699c[_0x50c4('0x39')][_0x50c4('0x4d')]){_0x26581b['include']=[{'all':!![]}];}_0x26581b=_[_0x50c4('0x40')]({},_0x26581b,_0x31699c[_0x50c4('0x44')]);return db[_0x50c4('0x32')][_0x50c4('0x4e')](_0x26581b)[_0x50c4('0x2c')](handleEntityNotFound(_0x33ef77,null))[_0x50c4('0x2c')](respondWithResult(_0x33ef77,null))[_0x50c4('0x47')](handleError(_0x33ef77,null));};exports[_0x50c4('0x4f')]=function(_0x961913,_0x13b9bd){return db[_0x50c4('0x32')]['create'](_0x961913['body'],{})[_0x50c4('0x2c')](function(_0xbd6e8){var _0x1fec20=_0x961913[_0x50c4('0x50')][_0x50c4('0x29')]({'plain':!![]});if(!_0x1fec20)throw new Error(_0x50c4('0x51'));if(_0x1fec20[_0x50c4('0x52')]===_0x50c4('0x50')){var _0x31cdb7=_0xbd6e8['get']({'plain':!![]});var _0x1e897c=_0x50c4('0x2a');return db[_0x50c4('0x53')]['find']({'where':{'name':_0x1e897c,'userProfileId':_0x1fec20[_0x50c4('0x54')]},'raw':!![]})['then'](function(_0x409999){if(_0x409999&&_0x409999[_0x50c4('0x55')]===0x0){return db[_0x50c4('0x2b')][_0x50c4('0x4f')]({'name':_0x31cdb7[_0x50c4('0x2f')],'resourceId':_0x31cdb7['id'],'type':_0x409999[_0x50c4('0x2f')],'sectionId':_0x409999['id']},{})[_0x50c4('0x2c')](function(){return _0xbd6e8;});}else{return _0xbd6e8;}})['catch'](function(_0x51f91f){logger[_0x50c4('0x2d')](_0x50c4('0x56'),_0x51f91f);throw _0x51f91f;});}return _0xbd6e8;})['then'](respondWithResult(_0x13b9bd,0xc9))[_0x50c4('0x47')](handleError(_0x13b9bd,null));};exports[_0x50c4('0x27')]=function(_0x336e07,_0x18a3a3){if(_0x336e07[_0x50c4('0x57')]['id']){delete _0x336e07[_0x50c4('0x57')]['id'];}return db[_0x50c4('0x32')]['find']({'where':{'id':_0x336e07[_0x50c4('0x49')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x18a3a3,null))[_0x50c4('0x2c')](saveUpdates(_0x336e07['body'],null))[_0x50c4('0x2c')](respondWithResult(_0x18a3a3,null))['catch'](handleError(_0x18a3a3,null));};exports[_0x50c4('0x28')]=function(_0x1db8e3,_0x40d47c){return db[_0x50c4('0x32')][_0x50c4('0x4e')]({'where':{'id':_0x1db8e3['params']['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x40d47c,null))[_0x50c4('0x2c')](removeEntity(_0x40d47c,null))[_0x50c4('0x47')](handleError(_0x40d47c,null));};exports[_0x50c4('0x58')]=function(_0x1c6937,_0x67018d){return db[_0x50c4('0x32')][_0x50c4('0x58')]()[_0x50c4('0x2c')](respondWithResult(_0x67018d,null))[_0x50c4('0x47')](handleError(_0x67018d,null));};exports['getMembers']=function(_0x442147,_0x6e9310,_0x434bdf){var _0x1658b0={'raw':!![],'where':{}},_0x53e0f3={},_0x4560cb;return db[_0x50c4('0x32')][_0x50c4('0x59')]({'where':{'id':_0x442147[_0x50c4('0x49')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x6e9310,null))[_0x50c4('0x2c')](function(_0x3990c3){if(_0x3990c3){_0x4560cb=_0x3990c3[_0x50c4('0x29')]({'plain':!![]});_0x53e0f3[_0x50c4('0x36')]=_['keys'](db[_0x50c4('0x5a')][_0x50c4('0x4a')]);_0x53e0f3[_0x50c4('0x39')]=_[_0x50c4('0x4b')](_0x442147['query']);_0x53e0f3[_0x50c4('0x37')]=_['intersection'](_0x53e0f3[_0x50c4('0x36')],_0x53e0f3[_0x50c4('0x39')]);_0x1658b0['attributes']=_[_0x50c4('0x38')](_0x53e0f3[_0x50c4('0x36')],qs[_0x50c4('0x3b')](_0x442147[_0x50c4('0x39')][_0x50c4('0x3b')]));_0x1658b0[_0x50c4('0x3a')]=_0x1658b0[_0x50c4('0x3a')][_0x50c4('0x4c')]?_0x1658b0[_0x50c4('0x3a')]:_0x53e0f3[_0x50c4('0x36')];if(!_0x442147[_0x50c4('0x39')][_0x50c4('0x3c')]('nolimit')){_0x1658b0[_0x50c4('0x23')]=qs[_0x50c4('0x23')](_0x442147[_0x50c4('0x39')][_0x50c4('0x23')]);_0x1658b0[_0x50c4('0x22')]=qs['offset'](_0x442147[_0x50c4('0x39')][_0x50c4('0x22')]);}_0x1658b0['order']=qs[_0x50c4('0x3e')](_0x442147[_0x50c4('0x39')][_0x50c4('0x3e')]);_0x1658b0[_0x50c4('0x41')]=qs[_0x50c4('0x37')](_[_0x50c4('0x3f')](_0x442147['query'],_0x53e0f3[_0x50c4('0x37')]));_0x1658b0['where'][_0x50c4('0x5b')]=_0x3990c3['id'];if(_0x442147[_0x50c4('0x39')][_0x50c4('0x43')]){_0x1658b0['where']=_[_0x50c4('0x40')](_0x1658b0[_0x50c4('0x41')],{'$or':_[_0x50c4('0x31')](_0x1658b0[_0x50c4('0x3a')],function(_0x29deff){var _0x244a0c={};_0x244a0c[_0x29deff]={'$like':'%'+_0x442147['query'][_0x50c4('0x43')]+'%'};return _0x244a0c;})});}_0x1658b0=_[_0x50c4('0x40')]({},_0x1658b0,_0x442147['options']);return db[_0x50c4('0x5a')][_0x50c4('0x45')](_0x1658b0);}})[_0x50c4('0x2c')](function(_0x1f367d){if(_0x1f367d){return db[_0x50c4('0x5c')][_0x50c4('0x5d')]({'where':{'id':_[_0x50c4('0x31')](_0x1f367d,_0x50c4('0x5e')),'role':_0x50c4('0x5f')},'attributes':['id','name',_0x50c4('0x60'),_0x50c4('0x61'),_0x50c4('0x62')]});}})[_0x50c4('0x2c')](function(_0x42d99e){if(_0x42d99e){return{'count':_0x42d99e[_0x50c4('0x24')],'rows':_[_0x50c4('0x31')](_0x42d99e[_0x50c4('0x46')],function(_0x55bd10){return{'membername':_0x55bd10['name'],'UserId':_0x55bd10['id'],'queue_name':_0x4560cb[_0x50c4('0x2f')],'SmsQueueId':_0x4560cb['id'],'interface':util[_0x50c4('0x63')](_0x50c4('0x64'),'SIP',_0x55bd10[_0x50c4('0x2f')]),'penalty':0x0,'paused':_0x55bd10[_0x50c4('0x60')],'createdAt':_0x55bd10['createdAt'],'updatedAt':_0x55bd10[_0x50c4('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x6e9310,_0x1658b0))[_0x50c4('0x47')](handleError(_0x6e9310,null));};exports['getTeams']=function(_0x51b507,_0x39c69f,_0x4a501c){var _0x66b7a0={};var _0x6b171={};var _0x2269fd;var _0xa25966;return db[_0x50c4('0x32')][_0x50c4('0x59')]({'where':{'id':_0x51b507[_0x50c4('0x49')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x39c69f,null))[_0x50c4('0x2c')](function(_0x52d918){if(_0x52d918){_0x2269fd=_0x52d918;_0x6b171['model']=_['keys'](db[_0x50c4('0x65')]['rawAttributes']);_0x6b171['query']=_['keys'](_0x51b507[_0x50c4('0x39')]);_0x6b171[_0x50c4('0x37')]=_[_0x50c4('0x38')](_0x6b171['model'],_0x6b171[_0x50c4('0x39')]);_0x66b7a0[_0x50c4('0x3a')]=_[_0x50c4('0x38')](_0x6b171['model'],qs['fields'](_0x51b507[_0x50c4('0x39')]['fields']));_0x66b7a0[_0x50c4('0x3a')]=_0x66b7a0[_0x50c4('0x3a')]['length']?_0x66b7a0[_0x50c4('0x3a')]:_0x6b171[_0x50c4('0x36')];_0x66b7a0['order']=qs[_0x50c4('0x3e')](_0x51b507['query']['sort']);_0x66b7a0[_0x50c4('0x41')]=qs[_0x50c4('0x37')](_[_0x50c4('0x3f')](_0x51b507[_0x50c4('0x39')],_0x6b171['filters']));if(_0x51b507[_0x50c4('0x39')]['filter']){_0x66b7a0[_0x50c4('0x41')]=_[_0x50c4('0x40')](_0x66b7a0[_0x50c4('0x41')],{'$or':_['map'](_0x66b7a0['attributes'],function(_0x1c0da9){var _0x150b77={};_0x150b77[_0x1c0da9]={'$like':'%'+_0x51b507[_0x50c4('0x39')][_0x50c4('0x43')]+'%'};return _0x150b77;})});}_0x66b7a0=_['merge']({},_0x66b7a0,_0x51b507[_0x50c4('0x44')]);return _0x2269fd[_0x50c4('0x66')](_0x66b7a0);}})[_0x50c4('0x2c')](function(_0xcd76d7){if(_0xcd76d7){_0xa25966=_0xcd76d7[_0x50c4('0x4c')];if(!_0x51b507[_0x50c4('0x39')][_0x50c4('0x3c')](_0x50c4('0x67'))){_0x66b7a0[_0x50c4('0x23')]=qs[_0x50c4('0x23')](_0x51b507[_0x50c4('0x39')][_0x50c4('0x23')]);_0x66b7a0[_0x50c4('0x22')]=qs[_0x50c4('0x22')](_0x51b507[_0x50c4('0x39')]['offset']);}return _0x2269fd[_0x50c4('0x66')](_0x66b7a0);}})[_0x50c4('0x2c')](function(_0x466708){if(_0x466708){return _0x466708?{'count':_0xa25966,'rows':_0x466708}:null;}})['then'](respondWithResult(_0x39c69f,null))[_0x50c4('0x47')](handleError(_0x39c69f,null));};exports[_0x50c4('0x68')]=function(_0x2da2b3,_0x27b1ef,_0x36b087){var _0x40cb72=_0x2da2b3[_0x50c4('0x57')][_0x50c4('0x69')];return db['Team']['findAll']({'where':{'id':_0x40cb72},'attributes':['id'],'include':[{'model':db[_0x50c4('0x5c')],'as':_0x50c4('0x6a'),'attributes':['id',_0x50c4('0x2f'),_0x50c4('0x6b'),_0x50c4('0x6c'),_0x50c4('0x6d')],'raw':!![]}]})[_0x50c4('0x2c')](function(_0x1eeaef){if(_0x1eeaef){var _0x28dcdd=_[_0x50c4('0x6e')](_0x1eeaef,function(_0x10984b){var _0x5851ed=_0x10984b['get']({'plain':!![]});return _0x5851ed[_0x50c4('0x6a')];});return db[_0x50c4('0x32')][_0x50c4('0x4e')]({'where':{'id':_0x2da2b3[_0x50c4('0x49')]['id']}})[_0x50c4('0x2c')](function(_0x3d6235){return db[_0x50c4('0x6f')][_0x50c4('0x70')](function(_0x20bc23){return _0x3d6235[_0x50c4('0x68')](_0x40cb72,{'transaction':_0x20bc23})['then'](function(){return BPromise[_0x50c4('0x71')](_0x28dcdd,function(_0x14ce61){return db[_0x50c4('0x5a')][_0x50c4('0x72')]({'where':{'UserId':_0x14ce61['id'],'SmsQueueId':_0x2da2b3[_0x50c4('0x49')]['id']},'transaction':_0x20bc23});});})[_0x50c4('0x2c')](function(){_0x28dcdd[_0x50c4('0x73')](function(_0x1eb074){socket[_0x50c4('0x74')](_0x50c4('0x75'),{'UserId':_0x1eb074['id'],'SmsQueueId':_0x3d6235['id']});});});});});}})[_0x50c4('0x2c')](respondWithStatusCode(_0x27b1ef,null))['catch'](handleError(_0x27b1ef,null));};exports['removeTeams']=function(_0x492196,_0x151198,_0x32896c){return db['Team'][_0x50c4('0x45')]({'where':{'id':_0x492196[_0x50c4('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x50c4('0x5c')],'as':_0x50c4('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x50c4('0x2c')](handleEntityNotFound(_0x151198,null))['then'](function(_0x1f9d4a){var _0xdcd31e=_['map'](_0x1f9d4a,'id');var _0x182ad7=[];var _0x40f393=[];var _0x14bf26=squel['select']();_0x14bf26[_0x50c4('0x76')](_0x50c4('0x77'))['from'](_0x50c4('0x78'),'tq')[_0x50c4('0x79')](_0x50c4('0x7a'),'ut',_0x50c4('0x7b'))[_0x50c4('0x41')](_0x50c4('0x7c'),_0x492196[_0x50c4('0x49')]['id']);for(var _0x554515=0x0;_0x554515<_0x1f9d4a['length'];_0x554515+=0x1){let _0x17c62b=_0x1f9d4a[_0x554515];for(var _0x3f385f=0x0;_0x3f385f<_0x17c62b[_0x50c4('0x6a')][_0x50c4('0x4c')];_0x3f385f+=0x1){let _0xbeb0e0=_0x17c62b[_0x50c4('0x6a')][_0x3f385f];var _0x317de3=_0x14bf26['clone']();_0x317de3[_0x50c4('0x41')](_0x50c4('0x7d'),_0xbeb0e0['id']);_0x40f393[_0x50c4('0x7e')](db['sequelize'][_0x50c4('0x39')](_0x317de3['toString'](),{'type':db[_0x50c4('0x6f')][_0x50c4('0x7f')][_0x50c4('0x80')]})[_0x50c4('0x2c')](function(_0x44cb2f){if(_0x44cb2f[_0x50c4('0x4c')]===0x1){return _0xbeb0e0['id'];}else{var _0x558c03=_[_0x50c4('0x81')](_[_0x50c4('0x31')](_0x44cb2f,'TeamId'),function(_0x13c993){return _[_0x50c4('0x82')](_0xdcd31e,_0x13c993);});if(_0x558c03){return _0xbeb0e0['id'];}}}));}}return BPromise['all'](_0x40f393)['then'](function(_0xd6364d){_0x182ad7=_(_0x182ad7)[_0x50c4('0x83')](_0xd6364d)[_0x50c4('0x84')]()[_0x50c4('0x85')]();return db[_0x50c4('0x32')][_0x50c4('0x4e')]({'where':{'id':_0x492196[_0x50c4('0x49')]['id']}})['then'](function(_0x1cb8fe){return db['sequelize'][_0x50c4('0x70')](function(_0x69b29c){return _0x1cb8fe[_0x50c4('0x86')](_0x492196[_0x50c4('0x39')][_0x50c4('0x69')],{'transaction':_0x69b29c})['then'](function(){if(!_[_0x50c4('0x87')](_0x182ad7)){return _0x1cb8fe[_0x50c4('0x88')](_0x182ad7,{'transaction':_0x69b29c});}})[_0x50c4('0x2c')](function(){_0x182ad7[_0x50c4('0x73')](function(_0x21990f){socket['emit'](_0x50c4('0x89'),{'UserId':_0x21990f,'SmsQueueId':_0x1cb8fe['id']});});});});});});})[_0x50c4('0x2c')](respondWithStatusCode(_0x151198,null))[_0x50c4('0x47')](handleError(_0x151198,null));};exports[_0x50c4('0x8a')]=function(_0x467f50,_0x127a1a,_0x48bee6){return db[_0x50c4('0x32')][_0x50c4('0x4e')]({'where':{'id':_0x467f50[_0x50c4('0x49')]['id']}})['then'](handleEntityNotFound(_0x127a1a,null))['then'](function(_0x1d5f8b){if(_0x1d5f8b){return _0x1d5f8b[_0x50c4('0x8a')](_0x467f50[_0x50c4('0x57')][_0x50c4('0x69')],_['omit'](_0x467f50[_0x50c4('0x57')],['ids','id'])||{})[_0x50c4('0x8b')](function(_0x66fcc1){for(var _0x296b7b=0x0;_0x296b7b<_0x467f50[_0x50c4('0x57')][_0x50c4('0x69')]['length'];_0x296b7b+=0x1){socket['emit'](_0x50c4('0x75'),{'UserId':Number(_0x467f50['body'][_0x50c4('0x69')][_0x296b7b]),'SmsQueueId':Number(_0x467f50[_0x50c4('0x49')]['id'])});}return _0x66fcc1;});}})[_0x50c4('0x2c')](respondWithResult(_0x127a1a,null))[_0x50c4('0x47')](handleError(_0x127a1a,null));};exports[_0x50c4('0x88')]=function(_0x1a9488,_0x3cb8ef,_0x2009f6){return db[_0x50c4('0x32')][_0x50c4('0x4e')]({'where':{'id':_0x1a9488[_0x50c4('0x49')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x3cb8ef,null))[_0x50c4('0x2c')](function(_0x22ec62){if(_0x22ec62){return _0x22ec62['removeAgents'](_0x1a9488['query']['ids'])[_0x50c4('0x2c')](function(){if(_['isArray'](_0x1a9488[_0x50c4('0x39')][_0x50c4('0x69')])){for(var _0x1ab5db=0x0;_0x1ab5db<_0x1a9488[_0x50c4('0x39')]['ids'][_0x50c4('0x4c')];_0x1ab5db+=0x1){socket[_0x50c4('0x74')](_0x50c4('0x89'),{'UserId':Number(_0x1a9488[_0x50c4('0x39')][_0x50c4('0x69')][_0x1ab5db]),'SmsQueueId':Number(_0x1a9488[_0x50c4('0x49')]['id'])});}}else{socket[_0x50c4('0x74')](_0x50c4('0x89'),{'UserId':Number(_0x1a9488[_0x50c4('0x39')][_0x50c4('0x69')]),'SmsQueueId':Number(_0x1a9488[_0x50c4('0x49')]['id'])});}});}})[_0x50c4('0x2c')](respondWithStatusCode(_0x3cb8ef,null))[_0x50c4('0x47')](handleError(_0x3cb8ef,null));};exports[_0x50c4('0x8c')]=function(_0x3fbb83,_0x25882f,_0x1a7c4c){var _0x12f77b={};var _0x91f1d6={};var _0x54fc3d;var _0x5d4d14;return db[_0x50c4('0x32')][_0x50c4('0x59')]({'where':{'id':_0x3fbb83[_0x50c4('0x49')]['id']}})[_0x50c4('0x2c')](handleEntityNotFound(_0x25882f,null))[_0x50c4('0x2c')](function(_0x33b05b){if(_0x33b05b){_0x54fc3d=_0x33b05b;_0x91f1d6['model']=_[_0x50c4('0x4b')](db[_0x50c4('0x5c')]['rawAttributes']);_0x91f1d6[_0x50c4('0x39')]=_[_0x50c4('0x4b')](_0x3fbb83[_0x50c4('0x39')]);_0x91f1d6[_0x50c4('0x37')]=_['intersection'](_0x91f1d6['model'],_0x91f1d6['query']);_0x12f77b[_0x50c4('0x3a')]=_[_0x50c4('0x38')](_0x91f1d6['model'],qs[_0x50c4('0x3b')](_0x3fbb83[_0x50c4('0x39')][_0x50c4('0x3b')]));_0x12f77b['attributes']=_0x12f77b['attributes'][_0x50c4('0x4c')]?_0x12f77b[_0x50c4('0x3a')]:_0x91f1d6[_0x50c4('0x36')];_0x12f77b['order']=qs[_0x50c4('0x3e')](_0x3fbb83[_0x50c4('0x39')][_0x50c4('0x3e')]);_0x12f77b['where']=qs[_0x50c4('0x37')](_[_0x50c4('0x3f')](_0x3fbb83['query'],_0x91f1d6[_0x50c4('0x37')]));if(_0x3fbb83['query'][_0x50c4('0x43')]){_0x12f77b[_0x50c4('0x41')]=_[_0x50c4('0x40')](_0x12f77b[_0x50c4('0x41')],{'$or':_[_0x50c4('0x31')](_0x12f77b[_0x50c4('0x3a')],function(_0x3c6f96){var _0xff8027={};_0xff8027[_0x3c6f96]={'$like':'%'+_0x3fbb83[_0x50c4('0x39')][_0x50c4('0x43')]+'%'};return _0xff8027;})});}_0x12f77b=_[_0x50c4('0x40')]({},_0x12f77b,_0x3fbb83[_0x50c4('0x44')]);return _0x54fc3d[_0x50c4('0x8c')](_0x12f77b);}})[_0x50c4('0x2c')](function(_0x387dab){if(_0x387dab){_0x5d4d14=_0x387dab[_0x50c4('0x4c')];if(!_0x3fbb83[_0x50c4('0x39')][_0x50c4('0x3c')](_0x50c4('0x67'))){_0x12f77b[_0x50c4('0x23')]=qs['limit'](_0x3fbb83[_0x50c4('0x39')]['limit']);_0x12f77b[_0x50c4('0x22')]=qs[_0x50c4('0x22')](_0x3fbb83[_0x50c4('0x39')][_0x50c4('0x22')]);}return _0x54fc3d[_0x50c4('0x8c')](_0x12f77b);}})[_0x50c4('0x2c')](function(_0x36c05f){if(_0x36c05f){return _0x36c05f?{'count':_0x5d4d14,'rows':_0x36c05f}:null;}})[_0x50c4('0x2c')](respondWithResult(_0x25882f,null))[_0x50c4('0x47')](handleError(_0x25882f,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f694bfb..242f5b6 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 _0xc5b3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5b3,0x134));var _0x3c5b=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xc5b3[_0xe0b81f];return _0x290e5e;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x3c5b('0x0'))['db'][_0x3c5b('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3c5b('0x2')](0x0);var events={'afterCreate':_0x3c5b('0x3'),'afterUpdate':_0x3c5b('0x4'),'afterDestroy':_0x3c5b('0x5')};function emitEvent(_0x41f4aa){return function(_0x1d287a,_0x56a1b3,_0x4dde1b){SmsQueueEvents['emit'](_0x41f4aa+':'+_0x1d287a['id'],_0x1d287a);SmsQueueEvents[_0x3c5b('0x6')](_0x41f4aa,_0x1d287a);_0x4dde1b(null);};}for(var e in events){if(events[_0x3c5b('0x7')](e)){var event=events[e];SmsQueue[_0x3c5b('0x8')](e,emitEvent(event));}}module[_0x3c5b('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xe139=['SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x21015e,_0x3dbe11){var _0x3e9266=function(_0x2c0fe4){while(--_0x2c0fe4){_0x21015e['push'](_0x21015e['shift']());}};_0x3e9266(++_0x3dbe11);}(_0xe139,0x1dd));var _0x9e13=function(_0x191318,_0x8568e6){_0x191318=_0x191318-0x0;var _0x40c3ef=_0xe139[_0x191318];return _0x40c3ef;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x9e13('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9e13('0x1')](0x0);var events={'afterCreate':_0x9e13('0x2'),'afterUpdate':_0x9e13('0x3'),'afterDestroy':_0x9e13('0x4')};function emitEvent(_0x294d15){return function(_0x3bb289,_0xe3afa3,_0x3ae366){SmsQueueEvents[_0x9e13('0x5')](_0x294d15+':'+_0x3bb289['id'],_0x3bb289);SmsQueueEvents['emit'](_0x294d15,_0x3bb289);_0x3ae366(null);};}for(var e in events){if(events[_0x9e13('0x6')](e)){var event=events[e];SmsQueue[_0x9e13('0x7')](e,emitEvent(event));}}module[_0x9e13('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 9bdcba7..d1c13bc 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 _0x1588=['../../config/environment','exports','define','SmsQueue','sms_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x51f166,_0x4a8fc6){var _0x476cfa=function(_0x504859){while(--_0x504859){_0x51f166['push'](_0x51f166['shift']());}};_0x476cfa(++_0x4a8fc6);}(_0x1588,0x14a));var _0x8158=function(_0x44eb57,_0x41a3c6){_0x44eb57=_0x44eb57-0x0;var _0xc85695=_0x1588[_0x44eb57];return _0xc85695;};'use strict';var _=require(_0x8158('0x0'));var util=require(_0x8158('0x1'));var logger=require('../../config/logger')(_0x8158('0x2'));var moment=require(_0x8158('0x3'));var BPromise=require(_0x8158('0x4'));var rp=require(_0x8158('0x5'));var fs=require('fs');var path=require(_0x8158('0x6'));var rimraf=require(_0x8158('0x7'));var config=require(_0x8158('0x8'));var attributes=require('./smsQueue.attributes');module[_0x8158('0x9')]=function(_0x40f4ae,_0x1df2fd){return _0x40f4ae[_0x8158('0xa')](_0x8158('0xb'),attributes,{'tableName':_0x8158('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fa0=['path','../../config/environment','./smsQueue.attributes','define','SmsQueue','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x35100b,_0x4f1f9a){var _0x5ce405=function(_0x212f43){while(--_0x212f43){_0x35100b['push'](_0x35100b['shift']());}};_0x5ce405(++_0x4f1f9a);}(_0x8fa0,0x1a7));var _0x08fa=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x8fa0[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x08fa('0x0'));var logger=require(_0x08fa('0x1'))(_0x08fa('0x2'));var moment=require(_0x08fa('0x3'));var BPromise=require(_0x08fa('0x4'));var rp=require(_0x08fa('0x5'));var fs=require('fs');var path=require(_0x08fa('0x6'));var rimraf=require('rimraf');var config=require(_0x08fa('0x7'));var attributes=require(_0x08fa('0x8'));module['exports']=function(_0x4bb051,_0x4e0d82){return _0x4bb051[_0x08fa('0x9')](_0x08fa('0xa'),attributes,{'tableName':'sms_queues','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 214e443..8f70603 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 _0x95fe=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','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','where','attributes','limit','include','model','map','ShowSmsQueue','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95fe,0x161));var _0xe95f=function(_0x5d356a,_0x55ea43){_0x5d356a=_0x5d356a-0x0;var _0x38d08e=_0x95fe[_0x5d356a];return _0x38d08e;};'use strict';var _=require(_0xe95f('0x0'));var util=require(_0xe95f('0x1'));var moment=require(_0xe95f('0x2'));var BPromise=require(_0xe95f('0x3'));var rs=require(_0xe95f('0x4'));var fs=require('fs');var Redis=require(_0xe95f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe95f('0x6'))(_0xe95f('0x7'));var config=require('../../config/environment');var jayson=require(_0xe95f('0x8'));var client=jayson[_0xe95f('0x9')][_0xe95f('0xa')]({'port':0x232a});config[_0xe95f('0xb')]=_[_0xe95f('0xc')](config[_0xe95f('0xb')],{'host':_0xe95f('0xd'),'port':0x18eb});var socket=require(_0xe95f('0xe'))(new Redis(config[_0xe95f('0xb')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x130add,_0x41500b,_0x4f2779){return new BPromise(function(_0x2b853d,_0x3538cc){return client[_0xe95f('0xf')](_0x130add,_0x4f2779)['then'](function(_0xf959c4){logger[_0xe95f('0x10')](_0xe95f('0x11'),_0x41500b,_0xe95f('0x12'));logger[_0xe95f('0x13')](_0xe95f('0x14'),_0x41500b,_0xe95f('0x12'),JSON[_0xe95f('0x15')](_0xf959c4));if(_0xf959c4[_0xe95f('0x16')]){if(_0xf959c4['error'][_0xe95f('0x17')]===0x1f4){logger[_0xe95f('0x16')](_0xe95f('0x11'),_0x41500b,_0xf959c4[_0xe95f('0x16')][_0xe95f('0x18')]);return _0x3538cc(_0xf959c4['error'][_0xe95f('0x18')]);}logger['error'](_0xe95f('0x11'),_0x41500b,_0xf959c4['error'][_0xe95f('0x18')]);return _0x2b853d(_0xf959c4[_0xe95f('0x16')][_0xe95f('0x18')]);}else{logger['info'](_0xe95f('0x11'),_0x41500b,'request\x20sent');_0x2b853d(_0xf959c4['result'][_0xe95f('0x18')]);}})[_0xe95f('0x19')](function(_0x5bbca6){logger[_0xe95f('0x16')](_0xe95f('0x11'),_0x41500b,_0x5bbca6);_0x3538cc(_0x5bbca6);});});}exports[_0xe95f('0x1a')]=function(_0x13d6b2){var _0x1df421=this;return new Promise(function(_0x30d3a7,_0x2f7513){return db[_0xe95f('0x1b')][_0xe95f('0x1c')]({'raw':_0x13d6b2[_0xe95f('0x1d')]?_0x13d6b2[_0xe95f('0x1d')][_0xe95f('0x1e')]===undefined?!![]:![]:!![],'where':_0x13d6b2['options']?_0x13d6b2[_0xe95f('0x1d')][_0xe95f('0x1f')]||null:null,'attributes':_0x13d6b2[_0xe95f('0x1d')]?_0x13d6b2[_0xe95f('0x1d')][_0xe95f('0x20')]||null:null,'limit':_0x13d6b2['options']?_0x13d6b2[_0xe95f('0x1d')][_0xe95f('0x21')]||null:null,'include':_0x13d6b2['options']?_0x13d6b2[_0xe95f('0x1d')][_0xe95f('0x22')]?_['map'](_0x13d6b2[_0xe95f('0x1d')]['include'],function(_0x25357e){return{'model':db[_0x25357e[_0xe95f('0x23')]],'as':_0x25357e['as'],'attributes':_0x25357e[_0xe95f('0x20')],'include':_0x25357e[_0xe95f('0x22')]?_['map'](_0x25357e['include'],function(_0x3bec76){return{'model':db[_0x3bec76['model']],'as':_0x3bec76['as'],'attributes':_0x3bec76[_0xe95f('0x20')],'include':_0x3bec76[_0xe95f('0x22')]?_[_0xe95f('0x24')](_0x3bec76[_0xe95f('0x22')],function(_0x39fd80){return{'model':db[_0x39fd80[_0xe95f('0x23')]],'as':_0x39fd80['as'],'attributes':_0x39fd80[_0xe95f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x339cd2){logger[_0xe95f('0x10')](_0xe95f('0x1a'),_0x13d6b2);logger[_0xe95f('0x13')](_0xe95f('0x1a'),_0x13d6b2,JSON[_0xe95f('0x15')](_0x339cd2));_0x30d3a7(_0x339cd2);})[_0xe95f('0x19')](function(_0x2caccd){logger[_0xe95f('0x16')]('GetSmsQueue',_0x2caccd[_0xe95f('0x18')],_0x13d6b2);_0x2f7513(_0x1df421[_0xe95f('0x16')](0x1f4,_0x2caccd[_0xe95f('0x18')]));});});};exports[_0xe95f('0x25')]=function(_0x2cff3f){var _0x46e21e=this;return new Promise(function(_0x5de132,_0x31877e){return db[_0xe95f('0x1b')][_0xe95f('0x26')]({'raw':_0x2cff3f['options']?_0x2cff3f[_0xe95f('0x1d')][_0xe95f('0x1e')]===undefined?!![]:![]:!![],'where':_0x2cff3f['options']?_0x2cff3f['options'][_0xe95f('0x1f')]||null:null,'attributes':_0x2cff3f[_0xe95f('0x1d')]?_0x2cff3f[_0xe95f('0x1d')]['attributes']||null:null,'include':_0x2cff3f[_0xe95f('0x1d')]?_0x2cff3f['options'][_0xe95f('0x22')]?_[_0xe95f('0x24')](_0x2cff3f[_0xe95f('0x1d')][_0xe95f('0x22')],function(_0xfdf0cb){return{'model':db[_0xfdf0cb['model']],'as':_0xfdf0cb['as'],'attributes':_0xfdf0cb['attributes'],'include':_0xfdf0cb['include']?_[_0xe95f('0x24')](_0xfdf0cb[_0xe95f('0x22')],function(_0x4e66cf){return{'model':db[_0x4e66cf[_0xe95f('0x23')]],'as':_0x4e66cf['as'],'attributes':_0x4e66cf[_0xe95f('0x20')],'include':_0x4e66cf[_0xe95f('0x22')]?_[_0xe95f('0x24')](_0x4e66cf[_0xe95f('0x22')],function(_0x5df5c5){return{'model':db[_0x5df5c5['model']],'as':_0x5df5c5['as'],'attributes':_0x5df5c5[_0xe95f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe95f('0x27')](function(_0x2926a6){logger[_0xe95f('0x10')]('ShowSmsQueue',_0x2cff3f);logger[_0xe95f('0x13')](_0xe95f('0x25'),_0x2cff3f,JSON['stringify'](_0x2926a6));_0x5de132(_0x2926a6);})[_0xe95f('0x19')](function(_0x17da65){logger[_0xe95f('0x16')](_0xe95f('0x25'),_0x17da65[_0xe95f('0x18')],_0x2cff3f);_0x31877e(_0x46e21e[_0xe95f('0x16')](0x1f4,_0x17da65[_0xe95f('0x18')]));});});}; \ No newline at end of file +var _0x5471=['ShowSmsQueue','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','info','catch','GetSmsQueue','SmsQueue','options','where','map','include','model','attributes','then','raw'];(function(_0x23622c,_0x4e5f81){var _0x1b734d=function(_0x25cb50){while(--_0x25cb50){_0x23622c['push'](_0x23622c['shift']());}};_0x1b734d(++_0x4e5f81);}(_0x5471,0xfd));var _0x1547=function(_0x392225,_0x2c78da){_0x392225=_0x392225-0x0;var _0x28dc00=_0x5471[_0x392225];return _0x28dc00;};'use strict';var _=require(_0x1547('0x0'));var util=require('util');var moment=require(_0x1547('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1547('0x2'));var db=require(_0x1547('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1547('0x4'))(_0x1547('0x5'));var config=require(_0x1547('0x6'));var jayson=require(_0x1547('0x7'));var client=jayson[_0x1547('0x8')]['http']({'port':0x232a});config[_0x1547('0x9')]=_[_0x1547('0xa')](config[_0x1547('0x9')],{'host':_0x1547('0xb'),'port':0x18eb});var socket=require(_0x1547('0xc'))(new Redis(config[_0x1547('0x9')]));require(_0x1547('0xd'))[_0x1547('0xe')](socket);function respondWithRpcPromise(_0x221c2f,_0x53e662,_0x466d5b){return new BPromise(function(_0x33c385,_0x11ca31){return client['request'](_0x221c2f,_0x466d5b)['then'](function(_0x2a6f5f){logger['info']('SmsQueue,\x20%s,\x20%s',_0x53e662,_0x1547('0xf'));logger[_0x1547('0x10')](_0x1547('0x11'),_0x53e662,'request\x20sent',JSON[_0x1547('0x12')](_0x2a6f5f));if(_0x2a6f5f[_0x1547('0x13')]){if(_0x2a6f5f[_0x1547('0x13')][_0x1547('0x14')]===0x1f4){logger[_0x1547('0x13')]('SmsQueue,\x20%s,\x20%s',_0x53e662,_0x2a6f5f[_0x1547('0x13')][_0x1547('0x15')]);return _0x11ca31(_0x2a6f5f['error'][_0x1547('0x15')]);}logger[_0x1547('0x13')](_0x1547('0x16'),_0x53e662,_0x2a6f5f['error'][_0x1547('0x15')]);return _0x33c385(_0x2a6f5f[_0x1547('0x13')]['message']);}else{logger[_0x1547('0x17')](_0x1547('0x16'),_0x53e662,_0x1547('0xf'));_0x33c385(_0x2a6f5f['result'][_0x1547('0x15')]);}})[_0x1547('0x18')](function(_0x5f20db){logger[_0x1547('0x13')]('SmsQueue,\x20%s,\x20%s',_0x53e662,_0x5f20db);_0x11ca31(_0x5f20db);});});}exports[_0x1547('0x19')]=function(_0x3773a0){var _0x1fffe1=this;return new Promise(function(_0x28e77e,_0x2d48fb){return db[_0x1547('0x1a')]['findAll']({'raw':_0x3773a0['options']?_0x3773a0[_0x1547('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3773a0['options']?_0x3773a0[_0x1547('0x1b')][_0x1547('0x1c')]||null:null,'attributes':_0x3773a0[_0x1547('0x1b')]?_0x3773a0[_0x1547('0x1b')]['attributes']||null:null,'limit':_0x3773a0['options']?_0x3773a0[_0x1547('0x1b')]['limit']||null:null,'include':_0x3773a0['options']?_0x3773a0[_0x1547('0x1b')]['include']?_[_0x1547('0x1d')](_0x3773a0[_0x1547('0x1b')][_0x1547('0x1e')],function(_0x62d211){return{'model':db[_0x62d211[_0x1547('0x1f')]],'as':_0x62d211['as'],'attributes':_0x62d211[_0x1547('0x20')],'include':_0x62d211['include']?_[_0x1547('0x1d')](_0x62d211[_0x1547('0x1e')],function(_0x3831e0){return{'model':db[_0x3831e0['model']],'as':_0x3831e0['as'],'attributes':_0x3831e0[_0x1547('0x20')],'include':_0x3831e0[_0x1547('0x1e')]?_['map'](_0x3831e0[_0x1547('0x1e')],function(_0x176d61){return{'model':db[_0x176d61[_0x1547('0x1f')]],'as':_0x176d61['as'],'attributes':_0x176d61[_0x1547('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1547('0x21')](function(_0x3a4ded){logger['info'](_0x1547('0x19'),_0x3773a0);logger[_0x1547('0x10')]('GetSmsQueue',_0x3773a0,JSON['stringify'](_0x3a4ded));_0x28e77e(_0x3a4ded);})[_0x1547('0x18')](function(_0x42ff5c){logger[_0x1547('0x13')](_0x1547('0x19'),_0x42ff5c[_0x1547('0x15')],_0x3773a0);_0x2d48fb(_0x1fffe1['error'](0x1f4,_0x42ff5c['message']));});});};exports['ShowSmsQueue']=function(_0x5b76b4){var _0x3af506=this;return new Promise(function(_0x348202,_0x165157){return db['SmsQueue']['find']({'raw':_0x5b76b4[_0x1547('0x1b')]?_0x5b76b4[_0x1547('0x1b')][_0x1547('0x22')]===undefined?!![]:![]:!![],'where':_0x5b76b4[_0x1547('0x1b')]?_0x5b76b4[_0x1547('0x1b')][_0x1547('0x1c')]||null:null,'attributes':_0x5b76b4['options']?_0x5b76b4[_0x1547('0x1b')][_0x1547('0x20')]||null:null,'include':_0x5b76b4[_0x1547('0x1b')]?_0x5b76b4[_0x1547('0x1b')][_0x1547('0x1e')]?_[_0x1547('0x1d')](_0x5b76b4[_0x1547('0x1b')][_0x1547('0x1e')],function(_0x26540f){return{'model':db[_0x26540f[_0x1547('0x1f')]],'as':_0x26540f['as'],'attributes':_0x26540f['attributes'],'include':_0x26540f[_0x1547('0x1e')]?_[_0x1547('0x1d')](_0x26540f[_0x1547('0x1e')],function(_0x5c4986){return{'model':db[_0x5c4986[_0x1547('0x1f')]],'as':_0x5c4986['as'],'attributes':_0x5c4986[_0x1547('0x20')],'include':_0x5c4986[_0x1547('0x1e')]?_[_0x1547('0x1d')](_0x5c4986['include'],function(_0x54a642){return{'model':db[_0x54a642[_0x1547('0x1f')]],'as':_0x54a642['as'],'attributes':_0x54a642[_0x1547('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1547('0x21')](function(_0x39f13d){logger[_0x1547('0x17')](_0x1547('0x23'),_0x5b76b4);logger[_0x1547('0x10')]('ShowSmsQueue',_0x5b76b4,JSON[_0x1547('0x12')](_0x39f13d));_0x348202(_0x39f13d);})[_0x1547('0x18')](function(_0x2f4b6e){logger[_0x1547('0x13')]('ShowSmsQueue',_0x2f4b6e[_0x1547('0x15')],_0x5b76b4);_0x165157(_0x3af506['error'](0x1f4,_0x2f4b6e[_0x1547('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 8f81c34..9317357 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 _0xe93d=['smsQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x313948,_0x3cabb1){var _0xa66537=function(_0x5a16a0){while(--_0x5a16a0){_0x313948['push'](_0x313948['shift']());}};_0xa66537(++_0x3cabb1);}(_0xe93d,0x1b9));var _0xde93=function(_0x593e7c,_0x362b74){_0x593e7c=_0x593e7c-0x0;var _0x5db231=_0xe93d[_0x593e7c];return _0x5db231;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xde93('0x0'),_0xde93('0x1'),_0xde93('0x2')];function createListener(_0x5911b6,_0x111270){return function(_0x53e3a7){_0x111270[_0xde93('0x3')](_0x5911b6,_0x53e3a7);};}function removeListener(_0x4ada05,_0x2b8fc6){return function(){SmsQueueEvents[_0xde93('0x4')](_0x4ada05,_0x2b8fc6);};}exports[_0xde93('0x5')]=function(_0x5aea8e){for(var _0xd656f9=0x0,_0x25bc72=events[_0xde93('0x6')];_0xd656f9<_0x25bc72;_0xd656f9++){var _0x192ac0=events[_0xd656f9];var _0x2cacc3=createListener(_0xde93('0x7')+_0x192ac0,_0x5aea8e);SmsQueueEvents['on'](_0x192ac0,_0x2cacc3);}}; \ No newline at end of file +var _0x5664=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x5664,0x1ac));var _0x4566=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0x5664[_0xc55d64];return _0x4194f6;};'use strict';var SmsQueueEvents=require(_0x4566('0x0'));var events=[_0x4566('0x1'),_0x4566('0x2'),_0x4566('0x3')];function createListener(_0x1599bd,_0x467250){return function(_0x41b52e){_0x467250[_0x4566('0x4')](_0x1599bd,_0x41b52e);};}function removeListener(_0x32ca49,_0x308740){return function(){SmsQueueEvents[_0x4566('0x5')](_0x32ca49,_0x308740);};}exports[_0x4566('0x6')]=function(_0x42f3e8){for(var _0x583e44=0x0,_0x30097d=events[_0x4566('0x7')];_0x583e44<_0x30097d;_0x583e44++){var _0x4ece32=events[_0x583e44];var _0x55ace3=createListener(_0x4566('0x8')+_0x4ece32,_0x42f3e8);SmsQueueEvents['on'](_0x4ece32,_0x55ace3);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 89f2145..d0d3950 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 _0x34ec=['/:id','update','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','show','post'];(function(_0x1bd8a4,_0x59e907){var _0x15b0aa=function(_0x866f7e){while(--_0x866f7e){_0x1bd8a4['push'](_0x1bd8a4['shift']());}};_0x15b0aa(++_0x59e907);}(_0x34ec,0x1f4));var _0xc34e=function(_0x27eb9e,_0x51eb57){_0x27eb9e=_0x27eb9e-0x0;var _0x11fb4e=_0x34ec[_0x27eb9e];return _0x11fb4e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc34e('0x0'));var timeout=require(_0xc34e('0x1'));var express=require(_0xc34e('0x2'));var router=express[_0xc34e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc34e('0x4'));var config=require(_0xc34e('0x5'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0xc34e('0x6')](),controller[_0xc34e('0x7')]);router[_0xc34e('0x8')]('/describe',auth[_0xc34e('0x6')](),controller[_0xc34e('0x9')]);router[_0xc34e('0x8')]('/:id',auth[_0xc34e('0x6')](),controller[_0xc34e('0xa')]);router[_0xc34e('0xb')]('/',auth[_0xc34e('0x6')](),controller['create']);router['put'](_0xc34e('0xc'),auth['isAuthenticated'](),controller[_0xc34e('0xd')]);router['delete'](_0xc34e('0xc'),auth[_0xc34e('0x6')](),controller[_0xc34e('0xe')]);module[_0xc34e('0xf')]=router; \ No newline at end of file +var _0x87d3=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete'];(function(_0x230a39,_0x1c5bc2){var _0x314173=function(_0x5be403){while(--_0x5be403){_0x230a39['push'](_0x230a39['shift']());}};_0x314173(++_0x1c5bc2);}(_0x87d3,0x86));var _0x387d=function(_0x2847ec,_0x40ce19){_0x2847ec=_0x2847ec-0x0;var _0x507988=_0x87d3[_0x2847ec];return _0x507988;};'use strict';var multer=require(_0x387d('0x0'));var util=require(_0x387d('0x1'));var path=require(_0x387d('0x2'));var timeout=require(_0x387d('0x3'));var express=require(_0x387d('0x4'));var router=express[_0x387d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x387d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x387d('0x7'));var controller=require(_0x387d('0x8'));router[_0x387d('0x9')]('/',auth['isAuthenticated'](),controller[_0x387d('0xa')]);router[_0x387d('0x9')](_0x387d('0xb'),auth[_0x387d('0xc')](),controller[_0x387d('0xd')]);router[_0x387d('0x9')](_0x387d('0xe'),auth[_0x387d('0xc')](),controller[_0x387d('0xf')]);router[_0x387d('0x10')]('/',auth[_0x387d('0xc')](),controller['create']);router[_0x387d('0x11')](_0x387d('0xe'),auth[_0x387d('0xc')](),controller[_0x387d('0x12')]);router[_0x387d('0x13')](_0x387d('0xe'),auth[_0x387d('0xc')](),controller[_0x387d('0x14')]);module[_0x387d('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0dc50a0..7523e3a 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 _0x4a2f=['STRING','DATE','moment','exports'];(function(_0x506553,_0x3b9770){var _0x52ddef=function(_0x170b52){while(--_0x170b52){_0x506553['push'](_0x506553['shift']());}};_0x52ddef(++_0x3b9770);}(_0x4a2f,0x146));var _0xf4a2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4a2f[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0xf4a2('0x0'));var Sequelize=require('sequelize');module[_0xf4a2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf4a2('0x2')]},'joinAt':{'type':Sequelize[_0xf4a2('0x3')]},'leaveAt':{'type':Sequelize[_0xf4a2('0x3')]},'acceptAt':{'type':Sequelize[_0xf4a2('0x3')]},'exitAt':{'type':Sequelize[_0xf4a2('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf14b=['DATE','sequelize','STRING'];(function(_0x37a673,_0x50c1ea){var _0x39e377=function(_0x269ed1){while(--_0x269ed1){_0x37a673['push'](_0x37a673['shift']());}};_0x39e377(++_0x50c1ea);}(_0xf14b,0xb8));var _0xbf14=function(_0x409abe,_0x4b64b4){_0x409abe=_0x409abe-0x0;var _0x2a0543=_0xf14b[_0x409abe];return _0x2a0543;};'use strict';var moment=require('moment');var Sequelize=require(_0xbf14('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbf14('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xbf14('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbf14('0x2')]},'acceptAt':{'type':Sequelize[_0xbf14('0x2')]},'exitAt':{'type':Sequelize[_0xbf14('0x2')]},'reason':{'type':Sequelize[_0xbf14('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 215b3e1..b085d9e 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 _0x996d=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','path'];(function(_0x3e524b,_0x120a2e){var _0x2cd9c9=function(_0x5469a8){while(--_0x5469a8){_0x3e524b['push'](_0x3e524b['shift']());}};_0x2cd9c9(++_0x120a2e);}(_0x996d,0x17f));var _0xd996=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x996d[_0x45d3f0];return _0x314b79;};'use strict';var emlformat=require(_0xd996('0x0'));var rimraf=require(_0xd996('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd996('0x2'));var moment=require(_0xd996('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd996('0x4'));var util=require(_0xd996('0x5'));var path=require(_0xd996('0x6'));var sox=require(_0xd996('0x7'));var csv=require(_0xd996('0x8'));var ejs=require(_0xd996('0x9'));var fs=require('fs');var fs_extra=require(_0xd996('0xa'));var _=require(_0xd996('0xb'));var squel=require(_0xd996('0xc'));var crypto=require(_0xd996('0xd'));var jsforce=require(_0xd996('0xe'));var deskjs=require(_0xd996('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd996('0x10'));var Papa=require(_0xd996('0x11'));var Redis=require(_0xd996('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd996('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd996('0x14'));var logger=require(_0xd996('0x15'))(_0xd996('0x16'));var utils=require(_0xd996('0x17'));var config=require(_0xd996('0x18'));var licenseUtil=require(_0xd996('0x19'));var db=require(_0xd996('0x1a'))['db'];function respondWithStatusCode(_0x5e7264,_0x4a6005){_0x4a6005=_0x4a6005||0xcc;return function(_0x360466){if(_0x360466){return _0x5e7264[_0xd996('0x1b')](_0x4a6005);}return _0x5e7264['status'](_0x4a6005)['end']();};}function respondWithResult(_0x1c447a,_0x2d7127){_0x2d7127=_0x2d7127||0xc8;return function(_0x1600d){if(_0x1600d){return _0x1c447a[_0xd996('0x1c')](_0x2d7127)[_0xd996('0x1d')](_0x1600d);}};}function respondWithFilteredResult(_0x564116,_0x4b2868){return function(_0x118115){if(_0x118115){var _0x20a039=typeof _0x4b2868[_0xd996('0x1e')]==='undefined'&&typeof _0x4b2868['limit']===_0xd996('0x1f');var _0x88b738=_0x118115['count'];var _0x31fd5c=_0x20a039?0x0:_0x4b2868[_0xd996('0x1e')];var _0x9d1f91=_0x20a039?_0x118115[_0xd996('0x20')]:_0x4b2868[_0xd996('0x1e')]+_0x4b2868[_0xd996('0x21')];var _0x18a4b9;if(_0x9d1f91>=_0x88b738){_0x9d1f91=_0x88b738;_0x18a4b9=0xc8;}else{_0x18a4b9=0xce;}_0x564116[_0xd996('0x1c')](_0x18a4b9);return _0x564116[_0xd996('0x22')](_0xd996('0x23'),_0x31fd5c+'-'+_0x9d1f91+'/'+_0x88b738)[_0xd996('0x1d')](_0x118115);}return null;};}function patchUpdates(_0x490955){return function(_0x4d4842){try{jsonpatch[_0xd996('0x24')](_0x4d4842,_0x490955,!![]);}catch(_0x424671){return BPromise[_0xd996('0x25')](_0x424671);}return _0x4d4842[_0xd996('0x26')]();};}function saveUpdates(_0x5a239d,_0x442cad){return function(_0x2d059d){if(_0x2d059d){return _0x2d059d[_0xd996('0x27')](_0x5a239d)[_0xd996('0x28')](function(_0xcdc885){return _0xcdc885;});}return null;};}function removeEntity(_0x5b6623,_0x449730){return function(_0x4113e0){if(_0x4113e0){return _0x4113e0[_0xd996('0x29')]()[_0xd996('0x28')](function(){_0x5b6623['status'](0xcc)[_0xd996('0x2a')]();});}};}function handleEntityNotFound(_0x26e28e,_0x33efc2){return function(_0x407a9d){if(!_0x407a9d){_0x26e28e['sendStatus'](0x194);}return _0x407a9d;};}function handleError(_0x1ef697,_0x3ef388){_0x3ef388=_0x3ef388||0x1f4;return function(_0x45a1cb){logger['error'](_0x45a1cb[_0xd996('0x2b')]);if(_0x45a1cb['name']){delete _0x45a1cb[_0xd996('0x2c')];}_0x1ef697[_0xd996('0x1c')](_0x3ef388)['send'](_0x45a1cb);};}exports[_0xd996('0x2d')]=function(_0x3f021d,_0x5b384b){var _0x18dffa={},_0x2d3545={},_0x38e1b1={'count':0x0,'rows':[]};var _0x530f34=_[_0xd996('0x2e')](db[_0xd996('0x2f')][_0xd996('0x30')],function(_0x38e408){return{'name':_0x38e408[_0xd996('0x31')],'type':_0x38e408[_0xd996('0x32')][_0xd996('0x33')]};});_0x2d3545['model']=_[_0xd996('0x2e')](_0x530f34,_0xd996('0x2c'));_0x2d3545[_0xd996('0x34')]=_[_0xd996('0x35')](_0x3f021d['query']);_0x2d3545[_0xd996('0x36')]=_['intersection'](_0x2d3545[_0xd996('0x37')],_0x2d3545[_0xd996('0x34')]);_0x18dffa[_0xd996('0x38')]=_[_0xd996('0x39')](_0x2d3545[_0xd996('0x37')],qs[_0xd996('0x3a')](_0x3f021d[_0xd996('0x34')][_0xd996('0x3a')]));_0x18dffa[_0xd996('0x38')]=_0x18dffa['attributes'][_0xd996('0x3b')]?_0x18dffa[_0xd996('0x38')]:_0x2d3545[_0xd996('0x37')];if(!_0x3f021d[_0xd996('0x34')][_0xd996('0x3c')]('nolimit')){_0x18dffa[_0xd996('0x21')]=qs[_0xd996('0x21')](_0x3f021d[_0xd996('0x34')]['limit']);_0x18dffa['offset']=qs[_0xd996('0x1e')](_0x3f021d[_0xd996('0x34')]['offset']);}_0x18dffa['order']=qs[_0xd996('0x3d')](_0x3f021d[_0xd996('0x34')][_0xd996('0x3d')]);_0x18dffa[_0xd996('0x3e')]=qs[_0xd996('0x36')](_[_0xd996('0x3f')](_0x3f021d[_0xd996('0x34')],_0x2d3545[_0xd996('0x36')]),_0x530f34);if(_0x3f021d[_0xd996('0x34')]['filter']){_0x18dffa[_0xd996('0x3e')]=_['merge'](_0x18dffa[_0xd996('0x3e')],{'$or':_[_0xd996('0x2e')](_0x530f34,function(_0x676652){if(_0x676652['type']!==_0xd996('0x40')){var _0xb31b95={};_0xb31b95[_0x676652[_0xd996('0x2c')]]={'$like':'%'+_0x3f021d['query'][_0xd996('0x41')]+'%'};return _0xb31b95;}})});}_0x18dffa=_[_0xd996('0x42')]({},_0x18dffa,_0x3f021d[_0xd996('0x43')]);var _0x3d9888={'where':_0x18dffa[_0xd996('0x3e')]};return db['SmsQueueReport'][_0xd996('0x20')](_0x3d9888)[_0xd996('0x28')](function(_0x59adb9){_0x38e1b1[_0xd996('0x20')]=_0x59adb9;if(_0x3f021d['query'][_0xd996('0x44')]){_0x18dffa[_0xd996('0x45')]=[{'all':!![]}];}return db[_0xd996('0x2f')]['findAll'](_0x18dffa);})[_0xd996('0x28')](function(_0xf6112b){_0x38e1b1[_0xd996('0x46')]=_0xf6112b;return _0x38e1b1;})[_0xd996('0x28')](respondWithFilteredResult(_0x5b384b,_0x18dffa))[_0xd996('0x47')](handleError(_0x5b384b,null));};exports[_0xd996('0x48')]=function(_0x797080,_0x131f78){var _0x4e97e4={'raw':!![],'where':{'id':_0x797080[_0xd996('0x49')]['id']}},_0x1bb3d7={};_0x1bb3d7[_0xd996('0x37')]=_[_0xd996('0x35')](db[_0xd996('0x2f')]['rawAttributes']);_0x1bb3d7['query']=_[_0xd996('0x35')](_0x797080['query']);_0x1bb3d7[_0xd996('0x36')]=_['intersection'](_0x1bb3d7[_0xd996('0x37')],_0x1bb3d7[_0xd996('0x34')]);_0x4e97e4[_0xd996('0x38')]=_[_0xd996('0x39')](_0x1bb3d7['model'],qs[_0xd996('0x3a')](_0x797080['query']['fields']));_0x4e97e4[_0xd996('0x38')]=_0x4e97e4[_0xd996('0x38')][_0xd996('0x3b')]?_0x4e97e4[_0xd996('0x38')]:_0x1bb3d7[_0xd996('0x37')];if(_0x797080[_0xd996('0x34')]['includeAll']){_0x4e97e4[_0xd996('0x45')]=[{'all':!![]}];}_0x4e97e4=_[_0xd996('0x42')]({},_0x4e97e4,_0x797080['options']);return db['SmsQueueReport'][_0xd996('0x4a')](_0x4e97e4)[_0xd996('0x28')](handleEntityNotFound(_0x131f78,null))[_0xd996('0x28')](respondWithResult(_0x131f78,null))['catch'](handleError(_0x131f78,null));};exports[_0xd996('0x4b')]=function(_0x4e1f9a,_0x80e81){return db[_0xd996('0x2f')][_0xd996('0x4b')](_0x4e1f9a['body'],{})[_0xd996('0x28')](respondWithResult(_0x80e81,0xc9))[_0xd996('0x47')](handleError(_0x80e81,null));};exports[_0xd996('0x27')]=function(_0x5bbb54,_0x11f34d){if(_0x5bbb54[_0xd996('0x4c')]['id']){delete _0x5bbb54[_0xd996('0x4c')]['id'];}return db[_0xd996('0x2f')][_0xd996('0x4a')]({'where':{'id':_0x5bbb54[_0xd996('0x49')]['id']}})['then'](handleEntityNotFound(_0x11f34d,null))[_0xd996('0x28')](saveUpdates(_0x5bbb54[_0xd996('0x4c')],null))[_0xd996('0x28')](respondWithResult(_0x11f34d,null))[_0xd996('0x47')](handleError(_0x11f34d,null));};exports[_0xd996('0x29')]=function(_0x3b4d4b,_0x3153e6){return db[_0xd996('0x2f')][_0xd996('0x4a')]({'where':{'id':_0x3b4d4b[_0xd996('0x49')]['id']}})[_0xd996('0x28')](handleEntityNotFound(_0x3153e6,null))[_0xd996('0x28')](removeEntity(_0x3153e6,null))['catch'](handleError(_0x3153e6,null));};exports[_0xd996('0x4d')]=function(_0x1844bc,_0x455cae){return db[_0xd996('0x2f')]['describe']()['then'](respondWithResult(_0x455cae,null))['catch'](handleError(_0x455cae,null));}; \ No newline at end of file +var _0xd1cf=['../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger'];(function(_0x514a57,_0x3f68f0){var _0x5814ac=function(_0x538d37){while(--_0x538d37){_0x514a57['push'](_0x514a57['shift']());}};_0x5814ac(++_0x3f68f0);}(_0xd1cf,0x165));var _0xfd1c=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0xd1cf[_0x2a453b];return _0x132f79;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfd1c('0x0'));var rp=require(_0xfd1c('0x1'));var moment=require(_0xfd1c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfd1c('0x3'));var util=require(_0xfd1c('0x4'));var path=require(_0xfd1c('0x5'));var sox=require(_0xfd1c('0x6'));var csv=require('to-csv');var ejs=require(_0xfd1c('0x7'));var fs=require('fs');var fs_extra=require(_0xfd1c('0x8'));var _=require('lodash');var squel=require(_0xfd1c('0x9'));var crypto=require(_0xfd1c('0xa'));var jsforce=require(_0xfd1c('0xb'));var deskjs=require(_0xfd1c('0xc'));var toCsv=require(_0xfd1c('0xd'));var querystring=require(_0xfd1c('0xe'));var Papa=require(_0xfd1c('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(_0xfd1c('0x10'));var logger=require(_0xfd1c('0x11'))('api');var utils=require(_0xfd1c('0x12'));var config=require(_0xfd1c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd1c('0x14'))['db'];function respondWithStatusCode(_0x294d60,_0x3d09a2){_0x3d09a2=_0x3d09a2||0xcc;return function(_0x3ff294){if(_0x3ff294){return _0x294d60['sendStatus'](_0x3d09a2);}return _0x294d60[_0xfd1c('0x15')](_0x3d09a2)[_0xfd1c('0x16')]();};}function respondWithResult(_0x174375,_0x5c5606){_0x5c5606=_0x5c5606||0xc8;return function(_0x48b9d9){if(_0x48b9d9){return _0x174375[_0xfd1c('0x15')](_0x5c5606)['json'](_0x48b9d9);}};}function respondWithFilteredResult(_0x54c3d5,_0x545303){return function(_0xac1d75){if(_0xac1d75){var _0x25b619=typeof _0x545303['offset']===_0xfd1c('0x17')&&typeof _0x545303['limit']===_0xfd1c('0x17');var _0x2c9ada=_0xac1d75['count'];var _0x41cebc=_0x25b619?0x0:_0x545303[_0xfd1c('0x18')];var _0xae99e9=_0x25b619?_0xac1d75[_0xfd1c('0x19')]:_0x545303['offset']+_0x545303['limit'];var _0x302ad8;if(_0xae99e9>=_0x2c9ada){_0xae99e9=_0x2c9ada;_0x302ad8=0xc8;}else{_0x302ad8=0xce;}_0x54c3d5[_0xfd1c('0x15')](_0x302ad8);return _0x54c3d5[_0xfd1c('0x1a')](_0xfd1c('0x1b'),_0x41cebc+'-'+_0xae99e9+'/'+_0x2c9ada)[_0xfd1c('0x1c')](_0xac1d75);}return null;};}function patchUpdates(_0x3e805c){return function(_0xf2a3be){try{jsonpatch[_0xfd1c('0x1d')](_0xf2a3be,_0x3e805c,!![]);}catch(_0x145676){return BPromise[_0xfd1c('0x1e')](_0x145676);}return _0xf2a3be[_0xfd1c('0x1f')]();};}function saveUpdates(_0x2a1961,_0x2bd0da){return function(_0x11ee00){if(_0x11ee00){return _0x11ee00[_0xfd1c('0x20')](_0x2a1961)[_0xfd1c('0x21')](function(_0x3e25dd){return _0x3e25dd;});}return null;};}function removeEntity(_0x3949ad,_0x2789c4){return function(_0x2b15e7){if(_0x2b15e7){return _0x2b15e7[_0xfd1c('0x22')]()[_0xfd1c('0x21')](function(){_0x3949ad[_0xfd1c('0x15')](0xcc)[_0xfd1c('0x16')]();});}};}function handleEntityNotFound(_0x3f5b64,_0x2c5cf8){return function(_0x1ef356){if(!_0x1ef356){_0x3f5b64[_0xfd1c('0x23')](0x194);}return _0x1ef356;};}function handleError(_0x1da046,_0x3574e8){_0x3574e8=_0x3574e8||0x1f4;return function(_0x443771){logger[_0xfd1c('0x24')](_0x443771[_0xfd1c('0x25')]);if(_0x443771['name']){delete _0x443771[_0xfd1c('0x26')];}_0x1da046[_0xfd1c('0x15')](_0x3574e8)[_0xfd1c('0x27')](_0x443771);};}exports[_0xfd1c('0x28')]=function(_0x5611ac,_0x1c6464){var _0x1d61bd={},_0x3399fa={},_0x32cac5={'count':0x0,'rows':[]};var _0x1494d9=_['map'](db[_0xfd1c('0x29')][_0xfd1c('0x2a')],function(_0x362cfc){return{'name':_0x362cfc[_0xfd1c('0x2b')],'type':_0x362cfc[_0xfd1c('0x2c')][_0xfd1c('0x2d')]};});_0x3399fa[_0xfd1c('0x2e')]=_['map'](_0x1494d9,'name');_0x3399fa[_0xfd1c('0x2f')]=_[_0xfd1c('0x30')](_0x5611ac[_0xfd1c('0x2f')]);_0x3399fa[_0xfd1c('0x31')]=_[_0xfd1c('0x32')](_0x3399fa[_0xfd1c('0x2e')],_0x3399fa[_0xfd1c('0x2f')]);_0x1d61bd[_0xfd1c('0x33')]=_[_0xfd1c('0x32')](_0x3399fa[_0xfd1c('0x2e')],qs[_0xfd1c('0x34')](_0x5611ac['query'][_0xfd1c('0x34')]));_0x1d61bd[_0xfd1c('0x33')]=_0x1d61bd[_0xfd1c('0x33')][_0xfd1c('0x35')]?_0x1d61bd['attributes']:_0x3399fa[_0xfd1c('0x2e')];if(!_0x5611ac[_0xfd1c('0x2f')][_0xfd1c('0x36')](_0xfd1c('0x37'))){_0x1d61bd[_0xfd1c('0x38')]=qs[_0xfd1c('0x38')](_0x5611ac[_0xfd1c('0x2f')][_0xfd1c('0x38')]);_0x1d61bd[_0xfd1c('0x18')]=qs[_0xfd1c('0x18')](_0x5611ac['query']['offset']);}_0x1d61bd[_0xfd1c('0x39')]=qs[_0xfd1c('0x3a')](_0x5611ac[_0xfd1c('0x2f')]['sort']);_0x1d61bd[_0xfd1c('0x3b')]=qs['filters'](_['pick'](_0x5611ac[_0xfd1c('0x2f')],_0x3399fa['filters']),_0x1494d9);if(_0x5611ac[_0xfd1c('0x2f')][_0xfd1c('0x3c')]){_0x1d61bd[_0xfd1c('0x3b')]=_[_0xfd1c('0x3d')](_0x1d61bd[_0xfd1c('0x3b')],{'$or':_[_0xfd1c('0x3e')](_0x1494d9,function(_0x1abb48){if(_0x1abb48[_0xfd1c('0x2c')]!==_0xfd1c('0x3f')){var _0x301ac8={};_0x301ac8[_0x1abb48[_0xfd1c('0x26')]]={'$like':'%'+_0x5611ac[_0xfd1c('0x2f')][_0xfd1c('0x3c')]+'%'};return _0x301ac8;}})});}_0x1d61bd=_[_0xfd1c('0x3d')]({},_0x1d61bd,_0x5611ac[_0xfd1c('0x40')]);var _0x29c657={'where':_0x1d61bd[_0xfd1c('0x3b')]};return db[_0xfd1c('0x29')][_0xfd1c('0x19')](_0x29c657)[_0xfd1c('0x21')](function(_0x4160f8){_0x32cac5[_0xfd1c('0x19')]=_0x4160f8;if(_0x5611ac['query'][_0xfd1c('0x41')]){_0x1d61bd[_0xfd1c('0x42')]=[{'all':!![]}];}return db[_0xfd1c('0x29')][_0xfd1c('0x43')](_0x1d61bd);})[_0xfd1c('0x21')](function(_0x218183){_0x32cac5[_0xfd1c('0x44')]=_0x218183;return _0x32cac5;})[_0xfd1c('0x21')](respondWithFilteredResult(_0x1c6464,_0x1d61bd))[_0xfd1c('0x45')](handleError(_0x1c6464,null));};exports[_0xfd1c('0x46')]=function(_0x1cd66e,_0x5d87b4){var _0x397636={'raw':!![],'where':{'id':_0x1cd66e[_0xfd1c('0x47')]['id']}},_0x357763={};_0x357763[_0xfd1c('0x2e')]=_[_0xfd1c('0x30')](db['SmsQueueReport'][_0xfd1c('0x2a')]);_0x357763[_0xfd1c('0x2f')]=_[_0xfd1c('0x30')](_0x1cd66e[_0xfd1c('0x2f')]);_0x357763[_0xfd1c('0x31')]=_['intersection'](_0x357763['model'],_0x357763[_0xfd1c('0x2f')]);_0x397636[_0xfd1c('0x33')]=_[_0xfd1c('0x32')](_0x357763['model'],qs[_0xfd1c('0x34')](_0x1cd66e[_0xfd1c('0x2f')]['fields']));_0x397636[_0xfd1c('0x33')]=_0x397636[_0xfd1c('0x33')][_0xfd1c('0x35')]?_0x397636[_0xfd1c('0x33')]:_0x357763['model'];if(_0x1cd66e[_0xfd1c('0x2f')][_0xfd1c('0x41')]){_0x397636['include']=[{'all':!![]}];}_0x397636=_['merge']({},_0x397636,_0x1cd66e[_0xfd1c('0x40')]);return db[_0xfd1c('0x29')][_0xfd1c('0x48')](_0x397636)[_0xfd1c('0x21')](handleEntityNotFound(_0x5d87b4,null))[_0xfd1c('0x21')](respondWithResult(_0x5d87b4,null))['catch'](handleError(_0x5d87b4,null));};exports[_0xfd1c('0x49')]=function(_0x2b075b,_0x23da1a){return db['SmsQueueReport'][_0xfd1c('0x49')](_0x2b075b[_0xfd1c('0x4a')],{})[_0xfd1c('0x21')](respondWithResult(_0x23da1a,0xc9))[_0xfd1c('0x45')](handleError(_0x23da1a,null));};exports[_0xfd1c('0x20')]=function(_0x3e9bf4,_0x85a05b){if(_0x3e9bf4['body']['id']){delete _0x3e9bf4[_0xfd1c('0x4a')]['id'];}return db['SmsQueueReport'][_0xfd1c('0x48')]({'where':{'id':_0x3e9bf4[_0xfd1c('0x47')]['id']}})['then'](handleEntityNotFound(_0x85a05b,null))[_0xfd1c('0x21')](saveUpdates(_0x3e9bf4[_0xfd1c('0x4a')],null))[_0xfd1c('0x21')](respondWithResult(_0x85a05b,null))[_0xfd1c('0x45')](handleError(_0x85a05b,null));};exports[_0xfd1c('0x22')]=function(_0x5ebcc1,_0x57ab9c){return db[_0xfd1c('0x29')][_0xfd1c('0x48')]({'where':{'id':_0x5ebcc1[_0xfd1c('0x47')]['id']}})[_0xfd1c('0x21')](handleEntityNotFound(_0x57ab9c,null))[_0xfd1c('0x21')](removeEntity(_0x57ab9c,null))[_0xfd1c('0x45')](handleError(_0x57ab9c,null));};exports['describe']=function(_0x200464,_0x147f9d){return db[_0xfd1c('0x29')]['describe']()[_0xfd1c('0x21')](respondWithResult(_0x147f9d,null))[_0xfd1c('0x45')](handleError(_0x147f9d,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9c34e0d..ce64b05 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0xbc2590,_0x59759e){var _0x2df998=function(_0x55201e){while(--_0x55201e){_0xbc2590['push'](_0xbc2590['shift']());}};_0x2df998(++_0x59759e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xb7e7[_0x9df060];return _0x338dfe;};'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_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1e63ec,_0x1c5fae){var _0x442972=function(_0x2d65eb){while(--_0x2d65eb){_0x1e63ec['push'](_0x1e63ec['shift']());}};_0x442972(++_0x1c5fae);}(_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 logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 80041cb..4d17b10 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 _0x8ea4=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','raw','update','options','limit','UpdateSmsQueueReport'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8ea4,0x1d0));var _0x48ea=function(_0x13eec2,_0xe78b42){_0x13eec2=_0x13eec2-0x0;var _0x46c367=_0x8ea4[_0x13eec2];return _0x46c367;};'use strict';var _=require(_0x48ea('0x0'));var util=require('util');var moment=require(_0x48ea('0x1'));var BPromise=require('bluebird');var rs=require(_0x48ea('0x2'));var fs=require('fs');var Redis=require(_0x48ea('0x3'));var db=require(_0x48ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x48ea('0x5'))('rpc');var config=require(_0x48ea('0x6'));var jayson=require(_0x48ea('0x7'));var client=jayson[_0x48ea('0x8')][_0x48ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5831b6,_0x4d2f7c,_0x26ca33){return new BPromise(function(_0x59da2e,_0x4b8dfd){return client['request'](_0x5831b6,_0x26ca33)[_0x48ea('0xa')](function(_0x1e4528){logger[_0x48ea('0xb')](_0x48ea('0xc'),_0x4d2f7c,_0x48ea('0xd'));logger[_0x48ea('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x4d2f7c,_0x48ea('0xd'),JSON[_0x48ea('0xf')](_0x1e4528));if(_0x1e4528[_0x48ea('0x10')]){if(_0x1e4528[_0x48ea('0x10')][_0x48ea('0x11')]===0x1f4){logger[_0x48ea('0x10')](_0x48ea('0xc'),_0x4d2f7c,_0x1e4528[_0x48ea('0x10')][_0x48ea('0x12')]);return _0x4b8dfd(_0x1e4528['error'][_0x48ea('0x12')]);}logger[_0x48ea('0x10')](_0x48ea('0xc'),_0x4d2f7c,_0x1e4528['error']['message']);return _0x59da2e(_0x1e4528[_0x48ea('0x10')][_0x48ea('0x12')]);}else{logger[_0x48ea('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x4d2f7c,_0x48ea('0xd'));_0x59da2e(_0x1e4528['result'][_0x48ea('0x12')]);}})[_0x48ea('0x13')](function(_0x3f4779){logger[_0x48ea('0x10')](_0x48ea('0xc'),_0x4d2f7c,_0x3f4779);_0x4b8dfd(_0x3f4779);});});}exports[_0x48ea('0x14')]=function(_0x5e54ec){var _0x35fcd3=this;return new Promise(function(_0x25dc76,_0x56a937){return db[_0x48ea('0x15')][_0x48ea('0x16')](_0x5e54ec[_0x48ea('0x17')],{'raw':_0x5e54ec['options']?_0x5e54ec['options'][_0x48ea('0x18')]===undefined?!![]:![]:!![]})[_0x48ea('0xa')](function(_0x2795b3){logger['info']('CreateSmsQueueReport',_0x5e54ec);logger[_0x48ea('0xe')]('CreateSmsQueueReport',_0x5e54ec,JSON[_0x48ea('0xf')](_0x2795b3));_0x25dc76(_0x2795b3);})[_0x48ea('0x13')](function(_0xefea66){logger[_0x48ea('0x10')](_0x48ea('0x14'),_0xefea66[_0x48ea('0x12')],_0x5e54ec);_0x56a937(_0x35fcd3[_0x48ea('0x10')](0x1f4,_0xefea66[_0x48ea('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x1294b7){var _0x1dcc25=this;return new Promise(function(_0x22053c,_0x30b034){return db[_0x48ea('0x15')][_0x48ea('0x19')](_0x1294b7[_0x48ea('0x17')],{'raw':_0x1294b7[_0x48ea('0x1a')]?_0x1294b7[_0x48ea('0x1a')][_0x48ea('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1294b7['options']?_0x1294b7[_0x48ea('0x1a')]['where']||null:null,'attributes':_0x1294b7[_0x48ea('0x1a')]?_0x1294b7[_0x48ea('0x1a')]['attributes']||null:null,'limit':_0x1294b7[_0x48ea('0x1a')]?_0x1294b7[_0x48ea('0x1a')][_0x48ea('0x1b')]||null:null})[_0x48ea('0xa')](function(_0x2c086e){logger[_0x48ea('0xb')]('UpdateSmsQueueReport',_0x1294b7);logger[_0x48ea('0xe')](_0x48ea('0x1c'),_0x1294b7,JSON[_0x48ea('0xf')](_0x2c086e));_0x22053c(_0x2c086e);})[_0x48ea('0x13')](function(_0x4c1b02){logger[_0x48ea('0x10')](_0x48ea('0x1c'),_0x4c1b02[_0x48ea('0x12')],_0x1294b7);_0x30b034(_0x1dcc25[_0x48ea('0x10')](0x1f4,_0x4c1b02[_0x48ea('0x12')]));});});}; \ No newline at end of file +var _0x9f59=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','catch','UpdateSmsQueueReport','update','where','attributes','util','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9f59,0x19e));var _0x99f5=function(_0x569bbf,_0x2aa5f1){_0x569bbf=_0x569bbf-0x0;var _0x5292c4=_0x9f59[_0x569bbf];return _0x5292c4;};'use strict';var _=require('lodash');var util=require(_0x99f5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x99f5('0x1'));var fs=require('fs');var Redis=require(_0x99f5('0x2'));var db=require(_0x99f5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x99f5('0x4'))(_0x99f5('0x5'));var config=require(_0x99f5('0x6'));var jayson=require(_0x99f5('0x7'));var client=jayson['client'][_0x99f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f3812,_0x21108a,_0x9435e9){return new BPromise(function(_0xc7d5cf,_0x1448ca){return client[_0x99f5('0x9')](_0x5f3812,_0x9435e9)[_0x99f5('0xa')](function(_0x20d1d2){logger[_0x99f5('0xb')](_0x99f5('0xc'),_0x21108a,'request\x20sent');logger['debug'](_0x99f5('0xd'),_0x21108a,_0x99f5('0xe'),JSON[_0x99f5('0xf')](_0x20d1d2));if(_0x20d1d2[_0x99f5('0x10')]){if(_0x20d1d2[_0x99f5('0x10')][_0x99f5('0x11')]===0x1f4){logger['error'](_0x99f5('0xc'),_0x21108a,_0x20d1d2[_0x99f5('0x10')][_0x99f5('0x12')]);return _0x1448ca(_0x20d1d2[_0x99f5('0x10')][_0x99f5('0x12')]);}logger[_0x99f5('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x21108a,_0x20d1d2[_0x99f5('0x10')][_0x99f5('0x12')]);return _0xc7d5cf(_0x20d1d2['error'][_0x99f5('0x12')]);}else{logger[_0x99f5('0xb')](_0x99f5('0xc'),_0x21108a,'request\x20sent');_0xc7d5cf(_0x20d1d2[_0x99f5('0x13')][_0x99f5('0x12')]);}})['catch'](function(_0x128f9f){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x21108a,_0x128f9f);_0x1448ca(_0x128f9f);});});}exports[_0x99f5('0x14')]=function(_0x496587){var _0xc072b6=this;return new Promise(function(_0x5bf668,_0x4da38b){return db[_0x99f5('0x15')][_0x99f5('0x16')](_0x496587[_0x99f5('0x17')],{'raw':_0x496587[_0x99f5('0x18')]?_0x496587[_0x99f5('0x18')][_0x99f5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x35cc45){logger[_0x99f5('0xb')](_0x99f5('0x14'),_0x496587);logger[_0x99f5('0x1a')](_0x99f5('0x14'),_0x496587,JSON[_0x99f5('0xf')](_0x35cc45));_0x5bf668(_0x35cc45);})[_0x99f5('0x1b')](function(_0x3cddcd){logger[_0x99f5('0x10')](_0x99f5('0x14'),_0x3cddcd[_0x99f5('0x12')],_0x496587);_0x4da38b(_0xc072b6[_0x99f5('0x10')](0x1f4,_0x3cddcd[_0x99f5('0x12')]));});});};exports[_0x99f5('0x1c')]=function(_0x49cb6f){var _0x3810c7=this;return new Promise(function(_0x5b31ce,_0x3af9f8){return db[_0x99f5('0x15')][_0x99f5('0x1d')](_0x49cb6f[_0x99f5('0x17')],{'raw':_0x49cb6f[_0x99f5('0x18')]?_0x49cb6f[_0x99f5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49cb6f[_0x99f5('0x18')]?_0x49cb6f[_0x99f5('0x18')][_0x99f5('0x1e')]||null:null,'attributes':_0x49cb6f['options']?_0x49cb6f['options'][_0x99f5('0x1f')]||null:null,'limit':_0x49cb6f[_0x99f5('0x18')]?_0x49cb6f['options']['limit']||null:null})[_0x99f5('0xa')](function(_0x1fb113){logger[_0x99f5('0xb')](_0x99f5('0x1c'),_0x49cb6f);logger['debug']('UpdateSmsQueueReport',_0x49cb6f,JSON[_0x99f5('0xf')](_0x1fb113));_0x5b31ce(_0x1fb113);})[_0x99f5('0x1b')](function(_0x55cf39){logger[_0x99f5('0x10')](_0x99f5('0x1c'),_0x55cf39['message'],_0x49cb6f);_0x3af9f8(_0x3810c7[_0x99f5('0x10')](0x1f4,_0x55cf39[_0x99f5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 5e20a0d..7af0cb1 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 _0xe0ae=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x277a20,_0x1b2f85){var _0x31575c=function(_0x1ea4dc){while(--_0x1ea4dc){_0x277a20['push'](_0x277a20['shift']());}};_0x31575c(++_0x1b2f85);}(_0xe0ae,0xa1));var _0xee0a=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xe0ae[_0x38c632];return _0x12737e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xee0a('0x3'));var interaction=require(_0xee0a('0x4'));var config=require('../../config/environment');var controller=require(_0xee0a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0a('0x6')]);router[_0xee0a('0x7')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller['describe']);router[_0xee0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee0a('0xa')]);router[_0xee0a('0xb')]('/',auth[_0xee0a('0x9')](),controller['create']);router[_0xee0a('0xc')](_0xee0a('0xd'),auth['isAuthenticated'](),controller[_0xee0a('0xe')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0x9')](),controller['destroy']);module[_0xee0a('0xf')]=router; \ No newline at end of file +var _0x7dfd=['isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x152abe,_0x4aa488){var _0x13e3bd=function(_0x4769f2){while(--_0x4769f2){_0x152abe['push'](_0x152abe['shift']());}};_0x13e3bd(++_0x4aa488);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')]('/',auth[_0xd7df('0xc')](),controller[_0xd7df('0xd')]);router[_0xd7df('0xb')](_0xd7df('0xe'),auth[_0xd7df('0xc')](),controller['describe']);router[_0xd7df('0xb')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x10')]);router['post']('/',auth[_0xd7df('0xc')](),controller['create']);router[_0xd7df('0x11')]('/:id',auth[_0xd7df('0xc')](),controller[_0xd7df('0x12')]);router[_0xd7df('0x13')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x14')]);module[_0xd7df('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 55799d7..290aa6f 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x95b44e,_0x4af5e1){var _0x4d33ea=function(_0x35acd6){while(--_0x35acd6){_0x95b44e['push'](_0x95b44e['shift']());}};_0x4d33ea(++_0x4af5e1);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x106ddf,_0x5c5c1c){var _0x44d646=function(_0x1cc35d){while(--_0x1cc35d){_0x106ddf['push'](_0x106ddf['shift']());}};_0x44d646(++_0x5c5c1c);}(_0xe706,0xa3));var _0x6e70=function(_0xbd3a05,_0xe6c6b7){_0xbd3a05=_0xbd3a05-0x0;var _0x101f90=_0xe706[_0xbd3a05];return _0x101f90;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 3c8ba44..5bf26cf 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 _0xde4b=['where','VIRTUAL','includeAll','include','findAll','catch','params','keys','length','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filters','filter','merge'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xde4b,0x1cf));var _0xbde4=function(_0x59fffa,_0x5a61db){_0x59fffa=_0x59fffa-0x0;var _0x281d4e=_0xde4b[_0x59fffa];return _0x281d4e;};'use strict';var emlformat=require(_0xbde4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbde4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbde4('0x2'));var moment=require(_0xbde4('0x3'));var BPromise=require(_0xbde4('0x4'));var Mustache=require(_0xbde4('0x5'));var util=require('util');var path=require(_0xbde4('0x6'));var sox=require(_0xbde4('0x7'));var csv=require('to-csv');var ejs=require(_0xbde4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbde4('0x9'));var squel=require('squel');var crypto=require(_0xbde4('0xa'));var jsforce=require(_0xbde4('0xb'));var deskjs=require(_0xbde4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbde4('0xd'));var Papa=require(_0xbde4('0xe'));var Redis=require(_0xbde4('0xf'));var authService=require(_0xbde4('0x10'));var qs=require(_0xbde4('0x11'));var as=require(_0xbde4('0x12'));var hardwareService=require(_0xbde4('0x13'));var logger=require(_0xbde4('0x14'))(_0xbde4('0x15'));var utils=require(_0xbde4('0x16'));var config=require(_0xbde4('0x17'));var licenseUtil=require(_0xbde4('0x18'));var db=require(_0xbde4('0x19'))['db'];function respondWithStatusCode(_0x1c1579,_0x24807b){_0x24807b=_0x24807b||0xcc;return function(_0x26308b){if(_0x26308b){return _0x1c1579[_0xbde4('0x1a')](_0x24807b);}return _0x1c1579[_0xbde4('0x1b')](_0x24807b)[_0xbde4('0x1c')]();};}function respondWithResult(_0x3f2396,_0x47740d){_0x47740d=_0x47740d||0xc8;return function(_0x11938f){if(_0x11938f){return _0x3f2396[_0xbde4('0x1b')](_0x47740d)[_0xbde4('0x1d')](_0x11938f);}};}function respondWithFilteredResult(_0x3de478,_0x3e2c8d){return function(_0x3a2304){if(_0x3a2304){var _0x435dd6=typeof _0x3e2c8d[_0xbde4('0x1e')]===_0xbde4('0x1f')&&typeof _0x3e2c8d[_0xbde4('0x20')]===_0xbde4('0x1f');var _0x47e1be=_0x3a2304[_0xbde4('0x21')];var _0x2657e1=_0x435dd6?0x0:_0x3e2c8d[_0xbde4('0x1e')];var _0x56b3b9=_0x435dd6?_0x3a2304[_0xbde4('0x21')]:_0x3e2c8d['offset']+_0x3e2c8d[_0xbde4('0x20')];var _0x561f68;if(_0x56b3b9>=_0x47e1be){_0x56b3b9=_0x47e1be;_0x561f68=0xc8;}else{_0x561f68=0xce;}_0x3de478['status'](_0x561f68);return _0x3de478[_0xbde4('0x22')]('Content-Range',_0x2657e1+'-'+_0x56b3b9+'/'+_0x47e1be)['json'](_0x3a2304);}return null;};}function patchUpdates(_0x4869b4){return function(_0x5658e5){try{jsonpatch['apply'](_0x5658e5,_0x4869b4,!![]);}catch(_0x3e6fba){return BPromise[_0xbde4('0x23')](_0x3e6fba);}return _0x5658e5[_0xbde4('0x24')]();};}function saveUpdates(_0x397cdf,_0x2a8455){return function(_0x2a2bbf){if(_0x2a2bbf){return _0x2a2bbf[_0xbde4('0x25')](_0x397cdf)[_0xbde4('0x26')](function(_0x527ee3){return _0x527ee3;});}return null;};}function removeEntity(_0x5373c6,_0x78a0a2){return function(_0x3e6e47){if(_0x3e6e47){return _0x3e6e47[_0xbde4('0x27')]()[_0xbde4('0x26')](function(){_0x5373c6[_0xbde4('0x1b')](0xcc)[_0xbde4('0x1c')]();});}};}function handleEntityNotFound(_0x1a18ae,_0x1ceead){return function(_0x272f20){if(!_0x272f20){_0x1a18ae[_0xbde4('0x1a')](0x194);}return _0x272f20;};}function handleError(_0x12d71f,_0x50de9c){_0x50de9c=_0x50de9c||0x1f4;return function(_0x488225){logger[_0xbde4('0x28')](_0x488225['stack']);if(_0x488225['name']){delete _0x488225[_0xbde4('0x29')];}_0x12d71f[_0xbde4('0x1b')](_0x50de9c)[_0xbde4('0x2a')](_0x488225);};}exports[_0xbde4('0x2b')]=function(_0x131a10,_0x5e241f){var _0x19aefb={},_0x241e97={},_0x55fcf4={'count':0x0,'rows':[]};var _0x417bb9=_['map'](db[_0xbde4('0x2c')][_0xbde4('0x2d')],function(_0x7e336d){return{'name':_0x7e336d[_0xbde4('0x2e')],'type':_0x7e336d[_0xbde4('0x2f')][_0xbde4('0x30')]};});_0x241e97[_0xbde4('0x31')]=_[_0xbde4('0x32')](_0x417bb9,_0xbde4('0x29'));_0x241e97[_0xbde4('0x33')]=_['keys'](_0x131a10[_0xbde4('0x33')]);_0x241e97['filters']=_['intersection'](_0x241e97[_0xbde4('0x31')],_0x241e97[_0xbde4('0x33')]);_0x19aefb[_0xbde4('0x34')]=_[_0xbde4('0x35')](_0x241e97[_0xbde4('0x31')],qs['fields'](_0x131a10[_0xbde4('0x33')][_0xbde4('0x36')]));_0x19aefb[_0xbde4('0x34')]=_0x19aefb[_0xbde4('0x34')]['length']?_0x19aefb['attributes']:_0x241e97[_0xbde4('0x31')];if(!_0x131a10[_0xbde4('0x33')][_0xbde4('0x37')]('nolimit')){_0x19aefb[_0xbde4('0x20')]=qs[_0xbde4('0x20')](_0x131a10['query']['limit']);_0x19aefb[_0xbde4('0x1e')]=qs[_0xbde4('0x1e')](_0x131a10[_0xbde4('0x33')][_0xbde4('0x1e')]);}_0x19aefb[_0xbde4('0x38')]=qs[_0xbde4('0x39')](_0x131a10[_0xbde4('0x33')][_0xbde4('0x39')]);_0x19aefb['where']=qs['filters'](_[_0xbde4('0x3a')](_0x131a10[_0xbde4('0x33')],_0x241e97[_0xbde4('0x3b')]),_0x417bb9);if(_0x131a10['query'][_0xbde4('0x3c')]){_0x19aefb['where']=_[_0xbde4('0x3d')](_0x19aefb[_0xbde4('0x3e')],{'$or':_[_0xbde4('0x32')](_0x417bb9,function(_0x2a0ea9){if(_0x2a0ea9[_0xbde4('0x2f')]!==_0xbde4('0x3f')){var _0x3fb84a={};_0x3fb84a[_0x2a0ea9['name']]={'$like':'%'+_0x131a10['query'][_0xbde4('0x3c')]+'%'};return _0x3fb84a;}})});}_0x19aefb=_[_0xbde4('0x3d')]({},_0x19aefb,_0x131a10['options']);var _0x1bdc95={'where':_0x19aefb['where']};return db[_0xbde4('0x2c')]['count'](_0x1bdc95)[_0xbde4('0x26')](function(_0x3a6c14){_0x55fcf4[_0xbde4('0x21')]=_0x3a6c14;if(_0x131a10[_0xbde4('0x33')][_0xbde4('0x40')]){_0x19aefb[_0xbde4('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xbde4('0x42')](_0x19aefb);})[_0xbde4('0x26')](function(_0x49ce6a){_0x55fcf4['rows']=_0x49ce6a;return _0x55fcf4;})[_0xbde4('0x26')](respondWithFilteredResult(_0x5e241f,_0x19aefb))[_0xbde4('0x43')](handleError(_0x5e241f,null));};exports['show']=function(_0x3d88a6,_0x584535){var _0x3b336b={'raw':!![],'where':{'id':_0x3d88a6[_0xbde4('0x44')]['id']}},_0x438cd9={};_0x438cd9[_0xbde4('0x31')]=_[_0xbde4('0x45')](db[_0xbde4('0x2c')][_0xbde4('0x2d')]);_0x438cd9[_0xbde4('0x33')]=_[_0xbde4('0x45')](_0x3d88a6[_0xbde4('0x33')]);_0x438cd9[_0xbde4('0x3b')]=_[_0xbde4('0x35')](_0x438cd9[_0xbde4('0x31')],_0x438cd9[_0xbde4('0x33')]);_0x3b336b['attributes']=_['intersection'](_0x438cd9[_0xbde4('0x31')],qs['fields'](_0x3d88a6[_0xbde4('0x33')]['fields']));_0x3b336b[_0xbde4('0x34')]=_0x3b336b['attributes'][_0xbde4('0x46')]?_0x3b336b[_0xbde4('0x34')]:_0x438cd9[_0xbde4('0x31')];if(_0x3d88a6[_0xbde4('0x33')][_0xbde4('0x40')]){_0x3b336b[_0xbde4('0x41')]=[{'all':!![]}];}_0x3b336b=_[_0xbde4('0x3d')]({},_0x3b336b,_0x3d88a6['options']);return db[_0xbde4('0x2c')]['find'](_0x3b336b)['then'](handleEntityNotFound(_0x584535,null))['then'](respondWithResult(_0x584535,null))[_0xbde4('0x43')](handleError(_0x584535,null));};exports[_0xbde4('0x47')]=function(_0x4bdf92,_0x41e076){return db['SmsTransferReport'][_0xbde4('0x47')](_0x4bdf92[_0xbde4('0x48')],{})[_0xbde4('0x26')](respondWithResult(_0x41e076,0xc9))[_0xbde4('0x43')](handleError(_0x41e076,null));};exports[_0xbde4('0x25')]=function(_0x30dcdb,_0x4be3d7){if(_0x30dcdb[_0xbde4('0x48')]['id']){delete _0x30dcdb[_0xbde4('0x48')]['id'];}return db['SmsTransferReport'][_0xbde4('0x49')]({'where':{'id':_0x30dcdb[_0xbde4('0x44')]['id']}})[_0xbde4('0x26')](handleEntityNotFound(_0x4be3d7,null))[_0xbde4('0x26')](saveUpdates(_0x30dcdb[_0xbde4('0x48')],null))[_0xbde4('0x26')](respondWithResult(_0x4be3d7,null))[_0xbde4('0x43')](handleError(_0x4be3d7,null));};exports[_0xbde4('0x27')]=function(_0xdce029,_0x34e814){return db['SmsTransferReport'][_0xbde4('0x49')]({'where':{'id':_0xdce029['params']['id']}})[_0xbde4('0x26')](handleEntityNotFound(_0x34e814,null))[_0xbde4('0x26')](removeEntity(_0x34e814,null))['catch'](handleError(_0x34e814,null));};exports[_0xbde4('0x4a')]=function(_0x40625b,_0x36420b){return db[_0xbde4('0x2c')][_0xbde4('0x4a')]()[_0xbde4('0x26')](respondWithResult(_0x36420b,null))['catch'](handleError(_0x36420b,null));}; \ No newline at end of file +var _0x8338=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','end','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','show','SmsTransferReport','include','options','find','create','body','catch','params','describe','eml-format'];(function(_0xf5b4c5,_0x232e03){var _0x176ed2=function(_0x34e15c){while(--_0x34e15c){_0xf5b4c5['push'](_0xf5b4c5['shift']());}};_0x176ed2(++_0x232e03);}(_0x8338,0xe6));var _0x8833=function(_0x5a3403,_0x205ac1){_0x5a3403=_0x5a3403-0x0;var _0x422016=_0x8338[_0x5a3403];return _0x422016;};'use strict';var emlformat=require(_0x8833('0x0'));var rimraf=require(_0x8833('0x1'));var zipdir=require(_0x8833('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8833('0x3'));var BPromise=require(_0x8833('0x4'));var Mustache=require(_0x8833('0x5'));var util=require(_0x8833('0x6'));var path=require(_0x8833('0x7'));var sox=require(_0x8833('0x8'));var csv=require(_0x8833('0x9'));var ejs=require(_0x8833('0xa'));var fs=require('fs');var fs_extra=require(_0x8833('0xb'));var _=require(_0x8833('0xc'));var squel=require(_0x8833('0xd'));var crypto=require(_0x8833('0xe'));var jsforce=require(_0x8833('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8833('0x9'));var querystring=require(_0x8833('0x10'));var Papa=require('papaparse');var Redis=require(_0x8833('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8833('0x12'));var as=require(_0x8833('0x13'));var hardwareService=require(_0x8833('0x14'));var logger=require(_0x8833('0x15'))(_0x8833('0x16'));var utils=require(_0x8833('0x17'));var config=require(_0x8833('0x18'));var licenseUtil=require(_0x8833('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24408d,_0x1fe630){_0x1fe630=_0x1fe630||0xcc;return function(_0x1b2b7e){if(_0x1b2b7e){return _0x24408d[_0x8833('0x1a')](_0x1fe630);}return _0x24408d['status'](_0x1fe630)['end']();};}function respondWithResult(_0x404ff2,_0xd6c0e2){_0xd6c0e2=_0xd6c0e2||0xc8;return function(_0x583567){if(_0x583567){return _0x404ff2['status'](_0xd6c0e2)[_0x8833('0x1b')](_0x583567);}};}function respondWithFilteredResult(_0x35775d,_0x58bebb){return function(_0xb1123a){if(_0xb1123a){var _0x2701c1=typeof _0x58bebb['offset']===_0x8833('0x1c')&&typeof _0x58bebb['limit']===_0x8833('0x1c');var _0x416e51=_0xb1123a[_0x8833('0x1d')];var _0x5a1776=_0x2701c1?0x0:_0x58bebb[_0x8833('0x1e')];var _0x3b9b06=_0x2701c1?_0xb1123a[_0x8833('0x1d')]:_0x58bebb[_0x8833('0x1e')]+_0x58bebb[_0x8833('0x1f')];var _0x81a8e;if(_0x3b9b06>=_0x416e51){_0x3b9b06=_0x416e51;_0x81a8e=0xc8;}else{_0x81a8e=0xce;}_0x35775d[_0x8833('0x20')](_0x81a8e);return _0x35775d[_0x8833('0x21')](_0x8833('0x22'),_0x5a1776+'-'+_0x3b9b06+'/'+_0x416e51)['json'](_0xb1123a);}return null;};}function patchUpdates(_0x423b4c){return function(_0x5efc64){try{jsonpatch['apply'](_0x5efc64,_0x423b4c,!![]);}catch(_0x5851b3){return BPromise[_0x8833('0x23')](_0x5851b3);}return _0x5efc64[_0x8833('0x24')]();};}function saveUpdates(_0x52cf11,_0x4db9cf){return function(_0xed4ab8){if(_0xed4ab8){return _0xed4ab8[_0x8833('0x25')](_0x52cf11)[_0x8833('0x26')](function(_0x5c6767){return _0x5c6767;});}return null;};}function removeEntity(_0xbb4964,_0x2b4351){return function(_0x594bb8){if(_0x594bb8){return _0x594bb8[_0x8833('0x27')]()[_0x8833('0x26')](function(){_0xbb4964[_0x8833('0x20')](0xcc)[_0x8833('0x28')]();});}};}function handleEntityNotFound(_0x11d4db,_0x3bc961){return function(_0x570cf1){if(!_0x570cf1){_0x11d4db['sendStatus'](0x194);}return _0x570cf1;};}function handleError(_0x2b38a3,_0x17a03e){_0x17a03e=_0x17a03e||0x1f4;return function(_0xce4a3a){logger['error'](_0xce4a3a[_0x8833('0x29')]);if(_0xce4a3a[_0x8833('0x2a')]){delete _0xce4a3a['name'];}_0x2b38a3[_0x8833('0x20')](_0x17a03e)['send'](_0xce4a3a);};}exports[_0x8833('0x2b')]=function(_0x2ca1dd,_0x3783e9){var _0x48a569={},_0x50d5e3={},_0x392503={'count':0x0,'rows':[]};var _0x13efcb=_['map'](db['SmsTransferReport'][_0x8833('0x2c')],function(_0x1898c9){return{'name':_0x1898c9[_0x8833('0x2d')],'type':_0x1898c9[_0x8833('0x2e')][_0x8833('0x2f')]};});_0x50d5e3[_0x8833('0x30')]=_[_0x8833('0x31')](_0x13efcb,_0x8833('0x2a'));_0x50d5e3[_0x8833('0x32')]=_[_0x8833('0x33')](_0x2ca1dd[_0x8833('0x32')]);_0x50d5e3[_0x8833('0x34')]=_[_0x8833('0x35')](_0x50d5e3['model'],_0x50d5e3[_0x8833('0x32')]);_0x48a569['attributes']=_[_0x8833('0x35')](_0x50d5e3[_0x8833('0x30')],qs[_0x8833('0x36')](_0x2ca1dd['query'][_0x8833('0x36')]));_0x48a569[_0x8833('0x37')]=_0x48a569[_0x8833('0x37')][_0x8833('0x38')]?_0x48a569[_0x8833('0x37')]:_0x50d5e3[_0x8833('0x30')];if(!_0x2ca1dd[_0x8833('0x32')][_0x8833('0x39')]('nolimit')){_0x48a569[_0x8833('0x1f')]=qs['limit'](_0x2ca1dd['query'][_0x8833('0x1f')]);_0x48a569['offset']=qs[_0x8833('0x1e')](_0x2ca1dd[_0x8833('0x32')][_0x8833('0x1e')]);}_0x48a569['order']=qs[_0x8833('0x3a')](_0x2ca1dd['query'][_0x8833('0x3a')]);_0x48a569['where']=qs[_0x8833('0x34')](_[_0x8833('0x3b')](_0x2ca1dd[_0x8833('0x32')],_0x50d5e3['filters']),_0x13efcb);if(_0x2ca1dd[_0x8833('0x32')]['filter']){_0x48a569[_0x8833('0x3c')]=_[_0x8833('0x3d')](_0x48a569['where'],{'$or':_['map'](_0x13efcb,function(_0x21a8a4){if(_0x21a8a4[_0x8833('0x2e')]!==_0x8833('0x3e')){var _0x566d85={};_0x566d85[_0x21a8a4[_0x8833('0x2a')]]={'$like':'%'+_0x2ca1dd[_0x8833('0x32')][_0x8833('0x3f')]+'%'};return _0x566d85;}})});}_0x48a569=_['merge']({},_0x48a569,_0x2ca1dd['options']);var _0x573269={'where':_0x48a569['where']};return db['SmsTransferReport'][_0x8833('0x1d')](_0x573269)[_0x8833('0x26')](function(_0x21e29f){_0x392503[_0x8833('0x1d')]=_0x21e29f;if(_0x2ca1dd[_0x8833('0x32')][_0x8833('0x40')]){_0x48a569['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x8833('0x41')](_0x48a569);})[_0x8833('0x26')](function(_0x539222){_0x392503[_0x8833('0x42')]=_0x539222;return _0x392503;})[_0x8833('0x26')](respondWithFilteredResult(_0x3783e9,_0x48a569))['catch'](handleError(_0x3783e9,null));};exports[_0x8833('0x43')]=function(_0x38aca6,_0x4094f1){var _0x5d3ee0={'raw':!![],'where':{'id':_0x38aca6['params']['id']}},_0x1984be={};_0x1984be[_0x8833('0x30')]=_['keys'](db[_0x8833('0x44')][_0x8833('0x2c')]);_0x1984be[_0x8833('0x32')]=_[_0x8833('0x33')](_0x38aca6['query']);_0x1984be[_0x8833('0x34')]=_[_0x8833('0x35')](_0x1984be[_0x8833('0x30')],_0x1984be[_0x8833('0x32')]);_0x5d3ee0['attributes']=_[_0x8833('0x35')](_0x1984be[_0x8833('0x30')],qs[_0x8833('0x36')](_0x38aca6[_0x8833('0x32')][_0x8833('0x36')]));_0x5d3ee0[_0x8833('0x37')]=_0x5d3ee0[_0x8833('0x37')][_0x8833('0x38')]?_0x5d3ee0['attributes']:_0x1984be[_0x8833('0x30')];if(_0x38aca6[_0x8833('0x32')][_0x8833('0x40')]){_0x5d3ee0[_0x8833('0x45')]=[{'all':!![]}];}_0x5d3ee0=_[_0x8833('0x3d')]({},_0x5d3ee0,_0x38aca6[_0x8833('0x46')]);return db[_0x8833('0x44')][_0x8833('0x47')](_0x5d3ee0)[_0x8833('0x26')](handleEntityNotFound(_0x4094f1,null))['then'](respondWithResult(_0x4094f1,null))['catch'](handleError(_0x4094f1,null));};exports[_0x8833('0x48')]=function(_0x44a460,_0x3e5737){return db[_0x8833('0x44')]['create'](_0x44a460[_0x8833('0x49')],{})[_0x8833('0x26')](respondWithResult(_0x3e5737,0xc9))[_0x8833('0x4a')](handleError(_0x3e5737,null));};exports['update']=function(_0x438c18,_0x3cae5d){if(_0x438c18['body']['id']){delete _0x438c18[_0x8833('0x49')]['id'];}return db[_0x8833('0x44')][_0x8833('0x47')]({'where':{'id':_0x438c18[_0x8833('0x4b')]['id']}})[_0x8833('0x26')](handleEntityNotFound(_0x3cae5d,null))[_0x8833('0x26')](saveUpdates(_0x438c18[_0x8833('0x49')],null))[_0x8833('0x26')](respondWithResult(_0x3cae5d,null))[_0x8833('0x4a')](handleError(_0x3cae5d,null));};exports['destroy']=function(_0x501891,_0x15fe3f){return db[_0x8833('0x44')]['find']({'where':{'id':_0x501891[_0x8833('0x4b')]['id']}})['then'](handleEntityNotFound(_0x15fe3f,null))[_0x8833('0x26')](removeEntity(_0x15fe3f,null))[_0x8833('0x4a')](handleError(_0x15fe3f,null));};exports[_0x8833('0x4c')]=function(_0x585774,_0x2c31ba){return db[_0x8833('0x44')][_0x8833('0x4c')]()[_0x8833('0x26')](respondWithResult(_0x2c31ba,null))['catch'](handleError(_0x2c31ba,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e5fd20a..45da266 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 _0xc978=['bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3bdce0,_0x50c57e){var _0x446d49=function(_0x2cd07b){while(--_0x2cd07b){_0x3bdce0['push'](_0x3bdce0['shift']());}};_0x446d49(++_0x50c57e);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var logger=require(_0x8c97('0x2'))(_0x8c97('0x3'));var moment=require(_0x8c97('0x4'));var BPromise=require(_0x8c97('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c97('0x6'));var rimraf=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var attributes=require(_0x8c97('0x9'));module[_0x8c97('0xa')]=function(_0x2a9434,_0xabd146){return _0x2a9434['define'](_0x8c97('0xb'),attributes,{'tableName':_0x8c97('0xc'),'paranoid':![],'indexes':[{'name':_0x8c97('0xd'),'fields':[_0x8c97('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef72=['../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','request-promise','rimraf'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xef72,0xf8));var _0x2ef7=function(_0x26c7c9,_0x7b7d35){_0x26c7c9=_0x26c7c9-0x0;var _0x4fd423=_0xef72[_0x26c7c9];return _0x4fd423;};'use strict';var _=require(_0x2ef7('0x0'));var util=require(_0x2ef7('0x1'));var logger=require(_0x2ef7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ef7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ef7('0x4'));var config=require(_0x2ef7('0x5'));var attributes=require(_0x2ef7('0x6'));module['exports']=function(_0x12ce1b,_0x4ff788){return _0x12ce1b[_0x2ef7('0x7')](_0x2ef7('0x8'),attributes,{'tableName':_0x2ef7('0x9'),'paranoid':![],'indexes':[{'name':_0x2ef7('0xa'),'fields':[_0x2ef7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index af2af93..58a15c4 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 _0xe4d9=['request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0xe4d9,0x141));var _0x9e4d=function(_0x445133,_0x97fae1){_0x445133=_0x445133-0x0;var _0x124607=_0xe4d9[_0x445133];return _0x124607;};'use strict';var _=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var moment=require(_0x9e4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9e4d('0x4'));var logger=require(_0x9e4d('0x5'))('rpc');var config=require(_0x9e4d('0x6'));var jayson=require(_0x9e4d('0x7'));var client=jayson['client'][_0x9e4d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x74b14,_0x5bfad3,_0x5af2a0){return new BPromise(function(_0x36ec30,_0x48d257){return client[_0x9e4d('0x9')](_0x74b14,_0x5af2a0)[_0x9e4d('0xa')](function(_0x4ea141){logger[_0x9e4d('0xb')](_0x9e4d('0xc'),_0x5bfad3,_0x9e4d('0xd'));logger[_0x9e4d('0xe')](_0x9e4d('0xf'),_0x5bfad3,_0x9e4d('0xd'),JSON[_0x9e4d('0x10')](_0x4ea141));if(_0x4ea141[_0x9e4d('0x11')]){if(_0x4ea141[_0x9e4d('0x11')][_0x9e4d('0x12')]===0x1f4){logger[_0x9e4d('0x11')](_0x9e4d('0xc'),_0x5bfad3,_0x4ea141[_0x9e4d('0x11')][_0x9e4d('0x13')]);return _0x48d257(_0x4ea141[_0x9e4d('0x11')]['message']);}logger[_0x9e4d('0x11')](_0x9e4d('0xc'),_0x5bfad3,_0x4ea141[_0x9e4d('0x11')][_0x9e4d('0x13')]);return _0x36ec30(_0x4ea141[_0x9e4d('0x11')][_0x9e4d('0x13')]);}else{logger['info'](_0x9e4d('0xc'),_0x5bfad3,_0x9e4d('0xd'));_0x36ec30(_0x4ea141[_0x9e4d('0x14')][_0x9e4d('0x13')]);}})[_0x9e4d('0x15')](function(_0x42674a){logger['error'](_0x9e4d('0xc'),_0x5bfad3,_0x42674a);_0x48d257(_0x42674a);});});} \ No newline at end of file +var _0x4aa3=['jayson/promise','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4aa3,0x174));var _0x34aa=function(_0x361c2a,_0x28e9c0){_0x361c2a=_0x361c2a-0x0;var _0x509f65=_0x4aa3[_0x361c2a];return _0x509f65;};'use strict';var _=require(_0x34aa('0x0'));var util=require(_0x34aa('0x1'));var moment=require('moment');var BPromise=require(_0x34aa('0x2'));var rs=require(_0x34aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34aa('0x4'))['db'];var utils=require(_0x34aa('0x5'));var logger=require('../../config/logger')(_0x34aa('0x6'));var config=require(_0x34aa('0x7'));var jayson=require(_0x34aa('0x8'));var client=jayson['client'][_0x34aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdcaa74,_0x55c471,_0x333bbe){return new BPromise(function(_0x420d9e,_0x4e7785){return client[_0x34aa('0xa')](_0xdcaa74,_0x333bbe)['then'](function(_0x4a332b){logger[_0x34aa('0xb')](_0x34aa('0xc'),_0x55c471,_0x34aa('0xd'));logger[_0x34aa('0xe')](_0x34aa('0xf'),_0x55c471,_0x34aa('0xd'),JSON['stringify'](_0x4a332b));if(_0x4a332b[_0x34aa('0x10')]){if(_0x4a332b['error']['code']===0x1f4){logger[_0x34aa('0x10')](_0x34aa('0xc'),_0x55c471,_0x4a332b[_0x34aa('0x10')]['message']);return _0x4e7785(_0x4a332b[_0x34aa('0x10')]['message']);}logger[_0x34aa('0x10')](_0x34aa('0xc'),_0x55c471,_0x4a332b[_0x34aa('0x10')][_0x34aa('0x11')]);return _0x420d9e(_0x4a332b[_0x34aa('0x10')]['message']);}else{logger[_0x34aa('0xb')](_0x34aa('0xc'),_0x55c471,_0x34aa('0xd'));_0x420d9e(_0x4a332b[_0x34aa('0x12')][_0x34aa('0x11')]);}})[_0x34aa('0x13')](function(_0x33cd7e){logger[_0x34aa('0x10')](_0x34aa('0xc'),_0x55c471,_0x33cd7e);_0x4e7785(_0x33cd7e);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9e3c816..07c0c45 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 _0x76cb=['isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','create','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x76cb,0x16f));var _0xb76c=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x76cb[_0x9b5bb2];return _0x2e1e92;};'use strict';var multer=require(_0xb76c('0x0'));var util=require(_0xb76c('0x1'));var path=require(_0xb76c('0x2'));var timeout=require(_0xb76c('0x3'));var express=require(_0xb76c('0x4'));var router=express['Router']();var fs_extra=require(_0xb76c('0x5'));var auth=require(_0xb76c('0x6'));var interaction=require(_0xb76c('0x7'));var config=require(_0xb76c('0x8'));var controller=require('./sound.controller');router[_0xb76c('0x9')]('/',auth[_0xb76c('0xa')](),controller[_0xb76c('0xb')]);router[_0xb76c('0x9')](_0xb76c('0xc'),auth[_0xb76c('0xa')](),controller[_0xb76c('0xd')]);router[_0xb76c('0x9')]('/:id/download',auth[_0xb76c('0xa')](),controller[_0xb76c('0xe')]);var upload=multer({'storage':multer[_0xb76c('0xf')]({'destination':function(_0x23470b,_0x29de4c,_0x294298){_0x294298(null,path[_0xb76c('0x10')](config[_0xb76c('0x11')],_0xb76c('0x12')));},'filename':function(_0x5b43e0,_0x1c88d6,_0x5e5704){_0x1c88d6[_0xb76c('0x13')]=_0x1c88d6['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e5704(null,util[_0xb76c('0x14')](_0xb76c('0x15'),path[_0xb76c('0x16')](_0x1c88d6['originalname'],path[_0xb76c('0x17')](_0x1c88d6[_0xb76c('0x13')])),Date[_0xb76c('0x18')](),path['extname'](_0x1c88d6['originalname'])));}})});router[_0xb76c('0x19')]('/',upload['single']('file'),controller[_0xb76c('0x1a')]);router['put'](_0xb76c('0xc'),auth[_0xb76c('0xa')](),controller['update']);router[_0xb76c('0x1b')](_0xb76c('0xc'),auth[_0xb76c('0xa')](),controller[_0xb76c('0x1b')]);module[_0xb76c('0x1c')]=router; \ No newline at end of file +var _0x02f4=['../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','post','file','put','update','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service'];(function(_0x133cac,_0xc8f87b){var _0x1e95fd=function(_0xb7d0fa){while(--_0xb7d0fa){_0x133cac['push'](_0x133cac['shift']());}};_0x1e95fd(++_0xc8f87b);}(_0x02f4,0xc6));var _0x402f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x02f4[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x402f('0x0'));var util=require(_0x402f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x402f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x402f('0x3'));var interaction=require(_0x402f('0x4'));var config=require(_0x402f('0x5'));var controller=require(_0x402f('0x6'));router[_0x402f('0x7')]('/',auth[_0x402f('0x8')](),controller[_0x402f('0x9')]);router[_0x402f('0x7')](_0x402f('0xa'),auth[_0x402f('0x8')](),controller[_0x402f('0xb')]);router[_0x402f('0x7')](_0x402f('0xc'),auth[_0x402f('0x8')](),controller[_0x402f('0xd')]);var upload=multer({'storage':multer[_0x402f('0xe')]({'destination':function(_0x75a451,_0x3a81f6,_0x24e343){_0x24e343(null,path[_0x402f('0xf')](config[_0x402f('0x10')],_0x402f('0x11')));},'filename':function(_0x156f7e,_0x33adb3,_0x23b715){_0x33adb3[_0x402f('0x12')]=_0x33adb3[_0x402f('0x12')][_0x402f('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23b715(null,util[_0x402f('0x14')](_0x402f('0x15'),path['basename'](_0x33adb3[_0x402f('0x12')],path['extname'](_0x33adb3['originalname'])),Date['now'](),path[_0x402f('0x16')](_0x33adb3[_0x402f('0x12')])));}})});router[_0x402f('0x17')]('/',upload['single'](_0x402f('0x18')),controller['create']);router[_0x402f('0x19')]('/:id',auth[_0x402f('0x8')](),controller[_0x402f('0x1a')]);router[_0x402f('0x1b')](_0x402f('0xa'),auth[_0x402f('0x8')](),controller['delete']);module[_0x402f('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 37faa40..2835a17 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 _0x7cb1=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cb1,0x96));var _0x17cb=function(_0x5ca8f4,_0x32df18){_0x5ca8f4=_0x5ca8f4-0x0;var _0x31ebc8=_0x7cb1[_0x5ca8f4];return _0x31ebc8;};'use strict';var Sequelize=require(_0x17cb('0x0'));module[_0x17cb('0x1')]={'name':{'type':Sequelize[_0x17cb('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x17cb('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x17cb('0x2')]},'original_duration':{'type':Sequelize[_0x17cb('0x3')]},'original_sampleCount':{'type':Sequelize[_0x17cb('0x4')]},'original_channelCount':{'type':Sequelize[_0x17cb('0x5')]},'original_bitRate':{'type':Sequelize[_0x17cb('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x17cb('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x17cb('0x4')]},'converted_channelCount':{'type':Sequelize[_0x17cb('0x5')]},'converted_bitRate':{'type':Sequelize[_0x17cb('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x17cb('0x5')]}}; \ No newline at end of file +var _0x44ff=['INTEGER','sequelize','STRING','name','FLOAT','BIGINT'];(function(_0x16d578,_0x3cbca3){var _0x3c0177=function(_0x57032a){while(--_0x57032a){_0x16d578['push'](_0x16d578['shift']());}};_0x3c0177(++_0x3cbca3);}(_0x44ff,0x14b));var _0xf44f=function(_0x3e429d,_0x125d0d){_0x3e429d=_0x3e429d-0x0;var _0x167cf1=_0x44ff[_0x3e429d];return _0x167cf1;};'use strict';var Sequelize=require(_0xf44f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf44f('0x1')],'unique':_0xf44f('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf44f('0x1')]},'display_name':{'type':Sequelize[_0xf44f('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xf44f('0x1')]},'original_duration':{'type':Sequelize[_0xf44f('0x3')]},'original_sampleCount':{'type':Sequelize[_0xf44f('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xf44f('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xf44f('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xf44f('0x4')]},'converted_channelCount':{'type':Sequelize[_0xf44f('0x5')]},'converted_bitRate':{'type':Sequelize[_0xf44f('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 6064431..c0e7aaa 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 _0x0953=['Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','extname','file','originalname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','converted_sampleRate','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','body','description','delete','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','destroy','get','Sounds','UserProfileResource','then','sendStatus','error','stack','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','Sound','includeAll','include','rows','catch','show','fields','download','find','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted'];(function(_0x5377a8,_0x3a622e){var _0x1cfc82=function(_0x163106){while(--_0x163106){_0x5377a8['push'](_0x5377a8['shift']());}};_0x1cfc82(++_0x3a622e);}(_0x0953,0x1ab));var _0x3095=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x0953[_0x4d1ee9];return _0x9a5456;};'use strict';var emlformat=require(_0x3095('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3095('0x1'));var jsonpatch=require(_0x3095('0x2'));var rp=require('request-promise');var moment=require(_0x3095('0x3'));var BPromise=require(_0x3095('0x4'));var Mustache=require(_0x3095('0x5'));var util=require('util');var path=require(_0x3095('0x6'));var sox=require(_0x3095('0x7'));var csv=require('to-csv');var ejs=require(_0x3095('0x8'));var fs=require('fs');var fs_extra=require(_0x3095('0x9'));var _=require(_0x3095('0xa'));var squel=require('squel');var crypto=require(_0x3095('0xb'));var jsforce=require(_0x3095('0xc'));var deskjs=require(_0x3095('0xd'));var toCsv=require(_0x3095('0xe'));var querystring=require('querystring');var Papa=require(_0x3095('0xf'));var Redis=require('ioredis');var authService=require(_0x3095('0x10'));var qs=require(_0x3095('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3095('0x12'));var logger=require('../../config/logger')(_0x3095('0x13'));var utils=require('../../config/utils');var config=require(_0x3095('0x14'));var licenseUtil=require(_0x3095('0x15'));var db=require(_0x3095('0x16'))['db'];function respondWithStatusCode(_0x16f410,_0x568c9f){_0x568c9f=_0x568c9f||0xcc;return function(_0x3cc385){if(_0x3cc385){return _0x16f410['sendStatus'](_0x568c9f);}return _0x16f410[_0x3095('0x17')](_0x568c9f)[_0x3095('0x18')]();};}function respondWithResult(_0x2bbf3b,_0x58b021){_0x58b021=_0x58b021||0xc8;return function(_0x333d92){if(_0x333d92){return _0x2bbf3b[_0x3095('0x17')](_0x58b021)['json'](_0x333d92);}};}function respondWithFilteredResult(_0x33b9a5,_0x4d0033){return function(_0x39f765){if(_0x39f765){var _0xd90764=typeof _0x4d0033[_0x3095('0x19')]==='undefined'&&typeof _0x4d0033[_0x3095('0x1a')]===_0x3095('0x1b');var _0x181b22=_0x39f765['count'];var _0x1eb8a0=_0xd90764?0x0:_0x4d0033[_0x3095('0x19')];var _0x59075e=_0xd90764?_0x39f765[_0x3095('0x1c')]:_0x4d0033[_0x3095('0x19')]+_0x4d0033[_0x3095('0x1a')];var _0xd7c9cf;if(_0x59075e>=_0x181b22){_0x59075e=_0x181b22;_0xd7c9cf=0xc8;}else{_0xd7c9cf=0xce;}_0x33b9a5[_0x3095('0x17')](_0xd7c9cf);return _0x33b9a5[_0x3095('0x1d')](_0x3095('0x1e'),_0x1eb8a0+'-'+_0x59075e+'/'+_0x181b22)[_0x3095('0x1f')](_0x39f765);}return null;};}function patchUpdates(_0x49bfa5){return function(_0x3bed92){try{jsonpatch[_0x3095('0x20')](_0x3bed92,_0x49bfa5,!![]);}catch(_0x59c930){return BPromise['reject'](_0x59c930);}return _0x3bed92['save']();};}function saveUpdates(_0x5110a3,_0x9decb3){return function(_0x2f1e37){if(_0x2f1e37){return _0x2f1e37[_0x3095('0x21')](_0x5110a3)['then'](function(_0x16f3c8){return _0x16f3c8;});}return null;};}function removeEntity(_0x19cffc,_0x3726cf){return function(_0x4819f6){if(_0x4819f6){return _0x4819f6[_0x3095('0x22')]()['then'](function(){var _0x36c232=_0x4819f6[_0x3095('0x23')]({'plain':!![]});var _0x10032a=_0x3095('0x24');return db[_0x3095('0x25')][_0x3095('0x22')]({'where':{'type':_0x10032a,'resourceId':_0x36c232['id']}})[_0x3095('0x26')](function(){return _0x4819f6;});})[_0x3095('0x26')](function(){_0x19cffc[_0x3095('0x17')](0xcc)[_0x3095('0x18')]();});}};}function handleEntityNotFound(_0x3acb7b,_0x546f8d){return function(_0x574b03){if(!_0x574b03){_0x3acb7b[_0x3095('0x27')](0x194);}return _0x574b03;};}function handleError(_0x317f07,_0x2614fe){_0x2614fe=_0x2614fe||0x1f4;return function(_0x6af7b8){logger[_0x3095('0x28')](_0x6af7b8[_0x3095('0x29')]);if(_0x6af7b8['name']){delete _0x6af7b8['name'];}_0x317f07['status'](_0x2614fe)['send'](_0x6af7b8);};}exports[_0x3095('0x2a')]=function(_0x1e26ed,_0x4bef63){var _0x1481f4={},_0x165dfb={},_0x455931={'count':0x0,'rows':[]};var _0x3b4e4e=_[_0x3095('0x2b')](db['Sound'][_0x3095('0x2c')],function(_0x24e690){return{'name':_0x24e690['fieldName'],'type':_0x24e690[_0x3095('0x2d')][_0x3095('0x2e')]};});_0x165dfb[_0x3095('0x2f')]=_[_0x3095('0x2b')](_0x3b4e4e,'name');_0x165dfb['query']=_[_0x3095('0x30')](_0x1e26ed['query']);_0x165dfb[_0x3095('0x31')]=_[_0x3095('0x32')](_0x165dfb['model'],_0x165dfb[_0x3095('0x33')]);_0x1481f4[_0x3095('0x34')]=_[_0x3095('0x32')](_0x165dfb[_0x3095('0x2f')],qs['fields'](_0x1e26ed['query']['fields']));_0x1481f4[_0x3095('0x34')]=_0x1481f4['attributes'][_0x3095('0x35')]?_0x1481f4[_0x3095('0x34')]:_0x165dfb['model'];if(!_0x1e26ed[_0x3095('0x33')][_0x3095('0x36')](_0x3095('0x37'))){_0x1481f4[_0x3095('0x1a')]=qs[_0x3095('0x1a')](_0x1e26ed['query'][_0x3095('0x1a')]);_0x1481f4[_0x3095('0x19')]=qs[_0x3095('0x19')](_0x1e26ed['query'][_0x3095('0x19')]);}_0x1481f4[_0x3095('0x38')]=qs[_0x3095('0x39')](_0x1e26ed[_0x3095('0x33')]['sort']);_0x1481f4[_0x3095('0x3a')]=qs['filters'](_[_0x3095('0x3b')](_0x1e26ed[_0x3095('0x33')],_0x165dfb['filters']),_0x3b4e4e);if(_0x1e26ed[_0x3095('0x33')][_0x3095('0x3c')]){_0x1481f4[_0x3095('0x3a')]=_[_0x3095('0x3d')](_0x1481f4[_0x3095('0x3a')],{'$or':_[_0x3095('0x2b')](_0x3b4e4e,function(_0x3e3b9a){if(_0x3e3b9a[_0x3095('0x2d')]!==_0x3095('0x3e')){var _0x58a94a={};_0x58a94a[_0x3e3b9a[_0x3095('0x3f')]]={'$like':'%'+_0x1e26ed[_0x3095('0x33')]['filter']+'%'};return _0x58a94a;}})});}_0x1481f4=_[_0x3095('0x3d')]({},_0x1481f4,_0x1e26ed[_0x3095('0x40')]);var _0xc71b2c={'where':_0x1481f4[_0x3095('0x3a')]};return db[_0x3095('0x41')][_0x3095('0x1c')](_0xc71b2c)[_0x3095('0x26')](function(_0x2bb20d){_0x455931[_0x3095('0x1c')]=_0x2bb20d;if(_0x1e26ed[_0x3095('0x33')][_0x3095('0x42')]){_0x1481f4[_0x3095('0x43')]=[{'all':!![]}];}return db[_0x3095('0x41')]['findAll'](_0x1481f4);})[_0x3095('0x26')](function(_0xe48c40){_0x455931[_0x3095('0x44')]=_0xe48c40;return _0x455931;})['then'](respondWithFilteredResult(_0x4bef63,_0x1481f4))[_0x3095('0x45')](handleError(_0x4bef63,null));};exports[_0x3095('0x46')]=function(_0x1cb8d6,_0x22bdeb){var _0x2a0139={'raw':!![],'where':{'id':_0x1cb8d6['params']['id']}},_0x16eead={};_0x16eead[_0x3095('0x2f')]=_['keys'](db[_0x3095('0x41')][_0x3095('0x2c')]);_0x16eead['query']=_[_0x3095('0x30')](_0x1cb8d6[_0x3095('0x33')]);_0x16eead['filters']=_[_0x3095('0x32')](_0x16eead[_0x3095('0x2f')],_0x16eead[_0x3095('0x33')]);_0x2a0139['attributes']=_['intersection'](_0x16eead[_0x3095('0x2f')],qs['fields'](_0x1cb8d6[_0x3095('0x33')][_0x3095('0x47')]));_0x2a0139[_0x3095('0x34')]=_0x2a0139['attributes']['length']?_0x2a0139[_0x3095('0x34')]:_0x16eead[_0x3095('0x2f')];if(_0x1cb8d6[_0x3095('0x33')][_0x3095('0x42')]){_0x2a0139[_0x3095('0x43')]=[{'all':!![]}];}_0x2a0139=_[_0x3095('0x3d')]({},_0x2a0139,_0x1cb8d6[_0x3095('0x40')]);return db[_0x3095('0x41')]['find'](_0x2a0139)[_0x3095('0x26')](handleEntityNotFound(_0x22bdeb,null))['then'](respondWithResult(_0x22bdeb,null))[_0x3095('0x45')](handleError(_0x22bdeb,null));};exports[_0x3095('0x48')]=function(_0x3384e6,_0x115898,_0x2c7a61){return db[_0x3095('0x41')][_0x3095('0x49')]({'where':{'id':_0x3384e6[_0x3095('0x4a')]['id']},'attributes':[_0x3095('0x3f'),_0x3095('0x4b'),_0x3095('0x4c')],'raw':!![]})[_0x3095('0x26')](handleEntityNotFound(_0x115898,null))[_0x3095('0x26')](function(_0x11775a){if(_0x11775a){if(!fs[_0x3095('0x4d')](path[_0x3095('0x4e')](config[_0x3095('0x4f')],_0x3095('0x50'),_0x11775a[_0x3095('0x4b')]+'.'+_0x11775a[_0x3095('0x4c')]))){throw new db[(_0x3095('0x51'))][(_0x3095('0x52'))](_0x3095('0x53'));}return _0x115898[_0x3095('0x48')](path[_0x3095('0x4e')](config['root'],_0x3095('0x50'),util['format']('%s.%s',_0x11775a[_0x3095('0x4b')],_0x11775a[_0x3095('0x4c')])),util[_0x3095('0x54')](_0x3095('0x55'),_0x11775a[_0x3095('0x3f')],_0x11775a[_0x3095('0x4c')]));}return null;})[_0x3095('0x45')](handleError(_0x115898,null));};exports[_0x3095('0x56')]=function(_0x4d3d96,_0x228e9a,_0x5f418a){var _0x5860aa={'name':path[_0x3095('0x57')](_0x4d3d96['file']['originalname'],path[_0x3095('0x58')](_0x4d3d96[_0x3095('0x59')][_0x3095('0x5a')])),'save_name':path[_0x3095('0x57')](_0x4d3d96[_0x3095('0x59')]['filename'],path[_0x3095('0x58')](_0x4d3d96[_0x3095('0x59')]['filename'])),'original_format':path[_0x3095('0x58')](_0x4d3d96[_0x3095('0x59')][_0x3095('0x5a')])[_0x3095('0x5b')](0x1),'converted_format':_0x3095('0x5c')};var _0x471e2c=path[_0x3095('0x4e')](config['root'],_0x3095('0x5d'),_0x4d3d96[_0x3095('0x59')]['filename']);var _0x332ff9=path[_0x3095('0x4e')](config[_0x3095('0x4f')],'server/files/sounds/converted',util['format']('%s.%s',path[_0x3095('0x57')](_0x4d3d96[_0x3095('0x59')]['filename'],path[_0x3095('0x58')](_0x4d3d96[_0x3095('0x59')]['filename'])),_0x5860aa[_0x3095('0x4c')]));logger[_0x3095('0x5e')](_0x3095('0x5f'),_0x471e2c);logger['info'](_0x3095('0x60'),_0x332ff9);try{fs[_0x3095('0x61')](_0x471e2c,parseInt(_0x3095('0x62'),0x8));var _0x4bc3a1=sox[_0x3095('0x63')](_0x471e2c,_0x332ff9,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4bc3a1['on'](_0x3095('0x28'),function(_0x983c9e){fs['unlinkSync'](_0x471e2c);_0x228e9a[_0x3095('0x17')](0x1f4)[_0x3095('0x64')](_0x983c9e);});_0x4bc3a1['on'](_0x3095('0x65'),function(_0x55a689){_0x5860aa[_0x3095('0x66')]=isNaN(_0x55a689[_0x3095('0x67')])?null:_0x55a689[_0x3095('0x67')]*0x3e8;_0x5860aa[_0x3095('0x68')]=isNaN(_0x55a689[_0x3095('0x69')])?null:_0x55a689[_0x3095('0x69')];_0x5860aa[_0x3095('0x6a')]=isNaN(_0x55a689['channelCount'])?null:_0x55a689['channelCount'];_0x5860aa[_0x3095('0x6b')]=isNaN(_0x55a689[_0x3095('0x6c')])?null:_0x55a689[_0x3095('0x6c')];_0x5860aa[_0x3095('0x6d')]=isNaN(_0x55a689[_0x3095('0x6e')])?null:_0x55a689[_0x3095('0x6e')];});_0x4bc3a1['on'](_0x3095('0x6f'),function(_0x5726b1){_0x5860aa['converted_duration']=isNaN(_0x5726b1[_0x3095('0x67')])?null:_0x5726b1[_0x3095('0x67')]*0x3e8;_0x5860aa[_0x3095('0x70')]=isNaN(_0x5726b1['sampleCount'])?null:_0x5726b1[_0x3095('0x69')];_0x5860aa[_0x3095('0x71')]=isNaN(_0x5726b1[_0x3095('0x72')])?null:_0x5726b1['channelCount'];_0x5860aa[_0x3095('0x73')]=isNaN(_0x5726b1['bitRate'])?null:_0x5726b1[_0x3095('0x6c')];_0x5860aa[_0x3095('0x74')]=isNaN(_0x5726b1[_0x3095('0x6e')])?null:_0x5726b1[_0x3095('0x6e')];});_0x4bc3a1['on'](_0x3095('0x18'),function(){fs[_0x3095('0x61')](_0x332ff9,parseInt(_0x3095('0x62'),0x8));return db[_0x3095('0x41')][_0x3095('0x56')](_0x5860aa)[_0x3095('0x26')](function(_0x27d70c){var _0x46836d={'role':_0x4d3d96['body']['role'],'userProfileId':_0x4d3d96['body'][_0x3095('0x75')]};if(!_0x46836d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46836d['role']===_0x3095('0x76')){var _0xc8b5eb=_0x27d70c[_0x3095('0x23')]({'plain':!![]});return db[_0x3095('0x77')][_0x3095('0x49')]({'where':{'name':'Sounds','userProfileId':_0x46836d[_0x3095('0x75')]},'raw':!![]})[_0x3095('0x26')](function(_0xe44720){if(_0xe44720&&_0xe44720[_0x3095('0x78')]===0x0){return db['UserProfileResource'][_0x3095('0x56')]({'name':_0xc8b5eb['name'],'resourceId':_0xc8b5eb['id'],'type':_0xe44720[_0x3095('0x3f')],'sectionId':_0xe44720['id']},{})[_0x3095('0x26')](function(){return _0x27d70c;});}else{return _0x27d70c;}})[_0x3095('0x45')](function(_0x2828d5){logger[_0x3095('0x28')](_0x3095('0x79'),_0x2828d5);throw _0x2828d5;});}return _0x27d70c;})[_0x3095('0x26')](respondWithResult(_0x228e9a,null))[_0x3095('0x45')](handleError(_0x228e9a,null));});_0x4bc3a1[_0x3095('0x7a')]();}catch(_0x3238e7){_0x228e9a[_0x3095('0x17')](0x1f4)['send'](_0x3238e7);}};exports[_0x3095('0x21')]=function(_0x26a9f2,_0x5bc1eb,_0x5b6522){return db[_0x3095('0x41')][_0x3095('0x49')]({'where':{'id':_0x26a9f2[_0x3095('0x4a')]['id']}})[_0x3095('0x26')](handleEntityNotFound(_0x5bc1eb,null))[_0x3095('0x26')](saveUpdates(_['pick'](_0x26a9f2[_0x3095('0x7b')],[_0x3095('0x3f'),_0x3095('0x7c')]),null))['then'](respondWithResult(_0x5bc1eb,null))[_0x3095('0x45')](handleError(_0x5bc1eb,null));};exports[_0x3095('0x7d')]=function(_0x223d27,_0x49fee6,_0x5bc1d9){return db[_0x3095('0x41')][_0x3095('0x49')]({'where':{'id':_0x223d27['params']['id']}})[_0x3095('0x26')](function(_0x4869cc){if(_0x4869cc){return _0x4869cc['destroy']();}})[_0x3095('0x26')](function(_0x505ca8){var _0x201ec2=path[_0x3095('0x4e')](config[_0x3095('0x4f')],_0x3095('0x5d'),util[_0x3095('0x54')](_0x3095('0x55'),_0x505ca8[_0x3095('0x4b')],_0x505ca8['original_format']));var _0x4869ab=path[_0x3095('0x4e')](config[_0x3095('0x4f')],_0x3095('0x50'),util[_0x3095('0x54')](_0x3095('0x55'),_0x505ca8[_0x3095('0x4b')],_0x505ca8[_0x3095('0x4c')]));fs[_0x3095('0x7e')](_0x201ec2);fs['unlinkSync'](_0x4869ab);return _0x505ca8;})['then'](function(_0x5dd4af){if(_0x5dd4af){return _0x49fee6[_0x3095('0x17')](0xcc)[_0x3095('0x18')]();}})['then'](handleEntityNotFound(_0x49fee6,null))[_0x3095('0x45')](handleError(_0x49fee6,null));}; \ No newline at end of file +var _0x60a8=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','stack','name','send','index','Sound','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','rawAttributes','include','download','params','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','extname','originalname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','channelCount','converted_sampleRate','end','role','body','user','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x1945a5,_0x50de54){var _0x5817a5=function(_0x2a5a93){while(--_0x2a5a93){_0x1945a5['push'](_0x1945a5['shift']());}};_0x5817a5(++_0x50de54);}(_0x60a8,0x6b));var _0x860a=function(_0x4ed377,_0x18ba8e){_0x4ed377=_0x4ed377-0x0;var _0x21b8bd=_0x60a8[_0x4ed377];return _0x21b8bd;};'use strict';var emlformat=require(_0x860a('0x0'));var rimraf=require(_0x860a('0x1'));var zipdir=require(_0x860a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x860a('0x3'));var moment=require(_0x860a('0x4'));var BPromise=require(_0x860a('0x5'));var Mustache=require('mustache');var util=require(_0x860a('0x6'));var path=require(_0x860a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x860a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x860a('0x9'));var squel=require(_0x860a('0xa'));var crypto=require(_0x860a('0xb'));var jsforce=require(_0x860a('0xc'));var deskjs=require(_0x860a('0xd'));var toCsv=require(_0x860a('0xe'));var querystring=require(_0x860a('0xf'));var Papa=require(_0x860a('0x10'));var Redis=require('ioredis');var authService=require(_0x860a('0x11'));var qs=require(_0x860a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x860a('0x13'));var logger=require(_0x860a('0x14'))('api');var utils=require(_0x860a('0x15'));var config=require(_0x860a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d802f,_0x15e5be){_0x15e5be=_0x15e5be||0xcc;return function(_0x86c535){if(_0x86c535){return _0x4d802f[_0x860a('0x17')](_0x15e5be);}return _0x4d802f[_0x860a('0x18')](_0x15e5be)['end']();};}function respondWithResult(_0x34e2fe,_0x159a09){_0x159a09=_0x159a09||0xc8;return function(_0x52a8b7){if(_0x52a8b7){return _0x34e2fe[_0x860a('0x18')](_0x159a09)[_0x860a('0x19')](_0x52a8b7);}};}function respondWithFilteredResult(_0x316323,_0x458546){return function(_0x3b50f1){if(_0x3b50f1){var _0x11dfa1=typeof _0x458546[_0x860a('0x1a')]===_0x860a('0x1b')&&typeof _0x458546[_0x860a('0x1c')]==='undefined';var _0x45ad78=_0x3b50f1[_0x860a('0x1d')];var _0x513710=_0x11dfa1?0x0:_0x458546[_0x860a('0x1a')];var _0x58fe08=_0x11dfa1?_0x3b50f1[_0x860a('0x1d')]:_0x458546[_0x860a('0x1a')]+_0x458546[_0x860a('0x1c')];var _0x3efb1f;if(_0x58fe08>=_0x45ad78){_0x58fe08=_0x45ad78;_0x3efb1f=0xc8;}else{_0x3efb1f=0xce;}_0x316323[_0x860a('0x18')](_0x3efb1f);return _0x316323['set']('Content-Range',_0x513710+'-'+_0x58fe08+'/'+_0x45ad78)[_0x860a('0x19')](_0x3b50f1);}return null;};}function patchUpdates(_0x59e075){return function(_0x19677a){try{jsonpatch[_0x860a('0x1e')](_0x19677a,_0x59e075,!![]);}catch(_0x5054de){return BPromise[_0x860a('0x1f')](_0x5054de);}return _0x19677a[_0x860a('0x20')]();};}function saveUpdates(_0x2255d3,_0x24c130){return function(_0x3caaa7){if(_0x3caaa7){return _0x3caaa7['update'](_0x2255d3)[_0x860a('0x21')](function(_0x229f49){return _0x229f49;});}return null;};}function removeEntity(_0x2b0d90,_0xab9032){return function(_0x55cba9){if(_0x55cba9){return _0x55cba9[_0x860a('0x22')]()[_0x860a('0x21')](function(){var _0x487b91=_0x55cba9[_0x860a('0x23')]({'plain':!![]});var _0x54e59c=_0x860a('0x24');return db[_0x860a('0x25')][_0x860a('0x22')]({'where':{'type':_0x54e59c,'resourceId':_0x487b91['id']}})[_0x860a('0x21')](function(){return _0x55cba9;});})[_0x860a('0x21')](function(){_0x2b0d90[_0x860a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21b950,_0x3e9438){return function(_0x401a57){if(!_0x401a57){_0x21b950['sendStatus'](0x194);}return _0x401a57;};}function handleError(_0x56314c,_0x1ec205){_0x1ec205=_0x1ec205||0x1f4;return function(_0x2569f1){logger['error'](_0x2569f1[_0x860a('0x26')]);if(_0x2569f1[_0x860a('0x27')]){delete _0x2569f1[_0x860a('0x27')];}_0x56314c['status'](_0x1ec205)[_0x860a('0x28')](_0x2569f1);};}exports[_0x860a('0x29')]=function(_0x1db454,_0x1d3a51){var _0x44a7f4={},_0x29048e={},_0x5a766a={'count':0x0,'rows':[]};var _0x546d63=_['map'](db[_0x860a('0x2a')]['rawAttributes'],function(_0x3c1ba2){return{'name':_0x3c1ba2[_0x860a('0x2b')],'type':_0x3c1ba2[_0x860a('0x2c')][_0x860a('0x2d')]};});_0x29048e[_0x860a('0x2e')]=_[_0x860a('0x2f')](_0x546d63,_0x860a('0x27'));_0x29048e['query']=_[_0x860a('0x30')](_0x1db454[_0x860a('0x31')]);_0x29048e['filters']=_['intersection'](_0x29048e['model'],_0x29048e['query']);_0x44a7f4[_0x860a('0x32')]=_[_0x860a('0x33')](_0x29048e[_0x860a('0x2e')],qs[_0x860a('0x34')](_0x1db454[_0x860a('0x31')][_0x860a('0x34')]));_0x44a7f4['attributes']=_0x44a7f4['attributes'][_0x860a('0x35')]?_0x44a7f4[_0x860a('0x32')]:_0x29048e[_0x860a('0x2e')];if(!_0x1db454[_0x860a('0x31')][_0x860a('0x36')](_0x860a('0x37'))){_0x44a7f4[_0x860a('0x1c')]=qs['limit'](_0x1db454[_0x860a('0x31')][_0x860a('0x1c')]);_0x44a7f4[_0x860a('0x1a')]=qs[_0x860a('0x1a')](_0x1db454[_0x860a('0x31')][_0x860a('0x1a')]);}_0x44a7f4[_0x860a('0x38')]=qs[_0x860a('0x39')](_0x1db454['query'][_0x860a('0x39')]);_0x44a7f4[_0x860a('0x3a')]=qs[_0x860a('0x3b')](_[_0x860a('0x3c')](_0x1db454[_0x860a('0x31')],_0x29048e[_0x860a('0x3b')]),_0x546d63);if(_0x1db454[_0x860a('0x31')][_0x860a('0x3d')]){_0x44a7f4[_0x860a('0x3a')]=_[_0x860a('0x3e')](_0x44a7f4[_0x860a('0x3a')],{'$or':_[_0x860a('0x2f')](_0x546d63,function(_0x24cd2c){if(_0x24cd2c[_0x860a('0x2c')]!==_0x860a('0x3f')){var _0x153803={};_0x153803[_0x24cd2c[_0x860a('0x27')]]={'$like':'%'+_0x1db454['query'][_0x860a('0x3d')]+'%'};return _0x153803;}})});}_0x44a7f4=_[_0x860a('0x3e')]({},_0x44a7f4,_0x1db454['options']);var _0x4b4d7e={'where':_0x44a7f4[_0x860a('0x3a')]};return db[_0x860a('0x2a')]['count'](_0x4b4d7e)[_0x860a('0x21')](function(_0x3baf05){_0x5a766a[_0x860a('0x1d')]=_0x3baf05;if(_0x1db454[_0x860a('0x31')][_0x860a('0x40')]){_0x44a7f4['include']=[{'all':!![]}];}return db[_0x860a('0x2a')][_0x860a('0x41')](_0x44a7f4);})[_0x860a('0x21')](function(_0x3c5c5c){_0x5a766a[_0x860a('0x42')]=_0x3c5c5c;return _0x5a766a;})['then'](respondWithFilteredResult(_0x1d3a51,_0x44a7f4))[_0x860a('0x43')](handleError(_0x1d3a51,null));};exports[_0x860a('0x44')]=function(_0x3d309f,_0x495cdd){var _0x43f540={'raw':!![],'where':{'id':_0x3d309f['params']['id']}},_0x156a7a={};_0x156a7a[_0x860a('0x2e')]=_[_0x860a('0x30')](db[_0x860a('0x2a')][_0x860a('0x45')]);_0x156a7a['query']=_[_0x860a('0x30')](_0x3d309f[_0x860a('0x31')]);_0x156a7a[_0x860a('0x3b')]=_['intersection'](_0x156a7a[_0x860a('0x2e')],_0x156a7a['query']);_0x43f540[_0x860a('0x32')]=_[_0x860a('0x33')](_0x156a7a[_0x860a('0x2e')],qs[_0x860a('0x34')](_0x3d309f[_0x860a('0x31')][_0x860a('0x34')]));_0x43f540['attributes']=_0x43f540[_0x860a('0x32')][_0x860a('0x35')]?_0x43f540[_0x860a('0x32')]:_0x156a7a[_0x860a('0x2e')];if(_0x3d309f['query']['includeAll']){_0x43f540[_0x860a('0x46')]=[{'all':!![]}];}_0x43f540=_[_0x860a('0x3e')]({},_0x43f540,_0x3d309f['options']);return db['Sound']['find'](_0x43f540)[_0x860a('0x21')](handleEntityNotFound(_0x495cdd,null))[_0x860a('0x21')](respondWithResult(_0x495cdd,null))[_0x860a('0x43')](handleError(_0x495cdd,null));};exports[_0x860a('0x47')]=function(_0x40fcb6,_0x5c6b04,_0x3830d5){return db[_0x860a('0x2a')]['find']({'where':{'id':_0x40fcb6[_0x860a('0x48')]['id']},'attributes':['name',_0x860a('0x49'),'converted_format'],'raw':!![]})[_0x860a('0x21')](handleEntityNotFound(_0x5c6b04,null))[_0x860a('0x21')](function(_0xe476ba){if(_0xe476ba){if(!fs[_0x860a('0x4a')](path[_0x860a('0x4b')](config[_0x860a('0x4c')],_0x860a('0x4d'),_0xe476ba['save_name']+'.'+_0xe476ba[_0x860a('0x4e')]))){throw new db[(_0x860a('0x4f'))][(_0x860a('0x50'))](_0x860a('0x51'));}return _0x5c6b04[_0x860a('0x47')](path[_0x860a('0x4b')](config[_0x860a('0x4c')],_0x860a('0x4d'),util['format'](_0x860a('0x52'),_0xe476ba[_0x860a('0x49')],_0xe476ba['converted_format'])),util[_0x860a('0x53')](_0x860a('0x52'),_0xe476ba['name'],_0xe476ba[_0x860a('0x4e')]));}return null;})['catch'](handleError(_0x5c6b04,null));};exports[_0x860a('0x54')]=function(_0x3b7060,_0x3985b2,_0x13d53a){var _0x5e159d={'name':path[_0x860a('0x55')](_0x3b7060[_0x860a('0x56')]['originalname'],path[_0x860a('0x57')](_0x3b7060[_0x860a('0x56')][_0x860a('0x58')])),'save_name':path[_0x860a('0x55')](_0x3b7060['file'][_0x860a('0x59')],path[_0x860a('0x57')](_0x3b7060[_0x860a('0x56')][_0x860a('0x59')])),'original_format':path['extname'](_0x3b7060[_0x860a('0x56')]['originalname'])['substring'](0x1),'converted_format':_0x860a('0x5a')};var _0x3eb967=path[_0x860a('0x4b')](config[_0x860a('0x4c')],_0x860a('0x5b'),_0x3b7060[_0x860a('0x56')]['filename']);var _0x45be84=path[_0x860a('0x4b')](config['root'],'server/files/sounds/converted',util[_0x860a('0x53')]('%s.%s',path[_0x860a('0x55')](_0x3b7060['file'][_0x860a('0x59')],path[_0x860a('0x57')](_0x3b7060[_0x860a('0x56')][_0x860a('0x59')])),_0x5e159d[_0x860a('0x4e')]));logger[_0x860a('0x5c')](_0x860a('0x5d'),_0x3eb967);logger[_0x860a('0x5c')]('Sound\x20upload\x20destination:\x20%s',_0x45be84);try{fs[_0x860a('0x5e')](_0x3eb967,parseInt(_0x860a('0x5f'),0x8));var _0x3aadd6=sox[_0x860a('0x60')](_0x3eb967,_0x45be84,{'sampleRate':0x1f40,'format':_0x860a('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3aadd6['on']('error',function(_0x18d1b2){fs[_0x860a('0x61')](_0x3eb967);_0x3985b2[_0x860a('0x18')](0x1f4)[_0x860a('0x28')](_0x18d1b2);});_0x3aadd6['on'](_0x860a('0x62'),function(_0x1e77ee){_0x5e159d['original_duration']=isNaN(_0x1e77ee[_0x860a('0x63')])?null:_0x1e77ee[_0x860a('0x63')]*0x3e8;_0x5e159d[_0x860a('0x64')]=isNaN(_0x1e77ee[_0x860a('0x65')])?null:_0x1e77ee[_0x860a('0x65')];_0x5e159d[_0x860a('0x66')]=isNaN(_0x1e77ee['channelCount'])?null:_0x1e77ee['channelCount'];_0x5e159d[_0x860a('0x67')]=isNaN(_0x1e77ee[_0x860a('0x68')])?null:_0x1e77ee[_0x860a('0x68')];_0x5e159d[_0x860a('0x69')]=isNaN(_0x1e77ee[_0x860a('0x6a')])?null:_0x1e77ee[_0x860a('0x6a')];});_0x3aadd6['on'](_0x860a('0x6b'),function(_0x51aa0a){_0x5e159d[_0x860a('0x6c')]=isNaN(_0x51aa0a[_0x860a('0x63')])?null:_0x51aa0a[_0x860a('0x63')]*0x3e8;_0x5e159d[_0x860a('0x6d')]=isNaN(_0x51aa0a[_0x860a('0x65')])?null:_0x51aa0a[_0x860a('0x65')];_0x5e159d['converted_channelCount']=isNaN(_0x51aa0a[_0x860a('0x6e')])?null:_0x51aa0a[_0x860a('0x6e')];_0x5e159d['converted_bitRate']=isNaN(_0x51aa0a[_0x860a('0x68')])?null:_0x51aa0a['bitRate'];_0x5e159d[_0x860a('0x6f')]=isNaN(_0x51aa0a[_0x860a('0x6a')])?null:_0x51aa0a[_0x860a('0x6a')];});_0x3aadd6['on'](_0x860a('0x70'),function(){fs['chmodSync'](_0x45be84,parseInt(_0x860a('0x5f'),0x8));return db[_0x860a('0x2a')][_0x860a('0x54')](_0x5e159d)[_0x860a('0x21')](function(_0x88bc9e){var _0xb5bdf1={'role':_0x3b7060['body'][_0x860a('0x71')],'userProfileId':_0x3b7060[_0x860a('0x72')]['userProfileId']};if(!_0xb5bdf1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb5bdf1['role']===_0x860a('0x73')){var _0x1ee983=_0x88bc9e['get']({'plain':!![]});return db['UserProfileSection'][_0x860a('0x74')]({'where':{'name':'Sounds','userProfileId':_0xb5bdf1['userProfileId']},'raw':!![]})[_0x860a('0x21')](function(_0x48805a){if(_0x48805a&&_0x48805a[_0x860a('0x75')]===0x0){return db[_0x860a('0x25')]['create']({'name':_0x1ee983[_0x860a('0x27')],'resourceId':_0x1ee983['id'],'type':_0x48805a[_0x860a('0x27')],'sectionId':_0x48805a['id']},{})[_0x860a('0x21')](function(){return _0x88bc9e;});}else{return _0x88bc9e;}})[_0x860a('0x43')](function(_0x3d4161){logger[_0x860a('0x76')](_0x860a('0x77'),_0x3d4161);throw _0x3d4161;});}return _0x88bc9e;})[_0x860a('0x21')](respondWithResult(_0x3985b2,null))['catch'](handleError(_0x3985b2,null));});_0x3aadd6[_0x860a('0x78')]();}catch(_0x37a957){_0x3985b2['status'](0x1f4)[_0x860a('0x28')](_0x37a957);}};exports[_0x860a('0x79')]=function(_0x1bd2cc,_0x388ca8,_0x1e8993){return db[_0x860a('0x2a')]['find']({'where':{'id':_0x1bd2cc[_0x860a('0x48')]['id']}})[_0x860a('0x21')](handleEntityNotFound(_0x388ca8,null))[_0x860a('0x21')](saveUpdates(_[_0x860a('0x3c')](_0x1bd2cc['body'],['name','description']),null))[_0x860a('0x21')](respondWithResult(_0x388ca8,null))[_0x860a('0x43')](handleError(_0x388ca8,null));};exports[_0x860a('0x7a')]=function(_0x4c78db,_0xd932cf,_0x2af283){return db[_0x860a('0x2a')][_0x860a('0x74')]({'where':{'id':_0x4c78db[_0x860a('0x48')]['id']}})[_0x860a('0x21')](function(_0x660f6a){if(_0x660f6a){return _0x660f6a[_0x860a('0x22')]();}})[_0x860a('0x21')](function(_0x5519e1){var _0x26b226=path[_0x860a('0x4b')](config[_0x860a('0x4c')],_0x860a('0x5b'),util['format'](_0x860a('0x52'),_0x5519e1[_0x860a('0x49')],_0x5519e1[_0x860a('0x7b')]));var _0x34ef6a=path['join'](config[_0x860a('0x4c')],_0x860a('0x4d'),util[_0x860a('0x53')](_0x860a('0x52'),_0x5519e1[_0x860a('0x49')],_0x5519e1[_0x860a('0x4e')]));fs['unlinkSync'](_0x26b226);fs['unlinkSync'](_0x34ef6a);return _0x5519e1;})[_0x860a('0x21')](function(_0x311587){if(_0x311587){return _0xd932cf[_0x860a('0x18')](0xcc)[_0x860a('0x70')]();}})['then'](handleEntityNotFound(_0xd932cf,null))[_0x860a('0x43')](handleError(_0xd932cf,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index d4baa9e..9a16543 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 _0x1a03=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a03,0x11e));var _0x31a0=function(_0x29fa3d,_0x45d24f){_0x29fa3d=_0x29fa3d-0x0;var _0x5d4bbf=_0x1a03[_0x29fa3d];return _0x5d4bbf;};'use strict';var _=require(_0x31a0('0x0'));var util=require(_0x31a0('0x1'));var logger=require(_0x31a0('0x2'))('api');var moment=require(_0x31a0('0x3'));var BPromise=require('bluebird');var rp=require(_0x31a0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31a0('0x5'));var config=require(_0x31a0('0x6'));var attributes=require(_0x31a0('0x7'));module['exports']=function(_0x17e1d6,_0x5ec3f5){return _0x17e1d6[_0x31a0('0x8')](_0x31a0('0x9'),attributes,{'tableName':_0x31a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb29c=['../../config/logger','path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds','util'];(function(_0x1d8dc6,_0x42a703){var _0x53355e=function(_0x32df2f){while(--_0x32df2f){_0x1d8dc6['push'](_0x1d8dc6['shift']());}};_0x53355e(++_0x42a703);}(_0xb29c,0x18f));var _0xcb29=function(_0x1cb2f1,_0x3b8a97){_0x1cb2f1=_0x1cb2f1-0x0;var _0x446ebe=_0xb29c[_0x1cb2f1];return _0x446ebe;};'use strict';var _=require('lodash');var util=require(_0xcb29('0x0'));var logger=require(_0xcb29('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb29('0x2'));var rimraf=require(_0xcb29('0x3'));var config=require(_0xcb29('0x4'));var attributes=require(_0xcb29('0x5'));module['exports']=function(_0x2af24d,_0x13e533){return _0x2af24d['define'](_0xcb29('0x6'),attributes,{'tableName':_0xcb29('0x7'),'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 751dc38..29185e9 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 _0x83c3=['result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83c3,0xfd));var _0x383c=function(_0x829a9a,_0x156656){_0x829a9a=_0x829a9a-0x0;var _0x48f153=_0x83c3[_0x829a9a];return _0x48f153;};'use strict';var _=require('lodash');var util=require(_0x383c('0x0'));var moment=require(_0x383c('0x1'));var BPromise=require('bluebird');var rs=require(_0x383c('0x2'));var fs=require('fs');var Redis=require(_0x383c('0x3'));var db=require(_0x383c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x383c('0x5'))(_0x383c('0x6'));var config=require('../../config/environment');var jayson=require(_0x383c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13d575,_0x31fe9e,_0xbe18f8){return new BPromise(function(_0xfbdd0b,_0xd05401){return client['request'](_0x13d575,_0xbe18f8)['then'](function(_0x5add06){logger[_0x383c('0x8')](_0x383c('0x9'),_0x31fe9e,_0x383c('0xa'));logger[_0x383c('0xb')](_0x383c('0xc'),_0x31fe9e,_0x383c('0xa'),JSON[_0x383c('0xd')](_0x5add06));if(_0x5add06[_0x383c('0xe')]){if(_0x5add06[_0x383c('0xe')][_0x383c('0xf')]===0x1f4){logger[_0x383c('0xe')](_0x383c('0x9'),_0x31fe9e,_0x5add06[_0x383c('0xe')]['message']);return _0xd05401(_0x5add06[_0x383c('0xe')][_0x383c('0x10')]);}logger['error']('Sound,\x20%s,\x20%s',_0x31fe9e,_0x5add06[_0x383c('0xe')]['message']);return _0xfbdd0b(_0x5add06[_0x383c('0xe')][_0x383c('0x10')]);}else{logger[_0x383c('0x8')](_0x383c('0x9'),_0x31fe9e,_0x383c('0xa'));_0xfbdd0b(_0x5add06[_0x383c('0x11')][_0x383c('0x10')]);}})[_0x383c('0x12')](function(_0x44ad97){logger[_0x383c('0xe')]('Sound,\x20%s,\x20%s',_0x31fe9e,_0x44ad97);_0xd05401(_0x44ad97);});});}exports[_0x383c('0x13')]=function(_0x11858e){var _0x304f6f=this;return new Promise(function(_0x1bd192,_0x4b76c6){return db[_0x383c('0x14')][_0x383c('0x15')]({'raw':_0x11858e[_0x383c('0x16')]?_0x11858e['options'][_0x383c('0x17')]===undefined?!![]:![]:!![],'where':_0x11858e[_0x383c('0x16')]?_0x11858e[_0x383c('0x16')][_0x383c('0x18')]||null:null,'attributes':_0x11858e[_0x383c('0x16')]?_0x11858e[_0x383c('0x16')][_0x383c('0x19')]||null:null,'include':_0x11858e[_0x383c('0x16')]?_0x11858e['options'][_0x383c('0x1a')]?_[_0x383c('0x1b')](_0x11858e[_0x383c('0x16')][_0x383c('0x1a')],function(_0x5057e8){return{'model':db[_0x5057e8[_0x383c('0x1c')]],'as':_0x5057e8['as'],'attributes':_0x5057e8[_0x383c('0x19')],'include':_0x5057e8[_0x383c('0x1a')]?_[_0x383c('0x1b')](_0x5057e8['include'],function(_0x15f61c){return{'model':db[_0x15f61c[_0x383c('0x1c')]],'as':_0x15f61c['as'],'attributes':_0x15f61c[_0x383c('0x19')],'include':_0x15f61c[_0x383c('0x1a')]?_[_0x383c('0x1b')](_0x15f61c[_0x383c('0x1a')],function(_0x35d7c9){return{'model':db[_0x35d7c9[_0x383c('0x1c')]],'as':_0x35d7c9['as'],'attributes':_0x35d7c9[_0x383c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x383c('0x1d')](function(_0x4234d5){logger['info'](_0x383c('0x13'),_0x11858e);logger['debug'](_0x383c('0x13'),_0x11858e,JSON[_0x383c('0xd')](_0x4234d5));_0x1bd192(_0x4234d5);})[_0x383c('0x12')](function(_0x52af3d){logger[_0x383c('0xe')](_0x383c('0x13'),_0x52af3d['message'],_0x11858e);_0x4b76c6(_0x304f6f[_0x383c('0xe')](0x1f4,_0x52af3d[_0x383c('0x10')]));});});}; \ No newline at end of file +var _0x1030=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','then','lodash','util'];(function(_0x34eabc,_0x51d411){var _0x43e72f=function(_0x5619e8){while(--_0x5619e8){_0x34eabc['push'](_0x34eabc['shift']());}};_0x43e72f(++_0x51d411);}(_0x1030,0x9e));var _0x0103=function(_0x5984b5,_0x4985f5){_0x5984b5=_0x5984b5-0x0;var _0x53c5b6=_0x1030[_0x5984b5];return _0x53c5b6;};'use strict';var _=require(_0x0103('0x0'));var util=require(_0x0103('0x1'));var moment=require('moment');var BPromise=require(_0x0103('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0103('0x3'))['db'];var utils=require(_0x0103('0x4'));var logger=require(_0x0103('0x5'))(_0x0103('0x6'));var config=require(_0x0103('0x7'));var jayson=require(_0x0103('0x8'));var client=jayson[_0x0103('0x9')][_0x0103('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20e513,_0x3578b4,_0x224054){return new BPromise(function(_0x240218,_0x1b8f82){return client['request'](_0x20e513,_0x224054)['then'](function(_0x2f0d2e){logger[_0x0103('0xb')](_0x0103('0xc'),_0x3578b4,_0x0103('0xd'));logger[_0x0103('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x3578b4,'request\x20sent',JSON[_0x0103('0xf')](_0x2f0d2e));if(_0x2f0d2e[_0x0103('0x10')]){if(_0x2f0d2e[_0x0103('0x10')][_0x0103('0x11')]===0x1f4){logger['error'](_0x0103('0xc'),_0x3578b4,_0x2f0d2e[_0x0103('0x10')][_0x0103('0x12')]);return _0x1b8f82(_0x2f0d2e[_0x0103('0x10')][_0x0103('0x12')]);}logger['error'](_0x0103('0xc'),_0x3578b4,_0x2f0d2e['error'][_0x0103('0x12')]);return _0x240218(_0x2f0d2e[_0x0103('0x10')]['message']);}else{logger[_0x0103('0xb')](_0x0103('0xc'),_0x3578b4,'request\x20sent');_0x240218(_0x2f0d2e[_0x0103('0x13')]['message']);}})[_0x0103('0x14')](function(_0x39c90e){logger[_0x0103('0x10')](_0x0103('0xc'),_0x3578b4,_0x39c90e);_0x1b8f82(_0x39c90e);});});}exports[_0x0103('0x15')]=function(_0x537dc2){var _0x1cf397=this;return new Promise(function(_0x13eb5b,_0xdcd0e){return db[_0x0103('0x16')][_0x0103('0x17')]({'raw':_0x537dc2['options']?_0x537dc2[_0x0103('0x18')][_0x0103('0x19')]===undefined?!![]:![]:!![],'where':_0x537dc2[_0x0103('0x18')]?_0x537dc2[_0x0103('0x18')][_0x0103('0x1a')]||null:null,'attributes':_0x537dc2['options']?_0x537dc2['options'][_0x0103('0x1b')]||null:null,'include':_0x537dc2[_0x0103('0x18')]?_0x537dc2[_0x0103('0x18')]['include']?_[_0x0103('0x1c')](_0x537dc2[_0x0103('0x18')][_0x0103('0x1d')],function(_0x7f0d82){return{'model':db[_0x7f0d82[_0x0103('0x1e')]],'as':_0x7f0d82['as'],'attributes':_0x7f0d82[_0x0103('0x1b')],'include':_0x7f0d82['include']?_[_0x0103('0x1c')](_0x7f0d82[_0x0103('0x1d')],function(_0x32fcbd){return{'model':db[_0x32fcbd[_0x0103('0x1e')]],'as':_0x32fcbd['as'],'attributes':_0x32fcbd[_0x0103('0x1b')],'include':_0x32fcbd[_0x0103('0x1d')]?_[_0x0103('0x1c')](_0x32fcbd[_0x0103('0x1d')],function(_0x2af310){return{'model':db[_0x2af310['model']],'as':_0x2af310['as'],'attributes':_0x2af310[_0x0103('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0103('0x1f')](function(_0x503bf1){logger[_0x0103('0xb')](_0x0103('0x15'),_0x537dc2);logger[_0x0103('0xe')](_0x0103('0x15'),_0x537dc2,JSON['stringify'](_0x503bf1));_0x13eb5b(_0x503bf1);})[_0x0103('0x14')](function(_0x482d5d){logger[_0x0103('0x10')]('ShowSound',_0x482d5d['message'],_0x537dc2);_0xdcd0e(_0x1cf397[_0x0103('0x10')](0x1f4,_0x482d5d[_0x0103('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 349e22e..2672be8 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 _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd86da6,_0x22645d){var _0x5682fd=function(_0x30011f){while(--_0x30011f){_0xd86da6['push'](_0xd86da6['shift']());}};_0x5682fd(++_0x22645d);}(_0xb10b,0x12a));var _0xbb10=function(_0x454f02,_0x32ce79){_0x454f02=_0x454f02-0x0;var _0x3369f7=_0xb10b[_0x454f02];return _0x3369f7;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x1e163c,_0x1ce254){var _0x1b50ac=function(_0x33d71f){while(--_0x33d71f){_0x1e163c['push'](_0x1e163c['shift']());}};_0x1b50ac(++_0x1ce254);}(_0x757a,0xde));var _0xa757=function(_0x979c28,_0x4ba9fd){_0x979c28=_0x979c28-0x0;var _0x240b6e=_0x757a[_0x979c28];return _0x240b6e;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 473832e..38e3de0 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 _0x2abd=['ENUM','sequelize','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2abd,0x169));var _0xd2ab=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2abd[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xd2ab('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd2ab('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xd2ab('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xd2ab('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd381=['STRING','TEXT','ENUM','out','sequelize','exports'];(function(_0x582ebb,_0x13a628){var _0x87ca75=function(_0x3d7fea){while(--_0x3d7fea){_0x582ebb['push'](_0x582ebb['shift']());}};_0x87ca75(++_0x13a628);}(_0xd381,0x13c));var _0x1d38=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xd381[_0xaa6a4];return _0xdc31a4;};'use strict';var Sequelize=require(_0x1d38('0x0'));module[_0x1d38('0x1')]={'uniqueid':{'type':Sequelize[_0x1d38('0x2')]},'body':{'type':Sequelize[_0x1d38('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x1d38('0x4')]('in','out'),'defaultValue':_0x1d38('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x1d38('0x2')]},'providerResponse':{'type':Sequelize[_0x1d38('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b71e8eb..f97e121 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 _0xd94d=['create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','SquareMessage','length','options','find'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xd94d,0x16f));var _0xdd94=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd94d[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd94('0x0'));var zipdir=require(_0xdd94('0x1'));var jsonpatch=require(_0xdd94('0x2'));var rp=require('request-promise');var moment=require(_0xdd94('0x3'));var BPromise=require(_0xdd94('0x4'));var Mustache=require(_0xdd94('0x5'));var util=require(_0xdd94('0x6'));var path=require(_0xdd94('0x7'));var sox=require(_0xdd94('0x8'));var csv=require(_0xdd94('0x9'));var ejs=require('ejs');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('0x9'));var querystring=require(_0xdd94('0xf'));var Papa=require(_0xdd94('0x10'));var Redis=require(_0xdd94('0x11'));var authService=require(_0xdd94('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd94('0x13'));var logger=require('../../config/logger')(_0xdd94('0x14'));var utils=require(_0xdd94('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x167f09,_0x516817){_0x516817=_0x516817||0xcc;return function(_0x3ed2ba){if(_0x3ed2ba){return _0x167f09[_0xdd94('0x16')](_0x516817);}return _0x167f09[_0xdd94('0x17')](_0x516817)[_0xdd94('0x18')]();};}function respondWithResult(_0x3f60e9,_0x430b44){_0x430b44=_0x430b44||0xc8;return function(_0xe85f7a){if(_0xe85f7a){return _0x3f60e9[_0xdd94('0x17')](_0x430b44)['json'](_0xe85f7a);}};}function respondWithFilteredResult(_0x46cdcd,_0x4c5261){return function(_0x203d6c){if(_0x203d6c){var _0x19ec9c=typeof _0x4c5261[_0xdd94('0x19')]==='undefined'&&typeof _0x4c5261[_0xdd94('0x1a')]===_0xdd94('0x1b');var _0x1d81c9=_0x203d6c[_0xdd94('0x1c')];var _0x321b2b=_0x19ec9c?0x0:_0x4c5261['offset'];var _0x6600ba=_0x19ec9c?_0x203d6c['count']:_0x4c5261[_0xdd94('0x19')]+_0x4c5261[_0xdd94('0x1a')];var _0x18478e;if(_0x6600ba>=_0x1d81c9){_0x6600ba=_0x1d81c9;_0x18478e=0xc8;}else{_0x18478e=0xce;}_0x46cdcd[_0xdd94('0x17')](_0x18478e);return _0x46cdcd[_0xdd94('0x1d')](_0xdd94('0x1e'),_0x321b2b+'-'+_0x6600ba+'/'+_0x1d81c9)[_0xdd94('0x1f')](_0x203d6c);}return null;};}function patchUpdates(_0x517c4e){return function(_0x10fb94){try{jsonpatch[_0xdd94('0x20')](_0x10fb94,_0x517c4e,!![]);}catch(_0x6294d3){return BPromise[_0xdd94('0x21')](_0x6294d3);}return _0x10fb94[_0xdd94('0x22')]();};}function saveUpdates(_0x4a36f5,_0x5f4a9a){return function(_0x266953){if(_0x266953){return _0x266953[_0xdd94('0x23')](_0x4a36f5)['then'](function(_0x22d115){return _0x22d115;});}return null;};}function removeEntity(_0x27871c,_0x50e699){return function(_0x3a0f4c){if(_0x3a0f4c){return _0x3a0f4c[_0xdd94('0x24')]()[_0xdd94('0x25')](function(){_0x27871c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4c20,_0x5a1599){return function(_0x4d940d){if(!_0x4d940d){_0x3c4c20['sendStatus'](0x194);}return _0x4d940d;};}function handleError(_0x371ded,_0x452bca){_0x452bca=_0x452bca||0x1f4;return function(_0xd28417){logger['error'](_0xd28417[_0xdd94('0x26')]);if(_0xd28417[_0xdd94('0x27')]){delete _0xd28417['name'];}_0x371ded[_0xdd94('0x17')](_0x452bca)[_0xdd94('0x28')](_0xd28417);};}exports[_0xdd94('0x29')]=function(_0x368dca,_0x4e6102){var _0x3e9e43={},_0x32f913={},_0x58f2df={'count':0x0,'rows':[]};var _0x2a6bff=_[_0xdd94('0x2a')](db['SquareMessage'][_0xdd94('0x2b')],function(_0x1534a6){return{'name':_0x1534a6[_0xdd94('0x2c')],'type':_0x1534a6[_0xdd94('0x2d')]['key']};});_0x32f913['model']=_[_0xdd94('0x2a')](_0x2a6bff,_0xdd94('0x27'));_0x32f913['query']=_[_0xdd94('0x2e')](_0x368dca['query']);_0x32f913[_0xdd94('0x2f')]=_[_0xdd94('0x30')](_0x32f913[_0xdd94('0x31')],_0x32f913[_0xdd94('0x32')]);_0x3e9e43[_0xdd94('0x33')]=_[_0xdd94('0x30')](_0x32f913[_0xdd94('0x31')],qs[_0xdd94('0x34')](_0x368dca[_0xdd94('0x32')][_0xdd94('0x34')]));_0x3e9e43['attributes']=_0x3e9e43[_0xdd94('0x33')]['length']?_0x3e9e43[_0xdd94('0x33')]:_0x32f913['model'];if(!_0x368dca[_0xdd94('0x32')][_0xdd94('0x35')]('nolimit')){_0x3e9e43['limit']=qs[_0xdd94('0x1a')](_0x368dca[_0xdd94('0x32')][_0xdd94('0x1a')]);_0x3e9e43[_0xdd94('0x19')]=qs[_0xdd94('0x19')](_0x368dca[_0xdd94('0x32')]['offset']);}_0x3e9e43[_0xdd94('0x36')]=qs[_0xdd94('0x37')](_0x368dca[_0xdd94('0x32')][_0xdd94('0x37')]);_0x3e9e43['where']=qs[_0xdd94('0x2f')](_[_0xdd94('0x38')](_0x368dca[_0xdd94('0x32')],_0x32f913[_0xdd94('0x2f')]),_0x2a6bff);if(_0x368dca['query'][_0xdd94('0x39')]){_0x3e9e43[_0xdd94('0x3a')]=_[_0xdd94('0x3b')](_0x3e9e43['where'],{'$or':_[_0xdd94('0x2a')](_0x2a6bff,function(_0x3d9350){if(_0x3d9350[_0xdd94('0x2d')]!==_0xdd94('0x3c')){var _0x1f6ee3={};_0x1f6ee3[_0x3d9350[_0xdd94('0x27')]]={'$like':'%'+_0x368dca[_0xdd94('0x32')]['filter']+'%'};return _0x1f6ee3;}})});}_0x3e9e43=_[_0xdd94('0x3b')]({},_0x3e9e43,_0x368dca['options']);var _0x5c0d3f={'where':_0x3e9e43['where']};return db['SquareMessage'][_0xdd94('0x1c')](_0x5c0d3f)[_0xdd94('0x25')](function(_0x164a0c){_0x58f2df[_0xdd94('0x1c')]=_0x164a0c;if(_0x368dca[_0xdd94('0x32')][_0xdd94('0x3d')]){_0x3e9e43[_0xdd94('0x3e')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x3e9e43);})[_0xdd94('0x25')](function(_0x58c6a6){_0x58f2df[_0xdd94('0x3f')]=_0x58c6a6;return _0x58f2df;})['then'](respondWithFilteredResult(_0x4e6102,_0x3e9e43))[_0xdd94('0x40')](handleError(_0x4e6102,null));};exports[_0xdd94('0x41')]=function(_0x550a01,_0x38359e){var _0x215a43={'raw':!![],'where':{'id':_0x550a01[_0xdd94('0x42')]['id']}},_0x1a0ee6={};_0x1a0ee6[_0xdd94('0x31')]=_['keys'](db[_0xdd94('0x43')][_0xdd94('0x2b')]);_0x1a0ee6[_0xdd94('0x32')]=_[_0xdd94('0x2e')](_0x550a01[_0xdd94('0x32')]);_0x1a0ee6[_0xdd94('0x2f')]=_[_0xdd94('0x30')](_0x1a0ee6[_0xdd94('0x31')],_0x1a0ee6['query']);_0x215a43[_0xdd94('0x33')]=_['intersection'](_0x1a0ee6[_0xdd94('0x31')],qs[_0xdd94('0x34')](_0x550a01[_0xdd94('0x32')][_0xdd94('0x34')]));_0x215a43[_0xdd94('0x33')]=_0x215a43[_0xdd94('0x33')][_0xdd94('0x44')]?_0x215a43[_0xdd94('0x33')]:_0x1a0ee6[_0xdd94('0x31')];if(_0x550a01[_0xdd94('0x32')][_0xdd94('0x3d')]){_0x215a43[_0xdd94('0x3e')]=[{'all':!![]}];}_0x215a43=_[_0xdd94('0x3b')]({},_0x215a43,_0x550a01[_0xdd94('0x45')]);return db['SquareMessage'][_0xdd94('0x46')](_0x215a43)['then'](handleEntityNotFound(_0x38359e,null))[_0xdd94('0x25')](respondWithResult(_0x38359e,null))[_0xdd94('0x40')](handleError(_0x38359e,null));};exports['create']=function(_0xf9245a,_0x1d33be){return db[_0xdd94('0x43')][_0xdd94('0x47')](_0xf9245a[_0xdd94('0x48')],{})[_0xdd94('0x25')](respondWithResult(_0x1d33be,0xc9))[_0xdd94('0x40')](handleError(_0x1d33be,null));};exports['update']=function(_0x4ad278,_0x5ce4e3){if(_0x4ad278['body']['id']){delete _0x4ad278[_0xdd94('0x48')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x4ad278[_0xdd94('0x42')]['id']}})[_0xdd94('0x25')](handleEntityNotFound(_0x5ce4e3,null))[_0xdd94('0x25')](saveUpdates(_0x4ad278[_0xdd94('0x48')],null))[_0xdd94('0x25')](respondWithResult(_0x5ce4e3,null))['catch'](handleError(_0x5ce4e3,null));};exports['destroy']=function(_0x49869e,_0x3b991d){return db[_0xdd94('0x43')][_0xdd94('0x46')]({'where':{'id':_0x49869e[_0xdd94('0x42')]['id']}})[_0xdd94('0x25')](handleEntityNotFound(_0x3b991d,null))['then'](removeEntity(_0x3b991d,null))[_0xdd94('0x40')](handleError(_0x3b991d,null));}; \ No newline at end of file +var _0xeeeb=['destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','offset','count','set','json','apply','reject','then'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0xeeeb,0x1bb));var _0xbeee=function(_0x5c385c,_0x19aef4){_0x5c385c=_0x5c385c-0x0;var _0x74ae2c=_0xeeeb[_0x5c385c];return _0x74ae2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbeee('0x0'));var zipdir=require(_0xbeee('0x1'));var jsonpatch=require(_0xbeee('0x2'));var rp=require(_0xbeee('0x3'));var moment=require(_0xbeee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbeee('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbeee('0x6'));var ejs=require(_0xbeee('0x7'));var fs=require('fs');var fs_extra=require(_0xbeee('0x8'));var _=require(_0xbeee('0x9'));var squel=require(_0xbeee('0xa'));var crypto=require(_0xbeee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbeee('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbeee('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbeee('0xe'));var as=require(_0xbeee('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbeee('0x10'))(_0xbeee('0x11'));var utils=require(_0xbeee('0x12'));var config=require(_0xbeee('0x13'));var licenseUtil=require(_0xbeee('0x14'));var db=require(_0xbeee('0x15'))['db'];function respondWithStatusCode(_0x3dcb84,_0x5b8958){_0x5b8958=_0x5b8958||0xcc;return function(_0x363d35){if(_0x363d35){return _0x3dcb84['sendStatus'](_0x5b8958);}return _0x3dcb84[_0xbeee('0x16')](_0x5b8958)[_0xbeee('0x17')]();};}function respondWithResult(_0x572911,_0x3777ca){_0x3777ca=_0x3777ca||0xc8;return function(_0x4b7b6d){if(_0x4b7b6d){return _0x572911[_0xbeee('0x16')](_0x3777ca)['json'](_0x4b7b6d);}};}function respondWithFilteredResult(_0x15d887,_0x2771e9){return function(_0x1dd019){if(_0x1dd019){var _0x377a78=typeof _0x2771e9['offset']==='undefined'&&typeof _0x2771e9[_0xbeee('0x18')]===_0xbeee('0x19');var _0x4e5c6e=_0x1dd019['count'];var _0xa31be2=_0x377a78?0x0:_0x2771e9[_0xbeee('0x1a')];var _0x41e86a=_0x377a78?_0x1dd019[_0xbeee('0x1b')]:_0x2771e9[_0xbeee('0x1a')]+_0x2771e9[_0xbeee('0x18')];var _0x208ecd;if(_0x41e86a>=_0x4e5c6e){_0x41e86a=_0x4e5c6e;_0x208ecd=0xc8;}else{_0x208ecd=0xce;}_0x15d887[_0xbeee('0x16')](_0x208ecd);return _0x15d887[_0xbeee('0x1c')]('Content-Range',_0xa31be2+'-'+_0x41e86a+'/'+_0x4e5c6e)[_0xbeee('0x1d')](_0x1dd019);}return null;};}function patchUpdates(_0x48bf0d){return function(_0x5c882c){try{jsonpatch[_0xbeee('0x1e')](_0x5c882c,_0x48bf0d,!![]);}catch(_0x590588){return BPromise[_0xbeee('0x1f')](_0x590588);}return _0x5c882c['save']();};}function saveUpdates(_0x284695,_0x32fa75){return function(_0x522ce2){if(_0x522ce2){return _0x522ce2['update'](_0x284695)[_0xbeee('0x20')](function(_0x1c23ee){return _0x1c23ee;});}return null;};}function removeEntity(_0x13e823,_0x21cb84){return function(_0x2953a4){if(_0x2953a4){return _0x2953a4[_0xbeee('0x21')]()[_0xbeee('0x20')](function(){_0x13e823[_0xbeee('0x16')](0xcc)[_0xbeee('0x17')]();});}};}function handleEntityNotFound(_0x431590,_0x2e6610){return function(_0x4fd3e7){if(!_0x4fd3e7){_0x431590['sendStatus'](0x194);}return _0x4fd3e7;};}function handleError(_0x4e3e5e,_0x240677){_0x240677=_0x240677||0x1f4;return function(_0x8cafc7){logger[_0xbeee('0x22')](_0x8cafc7[_0xbeee('0x23')]);if(_0x8cafc7[_0xbeee('0x24')]){delete _0x8cafc7['name'];}_0x4e3e5e[_0xbeee('0x16')](_0x240677)[_0xbeee('0x25')](_0x8cafc7);};}exports[_0xbeee('0x26')]=function(_0x11d692,_0x56c852){var _0x851c90={},_0x51bfe2={},_0x5d19c6={'count':0x0,'rows':[]};var _0x1cd624=_[_0xbeee('0x27')](db[_0xbeee('0x28')][_0xbeee('0x29')],function(_0x3b3bde){return{'name':_0x3b3bde['fieldName'],'type':_0x3b3bde[_0xbeee('0x2a')][_0xbeee('0x2b')]};});_0x51bfe2[_0xbeee('0x2c')]=_[_0xbeee('0x27')](_0x1cd624,_0xbeee('0x24'));_0x51bfe2['query']=_[_0xbeee('0x2d')](_0x11d692[_0xbeee('0x2e')]);_0x51bfe2[_0xbeee('0x2f')]=_['intersection'](_0x51bfe2['model'],_0x51bfe2[_0xbeee('0x2e')]);_0x851c90[_0xbeee('0x30')]=_[_0xbeee('0x31')](_0x51bfe2['model'],qs[_0xbeee('0x32')](_0x11d692[_0xbeee('0x2e')][_0xbeee('0x32')]));_0x851c90[_0xbeee('0x30')]=_0x851c90[_0xbeee('0x30')][_0xbeee('0x33')]?_0x851c90[_0xbeee('0x30')]:_0x51bfe2[_0xbeee('0x2c')];if(!_0x11d692[_0xbeee('0x2e')]['hasOwnProperty'](_0xbeee('0x34'))){_0x851c90[_0xbeee('0x18')]=qs[_0xbeee('0x18')](_0x11d692[_0xbeee('0x2e')]['limit']);_0x851c90['offset']=qs[_0xbeee('0x1a')](_0x11d692[_0xbeee('0x2e')][_0xbeee('0x1a')]);}_0x851c90['order']=qs['sort'](_0x11d692[_0xbeee('0x2e')][_0xbeee('0x35')]);_0x851c90['where']=qs[_0xbeee('0x2f')](_[_0xbeee('0x36')](_0x11d692[_0xbeee('0x2e')],_0x51bfe2[_0xbeee('0x2f')]),_0x1cd624);if(_0x11d692[_0xbeee('0x2e')]['filter']){_0x851c90[_0xbeee('0x37')]=_[_0xbeee('0x38')](_0x851c90['where'],{'$or':_[_0xbeee('0x27')](_0x1cd624,function(_0x4bdae6){if(_0x4bdae6[_0xbeee('0x2a')]!==_0xbeee('0x39')){var _0x553fe2={};_0x553fe2[_0x4bdae6[_0xbeee('0x24')]]={'$like':'%'+_0x11d692[_0xbeee('0x2e')][_0xbeee('0x3a')]+'%'};return _0x553fe2;}})});}_0x851c90=_[_0xbeee('0x38')]({},_0x851c90,_0x11d692[_0xbeee('0x3b')]);var _0x4e2754={'where':_0x851c90[_0xbeee('0x37')]};return db[_0xbeee('0x28')][_0xbeee('0x1b')](_0x4e2754)[_0xbeee('0x20')](function(_0x179162){_0x5d19c6['count']=_0x179162;if(_0x11d692[_0xbeee('0x2e')][_0xbeee('0x3c')]){_0x851c90[_0xbeee('0x3d')]=[{'all':!![]}];}return db[_0xbeee('0x28')][_0xbeee('0x3e')](_0x851c90);})[_0xbeee('0x20')](function(_0x50702f){_0x5d19c6['rows']=_0x50702f;return _0x5d19c6;})[_0xbeee('0x20')](respondWithFilteredResult(_0x56c852,_0x851c90))['catch'](handleError(_0x56c852,null));};exports[_0xbeee('0x3f')]=function(_0x545cd8,_0xb76244){var _0x4d76cd={'raw':!![],'where':{'id':_0x545cd8[_0xbeee('0x40')]['id']}},_0x1f6cb6={};_0x1f6cb6[_0xbeee('0x2c')]=_[_0xbeee('0x2d')](db[_0xbeee('0x28')][_0xbeee('0x29')]);_0x1f6cb6[_0xbeee('0x2e')]=_[_0xbeee('0x2d')](_0x545cd8[_0xbeee('0x2e')]);_0x1f6cb6[_0xbeee('0x2f')]=_['intersection'](_0x1f6cb6[_0xbeee('0x2c')],_0x1f6cb6[_0xbeee('0x2e')]);_0x4d76cd[_0xbeee('0x30')]=_[_0xbeee('0x31')](_0x1f6cb6[_0xbeee('0x2c')],qs[_0xbeee('0x32')](_0x545cd8[_0xbeee('0x2e')]['fields']));_0x4d76cd['attributes']=_0x4d76cd['attributes']['length']?_0x4d76cd[_0xbeee('0x30')]:_0x1f6cb6['model'];if(_0x545cd8['query'][_0xbeee('0x3c')]){_0x4d76cd[_0xbeee('0x3d')]=[{'all':!![]}];}_0x4d76cd=_[_0xbeee('0x38')]({},_0x4d76cd,_0x545cd8['options']);return db[_0xbeee('0x28')][_0xbeee('0x41')](_0x4d76cd)[_0xbeee('0x20')](handleEntityNotFound(_0xb76244,null))[_0xbeee('0x20')](respondWithResult(_0xb76244,null))[_0xbeee('0x42')](handleError(_0xb76244,null));};exports['create']=function(_0x2d7ed4,_0x407c16){return db[_0xbeee('0x28')]['create'](_0x2d7ed4[_0xbeee('0x43')],{})[_0xbeee('0x20')](respondWithResult(_0x407c16,0xc9))[_0xbeee('0x42')](handleError(_0x407c16,null));};exports['update']=function(_0x30b8b7,_0x2d2bb0){if(_0x30b8b7[_0xbeee('0x43')]['id']){delete _0x30b8b7['body']['id'];}return db['SquareMessage'][_0xbeee('0x41')]({'where':{'id':_0x30b8b7[_0xbeee('0x40')]['id']}})[_0xbeee('0x20')](handleEntityNotFound(_0x2d2bb0,null))[_0xbeee('0x20')](saveUpdates(_0x30b8b7['body'],null))[_0xbeee('0x20')](respondWithResult(_0x2d2bb0,null))[_0xbeee('0x42')](handleError(_0x2d2bb0,null));};exports[_0xbeee('0x21')]=function(_0x4d2f2,_0x174822){return db[_0xbeee('0x28')][_0xbeee('0x41')]({'where':{'id':_0x4d2f2[_0xbeee('0x40')]['id']}})[_0xbeee('0x20')](handleEntityNotFound(_0x174822,null))[_0xbeee('0x20')](removeEntity(_0x174822,null))[_0xbeee('0x42')](handleError(_0x174822,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 5455266..a86aace 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 _0x352a=['bluebird','request-promise','path','rimraf','exports','lodash','util','../../config/logger','api'];(function(_0x4f3764,_0x43d4ff){var _0x434f22=function(_0x524493){while(--_0x524493){_0x4f3764['push'](_0x4f3764['shift']());}};_0x434f22(++_0x43d4ff);}(_0x352a,0x83));var _0xa352=function(_0x2850de,_0x1121b8){_0x2850de=_0x2850de-0x0;var _0x487dfd=_0x352a[_0x2850de];return _0x487dfd;};'use strict';var _=require(_0xa352('0x0'));var util=require(_0xa352('0x1'));var logger=require(_0xa352('0x2'))(_0xa352('0x3'));var moment=require('moment');var BPromise=require(_0xa352('0x4'));var rp=require(_0xa352('0x5'));var fs=require('fs');var path=require(_0xa352('0x6'));var rimraf=require(_0xa352('0x7'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xa352('0x8')]=function(_0x35314b,_0x48265d){return _0x35314b['define']('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf240=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','util','../../config/logger'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xf240,0xc2));var _0x0f24=function(_0x30e7fe,_0x8be533){_0x30e7fe=_0x30e7fe-0x0;var _0x5a3e15=_0xf240[_0x30e7fe];return _0x5a3e15;};'use strict';var _=require('lodash');var util=require(_0x0f24('0x0'));var logger=require(_0x0f24('0x1'))(_0x0f24('0x2'));var moment=require(_0x0f24('0x3'));var BPromise=require(_0x0f24('0x4'));var rp=require(_0x0f24('0x5'));var fs=require('fs');var path=require(_0x0f24('0x6'));var rimraf=require(_0x0f24('0x7'));var config=require(_0x0f24('0x8'));var attributes=require(_0x0f24('0x9'));module[_0x0f24('0xa')]=function(_0x22cd23,_0x3aa7ba){return _0x22cd23[_0x0f24('0xb')](_0x0f24('0xc'),attributes,{'tableName':_0x0f24('0xd'),'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 edf0201..37138d6 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 _0xb6dc=['request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareMessage','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','SquareMessage,\x20%s,\x20%s','debug'];(function(_0x42ab43,_0xb38833){var _0xf1ca33=function(_0x10b5e9){while(--_0x10b5e9){_0x42ab43['push'](_0x42ab43['shift']());}};_0xf1ca33(++_0xb38833);}(_0xb6dc,0x1ad));var _0xcb6d=function(_0xa3d613,_0x245c0b){_0xa3d613=_0xa3d613-0x0;var _0x5efc38=_0xb6dc[_0xa3d613];return _0x5efc38;};'use strict';var _=require('lodash');var util=require(_0xcb6d('0x0'));var moment=require(_0xcb6d('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb6d('0x2'));var fs=require('fs');var Redis=require(_0xcb6d('0x3'));var db=require(_0xcb6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb6d('0x5'))(_0xcb6d('0x6'));var config=require('../../config/environment');var jayson=require(_0xcb6d('0x7'));var client=jayson['client'][_0xcb6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x151821,_0x26e8f7,_0x3d6db6){return new BPromise(function(_0x33cdee,_0xe65fc5){return client[_0xcb6d('0x9')](_0x151821,_0x3d6db6)[_0xcb6d('0xa')](function(_0x139678){logger['info'](_0xcb6d('0xb'),_0x26e8f7,'request\x20sent');logger[_0xcb6d('0xc')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x26e8f7,_0xcb6d('0xd'),JSON[_0xcb6d('0xe')](_0x139678));if(_0x139678[_0xcb6d('0xf')]){if(_0x139678['error'][_0xcb6d('0x10')]===0x1f4){logger[_0xcb6d('0xf')](_0xcb6d('0xb'),_0x26e8f7,_0x139678['error'][_0xcb6d('0x11')]);return _0xe65fc5(_0x139678[_0xcb6d('0xf')]['message']);}logger[_0xcb6d('0xf')](_0xcb6d('0xb'),_0x26e8f7,_0x139678[_0xcb6d('0xf')][_0xcb6d('0x11')]);return _0x33cdee(_0x139678[_0xcb6d('0xf')][_0xcb6d('0x11')]);}else{logger[_0xcb6d('0x12')](_0xcb6d('0xb'),_0x26e8f7,_0xcb6d('0xd'));_0x33cdee(_0x139678[_0xcb6d('0x13')][_0xcb6d('0x11')]);}})[_0xcb6d('0x14')](function(_0x24f520){logger[_0xcb6d('0xf')](_0xcb6d('0xb'),_0x26e8f7,_0x24f520);_0xe65fc5(_0x24f520);});});}exports[_0xcb6d('0x15')]=function(_0x4da10b){var _0x427813=this;return new Promise(function(_0x3d6f2d,_0x4fe718){return db['SquareMessage'][_0xcb6d('0x16')](_0x4da10b[_0xcb6d('0x17')],{'raw':_0x4da10b[_0xcb6d('0x18')]?_0x4da10b[_0xcb6d('0x18')][_0xcb6d('0x19')]===undefined?!![]:![]:!![]})[_0xcb6d('0xa')](function(_0x4b2f84){logger[_0xcb6d('0x12')](_0xcb6d('0x15'),_0x4da10b);logger[_0xcb6d('0xc')](_0xcb6d('0x15'),_0x4da10b,JSON['stringify'](_0x4b2f84));_0x3d6f2d(_0x4b2f84);})[_0xcb6d('0x14')](function(_0x2acadc){logger[_0xcb6d('0xf')](_0xcb6d('0x15'),_0x2acadc['message'],_0x4da10b);_0x4fe718(_0x427813[_0xcb6d('0xf')](0x1f4,_0x2acadc['message']));});});}; \ No newline at end of file +var _0xd61e=['lodash','moment','randomstring','ioredis','../../config/utils','jayson/promise','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CreateSquareMessage','SquareMessage','create','body','raw'];(function(_0x226254,_0x417c73){var _0x154074=function(_0x2150f5){while(--_0x2150f5){_0x226254['push'](_0x226254['shift']());}};_0x154074(++_0x417c73);}(_0xd61e,0x1b9));var _0xed61=function(_0x45b582,_0x19e151){_0x45b582=_0x45b582-0x0;var _0x32da52=_0xd61e[_0x45b582];return _0x32da52;};'use strict';var _=require(_0xed61('0x0'));var util=require('util');var moment=require(_0xed61('0x1'));var BPromise=require('bluebird');var rs=require(_0xed61('0x2'));var fs=require('fs');var Redis=require(_0xed61('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xed61('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xed61('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3b3a,_0x1590ff,_0x3acdfb){return new BPromise(function(_0x501e0d,_0x5310f1){return client[_0xed61('0x6')](_0x2e3b3a,_0x3acdfb)[_0xed61('0x7')](function(_0x3e9f71){logger[_0xed61('0x8')](_0xed61('0x9'),_0x1590ff,_0xed61('0xa'));logger[_0xed61('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x1590ff,_0xed61('0xa'),JSON['stringify'](_0x3e9f71));if(_0x3e9f71[_0xed61('0xc')]){if(_0x3e9f71[_0xed61('0xc')][_0xed61('0xd')]===0x1f4){logger[_0xed61('0xc')](_0xed61('0x9'),_0x1590ff,_0x3e9f71[_0xed61('0xc')][_0xed61('0xe')]);return _0x5310f1(_0x3e9f71[_0xed61('0xc')]['message']);}logger[_0xed61('0xc')](_0xed61('0x9'),_0x1590ff,_0x3e9f71['error'][_0xed61('0xe')]);return _0x501e0d(_0x3e9f71['error'][_0xed61('0xe')]);}else{logger[_0xed61('0x8')](_0xed61('0x9'),_0x1590ff,_0xed61('0xa'));_0x501e0d(_0x3e9f71['result']['message']);}})[_0xed61('0xf')](function(_0x36d8a9){logger['error'](_0xed61('0x9'),_0x1590ff,_0x36d8a9);_0x5310f1(_0x36d8a9);});});}exports[_0xed61('0x10')]=function(_0x419073){var _0x586cfe=this;return new Promise(function(_0x4bce2e,_0x246dc7){return db[_0xed61('0x11')][_0xed61('0x12')](_0x419073[_0xed61('0x13')],{'raw':_0x419073['options']?_0x419073['options'][_0xed61('0x14')]===undefined?!![]:![]:!![]})[_0xed61('0x7')](function(_0x3155d7){logger[_0xed61('0x8')](_0xed61('0x10'),_0x419073);logger[_0xed61('0xb')](_0xed61('0x10'),_0x419073,JSON['stringify'](_0x3155d7));_0x4bce2e(_0x3155d7);})[_0xed61('0xf')](function(_0x5a5b86){logger[_0xed61('0xc')]('CreateSquareMessage',_0x5a5b86['message'],_0x419073);_0x246dc7(_0x586cfe['error'](0x1f4,_0x5a5b86['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index c1f667b..5281008 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 _0xa7b3=['post','create','update','delete','destroy','exports','util','Router','fs-extra','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','test'];(function(_0x2e7741,_0x263ab7){var _0x39e383=function(_0x4e1757){while(--_0x4e1757){_0x2e7741['push'](_0x2e7741['shift']());}};_0x39e383(++_0x263ab7);}(_0xa7b3,0xba));var _0x3a7b=function(_0x5f35a2,_0x1620ad){_0x5f35a2=_0x5f35a2-0x0;var _0x54e1fc=_0xa7b3[_0x5f35a2];return _0x54e1fc;};'use strict';var multer=require('multer');var util=require(_0x3a7b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3a7b('0x1')]();var fs_extra=require(_0x3a7b('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a7b('0x3'));var controller=require(_0x3a7b('0x4'));router[_0x3a7b('0x5')]('/',auth['isAuthenticated'](),controller[_0x3a7b('0x6')]);router[_0x3a7b('0x5')](_0x3a7b('0x7'),auth[_0x3a7b('0x8')](),controller[_0x3a7b('0x9')]);router['get'](_0x3a7b('0xa'),auth['isAuthenticated'](),timeout('15s'),controller[_0x3a7b('0xb')]);router[_0x3a7b('0xc')]('/',auth[_0x3a7b('0x8')](),controller[_0x3a7b('0xd')]);router['put']('/:id',auth[_0x3a7b('0x8')](),controller[_0x3a7b('0xe')]);router[_0x3a7b('0xf')](_0x3a7b('0x7'),auth['isAuthenticated'](),controller[_0x3a7b('0x10')]);module[_0x3a7b('0x11')]=router; \ No newline at end of file +var _0xbfd5=['/:id/test','15s','test','post','create','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xbfd5,0x16d));var _0x5bfd=function(_0x4bf5ce,_0x17169c){_0x4bf5ce=_0x4bf5ce-0x0;var _0x5ba1bc=_0xbfd5[_0x4bf5ce];return _0x5ba1bc;};'use strict';var multer=require('multer');var util=require(_0x5bfd('0x0'));var path=require(_0x5bfd('0x1'));var timeout=require(_0x5bfd('0x2'));var express=require(_0x5bfd('0x3'));var router=express['Router']();var fs_extra=require(_0x5bfd('0x4'));var auth=require(_0x5bfd('0x5'));var interaction=require(_0x5bfd('0x6'));var config=require(_0x5bfd('0x7'));var controller=require('./squareOdbc.controller');router[_0x5bfd('0x8')]('/',auth[_0x5bfd('0x9')](),controller[_0x5bfd('0xa')]);router[_0x5bfd('0x8')](_0x5bfd('0xb'),auth['isAuthenticated'](),controller[_0x5bfd('0xc')]);router['get'](_0x5bfd('0xd'),auth['isAuthenticated'](),timeout(_0x5bfd('0xe')),controller[_0x5bfd('0xf')]);router[_0x5bfd('0x10')]('/',auth[_0x5bfd('0x9')](),controller[_0x5bfd('0x11')]);router[_0x5bfd('0x12')](_0x5bfd('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5bfd('0x13')](_0x5bfd('0xb'),auth['isAuthenticated'](),controller[_0x5bfd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e001205..4686bb6 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 _0x0061=['name','sequelize','STRING'];(function(_0x493ad2,_0x126afe){var _0xbea759=function(_0x56e837){while(--_0x56e837){_0x493ad2['push'](_0x493ad2['shift']());}};_0xbea759(++_0x126afe);}(_0x0061,0x91));var _0x1006=function(_0xdd7d95,_0x4292a5){_0xdd7d95=_0xdd7d95-0x0;var _0x49d555=_0x0061[_0xdd7d95];return _0x49d555;};'use strict';var Sequelize=require(_0x1006('0x0'));module['exports']={'name':{'type':Sequelize[_0x1006('0x1')],'unique':_0x1006('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1006('0x1')]},'description':{'type':Sequelize[_0x1006('0x1')]}}; \ No newline at end of file +var _0x17fb=['exports'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x17fb,0x181));var _0xb17f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x17fb[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0xb17f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 4af2818..7160e2e 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 _0x88fe=['pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','name','send','SquareOdbc','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where'];(function(_0x50f9e5,_0x4f90d6){var _0x548d6b=function(_0x5404c7){while(--_0x5404c7){_0x50f9e5['push'](_0x50f9e5['shift']());}};_0x548d6b(++_0x4f90d6);}(_0x88fe,0x6a));var _0xe88f=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0x88fe[_0x1075b8];return _0x5d047f;};'use strict';var emlformat=require(_0xe88f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe88f('0x1'));var jsonpatch=require(_0xe88f('0x2'));var rp=require(_0xe88f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe88f('0x4'));var util=require(_0xe88f('0x5'));var path=require('path');var sox=require(_0xe88f('0x6'));var csv=require(_0xe88f('0x7'));var ejs=require(_0xe88f('0x8'));var fs=require('fs');var fs_extra=require(_0xe88f('0x9'));var _=require(_0xe88f('0xa'));var squel=require(_0xe88f('0xb'));var crypto=require(_0xe88f('0xc'));var jsforce=require(_0xe88f('0xd'));var deskjs=require(_0xe88f('0xe'));var toCsv=require(_0xe88f('0x7'));var querystring=require('querystring');var Papa=require(_0xe88f('0xf'));var Redis=require(_0xe88f('0x10'));var authService=require(_0xe88f('0x11'));var qs=require(_0xe88f('0x12'));var as=require(_0xe88f('0x13'));var hardwareService=require(_0xe88f('0x14'));var logger=require('../../config/logger')(_0xe88f('0x15'));var utils=require('../../config/utils');var config=require(_0xe88f('0x16'));var licenseUtil=require(_0xe88f('0x17'));var db=require(_0xe88f('0x18'))['db'];function respondWithStatusCode(_0x34baee,_0x22cf4e){_0x22cf4e=_0x22cf4e||0xcc;return function(_0x2c95b5){if(_0x2c95b5){return _0x34baee[_0xe88f('0x19')](_0x22cf4e);}return _0x34baee[_0xe88f('0x1a')](_0x22cf4e)[_0xe88f('0x1b')]();};}function respondWithResult(_0x156b3a,_0x3aa2f5){_0x3aa2f5=_0x3aa2f5||0xc8;return function(_0x4bf5ca){if(_0x4bf5ca){return _0x156b3a['status'](_0x3aa2f5)[_0xe88f('0x1c')](_0x4bf5ca);}};}function respondWithFilteredResult(_0x458763,_0x302ecd){return function(_0x1af353){if(_0x1af353){var _0x5f4273=typeof _0x302ecd[_0xe88f('0x1d')]===_0xe88f('0x1e')&&typeof _0x302ecd['limit']==='undefined';var _0xa5af07=_0x1af353[_0xe88f('0x1f')];var _0x533f52=_0x5f4273?0x0:_0x302ecd[_0xe88f('0x1d')];var _0x4b3e5d=_0x5f4273?_0x1af353[_0xe88f('0x1f')]:_0x302ecd[_0xe88f('0x1d')]+_0x302ecd[_0xe88f('0x20')];var _0x45cd5d;if(_0x4b3e5d>=_0xa5af07){_0x4b3e5d=_0xa5af07;_0x45cd5d=0xc8;}else{_0x45cd5d=0xce;}_0x458763[_0xe88f('0x1a')](_0x45cd5d);return _0x458763[_0xe88f('0x21')]('Content-Range',_0x533f52+'-'+_0x4b3e5d+'/'+_0xa5af07)['json'](_0x1af353);}return null;};}function patchUpdates(_0x31b89c){return function(_0x9db340){try{jsonpatch[_0xe88f('0x22')](_0x9db340,_0x31b89c,!![]);}catch(_0x4eaf1b){return BPromise[_0xe88f('0x23')](_0x4eaf1b);}return _0x9db340[_0xe88f('0x24')]();};}function saveUpdates(_0xe518bb,_0x46417a){return function(_0x19df52){if(_0x19df52){return _0x19df52[_0xe88f('0x25')](_0xe518bb)[_0xe88f('0x26')](function(_0x172570){return _0x172570;});}return null;};}function removeEntity(_0x16c45d,_0x9ba1f9){return function(_0x11b8b0){if(_0x11b8b0){return _0x11b8b0[_0xe88f('0x27')]()[_0xe88f('0x26')](function(){var _0x11d999=_0x11b8b0[_0xe88f('0x28')]({'plain':!![]});var _0x51621f=_0xe88f('0x29');return db[_0xe88f('0x2a')][_0xe88f('0x27')]({'where':{'type':_0x51621f,'resourceId':_0x11d999['id']}})[_0xe88f('0x26')](function(){return _0x11b8b0;});})['then'](function(){_0x16c45d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6118,_0x15fde5){return function(_0x47e657){if(!_0x47e657){_0x2c6118['sendStatus'](0x194);}return _0x47e657;};}function handleError(_0x42d3dc,_0x4f7657){_0x4f7657=_0x4f7657||0x1f4;return function(_0x4aa798){logger['error'](_0x4aa798['stack']);if(_0x4aa798[_0xe88f('0x2b')]){delete _0x4aa798[_0xe88f('0x2b')];}_0x42d3dc[_0xe88f('0x1a')](_0x4f7657)[_0xe88f('0x2c')](_0x4aa798);};}exports['index']=function(_0x304f95,_0x12ac24){var _0x2af15b={},_0x9cf72e={},_0x4ce1b5={'count':0x0,'rows':[]};var _0xac8743=_['map'](db[_0xe88f('0x2d')][_0xe88f('0x2e')],function(_0x21c36a){return{'name':_0x21c36a[_0xe88f('0x2f')],'type':_0x21c36a[_0xe88f('0x30')]['key']};});_0x9cf72e[_0xe88f('0x31')]=_[_0xe88f('0x32')](_0xac8743,_0xe88f('0x2b'));_0x9cf72e[_0xe88f('0x33')]=_['keys'](_0x304f95[_0xe88f('0x33')]);_0x9cf72e[_0xe88f('0x34')]=_[_0xe88f('0x35')](_0x9cf72e[_0xe88f('0x31')],_0x9cf72e[_0xe88f('0x33')]);_0x2af15b[_0xe88f('0x36')]=_[_0xe88f('0x35')](_0x9cf72e[_0xe88f('0x31')],qs[_0xe88f('0x37')](_0x304f95['query'][_0xe88f('0x37')]));_0x2af15b[_0xe88f('0x36')]=_0x2af15b[_0xe88f('0x36')][_0xe88f('0x38')]?_0x2af15b[_0xe88f('0x36')]:_0x9cf72e[_0xe88f('0x31')];if(!_0x304f95[_0xe88f('0x33')]['hasOwnProperty'](_0xe88f('0x39'))){_0x2af15b[_0xe88f('0x20')]=qs['limit'](_0x304f95[_0xe88f('0x33')][_0xe88f('0x20')]);_0x2af15b[_0xe88f('0x1d')]=qs[_0xe88f('0x1d')](_0x304f95[_0xe88f('0x33')]['offset']);}_0x2af15b['order']=qs['sort'](_0x304f95[_0xe88f('0x33')][_0xe88f('0x3a')]);_0x2af15b[_0xe88f('0x3b')]=qs[_0xe88f('0x34')](_[_0xe88f('0x3c')](_0x304f95[_0xe88f('0x33')],_0x9cf72e['filters']),_0xac8743);if(_0x304f95[_0xe88f('0x33')][_0xe88f('0x3d')]){_0x2af15b[_0xe88f('0x3b')]=_[_0xe88f('0x3e')](_0x2af15b['where'],{'$or':_[_0xe88f('0x32')](_0xac8743,function(_0x1145a0){if(_0x1145a0[_0xe88f('0x30')]!=='VIRTUAL'){var _0x45364a={};_0x45364a[_0x1145a0['name']]={'$like':'%'+_0x304f95['query']['filter']+'%'};return _0x45364a;}})});}_0x2af15b=_[_0xe88f('0x3e')]({},_0x2af15b,_0x304f95[_0xe88f('0x3f')]);var _0x153a27={'where':_0x2af15b[_0xe88f('0x3b')]};return db[_0xe88f('0x2d')][_0xe88f('0x1f')](_0x153a27)['then'](function(_0x283831){_0x4ce1b5[_0xe88f('0x1f')]=_0x283831;if(_0x304f95[_0xe88f('0x33')][_0xe88f('0x40')]){_0x2af15b[_0xe88f('0x41')]=[{'all':!![]}];}return db['SquareOdbc'][_0xe88f('0x42')](_0x2af15b);})[_0xe88f('0x26')](function(_0x5621fe){_0x4ce1b5['rows']=_0x5621fe;return _0x4ce1b5;})['then'](respondWithFilteredResult(_0x12ac24,_0x2af15b))[_0xe88f('0x43')](handleError(_0x12ac24,null));};exports[_0xe88f('0x44')]=function(_0xf60be6,_0x38da10){var _0x14cfee={'raw':!![],'where':{'id':_0xf60be6[_0xe88f('0x45')]['id']}},_0x18c52d={};_0x18c52d['model']=_[_0xe88f('0x46')](db['SquareOdbc']['rawAttributes']);_0x18c52d['query']=_[_0xe88f('0x46')](_0xf60be6[_0xe88f('0x33')]);_0x18c52d['filters']=_[_0xe88f('0x35')](_0x18c52d[_0xe88f('0x31')],_0x18c52d[_0xe88f('0x33')]);_0x14cfee[_0xe88f('0x36')]=_[_0xe88f('0x35')](_0x18c52d[_0xe88f('0x31')],qs[_0xe88f('0x37')](_0xf60be6[_0xe88f('0x33')][_0xe88f('0x37')]));_0x14cfee[_0xe88f('0x36')]=_0x14cfee[_0xe88f('0x36')][_0xe88f('0x38')]?_0x14cfee[_0xe88f('0x36')]:_0x18c52d['model'];if(_0xf60be6['query'][_0xe88f('0x40')]){_0x14cfee[_0xe88f('0x41')]=[{'all':!![]}];}_0x14cfee=_[_0xe88f('0x3e')]({},_0x14cfee,_0xf60be6[_0xe88f('0x3f')]);return db[_0xe88f('0x2d')]['find'](_0x14cfee)[_0xe88f('0x26')](handleEntityNotFound(_0x38da10,null))[_0xe88f('0x26')](respondWithResult(_0x38da10,null))['catch'](handleError(_0x38da10,null));};exports[_0xe88f('0x47')]=function(_0x58d1de,_0x5a956e){return db[_0xe88f('0x2d')][_0xe88f('0x47')](_0x58d1de[_0xe88f('0x48')],{})[_0xe88f('0x26')](function(_0x1bf49d){var _0x2cb3fe=_0x58d1de[_0xe88f('0x49')][_0xe88f('0x28')]({'plain':!![]});if(!_0x2cb3fe)throw new Error(_0xe88f('0x4a'));if(_0x2cb3fe['role']===_0xe88f('0x49')){var _0x25a8c4=_0x1bf49d[_0xe88f('0x28')]({'plain':!![]});var _0x3cd7d4=_0xe88f('0x29');return db['UserProfileSection'][_0xe88f('0x4b')]({'where':{'name':_0x3cd7d4,'userProfileId':_0x2cb3fe[_0xe88f('0x4c')]},'raw':!![]})[_0xe88f('0x26')](function(_0x4d7af8){if(_0x4d7af8&&_0x4d7af8['autoAssociation']===0x0){return db[_0xe88f('0x2a')][_0xe88f('0x47')]({'name':_0x25a8c4[_0xe88f('0x2b')],'resourceId':_0x25a8c4['id'],'type':_0x4d7af8[_0xe88f('0x2b')],'sectionId':_0x4d7af8['id']},{})[_0xe88f('0x26')](function(){return _0x1bf49d;});}else{return _0x1bf49d;}})[_0xe88f('0x43')](function(_0x268b46){logger['error'](_0xe88f('0x4d'),_0x268b46);throw _0x268b46;});}return _0x1bf49d;})[_0xe88f('0x26')](respondWithResult(_0x5a956e,0xc9))['catch'](handleError(_0x5a956e,null));};exports[_0xe88f('0x25')]=function(_0x1d5a74,_0x199e14){if(_0x1d5a74[_0xe88f('0x48')]['id']){delete _0x1d5a74['body']['id'];}return db['SquareOdbc'][_0xe88f('0x4b')]({'where':{'id':_0x1d5a74['params']['id']}})[_0xe88f('0x26')](handleEntityNotFound(_0x199e14,null))[_0xe88f('0x26')](saveUpdates(_0x1d5a74['body'],null))['then'](respondWithResult(_0x199e14,null))[_0xe88f('0x43')](handleError(_0x199e14,null));};exports['destroy']=function(_0xbc150,_0x46388f){return db['SquareOdbc'][_0xe88f('0x4b')]({'where':{'id':_0xbc150[_0xe88f('0x45')]['id']}})[_0xe88f('0x26')](handleEntityNotFound(_0x46388f,null))[_0xe88f('0x26')](removeEntity(_0x46388f,null))['catch'](handleError(_0x46388f,null));};exports[_0xe88f('0x4e')]=function(_0x41e4cf,_0x558a29,_0x1f034d){var _0x12c20d;return db[_0xe88f('0x2d')][_0xe88f('0x4b')]({'where':{'id':_0x41e4cf[_0xe88f('0x45')]['id']},'attributes':['id',_0xe88f('0x4f')]})[_0xe88f('0x26')](handleEntityNotFound(_0x558a29,null))[_0xe88f('0x26')](function(_0x455c7f){if(_0x455c7f){var _0x5bdc47=require(_0xe88f('0x50'))();_0x5bdc47[_0xe88f('0x51')](_0x455c7f[_0xe88f('0x4f')]);_0x5bdc47[_0xe88f('0x52')]();return _0x455c7f;}})[_0xe88f('0x26')](respondWithResult(_0x558a29,null))['catch'](handleError(_0x558a29,null));}; \ No newline at end of file +var _0x4202=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4202,0x109));var _0x2420=function(_0x15f8ad,_0x5275c3){_0x15f8ad=_0x15f8ad-0x0;var _0xc0238a=_0x4202[_0x15f8ad];return _0xc0238a;};'use strict';var emlformat=require(_0x2420('0x0'));var rimraf=require(_0x2420('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2420('0x2'));var rp=require(_0x2420('0x3'));var moment=require(_0x2420('0x4'));var BPromise=require(_0x2420('0x5'));var Mustache=require(_0x2420('0x6'));var util=require(_0x2420('0x7'));var path=require(_0x2420('0x8'));var sox=require(_0x2420('0x9'));var csv=require('to-csv');var ejs=require(_0x2420('0xa'));var fs=require('fs');var fs_extra=require(_0x2420('0xb'));var _=require('lodash');var squel=require(_0x2420('0xc'));var crypto=require(_0x2420('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2420('0xe'));var toCsv=require(_0x2420('0xf'));var querystring=require(_0x2420('0x10'));var Papa=require(_0x2420('0x11'));var Redis=require('ioredis');var authService=require(_0x2420('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2420('0x13'));var hardwareService=require(_0x2420('0x14'));var logger=require('../../config/logger')(_0x2420('0x15'));var utils=require(_0x2420('0x16'));var config=require(_0x2420('0x17'));var licenseUtil=require(_0x2420('0x18'));var db=require(_0x2420('0x19'))['db'];function respondWithStatusCode(_0x315a3d,_0xd7014f){_0xd7014f=_0xd7014f||0xcc;return function(_0x52195e){if(_0x52195e){return _0x315a3d[_0x2420('0x1a')](_0xd7014f);}return _0x315a3d[_0x2420('0x1b')](_0xd7014f)[_0x2420('0x1c')]();};}function respondWithResult(_0x3465e4,_0x369db3){_0x369db3=_0x369db3||0xc8;return function(_0x463121){if(_0x463121){return _0x3465e4[_0x2420('0x1b')](_0x369db3)[_0x2420('0x1d')](_0x463121);}};}function respondWithFilteredResult(_0x54efec,_0x3f9ada){return function(_0x104edd){if(_0x104edd){var _0x493e78=typeof _0x3f9ada[_0x2420('0x1e')]==='undefined'&&typeof _0x3f9ada[_0x2420('0x1f')]==='undefined';var _0x328a66=_0x104edd[_0x2420('0x20')];var _0x12c00d=_0x493e78?0x0:_0x3f9ada[_0x2420('0x1e')];var _0x475884=_0x493e78?_0x104edd[_0x2420('0x20')]:_0x3f9ada[_0x2420('0x1e')]+_0x3f9ada[_0x2420('0x1f')];var _0x868ed6;if(_0x475884>=_0x328a66){_0x475884=_0x328a66;_0x868ed6=0xc8;}else{_0x868ed6=0xce;}_0x54efec[_0x2420('0x1b')](_0x868ed6);return _0x54efec[_0x2420('0x21')](_0x2420('0x22'),_0x12c00d+'-'+_0x475884+'/'+_0x328a66)[_0x2420('0x1d')](_0x104edd);}return null;};}function patchUpdates(_0xef78e7){return function(_0x94da78){try{jsonpatch[_0x2420('0x23')](_0x94da78,_0xef78e7,!![]);}catch(_0xac18e3){return BPromise[_0x2420('0x24')](_0xac18e3);}return _0x94da78[_0x2420('0x25')]();};}function saveUpdates(_0x2bcb37,_0x31a7af){return function(_0x16a7da){if(_0x16a7da){return _0x16a7da[_0x2420('0x26')](_0x2bcb37)[_0x2420('0x27')](function(_0x30a9ce){return _0x30a9ce;});}return null;};}function removeEntity(_0x190a72,_0x4b93b6){return function(_0x47a5d2){if(_0x47a5d2){return _0x47a5d2[_0x2420('0x28')]()[_0x2420('0x27')](function(){var _0x5cd5b6=_0x47a5d2['get']({'plain':!![]});var _0x3d643b=_0x2420('0x29');return db[_0x2420('0x2a')][_0x2420('0x28')]({'where':{'type':_0x3d643b,'resourceId':_0x5cd5b6['id']}})[_0x2420('0x27')](function(){return _0x47a5d2;});})[_0x2420('0x27')](function(){_0x190a72[_0x2420('0x1b')](0xcc)[_0x2420('0x1c')]();});}};}function handleEntityNotFound(_0x31403d,_0x57205b){return function(_0x2210a4){if(!_0x2210a4){_0x31403d['sendStatus'](0x194);}return _0x2210a4;};}function handleError(_0x4d00f1,_0x136615){_0x136615=_0x136615||0x1f4;return function(_0x1a0c2a){logger['error'](_0x1a0c2a[_0x2420('0x2b')]);if(_0x1a0c2a[_0x2420('0x2c')]){delete _0x1a0c2a[_0x2420('0x2c')];}_0x4d00f1[_0x2420('0x1b')](_0x136615)[_0x2420('0x2d')](_0x1a0c2a);};}exports['index']=function(_0x7621f1,_0x47a7eb){var _0x3cfc81={},_0x59dbbf={},_0x4bd627={'count':0x0,'rows':[]};var _0x430d4f=_[_0x2420('0x2e')](db[_0x2420('0x2f')][_0x2420('0x30')],function(_0x289844){return{'name':_0x289844[_0x2420('0x31')],'type':_0x289844[_0x2420('0x32')]['key']};});_0x59dbbf[_0x2420('0x33')]=_[_0x2420('0x2e')](_0x430d4f,_0x2420('0x2c'));_0x59dbbf[_0x2420('0x34')]=_[_0x2420('0x35')](_0x7621f1[_0x2420('0x34')]);_0x59dbbf['filters']=_[_0x2420('0x36')](_0x59dbbf[_0x2420('0x33')],_0x59dbbf[_0x2420('0x34')]);_0x3cfc81[_0x2420('0x37')]=_[_0x2420('0x36')](_0x59dbbf[_0x2420('0x33')],qs[_0x2420('0x38')](_0x7621f1['query']['fields']));_0x3cfc81['attributes']=_0x3cfc81[_0x2420('0x37')]['length']?_0x3cfc81[_0x2420('0x37')]:_0x59dbbf[_0x2420('0x33')];if(!_0x7621f1[_0x2420('0x34')]['hasOwnProperty'](_0x2420('0x39'))){_0x3cfc81[_0x2420('0x1f')]=qs[_0x2420('0x1f')](_0x7621f1[_0x2420('0x34')][_0x2420('0x1f')]);_0x3cfc81[_0x2420('0x1e')]=qs['offset'](_0x7621f1[_0x2420('0x34')][_0x2420('0x1e')]);}_0x3cfc81[_0x2420('0x3a')]=qs['sort'](_0x7621f1[_0x2420('0x34')]['sort']);_0x3cfc81[_0x2420('0x3b')]=qs[_0x2420('0x3c')](_[_0x2420('0x3d')](_0x7621f1[_0x2420('0x34')],_0x59dbbf['filters']),_0x430d4f);if(_0x7621f1[_0x2420('0x34')][_0x2420('0x3e')]){_0x3cfc81[_0x2420('0x3b')]=_[_0x2420('0x3f')](_0x3cfc81[_0x2420('0x3b')],{'$or':_[_0x2420('0x2e')](_0x430d4f,function(_0x72d2bd){if(_0x72d2bd[_0x2420('0x32')]!==_0x2420('0x40')){var _0x2d41e6={};_0x2d41e6[_0x72d2bd[_0x2420('0x2c')]]={'$like':'%'+_0x7621f1[_0x2420('0x34')]['filter']+'%'};return _0x2d41e6;}})});}_0x3cfc81=_[_0x2420('0x3f')]({},_0x3cfc81,_0x7621f1['options']);var _0x2a162b={'where':_0x3cfc81[_0x2420('0x3b')]};return db['SquareOdbc'][_0x2420('0x20')](_0x2a162b)[_0x2420('0x27')](function(_0x4f4dfc){_0x4bd627[_0x2420('0x20')]=_0x4f4dfc;if(_0x7621f1['query'][_0x2420('0x41')]){_0x3cfc81[_0x2420('0x42')]=[{'all':!![]}];}return db['SquareOdbc'][_0x2420('0x43')](_0x3cfc81);})[_0x2420('0x27')](function(_0x1bd7d5){_0x4bd627[_0x2420('0x44')]=_0x1bd7d5;return _0x4bd627;})[_0x2420('0x27')](respondWithFilteredResult(_0x47a7eb,_0x3cfc81))['catch'](handleError(_0x47a7eb,null));};exports['show']=function(_0x46f5b3,_0x7435ab){var _0x324f3e={'raw':!![],'where':{'id':_0x46f5b3[_0x2420('0x45')]['id']}},_0x2d5be4={};_0x2d5be4['model']=_[_0x2420('0x35')](db['SquareOdbc']['rawAttributes']);_0x2d5be4[_0x2420('0x34')]=_['keys'](_0x46f5b3[_0x2420('0x34')]);_0x2d5be4[_0x2420('0x3c')]=_[_0x2420('0x36')](_0x2d5be4[_0x2420('0x33')],_0x2d5be4['query']);_0x324f3e[_0x2420('0x37')]=_[_0x2420('0x36')](_0x2d5be4['model'],qs[_0x2420('0x38')](_0x46f5b3['query'][_0x2420('0x38')]));_0x324f3e[_0x2420('0x37')]=_0x324f3e[_0x2420('0x37')][_0x2420('0x46')]?_0x324f3e[_0x2420('0x37')]:_0x2d5be4[_0x2420('0x33')];if(_0x46f5b3['query']['includeAll']){_0x324f3e[_0x2420('0x42')]=[{'all':!![]}];}_0x324f3e=_[_0x2420('0x3f')]({},_0x324f3e,_0x46f5b3[_0x2420('0x47')]);return db['SquareOdbc'][_0x2420('0x48')](_0x324f3e)['then'](handleEntityNotFound(_0x7435ab,null))['then'](respondWithResult(_0x7435ab,null))[_0x2420('0x49')](handleError(_0x7435ab,null));};exports[_0x2420('0x4a')]=function(_0x442916,_0x334ab4){return db[_0x2420('0x2f')][_0x2420('0x4a')](_0x442916[_0x2420('0x4b')],{})[_0x2420('0x27')](function(_0x4b70da){var _0xf1e09b=_0x442916['user'][_0x2420('0x4c')]({'plain':!![]});if(!_0xf1e09b)throw new Error(_0x2420('0x4d'));if(_0xf1e09b[_0x2420('0x4e')]===_0x2420('0x4f')){var _0x1c05e5=_0x4b70da[_0x2420('0x4c')]({'plain':!![]});var _0x3dd309=_0x2420('0x29');return db[_0x2420('0x50')]['find']({'where':{'name':_0x3dd309,'userProfileId':_0xf1e09b[_0x2420('0x51')]},'raw':!![]})[_0x2420('0x27')](function(_0x263202){if(_0x263202&&_0x263202['autoAssociation']===0x0){return db[_0x2420('0x2a')][_0x2420('0x4a')]({'name':_0x1c05e5[_0x2420('0x2c')],'resourceId':_0x1c05e5['id'],'type':_0x263202[_0x2420('0x2c')],'sectionId':_0x263202['id']},{})['then'](function(){return _0x4b70da;});}else{return _0x4b70da;}})[_0x2420('0x49')](function(_0x20977){logger[_0x2420('0x52')](_0x2420('0x53'),_0x20977);throw _0x20977;});}return _0x4b70da;})['then'](respondWithResult(_0x334ab4,0xc9))[_0x2420('0x49')](handleError(_0x334ab4,null));};exports['update']=function(_0x5d75ba,_0xc1edaf){if(_0x5d75ba[_0x2420('0x4b')]['id']){delete _0x5d75ba[_0x2420('0x4b')]['id'];}return db[_0x2420('0x2f')][_0x2420('0x48')]({'where':{'id':_0x5d75ba[_0x2420('0x45')]['id']}})[_0x2420('0x27')](handleEntityNotFound(_0xc1edaf,null))[_0x2420('0x27')](saveUpdates(_0x5d75ba[_0x2420('0x4b')],null))[_0x2420('0x27')](respondWithResult(_0xc1edaf,null))[_0x2420('0x49')](handleError(_0xc1edaf,null));};exports[_0x2420('0x28')]=function(_0x30f665,_0x30d28e){return db[_0x2420('0x2f')]['find']({'where':{'id':_0x30f665[_0x2420('0x45')]['id']}})[_0x2420('0x27')](handleEntityNotFound(_0x30d28e,null))[_0x2420('0x27')](removeEntity(_0x30d28e,null))[_0x2420('0x49')](handleError(_0x30d28e,null));};exports[_0x2420('0x54')]=function(_0x4d0761,_0x4001ae,_0x3f2638){var _0x3ca39c;return db['SquareOdbc'][_0x2420('0x48')]({'where':{'id':_0x4d0761['params']['id']},'attributes':['id',_0x2420('0x55')]})['then'](handleEntityNotFound(_0x4001ae,null))[_0x2420('0x27')](function(_0xb0d463){if(_0xb0d463){var _0x170942=require(_0x2420('0x56'))();_0x170942[_0x2420('0x57')](_0xb0d463[_0x2420('0x55')]);_0x170942[_0x2420('0x58')]();return _0xb0d463;}})[_0x2420('0x27')](respondWithResult(_0x4001ae,null))[_0x2420('0x49')](handleError(_0x4001ae,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f744173..38c2bcb 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 _0xad5f=['bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment'];(function(_0x20e2c1,_0x347fdb){var _0x52bef6=function(_0x2dad1e){while(--_0x2dad1e){_0x20e2c1['push'](_0x20e2c1['shift']());}};_0x52bef6(++_0x347fdb);}(_0xad5f,0x1a8));var _0xfad5=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0xad5f[_0x5b3950];return _0x41e436;};'use strict';var _=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var logger=require(_0xfad5('0x2'))(_0xfad5('0x3'));var moment=require(_0xfad5('0x4'));var BPromise=require(_0xfad5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfad5('0x6'));var rimraf=require(_0xfad5('0x7'));var config=require(_0xfad5('0x8'));var attributes=require(_0xfad5('0x9'));module[_0xfad5('0xa')]=function(_0x180450,_0x43cae5){return _0x180450['define'](_0xfad5('0xb'),attributes,{'tableName':_0xfad5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb76f=['square_odbc','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','define','SquareOdbc'];(function(_0x5f8893,_0x595d5e){var _0x113730=function(_0x283dea){while(--_0x283dea){_0x5f8893['push'](_0x5f8893['shift']());}};_0x113730(++_0x595d5e);}(_0xb76f,0x182));var _0xfb76=function(_0x2c12b4,_0x1a17b1){_0x2c12b4=_0x2c12b4-0x0;var _0x3fc1e3=_0xb76f[_0x2c12b4];return _0x3fc1e3;};'use strict';var _=require(_0xfb76('0x0'));var util=require('util');var logger=require(_0xfb76('0x1'))('api');var moment=require(_0xfb76('0x2'));var BPromise=require(_0xfb76('0x3'));var rp=require(_0xfb76('0x4'));var fs=require('fs');var path=require(_0xfb76('0x5'));var rimraf=require(_0xfb76('0x6'));var config=require('../../config/environment');var attributes=require(_0xfb76('0x7'));module['exports']=function(_0x5ae654,_0xbb1fbc){return _0x5ae654[_0xfb76('0x8')](_0xfb76('0x9'),attributes,{'tableName':_0xfb76('0xa'),'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 65fdee7..fd40677 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 _0x02f7=['info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4a759a,_0x2d13dc){var _0x5642e6=function(_0x421f7f){while(--_0x421f7f){_0x4a759a['push'](_0x4a759a['shift']());}};_0x5642e6(++_0x2d13dc);}(_0x02f7,0xd1));var _0x702f=function(_0x47f587,_0x33ec3a){_0x47f587=_0x47f587-0x0;var _0x2a26d3=_0x02f7[_0x47f587];return _0x2a26d3;};'use strict';var _=require(_0x702f('0x0'));var util=require(_0x702f('0x1'));var moment=require(_0x702f('0x2'));var BPromise=require(_0x702f('0x3'));var rs=require(_0x702f('0x4'));var fs=require('fs');var Redis=require(_0x702f('0x5'));var db=require(_0x702f('0x6'))['db'];var utils=require(_0x702f('0x7'));var logger=require(_0x702f('0x8'))(_0x702f('0x9'));var config=require(_0x702f('0xa'));var jayson=require(_0x702f('0xb'));var client=jayson['client'][_0x702f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fb373,_0x1bdd9d,_0x5866c9){return new BPromise(function(_0x29a871,_0x1e94c9){return client[_0x702f('0xd')](_0x2fb373,_0x5866c9)[_0x702f('0xe')](function(_0x1741a4){logger[_0x702f('0xf')](_0x702f('0x10'),_0x1bdd9d,_0x702f('0x11'));logger[_0x702f('0x12')](_0x702f('0x13'),_0x1bdd9d,_0x702f('0x11'),JSON['stringify'](_0x1741a4));if(_0x1741a4[_0x702f('0x14')]){if(_0x1741a4['error']['code']===0x1f4){logger[_0x702f('0x14')](_0x702f('0x10'),_0x1bdd9d,_0x1741a4['error'][_0x702f('0x15')]);return _0x1e94c9(_0x1741a4[_0x702f('0x14')][_0x702f('0x15')]);}logger[_0x702f('0x14')](_0x702f('0x10'),_0x1bdd9d,_0x1741a4[_0x702f('0x14')]['message']);return _0x29a871(_0x1741a4[_0x702f('0x14')][_0x702f('0x15')]);}else{logger[_0x702f('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x1bdd9d,_0x702f('0x11'));_0x29a871(_0x1741a4['result'][_0x702f('0x15')]);}})[_0x702f('0x16')](function(_0x1203e3){logger['error'](_0x702f('0x10'),_0x1bdd9d,_0x1203e3);_0x1e94c9(_0x1203e3);});});}exports[_0x702f('0x17')]=function(_0x402c20){var _0x5679e8=this;return new Promise(function(_0x236796,_0x2e4635){return db[_0x702f('0x18')][_0x702f('0x19')]({'raw':_0x402c20['options']?_0x402c20[_0x702f('0x1a')][_0x702f('0x1b')]===undefined?!![]:![]:!![],'where':_0x402c20[_0x702f('0x1a')]?_0x402c20[_0x702f('0x1a')]['where']||null:null,'attributes':_0x402c20[_0x702f('0x1a')]?_0x402c20[_0x702f('0x1a')]['attributes']||null:null,'include':_0x402c20[_0x702f('0x1a')]?_0x402c20[_0x702f('0x1a')]['include']?_[_0x702f('0x1c')](_0x402c20[_0x702f('0x1a')][_0x702f('0x1d')],function(_0x529729){return{'model':db[_0x529729[_0x702f('0x1e')]],'as':_0x529729['as'],'attributes':_0x529729[_0x702f('0x1f')],'include':_0x529729['include']?_[_0x702f('0x1c')](_0x529729['include'],function(_0x3691e6){return{'model':db[_0x3691e6[_0x702f('0x1e')]],'as':_0x3691e6['as'],'attributes':_0x3691e6[_0x702f('0x1f')],'include':_0x3691e6[_0x702f('0x1d')]?_[_0x702f('0x1c')](_0x3691e6[_0x702f('0x1d')],function(_0x10aeaf){return{'model':db[_0x10aeaf[_0x702f('0x1e')]],'as':_0x10aeaf['as'],'attributes':_0x10aeaf[_0x702f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x702f('0xe')](function(_0x3f58d1){logger[_0x702f('0xf')]('ShowSquareOdbc',_0x402c20);logger[_0x702f('0x12')](_0x702f('0x17'),_0x402c20,JSON['stringify'](_0x3f58d1));_0x236796(_0x3f58d1);})[_0x702f('0x16')](function(_0x3414a8){logger[_0x702f('0x14')]('ShowSquareOdbc',_0x3414a8[_0x702f('0x15')],_0x402c20);_0x2e4635(_0x5679e8['error'](0x1f4,_0x3414a8['message']));});});}; \ No newline at end of file +var _0x18a9=['options','raw','where','attributes','include','map','model','then','debug','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x18a9,0x1ad));var _0x918a=function(_0x3c3ab0,_0x414227){_0x3c3ab0=_0x3c3ab0-0x0;var _0x37630b=_0x18a9[_0x3c3ab0];return _0x37630b;};'use strict';var _=require('lodash');var util=require(_0x918a('0x0'));var moment=require(_0x918a('0x1'));var BPromise=require(_0x918a('0x2'));var rs=require(_0x918a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x918a('0x4'));var config=require(_0x918a('0x5'));var jayson=require(_0x918a('0x6'));var client=jayson[_0x918a('0x7')][_0x918a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18728f,_0x1724bd,_0x4b797e){return new BPromise(function(_0x477776,_0x39e522){return client[_0x918a('0x9')](_0x18728f,_0x4b797e)['then'](function(_0x5daeba){logger[_0x918a('0xa')](_0x918a('0xb'),_0x1724bd,_0x918a('0xc'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1724bd,_0x918a('0xc'),JSON[_0x918a('0xd')](_0x5daeba));if(_0x5daeba[_0x918a('0xe')]){if(_0x5daeba[_0x918a('0xe')][_0x918a('0xf')]===0x1f4){logger['error'](_0x918a('0xb'),_0x1724bd,_0x5daeba[_0x918a('0xe')]['message']);return _0x39e522(_0x5daeba[_0x918a('0xe')][_0x918a('0x10')]);}logger[_0x918a('0xe')](_0x918a('0xb'),_0x1724bd,_0x5daeba[_0x918a('0xe')]['message']);return _0x477776(_0x5daeba[_0x918a('0xe')][_0x918a('0x10')]);}else{logger[_0x918a('0xa')](_0x918a('0xb'),_0x1724bd,_0x918a('0xc'));_0x477776(_0x5daeba['result'][_0x918a('0x10')]);}})[_0x918a('0x11')](function(_0x366d75){logger[_0x918a('0xe')](_0x918a('0xb'),_0x1724bd,_0x366d75);_0x39e522(_0x366d75);});});}exports[_0x918a('0x12')]=function(_0x190a26){var _0x1859eb=this;return new Promise(function(_0x1a1824,_0x58a271){return db[_0x918a('0x13')][_0x918a('0x14')]({'raw':_0x190a26[_0x918a('0x15')]?_0x190a26[_0x918a('0x15')][_0x918a('0x16')]===undefined?!![]:![]:!![],'where':_0x190a26[_0x918a('0x15')]?_0x190a26[_0x918a('0x15')][_0x918a('0x17')]||null:null,'attributes':_0x190a26[_0x918a('0x15')]?_0x190a26[_0x918a('0x15')][_0x918a('0x18')]||null:null,'include':_0x190a26[_0x918a('0x15')]?_0x190a26[_0x918a('0x15')][_0x918a('0x19')]?_[_0x918a('0x1a')](_0x190a26[_0x918a('0x15')][_0x918a('0x19')],function(_0x1a63d9){return{'model':db[_0x1a63d9[_0x918a('0x1b')]],'as':_0x1a63d9['as'],'attributes':_0x1a63d9[_0x918a('0x18')],'include':_0x1a63d9['include']?_['map'](_0x1a63d9['include'],function(_0x579a34){return{'model':db[_0x579a34[_0x918a('0x1b')]],'as':_0x579a34['as'],'attributes':_0x579a34[_0x918a('0x18')],'include':_0x579a34[_0x918a('0x19')]?_['map'](_0x579a34[_0x918a('0x19')],function(_0xc83dd7){return{'model':db[_0xc83dd7[_0x918a('0x1b')]],'as':_0xc83dd7['as'],'attributes':_0xc83dd7[_0x918a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x918a('0x1c')](function(_0x5d4e96){logger[_0x918a('0xa')](_0x918a('0x12'),_0x190a26);logger[_0x918a('0x1d')](_0x918a('0x12'),_0x190a26,JSON['stringify'](_0x5d4e96));_0x1a1824(_0x5d4e96);})[_0x918a('0x11')](function(_0x2b0a8f){logger[_0x918a('0xe')](_0x918a('0x12'),_0x2b0a8f[_0x918a('0x10')],_0x190a26);_0x58a271(_0x1859eb[_0x918a('0xe')](0x1f4,_0x2b0a8f[_0x918a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f63201b..221b67c 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 _0x78e2=['./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','removeUsers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x597be4,_0x27e874){var _0x2b2608=function(_0x37ca34){while(--_0x37ca34){_0x597be4['push'](_0x597be4['shift']());}};_0x2b2608(++_0x27e874);}(_0x78e2,0x1a8));var _0x278e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78e2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x278e('0x0'));var util=require(_0x278e('0x1'));var path=require(_0x278e('0x2'));var timeout=require(_0x278e('0x3'));var express=require(_0x278e('0x4'));var router=express['Router']();var fs_extra=require(_0x278e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x278e('0x6'));var config=require(_0x278e('0x7'));var controller=require(_0x278e('0x8'));router[_0x278e('0x9')]('/',auth[_0x278e('0xa')](),controller[_0x278e('0xb')]);router[_0x278e('0x9')](_0x278e('0xc'),auth[_0x278e('0xa')](),controller[_0x278e('0xd')]);router[_0x278e('0x9')](_0x278e('0xe'),auth[_0x278e('0xa')](),controller[_0x278e('0xf')]);router[_0x278e('0x10')]('/',auth['isAuthenticated'](),controller[_0x278e('0x11')]);router[_0x278e('0x10')](_0x278e('0xe'),auth[_0x278e('0xa')](),controller[_0x278e('0x12')]);router[_0x278e('0x13')](_0x278e('0xc'),auth['isAuthenticated'](),controller[_0x278e('0x14')]);router[_0x278e('0x15')]('/:id',auth[_0x278e('0xa')](),controller['destroy']);router[_0x278e('0x15')]('/:id/users',auth[_0x278e('0xa')](),controller[_0x278e('0x16')]);module[_0x278e('0x17')]=router; \ No newline at end of file +var _0x280b=['fs-extra','./squareProject.controller','get','index','show','/:id/users','getUsers','post','isAuthenticated','put','update','delete','/:id','removeUsers','exports','util','path','Router'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x280b,0x1bf));var _0xb280=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x280b[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xb280('0x0'));var path=require(_0xb280('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb280('0x2')]();var fs_extra=require(_0xb280('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb280('0x4'));router[_0xb280('0x5')]('/',auth['isAuthenticated'](),controller[_0xb280('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb280('0x7')]);router['get'](_0xb280('0x8'),auth['isAuthenticated'](),controller[_0xb280('0x9')]);router[_0xb280('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb280('0xa')]('/:id/users',auth[_0xb280('0xb')](),controller['addUsers']);router[_0xb280('0xc')]('/:id',auth[_0xb280('0xb')](),controller[_0xb280('0xd')]);router[_0xb280('0xe')](_0xb280('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0xb280('0xe')](_0xb280('0x8'),auth['isAuthenticated'](),controller[_0xb280('0x10')]);module[_0xb280('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index fb61d21..8d137f5 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 _0xbb73=['getDataValue','preproduction','toString','production','utf8','DATE','sequelize','exports','name','TEXT','BLOB','long'];(function(_0x4314cf,_0x487b66){var _0x1e4364=function(_0x2b6630){while(--_0x2b6630){_0x4314cf['push'](_0x4314cf['shift']());}};_0x1e4364(++_0x487b66);}(_0xbb73,0x156));var _0x3bb7=function(_0x3d1e0c,_0x2bf06d){_0x3d1e0c=_0x3d1e0c-0x0;var _0x16f0c9=_0xbb73[_0x3d1e0c];return _0x16f0c9;};'use strict';var Sequelize=require(_0x3bb7('0x0'));module[_0x3bb7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3bb7('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x3bb7('0x3')]},'preproduction':{'type':Sequelize[_0x3bb7('0x4')](_0x3bb7('0x5')),'get':function(){if(this[_0x3bb7('0x6')](_0x3bb7('0x7'))){return this[_0x3bb7('0x6')](_0x3bb7('0x7'))[_0x3bb7('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x3bb7('0x4')]('long'),'get':function(){if(this[_0x3bb7('0x6')]('production')){return this[_0x3bb7('0x6')](_0x3bb7('0x9'))['toString'](_0x3bb7('0xa'));}}},'savedAt':{'type':Sequelize[_0x3bb7('0xb')]},'publishedAt':{'type':Sequelize[_0x3bb7('0xb')]}}; \ No newline at end of file +var _0x8cc2=['utf8','getDataValue','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','preproduction','toString'];(function(_0x2f369e,_0x539279){var _0x145b57=function(_0x22b4b0){while(--_0x22b4b0){_0x2f369e['push'](_0x2f369e['shift']());}};_0x145b57(++_0x539279);}(_0x8cc2,0x1d8));var _0x28cc=function(_0x20ae1f,_0x4ae1a5){_0x20ae1f=_0x20ae1f-0x0;var _0x5208c3=_0x8cc2[_0x20ae1f];return _0x5208c3;};'use strict';var Sequelize=require(_0x28cc('0x0'));module[_0x28cc('0x1')]={'name':{'type':Sequelize[_0x28cc('0x2')],'unique':_0x28cc('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x28cc('0x2')]},'notes':{'type':Sequelize[_0x28cc('0x4')]},'preproduction':{'type':Sequelize[_0x28cc('0x5')](_0x28cc('0x6')),'get':function(){if(this['getDataValue'](_0x28cc('0x7'))){return this['getDataValue'](_0x28cc('0x7'))[_0x28cc('0x8')](_0x28cc('0x9'));}}},'production':{'type':Sequelize[_0x28cc('0x5')](_0x28cc('0x6')),'get':function(){if(this[_0x28cc('0xa')](_0x28cc('0xb'))){return this['getDataValue']('production')['toString'](_0x28cc('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x28cc('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c3f731e..a948517 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 _0xfc07=['rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','keys','User','sort','options','getUsers','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','SquareProjects','UserProfileResource','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge','includeAll','include','findAll'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xfc07,0x141));var _0x7fc0=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0xfc07[_0x648163];return _0x199d4d;};'use strict';var emlformat=require(_0x7fc0('0x0'));var rimraf=require(_0x7fc0('0x1'));var zipdir=require(_0x7fc0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fc0('0x3'));var moment=require(_0x7fc0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7fc0('0x5'));var util=require('util');var path=require(_0x7fc0('0x6'));var sox=require(_0x7fc0('0x7'));var csv=require(_0x7fc0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fc0('0x9'));var _=require(_0x7fc0('0xa'));var squel=require(_0x7fc0('0xb'));var crypto=require(_0x7fc0('0xc'));var jsforce=require(_0x7fc0('0xd'));var deskjs=require(_0x7fc0('0xe'));var toCsv=require(_0x7fc0('0x8'));var querystring=require(_0x7fc0('0xf'));var Papa=require(_0x7fc0('0x10'));var Redis=require(_0x7fc0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7fc0('0x12'));var as=require(_0x7fc0('0x13'));var hardwareService=require(_0x7fc0('0x14'));var logger=require(_0x7fc0('0x15'))('api');var utils=require(_0x7fc0('0x16'));var config=require(_0x7fc0('0x17'));var licenseUtil=require(_0x7fc0('0x18'));var db=require(_0x7fc0('0x19'))['db'];config[_0x7fc0('0x1a')]=_['defaults'](config[_0x7fc0('0x1a')],{'host':_0x7fc0('0x1b'),'port':0x18eb});var socket=require(_0x7fc0('0x1c'))(new Redis(config[_0x7fc0('0x1a')]));require(_0x7fc0('0x1d'))[_0x7fc0('0x1e')](socket);function respondWithStatusCode(_0x4e787d,_0x319fc1){_0x319fc1=_0x319fc1||0xcc;return function(_0x5d94b5){if(_0x5d94b5){return _0x4e787d[_0x7fc0('0x1f')](_0x319fc1);}return _0x4e787d[_0x7fc0('0x20')](_0x319fc1)[_0x7fc0('0x21')]();};}function respondWithResult(_0x560700,_0x58db36){_0x58db36=_0x58db36||0xc8;return function(_0x292cb4){if(_0x292cb4){return _0x560700[_0x7fc0('0x20')](_0x58db36)[_0x7fc0('0x22')](_0x292cb4);}};}function respondWithFilteredResult(_0x1384c3,_0x2c4e8a){return function(_0x6ddff8){if(_0x6ddff8){var _0x412be5=typeof _0x2c4e8a[_0x7fc0('0x23')]===_0x7fc0('0x24')&&typeof _0x2c4e8a[_0x7fc0('0x25')]===_0x7fc0('0x24');var _0x1a782f=_0x6ddff8[_0x7fc0('0x26')];var _0x356318=_0x412be5?0x0:_0x2c4e8a[_0x7fc0('0x23')];var _0x39d3d5=_0x412be5?_0x6ddff8[_0x7fc0('0x26')]:_0x2c4e8a[_0x7fc0('0x23')]+_0x2c4e8a['limit'];var _0x248b62;if(_0x39d3d5>=_0x1a782f){_0x39d3d5=_0x1a782f;_0x248b62=0xc8;}else{_0x248b62=0xce;}_0x1384c3['status'](_0x248b62);return _0x1384c3[_0x7fc0('0x27')](_0x7fc0('0x28'),_0x356318+'-'+_0x39d3d5+'/'+_0x1a782f)[_0x7fc0('0x22')](_0x6ddff8);}return null;};}function patchUpdates(_0x2651f9){return function(_0x594953){try{jsonpatch['apply'](_0x594953,_0x2651f9,!![]);}catch(_0x51ef07){return BPromise['reject'](_0x51ef07);}return _0x594953['save']();};}function saveUpdates(_0x39fab3,_0x30758a){return function(_0x2f728c){if(_0x2f728c){return _0x2f728c['update'](_0x39fab3)[_0x7fc0('0x29')](function(_0x48b67a){return _0x48b67a;});}return null;};}function removeEntity(_0x1a9299,_0x355c7b){return function(_0x721b45){if(_0x721b45){return _0x721b45[_0x7fc0('0x2a')]()[_0x7fc0('0x29')](function(){var _0x3eadd9=_0x721b45[_0x7fc0('0x2b')]({'plain':!![]});var _0xe79f44=_0x7fc0('0x2c');return db[_0x7fc0('0x2d')][_0x7fc0('0x2a')]({'where':{'type':_0xe79f44,'resourceId':_0x3eadd9['id']}})[_0x7fc0('0x29')](function(){return _0x721b45;});})[_0x7fc0('0x29')](function(){_0x1a9299[_0x7fc0('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93648f,_0x3d2497){return function(_0x46a6ed){if(!_0x46a6ed){_0x93648f[_0x7fc0('0x1f')](0x194);}return _0x46a6ed;};}function handleError(_0x450fe7,_0x1b4eb1){_0x1b4eb1=_0x1b4eb1||0x1f4;return function(_0x3e4fbb){logger['error'](_0x3e4fbb['stack']);if(_0x3e4fbb[_0x7fc0('0x2e')]){delete _0x3e4fbb['name'];}_0x450fe7[_0x7fc0('0x20')](_0x1b4eb1)[_0x7fc0('0x2f')](_0x3e4fbb);};}exports[_0x7fc0('0x30')]=function(_0x14a938,_0x58a392){var _0x27323c={},_0x543a18={},_0x2da239={'count':0x0,'rows':[]};var _0x4cab2a=_[_0x7fc0('0x31')](db[_0x7fc0('0x32')][_0x7fc0('0x33')],function(_0xfe758a){return{'name':_0xfe758a[_0x7fc0('0x34')],'type':_0xfe758a[_0x7fc0('0x35')][_0x7fc0('0x36')]};});_0x543a18[_0x7fc0('0x37')]=_[_0x7fc0('0x31')](_0x4cab2a,_0x7fc0('0x2e'));_0x543a18[_0x7fc0('0x38')]=_['keys'](_0x14a938['query']);_0x543a18[_0x7fc0('0x39')]=_[_0x7fc0('0x3a')](_0x543a18[_0x7fc0('0x37')],_0x543a18['query']);_0x27323c[_0x7fc0('0x3b')]=_['intersection'](_0x543a18[_0x7fc0('0x37')],qs[_0x7fc0('0x3c')](_0x14a938['query'][_0x7fc0('0x3c')]));_0x27323c[_0x7fc0('0x3b')]=_0x27323c[_0x7fc0('0x3b')][_0x7fc0('0x3d')]?_0x27323c[_0x7fc0('0x3b')]:_0x543a18[_0x7fc0('0x37')];if(!_0x14a938[_0x7fc0('0x38')]['hasOwnProperty'](_0x7fc0('0x3e'))){_0x27323c[_0x7fc0('0x25')]=qs[_0x7fc0('0x25')](_0x14a938[_0x7fc0('0x38')]['limit']);_0x27323c[_0x7fc0('0x23')]=qs[_0x7fc0('0x23')](_0x14a938[_0x7fc0('0x38')][_0x7fc0('0x23')]);}_0x27323c[_0x7fc0('0x3f')]=qs['sort'](_0x14a938['query']['sort']);_0x27323c['where']=qs[_0x7fc0('0x39')](_[_0x7fc0('0x40')](_0x14a938['query'],_0x543a18[_0x7fc0('0x39')]),_0x4cab2a);if(_0x14a938['query'][_0x7fc0('0x41')]){_0x27323c[_0x7fc0('0x42')]=_[_0x7fc0('0x43')](_0x27323c['where'],{'$or':_[_0x7fc0('0x31')](_0x4cab2a,function(_0x4fca02){if(_0x4fca02[_0x7fc0('0x35')]!=='VIRTUAL'){var _0x118d8b={};_0x118d8b[_0x4fca02[_0x7fc0('0x2e')]]={'$like':'%'+_0x14a938['query'][_0x7fc0('0x41')]+'%'};return _0x118d8b;}})});}_0x27323c=_[_0x7fc0('0x43')]({},_0x27323c,_0x14a938['options']);var _0x48ef78={'where':_0x27323c[_0x7fc0('0x42')]};return db[_0x7fc0('0x32')][_0x7fc0('0x26')](_0x48ef78)[_0x7fc0('0x29')](function(_0xf604b8){_0x2da239[_0x7fc0('0x26')]=_0xf604b8;if(_0x14a938[_0x7fc0('0x38')][_0x7fc0('0x44')]){_0x27323c[_0x7fc0('0x45')]=[{'all':!![]}];}return db['SquareProject'][_0x7fc0('0x46')](_0x27323c);})[_0x7fc0('0x29')](function(_0x12120a){_0x2da239[_0x7fc0('0x47')]=_0x12120a;return _0x2da239;})[_0x7fc0('0x29')](respondWithFilteredResult(_0x58a392,_0x27323c))['catch'](handleError(_0x58a392,null));};exports['show']=function(_0x2dc2e0,_0x350b7e){var _0x25aaae={'raw':![],'where':{'id':_0x2dc2e0[_0x7fc0('0x48')]['id']}},_0x36d6c1={};_0x36d6c1[_0x7fc0('0x37')]=_['keys'](db[_0x7fc0('0x32')][_0x7fc0('0x33')]);_0x36d6c1['query']=_['keys'](_0x2dc2e0[_0x7fc0('0x38')]);_0x36d6c1['filters']=_[_0x7fc0('0x3a')](_0x36d6c1[_0x7fc0('0x37')],_0x36d6c1['query']);_0x25aaae['attributes']=_[_0x7fc0('0x3a')](_0x36d6c1[_0x7fc0('0x37')],qs[_0x7fc0('0x3c')](_0x2dc2e0['query'][_0x7fc0('0x3c')]));_0x25aaae['attributes']=_0x25aaae[_0x7fc0('0x3b')][_0x7fc0('0x3d')]?_0x25aaae[_0x7fc0('0x3b')]:_0x36d6c1[_0x7fc0('0x37')];if(_0x2dc2e0[_0x7fc0('0x38')][_0x7fc0('0x44')]){_0x25aaae[_0x7fc0('0x45')]=[{'all':!![]}];}_0x25aaae=_[_0x7fc0('0x43')]({},_0x25aaae,_0x2dc2e0['options']);return db['SquareProject'][_0x7fc0('0x49')](_0x25aaae)['then'](handleEntityNotFound(_0x350b7e,null))[_0x7fc0('0x29')](respondWithResult(_0x350b7e,null))[_0x7fc0('0x4a')](handleError(_0x350b7e,null));};exports[_0x7fc0('0x4b')]=function(_0x1f5eb8,_0x3d52de){return db[_0x7fc0('0x32')][_0x7fc0('0x4b')](_0x1f5eb8[_0x7fc0('0x4c')],{})[_0x7fc0('0x29')](function(_0x53b492){var _0x3d9da4=_0x1f5eb8[_0x7fc0('0x4d')]['get']({'plain':!![]});if(!_0x3d9da4)throw new Error(_0x7fc0('0x4e'));if(_0x3d9da4['role']===_0x7fc0('0x4d')){var _0x4fa251=_0x53b492[_0x7fc0('0x2b')]({'plain':!![]});var _0x593cd3=_0x7fc0('0x2c');return db[_0x7fc0('0x4f')]['find']({'where':{'name':_0x593cd3,'userProfileId':_0x3d9da4[_0x7fc0('0x50')]},'raw':!![]})[_0x7fc0('0x29')](function(_0x51c37d){if(_0x51c37d&&_0x51c37d[_0x7fc0('0x51')]===0x0){return db[_0x7fc0('0x2d')][_0x7fc0('0x4b')]({'name':_0x4fa251['name'],'resourceId':_0x4fa251['id'],'type':_0x51c37d[_0x7fc0('0x2e')],'sectionId':_0x51c37d['id']},{})[_0x7fc0('0x29')](function(){return _0x53b492;});}else{return _0x53b492;}})[_0x7fc0('0x4a')](function(_0x18d0d1){logger[_0x7fc0('0x52')](_0x7fc0('0x53'),_0x18d0d1);throw _0x18d0d1;});}return _0x53b492;})[_0x7fc0('0x29')](respondWithResult(_0x3d52de,0xc9))[_0x7fc0('0x4a')](handleError(_0x3d52de,null));};exports[_0x7fc0('0x54')]=function(_0x449374,_0x30fb1e){if(_0x449374['body']['id']){delete _0x449374[_0x7fc0('0x4c')]['id'];}return db['SquareProject'][_0x7fc0('0x49')]({'where':{'id':_0x449374['params']['id']}})[_0x7fc0('0x29')](handleEntityNotFound(_0x30fb1e,null))['then'](saveUpdates(_0x449374[_0x7fc0('0x4c')],null))[_0x7fc0('0x29')](respondWithResult(_0x30fb1e,null))['catch'](handleError(_0x30fb1e,null));};exports['destroy']=function(_0x5a9b6a,_0x3438ec){return db[_0x7fc0('0x32')]['find']({'where':{'id':_0x5a9b6a[_0x7fc0('0x48')]['id']}})[_0x7fc0('0x29')](handleEntityNotFound(_0x3438ec,null))[_0x7fc0('0x29')](removeEntity(_0x3438ec,null))['catch'](handleError(_0x3438ec,null));};exports['addUsers']=function(_0x255499,_0xb33eba,_0x114688){return db['SquareProject']['find']({'where':{'id':_0x255499[_0x7fc0('0x48')]['id']}})[_0x7fc0('0x29')](handleEntityNotFound(_0xb33eba,null))[_0x7fc0('0x29')](function(_0x18e7f0){if(_0x18e7f0){return _0x18e7f0[_0x7fc0('0x55')](_0x255499[_0x7fc0('0x4c')][_0x7fc0('0x56')],_[_0x7fc0('0x57')](_0x255499[_0x7fc0('0x4c')],[_0x7fc0('0x56'),'id'])||{});}})['then'](respondWithResult(_0xb33eba,null))['catch'](handleError(_0xb33eba,null));};exports[_0x7fc0('0x58')]=function(_0x3bc3ba,_0x355eaf,_0x1c94d0){return db['SquareProject'][_0x7fc0('0x49')]({'where':{'id':_0x3bc3ba[_0x7fc0('0x48')]['id']}})[_0x7fc0('0x29')](handleEntityNotFound(_0x355eaf,null))[_0x7fc0('0x29')](function(_0x5e2776){if(_0x5e2776){return _0x5e2776[_0x7fc0('0x58')](_0x3bc3ba[_0x7fc0('0x38')]['ids'])[_0x7fc0('0x29')](function(){if(_[_0x7fc0('0x59')](_0x3bc3ba[_0x7fc0('0x38')]['ids'])){for(var _0xc10903=0x0;_0xc10903<_0x3bc3ba[_0x7fc0('0x38')]['ids'][_0x7fc0('0x3d')];_0xc10903+=0x1){socket[_0x7fc0('0x5a')](_0x7fc0('0x5b'),{'UserId':Number(_0x3bc3ba['query']['ids'][_0xc10903]),'SquareProjectId':Number(_0x3bc3ba[_0x7fc0('0x48')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x3bc3ba['query'][_0x7fc0('0x56')]),'SquareProjectId':Number(_0x3bc3ba[_0x7fc0('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x355eaf,null))[_0x7fc0('0x4a')](handleError(_0x355eaf,null));};exports['getUsers']=function(_0x3571ff,_0x1808af,_0x426ba2){var _0x3e2d3d={};var _0x26ebfd={};var _0x417148;var _0x596788;return db['SquareProject'][_0x7fc0('0x5c')]({'where':{'id':_0x3571ff['params']['id']}})[_0x7fc0('0x29')](handleEntityNotFound(_0x1808af,null))[_0x7fc0('0x29')](function(_0x5585bb){if(_0x5585bb){_0x417148=_0x5585bb;_0x26ebfd['model']=_[_0x7fc0('0x5d')](db[_0x7fc0('0x5e')][_0x7fc0('0x33')]);_0x26ebfd[_0x7fc0('0x38')]=_['keys'](_0x3571ff[_0x7fc0('0x38')]);_0x26ebfd['filters']=_['intersection'](_0x26ebfd[_0x7fc0('0x37')],_0x26ebfd[_0x7fc0('0x38')]);_0x3e2d3d[_0x7fc0('0x3b')]=_[_0x7fc0('0x3a')](_0x26ebfd[_0x7fc0('0x37')],qs[_0x7fc0('0x3c')](_0x3571ff[_0x7fc0('0x38')][_0x7fc0('0x3c')]));_0x3e2d3d[_0x7fc0('0x3b')]=_0x3e2d3d[_0x7fc0('0x3b')][_0x7fc0('0x3d')]?_0x3e2d3d[_0x7fc0('0x3b')]:_0x26ebfd['model'];_0x3e2d3d[_0x7fc0('0x3f')]=qs[_0x7fc0('0x5f')](_0x3571ff[_0x7fc0('0x38')][_0x7fc0('0x5f')]);_0x3e2d3d[_0x7fc0('0x42')]=qs[_0x7fc0('0x39')](_['pick'](_0x3571ff[_0x7fc0('0x38')],_0x26ebfd[_0x7fc0('0x39')]));if(_0x3571ff[_0x7fc0('0x38')][_0x7fc0('0x41')]){_0x3e2d3d['where']=_[_0x7fc0('0x43')](_0x3e2d3d['where'],{'$or':_[_0x7fc0('0x31')](_0x3e2d3d['attributes'],function(_0x3de824){var _0x536334={};_0x536334[_0x3de824]={'$like':'%'+_0x3571ff[_0x7fc0('0x38')][_0x7fc0('0x41')]+'%'};return _0x536334;})});}_0x3e2d3d=_[_0x7fc0('0x43')]({},_0x3e2d3d,_0x3571ff[_0x7fc0('0x60')]);return _0x417148['getUsers'](_0x3e2d3d);}})[_0x7fc0('0x29')](function(_0x398dee){if(_0x398dee){_0x596788=_0x398dee[_0x7fc0('0x3d')];if(!_0x3571ff['query']['hasOwnProperty'](_0x7fc0('0x3e'))){_0x3e2d3d[_0x7fc0('0x25')]=qs[_0x7fc0('0x25')](_0x3571ff[_0x7fc0('0x38')][_0x7fc0('0x25')]);_0x3e2d3d[_0x7fc0('0x23')]=qs[_0x7fc0('0x23')](_0x3571ff[_0x7fc0('0x38')][_0x7fc0('0x23')]);}return _0x417148[_0x7fc0('0x61')](_0x3e2d3d);}})[_0x7fc0('0x29')](function(_0x2933ec){if(_0x2933ec){return _0x2933ec?{'count':_0x596788,'rows':_0x2933ec}:null;}})[_0x7fc0('0x29')](respondWithResult(_0x1808af,null))[_0x7fc0('0x4a')](handleError(_0x1808af,null));}; \ No newline at end of file +var _0x1f24=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','SquareProjects','sendStatus','error','stack','send','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','SquareProject','rows','show','params','length','include','options','find','catch','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f24,0x72));var _0x41f2=function(_0x15968f,_0x56deb6){_0x15968f=_0x15968f-0x0;var _0x41f960=_0x1f24[_0x15968f];return _0x41f960;};'use strict';var emlformat=require(_0x41f2('0x0'));var rimraf=require(_0x41f2('0x1'));var zipdir=require(_0x41f2('0x2'));var jsonpatch=require(_0x41f2('0x3'));var rp=require(_0x41f2('0x4'));var moment=require(_0x41f2('0x5'));var BPromise=require(_0x41f2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x41f2('0x7'));var sox=require(_0x41f2('0x8'));var csv=require(_0x41f2('0x9'));var ejs=require(_0x41f2('0xa'));var fs=require('fs');var fs_extra=require(_0x41f2('0xb'));var _=require(_0x41f2('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x41f2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x41f2('0x9'));var querystring=require(_0x41f2('0xe'));var Papa=require(_0x41f2('0xf'));var Redis=require(_0x41f2('0x10'));var authService=require(_0x41f2('0x11'));var qs=require(_0x41f2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41f2('0x13'));var logger=require(_0x41f2('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x41f2('0x15'))['db'];config[_0x41f2('0x16')]=_[_0x41f2('0x17')](config[_0x41f2('0x16')],{'host':_0x41f2('0x18'),'port':0x18eb});var socket=require(_0x41f2('0x19'))(new Redis(config['redis']));require('./squareProject.socket')[_0x41f2('0x1a')](socket);function respondWithStatusCode(_0x45c8ec,_0x3aa3ed){_0x3aa3ed=_0x3aa3ed||0xcc;return function(_0x49f1b4){if(_0x49f1b4){return _0x45c8ec['sendStatus'](_0x3aa3ed);}return _0x45c8ec['status'](_0x3aa3ed)[_0x41f2('0x1b')]();};}function respondWithResult(_0x619af0,_0x52f931){_0x52f931=_0x52f931||0xc8;return function(_0x24abac){if(_0x24abac){return _0x619af0[_0x41f2('0x1c')](_0x52f931)[_0x41f2('0x1d')](_0x24abac);}};}function respondWithFilteredResult(_0x14ac0a,_0x2f1e61){return function(_0x1555cf){if(_0x1555cf){var _0x5deb6b=typeof _0x2f1e61[_0x41f2('0x1e')]==='undefined'&&typeof _0x2f1e61[_0x41f2('0x1f')]===_0x41f2('0x20');var _0x4d135f=_0x1555cf[_0x41f2('0x21')];var _0x284210=_0x5deb6b?0x0:_0x2f1e61['offset'];var _0x341d40=_0x5deb6b?_0x1555cf[_0x41f2('0x21')]:_0x2f1e61[_0x41f2('0x1e')]+_0x2f1e61['limit'];var _0x5875da;if(_0x341d40>=_0x4d135f){_0x341d40=_0x4d135f;_0x5875da=0xc8;}else{_0x5875da=0xce;}_0x14ac0a[_0x41f2('0x1c')](_0x5875da);return _0x14ac0a[_0x41f2('0x22')](_0x41f2('0x23'),_0x284210+'-'+_0x341d40+'/'+_0x4d135f)['json'](_0x1555cf);}return null;};}function patchUpdates(_0x5b787c){return function(_0x492d67){try{jsonpatch[_0x41f2('0x24')](_0x492d67,_0x5b787c,!![]);}catch(_0x1d5299){return BPromise[_0x41f2('0x25')](_0x1d5299);}return _0x492d67[_0x41f2('0x26')]();};}function saveUpdates(_0x1118c7,_0x2322f2){return function(_0x2dcc1b){if(_0x2dcc1b){return _0x2dcc1b[_0x41f2('0x27')](_0x1118c7)['then'](function(_0x441559){return _0x441559;});}return null;};}function removeEntity(_0x5e09dd,_0x500b83){return function(_0x1e113a){if(_0x1e113a){return _0x1e113a[_0x41f2('0x28')]()[_0x41f2('0x29')](function(){var _0x56b9fc=_0x1e113a[_0x41f2('0x2a')]({'plain':!![]});var _0x21082a=_0x41f2('0x2b');return db['UserProfileResource'][_0x41f2('0x28')]({'where':{'type':_0x21082a,'resourceId':_0x56b9fc['id']}})[_0x41f2('0x29')](function(){return _0x1e113a;});})[_0x41f2('0x29')](function(){_0x5e09dd[_0x41f2('0x1c')](0xcc)[_0x41f2('0x1b')]();});}};}function handleEntityNotFound(_0x39010f,_0x160fe3){return function(_0x4e0a7e){if(!_0x4e0a7e){_0x39010f[_0x41f2('0x2c')](0x194);}return _0x4e0a7e;};}function handleError(_0x303e0f,_0x111fa2){_0x111fa2=_0x111fa2||0x1f4;return function(_0x2afee4){logger[_0x41f2('0x2d')](_0x2afee4[_0x41f2('0x2e')]);if(_0x2afee4['name']){delete _0x2afee4['name'];}_0x303e0f[_0x41f2('0x1c')](_0x111fa2)[_0x41f2('0x2f')](_0x2afee4);};}exports['index']=function(_0x1750a0,_0x40b61d){var _0x5f1b6c={},_0x3eb700={},_0x1c36ec={'count':0x0,'rows':[]};var _0x4d324d=_[_0x41f2('0x30')](db['SquareProject'][_0x41f2('0x31')],function(_0x20c383){return{'name':_0x20c383['fieldName'],'type':_0x20c383[_0x41f2('0x32')][_0x41f2('0x33')]};});_0x3eb700[_0x41f2('0x34')]=_[_0x41f2('0x30')](_0x4d324d,_0x41f2('0x35'));_0x3eb700[_0x41f2('0x36')]=_[_0x41f2('0x37')](_0x1750a0['query']);_0x3eb700[_0x41f2('0x38')]=_[_0x41f2('0x39')](_0x3eb700[_0x41f2('0x34')],_0x3eb700[_0x41f2('0x36')]);_0x5f1b6c[_0x41f2('0x3a')]=_[_0x41f2('0x39')](_0x3eb700['model'],qs['fields'](_0x1750a0[_0x41f2('0x36')][_0x41f2('0x3b')]));_0x5f1b6c['attributes']=_0x5f1b6c[_0x41f2('0x3a')]['length']?_0x5f1b6c[_0x41f2('0x3a')]:_0x3eb700['model'];if(!_0x1750a0[_0x41f2('0x36')][_0x41f2('0x3c')](_0x41f2('0x3d'))){_0x5f1b6c[_0x41f2('0x1f')]=qs['limit'](_0x1750a0['query']['limit']);_0x5f1b6c['offset']=qs[_0x41f2('0x1e')](_0x1750a0['query'][_0x41f2('0x1e')]);}_0x5f1b6c[_0x41f2('0x3e')]=qs[_0x41f2('0x3f')](_0x1750a0[_0x41f2('0x36')][_0x41f2('0x3f')]);_0x5f1b6c[_0x41f2('0x40')]=qs[_0x41f2('0x38')](_[_0x41f2('0x41')](_0x1750a0[_0x41f2('0x36')],_0x3eb700[_0x41f2('0x38')]),_0x4d324d);if(_0x1750a0[_0x41f2('0x36')][_0x41f2('0x42')]){_0x5f1b6c[_0x41f2('0x40')]=_[_0x41f2('0x43')](_0x5f1b6c[_0x41f2('0x40')],{'$or':_[_0x41f2('0x30')](_0x4d324d,function(_0x2e1da6){if(_0x2e1da6[_0x41f2('0x32')]!==_0x41f2('0x44')){var _0x2c7186={};_0x2c7186[_0x2e1da6[_0x41f2('0x35')]]={'$like':'%'+_0x1750a0['query']['filter']+'%'};return _0x2c7186;}})});}_0x5f1b6c=_['merge']({},_0x5f1b6c,_0x1750a0['options']);var _0x2d4f66={'where':_0x5f1b6c['where']};return db['SquareProject'][_0x41f2('0x21')](_0x2d4f66)['then'](function(_0x45470b){_0x1c36ec['count']=_0x45470b;if(_0x1750a0[_0x41f2('0x36')][_0x41f2('0x45')]){_0x5f1b6c['include']=[{'all':!![]}];}return db[_0x41f2('0x46')]['findAll'](_0x5f1b6c);})[_0x41f2('0x29')](function(_0x35830d){_0x1c36ec[_0x41f2('0x47')]=_0x35830d;return _0x1c36ec;})['then'](respondWithFilteredResult(_0x40b61d,_0x5f1b6c))['catch'](handleError(_0x40b61d,null));};exports[_0x41f2('0x48')]=function(_0x163327,_0x2b8250){var _0xe6ff78={'raw':![],'where':{'id':_0x163327[_0x41f2('0x49')]['id']}},_0x3a3ee6={};_0x3a3ee6[_0x41f2('0x34')]=_[_0x41f2('0x37')](db[_0x41f2('0x46')][_0x41f2('0x31')]);_0x3a3ee6['query']=_[_0x41f2('0x37')](_0x163327[_0x41f2('0x36')]);_0x3a3ee6['filters']=_[_0x41f2('0x39')](_0x3a3ee6[_0x41f2('0x34')],_0x3a3ee6[_0x41f2('0x36')]);_0xe6ff78[_0x41f2('0x3a')]=_['intersection'](_0x3a3ee6[_0x41f2('0x34')],qs[_0x41f2('0x3b')](_0x163327[_0x41f2('0x36')][_0x41f2('0x3b')]));_0xe6ff78[_0x41f2('0x3a')]=_0xe6ff78[_0x41f2('0x3a')][_0x41f2('0x4a')]?_0xe6ff78[_0x41f2('0x3a')]:_0x3a3ee6[_0x41f2('0x34')];if(_0x163327[_0x41f2('0x36')][_0x41f2('0x45')]){_0xe6ff78[_0x41f2('0x4b')]=[{'all':!![]}];}_0xe6ff78=_[_0x41f2('0x43')]({},_0xe6ff78,_0x163327[_0x41f2('0x4c')]);return db['SquareProject'][_0x41f2('0x4d')](_0xe6ff78)[_0x41f2('0x29')](handleEntityNotFound(_0x2b8250,null))[_0x41f2('0x29')](respondWithResult(_0x2b8250,null))[_0x41f2('0x4e')](handleError(_0x2b8250,null));};exports[_0x41f2('0x4f')]=function(_0x28bd48,_0x19d193){return db[_0x41f2('0x46')][_0x41f2('0x4f')](_0x28bd48[_0x41f2('0x50')],{})[_0x41f2('0x29')](function(_0x5e48d6){var _0x290103=_0x28bd48[_0x41f2('0x51')][_0x41f2('0x2a')]({'plain':!![]});if(!_0x290103)throw new Error(_0x41f2('0x52'));if(_0x290103[_0x41f2('0x53')]==='user'){var _0x4069d4=_0x5e48d6[_0x41f2('0x2a')]({'plain':!![]});var _0x15930e=_0x41f2('0x2b');return db[_0x41f2('0x54')]['find']({'where':{'name':_0x15930e,'userProfileId':_0x290103['userProfileId']},'raw':!![]})[_0x41f2('0x29')](function(_0x48ca54){if(_0x48ca54&&_0x48ca54[_0x41f2('0x55')]===0x0){return db[_0x41f2('0x56')][_0x41f2('0x4f')]({'name':_0x4069d4[_0x41f2('0x35')],'resourceId':_0x4069d4['id'],'type':_0x48ca54['name'],'sectionId':_0x48ca54['id']},{})[_0x41f2('0x29')](function(){return _0x5e48d6;});}else{return _0x5e48d6;}})['catch'](function(_0x3e4fe8){logger[_0x41f2('0x2d')](_0x41f2('0x57'),_0x3e4fe8);throw _0x3e4fe8;});}return _0x5e48d6;})[_0x41f2('0x29')](respondWithResult(_0x19d193,0xc9))[_0x41f2('0x4e')](handleError(_0x19d193,null));};exports['update']=function(_0x46b1f7,_0x29833a){if(_0x46b1f7['body']['id']){delete _0x46b1f7[_0x41f2('0x50')]['id'];}return db[_0x41f2('0x46')][_0x41f2('0x4d')]({'where':{'id':_0x46b1f7['params']['id']}})[_0x41f2('0x29')](handleEntityNotFound(_0x29833a,null))['then'](saveUpdates(_0x46b1f7[_0x41f2('0x50')],null))[_0x41f2('0x29')](respondWithResult(_0x29833a,null))[_0x41f2('0x4e')](handleError(_0x29833a,null));};exports[_0x41f2('0x28')]=function(_0x4b5104,_0x10d5de){return db['SquareProject']['find']({'where':{'id':_0x4b5104[_0x41f2('0x49')]['id']}})[_0x41f2('0x29')](handleEntityNotFound(_0x10d5de,null))['then'](removeEntity(_0x10d5de,null))[_0x41f2('0x4e')](handleError(_0x10d5de,null));};exports[_0x41f2('0x58')]=function(_0x58a406,_0x3eaf2f,_0x502fbd){return db[_0x41f2('0x46')][_0x41f2('0x4d')]({'where':{'id':_0x58a406[_0x41f2('0x49')]['id']}})[_0x41f2('0x29')](handleEntityNotFound(_0x3eaf2f,null))[_0x41f2('0x29')](function(_0x455c30){if(_0x455c30){return _0x455c30[_0x41f2('0x58')](_0x58a406[_0x41f2('0x50')][_0x41f2('0x59')],_[_0x41f2('0x5a')](_0x58a406[_0x41f2('0x50')],[_0x41f2('0x59'),'id'])||{});}})['then'](respondWithResult(_0x3eaf2f,null))[_0x41f2('0x4e')](handleError(_0x3eaf2f,null));};exports[_0x41f2('0x5b')]=function(_0x45c4a7,_0x59a0dd,_0x1bf99f){return db['SquareProject'][_0x41f2('0x4d')]({'where':{'id':_0x45c4a7['params']['id']}})[_0x41f2('0x29')](handleEntityNotFound(_0x59a0dd,null))[_0x41f2('0x29')](function(_0x2b8356){if(_0x2b8356){return _0x2b8356[_0x41f2('0x5b')](_0x45c4a7[_0x41f2('0x36')]['ids'])[_0x41f2('0x29')](function(){if(_[_0x41f2('0x5c')](_0x45c4a7[_0x41f2('0x36')]['ids'])){for(var _0x4003c5=0x0;_0x4003c5<_0x45c4a7[_0x41f2('0x36')][_0x41f2('0x59')][_0x41f2('0x4a')];_0x4003c5+=0x1){socket[_0x41f2('0x5d')](_0x41f2('0x5e'),{'UserId':Number(_0x45c4a7[_0x41f2('0x36')][_0x41f2('0x59')][_0x4003c5]),'SquareProjectId':Number(_0x45c4a7[_0x41f2('0x49')]['id'])});}}else{socket['emit'](_0x41f2('0x5e'),{'UserId':Number(_0x45c4a7['query'][_0x41f2('0x59')]),'SquareProjectId':Number(_0x45c4a7[_0x41f2('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x59a0dd,null))[_0x41f2('0x4e')](handleError(_0x59a0dd,null));};exports['getUsers']=function(_0x93cd02,_0x59915c,_0x126095){var _0x90bcaa={};var _0x49a54f={};var _0x477c07;var _0x506ed4;return db[_0x41f2('0x46')][_0x41f2('0x5f')]({'where':{'id':_0x93cd02[_0x41f2('0x49')]['id']}})['then'](handleEntityNotFound(_0x59915c,null))[_0x41f2('0x29')](function(_0x3b0a32){if(_0x3b0a32){_0x477c07=_0x3b0a32;_0x49a54f[_0x41f2('0x34')]=_[_0x41f2('0x37')](db['User'][_0x41f2('0x31')]);_0x49a54f[_0x41f2('0x36')]=_['keys'](_0x93cd02['query']);_0x49a54f[_0x41f2('0x38')]=_['intersection'](_0x49a54f[_0x41f2('0x34')],_0x49a54f[_0x41f2('0x36')]);_0x90bcaa[_0x41f2('0x3a')]=_[_0x41f2('0x39')](_0x49a54f[_0x41f2('0x34')],qs['fields'](_0x93cd02['query']['fields']));_0x90bcaa['attributes']=_0x90bcaa[_0x41f2('0x3a')]['length']?_0x90bcaa[_0x41f2('0x3a')]:_0x49a54f[_0x41f2('0x34')];_0x90bcaa[_0x41f2('0x3e')]=qs['sort'](_0x93cd02[_0x41f2('0x36')][_0x41f2('0x3f')]);_0x90bcaa['where']=qs['filters'](_[_0x41f2('0x41')](_0x93cd02['query'],_0x49a54f[_0x41f2('0x38')]));if(_0x93cd02[_0x41f2('0x36')][_0x41f2('0x42')]){_0x90bcaa[_0x41f2('0x40')]=_[_0x41f2('0x43')](_0x90bcaa['where'],{'$or':_[_0x41f2('0x30')](_0x90bcaa[_0x41f2('0x3a')],function(_0x4b027f){var _0x58c3a8={};_0x58c3a8[_0x4b027f]={'$like':'%'+_0x93cd02['query'][_0x41f2('0x42')]+'%'};return _0x58c3a8;})});}_0x90bcaa=_['merge']({},_0x90bcaa,_0x93cd02[_0x41f2('0x4c')]);return _0x477c07['getUsers'](_0x90bcaa);}})[_0x41f2('0x29')](function(_0x2b4d7e){if(_0x2b4d7e){_0x506ed4=_0x2b4d7e['length'];if(!_0x93cd02[_0x41f2('0x36')][_0x41f2('0x3c')](_0x41f2('0x3d'))){_0x90bcaa[_0x41f2('0x1f')]=qs[_0x41f2('0x1f')](_0x93cd02[_0x41f2('0x36')]['limit']);_0x90bcaa[_0x41f2('0x1e')]=qs[_0x41f2('0x1e')](_0x93cd02['query']['offset']);}return _0x477c07[_0x41f2('0x60')](_0x90bcaa);}})['then'](function(_0x58ca82){if(_0x58ca82){return _0x58ca82?{'count':_0x506ed4,'rows':_0x58ca82}:null;}})[_0x41f2('0x29')](respondWithResult(_0x59915c,null))[_0x41f2('0x4e')](handleError(_0x59915c,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index bdff71e..2585604 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 _0xd729=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x272d8a,_0x45184b){var _0x26286e=function(_0x93beaa){while(--_0x93beaa){_0x272d8a['push'](_0x272d8a['shift']());}};_0x26286e(++_0x45184b);}(_0xd729,0xd0));var _0x9d72=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd729[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x9d72('0x0'));var SquareProject=require(_0x9d72('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x9d72('0x2')](0x0);var events={'afterCreate':_0x9d72('0x3'),'afterUpdate':_0x9d72('0x4'),'afterDestroy':_0x9d72('0x5')};function emitEvent(_0x41d3b6){return function(_0x4b2216,_0x2ac357,_0x3e9354){SquareProjectEvents[_0x9d72('0x6')](_0x41d3b6+':'+_0x4b2216['id'],_0x4b2216);SquareProjectEvents[_0x9d72('0x6')](_0x41d3b6,_0x4b2216);_0x3e9354(null);};}for(var e in events){if(events[_0x9d72('0x7')](e)){var event=events[e];SquareProject[_0x9d72('0x8')](e,emitEvent(event));}}module[_0x9d72('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xdce2=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x4d5b81,_0x70fab0){var _0x1b0524=function(_0x21edf8){while(--_0x21edf8){_0x4d5b81['push'](_0x4d5b81['shift']());}};_0x1b0524(++_0x70fab0);}(_0xdce2,0x97));var _0x2dce=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xdce2[_0x368fb9];return _0x4892fb;};'use strict';var EventEmitter=require(_0x2dce('0x0'));var SquareProject=require(_0x2dce('0x1'))['db'][_0x2dce('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2dce('0x3')](0x0);var events={'afterCreate':_0x2dce('0x4'),'afterUpdate':_0x2dce('0x5'),'afterDestroy':_0x2dce('0x6')};function emitEvent(_0x419638){return function(_0x4672c3,_0x2386f3,_0x5ae8cb){SquareProjectEvents[_0x2dce('0x7')](_0x419638+':'+_0x4672c3['id'],_0x4672c3);SquareProjectEvents[_0x2dce('0x7')](_0x419638,_0x4672c3);_0x5ae8cb(null);};}for(var e in events){if(events[_0x2dce('0x8')](e)){var event=events[e];SquareProject[_0x2dce('0x9')](e,emitEvent(event));}}module[_0x2dce('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index a0e3c8f..26f335b 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 _0x6f58=['publishedAt','lodash','util','moment','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x2c6717,_0x240ba5){var _0x5395f6=function(_0x4184c5){while(--_0x4184c5){_0x2c6717['push'](_0x2c6717['shift']());}};_0x5395f6(++_0x240ba5);}(_0x6f58,0xc1));var _0x86f5=function(_0x521e76,_0x5c0d1f){_0x521e76=_0x521e76-0x0;var _0x34ab74=_0x6f58[_0x521e76];return _0x34ab74;};'use strict';var _=require(_0x86f5('0x0'));var util=require(_0x86f5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x86f5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x86f5('0x3'));var rimraf=require(_0x86f5('0x4'));var config=require('../../config/environment');var attributes=require(_0x86f5('0x5'));module[_0x86f5('0x6')]=function(_0x5c3e6a,_0x22601f){return _0x5c3e6a[_0x86f5('0x7')](_0x86f5('0x8'),attributes,{'tableName':_0x86f5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29b4f1,_0x15f182,_0x1ad835){if(_0x29b4f1[_0x86f5('0xa')](_0x86f5('0xb'))){_0x29b4f1['savedAt']=moment()[_0x86f5('0xc')](_0x86f5('0xd'));}if(_0x29b4f1[_0x86f5('0xa')](_0x86f5('0xe'))){_0x29b4f1[_0x86f5('0xf')]=moment()[_0x86f5('0xc')](_0x86f5('0xd'));}_0x1ad835(null,_0x29b4f1);}}});}; \ No newline at end of file +var _0xdd5d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util'];(function(_0x29cf79,_0x55f37c){var _0x5c9eae=function(_0x7a326c){while(--_0x7a326c){_0x29cf79['push'](_0x29cf79['shift']());}};_0x5c9eae(++_0x55f37c);}(_0xdd5d,0xda));var _0xddd5=function(_0x110bd6,_0x338f31){_0x110bd6=_0x110bd6-0x0;var _0x930d69=_0xdd5d[_0x110bd6];return _0x930d69;};'use strict';var _=require(_0xddd5('0x0'));var util=require(_0xddd5('0x1'));var logger=require(_0xddd5('0x2'))(_0xddd5('0x3'));var moment=require(_0xddd5('0x4'));var BPromise=require(_0xddd5('0x5'));var rp=require(_0xddd5('0x6'));var fs=require('fs');var path=require(_0xddd5('0x7'));var rimraf=require(_0xddd5('0x8'));var config=require(_0xddd5('0x9'));var attributes=require(_0xddd5('0xa'));module['exports']=function(_0x5c2660,_0x4823ad){return _0x5c2660[_0xddd5('0xb')](_0xddd5('0xc'),attributes,{'tableName':_0xddd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x365a21,_0x1f4907,_0x496d47){if(_0x365a21[_0xddd5('0xe')](_0xddd5('0xf'))){_0x365a21['savedAt']=moment()[_0xddd5('0x10')](_0xddd5('0x11'));}if(_0x365a21['changed'](_0xddd5('0x12'))){_0x365a21[_0xddd5('0x13')]=moment()[_0xddd5('0x10')](_0xddd5('0x11'));}_0x496d47(null,_0x365a21);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0a90bae..b76b716 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 _0x58ed=['options','raw','where','attributes','include','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareProject','SquareProject','find'];(function(_0x24b094,_0x33e07c){var _0xc6c2b9=function(_0x13c30e){while(--_0x13c30e){_0x24b094['push'](_0x24b094['shift']());}};_0xc6c2b9(++_0x33e07c);}(_0x58ed,0xc4));var _0xd58e=function(_0xc537d2,_0x565315){_0xc537d2=_0xc537d2-0x0;var _0x35aac4=_0x58ed[_0xc537d2];return _0x35aac4;};'use strict';var _=require(_0xd58e('0x0'));var util=require(_0xd58e('0x1'));var moment=require(_0xd58e('0x2'));var BPromise=require('bluebird');var rs=require(_0xd58e('0x3'));var fs=require('fs');var Redis=require(_0xd58e('0x4'));var db=require(_0xd58e('0x5'))['db'];var utils=require(_0xd58e('0x6'));var logger=require(_0xd58e('0x7'))(_0xd58e('0x8'));var config=require(_0xd58e('0x9'));var jayson=require(_0xd58e('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xd58e('0xb')]=_[_0xd58e('0xc')](config[_0xd58e('0xb')],{'host':_0xd58e('0xd'),'port':0x18eb});var socket=require(_0xd58e('0xe'))(new Redis(config[_0xd58e('0xb')]));require(_0xd58e('0xf'))[_0xd58e('0x10')](socket);function respondWithRpcPromise(_0x428b43,_0x33d1a9,_0x1fa6f0){return new BPromise(function(_0x59bda3,_0x1da426){return client[_0xd58e('0x11')](_0x428b43,_0x1fa6f0)['then'](function(_0x4155c0){logger['info'](_0xd58e('0x12'),_0x33d1a9,_0xd58e('0x13'));logger[_0xd58e('0x14')](_0xd58e('0x15'),_0x33d1a9,_0xd58e('0x13'),JSON[_0xd58e('0x16')](_0x4155c0));if(_0x4155c0['error']){if(_0x4155c0[_0xd58e('0x17')][_0xd58e('0x18')]===0x1f4){logger['error'](_0xd58e('0x12'),_0x33d1a9,_0x4155c0[_0xd58e('0x17')]['message']);return _0x1da426(_0x4155c0[_0xd58e('0x17')][_0xd58e('0x19')]);}logger[_0xd58e('0x17')](_0xd58e('0x12'),_0x33d1a9,_0x4155c0[_0xd58e('0x17')][_0xd58e('0x19')]);return _0x59bda3(_0x4155c0[_0xd58e('0x17')][_0xd58e('0x19')]);}else{logger[_0xd58e('0x1a')]('SquareProject,\x20%s,\x20%s',_0x33d1a9,'request\x20sent');_0x59bda3(_0x4155c0[_0xd58e('0x1b')]['message']);}})[_0xd58e('0x1c')](function(_0x47d060){logger[_0xd58e('0x17')](_0xd58e('0x12'),_0x33d1a9,_0x47d060);_0x1da426(_0x47d060);});});}exports[_0xd58e('0x1d')]=function(_0x15789){var _0xa72aab=this;return new Promise(function(_0xbfe882,_0x2aac15){return db[_0xd58e('0x1e')][_0xd58e('0x1f')]({'raw':_0x15789[_0xd58e('0x20')]?_0x15789['options'][_0xd58e('0x21')]===undefined?!![]:![]:!![],'where':_0x15789[_0xd58e('0x20')]?_0x15789[_0xd58e('0x20')][_0xd58e('0x22')]||null:null,'attributes':_0x15789['options']?_0x15789['options'][_0xd58e('0x23')]||null:null,'include':_0x15789[_0xd58e('0x20')]?_0x15789[_0xd58e('0x20')][_0xd58e('0x24')]?_['map'](_0x15789['options'][_0xd58e('0x24')],function(_0x1a0259){return{'model':db[_0x1a0259['model']],'as':_0x1a0259['as'],'attributes':_0x1a0259[_0xd58e('0x23')],'include':_0x1a0259[_0xd58e('0x24')]?_[_0xd58e('0x25')](_0x1a0259['include'],function(_0x2f76da){return{'model':db[_0x2f76da['model']],'as':_0x2f76da['as'],'attributes':_0x2f76da[_0xd58e('0x23')],'include':_0x2f76da['include']?_[_0xd58e('0x25')](_0x2f76da['include'],function(_0x1e2589){return{'model':db[_0x1e2589['model']],'as':_0x1e2589['as'],'attributes':_0x1e2589[_0xd58e('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x211711){logger[_0xd58e('0x1a')](_0xd58e('0x1d'),_0x15789);logger['debug'](_0xd58e('0x1d'),_0x15789,JSON['stringify'](_0x211711));_0xbfe882(_0x211711);})[_0xd58e('0x1c')](function(_0x15bdee){logger[_0xd58e('0x17')](_0xd58e('0x1d'),_0x15bdee[_0xd58e('0x19')],_0x15789);_0x2aac15(_0xa72aab[_0xd58e('0x17')](0x1f4,_0x15bdee[_0xd58e('0x19')]));});});}; \ No newline at end of file +var _0xca7e=['result','catch','ShowSquareProject','SquareProject','find','options','where','include','map','model','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xca7e,0x133));var _0xeca7=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xca7e[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xeca7('0x0'));var util=require(_0xeca7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeca7('0x2'));var fs=require('fs');var Redis=require(_0xeca7('0x3'));var db=require(_0xeca7('0x4'))['db'];var utils=require(_0xeca7('0x5'));var logger=require(_0xeca7('0x6'))(_0xeca7('0x7'));var config=require(_0xeca7('0x8'));var jayson=require(_0xeca7('0x9'));var client=jayson['client'][_0xeca7('0xa')]({'port':0x232a});config[_0xeca7('0xb')]=_[_0xeca7('0xc')](config[_0xeca7('0xb')],{'host':_0xeca7('0xd'),'port':0x18eb});var socket=require(_0xeca7('0xe'))(new Redis(config[_0xeca7('0xb')]));require('./squareProject.socket')[_0xeca7('0xf')](socket);function respondWithRpcPromise(_0x24aa28,_0x1151cf,_0x34be41){return new BPromise(function(_0x31c084,_0x124f62){return client[_0xeca7('0x10')](_0x24aa28,_0x34be41)[_0xeca7('0x11')](function(_0x28b1c8){logger[_0xeca7('0x12')](_0xeca7('0x13'),_0x1151cf,'request\x20sent');logger['debug'](_0xeca7('0x14'),_0x1151cf,'request\x20sent',JSON[_0xeca7('0x15')](_0x28b1c8));if(_0x28b1c8['error']){if(_0x28b1c8[_0xeca7('0x16')][_0xeca7('0x17')]===0x1f4){logger[_0xeca7('0x16')](_0xeca7('0x13'),_0x1151cf,_0x28b1c8[_0xeca7('0x16')][_0xeca7('0x18')]);return _0x124f62(_0x28b1c8[_0xeca7('0x16')]['message']);}logger[_0xeca7('0x16')]('SquareProject,\x20%s,\x20%s',_0x1151cf,_0x28b1c8[_0xeca7('0x16')]['message']);return _0x31c084(_0x28b1c8[_0xeca7('0x16')][_0xeca7('0x18')]);}else{logger[_0xeca7('0x12')]('SquareProject,\x20%s,\x20%s',_0x1151cf,_0xeca7('0x19'));_0x31c084(_0x28b1c8[_0xeca7('0x1a')][_0xeca7('0x18')]);}})[_0xeca7('0x1b')](function(_0x1dcdf0){logger['error'](_0xeca7('0x13'),_0x1151cf,_0x1dcdf0);_0x124f62(_0x1dcdf0);});});}exports[_0xeca7('0x1c')]=function(_0x223d9f){var _0x4d023a=this;return new Promise(function(_0xfb289b,_0x4c9a2f){return db[_0xeca7('0x1d')][_0xeca7('0x1e')]({'raw':_0x223d9f[_0xeca7('0x1f')]?_0x223d9f[_0xeca7('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x223d9f[_0xeca7('0x1f')]?_0x223d9f[_0xeca7('0x1f')][_0xeca7('0x20')]||null:null,'attributes':_0x223d9f[_0xeca7('0x1f')]?_0x223d9f[_0xeca7('0x1f')]['attributes']||null:null,'include':_0x223d9f[_0xeca7('0x1f')]?_0x223d9f['options'][_0xeca7('0x21')]?_[_0xeca7('0x22')](_0x223d9f[_0xeca7('0x1f')]['include'],function(_0x414237){return{'model':db[_0x414237[_0xeca7('0x23')]],'as':_0x414237['as'],'attributes':_0x414237['attributes'],'include':_0x414237['include']?_[_0xeca7('0x22')](_0x414237['include'],function(_0x28f826){return{'model':db[_0x28f826[_0xeca7('0x23')]],'as':_0x28f826['as'],'attributes':_0x28f826['attributes'],'include':_0x28f826['include']?_[_0xeca7('0x22')](_0x28f826[_0xeca7('0x21')],function(_0x4d4481){return{'model':db[_0x4d4481['model']],'as':_0x4d4481['as'],'attributes':_0x4d4481[_0xeca7('0x24')]};}):[]};}):[]};}):[]:[]})[_0xeca7('0x11')](function(_0x53b67c){logger[_0xeca7('0x12')]('ShowSquareProject',_0x223d9f);logger['debug'](_0xeca7('0x1c'),_0x223d9f,JSON[_0xeca7('0x15')](_0x53b67c));_0xfb289b(_0x53b67c);})[_0xeca7('0x1b')](function(_0x2d3353){logger[_0xeca7('0x16')](_0xeca7('0x1c'),_0x2d3353[_0xeca7('0x18')],_0x223d9f);_0x4c9a2f(_0x4d023a[_0xeca7('0x16')](0x1f4,_0x2d3353[_0xeca7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 2c4f858..9b0eebe 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 _0x1869=['remove','update','removeListener','register','save'];(function(_0x4d3681,_0x136f19){var _0x22c7ac=function(_0x3c6120){while(--_0x3c6120){_0x4d3681['push'](_0x4d3681['shift']());}};_0x22c7ac(++_0x136f19);}(_0x1869,0x1f3));var _0x9186=function(_0x216ac2,_0xe1c7df){_0x216ac2=_0x216ac2-0x0;var _0x25e66b=_0x1869[_0x216ac2];return _0x25e66b;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x9186('0x0'),_0x9186('0x1'),_0x9186('0x2')];function createListener(_0x157137,_0x184cc9){return function(_0x5262be){_0x184cc9['emit'](_0x157137,_0x5262be);};}function removeListener(_0x49bc2b,_0x399f67){return function(){SquareProjectEvents[_0x9186('0x3')](_0x49bc2b,_0x399f67);};}exports[_0x9186('0x4')]=function(_0x57c300){for(var _0x27ee54=0x0,_0x53b3b2=events['length'];_0x27ee54<_0x53b3b2;_0x27ee54++){var _0x4c6551=events[_0x27ee54];var _0x1e5ff0=createListener('squareProject:'+_0x4c6551,_0x57c300);SquareProjectEvents['on'](_0x4c6551,_0x1e5ff0);}}; \ No newline at end of file +var _0xb8e1=['update','removeListener','register','squareProject:','./squareProject.events','save','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb8e1,0x100));var _0x1b8e=function(_0x384c64,_0x1fc60c){_0x384c64=_0x384c64-0x0;var _0x5974d3=_0xb8e1[_0x384c64];return _0x5974d3;};'use strict';var SquareProjectEvents=require(_0x1b8e('0x0'));var events=[_0x1b8e('0x1'),_0x1b8e('0x2'),_0x1b8e('0x3')];function createListener(_0x24f8be,_0x10c8d3){return function(_0x584069){_0x10c8d3['emit'](_0x24f8be,_0x584069);};}function removeListener(_0x5b0b03,_0x28fa72){return function(){SquareProjectEvents[_0x1b8e('0x4')](_0x5b0b03,_0x28fa72);};}exports[_0x1b8e('0x5')]=function(_0x20d284){for(var _0x12d7c4=0x0,_0x17880f=events['length'];_0x12d7c4<_0x17880f;_0x12d7c4++){var _0x1d4909=events[_0x12d7c4];var _0x452b02=createListener(_0x1b8e('0x6')+_0x1d4909,_0x20d284);SquareProjectEvents['on'](_0x1d4909,_0x452b02);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 298b159..ba7e00a 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 _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x16f03f,_0x53eadc){var _0xaabcbe=function(_0x15af8a){while(--_0x15af8a){_0x16f03f['push'](_0x16f03f['shift']());}};_0xaabcbe(++_0x53eadc);}(_0xe14b,0x93));var _0xbe14=function(_0x362b1f,_0x59852c){_0x362b1f=_0x362b1f-0x0;var _0x2fe300=_0xe14b[_0x362b1f];return _0x2fe300;};'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['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x2caabb,_0x670689){var _0x3af66f=function(_0x5d4abe){while(--_0x5d4abe){_0x2caabb['push'](_0x2caabb['shift']());}};_0x3af66f(++_0x670689);}(_0x814b,0x1a2));var _0xb814=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x814b[_0x45d1fd];return _0xd0e542;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 306d587..38129db 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 _0x55ca=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x551bc1,_0x47cff3){var _0x12ea5e=function(_0x2d4c10){while(--_0x2d4c10){_0x551bc1['push'](_0x551bc1['shift']());}};_0x12ea5e(++_0x47cff3);}(_0x55ca,0x126));var _0xa55c=function(_0x371b64,_0x67b4bb){_0x371b64=_0x371b64-0x0;var _0x3cf3b1=_0x55ca[_0x371b64];return _0x3cf3b1;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa55c('0x2')]},'extension':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'dnid':{'type':Sequelize[_0xa55c('0x2')]},'projectName':{'type':Sequelize[_0xa55c('0x2')]},'saveName':{'type':Sequelize[_0xa55c('0x2')]},'filename':{'type':Sequelize[_0xa55c('0x2')]},'savePath':{'type':Sequelize[_0xa55c('0x2')]},'format':{'type':Sequelize[_0xa55c('0x3')],'get':function(){var _0x4d0624='';var _0x2121fd=this[_0xa55c('0x4')]('savePath');if(_0x2121fd){_0x4d0624=_0x2121fd[_0xa55c('0x5')](_0x2121fd[_0xa55c('0x6')]('.'));}return _0x4d0624;}}}; \ No newline at end of file +var _0xb458=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x46758f,_0x362ed7){var _0x169eff=function(_0x7a4de6){while(--_0x7a4de6){_0x46758f['push'](_0x46758f['shift']());}};_0x169eff(++_0x362ed7);}(_0xb458,0x103));var _0x8b45=function(_0x1737f4,_0x16f244){_0x1737f4=_0x1737f4-0x0;var _0x37e525=_0xb458[_0x1737f4];return _0x37e525;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'uniqueid':{'type':Sequelize[_0x8b45('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8b45('0x2')]},'extension':{'type':Sequelize[_0x8b45('0x2')]},'priority':{'type':Sequelize[_0x8b45('0x2')]},'accountcode':{'type':Sequelize[_0x8b45('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x8b45('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x8b45('0x2')]},'format':{'type':Sequelize[_0x8b45('0x3')],'get':function(){var _0x2daa9a='';var _0x3a8ccb=this[_0x8b45('0x4')]('savePath');if(_0x3a8ccb){_0x2daa9a=_0x3a8ccb[_0x8b45('0x5')](_0x3a8ccb[_0x8b45('0x6')]('.'));}return _0x2daa9a;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 5c3d637..5cf12e7 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 _0x8040=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','SquareRecording','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','merge','find','create','body','params','../../components/encryptor','uniqueid','filename','savePath','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash'];(function(_0x140dcd,_0xe99058){var _0x346705=function(_0x38a521){while(--_0x38a521){_0x140dcd['push'](_0x140dcd['shift']());}};_0x346705(++_0xe99058);}(_0x8040,0x11b));var _0x0804=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8040[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0804('0x0'));var rimraf=require(_0x0804('0x1'));var zipdir=require(_0x0804('0x2'));var jsonpatch=require(_0x0804('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0804('0x4'));var Mustache=require(_0x0804('0x5'));var util=require('util');var path=require(_0x0804('0x6'));var sox=require(_0x0804('0x7'));var csv=require(_0x0804('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0804('0x9'));var _=require(_0x0804('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0804('0xb'));var deskjs=require(_0x0804('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0804('0xd'));var Papa=require(_0x0804('0xe'));var Redis=require('ioredis');var authService=require(_0x0804('0xf'));var qs=require(_0x0804('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0804('0x11'))(_0x0804('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0804('0x13'));var db=require(_0x0804('0x14'))['db'];function respondWithStatusCode(_0xfe7adc,_0x46366f){_0x46366f=_0x46366f||0xcc;return function(_0xaf43e6){if(_0xaf43e6){return _0xfe7adc[_0x0804('0x15')](_0x46366f);}return _0xfe7adc[_0x0804('0x16')](_0x46366f)[_0x0804('0x17')]();};}function respondWithResult(_0x2974fa,_0x33e4df){_0x33e4df=_0x33e4df||0xc8;return function(_0x435cb7){if(_0x435cb7){return _0x2974fa['status'](_0x33e4df)[_0x0804('0x18')](_0x435cb7);}};}function respondWithFilteredResult(_0x52e0cc,_0x62aab8){return function(_0x247538){if(_0x247538){var _0x3c1a8d=typeof _0x62aab8[_0x0804('0x19')]===_0x0804('0x1a')&&typeof _0x62aab8[_0x0804('0x1b')]===_0x0804('0x1a');var _0x413243=_0x247538['count'];var _0x236752=_0x3c1a8d?0x0:_0x62aab8[_0x0804('0x19')];var _0x5a3da5=_0x3c1a8d?_0x247538[_0x0804('0x1c')]:_0x62aab8[_0x0804('0x19')]+_0x62aab8['limit'];var _0x53ad9a;if(_0x5a3da5>=_0x413243){_0x5a3da5=_0x413243;_0x53ad9a=0xc8;}else{_0x53ad9a=0xce;}_0x52e0cc[_0x0804('0x16')](_0x53ad9a);return _0x52e0cc[_0x0804('0x1d')](_0x0804('0x1e'),_0x236752+'-'+_0x5a3da5+'/'+_0x413243)[_0x0804('0x18')](_0x247538);}return null;};}function patchUpdates(_0x58106e){return function(_0x25e3b2){try{jsonpatch[_0x0804('0x1f')](_0x25e3b2,_0x58106e,!![]);}catch(_0x1621ca){return BPromise['reject'](_0x1621ca);}return _0x25e3b2[_0x0804('0x20')]();};}function saveUpdates(_0x5ec719,_0x3a0184){return function(_0x37fc07){if(_0x37fc07){return _0x37fc07[_0x0804('0x21')](_0x5ec719)['then'](function(_0x48ca8d){return _0x48ca8d;});}return null;};}function removeEntity(_0x2fac5b,_0x1bf064){return function(_0x50d9d0){if(_0x50d9d0){return _0x50d9d0['destroy']()[_0x0804('0x22')](function(){_0x2fac5b[_0x0804('0x16')](0xcc)[_0x0804('0x17')]();});}};}function handleEntityNotFound(_0x4be8f8,_0x5a187e){return function(_0x154a48){if(!_0x154a48){_0x4be8f8[_0x0804('0x15')](0x194);}return _0x154a48;};}function handleError(_0x52a492,_0x4e3784){_0x4e3784=_0x4e3784||0x1f4;return function(_0x59e578){logger[_0x0804('0x23')](_0x59e578['stack']);if(_0x59e578[_0x0804('0x24')]){delete _0x59e578[_0x0804('0x24')];}_0x52a492[_0x0804('0x16')](_0x4e3784)[_0x0804('0x25')](_0x59e578);};}exports[_0x0804('0x26')]=function(_0xb7fa7f,_0x30320b){var _0x3c1328={},_0x3259f2={},_0x36d205={'count':0x0,'rows':[]};var _0x1cf167=_[_0x0804('0x27')](db[_0x0804('0x28')]['rawAttributes'],function(_0x565c61){return{'name':_0x565c61[_0x0804('0x29')],'type':_0x565c61[_0x0804('0x2a')][_0x0804('0x2b')]};});_0x3259f2['model']=_[_0x0804('0x27')](_0x1cf167,_0x0804('0x24'));_0x3259f2[_0x0804('0x2c')]=_[_0x0804('0x2d')](_0xb7fa7f['query']);_0x3259f2[_0x0804('0x2e')]=_[_0x0804('0x2f')](_0x3259f2[_0x0804('0x30')],_0x3259f2[_0x0804('0x2c')]);_0x3c1328[_0x0804('0x31')]=_['intersection'](_0x3259f2[_0x0804('0x30')],qs['fields'](_0xb7fa7f[_0x0804('0x2c')][_0x0804('0x32')]));_0x3c1328[_0x0804('0x31')]=_0x3c1328[_0x0804('0x31')][_0x0804('0x33')]?_0x3c1328[_0x0804('0x31')]:_0x3259f2[_0x0804('0x30')];if(!_0xb7fa7f[_0x0804('0x2c')][_0x0804('0x34')](_0x0804('0x35'))){_0x3c1328[_0x0804('0x1b')]=qs[_0x0804('0x1b')](_0xb7fa7f[_0x0804('0x2c')]['limit']);_0x3c1328['offset']=qs[_0x0804('0x19')](_0xb7fa7f[_0x0804('0x2c')]['offset']);}_0x3c1328[_0x0804('0x36')]=qs['sort'](_0xb7fa7f[_0x0804('0x2c')][_0x0804('0x37')]);_0x3c1328[_0x0804('0x38')]=qs[_0x0804('0x2e')](_[_0x0804('0x39')](_0xb7fa7f[_0x0804('0x2c')],_0x3259f2[_0x0804('0x2e')]),_0x1cf167);if(_0xb7fa7f[_0x0804('0x2c')][_0x0804('0x3a')]){_0x3c1328['where']=_['merge'](_0x3c1328['where'],{'$or':_['map'](_0x1cf167,function(_0x19a114){if(_0x19a114['type']!==_0x0804('0x3b')){var _0x1fe533={};_0x1fe533[_0x19a114[_0x0804('0x24')]]={'$like':'%'+_0xb7fa7f[_0x0804('0x2c')][_0x0804('0x3a')]+'%'};return _0x1fe533;}})});}_0x3c1328=_['merge']({},_0x3c1328,_0xb7fa7f[_0x0804('0x3c')]);var _0x547806={'where':_0x3c1328[_0x0804('0x38')]};return db[_0x0804('0x28')]['count'](_0x547806)[_0x0804('0x22')](function(_0x48d06d){_0x36d205['count']=_0x48d06d;if(_0xb7fa7f['query'][_0x0804('0x3d')]){_0x3c1328[_0x0804('0x3e')]=[{'all':!![]}];}return db[_0x0804('0x28')]['findAll'](_0x3c1328);})[_0x0804('0x22')](function(_0xabe600){_0x36d205[_0x0804('0x3f')]=_0xabe600;return _0x36d205;})[_0x0804('0x22')](respondWithFilteredResult(_0x30320b,_0x3c1328))[_0x0804('0x40')](handleError(_0x30320b,null));};exports[_0x0804('0x41')]=function(_0xb57f35,_0x49eb42){var _0x270741={'raw':!![],'where':{'id':_0xb57f35['params']['id']}},_0x17f538={};_0x17f538['model']=_[_0x0804('0x2d')](db[_0x0804('0x28')][_0x0804('0x42')]);_0x17f538[_0x0804('0x2c')]=_[_0x0804('0x2d')](_0xb57f35[_0x0804('0x2c')]);_0x17f538[_0x0804('0x2e')]=_[_0x0804('0x2f')](_0x17f538['model'],_0x17f538[_0x0804('0x2c')]);_0x270741[_0x0804('0x31')]=_[_0x0804('0x2f')](_0x17f538[_0x0804('0x30')],qs[_0x0804('0x32')](_0xb57f35[_0x0804('0x2c')][_0x0804('0x32')]));_0x270741['attributes']=_0x270741[_0x0804('0x31')][_0x0804('0x33')]?_0x270741['attributes']:_0x17f538[_0x0804('0x30')];if(_0xb57f35[_0x0804('0x2c')][_0x0804('0x3d')]){_0x270741['include']=[{'all':!![]}];}_0x270741=_[_0x0804('0x43')]({},_0x270741,_0xb57f35[_0x0804('0x3c')]);return db['SquareRecording'][_0x0804('0x44')](_0x270741)[_0x0804('0x22')](handleEntityNotFound(_0x49eb42,null))[_0x0804('0x22')](respondWithResult(_0x49eb42,null))[_0x0804('0x40')](handleError(_0x49eb42,null));};exports[_0x0804('0x45')]=function(_0x4c583a,_0x38ace0){return db['SquareRecording'][_0x0804('0x45')](_0x4c583a[_0x0804('0x46')],{})[_0x0804('0x22')](respondWithResult(_0x38ace0,0xc9))['catch'](handleError(_0x38ace0,null));};exports[_0x0804('0x21')]=function(_0x537349,_0x5d2411){if(_0x537349[_0x0804('0x46')]['id']){delete _0x537349[_0x0804('0x46')]['id'];}return db['SquareRecording'][_0x0804('0x44')]({'where':{'id':_0x537349[_0x0804('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d2411,null))['then'](saveUpdates(_0x537349['body'],null))[_0x0804('0x22')](respondWithResult(_0x5d2411,null))[_0x0804('0x40')](handleError(_0x5d2411,null));};exports['download']=function(_0x53b48a,_0x51ac49,_0x492406){var _0x1e5393=require(_0x0804('0x48'));var _0x1d051f=![];var _0x4ae386={};if(_0x53b48a[_0x0804('0x2c')][_0x0804('0x2a')]&&_0x53b48a[_0x0804('0x2c')][_0x0804('0x2a')]==='uniqueid'){_0x4ae386[_0x0804('0x49')]=_0x53b48a[_0x0804('0x47')]['id'];}else{_0x4ae386['id']=_0x53b48a[_0x0804('0x47')]['id'];}return db[_0x0804('0x28')][_0x0804('0x44')]({'where':_0x4ae386,'attributes':['id','savePath',_0x0804('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x51ac49,null))[_0x0804('0x22')](function(_0x57a82f){if(_0x57a82f){var _0x4c73c4=_0x57a82f[_0x0804('0x4b')];var _0x54c72b=util['format'](_0x0804('0x4c'),_0x4c73c4);if(fs['existsSync'](_0x54c72b)){_0x1d051f=!![];return _0x1e5393[_0x0804('0x4d')](_0x54c72b,_0x4c73c4,config[_0x0804('0x4e')][_0x0804('0x4f')])[_0x0804('0x22')](function(){return _0x57a82f;});}return _0x57a82f;}})[_0x0804('0x22')](function(_0x3fd94f){if(_0x3fd94f){var _0x141154=_0x3fd94f['savePath'];if(!fs[_0x0804('0x50')](_0x141154)){throw new db[(_0x0804('0x51'))][(_0x0804('0x52'))](_0x0804('0x53'));}if(_0x3fd94f[_0x0804('0x4a')]){return _0x51ac49[_0x0804('0x54')](_0x141154,_0x3fd94f[_0x0804('0x4a')]+path[_0x0804('0x55')](_0x141154),function(){if(_0x1d051f){fs[_0x0804('0x56')](_0x141154);}});}else{return _0x51ac49[_0x0804('0x54')](_0x141154,function(_0x3acf26){if(_0x1d051f){fs[_0x0804('0x56')](_0x141154);}});}}})[_0x0804('0x40')](function(_0x320b34){if(_0x320b34[_0x0804('0x57')]===_0x0804('0x53')){_0x51ac49[_0x0804('0x16')](0x194)['send'](_0x0804('0x58'));}else{return handleError(_0x51ac49,null);}});};exports[_0x0804('0x59')]=function(_0x53f1d9,_0x16f8fb){return db[_0x0804('0x28')][_0x0804('0x44')]({'where':{'id':_0x53f1d9[_0x0804('0x47')]['id']}})[_0x0804('0x22')](function(_0x533aad){if(_[_0x0804('0x5a')](_0x533aad)){throw new ReferenceError(_0x0804('0x5b'));}return _0x533aad;})['then'](function(_0x8fa442){var _0x40148a=_0x8fa442[_0x0804('0x4b')];logger[_0x0804('0x5c')](_0x0804('0x5d'),_0x40148a);if(!_[_0x0804('0x5a')](_0x8fa442[_0x0804('0x4b')])&&fs[_0x0804('0x50')](_0x40148a)){logger[_0x0804('0x5c')]('File:\x20\x22'+_0x40148a+_0x0804('0x5e'));fs[_0x0804('0x5f')](_0x40148a);}_0x40148a=_0x40148a+_0x0804('0x60');if(!_['isNil'](_0x8fa442[_0x0804('0x4b')])&&fs[_0x0804('0x50')](_0x40148a)){logger[_0x0804('0x5c')](_0x0804('0x61')+_0x40148a+_0x0804('0x5e'));fs['unlinkSync'](_0x40148a);}return _0x8fa442;})[_0x0804('0x22')](function(_0x4c8d96){if(!_0x4c8d96)throw new InternalError();return _0x4c8d96[_0x0804('0x59')]();})[_0x0804('0x22')](function(){_0x16f8fb[_0x0804('0x16')](0xcc)[_0x0804('0x17')]();})[_0x0804('0x40')](handleError(_0x16f8fb,null));}; \ No newline at end of file +var _0xa0f6=['key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SquareRecording','findAll','rows','show','params','length','includeAll','include','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','recording','Sequelize','ValidationError','filename','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0xa0f6,0xf5));var _0x6a0f=function(_0xb08a99,_0x3fe619){_0xb08a99=_0xb08a99-0x0;var _0x355f24=_0xa0f6[_0xb08a99];return _0x355f24;};'use strict';var emlformat=require(_0x6a0f('0x0'));var rimraf=require(_0x6a0f('0x1'));var zipdir=require(_0x6a0f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6a0f('0x3'));var BPromise=require(_0x6a0f('0x4'));var Mustache=require(_0x6a0f('0x5'));var util=require(_0x6a0f('0x6'));var path=require(_0x6a0f('0x7'));var sox=require(_0x6a0f('0x8'));var csv=require('to-csv');var ejs=require(_0x6a0f('0x9'));var fs=require('fs');var fs_extra=require(_0x6a0f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6a0f('0xb'));var deskjs=require(_0x6a0f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6a0f('0xd'));var Papa=require(_0x6a0f('0xe'));var Redis=require('ioredis');var authService=require(_0x6a0f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6a0f('0x10'));var hardwareService=require(_0x6a0f('0x11'));var logger=require('../../config/logger')(_0x6a0f('0x12'));var utils=require(_0x6a0f('0x13'));var config=require(_0x6a0f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a0f('0x15'))['db'];function respondWithStatusCode(_0x4c60a0,_0x27d711){_0x27d711=_0x27d711||0xcc;return function(_0x3fe415){if(_0x3fe415){return _0x4c60a0[_0x6a0f('0x16')](_0x27d711);}return _0x4c60a0[_0x6a0f('0x17')](_0x27d711)[_0x6a0f('0x18')]();};}function respondWithResult(_0xf8af2b,_0x5ad948){_0x5ad948=_0x5ad948||0xc8;return function(_0x311997){if(_0x311997){return _0xf8af2b[_0x6a0f('0x17')](_0x5ad948)[_0x6a0f('0x19')](_0x311997);}};}function respondWithFilteredResult(_0x2fc7e2,_0x5dcea3){return function(_0x1fc4c3){if(_0x1fc4c3){var _0x59db12=typeof _0x5dcea3[_0x6a0f('0x1a')]==='undefined'&&typeof _0x5dcea3[_0x6a0f('0x1b')]==='undefined';var _0x268d44=_0x1fc4c3[_0x6a0f('0x1c')];var _0x262ed1=_0x59db12?0x0:_0x5dcea3[_0x6a0f('0x1a')];var _0x3ea652=_0x59db12?_0x1fc4c3[_0x6a0f('0x1c')]:_0x5dcea3[_0x6a0f('0x1a')]+_0x5dcea3[_0x6a0f('0x1b')];var _0x1a9185;if(_0x3ea652>=_0x268d44){_0x3ea652=_0x268d44;_0x1a9185=0xc8;}else{_0x1a9185=0xce;}_0x2fc7e2[_0x6a0f('0x17')](_0x1a9185);return _0x2fc7e2['set'](_0x6a0f('0x1d'),_0x262ed1+'-'+_0x3ea652+'/'+_0x268d44)[_0x6a0f('0x19')](_0x1fc4c3);}return null;};}function patchUpdates(_0x309a3b){return function(_0x5806c6){try{jsonpatch['apply'](_0x5806c6,_0x309a3b,!![]);}catch(_0x1803c7){return BPromise[_0x6a0f('0x1e')](_0x1803c7);}return _0x5806c6[_0x6a0f('0x1f')]();};}function saveUpdates(_0x208af8,_0x3fe791){return function(_0x340694){if(_0x340694){return _0x340694[_0x6a0f('0x20')](_0x208af8)[_0x6a0f('0x21')](function(_0x31bdd1){return _0x31bdd1;});}return null;};}function removeEntity(_0x504cec,_0x43e6c0){return function(_0x4d3230){if(_0x4d3230){return _0x4d3230[_0x6a0f('0x22')]()[_0x6a0f('0x21')](function(){_0x504cec['status'](0xcc)[_0x6a0f('0x18')]();});}};}function handleEntityNotFound(_0x40ca4a,_0xc8ae30){return function(_0x16d22f){if(!_0x16d22f){_0x40ca4a[_0x6a0f('0x16')](0x194);}return _0x16d22f;};}function handleError(_0x41c764,_0x4076af){_0x4076af=_0x4076af||0x1f4;return function(_0x2ca20b){logger['error'](_0x2ca20b[_0x6a0f('0x23')]);if(_0x2ca20b['name']){delete _0x2ca20b[_0x6a0f('0x24')];}_0x41c764[_0x6a0f('0x17')](_0x4076af)[_0x6a0f('0x25')](_0x2ca20b);};}exports[_0x6a0f('0x26')]=function(_0x1e96e9,_0x2fe21b){var _0x4d6ea8={},_0x18a7a5={},_0x6f1e43={'count':0x0,'rows':[]};var _0x43c242=_[_0x6a0f('0x27')](db['SquareRecording'][_0x6a0f('0x28')],function(_0x9c16ab){return{'name':_0x9c16ab[_0x6a0f('0x29')],'type':_0x9c16ab[_0x6a0f('0x2a')][_0x6a0f('0x2b')]};});_0x18a7a5[_0x6a0f('0x2c')]=_['map'](_0x43c242,'name');_0x18a7a5[_0x6a0f('0x2d')]=_[_0x6a0f('0x2e')](_0x1e96e9[_0x6a0f('0x2d')]);_0x18a7a5['filters']=_[_0x6a0f('0x2f')](_0x18a7a5[_0x6a0f('0x2c')],_0x18a7a5['query']);_0x4d6ea8[_0x6a0f('0x30')]=_[_0x6a0f('0x2f')](_0x18a7a5[_0x6a0f('0x2c')],qs[_0x6a0f('0x31')](_0x1e96e9[_0x6a0f('0x2d')][_0x6a0f('0x31')]));_0x4d6ea8[_0x6a0f('0x30')]=_0x4d6ea8[_0x6a0f('0x30')]['length']?_0x4d6ea8[_0x6a0f('0x30')]:_0x18a7a5['model'];if(!_0x1e96e9[_0x6a0f('0x2d')][_0x6a0f('0x32')](_0x6a0f('0x33'))){_0x4d6ea8[_0x6a0f('0x1b')]=qs[_0x6a0f('0x1b')](_0x1e96e9[_0x6a0f('0x2d')][_0x6a0f('0x1b')]);_0x4d6ea8[_0x6a0f('0x1a')]=qs[_0x6a0f('0x1a')](_0x1e96e9['query']['offset']);}_0x4d6ea8[_0x6a0f('0x34')]=qs[_0x6a0f('0x35')](_0x1e96e9['query'][_0x6a0f('0x35')]);_0x4d6ea8[_0x6a0f('0x36')]=qs[_0x6a0f('0x37')](_[_0x6a0f('0x38')](_0x1e96e9[_0x6a0f('0x2d')],_0x18a7a5[_0x6a0f('0x37')]),_0x43c242);if(_0x1e96e9[_0x6a0f('0x2d')][_0x6a0f('0x39')]){_0x4d6ea8['where']=_[_0x6a0f('0x3a')](_0x4d6ea8[_0x6a0f('0x36')],{'$or':_[_0x6a0f('0x27')](_0x43c242,function(_0xbcd8a6){if(_0xbcd8a6[_0x6a0f('0x2a')]!=='VIRTUAL'){var _0x2d639c={};_0x2d639c[_0xbcd8a6[_0x6a0f('0x24')]]={'$like':'%'+_0x1e96e9[_0x6a0f('0x2d')]['filter']+'%'};return _0x2d639c;}})});}_0x4d6ea8=_[_0x6a0f('0x3a')]({},_0x4d6ea8,_0x1e96e9[_0x6a0f('0x3b')]);var _0x113952={'where':_0x4d6ea8[_0x6a0f('0x36')]};return db['SquareRecording'][_0x6a0f('0x1c')](_0x113952)[_0x6a0f('0x21')](function(_0xd49fc5){_0x6f1e43[_0x6a0f('0x1c')]=_0xd49fc5;if(_0x1e96e9[_0x6a0f('0x2d')]['includeAll']){_0x4d6ea8['include']=[{'all':!![]}];}return db[_0x6a0f('0x3c')][_0x6a0f('0x3d')](_0x4d6ea8);})[_0x6a0f('0x21')](function(_0x16c4df){_0x6f1e43[_0x6a0f('0x3e')]=_0x16c4df;return _0x6f1e43;})[_0x6a0f('0x21')](respondWithFilteredResult(_0x2fe21b,_0x4d6ea8))['catch'](handleError(_0x2fe21b,null));};exports[_0x6a0f('0x3f')]=function(_0x381f4c,_0x2a39de){var _0x47e6c4={'raw':!![],'where':{'id':_0x381f4c[_0x6a0f('0x40')]['id']}},_0x5cde46={};_0x5cde46['model']=_[_0x6a0f('0x2e')](db['SquareRecording'][_0x6a0f('0x28')]);_0x5cde46['query']=_[_0x6a0f('0x2e')](_0x381f4c['query']);_0x5cde46['filters']=_[_0x6a0f('0x2f')](_0x5cde46[_0x6a0f('0x2c')],_0x5cde46['query']);_0x47e6c4[_0x6a0f('0x30')]=_[_0x6a0f('0x2f')](_0x5cde46[_0x6a0f('0x2c')],qs[_0x6a0f('0x31')](_0x381f4c['query']['fields']));_0x47e6c4['attributes']=_0x47e6c4[_0x6a0f('0x30')][_0x6a0f('0x41')]?_0x47e6c4[_0x6a0f('0x30')]:_0x5cde46[_0x6a0f('0x2c')];if(_0x381f4c['query'][_0x6a0f('0x42')]){_0x47e6c4[_0x6a0f('0x43')]=[{'all':!![]}];}_0x47e6c4=_[_0x6a0f('0x3a')]({},_0x47e6c4,_0x381f4c['options']);return db[_0x6a0f('0x3c')][_0x6a0f('0x44')](_0x47e6c4)[_0x6a0f('0x21')](handleEntityNotFound(_0x2a39de,null))['then'](respondWithResult(_0x2a39de,null))[_0x6a0f('0x45')](handleError(_0x2a39de,null));};exports['create']=function(_0x3198b1,_0x3805f7){return db[_0x6a0f('0x3c')][_0x6a0f('0x46')](_0x3198b1[_0x6a0f('0x47')],{})[_0x6a0f('0x21')](respondWithResult(_0x3805f7,0xc9))[_0x6a0f('0x45')](handleError(_0x3805f7,null));};exports[_0x6a0f('0x20')]=function(_0x4754ec,_0x3dbe8a){if(_0x4754ec[_0x6a0f('0x47')]['id']){delete _0x4754ec[_0x6a0f('0x47')]['id'];}return db[_0x6a0f('0x3c')]['find']({'where':{'id':_0x4754ec['params']['id']}})['then'](handleEntityNotFound(_0x3dbe8a,null))[_0x6a0f('0x21')](saveUpdates(_0x4754ec[_0x6a0f('0x47')],null))[_0x6a0f('0x21')](respondWithResult(_0x3dbe8a,null))[_0x6a0f('0x45')](handleError(_0x3dbe8a,null));};exports[_0x6a0f('0x48')]=function(_0x36af0f,_0x7c0bc8,_0x2d9bf3){var _0x2189d8=require(_0x6a0f('0x49'));var _0x49e52d=![];var _0x55b74c={};if(_0x36af0f[_0x6a0f('0x2d')][_0x6a0f('0x2a')]&&_0x36af0f[_0x6a0f('0x2d')][_0x6a0f('0x2a')]===_0x6a0f('0x4a')){_0x55b74c[_0x6a0f('0x4a')]=_0x36af0f[_0x6a0f('0x40')]['id'];}else{_0x55b74c['id']=_0x36af0f[_0x6a0f('0x40')]['id'];}return db[_0x6a0f('0x3c')][_0x6a0f('0x44')]({'where':_0x55b74c,'attributes':['id','savePath','filename'],'raw':!![]})[_0x6a0f('0x21')](handleEntityNotFound(_0x7c0bc8,null))['then'](function(_0xeed167){if(_0xeed167){var _0x2014be=_0xeed167[_0x6a0f('0x4b')];var _0x5d296d=util[_0x6a0f('0x4c')](_0x6a0f('0x4d'),_0x2014be);if(fs[_0x6a0f('0x4e')](_0x5d296d)){_0x49e52d=!![];return _0x2189d8['decryptFile'](_0x5d296d,_0x2014be,config['secrets'][_0x6a0f('0x4f')])[_0x6a0f('0x21')](function(){return _0xeed167;});}return _0xeed167;}})['then'](function(_0x46873f){if(_0x46873f){var _0x370ddc=_0x46873f[_0x6a0f('0x4b')];if(!fs[_0x6a0f('0x4e')](_0x370ddc)){throw new db[(_0x6a0f('0x50'))][(_0x6a0f('0x51'))]('SquareRecording\x20not\x20found');}if(_0x46873f[_0x6a0f('0x52')]){return _0x7c0bc8['download'](_0x370ddc,_0x46873f['filename']+path[_0x6a0f('0x53')](_0x370ddc),function(){if(_0x49e52d){fs[_0x6a0f('0x54')](_0x370ddc);}});}else{return _0x7c0bc8['download'](_0x370ddc,function(_0x2dfec9){if(_0x49e52d){fs[_0x6a0f('0x54')](_0x370ddc);}});}}})[_0x6a0f('0x45')](function(_0x465b0e){if(_0x465b0e[_0x6a0f('0x55')]===_0x6a0f('0x56')){_0x7c0bc8[_0x6a0f('0x17')](0x194)['send'](_0x6a0f('0x57'));}else{return handleError(_0x7c0bc8,null);}});};exports[_0x6a0f('0x22')]=function(_0x4f2914,_0x9d75c8){return db[_0x6a0f('0x3c')]['find']({'where':{'id':_0x4f2914['params']['id']}})[_0x6a0f('0x21')](function(_0x5b778d){if(_[_0x6a0f('0x58')](_0x5b778d)){throw new ReferenceError(_0x6a0f('0x59'));}return _0x5b778d;})[_0x6a0f('0x21')](function(_0x2ea6ca){var _0x152765=_0x2ea6ca[_0x6a0f('0x4b')];logger[_0x6a0f('0x5a')](_0x6a0f('0x5b'),_0x152765);if(!_[_0x6a0f('0x58')](_0x2ea6ca[_0x6a0f('0x4b')])&&fs[_0x6a0f('0x4e')](_0x152765)){logger['info'](_0x6a0f('0x5c')+_0x152765+_0x6a0f('0x5d'));fs[_0x6a0f('0x5e')](_0x152765);}_0x152765=_0x152765+_0x6a0f('0x5f');if(!_[_0x6a0f('0x58')](_0x2ea6ca[_0x6a0f('0x4b')])&&fs[_0x6a0f('0x4e')](_0x152765)){logger['info'](_0x6a0f('0x5c')+_0x152765+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6a0f('0x5e')](_0x152765);}return _0x2ea6ca;})[_0x6a0f('0x21')](function(_0x56deda){if(!_0x56deda)throw new InternalError();return _0x56deda['destroy']();})[_0x6a0f('0x21')](function(){_0x9d75c8[_0x6a0f('0x17')](0xcc)[_0x6a0f('0x18')]();})[_0x6a0f('0x45')](handleError(_0x9d75c8,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 803a67a..c97b73f 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 _0x6db4=['moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','util','../../config/logger','api'];(function(_0x393c8c,_0x4a0817){var _0x18f858=function(_0x437b9b){while(--_0x437b9b){_0x393c8c['push'](_0x393c8c['shift']());}};_0x18f858(++_0x4a0817);}(_0x6db4,0x111));var _0x46db=function(_0x1edfe4,_0x2d50f2){_0x1edfe4=_0x1edfe4-0x0;var _0x8a1467=_0x6db4[_0x1edfe4];return _0x8a1467;};'use strict';var _=require('lodash');var util=require(_0x46db('0x0'));var logger=require(_0x46db('0x1'))(_0x46db('0x2'));var moment=require(_0x46db('0x3'));var BPromise=require(_0x46db('0x4'));var rp=require(_0x46db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46db('0x6'));var config=require(_0x46db('0x7'));var attributes=require(_0x46db('0x8'));module[_0x46db('0x9')]=function(_0x331e67,_0x2abfd4){return _0x331e67[_0x46db('0xa')]('SquareRecording',attributes,{'tableName':_0x46db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['exports','define','SquareRecording','square_recordings','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x2fed42,_0x4f0ed6){var _0x453721=function(_0x55c849){while(--_0x55c849){_0x2fed42['push'](_0x2fed42['shift']());}};_0x453721(++_0x4f0ed6);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'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 ec8731e..7f1bb2e 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 _0x549d=['info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareRecording','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x2195e6,_0x3222ed){var _0x2d44a6=function(_0x1c6b33){while(--_0x1c6b33){_0x2195e6['push'](_0x2195e6['shift']());}};_0x2d44a6(++_0x3222ed);}(_0x549d,0x1f4));var _0xd549=function(_0x5250d1,_0x10fdf4){_0x5250d1=_0x5250d1-0x0;var _0x1ba6b0=_0x549d[_0x5250d1];return _0x1ba6b0;};'use strict';var _=require(_0xd549('0x0'));var util=require(_0xd549('0x1'));var moment=require(_0xd549('0x2'));var BPromise=require(_0xd549('0x3'));var rs=require(_0xd549('0x4'));var fs=require('fs');var Redis=require(_0xd549('0x5'));var db=require(_0xd549('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd549('0x7'));var config=require(_0xd549('0x8'));var jayson=require(_0xd549('0x9'));var client=jayson[_0xd549('0xa')][_0xd549('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xba6bf1,_0x397b6d,_0xf9f4aa){return new BPromise(function(_0x58cb3e,_0x5c0737){return client['request'](_0xba6bf1,_0xf9f4aa)[_0xd549('0xc')](function(_0x59d249){logger[_0xd549('0xd')](_0xd549('0xe'),_0x397b6d,_0xd549('0xf'));logger[_0xd549('0x10')](_0xd549('0x11'),_0x397b6d,_0xd549('0xf'),JSON['stringify'](_0x59d249));if(_0x59d249[_0xd549('0x12')]){if(_0x59d249[_0xd549('0x12')][_0xd549('0x13')]===0x1f4){logger['error'](_0xd549('0xe'),_0x397b6d,_0x59d249[_0xd549('0x12')]['message']);return _0x5c0737(_0x59d249['error'][_0xd549('0x14')]);}logger['error'](_0xd549('0xe'),_0x397b6d,_0x59d249[_0xd549('0x12')][_0xd549('0x14')]);return _0x58cb3e(_0x59d249[_0xd549('0x12')][_0xd549('0x14')]);}else{logger[_0xd549('0xd')](_0xd549('0xe'),_0x397b6d,_0xd549('0xf'));_0x58cb3e(_0x59d249[_0xd549('0x15')][_0xd549('0x14')]);}})[_0xd549('0x16')](function(_0x538f4b){logger[_0xd549('0x12')](_0xd549('0xe'),_0x397b6d,_0x538f4b);_0x5c0737(_0x538f4b);});});}exports[_0xd549('0x17')]=function(_0x5e4e4d){var _0x3a39b3=this;return new Promise(function(_0x530c70,_0x216cf9){return db['SquareRecording']['create'](_0x5e4e4d[_0xd549('0x18')],{'raw':_0x5e4e4d[_0xd549('0x19')]?_0x5e4e4d[_0xd549('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xd549('0xc')](function(_0x31d53a){logger[_0xd549('0xd')]('CreateSquareRecording',_0x5e4e4d);logger[_0xd549('0x10')](_0xd549('0x17'),_0x5e4e4d,JSON[_0xd549('0x1a')](_0x31d53a));_0x530c70(_0x31d53a);})['catch'](function(_0x2af67a){logger[_0xd549('0x12')]('CreateSquareRecording',_0x2af67a[_0xd549('0x14')],_0x5e4e4d);_0x216cf9(_0x3a39b3[_0xd549('0x12')](0x1f4,_0x2af67a[_0xd549('0x14')]));});});}; \ No newline at end of file +var _0xdaef=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareRecording','create','options','raw','CreateSquareRecording','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0xdaef,0x16e));var _0xfdae=function(_0x5e5b5e,_0x1d4bde){_0x5e5b5e=_0x5e5b5e-0x0;var _0x296489=_0xdaef[_0x5e5b5e];return _0x296489;};'use strict';var _=require(_0xfdae('0x0'));var util=require('util');var moment=require(_0xfdae('0x1'));var BPromise=require(_0xfdae('0x2'));var rs=require(_0xfdae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfdae('0x4'))['db'];var utils=require(_0xfdae('0x5'));var logger=require('../../config/logger')(_0xfdae('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfdae('0x7')][_0xfdae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52387d,_0x4b24fb,_0x5ed5a8){return new BPromise(function(_0x8217e0,_0x119cbc){return client['request'](_0x52387d,_0x5ed5a8)[_0xfdae('0x9')](function(_0x3e438a){logger[_0xfdae('0xa')](_0xfdae('0xb'),_0x4b24fb,_0xfdae('0xc'));logger[_0xfdae('0xd')](_0xfdae('0xe'),_0x4b24fb,_0xfdae('0xc'),JSON[_0xfdae('0xf')](_0x3e438a));if(_0x3e438a[_0xfdae('0x10')]){if(_0x3e438a[_0xfdae('0x10')]['code']===0x1f4){logger['error'](_0xfdae('0xb'),_0x4b24fb,_0x3e438a[_0xfdae('0x10')][_0xfdae('0x11')]);return _0x119cbc(_0x3e438a['error'][_0xfdae('0x11')]);}logger[_0xfdae('0x10')](_0xfdae('0xb'),_0x4b24fb,_0x3e438a['error'][_0xfdae('0x11')]);return _0x8217e0(_0x3e438a['error'][_0xfdae('0x11')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x4b24fb,_0xfdae('0xc'));_0x8217e0(_0x3e438a[_0xfdae('0x12')][_0xfdae('0x11')]);}})[_0xfdae('0x13')](function(_0xa8c8fd){logger[_0xfdae('0x10')](_0xfdae('0xb'),_0x4b24fb,_0xa8c8fd);_0x119cbc(_0xa8c8fd);});});}exports['CreateSquareRecording']=function(_0x4d6f8b){var _0xbe556=this;return new Promise(function(_0x509ef0,_0x38762c){return db[_0xfdae('0x14')][_0xfdae('0x15')](_0x4d6f8b['body'],{'raw':_0x4d6f8b[_0xfdae('0x16')]?_0x4d6f8b[_0xfdae('0x16')][_0xfdae('0x17')]===undefined?!![]:![]:!![]})[_0xfdae('0x9')](function(_0x2ea728){logger['info'](_0xfdae('0x18'),_0x4d6f8b);logger[_0xfdae('0xd')](_0xfdae('0x18'),_0x4d6f8b,JSON[_0xfdae('0xf')](_0x2ea728));_0x509ef0(_0x2ea728);})[_0xfdae('0x13')](function(_0x58b36f){logger['error'](_0xfdae('0x18'),_0x58b36f[_0xfdae('0x11')],_0x4d6f8b);_0x38762c(_0xbe556[_0xfdae('0x10')](0x1f4,_0x58b36f['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index fd4c973..e21c0ca 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _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(_0x5a8286,_0x122d4a){var _0xa58f52=function(_0x3978e9){while(--_0x3978e9){_0x5a8286['push'](_0x5a8286['shift']());}};_0xa58f52(++_0x122d4a);}(_0xe706,0xa3));var _0x6e70=function(_0x1089fb,_0x2a412d){_0x1089fb=_0x1089fb-0x0;var _0x5deb2a=_0xe706[_0x1089fb];return _0x5deb2a;};'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 d24098d..809ea44 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 _0x8882=['STRING','BOOLEAN','sequelize','exports'];(function(_0x53f3d0,_0x41ca07){var _0x583eb9=function(_0x1f11f8){while(--_0x1f11f8){_0x53f3d0['push'](_0x53f3d0['shift']());}};_0x583eb9(++_0x41ca07);}(_0x8882,0x166));var _0x2888=function(_0x38f97e,_0x2b6d26){_0x38f97e=_0x38f97e-0x0;var _0x11e2f5=_0x8882[_0x38f97e];return _0x11e2f5;};'use strict';var Sequelize=require(_0x2888('0x0'));module[_0x2888('0x1')]={'network':{'type':Sequelize[_0x2888('0x2')]},'network_script':{'type':Sequelize[_0x2888('0x2')]},'request':{'type':Sequelize[_0x2888('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2888('0x2')]},'type':{'type':Sequelize[_0x2888('0x2')]},'uniqueid':{'type':Sequelize[_0x2888('0x2')]},'version':{'type':Sequelize[_0x2888('0x2')]},'callerid':{'type':Sequelize[_0x2888('0x2')]},'calleridname':{'type':Sequelize[_0x2888('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x2888('0x2')]},'callington':{'type':Sequelize[_0x2888('0x2')]},'callingtns':{'type':Sequelize[_0x2888('0x2')]},'dnid':{'type':Sequelize[_0x2888('0x2')]},'rdnis':{'type':Sequelize[_0x2888('0x2')]},'context':{'type':Sequelize[_0x2888('0x2')]},'extension':{'type':Sequelize[_0x2888('0x2')]},'priority':{'type':Sequelize[_0x2888('0x2')]},'enhanced':{'type':Sequelize[_0x2888('0x2')]},'accountcode':{'type':Sequelize[_0x2888('0x2')]},'threadid':{'type':Sequelize[_0x2888('0x2')]},'project_name':{'type':Sequelize[_0x2888('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x2888('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe7a0=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3f0f70,_0x2a1eb2){var _0x2a4a73=function(_0x5b8a52){while(--_0x5b8a52){_0x3f0f70['push'](_0x3f0f70['shift']());}};_0x2a4a73(++_0x2a1eb2);}(_0xe7a0,0x10d));var _0x0e7a=function(_0x104665,_0xd35a22){_0x104665=_0x104665-0x0;var _0xc00896=_0xe7a0[_0x104665];return _0xc00896;};'use strict';var Sequelize=require(_0x0e7a('0x0'));module[_0x0e7a('0x1')]={'network':{'type':Sequelize[_0x0e7a('0x2')]},'network_script':{'type':Sequelize[_0x0e7a('0x2')]},'request':{'type':Sequelize[_0x0e7a('0x2')]},'channel':{'type':Sequelize[_0x0e7a('0x2')]},'language':{'type':Sequelize[_0x0e7a('0x2')]},'type':{'type':Sequelize[_0x0e7a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x0e7a('0x2')]},'callerid':{'type':Sequelize[_0x0e7a('0x2')]},'calleridname':{'type':Sequelize[_0x0e7a('0x2')]},'callingpres':{'type':Sequelize[_0x0e7a('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x0e7a('0x2')]},'callingtns':{'type':Sequelize[_0x0e7a('0x2')]},'dnid':{'type':Sequelize[_0x0e7a('0x2')]},'rdnis':{'type':Sequelize[_0x0e7a('0x2')]},'context':{'type':Sequelize[_0x0e7a('0x2')]},'extension':{'type':Sequelize[_0x0e7a('0x2')]},'priority':{'type':Sequelize[_0x0e7a('0x2')]},'enhanced':{'type':Sequelize[_0x0e7a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0e7a('0x2')]},'project_name':{'type':Sequelize[_0x0e7a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0e7a('0x3')]},'bot':{'type':Sequelize[_0x0e7a('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1720086..5e1a4bb 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 _0xdae6=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','map','rawAttributes','fieldName'];(function(_0x59173d,_0x467935){var _0x1a3727=function(_0x25530e){while(--_0x25530e){_0x59173d['push'](_0x59173d['shift']());}};_0x1a3727(++_0x467935);}(_0xdae6,0x6f));var _0x6dae=function(_0xb9eb5f,_0x5073f0){_0xb9eb5f=_0xb9eb5f-0x0;var _0x1e9fa9=_0xdae6[_0xb9eb5f];return _0x1e9fa9;};'use strict';var emlformat=require(_0x6dae('0x0'));var rimraf=require(_0x6dae('0x1'));var zipdir=require(_0x6dae('0x2'));var jsonpatch=require(_0x6dae('0x3'));var rp=require('request-promise');var moment=require(_0x6dae('0x4'));var BPromise=require(_0x6dae('0x5'));var Mustache=require('mustache');var util=require(_0x6dae('0x6'));var path=require(_0x6dae('0x7'));var sox=require(_0x6dae('0x8'));var csv=require(_0x6dae('0x9'));var ejs=require(_0x6dae('0xa'));var fs=require('fs');var fs_extra=require(_0x6dae('0xb'));var _=require(_0x6dae('0xc'));var squel=require(_0x6dae('0xd'));var crypto=require(_0x6dae('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6dae('0xf'));var toCsv=require(_0x6dae('0x9'));var querystring=require(_0x6dae('0x10'));var Papa=require(_0x6dae('0x11'));var Redis=require(_0x6dae('0x12'));var authService=require(_0x6dae('0x13'));var qs=require(_0x6dae('0x14'));var as=require(_0x6dae('0x15'));var hardwareService=require(_0x6dae('0x16'));var logger=require(_0x6dae('0x17'))(_0x6dae('0x18'));var utils=require(_0x6dae('0x19'));var config=require(_0x6dae('0x1a'));var licenseUtil=require(_0x6dae('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a65cf,_0x340fd9){_0x340fd9=_0x340fd9||0xcc;return function(_0x14755a){if(_0x14755a){return _0x2a65cf['sendStatus'](_0x340fd9);}return _0x2a65cf[_0x6dae('0x1c')](_0x340fd9)[_0x6dae('0x1d')]();};}function respondWithResult(_0x118b9a,_0x475687){_0x475687=_0x475687||0xc8;return function(_0x305fe3){if(_0x305fe3){return _0x118b9a[_0x6dae('0x1c')](_0x475687)[_0x6dae('0x1e')](_0x305fe3);}};}function respondWithFilteredResult(_0x1e906c,_0x5b9d0a){return function(_0x598b5e){if(_0x598b5e){var _0x4db28e=typeof _0x5b9d0a[_0x6dae('0x1f')]==='undefined'&&typeof _0x5b9d0a['limit']===_0x6dae('0x20');var _0x59474d=_0x598b5e[_0x6dae('0x21')];var _0x99d989=_0x4db28e?0x0:_0x5b9d0a[_0x6dae('0x1f')];var _0x4e3728=_0x4db28e?_0x598b5e[_0x6dae('0x21')]:_0x5b9d0a[_0x6dae('0x1f')]+_0x5b9d0a[_0x6dae('0x22')];var _0x2e208f;if(_0x4e3728>=_0x59474d){_0x4e3728=_0x59474d;_0x2e208f=0xc8;}else{_0x2e208f=0xce;}_0x1e906c[_0x6dae('0x1c')](_0x2e208f);return _0x1e906c[_0x6dae('0x23')](_0x6dae('0x24'),_0x99d989+'-'+_0x4e3728+'/'+_0x59474d)[_0x6dae('0x1e')](_0x598b5e);}return null;};}function patchUpdates(_0x111c8a){return function(_0x18ece1){try{jsonpatch['apply'](_0x18ece1,_0x111c8a,!![]);}catch(_0x1e9b41){return BPromise[_0x6dae('0x25')](_0x1e9b41);}return _0x18ece1[_0x6dae('0x26')]();};}function saveUpdates(_0x5e453b,_0x3dbebe){return function(_0x4d8c98){if(_0x4d8c98){return _0x4d8c98['update'](_0x5e453b)[_0x6dae('0x27')](function(_0x3ee32d){return _0x3ee32d;});}return null;};}function removeEntity(_0x303826,_0x38d15a){return function(_0x802069){if(_0x802069){return _0x802069[_0x6dae('0x28')]()[_0x6dae('0x27')](function(){_0x303826[_0x6dae('0x1c')](0xcc)[_0x6dae('0x1d')]();});}};}function handleEntityNotFound(_0x21d180,_0x41a6ad){return function(_0x356fc6){if(!_0x356fc6){_0x21d180[_0x6dae('0x29')](0x194);}return _0x356fc6;};}function handleError(_0x10ff5c,_0x5c85d5){_0x5c85d5=_0x5c85d5||0x1f4;return function(_0x16902c){logger[_0x6dae('0x2a')](_0x16902c['stack']);if(_0x16902c[_0x6dae('0x2b')]){delete _0x16902c[_0x6dae('0x2b')];}_0x10ff5c[_0x6dae('0x1c')](_0x5c85d5)['send'](_0x16902c);};}exports['index']=function(_0x2c3e64,_0xcb6bfe){var _0xc60366={},_0x145717={},_0x38a77b={'count':0x0,'rows':[]};var _0x7dff70=_[_0x6dae('0x2c')](db['SquareReport'][_0x6dae('0x2d')],function(_0x293bbc){return{'name':_0x293bbc[_0x6dae('0x2e')],'type':_0x293bbc['type'][_0x6dae('0x2f')]};});_0x145717[_0x6dae('0x30')]=_[_0x6dae('0x2c')](_0x7dff70,_0x6dae('0x2b'));_0x145717[_0x6dae('0x31')]=_[_0x6dae('0x32')](_0x2c3e64[_0x6dae('0x31')]);_0x145717[_0x6dae('0x33')]=_[_0x6dae('0x34')](_0x145717['model'],_0x145717[_0x6dae('0x31')]);_0xc60366[_0x6dae('0x35')]=_[_0x6dae('0x34')](_0x145717[_0x6dae('0x30')],qs[_0x6dae('0x36')](_0x2c3e64[_0x6dae('0x31')][_0x6dae('0x36')]));_0xc60366[_0x6dae('0x35')]=_0xc60366['attributes']['length']?_0xc60366[_0x6dae('0x35')]:_0x145717[_0x6dae('0x30')];if(!_0x2c3e64[_0x6dae('0x31')][_0x6dae('0x37')](_0x6dae('0x38'))){_0xc60366['limit']=qs[_0x6dae('0x22')](_0x2c3e64['query'][_0x6dae('0x22')]);_0xc60366[_0x6dae('0x1f')]=qs[_0x6dae('0x1f')](_0x2c3e64[_0x6dae('0x31')][_0x6dae('0x1f')]);}_0xc60366[_0x6dae('0x39')]=qs['sort'](_0x2c3e64[_0x6dae('0x31')][_0x6dae('0x3a')]);_0xc60366[_0x6dae('0x3b')]=qs[_0x6dae('0x33')](_[_0x6dae('0x3c')](_0x2c3e64[_0x6dae('0x31')],_0x145717[_0x6dae('0x33')]),_0x7dff70);if(_0x2c3e64[_0x6dae('0x31')][_0x6dae('0x3d')]){_0xc60366[_0x6dae('0x3b')]=_[_0x6dae('0x3e')](_0xc60366['where'],{'$or':_[_0x6dae('0x2c')](_0x7dff70,function(_0x2ec667){if(_0x2ec667[_0x6dae('0x3f')]!==_0x6dae('0x40')){var _0x780d7f={};_0x780d7f[_0x2ec667[_0x6dae('0x2b')]]={'$like':'%'+_0x2c3e64[_0x6dae('0x31')][_0x6dae('0x3d')]+'%'};return _0x780d7f;}})});}_0xc60366=_[_0x6dae('0x3e')]({},_0xc60366,_0x2c3e64[_0x6dae('0x41')]);var _0x5cf747={'where':_0xc60366[_0x6dae('0x3b')]};return db[_0x6dae('0x42')][_0x6dae('0x21')](_0x5cf747)[_0x6dae('0x27')](function(_0x3479b4){_0x38a77b[_0x6dae('0x21')]=_0x3479b4;if(_0x2c3e64[_0x6dae('0x31')][_0x6dae('0x43')]){_0xc60366[_0x6dae('0x44')]=[{'all':!![]}];}return db[_0x6dae('0x42')][_0x6dae('0x45')](_0xc60366);})[_0x6dae('0x27')](function(_0x57efe1){_0x38a77b[_0x6dae('0x46')]=_0x57efe1;return _0x38a77b;})['then'](respondWithFilteredResult(_0xcb6bfe,_0xc60366))[_0x6dae('0x47')](handleError(_0xcb6bfe,null));};exports['show']=function(_0x2724b2,_0x414723){var _0xb37b92={'raw':!![],'where':{'id':_0x2724b2[_0x6dae('0x48')]['id']}},_0x3c4769={};_0x3c4769[_0x6dae('0x30')]=_[_0x6dae('0x32')](db['SquareReport'][_0x6dae('0x2d')]);_0x3c4769[_0x6dae('0x31')]=_[_0x6dae('0x32')](_0x2724b2[_0x6dae('0x31')]);_0x3c4769['filters']=_[_0x6dae('0x34')](_0x3c4769[_0x6dae('0x30')],_0x3c4769[_0x6dae('0x31')]);_0xb37b92[_0x6dae('0x35')]=_[_0x6dae('0x34')](_0x3c4769[_0x6dae('0x30')],qs[_0x6dae('0x36')](_0x2724b2['query'][_0x6dae('0x36')]));_0xb37b92[_0x6dae('0x35')]=_0xb37b92[_0x6dae('0x35')][_0x6dae('0x49')]?_0xb37b92[_0x6dae('0x35')]:_0x3c4769[_0x6dae('0x30')];if(_0x2724b2['query'][_0x6dae('0x43')]){_0xb37b92['include']=[{'all':!![]}];}_0xb37b92=_[_0x6dae('0x3e')]({},_0xb37b92,_0x2724b2[_0x6dae('0x41')]);return db[_0x6dae('0x42')][_0x6dae('0x4a')](_0xb37b92)[_0x6dae('0x27')](handleEntityNotFound(_0x414723,null))[_0x6dae('0x27')](respondWithResult(_0x414723,null))[_0x6dae('0x47')](handleError(_0x414723,null));};exports[_0x6dae('0x4b')]=function(_0x5f0dcc,_0x3fbc2d){return db[_0x6dae('0x42')]['create'](_0x5f0dcc[_0x6dae('0x4c')],{})[_0x6dae('0x27')](respondWithResult(_0x3fbc2d,0xc9))[_0x6dae('0x47')](handleError(_0x3fbc2d,null));};exports[_0x6dae('0x4d')]=function(_0x5af5f6,_0x263f9b){if(_0x5af5f6[_0x6dae('0x4c')]['id']){delete _0x5af5f6[_0x6dae('0x4c')]['id'];}return db['SquareReport'][_0x6dae('0x4a')]({'where':{'id':_0x5af5f6[_0x6dae('0x48')]['id']}})[_0x6dae('0x27')](handleEntityNotFound(_0x263f9b,null))[_0x6dae('0x27')](saveUpdates(_0x5af5f6[_0x6dae('0x4c')],null))['then'](respondWithResult(_0x263f9b,null))[_0x6dae('0x47')](handleError(_0x263f9b,null));};exports[_0x6dae('0x28')]=function(_0x31db90,_0x5a1bbc){return db[_0x6dae('0x42')][_0x6dae('0x4a')]({'where':{'id':_0x31db90[_0x6dae('0x48')]['id']}})[_0x6dae('0x27')](handleEntityNotFound(_0x5a1bbc,null))['then'](removeEntity(_0x5a1bbc,null))[_0x6dae('0x47')](handleError(_0x5a1bbc,null));};exports[_0x6dae('0x4e')]=function(_0x2fb20c,_0xc10c73){return db[_0x6dae('0x42')][_0x6dae('0x4e')]()['then'](respondWithResult(_0xc10c73,null))[_0x6dae('0x47')](handleError(_0xc10c73,null));}; \ No newline at end of file +var _0x9e1b=['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/logger','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','SquareReport','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x9e1b,0x125));var _0xb9e1=function(_0x58491b,_0x698a3c){_0x58491b=_0x58491b-0x0;var _0x2d19a3=_0x9e1b[_0x58491b];return _0x2d19a3;};'use strict';var emlformat=require(_0xb9e1('0x0'));var rimraf=require(_0xb9e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9e1('0x2'));var rp=require(_0xb9e1('0x3'));var moment=require(_0xb9e1('0x4'));var BPromise=require(_0xb9e1('0x5'));var Mustache=require(_0xb9e1('0x6'));var util=require('util');var path=require(_0xb9e1('0x7'));var sox=require(_0xb9e1('0x8'));var csv=require(_0xb9e1('0x9'));var ejs=require(_0xb9e1('0xa'));var fs=require('fs');var fs_extra=require(_0xb9e1('0xb'));var _=require(_0xb9e1('0xc'));var squel=require(_0xb9e1('0xd'));var crypto=require(_0xb9e1('0xe'));var jsforce=require(_0xb9e1('0xf'));var deskjs=require(_0xb9e1('0x10'));var toCsv=require(_0xb9e1('0x9'));var querystring=require(_0xb9e1('0x11'));var Papa=require('papaparse');var Redis=require(_0xb9e1('0x12'));var authService=require(_0xb9e1('0x13'));var qs=require(_0xb9e1('0x14'));var as=require(_0xb9e1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9e1('0x16'))('api');var utils=require(_0xb9e1('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9e1('0x18'))['db'];function respondWithStatusCode(_0x24f78b,_0x4a8e9c){_0x4a8e9c=_0x4a8e9c||0xcc;return function(_0x5a0970){if(_0x5a0970){return _0x24f78b['sendStatus'](_0x4a8e9c);}return _0x24f78b[_0xb9e1('0x19')](_0x4a8e9c)['end']();};}function respondWithResult(_0x360441,_0x2ac7e8){_0x2ac7e8=_0x2ac7e8||0xc8;return function(_0x4f06f2){if(_0x4f06f2){return _0x360441['status'](_0x2ac7e8)[_0xb9e1('0x1a')](_0x4f06f2);}};}function respondWithFilteredResult(_0x3d6546,_0x459d83){return function(_0x28ae06){if(_0x28ae06){var _0x36a6ea=typeof _0x459d83[_0xb9e1('0x1b')]===_0xb9e1('0x1c')&&typeof _0x459d83[_0xb9e1('0x1d')]===_0xb9e1('0x1c');var _0x43631e=_0x28ae06['count'];var _0xe27c7d=_0x36a6ea?0x0:_0x459d83[_0xb9e1('0x1b')];var _0x4ce35a=_0x36a6ea?_0x28ae06[_0xb9e1('0x1e')]:_0x459d83[_0xb9e1('0x1b')]+_0x459d83['limit'];var _0x3aeca8;if(_0x4ce35a>=_0x43631e){_0x4ce35a=_0x43631e;_0x3aeca8=0xc8;}else{_0x3aeca8=0xce;}_0x3d6546[_0xb9e1('0x19')](_0x3aeca8);return _0x3d6546[_0xb9e1('0x1f')](_0xb9e1('0x20'),_0xe27c7d+'-'+_0x4ce35a+'/'+_0x43631e)[_0xb9e1('0x1a')](_0x28ae06);}return null;};}function patchUpdates(_0xbc5017){return function(_0x420bd6){try{jsonpatch[_0xb9e1('0x21')](_0x420bd6,_0xbc5017,!![]);}catch(_0x1fb9f1){return BPromise[_0xb9e1('0x22')](_0x1fb9f1);}return _0x420bd6[_0xb9e1('0x23')]();};}function saveUpdates(_0x14d22e,_0x102574){return function(_0x3836a0){if(_0x3836a0){return _0x3836a0[_0xb9e1('0x24')](_0x14d22e)[_0xb9e1('0x25')](function(_0x3f1361){return _0x3f1361;});}return null;};}function removeEntity(_0x7ba87e,_0x5a6832){return function(_0x224104){if(_0x224104){return _0x224104['destroy']()[_0xb9e1('0x25')](function(){_0x7ba87e[_0xb9e1('0x19')](0xcc)[_0xb9e1('0x26')]();});}};}function handleEntityNotFound(_0x463284,_0x2cc60e){return function(_0x3b72d7){if(!_0x3b72d7){_0x463284['sendStatus'](0x194);}return _0x3b72d7;};}function handleError(_0x1daf4a,_0x5f2844){_0x5f2844=_0x5f2844||0x1f4;return function(_0x2051b1){logger[_0xb9e1('0x27')](_0x2051b1[_0xb9e1('0x28')]);if(_0x2051b1[_0xb9e1('0x29')]){delete _0x2051b1[_0xb9e1('0x29')];}_0x1daf4a[_0xb9e1('0x19')](_0x5f2844)[_0xb9e1('0x2a')](_0x2051b1);};}exports[_0xb9e1('0x2b')]=function(_0x36688d,_0x3f672e){var _0x186ca3={},_0x13c609={},_0x42563d={'count':0x0,'rows':[]};var _0x5c51c7=_['map'](db[_0xb9e1('0x2c')][_0xb9e1('0x2d')],function(_0x288f58){return{'name':_0x288f58['fieldName'],'type':_0x288f58[_0xb9e1('0x2e')]['key']};});_0x13c609[_0xb9e1('0x2f')]=_[_0xb9e1('0x30')](_0x5c51c7,'name');_0x13c609[_0xb9e1('0x31')]=_[_0xb9e1('0x32')](_0x36688d[_0xb9e1('0x31')]);_0x13c609['filters']=_[_0xb9e1('0x33')](_0x13c609[_0xb9e1('0x2f')],_0x13c609['query']);_0x186ca3['attributes']=_['intersection'](_0x13c609[_0xb9e1('0x2f')],qs[_0xb9e1('0x34')](_0x36688d[_0xb9e1('0x31')][_0xb9e1('0x34')]));_0x186ca3['attributes']=_0x186ca3[_0xb9e1('0x35')]['length']?_0x186ca3['attributes']:_0x13c609['model'];if(!_0x36688d['query'][_0xb9e1('0x36')]('nolimit')){_0x186ca3[_0xb9e1('0x1d')]=qs[_0xb9e1('0x1d')](_0x36688d['query']['limit']);_0x186ca3[_0xb9e1('0x1b')]=qs[_0xb9e1('0x1b')](_0x36688d[_0xb9e1('0x31')][_0xb9e1('0x1b')]);}_0x186ca3[_0xb9e1('0x37')]=qs[_0xb9e1('0x38')](_0x36688d['query'][_0xb9e1('0x38')]);_0x186ca3[_0xb9e1('0x39')]=qs['filters'](_[_0xb9e1('0x3a')](_0x36688d[_0xb9e1('0x31')],_0x13c609[_0xb9e1('0x3b')]),_0x5c51c7);if(_0x36688d[_0xb9e1('0x31')][_0xb9e1('0x3c')]){_0x186ca3['where']=_[_0xb9e1('0x3d')](_0x186ca3[_0xb9e1('0x39')],{'$or':_[_0xb9e1('0x30')](_0x5c51c7,function(_0x3d6379){if(_0x3d6379[_0xb9e1('0x2e')]!=='VIRTUAL'){var _0x8facbf={};_0x8facbf[_0x3d6379[_0xb9e1('0x29')]]={'$like':'%'+_0x36688d[_0xb9e1('0x31')][_0xb9e1('0x3c')]+'%'};return _0x8facbf;}})});}_0x186ca3=_['merge']({},_0x186ca3,_0x36688d['options']);var _0x428e09={'where':_0x186ca3[_0xb9e1('0x39')]};return db['SquareReport'][_0xb9e1('0x1e')](_0x428e09)[_0xb9e1('0x25')](function(_0xd79905){_0x42563d['count']=_0xd79905;if(_0x36688d[_0xb9e1('0x31')][_0xb9e1('0x3e')]){_0x186ca3[_0xb9e1('0x3f')]=[{'all':!![]}];}return db[_0xb9e1('0x2c')][_0xb9e1('0x40')](_0x186ca3);})['then'](function(_0x4299b5){_0x42563d[_0xb9e1('0x41')]=_0x4299b5;return _0x42563d;})[_0xb9e1('0x25')](respondWithFilteredResult(_0x3f672e,_0x186ca3))[_0xb9e1('0x42')](handleError(_0x3f672e,null));};exports[_0xb9e1('0x43')]=function(_0x2e0a97,_0x5c3e74){var _0x1affa4={'raw':!![],'where':{'id':_0x2e0a97[_0xb9e1('0x44')]['id']}},_0x77e3b3={};_0x77e3b3[_0xb9e1('0x2f')]=_['keys'](db[_0xb9e1('0x2c')][_0xb9e1('0x2d')]);_0x77e3b3['query']=_['keys'](_0x2e0a97[_0xb9e1('0x31')]);_0x77e3b3[_0xb9e1('0x3b')]=_[_0xb9e1('0x33')](_0x77e3b3[_0xb9e1('0x2f')],_0x77e3b3['query']);_0x1affa4[_0xb9e1('0x35')]=_['intersection'](_0x77e3b3[_0xb9e1('0x2f')],qs['fields'](_0x2e0a97[_0xb9e1('0x31')][_0xb9e1('0x34')]));_0x1affa4[_0xb9e1('0x35')]=_0x1affa4[_0xb9e1('0x35')][_0xb9e1('0x45')]?_0x1affa4[_0xb9e1('0x35')]:_0x77e3b3[_0xb9e1('0x2f')];if(_0x2e0a97[_0xb9e1('0x31')]['includeAll']){_0x1affa4[_0xb9e1('0x3f')]=[{'all':!![]}];}_0x1affa4=_[_0xb9e1('0x3d')]({},_0x1affa4,_0x2e0a97[_0xb9e1('0x46')]);return db[_0xb9e1('0x2c')][_0xb9e1('0x47')](_0x1affa4)[_0xb9e1('0x25')](handleEntityNotFound(_0x5c3e74,null))[_0xb9e1('0x25')](respondWithResult(_0x5c3e74,null))[_0xb9e1('0x42')](handleError(_0x5c3e74,null));};exports['create']=function(_0x453daf,_0x4af687){return db[_0xb9e1('0x2c')]['create'](_0x453daf[_0xb9e1('0x48')],{})['then'](respondWithResult(_0x4af687,0xc9))[_0xb9e1('0x42')](handleError(_0x4af687,null));};exports['update']=function(_0x351d58,_0x1694a2){if(_0x351d58[_0xb9e1('0x48')]['id']){delete _0x351d58[_0xb9e1('0x48')]['id'];}return db[_0xb9e1('0x2c')][_0xb9e1('0x47')]({'where':{'id':_0x351d58[_0xb9e1('0x44')]['id']}})[_0xb9e1('0x25')](handleEntityNotFound(_0x1694a2,null))[_0xb9e1('0x25')](saveUpdates(_0x351d58[_0xb9e1('0x48')],null))['then'](respondWithResult(_0x1694a2,null))['catch'](handleError(_0x1694a2,null));};exports[_0xb9e1('0x49')]=function(_0x56d85c,_0x479a6c){return db[_0xb9e1('0x2c')]['find']({'where':{'id':_0x56d85c[_0xb9e1('0x44')]['id']}})[_0xb9e1('0x25')](handleEntityNotFound(_0x479a6c,null))[_0xb9e1('0x25')](removeEntity(_0x479a6c,null))[_0xb9e1('0x42')](handleError(_0x479a6c,null));};exports[_0xb9e1('0x4a')]=function(_0x16538f,_0x2df7a5){return db[_0xb9e1('0x2c')]['describe']()[_0xb9e1('0x25')](respondWithResult(_0x2df7a5,null))[_0xb9e1('0x42')](handleError(_0x2df7a5,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5afa0ce..1e5faa0 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 _0xc52c=['moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1d1c33,_0x436a15){var _0x1393a6=function(_0x188cab){while(--_0x188cab){_0x1d1c33['push'](_0x1d1c33['shift']());}};_0x1393a6(++_0x436a15);}(_0xc52c,0x119));var _0xcc52=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0xc52c[_0x423549];return _0xdcb104;};'use strict';var _=require(_0xcc52('0x0'));var util=require(_0xcc52('0x1'));var logger=require(_0xcc52('0x2'))(_0xcc52('0x3'));var moment=require(_0xcc52('0x4'));var BPromise=require(_0xcc52('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc52('0x6'));var rimraf=require(_0xcc52('0x7'));var config=require(_0xcc52('0x8'));var attributes=require(_0xcc52('0x9'));module[_0xcc52('0xa')]=function(_0x34771c,_0x53232d){return _0x34771c[_0xcc52('0xb')](_0xcc52('0xc'),attributes,{'tableName':_0xcc52('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xcc52('0xe'),'project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b8f=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4e07d9,_0x15d276){var _0x508643=function(_0x145846){while(--_0x145846){_0x4e07d9['push'](_0x4e07d9['shift']());}};_0x508643(++_0x15d276);}(_0x8b8f,0x129));var _0xf8b8=function(_0x53061b,_0x16eac0){_0x53061b=_0x53061b-0x0;var _0xc394e=_0x8b8f[_0x53061b];return _0xc394e;};'use strict';var _=require(_0xf8b8('0x0'));var util=require('util');var logger=require(_0xf8b8('0x1'))(_0xf8b8('0x2'));var moment=require(_0xf8b8('0x3'));var BPromise=require(_0xf8b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8b8('0x5'));var rimraf=require('rimraf');var config=require(_0xf8b8('0x6'));var attributes=require(_0xf8b8('0x7'));module[_0xf8b8('0x8')]=function(_0x5f31f7,_0x1e4f1d){return _0x5f31f7[_0xf8b8('0x9')](_0xf8b8('0xa'),attributes,{'tableName':_0xf8b8('0xb'),'paranoid':![],'indexes':[{'name':_0xf8b8('0xc'),'fields':[_0xf8b8('0xd'),_0xf8b8('0xe')]},{'name':'leaveAt','fields':[_0xf8b8('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 96f05f5..5cde66c 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 _0x780a=['options','raw','UpdateSquareReport','SquareReport','update','body','where','attributes','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','CreateSquareReport','create'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0x780a,0x1c3));var _0xa780=function(_0x4b91bb,_0x59744a){_0x4b91bb=_0x4b91bb-0x0;var _0x17064c=_0x780a[_0x4b91bb];return _0x17064c;};'use strict';var _=require(_0xa780('0x0'));var util=require(_0xa780('0x1'));var moment=require(_0xa780('0x2'));var BPromise=require('bluebird');var rs=require(_0xa780('0x3'));var fs=require('fs');var Redis=require(_0xa780('0x4'));var db=require(_0xa780('0x5'))['db'];var utils=require(_0xa780('0x6'));var logger=require(_0xa780('0x7'))(_0xa780('0x8'));var config=require('../../config/environment');var jayson=require(_0xa780('0x9'));var client=jayson[_0xa780('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45c519,_0x1076a6,_0x4c41f7){return new BPromise(function(_0x30c2b0,_0x3cfdef){return client[_0xa780('0xb')](_0x45c519,_0x4c41f7)[_0xa780('0xc')](function(_0x3a41d3){logger[_0xa780('0xd')]('SquareReport,\x20%s,\x20%s',_0x1076a6,_0xa780('0xe'));logger[_0xa780('0xf')](_0xa780('0x10'),_0x1076a6,'request\x20sent',JSON[_0xa780('0x11')](_0x3a41d3));if(_0x3a41d3['error']){if(_0x3a41d3[_0xa780('0x12')][_0xa780('0x13')]===0x1f4){logger[_0xa780('0x12')](_0xa780('0x14'),_0x1076a6,_0x3a41d3['error'][_0xa780('0x15')]);return _0x3cfdef(_0x3a41d3[_0xa780('0x12')]['message']);}logger[_0xa780('0x12')]('SquareReport,\x20%s,\x20%s',_0x1076a6,_0x3a41d3['error']['message']);return _0x30c2b0(_0x3a41d3['error'][_0xa780('0x15')]);}else{logger[_0xa780('0xd')]('SquareReport,\x20%s,\x20%s',_0x1076a6,_0xa780('0xe'));_0x30c2b0(_0x3a41d3[_0xa780('0x16')][_0xa780('0x15')]);}})['catch'](function(_0x1fa0ec){logger[_0xa780('0x12')](_0xa780('0x14'),_0x1076a6,_0x1fa0ec);_0x3cfdef(_0x1fa0ec);});});}exports[_0xa780('0x17')]=function(_0x513c94){var _0x2cf5fb=this;return new Promise(function(_0x48f572,_0x5e435b){return db['SquareReport'][_0xa780('0x18')](_0x513c94['body'],{'raw':_0x513c94['options']?_0x513c94[_0xa780('0x19')][_0xa780('0x1a')]===undefined?!![]:![]:!![]})[_0xa780('0xc')](function(_0x1bfc10){logger[_0xa780('0xd')]('CreateSquareReport',_0x513c94);logger[_0xa780('0xf')](_0xa780('0x17'),_0x513c94,JSON[_0xa780('0x11')](_0x1bfc10));_0x48f572(_0x1bfc10);})['catch'](function(_0x36fcce){logger[_0xa780('0x12')](_0xa780('0x17'),_0x36fcce[_0xa780('0x15')],_0x513c94);_0x5e435b(_0x2cf5fb[_0xa780('0x12')](0x1f4,_0x36fcce[_0xa780('0x15')]));});});};exports[_0xa780('0x1b')]=function(_0x384bab){var _0x284e8c=this;return new Promise(function(_0x2df3af,_0x5e08a8){return db[_0xa780('0x1c')][_0xa780('0x1d')](_0x384bab[_0xa780('0x1e')],{'raw':_0x384bab[_0xa780('0x19')]?_0x384bab['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x384bab[_0xa780('0x19')]?_0x384bab[_0xa780('0x19')][_0xa780('0x1f')]||null:null,'attributes':_0x384bab[_0xa780('0x19')]?_0x384bab[_0xa780('0x19')][_0xa780('0x20')]||null:null,'limit':_0x384bab[_0xa780('0x19')]?_0x384bab['options']['limit']||null:null})['then'](function(_0x5bdd18){logger[_0xa780('0xd')](_0xa780('0x1b'),_0x384bab);logger[_0xa780('0xf')](_0xa780('0x1b'),_0x384bab,JSON[_0xa780('0x11')](_0x5bdd18));_0x2df3af(_0x5bdd18);})[_0xa780('0x21')](function(_0x46dfcd){logger['error'](_0xa780('0x1b'),_0x46dfcd[_0xa780('0x15')],_0x384bab);_0x5e08a8(_0x284e8c['error'](0x1f4,_0x46dfcd['message']));});});}; \ No newline at end of file +var _0x341a=['options','raw','then','UpdateSquareReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','body'];(function(_0x130e28,_0x2a818c){var _0x53fde5=function(_0x35697e){while(--_0x35697e){_0x130e28['push'](_0x130e28['shift']());}};_0x53fde5(++_0x2a818c);}(_0x341a,0xee));var _0xa341=function(_0x529928,_0x16354b){_0x529928=_0x529928-0x0;var _0x47fc42=_0x341a[_0x529928];return _0x47fc42;};'use strict';var _=require(_0xa341('0x0'));var util=require(_0xa341('0x1'));var moment=require(_0xa341('0x2'));var BPromise=require(_0xa341('0x3'));var rs=require(_0xa341('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa341('0x5'))['db'];var utils=require(_0xa341('0x6'));var logger=require('../../config/logger')(_0xa341('0x7'));var config=require(_0xa341('0x8'));var jayson=require(_0xa341('0x9'));var client=jayson[_0xa341('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x450345,_0x3b17a4,_0x911418){return new BPromise(function(_0x4fef29,_0x4976f2){return client[_0xa341('0xb')](_0x450345,_0x911418)['then'](function(_0x1a66b8){logger['info'](_0xa341('0xc'),_0x3b17a4,_0xa341('0xd'));logger[_0xa341('0xe')](_0xa341('0xf'),_0x3b17a4,'request\x20sent',JSON[_0xa341('0x10')](_0x1a66b8));if(_0x1a66b8[_0xa341('0x11')]){if(_0x1a66b8[_0xa341('0x11')][_0xa341('0x12')]===0x1f4){logger[_0xa341('0x11')](_0xa341('0xc'),_0x3b17a4,_0x1a66b8[_0xa341('0x11')][_0xa341('0x13')]);return _0x4976f2(_0x1a66b8[_0xa341('0x11')][_0xa341('0x13')]);}logger[_0xa341('0x11')](_0xa341('0xc'),_0x3b17a4,_0x1a66b8[_0xa341('0x11')][_0xa341('0x13')]);return _0x4fef29(_0x1a66b8[_0xa341('0x11')][_0xa341('0x13')]);}else{logger[_0xa341('0x14')](_0xa341('0xc'),_0x3b17a4,_0xa341('0xd'));_0x4fef29(_0x1a66b8[_0xa341('0x15')][_0xa341('0x13')]);}})[_0xa341('0x16')](function(_0x140446){logger['error'](_0xa341('0xc'),_0x3b17a4,_0x140446);_0x4976f2(_0x140446);});});}exports[_0xa341('0x17')]=function(_0x2e7113){var _0x3a5bfe=this;return new Promise(function(_0x1be5b1,_0x36a26a){return db[_0xa341('0x18')]['create'](_0x2e7113[_0xa341('0x19')],{'raw':_0x2e7113[_0xa341('0x1a')]?_0x2e7113[_0xa341('0x1a')][_0xa341('0x1b')]===undefined?!![]:![]:!![]})[_0xa341('0x1c')](function(_0x27df7c){logger['info'](_0xa341('0x17'),_0x2e7113);logger[_0xa341('0xe')](_0xa341('0x17'),_0x2e7113,JSON[_0xa341('0x10')](_0x27df7c));_0x1be5b1(_0x27df7c);})['catch'](function(_0x1a2cb9){logger[_0xa341('0x11')](_0xa341('0x17'),_0x1a2cb9[_0xa341('0x13')],_0x2e7113);_0x36a26a(_0x3a5bfe['error'](0x1f4,_0x1a2cb9[_0xa341('0x13')]));});});};exports[_0xa341('0x1d')]=function(_0x14978f){var _0x32732c=this;return new Promise(function(_0x396fcd,_0x49a621){return db[_0xa341('0x18')][_0xa341('0x1e')](_0x14978f[_0xa341('0x19')],{'raw':_0x14978f[_0xa341('0x1a')]?_0x14978f[_0xa341('0x1a')][_0xa341('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14978f[_0xa341('0x1a')]?_0x14978f[_0xa341('0x1a')]['where']||null:null,'attributes':_0x14978f[_0xa341('0x1a')]?_0x14978f['options'][_0xa341('0x1f')]||null:null,'limit':_0x14978f[_0xa341('0x1a')]?_0x14978f['options'][_0xa341('0x20')]||null:null})[_0xa341('0x1c')](function(_0x539f6f){logger[_0xa341('0x14')]('UpdateSquareReport',_0x14978f);logger[_0xa341('0xe')]('UpdateSquareReport',_0x14978f,JSON['stringify'](_0x539f6f));_0x396fcd(_0x539f6f);})['catch'](function(_0x59b6bc){logger[_0xa341('0x11')]('UpdateSquareReport',_0x59b6bc['message'],_0x14978f);_0x49a621(_0x32732c[_0xa341('0x11')](0x1f4,_0x59b6bc[_0xa341('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9742101..697ef50 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 _0x801b=['index','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x801b,0x196));var _0xb801=function(_0x47f4e0,_0x5a33c9){_0x47f4e0=_0x47f4e0-0x0;var _0x2789bb=_0x801b[_0x47f4e0];return _0x2789bb;};'use strict';var multer=require(_0xb801('0x0'));var util=require(_0xb801('0x1'));var path=require(_0xb801('0x2'));var timeout=require(_0xb801('0x3'));var express=require('express');var router=express[_0xb801('0x4')]();var fs_extra=require(_0xb801('0x5'));var auth=require(_0xb801('0x6'));var interaction=require(_0xb801('0x7'));var config=require(_0xb801('0x8'));var controller=require(_0xb801('0x9'));router[_0xb801('0xa')]('/',auth[_0xb801('0xb')](),controller[_0xb801('0xc')]);router[_0xb801('0xa')]('/describe',auth[_0xb801('0xb')](),controller[_0xb801('0xd')]);router[_0xb801('0xa')](_0xb801('0xe'),auth[_0xb801('0xb')](),controller[_0xb801('0xf')]);router[_0xb801('0x10')]('/',auth['isAuthenticated'](),controller[_0xb801('0x11')]);router[_0xb801('0x12')]('/:id',auth[_0xb801('0xb')](),controller[_0xb801('0x13')]);router[_0xb801('0x14')]('/:id',auth[_0xb801('0xb')](),controller[_0xb801('0x15')]);module['exports']=router; \ No newline at end of file +var _0xca79=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util'];(function(_0x5424dd,_0xb16551){var _0x41af48=function(_0x4a5c65){while(--_0x4a5c65){_0x5424dd['push'](_0x5424dd['shift']());}};_0x41af48(++_0xb16551);}(_0xca79,0x139));var _0x9ca7=function(_0x296d86,_0x426d03){_0x296d86=_0x296d86-0x0;var _0x622e9c=_0xca79[_0x296d86];return _0x622e9c;};'use strict';var multer=require(_0x9ca7('0x0'));var util=require(_0x9ca7('0x1'));var path=require('path');var timeout=require(_0x9ca7('0x2'));var express=require(_0x9ca7('0x3'));var router=express[_0x9ca7('0x4')]();var fs_extra=require(_0x9ca7('0x5'));var auth=require(_0x9ca7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9ca7('0x7'));var controller=require(_0x9ca7('0x8'));router[_0x9ca7('0x9')]('/',auth['isAuthenticated'](),controller[_0x9ca7('0xa')]);router[_0x9ca7('0x9')](_0x9ca7('0xb'),auth['isAuthenticated'](),controller[_0x9ca7('0xc')]);router[_0x9ca7('0x9')](_0x9ca7('0xd'),auth[_0x9ca7('0xe')](),controller['show']);router[_0x9ca7('0xf')]('/',auth[_0x9ca7('0xe')](),controller[_0x9ca7('0x10')]);router[_0x9ca7('0x11')]('/:id',auth[_0x9ca7('0xe')](),controller[_0x9ca7('0x12')]);router[_0x9ca7('0x13')]('/:id',auth[_0x9ca7('0xe')](),controller[_0x9ca7('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 46b20be..25ae108 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 _0x543c=['STRING','TEXT','sequelize'];(function(_0x35ea92,_0xaabf81){var _0x5c4f67=function(_0x22fd31){while(--_0x22fd31){_0x35ea92['push'](_0x35ea92['shift']());}};_0x5c4f67(++_0xaabf81);}(_0x543c,0xf8));var _0xc543=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x543c[_0x3c04ef];return _0x6a3a69;};'use strict';var Sequelize=require(_0xc543('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc543('0x1')]},'node':{'type':Sequelize[_0xc543('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xc543('0x2')]},'project_name':{'type':Sequelize[_0xc543('0x1')]},'callerid':{'type':Sequelize[_0xc543('0x1')]}}; \ No newline at end of file +var _0xd8a6=['TEXT','exports','STRING'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0xd8a6,0x181));var _0x6d8a=function(_0x466804,_0x1a0213){_0x466804=_0x466804-0x0;var _0x547cc4=_0xd8a6[_0x466804];return _0x547cc4;};'use strict';var Sequelize=require('sequelize');module[_0x6d8a('0x0')]={'uniqueid':{'type':Sequelize[_0x6d8a('0x1')]},'node':{'type':Sequelize[_0x6d8a('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x6d8a('0x2')]},'project_name':{'type':Sequelize[_0x6d8a('0x1')]},'callerid':{'type':Sequelize[_0x6d8a('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 80ba159..84cb467 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 _0x915a=['findAll','rows','catch','show','params','keys','options','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','include'];(function(_0x14d81f,_0x4b0bc9){var _0x52306b=function(_0x404ee5){while(--_0x404ee5){_0x14d81f['push'](_0x14d81f['shift']());}};_0x52306b(++_0x4b0bc9);}(_0x915a,0x192));var _0xa915=function(_0x1026cd,_0x5aaadf){_0x1026cd=_0x1026cd-0x0;var _0x1d695f=_0x915a[_0x1026cd];return _0x1d695f;};'use strict';var emlformat=require(_0xa915('0x0'));var rimraf=require(_0xa915('0x1'));var zipdir=require(_0xa915('0x2'));var jsonpatch=require(_0xa915('0x3'));var rp=require('request-promise');var moment=require(_0xa915('0x4'));var BPromise=require(_0xa915('0x5'));var Mustache=require(_0xa915('0x6'));var util=require(_0xa915('0x7'));var path=require(_0xa915('0x8'));var sox=require(_0xa915('0x9'));var csv=require(_0xa915('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa915('0xb'));var _=require(_0xa915('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa915('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa915('0xe'));var Papa=require(_0xa915('0xf'));var Redis=require(_0xa915('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa915('0x11'));var as=require(_0xa915('0x12'));var hardwareService=require(_0xa915('0x13'));var logger=require(_0xa915('0x14'))(_0xa915('0x15'));var utils=require(_0xa915('0x16'));var config=require(_0xa915('0x17'));var licenseUtil=require(_0xa915('0x18'));var db=require(_0xa915('0x19'))['db'];function respondWithStatusCode(_0x2eb95f,_0x9c2622){_0x9c2622=_0x9c2622||0xcc;return function(_0x14a38b){if(_0x14a38b){return _0x2eb95f['sendStatus'](_0x9c2622);}return _0x2eb95f[_0xa915('0x1a')](_0x9c2622)['end']();};}function respondWithResult(_0x2182b5,_0x1794d2){_0x1794d2=_0x1794d2||0xc8;return function(_0x1feb16){if(_0x1feb16){return _0x2182b5[_0xa915('0x1a')](_0x1794d2)[_0xa915('0x1b')](_0x1feb16);}};}function respondWithFilteredResult(_0x152013,_0x27e42e){return function(_0x13d98c){if(_0x13d98c){var _0x445333=typeof _0x27e42e[_0xa915('0x1c')]===_0xa915('0x1d')&&typeof _0x27e42e[_0xa915('0x1e')]==='undefined';var _0x204aaf=_0x13d98c[_0xa915('0x1f')];var _0x2640e7=_0x445333?0x0:_0x27e42e[_0xa915('0x1c')];var _0x225426=_0x445333?_0x13d98c[_0xa915('0x1f')]:_0x27e42e[_0xa915('0x1c')]+_0x27e42e[_0xa915('0x1e')];var _0x1598ba;if(_0x225426>=_0x204aaf){_0x225426=_0x204aaf;_0x1598ba=0xc8;}else{_0x1598ba=0xce;}_0x152013[_0xa915('0x1a')](_0x1598ba);return _0x152013[_0xa915('0x20')](_0xa915('0x21'),_0x2640e7+'-'+_0x225426+'/'+_0x204aaf)[_0xa915('0x1b')](_0x13d98c);}return null;};}function patchUpdates(_0x332c12){return function(_0x44240e){try{jsonpatch[_0xa915('0x22')](_0x44240e,_0x332c12,!![]);}catch(_0x47ac01){return BPromise[_0xa915('0x23')](_0x47ac01);}return _0x44240e['save']();};}function saveUpdates(_0x563a68,_0x537538){return function(_0x465981){if(_0x465981){return _0x465981['update'](_0x563a68)[_0xa915('0x24')](function(_0x2e9965){return _0x2e9965;});}return null;};}function removeEntity(_0x16b6c7,_0x590039){return function(_0x1a407c){if(_0x1a407c){return _0x1a407c[_0xa915('0x25')]()[_0xa915('0x24')](function(){_0x16b6c7[_0xa915('0x1a')](0xcc)[_0xa915('0x26')]();});}};}function handleEntityNotFound(_0x500382,_0x524a9f){return function(_0x1a04c1){if(!_0x1a04c1){_0x500382['sendStatus'](0x194);}return _0x1a04c1;};}function handleError(_0xfb5164,_0x1e2149){_0x1e2149=_0x1e2149||0x1f4;return function(_0x55628d){logger[_0xa915('0x27')](_0x55628d[_0xa915('0x28')]);if(_0x55628d['name']){delete _0x55628d[_0xa915('0x29')];}_0xfb5164[_0xa915('0x1a')](_0x1e2149)[_0xa915('0x2a')](_0x55628d);};}exports[_0xa915('0x2b')]=function(_0x53c2dd,_0xe1fa52){var _0xafeb6e={},_0x32c3a3={},_0x5a911c={'count':0x0,'rows':[]};var _0x5df6a0=_[_0xa915('0x2c')](db[_0xa915('0x2d')][_0xa915('0x2e')],function(_0x406b86){return{'name':_0x406b86[_0xa915('0x2f')],'type':_0x406b86[_0xa915('0x30')][_0xa915('0x31')]};});_0x32c3a3[_0xa915('0x32')]=_['map'](_0x5df6a0,_0xa915('0x29'));_0x32c3a3[_0xa915('0x33')]=_['keys'](_0x53c2dd[_0xa915('0x33')]);_0x32c3a3[_0xa915('0x34')]=_['intersection'](_0x32c3a3[_0xa915('0x32')],_0x32c3a3[_0xa915('0x33')]);_0xafeb6e[_0xa915('0x35')]=_[_0xa915('0x36')](_0x32c3a3['model'],qs[_0xa915('0x37')](_0x53c2dd[_0xa915('0x33')][_0xa915('0x37')]));_0xafeb6e[_0xa915('0x35')]=_0xafeb6e[_0xa915('0x35')][_0xa915('0x38')]?_0xafeb6e[_0xa915('0x35')]:_0x32c3a3[_0xa915('0x32')];if(!_0x53c2dd[_0xa915('0x33')][_0xa915('0x39')]('nolimit')){_0xafeb6e[_0xa915('0x1e')]=qs[_0xa915('0x1e')](_0x53c2dd[_0xa915('0x33')]['limit']);_0xafeb6e[_0xa915('0x1c')]=qs['offset'](_0x53c2dd[_0xa915('0x33')][_0xa915('0x1c')]);}_0xafeb6e[_0xa915('0x3a')]=qs[_0xa915('0x3b')](_0x53c2dd[_0xa915('0x33')][_0xa915('0x3b')]);_0xafeb6e[_0xa915('0x3c')]=qs[_0xa915('0x34')](_[_0xa915('0x3d')](_0x53c2dd[_0xa915('0x33')],_0x32c3a3[_0xa915('0x34')]),_0x5df6a0);if(_0x53c2dd[_0xa915('0x33')]['filter']){_0xafeb6e['where']=_[_0xa915('0x3e')](_0xafeb6e[_0xa915('0x3c')],{'$or':_['map'](_0x5df6a0,function(_0x152652){if(_0x152652[_0xa915('0x30')]!=='VIRTUAL'){var _0x3abc67={};_0x3abc67[_0x152652['name']]={'$like':'%'+_0x53c2dd[_0xa915('0x33')][_0xa915('0x3f')]+'%'};return _0x3abc67;}})});}_0xafeb6e=_[_0xa915('0x3e')]({},_0xafeb6e,_0x53c2dd['options']);var _0x282b40={'where':_0xafeb6e[_0xa915('0x3c')]};return db[_0xa915('0x2d')][_0xa915('0x1f')](_0x282b40)[_0xa915('0x24')](function(_0x925422){_0x5a911c['count']=_0x925422;if(_0x53c2dd[_0xa915('0x33')][_0xa915('0x40')]){_0xafeb6e[_0xa915('0x41')]=[{'all':!![]}];}return db[_0xa915('0x2d')][_0xa915('0x42')](_0xafeb6e);})['then'](function(_0x53fb2c){_0x5a911c[_0xa915('0x43')]=_0x53fb2c;return _0x5a911c;})['then'](respondWithFilteredResult(_0xe1fa52,_0xafeb6e))[_0xa915('0x44')](handleError(_0xe1fa52,null));};exports[_0xa915('0x45')]=function(_0x5a7dbe,_0x598c78){var _0x4a1eaa={'raw':!![],'where':{'id':_0x5a7dbe[_0xa915('0x46')]['id']}},_0x766196={};_0x766196[_0xa915('0x32')]=_[_0xa915('0x47')](db[_0xa915('0x2d')][_0xa915('0x2e')]);_0x766196[_0xa915('0x33')]=_[_0xa915('0x47')](_0x5a7dbe[_0xa915('0x33')]);_0x766196[_0xa915('0x34')]=_[_0xa915('0x36')](_0x766196[_0xa915('0x32')],_0x766196[_0xa915('0x33')]);_0x4a1eaa[_0xa915('0x35')]=_['intersection'](_0x766196[_0xa915('0x32')],qs[_0xa915('0x37')](_0x5a7dbe[_0xa915('0x33')][_0xa915('0x37')]));_0x4a1eaa[_0xa915('0x35')]=_0x4a1eaa[_0xa915('0x35')][_0xa915('0x38')]?_0x4a1eaa[_0xa915('0x35')]:_0x766196[_0xa915('0x32')];if(_0x5a7dbe[_0xa915('0x33')][_0xa915('0x40')]){_0x4a1eaa[_0xa915('0x41')]=[{'all':!![]}];}_0x4a1eaa=_[_0xa915('0x3e')]({},_0x4a1eaa,_0x5a7dbe[_0xa915('0x48')]);return db[_0xa915('0x2d')]['find'](_0x4a1eaa)['then'](handleEntityNotFound(_0x598c78,null))[_0xa915('0x24')](respondWithResult(_0x598c78,null))[_0xa915('0x44')](handleError(_0x598c78,null));};exports[_0xa915('0x49')]=function(_0x5c35c3,_0x2cb6a1){return db['SquareDetailsReport'][_0xa915('0x49')](_0x5c35c3['body'],{})['then'](respondWithResult(_0x2cb6a1,0xc9))[_0xa915('0x44')](handleError(_0x2cb6a1,null));};exports[_0xa915('0x4a')]=function(_0x5e5c77,_0x37fc4b){if(_0x5e5c77[_0xa915('0x4b')]['id']){delete _0x5e5c77[_0xa915('0x4b')]['id'];}return db[_0xa915('0x2d')][_0xa915('0x4c')]({'where':{'id':_0x5e5c77[_0xa915('0x46')]['id']}})['then'](handleEntityNotFound(_0x37fc4b,null))['then'](saveUpdates(_0x5e5c77[_0xa915('0x4b')],null))[_0xa915('0x24')](respondWithResult(_0x37fc4b,null))[_0xa915('0x44')](handleError(_0x37fc4b,null));};exports[_0xa915('0x25')]=function(_0x268eba,_0x3650ff){return db[_0xa915('0x2d')]['find']({'where':{'id':_0x268eba[_0xa915('0x46')]['id']}})[_0xa915('0x24')](handleEntityNotFound(_0x3650ff,null))[_0xa915('0x24')](removeEntity(_0x3650ff,null))[_0xa915('0x44')](handleError(_0x3650ff,null));};exports[_0xa915('0x4d')]=function(_0x59363d,_0x4bd7aa){return db[_0xa915('0x2d')]['describe']()[_0xa915('0x24')](respondWithResult(_0x4bd7aa,null))[_0xa915('0x44')](handleError(_0x4bd7aa,null));}; \ No newline at end of file +var _0xf624=['filter','merge','SquareDetailsReport','includeAll','rows','catch','show','params','keys','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x3d11be,_0x1b9a8c){var _0x4b657b=function(_0x4a96f2){while(--_0x4a96f2){_0x3d11be['push'](_0x3d11be['shift']());}};_0x4b657b(++_0x1b9a8c);}(_0xf624,0x186));var _0x4f62=function(_0x42b15f,_0x238214){_0x42b15f=_0x42b15f-0x0;var _0x34d3ee=_0xf624[_0x42b15f];return _0x34d3ee;};'use strict';var emlformat=require(_0x4f62('0x0'));var rimraf=require(_0x4f62('0x1'));var zipdir=require(_0x4f62('0x2'));var jsonpatch=require(_0x4f62('0x3'));var rp=require(_0x4f62('0x4'));var moment=require(_0x4f62('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4f62('0x6'));var util=require(_0x4f62('0x7'));var path=require(_0x4f62('0x8'));var sox=require(_0x4f62('0x9'));var csv=require('to-csv');var ejs=require(_0x4f62('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f62('0xb'));var squel=require(_0x4f62('0xc'));var crypto=require(_0x4f62('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4f62('0xe'));var toCsv=require(_0x4f62('0xf'));var querystring=require(_0x4f62('0x10'));var Papa=require('papaparse');var Redis=require(_0x4f62('0x11'));var authService=require(_0x4f62('0x12'));var qs=require(_0x4f62('0x13'));var as=require(_0x4f62('0x14'));var hardwareService=require(_0x4f62('0x15'));var logger=require('../../config/logger')(_0x4f62('0x16'));var utils=require('../../config/utils');var config=require(_0x4f62('0x17'));var licenseUtil=require(_0x4f62('0x18'));var db=require(_0x4f62('0x19'))['db'];function respondWithStatusCode(_0x2e1b6d,_0x2b32d8){_0x2b32d8=_0x2b32d8||0xcc;return function(_0x1b0a94){if(_0x1b0a94){return _0x2e1b6d[_0x4f62('0x1a')](_0x2b32d8);}return _0x2e1b6d[_0x4f62('0x1b')](_0x2b32d8)[_0x4f62('0x1c')]();};}function respondWithResult(_0x51075f,_0x466c59){_0x466c59=_0x466c59||0xc8;return function(_0x5bfb3b){if(_0x5bfb3b){return _0x51075f[_0x4f62('0x1b')](_0x466c59)[_0x4f62('0x1d')](_0x5bfb3b);}};}function respondWithFilteredResult(_0x540d64,_0x2698d5){return function(_0x21d701){if(_0x21d701){var _0x14763b=typeof _0x2698d5[_0x4f62('0x1e')]===_0x4f62('0x1f')&&typeof _0x2698d5[_0x4f62('0x20')]===_0x4f62('0x1f');var _0x316307=_0x21d701[_0x4f62('0x21')];var _0x480128=_0x14763b?0x0:_0x2698d5[_0x4f62('0x1e')];var _0x113af8=_0x14763b?_0x21d701[_0x4f62('0x21')]:_0x2698d5[_0x4f62('0x1e')]+_0x2698d5[_0x4f62('0x20')];var _0x20304e;if(_0x113af8>=_0x316307){_0x113af8=_0x316307;_0x20304e=0xc8;}else{_0x20304e=0xce;}_0x540d64[_0x4f62('0x1b')](_0x20304e);return _0x540d64[_0x4f62('0x22')](_0x4f62('0x23'),_0x480128+'-'+_0x113af8+'/'+_0x316307)[_0x4f62('0x1d')](_0x21d701);}return null;};}function patchUpdates(_0x28886e){return function(_0x49a4f4){try{jsonpatch[_0x4f62('0x24')](_0x49a4f4,_0x28886e,!![]);}catch(_0x2c89cc){return BPromise['reject'](_0x2c89cc);}return _0x49a4f4[_0x4f62('0x25')]();};}function saveUpdates(_0x5095b5,_0x3848e7){return function(_0x28c4e8){if(_0x28c4e8){return _0x28c4e8[_0x4f62('0x26')](_0x5095b5)['then'](function(_0x5487c1){return _0x5487c1;});}return null;};}function removeEntity(_0x54d2fa,_0x757eb2){return function(_0x52b715){if(_0x52b715){return _0x52b715[_0x4f62('0x27')]()[_0x4f62('0x28')](function(){_0x54d2fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x592052,_0x568ab2){return function(_0x1d0cf4){if(!_0x1d0cf4){_0x592052[_0x4f62('0x1a')](0x194);}return _0x1d0cf4;};}function handleError(_0x2521c1,_0x99c216){_0x99c216=_0x99c216||0x1f4;return function(_0x278432){logger['error'](_0x278432[_0x4f62('0x29')]);if(_0x278432[_0x4f62('0x2a')]){delete _0x278432[_0x4f62('0x2a')];}_0x2521c1['status'](_0x99c216)[_0x4f62('0x2b')](_0x278432);};}exports[_0x4f62('0x2c')]=function(_0x37b1dc,_0x1fe725){var _0x3b4129={},_0x417798={},_0x44e2a4={'count':0x0,'rows':[]};var _0x1fecae=_[_0x4f62('0x2d')](db['SquareDetailsReport'][_0x4f62('0x2e')],function(_0x155b6d){return{'name':_0x155b6d['fieldName'],'type':_0x155b6d[_0x4f62('0x2f')][_0x4f62('0x30')]};});_0x417798[_0x4f62('0x31')]=_['map'](_0x1fecae,'name');_0x417798['query']=_['keys'](_0x37b1dc[_0x4f62('0x32')]);_0x417798[_0x4f62('0x33')]=_['intersection'](_0x417798[_0x4f62('0x31')],_0x417798[_0x4f62('0x32')]);_0x3b4129[_0x4f62('0x34')]=_[_0x4f62('0x35')](_0x417798[_0x4f62('0x31')],qs[_0x4f62('0x36')](_0x37b1dc[_0x4f62('0x32')][_0x4f62('0x36')]));_0x3b4129[_0x4f62('0x34')]=_0x3b4129[_0x4f62('0x34')]['length']?_0x3b4129[_0x4f62('0x34')]:_0x417798['model'];if(!_0x37b1dc[_0x4f62('0x32')][_0x4f62('0x37')](_0x4f62('0x38'))){_0x3b4129[_0x4f62('0x20')]=qs[_0x4f62('0x20')](_0x37b1dc['query'][_0x4f62('0x20')]);_0x3b4129[_0x4f62('0x1e')]=qs[_0x4f62('0x1e')](_0x37b1dc[_0x4f62('0x32')][_0x4f62('0x1e')]);}_0x3b4129['order']=qs[_0x4f62('0x39')](_0x37b1dc[_0x4f62('0x32')]['sort']);_0x3b4129[_0x4f62('0x3a')]=qs[_0x4f62('0x33')](_[_0x4f62('0x3b')](_0x37b1dc[_0x4f62('0x32')],_0x417798['filters']),_0x1fecae);if(_0x37b1dc[_0x4f62('0x32')][_0x4f62('0x3c')]){_0x3b4129['where']=_[_0x4f62('0x3d')](_0x3b4129['where'],{'$or':_[_0x4f62('0x2d')](_0x1fecae,function(_0x5894ad){if(_0x5894ad[_0x4f62('0x2f')]!=='VIRTUAL'){var _0x12b491={};_0x12b491[_0x5894ad[_0x4f62('0x2a')]]={'$like':'%'+_0x37b1dc[_0x4f62('0x32')]['filter']+'%'};return _0x12b491;}})});}_0x3b4129=_[_0x4f62('0x3d')]({},_0x3b4129,_0x37b1dc['options']);var _0x35142d={'where':_0x3b4129['where']};return db[_0x4f62('0x3e')]['count'](_0x35142d)[_0x4f62('0x28')](function(_0x14e1d0){_0x44e2a4['count']=_0x14e1d0;if(_0x37b1dc[_0x4f62('0x32')][_0x4f62('0x3f')]){_0x3b4129['include']=[{'all':!![]}];}return db[_0x4f62('0x3e')]['findAll'](_0x3b4129);})[_0x4f62('0x28')](function(_0x69ca67){_0x44e2a4[_0x4f62('0x40')]=_0x69ca67;return _0x44e2a4;})[_0x4f62('0x28')](respondWithFilteredResult(_0x1fe725,_0x3b4129))[_0x4f62('0x41')](handleError(_0x1fe725,null));};exports[_0x4f62('0x42')]=function(_0x505b1e,_0x428c37){var _0x568d1c={'raw':!![],'where':{'id':_0x505b1e[_0x4f62('0x43')]['id']}},_0x1d0eca={};_0x1d0eca[_0x4f62('0x31')]=_[_0x4f62('0x44')](db['SquareDetailsReport'][_0x4f62('0x2e')]);_0x1d0eca['query']=_['keys'](_0x505b1e[_0x4f62('0x32')]);_0x1d0eca['filters']=_['intersection'](_0x1d0eca['model'],_0x1d0eca[_0x4f62('0x32')]);_0x568d1c[_0x4f62('0x34')]=_[_0x4f62('0x35')](_0x1d0eca[_0x4f62('0x31')],qs[_0x4f62('0x36')](_0x505b1e['query'][_0x4f62('0x36')]));_0x568d1c[_0x4f62('0x34')]=_0x568d1c['attributes'][_0x4f62('0x45')]?_0x568d1c[_0x4f62('0x34')]:_0x1d0eca[_0x4f62('0x31')];if(_0x505b1e[_0x4f62('0x32')][_0x4f62('0x3f')]){_0x568d1c['include']=[{'all':!![]}];}_0x568d1c=_['merge']({},_0x568d1c,_0x505b1e[_0x4f62('0x46')]);return db['SquareDetailsReport'][_0x4f62('0x47')](_0x568d1c)['then'](handleEntityNotFound(_0x428c37,null))[_0x4f62('0x28')](respondWithResult(_0x428c37,null))[_0x4f62('0x41')](handleError(_0x428c37,null));};exports['create']=function(_0x27fa56,_0x5b014e){return db[_0x4f62('0x3e')][_0x4f62('0x48')](_0x27fa56[_0x4f62('0x49')],{})[_0x4f62('0x28')](respondWithResult(_0x5b014e,0xc9))[_0x4f62('0x41')](handleError(_0x5b014e,null));};exports[_0x4f62('0x26')]=function(_0x1a1dc2,_0x4f7316){if(_0x1a1dc2[_0x4f62('0x49')]['id']){delete _0x1a1dc2[_0x4f62('0x49')]['id'];}return db[_0x4f62('0x3e')][_0x4f62('0x47')]({'where':{'id':_0x1a1dc2[_0x4f62('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f7316,null))[_0x4f62('0x28')](saveUpdates(_0x1a1dc2[_0x4f62('0x49')],null))[_0x4f62('0x28')](respondWithResult(_0x4f7316,null))[_0x4f62('0x41')](handleError(_0x4f7316,null));};exports[_0x4f62('0x27')]=function(_0x3cc84d,_0x3dc631){return db[_0x4f62('0x3e')][_0x4f62('0x47')]({'where':{'id':_0x3cc84d[_0x4f62('0x43')]['id']}})['then'](handleEntityNotFound(_0x3dc631,null))[_0x4f62('0x28')](removeEntity(_0x3dc631,null))['catch'](handleError(_0x3dc631,null));};exports[_0x4f62('0x4a')]=function(_0x192bbe,_0x4d51a6){return db[_0x4f62('0x3e')][_0x4f62('0x4a')]()[_0x4f62('0x28')](respondWithResult(_0x4d51a6,null))[_0x4f62('0x41')](handleError(_0x4d51a6,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index fc12634..ceb850c 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 _0x7e07=['bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','define','../../config/logger','api','moment'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7e07,0x11f));var _0x77e0=function(_0xc71bc1,_0x468122){_0xc71bc1=_0xc71bc1-0x0;var _0x449eed=_0x7e07[_0xc71bc1];return _0x449eed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x77e0('0x0'))(_0x77e0('0x1'));var moment=require(_0x77e0('0x2'));var BPromise=require(_0x77e0('0x3'));var rp=require(_0x77e0('0x4'));var fs=require('fs');var path=require(_0x77e0('0x5'));var rimraf=require('rimraf');var config=require(_0x77e0('0x6'));var attributes=require(_0x77e0('0x7'));module[_0x77e0('0x8')]=function(_0x28c14c,_0x4b1347){return _0x28c14c[_0x77e0('0x9')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x031b=['report_square_details','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','SquareDetailsReport'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x031b,0xbf));var _0xb031=function(_0x5d3bdb,_0x3a396a){_0x5d3bdb=_0x5d3bdb-0x0;var _0x4d08d1=_0x031b[_0x5d3bdb];return _0x4d08d1;};'use strict';var _=require('lodash');var util=require(_0xb031('0x0'));var logger=require(_0xb031('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb031('0x2'));var rp=require(_0xb031('0x3'));var fs=require('fs');var path=require(_0xb031('0x4'));var rimraf=require('rimraf');var config=require(_0xb031('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0xb031('0x6')]=function(_0x51e61e,_0x2aee31){return _0x51e61e[_0xb031('0x7')](_0xb031('0x8'),attributes,{'tableName':_0xb031('0x9'),'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 791baea..7bff507 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 _0xe820=['raw','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options'];(function(_0x4fa533,_0x22066b){var _0x87f7f8=function(_0x9c4b3d){while(--_0x9c4b3d){_0x4fa533['push'](_0x4fa533['shift']());}};_0x87f7f8(++_0x22066b);}(_0xe820,0xd2));var _0x0e82=function(_0x5e336d,_0x265da9){_0x5e336d=_0x5e336d-0x0;var _0x1949ce=_0xe820[_0x5e336d];return _0x1949ce;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});}exports[_0x0e82('0x13')]=function(_0x53622b){var _0x25ac21=this;return new Promise(function(_0x310aac,_0x3a3ddf){return db[_0x0e82('0x14')][_0x0e82('0x15')](_0x53622b[_0x0e82('0x16')],{'raw':_0x53622b[_0x0e82('0x17')]?_0x53622b[_0x0e82('0x17')][_0x0e82('0x18')]===undefined?!![]:![]:!![]})[_0x0e82('0xa')](function(_0x5903c){logger['info']('CreateSquareDetailsReport',_0x53622b);logger[_0x0e82('0xd')](_0x0e82('0x13'),_0x53622b,JSON[_0x0e82('0xf')](_0x5903c));_0x310aac(_0x5903c);})[_0x0e82('0x19')](function(_0xd48046){logger[_0x0e82('0x10')](_0x0e82('0x13'),_0xd48046[_0x0e82('0x12')],_0x53622b);_0x3a3ddf(_0x25ac21['error'](0x1f4,_0xd48046[_0x0e82('0x12')]));});});}; \ No newline at end of file +var _0x26f9=['create','options','CreateSquareDetailsReport','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareDetailsReport'];(function(_0x35f318,_0x515f57){var _0x290a0d=function(_0x2be50d){while(--_0x2be50d){_0x35f318['push'](_0x35f318['shift']());}};_0x290a0d(++_0x515f57);}(_0x26f9,0x16f));var _0x926f=function(_0xf5eaa0,_0x5bfa29){_0xf5eaa0=_0xf5eaa0-0x0;var _0x47039e=_0x26f9[_0xf5eaa0];return _0x47039e;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var moment=require('moment');var BPromise=require(_0x926f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x926f('0x3'))['db'];var utils=require(_0x926f('0x4'));var logger=require('../../config/logger')(_0x926f('0x5'));var config=require(_0x926f('0x6'));var jayson=require(_0x926f('0x7'));var client=jayson[_0x926f('0x8')][_0x926f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2ded,_0xf56fcb,_0x1e455d){return new BPromise(function(_0x41a7ed,_0x2af11e){return client['request'](_0x3d2ded,_0x1e455d)[_0x926f('0xa')](function(_0x593c13){logger[_0x926f('0xb')](_0x926f('0xc'),_0xf56fcb,'request\x20sent');logger[_0x926f('0xd')](_0x926f('0xe'),_0xf56fcb,_0x926f('0xf'),JSON[_0x926f('0x10')](_0x593c13));if(_0x593c13[_0x926f('0x11')]){if(_0x593c13['error'][_0x926f('0x12')]===0x1f4){logger[_0x926f('0x11')](_0x926f('0xc'),_0xf56fcb,_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);return _0x2af11e(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xf56fcb,_0x593c13['error'][_0x926f('0x13')]);return _0x41a7ed(_0x593c13[_0x926f('0x11')][_0x926f('0x13')]);}else{logger[_0x926f('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0xf56fcb,_0x926f('0xf'));_0x41a7ed(_0x593c13[_0x926f('0x14')]['message']);}})[_0x926f('0x15')](function(_0x52865b){logger[_0x926f('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xf56fcb,_0x52865b);_0x2af11e(_0x52865b);});});}exports['CreateSquareDetailsReport']=function(_0x36ead3){var _0xab29b3=this;return new Promise(function(_0x4f25e3,_0x3ed07d){return db[_0x926f('0x16')][_0x926f('0x17')](_0x36ead3['body'],{'raw':_0x36ead3[_0x926f('0x18')]?_0x36ead3[_0x926f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x926f('0xa')](function(_0x4241ac){logger['info'](_0x926f('0x19'),_0x36ead3);logger[_0x926f('0xd')](_0x926f('0x19'),_0x36ead3,JSON[_0x926f('0x10')](_0x4241ac));_0x4f25e3(_0x4241ac);})[_0x926f('0x15')](function(_0x3b7179){logger[_0x926f('0x11')](_0x926f('0x19'),_0x3b7179[_0x926f('0x13')],_0x36ead3);_0x3ed07d(_0xab29b3[_0x926f('0x11')](0x1f4,_0x3b7179[_0x926f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 9a3e0fc..e8d96d7 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 _0x50be=['killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x50be,0xe8));var _0xe50b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50be[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xe50b('0x0'));var router=express[_0xe50b('0x1')]();var auth=require(_0xe50b('0x2'));var controller=require(_0xe50b('0x3'));router[_0xe50b('0x4')]('/',auth['isAuthenticated'](),controller[_0xe50b('0x5')]);router[_0xe50b('0x4')](_0xe50b('0x6'),auth[_0xe50b('0x7')](),controller[_0xe50b('0x8')]);module[_0xe50b('0x9')]=router; \ No newline at end of file +var _0x352d=['exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x4264,_0x3acc16){var _0x3261c5=function(_0x3bee6c){while(--_0x3bee6c){_0x4264['push'](_0x4264['shift']());}};_0x3261c5(++_0x3acc16);}(_0x352d,0xe1));var _0xd352=function(_0x58e7e5,_0x2d4cbf){_0x58e7e5=_0x58e7e5-0x0;var _0x470129=_0x352d[_0x58e7e5];return _0x470129;};'use strict';var express=require(_0xd352('0x0'));var router=express[_0xd352('0x1')]();var auth=require(_0xd352('0x2'));var controller=require(_0xd352('0x3'));router['get']('/',auth[_0xd352('0x4')](),controller['index']);router['get'](_0xd352('0x5'),auth[_0xd352('0x4')](),controller[_0xd352('0x6')]);module[_0xd352('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 0420266..2f7edf0 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 _0xeca3=['systeminformation','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xeca3,0x13f));var _0x3eca=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeca3[_0x2641f9];return _0x585741;};'use strict';var info=require(_0x3eca('0x0'));var exec=require('child_process')[_0x3eca('0x1')];var logger=require(_0x3eca('0x2'))(_0x3eca('0x3'));var util=require(_0x3eca('0x4'));var BPromise=require(_0x3eca('0x5'));var _=require(_0x3eca('0x6'));function handleError(_0x488db5,_0x306cc5,_0x35e0ec){_0x306cc5=_0x306cc5||0x1f4;return function(_0x4edf1d){logger[_0x3eca('0x7')](_0x3eca('0x8'),_0x35e0ec,_0x306cc5,util['inspect'](_0x4edf1d,{'showHidden':![],'depth':null}));delete _0x4edf1d[_0x3eca('0x9')];_0x488db5[_0x3eca('0xa')](_0x306cc5)[_0x3eca('0xb')](_0x4edf1d);};}exports[_0x3eca('0xc')]=function(_0x426b75,_0x320d7b){return info[_0x3eca('0xd')]()[_0x3eca('0xe')](function(_0x1602cf){return _0x320d7b[_0x3eca('0xa')](0xc8)[_0x3eca('0xf')](_0x1602cf);})[_0x3eca('0x10')](function(_0x3f0388){return _0x320d7b[_0x3eca('0xa')](0x1f4)[_0x3eca('0xf')](_0x3f0388);});};exports[_0x3eca('0x11')]=function(_0x90e8d4,_0x1b434e){var _0x484ea2=['components/import/cm'];return new BPromise(function(_0x284bd1,_0x4be93f){return exec(util[_0x3eca('0x12')](_0x3eca('0x13'),_0x90e8d4[_0x3eca('0x14')][_0x3eca('0x15')]),function(_0xf954e4,_0x20951a,_0x51cc5e){if(_0xf954e4){return _0x4be93f(_0xf954e4);}return _0x284bd1(_0x20951a);});})[_0x3eca('0xe')](function(_0xb7c1e0){var _0x401342=![];var _0x559eec=_0xb7c1e0[_0x3eca('0x16')](/\n/);for(var _0x5e90d6=0x0,_0x153c28=_0x484ea2[_0x3eca('0x17')];_0x5e90d6<_0x153c28,_0x401342===![];_0x5e90d6+=0x1){if(_0xb7c1e0[_0x3eca('0x18')](_0x484ea2[_0x5e90d6])>=0x0){_0x401342=!![];}}if(!_0x401342){throw new Error(util[_0x3eca('0x12')](_0x3eca('0x19'),_0x90e8d4[_0x3eca('0x14')][_0x3eca('0x15')]));}process[_0x3eca('0x1a')](_0x90e8d4['params'][_0x3eca('0x15')],_0x3eca('0x1b'));return _0x1b434e[_0x3eca('0xa')](0xc8)['json']({'message':util[_0x3eca('0x12')](_0x3eca('0x1c'),_0x90e8d4[_0x3eca('0x14')][_0x3eca('0x15')])});})['catch'](handleError(_0x1b434e,null,'killProcess'));}; \ No newline at end of file +var _0x397f=['pid','then','split','length','indexOf','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x4e73f0,_0x12b20f){var _0x4f78c1=function(_0x2aff37){while(--_0x2aff37){_0x4e73f0['push'](_0x4e73f0['shift']());}};_0x4f78c1(++_0x12b20f);}(_0x397f,0x174));var _0xf397=function(_0x3f9c14,_0x4649d1){_0x3f9c14=_0x3f9c14-0x0;var _0x2d0851=_0x397f[_0x3f9c14];return _0x2d0851;};'use strict';var info=require(_0xf397('0x0'));var exec=require('child_process')[_0xf397('0x1')];var logger=require(_0xf397('0x2'))(_0xf397('0x3'));var util=require(_0xf397('0x4'));var BPromise=require('bluebird');var _=require(_0xf397('0x5'));function handleError(_0x220c78,_0x194492,_0x3a6f90){_0x194492=_0x194492||0x1f4;return function(_0x18f28f){logger['error'](_0xf397('0x6'),_0x3a6f90,_0x194492,util['inspect'](_0x18f28f,{'showHidden':![],'depth':null}));delete _0x18f28f[_0xf397('0x7')];_0x220c78[_0xf397('0x8')](_0x194492)[_0xf397('0x9')](_0x18f28f);};}exports[_0xf397('0xa')]=function(_0x16fd93,_0x43efaa){return info[_0xf397('0xb')]()['then'](function(_0x5a046b){return _0x43efaa[_0xf397('0x8')](0xc8)['json'](_0x5a046b);})[_0xf397('0xc')](function(_0x23a51d){return _0x43efaa['status'](0x1f4)['json'](_0x23a51d);});};exports[_0xf397('0xd')]=function(_0x2607c2,_0x76e374){var _0x2f7c4f=[_0xf397('0xe')];return new BPromise(function(_0x392a95,_0x3781b6){return exec(util[_0xf397('0xf')](_0xf397('0x10'),_0x2607c2[_0xf397('0x11')][_0xf397('0x12')]),function(_0xb4579e,_0x28509a,_0x227ce6){if(_0xb4579e){return _0x3781b6(_0xb4579e);}return _0x392a95(_0x28509a);});})[_0xf397('0x13')](function(_0x4bd002){var _0x4b3206=![];var _0x2c4126=_0x4bd002[_0xf397('0x14')](/\n/);for(var _0x47e2f0=0x0,_0x21b964=_0x2f7c4f[_0xf397('0x15')];_0x47e2f0<_0x21b964,_0x4b3206===![];_0x47e2f0+=0x1){if(_0x4bd002[_0xf397('0x16')](_0x2f7c4f[_0x47e2f0])>=0x0){_0x4b3206=!![];}}if(!_0x4b3206){throw new Error(util[_0xf397('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2607c2[_0xf397('0x11')]['pid']));}process['kill'](_0x2607c2[_0xf397('0x11')][_0xf397('0x12')],_0xf397('0x17'));return _0x76e374['status'](0xc8)[_0xf397('0x18')]({'message':util[_0xf397('0xf')](_0xf397('0x19'),_0x2607c2[_0xf397('0x11')][_0xf397('0x12')])});})[_0xf397('0xc')](handleError(_0x76e374,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index b7e83d8..8189b14 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 _0xa413=['isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./tag.controller','get'];(function(_0x814540,_0x4b4e47){var _0x182f92=function(_0x2b8822){while(--_0x2b8822){_0x814540['push'](_0x814540['shift']());}};_0x182f92(++_0x4b4e47);}(_0xa413,0x1e5));var _0x3a41=function(_0x2732ce,_0x507d27){_0x2732ce=_0x2732ce-0x0;var _0x189aff=_0xa413[_0x2732ce];return _0x189aff;};'use strict';var multer=require(_0x3a41('0x0'));var util=require('util');var path=require(_0x3a41('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a41('0x2'));var router=express[_0x3a41('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3a41('0x4'));var config=require(_0x3a41('0x5'));var controller=require(_0x3a41('0x6'));router[_0x3a41('0x7')]('/',auth[_0x3a41('0x8')](),controller[_0x3a41('0x9')]);router[_0x3a41('0x7')](_0x3a41('0xa'),auth[_0x3a41('0x8')](),controller[_0x3a41('0xb')]);router[_0x3a41('0xc')]('/',auth['isAuthenticated'](),controller[_0x3a41('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3a41('0xe')]);router['delete'](_0x3a41('0xa'),auth['isAuthenticated'](),controller[_0x3a41('0xf')]);module[_0x3a41('0x10')]=router; \ No newline at end of file +var _0xe127=['destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','/:id','show','isAuthenticated','create','update'];(function(_0x40292e,_0xaa2a7b){var _0x1ed986=function(_0x10dbef){while(--_0x10dbef){_0x40292e['push'](_0x40292e['shift']());}};_0x1ed986(++_0xaa2a7b);}(_0xe127,0x1e2));var _0x7e12=function(_0x39fd01,_0x1d6f3f){_0x39fd01=_0x39fd01-0x0;var _0x4cd2c6=_0xe127[_0x39fd01];return _0x4cd2c6;};'use strict';var multer=require('multer');var util=require(_0x7e12('0x0'));var path=require(_0x7e12('0x1'));var timeout=require('connect-timeout');var express=require(_0x7e12('0x2'));var router=express[_0x7e12('0x3')]();var fs_extra=require(_0x7e12('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e12('0x5'));var config=require(_0x7e12('0x6'));var controller=require(_0x7e12('0x7'));router[_0x7e12('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e12('0x8')](_0x7e12('0x9'),auth['isAuthenticated'](),controller[_0x7e12('0xa')]);router['post']('/',auth[_0x7e12('0xb')](),controller[_0x7e12('0xc')]);router['put'](_0x7e12('0x9'),auth[_0x7e12('0xb')](),controller[_0x7e12('0xd')]);router['delete'](_0x7e12('0x9'),auth['isAuthenticated'](),controller[_0x7e12('0xe')]);module[_0x7e12('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 719e3ff..7225696 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 _0x1ebd=['sequelize','exports','STRING','#0091EA'];(function(_0x5c12fb,_0x28647e){var _0xf9450e=function(_0x2aa9bc){while(--_0x2aa9bc){_0x5c12fb['push'](_0x5c12fb['shift']());}};_0xf9450e(++_0x28647e);}(_0x1ebd,0x64));var _0xd1eb=function(_0x2b76ab,_0x226cf0){_0x2b76ab=_0x2b76ab-0x0;var _0x92ba5b=_0x1ebd[_0x2b76ab];return _0x92ba5b;};'use strict';var Sequelize=require(_0xd1eb('0x0'));module[_0xd1eb('0x1')]={'name':{'type':Sequelize[_0xd1eb('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd1eb('0x2')],'defaultValue':_0xd1eb('0x3')},'description':{'type':Sequelize[_0xd1eb('0x2')]}}; \ No newline at end of file +var _0xbc4a=['sequelize','exports','STRING'];(function(_0x43839c,_0x22b7fa){var _0x436718=function(_0x3552ee){while(--_0x3552ee){_0x43839c['push'](_0x43839c['shift']());}};_0x436718(++_0x22b7fa);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x12ab82,_0x2e1f37){_0x12ab82=_0x12ab82-0x0;var _0x4d7ac2=_0xbc4a[_0x12ab82];return _0x4d7ac2;};'use strict';var Sequelize=require(_0xabc4('0x0'));module[_0xabc4('0x1')]={'name':{'type':Sequelize[_0xabc4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 42d1c36..c6f545f 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 _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','destroy','stack','name','index','map','Tag','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x5263d2,_0x476862){var _0x2363a0=function(_0x22380d){while(--_0x22380d){_0x5263d2['push'](_0x5263d2['shift']());}};_0x2363a0(++_0x476862);}(_0x524a,0xf5));var _0xa524=function(_0x367d13,_0x4e3759){_0x367d13=_0x367d13-0x0;var _0x6fb2c2=_0x524a[_0x367d13];return _0x6fb2c2;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['Tag'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':!![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['Tag'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));}; \ No newline at end of file +var _0xf72b=['sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','Tags','end','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0xf72b,0x1d9));var _0xbf72=function(_0x59f399,_0x216dbc){_0x59f399=_0x59f399-0x0;var _0x112213=_0xf72b[_0x59f399];return _0x112213;};'use strict';var emlformat=require(_0xbf72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf72('0x2'));var moment=require(_0xbf72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf72('0x4'));var util=require(_0xbf72('0x5'));var path=require(_0xbf72('0x6'));var sox=require(_0xbf72('0x7'));var csv=require(_0xbf72('0x8'));var ejs=require(_0xbf72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x8'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var licenseUtil=require(_0xbf72('0x17'));var db=require(_0xbf72('0x18'))['db'];function respondWithStatusCode(_0x5eb4cc,_0x5967f5){_0x5967f5=_0x5967f5||0xcc;return function(_0x3bd500){if(_0x3bd500){return _0x5eb4cc[_0xbf72('0x19')](_0x5967f5);}return _0x5eb4cc[_0xbf72('0x1a')](_0x5967f5)['end']();};}function respondWithResult(_0x25255e,_0x4f4fa5){_0x4f4fa5=_0x4f4fa5||0xc8;return function(_0x5625b3){if(_0x5625b3){return _0x25255e['status'](_0x4f4fa5)[_0xbf72('0x1b')](_0x5625b3);}};}function respondWithFilteredResult(_0xb96906,_0x3af48d){return function(_0x723eb1){if(_0x723eb1){var _0x39d0cd=typeof _0x3af48d[_0xbf72('0x1c')]==='undefined'&&typeof _0x3af48d[_0xbf72('0x1d')]===_0xbf72('0x1e');var _0x2a8609=_0x723eb1[_0xbf72('0x1f')];var _0x27dadc=_0x39d0cd?0x0:_0x3af48d['offset'];var _0x51d4c9=_0x39d0cd?_0x723eb1[_0xbf72('0x1f')]:_0x3af48d[_0xbf72('0x1c')]+_0x3af48d[_0xbf72('0x1d')];var _0x2584d9;if(_0x51d4c9>=_0x2a8609){_0x51d4c9=_0x2a8609;_0x2584d9=0xc8;}else{_0x2584d9=0xce;}_0xb96906[_0xbf72('0x1a')](_0x2584d9);return _0xb96906[_0xbf72('0x20')](_0xbf72('0x21'),_0x27dadc+'-'+_0x51d4c9+'/'+_0x2a8609)['json'](_0x723eb1);}return null;};}function patchUpdates(_0x2aecae){return function(_0x42a193){try{jsonpatch[_0xbf72('0x22')](_0x42a193,_0x2aecae,!![]);}catch(_0x200139){return BPromise[_0xbf72('0x23')](_0x200139);}return _0x42a193['save']();};}function saveUpdates(_0x3cd181,_0x1de926){return function(_0x536071){if(_0x536071){return _0x536071[_0xbf72('0x24')](_0x3cd181)[_0xbf72('0x25')](function(_0x267c41){return _0x267c41;});}return null;};}function removeEntity(_0x4c7f3d,_0x44f3f9){return function(_0x428361){if(_0x428361){return _0x428361[_0xbf72('0x26')]()[_0xbf72('0x25')](function(){var _0x4f4dc0=_0x428361[_0xbf72('0x27')]({'plain':!![]});var _0x392a8c=_0xbf72('0x28');return db['UserProfileResource'][_0xbf72('0x26')]({'where':{'type':_0x392a8c,'resourceId':_0x4f4dc0['id']}})[_0xbf72('0x25')](function(){return _0x428361;});})[_0xbf72('0x25')](function(){_0x4c7f3d[_0xbf72('0x1a')](0xcc)[_0xbf72('0x29')]();});}};}function handleEntityNotFound(_0x2b1ff1,_0x182154){return function(_0x25ecdf){if(!_0x25ecdf){_0x2b1ff1[_0xbf72('0x19')](0x194);}return _0x25ecdf;};}function handleError(_0x92307f,_0x280d7a){_0x280d7a=_0x280d7a||0x1f4;return function(_0x20e747){logger[_0xbf72('0x2a')](_0x20e747[_0xbf72('0x2b')]);if(_0x20e747[_0xbf72('0x2c')]){delete _0x20e747['name'];}_0x92307f[_0xbf72('0x1a')](_0x280d7a)[_0xbf72('0x2d')](_0x20e747);};}exports[_0xbf72('0x2e')]=function(_0x28850d,_0xb1ee4e){var _0x82c0f0={},_0x35ecdc={},_0x209b2b={'count':0x0,'rows':[]};var _0x1be26a=_[_0xbf72('0x2f')](db[_0xbf72('0x30')][_0xbf72('0x31')],function(_0x423c61){return{'name':_0x423c61[_0xbf72('0x32')],'type':_0x423c61['type'][_0xbf72('0x33')]};});_0x35ecdc[_0xbf72('0x34')]=_[_0xbf72('0x2f')](_0x1be26a,'name');_0x35ecdc['query']=_['keys'](_0x28850d[_0xbf72('0x35')]);_0x35ecdc[_0xbf72('0x36')]=_[_0xbf72('0x37')](_0x35ecdc['model'],_0x35ecdc[_0xbf72('0x35')]);_0x82c0f0[_0xbf72('0x38')]=_['intersection'](_0x35ecdc[_0xbf72('0x34')],qs['fields'](_0x28850d[_0xbf72('0x35')][_0xbf72('0x39')]));_0x82c0f0['attributes']=_0x82c0f0['attributes'][_0xbf72('0x3a')]?_0x82c0f0[_0xbf72('0x38')]:_0x35ecdc[_0xbf72('0x34')];if(!_0x28850d[_0xbf72('0x35')][_0xbf72('0x3b')](_0xbf72('0x3c'))){_0x82c0f0[_0xbf72('0x1d')]=qs[_0xbf72('0x1d')](_0x28850d[_0xbf72('0x35')]['limit']);_0x82c0f0[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x28850d[_0xbf72('0x35')][_0xbf72('0x1c')]);}_0x82c0f0['order']=qs[_0xbf72('0x3d')](_0x28850d[_0xbf72('0x35')]['sort']);_0x82c0f0[_0xbf72('0x3e')]=qs['filters'](_['pick'](_0x28850d['query'],_0x35ecdc['filters']),_0x1be26a);if(_0x28850d[_0xbf72('0x35')]['filter']){_0x82c0f0['where']=_[_0xbf72('0x3f')](_0x82c0f0['where'],{'$or':_[_0xbf72('0x2f')](_0x1be26a,function(_0xde4ed9){if(_0xde4ed9['type']!==_0xbf72('0x40')){var _0x4aee64={};_0x4aee64[_0xde4ed9['name']]={'$like':'%'+_0x28850d[_0xbf72('0x35')][_0xbf72('0x41')]+'%'};return _0x4aee64;}})});}_0x82c0f0=_[_0xbf72('0x3f')]({},_0x82c0f0,_0x28850d[_0xbf72('0x42')]);var _0xffb333={'where':_0x82c0f0[_0xbf72('0x3e')]};return db[_0xbf72('0x30')][_0xbf72('0x1f')](_0xffb333)['then'](function(_0x311a0c){_0x209b2b[_0xbf72('0x1f')]=_0x311a0c;if(_0x28850d['query'][_0xbf72('0x43')]){_0x82c0f0['include']=[{'all':!![]}];}return db['Tag'][_0xbf72('0x44')](_0x82c0f0);})[_0xbf72('0x25')](function(_0x3992fd){_0x209b2b[_0xbf72('0x45')]=_0x3992fd;return _0x209b2b;})[_0xbf72('0x25')](respondWithFilteredResult(_0xb1ee4e,_0x82c0f0))['catch'](handleError(_0xb1ee4e,null));};exports['show']=function(_0x4b8f31,_0x359c2b){var _0x3a7828={'raw':!![],'where':{'id':_0x4b8f31[_0xbf72('0x46')]['id']}},_0x3871d0={};_0x3871d0['model']=_['keys'](db[_0xbf72('0x30')]['rawAttributes']);_0x3871d0[_0xbf72('0x35')]=_[_0xbf72('0x47')](_0x4b8f31[_0xbf72('0x35')]);_0x3871d0[_0xbf72('0x36')]=_['intersection'](_0x3871d0[_0xbf72('0x34')],_0x3871d0[_0xbf72('0x35')]);_0x3a7828[_0xbf72('0x38')]=_[_0xbf72('0x37')](_0x3871d0['model'],qs[_0xbf72('0x39')](_0x4b8f31[_0xbf72('0x35')]['fields']));_0x3a7828[_0xbf72('0x38')]=_0x3a7828[_0xbf72('0x38')][_0xbf72('0x3a')]?_0x3a7828[_0xbf72('0x38')]:_0x3871d0[_0xbf72('0x34')];if(_0x4b8f31[_0xbf72('0x35')][_0xbf72('0x43')]){_0x3a7828['include']=[{'all':!![]}];}_0x3a7828=_['merge']({},_0x3a7828,_0x4b8f31['options']);return db[_0xbf72('0x30')]['find'](_0x3a7828)[_0xbf72('0x25')](handleEntityNotFound(_0x359c2b,null))['then'](respondWithResult(_0x359c2b,null))['catch'](handleError(_0x359c2b,null));};exports['create']=function(_0x9f94ea,_0x15a271){return db[_0xbf72('0x30')][_0xbf72('0x48')](_0x9f94ea[_0xbf72('0x49')],{})[_0xbf72('0x25')](function(_0x530663){var _0x3ffa72=_0x9f94ea['user'][_0xbf72('0x27')]({'plain':!![]});if(!_0x3ffa72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ffa72[_0xbf72('0x4a')]===_0xbf72('0x4b')){var _0x45e4d5=_0x530663[_0xbf72('0x27')]({'plain':!![]});var _0x26ce94=_0xbf72('0x28');return db[_0xbf72('0x4c')][_0xbf72('0x4d')]({'where':{'name':_0x26ce94,'userProfileId':_0x3ffa72[_0xbf72('0x4e')]},'raw':!![]})['then'](function(_0x1fb168){if(_0x1fb168&&_0x1fb168[_0xbf72('0x4f')]===0x0){return db[_0xbf72('0x50')]['create']({'name':_0x45e4d5[_0xbf72('0x2c')],'resourceId':_0x45e4d5['id'],'type':_0x1fb168[_0xbf72('0x2c')],'sectionId':_0x1fb168['id']},{})[_0xbf72('0x25')](function(){return _0x530663;});}else{return _0x530663;}})[_0xbf72('0x51')](function(_0x824918){logger['error'](_0xbf72('0x52'),_0x824918);throw _0x824918;});}return _0x530663;})[_0xbf72('0x25')](respondWithResult(_0x15a271,0xc9))['catch'](handleError(_0x15a271,null));};exports[_0xbf72('0x24')]=function(_0x5e2dcd,_0x58080b){if(_0x5e2dcd[_0xbf72('0x49')]['id']){delete _0x5e2dcd[_0xbf72('0x49')]['id'];}return db[_0xbf72('0x30')][_0xbf72('0x4d')]({'where':{'id':_0x5e2dcd[_0xbf72('0x46')]['id']}})['then'](handleEntityNotFound(_0x58080b,null))['then'](saveUpdates(_0x5e2dcd['body'],null))[_0xbf72('0x25')](respondWithResult(_0x58080b,null))[_0xbf72('0x51')](handleError(_0x58080b,null));};exports[_0xbf72('0x26')]=function(_0x1648d0,_0x5cfbc4){return db['Tag'][_0xbf72('0x4d')]({'where':{'id':_0x1648d0[_0xbf72('0x46')]['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x5cfbc4,null))['then'](removeEntity(_0x5cfbc4,null))[_0xbf72('0x51')](handleError(_0x5cfbc4,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index c98d5da..2f7250a 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 _0x161d=['rimraf','../../config/environment','./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2fb009,_0x596c55){var _0x3397c8=function(_0x1658e3){while(--_0x1658e3){_0x2fb009['push'](_0x2fb009['shift']());}};_0x3397c8(++_0x596c55);}(_0x161d,0x171));var _0xd161=function(_0x261ba8,_0xb790ee){_0x261ba8=_0x261ba8-0x0;var _0x5db441=_0x161d[_0x261ba8];return _0x5db441;};'use strict';var _=require(_0xd161('0x0'));var util=require(_0xd161('0x1'));var logger=require(_0xd161('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd161('0x3'));var rp=require(_0xd161('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd161('0x5'));var config=require(_0xd161('0x6'));var attributes=require(_0xd161('0x7'));module[_0xd161('0x8')]=function(_0x4d225d,_0xd2a64e){return _0x4d225d[_0xd161('0x9')](_0xd161('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x443b=['./tag.attributes','exports','define','tools_tags','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x49758b,_0x51dcc7){var _0x17bdd9=function(_0x1e7488){while(--_0x1e7488){_0x49758b['push'](_0x49758b['shift']());}};_0x17bdd9(++_0x51dcc7);}(_0x443b,0xb8));var _0xb443=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x443b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb443('0x0'));var util=require(_0xb443('0x1'));var logger=require(_0xb443('0x2'))(_0xb443('0x3'));var moment=require('moment');var BPromise=require(_0xb443('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb443('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb443('0x6'));module[_0xb443('0x7')]=function(_0x43347f,_0x1b4f97){return _0x43347f[_0xb443('0x8')]('Tag',attributes,{'tableName':_0xb443('0x9'),'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 57bc148..bf24b73 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','util'];(function(_0x50efe5,_0x5e4749){var _0x3f2af1=function(_0x3a4354){while(--_0x3a4354){_0x50efe5['push'](_0x50efe5['shift']());}};_0x3f2af1(++_0x5e4749);}(_0xedd9,0xfc));var _0x9edd=function(_0x4aaf34,_0x507b38){_0x4aaf34=_0x4aaf34-0x0;var _0x368572=_0xedd9[_0x4aaf34];return _0x368572;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('Tag,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xee24=['stringify','error','code','Tag,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x17a5fe,_0x378a86){var _0xf6957=function(_0x1109a6){while(--_0x1109a6){_0x17a5fe['push'](_0x17a5fe['shift']());}};_0xf6957(++_0x378a86);}(_0xee24,0x1a6));var _0x4ee2=function(_0x221d0f,_0x37c51d){_0x221d0f=_0x221d0f-0x0;var _0x178f23=_0xee24[_0x221d0f];return _0x178f23;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var moment=require(_0x4ee2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ee2('0x2'));var fs=require('fs');var Redis=require(_0x4ee2('0x3'));var db=require(_0x4ee2('0x4'))['db'];var utils=require(_0x4ee2('0x5'));var logger=require('../../config/logger')(_0x4ee2('0x6'));var config=require(_0x4ee2('0x7'));var jayson=require(_0x4ee2('0x8'));var client=jayson[_0x4ee2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6e11,_0x319d9d,_0xe966eb){return new BPromise(function(_0x9a963c,_0x8d7266){return client[_0x4ee2('0xa')](_0x2e6e11,_0xe966eb)[_0x4ee2('0xb')](function(_0x3b6028){logger['info']('Tag,\x20%s,\x20%s',_0x319d9d,_0x4ee2('0xc'));logger[_0x4ee2('0xd')](_0x4ee2('0xe'),_0x319d9d,_0x4ee2('0xc'),JSON[_0x4ee2('0xf')](_0x3b6028));if(_0x3b6028['error']){if(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x11')]===0x1f4){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x8d7266(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x13')]);}logger[_0x4ee2('0x10')]('Tag,\x20%s,\x20%s',_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x9a963c(_0x3b6028[_0x4ee2('0x10')]['message']);}else{logger[_0x4ee2('0x14')](_0x4ee2('0x12'),_0x319d9d,_0x4ee2('0xc'));_0x9a963c(_0x3b6028[_0x4ee2('0x15')][_0x4ee2('0x13')]);}})[_0x4ee2('0x16')](function(_0x5e19f8){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x5e19f8);_0x8d7266(_0x5e19f8);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 1bd0f5b..375a48b 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_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'));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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_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'));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 28b1161..ba3dcbb 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 _0xb7e7=['STRING','sequelize'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb7e7[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x14dadd,_0x3c2870){var _0x26448e=function(_0x3107b9){while(--_0x3107b9){_0x14dadd['push'](_0x14dadd['shift']());}};_0x26448e(++_0x3c2870);}(_0xb10b,0x12a));var _0xbb10=function(_0x51a182,_0x5639a7){_0x51a182=_0x51a182-0x0;var _0x46aa3e=_0xb10b[_0x51a182];return _0x46aa3e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 2cfe1bf..e1af6bd 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 _0xa4c6=['merge','type','VIRTUAL','options','then','include','catch','show','params','keys','rawAttributes','includeAll','find','create','body','user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','MailQueueId','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserWhatsappQueue','UserVoicePrefix','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','length','order','Queues','findOne','Unknown\x20channel','ids','remove','isArray','Voice','Sms','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','format','all','TeamVoicePrefix','VoicePrefixId','addAgents','Chat','Openchannel','Queue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','sendStatus','error','stack','name','index','map','Team','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xa4c6,0x16e));var _0x6a4c=function(_0x51300c,_0x9f34b0){_0x51300c=_0x51300c-0x0;var _0x254fc3=_0xa4c6[_0x51300c];return _0x254fc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a4c('0x0'));var zipdir=require(_0x6a4c('0x1'));var jsonpatch=require(_0x6a4c('0x2'));var rp=require(_0x6a4c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a4c('0x4'));var util=require('util');var path=require(_0x6a4c('0x5'));var sox=require(_0x6a4c('0x6'));var csv=require(_0x6a4c('0x7'));var ejs=require(_0x6a4c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a4c('0x9'));var squel=require('squel');var crypto=require(_0x6a4c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6a4c('0xb'));var toCsv=require(_0x6a4c('0x7'));var querystring=require(_0x6a4c('0xc'));var Papa=require(_0x6a4c('0xd'));var Redis=require(_0x6a4c('0xe'));var authService=require(_0x6a4c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6a4c('0x10'));var hardwareService=require(_0x6a4c('0x11'));var logger=require(_0x6a4c('0x12'))(_0x6a4c('0x13'));var utils=require(_0x6a4c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6a4c('0x15'))['db'];config[_0x6a4c('0x16')]=_[_0x6a4c('0x17')](config[_0x6a4c('0x16')],{'host':_0x6a4c('0x18'),'port':0x18eb});var socket=require(_0x6a4c('0x19'))(new Redis(config[_0x6a4c('0x16')]));require('./team.socket')[_0x6a4c('0x1a')](socket);function respondWithStatusCode(_0x353077,_0x4b178d){_0x4b178d=_0x4b178d||0xcc;return function(_0x2af8df){if(_0x2af8df){return _0x353077['sendStatus'](_0x4b178d);}return _0x353077[_0x6a4c('0x1b')](_0x4b178d)[_0x6a4c('0x1c')]();};}function respondWithResult(_0x1f823d,_0x50cdbc){_0x50cdbc=_0x50cdbc||0xc8;return function(_0x49f0cb){if(_0x49f0cb){return _0x1f823d[_0x6a4c('0x1b')](_0x50cdbc)[_0x6a4c('0x1d')](_0x49f0cb);}};}function respondWithFilteredResult(_0x2e6181,_0xada922){return function(_0x1c58d6){if(_0x1c58d6){var _0xca9ae8=typeof _0xada922['offset']===_0x6a4c('0x1e')&&typeof _0xada922[_0x6a4c('0x1f')]===_0x6a4c('0x1e');var _0x40659c=_0x1c58d6[_0x6a4c('0x20')];var _0x578232=_0xca9ae8?0x0:_0xada922[_0x6a4c('0x21')];var _0x587477=_0xca9ae8?_0x1c58d6['count']:_0xada922['offset']+_0xada922['limit'];var _0x521359;if(_0x587477>=_0x40659c){_0x587477=_0x40659c;_0x521359=0xc8;}else{_0x521359=0xce;}_0x2e6181[_0x6a4c('0x1b')](_0x521359);return _0x2e6181[_0x6a4c('0x22')](_0x6a4c('0x23'),_0x578232+'-'+_0x587477+'/'+_0x40659c)[_0x6a4c('0x1d')](_0x1c58d6);}return null;};}function patchUpdates(_0x45008e){return function(_0x4bba0a){try{jsonpatch['apply'](_0x4bba0a,_0x45008e,!![]);}catch(_0x9a96af){return BPromise[_0x6a4c('0x24')](_0x9a96af);}return _0x4bba0a[_0x6a4c('0x25')]();};}function saveUpdates(_0x4e7ff6,_0x1d62cf){return function(_0x3a3292){if(_0x3a3292){return _0x3a3292[_0x6a4c('0x26')](_0x4e7ff6)['then'](function(_0x335a49){return _0x335a49;});}return null;};}function handleEntityNotFound(_0x990697,_0x3d62f8){return function(_0x1474f7){if(!_0x1474f7){_0x990697[_0x6a4c('0x27')](0x194);}return _0x1474f7;};}function handleError(_0x41dd7c,_0x575180){_0x575180=_0x575180||0x1f4;return function(_0x3f0b74){logger[_0x6a4c('0x28')](_0x3f0b74[_0x6a4c('0x29')]);if(_0x3f0b74[_0x6a4c('0x2a')]){delete _0x3f0b74[_0x6a4c('0x2a')];}_0x41dd7c['status'](_0x575180)['send'](_0x3f0b74);};}exports[_0x6a4c('0x2b')]=function(_0x54dffd,_0x156532){var _0xbf6505={},_0x3d8819={},_0x5292f1={'count':0x0,'rows':[]};var _0x59c28a=_[_0x6a4c('0x2c')](db[_0x6a4c('0x2d')]['rawAttributes'],function(_0x551177){return{'name':_0x551177['fieldName'],'type':_0x551177['type']['key']};});_0x3d8819['model']=_[_0x6a4c('0x2c')](_0x59c28a,'name');_0x3d8819['query']=_['keys'](_0x54dffd[_0x6a4c('0x2e')]);_0x3d8819[_0x6a4c('0x2f')]=_[_0x6a4c('0x30')](_0x3d8819[_0x6a4c('0x31')],_0x3d8819['query']);_0xbf6505[_0x6a4c('0x32')]=_[_0x6a4c('0x30')](_0x3d8819[_0x6a4c('0x31')],qs[_0x6a4c('0x33')](_0x54dffd[_0x6a4c('0x2e')][_0x6a4c('0x33')]));_0xbf6505[_0x6a4c('0x32')]=_0xbf6505[_0x6a4c('0x32')]['length']?_0xbf6505[_0x6a4c('0x32')]:_0x3d8819['model'];if(!_0x54dffd[_0x6a4c('0x2e')][_0x6a4c('0x34')]('nolimit')){_0xbf6505[_0x6a4c('0x1f')]=qs[_0x6a4c('0x1f')](_0x54dffd['query'][_0x6a4c('0x1f')]);_0xbf6505[_0x6a4c('0x21')]=qs[_0x6a4c('0x21')](_0x54dffd[_0x6a4c('0x2e')]['offset']);}_0xbf6505['order']=qs['sort'](_0x54dffd['query'][_0x6a4c('0x35')]);_0xbf6505[_0x6a4c('0x36')]=qs[_0x6a4c('0x2f')](_[_0x6a4c('0x37')](_0x54dffd['query'],_0x3d8819[_0x6a4c('0x2f')]),_0x59c28a);if(_0x54dffd[_0x6a4c('0x2e')][_0x6a4c('0x38')]){_0xbf6505[_0x6a4c('0x36')]=_[_0x6a4c('0x39')](_0xbf6505[_0x6a4c('0x36')],{'$or':_['map'](_0x59c28a,function(_0x2de976){if(_0x2de976[_0x6a4c('0x3a')]!==_0x6a4c('0x3b')){var _0x42c1cc={};_0x42c1cc[_0x2de976[_0x6a4c('0x2a')]]={'$like':'%'+_0x54dffd[_0x6a4c('0x2e')][_0x6a4c('0x38')]+'%'};return _0x42c1cc;}})});}_0xbf6505=_['merge']({},_0xbf6505,_0x54dffd[_0x6a4c('0x3c')]);var _0x26bbe0={'where':_0xbf6505['where']};return db[_0x6a4c('0x2d')]['count'](_0x26bbe0)[_0x6a4c('0x3d')](function(_0x4527c1){_0x5292f1[_0x6a4c('0x20')]=_0x4527c1;if(_0x54dffd[_0x6a4c('0x2e')]['includeAll']){_0xbf6505[_0x6a4c('0x3e')]=[{'all':!![]}];}return db[_0x6a4c('0x2d')]['findAll'](_0xbf6505);})[_0x6a4c('0x3d')](function(_0x2950ca){_0x5292f1['rows']=_0x2950ca;return _0x5292f1;})[_0x6a4c('0x3d')](respondWithFilteredResult(_0x156532,_0xbf6505))[_0x6a4c('0x3f')](handleError(_0x156532,null));};exports[_0x6a4c('0x40')]=function(_0x24833f,_0x437451){var _0x1efab7={'raw':![],'where':{'id':_0x24833f[_0x6a4c('0x41')]['id']}},_0x182026={};_0x182026[_0x6a4c('0x31')]=_[_0x6a4c('0x42')](db[_0x6a4c('0x2d')][_0x6a4c('0x43')]);_0x182026[_0x6a4c('0x2e')]=_['keys'](_0x24833f[_0x6a4c('0x2e')]);_0x182026[_0x6a4c('0x2f')]=_[_0x6a4c('0x30')](_0x182026['model'],_0x182026[_0x6a4c('0x2e')]);_0x1efab7[_0x6a4c('0x32')]=_[_0x6a4c('0x30')](_0x182026[_0x6a4c('0x31')],qs[_0x6a4c('0x33')](_0x24833f[_0x6a4c('0x2e')]['fields']));_0x1efab7['attributes']=_0x1efab7[_0x6a4c('0x32')]['length']?_0x1efab7[_0x6a4c('0x32')]:_0x182026[_0x6a4c('0x31')];if(_0x24833f[_0x6a4c('0x2e')][_0x6a4c('0x44')]){_0x1efab7[_0x6a4c('0x3e')]=[{'all':!![]}];}_0x1efab7=_[_0x6a4c('0x39')]({},_0x1efab7,_0x24833f[_0x6a4c('0x3c')]);return db[_0x6a4c('0x2d')][_0x6a4c('0x45')](_0x1efab7)[_0x6a4c('0x3d')](handleEntityNotFound(_0x437451,null))[_0x6a4c('0x3d')](respondWithResult(_0x437451,null))['catch'](handleError(_0x437451,null));};exports[_0x6a4c('0x46')]=function(_0x21b8bf,_0x30c941){return db[_0x6a4c('0x2d')][_0x6a4c('0x46')](_0x21b8bf[_0x6a4c('0x47')],{})['then'](function(_0x917061){var _0x3f1953=_0x21b8bf[_0x6a4c('0x48')]['get']({'plain':!![]});if(!_0x3f1953)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f1953[_0x6a4c('0x49')]===_0x6a4c('0x48')){var _0x1de351=_0x917061[_0x6a4c('0x4a')]({'plain':!![]});var _0x560670=_0x6a4c('0x4b');return db[_0x6a4c('0x4c')][_0x6a4c('0x45')]({'where':{'name':_0x560670,'userProfileId':_0x3f1953[_0x6a4c('0x4d')]},'raw':!![]})[_0x6a4c('0x3d')](function(_0x4629be){if(_0x4629be&&_0x4629be[_0x6a4c('0x4e')]===0x0){return db[_0x6a4c('0x4f')]['create']({'name':_0x1de351[_0x6a4c('0x2a')],'resourceId':_0x1de351['id'],'type':_0x4629be[_0x6a4c('0x2a')],'sectionId':_0x4629be['id']},{})[_0x6a4c('0x3d')](function(){return _0x917061;});}else{return _0x917061;}})['catch'](function(_0x3436a8){logger[_0x6a4c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3436a8);throw _0x3436a8;});}return _0x917061;})[_0x6a4c('0x3d')](respondWithResult(_0x30c941,0xc9))[_0x6a4c('0x3f')](handleError(_0x30c941,null));};exports[_0x6a4c('0x26')]=function(_0x3bfa1b,_0x185c47){if(_0x3bfa1b['body']['id']){delete _0x3bfa1b['body']['id'];}return db[_0x6a4c('0x2d')][_0x6a4c('0x45')]({'where':{'id':_0x3bfa1b[_0x6a4c('0x41')]['id']}})['then'](handleEntityNotFound(_0x185c47,null))[_0x6a4c('0x3d')](saveUpdates(_0x3bfa1b['body'],null))[_0x6a4c('0x3d')](respondWithResult(_0x185c47,null))[_0x6a4c('0x3f')](handleError(_0x185c47,null));};exports['destroy']=function(_0x221cb1,_0x31107b){var _0x32387e=_0x221cb1[_0x6a4c('0x41')]['id'];var _0x257b1b=[];return db[_0x6a4c('0x50')][_0x6a4c('0x51')](function(_0x24f649){var _0xbf914e=_0x6a4c('0x52')+_0x32387e;return db[_0x6a4c('0x50')]['query'](_0xbf914e,{'type':db[_0x6a4c('0x53')][_0x6a4c('0x54')][_0x6a4c('0x55')],'raw':!![],'transaction':_0x24f649})[_0x6a4c('0x3d')](function(_0x24ba35){_0x257b1b=_[_0x6a4c('0x2c')](_0x24ba35,function(_0x5b291b){return Number(_0x5b291b['UserId']);});})[_0x6a4c('0x3d')](function(){var _0x4b91c9=_0x6a4c('0x56')+_0x32387e;return db[_0x6a4c('0x50')][_0x6a4c('0x2e')](_0x4b91c9,{'type':db['Sequelize'][_0x6a4c('0x54')][_0x6a4c('0x55')],'raw':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0x4a1543){var _0x230cff=_[_0x6a4c('0x2c')](_0x4a1543,function(_0x55c4a6){return Number(_0x55c4a6[_0x6a4c('0x57')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x257b1b},'VoiceQueueId':{'$in':_0x230cff}},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){var _0x3d453e='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x32387e;return db['sequelize'][_0x6a4c('0x2e')](_0x3d453e,{'type':db[_0x6a4c('0x53')]['QueryTypes'][_0x6a4c('0x55')],'raw':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0xe3c9eb){var _0x38cdc9=_[_0x6a4c('0x2c')](_0xe3c9eb,function(_0x25ed82){return Number(_0x25ed82[_0x6a4c('0x58')]);});return db[_0x6a4c('0x59')][_0x6a4c('0x5a')]({'where':{'UserId':{'$in':_0x257b1b},'MailQueueId':{'$in':_0x38cdc9}},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){var _0x25fc62=_0x6a4c('0x5b')+_0x32387e;return db[_0x6a4c('0x50')]['query'](_0x25fc62,{'type':db['Sequelize'][_0x6a4c('0x54')]['SELECT'],'raw':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0x7f283d){var _0x544581=_[_0x6a4c('0x2c')](_0x7f283d,function(_0xc6ffde){return Number(_0xc6ffde[_0x6a4c('0x5c')]);});return db[_0x6a4c('0x5d')][_0x6a4c('0x5a')]({'where':{'UserId':{'$in':_0x257b1b},'SmsQueueId':{'$in':_0x544581}},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){var _0x383c0c=_0x6a4c('0x5e')+_0x32387e;return db[_0x6a4c('0x50')][_0x6a4c('0x2e')](_0x383c0c,{'type':db[_0x6a4c('0x53')][_0x6a4c('0x54')][_0x6a4c('0x55')],'raw':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0x539f88){var _0x1cb1fd=_[_0x6a4c('0x2c')](_0x539f88,function(_0x24bb2f){return Number(_0x24bb2f['ChatQueueId']);});return db['UserChatQueue'][_0x6a4c('0x5a')]({'where':{'UserId':{'$in':_0x257b1b},'ChatQueueId':{'$in':_0x1cb1fd}},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){var _0x3d9bc2=_0x6a4c('0x5f')+_0x32387e;return db['sequelize'][_0x6a4c('0x2e')](_0x3d9bc2,{'type':db[_0x6a4c('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0xd972f7){var _0x354ebb=_[_0x6a4c('0x2c')](_0xd972f7,function(_0x3327ad){return Number(_0x3327ad['FaxQueueId']);});return db[_0x6a4c('0x60')]['destroy']({'where':{'UserId':{'$in':_0x257b1b},'FaxQueueId':{'$in':_0x354ebb}},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){var _0x211126=_0x6a4c('0x61')+_0x32387e;return db['sequelize'][_0x6a4c('0x2e')](_0x211126,{'type':db[_0x6a4c('0x53')][_0x6a4c('0x54')][_0x6a4c('0x55')],'raw':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0x3ab4f5){var _0x137b6a=_[_0x6a4c('0x2c')](_0x3ab4f5,function(_0x52ea18){return Number(_0x52ea18[_0x6a4c('0x62')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x257b1b},'OpenchannelQueueId':{'$in':_0x137b6a}},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){var _0x367321='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x32387e;return db[_0x6a4c('0x50')]['query'](_0x367321,{'type':db[_0x6a4c('0x53')]['QueryTypes'][_0x6a4c('0x55')],'raw':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0x4cccdb){var _0x4d4718=_['map'](_0x4cccdb,function(_0x486b1f){return Number(_0x486b1f['WhatsappQueueId']);});return db[_0x6a4c('0x63')][_0x6a4c('0x5a')]({'where':{'UserId':{'$in':_0x257b1b},'WhatsappQueueId':{'$in':_0x4d4718}},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){return db['TeamVoicePrefix'][_0x6a4c('0x45')]({'where':{'TeamId':_0x32387e}});})[_0x6a4c('0x3d')](function(_0x34cdf5){if(_0x34cdf5===null){return;}return db[_0x6a4c('0x64')][_0x6a4c('0x5a')]({'where':{'UserId':{'$in':_0x257b1b},'VoicePrefixId':_0x34cdf5['VoicePrefixId']},'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(){return db['Team'][_0x6a4c('0x5a')]({'where':{'id':_0x32387e},'cascade':!![],'transaction':_0x24f649});})[_0x6a4c('0x3d')](function(_0x6b2eb){if(_0x6b2eb===0x0){_0x31107b[_0x6a4c('0x27')](0x194);}else{return db[_0x6a4c('0x4f')]['destroy']({'where':{'type':'Teams','resourceId':_0x32387e},'cascade':!![],'transaction':_0x24f649})[_0x6a4c('0x3d')](function(){_0x31107b[_0x6a4c('0x1b')](0xcc)['end']();});}})[_0x6a4c('0x3f')](function(_0xc1c979){_0x31107b['status'](0x1f4)['send'](_0xc1c979);});});};exports['getQueues']=function(_0x3008fd,_0x124700,_0x3dd57d){return db[_0x6a4c('0x2d')]['findOne']({'where':{'id':_0x3008fd[_0x6a4c('0x41')]['id']}})[_0x6a4c('0x3d')](handleEntityNotFound(_0x124700,null))['then'](function(_0x391a10){if(!_0x3008fd[_0x6a4c('0x2e')][_0x6a4c('0x65')]||!utils[_0x6a4c('0x66')](_0x3008fd[_0x6a4c('0x2e')][_0x6a4c('0x65')])){throw new db[(_0x6a4c('0x53'))][(_0x6a4c('0x67'))]('Unknown\x20channel');}var _0x4b0c39={};var _0x4451ca={};_0x4451ca[_0x6a4c('0x31')]=_['keys'](db[_[_0x6a4c('0x68')](_0x3008fd[_0x6a4c('0x2e')][_0x6a4c('0x65')][_0x6a4c('0x69')]())+_0x6a4c('0x6a')][_0x6a4c('0x43')]);_0x4451ca[_0x6a4c('0x2e')]=_[_0x6a4c('0x42')](_0x3008fd[_0x6a4c('0x2e')]);_0x4451ca[_0x6a4c('0x2f')]=_[_0x6a4c('0x30')](_0x4451ca[_0x6a4c('0x31')],_0x4451ca[_0x6a4c('0x2e')]);_0x4b0c39[_0x6a4c('0x32')]=_[_0x6a4c('0x30')](_0x4451ca[_0x6a4c('0x31')],qs['fields'](_0x3008fd[_0x6a4c('0x2e')][_0x6a4c('0x33')]));_0x4b0c39['attributes']=_0x4b0c39['attributes'][_0x6a4c('0x6b')]?_0x4b0c39[_0x6a4c('0x32')]:_0x4451ca['model'];_0x4b0c39[_0x6a4c('0x1f')]=qs[_0x6a4c('0x1f')](_0x3008fd[_0x6a4c('0x2e')][_0x6a4c('0x1f')]);_0x4b0c39[_0x6a4c('0x21')]=qs['offset'](_0x3008fd['query']['offset']);_0x4b0c39[_0x6a4c('0x6c')]=qs['sort'](_0x3008fd[_0x6a4c('0x2e')]['sort']);_0x4b0c39[_0x6a4c('0x36')]=qs[_0x6a4c('0x2f')](_['pick'](_0x3008fd[_0x6a4c('0x2e')],_0x4451ca[_0x6a4c('0x2f')]));_0x4b0c39=_[_0x6a4c('0x39')]({},_0x4b0c39,_0x3008fd[_0x6a4c('0x3c')]);return _0x391a10[_0x6a4c('0x4a')+_['capitalize'](_0x3008fd[_0x6a4c('0x2e')][_0x6a4c('0x65')][_0x6a4c('0x69')]())+_0x6a4c('0x6d')](_0x4b0c39);})[_0x6a4c('0x3d')](respondWithResult(_0x124700,null))['catch'](handleError(_0x124700,null));};exports['addQueues']=function(_0x327c87,_0x4f99d7,_0x12ad50){return db[_0x6a4c('0x2d')][_0x6a4c('0x6e')]({'where':{'id':_0x327c87[_0x6a4c('0x41')]['id']}})[_0x6a4c('0x3d')](function(_0x18f76a){if(_0x18f76a){if(!_0x327c87[_0x6a4c('0x47')][_0x6a4c('0x65')]||!utils[_0x6a4c('0x66')](_0x327c87[_0x6a4c('0x47')][_0x6a4c('0x65')])){throw new db[(_0x6a4c('0x53'))][(_0x6a4c('0x67'))](_0x6a4c('0x6f'));}return _0x18f76a['add'+_[_0x6a4c('0x68')](_0x327c87[_0x6a4c('0x47')]['channel'][_0x6a4c('0x69')]())+_0x6a4c('0x6d')](_0x327c87['body'][_0x6a4c('0x70')]);}return null;})[_0x6a4c('0x3d')](handleEntityNotFound(_0x4f99d7,null))['then'](respondWithStatusCode(_0x4f99d7,null))['catch'](handleError(_0x4f99d7,null));};exports['removeQueues']=function(_0x151786,_0x24b600,_0x13edfc){return db[_0x6a4c('0x2d')][_0x6a4c('0x6e')]({'where':{'id':_0x151786['params']['id']}})['then'](function(_0x2bce3c){if(_0x2bce3c){if(!_0x151786[_0x6a4c('0x2e')][_0x6a4c('0x65')]||!utils['isValidChannel'](_0x151786[_0x6a4c('0x2e')][_0x6a4c('0x65')])){throw new db[(_0x6a4c('0x53'))]['ValidationError'](_0x6a4c('0x6f'));}return _0x2bce3c[_0x6a4c('0x71')+_[_0x6a4c('0x68')](_0x151786[_0x6a4c('0x2e')][_0x6a4c('0x65')][_0x6a4c('0x69')]())+_0x6a4c('0x6d')](_0x151786[_0x6a4c('0x2e')]['ids']);}return null;})[_0x6a4c('0x3d')](handleEntityNotFound(_0x24b600,null))[_0x6a4c('0x3d')](respondWithStatusCode(_0x24b600,null))['catch'](handleError(_0x24b600,null));};exports['addAgents']=function(_0x51ffb9,_0x210c87){var _0x54d527=_[_0x6a4c('0x72')](_0x51ffb9[_0x6a4c('0x47')][_0x6a4c('0x70')])?_0x51ffb9[_0x6a4c('0x47')][_0x6a4c('0x70')]:[_0x51ffb9['body'][_0x6a4c('0x70')]];var _0xfd2b4d=_0x51ffb9[_0x6a4c('0x41')]['id'];return db[_0x6a4c('0x2d')][_0x6a4c('0x45')]({'where':{'id':_0xfd2b4d}})[_0x6a4c('0x3d')](handleEntityNotFound(_0x210c87,null))['then'](function(_0x3c0405){if(_0x3c0405){var _0x4fe55d=[_0x6a4c('0x73'),'Chat','Mail',_0x6a4c('0x74'),'Fax','Openchannel',_0x6a4c('0x75')];return db[_0x6a4c('0x50')][_0x6a4c('0x51')](function(_0xa305b7){var _0x50c540=_[_0x6a4c('0x2c')](_0x4fe55d,function(_0x1a7391){var _0x15f4ab={'attributes':['id',_0x6a4c('0x2a')]};if(_0x1a7391===_0x6a4c('0x73')){_0x15f4ab[_0x6a4c('0x76')]={'attributes':[_0x6a4c('0x77')]};}return _0x3c0405[_0x6a4c('0x4a')+_0x1a7391+'Queues'](_0x15f4ab)[_0x6a4c('0x3d')](function(_0x3452c7){var _0x12954f=_[_0x6a4c('0x2c')](_0x3452c7,function(_0x4ba6a8){var _0x2634f0=_[_0x6a4c('0x2c')](_0x54d527,function(_0x239857){var _0x2ed871={'where':{'UserId':_0x239857,[_0x1a7391+_0x6a4c('0x78')]:_0x4ba6a8['id']},'transaction':_0xa305b7};if(_0x1a7391==='Voice'){_0x2ed871[_0x6a4c('0x17')]={'penalty':_0x4ba6a8[_0x6a4c('0x79')]['penalty']};}return db[_0x6a4c('0x7a')+_0x1a7391+_0x6a4c('0x6a')][_0x6a4c('0x7b')](_0x2ed871)['then'](function(){socket[_0x6a4c('0x7c')]('user'+_0x1a7391+_0x6a4c('0x7d'),{'UserId':_0x239857,[_0x1a7391+_0x6a4c('0x78')]:_0x4ba6a8['id']});if(_0x1a7391!==_0x6a4c('0x73')){return;}return db[_0x6a4c('0x7a')][_0x6a4c('0x7e')]({'where':{'id':_0x54d527,'online':0x1},'attributes':['id',_0x6a4c('0x2a'),_0x6a4c('0x7f'),_0x6a4c('0x80'),_0x6a4c('0x81')],'raw':!![]})[_0x6a4c('0x3d')](function(_0x2758c8){var _0x14227c=_[_0x6a4c('0x2c')](_0x2758c8,function(_0x1346c4){return db[_0x6a4c('0x82')][_0x6a4c('0x83')]({'membername':_0x1346c4[_0x6a4c('0x2a')],'UserId':_0x1346c4['id'],'queue_name':_0x4ba6a8[_0x6a4c('0x2a')],'VoiceQueueId':_0x4ba6a8['id'],'interface':_['isNil'](_0x1346c4[_0x6a4c('0x81')])?util[_0x6a4c('0x84')]('SIP/%s',_0x1346c4['name']):_0x1346c4[_0x6a4c('0x81')],'paused':_0x1346c4[_0x6a4c('0x80')]||![],'penalty':_0x4ba6a8[_0x6a4c('0x79')][_0x6a4c('0x77')]},{'transaction':_0xa305b7});});return Promise[_0x6a4c('0x85')](_0x14227c);});});});return Promise[_0x6a4c('0x85')](_0x2634f0);});return Promise[_0x6a4c('0x85')](_0x12954f);})[_0x6a4c('0x3d')](function(){return db[_0x6a4c('0x86')][_0x6a4c('0x6e')]({'where':{'teamId':_0xfd2b4d}})[_0x6a4c('0x3d')](function(_0xd5b500){if(_0xd5b500){var _0x668583=_[_0x6a4c('0x2c')](_0x54d527,function(_0x591d1e){db[_0x6a4c('0x64')]['upsert']({'UserId':_0x591d1e,'VoicePrefixId':_0xd5b500[_0x6a4c('0x87')]});});return Promise[_0x6a4c('0x85')](_0x668583);}});});});return Promise[_0x6a4c('0x85')](_0x50c540)[_0x6a4c('0x3d')](function(){return _0x3c0405[_0x6a4c('0x88')](_0x54d527,{'transaction':_0xa305b7})['spread'](function(_0x2de326){return _0x2de326;});});});}})[_0x6a4c('0x3d')](respondWithResult(_0x210c87,null))['catch'](handleError(_0x210c87,null));};exports['removeAgents']=function(_0x3f6a00,_0x1b842a){var _0xee2fd6=_[_0x6a4c('0x72')](_0x3f6a00[_0x6a4c('0x2e')][_0x6a4c('0x70')])?_0x3f6a00['query']['ids']:[_0x3f6a00['query'][_0x6a4c('0x70')]];var _0x1f33e9=_0x3f6a00[_0x6a4c('0x41')]['id'];return db[_0x6a4c('0x2d')][_0x6a4c('0x45')]({'where':{'id':_0x1f33e9}})[_0x6a4c('0x3d')](handleEntityNotFound(_0x1b842a,null))['then'](function(_0x2d79bb){if(_0x2d79bb){var _0x5479db=[_0x6a4c('0x73'),_0x6a4c('0x89'),'Mail',_0x6a4c('0x74'),'Fax',_0x6a4c('0x8a'),_0x6a4c('0x75')];return db[_0x6a4c('0x50')][_0x6a4c('0x51')](function(_0x8c385a){var _0x2b319e=_[_0x6a4c('0x2c')](_0x5479db,function(_0x6c5e2){var _0x4dcfc6={'attributes':['id',_0x6a4c('0x2a')]};return _0x2d79bb[_0x6a4c('0x4a')+_0x6c5e2+_0x6a4c('0x6d')](_0x4dcfc6)[_0x6a4c('0x3d')](function(_0x67439a){var _0x4f695a=_[_0x6a4c('0x2c')](_0x67439a,function(_0x401ef7){return _0x401ef7['removeAgents'](_0xee2fd6,{'transaction':_0x8c385a})[_0x6a4c('0x3d')](function(){var _0x4223a8=_[_0x6a4c('0x2c')](_0xee2fd6,function(_0x4a8f4b){socket[_0x6a4c('0x7c')](_0x6a4c('0x48')+_0x6c5e2+_0x6a4c('0x8b'),{'UserId':Number(_0x4a8f4b),[_0x6c5e2+_0x6a4c('0x78')]:_0x401ef7['id']});if(_0x6c5e2!==_0x6a4c('0x73')){return;}return db[_0x6a4c('0x82')][_0x6a4c('0x5a')]({'where':{'VoiceQueueId':_0x401ef7['id'],'UserId':_0x4a8f4b},'transaction':_0x8c385a});});return Promise[_0x6a4c('0x85')](_0x4223a8);});});return Promise[_0x6a4c('0x85')](_0x4f695a);});});return Promise[_0x6a4c('0x85')](_0x2b319e)['then'](function(){return _0x2d79bb['removeAgents'](_0xee2fd6,{'transaction':_0x8c385a});})[_0x6a4c('0x3d')](function(){return db[_0x6a4c('0x86')][_0x6a4c('0x6e')]({'where':{'teamId':_0x1f33e9}})[_0x6a4c('0x3d')](function(_0x5d6445){if(_0x5d6445){var _0x46778e=_[_0x6a4c('0x2c')](_0xee2fd6,function(_0x2241e3){db[_0x6a4c('0x64')][_0x6a4c('0x5a')]({'where':{'UserId':_0x2241e3,'VoicePrefixId':_0x5d6445[_0x6a4c('0x87')]}});});return Promise[_0x6a4c('0x85')](_0x46778e);}});});});}})[_0x6a4c('0x3d')](respondWithStatusCode(_0x1b842a,null))[_0x6a4c('0x3f')](handleError(_0x1b842a,null));};exports['getAgents']=function(_0xd27981,_0x5d63b0,_0x236145){var _0x12d949={};var _0x50d166={};var _0x217046;var _0x208939;return db[_0x6a4c('0x2d')][_0x6a4c('0x6e')]({'where':{'id':_0xd27981[_0x6a4c('0x41')]['id']}})[_0x6a4c('0x3d')](handleEntityNotFound(_0x5d63b0,null))[_0x6a4c('0x3d')](function(_0x309eb0){if(_0x309eb0){_0x217046=_0x309eb0;_0x50d166[_0x6a4c('0x31')]=_[_0x6a4c('0x42')](db['User'][_0x6a4c('0x43')]);_0x50d166[_0x6a4c('0x2e')]=_[_0x6a4c('0x42')](_0xd27981['query']);_0x50d166[_0x6a4c('0x2f')]=_[_0x6a4c('0x30')](_0x50d166[_0x6a4c('0x31')],_0x50d166[_0x6a4c('0x2e')]);_0x12d949['attributes']=_[_0x6a4c('0x30')](_0x50d166[_0x6a4c('0x31')],qs[_0x6a4c('0x33')](_0xd27981[_0x6a4c('0x2e')][_0x6a4c('0x33')]));_0x12d949[_0x6a4c('0x32')]=_0x12d949[_0x6a4c('0x32')]['length']?_0x12d949[_0x6a4c('0x32')]:_0x50d166[_0x6a4c('0x31')];_0x12d949[_0x6a4c('0x6c')]=qs[_0x6a4c('0x35')](_0xd27981[_0x6a4c('0x2e')]['sort']);_0x12d949['where']=qs[_0x6a4c('0x2f')](_[_0x6a4c('0x37')](_0xd27981['query'],_0x50d166['filters']));if(_0xd27981[_0x6a4c('0x2e')][_0x6a4c('0x38')]){_0x12d949['where']=_[_0x6a4c('0x39')](_0x12d949[_0x6a4c('0x36')],{'$or':_[_0x6a4c('0x2c')](_0x12d949[_0x6a4c('0x32')],function(_0xde403e){var _0x30566b={};_0x30566b[_0xde403e]={'$like':'%'+_0xd27981[_0x6a4c('0x2e')][_0x6a4c('0x38')]+'%'};return _0x30566b;})});}_0x12d949=_['merge']({},_0x12d949,_0xd27981[_0x6a4c('0x3c')]);return _0x217046[_0x6a4c('0x8c')](_0x12d949);}})[_0x6a4c('0x3d')](function(_0x449c09){if(_0x449c09){_0x208939=_0x449c09[_0x6a4c('0x6b')];if(!_0xd27981['query'][_0x6a4c('0x34')]('nolimit')){_0x12d949[_0x6a4c('0x1f')]=qs[_0x6a4c('0x1f')](_0xd27981['query'][_0x6a4c('0x1f')]);_0x12d949[_0x6a4c('0x21')]=qs[_0x6a4c('0x21')](_0xd27981[_0x6a4c('0x2e')][_0x6a4c('0x21')]);}return _0x217046[_0x6a4c('0x8c')](_0x12d949);}})[_0x6a4c('0x3d')](function(_0x1a0d2d){if(_0x1a0d2d){return _0x1a0d2d?{'count':_0x208939,'rows':_0x1a0d2d}:null;}})[_0x6a4c('0x3d')](respondWithResult(_0x5d63b0,null))['catch'](handleError(_0x5d63b0,null));}; \ No newline at end of file +var _0xd515=['body','destroy','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','Sequelize','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','addQueues','add','toLowerCase','Queues','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','emit','findAll','online','voicePause','UserVoiceQueueRt','isNil','interface','all','spread','removeAgents','Openchannel','getAgents','eml-format','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','Team','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','includeAll','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','create','catch'];(function(_0x28d434,_0x2d2610){var _0x1109c6=function(_0x6f8c30){while(--_0x6f8c30){_0x28d434['push'](_0x28d434['shift']());}};_0x1109c6(++_0x2d2610);}(_0xd515,0x1f1));var _0x5d51=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xd515[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require(_0x5d51('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d51('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d51('0x2'));var util=require(_0x5d51('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x5d51('0x4'));var ejs=require(_0x5d51('0x5'));var fs=require('fs');var fs_extra=require(_0x5d51('0x6'));var _=require(_0x5d51('0x7'));var squel=require('squel');var crypto=require(_0x5d51('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5d51('0x9'));var toCsv=require(_0x5d51('0x4'));var querystring=require(_0x5d51('0xa'));var Papa=require(_0x5d51('0xb'));var Redis=require('ioredis');var authService=require(_0x5d51('0xc'));var qs=require(_0x5d51('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d51('0xe'));var logger=require(_0x5d51('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x5d51('0x10'));var licenseUtil=require(_0x5d51('0x11'));var db=require(_0x5d51('0x12'))['db'];config[_0x5d51('0x13')]=_[_0x5d51('0x14')](config[_0x5d51('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d51('0x13')]));require(_0x5d51('0x15'))[_0x5d51('0x16')](socket);function respondWithStatusCode(_0x1434cf,_0x158a05){_0x158a05=_0x158a05||0xcc;return function(_0x5796d0){if(_0x5796d0){return _0x1434cf[_0x5d51('0x17')](_0x158a05);}return _0x1434cf[_0x5d51('0x18')](_0x158a05)[_0x5d51('0x19')]();};}function respondWithResult(_0x43da96,_0x2a7081){_0x2a7081=_0x2a7081||0xc8;return function(_0x3deb28){if(_0x3deb28){return _0x43da96[_0x5d51('0x18')](_0x2a7081)[_0x5d51('0x1a')](_0x3deb28);}};}function respondWithFilteredResult(_0x38e6bc,_0x37acd3){return function(_0x30f720){if(_0x30f720){var _0x48b08b=typeof _0x37acd3[_0x5d51('0x1b')]===_0x5d51('0x1c')&&typeof _0x37acd3[_0x5d51('0x1d')]==='undefined';var _0xf0f0a3=_0x30f720[_0x5d51('0x1e')];var _0x45bbde=_0x48b08b?0x0:_0x37acd3[_0x5d51('0x1b')];var _0x24e651=_0x48b08b?_0x30f720[_0x5d51('0x1e')]:_0x37acd3['offset']+_0x37acd3['limit'];var _0x1cfabe;if(_0x24e651>=_0xf0f0a3){_0x24e651=_0xf0f0a3;_0x1cfabe=0xc8;}else{_0x1cfabe=0xce;}_0x38e6bc[_0x5d51('0x18')](_0x1cfabe);return _0x38e6bc[_0x5d51('0x1f')](_0x5d51('0x20'),_0x45bbde+'-'+_0x24e651+'/'+_0xf0f0a3)[_0x5d51('0x1a')](_0x30f720);}return null;};}function patchUpdates(_0x39668c){return function(_0x36c038){try{jsonpatch[_0x5d51('0x21')](_0x36c038,_0x39668c,!![]);}catch(_0x1b7664){return BPromise[_0x5d51('0x22')](_0x1b7664);}return _0x36c038[_0x5d51('0x23')]();};}function saveUpdates(_0x19341e,_0x54ec2f){return function(_0x5bc4f8){if(_0x5bc4f8){return _0x5bc4f8[_0x5d51('0x24')](_0x19341e)[_0x5d51('0x25')](function(_0x5718a3){return _0x5718a3;});}return null;};}function handleEntityNotFound(_0x30a6f8,_0x5ea485){return function(_0x538f9d){if(!_0x538f9d){_0x30a6f8[_0x5d51('0x17')](0x194);}return _0x538f9d;};}function handleError(_0x45b5b0,_0x486153){_0x486153=_0x486153||0x1f4;return function(_0x1b8148){logger[_0x5d51('0x26')](_0x1b8148[_0x5d51('0x27')]);if(_0x1b8148[_0x5d51('0x28')]){delete _0x1b8148[_0x5d51('0x28')];}_0x45b5b0[_0x5d51('0x18')](_0x486153)['send'](_0x1b8148);};}exports[_0x5d51('0x29')]=function(_0x2af6c2,_0x4e82d2){var _0x43e172={},_0x207d92={},_0x491929={'count':0x0,'rows':[]};var _0x33c5cc=_[_0x5d51('0x2a')](db[_0x5d51('0x2b')][_0x5d51('0x2c')],function(_0x44cf1c){return{'name':_0x44cf1c['fieldName'],'type':_0x44cf1c[_0x5d51('0x2d')][_0x5d51('0x2e')]};});_0x207d92[_0x5d51('0x2f')]=_[_0x5d51('0x2a')](_0x33c5cc,_0x5d51('0x28'));_0x207d92[_0x5d51('0x30')]=_[_0x5d51('0x31')](_0x2af6c2[_0x5d51('0x30')]);_0x207d92[_0x5d51('0x32')]=_[_0x5d51('0x33')](_0x207d92[_0x5d51('0x2f')],_0x207d92['query']);_0x43e172['attributes']=_[_0x5d51('0x33')](_0x207d92['model'],qs['fields'](_0x2af6c2['query'][_0x5d51('0x34')]));_0x43e172[_0x5d51('0x35')]=_0x43e172['attributes'][_0x5d51('0x36')]?_0x43e172[_0x5d51('0x35')]:_0x207d92[_0x5d51('0x2f')];if(!_0x2af6c2[_0x5d51('0x30')][_0x5d51('0x37')](_0x5d51('0x38'))){_0x43e172['limit']=qs[_0x5d51('0x1d')](_0x2af6c2[_0x5d51('0x30')][_0x5d51('0x1d')]);_0x43e172[_0x5d51('0x1b')]=qs[_0x5d51('0x1b')](_0x2af6c2[_0x5d51('0x30')][_0x5d51('0x1b')]);}_0x43e172[_0x5d51('0x39')]=qs[_0x5d51('0x3a')](_0x2af6c2[_0x5d51('0x30')][_0x5d51('0x3a')]);_0x43e172[_0x5d51('0x3b')]=qs[_0x5d51('0x32')](_[_0x5d51('0x3c')](_0x2af6c2[_0x5d51('0x30')],_0x207d92[_0x5d51('0x32')]),_0x33c5cc);if(_0x2af6c2[_0x5d51('0x30')][_0x5d51('0x3d')]){_0x43e172['where']=_['merge'](_0x43e172[_0x5d51('0x3b')],{'$or':_[_0x5d51('0x2a')](_0x33c5cc,function(_0x11a940){if(_0x11a940[_0x5d51('0x2d')]!==_0x5d51('0x3e')){var _0x5d02c6={};_0x5d02c6[_0x11a940['name']]={'$like':'%'+_0x2af6c2['query'][_0x5d51('0x3d')]+'%'};return _0x5d02c6;}})});}_0x43e172=_[_0x5d51('0x3f')]({},_0x43e172,_0x2af6c2[_0x5d51('0x40')]);var _0x12a463={'where':_0x43e172['where']};return db[_0x5d51('0x2b')][_0x5d51('0x1e')](_0x12a463)[_0x5d51('0x25')](function(_0x5f1805){_0x491929['count']=_0x5f1805;if(_0x2af6c2[_0x5d51('0x30')]['includeAll']){_0x43e172[_0x5d51('0x41')]=[{'all':!![]}];}return db['Team']['findAll'](_0x43e172);})[_0x5d51('0x25')](function(_0x3fce90){_0x491929[_0x5d51('0x42')]=_0x3fce90;return _0x491929;})[_0x5d51('0x25')](respondWithFilteredResult(_0x4e82d2,_0x43e172))['catch'](handleError(_0x4e82d2,null));};exports['show']=function(_0x28752a,_0x39da16){var _0x5b6ad4={'raw':![],'where':{'id':_0x28752a['params']['id']}},_0x3e5022={};_0x3e5022['model']=_['keys'](db['Team']['rawAttributes']);_0x3e5022[_0x5d51('0x30')]=_[_0x5d51('0x31')](_0x28752a['query']);_0x3e5022[_0x5d51('0x32')]=_[_0x5d51('0x33')](_0x3e5022[_0x5d51('0x2f')],_0x3e5022['query']);_0x5b6ad4['attributes']=_['intersection'](_0x3e5022[_0x5d51('0x2f')],qs[_0x5d51('0x34')](_0x28752a[_0x5d51('0x30')][_0x5d51('0x34')]));_0x5b6ad4['attributes']=_0x5b6ad4[_0x5d51('0x35')]['length']?_0x5b6ad4['attributes']:_0x3e5022[_0x5d51('0x2f')];if(_0x28752a['query'][_0x5d51('0x43')]){_0x5b6ad4[_0x5d51('0x41')]=[{'all':!![]}];}_0x5b6ad4=_['merge']({},_0x5b6ad4,_0x28752a[_0x5d51('0x40')]);return db[_0x5d51('0x2b')][_0x5d51('0x44')](_0x5b6ad4)['then'](handleEntityNotFound(_0x39da16,null))[_0x5d51('0x25')](respondWithResult(_0x39da16,null))['catch'](handleError(_0x39da16,null));};exports['create']=function(_0x1991e5,_0x4aa5ee){return db[_0x5d51('0x2b')]['create'](_0x1991e5['body'],{})[_0x5d51('0x25')](function(_0xd449fb){var _0x1d9853=_0x1991e5[_0x5d51('0x45')][_0x5d51('0x46')]({'plain':!![]});if(!_0x1d9853)throw new Error(_0x5d51('0x47'));if(_0x1d9853[_0x5d51('0x48')]===_0x5d51('0x45')){var _0x258853=_0xd449fb[_0x5d51('0x46')]({'plain':!![]});var _0x2b21f6=_0x5d51('0x49');return db['UserProfileSection'][_0x5d51('0x44')]({'where':{'name':_0x2b21f6,'userProfileId':_0x1d9853[_0x5d51('0x4a')]},'raw':!![]})[_0x5d51('0x25')](function(_0x267469){if(_0x267469&&_0x267469[_0x5d51('0x4b')]===0x0){return db[_0x5d51('0x4c')][_0x5d51('0x4d')]({'name':_0x258853[_0x5d51('0x28')],'resourceId':_0x258853['id'],'type':_0x267469[_0x5d51('0x28')],'sectionId':_0x267469['id']},{})['then'](function(){return _0xd449fb;});}else{return _0xd449fb;}})[_0x5d51('0x4e')](function(_0x3b65b4){logger[_0x5d51('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b65b4);throw _0x3b65b4;});}return _0xd449fb;})['then'](respondWithResult(_0x4aa5ee,0xc9))[_0x5d51('0x4e')](handleError(_0x4aa5ee,null));};exports[_0x5d51('0x24')]=function(_0x581d28,_0x5f25c4){if(_0x581d28[_0x5d51('0x4f')]['id']){delete _0x581d28[_0x5d51('0x4f')]['id'];}return db[_0x5d51('0x2b')][_0x5d51('0x44')]({'where':{'id':_0x581d28['params']['id']}})[_0x5d51('0x25')](handleEntityNotFound(_0x5f25c4,null))[_0x5d51('0x25')](saveUpdates(_0x581d28['body'],null))[_0x5d51('0x25')](respondWithResult(_0x5f25c4,null))[_0x5d51('0x4e')](handleError(_0x5f25c4,null));};exports[_0x5d51('0x50')]=function(_0x1f3b3c,_0x1426be){var _0x5a4eb2=_0x1f3b3c[_0x5d51('0x51')]['id'];var _0x3edc9c=[];return db[_0x5d51('0x52')][_0x5d51('0x53')](function(_0x5aaa20){var _0x1f4901=_0x5d51('0x54')+_0x5a4eb2;return db[_0x5d51('0x52')]['query'](_0x1f4901,{'type':db['Sequelize'][_0x5d51('0x55')][_0x5d51('0x56')],'raw':!![],'transaction':_0x5aaa20})[_0x5d51('0x25')](function(_0x1ab8cd){_0x3edc9c=_[_0x5d51('0x2a')](_0x1ab8cd,function(_0x4a051d){return Number(_0x4a051d['UserId']);});})[_0x5d51('0x25')](function(){var _0x128747='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5a4eb2;return db[_0x5d51('0x52')][_0x5d51('0x30')](_0x128747,{'type':db[_0x5d51('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(_0x2ef29d){var _0x3b5c1e=_[_0x5d51('0x2a')](_0x2ef29d,function(_0x55bfe1){return Number(_0x55bfe1['VoiceQueueId']);});return db[_0x5d51('0x58')][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'VoiceQueueId':{'$in':_0x3b5c1e}},'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(){var _0x4e9b64=_0x5d51('0x59')+_0x5a4eb2;return db[_0x5d51('0x52')]['query'](_0x4e9b64,{'type':db[_0x5d51('0x57')][_0x5d51('0x55')][_0x5d51('0x56')],'raw':!![],'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(_0x47f228){var _0x36a5cb=_[_0x5d51('0x2a')](_0x47f228,function(_0x4cbed8){return Number(_0x4cbed8[_0x5d51('0x5a')]);});return db[_0x5d51('0x5b')][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'MailQueueId':{'$in':_0x36a5cb}},'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(){var _0x5427ab='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5a4eb2;return db[_0x5d51('0x52')][_0x5d51('0x30')](_0x5427ab,{'type':db['Sequelize']['QueryTypes'][_0x5d51('0x56')],'raw':!![],'transaction':_0x5aaa20});})['then'](function(_0x4fee4d){var _0x35569a=_[_0x5d51('0x2a')](_0x4fee4d,function(_0x532104){return Number(_0x532104[_0x5d51('0x5c')]);});return db['UserSmsQueue'][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'SmsQueueId':{'$in':_0x35569a}},'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(){var _0x54abd9=_0x5d51('0x5d')+_0x5a4eb2;return db['sequelize'][_0x5d51('0x30')](_0x54abd9,{'type':db[_0x5d51('0x57')][_0x5d51('0x55')][_0x5d51('0x56')],'raw':!![],'transaction':_0x5aaa20});})['then'](function(_0x4dae03){var _0x275fbf=_[_0x5d51('0x2a')](_0x4dae03,function(_0x380d8a){return Number(_0x380d8a['ChatQueueId']);});return db['UserChatQueue'][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'ChatQueueId':{'$in':_0x275fbf}},'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(){var _0x558c90=_0x5d51('0x5e')+_0x5a4eb2;return db[_0x5d51('0x52')][_0x5d51('0x30')](_0x558c90,{'type':db[_0x5d51('0x57')][_0x5d51('0x55')][_0x5d51('0x56')],'raw':!![],'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(_0x56ffec){var _0x44d282=_[_0x5d51('0x2a')](_0x56ffec,function(_0x1ce397){return Number(_0x1ce397[_0x5d51('0x5f')]);});return db['UserFaxQueue'][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'FaxQueueId':{'$in':_0x44d282}},'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(){var _0x1d8ed7=_0x5d51('0x60')+_0x5a4eb2;return db[_0x5d51('0x52')][_0x5d51('0x30')](_0x1d8ed7,{'type':db[_0x5d51('0x57')][_0x5d51('0x55')][_0x5d51('0x56')],'raw':!![],'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(_0x58bfd0){var _0x4ada3c=_['map'](_0x58bfd0,function(_0x445e06){return Number(_0x445e06[_0x5d51('0x61')]);});return db[_0x5d51('0x62')][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'OpenchannelQueueId':{'$in':_0x4ada3c}},'transaction':_0x5aaa20});})['then'](function(){var _0x3c8231=_0x5d51('0x63')+_0x5a4eb2;return db[_0x5d51('0x52')][_0x5d51('0x30')](_0x3c8231,{'type':db[_0x5d51('0x57')][_0x5d51('0x55')][_0x5d51('0x56')],'raw':!![],'transaction':_0x5aaa20});})['then'](function(_0x45069b){var _0x2d1c5c=_[_0x5d51('0x2a')](_0x45069b,function(_0x5d3959){return Number(_0x5d3959[_0x5d51('0x64')]);});return db[_0x5d51('0x65')][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'WhatsappQueueId':{'$in':_0x2d1c5c}},'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(){return db[_0x5d51('0x66')][_0x5d51('0x44')]({'where':{'TeamId':_0x5a4eb2}});})['then'](function(_0xdc00aa){if(_0xdc00aa===null){return;}return db[_0x5d51('0x67')][_0x5d51('0x50')]({'where':{'UserId':{'$in':_0x3edc9c},'VoicePrefixId':_0xdc00aa[_0x5d51('0x68')]},'transaction':_0x5aaa20});})[_0x5d51('0x25')](function(){return db[_0x5d51('0x2b')][_0x5d51('0x50')]({'where':{'id':_0x5a4eb2},'cascade':!![],'transaction':_0x5aaa20});})['then'](function(_0x3389bb){if(_0x3389bb===0x0){_0x1426be['sendStatus'](0x194);}else{return db[_0x5d51('0x4c')]['destroy']({'where':{'type':_0x5d51('0x49'),'resourceId':_0x5a4eb2},'cascade':!![],'transaction':_0x5aaa20})['then'](function(){_0x1426be['status'](0xcc)[_0x5d51('0x19')]();});}})['catch'](function(_0x53d91c){_0x1426be[_0x5d51('0x18')](0x1f4)[_0x5d51('0x69')](_0x53d91c);});});};exports['getQueues']=function(_0x1db007,_0x1da5cd,_0x3771e5){return db[_0x5d51('0x2b')][_0x5d51('0x6a')]({'where':{'id':_0x1db007['params']['id']}})[_0x5d51('0x25')](handleEntityNotFound(_0x1da5cd,null))['then'](function(_0x59b1f0){if(!_0x1db007[_0x5d51('0x30')][_0x5d51('0x6b')]||!utils[_0x5d51('0x6c')](_0x1db007[_0x5d51('0x30')][_0x5d51('0x6b')])){throw new db[(_0x5d51('0x57'))][(_0x5d51('0x6d'))](_0x5d51('0x6e'));}var _0x58aa80={};var _0x575ffd={};_0x575ffd[_0x5d51('0x2f')]=_[_0x5d51('0x31')](db[_[_0x5d51('0x6f')](_0x1db007[_0x5d51('0x30')][_0x5d51('0x6b')]['toLowerCase']())+_0x5d51('0x70')][_0x5d51('0x2c')]);_0x575ffd['query']=_[_0x5d51('0x31')](_0x1db007[_0x5d51('0x30')]);_0x575ffd[_0x5d51('0x32')]=_[_0x5d51('0x33')](_0x575ffd[_0x5d51('0x2f')],_0x575ffd[_0x5d51('0x30')]);_0x58aa80['attributes']=_[_0x5d51('0x33')](_0x575ffd['model'],qs[_0x5d51('0x34')](_0x1db007['query']['fields']));_0x58aa80[_0x5d51('0x35')]=_0x58aa80[_0x5d51('0x35')][_0x5d51('0x36')]?_0x58aa80[_0x5d51('0x35')]:_0x575ffd[_0x5d51('0x2f')];_0x58aa80[_0x5d51('0x1d')]=qs[_0x5d51('0x1d')](_0x1db007[_0x5d51('0x30')]['limit']);_0x58aa80[_0x5d51('0x1b')]=qs[_0x5d51('0x1b')](_0x1db007['query'][_0x5d51('0x1b')]);_0x58aa80[_0x5d51('0x39')]=qs[_0x5d51('0x3a')](_0x1db007[_0x5d51('0x30')]['sort']);_0x58aa80[_0x5d51('0x3b')]=qs[_0x5d51('0x32')](_[_0x5d51('0x3c')](_0x1db007[_0x5d51('0x30')],_0x575ffd[_0x5d51('0x32')]));_0x58aa80=_[_0x5d51('0x3f')]({},_0x58aa80,_0x1db007[_0x5d51('0x40')]);return _0x59b1f0[_0x5d51('0x46')+_['capitalize'](_0x1db007[_0x5d51('0x30')][_0x5d51('0x6b')]['toLowerCase']())+'Queues'](_0x58aa80);})[_0x5d51('0x25')](respondWithResult(_0x1da5cd,null))['catch'](handleError(_0x1da5cd,null));};exports[_0x5d51('0x71')]=function(_0x35d3de,_0x365b00,_0x52909d){return db[_0x5d51('0x2b')][_0x5d51('0x6a')]({'where':{'id':_0x35d3de['params']['id']}})[_0x5d51('0x25')](function(_0x360d2a){if(_0x360d2a){if(!_0x35d3de[_0x5d51('0x4f')][_0x5d51('0x6b')]||!utils[_0x5d51('0x6c')](_0x35d3de[_0x5d51('0x4f')][_0x5d51('0x6b')])){throw new db[(_0x5d51('0x57'))]['ValidationError'](_0x5d51('0x6e'));}return _0x360d2a[_0x5d51('0x72')+_[_0x5d51('0x6f')](_0x35d3de[_0x5d51('0x4f')][_0x5d51('0x6b')][_0x5d51('0x73')]())+_0x5d51('0x74')](_0x35d3de[_0x5d51('0x4f')][_0x5d51('0x75')]);}return null;})['then'](handleEntityNotFound(_0x365b00,null))[_0x5d51('0x25')](respondWithStatusCode(_0x365b00,null))[_0x5d51('0x4e')](handleError(_0x365b00,null));};exports[_0x5d51('0x76')]=function(_0x424400,_0x6ab30a,_0x1d98ef){return db[_0x5d51('0x2b')][_0x5d51('0x6a')]({'where':{'id':_0x424400[_0x5d51('0x51')]['id']}})[_0x5d51('0x25')](function(_0x154836){if(_0x154836){if(!_0x424400[_0x5d51('0x30')][_0x5d51('0x6b')]||!utils[_0x5d51('0x6c')](_0x424400[_0x5d51('0x30')][_0x5d51('0x6b')])){throw new db['Sequelize']['ValidationError'](_0x5d51('0x6e'));}return _0x154836[_0x5d51('0x77')+_[_0x5d51('0x6f')](_0x424400[_0x5d51('0x30')][_0x5d51('0x6b')][_0x5d51('0x73')]())+_0x5d51('0x74')](_0x424400['query']['ids']);}return null;})[_0x5d51('0x25')](handleEntityNotFound(_0x6ab30a,null))['then'](respondWithStatusCode(_0x6ab30a,null))[_0x5d51('0x4e')](handleError(_0x6ab30a,null));};exports[_0x5d51('0x78')]=function(_0x40f0a9,_0x5f5b3b){var _0x3101a5=_[_0x5d51('0x79')](_0x40f0a9[_0x5d51('0x4f')][_0x5d51('0x75')])?_0x40f0a9[_0x5d51('0x4f')]['ids']:[_0x40f0a9['body']['ids']];var _0x1de16e=_0x40f0a9[_0x5d51('0x51')]['id'];return db['Team']['find']({'where':{'id':_0x1de16e}})[_0x5d51('0x25')](handleEntityNotFound(_0x5f5b3b,null))[_0x5d51('0x25')](function(_0x1e1c46){if(_0x1e1c46){var _0x2dd771=[_0x5d51('0x7a'),_0x5d51('0x7b'),_0x5d51('0x7c'),_0x5d51('0x7d'),'Fax','Openchannel',_0x5d51('0x7e')];return db['sequelize'][_0x5d51('0x53')](function(_0x5359cf){var _0xd27883=_[_0x5d51('0x2a')](_0x2dd771,function(_0xa0d7dc){var _0x230207={'attributes':['id',_0x5d51('0x28')]};if(_0xa0d7dc===_0x5d51('0x7a')){_0x230207[_0x5d51('0x7f')]={'attributes':[_0x5d51('0x80')]};}return _0x1e1c46[_0x5d51('0x46')+_0xa0d7dc+_0x5d51('0x74')](_0x230207)[_0x5d51('0x25')](function(_0x22f122){var _0x5dce8e=_[_0x5d51('0x2a')](_0x22f122,function(_0x56b140){var _0x9a052=_[_0x5d51('0x2a')](_0x3101a5,function(_0x5dbed2){var _0xe10873={'where':{'UserId':_0x5dbed2,[_0xa0d7dc+_0x5d51('0x81')]:_0x56b140['id']},'transaction':_0x5359cf};if(_0xa0d7dc===_0x5d51('0x7a')){_0xe10873[_0x5d51('0x14')]={'penalty':_0x56b140[_0x5d51('0x82')]['penalty']};}return db[_0x5d51('0x83')+_0xa0d7dc+_0x5d51('0x70')]['findOrCreate'](_0xe10873)[_0x5d51('0x25')](function(){socket[_0x5d51('0x84')]('user'+_0xa0d7dc+'Queue:save',{'UserId':_0x5dbed2,[_0xa0d7dc+_0x5d51('0x81')]:_0x56b140['id']});if(_0xa0d7dc!=='Voice'){return;}return db['User'][_0x5d51('0x85')]({'where':{'id':_0x3101a5,'online':0x1},'attributes':['id','name',_0x5d51('0x86'),_0x5d51('0x87'),'interface'],'raw':!![]})['then'](function(_0x2727ff){var _0x1d0cc2=_[_0x5d51('0x2a')](_0x2727ff,function(_0x28ede5){return db[_0x5d51('0x88')]['upsert']({'membername':_0x28ede5[_0x5d51('0x28')],'UserId':_0x28ede5['id'],'queue_name':_0x56b140[_0x5d51('0x28')],'VoiceQueueId':_0x56b140['id'],'interface':_[_0x5d51('0x89')](_0x28ede5[_0x5d51('0x8a')])?util['format']('SIP/%s',_0x28ede5[_0x5d51('0x28')]):_0x28ede5['interface'],'paused':_0x28ede5[_0x5d51('0x87')]||![],'penalty':_0x56b140[_0x5d51('0x82')]['penalty']},{'transaction':_0x5359cf});});return Promise['all'](_0x1d0cc2);});});});return Promise[_0x5d51('0x8b')](_0x9a052);});return Promise[_0x5d51('0x8b')](_0x5dce8e);})[_0x5d51('0x25')](function(){return db[_0x5d51('0x66')][_0x5d51('0x6a')]({'where':{'teamId':_0x1de16e}})[_0x5d51('0x25')](function(_0x1c3d25){if(_0x1c3d25){var _0x20435a=_[_0x5d51('0x2a')](_0x3101a5,function(_0x4fa48b){db[_0x5d51('0x67')]['upsert']({'UserId':_0x4fa48b,'VoicePrefixId':_0x1c3d25['VoicePrefixId']});});return Promise[_0x5d51('0x8b')](_0x20435a);}});});});return Promise[_0x5d51('0x8b')](_0xd27883)[_0x5d51('0x25')](function(){return _0x1e1c46[_0x5d51('0x78')](_0x3101a5,{'transaction':_0x5359cf})[_0x5d51('0x8c')](function(_0x5d650b){return _0x5d650b;});});});}})[_0x5d51('0x25')](respondWithResult(_0x5f5b3b,null))['catch'](handleError(_0x5f5b3b,null));};exports[_0x5d51('0x8d')]=function(_0xc62b40,_0x1cf526){var _0xd2f0b6=_[_0x5d51('0x79')](_0xc62b40[_0x5d51('0x30')][_0x5d51('0x75')])?_0xc62b40[_0x5d51('0x30')][_0x5d51('0x75')]:[_0xc62b40[_0x5d51('0x30')][_0x5d51('0x75')]];var _0x46241e=_0xc62b40[_0x5d51('0x51')]['id'];return db[_0x5d51('0x2b')][_0x5d51('0x44')]({'where':{'id':_0x46241e}})[_0x5d51('0x25')](handleEntityNotFound(_0x1cf526,null))[_0x5d51('0x25')](function(_0x2214dd){if(_0x2214dd){var _0x54e622=['Voice','Chat','Mail',_0x5d51('0x7d'),'Fax',_0x5d51('0x8e'),'Whatsapp'];return db['sequelize'][_0x5d51('0x53')](function(_0x37afaf){var _0x9473c7=_[_0x5d51('0x2a')](_0x54e622,function(_0x42edb2){var _0x8ad167={'attributes':['id','name']};return _0x2214dd[_0x5d51('0x46')+_0x42edb2+_0x5d51('0x74')](_0x8ad167)[_0x5d51('0x25')](function(_0x377d00){var _0x1c78b4=_[_0x5d51('0x2a')](_0x377d00,function(_0x25bbc0){return _0x25bbc0['removeAgents'](_0xd2f0b6,{'transaction':_0x37afaf})[_0x5d51('0x25')](function(){var _0x2b5068=_[_0x5d51('0x2a')](_0xd2f0b6,function(_0x30d169){socket[_0x5d51('0x84')](_0x5d51('0x45')+_0x42edb2+'Queue:remove',{'UserId':Number(_0x30d169),[_0x42edb2+_0x5d51('0x81')]:_0x25bbc0['id']});if(_0x42edb2!==_0x5d51('0x7a')){return;}return db[_0x5d51('0x88')][_0x5d51('0x50')]({'where':{'VoiceQueueId':_0x25bbc0['id'],'UserId':_0x30d169},'transaction':_0x37afaf});});return Promise[_0x5d51('0x8b')](_0x2b5068);});});return Promise[_0x5d51('0x8b')](_0x1c78b4);});});return Promise[_0x5d51('0x8b')](_0x9473c7)['then'](function(){return _0x2214dd[_0x5d51('0x8d')](_0xd2f0b6,{'transaction':_0x37afaf});})[_0x5d51('0x25')](function(){return db[_0x5d51('0x66')][_0x5d51('0x6a')]({'where':{'teamId':_0x46241e}})[_0x5d51('0x25')](function(_0x5649d1){if(_0x5649d1){var _0x1ad477=_['map'](_0xd2f0b6,function(_0x2d5c7a){db['UserVoicePrefix'][_0x5d51('0x50')]({'where':{'UserId':_0x2d5c7a,'VoicePrefixId':_0x5649d1['VoicePrefixId']}});});return Promise['all'](_0x1ad477);}});});});}})[_0x5d51('0x25')](respondWithStatusCode(_0x1cf526,null))['catch'](handleError(_0x1cf526,null));};exports[_0x5d51('0x8f')]=function(_0x23e044,_0x4efa3a,_0x36d351){var _0x43933={};var _0x222c0e={};var _0x34e1c2;var _0x3c8f57;return db['Team'][_0x5d51('0x6a')]({'where':{'id':_0x23e044[_0x5d51('0x51')]['id']}})[_0x5d51('0x25')](handleEntityNotFound(_0x4efa3a,null))[_0x5d51('0x25')](function(_0x1c8783){if(_0x1c8783){_0x34e1c2=_0x1c8783;_0x222c0e[_0x5d51('0x2f')]=_['keys'](db[_0x5d51('0x83')][_0x5d51('0x2c')]);_0x222c0e[_0x5d51('0x30')]=_[_0x5d51('0x31')](_0x23e044[_0x5d51('0x30')]);_0x222c0e['filters']=_[_0x5d51('0x33')](_0x222c0e['model'],_0x222c0e[_0x5d51('0x30')]);_0x43933['attributes']=_[_0x5d51('0x33')](_0x222c0e[_0x5d51('0x2f')],qs[_0x5d51('0x34')](_0x23e044['query'][_0x5d51('0x34')]));_0x43933[_0x5d51('0x35')]=_0x43933[_0x5d51('0x35')][_0x5d51('0x36')]?_0x43933[_0x5d51('0x35')]:_0x222c0e['model'];_0x43933[_0x5d51('0x39')]=qs[_0x5d51('0x3a')](_0x23e044[_0x5d51('0x30')][_0x5d51('0x3a')]);_0x43933[_0x5d51('0x3b')]=qs[_0x5d51('0x32')](_[_0x5d51('0x3c')](_0x23e044[_0x5d51('0x30')],_0x222c0e[_0x5d51('0x32')]));if(_0x23e044[_0x5d51('0x30')]['filter']){_0x43933[_0x5d51('0x3b')]=_[_0x5d51('0x3f')](_0x43933[_0x5d51('0x3b')],{'$or':_[_0x5d51('0x2a')](_0x43933[_0x5d51('0x35')],function(_0x200805){var _0x59c6ce={};_0x59c6ce[_0x200805]={'$like':'%'+_0x23e044['query'][_0x5d51('0x3d')]+'%'};return _0x59c6ce;})});}_0x43933=_[_0x5d51('0x3f')]({},_0x43933,_0x23e044['options']);return _0x34e1c2['getAgents'](_0x43933);}})['then'](function(_0xf5395b){if(_0xf5395b){_0x3c8f57=_0xf5395b[_0x5d51('0x36')];if(!_0x23e044['query'][_0x5d51('0x37')](_0x5d51('0x38'))){_0x43933[_0x5d51('0x1d')]=qs['limit'](_0x23e044['query'][_0x5d51('0x1d')]);_0x43933[_0x5d51('0x1b')]=qs['offset'](_0x23e044['query']['offset']);}return _0x34e1c2[_0x5d51('0x8f')](_0x43933);}})['then'](function(_0x2eec0b){if(_0x2eec0b){return _0x2eec0b?{'count':_0x3c8f57,'rows':_0x2eec0b}:null;}})[_0x5d51('0x25')](respondWithResult(_0x4efa3a,null))['catch'](handleError(_0x4efa3a,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 27fa70e..31f835b 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 _0x160d=['update','emit','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0xb6a965,_0x5c5ace){var _0x51d37d=function(_0x1c7c0d){while(--_0x1c7c0d){_0xb6a965['push'](_0xb6a965['shift']());}};_0x51d37d(++_0x5c5ace);}(_0x160d,0x134));var _0xd160=function(_0x56d7e7,_0x46911e){_0x56d7e7=_0x56d7e7-0x0;var _0x367c49=_0x160d[_0x56d7e7];return _0x367c49;};'use strict';var EventEmitter=require(_0xd160('0x0'));var Team=require(_0xd160('0x1'))['db'][_0xd160('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd160('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd160('0x4'),'afterDestroy':'remove'};function emitEvent(_0x51b1c7){return function(_0x589179,_0x373ad8,_0x3164d2){TeamEvents[_0xd160('0x5')](_0x51b1c7+':'+_0x589179['id'],_0x589179);TeamEvents[_0xd160('0x5')](_0x51b1c7,_0x589179);_0x3164d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd160('0x6')](e,emitEvent(event));}}module[_0xd160('0x7')]=TeamEvents; \ No newline at end of file +var _0x2f3a=['hook','exports','events','../../mysqldb','Team','save','remove','emit','hasOwnProperty'];(function(_0x26efc6,_0x56b71d){var _0x12765a=function(_0x4b7082){while(--_0x4b7082){_0x26efc6['push'](_0x26efc6['shift']());}};_0x12765a(++_0x56b71d);}(_0x2f3a,0xf5));var _0xa2f3=function(_0x23358f,_0x1b7113){_0x23358f=_0x23358f-0x0;var _0x50b911=_0x2f3a[_0x23358f];return _0x50b911;};'use strict';var EventEmitter=require(_0xa2f3('0x0'));var Team=require(_0xa2f3('0x1'))['db'][_0xa2f3('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa2f3('0x3'),'afterUpdate':'update','afterDestroy':_0xa2f3('0x4')};function emitEvent(_0x3e8961){return function(_0x2ff08d,_0x3c5ff9,_0x43796f){TeamEvents[_0xa2f3('0x5')](_0x3e8961+':'+_0x2ff08d['id'],_0x2ff08d);TeamEvents[_0xa2f3('0x5')](_0x3e8961,_0x2ff08d);_0x43796f(null);};}for(var e in events){if(events[_0xa2f3('0x6')](e)){var event=events[e];Team[_0xa2f3('0x7')](e,emitEvent(event));}}module[_0xa2f3('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 8b1d814..cb2e087 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 _0xa262=['lodash','util','api','bluebird','request-promise','path','rimraf','./team.attributes','exports','define','teams'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa262,0x134));var _0x2a26=function(_0x339662,_0x7d24aa){_0x339662=_0x339662-0x0;var _0x477564=_0xa262[_0x339662];return _0x477564;};'use strict';var _=require(_0x2a26('0x0'));var util=require(_0x2a26('0x1'));var logger=require('../../config/logger')(_0x2a26('0x2'));var moment=require('moment');var BPromise=require(_0x2a26('0x3'));var rp=require(_0x2a26('0x4'));var fs=require('fs');var path=require(_0x2a26('0x5'));var rimraf=require(_0x2a26('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a26('0x7'));module[_0x2a26('0x8')]=function(_0x5d8d67,_0xf68b1e){return _0x5d8d67[_0x2a26('0x9')]('Team',attributes,{'tableName':_0x2a26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc66=['util','../../config/logger','api','bluebird','path','exports','define','Team','lodash'];(function(_0xbd70e0,_0x193932){var _0x2f1f32=function(_0x279e6e){while(--_0x279e6e){_0xbd70e0['push'](_0xbd70e0['shift']());}};_0x2f1f32(++_0x193932);}(_0xfc66,0x1d3));var _0x6fc6=function(_0x389a18,_0x36de1a){_0x389a18=_0x389a18-0x0;var _0x11b9bd=_0xfc66[_0x389a18];return _0x11b9bd;};'use strict';var _=require(_0x6fc6('0x0'));var util=require(_0x6fc6('0x1'));var logger=require(_0x6fc6('0x2'))(_0x6fc6('0x3'));var moment=require('moment');var BPromise=require(_0x6fc6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fc6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x6fc6('0x6')]=function(_0x35ef51,_0x3c3ca4){return _0x35ef51[_0x6fc6('0x7')](_0x6fc6('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index bc68e8c..0896c90 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 _0xd6a6=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x4c6850,_0x556541){var _0x5d98ee=function(_0x1808ac){while(--_0x1808ac){_0x4c6850['push'](_0x4c6850['shift']());}};_0x5d98ee(++_0x556541);}(_0xd6a6,0x1c1));var _0x6d6a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd6a6[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6d6a('0x0'));var util=require('util');var moment=require(_0x6d6a('0x1'));var BPromise=require(_0x6d6a('0x2'));var rs=require(_0x6d6a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d6a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d6a('0x5'))(_0x6d6a('0x6'));var config=require(_0x6d6a('0x7'));var jayson=require(_0x6d6a('0x8'));var client=jayson[_0x6d6a('0x9')][_0x6d6a('0xa')]({'port':0x232a});config[_0x6d6a('0xb')]=_['defaults'](config[_0x6d6a('0xb')],{'host':_0x6d6a('0xc'),'port':0x18eb});var socket=require(_0x6d6a('0xd'))(new Redis(config[_0x6d6a('0xb')]));require('./team.socket')[_0x6d6a('0xe')](socket);function respondWithRpcPromise(_0x1c7f38,_0x10e75b,_0xa5552d){return new BPromise(function(_0x59ab88,_0x21a9c8){return client[_0x6d6a('0xf')](_0x1c7f38,_0xa5552d)[_0x6d6a('0x10')](function(_0x50795b){logger[_0x6d6a('0x11')](_0x6d6a('0x12'),_0x10e75b,_0x6d6a('0x13'));logger['debug'](_0x6d6a('0x14'),_0x10e75b,'request\x20sent',JSON['stringify'](_0x50795b));if(_0x50795b[_0x6d6a('0x15')]){if(_0x50795b['error'][_0x6d6a('0x16')]===0x1f4){logger['error'](_0x6d6a('0x12'),_0x10e75b,_0x50795b[_0x6d6a('0x15')]['message']);return _0x21a9c8(_0x50795b[_0x6d6a('0x15')][_0x6d6a('0x17')]);}logger[_0x6d6a('0x15')]('Team,\x20%s,\x20%s',_0x10e75b,_0x50795b['error']['message']);return _0x59ab88(_0x50795b[_0x6d6a('0x15')][_0x6d6a('0x17')]);}else{logger[_0x6d6a('0x11')](_0x6d6a('0x12'),_0x10e75b,'request\x20sent');_0x59ab88(_0x50795b[_0x6d6a('0x18')][_0x6d6a('0x17')]);}})['catch'](function(_0x5e9cd1){logger[_0x6d6a('0x15')]('Team,\x20%s,\x20%s',_0x10e75b,_0x5e9cd1);_0x21a9c8(_0x5e9cd1);});});} \ No newline at end of file +var _0x5697=['randomstring','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x5697,0x1b5));var _0x7569=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x5697[_0x58d5ac];return _0x37985c;};'use strict';var _=require(_0x7569('0x0'));var util=require('util');var moment=require(_0x7569('0x1'));var BPromise=require(_0x7569('0x2'));var rs=require(_0x7569('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(_0x7569('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7569('0x5')]=_[_0x7569('0x6')](config[_0x7569('0x5')],{'host':_0x7569('0x7'),'port':0x18eb});var socket=require(_0x7569('0x8'))(new Redis(config[_0x7569('0x5')]));require('./team.socket')[_0x7569('0x9')](socket);function respondWithRpcPromise(_0x59dc0c,_0x9458b7,_0x37695a){return new BPromise(function(_0x3609d2,_0xa4f75a){return client[_0x7569('0xa')](_0x59dc0c,_0x37695a)[_0x7569('0xb')](function(_0x40fe5b){logger[_0x7569('0xc')](_0x7569('0xd'),_0x9458b7,'request\x20sent');logger[_0x7569('0xe')](_0x7569('0xf'),_0x9458b7,_0x7569('0x10'),JSON[_0x7569('0x11')](_0x40fe5b));if(_0x40fe5b[_0x7569('0x12')]){if(_0x40fe5b[_0x7569('0x12')]['code']===0x1f4){logger[_0x7569('0x12')](_0x7569('0xd'),_0x9458b7,_0x40fe5b[_0x7569('0x12')][_0x7569('0x13')]);return _0xa4f75a(_0x40fe5b['error'][_0x7569('0x13')]);}logger[_0x7569('0x12')]('Team,\x20%s,\x20%s',_0x9458b7,_0x40fe5b['error'][_0x7569('0x13')]);return _0x3609d2(_0x40fe5b[_0x7569('0x12')]['message']);}else{logger[_0x7569('0xc')](_0x7569('0xd'),_0x9458b7,'request\x20sent');_0x3609d2(_0x40fe5b[_0x7569('0x14')][_0x7569('0x13')]);}})[_0x7569('0x15')](function(_0x470fd2){logger[_0x7569('0x12')](_0x7569('0xd'),_0x9458b7,_0x470fd2);_0xa4f75a(_0x470fd2);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4b3031f..34cbf8a 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 _0xd523=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0x4e2e79,_0x580d9c){var _0x5b8eff=function(_0x3c3539){while(--_0x3c3539){_0x4e2e79['push'](_0x4e2e79['shift']());}};_0x5b8eff(++_0x580d9c);}(_0xd523,0x153));var _0x3d52=function(_0xa60a08,_0x21936e){_0xa60a08=_0xa60a08-0x0;var _0x51da6f=_0xd523[_0xa60a08];return _0x51da6f;};'use strict';var TeamEvents=require(_0x3d52('0x0'));var events=[_0x3d52('0x1'),_0x3d52('0x2'),_0x3d52('0x3')];function createListener(_0x492b9d,_0x20ccf9){return function(_0x1b5ea1){_0x20ccf9[_0x3d52('0x4')](_0x492b9d,_0x1b5ea1);};}function removeListener(_0x5103d8,_0x24d3af){return function(){TeamEvents[_0x3d52('0x5')](_0x5103d8,_0x24d3af);};}exports[_0x3d52('0x6')]=function(_0x46a0e9){for(var _0x580f82=0x0,_0x4fcc92=events[_0x3d52('0x7')];_0x580f82<_0x4fcc92;_0x580f82++){var _0x2f3ebc=events[_0x580f82];var _0x232bd4=createListener(_0x3d52('0x8')+_0x2f3ebc,_0x46a0e9);TeamEvents['on'](_0x2f3ebc,_0x232bd4);}}; \ No newline at end of file +var _0xd206=['emit','removeListener','register','length','team:','./team.events'];(function(_0x51e6e4,_0x1fc762){var _0x247442=function(_0x14f96b){while(--_0x14f96b){_0x51e6e4['push'](_0x51e6e4['shift']());}};_0x247442(++_0x1fc762);}(_0xd206,0x89));var _0x6d20=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd206[_0x413feb];return _0x40ee88;};'use strict';var TeamEvents=require(_0x6d20('0x0'));var events=['save','remove','update'];function createListener(_0x57ea4c,_0x156005){return function(_0x5d3e21){_0x156005[_0x6d20('0x1')](_0x57ea4c,_0x5d3e21);};}function removeListener(_0x5bc029,_0x4a816e){return function(){TeamEvents[_0x6d20('0x2')](_0x5bc029,_0x4a816e);};}exports[_0x6d20('0x3')]=function(_0x54a356){for(var _0x1d24a5=0x0,_0x1c50e2=events[_0x6d20('0x4')];_0x1d24a5<_0x1c50e2;_0x1d24a5++){var _0x1969a1=events[_0x1d24a5];var _0x331f24=createListener(_0x6d20('0x5')+_0x1969a1,_0x54a356);TeamEvents['on'](_0x1969a1,_0x331f24);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index dfaced2..b6bed12 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 _0x7a28=['INTEGER','exports'];(function(_0xcf323,_0x34c2d3){var _0x1cfa63=function(_0x3a99f7){while(--_0x3a99f7){_0xcf323['push'](_0xcf323['shift']());}};_0x1cfa63(++_0x34c2d3);}(_0x7a28,0x1cd));var _0x87a2=function(_0x2723ba,_0x417afd){_0x2723ba=_0x2723ba-0x0;var _0x149f9d=_0x7a28[_0x2723ba];return _0x149f9d;};'use strict';var Sequelize=require('sequelize');module[_0x87a2('0x0')]={'TeamId':{'type':Sequelize[_0x87a2('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x87a2('0x1')]}}; \ No newline at end of file +var _0x5dd5=['exports'];(function(_0x5c8fd6,_0x29c893){var _0x36ada0=function(_0x3fb5da){while(--_0x3fb5da){_0x5c8fd6['push'](_0x5c8fd6['shift']());}};_0x36ada0(++_0x29c893);}(_0x5dd5,0x1a0));var _0x55dd=function(_0xb4fc84,_0x39b3f3){_0xb4fc84=_0xb4fc84-0x0;var _0x1bc8d3=_0x5dd5[_0xb4fc84];return _0x1bc8d3;};'use strict';var Sequelize=require('sequelize');module[_0x55dd('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'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 9bebeb5..13b3734 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 _0x7fb3=['api','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash','util','../../config/logger'];(function(_0x4af4ea,_0xae4238){var _0x3f431d=function(_0x1ed7ce){while(--_0x1ed7ce){_0x4af4ea['push'](_0x4af4ea['shift']());}};_0x3f431d(++_0xae4238);}(_0x7fb3,0xf9));var _0x37fb=function(_0xd45112,_0x68c8b4){_0xd45112=_0xd45112-0x0;var _0x2cddb8=_0x7fb3[_0xd45112];return _0x2cddb8;};'use strict';var _=require(_0x37fb('0x0'));var util=require(_0x37fb('0x1'));var logger=require(_0x37fb('0x2'))(_0x37fb('0x3'));var moment=require('moment');var BPromise=require(_0x37fb('0x4'));var rp=require(_0x37fb('0x5'));var fs=require('fs');var path=require(_0x37fb('0x6'));var rimraf=require(_0x37fb('0x7'));var config=require('../../config/environment');var attributes=require(_0x37fb('0x8'));module[_0x37fb('0x9')]=function(_0x2443bd,_0x23a839){return _0x2443bd[_0x37fb('0xa')](_0x37fb('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9189=['../../config/logger','api','moment','bluebird','path','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix'];(function(_0x17d5ef,_0x4b3ae4){var _0x2d36c2=function(_0x4f500e){while(--_0x4f500e){_0x17d5ef['push'](_0x17d5ef['shift']());}};_0x2d36c2(++_0x4b3ae4);}(_0x9189,0x1b0));var _0x9918=function(_0x447a04,_0x929147){_0x447a04=_0x447a04-0x0;var _0x4c1d72=_0x9189[_0x447a04];return _0x4c1d72;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9918('0x0'))(_0x9918('0x1'));var moment=require(_0x9918('0x2'));var BPromise=require(_0x9918('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9918('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9918('0x5'));module[_0x9918('0x6')]=function(_0x4a47d4,_0x3ba4a8){return _0x4a47d4[_0x9918('0x7')](_0x9918('0x8'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 51f2810..803b8db 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x33ddea,_0x222f65){var _0x5e2f59=function(_0x15bf02){while(--_0x15bf02){_0x33ddea['push'](_0x33ddea['shift']());}};_0x5e2f59(++_0x222f65);}(_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'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x271d2,_0x139546){var _0x44c3e7=function(_0x3dbc1b){while(--_0x3dbc1b){_0x271d2['push'](_0x271d2['shift']());}};_0x44c3e7(++_0x139546);}(_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'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index f6851ec..6b9cbb7 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 _0xcb73=['sequelize'];(function(_0x55d196,_0xeb128a){var _0x4784d6=function(_0x20bdb3){while(--_0x20bdb3){_0x55d196['push'](_0x55d196['shift']());}};_0x4784d6(++_0xeb128a);}(_0xcb73,0xf9));var _0x3cb7=function(_0x4f6b0f,_0x4c8d66){_0x4f6b0f=_0x4f6b0f-0x0;var _0x40d992=_0xcb73[_0x4f6b0f];return _0x40d992;};'use strict';var Sequelize=require(_0x3cb7('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9561=['exports','sequelize'];(function(_0x7a8d80,_0x6cbee0){var _0x5ecdf2=function(_0x4bb09c){while(--_0x4bb09c){_0x7a8d80['push'](_0x7a8d80['shift']());}};_0x5ecdf2(++_0x6cbee0);}(_0x9561,0x109));var _0x1956=function(_0x43f8ff,_0x43374a){_0x43f8ff=_0x43f8ff-0x0;var _0x3768cb=_0x9561[_0x43f8ff];return _0x3768cb;};'use strict';var Sequelize=require(_0x1956('0x0'));module[_0x1956('0x1')]={'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 f363d41..7c2cde3 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 _0x0207=['TeamVoiceQueue','team_has_voice_queues','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define'];(function(_0x38d672,_0xc41411){var _0x33b0ca=function(_0x1022ee){while(--_0x1022ee){_0x38d672['push'](_0x38d672['shift']());}};_0x33b0ca(++_0xc41411);}(_0x0207,0x162));var _0x7020=function(_0x58d435,_0x50b0f6){_0x58d435=_0x58d435-0x0;var _0x2ef1b7=_0x0207[_0x58d435];return _0x2ef1b7;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7020('0x1'));var BPromise=require(_0x7020('0x2'));var rp=require(_0x7020('0x3'));var fs=require('fs');var path=require(_0x7020('0x4'));var rimraf=require(_0x7020('0x5'));var config=require(_0x7020('0x6'));var attributes=require(_0x7020('0x7'));module['exports']=function(_0x5074d7,_0x38c320){return _0x5074d7[_0x7020('0x8')](_0x7020('0x9'),attributes,{'tableName':_0x7020('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc678=['path','rimraf','../../config/environment','exports','define','team_has_voice_queues','../../config/logger','api','moment','request-promise'];(function(_0x346064,_0x25d321){var _0x20c40d=function(_0x13560d){while(--_0x13560d){_0x346064['push'](_0x346064['shift']());}};_0x20c40d(++_0x25d321);}(_0xc678,0x1b4));var _0x8c67=function(_0x232b20,_0x64c029){_0x232b20=_0x232b20-0x0;var _0x27c413=_0xc678[_0x232b20];return _0x27c413;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c67('0x0'))(_0x8c67('0x1'));var moment=require(_0x8c67('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c67('0x3'));var fs=require('fs');var path=require(_0x8c67('0x4'));var rimraf=require(_0x8c67('0x5'));var config=require(_0x8c67('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0x8c67('0x7')]=function(_0x5cdb40,_0x351c21){return _0x5cdb40[_0x8c67('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0x8c67('0x9'),'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 708e6a6..f227f60 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 _0x0ec2=['client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x0ec2,0x72));var _0x20ec=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x0ec2[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x20ec('0x0'));var util=require('util');var moment=require(_0x20ec('0x1'));var BPromise=require(_0x20ec('0x2'));var rs=require(_0x20ec('0x3'));var fs=require('fs');var Redis=require(_0x20ec('0x4'));var db=require(_0x20ec('0x5'))['db'];var utils=require(_0x20ec('0x6'));var logger=require(_0x20ec('0x7'))(_0x20ec('0x8'));var config=require(_0x20ec('0x9'));var jayson=require(_0x20ec('0xa'));var client=jayson[_0x20ec('0xb')][_0x20ec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x206398,_0x223215,_0x12f5b2){return new BPromise(function(_0x505472,_0x3fe13e){return client['request'](_0x206398,_0x12f5b2)[_0x20ec('0xd')](function(_0x3d2ad2){logger[_0x20ec('0xe')](_0x20ec('0xf'),_0x223215,_0x20ec('0x10'));logger[_0x20ec('0x11')](_0x20ec('0x12'),_0x223215,_0x20ec('0x10'),JSON[_0x20ec('0x13')](_0x3d2ad2));if(_0x3d2ad2[_0x20ec('0x14')]){if(_0x3d2ad2['error'][_0x20ec('0x15')]===0x1f4){logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x3d2ad2[_0x20ec('0x14')][_0x20ec('0x16')]);return _0x3fe13e(_0x3d2ad2['error']['message']);}logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x3d2ad2['error'][_0x20ec('0x16')]);return _0x505472(_0x3d2ad2[_0x20ec('0x14')][_0x20ec('0x16')]);}else{logger[_0x20ec('0xe')](_0x20ec('0xf'),_0x223215,_0x20ec('0x10'));_0x505472(_0x3d2ad2[_0x20ec('0x17')][_0x20ec('0x16')]);}})[_0x20ec('0x18')](function(_0x32a33b){logger[_0x20ec('0x14')](_0x20ec('0xf'),_0x223215,_0x32a33b);_0x3fe13e(_0x32a33b);});});} \ No newline at end of file +var _0x3dc0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x3751d2,_0x3c94a9){var _0x31c9d5=function(_0x5ed714){while(--_0x5ed714){_0x3751d2['push'](_0x3751d2['shift']());}};_0x31c9d5(++_0x3c94a9);}(_0x3dc0,0xad));var _0x03dc=function(_0x49642d,_0x5a5ced){_0x49642d=_0x49642d-0x0;var _0x1e468c=_0x3dc0[_0x49642d];return _0x1e468c;};'use strict';var _=require(_0x03dc('0x0'));var util=require(_0x03dc('0x1'));var moment=require(_0x03dc('0x2'));var BPromise=require(_0x03dc('0x3'));var rs=require(_0x03dc('0x4'));var fs=require('fs');var Redis=require(_0x03dc('0x5'));var db=require(_0x03dc('0x6'))['db'];var utils=require(_0x03dc('0x7'));var logger=require(_0x03dc('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x03dc('0x9'));var client=jayson[_0x03dc('0xa')][_0x03dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dccc2,_0x41a76a,_0x468705){return new BPromise(function(_0x5c92c2,_0x24ea01){return client['request'](_0x5dccc2,_0x468705)['then'](function(_0x50633d){logger[_0x03dc('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x41a76a,'request\x20sent');logger[_0x03dc('0xd')](_0x03dc('0xe'),_0x41a76a,_0x03dc('0xf'),JSON[_0x03dc('0x10')](_0x50633d));if(_0x50633d[_0x03dc('0x11')]){if(_0x50633d[_0x03dc('0x11')][_0x03dc('0x12')]===0x1f4){logger[_0x03dc('0x11')](_0x03dc('0x13'),_0x41a76a,_0x50633d[_0x03dc('0x11')][_0x03dc('0x14')]);return _0x24ea01(_0x50633d[_0x03dc('0x11')][_0x03dc('0x14')]);}logger[_0x03dc('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x41a76a,_0x50633d[_0x03dc('0x11')][_0x03dc('0x14')]);return _0x5c92c2(_0x50633d['error'][_0x03dc('0x14')]);}else{logger[_0x03dc('0xc')](_0x03dc('0x13'),_0x41a76a,_0x03dc('0xf'));_0x5c92c2(_0x50633d[_0x03dc('0x15')][_0x03dc('0x14')]);}})['catch'](function(_0x2e22d6){logger[_0x03dc('0x11')](_0x03dc('0x13'),_0x41a76a,_0x2e22d6);_0x24ea01(_0x2e22d6);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 187f610..35e0e83 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 _0x1967=['./template.controller','isAuthenticated','index','get','/:id','show','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x1967,0x173));var _0x7196=function(_0x16e5b9,_0x325cbc){_0x16e5b9=_0x16e5b9-0x0;var _0x38a0b6=_0x1967[_0x16e5b9];return _0x38a0b6;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['post']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xf')]);router[_0x7196('0x10')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller['update']);router['delete'](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0x11')]);module[_0x7196('0x12')]=router; \ No newline at end of file +var _0x75dc=['delete','/:id','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','show','post','put','update'];(function(_0x56545a,_0x5b964b){var _0x31eb1d=function(_0x422a0d){while(--_0x422a0d){_0x56545a['push'](_0x56545a['shift']());}};_0x31eb1d(++_0x5b964b);}(_0x75dc,0x1d7));var _0xc75d=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0x75dc[_0x349a9e];return _0x24c207;};'use strict';var multer=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc75d('0x2')]();var fs_extra=require(_0xc75d('0x3'));var auth=require(_0xc75d('0x4'));var interaction=require(_0xc75d('0x5'));var config=require(_0xc75d('0x6'));var controller=require(_0xc75d('0x7'));router['get']('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0x9')]);router[_0xc75d('0xa')]('/:id',auth[_0xc75d('0x8')](),controller[_0xc75d('0xb')]);router[_0xc75d('0xc')]('/',auth[_0xc75d('0x8')](),controller['create']);router[_0xc75d('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc75d('0xe')]);router[_0xc75d('0xf')](_0xc75d('0x10'),auth[_0xc75d('0x8')](),controller['destroy']);module[_0xc75d('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 813911d..f1b4ffe 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 _0x04bb=['TEXT','sequelize','exports','STRING'];(function(_0xe9029f,_0x1bdba5){var _0x20f1dd=function(_0x32ee86){while(--_0x32ee86){_0xe9029f['push'](_0xe9029f['shift']());}};_0x20f1dd(++_0x1bdba5);}(_0x04bb,0xd5));var _0xb04b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04bb[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb04b('0x0'));module[_0xb04b('0x1')]={'name':{'type':Sequelize[_0xb04b('0x2')]},'description':{'type':Sequelize[_0xb04b('0x2')]},'html':{'type':Sequelize[_0xb04b('0x3')]}}; \ No newline at end of file +var _0x36ec=['STRING','TEXT','sequelize','exports'];(function(_0x3fb3db,_0x5770a6){var _0x588687=function(_0xe4456d){while(--_0xe4456d){_0x3fb3db['push'](_0x3fb3db['shift']());}};_0x588687(++_0x5770a6);}(_0x36ec,0x6a));var _0xc36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc36e('0x0'));module[_0xc36e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc36e('0x2')]},'html':{'type':Sequelize[_0xc36e('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index d3b795d..b55eb24 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 _0xc88b=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Templates','error','stack','name','index','map','fieldName','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','Template','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x45336e,_0x354104){var _0x343538=function(_0x548560){while(--_0x548560){_0x45336e['push'](_0x45336e['shift']());}};_0x343538(++_0x354104);}(_0xc88b,0x13e));var _0xbc88=function(_0x25db2a,_0x55e2b5){_0x25db2a=_0x25db2a-0x0;var _0x9f2e2c=_0xc88b[_0x25db2a];return _0x9f2e2c;};'use strict';var emlformat=require(_0xbc88('0x0'));var rimraf=require(_0xbc88('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbc88('0x2'));var moment=require(_0xbc88('0x3'));var BPromise=require(_0xbc88('0x4'));var Mustache=require(_0xbc88('0x5'));var util=require('util');var path=require(_0xbc88('0x6'));var sox=require(_0xbc88('0x7'));var csv=require(_0xbc88('0x8'));var ejs=require(_0xbc88('0x9'));var fs=require('fs');var fs_extra=require(_0xbc88('0xa'));var _=require(_0xbc88('0xb'));var squel=require('squel');var crypto=require(_0xbc88('0xc'));var jsforce=require(_0xbc88('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbc88('0x8'));var querystring=require(_0xbc88('0xe'));var Papa=require('papaparse');var Redis=require(_0xbc88('0xf'));var authService=require(_0xbc88('0x10'));var qs=require(_0xbc88('0x11'));var as=require(_0xbc88('0x12'));var hardwareService=require(_0xbc88('0x13'));var logger=require(_0xbc88('0x14'))('api');var utils=require(_0xbc88('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbc88('0x16'))['db'];function respondWithStatusCode(_0xe247ec,_0x398190){_0x398190=_0x398190||0xcc;return function(_0x11985c){if(_0x11985c){return _0xe247ec[_0xbc88('0x17')](_0x398190);}return _0xe247ec[_0xbc88('0x18')](_0x398190)[_0xbc88('0x19')]();};}function respondWithResult(_0x594f03,_0x1462bb){_0x1462bb=_0x1462bb||0xc8;return function(_0x328445){if(_0x328445){return _0x594f03['status'](_0x1462bb)['json'](_0x328445);}};}function respondWithFilteredResult(_0x5b9b73,_0x3a15e8){return function(_0x147139){if(_0x147139){var _0xa46552=typeof _0x3a15e8[_0xbc88('0x1a')]===_0xbc88('0x1b')&&typeof _0x3a15e8[_0xbc88('0x1c')]===_0xbc88('0x1b');var _0x32a5c6=_0x147139[_0xbc88('0x1d')];var _0x4e0249=_0xa46552?0x0:_0x3a15e8[_0xbc88('0x1a')];var _0x14ba3e=_0xa46552?_0x147139[_0xbc88('0x1d')]:_0x3a15e8['offset']+_0x3a15e8['limit'];var _0x30266d;if(_0x14ba3e>=_0x32a5c6){_0x14ba3e=_0x32a5c6;_0x30266d=0xc8;}else{_0x30266d=0xce;}_0x5b9b73[_0xbc88('0x18')](_0x30266d);return _0x5b9b73[_0xbc88('0x1e')](_0xbc88('0x1f'),_0x4e0249+'-'+_0x14ba3e+'/'+_0x32a5c6)[_0xbc88('0x20')](_0x147139);}return null;};}function patchUpdates(_0x652dc0){return function(_0x21cd33){try{jsonpatch[_0xbc88('0x21')](_0x21cd33,_0x652dc0,!![]);}catch(_0xa7d35f){return BPromise[_0xbc88('0x22')](_0xa7d35f);}return _0x21cd33[_0xbc88('0x23')]();};}function saveUpdates(_0x2fb6d5,_0x1e2200){return function(_0x26bb07){if(_0x26bb07){return _0x26bb07[_0xbc88('0x24')](_0x2fb6d5)['then'](function(_0x4f088b){return _0x4f088b;});}return null;};}function removeEntity(_0x27021d,_0x38ccc2){return function(_0x503d28){if(_0x503d28){return _0x503d28[_0xbc88('0x25')]()[_0xbc88('0x26')](function(){var _0x219561=_0x503d28[_0xbc88('0x27')]({'plain':!![]});var _0x13c494=_0xbc88('0x28');return db['UserProfileResource'][_0xbc88('0x25')]({'where':{'type':_0x13c494,'resourceId':_0x219561['id']}})[_0xbc88('0x26')](function(){return _0x503d28;});})[_0xbc88('0x26')](function(){_0x27021d[_0xbc88('0x18')](0xcc)[_0xbc88('0x19')]();});}};}function handleEntityNotFound(_0x4aeae5,_0xc3aa5b){return function(_0x573f2e){if(!_0x573f2e){_0x4aeae5['sendStatus'](0x194);}return _0x573f2e;};}function handleError(_0x3ea511,_0x2dbbbf){_0x2dbbbf=_0x2dbbbf||0x1f4;return function(_0x35b641){logger[_0xbc88('0x29')](_0x35b641[_0xbc88('0x2a')]);if(_0x35b641[_0xbc88('0x2b')]){delete _0x35b641[_0xbc88('0x2b')];}_0x3ea511['status'](_0x2dbbbf)['send'](_0x35b641);};}exports[_0xbc88('0x2c')]=function(_0x53ef14,_0x268d41){var _0x2d767c={},_0x56977f={},_0x53c913={'count':0x0,'rows':[]};var _0x3528a3=_[_0xbc88('0x2d')](db['Template']['rawAttributes'],function(_0xaa416e){return{'name':_0xaa416e[_0xbc88('0x2e')],'type':_0xaa416e['type'][_0xbc88('0x2f')]};});_0x56977f[_0xbc88('0x30')]=_[_0xbc88('0x2d')](_0x3528a3,_0xbc88('0x2b'));_0x56977f['query']=_[_0xbc88('0x31')](_0x53ef14['query']);_0x56977f[_0xbc88('0x32')]=_[_0xbc88('0x33')](_0x56977f[_0xbc88('0x30')],_0x56977f[_0xbc88('0x34')]);_0x2d767c['attributes']=_[_0xbc88('0x33')](_0x56977f[_0xbc88('0x30')],qs[_0xbc88('0x35')](_0x53ef14[_0xbc88('0x34')][_0xbc88('0x35')]));_0x2d767c[_0xbc88('0x36')]=_0x2d767c[_0xbc88('0x36')]['length']?_0x2d767c[_0xbc88('0x36')]:_0x56977f[_0xbc88('0x30')];if(!_0x53ef14[_0xbc88('0x34')][_0xbc88('0x37')]('nolimit')){_0x2d767c['limit']=qs[_0xbc88('0x1c')](_0x53ef14['query'][_0xbc88('0x1c')]);_0x2d767c['offset']=qs[_0xbc88('0x1a')](_0x53ef14[_0xbc88('0x34')]['offset']);}_0x2d767c[_0xbc88('0x38')]=qs[_0xbc88('0x39')](_0x53ef14['query']['sort']);_0x2d767c[_0xbc88('0x3a')]=qs['filters'](_['pick'](_0x53ef14[_0xbc88('0x34')],_0x56977f[_0xbc88('0x32')]),_0x3528a3);if(_0x53ef14[_0xbc88('0x34')][_0xbc88('0x3b')]){_0x2d767c['where']=_[_0xbc88('0x3c')](_0x2d767c['where'],{'$or':_[_0xbc88('0x2d')](_0x3528a3,function(_0x241e6c){if(_0x241e6c[_0xbc88('0x3d')]!==_0xbc88('0x3e')){var _0x510e48={};_0x510e48[_0x241e6c[_0xbc88('0x2b')]]={'$like':'%'+_0x53ef14[_0xbc88('0x34')]['filter']+'%'};return _0x510e48;}})});}_0x2d767c=_['merge']({},_0x2d767c,_0x53ef14[_0xbc88('0x3f')]);var _0xfa343a={'where':_0x2d767c[_0xbc88('0x3a')]};return db[_0xbc88('0x40')]['count'](_0xfa343a)['then'](function(_0x30df45){_0x53c913[_0xbc88('0x1d')]=_0x30df45;if(_0x53ef14['query'][_0xbc88('0x41')]){_0x2d767c['include']=[{'all':!![]}];}return db[_0xbc88('0x40')][_0xbc88('0x42')](_0x2d767c);})[_0xbc88('0x26')](function(_0x5b50bb){_0x53c913[_0xbc88('0x43')]=_0x5b50bb;return _0x53c913;})['then'](respondWithFilteredResult(_0x268d41,_0x2d767c))[_0xbc88('0x44')](handleError(_0x268d41,null));};exports['show']=function(_0x3196d0,_0x10a862){var _0x2be93d={'raw':!![],'where':{'id':_0x3196d0[_0xbc88('0x45')]['id']}},_0x1e303d={};_0x1e303d[_0xbc88('0x30')]=_[_0xbc88('0x31')](db[_0xbc88('0x40')][_0xbc88('0x46')]);_0x1e303d['query']=_[_0xbc88('0x31')](_0x3196d0[_0xbc88('0x34')]);_0x1e303d[_0xbc88('0x32')]=_[_0xbc88('0x33')](_0x1e303d[_0xbc88('0x30')],_0x1e303d[_0xbc88('0x34')]);_0x2be93d['attributes']=_[_0xbc88('0x33')](_0x1e303d['model'],qs['fields'](_0x3196d0[_0xbc88('0x34')]['fields']));_0x2be93d[_0xbc88('0x36')]=_0x2be93d[_0xbc88('0x36')]['length']?_0x2be93d[_0xbc88('0x36')]:_0x1e303d[_0xbc88('0x30')];if(_0x3196d0[_0xbc88('0x34')][_0xbc88('0x41')]){_0x2be93d[_0xbc88('0x47')]=[{'all':!![]}];}_0x2be93d=_[_0xbc88('0x3c')]({},_0x2be93d,_0x3196d0[_0xbc88('0x3f')]);return db['Template'][_0xbc88('0x48')](_0x2be93d)['then'](handleEntityNotFound(_0x10a862,null))[_0xbc88('0x26')](respondWithResult(_0x10a862,null))['catch'](handleError(_0x10a862,null));};exports[_0xbc88('0x49')]=function(_0x3984bb,_0x848a9c){return db[_0xbc88('0x40')][_0xbc88('0x49')](_0x3984bb[_0xbc88('0x4a')],{})['then'](function(_0x49d819){var _0x4d6a60=_0x3984bb['user'][_0xbc88('0x27')]({'plain':!![]});if(!_0x4d6a60)throw new Error(_0xbc88('0x4b'));if(_0x4d6a60[_0xbc88('0x4c')]===_0xbc88('0x4d')){var _0x19b12b=_0x49d819[_0xbc88('0x27')]({'plain':!![]});var _0x401bf3=_0xbc88('0x28');return db[_0xbc88('0x4e')][_0xbc88('0x48')]({'where':{'name':_0x401bf3,'userProfileId':_0x4d6a60[_0xbc88('0x4f')]},'raw':!![]})[_0xbc88('0x26')](function(_0x5b26a2){if(_0x5b26a2&&_0x5b26a2[_0xbc88('0x50')]===0x0){return db[_0xbc88('0x51')][_0xbc88('0x49')]({'name':_0x19b12b[_0xbc88('0x2b')],'resourceId':_0x19b12b['id'],'type':_0x5b26a2[_0xbc88('0x2b')],'sectionId':_0x5b26a2['id']},{})[_0xbc88('0x26')](function(){return _0x49d819;});}else{return _0x49d819;}})[_0xbc88('0x44')](function(_0xda0109){logger['error'](_0xbc88('0x52'),_0xda0109);throw _0xda0109;});}return _0x49d819;})[_0xbc88('0x26')](respondWithResult(_0x848a9c,0xc9))['catch'](handleError(_0x848a9c,null));};exports['update']=function(_0x4bad59,_0x32c192){if(_0x4bad59[_0xbc88('0x4a')]['id']){delete _0x4bad59[_0xbc88('0x4a')]['id'];}return db[_0xbc88('0x40')][_0xbc88('0x48')]({'where':{'id':_0x4bad59['params']['id']}})[_0xbc88('0x26')](handleEntityNotFound(_0x32c192,null))[_0xbc88('0x26')](saveUpdates(_0x4bad59['body'],null))['then'](respondWithResult(_0x32c192,null))[_0xbc88('0x44')](handleError(_0x32c192,null));};exports[_0xbc88('0x25')]=function(_0x424a9e,_0x5bbe4c){return db[_0xbc88('0x40')][_0xbc88('0x48')]({'where':{'id':_0x424a9e[_0xbc88('0x45')]['id']}})[_0xbc88('0x26')](handleEntityNotFound(_0x5bbe4c,null))[_0xbc88('0x26')](removeEntity(_0x5bbe4c,null))[_0xbc88('0x44')](handleError(_0x5bbe4c,null));}; \ No newline at end of file +var _0x7a47=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','Templates','destroy','error','stack','name','send','index','map','Template','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise'];(function(_0x4a8b2d,_0x3611c){var _0xab319e=function(_0x54919c){while(--_0x54919c){_0x4a8b2d['push'](_0x4a8b2d['shift']());}};_0xab319e(++_0x3611c);}(_0x7a47,0x187));var _0x77a4=function(_0x321893,_0x5879e7){_0x321893=_0x321893-0x0;var _0x449ee6=_0x7a47[_0x321893];return _0x449ee6;};'use strict';var emlformat=require(_0x77a4('0x0'));var rimraf=require(_0x77a4('0x1'));var zipdir=require(_0x77a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77a4('0x3'));var moment=require(_0x77a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77a4('0x5'));var util=require(_0x77a4('0x6'));var path=require(_0x77a4('0x7'));var sox=require(_0x77a4('0x8'));var csv=require(_0x77a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77a4('0xa'));var _=require(_0x77a4('0xb'));var squel=require('squel');var crypto=require(_0x77a4('0xc'));var jsforce=require(_0x77a4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x77a4('0x9'));var querystring=require(_0x77a4('0xe'));var Papa=require(_0x77a4('0xf'));var Redis=require('ioredis');var authService=require(_0x77a4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x77a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77a4('0x12'))(_0x77a4('0x13'));var utils=require(_0x77a4('0x14'));var config=require(_0x77a4('0x15'));var licenseUtil=require(_0x77a4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x374be0,_0x22a7ea){_0x22a7ea=_0x22a7ea||0xcc;return function(_0xfb5ddd){if(_0xfb5ddd){return _0x374be0[_0x77a4('0x17')](_0x22a7ea);}return _0x374be0[_0x77a4('0x18')](_0x22a7ea)[_0x77a4('0x19')]();};}function respondWithResult(_0x37b899,_0x33b74e){_0x33b74e=_0x33b74e||0xc8;return function(_0x51a940){if(_0x51a940){return _0x37b899[_0x77a4('0x18')](_0x33b74e)[_0x77a4('0x1a')](_0x51a940);}};}function respondWithFilteredResult(_0x5ff004,_0x56f24b){return function(_0x4fdd1e){if(_0x4fdd1e){var _0x412de2=typeof _0x56f24b[_0x77a4('0x1b')]==='undefined'&&typeof _0x56f24b[_0x77a4('0x1c')]===_0x77a4('0x1d');var _0x368277=_0x4fdd1e['count'];var _0x3a8a85=_0x412de2?0x0:_0x56f24b[_0x77a4('0x1b')];var _0x2fdf30=_0x412de2?_0x4fdd1e[_0x77a4('0x1e')]:_0x56f24b['offset']+_0x56f24b[_0x77a4('0x1c')];var _0x4b795d;if(_0x2fdf30>=_0x368277){_0x2fdf30=_0x368277;_0x4b795d=0xc8;}else{_0x4b795d=0xce;}_0x5ff004[_0x77a4('0x18')](_0x4b795d);return _0x5ff004[_0x77a4('0x1f')](_0x77a4('0x20'),_0x3a8a85+'-'+_0x2fdf30+'/'+_0x368277)[_0x77a4('0x1a')](_0x4fdd1e);}return null;};}function patchUpdates(_0xebf9ac){return function(_0x261e65){try{jsonpatch[_0x77a4('0x21')](_0x261e65,_0xebf9ac,!![]);}catch(_0x3c5d70){return BPromise[_0x77a4('0x22')](_0x3c5d70);}return _0x261e65[_0x77a4('0x23')]();};}function saveUpdates(_0x50cbf0,_0x36a2f2){return function(_0x3cb478){if(_0x3cb478){return _0x3cb478[_0x77a4('0x24')](_0x50cbf0)[_0x77a4('0x25')](function(_0x69de35){return _0x69de35;});}return null;};}function removeEntity(_0x161dfc,_0x5c3e15){return function(_0x3a1622){if(_0x3a1622){return _0x3a1622['destroy']()[_0x77a4('0x25')](function(){var _0x4ecc6c=_0x3a1622['get']({'plain':!![]});var _0x3f4c95=_0x77a4('0x26');return db['UserProfileResource'][_0x77a4('0x27')]({'where':{'type':_0x3f4c95,'resourceId':_0x4ecc6c['id']}})[_0x77a4('0x25')](function(){return _0x3a1622;});})[_0x77a4('0x25')](function(){_0x161dfc['status'](0xcc)[_0x77a4('0x19')]();});}};}function handleEntityNotFound(_0x3b9d3d,_0x3efe8a){return function(_0x33745f){if(!_0x33745f){_0x3b9d3d[_0x77a4('0x17')](0x194);}return _0x33745f;};}function handleError(_0x13c01d,_0x2ada5e){_0x2ada5e=_0x2ada5e||0x1f4;return function(_0xd8b1cb){logger[_0x77a4('0x28')](_0xd8b1cb[_0x77a4('0x29')]);if(_0xd8b1cb['name']){delete _0xd8b1cb[_0x77a4('0x2a')];}_0x13c01d[_0x77a4('0x18')](_0x2ada5e)[_0x77a4('0x2b')](_0xd8b1cb);};}exports[_0x77a4('0x2c')]=function(_0x1fd217,_0x5d2e0b){var _0x538da4={},_0x36b93f={},_0x581a0a={'count':0x0,'rows':[]};var _0x423b6c=_[_0x77a4('0x2d')](db[_0x77a4('0x2e')][_0x77a4('0x2f')],function(_0x4c7f86){return{'name':_0x4c7f86['fieldName'],'type':_0x4c7f86[_0x77a4('0x30')][_0x77a4('0x31')]};});_0x36b93f[_0x77a4('0x32')]=_['map'](_0x423b6c,'name');_0x36b93f['query']=_[_0x77a4('0x33')](_0x1fd217[_0x77a4('0x34')]);_0x36b93f[_0x77a4('0x35')]=_['intersection'](_0x36b93f['model'],_0x36b93f[_0x77a4('0x34')]);_0x538da4['attributes']=_[_0x77a4('0x36')](_0x36b93f[_0x77a4('0x32')],qs['fields'](_0x1fd217[_0x77a4('0x34')][_0x77a4('0x37')]));_0x538da4[_0x77a4('0x38')]=_0x538da4[_0x77a4('0x38')][_0x77a4('0x39')]?_0x538da4[_0x77a4('0x38')]:_0x36b93f[_0x77a4('0x32')];if(!_0x1fd217[_0x77a4('0x34')]['hasOwnProperty'](_0x77a4('0x3a'))){_0x538da4[_0x77a4('0x1c')]=qs['limit'](_0x1fd217[_0x77a4('0x34')][_0x77a4('0x1c')]);_0x538da4[_0x77a4('0x1b')]=qs[_0x77a4('0x1b')](_0x1fd217[_0x77a4('0x34')]['offset']);}_0x538da4[_0x77a4('0x3b')]=qs[_0x77a4('0x3c')](_0x1fd217[_0x77a4('0x34')][_0x77a4('0x3c')]);_0x538da4[_0x77a4('0x3d')]=qs[_0x77a4('0x35')](_['pick'](_0x1fd217[_0x77a4('0x34')],_0x36b93f[_0x77a4('0x35')]),_0x423b6c);if(_0x1fd217[_0x77a4('0x34')]['filter']){_0x538da4[_0x77a4('0x3d')]=_['merge'](_0x538da4[_0x77a4('0x3d')],{'$or':_[_0x77a4('0x2d')](_0x423b6c,function(_0xe78e13){if(_0xe78e13[_0x77a4('0x30')]!=='VIRTUAL'){var _0x17c72f={};_0x17c72f[_0xe78e13['name']]={'$like':'%'+_0x1fd217['query'][_0x77a4('0x3e')]+'%'};return _0x17c72f;}})});}_0x538da4=_[_0x77a4('0x3f')]({},_0x538da4,_0x1fd217[_0x77a4('0x40')]);var _0xbe2a45={'where':_0x538da4[_0x77a4('0x3d')]};return db['Template'][_0x77a4('0x1e')](_0xbe2a45)['then'](function(_0x578f7e){_0x581a0a[_0x77a4('0x1e')]=_0x578f7e;if(_0x1fd217[_0x77a4('0x34')][_0x77a4('0x41')]){_0x538da4['include']=[{'all':!![]}];}return db['Template'][_0x77a4('0x42')](_0x538da4);})[_0x77a4('0x25')](function(_0x11b646){_0x581a0a[_0x77a4('0x43')]=_0x11b646;return _0x581a0a;})[_0x77a4('0x25')](respondWithFilteredResult(_0x5d2e0b,_0x538da4))['catch'](handleError(_0x5d2e0b,null));};exports[_0x77a4('0x44')]=function(_0x5cfc6a,_0x1acb36){var _0x2344ea={'raw':!![],'where':{'id':_0x5cfc6a['params']['id']}},_0x1e262b={};_0x1e262b[_0x77a4('0x32')]=_[_0x77a4('0x33')](db[_0x77a4('0x2e')][_0x77a4('0x2f')]);_0x1e262b[_0x77a4('0x34')]=_[_0x77a4('0x33')](_0x5cfc6a[_0x77a4('0x34')]);_0x1e262b[_0x77a4('0x35')]=_[_0x77a4('0x36')](_0x1e262b[_0x77a4('0x32')],_0x1e262b[_0x77a4('0x34')]);_0x2344ea['attributes']=_[_0x77a4('0x36')](_0x1e262b['model'],qs[_0x77a4('0x37')](_0x5cfc6a[_0x77a4('0x34')][_0x77a4('0x37')]));_0x2344ea[_0x77a4('0x38')]=_0x2344ea[_0x77a4('0x38')][_0x77a4('0x39')]?_0x2344ea[_0x77a4('0x38')]:_0x1e262b[_0x77a4('0x32')];if(_0x5cfc6a['query'][_0x77a4('0x41')]){_0x2344ea['include']=[{'all':!![]}];}_0x2344ea=_[_0x77a4('0x3f')]({},_0x2344ea,_0x5cfc6a[_0x77a4('0x40')]);return db[_0x77a4('0x2e')][_0x77a4('0x45')](_0x2344ea)[_0x77a4('0x25')](handleEntityNotFound(_0x1acb36,null))['then'](respondWithResult(_0x1acb36,null))[_0x77a4('0x46')](handleError(_0x1acb36,null));};exports[_0x77a4('0x47')]=function(_0x2d1979,_0x16cffd){return db[_0x77a4('0x2e')][_0x77a4('0x47')](_0x2d1979[_0x77a4('0x48')],{})[_0x77a4('0x25')](function(_0x3ab6ce){var _0x2fb284=_0x2d1979['user'][_0x77a4('0x49')]({'plain':!![]});if(!_0x2fb284)throw new Error(_0x77a4('0x4a'));if(_0x2fb284[_0x77a4('0x4b')]==='user'){var _0x1ebc50=_0x3ab6ce[_0x77a4('0x49')]({'plain':!![]});var _0x42c7a4=_0x77a4('0x26');return db['UserProfileSection'][_0x77a4('0x45')]({'where':{'name':_0x42c7a4,'userProfileId':_0x2fb284['userProfileId']},'raw':!![]})['then'](function(_0x3f9f48){if(_0x3f9f48&&_0x3f9f48[_0x77a4('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x1ebc50[_0x77a4('0x2a')],'resourceId':_0x1ebc50['id'],'type':_0x3f9f48['name'],'sectionId':_0x3f9f48['id']},{})['then'](function(){return _0x3ab6ce;});}else{return _0x3ab6ce;}})[_0x77a4('0x46')](function(_0x5ad51a){logger['error'](_0x77a4('0x4d'),_0x5ad51a);throw _0x5ad51a;});}return _0x3ab6ce;})['then'](respondWithResult(_0x16cffd,0xc9))[_0x77a4('0x46')](handleError(_0x16cffd,null));};exports[_0x77a4('0x24')]=function(_0x2de6a2,_0x4d4e77){if(_0x2de6a2[_0x77a4('0x48')]['id']){delete _0x2de6a2[_0x77a4('0x48')]['id'];}return db['Template'][_0x77a4('0x45')]({'where':{'id':_0x2de6a2['params']['id']}})[_0x77a4('0x25')](handleEntityNotFound(_0x4d4e77,null))[_0x77a4('0x25')](saveUpdates(_0x2de6a2[_0x77a4('0x48')],null))[_0x77a4('0x25')](respondWithResult(_0x4d4e77,null))['catch'](handleError(_0x4d4e77,null));};exports[_0x77a4('0x27')]=function(_0x50dbac,_0x1c037c){return db[_0x77a4('0x2e')][_0x77a4('0x45')]({'where':{'id':_0x50dbac[_0x77a4('0x4e')]['id']}})[_0x77a4('0x25')](handleEntityNotFound(_0x1c037c,null))[_0x77a4('0x25')](removeEntity(_0x1c037c,null))[_0x77a4('0x46')](handleError(_0x1c037c,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 078a25c..056a925 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 _0x6200=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash'];(function(_0x4f067e,_0x406536){var _0x3930d1=function(_0x326249){while(--_0x326249){_0x4f067e['push'](_0x4f067e['shift']());}};_0x3930d1(++_0x406536);}(_0x6200,0x144));var _0x0620=function(_0x337eeb,_0x4f17e9){_0x337eeb=_0x337eeb-0x0;var _0x2dfdd8=_0x6200[_0x337eeb];return _0x2dfdd8;};'use strict';var _=require(_0x0620('0x0'));var util=require('util');var logger=require(_0x0620('0x1'))(_0x0620('0x2'));var moment=require(_0x0620('0x3'));var BPromise=require(_0x0620('0x4'));var rp=require(_0x0620('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0620('0x6'));var config=require(_0x0620('0x7'));var attributes=require(_0x0620('0x8'));module[_0x0620('0x9')]=function(_0x1a7967,_0xcae4d6){return _0x1a7967[_0x0620('0xa')](_0x0620('0xb'),attributes,{'tableName':_0x0620('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b34=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','Template','lodash','util','../../config/logger'];(function(_0x489ce5,_0x431c16){var _0x413132=function(_0x4039b8){while(--_0x4039b8){_0x489ce5['push'](_0x489ce5['shift']());}};_0x413132(++_0x431c16);}(_0x4b34,0x1a1));var _0x44b3=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x4b34[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0x44b3('0x0'));var util=require(_0x44b3('0x1'));var logger=require(_0x44b3('0x2'))(_0x44b3('0x3'));var moment=require(_0x44b3('0x4'));var BPromise=require(_0x44b3('0x5'));var rp=require(_0x44b3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44b3('0x7'));var config=require(_0x44b3('0x8'));var attributes=require(_0x44b3('0x9'));module[_0x44b3('0xa')]=function(_0x4d943e,_0x2b5dc3){return _0x4d943e['define'](_0x44b3('0xb'),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 5e3aaab..57df37f 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 _0x9742=['request','then','info','Template,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','options','raw','attributes','limit','include','model','map','util','moment','bluebird','randomstring','ioredis','rpc','client','http'];(function(_0x39e4a1,_0x4edcc5){var _0x55b30e=function(_0x5efd8e){while(--_0x5efd8e){_0x39e4a1['push'](_0x39e4a1['shift']());}};_0x55b30e(++_0x4edcc5);}(_0x9742,0x19c));var _0x2974=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9742[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x2974('0x0'));var moment=require(_0x2974('0x1'));var BPromise=require(_0x2974('0x2'));var rs=require(_0x2974('0x3'));var fs=require('fs');var Redis=require(_0x2974('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2974('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2974('0x6')][_0x2974('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x267d3e,_0x54e7ba,_0xc23af9){return new BPromise(function(_0x36f91a,_0x2d9db4){return client[_0x2974('0x8')](_0x267d3e,_0xc23af9)[_0x2974('0x9')](function(_0x9b092d){logger[_0x2974('0xa')](_0x2974('0xb'),_0x54e7ba,'request\x20sent');logger[_0x2974('0xc')]('Template,\x20%s,\x20%s,\x20%s',_0x54e7ba,_0x2974('0xd'),JSON[_0x2974('0xe')](_0x9b092d));if(_0x9b092d[_0x2974('0xf')]){if(_0x9b092d[_0x2974('0xf')][_0x2974('0x10')]===0x1f4){logger[_0x2974('0xf')](_0x2974('0xb'),_0x54e7ba,_0x9b092d[_0x2974('0xf')][_0x2974('0x11')]);return _0x2d9db4(_0x9b092d[_0x2974('0xf')][_0x2974('0x11')]);}logger[_0x2974('0xf')](_0x2974('0xb'),_0x54e7ba,_0x9b092d[_0x2974('0xf')][_0x2974('0x11')]);return _0x36f91a(_0x9b092d[_0x2974('0xf')]['message']);}else{logger[_0x2974('0xa')](_0x2974('0xb'),_0x54e7ba,_0x2974('0xd'));_0x36f91a(_0x9b092d[_0x2974('0x12')][_0x2974('0x11')]);}})[_0x2974('0x13')](function(_0x15cb5d){logger[_0x2974('0xf')]('Template,\x20%s,\x20%s',_0x54e7ba,_0x15cb5d);_0x2d9db4(_0x15cb5d);});});}exports[_0x2974('0x14')]=function(_0x503ed){var _0x3e5d42=this;return new Promise(function(_0x232e62,_0x3f2ebb){return db['Template']['findAll']({'raw':_0x503ed[_0x2974('0x15')]?_0x503ed['options'][_0x2974('0x16')]===undefined?!![]:![]:!![],'where':_0x503ed[_0x2974('0x15')]?_0x503ed[_0x2974('0x15')]['where']||null:null,'attributes':_0x503ed['options']?_0x503ed[_0x2974('0x15')][_0x2974('0x17')]||null:null,'limit':_0x503ed[_0x2974('0x15')]?_0x503ed[_0x2974('0x15')][_0x2974('0x18')]||null:null,'include':_0x503ed['options']?_0x503ed['options']['include']?_['map'](_0x503ed[_0x2974('0x15')][_0x2974('0x19')],function(_0x20c91f){return{'model':db[_0x20c91f[_0x2974('0x1a')]],'as':_0x20c91f['as'],'attributes':_0x20c91f[_0x2974('0x17')],'include':_0x20c91f[_0x2974('0x19')]?_[_0x2974('0x1b')](_0x20c91f['include'],function(_0x2d4d68){return{'model':db[_0x2d4d68['model']],'as':_0x2d4d68['as'],'attributes':_0x2d4d68[_0x2974('0x17')],'include':_0x2d4d68[_0x2974('0x19')]?_[_0x2974('0x1b')](_0x2d4d68[_0x2974('0x19')],function(_0x58e102){return{'model':db[_0x58e102[_0x2974('0x1a')]],'as':_0x58e102['as'],'attributes':_0x58e102[_0x2974('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2974('0x9')](function(_0x522043){logger[_0x2974('0xa')]('GetTemplate',_0x503ed);logger[_0x2974('0xc')](_0x2974('0x14'),_0x503ed,JSON[_0x2974('0xe')](_0x522043));_0x232e62(_0x522043);})['catch'](function(_0x1d1af2){logger[_0x2974('0xf')](_0x2974('0x14'),_0x1d1af2['message'],_0x503ed);_0x3f2ebb(_0x3e5d42['error'](0x1f4,_0x1d1af2['message']));});});}; \ No newline at end of file +var _0xa606=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','Template','findAll','options','raw','where','attributes','limit','include','map','model','GetTemplate','lodash','util','moment','bluebird','randomstring'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xa606,0x10b));var _0x6a60=function(_0xb5e0ac,_0x154af3){_0xb5e0ac=_0xb5e0ac-0x0;var _0x484999=_0xa606[_0xb5e0ac];return _0x484999;};'use strict';var _=require(_0x6a60('0x0'));var util=require(_0x6a60('0x1'));var moment=require(_0x6a60('0x2'));var BPromise=require(_0x6a60('0x3'));var rs=require(_0x6a60('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a60('0x5'))['db'];var utils=require(_0x6a60('0x6'));var logger=require(_0x6a60('0x7'))(_0x6a60('0x8'));var config=require(_0x6a60('0x9'));var jayson=require(_0x6a60('0xa'));var client=jayson[_0x6a60('0xb')][_0x6a60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d7cc3,_0x5d8a33,_0x460d32){return new BPromise(function(_0x4fa8a8,_0x24a21a){return client['request'](_0x3d7cc3,_0x460d32)[_0x6a60('0xd')](function(_0x2ba759){logger[_0x6a60('0xe')](_0x6a60('0xf'),_0x5d8a33,'request\x20sent');logger[_0x6a60('0x10')](_0x6a60('0x11'),_0x5d8a33,_0x6a60('0x12'),JSON[_0x6a60('0x13')](_0x2ba759));if(_0x2ba759[_0x6a60('0x14')]){if(_0x2ba759['error']['code']===0x1f4){logger[_0x6a60('0x14')](_0x6a60('0xf'),_0x5d8a33,_0x2ba759['error']['message']);return _0x24a21a(_0x2ba759['error'][_0x6a60('0x15')]);}logger['error']('Template,\x20%s,\x20%s',_0x5d8a33,_0x2ba759[_0x6a60('0x14')][_0x6a60('0x15')]);return _0x4fa8a8(_0x2ba759[_0x6a60('0x14')][_0x6a60('0x15')]);}else{logger[_0x6a60('0xe')](_0x6a60('0xf'),_0x5d8a33,_0x6a60('0x12'));_0x4fa8a8(_0x2ba759['result'][_0x6a60('0x15')]);}})[_0x6a60('0x16')](function(_0x1b6660){logger['error']('Template,\x20%s,\x20%s',_0x5d8a33,_0x1b6660);_0x24a21a(_0x1b6660);});});}exports['GetTemplate']=function(_0x2b4db4){var _0x84fba4=this;return new Promise(function(_0x3b9187,_0x2fc2b1){return db[_0x6a60('0x17')][_0x6a60('0x18')]({'raw':_0x2b4db4[_0x6a60('0x19')]?_0x2b4db4[_0x6a60('0x19')][_0x6a60('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b4db4[_0x6a60('0x19')]?_0x2b4db4[_0x6a60('0x19')][_0x6a60('0x1b')]||null:null,'attributes':_0x2b4db4[_0x6a60('0x19')]?_0x2b4db4[_0x6a60('0x19')][_0x6a60('0x1c')]||null:null,'limit':_0x2b4db4[_0x6a60('0x19')]?_0x2b4db4[_0x6a60('0x19')][_0x6a60('0x1d')]||null:null,'include':_0x2b4db4[_0x6a60('0x19')]?_0x2b4db4[_0x6a60('0x19')][_0x6a60('0x1e')]?_[_0x6a60('0x1f')](_0x2b4db4[_0x6a60('0x19')][_0x6a60('0x1e')],function(_0xce8af9){return{'model':db[_0xce8af9[_0x6a60('0x20')]],'as':_0xce8af9['as'],'attributes':_0xce8af9[_0x6a60('0x1c')],'include':_0xce8af9[_0x6a60('0x1e')]?_['map'](_0xce8af9['include'],function(_0x3d60c2){return{'model':db[_0x3d60c2['model']],'as':_0x3d60c2['as'],'attributes':_0x3d60c2[_0x6a60('0x1c')],'include':_0x3d60c2[_0x6a60('0x1e')]?_['map'](_0x3d60c2['include'],function(_0x16725e){return{'model':db[_0x16725e[_0x6a60('0x20')]],'as':_0x16725e['as'],'attributes':_0x16725e[_0x6a60('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6a60('0xd')](function(_0x553d49){logger['info'](_0x6a60('0x21'),_0x2b4db4);logger['debug'](_0x6a60('0x21'),_0x2b4db4,JSON[_0x6a60('0x13')](_0x553d49));_0x3b9187(_0x553d49);})['catch'](function(_0x3e2648){logger['error']('GetTemplate',_0x3e2648[_0x6a60('0x15')],_0x2b4db4);_0x2fc2b1(_0x84fba4[_0x6a60('0x14')](0x1f4,_0x3e2648[_0x6a60('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 396eb00..9bfcc20 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 _0x3a5c=['destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','addAllCondition','addAction','put','delete'];(function(_0x310366,_0x5264cf){var _0x132bbc=function(_0x122d53){while(--_0x122d53){_0x310366['push'](_0x310366['shift']());}};_0x132bbc(++_0x5264cf);}(_0x3a5c,0x166));var _0xc3a5=function(_0xec612b,_0x2ee4eb){_0xec612b=_0xec612b-0x0;var _0x59e2a7=_0x3a5c[_0xec612b];return _0x59e2a7;};'use strict';var multer=require(_0xc3a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc3a5('0x1'));var router=express[_0xc3a5('0x2')]();var fs_extra=require(_0xc3a5('0x3'));var auth=require(_0xc3a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc3a5('0x5'));var controller=require('./trigger.controller');router[_0xc3a5('0x6')]('/',auth[_0xc3a5('0x7')](),controller[_0xc3a5('0x8')]);router[_0xc3a5('0x6')](_0xc3a5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xc3a5('0x6')](_0xc3a5('0xa'),auth[_0xc3a5('0x7')](),controller[_0xc3a5('0xb')]);router[_0xc3a5('0x6')](_0xc3a5('0xc'),auth[_0xc3a5('0x7')](),controller[_0xc3a5('0xd')]);router['get'](_0xc3a5('0xe'),auth[_0xc3a5('0x7')](),controller['getActions']);router[_0xc3a5('0xf')]('/',auth[_0xc3a5('0x7')](),controller['create']);router[_0xc3a5('0xf')](_0xc3a5('0xa'),auth[_0xc3a5('0x7')](),controller[_0xc3a5('0x10')]);router[_0xc3a5('0xf')](_0xc3a5('0xc'),auth[_0xc3a5('0x7')](),controller['addAnyCondition']);router[_0xc3a5('0xf')](_0xc3a5('0xe'),auth[_0xc3a5('0x7')](),controller[_0xc3a5('0x11')]);router[_0xc3a5('0x12')](_0xc3a5('0x9'),auth[_0xc3a5('0x7')](),controller['update']);router[_0xc3a5('0x13')](_0xc3a5('0x9'),auth['isAuthenticated'](),controller[_0xc3a5('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb033=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','addAllCondition','post','addAction','update','destroy','exports','multer','util','path'];(function(_0x2be23f,_0x4bd597){var _0x21c6c0=function(_0x5f368d){while(--_0x5f368d){_0x2be23f['push'](_0x2be23f['shift']());}};_0x21c6c0(++_0x4bd597);}(_0xb033,0x9f));var _0x3b03=function(_0x472b01,_0x456426){_0x472b01=_0x472b01-0x0;var _0x574b4e=_0xb033[_0x472b01];return _0x574b4e;};'use strict';var multer=require(_0x3b03('0x0'));var util=require(_0x3b03('0x1'));var path=require(_0x3b03('0x2'));var timeout=require(_0x3b03('0x3'));var express=require(_0x3b03('0x4'));var router=express[_0x3b03('0x5')]();var fs_extra=require(_0x3b03('0x6'));var auth=require(_0x3b03('0x7'));var interaction=require(_0x3b03('0x8'));var config=require(_0x3b03('0x9'));var controller=require(_0x3b03('0xa'));router[_0x3b03('0xb')]('/',auth[_0x3b03('0xc')](),controller['index']);router[_0x3b03('0xb')](_0x3b03('0xd'),auth['isAuthenticated'](),controller[_0x3b03('0xe')]);router['get'](_0x3b03('0xf'),auth[_0x3b03('0xc')](),controller[_0x3b03('0x10')]);router[_0x3b03('0xb')](_0x3b03('0x11'),auth['isAuthenticated'](),controller[_0x3b03('0x12')]);router[_0x3b03('0xb')]('/:id/actions',auth['isAuthenticated'](),controller[_0x3b03('0x13')]);router['post']('/',auth[_0x3b03('0xc')](),controller[_0x3b03('0x14')]);router['post'](_0x3b03('0xf'),auth[_0x3b03('0xc')](),controller[_0x3b03('0x15')]);router[_0x3b03('0x16')]('/:id/any_conditions',auth[_0x3b03('0xc')](),controller['addAnyCondition']);router['post']('/:id/actions',auth[_0x3b03('0xc')](),controller[_0x3b03('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3b03('0x18')]);router['delete'](_0x3b03('0xd'),auth[_0x3b03('0xc')](),controller[_0x3b03('0x19')]);module[_0x3b03('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d2db194..d0b2950 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 _0x9ef8=['exports','STRING','BOOLEAN'];(function(_0x41d2ae,_0x14b7bb){var _0x3669a5=function(_0x103ab2){while(--_0x103ab2){_0x41d2ae['push'](_0x41d2ae['shift']());}};_0x3669a5(++_0x14b7bb);}(_0x9ef8,0x90));var _0x89ef=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0x9ef8[_0x403f5f];return _0x15b1cd;};'use strict';var Sequelize=require('sequelize');module[_0x89ef('0x0')]={'name':{'type':Sequelize[_0x89ef('0x1')]},'channel':{'type':Sequelize[_0x89ef('0x1')]},'description':{'type':Sequelize[_0x89ef('0x1')]},'status':{'type':Sequelize[_0x89ef('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xcc0e=['STRING','BOOLEAN','sequelize'];(function(_0x1e9287,_0x37f584){var _0x44342e=function(_0x2f559e){while(--_0x2f559e){_0x1e9287['push'](_0x1e9287['shift']());}};_0x44342e(++_0x37f584);}(_0xcc0e,0x8c));var _0xecc0=function(_0xcc7dea,_0x34e771){_0xcc7dea=_0xcc7dea-0x0;var _0x3a8415=_0xcc0e[_0xcc7dea];return _0x3a8415;};'use strict';var Sequelize=require(_0xecc0('0x0'));module['exports']={'name':{'type':Sequelize[_0xecc0('0x1')]},'channel':{'type':Sequelize[_0xecc0('0x1')]},'description':{'type':Sequelize[_0xecc0('0x1')]},'status':{'type':Sequelize[_0xecc0('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 936eea8..09e3b28 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 _0xe03a=['length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','catch','show','params','keys','includeAll','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','TriggerAnyId','findOne','getAllConditions','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','Triggers','sendStatus','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields'];(function(_0xd42933,_0x42dc08){var _0xd7cfba=function(_0x568b33){while(--_0x568b33){_0xd42933['push'](_0xd42933['shift']());}};_0xd7cfba(++_0x42dc08);}(_0xe03a,0xe0));var _0xae03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe03a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xae03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae03('0x1'));var jsonpatch=require(_0xae03('0x2'));var rp=require('request-promise');var moment=require(_0xae03('0x3'));var BPromise=require(_0xae03('0x4'));var Mustache=require(_0xae03('0x5'));var util=require(_0xae03('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xae03('0x7'));var ejs=require(_0xae03('0x8'));var fs=require('fs');var fs_extra=require(_0xae03('0x9'));var _=require(_0xae03('0xa'));var squel=require(_0xae03('0xb'));var crypto=require(_0xae03('0xc'));var jsforce=require(_0xae03('0xd'));var deskjs=require(_0xae03('0xe'));var toCsv=require(_0xae03('0x7'));var querystring=require(_0xae03('0xf'));var Papa=require(_0xae03('0x10'));var Redis=require('ioredis');var authService=require(_0xae03('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xae03('0x12'));var hardwareService=require(_0xae03('0x13'));var logger=require('../../config/logger')(_0xae03('0x14'));var utils=require(_0xae03('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xae03('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c1c4e,_0x59664e){_0x59664e=_0x59664e||0xcc;return function(_0x3351ab){if(_0x3351ab){return _0x1c1c4e['sendStatus'](_0x59664e);}return _0x1c1c4e['status'](_0x59664e)[_0xae03('0x17')]();};}function respondWithResult(_0xeb1df,_0x296e9e){_0x296e9e=_0x296e9e||0xc8;return function(_0x2e73e0){if(_0x2e73e0){return _0xeb1df[_0xae03('0x18')](_0x296e9e)[_0xae03('0x19')](_0x2e73e0);}};}function respondWithFilteredResult(_0x5e6c1d,_0x11f641){return function(_0x3a5865){if(_0x3a5865){var _0x44bfae=typeof _0x11f641['offset']===_0xae03('0x1a')&&typeof _0x11f641[_0xae03('0x1b')]===_0xae03('0x1a');var _0x456088=_0x3a5865[_0xae03('0x1c')];var _0x3ef404=_0x44bfae?0x0:_0x11f641['offset'];var _0x23e22e=_0x44bfae?_0x3a5865[_0xae03('0x1c')]:_0x11f641[_0xae03('0x1d')]+_0x11f641[_0xae03('0x1b')];var _0x3b29cf;if(_0x23e22e>=_0x456088){_0x23e22e=_0x456088;_0x3b29cf=0xc8;}else{_0x3b29cf=0xce;}_0x5e6c1d[_0xae03('0x18')](_0x3b29cf);return _0x5e6c1d[_0xae03('0x1e')](_0xae03('0x1f'),_0x3ef404+'-'+_0x23e22e+'/'+_0x456088)[_0xae03('0x19')](_0x3a5865);}return null;};}function patchUpdates(_0x17baf4){return function(_0x560454){try{jsonpatch[_0xae03('0x20')](_0x560454,_0x17baf4,!![]);}catch(_0x4ccb2b){return BPromise['reject'](_0x4ccb2b);}return _0x560454[_0xae03('0x21')]();};}function saveUpdates(_0x356bba,_0x7fba76){return function(_0x5b9e9d){if(_0x5b9e9d){return _0x5b9e9d[_0xae03('0x22')](_0x356bba)[_0xae03('0x23')](function(_0x38589c){return _0x38589c;});}return null;};}function removeEntity(_0x425454,_0x3d4be3){return function(_0x2236d3){if(_0x2236d3){return _0x2236d3[_0xae03('0x24')]()[_0xae03('0x23')](function(){var _0x31017a=_0x2236d3['get']({'plain':!![]});var _0x189575=_0xae03('0x25');return db['UserProfileResource'][_0xae03('0x24')]({'where':{'type':_0x189575,'resourceId':_0x31017a['id']}})[_0xae03('0x23')](function(){return _0x2236d3;});})[_0xae03('0x23')](function(){_0x425454[_0xae03('0x18')](0xcc)[_0xae03('0x17')]();});}};}function handleEntityNotFound(_0x315b7f,_0x62da67){return function(_0x1425d6){if(!_0x1425d6){_0x315b7f[_0xae03('0x26')](0x194);}return _0x1425d6;};}function handleError(_0x1de9a8,_0x19ff52){_0x19ff52=_0x19ff52||0x1f4;return function(_0x3786f5){logger['error'](_0x3786f5[_0xae03('0x27')]);if(_0x3786f5[_0xae03('0x28')]){delete _0x3786f5[_0xae03('0x28')];}_0x1de9a8[_0xae03('0x18')](_0x19ff52)[_0xae03('0x29')](_0x3786f5);};}exports[_0xae03('0x2a')]=function(_0x43d0f9,_0x21e75c){var _0x11f60a={},_0x13ae62={},_0x5488f3={'count':0x0,'rows':[]};var _0x4727df=_[_0xae03('0x2b')](db[_0xae03('0x2c')][_0xae03('0x2d')],function(_0x41d56d){return{'name':_0x41d56d[_0xae03('0x2e')],'type':_0x41d56d[_0xae03('0x2f')][_0xae03('0x30')]};});_0x13ae62[_0xae03('0x31')]=_[_0xae03('0x2b')](_0x4727df,_0xae03('0x28'));_0x13ae62['query']=_['keys'](_0x43d0f9['query']);_0x13ae62[_0xae03('0x32')]=_[_0xae03('0x33')](_0x13ae62[_0xae03('0x31')],_0x13ae62[_0xae03('0x34')]);_0x11f60a[_0xae03('0x35')]=_['intersection'](_0x13ae62['model'],qs[_0xae03('0x36')](_0x43d0f9[_0xae03('0x34')][_0xae03('0x36')]));_0x11f60a[_0xae03('0x35')]=_0x11f60a[_0xae03('0x35')][_0xae03('0x37')]?_0x11f60a['attributes']:_0x13ae62['model'];if(!_0x43d0f9[_0xae03('0x34')]['hasOwnProperty'](_0xae03('0x38'))){_0x11f60a[_0xae03('0x1b')]=qs[_0xae03('0x1b')](_0x43d0f9[_0xae03('0x34')]['limit']);_0x11f60a[_0xae03('0x1d')]=qs[_0xae03('0x1d')](_0x43d0f9['query'][_0xae03('0x1d')]);}_0x11f60a[_0xae03('0x39')]=qs[_0xae03('0x3a')](_0x43d0f9['query'][_0xae03('0x3a')]);_0x11f60a[_0xae03('0x3b')]=qs[_0xae03('0x32')](_[_0xae03('0x3c')](_0x43d0f9[_0xae03('0x34')],_0x13ae62['filters']),_0x4727df);if(_0x43d0f9[_0xae03('0x34')][_0xae03('0x3d')]){_0x11f60a[_0xae03('0x3b')]=_['merge'](_0x11f60a[_0xae03('0x3b')],{'$or':_[_0xae03('0x2b')](_0x4727df,function(_0x3a85a1){if(_0x3a85a1[_0xae03('0x2f')]!==_0xae03('0x3e')){var _0x3b9dd4={};_0x3b9dd4[_0x3a85a1[_0xae03('0x28')]]={'$like':'%'+_0x43d0f9[_0xae03('0x34')][_0xae03('0x3d')]+'%'};return _0x3b9dd4;}})});}_0x11f60a=_['merge']({},_0x11f60a,_0x43d0f9[_0xae03('0x3f')]);var _0x4d0721={'where':_0x11f60a['where']};return db['Trigger'][_0xae03('0x1c')](_0x4d0721)[_0xae03('0x23')](function(_0x20cd9c){_0x5488f3[_0xae03('0x1c')]=_0x20cd9c;if(_0x43d0f9[_0xae03('0x34')]['includeAll']){_0x11f60a[_0xae03('0x40')]=[{'all':!![]}];}return db[_0xae03('0x2c')]['findAll'](_0x11f60a);})['then'](function(_0x8321b2){_0x5488f3['rows']=_0x8321b2;return _0x5488f3;})['then'](respondWithFilteredResult(_0x21e75c,_0x11f60a))[_0xae03('0x41')](handleError(_0x21e75c,null));};exports[_0xae03('0x42')]=function(_0x4c52ee,_0x515190){var _0x4f23cb={'raw':![],'where':{'id':_0x4c52ee[_0xae03('0x43')]['id']}},_0x4d6766={};_0x4d6766['model']=_[_0xae03('0x44')](db['Trigger']['rawAttributes']);_0x4d6766[_0xae03('0x34')]=_[_0xae03('0x44')](_0x4c52ee[_0xae03('0x34')]);_0x4d6766[_0xae03('0x32')]=_['intersection'](_0x4d6766[_0xae03('0x31')],_0x4d6766[_0xae03('0x34')]);_0x4f23cb[_0xae03('0x35')]=_[_0xae03('0x33')](_0x4d6766[_0xae03('0x31')],qs[_0xae03('0x36')](_0x4c52ee[_0xae03('0x34')]['fields']));_0x4f23cb['attributes']=_0x4f23cb[_0xae03('0x35')]['length']?_0x4f23cb[_0xae03('0x35')]:_0x4d6766[_0xae03('0x31')];if(_0x4c52ee['query'][_0xae03('0x45')]){_0x4f23cb[_0xae03('0x40')]=[{'all':!![]}];}_0x4f23cb=_[_0xae03('0x46')]({},_0x4f23cb,_0x4c52ee[_0xae03('0x3f')]);return db[_0xae03('0x2c')][_0xae03('0x47')](_0x4f23cb)['then'](handleEntityNotFound(_0x515190,null))['then'](respondWithResult(_0x515190,null))[_0xae03('0x41')](handleError(_0x515190,null));};exports[_0xae03('0x48')]=function(_0x3cdba6,_0x16e90e){return db[_0xae03('0x2c')][_0xae03('0x48')](_0x3cdba6[_0xae03('0x49')],{})[_0xae03('0x23')](function(_0x129e42){var _0x573d47=_0x3cdba6[_0xae03('0x4a')][_0xae03('0x4b')]({'plain':!![]});if(!_0x573d47)throw new Error(_0xae03('0x4c'));if(_0x573d47[_0xae03('0x4d')]===_0xae03('0x4a')){var _0x406d5f=_0x129e42[_0xae03('0x4b')]({'plain':!![]});var _0x3d7ddf='Triggers';return db[_0xae03('0x4e')][_0xae03('0x47')]({'where':{'name':_0x3d7ddf,'userProfileId':_0x573d47[_0xae03('0x4f')]},'raw':!![]})[_0xae03('0x23')](function(_0x2fc4){if(_0x2fc4&&_0x2fc4['autoAssociation']===0x0){return db[_0xae03('0x50')][_0xae03('0x48')]({'name':_0x406d5f[_0xae03('0x28')],'resourceId':_0x406d5f['id'],'type':_0x2fc4[_0xae03('0x28')],'sectionId':_0x2fc4['id']},{})[_0xae03('0x23')](function(){return _0x129e42;});}else{return _0x129e42;}})[_0xae03('0x41')](function(_0x3efb4f){logger[_0xae03('0x51')](_0xae03('0x52'),_0x3efb4f);throw _0x3efb4f;});}return _0x129e42;})['then'](respondWithResult(_0x16e90e,0xc9))[_0xae03('0x41')](handleError(_0x16e90e,null));};exports[_0xae03('0x22')]=function(_0x276368,_0x3efda8){if(_0x276368['body']['id']){delete _0x276368[_0xae03('0x49')]['id'];}return db[_0xae03('0x2c')][_0xae03('0x47')]({'where':{'id':_0x276368['params']['id']}})[_0xae03('0x23')](handleEntityNotFound(_0x3efda8,null))['then'](saveUpdates(_0x276368[_0xae03('0x49')],null))[_0xae03('0x23')](respondWithResult(_0x3efda8,null))[_0xae03('0x41')](handleError(_0x3efda8,null));};exports['destroy']=function(_0x195bcf,_0x36c4d0){return db['Trigger']['find']({'where':{'id':_0x195bcf[_0xae03('0x43')]['id']}})['then'](handleEntityNotFound(_0x36c4d0,null))[_0xae03('0x23')](removeEntity(_0x36c4d0,null))[_0xae03('0x41')](handleError(_0x36c4d0,null));};exports['addAllCondition']=function(_0x26acfb,_0x10a569,_0x228918){if(_0x26acfb['body']['id']){delete _0x26acfb[_0xae03('0x49')]['id'];}return db[_0xae03('0x2c')][_0xae03('0x47')]({'where':{'id':_0x26acfb['params']['id']}})['then'](handleEntityNotFound(_0x10a569,null))[_0xae03('0x23')](function(_0x3aecd2){if(_0x3aecd2){_0x26acfb[_0xae03('0x49')][_0xae03('0x53')]=_0x3aecd2['id'];return db[_0xae03('0x54')][_0xae03('0x48')](_0x26acfb['body']);}})[_0xae03('0x23')](respondWithResult(_0x10a569,null))['catch'](handleError(_0x10a569,null));};exports['addAnyCondition']=function(_0x32950b,_0x2cc5df,_0xd311dc){if(_0x32950b[_0xae03('0x49')]['id']){delete _0x32950b['body']['id'];}return db[_0xae03('0x2c')][_0xae03('0x47')]({'where':{'id':_0x32950b[_0xae03('0x43')]['id']}})[_0xae03('0x23')](handleEntityNotFound(_0x2cc5df,null))[_0xae03('0x23')](function(_0x505529){if(_0x505529){_0x32950b[_0xae03('0x49')][_0xae03('0x55')]=_0x505529['id'];return db['Condition'][_0xae03('0x48')](_0x32950b['body']);}})['then'](respondWithResult(_0x2cc5df,null))[_0xae03('0x41')](handleError(_0x2cc5df,null));};exports['getAllConditions']=function(_0x18da2c,_0x1fcd52,_0x1c3ce4){var _0xd4c4ab={};var _0x204a1={};var _0x51ee76;var _0x3a6789;return db[_0xae03('0x2c')][_0xae03('0x56')]({'where':{'id':_0x18da2c['params']['id']}})[_0xae03('0x23')](handleEntityNotFound(_0x1fcd52,null))[_0xae03('0x23')](function(_0x276367){if(_0x276367){_0x51ee76=_0x276367;_0x204a1[_0xae03('0x31')]=_['keys'](db[_0xae03('0x54')][_0xae03('0x2d')]);_0x204a1[_0xae03('0x34')]=_['keys'](_0x18da2c[_0xae03('0x34')]);_0x204a1[_0xae03('0x32')]=_['intersection'](_0x204a1['model'],_0x204a1[_0xae03('0x34')]);_0xd4c4ab['attributes']=_[_0xae03('0x33')](_0x204a1[_0xae03('0x31')],qs[_0xae03('0x36')](_0x18da2c[_0xae03('0x34')][_0xae03('0x36')]));_0xd4c4ab['attributes']=_0xd4c4ab[_0xae03('0x35')][_0xae03('0x37')]?_0xd4c4ab[_0xae03('0x35')]:_0x204a1[_0xae03('0x31')];_0xd4c4ab[_0xae03('0x39')]=qs[_0xae03('0x3a')](_0x18da2c[_0xae03('0x34')]['sort']);_0xd4c4ab['where']=qs[_0xae03('0x32')](_[_0xae03('0x3c')](_0x18da2c[_0xae03('0x34')],_0x204a1[_0xae03('0x32')]));if(_0x18da2c[_0xae03('0x34')][_0xae03('0x3d')]){_0xd4c4ab[_0xae03('0x3b')]=_[_0xae03('0x46')](_0xd4c4ab[_0xae03('0x3b')],{'$or':_[_0xae03('0x2b')](_0xd4c4ab[_0xae03('0x35')],function(_0x3f88fd){var _0x215376={};_0x215376[_0x3f88fd]={'$like':'%'+_0x18da2c[_0xae03('0x34')]['filter']+'%'};return _0x215376;})});}_0xd4c4ab=_[_0xae03('0x46')]({},_0xd4c4ab,_0x18da2c[_0xae03('0x3f')]);return _0x51ee76[_0xae03('0x57')](_0xd4c4ab);}})[_0xae03('0x23')](function(_0x140f32){if(_0x140f32){_0x3a6789=_0x140f32['length'];if(!_0x18da2c[_0xae03('0x34')][_0xae03('0x58')](_0xae03('0x38'))){_0xd4c4ab['limit']=qs['limit'](_0x18da2c[_0xae03('0x34')][_0xae03('0x1b')]);_0xd4c4ab[_0xae03('0x1d')]=qs[_0xae03('0x1d')](_0x18da2c[_0xae03('0x34')][_0xae03('0x1d')]);}return _0x51ee76[_0xae03('0x57')](_0xd4c4ab);}})['then'](function(_0x1a4583){if(_0x1a4583){return _0x1a4583?{'count':_0x3a6789,'rows':_0x1a4583}:null;}})['then'](respondWithResult(_0x1fcd52,null))[_0xae03('0x41')](handleError(_0x1fcd52,null));};exports['getAnyConditions']=function(_0x3021ed,_0x5389e2,_0x22c653){var _0x28e4a2={};var _0x556810={};var _0x17e64e;var _0xc4d410;return db['Trigger']['findOne']({'where':{'id':_0x3021ed[_0xae03('0x43')]['id']}})['then'](handleEntityNotFound(_0x5389e2,null))['then'](function(_0x5fc38){if(_0x5fc38){_0x17e64e=_0x5fc38;_0x556810[_0xae03('0x31')]=_[_0xae03('0x44')](db[_0xae03('0x54')][_0xae03('0x2d')]);_0x556810[_0xae03('0x34')]=_[_0xae03('0x44')](_0x3021ed[_0xae03('0x34')]);_0x556810[_0xae03('0x32')]=_[_0xae03('0x33')](_0x556810[_0xae03('0x31')],_0x556810[_0xae03('0x34')]);_0x28e4a2['attributes']=_[_0xae03('0x33')](_0x556810[_0xae03('0x31')],qs['fields'](_0x3021ed[_0xae03('0x34')][_0xae03('0x36')]));_0x28e4a2[_0xae03('0x35')]=_0x28e4a2[_0xae03('0x35')][_0xae03('0x37')]?_0x28e4a2[_0xae03('0x35')]:_0x556810[_0xae03('0x31')];_0x28e4a2['order']=qs['sort'](_0x3021ed[_0xae03('0x34')][_0xae03('0x3a')]);_0x28e4a2[_0xae03('0x3b')]=qs[_0xae03('0x32')](_[_0xae03('0x3c')](_0x3021ed[_0xae03('0x34')],_0x556810[_0xae03('0x32')]));if(_0x3021ed[_0xae03('0x34')]['filter']){_0x28e4a2[_0xae03('0x3b')]=_[_0xae03('0x46')](_0x28e4a2[_0xae03('0x3b')],{'$or':_['map'](_0x28e4a2['attributes'],function(_0x99f005){var _0x9aaa34={};_0x9aaa34[_0x99f005]={'$like':'%'+_0x3021ed[_0xae03('0x34')][_0xae03('0x3d')]+'%'};return _0x9aaa34;})});}_0x28e4a2=_[_0xae03('0x46')]({},_0x28e4a2,_0x3021ed[_0xae03('0x3f')]);return _0x17e64e['getAnyConditions'](_0x28e4a2);}})['then'](function(_0x1c163d){if(_0x1c163d){_0xc4d410=_0x1c163d[_0xae03('0x37')];if(!_0x3021ed['query']['hasOwnProperty'](_0xae03('0x38'))){_0x28e4a2[_0xae03('0x1b')]=qs['limit'](_0x3021ed[_0xae03('0x34')][_0xae03('0x1b')]);_0x28e4a2['offset']=qs[_0xae03('0x1d')](_0x3021ed['query'][_0xae03('0x1d')]);}return _0x17e64e[_0xae03('0x59')](_0x28e4a2);}})[_0xae03('0x23')](function(_0x3e04cc){if(_0x3e04cc){return _0x3e04cc?{'count':_0xc4d410,'rows':_0x3e04cc}:null;}})[_0xae03('0x23')](respondWithResult(_0x5389e2,null))[_0xae03('0x41')](handleError(_0x5389e2,null));};exports[_0xae03('0x5a')]=function(_0x213e35,_0x207dd0,_0x3b18de){if(_0x213e35[_0xae03('0x49')]['id']){delete _0x213e35[_0xae03('0x49')]['id'];}return db['Trigger'][_0xae03('0x47')]({'where':{'id':_0x213e35[_0xae03('0x43')]['id']}})[_0xae03('0x23')](handleEntityNotFound(_0x207dd0,null))[_0xae03('0x23')](function(_0xc3afe6){if(_0xc3afe6){_0x213e35['body']['TriggerId']=_0xc3afe6['id'];return db[_0xae03('0x5b')][_0xae03('0x48')](_0x213e35[_0xae03('0x49')]);}})[_0xae03('0x23')](respondWithResult(_0x207dd0,null))[_0xae03('0x41')](handleError(_0x207dd0,null));};exports[_0xae03('0x5c')]=function(_0x5983c5,_0x1a751e,_0x34597a){var _0x3c0024={};var _0x3f7693={};var _0x549724;var _0x2ab801;return db[_0xae03('0x2c')][_0xae03('0x56')]({'where':{'id':_0x5983c5[_0xae03('0x43')]['id']}})[_0xae03('0x23')](handleEntityNotFound(_0x1a751e,null))['then'](function(_0x108e8a){if(_0x108e8a){_0x549724=_0x108e8a;_0x3f7693[_0xae03('0x31')]=_[_0xae03('0x44')](db[_0xae03('0x5b')][_0xae03('0x2d')]);_0x3f7693['query']=_[_0xae03('0x44')](_0x5983c5[_0xae03('0x34')]);_0x3f7693[_0xae03('0x32')]=_[_0xae03('0x33')](_0x3f7693[_0xae03('0x31')],_0x3f7693[_0xae03('0x34')]);_0x3c0024[_0xae03('0x35')]=_[_0xae03('0x33')](_0x3f7693[_0xae03('0x31')],qs[_0xae03('0x36')](_0x5983c5['query'][_0xae03('0x36')]));_0x3c0024['attributes']=_0x3c0024[_0xae03('0x35')][_0xae03('0x37')]?_0x3c0024[_0xae03('0x35')]:_0x3f7693['model'];_0x3c0024['order']=qs[_0xae03('0x3a')](_0x5983c5[_0xae03('0x34')]['sort']);_0x3c0024['where']=qs['filters'](_[_0xae03('0x3c')](_0x5983c5[_0xae03('0x34')],_0x3f7693[_0xae03('0x32')]));if(_0x5983c5[_0xae03('0x34')][_0xae03('0x3d')]){_0x3c0024[_0xae03('0x3b')]=_[_0xae03('0x46')](_0x3c0024[_0xae03('0x3b')],{'$or':_[_0xae03('0x2b')](_0x3c0024['attributes'],function(_0x173b94){var _0x580dd7={};_0x580dd7[_0x173b94]={'$like':'%'+_0x5983c5['query'][_0xae03('0x3d')]+'%'};return _0x580dd7;})});}_0x3c0024=_[_0xae03('0x46')]({},_0x3c0024,_0x5983c5[_0xae03('0x3f')]);return _0x549724[_0xae03('0x5c')](_0x3c0024);}})[_0xae03('0x23')](function(_0x19db71){if(_0x19db71){_0x2ab801=_0x19db71[_0xae03('0x37')];if(!_0x5983c5[_0xae03('0x34')][_0xae03('0x58')](_0xae03('0x38'))){_0x3c0024['limit']=qs['limit'](_0x5983c5[_0xae03('0x34')][_0xae03('0x1b')]);_0x3c0024[_0xae03('0x1d')]=qs['offset'](_0x5983c5['query'][_0xae03('0x1d')]);}return _0x549724[_0xae03('0x5c')](_0x3c0024);}})[_0xae03('0x23')](function(_0x3c89b7){if(_0x3c89b7){return _0x3c89b7?{'count':_0x2ab801,'rows':_0x3c89b7}:null;}})[_0xae03('0x23')](respondWithResult(_0x1a751e,null))['catch'](handleError(_0x1a751e,null));}; \ No newline at end of file +var _0x4c71=['merge','VIRTUAL','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','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','hasOwnProperty','getAnyConditions','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','json','apply','reject','save','destroy','then','get','Triggers','UserProfileResource','sendStatus','error','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','filter'];(function(_0xd8a8af,_0x1e93f0){var _0x5b7278=function(_0x458800){while(--_0x458800){_0xd8a8af['push'](_0xd8a8af['shift']());}};_0x5b7278(++_0x1e93f0);}(_0x4c71,0x147));var _0x14c7=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x4c71[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14c7('0x0'));var zipdir=require(_0x14c7('0x1'));var jsonpatch=require(_0x14c7('0x2'));var rp=require('request-promise');var moment=require(_0x14c7('0x3'));var BPromise=require(_0x14c7('0x4'));var Mustache=require(_0x14c7('0x5'));var util=require(_0x14c7('0x6'));var path=require(_0x14c7('0x7'));var sox=require(_0x14c7('0x8'));var csv=require(_0x14c7('0x9'));var ejs=require(_0x14c7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14c7('0xb'));var squel=require(_0x14c7('0xc'));var crypto=require(_0x14c7('0xd'));var jsforce=require(_0x14c7('0xe'));var deskjs=require(_0x14c7('0xf'));var toCsv=require(_0x14c7('0x9'));var querystring=require(_0x14c7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x14c7('0x11'));var qs=require(_0x14c7('0x12'));var as=require(_0x14c7('0x13'));var hardwareService=require(_0x14c7('0x14'));var logger=require(_0x14c7('0x15'))('api');var utils=require(_0x14c7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x14c7('0x17'));var db=require(_0x14c7('0x18'))['db'];function respondWithStatusCode(_0xf58873,_0x4f2819){_0x4f2819=_0x4f2819||0xcc;return function(_0x105779){if(_0x105779){return _0xf58873['sendStatus'](_0x4f2819);}return _0xf58873['status'](_0x4f2819)[_0x14c7('0x19')]();};}function respondWithResult(_0x34c125,_0x1cb6f8){_0x1cb6f8=_0x1cb6f8||0xc8;return function(_0x80635a){if(_0x80635a){return _0x34c125[_0x14c7('0x1a')](_0x1cb6f8)['json'](_0x80635a);}};}function respondWithFilteredResult(_0x2935bd,_0x3727c0){return function(_0x5a5b2d){if(_0x5a5b2d){var _0x27d817=typeof _0x3727c0[_0x14c7('0x1b')]===_0x14c7('0x1c')&&typeof _0x3727c0['limit']===_0x14c7('0x1c');var _0x1f018f=_0x5a5b2d[_0x14c7('0x1d')];var _0x46331d=_0x27d817?0x0:_0x3727c0[_0x14c7('0x1b')];var _0x38e8c4=_0x27d817?_0x5a5b2d[_0x14c7('0x1d')]:_0x3727c0[_0x14c7('0x1b')]+_0x3727c0['limit'];var _0x410fe5;if(_0x38e8c4>=_0x1f018f){_0x38e8c4=_0x1f018f;_0x410fe5=0xc8;}else{_0x410fe5=0xce;}_0x2935bd[_0x14c7('0x1a')](_0x410fe5);return _0x2935bd['set']('Content-Range',_0x46331d+'-'+_0x38e8c4+'/'+_0x1f018f)[_0x14c7('0x1e')](_0x5a5b2d);}return null;};}function patchUpdates(_0x22f108){return function(_0x3ee161){try{jsonpatch[_0x14c7('0x1f')](_0x3ee161,_0x22f108,!![]);}catch(_0x481594){return BPromise[_0x14c7('0x20')](_0x481594);}return _0x3ee161[_0x14c7('0x21')]();};}function saveUpdates(_0x4e4287,_0x3f82fb){return function(_0x1a1fbd){if(_0x1a1fbd){return _0x1a1fbd['update'](_0x4e4287)['then'](function(_0x55a92e){return _0x55a92e;});}return null;};}function removeEntity(_0x156283,_0x4d05a1){return function(_0x45d32e){if(_0x45d32e){return _0x45d32e[_0x14c7('0x22')]()[_0x14c7('0x23')](function(){var _0x499a6e=_0x45d32e[_0x14c7('0x24')]({'plain':!![]});var _0x3e6296=_0x14c7('0x25');return db[_0x14c7('0x26')][_0x14c7('0x22')]({'where':{'type':_0x3e6296,'resourceId':_0x499a6e['id']}})['then'](function(){return _0x45d32e;});})[_0x14c7('0x23')](function(){_0x156283[_0x14c7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8aca0,_0x3b7da9){return function(_0x139b99){if(!_0x139b99){_0x8aca0[_0x14c7('0x27')](0x194);}return _0x139b99;};}function handleError(_0x1cc1d5,_0x45e182){_0x45e182=_0x45e182||0x1f4;return function(_0x2af723){logger[_0x14c7('0x28')](_0x2af723[_0x14c7('0x29')]);if(_0x2af723[_0x14c7('0x2a')]){delete _0x2af723['name'];}_0x1cc1d5[_0x14c7('0x1a')](_0x45e182)[_0x14c7('0x2b')](_0x2af723);};}exports[_0x14c7('0x2c')]=function(_0x2f73ce,_0x5d4f6b){var _0x3c9bed={},_0x1cd2d8={},_0x2f5f27={'count':0x0,'rows':[]};var _0x1672da=_[_0x14c7('0x2d')](db[_0x14c7('0x2e')][_0x14c7('0x2f')],function(_0x18cf44){return{'name':_0x18cf44['fieldName'],'type':_0x18cf44[_0x14c7('0x30')][_0x14c7('0x31')]};});_0x1cd2d8[_0x14c7('0x32')]=_[_0x14c7('0x2d')](_0x1672da,_0x14c7('0x2a'));_0x1cd2d8[_0x14c7('0x33')]=_[_0x14c7('0x34')](_0x2f73ce[_0x14c7('0x33')]);_0x1cd2d8['filters']=_['intersection'](_0x1cd2d8[_0x14c7('0x32')],_0x1cd2d8['query']);_0x3c9bed[_0x14c7('0x35')]=_[_0x14c7('0x36')](_0x1cd2d8[_0x14c7('0x32')],qs[_0x14c7('0x37')](_0x2f73ce[_0x14c7('0x33')][_0x14c7('0x37')]));_0x3c9bed[_0x14c7('0x35')]=_0x3c9bed[_0x14c7('0x35')][_0x14c7('0x38')]?_0x3c9bed[_0x14c7('0x35')]:_0x1cd2d8[_0x14c7('0x32')];if(!_0x2f73ce['query']['hasOwnProperty'](_0x14c7('0x39'))){_0x3c9bed[_0x14c7('0x3a')]=qs['limit'](_0x2f73ce[_0x14c7('0x33')][_0x14c7('0x3a')]);_0x3c9bed[_0x14c7('0x1b')]=qs[_0x14c7('0x1b')](_0x2f73ce[_0x14c7('0x33')]['offset']);}_0x3c9bed[_0x14c7('0x3b')]=qs[_0x14c7('0x3c')](_0x2f73ce[_0x14c7('0x33')][_0x14c7('0x3c')]);_0x3c9bed[_0x14c7('0x3d')]=qs[_0x14c7('0x3e')](_[_0x14c7('0x3f')](_0x2f73ce[_0x14c7('0x33')],_0x1cd2d8[_0x14c7('0x3e')]),_0x1672da);if(_0x2f73ce[_0x14c7('0x33')][_0x14c7('0x40')]){_0x3c9bed[_0x14c7('0x3d')]=_[_0x14c7('0x41')](_0x3c9bed[_0x14c7('0x3d')],{'$or':_['map'](_0x1672da,function(_0x41ca5a){if(_0x41ca5a['type']!==_0x14c7('0x42')){var _0x27424d={};_0x27424d[_0x41ca5a[_0x14c7('0x2a')]]={'$like':'%'+_0x2f73ce[_0x14c7('0x33')][_0x14c7('0x40')]+'%'};return _0x27424d;}})});}_0x3c9bed=_[_0x14c7('0x41')]({},_0x3c9bed,_0x2f73ce[_0x14c7('0x43')]);var _0x492641={'where':_0x3c9bed[_0x14c7('0x3d')]};return db['Trigger']['count'](_0x492641)[_0x14c7('0x23')](function(_0x39a0b5){_0x2f5f27[_0x14c7('0x1d')]=_0x39a0b5;if(_0x2f73ce[_0x14c7('0x33')][_0x14c7('0x44')]){_0x3c9bed[_0x14c7('0x45')]=[{'all':!![]}];}return db[_0x14c7('0x2e')][_0x14c7('0x46')](_0x3c9bed);})[_0x14c7('0x23')](function(_0xdc2856){_0x2f5f27[_0x14c7('0x47')]=_0xdc2856;return _0x2f5f27;})[_0x14c7('0x23')](respondWithFilteredResult(_0x5d4f6b,_0x3c9bed))[_0x14c7('0x48')](handleError(_0x5d4f6b,null));};exports[_0x14c7('0x49')]=function(_0x2e2659,_0x3d68bc){var _0x38a338={'raw':![],'where':{'id':_0x2e2659[_0x14c7('0x4a')]['id']}},_0x480b89={};_0x480b89['model']=_[_0x14c7('0x34')](db[_0x14c7('0x2e')][_0x14c7('0x2f')]);_0x480b89[_0x14c7('0x33')]=_[_0x14c7('0x34')](_0x2e2659[_0x14c7('0x33')]);_0x480b89[_0x14c7('0x3e')]=_['intersection'](_0x480b89['model'],_0x480b89[_0x14c7('0x33')]);_0x38a338[_0x14c7('0x35')]=_['intersection'](_0x480b89['model'],qs['fields'](_0x2e2659['query'][_0x14c7('0x37')]));_0x38a338['attributes']=_0x38a338[_0x14c7('0x35')][_0x14c7('0x38')]?_0x38a338['attributes']:_0x480b89['model'];if(_0x2e2659[_0x14c7('0x33')][_0x14c7('0x44')]){_0x38a338['include']=[{'all':!![]}];}_0x38a338=_[_0x14c7('0x41')]({},_0x38a338,_0x2e2659[_0x14c7('0x43')]);return db['Trigger'][_0x14c7('0x4b')](_0x38a338)[_0x14c7('0x23')](handleEntityNotFound(_0x3d68bc,null))[_0x14c7('0x23')](respondWithResult(_0x3d68bc,null))['catch'](handleError(_0x3d68bc,null));};exports[_0x14c7('0x4c')]=function(_0x27e806,_0x56bb62){return db[_0x14c7('0x2e')]['create'](_0x27e806[_0x14c7('0x4d')],{})[_0x14c7('0x23')](function(_0x315982){var _0x39d847=_0x27e806[_0x14c7('0x4e')][_0x14c7('0x24')]({'plain':!![]});if(!_0x39d847)throw new Error(_0x14c7('0x4f'));if(_0x39d847[_0x14c7('0x50')]===_0x14c7('0x4e')){var _0x61ffd0=_0x315982['get']({'plain':!![]});var _0x4f7061='Triggers';return db[_0x14c7('0x51')][_0x14c7('0x4b')]({'where':{'name':_0x4f7061,'userProfileId':_0x39d847[_0x14c7('0x52')]},'raw':!![]})[_0x14c7('0x23')](function(_0x8aa51f){if(_0x8aa51f&&_0x8aa51f[_0x14c7('0x53')]===0x0){return db[_0x14c7('0x26')]['create']({'name':_0x61ffd0['name'],'resourceId':_0x61ffd0['id'],'type':_0x8aa51f['name'],'sectionId':_0x8aa51f['id']},{})[_0x14c7('0x23')](function(){return _0x315982;});}else{return _0x315982;}})[_0x14c7('0x48')](function(_0x1cde53){logger[_0x14c7('0x28')](_0x14c7('0x54'),_0x1cde53);throw _0x1cde53;});}return _0x315982;})[_0x14c7('0x23')](respondWithResult(_0x56bb62,0xc9))[_0x14c7('0x48')](handleError(_0x56bb62,null));};exports[_0x14c7('0x55')]=function(_0xd22e2a,_0x1e5164){if(_0xd22e2a[_0x14c7('0x4d')]['id']){delete _0xd22e2a['body']['id'];}return db[_0x14c7('0x2e')]['find']({'where':{'id':_0xd22e2a[_0x14c7('0x4a')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x1e5164,null))['then'](saveUpdates(_0xd22e2a['body'],null))[_0x14c7('0x23')](respondWithResult(_0x1e5164,null))[_0x14c7('0x48')](handleError(_0x1e5164,null));};exports[_0x14c7('0x22')]=function(_0x2e3135,_0xda9eaa){return db['Trigger'][_0x14c7('0x4b')]({'where':{'id':_0x2e3135[_0x14c7('0x4a')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0xda9eaa,null))[_0x14c7('0x23')](removeEntity(_0xda9eaa,null))['catch'](handleError(_0xda9eaa,null));};exports[_0x14c7('0x56')]=function(_0x5efda5,_0x191dc4,_0x14145a){if(_0x5efda5[_0x14c7('0x4d')]['id']){delete _0x5efda5[_0x14c7('0x4d')]['id'];}return db[_0x14c7('0x2e')]['find']({'where':{'id':_0x5efda5[_0x14c7('0x4a')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x191dc4,null))[_0x14c7('0x23')](function(_0x1cc6f7){if(_0x1cc6f7){_0x5efda5[_0x14c7('0x4d')][_0x14c7('0x57')]=_0x1cc6f7['id'];return db[_0x14c7('0x58')][_0x14c7('0x4c')](_0x5efda5['body']);}})[_0x14c7('0x23')](respondWithResult(_0x191dc4,null))[_0x14c7('0x48')](handleError(_0x191dc4,null));};exports[_0x14c7('0x59')]=function(_0x5eb443,_0x25b2e9,_0x35ab9f){if(_0x5eb443[_0x14c7('0x4d')]['id']){delete _0x5eb443[_0x14c7('0x4d')]['id'];}return db[_0x14c7('0x2e')][_0x14c7('0x4b')]({'where':{'id':_0x5eb443['params']['id']}})['then'](handleEntityNotFound(_0x25b2e9,null))[_0x14c7('0x23')](function(_0x2529e9){if(_0x2529e9){_0x5eb443['body'][_0x14c7('0x5a')]=_0x2529e9['id'];return db[_0x14c7('0x58')][_0x14c7('0x4c')](_0x5eb443[_0x14c7('0x4d')]);}})[_0x14c7('0x23')](respondWithResult(_0x25b2e9,null))[_0x14c7('0x48')](handleError(_0x25b2e9,null));};exports['getAllConditions']=function(_0x29ff27,_0x2cafdc,_0x35e5e1){var _0x45d48e={};var _0x5846b5={};var _0x5c3092;var _0x209819;return db[_0x14c7('0x2e')][_0x14c7('0x5b')]({'where':{'id':_0x29ff27[_0x14c7('0x4a')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x2cafdc,null))[_0x14c7('0x23')](function(_0x481e2d){if(_0x481e2d){_0x5c3092=_0x481e2d;_0x5846b5[_0x14c7('0x32')]=_[_0x14c7('0x34')](db[_0x14c7('0x58')]['rawAttributes']);_0x5846b5[_0x14c7('0x33')]=_[_0x14c7('0x34')](_0x29ff27[_0x14c7('0x33')]);_0x5846b5[_0x14c7('0x3e')]=_['intersection'](_0x5846b5['model'],_0x5846b5[_0x14c7('0x33')]);_0x45d48e['attributes']=_[_0x14c7('0x36')](_0x5846b5[_0x14c7('0x32')],qs[_0x14c7('0x37')](_0x29ff27[_0x14c7('0x33')][_0x14c7('0x37')]));_0x45d48e[_0x14c7('0x35')]=_0x45d48e[_0x14c7('0x35')]['length']?_0x45d48e[_0x14c7('0x35')]:_0x5846b5[_0x14c7('0x32')];_0x45d48e[_0x14c7('0x3b')]=qs[_0x14c7('0x3c')](_0x29ff27[_0x14c7('0x33')][_0x14c7('0x3c')]);_0x45d48e['where']=qs[_0x14c7('0x3e')](_[_0x14c7('0x3f')](_0x29ff27[_0x14c7('0x33')],_0x5846b5[_0x14c7('0x3e')]));if(_0x29ff27[_0x14c7('0x33')]['filter']){_0x45d48e['where']=_['merge'](_0x45d48e[_0x14c7('0x3d')],{'$or':_[_0x14c7('0x2d')](_0x45d48e[_0x14c7('0x35')],function(_0x402f90){var _0x554e7f={};_0x554e7f[_0x402f90]={'$like':'%'+_0x29ff27[_0x14c7('0x33')]['filter']+'%'};return _0x554e7f;})});}_0x45d48e=_[_0x14c7('0x41')]({},_0x45d48e,_0x29ff27[_0x14c7('0x43')]);return _0x5c3092[_0x14c7('0x5c')](_0x45d48e);}})['then'](function(_0x199dd0){if(_0x199dd0){_0x209819=_0x199dd0['length'];if(!_0x29ff27[_0x14c7('0x33')][_0x14c7('0x5d')]('nolimit')){_0x45d48e[_0x14c7('0x3a')]=qs[_0x14c7('0x3a')](_0x29ff27[_0x14c7('0x33')][_0x14c7('0x3a')]);_0x45d48e['offset']=qs['offset'](_0x29ff27[_0x14c7('0x33')][_0x14c7('0x1b')]);}return _0x5c3092[_0x14c7('0x5c')](_0x45d48e);}})[_0x14c7('0x23')](function(_0x5d7a06){if(_0x5d7a06){return _0x5d7a06?{'count':_0x209819,'rows':_0x5d7a06}:null;}})[_0x14c7('0x23')](respondWithResult(_0x2cafdc,null))[_0x14c7('0x48')](handleError(_0x2cafdc,null));};exports['getAnyConditions']=function(_0x4236b5,_0x1b3fe9,_0x3ff58d){var _0x57f82d={};var _0x4197dd={};var _0x3df24d;var _0x3f9782;return db['Trigger'][_0x14c7('0x5b')]({'where':{'id':_0x4236b5['params']['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x1b3fe9,null))[_0x14c7('0x23')](function(_0x4674cd){if(_0x4674cd){_0x3df24d=_0x4674cd;_0x4197dd['model']=_[_0x14c7('0x34')](db[_0x14c7('0x58')]['rawAttributes']);_0x4197dd[_0x14c7('0x33')]=_['keys'](_0x4236b5[_0x14c7('0x33')]);_0x4197dd[_0x14c7('0x3e')]=_[_0x14c7('0x36')](_0x4197dd[_0x14c7('0x32')],_0x4197dd[_0x14c7('0x33')]);_0x57f82d[_0x14c7('0x35')]=_['intersection'](_0x4197dd[_0x14c7('0x32')],qs[_0x14c7('0x37')](_0x4236b5[_0x14c7('0x33')][_0x14c7('0x37')]));_0x57f82d[_0x14c7('0x35')]=_0x57f82d[_0x14c7('0x35')]['length']?_0x57f82d['attributes']:_0x4197dd[_0x14c7('0x32')];_0x57f82d[_0x14c7('0x3b')]=qs[_0x14c7('0x3c')](_0x4236b5['query']['sort']);_0x57f82d['where']=qs[_0x14c7('0x3e')](_[_0x14c7('0x3f')](_0x4236b5[_0x14c7('0x33')],_0x4197dd[_0x14c7('0x3e')]));if(_0x4236b5[_0x14c7('0x33')][_0x14c7('0x40')]){_0x57f82d[_0x14c7('0x3d')]=_[_0x14c7('0x41')](_0x57f82d[_0x14c7('0x3d')],{'$or':_[_0x14c7('0x2d')](_0x57f82d[_0x14c7('0x35')],function(_0x46ddb0){var _0x16274c={};_0x16274c[_0x46ddb0]={'$like':'%'+_0x4236b5['query'][_0x14c7('0x40')]+'%'};return _0x16274c;})});}_0x57f82d=_[_0x14c7('0x41')]({},_0x57f82d,_0x4236b5[_0x14c7('0x43')]);return _0x3df24d['getAnyConditions'](_0x57f82d);}})[_0x14c7('0x23')](function(_0x4e6526){if(_0x4e6526){_0x3f9782=_0x4e6526[_0x14c7('0x38')];if(!_0x4236b5[_0x14c7('0x33')]['hasOwnProperty']('nolimit')){_0x57f82d[_0x14c7('0x3a')]=qs[_0x14c7('0x3a')](_0x4236b5[_0x14c7('0x33')][_0x14c7('0x3a')]);_0x57f82d[_0x14c7('0x1b')]=qs[_0x14c7('0x1b')](_0x4236b5[_0x14c7('0x33')][_0x14c7('0x1b')]);}return _0x3df24d[_0x14c7('0x5e')](_0x57f82d);}})[_0x14c7('0x23')](function(_0x18623b){if(_0x18623b){return _0x18623b?{'count':_0x3f9782,'rows':_0x18623b}:null;}})[_0x14c7('0x23')](respondWithResult(_0x1b3fe9,null))['catch'](handleError(_0x1b3fe9,null));};exports['addAction']=function(_0x4b2e67,_0x90d124,_0x247490){if(_0x4b2e67[_0x14c7('0x4d')]['id']){delete _0x4b2e67[_0x14c7('0x4d')]['id'];}return db['Trigger'][_0x14c7('0x4b')]({'where':{'id':_0x4b2e67[_0x14c7('0x4a')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x90d124,null))[_0x14c7('0x23')](function(_0x1c4457){if(_0x1c4457){_0x4b2e67[_0x14c7('0x4d')][_0x14c7('0x5f')]=_0x1c4457['id'];return db[_0x14c7('0x60')]['create'](_0x4b2e67[_0x14c7('0x4d')]);}})[_0x14c7('0x23')](respondWithResult(_0x90d124,null))[_0x14c7('0x48')](handleError(_0x90d124,null));};exports[_0x14c7('0x61')]=function(_0x3812a2,_0x20a9cb,_0x122734){var _0x3ab7e4={};var _0x1a5cb1={};var _0x23748f;var _0x41dc6a;return db[_0x14c7('0x2e')]['findOne']({'where':{'id':_0x3812a2[_0x14c7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20a9cb,null))[_0x14c7('0x23')](function(_0x453d49){if(_0x453d49){_0x23748f=_0x453d49;_0x1a5cb1[_0x14c7('0x32')]=_[_0x14c7('0x34')](db[_0x14c7('0x60')][_0x14c7('0x2f')]);_0x1a5cb1['query']=_[_0x14c7('0x34')](_0x3812a2[_0x14c7('0x33')]);_0x1a5cb1[_0x14c7('0x3e')]=_[_0x14c7('0x36')](_0x1a5cb1[_0x14c7('0x32')],_0x1a5cb1['query']);_0x3ab7e4['attributes']=_[_0x14c7('0x36')](_0x1a5cb1[_0x14c7('0x32')],qs[_0x14c7('0x37')](_0x3812a2[_0x14c7('0x33')][_0x14c7('0x37')]));_0x3ab7e4[_0x14c7('0x35')]=_0x3ab7e4[_0x14c7('0x35')]['length']?_0x3ab7e4[_0x14c7('0x35')]:_0x1a5cb1['model'];_0x3ab7e4[_0x14c7('0x3b')]=qs[_0x14c7('0x3c')](_0x3812a2[_0x14c7('0x33')][_0x14c7('0x3c')]);_0x3ab7e4[_0x14c7('0x3d')]=qs[_0x14c7('0x3e')](_[_0x14c7('0x3f')](_0x3812a2[_0x14c7('0x33')],_0x1a5cb1[_0x14c7('0x3e')]));if(_0x3812a2[_0x14c7('0x33')][_0x14c7('0x40')]){_0x3ab7e4[_0x14c7('0x3d')]=_['merge'](_0x3ab7e4[_0x14c7('0x3d')],{'$or':_[_0x14c7('0x2d')](_0x3ab7e4['attributes'],function(_0x254fb8){var _0x5e5acd={};_0x5e5acd[_0x254fb8]={'$like':'%'+_0x3812a2[_0x14c7('0x33')][_0x14c7('0x40')]+'%'};return _0x5e5acd;})});}_0x3ab7e4=_[_0x14c7('0x41')]({},_0x3ab7e4,_0x3812a2[_0x14c7('0x43')]);return _0x23748f[_0x14c7('0x61')](_0x3ab7e4);}})[_0x14c7('0x23')](function(_0x2b61d4){if(_0x2b61d4){_0x41dc6a=_0x2b61d4[_0x14c7('0x38')];if(!_0x3812a2[_0x14c7('0x33')][_0x14c7('0x5d')]('nolimit')){_0x3ab7e4[_0x14c7('0x3a')]=qs[_0x14c7('0x3a')](_0x3812a2[_0x14c7('0x33')][_0x14c7('0x3a')]);_0x3ab7e4[_0x14c7('0x1b')]=qs[_0x14c7('0x1b')](_0x3812a2[_0x14c7('0x33')][_0x14c7('0x1b')]);}return _0x23748f['getActions'](_0x3ab7e4);}})['then'](function(_0x561ab8){if(_0x561ab8){return _0x561ab8?{'count':_0x41dc6a,'rows':_0x561ab8}:null;}})['then'](respondWithResult(_0x20a9cb,null))[_0x14c7('0x48')](handleError(_0x20a9cb,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 365daa4..91c4dce 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 _0x815b=['./trigger.attributes','exports','define','tools_triggers','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x815b,0xb4));var _0xb815=function(_0x3d23f0,_0x400982){_0x3d23f0=_0x3d23f0-0x0;var _0x424058=_0x815b[_0x3d23f0];return _0x424058;};'use strict';var _=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var logger=require(_0xb815('0x2'))(_0xb815('0x3'));var moment=require(_0xb815('0x4'));var BPromise=require('bluebird');var rp=require(_0xb815('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb815('0x6'));var attributes=require(_0xb815('0x7'));module[_0xb815('0x8')]=function(_0x5a5c18,_0x466899){return _0x5a5c18[_0xb815('0x9')]('Trigger',attributes,{'tableName':_0xb815('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5a7=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','util','api','moment','bluebird'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xf5a7,0x133));var _0x7f5a=function(_0x4cc5b4,_0x1b89fa){_0x4cc5b4=_0x4cc5b4-0x0;var _0x4ca068=_0xf5a7[_0x4cc5b4];return _0x4ca068;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var logger=require('../../config/logger')(_0x7f5a('0x2'));var moment=require(_0x7f5a('0x3'));var BPromise=require(_0x7f5a('0x4'));var rp=require(_0x7f5a('0x5'));var fs=require('fs');var path=require(_0x7f5a('0x6'));var rimraf=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var attributes=require(_0x7f5a('0x9'));module[_0x7f5a('0xa')]=function(_0x520bf9,_0x2808f2){return _0x520bf9[_0x7f5a('0xb')]('Trigger',attributes,{'tableName':_0x7f5a('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 310ef0d..35b4e2c 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 _0xf1fb=['message','result','catch','GetTrigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x40d513,_0x2886f1){var _0x55bb22=function(_0x2d70e4){while(--_0x2d70e4){_0x40d513['push'](_0x40d513['shift']());}};_0x55bb22(++_0x2886f1);}(_0xf1fb,0xda));var _0xbf1f=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xf1fb[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xbf1f('0x0'));var util=require(_0xbf1f('0x1'));var moment=require(_0xbf1f('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf1f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf1f('0x4'))['db'];var utils=require(_0xbf1f('0x5'));var logger=require('../../config/logger')(_0xbf1f('0x6'));var config=require(_0xbf1f('0x7'));var jayson=require(_0xbf1f('0x8'));var client=jayson[_0xbf1f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d810c,_0x4e768d,_0x54da77){return new BPromise(function(_0x1976f3,_0x4ebe78){return client[_0xbf1f('0xa')](_0x2d810c,_0x54da77)[_0xbf1f('0xb')](function(_0xcd11b0){logger[_0xbf1f('0xc')](_0xbf1f('0xd'),_0x4e768d,_0xbf1f('0xe'));logger[_0xbf1f('0xf')](_0xbf1f('0x10'),_0x4e768d,_0xbf1f('0xe'),JSON[_0xbf1f('0x11')](_0xcd11b0));if(_0xcd11b0['error']){if(_0xcd11b0[_0xbf1f('0x12')][_0xbf1f('0x13')]===0x1f4){logger['error'](_0xbf1f('0xd'),_0x4e768d,_0xcd11b0[_0xbf1f('0x12')][_0xbf1f('0x14')]);return _0x4ebe78(_0xcd11b0[_0xbf1f('0x12')][_0xbf1f('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x4e768d,_0xcd11b0[_0xbf1f('0x12')][_0xbf1f('0x14')]);return _0x1976f3(_0xcd11b0[_0xbf1f('0x12')][_0xbf1f('0x14')]);}else{logger['info'](_0xbf1f('0xd'),_0x4e768d,_0xbf1f('0xe'));_0x1976f3(_0xcd11b0[_0xbf1f('0x15')][_0xbf1f('0x14')]);}})[_0xbf1f('0x16')](function(_0x56e5c4){logger[_0xbf1f('0x12')]('Trigger,\x20%s,\x20%s',_0x4e768d,_0x56e5c4);_0x4ebe78(_0x56e5c4);});});}exports[_0xbf1f('0x17')]=function(_0x1fe880){var _0x5259ca=this;return new Promise(function(_0x137eef,_0x20aee6){return db['Trigger'][_0xbf1f('0x18')]({'raw':_0x1fe880['options']?_0x1fe880[_0xbf1f('0x19')][_0xbf1f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fe880[_0xbf1f('0x19')]?_0x1fe880['options'][_0xbf1f('0x1b')]||null:null,'attributes':_0x1fe880[_0xbf1f('0x19')]?_0x1fe880['options'][_0xbf1f('0x1c')]||null:null,'limit':_0x1fe880[_0xbf1f('0x19')]?_0x1fe880[_0xbf1f('0x19')][_0xbf1f('0x1d')]||null:null,'include':_0x1fe880[_0xbf1f('0x19')]?_0x1fe880['options'][_0xbf1f('0x1e')]?_[_0xbf1f('0x1f')](_0x1fe880[_0xbf1f('0x19')]['include'],function(_0x56a9cf){return{'model':db[_0x56a9cf['model']],'as':_0x56a9cf['as'],'attributes':_0x56a9cf[_0xbf1f('0x1c')],'include':_0x56a9cf[_0xbf1f('0x1e')]?_[_0xbf1f('0x1f')](_0x56a9cf[_0xbf1f('0x1e')],function(_0x2a8a85){return{'model':db[_0x2a8a85[_0xbf1f('0x20')]],'as':_0x2a8a85['as'],'attributes':_0x2a8a85[_0xbf1f('0x1c')],'include':_0x2a8a85['include']?_[_0xbf1f('0x1f')](_0x2a8a85[_0xbf1f('0x1e')],function(_0x256b90){return{'model':db[_0x256b90[_0xbf1f('0x20')]],'as':_0x256b90['as'],'attributes':_0x256b90[_0xbf1f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2252f0){logger[_0xbf1f('0xc')](_0xbf1f('0x17'),_0x1fe880);logger[_0xbf1f('0xf')](_0xbf1f('0x17'),_0x1fe880,JSON[_0xbf1f('0x11')](_0x2252f0));_0x137eef(_0x2252f0);})[_0xbf1f('0x16')](function(_0x3e53db){logger[_0xbf1f('0x12')]('GetTrigger',_0x3e53db[_0xbf1f('0x14')],_0x1fe880);_0x20aee6(_0x5259ca[_0xbf1f('0x12')](0x1f4,_0x3e53db[_0xbf1f('0x14')]));});});};exports[_0xbf1f('0x21')]=function(_0xe792be){var _0x50fe96=this;return new Promise(function(_0xad5c84,_0x10569a){return db['Trigger']['find']({'raw':_0xe792be[_0xbf1f('0x19')]?_0xe792be['options'][_0xbf1f('0x1a')]===undefined?!![]:![]:!![],'where':_0xe792be[_0xbf1f('0x19')]?_0xe792be[_0xbf1f('0x19')]['where']||null:null,'attributes':_0xe792be[_0xbf1f('0x19')]?_0xe792be['options']['attributes']||null:null,'include':_0xe792be[_0xbf1f('0x19')]?_0xe792be[_0xbf1f('0x19')][_0xbf1f('0x1e')]?_[_0xbf1f('0x1f')](_0xe792be[_0xbf1f('0x19')][_0xbf1f('0x1e')],function(_0x5a6552){return{'model':db[_0x5a6552[_0xbf1f('0x20')]],'as':_0x5a6552['as'],'attributes':_0x5a6552[_0xbf1f('0x1c')],'include':_0x5a6552[_0xbf1f('0x1e')]?_[_0xbf1f('0x1f')](_0x5a6552[_0xbf1f('0x1e')],function(_0x46f4be){return{'model':db[_0x46f4be[_0xbf1f('0x20')]],'as':_0x46f4be['as'],'attributes':_0x46f4be[_0xbf1f('0x1c')],'include':_0x46f4be[_0xbf1f('0x1e')]?_[_0xbf1f('0x1f')](_0x46f4be[_0xbf1f('0x1e')],function(_0x2f093f){return{'model':db[_0x2f093f[_0xbf1f('0x20')]],'as':_0x2f093f['as'],'attributes':_0x2f093f[_0xbf1f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbf1f('0xb')](function(_0x4b1af9){logger[_0xbf1f('0xc')]('ShowTrigger',_0xe792be);logger[_0xbf1f('0xf')](_0xbf1f('0x21'),_0xe792be,JSON[_0xbf1f('0x11')](_0x4b1af9));_0xad5c84(_0x4b1af9);})['catch'](function(_0xa0228a){logger[_0xbf1f('0x12')]('ShowTrigger',_0xa0228a[_0xbf1f('0x14')],_0xe792be);_0x10569a(_0x50fe96[_0xbf1f('0x12')](0x1f4,_0xa0228a[_0xbf1f('0x14')]));});});}; \ No newline at end of file +var _0x5af5=['util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrigger','Trigger','findAll','options','where','limit','include','map','model','catch','ShowTrigger','find','raw','attributes'];(function(_0x4db8b0,_0x1cbdf7){var _0x31e65e=function(_0x291190){while(--_0x291190){_0x4db8b0['push'](_0x4db8b0['shift']());}};_0x31e65e(++_0x1cbdf7);}(_0x5af5,0x13b));var _0x55af=function(_0x5f1314,_0x49fb22){_0x5f1314=_0x5f1314-0x0;var _0x49647d=_0x5af5[_0x5f1314];return _0x49647d;};'use strict';var _=require('lodash');var util=require(_0x55af('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x55af('0x1'));var fs=require('fs');var Redis=require(_0x55af('0x2'));var db=require(_0x55af('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x55af('0x4'))(_0x55af('0x5'));var config=require(_0x55af('0x6'));var jayson=require(_0x55af('0x7'));var client=jayson[_0x55af('0x8')][_0x55af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cd858,_0x1cb565,_0x1b6c04){return new BPromise(function(_0x2f8a33,_0x5898cd){return client[_0x55af('0xa')](_0x2cd858,_0x1b6c04)[_0x55af('0xb')](function(_0x232e75){logger[_0x55af('0xc')](_0x55af('0xd'),_0x1cb565,_0x55af('0xe'));logger[_0x55af('0xf')](_0x55af('0x10'),_0x1cb565,_0x55af('0xe'),JSON[_0x55af('0x11')](_0x232e75));if(_0x232e75[_0x55af('0x12')]){if(_0x232e75[_0x55af('0x12')][_0x55af('0x13')]===0x1f4){logger[_0x55af('0x12')]('Trigger,\x20%s,\x20%s',_0x1cb565,_0x232e75[_0x55af('0x12')]['message']);return _0x5898cd(_0x232e75[_0x55af('0x12')]['message']);}logger[_0x55af('0x12')](_0x55af('0xd'),_0x1cb565,_0x232e75[_0x55af('0x12')]['message']);return _0x2f8a33(_0x232e75[_0x55af('0x12')]['message']);}else{logger[_0x55af('0xc')](_0x55af('0xd'),_0x1cb565,_0x55af('0xe'));_0x2f8a33(_0x232e75['result'][_0x55af('0x14')]);}})['catch'](function(_0x59ce70){logger['error']('Trigger,\x20%s,\x20%s',_0x1cb565,_0x59ce70);_0x5898cd(_0x59ce70);});});}exports[_0x55af('0x15')]=function(_0x29b880){var _0x59f48a=this;return new Promise(function(_0x13726d,_0x31425b){return db[_0x55af('0x16')][_0x55af('0x17')]({'raw':_0x29b880[_0x55af('0x18')]?_0x29b880[_0x55af('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x29b880[_0x55af('0x18')]?_0x29b880[_0x55af('0x18')][_0x55af('0x19')]||null:null,'attributes':_0x29b880[_0x55af('0x18')]?_0x29b880[_0x55af('0x18')]['attributes']||null:null,'limit':_0x29b880[_0x55af('0x18')]?_0x29b880[_0x55af('0x18')][_0x55af('0x1a')]||null:null,'include':_0x29b880[_0x55af('0x18')]?_0x29b880[_0x55af('0x18')][_0x55af('0x1b')]?_[_0x55af('0x1c')](_0x29b880[_0x55af('0x18')][_0x55af('0x1b')],function(_0x2770fa){return{'model':db[_0x2770fa[_0x55af('0x1d')]],'as':_0x2770fa['as'],'attributes':_0x2770fa['attributes'],'include':_0x2770fa[_0x55af('0x1b')]?_[_0x55af('0x1c')](_0x2770fa[_0x55af('0x1b')],function(_0x69900d){return{'model':db[_0x69900d[_0x55af('0x1d')]],'as':_0x69900d['as'],'attributes':_0x69900d['attributes'],'include':_0x69900d[_0x55af('0x1b')]?_[_0x55af('0x1c')](_0x69900d['include'],function(_0x45e36b){return{'model':db[_0x45e36b[_0x55af('0x1d')]],'as':_0x45e36b['as'],'attributes':_0x45e36b['attributes']};}):[]};}):[]};}):[]:[]})[_0x55af('0xb')](function(_0x517248){logger[_0x55af('0xc')](_0x55af('0x15'),_0x29b880);logger['debug'](_0x55af('0x15'),_0x29b880,JSON[_0x55af('0x11')](_0x517248));_0x13726d(_0x517248);})[_0x55af('0x1e')](function(_0x5eb98d){logger['error'](_0x55af('0x15'),_0x5eb98d[_0x55af('0x14')],_0x29b880);_0x31425b(_0x59f48a[_0x55af('0x12')](0x1f4,_0x5eb98d[_0x55af('0x14')]));});});};exports[_0x55af('0x1f')]=function(_0x477cae){var _0x441718=this;return new Promise(function(_0x4cf037,_0x41c5a8){return db[_0x55af('0x16')][_0x55af('0x20')]({'raw':_0x477cae['options']?_0x477cae['options'][_0x55af('0x21')]===undefined?!![]:![]:!![],'where':_0x477cae[_0x55af('0x18')]?_0x477cae[_0x55af('0x18')][_0x55af('0x19')]||null:null,'attributes':_0x477cae[_0x55af('0x18')]?_0x477cae['options'][_0x55af('0x22')]||null:null,'include':_0x477cae['options']?_0x477cae['options'][_0x55af('0x1b')]?_[_0x55af('0x1c')](_0x477cae[_0x55af('0x18')][_0x55af('0x1b')],function(_0x59dd66){return{'model':db[_0x59dd66[_0x55af('0x1d')]],'as':_0x59dd66['as'],'attributes':_0x59dd66[_0x55af('0x22')],'include':_0x59dd66['include']?_[_0x55af('0x1c')](_0x59dd66[_0x55af('0x1b')],function(_0x572a8e){return{'model':db[_0x572a8e[_0x55af('0x1d')]],'as':_0x572a8e['as'],'attributes':_0x572a8e[_0x55af('0x22')],'include':_0x572a8e[_0x55af('0x1b')]?_['map'](_0x572a8e[_0x55af('0x1b')],function(_0x4cab0a){return{'model':db[_0x4cab0a[_0x55af('0x1d')]],'as':_0x4cab0a['as'],'attributes':_0x4cab0a[_0x55af('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x423866){logger['info']('ShowTrigger',_0x477cae);logger['debug'](_0x55af('0x1f'),_0x477cae,JSON['stringify'](_0x423866));_0x4cf037(_0x423866);})[_0x55af('0x1e')](function(_0x3e7969){logger[_0x55af('0x12')](_0x55af('0x1f'),_0x3e7969['message'],_0x477cae);_0x41c5a8(_0x441718['error'](0x1f4,_0x3e7969['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 910d903..9ea62e0 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 _0x4484=['index','show','post','clone','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4484,0x15d));var _0x4448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4484[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x4448('0x0'));var path=require(_0x4448('0x1'));var timeout=require(_0x4448('0x2'));var express=require(_0x4448('0x3'));var router=express[_0x4448('0x4')]();var fs_extra=require(_0x4448('0x5'));var auth=require(_0x4448('0x6'));var interaction=require(_0x4448('0x7'));var config=require(_0x4448('0x8'));var controller=require('./trunk.controller');router[_0x4448('0x9')]('/',auth[_0x4448('0xa')](),controller[_0x4448('0xb')]);router[_0x4448('0x9')]('/:id',auth[_0x4448('0xa')](),controller[_0x4448('0xc')]);router[_0x4448('0xd')]('/:id/clone',auth[_0x4448('0xa')](),controller[_0x4448('0xe')]);router[_0x4448('0xd')]('/',auth[_0x4448('0xa')](),controller['create']);router[_0x4448('0xf')](_0x4448('0x10'),auth[_0x4448('0xa')](),controller[_0x4448('0x11')]);router['delete']('/:id',auth[_0x4448('0xa')](),controller[_0x4448('0x12')]);module[_0x4448('0x13')]=router; \ No newline at end of file +var _0x2915=['Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','get','/:id','show','/:id/clone','clone','post','create','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x1e211e,_0x2c13e3){var _0x265859=function(_0xf1193d){while(--_0xf1193d){_0x1e211e['push'](_0x1e211e['shift']());}};_0x265859(++_0x2c13e3);}(_0x2915,0x9b));var _0x5291=function(_0x19b872,_0xb4de35){_0x19b872=_0x19b872-0x0;var _0xda669b=_0x2915[_0x19b872];return _0xda669b;};'use strict';var multer=require(_0x5291('0x0'));var util=require(_0x5291('0x1'));var path=require(_0x5291('0x2'));var timeout=require(_0x5291('0x3'));var express=require(_0x5291('0x4'));var router=express[_0x5291('0x5')]();var fs_extra=require(_0x5291('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5291('0x7'));var config=require(_0x5291('0x8'));var controller=require(_0x5291('0x9'));router['get']('/',auth[_0x5291('0xa')](),controller['index']);router[_0x5291('0xb')](_0x5291('0xc'),auth[_0x5291('0xa')](),controller[_0x5291('0xd')]);router['post'](_0x5291('0xe'),auth[_0x5291('0xa')](),controller[_0x5291('0xf')]);router[_0x5291('0x10')]('/',auth['isAuthenticated'](),controller[_0x5291('0x11')]);router['put'](_0x5291('0xc'),auth[_0x5291('0xa')](),controller[_0x5291('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5291('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 22c5089..73ded09 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 _0xf583=['info','inband','auto','rfc2833','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','uas','pai','fingerprint','certificate','active','actpass','dynamic','nonat','update,nonat','BOOLEAN','exports','name','ENUM','friend','user','STRING','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x56fb33,_0x37be08){var _0x435ee4=function(_0xa80804){while(--_0xa80804){_0x56fb33['push'](_0x56fb33['shift']());}};_0x435ee4(++_0x37be08);}(_0xf583,0xdf));var _0x3f58=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xf583[_0x24061a];return _0x82054e;};'use strict';var Sequelize=require('sequelize');module[_0x3f58('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3f58('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x3'),_0x3f58('0x4'),'peer'),'allowNull':![],'defaultValue':_0x3f58('0x3')},'context':{'type':Sequelize[_0x3f58('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x3f58('0x2')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x3f58('0x6'),_0x3f58('0x7'),_0x3f58('0x8'),'PROHIB_PASSED_SCREEN',_0x3f58('0x9'),_0x3f58('0xa'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x3f58('0x5')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x3f58('0x5')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x65da32){this[_0x3f58('0xb')]('transport',_0x65da32?_0x65da32[_0x3f58('0xc')](','):null);},'get':function(){return this[_0x3f58('0xd')](_0x3f58('0xe'))?this[_0x3f58('0xd')](_0x3f58('0xe'))[_0x3f58('0xf')](','):null;},'comment':_0x3f58('0x10')},'dtmfmode':{'type':Sequelize[_0x3f58('0x2')]('rfc2833',_0x3f58('0x11'),'shortinfo',_0x3f58('0x12'),_0x3f58('0x13')),'defaultValue':_0x3f58('0x14')},'directmedia':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no','nonat',_0x3f58('0x16'),_0x3f58('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3f58('0x5')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x3f58('0x5')],'defaultValue':_0x3f58('0x18'),'set':function(_0x22934b){this[_0x3f58('0xb')](_0x3f58('0x19'),_0x22934b?_0x22934b[_0x3f58('0xc')](','):null);},'get':function(){return this[_0x3f58('0xd')](_0x3f58('0x19'))?this[_0x3f58('0xd')](_0x3f58('0x19'))[_0x3f58('0xf')](','):null;},'comment':_0x3f58('0x1a')},'callgroup':{'type':Sequelize[_0x3f58('0x5')]},'namedcallgroup':{'type':Sequelize[_0x3f58('0x5')]},'pickupgroup':{'type':Sequelize[_0x3f58('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x3f58('0x5')]},'language':{'type':Sequelize[_0x3f58('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3f58('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3f58('0x5')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x3f58('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x8ff6f2){this[_0x3f58('0xb')](_0x3f58('0x1b'),_0x8ff6f2?_0x8ff6f2[_0x3f58('0xc')](';'):_0x3f58('0x1c'));},'get':function(){return this[_0x3f58('0xd')]('allow')?this['getDataValue'](_0x3f58('0x1b'))[_0x3f58('0xf')](';'):null;},'comment':_0x3f58('0x1d')},'autoframing':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x3f58('0x1e'),'set':function(_0x397b58){this[_0x3f58('0xb')](_0x3f58('0x1f'),_0x397b58?_0x397b58[_0x3f58('0xc')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x3f58('0xd')]('insecure')[_0x3f58('0xf')](','):null;},'comment':_0x3f58('0x20')},'trustrpid':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3f58('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x3f58('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x3f58('0x15'),'no')},'accountcode':{'type':Sequelize[_0x3f58('0x21')](0xb)},'setvar':{'type':Sequelize[_0x3f58('0x5')]},'callerid':{'type':Sequelize[_0x3f58('0x5')],'defaultValue':_0x3f58('0x22')},'amaflags':{'type':Sequelize[_0x3f58('0x5')]},'callcounter':{'type':Sequelize[_0x3f58('0x2')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x3f58('0x15'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x3f58('0x5')]},'template':{'type':Sequelize[_0x3f58('0x5')]},'videosupport':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no',_0x3f58('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3f58('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x3f58('0x15'),'no')},'mailbox':{'type':Sequelize[_0x3f58('0x5')]},'session_timers':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x24'),_0x3f58('0x25'),'originate')},'session_expires':{'type':Sequelize[_0x3f58('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x3f58('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x3f58('0x2')]('uac',_0x3f58('0x26')),'defaultValue':_0x3f58('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x3f58('0x5')]},'fromuser':{'type':Sequelize[_0x3f58('0x5')]},'port':{'type':Sequelize[_0x3f58('0x21')](0x5)},'qualify':{'type':Sequelize[_0x3f58('0x2')]('yes','no'),'defaultValue':_0x3f58('0x15')},'keepalive':{'type':Sequelize[_0x3f58('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x3f58('0x5')]},'defaultuser':{'type':Sequelize[_0x3f58('0x5')]},'rtptimeout':{'type':Sequelize[_0x3f58('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3f58('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no',_0x3f58('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3f58('0x5')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x3f58('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x3f58('0x5')]},'contactdeny':{'type':Sequelize[_0x3f58('0x5')]},'contactacl':{'type':Sequelize[_0x3f58('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x3f58('0x5')]},'use_q850_reason':{'type':Sequelize[_0x3f58('0x5')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x3f58('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x3f58('0x15'),'no')},'force_avp':{'type':Sequelize[_0x3f58('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no',_0x3f58('0x28'),_0x3f58('0x29'))},'dtlsrekey':{'type':Sequelize[_0x3f58('0x21')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x3f58('0x5')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x3f58('0x5')]},'dtlscapath':{'type':Sequelize[_0x3f58('0x5')]},'dtlssetup':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x2a'),'passive',_0x3f58('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3f58('0x5')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x3f58('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no')},'vmexten':{'type':Sequelize[_0x3f58('0x5')]},'mohinterpret':{'type':Sequelize[_0x3f58('0x5')]},'mohsuggest':{'type':Sequelize[_0x3f58('0x5')]},'parkinglot':{'type':Sequelize[_0x3f58('0x5')]},'description':{'type':Sequelize[_0x3f58('0x5')]},'host':{'type':Sequelize[_0x3f58('0x5')],'defaultValue':_0x3f58('0x2c')},'canreinvite':{'type':Sequelize[_0x3f58('0x2')](_0x3f58('0x15'),'no',_0x3f58('0x2d'),'update',_0x3f58('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3f58('0x5')]},'otherFields':{'type':Sequelize[_0x3f58('0x5')]},'active':{'type':Sequelize[_0x3f58('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3f58('0x5')],'defaultValue':'no'}}; \ No newline at end of file +var _0x6d93=['PROHIB','setDataValue','transport','join','getDataValue','split','rfc2833','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]','never','always','INTEGER','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','dynamic','BOOLEAN','sequelize','STRING','name','friend','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6d93,0x1ad));var _0x36d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d93[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x36d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x36d9('0x1')],'allowNull':![],'unique':_0x36d9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x36d9('0x3'),'user','peer'),'allowNull':![],'defaultValue':_0x36d9('0x3')},'context':{'type':Sequelize[_0x36d9('0x1')],'allowNull':![],'defaultValue':_0x36d9('0x4')},'callingpres':{'type':Sequelize[_0x36d9('0x5')]('ALLOWED_NOT_SCREENED',_0x36d9('0x6'),_0x36d9('0x7'),_0x36d9('0x8'),'PROHIB_NOT_SCREENED',_0x36d9('0x9'),_0x36d9('0xa'),_0x36d9('0xb'))},'deny':{'type':Sequelize[_0x36d9('0x1')]},'permit':{'type':Sequelize[_0x36d9('0x1')]},'secret':{'type':Sequelize[_0x36d9('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x36d9('0x1')]},'transport':{'type':Sequelize[_0x36d9('0x1')],'defaultValue':'udp','set':function(_0x1cfcfa){this[_0x36d9('0xc')](_0x36d9('0xd'),_0x1cfcfa?_0x1cfcfa[_0x36d9('0xe')](','):null);},'get':function(){return this[_0x36d9('0xf')](_0x36d9('0xd'))?this['getDataValue']('transport')[_0x36d9('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x11'),'info','shortinfo','inband',_0x36d9('0x12')),'defaultValue':_0x36d9('0x11')},'directmedia':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no',_0x36d9('0x14'),_0x36d9('0x15'),_0x36d9('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x36d9('0x5')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x36d9('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x36d9('0x1')],'defaultValue':_0x36d9('0x17'),'set':function(_0x51ef23){this['setDataValue'](_0x36d9('0x18'),_0x51ef23?_0x51ef23[_0x36d9('0xe')](','):null);},'get':function(){return this[_0x36d9('0xf')](_0x36d9('0x18'))?this['getDataValue'](_0x36d9('0x18'))[_0x36d9('0x10')](','):null;},'comment':_0x36d9('0x19')},'callgroup':{'type':Sequelize[_0x36d9('0x1')]},'namedcallgroup':{'type':Sequelize[_0x36d9('0x1')]},'pickupgroup':{'type':Sequelize[_0x36d9('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x36d9('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x36d9('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x36d9('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x36d9('0x1a'),'set':function(_0x4f9d4d){this[_0x36d9('0xc')](_0x36d9('0x1b'),_0x4f9d4d?_0x4f9d4d[_0x36d9('0xe')](';'):_0x36d9('0x1a'));},'get':function(){return this[_0x36d9('0xf')](_0x36d9('0x1b'))?this[_0x36d9('0xf')](_0x36d9('0x1b'))[_0x36d9('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'insecure':{'type':Sequelize[_0x36d9('0x1')],'defaultValue':_0x36d9('0x1c'),'set':function(_0x492b95){this[_0x36d9('0xc')]('insecure',_0x492b95?_0x492b95[_0x36d9('0xe')](','):null);},'get':function(){return this[_0x36d9('0xf')](_0x36d9('0x1d'))?this[_0x36d9('0xf')](_0x36d9('0x1d'))[_0x36d9('0x10')](','):null;},'comment':_0x36d9('0x1e')},'trustrpid':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x36d9('0x5')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no',_0x36d9('0x1f'))},'promiscredir':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'useclientcode':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x36d9('0x1')]},'callerid':{'type':Sequelize[_0x36d9('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x36d9('0x1')]},'callcounter':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no'),'defaultValue':_0x36d9('0x13')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x36d9('0x5')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x36d9('0x5')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x36d9('0x1')]},'template':{'type':Sequelize[_0x36d9('0x1')]},'videosupport':{'type':Sequelize[_0x36d9('0x5')]('yes','no',_0x36d9('0x20')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x36d9('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x36d9('0x5')]('accept',_0x36d9('0x22'),_0x36d9('0x23'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x36d9('0x5')]('uac',_0x36d9('0x24')),'defaultValue':_0x36d9('0x24')},'t38pt_usertpsource':{'type':Sequelize[_0x36d9('0x1')]},'regexten':{'type':Sequelize[_0x36d9('0x1')]},'fromdomain':{'type':Sequelize[_0x36d9('0x1')]},'fromuser':{'type':Sequelize[_0x36d9('0x1')]},'port':{'type':Sequelize[_0x36d9('0x21')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x36d9('0x13')},'keepalive':{'type':Sequelize[_0x36d9('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x36d9('0x1')]},'defaultuser':{'type':Sequelize[_0x36d9('0x1')]},'rtptimeout':{'type':Sequelize[_0x36d9('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x36d9('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x36d9('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x36d9('0x1')]},'callbackextension':{'type':Sequelize[_0x36d9('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x36d9('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x36d9('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x36d9('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x36d9('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x36d9('0x1')]},'use_q850_reason':{'type':Sequelize[_0x36d9('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'force_avp':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'icesupport':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x36d9('0x25'),_0x36d9('0x26'))},'dtlsrekey':{'type':Sequelize[_0x36d9('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x36d9('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x36d9('0x1')]},'dtlscipher':{'type':Sequelize[_0x36d9('0x1')]},'dtlscafile':{'type':Sequelize[_0x36d9('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x36d9('0x27'),_0x36d9('0x28'),_0x36d9('0x29')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x36d9('0x1')]},'usereqphone':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x36d9('0x1')]},'call_limit':{'type':Sequelize[_0x36d9('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x36d9('0x5')](_0x36d9('0x13'),'no')},'subscribemwi':{'type':Sequelize[_0x36d9('0x5')]('yes','no')},'vmexten':{'type':Sequelize[_0x36d9('0x1')]},'mohinterpret':{'type':Sequelize[_0x36d9('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x36d9('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x36d9('0x1')],'defaultValue':_0x36d9('0x2a')},'canreinvite':{'type':Sequelize[_0x36d9('0x5')]('yes','no','nonat',_0x36d9('0x15'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x36d9('0x1')]},'otherFields':{'type':Sequelize[_0x36d9('0x1')]},'active':{'type':Sequelize[_0x36d9('0x2b')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x36d9('0x1')],'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 e229652..0b621d7 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 _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x4b84,0x1cc));var _0x44b8=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x4b84[_0x38af48];return _0x445384;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,null));}; \ No newline at end of file +var _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0xe02ca4,_0x1b0593){var _0x2ad3cf=function(_0x3b22bc){while(--_0x3b22bc){_0xe02ca4['push'](_0xe02ca4['shift']());}};_0x2ad3cf(++_0x1b0593);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 423d205..64af261 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 _0xdcbe=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger'];(function(_0x71312e,_0x21ba7f){var _0x1047e4=function(_0x227efc){while(--_0x227efc){_0x71312e['push'](_0x71312e['shift']());}};_0x1047e4(++_0x21ba7f);}(_0xdcbe,0x16f));var _0xedcb=function(_0x208231,_0x50cc7c){_0x208231=_0x208231-0x0;var _0x22b587=_0xdcbe[_0x208231];return _0x22b587;};'use strict';var _=require(_0xedcb('0x0'));var util=require(_0xedcb('0x1'));var logger=require(_0xedcb('0x2'))(_0xedcb('0x3'));var moment=require('moment');var BPromise=require(_0xedcb('0x4'));var rp=require(_0xedcb('0x5'));var fs=require('fs');var path=require(_0xedcb('0x6'));var rimraf=require(_0xedcb('0x7'));var config=require(_0xedcb('0x8'));var attributes=require('./trunk.attributes');module[_0xedcb('0x9')]=function(_0x406ed2,_0x22420a){return _0x406ed2['define']('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9fe=['bluebird','path','./trunk.attributes','define','Trunk','lodash','../../config/logger','api'];(function(_0xb275c8,_0x302b37){var _0x9b8a25=function(_0x4c123b){while(--_0x4c123b){_0xb275c8['push'](_0xb275c8['shift']());}};_0x9b8a25(++_0x302b37);}(_0xe9fe,0x145));var _0xee9f=function(_0x5decec,_0x4e5761){_0x5decec=_0x5decec-0x0;var _0x35e1b4=_0xe9fe[_0x5decec];return _0x35e1b4;};'use strict';var _=require(_0xee9f('0x0'));var util=require('util');var logger=require(_0xee9f('0x1'))(_0xee9f('0x2'));var moment=require('moment');var BPromise=require(_0xee9f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee9f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xee9f('0x5'));module['exports']=function(_0x1204e8,_0x4239cb){return _0x1204e8[_0xee9f('0x6')](_0xee9f('0x7'),attributes,{'tableName':'tools_trunks','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 b049de2..7d916f2 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 _0xf04c=['client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','error','code','message','catch','Trunk','findAll','options','where','attributes','include','map','model','debug','GetTrunk','ShowTrunk','find','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xf04c,0xc7));var _0xcf04=function(_0x98c23,_0x2e5309){_0x98c23=_0x98c23-0x0;var _0x17650a=_0xf04c[_0x98c23];return _0x17650a;};'use strict';var _=require(_0xcf04('0x0'));var util=require(_0xcf04('0x1'));var moment=require(_0xcf04('0x2'));var BPromise=require(_0xcf04('0x3'));var rs=require(_0xcf04('0x4'));var fs=require('fs');var Redis=require(_0xcf04('0x5'));var db=require(_0xcf04('0x6'))['db'];var utils=require(_0xcf04('0x7'));var logger=require(_0xcf04('0x8'))(_0xcf04('0x9'));var config=require('../../config/environment');var jayson=require(_0xcf04('0xa'));var client=jayson[_0xcf04('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeed622,_0x5d27fe,_0x20a548){return new BPromise(function(_0x5336a8,_0x15d3af){return client[_0xcf04('0xc')](_0xeed622,_0x20a548)[_0xcf04('0xd')](function(_0x25f6b6){logger[_0xcf04('0xe')](_0xcf04('0xf'),_0x5d27fe,_0xcf04('0x10'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x5d27fe,_0xcf04('0x10'),JSON['stringify'](_0x25f6b6));if(_0x25f6b6[_0xcf04('0x11')]){if(_0x25f6b6[_0xcf04('0x11')][_0xcf04('0x12')]===0x1f4){logger[_0xcf04('0x11')](_0xcf04('0xf'),_0x5d27fe,_0x25f6b6[_0xcf04('0x11')][_0xcf04('0x13')]);return _0x15d3af(_0x25f6b6[_0xcf04('0x11')]['message']);}logger[_0xcf04('0x11')]('Trunk,\x20%s,\x20%s',_0x5d27fe,_0x25f6b6['error']['message']);return _0x5336a8(_0x25f6b6['error'][_0xcf04('0x13')]);}else{logger[_0xcf04('0xe')](_0xcf04('0xf'),_0x5d27fe,_0xcf04('0x10'));_0x5336a8(_0x25f6b6['result'][_0xcf04('0x13')]);}})[_0xcf04('0x14')](function(_0x3e003a){logger['error'](_0xcf04('0xf'),_0x5d27fe,_0x3e003a);_0x15d3af(_0x3e003a);});});}exports['GetTrunk']=function(_0x7566b6){var _0x4fd169=this;return new Promise(function(_0x1e8ebf,_0x13ce88){return db[_0xcf04('0x15')][_0xcf04('0x16')]({'raw':_0x7566b6['options']?_0x7566b6[_0xcf04('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x7566b6[_0xcf04('0x17')]?_0x7566b6[_0xcf04('0x17')][_0xcf04('0x18')]||null:null,'attributes':_0x7566b6['options']?_0x7566b6[_0xcf04('0x17')][_0xcf04('0x19')]||null:null,'limit':_0x7566b6[_0xcf04('0x17')]?_0x7566b6[_0xcf04('0x17')]['limit']||null:null,'include':_0x7566b6[_0xcf04('0x17')]?_0x7566b6[_0xcf04('0x17')][_0xcf04('0x1a')]?_[_0xcf04('0x1b')](_0x7566b6['options'][_0xcf04('0x1a')],function(_0x133634){return{'model':db[_0x133634[_0xcf04('0x1c')]],'as':_0x133634['as'],'attributes':_0x133634[_0xcf04('0x19')],'include':_0x133634[_0xcf04('0x1a')]?_['map'](_0x133634[_0xcf04('0x1a')],function(_0x52b8ca){return{'model':db[_0x52b8ca['model']],'as':_0x52b8ca['as'],'attributes':_0x52b8ca[_0xcf04('0x19')],'include':_0x52b8ca[_0xcf04('0x1a')]?_[_0xcf04('0x1b')](_0x52b8ca[_0xcf04('0x1a')],function(_0x9788f5){return{'model':db[_0x9788f5['model']],'as':_0x9788f5['as'],'attributes':_0x9788f5[_0xcf04('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcf04('0xd')](function(_0x2c21f3){logger[_0xcf04('0xe')]('GetTrunk',_0x7566b6);logger[_0xcf04('0x1d')](_0xcf04('0x1e'),_0x7566b6,JSON['stringify'](_0x2c21f3));_0x1e8ebf(_0x2c21f3);})[_0xcf04('0x14')](function(_0x5f3982){logger[_0xcf04('0x11')](_0xcf04('0x1e'),_0x5f3982[_0xcf04('0x13')],_0x7566b6);_0x13ce88(_0x4fd169[_0xcf04('0x11')](0x1f4,_0x5f3982[_0xcf04('0x13')]));});});};exports[_0xcf04('0x1f')]=function(_0x5812d3){var _0x5a5513=this;return new Promise(function(_0x20b2e3,_0x34b8d4){return db[_0xcf04('0x15')][_0xcf04('0x20')]({'raw':_0x5812d3['options']?_0x5812d3[_0xcf04('0x17')][_0xcf04('0x21')]===undefined?!![]:![]:!![],'where':_0x5812d3[_0xcf04('0x17')]?_0x5812d3[_0xcf04('0x17')][_0xcf04('0x18')]||null:null,'attributes':_0x5812d3[_0xcf04('0x17')]?_0x5812d3[_0xcf04('0x17')][_0xcf04('0x19')]||null:null,'include':_0x5812d3['options']?_0x5812d3['options']['include']?_[_0xcf04('0x1b')](_0x5812d3[_0xcf04('0x17')]['include'],function(_0x3731a0){return{'model':db[_0x3731a0[_0xcf04('0x1c')]],'as':_0x3731a0['as'],'attributes':_0x3731a0['attributes'],'include':_0x3731a0[_0xcf04('0x1a')]?_[_0xcf04('0x1b')](_0x3731a0[_0xcf04('0x1a')],function(_0x2c4ebe){return{'model':db[_0x2c4ebe[_0xcf04('0x1c')]],'as':_0x2c4ebe['as'],'attributes':_0x2c4ebe[_0xcf04('0x19')],'include':_0x2c4ebe[_0xcf04('0x1a')]?_[_0xcf04('0x1b')](_0x2c4ebe[_0xcf04('0x1a')],function(_0x35e451){return{'model':db[_0x35e451[_0xcf04('0x1c')]],'as':_0x35e451['as'],'attributes':_0x35e451[_0xcf04('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcf04('0xd')](function(_0x5599d9){logger['info'](_0xcf04('0x1f'),_0x5812d3);logger[_0xcf04('0x1d')](_0xcf04('0x1f'),_0x5812d3,JSON[_0xcf04('0x22')](_0x5599d9));_0x20b2e3(_0x5599d9);})['catch'](function(_0x4454d9){logger['error'](_0xcf04('0x1f'),_0x4454d9[_0xcf04('0x13')],_0x5812d3);_0x34b8d4(_0x5a5513['error'](0x1f4,_0x4454d9[_0xcf04('0x13')]));});});}; \ No newline at end of file +var _0x5a16=['util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrunk','Trunk','options','raw','where','include','map','model','attributes','ShowTrunk','lodash'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5a16,0xbf));var _0x65a1=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x5a16[_0x44946b];return _0x249bc4;};'use strict';var _=require(_0x65a1('0x0'));var util=require(_0x65a1('0x1'));var moment=require(_0x65a1('0x2'));var BPromise=require(_0x65a1('0x3'));var rs=require(_0x65a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x65a1('0x6'));var jayson=require(_0x65a1('0x7'));var client=jayson[_0x65a1('0x8')][_0x65a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x325a66,_0x3d4571,_0x1afdc8){return new BPromise(function(_0x497b30,_0x70c996){return client[_0x65a1('0xa')](_0x325a66,_0x1afdc8)['then'](function(_0x9134a9){logger['info'](_0x65a1('0xb'),_0x3d4571,_0x65a1('0xc'));logger[_0x65a1('0xd')](_0x65a1('0xe'),_0x3d4571,_0x65a1('0xc'),JSON[_0x65a1('0xf')](_0x9134a9));if(_0x9134a9['error']){if(_0x9134a9[_0x65a1('0x10')][_0x65a1('0x11')]===0x1f4){logger[_0x65a1('0x10')](_0x65a1('0xb'),_0x3d4571,_0x9134a9[_0x65a1('0x10')][_0x65a1('0x12')]);return _0x70c996(_0x9134a9[_0x65a1('0x10')][_0x65a1('0x12')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x3d4571,_0x9134a9[_0x65a1('0x10')][_0x65a1('0x12')]);return _0x497b30(_0x9134a9[_0x65a1('0x10')][_0x65a1('0x12')]);}else{logger[_0x65a1('0x13')]('Trunk,\x20%s,\x20%s',_0x3d4571,'request\x20sent');_0x497b30(_0x9134a9[_0x65a1('0x14')]['message']);}})[_0x65a1('0x15')](function(_0x4ec26a){logger[_0x65a1('0x10')](_0x65a1('0xb'),_0x3d4571,_0x4ec26a);_0x70c996(_0x4ec26a);});});}exports[_0x65a1('0x16')]=function(_0x1dde12){var _0x3ada2e=this;return new Promise(function(_0x2fa5ff,_0x3675c9){return db[_0x65a1('0x17')]['findAll']({'raw':_0x1dde12[_0x65a1('0x18')]?_0x1dde12[_0x65a1('0x18')][_0x65a1('0x19')]===undefined?!![]:![]:!![],'where':_0x1dde12[_0x65a1('0x18')]?_0x1dde12[_0x65a1('0x18')][_0x65a1('0x1a')]||null:null,'attributes':_0x1dde12[_0x65a1('0x18')]?_0x1dde12[_0x65a1('0x18')]['attributes']||null:null,'limit':_0x1dde12[_0x65a1('0x18')]?_0x1dde12[_0x65a1('0x18')]['limit']||null:null,'include':_0x1dde12[_0x65a1('0x18')]?_0x1dde12['options'][_0x65a1('0x1b')]?_[_0x65a1('0x1c')](_0x1dde12[_0x65a1('0x18')]['include'],function(_0x2cc355){return{'model':db[_0x2cc355[_0x65a1('0x1d')]],'as':_0x2cc355['as'],'attributes':_0x2cc355['attributes'],'include':_0x2cc355[_0x65a1('0x1b')]?_[_0x65a1('0x1c')](_0x2cc355['include'],function(_0x63c0f6){return{'model':db[_0x63c0f6[_0x65a1('0x1d')]],'as':_0x63c0f6['as'],'attributes':_0x63c0f6[_0x65a1('0x1e')],'include':_0x63c0f6['include']?_[_0x65a1('0x1c')](_0x63c0f6[_0x65a1('0x1b')],function(_0x153794){return{'model':db[_0x153794[_0x65a1('0x1d')]],'as':_0x153794['as'],'attributes':_0x153794[_0x65a1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e6502){logger['info']('GetTrunk',_0x1dde12);logger[_0x65a1('0xd')]('GetTrunk',_0x1dde12,JSON[_0x65a1('0xf')](_0x5e6502));_0x2fa5ff(_0x5e6502);})[_0x65a1('0x15')](function(_0xeb2e7d){logger['error'](_0x65a1('0x16'),_0xeb2e7d[_0x65a1('0x12')],_0x1dde12);_0x3675c9(_0x3ada2e['error'](0x1f4,_0xeb2e7d[_0x65a1('0x12')]));});});};exports[_0x65a1('0x1f')]=function(_0x3f6e45){var _0x7ae8d0=this;return new Promise(function(_0x49fa20,_0x19f426){return db[_0x65a1('0x17')]['find']({'raw':_0x3f6e45[_0x65a1('0x18')]?_0x3f6e45[_0x65a1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f6e45['options']?_0x3f6e45[_0x65a1('0x18')][_0x65a1('0x1a')]||null:null,'attributes':_0x3f6e45[_0x65a1('0x18')]?_0x3f6e45[_0x65a1('0x18')][_0x65a1('0x1e')]||null:null,'include':_0x3f6e45[_0x65a1('0x18')]?_0x3f6e45[_0x65a1('0x18')]['include']?_[_0x65a1('0x1c')](_0x3f6e45['options']['include'],function(_0x37fb74){return{'model':db[_0x37fb74['model']],'as':_0x37fb74['as'],'attributes':_0x37fb74['attributes'],'include':_0x37fb74['include']?_['map'](_0x37fb74[_0x65a1('0x1b')],function(_0x396810){return{'model':db[_0x396810[_0x65a1('0x1d')]],'as':_0x396810['as'],'attributes':_0x396810[_0x65a1('0x1e')],'include':_0x396810['include']?_[_0x65a1('0x1c')](_0x396810[_0x65a1('0x1b')],function(_0x762d38){return{'model':db[_0x762d38[_0x65a1('0x1d')]],'as':_0x762d38['as'],'attributes':_0x762d38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4163ad){logger[_0x65a1('0x13')](_0x65a1('0x1f'),_0x3f6e45);logger['debug'](_0x65a1('0x1f'),_0x3f6e45,JSON['stringify'](_0x4163ad));_0x49fa20(_0x4163ad);})[_0x65a1('0x15')](function(_0x36fa73){logger[_0x65a1('0x10')](_0x65a1('0x1f'),_0x36fa73['message'],_0x3f6e45);_0x19f426(_0x7ae8d0[_0x65a1('0x10')](0x1f4,_0x36fa73[_0x65a1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index beadf91..f465bbd 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 _0x94bd=['exports','Router','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x20688f,_0x2131bd){var _0x561290=function(_0x267a1d){while(--_0x267a1d){_0x20688f['push'](_0x20688f['shift']());}};_0x561290(++_0x2131bd);}(_0x94bd,0x174));var _0xd94b=function(_0x576f2b,_0x499259){_0x576f2b=_0x576f2b-0x0;var _0x478304=_0x94bd[_0x576f2b];return _0x478304;};'use strict';var express=require('express');var router=express[_0xd94b('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xd94b('0x1'));router[_0xd94b('0x2')](_0xd94b('0x3'),auth[_0xd94b('0x4')](),controller[_0xd94b('0x5')]);module[_0xd94b('0x6')]=router; \ No newline at end of file +var _0x9ebf=['../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','exports','Router'];(function(_0x2b7c47,_0x22dba6){var _0x58d855=function(_0x5cd7c8){while(--_0x5cd7c8){_0x2b7c47['push'](_0x2b7c47['shift']());}};_0x58d855(++_0x22dba6);}(_0x9ebf,0xfb));var _0xf9eb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9ebf[_0x4a9fb1];return _0x348672;};'use strict';var express=require('express');var router=express[_0xf9eb('0x0')]();var auth=require(_0xf9eb('0x1'));var controller=require(_0xf9eb('0x2'));router['put'](_0xf9eb('0x3'),auth[_0xf9eb('0x4')](),controller['update']);module[_0xf9eb('0x5')]=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 93db546..c9d728b 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 _0xf7cc=['UserId','error','warning','info','debug','ENUM','BOOLEAN','TEXT','DATE','INTEGER'];(function(_0x47fa75,_0x37d587){var _0xb57785=function(_0x475732){while(--_0x475732){_0x47fa75['push'](_0x47fa75['shift']());}};_0xb57785(++_0x37d587);}(_0xf7cc,0x1a5));var _0xcf7c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf7cc[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xcf7c('0x0'),_0xcf7c('0x1'),_0xcf7c('0x2'),_0xcf7c('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xcf7c('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xcf7c('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xcf7c('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xcf7c('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xcf7c('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xcf7c('0x8')],'unique':_0xcf7c('0x9')}}; \ No newline at end of file +var _0x4764=['TEXT','DATE','INTEGER','sequelize','error','warning','info','debug','exports','ENUM','BOOLEAN'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x4764,0x121));var _0x4476=function(_0x2e8b03,_0x37dc00){_0x2e8b03=_0x2e8b03-0x0;var _0x3c2d93=_0x4764[_0x2e8b03];return _0x3c2d93;};'use strict';var Sequelize=require(_0x4476('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x4476('0x1'),_0x4476('0x2'),_0x4476('0x3'),_0x4476('0x4')];module[_0x4476('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x4476('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4476('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4476('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x4476('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x4476('0xa')],'unique':'UserId'}}; \ 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 04e3115..6a358ce 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 _0x2bd6=['redis','./user-setting.socket','localhost','status','update','then','sendStatus','stack','name','send','role','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x2bd6[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0x62bd('0x0'));var Redis=require(_0x62bd('0x1'));var logger=require(_0x62bd('0x2'))(_0x62bd('0x3'));var config=require(_0x62bd('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x62bd('0x5'))(new Redis(config[_0x62bd('0x6')]));require(_0x62bd('0x7'))['register'](socket);config[_0x62bd('0x6')]=_['defaults'](config['redis'],{'host':_0x62bd('0x8'),'port':0x18eb});function respondWithResult(_0x39af04,_0x55d811){_0x55d811=_0x55d811||0xc8;return function(_0x3d0d8b){if(_0x3d0d8b){return _0x39af04[_0x62bd('0x9')](_0x55d811)['json'](_0x3d0d8b);}};}function saveUpdates(_0x1e3f0e){return function(_0x21ad65){if(_0x21ad65){return _0x21ad65[_0x62bd('0xa')](_0x1e3f0e)[_0x62bd('0xb')](function(_0x429d3f){return _0x429d3f;});}return null;};}function handleEntityNotFound(_0x341a2c){return function(_0x4423f2){if(!_0x4423f2){_0x341a2c[_0x62bd('0xc')](0x194);}return _0x4423f2;};}function handleError(_0x3c582f,_0x40b22f){_0x40b22f=_0x40b22f||0x1f4;return function(_0x4d4036){logger['error'](_0x4d4036[_0x62bd('0xd')]);if(_0x4d4036[_0x62bd('0xe')]){delete _0x4d4036[_0x62bd('0xe')];}_0x3c582f[_0x62bd('0x9')](_0x40b22f)[_0x62bd('0xf')](_0x4d4036);};}exports[_0x62bd('0xa')]=function(_0x549520,_0x12815e){if(_0x549520['user'][_0x62bd('0x10')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x549520[_0x62bd('0x11')]['id'])))throw new Error(_0x62bd('0x12'));return db[_0x62bd('0x13')][_0x62bd('0x14')]({'where':{'id':_0x549520[_0x62bd('0x11')]['id']}})[_0x62bd('0xb')](handleEntityNotFound(_0x12815e,null))[_0x62bd('0xb')](saveUpdates(_0x549520[_0x62bd('0x15')],null))['then'](respondWithResult(_0x12815e,null))[_0x62bd('0x16')](handleError(_0x12815e,null));}; \ No newline at end of file +var _0xf00e=['params','Invalid\x20user\x20setting\x20id','find','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','then','name','send','user','role','admin'];(function(_0x31c480,_0x13f64a){var _0x3687ce=function(_0x46fbc0){while(--_0x46fbc0){_0x31c480['push'](_0x31c480['shift']());}};_0x3687ce(++_0x13f64a);}(_0xf00e,0x12f));var _0xef00=function(_0xdf48bb,_0x36fb7a){_0xdf48bb=_0xdf48bb-0x0;var _0x456ba2=_0xf00e[_0xdf48bb];return _0x456ba2;};'use strict';var _=require(_0xef00('0x0'));var Redis=require(_0xef00('0x1'));var logger=require(_0xef00('0x2'))(_0xef00('0x3'));var config=require(_0xef00('0x4'));var db=require(_0xef00('0x5'))['db'];var socket=require(_0xef00('0x6'))(new Redis(config[_0xef00('0x7')]));require(_0xef00('0x8'))[_0xef00('0x9')](socket);config[_0xef00('0x7')]=_[_0xef00('0xa')](config[_0xef00('0x7')],{'host':_0xef00('0xb'),'port':0x18eb});function respondWithResult(_0x254f2e,_0x17ec9e){_0x17ec9e=_0x17ec9e||0xc8;return function(_0x2245a3){if(_0x2245a3){return _0x254f2e[_0xef00('0xc')](_0x17ec9e)['json'](_0x2245a3);}};}function saveUpdates(_0x1d3b1c){return function(_0x493ea7){if(_0x493ea7){return _0x493ea7['update'](_0x1d3b1c)[_0xef00('0xd')](function(_0x4f8db3){return _0x4f8db3;});}return null;};}function handleEntityNotFound(_0x4f01bc){return function(_0xc380a6){if(!_0xc380a6){_0x4f01bc['sendStatus'](0x194);}return _0xc380a6;};}function handleError(_0x2c9c22,_0x3a7b21){_0x3a7b21=_0x3a7b21||0x1f4;return function(_0x5dba5b){logger['error'](_0x5dba5b['stack']);if(_0x5dba5b['name']){delete _0x5dba5b[_0xef00('0xe')];}_0x2c9c22['status'](_0x3a7b21)[_0xef00('0xf')](_0x5dba5b);};}exports['update']=function(_0x2e693f,_0x41cd9c){if(_0x2e693f[_0xef00('0x10')][_0xef00('0x11')]!==_0xef00('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x2e693f[_0xef00('0x13')]['id'])))throw new Error(_0xef00('0x14'));return db['UserSetting'][_0xef00('0x15')]({'where':{'id':_0x2e693f[_0xef00('0x13')]['id']}})[_0xef00('0xd')](handleEntityNotFound(_0x41cd9c,null))[_0xef00('0xd')](saveUpdates(_0x2e693f['body'],null))[_0xef00('0xd')](respondWithResult(_0x41cd9c,null))[_0xef00('0x16')](handleError(_0x41cd9c,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 318b589..a7dd2a6 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 _0x8ffe=['../../mysqldb','UserSetting','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x7c93da,_0x27ae80){var _0x48508e=function(_0x470a0e){while(--_0x470a0e){_0x7c93da['push'](_0x7c93da['shift']());}};_0x48508e(++_0x27ae80);}(_0x8ffe,0x1f3));var _0xe8ff=function(_0xb32a14,_0x51f544){_0xb32a14=_0xb32a14-0x0;var _0x3671f0=_0x8ffe[_0xb32a14];return _0x3671f0;};'use strict';var EventEmitter=require(_0xe8ff('0x0'));var UserSetting=require(_0xe8ff('0x1'))['db'][_0xe8ff('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xe8ff('0x3')](0x0);var events={'afterCreate':_0xe8ff('0x4'),'afterUpdate':'update','afterDestroy':_0xe8ff('0x5')};function emitEvent(_0x6f6cde){return function(_0x19a336,_0x1222bd,_0x3c2a49){UserSettingEvents[_0xe8ff('0x6')](_0x6f6cde+':'+_0x19a336['id'],_0x19a336);UserSettingEvents['emit'](_0x6f6cde,_0x19a336);_0x3c2a49(null);};}for(var e in events){if(events[_0xe8ff('0x7')](e)){var event=events[e];UserSetting[_0xe8ff('0x8')](e,emitEvent(event));}}module[_0xe8ff('0x9')]=UserSettingEvents; \ No newline at end of file +var _0xac19=['UserSetting','setMaxListeners','save','update','hook','events','../../mysqldb'];(function(_0x441574,_0x1a69de){var _0x23f2b9=function(_0x14587c){while(--_0x14587c){_0x441574['push'](_0x441574['shift']());}};_0x23f2b9(++_0x1a69de);}(_0xac19,0xde));var _0x9ac1=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0xac19[_0x1073ad];return _0x528474;};'use strict';var EventEmitter=require(_0x9ac1('0x0'));var UserSetting=require(_0x9ac1('0x1'))['db'][_0x9ac1('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x9ac1('0x3')](0x0);var events={'afterCreate':_0x9ac1('0x4'),'afterUpdate':_0x9ac1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3eed42){return function(_0x4584f5,_0x1de11c,_0x145c84){UserSettingEvents['emit'](_0x3eed42+':'+_0x4584f5['id'],_0x4584f5);UserSettingEvents['emit'](_0x3eed42,_0x4584f5);_0x145c84(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x9ac1('0x6')](e,emitEvent(event));}}module['exports']=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 b051fc5..574b66e 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 _0x574d=['./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabledSince'];(function(_0x1723cf,_0x575186){var _0x3aa4b0=function(_0x25963d){while(--_0x25963d){_0x1723cf['push'](_0x1723cf['shift']());}};_0x3aa4b0(++_0x575186);}(_0x574d,0xc0));var _0xd574=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x574d[_0x53ccf2];return _0x5a2964;};'use strict';var attributes=require(_0xd574('0x0'));module[_0xd574('0x1')]=function(_0x2ef0b0){return _0x2ef0b0[_0xd574('0x2')](_0xd574('0x3'),attributes,{'tableName':_0xd574('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46aec5){if(!_0x46aec5['clientSideLoggingEnabled'])_0x46aec5[_0xd574('0x5')]=null;else if(_0x46aec5[_0xd574('0x5')]===null)_0x46aec5[_0xd574('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x2242=['exports','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x5c337a,_0x59d328){var _0x253513=function(_0x1716d2){while(--_0x1716d2){_0x5c337a['push'](_0x5c337a['shift']());}};_0x253513(++_0x59d328);}(_0x2242,0x1a3));var _0x2224=function(_0x11625c,_0x1dbdc1){_0x11625c=_0x11625c-0x0;var _0x5adef7=_0x2242[_0x11625c];return _0x5adef7;};'use strict';var attributes=require(_0x2224('0x0'));module[_0x2224('0x1')]=function(_0x34be5a){return _0x34be5a['define'](_0x2224('0x2'),attributes,{'tableName':_0x2224('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4acc10){if(!_0x4acc10[_0x2224('0x4')])_0x4acc10[_0x2224('0x5')]=null;else if(_0x4acc10['clientSideLoggingEnabledSince']===null)_0x4acc10[_0x2224('0x5')]=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 16ae4c8..bf64be1 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 _0xb67b=['remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events'];(function(_0x379957,_0x3ab032){var _0x1a0cc0=function(_0x5456cf){while(--_0x5456cf){_0x379957['push'](_0x379957['shift']());}};_0x1a0cc0(++_0x3ab032);}(_0xb67b,0x1f3));var _0xbb67=function(_0x3acfa3,_0x13ea7a){_0x3acfa3=_0x3acfa3-0x0;var _0xcfe26e=_0xb67b[_0x3acfa3];return _0xcfe26e;};'use strict';var UserSettingEvents=require(_0xbb67('0x0'));var events=['save',_0xbb67('0x1'),_0xbb67('0x2')];function createListener(_0x21f8ff,_0x339ded){return function(_0x534e8a){_0x339ded[_0xbb67('0x3')](_0x21f8ff,_0x534e8a);if(_0x21f8ff===_0xbb67('0x4')){_0x339ded[_0xbb67('0x3')](_0xbb67('0x5')+_0x534e8a[_0xbb67('0x6')],_0x534e8a);}};}exports[_0xbb67('0x7')]=function(_0x3b9e0c){for(var _0x56ff14=0x0,_0x352fae=events[_0xbb67('0x8')];_0x56ff14<_0x352fae;_0x56ff14++){var _0x57d582=events[_0x56ff14];var _0x4912e4=createListener(_0xbb67('0x9')+_0x57d582,_0x3b9e0c);UserSettingEvents['on'](_0x57d582,_0x4912e4);}}; \ No newline at end of file +var _0xb27e=['user-setting:update','emit','UserId','register','length','user-setting:','./user-setting.events','save','update'];(function(_0xe0bd31,_0xcc0e2b){var _0x30164f=function(_0x23d24e){while(--_0x23d24e){_0xe0bd31['push'](_0xe0bd31['shift']());}};_0x30164f(++_0xcc0e2b);}(_0xb27e,0x141));var _0xeb27=function(_0x4232d2,_0x389130){_0x4232d2=_0x4232d2-0x0;var _0x283120=_0xb27e[_0x4232d2];return _0x283120;};'use strict';var UserSettingEvents=require(_0xeb27('0x0'));var events=[_0xeb27('0x1'),'remove',_0xeb27('0x2')];function createListener(_0xdf62b6,_0x224025){return function(_0x2dfe6d){_0x224025['emit'](_0xdf62b6,_0x2dfe6d);if(_0xdf62b6===_0xeb27('0x3')){_0x224025[_0xeb27('0x4')]('user-setting:update:user-'+_0x2dfe6d[_0xeb27('0x5')],_0x2dfe6d);}};}exports[_0xeb27('0x6')]=function(_0x16c218){for(var _0x173253=0x0,_0x30fa50=events[_0xeb27('0x7')];_0x173253<_0x30fa50;_0x173253++){var _0x1540b9=events[_0x173253];var _0x179707=createListener(_0xeb27('0x8')+_0x1540b9,_0x16c218);UserSettingEvents['on'](_0x1540b9,_0x179707);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 83ea56e..b3fa5de 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 _0xbd72=['addSquareProjects','put','update','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','addQueues','diskStorage','root','%s-%s','now','single','file','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts'];(function(_0xfd6c39,_0x42dd63){var _0x52b65a=function(_0x108fe5){while(--_0x108fe5){_0xfd6c39['push'](_0xfd6c39['shift']());}};_0x52b65a(++_0x42dd63);}(_0xbd72,0x1e3));var _0x2bd7=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xbd72[_0x382c73];return _0x1dd0bf;};'use strict';var multer=require(_0x2bd7('0x0'));var util=require(_0x2bd7('0x1'));var path=require('path');var timeout=require(_0x2bd7('0x2'));var express=require(_0x2bd7('0x3'));var router=express['Router']();var fs_extra=require(_0x2bd7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2bd7('0x5'));var config=require('../../config/environment');var controller=require(_0x2bd7('0x6'));router[_0x2bd7('0x7')]('/',auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x9')]);router[_0x2bd7('0x7')](_0x2bd7('0xa'),auth[_0x2bd7('0x8')](),controller['describe']);router[_0x2bd7('0x7')](_0x2bd7('0xb'),auth['isAuthenticated'](),controller[_0x2bd7('0xc')]);router[_0x2bd7('0x7')](_0x2bd7('0xd'),auth['isAuthenticated'](),controller[_0x2bd7('0xe')]);router[_0x2bd7('0x7')](_0x2bd7('0xf'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x10')]);router[_0x2bd7('0x7')](_0x2bd7('0x11'),controller[_0x2bd7('0x12')]);router['get'](_0x2bd7('0x13'),auth[_0x2bd7('0x8')](),controller['getOpenTabs']);router[_0x2bd7('0x7')](_0x2bd7('0x14'),auth['isAuthenticated'](),controller[_0x2bd7('0x15')]);router[_0x2bd7('0x7')](_0x2bd7('0x16'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x17')]);router[_0x2bd7('0x7')](_0x2bd7('0x18'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x19')]);router['get'](_0x2bd7('0x1a'),auth['isAuthenticated'](),controller['getGroups']);router[_0x2bd7('0x7')](_0x2bd7('0x1b'),auth['isAuthenticated'](),controller[_0x2bd7('0x1c')]);router[_0x2bd7('0x7')](_0x2bd7('0x1d'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x1e')]);router[_0x2bd7('0x7')](_0x2bd7('0x1f'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x20')]);router[_0x2bd7('0x7')](_0x2bd7('0x21'),auth['isAuthenticated'](),controller[_0x2bd7('0x22')]);router[_0x2bd7('0x7')](_0x2bd7('0x23'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x24')]);router[_0x2bd7('0x7')](_0x2bd7('0x25'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x26')]);router[_0x2bd7('0x7')](_0x2bd7('0x27'),auth['isAuthenticated'](),controller[_0x2bd7('0x28')]);router[_0x2bd7('0x7')](_0x2bd7('0x29'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0x2bd7('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x2bd7('0x2a')]);router[_0x2bd7('0x7')](_0x2bd7('0x2b'),auth['isAuthenticated'](),controller[_0x2bd7('0x2c')]);router['get'](_0x2bd7('0x2d'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x2e')]);router['get'](_0x2bd7('0x2f'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x2bd7('0x7')](_0x2bd7('0x30'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x31')]);router[_0x2bd7('0x7')](_0x2bd7('0x32'),auth['isAuthenticated'](),controller[_0x2bd7('0x33')]);router[_0x2bd7('0x7')](_0x2bd7('0x34'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x35')]);router['get']('/:id/sms_accounts',auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x2bd7('0x7')](_0x2bd7('0x36'),auth['isAuthenticated'](),controller[_0x2bd7('0x37')]);router[_0x2bd7('0x7')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x2bd7('0x38')]);router[_0x2bd7('0x7')](_0x2bd7('0x39'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x3a')]);router['get'](_0x2bd7('0x3b'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x3c')]);router['get'](_0x2bd7('0x3d'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x3e')]);router[_0x2bd7('0x3f')]('/:id/contacts',auth[_0x2bd7('0x8')](),controller['addContacts']);router[_0x2bd7('0x3f')]('/',auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x40')]);router[_0x2bd7('0x3f')]('/create_many',auth['isAuthenticated'](),controller[_0x2bd7('0x41')]);router[_0x2bd7('0x3f')]('/:id/queues',auth['isAuthenticated'](),controller[_0x2bd7('0x42')]);var upload=multer({'storage':multer[_0x2bd7('0x43')]({'destination':function(_0x3389cf,_0x27b5a2,_0x586497){_0x586497(null,path['join'](config[_0x2bd7('0x44')],'server/files/images/'));},'filename':function(_0x2ab3d3,_0x2470a9,_0x1d7222){_0x1d7222(null,util['format'](_0x2bd7('0x45'),Date[_0x2bd7('0x46')](),_0x2470a9['originalname']));}})});router[_0x2bd7('0x3f')](_0x2bd7('0x11'),upload[_0x2bd7('0x47')](_0x2bd7('0x48')),controller['addAvatar']);router[_0x2bd7('0x3f')](_0x2bd7('0x49'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x4a')]);router[_0x2bd7('0x3f')](_0x2bd7('0x4b'),auth['isAuthenticated'](),controller['logout']);router[_0x2bd7('0x3f')](_0x2bd7('0x4c'),auth['isAuthenticated'](),controller[_0x2bd7('0x4d')]);router[_0x2bd7('0x3f')](_0x2bd7('0x4e'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x4f')]);router['post'](_0x2bd7('0x50'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x51')]);router[_0x2bd7('0x3f')](_0x2bd7('0x52'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x53')]);router[_0x2bd7('0x3f')](_0x2bd7('0x54'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x2bd7('0x3f')](_0x2bd7('0x55'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x56')]);router['post'](_0x2bd7('0x57'),auth[_0x2bd7('0x8')](),controller['addSmsInteractions']);router[_0x2bd7('0x3f')](_0x2bd7('0x58'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router['post'](_0x2bd7('0x59'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x5a')]);router[_0x2bd7('0x3f')](_0x2bd7('0x30'),auth[_0x2bd7('0x8')](),controller['addFaxAccounts']);router[_0x2bd7('0x3f')](_0x2bd7('0x32'),auth[_0x2bd7('0x8')](),controller['addMailAccounts']);router[_0x2bd7('0x3f')](_0x2bd7('0x34'),auth['isAuthenticated'](),controller[_0x2bd7('0x5b')]);router[_0x2bd7('0x3f')](_0x2bd7('0x5c'),auth['isAuthenticated'](),controller[_0x2bd7('0x5d')]);router[_0x2bd7('0x3f')](_0x2bd7('0x36'),auth['isAuthenticated'](),controller[_0x2bd7('0x5e')]);router['post'](_0x2bd7('0x5f'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x60')]);router['post'](_0x2bd7('0x39'),auth['isAuthenticated'](),controller[_0x2bd7('0x61')]);router[_0x2bd7('0x3f')](_0x2bd7('0x3d'),auth[_0x2bd7('0x8')](),controller['createApiKey']);router[_0x2bd7('0x62')](_0x2bd7('0xf'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x63')]);router[_0x2bd7('0x62')]('/:id/password',auth[_0x2bd7('0x8')](),controller['changePassword']);router['delete'](_0x2bd7('0x16'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x64')]);router[_0x2bd7('0x65')](_0x2bd7('0x50'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x66')]);router[_0x2bd7('0x65')](_0x2bd7('0xf'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x67')]);router[_0x2bd7('0x65')](_0x2bd7('0x52'),auth['isAuthenticated'](),controller[_0x2bd7('0x68')]);router['delete'](_0x2bd7('0x54'),auth[_0x2bd7('0x8')](),controller['removeMailInteractions']);router['delete']('/:id/fax_interactions',auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x69')]);router[_0x2bd7('0x65')](_0x2bd7('0x57'),auth['isAuthenticated'](),controller[_0x2bd7('0x6a')]);router[_0x2bd7('0x65')](_0x2bd7('0x58'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x6b')]);router[_0x2bd7('0x65')](_0x2bd7('0x59'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x6c')]);router[_0x2bd7('0x65')]('/:id/fax_accounts',auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x6d')]);router[_0x2bd7('0x65')](_0x2bd7('0x32'),auth[_0x2bd7('0x8')](),controller['removeMailAccounts']);router['delete'](_0x2bd7('0x34'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x6e')]);router[_0x2bd7('0x65')](_0x2bd7('0x5c'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x6f')]);router['delete'](_0x2bd7('0x36'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x70')]);router['delete'](_0x2bd7('0x5f'),auth[_0x2bd7('0x8')](),controller['removeWhatsappAccounts']);router[_0x2bd7('0x65')](_0x2bd7('0x39'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x71')]);router[_0x2bd7('0x65')](_0x2bd7('0x3d'),auth[_0x2bd7('0x8')](),controller[_0x2bd7('0x72')]);module[_0x2bd7('0x73')]=router; \ No newline at end of file +var _0xe3d8=['diskStorage','join','root','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','logout','pause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','update','/:id/password','changePassword','removeTeams','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','/:id/contacts','addContacts','create','/create_many','post','addQueues'];(function(_0x56f972,_0x49b459){var _0xf415ef=function(_0x5e30f5){while(--_0x5e30f5){_0x56f972['push'](_0x56f972['shift']());}};_0xf415ef(++_0x49b459);}(_0xe3d8,0xaf));var _0x8e3d=function(_0x15b74b,_0x4347b7){_0x15b74b=_0x15b74b-0x0;var _0x2b55e0=_0xe3d8[_0x15b74b];return _0x2b55e0;};'use strict';var multer=require(_0x8e3d('0x0'));var util=require(_0x8e3d('0x1'));var path=require(_0x8e3d('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e3d('0x3'));var router=express[_0x8e3d('0x4')]();var fs_extra=require(_0x8e3d('0x5'));var auth=require(_0x8e3d('0x6'));var interaction=require(_0x8e3d('0x7'));var config=require('../../config/environment');var controller=require(_0x8e3d('0x8'));router[_0x8e3d('0x9')]('/',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0xb')]);router[_0x8e3d('0x9')](_0x8e3d('0xc'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0xd')]);router[_0x8e3d('0x9')]('/whoami',auth['isAuthenticated'](),controller[_0x8e3d('0xe')]);router[_0x8e3d('0x9')](_0x8e3d('0xf'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x10')]);router[_0x8e3d('0x9')](_0x8e3d('0x11'),auth['isAuthenticated'](),controller[_0x8e3d('0x12')]);router['get'](_0x8e3d('0x13'),controller['getAvatar']);router[_0x8e3d('0x9')](_0x8e3d('0x14'),auth[_0x8e3d('0xa')](),controller['getOpenTabs']);router[_0x8e3d('0x9')]('/:id/contacts',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x15')]);router[_0x8e3d('0x9')](_0x8e3d('0x16'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x17')]);router[_0x8e3d('0x9')](_0x8e3d('0x18'),auth[_0x8e3d('0xa')](),controller['getVoiceQueuesRt']);router[_0x8e3d('0x9')](_0x8e3d('0x19'),auth['isAuthenticated'](),controller[_0x8e3d('0x1a')]);router['get'](_0x8e3d('0x1b'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x1c')]);router[_0x8e3d('0x9')](_0x8e3d('0x1d'),auth['isAuthenticated'](),controller[_0x8e3d('0x1e')]);router[_0x8e3d('0x9')]('/:id/chat/interactions',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x1f')]);router['get'](_0x8e3d('0x20'),auth['isAuthenticated'](),controller[_0x8e3d('0x21')]);router[_0x8e3d('0x9')](_0x8e3d('0x22'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x23')]);router['get'](_0x8e3d('0x24'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x25')]);router[_0x8e3d('0x9')]('/:id/fax/interactions',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x26')]);router['get'](_0x8e3d('0x27'),auth[_0x8e3d('0xa')](),controller['getWhatsappInteractions']);router[_0x8e3d('0x9')]('/:id/teams',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x28')]);router[_0x8e3d('0x9')](_0x8e3d('0x29'),auth['isAuthenticated'](),controller[_0x8e3d('0x2a')]);router['get'](_0x8e3d('0x2b'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x2c')]);router[_0x8e3d('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x8e3d('0x9')](_0x8e3d('0x2d'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x2e')]);router[_0x8e3d('0x9')](_0x8e3d('0x2f'),auth['isAuthenticated'](),controller['getMailAccounts']);router['get'](_0x8e3d('0x30'),auth[_0x8e3d('0xa')](),controller['getOpenchannelAccounts']);router[_0x8e3d('0x9')]('/:id/sms_accounts',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x31')]);router[_0x8e3d('0x9')](_0x8e3d('0x32'),auth['isAuthenticated'](),controller[_0x8e3d('0x33')]);router[_0x8e3d('0x9')](_0x8e3d('0x34'),auth['isAuthenticated'](),controller[_0x8e3d('0x35')]);router[_0x8e3d('0x9')](_0x8e3d('0x36'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x37')]);router[_0x8e3d('0x9')](_0x8e3d('0x38'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x39')]);router[_0x8e3d('0x9')](_0x8e3d('0x3a'),auth[_0x8e3d('0xa')](),controller['getApiKey']);router['post'](_0x8e3d('0x3b'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x3c')]);router['post']('/',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x3d')]);router['post'](_0x8e3d('0x3e'),auth[_0x8e3d('0xa')](),controller['bulkCreate']);router[_0x8e3d('0x3f')](_0x8e3d('0x16'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x40')]);var upload=multer({'storage':multer[_0x8e3d('0x41')]({'destination':function(_0x3fcf4e,_0x328986,_0x188efc){_0x188efc(null,path[_0x8e3d('0x42')](config[_0x8e3d('0x43')],'server/files/images/'));},'filename':function(_0x235ae2,_0x4f42a0,_0x1735ea){_0x1735ea(null,util[_0x8e3d('0x44')](_0x8e3d('0x45'),Date[_0x8e3d('0x46')](),_0x4f42a0[_0x8e3d('0x47')]));}})});router[_0x8e3d('0x3f')](_0x8e3d('0x13'),upload[_0x8e3d('0x48')](_0x8e3d('0x49')),controller['addAvatar']);router['post'](_0x8e3d('0x4a'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x4b')]);router['post'](_0x8e3d('0x4c'),auth['isAuthenticated'](),controller[_0x8e3d('0x4d')]);router[_0x8e3d('0x3f')]('/:id/pause',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x4e')]);router[_0x8e3d('0x3f')]('/:id/unpause',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x4f')]);router['post'](_0x8e3d('0x50'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x51')]);router[_0x8e3d('0x3f')](_0x8e3d('0x52'),auth['isAuthenticated'](),controller[_0x8e3d('0x53')]);router[_0x8e3d('0x3f')](_0x8e3d('0x54'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x55')]);router[_0x8e3d('0x3f')](_0x8e3d('0x56'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x57')]);router[_0x8e3d('0x3f')](_0x8e3d('0x58'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x59')]);router[_0x8e3d('0x3f')](_0x8e3d('0x5a'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x5b')]);router['post'](_0x8e3d('0x5c'),auth['isAuthenticated'](),controller[_0x8e3d('0x5d')]);router[_0x8e3d('0x3f')](_0x8e3d('0x2d'),auth['isAuthenticated'](),controller[_0x8e3d('0x5e')]);router[_0x8e3d('0x3f')](_0x8e3d('0x2f'),auth['isAuthenticated'](),controller[_0x8e3d('0x5f')]);router['post'](_0x8e3d('0x30'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x60')]);router['post'](_0x8e3d('0x61'),auth[_0x8e3d('0xa')](),controller['addSmsAccounts']);router[_0x8e3d('0x3f')](_0x8e3d('0x32'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x8e3d('0x3f')]('/:id/whatsapp_accounts',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x62')]);router[_0x8e3d('0x3f')]('/:id/square_projects',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x63')]);router[_0x8e3d('0x3f')](_0x8e3d('0x3a'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x64')]);router['put'](_0x8e3d('0x11'),auth['isAuthenticated'](),controller[_0x8e3d('0x65')]);router['put'](_0x8e3d('0x66'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x67')]);router['delete'](_0x8e3d('0x16'),auth[_0x8e3d('0xa')](),controller['removeQueues']);router['delete'](_0x8e3d('0x50'),auth['isAuthenticated'](),controller[_0x8e3d('0x68')]);router[_0x8e3d('0x69')](_0x8e3d('0x11'),auth['isAuthenticated'](),controller[_0x8e3d('0x6a')]);router['delete'](_0x8e3d('0x52'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x6b')]);router[_0x8e3d('0x69')]('/:id/mail_interactions',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x6c')]);router[_0x8e3d('0x69')](_0x8e3d('0x56'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x6d')]);router[_0x8e3d('0x69')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x8e3d('0x6e')]);router[_0x8e3d('0x69')](_0x8e3d('0x5a'),auth[_0x8e3d('0xa')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x8e3d('0x6f')]);router[_0x8e3d('0x69')]('/:id/fax_accounts',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x70')]);router[_0x8e3d('0x69')](_0x8e3d('0x2f'),auth['isAuthenticated'](),controller[_0x8e3d('0x71')]);router[_0x8e3d('0x69')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x72')]);router[_0x8e3d('0x69')](_0x8e3d('0x32'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x73')]);router['delete'](_0x8e3d('0x34'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x74')]);router[_0x8e3d('0x69')](_0x8e3d('0x36'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x75')]);router[_0x8e3d('0x69')](_0x8e3d('0x3a'),auth[_0x8e3d('0xa')](),controller[_0x8e3d('0x76')]);module[_0x8e3d('0x77')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 601e76b..d0590fc 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 _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 6267ee7..2153237 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 _0xb7cc=['find','fax','mail','body','describe','addContacts','ids','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','QueryTypes','from','mailbox','VoiceMail','fullname','email','agent','permissions','101','102','103','104','105','107','108','109','114','115','create','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','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','isEmpty','compact','oldPassword','newPassword','Sequelize','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','voice','SIP/%s','voicePause','UserVoiceQueueRt','upsert','isValidChannel','isArray','Queue:remove','addAvatar','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','whatsapp','CHAT','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MAIL','createdAt','SMS','WhatsappOpenTabs','concat','CmContact','intersection','order','sort','pick','merge','options','getContacts','hasOwnProperty','CmList','Tags','color','tag','nolimit','getQueues','Queue','Queues','getVoiceQueuesRt','ChatGroup','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','QueuePause','DEFAULT\x20PAUSE','bulkCreate','unpause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','addTeams','omit','Team','getVoiceQueues','setDataValue','getChatQueues','Chat','getMailQueues','Mail','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','addAgent','Voice','getDataValue','TeamVoicePrefix','UserVoicePrefix','removeTeams','getSmsQueues','transaction','removeAgent','destroy','VoicePrefixId','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','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','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','$and','$or','$gt','$lte','$ne','$between','$notIn','$iLike','$notILike','$like','$overlap','$contained','$any','CmHopper','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','json','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','getUserSetting','getPresence','teams','queues','VoiceQueue','inbound','col','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','pause','unknown','unavailable','ringing','voiceStatus','slice','charAt','select','field','ui.','InteractionId','user_has_','_interactions','OpenTabs','bluebird','util','path','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','localhost','client','http','request','then','debug','request\x20sent','error','User,\x20%s,\x20%s','message','catch','status','end','offset','undefined','limit','count','set','Content-Range','update','get','role','admin','Users','user','Agents','Telephones','telephone','ignore','map','value','includes','name','sendStatus','stack','send','User','rawAttributes','fieldName','type','key','filter','password','getOptions','where','query','includeAll','include','userSetting','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','sms','dataValues','openchannel','all','show','params','keys','filters','model','fields','true'];(function(_0xfeb39,_0x1d20b7){var _0x167aa8=function(_0x54b506){while(--_0x54b506){_0xfeb39['push'](_0xfeb39['shift']());}};_0x167aa8(++_0x1d20b7);}(_0xb7cc,0x13f));var _0xcb7c=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xb7cc[_0x4b73a2];return _0x383c66;};'use strict';var moment=require('moment');var BPromise=require(_0xcb7c('0x0'));var util=require(_0xcb7c('0x1'));var path=require(_0xcb7c('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcb7c('0x3'));var jayson=require('jayson/promise');var Redis=require(_0xcb7c('0x4'));var authService=require('../../components/auth/service');var qs=require(_0xcb7c('0x5'));var logger=require(_0xcb7c('0x6'))(_0xcb7c('0x7'));var utils=require(_0xcb7c('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0xcb7c('0x9'));var db=require(_0xcb7c('0xa'))['db'];var socket=require(_0xcb7c('0xb'))(new Redis(config[_0xcb7c('0xc')]));require(_0xcb7c('0xd'))['register'](socket);config[_0xcb7c('0xc')]=_['defaults'](config[_0xcb7c('0xc')],{'host':_0xcb7c('0xe'),'port':0x18eb});var client=jayson[_0xcb7c('0xf')][_0xcb7c('0x10')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2cf0b7,_0x12cb43,_0x2c7c27,_0x2979e1){return new BPromise(function(_0x577adc,_0x4d6211){var _0x12bf7c=_0x2979e1||client;return _0x12bf7c[_0xcb7c('0x11')](_0x2cf0b7,_0x2c7c27)[_0xcb7c('0x12')](function(_0x27ff94){logger['info']('User,\x20%s,\x20%s',_0x12cb43,'request\x20sent');logger[_0xcb7c('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x12cb43,_0xcb7c('0x14'),JSON['stringify'](_0x27ff94));if(_0x27ff94[_0xcb7c('0x15')]){if(_0x27ff94[_0xcb7c('0x15')]['code']===0x1f4){logger[_0xcb7c('0x15')](_0xcb7c('0x16'),_0x12cb43,_0x27ff94[_0xcb7c('0x15')][_0xcb7c('0x17')]);return _0x4d6211(_0x27ff94[_0xcb7c('0x15')][_0xcb7c('0x17')]);}logger[_0xcb7c('0x15')](_0xcb7c('0x16'),_0x12cb43,_0x27ff94[_0xcb7c('0x15')][_0xcb7c('0x17')]);return _0x577adc(_0x27ff94[_0xcb7c('0x15')][_0xcb7c('0x17')]);}else{logger['info'](_0xcb7c('0x16'),_0x12cb43,_0xcb7c('0x14'));_0x577adc(_0x27ff94['result'][_0xcb7c('0x17')]);}})[_0xcb7c('0x18')](function(_0x3c028e){logger[_0xcb7c('0x15')](_0xcb7c('0x16'),_0x12cb43,_0x3c028e);_0x4d6211(_0x3c028e);});});}function respondWithStatusCode(_0x4ebe1a,_0x43502b){_0x43502b=_0x43502b||0xcc;return function(_0x4d3634){if(_0x4d3634){return _0x4ebe1a['sendStatus'](_0x43502b);}return _0x4ebe1a[_0xcb7c('0x19')](_0x43502b)[_0xcb7c('0x1a')]();};}function respondWithResult(_0x4a5a32,_0x24f1b4){_0x24f1b4=_0x24f1b4||0xc8;return function(_0x20db83){if(_0x20db83){return _0x4a5a32[_0xcb7c('0x19')](_0x24f1b4)['json'](_0x20db83);}};}function respondWithFilteredResult(_0x5cdb40,_0x146d16){return function(_0x2868c5){if(_0x2868c5){var _0xa671a=typeof _0x146d16[_0xcb7c('0x1b')]===_0xcb7c('0x1c')&&typeof _0x146d16[_0xcb7c('0x1d')]===_0xcb7c('0x1c');var _0x25a846=_0x2868c5['count'];var _0x48ea34=_0xa671a?0x0:_0x146d16[_0xcb7c('0x1b')];var _0x5a3629=_0xa671a?_0x2868c5[_0xcb7c('0x1e')]:_0x146d16[_0xcb7c('0x1b')]+_0x146d16[_0xcb7c('0x1d')];var _0x508acd;if(_0x5a3629>=_0x25a846){_0x5a3629=_0x25a846;_0x508acd=0xc8;}else{_0x508acd=0xce;}_0x5cdb40[_0xcb7c('0x19')](_0x508acd);return _0x5cdb40[_0xcb7c('0x1f')](_0xcb7c('0x20'),_0x48ea34+'-'+_0x5a3629+'/'+_0x25a846)['json'](_0x2868c5);}return null;};}function saveUpdates(_0x3348b6){return function(_0x4bf53d){if(_0x4bf53d){return _0x4bf53d[_0xcb7c('0x21')](_0x3348b6)[_0xcb7c('0x12')](function(_0x29c373){return _0x29c373;});}return null;};}function removeEntity(_0x56e72d){return function(_0x2bbe7f){if(_0x2bbe7f){return _0x2bbe7f['destroy']()[_0xcb7c('0x12')](function(){var _0x5e06db=_0x2bbe7f[_0xcb7c('0x22')]({'plain':!![]});if(_0x5e06db[_0xcb7c('0x23')]===_0xcb7c('0x24'))return;var _0x35c593=[{'name':_0xcb7c('0x25'),'value':_0xcb7c('0x26'),'ignore':!![]},{'name':_0xcb7c('0x27'),'value':'agent','ignore':![]},{'name':_0xcb7c('0x28'),'value':_0xcb7c('0x29'),'ignore':![]}];var _0x5c104d=_(_0x35c593)['filter'](_0xcb7c('0x2a'))[_0xcb7c('0x2b')](_0xcb7c('0x2c'))[_0xcb7c('0x2c')]();if(_[_0xcb7c('0x2d')](_0x5c104d,_0x5e06db[_0xcb7c('0x23')])){return;}var _0x3f6e2e=_['find'](_0x35c593,['value',_0x5e06db[_0xcb7c('0x23')]])[_0xcb7c('0x2e')];return db['UserProfileResource']['destroy']({'where':{'type':_0x3f6e2e,'resourceId':_0x5e06db['id']}})[_0xcb7c('0x12')](function(){return _0x2bbe7f;});})['then'](function(){_0x56e72d[_0xcb7c('0x19')](0xcc)[_0xcb7c('0x1a')]();});}};}function handleEntityNotFound(_0x51754d){return function(_0xb70740){if(!_0xb70740){_0x51754d[_0xcb7c('0x2f')](0x194);}return _0xb70740;};}function handleError(_0x8ae472,_0x57eb2c){_0x57eb2c=_0x57eb2c||0x1f4;return function(_0x50963){logger[_0xcb7c('0x15')](_0x50963[_0xcb7c('0x30')]);if(_0x50963[_0xcb7c('0x2e')]){delete _0x50963[_0xcb7c('0x2e')];}_0x8ae472[_0xcb7c('0x19')](_0x57eb2c)[_0xcb7c('0x31')](_0x50963);};}exports['index']=function(_0x54e5d7,_0x3840b9){var _0x2f9245={},_0x1f97e4={'count':0x0,'rows':[]};var _0x58bc1b=_(db[_0xcb7c('0x32')][_0xcb7c('0x33')])[_0xcb7c('0x2b')](function(_0x4e8266){return{'name':_0x4e8266[_0xcb7c('0x34')],'type':_0x4e8266[_0xcb7c('0x35')][_0xcb7c('0x36')]};})[_0xcb7c('0x37')](function(_0x1b87bf){return!_[_0xcb7c('0x2d')]([_0xcb7c('0x38'),'salt'],_0x1b87bf[_0xcb7c('0x2e')]);})[_0xcb7c('0x2c')]();_0x2f9245=qs[_0xcb7c('0x39')](_0x58bc1b,_0x54e5d7);var _0x50d07c={'where':_0x2f9245[_0xcb7c('0x3a')]};return db[_0xcb7c('0x32')][_0xcb7c('0x1e')](_0x50d07c)[_0xcb7c('0x12')](function(_0x3dd7b6){_0x1f97e4[_0xcb7c('0x1e')]=_0x3dd7b6;if(_0x54e5d7[_0xcb7c('0x3b')][_0xcb7c('0x3c')]){_0x2f9245[_0xcb7c('0x3d')]=[{'all':!![]}];}if(_0x54e5d7[_0xcb7c('0x3b')][_0xcb7c('0x3e')]==='true'){_0x2f9245[_0xcb7c('0x3d')]=[{'model':db[_0xcb7c('0x3f')],'as':'userSetting'}];}if(!_[_0xcb7c('0x2d')](_0x2f9245[_0xcb7c('0x40')],'id')){_0x2f9245[_0xcb7c('0x40')][_0xcb7c('0x41')]('id');}return db[_0xcb7c('0x32')][_0xcb7c('0x42')](_0x2f9245);})[_0xcb7c('0x12')](function(_0x2f9f2c){_0x1f97e4[_0xcb7c('0x43')]=_0x2f9f2c;if(_0x54e5d7['query'][_0xcb7c('0x44')]==='true'){var _0x143343=[];for(var _0x4ba801=0x0;_0x4ba801<_0x1f97e4[_0xcb7c('0x43')][_0xcb7c('0x45')];_0x4ba801++){_0x143343['push'](get_open_tabs(_0xcb7c('0x46'),_0x1f97e4[_0xcb7c('0x43')][_0x4ba801]['dataValues']));_0x143343[_0xcb7c('0x41')](get_open_tabs(_0xcb7c('0x47'),_0x1f97e4[_0xcb7c('0x43')][_0x4ba801][_0xcb7c('0x48')]));_0x143343[_0xcb7c('0x41')](get_open_tabs('fax',_0x1f97e4[_0xcb7c('0x43')][_0x4ba801]['dataValues']));_0x143343[_0xcb7c('0x41')](get_open_tabs('mail',_0x1f97e4[_0xcb7c('0x43')][_0x4ba801][_0xcb7c('0x48')]));_0x143343[_0xcb7c('0x41')](get_open_tabs(_0xcb7c('0x49'),_0x1f97e4[_0xcb7c('0x43')][_0x4ba801][_0xcb7c('0x48')]));_0x143343[_0xcb7c('0x41')](get_open_tabs('whatsapp',_0x1f97e4[_0xcb7c('0x43')][_0x4ba801][_0xcb7c('0x48')]));}return BPromise[_0xcb7c('0x4a')](_0x143343)['then'](function(){return _0x1f97e4;});}else{return _0x1f97e4;}})[_0xcb7c('0x12')](respondWithFilteredResult(_0x3840b9,_0x2f9245))[_0xcb7c('0x18')](handleError(_0x3840b9,null));};exports[_0xcb7c('0x4b')]=function(_0x549e18,_0x19bb03){var _0x44395c={'raw':![],'where':{'id':_0x549e18[_0xcb7c('0x4c')]['id']}},_0x21f5a4={};_0x21f5a4['model']=_['differenceBy'](_['keys'](db[_0xcb7c('0x32')][_0xcb7c('0x33')]),[_0xcb7c('0x38'),'salt']);_0x21f5a4[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x549e18['query']);_0x21f5a4[_0xcb7c('0x4e')]=_['intersection'](_0x21f5a4[_0xcb7c('0x4f')],_0x21f5a4[_0xcb7c('0x3b')]);_0x44395c[_0xcb7c('0x40')]=_['intersection'](_0x21f5a4['model'],qs['fields'](_0x549e18[_0xcb7c('0x3b')][_0xcb7c('0x50')]));_0x44395c[_0xcb7c('0x40')]=_0x44395c[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x44395c[_0xcb7c('0x40')]:_0x21f5a4['model'];if(_0x549e18[_0xcb7c('0x3b')][_0xcb7c('0x3c')]){_0x44395c[_0xcb7c('0x3d')]=[{'all':!![]}];}if(_0x549e18[_0xcb7c('0x3b')][_0xcb7c('0x3e')]===_0xcb7c('0x51')){_0x44395c[_0xcb7c('0x3d')]=[{'model':db[_0xcb7c('0x3f')],'as':_0xcb7c('0x3e')}];}_0x44395c=_['merge']({},_0x44395c,_0x549e18['options']);if(!_['includes'](_0x44395c['attributes'],'id')){_0x44395c[_0xcb7c('0x40')]['push']('id');}return db[_0xcb7c('0x32')][_0xcb7c('0x52')](_0x44395c)[_0xcb7c('0x12')](handleEntityNotFound(_0x19bb03,null))[_0xcb7c('0x12')](function(_0x1e3ae5){var _0x12223c=[];values=_0x1e3ae5;if(_0x549e18[_0xcb7c('0x3b')]['openTabs']===_0xcb7c('0x51')){_0x12223c[_0xcb7c('0x41')](get_open_tabs('chat',_0x1e3ae5[_0xcb7c('0x48')]));_0x12223c[_0xcb7c('0x41')](get_open_tabs(_0xcb7c('0x47'),_0x1e3ae5[_0xcb7c('0x48')]));_0x12223c['push'](get_open_tabs(_0xcb7c('0x49'),_0x1e3ae5[_0xcb7c('0x48')]));_0x12223c[_0xcb7c('0x41')](get_open_tabs('whatsapp',_0x1e3ae5[_0xcb7c('0x48')]));_0x12223c['push'](get_open_tabs(_0xcb7c('0x53'),_0x1e3ae5['dataValues']));_0x12223c['push'](get_open_tabs(_0xcb7c('0x54'),_0x1e3ae5[_0xcb7c('0x48')]));return BPromise[_0xcb7c('0x4a')](_0x12223c);}else{return values;}})[_0xcb7c('0x12')](function(){return values;})[_0xcb7c('0x12')](respondWithResult(_0x19bb03,null))[_0xcb7c('0x18')](handleError(_0x19bb03,null));};exports['update']=function(_0x1b52c8,_0x1fd4e7){if(_0x1b52c8[_0xcb7c('0x55')]['id']){delete _0x1b52c8['body']['id'];}delete _0x1b52c8[_0xcb7c('0x55')][_0xcb7c('0x23')];return db[_0xcb7c('0x32')]['find']({'where':{'id':_0x1b52c8[_0xcb7c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1fd4e7,null))[_0xcb7c('0x12')](saveUpdates(_0x1b52c8[_0xcb7c('0x55')],null))[_0xcb7c('0x12')](respondWithResult(_0x1fd4e7,null))['catch'](handleError(_0x1fd4e7,null));};exports['describe']=function(_0xb90dc8,_0x124b78){return db['User'][_0xcb7c('0x56')]()[_0xcb7c('0x12')](respondWithResult(_0x124b78,null))[_0xcb7c('0x18')](handleError(_0x124b78,null));};exports[_0xcb7c('0x57')]=function(_0x3214f4,_0x2051fa){return db[_0xcb7c('0x32')]['find']({'where':{'id':_0x3214f4[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x2051fa,null))[_0xcb7c('0x12')](function(_0xb691b1){if(_0xb691b1){return _0xb691b1['addContacts'](_0x3214f4['body'][_0xcb7c('0x58')],_['omit'](_0x3214f4[_0xcb7c('0x55')],['ids','id'])||{});}})[_0xcb7c('0x12')](respondWithResult(_0x2051fa,null))[_0xcb7c('0x18')](handleError(_0x2051fa,null));};function validateUser(_0x1bfd92){return new BPromise(function(_0x92124a,_0x2b843c){if(_0x1bfd92[_0xcb7c('0x59')])return _0x92124a(_0x1bfd92);return db[_0xcb7c('0x5a')][_0xcb7c('0x5b')](0x1)[_0xcb7c('0x12')](function(_0x84d367){if(_0x84d367[_0xcb7c('0x5c')])authService['validatePasswordPattern'](_0x1bfd92[_0xcb7c('0x38')]);db[_0xcb7c('0x32')][_0xcb7c('0x5d')](_0xcb7c('0x59'))['then'](function(_0xe2ecfa){if(_[_0xcb7c('0x5e')](_0xe2ecfa)){_0x1bfd92[_0xcb7c('0x59')]=_0x84d367[_0xcb7c('0x5f')]||0x1;return;}if(_[_0xcb7c('0x5e')](_0x84d367[_0xcb7c('0x5f')])||_0x84d367[_0xcb7c('0x5f')]===_0xe2ecfa){_0x1bfd92[_0xcb7c('0x59')]=_0xe2ecfa+0x1;return;}if(_0x84d367[_0xcb7c('0x5f')]>_0xe2ecfa){_0x1bfd92[_0xcb7c('0x59')]=_0x84d367[_0xcb7c('0x5f')];return;}return db[_0xcb7c('0x60')][_0xcb7c('0x3b')]('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[_0xcb7c('0x60')][_0xcb7c('0x61')]['SELECT']})['then'](function(_0x502511){if(_0x502511&&_0x502511[_0xcb7c('0x45')]){for(var _0xccdd48=0x0,_0x39a72e=_0x502511[_0xcb7c('0x45')];_0xccdd48<_0x39a72e&&_[_0xcb7c('0x5e')](_0x1bfd92['internal']);_0xccdd48++){if(_0x84d367['min_internal']<=_0x502511[_0xccdd48][_0xcb7c('0x62')]){_0x1bfd92[_0xcb7c('0x59')]=_0x502511[_0xccdd48]['from'];}else if(_0x84d367[_0xcb7c('0x5f')]>_0x502511[_0xccdd48][_0xcb7c('0x62')]&&_0x84d367[_0xcb7c('0x5f')]<=_0x502511[_0xccdd48]['to']){_0x1bfd92['internal']=_0x84d367[_0xcb7c('0x5f')];}}}if(_[_0xcb7c('0x5e')](_0x1bfd92[_0xcb7c('0x59')])){_0x1bfd92[_0xcb7c('0x59')]=_0xe2ecfa+0x1;}return _0x92124a(_0x1bfd92);});});})[_0xcb7c('0x18')](function(_0x49cda6){_0x2b843c(_0x49cda6);});});}function updateUser(_0x9f279b){return new BPromise(function(_0x42c6b9,_0x2af16c){try{if(_0x9f279b['voicemail']){_0x9f279b[_0xcb7c('0x63')]=_0x9f279b[_0xcb7c('0x59')];_0x9f279b[_0xcb7c('0x64')]={'mailbox':_0x9f279b[_0xcb7c('0x59')],'password':_0x9f279b['password'],'fullname':_0x9f279b[_0xcb7c('0x65')],'email':_0x9f279b[_0xcb7c('0x66')]};}if(_0x9f279b[_0xcb7c('0x23')]===_0xcb7c('0x67')){if(!_0x9f279b['permissions'])_0x9f279b[_0xcb7c('0x68')]=[_0xcb7c('0x69'),_0xcb7c('0x6a'),_0xcb7c('0x6b'),'113','110',_0xcb7c('0x6c'),_0xcb7c('0x6d'),'106',_0xcb7c('0x6e'),_0xcb7c('0x6f'),_0xcb7c('0x70'),'100','111',_0xcb7c('0x71'),_0xcb7c('0x72')];}_0x42c6b9(_0x9f279b);}catch(_0x4a868f){_0x2af16c(_0x4a868f);}});}exports[_0xcb7c('0x73')]=function(_0x6af342,_0x3e257d){if(_0x6af342[_0xcb7c('0x26')][_0xcb7c('0x23')]==='agent')throw new Error('Unauthorized');if(_0x6af342[_0xcb7c('0x55')][_0xcb7c('0x23')]==='user'&&_0x6af342[_0xcb7c('0x26')][_0xcb7c('0x23')]!=='admin'){throw new Error(_0xcb7c('0x74'));}if(_0x6af342[_0xcb7c('0x55')]['role']===_0xcb7c('0x24')&&_0x6af342[_0xcb7c('0x26')][_0xcb7c('0x23')]!==_0xcb7c('0x24')){throw new Error(_0xcb7c('0x75'));}return licenseUtil[_0xcb7c('0x76')]([_0x6af342[_0xcb7c('0x55')]])['then'](function(){return validateUser(_0x6af342[_0xcb7c('0x55')]);})[_0xcb7c('0x12')](function(_0x25c2ad){return updateUser(_0x25c2ad)[_0xcb7c('0x12')](function(_0x491225){if(_0x491225[_0xcb7c('0x23')]===_0xcb7c('0x24')){_0x491225[_0xcb7c('0x77')]=_0x6af342[_0xcb7c('0x26')][_0xcb7c('0x77')];delete _0x491225['userProfileId'];}return _0x491225;});})[_0xcb7c('0x12')](function(_0x353da4){return db[_0xcb7c('0x32')][_0xcb7c('0x73')](_0x353da4,{'include':[{'model':db[_0xcb7c('0x64')],'as':_0xcb7c('0x64')}]});})[_0xcb7c('0x12')](function(_0x47a88d){if(_0x6af342[_0xcb7c('0x55')][_0xcb7c('0x23')]==='user')return _0x47a88d;if(_0x6af342[_0xcb7c('0x26')][_0xcb7c('0x23')]!=='user')return _0x47a88d;return db[_0xcb7c('0x78')]['find']({'where':{'name':_0x47a88d['role']==='agent'?_0xcb7c('0x27'):_0xcb7c('0x28'),'userProfileId':_0x6af342[_0xcb7c('0x26')][_0xcb7c('0x79')]},'raw':!![]})[_0xcb7c('0x12')](function(_0x17f37d){if(!_0x17f37d||_0x17f37d[_0xcb7c('0x7a')]!=0x0)return _0x47a88d;return db[_0xcb7c('0x7b')]['create']({'name':_0x47a88d[_0xcb7c('0x2e')],'resourceId':_0x47a88d['id'],'type':_0x17f37d[_0xcb7c('0x2e')],'sectionId':_0x17f37d['id']},{})['then'](function(){return _0x47a88d;});})[_0xcb7c('0x18')](function(_0x400007){logger[_0xcb7c('0x15')](_0xcb7c('0x7c'),_0x400007);throw _0x400007;});})['then'](respondWithResult(_0x3e257d,0xc9))[_0xcb7c('0x18')](handleError(_0x3e257d,null));};exports['bulkCreate']=function(_0x15b00d,_0x2f9e85){var _0x26d3b2=_0x15b00d[_0xcb7c('0x55')];var _0x3e9e66=[];if(_0x15b00d[_0xcb7c('0x26')][_0xcb7c('0x23')]===_0xcb7c('0x67'))throw new Error('Unauthorized');if(_['some'](_0x26d3b2,[_0xcb7c('0x23'),_0xcb7c('0x26')])&&_0x15b00d[_0xcb7c('0x26')][_0xcb7c('0x23')]!==_0xcb7c('0x24')){throw new Error(_0xcb7c('0x74'));}if(_[_0xcb7c('0x7d')](_0x26d3b2,[_0xcb7c('0x23'),_0xcb7c('0x24')])&&_0x15b00d[_0xcb7c('0x26')]['role']!==_0xcb7c('0x24')){throw new Error(_0xcb7c('0x7e'));}return licenseUtil[_0xcb7c('0x76')](_0x26d3b2)[_0xcb7c('0x12')](function(){return validateUser(_0x26d3b2[0x0]);})[_0xcb7c('0x12')](function(){for(var _0x3e5d9c=0x1;_0x3e5d9c<_0x26d3b2[_0xcb7c('0x45')];_0x3e5d9c++){var _0x3ac61f=_0x26d3b2[_0x3e5d9c-0x1]['internal'];if(!_0x26d3b2[_0x3e5d9c][_0xcb7c('0x59')])_0x26d3b2[_0x3e5d9c]['internal']=_0x3ac61f+0x1;_0x3e9e66[_0xcb7c('0x41')](validateUser(_0x26d3b2[_0x3e5d9c]));}return BPromise[_0xcb7c('0x4a')](_0x3e9e66);})[_0xcb7c('0x12')](function(){_0x3e9e66=[];for(var _0x192807=0x0;_0x192807<_0x26d3b2[_0xcb7c('0x45')];_0x192807++){_0x3e9e66[_0xcb7c('0x41')](updateUser(_0x26d3b2[_0x192807]));}return BPromise[_0xcb7c('0x4a')](_0x3e9e66);})['then'](function(){return BPromise[_0xcb7c('0x7f')](_0x26d3b2,function(_0x231119){return db[_0xcb7c('0x32')][_0xcb7c('0x73')](_0x231119,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0xcb7c('0x12')](function(_0x73e434){_0x231119['id']=_0x73e434['id'];return _0x231119;});});})['then'](function(_0xb5ef10){if(_0x15b00d[_0xcb7c('0x55')][_0xcb7c('0x23')]==='user')return _0xb5ef10;if(_0x15b00d[_0xcb7c('0x26')][_0xcb7c('0x23')]!=='user')return _0xb5ef10;var _0x3e4874=_[_0xcb7c('0x7d')](_0xb5ef10,function(_0x415077){return _0x415077[_0xcb7c('0x23')]===_0xcb7c('0x67')||_0x415077[_0xcb7c('0x23')]===_0xcb7c('0x29');});if(!_0x3e4874)return _0xb5ef10;return db[_0xcb7c('0x78')][_0xcb7c('0x42')]({'where':{'name':{'$or':[_0xcb7c('0x27'),'Telephones']},'userProfileId':_0x15b00d[_0xcb7c('0x26')][_0xcb7c('0x79')]},'raw':!![]})[_0xcb7c('0x12')](function(_0x48a1fa){if(_[_0xcb7c('0x80')](_0x48a1fa)||!_[_0xcb7c('0x7d')](_0x48a1fa,[_0xcb7c('0x7a'),0x0]))return _0xb5ef10;_0x3e9e66=[];var _0x381227=_(_0x48a1fa)[_0xcb7c('0x2b')](function(_0x4727a1){if(_0x4727a1[_0xcb7c('0x7a')]===0x1)return;return _0x4727a1[_0xcb7c('0x2e')]===_0xcb7c('0x27')?_0xcb7c('0x67'):_0xcb7c('0x29');})[_0xcb7c('0x81')]()[_0xcb7c('0x2c')]();for(var _0x46110f=0x0;_0x46110f<_0xb5ef10['length'];_0x46110f++){if(!_['includes'](_0x381227,_0xb5ef10[_0x46110f][_0xcb7c('0x23')]))return;var _0x5d2ca4=_0xb5ef10[_0x46110f][_0xcb7c('0x23')]===_0xcb7c('0x67')?_0xcb7c('0x27'):_0xcb7c('0x28');_0x3e9e66[_0xcb7c('0x41')](db['UserProfileResource'][_0xcb7c('0x73')]({'name':_0xb5ef10[_0x46110f]['name'],'resourceId':_0xb5ef10[_0x46110f]['id'],'type':_0x5d2ca4,'sectionId':_[_0xcb7c('0x52')](_0x48a1fa,[_0xcb7c('0x2e'),_0x5d2ca4])['id']},{}));}return BPromise[_0xcb7c('0x4a')](_0x3e9e66);});})[_0xcb7c('0x12')](respondWithResult(_0x2f9e85,0xc9))[_0xcb7c('0x18')](handleError(_0x2f9e85,null));};exports['changePassword']=function(_0xd4729e,_0x4351c6){if(_0xd4729e['body']['id']){delete _0xd4729e[_0xcb7c('0x55')]['id'];}return db['User'][_0xcb7c('0x52')]({'where':{'id':_0xd4729e['params']['id']}})[_0xcb7c('0x12')](function(_0x38295d){if(!_0x38295d)return null;if(_0x38295d['id']===_0xd4729e[_0xcb7c('0x26')]['id']){if(!_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x82')]||!_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x83')]){throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x38295d['authenticate'](_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x82')])){throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))](_0xcb7c('0x86'));}if(_0xd4729e['body'][_0xcb7c('0x82')]===_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x83')]){throw new db['Sequelize'][(_0xcb7c('0x85'))](_0xcb7c('0x87'));}}else if(_0xd4729e[_0xcb7c('0x26')]['role']==='admin'){if(!_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x83')]){throw new db['Sequelize']['ValidationError'](_0xcb7c('0x88'));}}else if(_0xd4729e[_0xcb7c('0x26')][_0xcb7c('0x23')]===_0xcb7c('0x26')){if(!_0xd4729e['body']['newPassword']){throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))](_0xcb7c('0x88'));}if(_0x38295d[_0xcb7c('0x23')]!=='agent'){throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))](_0xcb7c('0x89'));}}else{throw new db[(_0xcb7c('0x84'))]['ValidationError'](_0xcb7c('0x89'));}return _0x38295d;})[_0xcb7c('0x12')](handleEntityNotFound(_0x4351c6,null))[_0xcb7c('0x12')](function(_0x515578){return db[_0xcb7c('0x5a')][_0xcb7c('0x8a')]({'attributes':['id','securePassword',_0xcb7c('0x8b'),_0xcb7c('0x8c')]})[_0xcb7c('0x12')](function(_0xd2a551){if(_0xd2a551[_0xcb7c('0x5c')])authService[_0xcb7c('0x8d')](_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x83')]);if(!_0xd2a551[_0xcb7c('0x8b')]||!_0x515578['previousPasswords'])return _0x515578;authService[_0xcb7c('0x8e')](_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x83')],_0x515578[_0xcb7c('0x8f')],_0xd2a551['passwordHistoryLimit']);return _0x515578;})[_0xcb7c('0x12')](saveUpdates({'password':_0xd4729e[_0xcb7c('0x55')][_0xcb7c('0x83')],'passwordResetAt':_0xd4729e[_0xcb7c('0x26')]['id']==_0xd4729e[_0xcb7c('0x4c')]['id']?moment():null,'previousPasswords':authService[_0xcb7c('0x90')](_0xd4729e[_0xcb7c('0x55')]['newPassword'],_0x515578[_0xcb7c('0x8f')])},null));})[_0xcb7c('0x12')](respondWithResult(_0x4351c6,null))[_0xcb7c('0x18')](handleError(_0x4351c6,null));};exports[_0xcb7c('0x91')]=function(_0x54d5af,_0x46d2ae){var _0x5cc037=_0x54d5af[_0xcb7c('0x55')][_0xcb7c('0x92')];return db[_0xcb7c('0x32')][_0xcb7c('0x52')]({'where':{'id':_0x54d5af[_0xcb7c('0x4c')]['id']},'attributes':['id','name',_0xcb7c('0x23'),_0xcb7c('0x93'),_0xcb7c('0x94'),'voicePause',_0xcb7c('0x95')]})['then'](handleEntityNotFound(_0x46d2ae,null))[_0xcb7c('0x12')](function(_0x4fade0){if(_0x4fade0){if(!utils['isValidChannel'](_0x5cc037)){throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))](_0xcb7c('0x96'));}return _0x4fade0[_0xcb7c('0x97')+_[_0xcb7c('0x98')](_0x5cc037[_0xcb7c('0x99')]())+'Queues'](_0x54d5af[_0xcb7c('0x55')][_0xcb7c('0x58')],{'penalty':_0x54d5af[_0xcb7c('0x55')][_0xcb7c('0x9a')]||0x0})[_0xcb7c('0x9b')](function(_0x334667){for(var _0x440016=0x0;_0x440016<_0x54d5af['body'][_0xcb7c('0x58')][_0xcb7c('0x45')];_0x440016+=0x1){var _0x3bcea3={'UserId':Number(_0x54d5af[_0xcb7c('0x4c')]['id'])};_0x3bcea3[_['capitalize'](_0x5cc037[_0xcb7c('0x99')]())+_0xcb7c('0x9c')]=Number(_0x54d5af[_0xcb7c('0x55')][_0xcb7c('0x58')][_0x440016]);socket[_0xcb7c('0x9d')](_0xcb7c('0x26')+_[_0xcb7c('0x98')](_0x5cc037['toLowerCase']())+_0xcb7c('0x9e'),_0x3bcea3);}return _0x334667;})[_0xcb7c('0x12')](function(){if(_0x5cc037===_0xcb7c('0x9f')){return db['VoiceQueue'][_0xcb7c('0x42')]({'where':{'id':_0x54d5af[_0xcb7c('0x55')][_0xcb7c('0x58')]||[]},'raw':!![],'attributes':['id',_0xcb7c('0x2e')]});}})[_0xcb7c('0x12')](function(_0x5196bc){var _0x175a74=_0x4fade0[_0xcb7c('0x22')]({'plain':!![]});var _0x559055=[];if(_0x5cc037===_0xcb7c('0x9f')&&_0x175a74[_0xcb7c('0x23')]===_0xcb7c('0x67')&&_0x175a74[_0xcb7c('0x93')]){for(var _0x57f18f=0x0;_0x57f18f<_0x5196bc[_0xcb7c('0x45')];_0x57f18f+=0x1){_0x559055[_0xcb7c('0x41')]({'membername':_0x175a74[_0xcb7c('0x2e')],'UserId':_0x175a74['id'],'queue_name':_0x5196bc[_0x57f18f][_0xcb7c('0x2e')],'VoiceQueueId':_0x5196bc[_0x57f18f]['id'],'interface':_[_0xcb7c('0x5e')](_0x175a74['interface'])?util['format'](_0xcb7c('0xa0'),_0x175a74['name']):_0x175a74[_0xcb7c('0x95')],'paused':_0x175a74[_0xcb7c('0xa1')]||![],'penalty':_0x54d5af[_0xcb7c('0x55')]['penalty']||0x0});}return BPromise[_0xcb7c('0x7f')](_0x559055,function(_0x34f828){return db[_0xcb7c('0xa2')][_0xcb7c('0xa3')](_0x34f828);});}return _0x4fade0;});}})['then'](respondWithStatusCode(_0x46d2ae,null))['catch'](handleError(_0x46d2ae,null));};exports['removeQueues']=function(_0x4d7531,_0x5dcbbe){var _0x555b67,_0x7e575f;return db[_0xcb7c('0x32')][_0xcb7c('0x52')]({'where':{'id':_0x4d7531[_0xcb7c('0x4c')]['id']},'attributes':['id',_0xcb7c('0x2e'),_0xcb7c('0x23')]})[_0xcb7c('0x12')](handleEntityNotFound(_0x5dcbbe,null))['then'](function(_0x38d98b){if(_0x38d98b){_0x555b67=_0x38d98b;if(!_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x92')]||!utils[_0xcb7c('0xa4')](_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x92')])){throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))](_0xcb7c('0x96'));}return _0x38d98b['remove'+_[_0xcb7c('0x98')](_0x4d7531['query'][_0xcb7c('0x92')][_0xcb7c('0x99')]())+'Queues'](_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x58')]);}})[_0xcb7c('0x12')](function(_0x30a2b6){if(_[_0xcb7c('0xa5')](_0x4d7531['query'][_0xcb7c('0x58')])){for(var _0x1b91a4=0x0;_0x1b91a4<_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x58')][_0xcb7c('0x45')];_0x1b91a4+=0x1){_0x7e575f={'UserId':Number(_0x4d7531['params']['id'])};_0x7e575f[_[_0xcb7c('0x98')](_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x92')][_0xcb7c('0x99')]())+_0xcb7c('0x9c')]=Number(_0x4d7531[_0xcb7c('0x3b')]['ids'][_0x1b91a4]);socket[_0xcb7c('0x9d')](_0xcb7c('0x26')+_[_0xcb7c('0x98')](_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x92')][_0xcb7c('0x99')]())+_0xcb7c('0xa6'),_0x7e575f);}}else{_0x7e575f={'UserId':Number(_0x4d7531['params']['id'])};_0x7e575f[_[_0xcb7c('0x98')](_0x4d7531[_0xcb7c('0x3b')]['channel'][_0xcb7c('0x99')]())+'QueueId']=Number(_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x58')]);socket[_0xcb7c('0x9d')](_0xcb7c('0x26')+_['capitalize'](_0x4d7531['query'][_0xcb7c('0x92')][_0xcb7c('0x99')]())+_0xcb7c('0xa6'),_0x7e575f);}return _0x30a2b6;})[_0xcb7c('0x12')](function(){if(_0x4d7531[_0xcb7c('0x3b')][_0xcb7c('0x92')]===_0xcb7c('0x9f')){return db[_0xcb7c('0xa2')]['destroy']({'where':{'UserId':_0x4d7531[_0xcb7c('0x4c')]['id'],'VoiceQueueId':_0x4d7531[_0xcb7c('0x3b')]['ids']},'individualHooks':!![]})[_0xcb7c('0x12')](function(){return _0x555b67;});}return _0x555b67;})[_0xcb7c('0x12')](respondWithStatusCode(_0x5dcbbe,null))[_0xcb7c('0x18')](handleError(_0x5dcbbe,null));};exports[_0xcb7c('0xa7')]=function(_0x11ec40,_0x4feee4){_0x11ec40[_0xcb7c('0x55')]['userpic']=_0x11ec40['file'][_0xcb7c('0xa8')];return db['User'][_0xcb7c('0x52')]({'where':{'id':_0x11ec40[_0xcb7c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4feee4,null))[_0xcb7c('0x12')](saveUpdates(_0x11ec40[_0xcb7c('0x55')],null))[_0xcb7c('0x12')](respondWithResult(_0x4feee4,null))[_0xcb7c('0x18')](handleError(_0x4feee4,null));};exports[_0xcb7c('0xa9')]=function(_0x3e8e83,_0x4c2066){var _0x4665a2=path[_0xcb7c('0xaa')](config[_0xcb7c('0xab')],_0xcb7c('0xac'));return db['User'][_0xcb7c('0x52')]({'where':{'id':_0x3e8e83[_0xcb7c('0x4c')]['id']},'attributes':['id',_0xcb7c('0xad')],'raw':!![]})[_0xcb7c('0x12')](handleEntityNotFound(_0x4c2066,null))[_0xcb7c('0x12')](function(_0x44cf79){if(_0x44cf79){if(_['isNil'](_0x44cf79[_0xcb7c('0xad')])){return _0x4c2066[_0xcb7c('0xae')](_0x4665a2);}else{if(!fs[_0xcb7c('0xaf')](path[_0xcb7c('0xaa')](config['root'],_0xcb7c('0xb0'),_0x44cf79['userpic']))){return _0x4c2066[_0xcb7c('0xae')](_0x4665a2);}return _0x4c2066[_0xcb7c('0xae')](path[_0xcb7c('0xaa')](config[_0xcb7c('0xab')],'server/files/images/',_0x44cf79[_0xcb7c('0xad')]));}}})[_0xcb7c('0x18')](handleError(_0x4c2066,null));};exports[_0xcb7c('0xb1')]=function(_0x3d51d5,_0x1478b5){return db[_0xcb7c('0x32')][_0xcb7c('0x52')]({'where':{'id':_0x3d51d5[_0xcb7c('0x4c')]['id']},'attributes':['id']})[_0xcb7c('0x12')](handleEntityNotFound(_0x1478b5,null))[_0xcb7c('0x12')](function(_0x2fcf51){var _0x542c48=[];values=_0x2fcf51['dataValues'];_0x542c48[_0xcb7c('0x41')](get_open_tabs(_0xcb7c('0x46'),_0x2fcf51[_0xcb7c('0x48')]));_0x542c48[_0xcb7c('0x41')](get_open_tabs('sms',_0x2fcf51['dataValues']));_0x542c48['push'](get_open_tabs(_0xcb7c('0x49'),_0x2fcf51[_0xcb7c('0x48')]));_0x542c48['push'](get_open_tabs(_0xcb7c('0xb2'),_0x2fcf51[_0xcb7c('0x48')]));_0x542c48[_0xcb7c('0x41')](get_open_tabs('fax',_0x2fcf51['dataValues']));_0x542c48[_0xcb7c('0x41')](get_open_tabs(_0xcb7c('0x54'),_0x2fcf51[_0xcb7c('0x48')]));return BPromise[_0xcb7c('0x4a')](_0x542c48);})['then'](function(_0xc6fa55){if(_0xc6fa55){var _0x8a20d3=_[_0xcb7c('0x2b')](values['ChatOpenTabs'],function(_0x287b64){return{'channel':_0xcb7c('0xb3'),'id':_0x287b64['id'],'createdAt':_0x287b64['createdAt']};});var _0x209f93=_[_0xcb7c('0x2b')](values[_0xcb7c('0xb4')],function(_0x533a1f){return{'channel':_0xcb7c('0xb5'),'id':_0x533a1f['id'],'createdAt':_0x533a1f['createdAt']};});var _0x575246=_[_0xcb7c('0x2b')](values[_0xcb7c('0xb6')],function(_0xf3e65d){return{'channel':_0xcb7c('0xb7'),'id':_0xf3e65d['id'],'createdAt':_0xf3e65d['createdAt']};});var _0x30da3=_[_0xcb7c('0x2b')](values['MailOpenTabs'],function(_0x23df85){return{'channel':_0xcb7c('0xb8'),'id':_0x23df85['id'],'createdAt':_0x23df85[_0xcb7c('0xb9')]};});var _0x389e41=_['map'](values['SmsOpenTabs'],function(_0x237b07){return{'channel':_0xcb7c('0xba'),'id':_0x237b07['id'],'createdAt':_0x237b07[_0xcb7c('0xb9')]};});var _0x3fafcb=_[_0xcb7c('0x2b')](values[_0xcb7c('0xbb')],function(_0x1afd01){return{'channel':'WHATSAPP','id':_0x1afd01['id'],'createdAt':_0x1afd01['createdAt']};});var _0x51f756=_[_0xcb7c('0xbc')](_0x8a20d3,_0x209f93,_0x575246,_0x30da3,_0x389e41,_0x3fafcb);var _0x32638c={'count':_0x51f756['length'],'rows':_0x51f756};return _0x32638c;}else return null;})['then'](respondWithResult(_0x1478b5,null))[_0xcb7c('0x18')](handleError(_0x1478b5,null));};exports['getContacts']=function(_0x567574,_0x3ef89a){var _0x4307b7={};var _0x97ff15={};var _0x5557f3;var _0xe3c8fd;return db[_0xcb7c('0x32')]['findOne']({'where':{'id':_0x567574[_0xcb7c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ef89a,null))[_0xcb7c('0x12')](function(_0x4ecee5){if(_0x4ecee5){_0x5557f3=_0x4ecee5;_0x97ff15[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xbd')]['rawAttributes']);_0x97ff15['query']=_[_0xcb7c('0x4d')](_0x567574[_0xcb7c('0x3b')]);_0x97ff15[_0xcb7c('0x4e')]=_['intersection'](_0x97ff15[_0xcb7c('0x4f')],_0x97ff15['query']);_0x4307b7[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x97ff15['model'],qs[_0xcb7c('0x50')](_0x567574[_0xcb7c('0x3b')][_0xcb7c('0x50')]));_0x4307b7[_0xcb7c('0x40')]=_0x4307b7['attributes'][_0xcb7c('0x45')]?_0x4307b7['attributes']:_0x97ff15[_0xcb7c('0x4f')];_0x4307b7[_0xcb7c('0xbf')]=qs['sort'](_0x567574[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x4307b7['where']=qs[_0xcb7c('0x4e')](_[_0xcb7c('0xc1')](_0x567574[_0xcb7c('0x3b')],_0x97ff15['filters']));if(_0x567574[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0x4307b7[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0x4307b7[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0x4307b7['attributes'],function(_0xd3b123){var _0x911a66={};_0x911a66[_0xd3b123]={'$like':'%'+_0x567574[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x911a66;})});}_0x4307b7=_[_0xcb7c('0xc2')]({},_0x4307b7,_0x567574[_0xcb7c('0xc3')]);return _0x5557f3[_0xcb7c('0xc4')](_0x4307b7);}})[_0xcb7c('0x12')](function(_0x341f2c){if(_0x341f2c){_0xe3c8fd=_0x341f2c[_0xcb7c('0x45')];if(_0x567574[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0x3c'))){_0x4307b7['include']=[{'model':db[_0xcb7c('0xc6')],'as':'List','required':![]},{'model':db['Tag'],'as':_0xcb7c('0xc7'),'attributes':['id',_0xcb7c('0x2e'),_0xcb7c('0xc8')],'where':_0x567574[_0xcb7c('0x3b')]['tag']?{'id':_0x567574[_0xcb7c('0x3b')][_0xcb7c('0xc9')]}:undefined,'required':_0x567574[_0xcb7c('0x3b')][_0xcb7c('0xc9')]?!![]:![]}];}if(!_0x567574[_0xcb7c('0x3b')]['hasOwnProperty'](_0xcb7c('0xca'))){_0x4307b7[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x567574[_0xcb7c('0x3b')]['limit']);_0x4307b7['offset']=qs[_0xcb7c('0x1b')](_0x567574[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}return _0x5557f3[_0xcb7c('0xc4')](_0x4307b7);}})[_0xcb7c('0x12')](function(_0x58eb59){if(_0x58eb59){return _0x58eb59?{'count':_0xe3c8fd,'rows':_0x58eb59}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x3ef89a,null))[_0xcb7c('0x18')](handleError(_0x3ef89a,null));};exports[_0xcb7c('0xcb')]=function(_0x27c917,_0x3a5850){var _0x90630d;var _0x3f82be={};var _0x3480dc;return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x27c917[_0xcb7c('0x4c')]['id']},'attributes':['id','name',_0xcb7c('0x23')]})[_0xcb7c('0x12')](handleEntityNotFound(_0x3a5850,null))[_0xcb7c('0x12')](function(_0x3c73ed){if(!utils['isValidChannel'](_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0x92')])){throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))](_0xcb7c('0x96'));}_0x90630d=_0x3c73ed;var _0x3c4349={};_0x3c4349[_0xcb7c('0x4f')]=_['keys'](db[_[_0xcb7c('0x98')](_0x27c917['query'][_0xcb7c('0x92')])+_0xcb7c('0xcc')]['rawAttributes']);_0x3c4349[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x27c917['query']);_0x3c4349[_0xcb7c('0x4e')]=_[_0xcb7c('0xbe')](_0x3c4349[_0xcb7c('0x4f')],_0x3c4349[_0xcb7c('0x3b')]);_0x3f82be[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x3c4349[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0x27c917['query'][_0xcb7c('0x50')]));_0x3f82be[_0xcb7c('0x40')]=_0x3f82be[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x3f82be[_0xcb7c('0x40')]:_0x3c4349[_0xcb7c('0x4f')];_0x3f82be[_0xcb7c('0xbf')]=qs[_0xcb7c('0xc0')](_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x3f82be[_0xcb7c('0x3a')]=qs[_0xcb7c('0x4e')](_[_0xcb7c('0xc1')](_0x27c917['query'],_0x3c4349[_0xcb7c('0x4e')]));if(_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0x3f82be[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0x3f82be[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0x3f82be[_0xcb7c('0x40')],function(_0x3fa342){var _0x447833={};_0x447833[_0x3fa342]={'$like':'%'+_0x27c917['query']['filter']+'%'};return _0x447833;})});}_0x3f82be=_[_0xcb7c('0xc2')]({},_0x3f82be,_0x27c917[_0xcb7c('0xc3')]);switch(_0x90630d[_0xcb7c('0x23')]){case _0xcb7c('0x24'):return db[_[_0xcb7c('0x98')](_0x27c917[_0xcb7c('0x3b')]['channel'])+_0xcb7c('0xcc')][_0xcb7c('0x42')](_0x3f82be);case _0xcb7c('0x26'):case'agent':return _0x90630d[_0xcb7c('0x22')+_[_0xcb7c('0x98')](_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0x92')])+_0xcb7c('0xcd')](_0x3f82be);default:throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))]('Unknown\x20role');}})[_0xcb7c('0x12')](function(_0x49b2db){_0x3480dc=_0x49b2db[_0xcb7c('0x45')];if(!_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0xc5')]('nolimit')){_0x3f82be[_0xcb7c('0x1d')]=qs['limit'](_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0x3f82be[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}switch(_0x90630d[_0xcb7c('0x23')]){case _0xcb7c('0x24'):return db[_[_0xcb7c('0x98')](_0x27c917[_0xcb7c('0x3b')][_0xcb7c('0x92')])+_0xcb7c('0xcc')]['findAll'](_0x3f82be);case _0xcb7c('0x26'):case'agent':return _0x90630d[_0xcb7c('0x22')+_['capitalize'](_0x27c917['query'][_0xcb7c('0x92')])+_0xcb7c('0xcd')](_0x3f82be);}})[_0xcb7c('0x12')](function(_0x543f89){return{'count':_0x3480dc,'rows':_0x543f89};})[_0xcb7c('0x12')](respondWithResult(_0x3a5850,null))['catch'](handleError(_0x3a5850,null));};exports['getVoiceQueuesRt']=function(_0x19f46e,_0x450d86){var _0x119696={};var _0x2cf3a5={};var _0x6afad2;var _0x100209;return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x19f46e['params']['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x450d86,null))[_0xcb7c('0x12')](function(_0x17828e){if(_0x17828e){_0x6afad2=_0x17828e;_0x2cf3a5['model']=_[_0xcb7c('0x4d')](db[_0xcb7c('0xa2')][_0xcb7c('0x33')]);_0x2cf3a5[_0xcb7c('0x3b')]=_['keys'](_0x19f46e[_0xcb7c('0x3b')]);_0x2cf3a5[_0xcb7c('0x4e')]=_[_0xcb7c('0xbe')](_0x2cf3a5[_0xcb7c('0x4f')],_0x2cf3a5[_0xcb7c('0x3b')]);_0x119696['attributes']=_[_0xcb7c('0xbe')](_0x2cf3a5[_0xcb7c('0x4f')],qs['fields'](_0x19f46e[_0xcb7c('0x3b')][_0xcb7c('0x50')]));_0x119696[_0xcb7c('0x40')]=_0x119696['attributes']['length']?_0x119696[_0xcb7c('0x40')]:_0x2cf3a5['model'];_0x119696[_0xcb7c('0xbf')]=qs[_0xcb7c('0xc0')](_0x19f46e[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x119696[_0xcb7c('0x3a')]=qs['filters'](_['pick'](_0x19f46e[_0xcb7c('0x3b')],_0x2cf3a5[_0xcb7c('0x4e')]));if(_0x19f46e['query'][_0xcb7c('0x37')]){_0x119696['where']=_['merge'](_0x119696[_0xcb7c('0x3a')],{'$or':_['map'](_0x119696[_0xcb7c('0x40')],function(_0x1f1654){var _0x1cd653={};_0x1cd653[_0x1f1654]={'$like':'%'+_0x19f46e[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x1cd653;})});}_0x119696=_[_0xcb7c('0xc2')]({},_0x119696,_0x19f46e[_0xcb7c('0xc3')]);return _0x6afad2[_0xcb7c('0xce')](_0x119696);}})[_0xcb7c('0x12')](function(_0xb6196c){if(_0xb6196c){_0x100209=_0xb6196c[_0xcb7c('0x45')];if(!_0x19f46e[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x119696['limit']=qs[_0xcb7c('0x1d')](_0x19f46e[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0x119696['offset']=qs[_0xcb7c('0x1b')](_0x19f46e['query'][_0xcb7c('0x1b')]);}return _0x6afad2[_0xcb7c('0xce')](_0x119696);}})[_0xcb7c('0x12')](function(_0x328267){if(_0x328267){return _0x328267?{'count':_0x100209,'rows':_0x328267}:null;}})['then'](respondWithResult(_0x450d86,null))['catch'](handleError(_0x450d86,null));};exports['getGroups']=function(_0x8c3e5b,_0x537067){var _0x48adac={};var _0x38a941={};var _0xe2ecdf;var _0x9eaaa3;return db['User']['findOne']({'where':{'id':_0x8c3e5b[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x537067,null))[_0xcb7c('0x12')](function(_0x414be1){if(_0x414be1){_0xe2ecdf=_0x414be1;_0x38a941[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xcf')][_0xcb7c('0x33')]);_0x38a941[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x8c3e5b[_0xcb7c('0x3b')]);_0x38a941[_0xcb7c('0x4e')]=_[_0xcb7c('0xbe')](_0x38a941[_0xcb7c('0x4f')],_0x38a941[_0xcb7c('0x3b')]);_0x48adac[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x38a941[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0x8c3e5b['query'][_0xcb7c('0x50')]));_0x48adac[_0xcb7c('0x40')]=_0x48adac[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x48adac[_0xcb7c('0x40')]:_0x38a941[_0xcb7c('0x4f')];_0x48adac[_0xcb7c('0xbf')]=qs[_0xcb7c('0xc0')](_0x8c3e5b[_0xcb7c('0x3b')]['sort']);_0x48adac['where']=qs[_0xcb7c('0x4e')](_[_0xcb7c('0xc1')](_0x8c3e5b[_0xcb7c('0x3b')],_0x38a941[_0xcb7c('0x4e')]));if(_0x8c3e5b[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0x48adac[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0x48adac['where'],{'$or':_[_0xcb7c('0x2b')](_0x48adac[_0xcb7c('0x40')],function(_0x5eba4c){var _0x415e64={};_0x415e64[_0x5eba4c]={'$like':'%'+_0x8c3e5b[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x415e64;})});}_0x48adac=_[_0xcb7c('0xc2')]({},_0x48adac,_0x8c3e5b[_0xcb7c('0xc3')]);return _0xe2ecdf[_0xcb7c('0xd0')](_0x48adac);}})[_0xcb7c('0x12')](function(_0xb05964){if(_0xb05964){_0x9eaaa3=_0xb05964[_0xcb7c('0x45')];if(!_0x8c3e5b['query'][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x48adac['limit']=qs['limit'](_0x8c3e5b['query'][_0xcb7c('0x1d')]);_0x48adac[_0xcb7c('0x1b')]=qs['offset'](_0x8c3e5b[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}return _0xe2ecdf['getGroups'](_0x48adac);}})[_0xcb7c('0x12')](function(_0x391b70){if(_0x391b70){return _0x391b70?{'count':_0x9eaaa3,'rows':_0x391b70}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x537067,null))[_0xcb7c('0x18')](handleError(_0x537067,null));};exports['getRecordings']=function(_0x89dd30,_0x20d4ad){var _0xc31e49={'raw':!![],'where':{}};var _0x4aeba2={};var _0x801265={'count':0x0,'rows':[]};return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x89dd30['params']['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x20d4ad,null))[_0xcb7c('0x12')](function(_0x418fcc){if(_0x418fcc){_0x4aeba2[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xd1')][_0xcb7c('0x33')]);_0x4aeba2[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x89dd30[_0xcb7c('0x3b')]);_0x4aeba2[_0xcb7c('0x4e')]=_[_0xcb7c('0xbe')](_0x4aeba2[_0xcb7c('0x4f')],_0x4aeba2[_0xcb7c('0x3b')]);_0xc31e49[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x4aeba2['model'],qs[_0xcb7c('0x50')](_0x89dd30['query'][_0xcb7c('0x50')]));_0xc31e49[_0xcb7c('0x40')]=_0xc31e49[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0xc31e49[_0xcb7c('0x40')]:_0x4aeba2[_0xcb7c('0x4f')];if(!_0x89dd30[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0xc31e49[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x89dd30[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0xc31e49[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x89dd30['query']['offset']);}_0xc31e49[_0xcb7c('0xbf')]=qs['sort'](_0x89dd30[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0xc31e49[_0xcb7c('0x3a')]=qs[_0xcb7c('0x4e')](_[_0xcb7c('0xc1')](_0x89dd30['query'],_0x4aeba2[_0xcb7c('0x4e')]));_0xc31e49[_0xcb7c('0x3a')][_0xcb7c('0xd2')]=_0x418fcc['id'];if(_0x89dd30[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0xc31e49['where']=_[_0xcb7c('0xc2')](_0xc31e49[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0xc31e49['attributes'],function(_0x13f2d5){var _0x27cc27={};_0x27cc27[_0x13f2d5]={'$like':'%'+_0x89dd30[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x27cc27;})});}_0xc31e49=_[_0xcb7c('0xc2')]({},_0xc31e49,_0x89dd30['options']);return db['VoiceRecording'][_0xcb7c('0x1e')]({'where':_0xc31e49[_0xcb7c('0x3a')]})[_0xcb7c('0x12')](function(_0x16499d){_0x801265[_0xcb7c('0x1e')]=_0x16499d;if(_0x89dd30[_0xcb7c('0x3b')]['includeAll']){_0xc31e49[_0xcb7c('0x3d')]=[{'all':!![]}];}return db[_0xcb7c('0xd1')][_0xcb7c('0x42')](_0xc31e49);})[_0xcb7c('0x12')](function(_0x5b6b36){_0x801265[_0xcb7c('0x43')]=_0x5b6b36;return _0x801265;});}})['then'](respondWithFilteredResult(_0x20d4ad,_0xc31e49))[_0xcb7c('0x18')](handleError(_0x20d4ad,null));};exports[_0xcb7c('0xd3')]=function(_0x587b0d,_0x56f259){var _0x1dca14={'raw':!![],'where':{}};var _0x510f47={};var _0x32ac63={'count':0x0,'rows':[]};return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x587b0d[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x56f259,null))[_0xcb7c('0x12')](function(_0x450a8b){if(_0x450a8b){_0x510f47[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xd4')][_0xcb7c('0x33')]);_0x510f47[_0xcb7c('0x3b')]=_['keys'](_0x587b0d[_0xcb7c('0x3b')]);_0x510f47['filters']=_[_0xcb7c('0xbe')](_0x510f47[_0xcb7c('0x4f')],_0x510f47[_0xcb7c('0x3b')]);_0x1dca14['attributes']=_[_0xcb7c('0xbe')](_0x510f47[_0xcb7c('0x4f')],qs['fields'](_0x587b0d[_0xcb7c('0x3b')]['fields']));_0x1dca14[_0xcb7c('0x40')]=_0x1dca14[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x1dca14[_0xcb7c('0x40')]:_0x510f47[_0xcb7c('0x4f')];if(!_0x587b0d[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x1dca14[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x587b0d['query'][_0xcb7c('0x1d')]);_0x1dca14[_0xcb7c('0x1b')]=qs['offset'](_0x587b0d[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}_0x1dca14['order']=qs['sort'](_0x587b0d[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x1dca14[_0xcb7c('0x3a')]=qs['filters'](_[_0xcb7c('0xc1')](_0x587b0d[_0xcb7c('0x3b')],_0x510f47[_0xcb7c('0x4e')]));_0x1dca14['where'][_0xcb7c('0xd2')]=_0x450a8b['id'];if(_0x587b0d[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0x1dca14[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0x1dca14[_0xcb7c('0x3a')],{'$or':_['map'](_0x1dca14[_0xcb7c('0x40')],function(_0x324c86){var _0x2619ce={};_0x2619ce[_0x324c86]={'$like':'%'+_0x587b0d[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x2619ce;})});}_0x1dca14=_[_0xcb7c('0xc2')]({},_0x1dca14,_0x587b0d[_0xcb7c('0xc3')]);return db[_0xcb7c('0xd4')][_0xcb7c('0x1e')]({'where':_0x1dca14[_0xcb7c('0x3a')]})['then'](function(_0x57dcee){_0x32ac63[_0xcb7c('0x1e')]=_0x57dcee;if(_0x587b0d[_0xcb7c('0x3b')][_0xcb7c('0x3c')]){_0x1dca14[_0xcb7c('0x3d')]=[{'all':!![]}];}return db['ScreenRecording'][_0xcb7c('0x42')](_0x1dca14);})[_0xcb7c('0x12')](function(_0x354665){_0x32ac63[_0xcb7c('0x43')]=_0x354665;return _0x32ac63;});}})[_0xcb7c('0x12')](respondWithFilteredResult(_0x56f259,_0x1dca14))[_0xcb7c('0x18')](handleError(_0x56f259,null));};exports['getChatInteractions']=function(_0x155d29,_0x2869cb){var _0x3b9273={};var _0x49216e={};var _0x82e409;var _0x58c755;return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x155d29[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x2869cb,null))[_0xcb7c('0x12')](function(_0x27a1d3){if(_0x27a1d3){_0x82e409=_0x27a1d3;_0x49216e[_0xcb7c('0x4f')]=_['keys'](db[_0xcb7c('0xd5')][_0xcb7c('0x33')]);_0x49216e['query']=_['keys'](_0x155d29[_0xcb7c('0x3b')]);_0x49216e[_0xcb7c('0x4e')]=_[_0xcb7c('0xbe')](_0x49216e['model'],_0x49216e[_0xcb7c('0x3b')]);_0x3b9273[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x49216e[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0x155d29['query'][_0xcb7c('0x50')]));_0x3b9273[_0xcb7c('0x40')]=_0x3b9273[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x3b9273['attributes']:_0x49216e[_0xcb7c('0x4f')];_0x3b9273['order']=qs[_0xcb7c('0xc0')](_0x155d29[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x3b9273['where']=qs[_0xcb7c('0x4e')](_[_0xcb7c('0xc1')](_0x155d29[_0xcb7c('0x3b')],_0x49216e[_0xcb7c('0x4e')]));if(_0x155d29['query']['filter']){_0x3b9273[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0x3b9273[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0x3b9273['attributes'],function(_0x3dd415){var _0x193f30={};_0x193f30[_0x3dd415]={'$like':'%'+_0x155d29['query'][_0xcb7c('0x37')]+'%'};return _0x193f30;})});}_0x3b9273=_[_0xcb7c('0xc2')]({},_0x3b9273,_0x155d29[_0xcb7c('0xc3')]);return _0x82e409[_0xcb7c('0xd6')](_0x3b9273);}})[_0xcb7c('0x12')](function(_0x220758){if(_0x220758){_0x58c755=_0x220758[_0xcb7c('0x45')];if(!_0x155d29[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x3b9273[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x155d29[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0x3b9273[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x155d29['query'][_0xcb7c('0x1b')]);}return _0x82e409['getChatInteractions'](_0x3b9273);}})[_0xcb7c('0x12')](function(_0x2dab34){if(_0x2dab34){return _0x2dab34?{'count':_0x58c755,'rows':_0x2dab34}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x2869cb,null))['catch'](handleError(_0x2869cb,null));};exports['getOpenchannelInteractions']=function(_0x27ceb5,_0x1e6467){var _0x84b89d={};var _0x4c99ca={};var _0x3e2f47;var _0x1b6f5c;return db['User'][_0xcb7c('0x8a')]({'where':{'id':_0x27ceb5[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x1e6467,null))[_0xcb7c('0x12')](function(_0x5d50cc){if(_0x5d50cc){_0x3e2f47=_0x5d50cc;_0x4c99ca['model']=_[_0xcb7c('0x4d')](db[_0xcb7c('0xd7')][_0xcb7c('0x33')]);_0x4c99ca[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x27ceb5[_0xcb7c('0x3b')]);_0x4c99ca['filters']=_[_0xcb7c('0xbe')](_0x4c99ca[_0xcb7c('0x4f')],_0x4c99ca[_0xcb7c('0x3b')]);_0x84b89d['attributes']=_[_0xcb7c('0xbe')](_0x4c99ca[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0x27ceb5['query'][_0xcb7c('0x50')]));_0x84b89d['attributes']=_0x84b89d[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x84b89d['attributes']:_0x4c99ca[_0xcb7c('0x4f')];_0x84b89d['order']=qs[_0xcb7c('0xc0')](_0x27ceb5[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x84b89d[_0xcb7c('0x3a')]=qs[_0xcb7c('0x4e')](_['pick'](_0x27ceb5[_0xcb7c('0x3b')],_0x4c99ca[_0xcb7c('0x4e')]));if(_0x27ceb5[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0x84b89d['where']=_[_0xcb7c('0xc2')](_0x84b89d[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0x84b89d[_0xcb7c('0x40')],function(_0x437ddc){var _0x3a1323={};_0x3a1323[_0x437ddc]={'$like':'%'+_0x27ceb5[_0xcb7c('0x3b')]['filter']+'%'};return _0x3a1323;})});}_0x84b89d=_[_0xcb7c('0xc2')]({},_0x84b89d,_0x27ceb5[_0xcb7c('0xc3')]);return _0x3e2f47[_0xcb7c('0xd8')](_0x84b89d);}})[_0xcb7c('0x12')](function(_0x48b68c){if(_0x48b68c){_0x1b6f5c=_0x48b68c[_0xcb7c('0x45')];if(!_0x27ceb5[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x84b89d['limit']=qs[_0xcb7c('0x1d')](_0x27ceb5['query']['limit']);_0x84b89d[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x27ceb5[_0xcb7c('0x3b')]['offset']);}return _0x3e2f47[_0xcb7c('0xd8')](_0x84b89d);}})[_0xcb7c('0x12')](function(_0x3e03d1){if(_0x3e03d1){return _0x3e03d1?{'count':_0x1b6f5c,'rows':_0x3e03d1}:null;}})['then'](respondWithResult(_0x1e6467,null))[_0xcb7c('0x18')](handleError(_0x1e6467,null));};exports['getMailInteractions']=function(_0x9560a1,_0x12672d){var _0x9c3eff={'raw':!![],'where':{}};var _0x4ae1ab={};var _0x40d075={'count':0x0,'rows':[]};return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x9560a1[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x12672d,null))[_0xcb7c('0x12')](function(_0x4f402e){if(_0x4f402e){_0x4ae1ab['model']=_['keys'](db[_0xcb7c('0xd9')][_0xcb7c('0x33')]);_0x4ae1ab[_0xcb7c('0x3b')]=_['keys'](_0x9560a1[_0xcb7c('0x3b')]);_0x4ae1ab[_0xcb7c('0x4e')]=_[_0xcb7c('0xbe')](_0x4ae1ab[_0xcb7c('0x4f')],_0x4ae1ab[_0xcb7c('0x3b')]);_0x9c3eff[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x4ae1ab[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0x9560a1[_0xcb7c('0x3b')][_0xcb7c('0x50')]));_0x9c3eff[_0xcb7c('0x40')]=_0x9c3eff['attributes'][_0xcb7c('0x45')]?_0x9c3eff['attributes']:_0x4ae1ab[_0xcb7c('0x4f')];if(!_0x9560a1[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x9c3eff[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x9560a1[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0x9c3eff[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x9560a1[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}_0x9c3eff[_0xcb7c('0xbf')]=qs[_0xcb7c('0xc0')](_0x9560a1[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x9c3eff[_0xcb7c('0x3a')]=qs['filters'](_[_0xcb7c('0xc1')](_0x9560a1[_0xcb7c('0x3b')],_0x4ae1ab[_0xcb7c('0x4e')]));_0x9c3eff[_0xcb7c('0x3a')][_0xcb7c('0xd2')]=_0x4f402e['id'];if(_0x9560a1[_0xcb7c('0x3b')]['filter']){_0x9c3eff['where']=_[_0xcb7c('0xc2')](_0x9c3eff[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0x9c3eff[_0xcb7c('0x40')],function(_0x1b7c8b){var _0x3093c0={};_0x3093c0[_0x1b7c8b]={'$like':'%'+_0x9560a1[_0xcb7c('0x3b')]['filter']+'%'};return _0x3093c0;})});}_0x9c3eff=_[_0xcb7c('0xc2')]({},_0x9c3eff,_0x9560a1[_0xcb7c('0xc3')]);return db[_0xcb7c('0xd9')][_0xcb7c('0x1e')]({'where':_0x9c3eff['where']})['then'](function(_0x4f5b33){_0x40d075[_0xcb7c('0x1e')]=_0x4f5b33;if(_0x9560a1[_0xcb7c('0x3b')][_0xcb7c('0x3c')]){_0x9c3eff[_0xcb7c('0x3d')]=[{'all':!![]}];}return db[_0xcb7c('0xd9')]['findAll'](_0x9c3eff);})[_0xcb7c('0x12')](function(_0x2f85bf){_0x40d075[_0xcb7c('0x43')]=_0x2f85bf;return _0x40d075;});}})[_0xcb7c('0x12')](respondWithFilteredResult(_0x12672d,_0x9c3eff))[_0xcb7c('0x18')](handleError(_0x12672d,null));};exports[_0xcb7c('0xda')]=function(_0x13dbd7,_0x2f01ef){var _0x248553={};var _0x39c338={};var _0x425d53;var _0x3e2bcb;return db[_0xcb7c('0x32')]['findOne']({'where':{'id':_0x13dbd7[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x2f01ef,null))[_0xcb7c('0x12')](function(_0x1b5a71){if(_0x1b5a71){_0x425d53=_0x1b5a71;_0x39c338[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xdb')][_0xcb7c('0x33')]);_0x39c338[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x13dbd7[_0xcb7c('0x3b')]);_0x39c338['filters']=_[_0xcb7c('0xbe')](_0x39c338[_0xcb7c('0x4f')],_0x39c338[_0xcb7c('0x3b')]);_0x248553[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x39c338[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0x13dbd7[_0xcb7c('0x3b')]['fields']));_0x248553[_0xcb7c('0x40')]=_0x248553[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x248553['attributes']:_0x39c338[_0xcb7c('0x4f')];_0x248553[_0xcb7c('0xbf')]=qs[_0xcb7c('0xc0')](_0x13dbd7['query']['sort']);_0x248553[_0xcb7c('0x3a')]=qs['filters'](_[_0xcb7c('0xc1')](_0x13dbd7[_0xcb7c('0x3b')],_0x39c338[_0xcb7c('0x4e')]));if(_0x13dbd7[_0xcb7c('0x3b')]['filter']){_0x248553[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0x248553[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0x248553[_0xcb7c('0x40')],function(_0x155ac3){var _0x27777={};_0x27777[_0x155ac3]={'$like':'%'+_0x13dbd7['query'][_0xcb7c('0x37')]+'%'};return _0x27777;})});}_0x248553=_[_0xcb7c('0xc2')]({},_0x248553,_0x13dbd7[_0xcb7c('0xc3')]);return _0x425d53[_0xcb7c('0xda')](_0x248553);}})[_0xcb7c('0x12')](function(_0x2ff93a){if(_0x2ff93a){_0x3e2bcb=_0x2ff93a['length'];if(!_0x13dbd7['query'][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x248553[_0xcb7c('0x1d')]=qs['limit'](_0x13dbd7[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0x248553[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x13dbd7[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}return _0x425d53[_0xcb7c('0xda')](_0x248553);}})['then'](function(_0xaec749){if(_0xaec749){return _0xaec749?{'count':_0x3e2bcb,'rows':_0xaec749}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x2f01ef,null))[_0xcb7c('0x18')](handleError(_0x2f01ef,null));};exports[_0xcb7c('0xdc')]=function(_0x25eacd,_0x3fd8ed){var _0x40e19c={};var _0x50d857={};var _0xd87ca3;var _0x1b2e60;return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x25eacd['params']['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x3fd8ed,null))[_0xcb7c('0x12')](function(_0x19a61d){if(_0x19a61d){_0xd87ca3=_0x19a61d;_0x50d857[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xdd')][_0xcb7c('0x33')]);_0x50d857[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x25eacd[_0xcb7c('0x3b')]);_0x50d857['filters']=_[_0xcb7c('0xbe')](_0x50d857[_0xcb7c('0x4f')],_0x50d857['query']);_0x40e19c[_0xcb7c('0x40')]=_['intersection'](_0x50d857['model'],qs[_0xcb7c('0x50')](_0x25eacd[_0xcb7c('0x3b')][_0xcb7c('0x50')]));_0x40e19c[_0xcb7c('0x40')]=_0x40e19c[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x40e19c[_0xcb7c('0x40')]:_0x50d857[_0xcb7c('0x4f')];_0x40e19c[_0xcb7c('0xbf')]=qs[_0xcb7c('0xc0')](_0x25eacd['query'][_0xcb7c('0xc0')]);_0x40e19c['where']=qs[_0xcb7c('0x4e')](_['pick'](_0x25eacd[_0xcb7c('0x3b')],_0x50d857['filters']));if(_0x25eacd['query']['filter']){_0x40e19c[_0xcb7c('0x3a')]=_['merge'](_0x40e19c[_0xcb7c('0x3a')],{'$or':_['map'](_0x40e19c[_0xcb7c('0x40')],function(_0x1ddaad){var _0x5cad95={};_0x5cad95[_0x1ddaad]={'$like':'%'+_0x25eacd[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x5cad95;})});}_0x40e19c=_[_0xcb7c('0xc2')]({},_0x40e19c,_0x25eacd[_0xcb7c('0xc3')]);return _0xd87ca3[_0xcb7c('0xdc')](_0x40e19c);}})[_0xcb7c('0x12')](function(_0x57c58e){if(_0x57c58e){_0x1b2e60=_0x57c58e[_0xcb7c('0x45')];if(!_0x25eacd[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x40e19c[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x25eacd[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0x40e19c[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x25eacd[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}return _0xd87ca3[_0xcb7c('0xdc')](_0x40e19c);}})[_0xcb7c('0x12')](function(_0x24f6c0){if(_0x24f6c0){return _0x24f6c0?{'count':_0x1b2e60,'rows':_0x24f6c0}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x3fd8ed,null))[_0xcb7c('0x18')](handleError(_0x3fd8ed,null));};exports[_0xcb7c('0xde')]=function(_0x4db3cd,_0x5a2612){var _0x475252={};var _0x192e0f={};var _0x317b33;var _0x3d3cca;return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x4db3cd[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x5a2612,null))[_0xcb7c('0x12')](function(_0x23f694){if(_0x23f694){_0x317b33=_0x23f694;_0x192e0f[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xdf')]['rawAttributes']);_0x192e0f['query']=_[_0xcb7c('0x4d')](_0x4db3cd[_0xcb7c('0x3b')]);_0x192e0f['filters']=_['intersection'](_0x192e0f[_0xcb7c('0x4f')],_0x192e0f[_0xcb7c('0x3b')]);_0x475252['attributes']=_['intersection'](_0x192e0f['model'],qs['fields'](_0x4db3cd['query'][_0xcb7c('0x50')]));_0x475252[_0xcb7c('0x40')]=_0x475252[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0x475252[_0xcb7c('0x40')]:_0x192e0f['model'];_0x475252['order']=qs[_0xcb7c('0xc0')](_0x4db3cd[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0x475252[_0xcb7c('0x3a')]=qs['filters'](_[_0xcb7c('0xc1')](_0x4db3cd[_0xcb7c('0x3b')],_0x192e0f[_0xcb7c('0x4e')]));if(_0x4db3cd[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0x475252['where']=_[_0xcb7c('0xc2')](_0x475252['where'],{'$or':_['map'](_0x475252[_0xcb7c('0x40')],function(_0x1dcee5){var _0x2935e7={};_0x2935e7[_0x1dcee5]={'$like':'%'+_0x4db3cd[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x2935e7;})});}_0x475252=_[_0xcb7c('0xc2')]({},_0x475252,_0x4db3cd['options']);return _0x317b33[_0xcb7c('0xde')](_0x475252);}})['then'](function(_0x5a879b){if(_0x5a879b){_0x3d3cca=_0x5a879b[_0xcb7c('0x45')];if(!_0x4db3cd[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0x475252[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x4db3cd['query']['limit']);_0x475252[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x4db3cd[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}return _0x317b33['getWhatsappInteractions'](_0x475252);}})[_0xcb7c('0x12')](function(_0x3ee66c){if(_0x3ee66c){return _0x3ee66c?{'count':_0x3d3cca,'rows':_0x3ee66c}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x5a2612,null))[_0xcb7c('0x18')](handleError(_0x5a2612,null));};exports[_0xcb7c('0xe0')]=function(_0x18f051,_0x53bbc1,_0x1e4ac0){var _0x1a9e67;var _0x288a7d;var _0x34516a;var _0x3cf387=!_['isNil'](_0x18f051[_0xcb7c('0x4c')]['id'])?_0x18f051['params']['id']:!_[_0xcb7c('0x5e')](_0x18f051[_0xcb7c('0x26')]['id'])?_0x18f051[_0xcb7c('0x26')]['id']:null;return db['User']['find']({'where':{'id':_0x3cf387,'role':{'$or':[_0xcb7c('0x24'),_0xcb7c('0x26'),_0xcb7c('0x67')]}},'attributes':['id',_0xcb7c('0x2e'),_0xcb7c('0xe1'),_0xcb7c('0xe2'),_0xcb7c('0x23'),'internal','loginInPause']})[_0xcb7c('0x12')](function(_0x2d0c74){if(_0x2d0c74){if(_0x2d0c74[_0xcb7c('0x23')]===_0xcb7c('0x67')){_0x1a9e67=_0x2d0c74;if(_0x18f051[_0xcb7c('0x55')][_0xcb7c('0x95')]){_0x34516a=util[_0xcb7c('0xe3')](_0xcb7c('0xe4'),_0x1a9e67[_0x18f051[_0xcb7c('0x55')]['interface']]);}else if(_0x18f051[_0xcb7c('0x55')]['intrf']){_0x34516a=util['format'](_0xcb7c('0xa0'),_0x18f051[_0xcb7c('0x55')][_0xcb7c('0xe5')]);}else{_0x34516a=util[_0xcb7c('0xe3')](_0xcb7c('0xa0'),_0x1a9e67['name']);}socket['to'](util[_0xcb7c('0xe3')](_0xcb7c('0xe6'),_0x1a9e67[_0xcb7c('0x2e')]))[_0xcb7c('0x9d')]('user:forcelogout',{'user':{'id':_0x1a9e67['id'],'name':_0x1a9e67['name']},'ip':_0x18f051[_0xcb7c('0xe7')][_0xcb7c('0xe8')]||_0x18f051[_0xcb7c('0xe9')][_0xcb7c('0xea')]||_0x18f051[_0xcb7c('0xeb')][_0xcb7c('0xea')]||_0x18f051[_0xcb7c('0xe9')]['socket'][_0xcb7c('0xea')]});return db[_0xcb7c('0xa2')]['destroy']({'where':{'membername':_0x1a9e67[_0xcb7c('0x2e')]},'individualHooks':!![]});}}else{throw new db[(_0xcb7c('0x84'))][(_0xcb7c('0x85'))](_0xcb7c('0xec'));}})['then'](function(){if(_0x1a9e67){return _0x1a9e67['getVoiceQueues']({'raw':!![]});}})[_0xcb7c('0x12')](function(_0x14d4b5){if(_0x1a9e67){var _0x383ee0=[];if(_0x14d4b5){_0x288a7d=_0x14d4b5;if(_0x288a7d[_0xcb7c('0x45')]){for(var _0xa59a07=0x0;_0xa59a07<_0x288a7d[_0xcb7c('0x45')];_0xa59a07++){_0x383ee0[_0xcb7c('0x41')]({'membername':_0x1a9e67[_0xcb7c('0x2e')],'UserId':_0x1a9e67['id'],'queue_name':_0x288a7d[_0xa59a07][_0xcb7c('0x2e')],'VoiceQueueId':_0x288a7d[_0xa59a07]['id'],'interface':_0x34516a,'paused':_0x1a9e67['loginInPause']||![],'penalty':_0x288a7d[_0xa59a07]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0xcb7c('0x7f')](_0x383ee0,function(_0x46d8a3){return db[_0xcb7c('0xa2')][_0xcb7c('0xa3')](_0x46d8a3);});}}}})[_0xcb7c('0x12')](function(){if(_0x1a9e67){return db['MemberReport'][_0xcb7c('0x42')]({'where':{'membername':_0x1a9e67[_0xcb7c('0x2e')],'exitAt':null}});}})[_0xcb7c('0x12')](function(_0x7ec0b3){if(_0x1a9e67){var _0x41eb07=[];_0x7ec0b3[_0xcb7c('0xed')](function(_0x197394){_0x41eb07['push'](_0x197394[_0xcb7c('0x21')]({'exitAt':moment()['format'](_0xcb7c('0xee'))}));});return BPromise[_0xcb7c('0x4a')](_0x41eb07);}})[_0xcb7c('0x12')](function(){if(_0x1a9e67){var _0x42f6a6=[];var _0x4ec465=[];var _0x100b83=utils[_0xcb7c('0xef')]();var _0x57eb1f={'membername':_0x1a9e67[_0xcb7c('0x2e')],'interface':_0x34516a,'enterAt':moment()[_0xcb7c('0xe3')](_0xcb7c('0xee')),'role':_0x1a9e67[_0xcb7c('0x23')],'internal':_0x1a9e67[_0xcb7c('0x59')]};_0x100b83['forEach'](function(_0x3ccf46){_0x42f6a6[_0xcb7c('0x41')](_[_0xcb7c('0xc2')]({'channel':_0x3ccf46,'type':_0xcb7c('0xf0'),'data1':_0x18f051[_0xcb7c('0x55')]['device'],'data2':_0x34516a},_0x57eb1f));if(_0x1a9e67[_0xcb7c('0x94')]){_0x4ec465[_0xcb7c('0x41')](_[_0xcb7c('0xc2')]({'channel':_0x3ccf46,'type':_0xcb7c('0xf1'),'data1':_0xcb7c('0xf2')},_0x57eb1f));}});return db[_0xcb7c('0xf3')]['bulkCreate'](_0x42f6a6['concat'](_0x4ec465),{'individualHooks':!![]});}})[_0xcb7c('0x12')](function(){if(_0x1a9e67){return _0x1a9e67[_0xcb7c('0x21')]({'online':!![],'lastLoginAt':moment()[_0xcb7c('0xe3')](_0xcb7c('0xee')),'voicePause':_0x1a9e67[_0xcb7c('0x94')]||![],'mailPause':_0x1a9e67[_0xcb7c('0x94')]||![],'chatPause':_0x1a9e67[_0xcb7c('0x94')]||![],'faxPause':_0x1a9e67[_0xcb7c('0x94')]||![],'smsPause':_0x1a9e67[_0xcb7c('0x94')]||![],'openchannelPause':_0x1a9e67['loginInPause']||![],'whatsappPause':_0x1a9e67[_0xcb7c('0x94')]||![],'pauseType':_0x1a9e67['loginInPause']?_0xcb7c('0xf2'):null,'interface':_0x34516a,'lastPauseAt':moment()[_0xcb7c('0xe3')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xcb7c('0x12')](function(_0x310e53){if(_0x18f051[_0xcb7c('0xf4')]){return _0x1e4ac0();}else{return BPromise[_0xcb7c('0xf5')](_0x310e53)[_0xcb7c('0x12')](respondWithResult(_0x53bbc1,null));}})[_0xcb7c('0x18')](handleError(_0x53bbc1,null));};exports[_0xcb7c('0xf6')]=function(_0x4cebf7,_0x251fe4){var _0x2b0450;return db['User'][_0xcb7c('0x52')]({'where':{'id':_0x4cebf7[_0xcb7c('0x4c')]['id'],'role':_0xcb7c('0x67')},'attributes':['id',_0xcb7c('0x2e'),_0xcb7c('0x23')]})[_0xcb7c('0x12')](handleEntityNotFound(_0x251fe4,null))[_0xcb7c('0x12')](function(_0xfe0e0){if(_0xfe0e0){_0x2b0450=_0xfe0e0;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x2b0450[_0xcb7c('0x2e')]},'individualHooks':!![]});}})[_0xcb7c('0x12')](function(){return db[_0xcb7c('0xf3')][_0xcb7c('0x42')]({'where':{'membername':_0x2b0450[_0xcb7c('0x2e')],'exitAt':null}});})[_0xcb7c('0x12')](function(_0x10d181){var _0x4099f7=[];_0x10d181[_0xcb7c('0xed')](function(_0x2f12ef){_0x4099f7[_0xcb7c('0x41')](_0x2f12ef[_0xcb7c('0x21')]({'exitAt':moment()[_0xcb7c('0xe3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xcb7c('0x4a')](_0x4099f7);})['then'](function(){return _0x2b0450[_0xcb7c('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x251fe4,null))[_0xcb7c('0x18')](handleError(_0x251fe4,null));};exports['pause']=function(_0x35c5d9,_0x5cf3b9){var _0x744e91;return db[_0xcb7c('0xa2')][_0xcb7c('0x21')]({'paused':0x1},{'where':{'UserId':_0x35c5d9[_0xcb7c('0x4c')]['id']},'individualHooks':!![]})[_0xcb7c('0x12')](function(){return db[_0xcb7c('0x32')]['find']({'where':{'id':_0x35c5d9[_0xcb7c('0x4c')]['id'],'role':_0xcb7c('0x67')},'attributes':['id',_0xcb7c('0x2e'),'role',_0xcb7c('0x59'),_0xcb7c('0x95')]});})[_0xcb7c('0x12')](handleEntityNotFound(_0x5cf3b9,null))[_0xcb7c('0x12')](function(_0x4782e8){if(_0x4782e8){_0x744e91=_0x4782e8;return respondWithRpcPromise(_0xcb7c('0xf7'),'pause',{'id':_0x744e91['id'],'name':_0x744e91['name'],'pause':!![]});}})[_0xcb7c('0x12')](function(){if(_0x744e91){return db[_0xcb7c('0xf3')]['findAll']({'where':{'membername':_0x744e91[_0xcb7c('0x2e')],'type':_0xcb7c('0xf1'),'exitAt':null}});}})['then'](function(_0x7a979e){if(_0x7a979e[_0xcb7c('0x45')]){var _0x35a061=moment()[_0xcb7c('0xe3')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x42c6a6=0x0,_0x1fdd54=_0x7a979e[_0xcb7c('0x45')];_0x42c6a6<_0x1fdd54;_0x42c6a6++){_0x7a979e[_0x42c6a6]['updateAttributes']({'exitAt':_0x35a061});}}})[_0xcb7c('0x12')](function(){var _0x4dd540=[];var _0x3a5c85=utils[_0xcb7c('0xef')]();_0x3a5c85[_0xcb7c('0xed')](function(_0x4f325a){_0x4dd540[_0xcb7c('0x41')]({'channel':_0x4f325a,'membername':_0x744e91[_0xcb7c('0x2e')],'interface':_[_0xcb7c('0x5e')](_0x744e91[_0xcb7c('0x95')])?util[_0xcb7c('0xe3')](_0xcb7c('0xa0'),_0x744e91['name']):_0x744e91[_0xcb7c('0x95')],'type':'PAUSE','enterAt':moment()[_0xcb7c('0xe3')](_0xcb7c('0xee')),'data1':_0x35c5d9[_0xcb7c('0x55')][_0xcb7c('0x35')]||_0xcb7c('0xf8'),'role':_0x744e91[_0xcb7c('0x23')],'internal':_0x744e91['internal']});});return db[_0xcb7c('0xf3')][_0xcb7c('0xf9')](_0x4dd540,{'individualHooks':!![]});})['then'](function(){return _0x744e91[_0xcb7c('0x21')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x35c5d9['body']['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xcb7c('0xee'))});})['then'](respondWithResult(_0x5cf3b9,null))[_0xcb7c('0x18')](handleError(_0x5cf3b9,null));};exports[_0xcb7c('0xfa')]=function(_0x46d47a,_0x13d699){var _0x2daaac;return db['User'][_0xcb7c('0x52')]({'where':{'id':_0x46d47a['params']['id']},'attributes':['id','name',_0xcb7c('0x23'),_0xcb7c('0xa1'),'mailPause',_0xcb7c('0xfb'),_0xcb7c('0xfc'),_0xcb7c('0xfd'),_0xcb7c('0xfe'),_0xcb7c('0xff'),_0xcb7c('0x100'),_0xcb7c('0x101')]})[_0xcb7c('0x12')](handleEntityNotFound(_0x13d699,null))[_0xcb7c('0x12')](function(_0x12c4cb){if(_0x12c4cb){_0x2daaac=_0x12c4cb;if(_0x46d47a[_0xcb7c('0x55')][_0xcb7c('0x92')]&&!utils[_0xcb7c('0xa4')](_0x46d47a['body'][_0xcb7c('0x92')])){throw new db[(_0xcb7c('0x84'))]['ValidationError'](_0xcb7c('0x96'));}switch(_0x46d47a[_0xcb7c('0x55')]['channel']){case'voice':return respondWithRpcPromise(_0xcb7c('0xf7'),'unpause',{'id':_0x2daaac['id'],'name':_0x2daaac['name'],'pause':![]})[_0xcb7c('0x12')](function(){return db[_0xcb7c('0xa2')][_0xcb7c('0x21')]({'paused':0x0},{'where':{'UserId':_0x2daaac['id']},'individualHooks':!![]});})[_0xcb7c('0x12')](function(){return db['MemberReport'][_0xcb7c('0x52')]({'where':{'channel':_0x46d47a[_0xcb7c('0x55')]['channel'],'membername':_0x2daaac[_0xcb7c('0x2e')],'type':_0xcb7c('0xf1'),'exitAt':null}});})[_0xcb7c('0x12')](function(_0x511292){if(_0x511292){return _0x511292['update']({'exitAt':moment()[_0xcb7c('0xe3')](_0xcb7c('0xee')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x2daaac[_0xcb7c('0x21')]({'voicePause':![]});});case _0xcb7c('0x54'):case _0xcb7c('0x46'):case _0xcb7c('0x53'):case'sms':case _0xcb7c('0xb2'):case _0xcb7c('0x49'):return db[_0xcb7c('0xf3')][_0xcb7c('0x52')]({'where':{'channel':_0x46d47a[_0xcb7c('0x55')][_0xcb7c('0x92')],'membername':_0x2daaac['name'],'type':_0xcb7c('0xf1'),'exitAt':null}})[_0xcb7c('0x12')](function(_0x5e018f){if(_0x5e018f){return _0x5e018f[_0xcb7c('0x21')]({'exitAt':moment()[_0xcb7c('0xe3')](_0xcb7c('0xee')),'data2':_0xcb7c('0x102')},{'individualHooks':!![]});}return null;})[_0xcb7c('0x12')](function(){var _0x173946={};_[_0xcb7c('0x1f')](_0x173946,util['format'](_0xcb7c('0x103'),_0x46d47a[_0xcb7c('0x55')]['channel'],_0xcb7c('0x104')),![]);return _0x2daaac['update'](_0x173946);});default:return respondWithRpcPromise(_0xcb7c('0xf7'),_0xcb7c('0xfa'),{'id':_0x2daaac['id'],'name':_0x2daaac[_0xcb7c('0x2e')],'pause':![]})['then'](function(){return db[_0xcb7c('0xa2')]['update']({'paused':0x0},{'where':{'UserId':_0x2daaac['id']}});})[_0xcb7c('0x12')](function(){return db['MemberReport'][_0xcb7c('0x42')]({'where':{'membername':_0x2daaac[_0xcb7c('0x2e')],'type':_0xcb7c('0xf1'),'exitAt':null}});})[_0xcb7c('0x12')](function(_0x59fba3){var _0x21867a=[];_0x59fba3[_0xcb7c('0xed')](function(_0x3057dc){_0x21867a['push'](_0x3057dc[_0xcb7c('0x21')]({'exitAt':moment()['format'](_0xcb7c('0xee')),'data2':_0xcb7c('0x102')}));});return BPromise[_0xcb7c('0x4a')](_0x21867a);})['then'](function(){return _0x2daaac[_0xcb7c('0x21')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xcb7c('0x12')](respondWithResult(_0x13d699,null))[_0xcb7c('0x18')](handleError(_0x13d699,null));};exports[_0xcb7c('0x105')]=function(_0xcfa5db,_0x348cbb){var _0xa5f8f2={};var _0x5db0d8={};var _0x14ce47;var _0x576b44;return db['User'][_0xcb7c('0x8a')]({'where':{'id':_0xcfa5db[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x348cbb,null))[_0xcb7c('0x12')](function(_0x3be4a2){if(_0x3be4a2){_0x14ce47=_0x3be4a2;_0x5db0d8[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db['Team'][_0xcb7c('0x33')]);_0x5db0d8[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0xcfa5db['query']);_0x5db0d8['filters']=_[_0xcb7c('0xbe')](_0x5db0d8['model'],_0x5db0d8['query']);_0xa5f8f2[_0xcb7c('0x40')]=_['intersection'](_0x5db0d8[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0xcfa5db[_0xcb7c('0x3b')][_0xcb7c('0x50')]));_0xa5f8f2[_0xcb7c('0x40')]=_0xa5f8f2['attributes']['length']?_0xa5f8f2[_0xcb7c('0x40')]:_0x5db0d8[_0xcb7c('0x4f')];_0xa5f8f2[_0xcb7c('0xbf')]=qs[_0xcb7c('0xc0')](_0xcfa5db[_0xcb7c('0x3b')]['sort']);_0xa5f8f2[_0xcb7c('0x3a')]=qs['filters'](_[_0xcb7c('0xc1')](_0xcfa5db[_0xcb7c('0x3b')],_0x5db0d8[_0xcb7c('0x4e')]));if(_0xcfa5db[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0xa5f8f2[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0xa5f8f2['where'],{'$or':_[_0xcb7c('0x2b')](_0xa5f8f2[_0xcb7c('0x40')],function(_0x517c81){var _0x33e36c={};_0x33e36c[_0x517c81]={'$like':'%'+_0xcfa5db[_0xcb7c('0x3b')]['filter']+'%'};return _0x33e36c;})});}_0xa5f8f2=_[_0xcb7c('0xc2')]({},_0xa5f8f2,_0xcfa5db[_0xcb7c('0xc3')]);return _0x14ce47['getTeams'](_0xa5f8f2);}})['then'](function(_0x20becd){if(_0x20becd){_0x576b44=_0x20becd[_0xcb7c('0x45')];if(!_0xcfa5db[_0xcb7c('0x3b')][_0xcb7c('0xc5')](_0xcb7c('0xca'))){_0xa5f8f2[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0xcfa5db['query'][_0xcb7c('0x1d')]);_0xa5f8f2[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0xcfa5db[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);}return _0x14ce47[_0xcb7c('0x105')](_0xa5f8f2);}})[_0xcb7c('0x12')](function(_0x3f112a){if(_0x3f112a){return _0x3f112a?{'count':_0x576b44,'rows':_0x3f112a}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x348cbb,null))[_0xcb7c('0x18')](handleError(_0x348cbb,null));};exports[_0xcb7c('0x106')]=function(_0x5b6150,_0x3d832f){return db[_0xcb7c('0x32')][_0xcb7c('0x52')]({'where':{'id':_0x5b6150[_0xcb7c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d832f,null))['then'](function(_0x2810dd){if(_0x2810dd){var _0x1cf74f=_0x2810dd['get']({'plain':!![]});return _0x2810dd[_0xcb7c('0x106')](_0x5b6150[_0xcb7c('0x55')]['ids'],_[_0xcb7c('0x107')](_0x5b6150[_0xcb7c('0x55')],['ids','id'])||{})[_0xcb7c('0x12')](function(){for(var _0x41ed86=0x0;_0x41ed86<_0x5b6150[_0xcb7c('0x55')][_0xcb7c('0x58')][_0xcb7c('0x45')];_0x41ed86++){var _0x513d2e=[];var _0x2c7619={};db[_0xcb7c('0x108')][_0xcb7c('0x8a')]({'where':{'id':_0x5b6150[_0xcb7c('0x55')][_0xcb7c('0x58')][_0x41ed86]}})[_0xcb7c('0x12')](function(_0x46c7b4){_0x2c7619=_0x46c7b4['dataValues'];_0x513d2e['push'](_0x46c7b4[_0xcb7c('0x109')]()[_0xcb7c('0x12')](function(_0x44b711){for(var _0x5cffe5=0x0;_0x5cffe5<_0x44b711[_0xcb7c('0x45')];_0x5cffe5++){_0x44b711[_0x5cffe5][_0xcb7c('0x10a')](_0xcb7c('0x92'),'Voice');}return _0x44b711;}));_0x513d2e[_0xcb7c('0x41')](_0x46c7b4[_0xcb7c('0x10b')]()[_0xcb7c('0x12')](function(_0xd36bf8){for(var _0x47621a=0x0;_0x47621a<_0xd36bf8[_0xcb7c('0x45')];_0x47621a++){_0xd36bf8[_0x47621a]['setDataValue']('channel',_0xcb7c('0x10c'));}return _0xd36bf8;}));_0x513d2e[_0xcb7c('0x41')](_0x46c7b4[_0xcb7c('0x10d')]()[_0xcb7c('0x12')](function(_0x599800){for(var _0x3c5466=0x0;_0x3c5466<_0x599800[_0xcb7c('0x45')];_0x3c5466++){_0x599800[_0x3c5466][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x10e'));}return _0x599800;}));_0x513d2e[_0xcb7c('0x41')](_0x46c7b4['getSmsQueues']()[_0xcb7c('0x12')](function(_0x3f6376){for(var _0x26b828=0x0;_0x26b828<_0x3f6376[_0xcb7c('0x45')];_0x26b828++){_0x3f6376[_0x26b828][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x10f'));}return _0x3f6376;}));_0x513d2e['push'](_0x46c7b4[_0xcb7c('0x110')]()['then'](function(_0x2c56dc){for(var _0x406944=0x0;_0x406944<_0x2c56dc[_0xcb7c('0x45')];_0x406944++){_0x2c56dc[_0x406944][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x111'));}return _0x2c56dc;}));_0x513d2e[_0xcb7c('0x41')](_0x46c7b4[_0xcb7c('0x112')]()[_0xcb7c('0x12')](function(_0x476c7d){for(var _0xa9a201=0x0;_0xa9a201<_0x476c7d[_0xcb7c('0x45')];_0xa9a201++){_0x476c7d[_0xa9a201][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x113'));}return _0x476c7d;}));_0x513d2e[_0xcb7c('0x41')](_0x46c7b4[_0xcb7c('0x114')]()[_0xcb7c('0x12')](function(_0x1d99ce){for(var _0x2b355b=0x0;_0x2b355b<_0x1d99ce[_0xcb7c('0x45')];_0x2b355b++){_0x1d99ce[_0x2b355b][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x115'));}return _0x1d99ce;}));return BPromise['all'](_0x513d2e);})['then'](function(_0x57747f){var _0x100d72=_[_0xcb7c('0x116')](_0x57747f);_0x513d2e=[];return db['sequelize']['transaction'](function(_0x104ac1){for(var _0x2394c5=0x0;_0x2394c5<_0x100d72[_0xcb7c('0x45')];_0x2394c5++){_0x513d2e[_0xcb7c('0x41')](_0x100d72[_0x2394c5][_0xcb7c('0x117')](_0x1cf74f['id']),{'transaction':_0x104ac1});}return BPromise[_0xcb7c('0x4a')](_0x513d2e)[_0xcb7c('0x12')](function(){if(_0x1cf74f[_0xcb7c('0x93')]){return BPromise['each'](_[_0xcb7c('0x37')](_0x100d72,function(_0xd336c9){return _0xd336c9['getDataValue'](_0xcb7c('0x92'))===_0xcb7c('0x118');}),function(_0x1f5a4f){return db[_0xcb7c('0xa2')][_0xcb7c('0xa3')]({'membername':_0x1cf74f['name'],'UserId':_0x1cf74f['id'],'queue_name':_0x1f5a4f[_0xcb7c('0x2e')],'VoiceQueueId':_0x1f5a4f['id'],'interface':_['isNil'](_0x1cf74f[_0xcb7c('0x95')])?util[_0xcb7c('0xe3')](_0xcb7c('0xa0'),_0x1cf74f['name']):_0x1cf74f[_0xcb7c('0x95')],'paused':_0x1cf74f[_0xcb7c('0xa1')]||![],'penalty':_0x1cf74f[_0xcb7c('0x9a')]},{'transaction':_0x104ac1});});}else{return;}})[_0xcb7c('0x12')](function(){for(var _0x216200=0x0;_0x216200<_0x100d72[_0xcb7c('0x45')];_0x216200++){var _0x1d9a93=_0x100d72[_0x216200][_0xcb7c('0x119')](_0xcb7c('0x92'));var _0x458582=_0x1d9a93+_0xcb7c('0x9c');socket[_0xcb7c('0x9d')](_0xcb7c('0x26')+_0x1d9a93+_0xcb7c('0x9e'),{'UserId':_0x1cf74f['id'],['queueField']:_0x100d72[_0x216200]['id']});}});});})[_0xcb7c('0x12')](function(){db[_0xcb7c('0x11a')][_0xcb7c('0x8a')]({'where':{'teamId':_0x2c7619['id']}})['then'](function(_0x3765c0){if(_0x3765c0){db[_0xcb7c('0x11b')][_0xcb7c('0x73')]({'UserId':_0x5b6150[_0xcb7c('0x4c')]['id'],'VoicePrefixId':_0x3765c0['VoicePrefixId']});}});});}});}})['then'](respondWithStatusCode(_0x3d832f,null))[_0xcb7c('0x18')](handleError(_0x3d832f,null));};exports[_0xcb7c('0x11c')]=function(_0x189b20,_0x1be294){return db[_0xcb7c('0x32')][_0xcb7c('0x8a')]({'where':{'id':_0x189b20[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x1be294,null))[_0xcb7c('0x12')](function(_0x50a89e){if(_0x50a89e){var _0x1a6775=_0x50a89e[_0xcb7c('0x22')]({'plain':!![]});var _0x119812=_0x189b20[_0xcb7c('0x3b')][_0xcb7c('0x58')];return _0x50a89e[_0xcb7c('0x11c')](_0x119812)[_0xcb7c('0x12')](function(){for(var _0x52d1ae=0x0;_0x52d1ae<_0x119812[_0xcb7c('0x45')];_0x52d1ae++){var _0x37770e=[];var _0x39afb9={};db[_0xcb7c('0x108')][_0xcb7c('0x8a')]({'where':{'id':_0x119812[_0x52d1ae]}})['then'](function(_0x240a37){_0x39afb9=_0x240a37[_0xcb7c('0x48')];_0x37770e['push'](_0x240a37['getVoiceQueues']()[_0xcb7c('0x12')](function(_0x339b4b){for(var _0x4a0834=0x0;_0x4a0834<_0x339b4b[_0xcb7c('0x45')];_0x4a0834++){_0x339b4b[_0x4a0834][_0xcb7c('0x10a')]('channel',_0xcb7c('0x118'));}return _0x339b4b;}));_0x37770e[_0xcb7c('0x41')](_0x240a37[_0xcb7c('0x10b')]()['then'](function(_0x1f2a01){for(var _0x298957=0x0;_0x298957<_0x1f2a01[_0xcb7c('0x45')];_0x298957++){_0x1f2a01[_0x298957][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x10c'));}return _0x1f2a01;}));_0x37770e[_0xcb7c('0x41')](_0x240a37['getMailQueues']()[_0xcb7c('0x12')](function(_0x3759cb){for(var _0x4560fb=0x0;_0x4560fb<_0x3759cb[_0xcb7c('0x45')];_0x4560fb++){_0x3759cb[_0x4560fb][_0xcb7c('0x10a')]('channel',_0xcb7c('0x10e'));}return _0x3759cb;}));_0x37770e[_0xcb7c('0x41')](_0x240a37[_0xcb7c('0x11d')]()['then'](function(_0x23a31c){for(var _0x5877c9=0x0;_0x5877c9<_0x23a31c['length'];_0x5877c9++){_0x23a31c[_0x5877c9][_0xcb7c('0x10a')]('channel',_0xcb7c('0x10f'));}return _0x23a31c;}));_0x37770e['push'](_0x240a37[_0xcb7c('0x110')]()['then'](function(_0x1bcb20){for(var _0x59bb06=0x0;_0x59bb06<_0x1bcb20[_0xcb7c('0x45')];_0x59bb06++){_0x1bcb20[_0x59bb06][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x111'));}return _0x1bcb20;}));_0x37770e[_0xcb7c('0x41')](_0x240a37['getFaxQueues']()[_0xcb7c('0x12')](function(_0x2b7d82){for(var _0x19f4b9=0x0;_0x19f4b9<_0x2b7d82[_0xcb7c('0x45')];_0x19f4b9++){_0x2b7d82[_0x19f4b9][_0xcb7c('0x10a')]('channel',_0xcb7c('0x113'));}return _0x2b7d82;}));_0x37770e[_0xcb7c('0x41')](_0x240a37[_0xcb7c('0x114')]()[_0xcb7c('0x12')](function(_0x96f773){for(var _0x4cf86b=0x0;_0x4cf86b<_0x96f773['length'];_0x4cf86b++){_0x96f773[_0x4cf86b][_0xcb7c('0x10a')](_0xcb7c('0x92'),_0xcb7c('0x115'));}return _0x96f773;}));return BPromise[_0xcb7c('0x4a')](_0x37770e);})['then'](function(_0x5e8ff3){var _0x597cc2=_['flatten'](_0x5e8ff3);_0x37770e=[];return db['sequelize'][_0xcb7c('0x11e')](function(_0x4b5e19){for(var _0x46dfe5=0x0;_0x46dfe5<_0x597cc2[_0xcb7c('0x45')];_0x46dfe5++){_0x37770e[_0xcb7c('0x41')](_0x597cc2[_0x46dfe5][_0xcb7c('0x11f')](_0x1a6775['id']),{'transaction':_0x4b5e19});}return BPromise[_0xcb7c('0x4a')](_0x37770e)[_0xcb7c('0x12')](function(){if(_0x1a6775['online']){return BPromise['each'](_['filter'](_0x597cc2,function(_0x37b4b8){return _0x37b4b8[_0xcb7c('0x119')](_0xcb7c('0x92'))===_0xcb7c('0x118');}),function(_0xfe7e4a){return db[_0xcb7c('0xa2')]['destroy']({'where':{'VoiceQueueId':_0xfe7e4a['id'],'UserId':_0x1a6775['id']},'transaction':_0x4b5e19});});}else{return;}})[_0xcb7c('0x12')](function(){db[_0xcb7c('0x11a')]['findOne']({'where':{'teamId':_0x39afb9['id']}})[_0xcb7c('0x12')](function(_0x27b95a){if(_0x27b95a){return db['UserVoicePrefix'][_0xcb7c('0x120')]({'where':{'UserId':_0x1a6775['id'],'VoicePrefixId':_0x27b95a[_0xcb7c('0x48')][_0xcb7c('0x121')]}});}});})[_0xcb7c('0x12')](function(){for(var _0x5463dd=0x0;_0x5463dd<_0x597cc2[_0xcb7c('0x45')];_0x5463dd++){var _0x47711a=_0x597cc2[_0x5463dd][_0xcb7c('0x119')](_0xcb7c('0x92'));var _0x487b07=_0x47711a+_0xcb7c('0x9c');socket['emit'](_0xcb7c('0x26')+_0x47711a+_0xcb7c('0xa6'),{'UserId':_0x1a6775['id'],['queueField']:_0x597cc2[_0x5463dd]['id']});}});});});}});}})[_0xcb7c('0x12')](respondWithStatusCode(_0x1be294,null))['catch'](handleError(_0x1be294,null));};exports[_0xcb7c('0x122')]=function(_0x2d5d34,_0x2f7f0c){var _0x79c789={};var _0x1d1471={};var _0xb37123;var _0x229b8a;return db['User'][_0xcb7c('0x8a')]({'where':{'id':_0x2d5d34[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x2f7f0c,null))['then'](function(_0x4a7b67){if(_0x4a7b67){_0xb37123=_0x4a7b67;_0x1d1471[_0xcb7c('0x4f')]=_[_0xcb7c('0x4d')](db[_0xcb7c('0xc6')][_0xcb7c('0x33')]);_0x1d1471[_0xcb7c('0x3b')]=_['keys'](_0x2d5d34[_0xcb7c('0x3b')]);_0x1d1471[_0xcb7c('0x4e')]=_[_0xcb7c('0xbe')](_0x1d1471[_0xcb7c('0x4f')],_0x1d1471['query']);_0x79c789[_0xcb7c('0x40')]=_[_0xcb7c('0xbe')](_0x1d1471[_0xcb7c('0x4f')],qs['fields'](_0x2d5d34[_0xcb7c('0x3b')][_0xcb7c('0x50')]));_0x79c789[_0xcb7c('0x40')]=_0x79c789['attributes']['length']?_0x79c789[_0xcb7c('0x40')]:_0x1d1471[_0xcb7c('0x4f')];_0x79c789[_0xcb7c('0xbf')]=qs['sort'](_0x2d5d34['query'][_0xcb7c('0xc0')]);_0x79c789[_0xcb7c('0x3a')]=qs[_0xcb7c('0x4e')](_['pick'](_0x2d5d34['query'],_0x1d1471[_0xcb7c('0x4e')]));if(_0x2d5d34[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0x79c789['where']=_['merge'](_0x79c789[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0x79c789[_0xcb7c('0x40')],function(_0x476990){var _0x30b422={};_0x30b422[_0x476990]={'$like':'%'+_0x2d5d34[_0xcb7c('0x3b')][_0xcb7c('0x37')]+'%'};return _0x30b422;})});}_0x79c789=_[_0xcb7c('0xc2')]({},_0x79c789,_0x2d5d34[_0xcb7c('0xc3')]);return _0xb37123['getLists'](_0x79c789);}})[_0xcb7c('0x12')](function(_0x2a48e7){if(_0x2a48e7){_0x229b8a=_0x2a48e7[_0xcb7c('0x45')];if(!_0x2d5d34[_0xcb7c('0x3b')]['hasOwnProperty'](_0xcb7c('0xca'))){_0x79c789[_0xcb7c('0x1d')]=qs[_0xcb7c('0x1d')](_0x2d5d34[_0xcb7c('0x3b')][_0xcb7c('0x1d')]);_0x79c789[_0xcb7c('0x1b')]=qs[_0xcb7c('0x1b')](_0x2d5d34['query'][_0xcb7c('0x1b')]);}return _0xb37123[_0xcb7c('0x122')](_0x79c789);}})[_0xcb7c('0x12')](function(_0x5e7bf7){if(_0x5e7bf7){return _0x5e7bf7?{'count':_0x229b8a,'rows':_0x5e7bf7}:null;}})[_0xcb7c('0x12')](respondWithResult(_0x2f7f0c,null))[_0xcb7c('0x18')](handleError(_0x2f7f0c,null));};exports[_0xcb7c('0x123')]=function(_0x4074c0,_0x4315d8){var _0xfb0ec1={};var _0x85c74a={};var _0x1642d4;return db['User'][_0xcb7c('0x8a')]({'where':{'id':_0x4074c0[_0xcb7c('0x4c')]['id']}})[_0xcb7c('0x12')](handleEntityNotFound(_0x4315d8,null))['then'](function(_0x131aec){if(_0x131aec){_0x1642d4=_0x131aec;_0x85c74a[_0xcb7c('0x4f')]=_['keys'](db['User'][_0xcb7c('0x33')]);_0x85c74a[_0xcb7c('0x3b')]=_[_0xcb7c('0x4d')](_0x4074c0[_0xcb7c('0x3b')]);_0x85c74a['filters']=_[_0xcb7c('0xbe')](_0x85c74a['model'],_0x85c74a['query']);_0xfb0ec1[_0xcb7c('0x40')]=_['intersection'](_0x85c74a[_0xcb7c('0x4f')],qs[_0xcb7c('0x50')](_0x4074c0['query']['fields']));_0xfb0ec1[_0xcb7c('0x40')]=_0xfb0ec1[_0xcb7c('0x40')][_0xcb7c('0x45')]?_0xfb0ec1[_0xcb7c('0x40')]:_0x85c74a[_0xcb7c('0x4f')];_0xfb0ec1[_0xcb7c('0xbf')]=qs['sort'](_0x4074c0[_0xcb7c('0x3b')][_0xcb7c('0xc0')]);_0xfb0ec1['where']=qs[_0xcb7c('0x4e')](_[_0xcb7c('0xc1')](_0x4074c0['query'],_0x85c74a[_0xcb7c('0x4e')]));if(_0x4074c0[_0xcb7c('0x3b')][_0xcb7c('0x37')]){_0xfb0ec1[_0xcb7c('0x3a')]=_[_0xcb7c('0xc2')](_0xfb0ec1[_0xcb7c('0x3a')],{'$or':_[_0xcb7c('0x2b')](_0xfb0ec1['attributes'],function(_0x5dcd31){var _0x160874={};_0x160874[_0x5dcd31]={'$like':'%'+_0x4074c0[_0xcb7c('0x3b')]['filter']+'%'};return _0x160874;})});}_0xfb0ec1['model']=db['User'];_0xfb0ec1['as']=_0xcb7c('0x27');_0xfb0ec1=_[_0xcb7c('0xc2')]({},_0xfb0ec1,_0x4074c0['options']);return _0x1642d4[_0xcb7c('0x109')]({'include':[_0xfb0ec1]});}})[_0xcb7c('0x12')](function(_0x1ae32b){if(_0x1ae32b){var _0x4d3dc6={},_0x5b5ec6=[];for(var _0x573a0f=0x0;_0x573a0f<_0x1ae32b[_0xcb7c('0x45')];_0x573a0f+=0x1){for(var _0x27a047=0x0,_0x4b24dd;_0x27a047<_0x1ae32b[_0x573a0f][_0xcb7c('0x27')][_0xcb7c('0x45')];_0x27a047+=0x1){_0x4b24dd=_0x1ae32b[_0x573a0f][_0xcb7c('0x27')][_0x27a047][_0xcb7c('0x22')]({'plain':!![]});_0x4d3dc6[_0x4b24dd['id']]=_0x4b24dd;}}_0x4d3dc6=_[_0xcb7c('0x124')](_0x4d3dc6);for(var _0x4949ac=qs[_0xcb7c('0x1b')](_0x4074c0[_0xcb7c('0x3b')][_0xcb7c('0x1b')]);_0x4949ac<_0x4d3dc6[_0xcb7c('0x45')]&&_0x5b5ec6[_0xcb7c('0x45')]=_0x8c7abe){_0x20a4c8=_0x8c7abe;_0x2c92e9=0xc8;}else{_0x2c92e9=0xce;}_0x5d254a['status'](_0x2c92e9);return _0x5d254a[_0x70f0('0x22')](_0x70f0('0x23'),_0x2a29b8+'-'+_0x20a4c8+'/'+_0x8c7abe)[_0x70f0('0x1d')](_0x9e8ede);}return null;};}function saveUpdates(_0x2746c7){return function(_0x1811a7){if(_0x1811a7){return _0x1811a7['update'](_0x2746c7)[_0x70f0('0x12')](function(_0x596913){return _0x596913;});}return null;};}function removeEntity(_0x4e7193){return function(_0x329f77){if(_0x329f77){return _0x329f77[_0x70f0('0x24')]()[_0x70f0('0x12')](function(){var _0x591cbd=_0x329f77[_0x70f0('0x25')]({'plain':!![]});if(_0x591cbd[_0x70f0('0x26')]===_0x70f0('0x27'))return;var _0x58d5ea=[{'name':_0x70f0('0x28'),'value':'user','ignore':!![]},{'name':_0x70f0('0x29'),'value':_0x70f0('0x2a'),'ignore':![]},{'name':_0x70f0('0x2b'),'value':_0x70f0('0x2c'),'ignore':![]}];var _0xf5247f=_(_0x58d5ea)['filter'](_0x70f0('0x2d'))['map']('value')['value']();if(_[_0x70f0('0x2e')](_0xf5247f,_0x591cbd['role'])){return;}var _0x29e46c=_['find'](_0x58d5ea,[_0x70f0('0x2f'),_0x591cbd[_0x70f0('0x26')]])[_0x70f0('0x30')];return db[_0x70f0('0x31')][_0x70f0('0x24')]({'where':{'type':_0x29e46c,'resourceId':_0x591cbd['id']}})[_0x70f0('0x12')](function(){return _0x329f77;});})[_0x70f0('0x12')](function(){_0x4e7193[_0x70f0('0x1b')](0xcc)[_0x70f0('0x1c')]();});}};}function handleEntityNotFound(_0x10c26a){return function(_0x5a8310){if(!_0x5a8310){_0x10c26a['sendStatus'](0x194);}return _0x5a8310;};}function handleError(_0x13c742,_0x4d02f9){_0x4d02f9=_0x4d02f9||0x1f4;return function(_0x33bc24){logger[_0x70f0('0x17')](_0x33bc24[_0x70f0('0x32')]);if(_0x33bc24[_0x70f0('0x30')]){delete _0x33bc24[_0x70f0('0x30')];}_0x13c742[_0x70f0('0x1b')](_0x4d02f9)['send'](_0x33bc24);};}exports['index']=function(_0x382dc0,_0x5698b1){var _0x1ab422={},_0x59e456={'count':0x0,'rows':[]};var _0x3f00eb=_(db['User']['rawAttributes'])[_0x70f0('0x33')](function(_0x1f9c11){return{'name':_0x1f9c11[_0x70f0('0x34')],'type':_0x1f9c11[_0x70f0('0x35')][_0x70f0('0x36')]};})[_0x70f0('0x37')](function(_0x2afa0b){return!_[_0x70f0('0x2e')](['password',_0x70f0('0x38')],_0x2afa0b[_0x70f0('0x30')]);})[_0x70f0('0x2f')]();_0x1ab422=qs[_0x70f0('0x39')](_0x3f00eb,_0x382dc0);var _0x28caa0={'where':_0x1ab422[_0x70f0('0x3a')]};return db[_0x70f0('0x3b')][_0x70f0('0x20')](_0x28caa0)[_0x70f0('0x12')](function(_0x25a707){_0x59e456['count']=_0x25a707;if(_0x382dc0[_0x70f0('0x3c')][_0x70f0('0x3d')]){_0x1ab422[_0x70f0('0x3e')]=[{'all':!![]}];}if(_0x382dc0['query'][_0x70f0('0x3f')]===_0x70f0('0x40')){_0x1ab422[_0x70f0('0x3e')]=[{'model':db[_0x70f0('0x41')],'as':_0x70f0('0x3f')}];}if(!_[_0x70f0('0x2e')](_0x1ab422['attributes'],'id')){_0x1ab422[_0x70f0('0x42')][_0x70f0('0x43')]('id');}return db[_0x70f0('0x3b')][_0x70f0('0x44')](_0x1ab422);})['then'](function(_0xd2d244){_0x59e456['rows']=_0xd2d244;if(_0x382dc0[_0x70f0('0x3c')][_0x70f0('0x45')]==='true'){var _0x4d867b=[];for(var _0x4ffc23=0x0;_0x4ffc23<_0x59e456[_0x70f0('0x46')][_0x70f0('0x47')];_0x4ffc23++){_0x4d867b['push'](get_open_tabs('chat',_0x59e456[_0x70f0('0x46')][_0x4ffc23][_0x70f0('0x48')]));_0x4d867b[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x49'),_0x59e456[_0x70f0('0x46')][_0x4ffc23]['dataValues']));_0x4d867b['push'](get_open_tabs(_0x70f0('0x4a'),_0x59e456[_0x70f0('0x46')][_0x4ffc23][_0x70f0('0x48')]));_0x4d867b[_0x70f0('0x43')](get_open_tabs('mail',_0x59e456['rows'][_0x4ffc23][_0x70f0('0x48')]));_0x4d867b[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x4b'),_0x59e456[_0x70f0('0x46')][_0x4ffc23][_0x70f0('0x48')]));_0x4d867b[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x4c'),_0x59e456['rows'][_0x4ffc23][_0x70f0('0x48')]));}return BPromise[_0x70f0('0x4d')](_0x4d867b)[_0x70f0('0x12')](function(){return _0x59e456;});}else{return _0x59e456;}})['then'](respondWithFilteredResult(_0x5698b1,_0x1ab422))['catch'](handleError(_0x5698b1,null));};exports[_0x70f0('0x4e')]=function(_0x228e32,_0x1b8bbc){var _0x5298df={'raw':![],'where':{'id':_0x228e32[_0x70f0('0x4f')]['id']}},_0x466681={};_0x466681[_0x70f0('0x50')]=_['differenceBy'](_[_0x70f0('0x51')](db[_0x70f0('0x3b')][_0x70f0('0x52')]),['password',_0x70f0('0x38')]);_0x466681[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x228e32[_0x70f0('0x3c')]);_0x466681[_0x70f0('0x53')]=_[_0x70f0('0x54')](_0x466681[_0x70f0('0x50')],_0x466681[_0x70f0('0x3c')]);_0x5298df[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x466681[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x228e32[_0x70f0('0x3c')]['fields']));_0x5298df[_0x70f0('0x42')]=_0x5298df[_0x70f0('0x42')][_0x70f0('0x47')]?_0x5298df[_0x70f0('0x42')]:_0x466681[_0x70f0('0x50')];if(_0x228e32[_0x70f0('0x3c')][_0x70f0('0x3d')]){_0x5298df['include']=[{'all':!![]}];}if(_0x228e32[_0x70f0('0x3c')][_0x70f0('0x3f')]==='true'){_0x5298df[_0x70f0('0x3e')]=[{'model':db[_0x70f0('0x41')],'as':_0x70f0('0x3f')}];}_0x5298df=_['merge']({},_0x5298df,_0x228e32['options']);if(!_[_0x70f0('0x2e')](_0x5298df[_0x70f0('0x42')],'id')){_0x5298df['attributes'][_0x70f0('0x43')]('id');}return db[_0x70f0('0x3b')][_0x70f0('0x56')](_0x5298df)['then'](handleEntityNotFound(_0x1b8bbc,null))[_0x70f0('0x12')](function(_0x2e1f85){var _0x1b53b7=[];values=_0x2e1f85;if(_0x228e32[_0x70f0('0x3c')][_0x70f0('0x45')]===_0x70f0('0x40')){_0x1b53b7[_0x70f0('0x43')](get_open_tabs('chat',_0x2e1f85[_0x70f0('0x48')]));_0x1b53b7[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x49'),_0x2e1f85[_0x70f0('0x48')]));_0x1b53b7[_0x70f0('0x43')](get_open_tabs('openchannel',_0x2e1f85[_0x70f0('0x48')]));_0x1b53b7[_0x70f0('0x43')](get_open_tabs('whatsapp',_0x2e1f85[_0x70f0('0x48')]));_0x1b53b7[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x4a'),_0x2e1f85[_0x70f0('0x48')]));_0x1b53b7['push'](get_open_tabs('mail',_0x2e1f85[_0x70f0('0x48')]));return BPromise['all'](_0x1b53b7);}else{return values;}})[_0x70f0('0x12')](function(){return values;})[_0x70f0('0x12')](respondWithResult(_0x1b8bbc,null))[_0x70f0('0x1a')](handleError(_0x1b8bbc,null));};exports[_0x70f0('0x57')]=function(_0x331a89,_0x8744f){if(_0x331a89[_0x70f0('0x58')]['id']){delete _0x331a89[_0x70f0('0x58')]['id'];}delete _0x331a89[_0x70f0('0x58')]['role'];return db[_0x70f0('0x3b')]['find']({'where':{'id':_0x331a89['params']['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x8744f,null))[_0x70f0('0x12')](saveUpdates(_0x331a89[_0x70f0('0x58')],null))[_0x70f0('0x12')](respondWithResult(_0x8744f,null))[_0x70f0('0x1a')](handleError(_0x8744f,null));};exports[_0x70f0('0x59')]=function(_0x3c889c,_0x279535){return db[_0x70f0('0x3b')][_0x70f0('0x59')]()[_0x70f0('0x12')](respondWithResult(_0x279535,null))[_0x70f0('0x1a')](handleError(_0x279535,null));};exports[_0x70f0('0x5a')]=function(_0x4eecbc,_0x687541){return db[_0x70f0('0x3b')]['find']({'where':{'id':_0x4eecbc['params']['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x687541,null))['then'](function(_0x1d9c14){if(_0x1d9c14){return _0x1d9c14[_0x70f0('0x5a')](_0x4eecbc[_0x70f0('0x58')][_0x70f0('0x5b')],_[_0x70f0('0x5c')](_0x4eecbc[_0x70f0('0x58')],[_0x70f0('0x5b'),'id'])||{});}})[_0x70f0('0x12')](respondWithResult(_0x687541,null))['catch'](handleError(_0x687541,null));};function validateUser(_0x5497d3){return new BPromise(function(_0x51a097,_0x5bad10){if(_0x5497d3[_0x70f0('0x5d')])return _0x51a097(_0x5497d3);return db[_0x70f0('0x5e')][_0x70f0('0x5f')](0x1)[_0x70f0('0x12')](function(_0x3bd837){if(_0x3bd837['securePassword'])authService[_0x70f0('0x60')](_0x5497d3[_0x70f0('0x61')]);db[_0x70f0('0x3b')][_0x70f0('0x62')](_0x70f0('0x5d'))[_0x70f0('0x12')](function(_0x3b92fc){if(_[_0x70f0('0x63')](_0x3b92fc)){_0x5497d3[_0x70f0('0x5d')]=_0x3bd837[_0x70f0('0x64')]||0x1;return;}if(_[_0x70f0('0x63')](_0x3bd837['min_internal'])||_0x3bd837[_0x70f0('0x64')]===_0x3b92fc){_0x5497d3['internal']=_0x3b92fc+0x1;return;}if(_0x3bd837['min_internal']>_0x3b92fc){_0x5497d3[_0x70f0('0x5d')]=_0x3bd837[_0x70f0('0x64')];return;}return db[_0x70f0('0x65')][_0x70f0('0x3c')]('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[_0x70f0('0x65')][_0x70f0('0x66')][_0x70f0('0x67')]})[_0x70f0('0x12')](function(_0x31fc80){if(_0x31fc80&&_0x31fc80['length']){for(var _0x5e87e7=0x0,_0x6ba465=_0x31fc80[_0x70f0('0x47')];_0x5e87e7<_0x6ba465&&_[_0x70f0('0x63')](_0x5497d3[_0x70f0('0x5d')]);_0x5e87e7++){if(_0x3bd837[_0x70f0('0x64')]<=_0x31fc80[_0x5e87e7][_0x70f0('0x68')]){_0x5497d3['internal']=_0x31fc80[_0x5e87e7]['from'];}else if(_0x3bd837[_0x70f0('0x64')]>_0x31fc80[_0x5e87e7][_0x70f0('0x68')]&&_0x3bd837[_0x70f0('0x64')]<=_0x31fc80[_0x5e87e7]['to']){_0x5497d3[_0x70f0('0x5d')]=_0x3bd837['min_internal'];}}}if(_[_0x70f0('0x63')](_0x5497d3[_0x70f0('0x5d')])){_0x5497d3[_0x70f0('0x5d')]=_0x3b92fc+0x1;}return _0x51a097(_0x5497d3);});});})[_0x70f0('0x1a')](function(_0x15194a){_0x5bad10(_0x15194a);});});}function updateUser(_0x13ae01){return new BPromise(function(_0x35e3a5,_0x169890){try{if(_0x13ae01['voicemail']){_0x13ae01[_0x70f0('0x69')]=_0x13ae01[_0x70f0('0x5d')];_0x13ae01[_0x70f0('0x6a')]={'mailbox':_0x13ae01[_0x70f0('0x5d')],'password':_0x13ae01['password'],'fullname':_0x13ae01[_0x70f0('0x6b')],'email':_0x13ae01[_0x70f0('0x6c')]};}if(_0x13ae01[_0x70f0('0x26')]===_0x70f0('0x2a')){if(!_0x13ae01[_0x70f0('0x6d')])_0x13ae01['permissions']=['101','102',_0x70f0('0x6e'),_0x70f0('0x6f'),_0x70f0('0x70'),_0x70f0('0x71'),_0x70f0('0x72'),'106','107',_0x70f0('0x73'),'109',_0x70f0('0x74'),_0x70f0('0x75'),_0x70f0('0x76'),_0x70f0('0x77')];}_0x35e3a5(_0x13ae01);}catch(_0x1cba29){_0x169890(_0x1cba29);}});}exports['create']=function(_0x10ee07,_0x5e1922){if(_0x10ee07[_0x70f0('0x78')][_0x70f0('0x26')]==='agent')throw new Error(_0x70f0('0x79'));if(_0x10ee07[_0x70f0('0x58')][_0x70f0('0x26')]===_0x70f0('0x78')&&_0x10ee07[_0x70f0('0x78')]['role']!==_0x70f0('0x27')){throw new Error(_0x70f0('0x7a'));}if(_0x10ee07[_0x70f0('0x58')]['role']==='admin'&&_0x10ee07[_0x70f0('0x78')]['role']!==_0x70f0('0x27')){throw new Error(_0x70f0('0x7b'));}return licenseUtil[_0x70f0('0x7c')]([_0x10ee07[_0x70f0('0x58')]])[_0x70f0('0x12')](function(){return validateUser(_0x10ee07['body']);})[_0x70f0('0x12')](function(_0x1b06dd){return updateUser(_0x1b06dd)[_0x70f0('0x12')](function(_0x24c0fc){if(_0x24c0fc['role']===_0x70f0('0x27')){_0x24c0fc[_0x70f0('0x7d')]=_0x10ee07[_0x70f0('0x78')]['settingsEnabled'];delete _0x24c0fc['userProfileId'];}return _0x24c0fc;});})['then'](function(_0x580907){return db['User'][_0x70f0('0x7e')](_0x580907,{'include':[{'model':db[_0x70f0('0x6a')],'as':'VoiceMail'}]});})['then'](function(_0x94a377){if(_0x10ee07['body'][_0x70f0('0x26')]===_0x70f0('0x78'))return _0x94a377;if(_0x10ee07['user']['role']!==_0x70f0('0x78'))return _0x94a377;return db['UserProfileSection'][_0x70f0('0x56')]({'where':{'name':_0x94a377[_0x70f0('0x26')]===_0x70f0('0x2a')?_0x70f0('0x29'):_0x70f0('0x2b'),'userProfileId':_0x10ee07['user'][_0x70f0('0x7f')]},'raw':!![]})[_0x70f0('0x12')](function(_0x18261e){if(!_0x18261e||_0x18261e['autoAssociation']!=0x0)return _0x94a377;return db[_0x70f0('0x31')][_0x70f0('0x7e')]({'name':_0x94a377['name'],'resourceId':_0x94a377['id'],'type':_0x18261e['name'],'sectionId':_0x18261e['id']},{})[_0x70f0('0x12')](function(){return _0x94a377;});})[_0x70f0('0x1a')](function(_0x5ee3c4){logger[_0x70f0('0x17')](_0x70f0('0x80'),_0x5ee3c4);throw _0x5ee3c4;});})['then'](respondWithResult(_0x5e1922,0xc9))[_0x70f0('0x1a')](handleError(_0x5e1922,null));};exports[_0x70f0('0x81')]=function(_0x510af3,_0x5028cf){var _0x3caf89=_0x510af3[_0x70f0('0x58')];var _0x3ab66e=[];if(_0x510af3[_0x70f0('0x78')][_0x70f0('0x26')]===_0x70f0('0x2a'))throw new Error(_0x70f0('0x79'));if(_[_0x70f0('0x82')](_0x3caf89,['role','user'])&&_0x510af3[_0x70f0('0x78')][_0x70f0('0x26')]!=='admin'){throw new Error(_0x70f0('0x7a'));}if(_[_0x70f0('0x82')](_0x3caf89,[_0x70f0('0x26'),_0x70f0('0x27')])&&_0x510af3[_0x70f0('0x78')]['role']!==_0x70f0('0x27')){throw new Error(_0x70f0('0x83'));}return licenseUtil['checkUserLimits'](_0x3caf89)[_0x70f0('0x12')](function(){return validateUser(_0x3caf89[0x0]);})['then'](function(){for(var _0x5708af=0x1;_0x5708af<_0x3caf89['length'];_0x5708af++){var _0x1f2089=_0x3caf89[_0x5708af-0x1][_0x70f0('0x5d')];if(!_0x3caf89[_0x5708af][_0x70f0('0x5d')])_0x3caf89[_0x5708af][_0x70f0('0x5d')]=_0x1f2089+0x1;_0x3ab66e[_0x70f0('0x43')](validateUser(_0x3caf89[_0x5708af]));}return BPromise['all'](_0x3ab66e);})[_0x70f0('0x12')](function(){_0x3ab66e=[];for(var _0x35e177=0x0;_0x35e177<_0x3caf89[_0x70f0('0x47')];_0x35e177++){_0x3ab66e[_0x70f0('0x43')](updateUser(_0x3caf89[_0x35e177]));}return BPromise[_0x70f0('0x4d')](_0x3ab66e);})[_0x70f0('0x12')](function(){return BPromise[_0x70f0('0x84')](_0x3caf89,function(_0x349e8c){return db['User'][_0x70f0('0x7e')](_0x349e8c,{'include':[{'model':db[_0x70f0('0x6a')],'as':'VoiceMail'}]})['then'](function(_0x5baab7){_0x349e8c['id']=_0x5baab7['id'];return _0x349e8c;});});})[_0x70f0('0x12')](function(_0x2c32dd){if(_0x510af3['body'][_0x70f0('0x26')]==='user')return _0x2c32dd;if(_0x510af3[_0x70f0('0x78')][_0x70f0('0x26')]!==_0x70f0('0x78'))return _0x2c32dd;var _0x477564=_['some'](_0x2c32dd,function(_0x5bdc8e){return _0x5bdc8e[_0x70f0('0x26')]==='agent'||_0x5bdc8e[_0x70f0('0x26')]===_0x70f0('0x2c');});if(!_0x477564)return _0x2c32dd;return db[_0x70f0('0x85')][_0x70f0('0x44')]({'where':{'name':{'$or':[_0x70f0('0x29'),_0x70f0('0x2b')]},'userProfileId':_0x510af3[_0x70f0('0x78')]['userProfileId']},'raw':!![]})[_0x70f0('0x12')](function(_0x590f2f){if(_[_0x70f0('0x86')](_0x590f2f)||!_[_0x70f0('0x82')](_0x590f2f,['autoAssociation',0x0]))return _0x2c32dd;_0x3ab66e=[];var _0x330d16=_(_0x590f2f)[_0x70f0('0x33')](function(_0x25eaef){if(_0x25eaef[_0x70f0('0x87')]===0x1)return;return _0x25eaef[_0x70f0('0x30')]===_0x70f0('0x29')?'agent':_0x70f0('0x2c');})[_0x70f0('0x88')]()[_0x70f0('0x2f')]();for(var _0x9a7981=0x0;_0x9a7981<_0x2c32dd[_0x70f0('0x47')];_0x9a7981++){if(!_[_0x70f0('0x2e')](_0x330d16,_0x2c32dd[_0x9a7981]['role']))return;var _0x53f966=_0x2c32dd[_0x9a7981]['role']==='agent'?_0x70f0('0x29'):_0x70f0('0x2b');_0x3ab66e[_0x70f0('0x43')](db[_0x70f0('0x31')][_0x70f0('0x7e')]({'name':_0x2c32dd[_0x9a7981][_0x70f0('0x30')],'resourceId':_0x2c32dd[_0x9a7981]['id'],'type':_0x53f966,'sectionId':_[_0x70f0('0x56')](_0x590f2f,[_0x70f0('0x30'),_0x53f966])['id']},{}));}return BPromise[_0x70f0('0x4d')](_0x3ab66e);});})['then'](respondWithResult(_0x5028cf,0xc9))[_0x70f0('0x1a')](handleError(_0x5028cf,null));};exports['changePassword']=function(_0x47c46e,_0x2101e5){if(_0x47c46e['body']['id']){delete _0x47c46e[_0x70f0('0x58')]['id'];}return db[_0x70f0('0x3b')]['find']({'where':{'id':_0x47c46e['params']['id']}})['then'](function(_0x2089f9){if(!_0x2089f9)return null;if(_0x2089f9['id']===_0x47c46e['user']['id']){if(!_0x47c46e['body'][_0x70f0('0x89')]||!_0x47c46e[_0x70f0('0x58')][_0x70f0('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x70f0('0x8b'));}if(!_0x2089f9['authenticate'](_0x47c46e['body'][_0x70f0('0x89')])){throw new db['Sequelize']['ValidationError'](_0x70f0('0x8c'));}if(_0x47c46e['body'][_0x70f0('0x89')]===_0x47c46e['body'][_0x70f0('0x8a')]){throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))](_0x70f0('0x8f'));}}else if(_0x47c46e[_0x70f0('0x78')][_0x70f0('0x26')]===_0x70f0('0x27')){if(!_0x47c46e[_0x70f0('0x58')][_0x70f0('0x8a')]){throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))](_0x70f0('0x90'));}}else if(_0x47c46e[_0x70f0('0x78')][_0x70f0('0x26')]==='user'){if(!_0x47c46e[_0x70f0('0x58')][_0x70f0('0x8a')]){throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))](_0x70f0('0x90'));}if(_0x2089f9[_0x70f0('0x26')]!==_0x70f0('0x2a')){throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))]('Unauthorized');}}else{throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))](_0x70f0('0x79'));}return _0x2089f9;})[_0x70f0('0x12')](handleEntityNotFound(_0x2101e5,null))[_0x70f0('0x12')](function(_0x4114d0){return db[_0x70f0('0x5e')][_0x70f0('0x91')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x70f0('0x92')]})[_0x70f0('0x12')](function(_0x1482a7){if(_0x1482a7[_0x70f0('0x93')])authService[_0x70f0('0x60')](_0x47c46e[_0x70f0('0x58')]['newPassword']);if(!_0x1482a7[_0x70f0('0x94')]||!_0x4114d0[_0x70f0('0x95')])return _0x4114d0;authService[_0x70f0('0x96')](_0x47c46e[_0x70f0('0x58')][_0x70f0('0x8a')],_0x4114d0[_0x70f0('0x95')],_0x1482a7['passwordHistoryLimit']);return _0x4114d0;})[_0x70f0('0x12')](saveUpdates({'password':_0x47c46e[_0x70f0('0x58')][_0x70f0('0x8a')],'passwordResetAt':_0x47c46e[_0x70f0('0x78')]['id']==_0x47c46e[_0x70f0('0x4f')]['id']?moment():null,'previousPasswords':authService[_0x70f0('0x97')](_0x47c46e['body'][_0x70f0('0x8a')],_0x4114d0[_0x70f0('0x95')])},null));})[_0x70f0('0x12')](respondWithResult(_0x2101e5,null))['catch'](handleError(_0x2101e5,null));};exports[_0x70f0('0x98')]=function(_0x329b3f,_0x39f980){var _0x116c99=_0x329b3f[_0x70f0('0x58')][_0x70f0('0x99')];return db[_0x70f0('0x3b')][_0x70f0('0x56')]({'where':{'id':_0x329b3f[_0x70f0('0x4f')]['id']},'attributes':['id','name',_0x70f0('0x26'),_0x70f0('0x9a'),'loginInPause',_0x70f0('0x9b'),'interface']})[_0x70f0('0x12')](handleEntityNotFound(_0x39f980,null))[_0x70f0('0x12')](function(_0x31f8a7){if(_0x31f8a7){if(!utils[_0x70f0('0x9c')](_0x116c99)){throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))](_0x70f0('0x9d'));}return _0x31f8a7[_0x70f0('0x9e')+_['capitalize'](_0x116c99[_0x70f0('0x9f')]())+_0x70f0('0xa0')](_0x329b3f['body'][_0x70f0('0x5b')],{'penalty':_0x329b3f[_0x70f0('0x58')]['penalty']||0x0})[_0x70f0('0xa1')](function(_0x2f00b4){for(var _0x18d2f1=0x0;_0x18d2f1<_0x329b3f[_0x70f0('0x58')]['ids'][_0x70f0('0x47')];_0x18d2f1+=0x1){var _0x5ad773={'UserId':Number(_0x329b3f[_0x70f0('0x4f')]['id'])};_0x5ad773[_[_0x70f0('0xa2')](_0x116c99[_0x70f0('0x9f')]())+_0x70f0('0xa3')]=Number(_0x329b3f[_0x70f0('0x58')]['ids'][_0x18d2f1]);socket[_0x70f0('0xa4')](_0x70f0('0x78')+_[_0x70f0('0xa2')](_0x116c99[_0x70f0('0x9f')]())+'Queue:save',_0x5ad773);}return _0x2f00b4;})[_0x70f0('0x12')](function(){if(_0x116c99===_0x70f0('0xa5')){return db[_0x70f0('0xa6')][_0x70f0('0x44')]({'where':{'id':_0x329b3f[_0x70f0('0x58')][_0x70f0('0x5b')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x70f0('0x12')](function(_0x35d59f){var _0x319792=_0x31f8a7[_0x70f0('0x25')]({'plain':!![]});var _0x3c7680=[];if(_0x116c99===_0x70f0('0xa5')&&_0x319792[_0x70f0('0x26')]===_0x70f0('0x2a')&&_0x319792[_0x70f0('0x9a')]){for(var _0x6e6fde=0x0;_0x6e6fde<_0x35d59f['length'];_0x6e6fde+=0x1){_0x3c7680[_0x70f0('0x43')]({'membername':_0x319792[_0x70f0('0x30')],'UserId':_0x319792['id'],'queue_name':_0x35d59f[_0x6e6fde][_0x70f0('0x30')],'VoiceQueueId':_0x35d59f[_0x6e6fde]['id'],'interface':_['isNil'](_0x319792[_0x70f0('0xa7')])?util[_0x70f0('0xa8')]('SIP/%s',_0x319792['name']):_0x319792[_0x70f0('0xa7')],'paused':_0x319792[_0x70f0('0x9b')]||![],'penalty':_0x329b3f['body'][_0x70f0('0xa9')]||0x0});}return BPromise[_0x70f0('0x84')](_0x3c7680,function(_0x42f969){return db[_0x70f0('0xaa')]['upsert'](_0x42f969);});}return _0x31f8a7;});}})[_0x70f0('0x12')](respondWithStatusCode(_0x39f980,null))['catch'](handleError(_0x39f980,null));};exports['removeQueues']=function(_0x5cf434,_0x49596d){var _0x4a2238,_0x46284e;return db[_0x70f0('0x3b')][_0x70f0('0x56')]({'where':{'id':_0x5cf434[_0x70f0('0x4f')]['id']},'attributes':['id',_0x70f0('0x30'),_0x70f0('0x26')]})[_0x70f0('0x12')](handleEntityNotFound(_0x49596d,null))[_0x70f0('0x12')](function(_0x1517d6){if(_0x1517d6){_0x4a2238=_0x1517d6;if(!_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x99')]||!utils[_0x70f0('0x9c')](_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x99')])){throw new db['Sequelize'][(_0x70f0('0x8e'))]('Unknown\x20channel');}return _0x1517d6['remove'+_[_0x70f0('0xa2')](_0x5cf434['query'][_0x70f0('0x99')][_0x70f0('0x9f')]())+_0x70f0('0xa0')](_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x5b')]);}})[_0x70f0('0x12')](function(_0x5eb9ab){if(_[_0x70f0('0xab')](_0x5cf434['query'][_0x70f0('0x5b')])){for(var _0x2ba396=0x0;_0x2ba396<_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x5b')][_0x70f0('0x47')];_0x2ba396+=0x1){_0x46284e={'UserId':Number(_0x5cf434[_0x70f0('0x4f')]['id'])};_0x46284e[_['capitalize'](_0x5cf434[_0x70f0('0x3c')]['channel'][_0x70f0('0x9f')]())+'QueueId']=Number(_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x5b')][_0x2ba396]);socket[_0x70f0('0xa4')](_0x70f0('0x78')+_[_0x70f0('0xa2')](_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x99')][_0x70f0('0x9f')]())+'Queue:remove',_0x46284e);}}else{_0x46284e={'UserId':Number(_0x5cf434[_0x70f0('0x4f')]['id'])};_0x46284e[_[_0x70f0('0xa2')](_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x99')][_0x70f0('0x9f')]())+_0x70f0('0xa3')]=Number(_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x5b')]);socket['emit'](_0x70f0('0x78')+_[_0x70f0('0xa2')](_0x5cf434['query'][_0x70f0('0x99')][_0x70f0('0x9f')]())+_0x70f0('0xac'),_0x46284e);}return _0x5eb9ab;})[_0x70f0('0x12')](function(){if(_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x99')]===_0x70f0('0xa5')){return db[_0x70f0('0xaa')][_0x70f0('0x24')]({'where':{'UserId':_0x5cf434[_0x70f0('0x4f')]['id'],'VoiceQueueId':_0x5cf434[_0x70f0('0x3c')][_0x70f0('0x5b')]},'individualHooks':!![]})['then'](function(){return _0x4a2238;});}return _0x4a2238;})[_0x70f0('0x12')](respondWithStatusCode(_0x49596d,null))['catch'](handleError(_0x49596d,null));};exports[_0x70f0('0xad')]=function(_0x504553,_0x48dccf){_0x504553['body']['userpic']=_0x504553[_0x70f0('0xae')][_0x70f0('0xaf')];return db[_0x70f0('0x3b')][_0x70f0('0x56')]({'where':{'id':_0x504553[_0x70f0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x48dccf,null))['then'](saveUpdates(_0x504553['body'],null))[_0x70f0('0x12')](respondWithResult(_0x48dccf,null))[_0x70f0('0x1a')](handleError(_0x48dccf,null));};exports[_0x70f0('0xb0')]=function(_0x5eb5f6,_0x29e2ce){var _0x135b59=path['join'](config[_0x70f0('0xb1')],_0x70f0('0xb2'));return db[_0x70f0('0x3b')][_0x70f0('0x56')]({'where':{'id':_0x5eb5f6['params']['id']},'attributes':['id',_0x70f0('0xb3')],'raw':!![]})[_0x70f0('0x12')](handleEntityNotFound(_0x29e2ce,null))[_0x70f0('0x12')](function(_0x2e5781){if(_0x2e5781){if(_[_0x70f0('0x63')](_0x2e5781[_0x70f0('0xb3')])){return _0x29e2ce[_0x70f0('0xb4')](_0x135b59);}else{if(!fs[_0x70f0('0xb5')](path[_0x70f0('0xb6')](config[_0x70f0('0xb1')],_0x70f0('0xb7'),_0x2e5781[_0x70f0('0xb3')]))){return _0x29e2ce[_0x70f0('0xb4')](_0x135b59);}return _0x29e2ce[_0x70f0('0xb4')](path[_0x70f0('0xb6')](config[_0x70f0('0xb1')],_0x70f0('0xb7'),_0x2e5781[_0x70f0('0xb3')]));}}})['catch'](handleError(_0x29e2ce,null));};exports[_0x70f0('0xb8')]=function(_0x2b014d,_0x2bffc7){return db[_0x70f0('0x3b')][_0x70f0('0x56')]({'where':{'id':_0x2b014d['params']['id']},'attributes':['id']})[_0x70f0('0x12')](handleEntityNotFound(_0x2bffc7,null))['then'](function(_0x512b28){var _0x5ef199=[];values=_0x512b28[_0x70f0('0x48')];_0x5ef199[_0x70f0('0x43')](get_open_tabs(_0x70f0('0xb9'),_0x512b28[_0x70f0('0x48')]));_0x5ef199[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x49'),_0x512b28[_0x70f0('0x48')]));_0x5ef199[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x4b'),_0x512b28[_0x70f0('0x48')]));_0x5ef199['push'](get_open_tabs(_0x70f0('0x4c'),_0x512b28['dataValues']));_0x5ef199[_0x70f0('0x43')](get_open_tabs(_0x70f0('0x4a'),_0x512b28['dataValues']));_0x5ef199[_0x70f0('0x43')](get_open_tabs(_0x70f0('0xba'),_0x512b28[_0x70f0('0x48')]));return BPromise[_0x70f0('0x4d')](_0x5ef199);})[_0x70f0('0x12')](function(_0x25b8f3){if(_0x25b8f3){var _0x1d42ae=_[_0x70f0('0x33')](values[_0x70f0('0xbb')],function(_0x2b680e){return{'channel':'CHAT','id':_0x2b680e['id'],'createdAt':_0x2b680e[_0x70f0('0xbc')]};});var _0xa40af3=_['map'](values[_0x70f0('0xbd')],function(_0x3eb3c6){return{'channel':_0x70f0('0xbe'),'id':_0x3eb3c6['id'],'createdAt':_0x3eb3c6['createdAt']};});var _0x1b3427=_[_0x70f0('0x33')](values[_0x70f0('0xbf')],function(_0x2471f3){return{'channel':_0x70f0('0xc0'),'id':_0x2471f3['id'],'createdAt':_0x2471f3[_0x70f0('0xbc')]};});var _0x1c04af=_[_0x70f0('0x33')](values['MailOpenTabs'],function(_0x23b1c0){return{'channel':_0x70f0('0xc1'),'id':_0x23b1c0['id'],'createdAt':_0x23b1c0[_0x70f0('0xbc')]};});var _0x1e44a8=_[_0x70f0('0x33')](values[_0x70f0('0xc2')],function(_0x4a2481){return{'channel':'SMS','id':_0x4a2481['id'],'createdAt':_0x4a2481[_0x70f0('0xbc')]};});var _0xa0eca7=_[_0x70f0('0x33')](values[_0x70f0('0xc3')],function(_0x5ecc43){return{'channel':_0x70f0('0xc4'),'id':_0x5ecc43['id'],'createdAt':_0x5ecc43[_0x70f0('0xbc')]};});var _0x193252=_[_0x70f0('0xc5')](_0x1d42ae,_0xa40af3,_0x1b3427,_0x1c04af,_0x1e44a8,_0xa0eca7);var _0xa0ebb={'count':_0x193252['length'],'rows':_0x193252};return _0xa0ebb;}else return null;})[_0x70f0('0x12')](respondWithResult(_0x2bffc7,null))[_0x70f0('0x1a')](handleError(_0x2bffc7,null));};exports[_0x70f0('0xc6')]=function(_0x1c0242,_0x4a5395){var _0x14e0f0={};var _0x3cdaca={};var _0x52f8fe;var _0x5e28c2;return db['User'][_0x70f0('0x91')]({'where':{'id':_0x1c0242[_0x70f0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a5395,null))[_0x70f0('0x12')](function(_0x26c1b2){if(_0x26c1b2){_0x52f8fe=_0x26c1b2;_0x3cdaca[_0x70f0('0x50')]=_[_0x70f0('0x51')](db['CmContact'][_0x70f0('0x52')]);_0x3cdaca[_0x70f0('0x3c')]=_['keys'](_0x1c0242[_0x70f0('0x3c')]);_0x3cdaca[_0x70f0('0x53')]=_['intersection'](_0x3cdaca[_0x70f0('0x50')],_0x3cdaca[_0x70f0('0x3c')]);_0x14e0f0[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x3cdaca[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x1c0242[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x14e0f0[_0x70f0('0x42')]=_0x14e0f0[_0x70f0('0x42')][_0x70f0('0x47')]?_0x14e0f0[_0x70f0('0x42')]:_0x3cdaca[_0x70f0('0x50')];_0x14e0f0[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x1c0242[_0x70f0('0x3c')]['sort']);_0x14e0f0[_0x70f0('0x3a')]=qs['filters'](_['pick'](_0x1c0242[_0x70f0('0x3c')],_0x3cdaca[_0x70f0('0x53')]));if(_0x1c0242[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x14e0f0['where']=_[_0x70f0('0xc9')](_0x14e0f0[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x14e0f0[_0x70f0('0x42')],function(_0xc0932f){var _0x1b5547={};_0x1b5547[_0xc0932f]={'$like':'%'+_0x1c0242[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x1b5547;})});}_0x14e0f0=_[_0x70f0('0xc9')]({},_0x14e0f0,_0x1c0242[_0x70f0('0xca')]);return _0x52f8fe[_0x70f0('0xc6')](_0x14e0f0);}})[_0x70f0('0x12')](function(_0x35d006){if(_0x35d006){_0x5e28c2=_0x35d006[_0x70f0('0x47')];if(_0x1c0242[_0x70f0('0x3c')][_0x70f0('0xcb')](_0x70f0('0x3d'))){_0x14e0f0[_0x70f0('0x3e')]=[{'model':db[_0x70f0('0xcc')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x70f0('0xcd'),'attributes':['id',_0x70f0('0x30'),_0x70f0('0xce')],'where':_0x1c0242['query']['tag']?{'id':_0x1c0242[_0x70f0('0x3c')][_0x70f0('0xcf')]}:undefined,'required':_0x1c0242[_0x70f0('0x3c')][_0x70f0('0xcf')]?!![]:![]}];}if(!_0x1c0242[_0x70f0('0x3c')][_0x70f0('0xcb')](_0x70f0('0xd0'))){_0x14e0f0[_0x70f0('0x1f')]=qs[_0x70f0('0x1f')](_0x1c0242[_0x70f0('0x3c')][_0x70f0('0x1f')]);_0x14e0f0[_0x70f0('0x21')]=qs['offset'](_0x1c0242[_0x70f0('0x3c')][_0x70f0('0x21')]);}return _0x52f8fe[_0x70f0('0xc6')](_0x14e0f0);}})[_0x70f0('0x12')](function(_0x5404ff){if(_0x5404ff){return _0x5404ff?{'count':_0x5e28c2,'rows':_0x5404ff}:null;}})[_0x70f0('0x12')](respondWithResult(_0x4a5395,null))[_0x70f0('0x1a')](handleError(_0x4a5395,null));};exports['getQueues']=function(_0x417f7b,_0x2c2b66){var _0x111ce7;var _0xb405ed={};var _0xc5ed0;return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x417f7b['params']['id']},'attributes':['id',_0x70f0('0x30'),_0x70f0('0x26')]})[_0x70f0('0x12')](handleEntityNotFound(_0x2c2b66,null))[_0x70f0('0x12')](function(_0x364184){if(!utils['isValidChannel'](_0x417f7b[_0x70f0('0x3c')][_0x70f0('0x99')])){throw new db[(_0x70f0('0x8d'))]['ValidationError'](_0x70f0('0x9d'));}_0x111ce7=_0x364184;var _0xacaa8d={};_0xacaa8d[_0x70f0('0x50')]=_['keys'](db[_[_0x70f0('0xa2')](_0x417f7b[_0x70f0('0x3c')][_0x70f0('0x99')])+_0x70f0('0xd1')][_0x70f0('0x52')]);_0xacaa8d[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x417f7b[_0x70f0('0x3c')]);_0xacaa8d['filters']=_[_0x70f0('0x54')](_0xacaa8d[_0x70f0('0x50')],_0xacaa8d['query']);_0xb405ed[_0x70f0('0x42')]=_['intersection'](_0xacaa8d['model'],qs[_0x70f0('0x55')](_0x417f7b[_0x70f0('0x3c')]['fields']));_0xb405ed[_0x70f0('0x42')]=_0xb405ed[_0x70f0('0x42')][_0x70f0('0x47')]?_0xb405ed['attributes']:_0xacaa8d['model'];_0xb405ed[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x417f7b[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0xb405ed['where']=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x417f7b[_0x70f0('0x3c')],_0xacaa8d[_0x70f0('0x53')]));if(_0x417f7b[_0x70f0('0x3c')]['filter']){_0xb405ed[_0x70f0('0x3a')]=_[_0x70f0('0xc9')](_0xb405ed[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0xb405ed[_0x70f0('0x42')],function(_0x5dc399){var _0x51906a={};_0x51906a[_0x5dc399]={'$like':'%'+_0x417f7b[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x51906a;})});}_0xb405ed=_[_0x70f0('0xc9')]({},_0xb405ed,_0x417f7b[_0x70f0('0xca')]);switch(_0x111ce7['role']){case _0x70f0('0x27'):return db[_['capitalize'](_0x417f7b[_0x70f0('0x3c')][_0x70f0('0x99')])+_0x70f0('0xd1')][_0x70f0('0x44')](_0xb405ed);case _0x70f0('0x78'):case _0x70f0('0x2a'):return _0x111ce7[_0x70f0('0x25')+_[_0x70f0('0xa2')](_0x417f7b[_0x70f0('0x3c')][_0x70f0('0x99')])+'Queues'](_0xb405ed);default:throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))]('Unknown\x20role');}})[_0x70f0('0x12')](function(_0x943c99){_0xc5ed0=_0x943c99['length'];if(!_0x417f7b[_0x70f0('0x3c')][_0x70f0('0xcb')](_0x70f0('0xd0'))){_0xb405ed[_0x70f0('0x1f')]=qs[_0x70f0('0x1f')](_0x417f7b[_0x70f0('0x3c')]['limit']);_0xb405ed[_0x70f0('0x21')]=qs['offset'](_0x417f7b['query'][_0x70f0('0x21')]);}switch(_0x111ce7[_0x70f0('0x26')]){case'admin':return db[_[_0x70f0('0xa2')](_0x417f7b[_0x70f0('0x3c')][_0x70f0('0x99')])+_0x70f0('0xd1')]['findAll'](_0xb405ed);case _0x70f0('0x78'):case _0x70f0('0x2a'):return _0x111ce7[_0x70f0('0x25')+_[_0x70f0('0xa2')](_0x417f7b['query'][_0x70f0('0x99')])+_0x70f0('0xa0')](_0xb405ed);}})[_0x70f0('0x12')](function(_0x171e14){return{'count':_0xc5ed0,'rows':_0x171e14};})[_0x70f0('0x12')](respondWithResult(_0x2c2b66,null))['catch'](handleError(_0x2c2b66,null));};exports[_0x70f0('0xd3')]=function(_0x4a6996,_0x53f9b3){var _0x117794={};var _0xefd3d5={};var _0x595d8a;var _0x588bfc;return db[_0x70f0('0x3b')]['findOne']({'where':{'id':_0x4a6996[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x53f9b3,null))[_0x70f0('0x12')](function(_0x26346b){if(_0x26346b){_0x595d8a=_0x26346b;_0xefd3d5[_0x70f0('0x50')]=_[_0x70f0('0x51')](db[_0x70f0('0xaa')][_0x70f0('0x52')]);_0xefd3d5[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x4a6996[_0x70f0('0x3c')]);_0xefd3d5['filters']=_[_0x70f0('0x54')](_0xefd3d5[_0x70f0('0x50')],_0xefd3d5['query']);_0x117794[_0x70f0('0x42')]=_['intersection'](_0xefd3d5[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x4a6996[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x117794[_0x70f0('0x42')]=_0x117794[_0x70f0('0x42')][_0x70f0('0x47')]?_0x117794[_0x70f0('0x42')]:_0xefd3d5['model'];_0x117794[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x4a6996[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x117794[_0x70f0('0x3a')]=qs['filters'](_['pick'](_0x4a6996[_0x70f0('0x3c')],_0xefd3d5[_0x70f0('0x53')]));if(_0x4a6996[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x117794[_0x70f0('0x3a')]=_[_0x70f0('0xc9')](_0x117794['where'],{'$or':_[_0x70f0('0x33')](_0x117794[_0x70f0('0x42')],function(_0x6e1cad){var _0x238a4f={};_0x238a4f[_0x6e1cad]={'$like':'%'+_0x4a6996[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x238a4f;})});}_0x117794=_[_0x70f0('0xc9')]({},_0x117794,_0x4a6996[_0x70f0('0xca')]);return _0x595d8a[_0x70f0('0xd3')](_0x117794);}})[_0x70f0('0x12')](function(_0x5ddf4e){if(_0x5ddf4e){_0x588bfc=_0x5ddf4e[_0x70f0('0x47')];if(!_0x4a6996[_0x70f0('0x3c')]['hasOwnProperty'](_0x70f0('0xd0'))){_0x117794['limit']=qs[_0x70f0('0x1f')](_0x4a6996['query']['limit']);_0x117794[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x4a6996[_0x70f0('0x3c')]['offset']);}return _0x595d8a[_0x70f0('0xd3')](_0x117794);}})['then'](function(_0x289926){if(_0x289926){return _0x289926?{'count':_0x588bfc,'rows':_0x289926}:null;}})[_0x70f0('0x12')](respondWithResult(_0x53f9b3,null))[_0x70f0('0x1a')](handleError(_0x53f9b3,null));};exports[_0x70f0('0xd4')]=function(_0x1e06fc,_0x56a74a){var _0x107a21={};var _0x257e6e={};var _0x219cdb;var _0x578131;return db[_0x70f0('0x3b')]['findOne']({'where':{'id':_0x1e06fc['params']['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x56a74a,null))[_0x70f0('0x12')](function(_0x11d0e8){if(_0x11d0e8){_0x219cdb=_0x11d0e8;_0x257e6e[_0x70f0('0x50')]=_[_0x70f0('0x51')](db[_0x70f0('0xd5')][_0x70f0('0x52')]);_0x257e6e[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x1e06fc[_0x70f0('0x3c')]);_0x257e6e[_0x70f0('0x53')]=_['intersection'](_0x257e6e[_0x70f0('0x50')],_0x257e6e[_0x70f0('0x3c')]);_0x107a21[_0x70f0('0x42')]=_['intersection'](_0x257e6e[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x1e06fc['query'][_0x70f0('0x55')]));_0x107a21[_0x70f0('0x42')]=_0x107a21[_0x70f0('0x42')][_0x70f0('0x47')]?_0x107a21['attributes']:_0x257e6e[_0x70f0('0x50')];_0x107a21[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x1e06fc[_0x70f0('0x3c')]['sort']);_0x107a21[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_['pick'](_0x1e06fc['query'],_0x257e6e[_0x70f0('0x53')]));if(_0x1e06fc[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x107a21['where']=_[_0x70f0('0xc9')](_0x107a21[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x107a21['attributes'],function(_0x54a72c){var _0x3f90db={};_0x3f90db[_0x54a72c]={'$like':'%'+_0x1e06fc['query'][_0x70f0('0x37')]+'%'};return _0x3f90db;})});}_0x107a21=_[_0x70f0('0xc9')]({},_0x107a21,_0x1e06fc['options']);return _0x219cdb[_0x70f0('0xd4')](_0x107a21);}})[_0x70f0('0x12')](function(_0x16390e){if(_0x16390e){_0x578131=_0x16390e['length'];if(!_0x1e06fc[_0x70f0('0x3c')][_0x70f0('0xcb')]('nolimit')){_0x107a21['limit']=qs[_0x70f0('0x1f')](_0x1e06fc[_0x70f0('0x3c')]['limit']);_0x107a21[_0x70f0('0x21')]=qs['offset'](_0x1e06fc[_0x70f0('0x3c')]['offset']);}return _0x219cdb[_0x70f0('0xd4')](_0x107a21);}})['then'](function(_0x30daf2){if(_0x30daf2){return _0x30daf2?{'count':_0x578131,'rows':_0x30daf2}:null;}})[_0x70f0('0x12')](respondWithResult(_0x56a74a,null))[_0x70f0('0x1a')](handleError(_0x56a74a,null));};exports[_0x70f0('0xd6')]=function(_0x3a53fa,_0x56fe4f){var _0x255344={'raw':!![],'where':{}};var _0x5effe9={};var _0x4ed13d={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x3a53fa[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x56fe4f,null))[_0x70f0('0x12')](function(_0x2e7e02){if(_0x2e7e02){_0x5effe9[_0x70f0('0x50')]=_[_0x70f0('0x51')](db[_0x70f0('0xd7')][_0x70f0('0x52')]);_0x5effe9[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x3a53fa['query']);_0x5effe9[_0x70f0('0x53')]=_[_0x70f0('0x54')](_0x5effe9['model'],_0x5effe9[_0x70f0('0x3c')]);_0x255344['attributes']=_[_0x70f0('0x54')](_0x5effe9['model'],qs[_0x70f0('0x55')](_0x3a53fa['query']['fields']));_0x255344[_0x70f0('0x42')]=_0x255344[_0x70f0('0x42')][_0x70f0('0x47')]?_0x255344[_0x70f0('0x42')]:_0x5effe9[_0x70f0('0x50')];if(!_0x3a53fa[_0x70f0('0x3c')]['hasOwnProperty'](_0x70f0('0xd0'))){_0x255344[_0x70f0('0x1f')]=qs[_0x70f0('0x1f')](_0x3a53fa['query'][_0x70f0('0x1f')]);_0x255344['offset']=qs['offset'](_0x3a53fa['query'][_0x70f0('0x21')]);}_0x255344[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x3a53fa[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x255344[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x3a53fa[_0x70f0('0x3c')],_0x5effe9[_0x70f0('0x53')]));_0x255344['where']['UserId']=_0x2e7e02['id'];if(_0x3a53fa[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x255344[_0x70f0('0x3a')]=_[_0x70f0('0xc9')](_0x255344['where'],{'$or':_[_0x70f0('0x33')](_0x255344[_0x70f0('0x42')],function(_0x53732f){var _0x358e15={};_0x358e15[_0x53732f]={'$like':'%'+_0x3a53fa[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x358e15;})});}_0x255344=_[_0x70f0('0xc9')]({},_0x255344,_0x3a53fa['options']);return db[_0x70f0('0xd7')][_0x70f0('0x20')]({'where':_0x255344[_0x70f0('0x3a')]})[_0x70f0('0x12')](function(_0x3d4faa){_0x4ed13d[_0x70f0('0x20')]=_0x3d4faa;if(_0x3a53fa[_0x70f0('0x3c')][_0x70f0('0x3d')]){_0x255344[_0x70f0('0x3e')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x255344);})[_0x70f0('0x12')](function(_0x22b822){_0x4ed13d['rows']=_0x22b822;return _0x4ed13d;});}})[_0x70f0('0x12')](respondWithFilteredResult(_0x56fe4f,_0x255344))[_0x70f0('0x1a')](handleError(_0x56fe4f,null));};exports[_0x70f0('0xd8')]=function(_0x34526d,_0x22aead){var _0x57df87={'raw':!![],'where':{}};var _0x50ce8a={};var _0x114ee4={'count':0x0,'rows':[]};return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x34526d[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x22aead,null))[_0x70f0('0x12')](function(_0x125a9c){if(_0x125a9c){_0x50ce8a['model']=_[_0x70f0('0x51')](db[_0x70f0('0xd9')][_0x70f0('0x52')]);_0x50ce8a['query']=_['keys'](_0x34526d[_0x70f0('0x3c')]);_0x50ce8a['filters']=_[_0x70f0('0x54')](_0x50ce8a['model'],_0x50ce8a[_0x70f0('0x3c')]);_0x57df87['attributes']=_[_0x70f0('0x54')](_0x50ce8a[_0x70f0('0x50')],qs['fields'](_0x34526d[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x57df87[_0x70f0('0x42')]=_0x57df87['attributes']['length']?_0x57df87[_0x70f0('0x42')]:_0x50ce8a[_0x70f0('0x50')];if(!_0x34526d[_0x70f0('0x3c')][_0x70f0('0xcb')](_0x70f0('0xd0'))){_0x57df87['limit']=qs['limit'](_0x34526d[_0x70f0('0x3c')][_0x70f0('0x1f')]);_0x57df87[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x34526d['query'][_0x70f0('0x21')]);}_0x57df87['order']=qs[_0x70f0('0xc8')](_0x34526d[_0x70f0('0x3c')]['sort']);_0x57df87[_0x70f0('0x3a')]=qs['filters'](_[_0x70f0('0xd2')](_0x34526d[_0x70f0('0x3c')],_0x50ce8a[_0x70f0('0x53')]));_0x57df87[_0x70f0('0x3a')][_0x70f0('0xda')]=_0x125a9c['id'];if(_0x34526d[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x57df87['where']=_[_0x70f0('0xc9')](_0x57df87['where'],{'$or':_[_0x70f0('0x33')](_0x57df87['attributes'],function(_0x4dff74){var _0x55a6ed={};_0x55a6ed[_0x4dff74]={'$like':'%'+_0x34526d[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x55a6ed;})});}_0x57df87=_['merge']({},_0x57df87,_0x34526d['options']);return db['ScreenRecording'][_0x70f0('0x20')]({'where':_0x57df87['where']})['then'](function(_0x302c47){_0x114ee4[_0x70f0('0x20')]=_0x302c47;if(_0x34526d[_0x70f0('0x3c')]['includeAll']){_0x57df87[_0x70f0('0x3e')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x57df87);})[_0x70f0('0x12')](function(_0x429172){_0x114ee4[_0x70f0('0x46')]=_0x429172;return _0x114ee4;});}})['then'](respondWithFilteredResult(_0x22aead,_0x57df87))[_0x70f0('0x1a')](handleError(_0x22aead,null));};exports[_0x70f0('0xdb')]=function(_0x3d21a7,_0x172906){var _0xa8f9de={};var _0x522214={};var _0x8efc8b;var _0x43e78f;return db[_0x70f0('0x3b')]['findOne']({'where':{'id':_0x3d21a7[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x172906,null))['then'](function(_0x1359fa){if(_0x1359fa){_0x8efc8b=_0x1359fa;_0x522214[_0x70f0('0x50')]=_['keys'](db[_0x70f0('0xdc')][_0x70f0('0x52')]);_0x522214['query']=_[_0x70f0('0x51')](_0x3d21a7['query']);_0x522214[_0x70f0('0x53')]=_[_0x70f0('0x54')](_0x522214[_0x70f0('0x50')],_0x522214['query']);_0xa8f9de[_0x70f0('0x42')]=_['intersection'](_0x522214[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x3d21a7[_0x70f0('0x3c')]['fields']));_0xa8f9de[_0x70f0('0x42')]=_0xa8f9de['attributes'][_0x70f0('0x47')]?_0xa8f9de[_0x70f0('0x42')]:_0x522214[_0x70f0('0x50')];_0xa8f9de[_0x70f0('0xc7')]=qs['sort'](_0x3d21a7[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0xa8f9de[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x3d21a7['query'],_0x522214[_0x70f0('0x53')]));if(_0x3d21a7['query'][_0x70f0('0x37')]){_0xa8f9de['where']=_['merge'](_0xa8f9de['where'],{'$or':_[_0x70f0('0x33')](_0xa8f9de['attributes'],function(_0x19f9ac){var _0x282347={};_0x282347[_0x19f9ac]={'$like':'%'+_0x3d21a7[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x282347;})});}_0xa8f9de=_[_0x70f0('0xc9')]({},_0xa8f9de,_0x3d21a7[_0x70f0('0xca')]);return _0x8efc8b[_0x70f0('0xdb')](_0xa8f9de);}})['then'](function(_0x11e8a1){if(_0x11e8a1){_0x43e78f=_0x11e8a1[_0x70f0('0x47')];if(!_0x3d21a7[_0x70f0('0x3c')][_0x70f0('0xcb')]('nolimit')){_0xa8f9de[_0x70f0('0x1f')]=qs['limit'](_0x3d21a7['query'][_0x70f0('0x1f')]);_0xa8f9de[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x3d21a7[_0x70f0('0x3c')][_0x70f0('0x21')]);}return _0x8efc8b['getChatInteractions'](_0xa8f9de);}})[_0x70f0('0x12')](function(_0x248027){if(_0x248027){return _0x248027?{'count':_0x43e78f,'rows':_0x248027}:null;}})['then'](respondWithResult(_0x172906,null))[_0x70f0('0x1a')](handleError(_0x172906,null));};exports[_0x70f0('0xdd')]=function(_0x80bd64,_0x570807){var _0x53746b={};var _0x1281ba={};var _0x4dd2d4;var _0x33e1ff;return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x80bd64['params']['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x570807,null))[_0x70f0('0x12')](function(_0x4ffe23){if(_0x4ffe23){_0x4dd2d4=_0x4ffe23;_0x1281ba[_0x70f0('0x50')]=_[_0x70f0('0x51')](db['OpenchannelInteraction'][_0x70f0('0x52')]);_0x1281ba[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x80bd64[_0x70f0('0x3c')]);_0x1281ba[_0x70f0('0x53')]=_['intersection'](_0x1281ba[_0x70f0('0x50')],_0x1281ba[_0x70f0('0x3c')]);_0x53746b['attributes']=_[_0x70f0('0x54')](_0x1281ba['model'],qs['fields'](_0x80bd64[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x53746b[_0x70f0('0x42')]=_0x53746b[_0x70f0('0x42')][_0x70f0('0x47')]?_0x53746b['attributes']:_0x1281ba[_0x70f0('0x50')];_0x53746b[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x80bd64[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x53746b[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x80bd64[_0x70f0('0x3c')],_0x1281ba[_0x70f0('0x53')]));if(_0x80bd64[_0x70f0('0x3c')]['filter']){_0x53746b[_0x70f0('0x3a')]=_['merge'](_0x53746b[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x53746b['attributes'],function(_0x4f3b07){var _0x4445ed={};_0x4445ed[_0x4f3b07]={'$like':'%'+_0x80bd64[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x4445ed;})});}_0x53746b=_[_0x70f0('0xc9')]({},_0x53746b,_0x80bd64[_0x70f0('0xca')]);return _0x4dd2d4[_0x70f0('0xdd')](_0x53746b);}})['then'](function(_0x19b144){if(_0x19b144){_0x33e1ff=_0x19b144['length'];if(!_0x80bd64['query'][_0x70f0('0xcb')]('nolimit')){_0x53746b['limit']=qs[_0x70f0('0x1f')](_0x80bd64[_0x70f0('0x3c')][_0x70f0('0x1f')]);_0x53746b[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x80bd64[_0x70f0('0x3c')][_0x70f0('0x21')]);}return _0x4dd2d4[_0x70f0('0xdd')](_0x53746b);}})[_0x70f0('0x12')](function(_0x204054){if(_0x204054){return _0x204054?{'count':_0x33e1ff,'rows':_0x204054}:null;}})[_0x70f0('0x12')](respondWithResult(_0x570807,null))[_0x70f0('0x1a')](handleError(_0x570807,null));};exports[_0x70f0('0xde')]=function(_0x5ec3e2,_0x5d1c00){var _0x1d916a={'raw':!![],'where':{}};var _0x767b89={};var _0x231637={'count':0x0,'rows':[]};return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x5ec3e2[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x5d1c00,null))['then'](function(_0x545d1f){if(_0x545d1f){_0x767b89[_0x70f0('0x50')]=_[_0x70f0('0x51')](db[_0x70f0('0xdf')][_0x70f0('0x52')]);_0x767b89[_0x70f0('0x3c')]=_['keys'](_0x5ec3e2['query']);_0x767b89[_0x70f0('0x53')]=_['intersection'](_0x767b89[_0x70f0('0x50')],_0x767b89['query']);_0x1d916a[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x767b89[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x5ec3e2[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x1d916a[_0x70f0('0x42')]=_0x1d916a[_0x70f0('0x42')]['length']?_0x1d916a[_0x70f0('0x42')]:_0x767b89[_0x70f0('0x50')];if(!_0x5ec3e2[_0x70f0('0x3c')][_0x70f0('0xcb')]('nolimit')){_0x1d916a[_0x70f0('0x1f')]=qs[_0x70f0('0x1f')](_0x5ec3e2[_0x70f0('0x3c')][_0x70f0('0x1f')]);_0x1d916a[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x5ec3e2[_0x70f0('0x3c')]['offset']);}_0x1d916a[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x5ec3e2[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x1d916a[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x5ec3e2[_0x70f0('0x3c')],_0x767b89[_0x70f0('0x53')]));_0x1d916a[_0x70f0('0x3a')]['UserId']=_0x545d1f['id'];if(_0x5ec3e2[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x1d916a[_0x70f0('0x3a')]=_['merge'](_0x1d916a[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x1d916a[_0x70f0('0x42')],function(_0x267faa){var _0x2c6864={};_0x2c6864[_0x267faa]={'$like':'%'+_0x5ec3e2[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x2c6864;})});}_0x1d916a=_['merge']({},_0x1d916a,_0x5ec3e2[_0x70f0('0xca')]);return db[_0x70f0('0xdf')][_0x70f0('0x20')]({'where':_0x1d916a[_0x70f0('0x3a')]})['then'](function(_0x2716fa){_0x231637[_0x70f0('0x20')]=_0x2716fa;if(_0x5ec3e2[_0x70f0('0x3c')][_0x70f0('0x3d')]){_0x1d916a[_0x70f0('0x3e')]=[{'all':!![]}];}return db[_0x70f0('0xdf')][_0x70f0('0x44')](_0x1d916a);})['then'](function(_0x29627d){_0x231637[_0x70f0('0x46')]=_0x29627d;return _0x231637;});}})['then'](respondWithFilteredResult(_0x5d1c00,_0x1d916a))['catch'](handleError(_0x5d1c00,null));};exports['getSmsInteractions']=function(_0x48586a,_0x297253){var _0x16f147={};var _0x4927ec={};var _0x56ca90;var _0x43925f;return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x48586a[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x297253,null))[_0x70f0('0x12')](function(_0x23a668){if(_0x23a668){_0x56ca90=_0x23a668;_0x4927ec[_0x70f0('0x50')]=_[_0x70f0('0x51')](db[_0x70f0('0xe0')][_0x70f0('0x52')]);_0x4927ec[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x48586a['query']);_0x4927ec[_0x70f0('0x53')]=_[_0x70f0('0x54')](_0x4927ec[_0x70f0('0x50')],_0x4927ec[_0x70f0('0x3c')]);_0x16f147[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x4927ec[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x48586a[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x16f147[_0x70f0('0x42')]=_0x16f147[_0x70f0('0x42')]['length']?_0x16f147['attributes']:_0x4927ec[_0x70f0('0x50')];_0x16f147[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x48586a[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x16f147['where']=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x48586a[_0x70f0('0x3c')],_0x4927ec[_0x70f0('0x53')]));if(_0x48586a['query'][_0x70f0('0x37')]){_0x16f147[_0x70f0('0x3a')]=_[_0x70f0('0xc9')](_0x16f147['where'],{'$or':_[_0x70f0('0x33')](_0x16f147['attributes'],function(_0x358917){var _0x2bcaa3={};_0x2bcaa3[_0x358917]={'$like':'%'+_0x48586a['query']['filter']+'%'};return _0x2bcaa3;})});}_0x16f147=_[_0x70f0('0xc9')]({},_0x16f147,_0x48586a['options']);return _0x56ca90[_0x70f0('0xe1')](_0x16f147);}})[_0x70f0('0x12')](function(_0x4260f0){if(_0x4260f0){_0x43925f=_0x4260f0['length'];if(!_0x48586a[_0x70f0('0x3c')]['hasOwnProperty'](_0x70f0('0xd0'))){_0x16f147[_0x70f0('0x1f')]=qs[_0x70f0('0x1f')](_0x48586a['query'][_0x70f0('0x1f')]);_0x16f147[_0x70f0('0x21')]=qs['offset'](_0x48586a[_0x70f0('0x3c')][_0x70f0('0x21')]);}return _0x56ca90['getSmsInteractions'](_0x16f147);}})[_0x70f0('0x12')](function(_0x471358){if(_0x471358){return _0x471358?{'count':_0x43925f,'rows':_0x471358}:null;}})[_0x70f0('0x12')](respondWithResult(_0x297253,null))['catch'](handleError(_0x297253,null));};exports[_0x70f0('0xe2')]=function(_0x5353e1,_0x15fd83){var _0x287cfa={};var _0x4aceb6={};var _0x3ac102;var _0x54371d;return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x5353e1[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x15fd83,null))[_0x70f0('0x12')](function(_0x1d604a){if(_0x1d604a){_0x3ac102=_0x1d604a;_0x4aceb6[_0x70f0('0x50')]=_[_0x70f0('0x51')](db['FaxInteraction'][_0x70f0('0x52')]);_0x4aceb6[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x5353e1[_0x70f0('0x3c')]);_0x4aceb6[_0x70f0('0x53')]=_['intersection'](_0x4aceb6['model'],_0x4aceb6[_0x70f0('0x3c')]);_0x287cfa[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x4aceb6[_0x70f0('0x50')],qs['fields'](_0x5353e1[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x287cfa[_0x70f0('0x42')]=_0x287cfa['attributes'][_0x70f0('0x47')]?_0x287cfa[_0x70f0('0x42')]:_0x4aceb6[_0x70f0('0x50')];_0x287cfa['order']=qs[_0x70f0('0xc8')](_0x5353e1['query']['sort']);_0x287cfa[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x5353e1[_0x70f0('0x3c')],_0x4aceb6[_0x70f0('0x53')]));if(_0x5353e1[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x287cfa[_0x70f0('0x3a')]=_[_0x70f0('0xc9')](_0x287cfa[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x287cfa[_0x70f0('0x42')],function(_0x141a7a){var _0x3c35a5={};_0x3c35a5[_0x141a7a]={'$like':'%'+_0x5353e1[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x3c35a5;})});}_0x287cfa=_[_0x70f0('0xc9')]({},_0x287cfa,_0x5353e1[_0x70f0('0xca')]);return _0x3ac102[_0x70f0('0xe2')](_0x287cfa);}})[_0x70f0('0x12')](function(_0x5cc09c){if(_0x5cc09c){_0x54371d=_0x5cc09c[_0x70f0('0x47')];if(!_0x5353e1[_0x70f0('0x3c')][_0x70f0('0xcb')]('nolimit')){_0x287cfa['limit']=qs[_0x70f0('0x1f')](_0x5353e1[_0x70f0('0x3c')][_0x70f0('0x1f')]);_0x287cfa[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x5353e1['query']['offset']);}return _0x3ac102[_0x70f0('0xe2')](_0x287cfa);}})[_0x70f0('0x12')](function(_0xf7f1fb){if(_0xf7f1fb){return _0xf7f1fb?{'count':_0x54371d,'rows':_0xf7f1fb}:null;}})[_0x70f0('0x12')](respondWithResult(_0x15fd83,null))[_0x70f0('0x1a')](handleError(_0x15fd83,null));};exports[_0x70f0('0xe3')]=function(_0x113770,_0x395654){var _0x43e2d1={};var _0x49d920={};var _0x30d918;var _0x39051d;return db[_0x70f0('0x3b')]['findOne']({'where':{'id':_0x113770['params']['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x395654,null))[_0x70f0('0x12')](function(_0x2e9842){if(_0x2e9842){_0x30d918=_0x2e9842;_0x49d920[_0x70f0('0x50')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x49d920['query']=_[_0x70f0('0x51')](_0x113770[_0x70f0('0x3c')]);_0x49d920[_0x70f0('0x53')]=_[_0x70f0('0x54')](_0x49d920['model'],_0x49d920[_0x70f0('0x3c')]);_0x43e2d1[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x49d920['model'],qs['fields'](_0x113770[_0x70f0('0x3c')]['fields']));_0x43e2d1[_0x70f0('0x42')]=_0x43e2d1[_0x70f0('0x42')]['length']?_0x43e2d1['attributes']:_0x49d920[_0x70f0('0x50')];_0x43e2d1[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x113770[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x43e2d1['where']=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0x113770['query'],_0x49d920[_0x70f0('0x53')]));if(_0x113770[_0x70f0('0x3c')][_0x70f0('0x37')]){_0x43e2d1[_0x70f0('0x3a')]=_[_0x70f0('0xc9')](_0x43e2d1[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x43e2d1['attributes'],function(_0x440b0c){var _0x4c9e7e={};_0x4c9e7e[_0x440b0c]={'$like':'%'+_0x113770[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x4c9e7e;})});}_0x43e2d1=_[_0x70f0('0xc9')]({},_0x43e2d1,_0x113770['options']);return _0x30d918['getWhatsappInteractions'](_0x43e2d1);}})['then'](function(_0x46b561){if(_0x46b561){_0x39051d=_0x46b561[_0x70f0('0x47')];if(!_0x113770[_0x70f0('0x3c')][_0x70f0('0xcb')](_0x70f0('0xd0'))){_0x43e2d1[_0x70f0('0x1f')]=qs['limit'](_0x113770[_0x70f0('0x3c')][_0x70f0('0x1f')]);_0x43e2d1[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x113770[_0x70f0('0x3c')]['offset']);}return _0x30d918[_0x70f0('0xe3')](_0x43e2d1);}})[_0x70f0('0x12')](function(_0xcc461){if(_0xcc461){return _0xcc461?{'count':_0x39051d,'rows':_0xcc461}:null;}})[_0x70f0('0x12')](respondWithResult(_0x395654,null))[_0x70f0('0x1a')](handleError(_0x395654,null));};exports[_0x70f0('0xe4')]=function(_0x439937,_0x10ecda,_0x1210b4){var _0x3fe98a;var _0x16b1ef;var _0x481aba;var _0x42ebe2=!_['isNil'](_0x439937[_0x70f0('0x4f')]['id'])?_0x439937[_0x70f0('0x4f')]['id']:!_[_0x70f0('0x63')](_0x439937[_0x70f0('0x78')]['id'])?_0x439937['user']['id']:null;return db[_0x70f0('0x3b')][_0x70f0('0x56')]({'where':{'id':_0x42ebe2,'role':{'$or':['admin',_0x70f0('0x78'),_0x70f0('0x2a')]}},'attributes':['id',_0x70f0('0x30'),_0x70f0('0xe5'),_0x70f0('0xe6'),_0x70f0('0x26'),_0x70f0('0x5d'),_0x70f0('0xe7')]})['then'](function(_0x3d09be){if(_0x3d09be){if(_0x3d09be[_0x70f0('0x26')]===_0x70f0('0x2a')){_0x3fe98a=_0x3d09be;if(_0x439937[_0x70f0('0x58')][_0x70f0('0xa7')]){_0x481aba=util['format']('LOCAL/%s@from-sip/n',_0x3fe98a[_0x439937[_0x70f0('0x58')]['interface']]);}else if(_0x439937[_0x70f0('0x58')][_0x70f0('0xe8')]){_0x481aba=util[_0x70f0('0xa8')](_0x70f0('0xe9'),_0x439937[_0x70f0('0x58')][_0x70f0('0xe8')]);}else{_0x481aba=util[_0x70f0('0xa8')](_0x70f0('0xe9'),_0x3fe98a['name']);}socket['to'](util[_0x70f0('0xa8')](_0x70f0('0xea'),_0x3fe98a[_0x70f0('0x30')]))[_0x70f0('0xa4')]('user:forcelogout',{'user':{'id':_0x3fe98a['id'],'name':_0x3fe98a['name']},'ip':_0x439937[_0x70f0('0xeb')][_0x70f0('0xec')]||_0x439937[_0x70f0('0xed')]['remoteAddress']||_0x439937[_0x70f0('0xee')][_0x70f0('0xef')]||_0x439937[_0x70f0('0xed')][_0x70f0('0xee')][_0x70f0('0xef')]});return db[_0x70f0('0xaa')][_0x70f0('0x24')]({'where':{'membername':_0x3fe98a[_0x70f0('0x30')]},'individualHooks':!![]});}}else{throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))](_0x70f0('0xf0'));}})['then'](function(){if(_0x3fe98a){return _0x3fe98a['getVoiceQueues']({'raw':!![]});}})[_0x70f0('0x12')](function(_0x5d09a1){if(_0x3fe98a){var _0x320bfe=[];if(_0x5d09a1){_0x16b1ef=_0x5d09a1;if(_0x16b1ef['length']){for(var _0x1ec975=0x0;_0x1ec975<_0x16b1ef[_0x70f0('0x47')];_0x1ec975++){_0x320bfe['push']({'membername':_0x3fe98a[_0x70f0('0x30')],'UserId':_0x3fe98a['id'],'queue_name':_0x16b1ef[_0x1ec975][_0x70f0('0x30')],'VoiceQueueId':_0x16b1ef[_0x1ec975]['id'],'interface':_0x481aba,'paused':_0x3fe98a[_0x70f0('0xe7')]||![],'penalty':_0x16b1ef[_0x1ec975]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x70f0('0x84')](_0x320bfe,function(_0x1c9856){return db['UserVoiceQueueRt']['upsert'](_0x1c9856);});}}}})['then'](function(){if(_0x3fe98a){return db['MemberReport']['findAll']({'where':{'membername':_0x3fe98a[_0x70f0('0x30')],'exitAt':null}});}})[_0x70f0('0x12')](function(_0x307c1f){if(_0x3fe98a){var _0x114d17=[];_0x307c1f['forEach'](function(_0x26ae1e){_0x114d17[_0x70f0('0x43')](_0x26ae1e[_0x70f0('0x57')]({'exitAt':moment()[_0x70f0('0xa8')](_0x70f0('0xf1'))}));});return BPromise[_0x70f0('0x4d')](_0x114d17);}})['then'](function(){if(_0x3fe98a){var _0x37dc17=[];var _0x54d85f=[];var _0x7330c7=utils['getChannels']();var _0x1b6d59={'membername':_0x3fe98a[_0x70f0('0x30')],'interface':_0x481aba,'enterAt':moment()[_0x70f0('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3fe98a[_0x70f0('0x26')],'internal':_0x3fe98a[_0x70f0('0x5d')]};_0x7330c7['forEach'](function(_0x2d218f){_0x37dc17[_0x70f0('0x43')](_['merge']({'channel':_0x2d218f,'type':_0x70f0('0xf2'),'data1':_0x439937[_0x70f0('0x58')][_0x70f0('0xf3')],'data2':_0x481aba},_0x1b6d59));if(_0x3fe98a['loginInPause']){_0x54d85f[_0x70f0('0x43')](_[_0x70f0('0xc9')]({'channel':_0x2d218f,'type':_0x70f0('0xf4'),'data1':'LOGININPAUSE'},_0x1b6d59));}});return db[_0x70f0('0xf5')][_0x70f0('0x81')](_0x37dc17[_0x70f0('0xc5')](_0x54d85f),{'individualHooks':!![]});}})[_0x70f0('0x12')](function(){if(_0x3fe98a){return _0x3fe98a[_0x70f0('0x57')]({'online':!![],'lastLoginAt':moment()[_0x70f0('0xa8')](_0x70f0('0xf1')),'voicePause':_0x3fe98a[_0x70f0('0xe7')]||![],'mailPause':_0x3fe98a[_0x70f0('0xe7')]||![],'chatPause':_0x3fe98a['loginInPause']||![],'faxPause':_0x3fe98a[_0x70f0('0xe7')]||![],'smsPause':_0x3fe98a[_0x70f0('0xe7')]||![],'openchannelPause':_0x3fe98a['loginInPause']||![],'whatsappPause':_0x3fe98a[_0x70f0('0xe7')]||![],'pauseType':_0x3fe98a[_0x70f0('0xe7')]?_0x70f0('0xf6'):null,'interface':_0x481aba,'lastPauseAt':moment()[_0x70f0('0xa8')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0xbb6b09){if(_0x439937[_0x70f0('0xf7')]){return _0x1210b4();}else{return BPromise['resolve'](_0xbb6b09)[_0x70f0('0x12')](respondWithResult(_0x10ecda,null));}})[_0x70f0('0x1a')](handleError(_0x10ecda,null));};exports[_0x70f0('0xf8')]=function(_0x5aa6fe,_0x41a70e){var _0x3575af;return db[_0x70f0('0x3b')]['find']({'where':{'id':_0x5aa6fe[_0x70f0('0x4f')]['id'],'role':_0x70f0('0x2a')},'attributes':['id',_0x70f0('0x30'),_0x70f0('0x26')]})[_0x70f0('0x12')](handleEntityNotFound(_0x41a70e,null))[_0x70f0('0x12')](function(_0x216b7d){if(_0x216b7d){_0x3575af=_0x216b7d;return db[_0x70f0('0xaa')][_0x70f0('0x24')]({'where':{'membername':_0x3575af[_0x70f0('0x30')]},'individualHooks':!![]});}})[_0x70f0('0x12')](function(){return db[_0x70f0('0xf5')][_0x70f0('0x44')]({'where':{'membername':_0x3575af[_0x70f0('0x30')],'exitAt':null}});})[_0x70f0('0x12')](function(_0x383d8c){var _0x105027=[];_0x383d8c[_0x70f0('0xf9')](function(_0x19c2db){_0x105027[_0x70f0('0x43')](_0x19c2db[_0x70f0('0x57')]({'exitAt':moment()[_0x70f0('0xa8')](_0x70f0('0xf1'))}));});return BPromise['all'](_0x105027);})[_0x70f0('0x12')](function(){return _0x3575af[_0x70f0('0x57')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x70f0('0x12')](respondWithResult(_0x41a70e,null))[_0x70f0('0x1a')](handleError(_0x41a70e,null));};exports[_0x70f0('0xfa')]=function(_0x576d13,_0x5c24de){var _0x332fd0;return db[_0x70f0('0xaa')]['update']({'paused':0x1},{'where':{'UserId':_0x576d13[_0x70f0('0x4f')]['id']},'individualHooks':!![]})['then'](function(){return db['User']['find']({'where':{'id':_0x576d13[_0x70f0('0x4f')]['id'],'role':_0x70f0('0x2a')},'attributes':['id',_0x70f0('0x30'),_0x70f0('0x26'),_0x70f0('0x5d'),'interface']});})[_0x70f0('0x12')](handleEntityNotFound(_0x5c24de,null))[_0x70f0('0x12')](function(_0x437d1e){if(_0x437d1e){_0x332fd0=_0x437d1e;return respondWithRpcPromise('QueuePause',_0x70f0('0xfa'),{'id':_0x332fd0['id'],'name':_0x332fd0[_0x70f0('0x30')],'pause':!![]});}})[_0x70f0('0x12')](function(){if(_0x332fd0){return db['MemberReport']['findAll']({'where':{'membername':_0x332fd0[_0x70f0('0x30')],'type':_0x70f0('0xf4'),'exitAt':null}});}})['then'](function(_0x25798f){if(_0x25798f[_0x70f0('0x47')]){var _0xd41e3c=moment()[_0x70f0('0xa8')](_0x70f0('0xf1'));for(var _0x43a6da=0x0,_0x571d12=_0x25798f[_0x70f0('0x47')];_0x43a6da<_0x571d12;_0x43a6da++){_0x25798f[_0x43a6da][_0x70f0('0xfb')]({'exitAt':_0xd41e3c});}}})[_0x70f0('0x12')](function(){var _0x6ce168=[];var _0x4c1854=utils[_0x70f0('0xfc')]();_0x4c1854[_0x70f0('0xf9')](function(_0x587aa5){_0x6ce168[_0x70f0('0x43')]({'channel':_0x587aa5,'membername':_0x332fd0[_0x70f0('0x30')],'interface':_[_0x70f0('0x63')](_0x332fd0[_0x70f0('0xa7')])?util[_0x70f0('0xa8')]('SIP/%s',_0x332fd0['name']):_0x332fd0[_0x70f0('0xa7')],'type':_0x70f0('0xf4'),'enterAt':moment()[_0x70f0('0xa8')](_0x70f0('0xf1')),'data1':_0x576d13[_0x70f0('0x58')][_0x70f0('0x35')]||'DEFAULT\x20PAUSE','role':_0x332fd0[_0x70f0('0x26')],'internal':_0x332fd0[_0x70f0('0x5d')]});});return db[_0x70f0('0xf5')][_0x70f0('0x81')](_0x6ce168,{'individualHooks':!![]});})[_0x70f0('0x12')](function(){return _0x332fd0[_0x70f0('0x57')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x576d13[_0x70f0('0x58')][_0x70f0('0x35')]||_0x70f0('0xfd'),'lastPauseAt':moment()['format'](_0x70f0('0xf1'))});})[_0x70f0('0x12')](respondWithResult(_0x5c24de,null))['catch'](handleError(_0x5c24de,null));};exports['unpause']=function(_0x22ce42,_0x4498a8){var _0x7250fd;return db[_0x70f0('0x3b')]['find']({'where':{'id':_0x22ce42['params']['id']},'attributes':['id','name','role',_0x70f0('0x9b'),_0x70f0('0xfe'),'chatPause','faxPause',_0x70f0('0xff'),_0x70f0('0x100'),_0x70f0('0x101'),'pauseType',_0x70f0('0x102')]})['then'](handleEntityNotFound(_0x4498a8,null))[_0x70f0('0x12')](function(_0x38532b){if(_0x38532b){_0x7250fd=_0x38532b;if(_0x22ce42[_0x70f0('0x58')][_0x70f0('0x99')]&&!utils[_0x70f0('0x9c')](_0x22ce42[_0x70f0('0x58')][_0x70f0('0x99')])){throw new db[(_0x70f0('0x8d'))][(_0x70f0('0x8e'))]('Unknown\x20channel');}switch(_0x22ce42['body'][_0x70f0('0x99')]){case _0x70f0('0xa5'):return respondWithRpcPromise('QueuePause','unpause',{'id':_0x7250fd['id'],'name':_0x7250fd['name'],'pause':![]})[_0x70f0('0x12')](function(){return db[_0x70f0('0xaa')]['update']({'paused':0x0},{'where':{'UserId':_0x7250fd['id']},'individualHooks':!![]});})[_0x70f0('0x12')](function(){return db['MemberReport']['find']({'where':{'channel':_0x22ce42['body'][_0x70f0('0x99')],'membername':_0x7250fd['name'],'type':_0x70f0('0xf4'),'exitAt':null}});})[_0x70f0('0x12')](function(_0x4487e3){if(_0x4487e3){return _0x4487e3[_0x70f0('0x57')]({'exitAt':moment()[_0x70f0('0xa8')](_0x70f0('0xf1')),'data2':_0x70f0('0x103')},{'individualHooks':!![]});}return null;})[_0x70f0('0x12')](function(){return _0x7250fd[_0x70f0('0x57')]({'voicePause':![]});});case _0x70f0('0xba'):case _0x70f0('0xb9'):case _0x70f0('0x4a'):case'sms':case _0x70f0('0x4c'):case _0x70f0('0x4b'):return db['MemberReport']['find']({'where':{'channel':_0x22ce42[_0x70f0('0x58')][_0x70f0('0x99')],'membername':_0x7250fd[_0x70f0('0x30')],'type':_0x70f0('0xf4'),'exitAt':null}})[_0x70f0('0x12')](function(_0x30f5f0){if(_0x30f5f0){return _0x30f5f0[_0x70f0('0x57')]({'exitAt':moment()[_0x70f0('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x70f0('0x103')},{'individualHooks':!![]});}return null;})[_0x70f0('0x12')](function(){var _0x4bda26={};_['set'](_0x4bda26,util[_0x70f0('0xa8')]('%s%s',_0x22ce42[_0x70f0('0x58')][_0x70f0('0x99')],_0x70f0('0x104')),![]);return _0x7250fd[_0x70f0('0x57')](_0x4bda26);});default:return respondWithRpcPromise('QueuePause',_0x70f0('0x105'),{'id':_0x7250fd['id'],'name':_0x7250fd['name'],'pause':![]})['then'](function(){return db[_0x70f0('0xaa')]['update']({'paused':0x0},{'where':{'UserId':_0x7250fd['id']}});})[_0x70f0('0x12')](function(){return db[_0x70f0('0xf5')][_0x70f0('0x44')]({'where':{'membername':_0x7250fd[_0x70f0('0x30')],'type':_0x70f0('0xf4'),'exitAt':null}});})['then'](function(_0x1f7093){var _0x1399ba=[];_0x1f7093[_0x70f0('0xf9')](function(_0x16ca0a){_0x1399ba['push'](_0x16ca0a[_0x70f0('0x57')]({'exitAt':moment()[_0x70f0('0xa8')](_0x70f0('0xf1')),'data2':_0x70f0('0x103')}));});return BPromise[_0x70f0('0x4d')](_0x1399ba);})['then'](function(){return _0x7250fd[_0x70f0('0x57')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x70f0('0x12')](respondWithResult(_0x4498a8,null))['catch'](handleError(_0x4498a8,null));};exports[_0x70f0('0x106')]=function(_0x1d118a,_0x49a675){var _0x20ce81={};var _0x1aa0f3={};var _0x490994;var _0x57152a;return db['User'][_0x70f0('0x91')]({'where':{'id':_0x1d118a[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x49a675,null))[_0x70f0('0x12')](function(_0x354bec){if(_0x354bec){_0x490994=_0x354bec;_0x1aa0f3['model']=_[_0x70f0('0x51')](db[_0x70f0('0x107')]['rawAttributes']);_0x1aa0f3['query']=_[_0x70f0('0x51')](_0x1d118a[_0x70f0('0x3c')]);_0x1aa0f3['filters']=_[_0x70f0('0x54')](_0x1aa0f3[_0x70f0('0x50')],_0x1aa0f3[_0x70f0('0x3c')]);_0x20ce81[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x1aa0f3[_0x70f0('0x50')],qs[_0x70f0('0x55')](_0x1d118a[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x20ce81[_0x70f0('0x42')]=_0x20ce81[_0x70f0('0x42')][_0x70f0('0x47')]?_0x20ce81[_0x70f0('0x42')]:_0x1aa0f3[_0x70f0('0x50')];_0x20ce81[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x1d118a[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x20ce81['where']=qs['filters'](_['pick'](_0x1d118a[_0x70f0('0x3c')],_0x1aa0f3[_0x70f0('0x53')]));if(_0x1d118a['query'][_0x70f0('0x37')]){_0x20ce81[_0x70f0('0x3a')]=_[_0x70f0('0xc9')](_0x20ce81[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x20ce81[_0x70f0('0x42')],function(_0x1c8fff){var _0x57a38e={};_0x57a38e[_0x1c8fff]={'$like':'%'+_0x1d118a[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x57a38e;})});}_0x20ce81=_[_0x70f0('0xc9')]({},_0x20ce81,_0x1d118a[_0x70f0('0xca')]);return _0x490994[_0x70f0('0x106')](_0x20ce81);}})[_0x70f0('0x12')](function(_0x243fb1){if(_0x243fb1){_0x57152a=_0x243fb1['length'];if(!_0x1d118a['query']['hasOwnProperty'](_0x70f0('0xd0'))){_0x20ce81['limit']=qs[_0x70f0('0x1f')](_0x1d118a[_0x70f0('0x3c')]['limit']);_0x20ce81[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x1d118a['query'][_0x70f0('0x21')]);}return _0x490994['getTeams'](_0x20ce81);}})[_0x70f0('0x12')](function(_0xf8017f){if(_0xf8017f){return _0xf8017f?{'count':_0x57152a,'rows':_0xf8017f}:null;}})['then'](respondWithResult(_0x49a675,null))[_0x70f0('0x1a')](handleError(_0x49a675,null));};exports[_0x70f0('0x108')]=function(_0x1c0df3,_0x3eafa7){return db['User'][_0x70f0('0x56')]({'where':{'id':_0x1c0df3[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x3eafa7,null))[_0x70f0('0x12')](function(_0x149ac5){if(_0x149ac5){var _0x462b75=_0x149ac5[_0x70f0('0x25')]({'plain':!![]});return _0x149ac5[_0x70f0('0x108')](_0x1c0df3[_0x70f0('0x58')][_0x70f0('0x5b')],_[_0x70f0('0x5c')](_0x1c0df3[_0x70f0('0x58')],[_0x70f0('0x5b'),'id'])||{})[_0x70f0('0x12')](function(){for(var _0x3c327e=0x0;_0x3c327e<_0x1c0df3[_0x70f0('0x58')][_0x70f0('0x5b')]['length'];_0x3c327e++){var _0x58adb0=[];var _0x3383c1={};db[_0x70f0('0x107')][_0x70f0('0x91')]({'where':{'id':_0x1c0df3[_0x70f0('0x58')]['ids'][_0x3c327e]}})[_0x70f0('0x12')](function(_0x5c91a7){_0x3383c1=_0x5c91a7[_0x70f0('0x48')];_0x58adb0[_0x70f0('0x43')](_0x5c91a7[_0x70f0('0x109')]()['then'](function(_0x228739){for(var _0x436d89=0x0;_0x436d89<_0x228739[_0x70f0('0x47')];_0x436d89++){_0x228739[_0x436d89]['setDataValue']('channel',_0x70f0('0x10a'));}return _0x228739;}));_0x58adb0[_0x70f0('0x43')](_0x5c91a7[_0x70f0('0x10b')]()[_0x70f0('0x12')](function(_0x42a555){for(var _0x592a15=0x0;_0x592a15<_0x42a555[_0x70f0('0x47')];_0x592a15++){_0x42a555[_0x592a15]['setDataValue'](_0x70f0('0x99'),'Chat');}return _0x42a555;}));_0x58adb0[_0x70f0('0x43')](_0x5c91a7[_0x70f0('0x10c')]()[_0x70f0('0x12')](function(_0x239306){for(var _0x17b0d2=0x0;_0x17b0d2<_0x239306['length'];_0x17b0d2++){_0x239306[_0x17b0d2]['setDataValue']('channel',_0x70f0('0x10d'));}return _0x239306;}));_0x58adb0['push'](_0x5c91a7[_0x70f0('0x10e')]()[_0x70f0('0x12')](function(_0x31d36d){for(var _0xfdbab4=0x0;_0xfdbab4<_0x31d36d[_0x70f0('0x47')];_0xfdbab4++){_0x31d36d[_0xfdbab4]['setDataValue'](_0x70f0('0x99'),'Sms');}return _0x31d36d;}));_0x58adb0[_0x70f0('0x43')](_0x5c91a7[_0x70f0('0x10f')]()[_0x70f0('0x12')](function(_0xc0eab5){for(var _0x5b338c=0x0;_0x5b338c<_0xc0eab5['length'];_0x5b338c++){_0xc0eab5[_0x5b338c][_0x70f0('0x110')]('channel',_0x70f0('0x111'));}return _0xc0eab5;}));_0x58adb0[_0x70f0('0x43')](_0x5c91a7['getFaxQueues']()[_0x70f0('0x12')](function(_0x492db){for(var _0x591ee8=0x0;_0x591ee8<_0x492db[_0x70f0('0x47')];_0x591ee8++){_0x492db[_0x591ee8]['setDataValue'](_0x70f0('0x99'),'Fax');}return _0x492db;}));_0x58adb0['push'](_0x5c91a7['getOpenchannelQueues']()[_0x70f0('0x12')](function(_0x1a71f7){for(var _0x475770=0x0;_0x475770<_0x1a71f7['length'];_0x475770++){_0x1a71f7[_0x475770]['setDataValue'](_0x70f0('0x99'),'Openchannel');}return _0x1a71f7;}));return BPromise[_0x70f0('0x4d')](_0x58adb0);})[_0x70f0('0x12')](function(_0x14c5da){var _0x5c4ab1=_['flatten'](_0x14c5da);_0x58adb0=[];return db[_0x70f0('0x65')][_0x70f0('0x112')](function(_0x58bb3e){for(var _0x4d853d=0x0;_0x4d853d<_0x5c4ab1['length'];_0x4d853d++){_0x58adb0[_0x70f0('0x43')](_0x5c4ab1[_0x4d853d][_0x70f0('0x113')](_0x462b75['id']),{'transaction':_0x58bb3e});}return BPromise[_0x70f0('0x4d')](_0x58adb0)[_0x70f0('0x12')](function(){if(_0x462b75['online']){return BPromise['each'](_[_0x70f0('0x37')](_0x5c4ab1,function(_0x267fcd){return _0x267fcd[_0x70f0('0x114')](_0x70f0('0x99'))==='Voice';}),function(_0x3da3a6){return db[_0x70f0('0xaa')][_0x70f0('0x115')]({'membername':_0x462b75[_0x70f0('0x30')],'UserId':_0x462b75['id'],'queue_name':_0x3da3a6[_0x70f0('0x30')],'VoiceQueueId':_0x3da3a6['id'],'interface':_['isNil'](_0x462b75[_0x70f0('0xa7')])?util['format'](_0x70f0('0xe9'),_0x462b75[_0x70f0('0x30')]):_0x462b75['interface'],'paused':_0x462b75[_0x70f0('0x9b')]||![],'penalty':_0x462b75[_0x70f0('0xa9')]},{'transaction':_0x58bb3e});});}else{return;}})[_0x70f0('0x12')](function(){for(var _0x2e53c6=0x0;_0x2e53c6<_0x5c4ab1[_0x70f0('0x47')];_0x2e53c6++){var _0x176210=_0x5c4ab1[_0x2e53c6]['getDataValue']('channel');var _0x37cf97=_0x176210+_0x70f0('0xa3');socket[_0x70f0('0xa4')](_0x70f0('0x78')+_0x176210+_0x70f0('0x116'),{'UserId':_0x462b75['id'],['queueField']:_0x5c4ab1[_0x2e53c6]['id']});}});});})[_0x70f0('0x12')](function(){db['TeamVoicePrefix'][_0x70f0('0x91')]({'where':{'teamId':_0x3383c1['id']}})[_0x70f0('0x12')](function(_0x1cd6ba){if(_0x1cd6ba){db[_0x70f0('0x117')][_0x70f0('0x7e')]({'UserId':_0x1c0df3[_0x70f0('0x4f')]['id'],'VoicePrefixId':_0x1cd6ba[_0x70f0('0x118')]});}});});}});}})[_0x70f0('0x12')](respondWithStatusCode(_0x3eafa7,null))[_0x70f0('0x1a')](handleError(_0x3eafa7,null));};exports['removeTeams']=function(_0x3d9743,_0x2b668e){return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x3d9743[_0x70f0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2b668e,null))['then'](function(_0x273ab7){if(_0x273ab7){var _0x5e8596=_0x273ab7[_0x70f0('0x25')]({'plain':!![]});var _0x362491=_0x3d9743[_0x70f0('0x3c')][_0x70f0('0x5b')];return _0x273ab7[_0x70f0('0x119')](_0x362491)[_0x70f0('0x12')](function(){for(var _0x47d43c=0x0;_0x47d43c<_0x362491['length'];_0x47d43c++){var _0x367484=[];var _0x4698c5={};db[_0x70f0('0x107')][_0x70f0('0x91')]({'where':{'id':_0x362491[_0x47d43c]}})['then'](function(_0x2e828f){_0x4698c5=_0x2e828f[_0x70f0('0x48')];_0x367484[_0x70f0('0x43')](_0x2e828f['getVoiceQueues']()['then'](function(_0x2a9757){for(var _0x37a4ba=0x0;_0x37a4ba<_0x2a9757[_0x70f0('0x47')];_0x37a4ba++){_0x2a9757[_0x37a4ba][_0x70f0('0x110')](_0x70f0('0x99'),_0x70f0('0x10a'));}return _0x2a9757;}));_0x367484[_0x70f0('0x43')](_0x2e828f[_0x70f0('0x10b')]()[_0x70f0('0x12')](function(_0xa57a0){for(var _0xec22e3=0x0;_0xec22e3<_0xa57a0[_0x70f0('0x47')];_0xec22e3++){_0xa57a0[_0xec22e3][_0x70f0('0x110')](_0x70f0('0x99'),'Chat');}return _0xa57a0;}));_0x367484['push'](_0x2e828f['getMailQueues']()[_0x70f0('0x12')](function(_0x1789cf){for(var _0xb5cf72=0x0;_0xb5cf72<_0x1789cf[_0x70f0('0x47')];_0xb5cf72++){_0x1789cf[_0xb5cf72][_0x70f0('0x110')](_0x70f0('0x99'),_0x70f0('0x10d'));}return _0x1789cf;}));_0x367484[_0x70f0('0x43')](_0x2e828f[_0x70f0('0x10e')]()[_0x70f0('0x12')](function(_0x28c8e4){for(var _0x5f15c7=0x0;_0x5f15c7<_0x28c8e4[_0x70f0('0x47')];_0x5f15c7++){_0x28c8e4[_0x5f15c7][_0x70f0('0x110')]('channel',_0x70f0('0x11a'));}return _0x28c8e4;}));_0x367484[_0x70f0('0x43')](_0x2e828f[_0x70f0('0x10f')]()['then'](function(_0x430110){for(var _0x5da098=0x0;_0x5da098<_0x430110['length'];_0x5da098++){_0x430110[_0x5da098][_0x70f0('0x110')]('channel',_0x70f0('0x111'));}return _0x430110;}));_0x367484[_0x70f0('0x43')](_0x2e828f[_0x70f0('0x11b')]()['then'](function(_0x562981){for(var _0x44aa34=0x0;_0x44aa34<_0x562981[_0x70f0('0x47')];_0x44aa34++){_0x562981[_0x44aa34][_0x70f0('0x110')](_0x70f0('0x99'),_0x70f0('0x11c'));}return _0x562981;}));_0x367484['push'](_0x2e828f[_0x70f0('0x11d')]()[_0x70f0('0x12')](function(_0x25925b){for(var _0x2404f3=0x0;_0x2404f3<_0x25925b['length'];_0x2404f3++){_0x25925b[_0x2404f3][_0x70f0('0x110')]('channel','Openchannel');}return _0x25925b;}));return BPromise['all'](_0x367484);})[_0x70f0('0x12')](function(_0xb34e4b){var _0x89ca26=_[_0x70f0('0x11e')](_0xb34e4b);_0x367484=[];return db[_0x70f0('0x65')][_0x70f0('0x112')](function(_0x9355f4){for(var _0x398741=0x0;_0x398741<_0x89ca26['length'];_0x398741++){_0x367484['push'](_0x89ca26[_0x398741][_0x70f0('0x11f')](_0x5e8596['id']),{'transaction':_0x9355f4});}return BPromise[_0x70f0('0x4d')](_0x367484)[_0x70f0('0x12')](function(){if(_0x5e8596['online']){return BPromise['each'](_[_0x70f0('0x37')](_0x89ca26,function(_0x4dd1e6){return _0x4dd1e6['getDataValue']('channel')==='Voice';}),function(_0x3af319){return db[_0x70f0('0xaa')][_0x70f0('0x24')]({'where':{'VoiceQueueId':_0x3af319['id'],'UserId':_0x5e8596['id']},'transaction':_0x9355f4});});}else{return;}})['then'](function(){db[_0x70f0('0x120')][_0x70f0('0x91')]({'where':{'teamId':_0x4698c5['id']}})[_0x70f0('0x12')](function(_0x4a745b){if(_0x4a745b){return db[_0x70f0('0x117')][_0x70f0('0x24')]({'where':{'UserId':_0x5e8596['id'],'VoicePrefixId':_0x4a745b['dataValues'][_0x70f0('0x118')]}});}});})[_0x70f0('0x12')](function(){for(var _0x9f6bc5=0x0;_0x9f6bc5<_0x89ca26[_0x70f0('0x47')];_0x9f6bc5++){var _0x90adb=_0x89ca26[_0x9f6bc5][_0x70f0('0x114')](_0x70f0('0x99'));var _0x43a156=_0x90adb+_0x70f0('0xa3');socket['emit'](_0x70f0('0x78')+_0x90adb+'Queue:remove',{'UserId':_0x5e8596['id'],['queueField']:_0x89ca26[_0x9f6bc5]['id']});}});});});}});}})[_0x70f0('0x12')](respondWithStatusCode(_0x2b668e,null))[_0x70f0('0x1a')](handleError(_0x2b668e,null));};exports['getLists']=function(_0x2046f3,_0x4c692f){var _0x4ab887={};var _0x44697a={};var _0x308314;var _0x14b74c;return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0x2046f3[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x4c692f,null))[_0x70f0('0x12')](function(_0x1a545e){if(_0x1a545e){_0x308314=_0x1a545e;_0x44697a[_0x70f0('0x50')]=_[_0x70f0('0x51')](db['CmList'][_0x70f0('0x52')]);_0x44697a[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0x2046f3[_0x70f0('0x3c')]);_0x44697a['filters']=_[_0x70f0('0x54')](_0x44697a['model'],_0x44697a[_0x70f0('0x3c')]);_0x4ab887['attributes']=_[_0x70f0('0x54')](_0x44697a[_0x70f0('0x50')],qs['fields'](_0x2046f3[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x4ab887[_0x70f0('0x42')]=_0x4ab887['attributes'][_0x70f0('0x47')]?_0x4ab887['attributes']:_0x44697a[_0x70f0('0x50')];_0x4ab887[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0x2046f3['query'][_0x70f0('0xc8')]);_0x4ab887[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_['pick'](_0x2046f3[_0x70f0('0x3c')],_0x44697a[_0x70f0('0x53')]));if(_0x2046f3[_0x70f0('0x3c')]['filter']){_0x4ab887[_0x70f0('0x3a')]=_['merge'](_0x4ab887[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x4ab887[_0x70f0('0x42')],function(_0x293729){var _0x861489={};_0x861489[_0x293729]={'$like':'%'+_0x2046f3[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x861489;})});}_0x4ab887=_[_0x70f0('0xc9')]({},_0x4ab887,_0x2046f3[_0x70f0('0xca')]);return _0x308314[_0x70f0('0x121')](_0x4ab887);}})[_0x70f0('0x12')](function(_0x1690fe){if(_0x1690fe){_0x14b74c=_0x1690fe[_0x70f0('0x47')];if(!_0x2046f3['query'][_0x70f0('0xcb')](_0x70f0('0xd0'))){_0x4ab887[_0x70f0('0x1f')]=qs[_0x70f0('0x1f')](_0x2046f3[_0x70f0('0x3c')][_0x70f0('0x1f')]);_0x4ab887[_0x70f0('0x21')]=qs[_0x70f0('0x21')](_0x2046f3['query']['offset']);}return _0x308314['getLists'](_0x4ab887);}})[_0x70f0('0x12')](function(_0x442415){if(_0x442415){return _0x442415?{'count':_0x14b74c,'rows':_0x442415}:null;}})[_0x70f0('0x12')](respondWithResult(_0x4c692f,null))['catch'](handleError(_0x4c692f,null));};exports[_0x70f0('0x122')]=function(_0xf0bf82,_0x129948){var _0x305fad={};var _0x5ebf0a={};var _0x37a6d5;return db[_0x70f0('0x3b')][_0x70f0('0x91')]({'where':{'id':_0xf0bf82[_0x70f0('0x4f')]['id']}})[_0x70f0('0x12')](handleEntityNotFound(_0x129948,null))['then'](function(_0x1175c7){if(_0x1175c7){_0x37a6d5=_0x1175c7;_0x5ebf0a[_0x70f0('0x50')]=_[_0x70f0('0x51')](db[_0x70f0('0x3b')][_0x70f0('0x52')]);_0x5ebf0a[_0x70f0('0x3c')]=_[_0x70f0('0x51')](_0xf0bf82[_0x70f0('0x3c')]);_0x5ebf0a[_0x70f0('0x53')]=_[_0x70f0('0x54')](_0x5ebf0a['model'],_0x5ebf0a[_0x70f0('0x3c')]);_0x305fad[_0x70f0('0x42')]=_[_0x70f0('0x54')](_0x5ebf0a['model'],qs['fields'](_0xf0bf82[_0x70f0('0x3c')][_0x70f0('0x55')]));_0x305fad[_0x70f0('0x42')]=_0x305fad[_0x70f0('0x42')]['length']?_0x305fad[_0x70f0('0x42')]:_0x5ebf0a[_0x70f0('0x50')];_0x305fad[_0x70f0('0xc7')]=qs[_0x70f0('0xc8')](_0xf0bf82[_0x70f0('0x3c')][_0x70f0('0xc8')]);_0x305fad[_0x70f0('0x3a')]=qs[_0x70f0('0x53')](_[_0x70f0('0xd2')](_0xf0bf82[_0x70f0('0x3c')],_0x5ebf0a[_0x70f0('0x53')]));if(_0xf0bf82['query'][_0x70f0('0x37')]){_0x305fad[_0x70f0('0x3a')]=_['merge'](_0x305fad[_0x70f0('0x3a')],{'$or':_[_0x70f0('0x33')](_0x305fad[_0x70f0('0x42')],function(_0x5bd25d){var _0x284821={};_0x284821[_0x5bd25d]={'$like':'%'+_0xf0bf82[_0x70f0('0x3c')][_0x70f0('0x37')]+'%'};return _0x284821;})});}_0x305fad['model']=db['User'];_0x305fad['as']=_0x70f0('0x29');_0x305fad=_[_0x70f0('0xc9')]({},_0x305fad,_0xf0bf82[_0x70f0('0xca')]);return _0x37a6d5[_0x70f0('0x109')]({'include':[_0x305fad]});}})[_0x70f0('0x12')](function(_0x26672b){if(_0x26672b){var _0x3e3fe0={},_0x21893e=[];for(var _0x229989=0x0;_0x229989<_0x26672b[_0x70f0('0x47')];_0x229989+=0x1){for(var _0x330ef7=0x0,_0x338e82;_0x330ef7<_0x26672b[_0x229989]['Agents'][_0x70f0('0x47')];_0x330ef7+=0x1){_0x338e82=_0x26672b[_0x229989][_0x70f0('0x29')][_0x330ef7][_0x70f0('0x25')]({'plain':!![]});_0x3e3fe0[_0x338e82['id']]=_0x338e82;}}_0x3e3fe0=_[_0x70f0('0x123')](_0x3e3fe0);for(var _0x149397=qs[_0x70f0('0x21')](_0xf0bf82[_0x70f0('0x3c')][_0x70f0('0x21')]);_0x149397<_0x3e3fe0[_0x70f0('0x47')]&&_0x21893e[_0x70f0('0x47')]=_0x58ec42[_0xc0b2('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x4e0412){return db[_0xc0b2('0x2c')]['destroy']({'where':{'membername':_0x4e0412['name']},'individualHooks':!![]});}})['then'](function(){if(_0x4e0412){return _0x4e0412['getVoiceQueues']({'raw':!![]});}})[_0xc0b2('0x11')](function(_0x57d7fa){if(_0x4e0412){if(_0x57d7fa){var _0x38b74c=[];_0x11ec5c=_0x57d7fa;if(_0x11ec5c[_0xc0b2('0x2f')]){for(var _0x522bd2=0x0;_0x522bd2<_0x11ec5c[_0xc0b2('0x2f')];_0x522bd2++){_0x38b74c[_0xc0b2('0x35')](db[_0xc0b2('0x2c')]['upsert']({'membername':_0x4e0412[_0xc0b2('0x28')],'UserId':_0x4e0412['id'],'queue_name':_0x11ec5c[_0x522bd2][_0xc0b2('0x28')],'VoiceQueueId':_0x11ec5c[_0x522bd2]['id'],'interface':_0x421d80,'paused':_0x4e0412[_0xc0b2('0x4f')]||![],'penalty':_0x11ec5c[_0x522bd2][_0xc0b2('0x55')]||0x0}));}return BPromise['all'](_0x38b74c);}}}})['then'](function(){if(_0x4e0412){return db[_0xc0b2('0x2d')][_0xc0b2('0x1d')]({'where':{'membername':_0x4e0412[_0xc0b2('0x28')],'exitAt':null}});}})[_0xc0b2('0x11')](function(_0x145135){if(_0x4e0412){if(_0x145135&&_0x145135['length']){var _0x1013cc=[];_0x145135[_0xc0b2('0x34')](function(_0x2a28c3){_0x1013cc[_0xc0b2('0x35')](_0x2a28c3[_0xc0b2('0x3c')]({'exitAt':moment()[_0xc0b2('0x30')](_0xc0b2('0x31'))}));});return BPromise[_0xc0b2('0x49')](_0x1013cc);}}})[_0xc0b2('0x11')](function(_0x48b2ff){if(_0x4e0412){var _0x34e07d=[];var _0x375e49=[];var _0x25d523=utils[_0xc0b2('0x33')]();var _0x22f31b={'membername':_0x4e0412[_0xc0b2('0x28')],'interface':_0x421d80,'enterAt':moment()[_0xc0b2('0x30')](_0xc0b2('0x31')),'role':_0x4e0412['role'],'internal':_0x4e0412[_0xc0b2('0x2a')]};_0x25d523[_0xc0b2('0x34')](function(_0x4deaf3){_0x34e07d[_0xc0b2('0x35')](_[_0xc0b2('0x56')]({'channel':_0x4deaf3,'type':'LOGIN','data1':_0xc0b2('0x57'),'data2':_0x421d80},_0x22f31b));if(_0x4e0412[_0xc0b2('0x4f')]){_0x375e49[_0xc0b2('0x35')](_[_0xc0b2('0x56')]({'channel':_0x4deaf3,'type':'PAUSE','data1':'LOGININPAUSE'},_0x22f31b));}});return db['MemberReport']['bulkCreate'](_0x34e07d['concat'](_0x375e49),{'individualHooks':!![]});}})['then'](function(){if(_0x4e0412){return _0x4e0412['update']({'online':!![],'lastLoginAt':moment()[_0xc0b2('0x30')](_0xc0b2('0x31')),'voicePause':_0x4e0412[_0xc0b2('0x4f')]||![],'mailPause':_0x4e0412[_0xc0b2('0x4f')]||![],'chatPause':_0x4e0412[_0xc0b2('0x4f')]||![],'faxPause':_0x4e0412['loginInPause']||![],'smsPause':_0x4e0412[_0xc0b2('0x4f')]||![],'openchannelPause':_0x4e0412[_0xc0b2('0x4f')]||![],'pauseType':_0x4e0412['loginInPause']?_0xc0b2('0x58'):null,'lastPauseAt':moment()[_0xc0b2('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x421d80});}})[_0xc0b2('0x11')](function(_0x4499f3){_0x36db7b(_0x4499f3);})[_0xc0b2('0x1a')](function(_0x50b261){_0x400e59(_0x2d2cdc[_0xc0b2('0x16')](0x1f4,_0x50b261[_0xc0b2('0x17')]));});});}; \ No newline at end of file +var _0x1554=['result','catch','GetUser','User','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowUser','debug','name','role','internal','interface','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','SIP/%s','type','body','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','whatsapp','set','Pause','LogoutUser','destroy','all','LoginUser','mobile','phone','count','agent','agents','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0xa6df52,_0x1b8584){var _0x5edd57=function(_0x543f11){while(--_0x543f11){_0xa6df52['push'](_0xa6df52['shift']());}};_0x5edd57(++_0x1b8584);}(_0x1554,0xa2));var _0x4155=function(_0x271fb8,_0x39b10a){_0x271fb8=_0x271fb8-0x0;var _0x5cfd90=_0x1554[_0x271fb8];return _0x5cfd90;};'use strict';var _=require(_0x4155('0x0'));var util=require(_0x4155('0x1'));var moment=require(_0x4155('0x2'));var BPromise=require(_0x4155('0x3'));var rs=require(_0x4155('0x4'));var fs=require('fs');var Redis=require(_0x4155('0x5'));var db=require(_0x4155('0x6'))['db'];var utils=require(_0x4155('0x7'));var logger=require(_0x4155('0x8'))(_0x4155('0x9'));var config=require(_0x4155('0xa'));var jayson=require(_0x4155('0xb'));var client=jayson[_0x4155('0xc')][_0x4155('0xd')]({'port':0x232a});config['redis']=_[_0x4155('0xe')](config['redis'],{'host':_0x4155('0xf'),'port':0x18eb});var socket=require(_0x4155('0x10'))(new Redis(config[_0x4155('0x11')]));require('./user.socket')['register'](socket);function respondWithRpcPromise(_0x20063b,_0x5a744c,_0x304d77){return new BPromise(function(_0x600fe5,_0x34158d){return client['request'](_0x20063b,_0x304d77)[_0x4155('0x12')](function(_0x45f60c){logger['info'](_0x4155('0x13'),_0x5a744c,_0x4155('0x14'));logger['debug'](_0x4155('0x15'),_0x5a744c,_0x4155('0x14'),JSON[_0x4155('0x16')](_0x45f60c));if(_0x45f60c[_0x4155('0x17')]){if(_0x45f60c['error']['code']===0x1f4){logger[_0x4155('0x17')](_0x4155('0x13'),_0x5a744c,_0x45f60c[_0x4155('0x17')][_0x4155('0x18')]);return _0x34158d(_0x45f60c[_0x4155('0x17')][_0x4155('0x18')]);}logger['error'](_0x4155('0x13'),_0x5a744c,_0x45f60c['error'][_0x4155('0x18')]);return _0x600fe5(_0x45f60c[_0x4155('0x17')][_0x4155('0x18')]);}else{logger[_0x4155('0x19')](_0x4155('0x13'),_0x5a744c,'request\x20sent');_0x600fe5(_0x45f60c[_0x4155('0x1a')]['message']);}})[_0x4155('0x1b')](function(_0x286a06){logger[_0x4155('0x17')](_0x4155('0x13'),_0x5a744c,_0x286a06);_0x34158d(_0x286a06);});});}exports[_0x4155('0x1c')]=function(_0x355acc){var _0x277fef=this;return new Promise(function(_0x4876f0,_0x245f09){return db[_0x4155('0x1d')][_0x4155('0x1e')]({'raw':_0x355acc[_0x4155('0x1f')]?_0x355acc['options']['raw']===undefined?!![]:![]:!![],'where':_0x355acc[_0x4155('0x1f')]?_0x355acc[_0x4155('0x1f')][_0x4155('0x20')]||null:null,'attributes':_0x355acc[_0x4155('0x1f')]?_0x355acc[_0x4155('0x1f')][_0x4155('0x21')]||null:null,'limit':_0x355acc[_0x4155('0x1f')]?_0x355acc[_0x4155('0x1f')][_0x4155('0x22')]||null:null,'include':_0x355acc['options']?_0x355acc[_0x4155('0x1f')][_0x4155('0x23')]?_[_0x4155('0x24')](_0x355acc[_0x4155('0x1f')][_0x4155('0x23')],function(_0xfcb099){return{'model':db[_0xfcb099[_0x4155('0x25')]],'as':_0xfcb099['as'],'attributes':_0xfcb099['attributes'],'include':_0xfcb099[_0x4155('0x23')]?_['map'](_0xfcb099[_0x4155('0x23')],function(_0x484cef){return{'model':db[_0x484cef[_0x4155('0x25')]],'as':_0x484cef['as'],'attributes':_0x484cef[_0x4155('0x21')],'include':_0x484cef[_0x4155('0x23')]?_[_0x4155('0x24')](_0x484cef['include'],function(_0x32f24c){return{'model':db[_0x32f24c[_0x4155('0x25')]],'as':_0x32f24c['as'],'attributes':_0x32f24c[_0x4155('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4155('0x12')](function(_0x1cd3b4){logger['info'](_0x4155('0x1c'),_0x355acc);logger['debug'](_0x4155('0x1c'),_0x355acc,JSON[_0x4155('0x16')](_0x1cd3b4));_0x4876f0(_0x1cd3b4);})[_0x4155('0x1b')](function(_0x15972f){logger[_0x4155('0x17')]('GetUser',_0x15972f['message'],_0x355acc);_0x245f09(_0x277fef[_0x4155('0x17')](0x1f4,_0x15972f[_0x4155('0x18')]));});});};exports['ShowUser']=function(_0xbfcf18){var _0x493a9f=this;return new Promise(function(_0x152a6e,_0x3fc504){return db[_0x4155('0x1d')][_0x4155('0x26')]({'raw':_0xbfcf18['options']?_0xbfcf18[_0x4155('0x1f')][_0x4155('0x27')]===undefined?!![]:![]:!![],'where':_0xbfcf18[_0x4155('0x1f')]?_0xbfcf18[_0x4155('0x1f')]['where']||null:null,'attributes':_0xbfcf18[_0x4155('0x1f')]?_0xbfcf18[_0x4155('0x1f')][_0x4155('0x21')]||null:null,'include':_0xbfcf18[_0x4155('0x1f')]?_0xbfcf18[_0x4155('0x1f')][_0x4155('0x23')]?_['map'](_0xbfcf18[_0x4155('0x1f')][_0x4155('0x23')],function(_0x4138c5){return{'model':db[_0x4138c5[_0x4155('0x25')]],'as':_0x4138c5['as'],'attributes':_0x4138c5['attributes'],'include':_0x4138c5['include']?_[_0x4155('0x24')](_0x4138c5['include'],function(_0x2d3633){return{'model':db[_0x2d3633['model']],'as':_0x2d3633['as'],'attributes':_0x2d3633[_0x4155('0x21')],'include':_0x2d3633[_0x4155('0x23')]?_['map'](_0x2d3633[_0x4155('0x23')],function(_0x554a65){return{'model':db[_0x554a65[_0x4155('0x25')]],'as':_0x554a65['as'],'attributes':_0x554a65[_0x4155('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ec767){logger[_0x4155('0x19')](_0x4155('0x28'),_0xbfcf18);logger[_0x4155('0x29')](_0x4155('0x28'),_0xbfcf18,JSON[_0x4155('0x16')](_0x2ec767));_0x152a6e(_0x2ec767);})['catch'](function(_0x2ecb2f){logger[_0x4155('0x17')]('ShowUser',_0x2ecb2f['message'],_0xbfcf18);_0x3fc504(_0x493a9f['error'](0x1f4,_0x2ecb2f[_0x4155('0x18')]));});});};exports['PauseUser']=function(_0x39b8a5){var _0x343d9c=this;return new Promise(function(_0x376d6f,_0x536893){var _0x1736f2;return db[_0x4155('0x1d')][_0x4155('0x26')]({'where':_0x39b8a5[_0x4155('0x1f')]['where']||{},'attributes':['id',_0x4155('0x2a'),_0x4155('0x2b'),_0x4155('0x2c'),_0x4155('0x2d')]})[_0x4155('0x12')](function(_0x100705){if(_0x100705){_0x1736f2=_0x100705;return db['UserVoiceQueueRt'][_0x4155('0x2e')]({'paused':0x1},{'where':{'UserId':_0x1736f2['id']},'individualHooks':!![]});}})[_0x4155('0x12')](function(){if(_0x1736f2){return db[_0x4155('0x2f')][_0x4155('0x1e')]({'where':{'membername':_0x1736f2[_0x4155('0x2a')],'type':_0x4155('0x30'),'exitAt':null}});}})[_0x4155('0x12')](function(_0x1ea7a3){if(_0x1736f2){if(_0x1ea7a3&&_0x1ea7a3[_0x4155('0x31')]){var _0xb9bc3b=moment()[_0x4155('0x32')](_0x4155('0x33'));for(var _0x1329c9=0x0,_0x43e3ca=_0x1ea7a3[_0x4155('0x31')];_0x1329c9<_0x43e3ca;_0x1329c9++){_0x1ea7a3[_0x1329c9][_0x4155('0x34')]({'exitAt':_0xb9bc3b});}}}})[_0x4155('0x12')](function(){if(_0x1736f2){var _0x49c99e=[];var _0x53d485=utils[_0x4155('0x35')]();_0x53d485[_0x4155('0x36')](function(_0x51d902){_0x49c99e[_0x4155('0x37')]({'channel':_0x51d902,'membername':_0x1736f2[_0x4155('0x2a')],'interface':_['isNil'](_0x1736f2['interface'])?util[_0x4155('0x32')](_0x4155('0x38'),_0x1736f2[_0x4155('0x2a')]):_0x1736f2[_0x4155('0x2d')],'type':_0x4155('0x30'),'enterAt':moment()[_0x4155('0x32')](_0x4155('0x33')),'data1':_0x39b8a5['body'][_0x4155('0x39')]||'DEFAULT\x20PAUSE','role':_0x1736f2[_0x4155('0x2b')],'internal':_0x1736f2[_0x4155('0x2c')],'uniqueid':_0x39b8a5[_0x4155('0x3a')][_0x4155('0x3b')]||null});});return db['MemberReport'][_0x4155('0x3c')](_0x49c99e,{'individualHooks':!![]});}})[_0x4155('0x12')](function(){if(_0x1736f2){return _0x1736f2[_0x4155('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x39b8a5[_0x4155('0x3a')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x4155('0x12')](function(_0xc71c5){_0x376d6f(_0xc71c5);})[_0x4155('0x1b')](function(_0x4f1ca2){_0x536893(_0x343d9c['error'](0x1f4,_0x4f1ca2[_0x4155('0x18')]));});});};exports[_0x4155('0x3d')]=function(_0x311c36){var _0x1eb312=this;return new Promise(function(_0x478fb5,_0x39fda9){var _0x32c0e7;return db[_0x4155('0x1d')][_0x4155('0x3e')]({'where':_0x311c36[_0x4155('0x1f')][_0x4155('0x20')]||{},'attributes':['id',_0x4155('0x2a')]})[_0x4155('0x12')](function(_0x1afdbb){if(_0x1afdbb){_0x32c0e7=_0x1afdbb;if(_0x311c36[_0x4155('0x3a')][_0x4155('0x3f')]&&!utils[_0x4155('0x40')](_0x311c36[_0x4155('0x3a')][_0x4155('0x3f')])){throw new Error(_0x4155('0x41'));}switch(_0x311c36[_0x4155('0x3a')]['channel']){case _0x4155('0x42'):return db[_0x4155('0x43')][_0x4155('0x2e')]({'paused':0x0},{'where':{'UserId':_0x32c0e7['id']}})['then'](function(){return db[_0x4155('0x2f')][_0x4155('0x26')]({'where':{'channel':_0x311c36[_0x4155('0x3a')][_0x4155('0x3f')],'membername':_0x32c0e7[_0x4155('0x2a')],'type':'PAUSE','exitAt':null}});})[_0x4155('0x12')](function(_0x1922f4){if(_0x1922f4){return _0x1922f4['update']({'exitAt':moment()[_0x4155('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x4155('0x44')},{'individualHooks':!![]});}return null;})[_0x4155('0x12')](function(){return _0x32c0e7[_0x4155('0x2e')]({'voicePause':![]});});case _0x4155('0x45'):case _0x4155('0x46'):case _0x4155('0x47'):case _0x4155('0x48'):case _0x4155('0x49'):case _0x4155('0x4a'):return db['MemberReport'][_0x4155('0x26')]({'where':{'channel':_0x311c36[_0x4155('0x3a')][_0x4155('0x3f')],'membername':_0x32c0e7[_0x4155('0x2a')],'type':'PAUSE','exitAt':null}})['then'](function(_0x370bfd){return _0x370bfd['update']({'exitAt':moment()['format'](_0x4155('0x33')),'data2':_0x4155('0x44')},{'individualHooks':!![]});})[_0x4155('0x12')](function(){var _0x2fb00b={};_[_0x4155('0x4b')](_0x2fb00b,util['format']('%s%s',_0x311c36[_0x4155('0x3a')][_0x4155('0x3f')],_0x4155('0x4c')),![]);return _0x32c0e7[_0x4155('0x2e')](_0x2fb00b);});default:return db[_0x4155('0x43')]['update']({'paused':0x0},{'where':{'UserId':_0x32c0e7['id']}})[_0x4155('0x12')](function(){return db[_0x4155('0x2f')][_0x4155('0x1e')]({'where':{'membername':_0x32c0e7[_0x4155('0x2a')],'type':_0x4155('0x30'),'exitAt':null}});})['then'](function(_0x581c70){var _0x2c75e2=[];_0x581c70[_0x4155('0x36')](function(_0x406449){_0x2c75e2[_0x4155('0x37')](_0x406449[_0x4155('0x2e')]({'exitAt':moment()['format'](_0x4155('0x33')),'data2':'system'}));});return BPromise['all'](_0x2c75e2);})[_0x4155('0x12')](function(){return _0x32c0e7[_0x4155('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x4155('0x12')](function(_0x5f55da){_0x478fb5(_0x5f55da);})['catch'](function(_0x599d3f){_0x39fda9(_0x1eb312[_0x4155('0x17')](0x1f4,_0x599d3f['message']));});});};exports[_0x4155('0x4d')]=function(_0x3745b9){var _0x56c13c=this;return new Promise(function(_0x911792,_0x52d7c3){var _0x2fe5f2;return db['User'][_0x4155('0x3e')]({'where':_0x3745b9['options']['where']||{},'attributes':['id','name']})['then'](function(_0x4537f5){if(_0x4537f5){_0x2fe5f2=_0x4537f5;return db['UserVoiceQueueRt'][_0x4155('0x4e')]({'where':{'membername':_0x2fe5f2[_0x4155('0x2a')]},'individualHooks':!![]});}})[_0x4155('0x12')](function(){if(_0x2fe5f2){return db['MemberReport'][_0x4155('0x1e')]({'where':{'membername':_0x2fe5f2[_0x4155('0x2a')],'exitAt':null}});}})[_0x4155('0x12')](function(_0x1b21e1){if(_0x2fe5f2){if(_0x1b21e1&&_0x1b21e1[_0x4155('0x31')]){var _0x30b807=[];_0x1b21e1[_0x4155('0x36')](function(_0x3b0fce){_0x30b807['push'](_0x3b0fce['update']({'exitAt':moment()[_0x4155('0x32')](_0x4155('0x33'))}));});return BPromise[_0x4155('0x4f')](_0x30b807);}}})[_0x4155('0x12')](function(){if(_0x2fe5f2){return _0x2fe5f2[_0x4155('0x2e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x4155('0x12')](function(_0x1470aa){_0x911792(_0x1470aa);})[_0x4155('0x1b')](function(_0x36f498){_0x52d7c3(_0x56c13c[_0x4155('0x17')](0x1f4,_0x36f498[_0x4155('0x18')]));});});};exports[_0x4155('0x50')]=function(_0x3ee784){var _0x22bd85=this;return new Promise(function(_0x194717,_0x1da9c3){var _0x5850d0;var _0x42e511;var _0x222371;var _0x32b605;return db[_0x4155('0x1d')][_0x4155('0x3e')]({'where':_0x3ee784['options'][_0x4155('0x20')]||{},'attributes':['id',_0x4155('0x2a'),_0x4155('0x2b'),_0x4155('0x51'),_0x4155('0x52'),_0x4155('0x2c'),'loginInPause',_0x4155('0x2d')]})[_0x4155('0x12')](function(_0xe56282){if(_0xe56282){_0x5850d0=_0xe56282;_0x32b605=_0x3ee784['body'][_0x4155('0x2d')]?_0x3ee784['body']['interface']:util['format'](_0x4155('0x38'),_0x5850d0[_0x4155('0x2a')]);return db[_0x4155('0x1d')][_0x4155('0x53')]({'where':{'role':_0x4155('0x54'),'online':!![],'id':{'$ne':_0x5850d0['id']}}});}})[_0x4155('0x12')](function(_0x4809f3){if(_0x4809f3){_0x222371=_0x4809f3;return require('../../config/license/util')['getLicense']();}})[_0x4155('0x12')](function(_0x4f6a60){if(_0x4f6a60&&_0x4f6a60[_0x4155('0x55')]&&_0x222371>=_0x4f6a60[_0x4155('0x55')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4155('0x12')](function(){if(_0x5850d0){return db[_0x4155('0x43')][_0x4155('0x4e')]({'where':{'membername':_0x5850d0[_0x4155('0x2a')]},'individualHooks':!![]});}})[_0x4155('0x12')](function(){if(_0x5850d0){return _0x5850d0[_0x4155('0x56')]({'raw':!![]});}})[_0x4155('0x12')](function(_0x529f88){if(_0x5850d0){if(_0x529f88){var _0xac4f8=[];_0x42e511=_0x529f88;if(_0x42e511[_0x4155('0x31')]){for(var _0x3b11fc=0x0;_0x3b11fc<_0x42e511[_0x4155('0x31')];_0x3b11fc++){_0xac4f8['push'](db['UserVoiceQueueRt'][_0x4155('0x57')]({'membername':_0x5850d0[_0x4155('0x2a')],'UserId':_0x5850d0['id'],'queue_name':_0x42e511[_0x3b11fc][_0x4155('0x2a')],'VoiceQueueId':_0x42e511[_0x3b11fc]['id'],'interface':_0x32b605,'paused':_0x5850d0[_0x4155('0x58')]||![],'penalty':_0x42e511[_0x3b11fc][_0x4155('0x59')]||0x0}));}return BPromise[_0x4155('0x4f')](_0xac4f8);}}}})[_0x4155('0x12')](function(){if(_0x5850d0){return db[_0x4155('0x2f')]['findAll']({'where':{'membername':_0x5850d0['name'],'exitAt':null}});}})[_0x4155('0x12')](function(_0x4d79ea){if(_0x5850d0){if(_0x4d79ea&&_0x4d79ea[_0x4155('0x31')]){var _0xefaae=[];_0x4d79ea[_0x4155('0x36')](function(_0x15cf3d){_0xefaae[_0x4155('0x37')](_0x15cf3d[_0x4155('0x2e')]({'exitAt':moment()['format'](_0x4155('0x33'))}));});return BPromise['all'](_0xefaae);}}})[_0x4155('0x12')](function(_0x3b9032){if(_0x5850d0){var _0x3dcda3=[];var _0x5121ef=[];var _0x23d17d=utils['getChannels']();var _0x160690={'membername':_0x5850d0[_0x4155('0x2a')],'interface':_0x32b605,'enterAt':moment()[_0x4155('0x32')](_0x4155('0x33')),'role':_0x5850d0[_0x4155('0x2b')],'internal':_0x5850d0[_0x4155('0x2c')]};_0x23d17d[_0x4155('0x36')](function(_0x490256){_0x3dcda3[_0x4155('0x37')](_['merge']({'channel':_0x490256,'type':_0x4155('0x5a'),'data1':_0x4155('0x5b'),'data2':_0x32b605},_0x160690));if(_0x5850d0[_0x4155('0x58')]){_0x5121ef['push'](_['merge']({'channel':_0x490256,'type':_0x4155('0x30'),'data1':_0x4155('0x5c')},_0x160690));}});return db['MemberReport'][_0x4155('0x3c')](_0x3dcda3[_0x4155('0x5d')](_0x5121ef),{'individualHooks':!![]});}})['then'](function(){if(_0x5850d0){return _0x5850d0[_0x4155('0x2e')]({'online':!![],'lastLoginAt':moment()[_0x4155('0x32')](_0x4155('0x33')),'voicePause':_0x5850d0['loginInPause']||![],'mailPause':_0x5850d0[_0x4155('0x58')]||![],'chatPause':_0x5850d0[_0x4155('0x58')]||![],'faxPause':_0x5850d0['loginInPause']||![],'smsPause':_0x5850d0['loginInPause']||![],'openchannelPause':_0x5850d0[_0x4155('0x58')]||![],'pauseType':_0x5850d0[_0x4155('0x58')]?_0x4155('0x5c'):null,'lastPauseAt':moment()['format'](_0x4155('0x33')),'interface':_0x32b605});}})[_0x4155('0x12')](function(_0x1c895e){_0x194717(_0x1c895e);})[_0x4155('0x1b')](function(_0x5c5c77){_0x1da9c3(_0x22bd85[_0x4155('0x17')](0x1f4,_0x5c5c77['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 80c9908..128ab90 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 _0x1f53=['remove','update','emit','register','length','./user.events'];(function(_0x3c432d,_0x45ae09){var _0x2d501d=function(_0x5c921f){while(--_0x5c921f){_0x3c432d['push'](_0x3c432d['shift']());}};_0x2d501d(++_0x45ae09);}(_0x1f53,0x1a9));var _0x31f5=function(_0x221f40,_0x417fd3){_0x221f40=_0x221f40-0x0;var _0xb83220=_0x1f53[_0x221f40];return _0xb83220;};'use strict';var UserEvents=require(_0x31f5('0x0'));var events=['save',_0x31f5('0x1'),_0x31f5('0x2')];function createListener(_0x545e68,_0x36c2eb){return function(_0x21caaf){_0x36c2eb[_0x31f5('0x3')](_0x545e68,_0x21caaf);};}function removeListener(_0x581bd6,_0x480eba){return function(){UserEvents['removeListener'](_0x581bd6,_0x480eba);};}exports[_0x31f5('0x4')]=function(_0x3d1d2d){for(var _0x24f847=0x0,_0x334908=events[_0x31f5('0x5')];_0x24f847<_0x334908;_0x24f847++){var _0x5e600c=events[_0x24f847];var _0x3a3ecd=createListener('user:'+_0x5e600c,_0x3d1d2d);UserEvents['on'](_0x5e600c,_0x3a3ecd);}}; \ No newline at end of file +var _0x0ba0=['register','length','user:','./user.events','save','update','emit','removeListener'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x0ba0,0x153));var _0x00ba=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x0ba0[_0xc4001c];return _0x49f7bc;};'use strict';var UserEvents=require(_0x00ba('0x0'));var events=[_0x00ba('0x1'),'remove',_0x00ba('0x2')];function createListener(_0x41da4b,_0x25cfc6){return function(_0x510132){_0x25cfc6[_0x00ba('0x3')](_0x41da4b,_0x510132);};}function removeListener(_0x450e1b,_0x373dcb){return function(){UserEvents[_0x00ba('0x4')](_0x450e1b,_0x373dcb);};}exports[_0x00ba('0x5')]=function(_0x1672e7){for(var _0x5a7e53=0x0,_0x52f1c3=events[_0x00ba('0x6')];_0x5a7e53<_0x52f1c3;_0x5a7e53++){var _0x2ea521=events[_0x5a7e53];var _0x10af33=createListener(_0x00ba('0x7')+_0x2ea521,_0x1672e7);UserEvents['on'](_0x2ea521,_0x10af33);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index a6562af..b2e8925 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(_0x148634,_0xb2a21c){var _0x4bf6ae=function(_0x46bc48){while(--_0x46bc48){_0x148634['push'](_0x148634['shift']());}};_0x4bf6ae(++_0xb2a21c);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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(_0x3780d3,_0x566353){var _0x20ff8a=function(_0x1e7399){while(--_0x1e7399){_0x3780d3['push'](_0x3780d3['shift']());}};_0x20ff8a(++_0x566353);}(_0x70e0,0x17b));var _0x070e=function(_0x105572,_0x25e4e2){_0x105572=_0x105572-0x0;var _0x58965a=_0x70e0[_0x105572];return _0x58965a;};'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 da3acf7..b4481f3 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 _0xaeb4=['exports','INTEGER','sequelize'];(function(_0x9c9a73,_0x1c0a75){var _0x3b6daf=function(_0x58b1a8){while(--_0x58b1a8){_0x9c9a73['push'](_0x9c9a73['shift']());}};_0x3b6daf(++_0x1c0a75);}(_0xaeb4,0x161));var _0x4aeb=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0xaeb4[_0x2f48cd];return _0x193ae2;};'use strict';var Sequelize=require(_0x4aeb('0x0'));module[_0x4aeb('0x1')]={'penalty':{'type':Sequelize[_0x4aeb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e69=['exports','INTEGER','sequelize'];(function(_0x5dda97,_0x5d916f){var _0x259d48=function(_0x19804f){while(--_0x19804f){_0x5dda97['push'](_0x5dda97['shift']());}};_0x259d48(++_0x5d916f);}(_0x8e69,0x1d9));var _0x98e6=function(_0x11a9e4,_0x16f1f4){_0x11a9e4=_0x11a9e4-0x0;var _0x12e79f=_0x8e69[_0x11a9e4];return _0x12e79f;};'use strict';var Sequelize=require(_0x98e6('0x0'));module[_0x98e6('0x1')]={'penalty':{'type':Sequelize[_0x98e6('0x2')],'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 353b555..b2802e4 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 _0x55aa=['rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x17bc9e,_0x329cea){var _0x4fb410=function(_0x2a7ff4){while(--_0x2a7ff4){_0x17bc9e['push'](_0x17bc9e['shift']());}};_0x4fb410(++_0x329cea);}(_0x55aa,0xd6));var _0xa55a=function(_0x443b21,_0x12337e){_0x443b21=_0x443b21-0x0;var _0xaec648=_0x55aa[_0x443b21];return _0xaec648;};'use strict';var _=require(_0xa55a('0x0'));var util=require(_0xa55a('0x1'));var logger=require(_0xa55a('0x2'))(_0xa55a('0x3'));var moment=require(_0xa55a('0x4'));var BPromise=require(_0xa55a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa55a('0x6'));var rimraf=require(_0xa55a('0x7'));var config=require(_0xa55a('0x8'));var attributes=require(_0xa55a('0x9'));module[_0xa55a('0xa')]=function(_0x2ca109,_0x1776f2){return _0x2ca109[_0xa55a('0xb')]('UserChatQueue',attributes,{'tableName':_0xa55a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5caf=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x5ec62b,_0x3d0b47){var _0x2efdbd=function(_0x4c7094){while(--_0x4c7094){_0x5ec62b['push'](_0x5ec62b['shift']());}};_0x2efdbd(++_0x3d0b47);}(_0x5caf,0x1c5));var _0xf5ca=function(_0x243527,_0x5aa0c4){_0x243527=_0x243527-0x0;var _0x1e83d0=_0x5caf[_0x243527];return _0x1e83d0;};'use strict';var _=require(_0xf5ca('0x0'));var util=require(_0xf5ca('0x1'));var logger=require(_0xf5ca('0x2'))('api');var moment=require(_0xf5ca('0x3'));var BPromise=require(_0xf5ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5ca('0x5'));var rimraf=require(_0xf5ca('0x6'));var config=require(_0xf5ca('0x7'));var attributes=require(_0xf5ca('0x8'));module[_0xf5ca('0x9')]=function(_0x456b56,_0x52e842){return _0x456b56[_0xf5ca('0xa')](_0xf5ca('0xb'),attributes,{'tableName':_0xf5ca('0xc'),'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 347008d..730bf43 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 _0x72cc=['http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x72cc,0x129));var _0xc72c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x72cc[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0xc72c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc72c('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc72c('0x2'))(_0xc72c('0x3'));var config=require(_0xc72c('0x4'));var jayson=require(_0xc72c('0x5'));var client=jayson[_0xc72c('0x6')][_0xc72c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4fe81d,_0xba941a,_0x2a0020){return new BPromise(function(_0x13489d,_0x1a6ba3){return client[_0xc72c('0x8')](_0x4fe81d,_0x2a0020)[_0xc72c('0x9')](function(_0x4fb7dd){logger['info'](_0xc72c('0xa'),_0xba941a,_0xc72c('0xb'));logger[_0xc72c('0xc')](_0xc72c('0xd'),_0xba941a,_0xc72c('0xb'),JSON['stringify'](_0x4fb7dd));if(_0x4fb7dd['error']){if(_0x4fb7dd[_0xc72c('0xe')][_0xc72c('0xf')]===0x1f4){logger[_0xc72c('0xe')]('UserChatQueue,\x20%s,\x20%s',_0xba941a,_0x4fb7dd[_0xc72c('0xe')][_0xc72c('0x10')]);return _0x1a6ba3(_0x4fb7dd[_0xc72c('0xe')][_0xc72c('0x10')]);}logger['error'](_0xc72c('0xa'),_0xba941a,_0x4fb7dd['error'][_0xc72c('0x10')]);return _0x13489d(_0x4fb7dd[_0xc72c('0xe')]['message']);}else{logger[_0xc72c('0x11')]('UserChatQueue,\x20%s,\x20%s',_0xba941a,_0xc72c('0xb'));_0x13489d(_0x4fb7dd[_0xc72c('0x12')]['message']);}})['catch'](function(_0x1c111d){logger[_0xc72c('0xe')](_0xc72c('0xa'),_0xba941a,_0x1c111d);_0x1a6ba3(_0x1c111d);});});} \ No newline at end of file +var _0xeea2=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x243f79,_0x429e45){var _0x460321=function(_0x4feefc){while(--_0x4feefc){_0x243f79['push'](_0x243f79['shift']());}};_0x460321(++_0x429e45);}(_0xeea2,0x71));var _0x2eea=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xeea2[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x2eea('0x0'));var util=require(_0x2eea('0x1'));var moment=require(_0x2eea('0x2'));var BPromise=require(_0x2eea('0x3'));var rs=require(_0x2eea('0x4'));var fs=require('fs');var Redis=require(_0x2eea('0x5'));var db=require(_0x2eea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2eea('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2eea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41b80a,_0xd14ce9,_0x3ed5a4){return new BPromise(function(_0x357eca,_0x2c96c9){return client[_0x2eea('0x9')](_0x41b80a,_0x3ed5a4)[_0x2eea('0xa')](function(_0x2cd81f){logger[_0x2eea('0xb')](_0x2eea('0xc'),_0xd14ce9,_0x2eea('0xd'));logger[_0x2eea('0xe')](_0x2eea('0xf'),_0xd14ce9,_0x2eea('0xd'),JSON['stringify'](_0x2cd81f));if(_0x2cd81f[_0x2eea('0x10')]){if(_0x2cd81f[_0x2eea('0x10')][_0x2eea('0x11')]===0x1f4){logger[_0x2eea('0x10')](_0x2eea('0xc'),_0xd14ce9,_0x2cd81f[_0x2eea('0x10')]['message']);return _0x2c96c9(_0x2cd81f[_0x2eea('0x10')][_0x2eea('0x12')]);}logger[_0x2eea('0x10')](_0x2eea('0xc'),_0xd14ce9,_0x2cd81f[_0x2eea('0x10')]['message']);return _0x357eca(_0x2cd81f[_0x2eea('0x10')][_0x2eea('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0xd14ce9,_0x2eea('0xd'));_0x357eca(_0x2cd81f[_0x2eea('0x13')][_0x2eea('0x12')]);}})[_0x2eea('0x14')](function(_0x8bd1e2){logger[_0x2eea('0x10')](_0x2eea('0xc'),_0xd14ce9,_0x8bd1e2);_0x2c96c9(_0x8bd1e2);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 91e9159..d2dd325 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3062c,_0x388bac){var _0xfa05ba=function(_0x1918c0){while(--_0x1918c0){_0x3062c['push'](_0x3062c['shift']());}};_0xfa05ba(++_0x388bac);}(_0x70e0,0x17b));var _0x070e=function(_0x4dbfb9,_0x1f5e3b){_0x4dbfb9=_0x4dbfb9-0x0;var _0x13a5fa=_0x70e0[_0x4dbfb9];return _0x13a5fa;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xb320a6,_0x587df8){var _0x1c39c2=function(_0x12681a){while(--_0x12681a){_0xb320a6['push'](_0xb320a6['shift']());}};_0x1c39c2(++_0x587df8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0xcb91[_0x14477e];return _0x5d4a05;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 55b15c4..24cb16e 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 _0x73b1=['exports','INTEGER'];(function(_0x3b0c12,_0x90a7f8){var _0x9ba1d2=function(_0x48786b){while(--_0x48786b){_0x3b0c12['push'](_0x3b0c12['shift']());}};_0x9ba1d2(++_0x90a7f8);}(_0x73b1,0xa8));var _0x173b=function(_0x51565f,_0x4b5771){_0x51565f=_0x51565f-0x0;var _0x104ae5=_0x73b1[_0x51565f];return _0x104ae5;};'use strict';var Sequelize=require('sequelize');module[_0x173b('0x0')]={'penalty':{'type':Sequelize[_0x173b('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb3c9=['exports','INTEGER','sequelize'];(function(_0x100173,_0x83a00b){var _0x1f64f0=function(_0x575892){while(--_0x575892){_0x100173['push'](_0x100173['shift']());}};_0x1f64f0(++_0x83a00b);}(_0xb3c9,0xa4));var _0x9b3c=function(_0x4f652a,_0x46ed19){_0x4f652a=_0x4f652a-0x0;var _0x48a7d6=_0xb3c9[_0x4f652a];return _0x48a7d6;};'use strict';var Sequelize=require(_0x9b3c('0x0'));module[_0x9b3c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9b3c('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 1ba5f32..3911b49 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 _0x4af0=['moment','bluebird','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api'];(function(_0x5a256a,_0x34b0c5){var _0x48b301=function(_0x3648d1){while(--_0x3648d1){_0x5a256a['push'](_0x5a256a['shift']());}};_0x48b301(++_0x34b0c5);}(_0x4af0,0x8d));var _0x04af=function(_0x28087c,_0x895c0f){_0x28087c=_0x28087c-0x0;var _0x329122=_0x4af0[_0x28087c];return _0x329122;};'use strict';var _=require(_0x04af('0x0'));var util=require('util');var logger=require(_0x04af('0x1'))(_0x04af('0x2'));var moment=require(_0x04af('0x3'));var BPromise=require(_0x04af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04af('0x5'));var rimraf=require(_0x04af('0x6'));var config=require(_0x04af('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x04af('0x8')]=function(_0x5c0737,_0x2e5d88){return _0x5c0737[_0x04af('0x9')](_0x04af('0xa'),attributes,{'tableName':_0x04af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf950=['UserFaxQueue','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define'];(function(_0x3f21ea,_0x385323){var _0x58fc15=function(_0x23f19d){while(--_0x23f19d){_0x3f21ea['push'](_0x3f21ea['shift']());}};_0x58fc15(++_0x385323);}(_0xf950,0x12d));var _0x0f95=function(_0x15253b,_0x275b10){_0x15253b=_0x15253b-0x0;var _0xa92106=_0xf950[_0x15253b];return _0xa92106;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f95('0x0'))(_0x0f95('0x1'));var moment=require(_0x0f95('0x2'));var BPromise=require('bluebird');var rp=require(_0x0f95('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f95('0x4'));var config=require(_0x0f95('0x5'));var attributes=require(_0x0f95('0x6'));module[_0x0f95('0x7')]=function(_0x1e83a7,_0x3ff8a7){return _0x1e83a7[_0x0f95('0x8')](_0x0f95('0x9'),attributes,{'tableName':'user_has_fax_queues','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 80520fa..4f0290d 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 _0x51a7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','lodash'];(function(_0x568e8d,_0x2091d7){var _0x2cfe58=function(_0xe39aeb){while(--_0xe39aeb){_0x568e8d['push'](_0x568e8d['shift']());}};_0x2cfe58(++_0x2091d7);}(_0x51a7,0x113));var _0x751a=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0x51a7[_0x34aec4];return _0x51e1a7;};'use strict';var _=require(_0x751a('0x0'));var util=require(_0x751a('0x1'));var moment=require(_0x751a('0x2'));var BPromise=require(_0x751a('0x3'));var rs=require(_0x751a('0x4'));var fs=require('fs');var Redis=require(_0x751a('0x5'));var db=require(_0x751a('0x6'))['db'];var utils=require(_0x751a('0x7'));var logger=require(_0x751a('0x8'))(_0x751a('0x9'));var config=require(_0x751a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x751a('0xb')][_0x751a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28a234,_0x540bd5,_0x2f7f8e){return new BPromise(function(_0x1bbc11,_0x40afd5){return client[_0x751a('0xd')](_0x28a234,_0x2f7f8e)[_0x751a('0xe')](function(_0x511146){logger['info'](_0x751a('0xf'),_0x540bd5,_0x751a('0x10'));logger[_0x751a('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x540bd5,_0x751a('0x10'),JSON['stringify'](_0x511146));if(_0x511146['error']){if(_0x511146['error'][_0x751a('0x12')]===0x1f4){logger[_0x751a('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x540bd5,_0x511146[_0x751a('0x13')][_0x751a('0x14')]);return _0x40afd5(_0x511146[_0x751a('0x13')][_0x751a('0x14')]);}logger[_0x751a('0x13')](_0x751a('0xf'),_0x540bd5,_0x511146[_0x751a('0x13')][_0x751a('0x14')]);return _0x1bbc11(_0x511146['error'][_0x751a('0x14')]);}else{logger[_0x751a('0x15')](_0x751a('0xf'),_0x540bd5,'request\x20sent');_0x1bbc11(_0x511146[_0x751a('0x16')][_0x751a('0x14')]);}})['catch'](function(_0x6ffbd0){logger[_0x751a('0x13')](_0x751a('0xf'),_0x540bd5,_0x6ffbd0);_0x40afd5(_0x6ffbd0);});});} \ No newline at end of file +var _0x2ecf=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash'];(function(_0x561368,_0x5119f9){var _0x3c14eb=function(_0x5ac6cf){while(--_0x5ac6cf){_0x561368['push'](_0x561368['shift']());}};_0x3c14eb(++_0x5119f9);}(_0x2ecf,0x92));var _0xf2ec=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x2ecf[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xf2ec('0x0'));var util=require(_0xf2ec('0x1'));var moment=require('moment');var BPromise=require(_0xf2ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2ec('0x3'));var db=require(_0xf2ec('0x4'))['db'];var utils=require(_0xf2ec('0x5'));var logger=require(_0xf2ec('0x6'))(_0xf2ec('0x7'));var config=require(_0xf2ec('0x8'));var jayson=require(_0xf2ec('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1fcdf3,_0x589d74,_0x406b94){return new BPromise(function(_0x65d7db,_0x20571c){return client[_0xf2ec('0xa')](_0x1fcdf3,_0x406b94)[_0xf2ec('0xb')](function(_0x56e60e){logger['info'](_0xf2ec('0xc'),_0x589d74,_0xf2ec('0xd'));logger[_0xf2ec('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x589d74,_0xf2ec('0xd'),JSON['stringify'](_0x56e60e));if(_0x56e60e['error']){if(_0x56e60e[_0xf2ec('0xf')][_0xf2ec('0x10')]===0x1f4){logger[_0xf2ec('0xf')](_0xf2ec('0xc'),_0x589d74,_0x56e60e['error'][_0xf2ec('0x11')]);return _0x20571c(_0x56e60e[_0xf2ec('0xf')]['message']);}logger[_0xf2ec('0xf')](_0xf2ec('0xc'),_0x589d74,_0x56e60e[_0xf2ec('0xf')][_0xf2ec('0x11')]);return _0x65d7db(_0x56e60e['error'][_0xf2ec('0x11')]);}else{logger[_0xf2ec('0x12')](_0xf2ec('0xc'),_0x589d74,'request\x20sent');_0x65d7db(_0x56e60e[_0xf2ec('0x13')][_0xf2ec('0x11')]);}})[_0xf2ec('0x14')](function(_0xbbe635){logger['error'](_0xf2ec('0xc'),_0x589d74,_0xbbe635);_0x20571c(_0xbbe635);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8181c7f..bf40ebf 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x52662b,_0x2996e1){var _0x2a0ad5=function(_0x5e3bd8){while(--_0x5e3bd8){_0x52662b['push'](_0x52662b['shift']());}};_0x2a0ad5(++_0x2996e1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x41b4b8,_0x4c6721){var _0x543782=function(_0x2f00ed){while(--_0x2f00ed){_0x41b4b8['push'](_0x41b4b8['shift']());}};_0x543782(++_0x4c6721);}(_0x70e0,0x17b));var _0x070e=function(_0x2b720a,_0x2b744e){_0x2b720a=_0x2b720a-0x0;var _0x422c12=_0x70e0[_0x2b720a];return _0x422c12;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 4b73716..60c1acf 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 _0xadcb=['sequelize','INTEGER'];(function(_0x62e9b9,_0x5ef683){var _0x16f72a=function(_0x2734e2){while(--_0x2734e2){_0x62e9b9['push'](_0x62e9b9['shift']());}};_0x16f72a(++_0x5ef683);}(_0xadcb,0x1a2));var _0xbadc=function(_0x4b9580,_0x573765){_0x4b9580=_0x4b9580-0x0;var _0x5e218e=_0xadcb[_0x4b9580];return _0x5e218e;};'use strict';var Sequelize=require(_0xbadc('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbadc('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xde5f=['INTEGER','sequelize','exports'];(function(_0x29d85e,_0x4c8365){var _0x53f590=function(_0x1b78d9){while(--_0x1b78d9){_0x29d85e['push'](_0x29d85e['shift']());}};_0x53f590(++_0x4c8365);}(_0xde5f,0x97));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfde5('0x0'));module[_0xfde5('0x1')]={'penalty':{'type':Sequelize[_0xfde5('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 6f20d28..4a27fd8 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 _0x4fbd=['rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fbd,0x163));var _0xd4fb=function(_0x2509d0,_0x1f45da){_0x2509d0=_0x2509d0-0x0;var _0x5da57a=_0x4fbd[_0x2509d0];return _0x5da57a;};'use strict';var _=require(_0xd4fb('0x0'));var util=require(_0xd4fb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd4fb('0x2'));var BPromise=require('bluebird');var rp=require(_0xd4fb('0x3'));var fs=require('fs');var path=require(_0xd4fb('0x4'));var rimraf=require(_0xd4fb('0x5'));var config=require('../../config/environment');var attributes=require(_0xd4fb('0x6'));module[_0xd4fb('0x7')]=function(_0x11f1c2,_0x3c0980){return _0x11f1c2[_0xd4fb('0x8')](_0xd4fb('0x9'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1cf=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_mail_queues','util','../../config/logger','api','moment'];(function(_0x43606b,_0x2f2292){var _0xbfd21a=function(_0x2f28fa){while(--_0x2f28fa){_0x43606b['push'](_0x43606b['shift']());}};_0xbfd21a(++_0x2f2292);}(_0xa1cf,0xe0));var _0xfa1c=function(_0x2a9f57,_0x4736c9){_0x2a9f57=_0x2a9f57-0x0;var _0x291e2e=_0xa1cf[_0x2a9f57];return _0x291e2e;};'use strict';var _=require('lodash');var util=require(_0xfa1c('0x0'));var logger=require(_0xfa1c('0x1'))(_0xfa1c('0x2'));var moment=require(_0xfa1c('0x3'));var BPromise=require(_0xfa1c('0x4'));var rp=require(_0xfa1c('0x5'));var fs=require('fs');var path=require(_0xfa1c('0x6'));var rimraf=require(_0xfa1c('0x7'));var config=require(_0xfa1c('0x8'));var attributes=require('./userMailQueue.attributes');module[_0xfa1c('0x9')]=function(_0x412e7b,_0x461f7e){return _0x412e7b[_0xfa1c('0xa')]('UserMailQueue',attributes,{'tableName':_0xfa1c('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 d80e4c2..d67b9f8 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x10e2b9,_0x30af06){var _0x32cebe=function(_0x4f5064){while(--_0x4f5064){_0x10e2b9['push'](_0x10e2b9['shift']());}};_0x32cebe(++_0x30af06);}(_0x55ca,0x126));var _0xa55c=function(_0x4392af,_0xec5afe){_0x4392af=_0x4392af-0x0;var _0x9fa8eb=_0x55ca[_0x4392af];return _0x9fa8eb;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3aa8e4,_0x4d4f70){var _0x2a8f26=function(_0x33cf1d){while(--_0x33cf1d){_0x3aa8e4['push'](_0x3aa8e4['shift']());}};_0x2a8f26(++_0x4d4f70);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 94dd67b..3160f11 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 _0xd868=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','path','connect-timeout'];(function(_0x5be827,_0x1cfda1){var _0x2962c0=function(_0x27829e){while(--_0x27829e){_0x5be827['push'](_0x5be827['shift']());}};_0x2962c0(++_0x1cfda1);}(_0xd868,0xcd));var _0x8d86=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xd868[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x8d86('0x0'));var util=require('util');var path=require(_0x8d86('0x1'));var timeout=require(_0x8d86('0x2'));var express=require(_0x8d86('0x3'));var router=express[_0x8d86('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8d86('0x5'));var interaction=require(_0x8d86('0x6'));var config=require(_0x8d86('0x7'));var controller=require(_0x8d86('0x8'));router[_0x8d86('0x9')]('/',auth[_0x8d86('0xa')](),controller[_0x8d86('0xb')]);module[_0x8d86('0xc')]=router; \ No newline at end of file +var _0x6572=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x6572,0x127));var _0x2657=function(_0x474b93,_0x4b406f){_0x474b93=_0x474b93-0x0;var _0x38f12c=_0x6572[_0x474b93];return _0x38f12c;};'use strict';var multer=require(_0x2657('0x0'));var util=require(_0x2657('0x1'));var path=require(_0x2657('0x2'));var timeout=require(_0x2657('0x3'));var express=require(_0x2657('0x4'));var router=express[_0x2657('0x5')]();var fs_extra=require(_0x2657('0x6'));var auth=require(_0x2657('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2657('0x8'));var controller=require(_0x2657('0x9'));router['post']('/',auth[_0x2657('0xa')](),controller[_0x2657('0xb')]);module[_0x2657('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 43e751f..879d12e 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 _0xfb16=['sequelize','exports','STRING','TEXT'];(function(_0xf21130,_0x5ae2e1){var _0x5c4d2e=function(_0x2d75c8){while(--_0x2d75c8){_0xf21130['push'](_0xf21130['shift']());}};_0x5c4d2e(++_0x5ae2e1);}(_0xfb16,0x184));var _0x6fb1=function(_0x2042f0,_0x30315b){_0x2042f0=_0x2042f0-0x0;var _0x1b7309=_0xfb16[_0x2042f0];return _0x1b7309;};'use strict';var Sequelize=require(_0x6fb1('0x0'));module[_0x6fb1('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x6fb1('0x2')]},'recipientsId':{'type':Sequelize[_0x6fb1('0x3')]},'recipientsDescription':{'type':Sequelize[_0x6fb1('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xff92=['BOOLEAN','TEXT'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xff92,0xc9));var _0x2ff9=function(_0x34ca02,_0x58243a){_0x34ca02=_0x34ca02-0x0;var _0x589e8b=_0xff92[_0x34ca02];return _0x589e8b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x2ff9('0x0')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x2ff9('0x1')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 773d931..1ecbb6f 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 _0x76bb=['getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','status','end','json','offset','undefined','limit','count','Content-Range','apply','then','stack','send','sendUserNotification','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','body','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','sortBy','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','queue','replace','Queue','push','findOne'];(function(_0x189d12,_0x17aafc){var _0x39b0ad=function(_0x21a7de){while(--_0x21a7de){_0x189d12['push'](_0x189d12['shift']());}};_0x39b0ad(++_0x17aafc);}(_0x76bb,0xc0));var _0xb76b=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x76bb[_0x4314d7];return _0x5c599b;};'use strict';var emlformat=require(_0xb76b('0x0'));var rimraf=require(_0xb76b('0x1'));var zipdir=require(_0xb76b('0x2'));var jsonpatch=require(_0xb76b('0x3'));var rp=require(_0xb76b('0x4'));var moment=require(_0xb76b('0x5'));var BPromise=require(_0xb76b('0x6'));var Mustache=require('mustache');var util=require(_0xb76b('0x7'));var path=require(_0xb76b('0x8'));var sox=require('sox');var csv=require(_0xb76b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb76b('0xa'));var _=require(_0xb76b('0xb'));var squel=require(_0xb76b('0xc'));var crypto=require(_0xb76b('0xd'));var jsforce=require(_0xb76b('0xe'));var deskjs=require(_0xb76b('0xf'));var toCsv=require(_0xb76b('0x9'));var querystring=require('querystring');var Papa=require(_0xb76b('0x10'));var Redis=require(_0xb76b('0x11'));var authService=require(_0xb76b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb76b('0x13'));var hardwareService=require(_0xb76b('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb76b('0x15'));var db=require(_0xb76b('0x16'))['db'];config['redis']=_[_0xb76b('0x17')](config['redis'],{'host':_0xb76b('0x18'),'port':0x18eb});var socket=require(_0xb76b('0x19'))(new Redis(config[_0xb76b('0x1a')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x36d412,_0x38ceea){_0x38ceea=_0x38ceea||0xcc;return function(_0x57aa25){if(_0x57aa25){return _0x36d412['sendStatus'](_0x38ceea);}return _0x36d412[_0xb76b('0x1b')](_0x38ceea)[_0xb76b('0x1c')]();};}function respondWithResult(_0x4c214d,_0x3c2692){_0x3c2692=_0x3c2692||0xc8;return function(_0x6d58f6){if(_0x6d58f6){return _0x4c214d['status'](_0x3c2692)[_0xb76b('0x1d')](_0x6d58f6);}};}function respondWithFilteredResult(_0x44516a,_0x579b3d){return function(_0x5cfd2d){if(_0x5cfd2d){var _0x4a2a15=typeof _0x579b3d[_0xb76b('0x1e')]===_0xb76b('0x1f')&&typeof _0x579b3d[_0xb76b('0x20')]==='undefined';var _0x1b267d=_0x5cfd2d[_0xb76b('0x21')];var _0x586ae1=_0x4a2a15?0x0:_0x579b3d[_0xb76b('0x1e')];var _0x10405a=_0x4a2a15?_0x5cfd2d[_0xb76b('0x21')]:_0x579b3d['offset']+_0x579b3d[_0xb76b('0x20')];var _0x42e703;if(_0x10405a>=_0x1b267d){_0x10405a=_0x1b267d;_0x42e703=0xc8;}else{_0x42e703=0xce;}_0x44516a['status'](_0x42e703);return _0x44516a['set'](_0xb76b('0x22'),_0x586ae1+'-'+_0x10405a+'/'+_0x1b267d)[_0xb76b('0x1d')](_0x5cfd2d);}return null;};}function patchUpdates(_0x1e4ffa){return function(_0x5025e5){try{jsonpatch[_0xb76b('0x23')](_0x5025e5,_0x1e4ffa,!![]);}catch(_0x2ae994){return BPromise['reject'](_0x2ae994);}return _0x5025e5['save']();};}function saveUpdates(_0x4abf22,_0x57bd4e){return function(_0x2746e7){if(_0x2746e7){return _0x2746e7['update'](_0x4abf22)[_0xb76b('0x24')](function(_0x4713b7){return _0x4713b7;});}return null;};}function removeEntity(_0x11d8d9,_0x31cdfd){return function(_0x5ad546){if(_0x5ad546){return _0x5ad546['destroy']()[_0xb76b('0x24')](function(){_0x11d8d9[_0xb76b('0x1b')](0xcc)[_0xb76b('0x1c')]();});}};}function handleEntityNotFound(_0x3c0434,_0x3639c5){return function(_0x17e8a2){if(!_0x17e8a2){_0x3c0434['sendStatus'](0x194);}return _0x17e8a2;};}function handleError(_0x18c2f9,_0x1b9afd){_0x1b9afd=_0x1b9afd||0x1f4;return function(_0x1778e5){logger['error'](_0x1778e5[_0xb76b('0x25')]);if(_0x1778e5['name']){delete _0x1778e5['name'];}_0x18c2f9[_0xb76b('0x1b')](_0x1b9afd)[_0xb76b('0x26')](_0x1778e5);};}exports[_0xb76b('0x27')]=function(_0x17644f,_0xbf3869,_0x2c554b){if(!_0x17644f['body'][_0xb76b('0x28')](_0xb76b('0x29'))&&!_0x17644f['body']['hasOwnProperty']('TemplateId')){throw new db[(_0xb76b('0x2a'))][(_0xb76b('0x2b'))](_0xb76b('0x2c'));}else{if(_0x17644f['body'][_0xb76b('0x28')](_0xb76b('0x2d'))&&!_0x17644f['body'][_0xb76b('0x28')](_0xb76b('0x2e'))){throw new db[(_0xb76b('0x2a'))][(_0xb76b('0x2b'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x17644f[_0xb76b('0x2f')][_0xb76b('0x28')](_0xb76b('0x30'))){throw new db[(_0xb76b('0x2a'))]['ValidationError'](_0xb76b('0x31'));}else{try{var _0x1d42c4=JSON[_0xb76b('0x32')](_0x17644f[_0xb76b('0x2f')][_0xb76b('0x30')]);}catch(_0x2f6bd9){logger[_0xb76b('0x33')](_0x2f6bd9);throw new db[(_0xb76b('0x2a'))][(_0xb76b('0x2b'))](_0xb76b('0x34'));}var _0x4fcd1f=[_0xb76b('0x35'),_0xb76b('0x36'),_0xb76b('0x37'),'openchannelqueue',_0xb76b('0x38'),_0xb76b('0x39'),_0xb76b('0x3a'),_0xb76b('0x3b'),'user'];if(_[_0xb76b('0x3c')](_0x1d42c4,function(_0x275c12){return!_[_0xb76b('0x3d')](_0x4fcd1f,_0x275c12[_0xb76b('0x3e')][_0xb76b('0x3f')]());})){throw new db[(_0xb76b('0x2a'))][(_0xb76b('0x2b'))](_0xb76b('0x40'));}}}var _0x20e7c9={};_0x20e7c9[_0xb76b('0x41')]=_0x17644f[_0xb76b('0x2f')][_0xb76b('0x28')]('senderName')?_0x17644f[_0xb76b('0x2f')][_0xb76b('0x41')]:_0x17644f[_0xb76b('0x42')][_0xb76b('0x43')];_0x20e7c9[_0xb76b('0x44')]=_[_0xb76b('0x45')](_0x17644f['body'][_0xb76b('0x44')])?null:_0x17644f[_0xb76b('0x2f')][_0xb76b('0x44')];_0x20e7c9['beep']=_0x17644f[_0xb76b('0x2f')][_0xb76b('0x46')]||![];_0x20e7c9[_0xb76b('0x47')]=_0x17644f[_0xb76b('0x42')]['id'];return getContent(_0x17644f[_0xb76b('0x2f')])[_0xb76b('0x24')](function(_0x49cadf){_0x20e7c9['body']=_0x49cadf;return getRecipients(_0x1d42c4);})['then'](function(_0x5b8724){_0x20e7c9['recipientsId']=_[_0xb76b('0x48')](_0x5b8724)['join'](',');return db['sequelize'][_0xb76b('0x49')](function(_0x5078b9){return db[_0xb76b('0x4a')][_0xb76b('0x4b')](_0x20e7c9,{'raw':!![],'transaction':_0x5078b9})[_0xb76b('0x24')](function(_0x3dc536){var _0x4d1d1c={'sender':_0x20e7c9[_0xb76b('0x41')],'description':_0x20e7c9[_0xb76b('0x44')],'content':_0x20e7c9[_0xb76b('0x2f')],'beep':_0x20e7c9['beep']};_0x5b8724[_0xb76b('0x4c')](function(_0x5ea497){_0x4d1d1c[_0xb76b('0x4d')]=_0x5ea497;socket[_0xb76b('0x4e')](_0xb76b('0x4f'),_0x4d1d1c);});return _0x3dc536;});});})[_0xb76b('0x24')](respondWithResult(_0xbf3869,0xc9))[_0xb76b('0x50')](handleError(_0xbf3869,null));};function getContent(_0xaaba5c){return new BPromise(function(_0x34a3cc,_0x2bb3c8){if(_0xaaba5c[_0xb76b('0x29')]){_0x34a3cc(_0xaaba5c[_0xb76b('0x29')]);return;}return db[_0xb76b('0x51')]['findOne']({'attributes':[_0xb76b('0x52')],'where':{'id':_0xaaba5c['TemplateId']},'raw':!![]})[_0xb76b('0x24')](function(_0x299536){if(!_0x299536)throw new db[(_0xb76b('0x2a'))][(_0xb76b('0x2b'))](_0xb76b('0x53'));var _0x898edc=Mustache[_0xb76b('0x54')](_0x299536[_0xb76b('0x52')],_0xaaba5c['view']);_0x34a3cc(_0x898edc);})[_0xb76b('0x50')](function(_0x2ef74b){_0x2bb3c8(_0x2ef74b);});});}function getRecipients(_0x182e86){return new BPromise(function(_0x25b462,_0x24dda4){var _0x5a2e4b=[];var _0x1399d5=[];_0x182e86[_0xb76b('0x4c')](function(_0x2f8676){var _0x1650cc=_[_0xb76b('0x55')](_0x2f8676['model'][_0xb76b('0x3f')]());if(_0x1650cc==='User'){_0x5a2e4b=_[_0xb76b('0x56')](_0x5a2e4b,_0x2f8676[_0xb76b('0x57')]);}else{if(_[_0xb76b('0x3d')](_0x1650cc,_0xb76b('0x58')))_0x1650cc=_0x1650cc[_0xb76b('0x59')](_0xb76b('0x58'),_0xb76b('0x5a'));_0x2f8676[_0xb76b('0x57')][_0xb76b('0x4c')](function(_0x5d684f){_0x1399d5[_0xb76b('0x5b')](getAgents(_0x1650cc,_0x5d684f));});}});return BPromise['all'](_0x1399d5)[_0xb76b('0x24')](function(_0x38c3ba){_0x5a2e4b=_['union'](_0x5a2e4b,_['flatten'](_0x38c3ba));_0x25b462(_0x5a2e4b);})[_0xb76b('0x50')](function(_0x4db0ff){_0x24dda4(_0x4db0ff);});});}function getAgents(_0x228819,_0x148d82){return new BPromise(function(_0x4c1a13,_0xd5ded4){return db[_0x228819][_0xb76b('0x5c')]({'where':{'id':_0x148d82}})[_0xb76b('0x24')](function(_0x186ff4){return _0x186ff4[_0xb76b('0x5d')]({'attributes':['id'],'raw':!![]})[_0xb76b('0x24')](function(_0xa7efd4){var _0xeae1af=_[_0xb76b('0x5e')](_0xa7efd4,'id');_0x4c1a13(_0xeae1af);});})[_0xb76b('0x50')](function(_0x11854f){_0xd5ded4(_0x11854f);});});} \ No newline at end of file +var _0xd4d1=['smsqueue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','catch','startCase','User','union','ids','replace','queue','push','all','flatten','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','json','limit','undefined','offset','set','apply','save','then','destroy','end','error','stack','name','send','sendUserNotification','body','text','TemplateId','ValidationError','hasOwnProperty','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue'];(function(_0x295ea9,_0x19d658){var _0x59a3fe=function(_0x35be54){while(--_0x35be54){_0x295ea9['push'](_0x295ea9['shift']());}};_0x59a3fe(++_0x19d658);}(_0xd4d1,0x8d));var _0x1d4d=function(_0x420784,_0x186f7e){_0x420784=_0x420784-0x0;var _0x416bb2=_0xd4d1[_0x420784];return _0x416bb2;};'use strict';var emlformat=require(_0x1d4d('0x0'));var rimraf=require(_0x1d4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d4d('0x2'));var rp=require(_0x1d4d('0x3'));var moment=require(_0x1d4d('0x4'));var BPromise=require(_0x1d4d('0x5'));var Mustache=require('mustache');var util=require(_0x1d4d('0x6'));var path=require('path');var sox=require(_0x1d4d('0x7'));var csv=require('to-csv');var ejs=require(_0x1d4d('0x8'));var fs=require('fs');var fs_extra=require(_0x1d4d('0x9'));var _=require(_0x1d4d('0xa'));var squel=require(_0x1d4d('0xb'));var crypto=require(_0x1d4d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d4d('0xd'));var toCsv=require(_0x1d4d('0xe'));var querystring=require(_0x1d4d('0xf'));var Papa=require(_0x1d4d('0x10'));var Redis=require(_0x1d4d('0x11'));var authService=require(_0x1d4d('0x12'));var qs=require(_0x1d4d('0x13'));var as=require(_0x1d4d('0x14'));var hardwareService=require(_0x1d4d('0x15'));var logger=require(_0x1d4d('0x16'))('api');var utils=require(_0x1d4d('0x17'));var config=require(_0x1d4d('0x18'));var licenseUtil=require(_0x1d4d('0x19'));var db=require('../../mysqldb')['db'];config[_0x1d4d('0x1a')]=_[_0x1d4d('0x1b')](config[_0x1d4d('0x1a')],{'host':_0x1d4d('0x1c'),'port':0x18eb});var socket=require(_0x1d4d('0x1d'))(new Redis(config['redis']));require(_0x1d4d('0x1e'))['register'](socket);function respondWithStatusCode(_0x14669b,_0x1b455f){_0x1b455f=_0x1b455f||0xcc;return function(_0x25cb54){if(_0x25cb54){return _0x14669b[_0x1d4d('0x1f')](_0x1b455f);}return _0x14669b[_0x1d4d('0x20')](_0x1b455f)['end']();};}function respondWithResult(_0x6ca2f9,_0x266617){_0x266617=_0x266617||0xc8;return function(_0x3886d9){if(_0x3886d9){return _0x6ca2f9[_0x1d4d('0x20')](_0x266617)[_0x1d4d('0x21')](_0x3886d9);}};}function respondWithFilteredResult(_0x153576,_0x10963c){return function(_0x1f8024){if(_0x1f8024){var _0x50dbc4=typeof _0x10963c['offset']==='undefined'&&typeof _0x10963c[_0x1d4d('0x22')]===_0x1d4d('0x23');var _0x20a551=_0x1f8024['count'];var _0x226cb2=_0x50dbc4?0x0:_0x10963c[_0x1d4d('0x24')];var _0x435dc2=_0x50dbc4?_0x1f8024['count']:_0x10963c[_0x1d4d('0x24')]+_0x10963c['limit'];var _0x20a05e;if(_0x435dc2>=_0x20a551){_0x435dc2=_0x20a551;_0x20a05e=0xc8;}else{_0x20a05e=0xce;}_0x153576[_0x1d4d('0x20')](_0x20a05e);return _0x153576[_0x1d4d('0x25')]('Content-Range',_0x226cb2+'-'+_0x435dc2+'/'+_0x20a551)[_0x1d4d('0x21')](_0x1f8024);}return null;};}function patchUpdates(_0x16441a){return function(_0x2a2857){try{jsonpatch[_0x1d4d('0x26')](_0x2a2857,_0x16441a,!![]);}catch(_0x491e17){return BPromise['reject'](_0x491e17);}return _0x2a2857[_0x1d4d('0x27')]();};}function saveUpdates(_0x593705,_0x8319a5){return function(_0x1c9cb6){if(_0x1c9cb6){return _0x1c9cb6['update'](_0x593705)[_0x1d4d('0x28')](function(_0x3075e1){return _0x3075e1;});}return null;};}function removeEntity(_0x3aeac1,_0x533134){return function(_0x584c83){if(_0x584c83){return _0x584c83[_0x1d4d('0x29')]()['then'](function(){_0x3aeac1[_0x1d4d('0x20')](0xcc)[_0x1d4d('0x2a')]();});}};}function handleEntityNotFound(_0x14af3a,_0x1f7918){return function(_0x7bf902){if(!_0x7bf902){_0x14af3a[_0x1d4d('0x1f')](0x194);}return _0x7bf902;};}function handleError(_0x3f02d8,_0x12dbdd){_0x12dbdd=_0x12dbdd||0x1f4;return function(_0x201621){logger[_0x1d4d('0x2b')](_0x201621[_0x1d4d('0x2c')]);if(_0x201621[_0x1d4d('0x2d')]){delete _0x201621[_0x1d4d('0x2d')];}_0x3f02d8[_0x1d4d('0x20')](_0x12dbdd)[_0x1d4d('0x2e')](_0x201621);};}exports[_0x1d4d('0x2f')]=function(_0x35249e,_0x49440f,_0x1fe24b){if(!_0x35249e[_0x1d4d('0x30')]['hasOwnProperty'](_0x1d4d('0x31'))&&!_0x35249e[_0x1d4d('0x30')]['hasOwnProperty'](_0x1d4d('0x32'))){throw new db['Sequelize'][(_0x1d4d('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x35249e[_0x1d4d('0x30')][_0x1d4d('0x34')](_0x1d4d('0x32'))&&!_0x35249e[_0x1d4d('0x30')][_0x1d4d('0x34')]('view')){throw new db[(_0x1d4d('0x35'))][(_0x1d4d('0x33'))](_0x1d4d('0x36'));}if(!_0x35249e['body']['hasOwnProperty'](_0x1d4d('0x37'))){throw new db[(_0x1d4d('0x35'))][(_0x1d4d('0x33'))](_0x1d4d('0x38'));}else{try{var _0xb99774=JSON[_0x1d4d('0x39')](_0x35249e['body']['recipients']);}catch(_0x4ef628){logger['error'](_0x4ef628);throw new db['Sequelize'][(_0x1d4d('0x33'))](_0x1d4d('0x3a'));}var _0x1da8c5=[_0x1d4d('0x3b'),_0x1d4d('0x3c'),_0x1d4d('0x3d'),_0x1d4d('0x3e'),_0x1d4d('0x3f'),'voicequeue',_0x1d4d('0x40'),'team',_0x1d4d('0x41')];if(_[_0x1d4d('0x42')](_0xb99774,function(_0x4e0310){return!_[_0x1d4d('0x43')](_0x1da8c5,_0x4e0310[_0x1d4d('0x44')][_0x1d4d('0x45')]());})){throw new db[(_0x1d4d('0x35'))][(_0x1d4d('0x33'))](_0x1d4d('0x46'));}}}var _0x51bb5b={};_0x51bb5b[_0x1d4d('0x47')]=_0x35249e[_0x1d4d('0x30')][_0x1d4d('0x34')](_0x1d4d('0x47'))?_0x35249e['body'][_0x1d4d('0x47')]:_0x35249e[_0x1d4d('0x41')]['fullname'];_0x51bb5b[_0x1d4d('0x48')]=_[_0x1d4d('0x49')](_0x35249e[_0x1d4d('0x30')]['recipientsDescription'])?null:_0x35249e['body'][_0x1d4d('0x48')];_0x51bb5b[_0x1d4d('0x4a')]=_0x35249e[_0x1d4d('0x30')]['beep']||![];_0x51bb5b[_0x1d4d('0x4b')]=_0x35249e[_0x1d4d('0x41')]['id'];return getContent(_0x35249e['body'])[_0x1d4d('0x28')](function(_0x5c6f84){_0x51bb5b[_0x1d4d('0x30')]=_0x5c6f84;return getRecipients(_0xb99774);})[_0x1d4d('0x28')](function(_0x423606){_0x51bb5b['recipientsId']=_[_0x1d4d('0x4c')](_0x423606)['join'](',');return db[_0x1d4d('0x4d')][_0x1d4d('0x4e')](function(_0x562ece){return db[_0x1d4d('0x4f')][_0x1d4d('0x50')](_0x51bb5b,{'raw':!![],'transaction':_0x562ece})['then'](function(_0x27efd9){var _0x2a2d82={'sender':_0x51bb5b['senderName'],'description':_0x51bb5b['recipientsDescription'],'content':_0x51bb5b['body'],'beep':_0x51bb5b[_0x1d4d('0x4a')]};_0x423606[_0x1d4d('0x51')](function(_0x51be19){_0x2a2d82[_0x1d4d('0x52')]=_0x51be19;socket[_0x1d4d('0x53')](_0x1d4d('0x54'),_0x2a2d82);});return _0x27efd9;});});})[_0x1d4d('0x28')](respondWithResult(_0x49440f,0xc9))['catch'](handleError(_0x49440f,null));};function getContent(_0x180ba4){return new BPromise(function(_0x594368,_0x3cd7ef){if(_0x180ba4['text']){_0x594368(_0x180ba4[_0x1d4d('0x31')]);return;}return db[_0x1d4d('0x55')][_0x1d4d('0x56')]({'attributes':[_0x1d4d('0x57')],'where':{'id':_0x180ba4[_0x1d4d('0x32')]},'raw':!![]})[_0x1d4d('0x28')](function(_0x534fbf){if(!_0x534fbf)throw new db[(_0x1d4d('0x35'))][(_0x1d4d('0x33'))](_0x1d4d('0x58'));var _0x3414a6=Mustache[_0x1d4d('0x59')](_0x534fbf[_0x1d4d('0x57')],_0x180ba4[_0x1d4d('0x5a')]);_0x594368(_0x3414a6);})[_0x1d4d('0x5b')](function(_0x1038ad){_0x3cd7ef(_0x1038ad);});});}function getRecipients(_0xb9b40f){return new BPromise(function(_0x2310be,_0x3ca95f){var _0xd49b74=[];var _0x3e1d03=[];_0xb9b40f[_0x1d4d('0x51')](function(_0x2dfbd0){var _0xf8c72c=_[_0x1d4d('0x5c')](_0x2dfbd0[_0x1d4d('0x44')]['toLowerCase']());if(_0xf8c72c===_0x1d4d('0x5d')){_0xd49b74=_[_0x1d4d('0x5e')](_0xd49b74,_0x2dfbd0[_0x1d4d('0x5f')]);}else{if(_[_0x1d4d('0x43')](_0xf8c72c,'queue'))_0xf8c72c=_0xf8c72c[_0x1d4d('0x60')](_0x1d4d('0x61'),'Queue');_0x2dfbd0[_0x1d4d('0x5f')][_0x1d4d('0x51')](function(_0x4ca00f){_0x3e1d03[_0x1d4d('0x62')](getAgents(_0xf8c72c,_0x4ca00f));});}});return BPromise[_0x1d4d('0x63')](_0x3e1d03)[_0x1d4d('0x28')](function(_0x55c10a){_0xd49b74=_['union'](_0xd49b74,_[_0x1d4d('0x64')](_0x55c10a));_0x2310be(_0xd49b74);})[_0x1d4d('0x5b')](function(_0x19d736){_0x3ca95f(_0x19d736);});});}function getAgents(_0x430ebe,_0x5b0910){return new BPromise(function(_0x5c7a22,_0x1d6736){return db[_0x430ebe][_0x1d4d('0x56')]({'where':{'id':_0x5b0910}})[_0x1d4d('0x28')](function(_0x539ca7){return _0x539ca7[_0x1d4d('0x65')]({'attributes':['id'],'raw':!![]})[_0x1d4d('0x28')](function(_0x438973){var _0x2cc8d9=_['map'](_0x438973,'id');_0x5c7a22(_0x2cc8d9);});})[_0x1d4d('0x5b')](function(_0xa48475){_0x1d6736(_0xa48475);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 23b4330..564a679 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 _0x309c=['emit','exports','UserNotification','update'];(function(_0x186840,_0x37a93b){var _0xa011a8=function(_0x16fe26){while(--_0x16fe26){_0x186840['push'](_0x186840['shift']());}};_0xa011a8(++_0x37a93b);}(_0x309c,0xd2));var _0xc309=function(_0x1e6bec,_0x414697){_0x1e6bec=_0x1e6bec-0x0;var _0x5487bc=_0x309c[_0x1e6bec];return _0x5487bc;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0xc309('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc309('0x1'),'afterDestroy':'remove'};function emitEvent(_0x28e5dc){return function(_0x1cedb7,_0x43198e,_0x3b814c){UserNotificationEvents[_0xc309('0x2')](_0x28e5dc+':'+_0x1cedb7['id'],_0x1cedb7);UserNotificationEvents[_0xc309('0x2')](_0x28e5dc,_0x1cedb7);_0x3b814c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xc309('0x3')]=UserNotificationEvents; \ No newline at end of file +var _0x20e2=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','UserNotification'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20e2,0xc7));var _0x220e=function(_0x69fe09,_0x585840){_0x69fe09=_0x69fe09-0x0;var _0xe0cedd=_0x20e2[_0x69fe09];return _0xe0cedd;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x220e('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x220e('0x1')](0x0);var events={'afterCreate':_0x220e('0x2'),'afterUpdate':_0x220e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54adf7){return function(_0x2d7ae0,_0x3da030,_0x4ec43d){UserNotificationEvents[_0x220e('0x4')](_0x54adf7+':'+_0x2d7ae0['id'],_0x2d7ae0);UserNotificationEvents[_0x220e('0x4')](_0x54adf7,_0x2d7ae0);_0x4ec43d(null);};}for(var e in events){if(events[_0x220e('0x5')](e)){var event=events[e];UserNotification[_0x220e('0x6')](e,emitEvent(event));}}module[_0x220e('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 41f41f9..d55eef4 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 _0x7ce4=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash'];(function(_0x5eb125,_0x2816b5){var _0x11d227=function(_0x25216f){while(--_0x25216f){_0x5eb125['push'](_0x5eb125['shift']());}};_0x11d227(++_0x2816b5);}(_0x7ce4,0xa4));var _0x47ce=function(_0x2bd878,_0x3c672a){_0x2bd878=_0x2bd878-0x0;var _0x174db4=_0x7ce4[_0x2bd878];return _0x174db4;};'use strict';var _=require(_0x47ce('0x0'));var util=require(_0x47ce('0x1'));var logger=require(_0x47ce('0x2'))(_0x47ce('0x3'));var moment=require(_0x47ce('0x4'));var BPromise=require('bluebird');var rp=require(_0x47ce('0x5'));var fs=require('fs');var path=require(_0x47ce('0x6'));var rimraf=require(_0x47ce('0x7'));var config=require(_0x47ce('0x8'));var attributes=require(_0x47ce('0x9'));module[_0x47ce('0xa')]=function(_0x401a3f,_0xf0685c){return _0x401a3f[_0x47ce('0xb')](_0x47ce('0xc'),attributes,{'tableName':_0x47ce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x47ce('0xe')});}; \ No newline at end of file +var _0x5a4d=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userNotification.attributes','UserNotification','userNotifications','utf8mb4'];(function(_0x6ab0fe,_0x2e5f73){var _0x53e27c=function(_0x5a4cd7){while(--_0x5a4cd7){_0x6ab0fe['push'](_0x6ab0fe['shift']());}};_0x53e27c(++_0x2e5f73);}(_0x5a4d,0x18d));var _0xd5a4=function(_0x510abb,_0x2fd9b6){_0x510abb=_0x510abb-0x0;var _0x354e8f=_0x5a4d[_0x510abb];return _0x354e8f;};'use strict';var _=require(_0xd5a4('0x0'));var util=require('util');var logger=require(_0xd5a4('0x1'))('api');var moment=require(_0xd5a4('0x2'));var BPromise=require(_0xd5a4('0x3'));var rp=require(_0xd5a4('0x4'));var fs=require('fs');var path=require(_0xd5a4('0x5'));var rimraf=require(_0xd5a4('0x6'));var config=require('../../config/environment');var attributes=require(_0xd5a4('0x7'));module['exports']=function(_0x431b4b,_0x4d5ff9){return _0x431b4b['define'](_0xd5a4('0x8'),attributes,{'tableName':_0xd5a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd5a4('0xa'),'collate':_0xd5a4('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 41ea4ac..6bfd9a6 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 _0x1889=['../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x45c78a,_0x34036b){var _0x491310=function(_0x57a99b){while(--_0x57a99b){_0x45c78a['push'](_0x45c78a['shift']());}};_0x491310(++_0x34036b);}(_0x1889,0x174));var _0x9188=function(_0x4a0607,_0x304adb){_0x4a0607=_0x4a0607-0x0;var _0x103790=_0x1889[_0x4a0607];return _0x103790;};'use strict';var _=require(_0x9188('0x0'));var util=require(_0x9188('0x1'));var moment=require('moment');var BPromise=require(_0x9188('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9188('0x3'));var db=require(_0x9188('0x4'))['db'];var utils=require(_0x9188('0x5'));var logger=require(_0x9188('0x6'))('rpc');var config=require(_0x9188('0x7'));var jayson=require(_0x9188('0x8'));var client=jayson[_0x9188('0x9')]['http']({'port':0x232a});config[_0x9188('0xa')]=_[_0x9188('0xb')](config[_0x9188('0xa')],{'host':_0x9188('0xc'),'port':0x18eb});var socket=require(_0x9188('0xd'))(new Redis(config['redis']));require(_0x9188('0xe'))['register'](socket);function respondWithRpcPromise(_0x46db7f,_0x15fda6,_0x3a72e9){return new BPromise(function(_0x98c9c8,_0x3fcc2f){return client[_0x9188('0xf')](_0x46db7f,_0x3a72e9)[_0x9188('0x10')](function(_0x1cc463){logger[_0x9188('0x11')]('UserNotification,\x20%s,\x20%s',_0x15fda6,_0x9188('0x12'));logger[_0x9188('0x13')](_0x9188('0x14'),_0x15fda6,_0x9188('0x12'),JSON[_0x9188('0x15')](_0x1cc463));if(_0x1cc463[_0x9188('0x16')]){if(_0x1cc463['error'][_0x9188('0x17')]===0x1f4){logger[_0x9188('0x16')](_0x9188('0x18'),_0x15fda6,_0x1cc463[_0x9188('0x16')][_0x9188('0x19')]);return _0x3fcc2f(_0x1cc463[_0x9188('0x16')]['message']);}logger['error'](_0x9188('0x18'),_0x15fda6,_0x1cc463[_0x9188('0x16')][_0x9188('0x19')]);return _0x98c9c8(_0x1cc463['error'][_0x9188('0x19')]);}else{logger[_0x9188('0x11')](_0x9188('0x18'),_0x15fda6,_0x9188('0x12'));_0x98c9c8(_0x1cc463[_0x9188('0x1a')][_0x9188('0x19')]);}})['catch'](function(_0x19363a){logger[_0x9188('0x16')](_0x9188('0x18'),_0x15fda6,_0x19363a);_0x3fcc2f(_0x19363a);});});} \ No newline at end of file +var _0xcf6e=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xcf6e,0x1ab));var _0xecf6=function(_0x258603,_0x52efaa){_0x258603=_0x258603-0x0;var _0x51d079=_0xcf6e[_0x258603];return _0x51d079;};'use strict';var _=require(_0xecf6('0x0'));var util=require(_0xecf6('0x1'));var moment=require(_0xecf6('0x2'));var BPromise=require(_0xecf6('0x3'));var rs=require(_0xecf6('0x4'));var fs=require('fs');var Redis=require(_0xecf6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xecf6('0x6'));var logger=require(_0xecf6('0x7'))(_0xecf6('0x8'));var config=require(_0xecf6('0x9'));var jayson=require(_0xecf6('0xa'));var client=jayson[_0xecf6('0xb')][_0xecf6('0xc')]({'port':0x232a});config[_0xecf6('0xd')]=_['defaults'](config[_0xecf6('0xd')],{'host':_0xecf6('0xe'),'port':0x18eb});var socket=require(_0xecf6('0xf'))(new Redis(config[_0xecf6('0xd')]));require(_0xecf6('0x10'))[_0xecf6('0x11')](socket);function respondWithRpcPromise(_0x5930eb,_0x4b5b9c,_0x20b8d4){return new BPromise(function(_0x2a3004,_0x561368){return client['request'](_0x5930eb,_0x20b8d4)['then'](function(_0x5e266e){logger[_0xecf6('0x12')](_0xecf6('0x13'),_0x4b5b9c,_0xecf6('0x14'));logger[_0xecf6('0x15')](_0xecf6('0x16'),_0x4b5b9c,_0xecf6('0x14'),JSON['stringify'](_0x5e266e));if(_0x5e266e[_0xecf6('0x17')]){if(_0x5e266e[_0xecf6('0x17')][_0xecf6('0x18')]===0x1f4){logger[_0xecf6('0x17')]('UserNotification,\x20%s,\x20%s',_0x4b5b9c,_0x5e266e['error'][_0xecf6('0x19')]);return _0x561368(_0x5e266e['error'][_0xecf6('0x19')]);}logger[_0xecf6('0x17')](_0xecf6('0x13'),_0x4b5b9c,_0x5e266e[_0xecf6('0x17')][_0xecf6('0x19')]);return _0x2a3004(_0x5e266e[_0xecf6('0x17')][_0xecf6('0x19')]);}else{logger[_0xecf6('0x12')](_0xecf6('0x13'),_0x4b5b9c,'request\x20sent');_0x2a3004(_0x5e266e[_0xecf6('0x1a')][_0xecf6('0x19')]);}})['catch'](function(_0x23105a){logger[_0xecf6('0x17')]('UserNotification,\x20%s,\x20%s',_0x4b5b9c,_0x23105a);_0x561368(_0x23105a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 388618c..28b9b85 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 _0x22ad=['./userNotification.events','remove','update','emit','removeListener','register'];(function(_0x54ae89,_0x57e6ed){var _0x223c57=function(_0x356014){while(--_0x356014){_0x54ae89['push'](_0x54ae89['shift']());}};_0x223c57(++_0x57e6ed);}(_0x22ad,0xc6));var _0xd22a=function(_0x3719b8,_0x14422b){_0x3719b8=_0x3719b8-0x0;var _0x5469fd=_0x22ad[_0x3719b8];return _0x5469fd;};'use strict';var UserNotificationEvents=require(_0xd22a('0x0'));var events=['save',_0xd22a('0x1'),_0xd22a('0x2')];function createListener(_0x4d83b6,_0x196125){return function(_0x30bff1){_0x196125[_0xd22a('0x3')](_0x4d83b6,_0x30bff1);};}function removeListener(_0x1a24a5,_0x387d35){return function(){UserNotificationEvents[_0xd22a('0x4')](_0x1a24a5,_0x387d35);};}exports[_0xd22a('0x5')]=function(_0x3b98eb){for(var _0x3b4c1d=0x0,_0x2de9fc=events['length'];_0x3b4c1d<_0x2de9fc;_0x3b4c1d++){var _0x13a7e5=events[_0x3b4c1d];var _0x3f00ab=createListener('userNotification:'+_0x13a7e5,_0x3b98eb);UserNotificationEvents['on'](_0x13a7e5,_0x3f00ab);}}; \ No newline at end of file +var _0x223c=['removeListener','register','userNotification:','emit'];(function(_0x1e9c53,_0x4affc7){var _0x1d13da=function(_0x4f5f67){while(--_0x4f5f67){_0x1e9c53['push'](_0x1e9c53['shift']());}};_0x1d13da(++_0x4affc7);}(_0x223c,0x163));var _0xc223=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x223c[_0x5b644e];return _0x49c6bf;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save','remove','update'];function createListener(_0x4c62e7,_0x2267c8){return function(_0x389483){_0x2267c8[_0xc223('0x0')](_0x4c62e7,_0x389483);};}function removeListener(_0x45b4d7,_0x489f8c){return function(){UserNotificationEvents[_0xc223('0x1')](_0x45b4d7,_0x489f8c);};}exports[_0xc223('0x2')]=function(_0xf3f8e4){for(var _0x27edca=0x0,_0x442227=events['length'];_0x27edca<_0x442227;_0x27edca++){var _0x162e16=events[_0x27edca];var _0x32866d=createListener(_0xc223('0x3')+_0x162e16,_0xf3f8e4);UserNotificationEvents['on'](_0x162e16,_0x32866d);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 72f6ae7..dcf3a6f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1f7af5,_0x5902ba){var _0x576a87=function(_0x52bec1){while(--_0x52bec1){_0x1f7af5['push'](_0x1f7af5['shift']());}};_0x576a87(++_0x5902ba);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 724633e..6d305b1 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 _0x70d8=['INTEGER','sequelize','exports'];(function(_0x167117,_0x2dee70){var _0x387b70=function(_0x58f7e0){while(--_0x58f7e0){_0x167117['push'](_0x167117['shift']());}};_0x387b70(++_0x2dee70);}(_0x70d8,0xa9));var _0x870d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x70d8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x870d('0x0'));module[_0x870d('0x1')]={'penalty':{'type':Sequelize[_0x870d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa6a9=['exports','INTEGER','sequelize'];(function(_0x4a5055,_0x3c97aa){var _0x329f81=function(_0x565b76){while(--_0x565b76){_0x4a5055['push'](_0x4a5055['shift']());}};_0x329f81(++_0x3c97aa);}(_0xa6a9,0x6e));var _0x9a6a=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0xa6a9[_0xe7281f];return _0x90dc99;};'use strict';var Sequelize=require(_0x9a6a('0x0'));module[_0x9a6a('0x1')]={'penalty':{'type':Sequelize[_0x9a6a('0x2')],'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 3911133..7259148 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 _0x698e=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x698e,0x96));var _0xe698=function(_0x2c3970,_0x38e51b){_0x2c3970=_0x2c3970-0x0;var _0x3988fa=_0x698e[_0x2c3970];return _0x3988fa;};'use strict';var _=require(_0xe698('0x0'));var util=require(_0xe698('0x1'));var logger=require('../../config/logger')(_0xe698('0x2'));var moment=require('moment');var BPromise=require(_0xe698('0x3'));var rp=require(_0xe698('0x4'));var fs=require('fs');var path=require(_0xe698('0x5'));var rimraf=require(_0xe698('0x6'));var config=require(_0xe698('0x7'));var attributes=require(_0xe698('0x8'));module[_0xe698('0x9')]=function(_0x5836e2,_0x362bff){return _0x5836e2[_0xe698('0xa')](_0xe698('0xb'),attributes,{'tableName':_0xe698('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3db8=['UserOpenchannelQueue','lodash','api','moment','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define'];(function(_0xb0ba01,_0x59ef5f){var _0x498999=function(_0x4ce0fe){while(--_0x4ce0fe){_0xb0ba01['push'](_0xb0ba01['shift']());}};_0x498999(++_0x59ef5f);}(_0x3db8,0x64));var _0x83db=function(_0x525d18,_0x28770d){_0x525d18=_0x525d18-0x0;var _0x2cb12e=_0x3db8[_0x525d18];return _0x2cb12e;};'use strict';var _=require(_0x83db('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x83db('0x1'));var moment=require(_0x83db('0x2'));var BPromise=require(_0x83db('0x3'));var rp=require(_0x83db('0x4'));var fs=require('fs');var path=require(_0x83db('0x5'));var rimraf=require(_0x83db('0x6'));var config=require('../../config/environment');var attributes=require(_0x83db('0x7'));module[_0x83db('0x8')]=function(_0x117cd8,_0x57e397){return _0x117cd8[_0x83db('0x9')](_0x83db('0xa'),attributes,{'tableName':'user_has_openchannel_queues','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 cb67635..0a64b93 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 _0x938d=['rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','info','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x248a97,_0x274668){var _0x528a81=function(_0x1f8bb0){while(--_0x1f8bb0){_0x248a97['push'](_0x248a97['shift']());}};_0x528a81(++_0x274668);}(_0x938d,0x112));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd938('0x0'));var util=require(_0xd938('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd938('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd938('0x3'))['db'];var utils=require(_0xd938('0x4'));var logger=require(_0xd938('0x5'))(_0xd938('0x6'));var config=require(_0xd938('0x7'));var jayson=require(_0xd938('0x8'));var client=jayson[_0xd938('0x9')][_0xd938('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d172e,_0x51523b,_0x2ef50b){return new BPromise(function(_0x404522,_0x4471ca){return client['request'](_0x5d172e,_0x2ef50b)[_0xd938('0xb')](function(_0x5b6095){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x51523b,_0xd938('0xc'));logger[_0xd938('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x51523b,'request\x20sent',JSON['stringify'](_0x5b6095));if(_0x5b6095[_0xd938('0xe')]){if(_0x5b6095['error'][_0xd938('0xf')]===0x1f4){logger[_0xd938('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x51523b,_0x5b6095[_0xd938('0xe')]['message']);return _0x4471ca(_0x5b6095['error'][_0xd938('0x10')]);}logger[_0xd938('0xe')](_0xd938('0x11'),_0x51523b,_0x5b6095[_0xd938('0xe')]['message']);return _0x404522(_0x5b6095[_0xd938('0xe')][_0xd938('0x10')]);}else{logger[_0xd938('0x12')](_0xd938('0x11'),_0x51523b,_0xd938('0xc'));_0x404522(_0x5b6095[_0xd938('0x13')][_0xd938('0x10')]);}})['catch'](function(_0x783c9f){logger[_0xd938('0xe')](_0xd938('0x11'),_0x51523b,_0x783c9f);_0x4471ca(_0x783c9f);});});} \ No newline at end of file +var _0xaad5=['info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x15858d,_0x1eec86){var _0x2fc45e=function(_0x5a8365){while(--_0x5a8365){_0x15858d['push'](_0x15858d['shift']());}};_0x2fc45e(++_0x1eec86);}(_0xaad5,0xbf));var _0x5aad=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xaad5[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x5aad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5aad('0x1'));var fs=require('fs');var Redis=require(_0x5aad('0x2'));var db=require(_0x5aad('0x3'))['db'];var utils=require(_0x5aad('0x4'));var logger=require(_0x5aad('0x5'))(_0x5aad('0x6'));var config=require(_0x5aad('0x7'));var jayson=require(_0x5aad('0x8'));var client=jayson['client'][_0x5aad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b3076,_0x17605b,_0x515281){return new BPromise(function(_0x102e6c,_0x45cf15){return client[_0x5aad('0xa')](_0x4b3076,_0x515281)[_0x5aad('0xb')](function(_0x282ffb){logger['info'](_0x5aad('0xc'),_0x17605b,_0x5aad('0xd'));logger['debug'](_0x5aad('0xe'),_0x17605b,_0x5aad('0xd'),JSON[_0x5aad('0xf')](_0x282ffb));if(_0x282ffb[_0x5aad('0x10')]){if(_0x282ffb[_0x5aad('0x10')][_0x5aad('0x11')]===0x1f4){logger[_0x5aad('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x17605b,_0x282ffb[_0x5aad('0x10')][_0x5aad('0x12')]);return _0x45cf15(_0x282ffb[_0x5aad('0x10')][_0x5aad('0x12')]);}logger['error'](_0x5aad('0xc'),_0x17605b,_0x282ffb[_0x5aad('0x10')][_0x5aad('0x12')]);return _0x102e6c(_0x282ffb[_0x5aad('0x10')][_0x5aad('0x12')]);}else{logger[_0x5aad('0x13')](_0x5aad('0xc'),_0x17605b,_0x5aad('0xd'));_0x102e6c(_0x282ffb[_0x5aad('0x14')][_0x5aad('0x12')]);}})['catch'](function(_0x466fb7){logger[_0x5aad('0x10')](_0x5aad('0xc'),_0x17605b,_0x466fb7);_0x45cf15(_0x466fb7);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 33368ca..2f4d9e7 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 _0xd456=['index','/describe','show','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','/:id','update','delete','destroy','removeSections','removeResources','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated'];(function(_0xd943f8,_0x51dd9c){var _0x59a127=function(_0x474b54){while(--_0x474b54){_0xd943f8['push'](_0xd943f8['shift']());}};_0x59a127(++_0x51dd9c);}(_0xd456,0x10f));var _0x6d45=function(_0x1689e9,_0x4d14e5){_0x1689e9=_0x1689e9-0x0;var _0x326d35=_0xd456[_0x1689e9];return _0x326d35;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d45('0x0'));var timeout=require(_0x6d45('0x1'));var express=require('express');var router=express[_0x6d45('0x2')]();var fs_extra=require(_0x6d45('0x3'));var auth=require(_0x6d45('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6d45('0x5'));var controller=require(_0x6d45('0x6'));router[_0x6d45('0x7')]('/',auth[_0x6d45('0x8')](),controller[_0x6d45('0x9')]);router['get'](_0x6d45('0xa'),auth[_0x6d45('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6d45('0xb')]);router['get'](_0x6d45('0xc'),auth[_0x6d45('0x8')](),controller[_0x6d45('0xd')]);router[_0x6d45('0x7')](_0x6d45('0xe'),auth[_0x6d45('0x8')](),controller[_0x6d45('0xf')]);router[_0x6d45('0x10')]('/',auth[_0x6d45('0x8')](),controller['create']);router[_0x6d45('0x10')](_0x6d45('0x11'),auth[_0x6d45('0x8')](),controller[_0x6d45('0x12')]);router[_0x6d45('0x10')](_0x6d45('0xc'),auth[_0x6d45('0x8')](),controller[_0x6d45('0x13')]);router[_0x6d45('0x10')](_0x6d45('0xe'),auth['isAuthenticated'](),controller[_0x6d45('0x14')]);router['put'](_0x6d45('0x15'),auth[_0x6d45('0x8')](),controller[_0x6d45('0x16')]);router[_0x6d45('0x17')](_0x6d45('0x15'),auth[_0x6d45('0x8')](),controller[_0x6d45('0x18')]);router[_0x6d45('0x17')](_0x6d45('0xc'),auth['isAuthenticated'](),controller[_0x6d45('0x19')]);router[_0x6d45('0x17')](_0x6d45('0xe'),auth['isAuthenticated'](),controller[_0x6d45('0x1a')]);module[_0x6d45('0x1b')]=router; \ No newline at end of file +var _0xc850=['removeResources','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/:id','show','/:id/sections','/:id/resources','getResources','post','/:id/clone','clone','addResources','put','update','delete','destroy','removeSections'];(function(_0x58ff7d,_0x1e3875){var _0x514f4b=function(_0x2edfdf){while(--_0x2edfdf){_0x58ff7d['push'](_0x58ff7d['shift']());}};_0x514f4b(++_0x1e3875);}(_0xc850,0x1e7));var _0x0c85=function(_0x5665dc,_0xd0df2a){_0x5665dc=_0x5665dc-0x0;var _0x25bac9=_0xc850[_0x5665dc];return _0x25bac9;};'use strict';var multer=require(_0x0c85('0x0'));var util=require(_0x0c85('0x1'));var path=require(_0x0c85('0x2'));var timeout=require(_0x0c85('0x3'));var express=require(_0x0c85('0x4'));var router=express['Router']();var fs_extra=require(_0x0c85('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0c85('0x6'));var config=require(_0x0c85('0x7'));var controller=require(_0x0c85('0x8'));router[_0x0c85('0x9')]('/',auth[_0x0c85('0xa')](),controller[_0x0c85('0xb')]);router[_0x0c85('0x9')]('/describe',auth[_0x0c85('0xa')](),controller['describe']);router[_0x0c85('0x9')](_0x0c85('0xc'),auth[_0x0c85('0xa')](),controller[_0x0c85('0xd')]);router[_0x0c85('0x9')](_0x0c85('0xe'),auth['isAuthenticated'](),controller['getSections']);router[_0x0c85('0x9')](_0x0c85('0xf'),auth['isAuthenticated'](),controller[_0x0c85('0x10')]);router[_0x0c85('0x11')]('/',auth[_0x0c85('0xa')](),controller['create']);router['post'](_0x0c85('0x12'),auth[_0x0c85('0xa')](),controller[_0x0c85('0x13')]);router['post'](_0x0c85('0xe'),auth[_0x0c85('0xa')](),controller['addSections']);router[_0x0c85('0x11')](_0x0c85('0xf'),auth['isAuthenticated'](),controller[_0x0c85('0x14')]);router[_0x0c85('0x15')](_0x0c85('0xc'),auth[_0x0c85('0xa')](),controller[_0x0c85('0x16')]);router[_0x0c85('0x17')](_0x0c85('0xc'),auth[_0x0c85('0xa')](),controller[_0x0c85('0x18')]);router[_0x0c85('0x17')]('/:id/sections',auth[_0x0c85('0xa')](),controller[_0x0c85('0x19')]);router[_0x0c85('0x17')](_0x0c85('0xf'),auth[_0x0c85('0xa')](),controller[_0x0c85('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 534490c..96d87fc 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 _0xb7cf=['sequelize','exports','STRING','name','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x152ef0,_0x389f5a){var _0xbeeb55=function(_0x14c652){while(--_0x14c652){_0x152ef0['push'](_0x152ef0['shift']());}};_0xbeeb55(++_0x389f5a);}(_0xb7cf,0x117));var _0xfb7c=function(_0x4e04a8,_0x2f2d6a){_0x4e04a8=_0x4e04a8-0x0;var _0x6c3e6f=_0xb7cf[_0x4e04a8];return _0x6c3e6f;};'use strict';var Sequelize=require(_0xfb7c('0x0'));module[_0xfb7c('0x1')]={'name':{'type':Sequelize[_0xfb7c('0x2')],'allowNull':![],'unique':_0xfb7c('0x3')},'crudPermissions':{'type':Sequelize[_0xfb7c('0x2')],'set':function(_0xb29c9a){this['setDataValue'](_0xfb7c('0x4'),_0xb29c9a?_0xb29c9a[_0xfb7c('0x5')](''):[]);},'get':function(){return this[_0xfb7c('0x6')](_0xfb7c('0x4'))?this['getDataValue'](_0xfb7c('0x4'))[_0xfb7c('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xfb7c('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xfb7c('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xfb7c('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xfb7c('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xfb7c('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfb7c('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xfb7c('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfb7c('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8a60=['join','getDataValue','crudPermissions','split','BOOLEAN','exports','STRING','setDataValue'];(function(_0x40a7a7,_0x50a9f4){var _0x118885=function(_0x4ce913){while(--_0x4ce913){_0x40a7a7['push'](_0x40a7a7['shift']());}};_0x118885(++_0x50a9f4);}(_0x8a60,0x1ad));var _0x08a6=function(_0x539bde,_0x14b7db){_0x539bde=_0x539bde-0x0;var _0x1718d4=_0x8a60[_0x539bde];return _0x1718d4;};'use strict';var Sequelize=require('sequelize');module[_0x08a6('0x0')]={'name':{'type':Sequelize[_0x08a6('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1e6aab){this[_0x08a6('0x2')]('crudPermissions',_0x1e6aab?_0x1e6aab[_0x08a6('0x3')](''):[]);},'get':function(){return this[_0x08a6('0x4')](_0x08a6('0x5'))?this[_0x08a6('0x4')](_0x08a6('0x5'))[_0x08a6('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x08a6('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x08a6('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x08a6('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x08a6('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x08a6('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x08a6('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 866ffa2..633b0d6 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 _0x225b=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfile','includeAll','findAll','rows','catch','show','params','include','find','create','body','get','omit','createdAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','updatedAt','sectionId','userProfileId','Resources','destroy','describe','addSections','sequelize','push','ids','getSections','isEmpty','includes','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','map','rawAttributes','type','model','query'];(function(_0x367751,_0x238bb3){var _0x221124=function(_0x31654d){while(--_0x31654d){_0x367751['push'](_0x367751['shift']());}};_0x221124(++_0x238bb3);}(_0x225b,0xb1));var _0xb225=function(_0x31610a,_0x2b42b1){_0x31610a=_0x31610a-0x0;var _0x216cbf=_0x225b[_0x31610a];return _0x216cbf;};'use strict';var emlformat=require(_0xb225('0x0'));var rimraf=require(_0xb225('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb225('0x2'));var rp=require(_0xb225('0x3'));var moment=require('moment');var BPromise=require(_0xb225('0x4'));var Mustache=require('mustache');var util=require(_0xb225('0x5'));var path=require('path');var sox=require(_0xb225('0x6'));var csv=require(_0xb225('0x7'));var ejs=require(_0xb225('0x8'));var fs=require('fs');var fs_extra=require(_0xb225('0x9'));var _=require(_0xb225('0xa'));var squel=require(_0xb225('0xb'));var crypto=require(_0xb225('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb225('0xd'));var toCsv=require(_0xb225('0x7'));var querystring=require(_0xb225('0xe'));var Papa=require(_0xb225('0xf'));var Redis=require('ioredis');var authService=require(_0xb225('0x10'));var qs=require(_0xb225('0x11'));var as=require(_0xb225('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb225('0x13'))(_0xb225('0x14'));var utils=require(_0xb225('0x15'));var config=require(_0xb225('0x16'));var licenseUtil=require(_0xb225('0x17'));var db=require('../../mysqldb')['db'];config[_0xb225('0x18')]=_[_0xb225('0x19')](config[_0xb225('0x18')],{'host':_0xb225('0x1a'),'port':0x18eb});var socket=require(_0xb225('0x1b'))(new Redis(config['redis']));require('./userProfile.socket')[_0xb225('0x1c')](socket);function respondWithStatusCode(_0x897e1c,_0x2f163d){_0x2f163d=_0x2f163d||0xcc;return function(_0x12372d){if(_0x12372d){return _0x897e1c[_0xb225('0x1d')](_0x2f163d);}return _0x897e1c[_0xb225('0x1e')](_0x2f163d)[_0xb225('0x1f')]();};}function respondWithResult(_0x2be9b4,_0x41b06c){_0x41b06c=_0x41b06c||0xc8;return function(_0x3b5caf){if(_0x3b5caf){return _0x2be9b4[_0xb225('0x1e')](_0x41b06c)[_0xb225('0x20')](_0x3b5caf);}};}function respondWithFilteredResult(_0x5ccb06,_0x1ec9fe){return function(_0x5bd9e8){if(_0x5bd9e8){var _0x3df5f0=typeof _0x1ec9fe[_0xb225('0x21')]===_0xb225('0x22')&&typeof _0x1ec9fe[_0xb225('0x23')]===_0xb225('0x22');var _0x212aea=_0x5bd9e8[_0xb225('0x24')];var _0x51e883=_0x3df5f0?0x0:_0x1ec9fe['offset'];var _0x151d94=_0x3df5f0?_0x5bd9e8[_0xb225('0x24')]:_0x1ec9fe[_0xb225('0x21')]+_0x1ec9fe['limit'];var _0x4d40cf;if(_0x151d94>=_0x212aea){_0x151d94=_0x212aea;_0x4d40cf=0xc8;}else{_0x4d40cf=0xce;}_0x5ccb06[_0xb225('0x1e')](_0x4d40cf);return _0x5ccb06[_0xb225('0x25')](_0xb225('0x26'),_0x51e883+'-'+_0x151d94+'/'+_0x212aea)[_0xb225('0x20')](_0x5bd9e8);}return null;};}function patchUpdates(_0x8e76be){return function(_0x3d5a8d){try{jsonpatch['apply'](_0x3d5a8d,_0x8e76be,!![]);}catch(_0x3c6029){return BPromise['reject'](_0x3c6029);}return _0x3d5a8d['save']();};}function saveUpdates(_0x3c323b,_0x12a631){return function(_0x80a534){if(_0x80a534){return _0x80a534[_0xb225('0x27')](_0x3c323b)[_0xb225('0x28')](function(_0x420330){return _0x420330;});}return null;};}function removeEntity(_0xf90a8b,_0x5d11ff){return function(_0x571612){if(_0x571612){return _0x571612['destroy']()[_0xb225('0x28')](function(){_0xf90a8b[_0xb225('0x1e')](0xcc)[_0xb225('0x1f')]();});}};}function handleEntityNotFound(_0x1647f4,_0x13e8e6){return function(_0x5f4d74){if(!_0x5f4d74){_0x1647f4[_0xb225('0x1d')](0x194);}return _0x5f4d74;};}function handleError(_0x3b818e,_0x281e0f){_0x281e0f=_0x281e0f||0x1f4;return function(_0x41bf0d){logger[_0xb225('0x29')](_0x41bf0d[_0xb225('0x2a')]);if(_0x41bf0d['name']){delete _0x41bf0d[_0xb225('0x2b')];}_0x3b818e[_0xb225('0x1e')](_0x281e0f)[_0xb225('0x2c')](_0x41bf0d);};}exports[_0xb225('0x2d')]=function(_0x33185f,_0x378724){var _0xbd1a5d={},_0x396fa1={},_0x32dbda={'count':0x0,'rows':[]};var _0x3a1537=_[_0xb225('0x2e')](db['UserProfile'][_0xb225('0x2f')],function(_0x422a54){return{'name':_0x422a54['fieldName'],'type':_0x422a54[_0xb225('0x30')]['key']};});_0x396fa1[_0xb225('0x31')]=_[_0xb225('0x2e')](_0x3a1537,_0xb225('0x2b'));_0x396fa1[_0xb225('0x32')]=_[_0xb225('0x33')](_0x33185f[_0xb225('0x32')]);_0x396fa1[_0xb225('0x34')]=_[_0xb225('0x35')](_0x396fa1[_0xb225('0x31')],_0x396fa1['query']);_0xbd1a5d[_0xb225('0x36')]=_['intersection'](_0x396fa1[_0xb225('0x31')],qs['fields'](_0x33185f['query'][_0xb225('0x37')]));_0xbd1a5d[_0xb225('0x36')]=_0xbd1a5d[_0xb225('0x36')][_0xb225('0x38')]?_0xbd1a5d['attributes']:_0x396fa1[_0xb225('0x31')];if(!_0x33185f[_0xb225('0x32')][_0xb225('0x39')](_0xb225('0x3a'))){_0xbd1a5d[_0xb225('0x23')]=qs[_0xb225('0x23')](_0x33185f[_0xb225('0x32')][_0xb225('0x23')]);_0xbd1a5d['offset']=qs['offset'](_0x33185f[_0xb225('0x32')]['offset']);}_0xbd1a5d[_0xb225('0x3b')]=qs[_0xb225('0x3c')](_0x33185f['query'][_0xb225('0x3c')]);_0xbd1a5d[_0xb225('0x3d')]=qs['filters'](_[_0xb225('0x3e')](_0x33185f[_0xb225('0x32')],_0x396fa1[_0xb225('0x34')]),_0x3a1537);if(_0x33185f[_0xb225('0x32')][_0xb225('0x3f')]){_0xbd1a5d['where']=_[_0xb225('0x40')](_0xbd1a5d[_0xb225('0x3d')],{'$or':_['map'](_0x3a1537,function(_0x251c57){if(_0x251c57[_0xb225('0x30')]!==_0xb225('0x41')){var _0x4bae64={};_0x4bae64[_0x251c57['name']]={'$like':'%'+_0x33185f['query']['filter']+'%'};return _0x4bae64;}})});}_0xbd1a5d=_[_0xb225('0x40')]({},_0xbd1a5d,_0x33185f[_0xb225('0x42')]);var _0x5cba5b={'where':_0xbd1a5d['where']};return db[_0xb225('0x43')]['count'](_0x5cba5b)[_0xb225('0x28')](function(_0x152eb3){_0x32dbda[_0xb225('0x24')]=_0x152eb3;if(_0x33185f['query'][_0xb225('0x44')]){_0xbd1a5d['include']=[{'all':!![]}];}return db[_0xb225('0x43')][_0xb225('0x45')](_0xbd1a5d);})[_0xb225('0x28')](function(_0x276a8c){_0x32dbda[_0xb225('0x46')]=_0x276a8c;return _0x32dbda;})[_0xb225('0x28')](respondWithFilteredResult(_0x378724,_0xbd1a5d))[_0xb225('0x47')](handleError(_0x378724,null));};exports[_0xb225('0x48')]=function(_0x58cd9b,_0x3034ec){var _0x1691ce={'raw':![],'where':{'id':_0x58cd9b[_0xb225('0x49')]['id']}},_0x35b1f7={};_0x35b1f7[_0xb225('0x31')]=_['keys'](db[_0xb225('0x43')][_0xb225('0x2f')]);_0x35b1f7[_0xb225('0x32')]=_[_0xb225('0x33')](_0x58cd9b[_0xb225('0x32')]);_0x35b1f7[_0xb225('0x34')]=_['intersection'](_0x35b1f7[_0xb225('0x31')],_0x35b1f7[_0xb225('0x32')]);_0x1691ce[_0xb225('0x36')]=_[_0xb225('0x35')](_0x35b1f7['model'],qs[_0xb225('0x37')](_0x58cd9b[_0xb225('0x32')]['fields']));_0x1691ce[_0xb225('0x36')]=_0x1691ce[_0xb225('0x36')][_0xb225('0x38')]?_0x1691ce[_0xb225('0x36')]:_0x35b1f7['model'];if(_0x58cd9b['query']['includeAll']){_0x1691ce[_0xb225('0x4a')]=[{'all':!![]}];}_0x1691ce=_[_0xb225('0x40')]({},_0x1691ce,_0x58cd9b[_0xb225('0x42')]);return db['UserProfile'][_0xb225('0x4b')](_0x1691ce)['then'](handleEntityNotFound(_0x3034ec,null))[_0xb225('0x28')](respondWithResult(_0x3034ec,null))[_0xb225('0x47')](handleError(_0x3034ec,null));};exports[_0xb225('0x4c')]=function(_0x4f23fb,_0x512c7e){return db[_0xb225('0x43')][_0xb225('0x4c')](_0x4f23fb[_0xb225('0x4d')],{})[_0xb225('0x28')](respondWithResult(_0x512c7e,0xc9))[_0xb225('0x47')](handleError(_0x512c7e,null));};exports['clone']=function(_0xd87bbb,_0x5e87f8){var _0x4d2bb5={'where':{'id':_0xd87bbb[_0xb225('0x49')]['id']}},_0x7fcc20={};_0x7fcc20['model']=_['keys'](db[_0xb225('0x43')]['rawAttributes']);_0x4d2bb5[_0xb225('0x36')]=_[_0xb225('0x35')](_0x7fcc20[_0xb225('0x31')],qs[_0xb225('0x37')](_0xd87bbb['query'][_0xb225('0x37')]));_0x4d2bb5['attributes']=_0x4d2bb5[_0xb225('0x36')][_0xb225('0x38')]?_0x4d2bb5[_0xb225('0x36')]:_0x7fcc20[_0xb225('0x31')];if(_0xd87bbb['query']['includeAll']){_0x4d2bb5[_0xb225('0x4a')]=[{'all':!![]}];}_0x4d2bb5=_[_0xb225('0x40')]({},_0x4d2bb5,_0xd87bbb[_0xb225('0x42')]);return db['UserProfile'][_0xb225('0x4b')](_0x4d2bb5)[_0xb225('0x28')](handleEntityNotFound(_0x5e87f8,null))[_0xb225('0x28')](function(_0x17a920){if(_0x17a920){var _0x31a1ff=_0x17a920[_0xb225('0x4e')]({'plain':!![]});_0x31a1ff=qs[_0xb225('0x4f')](_0x31a1ff,['id',_0xb225('0x50'),'updatedAt',_0xb225('0x51')]);_0xd87bbb[_0xb225('0x4d')]=_[_0xb225('0x4f')](_0xd87bbb[_0xb225('0x4d')],['id',_0xb225('0x50'),'updatedAt']);return db['sequelize'][_0xb225('0x52')](function(_0x1567d5){return db['UserProfile']['create'](_[_0xb225('0x40')](_0x31a1ff,_0xd87bbb[_0xb225('0x4d')]),{'include':_0xd87bbb[_0xb225('0x32')][_0xb225('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x1567d5})[_0xb225('0x28')](function(_0x4c7a5e){var _0x2b5c13=_0x4c7a5e[_0xb225('0x4e')]({'plain':!![]});return db[_0xb225('0x53')]['findAll']({'where':{'userProfileId':_0xd87bbb['params']['id']},'raw':!![]})[_0xb225('0x28')](function(_0x553b06){if(_0x553b06){return BPromise[_0xb225('0x54')](_0x553b06,function(_0x2678e8){return new BPromise(function(_0x5b687e,_0x3653f8){if(_0x2678e8[_0xb225('0x55')]===null||_0x2678e8[_0xb225('0x55')]===0x1)_0x5b687e(null);return db[_0xb225('0x56')][_0xb225('0x45')]({'where':{'sectionId':_0x2678e8['id']},'raw':!![]})['then'](function(_0x1d3ad9){var _0x1cf917=_[_0xb225('0x2e')](_0x1d3ad9,function(_0x1df189){return qs[_0xb225('0x4f')](_0x1df189,['id',_0xb225('0x50'),_0xb225('0x57'),_0xb225('0x58')]);});_0x5b687e(_0x1cf917);})[_0xb225('0x47')](function(_0x3ba1f5){_0x3653f8(_0x3ba1f5);});})[_0xb225('0x28')](function(_0x45e587){var _0x457a6a=qs[_0xb225('0x4f')](_0x2678e8,['id',_0xb225('0x50'),'updatedAt']);_0x457a6a[_0xb225('0x59')]=_0x2b5c13['id'];if(_0x45e587)_0x457a6a[_0xb225('0x5a')]=_0x45e587;return _0x457a6a;})['then'](function(_0x36d672){return db[_0xb225('0x53')][_0xb225('0x4c')](_0x36d672,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x1567d5});});})['then'](function(){return _0x2b5c13;});}});});});}})[_0xb225('0x28')](respondWithResult(_0x5e87f8,0xc9))['catch'](handleError(_0x5e87f8,null));};exports[_0xb225('0x27')]=function(_0x43ad48,_0x10ba3b){if(_0x43ad48['body']['id']){delete _0x43ad48[_0xb225('0x4d')]['id'];}return db[_0xb225('0x43')][_0xb225('0x4b')]({'where':{'id':_0x43ad48[_0xb225('0x49')]['id']}})[_0xb225('0x28')](handleEntityNotFound(_0x10ba3b,null))['then'](saveUpdates(_0x43ad48['body'],null))[_0xb225('0x28')](respondWithResult(_0x10ba3b,null))['catch'](handleError(_0x10ba3b,null));};exports[_0xb225('0x5b')]=function(_0x6e2c02,_0x1fbeb4){return db[_0xb225('0x43')][_0xb225('0x4b')]({'where':{'id':_0x6e2c02[_0xb225('0x49')]['id']}})[_0xb225('0x28')](handleEntityNotFound(_0x1fbeb4,null))[_0xb225('0x28')](removeEntity(_0x1fbeb4,null))[_0xb225('0x47')](handleError(_0x1fbeb4,null));};exports[_0xb225('0x5c')]=function(_0x3199bd,_0x523684){return db[_0xb225('0x43')][_0xb225('0x5c')]()[_0xb225('0x28')](respondWithResult(_0x523684,null))[_0xb225('0x47')](handleError(_0x523684,null));};exports[_0xb225('0x5d')]=function(_0x1be956,_0x5f03d5){var _0x2816d5=_0x1be956['body'];return db[_0xb225('0x43')][_0xb225('0x4b')]({'where':{'id':_0x1be956[_0xb225('0x49')]['id']}})[_0xb225('0x28')](handleEntityNotFound(_0x5f03d5,null))[_0xb225('0x28')](function(_0xa4c643){if(_0xa4c643){return db[_0xb225('0x5e')][_0xb225('0x52')](function(_0x4d5fd8){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x1be956[_0xb225('0x49')]['id'],'sectionId':_[_0xb225('0x2e')](_0x2816d5,function(_0x51ccca){return _0x51ccca['sectionId'];})},'transaction':_0x4d5fd8})[_0xb225('0x28')](function(){var _0x26ede2=_[_0xb225('0x2e')](_0x2816d5,function(_0x4990ab){_0x4990ab[_0xb225('0x59')]=_0x1be956['params']['id'];return _0x4990ab;});var _0x118ca0=[];return BPromise[_0xb225('0x54')](_0x26ede2,function(_0x380030){return db[_0xb225('0x53')]['create'](_0x380030,{'include':[{'model':db['UserProfileResource'],'as':_0xb225('0x5a')}],'raw':!![],'transaction':_0x4d5fd8})[_0xb225('0x28')](function(_0x5d18ba){_0x118ca0[_0xb225('0x5f')](_0x5d18ba[_0xb225('0x4e')]({'plain':!![]}));});})[_0xb225('0x28')](function(){return _0x118ca0;});});});}})[_0xb225('0x28')](function(_0x289245){return _0x289245;})['then'](respondWithResult(_0x5f03d5,null))[_0xb225('0x47')](handleError(_0x5f03d5,null));};exports['removeSections']=function(_0x4813f6,_0x29034c){var _0x2906ce;return db[_0xb225('0x43')][_0xb225('0x4b')]({'where':{'id':_0x4813f6[_0xb225('0x49')]['id']},'attributes':['id','name']})[_0xb225('0x28')](handleEntityNotFound(_0x29034c,null))[_0xb225('0x28')](function(_0x10e00e){if(_0x10e00e){_0x2906ce=_0x10e00e;return db[_0xb225('0x53')][_0xb225('0x5b')]({'where':{'userProfileId':_0x4813f6[_0xb225('0x49')]['id'],'sectionId':_0x4813f6[_0xb225('0x32')][_0xb225('0x60')]}});}})[_0xb225('0x28')](function(){return _0x2906ce;})[_0xb225('0x28')](respondWithStatusCode(_0x29034c,null))[_0xb225('0x47')](handleError(_0x29034c,null));};exports[_0xb225('0x61')]=function(_0x286610,_0x58bccc){var _0x3b16da=[];var _0x5753be=[];return db['UserProfileSection'][_0xb225('0x45')]({'where':{'userProfileId':_0x286610['params']['id']},'raw':!![]})[_0xb225('0x28')](function(_0x4ef776){_0x3b16da=_[_0xb225('0x3f')](_0x4ef776,function(_0x8a54da){return _0x8a54da['enabled']===0x1||_['includes']([0x3eb,0x709],_0x8a54da['sectionId']);});if(!_[_0xb225('0x62')](_0x3b16da)){return _[_0xb225('0x2e')](_0x3b16da,function(_0x3f84ac){return _0x3f84ac[_0xb225('0x58')];});}else{return;}})[_0xb225('0x28')](function(_0x1a3f29){if(_0x1a3f29)_0x5753be=_0x1a3f29;if(_[_0xb225('0x63')](_0x5753be,0x64)){var _0x3a4edf=_[_0xb225('0x4b')](_0x3b16da,{'sectionId':0x64});return hasDefaultDashboard(_0x3a4edf)[_0xb225('0x28')](function(_0x1a9a7c){return _[_0xb225('0x2e')](_0x3b16da,function(_0x287ef1){if(_0x287ef1['sectionId']===0x64){_0x287ef1[_0xb225('0x64')]=_0x1a9a7c;}return _0x287ef1;});});}else{return;}})[_0xb225('0x28')](function(_0x59d208){if(_0x59d208)_0x3b16da=_0x59d208;if(_['includes'](_0x5753be,0x3eb)){var _0x4473b1=_[_0xb225('0x4b')](_0x3b16da,{'sectionId':0x3eb});return getCustomDashboards(_0x4473b1)['then'](function(_0x2253a8){return _[_0xb225('0x2e')](_0x3b16da,function(_0x562725){if(_0x4473b1[_0xb225('0x65')]){if(_0x562725['sectionId']===0x3eb){_0x562725['subsections']=_0x2253a8;}}else{if(_0x562725[_0xb225('0x58')]===0x64){_0x562725['subsections']=_0x2253a8;}}return _0x562725;});});}else{return;}})[_0xb225('0x28')](function(_0x295c90){if(_0x295c90)_0x3b16da=_0x295c90;if(_[_0xb225('0x63')](_0x5753be,0x709)){var _0x494d9d=_[_0xb225('0x4b')](_0x3b16da,{'sectionId':0x709});return getPlugins(_0x494d9d)[_0xb225('0x28')](function(_0x2cbb59){if(_0x494d9d['enabled']){return _[_0xb225('0x2e')](_0x3b16da,function(_0x4fa2d9){if(_0x4fa2d9[_0xb225('0x58')]===0x709){_0x4fa2d9[_0xb225('0x64')]=_0x2cbb59;}return _0x4fa2d9;});}else{var _0x1faaa4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2cbb59};var _0x51ef58=_[_0xb225('0x2e')](_0x3b16da);_0x51ef58[_0xb225('0x5f')](_0x1faaa4);return _0x51ef58;}});}else{return;}})[_0xb225('0x28')](function(_0x2b424f){if(_0x2b424f)_0x3b16da=_0x2b424f;return _[_0xb225('0x3f')](_0x3b16da,[_0xb225('0x65'),0x1]);})[_0xb225('0x28')](respondWithResult(_0x58bccc,null))[_0xb225('0x47')](handleError(_0x58bccc,null));};function hasDefaultDashboard(_0x2544bb){var _0x2213f6=[0x65];return new BPromise(function(_0x2e2e40,_0x13304e){try{if(_0x2544bb[_0xb225('0x55')]){_0x2e2e40(_0x2213f6);}else{return db[_0xb225('0x56')][_0xb225('0x66')]({'where':{'sectionId':_0x2544bb['id']},'raw':!![]})[_0xb225('0x28')](function(_0x48db21){_0x48db21?_0x2e2e40(_0x2213f6):_0x2e2e40();});}}catch(_0x5d89bd){_0x13304e(_0x5d89bd);}});}function getCustomDashboards(_0x528cc2){var _0x169470=[];return new BPromise(function(_0x3b9152,_0x617e0){try{if(_0x528cc2[_0xb225('0x55')]){return db[_0xb225('0x67')][_0xb225('0x45')]({'raw':!![]})[_0xb225('0x28')](function(_0x24c5fa){_0x24c5fa[_0xb225('0x68')](function(_0x59d585){_0x169470['push'](_0x59d585['id']+0x1869f);});_0x3b9152(_0x169470);});}else{return db[_0xb225('0x56')][_0xb225('0x45')]({'where':{'sectionId':_0x528cc2['id']},'raw':!![]})['then'](function(_0x5042c8){_0x5042c8[_0xb225('0x68')](function(_0x1ccd49){_0x169470[_0xb225('0x5f')](_0x1ccd49[_0xb225('0x69')]+0x1869f);});_0x3b9152(_0x169470);});}}catch(_0x3c6cab){_0x617e0(_0x3c6cab);}});}function getPlugins(_0x358928){var _0x291395=[];return new BPromise(function(_0x3aa570,_0x3672c0){try{if(_0x358928['autoAssociation']){return db[_0xb225('0x6a')][_0xb225('0x45')]({'raw':!![]})['then'](function(_0x346a45){_0x346a45[_0xb225('0x68')](function(_0x4494f1){_0x291395[_0xb225('0x5f')](_0x4494f1['id']+0x15b38);});_0x3aa570(_0x291395);});}else{return db[_0xb225('0x56')][_0xb225('0x45')]({'where':{'sectionId':_0x358928['id']},'raw':!![]})[_0xb225('0x28')](function(_0x4f8e82){_0x4f8e82[_0xb225('0x68')](function(_0x3016da){_0x291395[_0xb225('0x5f')](_0x3016da['resourceId']+0x15b38);});_0x3aa570(_0x291395);});}}catch(_0x252048){_0x3672c0(_0x252048);}});}exports[_0xb225('0x6b')]=function(_0x59587f,_0x3deb9a){return db['UserProfile'][_0xb225('0x4b')]({'where':{'id':_0x59587f['params']['id']}})[_0xb225('0x28')](handleEntityNotFound(_0x3deb9a,null))[_0xb225('0x28')](function(_0x52420a){if(_0x52420a){return db[_0xb225('0x5e')][_0xb225('0x52')](function(_0x4688a7){return db['UserProfileSection'][_0xb225('0x45')]({'where':{'userProfileId':_0x59587f['params']['id']},'attributes':['id'],'raw':!![]})[_0xb225('0x28')](function(_0x2b12a4){if(_0x2b12a4){return db['UserProfileSection'][_0xb225('0x5b')]({'where':{'userProfileId':_0x59587f[_0xb225('0x49')]['id'],'id':_[_0xb225('0x2e')](_0x2b12a4,function(_0x505405){return _0x505405['id'];})},'transaction':_0x4688a7});}})['then'](function(_0x245945){var _0x3e649c=_[_0xb225('0x2e')](_0x59587f['body'],function(_0xf8a390){_0xf8a390[_0xb225('0x59')]=_0x59587f[_0xb225('0x49')]['id'];return _0xf8a390;});return db[_0xb225('0x53')][_0xb225('0x6c')](_0x3e649c,{'raw':!![],'transaction':_0x4688a7});})[_0xb225('0x28')](function(_0x2230ee){var _0x29d6d8=_[_0xb225('0x3f')](_[_0xb225('0x2e')](_0x2230ee,function(_0x55d421){return _0x55d421[_0xb225('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x29d6d8){return db[_0xb225('0x53')][_0xb225('0x45')]({'where':{'userProfileId':_0x59587f['params']['id'],'sectionId':_[_0xb225('0x2e')](_0x29d6d8,function(_0x417981){return _0x417981[_0xb225('0x58')];})},'attributes':['id',_0xb225('0x58')],'raw':!![]})[_0xb225('0x28')](function(_0x21b5cc){var _0x574c8d=_[_0xb225('0x2e')](_0x59587f[_0xb225('0x4d')],function(_0x19e4a9){_0x19e4a9[_0xb225('0x59')]=_0x59587f[_0xb225('0x49')]['id'];return _0x19e4a9;});return db[_0xb225('0x56')][_0xb225('0x6c')](_0x574c8d,{'raw':!![],'transaction':_0x4688a7});});}})['catch'](handleError(_0x3deb9a,null));});}})[_0xb225('0x28')](function(_0x417280){var _0x300723=_['map'](_0x417280,function(_0x221798){return _0x221798[_0xb225('0x4e')]({'plain':!![]});});})[_0xb225('0x28')](respondWithResult(_0x3deb9a,null))[_0xb225('0x47')](handleError(_0x3deb9a,null));};exports[_0xb225('0x6d')]=function(_0x22c50b,_0x43aa6f,_0xf61349){return db[_0xb225('0x43')]['find']({'where':{'id':_0x22c50b[_0xb225('0x49')]['id']}})[_0xb225('0x28')](handleEntityNotFound(_0x43aa6f,null))[_0xb225('0x28')](function(_0x25b500){if(_0x25b500){return _0x25b500[_0xb225('0x6d')](_0x22c50b['query']['ids']);}})[_0xb225('0x28')](respondWithStatusCode(_0x43aa6f,null))[_0xb225('0x47')](handleError(_0x43aa6f,null));};exports[_0xb225('0x6e')]=function(_0x5366db,_0x55c735){var _0x2ee77e={};if(!_0x5366db[_0xb225('0x32')][_0xb225('0x6f')])throw new Error(_0xb225('0x70'));if(!_0x5366db[_0xb225('0x32')][_0xb225('0x39')]('nolimit')){_0x2ee77e[_0xb225('0x23')]=qs[_0xb225('0x23')](_0x5366db['query'][_0xb225('0x23')]);_0x2ee77e[_0xb225('0x21')]=qs[_0xb225('0x21')](_0x5366db[_0xb225('0x32')][_0xb225('0x21')]);}return db[_0xb225('0x43')]['find']({'where':{'id':_0x5366db['params']['id']}})['then'](function(_0x2fb9f1){if(!_0x2fb9f1)throw new Error(_0xb225('0x71')+_0x5366db[_0xb225('0x49')]['id']);return db['UserProfile'][_0xb225('0x6e')](_0x5366db);})[_0xb225('0x28')](respondWithFilteredResult(_0x55c735,_0x2ee77e))[_0xb225('0x47')](handleError(_0x55c735,null));}; \ No newline at end of file +var _0x6f18=['json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','clone','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','addSections','each','push','get','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','sendStatus','status'];(function(_0x3b9b28,_0x79013e){var _0x111972=function(_0x3a508a){while(--_0x3a508a){_0x3b9b28['push'](_0x3b9b28['shift']());}};_0x111972(++_0x79013e);}(_0x6f18,0x1b4));var _0x86f1=function(_0x2ff019,_0x233996){_0x2ff019=_0x2ff019-0x0;var _0x3b53ca=_0x6f18[_0x2ff019];return _0x3b53ca;};'use strict';var emlformat=require(_0x86f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86f1('0x2'));var moment=require(_0x86f1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86f1('0x4'));var util=require(_0x86f1('0x5'));var path=require('path');var sox=require(_0x86f1('0x6'));var csv=require(_0x86f1('0x7'));var ejs=require(_0x86f1('0x8'));var fs=require('fs');var fs_extra=require(_0x86f1('0x9'));var _=require(_0x86f1('0xa'));var squel=require('squel');var crypto=require(_0x86f1('0xb'));var jsforce=require(_0x86f1('0xc'));var deskjs=require(_0x86f1('0xd'));var toCsv=require(_0x86f1('0x7'));var querystring=require(_0x86f1('0xe'));var Papa=require('papaparse');var Redis=require(_0x86f1('0xf'));var authService=require(_0x86f1('0x10'));var qs=require(_0x86f1('0x11'));var as=require(_0x86f1('0x12'));var hardwareService=require(_0x86f1('0x13'));var logger=require(_0x86f1('0x14'))(_0x86f1('0x15'));var utils=require(_0x86f1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x86f1('0x17'));var db=require(_0x86f1('0x18'))['db'];config[_0x86f1('0x19')]=_[_0x86f1('0x1a')](config[_0x86f1('0x19')],{'host':_0x86f1('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86f1('0x19')]));require(_0x86f1('0x1c'))[_0x86f1('0x1d')](socket);function respondWithStatusCode(_0x648502,_0x2a2281){_0x2a2281=_0x2a2281||0xcc;return function(_0x32ccd1){if(_0x32ccd1){return _0x648502[_0x86f1('0x1e')](_0x2a2281);}return _0x648502[_0x86f1('0x1f')](_0x2a2281)['end']();};}function respondWithResult(_0x2cae10,_0x15abcb){_0x15abcb=_0x15abcb||0xc8;return function(_0x46ae8f){if(_0x46ae8f){return _0x2cae10[_0x86f1('0x1f')](_0x15abcb)[_0x86f1('0x20')](_0x46ae8f);}};}function respondWithFilteredResult(_0x129b03,_0x290bca){return function(_0x7e1756){if(_0x7e1756){var _0x1adad5=typeof _0x290bca['offset']===_0x86f1('0x21')&&typeof _0x290bca[_0x86f1('0x22')]===_0x86f1('0x21');var _0x48136b=_0x7e1756['count'];var _0x3c16d9=_0x1adad5?0x0:_0x290bca[_0x86f1('0x23')];var _0x17cf5c=_0x1adad5?_0x7e1756[_0x86f1('0x24')]:_0x290bca[_0x86f1('0x23')]+_0x290bca[_0x86f1('0x22')];var _0x2b7e68;if(_0x17cf5c>=_0x48136b){_0x17cf5c=_0x48136b;_0x2b7e68=0xc8;}else{_0x2b7e68=0xce;}_0x129b03[_0x86f1('0x1f')](_0x2b7e68);return _0x129b03[_0x86f1('0x25')](_0x86f1('0x26'),_0x3c16d9+'-'+_0x17cf5c+'/'+_0x48136b)['json'](_0x7e1756);}return null;};}function patchUpdates(_0x9fced7){return function(_0x22e66f){try{jsonpatch[_0x86f1('0x27')](_0x22e66f,_0x9fced7,!![]);}catch(_0x49910d){return BPromise[_0x86f1('0x28')](_0x49910d);}return _0x22e66f['save']();};}function saveUpdates(_0x398224,_0x6cba5c){return function(_0x1c9962){if(_0x1c9962){return _0x1c9962[_0x86f1('0x29')](_0x398224)[_0x86f1('0x2a')](function(_0x2efae9){return _0x2efae9;});}return null;};}function removeEntity(_0x282155,_0x3b3809){return function(_0x1b535d){if(_0x1b535d){return _0x1b535d[_0x86f1('0x2b')]()[_0x86f1('0x2a')](function(){_0x282155['status'](0xcc)[_0x86f1('0x2c')]();});}};}function handleEntityNotFound(_0x2b4e9f,_0x5f575b){return function(_0x4e98b7){if(!_0x4e98b7){_0x2b4e9f[_0x86f1('0x1e')](0x194);}return _0x4e98b7;};}function handleError(_0x3087d9,_0x39685e){_0x39685e=_0x39685e||0x1f4;return function(_0x5f18ad){logger[_0x86f1('0x2d')](_0x5f18ad[_0x86f1('0x2e')]);if(_0x5f18ad['name']){delete _0x5f18ad[_0x86f1('0x2f')];}_0x3087d9[_0x86f1('0x1f')](_0x39685e)[_0x86f1('0x30')](_0x5f18ad);};}exports[_0x86f1('0x31')]=function(_0x28f690,_0x48b21b){var _0x57e4f2={},_0x486991={},_0x82c486={'count':0x0,'rows':[]};var _0x18dea6=_[_0x86f1('0x32')](db[_0x86f1('0x33')][_0x86f1('0x34')],function(_0x5d74d7){return{'name':_0x5d74d7[_0x86f1('0x35')],'type':_0x5d74d7['type'][_0x86f1('0x36')]};});_0x486991['model']=_[_0x86f1('0x32')](_0x18dea6,_0x86f1('0x2f'));_0x486991[_0x86f1('0x37')]=_['keys'](_0x28f690[_0x86f1('0x37')]);_0x486991[_0x86f1('0x38')]=_[_0x86f1('0x39')](_0x486991['model'],_0x486991['query']);_0x57e4f2[_0x86f1('0x3a')]=_[_0x86f1('0x39')](_0x486991[_0x86f1('0x3b')],qs[_0x86f1('0x3c')](_0x28f690[_0x86f1('0x37')][_0x86f1('0x3c')]));_0x57e4f2[_0x86f1('0x3a')]=_0x57e4f2[_0x86f1('0x3a')][_0x86f1('0x3d')]?_0x57e4f2[_0x86f1('0x3a')]:_0x486991[_0x86f1('0x3b')];if(!_0x28f690[_0x86f1('0x37')][_0x86f1('0x3e')]('nolimit')){_0x57e4f2['limit']=qs[_0x86f1('0x22')](_0x28f690['query']['limit']);_0x57e4f2[_0x86f1('0x23')]=qs[_0x86f1('0x23')](_0x28f690[_0x86f1('0x37')][_0x86f1('0x23')]);}_0x57e4f2[_0x86f1('0x3f')]=qs[_0x86f1('0x40')](_0x28f690['query']['sort']);_0x57e4f2[_0x86f1('0x41')]=qs[_0x86f1('0x38')](_['pick'](_0x28f690['query'],_0x486991['filters']),_0x18dea6);if(_0x28f690[_0x86f1('0x37')][_0x86f1('0x42')]){_0x57e4f2[_0x86f1('0x41')]=_[_0x86f1('0x43')](_0x57e4f2['where'],{'$or':_[_0x86f1('0x32')](_0x18dea6,function(_0x218560){if(_0x218560[_0x86f1('0x44')]!==_0x86f1('0x45')){var _0x386bef={};_0x386bef[_0x218560[_0x86f1('0x2f')]]={'$like':'%'+_0x28f690[_0x86f1('0x37')][_0x86f1('0x42')]+'%'};return _0x386bef;}})});}_0x57e4f2=_['merge']({},_0x57e4f2,_0x28f690[_0x86f1('0x46')]);var _0x1a1062={'where':_0x57e4f2[_0x86f1('0x41')]};return db[_0x86f1('0x33')][_0x86f1('0x24')](_0x1a1062)[_0x86f1('0x2a')](function(_0x1d57d2){_0x82c486[_0x86f1('0x24')]=_0x1d57d2;if(_0x28f690[_0x86f1('0x37')][_0x86f1('0x47')]){_0x57e4f2[_0x86f1('0x48')]=[{'all':!![]}];}return db[_0x86f1('0x33')][_0x86f1('0x49')](_0x57e4f2);})['then'](function(_0x4ec14b){_0x82c486[_0x86f1('0x4a')]=_0x4ec14b;return _0x82c486;})[_0x86f1('0x2a')](respondWithFilteredResult(_0x48b21b,_0x57e4f2))[_0x86f1('0x4b')](handleError(_0x48b21b,null));};exports[_0x86f1('0x4c')]=function(_0x457907,_0x32a455){var _0x1b0918={'raw':![],'where':{'id':_0x457907[_0x86f1('0x4d')]['id']}},_0x561058={};_0x561058['model']=_[_0x86f1('0x4e')](db['UserProfile'][_0x86f1('0x34')]);_0x561058[_0x86f1('0x37')]=_[_0x86f1('0x4e')](_0x457907[_0x86f1('0x37')]);_0x561058[_0x86f1('0x38')]=_[_0x86f1('0x39')](_0x561058[_0x86f1('0x3b')],_0x561058[_0x86f1('0x37')]);_0x1b0918[_0x86f1('0x3a')]=_[_0x86f1('0x39')](_0x561058[_0x86f1('0x3b')],qs[_0x86f1('0x3c')](_0x457907[_0x86f1('0x37')]['fields']));_0x1b0918[_0x86f1('0x3a')]=_0x1b0918[_0x86f1('0x3a')][_0x86f1('0x3d')]?_0x1b0918[_0x86f1('0x3a')]:_0x561058[_0x86f1('0x3b')];if(_0x457907['query'][_0x86f1('0x47')]){_0x1b0918[_0x86f1('0x48')]=[{'all':!![]}];}_0x1b0918=_[_0x86f1('0x43')]({},_0x1b0918,_0x457907[_0x86f1('0x46')]);return db[_0x86f1('0x33')][_0x86f1('0x4f')](_0x1b0918)[_0x86f1('0x2a')](handleEntityNotFound(_0x32a455,null))['then'](respondWithResult(_0x32a455,null))['catch'](handleError(_0x32a455,null));};exports[_0x86f1('0x50')]=function(_0x56d733,_0x28c671){return db[_0x86f1('0x33')]['create'](_0x56d733[_0x86f1('0x51')],{})[_0x86f1('0x2a')](respondWithResult(_0x28c671,0xc9))[_0x86f1('0x4b')](handleError(_0x28c671,null));};exports[_0x86f1('0x52')]=function(_0x32ad7c,_0x57038a){var _0x5cee72={'where':{'id':_0x32ad7c[_0x86f1('0x4d')]['id']}},_0x11a2ea={};_0x11a2ea[_0x86f1('0x3b')]=_[_0x86f1('0x4e')](db[_0x86f1('0x33')][_0x86f1('0x34')]);_0x5cee72[_0x86f1('0x3a')]=_['intersection'](_0x11a2ea[_0x86f1('0x3b')],qs[_0x86f1('0x3c')](_0x32ad7c[_0x86f1('0x37')][_0x86f1('0x3c')]));_0x5cee72[_0x86f1('0x3a')]=_0x5cee72[_0x86f1('0x3a')][_0x86f1('0x3d')]?_0x5cee72[_0x86f1('0x3a')]:_0x11a2ea['model'];if(_0x32ad7c[_0x86f1('0x37')]['includeAll']){_0x5cee72['include']=[{'all':!![]}];}_0x5cee72=_[_0x86f1('0x43')]({},_0x5cee72,_0x32ad7c[_0x86f1('0x46')]);return db['UserProfile'][_0x86f1('0x4f')](_0x5cee72)[_0x86f1('0x2a')](handleEntityNotFound(_0x57038a,null))[_0x86f1('0x2a')](function(_0x1ea9f2){if(_0x1ea9f2){var _0x4c5872=_0x1ea9f2['get']({'plain':!![]});_0x4c5872=qs[_0x86f1('0x53')](_0x4c5872,['id',_0x86f1('0x54'),_0x86f1('0x55'),_0x86f1('0x56')]);_0x32ad7c['body']=_[_0x86f1('0x53')](_0x32ad7c[_0x86f1('0x51')],['id',_0x86f1('0x54'),_0x86f1('0x55')]);return db[_0x86f1('0x57')][_0x86f1('0x58')](function(_0x42332d){return db[_0x86f1('0x33')][_0x86f1('0x50')](_[_0x86f1('0x43')](_0x4c5872,_0x32ad7c[_0x86f1('0x51')]),{'include':_0x32ad7c[_0x86f1('0x37')][_0x86f1('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x42332d})[_0x86f1('0x2a')](function(_0x297635){var _0x9e6877=_0x297635['get']({'plain':!![]});return db[_0x86f1('0x59')]['findAll']({'where':{'userProfileId':_0x32ad7c['params']['id']},'raw':!![]})[_0x86f1('0x2a')](function(_0x70be66){if(_0x70be66){return BPromise['each'](_0x70be66,function(_0x5a65a5){return new BPromise(function(_0xb2e276,_0x4f5cb4){if(_0x5a65a5[_0x86f1('0x5a')]===null||_0x5a65a5[_0x86f1('0x5a')]===0x1)_0xb2e276(null);return db[_0x86f1('0x5b')][_0x86f1('0x49')]({'where':{'sectionId':_0x5a65a5['id']},'raw':!![]})[_0x86f1('0x2a')](function(_0x59b7dd){var _0x4cd193=_[_0x86f1('0x32')](_0x59b7dd,function(_0x2de29e){return qs[_0x86f1('0x53')](_0x2de29e,['id',_0x86f1('0x54'),_0x86f1('0x55'),_0x86f1('0x5c')]);});_0xb2e276(_0x4cd193);})['catch'](function(_0x50ab14){_0x4f5cb4(_0x50ab14);});})[_0x86f1('0x2a')](function(_0x488a3f){var _0x23869c=qs['omit'](_0x5a65a5,['id',_0x86f1('0x54'),'updatedAt']);_0x23869c[_0x86f1('0x5d')]=_0x9e6877['id'];if(_0x488a3f)_0x23869c[_0x86f1('0x5e')]=_0x488a3f;return _0x23869c;})[_0x86f1('0x2a')](function(_0x3a1671){return db['UserProfileSection'][_0x86f1('0x50')](_0x3a1671,{'include':[{'model':db[_0x86f1('0x5b')],'as':_0x86f1('0x5e')}],'raw':!![],'transaction':_0x42332d});});})[_0x86f1('0x2a')](function(){return _0x9e6877;});}});});});}})['then'](respondWithResult(_0x57038a,0xc9))[_0x86f1('0x4b')](handleError(_0x57038a,null));};exports[_0x86f1('0x29')]=function(_0x283a79,_0x8dbbcd){if(_0x283a79[_0x86f1('0x51')]['id']){delete _0x283a79['body']['id'];}return db[_0x86f1('0x33')]['find']({'where':{'id':_0x283a79[_0x86f1('0x4d')]['id']}})[_0x86f1('0x2a')](handleEntityNotFound(_0x8dbbcd,null))[_0x86f1('0x2a')](saveUpdates(_0x283a79[_0x86f1('0x51')],null))[_0x86f1('0x2a')](respondWithResult(_0x8dbbcd,null))[_0x86f1('0x4b')](handleError(_0x8dbbcd,null));};exports[_0x86f1('0x2b')]=function(_0x5b1df0,_0x557ca2){return db[_0x86f1('0x33')]['find']({'where':{'id':_0x5b1df0[_0x86f1('0x4d')]['id']}})[_0x86f1('0x2a')](handleEntityNotFound(_0x557ca2,null))[_0x86f1('0x2a')](removeEntity(_0x557ca2,null))['catch'](handleError(_0x557ca2,null));};exports['describe']=function(_0x14bec1,_0x1c4cbf){return db[_0x86f1('0x33')]['describe']()[_0x86f1('0x2a')](respondWithResult(_0x1c4cbf,null))[_0x86f1('0x4b')](handleError(_0x1c4cbf,null));};exports[_0x86f1('0x5f')]=function(_0x38531c,_0x3b559f){var _0xbd0ff3=_0x38531c[_0x86f1('0x51')];return db[_0x86f1('0x33')][_0x86f1('0x4f')]({'where':{'id':_0x38531c[_0x86f1('0x4d')]['id']}})[_0x86f1('0x2a')](handleEntityNotFound(_0x3b559f,null))['then'](function(_0x52b8c7){if(_0x52b8c7){return db[_0x86f1('0x57')][_0x86f1('0x58')](function(_0x3ba84c){return db['UserProfileSection'][_0x86f1('0x2b')]({'where':{'userProfileId':_0x38531c[_0x86f1('0x4d')]['id'],'sectionId':_[_0x86f1('0x32')](_0xbd0ff3,function(_0x52c8ed){return _0x52c8ed[_0x86f1('0x5c')];})},'transaction':_0x3ba84c})[_0x86f1('0x2a')](function(){var _0x3314c3=_[_0x86f1('0x32')](_0xbd0ff3,function(_0x4de547){_0x4de547[_0x86f1('0x5d')]=_0x38531c[_0x86f1('0x4d')]['id'];return _0x4de547;});var _0x2bc5e9=[];return BPromise[_0x86f1('0x60')](_0x3314c3,function(_0x4e4796){return db[_0x86f1('0x59')][_0x86f1('0x50')](_0x4e4796,{'include':[{'model':db['UserProfileResource'],'as':_0x86f1('0x5e')}],'raw':!![],'transaction':_0x3ba84c})[_0x86f1('0x2a')](function(_0x4c5115){_0x2bc5e9[_0x86f1('0x61')](_0x4c5115[_0x86f1('0x62')]({'plain':!![]}));});})['then'](function(){return _0x2bc5e9;});});});}})[_0x86f1('0x2a')](function(_0x54f91b){return _0x54f91b;})['then'](respondWithResult(_0x3b559f,null))[_0x86f1('0x4b')](handleError(_0x3b559f,null));};exports['removeSections']=function(_0x48bb6b,_0x3e8c06){var _0x2c14ae;return db['UserProfile'][_0x86f1('0x4f')]({'where':{'id':_0x48bb6b[_0x86f1('0x4d')]['id']},'attributes':['id',_0x86f1('0x2f')]})[_0x86f1('0x2a')](handleEntityNotFound(_0x3e8c06,null))[_0x86f1('0x2a')](function(_0xec7453){if(_0xec7453){_0x2c14ae=_0xec7453;return db[_0x86f1('0x59')]['destroy']({'where':{'userProfileId':_0x48bb6b[_0x86f1('0x4d')]['id'],'sectionId':_0x48bb6b[_0x86f1('0x37')][_0x86f1('0x63')]}});}})['then'](function(){return _0x2c14ae;})[_0x86f1('0x2a')](respondWithStatusCode(_0x3e8c06,null))['catch'](handleError(_0x3e8c06,null));};exports[_0x86f1('0x64')]=function(_0x91ed7a,_0x5bf96f){var _0x4e4464=[];var _0x407d34=[];return db[_0x86f1('0x59')][_0x86f1('0x49')]({'where':{'userProfileId':_0x91ed7a['params']['id']},'raw':!![]})[_0x86f1('0x2a')](function(_0x18e35c){_0x4e4464=_['filter'](_0x18e35c,function(_0x4682c4){return _0x4682c4[_0x86f1('0x65')]===0x1||_[_0x86f1('0x66')]([0x3eb,0x709],_0x4682c4[_0x86f1('0x5c')]);});if(!_['isEmpty'](_0x4e4464)){return _[_0x86f1('0x32')](_0x4e4464,function(_0x4fd83d){return _0x4fd83d[_0x86f1('0x5c')];});}else{return;}})[_0x86f1('0x2a')](function(_0x2d83f3){if(_0x2d83f3)_0x407d34=_0x2d83f3;if(_[_0x86f1('0x66')](_0x407d34,0x64)){var _0x4732df=_[_0x86f1('0x4f')](_0x4e4464,{'sectionId':0x64});return hasDefaultDashboard(_0x4732df)[_0x86f1('0x2a')](function(_0x320146){return _[_0x86f1('0x32')](_0x4e4464,function(_0x4949f5){if(_0x4949f5[_0x86f1('0x5c')]===0x64){_0x4949f5['subsections']=_0x320146;}return _0x4949f5;});});}else{return;}})['then'](function(_0x3ca2fa){if(_0x3ca2fa)_0x4e4464=_0x3ca2fa;if(_[_0x86f1('0x66')](_0x407d34,0x3eb)){var _0x1db42c=_[_0x86f1('0x4f')](_0x4e4464,{'sectionId':0x3eb});return getCustomDashboards(_0x1db42c)[_0x86f1('0x2a')](function(_0x7a09aa){return _['map'](_0x4e4464,function(_0x30f8a8){if(_0x1db42c[_0x86f1('0x65')]){if(_0x30f8a8[_0x86f1('0x5c')]===0x3eb){_0x30f8a8[_0x86f1('0x67')]=_0x7a09aa;}}else{if(_0x30f8a8['sectionId']===0x64){_0x30f8a8['subsections']=_0x7a09aa;}}return _0x30f8a8;});});}else{return;}})[_0x86f1('0x2a')](function(_0x4d0024){if(_0x4d0024)_0x4e4464=_0x4d0024;if(_['includes'](_0x407d34,0x709)){var _0x42d4e2=_[_0x86f1('0x4f')](_0x4e4464,{'sectionId':0x709});return getPlugins(_0x42d4e2)[_0x86f1('0x2a')](function(_0xb7bcae){if(_0x42d4e2[_0x86f1('0x65')]){return _['map'](_0x4e4464,function(_0xd4baa3){if(_0xd4baa3['sectionId']===0x709){_0xd4baa3[_0x86f1('0x67')]=_0xb7bcae;}return _0xd4baa3;});}else{var _0x16671a={'sectionId':0x76c,'enabled':0x1,'subsections':_0xb7bcae};var _0x4bec6f=_[_0x86f1('0x32')](_0x4e4464);_0x4bec6f[_0x86f1('0x61')](_0x16671a);return _0x4bec6f;}});}else{return;}})['then'](function(_0x412b6a){if(_0x412b6a)_0x4e4464=_0x412b6a;return _[_0x86f1('0x42')](_0x4e4464,[_0x86f1('0x65'),0x1]);})[_0x86f1('0x2a')](respondWithResult(_0x5bf96f,null))[_0x86f1('0x4b')](handleError(_0x5bf96f,null));};function hasDefaultDashboard(_0x2336e6){var _0x46a0fd=[0x65];return new BPromise(function(_0x1ad463,_0x459c0a){try{if(_0x2336e6[_0x86f1('0x5a')]){_0x1ad463(_0x46a0fd);}else{return db[_0x86f1('0x5b')][_0x86f1('0x68')]({'where':{'sectionId':_0x2336e6['id']},'raw':!![]})[_0x86f1('0x2a')](function(_0x30d6dd){_0x30d6dd?_0x1ad463(_0x46a0fd):_0x1ad463();});}}catch(_0x5af224){_0x459c0a(_0x5af224);}});}function getCustomDashboards(_0x1fe733){var _0x59a5aa=[];return new BPromise(function(_0x444df3,_0x54279a){try{if(_0x1fe733[_0x86f1('0x5a')]){return db[_0x86f1('0x69')]['findAll']({'raw':!![]})[_0x86f1('0x2a')](function(_0x535836){_0x535836[_0x86f1('0x6a')](function(_0x5a872e){_0x59a5aa[_0x86f1('0x61')](_0x5a872e['id']+0x1869f);});_0x444df3(_0x59a5aa);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1fe733['id']},'raw':!![]})['then'](function(_0x4384fd){_0x4384fd[_0x86f1('0x6a')](function(_0x233cfe){_0x59a5aa[_0x86f1('0x61')](_0x233cfe[_0x86f1('0x6b')]+0x1869f);});_0x444df3(_0x59a5aa);});}}catch(_0x299285){_0x54279a(_0x299285);}});}function getPlugins(_0x162f19){var _0x1cf838=[];return new BPromise(function(_0x4736f3,_0x3e08c6){try{if(_0x162f19[_0x86f1('0x5a')]){return db[_0x86f1('0x6c')][_0x86f1('0x49')]({'raw':!![]})[_0x86f1('0x2a')](function(_0x53c10d){_0x53c10d[_0x86f1('0x6a')](function(_0x1d81bf){_0x1cf838[_0x86f1('0x61')](_0x1d81bf['id']+0x15b38);});_0x4736f3(_0x1cf838);});}else{return db[_0x86f1('0x5b')][_0x86f1('0x49')]({'where':{'sectionId':_0x162f19['id']},'raw':!![]})['then'](function(_0x4fc156){_0x4fc156[_0x86f1('0x6a')](function(_0x1ba009){_0x1cf838[_0x86f1('0x61')](_0x1ba009[_0x86f1('0x6b')]+0x15b38);});_0x4736f3(_0x1cf838);});}}catch(_0x4758cb){_0x3e08c6(_0x4758cb);}});}exports[_0x86f1('0x6d')]=function(_0x3adfad,_0x20c5c2){return db[_0x86f1('0x33')]['find']({'where':{'id':_0x3adfad[_0x86f1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x20c5c2,null))[_0x86f1('0x2a')](function(_0x6394c2){if(_0x6394c2){return db[_0x86f1('0x57')][_0x86f1('0x58')](function(_0x121e65){return db[_0x86f1('0x59')][_0x86f1('0x49')]({'where':{'userProfileId':_0x3adfad[_0x86f1('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x86f1('0x2a')](function(_0x137111){if(_0x137111){return db[_0x86f1('0x59')][_0x86f1('0x2b')]({'where':{'userProfileId':_0x3adfad[_0x86f1('0x4d')]['id'],'id':_[_0x86f1('0x32')](_0x137111,function(_0x282c04){return _0x282c04['id'];})},'transaction':_0x121e65});}})[_0x86f1('0x2a')](function(_0x19766a){var _0x58fbae=_['map'](_0x3adfad[_0x86f1('0x51')],function(_0x173d09){_0x173d09[_0x86f1('0x5d')]=_0x3adfad['params']['id'];return _0x173d09;});return db[_0x86f1('0x59')][_0x86f1('0x6e')](_0x58fbae,{'raw':!![],'transaction':_0x121e65});})[_0x86f1('0x2a')](function(_0x2ac02){var _0xc9819d=_[_0x86f1('0x42')](_[_0x86f1('0x32')](_0x2ac02,function(_0x4dc710){return _0x4dc710[_0x86f1('0x62')]({'plain':!![]});}),{'includeAll':![]});if(_0xc9819d){return db['UserProfileSection'][_0x86f1('0x49')]({'where':{'userProfileId':_0x3adfad[_0x86f1('0x4d')]['id'],'sectionId':_[_0x86f1('0x32')](_0xc9819d,function(_0x337bf6){return _0x337bf6[_0x86f1('0x5c')];})},'attributes':['id',_0x86f1('0x5c')],'raw':!![]})[_0x86f1('0x2a')](function(_0x336149){var _0x5bb1d1=_[_0x86f1('0x32')](_0x3adfad['body'],function(_0x4a588f){_0x4a588f['userProfileId']=_0x3adfad[_0x86f1('0x4d')]['id'];return _0x4a588f;});return db['UserProfileResource'][_0x86f1('0x6e')](_0x5bb1d1,{'raw':!![],'transaction':_0x121e65});});}})[_0x86f1('0x4b')](handleError(_0x20c5c2,null));});}})['then'](function(_0x2ebb6d){var _0x215e82=_[_0x86f1('0x32')](_0x2ebb6d,function(_0x20b0c0){return _0x20b0c0['get']({'plain':!![]});});})[_0x86f1('0x2a')](respondWithResult(_0x20c5c2,null))[_0x86f1('0x4b')](handleError(_0x20c5c2,null));};exports[_0x86f1('0x6f')]=function(_0x7335e,_0x3585ab,_0x34a632){return db[_0x86f1('0x33')][_0x86f1('0x4f')]({'where':{'id':_0x7335e[_0x86f1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3585ab,null))[_0x86f1('0x2a')](function(_0x30dc2f){if(_0x30dc2f){return _0x30dc2f[_0x86f1('0x6f')](_0x7335e[_0x86f1('0x37')][_0x86f1('0x63')]);}})[_0x86f1('0x2a')](respondWithStatusCode(_0x3585ab,null))[_0x86f1('0x4b')](handleError(_0x3585ab,null));};exports['getResources']=function(_0x3a3612,_0x580f06){var _0x59771f={};if(!_0x3a3612[_0x86f1('0x37')][_0x86f1('0x70')])throw new Error(_0x86f1('0x71'));if(!_0x3a3612[_0x86f1('0x37')]['hasOwnProperty'](_0x86f1('0x72'))){_0x59771f['limit']=qs[_0x86f1('0x22')](_0x3a3612[_0x86f1('0x37')][_0x86f1('0x22')]);_0x59771f[_0x86f1('0x23')]=qs[_0x86f1('0x23')](_0x3a3612['query']['offset']);}return db[_0x86f1('0x33')]['find']({'where':{'id':_0x3a3612[_0x86f1('0x4d')]['id']}})[_0x86f1('0x2a')](function(_0x3a547c){if(!_0x3a547c)throw new Error(_0x86f1('0x73')+_0x3a3612[_0x86f1('0x4d')]['id']);return db['UserProfile'][_0x86f1('0x74')](_0x3a3612);})[_0x86f1('0x2a')](respondWithFilteredResult(_0x580f06,_0x59771f))[_0x86f1('0x4b')](handleError(_0x580f06,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 2322cbc..28c9d6a 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 _0x7046=['events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x496f97,_0x5e174f){var _0x393b87=function(_0x2a8948){while(--_0x2a8948){_0x496f97['push'](_0x496f97['shift']());}};_0x393b87(++_0x5e174f);}(_0x7046,0x144));var _0x6704=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7046[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x6704('0x0'));var UserProfile=require(_0x6704('0x1'))['db'][_0x6704('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6704('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6704('0x4'),'afterDestroy':_0x6704('0x5')};function emitEvent(_0x2899c5){return function(_0x5258e7,_0x1e9b2a,_0x35bcc6){UserProfileEvents[_0x6704('0x6')](_0x2899c5+':'+_0x5258e7['id'],_0x5258e7);UserProfileEvents[_0x6704('0x6')](_0x2899c5,_0x5258e7);_0x35bcc6(null);};}for(var e in events){if(events[_0x6704('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x6704('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x7eff=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xf7ef('0x0'))['db'][_0xf7ef('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf7ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7ef('0x3'),'afterDestroy':_0xf7ef('0x4')};function emitEvent(_0xc0c7ba){return function(_0x4db614,_0x58a651,_0x4a4573){UserProfileEvents[_0xf7ef('0x5')](_0xc0c7ba+':'+_0x4db614['id'],_0x4db614);UserProfileEvents[_0xf7ef('0x5')](_0xc0c7ba,_0x4db614);_0x4a4573(null);};}for(var e in events){if(events[_0xf7ef('0x6')](e)){var event=events[e];UserProfile[_0xf7ef('0x7')](e,emitEvent(event));}}module[_0xf7ef('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index ab97819..b8f7a0d 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 _0x2a07=['VoicePrefix','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','VoiceQueues','users','agents','telephones','admin','user','Agents','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','intervals','Pause','scheduler','Schedule','sounds','Sound','Template','triggers','Trigger','Variable','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','where','sequelize','query','OpenTabs','define','user_profiles','raw','Invalid\x20section\x20\x27','length','UserProfileSection','find','ignore','isEmpty','union','push','all','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','sort','pick','filters','merge','key','AnalyticExtractedReport','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','ids','count','Tag','color','ThroughTags','tag','rows','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','type','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','agent','Telephones','membername','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','chanspies','VoiceChanSpy','voiceprefixes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a07,0x74));var _0x72a0=function(_0x268111,_0x31c1f9){_0x268111=_0x268111-0x0;var _0x54e72a=_0x2a07[_0x268111];return _0x54e72a;};'use strict';var _=require(_0x72a0('0x0'));var attributes=require(_0x72a0('0x1'));var qs=require(_0x72a0('0x2'));var squel=require(_0x72a0('0x3'));module[_0x72a0('0x4')]=function(_0x548164){var _0x335b7c=_0x548164[_0x72a0('0x5')];function _0x135982(_0x45b155,_0x431f65){return new Promise(function(_0xce74c,_0x3ccf6d){if(!_0x431f65)return _0xce74c(null);var _0x20dab9=_0x431f65[_0x72a0('0x6')]?{[_0x431f65[_0x72a0('0x6')][_0x72a0('0x7')]]:_0x431f65[_0x72a0('0x6')][_0x72a0('0x8')]}:undefined;return _0x335b7c[_0x45b155][_0x72a0('0x9')]({'where':_0x20dab9,'raw':!![]})[_0x72a0('0xa')](function(_0x2bc45b){_0x431f65['associatedResources']=_[_0x72a0('0xb')](_0x2bc45b,'id');_0xce74c(_0x431f65);})[_0x72a0('0xc')](function(_0x54abf6){_0x3ccf6d(_0x54abf6);});});}function _0x46fb8a(_0x194488,_0x1b85b1){return new Promise(function(_0x44d7cf,_0x975c27){var _0x516c08=_0x194488[_0x72a0('0x6')]?{[_0x194488[_0x72a0('0x6')][_0x72a0('0x7')]]:_0x194488[_0x72a0('0x6')][_0x72a0('0x8')]}:undefined;return _0x335b7c[_0x194488[_0x72a0('0xd')]][_0x72a0('0x9')]({'where':_0x516c08,'raw':!![]})['then'](function(_0x4930c5){_0x1b85b1[_0x72a0('0xe')]=_[_0x72a0('0xb')](_0x4930c5,function(_0x19eaf9){return _0x19eaf9[_0x72a0('0xf')];});_0x44d7cf(_0x1b85b1);})[_0x72a0('0xc')](function(_0x3f3d62){_0x975c27(_0x3f3d62);});});}function _0x4ab55e(_0x30248e,_0x2e7552,_0x16ac70){if(!_0x2e7552)return Promise[_0x72a0('0x10')](null);return new Promise(function(_0x2d1e95,_0x54495e){return _0x335b7c[_0x72a0('0x11')][_0x72a0('0x9')]({'where':{'sectionId':_0x2e7552['id']},'raw':!![]})[_0x72a0('0xa')](function(_0x5b63c8){if(_0x30248e[_0x72a0('0x7')]&&_0x30248e[_0x72a0('0x7')]!=='id'){_0x2e7552[_0x72a0('0xe')]=_[_0x72a0('0xb')](_0x5b63c8,function(_0x5437df){return _0x5437df[_0x30248e[_0x72a0('0x7')]];});}else{if(_0x16ac70==='AnalyticExtractedReport'){_0x2e7552[_0x72a0('0xe')]=_[_0x72a0('0xb')](_0x5b63c8,function(_0xde058c){return{'id':_0xde058c['resourceId'],'type':_0xde058c[_0x72a0('0x12')]};});}else{_0x2e7552[_0x72a0('0xe')]=_[_0x72a0('0xb')](_0x5b63c8,function(_0x3d1965){return _0x3d1965['resourceId'];});}}_0x2d1e95(_0x2e7552);})[_0x72a0('0xc')](function(_0x390464){_0x54495e(_0x390464);});});}function _0x1ddd54(_0x23b918,_0x3022b0){var _0x174b1b={'parentSections':[]};switch(_0x23b918['toLowerCase']()){case'squareprojects':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x14');break;case _0x72a0('0x15'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x16');break;case _0x72a0('0x17'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x18');_0x174b1b[_0x72a0('0x19')]=[{'name':_0x72a0('0x1a'),'field':'name','foreignKey':_0x72a0('0x1b')}];break;case _0x72a0('0x1c'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x1d');break;case _0x72a0('0x1e'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x1f');_0x174b1b[_0x72a0('0x19')]=[{'name':_0x72a0('0x20'),'field':'id','foreignKey':_0x72a0('0x21')}];break;case'lists':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x22');break;case _0x72a0('0x23'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x24');break;case _0x72a0('0x25'):_0x174b1b[_0x72a0('0x13')]='CmCustomField';break;case _0x72a0('0x26'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x27');break;case _0x72a0('0x28'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x29');break;case _0x72a0('0x2a'):_0x174b1b[_0x72a0('0x13')]='FaxQueue';break;case _0x72a0('0x2b'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x2c');break;case'inboundroutes':case _0x72a0('0x2d'):case'outboundroutes':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x2e');break;case _0x72a0('0x2f'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x30');break;case _0x72a0('0x31'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x32');break;case _0x72a0('0x33'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x34');_0x174b1b[_0x72a0('0x19')]=[{'name':'Agents','field':_0x72a0('0xf'),'foreignKey':'membername','model':_0x72a0('0x35'),'filter':{'field':_0x72a0('0x36'),'value':[_0x72a0('0x37')]}},{'name':_0x72a0('0x38'),'field':_0x72a0('0xf'),'foreignKey':_0x72a0('0x39'),'model':_0x72a0('0x35'),'filter':{'field':_0x72a0('0x36'),'value':[_0x72a0('0x3a')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x72a0('0x3b'),'model':_0x72a0('0x3c'),'filter':{'field':_0x72a0('0x12'),'value':[_0x72a0('0x3d')]}},{'name':_0x72a0('0x3e'),'field':'name','foreignKey':_0x72a0('0x3b'),'model':_0x72a0('0x3c'),'filter':{'field':'type','value':[_0x72a0('0x3f')]}}];break;case'musiconholds':_0x174b1b['childModel']='VoiceMusicOnHold';break;case _0x72a0('0x40'):_0x174b1b['childModel']=_0x72a0('0x41');break;case _0x72a0('0x42'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x43');break;case'ivrcampaigns':_0x174b1b['childModel']='Campaign';break;case'mailqueues':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x44');break;case'mailaccounts':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x45');break;case'mailsubstatuses':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x46');break;case _0x72a0('0x47'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x48');break;case _0x72a0('0x49'):_0x174b1b['childModel']=_0x72a0('0x4a');break;case'smsqueues':_0x174b1b[_0x72a0('0x13')]='SmsQueue';break;case _0x72a0('0x4b'):_0x174b1b[_0x72a0('0x13')]='SmsAccount';break;case _0x72a0('0x4c'):_0x174b1b['childModel']=_0x72a0('0x4d');break;case _0x72a0('0x4e'):_0x174b1b[_0x72a0('0x13')]='WhatsappAccount';break;case _0x72a0('0x4f'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x50');break;case'voicequeues':case'queuecampaigns':_0x174b1b[_0x72a0('0x13')]='VoiceQueue';if(_0x3022b0){_0x174b1b[_0x72a0('0x19')]=[{'name':_0x72a0('0x51')},{'name':_0x72a0('0x3e')}];}break;case _0x72a0('0x52'):case _0x72a0('0x53'):case _0x72a0('0x54'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x35');if(_0x3022b0){_0x174b1b[_0x72a0('0x19')]=[{'name':'Users','filter':{'field':_0x72a0('0x36'),'value':[_0x72a0('0x55'),_0x72a0('0x56')]},'ignore':!![]},{'name':_0x72a0('0x57')},{'name':_0x72a0('0x38')}];}break;case _0x72a0('0x58'):_0x174b1b[_0x72a0('0x13')]='ZendeskAccount';break;case'salesforceaccounts':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x59');break;case _0x72a0('0x5a'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x5b');break;case _0x72a0('0x5c'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x5d');break;case _0x72a0('0x5e'):_0x174b1b[_0x72a0('0x13')]='DeskAccount';break;case _0x72a0('0x5f'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x60');break;case _0x72a0('0x61'):_0x174b1b[_0x72a0('0x13')]='User';break;case _0x72a0('0x62'):_0x174b1b['childModel']='CannedAnswer';break;case _0x72a0('0x63'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x64');break;case _0x72a0('0x65'):_0x174b1b[_0x72a0('0x13')]='Dashboard';break;case _0x72a0('0x66'):_0x174b1b[_0x72a0('0x13')]='Interval';break;case'pauses':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x67');break;case _0x72a0('0x68'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x69');break;case _0x72a0('0x6a'):_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x6b');break;case'tags':_0x174b1b[_0x72a0('0x13')]='Tag';break;case'templates':_0x174b1b['childModel']=_0x72a0('0x6c');break;case _0x72a0('0x6d'):_0x174b1b['childModel']=_0x72a0('0x6e');break;case'trunks':_0x174b1b[_0x72a0('0x13')]='Trunk';break;case'variables':_0x174b1b[_0x72a0('0x13')]=_0x72a0('0x6f');break;case'plugins':_0x174b1b[_0x72a0('0x13')]='Plugin';break;case _0x72a0('0x70'):_0x174b1b['childModel']='AnalyticExtractedReport';_0x174b1b[_0x72a0('0x19')]=[{'name':_0x72a0('0x71'),'field':'id','foreignKey':_0x72a0('0x72')}];break;case'metrics':_0x174b1b['childModel']=_0x72a0('0x73');break;}return _0x174b1b;}function _0x48f178(_0x44b171,_0x36d604){var _0x1cea02=_0x44b171[_0x72a0('0x74')](0x0)[_0x72a0('0x75')]()+_0x44b171[_0x72a0('0x76')](0x1);var _0x41f7f6={'type':_0x335b7c[_0x72a0('0x77')][_0x72a0('0x78')][_0x72a0('0x79')],'raw':!![]};return new Promise(function(_0x32a0bb,_0x43ec4b){var _0x4d0774=squel[_0x72a0('0x7a')]()['field']('ui.'+_0x1cea02+'InteractionId','id')['field'](_0x72a0('0x7b'))[_0x72a0('0x7c')](_0x72a0('0x7d')+_0x44b171+'_interactions','ui')[_0x72a0('0x7e')]('ui.UserId\x20=\x20?',_0x36d604['id']);return _0x335b7c[_0x72a0('0x7f')][_0x72a0('0x80')](_0x4d0774['toString'](),_0x41f7f6)[_0x72a0('0xa')](function(_0x24e211){_0x36d604[_0x1cea02+_0x72a0('0x81')]=_0x24e211;_0x32a0bb(_0x24e211);})[_0x72a0('0xc')](function(_0x5e47c4){_0x43ec4b(_0x5e47c4);});});}return _0x548164[_0x72a0('0x82')]('UserProfile',attributes,{'tableName':_0x72a0('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2cb292){var _0x1df6fc={'raw':_0x2cb292['query'][_0x72a0('0x84')],'where':{}};var _0x3eb3b5={};var _0x1b8a72={'count':0x0,'rows':[]};var _0x154c9d=_0x2cb292[_0x72a0('0x80')]['section'];var _0x5707e9=_0x2cb292[_0x72a0('0x80')]['mergeResources']||![];var _0x421c35=_0x1ddd54(_0x154c9d,_0x5707e9);if(!_0x421c35['childModel'])throw new Error(_0x72a0('0x85')+_0x154c9d+'\x27');var _0xd9ae1a=[{'name':_0x154c9d}];if(!_['isEmpty'](_0x421c35[_0x72a0('0x19')]))_0xd9ae1a=_0x421c35[_0x72a0('0x19')];var _0x83ebf6=[];for(var _0x55b301=0x0;_0x55b301<_0xd9ae1a[_0x72a0('0x86')];_0x55b301++){_0x83ebf6['push'](_0x335b7c[_0x72a0('0x87')][_0x72a0('0x88')]({'where':{'userProfileId':_0x2cb292['params']['id'],'name':_0xd9ae1a[_0x55b301][_0x72a0('0xf')]},'raw':!![]}));}return Promise['all'](_0x83ebf6)['then'](function(_0x5142de){var _0x28969a=_['filter'](_0x5142de,function(_0x115ba8){return _0x115ba8?_0x115ba8:undefined;});var _0x5520b8=_[_0x72a0('0x6')](_0xd9ae1a,[_0x72a0('0x89'),!![]]);var _0x143ebf=_['isEmpty'](_0x28969a)&&_[_0x72a0('0x8a')](_0x5520b8)?null:_[_0x72a0('0x8b')](_0x5520b8,_0x28969a);if(!_0x143ebf)return null;var _0x275e45=[];for(var _0x28551a=0x0;_0x28551a<_0x143ebf[_0x72a0('0x86')];_0x28551a++){var _0x58ef97=_[_0x72a0('0x88')](_0xd9ae1a,function(_0x2d431d){return _0x143ebf[_0x28551a]?_0x2d431d[_0x72a0('0xf')]===_0x143ebf[_0x28551a][_0x72a0('0xf')]:null;});if(_0x58ef97){if(_0x143ebf[_0x28551a]['ignore']){_0x275e45[_0x72a0('0x8c')](_0x135982(_0x421c35[_0x72a0('0x13')],_0x143ebf[_0x28551a]));}else{if(!_0x143ebf[_0x28551a]['autoAssociation']){_0x275e45[_0x72a0('0x8c')](_0x4ab55e(_0x58ef97,_0x143ebf[_0x28551a],_0x421c35['childModel']));}else{if(_0x58ef97[_0x72a0('0xd')]){_0x275e45[_0x72a0('0x8c')](_0x46fb8a(_0x58ef97,_0x143ebf[_0x28551a]));}}}}}return Promise[_0x72a0('0x8d')](_0x275e45);})[_0x72a0('0xa')](function(_0x14f61a){var _0x1e23e9=_0x14f61a;var _0x7450c7=null;if(_0x1e23e9){_0x7450c7=_0x1e23e9['length']===0x1?_0x1e23e9[0x0]:null;}if(!_0x7450c7&&!_0x1e23e9)return _0x1b8a72;var _0x5b0dfd=_0x335b7c[_0x421c35['childModel']][_0x72a0('0x8e')];_0x3eb3b5[_0x72a0('0xd')]=_[_0x72a0('0x8f')](_0x5b0dfd);_0x3eb3b5[_0x72a0('0x80')]=_[_0x72a0('0x8f')](_0x2cb292[_0x72a0('0x80')]);_0x3eb3b5['filters']=_[_0x72a0('0x90')](_0x3eb3b5[_0x72a0('0xd')],_0x3eb3b5[_0x72a0('0x80')]);_0x1df6fc[_0x72a0('0x91')]=_[_0x72a0('0x90')](_0x3eb3b5[_0x72a0('0xd')],qs[_0x72a0('0x92')](_0x2cb292['query'][_0x72a0('0x92')]));_0x1df6fc[_0x72a0('0x91')]=_0x1df6fc[_0x72a0('0x91')][_0x72a0('0x86')]?_0x1df6fc[_0x72a0('0x91')]:_0x3eb3b5[_0x72a0('0xd')];if(!_0x2cb292['query'][_0x72a0('0x93')]('nolimit')){_0x1df6fc[_0x72a0('0x94')]=qs[_0x72a0('0x94')](_0x2cb292[_0x72a0('0x80')][_0x72a0('0x94')]);_0x1df6fc[_0x72a0('0x95')]=qs['offset'](_0x2cb292[_0x72a0('0x80')][_0x72a0('0x95')]);}_0x1df6fc['order']=qs[_0x72a0('0x96')](_0x2cb292[_0x72a0('0x80')][_0x72a0('0x96')]);_0x1df6fc[_0x72a0('0x7e')]=qs['filters'](_[_0x72a0('0x97')](_0x2cb292[_0x72a0('0x80')],_0x3eb3b5[_0x72a0('0x98')]));if(_0x2cb292[_0x72a0('0x80')][_0x72a0('0x6')]){_0x1df6fc[_0x72a0('0x7e')]=_[_0x72a0('0x99')](_0x1df6fc[_0x72a0('0x7e')],{'$or':_[_0x72a0('0xb')](_0x5b0dfd,function(_0x3d02e6){if(_0x3d02e6[_0x72a0('0x12')][_0x72a0('0x9a')]!=='VIRTUAL'){var _0x18dc1b={};_0x18dc1b[_0x3d02e6[_0x72a0('0x7')]]={'$like':'%'+_0x2cb292[_0x72a0('0x80')][_0x72a0('0x6')]+'%'};return _0x18dc1b;}})});}var _0xada6ad=[];var _0x3a0bd6=null;var _0x20281b={};if(_0x7450c7){_0x3a0bd6=_[_0x72a0('0x88')](_0xd9ae1a,['name',_0x7450c7[_0x72a0('0xf')]]);if(_0x3a0bd6['field']){_0x20281b={};if(_0x421c35['childModel']===_0x72a0('0x9b')){_0x20281b[_0x3a0bd6['foreignKey']]=_['map'](_0x7450c7[_0x72a0('0xe')],'id');}else{_0x20281b[_0x3a0bd6['foreignKey']]=_0x7450c7[_0x72a0('0xe')];}_0xada6ad[_0x72a0('0x8c')](_0x20281b);}else{_0x1df6fc[_0x72a0('0x7e')]['id']=_0x7450c7['associatedResources'];}}else{for(var _0x344a69=0x0;_0x344a69<_0x1e23e9[_0x72a0('0x86')];_0x344a69++){_0x3a0bd6=_[_0x72a0('0x88')](_0xd9ae1a,[_0x72a0('0xf'),_0x1e23e9[_0x344a69][_0x72a0('0xf')]]);if(_0x3a0bd6['field']){_0x20281b={};_0x20281b[_0x3a0bd6[_0x72a0('0x9c')]]=_0x1e23e9[_0x344a69][_0x72a0('0xe')];_0xada6ad[_0x72a0('0x8c')](_0x20281b);}else{if(!_0x1df6fc['where']['id'])_0x1df6fc[_0x72a0('0x7e')]['id']=[];_0x1e23e9[_0x344a69][_0x72a0('0xe')][_0x72a0('0x9d')](function(_0x56104e){_0x1df6fc[_0x72a0('0x7e')]['id'][_0x72a0('0x8c')](_0x56104e);});}}}if(!_[_0x72a0('0x8a')](_0xada6ad)){_0x1df6fc[_0x72a0('0x7e')]=_[_0x72a0('0x99')](_0x1df6fc[_0x72a0('0x7e')],{'$and':{'$or':_0xada6ad}});}_0x1df6fc=_[_0x72a0('0x99')]({},_0x1df6fc,_0x2cb292[_0x72a0('0x9e')]);if(_0x7450c7&&!_0x7450c7[_0x72a0('0x9f')]&&_0x421c35['childModel']===_0x72a0('0x9b')){if(_0x2cb292[_0x72a0('0x80')][_0x72a0('0xa0')]){_0x1df6fc[_0x72a0('0xa1')]=[{'all':!![]}];}return _0x335b7c[_0x421c35[_0x72a0('0x13')]]['findAll'](_0x1df6fc)[_0x72a0('0xa')](function(_0x2c72fd){var _0x1c95fc=[];_0x2c72fd[_0x72a0('0x9d')](function(_0x5a995e){var _0x36d8b9;switch(_0x5a995e[_0x72a0('0xa2')]){case _0x72a0('0xa3'):_0x36d8b9=_['find'](_0x7450c7['associatedResources'],function(_0x3e23e4){return _0x3e23e4['id']===_0x5a995e[_0x72a0('0x72')]&&_0x3e23e4[_0x72a0('0x12')]===_0x72a0('0xa4');});break;case _0x72a0('0xa5'):_0x36d8b9=_['find'](_0x7450c7['associatedResources'],function(_0x5c4170){return _0x5c4170['id']===_0x5a995e[_0x72a0('0x72')]&&_0x5c4170['type']===_0x72a0('0xa6');});break;}if(_0x36d8b9)_0x1c95fc['push'](_0x5a995e);});_0x1b8a72['count']=_0x1c95fc['length'];_0x1b8a72['rows']=_0x1c95fc;return _0x1b8a72;});}else{if(!_[_0x72a0('0x8a')](_0x2cb292[_0x72a0('0x80')][_0x72a0('0xa7')])){_0x1df6fc[_0x72a0('0x7e')]['id']=_0x1df6fc['where']['id']?_[_0x72a0('0x90')](_0x1df6fc[_0x72a0('0x7e')]['id'],_0x2cb292['query'][_0x72a0('0xa7')]):_0x2cb292[_0x72a0('0x80')]['ids'];}return _0x335b7c[_0x421c35[_0x72a0('0x13')]][_0x72a0('0xa8')]({'where':_0x1df6fc[_0x72a0('0x7e')]})[_0x72a0('0xa')](function(_0x5e1638){_0x1b8a72['count']=_0x5e1638;if(_0x2cb292[_0x72a0('0x80')][_0x72a0('0xa0')]){if(_0x421c35[_0x72a0('0x13')]===_0x72a0('0x1f')){_0x1df6fc[_0x72a0('0xa1')]=[{'model':_0x335b7c[_0x72a0('0xa9')],'as':'Tags','attributes':['id','name',_0x72a0('0xaa')],'required':_0x2cb292[_0x72a0('0x80')]['tag']?!![]:![]},{'model':_0x335b7c[_0x72a0('0xa9')],'as':_0x72a0('0xab'),'attributes':['id',_0x72a0('0xf'),_0x72a0('0xaa')],'through':_0x2cb292[_0x72a0('0x80')][_0x72a0('0xac')]?{'attributes':[],'where':{'TagId':_0x2cb292[_0x72a0('0x80')]['tag']||undefined}}:{},'required':_0x2cb292[_0x72a0('0x80')][_0x72a0('0xac')]?!![]:![]}];}else{_0x1df6fc[_0x72a0('0xa1')]=[{'all':!![]}];}}return _0x335b7c[_0x421c35['childModel']][_0x72a0('0x9')](_0x1df6fc);})[_0x72a0('0xa')](function(_0x346e03){_0x1b8a72[_0x72a0('0xad')]=_0x346e03;if(_0x154c9d===_0x72a0('0x57')&&_0x2cb292['query'][_0x72a0('0xae')]===_0x72a0('0xaf')){var _0x1f6d7d=[];for(var _0x417ac4=0x0;_0x417ac4<_0x1b8a72[_0x72a0('0xad')][_0x72a0('0x86')];_0x417ac4++){_0x1f6d7d['push'](_0x48f178(_0x72a0('0xb0'),_0x1b8a72[_0x72a0('0xad')][_0x417ac4][_0x72a0('0xb1')]));_0x1f6d7d[_0x72a0('0x8c')](_0x48f178(_0x72a0('0xb2'),_0x1b8a72[_0x72a0('0xad')][_0x417ac4][_0x72a0('0xb1')]));_0x1f6d7d[_0x72a0('0x8c')](_0x48f178(_0x72a0('0xb3'),_0x1b8a72['rows'][_0x417ac4][_0x72a0('0xb1')]));_0x1f6d7d['push'](_0x48f178(_0x72a0('0xb4'),_0x1b8a72[_0x72a0('0xad')][_0x417ac4][_0x72a0('0xb1')]));_0x1f6d7d[_0x72a0('0x8c')](_0x48f178(_0x72a0('0xb5'),_0x1b8a72[_0x72a0('0xad')][_0x417ac4]['dataValues']));_0x1f6d7d['push'](_0x48f178(_0x72a0('0xb6'),_0x1b8a72[_0x72a0('0xad')][_0x417ac4][_0x72a0('0xb1')]));}return Promise[_0x72a0('0x8d')](_0x1f6d7d)[_0x72a0('0xa')](function(){return _0x1b8a72;});}return _0x1b8a72;});}});}}});}; \ No newline at end of file +var _0x3266=['WhatsappAccount','teams','Team','voicequeues','users','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','Trunk','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','ui.','InteractionId','ui.createdAt','from','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','user_profiles','section','mergeResources','isEmpty','length','push','UserProfileSection','find','params','all','rawAttributes','keys','filters','intersection','attributes','nolimit','limit','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','includeAll','reportType','DefaultReports','custom','CustomReports','count','ids','include','Tags','color','tag','Tag','ThroughTags','rows','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','AnalyticExtractedReport','resourceId','toLowerCase','childModel','SquareProject','squarerecordings','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','voicemails','VoiceMail','Agents','membername','role','Telephones','User','telephone','VoiceQueues','VoiceQueue','type','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues','whatsappaccounts'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x3266,0x6a));var _0x6326=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x3266[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x6326('0x0'));var attributes=require(_0x6326('0x1'));var qs=require(_0x6326('0x2'));var squel=require(_0x6326('0x3'));module[_0x6326('0x4')]=function(_0x6b67c0){var _0x29aef3=_0x6b67c0[_0x6326('0x5')];function _0x265264(_0x5a6b4d,_0x30b22e){return new Promise(function(_0x5f38a3,_0x25ecd8){if(!_0x30b22e)return _0x5f38a3(null);var _0x44460c=_0x30b22e[_0x6326('0x6')]?{[_0x30b22e['filter'][_0x6326('0x7')]]:_0x30b22e['filter'][_0x6326('0x8')]}:undefined;return _0x29aef3[_0x5a6b4d][_0x6326('0x9')]({'where':_0x44460c,'raw':!![]})[_0x6326('0xa')](function(_0x1aee60){_0x30b22e[_0x6326('0xb')]=_['map'](_0x1aee60,'id');_0x5f38a3(_0x30b22e);})[_0x6326('0xc')](function(_0x464a36){_0x25ecd8(_0x464a36);});});}function _0x3590ab(_0x1e6909,_0x416844){return new Promise(function(_0x3b056c,_0x1ba67d){var _0x77c4e=_0x1e6909[_0x6326('0x6')]?{[_0x1e6909[_0x6326('0x6')]['field']]:_0x1e6909['filter'][_0x6326('0x8')]}:undefined;return _0x29aef3[_0x1e6909[_0x6326('0xd')]]['findAll']({'where':_0x77c4e,'raw':!![]})[_0x6326('0xa')](function(_0x4caef3){_0x416844[_0x6326('0xb')]=_[_0x6326('0xe')](_0x4caef3,function(_0x3d6ac0){return _0x3d6ac0[_0x6326('0xf')];});_0x3b056c(_0x416844);})[_0x6326('0xc')](function(_0x2c1879){_0x1ba67d(_0x2c1879);});});}function _0x55923a(_0x1104c5,_0x518e6f,_0x5945ee){if(!_0x518e6f)return Promise['resolve'](null);return new Promise(function(_0x51e7b9,_0x5d402d){return _0x29aef3['UserProfileResource'][_0x6326('0x9')]({'where':{'sectionId':_0x518e6f['id']},'raw':!![]})[_0x6326('0xa')](function(_0x2be78e){if(_0x1104c5['field']&&_0x1104c5['field']!=='id'){_0x518e6f[_0x6326('0xb')]=_[_0x6326('0xe')](_0x2be78e,function(_0x272b5c){return _0x272b5c[_0x1104c5[_0x6326('0x7')]];});}else{if(_0x5945ee===_0x6326('0x10')){_0x518e6f[_0x6326('0xb')]=_[_0x6326('0xe')](_0x2be78e,function(_0x53b437){return{'id':_0x53b437[_0x6326('0x11')],'type':_0x53b437['type']};});}else{_0x518e6f[_0x6326('0xb')]=_[_0x6326('0xe')](_0x2be78e,function(_0x2482ef){return _0x2482ef[_0x6326('0x11')];});}}_0x51e7b9(_0x518e6f);})[_0x6326('0xc')](function(_0x39fff1){_0x5d402d(_0x39fff1);});});}function _0x225555(_0x429bb0,_0x4781cc){var _0x2d0d00={'parentSections':[]};switch(_0x429bb0[_0x6326('0x12')]()){case'squareprojects':_0x2d0d00[_0x6326('0x13')]=_0x6326('0x14');break;case'odbc':_0x2d0d00['childModel']='SquareOdbc';break;case _0x6326('0x15'):_0x2d0d00['childModel']=_0x6326('0x16');_0x2d0d00[_0x6326('0x17')]=[{'name':'SquareProjects','field':_0x6326('0xf'),'foreignKey':_0x6326('0x18')}];break;case _0x6326('0x19'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x1a');break;case _0x6326('0x1b'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x1c');_0x2d0d00[_0x6326('0x17')]=[{'name':_0x6326('0x1d'),'field':'id','foreignKey':_0x6326('0x1e')}];break;case _0x6326('0x1f'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x20');break;case _0x6326('0x21'):_0x2d0d00[_0x6326('0x13')]='CmCompany';break;case _0x6326('0x22'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x23');break;case'chatqueues':_0x2d0d00[_0x6326('0x13')]='ChatQueue';break;case'chatwebsites':_0x2d0d00[_0x6326('0x13')]=_0x6326('0x24');break;case _0x6326('0x25'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x26');break;case _0x6326('0x27'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x28');break;case _0x6326('0x29'):case _0x6326('0x2a'):case _0x6326('0x2b'):_0x2d0d00[_0x6326('0x13')]='VoiceExtension';break;case _0x6326('0x2c'):_0x2d0d00[_0x6326('0x13')]='VoiceContext';break;case _0x6326('0x2d'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x2e');break;case'voicerecordings':_0x2d0d00[_0x6326('0x13')]='VoiceRecording';_0x2d0d00['parentSections']=[{'name':_0x6326('0x2f'),'field':_0x6326('0xf'),'foreignKey':_0x6326('0x30'),'model':'User','filter':{'field':_0x6326('0x31'),'value':['agent']}},{'name':_0x6326('0x32'),'field':'name','foreignKey':_0x6326('0x30'),'model':_0x6326('0x33'),'filter':{'field':_0x6326('0x31'),'value':[_0x6326('0x34')]}},{'name':_0x6326('0x35'),'field':_0x6326('0xf'),'foreignKey':'queue','model':_0x6326('0x36'),'filter':{'field':_0x6326('0x37'),'value':['inbound']}},{'name':_0x6326('0x38'),'field':'name','foreignKey':'queue','model':_0x6326('0x36'),'filter':{'field':_0x6326('0x37'),'value':[_0x6326('0x39')]}}];break;case _0x6326('0x3a'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x3b');break;case'chanspies':_0x2d0d00['childModel']=_0x6326('0x3c');break;case'voiceprefixes':_0x2d0d00[_0x6326('0x13')]='VoicePrefix';break;case _0x6326('0x3d'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x3e');break;case _0x6326('0x3f'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x40');break;case _0x6326('0x41'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x42');break;case _0x6326('0x43'):_0x2d0d00[_0x6326('0x13')]='MailSubstatus';break;case _0x6326('0x44'):_0x2d0d00['childModel']=_0x6326('0x45');break;case _0x6326('0x46'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x47');break;case'smsqueues':_0x2d0d00[_0x6326('0x13')]=_0x6326('0x48');break;case'smsaccounts':_0x2d0d00[_0x6326('0x13')]=_0x6326('0x49');break;case _0x6326('0x4a'):_0x2d0d00[_0x6326('0x13')]='WhatsappQueue';break;case _0x6326('0x4b'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x4c');break;case _0x6326('0x4d'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x4e');break;case _0x6326('0x4f'):case'queuecampaigns':_0x2d0d00[_0x6326('0x13')]=_0x6326('0x36');if(_0x4781cc){_0x2d0d00[_0x6326('0x17')]=[{'name':_0x6326('0x35')},{'name':'QueueCampaigns'}];}break;case _0x6326('0x50'):case'agents':case _0x6326('0x51'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x33');if(_0x4781cc){_0x2d0d00[_0x6326('0x17')]=[{'name':_0x6326('0x52'),'filter':{'field':'role','value':[_0x6326('0x53'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x6326('0x32')}];}break;case _0x6326('0x54'):_0x2d0d00['childModel']=_0x6326('0x55');break;case _0x6326('0x56'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x57');break;case _0x6326('0x58'):_0x2d0d00['childModel']='FreshdeskAccount';break;case _0x6326('0x59'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x5a');break;case _0x6326('0x5b'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x5c');break;case _0x6326('0x5d'):_0x2d0d00['childModel']=_0x6326('0x5e');break;case _0x6326('0x5f'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x33');break;case _0x6326('0x60'):_0x2d0d00['childModel']=_0x6326('0x61');break;case'dispositions':_0x2d0d00[_0x6326('0x13')]=_0x6326('0x62');break;case'customdashboards':_0x2d0d00[_0x6326('0x13')]='Dashboard';break;case _0x6326('0x63'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x64');break;case _0x6326('0x65'):_0x2d0d00['childModel']=_0x6326('0x66');break;case _0x6326('0x67'):_0x2d0d00['childModel']=_0x6326('0x68');break;case _0x6326('0x69'):_0x2d0d00[_0x6326('0x13')]='Sound';break;case _0x6326('0x6a'):_0x2d0d00[_0x6326('0x13')]='Tag';break;case _0x6326('0x6b'):_0x2d0d00['childModel']=_0x6326('0x6c');break;case _0x6326('0x6d'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x6e');break;case _0x6326('0x6f'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x70');break;case'variables':_0x2d0d00['childModel']='Variable';break;case _0x6326('0x71'):_0x2d0d00['childModel']=_0x6326('0x72');break;case _0x6326('0x73'):_0x2d0d00[_0x6326('0x13')]=_0x6326('0x10');_0x2d0d00[_0x6326('0x17')]=[{'name':'Reports','field':'id','foreignKey':_0x6326('0x74')}];break;case _0x6326('0x75'):_0x2d0d00['childModel']=_0x6326('0x76');break;}return _0x2d0d00;}function _0xdeba28(_0x1b6c29,_0x151a95){var _0x45e3d5=_0x1b6c29[_0x6326('0x77')](0x0)[_0x6326('0x78')]()+_0x1b6c29[_0x6326('0x79')](0x1);var _0x2c7a8d={'type':_0x29aef3[_0x6326('0x7a')]['QueryTypes'][_0x6326('0x7b')],'raw':!![]};return new Promise(function(_0x128ae0,_0x3fc712){var _0x92f535=squel['select']()['field'](_0x6326('0x7c')+_0x45e3d5+_0x6326('0x7d'),'id')[_0x6326('0x7')](_0x6326('0x7e'))[_0x6326('0x7f')]('user_has_'+_0x1b6c29+'_interactions','ui')[_0x6326('0x80')](_0x6326('0x81'),_0x151a95['id']);return _0x29aef3[_0x6326('0x82')][_0x6326('0x83')](_0x92f535['toString'](),_0x2c7a8d)[_0x6326('0xa')](function(_0x2c5f74){_0x151a95[_0x45e3d5+_0x6326('0x84')]=_0x2c5f74;_0x128ae0(_0x2c5f74);})[_0x6326('0xc')](function(_0x4197d6){_0x3fc712(_0x4197d6);});});}return _0x6b67c0[_0x6326('0x85')]('UserProfile',attributes,{'tableName':_0x6326('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5d5f4b){var _0x4877c8={'raw':_0x5d5f4b[_0x6326('0x83')]['raw'],'where':{}};var _0x14d66c={};var _0x56fb58={'count':0x0,'rows':[]};var _0x222e39=_0x5d5f4b[_0x6326('0x83')][_0x6326('0x87')];var _0x170639=_0x5d5f4b[_0x6326('0x83')][_0x6326('0x88')]||![];var _0xa2928e=_0x225555(_0x222e39,_0x170639);if(!_0xa2928e[_0x6326('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x222e39+'\x27');var _0x470f8e=[{'name':_0x222e39}];if(!_[_0x6326('0x89')](_0xa2928e[_0x6326('0x17')]))_0x470f8e=_0xa2928e[_0x6326('0x17')];var _0x26b86b=[];for(var _0x5599da=0x0;_0x5599da<_0x470f8e[_0x6326('0x8a')];_0x5599da++){_0x26b86b[_0x6326('0x8b')](_0x29aef3[_0x6326('0x8c')][_0x6326('0x8d')]({'where':{'userProfileId':_0x5d5f4b[_0x6326('0x8e')]['id'],'name':_0x470f8e[_0x5599da]['name']},'raw':!![]}));}return Promise[_0x6326('0x8f')](_0x26b86b)['then'](function(_0x4ae3a9){var _0x9313=_[_0x6326('0x6')](_0x4ae3a9,function(_0x70fe2f){return _0x70fe2f?_0x70fe2f:undefined;});var _0x1717f0=_['filter'](_0x470f8e,['ignore',!![]]);var _0x5cadb2=_['isEmpty'](_0x9313)&&_[_0x6326('0x89')](_0x1717f0)?null:_['union'](_0x1717f0,_0x9313);if(!_0x5cadb2)return null;var _0x303fef=[];for(var _0x5f6273=0x0;_0x5f6273<_0x5cadb2['length'];_0x5f6273++){var _0x4c1d7e=_['find'](_0x470f8e,function(_0x5e86bc){return _0x5cadb2[_0x5f6273]?_0x5e86bc['name']===_0x5cadb2[_0x5f6273][_0x6326('0xf')]:null;});if(_0x4c1d7e){if(_0x5cadb2[_0x5f6273]['ignore']){_0x303fef['push'](_0x265264(_0xa2928e['childModel'],_0x5cadb2[_0x5f6273]));}else{if(!_0x5cadb2[_0x5f6273]['autoAssociation']){_0x303fef[_0x6326('0x8b')](_0x55923a(_0x4c1d7e,_0x5cadb2[_0x5f6273],_0xa2928e['childModel']));}else{if(_0x4c1d7e[_0x6326('0xd')]){_0x303fef[_0x6326('0x8b')](_0x3590ab(_0x4c1d7e,_0x5cadb2[_0x5f6273]));}}}}}return Promise['all'](_0x303fef);})[_0x6326('0xa')](function(_0x50e78c){var _0xe8f08c=_0x50e78c;var _0x1dda23=null;if(_0xe8f08c){_0x1dda23=_0xe8f08c[_0x6326('0x8a')]===0x1?_0xe8f08c[0x0]:null;}if(!_0x1dda23&&!_0xe8f08c)return _0x56fb58;var _0x1e5aaa=_0x29aef3[_0xa2928e[_0x6326('0x13')]][_0x6326('0x90')];_0x14d66c[_0x6326('0xd')]=_[_0x6326('0x91')](_0x1e5aaa);_0x14d66c[_0x6326('0x83')]=_[_0x6326('0x91')](_0x5d5f4b[_0x6326('0x83')]);_0x14d66c[_0x6326('0x92')]=_[_0x6326('0x93')](_0x14d66c[_0x6326('0xd')],_0x14d66c[_0x6326('0x83')]);_0x4877c8[_0x6326('0x94')]=_[_0x6326('0x93')](_0x14d66c['model'],qs['fields'](_0x5d5f4b['query']['fields']));_0x4877c8[_0x6326('0x94')]=_0x4877c8['attributes']['length']?_0x4877c8['attributes']:_0x14d66c['model'];if(!_0x5d5f4b['query']['hasOwnProperty'](_0x6326('0x95'))){_0x4877c8[_0x6326('0x96')]=qs['limit'](_0x5d5f4b[_0x6326('0x83')][_0x6326('0x96')]);_0x4877c8[_0x6326('0x97')]=qs['offset'](_0x5d5f4b[_0x6326('0x83')][_0x6326('0x97')]);}_0x4877c8[_0x6326('0x98')]=qs[_0x6326('0x99')](_0x5d5f4b[_0x6326('0x83')]['sort']);_0x4877c8[_0x6326('0x80')]=qs['filters'](_['pick'](_0x5d5f4b[_0x6326('0x83')],_0x14d66c['filters']));if(_0x5d5f4b['query']['filter']){_0x4877c8['where']=_['merge'](_0x4877c8['where'],{'$or':_['map'](_0x1e5aaa,function(_0x128827){if(_0x128827[_0x6326('0x37')][_0x6326('0x9a')]!==_0x6326('0x9b')){var _0x590e06={};_0x590e06[_0x128827['field']]={'$like':'%'+_0x5d5f4b['query'][_0x6326('0x6')]+'%'};return _0x590e06;}})});}var _0x1e8d17=[];var _0x482231=null;var _0x21a82c={};if(_0x1dda23){_0x482231=_['find'](_0x470f8e,['name',_0x1dda23[_0x6326('0xf')]]);if(_0x482231[_0x6326('0x7')]){_0x21a82c={};if(_0xa2928e[_0x6326('0x13')]===_0x6326('0x10')){_0x21a82c[_0x482231[_0x6326('0x9c')]]=_[_0x6326('0xe')](_0x1dda23[_0x6326('0xb')],'id');}else{_0x21a82c[_0x482231['foreignKey']]=_0x1dda23['associatedResources'];}_0x1e8d17['push'](_0x21a82c);}else{_0x4877c8[_0x6326('0x80')]['id']=_0x1dda23['associatedResources'];}}else{for(var _0x48631a=0x0;_0x48631a<_0xe8f08c[_0x6326('0x8a')];_0x48631a++){_0x482231=_[_0x6326('0x8d')](_0x470f8e,['name',_0xe8f08c[_0x48631a][_0x6326('0xf')]]);if(_0x482231['field']){_0x21a82c={};_0x21a82c[_0x482231['foreignKey']]=_0xe8f08c[_0x48631a][_0x6326('0xb')];_0x1e8d17[_0x6326('0x8b')](_0x21a82c);}else{if(!_0x4877c8['where']['id'])_0x4877c8['where']['id']=[];_0xe8f08c[_0x48631a][_0x6326('0xb')][_0x6326('0x9d')](function(_0x28deab){_0x4877c8[_0x6326('0x80')]['id']['push'](_0x28deab);});}}}if(!_['isEmpty'](_0x1e8d17)){_0x4877c8[_0x6326('0x80')]=_[_0x6326('0x9e')](_0x4877c8[_0x6326('0x80')],{'$and':{'$or':_0x1e8d17}});}_0x4877c8=_[_0x6326('0x9e')]({},_0x4877c8,_0x5d5f4b[_0x6326('0x9f')]);if(_0x1dda23&&!_0x1dda23[_0x6326('0xa0')]&&_0xa2928e[_0x6326('0x13')]===_0x6326('0x10')){if(_0x5d5f4b['query'][_0x6326('0xa1')]){_0x4877c8['include']=[{'all':!![]}];}return _0x29aef3[_0xa2928e[_0x6326('0x13')]][_0x6326('0x9')](_0x4877c8)[_0x6326('0xa')](function(_0x3ad804){var _0x7ca6b2=[];_0x3ad804[_0x6326('0x9d')](function(_0x5597e1){var _0x280590;switch(_0x5597e1[_0x6326('0xa2')]){case'default':_0x280590=_[_0x6326('0x8d')](_0x1dda23[_0x6326('0xb')],function(_0x3104c5){return _0x3104c5['id']===_0x5597e1[_0x6326('0x74')]&&_0x3104c5[_0x6326('0x37')]===_0x6326('0xa3');});break;case _0x6326('0xa4'):_0x280590=_['find'](_0x1dda23[_0x6326('0xb')],function(_0x21ccbf){return _0x21ccbf['id']===_0x5597e1[_0x6326('0x74')]&&_0x21ccbf[_0x6326('0x37')]===_0x6326('0xa5');});break;}if(_0x280590)_0x7ca6b2['push'](_0x5597e1);});_0x56fb58[_0x6326('0xa6')]=_0x7ca6b2[_0x6326('0x8a')];_0x56fb58['rows']=_0x7ca6b2;return _0x56fb58;});}else{if(!_[_0x6326('0x89')](_0x5d5f4b[_0x6326('0x83')][_0x6326('0xa7')])){_0x4877c8[_0x6326('0x80')]['id']=_0x4877c8[_0x6326('0x80')]['id']?_[_0x6326('0x93')](_0x4877c8[_0x6326('0x80')]['id'],_0x5d5f4b[_0x6326('0x83')]['ids']):_0x5d5f4b[_0x6326('0x83')][_0x6326('0xa7')];}return _0x29aef3[_0xa2928e[_0x6326('0x13')]][_0x6326('0xa6')]({'where':_0x4877c8[_0x6326('0x80')]})[_0x6326('0xa')](function(_0xcb5683){_0x56fb58['count']=_0xcb5683;if(_0x5d5f4b[_0x6326('0x83')]['includeAll']){if(_0xa2928e[_0x6326('0x13')]==='CmContact'){_0x4877c8[_0x6326('0xa8')]=[{'model':_0x29aef3['Tag'],'as':_0x6326('0xa9'),'attributes':['id',_0x6326('0xf'),_0x6326('0xaa')],'required':_0x5d5f4b[_0x6326('0x83')][_0x6326('0xab')]?!![]:![]},{'model':_0x29aef3[_0x6326('0xac')],'as':_0x6326('0xad'),'attributes':['id','name',_0x6326('0xaa')],'through':_0x5d5f4b[_0x6326('0x83')][_0x6326('0xab')]?{'attributes':[],'where':{'TagId':_0x5d5f4b['query'][_0x6326('0xab')]||undefined}}:{},'required':_0x5d5f4b['query'][_0x6326('0xab')]?!![]:![]}];}else{_0x4877c8[_0x6326('0xa8')]=[{'all':!![]}];}}return _0x29aef3[_0xa2928e[_0x6326('0x13')]][_0x6326('0x9')](_0x4877c8);})[_0x6326('0xa')](function(_0x31de16){_0x56fb58[_0x6326('0xae')]=_0x31de16;if(_0x222e39==='Agents'&&_0x5d5f4b[_0x6326('0x83')]['openTabs']===_0x6326('0xaf')){var _0x44c21d=[];for(var _0x1f5816=0x0;_0x1f5816<_0x56fb58[_0x6326('0xae')]['length'];_0x1f5816++){_0x44c21d['push'](_0xdeba28(_0x6326('0xb0'),_0x56fb58[_0x6326('0xae')][_0x1f5816][_0x6326('0xb1')]));_0x44c21d[_0x6326('0x8b')](_0xdeba28('sms',_0x56fb58[_0x6326('0xae')][_0x1f5816]['dataValues']));_0x44c21d['push'](_0xdeba28(_0x6326('0xb2'),_0x56fb58[_0x6326('0xae')][_0x1f5816][_0x6326('0xb1')]));_0x44c21d[_0x6326('0x8b')](_0xdeba28(_0x6326('0xb3'),_0x56fb58[_0x6326('0xae')][_0x1f5816][_0x6326('0xb1')]));_0x44c21d[_0x6326('0x8b')](_0xdeba28(_0x6326('0xb4'),_0x56fb58[_0x6326('0xae')][_0x1f5816]['dataValues']));_0x44c21d['push'](_0xdeba28(_0x6326('0xb5'),_0x56fb58['rows'][_0x1f5816][_0x6326('0xb1')]));}return Promise['all'](_0x44c21d)['then'](function(){return _0x56fb58;});}return _0x56fb58;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 967a399..7a01698 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 _0x8fd4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x22808b,_0x329b6a){var _0x42cbd2=function(_0x256a8d){while(--_0x256a8d){_0x22808b['push'](_0x22808b['shift']());}};_0x42cbd2(++_0x329b6a);}(_0x8fd4,0x178));var _0x48fd=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x8fd4[_0xac151d];return _0x111dba;};'use strict';var _=require('lodash');var util=require(_0x48fd('0x0'));var moment=require(_0x48fd('0x1'));var BPromise=require(_0x48fd('0x2'));var rs=require(_0x48fd('0x3'));var fs=require('fs');var Redis=require(_0x48fd('0x4'));var db=require(_0x48fd('0x5'))['db'];var utils=require(_0x48fd('0x6'));var logger=require('../../config/logger')(_0x48fd('0x7'));var config=require(_0x48fd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x48fd('0x9')][_0x48fd('0xa')]({'port':0x232a});config[_0x48fd('0xb')]=_[_0x48fd('0xc')](config[_0x48fd('0xb')],{'host':_0x48fd('0xd'),'port':0x18eb});var socket=require(_0x48fd('0xe'))(new Redis(config[_0x48fd('0xb')]));require(_0x48fd('0xf'))[_0x48fd('0x10')](socket);function respondWithRpcPromise(_0x3df8bb,_0x4d6574,_0x74cd83){return new BPromise(function(_0x1e2a9d,_0x375065){return client[_0x48fd('0x11')](_0x3df8bb,_0x74cd83)[_0x48fd('0x12')](function(_0x285a28){logger[_0x48fd('0x13')](_0x48fd('0x14'),_0x4d6574,_0x48fd('0x15'));logger[_0x48fd('0x16')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x4d6574,_0x48fd('0x15'),JSON[_0x48fd('0x17')](_0x285a28));if(_0x285a28[_0x48fd('0x18')]){if(_0x285a28[_0x48fd('0x18')][_0x48fd('0x19')]===0x1f4){logger[_0x48fd('0x18')](_0x48fd('0x14'),_0x4d6574,_0x285a28[_0x48fd('0x18')][_0x48fd('0x1a')]);return _0x375065(_0x285a28[_0x48fd('0x18')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x4d6574,_0x285a28[_0x48fd('0x18')][_0x48fd('0x1a')]);return _0x1e2a9d(_0x285a28[_0x48fd('0x18')][_0x48fd('0x1a')]);}else{logger[_0x48fd('0x13')](_0x48fd('0x14'),_0x4d6574,_0x48fd('0x15'));_0x1e2a9d(_0x285a28[_0x48fd('0x1b')][_0x48fd('0x1a')]);}})[_0x48fd('0x1c')](function(_0x1d5393){logger[_0x48fd('0x18')](_0x48fd('0x14'),_0x4d6574,_0x1d5393);_0x375065(_0x1d5393);});});} \ No newline at end of file +var _0x933c=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x31cbec,_0x51de97){var _0x5b457a=function(_0x496399){while(--_0x496399){_0x31cbec['push'](_0x31cbec['shift']());}};_0x5b457a(++_0x51de97);}(_0x933c,0x99));var _0xc933=function(_0x2d3c72,_0x4d6446){_0x2d3c72=_0x2d3c72-0x0;var _0x1d2f5f=_0x933c[_0x2d3c72];return _0x1d2f5f;};'use strict';var _=require(_0xc933('0x0'));var util=require(_0xc933('0x1'));var moment=require(_0xc933('0x2'));var BPromise=require(_0xc933('0x3'));var rs=require(_0xc933('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc933('0x5'));var logger=require(_0xc933('0x6'))(_0xc933('0x7'));var config=require(_0xc933('0x8'));var jayson=require(_0xc933('0x9'));var client=jayson[_0xc933('0xa')]['http']({'port':0x232a});config[_0xc933('0xb')]=_['defaults'](config[_0xc933('0xb')],{'host':_0xc933('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc933('0xd'))[_0xc933('0xe')](socket);function respondWithRpcPromise(_0x5906c4,_0x4cd7cc,_0x36e8eb){return new BPromise(function(_0x3f785b,_0x325dbf){return client[_0xc933('0xf')](_0x5906c4,_0x36e8eb)[_0xc933('0x10')](function(_0x38f306){logger[_0xc933('0x11')](_0xc933('0x12'),_0x4cd7cc,'request\x20sent');logger['debug'](_0xc933('0x13'),_0x4cd7cc,_0xc933('0x14'),JSON[_0xc933('0x15')](_0x38f306));if(_0x38f306[_0xc933('0x16')]){if(_0x38f306[_0xc933('0x16')]['code']===0x1f4){logger[_0xc933('0x16')]('UserProfile,\x20%s,\x20%s',_0x4cd7cc,_0x38f306[_0xc933('0x16')][_0xc933('0x17')]);return _0x325dbf(_0x38f306[_0xc933('0x16')][_0xc933('0x17')]);}logger['error'](_0xc933('0x12'),_0x4cd7cc,_0x38f306['error']['message']);return _0x3f785b(_0x38f306[_0xc933('0x16')][_0xc933('0x17')]);}else{logger[_0xc933('0x11')](_0xc933('0x12'),_0x4cd7cc,_0xc933('0x14'));_0x3f785b(_0x38f306[_0xc933('0x18')][_0xc933('0x17')]);}})[_0xc933('0x19')](function(_0xe4fed5){logger[_0xc933('0x16')]('UserProfile,\x20%s,\x20%s',_0x4cd7cc,_0xe4fed5);_0x325dbf(_0xe4fed5);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 13e99c2..7ccfc3d 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 _0xb116=['update','emit','removeListener','./userProfile.events','remove'];(function(_0x58fa73,_0x5b2777){var _0x13b9d2=function(_0x25b953){while(--_0x25b953){_0x58fa73['push'](_0x58fa73['shift']());}};_0x13b9d2(++_0x5b2777);}(_0xb116,0x198));var _0x6b11=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xb116[_0x56e4e7];return _0x383618;};'use strict';var UserProfileEvents=require(_0x6b11('0x0'));var events=['save',_0x6b11('0x1'),_0x6b11('0x2')];function createListener(_0x2bc049,_0x39eb64){return function(_0x1f2ce2){_0x39eb64[_0x6b11('0x3')](_0x2bc049,_0x1f2ce2);};}function removeListener(_0x210a2a,_0x5691eb){return function(){UserProfileEvents[_0x6b11('0x4')](_0x210a2a,_0x5691eb);};}exports['register']=function(_0x505b19){for(var _0x3f34f1=0x0,_0x511f4c=events['length'];_0x3f34f1<_0x511f4c;_0x3f34f1++){var _0x131d31=events[_0x3f34f1];var _0x286cfd=createListener('userProfile:'+_0x131d31,_0x505b19);UserProfileEvents['on'](_0x131d31,_0x286cfd);}}; \ No newline at end of file +var _0xd5f6=['./userProfile.events','remove','update','userProfile:'];(function(_0x2316b9,_0x87059b){var _0x4405a9=function(_0xd9a3e1){while(--_0xd9a3e1){_0x2316b9['push'](_0x2316b9['shift']());}};_0x4405a9(++_0x87059b);}(_0xd5f6,0x7c));var _0x6d5f=function(_0x5cbf8d,_0x39f3c9){_0x5cbf8d=_0x5cbf8d-0x0;var _0x5c288f=_0xd5f6[_0x5cbf8d];return _0x5c288f;};'use strict';var UserProfileEvents=require(_0x6d5f('0x0'));var events=['save',_0x6d5f('0x1'),_0x6d5f('0x2')];function createListener(_0x1acabd,_0x191ac7){return function(_0x49ee9b){_0x191ac7['emit'](_0x1acabd,_0x49ee9b);};}function removeListener(_0x2460b5,_0x482827){return function(){UserProfileEvents['removeListener'](_0x2460b5,_0x482827);};}exports['register']=function(_0x317533){for(var _0x31bef1=0x0,_0x204840=events['length'];_0x31bef1<_0x204840;_0x31bef1++){var _0x44b8be=events[_0x31bef1];var _0x35244b=createListener(_0x6d5f('0x3')+_0x44b8be,_0x317533);UserProfileEvents['on'](_0x44b8be,_0x35244b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 753711b..b4fa25e 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 _0x801e=['./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13e854,_0x34f795){var _0x2ff220=function(_0x4d24b5){while(--_0x4d24b5){_0x13e854['push'](_0x13e854['shift']());}};_0x2ff220(++_0x34f795);}(_0x801e,0x15d));var _0xe801=function(_0x2efd8f,_0x492fa6){_0x2efd8f=_0x2efd8f-0x0;var _0xaccb7b=_0x801e[_0x2efd8f];return _0xaccb7b;};'use strict';var multer=require(_0xe801('0x0'));var util=require(_0xe801('0x1'));var path=require(_0xe801('0x2'));var timeout=require('connect-timeout');var express=require(_0xe801('0x3'));var router=express['Router']();var fs_extra=require(_0xe801('0x4'));var auth=require(_0xe801('0x5'));var interaction=require(_0xe801('0x6'));var config=require(_0xe801('0x7'));var controller=require(_0xe801('0x8'));router[_0xe801('0x9')]('/',auth['isAuthenticated'](),controller[_0xe801('0xa')]);router['get'](_0xe801('0xb'),auth[_0xe801('0xc')](),controller[_0xe801('0xd')]);router[_0xe801('0x9')](_0xe801('0xe'),auth[_0xe801('0xc')](),controller['show']);router[_0xe801('0xf')]('/',auth[_0xe801('0xc')](),controller[_0xe801('0x10')]);router[_0xe801('0x11')](_0xe801('0xe'),auth['isAuthenticated'](),controller[_0xe801('0x12')]);router['delete'](_0xe801('0xe'),auth[_0xe801('0xc')](),controller[_0xe801('0x13')]);module[_0xe801('0x14')]=router; \ No newline at end of file +var _0x8060=['isAuthenticated','describe','get','show','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','index','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8060,0x183));var _0x0806=function(_0x1e399a,_0x351c59){_0x1e399a=_0x1e399a-0x0;var _0x539897=_0x8060[_0x1e399a];return _0x539897;};'use strict';var multer=require(_0x0806('0x0'));var util=require(_0x0806('0x1'));var path=require(_0x0806('0x2'));var timeout=require(_0x0806('0x3'));var express=require(_0x0806('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0806('0x5'));var interaction=require(_0x0806('0x6'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0806('0x7')]);router['get'](_0x0806('0x8'),auth[_0x0806('0x9')](),controller[_0x0806('0xa')]);router[_0x0806('0xb')]('/:id',auth[_0x0806('0x9')](),controller[_0x0806('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0806('0xd')]);router[_0x0806('0xe')](_0x0806('0xf'),auth['isAuthenticated'](),controller[_0x0806('0x10')]);router['delete'](_0x0806('0xf'),auth[_0x0806('0x9')](),controller['destroy']);module[_0x0806('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 db03564..12b2c42 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 _0x841e=['INTEGER','sequelize','exports','STRING'];(function(_0x535ad4,_0x233c92){var _0x52fd03=function(_0x24b247){while(--_0x24b247){_0x535ad4['push'](_0x535ad4['shift']());}};_0x52fd03(++_0x233c92);}(_0x841e,0xf5));var _0xe841=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x841e[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xe841('0x0'));module[_0xe841('0x1')]={'name':{'type':Sequelize[_0xe841('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe841('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe841('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2a9b=['STRING','INTEGER','sequelize','exports'];(function(_0x371892,_0x4e511c){var _0xccb104=function(_0x26899c){while(--_0x26899c){_0x371892['push'](_0x371892['shift']());}};_0xccb104(++_0x4e511c);}(_0x2a9b,0x106));var _0xb2a9=function(_0x2bb321,_0x4cdf53){_0x2bb321=_0x2bb321-0x0;var _0x4e3ede=_0x2a9b[_0x2bb321];return _0x4e3ede;};'use strict';var Sequelize=require(_0xb2a9('0x0'));module[_0xb2a9('0x1')]={'name':{'type':Sequelize[_0xb2a9('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb2a9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb2a9('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index a614344..d7b5ebb 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 _0x9f0e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x420a21,_0x50a127){_0x420a21=_0x420a21-0x0;var _0x3c6aef=_0x9f0e[_0x420a21];return _0x3c6aef;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['UserProfileResource'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['UserProfileResource'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['UserProfileResource'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));}; \ No newline at end of file +var _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','UserProfileResource','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack'];(function(_0x150097,_0x203c26){var _0x143fd5=function(_0x299821){while(--_0x299821){_0x150097['push'](_0x150097['shift']());}};_0x143fd5(++_0x203c26);}(_0x2ef3,0xba));var _0x32ef=function(_0x285d76,_0x4f8469){_0x285d76=_0x285d76-0x0;var _0x317aa8=_0x2ef3[_0x285d76];return _0x317aa8;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['UserProfileResource'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['UserProfileResource'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['UserProfileResource']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index a46811d..8829feb 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 _0x605d=['exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./userProfileResource.attributes'];(function(_0x3319a4,_0x35416e){var _0x55e833=function(_0x212a30){while(--_0x212a30){_0x3319a4['push'](_0x3319a4['shift']());}};_0x55e833(++_0x35416e);}(_0x605d,0xae));var _0xd605=function(_0x522951,_0x2b6511){_0x522951=_0x522951-0x0;var _0x390bbb=_0x605d[_0x522951];return _0x390bbb;};'use strict';var _=require(_0xd605('0x0'));var util=require(_0xd605('0x1'));var logger=require(_0xd605('0x2'))('api');var moment=require(_0xd605('0x3'));var BPromise=require('bluebird');var rp=require(_0xd605('0x4'));var fs=require('fs');var path=require(_0xd605('0x5'));var rimraf=require(_0xd605('0x6'));var config=require('../../config/environment');var attributes=require(_0xd605('0x7'));module[_0xd605('0x8')]=function(_0x276f60,_0x3c2918){return _0x276f60[_0xd605('0x9')](_0xd605('0xa'),attributes,{'tableName':_0xd605('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xd605('0xc'),_0xd605('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72bf=['api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','util','../../config/logger'];(function(_0x23b93f,_0x2d519f){var _0x2167d1=function(_0x3e716f){while(--_0x3e716f){_0x23b93f['push'](_0x23b93f['shift']());}};_0x2167d1(++_0x2d519f);}(_0x72bf,0x139));var _0xf72b=function(_0x4791eb,_0x47fb48){_0x4791eb=_0x4791eb-0x0;var _0x1abc42=_0x72bf[_0x4791eb];return _0x1abc42;};'use strict';var _=require('lodash');var util=require(_0xf72b('0x0'));var logger=require(_0xf72b('0x1'))(_0xf72b('0x2'));var moment=require(_0xf72b('0x3'));var BPromise=require('bluebird');var rp=require(_0xf72b('0x4'));var fs=require('fs');var path=require(_0xf72b('0x5'));var rimraf=require(_0xf72b('0x6'));var config=require(_0xf72b('0x7'));var attributes=require(_0xf72b('0x8'));module[_0xf72b('0x9')]=function(_0x39f60a,_0x220c53){return _0x39f60a[_0xf72b('0xa')](_0xf72b('0xb'),attributes,{'tableName':_0xf72b('0xc'),'paranoid':![],'indexes':[{'name':_0xf72b('0xd'),'fields':['resourceId',_0xf72b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 7b5495b..16bcbad 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 _0x8143=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x154f21,_0x3c7f37){var _0x5ae16f=function(_0x214498){while(--_0x214498){_0x154f21['push'](_0x154f21['shift']());}};_0x5ae16f(++_0x3c7f37);}(_0x8143,0x1f4));var _0x3814=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8143[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3814('0x0'));var util=require(_0x3814('0x1'));var moment=require('moment');var BPromise=require(_0x3814('0x2'));var rs=require(_0x3814('0x3'));var fs=require('fs');var Redis=require(_0x3814('0x4'));var db=require(_0x3814('0x5'))['db'];var utils=require(_0x3814('0x6'));var logger=require(_0x3814('0x7'))(_0x3814('0x8'));var config=require(_0x3814('0x9'));var jayson=require(_0x3814('0xa'));var client=jayson['client'][_0x3814('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f1a46,_0x432ca4,_0x2c7347){return new BPromise(function(_0x168e5e,_0x5f30a7){return client[_0x3814('0xc')](_0x4f1a46,_0x2c7347)[_0x3814('0xd')](function(_0x51397d){logger['info'](_0x3814('0xe'),_0x432ca4,_0x3814('0xf'));logger['debug'](_0x3814('0x10'),_0x432ca4,_0x3814('0xf'),JSON[_0x3814('0x11')](_0x51397d));if(_0x51397d[_0x3814('0x12')]){if(_0x51397d[_0x3814('0x12')][_0x3814('0x13')]===0x1f4){logger['error'](_0x3814('0xe'),_0x432ca4,_0x51397d[_0x3814('0x12')][_0x3814('0x14')]);return _0x5f30a7(_0x51397d[_0x3814('0x12')][_0x3814('0x14')]);}logger[_0x3814('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x432ca4,_0x51397d[_0x3814('0x12')][_0x3814('0x14')]);return _0x168e5e(_0x51397d[_0x3814('0x12')][_0x3814('0x14')]);}else{logger[_0x3814('0x15')](_0x3814('0xe'),_0x432ca4,_0x3814('0xf'));_0x168e5e(_0x51397d[_0x3814('0x16')][_0x3814('0x14')]);}})[_0x3814('0x17')](function(_0x193ae0){logger[_0x3814('0x12')](_0x3814('0xe'),_0x432ca4,_0x193ae0);_0x5f30a7(_0x193ae0);});});} \ No newline at end of file +var _0x90b7=['info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x90b7,0xee));var _0x790b=function(_0x3ae3e0,_0x5d4d8c){_0x3ae3e0=_0x3ae3e0-0x0;var _0x25201c=_0x90b7[_0x3ae3e0];return _0x25201c;};'use strict';var _=require('lodash');var util=require(_0x790b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x790b('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x790b('0x2'))(_0x790b('0x3'));var config=require(_0x790b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x790b('0x5')][_0x790b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe391dd,_0x411e8b,_0x2a0c6d){return new BPromise(function(_0x1aa32a,_0x242b49){return client[_0x790b('0x7')](_0xe391dd,_0x2a0c6d)[_0x790b('0x8')](function(_0x27099e){logger[_0x790b('0x9')](_0x790b('0xa'),_0x411e8b,'request\x20sent');logger['debug'](_0x790b('0xb'),_0x411e8b,_0x790b('0xc'),JSON[_0x790b('0xd')](_0x27099e));if(_0x27099e[_0x790b('0xe')]){if(_0x27099e[_0x790b('0xe')][_0x790b('0xf')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x411e8b,_0x27099e[_0x790b('0xe')][_0x790b('0x10')]);return _0x242b49(_0x27099e['error']['message']);}logger[_0x790b('0xe')](_0x790b('0xa'),_0x411e8b,_0x27099e[_0x790b('0xe')][_0x790b('0x10')]);return _0x1aa32a(_0x27099e['error'][_0x790b('0x10')]);}else{logger[_0x790b('0x9')](_0x790b('0xa'),_0x411e8b,_0x790b('0xc'));_0x1aa32a(_0x27099e[_0x790b('0x11')][_0x790b('0x10')]);}})[_0x790b('0x12')](function(_0x10624f){logger[_0x790b('0xe')](_0x790b('0xa'),_0x411e8b,_0x10624f);_0x242b49(_0x10624f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9747134..32bcd8b 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 _0xb153=['Router','fs-extra','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb153,0xf3));var _0x3b15=function(_0x40fa68,_0x5446ef){_0x40fa68=_0x40fa68-0x0;var _0x4aa148=_0xb153[_0x40fa68];return _0x4aa148;};'use strict';var multer=require(_0x3b15('0x0'));var util=require(_0x3b15('0x1'));var path=require('path');var timeout=require(_0x3b15('0x2'));var express=require(_0x3b15('0x3'));var router=express[_0x3b15('0x4')]();var fs_extra=require(_0x3b15('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x3b15('0x6')]('/',auth[_0x3b15('0x7')](),controller[_0x3b15('0x8')]);router[_0x3b15('0x6')](_0x3b15('0x9'),auth['isAuthenticated'](),controller[_0x3b15('0xa')]);router[_0x3b15('0x6')](_0x3b15('0xb'),auth[_0x3b15('0x7')](),controller[_0x3b15('0xc')]);router['post']('/',auth[_0x3b15('0x7')](),controller[_0x3b15('0xd')]);router[_0x3b15('0xe')]('/:id',auth[_0x3b15('0x7')](),controller[_0x3b15('0xf')]);router[_0x3b15('0x10')](_0x3b15('0xb'),auth[_0x3b15('0x7')](),controller[_0x3b15('0x11')]);module[_0x3b15('0x12')]=router; \ No newline at end of file +var _0x0c55=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller'];(function(_0xdeef8c,_0x4e8387){var _0x423f72=function(_0x183f4b){while(--_0x183f4b){_0xdeef8c['push'](_0xdeef8c['shift']());}};_0x423f72(++_0x4e8387);}(_0x0c55,0x12a));var _0x50c5=function(_0x27ccb2,_0x2be54e){_0x27ccb2=_0x27ccb2-0x0;var _0x2be34b=_0x0c55[_0x27ccb2];return _0x2be34b;};'use strict';var multer=require('multer');var util=require(_0x50c5('0x0'));var path=require('path');var timeout=require(_0x50c5('0x1'));var express=require(_0x50c5('0x2'));var router=express['Router']();var fs_extra=require(_0x50c5('0x3'));var auth=require(_0x50c5('0x4'));var interaction=require(_0x50c5('0x5'));var config=require(_0x50c5('0x6'));var controller=require(_0x50c5('0x7'));router['get']('/',auth[_0x50c5('0x8')](),controller[_0x50c5('0x9')]);router['get'](_0x50c5('0xa'),auth[_0x50c5('0x8')](),controller[_0x50c5('0xb')]);router['get'](_0x50c5('0xc'),auth[_0x50c5('0x8')](),controller[_0x50c5('0xd')]);router[_0x50c5('0xe')]('/',auth[_0x50c5('0x8')](),controller['create']);router[_0x50c5('0xf')]('/:id',auth[_0x50c5('0x8')](),controller[_0x50c5('0x10')]);router[_0x50c5('0x11')]('/:id',auth[_0x50c5('0x8')](),controller['destroy']);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 9604730..6af4ae9 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 _0xb9be=['exports','STRING','INTEGER','BOOLEAN','join','getDataValue','crudPermissions','split','sequelize'];(function(_0x97877,_0x422052){var _0x5d9569=function(_0x60e479){while(--_0x60e479){_0x97877['push'](_0x97877['shift']());}};_0x5d9569(++_0x422052);}(_0xb9be,0xc5));var _0xeb9b=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0xb9be[_0x284a61];return _0x220e3c;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'name':{'type':Sequelize[_0xeb9b('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xeb9b('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xeb9b('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xeb9b('0x2')],'set':function(_0x288aaa){this['setDataValue']('crudPermissions',_0x288aaa?_0x288aaa[_0xeb9b('0x5')](''):[]);},'get':function(){return this[_0xeb9b('0x6')](_0xeb9b('0x7'))?this['getDataValue'](_0xeb9b('0x7'))[_0xeb9b('0x8')](''):[];}}}; \ No newline at end of file +var _0xe1e3=['getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x164609,_0x45890e){var _0x4a1a05=function(_0x3e9601){while(--_0x3e9601){_0x164609['push'](_0x164609['shift']());}};_0x4a1a05(++_0x45890e);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x467ec2,_0xb639d3){_0x467ec2=_0x467ec2-0x0;var _0x25dae9=_0xe1e3[_0x467ec2];return _0x25dae9;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x3e1e('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3e1e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3bacc){this[_0x3e1e('0x4')](_0x3e1e('0x5'),_0x3bacc?_0x3bacc[_0x3e1e('0x6')](''):[]);},'get':function(){return this[_0x3e1e('0x7')](_0x3e1e('0x5'))?this['getDataValue'](_0x3e1e('0x5'))[_0x3e1e('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 12c0684..9bcea84 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 _0x4c7e=['offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4c7e,0x77));var _0xe4c7=function(_0x2757fc,_0xfbd23){_0x2757fc=_0x2757fc-0x0;var _0x58efc4=_0x4c7e[_0x2757fc];return _0x58efc4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe4c7('0x0'));var jsonpatch=require(_0xe4c7('0x1'));var rp=require(_0xe4c7('0x2'));var moment=require(_0xe4c7('0x3'));var BPromise=require(_0xe4c7('0x4'));var Mustache=require(_0xe4c7('0x5'));var util=require(_0xe4c7('0x6'));var path=require('path');var sox=require(_0xe4c7('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4c7('0x9'));var squel=require(_0xe4c7('0xa'));var crypto=require(_0xe4c7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe4c7('0xc'));var toCsv=require(_0xe4c7('0xd'));var querystring=require(_0xe4c7('0xe'));var Papa=require(_0xe4c7('0xf'));var Redis=require('ioredis');var authService=require(_0xe4c7('0x10'));var qs=require(_0xe4c7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4c7('0x12'))(_0xe4c7('0x13'));var utils=require(_0xe4c7('0x14'));var config=require(_0xe4c7('0x15'));var licenseUtil=require(_0xe4c7('0x16'));var db=require(_0xe4c7('0x17'))['db'];function respondWithStatusCode(_0x52f78b,_0x25111d){_0x25111d=_0x25111d||0xcc;return function(_0x5da81e){if(_0x5da81e){return _0x52f78b['sendStatus'](_0x25111d);}return _0x52f78b[_0xe4c7('0x18')](_0x25111d)[_0xe4c7('0x19')]();};}function respondWithResult(_0x83eb93,_0x2c9dd1){_0x2c9dd1=_0x2c9dd1||0xc8;return function(_0x29cc76){if(_0x29cc76){return _0x83eb93[_0xe4c7('0x18')](_0x2c9dd1)[_0xe4c7('0x1a')](_0x29cc76);}};}function respondWithFilteredResult(_0x58038b,_0x247668){return function(_0x53cf66){if(_0x53cf66){var _0x3dcb09=typeof _0x247668[_0xe4c7('0x1b')]===_0xe4c7('0x1c')&&typeof _0x247668[_0xe4c7('0x1d')]===_0xe4c7('0x1c');var _0x131779=_0x53cf66['count'];var _0x3ffe6d=_0x3dcb09?0x0:_0x247668[_0xe4c7('0x1b')];var _0x382432=_0x3dcb09?_0x53cf66[_0xe4c7('0x1e')]:_0x247668[_0xe4c7('0x1b')]+_0x247668[_0xe4c7('0x1d')];var _0x557ebb;if(_0x382432>=_0x131779){_0x382432=_0x131779;_0x557ebb=0xc8;}else{_0x557ebb=0xce;}_0x58038b[_0xe4c7('0x18')](_0x557ebb);return _0x58038b['set'](_0xe4c7('0x1f'),_0x3ffe6d+'-'+_0x382432+'/'+_0x131779)['json'](_0x53cf66);}return null;};}function patchUpdates(_0x505386){return function(_0x554c5d){try{jsonpatch[_0xe4c7('0x20')](_0x554c5d,_0x505386,!![]);}catch(_0x343628){return BPromise[_0xe4c7('0x21')](_0x343628);}return _0x554c5d[_0xe4c7('0x22')]();};}function saveUpdates(_0x29fd0d,_0x4a3445){return function(_0x3cabfd){if(_0x3cabfd){return _0x3cabfd['update'](_0x29fd0d)[_0xe4c7('0x23')](function(_0x3c5cdd){return _0x3c5cdd;});}return null;};}function removeEntity(_0x350e5f,_0x2ac0a3){return function(_0x132409){if(_0x132409){return _0x132409[_0xe4c7('0x24')]()[_0xe4c7('0x23')](function(){_0x350e5f['status'](0xcc)[_0xe4c7('0x19')]();});}};}function handleEntityNotFound(_0x62908,_0x265806){return function(_0x34caef){if(!_0x34caef){_0x62908[_0xe4c7('0x25')](0x194);}return _0x34caef;};}function handleError(_0x35642e,_0x35798e){_0x35798e=_0x35798e||0x1f4;return function(_0xfb262d){logger[_0xe4c7('0x26')](_0xfb262d['stack']);if(_0xfb262d[_0xe4c7('0x27')]){delete _0xfb262d[_0xe4c7('0x27')];}_0x35642e[_0xe4c7('0x18')](_0x35798e)['send'](_0xfb262d);};}exports[_0xe4c7('0x28')]=function(_0x3db041,_0x59f24d){var _0x498a0a={},_0x5bdaf4={},_0x401886={'count':0x0,'rows':[]};var _0x30b505=_[_0xe4c7('0x29')](db[_0xe4c7('0x2a')][_0xe4c7('0x2b')],function(_0x2fe1e4){return{'name':_0x2fe1e4[_0xe4c7('0x2c')],'type':_0x2fe1e4[_0xe4c7('0x2d')][_0xe4c7('0x2e')]};});_0x5bdaf4[_0xe4c7('0x2f')]=_[_0xe4c7('0x29')](_0x30b505,_0xe4c7('0x27'));_0x5bdaf4[_0xe4c7('0x30')]=_['keys'](_0x3db041[_0xe4c7('0x30')]);_0x5bdaf4[_0xe4c7('0x31')]=_[_0xe4c7('0x32')](_0x5bdaf4['model'],_0x5bdaf4[_0xe4c7('0x30')]);_0x498a0a['attributes']=_['intersection'](_0x5bdaf4[_0xe4c7('0x2f')],qs[_0xe4c7('0x33')](_0x3db041[_0xe4c7('0x30')][_0xe4c7('0x33')]));_0x498a0a[_0xe4c7('0x34')]=_0x498a0a[_0xe4c7('0x34')][_0xe4c7('0x35')]?_0x498a0a[_0xe4c7('0x34')]:_0x5bdaf4[_0xe4c7('0x2f')];if(!_0x3db041[_0xe4c7('0x30')]['hasOwnProperty']('nolimit')){_0x498a0a[_0xe4c7('0x1d')]=qs[_0xe4c7('0x1d')](_0x3db041[_0xe4c7('0x30')][_0xe4c7('0x1d')]);_0x498a0a['offset']=qs[_0xe4c7('0x1b')](_0x3db041[_0xe4c7('0x30')]['offset']);}_0x498a0a[_0xe4c7('0x36')]=qs[_0xe4c7('0x37')](_0x3db041[_0xe4c7('0x30')][_0xe4c7('0x37')]);_0x498a0a[_0xe4c7('0x38')]=qs[_0xe4c7('0x31')](_[_0xe4c7('0x39')](_0x3db041['query'],_0x5bdaf4[_0xe4c7('0x31')]),_0x30b505);if(_0x3db041[_0xe4c7('0x30')][_0xe4c7('0x3a')]){_0x498a0a[_0xe4c7('0x38')]=_[_0xe4c7('0x3b')](_0x498a0a[_0xe4c7('0x38')],{'$or':_[_0xe4c7('0x29')](_0x30b505,function(_0xc158c6){if(_0xc158c6[_0xe4c7('0x2d')]!==_0xe4c7('0x3c')){var _0x1df612={};_0x1df612[_0xc158c6[_0xe4c7('0x27')]]={'$like':'%'+_0x3db041[_0xe4c7('0x30')][_0xe4c7('0x3a')]+'%'};return _0x1df612;}})});}_0x498a0a=_['merge']({},_0x498a0a,_0x3db041['options']);var _0x48dfea={'where':_0x498a0a[_0xe4c7('0x38')]};return db[_0xe4c7('0x2a')][_0xe4c7('0x1e')](_0x48dfea)[_0xe4c7('0x23')](function(_0x4cc501){_0x401886[_0xe4c7('0x1e')]=_0x4cc501;if(_0x3db041[_0xe4c7('0x30')][_0xe4c7('0x3d')]){_0x498a0a[_0xe4c7('0x3e')]=[{'all':!![]}];}return db[_0xe4c7('0x2a')][_0xe4c7('0x3f')](_0x498a0a);})[_0xe4c7('0x23')](function(_0x43ea0e){_0x401886['rows']=_0x43ea0e;return _0x401886;})['then'](respondWithFilteredResult(_0x59f24d,_0x498a0a))[_0xe4c7('0x40')](handleError(_0x59f24d,null));};exports[_0xe4c7('0x41')]=function(_0x2a9f71,_0x21f57b){var _0x28f5c9={'raw':![],'where':{'id':_0x2a9f71[_0xe4c7('0x42')]['id']}},_0x56a900={};_0x56a900[_0xe4c7('0x2f')]=_[_0xe4c7('0x43')](db[_0xe4c7('0x2a')][_0xe4c7('0x2b')]);_0x56a900[_0xe4c7('0x30')]=_['keys'](_0x2a9f71['query']);_0x56a900[_0xe4c7('0x31')]=_[_0xe4c7('0x32')](_0x56a900['model'],_0x56a900[_0xe4c7('0x30')]);_0x28f5c9['attributes']=_['intersection'](_0x56a900[_0xe4c7('0x2f')],qs['fields'](_0x2a9f71[_0xe4c7('0x30')][_0xe4c7('0x33')]));_0x28f5c9[_0xe4c7('0x34')]=_0x28f5c9[_0xe4c7('0x34')][_0xe4c7('0x35')]?_0x28f5c9['attributes']:_0x56a900[_0xe4c7('0x2f')];if(_0x2a9f71[_0xe4c7('0x30')][_0xe4c7('0x3d')]){_0x28f5c9[_0xe4c7('0x3e')]=[{'all':!![]}];}_0x28f5c9=_[_0xe4c7('0x3b')]({},_0x28f5c9,_0x2a9f71[_0xe4c7('0x44')]);return db[_0xe4c7('0x2a')][_0xe4c7('0x45')](_0x28f5c9)[_0xe4c7('0x23')](handleEntityNotFound(_0x21f57b,null))['then'](respondWithResult(_0x21f57b,null))['catch'](handleError(_0x21f57b,null));};exports[_0xe4c7('0x46')]=function(_0x46dd01,_0x5558c9){return db['UserProfileSection']['create'](_0x46dd01[_0xe4c7('0x47')],{})[_0xe4c7('0x23')](respondWithResult(_0x5558c9,0xc9))[_0xe4c7('0x40')](handleError(_0x5558c9,null));};exports['update']=function(_0x5633f0,_0x4ca818){if(_0x5633f0[_0xe4c7('0x47')]['id']){delete _0x5633f0['body']['id'];}return db['UserProfileSection'][_0xe4c7('0x45')]({'where':{'id':_0x5633f0[_0xe4c7('0x42')]['id']}})[_0xe4c7('0x23')](handleEntityNotFound(_0x4ca818,null))['then'](saveUpdates(_0x5633f0['body'],null))['then'](respondWithResult(_0x4ca818,null))[_0xe4c7('0x40')](handleError(_0x4ca818,null));};exports['destroy']=function(_0xc6052f,_0x3f9351){return db[_0xe4c7('0x2a')][_0xe4c7('0x45')]({'where':{'id':_0xc6052f['params']['id']}})[_0xe4c7('0x23')](handleEntityNotFound(_0x3f9351,null))[_0xe4c7('0x23')](removeEntity(_0x3f9351,null))[_0xe4c7('0x40')](handleError(_0x3f9351,null));};exports['describe']=function(_0x883ba2,_0x3f7526){return db['UserProfileSection'][_0xe4c7('0x48')]()[_0xe4c7('0x23')](respondWithResult(_0x3f7526,null))[_0xe4c7('0x40')](handleError(_0x3f7526,null));}; \ No newline at end of file +var _0x30b1=['sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','name','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x5f0dc6,_0x490fe6){var _0x2aa221=function(_0x427661){while(--_0x427661){_0x5f0dc6['push'](_0x5f0dc6['shift']());}};_0x2aa221(++_0x490fe6);}(_0x30b1,0x120));var _0x130b=function(_0x26c728,_0x4066db){_0x26c728=_0x26c728-0x0;var _0x5b7b9d=_0x30b1[_0x26c728];return _0x5b7b9d;};'use strict';var emlformat=require(_0x130b('0x0'));var rimraf=require(_0x130b('0x1'));var zipdir=require(_0x130b('0x2'));var jsonpatch=require(_0x130b('0x3'));var rp=require('request-promise');var moment=require(_0x130b('0x4'));var BPromise=require(_0x130b('0x5'));var Mustache=require(_0x130b('0x6'));var util=require(_0x130b('0x7'));var path=require('path');var sox=require(_0x130b('0x8'));var csv=require('to-csv');var ejs=require(_0x130b('0x9'));var fs=require('fs');var fs_extra=require(_0x130b('0xa'));var _=require('lodash');var squel=require(_0x130b('0xb'));var crypto=require(_0x130b('0xc'));var jsforce=require(_0x130b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x130b('0xe'));var querystring=require(_0x130b('0xf'));var Papa=require(_0x130b('0x10'));var Redis=require(_0x130b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x130b('0x12'));var hardwareService=require(_0x130b('0x13'));var logger=require(_0x130b('0x14'))(_0x130b('0x15'));var utils=require(_0x130b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x130b('0x17'));var db=require(_0x130b('0x18'))['db'];function respondWithStatusCode(_0x352c55,_0x3bf966){_0x3bf966=_0x3bf966||0xcc;return function(_0x418f12){if(_0x418f12){return _0x352c55[_0x130b('0x19')](_0x3bf966);}return _0x352c55[_0x130b('0x1a')](_0x3bf966)[_0x130b('0x1b')]();};}function respondWithResult(_0xffc71,_0x55e82c){_0x55e82c=_0x55e82c||0xc8;return function(_0x9c1e86){if(_0x9c1e86){return _0xffc71[_0x130b('0x1a')](_0x55e82c)[_0x130b('0x1c')](_0x9c1e86);}};}function respondWithFilteredResult(_0x14907c,_0x152496){return function(_0x43d87b){if(_0x43d87b){var _0x8471db=typeof _0x152496[_0x130b('0x1d')]===_0x130b('0x1e')&&typeof _0x152496[_0x130b('0x1f')]===_0x130b('0x1e');var _0x5ae77a=_0x43d87b['count'];var _0x4966b2=_0x8471db?0x0:_0x152496[_0x130b('0x1d')];var _0x344260=_0x8471db?_0x43d87b[_0x130b('0x20')]:_0x152496[_0x130b('0x1d')]+_0x152496['limit'];var _0x4e4cea;if(_0x344260>=_0x5ae77a){_0x344260=_0x5ae77a;_0x4e4cea=0xc8;}else{_0x4e4cea=0xce;}_0x14907c[_0x130b('0x1a')](_0x4e4cea);return _0x14907c[_0x130b('0x21')]('Content-Range',_0x4966b2+'-'+_0x344260+'/'+_0x5ae77a)[_0x130b('0x1c')](_0x43d87b);}return null;};}function patchUpdates(_0x46b00e){return function(_0x19d1bd){try{jsonpatch['apply'](_0x19d1bd,_0x46b00e,!![]);}catch(_0x1901f8){return BPromise[_0x130b('0x22')](_0x1901f8);}return _0x19d1bd['save']();};}function saveUpdates(_0x2bf399,_0x24da18){return function(_0x4d9c9f){if(_0x4d9c9f){return _0x4d9c9f[_0x130b('0x23')](_0x2bf399)[_0x130b('0x24')](function(_0x1c18ba){return _0x1c18ba;});}return null;};}function removeEntity(_0x4717aa,_0x1e765c){return function(_0x52c7c7){if(_0x52c7c7){return _0x52c7c7[_0x130b('0x25')]()[_0x130b('0x24')](function(){_0x4717aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cdb94,_0x5dc248){return function(_0x1ee028){if(!_0x1ee028){_0x2cdb94[_0x130b('0x19')](0x194);}return _0x1ee028;};}function handleError(_0x6735f8,_0x5b364f){_0x5b364f=_0x5b364f||0x1f4;return function(_0x4a4f0d){logger[_0x130b('0x26')](_0x4a4f0d[_0x130b('0x27')]);if(_0x4a4f0d['name']){delete _0x4a4f0d['name'];}_0x6735f8[_0x130b('0x1a')](_0x5b364f)[_0x130b('0x28')](_0x4a4f0d);};}exports[_0x130b('0x29')]=function(_0xf6272d,_0x355126){var _0x488777={},_0x317c7d={},_0x5f2770={'count':0x0,'rows':[]};var _0x3c108f=_[_0x130b('0x2a')](db[_0x130b('0x2b')][_0x130b('0x2c')],function(_0x457c78){return{'name':_0x457c78[_0x130b('0x2d')],'type':_0x457c78[_0x130b('0x2e')][_0x130b('0x2f')]};});_0x317c7d['model']=_[_0x130b('0x2a')](_0x3c108f,_0x130b('0x30'));_0x317c7d[_0x130b('0x31')]=_['keys'](_0xf6272d[_0x130b('0x31')]);_0x317c7d[_0x130b('0x32')]=_['intersection'](_0x317c7d[_0x130b('0x33')],_0x317c7d[_0x130b('0x31')]);_0x488777[_0x130b('0x34')]=_[_0x130b('0x35')](_0x317c7d[_0x130b('0x33')],qs[_0x130b('0x36')](_0xf6272d[_0x130b('0x31')][_0x130b('0x36')]));_0x488777[_0x130b('0x34')]=_0x488777[_0x130b('0x34')]['length']?_0x488777['attributes']:_0x317c7d[_0x130b('0x33')];if(!_0xf6272d['query'][_0x130b('0x37')]('nolimit')){_0x488777['limit']=qs['limit'](_0xf6272d[_0x130b('0x31')][_0x130b('0x1f')]);_0x488777['offset']=qs[_0x130b('0x1d')](_0xf6272d[_0x130b('0x31')][_0x130b('0x1d')]);}_0x488777[_0x130b('0x38')]=qs[_0x130b('0x39')](_0xf6272d[_0x130b('0x31')][_0x130b('0x39')]);_0x488777['where']=qs[_0x130b('0x32')](_[_0x130b('0x3a')](_0xf6272d[_0x130b('0x31')],_0x317c7d[_0x130b('0x32')]),_0x3c108f);if(_0xf6272d['query'][_0x130b('0x3b')]){_0x488777[_0x130b('0x3c')]=_['merge'](_0x488777[_0x130b('0x3c')],{'$or':_['map'](_0x3c108f,function(_0x21d936){if(_0x21d936[_0x130b('0x2e')]!==_0x130b('0x3d')){var _0x3b3886={};_0x3b3886[_0x21d936[_0x130b('0x30')]]={'$like':'%'+_0xf6272d[_0x130b('0x31')][_0x130b('0x3b')]+'%'};return _0x3b3886;}})});}_0x488777=_[_0x130b('0x3e')]({},_0x488777,_0xf6272d[_0x130b('0x3f')]);var _0xe2d0ad={'where':_0x488777[_0x130b('0x3c')]};return db['UserProfileSection'][_0x130b('0x20')](_0xe2d0ad)[_0x130b('0x24')](function(_0x17263c){_0x5f2770['count']=_0x17263c;if(_0xf6272d[_0x130b('0x31')][_0x130b('0x40')]){_0x488777['include']=[{'all':!![]}];}return db[_0x130b('0x2b')]['findAll'](_0x488777);})[_0x130b('0x24')](function(_0x2854c7){_0x5f2770[_0x130b('0x41')]=_0x2854c7;return _0x5f2770;})[_0x130b('0x24')](respondWithFilteredResult(_0x355126,_0x488777))[_0x130b('0x42')](handleError(_0x355126,null));};exports['show']=function(_0xe1822f,_0x2d4f1d){var _0x1839cb={'raw':![],'where':{'id':_0xe1822f[_0x130b('0x43')]['id']}},_0x479df9={};_0x479df9['model']=_[_0x130b('0x44')](db[_0x130b('0x2b')][_0x130b('0x2c')]);_0x479df9[_0x130b('0x31')]=_[_0x130b('0x44')](_0xe1822f['query']);_0x479df9[_0x130b('0x32')]=_[_0x130b('0x35')](_0x479df9[_0x130b('0x33')],_0x479df9[_0x130b('0x31')]);_0x1839cb[_0x130b('0x34')]=_['intersection'](_0x479df9[_0x130b('0x33')],qs[_0x130b('0x36')](_0xe1822f['query'][_0x130b('0x36')]));_0x1839cb['attributes']=_0x1839cb[_0x130b('0x34')][_0x130b('0x45')]?_0x1839cb[_0x130b('0x34')]:_0x479df9[_0x130b('0x33')];if(_0xe1822f[_0x130b('0x31')][_0x130b('0x40')]){_0x1839cb['include']=[{'all':!![]}];}_0x1839cb=_[_0x130b('0x3e')]({},_0x1839cb,_0xe1822f['options']);return db[_0x130b('0x2b')][_0x130b('0x46')](_0x1839cb)[_0x130b('0x24')](handleEntityNotFound(_0x2d4f1d,null))[_0x130b('0x24')](respondWithResult(_0x2d4f1d,null))[_0x130b('0x42')](handleError(_0x2d4f1d,null));};exports[_0x130b('0x47')]=function(_0x578491,_0x143c04){return db[_0x130b('0x2b')][_0x130b('0x47')](_0x578491[_0x130b('0x48')],{})[_0x130b('0x24')](respondWithResult(_0x143c04,0xc9))[_0x130b('0x42')](handleError(_0x143c04,null));};exports[_0x130b('0x23')]=function(_0x1cc273,_0x423caa){if(_0x1cc273['body']['id']){delete _0x1cc273[_0x130b('0x48')]['id'];}return db[_0x130b('0x2b')]['find']({'where':{'id':_0x1cc273['params']['id']}})['then'](handleEntityNotFound(_0x423caa,null))['then'](saveUpdates(_0x1cc273[_0x130b('0x48')],null))[_0x130b('0x24')](respondWithResult(_0x423caa,null))['catch'](handleError(_0x423caa,null));};exports['destroy']=function(_0x2a0899,_0x354f09){return db[_0x130b('0x2b')]['find']({'where':{'id':_0x2a0899['params']['id']}})[_0x130b('0x24')](handleEntityNotFound(_0x354f09,null))[_0x130b('0x24')](removeEntity(_0x354f09,null))[_0x130b('0x42')](handleError(_0x354f09,null));};exports[_0x130b('0x49')]=function(_0x580059,_0x21a498){return db[_0x130b('0x2b')][_0x130b('0x49')]()[_0x130b('0x24')](respondWithResult(_0x21a498,null))[_0x130b('0x42')](handleError(_0x21a498,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 49afc2d..fd7d55b 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 _0x20de=['bluebird','request-promise','path','./userProfileSection.attributes','define','compositeIndex','userProfileId','lodash','util','../../config/logger','api'];(function(_0x5084dc,_0x582f15){var _0x596baf=function(_0x13bd8b){while(--_0x13bd8b){_0x5084dc['push'](_0x5084dc['shift']());}};_0x596baf(++_0x582f15);}(_0x20de,0xd8));var _0xe20d=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x20de[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0xe20d('0x0'));var util=require(_0xe20d('0x1'));var logger=require(_0xe20d('0x2'))(_0xe20d('0x3'));var moment=require('moment');var BPromise=require(_0xe20d('0x4'));var rp=require(_0xe20d('0x5'));var fs=require('fs');var path=require(_0xe20d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe20d('0x7'));module['exports']=function(_0x128960,_0x529f8f){return _0x128960[_0xe20d('0x8')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xe20d('0x9'),'fields':['sectionId',_0xe20d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6401=['user_profile_has_sections','compositeIndex','userProfileId','lodash','util','api','moment','bluebird','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6401,0x93));var _0x1640=function(_0x3a25d9,_0x428685){_0x3a25d9=_0x3a25d9-0x0;var _0x17df23=_0x6401[_0x3a25d9];return _0x17df23;};'use strict';var _=require(_0x1640('0x0'));var util=require(_0x1640('0x1'));var logger=require('../../config/logger')(_0x1640('0x2'));var moment=require(_0x1640('0x3'));var BPromise=require(_0x1640('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1640('0x5'));module[_0x1640('0x6')]=function(_0x4117a4,_0x9c584e){return _0x4117a4[_0x1640('0x7')](_0x1640('0x8'),attributes,{'tableName':_0x1640('0x9'),'paranoid':![],'indexes':[{'name':_0x1640('0xa'),'fields':['sectionId',_0x1640('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 67d95e8..0754288 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 _0x497d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileSection,\x20%s,\x20%s','message','result','util','moment'];(function(_0x41cbc2,_0x26f738){var _0x378cb1=function(_0x13afd9){while(--_0x13afd9){_0x41cbc2['push'](_0x41cbc2['shift']());}};_0x378cb1(++_0x26f738);}(_0x497d,0x1a0));var _0xd497=function(_0x1e587e,_0x5aac8b){_0x1e587e=_0x1e587e-0x0;var _0x253b8f=_0x497d[_0x1e587e];return _0x253b8f;};'use strict';var _=require('lodash');var util=require(_0xd497('0x0'));var moment=require(_0xd497('0x1'));var BPromise=require(_0xd497('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd497('0x3'));var db=require(_0xd497('0x4'))['db'];var utils=require(_0xd497('0x5'));var logger=require(_0xd497('0x6'))(_0xd497('0x7'));var config=require(_0xd497('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd497('0x9')][_0xd497('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x156dc8,_0x18ed13,_0x11bb96){return new BPromise(function(_0xdef1fa,_0x2039df){return client['request'](_0x156dc8,_0x11bb96)['then'](function(_0x3d9f07){logger[_0xd497('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x18ed13,_0xd497('0xc'));logger['debug'](_0xd497('0xd'),_0x18ed13,_0xd497('0xc'),JSON[_0xd497('0xe')](_0x3d9f07));if(_0x3d9f07[_0xd497('0xf')]){if(_0x3d9f07[_0xd497('0xf')]['code']===0x1f4){logger['error'](_0xd497('0x10'),_0x18ed13,_0x3d9f07[_0xd497('0xf')][_0xd497('0x11')]);return _0x2039df(_0x3d9f07[_0xd497('0xf')]['message']);}logger['error'](_0xd497('0x10'),_0x18ed13,_0x3d9f07[_0xd497('0xf')][_0xd497('0x11')]);return _0xdef1fa(_0x3d9f07[_0xd497('0xf')][_0xd497('0x11')]);}else{logger['info'](_0xd497('0x10'),_0x18ed13,_0xd497('0xc'));_0xdef1fa(_0x3d9f07[_0xd497('0x12')][_0xd497('0x11')]);}})['catch'](function(_0x300110){logger[_0xd497('0xf')](_0xd497('0x10'),_0x18ed13,_0x300110);_0x2039df(_0x300110);});});} \ No newline at end of file +var _0xa74a=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x16d83a,_0x4abbd4){var _0xb1acae=function(_0x4bf072){while(--_0x4bf072){_0x16d83a['push'](_0x16d83a['shift']());}};_0xb1acae(++_0x4abbd4);}(_0xa74a,0x66));var _0xaa74=function(_0x4d4e80,_0x439a0c){_0x4d4e80=_0x4d4e80-0x0;var _0x6c9d7f=_0xa74a[_0x4d4e80];return _0x6c9d7f;};'use strict';var _=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var moment=require(_0xaa74('0x2'));var BPromise=require(_0xaa74('0x3'));var rs=require(_0xaa74('0x4'));var fs=require('fs');var Redis=require(_0xaa74('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa74('0x6'));var logger=require(_0xaa74('0x7'))(_0xaa74('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaa74('0x9')][_0xaa74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44002b,_0x3aca05,_0x10e7ce){return new BPromise(function(_0x5a3684,_0x197336){return client['request'](_0x44002b,_0x10e7ce)[_0xaa74('0xb')](function(_0x502005){logger[_0xaa74('0xc')](_0xaa74('0xd'),_0x3aca05,'request\x20sent');logger[_0xaa74('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3aca05,_0xaa74('0xf'),JSON[_0xaa74('0x10')](_0x502005));if(_0x502005['error']){if(_0x502005[_0xaa74('0x11')][_0xaa74('0x12')]===0x1f4){logger[_0xaa74('0x11')](_0xaa74('0xd'),_0x3aca05,_0x502005[_0xaa74('0x11')][_0xaa74('0x13')]);return _0x197336(_0x502005[_0xaa74('0x11')][_0xaa74('0x13')]);}logger[_0xaa74('0x11')](_0xaa74('0xd'),_0x3aca05,_0x502005[_0xaa74('0x11')]['message']);return _0x5a3684(_0x502005[_0xaa74('0x11')][_0xaa74('0x13')]);}else{logger['info'](_0xaa74('0xd'),_0x3aca05,'request\x20sent');_0x5a3684(_0x502005['result']['message']);}})['catch'](function(_0xbe83ac){logger[_0xaa74('0x11')](_0xaa74('0xd'),_0x3aca05,_0xbe83ac);_0x197336(_0xbe83ac);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 31f803c..826131b 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x26224c,_0x1a354c){var _0x4c2bc5=function(_0x179343){while(--_0x179343){_0x26224c['push'](_0x26224c['shift']());}};_0x4c2bc5(++_0x1a354c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b6db7,_0x4c638a){var _0x54a52c=function(_0x5a9b2c){while(--_0x5a9b2c){_0x2b6db7['push'](_0x2b6db7['shift']());}};_0x54a52c(++_0x4c638a);}(_0xe706,0xa3));var _0x6e70=function(_0x363618,_0x5ebf3a){_0x363618=_0x363618-0x0;var _0x496dee=_0xe706[_0x363618];return _0x496dee;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 16b5724..51b5b28 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 _0x3350=['sequelize','exports','INTEGER'];(function(_0x20574b,_0x277d45){var _0x3b27f6=function(_0xa46812){while(--_0xa46812){_0x20574b['push'](_0x20574b['shift']());}};_0x3b27f6(++_0x277d45);}(_0x3350,0xc9));var _0x0335=function(_0x10cafc,_0x4486c1){_0x10cafc=_0x10cafc-0x0;var _0xa66efb=_0x3350[_0x10cafc];return _0xa66efb;};'use strict';var Sequelize=require(_0x0335('0x0'));module[_0x0335('0x1')]={'penalty':{'type':Sequelize[_0x0335('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x659d=['exports','INTEGER'];(function(_0x3b7bcd,_0x5eeb3d){var _0x574838=function(_0x5de987){while(--_0x5de987){_0x3b7bcd['push'](_0x3b7bcd['shift']());}};_0x574838(++_0x5eeb3d);}(_0x659d,0x64));var _0xd659=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x659d[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');module[_0xd659('0x0')]={'penalty':{'type':Sequelize[_0xd659('0x1')],'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 fe3e9b2..d0c0e77 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 _0x553a=['bluebird','rimraf','exports','define','UserSmsQueue','user_has_sms_queues','util','api','moment'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x553a,0x192));var _0xa553=function(_0x44c5c1,_0x4d9d55){_0x44c5c1=_0x44c5c1-0x0;var _0x467172=_0x553a[_0x44c5c1];return _0x467172;};'use strict';var _=require('lodash');var util=require(_0xa553('0x0'));var logger=require('../../config/logger')(_0xa553('0x1'));var moment=require(_0xa553('0x2'));var BPromise=require(_0xa553('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa553('0x4'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xa553('0x5')]=function(_0x53190d,_0x5ddf5e){return _0x53190d[_0xa553('0x6')](_0xa553('0x7'),attributes,{'tableName':_0xa553('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4758da,_0x45257f){_0x4758da=_0x4758da-0x0;var _0x17327a=_0xc6ac[_0x4758da];return _0x17327a;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'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 996b2db..c29dc91 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 _0x7b8c=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x36ef0a,_0x3b4931){var _0x5a98e5=function(_0x356750){while(--_0x356750){_0x36ef0a['push'](_0x36ef0a['shift']());}};_0x5a98e5(++_0x3b4931);}(_0x7b8c,0x15e));var _0xc7b8=function(_0x3a1c4a,_0x3c2ca8){_0x3a1c4a=_0x3a1c4a-0x0;var _0xa2744e=_0x7b8c[_0x3a1c4a];return _0xa2744e;};'use strict';var _=require('lodash');var util=require(_0xc7b8('0x0'));var moment=require(_0xc7b8('0x1'));var BPromise=require(_0xc7b8('0x2'));var rs=require(_0xc7b8('0x3'));var fs=require('fs');var Redis=require(_0xc7b8('0x4'));var db=require(_0xc7b8('0x5'))['db'];var utils=require(_0xc7b8('0x6'));var logger=require(_0xc7b8('0x7'))(_0xc7b8('0x8'));var config=require(_0xc7b8('0x9'));var jayson=require(_0xc7b8('0xa'));var client=jayson[_0xc7b8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1094de,_0x3f941f,_0x2c264f){return new BPromise(function(_0x257a14,_0x2f43ca){return client[_0xc7b8('0xc')](_0x1094de,_0x2c264f)['then'](function(_0xf1b8fa){logger[_0xc7b8('0xd')](_0xc7b8('0xe'),_0x3f941f,_0xc7b8('0xf'));logger[_0xc7b8('0x10')](_0xc7b8('0x11'),_0x3f941f,_0xc7b8('0xf'),JSON['stringify'](_0xf1b8fa));if(_0xf1b8fa[_0xc7b8('0x12')]){if(_0xf1b8fa[_0xc7b8('0x12')][_0xc7b8('0x13')]===0x1f4){logger[_0xc7b8('0x12')](_0xc7b8('0xe'),_0x3f941f,_0xf1b8fa[_0xc7b8('0x12')]['message']);return _0x2f43ca(_0xf1b8fa['error'][_0xc7b8('0x14')]);}logger['error'](_0xc7b8('0xe'),_0x3f941f,_0xf1b8fa[_0xc7b8('0x12')][_0xc7b8('0x14')]);return _0x257a14(_0xf1b8fa[_0xc7b8('0x12')][_0xc7b8('0x14')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3f941f,'request\x20sent');_0x257a14(_0xf1b8fa[_0xc7b8('0x15')]['message']);}})[_0xc7b8('0x16')](function(_0x11fe69){logger[_0xc7b8('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x3f941f,_0x11fe69);_0x2f43ca(_0x11fe69);});});} \ No newline at end of file +var _0xdacd=['http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x17f287,_0x565e07){var _0x500ee8=function(_0x5bc933){while(--_0x5bc933){_0x17f287['push'](_0x17f287['shift']());}};_0x500ee8(++_0x565e07);}(_0xdacd,0x1ed));var _0xddac=function(_0x11d4ce,_0x1dbc78){_0x11d4ce=_0x11d4ce-0x0;var _0x384e83=_0xdacd[_0x11d4ce];return _0x384e83;};'use strict';var _=require('lodash');var util=require(_0xddac('0x0'));var moment=require(_0xddac('0x1'));var BPromise=require(_0xddac('0x2'));var rs=require(_0xddac('0x3'));var fs=require('fs');var Redis=require(_0xddac('0x4'));var db=require(_0xddac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xddac('0x6'))(_0xddac('0x7'));var config=require(_0xddac('0x8'));var jayson=require(_0xddac('0x9'));var client=jayson[_0xddac('0xa')][_0xddac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42f9b8,_0xed280,_0x26ea2){return new BPromise(function(_0x45a18f,_0x317cba){return client[_0xddac('0xc')](_0x42f9b8,_0x26ea2)[_0xddac('0xd')](function(_0x1992c){logger[_0xddac('0xe')](_0xddac('0xf'),_0xed280,_0xddac('0x10'));logger[_0xddac('0x11')](_0xddac('0x12'),_0xed280,_0xddac('0x10'),JSON[_0xddac('0x13')](_0x1992c));if(_0x1992c[_0xddac('0x14')]){if(_0x1992c[_0xddac('0x14')][_0xddac('0x15')]===0x1f4){logger[_0xddac('0x14')](_0xddac('0xf'),_0xed280,_0x1992c[_0xddac('0x14')]['message']);return _0x317cba(_0x1992c[_0xddac('0x14')][_0xddac('0x16')]);}logger[_0xddac('0x14')](_0xddac('0xf'),_0xed280,_0x1992c[_0xddac('0x14')]['message']);return _0x45a18f(_0x1992c['error'][_0xddac('0x16')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0xed280,'request\x20sent');_0x45a18f(_0x1992c['result'][_0xddac('0x16')]);}})[_0xddac('0x17')](function(_0xf906da){logger[_0xddac('0x14')](_0xddac('0xf'),_0xed280,_0xf906da);_0x317cba(_0xf906da);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 8c9a104..aa1c5b1 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 _0x2a61=['sequelize','exports','INTEGER'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2a61,0x186));var _0x12a6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2a61[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x12a6('0x0'));module[_0x12a6('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x12a6('0x2')]}}; \ No newline at end of file +var _0x449f=['INTEGER','sequelize','exports'];(function(_0x30e131,_0x529119){var _0xc07c16=function(_0x21d3aa){while(--_0x21d3aa){_0x30e131['push'](_0x30e131['shift']());}};_0xc07c16(++_0x529119);}(_0x449f,0x124));var _0xf449=function(_0x211576,_0xcc41af){_0x211576=_0x211576-0x0;var _0x3ce235=_0x449f[_0x211576];return _0x3ce235;};'use strict';var Sequelize=require(_0xf449('0x0'));module[_0xf449('0x1')]={'UserId':{'type':Sequelize[_0xf449('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xf449('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index ce167c6..782f7ae 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(_0x24c39e,_0x26a001){var _0x134d52=function(_0x32e09e){while(--_0x32e09e){_0x24c39e['push'](_0x24c39e['shift']());}};_0x134d52(++_0x26a001);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x995c70,_0x2892d6){var _0x4bde8d=function(_0x3c3d60){while(--_0x3c3d60){_0x995c70['push'](_0x995c70['shift']());}};_0x4bde8d(++_0x2892d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 66e717e..1b01a06 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x19cafc,_0x4faa17){var _0x3dab92=function(_0x1130a4){while(--_0x1130a4){_0x19cafc['push'](_0x19cafc['shift']());}};_0x3dab92(++_0x4faa17);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0xcb91[_0x29632e];return _0x426e04;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x10c6d3,_0x1ebe43){var _0x33c630=function(_0xc30e3){while(--_0xc30e3){_0x10c6d3['push'](_0x10c6d3['shift']());}};_0x33c630(++_0x1ebe43);}(_0x70e0,0x17b));var _0x070e=function(_0x2098d4,_0xb07e3d){_0x2098d4=_0x2098d4-0x0;var _0x4906b6=_0x70e0[_0x2098d4];return _0x4906b6;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d8ae2ae..780e3bd 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 _0xafc6=['sequelize','exports','INTEGER'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0xafc6,0xf9));var _0x6afc=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xafc6[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x6afc('0x0'));module[_0x6afc('0x1')]={'penalty':{'type':Sequelize[_0x6afc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x12c8=['exports','INTEGER'];(function(_0xe0c5bb,_0x2a0ccd){var _0xc9aaf2=function(_0x5925b0){while(--_0x5925b0){_0xe0c5bb['push'](_0xe0c5bb['shift']());}};_0xc9aaf2(++_0x2a0ccd);}(_0x12c8,0x114));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x812c('0x0')]={'penalty':{'type':Sequelize[_0x812c('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 a97de19..5595eff 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 _0x52d8=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x265e0e,_0x38b2bb){var _0x518157=function(_0x1e3eab){while(--_0x1e3eab){_0x265e0e['push'](_0x265e0e['shift']());}};_0x518157(++_0x38b2bb);}(_0x52d8,0x150));var _0x852d=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0x52d8[_0x867b0a];return _0x137438;};'use strict';var _=require(_0x852d('0x0'));var util=require(_0x852d('0x1'));var logger=require(_0x852d('0x2'))('api');var moment=require(_0x852d('0x3'));var BPromise=require(_0x852d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x852d('0x5'));var rimraf=require('rimraf');var config=require(_0x852d('0x6'));var attributes=require(_0x852d('0x7'));module[_0x852d('0x8')]=function(_0x3b1b83,_0x45dec7){return _0x3b1b83[_0x852d('0x9')](_0x852d('0xa'),attributes,{'tableName':_0x852d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f28=['user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x2d0d70,_0x42e1dc){var _0x32c5dc=function(_0xe44c18){while(--_0xe44c18){_0x2d0d70['push'](_0x2d0d70['shift']());}};_0x32c5dc(++_0x42e1dc);}(_0x0f28,0x85));var _0x80f2=function(_0x4291dd,_0x95d82){_0x4291dd=_0x4291dd-0x0;var _0x152462=_0x0f28[_0x4291dd];return _0x152462;};'use strict';var _=require(_0x80f2('0x0'));var util=require('util');var logger=require(_0x80f2('0x1'))(_0x80f2('0x2'));var moment=require(_0x80f2('0x3'));var BPromise=require(_0x80f2('0x4'));var rp=require(_0x80f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80f2('0x6'));var config=require(_0x80f2('0x7'));var attributes=require(_0x80f2('0x8'));module[_0x80f2('0x9')]=function(_0xbb4148,_0x35ad4f){return _0xbb4148[_0x80f2('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x80f2('0xb'),'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 a5a0cf8..cbb0bf7 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 _0xe277=['UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x120155,_0x7dcfe8){var _0x4894a2=function(_0xd7a6b1){while(--_0xd7a6b1){_0x120155['push'](_0x120155['shift']());}};_0x4894a2(++_0x7dcfe8);}(_0xe277,0x8e));var _0x7e27=function(_0x47019e,_0x1c6b90){_0x47019e=_0x47019e-0x0;var _0x48f568=_0xe277[_0x47019e];return _0x48f568;};'use strict';var _=require(_0x7e27('0x0'));var util=require(_0x7e27('0x1'));var moment=require('moment');var BPromise=require(_0x7e27('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e27('0x3'))['db'];var utils=require(_0x7e27('0x4'));var logger=require(_0x7e27('0x5'))(_0x7e27('0x6'));var config=require(_0x7e27('0x7'));var jayson=require(_0x7e27('0x8'));var client=jayson['client'][_0x7e27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41d4c7,_0x37b9d0,_0x155182){return new BPromise(function(_0x10a1aa,_0x2ad0e2){return client[_0x7e27('0xa')](_0x41d4c7,_0x155182)[_0x7e27('0xb')](function(_0x55874e){logger[_0x7e27('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x37b9d0,_0x7e27('0xd'));logger[_0x7e27('0xe')](_0x7e27('0xf'),_0x37b9d0,_0x7e27('0xd'),JSON[_0x7e27('0x10')](_0x55874e));if(_0x55874e[_0x7e27('0x11')]){if(_0x55874e[_0x7e27('0x11')][_0x7e27('0x12')]===0x1f4){logger[_0x7e27('0x11')](_0x7e27('0x13'),_0x37b9d0,_0x55874e['error'][_0x7e27('0x14')]);return _0x2ad0e2(_0x55874e[_0x7e27('0x11')][_0x7e27('0x14')]);}logger['error'](_0x7e27('0x13'),_0x37b9d0,_0x55874e['error']['message']);return _0x10a1aa(_0x55874e[_0x7e27('0x11')][_0x7e27('0x14')]);}else{logger[_0x7e27('0xc')](_0x7e27('0x13'),_0x37b9d0,'request\x20sent');_0x10a1aa(_0x55874e[_0x7e27('0x15')][_0x7e27('0x14')]);}})[_0x7e27('0x16')](function(_0x3e6048){logger['error'](_0x7e27('0x13'),_0x37b9d0,_0x3e6048);_0x2ad0e2(_0x3e6048);});});} \ No newline at end of file +var _0x4b9b=['code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x378780,_0xca48fd){var _0x244d46=function(_0x3a8135){while(--_0x3a8135){_0x378780['push'](_0x378780['shift']());}};_0x244d46(++_0xca48fd);}(_0x4b9b,0x191));var _0xb4b9=function(_0x6aad74,_0x32ecf4){_0x6aad74=_0x6aad74-0x0;var _0x5b1c38=_0x4b9b[_0x6aad74];return _0x5b1c38;};'use strict';var _=require('lodash');var util=require(_0xb4b9('0x0'));var moment=require(_0xb4b9('0x1'));var BPromise=require(_0xb4b9('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(_0xb4b9('0x3'))(_0xb4b9('0x4'));var config=require(_0xb4b9('0x5'));var jayson=require(_0xb4b9('0x6'));var client=jayson['client'][_0xb4b9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x926620,_0x1f432b,_0x6b35f1){return new BPromise(function(_0x4fe02d,_0x45b23f){return client[_0xb4b9('0x8')](_0x926620,_0x6b35f1)['then'](function(_0x212440){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x1f432b,'request\x20sent');logger['debug'](_0xb4b9('0x9'),_0x1f432b,_0xb4b9('0xa'),JSON[_0xb4b9('0xb')](_0x212440));if(_0x212440[_0xb4b9('0xc')]){if(_0x212440[_0xb4b9('0xc')][_0xb4b9('0xd')]===0x1f4){logger[_0xb4b9('0xc')](_0xb4b9('0xe'),_0x1f432b,_0x212440[_0xb4b9('0xc')][_0xb4b9('0xf')]);return _0x45b23f(_0x212440[_0xb4b9('0xc')][_0xb4b9('0xf')]);}logger[_0xb4b9('0xc')](_0xb4b9('0xe'),_0x1f432b,_0x212440[_0xb4b9('0xc')][_0xb4b9('0xf')]);return _0x4fe02d(_0x212440[_0xb4b9('0xc')][_0xb4b9('0xf')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x1f432b,_0xb4b9('0xa'));_0x4fe02d(_0x212440[_0xb4b9('0x10')][_0xb4b9('0xf')]);}})[_0xb4b9('0x11')](function(_0x24ebc3){logger[_0xb4b9('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x1f432b,_0x24ebc3);_0x45b23f(_0x24ebc3);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ab32cee..700a74c 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x272684,_0x7f6d1a){var _0x3f107e=function(_0x304726){while(--_0x304726){_0x272684['push'](_0x272684['shift']());}};_0x3f107e(++_0x7f6d1a);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4a33ca,_0x54bf02){var _0x394f13=function(_0x4577b4){while(--_0x4577b4){_0x4a33ca['push'](_0x4a33ca['shift']());}};_0x394f13(++_0x54bf02);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 978c9cb..63b1355 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 _0x7b90=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x7b90,0xea));var _0x07b9=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7b90[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x07b9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x07b9('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x07b9('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x07b9('0x3')],'allowNull':![],'unique':_0x07b9('0x4'),'comment':_0x07b9('0x2')},'VoiceQueueId':{'type':Sequelize[_0x07b9('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x07b9('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x07b9('0x1')](0xb),'defaultValue':0x0,'comment':_0x07b9('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x07b9('0x2')}}; \ No newline at end of file +var _0x975b=['queue_interface','INTEGER','sequelize','exports','STRING','Required\x20by\x20Asterisk'];(function(_0x2d9949,_0x1cf21b){var _0x28538d=function(_0x4217d6){while(--_0x4217d6){_0x2d9949['push'](_0x2d9949['shift']());}};_0x28538d(++_0x1cf21b);}(_0x975b,0x12e));var _0xb975=function(_0xff66cb,_0x26df1f){_0xff66cb=_0xff66cb-0x0;var _0x2e84d1=_0x975b[_0xff66cb];return _0x2e84d1;};'use strict';var Sequelize=require(_0xb975('0x0'));module[_0xb975('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xb975('0x2')],'allowNull':![],'comment':_0xb975('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb975('0x2')],'allowNull':![],'unique':_0xb975('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb975('0x4'),'comment':_0xb975('0x3')},'penalty':{'type':Sequelize[_0xb975('0x5')](0xb),'defaultValue':0x0,'comment':_0xb975('0x3')},'paused':{'type':Sequelize[_0xb975('0x5')](0xb),'defaultValue':0x0,'comment':_0xb975('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 03f814f..6f8d642 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 _0xd2ed=['hasOwnProperty','hook','events','UserVoiceQueueRt','setMaxListeners','remove','emit'];(function(_0x144e82,_0xe69b5d){var _0x527035=function(_0xbca095){while(--_0xbca095){_0x144e82['push'](_0x144e82['shift']());}};_0x527035(++_0xe69b5d);}(_0xd2ed,0xfe));var _0xdd2e=function(_0x193132,_0x5d5b96){_0x193132=_0x193132-0x0;var _0xba4600=_0xd2ed[_0x193132];return _0xba4600;};'use strict';var EventEmitter=require(_0xdd2e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xdd2e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xdd2e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdd2e('0x3')};function emitEvent(_0x5057c3){return function(_0x21015a,_0x4f9925,_0xa5e3b){UserVoiceQueueRtEvents['emit'](_0x5057c3+':'+_0x21015a['id'],_0x21015a);UserVoiceQueueRtEvents[_0xdd2e('0x4')](_0x5057c3,_0x21015a);_0xa5e3b(null);};}for(var e in events){if(events[_0xdd2e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xdd2e('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4e8d=['save','update','remove','hasOwnProperty','exports','events','UserVoiceQueueRt','setMaxListeners'];(function(_0x4e01a8,_0x20b479){var _0x1fe570=function(_0x21e060){while(--_0x21e060){_0x4e01a8['push'](_0x4e01a8['shift']());}};_0x1fe570(++_0x20b479);}(_0x4e8d,0xed));var _0xd4e8=function(_0x58eb04,_0x324442){_0x58eb04=_0x58eb04-0x0;var _0x3189a6=_0x4e8d[_0x58eb04];return _0x3189a6;};'use strict';var EventEmitter=require(_0xd4e8('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xd4e8('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd4e8('0x2')](0x0);var events={'afterCreate':_0xd4e8('0x3'),'afterUpdate':_0xd4e8('0x4'),'afterDestroy':_0xd4e8('0x5')};function emitEvent(_0x42b35f){return function(_0x14afb5,_0x22cf87,_0x4ee8b2){UserVoiceQueueRtEvents['emit'](_0x42b35f+':'+_0x14afb5['id'],_0x14afb5);UserVoiceQueueRtEvents['emit'](_0x42b35f,_0x14afb5);_0x4ee8b2(null);};}for(var e in events){if(events[_0xd4e8('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xd4e8('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 9b99ddb..b88cccf 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 _0x661a=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x661a,0x108));var _0xa661=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x661a[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0xa661('0x0'));var util=require('util');var logger=require(_0xa661('0x1'))(_0xa661('0x2'));var moment=require(_0xa661('0x3'));var BPromise=require(_0xa661('0x4'));var rp=require(_0xa661('0x5'));var fs=require('fs');var path=require(_0xa661('0x6'));var rimraf=require('rimraf');var config=require(_0xa661('0x7'));var attributes=require(_0xa661('0x8'));module[_0xa661('0x9')]=function(_0x12f51c,_0x5b8f46){return _0x12f51c[_0xa661('0xa')](_0xa661('0xb'),attributes,{'tableName':_0xa661('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd492=['../../config/logger','api','moment','bluebird','request-promise','path','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x4c8ceb,_0x3723bf){var _0x1eb9ea=function(_0xea1463){while(--_0xea1463){_0x4c8ceb['push'](_0x4c8ceb['shift']());}};_0x1eb9ea(++_0x3723bf);}(_0xd492,0x77));var _0x2d49=function(_0x40502a,_0x3122e9){_0x40502a=_0x40502a-0x0;var _0x1ff952=_0xd492[_0x40502a];return _0x1ff952;};'use strict';var _=require(_0x2d49('0x0'));var util=require(_0x2d49('0x1'));var logger=require(_0x2d49('0x2'))(_0x2d49('0x3'));var moment=require(_0x2d49('0x4'));var BPromise=require(_0x2d49('0x5'));var rp=require(_0x2d49('0x6'));var fs=require('fs');var path=require(_0x2d49('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x2d49('0x8')]=function(_0x6d044,_0x1de8d1){return _0x6d044['define'](_0x2d49('0x9'),attributes,{'tableName':_0x2d49('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 825e47f..de728a9 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 _0xba7a=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba7a,0x193));var _0xaba7=function(_0x5006b7,_0x52edeb){_0x5006b7=_0x5006b7-0x0;var _0x4245de=_0xba7a[_0x5006b7];return _0x4245de;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaba7('0x0'));var BPromise=require(_0xaba7('0x1'));var rs=require(_0xaba7('0x2'));var fs=require('fs');var Redis=require(_0xaba7('0x3'));var db=require(_0xaba7('0x4'))['db'];var utils=require(_0xaba7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xaba7('0x6'));var jayson=require(_0xaba7('0x7'));var client=jayson['client'][_0xaba7('0x8')]({'port':0x232a});config[_0xaba7('0x9')]=_['defaults'](config['redis'],{'host':_0xaba7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaba7('0x9')]));require(_0xaba7('0xb'))[_0xaba7('0xc')](socket);function respondWithRpcPromise(_0x55db6d,_0xdfcd57,_0x128c27){return new BPromise(function(_0x56d041,_0x1f058a){return client[_0xaba7('0xd')](_0x55db6d,_0x128c27)[_0xaba7('0xe')](function(_0x539c3b){logger['info'](_0xaba7('0xf'),_0xdfcd57,_0xaba7('0x10'));logger[_0xaba7('0x11')](_0xaba7('0x12'),_0xdfcd57,_0xaba7('0x10'),JSON[_0xaba7('0x13')](_0x539c3b));if(_0x539c3b[_0xaba7('0x14')]){if(_0x539c3b[_0xaba7('0x14')]['code']===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0xdfcd57,_0x539c3b[_0xaba7('0x14')]['message']);return _0x1f058a(_0x539c3b[_0xaba7('0x14')][_0xaba7('0x15')]);}logger[_0xaba7('0x14')](_0xaba7('0xf'),_0xdfcd57,_0x539c3b[_0xaba7('0x14')][_0xaba7('0x15')]);return _0x56d041(_0x539c3b[_0xaba7('0x14')][_0xaba7('0x15')]);}else{logger['info'](_0xaba7('0xf'),_0xdfcd57,'request\x20sent');_0x56d041(_0x539c3b[_0xaba7('0x16')][_0xaba7('0x15')]);}})[_0xaba7('0x17')](function(_0x34c06a){logger[_0xaba7('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xdfcd57,_0x34c06a);_0x1f058a(_0x34c06a);});});}exports[_0xaba7('0x18')]=function(_0x168e82){var _0x196c0f=this;return new Promise(function(_0x5861cf,_0x1dd530){return db[_0xaba7('0x19')][_0xaba7('0x1a')]({'raw':_0x168e82[_0xaba7('0x1b')]?_0x168e82['options'][_0xaba7('0x1c')]===undefined?!![]:![]:!![],'where':_0x168e82[_0xaba7('0x1b')]?_0x168e82[_0xaba7('0x1b')][_0xaba7('0x1d')]||null:null,'attributes':[[db[_0xaba7('0x1e')]['fn'](_0xaba7('0x1f'),db[_0xaba7('0x1e')]['fn']('IF',db[_0xaba7('0x1e')]['literal'](_0xaba7('0x20')))),_0xaba7('0x21')]]})[_0xaba7('0xe')](function(_0x415446){logger[_0xaba7('0x22')](_0xaba7('0x18'),_0x168e82);logger[_0xaba7('0x11')](_0xaba7('0x18'),_0x168e82,JSON['stringify'](_0x415446));_0x5861cf(_0x415446);})[_0xaba7('0x17')](function(_0x37b27a){logger[_0xaba7('0x14')](_0xaba7('0x18'),_0x37b27a[_0xaba7('0x15')],_0x168e82);_0x1dd530(_0x196c0f[_0xaba7('0x14')](0x1f4,_0x37b27a[_0xaba7('0x15')]));});});}; \ No newline at end of file +var _0xfcad=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xfcad,0x1a9));var _0xdfca=function(_0x392ae2,_0x1fbf5a){_0x392ae2=_0x392ae2-0x0;var _0x2fb1f8=_0xfcad[_0x392ae2];return _0x2fb1f8;};'use strict';var _=require(_0xdfca('0x0'));var util=require(_0xdfca('0x1'));var moment=require(_0xdfca('0x2'));var BPromise=require(_0xdfca('0x3'));var rs=require(_0xdfca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdfca('0x6'))(_0xdfca('0x7'));var config=require(_0xdfca('0x8'));var jayson=require(_0xdfca('0x9'));var client=jayson['client'][_0xdfca('0xa')]({'port':0x232a});config[_0xdfca('0xb')]=_[_0xdfca('0xc')](config[_0xdfca('0xb')],{'host':_0xdfca('0xd'),'port':0x18eb});var socket=require(_0xdfca('0xe'))(new Redis(config[_0xdfca('0xb')]));require(_0xdfca('0xf'))['register'](socket);function respondWithRpcPromise(_0x3ce117,_0x3f3c4d,_0x4d8adf){return new BPromise(function(_0x180382,_0xf03c20){return client[_0xdfca('0x10')](_0x3ce117,_0x4d8adf)[_0xdfca('0x11')](function(_0x2a22e6){logger[_0xdfca('0x12')](_0xdfca('0x13'),_0x3f3c4d,_0xdfca('0x14'));logger[_0xdfca('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3f3c4d,_0xdfca('0x14'),JSON[_0xdfca('0x16')](_0x2a22e6));if(_0x2a22e6[_0xdfca('0x17')]){if(_0x2a22e6[_0xdfca('0x17')]['code']===0x1f4){logger[_0xdfca('0x17')](_0xdfca('0x13'),_0x3f3c4d,_0x2a22e6[_0xdfca('0x17')][_0xdfca('0x18')]);return _0xf03c20(_0x2a22e6[_0xdfca('0x17')]['message']);}logger['error'](_0xdfca('0x13'),_0x3f3c4d,_0x2a22e6[_0xdfca('0x17')]['message']);return _0x180382(_0x2a22e6[_0xdfca('0x17')][_0xdfca('0x18')]);}else{logger['info'](_0xdfca('0x13'),_0x3f3c4d,'request\x20sent');_0x180382(_0x2a22e6[_0xdfca('0x19')][_0xdfca('0x18')]);}})[_0xdfca('0x1a')](function(_0xbc1c6f){logger[_0xdfca('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3f3c4d,_0xbc1c6f);_0xf03c20(_0xbc1c6f);});});}exports[_0xdfca('0x1b')]=function(_0x416504){var _0x30ceb7=this;return new Promise(function(_0x303029,_0xc47ac2){return db[_0xdfca('0x1c')][_0xdfca('0x1d')]({'raw':_0x416504['options']?_0x416504[_0xdfca('0x1e')][_0xdfca('0x1f')]===undefined?!![]:![]:!![],'where':_0x416504[_0xdfca('0x1e')]?_0x416504[_0xdfca('0x1e')][_0xdfca('0x20')]||null:null,'attributes':[[db[_0xdfca('0x21')]['fn']('COUNT',db[_0xdfca('0x21')]['fn']('IF',db[_0xdfca('0x21')]['literal'](_0xdfca('0x22')))),_0xdfca('0x23')]]})['then'](function(_0x459b7a){logger[_0xdfca('0x12')]('GetVoiceQueueRtPauses',_0x416504);logger[_0xdfca('0x15')](_0xdfca('0x1b'),_0x416504,JSON[_0xdfca('0x16')](_0x459b7a));_0x303029(_0x459b7a);})[_0xdfca('0x1a')](function(_0x31bd5b){logger['error'](_0xdfca('0x1b'),_0x31bd5b[_0xdfca('0x18')],_0x416504);_0xc47ac2(_0x30ceb7[_0xdfca('0x17')](0x1f4,_0x31bd5b[_0xdfca('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index ee863bb..6c428f6 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 _0x565f=['remove','update','emit','length','save'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x565f,0x68));var _0xf565=function(_0x38745a,_0x18e91d){_0x38745a=_0x38745a-0x0;var _0x258aba=_0x565f[_0x38745a];return _0x258aba;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xf565('0x0'),_0xf565('0x1'),_0xf565('0x2')];function createListener(_0x5956e1,_0x2abeda){return function(_0x24f0ad){_0x2abeda[_0xf565('0x3')](_0x5956e1,_0x24f0ad);};}function removeListener(_0x44400f,_0x35e885){return function(){UserVoiceQueueRtEvents['removeListener'](_0x44400f,_0x35e885);};}exports['register']=function(_0x570631){for(var _0x19f3f8=0x0,_0x4cc0ea=events[_0xf565('0x4')];_0x19f3f8<_0x4cc0ea;_0x19f3f8++){var _0x45db1b=events[_0x19f3f8];var _0x43b686=createListener('userVoiceQueueRt:'+_0x45db1b,_0x570631);UserVoiceQueueRtEvents['on'](_0x45db1b,_0x43b686);}}; \ No newline at end of file +var _0x39c7=['update','removeListener','userVoiceQueueRt:','save','remove'];(function(_0x7b1322,_0x328498){var _0x48f146=function(_0xb0129d){while(--_0xb0129d){_0x7b1322['push'](_0x7b1322['shift']());}};_0x48f146(++_0x328498);}(_0x39c7,0x85));var _0x739c=function(_0x1d11a3,_0x3982f2){_0x1d11a3=_0x1d11a3-0x0;var _0x17ab57=_0x39c7[_0x1d11a3];return _0x17ab57;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x739c('0x0'),_0x739c('0x1'),_0x739c('0x2')];function createListener(_0x25fdf5,_0xfadce8){return function(_0x18d787){_0xfadce8['emit'](_0x25fdf5,_0x18d787);};}function removeListener(_0x11c0a6,_0xff8215){return function(){UserVoiceQueueRtEvents[_0x739c('0x3')](_0x11c0a6,_0xff8215);};}exports['register']=function(_0x4c5030){for(var _0x1923d9=0x0,_0x3c0af1=events['length'];_0x1923d9<_0x3c0af1;_0x1923d9++){var _0x480159=events[_0x1923d9];var _0x27c5a4=createListener(_0x739c('0x4')+_0x480159,_0x4c5030);UserVoiceQueueRtEvents['on'](_0x480159,_0x27c5a4);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d7c8387..cee669b 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x53c552,_0x129587){var _0x599000=function(_0x519b95){while(--_0x519b95){_0x53c552['push'](_0x53c552['shift']());}};_0x599000(++_0x129587);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 2db799d..504ca03 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 _0x385b=['exports'];(function(_0x4c73cd,_0x5372d8){var _0x4894e8=function(_0x3fad97){while(--_0x3fad97){_0x4c73cd['push'](_0x4c73cd['shift']());}};_0x4894e8(++_0x5372d8);}(_0x385b,0x1a7));var _0xb385=function(_0x3450cb,_0x308b1c){_0x3450cb=_0x3450cb-0x0;var _0x5ee598=_0x385b[_0x3450cb];return _0x5ee598;};'use strict';var Sequelize=require('sequelize');module[_0xb385('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2ce8=['INTEGER','exports'];(function(_0x467c1a,_0x286eff){var _0x3f853d=function(_0x2e7e07){while(--_0x2e7e07){_0x467c1a['push'](_0x467c1a['shift']());}};_0x3f853d(++_0x286eff);}(_0x2ce8,0x137));var _0x82ce=function(_0x103936,_0x719749){_0x103936=_0x103936-0x0;var _0x4c73da=_0x2ce8[_0x103936];return _0x4c73da;};'use strict';var Sequelize=require('sequelize');module[_0x82ce('0x0')]={'penalty':{'type':Sequelize[_0x82ce('0x1')],'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 3e2ca67..3d0473b 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 _0x0acc=['../../config/logger','moment','bluebird','path','./userWhatsappQueue.attributes','define','util'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x0acc,0x109));var _0xc0ac=function(_0x310db9,_0xc1585f){_0x310db9=_0x310db9-0x0;var _0x74349d=_0x0acc[_0x310db9];return _0x74349d;};'use strict';var _=require('lodash');var util=require(_0xc0ac('0x0'));var logger=require(_0xc0ac('0x1'))('api');var moment=require(_0xc0ac('0x2'));var BPromise=require(_0xc0ac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0ac('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc0ac('0x5'));module['exports']=function(_0x426b7d,_0x520c7e){return _0x426b7d[_0xc0ac('0x6')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf560=['path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2cfcac,_0x1deb5c){var _0x18cbe7=function(_0x4b01c0){while(--_0x4b01c0){_0x2cfcac['push'](_0x2cfcac['shift']());}};_0x18cbe7(++_0x1deb5c);}(_0xf560,0x187));var _0x0f56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf560[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0f56('0x0'));var util=require(_0x0f56('0x1'));var logger=require(_0x0f56('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f56('0x3'));var rp=require(_0x0f56('0x4'));var fs=require('fs');var path=require(_0x0f56('0x5'));var rimraf=require(_0x0f56('0x6'));var config=require(_0x0f56('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x0f56('0x8')]=function(_0x44f813,_0x17de55){return _0x44f813[_0x0f56('0x9')](_0x0f56('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','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 70b10b1..54739b1 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 _0x10e6=['moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x292e72,_0x35ea3e){var _0x1b5b1a=function(_0x35c957){while(--_0x35c957){_0x292e72['push'](_0x292e72['shift']());}};_0x1b5b1a(++_0x35ea3e);}(_0x10e6,0xb3));var _0x610e=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x10e6[_0x326e79];return _0x37eb89;};'use strict';var _=require('lodash');var util=require(_0x610e('0x0'));var moment=require(_0x610e('0x1'));var BPromise=require('bluebird');var rs=require(_0x610e('0x2'));var fs=require('fs');var Redis=require(_0x610e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x610e('0x4'));var config=require(_0x610e('0x5'));var jayson=require(_0x610e('0x6'));var client=jayson['client'][_0x610e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23a3e9,_0x3f22bd,_0x3cbf79){return new BPromise(function(_0x378571,_0x60be03){return client[_0x610e('0x8')](_0x23a3e9,_0x3cbf79)[_0x610e('0x9')](function(_0xe64b30){logger['info'](_0x610e('0xa'),_0x3f22bd,'request\x20sent');logger[_0x610e('0xb')](_0x610e('0xc'),_0x3f22bd,_0x610e('0xd'),JSON[_0x610e('0xe')](_0xe64b30));if(_0xe64b30['error']){if(_0xe64b30[_0x610e('0xf')][_0x610e('0x10')]===0x1f4){logger[_0x610e('0xf')](_0x610e('0xa'),_0x3f22bd,_0xe64b30['error'][_0x610e('0x11')]);return _0x60be03(_0xe64b30[_0x610e('0xf')][_0x610e('0x11')]);}logger['error'](_0x610e('0xa'),_0x3f22bd,_0xe64b30['error'][_0x610e('0x11')]);return _0x378571(_0xe64b30[_0x610e('0xf')][_0x610e('0x11')]);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x3f22bd,_0x610e('0xd'));_0x378571(_0xe64b30[_0x610e('0x12')]['message']);}})[_0x610e('0x13')](function(_0x26836b){logger['error'](_0x610e('0xa'),_0x3f22bd,_0x26836b);_0x60be03(_0x26836b);});});} \ No newline at end of file +var _0xb157=['stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x586fc0,_0x57717c){var _0xf27ac6=function(_0x3c0b9d){while(--_0x3c0b9d){_0x586fc0['push'](_0x586fc0['shift']());}};_0xf27ac6(++_0x57717c);}(_0xb157,0x145));var _0x7b15=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb157[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7b15('0x0'));var util=require(_0x7b15('0x1'));var moment=require(_0x7b15('0x2'));var BPromise=require(_0x7b15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b15('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b15('0x5'));var logger=require(_0x7b15('0x6'))(_0x7b15('0x7'));var config=require(_0x7b15('0x8'));var jayson=require(_0x7b15('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x955829,_0x983f2d,_0x395e68){return new BPromise(function(_0x357bd4,_0x16358b){return client[_0x7b15('0xa')](_0x955829,_0x395e68)['then'](function(_0x56c029){logger['info'](_0x7b15('0xb'),_0x983f2d,_0x7b15('0xc'));logger[_0x7b15('0xd')](_0x7b15('0xe'),_0x983f2d,_0x7b15('0xc'),JSON[_0x7b15('0xf')](_0x56c029));if(_0x56c029[_0x7b15('0x10')]){if(_0x56c029[_0x7b15('0x10')]['code']===0x1f4){logger[_0x7b15('0x10')](_0x7b15('0xb'),_0x983f2d,_0x56c029[_0x7b15('0x10')][_0x7b15('0x11')]);return _0x16358b(_0x56c029['error']['message']);}logger[_0x7b15('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x983f2d,_0x56c029['error'][_0x7b15('0x11')]);return _0x357bd4(_0x56c029[_0x7b15('0x10')]['message']);}else{logger['info'](_0x7b15('0xb'),_0x983f2d,_0x7b15('0xc'));_0x357bd4(_0x56c029[_0x7b15('0x12')][_0x7b15('0x11')]);}})[_0x7b15('0x13')](function(_0x3eb464){logger[_0x7b15('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x983f2d,_0x3eb464);_0x16358b(_0x3eb464);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 19923bb..02a9cf5 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 _0x5eb8=['fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated','show','destroy','util','path','Router'];(function(_0x163ab5,_0x6a7dbe){var _0x17e579=function(_0x10733f){while(--_0x10733f){_0x163ab5['push'](_0x163ab5['shift']());}};_0x17e579(++_0x6a7dbe);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x32c9b9,_0x21a0cf){_0x32c9b9=_0x32c9b9-0x0;var _0x239eab=_0x5eb8[_0x32c9b9];return _0x239eab;};'use strict';var multer=require('multer');var util=require(_0x85eb('0x0'));var path=require(_0x85eb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85eb('0x2')]();var fs_extra=require(_0x85eb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x85eb('0x4'));var config=require(_0x85eb('0x5'));var controller=require(_0x85eb('0x6'));router[_0x85eb('0x7')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x8')]);router[_0x85eb('0x7')](_0x85eb('0x9'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router['put'](_0x85eb('0x9'),auth[_0x85eb('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x85eb('0xc')]);module['exports']=router; \ No newline at end of file +var _0xabe8=['post','create','put','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xabe8,0x8c));var _0x8abe=function(_0x490542,_0x66a1b1){_0x490542=_0x490542-0x0;var _0x321b03=_0xabe8[_0x490542];return _0x321b03;};'use strict';var multer=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var path=require(_0x8abe('0x2'));var timeout=require('connect-timeout');var express=require(_0x8abe('0x3'));var router=express[_0x8abe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8abe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8abe('0x6'));var controller=require(_0x8abe('0x7'));router[_0x8abe('0x8')]('/',auth[_0x8abe('0x9')](),controller[_0x8abe('0xa')]);router['get']('/:id',auth[_0x8abe('0x9')](),controller[_0x8abe('0xb')]);router[_0x8abe('0xc')]('/',auth[_0x8abe('0x9')](),controller[_0x8abe('0xd')]);router[_0x8abe('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8abe('0xf')](_0x8abe('0x10'),auth[_0x8abe('0x9')](),controller[_0x8abe('0x11')]);module[_0x8abe('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 7753ce9..fe774f2 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 _0x2caf=['name'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x2caf,0x6a));var _0xf2ca=function(_0x3e0411,_0x431486){_0x3e0411=_0x3e0411-0x0;var _0x409316=_0x2caf[_0x3e0411];return _0x409316;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf2ca('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd2b3=['exports','name','STRING','sequelize'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xd2b3,0x67));var _0x3d2b=function(_0x51be7f,_0xd159f3){_0x51be7f=_0x51be7f-0x0;var _0x58f88c=_0xd2b3[_0x51be7f];return _0x58f88c;};'use strict';var Sequelize=require(_0x3d2b('0x0'));module[_0x3d2b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3d2b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3d2b('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 5d2953a..dda525c 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 _0x1df0=['filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','Variables','UserProfileResource','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x47632a,_0x4c7c7d){var _0x18134c=function(_0x168617){while(--_0x168617){_0x47632a['push'](_0x47632a['shift']());}};_0x18134c(++_0x4c7c7d);}(_0x1df0,0x67));var _0x01df=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1df0[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x01df('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x01df('0x1'));var rp=require(_0x01df('0x2'));var moment=require('moment');var BPromise=require(_0x01df('0x3'));var Mustache=require(_0x01df('0x4'));var util=require(_0x01df('0x5'));var path=require('path');var sox=require(_0x01df('0x6'));var csv=require(_0x01df('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01df('0x8'));var _=require('lodash');var squel=require(_0x01df('0x9'));var crypto=require(_0x01df('0xa'));var jsforce=require(_0x01df('0xb'));var deskjs=require(_0x01df('0xc'));var toCsv=require(_0x01df('0x7'));var querystring=require(_0x01df('0xd'));var Papa=require(_0x01df('0xe'));var Redis=require(_0x01df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x01df('0x10'));var as=require(_0x01df('0x11'));var hardwareService=require(_0x01df('0x12'));var logger=require(_0x01df('0x13'))('api');var utils=require(_0x01df('0x14'));var config=require(_0x01df('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x01df('0x16'))['db'];function respondWithStatusCode(_0x3c0ef3,_0x3017eb){_0x3017eb=_0x3017eb||0xcc;return function(_0xf98551){if(_0xf98551){return _0x3c0ef3[_0x01df('0x17')](_0x3017eb);}return _0x3c0ef3['status'](_0x3017eb)['end']();};}function respondWithResult(_0x48cff4,_0x439a2e){_0x439a2e=_0x439a2e||0xc8;return function(_0x19f10b){if(_0x19f10b){return _0x48cff4['status'](_0x439a2e)[_0x01df('0x18')](_0x19f10b);}};}function respondWithFilteredResult(_0x2aa903,_0xb7faf8){return function(_0x36af70){if(_0x36af70){var _0x270095=typeof _0xb7faf8[_0x01df('0x19')]===_0x01df('0x1a')&&typeof _0xb7faf8[_0x01df('0x1b')]===_0x01df('0x1a');var _0x5a6cc5=_0x36af70['count'];var _0x529b5e=_0x270095?0x0:_0xb7faf8[_0x01df('0x19')];var _0xe0788e=_0x270095?_0x36af70['count']:_0xb7faf8[_0x01df('0x19')]+_0xb7faf8['limit'];var _0x5478e2;if(_0xe0788e>=_0x5a6cc5){_0xe0788e=_0x5a6cc5;_0x5478e2=0xc8;}else{_0x5478e2=0xce;}_0x2aa903[_0x01df('0x1c')](_0x5478e2);return _0x2aa903[_0x01df('0x1d')](_0x01df('0x1e'),_0x529b5e+'-'+_0xe0788e+'/'+_0x5a6cc5)[_0x01df('0x18')](_0x36af70);}return null;};}function patchUpdates(_0x7d07f9){return function(_0xbda9b9){try{jsonpatch[_0x01df('0x1f')](_0xbda9b9,_0x7d07f9,!![]);}catch(_0x4cb5cc){return BPromise[_0x01df('0x20')](_0x4cb5cc);}return _0xbda9b9[_0x01df('0x21')]();};}function saveUpdates(_0x26301d,_0x5d5061){return function(_0x1598ac){if(_0x1598ac){return _0x1598ac[_0x01df('0x22')](_0x26301d)['then'](function(_0x2ec13c){return _0x2ec13c;});}return null;};}function removeEntity(_0x4be498,_0x53ef5a){return function(_0xd37819){if(_0xd37819){return _0xd37819[_0x01df('0x23')]()[_0x01df('0x24')](function(){var _0x260c69=_0xd37819['get']({'plain':!![]});var _0x36735e=_0x01df('0x25');return db[_0x01df('0x26')][_0x01df('0x23')]({'where':{'type':_0x36735e,'resourceId':_0x260c69['id']}})[_0x01df('0x24')](function(){return _0xd37819;});})[_0x01df('0x24')](function(){_0x4be498['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b3f5,_0x3181da){return function(_0x5038ba){if(!_0x5038ba){_0x15b3f5['sendStatus'](0x194);}return _0x5038ba;};}function handleError(_0x4d4e2a,_0x25704c){_0x25704c=_0x25704c||0x1f4;return function(_0x11b11f){logger['error'](_0x11b11f['stack']);if(_0x11b11f[_0x01df('0x27')]){delete _0x11b11f[_0x01df('0x27')];}_0x4d4e2a[_0x01df('0x1c')](_0x25704c)[_0x01df('0x28')](_0x11b11f);};}exports[_0x01df('0x29')]=function(_0x4897ac,_0xe9a22e){var _0x2d0b5d={},_0x407272={},_0x1d75a6={'count':0x0,'rows':[]};var _0x5efe95=_[_0x01df('0x2a')](db[_0x01df('0x2b')][_0x01df('0x2c')],function(_0xe13990){return{'name':_0xe13990[_0x01df('0x2d')],'type':_0xe13990[_0x01df('0x2e')][_0x01df('0x2f')]};});_0x407272[_0x01df('0x30')]=_['map'](_0x5efe95,_0x01df('0x27'));_0x407272[_0x01df('0x31')]=_['keys'](_0x4897ac['query']);_0x407272[_0x01df('0x32')]=_[_0x01df('0x33')](_0x407272[_0x01df('0x30')],_0x407272['query']);_0x2d0b5d[_0x01df('0x34')]=_['intersection'](_0x407272[_0x01df('0x30')],qs[_0x01df('0x35')](_0x4897ac['query'][_0x01df('0x35')]));_0x2d0b5d[_0x01df('0x34')]=_0x2d0b5d[_0x01df('0x34')][_0x01df('0x36')]?_0x2d0b5d[_0x01df('0x34')]:_0x407272[_0x01df('0x30')];if(!_0x4897ac['query'][_0x01df('0x37')](_0x01df('0x38'))){_0x2d0b5d[_0x01df('0x1b')]=qs[_0x01df('0x1b')](_0x4897ac[_0x01df('0x31')][_0x01df('0x1b')]);_0x2d0b5d[_0x01df('0x19')]=qs[_0x01df('0x19')](_0x4897ac[_0x01df('0x31')][_0x01df('0x19')]);}_0x2d0b5d[_0x01df('0x39')]=qs['sort'](_0x4897ac['query'][_0x01df('0x3a')]);_0x2d0b5d[_0x01df('0x3b')]=qs['filters'](_[_0x01df('0x3c')](_0x4897ac[_0x01df('0x31')],_0x407272[_0x01df('0x32')]),_0x5efe95);if(_0x4897ac[_0x01df('0x31')][_0x01df('0x3d')]){_0x2d0b5d[_0x01df('0x3b')]=_[_0x01df('0x3e')](_0x2d0b5d[_0x01df('0x3b')],{'$or':_[_0x01df('0x2a')](_0x5efe95,function(_0x131050){if(_0x131050[_0x01df('0x2e')]!=='VIRTUAL'){var _0x778ed7={};_0x778ed7[_0x131050[_0x01df('0x27')]]={'$like':'%'+_0x4897ac[_0x01df('0x31')][_0x01df('0x3d')]+'%'};return _0x778ed7;}})});}_0x2d0b5d=_[_0x01df('0x3e')]({},_0x2d0b5d,_0x4897ac[_0x01df('0x3f')]);var _0x13fce0={'where':_0x2d0b5d['where']};return db[_0x01df('0x2b')]['count'](_0x13fce0)[_0x01df('0x24')](function(_0x4ca666){_0x1d75a6[_0x01df('0x40')]=_0x4ca666;if(_0x4897ac[_0x01df('0x31')][_0x01df('0x41')]){_0x2d0b5d[_0x01df('0x42')]=[{'all':!![]}];}return db[_0x01df('0x2b')][_0x01df('0x43')](_0x2d0b5d);})[_0x01df('0x24')](function(_0x741615){_0x1d75a6[_0x01df('0x44')]=_0x741615;return _0x1d75a6;})[_0x01df('0x24')](respondWithFilteredResult(_0xe9a22e,_0x2d0b5d))[_0x01df('0x45')](handleError(_0xe9a22e,null));};exports[_0x01df('0x46')]=function(_0x11b0b1,_0x8fc1dd){var _0x4c16c0={'raw':!![],'where':{'id':_0x11b0b1[_0x01df('0x47')]['id']}},_0x3f46af={};_0x3f46af['model']=_[_0x01df('0x48')](db['Variable'][_0x01df('0x2c')]);_0x3f46af[_0x01df('0x31')]=_[_0x01df('0x48')](_0x11b0b1[_0x01df('0x31')]);_0x3f46af['filters']=_['intersection'](_0x3f46af[_0x01df('0x30')],_0x3f46af[_0x01df('0x31')]);_0x4c16c0[_0x01df('0x34')]=_[_0x01df('0x33')](_0x3f46af[_0x01df('0x30')],qs[_0x01df('0x35')](_0x11b0b1[_0x01df('0x31')][_0x01df('0x35')]));_0x4c16c0[_0x01df('0x34')]=_0x4c16c0[_0x01df('0x34')][_0x01df('0x36')]?_0x4c16c0['attributes']:_0x3f46af[_0x01df('0x30')];if(_0x11b0b1[_0x01df('0x31')][_0x01df('0x41')]){_0x4c16c0[_0x01df('0x42')]=[{'all':!![]}];}_0x4c16c0=_[_0x01df('0x3e')]({},_0x4c16c0,_0x11b0b1[_0x01df('0x3f')]);return db[_0x01df('0x2b')][_0x01df('0x49')](_0x4c16c0)[_0x01df('0x24')](handleEntityNotFound(_0x8fc1dd,null))[_0x01df('0x24')](respondWithResult(_0x8fc1dd,null))['catch'](handleError(_0x8fc1dd,null));};exports[_0x01df('0x4a')]=function(_0x5bc3a7,_0x27927b){return db[_0x01df('0x2b')]['create'](_0x5bc3a7[_0x01df('0x4b')],{})[_0x01df('0x24')](function(_0x157a73){var _0x289618=_0x5bc3a7[_0x01df('0x4c')][_0x01df('0x4d')]({'plain':!![]});if(!_0x289618)throw new Error(_0x01df('0x4e'));if(_0x289618['role']==='user'){var _0x4b940a=_0x157a73[_0x01df('0x4d')]({'plain':!![]});var _0x1481df=_0x01df('0x25');return db[_0x01df('0x4f')]['find']({'where':{'name':_0x1481df,'userProfileId':_0x289618['userProfileId']},'raw':!![]})[_0x01df('0x24')](function(_0x301714){if(_0x301714&&_0x301714[_0x01df('0x50')]===0x0){return db[_0x01df('0x26')][_0x01df('0x4a')]({'name':_0x4b940a[_0x01df('0x27')],'resourceId':_0x4b940a['id'],'type':_0x301714['name'],'sectionId':_0x301714['id']},{})[_0x01df('0x24')](function(){return _0x157a73;});}else{return _0x157a73;}})[_0x01df('0x45')](function(_0x10c1eb){logger['error'](_0x01df('0x51'),_0x10c1eb);throw _0x10c1eb;});}return _0x157a73;})['then'](respondWithResult(_0x27927b,0xc9))[_0x01df('0x45')](handleError(_0x27927b,null));};exports['update']=function(_0x5192f7,_0x3940a7){if(_0x5192f7[_0x01df('0x4b')]['id']){delete _0x5192f7[_0x01df('0x4b')]['id'];}return db['Variable'][_0x01df('0x49')]({'where':{'id':_0x5192f7[_0x01df('0x47')]['id']}})[_0x01df('0x24')](handleEntityNotFound(_0x3940a7,null))[_0x01df('0x24')](saveUpdates(_0x5192f7[_0x01df('0x4b')],null))[_0x01df('0x24')](respondWithResult(_0x3940a7,null))['catch'](handleError(_0x3940a7,null));};exports['destroy']=function(_0x82669,_0x1ee462){return db[_0x01df('0x2b')][_0x01df('0x49')]({'where':{'id':_0x82669['params']['id']}})['then'](handleEntityNotFound(_0x1ee462,null))[_0x01df('0x24')](removeEntity(_0x1ee462,null))[_0x01df('0x45')](handleError(_0x1ee462,null));}; \ No newline at end of file +var _0x71c8=['error','stack','name','map','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','Variable','includeAll','rows','show','params','keys','rawAttributes','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus'];(function(_0x2a236a,_0x1f2732){var _0x43a800=function(_0x43275a){while(--_0x43275a){_0x2a236a['push'](_0x2a236a['shift']());}};_0x43a800(++_0x1f2732);}(_0x71c8,0x117));var _0x871c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x71c8[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x871c('0x0'));var rimraf=require(_0x871c('0x1'));var zipdir=require(_0x871c('0x2'));var jsonpatch=require(_0x871c('0x3'));var rp=require(_0x871c('0x4'));var moment=require('moment');var BPromise=require(_0x871c('0x5'));var Mustache=require(_0x871c('0x6'));var util=require(_0x871c('0x7'));var path=require(_0x871c('0x8'));var sox=require(_0x871c('0x9'));var csv=require(_0x871c('0xa'));var ejs=require(_0x871c('0xb'));var fs=require('fs');var fs_extra=require(_0x871c('0xc'));var _=require('lodash');var squel=require(_0x871c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x871c('0xe'));var toCsv=require(_0x871c('0xa'));var querystring=require('querystring');var Papa=require(_0x871c('0xf'));var Redis=require(_0x871c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x871c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x871c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x871c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c65c2,_0x114b16){_0x114b16=_0x114b16||0xcc;return function(_0x52035e){if(_0x52035e){return _0x5c65c2['sendStatus'](_0x114b16);}return _0x5c65c2[_0x871c('0x14')](_0x114b16)[_0x871c('0x15')]();};}function respondWithResult(_0x3b64bf,_0x8452c5){_0x8452c5=_0x8452c5||0xc8;return function(_0x175e07){if(_0x175e07){return _0x3b64bf[_0x871c('0x14')](_0x8452c5)[_0x871c('0x16')](_0x175e07);}};}function respondWithFilteredResult(_0x48c5f7,_0x596107){return function(_0x301014){if(_0x301014){var _0x2b0c0c=typeof _0x596107[_0x871c('0x17')]===_0x871c('0x18')&&typeof _0x596107['limit']===_0x871c('0x18');var _0x1f5f41=_0x301014[_0x871c('0x19')];var _0x436a21=_0x2b0c0c?0x0:_0x596107[_0x871c('0x17')];var _0x56a067=_0x2b0c0c?_0x301014[_0x871c('0x19')]:_0x596107[_0x871c('0x17')]+_0x596107['limit'];var _0x198a26;if(_0x56a067>=_0x1f5f41){_0x56a067=_0x1f5f41;_0x198a26=0xc8;}else{_0x198a26=0xce;}_0x48c5f7[_0x871c('0x14')](_0x198a26);return _0x48c5f7[_0x871c('0x1a')](_0x871c('0x1b'),_0x436a21+'-'+_0x56a067+'/'+_0x1f5f41)['json'](_0x301014);}return null;};}function patchUpdates(_0x4f2ac0){return function(_0x46fe7f){try{jsonpatch[_0x871c('0x1c')](_0x46fe7f,_0x4f2ac0,!![]);}catch(_0x163947){return BPromise[_0x871c('0x1d')](_0x163947);}return _0x46fe7f[_0x871c('0x1e')]();};}function saveUpdates(_0x52f116,_0x4600a4){return function(_0x5eef95){if(_0x5eef95){return _0x5eef95[_0x871c('0x1f')](_0x52f116)[_0x871c('0x20')](function(_0x5d79e2){return _0x5d79e2;});}return null;};}function removeEntity(_0x30b1b4,_0x425b09){return function(_0x2e3c48){if(_0x2e3c48){return _0x2e3c48[_0x871c('0x21')]()['then'](function(){var _0x12dd1b=_0x2e3c48[_0x871c('0x22')]({'plain':!![]});var _0x47c87c='Variables';return db[_0x871c('0x23')][_0x871c('0x21')]({'where':{'type':_0x47c87c,'resourceId':_0x12dd1b['id']}})[_0x871c('0x20')](function(){return _0x2e3c48;});})['then'](function(){_0x30b1b4[_0x871c('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27d5e8,_0x715638){return function(_0x1c0fbb){if(!_0x1c0fbb){_0x27d5e8[_0x871c('0x24')](0x194);}return _0x1c0fbb;};}function handleError(_0x5345c5,_0x187219){_0x187219=_0x187219||0x1f4;return function(_0x2bbf9e){logger[_0x871c('0x25')](_0x2bbf9e[_0x871c('0x26')]);if(_0x2bbf9e[_0x871c('0x27')]){delete _0x2bbf9e[_0x871c('0x27')];}_0x5345c5['status'](_0x187219)['send'](_0x2bbf9e);};}exports['index']=function(_0x4c1b77,_0x3d5a8b){var _0x24a244={},_0x4eb144={},_0x58d2f7={'count':0x0,'rows':[]};var _0x395be7=_[_0x871c('0x28')](db['Variable']['rawAttributes'],function(_0x2d2008){return{'name':_0x2d2008[_0x871c('0x29')],'type':_0x2d2008[_0x871c('0x2a')][_0x871c('0x2b')]};});_0x4eb144['model']=_[_0x871c('0x28')](_0x395be7,'name');_0x4eb144[_0x871c('0x2c')]=_['keys'](_0x4c1b77[_0x871c('0x2c')]);_0x4eb144[_0x871c('0x2d')]=_['intersection'](_0x4eb144[_0x871c('0x2e')],_0x4eb144[_0x871c('0x2c')]);_0x24a244[_0x871c('0x2f')]=_[_0x871c('0x30')](_0x4eb144['model'],qs[_0x871c('0x31')](_0x4c1b77[_0x871c('0x2c')][_0x871c('0x31')]));_0x24a244[_0x871c('0x2f')]=_0x24a244[_0x871c('0x2f')][_0x871c('0x32')]?_0x24a244[_0x871c('0x2f')]:_0x4eb144[_0x871c('0x2e')];if(!_0x4c1b77[_0x871c('0x2c')][_0x871c('0x33')](_0x871c('0x34'))){_0x24a244[_0x871c('0x35')]=qs[_0x871c('0x35')](_0x4c1b77[_0x871c('0x2c')][_0x871c('0x35')]);_0x24a244[_0x871c('0x17')]=qs[_0x871c('0x17')](_0x4c1b77[_0x871c('0x2c')][_0x871c('0x17')]);}_0x24a244[_0x871c('0x36')]=qs[_0x871c('0x37')](_0x4c1b77[_0x871c('0x2c')][_0x871c('0x37')]);_0x24a244[_0x871c('0x38')]=qs['filters'](_['pick'](_0x4c1b77['query'],_0x4eb144[_0x871c('0x2d')]),_0x395be7);if(_0x4c1b77[_0x871c('0x2c')]['filter']){_0x24a244['where']=_['merge'](_0x24a244[_0x871c('0x38')],{'$or':_[_0x871c('0x28')](_0x395be7,function(_0x127ad2){if(_0x127ad2[_0x871c('0x2a')]!=='VIRTUAL'){var _0x4bb0a6={};_0x4bb0a6[_0x127ad2['name']]={'$like':'%'+_0x4c1b77[_0x871c('0x2c')][_0x871c('0x39')]+'%'};return _0x4bb0a6;}})});}_0x24a244=_[_0x871c('0x3a')]({},_0x24a244,_0x4c1b77[_0x871c('0x3b')]);var _0x259409={'where':_0x24a244[_0x871c('0x38')]};return db[_0x871c('0x3c')][_0x871c('0x19')](_0x259409)[_0x871c('0x20')](function(_0x241265){_0x58d2f7['count']=_0x241265;if(_0x4c1b77['query'][_0x871c('0x3d')]){_0x24a244['include']=[{'all':!![]}];}return db['Variable']['findAll'](_0x24a244);})['then'](function(_0x1bef4d){_0x58d2f7[_0x871c('0x3e')]=_0x1bef4d;return _0x58d2f7;})[_0x871c('0x20')](respondWithFilteredResult(_0x3d5a8b,_0x24a244))['catch'](handleError(_0x3d5a8b,null));};exports[_0x871c('0x3f')]=function(_0x156b59,_0x850ce1){var _0x43ade2={'raw':!![],'where':{'id':_0x156b59[_0x871c('0x40')]['id']}},_0x10d66d={};_0x10d66d[_0x871c('0x2e')]=_[_0x871c('0x41')](db[_0x871c('0x3c')][_0x871c('0x42')]);_0x10d66d[_0x871c('0x2c')]=_[_0x871c('0x41')](_0x156b59[_0x871c('0x2c')]);_0x10d66d[_0x871c('0x2d')]=_[_0x871c('0x30')](_0x10d66d[_0x871c('0x2e')],_0x10d66d[_0x871c('0x2c')]);_0x43ade2[_0x871c('0x2f')]=_[_0x871c('0x30')](_0x10d66d[_0x871c('0x2e')],qs[_0x871c('0x31')](_0x156b59[_0x871c('0x2c')]['fields']));_0x43ade2[_0x871c('0x2f')]=_0x43ade2[_0x871c('0x2f')][_0x871c('0x32')]?_0x43ade2[_0x871c('0x2f')]:_0x10d66d[_0x871c('0x2e')];if(_0x156b59['query'][_0x871c('0x3d')]){_0x43ade2['include']=[{'all':!![]}];}_0x43ade2=_[_0x871c('0x3a')]({},_0x43ade2,_0x156b59[_0x871c('0x3b')]);return db[_0x871c('0x3c')][_0x871c('0x43')](_0x43ade2)[_0x871c('0x20')](handleEntityNotFound(_0x850ce1,null))[_0x871c('0x20')](respondWithResult(_0x850ce1,null))[_0x871c('0x44')](handleError(_0x850ce1,null));};exports[_0x871c('0x45')]=function(_0xaacc95,_0x4c6f04){return db['Variable']['create'](_0xaacc95['body'],{})[_0x871c('0x20')](function(_0x4e3e88){var _0x4c5507=_0xaacc95['user']['get']({'plain':!![]});if(!_0x4c5507)throw new Error(_0x871c('0x46'));if(_0x4c5507[_0x871c('0x47')]===_0x871c('0x48')){var _0x3c4223=_0x4e3e88[_0x871c('0x22')]({'plain':!![]});var _0x195067=_0x871c('0x49');return db[_0x871c('0x4a')][_0x871c('0x43')]({'where':{'name':_0x195067,'userProfileId':_0x4c5507[_0x871c('0x4b')]},'raw':!![]})[_0x871c('0x20')](function(_0x394936){if(_0x394936&&_0x394936[_0x871c('0x4c')]===0x0){return db[_0x871c('0x23')]['create']({'name':_0x3c4223[_0x871c('0x27')],'resourceId':_0x3c4223['id'],'type':_0x394936['name'],'sectionId':_0x394936['id']},{})['then'](function(){return _0x4e3e88;});}else{return _0x4e3e88;}})['catch'](function(_0xb1fd1b){logger[_0x871c('0x25')](_0x871c('0x4d'),_0xb1fd1b);throw _0xb1fd1b;});}return _0x4e3e88;})['then'](respondWithResult(_0x4c6f04,0xc9))['catch'](handleError(_0x4c6f04,null));};exports[_0x871c('0x1f')]=function(_0x383fca,_0x57c4bd){if(_0x383fca[_0x871c('0x4e')]['id']){delete _0x383fca[_0x871c('0x4e')]['id'];}return db[_0x871c('0x3c')][_0x871c('0x43')]({'where':{'id':_0x383fca['params']['id']}})[_0x871c('0x20')](handleEntityNotFound(_0x57c4bd,null))['then'](saveUpdates(_0x383fca[_0x871c('0x4e')],null))[_0x871c('0x20')](respondWithResult(_0x57c4bd,null))[_0x871c('0x44')](handleError(_0x57c4bd,null));};exports[_0x871c('0x21')]=function(_0x3e2a1a,_0xc28ae0){return db[_0x871c('0x3c')]['find']({'where':{'id':_0x3e2a1a[_0x871c('0x40')]['id']}})['then'](handleEntityNotFound(_0xc28ae0,null))[_0x871c('0x20')](removeEntity(_0xc28ae0,null))[_0x871c('0x44')](handleError(_0xc28ae0,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 7325301..7f222ea 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 _0x594d=['request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1a2687,_0x1594e5){var _0x567323=function(_0x3c5b3e){while(--_0x3c5b3e){_0x1a2687['push'](_0x1a2687['shift']());}};_0x567323(++_0x1594e5);}(_0x594d,0x174));var _0xd594=function(_0x420679,_0x16d5d8){_0x420679=_0x420679-0x0;var _0x41d645=_0x594d[_0x420679];return _0x41d645;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var logger=require(_0xd594('0x1'))(_0xd594('0x2'));var moment=require(_0xd594('0x3'));var BPromise=require(_0xd594('0x4'));var rp=require(_0xd594('0x5'));var fs=require('fs');var path=require(_0xd594('0x6'));var rimraf=require(_0xd594('0x7'));var config=require(_0xd594('0x8'));var attributes=require(_0xd594('0x9'));module['exports']=function(_0x534b61,_0x1646ac){return _0x534b61[_0xd594('0xa')](_0xd594('0xb'),attributes,{'tableName':_0xd594('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0101=['rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0101,0x1b6));var _0x1010=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0101[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1010('0x0'));var util=require(_0x1010('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1010('0x2'));var BPromise=require(_0x1010('0x3'));var rp=require(_0x1010('0x4'));var fs=require('fs');var path=require(_0x1010('0x5'));var rimraf=require(_0x1010('0x6'));var config=require(_0x1010('0x7'));var attributes=require(_0x1010('0x8'));module['exports']=function(_0x134593,_0x12c722){return _0x134593[_0x1010('0x9')](_0x1010('0xa'),attributes,{'tableName':_0x1010('0xb'),'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 2f4daa2..ec62edf 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 _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x381c21,_0x1042d0){var _0x32cf58=function(_0xa4d1d0){while(--_0xa4d1d0){_0x381c21['push'](_0x381c21['shift']());}};_0x32cf58(++_0x1042d0);}(_0xf494,0x1c6));var _0x4f49=function(_0x4fc060,_0x1179a4){_0x4fc060=_0x4fc060-0x0;var _0x369575=_0xf494[_0x4fc060];return _0x369575;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x1d7cc3,_0x5dfffe){var _0x4468ae=function(_0x4c765f){while(--_0x4c765f){_0x1d7cc3['push'](_0x1d7cc3['shift']());}};_0x4468ae(++_0x5dfffe);}(_0x55ca,0x126));var _0xa55c=function(_0x3fd50c,_0x1b41ed){_0x3fd50c=_0x3fd50c-0x0;var _0x4cebb2=_0x55ca[_0x3fd50c];return _0x4cebb2;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 2f0a6bd..449b45b 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 _0x0735=['/pull','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get','index','isAuthenticated','/reset','canUpdate','reset'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x0735,0xe5));var _0x5073=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x0735[_0x1d9aa0];return _0x226868;};'use strict';var express=require(_0x5073('0x0'));var router=express['Router']();var auth=require(_0x5073('0x1'));var controller=require(_0x5073('0x2'));router[_0x5073('0x3')]('/',controller[_0x5073('0x4')]);router[_0x5073('0x3')]('/fetch',auth[_0x5073('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0x5073('0x3')](_0x5073('0x6'),auth[_0x5073('0x5')](),auth[_0x5073('0x7')](),controller[_0x5073('0x8')]);router[_0x5073('0x3')](_0x5073('0x9'),auth['isAuthenticated'](),auth[_0x5073('0x7')](),controller['pull']);router[_0x5073('0x3')]('/restart',auth[_0x5073('0x5')](),controller[_0x5073('0xa')]);router[_0x5073('0x3')](_0x5073('0xb'),controller[_0x5073('0xc')]);module[_0x5073('0xd')]=router; \ No newline at end of file +var _0x14c6=['index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','Router','./version.controller','get'];(function(_0x3e0750,_0x5bc0ff){var _0x1194b5=function(_0x23e82b){while(--_0x23e82b){_0x3e0750['push'](_0x3e0750['shift']());}};_0x1194b5(++_0x5bc0ff);}(_0x14c6,0x1bf));var _0x614c=function(_0xe2af65,_0x39163b){_0xe2af65=_0xe2af65-0x0;var _0x2df26f=_0x14c6[_0xe2af65];return _0x2df26f;};'use strict';var express=require('express');var router=express[_0x614c('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x614c('0x1'));router[_0x614c('0x2')]('/',controller[_0x614c('0x3')]);router['get'](_0x614c('0x4'),auth[_0x614c('0x5')](),auth[_0x614c('0x6')](),controller[_0x614c('0x7')]);router['get'](_0x614c('0x8'),auth[_0x614c('0x5')](),auth['canUpdate'](),controller[_0x614c('0x9')]);router[_0x614c('0x2')](_0x614c('0xa'),auth[_0x614c('0x5')](),auth[_0x614c('0x6')](),controller[_0x614c('0xb')]);router[_0x614c('0x2')](_0x614c('0xc'),auth['isAuthenticated'](),controller[_0x614c('0xd')]);router['get'](_0x614c('0xe'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ad0bc46..397c0dd 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 _0x5715=['npm\x20install\x20--production','restart','motion2','migrations','readdirSync','root','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.','join','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','query','latest','fetch','tags','exports','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull'];(function(_0x41c77f,_0x42a232){var _0x3f5b70=function(_0x2aee6b){while(--_0x2aee6b){_0x41c77f['push'](_0x41c77f['shift']());}};_0x3f5b70(++_0x42a232);}(_0x5715,0xfe));var _0x5571=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x5715[_0x2064e5];return _0x21a233;};'use strict';var Umzug=require(_0x5571('0x0'));var path=require(_0x5571('0x1'));var fs=require('fs');var _=require(_0x5571('0x2'));var pkginfo=require('pkginfo')(module,_0x5571('0x3'));var compareVersions=require(_0x5571('0x4'));var exec=require('child_process')['exec'];var db=require(_0x5571('0x5'))['db'];var config=require(_0x5571('0x6'));var pm2=require(_0x5571('0x7'));var logger=require(_0x5571('0x8'))(_0x5571('0x9'));var git=require(_0x5571('0xa'))(config['root']);exports[_0x5571('0xb')]=function(_0x1a7cb7,_0x1abe29){var _0x45dc99={'current':module['exports']['version'],'phonebar':0x2};if(_0x1a7cb7[_0x5571('0xc')]&&_0x1a7cb7[_0x5571('0xc')][_0x5571('0xd')]){return git[_0x5571('0xe')]()[_0x5571('0xf')](function(_0x320b85,_0xf92243){_0x45dc99[_0x5571('0xd')]=(_0x320b85?module[_0x5571('0x10')][_0x5571('0x3')]:_0xf92243[_0x5571('0xd')])||_0x5571('0x11');return _0x1abe29[_0x5571('0x12')](0xc8)[_0x5571('0x13')](_0x45dc99);});}else{return _0x1abe29[_0x5571('0x12')](0xc8)['json'](_0x45dc99);}};exports[_0x5571('0xe')]=function(_0x5503b0,_0x192707){return git['fetch']([_0x5571('0x14'),_0x5571('0x15')],function(_0x17f103){if(_0x17f103){logger[_0x5571('0x16')](_0x17f103);return _0x192707[_0x5571('0x12')](0x1f4)[_0x5571('0x13')](_0x17f103);}logger[_0x5571('0x17')](_0x5571('0x18'));return _0x192707[_0x5571('0x12')](0xc8)[_0x5571('0x13')]({'output':_0x5571('0x19')});});};exports[_0x5571('0x1a')]=function(_0x1b1523,_0x4609da){return git['reset'](['--hard',_0x5571('0x1b')],function(_0x5af9e0){if(_0x5af9e0){logger[_0x5571('0x16')](_0x5af9e0);return _0x4609da[_0x5571('0x12')](0x1f4)['json'](_0x5af9e0);}logger['info'](_0x5571('0x1c'));return _0x4609da[_0x5571('0x12')](0xc8)[_0x5571('0x13')]({'output':_0x5571('0x1d')});});};exports[_0x5571('0x1e')]=function(_0x389e74,_0x8d45c8){exec(_0x5571('0x1f'),function(_0x9b6cca,_0x21a73e,_0x36baad){logger[_0x5571('0x17')](_0x21a73e);logger[_0x5571('0x17')](_0x36baad);if(_0x9b6cca){logger[_0x5571('0x16')](_0x9b6cca);return _0x8d45c8[_0x5571('0x12')](0x1f4)[_0x5571('0x13')](_0x9b6cca);}return _0x8d45c8[_0x5571('0x12')](0xc8)[_0x5571('0x13')]({'output':_0x21a73e});});};exports[_0x5571('0x20')]=function(_0x1cb694,_0x20020e){return pm2[_0x5571('0x20')](_0x5571('0x21'))['then'](function(_0x2f4361){logger['info']('pm2\x20restart\x20motion\x20%s',_0x2f4361);return _0x20020e[_0x5571('0x12')](0xc8)[_0x5571('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x30dc36){logger['error'](_0x30dc36);return _0x20020e[_0x5571('0x12')](0x1f4)['json'](_0x30dc36);});};exports[_0x5571('0x22')]=function(_0x41c68e,_0x3346b5){var _0x1afda5=fs[_0x5571('0x23')](path['join'](config[_0x5571('0x24')],_0x5571('0x25'),'migrations'));var _0x3d2de4=[];for(var _0xba5f=0x0;_0xba5f<_0x1afda5['length'];_0xba5f++){var _0xb994af=_0x1afda5[_0xba5f][_0x5571('0x26')](_0x5571('0x27'),'');if(compareVersions(module[_0x5571('0x10')][_0x5571('0x3')],_0xb994af)===-0x1){_0x3d2de4[_0x5571('0x28')](_0xb994af);}}if(_0x3d2de4[_0x5571('0x29')]){var _0x508c49=_0x3d2de4[_0x5571('0x2a')](compareVersions);var _0x105748=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x5571('0x2b'),'columnName':_0x5571('0x3')},'migrations':{'params':[db[_0x5571('0x2c')][_0x5571('0x2d')](),db['sequelize'][_0x5571('0x2e')],function(){throw new Error(_0x5571('0x2f'));}],'path':path[_0x5571('0x30')](config[_0x5571('0x24')],_0x5571('0x25'),'migrations'),'pattern':/\.js$/}});_0x105748['up']({'migrations':_[_0x5571('0x31')](_0x508c49,function(_0x28e66b){return _0x28e66b+_0x5571('0x27');})})[_0x5571('0x32')](function(){return _0x3346b5[_0x5571('0x12')](0xc8)[_0x5571('0x13')]({'output':_0x5571('0x33')+module[_0x5571('0x10')][_0x5571('0x3')]+_0x5571('0x34')+_[_0x5571('0x35')](_0x508c49),'migrations':_[_0x5571('0x30')](_0x508c49)});})[_0x5571('0x36')](function(_0x268679){if(_0x268679 instanceof db[_0x5571('0x2c')][_0x5571('0x37')]){return _0x3346b5[_0x5571('0x12')](0xc8)[_0x5571('0x13')]({'output':_0x5571('0x38')});}else{return _0x3346b5[_0x5571('0x12')](0x1f4)['json'](_0x268679);}});}else{return _0x3346b5['status'](0xc8)[_0x5571('0x13')]({'output':_0x5571('0x38')});}}; \ No newline at end of file +var _0x1834=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/logger','simple-git','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then'];(function(_0x5abb5a,_0x1198e2){var _0x4183e8=function(_0x5ca020){while(--_0x5ca020){_0x5abb5a['push'](_0x5abb5a['shift']());}};_0x4183e8(++_0x1198e2);}(_0x1834,0x1f3));var _0x4183=function(_0x2636ee,_0xa2019b){_0x2636ee=_0x2636ee-0x0;var _0x5be81e=_0x1834[_0x2636ee];return _0x5be81e;};'use strict';var Umzug=require('umzug');var path=require(_0x4183('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x4183('0x1'))(module,_0x4183('0x2'));var compareVersions=require(_0x4183('0x3'));var exec=require(_0x4183('0x4'))['exec'];var db=require(_0x4183('0x5'))['db'];var config=require(_0x4183('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x4183('0x7'))('update');var git=require(_0x4183('0x8'))(config['root']);exports['index']=function(_0x478171,_0xf14647){var _0x5a93d3={'current':module[_0x4183('0x9')][_0x4183('0x2')],'phonebar':0x2};if(_0x478171['query']&&_0x478171[_0x4183('0xa')][_0x4183('0xb')]){return git[_0x4183('0xc')]()[_0x4183('0xd')](function(_0x35e1ad,_0x542ebe){_0x5a93d3['latest']=(_0x35e1ad?module['exports'][_0x4183('0x2')]:_0x542ebe[_0x4183('0xb')])||_0x4183('0xe');return _0xf14647[_0x4183('0xf')](0xc8)[_0x4183('0x10')](_0x5a93d3);});}else{return _0xf14647['status'](0xc8)[_0x4183('0x10')](_0x5a93d3);}};exports[_0x4183('0xc')]=function(_0x240a9c,_0x402e07){return git[_0x4183('0xc')]([_0x4183('0x11'),_0x4183('0x12')],function(_0x4dd48e){if(_0x4dd48e){logger[_0x4183('0x13')](_0x4dd48e);return _0x402e07['status'](0x1f4)[_0x4183('0x10')](_0x4dd48e);}logger['info']('git\x20fetch');return _0x402e07[_0x4183('0xf')](0xc8)[_0x4183('0x10')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x1d900d,_0x3e7612){return git[_0x4183('0x14')]([_0x4183('0x15'),_0x4183('0x16')],function(_0x4081b2){if(_0x4081b2){logger['error'](_0x4081b2);return _0x3e7612[_0x4183('0xf')](0x1f4)[_0x4183('0x10')](_0x4081b2);}logger[_0x4183('0x17')](_0x4183('0x18'));return _0x3e7612['status'](0xc8)['json']({'output':_0x4183('0x19')});});};exports[_0x4183('0x1a')]=function(_0x126270,_0x4ae34b){exec(_0x4183('0x1b'),function(_0x47bc04,_0x55f77a,_0x3500b2){logger[_0x4183('0x17')](_0x55f77a);logger[_0x4183('0x17')](_0x3500b2);if(_0x47bc04){logger[_0x4183('0x13')](_0x47bc04);return _0x4ae34b[_0x4183('0xf')](0x1f4)[_0x4183('0x10')](_0x47bc04);}return _0x4ae34b[_0x4183('0xf')](0xc8)[_0x4183('0x10')]({'output':_0x55f77a});});};exports[_0x4183('0x1c')]=function(_0xb7e062,_0x385a59){return pm2[_0x4183('0x1c')](_0x4183('0x1d'))[_0x4183('0x1e')](function(_0x4131fc){logger[_0x4183('0x17')](_0x4183('0x1f'),_0x4131fc);return _0x385a59['status'](0xc8)[_0x4183('0x10')]({'output':_0x4183('0x20')});})[_0x4183('0x21')](function(_0x466a72){logger['error'](_0x466a72);return _0x385a59[_0x4183('0xf')](0x1f4)[_0x4183('0x10')](_0x466a72);});};exports[_0x4183('0x22')]=function(_0x4d3f79,_0x514584){var _0x2a37a5=fs[_0x4183('0x23')](path[_0x4183('0x24')](config[_0x4183('0x25')],'server','migrations'));var _0x32b2cb=[];for(var _0x25dda7=0x0;_0x25dda7<_0x2a37a5[_0x4183('0x26')];_0x25dda7++){var _0x3d0651=_0x2a37a5[_0x25dda7][_0x4183('0x27')](_0x4183('0x28'),'');if(compareVersions(module[_0x4183('0x9')]['version'],_0x3d0651)===-0x1){_0x32b2cb[_0x4183('0x29')](_0x3d0651);}}if(_0x32b2cb['length']){var _0x518794=_0x32b2cb[_0x4183('0x2a')](compareVersions);var _0x25dce3=new Umzug({'storage':_0x4183('0x2b'),'storageOptions':{'model':db[_0x4183('0x2c')],'modelName':'Migration','columnName':_0x4183('0x2')},'migrations':{'params':[db[_0x4183('0x2b')][_0x4183('0x2d')](),db[_0x4183('0x2b')][_0x4183('0x2e')],function(){throw new Error(_0x4183('0x2f'));}],'path':path[_0x4183('0x24')](config[_0x4183('0x25')],'server',_0x4183('0x22')),'pattern':/\.js$/}});_0x25dce3['up']({'migrations':_[_0x4183('0x30')](_0x518794,function(_0x1d6796){return _0x1d6796+_0x4183('0x28');})})['then'](function(){return _0x514584[_0x4183('0xf')](0xc8)[_0x4183('0x10')]({'output':_0x4183('0x31')+module['exports'][_0x4183('0x2')]+_0x4183('0x32')+_['last'](_0x518794),'migrations':_['join'](_0x518794)});})[_0x4183('0x21')](function(_0x55a120){if(_0x55a120 instanceof db['sequelize'][_0x4183('0x33')]){return _0x514584[_0x4183('0xf')](0xc8)[_0x4183('0x10')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x514584['status'](0x1f4)[_0x4183('0x10')](_0x55a120);}});}else{return _0x514584[_0x4183('0xf')](0xc8)['json']({'output':_0x4183('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 5f34be6..b878335 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 _0xd230=['index','/describe','describe','show','post','create','put','update','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xd230,0x107));var _0x0d23=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xd230[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0d23('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d23('0x1')]();var fs_extra=require(_0x0d23('0x2'));var auth=require(_0x0d23('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0d23('0x4'));var controller=require('./voiceAgentReport.controller');router[_0x0d23('0x5')]('/',auth[_0x0d23('0x6')](),controller[_0x0d23('0x7')]);router[_0x0d23('0x5')](_0x0d23('0x8'),auth[_0x0d23('0x6')](),controller[_0x0d23('0x9')]);router[_0x0d23('0x5')]('/:id',auth[_0x0d23('0x6')](),controller[_0x0d23('0xa')]);router[_0x0d23('0xb')]('/',auth[_0x0d23('0x6')](),controller[_0x0d23('0xc')]);router[_0x0d23('0xd')]('/:id',auth[_0x0d23('0x6')](),controller[_0x0d23('0xe')]);router[_0x0d23('0xf')]('/:id',auth[_0x0d23('0x6')](),controller[_0x0d23('0x10')]);module[_0x0d23('0x11')]=router; \ No newline at end of file +var _0x3297=['post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0x3297,0xc3));var _0x7329=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x3297[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var path=require(_0x7329('0x2'));var timeout=require('connect-timeout');var express=require(_0x7329('0x3'));var router=express[_0x7329('0x4')]();var fs_extra=require(_0x7329('0x5'));var auth=require(_0x7329('0x6'));var interaction=require(_0x7329('0x7'));var config=require('../../config/environment');var controller=require(_0x7329('0x8'));router[_0x7329('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7329('0x9')](_0x7329('0xa'),auth[_0x7329('0xb')](),controller[_0x7329('0xc')]);router['get'](_0x7329('0xd'),auth[_0x7329('0xb')](),controller[_0x7329('0xe')]);router[_0x7329('0xf')]('/',auth[_0x7329('0xb')](),controller['create']);router[_0x7329('0x10')](_0x7329('0xd'),auth['isAuthenticated'](),controller[_0x7329('0x11')]);router[_0x7329('0x12')](_0x7329('0xd'),auth[_0x7329('0xb')](),controller[_0x7329('0x13')]);module[_0x7329('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8ebdc34..67ea02f 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 _0x9563=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x48557d,_0x3d641d){var _0x14852f=function(_0x57f167){while(--_0x57f167){_0x48557d['push'](_0x48557d['shift']());}};_0x14852f(++_0x3d641d);}(_0x9563,0x1e7));var _0x3956=function(_0x3d3e8c,_0x436d0b){_0x3d3e8c=_0x3d3e8c-0x0;var _0x5f4927=_0x9563[_0x3d3e8c];return _0x5f4927;};'use strict';var Sequelize=require(_0x3956('0x0'));module[_0x3956('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3956('0x2')]},'calleridnum':{'type':Sequelize[_0x3956('0x2')]},'calleridname':{'type':Sequelize[_0x3956('0x2')]},'queue':{'type':Sequelize[_0x3956('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x3956('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x3956('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x3956('0x3')]},'agentdumpAt':{'type':Sequelize[_0x3956('0x3')]},'holdtime':{'type':Sequelize[_0x3956('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3956('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3956('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3956('0x4')]},'agentacw':{'type':Sequelize[_0x3956('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3956('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3956('0x2')]},'channelstate':{'type':Sequelize[_0x3956('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3956('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3956('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3956('0x2')]},'accountcode':{'type':Sequelize[_0x3956('0x2')]},'context':{'type':Sequelize[_0x3956('0x2')]},'exten':{'type':Sequelize[_0x3956('0x2')]},'priority':{'type':Sequelize[_0x3956('0x2')]},'destchannel':{'type':Sequelize[_0x3956('0x2')]},'destchannelstate':{'type':Sequelize[_0x3956('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x3956('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3956('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x3956('0x2')]},'destaccountcode':{'type':Sequelize[_0x3956('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x3956('0x2')]},'destpriority':{'type':Sequelize[_0x3956('0x2')]},'destuniqueid':{'type':Sequelize[_0x3956('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3956('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x3956('0x2')]},'transfer':{'type':Sequelize[_0x3956('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3956('0x2')],'comment':_0x3956('0x6')},'transferexten':{'type':Sequelize[_0x3956('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3956('0x2')]},'agententerreason':{'type':Sequelize[_0x3956('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9158=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5b8851,_0x361adf){var _0x27801a=function(_0x126d14){while(--_0x126d14){_0x5b8851['push'](_0x5b8851['shift']());}};_0x27801a(++_0x361adf);}(_0x9158,0x16e));var _0x8915=function(_0x35458c,_0x1aa04a){_0x35458c=_0x35458c-0x0;var _0x4cd46d=_0x9158[_0x35458c];return _0x4cd46d;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'type':{'type':Sequelize[_0x8915('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8915('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8915('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8915('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8915('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8915('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x8915('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8915('0x3')]},'holdtime':{'type':Sequelize[_0x8915('0x4')]},'agentcomplete':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8915('0x4')]},'agentacw':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8915('0x4')]},'reason':{'type':Sequelize[_0x8915('0x2')]},'lastevent':{'type':Sequelize[_0x8915('0x2')]},'channel':{'type':Sequelize[_0x8915('0x2')]},'channelstate':{'type':Sequelize[_0x8915('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8915('0x2')]},'language':{'type':Sequelize[_0x8915('0x2')]},'accountcode':{'type':Sequelize[_0x8915('0x2')]},'context':{'type':Sequelize[_0x8915('0x2')]},'exten':{'type':Sequelize[_0x8915('0x2')]},'priority':{'type':Sequelize[_0x8915('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8915('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8915('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8915('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x8915('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8915('0x2')]},'destcontext':{'type':Sequelize[_0x8915('0x2')]},'destexten':{'type':Sequelize[_0x8915('0x2')]},'destpriority':{'type':Sequelize[_0x8915('0x2')]},'destuniqueid':{'type':Sequelize[_0x8915('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8915('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x8915('0x2')]},'transfer':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8915('0x2')],'comment':_0x8915('0x6')},'transferexten':{'type':Sequelize[_0x8915('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8915('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 4b23470..049c838 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(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 fe11043..9a4bee9 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 _0x1159=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x293393,_0x2acafb){var _0x23c7d3=function(_0x43b869){while(--_0x43b869){_0x293393['push'](_0x293393['shift']());}};_0x23c7d3(++_0x2acafb);}(_0x1159,0xf3));var _0x9115=function(_0xee7502,_0x5d09e0){_0xee7502=_0xee7502-0x0;var _0x1b57fe=_0x1159[_0xee7502];return _0x1b57fe;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9115('0xc'),_0x9115('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2494=['api','moment','bluebird','request-promise','path','./voiceAgentReport.attributes','define','report_agent','uniqueid','destuniqueid','lodash','../../config/logger'];(function(_0xb3cc66,_0x12f3fa){var _0x14fbbf=function(_0x97ff8a){while(--_0x97ff8a){_0xb3cc66['push'](_0xb3cc66['shift']());}};_0x14fbbf(++_0x12f3fa);}(_0x2494,0x82));var _0x4249=function(_0x53025b,_0x2daa99){_0x53025b=_0x53025b-0x0;var _0x50951b=_0x2494[_0x53025b];return _0x50951b;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var logger=require(_0x4249('0x1'))(_0x4249('0x2'));var moment=require(_0x4249('0x3'));var BPromise=require(_0x4249('0x4'));var rp=require(_0x4249('0x5'));var fs=require('fs');var path=require(_0x4249('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module['exports']=function(_0x3c2d8d,_0x1d4ca8){return _0x3c2d8d[_0x4249('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x4249('0x9'),'paranoid':![],'indexes':[{'fields':[_0x4249('0xa'),_0x4249('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 3d429d4..7755dba 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 _0x2adc=['update','body','raw','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','UpdateVoiceAgentReport'];(function(_0x4ecc79,_0x3fcea4){var _0x406258=function(_0x4cda4f){while(--_0x4cda4f){_0x4ecc79['push'](_0x4ecc79['shift']());}};_0x406258(++_0x3fcea4);}(_0x2adc,0x1c5));var _0xc2ad=function(_0x183e51,_0x1194b9){_0x183e51=_0x183e51-0x0;var _0x420b77=_0x2adc[_0x183e51];return _0x420b77;};'use strict';var _=require('lodash');var util=require(_0xc2ad('0x0'));var moment=require(_0xc2ad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2ad('0x2'));var db=require(_0xc2ad('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc2ad('0x4'))(_0xc2ad('0x5'));var config=require(_0xc2ad('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc2ad('0x7')][_0xc2ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x182668,_0x19c4c8,_0x9fdf28){return new BPromise(function(_0x346532,_0x167a3d){return client[_0xc2ad('0x9')](_0x182668,_0x9fdf28)[_0xc2ad('0xa')](function(_0xc75254){logger['info'](_0xc2ad('0xb'),_0x19c4c8,_0xc2ad('0xc'));logger[_0xc2ad('0xd')](_0xc2ad('0xe'),_0x19c4c8,'request\x20sent',JSON[_0xc2ad('0xf')](_0xc75254));if(_0xc75254['error']){if(_0xc75254[_0xc2ad('0x10')][_0xc2ad('0x11')]===0x1f4){logger[_0xc2ad('0x10')](_0xc2ad('0xb'),_0x19c4c8,_0xc75254[_0xc2ad('0x10')][_0xc2ad('0x12')]);return _0x167a3d(_0xc75254['error'][_0xc2ad('0x12')]);}logger['error'](_0xc2ad('0xb'),_0x19c4c8,_0xc75254[_0xc2ad('0x10')][_0xc2ad('0x12')]);return _0x346532(_0xc75254[_0xc2ad('0x10')][_0xc2ad('0x12')]);}else{logger[_0xc2ad('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x19c4c8,'request\x20sent');_0x346532(_0xc75254[_0xc2ad('0x14')][_0xc2ad('0x12')]);}})[_0xc2ad('0x15')](function(_0x1d4640){logger[_0xc2ad('0x10')](_0xc2ad('0xb'),_0x19c4c8,_0x1d4640);_0x167a3d(_0x1d4640);});});}exports[_0xc2ad('0x16')]=function(_0x2dc627){var _0x4533a9=this;return new Promise(function(_0x124ca9,_0x288b48){return db[_0xc2ad('0x17')][_0xc2ad('0x18')](_0x2dc627['body'],{'raw':_0x2dc627[_0xc2ad('0x19')]?_0x2dc627['options']['raw']===undefined?!![]:![]:!![]})[_0xc2ad('0xa')](function(_0x2831f0){logger[_0xc2ad('0x13')](_0xc2ad('0x16'),_0x2dc627);logger[_0xc2ad('0xd')](_0xc2ad('0x16'),_0x2dc627,JSON[_0xc2ad('0xf')](_0x2831f0));_0x124ca9(_0x2831f0);})['catch'](function(_0x44a096){logger[_0xc2ad('0x10')]('CreateVoiceAgentReport',_0x44a096[_0xc2ad('0x12')],_0x2dc627);_0x288b48(_0x4533a9['error'](0x1f4,_0x44a096[_0xc2ad('0x12')]));});});};exports[_0xc2ad('0x1a')]=function(_0x17a682){var _0x40853f=this;return new Promise(function(_0x3063eb,_0x9adaa0){return db['VoiceAgentReport'][_0xc2ad('0x1b')](_0x17a682[_0xc2ad('0x1c')],{'raw':_0x17a682[_0xc2ad('0x19')]?_0x17a682['options'][_0xc2ad('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17a682['options']?_0x17a682['options']['where']||null:null,'attributes':_0x17a682['options']?_0x17a682[_0xc2ad('0x19')][_0xc2ad('0x1e')]||null:null,'limit':_0x17a682['options']?_0x17a682['options'][_0xc2ad('0x1f')]||null:null})[_0xc2ad('0xa')](function(_0x420cf8){logger[_0xc2ad('0x13')](_0xc2ad('0x1a'),_0x17a682);logger[_0xc2ad('0xd')](_0xc2ad('0x1a'),_0x17a682,JSON[_0xc2ad('0xf')](_0x420cf8));_0x3063eb(_0x420cf8);})[_0xc2ad('0x15')](function(_0x29568c){logger[_0xc2ad('0x10')](_0xc2ad('0x1a'),_0x29568c[_0xc2ad('0x12')],_0x17a682);_0x9adaa0(_0x40853f['error'](0x1f4,_0x29568c[_0xc2ad('0x12')]));});});}; \ No newline at end of file +var _0x2c3e=['then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x2c3e,0x11d));var _0xe2c3=function(_0xba2b8,_0x4785c9){_0xba2b8=_0xba2b8-0x0;var _0x9b75ed=_0x2c3e[_0xba2b8];return _0x9b75ed;};'use strict';var _=require(_0xe2c3('0x0'));var util=require(_0xe2c3('0x1'));var moment=require(_0xe2c3('0x2'));var BPromise=require(_0xe2c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2c3('0x4'));var db=require(_0xe2c3('0x5'))['db'];var utils=require(_0xe2c3('0x6'));var logger=require(_0xe2c3('0x7'))(_0xe2c3('0x8'));var config=require('../../config/environment');var jayson=require(_0xe2c3('0x9'));var client=jayson[_0xe2c3('0xa')][_0xe2c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d7d7b,_0x23872e,_0x1b4b86){return new BPromise(function(_0x563b73,_0x426a53){return client['request'](_0x3d7d7b,_0x1b4b86)[_0xe2c3('0xc')](function(_0x1ce464){logger[_0xe2c3('0xd')](_0xe2c3('0xe'),_0x23872e,_0xe2c3('0xf'));logger[_0xe2c3('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x23872e,_0xe2c3('0xf'),JSON['stringify'](_0x1ce464));if(_0x1ce464['error']){if(_0x1ce464[_0xe2c3('0x11')][_0xe2c3('0x12')]===0x1f4){logger[_0xe2c3('0x11')](_0xe2c3('0xe'),_0x23872e,_0x1ce464[_0xe2c3('0x11')][_0xe2c3('0x13')]);return _0x426a53(_0x1ce464[_0xe2c3('0x11')][_0xe2c3('0x13')]);}logger[_0xe2c3('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x23872e,_0x1ce464[_0xe2c3('0x11')][_0xe2c3('0x13')]);return _0x563b73(_0x1ce464[_0xe2c3('0x11')][_0xe2c3('0x13')]);}else{logger[_0xe2c3('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x23872e,'request\x20sent');_0x563b73(_0x1ce464[_0xe2c3('0x14')][_0xe2c3('0x13')]);}})[_0xe2c3('0x15')](function(_0x5ee871){logger[_0xe2c3('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x23872e,_0x5ee871);_0x426a53(_0x5ee871);});});}exports[_0xe2c3('0x16')]=function(_0xfe5097){var _0x2829f1=this;return new Promise(function(_0x2102a7,_0x3f7447){return db[_0xe2c3('0x17')][_0xe2c3('0x18')](_0xfe5097[_0xe2c3('0x19')],{'raw':_0xfe5097[_0xe2c3('0x1a')]?_0xfe5097['options'][_0xe2c3('0x1b')]===undefined?!![]:![]:!![]})[_0xe2c3('0xc')](function(_0xfdb543){logger[_0xe2c3('0xd')](_0xe2c3('0x16'),_0xfe5097);logger[_0xe2c3('0x10')](_0xe2c3('0x16'),_0xfe5097,JSON['stringify'](_0xfdb543));_0x2102a7(_0xfdb543);})[_0xe2c3('0x15')](function(_0x3308e3){logger['error'](_0xe2c3('0x16'),_0x3308e3[_0xe2c3('0x13')],_0xfe5097);_0x3f7447(_0x2829f1['error'](0x1f4,_0x3308e3[_0xe2c3('0x13')]));});});};exports[_0xe2c3('0x1c')]=function(_0x42eddd){var _0x2f0cc7=this;return new Promise(function(_0x404656,_0x206268){return db[_0xe2c3('0x17')][_0xe2c3('0x1d')](_0x42eddd[_0xe2c3('0x19')],{'raw':_0x42eddd[_0xe2c3('0x1a')]?_0x42eddd[_0xe2c3('0x1a')][_0xe2c3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42eddd[_0xe2c3('0x1a')]?_0x42eddd[_0xe2c3('0x1a')][_0xe2c3('0x1e')]||null:null,'attributes':_0x42eddd[_0xe2c3('0x1a')]?_0x42eddd['options'][_0xe2c3('0x1f')]||null:null,'limit':_0x42eddd[_0xe2c3('0x1a')]?_0x42eddd['options']['limit']||null:null})[_0xe2c3('0xc')](function(_0x561997){logger[_0xe2c3('0xd')](_0xe2c3('0x1c'),_0x42eddd);logger[_0xe2c3('0x10')](_0xe2c3('0x1c'),_0x42eddd,JSON[_0xe2c3('0x20')](_0x561997));_0x404656(_0x561997);})[_0xe2c3('0x15')](function(_0x449205){logger[_0xe2c3('0x11')](_0xe2c3('0x1c'),_0x449205[_0xe2c3('0x13')],_0x42eddd);_0x206268(_0x2f0cc7[_0xe2c3('0x11')](0x1f4,_0x449205[_0xe2c3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d639f83..f812f68 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 _0xc949=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x36f906,_0x2585ac){var _0x29276f=function(_0x23ec94){while(--_0x23ec94){_0x36f906['push'](_0x36f906['shift']());}};_0x29276f(++_0x2585ac);}(_0xc949,0x181));var _0x9c94=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xc949[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0xf')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x10')]);router['put'](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0x12')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);module[_0x9c94('0x14')]=router; \ No newline at end of file +var _0x5ad3=['isAuthenticated','index','describe','create','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x25f7d5,_0x887c4){var _0xe7c406=function(_0x54e28b){while(--_0x54e28b){_0x25f7d5['push'](_0x25f7d5['shift']());}};_0xe7c406(++_0x887c4);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x52ae40,_0x23c2bf){_0x52ae40=_0x52ae40-0x0;var _0xab6ed1=_0x5ad3[_0x52ae40];return _0xab6ed1;};'use strict';var multer=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var path=require(_0x35ad('0x2'));var timeout=require(_0x35ad('0x3'));var express=require('express');var router=express[_0x35ad('0x4')]();var fs_extra=require(_0x35ad('0x5'));var auth=require(_0x35ad('0x6'));var interaction=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var controller=require(_0x35ad('0x9'));router[_0x35ad('0xa')]('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xc')]);router[_0x35ad('0xa')]('/describe',auth[_0x35ad('0xb')](),controller[_0x35ad('0xd')]);router[_0x35ad('0xa')]('/:id',auth[_0x35ad('0xb')](),controller['show']);router['post']('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xe')]);router['put'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['update']);router['delete'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['destroy']);module[_0x35ad('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 75bea01..67a80af 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 _0xbfda=['inbound','internal','outbound','inbound-fax','dialer','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x44a317,_0x144fe2){var _0x3e1d57=function(_0x53a6f8){while(--_0x53a6f8){_0x44a317['push'](_0x44a317['shift']());}};_0x3e1d57(++_0x144fe2);}(_0xbfda,0x193));var _0xabfd=function(_0x1cd65a,_0x29fa8f){_0x1cd65a=_0x1cd65a-0x0;var _0xf93849=_0xbfda[_0x1cd65a];return _0xf93849;};'use strict';var Sequelize=require(_0xabfd('0x0'));module[_0xabfd('0x1')]={'uniqueid':{'type':Sequelize[_0xabfd('0x2')]},'type':{'type':Sequelize[_0xabfd('0x3')](_0xabfd('0x4'),_0xabfd('0x5'),_0xabfd('0x6'),_0xabfd('0x7'),'outbound-fax',_0xabfd('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xabfd('0x2')]},'source':{'type':Sequelize[_0xabfd('0x2')]},'destination':{'type':Sequelize[_0xabfd('0x2')]},'destinationcontext':{'type':Sequelize[_0xabfd('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xabfd('0x2')]},'destinationchannel':{'type':Sequelize[_0xabfd('0x2')]},'lastapplication':{'type':Sequelize[_0xabfd('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xabfd('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xabfd('0x9')]},'endtime':{'type':Sequelize[_0xabfd('0x9')]},'duration':{'type':Sequelize[_0xabfd('0xa')]},'billableseconds':{'type':Sequelize[_0xabfd('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xabfd('0x2')]},'amaflags':{'type':Sequelize[_0xabfd('0x2')]},'userfield':{'type':Sequelize[_0xabfd('0x2')]},'userDisposition':{'type':Sequelize[_0xabfd('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xabfd('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xabfd('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xabfd('0x2')]},'routeid':{'type':Sequelize[_0xabfd('0xa')]},'sipcallid':{'type':Sequelize[_0xabfd('0x2')]}}; \ No newline at end of file +var _0xd125=['internal','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','exports','STRING','ENUM','inbound'];(function(_0x32986,_0x4489c8){var _0x355ebb=function(_0x338840){while(--_0x338840){_0x32986['push'](_0x32986['shift']());}};_0x355ebb(++_0x4489c8);}(_0xd125,0x92));var _0x5d12=function(_0x2e4156,_0x428734){_0x2e4156=_0x2e4156-0x0;var _0x406780=_0xd125[_0x2e4156];return _0x406780;};'use strict';var Sequelize=require('sequelize');module[_0x5d12('0x0')]={'uniqueid':{'type':Sequelize[_0x5d12('0x1')]},'type':{'type':Sequelize[_0x5d12('0x2')](_0x5d12('0x3'),_0x5d12('0x4'),'outbound',_0x5d12('0x5'),_0x5d12('0x6'),'dialer')},'tag':{'type':Sequelize[_0x5d12('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x5d12('0x1')]},'destination':{'type':Sequelize[_0x5d12('0x1')]},'destinationcontext':{'type':Sequelize[_0x5d12('0x1')]},'callerid':{'type':Sequelize[_0x5d12('0x1')]},'channel':{'type':Sequelize[_0x5d12('0x1')]},'destinationchannel':{'type':Sequelize[_0x5d12('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5d12('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x5d12('0x8')]},'answertime':{'type':Sequelize[_0x5d12('0x8')]},'endtime':{'type':Sequelize[_0x5d12('0x8')]},'duration':{'type':Sequelize[_0x5d12('0x9')]},'billableseconds':{'type':Sequelize[_0x5d12('0x9')]},'mohtime':{'type':Sequelize[_0x5d12('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5d12('0x1')]},'amaflags':{'type':Sequelize[_0x5d12('0x1')]},'userfield':{'type':Sequelize[_0x5d12('0x1')]},'userDisposition':{'type':Sequelize[_0x5d12('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5d12('0x1')]},'prefix':{'type':Sequelize[_0x5d12('0x1')]},'routeid':{'type':Sequelize[_0x5d12('0x9')]},'sipcallid':{'type':Sequelize[_0x5d12('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 87ea70c..00a3d82 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(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xadb5,0xad));var _0x5adb=function(_0x28ab34,_0x419292){_0x28ab34=_0x28ab34-0x0;var _0x1a398e=_0xadb5[_0x28ab34];return _0x1a398e;};'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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x2ef3,0xba));var _0x32ef=function(_0x54d218,_0x3be342){_0x54d218=_0x54d218-0x0;var _0xaed0e2=_0x2ef3[_0x54d218];return _0xaed0e2;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index f1d27e7..1eb966c 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 _0xd1f0=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','util','api','moment','bluebird'];(function(_0x1ab758,_0x3dbede){var _0x5788a0=function(_0x324d24){while(--_0x324d24){_0x1ab758['push'](_0x1ab758['shift']());}};_0x5788a0(++_0x3dbede);}(_0xd1f0,0x168));var _0x0d1f=function(_0x55c97d,_0x228ffc){_0x55c97d=_0x55c97d-0x0;var _0x1d5112=_0xd1f0[_0x55c97d];return _0x1d5112;};'use strict';var _=require('lodash');var util=require(_0x0d1f('0x0'));var logger=require('../../config/logger')(_0x0d1f('0x1'));var moment=require(_0x0d1f('0x2'));var BPromise=require(_0x0d1f('0x3'));var rp=require(_0x0d1f('0x4'));var fs=require('fs');var path=require(_0x0d1f('0x5'));var rimraf=require(_0x0d1f('0x6'));var config=require(_0x0d1f('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x0d1f('0x8')]=function(_0x30b190,_0x19f2c1){return _0x30b190[_0x0d1f('0x9')](_0x0d1f('0xa'),attributes,{'tableName':_0x0d1f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x0d1f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b4e=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x2d40d3,_0x126604){var _0x1db2d2=function(_0xb8ffd9){while(--_0xb8ffd9){_0x2d40d3['push'](_0x2d40d3['shift']());}};_0x1db2d2(++_0x126604);}(_0x0b4e,0x144));var _0xe0b4=function(_0x3b4ae5,_0x21bdd4){_0x3b4ae5=_0x3b4ae5-0x0;var _0x3ff2f0=_0x0b4e[_0x3b4ae5];return _0x3ff2f0;};'use strict';var _=require(_0xe0b4('0x0'));var util=require('util');var logger=require(_0xe0b4('0x1'))(_0xe0b4('0x2'));var moment=require(_0xe0b4('0x3'));var BPromise=require(_0xe0b4('0x4'));var rp=require(_0xe0b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0b4('0x6'));var config=require(_0xe0b4('0x7'));var attributes=require(_0xe0b4('0x8'));module['exports']=function(_0x274f02,_0x4db178){return _0x274f02[_0xe0b4('0x9')](_0xe0b4('0xa'),attributes,{'tableName':_0xe0b4('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe0b4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index b53c603..c44dc42 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 _0x4571=['error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a7900,_0x2a9500){var _0x415c93=function(_0x322478){while(--_0x322478){_0x1a7900['push'](_0x1a7900['shift']());}};_0x415c93(++_0x2a9500);}(_0x4571,0xa3));var _0x1457=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x4571[_0x2d2ca2];return _0x48489d;};'use strict';var _=require(_0x1457('0x0'));var util=require(_0x1457('0x1'));var moment=require(_0x1457('0x2'));var BPromise=require(_0x1457('0x3'));var rs=require(_0x1457('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1457('0x5'));var logger=require('../../config/logger')(_0x1457('0x6'));var config=require('../../config/environment');var jayson=require(_0x1457('0x7'));var client=jayson['client'][_0x1457('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40b251,_0x3fedcd,_0x16af49){return new BPromise(function(_0x5c2e1e,_0x4fe47e){return client[_0x1457('0x9')](_0x40b251,_0x16af49)[_0x1457('0xa')](function(_0x1253df){logger[_0x1457('0xb')](_0x1457('0xc'),_0x3fedcd,_0x1457('0xd'));logger[_0x1457('0xe')](_0x1457('0xf'),_0x3fedcd,_0x1457('0xd'),JSON[_0x1457('0x10')](_0x1253df));if(_0x1253df['error']){if(_0x1253df[_0x1457('0x11')]['code']===0x1f4){logger['error'](_0x1457('0xc'),_0x3fedcd,_0x1253df[_0x1457('0x11')]['message']);return _0x4fe47e(_0x1253df['error'][_0x1457('0x12')]);}logger['error'](_0x1457('0xc'),_0x3fedcd,_0x1253df[_0x1457('0x11')][_0x1457('0x12')]);return _0x5c2e1e(_0x1253df[_0x1457('0x11')][_0x1457('0x12')]);}else{logger[_0x1457('0xb')](_0x1457('0xc'),_0x3fedcd,_0x1457('0xd'));_0x5c2e1e(_0x1253df[_0x1457('0x13')]['message']);}})[_0x1457('0x14')](function(_0x574f6d){logger[_0x1457('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x3fedcd,_0x574f6d);_0x4fe47e(_0x574f6d);});});}exports[_0x1457('0x15')]=function(_0x4bab0c){var _0xe411b1=this;return new Promise(function(_0x2eb750,_0x1d9c36){return db[_0x1457('0x16')][_0x1457('0x17')]({'raw':_0x4bab0c['options']?_0x4bab0c['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bab0c['options']?_0x4bab0c[_0x1457('0x18')][_0x1457('0x19')]||null:null,'attributes':_0x4bab0c[_0x1457('0x18')]?_0x4bab0c['options'][_0x1457('0x1a')]||null:null,'limit':_0x4bab0c[_0x1457('0x18')]?_0x4bab0c[_0x1457('0x18')][_0x1457('0x1b')]||null:null,'include':_0x4bab0c['options']?_0x4bab0c[_0x1457('0x18')][_0x1457('0x1c')]?_[_0x1457('0x1d')](_0x4bab0c[_0x1457('0x18')][_0x1457('0x1c')],function(_0xa799cf){return{'model':db[_0xa799cf[_0x1457('0x1e')]],'as':_0xa799cf['as'],'attributes':_0xa799cf[_0x1457('0x1a')],'include':_0xa799cf[_0x1457('0x1c')]?_['map'](_0xa799cf[_0x1457('0x1c')],function(_0x141b9c){return{'model':db[_0x141b9c[_0x1457('0x1e')]],'as':_0x141b9c['as'],'attributes':_0x141b9c['attributes'],'include':_0x141b9c[_0x1457('0x1c')]?_[_0x1457('0x1d')](_0x141b9c['include'],function(_0x33ccb1){return{'model':db[_0x33ccb1[_0x1457('0x1e')]],'as':_0x33ccb1['as'],'attributes':_0x33ccb1[_0x1457('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1192a3){logger[_0x1457('0xb')]('GetVoiceCallReport',_0x4bab0c);logger['debug'](_0x1457('0x15'),_0x4bab0c,JSON[_0x1457('0x10')](_0x1192a3));_0x2eb750(_0x1192a3);})[_0x1457('0x14')](function(_0x135729){logger[_0x1457('0x11')](_0x1457('0x15'),_0x135729['message'],_0x4bab0c);_0x1d9c36(_0xe411b1[_0x1457('0x11')](0x1f4,_0x135729['message']));});});};exports[_0x1457('0x1f')]=function(_0x37dd56){var _0xc690a4=this;return new Promise(function(_0x2e2b63,_0x1c0a2a){return db['VoiceCallReport'][_0x1457('0x20')](_0x37dd56[_0x1457('0x21')],{'raw':_0x37dd56['options']?_0x37dd56[_0x1457('0x18')][_0x1457('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0xa2e91a){logger[_0x1457('0xb')](_0x1457('0x1f'),_0x37dd56);logger[_0x1457('0xe')](_0x1457('0x1f'),_0x37dd56,JSON['stringify'](_0xa2e91a));_0x2e2b63(_0xa2e91a);})[_0x1457('0x14')](function(_0x359642){logger['error'](_0x1457('0x1f'),_0x359642[_0x1457('0x12')],_0x37dd56);_0x1c0a2a(_0xc690a4[_0x1457('0x11')](0x1f4,_0x359642[_0x1457('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x2b39ab){var _0x52097b=this;return new Promise(function(_0x1f9350,_0x2fdad0){return db[_0x1457('0x16')]['update'](_0x2b39ab[_0x1457('0x21')],{'raw':_0x2b39ab[_0x1457('0x18')]?_0x2b39ab[_0x1457('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b39ab[_0x1457('0x18')]?_0x2b39ab[_0x1457('0x18')][_0x1457('0x19')]||null:null,'attributes':_0x2b39ab[_0x1457('0x18')]?_0x2b39ab[_0x1457('0x18')]['attributes']||null:null,'limit':_0x2b39ab[_0x1457('0x18')]?_0x2b39ab[_0x1457('0x18')][_0x1457('0x1b')]||null:null})['then'](function(_0x1ac329){logger[_0x1457('0xb')](_0x1457('0x23'),_0x2b39ab);logger[_0x1457('0xe')](_0x1457('0x23'),_0x2b39ab,JSON[_0x1457('0x10')](_0x1ac329));_0x1f9350(_0x1ac329);})[_0x1457('0x14')](function(_0x1669ce){logger[_0x1457('0x11')](_0x1457('0x23'),_0x1669ce[_0x1457('0x12')],_0x2b39ab);_0x2fdad0(_0x52097b[_0x1457('0x11')](0x1f4,_0x1669ce[_0x1457('0x12')]));});});}; \ No newline at end of file +var _0xd4de=['update','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetVoiceCallReport','findAll','options','where','attributes','limit','include','map','CreateVoiceCallReport','VoiceCallReport','body','raw','stringify','UpdateVoiceCallReport'];(function(_0x2306d8,_0x47ebf0){var _0x339960=function(_0x379f92){while(--_0x379f92){_0x2306d8['push'](_0x2306d8['shift']());}};_0x339960(++_0x47ebf0);}(_0xd4de,0x173));var _0xed4d=function(_0x4aeb57,_0xeb977b){_0x4aeb57=_0x4aeb57-0x0;var _0x5051d2=_0xd4de[_0x4aeb57];return _0x5051d2;};'use strict';var _=require(_0xed4d('0x0'));var util=require(_0xed4d('0x1'));var moment=require(_0xed4d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed4d('0x3'))['db'];var utils=require(_0xed4d('0x4'));var logger=require('../../config/logger')(_0xed4d('0x5'));var config=require(_0xed4d('0x6'));var jayson=require(_0xed4d('0x7'));var client=jayson[_0xed4d('0x8')][_0xed4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b2aa7,_0xf191d9,_0x47dcd6){return new BPromise(function(_0x2b9561,_0x2dc01f){return client[_0xed4d('0xa')](_0x5b2aa7,_0x47dcd6)[_0xed4d('0xb')](function(_0x3eb7c7){logger[_0xed4d('0xc')](_0xed4d('0xd'),_0xf191d9,_0xed4d('0xe'));logger[_0xed4d('0xf')](_0xed4d('0x10'),_0xf191d9,_0xed4d('0xe'),JSON['stringify'](_0x3eb7c7));if(_0x3eb7c7['error']){if(_0x3eb7c7['error'][_0xed4d('0x11')]===0x1f4){logger[_0xed4d('0x12')](_0xed4d('0xd'),_0xf191d9,_0x3eb7c7[_0xed4d('0x12')][_0xed4d('0x13')]);return _0x2dc01f(_0x3eb7c7['error'][_0xed4d('0x13')]);}logger['error'](_0xed4d('0xd'),_0xf191d9,_0x3eb7c7[_0xed4d('0x12')]['message']);return _0x2b9561(_0x3eb7c7[_0xed4d('0x12')][_0xed4d('0x13')]);}else{logger[_0xed4d('0xc')](_0xed4d('0xd'),_0xf191d9,_0xed4d('0xe'));_0x2b9561(_0x3eb7c7[_0xed4d('0x14')][_0xed4d('0x13')]);}})[_0xed4d('0x15')](function(_0xb8c12c){logger[_0xed4d('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0xf191d9,_0xb8c12c);_0x2dc01f(_0xb8c12c);});});}exports[_0xed4d('0x16')]=function(_0x545c04){var _0x20586c=this;return new Promise(function(_0x2a515a,_0x4c3612){return db['VoiceCallReport'][_0xed4d('0x17')]({'raw':_0x545c04[_0xed4d('0x18')]?_0x545c04[_0xed4d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x545c04[_0xed4d('0x18')]?_0x545c04[_0xed4d('0x18')][_0xed4d('0x19')]||null:null,'attributes':_0x545c04[_0xed4d('0x18')]?_0x545c04['options'][_0xed4d('0x1a')]||null:null,'limit':_0x545c04[_0xed4d('0x18')]?_0x545c04[_0xed4d('0x18')][_0xed4d('0x1b')]||null:null,'include':_0x545c04['options']?_0x545c04[_0xed4d('0x18')][_0xed4d('0x1c')]?_[_0xed4d('0x1d')](_0x545c04['options'][_0xed4d('0x1c')],function(_0x50292b){return{'model':db[_0x50292b['model']],'as':_0x50292b['as'],'attributes':_0x50292b[_0xed4d('0x1a')],'include':_0x50292b[_0xed4d('0x1c')]?_[_0xed4d('0x1d')](_0x50292b[_0xed4d('0x1c')],function(_0x5393ab){return{'model':db[_0x5393ab['model']],'as':_0x5393ab['as'],'attributes':_0x5393ab[_0xed4d('0x1a')],'include':_0x5393ab['include']?_[_0xed4d('0x1d')](_0x5393ab[_0xed4d('0x1c')],function(_0x1c5efa){return{'model':db[_0x1c5efa['model']],'as':_0x1c5efa['as'],'attributes':_0x1c5efa[_0xed4d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a43af){logger[_0xed4d('0xc')](_0xed4d('0x16'),_0x545c04);logger['debug'](_0xed4d('0x16'),_0x545c04,JSON['stringify'](_0x1a43af));_0x2a515a(_0x1a43af);})['catch'](function(_0x6b90ac){logger[_0xed4d('0x12')]('GetVoiceCallReport',_0x6b90ac[_0xed4d('0x13')],_0x545c04);_0x4c3612(_0x20586c['error'](0x1f4,_0x6b90ac[_0xed4d('0x13')]));});});};exports[_0xed4d('0x1e')]=function(_0x773934){var _0xe6568f=this;return new Promise(function(_0x510bcc,_0x590ae8){return db[_0xed4d('0x1f')]['create'](_0x773934[_0xed4d('0x20')],{'raw':_0x773934['options']?_0x773934[_0xed4d('0x18')][_0xed4d('0x21')]===undefined?!![]:![]:!![]})[_0xed4d('0xb')](function(_0x336e3f){logger[_0xed4d('0xc')](_0xed4d('0x1e'),_0x773934);logger[_0xed4d('0xf')](_0xed4d('0x1e'),_0x773934,JSON[_0xed4d('0x22')](_0x336e3f));_0x510bcc(_0x336e3f);})[_0xed4d('0x15')](function(_0x46ddfc){logger[_0xed4d('0x12')](_0xed4d('0x1e'),_0x46ddfc[_0xed4d('0x13')],_0x773934);_0x590ae8(_0xe6568f[_0xed4d('0x12')](0x1f4,_0x46ddfc[_0xed4d('0x13')]));});});};exports[_0xed4d('0x23')]=function(_0x540acb){var _0x2bfcff=this;return new Promise(function(_0xfc68e4,_0x4b4819){return db[_0xed4d('0x1f')][_0xed4d('0x24')](_0x540acb['body'],{'raw':_0x540acb[_0xed4d('0x18')]?_0x540acb['options'][_0xed4d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540acb[_0xed4d('0x18')]?_0x540acb[_0xed4d('0x18')][_0xed4d('0x19')]||null:null,'attributes':_0x540acb[_0xed4d('0x18')]?_0x540acb[_0xed4d('0x18')][_0xed4d('0x1a')]||null:null,'limit':_0x540acb[_0xed4d('0x18')]?_0x540acb[_0xed4d('0x18')]['limit']||null:null})[_0xed4d('0xb')](function(_0x50013e){logger['info']('UpdateVoiceCallReport',_0x540acb);logger[_0xed4d('0xf')](_0xed4d('0x23'),_0x540acb,JSON[_0xed4d('0x22')](_0x50013e));_0xfc68e4(_0x50013e);})[_0xed4d('0x15')](function(_0x167fe6){logger[_0xed4d('0x12')](_0xed4d('0x23'),_0x167fe6[_0xed4d('0x13')],_0x540acb);_0x4b4819(_0x2bfcff[_0xed4d('0x12')](0x1f4,_0x167fe6[_0xed4d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3c1b851..f843220 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 _0x18c0=['index','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x23d4ce,_0x3c2d33){var _0x5bb76f=function(_0x5a88dc){while(--_0x5a88dc){_0x23d4ce['push'](_0x23d4ce['shift']());}};_0x5bb76f(++_0x3c2d33);}(_0x18c0,0x19d));var _0x018c=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x18c0[_0x2be8c2];return _0x97f531;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x018c('0x0'));var timeout=require(_0x018c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x018c('0x2'));var interaction=require(_0x018c('0x3'));var config=require(_0x018c('0x4'));var controller=require('./voiceChanSpy.controller');router[_0x018c('0x5')]('/',auth[_0x018c('0x6')](),controller[_0x018c('0x7')]);router[_0x018c('0x5')](_0x018c('0x8'),auth[_0x018c('0x6')](),controller['show']);router['post']('/',auth[_0x018c('0x6')](),controller[_0x018c('0x9')]);router[_0x018c('0xa')](_0x018c('0x8'),auth[_0x018c('0x6')](),controller[_0x018c('0xb')]);router[_0x018c('0xc')](_0x018c('0x8'),auth[_0x018c('0x6')](),controller[_0x018c('0xd')]);module[_0x018c('0xe')]=router; \ No newline at end of file +var _0x0f93=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x5c537b,_0x45d157){var _0x4be047=function(_0x9befd7){while(--_0x9befd7){_0x5c537b['push'](_0x5c537b['shift']());}};_0x4be047(++_0x45d157);}(_0x0f93,0x177));var _0x30f9=function(_0x482e79,_0x1271c7){_0x482e79=_0x482e79-0x0;var _0x1c696f=_0x0f93[_0x482e79];return _0x1c696f;};'use strict';var multer=require(_0x30f9('0x0'));var util=require(_0x30f9('0x1'));var path=require(_0x30f9('0x2'));var timeout=require(_0x30f9('0x3'));var express=require(_0x30f9('0x4'));var router=express[_0x30f9('0x5')]();var fs_extra=require(_0x30f9('0x6'));var auth=require(_0x30f9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x30f9('0x8'));var controller=require(_0x30f9('0x9'));router[_0x30f9('0xa')]('/',auth[_0x30f9('0xb')](),controller[_0x30f9('0xc')]);router[_0x30f9('0xa')](_0x30f9('0xd'),auth[_0x30f9('0xb')](),controller[_0x30f9('0xe')]);router[_0x30f9('0xf')]('/',auth[_0x30f9('0xb')](),controller[_0x30f9('0x10')]);router[_0x30f9('0x11')](_0x30f9('0xd'),auth[_0x30f9('0xb')](),controller[_0x30f9('0x12')]);router['delete'](_0x30f9('0xd'),auth[_0x30f9('0xb')](),controller[_0x30f9('0x13')]);module[_0x30f9('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 91ec757..78dbd76 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 _0x4daa=['options','getDataValue','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x3eb118,_0x77da1f){var _0xb34326=function(_0x2f244c){while(--_0x2f244c){_0x3eb118['push'](_0x3eb118['shift']());}};_0xb34326(++_0x77da1f);}(_0x4daa,0x133));var _0xa4da=function(_0x3a02f2,_0x381e2e){_0x3a02f2=_0x3a02f2-0x0;var _0x867e4d=_0x4daa[_0x3a02f2];return _0x867e4d;};'use strict';var Sequelize=require(_0xa4da('0x0'));module[_0xa4da('0x1')]={'name':{'type':Sequelize[_0xa4da('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xa4da('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xa4da('0x2')],'set':function(_0x104e39){this[_0xa4da('0x4')](_0xa4da('0x5'),_0x104e39?_0x104e39['join'](''):[]);},'get':function(){return this[_0xa4da('0x6')](_0xa4da('0x5'))?this[_0xa4da('0x6')](_0xa4da('0x5'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xa4da('0x2')]},'record':{'type':Sequelize[_0xa4da('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa4da('0x2')]},'description':{'type':Sequelize[_0xa4da('0x2')]}}; \ No newline at end of file +var _0xc9aa=['join','getDataValue','options','split','BOOLEAN','exports','STRING','name'];(function(_0x16485d,_0x2de91a){var _0x4ef13a=function(_0x371129){while(--_0x371129){_0x16485d['push'](_0x16485d['shift']());}};_0x4ef13a(++_0x2de91a);}(_0xc9aa,0x175));var _0xac9a=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0xc9aa[_0x57014b];return _0x2b258a;};'use strict';var Sequelize=require('sequelize');module[_0xac9a('0x0')]={'name':{'type':Sequelize[_0xac9a('0x1')]},'prefix':{'type':Sequelize[_0xac9a('0x1')],'unique':_0xac9a('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xac9a('0x1')],'set':function(_0x50bb87){this['setDataValue']('options',_0x50bb87?_0x50bb87[_0xac9a('0x3')](''):[]);},'get':function(){return this[_0xac9a('0x4')](_0xac9a('0x5'))?this[_0xac9a('0x4')]('options')[_0xac9a('0x6')](''):[];}},'auth':{'type':Sequelize[_0xac9a('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xac9a('0x1')]},'record':{'type':Sequelize[_0xac9a('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xac9a('0x1')]},'description':{'type':Sequelize[_0xac9a('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index c702c31..8ae975a 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 _0xa20a=['keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query'];(function(_0x2b6bdd,_0x38067b){var _0x42a1f3=function(_0x4afe5d){while(--_0x4afe5d){_0x2b6bdd['push'](_0x2b6bdd['shift']());}};_0x42a1f3(++_0x38067b);}(_0xa20a,0x74));var _0xaa20=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xa20a[_0x4b73a2];return _0x383c66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa20('0x0'));var jsonpatch=require(_0xaa20('0x1'));var rp=require(_0xaa20('0x2'));var moment=require(_0xaa20('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xaa20('0x4'));var util=require(_0xaa20('0x5'));var path=require(_0xaa20('0x6'));var sox=require(_0xaa20('0x7'));var csv=require(_0xaa20('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa20('0x9'));var squel=require(_0xaa20('0xa'));var crypto=require(_0xaa20('0xb'));var jsforce=require(_0xaa20('0xc'));var deskjs=require(_0xaa20('0xd'));var toCsv=require(_0xaa20('0x8'));var querystring=require(_0xaa20('0xe'));var Papa=require(_0xaa20('0xf'));var Redis=require(_0xaa20('0x10'));var authService=require(_0xaa20('0x11'));var qs=require(_0xaa20('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa20('0x13'));var logger=require(_0xaa20('0x14'))('api');var utils=require(_0xaa20('0x15'));var config=require(_0xaa20('0x16'));var licenseUtil=require(_0xaa20('0x17'));var db=require(_0xaa20('0x18'))['db'];function respondWithStatusCode(_0x36f915,_0x2fdd4f){_0x2fdd4f=_0x2fdd4f||0xcc;return function(_0x48848f){if(_0x48848f){return _0x36f915[_0xaa20('0x19')](_0x2fdd4f);}return _0x36f915[_0xaa20('0x1a')](_0x2fdd4f)[_0xaa20('0x1b')]();};}function respondWithResult(_0x364459,_0x179b55){_0x179b55=_0x179b55||0xc8;return function(_0xd88a1c){if(_0xd88a1c){return _0x364459[_0xaa20('0x1a')](_0x179b55)[_0xaa20('0x1c')](_0xd88a1c);}};}function respondWithFilteredResult(_0x1ae3fd,_0x1519d3){return function(_0x1e0cc8){if(_0x1e0cc8){var _0x30f531=typeof _0x1519d3[_0xaa20('0x1d')]===_0xaa20('0x1e')&&typeof _0x1519d3[_0xaa20('0x1f')]===_0xaa20('0x1e');var _0x77330d=_0x1e0cc8['count'];var _0x2acd8d=_0x30f531?0x0:_0x1519d3['offset'];var _0x278b6a=_0x30f531?_0x1e0cc8[_0xaa20('0x20')]:_0x1519d3['offset']+_0x1519d3[_0xaa20('0x1f')];var _0x3400b4;if(_0x278b6a>=_0x77330d){_0x278b6a=_0x77330d;_0x3400b4=0xc8;}else{_0x3400b4=0xce;}_0x1ae3fd[_0xaa20('0x1a')](_0x3400b4);return _0x1ae3fd[_0xaa20('0x21')](_0xaa20('0x22'),_0x2acd8d+'-'+_0x278b6a+'/'+_0x77330d)['json'](_0x1e0cc8);}return null;};}function patchUpdates(_0x4ace68){return function(_0x4b6991){try{jsonpatch['apply'](_0x4b6991,_0x4ace68,!![]);}catch(_0x5ac873){return BPromise[_0xaa20('0x23')](_0x5ac873);}return _0x4b6991[_0xaa20('0x24')]();};}function saveUpdates(_0x10c96e,_0x1766f5){return function(_0x3a6b49){if(_0x3a6b49){return _0x3a6b49[_0xaa20('0x25')](_0x10c96e)[_0xaa20('0x26')](function(_0x4209df){return _0x4209df;});}return null;};}function removeEntity(_0x82f28,_0x48aa88){return function(_0x5a2905){if(_0x5a2905){return _0x5a2905[_0xaa20('0x27')]()[_0xaa20('0x26')](function(){var _0x55ac29=_0x5a2905[_0xaa20('0x28')]({'plain':!![]});var _0x1388dc='ChanSpies';return db[_0xaa20('0x29')][_0xaa20('0x27')]({'where':{'type':_0x1388dc,'resourceId':_0x55ac29['id']}})['then'](function(){return _0x5a2905;});})[_0xaa20('0x26')](function(){_0x82f28['status'](0xcc)[_0xaa20('0x1b')]();});}};}function handleEntityNotFound(_0x7ffdf1,_0x213d4e){return function(_0x3c166d){if(!_0x3c166d){_0x7ffdf1[_0xaa20('0x19')](0x194);}return _0x3c166d;};}function handleError(_0x31f9f8,_0x532320){_0x532320=_0x532320||0x1f4;return function(_0x1b71df){logger['error'](_0x1b71df['stack']);if(_0x1b71df[_0xaa20('0x2a')]){delete _0x1b71df[_0xaa20('0x2a')];}_0x31f9f8[_0xaa20('0x1a')](_0x532320)[_0xaa20('0x2b')](_0x1b71df);};}exports['index']=function(_0x4d46fc,_0xe0a579){var _0x4483f6={},_0x5ce607={},_0x40b5d9={'count':0x0,'rows':[]};var _0x25b7b4=_[_0xaa20('0x2c')](db[_0xaa20('0x2d')][_0xaa20('0x2e')],function(_0x1596b7){return{'name':_0x1596b7[_0xaa20('0x2f')],'type':_0x1596b7[_0xaa20('0x30')][_0xaa20('0x31')]};});_0x5ce607[_0xaa20('0x32')]=_['map'](_0x25b7b4,_0xaa20('0x2a'));_0x5ce607[_0xaa20('0x33')]=_[_0xaa20('0x34')](_0x4d46fc[_0xaa20('0x33')]);_0x5ce607['filters']=_['intersection'](_0x5ce607[_0xaa20('0x32')],_0x5ce607[_0xaa20('0x33')]);_0x4483f6[_0xaa20('0x35')]=_['intersection'](_0x5ce607[_0xaa20('0x32')],qs[_0xaa20('0x36')](_0x4d46fc[_0xaa20('0x33')]['fields']));_0x4483f6[_0xaa20('0x35')]=_0x4483f6[_0xaa20('0x35')][_0xaa20('0x37')]?_0x4483f6[_0xaa20('0x35')]:_0x5ce607[_0xaa20('0x32')];if(!_0x4d46fc[_0xaa20('0x33')][_0xaa20('0x38')]('nolimit')){_0x4483f6[_0xaa20('0x1f')]=qs['limit'](_0x4d46fc['query'][_0xaa20('0x1f')]);_0x4483f6[_0xaa20('0x1d')]=qs['offset'](_0x4d46fc[_0xaa20('0x33')][_0xaa20('0x1d')]);}_0x4483f6[_0xaa20('0x39')]=qs[_0xaa20('0x3a')](_0x4d46fc[_0xaa20('0x33')][_0xaa20('0x3a')]);_0x4483f6[_0xaa20('0x3b')]=qs[_0xaa20('0x3c')](_[_0xaa20('0x3d')](_0x4d46fc[_0xaa20('0x33')],_0x5ce607[_0xaa20('0x3c')]),_0x25b7b4);if(_0x4d46fc[_0xaa20('0x33')][_0xaa20('0x3e')]){_0x4483f6[_0xaa20('0x3b')]=_['merge'](_0x4483f6[_0xaa20('0x3b')],{'$or':_['map'](_0x25b7b4,function(_0x504f71){if(_0x504f71['type']!==_0xaa20('0x3f')){var _0x498c05={};_0x498c05[_0x504f71[_0xaa20('0x2a')]]={'$like':'%'+_0x4d46fc['query'][_0xaa20('0x3e')]+'%'};return _0x498c05;}})});}_0x4483f6=_['merge']({},_0x4483f6,_0x4d46fc[_0xaa20('0x40')]);var _0x4b8572={'where':_0x4483f6[_0xaa20('0x3b')]};return db['VoiceChanSpy'][_0xaa20('0x20')](_0x4b8572)[_0xaa20('0x26')](function(_0x158cb1){_0x40b5d9[_0xaa20('0x20')]=_0x158cb1;if(_0x4d46fc[_0xaa20('0x33')][_0xaa20('0x41')]){_0x4483f6[_0xaa20('0x42')]=[{'all':!![]}];}return db[_0xaa20('0x2d')][_0xaa20('0x43')](_0x4483f6);})['then'](function(_0x399d7a){_0x40b5d9[_0xaa20('0x44')]=_0x399d7a;return _0x40b5d9;})[_0xaa20('0x26')](respondWithFilteredResult(_0xe0a579,_0x4483f6))[_0xaa20('0x45')](handleError(_0xe0a579,null));};exports['show']=function(_0x5c25ec,_0x54d68d){var _0x5c962d={'raw':![],'where':{'id':_0x5c25ec[_0xaa20('0x46')]['id']}},_0x5a5760={};_0x5a5760[_0xaa20('0x32')]=_['keys'](db[_0xaa20('0x2d')][_0xaa20('0x2e')]);_0x5a5760[_0xaa20('0x33')]=_['keys'](_0x5c25ec['query']);_0x5a5760['filters']=_[_0xaa20('0x47')](_0x5a5760['model'],_0x5a5760[_0xaa20('0x33')]);_0x5c962d['attributes']=_[_0xaa20('0x47')](_0x5a5760[_0xaa20('0x32')],qs[_0xaa20('0x36')](_0x5c25ec[_0xaa20('0x33')][_0xaa20('0x36')]));_0x5c962d[_0xaa20('0x35')]=_0x5c962d[_0xaa20('0x35')]['length']?_0x5c962d[_0xaa20('0x35')]:_0x5a5760['model'];if(_0x5c25ec['query'][_0xaa20('0x41')]){_0x5c962d[_0xaa20('0x42')]=[{'all':!![]}];}_0x5c962d=_[_0xaa20('0x48')]({},_0x5c962d,_0x5c25ec[_0xaa20('0x40')]);return db[_0xaa20('0x2d')][_0xaa20('0x49')](_0x5c962d)[_0xaa20('0x26')](handleEntityNotFound(_0x54d68d,null))[_0xaa20('0x26')](respondWithResult(_0x54d68d,null))[_0xaa20('0x45')](handleError(_0x54d68d,null));};exports['create']=function(_0x14de4a,_0x47a89c){return db[_0xaa20('0x2d')]['create'](_0x14de4a[_0xaa20('0x4a')],{})[_0xaa20('0x26')](function(_0x5b97f1){var _0x2358ec=_0x14de4a[_0xaa20('0x4b')][_0xaa20('0x28')]({'plain':!![]});if(!_0x2358ec)throw new Error(_0xaa20('0x4c'));if(_0x2358ec[_0xaa20('0x4d')]==='user'){var _0x3a9b1a=_0x5b97f1[_0xaa20('0x28')]({'plain':!![]});var _0x7b1763=_0xaa20('0x4e');return db[_0xaa20('0x4f')][_0xaa20('0x49')]({'where':{'name':_0x7b1763,'userProfileId':_0x2358ec[_0xaa20('0x50')]},'raw':!![]})[_0xaa20('0x26')](function(_0x3d6f79){if(_0x3d6f79&&_0x3d6f79['autoAssociation']===0x0){return db[_0xaa20('0x29')][_0xaa20('0x51')]({'name':_0x3a9b1a['name'],'resourceId':_0x3a9b1a['id'],'type':_0x3d6f79[_0xaa20('0x2a')],'sectionId':_0x3d6f79['id']},{})['then'](function(){return _0x5b97f1;});}else{return _0x5b97f1;}})[_0xaa20('0x45')](function(_0x23174e){logger[_0xaa20('0x52')](_0xaa20('0x53'),_0x23174e);throw _0x23174e;});}return _0x5b97f1;})[_0xaa20('0x26')](respondWithResult(_0x47a89c,0xc9))[_0xaa20('0x45')](handleError(_0x47a89c,null));};exports[_0xaa20('0x25')]=function(_0x1556a1,_0x41ea80){if(_0x1556a1['body']['id']){delete _0x1556a1[_0xaa20('0x4a')]['id'];}return db[_0xaa20('0x2d')]['find']({'where':{'id':_0x1556a1[_0xaa20('0x46')]['id']}})[_0xaa20('0x26')](handleEntityNotFound(_0x41ea80,null))['then'](saveUpdates(_0x1556a1[_0xaa20('0x4a')],null))['then'](respondWithResult(_0x41ea80,null))[_0xaa20('0x45')](handleError(_0x41ea80,null));};exports[_0xaa20('0x27')]=function(_0x3f8032,_0x146031){return db[_0xaa20('0x2d')]['find']({'where':{'id':_0x3f8032[_0xaa20('0x46')]['id']}})['then'](handleEntityNotFound(_0x146031,null))['then'](removeEntity(_0x146031,null))[_0xaa20('0x45')](handleError(_0x146031,null));}; \ No newline at end of file +var _0x0a9a=['end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','VoiceChanSpy','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x391bce,_0x4dcec1){var _0x14075b=function(_0xaa4088){while(--_0xaa4088){_0x391bce['push'](_0x391bce['shift']());}};_0x14075b(++_0x4dcec1);}(_0x0a9a,0x183));var _0xa0a9=function(_0x45e98f,_0x185040){_0x45e98f=_0x45e98f-0x0;var _0x5ac954=_0x0a9a[_0x45e98f];return _0x5ac954;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0a9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0a9('0x1'));var rp=require(_0xa0a9('0x2'));var moment=require(_0xa0a9('0x3'));var BPromise=require(_0xa0a9('0x4'));var Mustache=require('mustache');var util=require(_0xa0a9('0x5'));var path=require(_0xa0a9('0x6'));var sox=require('sox');var csv=require(_0xa0a9('0x7'));var ejs=require(_0xa0a9('0x8'));var fs=require('fs');var fs_extra=require(_0xa0a9('0x9'));var _=require(_0xa0a9('0xa'));var squel=require('squel');var crypto=require(_0xa0a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa0a9('0xc'));var toCsv=require(_0xa0a9('0x7'));var querystring=require(_0xa0a9('0xd'));var Papa=require(_0xa0a9('0xe'));var Redis=require('ioredis');var authService=require(_0xa0a9('0xf'));var qs=require(_0xa0a9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0a9('0x11'))(_0xa0a9('0x12'));var utils=require('../../config/utils');var config=require(_0xa0a9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0a9('0x14'))['db'];function respondWithStatusCode(_0x4b7913,_0xb87a94){_0xb87a94=_0xb87a94||0xcc;return function(_0x1ae2a7){if(_0x1ae2a7){return _0x4b7913[_0xa0a9('0x15')](_0xb87a94);}return _0x4b7913[_0xa0a9('0x16')](_0xb87a94)[_0xa0a9('0x17')]();};}function respondWithResult(_0x4fac40,_0x1f3f23){_0x1f3f23=_0x1f3f23||0xc8;return function(_0x9ef979){if(_0x9ef979){return _0x4fac40[_0xa0a9('0x16')](_0x1f3f23)[_0xa0a9('0x18')](_0x9ef979);}};}function respondWithFilteredResult(_0x2f8b3c,_0x1a7b8a){return function(_0x5a6693){if(_0x5a6693){var _0x176faa=typeof _0x1a7b8a['offset']==='undefined'&&typeof _0x1a7b8a[_0xa0a9('0x19')]===_0xa0a9('0x1a');var _0x476762=_0x5a6693[_0xa0a9('0x1b')];var _0x568409=_0x176faa?0x0:_0x1a7b8a[_0xa0a9('0x1c')];var _0x126401=_0x176faa?_0x5a6693[_0xa0a9('0x1b')]:_0x1a7b8a[_0xa0a9('0x1c')]+_0x1a7b8a[_0xa0a9('0x19')];var _0x3c1b3a;if(_0x126401>=_0x476762){_0x126401=_0x476762;_0x3c1b3a=0xc8;}else{_0x3c1b3a=0xce;}_0x2f8b3c['status'](_0x3c1b3a);return _0x2f8b3c[_0xa0a9('0x1d')](_0xa0a9('0x1e'),_0x568409+'-'+_0x126401+'/'+_0x476762)['json'](_0x5a6693);}return null;};}function patchUpdates(_0x53b99d){return function(_0x465d60){try{jsonpatch[_0xa0a9('0x1f')](_0x465d60,_0x53b99d,!![]);}catch(_0x3d9905){return BPromise['reject'](_0x3d9905);}return _0x465d60[_0xa0a9('0x20')]();};}function saveUpdates(_0x4e6f4c,_0x1fb36b){return function(_0x5e6148){if(_0x5e6148){return _0x5e6148[_0xa0a9('0x21')](_0x4e6f4c)[_0xa0a9('0x22')](function(_0x2f0b14){return _0x2f0b14;});}return null;};}function removeEntity(_0x305747,_0x4938da){return function(_0x423d3a){if(_0x423d3a){return _0x423d3a['destroy']()[_0xa0a9('0x22')](function(){var _0x1f78e1=_0x423d3a[_0xa0a9('0x23')]({'plain':!![]});var _0x252a14='ChanSpies';return db[_0xa0a9('0x24')][_0xa0a9('0x25')]({'where':{'type':_0x252a14,'resourceId':_0x1f78e1['id']}})[_0xa0a9('0x22')](function(){return _0x423d3a;});})[_0xa0a9('0x22')](function(){_0x305747['status'](0xcc)[_0xa0a9('0x17')]();});}};}function handleEntityNotFound(_0x38e454,_0x2eae30){return function(_0x5c446e){if(!_0x5c446e){_0x38e454['sendStatus'](0x194);}return _0x5c446e;};}function handleError(_0x2b3cbb,_0x3ba07e){_0x3ba07e=_0x3ba07e||0x1f4;return function(_0x10bbfd){logger[_0xa0a9('0x26')](_0x10bbfd[_0xa0a9('0x27')]);if(_0x10bbfd[_0xa0a9('0x28')]){delete _0x10bbfd[_0xa0a9('0x28')];}_0x2b3cbb[_0xa0a9('0x16')](_0x3ba07e)[_0xa0a9('0x29')](_0x10bbfd);};}exports[_0xa0a9('0x2a')]=function(_0x41e994,_0x554191){var _0x1f6178={},_0x1957bf={},_0x4fc94a={'count':0x0,'rows':[]};var _0x2f21ea=_[_0xa0a9('0x2b')](db['VoiceChanSpy']['rawAttributes'],function(_0x45374e){return{'name':_0x45374e['fieldName'],'type':_0x45374e['type'][_0xa0a9('0x2c')]};});_0x1957bf[_0xa0a9('0x2d')]=_[_0xa0a9('0x2b')](_0x2f21ea,_0xa0a9('0x28'));_0x1957bf[_0xa0a9('0x2e')]=_[_0xa0a9('0x2f')](_0x41e994[_0xa0a9('0x2e')]);_0x1957bf['filters']=_[_0xa0a9('0x30')](_0x1957bf[_0xa0a9('0x2d')],_0x1957bf['query']);_0x1f6178[_0xa0a9('0x31')]=_[_0xa0a9('0x30')](_0x1957bf[_0xa0a9('0x2d')],qs['fields'](_0x41e994['query'][_0xa0a9('0x32')]));_0x1f6178[_0xa0a9('0x31')]=_0x1f6178[_0xa0a9('0x31')][_0xa0a9('0x33')]?_0x1f6178['attributes']:_0x1957bf[_0xa0a9('0x2d')];if(!_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x34')]('nolimit')){_0x1f6178[_0xa0a9('0x19')]=qs[_0xa0a9('0x19')](_0x41e994[_0xa0a9('0x2e')]['limit']);_0x1f6178[_0xa0a9('0x1c')]=qs[_0xa0a9('0x1c')](_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x1c')]);}_0x1f6178[_0xa0a9('0x35')]=qs[_0xa0a9('0x36')](_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x36')]);_0x1f6178[_0xa0a9('0x37')]=qs[_0xa0a9('0x38')](_[_0xa0a9('0x39')](_0x41e994[_0xa0a9('0x2e')],_0x1957bf[_0xa0a9('0x38')]),_0x2f21ea);if(_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x3a')]){_0x1f6178[_0xa0a9('0x37')]=_[_0xa0a9('0x3b')](_0x1f6178['where'],{'$or':_[_0xa0a9('0x2b')](_0x2f21ea,function(_0x17428f){if(_0x17428f[_0xa0a9('0x3c')]!=='VIRTUAL'){var _0x757e10={};_0x757e10[_0x17428f[_0xa0a9('0x28')]]={'$like':'%'+_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x3a')]+'%'};return _0x757e10;}})});}_0x1f6178=_['merge']({},_0x1f6178,_0x41e994[_0xa0a9('0x3d')]);var _0x44791e={'where':_0x1f6178[_0xa0a9('0x37')]};return db[_0xa0a9('0x3e')][_0xa0a9('0x1b')](_0x44791e)['then'](function(_0x373b95){_0x4fc94a[_0xa0a9('0x1b')]=_0x373b95;if(_0x41e994[_0xa0a9('0x2e')][_0xa0a9('0x3f')]){_0x1f6178[_0xa0a9('0x40')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xa0a9('0x41')](_0x1f6178);})[_0xa0a9('0x22')](function(_0x27358c){_0x4fc94a[_0xa0a9('0x42')]=_0x27358c;return _0x4fc94a;})[_0xa0a9('0x22')](respondWithFilteredResult(_0x554191,_0x1f6178))['catch'](handleError(_0x554191,null));};exports[_0xa0a9('0x43')]=function(_0x1c8760,_0x5081cf){var _0x4cdcd6={'raw':![],'where':{'id':_0x1c8760[_0xa0a9('0x44')]['id']}},_0x41cd22={};_0x41cd22[_0xa0a9('0x2d')]=_[_0xa0a9('0x2f')](db['VoiceChanSpy'][_0xa0a9('0x45')]);_0x41cd22[_0xa0a9('0x2e')]=_[_0xa0a9('0x2f')](_0x1c8760[_0xa0a9('0x2e')]);_0x41cd22[_0xa0a9('0x38')]=_[_0xa0a9('0x30')](_0x41cd22[_0xa0a9('0x2d')],_0x41cd22[_0xa0a9('0x2e')]);_0x4cdcd6[_0xa0a9('0x31')]=_[_0xa0a9('0x30')](_0x41cd22[_0xa0a9('0x2d')],qs[_0xa0a9('0x32')](_0x1c8760[_0xa0a9('0x2e')][_0xa0a9('0x32')]));_0x4cdcd6[_0xa0a9('0x31')]=_0x4cdcd6[_0xa0a9('0x31')][_0xa0a9('0x33')]?_0x4cdcd6['attributes']:_0x41cd22[_0xa0a9('0x2d')];if(_0x1c8760['query'][_0xa0a9('0x3f')]){_0x4cdcd6[_0xa0a9('0x40')]=[{'all':!![]}];}_0x4cdcd6=_[_0xa0a9('0x3b')]({},_0x4cdcd6,_0x1c8760[_0xa0a9('0x3d')]);return db[_0xa0a9('0x3e')][_0xa0a9('0x46')](_0x4cdcd6)[_0xa0a9('0x22')](handleEntityNotFound(_0x5081cf,null))[_0xa0a9('0x22')](respondWithResult(_0x5081cf,null))[_0xa0a9('0x47')](handleError(_0x5081cf,null));};exports['create']=function(_0x5d4162,_0x46a9ca){return db[_0xa0a9('0x3e')]['create'](_0x5d4162[_0xa0a9('0x48')],{})[_0xa0a9('0x22')](function(_0x2c9c29){var _0x4a35dd=_0x5d4162[_0xa0a9('0x49')][_0xa0a9('0x23')]({'plain':!![]});if(!_0x4a35dd)throw new Error(_0xa0a9('0x4a'));if(_0x4a35dd[_0xa0a9('0x4b')]==='user'){var _0x398501=_0x2c9c29[_0xa0a9('0x23')]({'plain':!![]});var _0x3d9846=_0xa0a9('0x4c');return db[_0xa0a9('0x4d')][_0xa0a9('0x46')]({'where':{'name':_0x3d9846,'userProfileId':_0x4a35dd[_0xa0a9('0x4e')]},'raw':!![]})['then'](function(_0x63cbda){if(_0x63cbda&&_0x63cbda[_0xa0a9('0x4f')]===0x0){return db['UserProfileResource'][_0xa0a9('0x50')]({'name':_0x398501[_0xa0a9('0x28')],'resourceId':_0x398501['id'],'type':_0x63cbda[_0xa0a9('0x28')],'sectionId':_0x63cbda['id']},{})['then'](function(){return _0x2c9c29;});}else{return _0x2c9c29;}})['catch'](function(_0xb952fc){logger[_0xa0a9('0x26')](_0xa0a9('0x51'),_0xb952fc);throw _0xb952fc;});}return _0x2c9c29;})[_0xa0a9('0x22')](respondWithResult(_0x46a9ca,0xc9))['catch'](handleError(_0x46a9ca,null));};exports['update']=function(_0x2121a0,_0x1f0e30){if(_0x2121a0['body']['id']){delete _0x2121a0['body']['id'];}return db[_0xa0a9('0x3e')][_0xa0a9('0x46')]({'where':{'id':_0x2121a0[_0xa0a9('0x44')]['id']}})[_0xa0a9('0x22')](handleEntityNotFound(_0x1f0e30,null))[_0xa0a9('0x22')](saveUpdates(_0x2121a0[_0xa0a9('0x48')],null))[_0xa0a9('0x22')](respondWithResult(_0x1f0e30,null))[_0xa0a9('0x47')](handleError(_0x1f0e30,null));};exports[_0xa0a9('0x25')]=function(_0x23f1b1,_0x2da124){return db['VoiceChanSpy'][_0xa0a9('0x46')]({'where':{'id':_0x23f1b1[_0xa0a9('0x44')]['id']}})[_0xa0a9('0x22')](handleEntityNotFound(_0x2da124,null))['then'](removeEntity(_0x2da124,null))[_0xa0a9('0x47')](handleError(_0x2da124,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 2d6a48a..30ffda3 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 _0x8df1=['define','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','catch','exports','models'];(function(_0x33f3df,_0x3c5aa2){var _0x4e7785=function(_0x1f904f){while(--_0x1f904f){_0x33f3df['push'](_0x33f3df['shift']());}};_0x4e7785(++_0x3c5aa2);}(_0x8df1,0x96));var _0x18df=function(_0x4428d0,_0x24a3e9){_0x4428d0=_0x4428d0-0x0;var _0x3c1fda=_0x8df1[_0x4428d0];return _0x3c1fda;};'use strict';var _=require(_0x18df('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x18df('0x1'));var getUserApplications=function(_0x4ae408,_0x46774b,_0x5d259f){var _0x27f7c0=0x1;var _0x1825a3=[];var _0xc93a61={'context':_0x46774b['context']||_0x18df('0x2'),'exten':util[_0x18df('0x3')](_0x18df('0x4'),_0x4ae408[_0x18df('0x5')],_0x5d259f),'type':'system','isApp':![],'ChanSpyId':_0x4ae408['id'],'UserId':_0x46774b['id']};_0x1825a3[_0x18df('0x6')](_[_0x18df('0x7')]({'app':_0x18df('0x8'),'appdata':util[_0x18df('0x3')](_0x18df('0x9'),_0x18df('0xa')),'priority':_0x27f7c0++},_0xc93a61));if(_0x4ae408[_0x18df('0xb')]){_0x1825a3['push'](_['merge']({'app':_0x18df('0xc'),'appdata':util[_0x18df('0x3')](_0x18df('0xd'),_0x4ae408[_0x18df('0xe')]),'priority':_0x27f7c0++},_0xc93a61));}if(_0x4ae408['auth']){_0x1825a3['push'](_[_0x18df('0x7')]({'app':_0x18df('0xf'),'appdata':_0x4ae408[_0x18df('0x10')],'priority':_0x27f7c0++},_0xc93a61));}_0x1825a3[_0x18df('0x6')](_['merge']({'app':'ChanSpy','appdata':util['format'](_0x18df('0x11'),_0x46774b[_0x18df('0x12')],_0x4ae408['options']?_0x4ae408[_0x18df('0x13')][_0x18df('0x14')](''):''),'priority':_0x27f7c0++},_0xc93a61));if(_0x4ae408[_0x18df('0xb')]){_0x1825a3[_0x18df('0x6')](_[_0x18df('0x7')]({'app':_0x18df('0x15'),'priority':_0x27f7c0++},_0xc93a61));}return _0x1825a3;};var getChanSpyApplications=function(_0x235806,_0x40590b){var _0x496ba9=[];for(var _0x75c116=0x0,_0x59caad=0x1;_0x75c116<_0x40590b[_0x18df('0x16')];_0x75c116++,_0x59caad=0x1){_0x496ba9=_0x496ba9[_0x18df('0x17')](getUserApplications(_0x235806,_0x40590b[_0x75c116],_0x40590b[_0x75c116][_0x18df('0x18')]));if(_0x40590b[_0x75c116][_0x18df('0x18')]!=_0x40590b[_0x75c116][_0x18df('0x12')]){_0x496ba9=_0x496ba9[_0x18df('0x17')](getUserApplications(_0x235806,_0x40590b[_0x75c116],_0x40590b[_0x75c116][_0x18df('0x12')]));}}return _0x496ba9;};var getChanSpyPromise=function(_0x38e27e,_0x28bd1e){return new BPromise(function(_0x1cdc5b,_0x2cb9b0){return _0x38e27e['User'][_0x18df('0x19')]({'attributes':['id',_0x18df('0x12'),'internal'],'where':{'role':_0x18df('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x54106b){if(_0x54106b){return _0x1cdc5b(getChanSpyApplications(_0x28bd1e,_0x54106b));}return _0x1cdc5b([]);})[_0x18df('0x1b')](function(_0x126d47){_0x2cb9b0(_0x126d47);});});};module[_0x18df('0x1c')]=function(_0xca13e8,_0x5e7749){var _0x5cbc8b=_0xca13e8[_0x18df('0x1d')];return _0xca13e8[_0x18df('0x1e')]('VoiceChanSpy',attributes,{'tableName':_0x18df('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x39c8f4,_0x50388c,_0x1180d1){return getChanSpyPromise(_0x5cbc8b,_0x39c8f4)[_0x18df('0x20')](function(_0x14cf1f){if(_0x14cf1f&&_0x14cf1f[_0x18df('0x16')]){return _0x5cbc8b[_0x18df('0x21')]['bulkCreate'](_0x14cf1f);}})[_0x18df('0x20')](function(){_0x1180d1();})[_0x18df('0x1b')](function(_0x4a23c9){_0x1180d1(_0x4a23c9);});},'afterUpdate':function(_0x64732c,_0x1a5ff5,_0x2ad7b2){return _0x5cbc8b[_0x18df('0x21')]['destroy']({'where':{'ChanSpyId':_0x64732c['id']}})[_0x18df('0x20')](function(){return getChanSpyPromise(_0x5cbc8b,_0x64732c);})[_0x18df('0x20')](function(_0x1f7edc){if(_0x1f7edc&&_0x1f7edc[_0x18df('0x16')]){return _0x5cbc8b[_0x18df('0x21')][_0x18df('0x22')](_0x1f7edc);}})[_0x18df('0x20')](function(){_0x2ad7b2();})[_0x18df('0x1b')](function(_0x354300){_0x2ad7b2(_0x354300);});},'afterDestroy':function(_0x3b0238,_0x2ec080,_0x5d8aa8){return _0x5cbc8b[_0x18df('0x21')][_0x18df('0x23')]({'where':{'ChanSpyId':_0x3b0238['id']}})['then'](function(){_0x5d8aa8();})['catch'](function(_0x53f83e){_0x5d8aa8(_0x53f83e);});}}});}; \ No newline at end of file +var _0x7955=['destroy','lodash','bluebird','from-sip','format','%s%s','prefix','merge','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate'];(function(_0x5b18a3,_0x3bc3ef){var _0xa50edc=function(_0x1cd10c){while(--_0x1cd10c){_0x5b18a3['push'](_0x5b18a3['shift']());}};_0xa50edc(++_0x3bc3ef);}(_0x7955,0xb0));var _0x5795=function(_0x29d4ee,_0xf6b449){_0x29d4ee=_0x29d4ee-0x0;var _0x4827c7=_0x7955[_0x29d4ee];return _0x4827c7;};'use strict';var _=require(_0x5795('0x0'));var util=require('util');var BPromise=require(_0x5795('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3ade6b,_0x17edd4,_0x5b663a){var _0x19221e=0x1;var _0x1c37a2=[];var _0xfefd8={'context':_0x17edd4['context']||_0x5795('0x2'),'exten':util[_0x5795('0x3')](_0x5795('0x4'),_0x3ade6b[_0x5795('0x5')],_0x5b663a),'type':'system','isApp':![],'ChanSpyId':_0x3ade6b['id'],'UserId':_0x17edd4['id']};_0x1c37a2['push'](_[_0x5795('0x6')]({'app':'Set','appdata':util['format']('CDR(type)=%s',_0x5795('0x7')),'priority':_0x19221e++},_0xfefd8));if(_0x3ade6b[_0x5795('0x8')]){_0x1c37a2[_0x5795('0x9')](_[_0x5795('0x6')]({'app':'MixMonitor','appdata':util['format'](_0x5795('0xa'),_0x3ade6b[_0x5795('0xb')]),'priority':_0x19221e++},_0xfefd8));}if(_0x3ade6b[_0x5795('0xc')]){_0x1c37a2[_0x5795('0x9')](_[_0x5795('0x6')]({'app':_0x5795('0xd'),'appdata':_0x3ade6b[_0x5795('0xe')],'priority':_0x19221e++},_0xfefd8));}_0x1c37a2[_0x5795('0x9')](_['merge']({'app':_0x5795('0xf'),'appdata':util['format'](_0x5795('0x10'),_0x17edd4[_0x5795('0x11')],_0x3ade6b[_0x5795('0x12')]?_0x3ade6b[_0x5795('0x12')]['join'](''):''),'priority':_0x19221e++},_0xfefd8));if(_0x3ade6b[_0x5795('0x8')]){_0x1c37a2[_0x5795('0x9')](_[_0x5795('0x6')]({'app':_0x5795('0x13'),'priority':_0x19221e++},_0xfefd8));}return _0x1c37a2;};var getChanSpyApplications=function(_0x27eb64,_0x401647){var _0x22a902=[];for(var _0x126f22=0x0,_0x9861ba=0x1;_0x126f22<_0x401647[_0x5795('0x14')];_0x126f22++,_0x9861ba=0x1){_0x22a902=_0x22a902[_0x5795('0x15')](getUserApplications(_0x27eb64,_0x401647[_0x126f22],_0x401647[_0x126f22]['internal']));if(_0x401647[_0x126f22][_0x5795('0x16')]!=_0x401647[_0x126f22][_0x5795('0x11')]){_0x22a902=_0x22a902[_0x5795('0x15')](getUserApplications(_0x27eb64,_0x401647[_0x126f22],_0x401647[_0x126f22][_0x5795('0x11')]));}}return _0x22a902;};var getChanSpyPromise=function(_0x21e310,_0x11e70d){return new BPromise(function(_0x149349,_0x4bec51){return _0x21e310[_0x5795('0x17')][_0x5795('0x18')]({'attributes':['id',_0x5795('0x11'),_0x5795('0x16')],'where':{'role':_0x5795('0x19'),'chanspy':!![]},'raw':!![]})['then'](function(_0x2ef18){if(_0x2ef18){return _0x149349(getChanSpyApplications(_0x11e70d,_0x2ef18));}return _0x149349([]);})[_0x5795('0x1a')](function(_0x286870){_0x4bec51(_0x286870);});});};module[_0x5795('0x1b')]=function(_0x513442,_0x29a22f){var _0xe03c60=_0x513442['models'];return _0x513442[_0x5795('0x1c')](_0x5795('0x1d'),attributes,{'tableName':_0x5795('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x428697,_0x3302ec,_0x6d0292){return getChanSpyPromise(_0xe03c60,_0x428697)[_0x5795('0x1f')](function(_0x46164e){if(_0x46164e&&_0x46164e['length']){return _0xe03c60[_0x5795('0x20')][_0x5795('0x21')](_0x46164e);}})['then'](function(){_0x6d0292();})['catch'](function(_0x4c15fa){_0x6d0292(_0x4c15fa);});},'afterUpdate':function(_0x46aa9,_0x480ffe,_0x47eb74){return _0xe03c60[_0x5795('0x20')][_0x5795('0x22')]({'where':{'ChanSpyId':_0x46aa9['id']}})['then'](function(){return getChanSpyPromise(_0xe03c60,_0x46aa9);})['then'](function(_0x57ba8d){if(_0x57ba8d&&_0x57ba8d[_0x5795('0x14')]){return _0xe03c60['VoiceExtension']['bulkCreate'](_0x57ba8d);}})['then'](function(){_0x47eb74();})[_0x5795('0x1a')](function(_0x3d3377){_0x47eb74(_0x3d3377);});},'afterDestroy':function(_0x534df5,_0x1d4f55,_0x5ae909){return _0xe03c60[_0x5795('0x20')][_0x5795('0x22')]({'where':{'ChanSpyId':_0x534df5['id']}})[_0x5795('0x1f')](function(){_0x5ae909();})['catch'](function(_0x385726){_0x5ae909(_0x385726);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index c6510e2..7b13867 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 _0x6953=['catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6953,0x91));var _0x3695=function(_0x16efcd,_0x52bc16){_0x16efcd=_0x16efcd-0x0;var _0x298b68=_0x6953[_0x16efcd];return _0x298b68;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3695('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3695('0x3'));var logger=require(_0x3695('0x4'))(_0x3695('0x5'));var config=require('../../config/environment');var jayson=require(_0x3695('0x6'));var client=jayson['client'][_0x3695('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14eb32,_0x912099,_0x1a4e75){return new BPromise(function(_0x301e46,_0x4e337b){return client[_0x3695('0x8')](_0x14eb32,_0x1a4e75)['then'](function(_0x1fcd43){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x912099,_0x3695('0x9'));logger['debug'](_0x3695('0xa'),_0x912099,_0x3695('0x9'),JSON[_0x3695('0xb')](_0x1fcd43));if(_0x1fcd43[_0x3695('0xc')]){if(_0x1fcd43[_0x3695('0xc')][_0x3695('0xd')]===0x1f4){logger['error'](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x4e337b(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}logger[_0x3695('0xc')](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x301e46(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}else{logger['info'](_0x3695('0xe'),_0x912099,_0x3695('0x9'));_0x301e46(_0x1fcd43[_0x3695('0x10')][_0x3695('0xf')]);}})[_0x3695('0x11')](function(_0x1973ee){logger[_0x3695('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x912099,_0x1973ee);_0x4e337b(_0x1973ee);});});} \ No newline at end of file +var _0x4e81=['VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x30a926,_0x57dec9){var _0x1dbead=function(_0x5396e0){while(--_0x5396e0){_0x30a926['push'](_0x30a926['shift']());}};_0x1dbead(++_0x57dec9);}(_0x4e81,0x1bc));var _0x14e8=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x4e81[_0x5c7a85];return _0x35290f;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 0004cf2..fd90544 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 _0x80d9=['show','post','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x6fa261,_0x596489){var _0x2938d3=function(_0x51fd60){while(--_0x51fd60){_0x6fa261['push'](_0x6fa261['shift']());}};_0x2938d3(++_0x596489);}(_0x80d9,0x115));var _0x980d=function(_0x1380d2,_0x393fc9){_0x1380d2=_0x1380d2-0x0;var _0x81765b=_0x80d9[_0x1380d2];return _0x81765b;};'use strict';var multer=require('multer');var util=require(_0x980d('0x0'));var path=require(_0x980d('0x1'));var timeout=require(_0x980d('0x2'));var express=require(_0x980d('0x3'));var router=express[_0x980d('0x4')]();var fs_extra=require(_0x980d('0x5'));var auth=require(_0x980d('0x6'));var interaction=require(_0x980d('0x7'));var config=require(_0x980d('0x8'));var controller=require('./voiceContext.controller');router[_0x980d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x980d('0xa'),auth[_0x980d('0xb')](),controller[_0x980d('0xc')]);router[_0x980d('0xd')]('/',auth[_0x980d('0xb')](),controller[_0x980d('0xe')]);router['put'](_0x980d('0xa'),auth[_0x980d('0xb')](),controller['update']);router[_0x980d('0xf')](_0x980d('0xa'),auth[_0x980d('0xb')](),controller[_0x980d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3fc6=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceContext.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x3fc6,0x10b));var _0x63fc=function(_0x254ba1,_0x54d61c){_0x254ba1=_0x254ba1-0x0;var _0xba1236=_0x3fc6[_0x254ba1];return _0xba1236;};'use strict';var multer=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var path=require('path');var timeout=require(_0x63fc('0x2'));var express=require(_0x63fc('0x3'));var router=express[_0x63fc('0x4')]();var fs_extra=require(_0x63fc('0x5'));var auth=require(_0x63fc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x63fc('0x7'));router['get']('/',auth[_0x63fc('0x8')](),controller[_0x63fc('0x9')]);router[_0x63fc('0xa')]('/:id',auth[_0x63fc('0x8')](),controller[_0x63fc('0xb')]);router[_0x63fc('0xc')]('/',auth[_0x63fc('0x8')](),controller[_0x63fc('0xd')]);router[_0x63fc('0xe')](_0x63fc('0xf'),auth[_0x63fc('0x8')](),controller[_0x63fc('0x10')]);router[_0x63fc('0x11')](_0x63fc('0xf'),auth[_0x63fc('0x8')](),controller[_0x63fc('0x12')]);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 e11cd93..a4cb051 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 _0x53bb=['name','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x53bb,0x151));var _0xb53b=function(_0x4c53a8,_0x1c3422){_0x4c53a8=_0x4c53a8-0x0;var _0x594d48=_0x53bb[_0x4c53a8];return _0x594d48;};'use strict';var Sequelize=require('sequelize');module[_0xb53b('0x0')]={'name':{'type':Sequelize[_0xb53b('0x1')],'unique':_0xb53b('0x2')},'description':{'type':Sequelize[_0xb53b('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x02b0=['name','BOOLEAN','sequelize'];(function(_0x3e0d11,_0x34214e){var _0x352f2f=function(_0x5991f6){while(--_0x5991f6){_0x3e0d11['push'](_0x3e0d11['shift']());}};_0x352f2f(++_0x34214e);}(_0x02b0,0x6b));var _0x002b=function(_0x465d4c,_0x35f4fb){_0x465d4c=_0x465d4c-0x0;var _0x537375=_0x02b0[_0x465d4c];return _0x537375;};'use strict';var Sequelize=require(_0x002b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x002b('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x002b('0x2')],'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 dbefdab..b9db5f8 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 _0xa72f=['jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','end','offset','limit','undefined','count','status','set','json','apply','reject','save','destroy','get','Contexts','UserProfileResource','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x329406,_0x34ff27){var _0x42176f=function(_0x313034){while(--_0x313034){_0x329406['push'](_0x329406['shift']());}};_0x42176f(++_0x34ff27);}(_0xa72f,0xc2));var _0xfa72=function(_0x1d9e40,_0x1c44db){_0x1d9e40=_0x1d9e40-0x0;var _0x2ee94f=_0xa72f[_0x1d9e40];return _0x2ee94f;};'use strict';var emlformat=require(_0xfa72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa72('0x1'));var jsonpatch=require(_0xfa72('0x2'));var rp=require(_0xfa72('0x3'));var moment=require('moment');var BPromise=require(_0xfa72('0x4'));var Mustache=require(_0xfa72('0x5'));var util=require(_0xfa72('0x6'));var path=require(_0xfa72('0x7'));var sox=require(_0xfa72('0x8'));var csv=require(_0xfa72('0x9'));var ejs=require(_0xfa72('0xa'));var fs=require('fs');var fs_extra=require(_0xfa72('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfa72('0xc'));var jsforce=require(_0xfa72('0xd'));var deskjs=require(_0xfa72('0xe'));var toCsv=require(_0xfa72('0x9'));var querystring=require(_0xfa72('0xf'));var Papa=require('papaparse');var Redis=require(_0xfa72('0x10'));var authService=require(_0xfa72('0x11'));var qs=require(_0xfa72('0x12'));var as=require(_0xfa72('0x13'));var hardwareService=require(_0xfa72('0x14'));var logger=require(_0xfa72('0x15'))(_0xfa72('0x16'));var utils=require('../../config/utils');var config=require(_0xfa72('0x17'));var licenseUtil=require(_0xfa72('0x18'));var db=require(_0xfa72('0x19'))['db'];var jayson=require(_0xfa72('0x1a'));var client=jayson[_0xfa72('0x1b')][_0xfa72('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xfcdc2c,_0x5e95d0,_0x28d76b,_0x40edd1){return new BPromise(function(_0x3664dd,_0x424155){var _0x2f924e=_0x40edd1||client;return _0x2f924e[_0xfa72('0x1d')](_0xfcdc2c,_0x28d76b)[_0xfa72('0x1e')](function(_0x21db14){logger[_0xfa72('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x5e95d0,_0xfa72('0x20'));logger[_0xfa72('0x21')](_0xfa72('0x22'),_0x5e95d0,_0xfa72('0x20'),JSON[_0xfa72('0x23')](_0x21db14));if(_0x21db14[_0xfa72('0x24')]){if(_0x21db14[_0xfa72('0x24')][_0xfa72('0x25')]===0x1f4){logger[_0xfa72('0x24')]('VoiceContext,\x20%s,\x20%s',_0x5e95d0,_0x21db14['error'][_0xfa72('0x26')]);return _0x424155(_0x21db14['error'][_0xfa72('0x26')]);}logger['error'](_0xfa72('0x27'),_0x5e95d0,_0x21db14[_0xfa72('0x24')][_0xfa72('0x26')]);return _0x3664dd(_0x21db14['error'][_0xfa72('0x26')]);}else{logger[_0xfa72('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x5e95d0,'request\x20sent');_0x3664dd(_0x21db14[_0xfa72('0x28')]['message']);}})[_0xfa72('0x29')](function(_0x48c5d1){logger[_0xfa72('0x24')](_0xfa72('0x27'),_0x5e95d0,_0x48c5d1);_0x424155(_0x48c5d1);});});}function respondWithStatusCode(_0x505ed9,_0x8ee952){_0x8ee952=_0x8ee952||0xcc;return function(_0x4b4b1e){if(_0x4b4b1e){return _0x505ed9[_0xfa72('0x2a')](_0x8ee952);}return _0x505ed9['status'](_0x8ee952)[_0xfa72('0x2b')]();};}function respondWithResult(_0xbe79b4,_0x5028f8){_0x5028f8=_0x5028f8||0xc8;return function(_0x209448){if(_0x209448){return _0xbe79b4['status'](_0x5028f8)['json'](_0x209448);}};}function respondWithFilteredResult(_0x4c3840,_0x74a713){return function(_0x422b38){if(_0x422b38){var _0x4c8474=typeof _0x74a713[_0xfa72('0x2c')]==='undefined'&&typeof _0x74a713[_0xfa72('0x2d')]===_0xfa72('0x2e');var _0x16a22d=_0x422b38['count'];var _0x3bee27=_0x4c8474?0x0:_0x74a713[_0xfa72('0x2c')];var _0x31a354=_0x4c8474?_0x422b38[_0xfa72('0x2f')]:_0x74a713['offset']+_0x74a713[_0xfa72('0x2d')];var _0x2f9393;if(_0x31a354>=_0x16a22d){_0x31a354=_0x16a22d;_0x2f9393=0xc8;}else{_0x2f9393=0xce;}_0x4c3840[_0xfa72('0x30')](_0x2f9393);return _0x4c3840[_0xfa72('0x31')]('Content-Range',_0x3bee27+'-'+_0x31a354+'/'+_0x16a22d)[_0xfa72('0x32')](_0x422b38);}return null;};}function patchUpdates(_0x3d8ed9){return function(_0x2c0b91){try{jsonpatch[_0xfa72('0x33')](_0x2c0b91,_0x3d8ed9,!![]);}catch(_0x288422){return BPromise[_0xfa72('0x34')](_0x288422);}return _0x2c0b91[_0xfa72('0x35')]();};}function saveUpdates(_0x206732,_0x3c4b36){return function(_0xe90d74){if(_0xe90d74){return _0xe90d74['update'](_0x206732)[_0xfa72('0x1e')](function(_0x1e4d2d){return _0x1e4d2d;});}return null;};}function removeEntity(_0x2d6801,_0x50315b){return function(_0x4d66b8){if(_0x4d66b8){return _0x4d66b8[_0xfa72('0x36')]()['then'](function(){var _0xae567a=_0x4d66b8[_0xfa72('0x37')]({'plain':!![]});var _0x42cf63=_0xfa72('0x38');return db[_0xfa72('0x39')][_0xfa72('0x36')]({'where':{'type':_0x42cf63,'resourceId':_0xae567a['id']}})[_0xfa72('0x1e')](function(){return _0x4d66b8;});})['then'](function(){_0x2d6801[_0xfa72('0x30')](0xcc)[_0xfa72('0x2b')]();});}};}function handleEntityNotFound(_0x47dc87,_0x27cc19){return function(_0x50d157){if(!_0x50d157){_0x47dc87[_0xfa72('0x2a')](0x194);}return _0x50d157;};}function handleError(_0x343631,_0x4242a8){_0x4242a8=_0x4242a8||0x1f4;return function(_0x7b144d){logger[_0xfa72('0x24')](_0x7b144d['stack']);if(_0x7b144d[_0xfa72('0x3a')]){delete _0x7b144d[_0xfa72('0x3a')];}_0x343631[_0xfa72('0x30')](_0x4242a8)[_0xfa72('0x3b')](_0x7b144d);};}exports[_0xfa72('0x3c')]=function(_0x23d6a3,_0x2d5795){var _0x4c2e50={},_0xb5f63f={},_0x5dc7e5={'count':0x0,'rows':[]};var _0x4a30b3=_['map'](db[_0xfa72('0x3d')][_0xfa72('0x3e')],function(_0x53dee4){return{'name':_0x53dee4[_0xfa72('0x3f')],'type':_0x53dee4[_0xfa72('0x40')][_0xfa72('0x41')]};});_0xb5f63f['model']=_[_0xfa72('0x42')](_0x4a30b3,'name');_0xb5f63f['query']=_[_0xfa72('0x43')](_0x23d6a3[_0xfa72('0x44')]);_0xb5f63f[_0xfa72('0x45')]=_[_0xfa72('0x46')](_0xb5f63f[_0xfa72('0x47')],_0xb5f63f['query']);_0x4c2e50[_0xfa72('0x48')]=_[_0xfa72('0x46')](_0xb5f63f[_0xfa72('0x47')],qs[_0xfa72('0x49')](_0x23d6a3[_0xfa72('0x44')]['fields']));_0x4c2e50[_0xfa72('0x48')]=_0x4c2e50[_0xfa72('0x48')][_0xfa72('0x4a')]?_0x4c2e50[_0xfa72('0x48')]:_0xb5f63f[_0xfa72('0x47')];if(!_0x23d6a3['query'][_0xfa72('0x4b')](_0xfa72('0x4c'))){_0x4c2e50[_0xfa72('0x2d')]=qs['limit'](_0x23d6a3[_0xfa72('0x44')][_0xfa72('0x2d')]);_0x4c2e50['offset']=qs[_0xfa72('0x2c')](_0x23d6a3[_0xfa72('0x44')][_0xfa72('0x2c')]);}_0x4c2e50[_0xfa72('0x4d')]=qs[_0xfa72('0x4e')](_0x23d6a3[_0xfa72('0x44')][_0xfa72('0x4e')]);_0x4c2e50[_0xfa72('0x4f')]=qs[_0xfa72('0x45')](_['pick'](_0x23d6a3['query'],_0xb5f63f[_0xfa72('0x45')]),_0x4a30b3);if(_0x23d6a3[_0xfa72('0x44')][_0xfa72('0x50')]){_0x4c2e50[_0xfa72('0x4f')]=_[_0xfa72('0x51')](_0x4c2e50[_0xfa72('0x4f')],{'$or':_[_0xfa72('0x42')](_0x4a30b3,function(_0x25dc01){if(_0x25dc01[_0xfa72('0x40')]!==_0xfa72('0x52')){var _0x1ea4c5={};_0x1ea4c5[_0x25dc01['name']]={'$like':'%'+_0x23d6a3[_0xfa72('0x44')]['filter']+'%'};return _0x1ea4c5;}})});}_0x4c2e50=_[_0xfa72('0x51')]({},_0x4c2e50,_0x23d6a3['options']);var _0x549ccb={'where':_0x4c2e50[_0xfa72('0x4f')]};return db['VoiceContext'][_0xfa72('0x2f')](_0x549ccb)[_0xfa72('0x1e')](function(_0x10300f){_0x5dc7e5[_0xfa72('0x2f')]=_0x10300f;if(_0x23d6a3[_0xfa72('0x44')][_0xfa72('0x53')]){_0x4c2e50[_0xfa72('0x54')]=[{'all':!![]}];}return db['VoiceContext'][_0xfa72('0x55')](_0x4c2e50);})[_0xfa72('0x1e')](function(_0x420a54){_0x5dc7e5[_0xfa72('0x56')]=_0x420a54;return _0x5dc7e5;})[_0xfa72('0x1e')](respondWithFilteredResult(_0x2d5795,_0x4c2e50))[_0xfa72('0x29')](handleError(_0x2d5795,null));};exports[_0xfa72('0x57')]=function(_0x31f37a,_0x45a0f4){var _0x4c973d={'raw':![],'where':{'id':_0x31f37a[_0xfa72('0x58')]['id']}},_0x456077={};_0x456077[_0xfa72('0x47')]=_['keys'](db[_0xfa72('0x3d')][_0xfa72('0x3e')]);_0x456077['query']=_[_0xfa72('0x43')](_0x31f37a[_0xfa72('0x44')]);_0x456077[_0xfa72('0x45')]=_[_0xfa72('0x46')](_0x456077[_0xfa72('0x47')],_0x456077['query']);_0x4c973d[_0xfa72('0x48')]=_[_0xfa72('0x46')](_0x456077['model'],qs[_0xfa72('0x49')](_0x31f37a[_0xfa72('0x44')][_0xfa72('0x49')]));_0x4c973d[_0xfa72('0x48')]=_0x4c973d[_0xfa72('0x48')][_0xfa72('0x4a')]?_0x4c973d[_0xfa72('0x48')]:_0x456077['model'];if(_0x31f37a['query'][_0xfa72('0x53')]){_0x4c973d[_0xfa72('0x54')]=[{'all':!![]}];}_0x4c973d=_['merge']({},_0x4c973d,_0x31f37a[_0xfa72('0x59')]);return db[_0xfa72('0x3d')][_0xfa72('0x5a')](_0x4c973d)[_0xfa72('0x1e')](handleEntityNotFound(_0x45a0f4,null))[_0xfa72('0x1e')](respondWithResult(_0x45a0f4,null))['catch'](handleError(_0x45a0f4,null));};exports[_0xfa72('0x5b')]=function(_0x9af06b,_0x1c2f57,_0x3e744f){var _0x3423ad;return db[_0xfa72('0x3d')][_0xfa72('0x5b')](_0x9af06b['body'],{'raw':!![]})[_0xfa72('0x1e')](function(_0x5953cb){_0x3423ad=_0x5953cb;return db[_0xfa72('0x3d')][_0xfa72('0x55')]({'raw':!![]});})[_0xfa72('0x1e')](function(_0x4204ab){var _0x1ad9ab=fs[_0xfa72('0x5c')](path[_0xfa72('0x5d')](config[_0xfa72('0x5e')],_0xfa72('0x5f')),_0xfa72('0x60'));var _0x2c8e76=ejs[_0xfa72('0x61')](_0x1ad9ab,{'contexts':_0x4204ab||[]});fs[_0xfa72('0x62')](_0xfa72('0x63'),_0x2c8e76);})[_0xfa72('0x1e')](function(){return respondWithRpcPromise(_0xfa72('0x64'),_0xfa72('0x5b'),{'module':_0xfa72('0x65')});})['then'](function(){var _0x2dad9f=_0x9af06b[_0xfa72('0x66')][_0xfa72('0x37')]({'plain':!![]});if(!_0x2dad9f)throw new Error(_0xfa72('0x67'));if(_0x2dad9f[_0xfa72('0x68')]===_0xfa72('0x66')){var _0x58a87c=_0x3423ad[_0xfa72('0x37')]({'plain':!![]});return db[_0xfa72('0x69')][_0xfa72('0x5a')]({'where':{'name':'Contexts','userProfileId':_0x2dad9f[_0xfa72('0x6a')]},'raw':!![]})['then'](function(_0x4ec7ed){if(_0x4ec7ed&&_0x4ec7ed[_0xfa72('0x6b')]===0x0){return db[_0xfa72('0x39')][_0xfa72('0x5b')]({'name':_0x58a87c[_0xfa72('0x3a')],'resourceId':_0x58a87c['id'],'type':_0x4ec7ed[_0xfa72('0x3a')],'sectionId':_0x4ec7ed['id']},{})[_0xfa72('0x1e')](function(){return _0x3423ad;});}else{return _0x3423ad;}})[_0xfa72('0x29')](function(_0x243d84){logger[_0xfa72('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x243d84);throw _0x243d84;});}return _0x3423ad;})[_0xfa72('0x1e')](respondWithResult(_0x1c2f57,0xc9))['catch'](handleError(_0x1c2f57,null));};exports[_0xfa72('0x6c')]=function(_0x146f6c,_0x555b38,_0x1cc4aa){var _0x25371a;return db[_0xfa72('0x3d')]['find']({'where':{'id':_0x146f6c[_0xfa72('0x58')]['id']}})[_0xfa72('0x1e')](handleEntityNotFound(_0x555b38,null))[_0xfa72('0x1e')](saveUpdates(_0x146f6c[_0xfa72('0x6d')],null))[_0xfa72('0x1e')](function(_0x4a052b){if(_0x4a052b){_0x25371a=_0x4a052b;return db['VoiceContext'][_0xfa72('0x55')]({'raw':!![]});}})[_0xfa72('0x1e')](function(_0x1b52ca){var _0x59bb98=fs[_0xfa72('0x5c')](path['join'](config[_0xfa72('0x5e')],_0xfa72('0x5f')),'utf8');var _0x2bea33=ejs[_0xfa72('0x61')](_0x59bb98,{'contexts':_0x1b52ca||[]});fs[_0xfa72('0x62')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2bea33);})['then'](function(){return respondWithRpcPromise(_0xfa72('0x64'),_0xfa72('0x6c'),{'module':'chan_sip.so'});})[_0xfa72('0x1e')](function(){return _0x25371a;})[_0xfa72('0x1e')](respondWithResult(_0x555b38,null))[_0xfa72('0x29')](handleError(_0x555b38,null));};exports[_0xfa72('0x36')]=function(_0x1f028f,_0x40ea68,_0xb8a90){var _0x46e3ce;return db[_0xfa72('0x3d')]['find']({'where':{'id':_0x1f028f[_0xfa72('0x58')]['id']}})[_0xfa72('0x1e')](handleEntityNotFound(_0x40ea68,null))['then'](removeEntity(_0x40ea68,null))[_0xfa72('0x1e')](function(){return db['VoiceContext'][_0xfa72('0x55')]({'raw':!![]});})[_0xfa72('0x1e')](function(_0x39e120){var _0x5b7adf=fs[_0xfa72('0x5c')](path[_0xfa72('0x5d')](config[_0xfa72('0x5e')],_0xfa72('0x5f')),_0xfa72('0x60'));var _0x1246d8=ejs[_0xfa72('0x61')](_0x5b7adf,{'contexts':_0x39e120});fs[_0xfa72('0x62')](_0xfa72('0x63'),_0x1246d8);return respondWithRpcPromise(_0xfa72('0x64'),_0xfa72('0x36'),{'module':_0xfa72('0x65')});})[_0xfa72('0x29')](handleError(_0x40ea68,null));}; \ No newline at end of file +var _0x2624=['render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','writeFileSync','Reload','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','jayson/promise','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','destroy','get','Contexts','stack','name','send','map','VoiceContext','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','rawAttributes','create','body','findAll','server/files/templates/context.ejs','utf8'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x2624,0x75));var _0x4262=function(_0x2daea1,_0x2f9423){_0x2daea1=_0x2daea1-0x0;var _0x363f43=_0x2624[_0x2daea1];return _0x363f43;};'use strict';var emlformat=require(_0x4262('0x0'));var rimraf=require(_0x4262('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4262('0x2'));var rp=require(_0x4262('0x3'));var moment=require(_0x4262('0x4'));var BPromise=require(_0x4262('0x5'));var Mustache=require('mustache');var util=require(_0x4262('0x6'));var path=require(_0x4262('0x7'));var sox=require(_0x4262('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4262('0x9'));var _=require(_0x4262('0xa'));var squel=require(_0x4262('0xb'));var crypto=require(_0x4262('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4262('0xd'));var querystring=require(_0x4262('0xe'));var Papa=require(_0x4262('0xf'));var Redis=require(_0x4262('0x10'));var authService=require(_0x4262('0x11'));var qs=require(_0x4262('0x12'));var as=require(_0x4262('0x13'));var hardwareService=require(_0x4262('0x14'));var logger=require(_0x4262('0x15'))(_0x4262('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4262('0x17'));var db=require(_0x4262('0x18'))['db'];var jayson=require(_0x4262('0x19'));var client=jayson['client'][_0x4262('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x20b0b3,_0x26f40b,_0x2de456,_0x5d0d33){return new BPromise(function(_0x46c917,_0x463f4e){var _0x3b8a59=_0x5d0d33||client;return _0x3b8a59['request'](_0x20b0b3,_0x2de456)[_0x4262('0x1b')](function(_0x4add63){logger['info'](_0x4262('0x1c'),_0x26f40b,_0x4262('0x1d'));logger[_0x4262('0x1e')](_0x4262('0x1f'),_0x26f40b,_0x4262('0x1d'),JSON[_0x4262('0x20')](_0x4add63));if(_0x4add63['error']){if(_0x4add63[_0x4262('0x21')][_0x4262('0x22')]===0x1f4){logger[_0x4262('0x21')](_0x4262('0x1c'),_0x26f40b,_0x4add63[_0x4262('0x21')][_0x4262('0x23')]);return _0x463f4e(_0x4add63[_0x4262('0x21')][_0x4262('0x23')]);}logger[_0x4262('0x21')]('VoiceContext,\x20%s,\x20%s',_0x26f40b,_0x4add63['error']['message']);return _0x46c917(_0x4add63['error'][_0x4262('0x23')]);}else{logger[_0x4262('0x24')](_0x4262('0x1c'),_0x26f40b,_0x4262('0x1d'));_0x46c917(_0x4add63[_0x4262('0x25')][_0x4262('0x23')]);}})[_0x4262('0x26')](function(_0x128efc){logger['error'](_0x4262('0x1c'),_0x26f40b,_0x128efc);_0x463f4e(_0x128efc);});});}function respondWithStatusCode(_0x47bd87,_0x210ed5){_0x210ed5=_0x210ed5||0xcc;return function(_0x1d222b){if(_0x1d222b){return _0x47bd87[_0x4262('0x27')](_0x210ed5);}return _0x47bd87[_0x4262('0x28')](_0x210ed5)[_0x4262('0x29')]();};}function respondWithResult(_0x296eb4,_0x91a242){_0x91a242=_0x91a242||0xc8;return function(_0x16829c){if(_0x16829c){return _0x296eb4['status'](_0x91a242)[_0x4262('0x2a')](_0x16829c);}};}function respondWithFilteredResult(_0x4ba2eb,_0x4ad9d4){return function(_0x41e83b){if(_0x41e83b){var _0x4fcc12=typeof _0x4ad9d4[_0x4262('0x2b')]===_0x4262('0x2c')&&typeof _0x4ad9d4[_0x4262('0x2d')]==='undefined';var _0x3edda0=_0x41e83b['count'];var _0x1c0c5d=_0x4fcc12?0x0:_0x4ad9d4[_0x4262('0x2b')];var _0x273e3f=_0x4fcc12?_0x41e83b[_0x4262('0x2e')]:_0x4ad9d4[_0x4262('0x2b')]+_0x4ad9d4[_0x4262('0x2d')];var _0x85108a;if(_0x273e3f>=_0x3edda0){_0x273e3f=_0x3edda0;_0x85108a=0xc8;}else{_0x85108a=0xce;}_0x4ba2eb[_0x4262('0x28')](_0x85108a);return _0x4ba2eb['set']('Content-Range',_0x1c0c5d+'-'+_0x273e3f+'/'+_0x3edda0)[_0x4262('0x2a')](_0x41e83b);}return null;};}function patchUpdates(_0x3a16b1){return function(_0x44e822){try{jsonpatch['apply'](_0x44e822,_0x3a16b1,!![]);}catch(_0x201890){return BPromise[_0x4262('0x2f')](_0x201890);}return _0x44e822[_0x4262('0x30')]();};}function saveUpdates(_0xed3e9a,_0x4248a2){return function(_0x4eea3b){if(_0x4eea3b){return _0x4eea3b['update'](_0xed3e9a)[_0x4262('0x1b')](function(_0x4bdb95){return _0x4bdb95;});}return null;};}function removeEntity(_0x408534,_0x390fd1){return function(_0x3699ec){if(_0x3699ec){return _0x3699ec[_0x4262('0x31')]()['then'](function(){var _0x53b08a=_0x3699ec[_0x4262('0x32')]({'plain':!![]});var _0x34da9f=_0x4262('0x33');return db['UserProfileResource'][_0x4262('0x31')]({'where':{'type':_0x34da9f,'resourceId':_0x53b08a['id']}})[_0x4262('0x1b')](function(){return _0x3699ec;});})[_0x4262('0x1b')](function(){_0x408534[_0x4262('0x28')](0xcc)[_0x4262('0x29')]();});}};}function handleEntityNotFound(_0x36bf00,_0x229ad5){return function(_0x408831){if(!_0x408831){_0x36bf00['sendStatus'](0x194);}return _0x408831;};}function handleError(_0x242e93,_0x67503){_0x67503=_0x67503||0x1f4;return function(_0x63a7e0){logger[_0x4262('0x21')](_0x63a7e0[_0x4262('0x34')]);if(_0x63a7e0[_0x4262('0x35')]){delete _0x63a7e0[_0x4262('0x35')];}_0x242e93[_0x4262('0x28')](_0x67503)[_0x4262('0x36')](_0x63a7e0);};}exports['index']=function(_0x266015,_0x50c1a6){var _0x449d22={},_0x2cf211={},_0x1fb7fa={'count':0x0,'rows':[]};var _0x2c1173=_[_0x4262('0x37')](db[_0x4262('0x38')]['rawAttributes'],function(_0x56cacb){return{'name':_0x56cacb[_0x4262('0x39')],'type':_0x56cacb[_0x4262('0x3a')][_0x4262('0x3b')]};});_0x2cf211['model']=_[_0x4262('0x37')](_0x2c1173,'name');_0x2cf211[_0x4262('0x3c')]=_['keys'](_0x266015['query']);_0x2cf211[_0x4262('0x3d')]=_[_0x4262('0x3e')](_0x2cf211[_0x4262('0x3f')],_0x2cf211[_0x4262('0x3c')]);_0x449d22[_0x4262('0x40')]=_['intersection'](_0x2cf211[_0x4262('0x3f')],qs[_0x4262('0x41')](_0x266015['query'][_0x4262('0x41')]));_0x449d22['attributes']=_0x449d22[_0x4262('0x40')][_0x4262('0x42')]?_0x449d22[_0x4262('0x40')]:_0x2cf211[_0x4262('0x3f')];if(!_0x266015[_0x4262('0x3c')][_0x4262('0x43')]('nolimit')){_0x449d22[_0x4262('0x2d')]=qs[_0x4262('0x2d')](_0x266015['query'][_0x4262('0x2d')]);_0x449d22[_0x4262('0x2b')]=qs[_0x4262('0x2b')](_0x266015[_0x4262('0x3c')][_0x4262('0x2b')]);}_0x449d22['order']=qs['sort'](_0x266015['query'][_0x4262('0x44')]);_0x449d22[_0x4262('0x45')]=qs[_0x4262('0x3d')](_[_0x4262('0x46')](_0x266015[_0x4262('0x3c')],_0x2cf211['filters']),_0x2c1173);if(_0x266015[_0x4262('0x3c')]['filter']){_0x449d22[_0x4262('0x45')]=_[_0x4262('0x47')](_0x449d22['where'],{'$or':_[_0x4262('0x37')](_0x2c1173,function(_0x470938){if(_0x470938['type']!==_0x4262('0x48')){var _0x1cdf20={};_0x1cdf20[_0x470938[_0x4262('0x35')]]={'$like':'%'+_0x266015['query'][_0x4262('0x49')]+'%'};return _0x1cdf20;}})});}_0x449d22=_[_0x4262('0x47')]({},_0x449d22,_0x266015[_0x4262('0x4a')]);var _0x47b4c3={'where':_0x449d22['where']};return db[_0x4262('0x38')]['count'](_0x47b4c3)[_0x4262('0x1b')](function(_0x408bb9){_0x1fb7fa[_0x4262('0x2e')]=_0x408bb9;if(_0x266015[_0x4262('0x3c')][_0x4262('0x4b')]){_0x449d22[_0x4262('0x4c')]=[{'all':!![]}];}return db[_0x4262('0x38')]['findAll'](_0x449d22);})[_0x4262('0x1b')](function(_0x2a2535){_0x1fb7fa[_0x4262('0x4d')]=_0x2a2535;return _0x1fb7fa;})['then'](respondWithFilteredResult(_0x50c1a6,_0x449d22))[_0x4262('0x26')](handleError(_0x50c1a6,null));};exports[_0x4262('0x4e')]=function(_0x31cf2a,_0x3db3e8){var _0x492084={'raw':![],'where':{'id':_0x31cf2a[_0x4262('0x4f')]['id']}},_0x11dcd4={};_0x11dcd4['model']=_[_0x4262('0x50')](db[_0x4262('0x38')][_0x4262('0x51')]);_0x11dcd4[_0x4262('0x3c')]=_[_0x4262('0x50')](_0x31cf2a[_0x4262('0x3c')]);_0x11dcd4['filters']=_[_0x4262('0x3e')](_0x11dcd4['model'],_0x11dcd4[_0x4262('0x3c')]);_0x492084[_0x4262('0x40')]=_[_0x4262('0x3e')](_0x11dcd4[_0x4262('0x3f')],qs[_0x4262('0x41')](_0x31cf2a[_0x4262('0x3c')][_0x4262('0x41')]));_0x492084[_0x4262('0x40')]=_0x492084[_0x4262('0x40')]['length']?_0x492084[_0x4262('0x40')]:_0x11dcd4[_0x4262('0x3f')];if(_0x31cf2a[_0x4262('0x3c')][_0x4262('0x4b')]){_0x492084[_0x4262('0x4c')]=[{'all':!![]}];}_0x492084=_[_0x4262('0x47')]({},_0x492084,_0x31cf2a[_0x4262('0x4a')]);return db[_0x4262('0x38')]['find'](_0x492084)['then'](handleEntityNotFound(_0x3db3e8,null))[_0x4262('0x1b')](respondWithResult(_0x3db3e8,null))['catch'](handleError(_0x3db3e8,null));};exports[_0x4262('0x52')]=function(_0xb1b5fb,_0x4e4b6a,_0x13715c){var _0x42d4d7;return db[_0x4262('0x38')]['create'](_0xb1b5fb[_0x4262('0x53')],{'raw':!![]})[_0x4262('0x1b')](function(_0x19ac3b){_0x42d4d7=_0x19ac3b;return db[_0x4262('0x38')][_0x4262('0x54')]({'raw':!![]});})[_0x4262('0x1b')](function(_0x4771e4){var _0x552f3=fs['readFileSync'](path['join'](config['root'],_0x4262('0x55')),_0x4262('0x56'));var _0x44c583=ejs[_0x4262('0x57')](_0x552f3,{'contexts':_0x4771e4||[]});fs['writeFileSync'](_0x4262('0x58'),_0x44c583);})[_0x4262('0x1b')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x4262('0x59')});})[_0x4262('0x1b')](function(){var _0x211b81=_0xb1b5fb[_0x4262('0x5a')]['get']({'plain':!![]});if(!_0x211b81)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x211b81['role']===_0x4262('0x5a')){var _0x9d1fa=_0x42d4d7[_0x4262('0x32')]({'plain':!![]});return db[_0x4262('0x5b')]['find']({'where':{'name':'Contexts','userProfileId':_0x211b81['userProfileId']},'raw':!![]})[_0x4262('0x1b')](function(_0x5553a9){if(_0x5553a9&&_0x5553a9[_0x4262('0x5c')]===0x0){return db[_0x4262('0x5d')][_0x4262('0x52')]({'name':_0x9d1fa[_0x4262('0x35')],'resourceId':_0x9d1fa['id'],'type':_0x5553a9['name'],'sectionId':_0x5553a9['id']},{})[_0x4262('0x1b')](function(){return _0x42d4d7;});}else{return _0x42d4d7;}})['catch'](function(_0x59ae7f){logger[_0x4262('0x21')](_0x4262('0x5e'),_0x59ae7f);throw _0x59ae7f;});}return _0x42d4d7;})[_0x4262('0x1b')](respondWithResult(_0x4e4b6a,0xc9))[_0x4262('0x26')](handleError(_0x4e4b6a,null));};exports['update']=function(_0x13ed39,_0x5d9db3,_0x58cb44){var _0x4de77f;return db[_0x4262('0x38')]['find']({'where':{'id':_0x13ed39[_0x4262('0x4f')]['id']}})[_0x4262('0x1b')](handleEntityNotFound(_0x5d9db3,null))['then'](saveUpdates(_0x13ed39[_0x4262('0x53')],null))[_0x4262('0x1b')](function(_0x7615d2){if(_0x7615d2){_0x4de77f=_0x7615d2;return db['VoiceContext'][_0x4262('0x54')]({'raw':!![]});}})[_0x4262('0x1b')](function(_0x256484){var _0x5f0c60=fs[_0x4262('0x5f')](path[_0x4262('0x60')](config[_0x4262('0x61')],'server/files/templates/context.ejs'),'utf8');var _0x475e26=ejs[_0x4262('0x57')](_0x5f0c60,{'contexts':_0x256484||[]});fs[_0x4262('0x62')](_0x4262('0x58'),_0x475e26);})['then'](function(){return respondWithRpcPromise(_0x4262('0x63'),_0x4262('0x64'),{'module':_0x4262('0x59')});})[_0x4262('0x1b')](function(){return _0x4de77f;})[_0x4262('0x1b')](respondWithResult(_0x5d9db3,null))[_0x4262('0x26')](handleError(_0x5d9db3,null));};exports['destroy']=function(_0x242371,_0x1e444c,_0x472411){var _0x2884cd;return db[_0x4262('0x38')][_0x4262('0x65')]({'where':{'id':_0x242371['params']['id']}})[_0x4262('0x1b')](handleEntityNotFound(_0x1e444c,null))[_0x4262('0x1b')](removeEntity(_0x1e444c,null))[_0x4262('0x1b')](function(){return db['VoiceContext'][_0x4262('0x54')]({'raw':!![]});})['then'](function(_0x5cfdf3){var _0x397e97=fs[_0x4262('0x5f')](path[_0x4262('0x60')](config[_0x4262('0x61')],_0x4262('0x55')),'utf8');var _0x238c9e=ejs[_0x4262('0x57')](_0x397e97,{'contexts':_0x5cfdf3});fs[_0x4262('0x62')](_0x4262('0x58'),_0x238c9e);return respondWithRpcPromise('Reload',_0x4262('0x31'),{'module':_0x4262('0x59')});})[_0x4262('0x26')](handleError(_0x1e444c,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index ee6e038..64a3dd9 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 _0xb156=['request-promise','path','rimraf','./voiceContext.attributes','define','VoiceContext','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4c4c5a,_0x370881){var _0x3f6c1=function(_0x27182b){while(--_0x27182b){_0x4c4c5a['push'](_0x4c4c5a['shift']());}};_0x3f6c1(++_0x370881);}(_0xb156,0x1da));var _0x6b15=function(_0x19115e,_0x507bab){_0x19115e=_0x19115e-0x0;var _0x45bbd4=_0xb156[_0x19115e];return _0x45bbd4;};'use strict';var _=require(_0x6b15('0x0'));var util=require(_0x6b15('0x1'));var logger=require(_0x6b15('0x2'))(_0x6b15('0x3'));var moment=require(_0x6b15('0x4'));var BPromise=require(_0x6b15('0x5'));var rp=require(_0x6b15('0x6'));var fs=require('fs');var path=require(_0x6b15('0x7'));var rimraf=require(_0x6b15('0x8'));var config=require('../../config/environment');var attributes=require(_0x6b15('0x9'));module['exports']=function(_0x3f9a12,_0x1c2802){return _0x3f9a12[_0x6b15('0xa')](_0x6b15('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94d4=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','lodash','util','api','moment','bluebird'];(function(_0x14a1c8,_0x22b96d){var _0x17b2cd=function(_0x38a81f){while(--_0x38a81f){_0x14a1c8['push'](_0x14a1c8['shift']());}};_0x17b2cd(++_0x22b96d);}(_0x94d4,0xa5));var _0x494d=function(_0x493866,_0x346a31){_0x493866=_0x493866-0x0;var _0x11bed2=_0x94d4[_0x493866];return _0x11bed2;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var logger=require('../../config/logger')(_0x494d('0x2'));var moment=require(_0x494d('0x3'));var BPromise=require(_0x494d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x494d('0x5'));var rimraf=require(_0x494d('0x6'));var config=require(_0x494d('0x7'));var attributes=require(_0x494d('0x8'));module[_0x494d('0x9')]=function(_0x1772bd,_0x595c04){return _0x1772bd['define']('VoiceContext',attributes,{'tableName':'voice_contexts','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 a206977..0d67a31 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 _0xf767=['../../config/environment','jayson/promise','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x279522,_0x497270){var _0xc6071d=function(_0x505793){while(--_0x505793){_0x279522['push'](_0x279522['shift']());}};_0xc6071d(++_0x497270);}(_0xf767,0x183));var _0x7f76=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0xf767[_0x445101];return _0x3c3d04;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f76('0x0'));var BPromise=require(_0x7f76('0x1'));var rs=require(_0x7f76('0x2'));var fs=require('fs');var Redis=require(_0x7f76('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7f76('0x4'));var jayson=require(_0x7f76('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23629f,_0x370b0a,_0x5ced68){return new BPromise(function(_0x4060f6,_0x7561e0){return client['request'](_0x23629f,_0x5ced68)[_0x7f76('0x6')](function(_0x3e79ad){logger[_0x7f76('0x7')](_0x7f76('0x8'),_0x370b0a,_0x7f76('0x9'));logger[_0x7f76('0xa')](_0x7f76('0xb'),_0x370b0a,_0x7f76('0x9'),JSON[_0x7f76('0xc')](_0x3e79ad));if(_0x3e79ad['error']){if(_0x3e79ad[_0x7f76('0xd')][_0x7f76('0xe')]===0x1f4){logger[_0x7f76('0xd')](_0x7f76('0x8'),_0x370b0a,_0x3e79ad[_0x7f76('0xd')][_0x7f76('0xf')]);return _0x7561e0(_0x3e79ad[_0x7f76('0xd')][_0x7f76('0xf')]);}logger[_0x7f76('0xd')]('VoiceContext,\x20%s,\x20%s',_0x370b0a,_0x3e79ad[_0x7f76('0xd')][_0x7f76('0xf')]);return _0x4060f6(_0x3e79ad[_0x7f76('0xd')][_0x7f76('0xf')]);}else{logger['info'](_0x7f76('0x8'),_0x370b0a,_0x7f76('0x9'));_0x4060f6(_0x3e79ad[_0x7f76('0x10')]['message']);}})['catch'](function(_0x1eea7e){logger['error'](_0x7f76('0x8'),_0x370b0a,_0x1eea7e);_0x7561e0(_0x1eea7e);});});} \ No newline at end of file +var _0x5e6c=['debug','request\x20sent','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x42968f,_0x5220ee){var _0x443182=function(_0x498cac){while(--_0x498cac){_0x42968f['push'](_0x42968f['shift']());}};_0x443182(++_0x5220ee);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0xddeaa9,_0x4a8cc6){_0xddeaa9=_0xddeaa9-0x0;var _0x54cf02=_0x5e6c[_0xddeaa9];return _0x54cf02;};'use strict';var _=require('lodash');var util=require(_0xc5e6('0x0'));var moment=require(_0xc5e6('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5e6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc5e6('0x3'))(_0xc5e6('0x4'));var config=require('../../config/environment');var jayson=require(_0xc5e6('0x5'));var client=jayson['client'][_0xc5e6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x79124e,_0x4b438c,_0x322299){return new BPromise(function(_0x360980,_0x71405){return client[_0xc5e6('0x7')](_0x79124e,_0x322299)[_0xc5e6('0x8')](function(_0x2abbe8){logger[_0xc5e6('0x9')]('VoiceContext,\x20%s,\x20%s',_0x4b438c,'request\x20sent');logger[_0xc5e6('0xa')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4b438c,_0xc5e6('0xb'),JSON['stringify'](_0x2abbe8));if(_0x2abbe8['error']){if(_0x2abbe8[_0xc5e6('0xc')][_0xc5e6('0xd')]===0x1f4){logger[_0xc5e6('0xc')](_0xc5e6('0xe'),_0x4b438c,_0x2abbe8[_0xc5e6('0xc')][_0xc5e6('0xf')]);return _0x71405(_0x2abbe8[_0xc5e6('0xc')][_0xc5e6('0xf')]);}logger[_0xc5e6('0xc')](_0xc5e6('0xe'),_0x4b438c,_0x2abbe8[_0xc5e6('0xc')][_0xc5e6('0xf')]);return _0x360980(_0x2abbe8[_0xc5e6('0xc')][_0xc5e6('0xf')]);}else{logger[_0xc5e6('0x9')](_0xc5e6('0xe'),_0x4b438c,'request\x20sent');_0x360980(_0x2abbe8[_0xc5e6('0x10')]['message']);}})[_0xc5e6('0x11')](function(_0x41ca28){logger[_0xc5e6('0xc')](_0xc5e6('0xe'),_0x4b438c,_0x41ca28);_0x71405(_0x41ca28);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 3370572..4cb4d3f 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 _0x1da6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x1da6,0x7c));var _0x61da=function(_0x3cd451,_0x26e81a){_0x3cd451=_0x3cd451-0x0;var _0x571ce6=_0x1da6[_0x3cd451];return _0x571ce6;};'use strict';var multer=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var path=require(_0x61da('0x2'));var timeout=require(_0x61da('0x3'));var express=require(_0x61da('0x4'));var router=express[_0x61da('0x5')]();var fs_extra=require(_0x61da('0x6'));var auth=require(_0x61da('0x7'));var interaction=require(_0x61da('0x8'));var config=require(_0x61da('0x9'));var controller=require(_0x61da('0xa'));router[_0x61da('0xb')]('/',auth[_0x61da('0xc')](),controller[_0x61da('0xd')]);router[_0x61da('0xb')](_0x61da('0xe'),auth[_0x61da('0xc')](),controller[_0x61da('0xf')]);router[_0x61da('0xb')](_0x61da('0x10'),auth['isAuthenticated'](),controller[_0x61da('0x11')]);router[_0x61da('0x12')]('/',auth[_0x61da('0xc')](),controller[_0x61da('0x13')]);router[_0x61da('0x14')](_0x61da('0x10'),auth[_0x61da('0xc')](),controller[_0x61da('0x15')]);router[_0x61da('0x16')](_0x61da('0x10'),auth[_0x61da('0xc')](),controller[_0x61da('0x17')]);module[_0x61da('0x18')]=router; \ No newline at end of file +var _0xb19d=['post','create','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x23b547,_0x118b02){var _0x30733f=function(_0x55c27e){while(--_0x55c27e){_0x23b547['push'](_0x23b547['shift']());}};_0x30733f(++_0x118b02);}(_0xb19d,0x8b));var _0xdb19=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xb19d[_0x1fd675];return _0x16b554;};'use strict';var multer=require(_0xdb19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdb19('0x1'));var express=require(_0xdb19('0x2'));var router=express[_0xdb19('0x3')]();var fs_extra=require(_0xdb19('0x4'));var auth=require(_0xdb19('0x5'));var interaction=require(_0xdb19('0x6'));var config=require(_0xdb19('0x7'));var controller=require(_0xdb19('0x8'));router[_0xdb19('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb19('0xa')]);router['get'](_0xdb19('0xb'),auth[_0xdb19('0xc')](),controller[_0xdb19('0xd')]);router[_0xdb19('0x9')]('/:id',auth[_0xdb19('0xc')](),controller[_0xdb19('0xe')]);router[_0xdb19('0xf')]('/',auth[_0xdb19('0xc')](),controller[_0xdb19('0x10')]);router['put'](_0xdb19('0x11'),auth['isAuthenticated'](),controller[_0xdb19('0x12')]);router[_0xdb19('0x13')]('/:id',auth[_0xdb19('0xc')](),controller[_0xdb19('0x14')]);module[_0xdb19('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 95ac745..dab8371 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 _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x13b8c8,_0x3c6cbc){var _0x1c3a4f=function(_0x1eec1f){while(--_0x1eec1f){_0x13b8c8['push'](_0x13b8c8['shift']());}};_0x1c3a4f(++_0x3c6cbc);}(_0x008c,0x188));var _0xc008=function(_0x3bee27,_0x211a75){_0x3bee27=_0x3bee27-0x0;var _0x500445=_0x008c[_0x3bee27];return _0x500445;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x6a2857,_0x507f15){var _0x32be04=function(_0x27c744){while(--_0x27c744){_0x6a2857['push'](_0x6a2857['shift']());}};_0x32be04(++_0x507f15);}(_0xb821,0xa7));var _0x1b82=function(_0xba9a47,_0x4f142a){_0xba9a47=_0xba9a47-0x0;var _0x564376=_0xb821[_0xba9a47];return _0x564376;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8e68feb..3b1f817 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 _0xa1c8=['util','path','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x358b9f,_0x3ec3f1){var _0x315cc0=function(_0x1f555c){while(--_0x1f555c){_0x358b9f['push'](_0x358b9f['shift']());}};_0x315cc0(++_0x3ec3f1);}(_0xa1c8,0x119));var _0x8a1c=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa1c8[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x8a1c('0x0'));var rimraf=require(_0x8a1c('0x1'));var zipdir=require(_0x8a1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a1c('0x3'));var moment=require(_0x8a1c('0x4'));var BPromise=require(_0x8a1c('0x5'));var Mustache=require(_0x8a1c('0x6'));var util=require(_0x8a1c('0x7'));var path=require(_0x8a1c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a1c('0x9'));var _=require(_0x8a1c('0xa'));var squel=require('squel');var crypto=require(_0x8a1c('0xb'));var jsforce=require(_0x8a1c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8a1c('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a1c('0xe'));var authService=require(_0x8a1c('0xf'));var qs=require(_0x8a1c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a1c('0x11'));var logger=require(_0x8a1c('0x12'))('api');var utils=require(_0x8a1c('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a1c('0x14'))['db'];function respondWithStatusCode(_0x21bec9,_0x37d19){_0x37d19=_0x37d19||0xcc;return function(_0x2b650a){if(_0x2b650a){return _0x21bec9[_0x8a1c('0x15')](_0x37d19);}return _0x21bec9[_0x8a1c('0x16')](_0x37d19)[_0x8a1c('0x17')]();};}function respondWithResult(_0x127745,_0x423e6c){_0x423e6c=_0x423e6c||0xc8;return function(_0x41d620){if(_0x41d620){return _0x127745[_0x8a1c('0x16')](_0x423e6c)[_0x8a1c('0x18')](_0x41d620);}};}function respondWithFilteredResult(_0x5cc2d8,_0x42a7e6){return function(_0x24c266){if(_0x24c266){var _0x1e6d2d=typeof _0x42a7e6['offset']===_0x8a1c('0x19')&&typeof _0x42a7e6[_0x8a1c('0x1a')]===_0x8a1c('0x19');var _0xf47b10=_0x24c266[_0x8a1c('0x1b')];var _0x4b4019=_0x1e6d2d?0x0:_0x42a7e6[_0x8a1c('0x1c')];var _0x397ee2=_0x1e6d2d?_0x24c266[_0x8a1c('0x1b')]:_0x42a7e6[_0x8a1c('0x1c')]+_0x42a7e6[_0x8a1c('0x1a')];var _0x587902;if(_0x397ee2>=_0xf47b10){_0x397ee2=_0xf47b10;_0x587902=0xc8;}else{_0x587902=0xce;}_0x5cc2d8[_0x8a1c('0x16')](_0x587902);return _0x5cc2d8['set'](_0x8a1c('0x1d'),_0x4b4019+'-'+_0x397ee2+'/'+_0xf47b10)['json'](_0x24c266);}return null;};}function patchUpdates(_0x2ad03d){return function(_0x2bdcbe){try{jsonpatch[_0x8a1c('0x1e')](_0x2bdcbe,_0x2ad03d,!![]);}catch(_0x138ed1){return BPromise[_0x8a1c('0x1f')](_0x138ed1);}return _0x2bdcbe['save']();};}function saveUpdates(_0x50ea38,_0x1c0d9){return function(_0x12e8d3){if(_0x12e8d3){return _0x12e8d3[_0x8a1c('0x20')](_0x50ea38)[_0x8a1c('0x21')](function(_0x3340c0){return _0x3340c0;});}return null;};}function removeEntity(_0x4f2901,_0x23fa57){return function(_0x59d92b){if(_0x59d92b){return _0x59d92b[_0x8a1c('0x22')]()[_0x8a1c('0x21')](function(){_0x4f2901[_0x8a1c('0x16')](0xcc)[_0x8a1c('0x17')]();});}};}function handleEntityNotFound(_0x58ce0a,_0xdfdfe1){return function(_0x39497d){if(!_0x39497d){_0x58ce0a[_0x8a1c('0x15')](0x194);}return _0x39497d;};}function handleError(_0x78a1d2,_0x54c70a){_0x54c70a=_0x54c70a||0x1f4;return function(_0x3e3066){logger[_0x8a1c('0x23')](_0x3e3066[_0x8a1c('0x24')]);if(_0x3e3066['name']){delete _0x3e3066[_0x8a1c('0x25')];}_0x78a1d2[_0x8a1c('0x16')](_0x54c70a)['send'](_0x3e3066);};}exports[_0x8a1c('0x26')]=function(_0x1c0183,_0x27654f){var _0x470555={},_0x52d30e={},_0x473e66={'count':0x0,'rows':[]};var _0xa6e754=_[_0x8a1c('0x27')](db[_0x8a1c('0x28')][_0x8a1c('0x29')],function(_0x31de16){return{'name':_0x31de16[_0x8a1c('0x2a')],'type':_0x31de16[_0x8a1c('0x2b')][_0x8a1c('0x2c')]};});_0x52d30e[_0x8a1c('0x2d')]=_[_0x8a1c('0x27')](_0xa6e754,_0x8a1c('0x25'));_0x52d30e[_0x8a1c('0x2e')]=_[_0x8a1c('0x2f')](_0x1c0183[_0x8a1c('0x2e')]);_0x52d30e['filters']=_[_0x8a1c('0x30')](_0x52d30e[_0x8a1c('0x2d')],_0x52d30e[_0x8a1c('0x2e')]);_0x470555[_0x8a1c('0x31')]=_[_0x8a1c('0x30')](_0x52d30e[_0x8a1c('0x2d')],qs[_0x8a1c('0x32')](_0x1c0183['query']['fields']));_0x470555[_0x8a1c('0x31')]=_0x470555[_0x8a1c('0x31')][_0x8a1c('0x33')]?_0x470555[_0x8a1c('0x31')]:_0x52d30e[_0x8a1c('0x2d')];if(!_0x1c0183[_0x8a1c('0x2e')]['hasOwnProperty'](_0x8a1c('0x34'))){_0x470555[_0x8a1c('0x1a')]=qs['limit'](_0x1c0183[_0x8a1c('0x2e')][_0x8a1c('0x1a')]);_0x470555['offset']=qs['offset'](_0x1c0183[_0x8a1c('0x2e')][_0x8a1c('0x1c')]);}_0x470555[_0x8a1c('0x35')]=qs['sort'](_0x1c0183[_0x8a1c('0x2e')][_0x8a1c('0x36')]);_0x470555['where']=qs['filters'](_[_0x8a1c('0x37')](_0x1c0183[_0x8a1c('0x2e')],_0x52d30e[_0x8a1c('0x38')]),_0xa6e754);if(_0x1c0183[_0x8a1c('0x2e')][_0x8a1c('0x39')]){_0x470555['where']=_[_0x8a1c('0x3a')](_0x470555[_0x8a1c('0x3b')],{'$or':_[_0x8a1c('0x27')](_0xa6e754,function(_0x42b161){if(_0x42b161['type']!==_0x8a1c('0x3c')){var _0x5bb59e={};_0x5bb59e[_0x42b161[_0x8a1c('0x25')]]={'$like':'%'+_0x1c0183[_0x8a1c('0x2e')][_0x8a1c('0x39')]+'%'};return _0x5bb59e;}})});}_0x470555=_['merge']({},_0x470555,_0x1c0183[_0x8a1c('0x3d')]);var _0x5461e4={'where':_0x470555[_0x8a1c('0x3b')]};return db[_0x8a1c('0x28')][_0x8a1c('0x1b')](_0x5461e4)[_0x8a1c('0x21')](function(_0xc93dec){_0x473e66[_0x8a1c('0x1b')]=_0xc93dec;if(_0x1c0183[_0x8a1c('0x2e')]['includeAll']){_0x470555[_0x8a1c('0x3e')]=[{'all':!![]}];}return db[_0x8a1c('0x28')][_0x8a1c('0x3f')](_0x470555);})['then'](function(_0x4cb219){_0x473e66['rows']=_0x4cb219;return _0x473e66;})[_0x8a1c('0x21')](respondWithFilteredResult(_0x27654f,_0x470555))[_0x8a1c('0x40')](handleError(_0x27654f,null));};exports[_0x8a1c('0x41')]=function(_0x14a8e9,_0x58246d){var _0x20b6e0={'raw':!![],'where':{'id':_0x14a8e9[_0x8a1c('0x42')]['id']}},_0x8c8b8={};_0x8c8b8[_0x8a1c('0x2d')]=_[_0x8a1c('0x2f')](db[_0x8a1c('0x28')]['rawAttributes']);_0x8c8b8[_0x8a1c('0x2e')]=_[_0x8a1c('0x2f')](_0x14a8e9['query']);_0x8c8b8[_0x8a1c('0x38')]=_[_0x8a1c('0x30')](_0x8c8b8[_0x8a1c('0x2d')],_0x8c8b8[_0x8a1c('0x2e')]);_0x20b6e0[_0x8a1c('0x31')]=_[_0x8a1c('0x30')](_0x8c8b8[_0x8a1c('0x2d')],qs[_0x8a1c('0x32')](_0x14a8e9['query'][_0x8a1c('0x32')]));_0x20b6e0['attributes']=_0x20b6e0[_0x8a1c('0x31')]['length']?_0x20b6e0[_0x8a1c('0x31')]:_0x8c8b8['model'];if(_0x14a8e9[_0x8a1c('0x2e')][_0x8a1c('0x43')]){_0x20b6e0['include']=[{'all':!![]}];}_0x20b6e0=_[_0x8a1c('0x3a')]({},_0x20b6e0,_0x14a8e9[_0x8a1c('0x3d')]);return db[_0x8a1c('0x28')][_0x8a1c('0x44')](_0x20b6e0)[_0x8a1c('0x21')](handleEntityNotFound(_0x58246d,null))['then'](respondWithResult(_0x58246d,null))[_0x8a1c('0x40')](handleError(_0x58246d,null));};exports[_0x8a1c('0x45')]=function(_0x3aa8b8,_0x18bb57){return db[_0x8a1c('0x28')][_0x8a1c('0x45')](_0x3aa8b8['body'],{})['then'](respondWithResult(_0x18bb57,0xc9))[_0x8a1c('0x40')](handleError(_0x18bb57,null));};exports[_0x8a1c('0x20')]=function(_0x25cb61,_0x319fa5){if(_0x25cb61[_0x8a1c('0x46')]['id']){delete _0x25cb61[_0x8a1c('0x46')]['id'];}return db[_0x8a1c('0x28')][_0x8a1c('0x44')]({'where':{'id':_0x25cb61[_0x8a1c('0x42')]['id']}})[_0x8a1c('0x21')](handleEntityNotFound(_0x319fa5,null))[_0x8a1c('0x21')](saveUpdates(_0x25cb61['body'],null))[_0x8a1c('0x21')](respondWithResult(_0x319fa5,null))['catch'](handleError(_0x319fa5,null));};exports[_0x8a1c('0x22')]=function(_0x12500b,_0x3a12ab){return db[_0x8a1c('0x28')]['find']({'where':{'id':_0x12500b[_0x8a1c('0x42')]['id']}})[_0x8a1c('0x21')](handleEntityNotFound(_0x3a12ab,null))[_0x8a1c('0x21')](removeEntity(_0x3a12ab,null))[_0x8a1c('0x40')](handleError(_0x3a12ab,null));};exports[_0x8a1c('0x47')]=function(_0x453c72,_0x42f0ab){return db[_0x8a1c('0x28')][_0x8a1c('0x47')]()['then'](respondWithResult(_0x42f0ab,null))[_0x8a1c('0x40')](handleError(_0x42f0ab,null));}; \ No newline at end of file +var _0x4b82=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','catch','show','rawAttributes','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4b82,0xc7));var _0x24b8=function(_0x2b1cdd,_0x1c47ef){_0x2b1cdd=_0x2b1cdd-0x0;var _0xc554f2=_0x4b82[_0x2b1cdd];return _0xc554f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24b8('0x1'));var rp=require(_0x24b8('0x2'));var moment=require(_0x24b8('0x3'));var BPromise=require(_0x24b8('0x4'));var Mustache=require(_0x24b8('0x5'));var util=require(_0x24b8('0x6'));var path=require(_0x24b8('0x7'));var sox=require(_0x24b8('0x8'));var csv=require('to-csv');var ejs=require(_0x24b8('0x9'));var fs=require('fs');var fs_extra=require(_0x24b8('0xa'));var _=require(_0x24b8('0xb'));var squel=require(_0x24b8('0xc'));var crypto=require(_0x24b8('0xd'));var jsforce=require(_0x24b8('0xe'));var deskjs=require(_0x24b8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x24b8('0x10'));var Papa=require('papaparse');var Redis=require(_0x24b8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x24b8('0x12'));var as=require(_0x24b8('0x13'));var hardwareService=require(_0x24b8('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x24b8('0x15'));var licenseUtil=require(_0x24b8('0x16'));var db=require(_0x24b8('0x17'))['db'];function respondWithStatusCode(_0x1d5452,_0x229e76){_0x229e76=_0x229e76||0xcc;return function(_0x3544a2){if(_0x3544a2){return _0x1d5452[_0x24b8('0x18')](_0x229e76);}return _0x1d5452['status'](_0x229e76)['end']();};}function respondWithResult(_0x3d7109,_0x3d5ec4){_0x3d5ec4=_0x3d5ec4||0xc8;return function(_0x400a86){if(_0x400a86){return _0x3d7109[_0x24b8('0x19')](_0x3d5ec4)[_0x24b8('0x1a')](_0x400a86);}};}function respondWithFilteredResult(_0x5b2f03,_0x230290){return function(_0x34cf2a){if(_0x34cf2a){var _0xd06df5=typeof _0x230290[_0x24b8('0x1b')]===_0x24b8('0x1c')&&typeof _0x230290[_0x24b8('0x1d')]==='undefined';var _0x1efca7=_0x34cf2a['count'];var _0x2ce781=_0xd06df5?0x0:_0x230290[_0x24b8('0x1b')];var _0x4cec99=_0xd06df5?_0x34cf2a[_0x24b8('0x1e')]:_0x230290[_0x24b8('0x1b')]+_0x230290['limit'];var _0x145cbf;if(_0x4cec99>=_0x1efca7){_0x4cec99=_0x1efca7;_0x145cbf=0xc8;}else{_0x145cbf=0xce;}_0x5b2f03[_0x24b8('0x19')](_0x145cbf);return _0x5b2f03[_0x24b8('0x1f')](_0x24b8('0x20'),_0x2ce781+'-'+_0x4cec99+'/'+_0x1efca7)['json'](_0x34cf2a);}return null;};}function patchUpdates(_0x297401){return function(_0x1af66b){try{jsonpatch[_0x24b8('0x21')](_0x1af66b,_0x297401,!![]);}catch(_0x23905f){return BPromise[_0x24b8('0x22')](_0x23905f);}return _0x1af66b[_0x24b8('0x23')]();};}function saveUpdates(_0x56d6f2,_0x39d5ec){return function(_0x20256d){if(_0x20256d){return _0x20256d[_0x24b8('0x24')](_0x56d6f2)[_0x24b8('0x25')](function(_0x3c6988){return _0x3c6988;});}return null;};}function removeEntity(_0x49ce96,_0x58d237){return function(_0x98c2b7){if(_0x98c2b7){return _0x98c2b7[_0x24b8('0x26')]()[_0x24b8('0x25')](function(){_0x49ce96[_0x24b8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ec431,_0x39b8fd){return function(_0x597fc5){if(!_0x597fc5){_0x1ec431['sendStatus'](0x194);}return _0x597fc5;};}function handleError(_0x5e72d1,_0x5c67c3){_0x5c67c3=_0x5c67c3||0x1f4;return function(_0x1e12cb){logger[_0x24b8('0x27')](_0x1e12cb[_0x24b8('0x28')]);if(_0x1e12cb['name']){delete _0x1e12cb[_0x24b8('0x29')];}_0x5e72d1[_0x24b8('0x19')](_0x5c67c3)[_0x24b8('0x2a')](_0x1e12cb);};}exports[_0x24b8('0x2b')]=function(_0x340213,_0x263cce){var _0x1f5ee8={},_0x14423d={},_0x451c10={'count':0x0,'rows':[]};var _0x4d0700=_['map'](db[_0x24b8('0x2c')]['rawAttributes'],function(_0x567781){return{'name':_0x567781[_0x24b8('0x2d')],'type':_0x567781[_0x24b8('0x2e')][_0x24b8('0x2f')]};});_0x14423d[_0x24b8('0x30')]=_['map'](_0x4d0700,_0x24b8('0x29'));_0x14423d[_0x24b8('0x31')]=_[_0x24b8('0x32')](_0x340213[_0x24b8('0x31')]);_0x14423d[_0x24b8('0x33')]=_['intersection'](_0x14423d[_0x24b8('0x30')],_0x14423d['query']);_0x1f5ee8[_0x24b8('0x34')]=_[_0x24b8('0x35')](_0x14423d[_0x24b8('0x30')],qs['fields'](_0x340213[_0x24b8('0x31')][_0x24b8('0x36')]));_0x1f5ee8[_0x24b8('0x34')]=_0x1f5ee8[_0x24b8('0x34')][_0x24b8('0x37')]?_0x1f5ee8['attributes']:_0x14423d['model'];if(!_0x340213['query'][_0x24b8('0x38')](_0x24b8('0x39'))){_0x1f5ee8[_0x24b8('0x1d')]=qs[_0x24b8('0x1d')](_0x340213[_0x24b8('0x31')][_0x24b8('0x1d')]);_0x1f5ee8[_0x24b8('0x1b')]=qs[_0x24b8('0x1b')](_0x340213[_0x24b8('0x31')][_0x24b8('0x1b')]);}_0x1f5ee8['order']=qs[_0x24b8('0x3a')](_0x340213[_0x24b8('0x31')][_0x24b8('0x3a')]);_0x1f5ee8[_0x24b8('0x3b')]=qs[_0x24b8('0x33')](_[_0x24b8('0x3c')](_0x340213[_0x24b8('0x31')],_0x14423d['filters']),_0x4d0700);if(_0x340213[_0x24b8('0x31')][_0x24b8('0x3d')]){_0x1f5ee8[_0x24b8('0x3b')]=_['merge'](_0x1f5ee8['where'],{'$or':_[_0x24b8('0x3e')](_0x4d0700,function(_0x54ede8){if(_0x54ede8[_0x24b8('0x2e')]!==_0x24b8('0x3f')){var _0x3ebf06={};_0x3ebf06[_0x54ede8[_0x24b8('0x29')]]={'$like':'%'+_0x340213['query']['filter']+'%'};return _0x3ebf06;}})});}_0x1f5ee8=_[_0x24b8('0x40')]({},_0x1f5ee8,_0x340213[_0x24b8('0x41')]);var _0x88d86f={'where':_0x1f5ee8[_0x24b8('0x3b')]};return db[_0x24b8('0x2c')][_0x24b8('0x1e')](_0x88d86f)[_0x24b8('0x25')](function(_0x2837fc){_0x451c10[_0x24b8('0x1e')]=_0x2837fc;if(_0x340213['query'][_0x24b8('0x42')]){_0x1f5ee8[_0x24b8('0x43')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x1f5ee8);})[_0x24b8('0x25')](function(_0x28dd8e){_0x451c10['rows']=_0x28dd8e;return _0x451c10;})[_0x24b8('0x25')](respondWithFilteredResult(_0x263cce,_0x1f5ee8))[_0x24b8('0x44')](handleError(_0x263cce,null));};exports[_0x24b8('0x45')]=function(_0x1223f8,_0x39ec49){var _0x9f49ba={'raw':!![],'where':{'id':_0x1223f8['params']['id']}},_0x152a76={};_0x152a76[_0x24b8('0x30')]=_[_0x24b8('0x32')](db[_0x24b8('0x2c')][_0x24b8('0x46')]);_0x152a76['query']=_[_0x24b8('0x32')](_0x1223f8[_0x24b8('0x31')]);_0x152a76['filters']=_[_0x24b8('0x35')](_0x152a76[_0x24b8('0x30')],_0x152a76[_0x24b8('0x31')]);_0x9f49ba[_0x24b8('0x34')]=_[_0x24b8('0x35')](_0x152a76[_0x24b8('0x30')],qs[_0x24b8('0x36')](_0x1223f8[_0x24b8('0x31')][_0x24b8('0x36')]));_0x9f49ba[_0x24b8('0x34')]=_0x9f49ba[_0x24b8('0x34')][_0x24b8('0x37')]?_0x9f49ba[_0x24b8('0x34')]:_0x152a76[_0x24b8('0x30')];if(_0x1223f8['query'][_0x24b8('0x42')]){_0x9f49ba[_0x24b8('0x43')]=[{'all':!![]}];}_0x9f49ba=_[_0x24b8('0x40')]({},_0x9f49ba,_0x1223f8[_0x24b8('0x41')]);return db[_0x24b8('0x2c')][_0x24b8('0x47')](_0x9f49ba)[_0x24b8('0x25')](handleEntityNotFound(_0x39ec49,null))[_0x24b8('0x25')](respondWithResult(_0x39ec49,null))[_0x24b8('0x44')](handleError(_0x39ec49,null));};exports[_0x24b8('0x48')]=function(_0x4854d9,_0x1a86d6){return db[_0x24b8('0x2c')]['create'](_0x4854d9[_0x24b8('0x49')],{})[_0x24b8('0x25')](respondWithResult(_0x1a86d6,0xc9))[_0x24b8('0x44')](handleError(_0x1a86d6,null));};exports[_0x24b8('0x24')]=function(_0x427258,_0xba3804){if(_0x427258[_0x24b8('0x49')]['id']){delete _0x427258[_0x24b8('0x49')]['id'];}return db[_0x24b8('0x2c')][_0x24b8('0x47')]({'where':{'id':_0x427258[_0x24b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0xba3804,null))[_0x24b8('0x25')](saveUpdates(_0x427258[_0x24b8('0x49')],null))['then'](respondWithResult(_0xba3804,null))[_0x24b8('0x44')](handleError(_0xba3804,null));};exports[_0x24b8('0x26')]=function(_0x480dec,_0x19fdc2){return db[_0x24b8('0x2c')][_0x24b8('0x47')]({'where':{'id':_0x480dec[_0x24b8('0x4a')]['id']}})[_0x24b8('0x25')](handleEntityNotFound(_0x19fdc2,null))['then'](removeEntity(_0x19fdc2,null))[_0x24b8('0x44')](handleError(_0x19fdc2,null));};exports[_0x24b8('0x4b')]=function(_0x332441,_0x331c3b){return db[_0x24b8('0x2c')]['describe']()[_0x24b8('0x25')](respondWithResult(_0x331c3b,null))[_0x24b8('0x44')](handleError(_0x331c3b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 144b331..2ab08c0 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 _0x2159=['../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x304fe9,_0x1da07d){var _0x5b98a7=function(_0x6597c0){while(--_0x6597c0){_0x304fe9['push'](_0x304fe9['shift']());}};_0x5b98a7(++_0x1da07d);}(_0x2159,0x17f));var _0x9215=function(_0x1f6f5f,_0x18af05){_0x1f6f5f=_0x1f6f5f-0x0;var _0x407847=_0x2159[_0x1f6f5f];return _0x407847;};'use strict';var _=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var logger=require(_0x9215('0x2'))(_0x9215('0x3'));var moment=require('moment');var BPromise=require(_0x9215('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9215('0x5'));var rimraf=require(_0x9215('0x6'));var config=require(_0x9215('0x7'));var attributes=require(_0x9215('0x8'));module[_0x9215('0x9')]=function(_0x1fd854,_0x3be70d){return _0x1fd854[_0x9215('0xa')]('VoiceDialReport',attributes,{'tableName':_0x9215('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9215('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee44=['define','VoiceDialReport','lodash','util','bluebird','rimraf','../../config/environment','exports'];(function(_0x4b6214,_0x59bb66){var _0x3cf589=function(_0x1d378b){while(--_0x1d378b){_0x4b6214['push'](_0x4b6214['shift']());}};_0x3cf589(++_0x59bb66);}(_0xee44,0xaa));var _0x4ee4=function(_0x4f9ed9,_0x5169b3){_0x4f9ed9=_0x4f9ed9-0x0;var _0x2e505f=_0xee44[_0x4f9ed9];return _0x2e505f;};'use strict';var _=require(_0x4ee4('0x0'));var util=require(_0x4ee4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4ee4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ee4('0x3'));var config=require(_0x4ee4('0x4'));var attributes=require('./voiceDialReport.attributes');module[_0x4ee4('0x5')]=function(_0x484ed3,_0x5a28dc){return _0x484ed3[_0x4ee4('0x6')](_0x4ee4('0x7'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index a9cc59b..4b38bf1 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 _0x6055=['request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','raw','then','UpdateVoiceDialReport','update','options','where','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s'];(function(_0xb82166,_0x4b9e07){var _0x3e0b83=function(_0x5e0b48){while(--_0x5e0b48){_0xb82166['push'](_0xb82166['shift']());}};_0x3e0b83(++_0x4b9e07);}(_0x6055,0xbd));var _0x5605=function(_0x161b74,_0x2125d4){_0x161b74=_0x161b74-0x0;var _0x31afbd=_0x6055[_0x161b74];return _0x31afbd;};'use strict';var _=require(_0x5605('0x0'));var util=require(_0x5605('0x1'));var moment=require(_0x5605('0x2'));var BPromise=require(_0x5605('0x3'));var rs=require(_0x5605('0x4'));var fs=require('fs');var Redis=require(_0x5605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5605('0x6'));var logger=require(_0x5605('0x7'))('rpc');var config=require(_0x5605('0x8'));var jayson=require(_0x5605('0x9'));var client=jayson[_0x5605('0xa')][_0x5605('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7be507,_0x562e35,_0x56f281){return new BPromise(function(_0x1910cd,_0x4a0f1f){return client[_0x5605('0xc')](_0x7be507,_0x56f281)['then'](function(_0x452f4f){logger[_0x5605('0xd')](_0x5605('0xe'),_0x562e35,_0x5605('0xf'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x562e35,_0x5605('0xf'),JSON[_0x5605('0x10')](_0x452f4f));if(_0x452f4f[_0x5605('0x11')]){if(_0x452f4f['error'][_0x5605('0x12')]===0x1f4){logger[_0x5605('0x11')](_0x5605('0xe'),_0x562e35,_0x452f4f[_0x5605('0x11')]['message']);return _0x4a0f1f(_0x452f4f[_0x5605('0x11')][_0x5605('0x13')]);}logger[_0x5605('0x11')](_0x5605('0xe'),_0x562e35,_0x452f4f[_0x5605('0x11')][_0x5605('0x13')]);return _0x1910cd(_0x452f4f[_0x5605('0x11')][_0x5605('0x13')]);}else{logger[_0x5605('0xd')](_0x5605('0xe'),_0x562e35,_0x5605('0xf'));_0x1910cd(_0x452f4f[_0x5605('0x14')][_0x5605('0x13')]);}})[_0x5605('0x15')](function(_0x401974){logger[_0x5605('0x11')](_0x5605('0xe'),_0x562e35,_0x401974);_0x4a0f1f(_0x401974);});});}exports[_0x5605('0x16')]=function(_0x179b3d){var _0x5e6e49=this;return new Promise(function(_0x4359be,_0x246c5d){return db[_0x5605('0x17')][_0x5605('0x18')](_0x179b3d[_0x5605('0x19')],{'raw':_0x179b3d['options']?_0x179b3d['options'][_0x5605('0x1a')]===undefined?!![]:![]:!![]})[_0x5605('0x1b')](function(_0x1e6522){logger['info'](_0x5605('0x16'),_0x179b3d);logger['debug'](_0x5605('0x16'),_0x179b3d,JSON[_0x5605('0x10')](_0x1e6522));_0x4359be(_0x1e6522);})['catch'](function(_0x362a20){logger[_0x5605('0x11')](_0x5605('0x16'),_0x362a20['message'],_0x179b3d);_0x246c5d(_0x5e6e49[_0x5605('0x11')](0x1f4,_0x362a20['message']));});});};exports[_0x5605('0x1c')]=function(_0x47c919){var _0x2880a3=this;return new Promise(function(_0x253276,_0x468ec3){return db[_0x5605('0x17')][_0x5605('0x1d')](_0x47c919['body'],{'raw':_0x47c919[_0x5605('0x1e')]?_0x47c919['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47c919[_0x5605('0x1e')]?_0x47c919[_0x5605('0x1e')][_0x5605('0x1f')]||null:null,'attributes':_0x47c919['options']?_0x47c919[_0x5605('0x1e')]['attributes']||null:null,'limit':_0x47c919[_0x5605('0x1e')]?_0x47c919[_0x5605('0x1e')][_0x5605('0x20')]||null:null})[_0x5605('0x1b')](function(_0xa8fb47){logger[_0x5605('0xd')](_0x5605('0x1c'),_0x47c919);logger[_0x5605('0x21')](_0x5605('0x1c'),_0x47c919,JSON[_0x5605('0x10')](_0xa8fb47));_0x253276(_0xa8fb47);})[_0x5605('0x15')](function(_0x3f0fe1){logger[_0x5605('0x11')](_0x5605('0x1c'),_0x3f0fe1[_0x5605('0x13')],_0x47c919);_0x468ec3(_0x2880a3[_0x5605('0x11')](0x1f4,_0x3f0fe1['message']));});});}; \ No newline at end of file +var _0xa8d8=['code','VoiceDialReport,\x20%s,\x20%s','message','info','result','CreateVoiceDialReport','VoiceDialReport','body','options','raw','then','catch','update','where','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa59fa8,_0x3df9a6){var _0x1fe4fe=function(_0x49d312){while(--_0x49d312){_0xa59fa8['push'](_0xa59fa8['shift']());}};_0x1fe4fe(++_0x3df9a6);}(_0xa8d8,0x94));var _0x8a8d=function(_0x3d1c06,_0x30f2e0){_0x3d1c06=_0x3d1c06-0x0;var _0x10c6e6=_0xa8d8[_0x3d1c06];return _0x10c6e6;};'use strict';var _=require(_0x8a8d('0x0'));var util=require(_0x8a8d('0x1'));var moment=require(_0x8a8d('0x2'));var BPromise=require(_0x8a8d('0x3'));var rs=require(_0x8a8d('0x4'));var fs=require('fs');var Redis=require(_0x8a8d('0x5'));var db=require(_0x8a8d('0x6'))['db'];var utils=require(_0x8a8d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a8d('0x8'));var jayson=require(_0x8a8d('0x9'));var client=jayson[_0x8a8d('0xa')][_0x8a8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a0af5,_0x48acb7,_0x23374a){return new BPromise(function(_0x119c6c,_0x2fd474){return client['request'](_0x1a0af5,_0x23374a)['then'](function(_0x48a7ec){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x48acb7,_0x8a8d('0xc'));logger[_0x8a8d('0xd')](_0x8a8d('0xe'),_0x48acb7,_0x8a8d('0xc'),JSON[_0x8a8d('0xf')](_0x48a7ec));if(_0x48a7ec['error']){if(_0x48a7ec[_0x8a8d('0x10')][_0x8a8d('0x11')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x48acb7,_0x48a7ec['error']['message']);return _0x2fd474(_0x48a7ec[_0x8a8d('0x10')]['message']);}logger[_0x8a8d('0x10')](_0x8a8d('0x12'),_0x48acb7,_0x48a7ec['error'][_0x8a8d('0x13')]);return _0x119c6c(_0x48a7ec[_0x8a8d('0x10')]['message']);}else{logger[_0x8a8d('0x14')](_0x8a8d('0x12'),_0x48acb7,_0x8a8d('0xc'));_0x119c6c(_0x48a7ec[_0x8a8d('0x15')][_0x8a8d('0x13')]);}})['catch'](function(_0x1a6ee0){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x48acb7,_0x1a6ee0);_0x2fd474(_0x1a6ee0);});});}exports[_0x8a8d('0x16')]=function(_0xd7cadc){var _0xb26429=this;return new Promise(function(_0x260c5c,_0x13c42e){return db[_0x8a8d('0x17')]['create'](_0xd7cadc[_0x8a8d('0x18')],{'raw':_0xd7cadc['options']?_0xd7cadc[_0x8a8d('0x19')][_0x8a8d('0x1a')]===undefined?!![]:![]:!![]})[_0x8a8d('0x1b')](function(_0x3bf0a2){logger[_0x8a8d('0x14')](_0x8a8d('0x16'),_0xd7cadc);logger[_0x8a8d('0xd')](_0x8a8d('0x16'),_0xd7cadc,JSON[_0x8a8d('0xf')](_0x3bf0a2));_0x260c5c(_0x3bf0a2);})[_0x8a8d('0x1c')](function(_0x377891){logger[_0x8a8d('0x10')]('CreateVoiceDialReport',_0x377891[_0x8a8d('0x13')],_0xd7cadc);_0x13c42e(_0xb26429[_0x8a8d('0x10')](0x1f4,_0x377891[_0x8a8d('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x3b1be2){var _0x426b94=this;return new Promise(function(_0x494faf,_0x12a651){return db[_0x8a8d('0x17')][_0x8a8d('0x1d')](_0x3b1be2[_0x8a8d('0x18')],{'raw':_0x3b1be2[_0x8a8d('0x19')]?_0x3b1be2[_0x8a8d('0x19')][_0x8a8d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b1be2[_0x8a8d('0x19')]?_0x3b1be2[_0x8a8d('0x19')][_0x8a8d('0x1e')]||null:null,'attributes':_0x3b1be2['options']?_0x3b1be2['options']['attributes']||null:null,'limit':_0x3b1be2[_0x8a8d('0x19')]?_0x3b1be2[_0x8a8d('0x19')][_0x8a8d('0x1f')]||null:null})[_0x8a8d('0x1b')](function(_0x595fea){logger[_0x8a8d('0x14')](_0x8a8d('0x20'),_0x3b1be2);logger['debug'](_0x8a8d('0x20'),_0x3b1be2,JSON['stringify'](_0x595fea));_0x494faf(_0x595fea);})[_0x8a8d('0x1c')](function(_0xcdd873){logger[_0x8a8d('0x10')](_0x8a8d('0x20'),_0xcdd873['message'],_0x3b1be2);_0x12a651(_0x426b94[_0x8a8d('0x10')](0x1f4,_0xcdd873['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index cff0129..bc4bcc5 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 _0x6e60=['show','post','create','addApplications','put','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id'];(function(_0x1e7683,_0x461af2){var _0x3927b4=function(_0x26ec89){while(--_0x26ec89){_0x1e7683['push'](_0x1e7683['shift']());}};_0x3927b4(++_0x461af2);}(_0x6e60,0x1a9));var _0x06e6=function(_0x2ecc7d,_0x32c59b){_0x2ecc7d=_0x2ecc7d-0x0;var _0x3c8453=_0x6e60[_0x2ecc7d];return _0x3c8453;};'use strict';var multer=require(_0x06e6('0x0'));var util=require(_0x06e6('0x1'));var path=require(_0x06e6('0x2'));var timeout=require('connect-timeout');var express=require(_0x06e6('0x3'));var router=express['Router']();var fs_extra=require(_0x06e6('0x4'));var auth=require(_0x06e6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x06e6('0x6'));var controller=require(_0x06e6('0x7'));router['get']('/',auth[_0x06e6('0x8')](),controller[_0x06e6('0x9')]);router[_0x06e6('0xa')](_0x06e6('0xb'),auth[_0x06e6('0x8')](),controller[_0x06e6('0xc')]);router[_0x06e6('0xd')]('/',auth[_0x06e6('0x8')](),controller[_0x06e6('0xe')]);router[_0x06e6('0xd')]('/:id/applications',auth['isAuthenticated'](),controller[_0x06e6('0xf')]);router[_0x06e6('0x10')](_0x06e6('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x06e6('0xb'),auth['isAuthenticated'](),controller[_0x06e6('0x11')]);module[_0x06e6('0x12')]=router; \ No newline at end of file +var _0xadbb=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','get','/:id','post','create','addApplications'];(function(_0x4ec69a,_0x2826de){var _0x280921=function(_0x57a021){while(--_0x57a021){_0x4ec69a['push'](_0x4ec69a['shift']());}};_0x280921(++_0x2826de);}(_0xadbb,0xe9));var _0xbadb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xadbb[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xbadb('0x0'));var util=require(_0xbadb('0x1'));var path=require('path');var timeout=require(_0xbadb('0x2'));var express=require(_0xbadb('0x3'));var router=express[_0xbadb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbadb('0x5'));var config=require(_0xbadb('0x6'));var controller=require(_0xbadb('0x7'));router['get']('/',auth[_0xbadb('0x8')](),controller['index']);router[_0xbadb('0x9')](_0xbadb('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xbadb('0xb')]('/',auth[_0xbadb('0x8')](),controller[_0xbadb('0xc')]);router[_0xbadb('0xb')]('/:id/applications',auth[_0xbadb('0x8')](),controller[_0xbadb('0xd')]);router[_0xbadb('0xe')]('/:id',auth[_0xbadb('0x8')](),controller[_0xbadb('0xf')]);router[_0xbadb('0x10')](_0xbadb('0xa'),auth['isAuthenticated'](),controller[_0xbadb('0x11')]);module[_0xbadb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ff5e06c..358a741 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 _0x312d=['VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x312d,0xae));var _0xd312=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x312d[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xd312('0x0'));module[_0xd312('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd312('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'unique':_0xd312('0x2')},'priority':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xd312('0x2')},'tag':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd312('0x4')},'appdata':{'type':Sequelize[_0xd312('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd312('0x5')](_0xd312('0x6'),_0xd312('0x7'),_0xd312('0x8'),_0xd312('0x9'),_0xd312('0xa'),_0xd312('0xb'),_0xd312('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0xd312('0x3')]},'interval':{'type':Sequelize[_0xd312('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xd312('0xd')]},'isApp':{'type':Sequelize[_0xd312('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd312('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd312('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd312('0xd')]},'recordingFormat':{'type':Sequelize[_0xd312('0x3')],'defaultValue':_0xd312('0xf')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xd312('0x10')],'get':function(_0x58567b){return this[_0xd312('0x11')](_0xd312('0x12'));}},'alias':{'type':Sequelize[_0xd312('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xf36e=['outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound'];(function(_0x31784c,_0x24ffd1){var _0x4361c8=function(_0x4f803b){while(--_0x4f803b){_0x31784c['push'](_0x31784c['shift']());}};_0x4361c8(++_0x24ffd1);}(_0xf36e,0x129));var _0xef36=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf36e[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xef36('0x0'));module[_0xef36('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xef36('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xef36('0x3')],'allowNull':![],'unique':_0xef36('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xef36('0x2')},'tag':{'type':Sequelize[_0xef36('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xef36('0x4')},'appdata':{'type':Sequelize[_0xef36('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xef36('0x5')](_0xef36('0x6'),_0xef36('0x7'),'internal',_0xef36('0x8'),_0xef36('0x9'),_0xef36('0xa'),_0xef36('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xef36('0x3')]},'interval':{'type':Sequelize[_0xef36('0x3')],'allowNull':![],'defaultValue':_0xef36('0xc')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xef36('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xef36('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xef36('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xef36('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xef36('0xe')]},'recordingFormat':{'type':Sequelize[_0xef36('0x3')],'defaultValue':_0xef36('0xf')},'answer':{'type':Sequelize[_0xef36('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xef36('0x10')],'get':function(_0x4e86cc){return this[_0xef36('0x11')](_0xef36('0x12'));}},'alias':{'type':Sequelize[_0xef36('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index ff22b99..cca9f7e 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 _0xb8de=['hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','catch','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','mandatoryDisposition','alias','sequelize','Transaction','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','undefined','limit','count','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','fieldName','type','key','model','query','keys','filters','intersection','attributes','length'];(function(_0x54a95e,_0x9397d0){var _0x17722a=function(_0x2dfcf0){while(--_0x2dfcf0){_0x54a95e['push'](_0x54a95e['shift']());}};_0x17722a(++_0x9397d0);}(_0xb8de,0x136));var _0xeb8d=function(_0x4ab506,_0x5ce5d1){_0x4ab506=_0x4ab506-0x0;var _0x3939be=_0xb8de[_0x4ab506];return _0x3939be;};'use strict';var _=require(_0xeb8d('0x0'));var Redis=require(_0xeb8d('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xeb8d('0x2'))(_0xeb8d('0x3'));var config=require(_0xeb8d('0x4'));var db=require(_0xeb8d('0x5'))['db'];config[_0xeb8d('0x6')]=_[_0xeb8d('0x7')](config[_0xeb8d('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb8d('0x8'))(new Redis(config[_0xeb8d('0x6')]));require(_0xeb8d('0x9'))['register'](socket);function respondWithStatusCode(_0x460091,_0x5b05da){_0x5b05da=_0x5b05da||0xcc;return function(_0x57eb18){if(_0x57eb18){return _0x460091[_0xeb8d('0xa')](_0x5b05da);}return _0x460091[_0xeb8d('0xb')](_0x5b05da)[_0xeb8d('0xc')]();};}function respondWithResult(_0x2d8e10,_0x1ac39c){_0x1ac39c=_0x1ac39c||0xc8;return function(_0x683fbe){if(_0x683fbe){return _0x2d8e10[_0xeb8d('0xb')](_0x1ac39c)['json'](_0x683fbe);}};}function respondWithFilteredResult(_0x489f4e,_0x44a7ec){return function(_0x2f579d){if(_0x2f579d){var _0x13f441=typeof _0x44a7ec[_0xeb8d('0xd')]===_0xeb8d('0xe')&&typeof _0x44a7ec[_0xeb8d('0xf')]===_0xeb8d('0xe');var _0x247829=_0x2f579d[_0xeb8d('0x10')];var _0x333953=_0x13f441?0x0:_0x44a7ec[_0xeb8d('0xd')];var _0xb22b49=_0x13f441?_0x2f579d['count']:_0x44a7ec[_0xeb8d('0xd')]+_0x44a7ec[_0xeb8d('0xf')];var _0x13b6dc;if(_0xb22b49>=_0x247829){_0xb22b49=_0x247829;_0x13b6dc=0xc8;}else{_0x13b6dc=0xce;}_0x489f4e[_0xeb8d('0xb')](_0x13b6dc);return _0x489f4e['set']('Content-Range',_0x333953+'-'+_0xb22b49+'/'+_0x247829)[_0xeb8d('0x11')](_0x2f579d);}return null;};}function removeEntity(_0x273f03){return function(_0x1321c4){if(_0x1321c4){return _0x1321c4[_0xeb8d('0x12')]()[_0xeb8d('0x13')](function(){var _0x3387e9=_0x1321c4[_0xeb8d('0x14')]({'plain':!![]});var _0x24a8b2=[{'name':_0xeb8d('0x15'),'value':_0xeb8d('0x16'),'ignore':![]},{'name':_0xeb8d('0x17'),'value':_0xeb8d('0x18'),'ignore':![]},{'name':_0xeb8d('0x19'),'value':_0xeb8d('0x1a'),'ignore':![]}];var _0x331757=_(_0x24a8b2)[_0xeb8d('0x1b')](_0xeb8d('0x1c'))[_0xeb8d('0x1d')](_0xeb8d('0x1e'))[_0xeb8d('0x1e')]();if(_[_0xeb8d('0x1f')](_0x331757,_0x3387e9['type'])){return;}var _0x563213=_[_0xeb8d('0x20')](_0x24a8b2,['value',_0x3387e9['type']])[_0xeb8d('0x21')];return db[_0xeb8d('0x22')][_0xeb8d('0x12')]({'where':{'type':_0x563213,'resourceId':_0x3387e9['id']}})[_0xeb8d('0x13')](function(){return _0x1321c4;});})['then'](function(){_0x273f03[_0xeb8d('0xb')](0xcc)[_0xeb8d('0xc')]();});}};}function handleEntityNotFound(_0x453895){return function(_0x467638){if(!_0x467638){_0x453895[_0xeb8d('0xa')](0x194);}return _0x467638;};}function handleError(_0x49210c,_0x1b3eca){_0x1b3eca=_0x1b3eca||0x1f4;return function(_0x102653){logger[_0xeb8d('0x23')](_0x102653[_0xeb8d('0x24')]);if(_0x102653[_0xeb8d('0x21')]){delete _0x102653[_0xeb8d('0x21')];}_0x49210c[_0xeb8d('0xb')](_0x1b3eca)[_0xeb8d('0x25')](_0x102653);};}exports[_0xeb8d('0x26')]=function(_0x2e3788,_0x98c53a){var _0x4ec8f1={},_0x3b3629={},_0x1aaf25={'count':0x0,'rows':[]};var _0x2d6ff9=_[_0xeb8d('0x1d')](db[_0xeb8d('0x27')]['rawAttributes'],function(_0x40e993){return{'name':_0x40e993[_0xeb8d('0x28')],'type':_0x40e993[_0xeb8d('0x29')][_0xeb8d('0x2a')]};});_0x3b3629[_0xeb8d('0x2b')]=_[_0xeb8d('0x1d')](_0x2d6ff9,_0xeb8d('0x21'));_0x3b3629[_0xeb8d('0x2c')]=_[_0xeb8d('0x2d')](_0x2e3788[_0xeb8d('0x2c')]);_0x3b3629[_0xeb8d('0x2e')]=_[_0xeb8d('0x2f')](_0x3b3629[_0xeb8d('0x2b')],_0x3b3629[_0xeb8d('0x2c')]);_0x4ec8f1[_0xeb8d('0x30')]=_[_0xeb8d('0x2f')](_0x3b3629[_0xeb8d('0x2b')],qs['fields'](_0x2e3788[_0xeb8d('0x2c')]['fields']));_0x4ec8f1['attributes']=_0x4ec8f1[_0xeb8d('0x30')][_0xeb8d('0x31')]?_0x4ec8f1[_0xeb8d('0x30')]:_0x3b3629[_0xeb8d('0x2b')];if(!_0x2e3788[_0xeb8d('0x2c')][_0xeb8d('0x32')]('nolimit')){_0x4ec8f1[_0xeb8d('0xf')]=qs[_0xeb8d('0xf')](_0x2e3788['query'][_0xeb8d('0xf')]);_0x4ec8f1[_0xeb8d('0xd')]=qs['offset'](_0x2e3788[_0xeb8d('0x2c')][_0xeb8d('0xd')]);}_0x4ec8f1[_0xeb8d('0x33')]=qs[_0xeb8d('0x34')](_0x2e3788[_0xeb8d('0x2c')][_0xeb8d('0x34')]);_0x4ec8f1[_0xeb8d('0x35')]=qs[_0xeb8d('0x2e')](_['pick'](_0x2e3788[_0xeb8d('0x2c')],_0x3b3629['filters']),_0x2d6ff9);if(_0x2e3788['query'][_0xeb8d('0x1b')]){_0x4ec8f1[_0xeb8d('0x35')]=_[_0xeb8d('0x36')](_0x4ec8f1['where'],{'$or':_['map'](_0x2d6ff9,function(_0x20bb08){if(_0x20bb08['type']!==_0xeb8d('0x37')){var _0x5e8aa8={};_0x5e8aa8[_0x20bb08[_0xeb8d('0x21')]]={'$like':'%'+_0x2e3788[_0xeb8d('0x2c')][_0xeb8d('0x1b')]+'%'};return _0x5e8aa8;}})});}_0x4ec8f1=_[_0xeb8d('0x36')]({},_0x4ec8f1,_0x2e3788[_0xeb8d('0x38')]);var _0x5cafb8={'where':_0x4ec8f1[_0xeb8d('0x35')]};return db[_0xeb8d('0x27')][_0xeb8d('0x10')](_0x5cafb8)[_0xeb8d('0x13')](function(_0x2f9941){_0x1aaf25[_0xeb8d('0x10')]=_0x2f9941;if(_0x2e3788[_0xeb8d('0x2c')][_0xeb8d('0x39')]){_0x4ec8f1[_0xeb8d('0x3a')]=[{'all':!![]}];}return db[_0xeb8d('0x27')][_0xeb8d('0x3b')](_0x4ec8f1);})['then'](function(_0x5e4dae){_0x1aaf25[_0xeb8d('0x3c')]=_0x5e4dae;return _0x1aaf25;})[_0xeb8d('0x13')](respondWithFilteredResult(_0x98c53a,_0x4ec8f1))['catch'](handleError(_0x98c53a,null));};exports[_0xeb8d('0x3d')]=function(_0x38a3c0,_0x12d2a1){var _0x37efb8={'raw':![],'where':{'id':_0x38a3c0[_0xeb8d('0x3e')]['id']}},_0x51aac3={};_0x51aac3[_0xeb8d('0x2b')]=_[_0xeb8d('0x2d')](db[_0xeb8d('0x27')]['rawAttributes']);_0x51aac3[_0xeb8d('0x2c')]=_[_0xeb8d('0x2d')](_0x38a3c0[_0xeb8d('0x2c')]);_0x51aac3[_0xeb8d('0x2e')]=_[_0xeb8d('0x2f')](_0x51aac3['model'],_0x51aac3[_0xeb8d('0x2c')]);_0x37efb8[_0xeb8d('0x30')]=_[_0xeb8d('0x2f')](_0x51aac3['model'],qs[_0xeb8d('0x3f')](_0x38a3c0[_0xeb8d('0x2c')][_0xeb8d('0x3f')]));_0x37efb8[_0xeb8d('0x30')]=_0x37efb8['attributes'][_0xeb8d('0x31')]?_0x37efb8['attributes']:_0x51aac3[_0xeb8d('0x2b')];if(_0x38a3c0[_0xeb8d('0x2c')]['includeAll']){_0x37efb8[_0xeb8d('0x3a')]=[{'all':!![]}];}_0x37efb8=_[_0xeb8d('0x36')]({},_0x37efb8,_0x38a3c0[_0xeb8d('0x38')]);return db['VoiceExtension']['find'](_0x37efb8)['then'](handleEntityNotFound(_0x12d2a1,null))['then'](respondWithResult(_0x12d2a1,null))[_0xeb8d('0x40')](handleError(_0x12d2a1,null));};exports['destroy']=function(_0x3373f9,_0x394f9f){return db[_0xeb8d('0x27')][_0xeb8d('0x20')]({'where':{'id':_0x3373f9[_0xeb8d('0x3e')]['id']}})[_0xeb8d('0x13')](handleEntityNotFound(_0x394f9f,null))['then'](removeEntity(_0x394f9f,null))['catch'](handleError(_0x394f9f,null));};exports[_0xeb8d('0x41')]=function(_0xef7be5,_0x4f3d4a){if(_0xef7be5[_0xeb8d('0x42')][_0xeb8d('0x29')]==='outbound'&&!_[_0xeb8d('0x43')](_0xef7be5[_0xeb8d('0x42')][_0xeb8d('0x44')],'_')){_0xef7be5[_0xeb8d('0x42')][_0xeb8d('0x44')]='_'['concat'](_0xef7be5[_0xeb8d('0x42')]['exten']);}return db[_0xeb8d('0x27')][_0xeb8d('0x41')](_0xef7be5[_0xeb8d('0x42')],{'raw':![]})[_0xeb8d('0x13')](function(_0x122543){var _0x1979d4=_0xef7be5[_0xeb8d('0x45')]['get']({'plain':!![]});if(!_0x1979d4)throw new Error(_0xeb8d('0x46'));if(_0x1979d4['role']==='user'){var _0x521e61=_0x122543[_0xeb8d('0x14')]({'plain':!![]});var _0x57059a=[{'name':_0xeb8d('0x15'),'value':_0xeb8d('0x16')},{'name':_0xeb8d('0x17'),'value':_0xeb8d('0x18')},{'name':'InternalRoutes','value':_0xeb8d('0x1a')}];var _0x353642=_['find'](_0x57059a,[_0xeb8d('0x1e'),_0x521e61[_0xeb8d('0x29')]])[_0xeb8d('0x21')];return db[_0xeb8d('0x47')][_0xeb8d('0x20')]({'where':{'name':_0x353642,'userProfileId':_0x1979d4[_0xeb8d('0x48')]},'raw':!![]})[_0xeb8d('0x13')](function(_0xe4379f){if(_0xe4379f&&_0xe4379f[_0xeb8d('0x49')]===0x0){return db[_0xeb8d('0x22')][_0xeb8d('0x41')]({'name':_0x521e61[_0xeb8d('0x21')],'resourceId':_0x521e61['id'],'type':_0xe4379f['name'],'sectionId':_0xe4379f['id']},{})['then'](function(){return _0x122543;});}else{return _0x122543;}})[_0xeb8d('0x40')](function(_0x5ed19f){logger[_0xeb8d('0x23')](_0xeb8d('0x4a'),_0x5ed19f);throw _0x5ed19f;});}return _0x122543;})[_0xeb8d('0x13')](respondWithResult(_0x4f3d4a,0xc9))[_0xeb8d('0x40')](handleError(_0x4f3d4a,null));};exports[_0xeb8d('0x4b')]=function(_0x3f0cb7,_0x43e7f8){if(_0x3f0cb7[_0xeb8d('0x42')]['id']){delete _0x3f0cb7[_0xeb8d('0x42')]['id'];}return db[_0xeb8d('0x27')][_0xeb8d('0x20')]({'where':{'id':_0x3f0cb7[_0xeb8d('0x3e')]['id']}})[_0xeb8d('0x13')](handleEntityNotFound(_0x43e7f8,null))[_0xeb8d('0x13')](function(_0x28961a){if(_0x28961a){return db[_0xeb8d('0x27')][_0xeb8d('0x4b')](_['pick'](_0x3f0cb7['body'],['exten',_0xeb8d('0x4c'),_0xeb8d('0x4d'),'recordingFormat',_0xeb8d('0x4e'),_0xeb8d('0x4f'),_0xeb8d('0x50')]),{'where':{'context':_0x28961a[_0xeb8d('0x4c')],'exten':_0x28961a[_0xeb8d('0x44')]},'individualHooks':!![]})[_0xeb8d('0x13')](function(_0x599af1){return _0x599af1;});}return null;})[_0xeb8d('0x13')](respondWithStatusCode(_0x43e7f8,null))['catch'](handleError(_0x43e7f8,null));};exports['addApplications']=function(_0x59cbe7,_0x894b05){var _0x215787=_0x59cbe7[_0xeb8d('0x3e')]['id'];var _0x2b1fcf=_0x59cbe7['body'];var _0x5cb3fd=0xc8;var _0x28b980=null;return db[_0xeb8d('0x51')]['transaction']({'isolationLevel':db[_0xeb8d('0x51')][_0xeb8d('0x52')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4bec61){return db['VoiceExtension'][_0xeb8d('0x53')]({'where':{'id':_0x215787},'transaction':_0x4bec61})[_0xeb8d('0x13')](function(_0x213cb8){if(_0x213cb8){return db[_0xeb8d('0x27')][_0xeb8d('0x12')]({'where':{'VoiceExtensionId':_0x215787},'transaction':_0x4bec61})[_0xeb8d('0x13')](function(){var _0x4cf547=_['map'](_0x2b1fcf,function(_0x4aca8e){_0x4aca8e[_0xeb8d('0x54')]=_0x215787;_0x4aca8e[_0xeb8d('0x55')]=!![];return _0x4aca8e;});return _0x213cb8[_0xeb8d('0x56')](_0x4cf547);})[_0xeb8d('0x13')](function(_0x307278){return db[_0xeb8d('0x27')][_0xeb8d('0x57')](_0x307278,{'transaction':_0x4bec61});});}else{_0x5cb3fd=0x194;_0x28b980=[];}});})[_0xeb8d('0x13')](function(){if(_0x5cb3fd!==0x194){return db['VoiceExtension'][_0xeb8d('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x215787},'order':'cast(priority\x20as\x20unsigned)'})[_0xeb8d('0x13')](function(_0x100106){_0x28b980=_0x100106;});}})[_0xeb8d('0x40')](function(_0x39571c){_0x5cb3fd=0x1f4;logger['error'](_0x39571c[_0xeb8d('0x24')]);if(_0x39571c[_0xeb8d('0x21')]){delete _0x39571c[_0xeb8d('0x21')];}_0x28b980=_0x39571c;})[_0xeb8d('0x59')](function(){if(_0x28b980===null){_0x894b05['sendStatus'](_0x5cb3fd);}else{if(_0x5cb3fd===0x1f4){_0x894b05['status'](_0x5cb3fd)[_0xeb8d('0x25')](_0x28b980);}else{_0x894b05['status'](_0x5cb3fd)['json'](_0x28b980);}}});}; \ No newline at end of file +var _0xeee6=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','outbound','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','internal','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','api','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','filter','ignore','map','value','includes','type','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model'];(function(_0x161beb,_0x146827){var _0x5b0557=function(_0x2dfb50){while(--_0x2dfb50){_0x161beb['push'](_0x161beb['shift']());}};_0x5b0557(++_0x146827);}(_0xeee6,0x1ac));var _0x6eee=function(_0x5774fc,_0x40f70a){_0x5774fc=_0x5774fc-0x0;var _0x1554d0=_0xeee6[_0x5774fc];return _0x1554d0;};'use strict';var _=require(_0x6eee('0x0'));var Redis=require(_0x6eee('0x1'));var qs=require(_0x6eee('0x2'));var logger=require('../../config/logger')(_0x6eee('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x6eee('0x4')]=_[_0x6eee('0x5')](config['redis'],{'host':_0x6eee('0x6'),'port':0x18eb});var socket=require(_0x6eee('0x7'))(new Redis(config[_0x6eee('0x4')]));require(_0x6eee('0x8'))[_0x6eee('0x9')](socket);function respondWithStatusCode(_0x573f65,_0x565515){_0x565515=_0x565515||0xcc;return function(_0x5b2035){if(_0x5b2035){return _0x573f65[_0x6eee('0xa')](_0x565515);}return _0x573f65[_0x6eee('0xb')](_0x565515)[_0x6eee('0xc')]();};}function respondWithResult(_0x3a468b,_0x1bcd60){_0x1bcd60=_0x1bcd60||0xc8;return function(_0x568831){if(_0x568831){return _0x3a468b['status'](_0x1bcd60)[_0x6eee('0xd')](_0x568831);}};}function respondWithFilteredResult(_0x1432b0,_0x3a5253){return function(_0x4cd9aa){if(_0x4cd9aa){var _0x53afcf=typeof _0x3a5253[_0x6eee('0xe')]===_0x6eee('0xf')&&typeof _0x3a5253[_0x6eee('0x10')]===_0x6eee('0xf');var _0x59da2e=_0x4cd9aa[_0x6eee('0x11')];var _0x4eb1f9=_0x53afcf?0x0:_0x3a5253[_0x6eee('0xe')];var _0x3a2e54=_0x53afcf?_0x4cd9aa[_0x6eee('0x11')]:_0x3a5253[_0x6eee('0xe')]+_0x3a5253[_0x6eee('0x10')];var _0x338fbc;if(_0x3a2e54>=_0x59da2e){_0x3a2e54=_0x59da2e;_0x338fbc=0xc8;}else{_0x338fbc=0xce;}_0x1432b0[_0x6eee('0xb')](_0x338fbc);return _0x1432b0[_0x6eee('0x12')]('Content-Range',_0x4eb1f9+'-'+_0x3a2e54+'/'+_0x59da2e)[_0x6eee('0xd')](_0x4cd9aa);}return null;};}function removeEntity(_0x2f54c6){return function(_0xddc2b7){if(_0xddc2b7){return _0xddc2b7[_0x6eee('0x13')]()[_0x6eee('0x14')](function(){var _0x58f5da=_0xddc2b7[_0x6eee('0x15')]({'plain':!![]});var _0x45e0e7=[{'name':_0x6eee('0x16'),'value':_0x6eee('0x17'),'ignore':![]},{'name':_0x6eee('0x18'),'value':'outbound','ignore':![]},{'name':_0x6eee('0x19'),'value':'internal','ignore':![]}];var _0x418940=_(_0x45e0e7)[_0x6eee('0x1a')](_0x6eee('0x1b'))[_0x6eee('0x1c')](_0x6eee('0x1d'))[_0x6eee('0x1d')]();if(_[_0x6eee('0x1e')](_0x418940,_0x58f5da[_0x6eee('0x1f')])){return;}var _0x39af24=_['find'](_0x45e0e7,[_0x6eee('0x1d'),_0x58f5da[_0x6eee('0x1f')]])[_0x6eee('0x20')];return db[_0x6eee('0x21')][_0x6eee('0x13')]({'where':{'type':_0x39af24,'resourceId':_0x58f5da['id']}})[_0x6eee('0x14')](function(){return _0xddc2b7;});})[_0x6eee('0x14')](function(){_0x2f54c6['status'](0xcc)[_0x6eee('0xc')]();});}};}function handleEntityNotFound(_0x11cc01){return function(_0x2a2c1b){if(!_0x2a2c1b){_0x11cc01[_0x6eee('0xa')](0x194);}return _0x2a2c1b;};}function handleError(_0xbaebde,_0x289007){_0x289007=_0x289007||0x1f4;return function(_0x5c6625){logger['error'](_0x5c6625[_0x6eee('0x22')]);if(_0x5c6625[_0x6eee('0x20')]){delete _0x5c6625['name'];}_0xbaebde[_0x6eee('0xb')](_0x289007)[_0x6eee('0x23')](_0x5c6625);};}exports[_0x6eee('0x24')]=function(_0x3848e3,_0x34cdca){var _0x31ecb5={},_0x3d3d76={},_0x38a0d8={'count':0x0,'rows':[]};var _0x3599e3=_[_0x6eee('0x1c')](db[_0x6eee('0x25')][_0x6eee('0x26')],function(_0x2b1994){return{'name':_0x2b1994[_0x6eee('0x27')],'type':_0x2b1994[_0x6eee('0x1f')][_0x6eee('0x28')]};});_0x3d3d76[_0x6eee('0x29')]=_[_0x6eee('0x1c')](_0x3599e3,_0x6eee('0x20'));_0x3d3d76[_0x6eee('0x2a')]=_[_0x6eee('0x2b')](_0x3848e3[_0x6eee('0x2a')]);_0x3d3d76[_0x6eee('0x2c')]=_['intersection'](_0x3d3d76[_0x6eee('0x29')],_0x3d3d76[_0x6eee('0x2a')]);_0x31ecb5[_0x6eee('0x2d')]=_[_0x6eee('0x2e')](_0x3d3d76[_0x6eee('0x29')],qs[_0x6eee('0x2f')](_0x3848e3[_0x6eee('0x2a')][_0x6eee('0x2f')]));_0x31ecb5['attributes']=_0x31ecb5[_0x6eee('0x2d')]['length']?_0x31ecb5[_0x6eee('0x2d')]:_0x3d3d76[_0x6eee('0x29')];if(!_0x3848e3[_0x6eee('0x2a')][_0x6eee('0x30')](_0x6eee('0x31'))){_0x31ecb5['limit']=qs[_0x6eee('0x10')](_0x3848e3['query'][_0x6eee('0x10')]);_0x31ecb5[_0x6eee('0xe')]=qs['offset'](_0x3848e3[_0x6eee('0x2a')]['offset']);}_0x31ecb5[_0x6eee('0x32')]=qs[_0x6eee('0x33')](_0x3848e3[_0x6eee('0x2a')][_0x6eee('0x33')]);_0x31ecb5[_0x6eee('0x34')]=qs[_0x6eee('0x2c')](_['pick'](_0x3848e3[_0x6eee('0x2a')],_0x3d3d76[_0x6eee('0x2c')]),_0x3599e3);if(_0x3848e3['query'][_0x6eee('0x1a')]){_0x31ecb5[_0x6eee('0x34')]=_[_0x6eee('0x35')](_0x31ecb5[_0x6eee('0x34')],{'$or':_[_0x6eee('0x1c')](_0x3599e3,function(_0x506610){if(_0x506610[_0x6eee('0x1f')]!==_0x6eee('0x36')){var _0x238a67={};_0x238a67[_0x506610[_0x6eee('0x20')]]={'$like':'%'+_0x3848e3[_0x6eee('0x2a')][_0x6eee('0x1a')]+'%'};return _0x238a67;}})});}_0x31ecb5=_['merge']({},_0x31ecb5,_0x3848e3[_0x6eee('0x37')]);var _0x1e6c3d={'where':_0x31ecb5['where']};return db[_0x6eee('0x25')]['count'](_0x1e6c3d)[_0x6eee('0x14')](function(_0x575204){_0x38a0d8[_0x6eee('0x11')]=_0x575204;if(_0x3848e3[_0x6eee('0x2a')][_0x6eee('0x38')]){_0x31ecb5['include']=[{'all':!![]}];}return db[_0x6eee('0x25')][_0x6eee('0x39')](_0x31ecb5);})[_0x6eee('0x14')](function(_0x2b796f){_0x38a0d8[_0x6eee('0x3a')]=_0x2b796f;return _0x38a0d8;})[_0x6eee('0x14')](respondWithFilteredResult(_0x34cdca,_0x31ecb5))[_0x6eee('0x3b')](handleError(_0x34cdca,null));};exports['show']=function(_0x288423,_0xb2fdbe){var _0xfb6951={'raw':![],'where':{'id':_0x288423[_0x6eee('0x3c')]['id']}},_0x4b93a5={};_0x4b93a5[_0x6eee('0x29')]=_[_0x6eee('0x2b')](db[_0x6eee('0x25')]['rawAttributes']);_0x4b93a5['query']=_[_0x6eee('0x2b')](_0x288423[_0x6eee('0x2a')]);_0x4b93a5[_0x6eee('0x2c')]=_[_0x6eee('0x2e')](_0x4b93a5[_0x6eee('0x29')],_0x4b93a5[_0x6eee('0x2a')]);_0xfb6951[_0x6eee('0x2d')]=_[_0x6eee('0x2e')](_0x4b93a5[_0x6eee('0x29')],qs[_0x6eee('0x2f')](_0x288423[_0x6eee('0x2a')][_0x6eee('0x2f')]));_0xfb6951['attributes']=_0xfb6951[_0x6eee('0x2d')][_0x6eee('0x3d')]?_0xfb6951[_0x6eee('0x2d')]:_0x4b93a5[_0x6eee('0x29')];if(_0x288423[_0x6eee('0x2a')][_0x6eee('0x38')]){_0xfb6951[_0x6eee('0x3e')]=[{'all':!![]}];}_0xfb6951=_[_0x6eee('0x35')]({},_0xfb6951,_0x288423[_0x6eee('0x37')]);return db[_0x6eee('0x25')][_0x6eee('0x3f')](_0xfb6951)[_0x6eee('0x14')](handleEntityNotFound(_0xb2fdbe,null))['then'](respondWithResult(_0xb2fdbe,null))[_0x6eee('0x3b')](handleError(_0xb2fdbe,null));};exports[_0x6eee('0x13')]=function(_0x31616a,_0x176475){return db[_0x6eee('0x25')][_0x6eee('0x3f')]({'where':{'id':_0x31616a[_0x6eee('0x3c')]['id']}})[_0x6eee('0x14')](handleEntityNotFound(_0x176475,null))[_0x6eee('0x14')](removeEntity(_0x176475,null))[_0x6eee('0x3b')](handleError(_0x176475,null));};exports[_0x6eee('0x40')]=function(_0x313f2b,_0x4147a5){if(_0x313f2b[_0x6eee('0x41')][_0x6eee('0x1f')]===_0x6eee('0x42')&&!_['startsWith'](_0x313f2b[_0x6eee('0x41')]['exten'],'_')){_0x313f2b[_0x6eee('0x41')][_0x6eee('0x43')]='_'[_0x6eee('0x44')](_0x313f2b['body']['exten']);}return db[_0x6eee('0x25')]['create'](_0x313f2b['body'],{'raw':![]})[_0x6eee('0x14')](function(_0x3d93c1){var _0x561dc0=_0x313f2b['user'][_0x6eee('0x15')]({'plain':!![]});if(!_0x561dc0)throw new Error(_0x6eee('0x45'));if(_0x561dc0[_0x6eee('0x46')]===_0x6eee('0x47')){var _0x2eb32d=_0x3d93c1[_0x6eee('0x15')]({'plain':!![]});var _0x3951da=[{'name':_0x6eee('0x16'),'value':_0x6eee('0x17')},{'name':_0x6eee('0x18'),'value':_0x6eee('0x42')},{'name':_0x6eee('0x19'),'value':_0x6eee('0x48')}];var _0x4dd763=_[_0x6eee('0x3f')](_0x3951da,[_0x6eee('0x1d'),_0x2eb32d[_0x6eee('0x1f')]])['name'];return db['UserProfileSection'][_0x6eee('0x3f')]({'where':{'name':_0x4dd763,'userProfileId':_0x561dc0['userProfileId']},'raw':!![]})[_0x6eee('0x14')](function(_0x5722c6){if(_0x5722c6&&_0x5722c6[_0x6eee('0x49')]===0x0){return db[_0x6eee('0x21')][_0x6eee('0x40')]({'name':_0x2eb32d[_0x6eee('0x20')],'resourceId':_0x2eb32d['id'],'type':_0x5722c6[_0x6eee('0x20')],'sectionId':_0x5722c6['id']},{})[_0x6eee('0x14')](function(){return _0x3d93c1;});}else{return _0x3d93c1;}})[_0x6eee('0x3b')](function(_0x16ad56){logger[_0x6eee('0x4a')](_0x6eee('0x4b'),_0x16ad56);throw _0x16ad56;});}return _0x3d93c1;})[_0x6eee('0x14')](respondWithResult(_0x4147a5,0xc9))[_0x6eee('0x3b')](handleError(_0x4147a5,null));};exports['update']=function(_0x274991,_0x146812){if(_0x274991[_0x6eee('0x41')]['id']){delete _0x274991[_0x6eee('0x41')]['id'];}return db[_0x6eee('0x25')][_0x6eee('0x3f')]({'where':{'id':_0x274991[_0x6eee('0x3c')]['id']}})[_0x6eee('0x14')](handleEntityNotFound(_0x146812,null))[_0x6eee('0x14')](function(_0x4fcc7c){if(_0x4fcc7c){return db[_0x6eee('0x25')][_0x6eee('0x4c')](_[_0x6eee('0x4d')](_0x274991[_0x6eee('0x41')],[_0x6eee('0x43'),_0x6eee('0x4e'),'description',_0x6eee('0x4f'),_0x6eee('0x50'),_0x6eee('0x51'),_0x6eee('0x52')]),{'where':{'context':_0x4fcc7c[_0x6eee('0x4e')],'exten':_0x4fcc7c['exten']},'individualHooks':!![]})[_0x6eee('0x14')](function(_0x17ceff){return _0x17ceff;});}return null;})[_0x6eee('0x14')](respondWithStatusCode(_0x146812,null))[_0x6eee('0x3b')](handleError(_0x146812,null));};exports[_0x6eee('0x53')]=function(_0x48c445,_0x27f17e){var _0x1198c7=_0x48c445['params']['id'];var _0x43152a=_0x48c445[_0x6eee('0x41')];var _0x3ec1d8=0xc8;var _0x50e061=null;return db['sequelize'][_0x6eee('0x54')]({'isolationLevel':db[_0x6eee('0x55')]['Transaction'][_0x6eee('0x56')][_0x6eee('0x57')]},function(_0x55c88f){return db['VoiceExtension']['findOne']({'where':{'id':_0x1198c7},'transaction':_0x55c88f})[_0x6eee('0x14')](function(_0x29f1cd){if(_0x29f1cd){return db[_0x6eee('0x25')][_0x6eee('0x13')]({'where':{'VoiceExtensionId':_0x1198c7},'transaction':_0x55c88f})['then'](function(){var _0x682449=_[_0x6eee('0x1c')](_0x43152a,function(_0x1e9f37){_0x1e9f37[_0x6eee('0x58')]=_0x1198c7;_0x1e9f37[_0x6eee('0x59')]=!![];return _0x1e9f37;});return _0x29f1cd['createRouting'](_0x682449);})['then'](function(_0x101761){return db[_0x6eee('0x25')][_0x6eee('0x5a')](_0x101761,{'transaction':_0x55c88f});});}else{_0x3ec1d8=0x194;_0x50e061=[];}});})['then'](function(){if(_0x3ec1d8!==0x194){return db[_0x6eee('0x25')][_0x6eee('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1198c7},'order':_0x6eee('0x5c')})[_0x6eee('0x14')](function(_0xa9faea){_0x50e061=_0xa9faea;});}})[_0x6eee('0x3b')](function(_0x5ba2f0){_0x3ec1d8=0x1f4;logger[_0x6eee('0x4a')](_0x5ba2f0[_0x6eee('0x22')]);if(_0x5ba2f0[_0x6eee('0x20')]){delete _0x5ba2f0[_0x6eee('0x20')];}_0x50e061=_0x5ba2f0;})[_0x6eee('0x5d')](function(){if(_0x50e061===null){_0x27f17e[_0x6eee('0xa')](_0x3ec1d8);}else{if(_0x3ec1d8===0x1f4){_0x27f17e[_0x6eee('0xb')](_0x3ec1d8)['send'](_0x50e061);}else{_0x27f17e[_0x6eee('0xb')](_0x3ec1d8)['json'](_0x50e061);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4e1e3c5..7c8c81b 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 _0x4c66=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x29da83,_0x451dcd){var _0x389536=function(_0x29d0d2){while(--_0x29d0d2){_0x29da83['push'](_0x29da83['shift']());}};_0x389536(++_0x451dcd);}(_0x4c66,0x171));var _0x64c6=function(_0x5bd039,_0x1c460e){_0x5bd039=_0x5bd039-0x0;var _0x20922a=_0x4c66[_0x5bd039];return _0x20922a;};'use strict';var EventEmitter=require(_0x64c6('0x0'));var VoiceExtension=require(_0x64c6('0x1'))['db'][_0x64c6('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x64c6('0x3')](0x0);var events={'afterCreate':_0x64c6('0x4'),'afterUpdate':_0x64c6('0x5'),'afterDestroy':_0x64c6('0x6')};function emitEvent(_0x23a9af){return function(_0x5ddd09,_0x169a48,_0x5c55bb){VoiceExtensionEvents[_0x64c6('0x7')](_0x23a9af+':'+_0x5ddd09['id'],_0x5ddd09);VoiceExtensionEvents[_0x64c6('0x7')](_0x23a9af,_0x5ddd09);_0x5c55bb(null);};}for(var e in events){if(events[_0x64c6('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x64c6('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x69eb=['VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x199172,_0x37d2ee){var _0x53f506=function(_0x2598aa){while(--_0x2598aa){_0x199172['push'](_0x199172['shift']());}};_0x53f506(++_0x37d2ee);}(_0x69eb,0x1b0));var _0xb69e=function(_0x4bc9a1,_0x434436){_0x4bc9a1=_0x4bc9a1-0x0;var _0x2d9dbe=_0x69eb[_0x4bc9a1];return _0x2d9dbe;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xb69e('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb69e('0x1')](0x0);var events={'afterCreate':_0xb69e('0x2'),'afterUpdate':'update','afterDestroy':_0xb69e('0x3')};function emitEvent(_0x827e4e){return function(_0x16a094,_0xc9bb63,_0xdb552d){VoiceExtensionEvents[_0xb69e('0x4')](_0x827e4e+':'+_0x16a094['id'],_0x16a094);VoiceExtensionEvents[_0xb69e('0x4')](_0x827e4e,_0x16a094);_0xdb552d(null);};}for(var e in events){if(events[_0xb69e('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 64bb1b0..58375a4 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 _0xd9c8=['NoOp(No\x20number\x20available)','answer','queue','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','then','Hangup','lodash','./voiceExtension.attributes','models','type','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','param','prefix','phone','SIP','options','U(xcally-mixmonitor-context)','replace','join','isEmpty','findAll','interval','IntervalId','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)='];(function(_0x4967d3,_0xfceab3){var _0x238137=function(_0x1188ff){while(--_0x1188ff){_0x4967d3['push'](_0x4967d3['shift']());}};_0x238137(++_0xfceab3);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xd9c8[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x8d9c('0x0'));var attributes=require(_0x8d9c('0x1'));module['exports']=function(_0xf6e1a){var _0x240e64=_0xf6e1a[_0x8d9c('0x2')];function _0xaecd58(_0x324d36){var _0x376ce5=0x2;var _0xa7b017=[{'type':_0x324d36['type'],'app':'Set','appdata':'CDR(type)='+_0x324d36[_0x8d9c('0x3')],'context':_0x324d36[_0x8d9c('0x4')],'exten':_0x324d36[_0x8d9c('0x5')],'priority':_0x376ce5++,'VoiceExtensionId':_0x324d36['id']},{'type':_0x324d36['type'],'app':_0x324d36[_0x8d9c('0x6')]?_0x8d9c('0x7'):_0x8d9c('0x8'),'appdata':_0x324d36[_0x8d9c('0x6')]?_0x8d9c('0x9')+_0x324d36[_0x8d9c('0x6')]:_0x8d9c('0xa'),'context':_0x324d36[_0x8d9c('0x4')],'exten':_0x324d36['exten'],'priority':_0x376ce5++,'VoiceExtensionId':_0x324d36['id']}];if(_0x324d36[_0x8d9c('0x3')]==='inbound'){_0xa7b017[_0x8d9c('0xb')]({'type':'inbound','app':_0x8d9c('0x7'),'appdata':'CDR(routeid)='+_0x324d36['id'],'context':_0x324d36['context'],'exten':_0x324d36[_0x8d9c('0x5')],'priority':_0x376ce5++,'VoiceExtensionId':_0x324d36['id']});}_0xa7b017['push']({'type':_0x324d36[_0x8d9c('0x3')],'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0xc'),'context':_0x324d36[_0x8d9c('0x4')],'exten':_0x324d36[_0x8d9c('0x5')],'priority':_0x376ce5++,'VoiceExtensionId':_0x324d36['id']},{'type':_0x324d36[_0x8d9c('0x3')],'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0xd'),'context':_0x324d36[_0x8d9c('0x4')],'exten':_0x324d36[_0x8d9c('0x5')],'priority':_0x376ce5++,'VoiceExtensionId':_0x324d36['id']},{'type':_0x324d36['type'],'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0xe'),'context':_0x324d36[_0x8d9c('0x4')],'exten':_0x324d36[_0x8d9c('0x5')],'priority':_0x376ce5++,'VoiceExtensionId':_0x324d36['id']});return _0xa7b017;}function _0x1a071d(_0x11add4){var _0x304de9=0x2;var _0x1c8d6f=[{'type':_0x8d9c('0xf'),'app':_0x8d9c('0x7'),'appdata':'CDR(type)=outbound','context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':'outbound','app':_0x11add4[_0x8d9c('0x6')]?_0x8d9c('0x7'):'NoOp','appdata':_0x11add4[_0x8d9c('0x6')]?_0x8d9c('0x9')+_0x11add4[_0x8d9c('0x6')]:_0x8d9c('0xa'),'context':_0x11add4['context'],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':_0x8d9c('0xf'),'app':'Set','appdata':'CDR(destination)='+(_0x11add4[_0x8d9c('0x10')]?_0x8d9c('0x11')+_0x11add4[_0x8d9c('0x10')]+'}':_0x8d9c('0x12')),'context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':_0x8d9c('0xf'),'app':'Set','appdata':_0x8d9c('0x13')+_0x11add4['id'],'context':_0x11add4['context'],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':_0x8d9c('0xf'),'app':_0x8d9c('0x14'),'appdata':_0x8d9c('0x15')+(_0x304de9+0x2)+_0x8d9c('0x16')+(_0x304de9+0x1)+')','context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':'outbound','app':'Set','appdata':_0x11add4['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x11add4['cutdigits']+'}':_0x8d9c('0x17'),'context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':_0x8d9c('0xf'),'app':'Set','appdata':_0x8d9c('0xc'),'context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4['exten'],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':'outbound','app':_0x8d9c('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':_0x8d9c('0xf'),'app':'Set','appdata':_0x8d9c('0xe'),'context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':_0x8d9c('0xf'),'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0x18')+_0x11add4['id'],'context':_0x11add4['context'],'exten':_0x11add4['exten'],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']}];if(_0x11add4[_0x8d9c('0x19')]('recordingFormat')&&_0x11add4[_0x8d9c('0x1a')]!==_0x8d9c('0x1b')){_0x1c8d6f['push']({'type':_0x8d9c('0xf'),'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0x1c'),'context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']},{'type':_0x8d9c('0xf'),'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0x1d')+_0x11add4[_0x8d9c('0x1a')]||_0x8d9c('0x1e'),'context':_0x11add4[_0x8d9c('0x4')],'exten':_0x11add4[_0x8d9c('0x5')],'priority':_0x304de9++,'VoiceExtensionId':_0x11add4['id']});}return _0x1c8d6f;}function _0x1d230f(_0x54c4e6,_0x5f330e){var _0x23a61c=[{'name':_0x8d9c('0x1f'),'param':0x0},{'name':_0x8d9c('0x20'),'param':0x1},{'name':'options','param':0x2},{'name':_0x8d9c('0x21'),'param':0x3}];var _0x2f7d2e={};var _0x33135a=_0x5f330e[_0x8d9c('0x22')](',');var _0x2f337c=[];for(var _0x26da22=0x0;_0x26da22<_0x23a61c[_0x8d9c('0x23')];_0x26da22++){switch(_0x23a61c[_0x26da22]['name']){case _0x8d9c('0x1f'):_0x2f7d2e['trunk']=_0x33135a[_0x23a61c[_0x26da22][_0x8d9c('0x24')]]['split']('/')[0x1];_0x2f7d2e['phone']=_0x33135a[_0x23a61c[_0x26da22][_0x8d9c('0x24')]][_0x8d9c('0x22')]('/')[0x2];_0x2f7d2e[_0x8d9c('0x25')]=_0x2f7d2e[_0x8d9c('0x26')]?_0x2f7d2e[_0x8d9c('0x26')]['split']('$')[0x0]:undefined;_0x2f7d2e['phone']=_0x54c4e6[_0x8d9c('0x10')]?(_0x2f7d2e[_0x8d9c('0x25')]||'')+_0x8d9c('0x11')+_0x54c4e6[_0x8d9c('0x10')]+'}':(_0x2f7d2e[_0x8d9c('0x25')]||'')+_0x8d9c('0x12');_0x2f337c[_0x23a61c[_0x26da22][_0x8d9c('0x24')]]=[_0x8d9c('0x27'),_0x2f7d2e['trunk'],_0x2f7d2e[_0x8d9c('0x26')]]['join']('/');break;case'options':_0x2f7d2e[_0x8d9c('0x28')]=_0x33135a[_0x23a61c[_0x26da22][_0x8d9c('0x24')]];if(_0x54c4e6[_0x8d9c('0x1a')]!=='none'){if(_0x2f7d2e[_0x8d9c('0x28')]['indexOf'](_0x8d9c('0x29'))<0x0){_0x2f7d2e['options']+='U(xcally-mixmonitor-context)';}}else{_0x2f7d2e[_0x8d9c('0x28')]=_0x2f7d2e[_0x8d9c('0x28')][_0x8d9c('0x2a')]('U(xcally-mixmonitor-context)','');}_0x2f337c[_0x23a61c[_0x26da22][_0x8d9c('0x24')]]=_0x2f7d2e[_0x8d9c('0x28')];break;default:_0x2f337c[_0x23a61c[_0x26da22][_0x8d9c('0x24')]]=_0x33135a[_0x23a61c[_0x26da22][_0x8d9c('0x24')]];}}return _0x2f337c[_0x8d9c('0x2b')](',');}function _0x1e9cb5(_0x2b16df,_0x3794e3,_0x846e22){return new Promise(function(_0xcd7c50,_0x584eca){var _0x41d786=[];if(_[_0x8d9c('0x2c')](_0x3794e3))return _0xcd7c50(_0x41d786);_0x240e64['Interval'][_0x8d9c('0x2d')]({'attributes':['id',_0x8d9c('0x2e'),_0x8d9c('0x2f')],'raw':!![]})['then'](function(_0x21d075){for(var _0x4c2513=0x0,_0x164117=0x0;_0x4c2513<_0x3794e3[_0x8d9c('0x23')];_0x4c2513++,_0x164117=0x0){var _0x156351=_0x3794e3[_0x4c2513];var _0x4a65de=[];var _0x533c7f=[];delete _0x156351['id'];if(_0x156351[_0x8d9c('0x2e')]!=='*,*,*,*'){_0x156351[_0x8d9c('0x30')]=[_0x156351[_0x8d9c('0x2e')]];}else{_0x156351[_0x8d9c('0x30')]=_0x156351[_0x8d9c('0x2f')]?_[_0x8d9c('0x31')](_[_0x8d9c('0x32')](_0x21d075,{'IntervalId':_0x156351[_0x8d9c('0x2f')]}),'interval'):[];}_0x156351[_0x8d9c('0x4')]=_0x2b16df[_0x8d9c('0x4')];_0x156351[_0x8d9c('0x5')]=_0x2b16df[_0x8d9c('0x5')];if(_0x156351[_0x8d9c('0x3')])_0x156351[_0x8d9c('0x3')]=_0x156351[_0x8d9c('0x3')][_0x8d9c('0x33')]();if(_0x2b16df['type']===_0x8d9c('0xf')){if(_0x156351[_0x8d9c('0x19')](_0x8d9c('0x34'))&&_0x156351[_0x8d9c('0x34')]&&_0x156351[_0x8d9c('0x34')]!=='--'){_0x4a65de[_0x8d9c('0xb')]({'type':_0x156351[_0x8d9c('0x3')]['toLowerCase'](),'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0x35')+_0x156351[_0x8d9c('0x34')],'context':_0x2b16df['context'],'exten':_0x2b16df[_0x8d9c('0x5')],'priority':_0x156351[_0x8d9c('0x30')][_0x8d9c('0x23')]+_0x846e22+_0x164117++,'VoiceExtensionId':_0x2b16df['id']});}_0x4a65de[_0x8d9c('0xb')]({'type':_0x156351[_0x8d9c('0x3')][_0x8d9c('0x33')](),'app':_0x8d9c('0x14'),'appdata':_0x8d9c('0x36')+(_0x156351[_0x8d9c('0x37')]?_0x8d9c('0x38')+_0x156351[_0x8d9c('0x37')]+')':_0x8d9c('0x39')),'context':_0x2b16df[_0x8d9c('0x4')],'exten':_0x2b16df[_0x8d9c('0x5')],'priority':_0x156351[_0x8d9c('0x30')][_0x8d9c('0x23')]+_0x846e22+_0x164117++,'VoiceExtensionId':_0x2b16df['id']});}else{if(_0x156351[_0x8d9c('0x19')](_0x8d9c('0x3a'))){if([_0x8d9c('0x3b'),'playback'][_0x8d9c('0x3c')](_0x156351[_0x8d9c('0x3d')]['toLowerCase']())&&_0x156351['appType']!==_0x8d9c('0x3e')){if(_0x156351[_0x8d9c('0x3a')]){_0x4a65de[_0x8d9c('0xb')]({'type':_0x156351[_0x8d9c('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0x8d9c('0x3f'),'context':_0x2b16df['context'],'exten':_0x2b16df['exten'],'priority':_0x156351['intervals']['length']+_0x846e22+_0x164117++,'VoiceExtensionId':_0x2b16df['id']});_0x4a65de[_0x8d9c('0xb')]({'type':_0x156351[_0x8d9c('0x3')][_0x8d9c('0x33')](),'app':_0x8d9c('0x7'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2b16df['context'],'exten':_0x2b16df[_0x8d9c('0x5')],'priority':_0x156351['intervals']['length']+_0x846e22+_0x164117++,'VoiceExtensionId':_0x2b16df['id']});}else{_0x4a65de[_0x8d9c('0xb')]({'type':_0x156351[_0x8d9c('0x3')]['toLowerCase'](),'app':_0x8d9c('0x14'),'appdata':_0x8d9c('0x40'),'context':_0x2b16df['context'],'exten':_0x2b16df[_0x8d9c('0x5')],'priority':_0x156351[_0x8d9c('0x30')]['length']+_0x846e22+_0x164117++,'VoiceExtensionId':_0x2b16df['id']});_0x4a65de[_0x8d9c('0xb')]({'type':_0x156351[_0x8d9c('0x3')][_0x8d9c('0x33')](),'app':_0x8d9c('0x7'),'appdata':_0x8d9c('0x41'),'context':_0x2b16df['context'],'exten':_0x2b16df['exten'],'priority':_0x156351[_0x8d9c('0x30')][_0x8d9c('0x23')]+_0x846e22+_0x164117++,'VoiceExtensionId':_0x2b16df['id']});}}}}for(var _0x1f4238=0x0;_0x1f4238<_0x156351[_0x8d9c('0x30')]['length'];_0x1f4238++){var _0x49cebd=_0x846e22+_0x156351[_0x8d9c('0x30')][_0x8d9c('0x23')];var _0x45c908=_0x1f4238===_0x156351[_0x8d9c('0x30')][_0x8d9c('0x23')]-0x1?_0x846e22+_0x4a65de[_0x8d9c('0x23')]+_0x533c7f[_0x8d9c('0x23')]+0x2:_0x846e22+_0x1f4238+0x1;_0x4a65de[_0x8d9c('0x42')](_0x1f4238,0x0,{'type':_0x2b16df[_0x8d9c('0x3')],'app':_0x8d9c('0x43'),'appdata':_0x156351[_0x8d9c('0x30')][_0x1f4238]+'?'+_0x2b16df[_0x8d9c('0x4')]+',${EXTEN},'+_0x49cebd+':'+_0x2b16df[_0x8d9c('0x4')]+_0x8d9c('0x44')+_0x45c908,'exten':_0x2b16df[_0x8d9c('0x5')],'context':_0x2b16df[_0x8d9c('0x4')],'priority':_0x846e22+_0x1f4238,'VoiceExtensionId':_0x2b16df['id']});}if(_0x156351[_0x8d9c('0x45')]===_0x8d9c('0x46'))_0x156351[_0x8d9c('0x47')]=_0x1d230f(_0x2b16df,_0x156351[_0x8d9c('0x47')]);_0x156351[_0x8d9c('0x48')]=_0x4a65de[_0x8d9c('0x23')]?_[_0x8d9c('0x49')](_0x4a65de)[_0x8d9c('0x48')]+0x1:_0x846e22;_0x41d786=_[_0x8d9c('0x4a')](_0x41d786,_0x4a65de,[_0x156351],_0x533c7f);_0x846e22=_[_0x8d9c('0x49')](_0x41d786)[_0x8d9c('0x48')]+0x1;}return _0xcd7c50(_0x41d786);})[_0x8d9c('0x4b')](function(_0x4146d8){_0x584eca(_0x4146d8);});});}return _0xf6e1a[_0x8d9c('0x4c')](_0x8d9c('0x4d'),attributes,{'tableName':_0x8d9c('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1d8889){var _0x50c494=this['get']({'plain':!![]});var _0x3f6eb2=_0x50c494[_0x8d9c('0x3')]===_0x8d9c('0xf')?_0x1a071d(_0x50c494):_0xaecd58(_0x50c494);return _0x1e9cb5(_0x50c494,_0x1d8889,_[_0x8d9c('0x49')](_0x3f6eb2)[_0x8d9c('0x48')]+0x1)[_0x8d9c('0x4f')](function(_0x6661cb){var _0x1b8fc9=_[_0x8d9c('0x4a')](_0x3f6eb2,_0x6661cb);_0x1b8fc9[_0x8d9c('0xb')]({'type':_0x50c494[_0x8d9c('0x3')],'app':_0x8d9c('0x50'),'exten':_0x50c494[_0x8d9c('0x5')],'context':_0x50c494[_0x8d9c('0x4')],'priority':_[_0x8d9c('0x49')](_0x1b8fc9)[_0x8d9c('0x48')]+0x1,'VoiceExtensionId':_0x50c494['id']});return _0x1b8fc9;});}}});}; \ No newline at end of file +var _0x2c79=['prefix','${EXTEN:','${EXTEN}','SIP','join','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','*,*,*,*','map','filter','toLowerCase','tag','CDR(tag)=','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','catch','define','voice_extensions','Hangup','lodash','exports','models','type','CDR(type)=','context','exten','Set','alias','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(routeAlias)=','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','phone'];(function(_0x216148,_0x443367){var _0x38a922=function(_0x4573de){while(--_0x4573de){_0x216148['push'](_0x216148['shift']());}};_0x38a922(++_0x443367);}(_0x2c79,0x164));var _0x92c7=function(_0x3c8384,_0x31d7d9){_0x3c8384=_0x3c8384-0x0;var _0x35068c=_0x2c79[_0x3c8384];return _0x35068c;};'use strict';var _=require(_0x92c7('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x92c7('0x1')]=function(_0x123643){var _0x5b6e0a=_0x123643[_0x92c7('0x2')];function _0x5e6c38(_0xd3e9cd){var _0x516846=0x2;var _0x10bdc2=[{'type':_0xd3e9cd[_0x92c7('0x3')],'app':'Set','appdata':_0x92c7('0x4')+_0xd3e9cd['type'],'context':_0xd3e9cd[_0x92c7('0x5')],'exten':_0xd3e9cd[_0x92c7('0x6')],'priority':_0x516846++,'VoiceExtensionId':_0xd3e9cd['id']},{'type':_0xd3e9cd['type'],'app':_0xd3e9cd['alias']?_0x92c7('0x7'):'NoOp','appdata':_0xd3e9cd[_0x92c7('0x8')]?'CDR(routeAlias)='+_0xd3e9cd['alias']:_0x92c7('0x9'),'context':_0xd3e9cd[_0x92c7('0x5')],'exten':_0xd3e9cd[_0x92c7('0x6')],'priority':_0x516846++,'VoiceExtensionId':_0xd3e9cd['id']}];if(_0xd3e9cd[_0x92c7('0x3')]==='inbound'){_0x10bdc2[_0x92c7('0xa')]({'type':_0x92c7('0xb'),'app':_0x92c7('0x7'),'appdata':_0x92c7('0xc')+_0xd3e9cd['id'],'context':_0xd3e9cd[_0x92c7('0x5')],'exten':_0xd3e9cd['exten'],'priority':_0x516846++,'VoiceExtensionId':_0xd3e9cd['id']});}_0x10bdc2[_0x92c7('0xa')]({'type':_0xd3e9cd[_0x92c7('0x3')],'app':_0x92c7('0x7'),'appdata':_0x92c7('0xd'),'context':_0xd3e9cd[_0x92c7('0x5')],'exten':_0xd3e9cd['exten'],'priority':_0x516846++,'VoiceExtensionId':_0xd3e9cd['id']},{'type':_0xd3e9cd[_0x92c7('0x3')],'app':_0x92c7('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xd3e9cd[_0x92c7('0x5')],'exten':_0xd3e9cd[_0x92c7('0x6')],'priority':_0x516846++,'VoiceExtensionId':_0xd3e9cd['id']},{'type':_0xd3e9cd['type'],'app':_0x92c7('0x7'),'appdata':_0x92c7('0xe'),'context':_0xd3e9cd[_0x92c7('0x5')],'exten':_0xd3e9cd[_0x92c7('0x6')],'priority':_0x516846++,'VoiceExtensionId':_0xd3e9cd['id']});return _0x10bdc2;}function _0x1048c6(_0x44069c){var _0x57993e=0x2;var _0x92d637=[{'type':_0x92c7('0xf'),'app':_0x92c7('0x7'),'appdata':_0x92c7('0x10'),'context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':'outbound','app':_0x44069c[_0x92c7('0x8')]?'Set':_0x92c7('0x11'),'appdata':_0x44069c['alias']?_0x92c7('0x12')+_0x44069c['alias']:_0x92c7('0x9'),'context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':'outbound','app':_0x92c7('0x7'),'appdata':_0x92c7('0x13')+(_0x44069c[_0x92c7('0x14')]?'${EXTEN:'+_0x44069c[_0x92c7('0x14')]+'}':'${EXTEN}'),'context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':'outbound','app':_0x92c7('0x7'),'appdata':_0x92c7('0xc')+_0x44069c['id'],'context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':_0x92c7('0xf'),'app':_0x92c7('0x15'),'appdata':_0x92c7('0x16')+(_0x57993e+0x2)+_0x92c7('0x17')+(_0x57993e+0x1)+')','context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':_0x92c7('0xf'),'app':_0x92c7('0x7'),'appdata':_0x44069c['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x44069c[_0x92c7('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':'outbound','app':'Set','appdata':_0x92c7('0xd'),'context':_0x44069c['context'],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':'outbound','app':'Set','appdata':_0x92c7('0x18'),'context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':_0x92c7('0xf'),'app':_0x92c7('0x7'),'appdata':_0x92c7('0xe'),'context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c['exten'],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':_0x92c7('0xf'),'app':'Set','appdata':'outboundrouteid='+_0x44069c['id'],'context':_0x44069c['context'],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']}];if(_0x44069c[_0x92c7('0x19')](_0x92c7('0x1a'))&&_0x44069c[_0x92c7('0x1a')]!==_0x92c7('0x1b')){_0x92d637[_0x92c7('0xa')]({'type':_0x92c7('0xf'),'app':_0x92c7('0x7'),'appdata':_0x92c7('0x1c'),'context':_0x44069c['context'],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']},{'type':_0x92c7('0xf'),'app':_0x92c7('0x7'),'appdata':_0x92c7('0x1d')+_0x44069c[_0x92c7('0x1a')]||_0x92c7('0x1e'),'context':_0x44069c[_0x92c7('0x5')],'exten':_0x44069c[_0x92c7('0x6')],'priority':_0x57993e++,'VoiceExtensionId':_0x44069c['id']});}return _0x92d637;}function _0xaa9663(_0x96d616,_0x2320fd){var _0x479a32=[{'name':_0x92c7('0x1f'),'param':0x0},{'name':_0x92c7('0x20'),'param':0x1},{'name':_0x92c7('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x3a95cc={};var _0x446007=_0x2320fd[_0x92c7('0x22')](',');var _0x334805=[];for(var _0x44b50c=0x0;_0x44b50c<_0x479a32[_0x92c7('0x23')];_0x44b50c++){switch(_0x479a32[_0x44b50c][_0x92c7('0x24')]){case _0x92c7('0x1f'):_0x3a95cc['trunk']=_0x446007[_0x479a32[_0x44b50c][_0x92c7('0x25')]][_0x92c7('0x22')]('/')[0x1];_0x3a95cc[_0x92c7('0x26')]=_0x446007[_0x479a32[_0x44b50c][_0x92c7('0x25')]][_0x92c7('0x22')]('/')[0x2];_0x3a95cc[_0x92c7('0x27')]=_0x3a95cc['phone']?_0x3a95cc[_0x92c7('0x26')]['split']('$')[0x0]:undefined;_0x3a95cc['phone']=_0x96d616[_0x92c7('0x14')]?(_0x3a95cc['prefix']||'')+_0x92c7('0x28')+_0x96d616['cutdigits']+'}':(_0x3a95cc[_0x92c7('0x27')]||'')+_0x92c7('0x29');_0x334805[_0x479a32[_0x44b50c]['param']]=[_0x92c7('0x2a'),_0x3a95cc[_0x92c7('0x1f')],_0x3a95cc['phone']][_0x92c7('0x2b')]('/');break;case _0x92c7('0x21'):_0x3a95cc[_0x92c7('0x21')]=_0x446007[_0x479a32[_0x44b50c][_0x92c7('0x25')]];if(_0x96d616[_0x92c7('0x1a')]!==_0x92c7('0x1b')){if(_0x3a95cc['options']['indexOf'](_0x92c7('0x2c'))<0x0){_0x3a95cc['options']+=_0x92c7('0x2c');}}else{_0x3a95cc[_0x92c7('0x21')]=_0x3a95cc[_0x92c7('0x21')][_0x92c7('0x2d')](_0x92c7('0x2c'),'');}_0x334805[_0x479a32[_0x44b50c][_0x92c7('0x25')]]=_0x3a95cc['options'];break;default:_0x334805[_0x479a32[_0x44b50c]['param']]=_0x446007[_0x479a32[_0x44b50c][_0x92c7('0x25')]];}}return _0x334805[_0x92c7('0x2b')](',');}function _0x42e396(_0x5acb8a,_0x506016,_0x11c28f){return new Promise(function(_0x1fb142,_0x250c7e){var _0x3a87c6=[];if(_['isEmpty'](_0x506016))return _0x1fb142(_0x3a87c6);_0x5b6e0a[_0x92c7('0x2e')][_0x92c7('0x2f')]({'attributes':['id',_0x92c7('0x30'),_0x92c7('0x31')],'raw':!![]})['then'](function(_0x1d8f74){for(var _0x11b1d1=0x0,_0x3f9602=0x0;_0x11b1d1<_0x506016['length'];_0x11b1d1++,_0x3f9602=0x0){var _0xd35f2a=_0x506016[_0x11b1d1];var _0x534b06=[];var _0x515844=[];delete _0xd35f2a['id'];if(_0xd35f2a[_0x92c7('0x30')]!==_0x92c7('0x32')){_0xd35f2a['intervals']=[_0xd35f2a['interval']];}else{_0xd35f2a['intervals']=_0xd35f2a[_0x92c7('0x31')]?_[_0x92c7('0x33')](_[_0x92c7('0x34')](_0x1d8f74,{'IntervalId':_0xd35f2a['IntervalId']}),'interval'):[];}_0xd35f2a[_0x92c7('0x5')]=_0x5acb8a['context'];_0xd35f2a[_0x92c7('0x6')]=_0x5acb8a[_0x92c7('0x6')];if(_0xd35f2a[_0x92c7('0x3')])_0xd35f2a['type']=_0xd35f2a[_0x92c7('0x3')][_0x92c7('0x35')]();if(_0x5acb8a[_0x92c7('0x3')]===_0x92c7('0xf')){if(_0xd35f2a[_0x92c7('0x19')](_0x92c7('0x36'))&&_0xd35f2a[_0x92c7('0x36')]&&_0xd35f2a[_0x92c7('0x36')]!=='--'){_0x534b06[_0x92c7('0xa')]({'type':_0xd35f2a['type'][_0x92c7('0x35')](),'app':_0x92c7('0x7'),'appdata':_0x92c7('0x37')+_0xd35f2a[_0x92c7('0x36')],'context':_0x5acb8a['context'],'exten':_0x5acb8a[_0x92c7('0x6')],'priority':_0xd35f2a[_0x92c7('0x38')][_0x92c7('0x23')]+_0x11c28f+_0x3f9602++,'VoiceExtensionId':_0x5acb8a['id']});}_0x534b06[_0x92c7('0xa')]({'type':_0xd35f2a['type'][_0x92c7('0x35')](),'app':_0x92c7('0x15'),'appdata':_0x92c7('0x39')+(_0xd35f2a[_0x92c7('0x3a')]?'Set(CALLERID(all)='+_0xd35f2a['callerID']+')':_0x92c7('0x3b')),'context':_0x5acb8a[_0x92c7('0x5')],'exten':_0x5acb8a[_0x92c7('0x6')],'priority':_0xd35f2a[_0x92c7('0x38')][_0x92c7('0x23')]+_0x11c28f+_0x3f9602++,'VoiceExtensionId':_0x5acb8a['id']});}else{if(_0xd35f2a['hasOwnProperty'](_0x92c7('0x3c'))){if([_0x92c7('0x3d'),'playback'][_0x92c7('0x3e')](_0xd35f2a['app'][_0x92c7('0x35')]())&&_0xd35f2a[_0x92c7('0x3f')]!==_0x92c7('0x40')){if(_0xd35f2a['answer']){_0x534b06['push']({'type':_0xd35f2a[_0x92c7('0x3')]['toLowerCase'](),'app':_0x92c7('0x15'),'appdata':_0x92c7('0x41'),'context':_0x5acb8a[_0x92c7('0x5')],'exten':_0x5acb8a[_0x92c7('0x6')],'priority':_0xd35f2a[_0x92c7('0x38')]['length']+_0x11c28f+_0x3f9602++,'VoiceExtensionId':_0x5acb8a['id']});_0x534b06[_0x92c7('0xa')]({'type':_0xd35f2a[_0x92c7('0x3')]['toLowerCase'](),'app':_0x92c7('0x7'),'appdata':_0x92c7('0x42'),'context':_0x5acb8a[_0x92c7('0x5')],'exten':_0x5acb8a['exten'],'priority':_0xd35f2a[_0x92c7('0x38')][_0x92c7('0x23')]+_0x11c28f+_0x3f9602++,'VoiceExtensionId':_0x5acb8a['id']});}else{_0x534b06['push']({'type':_0xd35f2a[_0x92c7('0x3')][_0x92c7('0x35')](),'app':'ExecIf','appdata':_0x92c7('0x43'),'context':_0x5acb8a[_0x92c7('0x5')],'exten':_0x5acb8a[_0x92c7('0x6')],'priority':_0xd35f2a['intervals'][_0x92c7('0x23')]+_0x11c28f+_0x3f9602++,'VoiceExtensionId':_0x5acb8a['id']});_0x534b06[_0x92c7('0xa')]({'type':_0xd35f2a[_0x92c7('0x3')][_0x92c7('0x35')](),'app':'Set','appdata':_0x92c7('0x44'),'context':_0x5acb8a['context'],'exten':_0x5acb8a[_0x92c7('0x6')],'priority':_0xd35f2a[_0x92c7('0x38')][_0x92c7('0x23')]+_0x11c28f+_0x3f9602++,'VoiceExtensionId':_0x5acb8a['id']});}}}}for(var _0x5650d9=0x0;_0x5650d9<_0xd35f2a[_0x92c7('0x38')][_0x92c7('0x23')];_0x5650d9++){var _0x1e49a7=_0x11c28f+_0xd35f2a[_0x92c7('0x38')]['length'];var _0x213a63=_0x5650d9===_0xd35f2a[_0x92c7('0x38')][_0x92c7('0x23')]-0x1?_0x11c28f+_0x534b06[_0x92c7('0x23')]+_0x515844[_0x92c7('0x23')]+0x2:_0x11c28f+_0x5650d9+0x1;_0x534b06['splice'](_0x5650d9,0x0,{'type':_0x5acb8a['type'],'app':_0x92c7('0x45'),'appdata':_0xd35f2a[_0x92c7('0x38')][_0x5650d9]+'?'+_0x5acb8a[_0x92c7('0x5')]+_0x92c7('0x46')+_0x1e49a7+':'+_0x5acb8a[_0x92c7('0x5')]+_0x92c7('0x46')+_0x213a63,'exten':_0x5acb8a[_0x92c7('0x6')],'context':_0x5acb8a[_0x92c7('0x5')],'priority':_0x11c28f+_0x5650d9,'VoiceExtensionId':_0x5acb8a['id']});}if(_0xd35f2a[_0x92c7('0x3f')]===_0x92c7('0x47'))_0xd35f2a[_0x92c7('0x48')]=_0xaa9663(_0x5acb8a,_0xd35f2a[_0x92c7('0x48')]);_0xd35f2a['priority']=_0x534b06[_0x92c7('0x23')]?_[_0x92c7('0x49')](_0x534b06)[_0x92c7('0x4a')]+0x1:_0x11c28f;_0x3a87c6=_['concat'](_0x3a87c6,_0x534b06,[_0xd35f2a],_0x515844);_0x11c28f=_['last'](_0x3a87c6)[_0x92c7('0x4a')]+0x1;}return _0x1fb142(_0x3a87c6);})[_0x92c7('0x4b')](function(_0x3f385c){_0x250c7e(_0x3f385c);});});}return _0x123643[_0x92c7('0x4c')]('VoiceExtension',attributes,{'tableName':_0x92c7('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3f2fdc){var _0x12b1fc=this['get']({'plain':!![]});var _0x2bb9a7=_0x12b1fc[_0x92c7('0x3')]==='outbound'?_0x1048c6(_0x12b1fc):_0x5e6c38(_0x12b1fc);return _0x42e396(_0x12b1fc,_0x3f2fdc,_[_0x92c7('0x49')](_0x2bb9a7)[_0x92c7('0x4a')]+0x1)['then'](function(_0x248aa8){var _0x221be5=_['concat'](_0x2bb9a7,_0x248aa8);_0x221be5[_0x92c7('0xa')]({'type':_0x12b1fc[_0x92c7('0x3')],'app':_0x92c7('0x4e'),'exten':_0x12b1fc[_0x92c7('0x6')],'context':_0x12b1fc[_0x92c7('0x5')],'priority':_[_0x92c7('0x49')](_0x221be5)[_0x92c7('0x4a')]+0x1,'VoiceExtensionId':_0x12b1fc['id']});return _0x221be5;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 77bdc31..d5088f9 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 _0x31c2=['message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','map','include','model','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s'];(function(_0x11bd6e,_0x2be638){var _0x3d80b4=function(_0x1b8758){while(--_0x1b8758){_0x11bd6e['push'](_0x11bd6e['shift']());}};_0x3d80b4(++_0x2be638);}(_0x31c2,0x1e1));var _0x231c=function(_0x72bb3c,_0x201416){_0x72bb3c=_0x72bb3c-0x0;var _0x83a535=_0x31c2[_0x72bb3c];return _0x83a535;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var moment=require(_0x231c('0x2'));var BPromise=require(_0x231c('0x3'));var rs=require(_0x231c('0x4'));var fs=require('fs');var Redis=require(_0x231c('0x5'));var db=require(_0x231c('0x6'))['db'];var utils=require(_0x231c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x231c('0x8'));var jayson=require(_0x231c('0x9'));var client=jayson[_0x231c('0xa')][_0x231c('0xb')]({'port':0x232a});config['redis']=_[_0x231c('0xc')](config['redis'],{'host':_0x231c('0xd'),'port':0x18eb});var socket=require(_0x231c('0xe'))(new Redis(config[_0x231c('0xf')]));require('./voiceExtension.socket')[_0x231c('0x10')](socket);function respondWithRpcPromise(_0x3cffb0,_0x1e390f,_0x23841c){return new BPromise(function(_0x6a5f85,_0x46c0a6){return client[_0x231c('0x11')](_0x3cffb0,_0x23841c)['then'](function(_0x2e3796){logger[_0x231c('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x1e390f,_0x231c('0x13'));logger[_0x231c('0x14')](_0x231c('0x15'),_0x1e390f,_0x231c('0x13'),JSON[_0x231c('0x16')](_0x2e3796));if(_0x2e3796[_0x231c('0x17')]){if(_0x2e3796[_0x231c('0x17')][_0x231c('0x18')]===0x1f4){logger[_0x231c('0x17')](_0x231c('0x19'),_0x1e390f,_0x2e3796[_0x231c('0x17')][_0x231c('0x1a')]);return _0x46c0a6(_0x2e3796[_0x231c('0x17')][_0x231c('0x1a')]);}logger[_0x231c('0x17')](_0x231c('0x19'),_0x1e390f,_0x2e3796[_0x231c('0x17')][_0x231c('0x1a')]);return _0x6a5f85(_0x2e3796[_0x231c('0x17')][_0x231c('0x1a')]);}else{logger['info'](_0x231c('0x19'),_0x1e390f,_0x231c('0x13'));_0x6a5f85(_0x2e3796[_0x231c('0x1b')][_0x231c('0x1a')]);}})[_0x231c('0x1c')](function(_0x2bca68){logger[_0x231c('0x17')](_0x231c('0x19'),_0x1e390f,_0x2bca68);_0x46c0a6(_0x2bca68);});});}exports[_0x231c('0x1d')]=function(_0x1c9c85){var _0x5f045f=this;return new Promise(function(_0x4a0c45,_0x5e8a53){return db[_0x231c('0x1e')]['findAll']({'raw':_0x1c9c85[_0x231c('0x1f')]?_0x1c9c85[_0x231c('0x1f')][_0x231c('0x20')]===undefined?!![]:![]:!![],'where':_0x1c9c85[_0x231c('0x1f')]?_0x1c9c85[_0x231c('0x1f')][_0x231c('0x21')]||null:null,'attributes':_0x1c9c85[_0x231c('0x1f')]?_0x1c9c85[_0x231c('0x1f')]['attributes']||null:null,'limit':_0x1c9c85[_0x231c('0x1f')]?_0x1c9c85[_0x231c('0x1f')]['limit']||null:null,'include':_0x1c9c85[_0x231c('0x1f')]?_0x1c9c85[_0x231c('0x1f')]['include']?_[_0x231c('0x22')](_0x1c9c85['options'][_0x231c('0x23')],function(_0x454f70){return{'model':db[_0x454f70[_0x231c('0x24')]],'as':_0x454f70['as'],'attributes':_0x454f70[_0x231c('0x25')],'include':_0x454f70[_0x231c('0x23')]?_[_0x231c('0x22')](_0x454f70[_0x231c('0x23')],function(_0x4caf68){return{'model':db[_0x4caf68[_0x231c('0x24')]],'as':_0x4caf68['as'],'attributes':_0x4caf68[_0x231c('0x25')],'include':_0x4caf68['include']?_[_0x231c('0x22')](_0x4caf68[_0x231c('0x23')],function(_0x45ced8){return{'model':db[_0x45ced8[_0x231c('0x24')]],'as':_0x45ced8['as'],'attributes':_0x45ced8[_0x231c('0x25')]};}):[]};}):[]};}):[]:[]})[_0x231c('0x26')](function(_0x40f76e){logger['info'](_0x231c('0x1d'),_0x1c9c85);logger[_0x231c('0x14')]('GetVoiceExtension',_0x1c9c85,JSON['stringify'](_0x40f76e));_0x4a0c45(_0x40f76e);})['catch'](function(_0x9f459){logger['error'](_0x231c('0x1d'),_0x9f459['message'],_0x1c9c85);_0x5e8a53(_0x5f045f[_0x231c('0x17')](0x1f4,_0x9f459[_0x231c('0x1a')]));});});}; \ No newline at end of file +var _0x1134=['include','map','model','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetVoiceExtension','findAll','options','where','limit'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0x1134,0x19c));var _0x4113=function(_0x46f05a,_0x58e294){_0x46f05a=_0x46f05a-0x0;var _0x8c5bd9=_0x1134[_0x46f05a];return _0x8c5bd9;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var moment=require('moment');var BPromise=require(_0x4113('0x2'));var rs=require(_0x4113('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4113('0x4'))['db'];var utils=require(_0x4113('0x5'));var logger=require('../../config/logger')(_0x4113('0x6'));var config=require('../../config/environment');var jayson=require(_0x4113('0x7'));var client=jayson['client'][_0x4113('0x8')]({'port':0x232a});config['redis']=_[_0x4113('0x9')](config[_0x4113('0xa')],{'host':_0x4113('0xb'),'port':0x18eb});var socket=require(_0x4113('0xc'))(new Redis(config[_0x4113('0xa')]));require(_0x4113('0xd'))[_0x4113('0xe')](socket);function respondWithRpcPromise(_0x19b6f2,_0x5e635c,_0x85a9dd){return new BPromise(function(_0x207442,_0x29c7f9){return client[_0x4113('0xf')](_0x19b6f2,_0x85a9dd)[_0x4113('0x10')](function(_0x30f02a){logger[_0x4113('0x11')](_0x4113('0x12'),_0x5e635c,_0x4113('0x13'));logger[_0x4113('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x5e635c,'request\x20sent',JSON['stringify'](_0x30f02a));if(_0x30f02a[_0x4113('0x15')]){if(_0x30f02a[_0x4113('0x15')]['code']===0x1f4){logger['error'](_0x4113('0x12'),_0x5e635c,_0x30f02a['error'][_0x4113('0x16')]);return _0x29c7f9(_0x30f02a['error']['message']);}logger[_0x4113('0x15')](_0x4113('0x12'),_0x5e635c,_0x30f02a[_0x4113('0x15')][_0x4113('0x16')]);return _0x207442(_0x30f02a[_0x4113('0x15')][_0x4113('0x16')]);}else{logger[_0x4113('0x11')](_0x4113('0x12'),_0x5e635c,_0x4113('0x13'));_0x207442(_0x30f02a[_0x4113('0x17')]['message']);}})[_0x4113('0x18')](function(_0x287efd){logger[_0x4113('0x15')](_0x4113('0x12'),_0x5e635c,_0x287efd);_0x29c7f9(_0x287efd);});});}exports[_0x4113('0x19')]=function(_0x9608c3){var _0x18c627=this;return new Promise(function(_0x4cdffc,_0x37bf1e){return db['VoiceExtension'][_0x4113('0x1a')]({'raw':_0x9608c3[_0x4113('0x1b')]?_0x9608c3['options']['raw']===undefined?!![]:![]:!![],'where':_0x9608c3[_0x4113('0x1b')]?_0x9608c3['options'][_0x4113('0x1c')]||null:null,'attributes':_0x9608c3[_0x4113('0x1b')]?_0x9608c3[_0x4113('0x1b')]['attributes']||null:null,'limit':_0x9608c3[_0x4113('0x1b')]?_0x9608c3[_0x4113('0x1b')][_0x4113('0x1d')]||null:null,'include':_0x9608c3[_0x4113('0x1b')]?_0x9608c3[_0x4113('0x1b')][_0x4113('0x1e')]?_[_0x4113('0x1f')](_0x9608c3[_0x4113('0x1b')][_0x4113('0x1e')],function(_0xc73743){return{'model':db[_0xc73743[_0x4113('0x20')]],'as':_0xc73743['as'],'attributes':_0xc73743[_0x4113('0x21')],'include':_0xc73743['include']?_[_0x4113('0x1f')](_0xc73743[_0x4113('0x1e')],function(_0x54cf93){return{'model':db[_0x54cf93[_0x4113('0x20')]],'as':_0x54cf93['as'],'attributes':_0x54cf93[_0x4113('0x21')],'include':_0x54cf93[_0x4113('0x1e')]?_[_0x4113('0x1f')](_0x54cf93[_0x4113('0x1e')],function(_0x180fed){return{'model':db[_0x180fed[_0x4113('0x20')]],'as':_0x180fed['as'],'attributes':_0x180fed[_0x4113('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4113('0x10')](function(_0x2e91bf){logger[_0x4113('0x11')](_0x4113('0x19'),_0x9608c3);logger[_0x4113('0x14')](_0x4113('0x19'),_0x9608c3,JSON['stringify'](_0x2e91bf));_0x4cdffc(_0x2e91bf);})[_0x4113('0x18')](function(_0xfeabfd){logger['error'](_0x4113('0x19'),_0xfeabfd[_0x4113('0x16')],_0x9608c3);_0x37bf1e(_0x18c627[_0x4113('0x15')](0x1f4,_0xfeabfd[_0x4113('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index f5e0daf..948f953 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 _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x4b6315,_0xad55d){var _0x421452=function(_0x3ee975){while(--_0x3ee975){_0x4b6315['push'](_0x4b6315['shift']());}};_0x421452(++_0xad55d);}(_0x5fab,0x177));var _0xb5fa=function(_0x407d0f,_0x5cafa2){_0x407d0f=_0x407d0f-0x0;var _0xdeeb73=_0x5fab[_0x407d0f];return _0xdeeb73;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x4807f6,_0x41551d){var _0x49f88b=function(_0x284c2e){while(--_0x284c2e){_0x4807f6['push'](_0x4807f6['shift']());}};_0x49f88b(++_0x41551d);}(_0xf494,0x1c6));var _0x4f49=function(_0x349239,_0x1b7637){_0x349239=_0x349239-0x0;var _0x5313b6=_0xf494[_0x349239];return _0x5313b6;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index a8e4646..2df029e 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 _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x3bb6d7,_0x308535){var _0x6f29c0=function(_0x35e9a5){while(--_0x35e9a5){_0x3bb6d7['push'](_0x3bb6d7['shift']());}};_0x6f29c0(++_0x308535);}(_0x4bd3,0x174));var _0x34bd=function(_0x328b67,_0x579ccc){_0x328b67=_0x328b67-0x0;var _0x2fd9b8=_0x4bd3[_0x328b67];return _0x2fd9b8;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file +var _0x6d11=['put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x6d11,0xbf));var _0x16d1=function(_0x348f78,_0x1340f7){_0x348f78=_0x348f78-0x0;var _0x44581f=_0x6d11[_0x348f78];return _0x44581f;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['get']('/:id/messages',auth[_0x16d1('0x8')](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')]('/',auth[_0x16d1('0x8')](),controller['create']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);router[_0x16d1('0xf')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index ee862f3..6e3c967 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 _0xff52=['exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox'];(function(_0x1a0d0e,_0x46c13d){var _0x33139e=function(_0x44f89d){while(--_0x44f89d){_0x1a0d0e['push'](_0x1a0d0e['shift']());}};_0x33139e(++_0x46c13d);}(_0xff52,0x150));var _0x2ff5=function(_0x2860ab,_0x27440f){_0x2860ab=_0x2860ab-0x0;var _0x3037c4=_0xff52[_0x2860ab];return _0x3037c4;};'use strict';var Sequelize=require('sequelize');module[_0x2ff5('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2ff5('0x1')],'defaultValue':_0x2ff5('0x2'),'unique':_0x2ff5('0x3')},'mailbox':{'type':Sequelize[_0x2ff5('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x2ff5('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2ff5('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3dbd6f){this['setDataValue'](_0x2ff5('0x4'),typeof _0x3dbd6f===_0x2ff5('0x5')&&_0x3dbd6f[_0x2ff5('0x6')]()?_0x3dbd6f[_0x2ff5('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x2ff5('0x7')},'attach':{'type':Sequelize[_0x2ff5('0x8')](_0x2ff5('0x9'),'no'),'defaultValue':_0x2ff5('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x2ff5('0x8')](_0x2ff5('0x9'),'no'),'defaultValue':_0x2ff5('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x2ff5('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x2ff5('0x8')](_0x2ff5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2ff5('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x2ff5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x2ff5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2ff5('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2ff5('0x8')](_0x2ff5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2ff5('0x8')](_0x2ff5('0x9'),'no'),'defaultValue':_0x2ff5('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2ff5('0x8')](_0x2ff5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x2ff5('0x8')](_0x2ff5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x2ff5('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x2ff5('0x1')]},'emailbody':{'type':Sequelize[_0x2ff5('0x1')]},'maxsecs':{'type':Sequelize[_0x2ff5('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2ff5('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2ff5('0xb')],'get':function(){return this['getDataValue'](_0x2ff5('0xc'))+_0x2ff5('0xd')+this[_0x2ff5('0xe')](_0x2ff5('0xf'));}}}; \ No newline at end of file +var _0x35f5=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string'];(function(_0x13a7d2,_0x2aa488){var _0x2658da=function(_0x4a1fb5){while(--_0x4a1fb5){_0x13a7d2['push'](_0x13a7d2['shift']());}};_0x2658da(++_0x2aa488);}(_0x35f5,0xf9));var _0x535f=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x35f5[_0x547e20];return _0x359171;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x535f('0x0')]},'context':{'type':Sequelize[_0x535f('0x0')],'defaultValue':_0x535f('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x535f('0x0')],'defaultValue':'','allowNull':![],'unique':_0x535f('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x535f('0x0')],'validate':{'isEmail':!![]},'set':function(_0x38c8c8){this[_0x535f('0x3')](_0x535f('0x4'),typeof _0x38c8c8===_0x535f('0x5')&&_0x38c8c8[_0x535f('0x6')]()?_0x38c8c8[_0x535f('0x6')]():null);}},'pager':{'type':Sequelize[_0x535f('0x0')]},'tz':{'type':Sequelize[_0x535f('0x0')],'defaultValue':_0x535f('0x7')},'attach':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x535f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x535f('0x0')]},'callback':{'type':Sequelize[_0x535f('0x0')]},'review':{'type':Sequelize['ENUM'](_0x535f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x535f('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x535f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x535f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x535f('0x8')](_0x535f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x535f('0xb')},'emailsubject':{'type':Sequelize[_0x535f('0x0')]},'emailbody':{'type':Sequelize[_0x535f('0x0')]},'maxsecs':{'type':Sequelize[_0x535f('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x535f('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x535f('0xd')],'get':function(){return this['getDataValue']('fullname')+_0x535f('0xe')+this[_0x535f('0xf')](_0x535f('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index fa18887..16577dc 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 _0xd914=['limit','order','sort','where','filters','pick','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','show','params','merge','find','create','body','get','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','filter','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','Voicemails','UserProfileResource','name','send','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3aa66e,_0x2ca45a){var _0x1f5115=function(_0x59f7ce){while(--_0x59f7ce){_0x3aa66e['push'](_0x3aa66e['shift']());}};_0x1f5115(++_0x2ca45a);}(_0xd914,0x17f));var _0x4d91=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xd914[_0x1cbcf1];return _0x3a06f0;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){var _0x55356b=_0x12b722['get']({'plain':!![]});var _0x1ee6b3=_0x4d91('0x28');return db[_0x4d91('0x29')][_0x4d91('0x27')]({'where':{'type':_0x1ee6b3,'resourceId':_0x55356b['id']}})[_0x4d91('0x26')](function(){return _0x12b722;});})[_0x4d91('0x26')](function(){_0x9cb864[_0x4d91('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc353,_0xda9802){return function(_0x12ac74){if(!_0x12ac74){_0x3dc353['sendStatus'](0x194);}return _0x12ac74;};}function handleError(_0x480a56,_0x299f27){_0x299f27=_0x299f27||0x1f4;return function(_0x470079){logger['error'](_0x470079['stack']);if(_0x470079[_0x4d91('0x2a')]){delete _0x470079[_0x4d91('0x2a')];}_0x480a56[_0x4d91('0x1b')](_0x299f27)[_0x4d91('0x2b')](_0x470079);};}exports['index']=function(_0x2587a1,_0x31bbf8){var _0x468e95={},_0xee7535={},_0xa63422={'count':0x0,'rows':[]};var _0x3466f3=_[_0x4d91('0x2c')](db['VoiceMail'][_0x4d91('0x2d')],function(_0x4f44ff){return{'name':_0x4f44ff['fieldName'],'type':_0x4f44ff[_0x4d91('0x2e')][_0x4d91('0x2f')]};});_0xee7535['model']=_[_0x4d91('0x2c')](_0x3466f3,_0x4d91('0x2a'));_0xee7535[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x2587a1[_0x4d91('0x30')]);_0xee7535['filters']=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],_0xee7535[_0x4d91('0x30')]);_0x468e95[_0x4d91('0x34')]=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],qs['fields'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x35')]));_0x468e95['attributes']=_0x468e95[_0x4d91('0x34')][_0x4d91('0x36')]?_0x468e95[_0x4d91('0x34')]:_0xee7535['model'];if(!_0x2587a1[_0x4d91('0x30')][_0x4d91('0x37')](_0x4d91('0x38'))){_0x468e95[_0x4d91('0x39')]=qs['limit'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x39')]);_0x468e95[_0x4d91('0x1e')]=qs[_0x4d91('0x1e')](_0x2587a1['query']['offset']);}_0x468e95[_0x4d91('0x3a')]=qs[_0x4d91('0x3b')](_0x2587a1['query'][_0x4d91('0x3b')]);_0x468e95[_0x4d91('0x3c')]=qs[_0x4d91('0x3d')](_[_0x4d91('0x3e')](_0x2587a1['query'],_0xee7535[_0x4d91('0x3d')]),_0x3466f3);if(_0x2587a1[_0x4d91('0x30')]['filter']){_0x468e95[_0x4d91('0x3c')]=_['merge'](_0x468e95[_0x4d91('0x3c')],{'$or':_['map'](_0x3466f3,function(_0x2dc892){if(_0x2dc892['type']!==_0x4d91('0x3f')){var _0x2782d2={};_0x2782d2[_0x2dc892[_0x4d91('0x2a')]]={'$like':'%'+_0x2587a1[_0x4d91('0x30')]['filter']+'%'};return _0x2782d2;}})});}_0x468e95=_['merge']({},_0x468e95,_0x2587a1[_0x4d91('0x40')]);var _0x55c8d0={'where':_0x468e95[_0x4d91('0x3c')]};return db[_0x4d91('0x41')]['count'](_0x55c8d0)[_0x4d91('0x26')](function(_0x2ae356){_0xa63422[_0x4d91('0x20')]=_0x2ae356;if(_0x2587a1[_0x4d91('0x30')][_0x4d91('0x42')]){_0x468e95[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x41')]['findAll'](_0x468e95);})[_0x4d91('0x26')](function(_0x4c70af){_0xa63422[_0x4d91('0x44')]=_0x4c70af;return _0xa63422;})[_0x4d91('0x26')](respondWithFilteredResult(_0x31bbf8,_0x468e95))[_0x4d91('0x45')](handleError(_0x31bbf8,null));};exports[_0x4d91('0x46')]=function(_0x20ec78,_0x1fc884){var _0x4b8e12={'raw':!![],'where':{'id':_0x20ec78[_0x4d91('0x47')]['id']}},_0x4ffc08={};_0x4ffc08[_0x4d91('0x33')]=_['keys'](db[_0x4d91('0x41')][_0x4d91('0x2d')]);_0x4ffc08[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x20ec78[_0x4d91('0x30')]);_0x4ffc08[_0x4d91('0x3d')]=_[_0x4d91('0x32')](_0x4ffc08[_0x4d91('0x33')],_0x4ffc08[_0x4d91('0x30')]);_0x4b8e12['attributes']=_['intersection'](_0x4ffc08[_0x4d91('0x33')],qs['fields'](_0x20ec78[_0x4d91('0x30')][_0x4d91('0x35')]));_0x4b8e12[_0x4d91('0x34')]=_0x4b8e12[_0x4d91('0x34')]['length']?_0x4b8e12[_0x4d91('0x34')]:_0x4ffc08['model'];if(_0x20ec78['query'][_0x4d91('0x42')]){_0x4b8e12[_0x4d91('0x43')]=[{'all':!![]}];}_0x4b8e12=_[_0x4d91('0x48')]({},_0x4b8e12,_0x20ec78[_0x4d91('0x40')]);return db[_0x4d91('0x41')][_0x4d91('0x49')](_0x4b8e12)['then'](handleEntityNotFound(_0x1fc884,null))[_0x4d91('0x26')](respondWithResult(_0x1fc884,null))[_0x4d91('0x45')](handleError(_0x1fc884,null));};exports[_0x4d91('0x4a')]=function(_0x449dd8,_0x106e5b){return db[_0x4d91('0x41')][_0x4d91('0x4a')](_0x449dd8[_0x4d91('0x4b')],{})[_0x4d91('0x26')](function(_0x145dfd){var _0x16f776=_0x449dd8['user'][_0x4d91('0x4c')]({'plain':!![]});if(!_0x16f776)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16f776[_0x4d91('0x4d')]===_0x4d91('0x4e')){var _0x195e65=_0x145dfd[_0x4d91('0x4c')]({'plain':!![]});var _0x436a3d=_0x4d91('0x28');return db[_0x4d91('0x4f')][_0x4d91('0x49')]({'where':{'name':_0x436a3d,'userProfileId':_0x16f776['userProfileId']},'raw':!![]})[_0x4d91('0x26')](function(_0x43e72c){if(_0x43e72c&&_0x43e72c[_0x4d91('0x50')]===0x0){return db[_0x4d91('0x29')][_0x4d91('0x4a')]({'name':_0x195e65[_0x4d91('0x2a')],'resourceId':_0x195e65['id'],'type':_0x43e72c[_0x4d91('0x2a')],'sectionId':_0x43e72c['id']},{})['then'](function(){return _0x145dfd;});}else{return _0x145dfd;}})[_0x4d91('0x45')](function(_0x2159e4){logger[_0x4d91('0x51')](_0x4d91('0x52'),_0x2159e4);throw _0x2159e4;});}return _0x145dfd;})[_0x4d91('0x26')](respondWithResult(_0x106e5b,0xc9))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x25')]=function(_0x4138c5,_0x645923){if(_0x4138c5[_0x4d91('0x4b')]['id']){delete _0x4138c5[_0x4d91('0x4b')]['id'];}return db[_0x4d91('0x41')][_0x4d91('0x49')]({'where':{'id':_0x4138c5[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x645923,null))[_0x4d91('0x26')](saveUpdates(_0x4138c5[_0x4d91('0x4b')],null))['then'](respondWithResult(_0x645923,null))['catch'](handleError(_0x645923,null));};exports['destroy']=function(_0x45cf4e,_0x10c1dd){return db[_0x4d91('0x41')]['find']({'where':{'id':_0x45cf4e[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x10c1dd,null))[_0x4d91('0x26')](removeEntity(_0x10c1dd,null))['catch'](handleError(_0x10c1dd,null));};exports['getMessages']=function(_0x5bc877,_0x75aa6d,_0x26bfde){return db[_0x4d91('0x41')][_0x4d91('0x53')]({'where':{'id':_0x5bc877[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x75aa6d,null))[_0x4d91('0x26')](function(_0x20c0f2){var _0x4d9b87;var _0x563558={},_0x3f4f24={};_0x3f4f24['model']=_[_0x4d91('0x31')](db[_0x4d91('0x54')][_0x4d91('0x2d')]);_0x3f4f24['query']=_[_0x4d91('0x31')](_0x5bc877[_0x4d91('0x30')]);_0x3f4f24[_0x4d91('0x3d')]=_[_0x4d91('0x32')](_0x3f4f24[_0x4d91('0x33')],_0x3f4f24[_0x4d91('0x30')]);_0x563558[_0x4d91('0x34')]=_['intersection'](_0x3f4f24['model'],qs['fields'](_0x5bc877['query'][_0x4d91('0x35')]));_0x563558[_0x4d91('0x34')]=_0x563558[_0x4d91('0x34')]['length']?_0x563558[_0x4d91('0x34')]:_0x3f4f24['model'];if(!_0x5bc877[_0x4d91('0x30')][_0x4d91('0x37')]('nolimit')){_0x563558['limit']=qs[_0x4d91('0x39')](_0x5bc877[_0x4d91('0x30')][_0x4d91('0x39')]);_0x563558[_0x4d91('0x1e')]=qs[_0x4d91('0x1e')](_0x5bc877[_0x4d91('0x30')][_0x4d91('0x1e')]);}_0x563558[_0x4d91('0x3a')]=qs[_0x4d91('0x3b')](_0x5bc877[_0x4d91('0x30')]['sort']);_0x563558['where']=qs[_0x4d91('0x3d')](_[_0x4d91('0x3e')](_0x5bc877[_0x4d91('0x30')],_0x3f4f24[_0x4d91('0x3d')]));if(_0x5bc877[_0x4d91('0x30')][_0x4d91('0x55')]){_0x563558[_0x4d91('0x3c')]=_[_0x4d91('0x48')](_0x563558[_0x4d91('0x3c')],{'$or':_['map'](_0x563558['attributes'],function(_0x515574){var _0x51156f={};_0x51156f[_0x515574]={'$like':'%'+_0x5bc877[_0x4d91('0x30')][_0x4d91('0x55')]+'%'};return _0x51156f;})});}_0x563558[_0x4d91('0x3c')]=_[_0x4d91('0x48')](_0x563558[_0x4d91('0x3c')],{'mailboxuser':_0x20c0f2[_0x4d91('0x56')]});_0x563558=_[_0x4d91('0x48')]({},_0x563558,_0x5bc877[_0x4d91('0x40')]);return db[_0x4d91('0x54')][_0x4d91('0x57')](_0x563558)[_0x4d91('0x26')](respondWithFilteredResult(_0x75aa6d,_0x563558));})[_0x4d91('0x45')](handleError(_0x75aa6d,null));}; \ No newline at end of file +var _0xac4a=['querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','VoiceMail','include','findAll','rows','catch','includeAll','create','body','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce'];(function(_0x2943f3,_0x2559cf){var _0x4282c2=function(_0x492822){while(--_0x492822){_0x2943f3['push'](_0x2943f3['shift']());}};_0x4282c2(++_0x2559cf);}(_0xac4a,0x13f));var _0xaac4=function(_0x3f0cf0,_0x5c0620){_0x3f0cf0=_0x3f0cf0-0x0;var _0xa9cc91=_0xac4a[_0x3f0cf0];return _0xa9cc91;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){var _0xb2577b=_0x4f10ec['get']({'plain':!![]});var _0x24186b='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x24186b,'resourceId':_0xb2577b['id']}})['then'](function(){return _0x4f10ec;});})[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)[_0xaac4('0x24')]();});}};}function handleEntityNotFound(_0xe93120,_0x3c1445){return function(_0x249a5d){if(!_0x249a5d){_0xe93120[_0xaac4('0x15')](0x194);}return _0x249a5d;};}function handleError(_0x2d68b6,_0x2f36ad){_0x2f36ad=_0x2f36ad||0x1f4;return function(_0x386c9b){logger['error'](_0x386c9b[_0xaac4('0x25')]);if(_0x386c9b[_0xaac4('0x26')]){delete _0x386c9b[_0xaac4('0x26')];}_0x2d68b6[_0xaac4('0x16')](_0x2f36ad)[_0xaac4('0x27')](_0x386c9b);};}exports[_0xaac4('0x28')]=function(_0x5e469a,_0xcf6c1){var _0x5d2c9a={},_0x2df7e3={},_0xab5d04={'count':0x0,'rows':[]};var _0x182343=_[_0xaac4('0x29')](db['VoiceMail']['rawAttributes'],function(_0x58f748){return{'name':_0x58f748[_0xaac4('0x2a')],'type':_0x58f748[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x2df7e3[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0x182343,_0xaac4('0x26'));_0x2df7e3[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x5e469a[_0xaac4('0x2e')]);_0x2df7e3[_0xaac4('0x30')]=_[_0xaac4('0x31')](_0x2df7e3[_0xaac4('0x2d')],_0x2df7e3[_0xaac4('0x2e')]);_0x5d2c9a[_0xaac4('0x32')]=_[_0xaac4('0x31')](_0x2df7e3['model'],qs['fields'](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x5d2c9a[_0xaac4('0x32')]=_0x5d2c9a['attributes'][_0xaac4('0x34')]?_0x5d2c9a[_0xaac4('0x32')]:_0x2df7e3[_0xaac4('0x2d')];if(!_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x35')](_0xaac4('0x36'))){_0x5d2c9a[_0xaac4('0x1a')]=qs['limit'](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x5d2c9a[_0xaac4('0x18')]=qs['offset'](_0x5e469a[_0xaac4('0x2e')]['offset']);}_0x5d2c9a['order']=qs[_0xaac4('0x37')](_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x5d2c9a['where']=qs['filters'](_[_0xaac4('0x38')](_0x5e469a[_0xaac4('0x2e')],_0x2df7e3[_0xaac4('0x30')]),_0x182343);if(_0x5e469a[_0xaac4('0x2e')][_0xaac4('0x39')]){_0x5d2c9a[_0xaac4('0x3a')]=_['merge'](_0x5d2c9a['where'],{'$or':_[_0xaac4('0x29')](_0x182343,function(_0x3b2b72){if(_0x3b2b72['type']!==_0xaac4('0x3b')){var _0xdea3a0={};_0xdea3a0[_0x3b2b72[_0xaac4('0x26')]]={'$like':'%'+_0x5e469a['query'][_0xaac4('0x39')]+'%'};return _0xdea3a0;}})});}_0x5d2c9a=_[_0xaac4('0x3c')]({},_0x5d2c9a,_0x5e469a[_0xaac4('0x3d')]);var _0x5bc387={'where':_0x5d2c9a[_0xaac4('0x3a')]};return db[_0xaac4('0x3e')][_0xaac4('0x1b')](_0x5bc387)[_0xaac4('0x23')](function(_0x51e59d){_0xab5d04[_0xaac4('0x1b')]=_0x51e59d;if(_0x5e469a['query']['includeAll']){_0x5d2c9a[_0xaac4('0x3f')]=[{'all':!![]}];}return db[_0xaac4('0x3e')][_0xaac4('0x40')](_0x5d2c9a);})[_0xaac4('0x23')](function(_0x43bc12){_0xab5d04[_0xaac4('0x41')]=_0x43bc12;return _0xab5d04;})[_0xaac4('0x23')](respondWithFilteredResult(_0xcf6c1,_0x5d2c9a))[_0xaac4('0x42')](handleError(_0xcf6c1,null));};exports['show']=function(_0x15191a,_0x36ac31){var _0x1fea3d={'raw':!![],'where':{'id':_0x15191a['params']['id']}},_0x2bba0c={};_0x2bba0c[_0xaac4('0x2d')]=_[_0xaac4('0x2f')](db[_0xaac4('0x3e')]['rawAttributes']);_0x2bba0c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x15191a[_0xaac4('0x2e')]);_0x2bba0c[_0xaac4('0x30')]=_['intersection'](_0x2bba0c[_0xaac4('0x2d')],_0x2bba0c[_0xaac4('0x2e')]);_0x1fea3d[_0xaac4('0x32')]=_['intersection'](_0x2bba0c[_0xaac4('0x2d')],qs[_0xaac4('0x33')](_0x15191a[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x1fea3d[_0xaac4('0x32')]=_0x1fea3d[_0xaac4('0x32')][_0xaac4('0x34')]?_0x1fea3d[_0xaac4('0x32')]:_0x2bba0c[_0xaac4('0x2d')];if(_0x15191a['query'][_0xaac4('0x43')]){_0x1fea3d[_0xaac4('0x3f')]=[{'all':!![]}];}_0x1fea3d=_[_0xaac4('0x3c')]({},_0x1fea3d,_0x15191a[_0xaac4('0x3d')]);return db[_0xaac4('0x3e')]['find'](_0x1fea3d)['then'](handleEntityNotFound(_0x36ac31,null))[_0xaac4('0x23')](respondWithResult(_0x36ac31,null))[_0xaac4('0x42')](handleError(_0x36ac31,null));};exports[_0xaac4('0x44')]=function(_0x16c7f4,_0x5f33ea){return db[_0xaac4('0x3e')]['create'](_0x16c7f4[_0xaac4('0x45')],{})[_0xaac4('0x23')](function(_0x487203){var _0x282de3=_0x16c7f4[_0xaac4('0x46')][_0xaac4('0x47')]({'plain':!![]});if(!_0x282de3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x282de3['role']===_0xaac4('0x46')){var _0x2c1751=_0x487203[_0xaac4('0x47')]({'plain':!![]});var _0xb32d1d=_0xaac4('0x48');return db[_0xaac4('0x49')]['find']({'where':{'name':_0xb32d1d,'userProfileId':_0x282de3[_0xaac4('0x4a')]},'raw':!![]})[_0xaac4('0x23')](function(_0x1c9979){if(_0x1c9979&&_0x1c9979[_0xaac4('0x4b')]===0x0){return db['UserProfileResource'][_0xaac4('0x44')]({'name':_0x2c1751['name'],'resourceId':_0x2c1751['id'],'type':_0x1c9979[_0xaac4('0x26')],'sectionId':_0x1c9979['id']},{})[_0xaac4('0x23')](function(){return _0x487203;});}else{return _0x487203;}})[_0xaac4('0x42')](function(_0x3922a0){logger[_0xaac4('0x4c')](_0xaac4('0x4d'),_0x3922a0);throw _0x3922a0;});}return _0x487203;})[_0xaac4('0x23')](respondWithResult(_0x5f33ea,0xc9))[_0xaac4('0x42')](handleError(_0x5f33ea,null));};exports[_0xaac4('0x21')]=function(_0x1b9219,_0x1a637e){if(_0x1b9219[_0xaac4('0x45')]['id']){delete _0x1b9219[_0xaac4('0x45')]['id'];}return db[_0xaac4('0x3e')]['find']({'where':{'id':_0x1b9219[_0xaac4('0x4e')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x1a637e,null))[_0xaac4('0x23')](saveUpdates(_0x1b9219[_0xaac4('0x45')],null))[_0xaac4('0x23')](respondWithResult(_0x1a637e,null))[_0xaac4('0x42')](handleError(_0x1a637e,null));};exports[_0xaac4('0x22')]=function(_0x46082d,_0x5e8928){return db[_0xaac4('0x3e')]['find']({'where':{'id':_0x46082d[_0xaac4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e8928,null))[_0xaac4('0x23')](removeEntity(_0x5e8928,null))['catch'](handleError(_0x5e8928,null));};exports['getMessages']=function(_0x19764c,_0x3a4e29,_0x48ae39){return db[_0xaac4('0x3e')][_0xaac4('0x4f')]({'where':{'id':_0x19764c[_0xaac4('0x4e')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x3a4e29,null))[_0xaac4('0x23')](function(_0x19d9c1){var _0x5d38bc;var _0x346f4c={},_0x586a10={};_0x586a10[_0xaac4('0x2d')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x586a10[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x19764c[_0xaac4('0x2e')]);_0x586a10[_0xaac4('0x30')]=_['intersection'](_0x586a10[_0xaac4('0x2d')],_0x586a10[_0xaac4('0x2e')]);_0x346f4c[_0xaac4('0x32')]=_['intersection'](_0x586a10[_0xaac4('0x2d')],qs[_0xaac4('0x33')](_0x19764c[_0xaac4('0x2e')][_0xaac4('0x33')]));_0x346f4c[_0xaac4('0x32')]=_0x346f4c[_0xaac4('0x32')][_0xaac4('0x34')]?_0x346f4c['attributes']:_0x586a10['model'];if(!_0x19764c[_0xaac4('0x2e')]['hasOwnProperty']('nolimit')){_0x346f4c[_0xaac4('0x1a')]=qs['limit'](_0x19764c[_0xaac4('0x2e')]['limit']);_0x346f4c[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x19764c['query']['offset']);}_0x346f4c['order']=qs['sort'](_0x19764c[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x346f4c[_0xaac4('0x3a')]=qs[_0xaac4('0x30')](_['pick'](_0x19764c[_0xaac4('0x2e')],_0x586a10[_0xaac4('0x30')]));if(_0x19764c[_0xaac4('0x2e')][_0xaac4('0x39')]){_0x346f4c[_0xaac4('0x3a')]=_[_0xaac4('0x3c')](_0x346f4c[_0xaac4('0x3a')],{'$or':_[_0xaac4('0x29')](_0x346f4c[_0xaac4('0x32')],function(_0x40271c){var _0x43aeee={};_0x43aeee[_0x40271c]={'$like':'%'+_0x19764c['query']['filter']+'%'};return _0x43aeee;})});}_0x346f4c[_0xaac4('0x3a')]=_['merge'](_0x346f4c['where'],{'mailboxuser':_0x19d9c1[_0xaac4('0x50')]});_0x346f4c=_['merge']({},_0x346f4c,_0x19764c[_0xaac4('0x3d')]);return db[_0xaac4('0x51')][_0xaac4('0x52')](_0x346f4c)[_0xaac4('0x23')](respondWithFilteredResult(_0x3a4e29,_0x346f4c));})['catch'](handleError(_0x3a4e29,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8eb0d59..fcd4f92 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 _0x7dc0=['exports','define','VoiceMail','voice_voicemail','context','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x7dc0,0x1a5));var _0x07dc=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0x7dc0[_0x11f5ff];return _0x46eefb;};'use strict';var _=require(_0x07dc('0x0'));var util=require(_0x07dc('0x1'));var logger=require(_0x07dc('0x2'))('api');var moment=require(_0x07dc('0x3'));var BPromise=require(_0x07dc('0x4'));var rp=require(_0x07dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07dc('0x6'));var config=require(_0x07dc('0x7'));var attributes=require('./voiceMail.attributes');module[_0x07dc('0x8')]=function(_0x30c88f,_0x3dee40){return _0x30c88f[_0x07dc('0x9')](_0x07dc('0xa'),attributes,{'tableName':_0x07dc('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x07dc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3cb9=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x3cb9,0x8e));var _0x93cb=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x3cb9[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x93cb('0x0'));var util=require(_0x93cb('0x1'));var logger=require(_0x93cb('0x2'))('api');var moment=require('moment');var BPromise=require(_0x93cb('0x3'));var rp=require(_0x93cb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93cb('0x5'));var config=require(_0x93cb('0x6'));var attributes=require('./voiceMail.attributes');module[_0x93cb('0x7')]=function(_0x1f8963,_0x624960){return _0x1f8963[_0x93cb('0x8')](_0x93cb('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x93cb('0xa'),'fields':[_0x93cb('0xb'),_0x93cb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index b626c92..bad263b 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 _0xcae7=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x269afe,_0x107775){var _0x17d6ba=function(_0x4b6735){while(--_0x4b6735){_0x269afe['push'](_0x269afe['shift']());}};_0x17d6ba(++_0x107775);}(_0xcae7,0x1d3));var _0x7cae=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0xcae7[_0x375325];return _0x228f57;};'use strict';var _=require('lodash');var util=require(_0x7cae('0x0'));var moment=require(_0x7cae('0x1'));var BPromise=require('bluebird');var rs=require(_0x7cae('0x2'));var fs=require('fs');var Redis=require(_0x7cae('0x3'));var db=require(_0x7cae('0x4'))['db'];var utils=require(_0x7cae('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7cae('0x6'));var client=jayson[_0x7cae('0x7')][_0x7cae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe7df60,_0x99d2e1,_0x23bab4){return new BPromise(function(_0x5170b9,_0x6a56e9){return client[_0x7cae('0x9')](_0xe7df60,_0x23bab4)[_0x7cae('0xa')](function(_0x271d39){logger[_0x7cae('0xb')](_0x7cae('0xc'),_0x99d2e1,'request\x20sent');logger[_0x7cae('0xd')](_0x7cae('0xe'),_0x99d2e1,_0x7cae('0xf'),JSON['stringify'](_0x271d39));if(_0x271d39[_0x7cae('0x10')]){if(_0x271d39[_0x7cae('0x10')][_0x7cae('0x11')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x99d2e1,_0x271d39[_0x7cae('0x10')]['message']);return _0x6a56e9(_0x271d39['error'][_0x7cae('0x12')]);}logger[_0x7cae('0x10')](_0x7cae('0xc'),_0x99d2e1,_0x271d39['error'][_0x7cae('0x12')]);return _0x5170b9(_0x271d39[_0x7cae('0x10')]['message']);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x99d2e1,'request\x20sent');_0x5170b9(_0x271d39[_0x7cae('0x13')][_0x7cae('0x12')]);}})['catch'](function(_0x596f46){logger[_0x7cae('0x10')](_0x7cae('0xc'),_0x99d2e1,_0x596f46);_0x6a56e9(_0x596f46);});});} \ No newline at end of file +var _0xee2a=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee2a,0x9d));var _0xaee2=function(_0x563e69,_0x33863c){_0x563e69=_0x563e69-0x0;var _0x13b92c=_0xee2a[_0x563e69];return _0x13b92c;};'use strict';var _=require(_0xaee2('0x0'));var util=require('util');var moment=require(_0xaee2('0x1'));var BPromise=require(_0xaee2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaee2('0x3'));var db=require(_0xaee2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaee2('0x5'));var config=require(_0xaee2('0x6'));var jayson=require(_0xaee2('0x7'));var client=jayson[_0xaee2('0x8')][_0xaee2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5514a8,_0x1c7b85,_0x4282a9){return new BPromise(function(_0x55dcae,_0x2f7609){return client[_0xaee2('0xa')](_0x5514a8,_0x4282a9)['then'](function(_0xaf5cb8){logger[_0xaee2('0xb')](_0xaee2('0xc'),_0x1c7b85,_0xaee2('0xd'));logger[_0xaee2('0xe')](_0xaee2('0xf'),_0x1c7b85,_0xaee2('0xd'),JSON['stringify'](_0xaf5cb8));if(_0xaf5cb8[_0xaee2('0x10')]){if(_0xaf5cb8[_0xaee2('0x10')][_0xaee2('0x11')]===0x1f4){logger['error'](_0xaee2('0xc'),_0x1c7b85,_0xaf5cb8[_0xaee2('0x10')][_0xaee2('0x12')]);return _0x2f7609(_0xaf5cb8['error'][_0xaee2('0x12')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x1c7b85,_0xaf5cb8[_0xaee2('0x10')][_0xaee2('0x12')]);return _0x55dcae(_0xaf5cb8[_0xaee2('0x10')][_0xaee2('0x12')]);}else{logger[_0xaee2('0xb')](_0xaee2('0xc'),_0x1c7b85,_0xaee2('0xd'));_0x55dcae(_0xaf5cb8['result']['message']);}})[_0xaee2('0x13')](function(_0x2bdf49){logger['error'](_0xaee2('0xc'),_0x1c7b85,_0x2bdf49);_0x2f7609(_0x2bdf49);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 002b291..7f26c0b 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 _0x81cb=['../../config/environment','./voiceMailMessage.controller','index','get','/:id','isAuthenticated','/:id/download','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x81cb,0x1dc));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb81c('0x0'));var timeout=require(_0xb81c('0x1'));var express=require(_0xb81c('0x2'));var router=express[_0xb81c('0x3')]();var fs_extra=require(_0xb81c('0x4'));var auth=require(_0xb81c('0x5'));var interaction=require(_0xb81c('0x6'));var config=require(_0xb81c('0x7'));var controller=require(_0xb81c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb81c('0x9')]);router[_0xb81c('0xa')](_0xb81c('0xb'),auth[_0xb81c('0xc')](),controller['show']);router[_0xb81c('0xa')](_0xb81c('0xd'),auth[_0xb81c('0xc')](),controller['download']);router[_0xb81c('0xe')]('/',auth[_0xb81c('0xc')](),controller[_0xb81c('0xf')]);router[_0xb81c('0x10')](_0xb81c('0xb'),auth[_0xb81c('0xc')](),controller[_0xb81c('0x11')]);router[_0xb81c('0x12')](_0xb81c('0xb'),auth['isAuthenticated'](),controller[_0xb81c('0x13')]);module[_0xb81c('0x14')]=router; \ No newline at end of file +var _0x3e62=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceMailMessage.controller','get','/:id'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x3e62,0x172));var _0x23e6=function(_0x16ea59,_0x1c9163){_0x16ea59=_0x16ea59-0x0;var _0x361582=_0x3e62[_0x16ea59];return _0x361582;};'use strict';var multer=require(_0x23e6('0x0'));var util=require(_0x23e6('0x1'));var path=require(_0x23e6('0x2'));var timeout=require(_0x23e6('0x3'));var express=require(_0x23e6('0x4'));var router=express[_0x23e6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x23e6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x23e6('0x7'));router[_0x23e6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x23e6('0x8')](_0x23e6('0x9'),auth[_0x23e6('0xa')](),controller[_0x23e6('0xb')]);router[_0x23e6('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x23e6('0xc')]('/',auth[_0x23e6('0xa')](),controller[_0x23e6('0xd')]);router[_0x23e6('0xe')](_0x23e6('0x9'),auth[_0x23e6('0xa')](),controller[_0x23e6('0xf')]);router[_0x23e6('0x10')](_0x23e6('0x9'),auth[_0x23e6('0xa')](),controller[_0x23e6('0x11')]);module[_0x23e6('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index fe317c3..d625842 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 _0x8c86=['getDataValue','INTEGER','STRING','BLOB','long','literal','exports','VIRTUAL'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x8c86,0x1ce));var _0x68c8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8c86[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x68c8('0x0')]={'name':{'type':Sequelize[_0x68c8('0x1')],'get':function(_0x35fbc4){return this[_0x68c8('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x68c8('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x68c8('0x5')](_0x68c8('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x68c8('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x68c8('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xc5f8=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP'];(function(_0xa950b5,_0x37abc7){var _0x5a9a29=function(_0x52d9c4){while(--_0x52d9c4){_0xa950b5['push'](_0xa950b5['shift']());}};_0x5a9a29(++_0x37abc7);}(_0xc5f8,0xf9));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x8c5f('0x0')]={'name':{'type':Sequelize[_0x8c5f('0x1')],'get':function(_0x12d107){return this[_0x8c5f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8c5f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x8c5f('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8c5f('0x4')],'defaultValue':''},'stamp':{'type':_0x8c5f('0x6'),'defaultValue':Sequelize['literal'](_0x8c5f('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 644b6d7..d9248cc 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 _0x5b7a=['limit','count','set','Content-Range','reject','update','destroy','then','end','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','merge','find','create','body','params','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x485377,_0xfa8793){var _0x19e180=function(_0x25b096){while(--_0x25b096){_0x485377['push'](_0x485377['shift']());}};_0x19e180(++_0xfa8793);}(_0x5b7a,0x8f));var _0xa5b7=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x5b7a[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0xa5b7('0x0'));var rimraf=require(_0xa5b7('0x1'));var zipdir=require(_0xa5b7('0x2'));var jsonpatch=require(_0xa5b7('0x3'));var rp=require(_0xa5b7('0x4'));var moment=require(_0xa5b7('0x5'));var BPromise=require(_0xa5b7('0x6'));var Mustache=require('mustache');var util=require(_0xa5b7('0x7'));var path=require('path');var sox=require(_0xa5b7('0x8'));var csv=require(_0xa5b7('0x9'));var ejs=require(_0xa5b7('0xa'));var fs=require('fs');var fs_extra=require(_0xa5b7('0xb'));var _=require(_0xa5b7('0xc'));var squel=require(_0xa5b7('0xd'));var crypto=require(_0xa5b7('0xe'));var jsforce=require(_0xa5b7('0xf'));var deskjs=require(_0xa5b7('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa5b7('0x11'));var Papa=require(_0xa5b7('0x12'));var Redis=require(_0xa5b7('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa5b7('0x14'));var hardwareService=require(_0xa5b7('0x15'));var logger=require(_0xa5b7('0x16'))(_0xa5b7('0x17'));var utils=require(_0xa5b7('0x18'));var config=require(_0xa5b7('0x19'));var licenseUtil=require(_0xa5b7('0x1a'));var db=require(_0xa5b7('0x1b'))['db'];function respondWithStatusCode(_0x408291,_0x41c91f){_0x41c91f=_0x41c91f||0xcc;return function(_0x2dfec1){if(_0x2dfec1){return _0x408291[_0xa5b7('0x1c')](_0x41c91f);}return _0x408291[_0xa5b7('0x1d')](_0x41c91f)['end']();};}function respondWithResult(_0x4ecf6f,_0x50f3cf){_0x50f3cf=_0x50f3cf||0xc8;return function(_0x6a42b0){if(_0x6a42b0){return _0x4ecf6f[_0xa5b7('0x1d')](_0x50f3cf)[_0xa5b7('0x1e')](_0x6a42b0);}};}function respondWithFilteredResult(_0x7a53db,_0x476170){return function(_0x2f0f98){if(_0x2f0f98){var _0x553ade=typeof _0x476170[_0xa5b7('0x1f')]===_0xa5b7('0x20')&&typeof _0x476170[_0xa5b7('0x21')]===_0xa5b7('0x20');var _0x1d16b2=_0x2f0f98[_0xa5b7('0x22')];var _0x42b578=_0x553ade?0x0:_0x476170[_0xa5b7('0x1f')];var _0x8b08d5=_0x553ade?_0x2f0f98[_0xa5b7('0x22')]:_0x476170[_0xa5b7('0x1f')]+_0x476170[_0xa5b7('0x21')];var _0x4a2403;if(_0x8b08d5>=_0x1d16b2){_0x8b08d5=_0x1d16b2;_0x4a2403=0xc8;}else{_0x4a2403=0xce;}_0x7a53db[_0xa5b7('0x1d')](_0x4a2403);return _0x7a53db[_0xa5b7('0x23')](_0xa5b7('0x24'),_0x42b578+'-'+_0x8b08d5+'/'+_0x1d16b2)[_0xa5b7('0x1e')](_0x2f0f98);}return null;};}function patchUpdates(_0x4d3283){return function(_0x2fbbc3){try{jsonpatch['apply'](_0x2fbbc3,_0x4d3283,!![]);}catch(_0x2418e6){return BPromise[_0xa5b7('0x25')](_0x2418e6);}return _0x2fbbc3['save']();};}function saveUpdates(_0x45056d,_0x28dc24){return function(_0xdebfb1){if(_0xdebfb1){return _0xdebfb1[_0xa5b7('0x26')](_0x45056d)['then'](function(_0x421948){return _0x421948;});}return null;};}function removeEntity(_0x39a5ec,_0x4414aa){return function(_0x43825c){if(_0x43825c){return _0x43825c[_0xa5b7('0x27')]()[_0xa5b7('0x28')](function(){_0x39a5ec[_0xa5b7('0x1d')](0xcc)[_0xa5b7('0x29')]();});}};}function handleEntityNotFound(_0x335c71,_0x3e5aca){return function(_0x350678){if(!_0x350678){_0x335c71[_0xa5b7('0x1c')](0x194);}return _0x350678;};}function handleError(_0x21e516,_0x345498){_0x345498=_0x345498||0x1f4;return function(_0x2ed7d0){logger[_0xa5b7('0x2a')](_0x2ed7d0[_0xa5b7('0x2b')]);if(_0x2ed7d0[_0xa5b7('0x2c')]){delete _0x2ed7d0[_0xa5b7('0x2c')];}_0x21e516[_0xa5b7('0x1d')](_0x345498)[_0xa5b7('0x2d')](_0x2ed7d0);};}exports[_0xa5b7('0x2e')]=function(_0xeffdf7,_0x423877){var _0x128331={},_0x42619c={},_0x535cb8={'count':0x0,'rows':[]};var _0x37d998=_[_0xa5b7('0x2f')](db[_0xa5b7('0x30')][_0xa5b7('0x31')],function(_0x18c623){return{'name':_0x18c623[_0xa5b7('0x32')],'type':_0x18c623[_0xa5b7('0x33')][_0xa5b7('0x34')]};});_0x42619c[_0xa5b7('0x35')]=_[_0xa5b7('0x36')](_['map'](_0x37d998,_0xa5b7('0x2c')),['name']);_0x42619c[_0xa5b7('0x37')]=_[_0xa5b7('0x38')](_0xeffdf7[_0xa5b7('0x37')]);_0x42619c['filters']=_[_0xa5b7('0x39')](_0x42619c[_0xa5b7('0x35')],_0x42619c['query']);_0x128331['attributes']=_[_0xa5b7('0x39')](_0x42619c['model'],qs[_0xa5b7('0x3a')](_0xeffdf7['query'][_0xa5b7('0x3a')]));_0x128331[_0xa5b7('0x3b')]=_0x128331['attributes']['length']?_0x128331['attributes']:_0x42619c[_0xa5b7('0x35')];if(!_0xeffdf7['query'][_0xa5b7('0x3c')](_0xa5b7('0x3d'))){_0x128331[_0xa5b7('0x21')]=qs[_0xa5b7('0x21')](_0xeffdf7[_0xa5b7('0x37')][_0xa5b7('0x21')]);_0x128331[_0xa5b7('0x1f')]=qs[_0xa5b7('0x1f')](_0xeffdf7['query']['offset']);}_0x128331[_0xa5b7('0x3e')]=qs[_0xa5b7('0x3f')](_0xeffdf7[_0xa5b7('0x37')][_0xa5b7('0x3f')]);_0x128331['where']=qs[_0xa5b7('0x40')](_[_0xa5b7('0x41')](_0xeffdf7['query'],_0x42619c[_0xa5b7('0x40')]),_0x37d998);if(_0xeffdf7['query'][_0xa5b7('0x42')]){_0x128331[_0xa5b7('0x43')]=_['merge'](_0x128331[_0xa5b7('0x43')],{'$or':_[_0xa5b7('0x2f')](_0x37d998,function(_0x41459c){if(_0x41459c[_0xa5b7('0x33')]!==_0xa5b7('0x44')){var _0x694d70={};_0x694d70[_0x41459c[_0xa5b7('0x2c')]]={'$like':'%'+_0xeffdf7['query']['filter']+'%'};return _0x694d70;}})});}_0x128331=_['merge']({},_0x128331,_0xeffdf7[_0xa5b7('0x45')]);var _0x1ff304={'where':_0x128331['where']};return db[_0xa5b7('0x30')][_0xa5b7('0x22')](_0x1ff304)['then'](function(_0x417677){_0x535cb8[_0xa5b7('0x22')]=_0x417677;if(_0xeffdf7[_0xa5b7('0x37')][_0xa5b7('0x46')]){_0x128331[_0xa5b7('0x47')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa5b7('0x48')](_0x128331);})[_0xa5b7('0x28')](function(_0x42b024){_0x535cb8['rows']=_0x42b024;return _0x535cb8;})[_0xa5b7('0x28')](respondWithFilteredResult(_0x423877,_0x128331))[_0xa5b7('0x49')](handleError(_0x423877,null));};exports[_0xa5b7('0x4a')]=function(_0xef30b8,_0x5f4bb5){var _0x422fb4={'raw':!![],'where':{'id':_0xef30b8['params']['id']}},_0x55efb2={};_0x55efb2[_0xa5b7('0x35')]=_[_0xa5b7('0x38')](db[_0xa5b7('0x30')]['rawAttributes']);_0x55efb2[_0xa5b7('0x37')]=_[_0xa5b7('0x38')](_0xef30b8[_0xa5b7('0x37')]);_0x55efb2[_0xa5b7('0x40')]=_[_0xa5b7('0x39')](_0x55efb2[_0xa5b7('0x35')],_0x55efb2['query']);_0x422fb4[_0xa5b7('0x3b')]=_[_0xa5b7('0x39')](_0x55efb2[_0xa5b7('0x35')],qs['fields'](_0xef30b8[_0xa5b7('0x37')][_0xa5b7('0x3a')]));_0x422fb4[_0xa5b7('0x3b')]=_0x422fb4[_0xa5b7('0x3b')]['length']?_0x422fb4['attributes']:_0x55efb2[_0xa5b7('0x35')];if(_0xef30b8[_0xa5b7('0x37')][_0xa5b7('0x46')]){_0x422fb4[_0xa5b7('0x47')]=[{'all':!![]}];}_0x422fb4=_[_0xa5b7('0x4b')]({},_0x422fb4,_0xef30b8[_0xa5b7('0x45')]);return db['VoiceMailMessage'][_0xa5b7('0x4c')](_0x422fb4)['then'](handleEntityNotFound(_0x5f4bb5,null))['then'](respondWithResult(_0x5f4bb5,null))['catch'](handleError(_0x5f4bb5,null));};exports[_0xa5b7('0x4d')]=function(_0x18a4ea,_0x55d57e){return db[_0xa5b7('0x30')][_0xa5b7('0x4d')](_0x18a4ea['body'],{})[_0xa5b7('0x28')](respondWithResult(_0x55d57e,0xc9))[_0xa5b7('0x49')](handleError(_0x55d57e,null));};exports[_0xa5b7('0x26')]=function(_0x33fb66,_0x14105f){if(_0x33fb66[_0xa5b7('0x4e')]['id']){delete _0x33fb66[_0xa5b7('0x4e')]['id'];}return db['VoiceMailMessage'][_0xa5b7('0x4c')]({'where':{'id':_0x33fb66['params']['id']}})[_0xa5b7('0x28')](handleEntityNotFound(_0x14105f,null))[_0xa5b7('0x28')](saveUpdates(_0x33fb66[_0xa5b7('0x4e')],null))[_0xa5b7('0x28')](respondWithResult(_0x14105f,null))[_0xa5b7('0x49')](handleError(_0x14105f,null));};exports[_0xa5b7('0x27')]=function(_0x395e7b,_0x2e7c88){return db[_0xa5b7('0x30')][_0xa5b7('0x4c')]({'where':{'id':_0x395e7b[_0xa5b7('0x4f')]['id']}})[_0xa5b7('0x28')](handleEntityNotFound(_0x2e7c88,null))['then'](removeEntity(_0x2e7c88,null))[_0xa5b7('0x49')](handleError(_0x2e7c88,null));};exports[_0xa5b7('0x50')]=function(_0x1f74a1,_0x3ee415,_0x7f8630){return db[_0xa5b7('0x30')][_0xa5b7('0x4c')]({'where':{'id':_0x1f74a1[_0xa5b7('0x4f')]['id']},'attributes':['id','recording',_0xa5b7('0x51')]})['then'](handleEntityNotFound(_0x3ee415,null))[_0xa5b7('0x28')](function(_0xf5712e){if(_0xf5712e){if(!_0xf5712e[_0xa5b7('0x52')]){throw new db[(_0xa5b7('0x53'))][(_0xa5b7('0x54'))](_0xa5b7('0x55'));}var _0x402ed5={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0xf5712e[_0xa5b7('0x51')]){_0x402ed5['Content-Disposition']=_0xa5b7('0x56')+_0xf5712e[_0xa5b7('0x51')]+_0xa5b7('0x57');}_0x3ee415['set'](_0x402ed5);return _0x3ee415[_0xa5b7('0x2d')](new Buffer(_0xf5712e[_0xa5b7('0x52')]));}})[_0xa5b7('0x49')](handleError(_0x3ee415,null));}; \ No newline at end of file +var _0xf01d=['type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','send','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','save','update','then','destroy','error','name','map','VoiceMailMessage','rawAttributes','fieldName'];(function(_0x43a8b9,_0x4ff1e0){var _0x39894b=function(_0x48b507){while(--_0x48b507){_0x43a8b9['push'](_0x43a8b9['shift']());}};_0x39894b(++_0x4ff1e0);}(_0xf01d,0x1bf));var _0xdf01=function(_0x1e4550,_0x133f03){_0x1e4550=_0x1e4550-0x0;var _0x170a6e=_0xf01d[_0x1e4550];return _0x170a6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf01('0x0'));var zipdir=require(_0xdf01('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf01('0x2'));var moment=require(_0xdf01('0x3'));var BPromise=require(_0xdf01('0x4'));var Mustache=require(_0xdf01('0x5'));var util=require(_0xdf01('0x6'));var path=require('path');var sox=require(_0xdf01('0x7'));var csv=require(_0xdf01('0x8'));var ejs=require(_0xdf01('0x9'));var fs=require('fs');var fs_extra=require(_0xdf01('0xa'));var _=require(_0xdf01('0xb'));var squel=require(_0xdf01('0xc'));var crypto=require(_0xdf01('0xd'));var jsforce=require(_0xdf01('0xe'));var deskjs=require(_0xdf01('0xf'));var toCsv=require(_0xdf01('0x8'));var querystring=require(_0xdf01('0x10'));var Papa=require(_0xdf01('0x11'));var Redis=require(_0xdf01('0x12'));var authService=require(_0xdf01('0x13'));var qs=require(_0xdf01('0x14'));var as=require(_0xdf01('0x15'));var hardwareService=require(_0xdf01('0x16'));var logger=require(_0xdf01('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xdf01('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf01('0x19'))['db'];function respondWithStatusCode(_0x2f1d7c,_0x4dd156){_0x4dd156=_0x4dd156||0xcc;return function(_0x2a364d){if(_0x2a364d){return _0x2f1d7c[_0xdf01('0x1a')](_0x4dd156);}return _0x2f1d7c['status'](_0x4dd156)[_0xdf01('0x1b')]();};}function respondWithResult(_0x24e291,_0x508709){_0x508709=_0x508709||0xc8;return function(_0x411d95){if(_0x411d95){return _0x24e291[_0xdf01('0x1c')](_0x508709)['json'](_0x411d95);}};}function respondWithFilteredResult(_0x10c0a5,_0x4f296d){return function(_0x23fd9a){if(_0x23fd9a){var _0xd1b588=typeof _0x4f296d[_0xdf01('0x1d')]===_0xdf01('0x1e')&&typeof _0x4f296d[_0xdf01('0x1f')]===_0xdf01('0x1e');var _0x30182c=_0x23fd9a['count'];var _0x36d18b=_0xd1b588?0x0:_0x4f296d[_0xdf01('0x1d')];var _0x484556=_0xd1b588?_0x23fd9a[_0xdf01('0x20')]:_0x4f296d[_0xdf01('0x1d')]+_0x4f296d[_0xdf01('0x1f')];var _0x3545ca;if(_0x484556>=_0x30182c){_0x484556=_0x30182c;_0x3545ca=0xc8;}else{_0x3545ca=0xce;}_0x10c0a5[_0xdf01('0x1c')](_0x3545ca);return _0x10c0a5[_0xdf01('0x21')]('Content-Range',_0x36d18b+'-'+_0x484556+'/'+_0x30182c)[_0xdf01('0x22')](_0x23fd9a);}return null;};}function patchUpdates(_0x1be6c){return function(_0x294149){try{jsonpatch['apply'](_0x294149,_0x1be6c,!![]);}catch(_0x2d57e3){return BPromise['reject'](_0x2d57e3);}return _0x294149[_0xdf01('0x23')]();};}function saveUpdates(_0x1b13db,_0x28a22b){return function(_0x455bd7){if(_0x455bd7){return _0x455bd7[_0xdf01('0x24')](_0x1b13db)[_0xdf01('0x25')](function(_0x17f865){return _0x17f865;});}return null;};}function removeEntity(_0x436b6a,_0x26b25b){return function(_0x181fe5){if(_0x181fe5){return _0x181fe5[_0xdf01('0x26')]()[_0xdf01('0x25')](function(){_0x436b6a[_0xdf01('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c5277,_0x48dda1){return function(_0x6a54a8){if(!_0x6a54a8){_0x2c5277[_0xdf01('0x1a')](0x194);}return _0x6a54a8;};}function handleError(_0x53e40a,_0x5223b5){_0x5223b5=_0x5223b5||0x1f4;return function(_0x5f4bde){logger[_0xdf01('0x27')](_0x5f4bde['stack']);if(_0x5f4bde[_0xdf01('0x28')]){delete _0x5f4bde['name'];}_0x53e40a[_0xdf01('0x1c')](_0x5223b5)['send'](_0x5f4bde);};}exports['index']=function(_0x168ddd,_0x47dad6){var _0x896954={},_0x4496ba={},_0x2471fc={'count':0x0,'rows':[]};var _0x425c6a=_[_0xdf01('0x29')](db[_0xdf01('0x2a')][_0xdf01('0x2b')],function(_0x1a17c2){return{'name':_0x1a17c2[_0xdf01('0x2c')],'type':_0x1a17c2[_0xdf01('0x2d')][_0xdf01('0x2e')]};});_0x4496ba[_0xdf01('0x2f')]=_[_0xdf01('0x30')](_[_0xdf01('0x29')](_0x425c6a,_0xdf01('0x28')),['name']);_0x4496ba['query']=_[_0xdf01('0x31')](_0x168ddd[_0xdf01('0x32')]);_0x4496ba[_0xdf01('0x33')]=_[_0xdf01('0x34')](_0x4496ba[_0xdf01('0x2f')],_0x4496ba[_0xdf01('0x32')]);_0x896954[_0xdf01('0x35')]=_[_0xdf01('0x34')](_0x4496ba[_0xdf01('0x2f')],qs[_0xdf01('0x36')](_0x168ddd['query'][_0xdf01('0x36')]));_0x896954[_0xdf01('0x35')]=_0x896954['attributes']['length']?_0x896954[_0xdf01('0x35')]:_0x4496ba[_0xdf01('0x2f')];if(!_0x168ddd[_0xdf01('0x32')][_0xdf01('0x37')]('nolimit')){_0x896954['limit']=qs[_0xdf01('0x1f')](_0x168ddd[_0xdf01('0x32')]['limit']);_0x896954[_0xdf01('0x1d')]=qs[_0xdf01('0x1d')](_0x168ddd[_0xdf01('0x32')][_0xdf01('0x1d')]);}_0x896954['order']=qs[_0xdf01('0x38')](_0x168ddd[_0xdf01('0x32')][_0xdf01('0x38')]);_0x896954[_0xdf01('0x39')]=qs[_0xdf01('0x33')](_['pick'](_0x168ddd[_0xdf01('0x32')],_0x4496ba[_0xdf01('0x33')]),_0x425c6a);if(_0x168ddd['query'][_0xdf01('0x3a')]){_0x896954[_0xdf01('0x39')]=_[_0xdf01('0x3b')](_0x896954[_0xdf01('0x39')],{'$or':_[_0xdf01('0x29')](_0x425c6a,function(_0x327f76){if(_0x327f76['type']!==_0xdf01('0x3c')){var _0xecfd5a={};_0xecfd5a[_0x327f76[_0xdf01('0x28')]]={'$like':'%'+_0x168ddd['query'][_0xdf01('0x3a')]+'%'};return _0xecfd5a;}})});}_0x896954=_['merge']({},_0x896954,_0x168ddd[_0xdf01('0x3d')]);var _0x240acd={'where':_0x896954[_0xdf01('0x39')]};return db[_0xdf01('0x2a')][_0xdf01('0x20')](_0x240acd)[_0xdf01('0x25')](function(_0x29ad47){_0x2471fc[_0xdf01('0x20')]=_0x29ad47;if(_0x168ddd['query'][_0xdf01('0x3e')]){_0x896954[_0xdf01('0x3f')]=[{'all':!![]}];}return db[_0xdf01('0x2a')][_0xdf01('0x40')](_0x896954);})[_0xdf01('0x25')](function(_0x5ce738){_0x2471fc[_0xdf01('0x41')]=_0x5ce738;return _0x2471fc;})[_0xdf01('0x25')](respondWithFilteredResult(_0x47dad6,_0x896954))[_0xdf01('0x42')](handleError(_0x47dad6,null));};exports[_0xdf01('0x43')]=function(_0x420e4a,_0x5856a2){var _0x3e5a5b={'raw':!![],'where':{'id':_0x420e4a[_0xdf01('0x44')]['id']}},_0x1334b7={};_0x1334b7['model']=_['keys'](db['VoiceMailMessage'][_0xdf01('0x2b')]);_0x1334b7[_0xdf01('0x32')]=_[_0xdf01('0x31')](_0x420e4a['query']);_0x1334b7[_0xdf01('0x33')]=_[_0xdf01('0x34')](_0x1334b7[_0xdf01('0x2f')],_0x1334b7[_0xdf01('0x32')]);_0x3e5a5b[_0xdf01('0x35')]=_['intersection'](_0x1334b7[_0xdf01('0x2f')],qs[_0xdf01('0x36')](_0x420e4a[_0xdf01('0x32')]['fields']));_0x3e5a5b[_0xdf01('0x35')]=_0x3e5a5b[_0xdf01('0x35')][_0xdf01('0x45')]?_0x3e5a5b[_0xdf01('0x35')]:_0x1334b7['model'];if(_0x420e4a[_0xdf01('0x32')][_0xdf01('0x3e')]){_0x3e5a5b[_0xdf01('0x3f')]=[{'all':!![]}];}_0x3e5a5b=_[_0xdf01('0x3b')]({},_0x3e5a5b,_0x420e4a[_0xdf01('0x3d')]);return db['VoiceMailMessage']['find'](_0x3e5a5b)['then'](handleEntityNotFound(_0x5856a2,null))[_0xdf01('0x25')](respondWithResult(_0x5856a2,null))['catch'](handleError(_0x5856a2,null));};exports['create']=function(_0x8b8bbf,_0x99a924){return db[_0xdf01('0x2a')][_0xdf01('0x46')](_0x8b8bbf[_0xdf01('0x47')],{})['then'](respondWithResult(_0x99a924,0xc9))['catch'](handleError(_0x99a924,null));};exports[_0xdf01('0x24')]=function(_0x33dd9d,_0x1820ab){if(_0x33dd9d[_0xdf01('0x47')]['id']){delete _0x33dd9d[_0xdf01('0x47')]['id'];}return db[_0xdf01('0x2a')][_0xdf01('0x48')]({'where':{'id':_0x33dd9d[_0xdf01('0x44')]['id']}})['then'](handleEntityNotFound(_0x1820ab,null))[_0xdf01('0x25')](saveUpdates(_0x33dd9d[_0xdf01('0x47')],null))[_0xdf01('0x25')](respondWithResult(_0x1820ab,null))[_0xdf01('0x42')](handleError(_0x1820ab,null));};exports[_0xdf01('0x26')]=function(_0x381028,_0x129ef1){return db[_0xdf01('0x2a')][_0xdf01('0x48')]({'where':{'id':_0x381028['params']['id']}})['then'](handleEntityNotFound(_0x129ef1,null))[_0xdf01('0x25')](removeEntity(_0x129ef1,null))[_0xdf01('0x42')](handleError(_0x129ef1,null));};exports[_0xdf01('0x49')]=function(_0x1ca696,_0x59d63a,_0x5198eb){return db['VoiceMailMessage'][_0xdf01('0x48')]({'where':{'id':_0x1ca696[_0xdf01('0x44')]['id']},'attributes':['id',_0xdf01('0x4a'),'msg_id']})[_0xdf01('0x25')](handleEntityNotFound(_0x59d63a,null))['then'](function(_0x242500){if(_0x242500){if(!_0x242500[_0xdf01('0x4a')]){throw new db['Sequelize'][(_0xdf01('0x4b'))](_0xdf01('0x4c'));}var _0x44ce79={'Content-Type':_0xdf01('0x4d'),'Content-Disposition':_0xdf01('0x4e')};if(_0x242500['msg_id']){_0x44ce79[_0xdf01('0x4f')]=_0xdf01('0x50')+_0x242500['msg_id']+'.wav\x22';}_0x59d63a[_0xdf01('0x21')](_0x44ce79);return _0x59d63a[_0xdf01('0x51')](new Buffer(_0x242500[_0xdf01('0x4a')]));}})[_0xdf01('0x42')](handleError(_0x59d63a,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a1521c1..16808b1 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 _0x7b38=['dir','lodash','../../config/logger','api','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages'];(function(_0x3fb328,_0x49282f){var _0x2781af=function(_0x1a2200){while(--_0x1a2200){_0x3fb328['push'](_0x3fb328['shift']());}};_0x2781af(++_0x49282f);}(_0x7b38,0x1e5));var _0x87b3=function(_0x417c99,_0x22d66f){_0x417c99=_0x417c99-0x0;var _0x2947e8=_0x7b38[_0x417c99];return _0x2947e8;};'use strict';var _=require(_0x87b3('0x0'));var util=require('util');var logger=require(_0x87b3('0x1'))(_0x87b3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x87b3('0x3'));var fs=require('fs');var path=require(_0x87b3('0x4'));var rimraf=require(_0x87b3('0x5'));var config=require('../../config/environment');var attributes=require(_0x87b3('0x6'));module[_0x87b3('0x7')]=function(_0x17a5f6,_0x55b8b3){return _0x17a5f6['define'](_0x87b3('0x8'),attributes,{'tableName':_0x87b3('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x87b3('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x071e=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./voiceMailMessage.attributes','exports','define','dir'];(function(_0x4bd979,_0x432846){var _0x2660eb=function(_0x26aeaf){while(--_0x26aeaf){_0x4bd979['push'](_0x4bd979['shift']());}};_0x2660eb(++_0x432846);}(_0x071e,0x1e4));var _0xe071=function(_0x25b821,_0x30e64f){_0x25b821=_0x25b821-0x0;var _0x42e13e=_0x071e[_0x25b821];return _0x42e13e;};'use strict';var _=require(_0xe071('0x0'));var util=require(_0xe071('0x1'));var logger=require(_0xe071('0x2'))(_0xe071('0x3'));var moment=require('moment');var BPromise=require(_0xe071('0x4'));var rp=require(_0xe071('0x5'));var fs=require('fs');var path=require(_0xe071('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe071('0x7'));module[_0xe071('0x8')]=function(_0x686688,_0x3d428b){return _0x686688[_0xe071('0x9')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xe071('0xa'),'fields':[_0xe071('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 1289e18..be411ed 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 _0x1b44=['error','code','message','result','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3a7cac,_0x1db945){var _0x32ca4e=function(_0x52ca66){while(--_0x52ca66){_0x3a7cac['push'](_0x3a7cac['shift']());}};_0x32ca4e(++_0x1db945);}(_0x1b44,0x15b));var _0x41b4=function(_0x27a04f,_0x8222e6){_0x27a04f=_0x27a04f-0x0;var _0x220ef1=_0x1b44[_0x27a04f];return _0x220ef1;};'use strict';var _=require('lodash');var util=require(_0x41b4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41b4('0x1'))['db'];var utils=require(_0x41b4('0x2'));var logger=require(_0x41b4('0x3'))(_0x41b4('0x4'));var config=require(_0x41b4('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x41b4('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xd43fa4,_0x48712f,_0x32f59f){return new BPromise(function(_0x2d8ed4,_0x457091){return client[_0x41b4('0x7')](_0xd43fa4,_0x32f59f)['then'](function(_0x42e6da){logger[_0x41b4('0x8')](_0x41b4('0x9'),_0x48712f,'request\x20sent');logger[_0x41b4('0xa')](_0x41b4('0xb'),_0x48712f,_0x41b4('0xc'),JSON['stringify'](_0x42e6da));if(_0x42e6da[_0x41b4('0xd')]){if(_0x42e6da[_0x41b4('0xd')][_0x41b4('0xe')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x48712f,_0x42e6da[_0x41b4('0xd')][_0x41b4('0xf')]);return _0x457091(_0x42e6da[_0x41b4('0xd')]['message']);}logger['error'](_0x41b4('0x9'),_0x48712f,_0x42e6da[_0x41b4('0xd')][_0x41b4('0xf')]);return _0x2d8ed4(_0x42e6da['error'][_0x41b4('0xf')]);}else{logger[_0x41b4('0x8')]('VoiceMailMessage,\x20%s,\x20%s',_0x48712f,_0x41b4('0xc'));_0x2d8ed4(_0x42e6da[_0x41b4('0x10')]['message']);}})[_0x41b4('0x11')](function(_0x38bbea){logger[_0x41b4('0xd')](_0x41b4('0x9'),_0x48712f,_0x38bbea);_0x457091(_0x38bbea);});});} \ No newline at end of file +var _0xe3db=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe3db,0xd5));var _0xbe3d=function(_0x54d2ea,_0x24f1ec){_0x54d2ea=_0x54d2ea-0x0;var _0x459d83=_0xe3db[_0x54d2ea];return _0x459d83;};'use strict';var _=require(_0xbe3d('0x0'));var util=require(_0xbe3d('0x1'));var moment=require(_0xbe3d('0x2'));var BPromise=require(_0xbe3d('0x3'));var rs=require(_0xbe3d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe3d('0x5'))['db'];var utils=require(_0xbe3d('0x6'));var logger=require(_0xbe3d('0x7'))(_0xbe3d('0x8'));var config=require('../../config/environment');var jayson=require(_0xbe3d('0x9'));var client=jayson[_0xbe3d('0xa')][_0xbe3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x482acf,_0x19f8d1,_0x5dd7b1){return new BPromise(function(_0x30ef57,_0x299758){return client[_0xbe3d('0xc')](_0x482acf,_0x5dd7b1)[_0xbe3d('0xd')](function(_0x1603aa){logger[_0xbe3d('0xe')](_0xbe3d('0xf'),_0x19f8d1,_0xbe3d('0x10'));logger[_0xbe3d('0x11')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x19f8d1,_0xbe3d('0x10'),JSON[_0xbe3d('0x12')](_0x1603aa));if(_0x1603aa[_0xbe3d('0x13')]){if(_0x1603aa[_0xbe3d('0x13')][_0xbe3d('0x14')]===0x1f4){logger[_0xbe3d('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x19f8d1,_0x1603aa['error'][_0xbe3d('0x15')]);return _0x299758(_0x1603aa[_0xbe3d('0x13')][_0xbe3d('0x15')]);}logger[_0xbe3d('0x13')](_0xbe3d('0xf'),_0x19f8d1,_0x1603aa[_0xbe3d('0x13')][_0xbe3d('0x15')]);return _0x30ef57(_0x1603aa['error'][_0xbe3d('0x15')]);}else{logger[_0xbe3d('0xe')](_0xbe3d('0xf'),_0x19f8d1,_0xbe3d('0x10'));_0x30ef57(_0x1603aa[_0xbe3d('0x16')]['message']);}})[_0xbe3d('0x17')](function(_0x2483f3){logger[_0xbe3d('0x13')](_0xbe3d('0xf'),_0x19f8d1,_0x2483f3);_0x299758(_0x2483f3);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 352e1d2..fb31c0d 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 _0xcba0=['isAuthenticated','index','/:id','show','/:id/sounds','post','create','put','update','delete','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get'];(function(_0x205e83,_0x2df5a4){var _0x10bb19=function(_0x41a375){while(--_0x41a375){_0x205e83['push'](_0x205e83['shift']());}};_0x10bb19(++_0x2df5a4);}(_0xcba0,0x1a5));var _0x0cba=function(_0x374966,_0x4396e5){_0x374966=_0x374966-0x0;var _0xa9121e=_0xcba0[_0x374966];return _0xa9121e;};'use strict';var multer=require(_0x0cba('0x0'));var util=require('util');var path=require(_0x0cba('0x1'));var timeout=require(_0x0cba('0x2'));var express=require(_0x0cba('0x3'));var router=express[_0x0cba('0x4')]();var fs_extra=require(_0x0cba('0x5'));var auth=require(_0x0cba('0x6'));var interaction=require(_0x0cba('0x7'));var config=require(_0x0cba('0x8'));var controller=require(_0x0cba('0x9'));router[_0x0cba('0xa')]('/',auth[_0x0cba('0xb')](),controller[_0x0cba('0xc')]);router[_0x0cba('0xa')](_0x0cba('0xd'),auth[_0x0cba('0xb')](),controller[_0x0cba('0xe')]);router[_0x0cba('0xa')](_0x0cba('0xf'),auth[_0x0cba('0xb')](),controller['getSounds']);router[_0x0cba('0x10')]('/',auth[_0x0cba('0xb')](),controller[_0x0cba('0x11')]);router[_0x0cba('0x10')]('/:id/sounds',auth[_0x0cba('0xb')](),controller['addSound']);router[_0x0cba('0x12')](_0x0cba('0xd'),auth['isAuthenticated'](),controller[_0x0cba('0x13')]);router['delete'](_0x0cba('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x0cba('0x14')](_0x0cba('0x15'),auth[_0x0cba('0xb')](),controller[_0x0cba('0x16')]);module[_0x0cba('0x17')]=router; \ No newline at end of file +var _0x1398=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','create','put','update','delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout'];(function(_0x5ac90f,_0x2c7902){var _0x5b6fd4=function(_0x47df20){while(--_0x47df20){_0x5ac90f['push'](_0x5ac90f['shift']());}};_0x5b6fd4(++_0x2c7902);}(_0x1398,0x178));var _0x8139=function(_0x531962,_0x373a9a){_0x531962=_0x531962-0x0;var _0x1f88c0=_0x1398[_0x531962];return _0x1f88c0;};'use strict';var multer=require(_0x8139('0x0'));var util=require(_0x8139('0x1'));var path=require(_0x8139('0x2'));var timeout=require(_0x8139('0x3'));var express=require(_0x8139('0x4'));var router=express['Router']();var fs_extra=require(_0x8139('0x5'));var auth=require(_0x8139('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8139('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x8139('0x8')]('/',auth[_0x8139('0x9')](),controller['index']);router[_0x8139('0x8')](_0x8139('0xa'),auth[_0x8139('0x9')](),controller['show']);router['get'](_0x8139('0xb'),auth[_0x8139('0x9')](),controller[_0x8139('0xc')]);router[_0x8139('0xd')]('/',auth[_0x8139('0x9')](),controller[_0x8139('0xe')]);router['post'](_0x8139('0xb'),auth[_0x8139('0x9')](),controller['addSound']);router[_0x8139('0xf')]('/:id',auth[_0x8139('0x9')](),controller[_0x8139('0x10')]);router[_0x8139('0x11')](_0x8139('0xa'),auth[_0x8139('0x9')](),controller['destroy']);router[_0x8139('0x11')](_0x8139('0x12'),auth[_0x8139('0x9')](),controller[_0x8139('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 4588093..c1162e4 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 _0xe076=['name','ENUM','custom','mp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x31d187,_0x45ba6b){var _0x3bc328=function(_0x1e61ad){while(--_0x1e61ad){_0x31d187['push'](_0x31d187['shift']());}};_0x3bc328(++_0x45ba6b);}(_0xe076,0x1b7));var _0x6e07=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe076[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x6e07('0x0'));module[_0x6e07('0x1')]={'name':{'type':Sequelize[_0x6e07('0x2')],'allowNull':![],'unique':_0x6e07('0x3')},'mode':{'type':Sequelize[_0x6e07('0x4')](_0x6e07('0x5'),'files',_0x6e07('0x6'),'quietmp3nb',_0x6e07('0x7'),_0x6e07('0x8')),'allowNull':!![],'defaultValue':_0x6e07('0x9')},'directory':{'type':Sequelize[_0x6e07('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x6e07('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e07('0xa')},'format':{'type':Sequelize[_0x6e07('0x2')],'allowNull':!![]},'stamp':{'type':_0x6e07('0xb')},'defaultEntry':{'type':Sequelize[_0x6e07('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb48=['mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xcb48,0x1cc));var _0x8cb4=function(_0x1d6e84,_0x57162d){_0x1d6e84=_0x1d6e84-0x0;var _0x2b60b0=_0xcb48[_0x1d6e84];return _0x2b60b0;};'use strict';var Sequelize=require(_0x8cb4('0x0'));module['exports']={'name':{'type':Sequelize[_0x8cb4('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x8cb4('0x2')](_0x8cb4('0x3'),_0x8cb4('0x4'),_0x8cb4('0x5'),_0x8cb4('0x6'),_0x8cb4('0x7'),_0x8cb4('0x8')),'allowNull':!![],'defaultValue':_0x8cb4('0x4')},'directory':{'type':Sequelize[_0x8cb4('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x8cb4('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8cb4('0x1')],'allowNull':!![],'defaultValue':_0x8cb4('0x9')},'format':{'type':Sequelize[_0x8cb4('0x1')],'allowNull':!![]},'stamp':{'type':_0x8cb4('0xa')},'defaultEntry':{'type':Sequelize[_0x8cb4('0xb')],'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 446393c..6bb6a26 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 _0x6e20=['update','body','create','sequelize','transaction','mode','join','server/files/moh','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','format','basename','extname','converted_format','root','symlinkSync','removeSound','id2','%s.%s','getSounds','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','reject','save','then','get','MusicOnHolds','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find'];(function(_0x354ecb,_0x1e1f92){var _0x4f1ca7=function(_0x4db646){while(--_0x4db646){_0x354ecb['push'](_0x354ecb['shift']());}};_0x4f1ca7(++_0x1e1f92);}(_0x6e20,0x93));var _0x06e2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6e20[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06e2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06e2('0x1'));var rp=require(_0x06e2('0x2'));var moment=require(_0x06e2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x06e2('0x4'));var util=require(_0x06e2('0x5'));var path=require(_0x06e2('0x6'));var sox=require(_0x06e2('0x7'));var csv=require(_0x06e2('0x8'));var ejs=require(_0x06e2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x06e2('0xa'));var crypto=require(_0x06e2('0xb'));var jsforce=require(_0x06e2('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x06e2('0xd'));var Papa=require('papaparse');var Redis=require(_0x06e2('0xe'));var authService=require(_0x06e2('0xf'));var qs=require(_0x06e2('0x10'));var as=require(_0x06e2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x06e2('0x12'))(_0x06e2('0x13'));var utils=require(_0x06e2('0x14'));var config=require(_0x06e2('0x15'));var licenseUtil=require(_0x06e2('0x16'));var db=require(_0x06e2('0x17'))['db'];function respondWithStatusCode(_0x899ae9,_0x23d0b6){_0x23d0b6=_0x23d0b6||0xcc;return function(_0x324f0f){if(_0x324f0f){return _0x899ae9['sendStatus'](_0x23d0b6);}return _0x899ae9[_0x06e2('0x18')](_0x23d0b6)[_0x06e2('0x19')]();};}function respondWithResult(_0x1634cb,_0x45142a){_0x45142a=_0x45142a||0xc8;return function(_0xb65453){if(_0xb65453){return _0x1634cb[_0x06e2('0x18')](_0x45142a)['json'](_0xb65453);}};}function respondWithFilteredResult(_0x180568,_0x2cc54e){return function(_0x5eaea9){if(_0x5eaea9){var _0x518703=typeof _0x2cc54e[_0x06e2('0x1a')]===_0x06e2('0x1b')&&typeof _0x2cc54e[_0x06e2('0x1c')]===_0x06e2('0x1b');var _0x4ff526=_0x5eaea9[_0x06e2('0x1d')];var _0x9438d4=_0x518703?0x0:_0x2cc54e[_0x06e2('0x1a')];var _0x2c1283=_0x518703?_0x5eaea9[_0x06e2('0x1d')]:_0x2cc54e[_0x06e2('0x1a')]+_0x2cc54e[_0x06e2('0x1c')];var _0x5cac4e;if(_0x2c1283>=_0x4ff526){_0x2c1283=_0x4ff526;_0x5cac4e=0xc8;}else{_0x5cac4e=0xce;}_0x180568[_0x06e2('0x18')](_0x5cac4e);return _0x180568[_0x06e2('0x1e')]('Content-Range',_0x9438d4+'-'+_0x2c1283+'/'+_0x4ff526)['json'](_0x5eaea9);}return null;};}function patchUpdates(_0x7c0d81){return function(_0xdefdea){try{jsonpatch['apply'](_0xdefdea,_0x7c0d81,!![]);}catch(_0x124f94){return BPromise[_0x06e2('0x1f')](_0x124f94);}return _0xdefdea[_0x06e2('0x20')]();};}function saveUpdates(_0x4cdfa0,_0x6601a2){return function(_0x54e884){if(_0x54e884){return _0x54e884['update'](_0x4cdfa0)[_0x06e2('0x21')](function(_0x4b5eeb){return _0x4b5eeb;});}return null;};}function removeEntity(_0x4ee2af,_0x2c089e){return function(_0x13115c){if(_0x13115c){return _0x13115c['destroy']()[_0x06e2('0x21')](function(){var _0x282793=_0x13115c[_0x06e2('0x22')]({'plain':!![]});var _0x497c16=_0x06e2('0x23');return db[_0x06e2('0x24')][_0x06e2('0x25')]({'where':{'type':_0x497c16,'resourceId':_0x282793['id']}})[_0x06e2('0x21')](function(){return _0x13115c;});})[_0x06e2('0x21')](function(){_0x4ee2af[_0x06e2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc4674,_0x462acd){return function(_0x1c3913){if(!_0x1c3913){_0xdc4674[_0x06e2('0x26')](0x194);}return _0x1c3913;};}function handleError(_0x4f0377,_0x3ddb8d){_0x3ddb8d=_0x3ddb8d||0x1f4;return function(_0xf13ced){logger['error'](_0xf13ced[_0x06e2('0x27')]);if(_0xf13ced[_0x06e2('0x28')]){delete _0xf13ced['name'];}_0x4f0377[_0x06e2('0x18')](_0x3ddb8d)[_0x06e2('0x29')](_0xf13ced);};}exports[_0x06e2('0x2a')]=function(_0x3e9af4,_0xb485c0){var _0x59a69b={},_0x484f47={},_0x5e45e7={'count':0x0,'rows':[]};var _0x57f7fd=_[_0x06e2('0x2b')](db[_0x06e2('0x2c')][_0x06e2('0x2d')],function(_0x4e6adb){return{'name':_0x4e6adb['fieldName'],'type':_0x4e6adb[_0x06e2('0x2e')]['key']};});_0x484f47[_0x06e2('0x2f')]=_[_0x06e2('0x2b')](_0x57f7fd,_0x06e2('0x28'));_0x484f47['query']=_[_0x06e2('0x30')](_0x3e9af4['query']);_0x484f47[_0x06e2('0x31')]=_[_0x06e2('0x32')](_0x484f47[_0x06e2('0x2f')],_0x484f47[_0x06e2('0x33')]);_0x59a69b['attributes']=_['intersection'](_0x484f47[_0x06e2('0x2f')],qs['fields'](_0x3e9af4[_0x06e2('0x33')][_0x06e2('0x34')]));_0x59a69b[_0x06e2('0x35')]=_0x59a69b[_0x06e2('0x35')][_0x06e2('0x36')]?_0x59a69b[_0x06e2('0x35')]:_0x484f47[_0x06e2('0x2f')];if(!_0x3e9af4['query'][_0x06e2('0x37')](_0x06e2('0x38'))){_0x59a69b[_0x06e2('0x1c')]=qs['limit'](_0x3e9af4[_0x06e2('0x33')]['limit']);_0x59a69b['offset']=qs[_0x06e2('0x1a')](_0x3e9af4['query'][_0x06e2('0x1a')]);}_0x59a69b['order']=qs[_0x06e2('0x39')](_0x3e9af4[_0x06e2('0x33')]['sort']);delete _0x3e9af4['query']['sort'];_0x59a69b['where']=qs[_0x06e2('0x31')](_[_0x06e2('0x3a')](_0x3e9af4[_0x06e2('0x33')],_0x484f47[_0x06e2('0x31')]),_0x57f7fd);if(_0x3e9af4['query'][_0x06e2('0x3b')]){_0x59a69b[_0x06e2('0x3c')]=_[_0x06e2('0x3d')](_0x59a69b[_0x06e2('0x3c')],{'$or':_['map'](_0x57f7fd,function(_0x542380){if(_0x542380[_0x06e2('0x2e')]!==_0x06e2('0x3e')){var _0xc1af9a={};_0xc1af9a[_0x542380[_0x06e2('0x28')]]={'$like':'%'+_0x3e9af4[_0x06e2('0x33')][_0x06e2('0x3b')]+'%'};return _0xc1af9a;}})});}_0x59a69b=_[_0x06e2('0x3d')]({},_0x59a69b,_0x3e9af4['options']);var _0x3f2ac5={'where':_0x59a69b['where']};return db[_0x06e2('0x2c')][_0x06e2('0x1d')](_0x3f2ac5)[_0x06e2('0x21')](function(_0x41549d){_0x5e45e7[_0x06e2('0x1d')]=_0x41549d;if(_0x3e9af4[_0x06e2('0x33')][_0x06e2('0x3f')]){_0x59a69b[_0x06e2('0x40')]=[{'all':!![]}];}return db[_0x06e2('0x2c')][_0x06e2('0x41')](_0x59a69b);})[_0x06e2('0x21')](function(_0x510147){_0x5e45e7[_0x06e2('0x42')]=_0x510147;return _0x5e45e7;})[_0x06e2('0x21')](respondWithFilteredResult(_0xb485c0,_0x59a69b))[_0x06e2('0x43')](handleError(_0xb485c0,null));};exports['show']=function(_0x122734,_0x212c15){var _0x2384d0={'raw':![],'where':{'id':_0x122734[_0x06e2('0x44')]['id']}},_0x156db9={};_0x156db9[_0x06e2('0x2f')]=_[_0x06e2('0x30')](db[_0x06e2('0x2c')][_0x06e2('0x2d')]);_0x156db9[_0x06e2('0x33')]=_['keys'](_0x122734[_0x06e2('0x33')]);_0x156db9[_0x06e2('0x31')]=_['intersection'](_0x156db9[_0x06e2('0x2f')],_0x156db9[_0x06e2('0x33')]);_0x2384d0[_0x06e2('0x35')]=_['intersection'](_0x156db9[_0x06e2('0x2f')],qs[_0x06e2('0x34')](_0x122734[_0x06e2('0x33')][_0x06e2('0x34')]));_0x2384d0[_0x06e2('0x35')]=_0x2384d0[_0x06e2('0x35')][_0x06e2('0x36')]?_0x2384d0['attributes']:_0x156db9[_0x06e2('0x2f')];if(_0x122734[_0x06e2('0x33')]['includeAll']){_0x2384d0[_0x06e2('0x40')]=[{'all':!![]}];}_0x2384d0=_['merge']({},_0x2384d0,_0x122734[_0x06e2('0x45')]);return db[_0x06e2('0x2c')][_0x06e2('0x46')](_0x2384d0)[_0x06e2('0x21')](handleEntityNotFound(_0x212c15,null))[_0x06e2('0x21')](respondWithResult(_0x212c15,null))[_0x06e2('0x43')](handleError(_0x212c15,null));};exports[_0x06e2('0x47')]=function(_0x39e2fd,_0x5b5783){if(_0x39e2fd[_0x06e2('0x48')]['id']){delete _0x39e2fd[_0x06e2('0x48')]['id'];}return db[_0x06e2('0x2c')]['find']({'where':{'id':_0x39e2fd['params']['id']}})[_0x06e2('0x21')](handleEntityNotFound(_0x5b5783,null))[_0x06e2('0x21')](saveUpdates(_0x39e2fd['body'],null))['then'](respondWithResult(_0x5b5783,null))[_0x06e2('0x43')](handleError(_0x5b5783,null));};exports[_0x06e2('0x49')]=function(_0x48e718,_0x56aca6,_0x18905f){return db[_0x06e2('0x4a')][_0x06e2('0x4b')](function(_0x5c4951){if(_0x48e718['body'][_0x06e2('0x4c')]==='files'){_0x48e718[_0x06e2('0x48')]['directory']=path[_0x06e2('0x4d')](config['root'],_0x06e2('0x4e'),_0x48e718[_0x06e2('0x48')]['name']);}return db[_0x06e2('0x2c')]['create'](_0x48e718[_0x06e2('0x48')],{'transaction':_0x5c4951})[_0x06e2('0x21')](function(_0xd729ce){if(_0x48e718['body']['mode']==='files'){fs[_0x06e2('0x4f')](_0xd729ce[_0x06e2('0x50')],parseInt(_0x06e2('0x51'),0x8));}var _0x307bec=_0x48e718[_0x06e2('0x52')][_0x06e2('0x22')]({'plain':!![]});if(!_0x307bec)throw new Error(_0x06e2('0x53'));if(_0x307bec[_0x06e2('0x54')]==='user'){var _0x481bce=_0xd729ce[_0x06e2('0x22')]({'plain':!![]});return db[_0x06e2('0x55')][_0x06e2('0x46')]({'where':{'name':_0x06e2('0x23'),'userProfileId':_0x307bec[_0x06e2('0x56')]},'raw':!![]})[_0x06e2('0x21')](function(_0x29dd04){if(_0x29dd04&&_0x29dd04['autoAssociation']===0x0){return db[_0x06e2('0x24')][_0x06e2('0x49')]({'name':_0x481bce['name'],'resourceId':_0x481bce['id'],'type':_0x29dd04['name'],'sectionId':_0x29dd04['id']},{})[_0x06e2('0x21')](function(){return _0xd729ce;});}else{return _0xd729ce;}})[_0x06e2('0x43')](function(_0x900f3e){logger[_0x06e2('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x900f3e);});}return _0xd729ce;});})[_0x06e2('0x21')](respondWithResult(_0x56aca6,0xc9))[_0x06e2('0x43')](handleError(_0x56aca6,null));};exports[_0x06e2('0x25')]=function(_0xa0b33d,_0x491f32,_0x5aa69d){var _0x55e9fa;return db[_0x06e2('0x2c')][_0x06e2('0x46')]({'where':{'id':_0xa0b33d['params']['id']}})[_0x06e2('0x21')](function(_0x1958cf){if(_0x1958cf){return db[_0x06e2('0x4a')][_0x06e2('0x4b')](function(_0x36dd14){return _0x1958cf[_0x06e2('0x25')]({'transaction':_0x36dd14,'raw':!![]})['then'](function(_0x4fcc4b){if(_0x4fcc4b['directory']){fs[_0x06e2('0x58')](_0x4fcc4b['directory'])['forEach'](function(_0x46924a){fs[_0x06e2('0x59')](path['join'](_0x4fcc4b[_0x06e2('0x50')],_0x46924a));});fs[_0x06e2('0x5a')](_0x4fcc4b[_0x06e2('0x50')]);}return _0x4fcc4b;});})['catch'](function(_0x81160b){throw new db[(_0x06e2('0x5b'))][(_0x06e2('0x5c'))](_0x81160b[_0x06e2('0x5d')]);});}})[_0x06e2('0x21')](handleEntityNotFound(_0x491f32,null))[_0x06e2('0x21')](removeEntity(_0x491f32,null))['catch'](handleError(_0x491f32,null));};exports[_0x06e2('0x5e')]=function(_0x199e06,_0x33b443,_0x57ba8c){return db[_0x06e2('0x4a')][_0x06e2('0x4b')](function(_0x35de91){var _0x41d0f5;return db[_0x06e2('0x2c')]['find']({'where':{'id':_0x199e06[_0x06e2('0x44')]['id']}})[_0x06e2('0x21')](function(_0x4ad188){if(_0x4ad188){_0x41d0f5=_0x4ad188;return _0x4ad188['addSound'](_0x199e06[_0x06e2('0x48')]['id'],{'transaction':_0x35de91});}})[_0x06e2('0x21')](function(_0x2db107){if(_0x2db107){return db[_0x06e2('0x5f')][_0x06e2('0x60')]({'where':{'id':_0x199e06[_0x06e2('0x48')]['id']},'attributes':['id','name',_0x06e2('0x61'),'converted_format',_0x06e2('0x62')],'raw':!![]});}})[_0x06e2('0x21')](function(_0x4f4110){if(_0x4f4110){var _0x1e2913=path[_0x06e2('0x4d')](config['root'],'server/files/sounds/converted',util[_0x06e2('0x63')]('%s.%s',path[_0x06e2('0x64')](_0x4f4110[_0x06e2('0x61')],path[_0x06e2('0x65')](_0x4f4110['save_name'])),_0x4f4110[_0x06e2('0x66')]));var _0x57f6f3=path[_0x06e2('0x4d')](config[_0x06e2('0x67')],'server/files/moh',_0x41d0f5[_0x06e2('0x28')],util[_0x06e2('0x63')]('%s.%s',_0x4f4110[_0x06e2('0x28')],_0x4f4110[_0x06e2('0x66')]));fs[_0x06e2('0x68')](_0x1e2913,_0x57f6f3);return _0x4f4110;}})[_0x06e2('0x43')](function(_0xd28ab5){throw new db['Sequelize'][(_0x06e2('0x5c'))](_0xd28ab5[_0x06e2('0x5d')]);});})['then'](handleEntityNotFound(_0x33b443,null))[_0x06e2('0x21')](respondWithResult(_0x33b443,0xc9))[_0x06e2('0x43')](handleError(_0x33b443,null));};exports[_0x06e2('0x69')]=function(_0x241303,_0xe24d79,_0x47c797){return db[_0x06e2('0x4a')][_0x06e2('0x4b')](function(_0x18c45f){var _0x99b43d;return db[_0x06e2('0x2c')]['findOne']({'where':{'id':_0x241303[_0x06e2('0x44')]['id']}})['then'](handleEntityNotFound(_0xe24d79,null))['then'](function(_0x22df4d){if(_0x22df4d){_0x99b43d=_0x22df4d;return _0x22df4d['removeSound'](_0x241303[_0x06e2('0x44')][_0x06e2('0x6a')]);}})[_0x06e2('0x21')](function(_0x321a24){if(_0x321a24){return db[_0x06e2('0x5f')]['findOne']({'where':{'id':_0x241303[_0x06e2('0x44')][_0x06e2('0x6a')]},'attributes':['id',_0x06e2('0x28'),_0x06e2('0x61'),_0x06e2('0x66'),_0x06e2('0x62')],'raw':!![]});}})[_0x06e2('0x21')](function(_0x37d6db){if(_0x37d6db){fs[_0x06e2('0x59')](path[_0x06e2('0x4d')](_0x99b43d[_0x06e2('0x50')],util[_0x06e2('0x63')](_0x06e2('0x6b'),_0x37d6db[_0x06e2('0x28')],_0x37d6db[_0x06e2('0x66')])));return _0x37d6db;}})[_0x06e2('0x43')](function(_0x53304e){throw new db['Sequelize'][(_0x06e2('0x5c'))](_0x53304e['message']);});})[_0x06e2('0x21')](handleEntityNotFound(_0xe24d79,null))[_0x06e2('0x21')](respondWithStatusCode(_0xe24d79,0xcc))[_0x06e2('0x43')](handleError(_0xe24d79,null));};exports['getSounds']=function(_0x376aed,_0x10149f,_0x1a817e){var _0x1482ea={};var _0x48ed0c={};var _0x1953fe;var _0x596a02;return db[_0x06e2('0x2c')]['findOne']({'where':{'id':_0x376aed['params']['id']}})['then'](handleEntityNotFound(_0x10149f,null))[_0x06e2('0x21')](function(_0x3a2b10){if(_0x3a2b10){_0x1953fe=_0x3a2b10;_0x48ed0c[_0x06e2('0x2f')]=_['keys'](db[_0x06e2('0x5f')][_0x06e2('0x2d')]);_0x48ed0c[_0x06e2('0x33')]=_['keys'](_0x376aed['query']);_0x48ed0c['filters']=_[_0x06e2('0x32')](_0x48ed0c[_0x06e2('0x2f')],_0x48ed0c['query']);_0x1482ea[_0x06e2('0x35')]=_[_0x06e2('0x32')](_0x48ed0c[_0x06e2('0x2f')],qs['fields'](_0x376aed[_0x06e2('0x33')][_0x06e2('0x34')]));_0x1482ea[_0x06e2('0x35')]=_0x1482ea[_0x06e2('0x35')]['length']?_0x1482ea[_0x06e2('0x35')]:_0x48ed0c[_0x06e2('0x2f')];_0x1482ea['order']=qs['sort'](_0x376aed[_0x06e2('0x33')][_0x06e2('0x39')]);_0x1482ea[_0x06e2('0x3c')]=qs[_0x06e2('0x31')](_[_0x06e2('0x3a')](_0x376aed[_0x06e2('0x33')],_0x48ed0c[_0x06e2('0x31')]));if(_0x376aed[_0x06e2('0x33')][_0x06e2('0x3b')]){_0x1482ea[_0x06e2('0x3c')]=_['merge'](_0x1482ea[_0x06e2('0x3c')],{'$or':_['map'](_0x1482ea[_0x06e2('0x35')],function(_0x5c3f7a){var _0x4d22cb={};_0x4d22cb[_0x5c3f7a]={'$like':'%'+_0x376aed[_0x06e2('0x33')][_0x06e2('0x3b')]+'%'};return _0x4d22cb;})});}_0x1482ea=_[_0x06e2('0x3d')]({},_0x1482ea,_0x376aed[_0x06e2('0x45')]);return _0x1953fe[_0x06e2('0x6c')](_0x1482ea);}})[_0x06e2('0x21')](function(_0x4a0c81){if(_0x4a0c81){_0x596a02=_0x4a0c81[_0x06e2('0x36')];if(!_0x376aed[_0x06e2('0x33')][_0x06e2('0x37')](_0x06e2('0x38'))){_0x1482ea[_0x06e2('0x1c')]=qs['limit'](_0x376aed[_0x06e2('0x33')][_0x06e2('0x1c')]);_0x1482ea[_0x06e2('0x1a')]=qs['offset'](_0x376aed[_0x06e2('0x33')]['offset']);}return _0x1953fe[_0x06e2('0x6c')](_0x1482ea);}})['then'](function(_0x51bf7f){if(_0x51bf7f){return _0x51bf7f?{'count':_0x596a02,'rows':_0x51bf7f}:null;}})['then'](respondWithResult(_0x10149f,null))[_0x06e2('0x43')](handleError(_0x10149f,null));}; \ No newline at end of file +var _0x7687=['readdirSync','forEach','unlinkSync','ValidationError','message','addSound','transaction','findOne','createdAt','format','%s.%s','extname','save_name','converted_format','removeSound','sequelize','id2','Sequelize','getSounds','Sound','order','length','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','UserProfileResource','end','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','include','find','catch','body','mode','join','root','server/files/moh','create','files','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy'];(function(_0x3b5dbc,_0x215972){var _0x185efd=function(_0x56bdd3){while(--_0x56bdd3){_0x3b5dbc['push'](_0x3b5dbc['shift']());}};_0x185efd(++_0x215972);}(_0x7687,0x1db));var _0x7768=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x7687[_0x581af1];return _0x54c22e;};'use strict';var emlformat=require(_0x7768('0x0'));var rimraf=require(_0x7768('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7768('0x2'));var rp=require(_0x7768('0x3'));var moment=require(_0x7768('0x4'));var BPromise=require(_0x7768('0x5'));var Mustache=require(_0x7768('0x6'));var util=require(_0x7768('0x7'));var path=require(_0x7768('0x8'));var sox=require(_0x7768('0x9'));var csv=require(_0x7768('0xa'));var ejs=require(_0x7768('0xb'));var fs=require('fs');var fs_extra=require(_0x7768('0xc'));var _=require(_0x7768('0xd'));var squel=require(_0x7768('0xe'));var crypto=require(_0x7768('0xf'));var jsforce=require(_0x7768('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7768('0x11'));var Papa=require(_0x7768('0x12'));var Redis=require(_0x7768('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7768('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7768('0x15'))(_0x7768('0x16'));var utils=require(_0x7768('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7768('0x18'));var db=require(_0x7768('0x19'))['db'];function respondWithStatusCode(_0x141dd6,_0x33f7da){_0x33f7da=_0x33f7da||0xcc;return function(_0xb15a41){if(_0xb15a41){return _0x141dd6[_0x7768('0x1a')](_0x33f7da);}return _0x141dd6[_0x7768('0x1b')](_0x33f7da)['end']();};}function respondWithResult(_0x4c273e,_0x525a59){_0x525a59=_0x525a59||0xc8;return function(_0x225f07){if(_0x225f07){return _0x4c273e['status'](_0x525a59)[_0x7768('0x1c')](_0x225f07);}};}function respondWithFilteredResult(_0x36da68,_0x267246){return function(_0x53b44c){if(_0x53b44c){var _0x3ba41c=typeof _0x267246[_0x7768('0x1d')]===_0x7768('0x1e')&&typeof _0x267246[_0x7768('0x1f')]===_0x7768('0x1e');var _0xebb1f=_0x53b44c['count'];var _0x1ba892=_0x3ba41c?0x0:_0x267246[_0x7768('0x1d')];var _0x9b144=_0x3ba41c?_0x53b44c[_0x7768('0x20')]:_0x267246[_0x7768('0x1d')]+_0x267246[_0x7768('0x1f')];var _0x275946;if(_0x9b144>=_0xebb1f){_0x9b144=_0xebb1f;_0x275946=0xc8;}else{_0x275946=0xce;}_0x36da68['status'](_0x275946);return _0x36da68['set'](_0x7768('0x21'),_0x1ba892+'-'+_0x9b144+'/'+_0xebb1f)[_0x7768('0x1c')](_0x53b44c);}return null;};}function patchUpdates(_0x4e0a4f){return function(_0x28e4bc){try{jsonpatch['apply'](_0x28e4bc,_0x4e0a4f,!![]);}catch(_0x574152){return BPromise[_0x7768('0x22')](_0x574152);}return _0x28e4bc[_0x7768('0x23')]();};}function saveUpdates(_0x266471,_0x250f66){return function(_0x5a9ead){if(_0x5a9ead){return _0x5a9ead[_0x7768('0x24')](_0x266471)[_0x7768('0x25')](function(_0x40ecad){return _0x40ecad;});}return null;};}function removeEntity(_0x155700,_0x2954ef){return function(_0x1720af){if(_0x1720af){return _0x1720af['destroy']()['then'](function(){var _0xd36691=_0x1720af[_0x7768('0x26')]({'plain':!![]});var _0x901fb='MusicOnHolds';return db[_0x7768('0x27')]['destroy']({'where':{'type':_0x901fb,'resourceId':_0xd36691['id']}})[_0x7768('0x25')](function(){return _0x1720af;});})[_0x7768('0x25')](function(){_0x155700[_0x7768('0x1b')](0xcc)[_0x7768('0x28')]();});}};}function handleEntityNotFound(_0x2b392e,_0x75553){return function(_0x1c82ed){if(!_0x1c82ed){_0x2b392e[_0x7768('0x1a')](0x194);}return _0x1c82ed;};}function handleError(_0x24d821,_0x12808f){_0x12808f=_0x12808f||0x1f4;return function(_0x8cbfa5){logger['error'](_0x8cbfa5[_0x7768('0x29')]);if(_0x8cbfa5['name']){delete _0x8cbfa5[_0x7768('0x2a')];}_0x24d821[_0x7768('0x1b')](_0x12808f)[_0x7768('0x2b')](_0x8cbfa5);};}exports[_0x7768('0x2c')]=function(_0x42c37b,_0x26402e){var _0x2d3de8={},_0x15aaa0={},_0x4cebbf={'count':0x0,'rows':[]};var _0x2e10c2=_[_0x7768('0x2d')](db[_0x7768('0x2e')][_0x7768('0x2f')],function(_0x3b11bf){return{'name':_0x3b11bf[_0x7768('0x30')],'type':_0x3b11bf[_0x7768('0x31')]['key']};});_0x15aaa0[_0x7768('0x32')]=_[_0x7768('0x2d')](_0x2e10c2,_0x7768('0x2a'));_0x15aaa0[_0x7768('0x33')]=_[_0x7768('0x34')](_0x42c37b[_0x7768('0x33')]);_0x15aaa0[_0x7768('0x35')]=_[_0x7768('0x36')](_0x15aaa0['model'],_0x15aaa0[_0x7768('0x33')]);_0x2d3de8['attributes']=_[_0x7768('0x36')](_0x15aaa0[_0x7768('0x32')],qs[_0x7768('0x37')](_0x42c37b[_0x7768('0x33')]['fields']));_0x2d3de8[_0x7768('0x38')]=_0x2d3de8[_0x7768('0x38')]['length']?_0x2d3de8[_0x7768('0x38')]:_0x15aaa0[_0x7768('0x32')];if(!_0x42c37b['query'][_0x7768('0x39')]('nolimit')){_0x2d3de8[_0x7768('0x1f')]=qs[_0x7768('0x1f')](_0x42c37b[_0x7768('0x33')][_0x7768('0x1f')]);_0x2d3de8[_0x7768('0x1d')]=qs[_0x7768('0x1d')](_0x42c37b[_0x7768('0x33')][_0x7768('0x1d')]);}_0x2d3de8['order']=qs[_0x7768('0x3a')](_0x42c37b[_0x7768('0x33')][_0x7768('0x3a')]);delete _0x42c37b[_0x7768('0x33')]['sort'];_0x2d3de8['where']=qs[_0x7768('0x35')](_[_0x7768('0x3b')](_0x42c37b[_0x7768('0x33')],_0x15aaa0[_0x7768('0x35')]),_0x2e10c2);if(_0x42c37b[_0x7768('0x33')]['filter']){_0x2d3de8[_0x7768('0x3c')]=_[_0x7768('0x3d')](_0x2d3de8[_0x7768('0x3c')],{'$or':_[_0x7768('0x2d')](_0x2e10c2,function(_0x486c18){if(_0x486c18[_0x7768('0x31')]!==_0x7768('0x3e')){var _0x380871={};_0x380871[_0x486c18[_0x7768('0x2a')]]={'$like':'%'+_0x42c37b[_0x7768('0x33')][_0x7768('0x3f')]+'%'};return _0x380871;}})});}_0x2d3de8=_[_0x7768('0x3d')]({},_0x2d3de8,_0x42c37b[_0x7768('0x40')]);var _0x16169f={'where':_0x2d3de8[_0x7768('0x3c')]};return db[_0x7768('0x2e')]['count'](_0x16169f)['then'](function(_0x59c153){_0x4cebbf[_0x7768('0x20')]=_0x59c153;if(_0x42c37b[_0x7768('0x33')][_0x7768('0x41')]){_0x2d3de8['include']=[{'all':!![]}];}return db[_0x7768('0x2e')][_0x7768('0x42')](_0x2d3de8);})[_0x7768('0x25')](function(_0x5d370e){_0x4cebbf[_0x7768('0x43')]=_0x5d370e;return _0x4cebbf;})[_0x7768('0x25')](respondWithFilteredResult(_0x26402e,_0x2d3de8))['catch'](handleError(_0x26402e,null));};exports['show']=function(_0x20506c,_0x16f342){var _0x16a9d0={'raw':![],'where':{'id':_0x20506c[_0x7768('0x44')]['id']}},_0x588d9f={};_0x588d9f['model']=_[_0x7768('0x34')](db[_0x7768('0x2e')][_0x7768('0x2f')]);_0x588d9f[_0x7768('0x33')]=_[_0x7768('0x34')](_0x20506c[_0x7768('0x33')]);_0x588d9f[_0x7768('0x35')]=_['intersection'](_0x588d9f[_0x7768('0x32')],_0x588d9f[_0x7768('0x33')]);_0x16a9d0[_0x7768('0x38')]=_[_0x7768('0x36')](_0x588d9f[_0x7768('0x32')],qs[_0x7768('0x37')](_0x20506c[_0x7768('0x33')][_0x7768('0x37')]));_0x16a9d0[_0x7768('0x38')]=_0x16a9d0[_0x7768('0x38')]['length']?_0x16a9d0[_0x7768('0x38')]:_0x588d9f[_0x7768('0x32')];if(_0x20506c['query'][_0x7768('0x41')]){_0x16a9d0[_0x7768('0x45')]=[{'all':!![]}];}_0x16a9d0=_[_0x7768('0x3d')]({},_0x16a9d0,_0x20506c[_0x7768('0x40')]);return db[_0x7768('0x2e')][_0x7768('0x46')](_0x16a9d0)[_0x7768('0x25')](handleEntityNotFound(_0x16f342,null))[_0x7768('0x25')](respondWithResult(_0x16f342,null))[_0x7768('0x47')](handleError(_0x16f342,null));};exports['update']=function(_0x1a129e,_0xd17002){if(_0x1a129e[_0x7768('0x48')]['id']){delete _0x1a129e[_0x7768('0x48')]['id'];}return db[_0x7768('0x2e')]['find']({'where':{'id':_0x1a129e[_0x7768('0x44')]['id']}})[_0x7768('0x25')](handleEntityNotFound(_0xd17002,null))[_0x7768('0x25')](saveUpdates(_0x1a129e['body'],null))['then'](respondWithResult(_0xd17002,null))[_0x7768('0x47')](handleError(_0xd17002,null));};exports['create']=function(_0x5288e8,_0x319a98,_0x2152e8){return db['sequelize']['transaction'](function(_0x2539a6){if(_0x5288e8[_0x7768('0x48')][_0x7768('0x49')]==='files'){_0x5288e8[_0x7768('0x48')]['directory']=path[_0x7768('0x4a')](config[_0x7768('0x4b')],_0x7768('0x4c'),_0x5288e8[_0x7768('0x48')]['name']);}return db[_0x7768('0x2e')][_0x7768('0x4d')](_0x5288e8[_0x7768('0x48')],{'transaction':_0x2539a6})[_0x7768('0x25')](function(_0x4ea8a0){if(_0x5288e8[_0x7768('0x48')][_0x7768('0x49')]===_0x7768('0x4e')){fs[_0x7768('0x4f')](_0x4ea8a0[_0x7768('0x50')],parseInt(_0x7768('0x51'),0x8));}var _0x3f5175=_0x5288e8[_0x7768('0x52')][_0x7768('0x26')]({'plain':!![]});if(!_0x3f5175)throw new Error(_0x7768('0x53'));if(_0x3f5175[_0x7768('0x54')]==='user'){var _0x577864=_0x4ea8a0['get']({'plain':!![]});return db[_0x7768('0x55')][_0x7768('0x46')]({'where':{'name':_0x7768('0x56'),'userProfileId':_0x3f5175['userProfileId']},'raw':!![]})[_0x7768('0x25')](function(_0x22c330){if(_0x22c330&&_0x22c330['autoAssociation']===0x0){return db['UserProfileResource'][_0x7768('0x4d')]({'name':_0x577864['name'],'resourceId':_0x577864['id'],'type':_0x22c330[_0x7768('0x2a')],'sectionId':_0x22c330['id']},{})['then'](function(){return _0x4ea8a0;});}else{return _0x4ea8a0;}})['catch'](function(_0x393b2f){logger[_0x7768('0x57')](_0x7768('0x58'),_0x393b2f);});}return _0x4ea8a0;});})[_0x7768('0x25')](respondWithResult(_0x319a98,0xc9))[_0x7768('0x47')](handleError(_0x319a98,null));};exports[_0x7768('0x59')]=function(_0x32e9d4,_0x23de00,_0x17909d){var _0x336834;return db['VoiceMusicOnHold'][_0x7768('0x46')]({'where':{'id':_0x32e9d4[_0x7768('0x44')]['id']}})['then'](function(_0x5dda46){if(_0x5dda46){return db['sequelize']['transaction'](function(_0x188740){return _0x5dda46[_0x7768('0x59')]({'transaction':_0x188740,'raw':!![]})[_0x7768('0x25')](function(_0x3339cd){if(_0x3339cd[_0x7768('0x50')]){fs[_0x7768('0x5a')](_0x3339cd[_0x7768('0x50')])[_0x7768('0x5b')](function(_0x56b22f){fs[_0x7768('0x5c')](path[_0x7768('0x4a')](_0x3339cd['directory'],_0x56b22f));});fs['rmdirSync'](_0x3339cd['directory']);}return _0x3339cd;});})['catch'](function(_0x4da73b){throw new db['Sequelize'][(_0x7768('0x5d'))](_0x4da73b[_0x7768('0x5e')]);});}})[_0x7768('0x25')](handleEntityNotFound(_0x23de00,null))[_0x7768('0x25')](removeEntity(_0x23de00,null))[_0x7768('0x47')](handleError(_0x23de00,null));};exports[_0x7768('0x5f')]=function(_0x14f810,_0x55827a,_0x2f008c){return db['sequelize'][_0x7768('0x60')](function(_0x4142f8){var _0x5a5296;return db['VoiceMusicOnHold'][_0x7768('0x46')]({'where':{'id':_0x14f810[_0x7768('0x44')]['id']}})['then'](function(_0x44cea2){if(_0x44cea2){_0x5a5296=_0x44cea2;return _0x44cea2[_0x7768('0x5f')](_0x14f810['body']['id'],{'transaction':_0x4142f8});}})['then'](function(_0xa76b7a){if(_0xa76b7a){return db['Sound'][_0x7768('0x61')]({'where':{'id':_0x14f810[_0x7768('0x48')]['id']},'attributes':['id','name','save_name','converted_format',_0x7768('0x62')],'raw':!![]});}})[_0x7768('0x25')](function(_0x4c9b42){if(_0x4c9b42){var _0x1f12c0=path['join'](config[_0x7768('0x4b')],'server/files/sounds/converted',util[_0x7768('0x63')](_0x7768('0x64'),path['basename'](_0x4c9b42['save_name'],path[_0x7768('0x65')](_0x4c9b42[_0x7768('0x66')])),_0x4c9b42[_0x7768('0x67')]));var _0x3f4c6f=path['join'](config['root'],_0x7768('0x4c'),_0x5a5296[_0x7768('0x2a')],util[_0x7768('0x63')](_0x7768('0x64'),_0x4c9b42[_0x7768('0x2a')],_0x4c9b42[_0x7768('0x67')]));fs['symlinkSync'](_0x1f12c0,_0x3f4c6f);return _0x4c9b42;}})[_0x7768('0x47')](function(_0x484752){throw new db['Sequelize'][(_0x7768('0x5d'))](_0x484752['message']);});})[_0x7768('0x25')](handleEntityNotFound(_0x55827a,null))['then'](respondWithResult(_0x55827a,0xc9))[_0x7768('0x47')](handleError(_0x55827a,null));};exports[_0x7768('0x68')]=function(_0x10ef7e,_0x154e8d,_0x5513e4){return db[_0x7768('0x69')][_0x7768('0x60')](function(_0x499251){var _0x2ad742;return db[_0x7768('0x2e')][_0x7768('0x61')]({'where':{'id':_0x10ef7e[_0x7768('0x44')]['id']}})['then'](handleEntityNotFound(_0x154e8d,null))['then'](function(_0x4febe9){if(_0x4febe9){_0x2ad742=_0x4febe9;return _0x4febe9[_0x7768('0x68')](_0x10ef7e['params']['id2']);}})[_0x7768('0x25')](function(_0x261bfc){if(_0x261bfc){return db['Sound']['findOne']({'where':{'id':_0x10ef7e[_0x7768('0x44')][_0x7768('0x6a')]},'attributes':['id','name',_0x7768('0x66'),_0x7768('0x67'),_0x7768('0x62')],'raw':!![]});}})['then'](function(_0x52cda3){if(_0x52cda3){fs['unlinkSync'](path['join'](_0x2ad742[_0x7768('0x50')],util['format'](_0x7768('0x64'),_0x52cda3[_0x7768('0x2a')],_0x52cda3['converted_format'])));return _0x52cda3;}})[_0x7768('0x47')](function(_0x2e5eea){throw new db[(_0x7768('0x6b'))][(_0x7768('0x5d'))](_0x2e5eea[_0x7768('0x5e')]);});})['then'](handleEntityNotFound(_0x154e8d,null))['then'](respondWithStatusCode(_0x154e8d,0xcc))[_0x7768('0x47')](handleError(_0x154e8d,null));};exports[_0x7768('0x6c')]=function(_0x473d05,_0x1682bb,_0x312dba){var _0xb368fb={};var _0x4120b5={};var _0x27690b;var _0xcc478c;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x473d05['params']['id']}})['then'](handleEntityNotFound(_0x1682bb,null))[_0x7768('0x25')](function(_0x3859b8){if(_0x3859b8){_0x27690b=_0x3859b8;_0x4120b5[_0x7768('0x32')]=_[_0x7768('0x34')](db[_0x7768('0x6d')]['rawAttributes']);_0x4120b5[_0x7768('0x33')]=_[_0x7768('0x34')](_0x473d05['query']);_0x4120b5[_0x7768('0x35')]=_[_0x7768('0x36')](_0x4120b5[_0x7768('0x32')],_0x4120b5[_0x7768('0x33')]);_0xb368fb[_0x7768('0x38')]=_[_0x7768('0x36')](_0x4120b5[_0x7768('0x32')],qs['fields'](_0x473d05['query'][_0x7768('0x37')]));_0xb368fb[_0x7768('0x38')]=_0xb368fb['attributes']['length']?_0xb368fb[_0x7768('0x38')]:_0x4120b5[_0x7768('0x32')];_0xb368fb[_0x7768('0x6e')]=qs[_0x7768('0x3a')](_0x473d05[_0x7768('0x33')][_0x7768('0x3a')]);_0xb368fb[_0x7768('0x3c')]=qs[_0x7768('0x35')](_[_0x7768('0x3b')](_0x473d05[_0x7768('0x33')],_0x4120b5[_0x7768('0x35')]));if(_0x473d05[_0x7768('0x33')]['filter']){_0xb368fb[_0x7768('0x3c')]=_['merge'](_0xb368fb[_0x7768('0x3c')],{'$or':_[_0x7768('0x2d')](_0xb368fb[_0x7768('0x38')],function(_0x273907){var _0x11a084={};_0x11a084[_0x273907]={'$like':'%'+_0x473d05['query']['filter']+'%'};return _0x11a084;})});}_0xb368fb=_[_0x7768('0x3d')]({},_0xb368fb,_0x473d05[_0x7768('0x40')]);return _0x27690b[_0x7768('0x6c')](_0xb368fb);}})[_0x7768('0x25')](function(_0x333fa9){if(_0x333fa9){_0xcc478c=_0x333fa9[_0x7768('0x6f')];if(!_0x473d05[_0x7768('0x33')][_0x7768('0x39')](_0x7768('0x70'))){_0xb368fb[_0x7768('0x1f')]=qs[_0x7768('0x1f')](_0x473d05['query'][_0x7768('0x1f')]);_0xb368fb[_0x7768('0x1d')]=qs[_0x7768('0x1d')](_0x473d05[_0x7768('0x33')][_0x7768('0x1d')]);}return _0x27690b['getSounds'](_0xb368fb);}})[_0x7768('0x25')](function(_0x5255bb){if(_0x5255bb){return _0x5255bb?{'count':_0xcc478c,'rows':_0x5255bb}:null;}})['then'](respondWithResult(_0x1682bb,null))[_0x7768('0x47')](handleError(_0x1682bb,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index b3c3db1..d799e4e 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 _0x9b27=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x9b27,0x1bf));var _0x79b2=function(_0x11afe7,_0x2dcbae){_0x11afe7=_0x11afe7-0x0;var _0x2967b5=_0x9b27[_0x11afe7];return _0x2967b5;};'use strict';var _=require(_0x79b2('0x0'));var util=require(_0x79b2('0x1'));var logger=require(_0x79b2('0x2'))(_0x79b2('0x3'));var moment=require(_0x79b2('0x4'));var BPromise=require(_0x79b2('0x5'));var rp=require(_0x79b2('0x6'));var fs=require('fs');var path=require(_0x79b2('0x7'));var rimraf=require(_0x79b2('0x8'));var config=require(_0x79b2('0x9'));var attributes=require(_0x79b2('0xa'));module['exports']=function(_0x555098,_0x10c677){return _0x555098[_0x79b2('0xb')](_0x79b2('0xc'),attributes,{'tableName':_0x79b2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc253=['../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0xc253,0xeb));var _0x3c25=function(_0x1c1b8c,_0x4c253d){_0x1c1b8c=_0x1c1b8c-0x0;var _0x1ee4c4=_0xc253[_0x1c1b8c];return _0x1ee4c4;};'use strict';var _=require(_0x3c25('0x0'));var util=require(_0x3c25('0x1'));var logger=require(_0x3c25('0x2'))(_0x3c25('0x3'));var moment=require(_0x3c25('0x4'));var BPromise=require('bluebird');var rp=require(_0x3c25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c25('0x6'));var config=require(_0x3c25('0x7'));var attributes=require(_0x3c25('0x8'));module['exports']=function(_0x5e4ac2,_0x489208){return _0x5e4ac2[_0x3c25('0x9')](_0x3c25('0xa'),attributes,{'tableName':'voice_musiconhold','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 02d0fa9..cd62ec7 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(_0x3ffb02,_0x59bc94){var _0x5145dc=function(_0x596cfd){while(--_0x596cfd){_0x3ffb02['push'](_0x3ffb02['shift']());}};_0x5145dc(++_0x59bc94);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0xcb91[_0x3474ac];return _0x5345ec;};'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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x11a8ae,_0x21ccb9){var _0x49d68b=function(_0x1d8596){while(--_0x1d8596){_0x11a8ae['push'](_0x11a8ae['shift']());}};_0x49d68b(++_0x21ccb9);}(_0x34e8,0x12c));var _0x834e=function(_0x1cb43d,_0x2c5fb8){_0x1cb43d=_0x1cb43d-0x0;var _0x4e8343=_0x34e8[_0x1cb43d];return _0x4e8343;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 09455c2..d9db45b 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 _0x956a=['index','/describe','describe','/:id','show','/:id/users','/:id/teams','post','create','addAgents','update','destroy','removeAgents','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x46063c,_0x213fa0){var _0x270150=function(_0x2c518f){while(--_0x2c518f){_0x46063c['push'](_0x46063c['shift']());}};_0x270150(++_0x213fa0);}(_0x956a,0xb6));var _0xa956=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x956a[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xa956('0x0'));var path=require(_0xa956('0x1'));var timeout=require(_0xa956('0x2'));var express=require(_0xa956('0x3'));var router=express[_0xa956('0x4')]();var fs_extra=require(_0xa956('0x5'));var auth=require(_0xa956('0x6'));var interaction=require(_0xa956('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xa956('0x8')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0xa')]);router['get'](_0xa956('0xb'),auth[_0xa956('0x9')](),controller[_0xa956('0xc')]);router[_0xa956('0x8')](_0xa956('0xd'),auth[_0xa956('0x9')](),controller[_0xa956('0xe')]);router['get'](_0xa956('0xf'),auth[_0xa956('0x9')](),controller['getAgents']);router[_0xa956('0x8')](_0xa956('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa956('0x11')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0x12')]);router['post'](_0xa956('0xf'),auth[_0xa956('0x9')](),controller[_0xa956('0x13')]);router['post']('/:id/teams',auth[_0xa956('0x9')](),controller['addTeams']);router['put'](_0xa956('0xd'),auth[_0xa956('0x9')](),controller[_0xa956('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa956('0x15')]);router['delete'](_0xa956('0xf'),auth[_0xa956('0x9')](),controller[_0xa956('0x16')]);router[_0xa956('0x17')](_0xa956('0x10'),auth[_0xa956('0x9')](),controller['removeTeams']);module['exports']=router; \ No newline at end of file +var _0xaab2=['../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','create','addTeams','put','update','destroy','/:id/users','removeAgents','delete','removeTeams','exports','path','connect-timeout','express','fs-extra'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0xaab2,0x15b));var _0x2aab=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaab2[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2aab('0x0'));var timeout=require(_0x2aab('0x1'));var express=require(_0x2aab('0x2'));var router=express['Router']();var fs_extra=require(_0x2aab('0x3'));var auth=require(_0x2aab('0x4'));var interaction=require(_0x2aab('0x5'));var config=require('../../config/environment');var controller=require(_0x2aab('0x6'));router[_0x2aab('0x7')]('/',auth[_0x2aab('0x8')](),controller[_0x2aab('0x9')]);router[_0x2aab('0x7')](_0x2aab('0xa'),auth[_0x2aab('0x8')](),controller[_0x2aab('0xb')]);router[_0x2aab('0x7')](_0x2aab('0xc'),auth[_0x2aab('0x8')](),controller[_0x2aab('0xd')]);router[_0x2aab('0x7')]('/:id/users',auth[_0x2aab('0x8')](),controller[_0x2aab('0xe')]);router[_0x2aab('0x7')](_0x2aab('0xf'),auth[_0x2aab('0x8')](),controller[_0x2aab('0x10')]);router['post']('/',auth[_0x2aab('0x8')](),controller[_0x2aab('0x11')]);router['post']('/:id/users',auth[_0x2aab('0x8')](),controller['addAgents']);router['post'](_0x2aab('0xf'),auth['isAuthenticated'](),controller[_0x2aab('0x12')]);router[_0x2aab('0x13')](_0x2aab('0xc'),auth['isAuthenticated'](),controller[_0x2aab('0x14')]);router['delete']('/:id',auth[_0x2aab('0x8')](),controller[_0x2aab('0x15')]);router['delete'](_0x2aab('0x16'),auth[_0x2aab('0x8')](),controller[_0x2aab('0x17')]);router[_0x2aab('0x18')](_0x2aab('0xf'),auth[_0x2aab('0x8')](),controller[_0x2aab('0x19')]);module[_0x2aab('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 77a74a9..232ce49 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 _0xbca3=['STRING','VIRTUAL','system-','getDataValue','name','sequelize'];(function(_0x1ab170,_0x5197ff){var _0x431698=function(_0x1a3fb6){while(--_0x1a3fb6){_0x1ab170['push'](_0x1ab170['shift']());}};_0x431698(++_0x5197ff);}(_0xbca3,0x7d));var _0x3bca=function(_0x196d97,_0x92282d){_0x196d97=_0x196d97-0x0;var _0x3110f3=_0xbca3[_0x196d97];return _0x3110f3;};'use strict';var Sequelize=require(_0x3bca('0x0'));module['exports']={'name':{'type':Sequelize[_0x3bca('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x3bca('0x2')],'get':function(_0x978d91){return _0x3bca('0x3')+this[_0x3bca('0x4')](_0x3bca('0x5'))+'-';}},'description':{'type':Sequelize[_0x3bca('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6d0d=['sequelize','exports','STRING','VIRTUAL','system-','name','INTEGER'];(function(_0xbbfc48,_0x518466){var _0x4669f1=function(_0x44bb4d){while(--_0x44bb4d){_0xbbfc48['push'](_0xbbfc48['shift']());}};_0x4669f1(++_0x518466);}(_0x6d0d,0x150));var _0xd6d0=function(_0x5731fd,_0x4bf294){_0x5731fd=_0x5731fd-0x0;var _0x379512=_0x6d0d[_0x5731fd];return _0x379512;};'use strict';var Sequelize=require(_0xd6d0('0x0'));module[_0xd6d0('0x1')]={'name':{'type':Sequelize[_0xd6d0('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xd6d0('0x3')],'get':function(_0x4de52e){return _0xd6d0('0x4')+this['getDataValue'](_0xd6d0('0x5'))+'-';}},'description':{'type':Sequelize[_0xd6d0('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xd6d0('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 20312d3..98b28ef 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 _0xe2cf=['socket.io-emitter','register','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','addAgents','ids','userVoicePrefix:save','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','nolimit','getTeams','addTeams','findAll','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','field','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1a0ced,_0x4defab){var _0x3e0c7c=function(_0x1af8b3){while(--_0x1af8b3){_0x1a0ced['push'](_0x1a0ced['shift']());}};_0x3e0c7c(++_0x4defab);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x5bab8e,_0x5a9ed6){_0x5bab8e=_0x5bab8e-0x0;var _0x3e14ea=_0xe2cf[_0x5bab8e];return _0x3e14ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe2c('0x1'));var rp=require('request-promise');var moment=require(_0xfe2c('0x2'));var BPromise=require(_0xfe2c('0x3'));var Mustache=require(_0xfe2c('0x4'));var util=require(_0xfe2c('0x5'));var path=require('path');var sox=require(_0xfe2c('0x6'));var csv=require(_0xfe2c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2c('0x8'));var squel=require(_0xfe2c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2c('0xa'));var toCsv=require(_0xfe2c('0x7'));var querystring=require(_0xfe2c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe2c('0xc'));var qs=require(_0xfe2c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2c('0xe'));var logger=require(_0xfe2c('0xf'))(_0xfe2c('0x10'));var utils=require(_0xfe2c('0x11'));var config=require(_0xfe2c('0x12'));var licenseUtil=require(_0xfe2c('0x13'));var db=require(_0xfe2c('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe2c('0x15'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xfe2c('0x16')](socket);function respondWithStatusCode(_0x4d0a10,_0x2aa7df){_0x2aa7df=_0x2aa7df||0xcc;return function(_0x12e4c4){if(_0x12e4c4){return _0x4d0a10['sendStatus'](_0x2aa7df);}return _0x4d0a10['status'](_0x2aa7df)[_0xfe2c('0x17')]();};}function respondWithResult(_0x3b3ebd,_0x1dbed4){_0x1dbed4=_0x1dbed4||0xc8;return function(_0x56cebc){if(_0x56cebc){return _0x3b3ebd['status'](_0x1dbed4)[_0xfe2c('0x18')](_0x56cebc);}};}function respondWithFilteredResult(_0x96a3a3,_0x135436){return function(_0x23242b){if(_0x23242b){var _0x36aeec=typeof _0x135436[_0xfe2c('0x19')]==='undefined'&&typeof _0x135436[_0xfe2c('0x1a')]===_0xfe2c('0x1b');var _0x1d7852=_0x23242b[_0xfe2c('0x1c')];var _0x55f751=_0x36aeec?0x0:_0x135436[_0xfe2c('0x19')];var _0x59bdeb=_0x36aeec?_0x23242b['count']:_0x135436[_0xfe2c('0x19')]+_0x135436[_0xfe2c('0x1a')];var _0x4bf7c0;if(_0x59bdeb>=_0x1d7852){_0x59bdeb=_0x1d7852;_0x4bf7c0=0xc8;}else{_0x4bf7c0=0xce;}_0x96a3a3[_0xfe2c('0x1d')](_0x4bf7c0);return _0x96a3a3[_0xfe2c('0x1e')]('Content-Range',_0x55f751+'-'+_0x59bdeb+'/'+_0x1d7852)[_0xfe2c('0x18')](_0x23242b);}return null;};}function patchUpdates(_0x5dd54b){return function(_0x4481ff){try{jsonpatch[_0xfe2c('0x1f')](_0x4481ff,_0x5dd54b,!![]);}catch(_0x8b5c0d){return BPromise[_0xfe2c('0x20')](_0x8b5c0d);}return _0x4481ff[_0xfe2c('0x21')]();};}function saveUpdates(_0x2ee3b3,_0x57cd6d){return function(_0x41a545){if(_0x41a545){return _0x41a545[_0xfe2c('0x22')](_0x2ee3b3)[_0xfe2c('0x23')](function(_0x26448c){return _0x26448c;});}return null;};}function removeEntity(_0x3486b5,_0x10afde){return function(_0x53bab0){if(_0x53bab0){return _0x53bab0[_0xfe2c('0x24')]()['then'](function(){var _0x16daf3=_0x53bab0[_0xfe2c('0x25')]({'plain':!![]});var _0x1c35d3='VoicePrefixes';return db[_0xfe2c('0x26')][_0xfe2c('0x24')]({'where':{'type':_0x1c35d3,'resourceId':_0x16daf3['id']}})['then'](function(){return _0x53bab0;});})[_0xfe2c('0x23')](function(){_0x3486b5[_0xfe2c('0x1d')](0xcc)[_0xfe2c('0x17')]();});}};}function handleEntityNotFound(_0x53a8c1,_0x170026){return function(_0x1b7c91){if(!_0x1b7c91){_0x53a8c1['sendStatus'](0x194);}return _0x1b7c91;};}function handleError(_0x481219,_0x1cf1d7){_0x1cf1d7=_0x1cf1d7||0x1f4;return function(_0x13e9a9){logger[_0xfe2c('0x27')](_0x13e9a9[_0xfe2c('0x28')]);if(_0x13e9a9[_0xfe2c('0x29')]){delete _0x13e9a9['name'];}_0x481219[_0xfe2c('0x1d')](_0x1cf1d7)[_0xfe2c('0x2a')](_0x13e9a9);};}exports[_0xfe2c('0x2b')]=function(_0x210c2e,_0x2843a5){var _0xabc499={},_0x69d23a={},_0x3f8696={'count':0x0,'rows':[]};var _0x2e09fe=_[_0xfe2c('0x2c')](db[_0xfe2c('0x2d')][_0xfe2c('0x2e')],function(_0x4e6b92){return{'name':_0x4e6b92[_0xfe2c('0x2f')],'type':_0x4e6b92[_0xfe2c('0x30')][_0xfe2c('0x31')]};});_0x69d23a['model']=_[_0xfe2c('0x2c')](_0x2e09fe,_0xfe2c('0x29'));_0x69d23a['query']=_[_0xfe2c('0x32')](_0x210c2e[_0xfe2c('0x33')]);_0x69d23a[_0xfe2c('0x34')]=_['intersection'](_0x69d23a[_0xfe2c('0x35')],_0x69d23a[_0xfe2c('0x33')]);_0xabc499[_0xfe2c('0x36')]=_[_0xfe2c('0x37')](_0x69d23a[_0xfe2c('0x35')],qs[_0xfe2c('0x38')](_0x210c2e[_0xfe2c('0x33')]['fields']));_0xabc499['attributes']=_0xabc499[_0xfe2c('0x36')][_0xfe2c('0x39')]?_0xabc499[_0xfe2c('0x36')]:_0x69d23a[_0xfe2c('0x35')];if(!_0x210c2e['query'][_0xfe2c('0x3a')]('nolimit')){_0xabc499[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x210c2e['query'][_0xfe2c('0x1a')]);_0xabc499['offset']=qs['offset'](_0x210c2e[_0xfe2c('0x33')][_0xfe2c('0x19')]);}_0xabc499[_0xfe2c('0x3b')]=qs[_0xfe2c('0x3c')](_0x210c2e[_0xfe2c('0x33')][_0xfe2c('0x3c')]);_0xabc499[_0xfe2c('0x3d')]=qs[_0xfe2c('0x34')](_[_0xfe2c('0x3e')](_0x210c2e[_0xfe2c('0x33')],_0x69d23a[_0xfe2c('0x34')]),_0x2e09fe);if(_0x210c2e['query'][_0xfe2c('0x3f')]){_0xabc499[_0xfe2c('0x3d')]=_[_0xfe2c('0x40')](_0xabc499['where'],{'$or':_['map'](_0x2e09fe,function(_0x4e5f0b){if(_0x4e5f0b[_0xfe2c('0x30')]!==_0xfe2c('0x41')){var _0x428b32={};_0x428b32[_0x4e5f0b[_0xfe2c('0x29')]]={'$like':'%'+_0x210c2e['query'][_0xfe2c('0x3f')]+'%'};return _0x428b32;}})});}_0xabc499=_[_0xfe2c('0x40')]({},_0xabc499,_0x210c2e[_0xfe2c('0x42')]);var _0x278acb={'where':_0xabc499[_0xfe2c('0x3d')]};return db['VoicePrefix'][_0xfe2c('0x1c')](_0x278acb)[_0xfe2c('0x23')](function(_0x6055dd){_0x3f8696[_0xfe2c('0x1c')]=_0x6055dd;if(_0x210c2e['query']['includeAll']){_0xabc499[_0xfe2c('0x43')]=[{'all':!![]}];}return db[_0xfe2c('0x2d')]['findAll'](_0xabc499);})[_0xfe2c('0x23')](function(_0x27862d){_0x3f8696[_0xfe2c('0x44')]=_0x27862d;return _0x3f8696;})[_0xfe2c('0x23')](respondWithFilteredResult(_0x2843a5,_0xabc499))['catch'](handleError(_0x2843a5,null));};exports[_0xfe2c('0x45')]=function(_0xfe35e5,_0x331a8a){var _0x466cdb={'raw':![],'where':{'id':_0xfe35e5[_0xfe2c('0x46')]['id']}},_0x122a05={};_0x122a05[_0xfe2c('0x35')]=_[_0xfe2c('0x32')](db['VoicePrefix'][_0xfe2c('0x2e')]);_0x122a05['query']=_[_0xfe2c('0x32')](_0xfe35e5[_0xfe2c('0x33')]);_0x122a05[_0xfe2c('0x34')]=_[_0xfe2c('0x37')](_0x122a05['model'],_0x122a05['query']);_0x466cdb['attributes']=_['intersection'](_0x122a05['model'],qs[_0xfe2c('0x38')](_0xfe35e5['query']['fields']));_0x466cdb[_0xfe2c('0x36')]=_0x466cdb['attributes'][_0xfe2c('0x39')]?_0x466cdb['attributes']:_0x122a05[_0xfe2c('0x35')];if(_0xfe35e5[_0xfe2c('0x33')][_0xfe2c('0x47')]){_0x466cdb[_0xfe2c('0x43')]=[{'all':!![]}];}_0x466cdb=_[_0xfe2c('0x40')]({},_0x466cdb,_0xfe35e5['options']);return db[_0xfe2c('0x2d')][_0xfe2c('0x48')](_0x466cdb)[_0xfe2c('0x23')](handleEntityNotFound(_0x331a8a,null))['then'](respondWithResult(_0x331a8a,null))[_0xfe2c('0x49')](handleError(_0x331a8a,null));};exports[_0xfe2c('0x24')]=function(_0x579b6b,_0x56f716){return db['VoicePrefix'][_0xfe2c('0x48')]({'where':{'id':_0x579b6b[_0xfe2c('0x46')]['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x56f716,null))[_0xfe2c('0x23')](removeEntity(_0x56f716,null))[_0xfe2c('0x49')](handleError(_0x56f716,null));};exports['describe']=function(_0x24cdce,_0x2983b0){return db[_0xfe2c('0x2d')]['describe']()['then'](respondWithResult(_0x2983b0,null))[_0xfe2c('0x49')](handleError(_0x2983b0,null));};exports[_0xfe2c('0x4a')]=function(_0x2daa5f,_0x154381){var _0x384766;return db[_0xfe2c('0x4b')][_0xfe2c('0x4c')](function(_0x37e3de){return db[_0xfe2c('0x2d')][_0xfe2c('0x4a')](_0x2daa5f['body'],{'transaction':_0x37e3de})[_0xfe2c('0x23')](function(_0x34e8e0){_0x384766=_0x34e8e0[_0xfe2c('0x25')]({'plain':!![]});return db[_0xfe2c('0x4d')][_0xfe2c('0x48')]({'where':{'id':_0x384766[_0xfe2c('0x4e')]},'raw':!![]})[_0xfe2c('0x23')](function(_0x158e70){return createVoicePrefixExtensions(_0x384766,_0x158e70,_0x37e3de);});});})[_0xfe2c('0x23')](function(){var _0xf54c02=_0x2daa5f[_0xfe2c('0x4f')]['get']({'plain':!![]});if(!_0xf54c02)throw new Error(_0xfe2c('0x50'));if(_0xf54c02['role']===_0xfe2c('0x4f')){var _0x4f4bc6=_0x384766;return db['UserProfileSection']['find']({'where':{'name':_0xfe2c('0x51'),'userProfileId':_0xf54c02['userProfileId']},'raw':!![]})[_0xfe2c('0x23')](function(_0x5f47cc){if(_0x5f47cc&&_0x5f47cc[_0xfe2c('0x52')]===0x0){return db[_0xfe2c('0x26')][_0xfe2c('0x4a')]({'name':_0x4f4bc6[_0xfe2c('0x29')],'resourceId':_0x4f4bc6['id'],'type':_0x5f47cc[_0xfe2c('0x29')],'sectionId':_0x5f47cc['id']},{})[_0xfe2c('0x23')](function(){return _0x384766;});}else{return _0x384766;}})[_0xfe2c('0x49')](function(_0x11d99e){logger[_0xfe2c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11d99e);throw _0x11d99e;});}return _0x384766;})[_0xfe2c('0x23')](respondWithResult(_0x154381,null))[_0xfe2c('0x49')](handleError(_0x154381,null));};function Extension(_0xf9ed12,_0x385c21,_0x366687,_0x5e6d96){this[_0xfe2c('0x53')]=_0xfe2c('0x54');this['exten']=_0xf9ed12;this['app']=_0x366687;this[_0xfe2c('0x30')]=_0xfe2c('0x55');this[_0xfe2c('0x56')]=_0xfe2c('0x57');this[_0xfe2c('0x58')]=_0x385c21;this[_0xfe2c('0x59')]=_0x5e6d96;}function createVoicePrefixExtensions(_0x306f81,_0x510c61,_0x1a2278){return new BPromise(function(_0x33df71,_0x4679){var _0x821144=new Extension(formatPrefixName(_0x306f81[_0xfe2c('0x5a')]),0x1,_0xfe2c('0x5b'),_0xfe2c('0x5c'));_0x821144['VoicePrefixId']=_0x306f81['id'];return db[_0xfe2c('0x4d')]['create'](_0x821144,{'transaction':_0x1a2278})[_0xfe2c('0x23')](function(_0x349d72){var _0x4cede1=_0x349d72[_0xfe2c('0x25')]({'plain':!![]});var _0x5caca7=_[_0xfe2c('0x2c')](addVoicePrefixExtensions(_0x306f81,_0x510c61),function(_0x377064){_0x377064['VoiceExtensionId']=_0x4cede1['id'];_0x377064[_0xfe2c('0x5d')]=_0x306f81['id'];return _0x377064;});return db['VoiceExtension'][_0xfe2c('0x5e')](_0x5caca7,{'transaction':_0x1a2278})['then'](function(_0x23827b){if(!_0x23827b){return _0x4679(_0xfe2c('0x5f'));}else{return _0x33df71(_0x23827b);}})['catch'](function(_0x661798){return _0x4679(_0x661798);});});;});};function addVoicePrefixExtensions(_0x7a0a77,_0x17b42a){var _0xda63e=[];var _0xa47aeb=formatPrefixName(_0x7a0a77['prefix']);_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x2,_0xfe2c('0x61'),_0xfe2c('0x62')+_0x7a0a77[_0xfe2c('0x29')]));if(_0x7a0a77['callerIdAll']){_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x3,'Set',_0xfe2c('0x63')+_0x7a0a77['callerIdAll']));}else{_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x3,_0xfe2c('0x5b'),_0xfe2c('0x64')));}_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x4,_0xfe2c('0x65'),_0x17b42a[_0xfe2c('0x53')]+','+_0xfe2c('0x66')+(0x8+_0x7a0a77[_0xfe2c('0x29')][_0xfe2c('0x39')])+'}'+','+0x1));return _0xda63e;}function formatPrefixName(_0x21b07a){var _0x3da347='_';for(var _0x2fcb15=0x0;_0x2fcb15<_0x21b07a[_0xfe2c('0x39')];_0x2fcb15++){if(_0x21b07a[_0xfe2c('0x67')](_0x2fcb15)=='-'){_0x3da347+=_0x21b07a[_0xfe2c('0x67')](_0x2fcb15);}else{_0x3da347+='['+_0x21b07a[_0xfe2c('0x67')](_0x2fcb15)+']';}}_0x3da347+='.';return _0x3da347;}exports['update']=function(_0x2f48d5,_0x53513a,_0xdafb46){var _0x5aee3f=_0x2f48d5[_0xfe2c('0x68')];_0x5aee3f['prefix']='system-'+_0x5aee3f[_0xfe2c('0x29')]+'-';return db[_0xfe2c('0x4b')][_0xfe2c('0x4c')](function(_0x40124f){return db[_0xfe2c('0x2d')]['update'](_0x5aee3f,{'where':{'id':_0x5aee3f['id']},'transaction':_0x40124f})[_0xfe2c('0x23')](function(){return db[_0xfe2c('0x4d')]['destroy']({'where':{'VoicePrefixId':_0x5aee3f['id']},'transaction':_0x40124f})[_0xfe2c('0x23')](function(){return db[_0xfe2c('0x4d')]['find']({'where':{'id':_0x5aee3f['VoiceExtensionId']},'raw':!![]})['then'](function(_0x14d619){return createVoicePrefixExtensions(_0x5aee3f,_0x14d619,_0x40124f);});});});})[_0xfe2c('0x23')](function(){return db[_0xfe2c('0x2d')]['findById'](_0x5aee3f['id']);})['then'](respondWithResult(_0x53513a,null))[_0xfe2c('0x49')](handleError(_0x53513a,null));};exports[_0xfe2c('0x69')]=function(_0x56a3be,_0x3508c2,_0x9c07d5){return db[_0xfe2c('0x2d')][_0xfe2c('0x48')]({'where':{'id':_0x56a3be['params']['id']}})['then'](handleEntityNotFound(_0x3508c2,null))[_0xfe2c('0x23')](function(_0x414b87){if(_0x414b87){return _0x414b87['addAgents'](_0x56a3be[_0xfe2c('0x68')][_0xfe2c('0x6a')],_['omit'](_0x56a3be[_0xfe2c('0x68')],['ids','id'])||{})['spread'](function(_0x1f5190){for(var _0x157ad0=0x0;_0x157ad0<_0x56a3be['body'][_0xfe2c('0x6a')][_0xfe2c('0x39')];_0x157ad0+=0x1){socket['emit'](_0xfe2c('0x6b'),{'UserId':Number(_0x56a3be['body'][_0xfe2c('0x6a')][_0x157ad0]),'VoicePrefixId':Number(_0x56a3be[_0xfe2c('0x46')]['id'])});}return _0x1f5190;});}})[_0xfe2c('0x23')](respondWithResult(_0x3508c2,null))[_0xfe2c('0x49')](handleError(_0x3508c2,null));};exports['removeAgents']=function(_0x10e0a0,_0x85c898,_0x5317e4){return db[_0xfe2c('0x2d')]['find']({'where':{'id':_0x10e0a0[_0xfe2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x85c898,null))[_0xfe2c('0x23')](function(_0x23311a){if(_0x23311a){return _0x23311a['removeAgents'](_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')])[_0xfe2c('0x23')](function(){if(_[_0xfe2c('0x6c')](_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')])){for(var _0x52627b=0x0;_0x52627b<_0x10e0a0[_0xfe2c('0x33')]['ids']['length'];_0x52627b+=0x1){socket[_0xfe2c('0x6d')](_0xfe2c('0x6e'),{'UserId':Number(_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')][_0x52627b]),'VoicePrefixId':Number(_0x10e0a0[_0xfe2c('0x46')]['id'])});}}else{socket[_0xfe2c('0x6d')]('userVoicePrefix:remove',{'UserId':Number(_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')]),'VoicePrefixId':Number(_0x10e0a0[_0xfe2c('0x46')]['id'])});}});}})[_0xfe2c('0x23')](respondWithStatusCode(_0x85c898,null))['catch'](handleError(_0x85c898,null));};exports[_0xfe2c('0x6f')]=function(_0x4f595d,_0x392232,_0x114553){var _0x512137={};var _0x1baccd={};var _0x540a67;var _0x49f9e1;return db['VoicePrefix'][_0xfe2c('0x70')]({'where':{'id':_0x4f595d[_0xfe2c('0x46')]['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x392232,null))[_0xfe2c('0x23')](function(_0x4147fc){if(_0x4147fc){_0x540a67=_0x4147fc;_0x1baccd[_0xfe2c('0x35')]=_[_0xfe2c('0x32')](db[_0xfe2c('0x71')][_0xfe2c('0x2e')]);_0x1baccd['query']=_['keys'](_0x4f595d[_0xfe2c('0x33')]);_0x1baccd[_0xfe2c('0x34')]=_[_0xfe2c('0x37')](_0x1baccd[_0xfe2c('0x35')],_0x1baccd[_0xfe2c('0x33')]);_0x512137[_0xfe2c('0x36')]=_['intersection'](_0x1baccd[_0xfe2c('0x35')],qs[_0xfe2c('0x38')](_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x38')]));_0x512137[_0xfe2c('0x36')]=_0x512137[_0xfe2c('0x36')][_0xfe2c('0x39')]?_0x512137[_0xfe2c('0x36')]:_0x1baccd[_0xfe2c('0x35')];_0x512137['order']=qs[_0xfe2c('0x3c')](_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3c')]);_0x512137[_0xfe2c('0x3d')]=qs[_0xfe2c('0x34')](_[_0xfe2c('0x3e')](_0x4f595d['query'],_0x1baccd[_0xfe2c('0x34')]));if(_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3f')]){_0x512137[_0xfe2c('0x3d')]=_['merge'](_0x512137['where'],{'$or':_[_0xfe2c('0x2c')](_0x512137[_0xfe2c('0x36')],function(_0x312e84){var _0x57643d={};_0x57643d[_0x312e84]={'$like':'%'+_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3f')]+'%'};return _0x57643d;})});}_0x512137=_[_0xfe2c('0x40')]({},_0x512137,_0x4f595d['options']);return _0x540a67[_0xfe2c('0x6f')](_0x512137);}})[_0xfe2c('0x23')](function(_0x1193c2){if(_0x1193c2){_0x49f9e1=_0x1193c2[_0xfe2c('0x39')];if(!_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3a')](_0xfe2c('0x72'))){_0x512137[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x4f595d['query'][_0xfe2c('0x1a')]);_0x512137['offset']=qs[_0xfe2c('0x19')](_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x19')]);}return _0x540a67['getAgents'](_0x512137);}})['then'](function(_0x4f39af){if(_0x4f39af){return _0x4f39af?{'count':_0x49f9e1,'rows':_0x4f39af}:null;}})[_0xfe2c('0x23')](respondWithResult(_0x392232,null))[_0xfe2c('0x49')](handleError(_0x392232,null));};exports[_0xfe2c('0x73')]=function(_0x3b07e7,_0x37e3d8,_0x27d025){var _0x23e1db={};var _0x14ebf0={};var _0x20c22a;var _0xb283e0;return db[_0xfe2c('0x2d')][_0xfe2c('0x70')]({'where':{'id':_0x3b07e7[_0xfe2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x37e3d8,null))[_0xfe2c('0x23')](function(_0x532f06){if(_0x532f06){_0x20c22a=_0x532f06;_0x14ebf0[_0xfe2c('0x35')]=_[_0xfe2c('0x32')](db['Team']['rawAttributes']);_0x14ebf0['query']=_[_0xfe2c('0x32')](_0x3b07e7[_0xfe2c('0x33')]);_0x14ebf0[_0xfe2c('0x34')]=_[_0xfe2c('0x37')](_0x14ebf0[_0xfe2c('0x35')],_0x14ebf0[_0xfe2c('0x33')]);_0x23e1db['attributes']=_['intersection'](_0x14ebf0[_0xfe2c('0x35')],qs[_0xfe2c('0x38')](_0x3b07e7[_0xfe2c('0x33')]['fields']));_0x23e1db[_0xfe2c('0x36')]=_0x23e1db['attributes'][_0xfe2c('0x39')]?_0x23e1db[_0xfe2c('0x36')]:_0x14ebf0[_0xfe2c('0x35')];_0x23e1db[_0xfe2c('0x3b')]=qs['sort'](_0x3b07e7[_0xfe2c('0x33')][_0xfe2c('0x3c')]);_0x23e1db[_0xfe2c('0x3d')]=qs[_0xfe2c('0x34')](_[_0xfe2c('0x3e')](_0x3b07e7['query'],_0x14ebf0[_0xfe2c('0x34')]));if(_0x3b07e7[_0xfe2c('0x33')]['filter']){_0x23e1db[_0xfe2c('0x3d')]=_[_0xfe2c('0x40')](_0x23e1db[_0xfe2c('0x3d')],{'$or':_[_0xfe2c('0x2c')](_0x23e1db[_0xfe2c('0x36')],function(_0x50f27e){var _0x995423={};_0x995423[_0x50f27e]={'$like':'%'+_0x3b07e7[_0xfe2c('0x33')][_0xfe2c('0x3f')]+'%'};return _0x995423;})});}_0x23e1db=_[_0xfe2c('0x40')]({},_0x23e1db,_0x3b07e7[_0xfe2c('0x42')]);return _0x20c22a[_0xfe2c('0x73')](_0x23e1db);}})[_0xfe2c('0x23')](function(_0x142bf1){if(_0x142bf1){_0xb283e0=_0x142bf1['length'];if(!_0x3b07e7['query'][_0xfe2c('0x3a')](_0xfe2c('0x72'))){_0x23e1db[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x3b07e7[_0xfe2c('0x33')][_0xfe2c('0x1a')]);_0x23e1db['offset']=qs['offset'](_0x3b07e7['query'][_0xfe2c('0x19')]);}return _0x20c22a[_0xfe2c('0x73')](_0x23e1db);}})[_0xfe2c('0x23')](function(_0x2351d5){if(_0x2351d5){return _0x2351d5?{'count':_0xb283e0,'rows':_0x2351d5}:null;}})[_0xfe2c('0x23')](respondWithResult(_0x37e3d8,null))[_0xfe2c('0x49')](handleError(_0x37e3d8,null));};exports[_0xfe2c('0x74')]=function(_0x3f2102,_0x1cc35d,_0x246d5d){var _0x5f34d3=_0x3f2102[_0xfe2c('0x68')][_0xfe2c('0x6a')];var _0x14631f;return db['Team'][_0xfe2c('0x75')]({'where':{'id':_0x5f34d3},'attributes':['id'],'include':[{'model':db[_0xfe2c('0x71')],'as':_0xfe2c('0x76'),'attributes':['id',_0xfe2c('0x29'),_0xfe2c('0x77'),_0xfe2c('0x78'),'interface'],'raw':!![]}]})['then'](function(_0x5f4744){if(_0x5f4744){_0x14631f=_0x5f4744;var _0x18ad4f=_[_0xfe2c('0x79')](_0x5f4744,function(_0x24faae){var _0x450e1d=_0x24faae[_0xfe2c('0x25')]({'plain':!![]});return _0x450e1d[_0xfe2c('0x76')];});return db['VoicePrefix'][_0xfe2c('0x48')]({'where':{'id':_0x3f2102['params']['id']}})[_0xfe2c('0x23')](function(_0x552cd3){return db['sequelize'][_0xfe2c('0x4c')](function(_0x32ed72){return _0x552cd3[_0xfe2c('0x74')](_0x5f34d3,{'transaction':_0x32ed72})['then'](function(){return BPromise[_0xfe2c('0x7a')](_0x14631f,function(_0x4f946d){return db[_0xfe2c('0x7b')][_0xfe2c('0x7c')]({'TeamId':_0x4f946d['id'],'VoicePrefixId':_0x3f2102[_0xfe2c('0x46')]['id']},{'transaction':_0x32ed72});});})[_0xfe2c('0x23')](function(){return BPromise['each'](_0x18ad4f,function(_0x42495d){return db[_0xfe2c('0x7d')]['findOrCreate']({'where':{'UserId':_0x42495d['id'],'VoicePrefixId':_0x3f2102[_0xfe2c('0x46')]['id']},'transaction':_0x32ed72});});})[_0xfe2c('0x23')](function(){_0x18ad4f[_0xfe2c('0x7e')](function(_0x1682b2){socket[_0xfe2c('0x6d')]('userVoicePrefix:save',{'UserId':_0x1682b2['id'],'VoicePrefixId':_0x552cd3['id']});});});});});}})[_0xfe2c('0x23')](respondWithStatusCode(_0x1cc35d,null))[_0xfe2c('0x49')](handleError(_0x1cc35d,null));};exports[_0xfe2c('0x7f')]=function(_0x3027f9,_0x3d6fba,_0x2523cc){return db['Team'][_0xfe2c('0x75')]({'where':{'id':_0x3027f9[_0xfe2c('0x33')][_0xfe2c('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfe2c('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3d6fba,null))[_0xfe2c('0x23')](function(_0x5cbd7f){var _0x3dba12=_[_0xfe2c('0x2c')](_0x5cbd7f,'id');var _0x40be3c=[];var _0x4dd915=[];var _0x6efab6=squel['select']();_0x6efab6[_0xfe2c('0x80')](_0xfe2c('0x81'))[_0xfe2c('0x82')]('team_has_voice_prefixes','tq')[_0xfe2c('0x83')](_0xfe2c('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfe2c('0x3d')](_0xfe2c('0x85'),_0x3027f9['params']['id']);for(var _0x3b6535=0x0;_0x3b6535<_0x5cbd7f[_0xfe2c('0x39')];_0x3b6535+=0x1){let _0x1d712e=_0x5cbd7f[_0x3b6535];for(var _0x14696e=0x0;_0x14696e<_0x1d712e[_0xfe2c('0x76')][_0xfe2c('0x39')];_0x14696e+=0x1){let _0x252527=_0x1d712e[_0xfe2c('0x76')][_0x14696e];var _0x1c0877=_0x6efab6[_0xfe2c('0x86')]();_0x1c0877[_0xfe2c('0x3d')](_0xfe2c('0x87'),_0x252527['id']);_0x4dd915[_0xfe2c('0x60')](db[_0xfe2c('0x4b')][_0xfe2c('0x33')](_0x1c0877[_0xfe2c('0x88')](),{'type':db['sequelize'][_0xfe2c('0x89')]['SELECT']})[_0xfe2c('0x23')](function(_0x5f3a0f){if(_0x5f3a0f[_0xfe2c('0x39')]===0x1){return _0x252527['id'];}else{var _0x329de0=_[_0xfe2c('0x8a')](_[_0xfe2c('0x2c')](_0x5f3a0f,_0xfe2c('0x8b')),function(_0x5b6e4f){return _[_0xfe2c('0x8c')](_0x3dba12,_0x5b6e4f);});if(_0x329de0){return _0x252527['id'];}}}));}}return BPromise[_0xfe2c('0x8d')](_0x4dd915)[_0xfe2c('0x23')](function(_0x57d173){_0x40be3c=_(_0x40be3c)['union'](_0x57d173)[_0xfe2c('0x8e')]()[_0xfe2c('0x8f')]();return db['VoicePrefix'][_0xfe2c('0x48')]({'where':{'id':_0x3027f9[_0xfe2c('0x46')]['id']}})[_0xfe2c('0x23')](function(_0x2f3af6){return db[_0xfe2c('0x4b')]['transaction'](function(_0x36abbf){return _0x2f3af6[_0xfe2c('0x7f')](_0x3027f9[_0xfe2c('0x33')][_0xfe2c('0x6a')],{'transaction':_0x36abbf})[_0xfe2c('0x23')](function(){if(!_[_0xfe2c('0x90')](_0x40be3c)){return _0x2f3af6[_0xfe2c('0x91')](_0x40be3c,{'transaction':_0x36abbf});}})[_0xfe2c('0x23')](function(){_0x40be3c['forEach'](function(_0x29c9ef){socket['emit'](_0xfe2c('0x6e'),{'UserId':_0x29c9ef,'VoicePrefixId':_0x2f3af6['id']});});});});});});})[_0xfe2c('0x23')](respondWithStatusCode(_0x3d6fba,null))[_0xfe2c('0x49')](handleError(_0x3d6fba,null));}; \ No newline at end of file +var _0x0120=['get','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','params','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Agents','online','interface','flatMap','sequelize','addTeams','each','TeamVoicePrefix','upsert','findOrCreate','userVoicePrefix:save','removeTeams','from','team_has_voice_prefixes','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3a1ae6,_0x52d1cc){var _0x14fb70=function(_0x59dc9c){while(--_0x59dc9c){_0x3a1ae6['push'](_0x3a1ae6['shift']());}};_0x14fb70(++_0x52d1cc);}(_0x0120,0x6f));var _0x0012=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0120[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];config['redis']=_[_0x0012('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0012('0x1b'))['register'](socket);function respondWithStatusCode(_0x3995fd,_0xf658bc){_0xf658bc=_0xf658bc||0xcc;return function(_0x47a6ef){if(_0x47a6ef){return _0x3995fd[_0x0012('0x1c')](_0xf658bc);}return _0x3995fd[_0x0012('0x1d')](_0xf658bc)[_0x0012('0x1e')]();};}function respondWithResult(_0x3b8dfc,_0x522e9b){_0x522e9b=_0x522e9b||0xc8;return function(_0x4e72da){if(_0x4e72da){return _0x3b8dfc[_0x0012('0x1d')](_0x522e9b)[_0x0012('0x1f')](_0x4e72da);}};}function respondWithFilteredResult(_0x3948bf,_0x2e88a8){return function(_0x1d0423){if(_0x1d0423){var _0x22ded1=typeof _0x2e88a8[_0x0012('0x20')]===_0x0012('0x21')&&typeof _0x2e88a8['limit']===_0x0012('0x21');var _0x56b0e1=_0x1d0423['count'];var _0x45d00b=_0x22ded1?0x0:_0x2e88a8[_0x0012('0x20')];var _0xa2e623=_0x22ded1?_0x1d0423[_0x0012('0x22')]:_0x2e88a8['offset']+_0x2e88a8['limit'];var _0x460d82;if(_0xa2e623>=_0x56b0e1){_0xa2e623=_0x56b0e1;_0x460d82=0xc8;}else{_0x460d82=0xce;}_0x3948bf[_0x0012('0x1d')](_0x460d82);return _0x3948bf[_0x0012('0x23')](_0x0012('0x24'),_0x45d00b+'-'+_0xa2e623+'/'+_0x56b0e1)[_0x0012('0x1f')](_0x1d0423);}return null;};}function patchUpdates(_0x2e6a2c){return function(_0x2c9a96){try{jsonpatch[_0x0012('0x25')](_0x2c9a96,_0x2e6a2c,!![]);}catch(_0x57487e){return BPromise[_0x0012('0x26')](_0x57487e);}return _0x2c9a96[_0x0012('0x27')]();};}function saveUpdates(_0x4cf4bd,_0x36cf42){return function(_0x13a78e){if(_0x13a78e){return _0x13a78e[_0x0012('0x28')](_0x4cf4bd)[_0x0012('0x29')](function(_0x42bcd7){return _0x42bcd7;});}return null;};}function removeEntity(_0x5e820b,_0x351ffd){return function(_0x18b0a7){if(_0x18b0a7){return _0x18b0a7[_0x0012('0x2a')]()[_0x0012('0x29')](function(){var _0x173cb3=_0x18b0a7[_0x0012('0x2b')]({'plain':!![]});var _0x15d48a=_0x0012('0x2c');return db[_0x0012('0x2d')][_0x0012('0x2a')]({'where':{'type':_0x15d48a,'resourceId':_0x173cb3['id']}})[_0x0012('0x29')](function(){return _0x18b0a7;});})[_0x0012('0x29')](function(){_0x5e820b[_0x0012('0x1d')](0xcc)[_0x0012('0x1e')]();});}};}function handleEntityNotFound(_0x1282bb,_0x276389){return function(_0x1b676d){if(!_0x1b676d){_0x1282bb[_0x0012('0x1c')](0x194);}return _0x1b676d;};}function handleError(_0x1c23e0,_0x291085){_0x291085=_0x291085||0x1f4;return function(_0x1bb14d){logger['error'](_0x1bb14d[_0x0012('0x2e')]);if(_0x1bb14d[_0x0012('0x2f')]){delete _0x1bb14d['name'];}_0x1c23e0[_0x0012('0x1d')](_0x291085)[_0x0012('0x30')](_0x1bb14d);};}exports[_0x0012('0x31')]=function(_0x1b6cef,_0x287b05){var _0x47d73b={},_0x13f169={},_0x187f4b={'count':0x0,'rows':[]};var _0x2e7487=_['map'](db[_0x0012('0x32')][_0x0012('0x33')],function(_0x398990){return{'name':_0x398990[_0x0012('0x34')],'type':_0x398990[_0x0012('0x35')][_0x0012('0x36')]};});_0x13f169['model']=_[_0x0012('0x37')](_0x2e7487,_0x0012('0x2f'));_0x13f169[_0x0012('0x38')]=_[_0x0012('0x39')](_0x1b6cef['query']);_0x13f169['filters']=_[_0x0012('0x3a')](_0x13f169[_0x0012('0x3b')],_0x13f169[_0x0012('0x38')]);_0x47d73b[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x13f169[_0x0012('0x3b')],qs[_0x0012('0x3d')](_0x1b6cef['query'][_0x0012('0x3d')]));_0x47d73b[_0x0012('0x3c')]=_0x47d73b['attributes'][_0x0012('0x3e')]?_0x47d73b[_0x0012('0x3c')]:_0x13f169[_0x0012('0x3b')];if(!_0x1b6cef[_0x0012('0x38')][_0x0012('0x3f')](_0x0012('0x40'))){_0x47d73b[_0x0012('0x41')]=qs['limit'](_0x1b6cef[_0x0012('0x38')]['limit']);_0x47d73b[_0x0012('0x20')]=qs['offset'](_0x1b6cef['query'][_0x0012('0x20')]);}_0x47d73b[_0x0012('0x42')]=qs[_0x0012('0x43')](_0x1b6cef['query'][_0x0012('0x43')]);_0x47d73b[_0x0012('0x44')]=qs[_0x0012('0x45')](_[_0x0012('0x46')](_0x1b6cef[_0x0012('0x38')],_0x13f169[_0x0012('0x45')]),_0x2e7487);if(_0x1b6cef[_0x0012('0x38')][_0x0012('0x47')]){_0x47d73b['where']=_[_0x0012('0x48')](_0x47d73b[_0x0012('0x44')],{'$or':_[_0x0012('0x37')](_0x2e7487,function(_0x1799f2){if(_0x1799f2[_0x0012('0x35')]!==_0x0012('0x49')){var _0x375317={};_0x375317[_0x1799f2['name']]={'$like':'%'+_0x1b6cef['query'][_0x0012('0x47')]+'%'};return _0x375317;}})});}_0x47d73b=_['merge']({},_0x47d73b,_0x1b6cef[_0x0012('0x4a')]);var _0x30af1b={'where':_0x47d73b[_0x0012('0x44')]};return db[_0x0012('0x32')][_0x0012('0x22')](_0x30af1b)['then'](function(_0x1bd93a){_0x187f4b[_0x0012('0x22')]=_0x1bd93a;if(_0x1b6cef['query'][_0x0012('0x4b')]){_0x47d73b[_0x0012('0x4c')]=[{'all':!![]}];}return db[_0x0012('0x32')][_0x0012('0x4d')](_0x47d73b);})['then'](function(_0x4ba00e){_0x187f4b[_0x0012('0x4e')]=_0x4ba00e;return _0x187f4b;})['then'](respondWithFilteredResult(_0x287b05,_0x47d73b))[_0x0012('0x4f')](handleError(_0x287b05,null));};exports['show']=function(_0xdd4689,_0x1296fd){var _0x3daefd={'raw':![],'where':{'id':_0xdd4689['params']['id']}},_0x364f8e={};_0x364f8e[_0x0012('0x3b')]=_['keys'](db[_0x0012('0x32')][_0x0012('0x33')]);_0x364f8e[_0x0012('0x38')]=_[_0x0012('0x39')](_0xdd4689[_0x0012('0x38')]);_0x364f8e[_0x0012('0x45')]=_[_0x0012('0x3a')](_0x364f8e['model'],_0x364f8e[_0x0012('0x38')]);_0x3daefd[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x364f8e[_0x0012('0x3b')],qs[_0x0012('0x3d')](_0xdd4689[_0x0012('0x38')]['fields']));_0x3daefd['attributes']=_0x3daefd['attributes']['length']?_0x3daefd[_0x0012('0x3c')]:_0x364f8e[_0x0012('0x3b')];if(_0xdd4689[_0x0012('0x38')][_0x0012('0x4b')]){_0x3daefd[_0x0012('0x4c')]=[{'all':!![]}];}_0x3daefd=_['merge']({},_0x3daefd,_0xdd4689[_0x0012('0x4a')]);return db[_0x0012('0x32')][_0x0012('0x50')](_0x3daefd)[_0x0012('0x29')](handleEntityNotFound(_0x1296fd,null))[_0x0012('0x29')](respondWithResult(_0x1296fd,null))[_0x0012('0x4f')](handleError(_0x1296fd,null));};exports[_0x0012('0x2a')]=function(_0x26fb2b,_0x2177a6){return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0x26fb2b['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x2177a6,null))[_0x0012('0x29')](removeEntity(_0x2177a6,null))[_0x0012('0x4f')](handleError(_0x2177a6,null));};exports['describe']=function(_0x2d4ee7,_0x2f451b){return db[_0x0012('0x32')][_0x0012('0x51')]()[_0x0012('0x29')](respondWithResult(_0x2f451b,null))['catch'](handleError(_0x2f451b,null));};exports[_0x0012('0x52')]=function(_0x552f02,_0x430973){var _0x42f296;return db['sequelize'][_0x0012('0x53')](function(_0x19cf31){return db[_0x0012('0x32')][_0x0012('0x52')](_0x552f02[_0x0012('0x54')],{'transaction':_0x19cf31})[_0x0012('0x29')](function(_0x4e9f7e){_0x42f296=_0x4e9f7e[_0x0012('0x2b')]({'plain':!![]});return db[_0x0012('0x55')][_0x0012('0x50')]({'where':{'id':_0x42f296[_0x0012('0x56')]},'raw':!![]})['then'](function(_0x102637){return createVoicePrefixExtensions(_0x42f296,_0x102637,_0x19cf31);});});})[_0x0012('0x29')](function(){var _0x2e79aa=_0x552f02['user'][_0x0012('0x2b')]({'plain':!![]});if(!_0x2e79aa)throw new Error(_0x0012('0x57'));if(_0x2e79aa[_0x0012('0x58')]===_0x0012('0x59')){var _0x1a48d9=_0x42f296;return db[_0x0012('0x5a')][_0x0012('0x50')]({'where':{'name':_0x0012('0x2c'),'userProfileId':_0x2e79aa[_0x0012('0x5b')]},'raw':!![]})[_0x0012('0x29')](function(_0x263634){if(_0x263634&&_0x263634['autoAssociation']===0x0){return db['UserProfileResource'][_0x0012('0x52')]({'name':_0x1a48d9[_0x0012('0x2f')],'resourceId':_0x1a48d9['id'],'type':_0x263634[_0x0012('0x2f')],'sectionId':_0x263634['id']},{})[_0x0012('0x29')](function(){return _0x42f296;});}else{return _0x42f296;}})['catch'](function(_0x248497){logger[_0x0012('0x5c')](_0x0012('0x5d'),_0x248497);throw _0x248497;});}return _0x42f296;})[_0x0012('0x29')](respondWithResult(_0x430973,null))[_0x0012('0x4f')](handleError(_0x430973,null));};function Extension(_0x130045,_0x51eae3,_0x17eaff,_0x490644){this[_0x0012('0x5e')]=_0x0012('0x5f');this[_0x0012('0x60')]=_0x130045;this[_0x0012('0x61')]=_0x17eaff;this[_0x0012('0x35')]='system';this[_0x0012('0x62')]=_0x0012('0x63');this[_0x0012('0x64')]=_0x51eae3;this[_0x0012('0x65')]=_0x490644;}function createVoicePrefixExtensions(_0x2ceed5,_0x3d32c2,_0x562d6d){return new BPromise(function(_0x4e4d52,_0x4ea93b){var _0xd7db34=new Extension(formatPrefixName(_0x2ceed5[_0x0012('0x66')]),0x1,'NoOp','Voice\x20Prefix');_0xd7db34['VoicePrefixId']=_0x2ceed5['id'];return db[_0x0012('0x55')][_0x0012('0x52')](_0xd7db34,{'transaction':_0x562d6d})[_0x0012('0x29')](function(_0x472843){var _0x1f0af9=_0x472843[_0x0012('0x2b')]({'plain':!![]});var _0x10cb5e=_[_0x0012('0x37')](addVoicePrefixExtensions(_0x2ceed5,_0x3d32c2),function(_0x2612e2){_0x2612e2[_0x0012('0x56')]=_0x1f0af9['id'];_0x2612e2['VoicePrefixId']=_0x2ceed5['id'];return _0x2612e2;});return db[_0x0012('0x55')][_0x0012('0x67')](_0x10cb5e,{'transaction':_0x562d6d})[_0x0012('0x29')](function(_0x5cfc9f){if(!_0x5cfc9f){return _0x4ea93b(_0x0012('0x68'));}else{return _0x4e4d52(_0x5cfc9f);}})[_0x0012('0x4f')](function(_0x4cba06){return _0x4ea93b(_0x4cba06);});});;});};function addVoicePrefixExtensions(_0x388466,_0x534840){var _0x2958c7=[];var _0x1661c2=formatPrefixName(_0x388466[_0x0012('0x66')]);_0x2958c7[_0x0012('0x69')](new Extension(_0x1661c2,0x2,'Set',_0x0012('0x6a')+_0x388466[_0x0012('0x2f')]));if(_0x388466[_0x0012('0x6b')]){_0x2958c7[_0x0012('0x69')](new Extension(_0x1661c2,0x3,_0x0012('0x6c'),_0x0012('0x6d')+_0x388466[_0x0012('0x6b')]));}else{_0x2958c7['push'](new Extension(_0x1661c2,0x3,'NoOp',_0x0012('0x6e')));}_0x2958c7[_0x0012('0x69')](new Extension(_0x1661c2,0x4,_0x0012('0x6f'),_0x534840[_0x0012('0x5e')]+','+_0x0012('0x70')+(0x8+_0x388466[_0x0012('0x2f')][_0x0012('0x3e')])+'}'+','+0x1));return _0x2958c7;}function formatPrefixName(_0x38cc51){var _0x548487='_';for(var _0x15b058=0x0;_0x15b058<_0x38cc51[_0x0012('0x3e')];_0x15b058++){if(_0x38cc51[_0x0012('0x71')](_0x15b058)=='-'){_0x548487+=_0x38cc51[_0x0012('0x71')](_0x15b058);}else{_0x548487+='['+_0x38cc51[_0x0012('0x71')](_0x15b058)+']';}}_0x548487+='.';return _0x548487;}exports[_0x0012('0x28')]=function(_0x496ab9,_0x4fc9b1,_0x571247){var _0x49963a=_0x496ab9['body'];_0x49963a['prefix']=_0x0012('0x72')+_0x49963a[_0x0012('0x2f')]+'-';return db['sequelize'][_0x0012('0x53')](function(_0x1c93e7){return db[_0x0012('0x32')][_0x0012('0x28')](_0x49963a,{'where':{'id':_0x49963a['id']},'transaction':_0x1c93e7})[_0x0012('0x29')](function(){return db['VoiceExtension'][_0x0012('0x2a')]({'where':{'VoicePrefixId':_0x49963a['id']},'transaction':_0x1c93e7})[_0x0012('0x29')](function(){return db[_0x0012('0x55')][_0x0012('0x50')]({'where':{'id':_0x49963a[_0x0012('0x56')]},'raw':!![]})[_0x0012('0x29')](function(_0x47e12a){return createVoicePrefixExtensions(_0x49963a,_0x47e12a,_0x1c93e7);});});});})['then'](function(){return db[_0x0012('0x32')]['findById'](_0x49963a['id']);})[_0x0012('0x29')](respondWithResult(_0x4fc9b1,null))[_0x0012('0x4f')](handleError(_0x4fc9b1,null));};exports[_0x0012('0x73')]=function(_0xdd97af,_0x521a88,_0x493a0d){return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0xdd97af[_0x0012('0x74')]['id']}})['then'](handleEntityNotFound(_0x521a88,null))[_0x0012('0x29')](function(_0x48d748){if(_0x48d748){return _0x48d748['addAgents'](_0xdd97af['body'][_0x0012('0x75')],_[_0x0012('0x76')](_0xdd97af['body'],[_0x0012('0x75'),'id'])||{})[_0x0012('0x77')](function(_0x574cf7){for(var _0x4e0a8f=0x0;_0x4e0a8f<_0xdd97af[_0x0012('0x54')]['ids'][_0x0012('0x3e')];_0x4e0a8f+=0x1){socket[_0x0012('0x78')]('userVoicePrefix:save',{'UserId':Number(_0xdd97af['body'][_0x0012('0x75')][_0x4e0a8f]),'VoicePrefixId':Number(_0xdd97af[_0x0012('0x74')]['id'])});}return _0x574cf7;});}})[_0x0012('0x29')](respondWithResult(_0x521a88,null))[_0x0012('0x4f')](handleError(_0x521a88,null));};exports['removeAgents']=function(_0x523419,_0x2852ac,_0x58d4dc){return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0x523419['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x2852ac,null))[_0x0012('0x29')](function(_0xd6f0ff){if(_0xd6f0ff){return _0xd6f0ff[_0x0012('0x79')](_0x523419[_0x0012('0x38')][_0x0012('0x75')])[_0x0012('0x29')](function(){if(_[_0x0012('0x7a')](_0x523419[_0x0012('0x38')][_0x0012('0x75')])){for(var _0x4a2ce1=0x0;_0x4a2ce1<_0x523419[_0x0012('0x38')]['ids']['length'];_0x4a2ce1+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x523419['query'][_0x0012('0x75')][_0x4a2ce1]),'VoicePrefixId':Number(_0x523419['params']['id'])});}}else{socket[_0x0012('0x78')](_0x0012('0x7b'),{'UserId':Number(_0x523419[_0x0012('0x38')]['ids']),'VoicePrefixId':Number(_0x523419[_0x0012('0x74')]['id'])});}});}})[_0x0012('0x29')](respondWithStatusCode(_0x2852ac,null))[_0x0012('0x4f')](handleError(_0x2852ac,null));};exports[_0x0012('0x7c')]=function(_0x35d36e,_0x26e6ed,_0xd6b12a){var _0x5dc5b5={};var _0x399108={};var _0x482684;var _0x526fae;return db[_0x0012('0x32')][_0x0012('0x7d')]({'where':{'id':_0x35d36e['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x26e6ed,null))['then'](function(_0xe913ef){if(_0xe913ef){_0x482684=_0xe913ef;_0x399108[_0x0012('0x3b')]=_[_0x0012('0x39')](db[_0x0012('0x7e')]['rawAttributes']);_0x399108[_0x0012('0x38')]=_[_0x0012('0x39')](_0x35d36e[_0x0012('0x38')]);_0x399108[_0x0012('0x45')]=_[_0x0012('0x3a')](_0x399108['model'],_0x399108[_0x0012('0x38')]);_0x5dc5b5[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x399108[_0x0012('0x3b')],qs[_0x0012('0x3d')](_0x35d36e['query'][_0x0012('0x3d')]));_0x5dc5b5['attributes']=_0x5dc5b5[_0x0012('0x3c')][_0x0012('0x3e')]?_0x5dc5b5['attributes']:_0x399108[_0x0012('0x3b')];_0x5dc5b5[_0x0012('0x42')]=qs['sort'](_0x35d36e[_0x0012('0x38')][_0x0012('0x43')]);_0x5dc5b5[_0x0012('0x44')]=qs[_0x0012('0x45')](_[_0x0012('0x46')](_0x35d36e[_0x0012('0x38')],_0x399108[_0x0012('0x45')]));if(_0x35d36e['query'][_0x0012('0x47')]){_0x5dc5b5[_0x0012('0x44')]=_[_0x0012('0x48')](_0x5dc5b5[_0x0012('0x44')],{'$or':_[_0x0012('0x37')](_0x5dc5b5[_0x0012('0x3c')],function(_0x203996){var _0x4da831={};_0x4da831[_0x203996]={'$like':'%'+_0x35d36e[_0x0012('0x38')][_0x0012('0x47')]+'%'};return _0x4da831;})});}_0x5dc5b5=_[_0x0012('0x48')]({},_0x5dc5b5,_0x35d36e[_0x0012('0x4a')]);return _0x482684[_0x0012('0x7c')](_0x5dc5b5);}})[_0x0012('0x29')](function(_0x119e75){if(_0x119e75){_0x526fae=_0x119e75['length'];if(!_0x35d36e[_0x0012('0x38')]['hasOwnProperty'](_0x0012('0x40'))){_0x5dc5b5[_0x0012('0x41')]=qs[_0x0012('0x41')](_0x35d36e[_0x0012('0x38')]['limit']);_0x5dc5b5[_0x0012('0x20')]=qs[_0x0012('0x20')](_0x35d36e[_0x0012('0x38')][_0x0012('0x20')]);}return _0x482684[_0x0012('0x7c')](_0x5dc5b5);}})[_0x0012('0x29')](function(_0x384731){if(_0x384731){return _0x384731?{'count':_0x526fae,'rows':_0x384731}:null;}})[_0x0012('0x29')](respondWithResult(_0x26e6ed,null))[_0x0012('0x4f')](handleError(_0x26e6ed,null));};exports[_0x0012('0x7f')]=function(_0x2cd7f9,_0x30739b,_0x529ad1){var _0x4de297={};var _0x493cf8={};var _0x10acaa;var _0x6b90b3;return db['VoicePrefix'][_0x0012('0x7d')]({'where':{'id':_0x2cd7f9['params']['id']}})[_0x0012('0x29')](handleEntityNotFound(_0x30739b,null))['then'](function(_0x2ecb66){if(_0x2ecb66){_0x10acaa=_0x2ecb66;_0x493cf8['model']=_['keys'](db['Team'][_0x0012('0x33')]);_0x493cf8[_0x0012('0x38')]=_['keys'](_0x2cd7f9[_0x0012('0x38')]);_0x493cf8[_0x0012('0x45')]=_[_0x0012('0x3a')](_0x493cf8['model'],_0x493cf8[_0x0012('0x38')]);_0x4de297[_0x0012('0x3c')]=_[_0x0012('0x3a')](_0x493cf8['model'],qs[_0x0012('0x3d')](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x3d')]));_0x4de297[_0x0012('0x3c')]=_0x4de297['attributes'][_0x0012('0x3e')]?_0x4de297['attributes']:_0x493cf8[_0x0012('0x3b')];_0x4de297['order']=qs[_0x0012('0x43')](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x43')]);_0x4de297[_0x0012('0x44')]=qs['filters'](_[_0x0012('0x46')](_0x2cd7f9[_0x0012('0x38')],_0x493cf8['filters']));if(_0x2cd7f9[_0x0012('0x38')][_0x0012('0x47')]){_0x4de297[_0x0012('0x44')]=_[_0x0012('0x48')](_0x4de297[_0x0012('0x44')],{'$or':_[_0x0012('0x37')](_0x4de297['attributes'],function(_0x49cd17){var _0x5d13c2={};_0x5d13c2[_0x49cd17]={'$like':'%'+_0x2cd7f9[_0x0012('0x38')][_0x0012('0x47')]+'%'};return _0x5d13c2;})});}_0x4de297=_[_0x0012('0x48')]({},_0x4de297,_0x2cd7f9[_0x0012('0x4a')]);return _0x10acaa[_0x0012('0x7f')](_0x4de297);}})[_0x0012('0x29')](function(_0x314645){if(_0x314645){_0x6b90b3=_0x314645[_0x0012('0x3e')];if(!_0x2cd7f9[_0x0012('0x38')][_0x0012('0x3f')](_0x0012('0x40'))){_0x4de297[_0x0012('0x41')]=qs[_0x0012('0x41')](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x41')]);_0x4de297[_0x0012('0x20')]=qs['offset'](_0x2cd7f9[_0x0012('0x38')][_0x0012('0x20')]);}return _0x10acaa[_0x0012('0x7f')](_0x4de297);}})[_0x0012('0x29')](function(_0x3e8b0a){if(_0x3e8b0a){return _0x3e8b0a?{'count':_0x6b90b3,'rows':_0x3e8b0a}:null;}})[_0x0012('0x29')](respondWithResult(_0x30739b,null))[_0x0012('0x4f')](handleError(_0x30739b,null));};exports['addTeams']=function(_0x5e3240,_0x18aee3,_0x57f5a3){var _0x346739=_0x5e3240[_0x0012('0x54')][_0x0012('0x75')];var _0x270d2c;return db['Team']['findAll']({'where':{'id':_0x346739},'attributes':['id'],'include':[{'model':db[_0x0012('0x7e')],'as':_0x0012('0x80'),'attributes':['id','name',_0x0012('0x81'),'voicePause',_0x0012('0x82')],'raw':!![]}]})[_0x0012('0x29')](function(_0x22a7f8){if(_0x22a7f8){_0x270d2c=_0x22a7f8;var _0xe30fa=_[_0x0012('0x83')](_0x22a7f8,function(_0x250d30){var _0x300690=_0x250d30[_0x0012('0x2b')]({'plain':!![]});return _0x300690['Agents'];});return db[_0x0012('0x32')][_0x0012('0x50')]({'where':{'id':_0x5e3240['params']['id']}})['then'](function(_0x973452){return db[_0x0012('0x84')][_0x0012('0x53')](function(_0x26fa8a){return _0x973452[_0x0012('0x85')](_0x346739,{'transaction':_0x26fa8a})[_0x0012('0x29')](function(){return BPromise[_0x0012('0x86')](_0x270d2c,function(_0x5d3b2e){return db[_0x0012('0x87')][_0x0012('0x88')]({'TeamId':_0x5d3b2e['id'],'VoicePrefixId':_0x5e3240[_0x0012('0x74')]['id']},{'transaction':_0x26fa8a});});})[_0x0012('0x29')](function(){return BPromise['each'](_0xe30fa,function(_0x558eb3){return db['UserVoicePrefix'][_0x0012('0x89')]({'where':{'UserId':_0x558eb3['id'],'VoicePrefixId':_0x5e3240[_0x0012('0x74')]['id']},'transaction':_0x26fa8a});});})[_0x0012('0x29')](function(){_0xe30fa['forEach'](function(_0x24264b){socket[_0x0012('0x78')](_0x0012('0x8a'),{'UserId':_0x24264b['id'],'VoicePrefixId':_0x973452['id']});});});});});}})[_0x0012('0x29')](respondWithStatusCode(_0x18aee3,null))['catch'](handleError(_0x18aee3,null));};exports[_0x0012('0x8b')]=function(_0x12c6fa,_0x5b1cb3,_0x5cb8b9){return db['Team'][_0x0012('0x4d')]({'where':{'id':_0x12c6fa[_0x0012('0x38')][_0x0012('0x75')]},'attributes':['id'],'include':[{'model':db[_0x0012('0x7e')],'as':_0x0012('0x80'),'attributes':['id'],'raw':!![]}]})[_0x0012('0x29')](handleEntityNotFound(_0x5b1cb3,null))[_0x0012('0x29')](function(_0x2c186c){var _0x1c0814=_[_0x0012('0x37')](_0x2c186c,'id');var _0x1c1b75=[];var _0x272b17=[];var _0x504cba=squel['select']();_0x504cba['field']('tq.TeamId')[_0x0012('0x8c')](_0x0012('0x8d'),'tq')['join']('user_has_teams','ut',_0x0012('0x8e'))['where'](_0x0012('0x8f'),_0x12c6fa['params']['id']);for(var _0x58e8cf=0x0;_0x58e8cf<_0x2c186c[_0x0012('0x3e')];_0x58e8cf+=0x1){let _0x2c692=_0x2c186c[_0x58e8cf];for(var _0x3bad29=0x0;_0x3bad29<_0x2c692[_0x0012('0x80')]['length'];_0x3bad29+=0x1){let _0x4ccd2f=_0x2c692[_0x0012('0x80')][_0x3bad29];var _0x14b576=_0x504cba['clone']();_0x14b576[_0x0012('0x44')](_0x0012('0x90'),_0x4ccd2f['id']);_0x272b17[_0x0012('0x69')](db['sequelize'][_0x0012('0x38')](_0x14b576[_0x0012('0x91')](),{'type':db[_0x0012('0x84')][_0x0012('0x92')][_0x0012('0x93')]})['then'](function(_0x860c38){if(_0x860c38[_0x0012('0x3e')]===0x1){return _0x4ccd2f['id'];}else{var _0x316014=_['every'](_['map'](_0x860c38,_0x0012('0x94')),function(_0x50acf5){return _[_0x0012('0x95')](_0x1c0814,_0x50acf5);});if(_0x316014){return _0x4ccd2f['id'];}}}));}}return BPromise['all'](_0x272b17)[_0x0012('0x29')](function(_0x3153a3){_0x1c1b75=_(_0x1c1b75)[_0x0012('0x96')](_0x3153a3)[_0x0012('0x97')]()[_0x0012('0x98')]();return db['VoicePrefix'][_0x0012('0x50')]({'where':{'id':_0x12c6fa['params']['id']}})[_0x0012('0x29')](function(_0x343e40){return db['sequelize']['transaction'](function(_0x260d80){return _0x343e40[_0x0012('0x8b')](_0x12c6fa[_0x0012('0x38')]['ids'],{'transaction':_0x260d80})[_0x0012('0x29')](function(){if(!_[_0x0012('0x99')](_0x1c1b75)){return _0x343e40[_0x0012('0x79')](_0x1c1b75,{'transaction':_0x260d80});}})[_0x0012('0x29')](function(){_0x1c1b75['forEach'](function(_0x5d5544){socket[_0x0012('0x78')](_0x0012('0x7b'),{'UserId':_0x5d5544,'VoicePrefixId':_0x343e40['id']});});});});});});})['then'](respondWithStatusCode(_0x5b1cb3,null))[_0x0012('0x4f')](handleError(_0x5b1cb3,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index eec0917..76b0a99 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 _0x40bc=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','hook'];(function(_0x5302df,_0x4ad364){var _0x5b23b7=function(_0x2fa23a){while(--_0x2fa23a){_0x5302df['push'](_0x5302df['shift']());}};_0x5b23b7(++_0x4ad364);}(_0x40bc,0x12d));var _0xc40b=function(_0x394a85,_0xd2106e){_0x394a85=_0x394a85-0x0;var _0x3cb48f=_0x40bc[_0x394a85];return _0x3cb48f;};'use strict';var EventEmitter=require(_0xc40b('0x0'));var VoicePrefix=require(_0xc40b('0x1'))['db'][_0xc40b('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc40b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5abee5){return function(_0x4f288a,_0x173819,_0x4b75c4){VoicePrefixEvents['emit'](_0x5abee5+':'+_0x4f288a['id'],_0x4f288a);VoicePrefixEvents['emit'](_0x5abee5,_0x4f288a);_0x4b75c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xc40b('0x4')](e,emitEvent(event));}}module[_0xc40b('0x5')]=VoicePrefixEvents; \ No newline at end of file +var _0x2b06=['../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x35d8fd,_0x43083e){var _0x8298a6=function(_0x537b79){while(--_0x537b79){_0x35d8fd['push'](_0x35d8fd['shift']());}};_0x8298a6(++_0x43083e);}(_0x2b06,0x128));var _0x62b0=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x2b06[_0x12d033];return _0x3b4e80;};'use strict';var EventEmitter=require(_0x62b0('0x0'));var VoicePrefix=require(_0x62b0('0x1'))['db'][_0x62b0('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x62b0('0x3')](0x0);var events={'afterCreate':_0x62b0('0x4'),'afterUpdate':'update','afterDestroy':_0x62b0('0x5')};function emitEvent(_0x5a2956){return function(_0xe0cd56,_0x17161c,_0x54f29f){VoicePrefixEvents[_0x62b0('0x6')](_0x5a2956+':'+_0xe0cd56['id'],_0xe0cd56);VoicePrefixEvents[_0x62b0('0x6')](_0x5a2956,_0xe0cd56);_0x54f29f(null);};}for(var e in events){if(events[_0x62b0('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x62b0('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index c888338..92eef0e 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 _0xbb62=['rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','../../config/logger','api','bluebird'];(function(_0x21bc1d,_0x5cf2f7){var _0x4a9c53=function(_0x6e3637){while(--_0x6e3637){_0x21bc1d['push'](_0x21bc1d['shift']());}};_0x4a9c53(++_0x5cf2f7);}(_0xbb62,0x14d));var _0x2bb6=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xbb62[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2bb6('0x0'))(_0x2bb6('0x1'));var moment=require('moment');var BPromise=require(_0x2bb6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2bb6('0x3'));var config=require('../../config/environment');var attributes=require(_0x2bb6('0x4'));module[_0x2bb6('0x5')]=function(_0x3e1955,_0x239948){return _0x3e1955[_0x2bb6('0x6')](_0x2bb6('0x7'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e58=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x176c92,_0x3b7112){var _0x3e1a0a=function(_0x5ddb42){while(--_0x5ddb42){_0x176c92['push'](_0x176c92['shift']());}};_0x3e1a0a(++_0x3b7112);}(_0x4e58,0x11d));var _0x84e5=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x4e58[_0x18cac4];return _0x2227c6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x84e5('0x0'))(_0x84e5('0x1'));var moment=require(_0x84e5('0x2'));var BPromise=require(_0x84e5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x84e5('0x4'));var attributes=require(_0x84e5('0x5'));module[_0x84e5('0x6')]=function(_0x37c6ef,_0x3f9ceb){return _0x37c6ef[_0x84e5('0x7')](_0x84e5('0x8'),attributes,{'tableName':_0x84e5('0x9'),'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 d145246..9c474c2 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 _0x5bc1=['register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x153846,_0x1227ad){var _0x3ee557=function(_0x514e76){while(--_0x514e76){_0x153846['push'](_0x153846['shift']());}};_0x3ee557(++_0x1227ad);}(_0x5bc1,0xb5));var _0x15bc=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x5bc1[_0x1b349a];return _0x5d1f7c;};'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});config['redis']=_[_0x15bc('0xa')](config[_0x15bc('0xb')],{'host':_0x15bc('0xc'),'port':0x18eb});var socket=require(_0x15bc('0xd'))(new Redis(config[_0x15bc('0xb')]));require(_0x15bc('0xe'))[_0x15bc('0xf')](socket);function respondWithRpcPromise(_0x735271,_0x140fe5,_0x37302c){return new BPromise(function(_0x4c0eca,_0x18b502){return client[_0x15bc('0x10')](_0x735271,_0x37302c)[_0x15bc('0x11')](function(_0x4c24a7){logger[_0x15bc('0x12')](_0x15bc('0x13'),_0x140fe5,_0x15bc('0x14'));logger[_0x15bc('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x140fe5,_0x15bc('0x14'),JSON[_0x15bc('0x16')](_0x4c24a7));if(_0x4c24a7[_0x15bc('0x17')]){if(_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x18')]===0x1f4){logger[_0x15bc('0x17')](_0x15bc('0x13'),_0x140fe5,_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x19')]);return _0x18b502(_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x19')]);}logger[_0x15bc('0x17')](_0x15bc('0x13'),_0x140fe5,_0x4c24a7[_0x15bc('0x17')]['message']);return _0x4c0eca(_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x19')]);}else{logger[_0x15bc('0x12')](_0x15bc('0x13'),_0x140fe5,_0x15bc('0x14'));_0x4c0eca(_0x4c24a7[_0x15bc('0x1a')][_0x15bc('0x19')]);}})[_0x15bc('0x1b')](function(_0x2cab32){logger[_0x15bc('0x17')](_0x15bc('0x13'),_0x140fe5,_0x2cab32);_0x18b502(_0x2cab32);});});} \ No newline at end of file +var _0x3d3d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','request\x20sent','stringify','code','error','message','VoicePrefix,\x20%s,\x20%s','result','catch','util','moment','randomstring'];(function(_0x5cb34c,_0x39c633){var _0xfc1f8f=function(_0x1ee842){while(--_0x1ee842){_0x5cb34c['push'](_0x5cb34c['shift']());}};_0xfc1f8f(++_0x39c633);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var moment=require(_0xd3d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3d3('0x2'));var fs=require('fs');var Redis=require(_0xd3d3('0x3'));var db=require(_0xd3d3('0x4'))['db'];var utils=require(_0xd3d3('0x5'));var logger=require(_0xd3d3('0x6'))(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var jayson=require(_0xd3d3('0x9'));var client=jayson[_0xd3d3('0xa')][_0xd3d3('0xb')]({'port':0x232a});config['redis']=_[_0xd3d3('0xc')](config[_0xd3d3('0xd')],{'host':_0xd3d3('0xe'),'port':0x18eb});var socket=require(_0xd3d3('0xf'))(new Redis(config['redis']));require(_0xd3d3('0x10'))[_0xd3d3('0x11')](socket);function respondWithRpcPromise(_0x409e2c,_0x300cba,_0x53cb12){return new BPromise(function(_0x2c523f,_0x44599e){return client[_0xd3d3('0x12')](_0x409e2c,_0x53cb12)[_0xd3d3('0x13')](function(_0x1cd30a){logger[_0xd3d3('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x300cba,_0xd3d3('0x15'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x300cba,'request\x20sent',JSON[_0xd3d3('0x16')](_0x1cd30a));if(_0x1cd30a['error']){if(_0x1cd30a['error'][_0xd3d3('0x17')]===0x1f4){logger[_0xd3d3('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x300cba,_0x1cd30a[_0xd3d3('0x18')]['message']);return _0x44599e(_0x1cd30a['error'][_0xd3d3('0x19')]);}logger[_0xd3d3('0x18')](_0xd3d3('0x1a'),_0x300cba,_0x1cd30a[_0xd3d3('0x18')][_0xd3d3('0x19')]);return _0x2c523f(_0x1cd30a['error'][_0xd3d3('0x19')]);}else{logger[_0xd3d3('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x300cba,'request\x20sent');_0x2c523f(_0x1cd30a[_0xd3d3('0x1b')][_0xd3d3('0x19')]);}})[_0xd3d3('0x1c')](function(_0x5f4031){logger[_0xd3d3('0x18')](_0xd3d3('0x1a'),_0x300cba,_0x5f4031);_0x44599e(_0x5f4031);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 1e94ba2..1e125d0 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 _0xf4eb=['removeListener','register','./voicePrefix.events'];(function(_0x576217,_0x271e63){var _0x489efa=function(_0x5ae9fc){while(--_0x5ae9fc){_0x576217['push'](_0x576217['shift']());}};_0x489efa(++_0x271e63);}(_0xf4eb,0xec));var _0xbf4e=function(_0x330cb0,_0x53a425){_0x330cb0=_0x330cb0-0x0;var _0x5240e0=_0xf4eb[_0x330cb0];return _0x5240e0;};'use strict';var VoicePrefixEvents=require(_0xbf4e('0x0'));var events=['save','remove','update'];function createListener(_0x5ed5b9,_0xbbbf01){return function(_0x49d80e){_0xbbbf01['emit'](_0x5ed5b9,_0x49d80e);};}function removeListener(_0x2e3070,_0x1c7606){return function(){VoicePrefixEvents[_0xbf4e('0x1')](_0x2e3070,_0x1c7606);};}exports[_0xbf4e('0x2')]=function(_0xa4dcf5){for(var _0x2fcfed=0x0,_0x15b99f=events['length'];_0x2fcfed<_0x15b99f;_0x2fcfed++){var _0x449d55=events[_0x2fcfed];var _0x5013c2=createListener('voicePrefix:'+_0x449d55,_0xa4dcf5);VoicePrefixEvents['on'](_0x449d55,_0x5013c2);}}; \ No newline at end of file +var _0xcd60=['register','length','./voicePrefix.events','save','remove','update','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd60,0xf0));var _0x0cd6=function(_0xf1e2c0,_0x1f3a23){_0xf1e2c0=_0xf1e2c0-0x0;var _0x188bd6=_0xcd60[_0xf1e2c0];return _0x188bd6;};'use strict';var VoicePrefixEvents=require(_0x0cd6('0x0'));var events=[_0x0cd6('0x1'),_0x0cd6('0x2'),_0x0cd6('0x3')];function createListener(_0x15e600,_0x455593){return function(_0x155444){_0x455593['emit'](_0x15e600,_0x155444);};}function removeListener(_0x10c2b8,_0x117c2e){return function(){VoicePrefixEvents[_0x0cd6('0x4')](_0x10c2b8,_0x117c2e);};}exports[_0x0cd6('0x5')]=function(_0x3b4f35){for(var _0x5f4525=0x0,_0x2ceb47=events[_0x0cd6('0x6')];_0x5f4525<_0x2ceb47;_0x5f4525++){var _0x47c8b2=events[_0x5f4525];var _0x4714bf=createListener('voicePrefix:'+_0x47c8b2,_0x3b4f35);VoicePrefixEvents['on'](_0x47c8b2,_0x4714bf);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index d07a89a..502219f 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 _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(_0x18fcde,_0x20f1c1){var _0x29bfb7=function(_0x4710f1){while(--_0x4710f1){_0x18fcde['push'](_0x18fcde['shift']());}};_0x29bfb7(++_0x20f1c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _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(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xb10b,0x12a));var _0xbb10=function(_0x19f00f,_0x181deb){_0x19f00f=_0x19f00f-0x0;var _0x332a97=_0xb10b[_0x19f00f];return _0x332a97;};'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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 6706cf4..2db12d4 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 _0x14a6=['inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM'];(function(_0x5cc94b,_0x466942){var _0x46de2d=function(_0x2afe23){while(--_0x2afe23){_0x5cc94b['push'](_0x5cc94b['shift']());}};_0x46de2d(++_0x466942);}(_0x14a6,0x93));var _0x614a=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0x14a6[_0x3794a0];return _0x5bdaba;};'use strict';var Sequelize=require(_0x614a('0x0'));module[_0x614a('0x1')]={'name':{'type':Sequelize[_0x614a('0x2')],'allowNull':![],'unique':_0x614a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x5'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x614a('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x614a('0x4')]('rr',_0x614a('0x6'),_0x614a('0x7'),_0x614a('0x8'),_0x614a('0x9'),_0x614a('0xa'),_0x614a('0xb'),_0x614a('0xc'),_0x614a('0xd')),'allowNull':![],'defaultValue':_0x614a('0x6'),'set':function(_0x4279a0){this[_0x614a('0xe')](_0x614a('0xf'),_0x4279a0?_0x4279a0:'rrmemory');},'get':function(){var _0x3c3a25=this[_0x614a('0x10')](_0x614a('0x11'));var _0x55c501=this[_0x614a('0x10')](_0x614a('0x12'));var _0x11519a=this['getDataValue'](_0x614a('0xf'));if(_0x3c3a25===_0x614a('0x5')){return _0x11519a;}if(_0x55c501==='booked'&&_0x11519a===_0x614a('0xa')||_0x55c501===_0x614a('0x13')&&_0x11519a===_0x614a('0x14')){return _0x11519a;}if(_0x55c501===_0x614a('0x15')||_0x55c501===_0x614a('0x16')||_0x55c501===_0x614a('0x17')){return _0x11519a;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x614a('0x18')](0xb)},'timeout':{'type':Sequelize[_0x614a('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x614a('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x614a('0x2')]},'weight':{'type':Sequelize[_0x614a('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x614a('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x614a('0x4')]('yes','no'),'defaultValue':_0x614a('0x19')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x614a('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x614a('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x614a('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x614a('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x614a('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x614a('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x614a('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x614a('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x614a('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x614a('0x4')]('yes','no'),'defaultValue':_0x614a('0x19')},'announce_holdtime':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x19'),'no',_0x614a('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x614a('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x614a('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x614a('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x614a('0x2')]},'queue_youarenext':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x614a('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x614a('0x2')]},'queue_quantity1':{'type':Sequelize[_0x614a('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x614a('0x2')]},'queue_less_than':{'type':Sequelize[_0x614a('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x34a0a8){this[_0x614a('0xe')]('periodic_announce',_0x34a0a8?_0x34a0a8[_0x614a('0x1c')](','):[]);},'get':function(){return this[_0x614a('0x10')]('periodic_announce')?this['getDataValue'](_0x614a('0x1d'))[_0x614a('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x614a('0x19'),'set':function(_0x1e25ef){this[_0x614a('0xe')](_0x614a('0x1f'),_0x1e25ef?_0x1e25ef['join'](','):undefined);},'get':function(){return this[_0x614a('0x10')](_0x614a('0x1f'))?this[_0x614a('0x10')](_0x614a('0x1f'))[_0x614a('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x614a('0x2')],'defaultValue':'no','set':function(_0x519f92){this['setDataValue'](_0x614a('0x20'),_0x519f92?_0x519f92[_0x614a('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x614a('0x20'))?this[_0x614a('0x10')](_0x614a('0x20'))[_0x614a('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x614a('0x2')]},'description':{'type':Sequelize[_0x614a('0x2')]},'acw':{'type':Sequelize[_0x614a('0x21')],'defaultValue':0x0,'set':function(_0x419ffd){this['setDataValue']('acw',_0x419ffd);if(_0x419ffd){if(this[_0x614a('0x10')](_0x614a('0x22'))<0x2){this['setDataValue'](_0x614a('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x614a('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x614a('0x23')},'dialMethod':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x24'),_0x614a('0x15'),_0x614a('0x17'),_0x614a('0x16'),_0x614a('0x13')),'defaultValue':'progressive','comment':_0x614a('0x25')},'dialLimitChannel':{'type':Sequelize[_0x614a('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x614a('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x614a('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x614a('0x28')},'dialPowerLevel':{'type':Sequelize[_0x614a('0x29')](0x2)[_0x614a('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x614a('0x2a')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x614a('0x2b')),'defaultValue':'dropRate','comment':_0x614a('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x614a('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x614a('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x614a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x614a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x614a('0x2')],'defaultValue':'tTxX','comment':_0x614a('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x614a('0x2f')},'dialQueueProject':{'type':Sequelize[_0x614a('0x2')],'comment':_0x614a('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x614a('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x614a('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x614a('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x614a('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0x3,'comment':_0x614a('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x614a('0x18')](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x614a('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x614a('0x36')},'dialTimezone':{'type':Sequelize[_0x614a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x614a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x614a('0x37')),'defaultValue':_0x614a('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x614a('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x614a('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x614a('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x614a('0x18')](0x9)[_0x614a('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x614a('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x614a('0x18')](0x9)[_0x614a('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x614a('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x614a('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x614a('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x614a('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x614a('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x614a('0x18')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x614a('0x18')](0x5)[_0x614a('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x614a('0x18')](0x9)[_0x614a('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x614a('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x614a('0x21')],'defaultValue':0x0,'comment':_0x614a('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x614a('0x4')](_0x614a('0x42'),_0x614a('0x43')),'defaultValue':_0x614a('0x42')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x614a('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x614a('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x614a('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x614a('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x614a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x614a('0x18')](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x614a('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x614a('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x614a('0x18')](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x614a('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x614a('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x614a('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x614a('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x614a('0x18')](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x614a('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x614a('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x614a('0x18')](0x5)[_0x614a('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x614a('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x614a('0x21')],'defaultValue':![],'comment':_0x614a('0x4a'),'set':function(_0x4a6b9d){if(!_0x4a6b9d)this[_0x614a('0xe')](_0x614a('0x4b'),null);this['setDataValue']('mandatoryDisposition',_0x4a6b9d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x614a('0x18')](0x3)[_0x614a('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x614a('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x614a('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x614a('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0x5eb3=['Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','name','inbound','outbound','default','STRING','ENUM','ringall','random','rrmemory','linear','rrordered','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview'];(function(_0x34b2ba,_0x401b23){var _0x2d9121=function(_0x28009b){while(--_0x28009b){_0x34b2ba['push'](_0x34b2ba['shift']());}};_0x2d9121(++_0x401b23);}(_0x5eb3,0x12f));var _0x35eb=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x5eb3[_0xd22d95];return _0x15d7a3;};'use strict';var Sequelize=require(_0x35eb('0x0'));module[_0x35eb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35eb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x35eb('0x3'),_0x35eb('0x4')),'allowNull':![],'defaultValue':_0x35eb('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x35eb('0x5')},'announce':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x35eb('0x7')]('rr',_0x35eb('0x8'),'leastrecent','fewestcalls',_0x35eb('0x9'),_0x35eb('0xa'),_0x35eb('0xb'),'wrandom',_0x35eb('0xc')),'allowNull':![],'defaultValue':_0x35eb('0x8'),'set':function(_0x513810){this['setDataValue'](_0x35eb('0xd'),_0x513810?_0x513810:_0x35eb('0xa'));},'get':function(){var _0x3b03ce=this[_0x35eb('0xe')](_0x35eb('0xf'));var _0x4ac37e=this['getDataValue'](_0x35eb('0x10'));var _0x3c3dec=this[_0x35eb('0xe')](_0x35eb('0xd'));if(_0x3b03ce==='inbound'){return _0x3c3dec;}if(_0x4ac37e===_0x35eb('0x11')&&_0x3c3dec===_0x35eb('0xa')||_0x4ac37e===_0x35eb('0x11')&&_0x3c3dec===_0x35eb('0x12')){return _0x3c3dec;}if(_0x4ac37e===_0x35eb('0x13')||_0x4ac37e===_0x35eb('0x14')||_0x4ac37e===_0x35eb('0x15')){return _0x3c3dec;}return null;}},'servicelevel':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x35eb('0x16')](0xb)},'timeout':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x35eb('0x6')]},'weight':{'type':Sequelize[_0x35eb('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x35eb('0x7')]('yes','no'),'defaultValue':_0x35eb('0x17')},'autopause':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no',_0x35eb('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x35eb('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x35eb('0x7')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x35eb('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defaultValue':_0x35eb('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x35eb('0x17'),'no',_0x35eb('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x35eb('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x35eb('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x35eb('0x6')]},'queue_youarenext':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x35eb('0x6')]},'queue_quantity1':{'type':Sequelize[_0x35eb('0x6')]},'queue_quantity2':{'type':Sequelize[_0x35eb('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x35eb('0x6')]},'queue_less_than':{'type':Sequelize[_0x35eb('0x6')]},'periodic_announce':{'type':Sequelize[_0x35eb('0x1a')],'set':function(_0x208676){this[_0x35eb('0x1b')](_0x35eb('0x1c'),_0x208676?_0x208676['join'](','):[]);},'get':function(){return this[_0x35eb('0xe')](_0x35eb('0x1c'))?this[_0x35eb('0xe')](_0x35eb('0x1c'))[_0x35eb('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':_0x35eb('0x17'),'set':function(_0x34f89a){this[_0x35eb('0x1b')](_0x35eb('0x1e'),_0x34f89a?_0x34f89a[_0x35eb('0x1f')](','):undefined);},'get':function(){return this[_0x35eb('0xe')]('joinempty')?this[_0x35eb('0xe')]('joinempty')[_0x35eb('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5a6f36){this[_0x35eb('0x1b')](_0x35eb('0x20'),_0x5a6f36?_0x5a6f36[_0x35eb('0x1f')](','):undefined);},'get':function(){return this[_0x35eb('0xe')]('leavewhenempty')?this[_0x35eb('0xe')](_0x35eb('0x20'))[_0x35eb('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x35eb('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x35eb('0x6')]},'description':{'type':Sequelize[_0x35eb('0x6')]},'acw':{'type':Sequelize[_0x35eb('0x21')],'defaultValue':0x0,'set':function(_0x16c920){this[_0x35eb('0x1b')]('acw',_0x16c920);if(_0x16c920){if(this[_0x35eb('0xe')](_0x35eb('0x22'))<0x2){this[_0x35eb('0x1b')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x35eb('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x35eb('0x23')},'dialMethod':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x24'),_0x35eb('0x13'),'power',_0x35eb('0x14'),'booked'),'defaultValue':_0x35eb('0x13'),'comment':_0x35eb('0x25')},'dialLimitChannel':{'type':Sequelize[_0x35eb('0x16')](0x4)[_0x35eb('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x35eb('0x27')},'dialLimitQueue':{'type':Sequelize[_0x35eb('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x35eb('0x28')},'dialPowerLevel':{'type':Sequelize[_0x35eb('0x29')](0x2)[_0x35eb('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x35eb('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x35eb('0x7')](_0x35eb('0x2b'),_0x35eb('0x2c')),'defaultValue':_0x35eb('0x2c'),'comment':_0x35eb('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x35eb('0x29')](0x2)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x35eb('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x35eb('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x35eb('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x35eb('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35eb('0x30')},'dialQueueOptions':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':'tTxX','comment':_0x35eb('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35eb('0x32')},'dialQueueProject':{'type':Sequelize[_0x35eb('0x6')],'comment':_0x35eb('0x33')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35eb('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35eb('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x3,'comment':_0x35eb('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x35eb('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':_0x35eb('0x38')},'dialPrefix':{'type':Sequelize[_0x35eb('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x35eb('0x7')]('always',_0x35eb('0x39'),_0x35eb('0x3a')),'defaultValue':_0x35eb('0x3b')},'dialAMDActive':{'type':Sequelize[_0x35eb('0x21')],'defaultValue':0x0,'comment':_0x35eb('0x3c')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x35eb('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x35eb('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x35eb('0x16')](0x9)[_0x35eb('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x35eb('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x35eb('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x35eb('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x35eb('0x16')](0x9)[_0x35eb('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x35eb('0x16')](0x9)[_0x35eb('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x35eb('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x35eb('0x16')](0x9)[_0x35eb('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x35eb('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x35eb('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x35eb('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x35eb('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x35eb('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x35eb('0x21')],'defaultValue':0x0,'comment':_0x35eb('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x35eb('0x7')]('DESC',_0x35eb('0x46')),'defaultValue':_0x35eb('0x47')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x35eb('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x35eb('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x35eb('0x48')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x35eb('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x35eb('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35eb('0x4a')},'dialDropMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35eb('0x4b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35eb('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35eb('0x4d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35eb('0x4e')},'dialMachineMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35eb('0x4f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x35eb('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35eb('0x50')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x35eb('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x35eb('0x16')](0x5)[_0x35eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35eb('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35eb('0x16')],'allowNull':!![],'comment':_0x35eb('0x52')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x35eb('0x53'),'set':function(_0x3f5f7a){if(!_0x3f5f7a)this[_0x35eb('0x1b')](_0x35eb('0x54'),null);this[_0x35eb('0x1b')]('mandatoryDisposition',_0x3f5f7a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x35eb('0x16')](0x3)[_0x35eb('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x35eb('0x21')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index c9e2308..a1daefe 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 _0x3fc6=['TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','interface','format','SIP/%s','userVoiceQueue:save','ids','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','emit','isEmpty','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ListId','select','phone','ContactId','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','CmListId','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','inbound','outbound','ignore','map','value','type','find','name','UserProfileResource','error','stack','send','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','merge','VoiceQueue','includeAll','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','VoiceQueues','QueueCampaigns','UserProfileSection','autoAssociation','clone','include','omit','createdAt','updatedAt','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','nolimit','VoiceQueueId','CmHopper','rows','CmHopperHistory','options','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','flatMap','forEach','penalty','sequelize','transaction'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x3fc6,0x115));var _0x63fc=function(_0x1ffd41,_0x35032f){_0x1ffd41=_0x1ffd41-0x0;var _0x43c979=_0x3fc6[_0x1ffd41];return _0x43c979;};'use strict';var emlformat=require(_0x63fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63fc('0x1'));var jsonpatch=require(_0x63fc('0x2'));var rp=require(_0x63fc('0x3'));var moment=require(_0x63fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x63fc('0x5'));var util=require(_0x63fc('0x6'));var path=require(_0x63fc('0x7'));var sox=require('sox');var csv=require(_0x63fc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63fc('0x9'));var _=require(_0x63fc('0xa'));var squel=require(_0x63fc('0xb'));var crypto=require('crypto');var jsforce=require(_0x63fc('0xc'));var deskjs=require(_0x63fc('0xd'));var toCsv=require(_0x63fc('0x8'));var querystring=require(_0x63fc('0xe'));var Papa=require(_0x63fc('0xf'));var Redis=require('ioredis');var authService=require(_0x63fc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63fc('0x11'));var logger=require(_0x63fc('0x12'))(_0x63fc('0x13'));var utils=require(_0x63fc('0x14'));var config=require(_0x63fc('0x15'));var licenseUtil=require(_0x63fc('0x16'));var db=require(_0x63fc('0x17'))['db'];config[_0x63fc('0x18')]=_['defaults'](config[_0x63fc('0x18')],{'host':_0x63fc('0x19'),'port':0x18eb});var socket=require(_0x63fc('0x1a'))(new Redis(config['redis']));require(_0x63fc('0x1b'))[_0x63fc('0x1c')](socket);function respondWithStatusCode(_0x3979f4,_0x563f50){_0x563f50=_0x563f50||0xcc;return function(_0x56dfb8){if(_0x56dfb8){return _0x3979f4[_0x63fc('0x1d')](_0x563f50);}return _0x3979f4[_0x63fc('0x1e')](_0x563f50)[_0x63fc('0x1f')]();};}function respondWithResult(_0x1584d8,_0x2f14eb){_0x2f14eb=_0x2f14eb||0xc8;return function(_0x34553f){if(_0x34553f){return _0x1584d8[_0x63fc('0x1e')](_0x2f14eb)[_0x63fc('0x20')](_0x34553f);}};}function respondWithFilteredResult(_0x13612e,_0x893552){return function(_0x2db18b){if(_0x2db18b){var _0x1283f8=typeof _0x893552[_0x63fc('0x21')]==='undefined'&&typeof _0x893552[_0x63fc('0x22')]===_0x63fc('0x23');var _0x2db848=_0x2db18b[_0x63fc('0x24')];var _0x3a3924=_0x1283f8?0x0:_0x893552['offset'];var _0x1ba025=_0x1283f8?_0x2db18b[_0x63fc('0x24')]:_0x893552[_0x63fc('0x21')]+_0x893552['limit'];var _0x5eb35d;if(_0x1ba025>=_0x2db848){_0x1ba025=_0x2db848;_0x5eb35d=0xc8;}else{_0x5eb35d=0xce;}_0x13612e[_0x63fc('0x1e')](_0x5eb35d);return _0x13612e[_0x63fc('0x25')](_0x63fc('0x26'),_0x3a3924+'-'+_0x1ba025+'/'+_0x2db848)['json'](_0x2db18b);}return null;};}function patchUpdates(_0x1053c7){return function(_0x26e442){try{jsonpatch[_0x63fc('0x27')](_0x26e442,_0x1053c7,!![]);}catch(_0x5d5c42){return BPromise[_0x63fc('0x28')](_0x5d5c42);}return _0x26e442['save']();};}function saveUpdates(_0x1b012e,_0x54ebf6){return function(_0x184e5e){if(_0x184e5e){return _0x184e5e[_0x63fc('0x29')](_0x1b012e)[_0x63fc('0x2a')](function(_0x327dc2){return _0x327dc2;});}return null;};}function removeEntity(_0x1a349d,_0x214424){return function(_0x54cef4){if(_0x54cef4){return _0x54cef4[_0x63fc('0x2b')]()[_0x63fc('0x2a')](function(){var _0x2dda64=_0x54cef4['get']({'plain':!![]});var _0x2da8c1=[{'name':'VoiceQueues','value':_0x63fc('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0x63fc('0x2d'),'ignore':![]}];var _0x37263b=_(_0x2da8c1)['filter'](_0x63fc('0x2e'))[_0x63fc('0x2f')](_0x63fc('0x30'))[_0x63fc('0x30')]();if(_['includes'](_0x37263b,_0x2dda64[_0x63fc('0x31')])){return;}var _0x496dbd=_[_0x63fc('0x32')](_0x2da8c1,[_0x63fc('0x30'),_0x2dda64['type']])[_0x63fc('0x33')];return db[_0x63fc('0x34')][_0x63fc('0x2b')]({'where':{'type':_0x496dbd,'resourceId':_0x2dda64['id']}})[_0x63fc('0x2a')](function(){return _0x54cef4;});})[_0x63fc('0x2a')](function(){_0x1a349d[_0x63fc('0x1e')](0xcc)[_0x63fc('0x1f')]();});}};}function handleEntityNotFound(_0x1206bb,_0x31de33){return function(_0x2dbb1d){if(!_0x2dbb1d){_0x1206bb['sendStatus'](0x194);}return _0x2dbb1d;};}function handleError(_0x140759,_0x558376){_0x558376=_0x558376||0x1f4;return function(_0x158397){logger[_0x63fc('0x35')](_0x158397[_0x63fc('0x36')]);if(_0x158397[_0x63fc('0x33')]){delete _0x158397[_0x63fc('0x33')];}_0x140759[_0x63fc('0x1e')](_0x558376)[_0x63fc('0x37')](_0x158397);};}exports['index']=function(_0x3ea18b,_0xd2a3d7){var _0x1c495a={},_0x1a3c24={},_0x4a5a3d={'count':0x0,'rows':[]};var _0x4aa3b1=_[_0x63fc('0x2f')](db['VoiceQueue'][_0x63fc('0x38')],function(_0xb7d203){return{'name':_0xb7d203[_0x63fc('0x39')],'type':_0xb7d203[_0x63fc('0x31')][_0x63fc('0x3a')]};});_0x1a3c24[_0x63fc('0x3b')]=_['map'](_0x4aa3b1,_0x63fc('0x33'));_0x1a3c24['query']=_[_0x63fc('0x3c')](_0x3ea18b[_0x63fc('0x3d')]);_0x1a3c24['filters']=_[_0x63fc('0x3e')](_0x1a3c24[_0x63fc('0x3b')],_0x1a3c24[_0x63fc('0x3d')]);_0x1c495a[_0x63fc('0x3f')]=_[_0x63fc('0x3e')](_0x1a3c24[_0x63fc('0x3b')],qs[_0x63fc('0x40')](_0x3ea18b[_0x63fc('0x3d')][_0x63fc('0x40')]));_0x1c495a[_0x63fc('0x3f')]=_0x1c495a[_0x63fc('0x3f')][_0x63fc('0x41')]?_0x1c495a[_0x63fc('0x3f')]:_0x1a3c24[_0x63fc('0x3b')];if(!_0x3ea18b[_0x63fc('0x3d')]['hasOwnProperty']('nolimit')){_0x1c495a['limit']=qs[_0x63fc('0x22')](_0x3ea18b['query'][_0x63fc('0x22')]);_0x1c495a['offset']=qs[_0x63fc('0x21')](_0x3ea18b[_0x63fc('0x3d')][_0x63fc('0x21')]);}_0x1c495a[_0x63fc('0x42')]=qs[_0x63fc('0x43')](_0x3ea18b[_0x63fc('0x3d')][_0x63fc('0x43')]);_0x1c495a['where']=qs['filters'](_[_0x63fc('0x44')](_0x3ea18b[_0x63fc('0x3d')],_0x1a3c24[_0x63fc('0x45')]),_0x4aa3b1);if(_0x3ea18b[_0x63fc('0x3d')][_0x63fc('0x46')]){_0x1c495a[_0x63fc('0x47')]=_[_0x63fc('0x48')](_0x1c495a[_0x63fc('0x47')],{'$or':_[_0x63fc('0x2f')](_0x4aa3b1,function(_0x192757){if(_0x192757[_0x63fc('0x31')]!=='VIRTUAL'){var _0x97c7a={};_0x97c7a[_0x192757['name']]={'$like':'%'+_0x3ea18b['query'][_0x63fc('0x46')]+'%'};return _0x97c7a;}})});}_0x1c495a=_[_0x63fc('0x48')]({},_0x1c495a,_0x3ea18b['options']);var _0x15e550={'where':_0x1c495a[_0x63fc('0x47')]};return db[_0x63fc('0x49')]['count'](_0x15e550)['then'](function(_0x802843){_0x4a5a3d[_0x63fc('0x24')]=_0x802843;if(_0x3ea18b[_0x63fc('0x3d')][_0x63fc('0x4a')]){_0x1c495a['include']=[{'all':!![]}];}return db[_0x63fc('0x49')][_0x63fc('0x4b')](_0x1c495a);})[_0x63fc('0x2a')](function(_0x219b69){_0x4a5a3d['rows']=_0x219b69;return _0x4a5a3d;})[_0x63fc('0x2a')](respondWithFilteredResult(_0xd2a3d7,_0x1c495a))[_0x63fc('0x4c')](handleError(_0xd2a3d7,null));};exports[_0x63fc('0x4d')]=function(_0x1b3bb7,_0x1a796f){var _0xc47db9={'raw':![],'where':{'id':_0x1b3bb7[_0x63fc('0x4e')]['id']}},_0x101686={};_0x101686[_0x63fc('0x3b')]=_[_0x63fc('0x3c')](db[_0x63fc('0x49')]['rawAttributes']);_0x101686['query']=_[_0x63fc('0x3c')](_0x1b3bb7[_0x63fc('0x3d')]);_0x101686[_0x63fc('0x45')]=_[_0x63fc('0x3e')](_0x101686[_0x63fc('0x3b')],_0x101686[_0x63fc('0x3d')]);_0xc47db9['attributes']=_['intersection'](_0x101686['model'],qs['fields'](_0x1b3bb7['query'][_0x63fc('0x40')]));_0xc47db9['attributes']=_0xc47db9[_0x63fc('0x3f')]['length']?_0xc47db9[_0x63fc('0x3f')]:_0x101686[_0x63fc('0x3b')];if(_0x1b3bb7[_0x63fc('0x3d')][_0x63fc('0x4a')]){_0xc47db9['include']=[{'all':!![]}];}_0xc47db9=_[_0x63fc('0x48')]({},_0xc47db9,_0x1b3bb7['options']);return db['VoiceQueue']['find'](_0xc47db9)[_0x63fc('0x2a')](handleEntityNotFound(_0x1a796f,null))['then'](respondWithResult(_0x1a796f,null))['catch'](handleError(_0x1a796f,null));};exports[_0x63fc('0x4f')]=function(_0x173a34,_0x213f3f){return db[_0x63fc('0x49')][_0x63fc('0x4f')](_0x173a34[_0x63fc('0x50')],{})[_0x63fc('0x2a')](function(_0x257f49){var _0x5b879e=_0x173a34['user']['get']({'plain':!![]});if(!_0x5b879e)throw new Error(_0x63fc('0x51'));if(_0x5b879e[_0x63fc('0x52')]==='user'){var _0x4c24ac=_0x257f49[_0x63fc('0x53')]({'plain':!![]});var _0x2f2c90=[{'name':_0x63fc('0x54'),'value':_0x63fc('0x2c')},{'name':_0x63fc('0x55'),'value':'outbound'}];var _0x5492e1=_['find'](_0x2f2c90,[_0x63fc('0x30'),_0x4c24ac['type']])[_0x63fc('0x33')];return db[_0x63fc('0x56')][_0x63fc('0x32')]({'where':{'name':_0x5492e1,'userProfileId':_0x5b879e['userProfileId']},'raw':!![]})[_0x63fc('0x2a')](function(_0x4bcf56){if(_0x4bcf56&&_0x4bcf56[_0x63fc('0x57')]===0x0){return db[_0x63fc('0x34')][_0x63fc('0x4f')]({'name':_0x4c24ac[_0x63fc('0x33')],'resourceId':_0x4c24ac['id'],'type':_0x4bcf56[_0x63fc('0x33')],'sectionId':_0x4bcf56['id']},{})['then'](function(){return _0x257f49;});}else{return _0x257f49;}})[_0x63fc('0x4c')](function(_0x550000){logger[_0x63fc('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x550000);throw _0x550000;});}return _0x257f49;})['then'](respondWithResult(_0x213f3f,0xc9))[_0x63fc('0x4c')](handleError(_0x213f3f,null));};exports[_0x63fc('0x58')]=function(_0x5a97b9,_0x5c5ec2){var _0x4322a3={'where':{'id':_0x5a97b9[_0x63fc('0x4e')]['id']}},_0x5e86d1={};_0x5e86d1[_0x63fc('0x3b')]=_[_0x63fc('0x3c')](db[_0x63fc('0x49')][_0x63fc('0x38')]);_0x4322a3['attributes']=_[_0x63fc('0x3e')](_0x5e86d1[_0x63fc('0x3b')],qs['fields'](_0x5a97b9[_0x63fc('0x3d')][_0x63fc('0x40')]));_0x4322a3[_0x63fc('0x3f')]=_0x4322a3['attributes']['length']?_0x4322a3[_0x63fc('0x3f')]:_0x5e86d1[_0x63fc('0x3b')];if(_0x5a97b9['query'][_0x63fc('0x4a')]){_0x4322a3[_0x63fc('0x59')]=[{'all':!![]}];}_0x4322a3=_[_0x63fc('0x48')]({},_0x4322a3,_0x5a97b9['options']);return db[_0x63fc('0x49')]['find'](_0x4322a3)[_0x63fc('0x2a')](handleEntityNotFound(_0x5c5ec2,null))[_0x63fc('0x2a')](function(_0x1f0675){if(_0x1f0675){var _0x5c627d=_0x1f0675[_0x63fc('0x53')]({'plain':!![]});_0x5c627d=qs[_0x63fc('0x5a')](_0x5c627d,['id',_0x63fc('0x5b'),_0x63fc('0x5c')]);_0x5a97b9['body']=_[_0x63fc('0x5a')](_0x5a97b9[_0x63fc('0x50')],['id',_0x63fc('0x5b'),'updatedAt']);return db[_0x63fc('0x49')][_0x63fc('0x4f')](_[_0x63fc('0x48')](_0x5c627d,_0x5a97b9[_0x63fc('0x50')]),{'include':_0x5a97b9['query']['includeAll']?[{'all':!![]}]:undefined})[_0x63fc('0x2a')](function(_0x1d4431){var _0x1b097e=_0x5a97b9[_0x63fc('0x5d')][_0x63fc('0x53')]({'plain':!![]});if(!_0x1b097e)throw new Error(_0x63fc('0x51'));if(_0x1b097e[_0x63fc('0x52')]===_0x63fc('0x5d')){var _0x3d854e=_0x1d4431[_0x63fc('0x53')]({'plain':!![]});var _0x2b1e02=[{'name':_0x63fc('0x54'),'value':_0x63fc('0x2c')},{'name':'QueueCampaigns','value':_0x63fc('0x2d')}];var _0x2dbf58=_[_0x63fc('0x32')](_0x2b1e02,[_0x63fc('0x30'),_0x3d854e[_0x63fc('0x31')]])[_0x63fc('0x33')];return db[_0x63fc('0x56')][_0x63fc('0x32')]({'where':{'name':_0x2dbf58,'userProfileId':_0x1b097e['userProfileId']},'raw':!![]})['then'](function(_0x28be91){if(_0x28be91&&_0x28be91[_0x63fc('0x57')]===0x0){return db[_0x63fc('0x34')][_0x63fc('0x4f')]({'name':_0x3d854e['name'],'resourceId':_0x3d854e['id'],'type':_0x28be91[_0x63fc('0x33')],'sectionId':_0x28be91['id']},{})['then'](function(){return _0x1d4431;});}else{return _0x1d4431;}})[_0x63fc('0x4c')](function(_0x370da2){logger[_0x63fc('0x35')](_0x63fc('0x5e'),_0x370da2);throw _0x370da2;});}return _0x1d4431;});}})[_0x63fc('0x2a')](respondWithResult(_0x5c5ec2,0xc9))[_0x63fc('0x4c')](handleError(_0x5c5ec2,null));};exports[_0x63fc('0x29')]=function(_0x507956,_0x362830){if(_0x507956['body']['id']){delete _0x507956[_0x63fc('0x50')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x507956[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x362830,null))[_0x63fc('0x2a')](saveUpdates(_0x507956[_0x63fc('0x50')],null))[_0x63fc('0x2a')](respondWithResult(_0x362830,null))['catch'](handleError(_0x362830,null));};exports[_0x63fc('0x2b')]=function(_0x7832ed,_0xeffdc4){return db[_0x63fc('0x49')][_0x63fc('0x32')]({'where':{'id':_0x7832ed[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0xeffdc4,null))[_0x63fc('0x2a')](removeEntity(_0xeffdc4,null))[_0x63fc('0x4c')](handleError(_0xeffdc4,null));};exports[_0x63fc('0x5f')]=function(_0x48caf5,_0x244252,_0x77e628){var _0x1e3bb5={'raw':![],'where':{}};var _0x375fbc={};var _0x34cea9={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x63fc('0x60')]({'where':{'id':_0x48caf5[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x244252,null))[_0x63fc('0x2a')](function(_0x5d08c3){if(_0x5d08c3){_0x375fbc[_0x63fc('0x3b')]=_[_0x63fc('0x3c')](db['CmHopper'][_0x63fc('0x38')]);_0x375fbc[_0x63fc('0x3d')]=_[_0x63fc('0x3c')](_0x48caf5['query']);_0x375fbc[_0x63fc('0x45')]=_[_0x63fc('0x3e')](_0x375fbc[_0x63fc('0x3b')],_0x375fbc[_0x63fc('0x3d')]);_0x1e3bb5[_0x63fc('0x3f')]=_[_0x63fc('0x3e')](_0x375fbc[_0x63fc('0x3b')],qs[_0x63fc('0x40')](_0x48caf5['query'][_0x63fc('0x40')]));_0x1e3bb5[_0x63fc('0x3f')]=_0x1e3bb5[_0x63fc('0x3f')]['length']?_0x1e3bb5[_0x63fc('0x3f')]:_0x375fbc[_0x63fc('0x3b')];if(!_0x48caf5['query'][_0x63fc('0x61')](_0x63fc('0x62'))){_0x1e3bb5[_0x63fc('0x22')]=qs['limit'](_0x48caf5[_0x63fc('0x3d')]['limit']);_0x1e3bb5[_0x63fc('0x21')]=qs[_0x63fc('0x21')](_0x48caf5[_0x63fc('0x3d')][_0x63fc('0x21')]);}_0x1e3bb5[_0x63fc('0x42')]=qs[_0x63fc('0x43')](_0x48caf5[_0x63fc('0x3d')]['sort']);_0x1e3bb5[_0x63fc('0x47')]=qs[_0x63fc('0x45')](_[_0x63fc('0x44')](_0x48caf5['query'],_0x375fbc[_0x63fc('0x45')]));_0x1e3bb5[_0x63fc('0x47')][_0x63fc('0x63')]=_0x5d08c3['id'];if(_0x48caf5[_0x63fc('0x3d')]['filter']){_0x1e3bb5[_0x63fc('0x47')]=_[_0x63fc('0x48')](_0x1e3bb5[_0x63fc('0x47')],{'$or':_[_0x63fc('0x2f')](_0x1e3bb5[_0x63fc('0x3f')],function(_0x3d715f){var _0x5b0283={};_0x5b0283[_0x3d715f]={'$like':'%'+_0x48caf5['query']['filter']+'%'};return _0x5b0283;})});}_0x1e3bb5=_[_0x63fc('0x48')]({},_0x1e3bb5,_0x48caf5['options']);return db[_0x63fc('0x64')][_0x63fc('0x24')]({'where':_0x1e3bb5['where']})[_0x63fc('0x2a')](function(_0x3f308b){_0x34cea9[_0x63fc('0x24')]=_0x3f308b;if(_0x48caf5[_0x63fc('0x3d')][_0x63fc('0x4a')]){_0x1e3bb5[_0x63fc('0x59')]=[{'all':!![]}];}return db[_0x63fc('0x64')][_0x63fc('0x4b')](_0x1e3bb5);})['then'](function(_0x21da38){_0x34cea9[_0x63fc('0x65')]=_0x21da38;return _0x34cea9;});}})[_0x63fc('0x2a')](respondWithFilteredResult(_0x244252,_0x1e3bb5))[_0x63fc('0x4c')](handleError(_0x244252,null));};exports['getHopperHistories']=function(_0x26c71a,_0x346b8d,_0x4c0222){var _0x38c3dc={'raw':!![],'where':{}};var _0x250a88={};var _0x5ab7f3={'count':0x0,'rows':[]};return db[_0x63fc('0x49')][_0x63fc('0x60')]({'where':{'id':_0x26c71a[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x346b8d,null))[_0x63fc('0x2a')](function(_0x2a2f77){if(_0x2a2f77){_0x250a88[_0x63fc('0x3b')]=_[_0x63fc('0x3c')](db[_0x63fc('0x66')][_0x63fc('0x38')]);_0x250a88[_0x63fc('0x3d')]=_[_0x63fc('0x3c')](_0x26c71a[_0x63fc('0x3d')]);_0x250a88[_0x63fc('0x45')]=_['intersection'](_0x250a88['model'],_0x250a88[_0x63fc('0x3d')]);_0x38c3dc[_0x63fc('0x3f')]=_[_0x63fc('0x3e')](_0x250a88[_0x63fc('0x3b')],qs[_0x63fc('0x40')](_0x26c71a[_0x63fc('0x3d')][_0x63fc('0x40')]));_0x38c3dc['attributes']=_0x38c3dc[_0x63fc('0x3f')][_0x63fc('0x41')]?_0x38c3dc[_0x63fc('0x3f')]:_0x250a88[_0x63fc('0x3b')];if(!_0x26c71a[_0x63fc('0x3d')]['hasOwnProperty'](_0x63fc('0x62'))){_0x38c3dc[_0x63fc('0x22')]=qs['limit'](_0x26c71a[_0x63fc('0x3d')][_0x63fc('0x22')]);_0x38c3dc[_0x63fc('0x21')]=qs['offset'](_0x26c71a[_0x63fc('0x3d')][_0x63fc('0x21')]);}_0x38c3dc['order']=qs[_0x63fc('0x43')](_0x26c71a[_0x63fc('0x3d')][_0x63fc('0x43')]);_0x38c3dc[_0x63fc('0x47')]=qs['filters'](_['pick'](_0x26c71a['query'],_0x250a88[_0x63fc('0x45')]));_0x38c3dc[_0x63fc('0x47')]['VoiceQueueId']=_0x2a2f77['id'];if(_0x26c71a[_0x63fc('0x3d')][_0x63fc('0x46')]){_0x38c3dc[_0x63fc('0x47')]=_[_0x63fc('0x48')](_0x38c3dc['where'],{'$or':_['map'](_0x38c3dc[_0x63fc('0x3f')],function(_0x559c89){var _0x4c6578={};_0x4c6578[_0x559c89]={'$like':'%'+_0x26c71a[_0x63fc('0x3d')][_0x63fc('0x46')]+'%'};return _0x4c6578;})});}_0x38c3dc=_[_0x63fc('0x48')]({},_0x38c3dc,_0x26c71a[_0x63fc('0x67')]);return db[_0x63fc('0x66')]['count']({'where':_0x38c3dc[_0x63fc('0x47')]})[_0x63fc('0x2a')](function(_0x2db54b){_0x5ab7f3[_0x63fc('0x24')]=_0x2db54b;if(_0x26c71a[_0x63fc('0x3d')][_0x63fc('0x4a')]){_0x38c3dc[_0x63fc('0x59')]=[{'all':!![]}];}return db[_0x63fc('0x66')]['findAll'](_0x38c3dc);})['then'](function(_0x4ca52e){_0x5ab7f3['rows']=_0x4ca52e;return _0x5ab7f3;});}})[_0x63fc('0x2a')](respondWithFilteredResult(_0x346b8d,_0x38c3dc))[_0x63fc('0x4c')](handleError(_0x346b8d,null));};exports[_0x63fc('0x68')]=function(_0x311d4c,_0x52fa37,_0x43eaa0){var _0x1c707f={'raw':!![],'where':{}};var _0x1ad5f9={};var _0x26ad64={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x63fc('0x60')]({'where':{'id':_0x311d4c[_0x63fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52fa37,null))[_0x63fc('0x2a')](function(_0x37c3b1){if(_0x37c3b1){_0x1ad5f9['model']=_[_0x63fc('0x3c')](db['CmHopperFinal'][_0x63fc('0x38')]);_0x1ad5f9[_0x63fc('0x3d')]=_[_0x63fc('0x3c')](_0x311d4c[_0x63fc('0x3d')]);_0x1ad5f9[_0x63fc('0x45')]=_['intersection'](_0x1ad5f9[_0x63fc('0x3b')],_0x1ad5f9[_0x63fc('0x3d')]);_0x1c707f[_0x63fc('0x3f')]=_[_0x63fc('0x3e')](_0x1ad5f9[_0x63fc('0x3b')],qs['fields'](_0x311d4c[_0x63fc('0x3d')][_0x63fc('0x40')]));_0x1c707f[_0x63fc('0x3f')]=_0x1c707f[_0x63fc('0x3f')][_0x63fc('0x41')]?_0x1c707f[_0x63fc('0x3f')]:_0x1ad5f9['model'];if(!_0x311d4c[_0x63fc('0x3d')]['hasOwnProperty'](_0x63fc('0x62'))){_0x1c707f['limit']=qs[_0x63fc('0x22')](_0x311d4c['query'][_0x63fc('0x22')]);_0x1c707f[_0x63fc('0x21')]=qs[_0x63fc('0x21')](_0x311d4c[_0x63fc('0x3d')][_0x63fc('0x21')]);}_0x1c707f[_0x63fc('0x42')]=qs[_0x63fc('0x43')](_0x311d4c['query'][_0x63fc('0x43')]);_0x1c707f[_0x63fc('0x47')]=qs['filters'](_[_0x63fc('0x44')](_0x311d4c[_0x63fc('0x3d')],_0x1ad5f9[_0x63fc('0x45')]));_0x1c707f[_0x63fc('0x47')][_0x63fc('0x63')]=_0x37c3b1['id'];if(_0x311d4c[_0x63fc('0x3d')][_0x63fc('0x46')]){_0x1c707f[_0x63fc('0x47')]=_['merge'](_0x1c707f[_0x63fc('0x47')],{'$or':_[_0x63fc('0x2f')](_0x1c707f[_0x63fc('0x3f')],function(_0x455a85){var _0x5067a7={};_0x5067a7[_0x455a85]={'$like':'%'+_0x311d4c[_0x63fc('0x3d')][_0x63fc('0x46')]+'%'};return _0x5067a7;})});}_0x1c707f=_[_0x63fc('0x48')]({},_0x1c707f,_0x311d4c[_0x63fc('0x67')]);return db[_0x63fc('0x69')][_0x63fc('0x24')]({'where':_0x1c707f[_0x63fc('0x47')]})[_0x63fc('0x2a')](function(_0xb61991){_0x26ad64['count']=_0xb61991;if(_0x311d4c[_0x63fc('0x3d')][_0x63fc('0x4a')]){_0x1c707f['include']=[{'all':!![]}];}return db[_0x63fc('0x69')][_0x63fc('0x4b')](_0x1c707f);})[_0x63fc('0x2a')](function(_0x234485){_0x26ad64[_0x63fc('0x65')]=_0x234485;return _0x26ad64;});}})[_0x63fc('0x2a')](respondWithFilteredResult(_0x52fa37,_0x1c707f))['catch'](handleError(_0x52fa37,null));};exports['getHopperBlacks']=function(_0xd81446,_0x1ffa24,_0xcc619b){var _0x539071={'raw':!![],'where':{}};var _0x5604f0={};var _0xbc2d8c={'count':0x0,'rows':[]};return db[_0x63fc('0x49')][_0x63fc('0x60')]({'where':{'id':_0xd81446[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x1ffa24,null))['then'](function(_0x54bd3a){if(_0x54bd3a){_0x5604f0[_0x63fc('0x3b')]=_[_0x63fc('0x3c')](db['CmHopperBlack']['rawAttributes']);_0x5604f0[_0x63fc('0x3d')]=_[_0x63fc('0x3c')](_0xd81446[_0x63fc('0x3d')]);_0x5604f0[_0x63fc('0x45')]=_[_0x63fc('0x3e')](_0x5604f0['model'],_0x5604f0[_0x63fc('0x3d')]);_0x539071['attributes']=_[_0x63fc('0x3e')](_0x5604f0['model'],qs[_0x63fc('0x40')](_0xd81446[_0x63fc('0x3d')]['fields']));_0x539071[_0x63fc('0x3f')]=_0x539071[_0x63fc('0x3f')][_0x63fc('0x41')]?_0x539071[_0x63fc('0x3f')]:_0x5604f0[_0x63fc('0x3b')];if(!_0xd81446['query'][_0x63fc('0x61')](_0x63fc('0x62'))){_0x539071[_0x63fc('0x22')]=qs[_0x63fc('0x22')](_0xd81446[_0x63fc('0x3d')][_0x63fc('0x22')]);_0x539071[_0x63fc('0x21')]=qs[_0x63fc('0x21')](_0xd81446[_0x63fc('0x3d')][_0x63fc('0x21')]);}_0x539071[_0x63fc('0x42')]=qs['sort'](_0xd81446[_0x63fc('0x3d')][_0x63fc('0x43')]);_0x539071[_0x63fc('0x47')]=qs[_0x63fc('0x45')](_[_0x63fc('0x44')](_0xd81446[_0x63fc('0x3d')],_0x5604f0[_0x63fc('0x45')]));_0x539071['where'][_0x63fc('0x63')]=_0x54bd3a['id'];if(_0xd81446[_0x63fc('0x3d')]['filter']){_0x539071['where']=_[_0x63fc('0x48')](_0x539071[_0x63fc('0x47')],{'$or':_[_0x63fc('0x2f')](_0x539071['attributes'],function(_0x4c9cbe){var _0x17c93e={};_0x17c93e[_0x4c9cbe]={'$like':'%'+_0xd81446['query']['filter']+'%'};return _0x17c93e;})});}_0x539071=_[_0x63fc('0x48')]({},_0x539071,_0xd81446[_0x63fc('0x67')]);return db[_0x63fc('0x6a')]['count']({'where':_0x539071[_0x63fc('0x47')]})[_0x63fc('0x2a')](function(_0x117957){_0xbc2d8c[_0x63fc('0x24')]=_0x117957;if(_0xd81446[_0x63fc('0x3d')]['includeAll']){_0x539071[_0x63fc('0x59')]=[{'all':!![]}];}return db[_0x63fc('0x6a')][_0x63fc('0x4b')](_0x539071);})[_0x63fc('0x2a')](function(_0x2e00d8){_0xbc2d8c['rows']=_0x2e00d8;return _0xbc2d8c;});}})[_0x63fc('0x2a')](respondWithFilteredResult(_0x1ffa24,_0x539071))[_0x63fc('0x4c')](handleError(_0x1ffa24,null));};exports[_0x63fc('0x6b')]=function(_0x2a86c6,_0x59563e,_0x257af9){var _0x4a74ac={};var _0x45552b={};var _0x28d6cd;var _0x55ad71;return db[_0x63fc('0x49')][_0x63fc('0x60')]({'where':{'id':_0x2a86c6[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x59563e,null))['then'](function(_0x4de5b3){if(_0x4de5b3){_0x28d6cd=_0x4de5b3;_0x45552b['model']=_[_0x63fc('0x3c')](db[_0x63fc('0x6c')][_0x63fc('0x38')]);_0x45552b['query']=_['keys'](_0x2a86c6[_0x63fc('0x3d')]);_0x45552b[_0x63fc('0x45')]=_['intersection'](_0x45552b['model'],_0x45552b[_0x63fc('0x3d')]);_0x4a74ac['attributes']=_[_0x63fc('0x3e')](_0x45552b[_0x63fc('0x3b')],qs[_0x63fc('0x40')](_0x2a86c6['query'][_0x63fc('0x40')]));_0x4a74ac['attributes']=_0x4a74ac[_0x63fc('0x3f')][_0x63fc('0x41')]?_0x4a74ac['attributes']:_0x45552b['model'];_0x4a74ac[_0x63fc('0x42')]=qs['sort'](_0x2a86c6[_0x63fc('0x3d')][_0x63fc('0x43')]);_0x4a74ac['where']=qs[_0x63fc('0x45')](_[_0x63fc('0x44')](_0x2a86c6[_0x63fc('0x3d')],_0x45552b[_0x63fc('0x45')]));if(_0x2a86c6[_0x63fc('0x3d')][_0x63fc('0x46')]){_0x4a74ac[_0x63fc('0x47')]=_['merge'](_0x4a74ac[_0x63fc('0x47')],{'$or':_['map'](_0x4a74ac[_0x63fc('0x3f')],function(_0x2765ab){var _0x4f97d0={};_0x4f97d0[_0x2765ab]={'$like':'%'+_0x2a86c6[_0x63fc('0x3d')][_0x63fc('0x46')]+'%'};return _0x4f97d0;})});}_0x4a74ac=_[_0x63fc('0x48')]({},_0x4a74ac,_0x2a86c6[_0x63fc('0x67')]);return _0x28d6cd[_0x63fc('0x6b')](_0x4a74ac);}})['then'](function(_0x3e263e){if(_0x3e263e){_0x55ad71=_0x3e263e[_0x63fc('0x41')];if(!_0x2a86c6[_0x63fc('0x3d')]['hasOwnProperty'](_0x63fc('0x62'))){_0x4a74ac[_0x63fc('0x22')]=qs['limit'](_0x2a86c6[_0x63fc('0x3d')][_0x63fc('0x22')]);_0x4a74ac[_0x63fc('0x21')]=qs[_0x63fc('0x21')](_0x2a86c6[_0x63fc('0x3d')][_0x63fc('0x21')]);}return _0x28d6cd[_0x63fc('0x6b')](_0x4a74ac);}})[_0x63fc('0x2a')](function(_0x5d53aa){if(_0x5d53aa){return _0x5d53aa?{'count':_0x55ad71,'rows':_0x5d53aa}:null;}})['then'](respondWithResult(_0x59563e,null))['catch'](handleError(_0x59563e,null));};exports[_0x63fc('0x6d')]=function(_0x1e67f5,_0x5637ac,_0x3ee605){var _0x138270=_0x1e67f5[_0x63fc('0x50')][_0x63fc('0x6e')];var _0x8018d2=_[_0x63fc('0x2f')](_0x138270,'id');return db[_0x63fc('0x6c')][_0x63fc('0x4b')]({'where':{'id':_0x8018d2},'attributes':['id'],'include':[{'model':db[_0x63fc('0x6f')],'as':'Agents','attributes':['id','name',_0x63fc('0x70'),_0x63fc('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x3312b0){if(_0x3312b0){var _0x188873=_[_0x63fc('0x72')](_0x3312b0,function(_0x428c3e){var _0x4a65e1=_0x428c3e[_0x63fc('0x53')]({'plain':!![]});_0x4a65e1['Agents'][_0x63fc('0x73')](function(_0x4bfdce){_0x4bfdce[_0x63fc('0x74')]=_[_0x63fc('0x32')](_0x138270,{'id':_0x4a65e1['id']})[_0x63fc('0x74')];});return _0x4a65e1['Agents'];});return db[_0x63fc('0x49')][_0x63fc('0x32')]({'where':{'id':_0x1e67f5[_0x63fc('0x4e')]['id']}})['then'](function(_0x8364dc){return db[_0x63fc('0x75')][_0x63fc('0x76')](function(_0x51c97c){return _0x8364dc[_0x63fc('0x6d')](_0x8018d2,{'transaction':_0x51c97c})[_0x63fc('0x2a')](function(){return BPromise['each'](_0x138270,function(_0x226f72){return db[_0x63fc('0x77')][_0x63fc('0x78')]({'TeamId':_0x226f72['id'],'VoiceQueueId':_0x1e67f5['params']['id'],'penalty':_0x226f72[_0x63fc('0x74')]},{'transaction':_0x51c97c});});})[_0x63fc('0x2a')](function(){return BPromise[_0x63fc('0x79')](_0x188873,function(_0x799545){return db[_0x63fc('0x7a')][_0x63fc('0x7b')]({'where':{'UserId':_0x799545['id'],'VoiceQueueId':_0x1e67f5[_0x63fc('0x4e')]['id']},'defaults':{'penalty':_0x799545[_0x63fc('0x74')]},'transaction':_0x51c97c});});})[_0x63fc('0x2a')](function(){return BPromise['each'](_[_0x63fc('0x46')](_0x188873,{'online':!![]}),function(_0x440aeb){return db['UserVoiceQueueRt'][_0x63fc('0x78')]({'membername':_0x440aeb[_0x63fc('0x33')],'UserId':_0x440aeb['id'],'queue_name':_0x8364dc[_0x63fc('0x33')],'VoiceQueueId':_0x8364dc['id'],'interface':_['isNil'](_0x440aeb[_0x63fc('0x7c')])?util[_0x63fc('0x7d')](_0x63fc('0x7e'),_0x440aeb[_0x63fc('0x33')]):_0x440aeb[_0x63fc('0x7c')],'paused':_0x440aeb[_0x63fc('0x71')]||![],'penalty':_0x440aeb['penalty']},{'transaction':_0x51c97c});});})[_0x63fc('0x2a')](function(){_0x188873[_0x63fc('0x73')](function(_0xbdf8e0){socket['emit'](_0x63fc('0x7f'),{'UserId':_0xbdf8e0['id'],'VoiceQueueId':_0x8364dc['id']});});});});});}})['then'](respondWithStatusCode(_0x5637ac,null))[_0x63fc('0x4c')](handleError(_0x5637ac,null));};exports['removeTeams']=function(_0x30ed02,_0x24d5bc,_0x44d0c5){return db[_0x63fc('0x6c')][_0x63fc('0x4b')]({'where':{'id':_0x30ed02['query'][_0x63fc('0x80')]},'attributes':['id'],'include':[{'model':db[_0x63fc('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x63fc('0x2a')](handleEntityNotFound(_0x24d5bc,null))[_0x63fc('0x2a')](function(_0x3293c0){var _0x1cd0b4=_['map'](_0x3293c0,'id');var _0x23b9ad=[];var _0x56dae5=[];var _0x4e9f49=squel['select']();_0x4e9f49[_0x63fc('0x81')](_0x63fc('0x82'))[_0x63fc('0x83')](_0x63fc('0x84'),'tq')[_0x63fc('0x85')]('user_has_teams','ut',_0x63fc('0x86'))[_0x63fc('0x47')](_0x63fc('0x87'),_0x30ed02[_0x63fc('0x4e')]['id']);for(var _0x21abb2=0x0;_0x21abb2<_0x3293c0['length'];_0x21abb2+=0x1){let _0x2be968=_0x3293c0[_0x21abb2];for(var _0x57010f=0x0;_0x57010f<_0x2be968[_0x63fc('0x88')][_0x63fc('0x41')];_0x57010f+=0x1){let _0x11f8eb=_0x2be968[_0x63fc('0x88')][_0x57010f];var _0x33a45c=_0x4e9f49[_0x63fc('0x58')]();_0x33a45c[_0x63fc('0x47')](_0x63fc('0x89'),_0x11f8eb['id']);_0x56dae5[_0x63fc('0x8a')](db[_0x63fc('0x75')][_0x63fc('0x3d')](_0x33a45c[_0x63fc('0x8b')](),{'type':db[_0x63fc('0x75')][_0x63fc('0x8c')][_0x63fc('0x8d')]})[_0x63fc('0x2a')](function(_0x17b4a9){if(_0x17b4a9['length']===0x1){return _0x11f8eb['id'];}else{var _0x5a1f17=_[_0x63fc('0x8e')](_[_0x63fc('0x2f')](_0x17b4a9,_0x63fc('0x8f')),function(_0x5451d7){return _[_0x63fc('0x90')](_0x1cd0b4,_0x5451d7);});if(_0x5a1f17){return _0x11f8eb['id'];}}}));}}return BPromise[_0x63fc('0x91')](_0x56dae5)['then'](function(_0x1be22f){_0x23b9ad=_(_0x23b9ad)[_0x63fc('0x92')](_0x1be22f)[_0x63fc('0x93')]()[_0x63fc('0x30')]();return db[_0x63fc('0x49')]['find']({'where':{'id':_0x30ed02['params']['id']}})[_0x63fc('0x2a')](function(_0x3719d7){return db['sequelize'][_0x63fc('0x76')](function(_0x528a93){return _0x3719d7[_0x63fc('0x94')](_0x30ed02['query']['ids'],{'transaction':_0x528a93})[_0x63fc('0x2a')](function(){if(!_['isEmpty'](_0x23b9ad)){return _0x3719d7[_0x63fc('0x95')](_0x23b9ad,{'transaction':_0x528a93})[_0x63fc('0x2a')](function(){return db[_0x63fc('0x96')]['destroy']({'where':{'VoiceQueueId':_0x30ed02['params']['id'],'UserId':_0x23b9ad},'transaction':_0x528a93});});}})['then'](function(){_0x23b9ad[_0x63fc('0x73')](function(_0x144292){socket['emit'](_0x63fc('0x97'),{'UserId':_0x144292,'VoiceQueueId':_0x3719d7['id']});});});});});});})[_0x63fc('0x2a')](respondWithStatusCode(_0x24d5bc,null))['catch'](handleError(_0x24d5bc,null));};exports[_0x63fc('0x98')]=function(_0x68e667,_0x20a230,_0x421b18){var _0x2ec0bf,_0x448da7;return db[_0x63fc('0x49')][_0x63fc('0x32')]({'where':{'id':_0x68e667[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x20a230,null))['then'](function(_0x41f445){if(_0x41f445){_0x448da7=_0x41f445;return _0x41f445[_0x63fc('0x98')](_0x68e667[_0x63fc('0x50')][_0x63fc('0x80')],_[_0x63fc('0x5a')](_0x68e667['body'],[_0x63fc('0x80'),'id'])||{})['spread'](function(_0x21014b){for(var _0x7a9c20=0x0;_0x7a9c20<_0x68e667[_0x63fc('0x50')]['ids'][_0x63fc('0x41')];_0x7a9c20+=0x1){socket[_0x63fc('0x99')]('userVoiceQueue:save',{'UserId':Number(_0x68e667[_0x63fc('0x50')][_0x63fc('0x80')][_0x7a9c20]),'VoiceQueueId':Number(_0x68e667['params']['id'])});}return _0x21014b;});}})[_0x63fc('0x2a')](function(_0x3c94ad){_0x2ec0bf=_0x3c94ad||[];if(_0x448da7){return db['User'][_0x63fc('0x4b')]({'where':{'id':_0x68e667[_0x63fc('0x50')]['ids']},'attributes':['id',_0x63fc('0x33'),_0x63fc('0x70'),_0x63fc('0x71'),'interface'],'raw':!![]});}})['then'](function(_0x48de84){if(!_[_0x63fc('0x9a')](_0x48de84)){var _0x2be64e=[];for(var _0x59b791=0x0;_0x59b791<_0x48de84['length'];_0x59b791++){if(_0x48de84[_0x59b791][_0x63fc('0x70')]){_0x2be64e[_0x63fc('0x8a')](db[_0x63fc('0x96')][_0x63fc('0x78')]({'membername':_0x48de84[_0x59b791][_0x63fc('0x33')],'UserId':_0x48de84[_0x59b791]['id'],'queue_name':_0x448da7['name'],'VoiceQueueId':_0x448da7['id'],'interface':_[_0x63fc('0x9b')](_0x48de84[_0x59b791][_0x63fc('0x7c')])?util['format'](_0x63fc('0x7e'),_0x48de84[_0x59b791][_0x63fc('0x33')]):_0x48de84[_0x59b791][_0x63fc('0x7c')],'paused':_0x48de84[_0x59b791]['voicePause']||![],'penalty':_0x68e667['body'][_0x63fc('0x74')]||0x0}));}}return BPromise[_0x63fc('0x91')](_0x2be64e);}})['then'](function(){return _0x2ec0bf;})[_0x63fc('0x2a')](respondWithResult(_0x20a230,null))[_0x63fc('0x4c')](handleError(_0x20a230,null));};exports[_0x63fc('0x95')]=function(_0x97ecad,_0x10e139,_0x54b6d2){return db[_0x63fc('0x49')]['find']({'where':{'id':_0x97ecad['params']['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x10e139,null))[_0x63fc('0x2a')](function(_0x4a26fc){if(_0x4a26fc){return _0x4a26fc['removeAgents'](_0x97ecad[_0x63fc('0x3d')][_0x63fc('0x80')])[_0x63fc('0x2a')](function(){if(_[_0x63fc('0x9c')](_0x97ecad['query'][_0x63fc('0x80')])){for(var _0x54fe3d=0x0;_0x54fe3d<_0x97ecad[_0x63fc('0x3d')][_0x63fc('0x80')][_0x63fc('0x41')];_0x54fe3d+=0x1){socket['emit'](_0x63fc('0x97'),{'UserId':Number(_0x97ecad[_0x63fc('0x3d')]['ids'][_0x54fe3d]),'VoiceQueueId':Number(_0x97ecad[_0x63fc('0x4e')]['id'])});}}else{socket[_0x63fc('0x99')]('userVoiceQueue:remove',{'UserId':Number(_0x97ecad[_0x63fc('0x3d')][_0x63fc('0x80')]),'VoiceQueueId':Number(_0x97ecad[_0x63fc('0x4e')]['id'])});}});}})[_0x63fc('0x2a')](function(_0x2773e7){return db['UserVoiceQueueRt'][_0x63fc('0x2b')]({'where':{'VoiceQueueId':_0x97ecad[_0x63fc('0x4e')]['id'],'UserId':_0x97ecad['query'][_0x63fc('0x80')]}})['then'](function(){return _0x2773e7;});})[_0x63fc('0x2a')](respondWithStatusCode(_0x10e139,null))[_0x63fc('0x4c')](handleError(_0x10e139,null));};exports['getAgents']=function(_0x5d8e87,_0x47a88a,_0x4a5482){var _0x4be4f2={};var _0x20a96a={};var _0x3e8950;var _0x312767;return db[_0x63fc('0x49')][_0x63fc('0x60')]({'where':{'id':_0x5d8e87['params']['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x47a88a,null))['then'](function(_0x4fc859){if(_0x4fc859){_0x3e8950=_0x4fc859;_0x20a96a[_0x63fc('0x3b')]=_[_0x63fc('0x3c')](db[_0x63fc('0x6f')]['rawAttributes']);_0x20a96a[_0x63fc('0x3d')]=_['keys'](_0x5d8e87[_0x63fc('0x3d')]);_0x20a96a[_0x63fc('0x45')]=_['intersection'](_0x20a96a[_0x63fc('0x3b')],_0x20a96a[_0x63fc('0x3d')]);_0x4be4f2[_0x63fc('0x3f')]=_[_0x63fc('0x3e')](_0x20a96a['model'],qs[_0x63fc('0x40')](_0x5d8e87['query'][_0x63fc('0x40')]));_0x4be4f2[_0x63fc('0x3f')]=_0x4be4f2[_0x63fc('0x3f')][_0x63fc('0x41')]?_0x4be4f2[_0x63fc('0x3f')]:_0x20a96a[_0x63fc('0x3b')];_0x4be4f2[_0x63fc('0x42')]=qs['sort'](_0x5d8e87[_0x63fc('0x3d')][_0x63fc('0x43')]);_0x4be4f2[_0x63fc('0x47')]=qs[_0x63fc('0x45')](_[_0x63fc('0x44')](_0x5d8e87[_0x63fc('0x3d')],_0x20a96a[_0x63fc('0x45')]));if(_0x5d8e87[_0x63fc('0x3d')]['filter']){_0x4be4f2[_0x63fc('0x47')]=_[_0x63fc('0x48')](_0x4be4f2[_0x63fc('0x47')],{'$or':_[_0x63fc('0x2f')](_0x4be4f2[_0x63fc('0x3f')],function(_0x1fb7de){var _0x3a3624={};_0x3a3624[_0x1fb7de]={'$like':'%'+_0x5d8e87[_0x63fc('0x3d')]['filter']+'%'};return _0x3a3624;})});}_0x4be4f2=_[_0x63fc('0x48')]({},_0x4be4f2,_0x5d8e87['options']);return _0x3e8950[_0x63fc('0x9d')](_0x4be4f2);}})[_0x63fc('0x2a')](function(_0x54e88a){if(_0x54e88a){_0x312767=_0x54e88a[_0x63fc('0x41')];if(!_0x5d8e87['query'][_0x63fc('0x61')](_0x63fc('0x62'))){_0x4be4f2[_0x63fc('0x22')]=qs[_0x63fc('0x22')](_0x5d8e87[_0x63fc('0x3d')][_0x63fc('0x22')]);_0x4be4f2[_0x63fc('0x21')]=qs[_0x63fc('0x21')](_0x5d8e87[_0x63fc('0x3d')][_0x63fc('0x21')]);}return _0x3e8950['getAgents'](_0x4be4f2);}})[_0x63fc('0x2a')](function(_0x1630ca){if(_0x1630ca){return _0x1630ca?{'count':_0x312767,'rows':_0x1630ca}:null;}})[_0x63fc('0x2a')](respondWithResult(_0x47a88a,null))[_0x63fc('0x4c')](handleError(_0x47a88a,null));};exports['getMembers']=function(_0x7f8c18,_0x44c3b2,_0x394d4d){var _0x2f2360={};var _0x2728d3={};var _0x59667d;var _0x465ca0;return db[_0x63fc('0x49')][_0x63fc('0x60')]({'where':{'id':_0x7f8c18[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x44c3b2,null))[_0x63fc('0x2a')](function(_0xf6a8c5){if(_0xf6a8c5){_0x59667d=_0xf6a8c5;_0x2728d3[_0x63fc('0x3b')]=_[_0x63fc('0x3c')](db[_0x63fc('0x96')][_0x63fc('0x38')]);_0x2728d3['query']=_[_0x63fc('0x3c')](_0x7f8c18['query']);_0x2728d3['filters']=_[_0x63fc('0x3e')](_0x2728d3[_0x63fc('0x3b')],_0x2728d3[_0x63fc('0x3d')]);_0x2f2360[_0x63fc('0x3f')]=_[_0x63fc('0x3e')](_0x2728d3['model'],qs['fields'](_0x7f8c18[_0x63fc('0x3d')][_0x63fc('0x40')]));_0x2f2360[_0x63fc('0x3f')]=_0x2f2360[_0x63fc('0x3f')]['length']?_0x2f2360[_0x63fc('0x3f')]:_0x2728d3[_0x63fc('0x3b')];_0x2f2360[_0x63fc('0x42')]=qs[_0x63fc('0x43')](_0x7f8c18[_0x63fc('0x3d')][_0x63fc('0x43')]);_0x2f2360[_0x63fc('0x47')]=qs[_0x63fc('0x45')](_[_0x63fc('0x44')](_0x7f8c18['query'],_0x2728d3[_0x63fc('0x45')]));if(_0x7f8c18[_0x63fc('0x3d')][_0x63fc('0x46')]){_0x2f2360['where']=_['merge'](_0x2f2360['where'],{'$or':_[_0x63fc('0x2f')](_0x2f2360[_0x63fc('0x3f')],function(_0x33919f){var _0x276980={};_0x276980[_0x33919f]={'$like':'%'+_0x7f8c18[_0x63fc('0x3d')][_0x63fc('0x46')]+'%'};return _0x276980;})});}_0x2f2360=_[_0x63fc('0x48')]({},_0x2f2360,_0x7f8c18[_0x63fc('0x67')]);return _0x59667d[_0x63fc('0x9e')](_0x2f2360);}})['then'](function(_0x321b40){if(_0x321b40){_0x465ca0=_0x321b40[_0x63fc('0x41')];if(!_0x7f8c18[_0x63fc('0x3d')][_0x63fc('0x61')](_0x63fc('0x62'))){_0x2f2360['limit']=qs[_0x63fc('0x22')](_0x7f8c18[_0x63fc('0x3d')][_0x63fc('0x22')]);_0x2f2360[_0x63fc('0x21')]=qs[_0x63fc('0x21')](_0x7f8c18[_0x63fc('0x3d')][_0x63fc('0x21')]);}return _0x59667d[_0x63fc('0x9e')](_0x2f2360);}})['then'](function(_0x16ea53){return _0x16ea53?{'count':_0x465ca0,'rows':_0x16ea53}:null;})[_0x63fc('0x2a')](respondWithResult(_0x44c3b2,null))[_0x63fc('0x4c')](handleError(_0x44c3b2,null));};exports['getLists']=function(_0x4209c5,_0x545a8f,_0x5eeb17){var _0x50d857={};var _0x2107c2={};var _0x12a998;var _0x1433d8;return db['VoiceQueue'][_0x63fc('0x60')]({'where':{'id':_0x4209c5[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x545a8f,null))[_0x63fc('0x2a')](function(_0x2f8f69){if(_0x2f8f69){_0x12a998=_0x2f8f69;_0x2107c2['model']=_[_0x63fc('0x3c')](db[_0x63fc('0x9f')][_0x63fc('0x38')]);_0x2107c2[_0x63fc('0x3d')]=_[_0x63fc('0x3c')](_0x4209c5['query']);_0x2107c2[_0x63fc('0x45')]=_[_0x63fc('0x3e')](_0x2107c2[_0x63fc('0x3b')],_0x2107c2[_0x63fc('0x3d')]);_0x50d857[_0x63fc('0x3f')]=_[_0x63fc('0x3e')](_0x2107c2[_0x63fc('0x3b')],qs[_0x63fc('0x40')](_0x4209c5[_0x63fc('0x3d')][_0x63fc('0x40')]));_0x50d857['attributes']=_0x50d857['attributes'][_0x63fc('0x41')]?_0x50d857[_0x63fc('0x3f')]:_0x2107c2['model'];_0x50d857[_0x63fc('0x42')]=qs[_0x63fc('0x43')](_0x4209c5[_0x63fc('0x3d')]['sort']);_0x50d857[_0x63fc('0x47')]=qs[_0x63fc('0x45')](_[_0x63fc('0x44')](_0x4209c5['query'],_0x2107c2[_0x63fc('0x45')]));if(_0x4209c5[_0x63fc('0x3d')][_0x63fc('0x46')]){_0x50d857[_0x63fc('0x47')]=_[_0x63fc('0x48')](_0x50d857['where'],{'$or':_[_0x63fc('0x2f')](_0x50d857[_0x63fc('0x3f')],function(_0x169ff4){var _0x3a4351={};_0x3a4351[_0x169ff4]={'$like':'%'+_0x4209c5[_0x63fc('0x3d')][_0x63fc('0x46')]+'%'};return _0x3a4351;})});}_0x50d857=_[_0x63fc('0x48')]({},_0x50d857,_0x4209c5[_0x63fc('0x67')]);return _0x12a998[_0x63fc('0xa0')](_0x50d857);}})[_0x63fc('0x2a')](function(_0x163300){if(_0x163300){_0x1433d8=_0x163300[_0x63fc('0x41')];if(!_0x4209c5[_0x63fc('0x3d')]['hasOwnProperty'](_0x63fc('0x62'))){_0x50d857['limit']=qs[_0x63fc('0x22')](_0x4209c5[_0x63fc('0x3d')]['limit']);_0x50d857['offset']=qs[_0x63fc('0x21')](_0x4209c5[_0x63fc('0x3d')][_0x63fc('0x21')]);}return _0x12a998[_0x63fc('0xa0')](_0x50d857);}})[_0x63fc('0x2a')](function(_0x244159){if(_0x244159){return _0x244159?{'count':_0x1433d8,'rows':_0x244159}:null;}})[_0x63fc('0x2a')](respondWithResult(_0x545a8f,null))[_0x63fc('0x4c')](handleError(_0x545a8f,null));};exports[_0x63fc('0xa1')]=function(_0x5d6fde,_0x585f31,_0x3cc306){var _0x1fb42a=moment()[_0x63fc('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1bf25a,_0x26291d;return db[_0x63fc('0x49')][_0x63fc('0x32')]({'where':{'id':_0x5d6fde[_0x63fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x585f31,null))[_0x63fc('0x2a')](function(_0x3dd81a){if(_0x3dd81a){_0x26291d=_0x3dd81a;return _0x3dd81a[_0x63fc('0xa1')](_0x5d6fde[_0x63fc('0x50')][_0x63fc('0x80')],_[_0x63fc('0x5a')](_0x5d6fde['body'],[_0x63fc('0x80'),'id'])||{});}return null;})[_0x63fc('0xa2')](function(_0x21a949){var _0x317d1e;_0x1bf25a=_0x21a949||[];var _0x1cb347=[];if(_0x21a949){for(var _0xeb71eb=0x0;_0xeb71eb<_0x21a949[_0x63fc('0x41')];_0xeb71eb+=0x1){var _0x1ab3cf=_0x21a949[_0xeb71eb][_0x63fc('0x53')]({'plain':!![]});_0x26291d[_0x63fc('0xa3')]=_0x5d6fde[_0x63fc('0x50')][_0x63fc('0xa3')]?_0x5d6fde[_0x63fc('0x50')][_0x63fc('0xa3')]:_0x26291d[_0x63fc('0xa3')];switch(_0x26291d['dialCheckDuplicateType']){case _0x63fc('0xa4'):_0x317d1e=squel[_0x63fc('0xa5')]()[_0x63fc('0xa6')]('cm_hopper')[_0x63fc('0xa7')](['phone',_0x63fc('0xa8'),'ContactId',_0x63fc('0xa9'),_0x63fc('0x63'),_0x63fc('0x5b'),_0x63fc('0x5c')],squel[_0x63fc('0xaa')]()['field'](_0x63fc('0xab'),'phone')[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27','scheduledAt')[_0x63fc('0x81')]('id',_0x63fc('0xac'))[_0x63fc('0x81')](_0x1ab3cf['CmListId'][_0x63fc('0x8b')](),_0x63fc('0xa9'))[_0x63fc('0x81')](_0x5d6fde['params']['id'][_0x63fc('0x8b')](),'VoiceQueueId')[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0x5b'))[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0x5c'))[_0x63fc('0x83')](_0x63fc('0xad'))[_0x63fc('0x47')]('deletedAt\x20IS\x20NULL')[_0x63fc('0x47')](_0x63fc('0xae'),_0x1ab3cf['CmListId']['toString']())[_0x63fc('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0x63fc('0x47')](_0x63fc('0xaf'),squel[_0x63fc('0xaa')]()['field'](_0x63fc('0xb0'))['from'](_0x63fc('0xb1'))['where'](_0x63fc('0x87'),_0x5d6fde[_0x63fc('0x4e')]['id'][_0x63fc('0x8b')]()))[_0x63fc('0x47')](_0x63fc('0xaf'),squel[_0x63fc('0xaa')]()[_0x63fc('0x81')]('COALESCE(phone,\x27\x27)')[_0x63fc('0x83')](_0x63fc('0xb2'))[_0x63fc('0x47')]('VoiceQueueId\x20=\x20?',_0x5d6fde[_0x63fc('0x4e')]['id'][_0x63fc('0x8b')]())))[_0x63fc('0x8b')]();break;case _0x63fc('0xb3'):_0x317d1e=squel[_0x63fc('0xa5')]()[_0x63fc('0xa6')](_0x63fc('0xb2'))[_0x63fc('0xa7')]([_0x63fc('0xab'),_0x63fc('0xa8'),_0x63fc('0xac'),'ListId',_0x63fc('0x63'),'createdAt',_0x63fc('0x5c')],squel[_0x63fc('0xaa')]()[_0x63fc('0x81')](_0x63fc('0xab'),'phone')[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0xa8'))[_0x63fc('0x81')]('id',_0x63fc('0xac'))[_0x63fc('0x81')](_0x1ab3cf[_0x63fc('0xb4')][_0x63fc('0x8b')](),_0x63fc('0xa9'))['field'](_0x5d6fde['params']['id'][_0x63fc('0x8b')](),_0x63fc('0x63'))[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0x5b'))[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0x5c'))[_0x63fc('0x83')](_0x63fc('0xad'))[_0x63fc('0x47')](_0x63fc('0xb5'))[_0x63fc('0x47')]('ListId\x20=\x20?',_0x1ab3cf[_0x63fc('0xb4')][_0x63fc('0x8b')]())[_0x63fc('0x47')](_0x63fc('0xb6'))[_0x63fc('0x47')](_0x63fc('0xaf'),squel[_0x63fc('0xaa')]()[_0x63fc('0x81')]('COALESCE(phone,\x27\x27)')[_0x63fc('0x83')](_0x63fc('0xb2'))[_0x63fc('0x47')]('VoiceQueueId\x20=\x20?',_0x5d6fde[_0x63fc('0x4e')]['id'][_0x63fc('0x8b')]())))[_0x63fc('0x8b')]();break;default:_0x317d1e=squel[_0x63fc('0xa5')]()[_0x63fc('0xa6')](_0x63fc('0xb2'))[_0x63fc('0xa7')](['phone',_0x63fc('0xa8'),'ContactId',_0x63fc('0xa9'),'VoiceQueueId','createdAt',_0x63fc('0x5c')],squel[_0x63fc('0xaa')]()[_0x63fc('0x81')](_0x63fc('0xab'),_0x63fc('0xab'))[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0xa8'))['field']('id',_0x63fc('0xac'))[_0x63fc('0x81')](_0x1ab3cf[_0x63fc('0xb4')][_0x63fc('0x8b')](),_0x63fc('0xa9'))[_0x63fc('0x81')](_0x5d6fde[_0x63fc('0x4e')]['id']['toString'](),_0x63fc('0x63'))[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0x5b'))[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0x5c'))[_0x63fc('0x83')](_0x63fc('0xad'))[_0x63fc('0x47')](_0x63fc('0xb5'))[_0x63fc('0x47')](_0x63fc('0xae'),_0x1ab3cf['CmListId'][_0x63fc('0x8b')]())[_0x63fc('0x47')](_0x63fc('0xb6')))['toString']();}_0x1cb347[_0x63fc('0x8a')](db[_0x63fc('0x75')][_0x63fc('0x3d')](_0x317d1e));}return BPromise[_0x63fc('0x91')](_0x1cb347);}})[_0x63fc('0x2a')](function(){var _0x15300b=[];var _0x162eaf=squel[_0x63fc('0xa5')]()[_0x63fc('0xa6')](_0x63fc('0xb7'))[_0x63fc('0xa7')]([_0x63fc('0xb8'),_0x63fc('0xab'),_0x63fc('0xb9'),_0x63fc('0x5b'),'updatedAt'],squel[_0x63fc('0xaa')]()[_0x63fc('0x81')](_0x63fc('0xba'))[_0x63fc('0x81')](_0x63fc('0xbb'))[_0x63fc('0x81')]('ci.OrderBy+1')[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27','createdAt')[_0x63fc('0x81')]('\x27'+_0x1fb42a+'\x27',_0x63fc('0x5c'))[_0x63fc('0x83')](_0x63fc('0xbc'),'ci')[_0x63fc('0x85')]('cm_hopper','h',_0x63fc('0xbd'))['where'](_0x63fc('0xbe'),_0x1fb42a)['where'](_0x63fc('0xbf'),_0x63fc('0xc0')))['toString']();_0x15300b['push'](db[_0x63fc('0x75')][_0x63fc('0x3d')](_0x162eaf));return BPromise[_0x63fc('0x91')](_0x15300b);})['then'](function(){return _0x1bf25a;})[_0x63fc('0x2a')](respondWithResult(_0x585f31,null))[_0x63fc('0x4c')](handleError(_0x585f31,null));};exports['removeLists']=function(_0x7da482,_0x3cb878,_0x4d4ef1){return db[_0x63fc('0x49')][_0x63fc('0x32')]({'where':{'id':_0x7da482[_0x63fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3cb878,null))[_0x63fc('0x2a')](function(_0x3c000b){if(_0x3c000b){return _0x3c000b['removeLists'](_0x7da482['query'][_0x63fc('0x80')]);}})[_0x63fc('0x2a')](function(_0x30fe7b){if(_0x30fe7b){return db[_0x63fc('0x64')][_0x63fc('0x2b')]({'where':{'ListId':_0x7da482['query'][_0x63fc('0x80')],'VoiceQueueId':_0x7da482[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](function(){return _0x30fe7b;});}})['then'](respondWithStatusCode(_0x3cb878,null))['catch'](handleError(_0x3cb878,null));};exports['getBlackLists']=function(_0x3f1bff,_0x49b365,_0x5e5030){var _0x5a49d0={};var _0x347ed1={};var _0x31c902;var _0x52093e;return db[_0x63fc('0x49')]['findOne']({'where':{'id':_0x3f1bff['params']['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x49b365,null))[_0x63fc('0x2a')](function(_0x572d1c){if(_0x572d1c){_0x31c902=_0x572d1c;_0x347ed1['model']=_[_0x63fc('0x3c')](db[_0x63fc('0x9f')][_0x63fc('0x38')]);_0x347ed1[_0x63fc('0x3d')]=_[_0x63fc('0x3c')](_0x3f1bff[_0x63fc('0x3d')]);_0x347ed1[_0x63fc('0x45')]=_[_0x63fc('0x3e')](_0x347ed1[_0x63fc('0x3b')],_0x347ed1[_0x63fc('0x3d')]);_0x5a49d0[_0x63fc('0x3f')]=_['intersection'](_0x347ed1[_0x63fc('0x3b')],qs[_0x63fc('0x40')](_0x3f1bff['query'][_0x63fc('0x40')]));_0x5a49d0['attributes']=_0x5a49d0['attributes'][_0x63fc('0x41')]?_0x5a49d0['attributes']:_0x347ed1[_0x63fc('0x3b')];_0x5a49d0[_0x63fc('0x42')]=qs[_0x63fc('0x43')](_0x3f1bff['query']['sort']);_0x5a49d0[_0x63fc('0x47')]=qs['filters'](_['pick'](_0x3f1bff['query'],_0x347ed1['filters']));if(_0x3f1bff[_0x63fc('0x3d')]['filter']){_0x5a49d0['where']=_['merge'](_0x5a49d0[_0x63fc('0x47')],{'$or':_[_0x63fc('0x2f')](_0x5a49d0[_0x63fc('0x3f')],function(_0xea4e45){var _0x3140bb={};_0x3140bb[_0xea4e45]={'$like':'%'+_0x3f1bff['query']['filter']+'%'};return _0x3140bb;})});}_0x5a49d0=_[_0x63fc('0x48')]({},_0x5a49d0,_0x3f1bff[_0x63fc('0x67')]);return _0x31c902['getBlackLists'](_0x5a49d0);}})['then'](function(_0x20def6){if(_0x20def6){_0x52093e=_0x20def6[_0x63fc('0x41')];if(!_0x3f1bff[_0x63fc('0x3d')][_0x63fc('0x61')]('nolimit')){_0x5a49d0['limit']=qs[_0x63fc('0x22')](_0x3f1bff[_0x63fc('0x3d')][_0x63fc('0x22')]);_0x5a49d0[_0x63fc('0x21')]=qs[_0x63fc('0x21')](_0x3f1bff[_0x63fc('0x3d')][_0x63fc('0x21')]);}return _0x31c902[_0x63fc('0xc1')](_0x5a49d0);}})[_0x63fc('0x2a')](function(_0x3171d3){if(_0x3171d3){return _0x3171d3?{'count':_0x52093e,'rows':_0x3171d3}:null;}})[_0x63fc('0x2a')](respondWithResult(_0x49b365,null))[_0x63fc('0x4c')](handleError(_0x49b365,null));};exports[_0x63fc('0xc2')]=function(_0x2ead94,_0x2240eb,_0x517a7f){var _0xf3d0fe,_0xb6963f;return db[_0x63fc('0x49')]['find']({'where':{'id':_0x2ead94[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x2240eb,null))[_0x63fc('0x2a')](function(_0xbc93b5){if(_0xbc93b5){_0xb6963f=_0xbc93b5;return _0xbc93b5[_0x63fc('0xc2')](_0x2ead94['body'][_0x63fc('0x80')],_['omit'](_0x2ead94[_0x63fc('0x50')],[_0x63fc('0x80'),'id'])||{});}return null;})[_0x63fc('0xa2')](function(_0x1f8d08){var _0x2e421b;_0xf3d0fe=_0x1f8d08||[];var _0x10360d=[];if(_0x1f8d08){for(var _0x57503c=0x0;_0x57503c<_0x1f8d08[_0x63fc('0x41')];_0x57503c+=0x1){var _0x54c9b3=_0x1f8d08[_0x57503c]['get']({'plain':!![]});_0x2e421b=squel[_0x63fc('0xa5')]()[_0x63fc('0xa6')](_0x63fc('0xc3'))['fromQuery'](['phone','ContactId',_0x63fc('0xa9'),_0x63fc('0x63'),'createdAt',_0x63fc('0x5c')],squel['select']()[_0x63fc('0x81')]('phone',_0x63fc('0xab'))[_0x63fc('0x81')]('id','ContactId')[_0x63fc('0x81')](_0x54c9b3[_0x63fc('0xb4')][_0x63fc('0x8b')](),_0x63fc('0xa9'))[_0x63fc('0x81')](_0x2ead94[_0x63fc('0x4e')]['id']['toString'](),_0x63fc('0x63'))['field'](_0x63fc('0xc4'),_0x63fc('0x5b'))[_0x63fc('0x81')](_0x63fc('0xc4'),_0x63fc('0x5c'))[_0x63fc('0x83')](_0x63fc('0xad'))['where'](_0x63fc('0xb5'))[_0x63fc('0x47')](_0x63fc('0xae'),_0x54c9b3[_0x63fc('0xb4')][_0x63fc('0x8b')]())['where'](_0x63fc('0xb6')))[_0x63fc('0x8b')]();_0x10360d[_0x63fc('0x8a')](db[_0x63fc('0x75')][_0x63fc('0x3d')](_0x2e421b));}return BPromise[_0x63fc('0x91')](_0x10360d);}})['then'](function(){return _0xf3d0fe;})[_0x63fc('0x2a')](respondWithResult(_0x2240eb,null))[_0x63fc('0x4c')](handleError(_0x2240eb,null));};exports[_0x63fc('0xc5')]=function(_0x543b1f,_0x295102,_0x17e906){return db['VoiceQueue'][_0x63fc('0x32')]({'where':{'id':_0x543b1f['params']['id']}})[_0x63fc('0x2a')](handleEntityNotFound(_0x295102,null))['then'](function(_0x497caa){if(_0x497caa){return _0x497caa[_0x63fc('0xc5')](_0x543b1f[_0x63fc('0x3d')][_0x63fc('0x80')]);}})[_0x63fc('0x2a')](function(_0x513c84){if(_0x513c84){return db[_0x63fc('0x6a')]['destroy']({'where':{'ListId':_0x543b1f[_0x63fc('0x3d')]['ids'],'VoiceQueueId':_0x543b1f[_0x63fc('0x4e')]['id']}})[_0x63fc('0x2a')](function(){return _0x513c84;});}})[_0x63fc('0x2a')](respondWithStatusCode(_0x295102,null))[_0x63fc('0x4c')](handleError(_0x295102,null));}; \ No newline at end of file +var _0x2706=['voicePause','userVoiceQueue:save','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','ids','isEmpty','removeAgents','UserVoiceQueueRt','emit','addAgents','spread','isNil','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','updatedAt','field','CmListId','ListId','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.OrderBy+1','cm_contact_has_items','join','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','get','VoiceQueues','inbound','ignore','map','includes','find','value','type','name','end','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','outbound','UserProfileSection','autoAssociation','UserProfileResource','error','clone','include','omit','createdAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','nolimit','VoiceQueueId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','forEach','penalty','transaction','TeamVoiceQueue','upsert','each','findOrCreate','interface','format','SIP/%s'];(function(_0x264e7f,_0x4b8f91){var _0x173e6e=function(_0x525cfc){while(--_0x525cfc){_0x264e7f['push'](_0x264e7f['shift']());}};_0x173e6e(++_0x4b8f91);}(_0x2706,0x107));var _0x6270=function(_0x7483e1,_0x26b3ea){_0x7483e1=_0x7483e1-0x0;var _0x1d86ab=_0x2706[_0x7483e1];return _0x1d86ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6270('0x0'));var zipdir=require(_0x6270('0x1'));var jsonpatch=require(_0x6270('0x2'));var rp=require(_0x6270('0x3'));var moment=require('moment');var BPromise=require(_0x6270('0x4'));var Mustache=require(_0x6270('0x5'));var util=require(_0x6270('0x6'));var path=require(_0x6270('0x7'));var sox=require(_0x6270('0x8'));var csv=require(_0x6270('0x9'));var ejs=require(_0x6270('0xa'));var fs=require('fs');var fs_extra=require(_0x6270('0xb'));var _=require('lodash');var squel=require(_0x6270('0xc'));var crypto=require(_0x6270('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6270('0xe'));var toCsv=require(_0x6270('0x9'));var querystring=require(_0x6270('0xf'));var Papa=require(_0x6270('0x10'));var Redis=require(_0x6270('0x11'));var authService=require(_0x6270('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6270('0x13'));var hardwareService=require(_0x6270('0x14'));var logger=require(_0x6270('0x15'))(_0x6270('0x16'));var utils=require(_0x6270('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6270('0x18'))['db'];config[_0x6270('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6270('0x1a'))(new Redis(config['redis']));require(_0x6270('0x1b'))['register'](socket);function respondWithStatusCode(_0x5de8e7,_0x5515cc){_0x5515cc=_0x5515cc||0xcc;return function(_0x17d001){if(_0x17d001){return _0x5de8e7[_0x6270('0x1c')](_0x5515cc);}return _0x5de8e7[_0x6270('0x1d')](_0x5515cc)['end']();};}function respondWithResult(_0x4b4904,_0x20ad4d){_0x20ad4d=_0x20ad4d||0xc8;return function(_0x59af54){if(_0x59af54){return _0x4b4904[_0x6270('0x1d')](_0x20ad4d)[_0x6270('0x1e')](_0x59af54);}};}function respondWithFilteredResult(_0x2a9ff6,_0xcec42c){return function(_0x2c87c9){if(_0x2c87c9){var _0x5f1eb4=typeof _0xcec42c[_0x6270('0x1f')]==='undefined'&&typeof _0xcec42c[_0x6270('0x20')]===_0x6270('0x21');var _0x1d6437=_0x2c87c9[_0x6270('0x22')];var _0x184d69=_0x5f1eb4?0x0:_0xcec42c[_0x6270('0x1f')];var _0x1cb956=_0x5f1eb4?_0x2c87c9[_0x6270('0x22')]:_0xcec42c[_0x6270('0x1f')]+_0xcec42c[_0x6270('0x20')];var _0x1be58e;if(_0x1cb956>=_0x1d6437){_0x1cb956=_0x1d6437;_0x1be58e=0xc8;}else{_0x1be58e=0xce;}_0x2a9ff6[_0x6270('0x1d')](_0x1be58e);return _0x2a9ff6['set'](_0x6270('0x23'),_0x184d69+'-'+_0x1cb956+'/'+_0x1d6437)[_0x6270('0x1e')](_0x2c87c9);}return null;};}function patchUpdates(_0x2315c9){return function(_0x12150d){try{jsonpatch[_0x6270('0x24')](_0x12150d,_0x2315c9,!![]);}catch(_0x1b9b20){return BPromise[_0x6270('0x25')](_0x1b9b20);}return _0x12150d['save']();};}function saveUpdates(_0x191cc6,_0x27a273){return function(_0xb21fc){if(_0xb21fc){return _0xb21fc['update'](_0x191cc6)[_0x6270('0x26')](function(_0x4099d6){return _0x4099d6;});}return null;};}function removeEntity(_0x40f0c5,_0x42267c){return function(_0x12ee8d){if(_0x12ee8d){return _0x12ee8d[_0x6270('0x27')]()['then'](function(){var _0x3bd0f9=_0x12ee8d[_0x6270('0x28')]({'plain':!![]});var _0x247a4d=[{'name':_0x6270('0x29'),'value':_0x6270('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x2003f9=_(_0x247a4d)['filter'](_0x6270('0x2b'))[_0x6270('0x2c')]('value')['value']();if(_[_0x6270('0x2d')](_0x2003f9,_0x3bd0f9['type'])){return;}var _0x3be344=_[_0x6270('0x2e')](_0x247a4d,[_0x6270('0x2f'),_0x3bd0f9[_0x6270('0x30')]])[_0x6270('0x31')];return db['UserProfileResource'][_0x6270('0x27')]({'where':{'type':_0x3be344,'resourceId':_0x3bd0f9['id']}})[_0x6270('0x26')](function(){return _0x12ee8d;});})[_0x6270('0x26')](function(){_0x40f0c5[_0x6270('0x1d')](0xcc)[_0x6270('0x32')]();});}};}function handleEntityNotFound(_0x351b0b,_0x2fad9e){return function(_0x76b030){if(!_0x76b030){_0x351b0b[_0x6270('0x1c')](0x194);}return _0x76b030;};}function handleError(_0x56f35a,_0x28c464){_0x28c464=_0x28c464||0x1f4;return function(_0x451ac3){logger['error'](_0x451ac3[_0x6270('0x33')]);if(_0x451ac3['name']){delete _0x451ac3[_0x6270('0x31')];}_0x56f35a[_0x6270('0x1d')](_0x28c464)[_0x6270('0x34')](_0x451ac3);};}exports[_0x6270('0x35')]=function(_0x41f42a,_0x2c16aa){var _0x1d6d86={},_0x11182c={},_0x5c482e={'count':0x0,'rows':[]};var _0x57394e=_[_0x6270('0x2c')](db[_0x6270('0x36')][_0x6270('0x37')],function(_0x16a22d){return{'name':_0x16a22d[_0x6270('0x38')],'type':_0x16a22d['type'][_0x6270('0x39')]};});_0x11182c[_0x6270('0x3a')]=_[_0x6270('0x2c')](_0x57394e,_0x6270('0x31'));_0x11182c['query']=_['keys'](_0x41f42a[_0x6270('0x3b')]);_0x11182c[_0x6270('0x3c')]=_[_0x6270('0x3d')](_0x11182c['model'],_0x11182c[_0x6270('0x3b')]);_0x1d6d86[_0x6270('0x3e')]=_['intersection'](_0x11182c[_0x6270('0x3a')],qs[_0x6270('0x3f')](_0x41f42a['query'][_0x6270('0x3f')]));_0x1d6d86[_0x6270('0x3e')]=_0x1d6d86['attributes']['length']?_0x1d6d86[_0x6270('0x3e')]:_0x11182c[_0x6270('0x3a')];if(!_0x41f42a[_0x6270('0x3b')][_0x6270('0x40')]('nolimit')){_0x1d6d86['limit']=qs[_0x6270('0x20')](_0x41f42a['query']['limit']);_0x1d6d86[_0x6270('0x1f')]=qs['offset'](_0x41f42a[_0x6270('0x3b')]['offset']);}_0x1d6d86[_0x6270('0x41')]=qs[_0x6270('0x42')](_0x41f42a[_0x6270('0x3b')]['sort']);_0x1d6d86[_0x6270('0x43')]=qs['filters'](_[_0x6270('0x44')](_0x41f42a['query'],_0x11182c[_0x6270('0x3c')]),_0x57394e);if(_0x41f42a[_0x6270('0x3b')]['filter']){_0x1d6d86[_0x6270('0x43')]=_['merge'](_0x1d6d86['where'],{'$or':_['map'](_0x57394e,function(_0x5b9192){if(_0x5b9192[_0x6270('0x30')]!==_0x6270('0x45')){var _0x7d543c={};_0x7d543c[_0x5b9192[_0x6270('0x31')]]={'$like':'%'+_0x41f42a['query'][_0x6270('0x46')]+'%'};return _0x7d543c;}})});}_0x1d6d86=_['merge']({},_0x1d6d86,_0x41f42a[_0x6270('0x47')]);var _0xeee407={'where':_0x1d6d86[_0x6270('0x43')]};return db[_0x6270('0x36')][_0x6270('0x22')](_0xeee407)[_0x6270('0x26')](function(_0xea40b0){_0x5c482e['count']=_0xea40b0;if(_0x41f42a['query'][_0x6270('0x48')]){_0x1d6d86['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x6270('0x49')](_0x1d6d86);})[_0x6270('0x26')](function(_0xafa900){_0x5c482e[_0x6270('0x4a')]=_0xafa900;return _0x5c482e;})[_0x6270('0x26')](respondWithFilteredResult(_0x2c16aa,_0x1d6d86))[_0x6270('0x4b')](handleError(_0x2c16aa,null));};exports[_0x6270('0x4c')]=function(_0x1eef3a,_0x3e6766){var _0xcc3598={'raw':![],'where':{'id':_0x1eef3a[_0x6270('0x4d')]['id']}},_0x38bef8={};_0x38bef8[_0x6270('0x3a')]=_['keys'](db[_0x6270('0x36')][_0x6270('0x37')]);_0x38bef8[_0x6270('0x3b')]=_[_0x6270('0x4e')](_0x1eef3a[_0x6270('0x3b')]);_0x38bef8['filters']=_[_0x6270('0x3d')](_0x38bef8[_0x6270('0x3a')],_0x38bef8[_0x6270('0x3b')]);_0xcc3598[_0x6270('0x3e')]=_[_0x6270('0x3d')](_0x38bef8[_0x6270('0x3a')],qs['fields'](_0x1eef3a[_0x6270('0x3b')][_0x6270('0x3f')]));_0xcc3598['attributes']=_0xcc3598[_0x6270('0x3e')][_0x6270('0x4f')]?_0xcc3598[_0x6270('0x3e')]:_0x38bef8[_0x6270('0x3a')];if(_0x1eef3a['query']['includeAll']){_0xcc3598['include']=[{'all':!![]}];}_0xcc3598=_[_0x6270('0x50')]({},_0xcc3598,_0x1eef3a['options']);return db[_0x6270('0x36')][_0x6270('0x2e')](_0xcc3598)['then'](handleEntityNotFound(_0x3e6766,null))[_0x6270('0x26')](respondWithResult(_0x3e6766,null))[_0x6270('0x4b')](handleError(_0x3e6766,null));};exports[_0x6270('0x51')]=function(_0x4d1172,_0x261cd0){return db['VoiceQueue'][_0x6270('0x51')](_0x4d1172[_0x6270('0x52')],{})[_0x6270('0x26')](function(_0x2d6cb7){var _0x373937=_0x4d1172[_0x6270('0x53')][_0x6270('0x28')]({'plain':!![]});if(!_0x373937)throw new Error(_0x6270('0x54'));if(_0x373937[_0x6270('0x55')]===_0x6270('0x53')){var _0x50e5b2=_0x2d6cb7['get']({'plain':!![]});var _0x27ab69=[{'name':_0x6270('0x29'),'value':'inbound'},{'name':_0x6270('0x56'),'value':_0x6270('0x57')}];var _0x39bd3a=_[_0x6270('0x2e')](_0x27ab69,['value',_0x50e5b2['type']])['name'];return db[_0x6270('0x58')]['find']({'where':{'name':_0x39bd3a,'userProfileId':_0x373937['userProfileId']},'raw':!![]})[_0x6270('0x26')](function(_0x42e83d){if(_0x42e83d&&_0x42e83d[_0x6270('0x59')]===0x0){return db[_0x6270('0x5a')][_0x6270('0x51')]({'name':_0x50e5b2[_0x6270('0x31')],'resourceId':_0x50e5b2['id'],'type':_0x42e83d[_0x6270('0x31')],'sectionId':_0x42e83d['id']},{})[_0x6270('0x26')](function(){return _0x2d6cb7;});}else{return _0x2d6cb7;}})[_0x6270('0x4b')](function(_0x2ea7e4){logger[_0x6270('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea7e4);throw _0x2ea7e4;});}return _0x2d6cb7;})['then'](respondWithResult(_0x261cd0,0xc9))['catch'](handleError(_0x261cd0,null));};exports[_0x6270('0x5c')]=function(_0x19db02,_0x4ddb00){var _0x144705={'where':{'id':_0x19db02['params']['id']}},_0x57b09d={};_0x57b09d['model']=_[_0x6270('0x4e')](db[_0x6270('0x36')][_0x6270('0x37')]);_0x144705['attributes']=_['intersection'](_0x57b09d[_0x6270('0x3a')],qs['fields'](_0x19db02[_0x6270('0x3b')][_0x6270('0x3f')]));_0x144705['attributes']=_0x144705['attributes'][_0x6270('0x4f')]?_0x144705[_0x6270('0x3e')]:_0x57b09d[_0x6270('0x3a')];if(_0x19db02[_0x6270('0x3b')]['includeAll']){_0x144705[_0x6270('0x5d')]=[{'all':!![]}];}_0x144705=_[_0x6270('0x50')]({},_0x144705,_0x19db02['options']);return db[_0x6270('0x36')][_0x6270('0x2e')](_0x144705)[_0x6270('0x26')](handleEntityNotFound(_0x4ddb00,null))[_0x6270('0x26')](function(_0x142053){if(_0x142053){var _0x584038=_0x142053[_0x6270('0x28')]({'plain':!![]});_0x584038=qs[_0x6270('0x5e')](_0x584038,['id',_0x6270('0x5f'),'updatedAt']);_0x19db02[_0x6270('0x52')]=_[_0x6270('0x5e')](_0x19db02[_0x6270('0x52')],['id',_0x6270('0x5f'),'updatedAt']);return db[_0x6270('0x36')][_0x6270('0x51')](_[_0x6270('0x50')](_0x584038,_0x19db02[_0x6270('0x52')]),{'include':_0x19db02[_0x6270('0x3b')][_0x6270('0x48')]?[{'all':!![]}]:undefined})[_0x6270('0x26')](function(_0x24fd8d){var _0x180f10=_0x19db02[_0x6270('0x53')][_0x6270('0x28')]({'plain':!![]});if(!_0x180f10)throw new Error(_0x6270('0x54'));if(_0x180f10[_0x6270('0x55')]==='user'){var _0x9ac305=_0x24fd8d[_0x6270('0x28')]({'plain':!![]});var _0x1f2ffb=[{'name':_0x6270('0x29'),'value':_0x6270('0x2a')},{'name':'QueueCampaigns','value':_0x6270('0x57')}];var _0x3f9292=_['find'](_0x1f2ffb,['value',_0x9ac305[_0x6270('0x30')]])[_0x6270('0x31')];return db['UserProfileSection'][_0x6270('0x2e')]({'where':{'name':_0x3f9292,'userProfileId':_0x180f10[_0x6270('0x60')]},'raw':!![]})[_0x6270('0x26')](function(_0x26cbb5){if(_0x26cbb5&&_0x26cbb5[_0x6270('0x59')]===0x0){return db[_0x6270('0x5a')][_0x6270('0x51')]({'name':_0x9ac305[_0x6270('0x31')],'resourceId':_0x9ac305['id'],'type':_0x26cbb5[_0x6270('0x31')],'sectionId':_0x26cbb5['id']},{})[_0x6270('0x26')](function(){return _0x24fd8d;});}else{return _0x24fd8d;}})['catch'](function(_0x379bb7){logger[_0x6270('0x5b')](_0x6270('0x61'),_0x379bb7);throw _0x379bb7;});}return _0x24fd8d;});}})[_0x6270('0x26')](respondWithResult(_0x4ddb00,0xc9))[_0x6270('0x4b')](handleError(_0x4ddb00,null));};exports[_0x6270('0x62')]=function(_0x11485e,_0xa7f76c){if(_0x11485e['body']['id']){delete _0x11485e[_0x6270('0x52')]['id'];}return db[_0x6270('0x36')]['find']({'where':{'id':_0x11485e[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0xa7f76c,null))[_0x6270('0x26')](saveUpdates(_0x11485e[_0x6270('0x52')],null))[_0x6270('0x26')](respondWithResult(_0xa7f76c,null))[_0x6270('0x4b')](handleError(_0xa7f76c,null));};exports[_0x6270('0x27')]=function(_0x289839,_0x5065a1){return db['VoiceQueue'][_0x6270('0x2e')]({'where':{'id':_0x289839[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x5065a1,null))[_0x6270('0x26')](removeEntity(_0x5065a1,null))[_0x6270('0x4b')](handleError(_0x5065a1,null));};exports[_0x6270('0x63')]=function(_0x2f4c1b,_0x4223c2,_0x2c0c3b){var _0x325848={'raw':![],'where':{}};var _0x13601c={};var _0x3c3ca0={'count':0x0,'rows':[]};return db[_0x6270('0x36')][_0x6270('0x64')]({'where':{'id':_0x2f4c1b['params']['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x4223c2,null))[_0x6270('0x26')](function(_0x59e14b){if(_0x59e14b){_0x13601c[_0x6270('0x3a')]=_[_0x6270('0x4e')](db['CmHopper'][_0x6270('0x37')]);_0x13601c[_0x6270('0x3b')]=_[_0x6270('0x4e')](_0x2f4c1b[_0x6270('0x3b')]);_0x13601c[_0x6270('0x3c')]=_[_0x6270('0x3d')](_0x13601c[_0x6270('0x3a')],_0x13601c['query']);_0x325848[_0x6270('0x3e')]=_[_0x6270('0x3d')](_0x13601c['model'],qs[_0x6270('0x3f')](_0x2f4c1b[_0x6270('0x3b')][_0x6270('0x3f')]));_0x325848[_0x6270('0x3e')]=_0x325848[_0x6270('0x3e')][_0x6270('0x4f')]?_0x325848[_0x6270('0x3e')]:_0x13601c[_0x6270('0x3a')];if(!_0x2f4c1b[_0x6270('0x3b')]['hasOwnProperty'](_0x6270('0x65'))){_0x325848[_0x6270('0x20')]=qs['limit'](_0x2f4c1b[_0x6270('0x3b')][_0x6270('0x20')]);_0x325848[_0x6270('0x1f')]=qs['offset'](_0x2f4c1b[_0x6270('0x3b')][_0x6270('0x1f')]);}_0x325848[_0x6270('0x41')]=qs[_0x6270('0x42')](_0x2f4c1b['query'][_0x6270('0x42')]);_0x325848[_0x6270('0x43')]=qs[_0x6270('0x3c')](_[_0x6270('0x44')](_0x2f4c1b[_0x6270('0x3b')],_0x13601c['filters']));_0x325848[_0x6270('0x43')][_0x6270('0x66')]=_0x59e14b['id'];if(_0x2f4c1b[_0x6270('0x3b')][_0x6270('0x46')]){_0x325848[_0x6270('0x43')]=_[_0x6270('0x50')](_0x325848['where'],{'$or':_[_0x6270('0x2c')](_0x325848['attributes'],function(_0x4f1413){var _0x3abdc1={};_0x3abdc1[_0x4f1413]={'$like':'%'+_0x2f4c1b[_0x6270('0x3b')][_0x6270('0x46')]+'%'};return _0x3abdc1;})});}_0x325848=_[_0x6270('0x50')]({},_0x325848,_0x2f4c1b['options']);return db[_0x6270('0x67')]['count']({'where':_0x325848['where']})[_0x6270('0x26')](function(_0x4713c8){_0x3c3ca0[_0x6270('0x22')]=_0x4713c8;if(_0x2f4c1b['query'][_0x6270('0x48')]){_0x325848['include']=[{'all':!![]}];}return db[_0x6270('0x67')][_0x6270('0x49')](_0x325848);})[_0x6270('0x26')](function(_0x256f74){_0x3c3ca0['rows']=_0x256f74;return _0x3c3ca0;});}})[_0x6270('0x26')](respondWithFilteredResult(_0x4223c2,_0x325848))[_0x6270('0x4b')](handleError(_0x4223c2,null));};exports['getHopperHistories']=function(_0x5931e5,_0x34765e,_0x22173f){var _0x1488e0={'raw':!![],'where':{}};var _0x1276b1={};var _0xb15e6f={'count':0x0,'rows':[]};return db[_0x6270('0x36')]['findOne']({'where':{'id':_0x5931e5['params']['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x34765e,null))[_0x6270('0x26')](function(_0x2213d2){if(_0x2213d2){_0x1276b1[_0x6270('0x3a')]=_['keys'](db[_0x6270('0x68')][_0x6270('0x37')]);_0x1276b1[_0x6270('0x3b')]=_['keys'](_0x5931e5[_0x6270('0x3b')]);_0x1276b1['filters']=_[_0x6270('0x3d')](_0x1276b1[_0x6270('0x3a')],_0x1276b1['query']);_0x1488e0[_0x6270('0x3e')]=_['intersection'](_0x1276b1[_0x6270('0x3a')],qs[_0x6270('0x3f')](_0x5931e5[_0x6270('0x3b')][_0x6270('0x3f')]));_0x1488e0[_0x6270('0x3e')]=_0x1488e0[_0x6270('0x3e')][_0x6270('0x4f')]?_0x1488e0[_0x6270('0x3e')]:_0x1276b1[_0x6270('0x3a')];if(!_0x5931e5[_0x6270('0x3b')][_0x6270('0x40')](_0x6270('0x65'))){_0x1488e0[_0x6270('0x20')]=qs[_0x6270('0x20')](_0x5931e5[_0x6270('0x3b')][_0x6270('0x20')]);_0x1488e0[_0x6270('0x1f')]=qs[_0x6270('0x1f')](_0x5931e5['query'][_0x6270('0x1f')]);}_0x1488e0[_0x6270('0x41')]=qs['sort'](_0x5931e5[_0x6270('0x3b')][_0x6270('0x42')]);_0x1488e0[_0x6270('0x43')]=qs['filters'](_[_0x6270('0x44')](_0x5931e5[_0x6270('0x3b')],_0x1276b1[_0x6270('0x3c')]));_0x1488e0['where'][_0x6270('0x66')]=_0x2213d2['id'];if(_0x5931e5['query'][_0x6270('0x46')]){_0x1488e0[_0x6270('0x43')]=_[_0x6270('0x50')](_0x1488e0['where'],{'$or':_[_0x6270('0x2c')](_0x1488e0[_0x6270('0x3e')],function(_0x2f1442){var _0x58aff1={};_0x58aff1[_0x2f1442]={'$like':'%'+_0x5931e5[_0x6270('0x3b')][_0x6270('0x46')]+'%'};return _0x58aff1;})});}_0x1488e0=_[_0x6270('0x50')]({},_0x1488e0,_0x5931e5['options']);return db[_0x6270('0x68')][_0x6270('0x22')]({'where':_0x1488e0[_0x6270('0x43')]})[_0x6270('0x26')](function(_0x45f9a6){_0xb15e6f[_0x6270('0x22')]=_0x45f9a6;if(_0x5931e5['query'][_0x6270('0x48')]){_0x1488e0[_0x6270('0x5d')]=[{'all':!![]}];}return db[_0x6270('0x68')][_0x6270('0x49')](_0x1488e0);})[_0x6270('0x26')](function(_0x5615cb){_0xb15e6f[_0x6270('0x4a')]=_0x5615cb;return _0xb15e6f;});}})[_0x6270('0x26')](respondWithFilteredResult(_0x34765e,_0x1488e0))[_0x6270('0x4b')](handleError(_0x34765e,null));};exports[_0x6270('0x69')]=function(_0x2eddb4,_0xd4ec4c,_0x260535){var _0x4c90b2={'raw':!![],'where':{}};var _0x16b9df={};var _0x41922c={'count':0x0,'rows':[]};return db[_0x6270('0x36')]['findOne']({'where':{'id':_0x2eddb4[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0xd4ec4c,null))[_0x6270('0x26')](function(_0x5b119f){if(_0x5b119f){_0x16b9df[_0x6270('0x3a')]=_[_0x6270('0x4e')](db[_0x6270('0x6a')][_0x6270('0x37')]);_0x16b9df['query']=_[_0x6270('0x4e')](_0x2eddb4[_0x6270('0x3b')]);_0x16b9df[_0x6270('0x3c')]=_[_0x6270('0x3d')](_0x16b9df['model'],_0x16b9df['query']);_0x4c90b2[_0x6270('0x3e')]=_['intersection'](_0x16b9df[_0x6270('0x3a')],qs[_0x6270('0x3f')](_0x2eddb4['query'][_0x6270('0x3f')]));_0x4c90b2[_0x6270('0x3e')]=_0x4c90b2[_0x6270('0x3e')]['length']?_0x4c90b2[_0x6270('0x3e')]:_0x16b9df[_0x6270('0x3a')];if(!_0x2eddb4['query'][_0x6270('0x40')](_0x6270('0x65'))){_0x4c90b2[_0x6270('0x20')]=qs[_0x6270('0x20')](_0x2eddb4[_0x6270('0x3b')][_0x6270('0x20')]);_0x4c90b2[_0x6270('0x1f')]=qs[_0x6270('0x1f')](_0x2eddb4['query'][_0x6270('0x1f')]);}_0x4c90b2[_0x6270('0x41')]=qs[_0x6270('0x42')](_0x2eddb4[_0x6270('0x3b')]['sort']);_0x4c90b2[_0x6270('0x43')]=qs['filters'](_[_0x6270('0x44')](_0x2eddb4['query'],_0x16b9df[_0x6270('0x3c')]));_0x4c90b2[_0x6270('0x43')]['VoiceQueueId']=_0x5b119f['id'];if(_0x2eddb4['query'][_0x6270('0x46')]){_0x4c90b2[_0x6270('0x43')]=_[_0x6270('0x50')](_0x4c90b2[_0x6270('0x43')],{'$or':_[_0x6270('0x2c')](_0x4c90b2[_0x6270('0x3e')],function(_0x4e3a5b){var _0x3b0fe7={};_0x3b0fe7[_0x4e3a5b]={'$like':'%'+_0x2eddb4[_0x6270('0x3b')][_0x6270('0x46')]+'%'};return _0x3b0fe7;})});}_0x4c90b2=_[_0x6270('0x50')]({},_0x4c90b2,_0x2eddb4[_0x6270('0x47')]);return db[_0x6270('0x6a')]['count']({'where':_0x4c90b2[_0x6270('0x43')]})['then'](function(_0x18fe61){_0x41922c[_0x6270('0x22')]=_0x18fe61;if(_0x2eddb4[_0x6270('0x3b')][_0x6270('0x48')]){_0x4c90b2[_0x6270('0x5d')]=[{'all':!![]}];}return db[_0x6270('0x6a')][_0x6270('0x49')](_0x4c90b2);})['then'](function(_0x300877){_0x41922c[_0x6270('0x4a')]=_0x300877;return _0x41922c;});}})[_0x6270('0x26')](respondWithFilteredResult(_0xd4ec4c,_0x4c90b2))[_0x6270('0x4b')](handleError(_0xd4ec4c,null));};exports[_0x6270('0x6b')]=function(_0x4fd56f,_0x364c52,_0x24d66f){var _0x50fac2={'raw':!![],'where':{}};var _0x1438b1={};var _0xc7830a={'count':0x0,'rows':[]};return db[_0x6270('0x36')]['findOne']({'where':{'id':_0x4fd56f[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x364c52,null))['then'](function(_0xcd8ccc){if(_0xcd8ccc){_0x1438b1['model']=_[_0x6270('0x4e')](db[_0x6270('0x6c')][_0x6270('0x37')]);_0x1438b1[_0x6270('0x3b')]=_['keys'](_0x4fd56f['query']);_0x1438b1[_0x6270('0x3c')]=_[_0x6270('0x3d')](_0x1438b1[_0x6270('0x3a')],_0x1438b1['query']);_0x50fac2[_0x6270('0x3e')]=_[_0x6270('0x3d')](_0x1438b1[_0x6270('0x3a')],qs[_0x6270('0x3f')](_0x4fd56f[_0x6270('0x3b')][_0x6270('0x3f')]));_0x50fac2[_0x6270('0x3e')]=_0x50fac2['attributes']['length']?_0x50fac2[_0x6270('0x3e')]:_0x1438b1['model'];if(!_0x4fd56f[_0x6270('0x3b')][_0x6270('0x40')](_0x6270('0x65'))){_0x50fac2[_0x6270('0x20')]=qs[_0x6270('0x20')](_0x4fd56f[_0x6270('0x3b')][_0x6270('0x20')]);_0x50fac2['offset']=qs['offset'](_0x4fd56f[_0x6270('0x3b')][_0x6270('0x1f')]);}_0x50fac2[_0x6270('0x41')]=qs['sort'](_0x4fd56f[_0x6270('0x3b')][_0x6270('0x42')]);_0x50fac2[_0x6270('0x43')]=qs['filters'](_[_0x6270('0x44')](_0x4fd56f[_0x6270('0x3b')],_0x1438b1['filters']));_0x50fac2['where'][_0x6270('0x66')]=_0xcd8ccc['id'];if(_0x4fd56f[_0x6270('0x3b')][_0x6270('0x46')]){_0x50fac2[_0x6270('0x43')]=_[_0x6270('0x50')](_0x50fac2['where'],{'$or':_[_0x6270('0x2c')](_0x50fac2['attributes'],function(_0x535d20){var _0x1938c5={};_0x1938c5[_0x535d20]={'$like':'%'+_0x4fd56f[_0x6270('0x3b')][_0x6270('0x46')]+'%'};return _0x1938c5;})});}_0x50fac2=_[_0x6270('0x50')]({},_0x50fac2,_0x4fd56f[_0x6270('0x47')]);return db[_0x6270('0x6c')][_0x6270('0x22')]({'where':_0x50fac2['where']})['then'](function(_0x27d2fa){_0xc7830a[_0x6270('0x22')]=_0x27d2fa;if(_0x4fd56f['query'][_0x6270('0x48')]){_0x50fac2[_0x6270('0x5d')]=[{'all':!![]}];}return db[_0x6270('0x6c')]['findAll'](_0x50fac2);})[_0x6270('0x26')](function(_0x5c2952){_0xc7830a['rows']=_0x5c2952;return _0xc7830a;});}})[_0x6270('0x26')](respondWithFilteredResult(_0x364c52,_0x50fac2))[_0x6270('0x4b')](handleError(_0x364c52,null));};exports['getTeams']=function(_0x1f377c,_0xe57f42,_0x1efffb){var _0x240641={};var _0x3bd863={};var _0x4e1289;var _0x2421d1;return db[_0x6270('0x36')][_0x6270('0x64')]({'where':{'id':_0x1f377c[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0xe57f42,null))[_0x6270('0x26')](function(_0x556360){if(_0x556360){_0x4e1289=_0x556360;_0x3bd863[_0x6270('0x3a')]=_['keys'](db[_0x6270('0x6d')][_0x6270('0x37')]);_0x3bd863['query']=_[_0x6270('0x4e')](_0x1f377c['query']);_0x3bd863[_0x6270('0x3c')]=_[_0x6270('0x3d')](_0x3bd863[_0x6270('0x3a')],_0x3bd863['query']);_0x240641['attributes']=_['intersection'](_0x3bd863[_0x6270('0x3a')],qs[_0x6270('0x3f')](_0x1f377c[_0x6270('0x3b')][_0x6270('0x3f')]));_0x240641[_0x6270('0x3e')]=_0x240641[_0x6270('0x3e')][_0x6270('0x4f')]?_0x240641['attributes']:_0x3bd863[_0x6270('0x3a')];_0x240641['order']=qs[_0x6270('0x42')](_0x1f377c[_0x6270('0x3b')]['sort']);_0x240641[_0x6270('0x43')]=qs[_0x6270('0x3c')](_[_0x6270('0x44')](_0x1f377c[_0x6270('0x3b')],_0x3bd863[_0x6270('0x3c')]));if(_0x1f377c[_0x6270('0x3b')]['filter']){_0x240641['where']=_['merge'](_0x240641['where'],{'$or':_[_0x6270('0x2c')](_0x240641[_0x6270('0x3e')],function(_0x53fca0){var _0x1b8022={};_0x1b8022[_0x53fca0]={'$like':'%'+_0x1f377c[_0x6270('0x3b')][_0x6270('0x46')]+'%'};return _0x1b8022;})});}_0x240641=_[_0x6270('0x50')]({},_0x240641,_0x1f377c[_0x6270('0x47')]);return _0x4e1289[_0x6270('0x6e')](_0x240641);}})[_0x6270('0x26')](function(_0x17df55){if(_0x17df55){_0x2421d1=_0x17df55[_0x6270('0x4f')];if(!_0x1f377c[_0x6270('0x3b')][_0x6270('0x40')]('nolimit')){_0x240641[_0x6270('0x20')]=qs[_0x6270('0x20')](_0x1f377c[_0x6270('0x3b')]['limit']);_0x240641[_0x6270('0x1f')]=qs[_0x6270('0x1f')](_0x1f377c['query'][_0x6270('0x1f')]);}return _0x4e1289[_0x6270('0x6e')](_0x240641);}})[_0x6270('0x26')](function(_0x541643){if(_0x541643){return _0x541643?{'count':_0x2421d1,'rows':_0x541643}:null;}})[_0x6270('0x26')](respondWithResult(_0xe57f42,null))[_0x6270('0x4b')](handleError(_0xe57f42,null));};exports[_0x6270('0x6f')]=function(_0x89e5d,_0x57046d,_0xa71e71){var _0x246aa1=_0x89e5d[_0x6270('0x52')]['teams'];var _0x3fe494=_[_0x6270('0x2c')](_0x246aa1,'id');return db['Team'][_0x6270('0x49')]({'where':{'id':_0x3fe494},'attributes':['id'],'include':[{'model':db[_0x6270('0x70')],'as':_0x6270('0x71'),'attributes':['id',_0x6270('0x31'),_0x6270('0x72'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x59cb3d){if(_0x59cb3d){var _0x26cdc8=_['flatMap'](_0x59cb3d,function(_0x332fbd){var _0x1c68a0=_0x332fbd[_0x6270('0x28')]({'plain':!![]});_0x1c68a0[_0x6270('0x71')][_0x6270('0x73')](function(_0x4c08fe){_0x4c08fe[_0x6270('0x74')]=_[_0x6270('0x2e')](_0x246aa1,{'id':_0x1c68a0['id']})[_0x6270('0x74')];});return _0x1c68a0[_0x6270('0x71')];});return db[_0x6270('0x36')][_0x6270('0x2e')]({'where':{'id':_0x89e5d[_0x6270('0x4d')]['id']}})['then'](function(_0x36ede3){return db['sequelize'][_0x6270('0x75')](function(_0x3d7980){return _0x36ede3[_0x6270('0x6f')](_0x3fe494,{'transaction':_0x3d7980})['then'](function(){return BPromise['each'](_0x246aa1,function(_0x431c5c){return db[_0x6270('0x76')][_0x6270('0x77')]({'TeamId':_0x431c5c['id'],'VoiceQueueId':_0x89e5d['params']['id'],'penalty':_0x431c5c['penalty']},{'transaction':_0x3d7980});});})['then'](function(){return BPromise[_0x6270('0x78')](_0x26cdc8,function(_0x3c1656){return db['UserVoiceQueue'][_0x6270('0x79')]({'where':{'UserId':_0x3c1656['id'],'VoiceQueueId':_0x89e5d[_0x6270('0x4d')]['id']},'defaults':{'penalty':_0x3c1656[_0x6270('0x74')]},'transaction':_0x3d7980});});})['then'](function(){return BPromise[_0x6270('0x78')](_['filter'](_0x26cdc8,{'online':!![]}),function(_0x4699b4){return db['UserVoiceQueueRt'][_0x6270('0x77')]({'membername':_0x4699b4['name'],'UserId':_0x4699b4['id'],'queue_name':_0x36ede3[_0x6270('0x31')],'VoiceQueueId':_0x36ede3['id'],'interface':_['isNil'](_0x4699b4[_0x6270('0x7a')])?util[_0x6270('0x7b')](_0x6270('0x7c'),_0x4699b4[_0x6270('0x31')]):_0x4699b4[_0x6270('0x7a')],'paused':_0x4699b4[_0x6270('0x7d')]||![],'penalty':_0x4699b4[_0x6270('0x74')]},{'transaction':_0x3d7980});});})[_0x6270('0x26')](function(){_0x26cdc8[_0x6270('0x73')](function(_0x44291c){socket['emit'](_0x6270('0x7e'),{'UserId':_0x44291c['id'],'VoiceQueueId':_0x36ede3['id']});});});});});}})[_0x6270('0x26')](respondWithStatusCode(_0x57046d,null))[_0x6270('0x4b')](handleError(_0x57046d,null));};exports['removeTeams']=function(_0x5e2a8c,_0x3d2651,_0x54c6d2){return db['Team']['findAll']({'where':{'id':_0x5e2a8c[_0x6270('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6270('0x70')],'as':_0x6270('0x71'),'attributes':['id'],'raw':!![]}]})[_0x6270('0x26')](handleEntityNotFound(_0x3d2651,null))[_0x6270('0x26')](function(_0x110f32){var _0x56ab35=_[_0x6270('0x2c')](_0x110f32,'id');var _0x2bca5f=[];var _0x122039=[];var _0x1b349d=squel[_0x6270('0x7f')]();_0x1b349d['field'](_0x6270('0x80'))[_0x6270('0x81')](_0x6270('0x82'),'tq')['join'](_0x6270('0x83'),'ut',_0x6270('0x84'))['where'](_0x6270('0x85'),_0x5e2a8c['params']['id']);for(var _0x32c52a=0x0;_0x32c52a<_0x110f32['length'];_0x32c52a+=0x1){let _0x3b585c=_0x110f32[_0x32c52a];for(var _0x1f4a25=0x0;_0x1f4a25<_0x3b585c[_0x6270('0x71')][_0x6270('0x4f')];_0x1f4a25+=0x1){let _0x7a0027=_0x3b585c[_0x6270('0x71')][_0x1f4a25];var _0x1a281c=_0x1b349d['clone']();_0x1a281c['where'](_0x6270('0x86'),_0x7a0027['id']);_0x122039[_0x6270('0x87')](db['sequelize']['query'](_0x1a281c[_0x6270('0x88')](),{'type':db[_0x6270('0x89')][_0x6270('0x8a')][_0x6270('0x8b')]})[_0x6270('0x26')](function(_0x4493fe){if(_0x4493fe[_0x6270('0x4f')]===0x1){return _0x7a0027['id'];}else{var _0x427eae=_[_0x6270('0x8c')](_[_0x6270('0x2c')](_0x4493fe,_0x6270('0x8d')),function(_0x242858){return _['includes'](_0x56ab35,_0x242858);});if(_0x427eae){return _0x7a0027['id'];}}}));}}return BPromise[_0x6270('0x8e')](_0x122039)['then'](function(_0x421864){_0x2bca5f=_(_0x2bca5f)[_0x6270('0x8f')](_0x421864)[_0x6270('0x90')]()['value']();return db['VoiceQueue']['find']({'where':{'id':_0x5e2a8c[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](function(_0x3583ac){return db['sequelize'][_0x6270('0x75')](function(_0x3ca2a8){return _0x3583ac[_0x6270('0x91')](_0x5e2a8c['query'][_0x6270('0x92')],{'transaction':_0x3ca2a8})[_0x6270('0x26')](function(){if(!_[_0x6270('0x93')](_0x2bca5f)){return _0x3583ac[_0x6270('0x94')](_0x2bca5f,{'transaction':_0x3ca2a8})[_0x6270('0x26')](function(){return db[_0x6270('0x95')][_0x6270('0x27')]({'where':{'VoiceQueueId':_0x5e2a8c[_0x6270('0x4d')]['id'],'UserId':_0x2bca5f},'transaction':_0x3ca2a8});});}})[_0x6270('0x26')](function(){_0x2bca5f['forEach'](function(_0x1c3feb){socket[_0x6270('0x96')]('userVoiceQueue:remove',{'UserId':_0x1c3feb,'VoiceQueueId':_0x3583ac['id']});});});});});});})['then'](respondWithStatusCode(_0x3d2651,null))[_0x6270('0x4b')](handleError(_0x3d2651,null));};exports[_0x6270('0x97')]=function(_0x1be3de,_0x1b5e89,_0x5d057c){var _0x5358f3,_0x1e4cf0;return db[_0x6270('0x36')][_0x6270('0x2e')]({'where':{'id':_0x1be3de[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x1b5e89,null))[_0x6270('0x26')](function(_0x453bb7){if(_0x453bb7){_0x1e4cf0=_0x453bb7;return _0x453bb7[_0x6270('0x97')](_0x1be3de[_0x6270('0x52')][_0x6270('0x92')],_['omit'](_0x1be3de[_0x6270('0x52')],[_0x6270('0x92'),'id'])||{})[_0x6270('0x98')](function(_0x3d261f){for(var _0x7e928b=0x0;_0x7e928b<_0x1be3de['body']['ids'][_0x6270('0x4f')];_0x7e928b+=0x1){socket[_0x6270('0x96')](_0x6270('0x7e'),{'UserId':Number(_0x1be3de[_0x6270('0x52')][_0x6270('0x92')][_0x7e928b]),'VoiceQueueId':Number(_0x1be3de['params']['id'])});}return _0x3d261f;});}})['then'](function(_0x37c353){_0x5358f3=_0x37c353||[];if(_0x1e4cf0){return db[_0x6270('0x70')][_0x6270('0x49')]({'where':{'id':_0x1be3de[_0x6270('0x52')][_0x6270('0x92')]},'attributes':['id',_0x6270('0x31'),_0x6270('0x72'),_0x6270('0x7d'),_0x6270('0x7a')],'raw':!![]});}})[_0x6270('0x26')](function(_0x13fa72){if(!_[_0x6270('0x93')](_0x13fa72)){var _0x153b9e=[];for(var _0xf5b463=0x0;_0xf5b463<_0x13fa72['length'];_0xf5b463++){if(_0x13fa72[_0xf5b463][_0x6270('0x72')]){_0x153b9e[_0x6270('0x87')](db['UserVoiceQueueRt'][_0x6270('0x77')]({'membername':_0x13fa72[_0xf5b463][_0x6270('0x31')],'UserId':_0x13fa72[_0xf5b463]['id'],'queue_name':_0x1e4cf0[_0x6270('0x31')],'VoiceQueueId':_0x1e4cf0['id'],'interface':_[_0x6270('0x99')](_0x13fa72[_0xf5b463]['interface'])?util[_0x6270('0x7b')]('SIP/%s',_0x13fa72[_0xf5b463][_0x6270('0x31')]):_0x13fa72[_0xf5b463][_0x6270('0x7a')],'paused':_0x13fa72[_0xf5b463][_0x6270('0x7d')]||![],'penalty':_0x1be3de[_0x6270('0x52')][_0x6270('0x74')]||0x0}));}}return BPromise[_0x6270('0x8e')](_0x153b9e);}})[_0x6270('0x26')](function(){return _0x5358f3;})[_0x6270('0x26')](respondWithResult(_0x1b5e89,null))['catch'](handleError(_0x1b5e89,null));};exports[_0x6270('0x94')]=function(_0x415764,_0x11dcfd,_0x2639ba){return db[_0x6270('0x36')]['find']({'where':{'id':_0x415764[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x11dcfd,null))[_0x6270('0x26')](function(_0x5c67b5){if(_0x5c67b5){return _0x5c67b5['removeAgents'](_0x415764['query']['ids'])[_0x6270('0x26')](function(){if(_['isArray'](_0x415764['query'][_0x6270('0x92')])){for(var _0x333650=0x0;_0x333650<_0x415764['query'][_0x6270('0x92')][_0x6270('0x4f')];_0x333650+=0x1){socket[_0x6270('0x96')](_0x6270('0x9a'),{'UserId':Number(_0x415764['query'][_0x6270('0x92')][_0x333650]),'VoiceQueueId':Number(_0x415764[_0x6270('0x4d')]['id'])});}}else{socket[_0x6270('0x96')](_0x6270('0x9a'),{'UserId':Number(_0x415764['query'][_0x6270('0x92')]),'VoiceQueueId':Number(_0x415764[_0x6270('0x4d')]['id'])});}});}})['then'](function(_0x420953){return db[_0x6270('0x95')][_0x6270('0x27')]({'where':{'VoiceQueueId':_0x415764[_0x6270('0x4d')]['id'],'UserId':_0x415764[_0x6270('0x3b')][_0x6270('0x92')]}})[_0x6270('0x26')](function(){return _0x420953;});})[_0x6270('0x26')](respondWithStatusCode(_0x11dcfd,null))[_0x6270('0x4b')](handleError(_0x11dcfd,null));};exports['getAgents']=function(_0x32f758,_0x4db013,_0x1b94fe){var _0x4aa498={};var _0x518717={};var _0x48fc68;var _0x15cafd;return db[_0x6270('0x36')]['findOne']({'where':{'id':_0x32f758['params']['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x4db013,null))['then'](function(_0x27fa40){if(_0x27fa40){_0x48fc68=_0x27fa40;_0x518717[_0x6270('0x3a')]=_[_0x6270('0x4e')](db[_0x6270('0x70')][_0x6270('0x37')]);_0x518717[_0x6270('0x3b')]=_[_0x6270('0x4e')](_0x32f758[_0x6270('0x3b')]);_0x518717[_0x6270('0x3c')]=_['intersection'](_0x518717[_0x6270('0x3a')],_0x518717[_0x6270('0x3b')]);_0x4aa498[_0x6270('0x3e')]=_['intersection'](_0x518717[_0x6270('0x3a')],qs[_0x6270('0x3f')](_0x32f758[_0x6270('0x3b')]['fields']));_0x4aa498['attributes']=_0x4aa498[_0x6270('0x3e')][_0x6270('0x4f')]?_0x4aa498[_0x6270('0x3e')]:_0x518717[_0x6270('0x3a')];_0x4aa498['order']=qs['sort'](_0x32f758['query'][_0x6270('0x42')]);_0x4aa498[_0x6270('0x43')]=qs[_0x6270('0x3c')](_[_0x6270('0x44')](_0x32f758[_0x6270('0x3b')],_0x518717[_0x6270('0x3c')]));if(_0x32f758[_0x6270('0x3b')]['filter']){_0x4aa498[_0x6270('0x43')]=_['merge'](_0x4aa498[_0x6270('0x43')],{'$or':_[_0x6270('0x2c')](_0x4aa498['attributes'],function(_0x49e693){var _0x41e437={};_0x41e437[_0x49e693]={'$like':'%'+_0x32f758['query'][_0x6270('0x46')]+'%'};return _0x41e437;})});}_0x4aa498=_[_0x6270('0x50')]({},_0x4aa498,_0x32f758[_0x6270('0x47')]);return _0x48fc68[_0x6270('0x9b')](_0x4aa498);}})[_0x6270('0x26')](function(_0x254288){if(_0x254288){_0x15cafd=_0x254288[_0x6270('0x4f')];if(!_0x32f758[_0x6270('0x3b')][_0x6270('0x40')]('nolimit')){_0x4aa498[_0x6270('0x20')]=qs['limit'](_0x32f758[_0x6270('0x3b')][_0x6270('0x20')]);_0x4aa498[_0x6270('0x1f')]=qs[_0x6270('0x1f')](_0x32f758[_0x6270('0x3b')][_0x6270('0x1f')]);}return _0x48fc68[_0x6270('0x9b')](_0x4aa498);}})['then'](function(_0x26b76a){if(_0x26b76a){return _0x26b76a?{'count':_0x15cafd,'rows':_0x26b76a}:null;}})[_0x6270('0x26')](respondWithResult(_0x4db013,null))[_0x6270('0x4b')](handleError(_0x4db013,null));};exports['getMembers']=function(_0xe60aa5,_0x3bf533,_0x25ac45){var _0x1bb26d={};var _0x3e95d2={};var _0x212a05;var _0x571350;return db[_0x6270('0x36')][_0x6270('0x64')]({'where':{'id':_0xe60aa5[_0x6270('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3bf533,null))[_0x6270('0x26')](function(_0x4d92b8){if(_0x4d92b8){_0x212a05=_0x4d92b8;_0x3e95d2[_0x6270('0x3a')]=_['keys'](db[_0x6270('0x95')][_0x6270('0x37')]);_0x3e95d2[_0x6270('0x3b')]=_[_0x6270('0x4e')](_0xe60aa5[_0x6270('0x3b')]);_0x3e95d2['filters']=_[_0x6270('0x3d')](_0x3e95d2[_0x6270('0x3a')],_0x3e95d2[_0x6270('0x3b')]);_0x1bb26d[_0x6270('0x3e')]=_['intersection'](_0x3e95d2[_0x6270('0x3a')],qs['fields'](_0xe60aa5[_0x6270('0x3b')]['fields']));_0x1bb26d[_0x6270('0x3e')]=_0x1bb26d[_0x6270('0x3e')][_0x6270('0x4f')]?_0x1bb26d[_0x6270('0x3e')]:_0x3e95d2['model'];_0x1bb26d[_0x6270('0x41')]=qs[_0x6270('0x42')](_0xe60aa5[_0x6270('0x3b')][_0x6270('0x42')]);_0x1bb26d[_0x6270('0x43')]=qs[_0x6270('0x3c')](_[_0x6270('0x44')](_0xe60aa5[_0x6270('0x3b')],_0x3e95d2[_0x6270('0x3c')]));if(_0xe60aa5[_0x6270('0x3b')][_0x6270('0x46')]){_0x1bb26d[_0x6270('0x43')]=_[_0x6270('0x50')](_0x1bb26d[_0x6270('0x43')],{'$or':_[_0x6270('0x2c')](_0x1bb26d[_0x6270('0x3e')],function(_0x2a478e){var _0xa75ee3={};_0xa75ee3[_0x2a478e]={'$like':'%'+_0xe60aa5[_0x6270('0x3b')][_0x6270('0x46')]+'%'};return _0xa75ee3;})});}_0x1bb26d=_[_0x6270('0x50')]({},_0x1bb26d,_0xe60aa5[_0x6270('0x47')]);return _0x212a05[_0x6270('0x9c')](_0x1bb26d);}})[_0x6270('0x26')](function(_0x2a9880){if(_0x2a9880){_0x571350=_0x2a9880['length'];if(!_0xe60aa5[_0x6270('0x3b')][_0x6270('0x40')](_0x6270('0x65'))){_0x1bb26d[_0x6270('0x20')]=qs['limit'](_0xe60aa5[_0x6270('0x3b')][_0x6270('0x20')]);_0x1bb26d[_0x6270('0x1f')]=qs['offset'](_0xe60aa5[_0x6270('0x3b')]['offset']);}return _0x212a05[_0x6270('0x9c')](_0x1bb26d);}})[_0x6270('0x26')](function(_0x1b0b7c){return _0x1b0b7c?{'count':_0x571350,'rows':_0x1b0b7c}:null;})[_0x6270('0x26')](respondWithResult(_0x3bf533,null))[_0x6270('0x4b')](handleError(_0x3bf533,null));};exports[_0x6270('0x9d')]=function(_0x47685e,_0x39251e,_0x252c87){var _0x22ff9e={};var _0x243750={};var _0x139249;var _0x4b8c8b;return db[_0x6270('0x36')][_0x6270('0x64')]({'where':{'id':_0x47685e[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x39251e,null))['then'](function(_0x1cce2b){if(_0x1cce2b){_0x139249=_0x1cce2b;_0x243750['model']=_[_0x6270('0x4e')](db['CmList'][_0x6270('0x37')]);_0x243750[_0x6270('0x3b')]=_['keys'](_0x47685e[_0x6270('0x3b')]);_0x243750[_0x6270('0x3c')]=_['intersection'](_0x243750['model'],_0x243750['query']);_0x22ff9e[_0x6270('0x3e')]=_[_0x6270('0x3d')](_0x243750['model'],qs['fields'](_0x47685e[_0x6270('0x3b')][_0x6270('0x3f')]));_0x22ff9e[_0x6270('0x3e')]=_0x22ff9e['attributes'][_0x6270('0x4f')]?_0x22ff9e[_0x6270('0x3e')]:_0x243750['model'];_0x22ff9e['order']=qs[_0x6270('0x42')](_0x47685e[_0x6270('0x3b')][_0x6270('0x42')]);_0x22ff9e[_0x6270('0x43')]=qs[_0x6270('0x3c')](_[_0x6270('0x44')](_0x47685e[_0x6270('0x3b')],_0x243750['filters']));if(_0x47685e[_0x6270('0x3b')][_0x6270('0x46')]){_0x22ff9e[_0x6270('0x43')]=_[_0x6270('0x50')](_0x22ff9e[_0x6270('0x43')],{'$or':_[_0x6270('0x2c')](_0x22ff9e['attributes'],function(_0x207854){var _0x5edd3b={};_0x5edd3b[_0x207854]={'$like':'%'+_0x47685e[_0x6270('0x3b')]['filter']+'%'};return _0x5edd3b;})});}_0x22ff9e=_[_0x6270('0x50')]({},_0x22ff9e,_0x47685e[_0x6270('0x47')]);return _0x139249[_0x6270('0x9d')](_0x22ff9e);}})[_0x6270('0x26')](function(_0x1d92f7){if(_0x1d92f7){_0x4b8c8b=_0x1d92f7[_0x6270('0x4f')];if(!_0x47685e['query'][_0x6270('0x40')](_0x6270('0x65'))){_0x22ff9e[_0x6270('0x20')]=qs[_0x6270('0x20')](_0x47685e[_0x6270('0x3b')][_0x6270('0x20')]);_0x22ff9e[_0x6270('0x1f')]=qs[_0x6270('0x1f')](_0x47685e[_0x6270('0x3b')][_0x6270('0x1f')]);}return _0x139249[_0x6270('0x9d')](_0x22ff9e);}})[_0x6270('0x26')](function(_0x707dd9){if(_0x707dd9){return _0x707dd9?{'count':_0x4b8c8b,'rows':_0x707dd9}:null;}})['then'](respondWithResult(_0x39251e,null))['catch'](handleError(_0x39251e,null));};exports[_0x6270('0x9e')]=function(_0x38b9b3,_0x41df04,_0x5f2a5e){var _0x18e27b=moment()[_0x6270('0x7b')](_0x6270('0x9f'));var _0x34ab50,_0x2f8132;return db[_0x6270('0x36')][_0x6270('0x2e')]({'where':{'id':_0x38b9b3[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x41df04,null))['then'](function(_0x1cc1bb){if(_0x1cc1bb){_0x2f8132=_0x1cc1bb;return _0x1cc1bb[_0x6270('0x9e')](_0x38b9b3['body'][_0x6270('0x92')],_['omit'](_0x38b9b3[_0x6270('0x52')],[_0x6270('0x92'),'id'])||{});}return null;})['spread'](function(_0x35f325){var _0x1fdd28;_0x34ab50=_0x35f325||[];var _0x12cf76=[];if(_0x35f325){for(var _0x41a003=0x0;_0x41a003<_0x35f325[_0x6270('0x4f')];_0x41a003+=0x1){var _0x2ffbd9=_0x35f325[_0x41a003][_0x6270('0x28')]({'plain':!![]});_0x2f8132['dialCheckDuplicateType']=_0x38b9b3['body'][_0x6270('0xa0')]?_0x38b9b3[_0x6270('0x52')]['dialCheckDuplicateType']:_0x2f8132[_0x6270('0xa0')];switch(_0x2f8132['dialCheckDuplicateType']){case _0x6270('0xa1'):_0x1fdd28=squel['insert']()['into'](_0x6270('0xa2'))[_0x6270('0xa3')]([_0x6270('0xa4'),_0x6270('0xa5'),_0x6270('0xa6'),'ListId',_0x6270('0x66'),_0x6270('0x5f'),_0x6270('0xa7')],squel[_0x6270('0x7f')]()[_0x6270('0xa8')](_0x6270('0xa4'),_0x6270('0xa4'))[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27',_0x6270('0xa5'))['field']('id',_0x6270('0xa6'))[_0x6270('0xa8')](_0x2ffbd9[_0x6270('0xa9')]['toString'](),_0x6270('0xaa'))['field'](_0x38b9b3[_0x6270('0x4d')]['id'][_0x6270('0x88')](),_0x6270('0x66'))['field']('\x27'+_0x18e27b+'\x27',_0x6270('0x5f'))['field']('\x27'+_0x18e27b+'\x27',_0x6270('0xa7'))['from'](_0x6270('0xab'))[_0x6270('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0x6270('0xac'),_0x2ffbd9[_0x6270('0xa9')]['toString']())[_0x6270('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x6270('0x43')](_0x6270('0xad'),squel[_0x6270('0x7f')]()[_0x6270('0xa8')]('COALESCE(calleridnum,\x27\x27)')[_0x6270('0x81')](_0x6270('0xae'))[_0x6270('0x43')](_0x6270('0x85'),_0x38b9b3[_0x6270('0x4d')]['id'][_0x6270('0x88')]()))[_0x6270('0x43')](_0x6270('0xad'),squel['select']()[_0x6270('0xa8')](_0x6270('0xaf'))[_0x6270('0x81')](_0x6270('0xa2'))[_0x6270('0x43')](_0x6270('0x85'),_0x38b9b3['params']['id'][_0x6270('0x88')]())))[_0x6270('0x88')]();break;case _0x6270('0xb0'):_0x1fdd28=squel[_0x6270('0xb1')]()[_0x6270('0xb2')](_0x6270('0xa2'))[_0x6270('0xa3')]([_0x6270('0xa4'),_0x6270('0xa5'),_0x6270('0xa6'),_0x6270('0xaa'),_0x6270('0x66'),_0x6270('0x5f'),_0x6270('0xa7')],squel[_0x6270('0x7f')]()[_0x6270('0xa8')](_0x6270('0xa4'),_0x6270('0xa4'))[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27',_0x6270('0xa5'))['field']('id','ContactId')['field'](_0x2ffbd9[_0x6270('0xa9')]['toString'](),_0x6270('0xaa'))[_0x6270('0xa8')](_0x38b9b3['params']['id']['toString'](),'VoiceQueueId')[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27',_0x6270('0x5f'))[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27',_0x6270('0xa7'))['from'](_0x6270('0xab'))[_0x6270('0x43')](_0x6270('0xb3'))[_0x6270('0x43')]('ListId\x20=\x20?',_0x2ffbd9[_0x6270('0xa9')]['toString']())[_0x6270('0x43')](_0x6270('0xb4'))['where'](_0x6270('0xad'),squel[_0x6270('0x7f')]()[_0x6270('0xa8')](_0x6270('0xaf'))[_0x6270('0x81')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x38b9b3[_0x6270('0x4d')]['id']['toString']())))[_0x6270('0x88')]();break;default:_0x1fdd28=squel['insert']()[_0x6270('0xb2')](_0x6270('0xa2'))[_0x6270('0xa3')]([_0x6270('0xa4'),_0x6270('0xa5'),'ContactId','ListId',_0x6270('0x66'),_0x6270('0x5f'),_0x6270('0xa7')],squel[_0x6270('0x7f')]()['field'](_0x6270('0xa4'),_0x6270('0xa4'))[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27','scheduledAt')[_0x6270('0xa8')]('id','ContactId')[_0x6270('0xa8')](_0x2ffbd9[_0x6270('0xa9')][_0x6270('0x88')](),_0x6270('0xaa'))[_0x6270('0xa8')](_0x38b9b3[_0x6270('0x4d')]['id'][_0x6270('0x88')](),'VoiceQueueId')[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27',_0x6270('0x5f'))[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27',_0x6270('0xa7'))[_0x6270('0x81')]('cm_contacts')[_0x6270('0x43')](_0x6270('0xb3'))[_0x6270('0x43')](_0x6270('0xac'),_0x2ffbd9[_0x6270('0xa9')][_0x6270('0x88')]())[_0x6270('0x43')](_0x6270('0xb4')))[_0x6270('0x88')]();}_0x12cf76[_0x6270('0x87')](db[_0x6270('0x89')][_0x6270('0x3b')](_0x1fdd28));}return BPromise[_0x6270('0x8e')](_0x12cf76);}})['then'](function(){var _0x3a00c7=[];var _0x2c8394=squel[_0x6270('0xb1')]()[_0x6270('0xb2')](_0x6270('0xb5'))['fromQuery']([_0x6270('0xb6'),'phone',_0x6270('0xb7'),_0x6270('0x5f'),_0x6270('0xa7')],squel[_0x6270('0x7f')]()[_0x6270('0xa8')]('h.id')['field']('ci.item')[_0x6270('0xa8')](_0x6270('0xb8'))[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27',_0x6270('0x5f'))[_0x6270('0xa8')]('\x27'+_0x18e27b+'\x27','updatedAt')['from'](_0x6270('0xb9'),'ci')[_0x6270('0xba')](_0x6270('0xa2'),'h','h.ContactId=ci.CmContactId')[_0x6270('0x43')]('h.scheduledat=?',_0x18e27b)[_0x6270('0x43')]('ci.ItemClass=?','PHONE'))['toString']();_0x3a00c7['push'](db['sequelize'][_0x6270('0x3b')](_0x2c8394));return BPromise[_0x6270('0x8e')](_0x3a00c7);})[_0x6270('0x26')](function(){return _0x34ab50;})['then'](respondWithResult(_0x41df04,null))[_0x6270('0x4b')](handleError(_0x41df04,null));};exports[_0x6270('0xbb')]=function(_0x294645,_0x593c89,_0x49f6e5){return db[_0x6270('0x36')][_0x6270('0x2e')]({'where':{'id':_0x294645[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x593c89,null))['then'](function(_0x1def00){if(_0x1def00){return _0x1def00[_0x6270('0xbb')](_0x294645['query']['ids']);}})['then'](function(_0x181840){if(_0x181840){return db[_0x6270('0x67')][_0x6270('0x27')]({'where':{'ListId':_0x294645['query'][_0x6270('0x92')],'VoiceQueueId':_0x294645[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](function(){return _0x181840;});}})[_0x6270('0x26')](respondWithStatusCode(_0x593c89,null))[_0x6270('0x4b')](handleError(_0x593c89,null));};exports['getBlackLists']=function(_0x332f4b,_0x2cfed4,_0x1fcdac){var _0x35eb0f={};var _0x503374={};var _0x568a30;var _0x4c664d;return db[_0x6270('0x36')][_0x6270('0x64')]({'where':{'id':_0x332f4b['params']['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x2cfed4,null))[_0x6270('0x26')](function(_0x40f9fc){if(_0x40f9fc){_0x568a30=_0x40f9fc;_0x503374['model']=_[_0x6270('0x4e')](db[_0x6270('0xbc')][_0x6270('0x37')]);_0x503374[_0x6270('0x3b')]=_[_0x6270('0x4e')](_0x332f4b[_0x6270('0x3b')]);_0x503374[_0x6270('0x3c')]=_[_0x6270('0x3d')](_0x503374['model'],_0x503374[_0x6270('0x3b')]);_0x35eb0f['attributes']=_[_0x6270('0x3d')](_0x503374['model'],qs[_0x6270('0x3f')](_0x332f4b[_0x6270('0x3b')][_0x6270('0x3f')]));_0x35eb0f[_0x6270('0x3e')]=_0x35eb0f[_0x6270('0x3e')]['length']?_0x35eb0f[_0x6270('0x3e')]:_0x503374[_0x6270('0x3a')];_0x35eb0f[_0x6270('0x41')]=qs[_0x6270('0x42')](_0x332f4b[_0x6270('0x3b')][_0x6270('0x42')]);_0x35eb0f['where']=qs['filters'](_[_0x6270('0x44')](_0x332f4b[_0x6270('0x3b')],_0x503374[_0x6270('0x3c')]));if(_0x332f4b[_0x6270('0x3b')][_0x6270('0x46')]){_0x35eb0f[_0x6270('0x43')]=_[_0x6270('0x50')](_0x35eb0f['where'],{'$or':_[_0x6270('0x2c')](_0x35eb0f[_0x6270('0x3e')],function(_0x213ce0){var _0xc59196={};_0xc59196[_0x213ce0]={'$like':'%'+_0x332f4b['query'][_0x6270('0x46')]+'%'};return _0xc59196;})});}_0x35eb0f=_[_0x6270('0x50')]({},_0x35eb0f,_0x332f4b[_0x6270('0x47')]);return _0x568a30['getBlackLists'](_0x35eb0f);}})[_0x6270('0x26')](function(_0x1d5e14){if(_0x1d5e14){_0x4c664d=_0x1d5e14['length'];if(!_0x332f4b[_0x6270('0x3b')][_0x6270('0x40')](_0x6270('0x65'))){_0x35eb0f[_0x6270('0x20')]=qs[_0x6270('0x20')](_0x332f4b[_0x6270('0x3b')]['limit']);_0x35eb0f[_0x6270('0x1f')]=qs[_0x6270('0x1f')](_0x332f4b[_0x6270('0x3b')]['offset']);}return _0x568a30[_0x6270('0xbd')](_0x35eb0f);}})[_0x6270('0x26')](function(_0x139c06){if(_0x139c06){return _0x139c06?{'count':_0x4c664d,'rows':_0x139c06}:null;}})['then'](respondWithResult(_0x2cfed4,null))[_0x6270('0x4b')](handleError(_0x2cfed4,null));};exports[_0x6270('0xbe')]=function(_0x1cfb55,_0x187e42,_0xdab47c){var _0x552f01,_0x3b0348;return db[_0x6270('0x36')]['find']({'where':{'id':_0x1cfb55[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x187e42,null))[_0x6270('0x26')](function(_0x500da4){if(_0x500da4){_0x3b0348=_0x500da4;return _0x500da4[_0x6270('0xbe')](_0x1cfb55[_0x6270('0x52')][_0x6270('0x92')],_[_0x6270('0x5e')](_0x1cfb55[_0x6270('0x52')],[_0x6270('0x92'),'id'])||{});}return null;})[_0x6270('0x98')](function(_0x3c0ea1){var _0x3e1bba;_0x552f01=_0x3c0ea1||[];var _0x3dd11d=[];if(_0x3c0ea1){for(var _0x457acc=0x0;_0x457acc<_0x3c0ea1[_0x6270('0x4f')];_0x457acc+=0x1){var _0x6c45ce=_0x3c0ea1[_0x457acc][_0x6270('0x28')]({'plain':!![]});_0x3e1bba=squel[_0x6270('0xb1')]()['into'](_0x6270('0xbf'))[_0x6270('0xa3')]([_0x6270('0xa4'),_0x6270('0xa6'),_0x6270('0xaa'),_0x6270('0x66'),_0x6270('0x5f'),_0x6270('0xa7')],squel[_0x6270('0x7f')]()[_0x6270('0xa8')](_0x6270('0xa4'),_0x6270('0xa4'))[_0x6270('0xa8')]('id',_0x6270('0xa6'))[_0x6270('0xa8')](_0x6c45ce[_0x6270('0xa9')][_0x6270('0x88')](),'ListId')[_0x6270('0xa8')](_0x1cfb55[_0x6270('0x4d')]['id'][_0x6270('0x88')](),_0x6270('0x66'))[_0x6270('0xa8')](_0x6270('0xc0'),_0x6270('0x5f'))[_0x6270('0xa8')](_0x6270('0xc0'),_0x6270('0xa7'))['from'](_0x6270('0xab'))['where']('deletedAt\x20IS\x20NULL')[_0x6270('0x43')]('ListId\x20=\x20?',_0x6c45ce[_0x6270('0xa9')]['toString']())[_0x6270('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x6270('0x88')]();_0x3dd11d[_0x6270('0x87')](db[_0x6270('0x89')]['query'](_0x3e1bba));}return BPromise[_0x6270('0x8e')](_0x3dd11d);}})[_0x6270('0x26')](function(){return _0x552f01;})[_0x6270('0x26')](respondWithResult(_0x187e42,null))[_0x6270('0x4b')](handleError(_0x187e42,null));};exports[_0x6270('0xc1')]=function(_0x53c16c,_0x2cfd37,_0x43c033){return db[_0x6270('0x36')][_0x6270('0x2e')]({'where':{'id':_0x53c16c[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](handleEntityNotFound(_0x2cfd37,null))[_0x6270('0x26')](function(_0x576d52){if(_0x576d52){return _0x576d52[_0x6270('0xc1')](_0x53c16c[_0x6270('0x3b')][_0x6270('0x92')]);}})[_0x6270('0x26')](function(_0x4a334e){if(_0x4a334e){return db['CmHopperBlack'][_0x6270('0x27')]({'where':{'ListId':_0x53c16c[_0x6270('0x3b')][_0x6270('0x92')],'VoiceQueueId':_0x53c16c[_0x6270('0x4d')]['id']}})[_0x6270('0x26')](function(){return _0x4a334e;});}})[_0x6270('0x26')](respondWithStatusCode(_0x2cfd37,null))[_0x6270('0x4b')](handleError(_0x2cfd37,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d3480ff..30aea9c 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 _0x8c23=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x14f97f,_0x168ce2){var _0x1adb11=function(_0x598122){while(--_0x598122){_0x14f97f['push'](_0x14f97f['shift']());}};_0x1adb11(++_0x168ce2);}(_0x8c23,0xc5));var _0x38c2=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8c23[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x38c2('0x0'))['db'][_0x38c2('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x38c2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x38c2('0x3')};function emitEvent(_0x489cad){return function(_0x194f72,_0x582aa5,_0x487bde){VoiceQueueEvents['emit'](_0x489cad+':'+_0x194f72['id'],_0x194f72);VoiceQueueEvents[_0x38c2('0x4')](_0x489cad,_0x194f72);_0x487bde(null);};}for(var e in events){if(events[_0x38c2('0x5')](e)){var event=events[e];VoiceQueue[_0x38c2('0x6')](e,emitEvent(event));}}module[_0x38c2('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xe10d=['update','remove','emit','hasOwnProperty','hook','exports','events','VoiceQueue'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xe10d,0x11e));var _0xde10=function(_0x5003da,_0x3be204){_0x5003da=_0x5003da-0x0;var _0x2a4d46=_0xe10d[_0x5003da];return _0x2a4d46;};'use strict';var EventEmitter=require(_0xde10('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xde10('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xde10('0x2'),'afterDestroy':_0xde10('0x3')};function emitEvent(_0x536723){return function(_0x3f142e,_0x382f88,_0x34009a){VoiceQueueEvents['emit'](_0x536723+':'+_0x3f142e['id'],_0x3f142e);VoiceQueueEvents[_0xde10('0x4')](_0x536723,_0x3f142e);_0x34009a(null);};}for(var e in events){if(events[_0xde10('0x5')](e)){var event=events[e];VoiceQueue[_0xde10('0x6')](e,emitEvent(event));}}module[_0xde10('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d83a577..a1816a5 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(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x55ca,0x126));var _0xa55c=function(_0x2c5340,_0x5c86e5){_0x2c5340=_0x2c5340-0x0;var _0x3c505e=_0x55ca[_0x2c5340];return _0x3c505e;};'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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x97db75,_0x3abdb8){var _0x259a53=function(_0x4af802){while(--_0x4af802){_0x97db75['push'](_0x97db75['shift']());}};_0x259a53(++_0x3abdb8);}(_0x3e74,0x175));var _0x43e7=function(_0x168bcd,_0x27a88c){_0x168bcd=_0x168bcd-0x0;var _0x4e4bca=_0x3e74[_0x168bcd];return _0x4e4bca;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 3605c1c..17417ba 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 _0x8465=['http','redis','defaults','localhost','socket.io-emitter','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','result','catch','GetVoiceQueue','VoiceQueue','raw','options','where','include','map','model','attributes','then','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x26afda,_0x472b85){var _0x4ecb46=function(_0x35f083){while(--_0x35f083){_0x26afda['push'](_0x26afda['shift']());}};_0x4ecb46(++_0x472b85);}(_0x8465,0x19c));var _0x5846=function(_0x190725,_0x4c879f){_0x190725=_0x190725-0x0;var _0x4fe2de=_0x8465[_0x190725];return _0x4fe2de;};'use strict';var _=require(_0x5846('0x0'));var util=require(_0x5846('0x1'));var moment=require(_0x5846('0x2'));var BPromise=require(_0x5846('0x3'));var rs=require(_0x5846('0x4'));var fs=require('fs');var Redis=require(_0x5846('0x5'));var db=require(_0x5846('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5846('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5846('0x8')]({'port':0x232a});config[_0x5846('0x9')]=_[_0x5846('0xa')](config[_0x5846('0x9')],{'host':_0x5846('0xb'),'port':0x18eb});var socket=require(_0x5846('0xc'))(new Redis(config[_0x5846('0x9')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x19bcf9,_0x3d8f11,_0x3a8881){return new BPromise(function(_0x45cf93,_0x346ec5){return client['request'](_0x19bcf9,_0x3a8881)['then'](function(_0x4207d4){logger[_0x5846('0xd')]('VoiceQueue,\x20%s,\x20%s',_0x3d8f11,_0x5846('0xe'));logger[_0x5846('0xf')](_0x5846('0x10'),_0x3d8f11,_0x5846('0xe'),JSON[_0x5846('0x11')](_0x4207d4));if(_0x4207d4[_0x5846('0x12')]){if(_0x4207d4[_0x5846('0x12')]['code']===0x1f4){logger[_0x5846('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x3d8f11,_0x4207d4[_0x5846('0x12')][_0x5846('0x13')]);return _0x346ec5(_0x4207d4[_0x5846('0x12')][_0x5846('0x13')]);}logger[_0x5846('0x12')](_0x5846('0x14'),_0x3d8f11,_0x4207d4['error'][_0x5846('0x13')]);return _0x45cf93(_0x4207d4[_0x5846('0x12')][_0x5846('0x13')]);}else{logger[_0x5846('0xd')](_0x5846('0x14'),_0x3d8f11,'request\x20sent');_0x45cf93(_0x4207d4[_0x5846('0x15')]['message']);}})[_0x5846('0x16')](function(_0x3bcd17){logger[_0x5846('0x12')](_0x5846('0x14'),_0x3d8f11,_0x3bcd17);_0x346ec5(_0x3bcd17);});});}exports[_0x5846('0x17')]=function(_0xd006f6){var _0x384322=this;return new Promise(function(_0x1a28e8,_0x4aa625){return db[_0x5846('0x18')]['findAll']({'raw':_0xd006f6['options']?_0xd006f6['options'][_0x5846('0x19')]===undefined?!![]:![]:!![],'where':_0xd006f6[_0x5846('0x1a')]?_0xd006f6[_0x5846('0x1a')][_0x5846('0x1b')]||null:null,'attributes':_0xd006f6[_0x5846('0x1a')]?_0xd006f6[_0x5846('0x1a')]['attributes']||null:null,'limit':_0xd006f6[_0x5846('0x1a')]?_0xd006f6[_0x5846('0x1a')]['limit']||null:null,'include':_0xd006f6['options']?_0xd006f6[_0x5846('0x1a')][_0x5846('0x1c')]?_[_0x5846('0x1d')](_0xd006f6[_0x5846('0x1a')][_0x5846('0x1c')],function(_0x57c20f){return{'model':db[_0x57c20f[_0x5846('0x1e')]],'as':_0x57c20f['as'],'attributes':_0x57c20f[_0x5846('0x1f')],'include':_0x57c20f[_0x5846('0x1c')]?_['map'](_0x57c20f['include'],function(_0x5735bb){return{'model':db[_0x5735bb[_0x5846('0x1e')]],'as':_0x5735bb['as'],'attributes':_0x5735bb[_0x5846('0x1f')],'include':_0x5735bb['include']?_['map'](_0x5735bb[_0x5846('0x1c')],function(_0x4593a3){return{'model':db[_0x4593a3['model']],'as':_0x4593a3['as'],'attributes':_0x4593a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x5846('0x20')](function(_0x129008){logger[_0x5846('0xd')](_0x5846('0x17'),_0xd006f6);logger[_0x5846('0xf')](_0x5846('0x17'),_0xd006f6,JSON[_0x5846('0x11')](_0x129008));_0x1a28e8(_0x129008);})[_0x5846('0x16')](function(_0x3aa5be){logger[_0x5846('0x12')](_0x5846('0x17'),_0x3aa5be[_0x5846('0x13')],_0xd006f6);_0x4aa625(_0x384322[_0x5846('0x12')](0x1f4,_0x3aa5be['message']));});});};exports[_0x5846('0x21')]=function(_0x1059d1){var _0x2814b5=this;return new Promise(function(_0x133d05,_0x407f32){return db[_0x5846('0x18')][_0x5846('0x22')]({'raw':_0x1059d1[_0x5846('0x1a')]?_0x1059d1['options'][_0x5846('0x19')]===undefined?!![]:![]:!![],'where':_0x1059d1[_0x5846('0x1a')]?_0x1059d1['options']['where']||null:null,'attributes':_0x1059d1[_0x5846('0x1a')]?_0x1059d1[_0x5846('0x1a')]['attributes']||null:null,'include':_0x1059d1[_0x5846('0x1a')]?_0x1059d1['options']['include']?_[_0x5846('0x1d')](_0x1059d1[_0x5846('0x1a')]['include'],function(_0x29e9cd){return{'model':db[_0x29e9cd[_0x5846('0x1e')]],'as':_0x29e9cd['as'],'attributes':_0x29e9cd['attributes'],'include':_0x29e9cd[_0x5846('0x1c')]?_[_0x5846('0x1d')](_0x29e9cd[_0x5846('0x1c')],function(_0x2a9be8){return{'model':db[_0x2a9be8[_0x5846('0x1e')]],'as':_0x2a9be8['as'],'attributes':_0x2a9be8['attributes'],'include':_0x2a9be8['include']?_['map'](_0x2a9be8['include'],function(_0x296e42){return{'model':db[_0x296e42[_0x5846('0x1e')]],'as':_0x296e42['as'],'attributes':_0x296e42['attributes']};}):[]};}):[]};}):[]:[]})[_0x5846('0x20')](function(_0x3ee0bc){logger[_0x5846('0xd')]('ShowVoiceQueue',_0x1059d1);logger[_0x5846('0xf')](_0x5846('0x21'),_0x1059d1,JSON[_0x5846('0x11')](_0x3ee0bc));_0x133d05(_0x3ee0bc);})[_0x5846('0x16')](function(_0x13d98d){logger[_0x5846('0x12')]('ShowVoiceQueue',_0x13d98d[_0x5846('0x13')],_0x1059d1);_0x407f32(_0x2814b5[_0x5846('0x12')](0x1f4,_0x13d98d[_0x5846('0x13')]));});});}; \ No newline at end of file +var _0x5158=['find','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','redis','./voiceQueue.socket','register','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','model','attributes','map','then','info','stringify'];(function(_0x1e8e02,_0x4e9df0){var _0x3aa4c5=function(_0x2e65b0){while(--_0x2e65b0){_0x1e8e02['push'](_0x1e8e02['shift']());}};_0x3aa4c5(++_0x4e9df0);}(_0x5158,0x1d0));var _0x8515=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x5158[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require('lodash');var util=require(_0x8515('0x0'));var moment=require(_0x8515('0x1'));var BPromise=require(_0x8515('0x2'));var rs=require(_0x8515('0x3'));var fs=require('fs');var Redis=require(_0x8515('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8515('0x5'));var logger=require(_0x8515('0x6'))(_0x8515('0x7'));var config=require(_0x8515('0x8'));var jayson=require(_0x8515('0x9'));var client=jayson[_0x8515('0xa')][_0x8515('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8515('0xc'))(new Redis(config[_0x8515('0xd')]));require(_0x8515('0xe'))[_0x8515('0xf')](socket);function respondWithRpcPromise(_0x28082a,_0x2d534d,_0x48a5a5){return new BPromise(function(_0x503905,_0x4a2e67){return client[_0x8515('0x10')](_0x28082a,_0x48a5a5)['then'](function(_0x3b0114){logger['info'](_0x8515('0x11'),_0x2d534d,_0x8515('0x12'));logger[_0x8515('0x13')](_0x8515('0x14'),_0x2d534d,_0x8515('0x12'),JSON['stringify'](_0x3b0114));if(_0x3b0114[_0x8515('0x15')]){if(_0x3b0114[_0x8515('0x15')][_0x8515('0x16')]===0x1f4){logger[_0x8515('0x15')](_0x8515('0x11'),_0x2d534d,_0x3b0114['error'][_0x8515('0x17')]);return _0x4a2e67(_0x3b0114[_0x8515('0x15')][_0x8515('0x17')]);}logger[_0x8515('0x15')](_0x8515('0x11'),_0x2d534d,_0x3b0114[_0x8515('0x15')][_0x8515('0x17')]);return _0x503905(_0x3b0114['error'][_0x8515('0x17')]);}else{logger['info'](_0x8515('0x11'),_0x2d534d,_0x8515('0x12'));_0x503905(_0x3b0114[_0x8515('0x18')]['message']);}})[_0x8515('0x19')](function(_0x4bb57b){logger['error'](_0x8515('0x11'),_0x2d534d,_0x4bb57b);_0x4a2e67(_0x4bb57b);});});}exports[_0x8515('0x1a')]=function(_0x1aa165){var _0x370453=this;return new Promise(function(_0x261667,_0x269736){return db[_0x8515('0x1b')][_0x8515('0x1c')]({'raw':_0x1aa165['options']?_0x1aa165[_0x8515('0x1d')][_0x8515('0x1e')]===undefined?!![]:![]:!![],'where':_0x1aa165[_0x8515('0x1d')]?_0x1aa165[_0x8515('0x1d')][_0x8515('0x1f')]||null:null,'attributes':_0x1aa165['options']?_0x1aa165[_0x8515('0x1d')]['attributes']||null:null,'limit':_0x1aa165[_0x8515('0x1d')]?_0x1aa165[_0x8515('0x1d')][_0x8515('0x20')]||null:null,'include':_0x1aa165[_0x8515('0x1d')]?_0x1aa165[_0x8515('0x1d')][_0x8515('0x21')]?_['map'](_0x1aa165[_0x8515('0x1d')]['include'],function(_0x2b159f){return{'model':db[_0x2b159f[_0x8515('0x22')]],'as':_0x2b159f['as'],'attributes':_0x2b159f[_0x8515('0x23')],'include':_0x2b159f[_0x8515('0x21')]?_[_0x8515('0x24')](_0x2b159f['include'],function(_0x5ccdb4){return{'model':db[_0x5ccdb4['model']],'as':_0x5ccdb4['as'],'attributes':_0x5ccdb4[_0x8515('0x23')],'include':_0x5ccdb4[_0x8515('0x21')]?_[_0x8515('0x24')](_0x5ccdb4['include'],function(_0x16ff47){return{'model':db[_0x16ff47['model']],'as':_0x16ff47['as'],'attributes':_0x16ff47[_0x8515('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8515('0x25')](function(_0x54ef0b){logger[_0x8515('0x26')](_0x8515('0x1a'),_0x1aa165);logger[_0x8515('0x13')]('GetVoiceQueue',_0x1aa165,JSON[_0x8515('0x27')](_0x54ef0b));_0x261667(_0x54ef0b);})['catch'](function(_0xa7183b){logger[_0x8515('0x15')](_0x8515('0x1a'),_0xa7183b[_0x8515('0x17')],_0x1aa165);_0x269736(_0x370453[_0x8515('0x15')](0x1f4,_0xa7183b[_0x8515('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x33e4f3){var _0x2b4e43=this;return new Promise(function(_0x308326,_0x4d1211){return db[_0x8515('0x1b')][_0x8515('0x28')]({'raw':_0x33e4f3[_0x8515('0x1d')]?_0x33e4f3[_0x8515('0x1d')][_0x8515('0x1e')]===undefined?!![]:![]:!![],'where':_0x33e4f3[_0x8515('0x1d')]?_0x33e4f3[_0x8515('0x1d')][_0x8515('0x1f')]||null:null,'attributes':_0x33e4f3[_0x8515('0x1d')]?_0x33e4f3[_0x8515('0x1d')]['attributes']||null:null,'include':_0x33e4f3[_0x8515('0x1d')]?_0x33e4f3[_0x8515('0x1d')][_0x8515('0x21')]?_[_0x8515('0x24')](_0x33e4f3['options'][_0x8515('0x21')],function(_0x1f63cf){return{'model':db[_0x1f63cf[_0x8515('0x22')]],'as':_0x1f63cf['as'],'attributes':_0x1f63cf[_0x8515('0x23')],'include':_0x1f63cf[_0x8515('0x21')]?_[_0x8515('0x24')](_0x1f63cf['include'],function(_0x132ac2){return{'model':db[_0x132ac2[_0x8515('0x22')]],'as':_0x132ac2['as'],'attributes':_0x132ac2[_0x8515('0x23')],'include':_0x132ac2[_0x8515('0x21')]?_[_0x8515('0x24')](_0x132ac2['include'],function(_0x575c98){return{'model':db[_0x575c98[_0x8515('0x22')]],'as':_0x575c98['as'],'attributes':_0x575c98['attributes']};}):[]};}):[]};}):[]:[]})[_0x8515('0x25')](function(_0x3d5add){logger[_0x8515('0x26')](_0x8515('0x29'),_0x33e4f3);logger[_0x8515('0x13')](_0x8515('0x29'),_0x33e4f3,JSON[_0x8515('0x27')](_0x3d5add));_0x308326(_0x3d5add);})[_0x8515('0x19')](function(_0x3fa3b2){logger['error'](_0x8515('0x29'),_0x3fa3b2[_0x8515('0x17')],_0x33e4f3);_0x4d1211(_0x2b4e43[_0x8515('0x15')](0x1f4,_0x3fa3b2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7d8f3b9..80ca3e0 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 _0xd8b9=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','save'];(function(_0x182454,_0x4c25dd){var _0x262191=function(_0x492c19){while(--_0x492c19){_0x182454['push'](_0x182454['shift']());}};_0x262191(++_0x4c25dd);}(_0xd8b9,0x10c));var _0x9d8b=function(_0x5c2806,_0x5787ef){_0x5c2806=_0x5c2806-0x0;var _0x28d364=_0xd8b9[_0x5c2806];return _0x28d364;};'use strict';var VoiceQueueEvents=require(_0x9d8b('0x0'));var events=[_0x9d8b('0x1'),'remove','update'];function createListener(_0x349091,_0xdecae9){return function(_0x13f214){_0xdecae9[_0x9d8b('0x2')](_0x349091,_0x13f214);};}function removeListener(_0xfc7002,_0xd5f54b){return function(){VoiceQueueEvents[_0x9d8b('0x3')](_0xfc7002,_0xd5f54b);};}exports[_0x9d8b('0x4')]=function(_0x5154c1){for(var _0x43178c=0x0,_0x272fb2=events['length'];_0x43178c<_0x272fb2;_0x43178c++){var _0x163d38=events[_0x43178c];var _0x1d1db1=createListener(_0x9d8b('0x5')+_0x163d38,_0x5154c1);VoiceQueueEvents['on'](_0x163d38,_0x1d1db1);}}; \ No newline at end of file +var _0xa003=['update','removeListener','register','length','voiceQueue:','save','remove'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0xa003,0x16a));var _0x3a00=function(_0x2157a1,_0x5d0a75){_0x2157a1=_0x2157a1-0x0;var _0x340571=_0xa003[_0x2157a1];return _0x340571;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x3a00('0x0'),_0x3a00('0x1'),_0x3a00('0x2')];function createListener(_0x5e72bb,_0x4f8a28){return function(_0x5b54d9){_0x4f8a28['emit'](_0x5e72bb,_0x5b54d9);};}function removeListener(_0x8e3398,_0x598084){return function(){VoiceQueueEvents[_0x3a00('0x3')](_0x8e3398,_0x598084);};}exports[_0x3a00('0x4')]=function(_0x17f8cd){for(var _0x35a360=0x0,_0x1594a8=events[_0x3a00('0x5')];_0x35a360<_0x1594a8;_0x35a360++){var _0x385219=events[_0x35a360];var _0x432864=createListener(_0x3a00('0x6')+_0x385219,_0x17f8cd);VoiceQueueEvents['on'](_0x385219,_0x432864);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b173ec0..7a81c1e 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 _0x299a=['../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','/:id','post','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x299a,0xdc));var _0xa299=function(_0x15785,_0x1f2f64){_0x15785=_0x15785-0x0;var _0x4a4454=_0x299a[_0x15785];return _0x4a4454;};'use strict';var multer=require(_0xa299('0x0'));var util=require('util');var path=require(_0xa299('0x1'));var timeout=require(_0xa299('0x2'));var express=require(_0xa299('0x3'));var router=express[_0xa299('0x4')]();var fs_extra=require(_0xa299('0x5'));var auth=require(_0xa299('0x6'));var interaction=require(_0xa299('0x7'));var config=require(_0xa299('0x8'));var controller=require(_0xa299('0x9'));router[_0xa299('0xa')]('/',auth[_0xa299('0xb')](),controller['index']);router[_0xa299('0xa')](_0xa299('0xc'),auth['isAuthenticated'](),controller[_0xa299('0xd')]);router[_0xa299('0xa')](_0xa299('0xe'),auth[_0xa299('0xb')](),controller['getVoiceQueuesReport']);router['get'](_0xa299('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xa299('0x10')]('/',auth[_0xa299('0xb')](),controller['create']);router[_0xa299('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa299('0x12')]);router['delete'](_0xa299('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1770=['show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/index','getVoiceQueuesReport','/:id'];(function(_0x1b7a5f,_0x1b2cfa){var _0x599ab8=function(_0x425285){while(--_0x425285){_0x1b7a5f['push'](_0x1b7a5f['shift']());}};_0x599ab8(++_0x1b2cfa);}(_0x1770,0x18d));var _0x0177=function(_0x3c0d54,_0x2af799){_0x3c0d54=_0x3c0d54-0x0;var _0x4d173a=_0x1770[_0x3c0d54];return _0x4d173a;};'use strict';var multer=require(_0x0177('0x0'));var util=require(_0x0177('0x1'));var path=require(_0x0177('0x2'));var timeout=require(_0x0177('0x3'));var express=require(_0x0177('0x4'));var router=express[_0x0177('0x5')]();var fs_extra=require(_0x0177('0x6'));var auth=require(_0x0177('0x7'));var interaction=require(_0x0177('0x8'));var config=require(_0x0177('0x9'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x0177('0xa')](),controller['index']);router['get'](_0x0177('0xb'),auth[_0x0177('0xa')](),controller[_0x0177('0xc')]);router[_0x0177('0xd')](_0x0177('0xe'),auth[_0x0177('0xa')](),controller[_0x0177('0xf')]);router[_0x0177('0xd')](_0x0177('0x10'),auth['isAuthenticated'](),controller[_0x0177('0x11')]);router[_0x0177('0x12')]('/',auth[_0x0177('0xa')](),controller['create']);router[_0x0177('0x13')](_0x0177('0x10'),auth[_0x0177('0xa')](),controller['update']);router[_0x0177('0x14')]('/:id',auth[_0x0177('0xa')](),controller[_0x0177('0x15')]);module[_0x0177('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index b0c8d93..dc82a1d 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 _0xfd29=['format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x12f10f,_0x23a007){var _0x43f199=function(_0x3163c2){while(--_0x3163c2){_0x12f10f['push'](_0x12f10f['shift']());}};_0x43f199(++_0x23a007);}(_0xfd29,0x89));var _0x9fd2=function(_0x1669bd,_0x5532a4){_0x1669bd=_0x1669bd-0x0;var _0x10199f=_0xfd29[_0x1669bd];return _0x10199f;};'use strict';var Sequelize=require(_0x9fd2('0x0'));var moment=require(_0x9fd2('0x1'));module[_0x9fd2('0x2')]={'type':{'type':Sequelize[_0x9fd2('0x3')]},'uniqueid':{'type':Sequelize[_0x9fd2('0x3')]},'calleridnum':{'type':Sequelize[_0x9fd2('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x9fd2('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9fd2('0x4')],'set':function(_0x5685b6){var _0x568e07=moment(_0x5685b6);var _0x25b730=moment(this[_0x9fd2('0x5')](_0x9fd2('0x6')))[_0x9fd2('0x7')](_0x9fd2('0x8'));var _0x4bda3f=_0x568e07[_0x9fd2('0x9')](_0x25b730,'seconds');this[_0x9fd2('0xa')](_0x9fd2('0xb'),_0x5685b6);this[_0x9fd2('0xa')](_0x9fd2('0xc'),_0x4bda3f||null);}},'position':{'type':Sequelize[_0x9fd2('0xd')]},'count':{'type':Sequelize[_0x9fd2('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x9fd2('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9fd2('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9fd2('0x4')]},'queuecallerexit':{'type':Sequelize[_0x9fd2('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x9fd2('0x3')],'comment':_0x9fd2('0xf')},'originalposition':{'type':Sequelize[_0x9fd2('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9fd2('0x3')]},'exten':{'type':Sequelize[_0x9fd2('0x3')]},'priority':{'type':Sequelize[_0x9fd2('0x3')]},'holdtime':{'type':Sequelize[_0x9fd2('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9fd2('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9fd2('0x3')]},'transfer':{'type':Sequelize[_0x9fd2('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9fd2('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x9fd2('0x3')]},'transferuniqueid':{'type':Sequelize[_0x9fd2('0x3')]},'disposition':{'type':Sequelize[_0x9fd2('0x3')]},'secondDisposition':{'type':Sequelize[_0x9fd2('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x9fd2('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a14=['diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','exports','STRING','DATE','queuecallerjoinAt','format'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x6a14,0xe4));var _0x46a1=function(_0x505fe7,_0x5ed819){_0x505fe7=_0x505fe7-0x0;var _0x4ae500=_0x6a14[_0x505fe7];return _0x4ae500;};'use strict';var Sequelize=require(_0x46a1('0x0'));var moment=require('moment');module[_0x46a1('0x1')]={'type':{'type':Sequelize[_0x46a1('0x2')]},'uniqueid':{'type':Sequelize[_0x46a1('0x2')]},'calleridnum':{'type':Sequelize[_0x46a1('0x2')]},'calleridname':{'type':Sequelize[_0x46a1('0x2')]},'queue':{'type':Sequelize[_0x46a1('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x46a1('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x46a1('0x3')],'set':function(_0xf5202){var _0x4992ae=moment(_0xf5202);var _0x175d2c=moment(this['getDataValue'](_0x46a1('0x4')))[_0x46a1('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x45d68d=_0x4992ae[_0x46a1('0x6')](_0x175d2c,_0x46a1('0x7'));this[_0x46a1('0x8')](_0x46a1('0x9'),_0xf5202);this[_0x46a1('0x8')]('holdtime',_0x45d68d||null);}},'position':{'type':Sequelize[_0x46a1('0xa')]},'count':{'type':Sequelize[_0x46a1('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x46a1('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x46a1('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x46a1('0x3')]},'queuecallerexit':{'type':Sequelize[_0x46a1('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x46a1('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x46a1('0x2')],'comment':_0x46a1('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x46a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x46a1('0x2')]},'accountcode':{'type':Sequelize[_0x46a1('0x2')]},'context':{'type':Sequelize[_0x46a1('0x2')]},'exten':{'type':Sequelize[_0x46a1('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x46a1('0xa')]},'mohtime':{'type':Sequelize[_0x46a1('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x46a1('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x46a1('0x2')]},'transfer':{'type':Sequelize[_0x46a1('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x46a1('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x46a1('0x2')]},'transferuniqueid':{'type':Sequelize[_0x46a1('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x46a1('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x46a1('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 7b1b017..c3c53c0 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 _0x22e6=['where','pick','filter','merge','VIRTUAL','VoiceQueueReport','count','includeAll','include','rows','catch','show','params','find','create','body','destroy','getVoiceQueuesReport','options','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x22e6,0x116));var _0x622e=function(_0x51d9cb,_0x2b225d){_0x51d9cb=_0x51d9cb-0x0;var _0xccbfc3=_0x22e6[_0x51d9cb];return _0xccbfc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x622e('0x0'));var zipdir=require(_0x622e('0x1'));var jsonpatch=require(_0x622e('0x2'));var rp=require(_0x622e('0x3'));var moment=require(_0x622e('0x4'));var BPromise=require(_0x622e('0x5'));var Mustache=require(_0x622e('0x6'));var util=require(_0x622e('0x7'));var path=require(_0x622e('0x8'));var sox=require(_0x622e('0x9'));var csv=require(_0x622e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x622e('0xb'));var _=require(_0x622e('0xc'));var squel=require(_0x622e('0xd'));var crypto=require(_0x622e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x622e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x622e('0x10'));var Papa=require(_0x622e('0x11'));var Redis=require(_0x622e('0x12'));var authService=require(_0x622e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x622e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x622e('0x15'))(_0x622e('0x16'));var utils=require(_0x622e('0x17'));var config=require(_0x622e('0x18'));var licenseUtil=require(_0x622e('0x19'));var db=require('../../mysqldb')['db'];config[_0x622e('0x1a')]=_[_0x622e('0x1b')](config[_0x622e('0x1a')],{'host':_0x622e('0x1c'),'port':0x18eb});var socket=require(_0x622e('0x1d'))(new Redis(config[_0x622e('0x1a')]));require(_0x622e('0x1e'))['register'](socket);function respondWithStatusCode(_0x148317,_0x2b5cd9){_0x2b5cd9=_0x2b5cd9||0xcc;return function(_0x7b6765){if(_0x7b6765){return _0x148317[_0x622e('0x1f')](_0x2b5cd9);}return _0x148317[_0x622e('0x20')](_0x2b5cd9)['end']();};}function respondWithResult(_0x2a1c32,_0x1f4bbc){_0x1f4bbc=_0x1f4bbc||0xc8;return function(_0x8c6b59){if(_0x8c6b59){return _0x2a1c32[_0x622e('0x20')](_0x1f4bbc)[_0x622e('0x21')](_0x8c6b59);}};}function respondWithFilteredResult(_0x145f3b,_0x36a6fa){return function(_0x46d673){if(_0x46d673){var _0xe63d3=typeof _0x36a6fa[_0x622e('0x22')]===_0x622e('0x23')&&typeof _0x36a6fa[_0x622e('0x24')]===_0x622e('0x23');var _0x424b59=_0x46d673['count'];var _0x5bf4b0=_0xe63d3?0x0:_0x36a6fa[_0x622e('0x22')];var _0x380878=_0xe63d3?_0x46d673['count']:_0x36a6fa[_0x622e('0x22')]+_0x36a6fa[_0x622e('0x24')];var _0x1717de;if(_0x380878>=_0x424b59){_0x380878=_0x424b59;_0x1717de=0xc8;}else{_0x1717de=0xce;}_0x145f3b[_0x622e('0x20')](_0x1717de);return _0x145f3b[_0x622e('0x25')](_0x622e('0x26'),_0x5bf4b0+'-'+_0x380878+'/'+_0x424b59)['json'](_0x46d673);}return null;};}function patchUpdates(_0x8d5e7e){return function(_0xade931){try{jsonpatch[_0x622e('0x27')](_0xade931,_0x8d5e7e,!![]);}catch(_0x2076d7){return BPromise[_0x622e('0x28')](_0x2076d7);}return _0xade931[_0x622e('0x29')]();};}function saveUpdates(_0x2ce708,_0x20ab17){return function(_0x2e0fb6){if(_0x2e0fb6){return _0x2e0fb6[_0x622e('0x2a')](_0x2ce708)['then'](function(_0x5a84c1){return _0x5a84c1;});}return null;};}function removeEntity(_0x51a663,_0x58e2e9){return function(_0x10b368){if(_0x10b368){return _0x10b368['destroy']()[_0x622e('0x2b')](function(){_0x51a663['status'](0xcc)[_0x622e('0x2c')]();});}};}function handleEntityNotFound(_0x569f5b,_0x8dfb93){return function(_0x5dae31){if(!_0x5dae31){_0x569f5b[_0x622e('0x1f')](0x194);}return _0x5dae31;};}function handleError(_0x38983f,_0x5c571f){_0x5c571f=_0x5c571f||0x1f4;return function(_0x66d06c){logger[_0x622e('0x2d')](_0x66d06c[_0x622e('0x2e')]);if(_0x66d06c['name']){delete _0x66d06c[_0x622e('0x2f')];}_0x38983f['status'](_0x5c571f)[_0x622e('0x30')](_0x66d06c);};}exports[_0x622e('0x31')]=function(_0x3d9bdd,_0x124aa9){var _0x5487f0={},_0x206203={},_0x26141c={'count':0x0,'rows':[]};var _0x691e9=_[_0x622e('0x32')](db['VoiceQueueReport'][_0x622e('0x33')],function(_0x5f57af){return{'name':_0x5f57af['fieldName'],'type':_0x5f57af[_0x622e('0x34')][_0x622e('0x35')]};});_0x206203[_0x622e('0x36')]=_[_0x622e('0x32')](_0x691e9,_0x622e('0x2f'));_0x206203[_0x622e('0x37')]=_[_0x622e('0x38')](_0x3d9bdd[_0x622e('0x37')]);_0x206203[_0x622e('0x39')]=_[_0x622e('0x3a')](_0x206203[_0x622e('0x36')],_0x206203[_0x622e('0x37')]);_0x5487f0[_0x622e('0x3b')]=_[_0x622e('0x3a')](_0x206203[_0x622e('0x36')],qs[_0x622e('0x3c')](_0x3d9bdd[_0x622e('0x37')][_0x622e('0x3c')]));_0x5487f0[_0x622e('0x3b')]=_0x5487f0[_0x622e('0x3b')][_0x622e('0x3d')]?_0x5487f0[_0x622e('0x3b')]:_0x206203[_0x622e('0x36')];if(!_0x3d9bdd['query'][_0x622e('0x3e')](_0x622e('0x3f'))){_0x5487f0[_0x622e('0x24')]=qs['limit'](_0x3d9bdd[_0x622e('0x37')][_0x622e('0x24')]);_0x5487f0[_0x622e('0x22')]=qs[_0x622e('0x22')](_0x3d9bdd['query'][_0x622e('0x22')]);}_0x5487f0[_0x622e('0x40')]=qs[_0x622e('0x41')](_0x3d9bdd[_0x622e('0x37')][_0x622e('0x41')]);_0x5487f0[_0x622e('0x42')]=qs[_0x622e('0x39')](_[_0x622e('0x43')](_0x3d9bdd[_0x622e('0x37')],_0x206203[_0x622e('0x39')]),_0x691e9);if(_0x3d9bdd[_0x622e('0x37')][_0x622e('0x44')]){_0x5487f0['where']=_[_0x622e('0x45')](_0x5487f0[_0x622e('0x42')],{'$or':_[_0x622e('0x32')](_0x691e9,function(_0x17f57c){if(_0x17f57c['type']!==_0x622e('0x46')){var _0x251ec6={};_0x251ec6[_0x17f57c[_0x622e('0x2f')]]={'$like':'%'+_0x3d9bdd[_0x622e('0x37')][_0x622e('0x44')]+'%'};return _0x251ec6;}})});}_0x5487f0=_[_0x622e('0x45')]({},_0x5487f0,_0x3d9bdd['options']);var _0x3891de={'where':_0x5487f0[_0x622e('0x42')]};return db[_0x622e('0x47')]['count'](_0x3891de)[_0x622e('0x2b')](function(_0x374de6){_0x26141c[_0x622e('0x48')]=_0x374de6;if(_0x3d9bdd['query'][_0x622e('0x49')]){_0x5487f0[_0x622e('0x4a')]=[{'all':!![]}];}return db[_0x622e('0x47')]['findAll'](_0x5487f0);})['then'](function(_0x22d325){_0x26141c[_0x622e('0x4b')]=_0x22d325;return _0x26141c;})['then'](respondWithFilteredResult(_0x124aa9,_0x5487f0))[_0x622e('0x4c')](handleError(_0x124aa9,null));};exports[_0x622e('0x4d')]=function(_0x2a00ce,_0x4d3e30){var _0x1d51af={'raw':![],'where':{'id':_0x2a00ce[_0x622e('0x4e')]['id']}},_0x9d377={};_0x9d377[_0x622e('0x36')]=_['keys'](db[_0x622e('0x47')][_0x622e('0x33')]);_0x9d377[_0x622e('0x37')]=_[_0x622e('0x38')](_0x2a00ce[_0x622e('0x37')]);_0x9d377[_0x622e('0x39')]=_[_0x622e('0x3a')](_0x9d377[_0x622e('0x36')],_0x9d377[_0x622e('0x37')]);_0x1d51af[_0x622e('0x3b')]=_[_0x622e('0x3a')](_0x9d377['model'],qs[_0x622e('0x3c')](_0x2a00ce[_0x622e('0x37')][_0x622e('0x3c')]));_0x1d51af['attributes']=_0x1d51af[_0x622e('0x3b')][_0x622e('0x3d')]?_0x1d51af[_0x622e('0x3b')]:_0x9d377[_0x622e('0x36')];if(_0x2a00ce[_0x622e('0x37')][_0x622e('0x49')]){_0x1d51af[_0x622e('0x4a')]=[{'all':!![]}];}_0x1d51af=_['merge']({},_0x1d51af,_0x2a00ce['options']);return db['VoiceQueueReport'][_0x622e('0x4f')](_0x1d51af)[_0x622e('0x2b')](handleEntityNotFound(_0x4d3e30,null))[_0x622e('0x2b')](respondWithResult(_0x4d3e30,null))[_0x622e('0x4c')](handleError(_0x4d3e30,null));};exports[_0x622e('0x50')]=function(_0x4d926a,_0x36b876){return db['VoiceQueueReport'][_0x622e('0x50')](_0x4d926a['body'],{})[_0x622e('0x2b')](respondWithResult(_0x36b876,0xc9))['catch'](handleError(_0x36b876,null));};exports[_0x622e('0x2a')]=function(_0x1bd706,_0x46485f){if(_0x1bd706[_0x622e('0x51')]['id']){delete _0x1bd706[_0x622e('0x51')]['id'];}return db[_0x622e('0x47')][_0x622e('0x4f')]({'where':{'id':_0x1bd706[_0x622e('0x4e')]['id']}})[_0x622e('0x2b')](handleEntityNotFound(_0x46485f,null))[_0x622e('0x2b')](saveUpdates(_0x1bd706[_0x622e('0x51')],null))[_0x622e('0x2b')](respondWithResult(_0x46485f,null))[_0x622e('0x4c')](handleError(_0x46485f,null));};exports[_0x622e('0x52')]=function(_0x2a723b,_0x414639){return db[_0x622e('0x47')][_0x622e('0x4f')]({'where':{'id':_0x2a723b[_0x622e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x414639,null))[_0x622e('0x2b')](removeEntity(_0x414639,null))[_0x622e('0x4c')](handleError(_0x414639,null));};exports['describe']=function(_0x152fc8,_0x50f704){return db[_0x622e('0x47')]['describe']()[_0x622e('0x2b')](respondWithResult(_0x50f704,null))[_0x622e('0x4c')](handleError(_0x50f704,null));};exports[_0x622e('0x53')]=function(_0x202d3b,_0x5997e4){var _0x3ee847={},_0x2c4a06={},_0x142861={'count':0x0,'rows':[]};_0x2c4a06[_0x622e('0x36')]=_[_0x622e('0x38')](db[_0x622e('0x47')][_0x622e('0x33')]);_0x2c4a06['query']=_['keys'](_0x202d3b[_0x622e('0x37')]);_0x2c4a06[_0x622e('0x39')]=_[_0x622e('0x3a')](_0x2c4a06['model'],_0x2c4a06[_0x622e('0x37')]);_0x3ee847[_0x622e('0x3b')]=_['intersection'](_0x2c4a06[_0x622e('0x36')],qs[_0x622e('0x3c')](_0x202d3b[_0x622e('0x37')][_0x622e('0x3c')]));_0x3ee847[_0x622e('0x3b')]=_0x3ee847[_0x622e('0x3b')][_0x622e('0x3d')]?_0x3ee847['attributes']:_0x2c4a06[_0x622e('0x36')];if(!_0x202d3b[_0x622e('0x37')][_0x622e('0x3e')](_0x622e('0x3f'))){_0x3ee847[_0x622e('0x24')]=qs[_0x622e('0x24')](_0x202d3b['query'][_0x622e('0x24')]);_0x3ee847['offset']=qs[_0x622e('0x22')](_0x202d3b[_0x622e('0x37')]['offset']);}_0x3ee847[_0x622e('0x40')]=qs[_0x622e('0x41')](_0x202d3b['query'][_0x622e('0x41')]);_0x3ee847['where']=qs[_0x622e('0x39')](_['pick'](_0x202d3b[_0x622e('0x37')],_0x2c4a06[_0x622e('0x39')]));if(_0x202d3b[_0x622e('0x37')]['filter']){_0x3ee847[_0x622e('0x42')]=_['merge'](_0x3ee847[_0x622e('0x42')],{'$or':_[_0x622e('0x32')](_0x3ee847[_0x622e('0x3b')],function(_0x16d9cd){var _0x2c6b38={};_0x2c6b38[_0x16d9cd]={'$like':'%'+_0x202d3b[_0x622e('0x37')][_0x622e('0x44')]+'%'};return _0x2c6b38;})});}_0x3ee847=_[_0x622e('0x45')]({},_0x3ee847,_0x202d3b[_0x622e('0x54')]);var _0x2503cb={'where':_0x3ee847[_0x622e('0x42')]};return db[_0x622e('0x47')][_0x622e('0x48')](_0x2503cb)[_0x622e('0x2b')](function(_0x2cd83f){_0x142861[_0x622e('0x48')]=_0x2cd83f;if(_0x202d3b[_0x622e('0x37')][_0x622e('0x49')]){_0x3ee847['include']=[{'all':!![]}];}return db[_0x622e('0x47')][_0x622e('0x55')](_0x3ee847);})[_0x622e('0x2b')](function(_0x5d190f){_0x142861[_0x622e('0x4b')]=_0x5d190f;return _0x142861;})[_0x622e('0x2b')](respondWithFilteredResult(_0x5997e4,_0x3ee847,_0x622e('0x53')))['catch'](handleError(_0x5997e4,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xf7a0=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','status','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','catch','body','describe','getVoiceQueuesReport','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x5dee3b,_0x3d471c){var _0x32821c=function(_0x1e5878){while(--_0x1e5878){_0x5dee3b['push'](_0x5dee3b['shift']());}};_0x32821c(++_0x3d471c);}(_0xf7a0,0x145));var _0x0f7a=function(_0x51cd78,_0x5ebd9b){_0x51cd78=_0x51cd78-0x0;var _0x5c2b0a=_0xf7a0[_0x51cd78];return _0x5c2b0a;};'use strict';var emlformat=require(_0x0f7a('0x0'));var rimraf=require(_0x0f7a('0x1'));var zipdir=require(_0x0f7a('0x2'));var jsonpatch=require(_0x0f7a('0x3'));var rp=require(_0x0f7a('0x4'));var moment=require(_0x0f7a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0f7a('0x6'));var util=require(_0x0f7a('0x7'));var path=require(_0x0f7a('0x8'));var sox=require(_0x0f7a('0x9'));var csv=require(_0x0f7a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f7a('0xb'));var _=require(_0x0f7a('0xc'));var squel=require(_0x0f7a('0xd'));var crypto=require('crypto');var jsforce=require(_0x0f7a('0xe'));var deskjs=require(_0x0f7a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0f7a('0x10'));var Redis=require(_0x0f7a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0f7a('0x12'));var as=require(_0x0f7a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f7a('0x14'))('api');var utils=require(_0x0f7a('0x15'));var config=require(_0x0f7a('0x16'));var licenseUtil=require(_0x0f7a('0x17'));var db=require(_0x0f7a('0x18'))['db'];config[_0x0f7a('0x19')]=_[_0x0f7a('0x1a')](config[_0x0f7a('0x19')],{'host':_0x0f7a('0x1b'),'port':0x18eb});var socket=require(_0x0f7a('0x1c'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x0f7a('0x1d')](socket);function respondWithStatusCode(_0x304aa7,_0x59d5cb){_0x59d5cb=_0x59d5cb||0xcc;return function(_0x413a37){if(_0x413a37){return _0x304aa7[_0x0f7a('0x1e')](_0x59d5cb);}return _0x304aa7['status'](_0x59d5cb)['end']();};}function respondWithResult(_0x400606,_0x370758){_0x370758=_0x370758||0xc8;return function(_0x56ed34){if(_0x56ed34){return _0x400606['status'](_0x370758)[_0x0f7a('0x1f')](_0x56ed34);}};}function respondWithFilteredResult(_0x6cd8a1,_0x5f0315){return function(_0x1df6a1){if(_0x1df6a1){var _0x4c6a9d=typeof _0x5f0315['offset']===_0x0f7a('0x20')&&typeof _0x5f0315['limit']==='undefined';var _0x1ba036=_0x1df6a1[_0x0f7a('0x21')];var _0x107787=_0x4c6a9d?0x0:_0x5f0315[_0x0f7a('0x22')];var _0x66b8d3=_0x4c6a9d?_0x1df6a1[_0x0f7a('0x21')]:_0x5f0315[_0x0f7a('0x22')]+_0x5f0315[_0x0f7a('0x23')];var _0x1bac7d;if(_0x66b8d3>=_0x1ba036){_0x66b8d3=_0x1ba036;_0x1bac7d=0xc8;}else{_0x1bac7d=0xce;}_0x6cd8a1['status'](_0x1bac7d);return _0x6cd8a1[_0x0f7a('0x24')](_0x0f7a('0x25'),_0x107787+'-'+_0x66b8d3+'/'+_0x1ba036)[_0x0f7a('0x1f')](_0x1df6a1);}return null;};}function patchUpdates(_0x198855){return function(_0x34604e){try{jsonpatch[_0x0f7a('0x26')](_0x34604e,_0x198855,!![]);}catch(_0x51ba37){return BPromise['reject'](_0x51ba37);}return _0x34604e[_0x0f7a('0x27')]();};}function saveUpdates(_0x2c71b0,_0x31cdc8){return function(_0x88ccdc){if(_0x88ccdc){return _0x88ccdc[_0x0f7a('0x28')](_0x2c71b0)['then'](function(_0x3990fa){return _0x3990fa;});}return null;};}function removeEntity(_0x22b16c,_0x49041e){return function(_0x5dc438){if(_0x5dc438){return _0x5dc438[_0x0f7a('0x29')]()[_0x0f7a('0x2a')](function(){_0x22b16c['status'](0xcc)[_0x0f7a('0x2b')]();});}};}function handleEntityNotFound(_0x3e8ac2,_0x6d71ed){return function(_0x2c737c){if(!_0x2c737c){_0x3e8ac2[_0x0f7a('0x1e')](0x194);}return _0x2c737c;};}function handleError(_0x4d8eac,_0x45a315){_0x45a315=_0x45a315||0x1f4;return function(_0x6b5635){logger[_0x0f7a('0x2c')](_0x6b5635[_0x0f7a('0x2d')]);if(_0x6b5635[_0x0f7a('0x2e')]){delete _0x6b5635[_0x0f7a('0x2e')];}_0x4d8eac[_0x0f7a('0x2f')](_0x45a315)['send'](_0x6b5635);};}exports[_0x0f7a('0x30')]=function(_0x245d6d,_0x4cc405){var _0xa25652={},_0x57c3be={},_0x39f345={'count':0x0,'rows':[]};var _0x3bb5e9=_[_0x0f7a('0x31')](db[_0x0f7a('0x32')][_0x0f7a('0x33')],function(_0x24c483){return{'name':_0x24c483[_0x0f7a('0x34')],'type':_0x24c483[_0x0f7a('0x35')][_0x0f7a('0x36')]};});_0x57c3be[_0x0f7a('0x37')]=_[_0x0f7a('0x31')](_0x3bb5e9,_0x0f7a('0x2e'));_0x57c3be[_0x0f7a('0x38')]=_[_0x0f7a('0x39')](_0x245d6d[_0x0f7a('0x38')]);_0x57c3be[_0x0f7a('0x3a')]=_[_0x0f7a('0x3b')](_0x57c3be[_0x0f7a('0x37')],_0x57c3be['query']);_0xa25652[_0x0f7a('0x3c')]=_[_0x0f7a('0x3b')](_0x57c3be[_0x0f7a('0x37')],qs[_0x0f7a('0x3d')](_0x245d6d[_0x0f7a('0x38')][_0x0f7a('0x3d')]));_0xa25652[_0x0f7a('0x3c')]=_0xa25652[_0x0f7a('0x3c')][_0x0f7a('0x3e')]?_0xa25652[_0x0f7a('0x3c')]:_0x57c3be[_0x0f7a('0x37')];if(!_0x245d6d['query'][_0x0f7a('0x3f')](_0x0f7a('0x40'))){_0xa25652[_0x0f7a('0x23')]=qs[_0x0f7a('0x23')](_0x245d6d[_0x0f7a('0x38')][_0x0f7a('0x23')]);_0xa25652[_0x0f7a('0x22')]=qs[_0x0f7a('0x22')](_0x245d6d[_0x0f7a('0x38')][_0x0f7a('0x22')]);}_0xa25652[_0x0f7a('0x41')]=qs[_0x0f7a('0x42')](_0x245d6d['query'][_0x0f7a('0x42')]);_0xa25652['where']=qs['filters'](_[_0x0f7a('0x43')](_0x245d6d[_0x0f7a('0x38')],_0x57c3be[_0x0f7a('0x3a')]),_0x3bb5e9);if(_0x245d6d[_0x0f7a('0x38')][_0x0f7a('0x44')]){_0xa25652[_0x0f7a('0x45')]=_[_0x0f7a('0x46')](_0xa25652['where'],{'$or':_[_0x0f7a('0x31')](_0x3bb5e9,function(_0x2dbc1f){if(_0x2dbc1f[_0x0f7a('0x35')]!==_0x0f7a('0x47')){var _0x20a797={};_0x20a797[_0x2dbc1f['name']]={'$like':'%'+_0x245d6d['query']['filter']+'%'};return _0x20a797;}})});}_0xa25652=_[_0x0f7a('0x46')]({},_0xa25652,_0x245d6d[_0x0f7a('0x48')]);var _0x38b616={'where':_0xa25652[_0x0f7a('0x45')]};return db[_0x0f7a('0x32')][_0x0f7a('0x21')](_0x38b616)[_0x0f7a('0x2a')](function(_0x1f8c7b){_0x39f345[_0x0f7a('0x21')]=_0x1f8c7b;if(_0x245d6d[_0x0f7a('0x38')][_0x0f7a('0x49')]){_0xa25652[_0x0f7a('0x4a')]=[{'all':!![]}];}return db[_0x0f7a('0x32')]['findAll'](_0xa25652);})['then'](function(_0x3c9723){_0x39f345[_0x0f7a('0x4b')]=_0x3c9723;return _0x39f345;})['then'](respondWithFilteredResult(_0x4cc405,_0xa25652))['catch'](handleError(_0x4cc405,null));};exports[_0x0f7a('0x4c')]=function(_0x17ea49,_0x56a61c){var _0x430c3e={'raw':![],'where':{'id':_0x17ea49[_0x0f7a('0x4d')]['id']}},_0x139a7e={};_0x139a7e[_0x0f7a('0x37')]=_['keys'](db[_0x0f7a('0x32')][_0x0f7a('0x33')]);_0x139a7e['query']=_[_0x0f7a('0x39')](_0x17ea49[_0x0f7a('0x38')]);_0x139a7e[_0x0f7a('0x3a')]=_[_0x0f7a('0x3b')](_0x139a7e[_0x0f7a('0x37')],_0x139a7e[_0x0f7a('0x38')]);_0x430c3e['attributes']=_[_0x0f7a('0x3b')](_0x139a7e[_0x0f7a('0x37')],qs[_0x0f7a('0x3d')](_0x17ea49[_0x0f7a('0x38')]['fields']));_0x430c3e['attributes']=_0x430c3e[_0x0f7a('0x3c')][_0x0f7a('0x3e')]?_0x430c3e['attributes']:_0x139a7e['model'];if(_0x17ea49['query'][_0x0f7a('0x49')]){_0x430c3e[_0x0f7a('0x4a')]=[{'all':!![]}];}_0x430c3e=_[_0x0f7a('0x46')]({},_0x430c3e,_0x17ea49[_0x0f7a('0x48')]);return db['VoiceQueueReport'][_0x0f7a('0x4e')](_0x430c3e)[_0x0f7a('0x2a')](handleEntityNotFound(_0x56a61c,null))['then'](respondWithResult(_0x56a61c,null))['catch'](handleError(_0x56a61c,null));};exports[_0x0f7a('0x4f')]=function(_0x1f60c5,_0x337218){return db[_0x0f7a('0x32')][_0x0f7a('0x4f')](_0x1f60c5['body'],{})[_0x0f7a('0x2a')](respondWithResult(_0x337218,0xc9))[_0x0f7a('0x50')](handleError(_0x337218,null));};exports['update']=function(_0x24ff93,_0x30d2c4){if(_0x24ff93[_0x0f7a('0x51')]['id']){delete _0x24ff93['body']['id'];}return db['VoiceQueueReport'][_0x0f7a('0x4e')]({'where':{'id':_0x24ff93[_0x0f7a('0x4d')]['id']}})[_0x0f7a('0x2a')](handleEntityNotFound(_0x30d2c4,null))['then'](saveUpdates(_0x24ff93[_0x0f7a('0x51')],null))[_0x0f7a('0x2a')](respondWithResult(_0x30d2c4,null))[_0x0f7a('0x50')](handleError(_0x30d2c4,null));};exports[_0x0f7a('0x29')]=function(_0x7e4a09,_0xcb738d){return db['VoiceQueueReport']['find']({'where':{'id':_0x7e4a09[_0x0f7a('0x4d')]['id']}})[_0x0f7a('0x2a')](handleEntityNotFound(_0xcb738d,null))['then'](removeEntity(_0xcb738d,null))[_0x0f7a('0x50')](handleError(_0xcb738d,null));};exports[_0x0f7a('0x52')]=function(_0x1d65a1,_0x594fc5){return db[_0x0f7a('0x32')][_0x0f7a('0x52')]()[_0x0f7a('0x2a')](respondWithResult(_0x594fc5,null))[_0x0f7a('0x50')](handleError(_0x594fc5,null));};exports[_0x0f7a('0x53')]=function(_0x336ff9,_0xdc1c39){var _0x3327d2={},_0x1063f9={},_0x1ce4fb={'count':0x0,'rows':[]};_0x1063f9[_0x0f7a('0x37')]=_[_0x0f7a('0x39')](db[_0x0f7a('0x32')][_0x0f7a('0x33')]);_0x1063f9['query']=_[_0x0f7a('0x39')](_0x336ff9['query']);_0x1063f9['filters']=_[_0x0f7a('0x3b')](_0x1063f9['model'],_0x1063f9[_0x0f7a('0x38')]);_0x3327d2[_0x0f7a('0x3c')]=_[_0x0f7a('0x3b')](_0x1063f9[_0x0f7a('0x37')],qs[_0x0f7a('0x3d')](_0x336ff9[_0x0f7a('0x38')]['fields']));_0x3327d2[_0x0f7a('0x3c')]=_0x3327d2[_0x0f7a('0x3c')][_0x0f7a('0x3e')]?_0x3327d2[_0x0f7a('0x3c')]:_0x1063f9['model'];if(!_0x336ff9['query']['hasOwnProperty']('nolimit')){_0x3327d2[_0x0f7a('0x23')]=qs[_0x0f7a('0x23')](_0x336ff9[_0x0f7a('0x38')][_0x0f7a('0x23')]);_0x3327d2[_0x0f7a('0x22')]=qs['offset'](_0x336ff9['query'][_0x0f7a('0x22')]);}_0x3327d2[_0x0f7a('0x41')]=qs[_0x0f7a('0x42')](_0x336ff9[_0x0f7a('0x38')][_0x0f7a('0x42')]);_0x3327d2[_0x0f7a('0x45')]=qs['filters'](_[_0x0f7a('0x43')](_0x336ff9[_0x0f7a('0x38')],_0x1063f9['filters']));if(_0x336ff9[_0x0f7a('0x38')][_0x0f7a('0x44')]){_0x3327d2[_0x0f7a('0x45')]=_[_0x0f7a('0x46')](_0x3327d2['where'],{'$or':_[_0x0f7a('0x31')](_0x3327d2[_0x0f7a('0x3c')],function(_0x436b5e){var _0x3c18bf={};_0x3c18bf[_0x436b5e]={'$like':'%'+_0x336ff9[_0x0f7a('0x38')][_0x0f7a('0x44')]+'%'};return _0x3c18bf;})});}_0x3327d2=_[_0x0f7a('0x46')]({},_0x3327d2,_0x336ff9['options']);var _0x2c4217={'where':_0x3327d2[_0x0f7a('0x45')]};return db[_0x0f7a('0x32')][_0x0f7a('0x21')](_0x2c4217)[_0x0f7a('0x2a')](function(_0x1d071a){_0x1ce4fb['count']=_0x1d071a;if(_0x336ff9[_0x0f7a('0x38')][_0x0f7a('0x49')]){_0x3327d2[_0x0f7a('0x4a')]=[{'all':!![]}];}return db[_0x0f7a('0x32')][_0x0f7a('0x54')](_0x3327d2);})[_0x0f7a('0x2a')](function(_0x4e41b3){_0x1ce4fb[_0x0f7a('0x4b')]=_0x4e41b3;return _0x1ce4fb;})[_0x0f7a('0x2a')](respondWithFilteredResult(_0xdc1c39,_0x3327d2,_0x0f7a('0x53')))[_0x0f7a('0x50')](handleError(_0xdc1c39,null,_0x0f7a('0x53')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a862427..caaefc7 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 _0x9d3d=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x116ea0,_0x980666){var _0x1601a8=function(_0xfdae49){while(--_0xfdae49){_0x116ea0['push'](_0x116ea0['shift']());}};_0x1601a8(++_0x980666);}(_0x9d3d,0x12e));var _0xd9d3=function(_0x1f06e5,_0x354f08){_0x1f06e5=_0x1f06e5-0x0;var _0x5062bc=_0x9d3d[_0x1f06e5];return _0x5062bc;};'use strict';var EventEmitter=require(_0xd9d3('0x0'));var VoiceQueueReport=require(_0xd9d3('0x1'))['db'][_0xd9d3('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xd9d3('0x3')](0x0);var events={'afterCreate':_0xd9d3('0x4'),'afterUpdate':_0xd9d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3d359f){return function(_0x25e90c,_0x128639,_0x253e6){VoiceQueueReportEvents[_0xd9d3('0x6')](_0x3d359f+':'+_0x25e90c['id'],_0x25e90c);VoiceQueueReportEvents[_0xd9d3('0x6')](_0x3d359f,_0x25e90c);_0x253e6(null);};}for(var e in events){if(events[_0xd9d3('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xd9d3('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xc0f8=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x4ca007,_0x49c50b){var _0x433e7c=function(_0x1e400e){while(--_0x1e400e){_0x4ca007['push'](_0x4ca007['shift']());}};_0x433e7c(++_0x49c50b);}(_0xc0f8,0x1ac));var _0x8c0f=function(_0x1d6faf,_0x120907){_0x1d6faf=_0x1d6faf-0x0;var _0x3655fa=_0xc0f8[_0x1d6faf];return _0x3655fa;};'use strict';var EventEmitter=require(_0x8c0f('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c0f('0x1'),'afterUpdate':_0x8c0f('0x2'),'afterDestroy':_0x8c0f('0x3')};function emitEvent(_0x2feaa7){return function(_0x474516,_0xe44a,_0x3ccd93){VoiceQueueReportEvents['emit'](_0x2feaa7+':'+_0x474516['id'],_0x474516);VoiceQueueReportEvents[_0x8c0f('0x4')](_0x2feaa7,_0x474516);_0x3ccd93(null);};}for(var e in events){if(events[_0x8c0f('0x5')](e)){var event=events[e];VoiceQueueReport[_0x8c0f('0x6')](e,emitEvent(event));}}module[_0x8c0f('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 04ccb00..3224309 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 _0x3814=['calleridnum','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x296711,_0x2eeb39){var _0x4a4eb6=function(_0x4acf5f){while(--_0x4acf5f){_0x296711['push'](_0x296711['shift']());}};_0x4a4eb6(++_0x2eeb39);}(_0x3814,0xb7));var _0x4381=function(_0x29621b,_0x4d46f3){_0x29621b=_0x29621b-0x0;var _0xfdaafc=_0x3814[_0x29621b];return _0xfdaafc;};'use strict';var _=require(_0x4381('0x0'));var util=require('util');var logger=require(_0x4381('0x1'))('api');var moment=require(_0x4381('0x2'));var BPromise=require('bluebird');var rp=require(_0x4381('0x3'));var fs=require('fs');var path=require(_0x4381('0x4'));var rimraf=require(_0x4381('0x5'));var config=require(_0x4381('0x6'));var attributes=require(_0x4381('0x7'));module[_0x4381('0x8')]=function(_0x535e9e,_0x3aa1e6){return _0x535e9e[_0x4381('0x9')](_0x4381('0xa'),attributes,{'tableName':_0x4381('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x4381('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x042c=['report_queue','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport'];(function(_0x6913c9,_0x954579){var _0x32a68e=function(_0x4c9881){while(--_0x4c9881){_0x6913c9['push'](_0x6913c9['shift']());}};_0x32a68e(++_0x954579);}(_0x042c,0x146));var _0xc042=function(_0x486598,_0x6a72fb){_0x486598=_0x486598-0x0;var _0x288f53=_0x042c[_0x486598];return _0x288f53;};'use strict';var _=require(_0xc042('0x0'));var util=require(_0xc042('0x1'));var logger=require(_0xc042('0x2'))('api');var moment=require(_0xc042('0x3'));var BPromise=require(_0xc042('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc042('0x5'));var rimraf=require(_0xc042('0x6'));var config=require(_0xc042('0x7'));var attributes=require(_0xc042('0x8'));module[_0xc042('0x9')]=function(_0x2308ff,_0x577166){return _0x2308ff[_0xc042('0xa')](_0xc042('0xb'),attributes,{'tableName':_0xc042('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 6e00d3d..3dd7b86 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 _0xb9f9=['where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetVoiceQueueReport','options','attributes','limit','map','include','model','debug','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','update','raw'];(function(_0x3c2e8f,_0x489100){var _0x39858e=function(_0x5631ee){while(--_0x5631ee){_0x3c2e8f['push'](_0x3c2e8f['shift']());}};_0x39858e(++_0x489100);}(_0xb9f9,0x7c));var _0x9b9f=function(_0x4408d5,_0x42c1ab){_0x4408d5=_0x4408d5-0x0;var _0x22c585=_0xb9f9[_0x4408d5];return _0x22c585;};'use strict';var _=require(_0x9b9f('0x0'));var util=require('util');var moment=require(_0x9b9f('0x1'));var BPromise=require(_0x9b9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b9f('0x3'));var db=require(_0x9b9f('0x4'))['db'];var utils=require(_0x9b9f('0x5'));var logger=require(_0x9b9f('0x6'))(_0x9b9f('0x7'));var config=require(_0x9b9f('0x8'));var jayson=require(_0x9b9f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9b9f('0xa')]=_['defaults'](config[_0x9b9f('0xa')],{'host':_0x9b9f('0xb'),'port':0x18eb});var socket=require(_0x9b9f('0xc'))(new Redis(config['redis']));require(_0x9b9f('0xd'))[_0x9b9f('0xe')](socket);function respondWithRpcPromise(_0x49ffea,_0x99323d,_0x5725c1){return new BPromise(function(_0x196e79,_0x3da9be){return client['request'](_0x49ffea,_0x5725c1)[_0x9b9f('0xf')](function(_0x471606){logger[_0x9b9f('0x10')](_0x9b9f('0x11'),_0x99323d,'request\x20sent');logger['debug'](_0x9b9f('0x12'),_0x99323d,'request\x20sent',JSON['stringify'](_0x471606));if(_0x471606[_0x9b9f('0x13')]){if(_0x471606['error'][_0x9b9f('0x14')]===0x1f4){logger[_0x9b9f('0x13')](_0x9b9f('0x11'),_0x99323d,_0x471606[_0x9b9f('0x13')][_0x9b9f('0x15')]);return _0x3da9be(_0x471606[_0x9b9f('0x13')][_0x9b9f('0x15')]);}logger[_0x9b9f('0x13')](_0x9b9f('0x11'),_0x99323d,_0x471606[_0x9b9f('0x13')][_0x9b9f('0x15')]);return _0x196e79(_0x471606['error'][_0x9b9f('0x15')]);}else{logger[_0x9b9f('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x99323d,_0x9b9f('0x16'));_0x196e79(_0x471606[_0x9b9f('0x17')][_0x9b9f('0x15')]);}})[_0x9b9f('0x18')](function(_0x263c94){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x99323d,_0x263c94);_0x3da9be(_0x263c94);});});}exports[_0x9b9f('0x19')]=function(_0x35a159){var _0xfe5d06=this;return new Promise(function(_0x56e999,_0x28ac62){return db['VoiceQueueReport']['findAll']({'raw':_0x35a159[_0x9b9f('0x1a')]?_0x35a159[_0x9b9f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x35a159[_0x9b9f('0x1a')]?_0x35a159[_0x9b9f('0x1a')]['where']||null:null,'attributes':_0x35a159['options']?_0x35a159[_0x9b9f('0x1a')][_0x9b9f('0x1b')]||null:null,'limit':_0x35a159[_0x9b9f('0x1a')]?_0x35a159[_0x9b9f('0x1a')][_0x9b9f('0x1c')]||null:null,'include':_0x35a159[_0x9b9f('0x1a')]?_0x35a159[_0x9b9f('0x1a')]['include']?_[_0x9b9f('0x1d')](_0x35a159[_0x9b9f('0x1a')][_0x9b9f('0x1e')],function(_0x4b2b8a){return{'model':db[_0x4b2b8a[_0x9b9f('0x1f')]],'as':_0x4b2b8a['as'],'attributes':_0x4b2b8a[_0x9b9f('0x1b')],'include':_0x4b2b8a[_0x9b9f('0x1e')]?_[_0x9b9f('0x1d')](_0x4b2b8a[_0x9b9f('0x1e')],function(_0x2044ed){return{'model':db[_0x2044ed[_0x9b9f('0x1f')]],'as':_0x2044ed['as'],'attributes':_0x2044ed['attributes'],'include':_0x2044ed[_0x9b9f('0x1e')]?_[_0x9b9f('0x1d')](_0x2044ed[_0x9b9f('0x1e')],function(_0x615ab3){return{'model':db[_0x615ab3[_0x9b9f('0x1f')]],'as':_0x615ab3['as'],'attributes':_0x615ab3[_0x9b9f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9b9f('0xf')](function(_0x427a96){logger[_0x9b9f('0x10')](_0x9b9f('0x19'),_0x35a159);logger[_0x9b9f('0x20')](_0x9b9f('0x19'),_0x35a159,JSON[_0x9b9f('0x21')](_0x427a96));_0x56e999(_0x427a96);})[_0x9b9f('0x18')](function(_0x251bf0){logger['error'](_0x9b9f('0x19'),_0x251bf0[_0x9b9f('0x15')],_0x35a159);_0x28ac62(_0xfe5d06[_0x9b9f('0x13')](0x1f4,_0x251bf0[_0x9b9f('0x15')]));});});};exports[_0x9b9f('0x22')]=function(_0x394fbc){var _0x311088=this;return new Promise(function(_0x28f94d,_0x449cf0){return db[_0x9b9f('0x23')][_0x9b9f('0x24')](_0x394fbc['body'],{'raw':_0x394fbc[_0x9b9f('0x1a')]?_0x394fbc['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1a4959){logger['info'](_0x9b9f('0x22'),_0x394fbc);logger[_0x9b9f('0x20')](_0x9b9f('0x22'),_0x394fbc,JSON[_0x9b9f('0x21')](_0x1a4959));_0x28f94d(_0x1a4959);})[_0x9b9f('0x18')](function(_0x1acc77){logger[_0x9b9f('0x13')]('CreateVoiceQueueReport',_0x1acc77['message'],_0x394fbc);_0x449cf0(_0x311088[_0x9b9f('0x13')](0x1f4,_0x1acc77[_0x9b9f('0x15')]));});});};exports[_0x9b9f('0x25')]=function(_0x2e36ee){var _0x893eae=this;return new Promise(function(_0x2e2286,_0x581f50){return db[_0x9b9f('0x23')][_0x9b9f('0x26')](_0x2e36ee['body'],{'raw':_0x2e36ee[_0x9b9f('0x1a')]?_0x2e36ee[_0x9b9f('0x1a')][_0x9b9f('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e36ee[_0x9b9f('0x1a')]?_0x2e36ee[_0x9b9f('0x1a')][_0x9b9f('0x28')]||null:null,'attributes':_0x2e36ee[_0x9b9f('0x1a')]?_0x2e36ee[_0x9b9f('0x1a')][_0x9b9f('0x1b')]||null:null,'limit':_0x2e36ee['options']?_0x2e36ee[_0x9b9f('0x1a')][_0x9b9f('0x1c')]||null:null})[_0x9b9f('0xf')](function(_0x155e38){logger['info'](_0x9b9f('0x25'),_0x2e36ee);logger[_0x9b9f('0x20')](_0x9b9f('0x25'),_0x2e36ee,JSON[_0x9b9f('0x21')](_0x155e38));_0x2e2286(_0x155e38);})[_0x9b9f('0x18')](function(_0x4da3f7){logger[_0x9b9f('0x13')]('UpdateVoiceQueueReport',_0x4da3f7[_0x9b9f('0x15')],_0x2e36ee);_0x581f50(_0x893eae['error'](0x1f4,_0x4da3f7[_0x9b9f('0x15')]));});});}; \ No newline at end of file +var _0x6732=['stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','include','map','model','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','raw','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0x6732,0x119));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var moment=require(_0x2673('0x2'));var BPromise=require('bluebird');var rs=require(_0x2673('0x3'));var fs=require('fs');var Redis=require(_0x2673('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2673('0x5'));var logger=require('../../config/logger')(_0x2673('0x6'));var config=require(_0x2673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2673('0x8')][_0x2673('0x9')]({'port':0x232a});config[_0x2673('0xa')]=_[_0x2673('0xb')](config[_0x2673('0xa')],{'host':_0x2673('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2673('0xa')]));require(_0x2673('0xd'))[_0x2673('0xe')](socket);function respondWithRpcPromise(_0x54c4f0,_0x501e09,_0x4d5a09){return new BPromise(function(_0x41f7e2,_0x340a61){return client[_0x2673('0xf')](_0x54c4f0,_0x4d5a09)[_0x2673('0x10')](function(_0xc45274){logger[_0x2673('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x501e09,_0x2673('0x12'));logger[_0x2673('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x501e09,_0x2673('0x12'),JSON[_0x2673('0x14')](_0xc45274));if(_0xc45274[_0x2673('0x15')]){if(_0xc45274[_0x2673('0x15')][_0x2673('0x16')]===0x1f4){logger[_0x2673('0x15')](_0x2673('0x17'),_0x501e09,_0xc45274[_0x2673('0x15')][_0x2673('0x18')]);return _0x340a61(_0xc45274[_0x2673('0x15')]['message']);}logger[_0x2673('0x15')](_0x2673('0x17'),_0x501e09,_0xc45274['error'][_0x2673('0x18')]);return _0x41f7e2(_0xc45274[_0x2673('0x15')]['message']);}else{logger['info'](_0x2673('0x17'),_0x501e09,_0x2673('0x12'));_0x41f7e2(_0xc45274[_0x2673('0x19')][_0x2673('0x18')]);}})[_0x2673('0x1a')](function(_0x20ea4d){logger[_0x2673('0x15')](_0x2673('0x17'),_0x501e09,_0x20ea4d);_0x340a61(_0x20ea4d);});});}exports[_0x2673('0x1b')]=function(_0x25cc79){var _0x34337b=this;return new Promise(function(_0x1039f2,_0x27edad){return db[_0x2673('0x1c')][_0x2673('0x1d')]({'raw':_0x25cc79[_0x2673('0x1e')]?_0x25cc79[_0x2673('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x25cc79[_0x2673('0x1e')]?_0x25cc79[_0x2673('0x1e')][_0x2673('0x1f')]||null:null,'attributes':_0x25cc79[_0x2673('0x1e')]?_0x25cc79[_0x2673('0x1e')][_0x2673('0x20')]||null:null,'limit':_0x25cc79[_0x2673('0x1e')]?_0x25cc79['options']['limit']||null:null,'include':_0x25cc79['options']?_0x25cc79[_0x2673('0x1e')][_0x2673('0x21')]?_[_0x2673('0x22')](_0x25cc79[_0x2673('0x1e')][_0x2673('0x21')],function(_0x51ba97){return{'model':db[_0x51ba97['model']],'as':_0x51ba97['as'],'attributes':_0x51ba97[_0x2673('0x20')],'include':_0x51ba97[_0x2673('0x21')]?_[_0x2673('0x22')](_0x51ba97[_0x2673('0x21')],function(_0x442763){return{'model':db[_0x442763[_0x2673('0x23')]],'as':_0x442763['as'],'attributes':_0x442763[_0x2673('0x20')],'include':_0x442763[_0x2673('0x21')]?_['map'](_0x442763[_0x2673('0x21')],function(_0xeafb2f){return{'model':db[_0xeafb2f[_0x2673('0x23')]],'as':_0xeafb2f['as'],'attributes':_0xeafb2f[_0x2673('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2673('0x10')](function(_0x9d8d17){logger[_0x2673('0x11')](_0x2673('0x1b'),_0x25cc79);logger[_0x2673('0x13')](_0x2673('0x1b'),_0x25cc79,JSON['stringify'](_0x9d8d17));_0x1039f2(_0x9d8d17);})[_0x2673('0x1a')](function(_0x15b064){logger[_0x2673('0x15')](_0x2673('0x1b'),_0x15b064['message'],_0x25cc79);_0x27edad(_0x34337b[_0x2673('0x15')](0x1f4,_0x15b064['message']));});});};exports['CreateVoiceQueueReport']=function(_0x4a5391){var _0x63e15e=this;return new Promise(function(_0x316e70,_0x104108){return db[_0x2673('0x1c')][_0x2673('0x24')](_0x4a5391[_0x2673('0x25')],{'raw':_0x4a5391['options']?_0x4a5391[_0x2673('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x2673('0x10')](function(_0xd4b877){logger['info'](_0x2673('0x26'),_0x4a5391);logger[_0x2673('0x13')](_0x2673('0x26'),_0x4a5391,JSON[_0x2673('0x14')](_0xd4b877));_0x316e70(_0xd4b877);})[_0x2673('0x1a')](function(_0x1956cb){logger[_0x2673('0x15')](_0x2673('0x26'),_0x1956cb[_0x2673('0x18')],_0x4a5391);_0x104108(_0x63e15e[_0x2673('0x15')](0x1f4,_0x1956cb[_0x2673('0x18')]));});});};exports[_0x2673('0x27')]=function(_0x2e2cc9){var _0x351e94=this;return new Promise(function(_0x2118ef,_0x23ccbe){return db['VoiceQueueReport'][_0x2673('0x28')](_0x2e2cc9[_0x2673('0x25')],{'raw':_0x2e2cc9['options']?_0x2e2cc9[_0x2673('0x1e')][_0x2673('0x29')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e2cc9[_0x2673('0x1e')]?_0x2e2cc9[_0x2673('0x1e')][_0x2673('0x1f')]||null:null,'attributes':_0x2e2cc9[_0x2673('0x1e')]?_0x2e2cc9[_0x2673('0x1e')][_0x2673('0x20')]||null:null,'limit':_0x2e2cc9[_0x2673('0x1e')]?_0x2e2cc9[_0x2673('0x1e')][_0x2673('0x2a')]||null:null})['then'](function(_0xa7e8e3){logger['info'](_0x2673('0x27'),_0x2e2cc9);logger[_0x2673('0x13')](_0x2673('0x27'),_0x2e2cc9,JSON[_0x2673('0x14')](_0xa7e8e3));_0x2118ef(_0xa7e8e3);})['catch'](function(_0x137b45){logger[_0x2673('0x15')]('UpdateVoiceQueueReport',_0x137b45[_0x2673('0x18')],_0x2e2cc9);_0x23ccbe(_0x351e94[_0x2673('0x15')](0x1f4,_0x137b45[_0x2673('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 1bb8ada..3d4c157 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 _0x4986=['register','voiceQueueReport:','./voiceQueueReport.events','save','remove','removeListener'];(function(_0x332451,_0x89cd22){var _0x59547c=function(_0x101165){while(--_0x101165){_0x332451['push'](_0x332451['shift']());}};_0x59547c(++_0x89cd22);}(_0x4986,0x6e));var _0x6498=function(_0x3358da,_0x5994c5){_0x3358da=_0x3358da-0x0;var _0x10ed9a=_0x4986[_0x3358da];return _0x10ed9a;};'use strict';var VoiceQueueReportEvents=require(_0x6498('0x0'));var events=[_0x6498('0x1'),_0x6498('0x2'),'update'];function createListener(_0x5ab420,_0x405dc5){return function(_0x40bbc9){_0x405dc5['emit'](_0x5ab420,_0x40bbc9);};}function removeListener(_0x15e8d3,_0x12a6fb){return function(){VoiceQueueReportEvents[_0x6498('0x3')](_0x15e8d3,_0x12a6fb);};}exports[_0x6498('0x4')]=function(_0x117a31){for(var _0x8d1853=0x0,_0x26476d=events['length'];_0x8d1853<_0x26476d;_0x8d1853++){var _0x54e6af=events[_0x8d1853];var _0x1e2d8a=createListener(_0x6498('0x5')+_0x54e6af,_0x117a31);VoiceQueueReportEvents['on'](_0x54e6af,_0x1e2d8a);}}; \ No newline at end of file +var _0x121d=['register','length','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x5b62eb,_0x4b658f){var _0x5453a7=function(_0x513923){while(--_0x513923){_0x5b62eb['push'](_0x5b62eb['shift']());}};_0x5453a7(++_0x4b658f);}(_0x121d,0xea));var _0xd121=function(_0x361727,_0x1647d3){_0x361727=_0x361727-0x0;var _0x36b2ff=_0x121d[_0x361727];return _0x36b2ff;};'use strict';var VoiceQueueReportEvents=require(_0xd121('0x0'));var events=[_0xd121('0x1'),_0xd121('0x2'),_0xd121('0x3')];function createListener(_0x16ed51,_0x40e506){return function(_0x233726){_0x40e506[_0xd121('0x4')](_0x16ed51,_0x233726);};}function removeListener(_0x20a687,_0x349fc5){return function(){VoiceQueueReportEvents[_0xd121('0x5')](_0x20a687,_0x349fc5);};}exports[_0xd121('0x6')]=function(_0x2b2f41){for(var _0x31c727=0x0,_0x540cf2=events[_0xd121('0x7')];_0x31c727<_0x540cf2;_0x31c727++){var _0x5b67f7=events[_0x31c727];var _0x1da01c=createListener('voiceQueueReport:'+_0x5b67f7,_0x2b2f41);VoiceQueueReportEvents['on'](_0x5b67f7,_0x1da01c);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0699e73..67113c5 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 _0xc426=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','put','/:id','update'];(function(_0x33f6be,_0x2864a6){var _0x3de6ac=function(_0x3e5c26){while(--_0x3e5c26){_0x33f6be['push'](_0x33f6be['shift']());}};_0x3de6ac(++_0x2864a6);}(_0xc426,0xfe));var _0x6c42=function(_0x2d37af,_0x5f0407){_0x2d37af=_0x2d37af-0x0;var _0xe7653d=_0xc426[_0x2d37af];return _0xe7653d;};'use strict';var multer=require(_0x6c42('0x0'));var util=require('util');var path=require(_0x6c42('0x1'));var timeout=require(_0x6c42('0x2'));var express=require(_0x6c42('0x3'));var router=express[_0x6c42('0x4')]();var fs_extra=require(_0x6c42('0x5'));var auth=require(_0x6c42('0x6'));var interaction=require(_0x6c42('0x7'));var config=require(_0x6c42('0x8'));var controller=require(_0x6c42('0x9'));router['get']('/',auth[_0x6c42('0xa')](),controller[_0x6c42('0xb')]);router[_0x6c42('0xc')]('/:id',auth[_0x6c42('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6c42('0xd')](_0x6c42('0xe'),auth[_0x6c42('0xa')](),controller[_0x6c42('0xf')]);router['delete'](_0x6c42('0xe'),auth['isAuthenticated'](),controller[_0x6c42('0x10')]);module[_0x6c42('0x11')]=router; \ No newline at end of file +var _0x1738=['fs-extra','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','put','destroy','exports','multer','util','express','Router'];(function(_0x132a81,_0x4a1562){var _0x631e02=function(_0x27dd31){while(--_0x27dd31){_0x132a81['push'](_0x132a81['shift']());}};_0x631e02(++_0x4a1562);}(_0x1738,0x1bc));var _0x8173=function(_0x1b8a09,_0xfa4f73){_0x1b8a09=_0x1b8a09-0x0;var _0x53c51c=_0x1738[_0x1b8a09];return _0x53c51c;};'use strict';var multer=require(_0x8173('0x0'));var util=require(_0x8173('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8173('0x2'));var router=express[_0x8173('0x3')]();var fs_extra=require(_0x8173('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8173('0x5'));var controller=require(_0x8173('0x6'));router[_0x8173('0x7')]('/',auth[_0x8173('0x8')](),controller[_0x8173('0x9')]);router[_0x8173('0x7')](_0x8173('0xa'),auth[_0x8173('0x8')](),controller[_0x8173('0xb')]);router[_0x8173('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8173('0xd')](_0x8173('0xa'),auth[_0x8173('0x8')](),controller['update']);router['delete'](_0x8173('0xa'),auth[_0x8173('0x8')](),controller[_0x8173('0xe')]);module[_0x8173('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 3c0fc0e..44bcab6 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 _0xeb93=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING'];(function(_0x4f88bf,_0x25b46d){var _0x2f3a37=function(_0x4a1804){while(--_0x4a1804){_0x4f88bf['push'](_0x4f88bf['shift']());}};_0x2f3a37(++_0x25b46d);}(_0xeb93,0x18d));var _0x3eb9=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0xeb93[_0x28cddc];return _0x5ce855;};'use strict';var Sequelize=require(_0x3eb9('0x0'));var moment=require(_0x3eb9('0x1'));module['exports']={'time':{'type':Sequelize[_0x3eb9('0x2')]},'callid':{'type':Sequelize[_0x3eb9('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3eb9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3eb9('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3eb9('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3eb9('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3eb9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3eb9('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x3eb9('0x3')](_0x3eb9('0x4'))}}; \ No newline at end of file +var _0x3d9d=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','format'];(function(_0x5519e0,_0xec8f68){var _0x14dfb2=function(_0x46b753){while(--_0x46b753){_0x5519e0['push'](_0x5519e0['shift']());}};_0x14dfb2(++_0xec8f68);}(_0x3d9d,0xc4));var _0xd3d9=function(_0x53fc07,_0x386c70){_0x53fc07=_0x53fc07-0x0;var _0xe99cf3=_0x3d9d[_0x53fc07];return _0xe99cf3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd3d9('0x0'));module[_0xd3d9('0x1')]={'time':{'type':Sequelize[_0xd3d9('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd3d9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd3d9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd3d9('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd3d9('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd3d9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd3d9('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd3d9('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xd3d9('0x3')](_0xd3d9('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index efe94bb..ee178ef 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 _0x5204=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x964a4a,_0x525e69){var _0x51ab3a=function(_0x488879){while(--_0x488879){_0x964a4a['push'](_0x964a4a['shift']());}};_0x51ab3a(++_0x525e69);}(_0x5204,0x1b0));var _0x4520=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x5204[_0x233716];return _0x302298;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require(_0x4520('0x7'));var util=require('util');var path=require(_0x4520('0x8'));var sox=require('sox');var csv=require(_0x4520('0x9'));var ejs=require(_0x4520('0xa'));var fs=require('fs');var fs_extra=require(_0x4520('0xb'));var _=require(_0x4520('0xc'));var squel=require(_0x4520('0xd'));var crypto=require(_0x4520('0xe'));var jsforce=require(_0x4520('0xf'));var deskjs=require(_0x4520('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4520('0x11'));var Papa=require(_0x4520('0x12'));var Redis=require(_0x4520('0x13'));var authService=require(_0x4520('0x14'));var qs=require(_0x4520('0x15'));var as=require(_0x4520('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4520('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4520('0x18'));var licenseUtil=require(_0x4520('0x19'));var db=require(_0x4520('0x1a'))['db'];function respondWithStatusCode(_0x177db1,_0xe560b9){_0xe560b9=_0xe560b9||0xcc;return function(_0x45352a){if(_0x45352a){return _0x177db1[_0x4520('0x1b')](_0xe560b9);}return _0x177db1[_0x4520('0x1c')](_0xe560b9)[_0x4520('0x1d')]();};}function respondWithResult(_0x2b8e9d,_0x285785){_0x285785=_0x285785||0xc8;return function(_0x468810){if(_0x468810){return _0x2b8e9d[_0x4520('0x1c')](_0x285785)[_0x4520('0x1e')](_0x468810);}};}function respondWithFilteredResult(_0x4f34cf,_0x393bca){return function(_0x4a49dd){if(_0x4a49dd){var _0x1d1a6c=typeof _0x393bca[_0x4520('0x1f')]==='undefined'&&typeof _0x393bca['limit']==='undefined';var _0x5b8a20=_0x4a49dd[_0x4520('0x20')];var _0x59f500=_0x1d1a6c?0x0:_0x393bca[_0x4520('0x1f')];var _0x1ab1cc=_0x1d1a6c?_0x4a49dd[_0x4520('0x20')]:_0x393bca['offset']+_0x393bca['limit'];var _0x5cc6b7;if(_0x1ab1cc>=_0x5b8a20){_0x1ab1cc=_0x5b8a20;_0x5cc6b7=0xc8;}else{_0x5cc6b7=0xce;}_0x4f34cf[_0x4520('0x1c')](_0x5cc6b7);return _0x4f34cf[_0x4520('0x21')](_0x4520('0x22'),_0x59f500+'-'+_0x1ab1cc+'/'+_0x5b8a20)['json'](_0x4a49dd);}return null;};}function patchUpdates(_0x460bfb){return function(_0x5e8f75){try{jsonpatch[_0x4520('0x23')](_0x5e8f75,_0x460bfb,!![]);}catch(_0x5b43a9){return BPromise[_0x4520('0x24')](_0x5b43a9);}return _0x5e8f75[_0x4520('0x25')]();};}function saveUpdates(_0x23424b,_0x1ae933){return function(_0x36b530){if(_0x36b530){return _0x36b530[_0x4520('0x26')](_0x23424b)[_0x4520('0x27')](function(_0x2a32d0){return _0x2a32d0;});}return null;};}function removeEntity(_0x38f809,_0x507d8c){return function(_0x472f71){if(_0x472f71){return _0x472f71[_0x4520('0x28')]()[_0x4520('0x27')](function(){_0x38f809[_0x4520('0x1c')](0xcc)[_0x4520('0x1d')]();});}};}function handleEntityNotFound(_0x4f9d0e,_0x40a7eb){return function(_0x380e29){if(!_0x380e29){_0x4f9d0e[_0x4520('0x1b')](0x194);}return _0x380e29;};}function handleError(_0x59e180,_0x5f5f9a){_0x5f5f9a=_0x5f5f9a||0x1f4;return function(_0x49db1c){logger[_0x4520('0x29')](_0x49db1c[_0x4520('0x2a')]);if(_0x49db1c['name']){delete _0x49db1c[_0x4520('0x2b')];}_0x59e180['status'](_0x5f5f9a)['send'](_0x49db1c);};}exports[_0x4520('0x2c')]=function(_0x249a08,_0x2eff59){var _0x80d4da={},_0x4f75e9={},_0x20fb6a={'count':0x0,'rows':[]};var _0xe8ee1f=_[_0x4520('0x2d')](db[_0x4520('0x2e')][_0x4520('0x2f')],function(_0x45927b){return{'name':_0x45927b[_0x4520('0x30')],'type':_0x45927b[_0x4520('0x31')]['key']};});_0x4f75e9['model']=_[_0x4520('0x2d')](_0xe8ee1f,'name');_0x4f75e9[_0x4520('0x32')]=_[_0x4520('0x33')](_0x249a08[_0x4520('0x32')]);_0x4f75e9[_0x4520('0x34')]=_[_0x4520('0x35')](_0x4f75e9['model'],_0x4f75e9[_0x4520('0x32')]);_0x80d4da['attributes']=_['intersection'](_0x4f75e9[_0x4520('0x36')],qs[_0x4520('0x37')](_0x249a08[_0x4520('0x32')]['fields']));_0x80d4da[_0x4520('0x38')]=_0x80d4da['attributes'][_0x4520('0x39')]?_0x80d4da[_0x4520('0x38')]:_0x4f75e9[_0x4520('0x36')];if(!_0x249a08[_0x4520('0x32')]['hasOwnProperty'](_0x4520('0x3a'))){_0x80d4da['limit']=qs[_0x4520('0x3b')](_0x249a08['query'][_0x4520('0x3b')]);_0x80d4da[_0x4520('0x1f')]=qs[_0x4520('0x1f')](_0x249a08['query']['offset']);}_0x80d4da[_0x4520('0x3c')]=qs[_0x4520('0x3d')](_0x249a08[_0x4520('0x32')]['sort']);_0x80d4da[_0x4520('0x3e')]=qs['filters'](_[_0x4520('0x3f')](_0x249a08[_0x4520('0x32')],_0x4f75e9[_0x4520('0x34')]),_0xe8ee1f);if(_0x249a08['query']['filter']){_0x80d4da[_0x4520('0x3e')]=_[_0x4520('0x40')](_0x80d4da['where'],{'$or':_[_0x4520('0x2d')](_0xe8ee1f,function(_0x11eccf){if(_0x11eccf[_0x4520('0x31')]!==_0x4520('0x41')){var _0x40adb2={};_0x40adb2[_0x11eccf[_0x4520('0x2b')]]={'$like':'%'+_0x249a08['query']['filter']+'%'};return _0x40adb2;}})});}_0x80d4da=_[_0x4520('0x40')]({},_0x80d4da,_0x249a08[_0x4520('0x42')]);var _0xbad005={'where':_0x80d4da[_0x4520('0x3e')]};return db['VoiceQueuesLog'][_0x4520('0x20')](_0xbad005)[_0x4520('0x27')](function(_0x2a3e65){_0x20fb6a[_0x4520('0x20')]=_0x2a3e65;if(_0x249a08[_0x4520('0x32')][_0x4520('0x43')]){_0x80d4da[_0x4520('0x44')]=[{'all':!![]}];}return db[_0x4520('0x2e')]['findAll'](_0x80d4da);})['then'](function(_0x6ffab5){_0x20fb6a[_0x4520('0x45')]=_0x6ffab5;return _0x20fb6a;})[_0x4520('0x27')](respondWithFilteredResult(_0x2eff59,_0x80d4da))[_0x4520('0x46')](handleError(_0x2eff59,null));};exports[_0x4520('0x47')]=function(_0x20f52a,_0x4cba04){var _0x5474f8={'raw':!![],'where':{'id':_0x20f52a[_0x4520('0x48')]['id']}},_0x25ffb1={};_0x25ffb1[_0x4520('0x36')]=_[_0x4520('0x33')](db['VoiceQueuesLog'][_0x4520('0x2f')]);_0x25ffb1[_0x4520('0x32')]=_['keys'](_0x20f52a[_0x4520('0x32')]);_0x25ffb1[_0x4520('0x34')]=_[_0x4520('0x35')](_0x25ffb1[_0x4520('0x36')],_0x25ffb1[_0x4520('0x32')]);_0x5474f8[_0x4520('0x38')]=_[_0x4520('0x35')](_0x25ffb1['model'],qs[_0x4520('0x37')](_0x20f52a[_0x4520('0x32')]['fields']));_0x5474f8[_0x4520('0x38')]=_0x5474f8[_0x4520('0x38')][_0x4520('0x39')]?_0x5474f8['attributes']:_0x25ffb1[_0x4520('0x36')];if(_0x20f52a[_0x4520('0x32')][_0x4520('0x43')]){_0x5474f8[_0x4520('0x44')]=[{'all':!![]}];}_0x5474f8=_['merge']({},_0x5474f8,_0x20f52a[_0x4520('0x42')]);return db[_0x4520('0x2e')][_0x4520('0x49')](_0x5474f8)[_0x4520('0x27')](handleEntityNotFound(_0x4cba04,null))[_0x4520('0x27')](respondWithResult(_0x4cba04,null))['catch'](handleError(_0x4cba04,null));};exports[_0x4520('0x4a')]=function(_0x38d542,_0x2b3806){return db['VoiceQueuesLog'][_0x4520('0x4a')](_0x38d542[_0x4520('0x4b')],{})[_0x4520('0x27')](respondWithResult(_0x2b3806,0xc9))[_0x4520('0x46')](handleError(_0x2b3806,null));};exports['update']=function(_0x3cdd15,_0x555a14){if(_0x3cdd15[_0x4520('0x4b')]['id']){delete _0x3cdd15[_0x4520('0x4b')]['id'];}return db[_0x4520('0x2e')][_0x4520('0x49')]({'where':{'id':_0x3cdd15[_0x4520('0x48')]['id']}})['then'](handleEntityNotFound(_0x555a14,null))[_0x4520('0x27')](saveUpdates(_0x3cdd15[_0x4520('0x4b')],null))['then'](respondWithResult(_0x555a14,null))[_0x4520('0x46')](handleError(_0x555a14,null));};exports[_0x4520('0x28')]=function(_0x4b5762,_0x5f247c){return db[_0x4520('0x2e')][_0x4520('0x49')]({'where':{'id':_0x4b5762[_0x4520('0x48')]['id']}})[_0x4520('0x27')](handleEntityNotFound(_0x5f247c,null))[_0x4520('0x27')](removeEntity(_0x5f247c,null))[_0x4520('0x46')](handleError(_0x5f247c,null));}; \ No newline at end of file +var _0x1933=['params','find','create','body','rimraf','zip-dir','moment','bluebird','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/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','catch','show'];(function(_0x2ad3e1,_0x1a75de){var _0x5630fc=function(_0x1dc636){while(--_0x1dc636){_0x2ad3e1['push'](_0x2ad3e1['shift']());}};_0x5630fc(++_0x1a75de);}(_0x1933,0x124));var _0x3193=function(_0x5d2af5,_0x1541e3){_0x5d2af5=_0x5d2af5-0x0;var _0x4933b5=_0x1933[_0x5d2af5];return _0x4933b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3193('0x0'));var zipdir=require(_0x3193('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3193('0x2'));var BPromise=require(_0x3193('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3193('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3193('0x5'));var _=require(_0x3193('0x6'));var squel=require(_0x3193('0x7'));var crypto=require(_0x3193('0x8'));var jsforce=require(_0x3193('0x9'));var deskjs=require(_0x3193('0xa'));var toCsv=require(_0x3193('0x4'));var querystring=require(_0x3193('0xb'));var Papa=require(_0x3193('0xc'));var Redis=require(_0x3193('0xd'));var authService=require(_0x3193('0xe'));var qs=require(_0x3193('0xf'));var as=require(_0x3193('0x10'));var hardwareService=require(_0x3193('0x11'));var logger=require(_0x3193('0x12'))(_0x3193('0x13'));var utils=require(_0x3193('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3193('0x15'));var db=require(_0x3193('0x16'))['db'];function respondWithStatusCode(_0x25cfa0,_0x5060f4){_0x5060f4=_0x5060f4||0xcc;return function(_0x377a29){if(_0x377a29){return _0x25cfa0['sendStatus'](_0x5060f4);}return _0x25cfa0['status'](_0x5060f4)[_0x3193('0x17')]();};}function respondWithResult(_0x5205c3,_0x211441){_0x211441=_0x211441||0xc8;return function(_0x75f36f){if(_0x75f36f){return _0x5205c3[_0x3193('0x18')](_0x211441)[_0x3193('0x19')](_0x75f36f);}};}function respondWithFilteredResult(_0x4aa23f,_0x61f6a2){return function(_0x435e2d){if(_0x435e2d){var _0x17f473=typeof _0x61f6a2[_0x3193('0x1a')]===_0x3193('0x1b')&&typeof _0x61f6a2[_0x3193('0x1c')]===_0x3193('0x1b');var _0x382e64=_0x435e2d[_0x3193('0x1d')];var _0x3009c6=_0x17f473?0x0:_0x61f6a2['offset'];var _0x1ff4f3=_0x17f473?_0x435e2d[_0x3193('0x1d')]:_0x61f6a2[_0x3193('0x1a')]+_0x61f6a2['limit'];var _0x25944c;if(_0x1ff4f3>=_0x382e64){_0x1ff4f3=_0x382e64;_0x25944c=0xc8;}else{_0x25944c=0xce;}_0x4aa23f[_0x3193('0x18')](_0x25944c);return _0x4aa23f['set'](_0x3193('0x1e'),_0x3009c6+'-'+_0x1ff4f3+'/'+_0x382e64)[_0x3193('0x19')](_0x435e2d);}return null;};}function patchUpdates(_0xee7077){return function(_0xd20f81){try{jsonpatch[_0x3193('0x1f')](_0xd20f81,_0xee7077,!![]);}catch(_0xbdc721){return BPromise[_0x3193('0x20')](_0xbdc721);}return _0xd20f81[_0x3193('0x21')]();};}function saveUpdates(_0x2986f8,_0x3d4479){return function(_0x5e822f){if(_0x5e822f){return _0x5e822f['update'](_0x2986f8)['then'](function(_0x97bcf6){return _0x97bcf6;});}return null;};}function removeEntity(_0x2e9878,_0x46eb49){return function(_0x5e74e8){if(_0x5e74e8){return _0x5e74e8[_0x3193('0x22')]()[_0x3193('0x23')](function(){_0x2e9878[_0x3193('0x18')](0xcc)[_0x3193('0x17')]();});}};}function handleEntityNotFound(_0x1224c3,_0x1e73e1){return function(_0x3092f2){if(!_0x3092f2){_0x1224c3[_0x3193('0x24')](0x194);}return _0x3092f2;};}function handleError(_0x4e9e2a,_0x243479){_0x243479=_0x243479||0x1f4;return function(_0x3ef1a8){logger[_0x3193('0x25')](_0x3ef1a8[_0x3193('0x26')]);if(_0x3ef1a8[_0x3193('0x27')]){delete _0x3ef1a8[_0x3193('0x27')];}_0x4e9e2a[_0x3193('0x18')](_0x243479)[_0x3193('0x28')](_0x3ef1a8);};}exports['index']=function(_0x3f9aac,_0x4d3f4d){var _0x4e712a={},_0x96aa1c={},_0x2eb169={'count':0x0,'rows':[]};var _0x5f0ff5=_[_0x3193('0x29')](db[_0x3193('0x2a')][_0x3193('0x2b')],function(_0x3608a7){return{'name':_0x3608a7[_0x3193('0x2c')],'type':_0x3608a7[_0x3193('0x2d')]['key']};});_0x96aa1c[_0x3193('0x2e')]=_[_0x3193('0x29')](_0x5f0ff5,_0x3193('0x27'));_0x96aa1c[_0x3193('0x2f')]=_[_0x3193('0x30')](_0x3f9aac[_0x3193('0x2f')]);_0x96aa1c[_0x3193('0x31')]=_[_0x3193('0x32')](_0x96aa1c[_0x3193('0x2e')],_0x96aa1c[_0x3193('0x2f')]);_0x4e712a[_0x3193('0x33')]=_[_0x3193('0x32')](_0x96aa1c[_0x3193('0x2e')],qs[_0x3193('0x34')](_0x3f9aac[_0x3193('0x2f')]['fields']));_0x4e712a['attributes']=_0x4e712a[_0x3193('0x33')][_0x3193('0x35')]?_0x4e712a['attributes']:_0x96aa1c['model'];if(!_0x3f9aac['query']['hasOwnProperty'](_0x3193('0x36'))){_0x4e712a[_0x3193('0x1c')]=qs['limit'](_0x3f9aac[_0x3193('0x2f')][_0x3193('0x1c')]);_0x4e712a[_0x3193('0x1a')]=qs['offset'](_0x3f9aac[_0x3193('0x2f')][_0x3193('0x1a')]);}_0x4e712a[_0x3193('0x37')]=qs[_0x3193('0x38')](_0x3f9aac[_0x3193('0x2f')][_0x3193('0x38')]);_0x4e712a['where']=qs[_0x3193('0x31')](_[_0x3193('0x39')](_0x3f9aac[_0x3193('0x2f')],_0x96aa1c['filters']),_0x5f0ff5);if(_0x3f9aac['query']['filter']){_0x4e712a['where']=_[_0x3193('0x3a')](_0x4e712a['where'],{'$or':_[_0x3193('0x29')](_0x5f0ff5,function(_0x1ce878){if(_0x1ce878[_0x3193('0x2d')]!==_0x3193('0x3b')){var _0x4b6c39={};_0x4b6c39[_0x1ce878[_0x3193('0x27')]]={'$like':'%'+_0x3f9aac[_0x3193('0x2f')][_0x3193('0x3c')]+'%'};return _0x4b6c39;}})});}_0x4e712a=_[_0x3193('0x3a')]({},_0x4e712a,_0x3f9aac[_0x3193('0x3d')]);var _0x19c711={'where':_0x4e712a[_0x3193('0x3e')]};return db[_0x3193('0x2a')]['count'](_0x19c711)[_0x3193('0x23')](function(_0x445ef7){_0x2eb169[_0x3193('0x1d')]=_0x445ef7;if(_0x3f9aac[_0x3193('0x2f')][_0x3193('0x3f')]){_0x4e712a[_0x3193('0x40')]=[{'all':!![]}];}return db[_0x3193('0x2a')][_0x3193('0x41')](_0x4e712a);})[_0x3193('0x23')](function(_0x5d797a){_0x2eb169['rows']=_0x5d797a;return _0x2eb169;})['then'](respondWithFilteredResult(_0x4d3f4d,_0x4e712a))[_0x3193('0x42')](handleError(_0x4d3f4d,null));};exports[_0x3193('0x43')]=function(_0x144711,_0x1ab752){var _0x40d5ad={'raw':!![],'where':{'id':_0x144711[_0x3193('0x44')]['id']}},_0x5ac616={};_0x5ac616[_0x3193('0x2e')]=_[_0x3193('0x30')](db[_0x3193('0x2a')][_0x3193('0x2b')]);_0x5ac616[_0x3193('0x2f')]=_['keys'](_0x144711['query']);_0x5ac616[_0x3193('0x31')]=_['intersection'](_0x5ac616[_0x3193('0x2e')],_0x5ac616[_0x3193('0x2f')]);_0x40d5ad[_0x3193('0x33')]=_[_0x3193('0x32')](_0x5ac616[_0x3193('0x2e')],qs[_0x3193('0x34')](_0x144711['query'][_0x3193('0x34')]));_0x40d5ad[_0x3193('0x33')]=_0x40d5ad[_0x3193('0x33')]['length']?_0x40d5ad[_0x3193('0x33')]:_0x5ac616[_0x3193('0x2e')];if(_0x144711[_0x3193('0x2f')][_0x3193('0x3f')]){_0x40d5ad[_0x3193('0x40')]=[{'all':!![]}];}_0x40d5ad=_[_0x3193('0x3a')]({},_0x40d5ad,_0x144711['options']);return db[_0x3193('0x2a')][_0x3193('0x45')](_0x40d5ad)[_0x3193('0x23')](handleEntityNotFound(_0x1ab752,null))[_0x3193('0x23')](respondWithResult(_0x1ab752,null))[_0x3193('0x42')](handleError(_0x1ab752,null));};exports[_0x3193('0x46')]=function(_0x2e1d87,_0x2cc8a5){return db[_0x3193('0x2a')][_0x3193('0x46')](_0x2e1d87[_0x3193('0x47')],{})[_0x3193('0x23')](respondWithResult(_0x2cc8a5,0xc9))[_0x3193('0x42')](handleError(_0x2cc8a5,null));};exports['update']=function(_0xd3bd12,_0x51f491){if(_0xd3bd12[_0x3193('0x47')]['id']){delete _0xd3bd12[_0x3193('0x47')]['id'];}return db[_0x3193('0x2a')][_0x3193('0x45')]({'where':{'id':_0xd3bd12[_0x3193('0x44')]['id']}})[_0x3193('0x23')](handleEntityNotFound(_0x51f491,null))[_0x3193('0x23')](saveUpdates(_0xd3bd12[_0x3193('0x47')],null))[_0x3193('0x23')](respondWithResult(_0x51f491,null))['catch'](handleError(_0x51f491,null));};exports[_0x3193('0x22')]=function(_0x590247,_0x2d83b3){return db[_0x3193('0x2a')][_0x3193('0x45')]({'where':{'id':_0x590247[_0x3193('0x44')]['id']}})[_0x3193('0x23')](handleEntityNotFound(_0x2d83b3,null))[_0x3193('0x23')](removeEntity(_0x2d83b3,null))[_0x3193('0x42')](handleError(_0x2d83b3,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index eab173b..81de6d4 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 _0x6898=['request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger','api','moment','bluebird'];(function(_0x62a56f,_0x4cedeb){var _0x156be0=function(_0x1bd40f){while(--_0x1bd40f){_0x62a56f['push'](_0x62a56f['shift']());}};_0x156be0(++_0x4cedeb);}(_0x6898,0x11b));var _0x8689=function(_0x3435c3,_0x1ab24b){_0x3435c3=_0x3435c3-0x0;var _0x41987e=_0x6898[_0x3435c3];return _0x41987e;};'use strict';var _=require(_0x8689('0x0'));var util=require('util');var logger=require(_0x8689('0x1'))(_0x8689('0x2'));var moment=require(_0x8689('0x3'));var BPromise=require(_0x8689('0x4'));var rp=require(_0x8689('0x5'));var fs=require('fs');var path=require(_0x8689('0x6'));var rimraf=require(_0x8689('0x7'));var config=require('../../config/environment');var attributes=require(_0x8689('0x8'));module[_0x8689('0x9')]=function(_0x2c723e,_0x4e776d){return _0x2c723e[_0x8689('0xa')](_0x8689('0xb'),attributes,{'tableName':_0x8689('0xc'),'paranoid':![],'indexes':[{'name':_0x8689('0xd'),'fields':[_0x8689('0xe'),_0x8689('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x43df=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','dtm','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5ebd8f,_0x1db67c){var _0x3242c9=function(_0x537200){while(--_0x537200){_0x5ebd8f['push'](_0x5ebd8f['shift']());}};_0x3242c9(++_0x1db67c);}(_0x43df,0x1c8));var _0xf43d=function(_0x39abce,_0x1589e6){_0x39abce=_0x39abce-0x0;var _0x3fea79=_0x43df[_0x39abce];return _0x3fea79;};'use strict';var _=require('lodash');var util=require(_0xf43d('0x0'));var logger=require(_0xf43d('0x1'))('api');var moment=require(_0xf43d('0x2'));var BPromise=require(_0xf43d('0x3'));var rp=require(_0xf43d('0x4'));var fs=require('fs');var path=require(_0xf43d('0x5'));var rimraf=require(_0xf43d('0x6'));var config=require(_0xf43d('0x7'));var attributes=require(_0xf43d('0x8'));module[_0xf43d('0x9')]=function(_0x28c09b,_0x1563d7){return _0x28c09b[_0xf43d('0xa')](_0xf43d('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xf43d('0xc'),'fields':['event',_0xf43d('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index a4d4ac5..a03b757 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 _0x2e35=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x135fb4,_0x50e172){var _0x1b7f11=function(_0x3d10e0){while(--_0x3d10e0){_0x135fb4['push'](_0x135fb4['shift']());}};_0x1b7f11(++_0x50e172);}(_0x2e35,0x1d0));var _0x52e3=function(_0x2b2a07,_0x1307ed){_0x2b2a07=_0x2b2a07-0x0;var _0x29c1ee=_0x2e35[_0x2b2a07];return _0x29c1ee;};'use strict';var _=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var moment=require(_0x52e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x52e3('0x3'));var fs=require('fs');var Redis=require(_0x52e3('0x4'));var db=require(_0x52e3('0x5'))['db'];var utils=require(_0x52e3('0x6'));var logger=require('../../config/logger')(_0x52e3('0x7'));var config=require(_0x52e3('0x8'));var jayson=require(_0x52e3('0x9'));var client=jayson[_0x52e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x483b93,_0x507a6c,_0x21ae13){return new BPromise(function(_0x4d77a0,_0x4b2662){return client[_0x52e3('0xb')](_0x483b93,_0x21ae13)[_0x52e3('0xc')](function(_0x551848){logger[_0x52e3('0xd')](_0x52e3('0xe'),_0x507a6c,'request\x20sent');logger[_0x52e3('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x507a6c,_0x52e3('0x10'),JSON[_0x52e3('0x11')](_0x551848));if(_0x551848[_0x52e3('0x12')]){if(_0x551848['error'][_0x52e3('0x13')]===0x1f4){logger[_0x52e3('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x507a6c,_0x551848[_0x52e3('0x12')]['message']);return _0x4b2662(_0x551848['error']['message']);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x507a6c,_0x551848[_0x52e3('0x12')][_0x52e3('0x14')]);return _0x4d77a0(_0x551848[_0x52e3('0x12')][_0x52e3('0x14')]);}else{logger[_0x52e3('0xd')](_0x52e3('0xe'),_0x507a6c,_0x52e3('0x10'));_0x4d77a0(_0x551848[_0x52e3('0x15')][_0x52e3('0x14')]);}})[_0x52e3('0x16')](function(_0x3355e7){logger['error'](_0x52e3('0xe'),_0x507a6c,_0x3355e7);_0x4b2662(_0x3355e7);});});} \ No newline at end of file +var _0x80f7=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x20a1d6,_0x79f6e){var _0x2990b5=function(_0x47b900){while(--_0x47b900){_0x20a1d6['push'](_0x20a1d6['shift']());}};_0x2990b5(++_0x79f6e);}(_0x80f7,0x110));var _0x780f=function(_0x102287,_0x1c82dc){_0x102287=_0x102287-0x0;var _0x43d29e=_0x80f7[_0x102287];return _0x43d29e;};'use strict';var _=require(_0x780f('0x0'));var util=require(_0x780f('0x1'));var moment=require(_0x780f('0x2'));var BPromise=require(_0x780f('0x3'));var rs=require(_0x780f('0x4'));var fs=require('fs');var Redis=require(_0x780f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x780f('0x6'));var logger=require(_0x780f('0x7'))(_0x780f('0x8'));var config=require(_0x780f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x780f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd1dd27,_0x9b062d,_0x5bd3f3){return new BPromise(function(_0x297cec,_0x5db954){return client[_0x780f('0xb')](_0xd1dd27,_0x5bd3f3)[_0x780f('0xc')](function(_0x38f810){logger[_0x780f('0xd')](_0x780f('0xe'),_0x9b062d,_0x780f('0xf'));logger[_0x780f('0x10')](_0x780f('0x11'),_0x9b062d,_0x780f('0xf'),JSON[_0x780f('0x12')](_0x38f810));if(_0x38f810[_0x780f('0x13')]){if(_0x38f810[_0x780f('0x13')][_0x780f('0x14')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x9b062d,_0x38f810[_0x780f('0x13')][_0x780f('0x15')]);return _0x5db954(_0x38f810['error']['message']);}logger[_0x780f('0x13')](_0x780f('0xe'),_0x9b062d,_0x38f810[_0x780f('0x13')][_0x780f('0x15')]);return _0x297cec(_0x38f810['error'][_0x780f('0x15')]);}else{logger[_0x780f('0xd')](_0x780f('0xe'),_0x9b062d,'request\x20sent');_0x297cec(_0x38f810[_0x780f('0x16')]['message']);}})['catch'](function(_0x27a9d5){logger[_0x780f('0x13')](_0x780f('0xe'),_0x9b062d,_0x27a9d5);_0x5db954(_0x27a9d5);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 11e8d2f..5f2c96e 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 _0x7090=['downloadTranscribe','create','post','put','update','delete','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','/:id/download','download','/:id/downloads','/:id/transcribe'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7090,0xbf));var _0x0709=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0x7090[_0x2e53e1];return _0x3a23de;};'use strict';var multer=require(_0x0709('0x0'));var util=require('util');var path=require(_0x0709('0x1'));var timeout=require('connect-timeout');var express=require(_0x0709('0x2'));var router=express['Router']();var fs_extra=require(_0x0709('0x3'));var auth=require(_0x0709('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0709('0x5'));var controller=require(_0x0709('0x6'));router[_0x0709('0x7')]('/',auth[_0x0709('0x8')](),controller[_0x0709('0x9')]);router[_0x0709('0x7')]('/describe',auth[_0x0709('0x8')](),controller[_0x0709('0xa')]);router[_0x0709('0x7')](_0x0709('0xb'),auth[_0x0709('0x8')](),controller['show']);router[_0x0709('0x7')](_0x0709('0xc'),auth[_0x0709('0x8')](),controller[_0x0709('0xd')]);router[_0x0709('0x7')](_0x0709('0xe'),controller['downloads']);router[_0x0709('0x7')](_0x0709('0xf'),auth[_0x0709('0x8')](),controller[_0x0709('0x10')]);router['post']('/',auth[_0x0709('0x8')](),controller[_0x0709('0x11')]);router[_0x0709('0x12')](_0x0709('0xf'),auth[_0x0709('0x8')](),controller['runTranscribe']);router[_0x0709('0x13')](_0x0709('0xb'),auth[_0x0709('0x8')](),controller[_0x0709('0x14')]);router[_0x0709('0x15')](_0x0709('0xb'),auth[_0x0709('0x8')](),controller['destroy']);module[_0x0709('0x16')]=router; \ No newline at end of file +var _0xf861=['index','get','describe','/:id','show','/:id/download','downloads','/:id/transcribe','downloadTranscribe','create','post','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated'];(function(_0x225a7f,_0x529bd4){var _0x24704c=function(_0x39e031){while(--_0x39e031){_0x225a7f['push'](_0x225a7f['shift']());}};_0x24704c(++_0x529bd4);}(_0xf861,0x185));var _0x1f86=function(_0x3a1fbe,_0x17cc97){_0x3a1fbe=_0x3a1fbe-0x0;var _0x44d2cc=_0xf861[_0x3a1fbe];return _0x44d2cc;};'use strict';var multer=require(_0x1f86('0x0'));var util=require(_0x1f86('0x1'));var path=require(_0x1f86('0x2'));var timeout=require(_0x1f86('0x3'));var express=require(_0x1f86('0x4'));var router=express[_0x1f86('0x5')]();var fs_extra=require(_0x1f86('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1f86('0x7'));var config=require(_0x1f86('0x8'));var controller=require(_0x1f86('0x9'));router['get']('/',auth[_0x1f86('0xa')](),controller[_0x1f86('0xb')]);router[_0x1f86('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x1f86('0xd')]);router[_0x1f86('0xc')](_0x1f86('0xe'),auth['isAuthenticated'](),controller[_0x1f86('0xf')]);router[_0x1f86('0xc')](_0x1f86('0x10'),auth['isAuthenticated'](),controller['download']);router['get']('/:id/downloads',controller[_0x1f86('0x11')]);router[_0x1f86('0xc')](_0x1f86('0x12'),auth[_0x1f86('0xa')](),controller[_0x1f86('0x13')]);router['post']('/',auth[_0x1f86('0xa')](),controller[_0x1f86('0x14')]);router[_0x1f86('0x15')](_0x1f86('0x12'),auth[_0x1f86('0xa')](),controller['runTranscribe']);router[_0x1f86('0x16')](_0x1f86('0xe'),auth['isAuthenticated'](),controller[_0x1f86('0x17')]);router['delete'](_0x1f86('0xe'),auth[_0x1f86('0xa')](),controller['destroy']);module[_0x1f86('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 7880c7f..e392648 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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 59da9ce..3d8f75b 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 _0xef00=['[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','TranscriptionJob','transcribeName','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','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','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','find','create','body','describe','../../components/encryptor','uniqueid','value','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','token','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','TranscribeService','readFileSync'];(function(_0x399cdc,_0x17aa4f){var _0x525f46=function(_0x490ad8){while(--_0x490ad8){_0x399cdc['push'](_0x399cdc['shift']());}};_0x525f46(++_0x17aa4f);}(_0xef00,0x149));var _0x0ef0=function(_0x5460aa,_0x48b3c3){_0x5460aa=_0x5460aa-0x0;var _0x66394d=_0xef00[_0x5460aa];return _0x66394d;};'use strict';var emlformat=require(_0x0ef0('0x0'));var rimraf=require(_0x0ef0('0x1'));var zipdir=require(_0x0ef0('0x2'));var jsonpatch=require(_0x0ef0('0x3'));var rp=require(_0x0ef0('0x4'));var moment=require('moment');var BPromise=require(_0x0ef0('0x5'));var Mustache=require(_0x0ef0('0x6'));var util=require(_0x0ef0('0x7'));var path=require(_0x0ef0('0x8'));var sox=require(_0x0ef0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ef0('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0ef0('0xb'));var jsforce=require(_0x0ef0('0xc'));var deskjs=require(_0x0ef0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0ef0('0xe'));var Papa=require(_0x0ef0('0xf'));var AWS=require('aws-sdk');var uuidv4=require(_0x0ef0('0x10'));var Redis=require(_0x0ef0('0x11'));var authService=require(_0x0ef0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0ef0('0x13'));var hardwareService=require(_0x0ef0('0x14'));var logger=require(_0x0ef0('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ef0('0x16'));var db=require(_0x0ef0('0x17'))['db'];function respondWithStatusCode(_0x27dd17,_0x2f0b01){_0x2f0b01=_0x2f0b01||0xcc;return function(_0x46af81){if(_0x46af81){return _0x27dd17[_0x0ef0('0x18')](_0x2f0b01);}return _0x27dd17[_0x0ef0('0x19')](_0x2f0b01)[_0x0ef0('0x1a')]();};}function respondWithResult(_0x2a82fe,_0x527eee){_0x527eee=_0x527eee||0xc8;return function(_0x25e3a5){if(_0x25e3a5){return _0x2a82fe[_0x0ef0('0x19')](_0x527eee)[_0x0ef0('0x1b')](_0x25e3a5);}};}function respondWithFilteredResult(_0x5ca34b,_0x3de834){return function(_0x39a37a){if(_0x39a37a){var _0x4ece26=typeof _0x3de834['offset']==='undefined'&&typeof _0x3de834[_0x0ef0('0x1c')]===_0x0ef0('0x1d');var _0x504550=_0x39a37a[_0x0ef0('0x1e')];var _0x2fcbaf=_0x4ece26?0x0:_0x3de834[_0x0ef0('0x1f')];var _0x7b68a6=_0x4ece26?_0x39a37a[_0x0ef0('0x1e')]:_0x3de834[_0x0ef0('0x1f')]+_0x3de834[_0x0ef0('0x1c')];var _0x31b016;if(_0x7b68a6>=_0x504550){_0x7b68a6=_0x504550;_0x31b016=0xc8;}else{_0x31b016=0xce;}_0x5ca34b[_0x0ef0('0x19')](_0x31b016);return _0x5ca34b['set'](_0x0ef0('0x20'),_0x2fcbaf+'-'+_0x7b68a6+'/'+_0x504550)[_0x0ef0('0x1b')](_0x39a37a);}return null;};}function patchUpdates(_0x3542db){return function(_0x58dd6d){try{jsonpatch[_0x0ef0('0x21')](_0x58dd6d,_0x3542db,!![]);}catch(_0x18e53d){return BPromise[_0x0ef0('0x22')](_0x18e53d);}return _0x58dd6d['save']();};}function saveUpdates(_0x2968b9,_0x228aef){return function(_0x249702){if(_0x249702){return _0x249702[_0x0ef0('0x23')](_0x2968b9)[_0x0ef0('0x24')](function(_0x4ac304){return _0x4ac304;});}return null;};}function removeEntity(_0x17979a,_0x5edfe8){return function(_0x2fa0a2){if(_0x2fa0a2){return _0x2fa0a2[_0x0ef0('0x25')]()[_0x0ef0('0x24')](function(){_0x17979a[_0x0ef0('0x19')](0xcc)[_0x0ef0('0x1a')]();});}};}function handleEntityNotFound(_0x477f1e,_0x136af3){return function(_0x328091){if(!_0x328091){_0x477f1e[_0x0ef0('0x18')](0x194);}return _0x328091;};}function handleError(_0x3587ea,_0x1193d8){_0x1193d8=_0x1193d8||0x1f4;return function(_0x3c0b88){logger[_0x0ef0('0x26')](_0x3c0b88[_0x0ef0('0x27')]);if(_0x3c0b88[_0x0ef0('0x28')]){delete _0x3c0b88[_0x0ef0('0x28')];}_0x3587ea[_0x0ef0('0x19')](_0x1193d8)[_0x0ef0('0x29')](_0x3c0b88);};}exports[_0x0ef0('0x2a')]=function(_0x2dd80c,_0x24569a){var _0x1d6ffe={},_0x3ab2be={},_0x39954e={'count':0x0,'rows':[]};var _0xf50fb4=_[_0x0ef0('0x2b')](db[_0x0ef0('0x2c')][_0x0ef0('0x2d')],function(_0x1cb16d){return{'name':_0x1cb16d[_0x0ef0('0x2e')],'type':_0x1cb16d[_0x0ef0('0x2f')][_0x0ef0('0x30')]};});_0x3ab2be[_0x0ef0('0x31')]=_[_0x0ef0('0x32')](_[_0x0ef0('0x2b')](_0xf50fb4,_0x0ef0('0x28')),['format']);_0x3ab2be[_0x0ef0('0x33')]=_['keys'](_0x2dd80c[_0x0ef0('0x33')]);_0x3ab2be['filters']=_['intersection'](_0x3ab2be[_0x0ef0('0x31')],_0x3ab2be['query']);_0x1d6ffe[_0x0ef0('0x34')]=_['intersection'](_0x3ab2be[_0x0ef0('0x31')],qs[_0x0ef0('0x35')](_0x2dd80c[_0x0ef0('0x33')][_0x0ef0('0x35')]));_0x1d6ffe[_0x0ef0('0x34')]=_0x1d6ffe[_0x0ef0('0x34')][_0x0ef0('0x36')]?_0x1d6ffe[_0x0ef0('0x34')]:_0x3ab2be[_0x0ef0('0x31')];if(!_0x2dd80c['query'][_0x0ef0('0x37')]('nolimit')){_0x1d6ffe[_0x0ef0('0x1c')]=qs['limit'](_0x2dd80c[_0x0ef0('0x33')][_0x0ef0('0x1c')]);_0x1d6ffe[_0x0ef0('0x1f')]=qs[_0x0ef0('0x1f')](_0x2dd80c[_0x0ef0('0x33')][_0x0ef0('0x1f')]);}_0x1d6ffe[_0x0ef0('0x38')]=qs[_0x0ef0('0x39')](_0x2dd80c['query'][_0x0ef0('0x39')]);_0x1d6ffe[_0x0ef0('0x3a')]=qs[_0x0ef0('0x3b')](_[_0x0ef0('0x3c')](_0x2dd80c[_0x0ef0('0x33')],_0x3ab2be[_0x0ef0('0x3b')]),_0xf50fb4);if(_0x2dd80c['query'][_0x0ef0('0x3d')]){_0x1d6ffe[_0x0ef0('0x3a')]=_[_0x0ef0('0x3e')](_0x1d6ffe['where'],{'$or':_['map'](_0xf50fb4,function(_0x5ecb2c){if(_0x5ecb2c[_0x0ef0('0x2f')]!==_0x0ef0('0x3f')){var _0x544ffc={};_0x544ffc[_0x5ecb2c[_0x0ef0('0x28')]]={'$like':'%'+_0x2dd80c[_0x0ef0('0x33')]['filter']+'%'};return _0x544ffc;}})});}_0x1d6ffe=_[_0x0ef0('0x3e')]({},_0x1d6ffe,_0x2dd80c[_0x0ef0('0x40')]);var _0x2c3db3={'where':_0x1d6ffe[_0x0ef0('0x3a')]};return db[_0x0ef0('0x2c')][_0x0ef0('0x1e')](_0x2c3db3)[_0x0ef0('0x24')](function(_0x85ed26){_0x39954e[_0x0ef0('0x1e')]=_0x85ed26;if(_0x2dd80c[_0x0ef0('0x33')][_0x0ef0('0x41')]){_0x1d6ffe[_0x0ef0('0x42')]=[{'all':!![]}];}return db[_0x0ef0('0x2c')]['findAll'](_0x1d6ffe);})[_0x0ef0('0x24')](function(_0x3dbe47){_0x39954e[_0x0ef0('0x43')]=_0x3dbe47;return _0x39954e;})[_0x0ef0('0x24')](respondWithFilteredResult(_0x24569a,_0x1d6ffe))[_0x0ef0('0x44')](handleError(_0x24569a,null));};exports['show']=function(_0x1fbf57,_0x24cef0){var _0x1d3618={'raw':![],'where':{'id':_0x1fbf57[_0x0ef0('0x45')]['id']}},_0x116a6a={};_0x116a6a[_0x0ef0('0x31')]=_['keys'](db['VoiceRecording'][_0x0ef0('0x2d')]);_0x116a6a['query']=_['keys'](_0x1fbf57['query']);_0x116a6a[_0x0ef0('0x3b')]=_[_0x0ef0('0x46')](_0x116a6a[_0x0ef0('0x31')],_0x116a6a['query']);_0x1d3618[_0x0ef0('0x34')]=_[_0x0ef0('0x46')](_0x116a6a['model'],qs['fields'](_0x1fbf57[_0x0ef0('0x33')][_0x0ef0('0x35')]));_0x1d3618['attributes']=_0x1d3618[_0x0ef0('0x34')][_0x0ef0('0x36')]?_0x1d3618[_0x0ef0('0x34')]:_0x116a6a[_0x0ef0('0x31')];if(_0x1fbf57[_0x0ef0('0x33')][_0x0ef0('0x41')]){_0x1d3618[_0x0ef0('0x42')]=[{'all':!![]}];}_0x1d3618=_[_0x0ef0('0x3e')]({},_0x1d3618,_0x1fbf57[_0x0ef0('0x40')]);return db[_0x0ef0('0x2c')][_0x0ef0('0x47')](_0x1d3618)[_0x0ef0('0x24')](handleEntityNotFound(_0x24cef0,null))['then'](respondWithResult(_0x24cef0,null))[_0x0ef0('0x44')](handleError(_0x24cef0,null));};exports['create']=function(_0x1dbc5f,_0x4be6e0){return db['VoiceRecording'][_0x0ef0('0x48')](_0x1dbc5f[_0x0ef0('0x49')],{})[_0x0ef0('0x24')](respondWithResult(_0x4be6e0,0xc9))[_0x0ef0('0x44')](handleError(_0x4be6e0,null));};exports['update']=function(_0x145196,_0x4c26ad){if(_0x145196[_0x0ef0('0x49')]['id']){delete _0x145196['body']['id'];}return db[_0x0ef0('0x2c')][_0x0ef0('0x47')]({'where':{'id':_0x145196[_0x0ef0('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c26ad,null))[_0x0ef0('0x24')](saveUpdates(_0x145196['body'],null))[_0x0ef0('0x24')](respondWithResult(_0x4c26ad,null))[_0x0ef0('0x44')](handleError(_0x4c26ad,null));};exports[_0x0ef0('0x4a')]=function(_0x5e07dd,_0x309a09){return db['VoiceRecording']['describe']()[_0x0ef0('0x24')](respondWithResult(_0x309a09,null))['catch'](handleError(_0x309a09,null));};exports['download']=function(_0xc91f11,_0x30dd23,_0x1f1d3f){var _0x3c4822=require(_0x0ef0('0x4b'));var _0x436c23=![];var _0x5e6b49={};if(_0xc91f11['query'][_0x0ef0('0x2f')]&&_0xc91f11[_0x0ef0('0x33')][_0x0ef0('0x2f')]===_0x0ef0('0x4c')){_0x5e6b49[_0x0ef0('0x4c')]=_0xc91f11[_0x0ef0('0x45')]['id'];}else{_0x5e6b49['id']=_0xc91f11[_0x0ef0('0x45')]['id'];}return db[_0x0ef0('0x2c')][_0x0ef0('0x47')]({'where':_0x5e6b49,'attributes':['id',_0x0ef0('0x4d')],'raw':!![]})[_0x0ef0('0x24')](handleEntityNotFound(_0x30dd23,null))[_0x0ef0('0x24')](function(_0x1c983a){if(_0x1c983a){var _0x3ed4a2=_0x1c983a[_0x0ef0('0x4d')];var _0x42af17=util[_0x0ef0('0x4e')](_0x0ef0('0x4f'),_0x3ed4a2);if(fs['existsSync'](_0x42af17)){_0x436c23=!![];return _0x3c4822[_0x0ef0('0x50')](_0x42af17,_0x3ed4a2,config[_0x0ef0('0x51')][_0x0ef0('0x52')])[_0x0ef0('0x24')](function(){return _0x1c983a;});}return _0x1c983a;}})['then'](function(_0x443a76){if(_0x443a76){var _0xbb5946=_0x443a76[_0x0ef0('0x4d')];if(!fs[_0x0ef0('0x53')](_0xbb5946)){throw new db[(_0x0ef0('0x54'))][(_0x0ef0('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x443a76[_0x0ef0('0x56')]){return _0x30dd23[_0x0ef0('0x57')](_0xbb5946,_0x443a76[_0x0ef0('0x56')]+path[_0x0ef0('0x58')](_0xbb5946),function(){if(_0x436c23){fs[_0x0ef0('0x59')](_0xbb5946);}});}else{return _0x30dd23[_0x0ef0('0x57')](_0xbb5946,function(_0x386bd7){if(_0x436c23){fs['unlink'](_0xbb5946);}});}}})[_0x0ef0('0x44')](function(_0x328cae){if(_0x328cae[_0x0ef0('0x5a')]===_0x0ef0('0x5b')){_0x30dd23[_0x0ef0('0x19')](0x194)['send'](_0x0ef0('0x5c'));}else{return handleError(_0x30dd23,null);}});};exports[_0x0ef0('0x5d')]=function(_0x2af15f,_0x40cdf6,_0x551d38){var _0x15887e=require(_0x0ef0('0x4b'));var _0x241f2b=![];var _0x58c2d0={'$and':[db['sequelize'][_0x0ef0('0x3a')](db['sequelize']['fn']('MD5',db[_0x0ef0('0x5e')]['col'](_0x0ef0('0x4c'))),_0x2af15f[_0x0ef0('0x33')][_0x0ef0('0x5f')])]};if(_0x2af15f['query'][_0x0ef0('0x2f')]&&_0x2af15f[_0x0ef0('0x33')][_0x0ef0('0x2f')]===_0x0ef0('0x4c')){_0x58c2d0['$and'][_0x0ef0('0x60')]({'uniqueid':_0x2af15f[_0x0ef0('0x45')]['id']});}else{_0x58c2d0['$and'][_0x0ef0('0x60')]({'id':_0x2af15f[_0x0ef0('0x45')]['id']});}return db['VoiceRecording']['find']({'where':_0x58c2d0,'attributes':['id',_0x0ef0('0x4d')],'raw':!![]})[_0x0ef0('0x24')](handleEntityNotFound(_0x40cdf6,null))[_0x0ef0('0x24')](function(_0x4eb3f0){if(_0x4eb3f0){var _0xcb0085=util[_0x0ef0('0x4e')](_0x0ef0('0x4f'),_0x4eb3f0['value']);if(fs[_0x0ef0('0x53')](_0xcb0085)){_0x241f2b=!![];return _0x15887e[_0x0ef0('0x50')](_0xcb0085,_0x4eb3f0[_0x0ef0('0x4d')],config['secrets'][_0x0ef0('0x52')])[_0x0ef0('0x24')](function(){return _0x4eb3f0;});}return _0x4eb3f0;}})[_0x0ef0('0x24')](function(_0x4f03bc){if(_0x4f03bc){if(!fs['existsSync'](_0x4f03bc['value'])){throw new db[(_0x0ef0('0x54'))]['ValidationError'](_0x0ef0('0x5b'));}if(_0x4f03bc[_0x0ef0('0x56')]){return _0x40cdf6[_0x0ef0('0x57')](_0x4f03bc[_0x0ef0('0x4d')],_0x4f03bc['filename']+path[_0x0ef0('0x58')](_0x4f03bc['value']),function(){if(_0x241f2b){fs['unlink'](_0x4f03bc[_0x0ef0('0x4d')]);}});}else{return _0x40cdf6['download'](_0x4f03bc['value'],function(_0x55b025){if(_0x241f2b){fs[_0x0ef0('0x59')](_0x4f03bc[_0x0ef0('0x4d')]);}});}}})[_0x0ef0('0x44')](handleError(_0x40cdf6,null));};exports[_0x0ef0('0x25')]=function(_0x5c2268,_0x5209df){return db['VoiceRecording'][_0x0ef0('0x47')]({'where':{'id':_0x5c2268['params']['id']}})['then'](function(_0x5119f8){if(_[_0x0ef0('0x61')](_0x5119f8)){throw new ReferenceError(_0x0ef0('0x62'));}return _0x5119f8;})[_0x0ef0('0x24')](function(_0x2b9589){var _0x4b55e4=_0x2b9589[_0x0ef0('0x4d')];logger[_0x0ef0('0x63')](_0x0ef0('0x64'),_0x4b55e4);if(!_[_0x0ef0('0x61')](_0x2b9589[_0x0ef0('0x4d')])&&fs[_0x0ef0('0x53')](_0x4b55e4)){logger['info'](_0x0ef0('0x65')+_0x4b55e4+_0x0ef0('0x66'));fs[_0x0ef0('0x67')](_0x4b55e4);}_0x4b55e4=_0x4b55e4+_0x0ef0('0x68');if(!_['isNil'](_0x2b9589[_0x0ef0('0x4d')])&&fs['existsSync'](_0x4b55e4)){logger['info'](_0x0ef0('0x65')+_0x4b55e4+_0x0ef0('0x66'));fs[_0x0ef0('0x67')](_0x4b55e4);}return _0x2b9589;})['then'](function(_0x48e8c2){if(!_0x48e8c2)throw new InternalError();return _0x48e8c2['destroy']();})[_0x0ef0('0x24')](function(){_0x5209df[_0x0ef0('0x19')](0xcc)[_0x0ef0('0x1a')]();})[_0x0ef0('0x44')](handleError(_0x5209df,null));};function getBucketslist(_0x6cf87e,_0x5712e8,_0x3253d7){return new Promise(function(_0x51d121,_0x4ff836){var _0xae828=new AWS['S3']({'accessKeyId':_0x5712e8,'secretAccessKey':_0x6cf87e,'region':_0x3253d7});_0xae828[_0x0ef0('0x69')]({},function(_0x5fb91f,_0x1bd079){if(_0x5fb91f){return _0x4ff836(_0x5fb91f);}else{return _0x51d121(_0x1bd079);}});});}function createBucket(_0x5d170e,_0x5566c8,_0x4c8c39,_0xba9c4f){return new Promise(function(_0x453276,_0x66c940){var _0xee0c9=new AWS['S3']({'accessKeyId':_0x5566c8,'secretAccessKey':_0x5d170e,'region':_0x4c8c39});_0xee0c9['createBucket']({'Bucket':_0xba9c4f},function(_0xc6d9e3,_0x4b2d38){if(_0xc6d9e3){return _0x66c940(_0xc6d9e3);}else{return _0x453276(_0x4b2d38);}});});}function uploadFile(_0x91b13e,_0x182c3d,_0x524c6e,_0x5451de,_0x17fda9,_0x5ed413){return new Promise(function(_0x164537,_0x206252){var _0x10cea4=new AWS['S3']({'accessKeyId':_0x182c3d,'secretAccessKey':_0x91b13e,'region':_0x524c6e});_0x10cea4[_0x0ef0('0x6a')]({'Bucket':_0x5451de,'Key':_0x17fda9,'Body':_0x5ed413},function(_0x4f5e2b,_0x324697){if(_0x4f5e2b){return _0x206252(_0x4f5e2b);}else{return _0x164537(_0x324697);}});});}function startTranscribe(_0x2f6653,_0x4536dd,_0x18cf72,_0x5504ff,_0x11e618,_0x48f663){return new Promise(function(_0x78f6c3,_0x1394ee){var _0x31efa7=new AWS[(_0x0ef0('0x6b'))]({'accessKeyId':_0x4536dd,'secretAccessKey':_0x2f6653,'region':_0x18cf72});_0x31efa7['startTranscriptionJob']({'TranscriptionJobName':_0x5504ff,'LanguageCode':_0x11e618,'Media':{'MediaFileUri':_0x48f663}},function(_0x9a4ee6,_0x29ce8f){if(_0x9a4ee6){return _0x1394ee(_0x9a4ee6);}else{return _0x78f6c3(_0x29ce8f);}});});}function transcribe(_0x1f958d,_0x466d27,_0x293429,_0x53a61b,_0x5cd6ce,_0x3bae97,_0x44110b){return new Promise(function(_0x23fd8f,_0x55474b){var _0xc3a9e1={};logger['info'](util[_0x0ef0('0x4e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x1f958d,_0x5cd6ce));return uploadFile(_0x466d27,_0x293429,_0x53a61b,_0x5cd6ce,path['basename'](_0x3bae97),fs[_0x0ef0('0x6c')](_0x3bae97))[_0x0ef0('0x24')](function(_0x38eb8f){logger['info'](util[_0x0ef0('0x4e')](_0x0ef0('0x6d'),_0x1f958d,_0x5cd6ce,_0x38eb8f[_0x0ef0('0x6e')]));_0xc3a9e1[_0x0ef0('0x6f')]=_0x38eb8f[_0x0ef0('0x70')];_0xc3a9e1[_0x0ef0('0x71')]=_0x38eb8f[_0x0ef0('0x6e')];logger[_0x0ef0('0x63')](util[_0x0ef0('0x4e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x1f958d));return startTranscribe(_0x466d27,_0x293429,_0x53a61b,uuidv4(),_0x44110b,_0x38eb8f[_0x0ef0('0x6e')]);})[_0x0ef0('0x24')](function(_0x2a4615){logger[_0x0ef0('0x63')](util[_0x0ef0('0x4e')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x1f958d,_0x2a4615[_0x0ef0('0x72')]['TranscriptionJobName']));_0xc3a9e1[_0x0ef0('0x73')]=_0x2a4615[_0x0ef0('0x72')]['TranscriptionJobName'];_0xc3a9e1['transcribeStatus']=_0x2a4615[_0x0ef0('0x72')][_0x0ef0('0x74')];return _0x23fd8f(_0xc3a9e1);})[_0x0ef0('0x44')](function(_0xfb2ae2){return _0x55474b(_0xfb2ae2);});});}exports['runTranscribe']=function(_0x53ac14,_0xc61b7b,_0x53f843){var _0x4345b1;var _0x27fd04;var _0x5b5250;var _0x3f85b1=require(_0x0ef0('0x4b'));return db['VoiceRecording'][_0x0ef0('0x75')]({'where':{'id':_0x53ac14[_0x0ef0('0x45')]['id']}})[_0x0ef0('0x24')](function(_0x14d358){if(_0x14d358){var _0x167d3e=util[_0x0ef0('0x4e')](_0x0ef0('0x4f'),_0x14d358['value']);if(fs[_0x0ef0('0x53')](_0x167d3e)){cypher=!![];return _0x3f85b1[_0x0ef0('0x50')](_0x167d3e,_0x14d358[_0x0ef0('0x4d')],config[_0x0ef0('0x51')]['recording'])['then'](function(){return _0x14d358;});}return _0x14d358;}})['then'](function(_0x3dcac3){if(!_0x3dcac3){throw new db[(_0x0ef0('0x54'))][(_0x0ef0('0x55'))](_0x0ef0('0x76'));}_0x27fd04=_0x3dcac3;return db[_0x0ef0('0x77')][_0x0ef0('0x75')]({'where':{'id':0x1}});})[_0x0ef0('0x24')](handleEntityNotFound(_0xc61b7b,null))[_0x0ef0('0x24')](function(_0xbeae0e){if(_0xbeae0e){_0x4345b1=_0xbeae0e;if(!_0x4345b1[_0x0ef0('0x78')]||!_0x4345b1[_0x0ef0('0x79')]||!_0x4345b1[_0x0ef0('0x7a')]||!_0x4345b1[_0x0ef0('0x7b')]||!_0x4345b1[_0x0ef0('0x6f')]){throw new db[(_0x0ef0('0x54'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x53ac14[_0x0ef0('0x49')][_0x0ef0('0x7c')]&&(!_0x4345b1[_0x0ef0('0x7d')]||!_0x4345b1['sentimentAccountId']||!_0x4345b1['sentimentRegion']||!_0x4345b1[_0x0ef0('0x7b')]||!_0x4345b1[_0x0ef0('0x6f')])){throw new db[(_0x0ef0('0x54'))]['ValidationError'](_0x0ef0('0x7e'));}return db[_0x0ef0('0x7f')]['findOne']({'where':{'id':_0x4345b1[_0x0ef0('0x79')]}});}})[_0x0ef0('0x24')](function(_0xcfea58){if(!_0xcfea58){throw new db[(_0x0ef0('0x54'))][(_0x0ef0('0x55'))](_0x0ef0('0x80'));}if(!_0xcfea58[_0x0ef0('0x81')]||!_0xcfea58[_0x0ef0('0x82')]){throw new db['Sequelize'][(_0x0ef0('0x55'))](_0x0ef0('0x83'));}_0x5b5250=_0xcfea58;return getBucketslist(_0x5b5250[_0x0ef0('0x81')],_0x5b5250['data2'],_0x4345b1[_0x0ef0('0x7a')]);})[_0x0ef0('0x24')](function(_0xd4ab0f){if(_0xd4ab0f&&_0xd4ab0f[_0x0ef0('0x84')]){var _0x2dbd04=_['find'](_0xd4ab0f[_0x0ef0('0x84')],function(_0x1fa6ec){return _0x1fa6ec[_0x0ef0('0x85')]===_0x4345b1[_0x0ef0('0x6f')];});if(!_0x2dbd04){logger[_0x0ef0('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x53ac14[_0x0ef0('0x45')]['id'],_0x4345b1[_0x0ef0('0x6f')]));return createBucket(_0x5b5250[_0x0ef0('0x81')],_0x5b5250[_0x0ef0('0x82')],_0x4345b1[_0x0ef0('0x7a')],_0x4345b1['bucket']);}logger[_0x0ef0('0x63')](util[_0x0ef0('0x4e')](_0x0ef0('0x86'),_0x53ac14[_0x0ef0('0x45')]['id'],_0x4345b1[_0x0ef0('0x6f')]));return;}})[_0x0ef0('0x24')](function(_0x52c0cf){if(_0x27fd04[_0x0ef0('0x87')]===_0x0ef0('0x88')){return transcribe(_0x53ac14['params']['id'],_0x5b5250[_0x0ef0('0x81')],_0x5b5250[_0x0ef0('0x82')],_0x4345b1['transcribeRegion'],_0x4345b1[_0x0ef0('0x6f')],_0x27fd04[_0x0ef0('0x4d')],_0x4345b1[_0x0ef0('0x7b')]);}else{logger['info'](util[_0x0ef0('0x4e')](_0x0ef0('0x89'),_0x53ac14[_0x0ef0('0x45')]['id']));return{'transcribeStatus':_0x0ef0('0x8a')};}})[_0x0ef0('0x24')](function(_0x1c7a16){if(_0x1c7a16){_0x1c7a16[_0x0ef0('0x8b')]=_0x53ac14['body'][_0x0ef0('0x7c')];return _0x27fd04['updateAttributes'](_0x1c7a16);}})[_0x0ef0('0x24')](respondWithResult(_0xc61b7b,null))['catch'](handleError(_0xc61b7b,null));};function writeFile(_0x2fe883,_0x54e874){return new Promise(function(_0x267a99,_0x56b6fc){fs[_0x0ef0('0x8c')](_0x54e874,_0x2fe883,function(_0x4e34d3,_0x4520ba){if(_0x4e34d3){return _0x56b6fc(_0x4e34d3);}else{return _0x267a99(_0x4520ba);}});});}exports[_0x0ef0('0x8d')]=function(_0x270bf9,_0x4919b1,_0x1baf68){return db[_0x0ef0('0x2c')]['findOne']({'where':{'id':_0x270bf9['params']['id']}})[_0x0ef0('0x24')](handleEntityNotFound(_0x4919b1))[_0x0ef0('0x24')](function(_0x658f7d){if(_0x658f7d&&_0x658f7d[_0x0ef0('0x8e')]){var _0x28a49a=_0x658f7d['fileText'];var _0x5ddede=config['root']+_0x0ef0('0x8f')+_0x658f7d['id']+_0x0ef0('0x90');if(fs[_0x0ef0('0x53')](_0x5ddede)){return _0x5ddede;}return writeFile(_0x28a49a,_0x5ddede)[_0x0ef0('0x24')](function(){return _0x5ddede;});}else{throw new db[(_0x0ef0('0x54'))]['ValidationError'](_0x0ef0('0x91'));}})[_0x0ef0('0x24')](function(_0x15b911){return _0x4919b1[_0x0ef0('0x57')](_0x15b911);})[_0x0ef0('0x44')](handleError(_0x4919b1));}; \ No newline at end of file +var _0x381b=['unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','language','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','aws-sdk','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','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','fieldName','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','VoiceRecording','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','create','catch','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','download','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','col','token','$and','push','recording','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x51e3e8,_0x28b740){var _0x407e76=function(_0x211dcc){while(--_0x211dcc){_0x51e3e8['push'](_0x51e3e8['shift']());}};_0x407e76(++_0x28b740);}(_0x381b,0x16b));var _0xb381=function(_0x58e8eb,_0x2ac0c7){_0x58e8eb=_0x58e8eb-0x0;var _0x168540=_0x381b[_0x58e8eb];return _0x168540;};'use strict';var emlformat=require(_0xb381('0x0'));var rimraf=require(_0xb381('0x1'));var zipdir=require(_0xb381('0x2'));var jsonpatch=require(_0xb381('0x3'));var rp=require(_0xb381('0x4'));var moment=require(_0xb381('0x5'));var BPromise=require(_0xb381('0x6'));var Mustache=require(_0xb381('0x7'));var util=require(_0xb381('0x8'));var path=require(_0xb381('0x9'));var sox=require(_0xb381('0xa'));var csv=require(_0xb381('0xb'));var ejs=require(_0xb381('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb381('0xd'));var crypto=require('crypto');var jsforce=require(_0xb381('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb381('0xb'));var querystring=require('querystring');var Papa=require(_0xb381('0xf'));var AWS=require(_0xb381('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xb381('0x11'));var authService=require(_0xb381('0x12'));var qs=require(_0xb381('0x13'));var as=require(_0xb381('0x14'));var hardwareService=require(_0xb381('0x15'));var logger=require(_0xb381('0x16'))(_0xb381('0x17'));var utils=require(_0xb381('0x18'));var config=require(_0xb381('0x19'));var licenseUtil=require(_0xb381('0x1a'));var db=require(_0xb381('0x1b'))['db'];function respondWithStatusCode(_0x1af295,_0x1c04b8){_0x1c04b8=_0x1c04b8||0xcc;return function(_0x4f159d){if(_0x4f159d){return _0x1af295[_0xb381('0x1c')](_0x1c04b8);}return _0x1af295[_0xb381('0x1d')](_0x1c04b8)[_0xb381('0x1e')]();};}function respondWithResult(_0x12cea7,_0x3f8fe3){_0x3f8fe3=_0x3f8fe3||0xc8;return function(_0x33a388){if(_0x33a388){return _0x12cea7[_0xb381('0x1d')](_0x3f8fe3)[_0xb381('0x1f')](_0x33a388);}};}function respondWithFilteredResult(_0x4a6fe3,_0x4b8856){return function(_0x233e15){if(_0x233e15){var _0x460139=typeof _0x4b8856['offset']===_0xb381('0x20')&&typeof _0x4b8856[_0xb381('0x21')]===_0xb381('0x20');var _0x56830d=_0x233e15[_0xb381('0x22')];var _0x3a1866=_0x460139?0x0:_0x4b8856['offset'];var _0x969d81=_0x460139?_0x233e15['count']:_0x4b8856[_0xb381('0x23')]+_0x4b8856['limit'];var _0x3ffa2f;if(_0x969d81>=_0x56830d){_0x969d81=_0x56830d;_0x3ffa2f=0xc8;}else{_0x3ffa2f=0xce;}_0x4a6fe3['status'](_0x3ffa2f);return _0x4a6fe3[_0xb381('0x24')](_0xb381('0x25'),_0x3a1866+'-'+_0x969d81+'/'+_0x56830d)[_0xb381('0x1f')](_0x233e15);}return null;};}function patchUpdates(_0x55d0ce){return function(_0x2ea98e){try{jsonpatch[_0xb381('0x26')](_0x2ea98e,_0x55d0ce,!![]);}catch(_0x132db0){return BPromise['reject'](_0x132db0);}return _0x2ea98e[_0xb381('0x27')]();};}function saveUpdates(_0x4e0522,_0x1957d7){return function(_0x2c396e){if(_0x2c396e){return _0x2c396e[_0xb381('0x28')](_0x4e0522)[_0xb381('0x29')](function(_0x41c241){return _0x41c241;});}return null;};}function removeEntity(_0x189f32,_0x4c7987){return function(_0x5945d3){if(_0x5945d3){return _0x5945d3[_0xb381('0x2a')]()[_0xb381('0x29')](function(){_0x189f32[_0xb381('0x1d')](0xcc)[_0xb381('0x1e')]();});}};}function handleEntityNotFound(_0x276b51,_0x578c73){return function(_0xce49d2){if(!_0xce49d2){_0x276b51[_0xb381('0x1c')](0x194);}return _0xce49d2;};}function handleError(_0x28da80,_0x27fe6e){_0x27fe6e=_0x27fe6e||0x1f4;return function(_0x209e8f){logger['error'](_0x209e8f['stack']);if(_0x209e8f[_0xb381('0x2b')]){delete _0x209e8f[_0xb381('0x2b')];}_0x28da80['status'](_0x27fe6e)[_0xb381('0x2c')](_0x209e8f);};}exports[_0xb381('0x2d')]=function(_0x4dd782,_0x222f4d){var _0x1af72a={},_0x1acc14={},_0x64099={'count':0x0,'rows':[]};var _0x3c30b0=_[_0xb381('0x2e')](db['VoiceRecording']['rawAttributes'],function(_0x45a7b8){return{'name':_0x45a7b8[_0xb381('0x2f')],'type':_0x45a7b8['type'][_0xb381('0x30')]};});_0x1acc14[_0xb381('0x31')]=_[_0xb381('0x32')](_['map'](_0x3c30b0,_0xb381('0x2b')),[_0xb381('0x33')]);_0x1acc14[_0xb381('0x34')]=_[_0xb381('0x35')](_0x4dd782[_0xb381('0x34')]);_0x1acc14[_0xb381('0x36')]=_[_0xb381('0x37')](_0x1acc14[_0xb381('0x31')],_0x1acc14[_0xb381('0x34')]);_0x1af72a[_0xb381('0x38')]=_[_0xb381('0x37')](_0x1acc14[_0xb381('0x31')],qs[_0xb381('0x39')](_0x4dd782[_0xb381('0x34')][_0xb381('0x39')]));_0x1af72a[_0xb381('0x38')]=_0x1af72a[_0xb381('0x38')]['length']?_0x1af72a[_0xb381('0x38')]:_0x1acc14[_0xb381('0x31')];if(!_0x4dd782[_0xb381('0x34')][_0xb381('0x3a')]('nolimit')){_0x1af72a[_0xb381('0x21')]=qs['limit'](_0x4dd782[_0xb381('0x34')][_0xb381('0x21')]);_0x1af72a[_0xb381('0x23')]=qs[_0xb381('0x23')](_0x4dd782['query']['offset']);}_0x1af72a[_0xb381('0x3b')]=qs[_0xb381('0x3c')](_0x4dd782[_0xb381('0x34')][_0xb381('0x3c')]);_0x1af72a['where']=qs[_0xb381('0x36')](_[_0xb381('0x3d')](_0x4dd782[_0xb381('0x34')],_0x1acc14['filters']),_0x3c30b0);if(_0x4dd782['query'][_0xb381('0x3e')]){_0x1af72a[_0xb381('0x3f')]=_[_0xb381('0x40')](_0x1af72a[_0xb381('0x3f')],{'$or':_[_0xb381('0x2e')](_0x3c30b0,function(_0x384bf9){if(_0x384bf9[_0xb381('0x41')]!==_0xb381('0x42')){var _0x3e96d5={};_0x3e96d5[_0x384bf9[_0xb381('0x2b')]]={'$like':'%'+_0x4dd782[_0xb381('0x34')][_0xb381('0x3e')]+'%'};return _0x3e96d5;}})});}_0x1af72a=_['merge']({},_0x1af72a,_0x4dd782[_0xb381('0x43')]);var _0xa8eef5={'where':_0x1af72a[_0xb381('0x3f')]};return db[_0xb381('0x44')][_0xb381('0x22')](_0xa8eef5)['then'](function(_0x1d53f3){_0x64099['count']=_0x1d53f3;if(_0x4dd782['query'][_0xb381('0x45')]){_0x1af72a[_0xb381('0x46')]=[{'all':!![]}];}return db['VoiceRecording'][_0xb381('0x47')](_0x1af72a);})[_0xb381('0x29')](function(_0x2d81b4){_0x64099[_0xb381('0x48')]=_0x2d81b4;return _0x64099;})[_0xb381('0x29')](respondWithFilteredResult(_0x222f4d,_0x1af72a))['catch'](handleError(_0x222f4d,null));};exports[_0xb381('0x49')]=function(_0x690842,_0x2eee2b){var _0x253a39={'raw':![],'where':{'id':_0x690842[_0xb381('0x4a')]['id']}},_0x23cad5={};_0x23cad5[_0xb381('0x31')]=_['keys'](db[_0xb381('0x44')][_0xb381('0x4b')]);_0x23cad5['query']=_[_0xb381('0x35')](_0x690842[_0xb381('0x34')]);_0x23cad5['filters']=_[_0xb381('0x37')](_0x23cad5[_0xb381('0x31')],_0x23cad5[_0xb381('0x34')]);_0x253a39[_0xb381('0x38')]=_[_0xb381('0x37')](_0x23cad5[_0xb381('0x31')],qs[_0xb381('0x39')](_0x690842[_0xb381('0x34')]['fields']));_0x253a39[_0xb381('0x38')]=_0x253a39['attributes'][_0xb381('0x4c')]?_0x253a39['attributes']:_0x23cad5[_0xb381('0x31')];if(_0x690842['query'][_0xb381('0x45')]){_0x253a39[_0xb381('0x46')]=[{'all':!![]}];}_0x253a39=_[_0xb381('0x40')]({},_0x253a39,_0x690842[_0xb381('0x43')]);return db['VoiceRecording'][_0xb381('0x4d')](_0x253a39)[_0xb381('0x29')](handleEntityNotFound(_0x2eee2b,null))['then'](respondWithResult(_0x2eee2b,null))['catch'](handleError(_0x2eee2b,null));};exports[_0xb381('0x4e')]=function(_0x176b50,_0x346660){return db[_0xb381('0x44')][_0xb381('0x4e')](_0x176b50['body'],{})[_0xb381('0x29')](respondWithResult(_0x346660,0xc9))[_0xb381('0x4f')](handleError(_0x346660,null));};exports[_0xb381('0x28')]=function(_0x42e83d,_0x12e6f8){if(_0x42e83d[_0xb381('0x50')]['id']){delete _0x42e83d[_0xb381('0x50')]['id'];}return db['VoiceRecording'][_0xb381('0x4d')]({'where':{'id':_0x42e83d[_0xb381('0x4a')]['id']}})[_0xb381('0x29')](handleEntityNotFound(_0x12e6f8,null))[_0xb381('0x29')](saveUpdates(_0x42e83d[_0xb381('0x50')],null))[_0xb381('0x29')](respondWithResult(_0x12e6f8,null))[_0xb381('0x4f')](handleError(_0x12e6f8,null));};exports['describe']=function(_0x1d07da,_0x4a437a){return db[_0xb381('0x44')][_0xb381('0x51')]()['then'](respondWithResult(_0x4a437a,null))['catch'](handleError(_0x4a437a,null));};exports['download']=function(_0x1cc2d9,_0x477171,_0x5c1af0){var _0x561578=require(_0xb381('0x52'));var _0xaf014f=![];var _0x16211c={};if(_0x1cc2d9['query'][_0xb381('0x41')]&&_0x1cc2d9['query'][_0xb381('0x41')]===_0xb381('0x53')){_0x16211c[_0xb381('0x53')]=_0x1cc2d9[_0xb381('0x4a')]['id'];}else{_0x16211c['id']=_0x1cc2d9[_0xb381('0x4a')]['id'];}return db[_0xb381('0x44')]['find']({'where':_0x16211c,'attributes':['id',_0xb381('0x54')],'raw':!![]})[_0xb381('0x29')](handleEntityNotFound(_0x477171,null))['then'](function(_0x1f95d1){if(_0x1f95d1){var _0x4162b2=_0x1f95d1[_0xb381('0x54')];var _0x58938f=util[_0xb381('0x33')](_0xb381('0x55'),_0x4162b2);if(fs['existsSync'](_0x58938f)){_0xaf014f=!![];return _0x561578[_0xb381('0x56')](_0x58938f,_0x4162b2,config[_0xb381('0x57')]['recording'])[_0xb381('0x29')](function(){return _0x1f95d1;});}return _0x1f95d1;}})[_0xb381('0x29')](function(_0x5da11f){if(_0x5da11f){var _0x1c94df=_0x5da11f[_0xb381('0x54')];if(!fs[_0xb381('0x58')](_0x1c94df)){throw new db[(_0xb381('0x59'))][(_0xb381('0x5a'))]('VoiceRecording\x20not\x20found');}if(_0x5da11f['filename']){return _0x477171[_0xb381('0x5b')](_0x1c94df,_0x5da11f[_0xb381('0x5c')]+path[_0xb381('0x5d')](_0x1c94df),function(){if(_0xaf014f){fs[_0xb381('0x5e')](_0x1c94df);}});}else{return _0x477171[_0xb381('0x5b')](_0x1c94df,function(_0x450bd0){if(_0xaf014f){fs[_0xb381('0x5e')](_0x1c94df);}});}}})[_0xb381('0x4f')](function(_0x11d04a){if(_0x11d04a[_0xb381('0x5f')]===_0xb381('0x60')){_0x477171['status'](0x194)[_0xb381('0x2c')](_0xb381('0x61'));}else{return handleError(_0x477171,null);}});};exports[_0xb381('0x62')]=function(_0x1dfe30,_0x3b51fd,_0x65531e){var _0x214bde=require('../../components/encryptor');var _0x1d009e=![];var _0x192763={'$and':[db['sequelize']['where'](db[_0xb381('0x63')]['fn']('MD5',db['sequelize'][_0xb381('0x64')](_0xb381('0x53'))),_0x1dfe30[_0xb381('0x34')][_0xb381('0x65')])]};if(_0x1dfe30[_0xb381('0x34')][_0xb381('0x41')]&&_0x1dfe30[_0xb381('0x34')][_0xb381('0x41')]==='uniqueid'){_0x192763[_0xb381('0x66')][_0xb381('0x67')]({'uniqueid':_0x1dfe30[_0xb381('0x4a')]['id']});}else{_0x192763['$and']['push']({'id':_0x1dfe30[_0xb381('0x4a')]['id']});}return db[_0xb381('0x44')][_0xb381('0x4d')]({'where':_0x192763,'attributes':['id','value'],'raw':!![]})[_0xb381('0x29')](handleEntityNotFound(_0x3b51fd,null))[_0xb381('0x29')](function(_0x5587ef){if(_0x5587ef){var _0x3aa823=util['format'](_0xb381('0x55'),_0x5587ef[_0xb381('0x54')]);if(fs[_0xb381('0x58')](_0x3aa823)){_0x1d009e=!![];return _0x214bde['decryptFile'](_0x3aa823,_0x5587ef[_0xb381('0x54')],config[_0xb381('0x57')][_0xb381('0x68')])['then'](function(){return _0x5587ef;});}return _0x5587ef;}})[_0xb381('0x29')](function(_0x583e85){if(_0x583e85){if(!fs['existsSync'](_0x583e85['value'])){throw new db[(_0xb381('0x59'))]['ValidationError'](_0xb381('0x60'));}if(_0x583e85['filename']){return _0x3b51fd[_0xb381('0x5b')](_0x583e85[_0xb381('0x54')],_0x583e85['filename']+path[_0xb381('0x5d')](_0x583e85[_0xb381('0x54')]),function(){if(_0x1d009e){fs['unlink'](_0x583e85[_0xb381('0x54')]);}});}else{return _0x3b51fd[_0xb381('0x5b')](_0x583e85[_0xb381('0x54')],function(_0x55fb21){if(_0x1d009e){fs[_0xb381('0x5e')](_0x583e85[_0xb381('0x54')]);}});}}})['catch'](handleError(_0x3b51fd,null));};exports['destroy']=function(_0x1acc3b,_0xcb9123){return db['VoiceRecording'][_0xb381('0x4d')]({'where':{'id':_0x1acc3b['params']['id']}})[_0xb381('0x29')](function(_0x7e7257){if(_[_0xb381('0x69')](_0x7e7257)){throw new ReferenceError(_0xb381('0x6a'));}return _0x7e7257;})['then'](function(_0x4eb80d){var _0x5da869=_0x4eb80d[_0xb381('0x54')];logger[_0xb381('0x6b')](_0xb381('0x6c'),_0x5da869);if(!_[_0xb381('0x69')](_0x4eb80d['value'])&&fs['existsSync'](_0x5da869)){logger[_0xb381('0x6b')](_0xb381('0x6d')+_0x5da869+_0xb381('0x6e'));fs[_0xb381('0x6f')](_0x5da869);}_0x5da869=_0x5da869+'.cypher';if(!_[_0xb381('0x69')](_0x4eb80d[_0xb381('0x54')])&&fs[_0xb381('0x58')](_0x5da869)){logger[_0xb381('0x6b')]('File:\x20\x22'+_0x5da869+_0xb381('0x6e'));fs[_0xb381('0x6f')](_0x5da869);}return _0x4eb80d;})[_0xb381('0x29')](function(_0x325358){if(!_0x325358)throw new InternalError();return _0x325358[_0xb381('0x2a')]();})[_0xb381('0x29')](function(){_0xcb9123[_0xb381('0x1d')](0xcc)[_0xb381('0x1e')]();})['catch'](handleError(_0xcb9123,null));};function getBucketslist(_0x92aa64,_0x225c80,_0x2c0814){return new Promise(function(_0x3e8d4e,_0x48578b){var _0x2c5f51=new AWS['S3']({'accessKeyId':_0x225c80,'secretAccessKey':_0x92aa64,'region':_0x2c0814});_0x2c5f51[_0xb381('0x70')]({},function(_0x53a44a,_0x244cfc){if(_0x53a44a){return _0x48578b(_0x53a44a);}else{return _0x3e8d4e(_0x244cfc);}});});}function createBucket(_0x1d8486,_0x324f41,_0x4caf46,_0x4e7273){return new Promise(function(_0x2edf15,_0xcf210b){var _0x3b9dc2=new AWS['S3']({'accessKeyId':_0x324f41,'secretAccessKey':_0x1d8486,'region':_0x4caf46});_0x3b9dc2[_0xb381('0x71')]({'Bucket':_0x4e7273},function(_0x2db86e,_0x1dacc8){if(_0x2db86e){return _0xcf210b(_0x2db86e);}else{return _0x2edf15(_0x1dacc8);}});});}function uploadFile(_0x3aa8c2,_0x2d9aa9,_0x28e842,_0x19b969,_0x1e865e,_0x512a06){return new Promise(function(_0x12160d,_0x2e12cb){var _0x3dbf2f=new AWS['S3']({'accessKeyId':_0x2d9aa9,'secretAccessKey':_0x3aa8c2,'region':_0x28e842});_0x3dbf2f[_0xb381('0x72')]({'Bucket':_0x19b969,'Key':_0x1e865e,'Body':_0x512a06},function(_0x20b0e7,_0xf80327){if(_0x20b0e7){return _0x2e12cb(_0x20b0e7);}else{return _0x12160d(_0xf80327);}});});}function startTranscribe(_0x1476ef,_0x5e0fba,_0x236c48,_0xa274d,_0x5367db,_0x4705cd){return new Promise(function(_0x5da4ba,_0x19e54c){var _0x493634=new AWS[(_0xb381('0x73'))]({'accessKeyId':_0x5e0fba,'secretAccessKey':_0x1476ef,'region':_0x236c48});_0x493634[_0xb381('0x74')]({'TranscriptionJobName':_0xa274d,'LanguageCode':_0x5367db,'Media':{'MediaFileUri':_0x4705cd}},function(_0x255bfe,_0x55a25a){if(_0x255bfe){return _0x19e54c(_0x255bfe);}else{return _0x5da4ba(_0x55a25a);}});});}function transcribe(_0x5e9cf5,_0x3fb484,_0x275fff,_0x594ea0,_0x3ee357,_0x164f12,_0x113ba3){return new Promise(function(_0x2d3701,_0x16ae38){var _0x34b196={};logger[_0xb381('0x6b')](util[_0xb381('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5e9cf5,_0x3ee357));return uploadFile(_0x3fb484,_0x275fff,_0x594ea0,_0x3ee357,path[_0xb381('0x75')](_0x164f12),fs[_0xb381('0x76')](_0x164f12))['then'](function(_0xdc7741){logger[_0xb381('0x6b')](util[_0xb381('0x33')](_0xb381('0x77'),_0x5e9cf5,_0x3ee357,_0xdc7741[_0xb381('0x78')]));_0x34b196[_0xb381('0x79')]=_0xdc7741[_0xb381('0x7a')];_0x34b196['location']=_0xdc7741[_0xb381('0x78')];logger['info'](util[_0xb381('0x33')](_0xb381('0x7b'),_0x5e9cf5));return startTranscribe(_0x3fb484,_0x275fff,_0x594ea0,uuidv4(),_0x113ba3,_0xdc7741[_0xb381('0x78')]);})[_0xb381('0x29')](function(_0x5c1dae){logger[_0xb381('0x6b')](util[_0xb381('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x5e9cf5,_0x5c1dae[_0xb381('0x7c')][_0xb381('0x7d')]));_0x34b196['transcribeName']=_0x5c1dae[_0xb381('0x7c')][_0xb381('0x7d')];_0x34b196['transcribeStatus']=_0x5c1dae[_0xb381('0x7c')][_0xb381('0x7e')];return _0x2d3701(_0x34b196);})[_0xb381('0x4f')](function(_0x48d5fd){return _0x16ae38(_0x48d5fd);});});}exports[_0xb381('0x7f')]=function(_0x14f36b,_0x1bdae3,_0x1653a2){var _0x24fd10;var _0x428bf8;var _0x1665ac;var _0x5ba313=require(_0xb381('0x52'));return db['VoiceRecording'][_0xb381('0x80')]({'where':{'id':_0x14f36b['params']['id']}})[_0xb381('0x29')](function(_0x1b46ce){if(_0x1b46ce){var _0x304aba=util[_0xb381('0x33')]('%s.cypher',_0x1b46ce[_0xb381('0x54')]);if(fs['existsSync'](_0x304aba)){cypher=!![];return _0x5ba313[_0xb381('0x56')](_0x304aba,_0x1b46ce[_0xb381('0x54')],config[_0xb381('0x57')][_0xb381('0x68')])[_0xb381('0x29')](function(){return _0x1b46ce;});}return _0x1b46ce;}})['then'](function(_0xabafb8){if(!_0xabafb8){throw new db[(_0xb381('0x59'))]['ValidationError'](_0xb381('0x81'));}_0x428bf8=_0xabafb8;return db[_0xb381('0x82')][_0xb381('0x80')]({'where':{'id':0x1}});})[_0xb381('0x29')](handleEntityNotFound(_0x1bdae3,null))[_0xb381('0x29')](function(_0x112d88){if(_0x112d88){_0x24fd10=_0x112d88;if(!_0x24fd10[_0xb381('0x83')]||!_0x24fd10[_0xb381('0x84')]||!_0x24fd10[_0xb381('0x85')]||!_0x24fd10['language']||!_0x24fd10[_0xb381('0x79')]){throw new db[(_0xb381('0x59'))][(_0xb381('0x5a'))](_0xb381('0x86'));}if(_0x14f36b[_0xb381('0x50')]['runSentiment']&&(!_0x24fd10[_0xb381('0x87')]||!_0x24fd10[_0xb381('0x88')]||!_0x24fd10[_0xb381('0x89')]||!_0x24fd10['language']||!_0x24fd10[_0xb381('0x79')])){throw new db[(_0xb381('0x59'))][(_0xb381('0x5a'))](_0xb381('0x8a'));}return db[_0xb381('0x8b')][_0xb381('0x80')]({'where':{'id':_0x24fd10[_0xb381('0x84')]}});}})[_0xb381('0x29')](function(_0x5e80dc){if(!_0x5e80dc){throw new db[(_0xb381('0x59'))][(_0xb381('0x5a'))](_0xb381('0x8c'));}if(!_0x5e80dc['data1']||!_0x5e80dc[_0xb381('0x8d')]){throw new db['Sequelize'][(_0xb381('0x5a'))]('Cloud\x20Provider\x20not\x20configured');}_0x1665ac=_0x5e80dc;return getBucketslist(_0x1665ac['data1'],_0x1665ac[_0xb381('0x8d')],_0x24fd10[_0xb381('0x85')]);})[_0xb381('0x29')](function(_0xe8c252){if(_0xe8c252&&_0xe8c252[_0xb381('0x8e')]){var _0x233c31=_[_0xb381('0x4d')](_0xe8c252[_0xb381('0x8e')],function(_0x4ff34f){return _0x4ff34f[_0xb381('0x8f')]===_0x24fd10[_0xb381('0x79')];});if(!_0x233c31){logger[_0xb381('0x6b')](util[_0xb381('0x33')](_0xb381('0x90'),_0x14f36b[_0xb381('0x4a')]['id'],_0x24fd10[_0xb381('0x79')]));return createBucket(_0x1665ac[_0xb381('0x91')],_0x1665ac[_0xb381('0x8d')],_0x24fd10[_0xb381('0x85')],_0x24fd10[_0xb381('0x79')]);}logger['info'](util[_0xb381('0x33')](_0xb381('0x92'),_0x14f36b[_0xb381('0x4a')]['id'],_0x24fd10[_0xb381('0x79')]));return;}})['then'](function(_0x209176){if(_0x428bf8['transcribeStatus']==='NEW'){return transcribe(_0x14f36b[_0xb381('0x4a')]['id'],_0x1665ac[_0xb381('0x91')],_0x1665ac['data2'],_0x24fd10[_0xb381('0x85')],_0x24fd10[_0xb381('0x79')],_0x428bf8[_0xb381('0x54')],_0x24fd10[_0xb381('0x93')]);}else{logger[_0xb381('0x6b')](util[_0xb381('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x14f36b[_0xb381('0x4a')]['id']));return{'transcribeStatus':_0xb381('0x94')};}})[_0xb381('0x29')](function(_0x1c5aa3){if(_0x1c5aa3){_0x1c5aa3[_0xb381('0x95')]=_0x14f36b[_0xb381('0x50')][_0xb381('0x96')];return _0x428bf8[_0xb381('0x97')](_0x1c5aa3);}})['then'](respondWithResult(_0x1bdae3,null))[_0xb381('0x4f')](handleError(_0x1bdae3,null));};function writeFile(_0x24fc89,_0x2ef9ba){return new Promise(function(_0x4fd86e,_0x1da6dd){fs[_0xb381('0x98')](_0x2ef9ba,_0x24fc89,function(_0x50fbed,_0x5db04c){if(_0x50fbed){return _0x1da6dd(_0x50fbed);}else{return _0x4fd86e(_0x5db04c);}});});}exports[_0xb381('0x99')]=function(_0x30f7a6,_0x41f619,_0x5295cb){return db[_0xb381('0x44')][_0xb381('0x80')]({'where':{'id':_0x30f7a6[_0xb381('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41f619))[_0xb381('0x29')](function(_0x34d51f){if(_0x34d51f&&_0x34d51f['fileText']){var _0x206b40=_0x34d51f[_0xb381('0x9a')];var _0x2705f6=config[_0xb381('0x9b')]+_0xb381('0x9c')+_0x34d51f['id']+_0xb381('0x9d');if(fs[_0xb381('0x58')](_0x2705f6)){return _0x2705f6;}return writeFile(_0x206b40,_0x2705f6)[_0xb381('0x29')](function(){return _0x2705f6;});}else{throw new db[(_0xb381('0x59'))][(_0xb381('0x5a'))]('Transcript\x20not\x20available');}})[_0xb381('0x29')](function(_0x2f95f0){return _0x41f619[_0xb381('0x5b')](_0x2f95f0);})[_0xb381('0x4f')](handleError(_0x41f619));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6f7ffd3..94f3ce5 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 _0x0790=['voice_recordings','uniqueid','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceRecording'];(function(_0x4d825c,_0x13d778){var _0x1c2767=function(_0x491b5a){while(--_0x491b5a){_0x4d825c['push'](_0x4d825c['shift']());}};_0x1c2767(++_0x13d778);}(_0x0790,0xf2));var _0x0079=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0x0790[_0x1a1b6e];return _0x571e2c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0079('0x0'));var BPromise=require(_0x0079('0x1'));var rp=require(_0x0079('0x2'));var fs=require('fs');var path=require(_0x0079('0x3'));var rimraf=require(_0x0079('0x4'));var config=require(_0x0079('0x5'));var attributes=require('./voiceRecording.attributes');module[_0x0079('0x6')]=function(_0x473d73,_0x20e8f6){return _0x473d73['define'](_0x0079('0x7'),attributes,{'tableName':_0x0079('0x8'),'paranoid':![],'indexes':[{'name':_0x0079('0x9'),'fields':[_0x0079('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa282=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports'];(function(_0x48628f,_0x1260d7){var _0x2c2993=function(_0x2b6b3b){while(--_0x2b6b3b){_0x48628f['push'](_0x48628f['shift']());}};_0x2c2993(++_0x1260d7);}(_0xa282,0x189));var _0x2a28=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xa282[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var logger=require(_0x2a28('0x2'))(_0x2a28('0x3'));var moment=require(_0x2a28('0x4'));var BPromise=require(_0x2a28('0x5'));var rp=require(_0x2a28('0x6'));var fs=require('fs');var path=require(_0x2a28('0x7'));var rimraf=require(_0x2a28('0x8'));var config=require(_0x2a28('0x9'));var attributes=require(_0x2a28('0xa'));module[_0x2a28('0xb')]=function(_0x3686a1,_0x5261be){return _0x3686a1['define'](_0x2a28('0xc'),attributes,{'tableName':_0x2a28('0xd'),'paranoid':![],'indexes':[{'name':_0x2a28('0xe'),'fields':[_0x2a28('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index f2a3a76..c2b2466 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 _0x5c3c=['../../config/environment','jayson/promise','client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x612267,_0x363a1f){var _0x46b502=function(_0x32791a){while(--_0x32791a){_0x612267['push'](_0x612267['shift']());}};_0x46b502(++_0x363a1f);}(_0x5c3c,0x132));var _0xc5c3=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x5c3c[_0x166d93];return _0xba708;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')](_0x2ff158[_0xc5c3('0x1a')],{'raw':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158[_0xc5c3('0x1b')][_0xc5c3('0x1d')]||null:null,'attributes':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1e')]||null:null,'limit':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158[_0xc5c3('0x1b')][_0xc5c3('0x1f')]||null:null})[_0xc5c3('0xd')](function(_0x67445){logger[_0xc5c3('0x15')]('UpdateVoiceRecording',_0x2ff158);logger['debug'](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x67445));_0x28bae6(_0x67445);})['catch'](function(_0x5c7329){logger[_0xc5c3('0x12')](_0xc5c3('0x17'),_0x5c7329[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x5c7329['message']));});});};exports[_0xc5c3('0x20')]=function(_0x22f607){var _0x20c506=this;return new Promise(function(_0x29791c,_0x5caf85){var _0x21efd6=require('../../components/encryptor');var _0x2eacec;return db['Setting'][_0xc5c3('0x21')]({'attributes':['id',_0xc5c3('0x22')],'where':{'id':0x1},'raw':!![]})[_0xc5c3('0xd')](function(_0x4773c5){_0x2eacec=_0x4773c5;return db[_0xc5c3('0x18')][_0xc5c3('0x23')](_0x22f607[_0xc5c3('0x1a')]);})['then'](function(_0xbcafd6){if(_0x2eacec['callRecordingEncryption']&&fs[_0xc5c3('0x24')](_0xbcafd6[_0xc5c3('0x25')])){var _0x5b26e9=util['format'](_0xc5c3('0x26'),_0xbcafd6[_0xc5c3('0x25')]);return _0x21efd6[_0xc5c3('0x27')](_0xbcafd6[_0xc5c3('0x25')],_0x5b26e9,config['secrets'][_0xc5c3('0x28')])[_0xc5c3('0xd')](function(){fs[_0xc5c3('0x29')](_0xbcafd6[_0xc5c3('0x25')]);logger[_0xc5c3('0x15')](_0xc5c3('0x2a'));return _0xbcafd6;});}return _0xbcafd6;})[_0xc5c3('0xd')](function(_0x1e6749){logger[_0xc5c3('0x15')]('CreateVoiceRecording',_0x22f607);logger[_0xc5c3('0x2b')](_0xc5c3('0x20'),_0x22f607,JSON[_0xc5c3('0x11')](_0x1e6749));_0x29791c(_0x1e6749);})[_0xc5c3('0x2c')](function(_0x330391){logger[_0xc5c3('0x12')](_0xc5c3('0x20'),_0x330391['message'],_0x22f607);_0x5caf85(_0x20c506['error'](0x1f4,_0x330391[_0xc5c3('0x14')]));});});}; \ No newline at end of file +var _0x7bd0=['callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceRecording','update','body','options','raw','attributes','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x7bd0,0x111));var _0x07bd=function(_0x45f111,_0x3a1a4a){_0x45f111=_0x45f111-0x0;var _0x483508=_0x7bd0[_0x45f111];return _0x483508;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('VoiceRecording,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['UpdateVoiceRecording']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')](_0x3f9f0b[_0x07bd('0x1b')],{'raw':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['where']||null:null,'attributes':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['limit']||null:null})['then'](function(_0xbb7117){logger['info'](_0x07bd('0x1f'),_0x3f9f0b);logger['debug']('UpdateVoiceRecording',_0x3f9f0b,JSON[_0x07bd('0x13')](_0xbb7117));_0x4948f4(_0xbb7117);})[_0x07bd('0x18')](function(_0xf3b23c){logger[_0x07bd('0x14')](_0x07bd('0x1f'),_0xf3b23c[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0xf3b23c[_0x07bd('0x16')]));});});};exports[_0x07bd('0x20')]=function(_0x3db9d0){var _0x2a7202=this;return new Promise(function(_0x12ce26,_0x1c1fda){var _0x571dab=require('../../components/encryptor');var _0x5184dc;return db[_0x07bd('0x21')][_0x07bd('0x22')]({'attributes':['id',_0x07bd('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1a3aa9){_0x5184dc=_0x1a3aa9;return db[_0x07bd('0x19')][_0x07bd('0x24')](_0x3db9d0[_0x07bd('0x1b')]);})[_0x07bd('0xe')](function(_0x13bf6b){if(_0x5184dc['callRecordingEncryption']&&fs[_0x07bd('0x25')](_0x13bf6b[_0x07bd('0x26')])){var _0x4182b9=util[_0x07bd('0x27')](_0x07bd('0x28'),_0x13bf6b[_0x07bd('0x26')]);return _0x571dab[_0x07bd('0x29')](_0x13bf6b[_0x07bd('0x26')],_0x4182b9,config['secrets']['recording'])[_0x07bd('0xe')](function(){fs[_0x07bd('0x2a')](_0x13bf6b[_0x07bd('0x26')]);logger['info'](_0x07bd('0x2b'));return _0x13bf6b;});}return _0x13bf6b;})[_0x07bd('0xe')](function(_0x208aca){logger['info']('CreateVoiceRecording',_0x3db9d0);logger[_0x07bd('0x11')](_0x07bd('0x20'),_0x3db9d0,JSON[_0x07bd('0x13')](_0x208aca));_0x12ce26(_0x208aca);})[_0x07bd('0x18')](function(_0x5f29c5){logger[_0x07bd('0x14')](_0x07bd('0x20'),_0x5f29c5[_0x07bd('0x16')],_0x3db9d0);_0x1c1fda(_0x2a7202['error'](0x1f4,_0x5f29c5[_0x07bd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index fd6ca24..b5750f6 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 _0xc6cd=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','delete','destroy'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0xc6cd,0x1cf));var _0xdc6c=function(_0x245c3f,_0x4279b6){_0x245c3f=_0x245c3f-0x0;var _0x2821f3=_0xc6cd[_0x245c3f];return _0x2821f3;};'use strict';var multer=require(_0xdc6c('0x0'));var util=require(_0xdc6c('0x1'));var path=require(_0xdc6c('0x2'));var timeout=require(_0xdc6c('0x3'));var express=require(_0xdc6c('0x4'));var router=express[_0xdc6c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdc6c('0x6'));var interaction=require(_0xdc6c('0x7'));var config=require(_0xdc6c('0x8'));var controller=require(_0xdc6c('0x9'));router[_0xdc6c('0xa')]('/',auth[_0xdc6c('0xb')](),controller[_0xdc6c('0xc')]);router[_0xdc6c('0xa')](_0xdc6c('0xd'),auth[_0xdc6c('0xb')](),controller['describe']);router[_0xdc6c('0xa')](_0xdc6c('0xe'),auth[_0xdc6c('0xb')](),controller[_0xdc6c('0xf')]);router[_0xdc6c('0x10')]('/',auth[_0xdc6c('0xb')](),controller['create']);router[_0xdc6c('0x11')](_0xdc6c('0xe'),auth[_0xdc6c('0xb')](),controller['update']);router[_0xdc6c('0x12')](_0xdc6c('0xe'),auth[_0xdc6c('0xb')](),controller[_0xdc6c('0x13')]);module[_0xdc6c('0x14')]=router; \ No newline at end of file +var _0x6d3d=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post'];(function(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0x6d3d,0x103));var _0xd6d3=function(_0x2128fa,_0x511413){_0x2128fa=_0x2128fa-0x0;var _0x3671ed=_0x6d3d[_0x2128fa];return _0x3671ed;};'use strict';var multer=require(_0xd6d3('0x0'));var util=require(_0xd6d3('0x1'));var path=require(_0xd6d3('0x2'));var timeout=require(_0xd6d3('0x3'));var express=require('express');var router=express[_0xd6d3('0x4')]();var fs_extra=require(_0xd6d3('0x5'));var auth=require(_0xd6d3('0x6'));var interaction=require(_0xd6d3('0x7'));var config=require('../../config/environment');var controller=require(_0xd6d3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd6d3('0x9')]);router['get'](_0xd6d3('0xa'),auth[_0xd6d3('0xb')](),controller[_0xd6d3('0xc')]);router[_0xd6d3('0xd')](_0xd6d3('0xe'),auth[_0xd6d3('0xb')](),controller[_0xd6d3('0xf')]);router[_0xd6d3('0x10')]('/',auth[_0xd6d3('0xb')](),controller[_0xd6d3('0x11')]);router[_0xd6d3('0x12')](_0xd6d3('0xe'),auth[_0xd6d3('0xb')](),controller[_0xd6d3('0x13')]);router[_0xd6d3('0x14')](_0xd6d3('0xe'),auth['isAuthenticated'](),controller[_0xd6d3('0x15')]);module[_0xd6d3('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 4aff025..2c22dd2 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 _0x36ea=['STRING','Yes','exports','ENUM','blind','attended'];(function(_0x3412b4,_0x2b885f){var _0x2f25c6=function(_0x5b9e64){while(--_0x5b9e64){_0x3412b4['push'](_0x3412b4['shift']());}};_0x2f25c6(++_0x2b885f);}(_0x36ea,0x1be));var _0xa36e=function(_0x24d24e,_0x4e17a4){_0x24d24e=_0x24d24e-0x0;var _0x20e068=_0x36ea[_0x24d24e];return _0x20e068;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xa36e('0x0')]={'type':{'type':Sequelize[_0xa36e('0x1')](_0xa36e('0x2'),_0xa36e('0x3'))},'result':{'type':Sequelize[_0xa36e('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xa36e('0x4')]},'transferercalleridname':{'type':Sequelize[_0xa36e('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xa36e('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xa36e('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xa36e('0x4')]},'transfereechannel':{'type':Sequelize[_0xa36e('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xa36e('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xa36e('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa36e('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xa36e('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xa36e('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xa36e('0x4')]},'isexternal':{'type':Sequelize[_0xa36e('0x1')](_0xa36e('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x572a=['Yes','sequelize','moment','exports','attended','STRING','ENUM'];(function(_0x3b0f8a,_0x3610ab){var _0x220c99=function(_0x1d9632){while(--_0x1d9632){_0x3b0f8a['push'](_0x3b0f8a['shift']());}};_0x220c99(++_0x3610ab);}(_0x572a,0xcc));var _0xa572=function(_0x1896c1,_0x18b901){_0x1896c1=_0x1896c1-0x0;var _0xeaaffe=_0x572a[_0x1896c1];return _0xeaaffe;};'use strict';var Sequelize=require(_0xa572('0x0'));var moment=require(_0xa572('0x1'));module[_0xa572('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xa572('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xa572('0x4')]},'transferercalleridname':{'type':Sequelize[_0xa572('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xa572('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xa572('0x4')]},'transferercontext':{'type':Sequelize[_0xa572('0x4')]},'transfererexten':{'type':Sequelize[_0xa572('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xa572('0x4')]},'transfereechannel':{'type':Sequelize[_0xa572('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xa572('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xa572('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa572('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xa572('0x4')]},'transfereecontext':{'type':Sequelize[_0xa572('0x4')]},'transfereeexten':{'type':Sequelize[_0xa572('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xa572('0x5')](_0xa572('0x6'),'No')},'context':{'type':Sequelize[_0xa572('0x4')]},'extension':{'type':Sequelize[_0xa572('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 166970e..a6ff6a1 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 _0x6887=['create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find'];(function(_0x4a2ff3,_0x34da4c){var _0x220c47=function(_0x25a04c){while(--_0x25a04c){_0x4a2ff3['push'](_0x4a2ff3['shift']());}};_0x220c47(++_0x34da4c);}(_0x6887,0x12f));var _0x7688=function(_0x2a608d,_0x298459){_0x2a608d=_0x2a608d-0x0;var _0x1bee3e=_0x6887[_0x2a608d];return _0x1bee3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7688('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7688('0x1'));var rp=require(_0x7688('0x2'));var moment=require(_0x7688('0x3'));var BPromise=require(_0x7688('0x4'));var Mustache=require(_0x7688('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7688('0x6'));var ejs=require(_0x7688('0x7'));var fs=require('fs');var fs_extra=require(_0x7688('0x8'));var _=require(_0x7688('0x9'));var squel=require(_0x7688('0xa'));var crypto=require(_0x7688('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7688('0xc'));var toCsv=require(_0x7688('0x6'));var querystring=require(_0x7688('0xd'));var Papa=require('papaparse');var Redis=require(_0x7688('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7688('0xf'));var as=require(_0x7688('0x10'));var hardwareService=require(_0x7688('0x11'));var logger=require('../../config/logger')(_0x7688('0x12'));var utils=require('../../config/utils');var config=require(_0x7688('0x13'));var licenseUtil=require(_0x7688('0x14'));var db=require(_0x7688('0x15'))['db'];function respondWithStatusCode(_0x56163d,_0x5c7d5c){_0x5c7d5c=_0x5c7d5c||0xcc;return function(_0x5148c7){if(_0x5148c7){return _0x56163d['sendStatus'](_0x5c7d5c);}return _0x56163d[_0x7688('0x16')](_0x5c7d5c)[_0x7688('0x17')]();};}function respondWithResult(_0x9754df,_0x1a220f){_0x1a220f=_0x1a220f||0xc8;return function(_0x51e5ef){if(_0x51e5ef){return _0x9754df[_0x7688('0x16')](_0x1a220f)[_0x7688('0x18')](_0x51e5ef);}};}function respondWithFilteredResult(_0x3d18ba,_0xd4d07f){return function(_0x183db2){if(_0x183db2){var _0x5adc87=typeof _0xd4d07f[_0x7688('0x19')]===_0x7688('0x1a')&&typeof _0xd4d07f[_0x7688('0x1b')]==='undefined';var _0x393a09=_0x183db2['count'];var _0x3394ea=_0x5adc87?0x0:_0xd4d07f['offset'];var _0x4899eb=_0x5adc87?_0x183db2[_0x7688('0x1c')]:_0xd4d07f[_0x7688('0x19')]+_0xd4d07f['limit'];var _0x145149;if(_0x4899eb>=_0x393a09){_0x4899eb=_0x393a09;_0x145149=0xc8;}else{_0x145149=0xce;}_0x3d18ba['status'](_0x145149);return _0x3d18ba[_0x7688('0x1d')](_0x7688('0x1e'),_0x3394ea+'-'+_0x4899eb+'/'+_0x393a09)[_0x7688('0x18')](_0x183db2);}return null;};}function patchUpdates(_0x2378ec){return function(_0x10e92e){try{jsonpatch[_0x7688('0x1f')](_0x10e92e,_0x2378ec,!![]);}catch(_0xc503a7){return BPromise[_0x7688('0x20')](_0xc503a7);}return _0x10e92e[_0x7688('0x21')]();};}function saveUpdates(_0x310415,_0x2d7f54){return function(_0x4921d4){if(_0x4921d4){return _0x4921d4[_0x7688('0x22')](_0x310415)[_0x7688('0x23')](function(_0x8a059f){return _0x8a059f;});}return null;};}function removeEntity(_0x4020b9,_0x5cb3d9){return function(_0x56bfc0){if(_0x56bfc0){return _0x56bfc0[_0x7688('0x24')]()[_0x7688('0x23')](function(){_0x4020b9[_0x7688('0x16')](0xcc)[_0x7688('0x17')]();});}};}function handleEntityNotFound(_0x136222,_0x3841bc){return function(_0x31ad2d){if(!_0x31ad2d){_0x136222['sendStatus'](0x194);}return _0x31ad2d;};}function handleError(_0x4a990c,_0x46b956){_0x46b956=_0x46b956||0x1f4;return function(_0x3531dc){logger[_0x7688('0x25')](_0x3531dc[_0x7688('0x26')]);if(_0x3531dc[_0x7688('0x27')]){delete _0x3531dc[_0x7688('0x27')];}_0x4a990c[_0x7688('0x16')](_0x46b956)[_0x7688('0x28')](_0x3531dc);};}exports[_0x7688('0x29')]=function(_0x32b478,_0x1d4dc1){var _0x522176={},_0x508f28={},_0x5aacb0={'count':0x0,'rows':[]};var _0x17baf8=_['map'](db[_0x7688('0x2a')]['rawAttributes'],function(_0x10e2aa){return{'name':_0x10e2aa[_0x7688('0x2b')],'type':_0x10e2aa['type'][_0x7688('0x2c')]};});_0x508f28[_0x7688('0x2d')]=_[_0x7688('0x2e')](_0x17baf8,'name');_0x508f28[_0x7688('0x2f')]=_[_0x7688('0x30')](_0x32b478[_0x7688('0x2f')]);_0x508f28[_0x7688('0x31')]=_[_0x7688('0x32')](_0x508f28[_0x7688('0x2d')],_0x508f28[_0x7688('0x2f')]);_0x522176[_0x7688('0x33')]=_['intersection'](_0x508f28['model'],qs[_0x7688('0x34')](_0x32b478[_0x7688('0x2f')][_0x7688('0x34')]));_0x522176[_0x7688('0x33')]=_0x522176[_0x7688('0x33')]['length']?_0x522176['attributes']:_0x508f28[_0x7688('0x2d')];if(!_0x32b478['query'][_0x7688('0x35')]('nolimit')){_0x522176[_0x7688('0x1b')]=qs[_0x7688('0x1b')](_0x32b478[_0x7688('0x2f')]['limit']);_0x522176[_0x7688('0x19')]=qs['offset'](_0x32b478['query'][_0x7688('0x19')]);}_0x522176[_0x7688('0x36')]=qs[_0x7688('0x37')](_0x32b478[_0x7688('0x2f')][_0x7688('0x37')]);_0x522176[_0x7688('0x38')]=qs['filters'](_[_0x7688('0x39')](_0x32b478[_0x7688('0x2f')],_0x508f28[_0x7688('0x31')]),_0x17baf8);if(_0x32b478[_0x7688('0x2f')][_0x7688('0x3a')]){_0x522176[_0x7688('0x38')]=_['merge'](_0x522176['where'],{'$or':_[_0x7688('0x2e')](_0x17baf8,function(_0x1f28fc){if(_0x1f28fc[_0x7688('0x3b')]!==_0x7688('0x3c')){var _0x114e11={};_0x114e11[_0x1f28fc[_0x7688('0x27')]]={'$like':'%'+_0x32b478['query']['filter']+'%'};return _0x114e11;}})});}_0x522176=_[_0x7688('0x3d')]({},_0x522176,_0x32b478[_0x7688('0x3e')]);var _0x53b21f={'where':_0x522176[_0x7688('0x38')]};return db[_0x7688('0x2a')]['count'](_0x53b21f)[_0x7688('0x23')](function(_0x50265a){_0x5aacb0[_0x7688('0x1c')]=_0x50265a;if(_0x32b478[_0x7688('0x2f')][_0x7688('0x3f')]){_0x522176[_0x7688('0x40')]=[{'all':!![]}];}return db[_0x7688('0x2a')][_0x7688('0x41')](_0x522176);})['then'](function(_0x3d41b0){_0x5aacb0['rows']=_0x3d41b0;return _0x5aacb0;})[_0x7688('0x23')](respondWithFilteredResult(_0x1d4dc1,_0x522176))[_0x7688('0x42')](handleError(_0x1d4dc1,null));};exports[_0x7688('0x43')]=function(_0x4ece35,_0x55407c){var _0x4945b5={'raw':!![],'where':{'id':_0x4ece35[_0x7688('0x44')]['id']}},_0x4fb952={};_0x4fb952['model']=_[_0x7688('0x30')](db['VoiceTransferReport'][_0x7688('0x45')]);_0x4fb952[_0x7688('0x2f')]=_['keys'](_0x4ece35[_0x7688('0x2f')]);_0x4fb952[_0x7688('0x31')]=_['intersection'](_0x4fb952[_0x7688('0x2d')],_0x4fb952[_0x7688('0x2f')]);_0x4945b5[_0x7688('0x33')]=_[_0x7688('0x32')](_0x4fb952[_0x7688('0x2d')],qs[_0x7688('0x34')](_0x4ece35[_0x7688('0x2f')]['fields']));_0x4945b5[_0x7688('0x33')]=_0x4945b5[_0x7688('0x33')][_0x7688('0x46')]?_0x4945b5['attributes']:_0x4fb952[_0x7688('0x2d')];if(_0x4ece35[_0x7688('0x2f')][_0x7688('0x3f')]){_0x4945b5[_0x7688('0x40')]=[{'all':!![]}];}_0x4945b5=_['merge']({},_0x4945b5,_0x4ece35['options']);return db[_0x7688('0x2a')][_0x7688('0x47')](_0x4945b5)[_0x7688('0x23')](handleEntityNotFound(_0x55407c,null))[_0x7688('0x23')](respondWithResult(_0x55407c,null))[_0x7688('0x42')](handleError(_0x55407c,null));};exports[_0x7688('0x48')]=function(_0x25983f,_0x5e57db){return db[_0x7688('0x2a')][_0x7688('0x48')](_0x25983f[_0x7688('0x49')],{})[_0x7688('0x23')](respondWithResult(_0x5e57db,0xc9))[_0x7688('0x42')](handleError(_0x5e57db,null));};exports[_0x7688('0x22')]=function(_0x14fb48,_0x4556fd){if(_0x14fb48[_0x7688('0x49')]['id']){delete _0x14fb48[_0x7688('0x49')]['id'];}return db['VoiceTransferReport'][_0x7688('0x47')]({'where':{'id':_0x14fb48[_0x7688('0x44')]['id']}})['then'](handleEntityNotFound(_0x4556fd,null))[_0x7688('0x23')](saveUpdates(_0x14fb48[_0x7688('0x49')],null))[_0x7688('0x23')](respondWithResult(_0x4556fd,null))['catch'](handleError(_0x4556fd,null));};exports['destroy']=function(_0x33cdde,_0x4aaa1b){return db[_0x7688('0x2a')][_0x7688('0x47')]({'where':{'id':_0x33cdde[_0x7688('0x44')]['id']}})[_0x7688('0x23')](handleEntityNotFound(_0x4aaa1b,null))[_0x7688('0x23')](removeEntity(_0x4aaa1b,null))['catch'](handleError(_0x4aaa1b,null));};exports['describe']=function(_0x302857,_0x519d26){return db[_0x7688('0x2a')][_0x7688('0x4a')]()[_0x7688('0x23')](respondWithResult(_0x519d26,null))[_0x7688('0x42')](handleError(_0x519d26,null));}; \ No newline at end of file +var _0x7e05=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','include','VoiceTransferReport','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy'];(function(_0x435c89,_0x2b6da8){var _0x183449=function(_0x22369e){while(--_0x22369e){_0x435c89['push'](_0x435c89['shift']());}};_0x183449(++_0x2b6da8);}(_0x7e05,0x19d));var _0x57e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e05[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x57e0('0x0'));var rimraf=require(_0x57e0('0x1'));var zipdir=require(_0x57e0('0x2'));var jsonpatch=require(_0x57e0('0x3'));var rp=require(_0x57e0('0x4'));var moment=require('moment');var BPromise=require(_0x57e0('0x5'));var Mustache=require(_0x57e0('0x6'));var util=require(_0x57e0('0x7'));var path=require(_0x57e0('0x8'));var sox=require(_0x57e0('0x9'));var csv=require(_0x57e0('0xa'));var ejs=require(_0x57e0('0xb'));var fs=require('fs');var fs_extra=require(_0x57e0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x57e0('0xd'));var deskjs=require(_0x57e0('0xe'));var toCsv=require(_0x57e0('0xa'));var querystring=require(_0x57e0('0xf'));var Papa=require(_0x57e0('0x10'));var Redis=require(_0x57e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x57e0('0x12'));var as=require(_0x57e0('0x13'));var hardwareService=require(_0x57e0('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x57e0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x57e0('0x16'));var db=require(_0x57e0('0x17'))['db'];function respondWithStatusCode(_0x790c9e,_0xdb38ed){_0xdb38ed=_0xdb38ed||0xcc;return function(_0x3dc697){if(_0x3dc697){return _0x790c9e[_0x57e0('0x18')](_0xdb38ed);}return _0x790c9e[_0x57e0('0x19')](_0xdb38ed)[_0x57e0('0x1a')]();};}function respondWithResult(_0x1e6f2b,_0x26800f){_0x26800f=_0x26800f||0xc8;return function(_0x59148f){if(_0x59148f){return _0x1e6f2b['status'](_0x26800f)[_0x57e0('0x1b')](_0x59148f);}};}function respondWithFilteredResult(_0x4b3b04,_0x477470){return function(_0x25f949){if(_0x25f949){var _0x228c78=typeof _0x477470[_0x57e0('0x1c')]===_0x57e0('0x1d')&&typeof _0x477470['limit']==='undefined';var _0x29a208=_0x25f949[_0x57e0('0x1e')];var _0x476f27=_0x228c78?0x0:_0x477470[_0x57e0('0x1c')];var _0x28b210=_0x228c78?_0x25f949[_0x57e0('0x1e')]:_0x477470[_0x57e0('0x1c')]+_0x477470['limit'];var _0x1b4aea;if(_0x28b210>=_0x29a208){_0x28b210=_0x29a208;_0x1b4aea=0xc8;}else{_0x1b4aea=0xce;}_0x4b3b04['status'](_0x1b4aea);return _0x4b3b04[_0x57e0('0x1f')]('Content-Range',_0x476f27+'-'+_0x28b210+'/'+_0x29a208)['json'](_0x25f949);}return null;};}function patchUpdates(_0x1c8679){return function(_0xfa0ee6){try{jsonpatch['apply'](_0xfa0ee6,_0x1c8679,!![]);}catch(_0x3176b3){return BPromise[_0x57e0('0x20')](_0x3176b3);}return _0xfa0ee6[_0x57e0('0x21')]();};}function saveUpdates(_0x4fc506,_0x5266d0){return function(_0x12b650){if(_0x12b650){return _0x12b650[_0x57e0('0x22')](_0x4fc506)[_0x57e0('0x23')](function(_0x4d7a9f){return _0x4d7a9f;});}return null;};}function removeEntity(_0x23b91f,_0x5aa711){return function(_0x20e789){if(_0x20e789){return _0x20e789[_0x57e0('0x24')]()[_0x57e0('0x23')](function(){_0x23b91f[_0x57e0('0x19')](0xcc)[_0x57e0('0x1a')]();});}};}function handleEntityNotFound(_0x8844c3,_0x46e8e7){return function(_0x97e432){if(!_0x97e432){_0x8844c3[_0x57e0('0x18')](0x194);}return _0x97e432;};}function handleError(_0x4db793,_0x4f4c05){_0x4f4c05=_0x4f4c05||0x1f4;return function(_0x3e9b14){logger['error'](_0x3e9b14[_0x57e0('0x25')]);if(_0x3e9b14[_0x57e0('0x26')]){delete _0x3e9b14[_0x57e0('0x26')];}_0x4db793[_0x57e0('0x19')](_0x4f4c05)[_0x57e0('0x27')](_0x3e9b14);};}exports[_0x57e0('0x28')]=function(_0x3d7ebb,_0x2c43ac){var _0x3cbe0f={},_0x40e91d={},_0x33d664={'count':0x0,'rows':[]};var _0x18d5f0=_[_0x57e0('0x29')](db['VoiceTransferReport'][_0x57e0('0x2a')],function(_0x45ea68){return{'name':_0x45ea68[_0x57e0('0x2b')],'type':_0x45ea68[_0x57e0('0x2c')][_0x57e0('0x2d')]};});_0x40e91d[_0x57e0('0x2e')]=_[_0x57e0('0x29')](_0x18d5f0,_0x57e0('0x26'));_0x40e91d[_0x57e0('0x2f')]=_[_0x57e0('0x30')](_0x3d7ebb[_0x57e0('0x2f')]);_0x40e91d[_0x57e0('0x31')]=_[_0x57e0('0x32')](_0x40e91d[_0x57e0('0x2e')],_0x40e91d[_0x57e0('0x2f')]);_0x3cbe0f[_0x57e0('0x33')]=_['intersection'](_0x40e91d[_0x57e0('0x2e')],qs[_0x57e0('0x34')](_0x3d7ebb['query'][_0x57e0('0x34')]));_0x3cbe0f[_0x57e0('0x33')]=_0x3cbe0f[_0x57e0('0x33')][_0x57e0('0x35')]?_0x3cbe0f['attributes']:_0x40e91d[_0x57e0('0x2e')];if(!_0x3d7ebb['query'][_0x57e0('0x36')]('nolimit')){_0x3cbe0f[_0x57e0('0x37')]=qs[_0x57e0('0x37')](_0x3d7ebb[_0x57e0('0x2f')][_0x57e0('0x37')]);_0x3cbe0f[_0x57e0('0x1c')]=qs[_0x57e0('0x1c')](_0x3d7ebb[_0x57e0('0x2f')][_0x57e0('0x1c')]);}_0x3cbe0f[_0x57e0('0x38')]=qs[_0x57e0('0x39')](_0x3d7ebb[_0x57e0('0x2f')]['sort']);_0x3cbe0f['where']=qs[_0x57e0('0x31')](_[_0x57e0('0x3a')](_0x3d7ebb[_0x57e0('0x2f')],_0x40e91d['filters']),_0x18d5f0);if(_0x3d7ebb['query'][_0x57e0('0x3b')]){_0x3cbe0f[_0x57e0('0x3c')]=_['merge'](_0x3cbe0f[_0x57e0('0x3c')],{'$or':_[_0x57e0('0x29')](_0x18d5f0,function(_0x70f9dd){if(_0x70f9dd[_0x57e0('0x2c')]!==_0x57e0('0x3d')){var _0x34f43b={};_0x34f43b[_0x70f9dd[_0x57e0('0x26')]]={'$like':'%'+_0x3d7ebb['query'][_0x57e0('0x3b')]+'%'};return _0x34f43b;}})});}_0x3cbe0f=_[_0x57e0('0x3e')]({},_0x3cbe0f,_0x3d7ebb['options']);var _0x479209={'where':_0x3cbe0f[_0x57e0('0x3c')]};return db['VoiceTransferReport'][_0x57e0('0x1e')](_0x479209)[_0x57e0('0x23')](function(_0x262bc3){_0x33d664[_0x57e0('0x1e')]=_0x262bc3;if(_0x3d7ebb[_0x57e0('0x2f')]['includeAll']){_0x3cbe0f[_0x57e0('0x3f')]=[{'all':!![]}];}return db[_0x57e0('0x40')][_0x57e0('0x41')](_0x3cbe0f);})[_0x57e0('0x23')](function(_0x2115d4){_0x33d664[_0x57e0('0x42')]=_0x2115d4;return _0x33d664;})['then'](respondWithFilteredResult(_0x2c43ac,_0x3cbe0f))[_0x57e0('0x43')](handleError(_0x2c43ac,null));};exports[_0x57e0('0x44')]=function(_0x189fbf,_0x4886bd){var _0x3c93dd={'raw':!![],'where':{'id':_0x189fbf[_0x57e0('0x45')]['id']}},_0x43217e={};_0x43217e[_0x57e0('0x2e')]=_['keys'](db['VoiceTransferReport'][_0x57e0('0x2a')]);_0x43217e[_0x57e0('0x2f')]=_[_0x57e0('0x30')](_0x189fbf[_0x57e0('0x2f')]);_0x43217e[_0x57e0('0x31')]=_['intersection'](_0x43217e[_0x57e0('0x2e')],_0x43217e[_0x57e0('0x2f')]);_0x3c93dd[_0x57e0('0x33')]=_[_0x57e0('0x32')](_0x43217e[_0x57e0('0x2e')],qs[_0x57e0('0x34')](_0x189fbf[_0x57e0('0x2f')][_0x57e0('0x34')]));_0x3c93dd[_0x57e0('0x33')]=_0x3c93dd[_0x57e0('0x33')]['length']?_0x3c93dd['attributes']:_0x43217e[_0x57e0('0x2e')];if(_0x189fbf['query']['includeAll']){_0x3c93dd['include']=[{'all':!![]}];}_0x3c93dd=_['merge']({},_0x3c93dd,_0x189fbf[_0x57e0('0x46')]);return db['VoiceTransferReport'][_0x57e0('0x47')](_0x3c93dd)[_0x57e0('0x23')](handleEntityNotFound(_0x4886bd,null))[_0x57e0('0x23')](respondWithResult(_0x4886bd,null))[_0x57e0('0x43')](handleError(_0x4886bd,null));};exports['create']=function(_0x5dff66,_0xc6e682){return db[_0x57e0('0x40')][_0x57e0('0x48')](_0x5dff66[_0x57e0('0x49')],{})[_0x57e0('0x23')](respondWithResult(_0xc6e682,0xc9))['catch'](handleError(_0xc6e682,null));};exports[_0x57e0('0x22')]=function(_0x2a5685,_0x563a42){if(_0x2a5685[_0x57e0('0x49')]['id']){delete _0x2a5685[_0x57e0('0x49')]['id'];}return db['VoiceTransferReport'][_0x57e0('0x47')]({'where':{'id':_0x2a5685[_0x57e0('0x45')]['id']}})['then'](handleEntityNotFound(_0x563a42,null))['then'](saveUpdates(_0x2a5685[_0x57e0('0x49')],null))['then'](respondWithResult(_0x563a42,null))['catch'](handleError(_0x563a42,null));};exports[_0x57e0('0x24')]=function(_0xe3aa93,_0x116997){return db[_0x57e0('0x40')][_0x57e0('0x47')]({'where':{'id':_0xe3aa93[_0x57e0('0x45')]['id']}})[_0x57e0('0x23')](handleEntityNotFound(_0x116997,null))['then'](removeEntity(_0x116997,null))[_0x57e0('0x43')](handleError(_0x116997,null));};exports[_0x57e0('0x4a')]=function(_0x2150d1,_0x15384d){return db[_0x57e0('0x40')][_0x57e0('0x4a')]()[_0x57e0('0x23')](respondWithResult(_0x15384d,null))[_0x57e0('0x43')](handleError(_0x15384d,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 9ba9f68..ef96aef 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 _0x893f=['api','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer','lodash','../../config/logger'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x893f,0xa9));var _0xf893=function(_0x5e832d,_0x4d23ac){_0x5e832d=_0x5e832d-0x0;var _0x5b060a=_0x893f[_0x5e832d];return _0x5b060a;};'use strict';var _=require(_0xf893('0x0'));var util=require('util');var logger=require(_0xf893('0x1'))(_0xf893('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf893('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf893('0x4'));var config=require(_0xf893('0x5'));var attributes=require(_0xf893('0x6'));module['exports']=function(_0x1a609e,_0x3305eb){return _0x1a609e['define'](_0xf893('0x7'),attributes,{'tableName':_0xf893('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e32=['moment','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger'];(function(_0x51c560,_0x4e6c0e){var _0x594579=function(_0x18c6fe){while(--_0x18c6fe){_0x51c560['push'](_0x51c560['shift']());}};_0x594579(++_0x4e6c0e);}(_0x9e32,0xb2));var _0x29e3=function(_0x19fa95,_0x1cca0a){_0x19fa95=_0x19fa95-0x0;var _0x58a835=_0x9e32[_0x19fa95];return _0x58a835;};'use strict';var _=require(_0x29e3('0x0'));var util=require('util');var logger=require(_0x29e3('0x1'))('api');var moment=require(_0x29e3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x29e3('0x3'));var rimraf=require(_0x29e3('0x4'));var config=require(_0x29e3('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0x29e3('0x6')]=function(_0x1b1e04,_0x2abbfd){return _0x1b1e04[_0x29e3('0x7')](_0x29e3('0x8'),attributes,{'tableName':_0x29e3('0x9'),'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 373faa5..2f94043 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 _0x176d=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','body','options','raw','then','CreateVoiceTransferReport','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x176d,0x1ad));var _0xd176=function(_0x5209ea,_0x4e1117){_0x5209ea=_0x5209ea-0x0;var _0x1ff951=_0x176d[_0x5209ea];return _0x1ff951;};'use strict';var _=require(_0xd176('0x0'));var util=require(_0xd176('0x1'));var moment=require(_0xd176('0x2'));var BPromise=require(_0xd176('0x3'));var rs=require(_0xd176('0x4'));var fs=require('fs');var Redis=require(_0xd176('0x5'));var db=require(_0xd176('0x6'))['db'];var utils=require(_0xd176('0x7'));var logger=require(_0xd176('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd176('0x9'));var client=jayson['client'][_0xd176('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46c93d,_0x3bd8fb,_0x3ea72d){return new BPromise(function(_0x203733,_0x4ed389){return client[_0xd176('0xb')](_0x46c93d,_0x3ea72d)['then'](function(_0x377622){logger[_0xd176('0xc')](_0xd176('0xd'),_0x3bd8fb,_0xd176('0xe'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3bd8fb,_0xd176('0xe'),JSON[_0xd176('0xf')](_0x377622));if(_0x377622[_0xd176('0x10')]){if(_0x377622[_0xd176('0x10')]['code']===0x1f4){logger['error'](_0xd176('0xd'),_0x3bd8fb,_0x377622['error'][_0xd176('0x11')]);return _0x4ed389(_0x377622[_0xd176('0x10')][_0xd176('0x11')]);}logger[_0xd176('0x10')](_0xd176('0xd'),_0x3bd8fb,_0x377622[_0xd176('0x10')][_0xd176('0x11')]);return _0x203733(_0x377622['error'][_0xd176('0x11')]);}else{logger['info'](_0xd176('0xd'),_0x3bd8fb,_0xd176('0xe'));_0x203733(_0x377622[_0xd176('0x12')][_0xd176('0x11')]);}})['catch'](function(_0x1816c4){logger[_0xd176('0x10')](_0xd176('0xd'),_0x3bd8fb,_0x1816c4);_0x4ed389(_0x1816c4);});});}exports['CreateVoiceTransferReport']=function(_0x271980){var _0x13667d=this;return new Promise(function(_0x31c0b5,_0x4f63c8){return db['VoiceTransferReport']['create'](_0x271980[_0xd176('0x13')],{'raw':_0x271980[_0xd176('0x14')]?_0x271980[_0xd176('0x14')][_0xd176('0x15')]===undefined?!![]:![]:!![]})[_0xd176('0x16')](function(_0x1b568c){logger[_0xd176('0xc')](_0xd176('0x17'),_0x271980);logger[_0xd176('0x18')]('CreateVoiceTransferReport',_0x271980,JSON[_0xd176('0xf')](_0x1b568c));_0x31c0b5(_0x1b568c);})[_0xd176('0x19')](function(_0x4a1adf){logger[_0xd176('0x10')](_0xd176('0x17'),_0x4a1adf['message'],_0x271980);_0x4f63c8(_0x13667d[_0xd176('0x10')](0x1f4,_0x4a1adf[_0xd176('0x11')]));});});}; \ No newline at end of file +var _0x9b76=['code','message','VoiceTransferReport,\x20%s,\x20%s','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','stringify','error'];(function(_0x15f5b8,_0x1527e8){var _0x4cd03c=function(_0x535bc8){while(--_0x535bc8){_0x15f5b8['push'](_0x15f5b8['shift']());}};_0x4cd03c(++_0x1527e8);}(_0x9b76,0x66));var _0x69b7=function(_0x4594a3,_0x169912){_0x4594a3=_0x4594a3-0x0;var _0x27b7b9=_0x9b76[_0x4594a3];return _0x27b7b9;};'use strict';var _=require(_0x69b7('0x0'));var util=require(_0x69b7('0x1'));var moment=require(_0x69b7('0x2'));var BPromise=require(_0x69b7('0x3'));var rs=require(_0x69b7('0x4'));var fs=require('fs');var Redis=require(_0x69b7('0x5'));var db=require(_0x69b7('0x6'))['db'];var utils=require(_0x69b7('0x7'));var logger=require(_0x69b7('0x8'))(_0x69b7('0x9'));var config=require('../../config/environment');var jayson=require(_0x69b7('0xa'));var client=jayson[_0x69b7('0xb')][_0x69b7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28fead,_0x1e80b2,_0x1d74c6){return new BPromise(function(_0x317269,_0x52d3d5){return client[_0x69b7('0xd')](_0x28fead,_0x1d74c6)['then'](function(_0x336b1c){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1e80b2,_0x69b7('0xe'));logger[_0x69b7('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1e80b2,'request\x20sent',JSON[_0x69b7('0x10')](_0x336b1c));if(_0x336b1c[_0x69b7('0x11')]){if(_0x336b1c['error'][_0x69b7('0x12')]===0x1f4){logger[_0x69b7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x1e80b2,_0x336b1c[_0x69b7('0x11')][_0x69b7('0x13')]);return _0x52d3d5(_0x336b1c[_0x69b7('0x11')][_0x69b7('0x13')]);}logger[_0x69b7('0x11')](_0x69b7('0x14'),_0x1e80b2,_0x336b1c[_0x69b7('0x11')][_0x69b7('0x13')]);return _0x317269(_0x336b1c[_0x69b7('0x11')][_0x69b7('0x13')]);}else{logger[_0x69b7('0x15')](_0x69b7('0x14'),_0x1e80b2,'request\x20sent');_0x317269(_0x336b1c[_0x69b7('0x16')][_0x69b7('0x13')]);}})[_0x69b7('0x17')](function(_0x2ea46f){logger[_0x69b7('0x11')](_0x69b7('0x14'),_0x1e80b2,_0x2ea46f);_0x52d3d5(_0x2ea46f);});});}exports[_0x69b7('0x18')]=function(_0x53e634){var _0x15af74=this;return new Promise(function(_0x2ad3cf,_0x1b45d3){return db[_0x69b7('0x19')][_0x69b7('0x1a')](_0x53e634['body'],{'raw':_0x53e634[_0x69b7('0x1b')]?_0x53e634[_0x69b7('0x1b')][_0x69b7('0x1c')]===undefined?!![]:![]:!![]})[_0x69b7('0x1d')](function(_0x12d238){logger[_0x69b7('0x15')](_0x69b7('0x18'),_0x53e634);logger[_0x69b7('0xf')](_0x69b7('0x18'),_0x53e634,JSON['stringify'](_0x12d238));_0x2ad3cf(_0x12d238);})[_0x69b7('0x17')](function(_0xc07a82){logger[_0x69b7('0x11')](_0x69b7('0x18'),_0xc07a82[_0x69b7('0x13')],_0x53e634);_0x1b45d3(_0x15af74[_0x69b7('0x11')](0x1f4,_0xc07a82[_0x69b7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7ef0a51..e69454c 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 _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x1df5f4,_0x5be367){var _0x1b60fa=function(_0x40b4b9){while(--_0x40b4b9){_0x1df5f4['push'](_0x1df5f4['shift']());}};_0x1b60fa(++_0x5be367);}(_0x5b02,0xe9));var _0x25b0=function(_0x75dca5,_0x5cd869){_0x75dca5=_0x75dca5-0x0;var _0x3a8f22=_0x5b02[_0x75dca5];return _0x3a8f22;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file +var _0xe706=['/transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','/calls','calls'];(function(_0x4d91ff,_0x18704d){var _0x1f22f6=function(_0x4142ca){while(--_0x4142ca){_0x4d91ff['push'](_0x4d91ff['shift']());}};_0x1f22f6(++_0x18704d);}(_0xe706,0xa3));var _0x6e70=function(_0x161c6b,_0x29edbf){_0x161c6b=_0x161c6b-0x0;var _0x11b9c4=_0xe706[_0x161c6b];return _0x11b9c4;};'use strict';var express=require(_0x6e70('0x0'));var router=express[_0x6e70('0x1')]();var auth=require(_0x6e70('0x2'));var controller=require('./webbar.controller');router[_0x6e70('0x3')](_0x6e70('0x4'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x7')]);router[_0x6e70('0x3')](_0x6e70('0x8'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x9')]);router[_0x6e70('0x3')](_0x6e70('0xa'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x3')](_0x6e70('0xc'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x3')](_0x6e70('0xe'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['unhold']);router['post'](_0x6e70('0xf'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x3')](_0x6e70('0x11'),auth[_0x6e70('0x5')](),auth[_0x6e70('0x6')](),controller['transfer']);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 26adca0..250efd7 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 _0xe205=['hold\x20fired:','hold\x20executed!','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','hangup','hangup\x20fired:','userId','format','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold'];(function(_0x4025a1,_0x38caa7){var _0x36f972=function(_0x50faef){while(--_0x50faef){_0x4025a1['push'](_0x4025a1['shift']());}};_0x36f972(++_0x38caa7);}(_0xe205,0xa7));var _0x5e20=function(_0x224e63,_0x54a25b){_0x224e63=_0x224e63-0x0;var _0x54f487=_0xe205[_0x224e63];return _0x54f487;};'use strict';var path=require(_0x5e20('0x0'));var fs=require('fs');var _=require(_0x5e20('0x1'));var db=require(_0x5e20('0x2'))['db'];var config=require(_0x5e20('0x3'));var util=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var jayson=require(_0x5e20('0x6'));var amiClient=jayson[_0x5e20('0x7')][_0x5e20('0x8')]({'port':0x232a});var logger=require('../../config/logger')(_0x5e20('0x9'));var Redis=require(_0x5e20('0xa'));config[_0x5e20('0xb')]=_[_0x5e20('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5e20('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'callNumber':{'type':'string','required':[!![],_0x5e20('0x10')]},'callerId':{'type':_0x5e20('0x11')},'callbackUrl':{'type':_0x5e20('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':[!![],_0x5e20('0x12')]},'transferNumber':{'type':_0x5e20('0x11'),'required':[!![],_0x5e20('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});function emit(_0x542b3c,_0xeaeb77,_0x9a59ce){logger[_0x5e20('0x14')](_0x542b3c,_0xeaeb77,JSON[_0x5e20('0x15')](_0x9a59ce));io['to'](_0x542b3c)[_0x5e20('0x16')](_0xeaeb77,_0x9a59ce);}function handleError(_0x3b353f){return function(_0x1cc706){console[_0x5e20('0x17')]('handleError:',_0x1cc706,_0x1cc706 instanceof RangeError);logger[_0x5e20('0x18')](_0x1cc706[_0x5e20('0x19')]);if(_0x1cc706 instanceof RangeError){if(_0x1cc706['name']){delete _0x1cc706[_0x5e20('0x1a')];}_0x3b353f[_0x5e20('0x1b')](0x194)[_0x5e20('0x1c')](_0x1cc706);}else{if(_0x1cc706[_0x5e20('0x1a')]){delete _0x1cc706['name'];}_0x3b353f[_0x5e20('0x1b')](0x1f4)['send'](_0x1cc706);}};}function checkError(){return function(_0x4a3587){if(!_0x4a3587){throw new RangeError('NotFound');}return _0x4a3587;};}function respondWithRpcPromise(_0x5d0d1a,_0xe562ba){return new BPromise(function(_0x5cca90,_0x3d89e4){var _0x29b111=amiClient;return _0x29b111[_0x5e20('0x1d')](_0x5d0d1a,_0xe562ba)[_0x5e20('0x1e')](function(_0x3ef7fa){if(_0x3ef7fa[_0x5e20('0x18')]){if(_0x3ef7fa['error'][_0x5e20('0x1f')]===0x1f4){return _0x3d89e4(_0x3ef7fa['error']['message']);}return _0x5cca90(_0x3ef7fa[_0x5e20('0x18')][_0x5e20('0x20')]);}else{_0x5cca90(_0x3ef7fa[_0x5e20('0x21')]);}})[_0x5e20('0x22')](function(_0xbf7a24){_0x3d89e4(_0xbf7a24);});});}function getAgent(_0x200774){return db[_0x5e20('0x23')]['findOne']({'where':{'id':_0x200774,'role':_0x5e20('0x24')}})[_0x5e20('0x1e')](checkError());}function getAgentCheckSession(_0x238758,_0x3032ef){return new BPromise(function(_0x4c799d,_0x3a0f06){var _0x2c5d80=respondWithRpcPromise(_0x5e20('0x25'));var _0x222e7a=getAgent(_0x238758);Promise[_0x5e20('0x26')]([_0x2c5d80,_0x222e7a])[_0x5e20('0x1e')](function(_0x5ec45b){var _0xbc2b0e=_0x5ec45b[0x0];var _0x34a3d6=_0x5ec45b[0x1];var _0x543c29=_[_0x5e20('0x27')](_0xbc2b0e[_0x5e20('0x28')],function(_0x335f1e){return _0x335f1e[_0x5e20('0x29')]==_0x34a3d6['id']&&_0x335f1e[_0x5e20('0x2a')]==_0x3032ef;});if(_0x543c29[_0x5e20('0x2b')]==0x1){_0x4c799d(_0x34a3d6);}else{_0x3a0f06(new RangeError('sessionId\x20'+_0x3032ef+_0x5e20('0x2c')));}});});}exports[_0x5e20('0x2d')]=function(_0x330341,_0x5f2f1d){logger[_0x5e20('0x14')](_0x5e20('0x2e'),_0x330341[_0x5e20('0x2f')]);var _0x1ed59d=originateValidation[_0x5e20('0x30')](_0x330341[_0x5e20('0x2f')]);if(_0x1ed59d[_0x5e20('0x2b')]>0x0){return _0x5f2f1d['status'](0x190)[_0x5e20('0x31')](_0x1ed59d);}var _0x1a9fff=_0x330341[_0x5e20('0x2f')]['userId'];var _0x9469cd=_0x330341[_0x5e20('0x2f')][_0x5e20('0x32')];var _0x2e367e=_0x330341[_0x5e20('0x2f')][_0x5e20('0x33')];var _0x1114ae=_0x330341[_0x5e20('0x2f')][_0x5e20('0x34')];return getAgent(_0x1a9fff)[_0x5e20('0x1e')](function(_0x36e825){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x36e825[_0x5e20('0x1a')]);emit(util['format'](_0x5e20('0x36'),_0x36e825['name']),'webbar:originate',{'callNumber':_0x9469cd,'callerId':_0x2e367e,'callbackUrl':_0x1114ae});return _0x5f2f1d[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':'originate\x20executed!'});})[_0x5e20('0x22')](handleError(_0x5f2f1d));};exports[_0x5e20('0x37')]=function(_0x4f34c0,_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x38'),_0x4f34c0[_0x5e20('0x2f')]);var _0x15ce1d=hangupValidation[_0x5e20('0x30')](_0x4f34c0[_0x5e20('0x2f')]);if(_0x15ce1d[_0x5e20('0x2b')]>0x0){return _0x3f3908[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x15ce1d);}var _0x473b69=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x1cb3f0=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x473b69)[_0x5e20('0x1e')](function(_0x17feb4){logger['info'](_0x5e20('0x35'),_0x17feb4[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x17feb4[_0x5e20('0x1a')]),'webbar:hangup',{'sessionId':_0x1cb3f0});return _0x3f3908[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x3b')});})[_0x5e20('0x22')](handleError(_0x3f3908));};exports[_0x5e20('0x3c')]=function(_0x30d3ef,_0x5c7ae8){logger[_0x5e20('0x14')](_0x5e20('0x3d'),_0x30d3ef[_0x5e20('0x2f')]);var _0x5a21f0=answerValidation[_0x5e20('0x30')](_0x30d3ef[_0x5e20('0x2f')]);if(_0x5a21f0[_0x5e20('0x2b')]>0x0){return _0x5c7ae8[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5a21f0);}var _0x336d61=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x5c9504=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x336d61)[_0x5e20('0x1e')](function(_0x503cb6){logger[_0x5e20('0x14')]('entityFound:',_0x503cb6[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x503cb6[_0x5e20('0x1a')]),_0x5e20('0x3e'),{'sessionId':_0x5c9504});return _0x5c7ae8['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x5c7ae8));};exports[_0x5e20('0x3f')]=function(_0x28f155,_0x9d9d62){logger[_0x5e20('0x14')](_0x5e20('0x40'),_0x28f155[_0x5e20('0x2f')]);var _0x57c794=holdValidation['validate'](_0x28f155['body']);if(_0x57c794[_0x5e20('0x2b')]>0x0){return _0x9d9d62[_0x5e20('0x1b')](0x190)['json'](_0x57c794);}var _0x22b84e=_0x28f155[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x3bd5b8=_0x28f155[_0x5e20('0x2f')]['sessionId'];return getAgent(_0x22b84e)[_0x5e20('0x1e')](function(_0x245b52){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x245b52[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x245b52[_0x5e20('0x1a')]),'webbar:hold',{'sessionId':_0x3bd5b8});return _0x9d9d62['status'](0xc8)['json']({'error':![],'message':_0x5e20('0x41')});})[_0x5e20('0x22')](handleError(_0x9d9d62));};exports['unhold']=function(_0x4392ca,_0x4bfea7){logger[_0x5e20('0x14')]('unhold\x20fired:',_0x4392ca[_0x5e20('0x2f')]);var _0x59372c=unholdValidation[_0x5e20('0x30')](_0x4392ca[_0x5e20('0x2f')]);if(_0x59372c[_0x5e20('0x2b')]>0x0){return _0x4bfea7[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59372c);}var _0x200094=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x19c128=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x200094)[_0x5e20('0x1e')](function(_0x278b0e){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x278b0e[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x278b0e['name']),'webbar:unhold',{'sessionId':_0x19c128});return _0x4bfea7[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x42')});})[_0x5e20('0x22')](handleError(_0x4bfea7));};exports[_0x5e20('0x43')]=function(_0x596971,_0x457552){logger[_0x5e20('0x14')](_0x5e20('0x44'),_0x457552['body']);var _0x5d2aa2=callsValidation['validate'](_0x596971[_0x5e20('0x2f')]);if(_0x5d2aa2[_0x5e20('0x2b')]>0x0){return _0x457552[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5d2aa2);}var _0xbacc1f=_0x596971[_0x5e20('0x2f')]['userId'];var _0x393724=respondWithRpcPromise('VoiceChannels');var _0x2913e7=getAgent(_0xbacc1f);return Promise['all']([_0x393724,_0x2913e7])[_0x5e20('0x1e')](function(_0x2eff14){var _0x141743=_0x2eff14[0x0];var _0x5f025b=_0x2eff14[0x1];var _0x1f6a32=_[_0x5e20('0x27')](_0x141743[_0x5e20('0x28')],function(_0x4309b8){return _0x4309b8[_0x5e20('0x29')]==_0x5f025b['id'];});return _0x457552[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'count':_0x1f6a32['length'],'rows':_0x1f6a32});})[_0x5e20('0x22')](handleError(_0x457552));};exports[_0x5e20('0x45')]=function(_0x1a03e4,_0x2f9089){logger['info'](_0x5e20('0x46'),_0x1a03e4[_0x5e20('0x2f')]);var _0x23f07d=conferenceValidation[_0x5e20('0x30')](_0x1a03e4['body']);if(_0x23f07d[_0x5e20('0x2b')]>0x0){return _0x2f9089[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x23f07d);}var _0x53ddd4=_0x1a03e4['body']['userId'];return getAgent(_0x53ddd4)[_0x5e20('0x1e')](function(_0x1eb84c){logger['info'](_0x5e20('0x35'),_0x1eb84c[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')]('user:%s',_0x1eb84c[_0x5e20('0x1a')]),_0x5e20('0x47'));return _0x2f9089['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x48')});})['catch'](handleError(_0x2f9089));};exports[_0x5e20('0x49')]=function(_0x9993ae,_0x1e531d){logger[_0x5e20('0x14')]('transfer\x20fired:',_0x9993ae[_0x5e20('0x2f')]);var _0x59bff7=transferValidation['validate'](_0x9993ae[_0x5e20('0x2f')]);if(_0x59bff7[_0x5e20('0x2b')]>0x0){return _0x1e531d[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59bff7);}var _0x54cd1=_0x9993ae[_0x5e20('0x2f')]['userId'];var _0x4bccbe=_0x9993ae[_0x5e20('0x2f')][_0x5e20('0x2a')];var _0x17f248=_0x9993ae['body'][_0x5e20('0x4a')];return getAgent(_0x54cd1)[_0x5e20('0x1e')](function(_0x52f8ef){logger[_0x5e20('0x14')]('entityFound:',_0x52f8ef['name']);emit(util[_0x5e20('0x3a')]('user:%s',_0x52f8ef[_0x5e20('0x1a')]),_0x5e20('0x4b'),{'sessionId':_0x4bccbe,'transferNumber':_0x17f248});return _0x1e531d[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x4c')});})[_0x5e20('0x22')](handleError(_0x1e531d));}; \ No newline at end of file +var _0x00bb=['hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','util','jayson/promise','client','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','catch','User','VoiceChannels','then','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','json','body','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate'];(function(_0x5e4cab,_0x1e02f5){var _0x2768b1=function(_0x23de80){while(--_0x23de80){_0x5e4cab['push'](_0x5e4cab['shift']());}};_0x2768b1(++_0x1e02f5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x00bb[_0x3054be];return _0x3df150;};'use strict';var path=require(_0xb00b('0x0'));var fs=require('fs');var _=require(_0xb00b('0x1'));var db=require(_0xb00b('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xb00b('0x3'));var BPromise=require('bluebird');var jayson=require(_0xb00b('0x4'));var amiClient=jayson[_0xb00b('0x5')]['http']({'port':0x232a});var logger=require(_0xb00b('0x6'))(_0xb00b('0x7'));var Redis=require('ioredis');config['redis']=_['defaults'](config[_0xb00b('0x8')],{'host':_0xb00b('0x9'),'port':0x18eb});var io=require(_0xb00b('0xa'))(new Redis(config[_0xb00b('0x8')]));var Schema=require(_0xb00b('0xb'));var originateValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xb00b('0xd')]},'callerId':{'type':_0xb00b('0xe')},'callbackUrl':{'type':_0xb00b('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],_0xb00b('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb00b('0xf')]},'sessionId':{'type':_0xb00b('0xe'),'required':[!![],_0xb00b('0x10')]},'transferNumber':{'type':_0xb00b('0xe'),'required':[!![],_0xb00b('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb00b('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb00b('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb00b('0xf')]}});function emit(_0x4dcd45,_0x51d136,_0x1f9c78){logger[_0xb00b('0x12')](_0x4dcd45,_0x51d136,JSON[_0xb00b('0x13')](_0x1f9c78));io['to'](_0x4dcd45)[_0xb00b('0x14')](_0x51d136,_0x1f9c78);}function handleError(_0x58d65f){return function(_0x2a7231){console['log'](_0xb00b('0x15'),_0x2a7231,_0x2a7231 instanceof RangeError);logger['error'](_0x2a7231[_0xb00b('0x16')]);if(_0x2a7231 instanceof RangeError){if(_0x2a7231['name']){delete _0x2a7231[_0xb00b('0x17')];}_0x58d65f[_0xb00b('0x18')](0x194)['send'](_0x2a7231);}else{if(_0x2a7231['name']){delete _0x2a7231[_0xb00b('0x17')];}_0x58d65f['status'](0x1f4)[_0xb00b('0x19')](_0x2a7231);}};}function checkError(){return function(_0x43da66){if(!_0x43da66){throw new RangeError(_0xb00b('0x1a'));}return _0x43da66;};}function respondWithRpcPromise(_0x3501af,_0x56c189){return new BPromise(function(_0x362ee0,_0x4df284){var _0x25a973=amiClient;return _0x25a973[_0xb00b('0x1b')](_0x3501af,_0x56c189)['then'](function(_0x231293){if(_0x231293[_0xb00b('0x1c')]){if(_0x231293['error'][_0xb00b('0x1d')]===0x1f4){return _0x4df284(_0x231293[_0xb00b('0x1c')]['message']);}return _0x362ee0(_0x231293[_0xb00b('0x1c')][_0xb00b('0x1e')]);}else{_0x362ee0(_0x231293[_0xb00b('0x1f')]);}})[_0xb00b('0x20')](function(_0x520e55){_0x4df284(_0x520e55);});});}function getAgent(_0x50be6c){return db[_0xb00b('0x21')]['findOne']({'where':{'id':_0x50be6c,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x16ac55,_0x73b6b0){return new BPromise(function(_0x2592cf,_0x3825af){var _0x1f14fa=respondWithRpcPromise(_0xb00b('0x22'));var _0x15d3b9=getAgent(_0x16ac55);Promise['all']([_0x1f14fa,_0x15d3b9])[_0xb00b('0x23')](function(_0x503c9c){var _0x450129=_0x503c9c[0x0];var _0x348165=_0x503c9c[0x1];var _0x5424ca=_['filter'](_0x450129[_0xb00b('0x24')],function(_0x280ed3){return _0x280ed3[_0xb00b('0x25')]==_0x348165['id']&&_0x280ed3[_0xb00b('0x26')]==_0x73b6b0;});if(_0x5424ca[_0xb00b('0x27')]==0x1){_0x2592cf(_0x348165);}else{_0x3825af(new RangeError(_0xb00b('0x28')+_0x73b6b0+_0xb00b('0x29')));}});});}exports[_0xb00b('0x2a')]=function(_0x149c1a,_0x54e247){logger[_0xb00b('0x12')](_0xb00b('0x2b'),_0x149c1a['body']);var _0x593659=originateValidation[_0xb00b('0xb')](_0x149c1a['body']);if(_0x593659[_0xb00b('0x27')]>0x0){return _0x54e247['status'](0x190)[_0xb00b('0x2c')](_0x593659);}var _0x4117f2=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x338864=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x2f')];var _0x594840=_0x149c1a['body']['callerId'];var _0x347e73=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x30')];return getAgent(_0x4117f2)[_0xb00b('0x23')](function(_0x5cfa60){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x5cfa60[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x5cfa60[_0xb00b('0x17')]),_0xb00b('0x34'),{'callNumber':_0x338864,'callerId':_0x594840,'callbackUrl':_0x347e73});return _0x54e247[_0xb00b('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0xb00b('0x20')](handleError(_0x54e247));};exports['hangup']=function(_0x1c8258,_0x1c5400){logger[_0xb00b('0x12')](_0xb00b('0x35'),_0x1c8258[_0xb00b('0x2d')]);var _0x142cdd=hangupValidation[_0xb00b('0xb')](_0x1c8258['body']);if(_0x142cdd[_0xb00b('0x27')]>0x0){return _0x1c5400[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x142cdd);}var _0xd9c03f=_0x1c8258[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x59fb00=_0x1c8258[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0xd9c03f)['then'](function(_0x17ff34){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x17ff34[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')]('user:%s',_0x17ff34[_0xb00b('0x17')]),_0xb00b('0x36'),{'sessionId':_0x59fb00});return _0x1c5400[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x1c5400));};exports[_0xb00b('0x37')]=function(_0xf6ae0c,_0x10a348){logger[_0xb00b('0x12')](_0xb00b('0x38'),_0xf6ae0c[_0xb00b('0x2d')]);var _0x275664=answerValidation['validate'](_0xf6ae0c[_0xb00b('0x2d')]);if(_0x275664[_0xb00b('0x27')]>0x0){return _0x10a348[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x275664);}var _0x302ded=_0xf6ae0c[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x974a29=_0xf6ae0c[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0x302ded)[_0xb00b('0x23')](function(_0x419113){logger['info'](_0xb00b('0x31'),_0x419113[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x419113[_0xb00b('0x17')]),_0xb00b('0x39'),{'sessionId':_0x974a29});return _0x10a348[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x3a')});})[_0xb00b('0x20')](handleError(_0x10a348));};exports[_0xb00b('0x3b')]=function(_0x3b3031,_0x5dbe00){logger['info']('hold\x20fired:',_0x3b3031[_0xb00b('0x2d')]);var _0x23d858=holdValidation['validate'](_0x3b3031[_0xb00b('0x2d')]);if(_0x23d858[_0xb00b('0x27')]>0x0){return _0x5dbe00[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x23d858);}var _0x4b62b3=_0x3b3031['body'][_0xb00b('0x2e')];var _0x40c2fd=_0x3b3031['body']['sessionId'];return getAgent(_0x4b62b3)[_0xb00b('0x23')](function(_0x3a205d){logger['info'](_0xb00b('0x31'),_0x3a205d['name']);emit(util['format']('user:%s',_0x3a205d[_0xb00b('0x17')]),'webbar:hold',{'sessionId':_0x40c2fd});return _0x5dbe00[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x3c')});})[_0xb00b('0x20')](handleError(_0x5dbe00));};exports[_0xb00b('0x3d')]=function(_0xda60ca,_0x4846c9){logger['info'](_0xb00b('0x3e'),_0xda60ca[_0xb00b('0x2d')]);var _0x559357=unholdValidation[_0xb00b('0xb')](_0xda60ca[_0xb00b('0x2d')]);if(_0x559357['length']>0x0){return _0x4846c9[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x559357);}var _0x3b5d82=_0xda60ca['body']['userId'];var _0x19f907=_0xda60ca[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0x3b5d82)[_0xb00b('0x23')](function(_0x489b49){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x489b49['name']);emit(util['format'](_0xb00b('0x33'),_0x489b49['name']),_0xb00b('0x3f'),{'sessionId':_0x19f907});return _0x4846c9[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x40')});})[_0xb00b('0x20')](handleError(_0x4846c9));};exports[_0xb00b('0x41')]=function(_0x5a3b85,_0x5d52a5){logger['info'](_0xb00b('0x42'),_0x5d52a5[_0xb00b('0x2d')]);var _0x4129ba=callsValidation['validate'](_0x5a3b85[_0xb00b('0x2d')]);if(_0x4129ba[_0xb00b('0x27')]>0x0){return _0x5d52a5[_0xb00b('0x18')](0x190)['json'](_0x4129ba);}var _0x24e826=_0x5a3b85[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x385029=respondWithRpcPromise(_0xb00b('0x22'));var _0x279467=getAgent(_0x24e826);return Promise[_0xb00b('0x43')]([_0x385029,_0x279467])[_0xb00b('0x23')](function(_0x4c3067){var _0x153551=_0x4c3067[0x0];var _0x2cbe80=_0x4c3067[0x1];var _0x1b4860=_['filter'](_0x153551[_0xb00b('0x24')],function(_0x24a8a2){return _0x24a8a2[_0xb00b('0x25')]==_0x2cbe80['id'];});return _0x5d52a5[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'count':_0x1b4860['length'],'rows':_0x1b4860});})[_0xb00b('0x20')](handleError(_0x5d52a5));};exports[_0xb00b('0x44')]=function(_0x2e3c56,_0x1cad79){logger['info'](_0xb00b('0x45'),_0x2e3c56[_0xb00b('0x2d')]);var _0x2c93db=conferenceValidation[_0xb00b('0xb')](_0x2e3c56[_0xb00b('0x2d')]);if(_0x2c93db[_0xb00b('0x27')]>0x0){return _0x1cad79[_0xb00b('0x18')](0x190)['json'](_0x2c93db);}var _0x2b090a=_0x2e3c56['body'][_0xb00b('0x2e')];return getAgent(_0x2b090a)['then'](function(_0x3b3272){logger['info'](_0xb00b('0x31'),_0x3b3272['name']);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x3b3272[_0xb00b('0x17')]),'webbar:conference');return _0x1cad79['status'](0xc8)['json']({'error':![],'message':_0xb00b('0x46')});})[_0xb00b('0x20')](handleError(_0x1cad79));};exports[_0xb00b('0x47')]=function(_0x49246b,_0x311f49){logger[_0xb00b('0x12')](_0xb00b('0x48'),_0x49246b[_0xb00b('0x2d')]);var _0x1f4a96=transferValidation['validate'](_0x49246b[_0xb00b('0x2d')]);if(_0x1f4a96[_0xb00b('0x27')]>0x0){return _0x311f49['status'](0x190)[_0xb00b('0x2c')](_0x1f4a96);}var _0x36ac5a=_0x49246b[_0xb00b('0x2d')]['userId'];var _0x4e8b85=_0x49246b[_0xb00b('0x2d')][_0xb00b('0x26')];var _0x23762e=_0x49246b['body']['transferNumber'];return getAgent(_0x36ac5a)['then'](function(_0x5e9677){logger[_0xb00b('0x12')]('entityFound:',_0x5e9677[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')]('user:%s',_0x5e9677[_0xb00b('0x17')]),_0xb00b('0x49'),{'sessionId':_0x4e8b85,'transferNumber':_0x23762e});return _0x311f49[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x4a')});})['catch'](handleError(_0x311f49));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 62c4c5e..8f63f7a 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 _0x2ef3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','/:id/notify','/:id/send','send','put','update','delete','removeAnswers'];(function(_0x1758db,_0x3a6202){var _0x178066=function(_0x5eab2f){while(--_0x5eab2f){_0x1758db['push'](_0x1758db['shift']());}};_0x178066(++_0x3a6202);}(_0x2ef3,0xba));var _0x32ef=function(_0x1a82f3,_0x57cec8){_0x1a82f3=_0x1a82f3-0x0;var _0x2ba257=_0x2ef3[_0x1a82f3];return _0x2ba257;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['get'](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['get'](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['getApplications']);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x15')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x16')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x32ef('0x17')]);router[_0x32ef('0x15')](_0x32ef('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x32ef('0x15')](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['addApplications']);router[_0x32ef('0x15')](_0x32ef('0x18'),controller['notify']);router[_0x32ef('0x15')](_0x32ef('0x19'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1a')]);router[_0x32ef('0x1b')](_0x32ef('0xd'),auth['isAuthenticated'](),controller[_0x32ef('0x1c')]);router['delete'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller['destroy']);router[_0x32ef('0x1d')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller['removeDispositions']);router['delete'](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1e')]);router['delete']('/:id/users',auth[_0x32ef('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf61e=['getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','notify','send','put','/:id','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','isAuthenticated','describe','show','/:id/dispositions'];(function(_0x565dde,_0x948aa){var _0x2825eb=function(_0x1ae7e2){while(--_0x1ae7e2){_0x565dde['push'](_0x565dde['shift']());}};_0x2825eb(++_0x948aa);}(_0xf61e,0x191));var _0xef61=function(_0x433d9c,_0x34a4d3){_0x433d9c=_0x433d9c-0x0;var _0x5ed768=_0xf61e[_0x433d9c];return _0x5ed768;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0xb')](_0xef61('0x10'),auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0xb')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x13')]);router[_0xef61('0xb')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller[_0xef61('0x15')]);router[_0xef61('0xb')]('/:id/applications',auth[_0xef61('0xd')](),controller['getApplications']);router[_0xef61('0x16')]('/',auth[_0xef61('0xd')](),controller[_0xef61('0x17')]);router[_0xef61('0x16')]('/:id/dispositions',auth[_0xef61('0xd')](),controller[_0xef61('0x18')]);router[_0xef61('0x16')](_0xef61('0x12'),auth['isAuthenticated'](),controller[_0xef61('0x19')]);router[_0xef61('0x16')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x1a')]);router[_0xef61('0x16')](_0xef61('0x1b'),auth[_0xef61('0xd')](),controller[_0xef61('0x1c')]);router[_0xef61('0x16')]('/:id/notify',controller[_0xef61('0x1d')]);router[_0xef61('0x16')]('/:id/send',auth[_0xef61('0xd')](),controller[_0xef61('0x1e')]);router[_0xef61('0x1f')](_0xef61('0x20'),auth[_0xef61('0xd')](),controller[_0xef61('0x21')]);router[_0xef61('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0x23')]);router['delete'](_0xef61('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xef61('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xef61('0x24')]);router[_0xef61('0x22')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller['removeAgents']);module[_0xef61('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 af7cc83..f21d2b9 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 _0x25e5=['generate','ENUM','twilio','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','mandatoryDisposition','randomstring','exports','STRING','name'];(function(_0x423412,_0x4136ab){var _0x37f1db=function(_0x329f0d){while(--_0x329f0d){_0x423412['push'](_0x423412['shift']());}};_0x37f1db(++_0x4136ab);}(_0x25e5,0xcc));var _0x525e=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0x25e5[_0x33080e];return _0x407395;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x525e('0x0'));module[_0x525e('0x1')]={'name':{'type':Sequelize[_0x525e('0x2')],'unique':_0x525e('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x525e('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x525e('0x2')],'defaultValue':function(){return rs[_0x525e('0x4')]();}},'phone':{'type':Sequelize[_0x525e('0x2')]},'type':{'type':Sequelize[_0x525e('0x5')](_0x525e('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0x525e('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x525e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x525e('0x7')],'defaultValue':function(){return _0x525e('0x8');}},'notificationSound':{'type':Sequelize[_0x525e('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x525e('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x525e('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x525e('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x525e('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x525e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x525e('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x525e('0xa')],'comment':_0x525e('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x525e('0x9')],'defaultValue':![],'comment':_0x525e('0xc'),'set':function(_0x2b33a3){if(!_0x2b33a3){this['setDataValue'](_0x525e('0xd'),null);}this[_0x525e('0xe')](_0x525e('0xf'),_0x2b33a3);}},'description':{'type':Sequelize[_0x525e('0x2')]}}; \ No newline at end of file +var _0x0ef9=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x50b90f,_0x543b8f){var _0x4f2960=function(_0x737618){while(--_0x737618){_0x50b90f['push'](_0x50b90f['shift']());}};_0x4f2960(++_0x543b8f);}(_0x0ef9,0x1a9));var _0x90ef=function(_0x2ec3d1,_0x2d82b2){_0x2ec3d1=_0x2ec3d1-0x0;var _0x2551e2=_0x0ef9[_0x2ec3d1];return _0x2551e2;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x90ef('0x0')]={'name':{'type':Sequelize[_0x90ef('0x1')],'unique':_0x90ef('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x90ef('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x90ef('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x90ef('0x3'),_0x90ef('0x4'))},'accountSid':{'type':Sequelize[_0x90ef('0x1')]},'baseUrl':{'type':Sequelize[_0x90ef('0x1')]},'authToken':{'type':Sequelize[_0x90ef('0x1')]},'notificationTemplate':{'type':Sequelize[_0x90ef('0x5')],'defaultValue':function(){return _0x90ef('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x90ef('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x90ef('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x90ef('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x90ef('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x90ef('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x90ef('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x90ef('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x90ef('0x7')],'defaultValue':![],'comment':_0x90ef('0xa'),'set':function(_0x417017){if(!_0x417017){this[_0x90ef('0xb')](_0x90ef('0xc'),null);}this[_0x90ef('0xb')](_0x90ef('0xd'),_0x417017);}},'description':{'type':Sequelize[_0x90ef('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index aae5511..e248a6c 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 _0xa53c=['defaults','contact','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','destroy','WhatsappAccounts','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','filter','merge','VIRTUAL','options','where','findAll','params','Pause','keys','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','length','pick','include','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','order','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','getApplications','whatsapp','account','sinch','statuses','read','message_id','applications','orderBy','Applications','CmContact','Sequelize','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xa53c,0xe2));var _0xca53=function(_0xf4d44d,_0x358937){_0xf4d44d=_0xf4d44d-0x0;var _0x4e44b5=_0xa53c[_0xf4d44d];return _0x4e44b5;};'use strict';var emlformat=require(_0xca53('0x0'));var rimraf=require(_0xca53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xca53('0x2'));var BPromise=require(_0xca53('0x3'));var Mustache=require('mustache');var util=require(_0xca53('0x4'));var path=require('path');var sox=require(_0xca53('0x5'));var csv=require(_0xca53('0x6'));var ejs=require(_0xca53('0x7'));var fs=require('fs');var fs_extra=require(_0xca53('0x8'));var _=require(_0xca53('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xca53('0xa'));var deskjs=require(_0xca53('0xb'));var toCsv=require('to-csv');var querystring=require(_0xca53('0xc'));var Papa=require(_0xca53('0xd'));var Redis=require(_0xca53('0xe'));var authService=require(_0xca53('0xf'));var qs=require(_0xca53('0x10'));var as=require(_0xca53('0x11'));var hardwareService=require(_0xca53('0x12'));var logger=require(_0xca53('0x13'))('api');var utils=require(_0xca53('0x14'));var config=require(_0xca53('0x15'));var licenseUtil=require(_0xca53('0x16'));var db=require(_0xca53('0x17'))['db'];config[_0xca53('0x18')]=_['defaults'](config[_0xca53('0x18')],{'host':_0xca53('0x19'),'port':0x18eb});var socket=require(_0xca53('0x1a'))(new Redis(config[_0xca53('0x18')]));require(_0xca53('0x1b'))['register'](socket);var jayson=require(_0xca53('0x1c'));var client=jayson[_0xca53('0x1d')][_0xca53('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4955e6,_0x57ebe8,_0x2f95a5,_0x425bc4){return new BPromise(function(_0x5b5652,_0x2f6afe){var _0x29bde4=_0x425bc4||client;return _0x29bde4[_0xca53('0x1f')](_0x4955e6,_0x2f95a5)[_0xca53('0x20')](function(_0x3c368f){logger[_0xca53('0x21')](_0xca53('0x22'),_0x57ebe8,'request\x20sent');logger[_0xca53('0x23')](_0xca53('0x24'),_0x57ebe8,'request\x20sent',JSON[_0xca53('0x25')](_0x3c368f));if(_0x3c368f['error']){if(_0x3c368f['error'][_0xca53('0x26')]===0x1f4){logger[_0xca53('0x27')](_0xca53('0x22'),_0x57ebe8,_0x3c368f[_0xca53('0x27')]['message']);return _0x2f6afe(_0x3c368f['error'][_0xca53('0x28')]);}logger[_0xca53('0x27')](_0xca53('0x22'),_0x57ebe8,_0x3c368f[_0xca53('0x27')][_0xca53('0x28')]);return _0x5b5652(_0x3c368f['error'][_0xca53('0x28')]);}else{logger[_0xca53('0x21')](_0xca53('0x22'),_0x57ebe8,_0xca53('0x29'));_0x5b5652(_0x3c368f[_0xca53('0x2a')][_0xca53('0x28')]);}})[_0xca53('0x2b')](function(_0x339005){logger[_0xca53('0x27')](_0xca53('0x22'),_0x57ebe8,_0x339005);_0x2f6afe(_0x339005);});});}function respondWithStatusCode(_0x2121c4,_0xc56f7a){_0xc56f7a=_0xc56f7a||0xcc;return function(_0xcdeb68){if(_0xcdeb68){return _0x2121c4[_0xca53('0x2c')](_0xc56f7a);}return _0x2121c4[_0xca53('0x2d')](_0xc56f7a)[_0xca53('0x2e')]();};}function respondWithResult(_0x25c73e,_0x4ff21a){_0x4ff21a=_0x4ff21a||0xc8;return function(_0x1124bf){if(_0x1124bf){return _0x25c73e[_0xca53('0x2d')](_0x4ff21a)[_0xca53('0x2f')](_0x1124bf);}};}function respondWithFilteredResult(_0x665d15,_0x53a843){return function(_0x1b82a1){if(_0x1b82a1){var _0x539fc9=typeof _0x53a843['offset']==='undefined'&&typeof _0x53a843['limit']==='undefined';var _0x12dd4f=_0x1b82a1[_0xca53('0x30')];var _0x147d1f=_0x539fc9?0x0:_0x53a843['offset'];var _0x2fdc10=_0x539fc9?_0x1b82a1[_0xca53('0x30')]:_0x53a843['offset']+_0x53a843[_0xca53('0x31')];var _0x5e0682;if(_0x2fdc10>=_0x12dd4f){_0x2fdc10=_0x12dd4f;_0x5e0682=0xc8;}else{_0x5e0682=0xce;}_0x665d15[_0xca53('0x2d')](_0x5e0682);return _0x665d15[_0xca53('0x32')](_0xca53('0x33'),_0x147d1f+'-'+_0x2fdc10+'/'+_0x12dd4f)[_0xca53('0x2f')](_0x1b82a1);}return null;};}function patchUpdates(_0x34f0c6){return function(_0x45c0c8){try{jsonpatch[_0xca53('0x34')](_0x45c0c8,_0x34f0c6,!![]);}catch(_0x2d159a){return BPromise[_0xca53('0x35')](_0x2d159a);}return _0x45c0c8[_0xca53('0x36')]();};}function saveUpdates(_0x1d2560,_0x4e35b6){return function(_0x144367){if(_0x144367){return _0x144367['update'](_0x1d2560)[_0xca53('0x20')](function(_0x49e0a1){return _0x49e0a1;});}return null;};}function removeEntity(_0x4ea32e,_0x5e0114){return function(_0x498741){if(_0x498741){return _0x498741[_0xca53('0x37')]()[_0xca53('0x20')](function(){var _0xa1b79=_0x498741['get']({'plain':!![]});var _0x5f3d23=_0xca53('0x38');return db['UserProfileResource'][_0xca53('0x37')]({'where':{'type':_0x5f3d23,'resourceId':_0xa1b79['id']}})[_0xca53('0x20')](function(){return _0x498741;});})[_0xca53('0x20')](function(){_0x4ea32e[_0xca53('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a419,_0xba6f4a){return function(_0x913247){if(!_0x913247){_0x18a419[_0xca53('0x2c')](0x194);}return _0x913247;};}function handleError(_0x8a36ee,_0xd2d731){_0xd2d731=_0xd2d731||0x1f4;return function(_0x4e3132){logger[_0xca53('0x27')](_0x4e3132['stack']);if(_0x4e3132[_0xca53('0x39')]){delete _0x4e3132[_0xca53('0x39')];}_0x8a36ee[_0xca53('0x2d')](_0xd2d731)[_0xca53('0x3a')](_0x4e3132);};}exports[_0xca53('0x3b')]=function(_0x44b648,_0x29b450){var _0x3cbe72={'include':[{'model':db['Pause'],'as':_0xca53('0x3c')}]},_0x4a3aa3={},_0x5b10e4={'count':0x0,'rows':[]};var _0x887213=_[_0xca53('0x3d')](db[_0xca53('0x3e')][_0xca53('0x3f')],function(_0x1e8641){return{'name':_0x1e8641[_0xca53('0x40')],'type':_0x1e8641[_0xca53('0x41')][_0xca53('0x42')]};});_0x4a3aa3['model']=_[_0xca53('0x3d')](_0x887213,'name');_0x4a3aa3[_0xca53('0x43')]=_['keys'](_0x44b648[_0xca53('0x43')]);_0x4a3aa3[_0xca53('0x44')]=_['intersection'](_0x4a3aa3[_0xca53('0x45')],_0x4a3aa3[_0xca53('0x43')]);_0x3cbe72[_0xca53('0x46')]=_[_0xca53('0x47')](_0x4a3aa3['model'],qs['fields'](_0x44b648[_0xca53('0x43')][_0xca53('0x48')]));_0x3cbe72[_0xca53('0x46')]=_0x3cbe72[_0xca53('0x46')]['length']?_0x3cbe72[_0xca53('0x46')]:_0x4a3aa3[_0xca53('0x45')];if(!_0x44b648[_0xca53('0x43')][_0xca53('0x49')](_0xca53('0x4a'))){_0x3cbe72['limit']=qs[_0xca53('0x31')](_0x44b648['query'][_0xca53('0x31')]);_0x3cbe72[_0xca53('0x4b')]=qs['offset'](_0x44b648[_0xca53('0x43')]['offset']);}_0x3cbe72['order']=qs[_0xca53('0x4c')](_0x44b648[_0xca53('0x43')][_0xca53('0x4c')]);_0x3cbe72['where']=qs[_0xca53('0x44')](_['pick'](_0x44b648[_0xca53('0x43')],_0x4a3aa3[_0xca53('0x44')]),_0x887213);if(_0x44b648['query'][_0xca53('0x4d')]){_0x3cbe72['where']=_[_0xca53('0x4e')](_0x3cbe72['where'],{'$or':_['map'](_0x887213,function(_0x5d230){if(_0x5d230[_0xca53('0x41')]!==_0xca53('0x4f')){var _0xf3fb4e={};_0xf3fb4e[_0x5d230[_0xca53('0x39')]]={'$like':'%'+_0x44b648[_0xca53('0x43')][_0xca53('0x4d')]+'%'};return _0xf3fb4e;}})});}_0x3cbe72=_[_0xca53('0x4e')]({},_0x3cbe72,_0x44b648[_0xca53('0x50')]);var _0x1c2571={'where':_0x3cbe72[_0xca53('0x51')]};return db[_0xca53('0x3e')][_0xca53('0x30')](_0x1c2571)[_0xca53('0x20')](function(_0xabcba5){_0x5b10e4[_0xca53('0x30')]=_0xabcba5;if(_0x44b648[_0xca53('0x43')]['includeAll']){_0x3cbe72['include']=[{'all':!![]}];}return db[_0xca53('0x3e')][_0xca53('0x52')](_0x3cbe72);})[_0xca53('0x20')](function(_0x1d24e0){_0x5b10e4['rows']=_0x1d24e0;return _0x5b10e4;})[_0xca53('0x20')](respondWithFilteredResult(_0x29b450,_0x3cbe72))[_0xca53('0x2b')](handleError(_0x29b450,null));};exports['show']=function(_0x5a8aba,_0x5384ff){var _0x4213ea={'raw':![],'where':{'id':_0x5a8aba[_0xca53('0x53')]['id']},'include':[{'model':db[_0xca53('0x54')],'as':'mandatoryDispositionPause'}]},_0x282a30={};_0x282a30[_0xca53('0x45')]=_[_0xca53('0x55')](db[_0xca53('0x3e')][_0xca53('0x3f')]);_0x282a30['query']=_['keys'](_0x5a8aba[_0xca53('0x43')]);_0x282a30[_0xca53('0x44')]=_[_0xca53('0x47')](_0x282a30['model'],_0x282a30[_0xca53('0x43')]);_0x4213ea[_0xca53('0x46')]=_['intersection'](_0x282a30['model'],qs[_0xca53('0x48')](_0x5a8aba['query']['fields']));_0x4213ea[_0xca53('0x46')]=_0x4213ea[_0xca53('0x46')]['length']?_0x4213ea[_0xca53('0x46')]:_0x282a30['model'];if(_0x5a8aba[_0xca53('0x43')][_0xca53('0x56')]){_0x4213ea['include']=[{'all':!![]}];}_0x4213ea=_[_0xca53('0x4e')]({},_0x4213ea,_0x5a8aba[_0xca53('0x50')]);return db['WhatsappAccount'][_0xca53('0x57')](_0x4213ea)[_0xca53('0x20')](handleEntityNotFound(_0x5384ff,null))[_0xca53('0x20')](respondWithResult(_0x5384ff,null))[_0xca53('0x2b')](handleError(_0x5384ff,null));};exports[_0xca53('0x58')]=function(_0x26c989,_0x25e563){return db['WhatsappAccount'][_0xca53('0x58')](_0x26c989['body'],{})['then'](function(_0x7fb2e6){var _0x480d63=_0x26c989[_0xca53('0x59')][_0xca53('0x5a')]({'plain':!![]});if(!_0x480d63)throw new Error(_0xca53('0x5b'));if(_0x480d63[_0xca53('0x5c')]===_0xca53('0x59')){var _0x482ad2=_0x7fb2e6[_0xca53('0x5a')]({'plain':!![]});var _0x488bfa=_0xca53('0x38');return db[_0xca53('0x5d')]['find']({'where':{'name':_0x488bfa,'userProfileId':_0x480d63[_0xca53('0x5e')]},'raw':!![]})[_0xca53('0x20')](function(_0x5484e2){if(_0x5484e2&&_0x5484e2[_0xca53('0x5f')]===0x0){return db['UserProfileResource'][_0xca53('0x58')]({'name':_0x482ad2['name'],'resourceId':_0x482ad2['id'],'type':_0x5484e2[_0xca53('0x39')],'sectionId':_0x5484e2['id']},{})[_0xca53('0x20')](function(){return _0x7fb2e6;});}else{return _0x7fb2e6;}})[_0xca53('0x2b')](function(_0x7e9c79){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7e9c79);throw _0x7e9c79;});}return _0x7fb2e6;})[_0xca53('0x20')](respondWithResult(_0x25e563,0xc9))['catch'](handleError(_0x25e563,null));};exports[_0xca53('0x60')]=function(_0x341b45,_0x33f57f){if(_0x341b45[_0xca53('0x61')]['id']){delete _0x341b45['body']['id'];}return db[_0xca53('0x3e')][_0xca53('0x57')]({'where':{'id':_0x341b45['params']['id']},'include':[{'model':db[_0xca53('0x54')],'as':_0xca53('0x3c')}]})[_0xca53('0x20')](handleEntityNotFound(_0x33f57f,null))[_0xca53('0x20')](saveUpdates(_0x341b45[_0xca53('0x61')],null))['then'](respondWithResult(_0x33f57f,null))['catch'](handleError(_0x33f57f,null));};exports[_0xca53('0x37')]=function(_0x9078ae,_0x3e9938){return db['WhatsappAccount'][_0xca53('0x57')]({'where':{'id':_0x9078ae['params']['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x3e9938,null))[_0xca53('0x20')](removeEntity(_0x3e9938,null))[_0xca53('0x2b')](handleError(_0x3e9938,null));};exports[_0xca53('0x62')]=function(_0x15fda1,_0x120069){return db[_0xca53('0x3e')]['describe']()[_0xca53('0x20')](respondWithResult(_0x120069,null))[_0xca53('0x2b')](handleError(_0x120069,null));};exports[_0xca53('0x63')]=function(_0x6ab492,_0x25b82a,_0x48a325){if(_0x6ab492[_0xca53('0x61')]['id']){delete _0x6ab492['body']['id'];}return db['WhatsappAccount'][_0xca53('0x57')]({'where':{'id':_0x6ab492[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x25b82a,null))[_0xca53('0x20')](function(_0x31414f){if(_0x31414f){_0x6ab492[_0xca53('0x61')][_0xca53('0x64')]=_0x31414f['id'];return db[_0xca53('0x65')][_0xca53('0x58')](_0x6ab492[_0xca53('0x61')]);}})[_0xca53('0x20')](respondWithResult(_0x25b82a,null))[_0xca53('0x2b')](handleError(_0x25b82a,null));};exports[_0xca53('0x66')]=function(_0x42073f,_0x201f8c,_0x2c53cd){var _0x4ae9ef={'raw':![],'where':{}};var _0x5437eb={};var _0x454f75={'count':0x0,'rows':[]};return db[_0xca53('0x3e')][_0xca53('0x67')]({'where':{'id':_0x42073f['params']['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x201f8c,null))['then'](function(_0xe790f1){if(_0xe790f1){_0x5437eb[_0xca53('0x45')]=_[_0xca53('0x55')](db[_0xca53('0x65')][_0xca53('0x3f')]);_0x5437eb[_0xca53('0x43')]=_['keys'](_0x42073f[_0xca53('0x43')]);_0x5437eb[_0xca53('0x44')]=_[_0xca53('0x47')](_0x5437eb['model'],_0x5437eb[_0xca53('0x43')]);_0x4ae9ef[_0xca53('0x46')]=_[_0xca53('0x47')](_0x5437eb[_0xca53('0x45')],qs['fields'](_0x42073f[_0xca53('0x43')]['fields']));_0x4ae9ef[_0xca53('0x46')]=_0x4ae9ef['attributes'][_0xca53('0x68')]?_0x4ae9ef[_0xca53('0x46')]:_0x5437eb[_0xca53('0x45')];if(!_0x42073f['query'][_0xca53('0x49')]('nolimit')){_0x4ae9ef[_0xca53('0x31')]=qs[_0xca53('0x31')](_0x42073f[_0xca53('0x43')][_0xca53('0x31')]);_0x4ae9ef[_0xca53('0x4b')]=qs[_0xca53('0x4b')](_0x42073f[_0xca53('0x43')][_0xca53('0x4b')]);}_0x4ae9ef['order']=qs[_0xca53('0x4c')](_0x42073f[_0xca53('0x43')]['sort']);_0x4ae9ef[_0xca53('0x51')]=qs['filters'](_[_0xca53('0x69')](_0x42073f[_0xca53('0x43')],_0x5437eb[_0xca53('0x44')]));_0x4ae9ef[_0xca53('0x51')][_0xca53('0x64')]=_0xe790f1['id'];if(_0x42073f['query'][_0xca53('0x4d')]){_0x4ae9ef['where']=_[_0xca53('0x4e')](_0x4ae9ef[_0xca53('0x51')],{'$or':_[_0xca53('0x3d')](_0x4ae9ef[_0xca53('0x46')],function(_0x2e38a0){var _0x5c1ee0={};_0x5c1ee0[_0x2e38a0]={'$like':'%'+_0x42073f[_0xca53('0x43')][_0xca53('0x4d')]+'%'};return _0x5c1ee0;})});}_0x4ae9ef=_[_0xca53('0x4e')]({},_0x4ae9ef,_0x42073f[_0xca53('0x50')]);return db[_0xca53('0x65')][_0xca53('0x30')]({'where':_0x4ae9ef['where']})[_0xca53('0x20')](function(_0x2c352f){_0x454f75['count']=_0x2c352f;if(_0x42073f[_0xca53('0x43')][_0xca53('0x56')]){_0x4ae9ef[_0xca53('0x6a')]=[{'all':!![]}];}return db['Disposition'][_0xca53('0x52')](_0x4ae9ef);})[_0xca53('0x20')](function(_0x3d58c1){_0x454f75['rows']=_0x3d58c1;return _0x454f75;});}})[_0xca53('0x20')](respondWithFilteredResult(_0x201f8c,_0x4ae9ef))['catch'](handleError(_0x201f8c,null));};exports[_0xca53('0x6b')]=function(_0x3132a5,_0x4dcfc3,_0x5c5e1a){return db['WhatsappAccount'][_0xca53('0x57')]({'where':{'id':_0x3132a5[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x4dcfc3,null))['then'](function(_0x15512c){if(_0x15512c){return _0x15512c[_0xca53('0x6b')](_0x3132a5[_0xca53('0x43')][_0xca53('0x6c')]);}})[_0xca53('0x20')](respondWithStatusCode(_0x4dcfc3,null))['catch'](handleError(_0x4dcfc3,null));};exports[_0xca53('0x6d')]=function(_0x5e4904,_0x220ed0,_0x3a3935){if(_0x5e4904[_0xca53('0x61')]['id']){delete _0x5e4904['body']['id'];}return db['WhatsappAccount'][_0xca53('0x57')]({'where':{'id':_0x5e4904[_0xca53('0x53')]['id']}})['then'](handleEntityNotFound(_0x220ed0,null))[_0xca53('0x20')](function(_0x3819ac){if(_0x3819ac){_0x5e4904['body'][_0xca53('0x64')]=_0x3819ac['id'];return db[_0xca53('0x6e')][_0xca53('0x58')](_0x5e4904['body']);}})[_0xca53('0x20')](respondWithResult(_0x220ed0,null))[_0xca53('0x2b')](handleError(_0x220ed0,null));};exports['getAnswers']=function(_0x25990f,_0x51b1be,_0x1e92df){var _0x4baf86={'raw':![],'where':{}};var _0x29d83f={};var _0x1bd6a6={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x25990f[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x51b1be,null))[_0xca53('0x20')](function(_0x4134eb){if(_0x4134eb){_0x29d83f[_0xca53('0x45')]=_[_0xca53('0x55')](db[_0xca53('0x6e')][_0xca53('0x3f')]);_0x29d83f[_0xca53('0x43')]=_[_0xca53('0x55')](_0x25990f[_0xca53('0x43')]);_0x29d83f[_0xca53('0x44')]=_[_0xca53('0x47')](_0x29d83f['model'],_0x29d83f[_0xca53('0x43')]);_0x4baf86[_0xca53('0x46')]=_[_0xca53('0x47')](_0x29d83f['model'],qs[_0xca53('0x48')](_0x25990f[_0xca53('0x43')][_0xca53('0x48')]));_0x4baf86[_0xca53('0x46')]=_0x4baf86[_0xca53('0x46')][_0xca53('0x68')]?_0x4baf86[_0xca53('0x46')]:_0x29d83f[_0xca53('0x45')];if(!_0x25990f['query'][_0xca53('0x49')](_0xca53('0x4a'))){_0x4baf86[_0xca53('0x31')]=qs['limit'](_0x25990f[_0xca53('0x43')][_0xca53('0x31')]);_0x4baf86[_0xca53('0x4b')]=qs[_0xca53('0x4b')](_0x25990f[_0xca53('0x43')][_0xca53('0x4b')]);}_0x4baf86['order']=qs[_0xca53('0x4c')](_0x25990f['query']['sort']);_0x4baf86[_0xca53('0x51')]=qs[_0xca53('0x44')](_[_0xca53('0x69')](_0x25990f[_0xca53('0x43')],_0x29d83f[_0xca53('0x44')]));_0x4baf86[_0xca53('0x51')][_0xca53('0x64')]=_0x4134eb['id'];if(_0x25990f[_0xca53('0x43')][_0xca53('0x4d')]){_0x4baf86[_0xca53('0x51')]=_[_0xca53('0x4e')](_0x4baf86['where'],{'$or':_['map'](_0x4baf86[_0xca53('0x46')],function(_0x10684e){var _0x321535={};_0x321535[_0x10684e]={'$like':'%'+_0x25990f[_0xca53('0x43')][_0xca53('0x4d')]+'%'};return _0x321535;})});}_0x4baf86=_[_0xca53('0x4e')]({},_0x4baf86,_0x25990f['options']);return db[_0xca53('0x6e')][_0xca53('0x30')]({'where':_0x4baf86[_0xca53('0x51')]})[_0xca53('0x20')](function(_0x557c35){_0x1bd6a6[_0xca53('0x30')]=_0x557c35;if(_0x25990f[_0xca53('0x43')][_0xca53('0x56')]){_0x4baf86['include']=[{'all':!![]}];}return db[_0xca53('0x6e')][_0xca53('0x52')](_0x4baf86);})[_0xca53('0x20')](function(_0x11507e){_0x1bd6a6[_0xca53('0x6f')]=_0x11507e;return _0x1bd6a6;});}})[_0xca53('0x20')](respondWithFilteredResult(_0x51b1be,_0x4baf86))['catch'](handleError(_0x51b1be,null));};exports[_0xca53('0x70')]=function(_0x308a47,_0x5b07b8,_0x185672){return db[_0xca53('0x3e')][_0xca53('0x57')]({'where':{'id':_0x308a47[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x5b07b8,null))[_0xca53('0x20')](function(_0x4dce01){if(_0x4dce01){return _0x4dce01[_0xca53('0x70')](_0x308a47[_0xca53('0x43')][_0xca53('0x6c')]);}})[_0xca53('0x20')](respondWithStatusCode(_0x5b07b8,null))[_0xca53('0x2b')](handleError(_0x5b07b8,null));};exports[_0xca53('0x71')]=function(_0x339e31,_0x58f41c,_0x4ee8de){return db['WhatsappAccount'][_0xca53('0x57')]({'where':{'id':_0x339e31[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x58f41c,null))[_0xca53('0x20')](function(_0x2b6401){if(_0x2b6401){return _0x2b6401['addAgents'](_0x339e31['body'][_0xca53('0x6c')],_[_0xca53('0x72')](_0x339e31['body'],['ids','id'])||{})[_0xca53('0x73')](function(_0x330bf7){for(var _0x234665=0x0;_0x234665<_0x339e31[_0xca53('0x61')][_0xca53('0x6c')][_0xca53('0x68')];_0x234665+=0x1){socket[_0xca53('0x74')](_0xca53('0x75'),{'UserId':Number(_0x339e31[_0xca53('0x61')]['ids'][_0x234665]),'WhatsappAccountId':Number(_0x339e31['params']['id'])});}return _0x330bf7;});}})[_0xca53('0x20')](respondWithResult(_0x58f41c,null))[_0xca53('0x2b')](handleError(_0x58f41c,null));};exports[_0xca53('0x76')]=function(_0x2e07d3,_0x31b14a,_0x3aefba){return db[_0xca53('0x3e')][_0xca53('0x57')]({'where':{'id':_0x2e07d3[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x31b14a,null))[_0xca53('0x20')](function(_0xd6491b){if(_0xd6491b){return _0xd6491b[_0xca53('0x76')](_0x2e07d3[_0xca53('0x43')][_0xca53('0x6c')])[_0xca53('0x20')](function(){if(_[_0xca53('0x77')](_0x2e07d3[_0xca53('0x43')]['ids'])){for(var _0x23912e=0x0;_0x23912e<_0x2e07d3[_0xca53('0x43')]['ids'][_0xca53('0x68')];_0x23912e+=0x1){socket[_0xca53('0x74')](_0xca53('0x78'),{'UserId':Number(_0x2e07d3[_0xca53('0x43')][_0xca53('0x6c')][_0x23912e]),'WhatsappAccountId':Number(_0x2e07d3[_0xca53('0x53')]['id'])});}}else{socket[_0xca53('0x74')](_0xca53('0x78'),{'UserId':Number(_0x2e07d3[_0xca53('0x43')]['ids']),'WhatsappAccountId':Number(_0x2e07d3[_0xca53('0x53')]['id'])});}});}})[_0xca53('0x20')](respondWithStatusCode(_0x31b14a,null))[_0xca53('0x2b')](handleError(_0x31b14a,null));};exports[_0xca53('0x79')]=function(_0x2194e4,_0x1839d6,_0x590144){var _0x308b6f={};var _0x32efdf={};var _0x23155a;var _0x2ac44c;return db[_0xca53('0x3e')][_0xca53('0x67')]({'where':{'id':_0x2194e4[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x1839d6,null))[_0xca53('0x20')](function(_0x5e00ac){if(_0x5e00ac){_0x23155a=_0x5e00ac;_0x32efdf[_0xca53('0x45')]=_['keys'](db[_0xca53('0x7a')][_0xca53('0x3f')]);_0x32efdf['query']=_[_0xca53('0x55')](_0x2194e4[_0xca53('0x43')]);_0x32efdf['filters']=_[_0xca53('0x47')](_0x32efdf[_0xca53('0x45')],_0x32efdf['query']);_0x308b6f[_0xca53('0x46')]=_[_0xca53('0x47')](_0x32efdf[_0xca53('0x45')],qs[_0xca53('0x48')](_0x2194e4['query']['fields']));_0x308b6f[_0xca53('0x46')]=_0x308b6f[_0xca53('0x46')][_0xca53('0x68')]?_0x308b6f[_0xca53('0x46')]:_0x32efdf['model'];_0x308b6f[_0xca53('0x7b')]=qs['sort'](_0x2194e4['query'][_0xca53('0x4c')]);_0x308b6f['where']=qs[_0xca53('0x44')](_['pick'](_0x2194e4[_0xca53('0x43')],_0x32efdf[_0xca53('0x44')]));if(_0x2194e4[_0xca53('0x43')][_0xca53('0x4d')]){_0x308b6f[_0xca53('0x51')]=_['merge'](_0x308b6f[_0xca53('0x51')],{'$or':_[_0xca53('0x3d')](_0x308b6f['attributes'],function(_0x5d71c5){var _0x1bcd36={};_0x1bcd36[_0x5d71c5]={'$like':'%'+_0x2194e4['query']['filter']+'%'};return _0x1bcd36;})});}_0x308b6f=_[_0xca53('0x4e')]({},_0x308b6f,_0x2194e4['options']);return _0x23155a[_0xca53('0x79')](_0x308b6f);}})[_0xca53('0x20')](function(_0x76c30f){if(_0x76c30f){_0x2ac44c=_0x76c30f[_0xca53('0x68')];if(!_0x2194e4[_0xca53('0x43')][_0xca53('0x49')](_0xca53('0x4a'))){_0x308b6f[_0xca53('0x31')]=qs[_0xca53('0x31')](_0x2194e4[_0xca53('0x43')]['limit']);_0x308b6f[_0xca53('0x4b')]=qs['offset'](_0x2194e4[_0xca53('0x43')][_0xca53('0x4b')]);}return _0x23155a['getAgents'](_0x308b6f);}})['then'](function(_0x215771){if(_0x215771){return _0x215771?{'count':_0x2ac44c,'rows':_0x215771}:null;}})[_0xca53('0x20')](respondWithResult(_0x1839d6,null))['catch'](handleError(_0x1839d6,null));};exports['addApplications']=function(_0x935aa8,_0x123a64){var _0x4cd700=_0x935aa8[_0xca53('0x53')]['id'];var _0x36a488=_0x935aa8[_0xca53('0x61')];var _0x140934=0xc8;var _0x534f9a=null;return db[_0xca53('0x7c')][_0xca53('0x7d')]({'isolationLevel':db[_0xca53('0x7c')][_0xca53('0x7e')][_0xca53('0x7f')][_0xca53('0x80')]},function(_0x2a5edf){return db[_0xca53('0x3e')][_0xca53('0x67')]({'where':{'id':_0x4cd700},'transaction':_0x2a5edf})[_0xca53('0x20')](function(_0x6828f9){if(_0x6828f9){return db[_0xca53('0x81')]['destroy']({'where':{'WhatsappAccountId':_0x4cd700},'transaction':_0x2a5edf})[_0xca53('0x20')](function(){var _0x4e4882=_[_0xca53('0x3d')](_0x36a488,function(_0xb7301a){_0xb7301a['WhatsappAccountId']=_0x4cd700;return _0xb7301a;});return db[_0xca53('0x81')][_0xca53('0x82')](_0x4e4882,{'transaction':_0x2a5edf});});}else{_0x140934=0x194;_0x534f9a=[];}});})[_0xca53('0x20')](function(){if(_0x140934!==0x194){return db[_0xca53('0x81')][_0xca53('0x83')]({'where':{'WhatsappAccountId':_0x4cd700},'order':_0xca53('0x84')})[_0xca53('0x20')](function(_0x2ad0c3){_0x534f9a=_0x2ad0c3;});}})['catch'](function(_0x1e688a){_0x140934=0x1f4;logger[_0xca53('0x27')](_0x1e688a[_0xca53('0x85')]);if(_0x1e688a[_0xca53('0x39')]){delete _0x1e688a[_0xca53('0x39')];}_0x534f9a=_0x1e688a;})['finally'](function(){if(_0x534f9a===null){_0x123a64['sendStatus'](_0x140934);}else{if(_0x140934===0x1f4){_0x123a64[_0xca53('0x2d')](_0x140934)[_0xca53('0x3a')](_0x534f9a);}else{_0x123a64[_0xca53('0x2d')](_0x140934)['json'](_0x534f9a);}}});};exports['getApplications']=function(_0x107c80,_0x31286c,_0xaf9d0b){var _0x1bd473={};var _0x5ed01f={};var _0x326244;var _0x35cad5;return db[_0xca53('0x3e')][_0xca53('0x67')]({'where':{'id':_0x107c80[_0xca53('0x53')]['id']}})[_0xca53('0x20')](handleEntityNotFound(_0x31286c,null))[_0xca53('0x20')](function(_0xaecc6d){if(_0xaecc6d){_0x326244=_0xaecc6d;_0x5ed01f['model']=_[_0xca53('0x55')](db[_0xca53('0x81')][_0xca53('0x3f')]);_0x5ed01f['query']=_[_0xca53('0x55')](_0x107c80[_0xca53('0x43')]);_0x5ed01f[_0xca53('0x44')]=_['intersection'](_0x5ed01f['model'],_0x5ed01f[_0xca53('0x43')]);_0x1bd473[_0xca53('0x46')]=_[_0xca53('0x47')](_0x5ed01f[_0xca53('0x45')],qs[_0xca53('0x48')](_0x107c80['query'][_0xca53('0x48')]));_0x1bd473[_0xca53('0x46')]=_0x1bd473['attributes'][_0xca53('0x68')]?_0x1bd473[_0xca53('0x46')]:_0x5ed01f[_0xca53('0x45')];_0x1bd473[_0xca53('0x7b')]=qs[_0xca53('0x4c')](_0x107c80[_0xca53('0x43')]['sort']);_0x1bd473[_0xca53('0x51')]=qs[_0xca53('0x44')](_['pick'](_0x107c80[_0xca53('0x43')],_0x5ed01f[_0xca53('0x44')]));if(_0x107c80[_0xca53('0x43')][_0xca53('0x4d')]){_0x1bd473[_0xca53('0x51')]=_[_0xca53('0x4e')](_0x1bd473[_0xca53('0x51')],{'$or':_[_0xca53('0x3d')](_0x1bd473[_0xca53('0x46')],function(_0x4a38a3){var _0x51588e={};_0x51588e[_0x4a38a3]={'$like':'%'+_0x107c80['query'][_0xca53('0x4d')]+'%'};return _0x51588e;})});}_0x1bd473=_[_0xca53('0x4e')]({},_0x1bd473,_0x107c80[_0xca53('0x50')]);return _0x326244[_0xca53('0x86')](_0x1bd473);}})['then'](function(_0x4e26e0){if(_0x4e26e0){_0x35cad5=_0x4e26e0[_0xca53('0x68')];if(!_0x107c80['query']['hasOwnProperty'](_0xca53('0x4a'))){_0x1bd473[_0xca53('0x31')]=qs[_0xca53('0x31')](_0x107c80[_0xca53('0x43')][_0xca53('0x31')]);_0x1bd473[_0xca53('0x4b')]=qs['offset'](_0x107c80[_0xca53('0x43')][_0xca53('0x4b')]);}return _0x326244[_0xca53('0x86')](_0x1bd473);}})[_0xca53('0x20')](function(_0x11dd7a){if(_0x11dd7a){return _0x11dd7a?{'count':_0x35cad5,'rows':_0x11dd7a}:null;}})[_0xca53('0x20')](respondWithResult(_0x31286c,null))['catch'](handleError(_0x31286c,null));};exports['notify']=function(_0x1cf7af,_0x347d94,_0x4069e9){var _0x339035={'channel':_0xca53('0x87')};var _0x310d05=[];var _0x65718=[];var _0x2612b2={};return db[_0xca53('0x3e')][_0xca53('0x57')]({'where':{'id':_0x1cf7af['params']['id']},'include':[{'model':db[_0xca53('0x81')],'as':'Applications'}]})[_0xca53('0x20')](handleEntityNotFound(_0x347d94,null))[_0xca53('0x20')](function(_0x4d7379){_0x339035[_0xca53('0x88')]=_0x4d7379;if(_0x339035[_0xca53('0x88')]&&_0x339035['account']['type']===_0xca53('0x89')&&_0x1cf7af['body'][_0xca53('0x8a')]){if(_0x1cf7af[_0xca53('0x61')][_0xca53('0x8a')]['length']===0x0)return;if(_0x1cf7af[_0xca53('0x61')]['statuses'][0x0]['state']!==_0xca53('0x8b'))return;return db['WhatsappMessage'][_0xca53('0x60')]({'read':!![],'readAt':_0x1cf7af[_0xca53('0x61')][_0xca53('0x8a')][0x0]['timestamp']},{'where':{'messageId':_0x1cf7af['body'][_0xca53('0x8a')][0x0][_0xca53('0x8c')]},'individualHooks':!![]})[_0xca53('0x20')](function(_0x4e65a2){return _0x347d94[_0xca53('0x2d')](0xc8)[_0xca53('0x2f')](_0x4e65a2);});}_0x339035[_0xca53('0x8d')]=_[_0xca53('0x8e')](_0x4d7379['Applications'],[_0xca53('0x84')],['asc']);if(_0x339035['account'][_0xca53('0x8f')]){delete _0x339035[_0xca53('0x88')][_0xca53('0x8f')];}return db[_0xca53('0x90')][_0xca53('0x62')]()[_0xca53('0x20')](function(_0x2bf6f1){if(!_0x2bf6f1){throw new db[(_0xca53('0x91'))]['ValidationError']('no\x20available\x20attributes');}_0x310d05=_['difference'](_[_0xca53('0x55')](_0x2bf6f1),[_0xca53('0x92'),_0xca53('0x93')]);_0x65718=_[_0xca53('0x94')](_[_0xca53('0x55')](_0x2bf6f1),[_0xca53('0x92'),_0xca53('0x93'),_0xca53('0x95'),'ListId']);_0x339035[_0xca53('0x61')]={'mapKey':_0xca53('0x96')};if(_0x339035[_0xca53('0x88')]&&_0x339035[_0xca53('0x88')]['type']===_0xca53('0x97')){_0x339035['body'][_0xca53('0x98')]=_0x1cf7af[_0xca53('0x61')][_0xca53('0x99')][_0xca53('0x9a')](_0xca53('0x9b'),'');_0x339035[_0xca53('0x61')][_0xca53('0x61')]=_0x1cf7af[_0xca53('0x61')][_0xca53('0x9c')];_0x339035['body'][_0xca53('0x9d')]=_0x1cf7af[_0xca53('0x61')][_0xca53('0x9e')];}if(_0x339035['account']&&_0x339035[_0xca53('0x88')][_0xca53('0x41')]===_0xca53('0x89')){_0x339035[_0xca53('0x61')][_0xca53('0x98')]=_0x1cf7af[_0xca53('0x61')]['notifications'][0x0]['from'];_0x339035['body'][_0xca53('0x61')]=_0x1cf7af[_0xca53('0x61')][_0xca53('0x9f')][0x0][_0xca53('0x28')][_0xca53('0x61')];_0x339035['body'][_0xca53('0x9d')]=_0x1cf7af[_0xca53('0x61')][_0xca53('0x9f')][0x0]['message_id'];}if(_0x339035[_0xca53('0x61')]['id']){delete _0x339035['body']['id'];}if(_[_0xca53('0xa0')](_0x339035['body']['from'])){throw new db[(_0xca53('0x91'))]['ValidationError'](_0xca53('0xa1'));}if(_[_0xca53('0xa0')](_0x339035[_0xca53('0x61')][_0xca53('0x61')])||_0x339035[_0xca53('0x61')]['body']===''){throw new db[(_0xca53('0x91'))]['ValidationError'](_0xca53('0xa2'));}if(_['isNil'](_0x339035['body'][_0xca53('0xa3')])){throw new db[(_0xca53('0x91'))][(_0xca53('0xa4'))](_0xca53('0xa5')+_0x65718);}if(!_[_0xca53('0xa6')](_0x65718,_0x339035[_0xca53('0x61')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xca53('0xa7')+_0x65718);}_0x2612b2[_0x339035[_0xca53('0x61')][_0xca53('0xa3')]]=_0x339035[_0xca53('0x61')][_0xca53('0x98')];return db[_0xca53('0xa8')][_0xca53('0x57')]({'where':{'id':_0x339035[_0xca53('0x88')]['ListId']},'include':[{'model':db[_0xca53('0x90')],'as':_0xca53('0xa9'),'where':_0x2612b2,'limit':0x1,'order':[[_0xca53('0x93'),_0xca53('0xaa')]]}]});})[_0xca53('0x20')](handleEntityNotFound(_0x347d94,null))[_0xca53('0x20')](function(_0x90b04b){if(_0x90b04b){_0x339035[_0xca53('0xab')]=_['omit'](_0x90b04b,[_0xca53('0xa9')]);if(_0x90b04b[_0xca53('0xa9')][_0xca53('0x68')]){return _0x90b04b[_0xca53('0xa9')][0x0];}var _0x280cfb=_[_0xca53('0xac')](_0x339035[_0xca53('0x61')],{'firstName':_0x339035[_0xca53('0x61')][_0xca53('0x98')],'ListId':_0x90b04b['id']});_0x280cfb[_0x339035['body'][_0xca53('0xa3')]]=_0x339035[_0xca53('0x61')][_0xca53('0x98')];return db['CmContact'][_0xca53('0x58')](_0x280cfb,{'fields':_0x310d05,'raw':!![]});}})[_0xca53('0x20')](handleEntityNotFound(_0x347d94,null))['then'](function(_0x15c562){if(_0x15c562){_0x339035[_0xca53('0xad')]=_0x15c562;var _0x676078={'ContactId':_0x15c562['id'],'phone':_0x339035[_0xca53('0x61')]['from'],'WhatsappAccountId':_0x1cf7af[_0xca53('0x53')]['id']};var _0x180c56={'ContactId':_0x15c562['id'],'WhatsappAccountId':_0x1cf7af[_0xca53('0x53')]['id'],'closed':![]};return db[_0xca53('0xae')]['find']({'where':_0x180c56})[_0xca53('0x20')](function(_0x131934){if(_0x131934){return[_0x131934,![]];}return db[_0xca53('0xae')]['create'](_0x676078)[_0xca53('0x20')](function(_0x5408ff){return[_0x5408ff,!![]];});});}})['spread'](function(_0x5ac6bb,_0x54158f){_0x339035[_0xca53('0xaf')]=_0x5ac6bb[_0xca53('0x5a')]({'plain':!![]});_0x339035[_0xca53('0xaf')][_0xca53('0xb0')]=![];if(_0x54158f){if(_0x339035['account']['autoclose']){_0x339035[_0xca53('0x8d')][_0xca53('0xb1')]({'id':0x0,'priority':_0x339035['applications'][_0xca53('0x68')]+0x1,'app':_0xca53('0xb2'),'appdata':_0xca53('0xb3'),'interval':_0xca53('0xb4')});}_0x339035[_0xca53('0xaf')]['created']=!![];}return db[_0xca53('0xb5')][_0xca53('0x58')]({'phone':_0x339035['body'][_0xca53('0x98')],'messageId':_0x339035[_0xca53('0x61')][_0xca53('0x9d')],'body':_0x339035[_0xca53('0x61')]['body'],'WhatsappAccountId':_0x1cf7af[_0xca53('0x53')]['id'],'WhatsappInteractionId':_0x5ac6bb['id'],'direction':'in','ContactId':_0x5ac6bb[_0xca53('0xb6')],'AttachmentId':_0x339035['body'][_0xca53('0xb7')]});})['then'](function(_0x38083e){_0x339035['message']=_0x38083e;if(_0x339035[_0xca53('0xaf')]['UserId']){return db['User'][_0xca53('0x57')]({'attributes':['id',_0xca53('0x39')],'where':{'id':_0x339035[_0xca53('0xaf')][_0xca53('0xb8')]}})[_0xca53('0x20')](function(_0x55ea89){if(_0x55ea89){_0x339035[_0xca53('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xca53('0xb9'),'appdata':_0x55ea89[_0xca53('0x39')]+','+(_0x339035[_0xca53('0x88')][_0xca53('0xba')]||0xa),'interval':_0xca53('0xb4')});}return respondWithRpcPromise(_0xca53('0xbb'),_0xca53('0xbc'),_0x339035);});}return respondWithRpcPromise(_0xca53('0xbb'),'startRouting',_0x339035);})[_0xca53('0x20')](function(_0x559a77){if(_0x559a77){var _0x56c2fb=0xc8;var _0x3ac488=_0xca53('0xbd');logger[_0xca53('0x21')](_0xca53('0x24'),_0x3ac488,_0x56c2fb,_0xca53('0xbe'));logger[_0xca53('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3ac488,_0x56c2fb,_0xca53('0xbe'),JSON[_0xca53('0x25')](_0x559a77));if(_0x339035[_0xca53('0x88')]['type']===_0xca53('0x97')){return _0x347d94[_0xca53('0x2d')](_0x56c2fb)['set'](_0xca53('0xbf'),_0xca53('0xc0'))[_0xca53('0x3a')](_0xca53('0xc1'));}else{return _0x347d94[_0xca53('0x2d')](_0x56c2fb)[_0xca53('0x2f')](_0x559a77);}}});})[_0xca53('0x2b')](handleError(_0x347d94,null));};exports[_0xca53('0x3a')]=function(_0xaf4e80,_0x491d66,_0x36ab75){var _0x3db563,_0x5808f1,_0x5bee85;if(_['isNil'](_0xaf4e80[_0xca53('0x61')][_0xca53('0x61')])||_0xaf4e80['body']['body']===''){throw new db[(_0xca53('0x91'))][(_0xca53('0xa4'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xca53('0xa0')](_0xaf4e80[_0xca53('0x61')]['to'])){throw new db[(_0xca53('0x91'))][(_0xca53('0xa4'))](_0xca53('0xc2'));}_0x3db563=_0xaf4e80['body']['to'];return db[_0xca53('0x3e')][_0xca53('0x57')]({'where':{'id':_0xaf4e80[_0xca53('0x53')]['id']},'include':[{'model':db[_0xca53('0xa8')],'as':_0xca53('0xc3'),'include':[{'model':db[_0xca53('0x90')],'as':'Contacts','where':{'mobile':_0x3db563},'limit':0x1,'order':[[_0xca53('0x93'),_0xca53('0xaa')]]}]}]})[_0xca53('0x20')](handleEntityNotFound(_0x491d66,null))['then'](function(_0x57e309){if(_0x57e309&&_0x57e309[_0xca53('0xc3')]){_0x5808f1=_0x57e309[_0xca53('0x5a')]({'plain':!![]});if(_0x5808f1['List']&&_0x5808f1['List']['Contacts'][_0xca53('0x68')]){return _0x5808f1['List']['Contacts'][0x0];}return db[_0xca53('0x90')][_0xca53('0x58')](_[_0xca53('0xac')](_0xaf4e80['body'],{'firstName':_0x3db563,'mobile':_0x3db563,'phone':_0x3db563,'ListId':_0x5808f1['ListId']}));}})[_0xca53('0x20')](handleEntityNotFound(_0x491d66,null))[_0xca53('0x20')](function(_0x400e94){if(_0x400e94){_0x5bee85=_0x400e94;return db[_0xca53('0xae')][_0xca53('0x57')]({'where':{'ContactId':_0x5bee85['id'],'closed':![],'WhatsappAccountId':_0x5808f1['id']}})['then'](function(_0x122632){if(_0x122632){return[_0x122632,![]];}return db[_0xca53('0xae')][_0xca53('0x58')]({'UserId':_0xaf4e80['user']['id'],'ContactId':_0x5bee85['id'],'WhatsappAccountId':_0x5808f1['id'],'phone':_0x3db563,'firstMsgDirection':_0xca53('0xc4'),'Messages':[_[_0xca53('0x4e')](_0xaf4e80['body'],{'read':![],'body':_0xaf4e80[_0xca53('0x61')][_0xca53('0x61')],'phone':_0x3db563,'WhatsappAccountId':_0x5808f1['id'],'UserId':_0xaf4e80[_0xca53('0x59')]['id'],'ContactId':_0x5bee85['id']})]},{'include':[{'model':db[_0xca53('0xb5')],'as':_0xca53('0xc5')}]})['then'](function(_0x2358c5){return[_0x2358c5,!![]];});});}})[_0xca53('0x73')](function(_0x3ddc2b,_0xfa3782){if(_0xfa3782){return _0x3ddc2b;}return db[_0xca53('0xb5')][_0xca53('0x58')](_[_0xca53('0x4e')](_0xaf4e80[_0xca53('0x61')],{'read':![],'body':_0xaf4e80[_0xca53('0x61')][_0xca53('0x61')],'phone':_0x3db563,'WhatsappAccountId':_0x5808f1['id'],'WhatsappInteractionId':_0x3ddc2b['id'],'UserId':_0xaf4e80['user']['id'],'ContactId':_0x5bee85['id']}))[_0xca53('0x20')](function(_0x393d05){_0x3ddc2b[_0xca53('0xc6')]['Messages']=[];_0x3ddc2b[_0xca53('0xc6')][_0xca53('0xc5')][_0xca53('0xb1')](_0x393d05[_0xca53('0xc6')]);return _0x3ddc2b;});})[_0xca53('0x20')](respondWithResult(_0x491d66,null))[_0xca53('0x2b')](handleError(_0x491d66,null));}; \ No newline at end of file +var _0xbf69=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','Contacts','defaults','contact','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','../../mysqldb','redis','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','code','message','result','catch','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','sendStatus','stack','name','index','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','pick','filter','merge','where','options','findAll','rows','show','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','sort','Disposition','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','include','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','nolimit','sequelize','transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','Applications','account','statuses','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','mobile','twilio','replace','whatsapp:','MessageSid','sinch','from','notifications','messageId','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x4d3955,_0x4d1df6){var _0x5c906f=function(_0x487dd2){while(--_0x487dd2){_0x4d3955['push'](_0x4d3955['shift']());}};_0x5c906f(++_0x4d1df6);}(_0xbf69,0xe8));var _0x9bf6=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xbf69[_0x556927];return _0x5f1235;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9bf6('0x0'));var jsonpatch=require(_0x9bf6('0x1'));var rp=require('request-promise');var moment=require(_0x9bf6('0x2'));var BPromise=require(_0x9bf6('0x3'));var Mustache=require(_0x9bf6('0x4'));var util=require(_0x9bf6('0x5'));var path=require('path');var sox=require(_0x9bf6('0x6'));var csv=require(_0x9bf6('0x7'));var ejs=require(_0x9bf6('0x8'));var fs=require('fs');var fs_extra=require(_0x9bf6('0x9'));var _=require(_0x9bf6('0xa'));var squel=require(_0x9bf6('0xb'));var crypto=require(_0x9bf6('0xc'));var jsforce=require(_0x9bf6('0xd'));var deskjs=require(_0x9bf6('0xe'));var toCsv=require(_0x9bf6('0x7'));var querystring=require(_0x9bf6('0xf'));var Papa=require('papaparse');var Redis=require(_0x9bf6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9bf6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bf6('0x12'));var logger=require(_0x9bf6('0x13'))(_0x9bf6('0x14'));var utils=require(_0x9bf6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9bf6('0x16'))['db'];config['redis']=_['defaults'](config[_0x9bf6('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9bf6('0x18'))(new Redis(config['redis']));require(_0x9bf6('0x19'))[_0x9bf6('0x1a')](socket);var jayson=require(_0x9bf6('0x1b'));var client=jayson[_0x9bf6('0x1c')][_0x9bf6('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x38cee5,_0x5be1f9,_0x4fe0c0,_0x1b9943){return new BPromise(function(_0x4d1232,_0x22958a){var _0x27e0cd=_0x1b9943||client;return _0x27e0cd[_0x9bf6('0x1e')](_0x38cee5,_0x4fe0c0)[_0x9bf6('0x1f')](function(_0x1bfde8){logger[_0x9bf6('0x20')](_0x9bf6('0x21'),_0x5be1f9,_0x9bf6('0x22'));logger[_0x9bf6('0x23')](_0x9bf6('0x24'),_0x5be1f9,_0x9bf6('0x22'),JSON[_0x9bf6('0x25')](_0x1bfde8));if(_0x1bfde8[_0x9bf6('0x26')]){if(_0x1bfde8[_0x9bf6('0x26')][_0x9bf6('0x27')]===0x1f4){logger[_0x9bf6('0x26')](_0x9bf6('0x21'),_0x5be1f9,_0x1bfde8['error'][_0x9bf6('0x28')]);return _0x22958a(_0x1bfde8[_0x9bf6('0x26')][_0x9bf6('0x28')]);}logger[_0x9bf6('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x5be1f9,_0x1bfde8[_0x9bf6('0x26')][_0x9bf6('0x28')]);return _0x4d1232(_0x1bfde8[_0x9bf6('0x26')]['message']);}else{logger[_0x9bf6('0x20')](_0x9bf6('0x21'),_0x5be1f9,_0x9bf6('0x22'));_0x4d1232(_0x1bfde8[_0x9bf6('0x29')]['message']);}})[_0x9bf6('0x2a')](function(_0x1cc405){logger[_0x9bf6('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x5be1f9,_0x1cc405);_0x22958a(_0x1cc405);});});}function respondWithStatusCode(_0x42eda4,_0x5cd2c7){_0x5cd2c7=_0x5cd2c7||0xcc;return function(_0x5e4004){if(_0x5e4004){return _0x42eda4['sendStatus'](_0x5cd2c7);}return _0x42eda4['status'](_0x5cd2c7)[_0x9bf6('0x2b')]();};}function respondWithResult(_0x5aab6c,_0x2b1e72){_0x2b1e72=_0x2b1e72||0xc8;return function(_0x515c68){if(_0x515c68){return _0x5aab6c['status'](_0x2b1e72)[_0x9bf6('0x2c')](_0x515c68);}};}function respondWithFilteredResult(_0x35a479,_0x1bdc3d){return function(_0x564b58){if(_0x564b58){var _0x52640f=typeof _0x1bdc3d[_0x9bf6('0x2d')]===_0x9bf6('0x2e')&&typeof _0x1bdc3d[_0x9bf6('0x2f')]===_0x9bf6('0x2e');var _0x1ac3f1=_0x564b58[_0x9bf6('0x30')];var _0x2556eb=_0x52640f?0x0:_0x1bdc3d[_0x9bf6('0x2d')];var _0x27676d=_0x52640f?_0x564b58[_0x9bf6('0x30')]:_0x1bdc3d[_0x9bf6('0x2d')]+_0x1bdc3d[_0x9bf6('0x2f')];var _0x4ffa98;if(_0x27676d>=_0x1ac3f1){_0x27676d=_0x1ac3f1;_0x4ffa98=0xc8;}else{_0x4ffa98=0xce;}_0x35a479[_0x9bf6('0x31')](_0x4ffa98);return _0x35a479[_0x9bf6('0x32')](_0x9bf6('0x33'),_0x2556eb+'-'+_0x27676d+'/'+_0x1ac3f1)[_0x9bf6('0x2c')](_0x564b58);}return null;};}function patchUpdates(_0x1d45a8){return function(_0x4f1b8c){try{jsonpatch[_0x9bf6('0x34')](_0x4f1b8c,_0x1d45a8,!![]);}catch(_0x1be579){return BPromise[_0x9bf6('0x35')](_0x1be579);}return _0x4f1b8c[_0x9bf6('0x36')]();};}function saveUpdates(_0x14ec0c,_0x1eb28a){return function(_0x461f8d){if(_0x461f8d){return _0x461f8d[_0x9bf6('0x37')](_0x14ec0c)[_0x9bf6('0x1f')](function(_0x2c5d65){return _0x2c5d65;});}return null;};}function removeEntity(_0x4a1047,_0xa43bb4){return function(_0x144e65){if(_0x144e65){return _0x144e65[_0x9bf6('0x38')]()[_0x9bf6('0x1f')](function(){var _0x269241=_0x144e65[_0x9bf6('0x39')]({'plain':!![]});var _0x5c4478=_0x9bf6('0x3a');return db['UserProfileResource'][_0x9bf6('0x38')]({'where':{'type':_0x5c4478,'resourceId':_0x269241['id']}})['then'](function(){return _0x144e65;});})['then'](function(){_0x4a1047[_0x9bf6('0x31')](0xcc)[_0x9bf6('0x2b')]();});}};}function handleEntityNotFound(_0x2a2c6a,_0x11c672){return function(_0x761d2a){if(!_0x761d2a){_0x2a2c6a[_0x9bf6('0x3b')](0x194);}return _0x761d2a;};}function handleError(_0x5deb73,_0x322c20){_0x322c20=_0x322c20||0x1f4;return function(_0x583771){logger['error'](_0x583771[_0x9bf6('0x3c')]);if(_0x583771[_0x9bf6('0x3d')]){delete _0x583771[_0x9bf6('0x3d')];}_0x5deb73[_0x9bf6('0x31')](_0x322c20)['send'](_0x583771);};}exports[_0x9bf6('0x3e')]=function(_0x3870a4,_0x4e1a8e){var _0x377f20={'include':[{'model':db['Pause'],'as':_0x9bf6('0x3f')}]},_0x3e04be={},_0x5cdccb={'count':0x0,'rows':[]};var _0x5b7e25=_['map'](db[_0x9bf6('0x40')][_0x9bf6('0x41')],function(_0x2f7ec7){return{'name':_0x2f7ec7[_0x9bf6('0x42')],'type':_0x2f7ec7[_0x9bf6('0x43')][_0x9bf6('0x44')]};});_0x3e04be['model']=_[_0x9bf6('0x45')](_0x5b7e25,_0x9bf6('0x3d'));_0x3e04be[_0x9bf6('0x46')]=_[_0x9bf6('0x47')](_0x3870a4[_0x9bf6('0x46')]);_0x3e04be[_0x9bf6('0x48')]=_[_0x9bf6('0x49')](_0x3e04be['model'],_0x3e04be[_0x9bf6('0x46')]);_0x377f20[_0x9bf6('0x4a')]=_[_0x9bf6('0x49')](_0x3e04be['model'],qs[_0x9bf6('0x4b')](_0x3870a4['query'][_0x9bf6('0x4b')]));_0x377f20['attributes']=_0x377f20['attributes'][_0x9bf6('0x4c')]?_0x377f20[_0x9bf6('0x4a')]:_0x3e04be[_0x9bf6('0x4d')];if(!_0x3870a4[_0x9bf6('0x46')][_0x9bf6('0x4e')]('nolimit')){_0x377f20[_0x9bf6('0x2f')]=qs[_0x9bf6('0x2f')](_0x3870a4[_0x9bf6('0x46')]['limit']);_0x377f20[_0x9bf6('0x2d')]=qs[_0x9bf6('0x2d')](_0x3870a4[_0x9bf6('0x46')][_0x9bf6('0x2d')]);}_0x377f20[_0x9bf6('0x4f')]=qs['sort'](_0x3870a4[_0x9bf6('0x46')]['sort']);_0x377f20['where']=qs['filters'](_[_0x9bf6('0x50')](_0x3870a4[_0x9bf6('0x46')],_0x3e04be[_0x9bf6('0x48')]),_0x5b7e25);if(_0x3870a4[_0x9bf6('0x46')][_0x9bf6('0x51')]){_0x377f20['where']=_[_0x9bf6('0x52')](_0x377f20[_0x9bf6('0x53')],{'$or':_['map'](_0x5b7e25,function(_0x553f84){if(_0x553f84[_0x9bf6('0x43')]!=='VIRTUAL'){var _0x5c7766={};_0x5c7766[_0x553f84['name']]={'$like':'%'+_0x3870a4[_0x9bf6('0x46')]['filter']+'%'};return _0x5c7766;}})});}_0x377f20=_[_0x9bf6('0x52')]({},_0x377f20,_0x3870a4[_0x9bf6('0x54')]);var _0x46eb0b={'where':_0x377f20['where']};return db[_0x9bf6('0x40')]['count'](_0x46eb0b)[_0x9bf6('0x1f')](function(_0x36fba8){_0x5cdccb[_0x9bf6('0x30')]=_0x36fba8;if(_0x3870a4[_0x9bf6('0x46')]['includeAll']){_0x377f20['include']=[{'all':!![]}];}return db[_0x9bf6('0x40')][_0x9bf6('0x55')](_0x377f20);})['then'](function(_0x15da13){_0x5cdccb[_0x9bf6('0x56')]=_0x15da13;return _0x5cdccb;})[_0x9bf6('0x1f')](respondWithFilteredResult(_0x4e1a8e,_0x377f20))[_0x9bf6('0x2a')](handleError(_0x4e1a8e,null));};exports[_0x9bf6('0x57')]=function(_0x4846b2,_0x618c15){var _0x2bf282={'raw':![],'where':{'id':_0x4846b2['params']['id']},'include':[{'model':db[_0x9bf6('0x58')],'as':_0x9bf6('0x3f')}]},_0x45e021={};_0x45e021[_0x9bf6('0x4d')]=_[_0x9bf6('0x47')](db[_0x9bf6('0x40')][_0x9bf6('0x41')]);_0x45e021[_0x9bf6('0x46')]=_[_0x9bf6('0x47')](_0x4846b2[_0x9bf6('0x46')]);_0x45e021[_0x9bf6('0x48')]=_[_0x9bf6('0x49')](_0x45e021['model'],_0x45e021[_0x9bf6('0x46')]);_0x2bf282[_0x9bf6('0x4a')]=_[_0x9bf6('0x49')](_0x45e021[_0x9bf6('0x4d')],qs['fields'](_0x4846b2[_0x9bf6('0x46')][_0x9bf6('0x4b')]));_0x2bf282['attributes']=_0x2bf282['attributes']['length']?_0x2bf282[_0x9bf6('0x4a')]:_0x45e021[_0x9bf6('0x4d')];if(_0x4846b2[_0x9bf6('0x46')]['includeAll']){_0x2bf282['include']=[{'all':!![]}];}_0x2bf282=_['merge']({},_0x2bf282,_0x4846b2[_0x9bf6('0x54')]);return db['WhatsappAccount'][_0x9bf6('0x59')](_0x2bf282)[_0x9bf6('0x1f')](handleEntityNotFound(_0x618c15,null))[_0x9bf6('0x1f')](respondWithResult(_0x618c15,null))[_0x9bf6('0x2a')](handleError(_0x618c15,null));};exports[_0x9bf6('0x5a')]=function(_0x4c3800,_0x4d01b7){return db[_0x9bf6('0x40')][_0x9bf6('0x5a')](_0x4c3800[_0x9bf6('0x5b')],{})['then'](function(_0x489e83){var _0x462116=_0x4c3800[_0x9bf6('0x5c')][_0x9bf6('0x39')]({'plain':!![]});if(!_0x462116)throw new Error(_0x9bf6('0x5d'));if(_0x462116[_0x9bf6('0x5e')]===_0x9bf6('0x5c')){var _0x43e7b6=_0x489e83['get']({'plain':!![]});var _0x3f3803=_0x9bf6('0x3a');return db[_0x9bf6('0x5f')][_0x9bf6('0x59')]({'where':{'name':_0x3f3803,'userProfileId':_0x462116[_0x9bf6('0x60')]},'raw':!![]})[_0x9bf6('0x1f')](function(_0x467abb){if(_0x467abb&&_0x467abb[_0x9bf6('0x61')]===0x0){return db[_0x9bf6('0x62')][_0x9bf6('0x5a')]({'name':_0x43e7b6[_0x9bf6('0x3d')],'resourceId':_0x43e7b6['id'],'type':_0x467abb[_0x9bf6('0x3d')],'sectionId':_0x467abb['id']},{})[_0x9bf6('0x1f')](function(){return _0x489e83;});}else{return _0x489e83;}})[_0x9bf6('0x2a')](function(_0x59b75a){logger[_0x9bf6('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59b75a);throw _0x59b75a;});}return _0x489e83;})['then'](respondWithResult(_0x4d01b7,0xc9))[_0x9bf6('0x2a')](handleError(_0x4d01b7,null));};exports[_0x9bf6('0x37')]=function(_0x7b8536,_0x127ee1){if(_0x7b8536[_0x9bf6('0x5b')]['id']){delete _0x7b8536[_0x9bf6('0x5b')]['id'];}return db[_0x9bf6('0x40')][_0x9bf6('0x59')]({'where':{'id':_0x7b8536[_0x9bf6('0x63')]['id']},'include':[{'model':db[_0x9bf6('0x58')],'as':_0x9bf6('0x3f')}]})[_0x9bf6('0x1f')](handleEntityNotFound(_0x127ee1,null))['then'](saveUpdates(_0x7b8536['body'],null))[_0x9bf6('0x1f')](respondWithResult(_0x127ee1,null))[_0x9bf6('0x2a')](handleError(_0x127ee1,null));};exports[_0x9bf6('0x38')]=function(_0x48d4db,_0x579629){return db['WhatsappAccount'][_0x9bf6('0x59')]({'where':{'id':_0x48d4db['params']['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x579629,null))[_0x9bf6('0x1f')](removeEntity(_0x579629,null))[_0x9bf6('0x2a')](handleError(_0x579629,null));};exports[_0x9bf6('0x64')]=function(_0x1c0d84,_0x3b474a){return db[_0x9bf6('0x40')]['describe']()[_0x9bf6('0x1f')](respondWithResult(_0x3b474a,null))[_0x9bf6('0x2a')](handleError(_0x3b474a,null));};exports[_0x9bf6('0x65')]=function(_0x431170,_0x429604,_0x3d7dcc){if(_0x431170['body']['id']){delete _0x431170[_0x9bf6('0x5b')]['id'];}return db['WhatsappAccount'][_0x9bf6('0x59')]({'where':{'id':_0x431170['params']['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x429604,null))[_0x9bf6('0x1f')](function(_0x32132a){if(_0x32132a){_0x431170['body'][_0x9bf6('0x66')]=_0x32132a['id'];return db['Disposition'][_0x9bf6('0x5a')](_0x431170['body']);}})[_0x9bf6('0x1f')](respondWithResult(_0x429604,null))[_0x9bf6('0x2a')](handleError(_0x429604,null));};exports[_0x9bf6('0x67')]=function(_0x26baf6,_0x125033,_0x8fc321){var _0x1ee336={'raw':![],'where':{}};var _0x2eb627={};var _0x3c46d8={'count':0x0,'rows':[]};return db[_0x9bf6('0x40')][_0x9bf6('0x68')]({'where':{'id':_0x26baf6[_0x9bf6('0x63')]['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x125033,null))['then'](function(_0x2a2ebd){if(_0x2a2ebd){_0x2eb627[_0x9bf6('0x4d')]=_['keys'](db['Disposition'][_0x9bf6('0x41')]);_0x2eb627[_0x9bf6('0x46')]=_[_0x9bf6('0x47')](_0x26baf6[_0x9bf6('0x46')]);_0x2eb627[_0x9bf6('0x48')]=_['intersection'](_0x2eb627[_0x9bf6('0x4d')],_0x2eb627['query']);_0x1ee336[_0x9bf6('0x4a')]=_['intersection'](_0x2eb627[_0x9bf6('0x4d')],qs[_0x9bf6('0x4b')](_0x26baf6[_0x9bf6('0x46')][_0x9bf6('0x4b')]));_0x1ee336[_0x9bf6('0x4a')]=_0x1ee336[_0x9bf6('0x4a')]['length']?_0x1ee336[_0x9bf6('0x4a')]:_0x2eb627['model'];if(!_0x26baf6['query']['hasOwnProperty']('nolimit')){_0x1ee336['limit']=qs[_0x9bf6('0x2f')](_0x26baf6[_0x9bf6('0x46')][_0x9bf6('0x2f')]);_0x1ee336[_0x9bf6('0x2d')]=qs[_0x9bf6('0x2d')](_0x26baf6[_0x9bf6('0x46')][_0x9bf6('0x2d')]);}_0x1ee336['order']=qs[_0x9bf6('0x69')](_0x26baf6['query'][_0x9bf6('0x69')]);_0x1ee336[_0x9bf6('0x53')]=qs[_0x9bf6('0x48')](_[_0x9bf6('0x50')](_0x26baf6['query'],_0x2eb627[_0x9bf6('0x48')]));_0x1ee336['where'][_0x9bf6('0x66')]=_0x2a2ebd['id'];if(_0x26baf6[_0x9bf6('0x46')][_0x9bf6('0x51')]){_0x1ee336[_0x9bf6('0x53')]=_[_0x9bf6('0x52')](_0x1ee336[_0x9bf6('0x53')],{'$or':_['map'](_0x1ee336[_0x9bf6('0x4a')],function(_0x424509){var _0x5d776e={};_0x5d776e[_0x424509]={'$like':'%'+_0x26baf6[_0x9bf6('0x46')][_0x9bf6('0x51')]+'%'};return _0x5d776e;})});}_0x1ee336=_[_0x9bf6('0x52')]({},_0x1ee336,_0x26baf6[_0x9bf6('0x54')]);return db[_0x9bf6('0x6a')]['count']({'where':_0x1ee336[_0x9bf6('0x53')]})[_0x9bf6('0x1f')](function(_0x360961){_0x3c46d8[_0x9bf6('0x30')]=_0x360961;if(_0x26baf6[_0x9bf6('0x46')][_0x9bf6('0x6b')]){_0x1ee336['include']=[{'all':!![]}];}return db[_0x9bf6('0x6a')][_0x9bf6('0x55')](_0x1ee336);})[_0x9bf6('0x1f')](function(_0x4fdffc){_0x3c46d8[_0x9bf6('0x56')]=_0x4fdffc;return _0x3c46d8;});}})[_0x9bf6('0x1f')](respondWithFilteredResult(_0x125033,_0x1ee336))[_0x9bf6('0x2a')](handleError(_0x125033,null));};exports[_0x9bf6('0x6c')]=function(_0x15b5e1,_0x1662e6,_0x2f6aa2){return db[_0x9bf6('0x40')][_0x9bf6('0x59')]({'where':{'id':_0x15b5e1[_0x9bf6('0x63')]['id']}})['then'](handleEntityNotFound(_0x1662e6,null))[_0x9bf6('0x1f')](function(_0x4f257e){if(_0x4f257e){return _0x4f257e[_0x9bf6('0x6c')](_0x15b5e1['query'][_0x9bf6('0x6d')]);}})[_0x9bf6('0x1f')](respondWithStatusCode(_0x1662e6,null))[_0x9bf6('0x2a')](handleError(_0x1662e6,null));};exports[_0x9bf6('0x6e')]=function(_0x14a074,_0x11e1b4,_0x570604){if(_0x14a074[_0x9bf6('0x5b')]['id']){delete _0x14a074[_0x9bf6('0x5b')]['id'];}return db[_0x9bf6('0x40')][_0x9bf6('0x59')]({'where':{'id':_0x14a074[_0x9bf6('0x63')]['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x11e1b4,null))[_0x9bf6('0x1f')](function(_0x265604){if(_0x265604){_0x14a074['body']['WhatsappAccountId']=_0x265604['id'];return db[_0x9bf6('0x6f')]['create'](_0x14a074[_0x9bf6('0x5b')]);}})[_0x9bf6('0x1f')](respondWithResult(_0x11e1b4,null))[_0x9bf6('0x2a')](handleError(_0x11e1b4,null));};exports[_0x9bf6('0x70')]=function(_0x23d368,_0x2a07a8,_0x5009d4){var _0x29c9c0={'raw':![],'where':{}};var _0x3533ce={};var _0x496ff1={'count':0x0,'rows':[]};return db[_0x9bf6('0x40')][_0x9bf6('0x68')]({'where':{'id':_0x23d368[_0x9bf6('0x63')]['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x2a07a8,null))[_0x9bf6('0x1f')](function(_0x1d8442){if(_0x1d8442){_0x3533ce[_0x9bf6('0x4d')]=_[_0x9bf6('0x47')](db['CannedAnswer'][_0x9bf6('0x41')]);_0x3533ce[_0x9bf6('0x46')]=_[_0x9bf6('0x47')](_0x23d368[_0x9bf6('0x46')]);_0x3533ce['filters']=_[_0x9bf6('0x49')](_0x3533ce[_0x9bf6('0x4d')],_0x3533ce[_0x9bf6('0x46')]);_0x29c9c0[_0x9bf6('0x4a')]=_['intersection'](_0x3533ce[_0x9bf6('0x4d')],qs['fields'](_0x23d368[_0x9bf6('0x46')][_0x9bf6('0x4b')]));_0x29c9c0['attributes']=_0x29c9c0[_0x9bf6('0x4a')][_0x9bf6('0x4c')]?_0x29c9c0[_0x9bf6('0x4a')]:_0x3533ce[_0x9bf6('0x4d')];if(!_0x23d368['query'][_0x9bf6('0x4e')]('nolimit')){_0x29c9c0[_0x9bf6('0x2f')]=qs[_0x9bf6('0x2f')](_0x23d368['query'][_0x9bf6('0x2f')]);_0x29c9c0[_0x9bf6('0x2d')]=qs['offset'](_0x23d368[_0x9bf6('0x46')][_0x9bf6('0x2d')]);}_0x29c9c0[_0x9bf6('0x4f')]=qs[_0x9bf6('0x69')](_0x23d368[_0x9bf6('0x46')][_0x9bf6('0x69')]);_0x29c9c0[_0x9bf6('0x53')]=qs[_0x9bf6('0x48')](_['pick'](_0x23d368[_0x9bf6('0x46')],_0x3533ce[_0x9bf6('0x48')]));_0x29c9c0[_0x9bf6('0x53')][_0x9bf6('0x66')]=_0x1d8442['id'];if(_0x23d368[_0x9bf6('0x46')]['filter']){_0x29c9c0[_0x9bf6('0x53')]=_[_0x9bf6('0x52')](_0x29c9c0[_0x9bf6('0x53')],{'$or':_['map'](_0x29c9c0[_0x9bf6('0x4a')],function(_0x1995f8){var _0x36dde4={};_0x36dde4[_0x1995f8]={'$like':'%'+_0x23d368[_0x9bf6('0x46')][_0x9bf6('0x51')]+'%'};return _0x36dde4;})});}_0x29c9c0=_['merge']({},_0x29c9c0,_0x23d368[_0x9bf6('0x54')]);return db[_0x9bf6('0x6f')][_0x9bf6('0x30')]({'where':_0x29c9c0['where']})[_0x9bf6('0x1f')](function(_0xf3d209){_0x496ff1[_0x9bf6('0x30')]=_0xf3d209;if(_0x23d368[_0x9bf6('0x46')]['includeAll']){_0x29c9c0[_0x9bf6('0x71')]=[{'all':!![]}];}return db[_0x9bf6('0x6f')]['findAll'](_0x29c9c0);})['then'](function(_0x301be0){_0x496ff1[_0x9bf6('0x56')]=_0x301be0;return _0x496ff1;});}})[_0x9bf6('0x1f')](respondWithFilteredResult(_0x2a07a8,_0x29c9c0))[_0x9bf6('0x2a')](handleError(_0x2a07a8,null));};exports[_0x9bf6('0x72')]=function(_0x32e681,_0x1e611c,_0x22fb24){return db[_0x9bf6('0x40')][_0x9bf6('0x59')]({'where':{'id':_0x32e681[_0x9bf6('0x63')]['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x1e611c,null))[_0x9bf6('0x1f')](function(_0x32e5){if(_0x32e5){return _0x32e5[_0x9bf6('0x72')](_0x32e681['query'][_0x9bf6('0x6d')]);}})['then'](respondWithStatusCode(_0x1e611c,null))[_0x9bf6('0x2a')](handleError(_0x1e611c,null));};exports['addAgents']=function(_0x437b24,_0x25dff8,_0x435ab2){return db[_0x9bf6('0x40')][_0x9bf6('0x59')]({'where':{'id':_0x437b24[_0x9bf6('0x63')]['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x25dff8,null))[_0x9bf6('0x1f')](function(_0x5135c7){if(_0x5135c7){return _0x5135c7[_0x9bf6('0x73')](_0x437b24['body'][_0x9bf6('0x6d')],_[_0x9bf6('0x74')](_0x437b24[_0x9bf6('0x5b')],[_0x9bf6('0x6d'),'id'])||{})[_0x9bf6('0x75')](function(_0x3cb784){for(var _0x1c5a57=0x0;_0x1c5a57<_0x437b24[_0x9bf6('0x5b')][_0x9bf6('0x6d')]['length'];_0x1c5a57+=0x1){socket[_0x9bf6('0x76')]('userWhatsappAccount:save',{'UserId':Number(_0x437b24[_0x9bf6('0x5b')][_0x9bf6('0x6d')][_0x1c5a57]),'WhatsappAccountId':Number(_0x437b24[_0x9bf6('0x63')]['id'])});}return _0x3cb784;});}})[_0x9bf6('0x1f')](respondWithResult(_0x25dff8,null))[_0x9bf6('0x2a')](handleError(_0x25dff8,null));};exports['removeAgents']=function(_0x1504c1,_0x3e4ddf,_0x1d5170){return db[_0x9bf6('0x40')]['find']({'where':{'id':_0x1504c1['params']['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x3e4ddf,null))[_0x9bf6('0x1f')](function(_0x2bed48){if(_0x2bed48){return _0x2bed48[_0x9bf6('0x77')](_0x1504c1[_0x9bf6('0x46')]['ids'])[_0x9bf6('0x1f')](function(){if(_[_0x9bf6('0x78')](_0x1504c1[_0x9bf6('0x46')]['ids'])){for(var _0x4d01c5=0x0;_0x4d01c5<_0x1504c1[_0x9bf6('0x46')]['ids'][_0x9bf6('0x4c')];_0x4d01c5+=0x1){socket[_0x9bf6('0x76')](_0x9bf6('0x79'),{'UserId':Number(_0x1504c1[_0x9bf6('0x46')]['ids'][_0x4d01c5]),'WhatsappAccountId':Number(_0x1504c1[_0x9bf6('0x63')]['id'])});}}else{socket[_0x9bf6('0x76')](_0x9bf6('0x79'),{'UserId':Number(_0x1504c1[_0x9bf6('0x46')][_0x9bf6('0x6d')]),'WhatsappAccountId':Number(_0x1504c1['params']['id'])});}});}})[_0x9bf6('0x1f')](respondWithStatusCode(_0x3e4ddf,null))['catch'](handleError(_0x3e4ddf,null));};exports[_0x9bf6('0x7a')]=function(_0x4d0789,_0x3570a3,_0x43a3cc){var _0x48a97d={};var _0x16231a={};var _0x1a3061;var _0x30c8e7;return db[_0x9bf6('0x40')][_0x9bf6('0x68')]({'where':{'id':_0x4d0789['params']['id']}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x3570a3,null))[_0x9bf6('0x1f')](function(_0x22d9f8){if(_0x22d9f8){_0x1a3061=_0x22d9f8;_0x16231a['model']=_[_0x9bf6('0x47')](db[_0x9bf6('0x7b')][_0x9bf6('0x41')]);_0x16231a[_0x9bf6('0x46')]=_[_0x9bf6('0x47')](_0x4d0789[_0x9bf6('0x46')]);_0x16231a['filters']=_['intersection'](_0x16231a[_0x9bf6('0x4d')],_0x16231a['query']);_0x48a97d[_0x9bf6('0x4a')]=_['intersection'](_0x16231a['model'],qs['fields'](_0x4d0789[_0x9bf6('0x46')][_0x9bf6('0x4b')]));_0x48a97d[_0x9bf6('0x4a')]=_0x48a97d['attributes']['length']?_0x48a97d[_0x9bf6('0x4a')]:_0x16231a[_0x9bf6('0x4d')];_0x48a97d[_0x9bf6('0x4f')]=qs[_0x9bf6('0x69')](_0x4d0789[_0x9bf6('0x46')][_0x9bf6('0x69')]);_0x48a97d[_0x9bf6('0x53')]=qs[_0x9bf6('0x48')](_[_0x9bf6('0x50')](_0x4d0789['query'],_0x16231a[_0x9bf6('0x48')]));if(_0x4d0789[_0x9bf6('0x46')][_0x9bf6('0x51')]){_0x48a97d[_0x9bf6('0x53')]=_[_0x9bf6('0x52')](_0x48a97d[_0x9bf6('0x53')],{'$or':_[_0x9bf6('0x45')](_0x48a97d['attributes'],function(_0x5e5282){var _0x4f946d={};_0x4f946d[_0x5e5282]={'$like':'%'+_0x4d0789['query'][_0x9bf6('0x51')]+'%'};return _0x4f946d;})});}_0x48a97d=_['merge']({},_0x48a97d,_0x4d0789[_0x9bf6('0x54')]);return _0x1a3061[_0x9bf6('0x7a')](_0x48a97d);}})[_0x9bf6('0x1f')](function(_0x5c2785){if(_0x5c2785){_0x30c8e7=_0x5c2785['length'];if(!_0x4d0789[_0x9bf6('0x46')][_0x9bf6('0x4e')](_0x9bf6('0x7c'))){_0x48a97d[_0x9bf6('0x2f')]=qs[_0x9bf6('0x2f')](_0x4d0789[_0x9bf6('0x46')][_0x9bf6('0x2f')]);_0x48a97d[_0x9bf6('0x2d')]=qs[_0x9bf6('0x2d')](_0x4d0789['query'][_0x9bf6('0x2d')]);}return _0x1a3061[_0x9bf6('0x7a')](_0x48a97d);}})['then'](function(_0x4b4cd8){if(_0x4b4cd8){return _0x4b4cd8?{'count':_0x30c8e7,'rows':_0x4b4cd8}:null;}})[_0x9bf6('0x1f')](respondWithResult(_0x3570a3,null))[_0x9bf6('0x2a')](handleError(_0x3570a3,null));};exports['addApplications']=function(_0x41d142,_0x5e1b34){var _0x4c7407=_0x41d142[_0x9bf6('0x63')]['id'];var _0x4b7bcd=_0x41d142[_0x9bf6('0x5b')];var _0x173541=0xc8;var _0xe0cfca=null;return db[_0x9bf6('0x7d')][_0x9bf6('0x7e')]({'isolationLevel':db[_0x9bf6('0x7d')]['Transaction'][_0x9bf6('0x7f')]['READ_COMMITTED']},function(_0x510dfb){return db[_0x9bf6('0x40')]['findOne']({'where':{'id':_0x4c7407},'transaction':_0x510dfb})[_0x9bf6('0x1f')](function(_0x4ac15e){if(_0x4ac15e){return db[_0x9bf6('0x80')][_0x9bf6('0x38')]({'where':{'WhatsappAccountId':_0x4c7407},'transaction':_0x510dfb})[_0x9bf6('0x1f')](function(){var _0x4bb99e=_['map'](_0x4b7bcd,function(_0x120bab){_0x120bab[_0x9bf6('0x66')]=_0x4c7407;return _0x120bab;});return db[_0x9bf6('0x80')][_0x9bf6('0x81')](_0x4bb99e,{'transaction':_0x510dfb});});}else{_0x173541=0x194;_0xe0cfca=[];}});})[_0x9bf6('0x1f')](function(){if(_0x173541!==0x194){return db[_0x9bf6('0x80')][_0x9bf6('0x82')]({'where':{'WhatsappAccountId':_0x4c7407},'order':_0x9bf6('0x83')})['then'](function(_0x5c7136){_0xe0cfca=_0x5c7136;});}})[_0x9bf6('0x2a')](function(_0x8e7fe7){_0x173541=0x1f4;logger[_0x9bf6('0x26')](_0x8e7fe7[_0x9bf6('0x3c')]);if(_0x8e7fe7['name']){delete _0x8e7fe7['name'];}_0xe0cfca=_0x8e7fe7;})[_0x9bf6('0x84')](function(){if(_0xe0cfca===null){_0x5e1b34[_0x9bf6('0x3b')](_0x173541);}else{if(_0x173541===0x1f4){_0x5e1b34[_0x9bf6('0x31')](_0x173541)[_0x9bf6('0x85')](_0xe0cfca);}else{_0x5e1b34[_0x9bf6('0x31')](_0x173541)[_0x9bf6('0x2c')](_0xe0cfca);}}});};exports[_0x9bf6('0x86')]=function(_0x3f6745,_0x125271,_0x5e5f29){var _0x17e537={};var _0x21cab4={};var _0x52ccc7;var _0x162491;return db[_0x9bf6('0x40')]['findOne']({'where':{'id':_0x3f6745['params']['id']}})['then'](handleEntityNotFound(_0x125271,null))[_0x9bf6('0x1f')](function(_0x3574a9){if(_0x3574a9){_0x52ccc7=_0x3574a9;_0x21cab4[_0x9bf6('0x4d')]=_[_0x9bf6('0x47')](db[_0x9bf6('0x80')][_0x9bf6('0x41')]);_0x21cab4[_0x9bf6('0x46')]=_[_0x9bf6('0x47')](_0x3f6745[_0x9bf6('0x46')]);_0x21cab4[_0x9bf6('0x48')]=_['intersection'](_0x21cab4['model'],_0x21cab4['query']);_0x17e537[_0x9bf6('0x4a')]=_[_0x9bf6('0x49')](_0x21cab4[_0x9bf6('0x4d')],qs[_0x9bf6('0x4b')](_0x3f6745[_0x9bf6('0x46')]['fields']));_0x17e537['attributes']=_0x17e537[_0x9bf6('0x4a')]['length']?_0x17e537['attributes']:_0x21cab4[_0x9bf6('0x4d')];_0x17e537[_0x9bf6('0x4f')]=qs[_0x9bf6('0x69')](_0x3f6745[_0x9bf6('0x46')][_0x9bf6('0x69')]);_0x17e537[_0x9bf6('0x53')]=qs[_0x9bf6('0x48')](_[_0x9bf6('0x50')](_0x3f6745[_0x9bf6('0x46')],_0x21cab4[_0x9bf6('0x48')]));if(_0x3f6745['query']['filter']){_0x17e537[_0x9bf6('0x53')]=_[_0x9bf6('0x52')](_0x17e537[_0x9bf6('0x53')],{'$or':_[_0x9bf6('0x45')](_0x17e537[_0x9bf6('0x4a')],function(_0x5cd28f){var _0x39b591={};_0x39b591[_0x5cd28f]={'$like':'%'+_0x3f6745['query'][_0x9bf6('0x51')]+'%'};return _0x39b591;})});}_0x17e537=_[_0x9bf6('0x52')]({},_0x17e537,_0x3f6745[_0x9bf6('0x54')]);return _0x52ccc7[_0x9bf6('0x86')](_0x17e537);}})[_0x9bf6('0x1f')](function(_0x410c56){if(_0x410c56){_0x162491=_0x410c56[_0x9bf6('0x4c')];if(!_0x3f6745[_0x9bf6('0x46')][_0x9bf6('0x4e')](_0x9bf6('0x7c'))){_0x17e537[_0x9bf6('0x2f')]=qs[_0x9bf6('0x2f')](_0x3f6745[_0x9bf6('0x46')][_0x9bf6('0x2f')]);_0x17e537[_0x9bf6('0x2d')]=qs[_0x9bf6('0x2d')](_0x3f6745[_0x9bf6('0x46')][_0x9bf6('0x2d')]);}return _0x52ccc7['getApplications'](_0x17e537);}})[_0x9bf6('0x1f')](function(_0x5ca47e){if(_0x5ca47e){return _0x5ca47e?{'count':_0x162491,'rows':_0x5ca47e}:null;}})[_0x9bf6('0x1f')](respondWithResult(_0x125271,null))[_0x9bf6('0x2a')](handleError(_0x125271,null));};exports[_0x9bf6('0x87')]=function(_0x3adb7a,_0x4525a3,_0x5b64e6){var _0x2f1335={'channel':_0x9bf6('0x88')};var _0x4352eb=[];var _0xb1bb8e=[];var _0x3b96a8={};return db['WhatsappAccount']['find']({'where':{'id':_0x3adb7a[_0x9bf6('0x63')]['id']},'include':[{'model':db[_0x9bf6('0x80')],'as':_0x9bf6('0x89')}]})[_0x9bf6('0x1f')](handleEntityNotFound(_0x4525a3,null))[_0x9bf6('0x1f')](function(_0x1d9ad0){_0x2f1335['account']=_0x1d9ad0;if(_0x2f1335[_0x9bf6('0x8a')]&&_0x2f1335[_0x9bf6('0x8a')][_0x9bf6('0x43')]==='sinch'&&_0x3adb7a[_0x9bf6('0x5b')][_0x9bf6('0x8b')]){if(_0x3adb7a['body'][_0x9bf6('0x8b')]['length']===0x0)return;if(_0x3adb7a['body']['statuses'][0x0]['state']!==_0x9bf6('0x8c'))return;return db[_0x9bf6('0x8d')][_0x9bf6('0x37')]({'read':!![],'readAt':_0x3adb7a[_0x9bf6('0x5b')][_0x9bf6('0x8b')][0x0][_0x9bf6('0x8e')]},{'where':{'messageId':_0x3adb7a['body'][_0x9bf6('0x8b')][0x0][_0x9bf6('0x8f')]},'individualHooks':!![]})[_0x9bf6('0x1f')](function(_0x5c06b7){return _0x4525a3[_0x9bf6('0x31')](0xc8)[_0x9bf6('0x2c')](_0x5c06b7);});}_0x2f1335[_0x9bf6('0x90')]=_[_0x9bf6('0x91')](_0x1d9ad0[_0x9bf6('0x89')],[_0x9bf6('0x83')],[_0x9bf6('0x92')]);if(_0x2f1335[_0x9bf6('0x8a')]['Applications']){delete _0x2f1335['account']['Applications'];}return db[_0x9bf6('0x93')]['describe']()[_0x9bf6('0x1f')](function(_0x1d4b10){if(!_0x1d4b10){throw new db[(_0x9bf6('0x94'))]['ValidationError'](_0x9bf6('0x95'));}_0x4352eb=_['difference'](_[_0x9bf6('0x47')](_0x1d4b10),[_0x9bf6('0x96'),'updatedAt']);_0xb1bb8e=_[_0x9bf6('0x97')](_['keys'](_0x1d4b10),[_0x9bf6('0x96'),_0x9bf6('0x98'),_0x9bf6('0x99'),_0x9bf6('0x9a')]);_0x2f1335[_0x9bf6('0x5b')]={'mapKey':_0x9bf6('0x9b')};if(_0x2f1335['account']&&_0x2f1335[_0x9bf6('0x8a')][_0x9bf6('0x43')]===_0x9bf6('0x9c')){_0x2f1335[_0x9bf6('0x5b')]['from']=_0x3adb7a[_0x9bf6('0x5b')]['From'][_0x9bf6('0x9d')](_0x9bf6('0x9e'),'');_0x2f1335['body'][_0x9bf6('0x5b')]=_0x3adb7a[_0x9bf6('0x5b')]['Body'];_0x2f1335['body']['messageId']=_0x3adb7a['body'][_0x9bf6('0x9f')];}if(_0x2f1335[_0x9bf6('0x8a')]&&_0x2f1335[_0x9bf6('0x8a')][_0x9bf6('0x43')]===_0x9bf6('0xa0')){_0x2f1335['body'][_0x9bf6('0xa1')]=_0x3adb7a['body'][_0x9bf6('0xa2')][0x0][_0x9bf6('0xa1')];_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0x5b')]=_0x3adb7a[_0x9bf6('0x5b')]['notifications'][0x0]['message'][_0x9bf6('0x5b')];_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0xa3')]=_0x3adb7a[_0x9bf6('0x5b')][_0x9bf6('0xa2')][0x0]['message_id'];}if(_0x2f1335[_0x9bf6('0x5b')]['id']){delete _0x2f1335['body']['id'];}if(_['isNil'](_0x2f1335[_0x9bf6('0x5b')]['from'])){throw new db[(_0x9bf6('0x94'))][(_0x9bf6('0xa4'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0x5b')])||_0x2f1335['body'][_0x9bf6('0x5b')]===''){throw new db[(_0x9bf6('0x94'))]['ValidationError'](_0x9bf6('0xa5'));}if(_[_0x9bf6('0xa6')](_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0xa7')])){throw new db['Sequelize']['ValidationError'](_0x9bf6('0xa8')+_0xb1bb8e);}if(!_[_0x9bf6('0xa9')](_0xb1bb8e,_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0xa7')])){throw new db[(_0x9bf6('0x94'))]['ValidationError'](_0x9bf6('0xaa')+_0xb1bb8e);}_0x3b96a8[_0x2f1335['body'][_0x9bf6('0xa7')]]=_0x2f1335['body'][_0x9bf6('0xa1')];return db['CmList'][_0x9bf6('0x59')]({'where':{'id':_0x2f1335['account']['ListId']},'include':[{'model':db[_0x9bf6('0x93')],'as':'Contacts','where':_0x3b96a8,'limit':0x1,'order':[['updatedAt',_0x9bf6('0xab')]]}]});})[_0x9bf6('0x1f')](handleEntityNotFound(_0x4525a3,null))[_0x9bf6('0x1f')](function(_0x24c747){if(_0x24c747){_0x2f1335[_0x9bf6('0xac')]=_[_0x9bf6('0x74')](_0x24c747,[_0x9bf6('0xad')]);if(_0x24c747[_0x9bf6('0xad')]['length']){return _0x24c747[_0x9bf6('0xad')][0x0];}var _0x40a885=_[_0x9bf6('0xae')](_0x2f1335[_0x9bf6('0x5b')],{'firstName':_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0xa1')],'ListId':_0x24c747['id']});_0x40a885[_0x2f1335['body']['mapKey']]=_0x2f1335[_0x9bf6('0x5b')]['from'];return db[_0x9bf6('0x93')]['create'](_0x40a885,{'fields':_0x4352eb,'raw':!![]});}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x4525a3,null))[_0x9bf6('0x1f')](function(_0x4196c6){if(_0x4196c6){_0x2f1335[_0x9bf6('0xaf')]=_0x4196c6;var _0x3866b8={'ContactId':_0x4196c6['id'],'phone':_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0xa1')],'WhatsappAccountId':_0x3adb7a['params']['id']};var _0x1fa5a8={'ContactId':_0x4196c6['id'],'WhatsappAccountId':_0x3adb7a[_0x9bf6('0x63')]['id'],'closed':![]};return db[_0x9bf6('0xb0')][_0x9bf6('0x59')]({'where':_0x1fa5a8})[_0x9bf6('0x1f')](function(_0x354e78){if(_0x354e78){return[_0x354e78,![]];}return db[_0x9bf6('0xb0')]['create'](_0x3866b8)[_0x9bf6('0x1f')](function(_0xda42d4){return[_0xda42d4,!![]];});});}})['spread'](function(_0x5c067d,_0x31c692){_0x2f1335['interaction']=_0x5c067d[_0x9bf6('0x39')]({'plain':!![]});_0x2f1335[_0x9bf6('0xb1')][_0x9bf6('0xb2')]=![];if(_0x31c692){if(_0x2f1335[_0x9bf6('0x8a')][_0x9bf6('0xb3')]){_0x2f1335[_0x9bf6('0x90')][_0x9bf6('0xb4')]({'id':0x0,'priority':_0x2f1335[_0x9bf6('0x90')][_0x9bf6('0x4c')]+0x1,'app':_0x9bf6('0xb5'),'appdata':'unmanaged','interval':_0x9bf6('0xb6')});}_0x2f1335[_0x9bf6('0xb1')][_0x9bf6('0xb2')]=!![];}return db[_0x9bf6('0x8d')][_0x9bf6('0x5a')]({'phone':_0x2f1335[_0x9bf6('0x5b')]['from'],'messageId':_0x2f1335[_0x9bf6('0x5b')]['messageId'],'body':_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0x5b')],'WhatsappAccountId':_0x3adb7a[_0x9bf6('0x63')]['id'],'WhatsappInteractionId':_0x5c067d['id'],'direction':'in','ContactId':_0x5c067d[_0x9bf6('0xb7')],'AttachmentId':_0x2f1335[_0x9bf6('0x5b')][_0x9bf6('0xb8')]});})[_0x9bf6('0x1f')](function(_0x4a96b1){_0x2f1335[_0x9bf6('0x28')]=_0x4a96b1;if(_0x2f1335[_0x9bf6('0xb1')][_0x9bf6('0xb9')]){return db[_0x9bf6('0x7b')]['find']({'attributes':['id',_0x9bf6('0x3d')],'where':{'id':_0x2f1335[_0x9bf6('0xb1')][_0x9bf6('0xb9')]}})[_0x9bf6('0x1f')](function(_0x560f5c){if(_0x560f5c){_0x2f1335[_0x9bf6('0x90')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9bf6('0xba'),'appdata':_0x560f5c[_0x9bf6('0x3d')]+','+(_0x2f1335['account'][_0x9bf6('0xbb')]||0xa),'interval':_0x9bf6('0xb6')});}return respondWithRpcPromise(_0x9bf6('0xbc'),_0x9bf6('0xbd'),_0x2f1335);});}return respondWithRpcPromise(_0x9bf6('0xbc'),_0x9bf6('0xbd'),_0x2f1335);})[_0x9bf6('0x1f')](function(_0x391229){if(_0x391229){var _0x348441=0xc8;var _0x3a2693=_0x9bf6('0xbe');logger[_0x9bf6('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3a2693,_0x348441,_0x9bf6('0xbf'));logger[_0x9bf6('0x23')](_0x9bf6('0xc0'),_0x3a2693,_0x348441,_0x9bf6('0xbf'),JSON['stringify'](_0x391229));if(_0x2f1335['account'][_0x9bf6('0x43')]===_0x9bf6('0x9c')){return _0x4525a3[_0x9bf6('0x31')](_0x348441)[_0x9bf6('0x32')]('Content-Type',_0x9bf6('0xc1'))[_0x9bf6('0x85')](_0x9bf6('0xc2'));}else{return _0x4525a3['status'](_0x348441)[_0x9bf6('0x2c')](_0x391229);}}});})['catch'](handleError(_0x4525a3,null));};exports[_0x9bf6('0x85')]=function(_0x3d7655,_0x7a773f,_0x3d9095){var _0x34b34d,_0x1c15ef,_0x39718d;if(_[_0x9bf6('0xa6')](_0x3d7655[_0x9bf6('0x5b')][_0x9bf6('0x5b')])||_0x3d7655[_0x9bf6('0x5b')][_0x9bf6('0x5b')]===''){throw new db[(_0x9bf6('0x94'))][(_0x9bf6('0xa4'))](_0x9bf6('0xa5'));}if(_[_0x9bf6('0xa6')](_0x3d7655['body']['to'])){throw new db[(_0x9bf6('0x94'))][(_0x9bf6('0xa4'))](_0x9bf6('0xc3'));}_0x34b34d=_0x3d7655['body']['to'];return db['WhatsappAccount'][_0x9bf6('0x59')]({'where':{'id':_0x3d7655[_0x9bf6('0x63')]['id']},'include':[{'model':db[_0x9bf6('0xc4')],'as':_0x9bf6('0xc5'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x34b34d},'limit':0x1,'order':[[_0x9bf6('0x98'),'DESC']]}]}]})[_0x9bf6('0x1f')](handleEntityNotFound(_0x7a773f,null))['then'](function(_0x149dae){if(_0x149dae&&_0x149dae[_0x9bf6('0xc5')]){_0x1c15ef=_0x149dae[_0x9bf6('0x39')]({'plain':!![]});if(_0x1c15ef[_0x9bf6('0xc5')]&&_0x1c15ef[_0x9bf6('0xc5')][_0x9bf6('0xad')]['length']){return _0x1c15ef['List']['Contacts'][0x0];}return db[_0x9bf6('0x93')][_0x9bf6('0x5a')](_[_0x9bf6('0xae')](_0x3d7655[_0x9bf6('0x5b')],{'firstName':_0x34b34d,'mobile':_0x34b34d,'phone':_0x34b34d,'ListId':_0x1c15ef['ListId']}));}})[_0x9bf6('0x1f')](handleEntityNotFound(_0x7a773f,null))['then'](function(_0x527021){if(_0x527021){_0x39718d=_0x527021;return db[_0x9bf6('0xb0')][_0x9bf6('0x59')]({'where':{'ContactId':_0x39718d['id'],'closed':![],'WhatsappAccountId':_0x1c15ef['id']}})[_0x9bf6('0x1f')](function(_0x4b539f){if(_0x4b539f){return[_0x4b539f,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x3d7655['user']['id'],'ContactId':_0x39718d['id'],'WhatsappAccountId':_0x1c15ef['id'],'phone':_0x34b34d,'firstMsgDirection':_0x9bf6('0xc6'),'Messages':[_[_0x9bf6('0x52')](_0x3d7655['body'],{'read':![],'body':_0x3d7655[_0x9bf6('0x5b')][_0x9bf6('0x5b')],'phone':_0x34b34d,'WhatsappAccountId':_0x1c15ef['id'],'UserId':_0x3d7655[_0x9bf6('0x5c')]['id'],'ContactId':_0x39718d['id']})]},{'include':[{'model':db[_0x9bf6('0x8d')],'as':_0x9bf6('0xc7')}]})[_0x9bf6('0x1f')](function(_0x598ebd){return[_0x598ebd,!![]];});});}})[_0x9bf6('0x75')](function(_0xc7fd88,_0x365361){if(_0x365361){return _0xc7fd88;}return db[_0x9bf6('0x8d')][_0x9bf6('0x5a')](_[_0x9bf6('0x52')](_0x3d7655[_0x9bf6('0x5b')],{'read':![],'body':_0x3d7655[_0x9bf6('0x5b')][_0x9bf6('0x5b')],'phone':_0x34b34d,'WhatsappAccountId':_0x1c15ef['id'],'WhatsappInteractionId':_0xc7fd88['id'],'UserId':_0x3d7655[_0x9bf6('0x5c')]['id'],'ContactId':_0x39718d['id']}))[_0x9bf6('0x1f')](function(_0x198543){_0xc7fd88[_0x9bf6('0xc8')][_0x9bf6('0xc7')]=[];_0xc7fd88[_0x9bf6('0xc8')][_0x9bf6('0xc7')][_0x9bf6('0xb4')](_0x198543[_0x9bf6('0xc8')]);return _0xc7fd88;});})[_0x9bf6('0x1f')](respondWithResult(_0x7a773f,null))[_0x9bf6('0x2a')](handleError(_0x7a773f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 75fc94d..0dab63a 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 _0x195b=['WhatsappAccount','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x2b0875,_0x21ff12){var _0xedb8d7=function(_0x33ebf6){while(--_0x33ebf6){_0x2b0875['push'](_0x2b0875['shift']());}};_0xedb8d7(++_0x21ff12);}(_0x195b,0x166));var _0xb195=function(_0x2d6558,_0x37f042){_0x2d6558=_0x2d6558-0x0;var _0x190f44=_0x195b[_0x2d6558];return _0x190f44;};'use strict';var EventEmitter=require(_0xb195('0x0'));var WhatsappAccount=require(_0xb195('0x1'))['db'][_0xb195('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb195('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb195('0x4'),'afterDestroy':_0xb195('0x5')};function emitEvent(_0x3ee710){return function(_0x38caa7,_0x2fdff4,_0x31e9f2){WhatsappAccountEvents[_0xb195('0x6')](_0x3ee710+':'+_0x38caa7['id'],_0x38caa7);WhatsappAccountEvents[_0xb195('0x6')](_0x3ee710,_0x38caa7);_0x31e9f2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xb195('0x7')](e,emitEvent(event));}}module[_0xb195('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x1b19=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x272329,_0x1231c0){var _0x188b0b=function(_0x15a683){while(--_0x15a683){_0x272329['push'](_0x272329['shift']());}};_0x188b0b(++_0x1231c0);}(_0x1b19,0x129));var _0x91b1=function(_0x1f9f67,_0x18dac2){_0x1f9f67=_0x1f9f67-0x0;var _0x3f2744=_0x1b19[_0x1f9f67];return _0x3f2744;};'use strict';var EventEmitter=require(_0x91b1('0x0'));var WhatsappAccount=require(_0x91b1('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x91b1('0x2'),'afterUpdate':_0x91b1('0x3'),'afterDestroy':_0x91b1('0x4')};function emitEvent(_0x12ab10){return function(_0x25dc40,_0x3648c7,_0x5379ff){WhatsappAccountEvents['emit'](_0x12ab10+':'+_0x25dc40['id'],_0x25dc40);WhatsappAccountEvents[_0x91b1('0x5')](_0x12ab10,_0x25dc40);_0x5379ff(null);};}for(var e in events){if(events[_0x91b1('0x6')](e)){var event=events[e];WhatsappAccount[_0x91b1('0x7')](e,emitEvent(event));}}module[_0x91b1('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 842017d..ddee3c6 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 _0x0e4c=['bluebird','path','../../config/environment','exports','define','whatsapp_accounts'];(function(_0x5f0572,_0x4f7b0c){var _0x467af4=function(_0x34bde3){while(--_0x34bde3){_0x5f0572['push'](_0x5f0572['shift']());}};_0x467af4(++_0x4f7b0c);}(_0x0e4c,0x1bc));var _0xc0e4=function(_0x3f0655,_0x101a0c){_0x3f0655=_0x3f0655-0x0;var _0x1e73f1=_0x0e4c[_0x3f0655];return _0x1e73f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc0e4('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0e4('0x1'));var rimraf=require('rimraf');var config=require(_0xc0e4('0x2'));var attributes=require('./whatsappAccount.attributes');module[_0xc0e4('0x3')]=function(_0x4f38ee,_0x5535bd){return _0x4f38ee[_0xc0e4('0x4')]('WhatsappAccount',attributes,{'tableName':_0xc0e4('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda3f=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','api','moment','bluebird','rimraf'];(function(_0x285249,_0x3ac3d2){var _0x15e5e6=function(_0x2dd9d2){while(--_0x2dd9d2){_0x285249['push'](_0x285249['shift']());}};_0x15e5e6(++_0x3ac3d2);}(_0xda3f,0x102));var _0xfda3=function(_0x4cdbee,_0x5875de){_0x4cdbee=_0x4cdbee-0x0;var _0x2af12b=_0xda3f[_0x4cdbee];return _0x2af12b;};'use strict';var _=require(_0xfda3('0x0'));var util=require(_0xfda3('0x1'));var logger=require('../../config/logger')(_0xfda3('0x2'));var moment=require(_0xfda3('0x3'));var BPromise=require(_0xfda3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x5'));var config=require(_0xfda3('0x6'));var attributes=require(_0xfda3('0x7'));module[_0xfda3('0x8')]=function(_0x102ec0,_0x2f95c8){return _0x102ec0[_0xfda3('0x9')](_0xfda3('0xa'),attributes,{'tableName':'whatsapp_accounts','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 5708e68..1d7cc37 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 _0x72e3=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','lodash','moment'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x72e3,0x6a));var _0x372e=function(_0x4d2f23,_0x2259fe){_0x4d2f23=_0x4d2f23-0x0;var _0x51dafa=_0x72e3[_0x4d2f23];return _0x51dafa;};'use strict';var _=require(_0x372e('0x0'));var util=require('util');var moment=require(_0x372e('0x1'));var BPromise=require(_0x372e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x372e('0x3'));var db=require(_0x372e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x372e('0x5'))(_0x372e('0x6'));var config=require(_0x372e('0x7'));var jayson=require(_0x372e('0x8'));var client=jayson[_0x372e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x372e('0xa')](config[_0x372e('0xb')],{'host':_0x372e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x372e('0xb')]));require(_0x372e('0xd'))[_0x372e('0xe')](socket);function respondWithRpcPromise(_0x4c9ca8,_0xb2debf,_0x957960){return new BPromise(function(_0x1c27fb,_0x783f8d){return client[_0x372e('0xf')](_0x4c9ca8,_0x957960)[_0x372e('0x10')](function(_0x44fc70){logger[_0x372e('0x11')](_0x372e('0x12'),_0xb2debf,_0x372e('0x13'));logger[_0x372e('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xb2debf,_0x372e('0x13'),JSON[_0x372e('0x15')](_0x44fc70));if(_0x44fc70['error']){if(_0x44fc70['error'][_0x372e('0x16')]===0x1f4){logger[_0x372e('0x17')](_0x372e('0x12'),_0xb2debf,_0x44fc70['error'][_0x372e('0x18')]);return _0x783f8d(_0x44fc70[_0x372e('0x17')][_0x372e('0x18')]);}logger[_0x372e('0x17')](_0x372e('0x12'),_0xb2debf,_0x44fc70['error'][_0x372e('0x18')]);return _0x1c27fb(_0x44fc70[_0x372e('0x17')][_0x372e('0x18')]);}else{logger[_0x372e('0x11')](_0x372e('0x12'),_0xb2debf,_0x372e('0x13'));_0x1c27fb(_0x44fc70[_0x372e('0x19')][_0x372e('0x18')]);}})[_0x372e('0x1a')](function(_0x5c2be3){logger['error'](_0x372e('0x12'),_0xb2debf,_0x5c2be3);_0x783f8d(_0x5c2be3);});});}exports[_0x372e('0x1b')]=function(_0x32a15b){var _0x17aa8f=this;return new Promise(function(_0xae2790,_0x62f78){return db[_0x372e('0x1c')]['find']({'raw':_0x32a15b['options']?_0x32a15b[_0x372e('0x1d')][_0x372e('0x1e')]===undefined?!![]:![]:!![],'where':_0x32a15b[_0x372e('0x1d')]?_0x32a15b[_0x372e('0x1d')][_0x372e('0x1f')]||null:null,'attributes':_0x32a15b[_0x372e('0x1d')]?_0x32a15b['options'][_0x372e('0x20')]||null:null,'include':_0x32a15b[_0x372e('0x1d')]?_0x32a15b[_0x372e('0x1d')][_0x372e('0x21')]?_[_0x372e('0x22')](_0x32a15b['options']['include'],function(_0x49a5b9){return{'model':db[_0x49a5b9[_0x372e('0x23')]],'as':_0x49a5b9['as'],'attributes':_0x49a5b9[_0x372e('0x20')],'include':_0x49a5b9[_0x372e('0x21')]?_[_0x372e('0x22')](_0x49a5b9[_0x372e('0x21')],function(_0x5ecaad){return{'model':db[_0x5ecaad[_0x372e('0x23')]],'as':_0x5ecaad['as'],'attributes':_0x5ecaad[_0x372e('0x20')],'include':_0x5ecaad[_0x372e('0x21')]?_[_0x372e('0x22')](_0x5ecaad[_0x372e('0x21')],function(_0x4411e4){return{'model':db[_0x4411e4['model']],'as':_0x4411e4['as'],'attributes':_0x4411e4[_0x372e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x372e('0x10')](function(_0x31ae92){logger['info'](_0x372e('0x1b'),_0x32a15b);logger[_0x372e('0x14')](_0x372e('0x1b'),_0x32a15b,JSON['stringify'](_0x31ae92));_0xae2790(_0x31ae92);})[_0x372e('0x1a')](function(_0x492918){logger['error'](_0x372e('0x1b'),_0x492918['message'],_0x32a15b);_0x62f78(_0x17aa8f[_0x372e('0x17')](0x1f4,_0x492918[_0x372e('0x18')]));});});}; \ No newline at end of file +var _0xebfc=['message','result','catch','ShowWhatsappAccount','find','options','attributes','include','map','model','stringify','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x10791c,_0x9c820f){var _0x43d912=function(_0x48a672){while(--_0x48a672){_0x10791c['push'](_0x10791c['shift']());}};_0x43d912(++_0x9c820f);}(_0xebfc,0x12b));var _0xcebf=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xebfc[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0xcebf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcebf('0x1'));var fs=require('fs');var Redis=require(_0xcebf('0x2'));var db=require(_0xcebf('0x3'))['db'];var utils=require(_0xcebf('0x4'));var logger=require('../../config/logger')(_0xcebf('0x5'));var config=require(_0xcebf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcebf('0x7')]['http']({'port':0x232a});config[_0xcebf('0x8')]=_[_0xcebf('0x9')](config[_0xcebf('0x8')],{'host':_0xcebf('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcebf('0xb'))['register'](socket);function respondWithRpcPromise(_0x449960,_0x1c5633,_0x12a1c2){return new BPromise(function(_0x3cc5a0,_0x439fac){return client[_0xcebf('0xc')](_0x449960,_0x12a1c2)[_0xcebf('0xd')](function(_0x3cbb7b){logger[_0xcebf('0xe')](_0xcebf('0xf'),_0x1c5633,_0xcebf('0x10'));logger[_0xcebf('0x11')](_0xcebf('0x12'),_0x1c5633,_0xcebf('0x10'),JSON['stringify'](_0x3cbb7b));if(_0x3cbb7b[_0xcebf('0x13')]){if(_0x3cbb7b['error'][_0xcebf('0x14')]===0x1f4){logger[_0xcebf('0x13')](_0xcebf('0xf'),_0x1c5633,_0x3cbb7b[_0xcebf('0x13')]['message']);return _0x439fac(_0x3cbb7b[_0xcebf('0x13')][_0xcebf('0x15')]);}logger[_0xcebf('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x1c5633,_0x3cbb7b[_0xcebf('0x13')]['message']);return _0x3cc5a0(_0x3cbb7b[_0xcebf('0x13')][_0xcebf('0x15')]);}else{logger['info'](_0xcebf('0xf'),_0x1c5633,_0xcebf('0x10'));_0x3cc5a0(_0x3cbb7b[_0xcebf('0x16')][_0xcebf('0x15')]);}})[_0xcebf('0x17')](function(_0x7854db){logger[_0xcebf('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x1c5633,_0x7854db);_0x439fac(_0x7854db);});});}exports[_0xcebf('0x18')]=function(_0x12c4cf){var _0x34801c=this;return new Promise(function(_0x460b07,_0x2f1aa1){return db['WhatsappAccount'][_0xcebf('0x19')]({'raw':_0x12c4cf['options']?_0x12c4cf[_0xcebf('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x12c4cf[_0xcebf('0x1a')]?_0x12c4cf[_0xcebf('0x1a')]['where']||null:null,'attributes':_0x12c4cf[_0xcebf('0x1a')]?_0x12c4cf[_0xcebf('0x1a')][_0xcebf('0x1b')]||null:null,'include':_0x12c4cf[_0xcebf('0x1a')]?_0x12c4cf['options'][_0xcebf('0x1c')]?_[_0xcebf('0x1d')](_0x12c4cf['options'][_0xcebf('0x1c')],function(_0x575eaf){return{'model':db[_0x575eaf[_0xcebf('0x1e')]],'as':_0x575eaf['as'],'attributes':_0x575eaf['attributes'],'include':_0x575eaf[_0xcebf('0x1c')]?_[_0xcebf('0x1d')](_0x575eaf[_0xcebf('0x1c')],function(_0x565394){return{'model':db[_0x565394[_0xcebf('0x1e')]],'as':_0x565394['as'],'attributes':_0x565394['attributes'],'include':_0x565394['include']?_[_0xcebf('0x1d')](_0x565394['include'],function(_0x3e046a){return{'model':db[_0x3e046a[_0xcebf('0x1e')]],'as':_0x3e046a['as'],'attributes':_0x3e046a[_0xcebf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcebf('0xd')](function(_0x5997fd){logger[_0xcebf('0xe')](_0xcebf('0x18'),_0x12c4cf);logger[_0xcebf('0x11')](_0xcebf('0x18'),_0x12c4cf,JSON[_0xcebf('0x1f')](_0x5997fd));_0x460b07(_0x5997fd);})['catch'](function(_0x46547){logger[_0xcebf('0x13')](_0xcebf('0x18'),_0x46547[_0xcebf('0x15')],_0x12c4cf);_0x2f1aa1(_0x34801c[_0xcebf('0x13')](0x1f4,_0x46547[_0xcebf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 744c573..58dc3e2 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 _0x74e7=['whatsappAccount:','save','remove','update','emit','register','length'];(function(_0x137c2d,_0x44519e){var _0x1f0065=function(_0xc67f2c){while(--_0xc67f2c){_0x137c2d['push'](_0x137c2d['shift']());}};_0x1f0065(++_0x44519e);}(_0x74e7,0xfd));var _0x774e=function(_0x5dae6d,_0x48fd80){_0x5dae6d=_0x5dae6d-0x0;var _0x4bb0b2=_0x74e7[_0x5dae6d];return _0x4bb0b2;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x774e('0x0'),_0x774e('0x1'),_0x774e('0x2')];function createListener(_0x1d712a,_0x2110d2){return function(_0x53b93f){_0x2110d2[_0x774e('0x3')](_0x1d712a,_0x53b93f);};}function removeListener(_0x3d86cd,_0x228b92){return function(){WhatsappAccountEvents['removeListener'](_0x3d86cd,_0x228b92);};}exports[_0x774e('0x4')]=function(_0x332b59){for(var _0x5af61e=0x0,_0x28f4b0=events[_0x774e('0x5')];_0x5af61e<_0x28f4b0;_0x5af61e++){var _0x24ad83=events[_0x5af61e];var _0x34b87b=createListener(_0x774e('0x6')+_0x24ad83,_0x332b59);WhatsappAccountEvents['on'](_0x24ad83,_0x34b87b);}}; \ No newline at end of file +var _0x2657=['removeListener','save','remove','update'];(function(_0x1ba1c5,_0x3cfa7f){var _0x316caf=function(_0x304c12){while(--_0x304c12){_0x1ba1c5['push'](_0x1ba1c5['shift']());}};_0x316caf(++_0x3cfa7f);}(_0x2657,0x151));var _0x7265=function(_0x26ed5e,_0xa05b94){_0x26ed5e=_0x26ed5e-0x0;var _0x2e607a=_0x2657[_0x26ed5e];return _0x2e607a;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x7265('0x0'),_0x7265('0x1'),_0x7265('0x2')];function createListener(_0x5d9f21,_0x452c1b){return function(_0x8c6a4c){_0x452c1b['emit'](_0x5d9f21,_0x8c6a4c);};}function removeListener(_0x3e2920,_0xd0d9cf){return function(){WhatsappAccountEvents[_0x7265('0x3')](_0x3e2920,_0xd0d9cf);};}exports['register']=function(_0x2ec7d4){for(var _0xb8a80e=0x0,_0x24c2ac=events['length'];_0xb8a80e<_0x24c2ac;_0xb8a80e++){var _0x38c8d9=events[_0xb8a80e];var _0x30e2c5=createListener('whatsappAccount:'+_0x38c8d9,_0x2ec7d4);WhatsappAccountEvents['on'](_0x38c8d9,_0x30e2c5);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index cefc77e..df3e4ed 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 _0x307a=['update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2960c8,_0x5d1666){var _0x31a521=function(_0x17df01){while(--_0x17df01){_0x2960c8['push'](_0x2960c8['shift']());}};_0x31a521(++_0x5d1666);}(_0x307a,0x124));var _0xa307=function(_0x50889f,_0x42dcbc){_0x50889f=_0x50889f-0x0;var _0x3cb47b=_0x307a[_0x50889f];return _0x3cb47b;};'use strict';var multer=require(_0xa307('0x0'));var util=require(_0xa307('0x1'));var path=require(_0xa307('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa307('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa307('0x4'));var interaction=require(_0xa307('0x5'));var config=require(_0xa307('0x6'));var controller=require('./whatsappApplication.controller');router[_0xa307('0x7')]('/',auth[_0xa307('0x8')](),controller[_0xa307('0x9')]);router[_0xa307('0x7')](_0xa307('0xa'),auth[_0xa307('0x8')](),controller[_0xa307('0xb')]);router[_0xa307('0xc')]('/',auth['isAuthenticated'](),controller[_0xa307('0xd')]);router['put'](_0xa307('0xa'),auth[_0xa307('0x8')](),controller[_0xa307('0xe')]);router[_0xa307('0xf')](_0xa307('0xa'),auth[_0xa307('0x8')](),controller[_0xa307('0x10')]);module['exports']=router; \ No newline at end of file +var _0xde60=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3eec20,_0xd31e87){var _0xde7031=function(_0x5cc51f){while(--_0x5cc51f){_0x3eec20['push'](_0x3eec20['shift']());}};_0xde7031(++_0xd31e87);}(_0xde60,0x114));var _0x0de6=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0xde60[_0x401b3e];return _0x4f290f;};'use strict';var multer=require(_0x0de6('0x0'));var util=require('util');var path=require(_0x0de6('0x1'));var timeout=require(_0x0de6('0x2'));var express=require(_0x0de6('0x3'));var router=express[_0x0de6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0de6('0x5'));var interaction=require(_0x0de6('0x6'));var config=require(_0x0de6('0x7'));var controller=require(_0x0de6('0x8'));router[_0x0de6('0x9')]('/',auth[_0x0de6('0xa')](),controller[_0x0de6('0xb')]);router['get'](_0x0de6('0xc'),auth[_0x0de6('0xa')](),controller[_0x0de6('0xd')]);router[_0x0de6('0xe')]('/',auth[_0x0de6('0xa')](),controller[_0x0de6('0xf')]);router[_0x0de6('0x10')](_0x0de6('0xc'),auth['isAuthenticated'](),controller[_0x0de6('0x11')]);router['delete'](_0x0de6('0xc'),auth[_0x0de6('0xa')](),controller[_0x0de6('0x12')]);module[_0x0de6('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ea3690b..5596204 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 _0xedb2=['TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x32c25c,_0x448a3c){var _0x245c7c=function(_0x366d08){while(--_0x366d08){_0x32c25c['push'](_0x32c25c['shift']());}};_0x245c7c(++_0x448a3c);}(_0xedb2,0xe8));var _0x2edb=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xedb2[_0x5416db];return _0x243e35;};'use strict';var Sequelize=require(_0x2edb('0x0'));module[_0x2edb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2edb('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2edb('0x3')]()},'description':{'type':Sequelize[_0x2edb('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2edb('0x4')}}; \ No newline at end of file +var _0x1405=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x363d56,_0x1b3a02){var _0x403095=function(_0x1ac440){while(--_0x1ac440){_0x363d56['push'](_0x363d56['shift']());}};_0x403095(++_0x1b3a02);}(_0x1405,0x1a8));var _0x5140=function(_0x39a98e,_0x134184){_0x39a98e=_0x39a98e-0x0;var _0x4542fb=_0x1405[_0x39a98e];return _0x4542fb;};'use strict';var Sequelize=require('sequelize');module[_0x5140('0x0')]={'priority':{'type':Sequelize[_0x5140('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5140('0x2')],'allowNull':![],'defaultValue':_0x5140('0x3')},'appdata':{'type':Sequelize[_0x5140('0x4')]()},'description':{'type':Sequelize[_0x5140('0x2')]},'interval':{'type':Sequelize[_0x5140('0x2')],'defaultValue':_0x5140('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 36e528b..7fc4020 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 _0xae6e=['attributes','length','hasOwnProperty','nolimit','sort','filter','merge','where','include','findAll','show','create','body','catch','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','WhatsappApplication','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x4c8d5f,_0x5df26a){var _0x162c19=function(_0x4cbb9a){while(--_0x4cbb9a){_0x4c8d5f['push'](_0x4c8d5f['shift']());}};_0x162c19(++_0x5df26a);}(_0xae6e,0x1e5));var _0xeae6=function(_0x16899b,_0x5eabf5){_0x16899b=_0x16899b-0x0;var _0x2f9db0=_0xae6e[_0x16899b];return _0x2f9db0;};'use strict';var emlformat=require(_0xeae6('0x0'));var rimraf=require(_0xeae6('0x1'));var zipdir=require(_0xeae6('0x2'));var jsonpatch=require(_0xeae6('0x3'));var rp=require(_0xeae6('0x4'));var moment=require('moment');var BPromise=require(_0xeae6('0x5'));var Mustache=require('mustache');var util=require(_0xeae6('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeae6('0x7'));var fs=require('fs');var fs_extra=require(_0xeae6('0x8'));var _=require('lodash');var squel=require(_0xeae6('0x9'));var crypto=require(_0xeae6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeae6('0xb'));var querystring=require(_0xeae6('0xc'));var Papa=require(_0xeae6('0xd'));var Redis=require(_0xeae6('0xe'));var authService=require(_0xeae6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeae6('0x10'));var hardwareService=require(_0xeae6('0x11'));var logger=require(_0xeae6('0x12'))(_0xeae6('0x13'));var utils=require(_0xeae6('0x14'));var config=require(_0xeae6('0x15'));var licenseUtil=require(_0xeae6('0x16'));var db=require(_0xeae6('0x17'))['db'];function respondWithStatusCode(_0x571985,_0x429d80){_0x429d80=_0x429d80||0xcc;return function(_0x5050b5){if(_0x5050b5){return _0x571985['sendStatus'](_0x429d80);}return _0x571985[_0xeae6('0x18')](_0x429d80)[_0xeae6('0x19')]();};}function respondWithResult(_0x1741a5,_0x31f94a){_0x31f94a=_0x31f94a||0xc8;return function(_0x426af){if(_0x426af){return _0x1741a5[_0xeae6('0x18')](_0x31f94a)[_0xeae6('0x1a')](_0x426af);}};}function respondWithFilteredResult(_0x1b91cf,_0x34a0e5){return function(_0x5e5f55){if(_0x5e5f55){var _0x553429=typeof _0x34a0e5[_0xeae6('0x1b')]===_0xeae6('0x1c')&&typeof _0x34a0e5[_0xeae6('0x1d')]===_0xeae6('0x1c');var _0x5deb01=_0x5e5f55[_0xeae6('0x1e')];var _0x3376b6=_0x553429?0x0:_0x34a0e5[_0xeae6('0x1b')];var _0x126e69=_0x553429?_0x5e5f55[_0xeae6('0x1e')]:_0x34a0e5[_0xeae6('0x1b')]+_0x34a0e5[_0xeae6('0x1d')];var _0x120e29;if(_0x126e69>=_0x5deb01){_0x126e69=_0x5deb01;_0x120e29=0xc8;}else{_0x120e29=0xce;}_0x1b91cf['status'](_0x120e29);return _0x1b91cf['set'](_0xeae6('0x1f'),_0x3376b6+'-'+_0x126e69+'/'+_0x5deb01)['json'](_0x5e5f55);}return null;};}function patchUpdates(_0x1f0550){return function(_0x166a78){try{jsonpatch[_0xeae6('0x20')](_0x166a78,_0x1f0550,!![]);}catch(_0x48843c){return BPromise[_0xeae6('0x21')](_0x48843c);}return _0x166a78[_0xeae6('0x22')]();};}function saveUpdates(_0x2dbc6d,_0x1e8c0f){return function(_0xfd44b5){if(_0xfd44b5){return _0xfd44b5[_0xeae6('0x23')](_0x2dbc6d)[_0xeae6('0x24')](function(_0x1ed263){return _0x1ed263;});}return null;};}function removeEntity(_0x4b8886,_0x47c8a0){return function(_0x4bf0db){if(_0x4bf0db){return _0x4bf0db[_0xeae6('0x25')]()[_0xeae6('0x24')](function(){_0x4b8886[_0xeae6('0x18')](0xcc)[_0xeae6('0x19')]();});}};}function handleEntityNotFound(_0x25b540,_0x3dabff){return function(_0x172349){if(!_0x172349){_0x25b540['sendStatus'](0x194);}return _0x172349;};}function handleError(_0x34dfb4,_0x551720){_0x551720=_0x551720||0x1f4;return function(_0x5a5861){logger['error'](_0x5a5861[_0xeae6('0x26')]);if(_0x5a5861[_0xeae6('0x27')]){delete _0x5a5861[_0xeae6('0x27')];}_0x34dfb4[_0xeae6('0x18')](_0x551720)['send'](_0x5a5861);};}exports['index']=function(_0x538dfb,_0x22fa08){var _0x21a54e={},_0x1f702a={},_0x5bacc6={'count':0x0,'rows':[]};var _0x20819f=_[_0xeae6('0x28')](db[_0xeae6('0x29')]['rawAttributes'],function(_0x54bee5){return{'name':_0x54bee5[_0xeae6('0x2a')],'type':_0x54bee5[_0xeae6('0x2b')][_0xeae6('0x2c')]};});_0x1f702a[_0xeae6('0x2d')]=_[_0xeae6('0x28')](_0x20819f,_0xeae6('0x27'));_0x1f702a[_0xeae6('0x2e')]=_[_0xeae6('0x2f')](_0x538dfb[_0xeae6('0x2e')]);_0x1f702a[_0xeae6('0x30')]=_[_0xeae6('0x31')](_0x1f702a[_0xeae6('0x2d')],_0x1f702a[_0xeae6('0x2e')]);_0x21a54e['attributes']=_[_0xeae6('0x31')](_0x1f702a[_0xeae6('0x2d')],qs[_0xeae6('0x32')](_0x538dfb[_0xeae6('0x2e')][_0xeae6('0x32')]));_0x21a54e[_0xeae6('0x33')]=_0x21a54e['attributes'][_0xeae6('0x34')]?_0x21a54e[_0xeae6('0x33')]:_0x1f702a[_0xeae6('0x2d')];if(!_0x538dfb[_0xeae6('0x2e')][_0xeae6('0x35')](_0xeae6('0x36'))){_0x21a54e[_0xeae6('0x1d')]=qs[_0xeae6('0x1d')](_0x538dfb[_0xeae6('0x2e')]['limit']);_0x21a54e[_0xeae6('0x1b')]=qs[_0xeae6('0x1b')](_0x538dfb[_0xeae6('0x2e')][_0xeae6('0x1b')]);}_0x21a54e['order']=qs[_0xeae6('0x37')](_0x538dfb[_0xeae6('0x2e')][_0xeae6('0x37')]);_0x21a54e['where']=qs[_0xeae6('0x30')](_['pick'](_0x538dfb[_0xeae6('0x2e')],_0x1f702a['filters']),_0x20819f);if(_0x538dfb[_0xeae6('0x2e')][_0xeae6('0x38')]){_0x21a54e['where']=_[_0xeae6('0x39')](_0x21a54e['where'],{'$or':_['map'](_0x20819f,function(_0x26b08d){if(_0x26b08d[_0xeae6('0x2b')]!=='VIRTUAL'){var _0x1da578={};_0x1da578[_0x26b08d[_0xeae6('0x27')]]={'$like':'%'+_0x538dfb[_0xeae6('0x2e')][_0xeae6('0x38')]+'%'};return _0x1da578;}})});}_0x21a54e=_[_0xeae6('0x39')]({},_0x21a54e,_0x538dfb['options']);var _0x3e7f21={'where':_0x21a54e[_0xeae6('0x3a')]};return db[_0xeae6('0x29')]['count'](_0x3e7f21)['then'](function(_0x1b1175){_0x5bacc6['count']=_0x1b1175;if(_0x538dfb[_0xeae6('0x2e')]['includeAll']){_0x21a54e[_0xeae6('0x3b')]=[{'all':!![]}];}return db[_0xeae6('0x29')][_0xeae6('0x3c')](_0x21a54e);})['then'](function(_0x529a4a){_0x5bacc6['rows']=_0x529a4a;return _0x5bacc6;})[_0xeae6('0x24')](respondWithFilteredResult(_0x22fa08,_0x21a54e))['catch'](handleError(_0x22fa08,null));};exports[_0xeae6('0x3d')]=function(_0x3aeac6,_0x4f4f11){var _0x103de3={'raw':!![],'where':{'id':_0x3aeac6['params']['id']}},_0x78664d={};_0x78664d['model']=_[_0xeae6('0x2f')](db['WhatsappApplication']['rawAttributes']);_0x78664d[_0xeae6('0x2e')]=_[_0xeae6('0x2f')](_0x3aeac6['query']);_0x78664d[_0xeae6('0x30')]=_[_0xeae6('0x31')](_0x78664d[_0xeae6('0x2d')],_0x78664d[_0xeae6('0x2e')]);_0x103de3[_0xeae6('0x33')]=_[_0xeae6('0x31')](_0x78664d[_0xeae6('0x2d')],qs[_0xeae6('0x32')](_0x3aeac6[_0xeae6('0x2e')][_0xeae6('0x32')]));_0x103de3['attributes']=_0x103de3[_0xeae6('0x33')][_0xeae6('0x34')]?_0x103de3['attributes']:_0x78664d[_0xeae6('0x2d')];if(_0x3aeac6[_0xeae6('0x2e')]['includeAll']){_0x103de3[_0xeae6('0x3b')]=[{'all':!![]}];}_0x103de3=_[_0xeae6('0x39')]({},_0x103de3,_0x3aeac6['options']);return db[_0xeae6('0x29')]['find'](_0x103de3)['then'](handleEntityNotFound(_0x4f4f11,null))[_0xeae6('0x24')](respondWithResult(_0x4f4f11,null))['catch'](handleError(_0x4f4f11,null));};exports[_0xeae6('0x3e')]=function(_0x129e25,_0x2a06bd){return db[_0xeae6('0x29')][_0xeae6('0x3e')](_0x129e25[_0xeae6('0x3f')],{})['then'](respondWithResult(_0x2a06bd,0xc9))[_0xeae6('0x40')](handleError(_0x2a06bd,null));};exports[_0xeae6('0x23')]=function(_0x1171a5,_0x5eac0b){if(_0x1171a5['body']['id']){delete _0x1171a5[_0xeae6('0x3f')]['id'];}return db['WhatsappApplication'][_0xeae6('0x41')]({'where':{'id':_0x1171a5[_0xeae6('0x42')]['id']}})['then'](handleEntityNotFound(_0x5eac0b,null))['then'](saveUpdates(_0x1171a5['body'],null))[_0xeae6('0x24')](respondWithResult(_0x5eac0b,null))['catch'](handleError(_0x5eac0b,null));};exports[_0xeae6('0x25')]=function(_0x902adc,_0x4aa50a){return db[_0xeae6('0x29')]['find']({'where':{'id':_0x902adc[_0xeae6('0x42')]['id']}})[_0xeae6('0x24')](handleEntityNotFound(_0x4aa50a,null))[_0xeae6('0x24')](removeEntity(_0x4aa50a,null))[_0xeae6('0x40')](handleError(_0x4aa50a,null));}; \ No newline at end of file +var _0x2aa3=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/logger','../../config/utils'];(function(_0x40224c,_0x375358){var _0x528eeb=function(_0x17b782){while(--_0x17b782){_0x40224c['push'](_0x40224c['shift']());}};_0x528eeb(++_0x375358);}(_0x2aa3,0x83));var _0x32aa=function(_0x34ea6f,_0x4a2e84){_0x34ea6f=_0x34ea6f-0x0;var _0x578739=_0x2aa3[_0x34ea6f];return _0x578739;};'use strict';var emlformat=require(_0x32aa('0x0'));var rimraf=require(_0x32aa('0x1'));var zipdir=require(_0x32aa('0x2'));var jsonpatch=require(_0x32aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x32aa('0x4'));var Mustache=require(_0x32aa('0x5'));var util=require(_0x32aa('0x6'));var path=require(_0x32aa('0x7'));var sox=require(_0x32aa('0x8'));var csv=require(_0x32aa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32aa('0xa'));var _=require(_0x32aa('0xb'));var squel=require(_0x32aa('0xc'));var crypto=require(_0x32aa('0xd'));var jsforce=require(_0x32aa('0xe'));var deskjs=require(_0x32aa('0xf'));var toCsv=require(_0x32aa('0x9'));var querystring=require(_0x32aa('0x10'));var Papa=require('papaparse');var Redis=require(_0x32aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x32aa('0x12'));var as=require(_0x32aa('0x13'));var hardwareService=require(_0x32aa('0x14'));var logger=require(_0x32aa('0x15'))('api');var utils=require(_0x32aa('0x16'));var config=require(_0x32aa('0x17'));var licenseUtil=require(_0x32aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d341f,_0x32aca0){_0x32aca0=_0x32aca0||0xcc;return function(_0x3640f9){if(_0x3640f9){return _0x3d341f[_0x32aa('0x19')](_0x32aca0);}return _0x3d341f[_0x32aa('0x1a')](_0x32aca0)[_0x32aa('0x1b')]();};}function respondWithResult(_0x5e96e3,_0x46758f){_0x46758f=_0x46758f||0xc8;return function(_0x58d625){if(_0x58d625){return _0x5e96e3[_0x32aa('0x1a')](_0x46758f)[_0x32aa('0x1c')](_0x58d625);}};}function respondWithFilteredResult(_0x1140a6,_0x2cc92d){return function(_0x211278){if(_0x211278){var _0x47eadd=typeof _0x2cc92d[_0x32aa('0x1d')]===_0x32aa('0x1e')&&typeof _0x2cc92d[_0x32aa('0x1f')]===_0x32aa('0x1e');var _0x29c1c4=_0x211278['count'];var _0x5196c0=_0x47eadd?0x0:_0x2cc92d[_0x32aa('0x1d')];var _0x34dcaf=_0x47eadd?_0x211278[_0x32aa('0x20')]:_0x2cc92d['offset']+_0x2cc92d['limit'];var _0x1a0262;if(_0x34dcaf>=_0x29c1c4){_0x34dcaf=_0x29c1c4;_0x1a0262=0xc8;}else{_0x1a0262=0xce;}_0x1140a6[_0x32aa('0x1a')](_0x1a0262);return _0x1140a6[_0x32aa('0x21')](_0x32aa('0x22'),_0x5196c0+'-'+_0x34dcaf+'/'+_0x29c1c4)[_0x32aa('0x1c')](_0x211278);}return null;};}function patchUpdates(_0x1cb0eb){return function(_0x5729af){try{jsonpatch[_0x32aa('0x23')](_0x5729af,_0x1cb0eb,!![]);}catch(_0x327831){return BPromise[_0x32aa('0x24')](_0x327831);}return _0x5729af[_0x32aa('0x25')]();};}function saveUpdates(_0x2aa421,_0x90d165){return function(_0x1ce405){if(_0x1ce405){return _0x1ce405[_0x32aa('0x26')](_0x2aa421)[_0x32aa('0x27')](function(_0x53c65a){return _0x53c65a;});}return null;};}function removeEntity(_0x4e66e6,_0x5c82d2){return function(_0x6766da){if(_0x6766da){return _0x6766da[_0x32aa('0x28')]()['then'](function(){_0x4e66e6['status'](0xcc)[_0x32aa('0x1b')]();});}};}function handleEntityNotFound(_0x313930,_0x3ba6b2){return function(_0x13d610){if(!_0x13d610){_0x313930[_0x32aa('0x19')](0x194);}return _0x13d610;};}function handleError(_0x3606ae,_0x27df0e){_0x27df0e=_0x27df0e||0x1f4;return function(_0x405b03){logger[_0x32aa('0x29')](_0x405b03['stack']);if(_0x405b03[_0x32aa('0x2a')]){delete _0x405b03[_0x32aa('0x2a')];}_0x3606ae['status'](_0x27df0e)[_0x32aa('0x2b')](_0x405b03);};}exports['index']=function(_0x4f73d1,_0x21d730){var _0x212ee4={},_0x1d1c80={},_0x11c818={'count':0x0,'rows':[]};var _0x5903b8=_[_0x32aa('0x2c')](db[_0x32aa('0x2d')][_0x32aa('0x2e')],function(_0x29706e){return{'name':_0x29706e[_0x32aa('0x2f')],'type':_0x29706e[_0x32aa('0x30')]['key']};});_0x1d1c80['model']=_[_0x32aa('0x2c')](_0x5903b8,_0x32aa('0x2a'));_0x1d1c80[_0x32aa('0x31')]=_[_0x32aa('0x32')](_0x4f73d1['query']);_0x1d1c80['filters']=_[_0x32aa('0x33')](_0x1d1c80['model'],_0x1d1c80[_0x32aa('0x31')]);_0x212ee4[_0x32aa('0x34')]=_['intersection'](_0x1d1c80[_0x32aa('0x35')],qs[_0x32aa('0x36')](_0x4f73d1['query'][_0x32aa('0x36')]));_0x212ee4[_0x32aa('0x34')]=_0x212ee4[_0x32aa('0x34')][_0x32aa('0x37')]?_0x212ee4[_0x32aa('0x34')]:_0x1d1c80[_0x32aa('0x35')];if(!_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x38')](_0x32aa('0x39'))){_0x212ee4[_0x32aa('0x1f')]=qs[_0x32aa('0x1f')](_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x1f')]);_0x212ee4[_0x32aa('0x1d')]=qs['offset'](_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x1d')]);}_0x212ee4[_0x32aa('0x3a')]=qs[_0x32aa('0x3b')](_0x4f73d1[_0x32aa('0x31')]['sort']);_0x212ee4[_0x32aa('0x3c')]=qs[_0x32aa('0x3d')](_[_0x32aa('0x3e')](_0x4f73d1[_0x32aa('0x31')],_0x1d1c80[_0x32aa('0x3d')]),_0x5903b8);if(_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x3f')]){_0x212ee4[_0x32aa('0x3c')]=_[_0x32aa('0x40')](_0x212ee4[_0x32aa('0x3c')],{'$or':_[_0x32aa('0x2c')](_0x5903b8,function(_0x563a74){if(_0x563a74['type']!==_0x32aa('0x41')){var _0x3c4fb6={};_0x3c4fb6[_0x563a74[_0x32aa('0x2a')]]={'$like':'%'+_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x3f')]+'%'};return _0x3c4fb6;}})});}_0x212ee4=_[_0x32aa('0x40')]({},_0x212ee4,_0x4f73d1[_0x32aa('0x42')]);var _0x555a83={'where':_0x212ee4[_0x32aa('0x3c')]};return db[_0x32aa('0x2d')][_0x32aa('0x20')](_0x555a83)[_0x32aa('0x27')](function(_0x517614){_0x11c818[_0x32aa('0x20')]=_0x517614;if(_0x4f73d1['query'][_0x32aa('0x43')]){_0x212ee4[_0x32aa('0x44')]=[{'all':!![]}];}return db[_0x32aa('0x2d')][_0x32aa('0x45')](_0x212ee4);})[_0x32aa('0x27')](function(_0x5c4052){_0x11c818[_0x32aa('0x46')]=_0x5c4052;return _0x11c818;})[_0x32aa('0x27')](respondWithFilteredResult(_0x21d730,_0x212ee4))[_0x32aa('0x47')](handleError(_0x21d730,null));};exports[_0x32aa('0x48')]=function(_0x4fb0f4,_0x142572){var _0x483a04={'raw':!![],'where':{'id':_0x4fb0f4[_0x32aa('0x49')]['id']}},_0x1640f3={};_0x1640f3['model']=_[_0x32aa('0x32')](db[_0x32aa('0x2d')][_0x32aa('0x2e')]);_0x1640f3[_0x32aa('0x31')]=_[_0x32aa('0x32')](_0x4fb0f4[_0x32aa('0x31')]);_0x1640f3[_0x32aa('0x3d')]=_[_0x32aa('0x33')](_0x1640f3['model'],_0x1640f3['query']);_0x483a04[_0x32aa('0x34')]=_[_0x32aa('0x33')](_0x1640f3[_0x32aa('0x35')],qs[_0x32aa('0x36')](_0x4fb0f4[_0x32aa('0x31')]['fields']));_0x483a04[_0x32aa('0x34')]=_0x483a04[_0x32aa('0x34')][_0x32aa('0x37')]?_0x483a04['attributes']:_0x1640f3[_0x32aa('0x35')];if(_0x4fb0f4['query']['includeAll']){_0x483a04[_0x32aa('0x44')]=[{'all':!![]}];}_0x483a04=_[_0x32aa('0x40')]({},_0x483a04,_0x4fb0f4[_0x32aa('0x42')]);return db['WhatsappApplication']['find'](_0x483a04)[_0x32aa('0x27')](handleEntityNotFound(_0x142572,null))[_0x32aa('0x27')](respondWithResult(_0x142572,null))[_0x32aa('0x47')](handleError(_0x142572,null));};exports[_0x32aa('0x4a')]=function(_0x10078d,_0x1bb782){return db[_0x32aa('0x2d')][_0x32aa('0x4a')](_0x10078d[_0x32aa('0x4b')],{})[_0x32aa('0x27')](respondWithResult(_0x1bb782,0xc9))[_0x32aa('0x47')](handleError(_0x1bb782,null));};exports[_0x32aa('0x26')]=function(_0x75bd4,_0x1955dc){if(_0x75bd4['body']['id']){delete _0x75bd4['body']['id'];}return db[_0x32aa('0x2d')][_0x32aa('0x4c')]({'where':{'id':_0x75bd4[_0x32aa('0x49')]['id']}})[_0x32aa('0x27')](handleEntityNotFound(_0x1955dc,null))[_0x32aa('0x27')](saveUpdates(_0x75bd4[_0x32aa('0x4b')],null))[_0x32aa('0x27')](respondWithResult(_0x1955dc,null))[_0x32aa('0x47')](handleError(_0x1955dc,null));};exports['destroy']=function(_0x5573f7,_0x7115ef){return db['WhatsappApplication']['find']({'where':{'id':_0x5573f7[_0x32aa('0x49')]['id']}})[_0x32aa('0x27')](handleEntityNotFound(_0x7115ef,null))[_0x32aa('0x27')](removeEntity(_0x7115ef,null))[_0x32aa('0x47')](handleError(_0x7115ef,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 211a9e4..11908f3 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 _0x84ab=['exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./whatsappApplication.attributes'];(function(_0x4b496f,_0x360dd1){var _0x3e563e=function(_0x48f3a0){while(--_0x48f3a0){_0x4b496f['push'](_0x4b496f['shift']());}};_0x3e563e(++_0x360dd1);}(_0x84ab,0x12f));var _0xb84a=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x84ab[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb84a('0xb'),'collate':_0xb84a('0xc')});}; \ No newline at end of file +var _0x2e8a=['utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','define','whatsapp_applications','utf8mb4'];(function(_0x1cab41,_0x4bfa57){var _0x511deb=function(_0x3d1a43){while(--_0x3d1a43){_0x1cab41['push'](_0x1cab41['shift']());}};_0x511deb(++_0x4bfa57);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x215f9e,_0x438b14){_0x215f9e=_0x215f9e-0x0;var _0x217ce4=_0x2e8a[_0x215f9e];return _0x217ce4;};'use strict';var _=require('lodash');var util=require(_0xa2e8('0x0'));var logger=require(_0xa2e8('0x1'))('api');var moment=require(_0xa2e8('0x2'));var BPromise=require(_0xa2e8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2e8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x4593d2,_0x32fb35){return _0x4593d2[_0xa2e8('0x5')]('WhatsappApplication',attributes,{'tableName':_0xa2e8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa2e8('0x7'),'collate':_0xa2e8('0x8')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index aa7335a..3b43cab 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1f59eb,_0x2f642b){var _0x94ed9e=function(_0x49cdde){while(--_0x49cdde){_0x1f59eb['push'](_0x1f59eb['shift']());}};_0x94ed9e(++_0x2f642b);}(_0xac9d,0x14d));var _0xdac9=function(_0x9faff7,_0x59a564){_0x9faff7=_0x9faff7-0x0;var _0x4f8043=_0xac9d[_0x9faff7];return _0x4f8043;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x392a3c,_0x2d8685){var _0x1e95d1=function(_0x8e1de4){while(--_0x8e1de4){_0x392a3c['push'](_0x392a3c['shift']());}};_0x1e95d1(++_0x2d8685);}(_0xb821,0xa7));var _0x1b82=function(_0x1849a7,_0x2e2d59){_0x1849a7=_0x1849a7-0x0;var _0x4e93ce=_0xb821[_0x1849a7];return _0x4e93ce;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 6264386..16139fa 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 _0xfb65=['/:id/tags','tracked','addTags','put','whatsapp','update','delete','destroy','removeTags','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage'];(function(_0x439e4d,_0x1f05d3){var _0x515842=function(_0x56ea42){while(--_0x56ea42){_0x439e4d['push'](_0x439e4d['shift']());}};_0x515842(++_0x1f05d3);}(_0xfb65,0x82));var _0x5fb6=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0xfb65[_0x224dda];return _0x2987ac;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0x8')]('/:id/messages',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xe')]);router['get'](_0x5fb6('0xf'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x10')]);router[_0x5fb6('0x11')]('/',auth[_0x5fb6('0xa')](),controller['create']);router[_0x5fb6('0x11')](_0x5fb6('0x12'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x13')]);router[_0x5fb6('0x11')](_0x5fb6('0x14'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')]('whatsapp','whatsappinteraction:addtags'),controller[_0x5fb6('0x16')]);router[_0x5fb6('0x17')]('/:id',auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:update'),controller[_0x5fb6('0x19')]);router[_0x5fb6('0x1a')](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:destroy'),controller[_0x5fb6('0x1b')]);router['delete'](_0x5fb6('0x14'),auth['isAuthenticated'](),controller[_0x5fb6('0x1c')]);module[_0x5fb6('0x1d')]=router; \ No newline at end of file +var _0x1db9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id/messages','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1db9,0x176));var _0x91db=function(_0x5e22fc,_0x565328){_0x5e22fc=_0x5e22fc-0x0;var _0x14ab80=_0x1db9[_0x5e22fc];return _0x14ab80;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0x8')](_0x91db('0xc'),auth[_0x91db('0xa')](),controller['getMessages']);router[_0x91db('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x91db('0xd')]('/',auth[_0x91db('0xa')](),controller['create']);router['post'](_0x91db('0xc'),auth[_0x91db('0xa')](),controller[_0x91db('0xe')]);router[_0x91db('0xd')](_0x91db('0xf'),auth['isAuthenticated'](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x12')),controller[_0x91db('0x13')]);router[_0x91db('0x14')](_0x91db('0x15'),auth[_0x91db('0xa')](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x16')),controller[_0x91db('0x17')]);router[_0x91db('0x18')]('/:id',auth[_0x91db('0xa')](),interaction[_0x91db('0x10')](_0x91db('0x11'),_0x91db('0x19')),controller[_0x91db('0x1a')]);router[_0x91db('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0x91db('0x1b')]);module[_0x91db('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index b2cf7d2..9d12b11 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 _0x24ce=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x16360e,_0x1f51cc){var _0x15735a=function(_0x1a6968){while(--_0x1a6968){_0x16360e['push'](_0x16360e['shift']());}};_0x15735a(++_0x1f51cc);}(_0x24ce,0x1de));var _0xe24c=function(_0x436f24,_0x12d1cd){_0x436f24=_0x436f24-0x0;var _0x2a86c5=_0x24ce[_0x436f24];return _0x2a86c5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe24c('0x0'));module[_0xe24c('0x1')]={'closed':{'type':Sequelize[_0xe24c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe24c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe24c('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xe24c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe24c('0x5')]('in',_0xe24c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe24c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xe24c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe24c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbe3b=['exports','DATE','STRING','ENUM','out','BOOLEAN','moment'];(function(_0x4c7f40,_0x5dc8a6){var _0x326e1f=function(_0x169687){while(--_0x169687){_0x4c7f40['push'](_0x4c7f40['shift']());}};_0x326e1f(++_0x5dc8a6);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x31acc7,_0x168431){_0x31acc7=_0x31acc7-0x0;var _0x10d549=_0xbe3b[_0x31acc7];return _0x10d549;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbbe3('0x0'));module[_0xbbe3('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbbe3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbbe3('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbbe3('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbbe3('0x4')]('in',_0xbbe3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbbe3('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbbe3('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbbe3('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index adc5d2d..d587207 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 _0x50e5=['type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','show','include','options','create','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','spread','whatsappInteractionTags:save','removeTags','download','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','attachments','Attachment','Messages','direction','Account','Owner','get','Whatsapp','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','lastName','out','secret','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','unlinkSync','sendStatus','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./whatsappInteraction.socket','register','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','closed','UserId','answered','unmanaged','index','map','WhatsappInteraction','rawAttributes'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x50e5,0xb7));var _0x550e=function(_0x58a2ea,_0x4bb2ac){_0x58a2ea=_0x58a2ea-0x0;var _0x37f8c4=_0x50e5[_0x58a2ea];return _0x37f8c4;};'use strict';var emlformat=require(_0x550e('0x0'));var rimraf=require(_0x550e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x550e('0x2'));var rp=require(_0x550e('0x3'));var moment=require(_0x550e('0x4'));var BPromise=require(_0x550e('0x5'));var Mustache=require(_0x550e('0x6'));var util=require(_0x550e('0x7'));var path=require(_0x550e('0x8'));var sox=require(_0x550e('0x9'));var csv=require(_0x550e('0xa'));var ejs=require(_0x550e('0xb'));var fs=require('fs');var fs_extra=require(_0x550e('0xc'));var _=require(_0x550e('0xd'));var squel=require('squel');var crypto=require(_0x550e('0xe'));var jsforce=require(_0x550e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x550e('0xa'));var querystring=require(_0x550e('0x10'));var Papa=require(_0x550e('0x11'));var Redis=require('ioredis');var authService=require(_0x550e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x550e('0x13'));var hardwareService=require(_0x550e('0x14'));var logger=require('../../config/logger')(_0x550e('0x15'));var utils=require(_0x550e('0x16'));var config=require(_0x550e('0x17'));var licenseUtil=require(_0x550e('0x18'));var db=require('../../mysqldb')['db'];config[_0x550e('0x19')]=_['defaults'](config[_0x550e('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x550e('0x1a'))(new Redis(config[_0x550e('0x19')]));require(_0x550e('0x1b'))[_0x550e('0x1c')](socket);function respondWithStatusCode(_0x136e79,_0x4f79ed){_0x4f79ed=_0x4f79ed||0xcc;return function(_0x302be0){if(_0x302be0){return _0x136e79['sendStatus'](_0x4f79ed);}return _0x136e79[_0x550e('0x1d')](_0x4f79ed)['end']();};}function respondWithResult(_0x4a5f7a,_0x31f4bf){_0x31f4bf=_0x31f4bf||0xc8;return function(_0xabb30d){if(_0xabb30d){return _0x4a5f7a['status'](_0x31f4bf)['json'](_0xabb30d);}};}function respondWithFilteredResult(_0x4e450c,_0x22c264){return function(_0x5ed213){if(_0x5ed213){var _0x580c6f=typeof _0x22c264[_0x550e('0x1e')]===_0x550e('0x1f')&&typeof _0x22c264[_0x550e('0x20')]===_0x550e('0x1f');var _0x1ff0e9=_0x5ed213[_0x550e('0x21')];var _0x3b4dca=_0x580c6f?0x0:_0x22c264[_0x550e('0x1e')];var _0x1b9799=_0x580c6f?_0x5ed213['count']:_0x22c264[_0x550e('0x1e')]+_0x22c264[_0x550e('0x20')];var _0x5bdfb2;if(_0x1b9799>=_0x1ff0e9){_0x1b9799=_0x1ff0e9;_0x5bdfb2=0xc8;}else{_0x5bdfb2=0xce;}_0x4e450c['status'](_0x5bdfb2);return _0x4e450c[_0x550e('0x22')](_0x550e('0x23'),_0x3b4dca+'-'+_0x1b9799+'/'+_0x1ff0e9)['json'](_0x5ed213);}return null;};}function patchUpdates(_0x1ee208){return function(_0xcf3981){try{jsonpatch[_0x550e('0x24')](_0xcf3981,_0x1ee208,!![]);}catch(_0x317249){return BPromise[_0x550e('0x25')](_0x317249);}return _0xcf3981[_0x550e('0x26')]();};}function saveUpdates(_0x56f6a2,_0x707f72){return function(_0x205e3a){if(_0x205e3a){return _0x205e3a[_0x550e('0x27')](_0x56f6a2)[_0x550e('0x28')](function(_0x403391){return _0x403391;});}return null;};}function removeEntity(_0xc94de2,_0x35dfce){return function(_0x111161){if(_0x111161){return _0x111161[_0x550e('0x29')]()[_0x550e('0x28')](function(){_0xc94de2[_0x550e('0x1d')](0xcc)[_0x550e('0x2a')]();});}};}function handleEntityNotFound(_0x5e0434,_0x291976){return function(_0x11bec0){if(!_0x11bec0){_0x5e0434['sendStatus'](0x194);}return _0x11bec0;};}function handleError(_0x3a1d62,_0x78f04c){_0x78f04c=_0x78f04c||0x1f4;return function(_0x7ae242){logger[_0x550e('0x2b')](_0x7ae242[_0x550e('0x2c')]);if(_0x7ae242[_0x550e('0x2d')]){delete _0x7ae242[_0x550e('0x2d')];}_0x3a1d62[_0x550e('0x1d')](_0x78f04c)[_0x550e('0x2e')](_0x7ae242);};}function getInteractionUsers(_0x43f7b2,_0x25c40a){return new BPromise(function(_0xec21fd,_0x32fd38){try{if(_0x25c40a[_0x43f7b2['id']]){_0x43f7b2[_0x550e('0x2f')]=_['map'](_0x25c40a[_0x43f7b2['id']],function(_0x18f9b2){return{'id':_0x18f9b2['id'],'fullname':_0x18f9b2[_0x550e('0x30')]};});}}catch(_0x5002b0){_0x32fd38(_0x5002b0);}_0xec21fd(_0x43f7b2);});}function getInteractionTags(_0x1002a8,_0x2dea4b){return new BPromise(function(_0x48b50e,_0x3dd5b1){try{if(_0x1002a8[_0x550e('0x31')]){_0x1002a8[_0x550e('0x32')]=[];_0x1002a8[_0x550e('0x31')][_0x550e('0x33')](',')[_0x550e('0x34')](function(_0x6fd332){_0x1002a8[_0x550e('0x32')]['push'](_0x2dea4b[_0x6fd332]);});}delete _0x1002a8[_0x550e('0x31')];}catch(_0x5ef4b3){_0x3dd5b1(_0x5ef4b3);}_0x48b50e(_0x1002a8);});}function updateWhatsappInteraction(_0x281c6f,_0x1d94cd,_0x554e50){return new BPromise(function(_0x1aced1,_0x24ea07){return getInteractionUsers(_0x281c6f,_0x554e50)['then'](function(_0x4a88a8){return getInteractionTags(_0x4a88a8,_0x1d94cd);})['then'](function(_0x5da318){return getStateInteraction(_0x5da318);})[_0x550e('0x28')](function(_0x3b5365){_0x1aced1(_0x3b5365);})[_0x550e('0x35')](function(_0x57b1b8){_0x24ea07(_0x57b1b8);});});}function getStateInteraction(_0x4d6def){return new BPromise(function(_0x481d2c){_0x4d6def[_0x550e('0x36')]=0x0;_0x4d6def[_0x550e('0x37')]=0x0;_0x4d6def['answered']=0x0;_0x4d6def['unmanaged']=0x0;_0x4d6def['total']=0x0;if(!_0x4d6def[_0x550e('0x38')]&&!_0x4d6def[_0x550e('0x39')]){_0x4d6def[_0x550e('0x36')]+=0x1;}if(!_0x4d6def['closed']&&_0x4d6def['UserId']){_0x4d6def[_0x550e('0x37')]+=0x1;if(_0x4d6def[_0x550e('0x36')]){_0x4d6def[_0x550e('0x36')]-=0x1;}}if(_0x4d6def[_0x550e('0x38')]&&_0x4d6def['UserId']){_0x4d6def[_0x550e('0x3a')]+=0x1;if(_0x4d6def[_0x550e('0x37')]){_0x4d6def['talking']-=0x1;}}if(_0x4d6def['closed']&&!_0x4d6def[_0x550e('0x39')]){_0x4d6def[_0x550e('0x3b')]+=0x1;if(_0x4d6def[_0x550e('0x36')]){_0x4d6def[_0x550e('0x36')]-=0x1;}}_0x4d6def['total']+=0x1;_0x481d2c(_0x4d6def);});}exports[_0x550e('0x3c')]=function(_0x3244cf,_0x1dc236){var _0x1fb603={},_0x4d7297={},_0x3b2a45={'count':0x0,'rows':[]};var _0x24532e=_[_0x550e('0x3d')](db[_0x550e('0x3e')][_0x550e('0x3f')],function(_0x19357c){return{'name':_0x19357c['fieldName'],'type':_0x19357c[_0x550e('0x40')][_0x550e('0x41')]};});_0x4d7297[_0x550e('0x42')]=_[_0x550e('0x3d')](_0x24532e,_0x550e('0x2d'));_0x4d7297['query']=_[_0x550e('0x43')](_0x3244cf[_0x550e('0x44')]);_0x4d7297['filters']=_[_0x550e('0x45')](_0x4d7297[_0x550e('0x42')],_0x4d7297[_0x550e('0x44')]);_0x1fb603['attributes']=_['intersection'](_0x4d7297[_0x550e('0x42')],qs[_0x550e('0x46')](_0x3244cf['query'][_0x550e('0x46')]));_0x1fb603[_0x550e('0x47')]=_0x1fb603['attributes'][_0x550e('0x48')]?_0x1fb603[_0x550e('0x47')]:_0x4d7297[_0x550e('0x42')];if(!_0x3244cf[_0x550e('0x44')][_0x550e('0x49')](_0x550e('0x4a'))){_0x1fb603['limit']=qs[_0x550e('0x20')](_0x3244cf['query'][_0x550e('0x20')]);_0x1fb603[_0x550e('0x1e')]=qs['offset'](_0x3244cf[_0x550e('0x44')][_0x550e('0x1e')]);}_0x1fb603[_0x550e('0x4b')]=qs[_0x550e('0x4c')](_0x3244cf[_0x550e('0x44')][_0x550e('0x4c')]);_0x1fb603['where']=qs[_0x550e('0x4d')](_[_0x550e('0x4e')](_0x3244cf[_0x550e('0x44')],_0x4d7297[_0x550e('0x4d')]),_0x24532e);var _0x5a9ef5=[];var _0xbfd031=squel[_0x550e('0x4f')]()[_0x550e('0x50')]('id')[_0x550e('0x50')](_0x550e('0x2d'))[_0x550e('0x50')](_0x550e('0x51'))[_0x550e('0x52')](_0x550e('0x53'));var _0x2e619d=squel[_0x550e('0x4f')]()[_0x550e('0x50')](_0x550e('0x54'))[_0x550e('0x50')](_0x550e('0x55'))[_0x550e('0x50')](_0x550e('0x56'))['from'](_0x550e('0x57'),'ui')[_0x550e('0x58')](_0x550e('0x59'),'u',_0x550e('0x5a'));var _0x3c47b2=squel[_0x550e('0x4f')]()[_0x550e('0x52')]('whatsapp_interactions','i')[_0x550e('0x58')](_0x550e('0x5b'),'c',_0x550e('0x5c'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x550e('0x58')](_0x550e('0x5d'),'a',_0x550e('0x5e'))[_0x550e('0x58')](_0x550e('0x5f'),'me',_0x550e('0x60'))['left_join'](_0x550e('0x61'),'it',_0x550e('0x62'))[_0x550e('0x58')]('tools_tags','t',_0x550e('0x63'));var _0x4ba38b=squel[_0x550e('0x64')]();var _0x57549d=[];var _0x322569=squel[_0x550e('0x64')]();var _0x4db103;if(_0x3244cf[_0x550e('0x44')]['search']){_0x4db103=as[_0x550e('0x65')](_0x3244cf['query'][_0x550e('0x66')]);var _0x45b188=_0x4db103['sqlOperator'];for(var _0x130dfd=0x0;_0x130dfd<_0x4db103['conditions'][_0x550e('0x48')];_0x130dfd++){var _0x897986=_0x4db103[_0x550e('0x67')][_0x130dfd];var _0x417fe6='i';var _0x5c27da=_['find'](_0x24532e,[_0x550e('0x2d'),_0x897986['field']]);if(!_0x5c27da){switch(_0x897986['field']){case _0x550e('0x68'):if(_0x897986[_0x550e('0x69')]==0x1){_0x3c47b2[_0x550e('0x6a')]('`'+_0x897986[_0x550e('0x50')]+_0x550e('0x6b'));}else{_0x3c47b2[_0x550e('0x6a')]('`'+_0x897986['field']+_0x550e('0x6c'));}break;case _0x550e('0x6d'):if(_0x897986[_0x550e('0x6e')]===_0x550e('0x6f')){if(_0x897986[_0x550e('0x69')][_0x550e('0x33')]('\x20')[_0x550e('0x48')]>0x1){_0x4ba38b[_0x45b188](_0x550e('0x70'),qs[_0x550e('0x71')](_0x897986['value']),null);}else{var _0x2929c0='%'+_0x897986[_0x550e('0x69')]+'%';_0x4ba38b[_0x45b188](_0x550e('0x72'),_0x2929c0,_0x2929c0,_0x2929c0);}}else{_0x5c27da=_[_0x550e('0x73')](_0x24532e,[_0x550e('0x2d'),_0x550e('0x74')]);_0x897986[_0x550e('0x50')]=_0x550e('0x74');_0x46c396=as[_0x550e('0x75')](_0x417fe6,_0x5c27da[_0x550e('0x40')],_0x897986);_0x4ba38b[_0x45b188](_0x46c396['text'],_0x46c396[_0x550e('0x69')][_0x550e('0x76')],_0x46c396[_0x550e('0x69')][_0x550e('0x2a')]);}break;case _0x550e('0x77'):var _0x2d5de5=_0x897986[_0x550e('0x69')][_0x550e('0x33')](',')['map'](function(_0x59f8af){return Number(_0x59f8af);});_0x2d5de5[_0x550e('0x34')](function(_0x80d993){_0x322569['or'](_0x550e('0x78'),'%,'+_0x80d993+',%');});_0x57549d=_[_0x550e('0x79')](_0x57549d,_0x2d5de5);break;case _0x550e('0x7a'):if(_0x897986[_0x550e('0x6e')]==='$substring'){_0x4ba38b[_0x45b188](_0x550e('0x7b'),'%'+_0x897986[_0x550e('0x69')]+'%',null);}else{_0x5c27da=_['find'](_0x24532e,['name',_0x550e('0x39')]);_0x897986[_0x550e('0x50')]=_0x550e('0x39');_0x46c396=as[_0x550e('0x75')](_0x417fe6,_0x5c27da[_0x550e('0x40')],_0x897986);_0x4ba38b[_0x45b188](_0x46c396[_0x550e('0x7c')],_0x46c396[_0x550e('0x69')][_0x550e('0x76')],_0x46c396['value'][_0x550e('0x2a')]);}break;case _0x550e('0x7d'):_0x46c396=as['buildExpression']('me',null,_0x897986);_0x4ba38b[_0x45b188](_0x46c396[_0x550e('0x7c')],_0x46c396[_0x550e('0x69')][_0x550e('0x76')],_0x46c396[_0x550e('0x69')][_0x550e('0x2a')]);break;}}else{var _0x46c396=as[_0x550e('0x75')](_0x417fe6,_0x5c27da['type'],_0x897986);_0x4ba38b[_0x45b188](_0x46c396[_0x550e('0x7c')],_0x46c396[_0x550e('0x69')][_0x550e('0x76')],_0x46c396[_0x550e('0x69')][_0x550e('0x2a')]);}}}else{var _0x59bf83=_(_0x3244cf[_0x550e('0x44')])[_0x550e('0x43')]()['map'](function(_0x42eaa0){return _[_0x550e('0x7e')](_0x24532e,['name',_0x42eaa0])?_0x42eaa0:undefined;})[_0x550e('0x7f')]()[_0x550e('0x69')]();if(!_[_0x550e('0x80')](_0x59bf83)){_0x59bf83[_0x550e('0x34')](function(_0x571639){if(_0x571639===_0x550e('0x81')){_0x3c47b2['where'](_0x550e('0x82'),[][_0x550e('0x83')](_0x3244cf['query'][_0x571639]));}else if(_0x571639===_0x550e('0x84')){var _0x4a8dff=JSON[_0x550e('0x85')](_0x3244cf['query'][_0x571639])[_0x550e('0x86')];var _0x293db8=JSON[_0x550e('0x85')](_0x3244cf[_0x550e('0x44')][_0x571639])[_0x550e('0x87')];_0x3c47b2[_0x550e('0x88')](_0x550e('0x89'),_0x4a8dff,_0x293db8);}else{if(_0x3244cf[_0x550e('0x44')][_0x571639]===_0x550e('0x8a')){_0x3c47b2[_0x550e('0x88')]('i.'+_0x571639+_0x550e('0x8b'));}else{_0x3c47b2[_0x550e('0x88')]('i.'+_0x571639+_0x550e('0x8c'),_0x3244cf[_0x550e('0x44')][_0x571639]);}}});}if(_0x3244cf[_0x550e('0x44')][_0x550e('0x8d')]){if(_0x3244cf['query'][_0x550e('0x8d')]==0x1){_0x3c47b2[_0x550e('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x3c47b2[_0x550e('0x6a')]('`unreadMessages`\x20>\x200');}}if(_0x3244cf[_0x550e('0x44')][_0x550e('0x8e')]){_0x57549d=_[_0x550e('0x8f')](_0x3244cf[_0x550e('0x44')][_0x550e('0x8e')])?_0x3244cf[_0x550e('0x44')]['tag']:new Array(_0x3244cf[_0x550e('0x44')]['tag']);_0x57549d['forEach'](function(_0x2a6770){_0x322569['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a6770+',%');});}if(_0x3244cf[_0x550e('0x44')][_0x550e('0x90')]){var _0x4d214b=_0x3244cf['query'][_0x550e('0x90')][_0x550e('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4d214b)){_0x4ba38b['or']('i.id\x20LIKE\x20?',_0x4d214b+'%')['or'](_0x550e('0x92'),_0x4d214b+'%');}else{_0x4ba38b['or'](_0x550e('0x93'),qs['getFullTextValue'](_0x4d214b))['or'](_0x550e('0x94'),_0x4d214b+'%');}}}_0x3c47b2[_0x550e('0x88')](_0x4ba38b);_0x3c47b2[_0x550e('0x95')]('i.id');var _0x269adf={'type':db['Sequelize']['QueryTypes'][_0x550e('0x96')],'raw':!![]};var _0x530f90=_0x3c47b2[_0x550e('0x97')]();_0x530f90[_0x550e('0x50')]('i.id');_0x530f90[_0x550e('0x50')](_0x550e('0x98'),_0x550e('0x68'));if(_0x1fb603[_0x550e('0x4b')]){_0x1fb603[_0x550e('0x4b')]['forEach'](function(_0x592e67){var _0x1a7e4d=_0x592e67[0x0]===_0x550e('0x99')?_0x592e67[0x0]:'i.'+_0x592e67[0x0];_0x3c47b2[_0x550e('0x4b')](_0x1a7e4d,_0x592e67[0x1]===_0x550e('0x9a')?![]:!![]);});}if(!_['isEmpty'](_0x57549d)){_0x3c47b2['having'](_0x322569);_0x530f90[_0x550e('0x88')](_0x550e('0x9b'),_0x57549d);}BPromise[_0x550e('0x9c')]()[_0x550e('0x28')](function(){if(!_0x4db103){if(_0x3244cf[_0x550e('0x44')][_0x550e('0x81')])return;_0x530f90[_0x550e('0x88')](_0x550e('0x9d'));_0x3c47b2[_0x550e('0x88')](_0x550e('0x9d'));return;}if(_0x3244cf['user'][_0x550e('0x9e')]!==_0x550e('0x9f'))return;return _0x3244cf['user'][_0x550e('0xa0')]({'attributes':['id'],'raw':!![]})[_0x550e('0x28')](function(_0x1a1c57){if(_[_0x550e('0x80')](_0x1a1c57)){_0x530f90[_0x550e('0x88')]('i.WhatsappAccountId\x20IS\x20NULL');_0x3c47b2[_0x550e('0x88')](_0x550e('0xa1'));}else{_0x530f90[_0x550e('0x88')]('i.WhatsappAccountId\x20IN\x20?',_[_0x550e('0x3d')](_0x1a1c57,'id'));_0x3c47b2['where'](_0x550e('0x82'),_[_0x550e('0x3d')](_0x1a1c57,'id'));}});})[_0x550e('0x28')](function(){if(_0x3244cf[_0x550e('0xa2')]['role']===_0x550e('0x9f')&&!_0x4db103&&!_0x3244cf['query'][_0x550e('0x81')])return[];return db[_0x550e('0xa3')]['query'](_0x530f90[_0x550e('0xa4')](),_0x269adf);})['then'](function(_0x2c8e3c){_0x3b2a45['count']=_0x2c8e3c['length'];if(_0x3b2a45['count']===0x0)return[];return db[_0x550e('0xa3')][_0x550e('0x44')](_0xbfd031[_0x550e('0xa4')](),_0x269adf)[_0x550e('0x28')](function(_0x30c50a){_0x5a9ef5=_[_0x550e('0xa5')](_0x30c50a,'id');_0x269adf=_[_0x550e('0xa6')](_0x269adf,{'model':db[_0x550e('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3244cf[_0x550e('0x44')][_0x550e('0x46')]){_0x1fb603['attributes'][_0x550e('0x34')](function(_0xa1f3cc){_0x3c47b2[_0x550e('0x50')]('i.'+_0xa1f3cc);});}else{_0x3c47b2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x550e('0x68'));_0x3c47b2[_0x550e('0x50')](_0x550e('0xa7'),_0x550e('0xa8'));_0x3c47b2[_0x550e('0x50')](_0x550e('0xa9'),'Account.mandatoryDisposition');_0x3c47b2[_0x550e('0x50')]('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',_0x550e('0x99'));_0x3c47b2['field'](_0x550e('0xaa'));_0x3c47b2[_0x550e('0x50')](_0x550e('0xab'),_0x550e('0xac'));_0x3c47b2[_0x550e('0x50')](_0x550e('0xad'),_0x550e('0xae'));_0x3c47b2[_0x550e('0x50')](_0x550e('0xaf'),_0x550e('0xb0'));_0x3c47b2['field'](_0x550e('0xb1'),_0x550e('0xb2'));_0x3c47b2[_0x550e('0x50')](_0x550e('0xb3'),_0x550e('0xb4'));_0x3c47b2['field']('c.fax',_0x550e('0xb5'));_0x3c47b2[_0x550e('0x50')](_0x550e('0xb6'),'Owner.fullname');_0x3c47b2[_0x550e('0x50')](_0x550e('0xb7'),'Owner.internal');_0x3c47b2[_0x550e('0x50')](_0x550e('0xb8'),_0x550e('0x31'));}if(_0x1fb603[_0x550e('0x20')])_0x3c47b2[_0x550e('0x20')](_0x1fb603[_0x550e('0x20')]);if(_0x1fb603[_0x550e('0x1e')])_0x3c47b2[_0x550e('0x1e')](_0x1fb603[_0x550e('0x1e')]);return db[_0x550e('0xa3')][_0x550e('0x44')](_0x3c47b2[_0x550e('0xa4')](),_0x269adf);})[_0x550e('0x28')](function(_0x32d32f){if(_0x32d32f['length']>0x0)_0x2e619d[_0x550e('0x88')](_0x550e('0xb9'),_[_0x550e('0x3d')](_0x32d32f,'id'));return db[_0x550e('0xa3')][_0x550e('0x44')](_0x2e619d[_0x550e('0xa4')](),_0x269adf)[_0x550e('0x28')](function(_0x55bfc8){var _0x534084=_[_0x550e('0xba')](_0x55bfc8,_0x550e('0xbb'));var _0x527054=[];_0x32d32f[_0x550e('0x34')](function(_0x4e8bda){_0x527054[_0x550e('0xbc')](updateWhatsappInteraction(_0x4e8bda,_0x5a9ef5,_0x534084));});return BPromise[_0x550e('0xbd')](_0x527054);});});})['then'](function(_0x1c7eae){_0x3b2a45[_0x550e('0xbe')]=_0x1c7eae;return _0x3b2a45;})[_0x550e('0x28')](respondWithFilteredResult(_0x1dc236,_0x1fb603))[_0x550e('0x35')](handleError(_0x1dc236,null));};exports[_0x550e('0xbf')]=function(_0x59c499,_0x407be6){var _0x11edf2={'raw':![],'where':{'id':_0x59c499['params']['id']}},_0x29fb23={};_0x29fb23[_0x550e('0x42')]=_[_0x550e('0x43')](db[_0x550e('0x3e')][_0x550e('0x3f')]);_0x29fb23[_0x550e('0x44')]=_[_0x550e('0x43')](_0x59c499['query']);_0x29fb23[_0x550e('0x4d')]=_[_0x550e('0x45')](_0x29fb23[_0x550e('0x42')],_0x29fb23[_0x550e('0x44')]);_0x11edf2[_0x550e('0x47')]=_[_0x550e('0x45')](_0x29fb23['model'],qs['fields'](_0x59c499[_0x550e('0x44')]['fields']));_0x11edf2['attributes']=_0x11edf2[_0x550e('0x47')]['length']?_0x11edf2[_0x550e('0x47')]:_0x29fb23[_0x550e('0x42')];if(_0x59c499[_0x550e('0x44')]['includeAll']){_0x11edf2[_0x550e('0xc0')]=[{'all':!![]}];}_0x11edf2=_[_0x550e('0xa6')]({},_0x11edf2,_0x59c499[_0x550e('0xc1')]);return db[_0x550e('0x3e')][_0x550e('0x73')](_0x11edf2)['then'](handleEntityNotFound(_0x407be6,null))[_0x550e('0x28')](respondWithResult(_0x407be6,null))[_0x550e('0x35')](handleError(_0x407be6,null));};exports['create']=function(_0x388e07,_0x21df1e){return db[_0x550e('0x3e')][_0x550e('0xc2')](_0x388e07[_0x550e('0x7d')],{})[_0x550e('0x28')](respondWithResult(_0x21df1e,0xc9))[_0x550e('0x35')](handleError(_0x21df1e,null));};exports['update']=function(_0x60f094,_0x173ab1){if(_0x60f094[_0x550e('0x7d')]['id']){delete _0x60f094['body']['id'];}return db[_0x550e('0x3e')][_0x550e('0x73')]({'where':{'id':_0x60f094[_0x550e('0xc3')]['id']}})[_0x550e('0x28')](handleEntityNotFound(_0x173ab1,null))[_0x550e('0x28')](saveUpdates(_0x60f094[_0x550e('0x7d')],null))[_0x550e('0x28')](respondWithResult(_0x173ab1,null))['catch'](handleError(_0x173ab1,null));};exports['destroy']=function(_0x3166aa,_0x5c83a6){return db['WhatsappInteraction'][_0x550e('0x73')]({'where':{'id':_0x3166aa[_0x550e('0xc3')]['id']}})[_0x550e('0x28')](handleEntityNotFound(_0x5c83a6,null))['then'](removeEntity(_0x5c83a6,null))[_0x550e('0x35')](handleError(_0x5c83a6,null));};exports['describe']=function(_0x3d12b3,_0x25659e){return db[_0x550e('0x3e')][_0x550e('0xc4')]()['then'](respondWithResult(_0x25659e,null))[_0x550e('0x35')](handleError(_0x25659e,null));};exports[_0x550e('0xc5')]=function(_0x56a2,_0xe585d4,_0x23e3c4){return db[_0x550e('0xc6')]['find']({'where':{'id':_0x56a2[_0x550e('0xc3')]['id']}})[_0x550e('0x28')](handleEntityNotFound(_0xe585d4,null))[_0x550e('0x28')](function(_0x2c7ab8){if(_0x2c7ab8){return _0x2c7ab8[_0x550e('0xc5')](_0x56a2['body'][_0x550e('0xc7')],_[_0x550e('0xc8')](_0x56a2[_0x550e('0x7d')],[_0x550e('0xc7'),'id'])||{});}})[_0x550e('0x28')](respondWithResult(_0xe585d4,null))[_0x550e('0x35')](handleError(_0xe585d4,null));};exports[_0x550e('0xc9')]=function(_0x38c67a,_0xd78416,_0x250883){var _0x2af2be={'raw':![],'where':{}};var _0x454bd4={};var _0x18483b={'count':0x0,'rows':[]};return db[_0x550e('0x3e')][_0x550e('0xca')]({'where':{'id':_0x38c67a['params']['id']}})['then'](handleEntityNotFound(_0xd78416,null))[_0x550e('0x28')](function(_0x4d8d54){if(_0x4d8d54){_0x454bd4[_0x550e('0x42')]=_['keys'](db['WhatsappMessage'][_0x550e('0x3f')]);_0x454bd4[_0x550e('0x44')]=_[_0x550e('0x43')](_0x38c67a[_0x550e('0x44')]);_0x454bd4['filters']=_['intersection'](_0x454bd4[_0x550e('0x42')],_0x454bd4[_0x550e('0x44')]);_0x2af2be[_0x550e('0x47')]=_[_0x550e('0x45')](_0x454bd4['model'],qs[_0x550e('0x46')](_0x38c67a[_0x550e('0x44')][_0x550e('0x46')]));_0x2af2be[_0x550e('0x47')]=_0x2af2be[_0x550e('0x47')][_0x550e('0x48')]?_0x2af2be[_0x550e('0x47')]:_0x454bd4[_0x550e('0x42')];if(!_0x38c67a[_0x550e('0x44')]['hasOwnProperty'](_0x550e('0x4a'))){_0x2af2be[_0x550e('0x20')]=qs[_0x550e('0x20')](_0x38c67a[_0x550e('0x44')][_0x550e('0x20')]);_0x2af2be[_0x550e('0x1e')]=qs[_0x550e('0x1e')](_0x38c67a[_0x550e('0x44')][_0x550e('0x1e')]);}_0x2af2be[_0x550e('0x4b')]=qs[_0x550e('0x4c')](_0x38c67a[_0x550e('0x44')][_0x550e('0x4c')]);_0x2af2be[_0x550e('0x88')]=qs[_0x550e('0x4d')](_[_0x550e('0x4e')](_0x38c67a[_0x550e('0x44')],_0x454bd4[_0x550e('0x4d')]));_0x2af2be[_0x550e('0x88')][_0x550e('0xbb')]=_0x4d8d54['id'];if(_0x38c67a[_0x550e('0x44')][_0x550e('0x90')]){_0x2af2be[_0x550e('0x88')]=_['merge'](_0x2af2be['where'],{'$or':_[_0x550e('0x3d')](_0x2af2be['attributes'],function(_0x29d7f6){var _0xe659c9={};_0xe659c9[_0x29d7f6]={'$like':'%'+_0x38c67a[_0x550e('0x44')][_0x550e('0x90')]+'%'};return _0xe659c9;})});}if(_0x38c67a[_0x550e('0x44')][_0x550e('0x86')]){var _0x3481a8=_0x38c67a['query'][_0x550e('0x86')][_0x550e('0x33')](',');var _0x1df6df={};_0x1df6df[_0x3481a8[0x0]]={'$gte':moment(_0x3481a8[0x1])[_0x550e('0xcb')](_0x550e('0xcc'))};_0x2af2be[_0x550e('0x88')]=_[_0x550e('0xa6')](_0x2af2be[_0x550e('0x88')],_0x1df6df);}_0x2af2be=_[_0x550e('0xa6')]({},_0x2af2be,_0x38c67a[_0x550e('0xc1')]);return db[_0x550e('0xc6')][_0x550e('0x21')]({'where':_0x2af2be[_0x550e('0x88')]})['then'](function(_0x10b7ad){_0x18483b['count']=_0x10b7ad;if(_0x38c67a['query'][_0x550e('0xcd')]){_0x2af2be[_0x550e('0xc0')]=[{'all':!![]}];}return db[_0x550e('0xc6')][_0x550e('0xce')](_0x2af2be);})['then'](function(_0x45c814){_0x18483b[_0x550e('0xbe')]=_0x45c814;return _0x18483b;});}})[_0x550e('0x28')](respondWithFilteredResult(_0xd78416,_0x2af2be))[_0x550e('0x35')](handleError(_0xd78416,null));};exports['addTags']=function(_0x40c24a,_0x3daa58,_0x345a0f){return db[_0x550e('0x3e')][_0x550e('0x73')]({'where':{'id':_0x40c24a[_0x550e('0xc3')]['id']}})[_0x550e('0x28')](handleEntityNotFound(_0x3daa58,null))['then'](function(_0x3f1e21){if(_0x3f1e21){return _0x3f1e21[_0x550e('0xcf')](_0x40c24a['body'][_0x550e('0xc7')],_[_0x550e('0xc8')](_0x40c24a[_0x550e('0x7d')],['ids','id'])||{})[_0x550e('0xd0')](function(){return db['Tag']['findAll']({'attributes':['id',_0x550e('0x2d'),_0x550e('0x51')],'where':{'id':_0x40c24a[_0x550e('0x7d')][_0x550e('0xc7')]}});})[_0x550e('0x28')](function(_0x5c70f0){socket['emit'](_0x550e('0xd1'),{'id':Number(_0x40c24a[_0x550e('0xc3')]['id']),'tags':_0x5c70f0||[]});return{'id':Number(_0x40c24a[_0x550e('0xc3')]['id']),'tags':_0x5c70f0||[]};});}})['then'](respondWithResult(_0x3daa58,null))[_0x550e('0x35')](handleError(_0x3daa58,null));};exports['removeTags']=function(_0x5f2f44,_0x1c1974,_0x17047a){return db['WhatsappInteraction'][_0x550e('0x73')]({'where':{'id':_0x5f2f44['params']['id']}})[_0x550e('0x28')](handleEntityNotFound(_0x1c1974,null))[_0x550e('0x28')](function(_0x26a320){if(_0x26a320){return _0x26a320[_0x550e('0xd2')](_0x5f2f44['query'][_0x550e('0xc7')]);}})[_0x550e('0x28')](respondWithStatusCode(_0x1c1974,null))[_0x550e('0x35')](handleError(_0x1c1974,null));};exports[_0x550e('0xd3')]=function(_0x287581,_0x5cadd7){var _0x24b7a7=moment()['unix']()[_0x550e('0xa4')]();var _0x2effd6=path[_0x550e('0xd4')](config[_0x550e('0xd5')],_0x550e('0xd6'),_0x550e('0xd7'),_0x550e('0xd8'));var _0x5361de=path['join'](config[_0x550e('0xd5')],_0x550e('0xd6'),_0x550e('0xd7'),'attachments');var _0x1b53d8=path[_0x550e('0xd4')](_0x2effd6,_0x24b7a7);var _0x259371=util[_0x550e('0xcb')](_0x550e('0xd9'),_0x287581[_0x550e('0xc3')]['id'],_0x24b7a7);var _0x41d4c=path[_0x550e('0xd4')](_0x2effd6,_0x259371);var _0x2b8695=[];_0x2b8695[_0x550e('0xbc')]({'model':db['User'],'as':_0x550e('0x7a'),'attributes':['id',_0x550e('0x30')],'raw':!![]});_0x2b8695[_0x550e('0xbc')]({'model':db[_0x550e('0xda')],'as':'Contact','attributes':['id',_0x550e('0xdb'),'lastName'],'raw':!![]});if(_0x287581['query'][_0x550e('0xdc')]){_0x2b8695['push']({'model':db['Attachment'],'as':_0x550e('0xdd'),'raw':!![]});}var _0x3e5e2d=[{'model':db[_0x550e('0xc6')],'as':_0x550e('0xde'),'attributes':['id','body','createdAt',_0x550e('0xdf'),'secret',_0x550e('0x8d')],'include':_0x2b8695}];_0x3e5e2d[_0x550e('0xbc')]({'model':db['WhatsappAccount'],'as':_0x550e('0xe0'),'attributes':['id','name']});_0x3e5e2d[_0x550e('0xbc')]({'model':db[_0x550e('0x7a')],'as':_0x550e('0xe1'),'attributes':['id',_0x550e('0x30')]});return db[_0x550e('0x3e')][_0x550e('0x73')]({'where':{'id':_0x287581[_0x550e('0xc3')]['id']},'include':_0x3e5e2d})[_0x550e('0x28')](handleEntityNotFound(_0x5cadd7,null))[_0x550e('0x28')](function(_0x3df185){if(_0x3df185){var _0x2c3935=_0x3df185[_0x550e('0xe2')]({'plain':!![]});fs['mkdirSync'](_0x1b53d8);var _0x207fb1={'channel':_0x550e('0xe3'),'account':_0x2c3935[_0x550e('0xe0')][_0x550e('0x2d')],'agent':_0x2c3935[_0x550e('0xe1')]?_0x2c3935[_0x550e('0xe1')][_0x550e('0x30')]:_0x550e('0xe4'),'createdAt':moment(_0x2c3935[_0x550e('0x84')])[_0x550e('0xcb')](_0x550e('0xcc'))[_0x550e('0xa4')](),'closedAt':_0x2c3935[_0x550e('0x38')]?moment(_0x2c3935[_0x550e('0xe5')])[_0x550e('0xcb')](_0x550e('0xcc'))[_0x550e('0xa4')]():'','disposition':_0x2c3935[_0x550e('0xe6')],'messages':_(_0x2c3935[_0x550e('0xde')])[_0x550e('0x90')]({'secret':![]})['map'](function(_0x165273){if(_0x165273[_0x550e('0xdd')]){var _0x1895c2=path['join'](_0x5361de,_0x165273[_0x550e('0xdd')][_0x550e('0xe7')]);if(fs[_0x550e('0xe8')](_0x1895c2)){fs[_0x550e('0xe9')](_0x1895c2)[_0x550e('0xea')](fs[_0x550e('0xeb')](path[_0x550e('0xd4')](_0x1b53d8,_0x165273[_0x550e('0xdd')][_0x550e('0xe7')])));}}return{'date':moment(_0x165273[_0x550e('0x84')])['format'](_0x550e('0xcc'))[_0x550e('0xa4')](),'sender':_0x165273[_0x550e('0xdf')]==='out'?_0x165273[_0x550e('0x7a')]?_0x165273[_0x550e('0x7a')][_0x550e('0x30')]:'System':_0x165273['Contact']['firstName']+(_0x165273[_0x550e('0x6d')][_0x550e('0xec')]?'\x20'+_0x165273[_0x550e('0x6d')][_0x550e('0xec')]:''),'body':_0x165273[_0x550e('0xdd')]?_0x165273[_0x550e('0xdd')][_0x550e('0xe7')]:_0x165273[_0x550e('0x7d')],'direction':_0x165273[_0x550e('0xdf')]===_0x550e('0xed')?'A':'C','secret':_0x165273[_0x550e('0xee')],'read':_0x165273['read'],'attachment':_0x165273[_0x550e('0xdd')]};})[_0x550e('0x69')]()};return ejs[_0x550e('0xef')](path['join'](config[_0x550e('0xd5')],_0x550e('0xd6'),_0x550e('0xf0'),_0x550e('0xf1')),{'interaction':_0x207fb1})['then'](function(_0x4341a2){var _0xf8514a=path[_0x550e('0xd4')](_0x1b53d8,'transcript-'+_0x2c3935['id']+'-'+_0x24b7a7+_0x550e('0xf2'));var _0x45c530={'path':_0xf8514a,'channel':'Whatsapp','interactionId':_0x2c3935['id']};return pdf[_0x550e('0xf3')](_0x4341a2,_0x45c530);})[_0x550e('0x28')](function(){return new BPromise(function(_0x2c6c75,_0x1f46dc){zipdir(_0x1b53d8,{'saveTo':_0x41d4c},function(_0x239f20,_0x3018e1){if(_0x239f20)return _0x1f46dc(_0x239f20);return _0x2c6c75(_0x3018e1);});})['then'](function(){return new BPromise(function(_0xc9603,_0x2d7e04){rimraf(_0x1b53d8,function(_0x281c0d){if(_0x281c0d)_0x2d7e04(_0x281c0d);return _0xc9603();});});})[_0x550e('0x28')](function(){return _0x5cadd7[_0x550e('0xd3')](_0x41d4c,_0x259371,function(_0xcef830){if(_0xcef830){console[_0x550e('0xf4')]('err',_0xcef830);}else{fs[_0x550e('0xf5')](_0x41d4c);}});});});}else{return _0x5cadd7[_0x550e('0xf6')](0xc8);}})[_0x550e('0x35')](handleError(_0x5cadd7,null));}; \ No newline at end of file +var _0xf970=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','unmanaged','total','closed','UserId','WhatsappInteraction','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','User','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','parse','$gte','$lte','where','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','rows','show','includeAll','include','merge','options','create','body','params','describe','addMessage','ids','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','findAll','emit','removeTags','download','join','server','files','root','transcript-%d-%s.zip','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','Owner','get','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format'];(function(_0x2bc6c1,_0x4dd131){var _0x2f29a2=function(_0x3233fb){while(--_0x3233fb){_0x2bc6c1['push'](_0x2bc6c1['shift']());}};_0x2f29a2(++_0x4dd131);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x0f97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f97('0x1'));var jsonpatch=require(_0x0f97('0x2'));var rp=require(_0x0f97('0x3'));var moment=require(_0x0f97('0x4'));var BPromise=require(_0x0f97('0x5'));var Mustache=require(_0x0f97('0x6'));var util=require(_0x0f97('0x7'));var path=require('path');var sox=require(_0x0f97('0x8'));var csv=require(_0x0f97('0x9'));var ejs=require(_0x0f97('0xa'));var fs=require('fs');var fs_extra=require(_0x0f97('0xb'));var _=require(_0x0f97('0xc'));var squel=require(_0x0f97('0xd'));var crypto=require(_0x0f97('0xe'));var jsforce=require(_0x0f97('0xf'));var deskjs=require(_0x0f97('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0f97('0x11'));var Redis=require('ioredis');var authService=require(_0x0f97('0x12'));var qs=require(_0x0f97('0x13'));var as=require(_0x0f97('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x0f97('0x15'));var logger=require('../../config/logger')(_0x0f97('0x16'));var utils=require(_0x0f97('0x17'));var config=require(_0x0f97('0x18'));var licenseUtil=require(_0x0f97('0x19'));var db=require(_0x0f97('0x1a'))['db'];config['redis']=_[_0x0f97('0x1b')](config[_0x0f97('0x1c')],{'host':_0x0f97('0x1d'),'port':0x18eb});var socket=require(_0x0f97('0x1e'))(new Redis(config[_0x0f97('0x1c')]));require(_0x0f97('0x1f'))[_0x0f97('0x20')](socket);function respondWithStatusCode(_0x54f205,_0x4c34fc){_0x4c34fc=_0x4c34fc||0xcc;return function(_0x2a1fb8){if(_0x2a1fb8){return _0x54f205[_0x0f97('0x21')](_0x4c34fc);}return _0x54f205[_0x0f97('0x22')](_0x4c34fc)[_0x0f97('0x23')]();};}function respondWithResult(_0x5e3f3a,_0x58cb79){_0x58cb79=_0x58cb79||0xc8;return function(_0x336f61){if(_0x336f61){return _0x5e3f3a[_0x0f97('0x22')](_0x58cb79)[_0x0f97('0x24')](_0x336f61);}};}function respondWithFilteredResult(_0x185ba3,_0xae246){return function(_0x208f6b){if(_0x208f6b){var _0x5059ad=typeof _0xae246['offset']===_0x0f97('0x25')&&typeof _0xae246[_0x0f97('0x26')]===_0x0f97('0x25');var _0x425d97=_0x208f6b[_0x0f97('0x27')];var _0x3a91b4=_0x5059ad?0x0:_0xae246['offset'];var _0x27b771=_0x5059ad?_0x208f6b[_0x0f97('0x27')]:_0xae246[_0x0f97('0x28')]+_0xae246[_0x0f97('0x26')];var _0x13c7ed;if(_0x27b771>=_0x425d97){_0x27b771=_0x425d97;_0x13c7ed=0xc8;}else{_0x13c7ed=0xce;}_0x185ba3[_0x0f97('0x22')](_0x13c7ed);return _0x185ba3[_0x0f97('0x29')]('Content-Range',_0x3a91b4+'-'+_0x27b771+'/'+_0x425d97)[_0x0f97('0x24')](_0x208f6b);}return null;};}function patchUpdates(_0x2201d4){return function(_0xf2dab8){try{jsonpatch['apply'](_0xf2dab8,_0x2201d4,!![]);}catch(_0x31d384){return BPromise[_0x0f97('0x2a')](_0x31d384);}return _0xf2dab8['save']();};}function saveUpdates(_0xb5721e,_0x15df5c){return function(_0x4ef5bc){if(_0x4ef5bc){return _0x4ef5bc['update'](_0xb5721e)['then'](function(_0x406e24){return _0x406e24;});}return null;};}function removeEntity(_0x22eb53,_0x5247ad){return function(_0x8ef8c4){if(_0x8ef8c4){return _0x8ef8c4[_0x0f97('0x2b')]()[_0x0f97('0x2c')](function(){_0x22eb53[_0x0f97('0x22')](0xcc)[_0x0f97('0x23')]();});}};}function handleEntityNotFound(_0x23f078,_0x51a376){return function(_0x164ad6){if(!_0x164ad6){_0x23f078[_0x0f97('0x21')](0x194);}return _0x164ad6;};}function handleError(_0x3f4922,_0x37d7c9){_0x37d7c9=_0x37d7c9||0x1f4;return function(_0x4fe728){logger[_0x0f97('0x2d')](_0x4fe728[_0x0f97('0x2e')]);if(_0x4fe728[_0x0f97('0x2f')]){delete _0x4fe728[_0x0f97('0x2f')];}_0x3f4922[_0x0f97('0x22')](_0x37d7c9)[_0x0f97('0x30')](_0x4fe728);};}function getInteractionUsers(_0x2aeef8,_0x28ba36){return new BPromise(function(_0x51de2e,_0x481654){try{if(_0x28ba36[_0x2aeef8['id']]){_0x2aeef8[_0x0f97('0x31')]=_[_0x0f97('0x32')](_0x28ba36[_0x2aeef8['id']],function(_0x2fa2a7){return{'id':_0x2fa2a7['id'],'fullname':_0x2fa2a7[_0x0f97('0x33')]};});}}catch(_0x25bd0e){_0x481654(_0x25bd0e);}_0x51de2e(_0x2aeef8);});}function getInteractionTags(_0x405062,_0x17f244){return new BPromise(function(_0x46e0b4,_0x139c8a){try{if(_0x405062[_0x0f97('0x34')]){_0x405062[_0x0f97('0x35')]=[];_0x405062['TagIds'][_0x0f97('0x36')](',')[_0x0f97('0x37')](function(_0xe2526c){_0x405062[_0x0f97('0x35')][_0x0f97('0x38')](_0x17f244[_0xe2526c]);});}delete _0x405062['TagIds'];}catch(_0x1ba047){_0x139c8a(_0x1ba047);}_0x46e0b4(_0x405062);});}function updateWhatsappInteraction(_0x4e1471,_0x2f85f5,_0x5dc775){return new BPromise(function(_0x4037b2,_0xf86a26){return getInteractionUsers(_0x4e1471,_0x5dc775)[_0x0f97('0x2c')](function(_0x44ad1b){return getInteractionTags(_0x44ad1b,_0x2f85f5);})[_0x0f97('0x2c')](function(_0x5cfdf1){return getStateInteraction(_0x5cfdf1);})['then'](function(_0x133f74){_0x4037b2(_0x133f74);})[_0x0f97('0x39')](function(_0x595adf){_0xf86a26(_0x595adf);});});}function getStateInteraction(_0xfa6702){return new BPromise(function(_0x184e05){_0xfa6702[_0x0f97('0x3a')]=0x0;_0xfa6702[_0x0f97('0x3b')]=0x0;_0xfa6702['answered']=0x0;_0xfa6702[_0x0f97('0x3c')]=0x0;_0xfa6702[_0x0f97('0x3d')]=0x0;if(!_0xfa6702[_0x0f97('0x3e')]&&!_0xfa6702[_0x0f97('0x3f')]){_0xfa6702[_0x0f97('0x3a')]+=0x1;}if(!_0xfa6702['closed']&&_0xfa6702[_0x0f97('0x3f')]){_0xfa6702[_0x0f97('0x3b')]+=0x1;if(_0xfa6702[_0x0f97('0x3a')]){_0xfa6702[_0x0f97('0x3a')]-=0x1;}}if(_0xfa6702[_0x0f97('0x3e')]&&_0xfa6702[_0x0f97('0x3f')]){_0xfa6702['answered']+=0x1;if(_0xfa6702['talking']){_0xfa6702[_0x0f97('0x3b')]-=0x1;}}if(_0xfa6702[_0x0f97('0x3e')]&&!_0xfa6702[_0x0f97('0x3f')]){_0xfa6702['unmanaged']+=0x1;if(_0xfa6702[_0x0f97('0x3a')]){_0xfa6702[_0x0f97('0x3a')]-=0x1;}}_0xfa6702[_0x0f97('0x3d')]+=0x1;_0x184e05(_0xfa6702);});}exports['index']=function(_0x18aae7,_0x1de27e){var _0x1abb7e={},_0x679aea={},_0x3c84f7={'count':0x0,'rows':[]};var _0x1dc76d=_[_0x0f97('0x32')](db[_0x0f97('0x40')][_0x0f97('0x41')],function(_0x79aa92){return{'name':_0x79aa92[_0x0f97('0x42')],'type':_0x79aa92['type'][_0x0f97('0x43')]};});_0x679aea[_0x0f97('0x44')]=_['map'](_0x1dc76d,_0x0f97('0x2f'));_0x679aea['query']=_[_0x0f97('0x45')](_0x18aae7[_0x0f97('0x46')]);_0x679aea[_0x0f97('0x47')]=_['intersection'](_0x679aea['model'],_0x679aea[_0x0f97('0x46')]);_0x1abb7e[_0x0f97('0x48')]=_[_0x0f97('0x49')](_0x679aea[_0x0f97('0x44')],qs[_0x0f97('0x4a')](_0x18aae7['query']['fields']));_0x1abb7e[_0x0f97('0x48')]=_0x1abb7e[_0x0f97('0x48')][_0x0f97('0x4b')]?_0x1abb7e[_0x0f97('0x48')]:_0x679aea[_0x0f97('0x44')];if(!_0x18aae7[_0x0f97('0x46')][_0x0f97('0x4c')](_0x0f97('0x4d'))){_0x1abb7e[_0x0f97('0x26')]=qs['limit'](_0x18aae7[_0x0f97('0x46')]['limit']);_0x1abb7e[_0x0f97('0x28')]=qs[_0x0f97('0x28')](_0x18aae7[_0x0f97('0x46')]['offset']);}_0x1abb7e['order']=qs[_0x0f97('0x4e')](_0x18aae7[_0x0f97('0x46')][_0x0f97('0x4e')]);_0x1abb7e['where']=qs['filters'](_['pick'](_0x18aae7[_0x0f97('0x46')],_0x679aea[_0x0f97('0x47')]),_0x1dc76d);var _0x1871b6=[];var _0xf95e68=squel[_0x0f97('0x4f')]()[_0x0f97('0x50')]('id')[_0x0f97('0x50')](_0x0f97('0x2f'))[_0x0f97('0x50')](_0x0f97('0x51'))[_0x0f97('0x52')]('tools_tags');var _0xbc30c6=squel['select']()['field'](_0x0f97('0x53'))['field'](_0x0f97('0x54'))[_0x0f97('0x50')](_0x0f97('0x55'))[_0x0f97('0x52')](_0x0f97('0x56'),'ui')['left_join']('users','u',_0x0f97('0x57'));var _0xf5fedc=squel['select']()[_0x0f97('0x52')](_0x0f97('0x58'),'i')[_0x0f97('0x59')](_0x0f97('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0f97('0x59')](_0x0f97('0x5b'),'o',_0x0f97('0x5c'))[_0x0f97('0x59')](_0x0f97('0x5d'),'a',_0x0f97('0x5e'))[_0x0f97('0x59')](_0x0f97('0x5f'),'me',_0x0f97('0x60'))[_0x0f97('0x59')](_0x0f97('0x61'),'it',_0x0f97('0x62'))[_0x0f97('0x59')](_0x0f97('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1b757a=squel['expr']();var _0x2444e3=[];var _0x21ae61=squel[_0x0f97('0x64')]();var _0x5716c5;if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x65')]){_0x5716c5=as[_0x0f97('0x66')](_0x18aae7['query']['search']);var _0x5f0f31=_0x5716c5['sqlOperator'];for(var _0x375285=0x0;_0x375285<_0x5716c5[_0x0f97('0x67')][_0x0f97('0x4b')];_0x375285++){var _0x4c71b9=_0x5716c5[_0x0f97('0x67')][_0x375285];var _0x52a2ed='i';var _0x2285ba=_[_0x0f97('0x68')](_0x1dc76d,[_0x0f97('0x2f'),_0x4c71b9[_0x0f97('0x50')]]);if(!_0x2285ba){switch(_0x4c71b9[_0x0f97('0x50')]){case _0x0f97('0x69'):if(_0x4c71b9[_0x0f97('0x6a')]==0x1){_0xf5fedc[_0x0f97('0x6b')]('`'+_0x4c71b9[_0x0f97('0x50')]+'`\x20=\x200');}else{_0xf5fedc[_0x0f97('0x6b')]('`'+_0x4c71b9[_0x0f97('0x50')]+_0x0f97('0x6c'));}break;case _0x0f97('0x6d'):if(_0x4c71b9[_0x0f97('0x6e')]===_0x0f97('0x6f')){if(_0x4c71b9[_0x0f97('0x6a')][_0x0f97('0x36')]('\x20')['length']>0x1){_0x1b757a[_0x5f0f31](_0x0f97('0x70'),qs[_0x0f97('0x71')](_0x4c71b9['value']),null);}else{var _0x35d089='%'+_0x4c71b9[_0x0f97('0x6a')]+'%';_0x1b757a[_0x5f0f31](_0x0f97('0x72'),_0x35d089,_0x35d089,_0x35d089);}}else{_0x2285ba=_[_0x0f97('0x68')](_0x1dc76d,['name',_0x0f97('0x73')]);_0x4c71b9[_0x0f97('0x50')]=_0x0f97('0x73');_0x4b1bce=as[_0x0f97('0x74')](_0x52a2ed,_0x2285ba[_0x0f97('0x75')],_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x77')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x23')]);}break;case _0x0f97('0x78'):var _0xeddf70=_0x4c71b9[_0x0f97('0x6a')][_0x0f97('0x36')](',')['map'](function(_0x2e7c3a){return Number(_0x2e7c3a);});_0xeddf70[_0x0f97('0x37')](function(_0x359f6b){_0x21ae61['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x359f6b+',%');});_0x2444e3=_['union'](_0x2444e3,_0xeddf70);break;case _0x0f97('0x79'):if(_0x4c71b9['operator']===_0x0f97('0x6f')){_0x1b757a[_0x5f0f31]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c71b9[_0x0f97('0x6a')]+'%',null);}else{_0x2285ba=_['find'](_0x1dc76d,[_0x0f97('0x2f'),'UserId']);_0x4c71b9[_0x0f97('0x50')]=_0x0f97('0x3f');_0x4b1bce=as[_0x0f97('0x74')](_0x52a2ed,_0x2285ba[_0x0f97('0x75')],_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')]['start'],_0x4b1bce['value'][_0x0f97('0x23')]);}break;case'body':_0x4b1bce=as[_0x0f97('0x74')]('me',null,_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')]['start'],_0x4b1bce['value'][_0x0f97('0x23')]);break;}}else{var _0x4b1bce=as['buildExpression'](_0x52a2ed,_0x2285ba[_0x0f97('0x75')],_0x4c71b9);_0x1b757a[_0x5f0f31](_0x4b1bce[_0x0f97('0x76')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x77')],_0x4b1bce[_0x0f97('0x6a')][_0x0f97('0x23')]);}}}else{var _0x294ac8=_(_0x18aae7[_0x0f97('0x46')])[_0x0f97('0x45')]()['map'](function(_0x568116){return _['some'](_0x1dc76d,[_0x0f97('0x2f'),_0x568116])?_0x568116:undefined;})['compact']()[_0x0f97('0x6a')]();if(!_[_0x0f97('0x7a')](_0x294ac8)){_0x294ac8[_0x0f97('0x37')](function(_0x361504){if(_0x361504===_0x0f97('0x7b')){_0xf5fedc['where'](_0x0f97('0x7c'),[]['concat'](_0x18aae7[_0x0f97('0x46')][_0x361504]));}else if(_0x361504==='createdAt'){var _0x568821=JSON[_0x0f97('0x7d')](_0x18aae7[_0x0f97('0x46')][_0x361504])[_0x0f97('0x7e')];var _0x599011=JSON[_0x0f97('0x7d')](_0x18aae7[_0x0f97('0x46')][_0x361504])[_0x0f97('0x7f')];_0xf5fedc[_0x0f97('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x568821,_0x599011);}else{if(_0x18aae7[_0x0f97('0x46')][_0x361504]==='null'){_0xf5fedc[_0x0f97('0x80')]('i.'+_0x361504+_0x0f97('0x81'));}else{_0xf5fedc['where']('i.'+_0x361504+'\x20=\x20?',_0x18aae7[_0x0f97('0x46')][_0x361504]);}}});}if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x82')]){if(_0x18aae7[_0x0f97('0x46')]['read']==0x1){_0xf5fedc['having'](_0x0f97('0x83'));}else{_0xf5fedc[_0x0f97('0x6b')](_0x0f97('0x84'));}}if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x85')]){_0x2444e3=_[_0x0f97('0x86')](_0x18aae7['query'][_0x0f97('0x85')])?_0x18aae7[_0x0f97('0x46')][_0x0f97('0x85')]:new Array(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x85')]);_0x2444e3[_0x0f97('0x37')](function(_0x57b810){_0x21ae61['or'](_0x0f97('0x87'),'%,'+_0x57b810+',%');});}if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x88')]){var _0x393fe7=_0x18aae7[_0x0f97('0x46')][_0x0f97('0x88')][_0x0f97('0x89')]('\x5c','\x5c\x5c')[_0x0f97('0x89')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x393fe7)){_0x1b757a['or'](_0x0f97('0x8a'),_0x393fe7+'%')['or'](_0x0f97('0x8b'),_0x393fe7+'%');}else{_0x1b757a['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x393fe7))['or'](_0x0f97('0x8c'),_0x393fe7+'%');}}}_0xf5fedc['where'](_0x1b757a);_0xf5fedc[_0x0f97('0x8d')](_0x0f97('0x8e'));var _0xe654d5={'type':db['Sequelize'][_0x0f97('0x8f')][_0x0f97('0x90')],'raw':!![]};var _0x16071d=_0xf5fedc[_0x0f97('0x91')]();_0x16071d[_0x0f97('0x50')](_0x0f97('0x8e'));_0x16071d[_0x0f97('0x50')](_0x0f97('0x92'),_0x0f97('0x69'));if(_0x1abb7e['order']){_0x1abb7e[_0x0f97('0x93')][_0x0f97('0x37')](function(_0x2042df){var _0x46d7c0=_0x2042df[0x0]===_0x0f97('0x94')?_0x2042df[0x0]:'i.'+_0x2042df[0x0];_0xf5fedc['order'](_0x46d7c0,_0x2042df[0x1]===_0x0f97('0x95')?![]:!![]);});}if(!_[_0x0f97('0x7a')](_0x2444e3)){_0xf5fedc['having'](_0x21ae61);_0x16071d[_0x0f97('0x80')]('t.id\x20IN\x20?',_0x2444e3);}BPromise[_0x0f97('0x96')]()['then'](function(){if(!_0x5716c5){if(_0x18aae7[_0x0f97('0x46')][_0x0f97('0x7b')])return;_0x16071d['where'](_0x0f97('0x97'));_0xf5fedc['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x18aae7['user'][_0x0f97('0x98')]!==_0x0f97('0x99'))return;return _0x18aae7[_0x0f97('0x9a')][_0x0f97('0x9b')]({'attributes':['id'],'raw':!![]})[_0x0f97('0x2c')](function(_0x40897e){if(_[_0x0f97('0x7a')](_0x40897e)){_0x16071d[_0x0f97('0x80')](_0x0f97('0x9c'));_0xf5fedc[_0x0f97('0x80')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x16071d[_0x0f97('0x80')](_0x0f97('0x7c'),_[_0x0f97('0x32')](_0x40897e,'id'));_0xf5fedc['where'](_0x0f97('0x7c'),_[_0x0f97('0x32')](_0x40897e,'id'));}});})['then'](function(){if(_0x18aae7[_0x0f97('0x9a')][_0x0f97('0x98')]===_0x0f97('0x99')&&!_0x5716c5&&!_0x18aae7[_0x0f97('0x46')][_0x0f97('0x7b')])return[];return db[_0x0f97('0x9d')][_0x0f97('0x46')](_0x16071d[_0x0f97('0x9e')](),_0xe654d5);})[_0x0f97('0x2c')](function(_0x445892){_0x3c84f7[_0x0f97('0x27')]=_0x445892[_0x0f97('0x4b')];if(_0x3c84f7[_0x0f97('0x27')]===0x0)return[];return db[_0x0f97('0x9d')][_0x0f97('0x46')](_0xf95e68[_0x0f97('0x9e')](),_0xe654d5)[_0x0f97('0x2c')](function(_0x18dded){_0x1871b6=_['keyBy'](_0x18dded,'id');_0xe654d5=_['merge'](_0xe654d5,{'model':db[_0x0f97('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18aae7['query'][_0x0f97('0x4a')]){_0x1abb7e[_0x0f97('0x48')][_0x0f97('0x37')](function(_0xc2f752){_0xf5fedc[_0x0f97('0x50')]('i.'+_0xc2f752);});}else{_0xf5fedc['field'](_0x0f97('0x92'),_0x0f97('0x69'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0x9f'),'Account.key');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa0'),'Account.mandatoryDisposition');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa1'),'contactName');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa2'));_0xf5fedc['field'](_0x0f97('0xa3'),'Contact.firstName');_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa4'),'Contact.lastName');_0xf5fedc[_0x0f97('0x50')]('c.email',_0x0f97('0xa5'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa6'),_0x0f97('0xa7'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xa8'),_0x0f97('0xa9'));_0xf5fedc[_0x0f97('0x50')]('c.fax',_0x0f97('0xaa'));_0xf5fedc[_0x0f97('0x50')]('o.fullname',_0x0f97('0xab'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xac'),_0x0f97('0xad'));_0xf5fedc[_0x0f97('0x50')](_0x0f97('0xae'),_0x0f97('0x34'));}if(_0x1abb7e[_0x0f97('0x26')])_0xf5fedc['limit'](_0x1abb7e[_0x0f97('0x26')]);if(_0x1abb7e[_0x0f97('0x28')])_0xf5fedc[_0x0f97('0x28')](_0x1abb7e[_0x0f97('0x28')]);return db['sequelize']['query'](_0xf5fedc[_0x0f97('0x9e')](),_0xe654d5);})[_0x0f97('0x2c')](function(_0x34d326){if(_0x34d326[_0x0f97('0x4b')]>0x0)_0xbc30c6[_0x0f97('0x80')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x0f97('0x32')](_0x34d326,'id'));return db[_0x0f97('0x9d')][_0x0f97('0x46')](_0xbc30c6['toString'](),_0xe654d5)[_0x0f97('0x2c')](function(_0x1c3338){var _0x20f089=_[_0x0f97('0xaf')](_0x1c3338,_0x0f97('0xb0'));var _0x21fcf2=[];_0x34d326[_0x0f97('0x37')](function(_0xfd416d){_0x21fcf2[_0x0f97('0x38')](updateWhatsappInteraction(_0xfd416d,_0x1871b6,_0x20f089));});return BPromise['all'](_0x21fcf2);});});})[_0x0f97('0x2c')](function(_0x542d4e){_0x3c84f7[_0x0f97('0xb1')]=_0x542d4e;return _0x3c84f7;})['then'](respondWithFilteredResult(_0x1de27e,_0x1abb7e))['catch'](handleError(_0x1de27e,null));};exports[_0x0f97('0xb2')]=function(_0x2895f5,_0x452693){var _0x200d9b={'raw':![],'where':{'id':_0x2895f5['params']['id']}},_0x16f78c={};_0x16f78c[_0x0f97('0x44')]=_['keys'](db[_0x0f97('0x40')][_0x0f97('0x41')]);_0x16f78c[_0x0f97('0x46')]=_['keys'](_0x2895f5[_0x0f97('0x46')]);_0x16f78c[_0x0f97('0x47')]=_[_0x0f97('0x49')](_0x16f78c[_0x0f97('0x44')],_0x16f78c[_0x0f97('0x46')]);_0x200d9b[_0x0f97('0x48')]=_[_0x0f97('0x49')](_0x16f78c['model'],qs[_0x0f97('0x4a')](_0x2895f5[_0x0f97('0x46')]['fields']));_0x200d9b[_0x0f97('0x48')]=_0x200d9b[_0x0f97('0x48')][_0x0f97('0x4b')]?_0x200d9b[_0x0f97('0x48')]:_0x16f78c[_0x0f97('0x44')];if(_0x2895f5['query'][_0x0f97('0xb3')]){_0x200d9b[_0x0f97('0xb4')]=[{'all':!![]}];}_0x200d9b=_[_0x0f97('0xb5')]({},_0x200d9b,_0x2895f5[_0x0f97('0xb6')]);return db['WhatsappInteraction'][_0x0f97('0x68')](_0x200d9b)['then'](handleEntityNotFound(_0x452693,null))[_0x0f97('0x2c')](respondWithResult(_0x452693,null))[_0x0f97('0x39')](handleError(_0x452693,null));};exports['create']=function(_0x523784,_0xa622da){return db[_0x0f97('0x40')][_0x0f97('0xb7')](_0x523784['body'],{})[_0x0f97('0x2c')](respondWithResult(_0xa622da,0xc9))['catch'](handleError(_0xa622da,null));};exports['update']=function(_0x561cc7,_0x529bc3){if(_0x561cc7[_0x0f97('0xb8')]['id']){delete _0x561cc7['body']['id'];}return db[_0x0f97('0x40')][_0x0f97('0x68')]({'where':{'id':_0x561cc7[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x529bc3,null))['then'](saveUpdates(_0x561cc7[_0x0f97('0xb8')],null))[_0x0f97('0x2c')](respondWithResult(_0x529bc3,null))[_0x0f97('0x39')](handleError(_0x529bc3,null));};exports[_0x0f97('0x2b')]=function(_0x47b00d,_0x1ab583){return db['WhatsappInteraction'][_0x0f97('0x68')]({'where':{'id':_0x47b00d[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x1ab583,null))[_0x0f97('0x2c')](removeEntity(_0x1ab583,null))[_0x0f97('0x39')](handleError(_0x1ab583,null));};exports[_0x0f97('0xba')]=function(_0x55f0f2,_0x38c2d7){return db[_0x0f97('0x40')][_0x0f97('0xba')]()[_0x0f97('0x2c')](respondWithResult(_0x38c2d7,null))[_0x0f97('0x39')](handleError(_0x38c2d7,null));};exports[_0x0f97('0xbb')]=function(_0xc556c4,_0x5eeb8c,_0x367ac7){return db['WhatsappMessage']['find']({'where':{'id':_0xc556c4[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x5eeb8c,null))[_0x0f97('0x2c')](function(_0x2a35a7){if(_0x2a35a7){return _0x2a35a7[_0x0f97('0xbb')](_0xc556c4['body'][_0x0f97('0xbc')],_['omit'](_0xc556c4[_0x0f97('0xb8')],[_0x0f97('0xbc'),'id'])||{});}})[_0x0f97('0x2c')](respondWithResult(_0x5eeb8c,null))[_0x0f97('0x39')](handleError(_0x5eeb8c,null));};exports['getMessages']=function(_0x1027a6,_0x48b794,_0x5024c4){var _0x3ce24d={'raw':![],'where':{}};var _0x5e4cf2={};var _0x5c935e={'count':0x0,'rows':[]};return db[_0x0f97('0x40')][_0x0f97('0xbd')]({'where':{'id':_0x1027a6[_0x0f97('0xb9')]['id']}})[_0x0f97('0x2c')](handleEntityNotFound(_0x48b794,null))[_0x0f97('0x2c')](function(_0xb40340){if(_0xb40340){_0x5e4cf2[_0x0f97('0x44')]=_[_0x0f97('0x45')](db[_0x0f97('0xbe')][_0x0f97('0x41')]);_0x5e4cf2[_0x0f97('0x46')]=_['keys'](_0x1027a6['query']);_0x5e4cf2[_0x0f97('0x47')]=_['intersection'](_0x5e4cf2[_0x0f97('0x44')],_0x5e4cf2[_0x0f97('0x46')]);_0x3ce24d[_0x0f97('0x48')]=_['intersection'](_0x5e4cf2[_0x0f97('0x44')],qs[_0x0f97('0x4a')](_0x1027a6[_0x0f97('0x46')][_0x0f97('0x4a')]));_0x3ce24d[_0x0f97('0x48')]=_0x3ce24d['attributes'][_0x0f97('0x4b')]?_0x3ce24d['attributes']:_0x5e4cf2[_0x0f97('0x44')];if(!_0x1027a6[_0x0f97('0x46')]['hasOwnProperty']('nolimit')){_0x3ce24d['limit']=qs[_0x0f97('0x26')](_0x1027a6[_0x0f97('0x46')][_0x0f97('0x26')]);_0x3ce24d[_0x0f97('0x28')]=qs[_0x0f97('0x28')](_0x1027a6['query'][_0x0f97('0x28')]);}_0x3ce24d[_0x0f97('0x93')]=qs[_0x0f97('0x4e')](_0x1027a6[_0x0f97('0x46')][_0x0f97('0x4e')]);_0x3ce24d[_0x0f97('0x80')]=qs[_0x0f97('0x47')](_['pick'](_0x1027a6[_0x0f97('0x46')],_0x5e4cf2[_0x0f97('0x47')]));_0x3ce24d[_0x0f97('0x80')][_0x0f97('0xb0')]=_0xb40340['id'];if(_0x1027a6[_0x0f97('0x46')]['filter']){_0x3ce24d[_0x0f97('0x80')]=_[_0x0f97('0xb5')](_0x3ce24d[_0x0f97('0x80')],{'$or':_[_0x0f97('0x32')](_0x3ce24d['attributes'],function(_0x2422ad){var _0x11d733={};_0x11d733[_0x2422ad]={'$like':'%'+_0x1027a6[_0x0f97('0x46')]['filter']+'%'};return _0x11d733;})});}if(_0x1027a6['query'][_0x0f97('0x7e')]){var _0x3e1126=_0x1027a6['query']['$gte']['split'](',');var _0x4f8ffb={};_0x4f8ffb[_0x3e1126[0x0]]={'$gte':moment(_0x3e1126[0x1])[_0x0f97('0xbf')](_0x0f97('0xc0'))};_0x3ce24d[_0x0f97('0x80')]=_['merge'](_0x3ce24d[_0x0f97('0x80')],_0x4f8ffb);}_0x3ce24d=_['merge']({},_0x3ce24d,_0x1027a6['options']);return db['WhatsappMessage']['count']({'where':_0x3ce24d[_0x0f97('0x80')]})['then'](function(_0xc66311){_0x5c935e[_0x0f97('0x27')]=_0xc66311;if(_0x1027a6[_0x0f97('0x46')]['includeAll']){_0x3ce24d[_0x0f97('0xb4')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x3ce24d);})[_0x0f97('0x2c')](function(_0x22c0a5){_0x5c935e[_0x0f97('0xb1')]=_0x22c0a5;return _0x5c935e;});}})[_0x0f97('0x2c')](respondWithFilteredResult(_0x48b794,_0x3ce24d))[_0x0f97('0x39')](handleError(_0x48b794,null));};exports[_0x0f97('0xc1')]=function(_0x429875,_0x4c6a81,_0x2b61c3){return db[_0x0f97('0x40')][_0x0f97('0x68')]({'where':{'id':_0x429875['params']['id']}})['then'](handleEntityNotFound(_0x4c6a81,null))[_0x0f97('0x2c')](function(_0x2d5239){if(_0x2d5239){return _0x2d5239[_0x0f97('0xc2')](_0x429875[_0x0f97('0xb8')][_0x0f97('0xbc')],_[_0x0f97('0xc3')](_0x429875[_0x0f97('0xb8')],['ids','id'])||{})[_0x0f97('0xc4')](function(){return db[_0x0f97('0x78')][_0x0f97('0xc5')]({'attributes':['id','name','color'],'where':{'id':_0x429875[_0x0f97('0xb8')][_0x0f97('0xbc')]}});})[_0x0f97('0x2c')](function(_0x4fda78){socket[_0x0f97('0xc6')]('whatsappInteractionTags:save',{'id':Number(_0x429875[_0x0f97('0xb9')]['id']),'tags':_0x4fda78||[]});return{'id':Number(_0x429875[_0x0f97('0xb9')]['id']),'tags':_0x4fda78||[]};});}})[_0x0f97('0x2c')](respondWithResult(_0x4c6a81,null))[_0x0f97('0x39')](handleError(_0x4c6a81,null));};exports[_0x0f97('0xc7')]=function(_0x2e1395,_0x2d36c9,_0x23dc23){return db['WhatsappInteraction']['find']({'where':{'id':_0x2e1395[_0x0f97('0xb9')]['id']}})['then'](handleEntityNotFound(_0x2d36c9,null))[_0x0f97('0x2c')](function(_0x26c00f){if(_0x26c00f){return _0x26c00f[_0x0f97('0xc7')](_0x2e1395[_0x0f97('0x46')][_0x0f97('0xbc')]);}})[_0x0f97('0x2c')](respondWithStatusCode(_0x2d36c9,null))[_0x0f97('0x39')](handleError(_0x2d36c9,null));};exports[_0x0f97('0xc8')]=function(_0x5c0d1e,_0x510150){var _0x56d728=moment()['unix']()[_0x0f97('0x9e')]();var _0x19fa62=path[_0x0f97('0xc9')](config['root'],_0x0f97('0xca'),_0x0f97('0xcb'),'tmp');var _0x383231=path[_0x0f97('0xc9')](config[_0x0f97('0xcc')],_0x0f97('0xca'),'files','attachments');var _0x2d0665=path[_0x0f97('0xc9')](_0x19fa62,_0x56d728);var _0x542721=util['format'](_0x0f97('0xcd'),_0x5c0d1e[_0x0f97('0xb9')]['id'],_0x56d728);var _0x106b18=path[_0x0f97('0xc9')](_0x19fa62,_0x542721);var _0x2c1b31=[];_0x2c1b31[_0x0f97('0x38')]({'model':db[_0x0f97('0x79')],'as':_0x0f97('0x79'),'attributes':['id',_0x0f97('0x33')],'raw':!![]});_0x2c1b31[_0x0f97('0x38')]({'model':db['CmContact'],'as':_0x0f97('0x6d'),'attributes':['id',_0x0f97('0xce'),_0x0f97('0xcf')],'raw':!![]});if(_0x5c0d1e[_0x0f97('0x46')][_0x0f97('0xd0')]){_0x2c1b31[_0x0f97('0x38')]({'model':db[_0x0f97('0xd1')],'as':_0x0f97('0xd1'),'raw':!![]});}var _0x3b8d1c=[{'model':db[_0x0f97('0xbe')],'as':_0x0f97('0xd2'),'attributes':['id',_0x0f97('0xb8'),_0x0f97('0xd3'),_0x0f97('0xd4'),_0x0f97('0xd5'),_0x0f97('0x82')],'include':_0x2c1b31}];_0x3b8d1c[_0x0f97('0x38')]({'model':db[_0x0f97('0xd6')],'as':_0x0f97('0xd7'),'attributes':['id','name']});_0x3b8d1c[_0x0f97('0x38')]({'model':db['User'],'as':_0x0f97('0xd8'),'attributes':['id',_0x0f97('0x33')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x5c0d1e['params']['id']},'include':_0x3b8d1c})[_0x0f97('0x2c')](handleEntityNotFound(_0x510150,null))['then'](function(_0x4b34dd){if(_0x4b34dd){var _0x4e8147=_0x4b34dd[_0x0f97('0xd9')]({'plain':!![]});fs['mkdirSync'](_0x2d0665);var _0x4af6fe={'channel':'Whatsapp','account':_0x4e8147['Account'][_0x0f97('0x2f')],'agent':_0x4e8147[_0x0f97('0xd8')]?_0x4e8147['Owner'][_0x0f97('0x33')]:_0x0f97('0xda'),'createdAt':moment(_0x4e8147[_0x0f97('0xd3')])[_0x0f97('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0f97('0x9e')](),'closedAt':_0x4e8147[_0x0f97('0x3e')]?moment(_0x4e8147[_0x0f97('0xdb')])[_0x0f97('0xbf')](_0x0f97('0xc0'))[_0x0f97('0x9e')]():'','disposition':_0x4e8147[_0x0f97('0xdc')],'messages':_(_0x4e8147['Messages'])[_0x0f97('0x88')]({'secret':![]})[_0x0f97('0x32')](function(_0xd09dd4){if(_0xd09dd4['Attachment']){var _0x43bd55=path[_0x0f97('0xc9')](_0x383231,_0xd09dd4[_0x0f97('0xd1')][_0x0f97('0xdd')]);if(fs[_0x0f97('0xde')](_0x43bd55)){fs[_0x0f97('0xdf')](_0x43bd55)[_0x0f97('0xe0')](fs[_0x0f97('0xe1')](path[_0x0f97('0xc9')](_0x2d0665,_0xd09dd4['Attachment']['basename'])));}}return{'date':moment(_0xd09dd4[_0x0f97('0xd3')])[_0x0f97('0xbf')](_0x0f97('0xc0'))[_0x0f97('0x9e')](),'sender':_0xd09dd4[_0x0f97('0xd4')]===_0x0f97('0xe2')?_0xd09dd4[_0x0f97('0x79')]?_0xd09dd4['User']['fullname']:_0x0f97('0xe3'):_0xd09dd4[_0x0f97('0x6d')][_0x0f97('0xce')]+(_0xd09dd4[_0x0f97('0x6d')]['lastName']?'\x20'+_0xd09dd4[_0x0f97('0x6d')][_0x0f97('0xcf')]:''),'body':_0xd09dd4['Attachment']?_0xd09dd4[_0x0f97('0xd1')][_0x0f97('0xdd')]:_0xd09dd4[_0x0f97('0xb8')],'direction':_0xd09dd4['direction']==='out'?'A':'C','secret':_0xd09dd4[_0x0f97('0xd5')],'read':_0xd09dd4[_0x0f97('0x82')],'attachment':_0xd09dd4[_0x0f97('0xd1')]};})[_0x0f97('0x6a')]()};return ejs[_0x0f97('0xe4')](path['join'](config[_0x0f97('0xcc')],_0x0f97('0xca'),_0x0f97('0xe5'),_0x0f97('0xe6')),{'interaction':_0x4af6fe})['then'](function(_0x26abbc){var _0x31fb17=path['join'](_0x2d0665,_0x0f97('0xe7')+_0x4e8147['id']+'-'+_0x56d728+_0x0f97('0xe8'));var _0x3906a6={'path':_0x31fb17,'channel':'Whatsapp','interactionId':_0x4e8147['id']};return pdf[_0x0f97('0xe9')](_0x26abbc,_0x3906a6);})[_0x0f97('0x2c')](function(){return new BPromise(function(_0x50f874,_0x360f79){zipdir(_0x2d0665,{'saveTo':_0x106b18},function(_0x51bf38,_0x2bbf20){if(_0x51bf38)return _0x360f79(_0x51bf38);return _0x50f874(_0x2bbf20);});})[_0x0f97('0x2c')](function(){return new BPromise(function(_0x1ed2ca,_0x7bd3ca){rimraf(_0x2d0665,function(_0x4b0d00){if(_0x4b0d00)_0x7bd3ca(_0x4b0d00);return _0x1ed2ca();});});})[_0x0f97('0x2c')](function(){return _0x510150[_0x0f97('0xc8')](_0x106b18,_0x542721,function(_0x5d9c64){if(_0x5d9c64){console[_0x0f97('0xea')](_0x0f97('0xeb'),_0x5d9c64);}else{fs[_0x0f97('0xec')](_0x106b18);}});});});}else{return _0x510150[_0x0f97('0x21')](0xc8);}})[_0x0f97('0x39')](handleError(_0x510150,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 18094ed..e3a6dbb 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 _0xbb95=['exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','then','setDataValue','map','findAll','unreadMessages','length','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb95,0x7f));var _0x5bb9=function(_0x444d57,_0x2ced49){_0x444d57=_0x444d57-0x0;var _0x40353a=_0xbb95[_0x444d57];return _0x40353a;};'use strict';var EventEmitter=require(_0x5bb9('0x0'));var WhatsappInteraction=require(_0x5bb9('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x5bb9('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5bb9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5bb9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ef42d){return function(_0x4bf81a,_0x346d48,_0x2b72aa){_0x4bf81a['getUsers']({'attributes':['id'],'raw':!![]})[_0x5bb9('0x5')](function(_0x123a6a){_0x4bf81a[_0x5bb9('0x6')]('Users',_0x123a6a[_0x5bb9('0x7')](function(_0x2edf23){return{'id':_0x2edf23['id']};}));return WhatsappMessage[_0x5bb9('0x8')]({'where':{'WhatsappInteractionId':_0x4bf81a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5bb9('0x5')](function(_0x2a3d2){_0x4bf81a[_0x5bb9('0x6')](_0x5bb9('0x9'),_0x2a3d2[_0x5bb9('0xa')]);WhatsappInteractionEvents[_0x5bb9('0xb')](_0x4ef42d+':'+_0x4bf81a['id'],_0x4bf81a);WhatsappInteractionEvents[_0x5bb9('0xb')](_0x4ef42d,_0x4bf81a);_0x2b72aa(null);})['catch'](_0x2b72aa(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x5bb9('0xc')](e,emitEvent(event));}}module[_0x5bb9('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x0e35=['setMaxListeners','save','update','remove','setDataValue','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0x0e35,0xc2));var _0x50e3=function(_0xc70c4a,_0x3489d7){_0xc70c4a=_0xc70c4a-0x0;var _0x571af7=_0x0e35[_0xc70c4a];return _0x571af7;};'use strict';var EventEmitter=require(_0x50e3('0x0'));var WhatsappInteraction=require(_0x50e3('0x1'))['db'][_0x50e3('0x2')];var WhatsappMessage=require(_0x50e3('0x1'))['db'][_0x50e3('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x50e3('0x4')](0x0);var events={'afterCreate':_0x50e3('0x5'),'afterUpdate':_0x50e3('0x6'),'afterDestroy':_0x50e3('0x7')};function emitEvent(_0x344554){return function(_0x5a6200,_0x86283e,_0x35e2b1){_0x5a6200['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2ac084){_0x5a6200[_0x50e3('0x8')]('Users',_0x2ac084['map'](function(_0x35c16c){return{'id':_0x35c16c['id']};}));return WhatsappMessage[_0x50e3('0x9')]({'where':{'WhatsappInteractionId':_0x5a6200['id'],'direction':'in','read':![]},'raw':!![]});})[_0x50e3('0xa')](function(_0x2658d9){_0x5a6200[_0x50e3('0x8')](_0x50e3('0xb'),_0x2658d9[_0x50e3('0xc')]);WhatsappInteractionEvents[_0x50e3('0xd')](_0x344554+':'+_0x5a6200['id'],_0x5a6200);WhatsappInteractionEvents[_0x50e3('0xd')](_0x344554,_0x5a6200);_0x35e2b1(null);})[_0x50e3('0xe')](_0x35e2b1(null));};}for(var e in events){if(events[_0x50e3('0xf')](e)){var event=events[e];WhatsappInteraction[_0x50e3('0x10')](e,emitEvent(event));}}module[_0x50e3('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 829cd4d..9a89b8b 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 _0x4bec=['request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','define','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird'];(function(_0x4e6603,_0x3b8172){var _0x2930e7=function(_0x1fbc5f){while(--_0x1fbc5f){_0x4e6603['push'](_0x4e6603['shift']());}};_0x2930e7(++_0x3b8172);}(_0x4bec,0xdc));var _0xc4be=function(_0x35a238,_0x337f6c){_0x35a238=_0x35a238-0x0;var _0x30c6ac=_0x4bec[_0x35a238];return _0x30c6ac;};'use strict';var _=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var logger=require('../../config/logger')(_0xc4be('0x2'));var moment=require(_0xc4be('0x3'));var BPromise=require(_0xc4be('0x4'));var rp=require(_0xc4be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4be('0x6'));var config=require(_0xc4be('0x7'));var attributes=require(_0xc4be('0x8'));module['exports']=function(_0x4ecdad,_0x36e575){return _0x4ecdad[_0xc4be('0x9')]('WhatsappInteraction',attributes,{'tableName':_0xc4be('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x294e6c,_0x244d25,_0x36fa67){if(_0x294e6c['changed'](_0xc4be('0xb'))){_0x294e6c[_0xc4be('0xc')]=moment()[_0xc4be('0xd')](_0xc4be('0xe'));}_0x36fa67(null,_0x294e6c);}}});}; \ No newline at end of file +var _0xd9aa=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappInteraction.attributes','define','whatsapp_interactions','changed','closed'];(function(_0x479b44,_0x4ea7e1){var _0x38af60=function(_0x4316b2){while(--_0x4316b2){_0x479b44['push'](_0x479b44['shift']());}};_0x38af60(++_0x4ea7e1);}(_0xd9aa,0x93));var _0xad9a=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xd9aa[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xad9a('0x0'));var util=require(_0xad9a('0x1'));var logger=require(_0xad9a('0x2'))(_0xad9a('0x3'));var moment=require(_0xad9a('0x4'));var BPromise=require(_0xad9a('0x5'));var rp=require(_0xad9a('0x6'));var fs=require('fs');var path=require(_0xad9a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad9a('0x8'));module['exports']=function(_0x4d7e7b,_0x14a90){return _0x4d7e7b[_0xad9a('0x9')]('WhatsappInteraction',attributes,{'tableName':_0xad9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20b968,_0x57ca94,_0x342b4a){if(_0x20b968[_0xad9a('0xb')](_0xad9a('0xc'))){_0x20b968[_0xad9a('0xd')]=moment()[_0xad9a('0xe')](_0xad9a('0xf'));}_0x342b4a(null,_0x20b968);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 0a2c0ba..2f8e2b7 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 _0xb5c7=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','debug','bluebird'];(function(_0x56884e,_0x3584c1){var _0x1501c5=function(_0x47218f){while(--_0x47218f){_0x56884e['push'](_0x56884e['shift']());}};_0x1501c5(++_0x3584c1);}(_0xb5c7,0x1c2));var _0x7b5c=function(_0x70c85c,_0x2e8d39){_0x70c85c=_0x70c85c-0x0;var _0x19b73e=_0xb5c7[_0x70c85c];return _0x19b73e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7b5c('0x0'));var rs=require(_0x7b5c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b5c('0x2'))['db'];var utils=require(_0x7b5c('0x3'));var logger=require('../../config/logger')(_0x7b5c('0x4'));var config=require('../../config/environment');var jayson=require(_0x7b5c('0x5'));var client=jayson[_0x7b5c('0x6')][_0x7b5c('0x7')]({'port':0x232a});config['redis']=_[_0x7b5c('0x8')](config['redis'],{'host':_0x7b5c('0x9'),'port':0x18eb});var socket=require(_0x7b5c('0xa'))(new Redis(config[_0x7b5c('0xb')]));require('./whatsappInteraction.socket')[_0x7b5c('0xc')](socket);function respondWithRpcPromise(_0x2e4a23,_0x191327,_0x408e48){return new BPromise(function(_0x27784f,_0x102fbc){return client[_0x7b5c('0xd')](_0x2e4a23,_0x408e48)[_0x7b5c('0xe')](function(_0x376aa6){logger[_0x7b5c('0xf')](_0x7b5c('0x10'),_0x191327,_0x7b5c('0x11'));logger['debug'](_0x7b5c('0x12'),_0x191327,_0x7b5c('0x11'),JSON[_0x7b5c('0x13')](_0x376aa6));if(_0x376aa6['error']){if(_0x376aa6['error'][_0x7b5c('0x14')]===0x1f4){logger[_0x7b5c('0x15')](_0x7b5c('0x10'),_0x191327,_0x376aa6['error'][_0x7b5c('0x16')]);return _0x102fbc(_0x376aa6['error'][_0x7b5c('0x16')]);}logger[_0x7b5c('0x15')](_0x7b5c('0x10'),_0x191327,_0x376aa6['error'][_0x7b5c('0x16')]);return _0x27784f(_0x376aa6[_0x7b5c('0x15')][_0x7b5c('0x16')]);}else{logger[_0x7b5c('0xf')](_0x7b5c('0x10'),_0x191327,_0x7b5c('0x11'));_0x27784f(_0x376aa6[_0x7b5c('0x17')][_0x7b5c('0x16')]);}})[_0x7b5c('0x18')](function(_0x23494e){logger['error'](_0x7b5c('0x10'),_0x191327,_0x23494e);_0x102fbc(_0x23494e);});});}exports[_0x7b5c('0x19')]=function(_0x25e990){var _0x5c5cf3=this;return new Promise(function(_0x25aed7,_0x26b55d){return db[_0x7b5c('0x1a')][_0x7b5c('0x1b')](_0x25e990[_0x7b5c('0x1c')],{'raw':_0x25e990[_0x7b5c('0x1d')]?_0x25e990['options'][_0x7b5c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e990[_0x7b5c('0x1d')]?_0x25e990[_0x7b5c('0x1d')][_0x7b5c('0x1f')]||null:null,'attributes':_0x25e990[_0x7b5c('0x1d')]?_0x25e990['options'][_0x7b5c('0x20')]||null:null,'limit':_0x25e990[_0x7b5c('0x1d')]?_0x25e990[_0x7b5c('0x1d')]['limit']||null:null})[_0x7b5c('0xe')](function(_0x4555a1){logger[_0x7b5c('0xf')](_0x7b5c('0x19'),_0x25e990);logger['debug'](_0x7b5c('0x19'),_0x25e990,JSON[_0x7b5c('0x13')](_0x4555a1));_0x25aed7(_0x4555a1);})[_0x7b5c('0x18')](function(_0x32c284){logger[_0x7b5c('0x15')](_0x7b5c('0x19'),_0x32c284['message'],_0x25e990);_0x26b55d(_0x5c5cf3[_0x7b5c('0x15')](0x1f4,_0x32c284[_0x7b5c('0x16')]));});});};exports[_0x7b5c('0x21')]=function(_0x186ba9){return new Promise(function(_0x590045,_0x2c3257){return db[_0x7b5c('0x1a')][_0x7b5c('0x22')]({'where':_0x186ba9[_0x7b5c('0x1d')]?_0x186ba9[_0x7b5c('0x1d')]['where']||null:null})[_0x7b5c('0xe')](function(_0x540d79){if(_0x540d79){return _0x540d79[_0x7b5c('0x23')](_0x186ba9['body'][_0x7b5c('0x24')],_[_0x7b5c('0x25')](_0x186ba9[_0x7b5c('0x1c')],[_0x7b5c('0x24'),'id'])||{});}})[_0x7b5c('0x26')](function(_0x3c6b00){logger[_0x7b5c('0xf')](_0x7b5c('0x27'),_0x186ba9);logger[_0x7b5c('0x28')](_0x7b5c('0x27'),_0x186ba9,JSON['stringify'](_0x3c6b00));_0x590045(_0x3c6b00);})['catch'](function(_0x275bd6){logger[_0x7b5c('0x15')](_0x7b5c('0x27'),_0x275bd6[_0x7b5c('0x16')],_0x186ba9);_0x2c3257(_this['error'](0x1f4,_0x275bd6[_0x7b5c('0x16')]));});});}; \ No newline at end of file +var _0xd9bd=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','WhatsappInteraction','update','body','options','where','attributes','limit','UpdateWhatsappInteraction','stringify','catch','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x46dfd1,_0x31bd8c){var _0x27aea0=function(_0x49bccc){while(--_0x49bccc){_0x46dfd1['push'](_0x46dfd1['shift']());}};_0x27aea0(++_0x31bd8c);}(_0xd9bd,0x1c2));var _0xdd9b=function(_0x515442,_0x10eafc){_0x515442=_0x515442-0x0;var _0x2ca821=_0xd9bd[_0x515442];return _0x2ca821;};'use strict';var _=require(_0xdd9b('0x0'));var util=require(_0xdd9b('0x1'));var moment=require(_0xdd9b('0x2'));var BPromise=require(_0xdd9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd9b('0x4'));var db=require(_0xdd9b('0x5'))['db'];var utils=require(_0xdd9b('0x6'));var logger=require(_0xdd9b('0x7'))(_0xdd9b('0x8'));var config=require(_0xdd9b('0x9'));var jayson=require(_0xdd9b('0xa'));var client=jayson['client'][_0xdd9b('0xb')]({'port':0x232a});config[_0xdd9b('0xc')]=_[_0xdd9b('0xd')](config[_0xdd9b('0xc')],{'host':_0xdd9b('0xe'),'port':0x18eb});var socket=require(_0xdd9b('0xf'))(new Redis(config['redis']));require(_0xdd9b('0x10'))[_0xdd9b('0x11')](socket);function respondWithRpcPromise(_0x39691f,_0x514e0b,_0x3fa41e){return new BPromise(function(_0x288e7e,_0x55a31b){return client[_0xdd9b('0x12')](_0x39691f,_0x3fa41e)[_0xdd9b('0x13')](function(_0x5d6180){logger[_0xdd9b('0x14')](_0xdd9b('0x15'),_0x514e0b,'request\x20sent');logger[_0xdd9b('0x16')](_0xdd9b('0x17'),_0x514e0b,_0xdd9b('0x18'),JSON['stringify'](_0x5d6180));if(_0x5d6180[_0xdd9b('0x19')]){if(_0x5d6180[_0xdd9b('0x19')][_0xdd9b('0x1a')]===0x1f4){logger[_0xdd9b('0x19')](_0xdd9b('0x15'),_0x514e0b,_0x5d6180[_0xdd9b('0x19')][_0xdd9b('0x1b')]);return _0x55a31b(_0x5d6180[_0xdd9b('0x19')][_0xdd9b('0x1b')]);}logger[_0xdd9b('0x19')](_0xdd9b('0x15'),_0x514e0b,_0x5d6180[_0xdd9b('0x19')]['message']);return _0x288e7e(_0x5d6180['error'][_0xdd9b('0x1b')]);}else{logger[_0xdd9b('0x14')](_0xdd9b('0x15'),_0x514e0b,_0xdd9b('0x18'));_0x288e7e(_0x5d6180[_0xdd9b('0x1c')][_0xdd9b('0x1b')]);}})['catch'](function(_0x5a954f){logger[_0xdd9b('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x514e0b,_0x5a954f);_0x55a31b(_0x5a954f);});});}exports['UpdateWhatsappInteraction']=function(_0x2f1a40){var _0x188f98=this;return new Promise(function(_0x3649c3,_0x514710){return db[_0xdd9b('0x1d')][_0xdd9b('0x1e')](_0x2f1a40[_0xdd9b('0x1f')],{'raw':_0x2f1a40[_0xdd9b('0x20')]?_0x2f1a40[_0xdd9b('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f1a40['options']?_0x2f1a40[_0xdd9b('0x20')][_0xdd9b('0x21')]||null:null,'attributes':_0x2f1a40['options']?_0x2f1a40['options'][_0xdd9b('0x22')]||null:null,'limit':_0x2f1a40['options']?_0x2f1a40[_0xdd9b('0x20')][_0xdd9b('0x23')]||null:null})['then'](function(_0x4c48c0){logger[_0xdd9b('0x14')](_0xdd9b('0x24'),_0x2f1a40);logger['debug']('UpdateWhatsappInteraction',_0x2f1a40,JSON[_0xdd9b('0x25')](_0x4c48c0));_0x3649c3(_0x4c48c0);})[_0xdd9b('0x26')](function(_0x6e964a){logger[_0xdd9b('0x19')]('UpdateWhatsappInteraction',_0x6e964a[_0xdd9b('0x1b')],_0x2f1a40);_0x514710(_0x188f98[_0xdd9b('0x19')](0x1f4,_0x6e964a['message']));});});};exports[_0xdd9b('0x27')]=function(_0x33797e){return new Promise(function(_0x3ac17f,_0x53367c){return db[_0xdd9b('0x1d')][_0xdd9b('0x28')]({'where':_0x33797e[_0xdd9b('0x20')]?_0x33797e[_0xdd9b('0x20')]['where']||null:null})['then'](function(_0x3425d8){if(_0x3425d8){return _0x3425d8[_0xdd9b('0x29')](_0x33797e[_0xdd9b('0x1f')][_0xdd9b('0x2a')],_[_0xdd9b('0x2b')](_0x33797e[_0xdd9b('0x1f')],[_0xdd9b('0x2a'),'id'])||{});}})[_0xdd9b('0x2c')](function(_0x379f26){logger[_0xdd9b('0x14')](_0xdd9b('0x2d'),_0x33797e);logger[_0xdd9b('0x16')]('AddTags',_0x33797e,JSON['stringify'](_0x379f26));_0x3ac17f(_0x379f26);})['catch'](function(_0x51863a){logger['error'](_0xdd9b('0x2d'),_0x51863a[_0xdd9b('0x1b')],_0x33797e);_0x53367c(_this['error'](0x1f4,_0x51863a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 4f5cd36..2388215 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 _0x6304=['removeListener','register','length','./whatsappInteraction.events','save'];(function(_0x5def29,_0x2aad51){var _0x17241a=function(_0x519d80){while(--_0x519d80){_0x5def29['push'](_0x5def29['shift']());}};_0x17241a(++_0x2aad51);}(_0x6304,0xf3));var _0x4630=function(_0x453e3c,_0x279baa){_0x453e3c=_0x453e3c-0x0;var _0x1b7d0a=_0x6304[_0x453e3c];return _0x1b7d0a;};'use strict';var WhatsappInteractionEvents=require(_0x4630('0x0'));var events=[_0x4630('0x1'),'remove','update'];function createListener(_0x1523ea,_0x2defce){return function(_0x328727){_0x2defce['emit'](_0x1523ea,_0x328727);};}function removeListener(_0x34d72d,_0x3e2570){return function(){WhatsappInteractionEvents[_0x4630('0x2')](_0x34d72d,_0x3e2570);};}exports[_0x4630('0x3')]=function(_0x45e8bb){for(var _0x1d3345=0x0,_0x998e47=events[_0x4630('0x4')];_0x1d3345<_0x998e47;_0x1d3345++){var _0x5b8b8f=events[_0x1d3345];var _0x40bc83=createListener('whatsappInteraction:'+_0x5b8b8f,_0x45e8bb);WhatsappInteractionEvents['on'](_0x5b8b8f,_0x40bc83);}}; \ No newline at end of file +var _0x41e7=['save','remove','removeListener','register','length','./whatsappInteraction.events'];(function(_0x6317e0,_0x3a268e){var _0x3f6009=function(_0x293734){while(--_0x293734){_0x6317e0['push'](_0x6317e0['shift']());}};_0x3f6009(++_0x3a268e);}(_0x41e7,0xe9));var _0x741e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x41e7[_0x3947c9];return _0x2e7871;};'use strict';var WhatsappInteractionEvents=require(_0x741e('0x0'));var events=[_0x741e('0x1'),_0x741e('0x2'),'update'];function createListener(_0x1e58d7,_0x41817c){return function(_0x534240){_0x41817c['emit'](_0x1e58d7,_0x534240);};}function removeListener(_0x3e2ead,_0x22cf39){return function(){WhatsappInteractionEvents[_0x741e('0x3')](_0x3e2ead,_0x22cf39);};}exports[_0x741e('0x4')]=function(_0x163a5c){for(var _0x51d382=0x0,_0xa156cd=events[_0x741e('0x5')];_0x51d382<_0xa156cd;_0x51d382++){var _0x54ab9a=events[_0x51d382];var _0x3eb545=createListener('whatsappInteraction:'+_0x54ab9a,_0x163a5c);WhatsappInteractionEvents['on'](_0x54ab9a,_0x3eb545);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 97dce3d..4ceda1e 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 _0x4173=['create','status','put','update','/:id/accept','accept','/:id/reject','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsappmessage:create'];(function(_0x4ea9ff,_0x5a6caa){var _0x366459=function(_0x5ea89c){while(--_0x5ea89c){_0x4ea9ff['push'](_0x4ea9ff['shift']());}};_0x366459(++_0x5a6caa);}(_0x4173,0x8a));var _0x3417=function(_0x207696,_0x1cf674){_0x207696=_0x207696-0x0;var _0x4060f3=_0x4173[_0x207696];return _0x4060f3;};'use strict';var multer=require(_0x3417('0x0'));var util=require('util');var path=require(_0x3417('0x1'));var timeout=require(_0x3417('0x2'));var express=require(_0x3417('0x3'));var router=express[_0x3417('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3417('0x5'));var config=require(_0x3417('0x6'));var controller=require(_0x3417('0x7'));router[_0x3417('0x8')]('/',auth[_0x3417('0x9')](),controller[_0x3417('0xa')]);router[_0x3417('0x8')](_0x3417('0xb'),auth[_0x3417('0x9')](),controller[_0x3417('0xc')]);router['get'](_0x3417('0xd'),auth[_0x3417('0x9')](),controller[_0x3417('0xe')]);router[_0x3417('0xf')]('/',auth[_0x3417('0x9')](),interaction[_0x3417('0x10')]('whatsapp',_0x3417('0x11')),controller[_0x3417('0x12')]);router[_0x3417('0xf')]('/:id/status',controller[_0x3417('0x13')]);router[_0x3417('0x14')]('/:id',auth[_0x3417('0x9')](),controller[_0x3417('0x15')]);router[_0x3417('0x14')](_0x3417('0x16'),auth[_0x3417('0x9')](),controller[_0x3417('0x17')]);router[_0x3417('0x14')](_0x3417('0x18'),auth[_0x3417('0x9')](),controller['reject']);router['delete'](_0x3417('0xd'),auth[_0x3417('0x9')](),controller['destroy']);module[_0x3417('0x19')]=router; \ No newline at end of file +var _0xbd9a=['put','update','accept','delete','destroy','exports','express','Router','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','whatsapp','whatsappmessage:create','create','/:id/status','status'];(function(_0x30a007,_0x4f04db){var _0x1483b4=function(_0x5274cb){while(--_0x5274cb){_0x30a007['push'](_0x30a007['shift']());}};_0x1483b4(++_0x4f04db);}(_0xbd9a,0x1a8));var _0xabd9=function(_0x47abb1,_0x1c8935){_0x47abb1=_0x47abb1-0x0;var _0x5001aa=_0xbd9a[_0x47abb1];return _0x5001aa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xabd9('0x0'));var router=express[_0xabd9('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xabd9('0x2'));var config=require('../../config/environment');var controller=require(_0xabd9('0x3'));router[_0xabd9('0x4')]('/',auth[_0xabd9('0x5')](),controller[_0xabd9('0x6')]);router[_0xabd9('0x4')]('/describe',auth['isAuthenticated'](),controller[_0xabd9('0x7')]);router[_0xabd9('0x4')](_0xabd9('0x8'),auth[_0xabd9('0x5')](),controller[_0xabd9('0x9')]);router[_0xabd9('0xa')]('/',auth[_0xabd9('0x5')](),interaction['tracked'](_0xabd9('0xb'),_0xabd9('0xc')),controller[_0xabd9('0xd')]);router['post'](_0xabd9('0xe'),controller[_0xabd9('0xf')]);router[_0xabd9('0x10')](_0xabd9('0x8'),auth['isAuthenticated'](),controller[_0xabd9('0x11')]);router['put']('/:id/accept',auth[_0xabd9('0x5')](),controller[_0xabd9('0x12')]);router['put']('/:id/reject',auth[_0xabd9('0x5')](),controller['reject']);router[_0xabd9('0x13')]('/:id',auth[_0xabd9('0x5')](),controller[_0xabd9('0x14')]);module[_0xabd9('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 361bf04..5c5ee17 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 _0x0ef2=['BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x0ef2,0x169));var _0x20ef=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0x0ef2[_0x4664db];return _0x5615b4;};'use strict';var Sequelize=require(_0x20ef('0x0'));module[_0x20ef('0x1')]={'body':{'type':Sequelize[_0x20ef('0x2')](_0x20ef('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x20ef('0x4')]('in','out'),'defaultValue':_0x20ef('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x20ef('0x6')](0xbe)},'phone':{'type':Sequelize[_0x20ef('0x6')]},'readAt':{'type':Sequelize[_0x20ef('0x7')]},'secret':{'type':Sequelize[_0x20ef('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x20ef('0x6')]},'providerResponse':{'type':Sequelize[_0x20ef('0x2')]}}; \ No newline at end of file +var _0xcd72=['out','DATE','TEXT','sequelize','exports','BOOLEAN','ENUM'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xcd72,0x192));var _0x2cd7=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0xcd72[_0x483102];return _0x5cc885;};'use strict';var Sequelize=require(_0x2cd7('0x0'));module[_0x2cd7('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2cd7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2cd7('0x3')]('in','out'),'defaultValue':_0x2cd7('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x2cd7('0x5')]},'secret':{'type':Sequelize[_0x2cd7('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x2cd7('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 770387a..4e8c88c 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 _0x8a67=['rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','include','findAll','params','options','create','body','find','describe','whatsapp-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','agent','email','interface','channel','motionChannel','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','User','fullname','internal','SIP/%s','event'];(function(_0x1c08f6,_0x14c077){var _0xbc156a=function(_0x59df22){while(--_0x59df22){_0x1c08f6['push'](_0x1c08f6['shift']());}};_0xbc156a(++_0x14c077);}(_0x8a67,0x1b1));var _0x78a6=function(_0x353961,_0x36e750){_0x353961=_0x353961-0x0;var _0x331327=_0x8a67[_0x353961];return _0x331327;};'use strict';var emlformat=require(_0x78a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78a6('0x1'));var jsonpatch=require(_0x78a6('0x2'));var rp=require(_0x78a6('0x3'));var moment=require(_0x78a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x78a6('0x5'));var util=require(_0x78a6('0x6'));var path=require(_0x78a6('0x7'));var sox=require('sox');var csv=require(_0x78a6('0x8'));var ejs=require(_0x78a6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78a6('0xa'));var crypto=require(_0x78a6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x78a6('0xc'));var toCsv=require(_0x78a6('0x8'));var querystring=require(_0x78a6('0xd'));var Papa=require(_0x78a6('0xe'));var Redis=require('ioredis');var authService=require(_0x78a6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x78a6('0x10'));var hardwareService=require(_0x78a6('0x11'));var logger=require(_0x78a6('0x12'))(_0x78a6('0x13'));var utils=require(_0x78a6('0x14'));var config=require(_0x78a6('0x15'));var licenseUtil=require(_0x78a6('0x16'));var db=require(_0x78a6('0x17'))['db'];config[_0x78a6('0x18')]=_['defaults'](config['redis'],{'host':_0x78a6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78a6('0x18')]));require(_0x78a6('0x1a'))[_0x78a6('0x1b')](socket);var jayson=require(_0x78a6('0x1c'));var client=jayson['client'][_0x78a6('0x1d')]({'port':0x232c});var client9002=jayson[_0x78a6('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x367d45,_0x74466d,_0x3fd14f,_0x510845){return new BPromise(function(_0x57a883,_0x3e2ace){var _0x37409a=_0x510845||client;return _0x37409a[_0x78a6('0x1f')](_0x367d45,_0x3fd14f)[_0x78a6('0x20')](function(_0x2cb929){logger['info'](_0x78a6('0x21'),_0x74466d,_0x78a6('0x22'));logger[_0x78a6('0x23')](_0x78a6('0x24'),_0x74466d,_0x78a6('0x22'),JSON[_0x78a6('0x25')](_0x2cb929));if(_0x2cb929[_0x78a6('0x26')]){if(_0x2cb929[_0x78a6('0x26')]['code']===0x1f4){logger['error'](_0x78a6('0x21'),_0x74466d,_0x2cb929[_0x78a6('0x26')][_0x78a6('0x27')]);return _0x3e2ace(_0x2cb929['error'][_0x78a6('0x27')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x74466d,_0x2cb929[_0x78a6('0x26')][_0x78a6('0x27')]);return _0x57a883(_0x2cb929[_0x78a6('0x26')]['message']);}else{logger[_0x78a6('0x28')](_0x78a6('0x21'),_0x74466d,_0x78a6('0x22'));_0x57a883(_0x2cb929[_0x78a6('0x29')][_0x78a6('0x27')]);}})[_0x78a6('0x2a')](function(_0x29fd83){logger['error'](_0x78a6('0x21'),_0x74466d,_0x29fd83);_0x3e2ace(_0x29fd83);});});}function respondWithStatusCode(_0x176c85,_0x314ab7){_0x314ab7=_0x314ab7||0xcc;return function(_0x5234a5){if(_0x5234a5){return _0x176c85['sendStatus'](_0x314ab7);}return _0x176c85[_0x78a6('0x2b')](_0x314ab7)[_0x78a6('0x2c')]();};}function respondWithResult(_0x4719a6,_0x5dd1da){_0x5dd1da=_0x5dd1da||0xc8;return function(_0xf8f5d2){if(_0xf8f5d2){return _0x4719a6[_0x78a6('0x2b')](_0x5dd1da)[_0x78a6('0x2d')](_0xf8f5d2);}};}function respondWithFilteredResult(_0x1219fb,_0xafdb6b){return function(_0x2d84bd){if(_0x2d84bd){var _0x5689fc=typeof _0xafdb6b[_0x78a6('0x2e')]==='undefined'&&typeof _0xafdb6b['limit']===_0x78a6('0x2f');var _0x442e8c=_0x2d84bd[_0x78a6('0x30')];var _0x50957d=_0x5689fc?0x0:_0xafdb6b[_0x78a6('0x2e')];var _0x14b8ab=_0x5689fc?_0x2d84bd['count']:_0xafdb6b[_0x78a6('0x2e')]+_0xafdb6b[_0x78a6('0x31')];var _0x7918e7;if(_0x14b8ab>=_0x442e8c){_0x14b8ab=_0x442e8c;_0x7918e7=0xc8;}else{_0x7918e7=0xce;}_0x1219fb[_0x78a6('0x2b')](_0x7918e7);return _0x1219fb['set']('Content-Range',_0x50957d+'-'+_0x14b8ab+'/'+_0x442e8c)[_0x78a6('0x2d')](_0x2d84bd);}return null;};}function patchUpdates(_0x4d167f){return function(_0x5f4ae4){try{jsonpatch[_0x78a6('0x32')](_0x5f4ae4,_0x4d167f,!![]);}catch(_0xfff57e){return BPromise[_0x78a6('0x33')](_0xfff57e);}return _0x5f4ae4[_0x78a6('0x34')]();};}function saveUpdates(_0x1a9342,_0x40c13d){return function(_0x57fafe){if(_0x57fafe){return _0x57fafe[_0x78a6('0x35')](_0x1a9342)[_0x78a6('0x20')](function(_0x474ada){return _0x474ada;});}return null;};}function removeEntity(_0x1b2749,_0x3cd8d5){return function(_0x154a2d){if(_0x154a2d){return _0x154a2d[_0x78a6('0x36')]()['then'](function(){_0x1b2749[_0x78a6('0x2b')](0xcc)[_0x78a6('0x2c')]();});}};}function handleEntityNotFound(_0x8c4541,_0x9fef6c){return function(_0x519678){if(!_0x519678){_0x8c4541[_0x78a6('0x37')](0x194);}return _0x519678;};}function handleError(_0x96c7f3,_0x1eff03){_0x1eff03=_0x1eff03||0x1f4;return function(_0x412476){logger[_0x78a6('0x26')](_0x412476[_0x78a6('0x38')]);if(_0x412476['name']){delete _0x412476[_0x78a6('0x39')];}_0x96c7f3['status'](_0x1eff03)[_0x78a6('0x3a')](_0x412476);};}exports['index']=function(_0x144b69,_0x4a9b80){var _0x4ed2b4={},_0x104571={},_0x51cb7b={'count':0x0,'rows':[]};var _0x390767=_[_0x78a6('0x3b')](db[_0x78a6('0x3c')][_0x78a6('0x3d')],function(_0x4ecfa3){return{'name':_0x4ecfa3[_0x78a6('0x3e')],'type':_0x4ecfa3[_0x78a6('0x3f')][_0x78a6('0x40')]};});_0x104571[_0x78a6('0x41')]=_[_0x78a6('0x3b')](_0x390767,_0x78a6('0x39'));_0x104571[_0x78a6('0x42')]=_[_0x78a6('0x43')](_0x144b69[_0x78a6('0x42')]);_0x104571[_0x78a6('0x44')]=_['intersection'](_0x104571[_0x78a6('0x41')],_0x104571[_0x78a6('0x42')]);_0x4ed2b4[_0x78a6('0x45')]=_[_0x78a6('0x46')](_0x104571[_0x78a6('0x41')],qs[_0x78a6('0x47')](_0x144b69[_0x78a6('0x42')][_0x78a6('0x47')]));_0x4ed2b4['attributes']=_0x4ed2b4[_0x78a6('0x45')][_0x78a6('0x48')]?_0x4ed2b4['attributes']:_0x104571['model'];if(!_0x144b69[_0x78a6('0x42')][_0x78a6('0x49')](_0x78a6('0x4a'))){_0x4ed2b4[_0x78a6('0x31')]=qs[_0x78a6('0x31')](_0x144b69[_0x78a6('0x42')][_0x78a6('0x31')]);_0x4ed2b4[_0x78a6('0x2e')]=qs[_0x78a6('0x2e')](_0x144b69[_0x78a6('0x42')][_0x78a6('0x2e')]);}_0x4ed2b4[_0x78a6('0x4b')]=qs[_0x78a6('0x4c')](_0x144b69[_0x78a6('0x42')][_0x78a6('0x4c')]);_0x4ed2b4['where']=qs[_0x78a6('0x44')](_[_0x78a6('0x4d')](_0x144b69[_0x78a6('0x42')],_0x104571[_0x78a6('0x44')]),_0x390767);if(_0x144b69['query']['filter']){_0x4ed2b4[_0x78a6('0x4e')]=_['merge'](_0x4ed2b4[_0x78a6('0x4e')],{'$or':_[_0x78a6('0x3b')](_0x390767,function(_0x3071ab){if(_0x3071ab[_0x78a6('0x3f')]!==_0x78a6('0x4f')){var _0xc9f166={};_0xc9f166[_0x3071ab[_0x78a6('0x39')]]={'$like':'%'+_0x144b69['query'][_0x78a6('0x50')]+'%'};return _0xc9f166;}})});}_0x4ed2b4=_[_0x78a6('0x51')]({},_0x4ed2b4,_0x144b69['options']);var _0x416e5f={'where':_0x4ed2b4[_0x78a6('0x4e')]};return db['WhatsappMessage'][_0x78a6('0x30')](_0x416e5f)[_0x78a6('0x20')](function(_0x323a5f){_0x51cb7b[_0x78a6('0x30')]=_0x323a5f;if(_0x144b69[_0x78a6('0x42')]['includeAll']){_0x4ed2b4[_0x78a6('0x52')]=[{'all':!![]}];}return db[_0x78a6('0x3c')][_0x78a6('0x53')](_0x4ed2b4);})[_0x78a6('0x20')](function(_0x19d808){_0x51cb7b['rows']=_0x19d808;return _0x51cb7b;})['then'](respondWithFilteredResult(_0x4a9b80,_0x4ed2b4))[_0x78a6('0x2a')](handleError(_0x4a9b80,null));};exports['show']=function(_0x5657c8,_0x297f6b){var _0x5ef867={'raw':!![],'where':{'id':_0x5657c8[_0x78a6('0x54')]['id']}},_0x14acbb={};_0x14acbb[_0x78a6('0x41')]=_['keys'](db[_0x78a6('0x3c')][_0x78a6('0x3d')]);_0x14acbb[_0x78a6('0x42')]=_[_0x78a6('0x43')](_0x5657c8[_0x78a6('0x42')]);_0x14acbb[_0x78a6('0x44')]=_[_0x78a6('0x46')](_0x14acbb['model'],_0x14acbb[_0x78a6('0x42')]);_0x5ef867[_0x78a6('0x45')]=_['intersection'](_0x14acbb[_0x78a6('0x41')],qs['fields'](_0x5657c8[_0x78a6('0x42')][_0x78a6('0x47')]));_0x5ef867['attributes']=_0x5ef867[_0x78a6('0x45')][_0x78a6('0x48')]?_0x5ef867[_0x78a6('0x45')]:_0x14acbb[_0x78a6('0x41')];if(_0x5657c8[_0x78a6('0x42')]['includeAll']){_0x5ef867[_0x78a6('0x52')]=[{'all':!![]}];}_0x5ef867=_[_0x78a6('0x51')]({},_0x5ef867,_0x5657c8[_0x78a6('0x55')]);return db['WhatsappMessage']['find'](_0x5ef867)[_0x78a6('0x20')](handleEntityNotFound(_0x297f6b,null))['then'](respondWithResult(_0x297f6b,null))[_0x78a6('0x2a')](handleError(_0x297f6b,null));};exports[_0x78a6('0x56')]=function(_0x3a9f1b,_0x508873){return db['WhatsappMessage'][_0x78a6('0x56')](_0x3a9f1b[_0x78a6('0x57')],{})['then'](respondWithResult(_0x508873,0xc9))[_0x78a6('0x2a')](handleError(_0x508873,null));};exports['update']=function(_0x52268e,_0x2fe953){if(_0x52268e[_0x78a6('0x57')]['id']){delete _0x52268e[_0x78a6('0x57')]['id'];}return db[_0x78a6('0x3c')][_0x78a6('0x58')]({'where':{'id':_0x52268e['params']['id']}})[_0x78a6('0x20')](handleEntityNotFound(_0x2fe953,null))[_0x78a6('0x20')](saveUpdates(_0x52268e[_0x78a6('0x57')],null))['then'](respondWithResult(_0x2fe953,null))[_0x78a6('0x2a')](handleError(_0x2fe953,null));};exports[_0x78a6('0x36')]=function(_0x1f57d9,_0x76fdcb){return db[_0x78a6('0x3c')][_0x78a6('0x58')]({'where':{'id':_0x1f57d9[_0x78a6('0x54')]['id']}})[_0x78a6('0x20')](handleEntityNotFound(_0x76fdcb,null))[_0x78a6('0x20')](removeEntity(_0x76fdcb,null))[_0x78a6('0x2a')](handleError(_0x76fdcb,null));};exports['describe']=function(_0x26d7ac,_0x61078c){return db[_0x78a6('0x3c')][_0x78a6('0x59')]()[_0x78a6('0x20')](respondWithResult(_0x61078c,null))[_0x78a6('0x2a')](handleError(_0x61078c,null));};var interaction_log=require(_0x78a6('0x12'))(_0x78a6('0x5a'));exports[_0x78a6('0x5b')]=function(_0x2598f7,_0x266db8,_0x20e8c3){var _0x3c145b={'agent':{},'channel':'whatsapp'};if(_0x2598f7[_0x78a6('0x57')]['id']){delete _0x2598f7[_0x78a6('0x57')]['id'];}_0x2598f7[_0x78a6('0x57')][_0x78a6('0x5c')]=!![];_0x2598f7[_0x78a6('0x57')][_0x78a6('0x5d')]=moment()['format'](_0x78a6('0x5e'));_0x2598f7['body']['UserId']=_0x2598f7[_0x78a6('0x57')][_0x78a6('0x5f')]||_0x2598f7[_0x78a6('0x60')]['id'];_0x3c145b['agent']['id']=_0x2598f7[_0x78a6('0x57')][_0x78a6('0x5f')];return db[_0x78a6('0x3c')]['find']({'where':{'id':_0x2598f7[_0x78a6('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x266db8,null))['then'](saveUpdates(_0x2598f7['body'],null))[_0x78a6('0x20')](function(_0xd44713){if(_0xd44713){_0x3c145b['message']=_0xd44713[_0x78a6('0x61')]({'plain':!![]});return db[_0x78a6('0x62')][_0x78a6('0x58')]({'where':{'id':_0xd44713[_0x78a6('0x63')]}});}return null;})[_0x78a6('0x20')](handleEntityNotFound(_0x266db8,null))['then'](function(_0x35fc0d){if(_0x35fc0d){return _0x35fc0d[_0x78a6('0x35')]({'UserId':_0x2598f7[_0x78a6('0x57')]['UserId'],'read1stAt':_[_0x78a6('0x64')](_0x35fc0d[_0x78a6('0x65')])?moment()[_0x78a6('0x66')](_0x78a6('0x5e')):undefined});}return null;})[_0x78a6('0x20')](function(_0x29e614){if(_0x29e614){_0x3c145b['interaction']=_0x29e614[_0x78a6('0x61')]({'plain':!![]});interaction_log['info'](_0x78a6('0x67'),_0x2598f7[_0x78a6('0x60')]['id'],_0x2598f7[_0x78a6('0x60')][_0x78a6('0x39')],_0x2598f7[_0x78a6('0x60')][_0x78a6('0x68')],_0x3c145b[_0x78a6('0x69')]['id'],_0x2598f7[_0x78a6('0x57')]?JSON[_0x78a6('0x25')](_0x2598f7[_0x78a6('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x78a6('0x6a'),_0x3c145b);}return null;})['then'](function(_0x11b25a){var _0xdc205e=_0x78a6('0x6b')+_0x11b25a[_0x78a6('0x27')][_0x78a6('0x6c')];return db[_0x78a6('0x6d')][_0x78a6('0x42')](_0xdc205e,{'type':db['Sequelize'][_0x78a6('0x6e')][_0x78a6('0x6f')],'raw':!![]})[_0x78a6('0x20')](function(_0x53d886){return _0x53d886;});})['then'](function(_0x436729){if(_0x436729){_0x3c145b[_0x78a6('0x27')][_0x78a6('0x70')]=_0x436729[0x0];if(!_0x2598f7[_0x78a6('0x57')]['UserId'])return;return db['User'][_0x78a6('0x58')]({'where':{'id':_0x2598f7[_0x78a6('0x57')][_0x78a6('0x5f')],'role':_0x78a6('0x71')},'attributes':['id',_0x78a6('0x39'),'fullname',_0x78a6('0x72'),'internal'],'raw':!![]});}return null;})[_0x78a6('0x20')](function(_0x30e8d9){if(!_0x30e8d9)return null;_0x3c145b['message'][_0x78a6('0x71')]=_0x30e8d9;return _0x3c145b;})['then'](function(_0x435565){if(_0x435565){if(_0x2598f7[_0x78a6('0x57')]['manual']){_0x3c145b[_0x78a6('0x27')][_0x78a6('0x73')]=util[_0x78a6('0x66')]('SIP/%s',_0x2598f7[_0x78a6('0x60')]['name']);_0x3c145b[_0x78a6('0x27')][_0x78a6('0x74')]=_0x3c145b['channel'];_0x3c145b['message'][_0x78a6('0x75')]=_0x3c145b[_0x78a6('0x74')];_0x3c145b[_0x78a6('0x27')]['event']=_0x78a6('0x5b');return respondWithRpcPromise('EventManager',_0x78a6('0x76'),{'event':_0x78a6('0x77'),'message':_0x3c145b['message']},client9002)[_0x78a6('0x20')](function(){return _0x3c145b;});}return _0x3c145b;}return null;})[_0x78a6('0x20')](respondWithResult(_0x266db8,null))[_0x78a6('0x2a')](handleError(_0x266db8,null));};var interaction_log=require('../../config/logger')(_0x78a6('0x5a'));exports[_0x78a6('0x33')]=function(_0x382e5f,_0x18b6ee,_0x57e88a){var _0x262574={'agent':{},'channel':_0x78a6('0x78')};if(_0x382e5f[_0x78a6('0x57')]['id']){delete _0x382e5f[_0x78a6('0x57')]['id'];}_0x382e5f['body'][_0x78a6('0x5f')]=_0x382e5f['body'][_0x78a6('0x5f')]||_0x382e5f['user']['id'];_0x262574[_0x78a6('0x71')]['id']=_0x382e5f[_0x78a6('0x57')][_0x78a6('0x5f')];return db[_0x78a6('0x3c')][_0x78a6('0x58')]({'where':{'id':_0x382e5f[_0x78a6('0x54')]['id'],'UserId':null}})[_0x78a6('0x20')](handleEntityNotFound(_0x18b6ee,null))[_0x78a6('0x20')](function(_0x3c9592){if(_0x3c9592){_0x262574[_0x78a6('0x27')]=_0x3c9592[_0x78a6('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0x78a6('0x58')]({'where':{'id':_0x3c9592['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x18b6ee,null))[_0x78a6('0x20')](function(_0x128431){if(_0x128431){_0x262574[_0x78a6('0x69')]=_0x128431[_0x78a6('0x61')]({'plain':!![]});interaction_log['info'](_0x78a6('0x79'),_0x382e5f['user']['id'],_0x382e5f[_0x78a6('0x60')][_0x78a6('0x39')],_0x382e5f[_0x78a6('0x60')][_0x78a6('0x68')],_0x262574[_0x78a6('0x69')]['id'],_0x382e5f[_0x78a6('0x57')]?JSON[_0x78a6('0x25')](_0x382e5f['body']):_0x78a6('0x7a'));return respondWithRpcPromise(_0x78a6('0x7b'),_0x78a6('0x7c'),_0x262574);}return null;})[_0x78a6('0x20')](function(_0x442319){var _0x14ac4f=_0x78a6('0x6b')+_0x442319[_0x78a6('0x27')][_0x78a6('0x6c')];return db[_0x78a6('0x6d')]['query'](_0x14ac4f,{'type':db[_0x78a6('0x7d')][_0x78a6('0x6e')][_0x78a6('0x6f')],'raw':!![]})[_0x78a6('0x20')](function(_0x4aa065){return _0x4aa065;});})[_0x78a6('0x20')](function(_0x3e74bb){if(_0x3e74bb){_0x262574[_0x78a6('0x27')][_0x78a6('0x70')]=_0x3e74bb[0x0];if(!_0x382e5f[_0x78a6('0x57')][_0x78a6('0x5f')])return;return db[_0x78a6('0x7e')][_0x78a6('0x58')]({'where':{'id':_0x382e5f[_0x78a6('0x57')][_0x78a6('0x5f')],'role':_0x78a6('0x71')},'attributes':['id',_0x78a6('0x39'),_0x78a6('0x7f'),_0x78a6('0x72'),_0x78a6('0x80')],'raw':!![]});}return null;})[_0x78a6('0x20')](function(_0x34e8b8){if(!_0x34e8b8)return null;_0x262574['message']['agent']=_0x34e8b8;return _0x262574;})[_0x78a6('0x20')](function(_0x2788a3){if(_0x2788a3){_0x2788a3[_0x78a6('0x27')]['interface']=util['format'](_0x78a6('0x81'),_0x382e5f[_0x78a6('0x60')][_0x78a6('0x39')]);_0x2788a3[_0x78a6('0x27')][_0x78a6('0x74')]=_0x262574[_0x78a6('0x74')];_0x2788a3[_0x78a6('0x27')]['motionChannel']=_0x262574['channel'];_0x2788a3['message'][_0x78a6('0x82')]=_0x78a6('0x33');respondWithRpcPromise(_0x78a6('0x76'),'EventManager',{'event':_0x78a6('0x83'),'message':_0x2788a3[_0x78a6('0x27')]},client9002);return _0x262574;}return null;})[_0x78a6('0x20')](respondWithResult(_0x18b6ee,null))[_0x78a6('0x2a')](handleError(_0x18b6ee,null));};exports['status']=function(_0x4a6a24,_0x453cfe,_0x2a8b5a){if(_0x4a6a24['body']['id']){delete _0x4a6a24['body']['id'];}var _0x1658a1;return db[_0x78a6('0x3c')][_0x78a6('0x58')]({'where':{'id':_0x4a6a24[_0x78a6('0x54')]['id']}})[_0x78a6('0x20')](handleEntityNotFound(_0x453cfe,null))['then'](function(_0xea8b85){if(_0xea8b85){_0x1658a1=_0xea8b85;return db[_0x78a6('0x84')][_0x78a6('0x58')]({'where':{'id':_0xea8b85[_0x78a6('0x85')]}});}})[_0x78a6('0x20')](handleEntityNotFound(_0x453cfe,null))[_0x78a6('0x20')](function(_0x43d891){if(_0x43d891){logger[_0x78a6('0x23')](_0x78a6('0x86'),_0x78a6('0x2b'),_0x78a6('0x87'),_0x43d891[_0x78a6('0x3f')],util[_0x78a6('0x88')](_0x4a6a24[_0x78a6('0x57')],{'showHidden':![],'depth':null}));switch(_0x43d891[_0x78a6('0x3f')]){case'twilio':if(_0x4a6a24[_0x78a6('0x57')][_0x78a6('0x89')]&&_0x4a6a24[_0x78a6('0x57')][_0x78a6('0x89')]===_0x1658a1['messageId']&&_0x4a6a24[_0x78a6('0x57')][_0x78a6('0x8a')]&&_0x4a6a24[_0x78a6('0x57')][_0x78a6('0x8a')]===_0x78a6('0x5c')){return _0x1658a1[_0x78a6('0x35')]({'read':!![]});}else{logger[_0x78a6('0x26')](_0x78a6('0x8b'),_0x78a6('0x2b'),_0x78a6('0x8c'),util[_0x78a6('0x88')](_0x4a6a24['body'],{'showHidden':![],'depth':null}));}break;}return _0x1658a1;}})[_0x78a6('0x20')](respondWithResult(_0x453cfe,null))[_0x78a6('0x2a')](handleError(_0x453cfe,null));}; \ No newline at end of file +var _0x3eb4=['debug','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','show','params','find','create','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteraction','isNil','read1stAt','interaction','[WHATSAPPMESSAGE: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','ContactId','Sequelize','QueryTypes','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp','get','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','SELECT','email','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x3eb4,0x18b));var _0x43eb=function(_0x443692,_0x3633aa){_0x443692=_0x443692-0x0;var _0x52ab92=_0x3eb4[_0x443692];return _0x52ab92;};'use strict';var emlformat=require(_0x43eb('0x0'));var rimraf=require(_0x43eb('0x1'));var zipdir=require(_0x43eb('0x2'));var jsonpatch=require(_0x43eb('0x3'));var rp=require(_0x43eb('0x4'));var moment=require(_0x43eb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x43eb('0x6'));var util=require(_0x43eb('0x7'));var path=require('path');var sox=require(_0x43eb('0x8'));var csv=require(_0x43eb('0x9'));var ejs=require(_0x43eb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43eb('0xb'));var squel=require(_0x43eb('0xc'));var crypto=require(_0x43eb('0xd'));var jsforce=require(_0x43eb('0xe'));var deskjs=require(_0x43eb('0xf'));var toCsv=require(_0x43eb('0x9'));var querystring=require('querystring');var Papa=require(_0x43eb('0x10'));var Redis=require(_0x43eb('0x11'));var authService=require(_0x43eb('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43eb('0x13'));var logger=require(_0x43eb('0x14'))(_0x43eb('0x15'));var utils=require(_0x43eb('0x16'));var config=require(_0x43eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x43eb('0x18'))['db'];config[_0x43eb('0x19')]=_[_0x43eb('0x1a')](config[_0x43eb('0x19')],{'host':_0x43eb('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43eb('0x19')]));require(_0x43eb('0x1c'))[_0x43eb('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x43eb('0x1e')][_0x43eb('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x43eb('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x29c9ab,_0x1c220e,_0x575ccd,_0x5ad0f1){return new BPromise(function(_0x3051ca,_0x13b10b){var _0x46843=_0x5ad0f1||client;return _0x46843[_0x43eb('0x20')](_0x29c9ab,_0x575ccd)[_0x43eb('0x21')](function(_0x3e9e62){logger[_0x43eb('0x22')](_0x43eb('0x23'),_0x1c220e,_0x43eb('0x24'));logger[_0x43eb('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1c220e,_0x43eb('0x24'),JSON['stringify'](_0x3e9e62));if(_0x3e9e62[_0x43eb('0x26')]){if(_0x3e9e62[_0x43eb('0x26')]['code']===0x1f4){logger[_0x43eb('0x26')](_0x43eb('0x23'),_0x1c220e,_0x3e9e62[_0x43eb('0x26')][_0x43eb('0x27')]);return _0x13b10b(_0x3e9e62[_0x43eb('0x26')]['message']);}logger[_0x43eb('0x26')](_0x43eb('0x23'),_0x1c220e,_0x3e9e62['error'][_0x43eb('0x27')]);return _0x3051ca(_0x3e9e62['error'][_0x43eb('0x27')]);}else{logger[_0x43eb('0x22')](_0x43eb('0x23'),_0x1c220e,_0x43eb('0x24'));_0x3051ca(_0x3e9e62[_0x43eb('0x28')][_0x43eb('0x27')]);}})[_0x43eb('0x29')](function(_0x4d47fd){logger[_0x43eb('0x26')](_0x43eb('0x23'),_0x1c220e,_0x4d47fd);_0x13b10b(_0x4d47fd);});});}function respondWithStatusCode(_0x514f97,_0x23fd4e){_0x23fd4e=_0x23fd4e||0xcc;return function(_0x46cef0){if(_0x46cef0){return _0x514f97[_0x43eb('0x2a')](_0x23fd4e);}return _0x514f97[_0x43eb('0x2b')](_0x23fd4e)[_0x43eb('0x2c')]();};}function respondWithResult(_0xc3127b,_0xff6d0b){_0xff6d0b=_0xff6d0b||0xc8;return function(_0x4a00d0){if(_0x4a00d0){return _0xc3127b[_0x43eb('0x2b')](_0xff6d0b)[_0x43eb('0x2d')](_0x4a00d0);}};}function respondWithFilteredResult(_0x42fcb8,_0x564ed7){return function(_0x1a6e30){if(_0x1a6e30){var _0x16c692=typeof _0x564ed7[_0x43eb('0x2e')]==='undefined'&&typeof _0x564ed7[_0x43eb('0x2f')]==='undefined';var _0x527276=_0x1a6e30['count'];var _0x1ff6de=_0x16c692?0x0:_0x564ed7[_0x43eb('0x2e')];var _0x6f03a7=_0x16c692?_0x1a6e30[_0x43eb('0x30')]:_0x564ed7[_0x43eb('0x2e')]+_0x564ed7[_0x43eb('0x2f')];var _0x5cfc45;if(_0x6f03a7>=_0x527276){_0x6f03a7=_0x527276;_0x5cfc45=0xc8;}else{_0x5cfc45=0xce;}_0x42fcb8[_0x43eb('0x2b')](_0x5cfc45);return _0x42fcb8[_0x43eb('0x31')]('Content-Range',_0x1ff6de+'-'+_0x6f03a7+'/'+_0x527276)[_0x43eb('0x2d')](_0x1a6e30);}return null;};}function patchUpdates(_0x1275ce){return function(_0x508b57){try{jsonpatch[_0x43eb('0x32')](_0x508b57,_0x1275ce,!![]);}catch(_0x10631a){return BPromise[_0x43eb('0x33')](_0x10631a);}return _0x508b57[_0x43eb('0x34')]();};}function saveUpdates(_0x2d2ebc,_0x38d484){return function(_0xc9f73b){if(_0xc9f73b){return _0xc9f73b[_0x43eb('0x35')](_0x2d2ebc)[_0x43eb('0x21')](function(_0x2f9af2){return _0x2f9af2;});}return null;};}function removeEntity(_0x5856a3,_0x36295e){return function(_0x506e87){if(_0x506e87){return _0x506e87[_0x43eb('0x36')]()[_0x43eb('0x21')](function(){_0x5856a3['status'](0xcc)[_0x43eb('0x2c')]();});}};}function handleEntityNotFound(_0x12cbdc,_0x552bfc){return function(_0x1a7b3c){if(!_0x1a7b3c){_0x12cbdc[_0x43eb('0x2a')](0x194);}return _0x1a7b3c;};}function handleError(_0x39c21e,_0x525280){_0x525280=_0x525280||0x1f4;return function(_0x46df60){logger[_0x43eb('0x26')](_0x46df60[_0x43eb('0x37')]);if(_0x46df60[_0x43eb('0x38')]){delete _0x46df60[_0x43eb('0x38')];}_0x39c21e[_0x43eb('0x2b')](_0x525280)[_0x43eb('0x39')](_0x46df60);};}exports['index']=function(_0x93252a,_0x4f29bd){var _0x3b1021={},_0x39ab8c={},_0x2a22c0={'count':0x0,'rows':[]};var _0x20abb5=_[_0x43eb('0x3a')](db['WhatsappMessage'][_0x43eb('0x3b')],function(_0x55359c){return{'name':_0x55359c[_0x43eb('0x3c')],'type':_0x55359c[_0x43eb('0x3d')][_0x43eb('0x3e')]};});_0x39ab8c[_0x43eb('0x3f')]=_[_0x43eb('0x3a')](_0x20abb5,_0x43eb('0x38'));_0x39ab8c[_0x43eb('0x40')]=_[_0x43eb('0x41')](_0x93252a[_0x43eb('0x40')]);_0x39ab8c[_0x43eb('0x42')]=_[_0x43eb('0x43')](_0x39ab8c[_0x43eb('0x3f')],_0x39ab8c[_0x43eb('0x40')]);_0x3b1021[_0x43eb('0x44')]=_['intersection'](_0x39ab8c[_0x43eb('0x3f')],qs['fields'](_0x93252a[_0x43eb('0x40')][_0x43eb('0x45')]));_0x3b1021['attributes']=_0x3b1021['attributes'][_0x43eb('0x46')]?_0x3b1021[_0x43eb('0x44')]:_0x39ab8c[_0x43eb('0x3f')];if(!_0x93252a['query'][_0x43eb('0x47')](_0x43eb('0x48'))){_0x3b1021[_0x43eb('0x2f')]=qs[_0x43eb('0x2f')](_0x93252a[_0x43eb('0x40')][_0x43eb('0x2f')]);_0x3b1021['offset']=qs[_0x43eb('0x2e')](_0x93252a[_0x43eb('0x40')]['offset']);}_0x3b1021[_0x43eb('0x49')]=qs['sort'](_0x93252a[_0x43eb('0x40')][_0x43eb('0x4a')]);_0x3b1021[_0x43eb('0x4b')]=qs[_0x43eb('0x42')](_[_0x43eb('0x4c')](_0x93252a[_0x43eb('0x40')],_0x39ab8c[_0x43eb('0x42')]),_0x20abb5);if(_0x93252a['query'][_0x43eb('0x4d')]){_0x3b1021[_0x43eb('0x4b')]=_[_0x43eb('0x4e')](_0x3b1021[_0x43eb('0x4b')],{'$or':_[_0x43eb('0x3a')](_0x20abb5,function(_0x36a8ec){if(_0x36a8ec['type']!==_0x43eb('0x4f')){var _0x4ffd10={};_0x4ffd10[_0x36a8ec[_0x43eb('0x38')]]={'$like':'%'+_0x93252a[_0x43eb('0x40')][_0x43eb('0x4d')]+'%'};return _0x4ffd10;}})});}_0x3b1021=_[_0x43eb('0x4e')]({},_0x3b1021,_0x93252a[_0x43eb('0x50')]);var _0x150537={'where':_0x3b1021[_0x43eb('0x4b')]};return db[_0x43eb('0x51')][_0x43eb('0x30')](_0x150537)['then'](function(_0x13fae4){_0x2a22c0['count']=_0x13fae4;if(_0x93252a['query'][_0x43eb('0x52')]){_0x3b1021[_0x43eb('0x53')]=[{'all':!![]}];}return db[_0x43eb('0x51')][_0x43eb('0x54')](_0x3b1021);})[_0x43eb('0x21')](function(_0x1f9351){_0x2a22c0[_0x43eb('0x55')]=_0x1f9351;return _0x2a22c0;})['then'](respondWithFilteredResult(_0x4f29bd,_0x3b1021))['catch'](handleError(_0x4f29bd,null));};exports[_0x43eb('0x56')]=function(_0x286d33,_0x1f1b12){var _0x146ec9={'raw':!![],'where':{'id':_0x286d33[_0x43eb('0x57')]['id']}},_0x2920ff={};_0x2920ff[_0x43eb('0x3f')]=_[_0x43eb('0x41')](db[_0x43eb('0x51')][_0x43eb('0x3b')]);_0x2920ff['query']=_['keys'](_0x286d33['query']);_0x2920ff[_0x43eb('0x42')]=_[_0x43eb('0x43')](_0x2920ff[_0x43eb('0x3f')],_0x2920ff[_0x43eb('0x40')]);_0x146ec9[_0x43eb('0x44')]=_['intersection'](_0x2920ff['model'],qs[_0x43eb('0x45')](_0x286d33[_0x43eb('0x40')][_0x43eb('0x45')]));_0x146ec9[_0x43eb('0x44')]=_0x146ec9['attributes'][_0x43eb('0x46')]?_0x146ec9[_0x43eb('0x44')]:_0x2920ff['model'];if(_0x286d33['query'][_0x43eb('0x52')]){_0x146ec9[_0x43eb('0x53')]=[{'all':!![]}];}_0x146ec9=_[_0x43eb('0x4e')]({},_0x146ec9,_0x286d33[_0x43eb('0x50')]);return db[_0x43eb('0x51')][_0x43eb('0x58')](_0x146ec9)[_0x43eb('0x21')](handleEntityNotFound(_0x1f1b12,null))[_0x43eb('0x21')](respondWithResult(_0x1f1b12,null))[_0x43eb('0x29')](handleError(_0x1f1b12,null));};exports[_0x43eb('0x59')]=function(_0x4fa568,_0x2ca8b4){return db[_0x43eb('0x51')][_0x43eb('0x59')](_0x4fa568[_0x43eb('0x5a')],{})[_0x43eb('0x21')](respondWithResult(_0x2ca8b4,0xc9))[_0x43eb('0x29')](handleError(_0x2ca8b4,null));};exports[_0x43eb('0x35')]=function(_0x39a4fa,_0x5c3db7){if(_0x39a4fa[_0x43eb('0x5a')]['id']){delete _0x39a4fa[_0x43eb('0x5a')]['id'];}return db[_0x43eb('0x51')][_0x43eb('0x58')]({'where':{'id':_0x39a4fa['params']['id']}})[_0x43eb('0x21')](handleEntityNotFound(_0x5c3db7,null))[_0x43eb('0x21')](saveUpdates(_0x39a4fa[_0x43eb('0x5a')],null))[_0x43eb('0x21')](respondWithResult(_0x5c3db7,null))[_0x43eb('0x29')](handleError(_0x5c3db7,null));};exports[_0x43eb('0x36')]=function(_0x18d8ea,_0x4047f0){return db[_0x43eb('0x51')][_0x43eb('0x58')]({'where':{'id':_0x18d8ea['params']['id']}})[_0x43eb('0x21')](handleEntityNotFound(_0x4047f0,null))[_0x43eb('0x21')](removeEntity(_0x4047f0,null))[_0x43eb('0x29')](handleError(_0x4047f0,null));};exports[_0x43eb('0x5b')]=function(_0x416e25,_0x3e00e6){return db['WhatsappMessage'][_0x43eb('0x5b')]()[_0x43eb('0x21')](respondWithResult(_0x3e00e6,null))[_0x43eb('0x29')](handleError(_0x3e00e6,null));};var interaction_log=require(_0x43eb('0x14'))('whatsapp-interactions');exports[_0x43eb('0x5c')]=function(_0x141147,_0x533fa8,_0x302ee3){var _0x4979fd={'agent':{},'channel':'whatsapp'};if(_0x141147['body']['id']){delete _0x141147[_0x43eb('0x5a')]['id'];}_0x141147['body']['read']=!![];_0x141147[_0x43eb('0x5a')][_0x43eb('0x5d')]=moment()[_0x43eb('0x5e')](_0x43eb('0x5f'));_0x141147['body'][_0x43eb('0x60')]=_0x141147[_0x43eb('0x5a')][_0x43eb('0x60')]||_0x141147['user']['id'];_0x4979fd[_0x43eb('0x61')]['id']=_0x141147[_0x43eb('0x5a')]['UserId'];return db[_0x43eb('0x51')][_0x43eb('0x58')]({'where':{'id':_0x141147['params']['id'],'UserId':null}})[_0x43eb('0x21')](handleEntityNotFound(_0x533fa8,null))['then'](saveUpdates(_0x141147[_0x43eb('0x5a')],null))['then'](function(_0x5bea50){if(_0x5bea50){_0x4979fd[_0x43eb('0x27')]=_0x5bea50['get']({'plain':!![]});return db[_0x43eb('0x62')]['find']({'where':{'id':_0x5bea50['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x533fa8,null))[_0x43eb('0x21')](function(_0x3b4067){if(_0x3b4067){return _0x3b4067['update']({'UserId':_0x141147[_0x43eb('0x5a')][_0x43eb('0x60')],'read1stAt':_[_0x43eb('0x63')](_0x3b4067[_0x43eb('0x64')])?moment()[_0x43eb('0x5e')](_0x43eb('0x5f')):undefined});}return null;})['then'](function(_0x2144db){if(_0x2144db){_0x4979fd[_0x43eb('0x65')]=_0x2144db['get']({'plain':!![]});interaction_log[_0x43eb('0x22')](_0x43eb('0x66'),_0x141147['user']['id'],_0x141147[_0x43eb('0x67')]['name'],_0x141147[_0x43eb('0x67')]['role'],_0x4979fd[_0x43eb('0x65')]['id'],_0x141147[_0x43eb('0x5a')]?JSON[_0x43eb('0x68')](_0x141147[_0x43eb('0x5a')]):_0x43eb('0x69'));return respondWithRpcPromise(_0x43eb('0x6a'),_0x43eb('0x6b'),_0x4979fd);}return null;})['then'](function(_0x16c9a6){var _0x49d29c=_0x43eb('0x6c')+_0x16c9a6['message'][_0x43eb('0x6d')];return db['sequelize'][_0x43eb('0x40')](_0x49d29c,{'type':db[_0x43eb('0x6e')][_0x43eb('0x6f')]['SELECT'],'raw':!![]})[_0x43eb('0x21')](function(_0x24efb5){return _0x24efb5;});})[_0x43eb('0x21')](function(_0x189a93){if(_0x189a93){_0x4979fd[_0x43eb('0x27')][_0x43eb('0x70')]=_0x189a93[0x0];if(!_0x141147[_0x43eb('0x5a')][_0x43eb('0x60')])return;return db['User']['find']({'where':{'id':_0x141147[_0x43eb('0x5a')][_0x43eb('0x60')],'role':_0x43eb('0x61')},'attributes':['id','name',_0x43eb('0x71'),'email',_0x43eb('0x72')],'raw':!![]});}return null;})[_0x43eb('0x21')](function(_0x13e44c){if(!_0x13e44c)return null;_0x4979fd['message'][_0x43eb('0x61')]=_0x13e44c;return _0x4979fd;})[_0x43eb('0x21')](function(_0x4eafeb){if(_0x4eafeb){if(_0x141147[_0x43eb('0x5a')][_0x43eb('0x73')]){_0x4979fd[_0x43eb('0x27')][_0x43eb('0x74')]=util[_0x43eb('0x5e')](_0x43eb('0x75'),_0x141147['user'][_0x43eb('0x38')]);_0x4979fd[_0x43eb('0x27')][_0x43eb('0x76')]=_0x4979fd['channel'];_0x4979fd[_0x43eb('0x27')][_0x43eb('0x77')]=_0x4979fd[_0x43eb('0x76')];_0x4979fd[_0x43eb('0x27')][_0x43eb('0x78')]=_0x43eb('0x5c');return respondWithRpcPromise(_0x43eb('0x79'),_0x43eb('0x79'),{'event':_0x43eb('0x7a'),'message':_0x4979fd['message']},client9002)[_0x43eb('0x21')](function(){return _0x4979fd;});}return _0x4979fd;}return null;})['then'](respondWithResult(_0x533fa8,null))[_0x43eb('0x29')](handleError(_0x533fa8,null));};var interaction_log=require(_0x43eb('0x14'))('whatsapp-interactions');exports[_0x43eb('0x33')]=function(_0x291aba,_0x1a4beb,_0x5bbf96){var _0x34c89a={'agent':{},'channel':_0x43eb('0x7b')};if(_0x291aba['body']['id']){delete _0x291aba[_0x43eb('0x5a')]['id'];}_0x291aba[_0x43eb('0x5a')][_0x43eb('0x60')]=_0x291aba[_0x43eb('0x5a')][_0x43eb('0x60')]||_0x291aba[_0x43eb('0x67')]['id'];_0x34c89a[_0x43eb('0x61')]['id']=_0x291aba[_0x43eb('0x5a')][_0x43eb('0x60')];return db[_0x43eb('0x51')]['find']({'where':{'id':_0x291aba[_0x43eb('0x57')]['id'],'UserId':null}})[_0x43eb('0x21')](handleEntityNotFound(_0x1a4beb,null))[_0x43eb('0x21')](function(_0x4f270e){if(_0x4f270e){_0x34c89a['message']=_0x4f270e[_0x43eb('0x7c')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x4f270e[_0x43eb('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x1a4beb,null))[_0x43eb('0x21')](function(_0x54f374){if(_0x54f374){_0x34c89a[_0x43eb('0x65')]=_0x54f374[_0x43eb('0x7c')]({'plain':!![]});interaction_log[_0x43eb('0x22')](_0x43eb('0x7e'),_0x291aba[_0x43eb('0x67')]['id'],_0x291aba[_0x43eb('0x67')][_0x43eb('0x38')],_0x291aba[_0x43eb('0x67')][_0x43eb('0x7f')],_0x34c89a[_0x43eb('0x65')]['id'],_0x291aba['body']?JSON[_0x43eb('0x68')](_0x291aba[_0x43eb('0x5a')]):'null');return respondWithRpcPromise(_0x43eb('0x80'),_0x43eb('0x81'),_0x34c89a);}return null;})[_0x43eb('0x21')](function(_0x3f9fb9){var _0x54b8cb=_0x43eb('0x6c')+_0x3f9fb9[_0x43eb('0x27')][_0x43eb('0x6d')];return db[_0x43eb('0x82')]['query'](_0x54b8cb,{'type':db[_0x43eb('0x6e')][_0x43eb('0x6f')][_0x43eb('0x83')],'raw':!![]})['then'](function(_0x172fe7){return _0x172fe7;});})[_0x43eb('0x21')](function(_0x12c3d4){if(_0x12c3d4){_0x34c89a['message'][_0x43eb('0x70')]=_0x12c3d4[0x0];if(!_0x291aba[_0x43eb('0x5a')][_0x43eb('0x60')])return;return db['User'][_0x43eb('0x58')]({'where':{'id':_0x291aba[_0x43eb('0x5a')][_0x43eb('0x60')],'role':_0x43eb('0x61')},'attributes':['id',_0x43eb('0x38'),'fullname',_0x43eb('0x84'),'internal'],'raw':!![]});}return null;})[_0x43eb('0x21')](function(_0x1bd42c){if(!_0x1bd42c)return null;_0x34c89a[_0x43eb('0x27')][_0x43eb('0x61')]=_0x1bd42c;return _0x34c89a;})[_0x43eb('0x21')](function(_0x107499){if(_0x107499){_0x107499[_0x43eb('0x27')][_0x43eb('0x74')]=util[_0x43eb('0x5e')]('SIP/%s',_0x291aba[_0x43eb('0x67')][_0x43eb('0x38')]);_0x107499['message'][_0x43eb('0x76')]=_0x34c89a[_0x43eb('0x76')];_0x107499[_0x43eb('0x27')][_0x43eb('0x77')]=_0x34c89a[_0x43eb('0x76')];_0x107499[_0x43eb('0x27')][_0x43eb('0x78')]=_0x43eb('0x33');respondWithRpcPromise(_0x43eb('0x79'),'EventManager',{'event':_0x43eb('0x85'),'message':_0x107499[_0x43eb('0x27')]},client9002);return _0x34c89a;}return null;})[_0x43eb('0x21')](respondWithResult(_0x1a4beb,null))[_0x43eb('0x29')](handleError(_0x1a4beb,null));};exports[_0x43eb('0x2b')]=function(_0xa69742,_0x2e8525,_0x258952){if(_0xa69742[_0x43eb('0x5a')]['id']){delete _0xa69742['body']['id'];}var _0x455d7d;return db[_0x43eb('0x51')][_0x43eb('0x58')]({'where':{'id':_0xa69742[_0x43eb('0x57')]['id']}})[_0x43eb('0x21')](handleEntityNotFound(_0x2e8525,null))[_0x43eb('0x21')](function(_0x1799ee){if(_0x1799ee){_0x455d7d=_0x1799ee;return db[_0x43eb('0x86')][_0x43eb('0x58')]({'where':{'id':_0x1799ee[_0x43eb('0x87')]}});}})[_0x43eb('0x21')](handleEntityNotFound(_0x2e8525,null))[_0x43eb('0x21')](function(_0x26f03c){if(_0x26f03c){logger['debug'](_0x43eb('0x88'),_0x43eb('0x2b'),_0x43eb('0x89'),_0x26f03c['type'],util[_0x43eb('0x8a')](_0xa69742[_0x43eb('0x5a')],{'showHidden':![],'depth':null}));switch(_0x26f03c[_0x43eb('0x3d')]){case _0x43eb('0x8b'):if(_0xa69742[_0x43eb('0x5a')][_0x43eb('0x8c')]&&_0xa69742[_0x43eb('0x5a')][_0x43eb('0x8c')]===_0x455d7d[_0x43eb('0x8d')]&&_0xa69742[_0x43eb('0x5a')][_0x43eb('0x8e')]&&_0xa69742[_0x43eb('0x5a')][_0x43eb('0x8e')]==='read'){return _0x455d7d[_0x43eb('0x35')]({'read':!![]});}else{logger[_0x43eb('0x26')](_0x43eb('0x8f'),'status',_0x43eb('0x8b'),util['inspect'](_0xa69742[_0x43eb('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x455d7d;}})[_0x43eb('0x21')](respondWithResult(_0x2e8525,null))[_0x43eb('0x29')](handleError(_0x2e8525,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 4fbee6f..58275ee 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 _0x7894=['WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7894,0x170));var _0x4789=function(_0x2484fa,_0x120551){_0x2484fa=_0x2484fa-0x0;var _0x2dfe01=_0x7894[_0x2484fa];return _0x2dfe01;};'use strict';var EventEmitter=require(_0x4789('0x0'));var WhatsappMessage=require(_0x4789('0x1'))['db'][_0x4789('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4789('0x3')](0x0);var events={'afterCreate':_0x4789('0x4'),'afterUpdate':_0x4789('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4bd76){return function(_0x2b2dd3,_0x4e2393,_0x3394f6){WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76+':'+_0x2b2dd3['id'],_0x2b2dd3);WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76,_0x2b2dd3);_0x3394f6(null);};}for(var e in events){if(events[_0x4789('0x7')](e)){var event=events[e];WhatsappMessage[_0x4789('0x8')](e,emitEvent(event));}}module[_0x4789('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9348=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x1e7f5e,_0x1402ee){var _0x2bf6f0=function(_0x121711){while(--_0x121711){_0x1e7f5e['push'](_0x1e7f5e['shift']());}};_0x2bf6f0(++_0x1402ee);}(_0x9348,0x10d));var _0x8934=function(_0x69e4b8,_0x532555){_0x69e4b8=_0x69e4b8-0x0;var _0xea7bea=_0x9348[_0x69e4b8];return _0xea7bea;};'use strict';var EventEmitter=require(_0x8934('0x0'));var WhatsappMessage=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){WhatsappMessageEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);WhatsappMessageEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];WhatsappMessage[_0x8934('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 a9017ed..7709f6b 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 _0x2c22=['sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','WhatsappInteraction','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token='];(function(_0x2b9e35,_0x153b59){var _0x4ca96f=function(_0x593467){while(--_0x593467){_0x2b9e35['push'](_0x2b9e35['shift']());}};_0x4ca96f(++_0x153b59);}(_0x2c22,0x1cc));var _0x22c2=function(_0xff4be2,_0x49b57b){_0xff4be2=_0xff4be2-0x0;var _0x366430=_0x2c22[_0xff4be2];return _0x366430;};'use strict';var _=require('lodash');var util=require(_0x22c2('0x0'));var logger=require(_0x22c2('0x1'))(_0x22c2('0x2'));var moment=require(_0x22c2('0x3'));var BPromise=require(_0x22c2('0x4'));var rp=require(_0x22c2('0x5'));var fetch=require(_0x22c2('0x6'));var fs=require('fs');var path=require(_0x22c2('0x7'));var rimraf=require(_0x22c2('0x8'));var config=require(_0x22c2('0x9'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x59b5fd,_0x22a991){return _0x59b5fd[_0x22c2('0xa')](_0x22c2('0xb'),attributes,{'tableName':_0x22c2('0xc'),'paranoid':![],'indexes':[{'name':_0x22c2('0xd'),'fields':['messageId']},{'name':_0x22c2('0xe'),'fields':[_0x22c2('0xf')],'type':_0x22c2('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28d320,_0xa0c991,_0x5c1234){var _0xd3d2cb=_0x59b5fd[_0x22c2('0x11')];var _0x396b0b=_0x28d320[_0x22c2('0x12')]({'plain':!![]});if(_0x396b0b['direction'][_0x22c2('0x13')]()==='in'||_0x396b0b[_0x22c2('0x14')]['toLowerCase']()===_0x22c2('0x15')&&!_0x396b0b[_0x22c2('0x16')]&&!_[_0x22c2('0x17')](_0x396b0b['UserId'])){_0xd3d2cb[_0x22c2('0x18')]['findOne']({'where':{'id':_0x396b0b[_0x22c2('0x19')]}})['then'](function(_0x144ade){if(_0x144ade){_0x144ade[_0x22c2('0x1a')]({'lastMsgAt':_0x396b0b[_0x22c2('0x1b')],'lastMsgDirection':_0x396b0b[_0x22c2('0x14')]['toLowerCase']()});}})[_0x22c2('0x1c')](function(_0x5074b4){console[_0x22c2('0x1d')](_0x5074b4);});}if(_0x396b0b[_0x22c2('0x14')]===_0x22c2('0x15')&&!_0x396b0b[_0x22c2('0x16')]){var _0x30b164;_0xd3d2cb[_0x22c2('0x1e')]['find']({'where':{'id':_0x396b0b[_0x22c2('0x1f')]},'raw':!![]})[_0x22c2('0x20')](function(_0x35448d){_0x30b164=_0x35448d;if(_0x30b164&&_0x30b164[_0x22c2('0x21')]){switch(_0x30b164[_0x22c2('0x21')]){case'twilio':var _0xc0ff18=require(_0x22c2('0x22'));if(_0x30b164[_0x22c2('0x23')]&&_0x30b164[_0x22c2('0x24')]&&_0x30b164['phone']){var _0x323960=new _0xc0ff18(_0x30b164[_0x22c2('0x23')],_0x30b164[_0x22c2('0x24')]);_0x323960[_0x22c2('0x25')][_0x22c2('0x26')]({'body':_0x396b0b[_0x22c2('0xf')],'to':_0x22c2('0x27')+_0x396b0b[_0x22c2('0x28')],'from':_0x22c2('0x27')+_0x30b164[_0x22c2('0x28')],'statusCallback':_0x30b164[_0x22c2('0x29')]+_0x22c2('0x2a')+_0x396b0b['id']+_0x22c2('0x2b')+_0x30b164['token']})[_0x22c2('0x20')](function(_0x5e9607){if(_0x5e9607['sid']){return _0x28d320[_0x22c2('0x1a')]({'messageId':_0x5e9607[_0x22c2('0x2c')]});}})[_0x22c2('0x1c')](function(_0x4fa45a){logger[_0x22c2('0x1d')](_0x22c2('0x2d'),_0x22c2('0x2e'),_0x22c2('0x22'),util[_0x22c2('0x2f')](_0x4fa45a,{'showHidden':![],'depth':null}));});}else{logger[_0x22c2('0x1d')](_0x22c2('0x2d'),'afterCreate','twilio',_0x22c2('0x30'));}break;case _0x22c2('0x31'):var _0x2ab67f=_0x30b164[_0x22c2('0x23')];var _0x1a4727=_0x30b164[_0x22c2('0x24')];var _0x55e4f3=_0x30b164[_0x22c2('0x32')]+_0x22c2('0x33')+_0x2ab67f+_0x22c2('0x34');var _0xf52d88={'to':[_0x396b0b['phone']],'message':{'type':_0x22c2('0x35'),'text':_0x396b0b[_0x22c2('0xf')]}};var _0x19064d={'method':'POST','uri':_0x55e4f3,'headers':{'Authorization':_0x22c2('0x36')+_0x1a4727,'Content-Type':_0x22c2('0x37')},'body':_0xf52d88,'json':!![]};rp(_0x19064d)[_0x22c2('0x20')](function(_0x2a1f25){if(_0x2a1f25[_0x22c2('0x38')][0x0]['message_id']){return _0x28d320[_0x22c2('0x1a')]({'messageId':_0x2a1f25['statuses'][0x0][_0x22c2('0x39')]});}})[_0x22c2('0x1c')](function(_0x1aecd6){logger[_0x22c2('0x3a')](_0x22c2('0x3b'),_0x1aecd6);});break;}}})[_0x22c2('0x3c')](function(){_0x5c1234();});}else{_0x5c1234();}}},'charset':_0x22c2('0x3d'),'collate':_0x22c2('0x3e')});}; \ No newline at end of file +var _0x0a21=['util','api','moment','request-promise','node-fetch','path','rimraf','../../config/environment','exports','WhatsappMessage','whatsapp_messages','messageId','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','token','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/whatsapp/v1/','text','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci'];(function(_0x3faedd,_0x2ab6ed){var _0x21e754=function(_0x41240f){while(--_0x41240f){_0x3faedd['push'](_0x3faedd['shift']());}};_0x21e754(++_0x2ab6ed);}(_0x0a21,0x9f));var _0x10a2=function(_0x173ade,_0x4a3d16){_0x173ade=_0x173ade-0x0;var _0x7f7ac3=_0x0a21[_0x173ade];return _0x7f7ac3;};'use strict';var _=require('lodash');var util=require(_0x10a2('0x0'));var logger=require('../../config/logger')(_0x10a2('0x1'));var moment=require(_0x10a2('0x2'));var BPromise=require('bluebird');var rp=require(_0x10a2('0x3'));var fetch=require(_0x10a2('0x4'));var fs=require('fs');var path=require(_0x10a2('0x5'));var rimraf=require(_0x10a2('0x6'));var config=require(_0x10a2('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x10a2('0x8')]=function(_0x4d14d0,_0x33f92b){return _0x4d14d0['define'](_0x10a2('0x9'),attributes,{'tableName':_0x10a2('0xa'),'paranoid':![],'indexes':[{'name':_0x10a2('0xb'),'fields':[_0x10a2('0xb')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x10a2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b2c5b,_0x49f346,_0x517e41){var _0x133e77=_0x4d14d0[_0x10a2('0xd')];var _0x14982e=_0x5b2c5b[_0x10a2('0xe')]({'plain':!![]});if(_0x14982e[_0x10a2('0xf')][_0x10a2('0x10')]()==='in'||_0x14982e[_0x10a2('0xf')]['toLowerCase']()===_0x10a2('0x11')&&!_0x14982e[_0x10a2('0x12')]&&!_[_0x10a2('0x13')](_0x14982e['UserId'])){_0x133e77[_0x10a2('0x14')][_0x10a2('0x15')]({'where':{'id':_0x14982e['WhatsappInteractionId']}})['then'](function(_0x53b3d9){if(_0x53b3d9){_0x53b3d9[_0x10a2('0x16')]({'lastMsgAt':_0x14982e[_0x10a2('0x17')],'lastMsgDirection':_0x14982e['direction']['toLowerCase']()});}})[_0x10a2('0x18')](function(_0x4b1e5e){console[_0x10a2('0x19')](_0x4b1e5e);});}if(_0x14982e[_0x10a2('0xf')]===_0x10a2('0x11')&&!_0x14982e[_0x10a2('0x12')]){var _0x480593;_0x133e77[_0x10a2('0x1a')][_0x10a2('0x1b')]({'where':{'id':_0x14982e[_0x10a2('0x1c')]},'raw':!![]})['then'](function(_0x40edda){_0x480593=_0x40edda;if(_0x480593&&_0x480593[_0x10a2('0x1d')]){switch(_0x480593[_0x10a2('0x1d')]){case _0x10a2('0x1e'):var _0x1ad14d=require('twilio');if(_0x480593[_0x10a2('0x1f')]&&_0x480593[_0x10a2('0x20')]&&_0x480593[_0x10a2('0x21')]){var _0x39bc2a=new _0x1ad14d(_0x480593[_0x10a2('0x1f')],_0x480593[_0x10a2('0x20')]);_0x39bc2a['messages'][_0x10a2('0x22')]({'body':_0x14982e['body'],'to':_0x10a2('0x23')+_0x14982e[_0x10a2('0x21')],'from':'whatsapp:'+_0x480593['phone'],'statusCallback':_0x480593[_0x10a2('0x24')]+'/api/whatsapp/messages/'+_0x14982e['id']+'/status?token='+_0x480593[_0x10a2('0x25')]})[_0x10a2('0x26')](function(_0xcb2e5f){if(_0xcb2e5f[_0x10a2('0x27')]){return _0x5b2c5b[_0x10a2('0x16')]({'messageId':_0xcb2e5f[_0x10a2('0x27')]});}})[_0x10a2('0x18')](function(_0x4fd10b){logger[_0x10a2('0x19')](_0x10a2('0x28'),'afterCreate',_0x10a2('0x1e'),util['inspect'](_0x4fd10b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10a2('0x28'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x10a2('0x29'):var _0x4f1262=_0x480593['accountSid'];var _0xfb84e7=_0x480593[_0x10a2('0x20')];var _0x5c8ce4=_0x480593[_0x10a2('0x2a')]+_0x10a2('0x2b')+_0x4f1262+'/messages/';var _0x5eb1a4={'to':[_0x14982e['phone']],'message':{'type':_0x10a2('0x2c'),'text':_0x14982e['body']}};var _0x639c0c={'method':_0x10a2('0x2d'),'uri':_0x5c8ce4,'headers':{'Authorization':'Bearer\x20'+_0xfb84e7,'Content-Type':_0x10a2('0x2e')},'body':_0x5eb1a4,'json':!![]};rp(_0x639c0c)[_0x10a2('0x26')](function(_0x2a71a1){if(_0x2a71a1[_0x10a2('0x2f')][0x0][_0x10a2('0x30')]){return _0x5b2c5b[_0x10a2('0x16')]({'messageId':_0x2a71a1[_0x10a2('0x2f')][0x0][_0x10a2('0x30')]});}})[_0x10a2('0x18')](function(_0xf41c75){logger[_0x10a2('0x31')](_0x10a2('0x32'),_0xf41c75);});break;}}})[_0x10a2('0x33')](function(){_0x517e41();});}else{_0x517e41();}}},'charset':'utf8mb4','collate':_0x10a2('0x34')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index ddb47a6..558bd7c 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 _0x4187=['request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register'];(function(_0x4314c4,_0x4a21db){var _0x315931=function(_0x38e0c7){while(--_0x38e0c7){_0x4314c4['push'](_0x4314c4['shift']());}};_0x315931(++_0x4a21db);}(_0x4187,0x1f1));var _0x7418=function(_0x253e8c,_0x4bbb88){_0x253e8c=_0x253e8c-0x0;var _0x4afcf0=_0x4187[_0x253e8c];return _0x4afcf0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7418('0x0'));var BPromise=require(_0x7418('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7418('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7418('0x3'))(_0x7418('0x4'));var config=require(_0x7418('0x5'));var jayson=require(_0x7418('0x6'));var client=jayson['client'][_0x7418('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7418('0x8')],{'host':_0x7418('0x9'),'port':0x18eb});var socket=require(_0x7418('0xa'))(new Redis(config[_0x7418('0x8')]));require(_0x7418('0xb'))[_0x7418('0xc')](socket);function respondWithRpcPromise(_0x667d2f,_0x2d15ab,_0x4d9b62){return new BPromise(function(_0x5e3b67,_0x23eeec){return client[_0x7418('0xd')](_0x667d2f,_0x4d9b62)[_0x7418('0xe')](function(_0x299814){logger[_0x7418('0xf')](_0x7418('0x10'),_0x2d15ab,_0x7418('0x11'));logger[_0x7418('0x12')](_0x7418('0x13'),_0x2d15ab,_0x7418('0x11'),JSON[_0x7418('0x14')](_0x299814));if(_0x299814[_0x7418('0x15')]){if(_0x299814['error']['code']===0x1f4){logger[_0x7418('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x2d15ab,_0x299814[_0x7418('0x15')]['message']);return _0x23eeec(_0x299814[_0x7418('0x15')][_0x7418('0x16')]);}logger[_0x7418('0x15')](_0x7418('0x10'),_0x2d15ab,_0x299814['error'][_0x7418('0x16')]);return _0x5e3b67(_0x299814[_0x7418('0x15')][_0x7418('0x16')]);}else{logger['info'](_0x7418('0x10'),_0x2d15ab,'request\x20sent');_0x5e3b67(_0x299814['result'][_0x7418('0x16')]);}})[_0x7418('0x17')](function(_0x1e54bd){logger['error'](_0x7418('0x10'),_0x2d15ab,_0x1e54bd);_0x23eeec(_0x1e54bd);});});}exports[_0x7418('0x18')]=function(_0x2ad0f9){var _0x30390a=this;return new Promise(function(_0x46f5c8,_0x469933){return db[_0x7418('0x19')][_0x7418('0x1a')](_0x2ad0f9[_0x7418('0x1b')],{'raw':_0x2ad0f9[_0x7418('0x1c')]?_0x2ad0f9['options'][_0x7418('0x1d')]===undefined?!![]:![]:!![]})[_0x7418('0xe')](function(_0x571ad3){logger[_0x7418('0xf')](_0x7418('0x18'),_0x2ad0f9);logger['debug']('CreateWhatsappMessage',_0x2ad0f9,JSON[_0x7418('0x14')](_0x571ad3));_0x46f5c8(_0x571ad3);})[_0x7418('0x17')](function(_0x260c65){logger[_0x7418('0x15')]('CreateWhatsappMessage',_0x260c65[_0x7418('0x16')],_0x2ad0f9);_0x469933(_0x30390a[_0x7418('0x15')](0x1f4,_0x260c65[_0x7418('0x16')]));});});}; \ No newline at end of file +var _0x02d4=['redis','localhost','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults'];(function(_0x449a8c,_0x2158c5){var _0x5b1dc4=function(_0xa3522f){while(--_0xa3522f){_0x449a8c['push'](_0x449a8c['shift']());}};_0x5b1dc4(++_0x2158c5);}(_0x02d4,0xd5));var _0x402d=function(_0x4cec50,_0x58e03a){_0x4cec50=_0x4cec50-0x0;var _0x18e53e=_0x02d4[_0x4cec50];return _0x18e53e;};'use strict';var _=require(_0x402d('0x0'));var util=require(_0x402d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x402d('0x2'));var fs=require('fs');var Redis=require(_0x402d('0x3'));var db=require(_0x402d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x402d('0x5'))(_0x402d('0x6'));var config=require(_0x402d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x402d('0x8')][_0x402d('0x9')]({'port':0x232a});config['redis']=_[_0x402d('0xa')](config[_0x402d('0xb')],{'host':_0x402d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x402d('0xb')]));require(_0x402d('0xd'))[_0x402d('0xe')](socket);function respondWithRpcPromise(_0x283803,_0x320564,_0x2f93df){return new BPromise(function(_0x294bf4,_0x828047){return client['request'](_0x283803,_0x2f93df)[_0x402d('0xf')](function(_0x4a6acb){logger[_0x402d('0x10')](_0x402d('0x11'),_0x320564,_0x402d('0x12'));logger[_0x402d('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x320564,_0x402d('0x12'),JSON[_0x402d('0x14')](_0x4a6acb));if(_0x4a6acb['error']){if(_0x4a6acb['error'][_0x402d('0x15')]===0x1f4){logger[_0x402d('0x16')](_0x402d('0x11'),_0x320564,_0x4a6acb[_0x402d('0x16')]['message']);return _0x828047(_0x4a6acb[_0x402d('0x16')][_0x402d('0x17')]);}logger[_0x402d('0x16')](_0x402d('0x11'),_0x320564,_0x4a6acb['error'][_0x402d('0x17')]);return _0x294bf4(_0x4a6acb[_0x402d('0x16')][_0x402d('0x17')]);}else{logger[_0x402d('0x10')](_0x402d('0x11'),_0x320564,_0x402d('0x12'));_0x294bf4(_0x4a6acb[_0x402d('0x18')][_0x402d('0x17')]);}})['catch'](function(_0xd4e34c){logger['error'](_0x402d('0x11'),_0x320564,_0xd4e34c);_0x828047(_0xd4e34c);});});}exports[_0x402d('0x19')]=function(_0x4289c7){var _0x5ed9eb=this;return new Promise(function(_0x228749,_0x147ce5){return db[_0x402d('0x1a')][_0x402d('0x1b')](_0x4289c7[_0x402d('0x1c')],{'raw':_0x4289c7['options']?_0x4289c7[_0x402d('0x1d')][_0x402d('0x1e')]===undefined?!![]:![]:!![]})[_0x402d('0xf')](function(_0x32f6da){logger[_0x402d('0x10')](_0x402d('0x19'),_0x4289c7);logger[_0x402d('0x13')](_0x402d('0x19'),_0x4289c7,JSON[_0x402d('0x14')](_0x32f6da));_0x228749(_0x32f6da);})[_0x402d('0x1f')](function(_0x1e1003){logger[_0x402d('0x16')](_0x402d('0x19'),_0x1e1003[_0x402d('0x17')],_0x4289c7);_0x147ce5(_0x5ed9eb[_0x402d('0x16')](0x1f4,_0x1e1003['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index cea603a..4eb5f36 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 _0xc0a0=['update','emit','removeListener','register','./whatsappMessage.events','save','remove'];(function(_0x540160,_0x24c6b6){var _0x476120=function(_0x28046c){while(--_0x28046c){_0x540160['push'](_0x540160['shift']());}};_0x476120(++_0x24c6b6);}(_0xc0a0,0x89));var _0x0c0a=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xc0a0[_0x334841];return _0x5beb4b;};'use strict';var WhatsappMessageEvents=require(_0x0c0a('0x0'));var events=[_0x0c0a('0x1'),_0x0c0a('0x2'),_0x0c0a('0x3')];function createListener(_0x37b75a,_0x5c4c74){return function(_0x12135b){_0x5c4c74[_0x0c0a('0x4')](_0x37b75a,_0x12135b);};}function removeListener(_0x3f0f0a,_0x43b4a6){return function(){WhatsappMessageEvents[_0x0c0a('0x5')](_0x3f0f0a,_0x43b4a6);};}exports[_0x0c0a('0x6')]=function(_0x5b002b){for(var _0x2d2313=0x0,_0x86b79c=events['length'];_0x2d2313<_0x86b79c;_0x2d2313++){var _0x1313b0=events[_0x2d2313];var _0x2dc145=createListener('whatsappMessage:'+_0x1313b0,_0x5b002b);WhatsappMessageEvents['on'](_0x1313b0,_0x2dc145);}}; \ No newline at end of file +var _0xfef5=['save','remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfef5,0x100));var _0x5fef=function(_0x4ee01f,_0x10da10){_0x4ee01f=_0x4ee01f-0x0;var _0x554f06=_0xfef5[_0x4ee01f];return _0x554f06;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x5fef('0x0'),_0x5fef('0x1'),_0x5fef('0x2')];function createListener(_0x161430,_0x2310ba){return function(_0x22fec2){_0x2310ba[_0x5fef('0x3')](_0x161430,_0x22fec2);};}function removeListener(_0x26d503,_0x196063){return function(){WhatsappMessageEvents[_0x5fef('0x4')](_0x26d503,_0x196063);};}exports[_0x5fef('0x5')]=function(_0x2f659b){for(var _0x55b23d=0x0,_0x2f0ed2=events[_0x5fef('0x6')];_0x55b23d<_0x2f0ed2;_0x55b23d++){var _0x1b51b9=events[_0x55b23d];var _0x4972e2=createListener(_0x5fef('0x7')+_0x1b51b9,_0x2f659b);WhatsappMessageEvents['on'](_0x1b51b9,_0x4972e2);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 893f3f2..7739442 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 _0x27a9=['get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeAgents','multer','util','connect-timeout','../../config/environment','./whatsappQueue.controller'];(function(_0x5195c8,_0x3f6c7b){var _0x25bd63=function(_0x2be82f){while(--_0x2be82f){_0x5195c8['push'](_0x5195c8['shift']());}};_0x25bd63(++_0x3f6c7b);}(_0x27a9,0x73));var _0x927a=function(_0x118330,_0x507391){_0x118330=_0x118330-0x0;var _0x142964=_0x27a9[_0x118330];return _0x142964;};'use strict';var multer=require(_0x927a('0x0'));var util=require(_0x927a('0x1'));var path=require('path');var timeout=require(_0x927a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x927a('0x3'));var controller=require(_0x927a('0x4'));router[_0x927a('0x5')]('/',auth[_0x927a('0x6')](),controller[_0x927a('0x7')]);router['get'](_0x927a('0x8'),auth[_0x927a('0x6')](),controller[_0x927a('0x9')]);router[_0x927a('0x5')]('/:id',auth[_0x927a('0x6')](),controller[_0x927a('0xa')]);router[_0x927a('0x5')](_0x927a('0xb'),auth[_0x927a('0x6')](),controller['getMembers']);router[_0x927a('0x5')](_0x927a('0xc'),auth['isAuthenticated'](),controller[_0x927a('0xd')]);router['get'](_0x927a('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0x927a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x927a('0xf')](_0x927a('0xc'),auth[_0x927a('0x6')](),controller[_0x927a('0x10')]);router['post'](_0x927a('0xe'),auth[_0x927a('0x6')](),controller[_0x927a('0x11')]);router[_0x927a('0x12')](_0x927a('0x13'),auth['isAuthenticated'](),controller[_0x927a('0x14')]);router[_0x927a('0x15')](_0x927a('0x13'),auth['isAuthenticated'](),controller[_0x927a('0x16')]);router['delete'](_0x927a('0xc'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x927a('0x15')](_0x927a('0xe'),auth[_0x927a('0x6')](),controller[_0x927a('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0e4e=['/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe'];(function(_0x551b66,_0x24d43d){var _0x3028aa=function(_0x6097d8){while(--_0x6097d8){_0x551b66['push'](_0x551b66['shift']());}};_0x3028aa(++_0x24d43d);}(_0x0e4e,0xb8));var _0xe0e4=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0x0e4e[_0x1655bb];return _0x5e2020;};'use strict';var multer=require('multer');var util=require(_0xe0e4('0x0'));var path=require(_0xe0e4('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0e4('0x2'));var router=express[_0xe0e4('0x3')]();var fs_extra=require(_0xe0e4('0x4'));var auth=require(_0xe0e4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0e4('0x6'));var controller=require(_0xe0e4('0x7'));router[_0xe0e4('0x8')]('/',auth[_0xe0e4('0x9')](),controller[_0xe0e4('0xa')]);router[_0xe0e4('0x8')]('/describe',auth[_0xe0e4('0x9')](),controller[_0xe0e4('0xb')]);router['get'](_0xe0e4('0xc'),auth[_0xe0e4('0x9')](),controller['show']);router[_0xe0e4('0x8')](_0xe0e4('0xd'),auth[_0xe0e4('0x9')](),controller[_0xe0e4('0xe')]);router[_0xe0e4('0x8')](_0xe0e4('0xf'),auth[_0xe0e4('0x9')](),controller[_0xe0e4('0x10')]);router[_0xe0e4('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xe0e4('0x11')]);router[_0xe0e4('0x12')]('/',auth[_0xe0e4('0x9')](),controller[_0xe0e4('0x13')]);router[_0xe0e4('0x12')](_0xe0e4('0xf'),auth['isAuthenticated'](),controller[_0xe0e4('0x14')]);router[_0xe0e4('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xe0e4('0x15')]);router[_0xe0e4('0x16')](_0xe0e4('0xc'),auth[_0xe0e4('0x9')](),controller[_0xe0e4('0x17')]);router[_0xe0e4('0x18')]('/:id',auth[_0xe0e4('0x9')](),controller[_0xe0e4('0x19')]);router[_0xe0e4('0x18')](_0xe0e4('0xf'),auth[_0xe0e4('0x9')](),controller[_0xe0e4('0x1a')]);router[_0xe0e4('0x18')]('/:id/users',auth[_0xe0e4('0x9')](),controller['removeAgents']);module[_0xe0e4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 36d3ed6..ad08180 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 _0x63eb=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4b147e,_0x12e97c){var _0x28d903=function(_0x58d345){while(--_0x58d345){_0x4b147e['push'](_0x4b147e['shift']());}};_0x28d903(++_0x12e97c);}(_0x63eb,0x90));var _0xb63e=function(_0x293557,_0x6812df){_0x293557=_0x293557-0x0;var _0x366e5b=_0x63eb[_0x293557];return _0x366e5b;};'use strict';var Sequelize=require(_0xb63e('0x0'));module[_0xb63e('0x1')]={'name':{'type':Sequelize[_0xb63e('0x2')],'unique':_0xb63e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb63e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb63e('0x5')](_0xb63e('0x6'),_0xb63e('0x7'),_0xb63e('0x8'))},'description':{'type':Sequelize[_0xb63e('0x2')]}}; \ No newline at end of file +var _0xf430=['STRING','INTEGER','ENUM','roundrobin','sequelize','exports'];(function(_0x2474c4,_0x1269eb){var _0x5bfd1b=function(_0x13cdaa){while(--_0x13cdaa){_0x2474c4['push'](_0x2474c4['shift']());}};_0x5bfd1b(++_0x1269eb);}(_0xf430,0x1e4));var _0x0f43=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0xf430[_0x81f000];return _0x337aa2;};'use strict';var Sequelize=require(_0x0f43('0x0'));module[_0x0f43('0x1')]={'name':{'type':Sequelize[_0x0f43('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0f43('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0f43('0x4')]('rrmemory','beepall',_0x0f43('0x5'))},'description':{'type':Sequelize[_0x0f43('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e440324..35af274 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 _0x16b0=['show','params','find','create','body','user','role','get','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','addTeams','ids','Team','findAll','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','field','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','userWhatsappQueue:remove','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','undefined','limit','offset','count','reject','save','update','then','destroy','WhatsappQueues','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4b4471,_0x4d37a1){var _0x136b9f=function(_0x365b00){while(--_0x365b00){_0x4b4471['push'](_0x4b4471['shift']());}};_0x136b9f(++_0x4d37a1);}(_0x16b0,0x1da));var _0x016b=function(_0xac1075,_0x18252b){_0xac1075=_0xac1075-0x0;var _0x4001f0=_0x16b0[_0xac1075];return _0x4001f0;};'use strict';var emlformat=require(_0x016b('0x0'));var rimraf=require(_0x016b('0x1'));var zipdir=require(_0x016b('0x2'));var jsonpatch=require(_0x016b('0x3'));var rp=require(_0x016b('0x4'));var moment=require('moment');var BPromise=require(_0x016b('0x5'));var Mustache=require(_0x016b('0x6'));var util=require(_0x016b('0x7'));var path=require(_0x016b('0x8'));var sox=require(_0x016b('0x9'));var csv=require('to-csv');var ejs=require(_0x016b('0xa'));var fs=require('fs');var fs_extra=require(_0x016b('0xb'));var _=require(_0x016b('0xc'));var squel=require(_0x016b('0xd'));var crypto=require(_0x016b('0xe'));var jsforce=require(_0x016b('0xf'));var deskjs=require(_0x016b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x016b('0x11'));var Papa=require(_0x016b('0x12'));var Redis=require(_0x016b('0x13'));var authService=require(_0x016b('0x14'));var qs=require(_0x016b('0x15'));var as=require(_0x016b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x016b('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x016b('0x18'));var licenseUtil=require(_0x016b('0x19'));var db=require(_0x016b('0x1a'))['db'];config[_0x016b('0x1b')]=_[_0x016b('0x1c')](config[_0x016b('0x1b')],{'host':_0x016b('0x1d'),'port':0x18eb});var socket=require(_0x016b('0x1e'))(new Redis(config['redis']));require(_0x016b('0x1f'))[_0x016b('0x20')](socket);function respondWithStatusCode(_0x2fda4c,_0x4ea7be){_0x4ea7be=_0x4ea7be||0xcc;return function(_0x185e7b){if(_0x185e7b){return _0x2fda4c[_0x016b('0x21')](_0x4ea7be);}return _0x2fda4c['status'](_0x4ea7be)[_0x016b('0x22')]();};}function respondWithResult(_0x23e662,_0x5f356c){_0x5f356c=_0x5f356c||0xc8;return function(_0x441367){if(_0x441367){return _0x23e662[_0x016b('0x23')](_0x5f356c)[_0x016b('0x24')](_0x441367);}};}function respondWithFilteredResult(_0x11b225,_0x4e3032){return function(_0x5aa29a){if(_0x5aa29a){var _0x3f4fb7=typeof _0x4e3032['offset']===_0x016b('0x25')&&typeof _0x4e3032[_0x016b('0x26')]==='undefined';var _0x85a7d6=_0x5aa29a['count'];var _0x583dc1=_0x3f4fb7?0x0:_0x4e3032[_0x016b('0x27')];var _0xa71695=_0x3f4fb7?_0x5aa29a[_0x016b('0x28')]:_0x4e3032[_0x016b('0x27')]+_0x4e3032[_0x016b('0x26')];var _0x5cca28;if(_0xa71695>=_0x85a7d6){_0xa71695=_0x85a7d6;_0x5cca28=0xc8;}else{_0x5cca28=0xce;}_0x11b225['status'](_0x5cca28);return _0x11b225['set']('Content-Range',_0x583dc1+'-'+_0xa71695+'/'+_0x85a7d6)['json'](_0x5aa29a);}return null;};}function patchUpdates(_0x5be857){return function(_0x400e2f){try{jsonpatch['apply'](_0x400e2f,_0x5be857,!![]);}catch(_0x435c08){return BPromise[_0x016b('0x29')](_0x435c08);}return _0x400e2f[_0x016b('0x2a')]();};}function saveUpdates(_0x2677d3,_0x3f0845){return function(_0x3cd4d7){if(_0x3cd4d7){return _0x3cd4d7[_0x016b('0x2b')](_0x2677d3)[_0x016b('0x2c')](function(_0x4dcaa1){return _0x4dcaa1;});}return null;};}function removeEntity(_0x5eaa4a,_0x2dc4ca){return function(_0x2a36c6){if(_0x2a36c6){return _0x2a36c6[_0x016b('0x2d')]()['then'](function(){var _0xc9eb8b=_0x2a36c6['get']({'plain':!![]});var _0x22bc89=_0x016b('0x2e');return db['UserProfileResource'][_0x016b('0x2d')]({'where':{'type':_0x22bc89,'resourceId':_0xc9eb8b['id']}})[_0x016b('0x2c')](function(){return _0x2a36c6;});})[_0x016b('0x2c')](function(){_0x5eaa4a['status'](0xcc)[_0x016b('0x22')]();});}};}function handleEntityNotFound(_0x133838,_0x32fdd9){return function(_0x4c977a){if(!_0x4c977a){_0x133838['sendStatus'](0x194);}return _0x4c977a;};}function handleError(_0x38d52a,_0xf793de){_0xf793de=_0xf793de||0x1f4;return function(_0x5648b4){logger['error'](_0x5648b4['stack']);if(_0x5648b4[_0x016b('0x2f')]){delete _0x5648b4[_0x016b('0x2f')];}_0x38d52a[_0x016b('0x23')](_0xf793de)[_0x016b('0x30')](_0x5648b4);};}exports[_0x016b('0x31')]=function(_0x191bf4,_0x9e2cc8){var _0x1c720d={},_0x3db598={},_0xeeb506={'count':0x0,'rows':[]};var _0x283262=_[_0x016b('0x32')](db[_0x016b('0x33')][_0x016b('0x34')],function(_0x1e728a){return{'name':_0x1e728a[_0x016b('0x35')],'type':_0x1e728a[_0x016b('0x36')][_0x016b('0x37')]};});_0x3db598[_0x016b('0x38')]=_[_0x016b('0x32')](_0x283262,_0x016b('0x2f'));_0x3db598['query']=_[_0x016b('0x39')](_0x191bf4[_0x016b('0x3a')]);_0x3db598[_0x016b('0x3b')]=_[_0x016b('0x3c')](_0x3db598[_0x016b('0x38')],_0x3db598['query']);_0x1c720d['attributes']=_['intersection'](_0x3db598[_0x016b('0x38')],qs[_0x016b('0x3d')](_0x191bf4['query']['fields']));_0x1c720d['attributes']=_0x1c720d[_0x016b('0x3e')][_0x016b('0x3f')]?_0x1c720d[_0x016b('0x3e')]:_0x3db598[_0x016b('0x38')];if(!_0x191bf4[_0x016b('0x3a')][_0x016b('0x40')](_0x016b('0x41'))){_0x1c720d[_0x016b('0x26')]=qs['limit'](_0x191bf4[_0x016b('0x3a')][_0x016b('0x26')]);_0x1c720d[_0x016b('0x27')]=qs[_0x016b('0x27')](_0x191bf4[_0x016b('0x3a')][_0x016b('0x27')]);}_0x1c720d[_0x016b('0x42')]=qs[_0x016b('0x43')](_0x191bf4[_0x016b('0x3a')][_0x016b('0x43')]);_0x1c720d[_0x016b('0x44')]=qs[_0x016b('0x3b')](_[_0x016b('0x45')](_0x191bf4['query'],_0x3db598[_0x016b('0x3b')]),_0x283262);if(_0x191bf4['query'][_0x016b('0x46')]){_0x1c720d['where']=_[_0x016b('0x47')](_0x1c720d['where'],{'$or':_[_0x016b('0x32')](_0x283262,function(_0x3628b4){if(_0x3628b4['type']!==_0x016b('0x48')){var _0x14bcca={};_0x14bcca[_0x3628b4[_0x016b('0x2f')]]={'$like':'%'+_0x191bf4['query'][_0x016b('0x46')]+'%'};return _0x14bcca;}})});}_0x1c720d=_[_0x016b('0x47')]({},_0x1c720d,_0x191bf4[_0x016b('0x49')]);var _0x10d4af={'where':_0x1c720d[_0x016b('0x44')]};return db[_0x016b('0x33')][_0x016b('0x28')](_0x10d4af)[_0x016b('0x2c')](function(_0x2c01f4){_0xeeb506[_0x016b('0x28')]=_0x2c01f4;if(_0x191bf4['query'][_0x016b('0x4a')]){_0x1c720d[_0x016b('0x4b')]=[{'all':!![]}];}return db[_0x016b('0x33')]['findAll'](_0x1c720d);})[_0x016b('0x2c')](function(_0x218ccb){_0xeeb506[_0x016b('0x4c')]=_0x218ccb;return _0xeeb506;})[_0x016b('0x2c')](respondWithFilteredResult(_0x9e2cc8,_0x1c720d))[_0x016b('0x4d')](handleError(_0x9e2cc8,null));};exports[_0x016b('0x4e')]=function(_0x1ae48c,_0x16b515){var _0x48cda1={'raw':!![],'where':{'id':_0x1ae48c[_0x016b('0x4f')]['id']}},_0x113069={};_0x113069[_0x016b('0x38')]=_[_0x016b('0x39')](db[_0x016b('0x33')][_0x016b('0x34')]);_0x113069['query']=_[_0x016b('0x39')](_0x1ae48c[_0x016b('0x3a')]);_0x113069[_0x016b('0x3b')]=_[_0x016b('0x3c')](_0x113069['model'],_0x113069[_0x016b('0x3a')]);_0x48cda1[_0x016b('0x3e')]=_['intersection'](_0x113069[_0x016b('0x38')],qs[_0x016b('0x3d')](_0x1ae48c[_0x016b('0x3a')]['fields']));_0x48cda1['attributes']=_0x48cda1[_0x016b('0x3e')][_0x016b('0x3f')]?_0x48cda1[_0x016b('0x3e')]:_0x113069[_0x016b('0x38')];if(_0x1ae48c[_0x016b('0x3a')]['includeAll']){_0x48cda1['include']=[{'all':!![]}];}_0x48cda1=_['merge']({},_0x48cda1,_0x1ae48c['options']);return db[_0x016b('0x33')][_0x016b('0x50')](_0x48cda1)[_0x016b('0x2c')](handleEntityNotFound(_0x16b515,null))[_0x016b('0x2c')](respondWithResult(_0x16b515,null))['catch'](handleError(_0x16b515,null));};exports[_0x016b('0x51')]=function(_0x4df6a0,_0x431701){return db[_0x016b('0x33')][_0x016b('0x51')](_0x4df6a0[_0x016b('0x52')],{})[_0x016b('0x2c')](function(_0x5d8da8){var _0x50c68d=_0x4df6a0[_0x016b('0x53')]['get']({'plain':!![]});if(!_0x50c68d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50c68d[_0x016b('0x54')]===_0x016b('0x53')){var _0x10d737=_0x5d8da8[_0x016b('0x55')]({'plain':!![]});var _0x5086ec=_0x016b('0x2e');return db[_0x016b('0x56')][_0x016b('0x50')]({'where':{'name':_0x5086ec,'userProfileId':_0x50c68d[_0x016b('0x57')]},'raw':!![]})[_0x016b('0x2c')](function(_0x12cbb2){if(_0x12cbb2&&_0x12cbb2['autoAssociation']===0x0){return db['UserProfileResource'][_0x016b('0x51')]({'name':_0x10d737[_0x016b('0x2f')],'resourceId':_0x10d737['id'],'type':_0x12cbb2[_0x016b('0x2f')],'sectionId':_0x12cbb2['id']},{})[_0x016b('0x2c')](function(){return _0x5d8da8;});}else{return _0x5d8da8;}})[_0x016b('0x4d')](function(_0x1a81b0){logger[_0x016b('0x58')](_0x016b('0x59'),_0x1a81b0);throw _0x1a81b0;});}return _0x5d8da8;})[_0x016b('0x2c')](respondWithResult(_0x431701,0xc9))[_0x016b('0x4d')](handleError(_0x431701,null));};exports[_0x016b('0x2b')]=function(_0x27297d,_0x2e36fe){if(_0x27297d[_0x016b('0x52')]['id']){delete _0x27297d[_0x016b('0x52')]['id'];}return db[_0x016b('0x33')]['find']({'where':{'id':_0x27297d['params']['id']}})['then'](handleEntityNotFound(_0x2e36fe,null))[_0x016b('0x2c')](saveUpdates(_0x27297d[_0x016b('0x52')],null))[_0x016b('0x2c')](respondWithResult(_0x2e36fe,null))[_0x016b('0x4d')](handleError(_0x2e36fe,null));};exports[_0x016b('0x2d')]=function(_0x2e7e59,_0x117959){return db[_0x016b('0x33')][_0x016b('0x50')]({'where':{'id':_0x2e7e59[_0x016b('0x4f')]['id']}})[_0x016b('0x2c')](handleEntityNotFound(_0x117959,null))['then'](removeEntity(_0x117959,null))[_0x016b('0x4d')](handleError(_0x117959,null));};exports[_0x016b('0x5a')]=function(_0x283371,_0x49224b){return db[_0x016b('0x33')][_0x016b('0x5a')]()[_0x016b('0x2c')](respondWithResult(_0x49224b,null))[_0x016b('0x4d')](handleError(_0x49224b,null));};exports['getMembers']=function(_0x13d791,_0x2c3db9,_0x137516){var _0x19abb7={'raw':!![],'where':{}},_0xf24cff={},_0x4a3427;return db[_0x016b('0x33')]['findOne']({'where':{'id':_0x13d791['params']['id']}})[_0x016b('0x2c')](handleEntityNotFound(_0x2c3db9,null))[_0x016b('0x2c')](function(_0x1aa27c){if(_0x1aa27c){_0x4a3427=_0x1aa27c[_0x016b('0x55')]({'plain':!![]});_0xf24cff[_0x016b('0x38')]=_[_0x016b('0x39')](db[_0x016b('0x5b')][_0x016b('0x34')]);_0xf24cff[_0x016b('0x3a')]=_[_0x016b('0x39')](_0x13d791['query']);_0xf24cff[_0x016b('0x3b')]=_[_0x016b('0x3c')](_0xf24cff[_0x016b('0x38')],_0xf24cff[_0x016b('0x3a')]);_0x19abb7[_0x016b('0x3e')]=_[_0x016b('0x3c')](_0xf24cff['model'],qs[_0x016b('0x3d')](_0x13d791[_0x016b('0x3a')][_0x016b('0x3d')]));_0x19abb7[_0x016b('0x3e')]=_0x19abb7[_0x016b('0x3e')][_0x016b('0x3f')]?_0x19abb7['attributes']:_0xf24cff[_0x016b('0x38')];if(!_0x13d791[_0x016b('0x3a')][_0x016b('0x40')](_0x016b('0x41'))){_0x19abb7['limit']=qs[_0x016b('0x26')](_0x13d791[_0x016b('0x3a')][_0x016b('0x26')]);_0x19abb7['offset']=qs[_0x016b('0x27')](_0x13d791['query'][_0x016b('0x27')]);}_0x19abb7[_0x016b('0x42')]=qs[_0x016b('0x43')](_0x13d791['query'][_0x016b('0x43')]);_0x19abb7[_0x016b('0x44')]=qs[_0x016b('0x3b')](_[_0x016b('0x45')](_0x13d791[_0x016b('0x3a')],_0xf24cff[_0x016b('0x3b')]));_0x19abb7[_0x016b('0x44')][_0x016b('0x5c')]=_0x1aa27c['id'];if(_0x13d791['query'][_0x016b('0x46')]){_0x19abb7['where']=_[_0x016b('0x47')](_0x19abb7[_0x016b('0x44')],{'$or':_[_0x016b('0x32')](_0x19abb7['attributes'],function(_0x1c73b8){var _0x892c3a={};_0x892c3a[_0x1c73b8]={'$like':'%'+_0x13d791[_0x016b('0x3a')][_0x016b('0x46')]+'%'};return _0x892c3a;})});}_0x19abb7=_[_0x016b('0x47')]({},_0x19abb7,_0x13d791['options']);return db[_0x016b('0x5b')]['findAll'](_0x19abb7);}})['then'](function(_0x418323){if(_0x418323){return db[_0x016b('0x5d')][_0x016b('0x5e')]({'where':{'id':_[_0x016b('0x32')](_0x418323,_0x016b('0x5f')),'role':_0x016b('0x60')},'attributes':['id','name',_0x016b('0x61'),_0x016b('0x62'),'createdAt']});}})[_0x016b('0x2c')](function(_0x5bc4eb){if(_0x5bc4eb){return{'count':_0x5bc4eb[_0x016b('0x28')],'rows':_['map'](_0x5bc4eb[_0x016b('0x4c')],function(_0x52da4b){return{'membername':_0x52da4b[_0x016b('0x2f')],'UserId':_0x52da4b['id'],'queue_name':_0x4a3427['name'],'WhatsappQueueId':_0x4a3427['id'],'interface':util['format']('%s/%s','SIP',_0x52da4b['name']),'penalty':0x0,'paused':_0x52da4b[_0x016b('0x61')],'createdAt':_0x52da4b[_0x016b('0x63')],'updatedAt':_0x52da4b[_0x016b('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2c3db9,_0x19abb7))['catch'](handleError(_0x2c3db9,null));};exports['getTeams']=function(_0x3388c2,_0x28b077,_0x34099e){var _0x12daa7={};var _0x5e17a2={};var _0x564869;var _0x26ae9b;return db[_0x016b('0x33')]['findOne']({'where':{'id':_0x3388c2[_0x016b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x28b077,null))[_0x016b('0x2c')](function(_0x44c928){if(_0x44c928){_0x564869=_0x44c928;_0x5e17a2[_0x016b('0x38')]=_[_0x016b('0x39')](db['Team'][_0x016b('0x34')]);_0x5e17a2[_0x016b('0x3a')]=_[_0x016b('0x39')](_0x3388c2[_0x016b('0x3a')]);_0x5e17a2[_0x016b('0x3b')]=_[_0x016b('0x3c')](_0x5e17a2[_0x016b('0x38')],_0x5e17a2[_0x016b('0x3a')]);_0x12daa7[_0x016b('0x3e')]=_[_0x016b('0x3c')](_0x5e17a2[_0x016b('0x38')],qs[_0x016b('0x3d')](_0x3388c2[_0x016b('0x3a')]['fields']));_0x12daa7['attributes']=_0x12daa7[_0x016b('0x3e')][_0x016b('0x3f')]?_0x12daa7[_0x016b('0x3e')]:_0x5e17a2[_0x016b('0x38')];_0x12daa7[_0x016b('0x42')]=qs['sort'](_0x3388c2[_0x016b('0x3a')][_0x016b('0x43')]);_0x12daa7['where']=qs[_0x016b('0x3b')](_[_0x016b('0x45')](_0x3388c2[_0x016b('0x3a')],_0x5e17a2['filters']));if(_0x3388c2[_0x016b('0x3a')][_0x016b('0x46')]){_0x12daa7['where']=_['merge'](_0x12daa7[_0x016b('0x44')],{'$or':_[_0x016b('0x32')](_0x12daa7[_0x016b('0x3e')],function(_0x486b23){var _0x3dd0c3={};_0x3dd0c3[_0x486b23]={'$like':'%'+_0x3388c2[_0x016b('0x3a')][_0x016b('0x46')]+'%'};return _0x3dd0c3;})});}_0x12daa7=_[_0x016b('0x47')]({},_0x12daa7,_0x3388c2[_0x016b('0x49')]);return _0x564869['getTeams'](_0x12daa7);}})[_0x016b('0x2c')](function(_0x46920e){if(_0x46920e){_0x26ae9b=_0x46920e[_0x016b('0x3f')];if(!_0x3388c2[_0x016b('0x3a')]['hasOwnProperty'](_0x016b('0x41'))){_0x12daa7['limit']=qs['limit'](_0x3388c2[_0x016b('0x3a')][_0x016b('0x26')]);_0x12daa7['offset']=qs[_0x016b('0x27')](_0x3388c2[_0x016b('0x3a')][_0x016b('0x27')]);}return _0x564869['getTeams'](_0x12daa7);}})[_0x016b('0x2c')](function(_0x2258b7){if(_0x2258b7){return _0x2258b7?{'count':_0x26ae9b,'rows':_0x2258b7}:null;}})[_0x016b('0x2c')](respondWithResult(_0x28b077,null))[_0x016b('0x4d')](handleError(_0x28b077,null));};exports[_0x016b('0x64')]=function(_0x3221b5,_0x6d02fc,_0x2590aa){var _0x3ae79b=_0x3221b5[_0x016b('0x52')][_0x016b('0x65')];return db[_0x016b('0x66')][_0x016b('0x67')]({'where':{'id':_0x3ae79b},'attributes':['id'],'include':[{'model':db[_0x016b('0x5d')],'as':_0x016b('0x68'),'attributes':['id',_0x016b('0x2f'),_0x016b('0x69'),_0x016b('0x6a'),_0x016b('0x6b')],'raw':!![]}]})[_0x016b('0x2c')](function(_0x2ed12b){if(_0x2ed12b){var _0x8ecd7a=_[_0x016b('0x6c')](_0x2ed12b,function(_0x39719b){var _0x6ff3d9=_0x39719b[_0x016b('0x55')]({'plain':!![]});return _0x6ff3d9[_0x016b('0x68')];});return db['WhatsappQueue']['find']({'where':{'id':_0x3221b5['params']['id']}})[_0x016b('0x2c')](function(_0x4e7c92){return db['sequelize'][_0x016b('0x6d')](function(_0x130821){return _0x4e7c92[_0x016b('0x64')](_0x3ae79b,{'transaction':_0x130821})['then'](function(){return BPromise[_0x016b('0x6e')](_0x8ecd7a,function(_0x13b2ca){return db['UserWhatsappQueue'][_0x016b('0x6f')]({'where':{'UserId':_0x13b2ca['id'],'WhatsappQueueId':_0x3221b5[_0x016b('0x4f')]['id']},'transaction':_0x130821});});})[_0x016b('0x2c')](function(){_0x8ecd7a[_0x016b('0x70')](function(_0x3593f7){socket[_0x016b('0x71')](_0x016b('0x72'),{'UserId':_0x3593f7['id'],'WhatsappQueueId':_0x4e7c92['id']});});});});});}})[_0x016b('0x2c')](respondWithStatusCode(_0x6d02fc,null))[_0x016b('0x4d')](handleError(_0x6d02fc,null));};exports['removeTeams']=function(_0x55741a,_0x2cad24,_0x2e3262){return db[_0x016b('0x66')][_0x016b('0x67')]({'where':{'id':_0x55741a[_0x016b('0x3a')][_0x016b('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2cad24,null))[_0x016b('0x2c')](function(_0x6c185b){var _0x154590=_[_0x016b('0x32')](_0x6c185b,'id');var _0x52dc28=[];var _0x1024bb=[];var _0x11e267=squel['select']();_0x11e267[_0x016b('0x73')]('tq.TeamId')['from'](_0x016b('0x74'),'tq')['join']('user_has_teams','ut',_0x016b('0x75'))[_0x016b('0x44')]('WhatsappQueueId\x20=\x20?',_0x55741a[_0x016b('0x4f')]['id']);for(var _0x39acf9=0x0;_0x39acf9<_0x6c185b[_0x016b('0x3f')];_0x39acf9+=0x1){let _0x1ae5be=_0x6c185b[_0x39acf9];for(var _0x51128f=0x0;_0x51128f<_0x1ae5be[_0x016b('0x68')][_0x016b('0x3f')];_0x51128f+=0x1){let _0x4aaaf1=_0x1ae5be['Agents'][_0x51128f];var _0x4979a8=_0x11e267[_0x016b('0x76')]();_0x4979a8[_0x016b('0x44')](_0x016b('0x77'),_0x4aaaf1['id']);_0x1024bb[_0x016b('0x78')](db[_0x016b('0x79')][_0x016b('0x3a')](_0x4979a8[_0x016b('0x7a')](),{'type':db['sequelize'][_0x016b('0x7b')]['SELECT']})['then'](function(_0x4c39d3){if(_0x4c39d3[_0x016b('0x3f')]===0x1){return _0x4aaaf1['id'];}else{var _0x45f41d=_['every'](_[_0x016b('0x32')](_0x4c39d3,_0x016b('0x7c')),function(_0x2b799f){return _[_0x016b('0x7d')](_0x154590,_0x2b799f);});if(_0x45f41d){return _0x4aaaf1['id'];}}}));}}return BPromise[_0x016b('0x7e')](_0x1024bb)['then'](function(_0x2e93cb){_0x52dc28=_(_0x52dc28)[_0x016b('0x7f')](_0x2e93cb)[_0x016b('0x80')]()[_0x016b('0x81')]();return db[_0x016b('0x33')][_0x016b('0x50')]({'where':{'id':_0x55741a[_0x016b('0x4f')]['id']}})[_0x016b('0x2c')](function(_0x65538b){return db['sequelize'][_0x016b('0x6d')](function(_0x59eee7){return _0x65538b['removeTeams'](_0x55741a[_0x016b('0x3a')][_0x016b('0x65')],{'transaction':_0x59eee7})[_0x016b('0x2c')](function(){if(!_[_0x016b('0x82')](_0x52dc28)){return _0x65538b[_0x016b('0x83')](_0x52dc28,{'transaction':_0x59eee7});}})[_0x016b('0x2c')](function(){_0x52dc28[_0x016b('0x70')](function(_0x54e769){socket[_0x016b('0x71')]('userWhatsappQueue:remove',{'UserId':_0x54e769,'WhatsappQueueId':_0x65538b['id']});});});});});});})['then'](respondWithStatusCode(_0x2cad24,null))[_0x016b('0x4d')](handleError(_0x2cad24,null));};exports[_0x016b('0x84')]=function(_0x58807c,_0x9d9b46,_0x318f2f){return db[_0x016b('0x33')][_0x016b('0x50')]({'where':{'id':_0x58807c[_0x016b('0x4f')]['id']}})[_0x016b('0x2c')](handleEntityNotFound(_0x9d9b46,null))[_0x016b('0x2c')](function(_0x3e8868){if(_0x3e8868){return _0x3e8868['addAgents'](_0x58807c['body'][_0x016b('0x65')],_[_0x016b('0x85')](_0x58807c[_0x016b('0x52')],[_0x016b('0x65'),'id'])||{})['spread'](function(_0x407136){for(var _0x1a3ee5=0x0;_0x1a3ee5<_0x58807c[_0x016b('0x52')][_0x016b('0x65')]['length'];_0x1a3ee5+=0x1){socket[_0x016b('0x71')](_0x016b('0x72'),{'UserId':Number(_0x58807c[_0x016b('0x52')][_0x016b('0x65')][_0x1a3ee5]),'WhatsappQueueId':Number(_0x58807c[_0x016b('0x4f')]['id'])});}return _0x407136;});}})[_0x016b('0x2c')](respondWithResult(_0x9d9b46,null))['catch'](handleError(_0x9d9b46,null));};exports[_0x016b('0x83')]=function(_0xca7220,_0x248fc2,_0x3c8122){return db[_0x016b('0x33')][_0x016b('0x50')]({'where':{'id':_0xca7220[_0x016b('0x4f')]['id']}})[_0x016b('0x2c')](handleEntityNotFound(_0x248fc2,null))[_0x016b('0x2c')](function(_0x1c599f){if(_0x1c599f){return _0x1c599f['removeAgents'](_0xca7220['query'][_0x016b('0x65')])['then'](function(){if(_[_0x016b('0x86')](_0xca7220[_0x016b('0x3a')][_0x016b('0x65')])){for(var _0x1c2d4d=0x0;_0x1c2d4d<_0xca7220['query'][_0x016b('0x65')][_0x016b('0x3f')];_0x1c2d4d+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0xca7220['query'][_0x016b('0x65')][_0x1c2d4d]),'WhatsappQueueId':Number(_0xca7220['params']['id'])});}}else{socket[_0x016b('0x71')](_0x016b('0x87'),{'UserId':Number(_0xca7220['query'][_0x016b('0x65')]),'WhatsappQueueId':Number(_0xca7220['params']['id'])});}});}})['then'](respondWithStatusCode(_0x248fc2,null))[_0x016b('0x4d')](handleError(_0x248fc2,null));};exports[_0x016b('0x88')]=function(_0x38f332,_0x326e91,_0x404f38){var _0x10f73e={};var _0x2c2ce3={};var _0x46b02f;var _0x4840ff;return db[_0x016b('0x33')][_0x016b('0x89')]({'where':{'id':_0x38f332[_0x016b('0x4f')]['id']}})[_0x016b('0x2c')](handleEntityNotFound(_0x326e91,null))[_0x016b('0x2c')](function(_0x352372){if(_0x352372){_0x46b02f=_0x352372;_0x2c2ce3['model']=_['keys'](db[_0x016b('0x5d')][_0x016b('0x34')]);_0x2c2ce3[_0x016b('0x3a')]=_[_0x016b('0x39')](_0x38f332[_0x016b('0x3a')]);_0x2c2ce3['filters']=_[_0x016b('0x3c')](_0x2c2ce3[_0x016b('0x38')],_0x2c2ce3['query']);_0x10f73e[_0x016b('0x3e')]=_[_0x016b('0x3c')](_0x2c2ce3['model'],qs[_0x016b('0x3d')](_0x38f332['query'][_0x016b('0x3d')]));_0x10f73e['attributes']=_0x10f73e['attributes']['length']?_0x10f73e[_0x016b('0x3e')]:_0x2c2ce3[_0x016b('0x38')];_0x10f73e[_0x016b('0x42')]=qs[_0x016b('0x43')](_0x38f332[_0x016b('0x3a')][_0x016b('0x43')]);_0x10f73e[_0x016b('0x44')]=qs['filters'](_[_0x016b('0x45')](_0x38f332[_0x016b('0x3a')],_0x2c2ce3[_0x016b('0x3b')]));if(_0x38f332[_0x016b('0x3a')][_0x016b('0x46')]){_0x10f73e[_0x016b('0x44')]=_[_0x016b('0x47')](_0x10f73e[_0x016b('0x44')],{'$or':_['map'](_0x10f73e[_0x016b('0x3e')],function(_0x55cb81){var _0x43f230={};_0x43f230[_0x55cb81]={'$like':'%'+_0x38f332[_0x016b('0x3a')][_0x016b('0x46')]+'%'};return _0x43f230;})});}_0x10f73e=_['merge']({},_0x10f73e,_0x38f332[_0x016b('0x49')]);return _0x46b02f[_0x016b('0x88')](_0x10f73e);}})[_0x016b('0x2c')](function(_0x16812e){if(_0x16812e){_0x4840ff=_0x16812e[_0x016b('0x3f')];if(!_0x38f332['query']['hasOwnProperty'](_0x016b('0x41'))){_0x10f73e[_0x016b('0x26')]=qs[_0x016b('0x26')](_0x38f332['query']['limit']);_0x10f73e[_0x016b('0x27')]=qs[_0x016b('0x27')](_0x38f332['query']['offset']);}return _0x46b02f['getAgents'](_0x10f73e);}})[_0x016b('0x2c')](function(_0x1e6d53){if(_0x1e6d53){return _0x1e6d53?{'count':_0x4840ff,'rows':_0x1e6d53}:null;}})['then'](respondWithResult(_0x326e91,null))[_0x016b('0x4d')](handleError(_0x326e91,null));}; \ No newline at end of file +var _0xeaea=['select','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','value','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','get','WhatsappQueues','UserProfileResource','then','end','error','name','send','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','pick','findAndCountAll','agent','updatedAt','format','getTeams','nolimit','addTeams','User','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','ids'];(function(_0x509dcd,_0x19d0db){var _0x2de47e=function(_0x49202f){while(--_0x49202f){_0x509dcd['push'](_0x509dcd['shift']());}};_0x2de47e(++_0x19d0db);}(_0xeaea,0x118));var _0xaeae=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xeaea[_0x2db12b];return _0x20990b;};'use strict';var emlformat=require(_0xaeae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaeae('0x1'));var jsonpatch=require(_0xaeae('0x2'));var rp=require(_0xaeae('0x3'));var moment=require(_0xaeae('0x4'));var BPromise=require(_0xaeae('0x5'));var Mustache=require(_0xaeae('0x6'));var util=require(_0xaeae('0x7'));var path=require(_0xaeae('0x8'));var sox=require(_0xaeae('0x9'));var csv=require(_0xaeae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaeae('0xb'));var _=require(_0xaeae('0xc'));var squel=require(_0xaeae('0xd'));var crypto=require(_0xaeae('0xe'));var jsforce=require(_0xaeae('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xaeae('0xa'));var querystring=require(_0xaeae('0x10'));var Papa=require(_0xaeae('0x11'));var Redis=require('ioredis');var authService=require(_0xaeae('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaeae('0x13'));var logger=require('../../config/logger')(_0xaeae('0x14'));var utils=require(_0xaeae('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaeae('0x16'));var db=require(_0xaeae('0x17'))['db'];config[_0xaeae('0x18')]=_[_0xaeae('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaeae('0x1a'))(new Redis(config[_0xaeae('0x18')]));require(_0xaeae('0x1b'))[_0xaeae('0x1c')](socket);function respondWithStatusCode(_0x1e0825,_0x128866){_0x128866=_0x128866||0xcc;return function(_0x3226d3){if(_0x3226d3){return _0x1e0825[_0xaeae('0x1d')](_0x128866);}return _0x1e0825[_0xaeae('0x1e')](_0x128866)['end']();};}function respondWithResult(_0x297641,_0x479a26){_0x479a26=_0x479a26||0xc8;return function(_0x46cb02){if(_0x46cb02){return _0x297641['status'](_0x479a26)[_0xaeae('0x1f')](_0x46cb02);}};}function respondWithFilteredResult(_0x1d783a,_0x472ce8){return function(_0x2b086a){if(_0x2b086a){var _0x3b5045=typeof _0x472ce8['offset']===_0xaeae('0x20')&&typeof _0x472ce8[_0xaeae('0x21')]===_0xaeae('0x20');var _0x1179e4=_0x2b086a[_0xaeae('0x22')];var _0x239fc3=_0x3b5045?0x0:_0x472ce8['offset'];var _0x59775c=_0x3b5045?_0x2b086a[_0xaeae('0x22')]:_0x472ce8[_0xaeae('0x23')]+_0x472ce8[_0xaeae('0x21')];var _0x2a8c3b;if(_0x59775c>=_0x1179e4){_0x59775c=_0x1179e4;_0x2a8c3b=0xc8;}else{_0x2a8c3b=0xce;}_0x1d783a[_0xaeae('0x1e')](_0x2a8c3b);return _0x1d783a[_0xaeae('0x24')](_0xaeae('0x25'),_0x239fc3+'-'+_0x59775c+'/'+_0x1179e4)[_0xaeae('0x1f')](_0x2b086a);}return null;};}function patchUpdates(_0x440707){return function(_0x4e010e){try{jsonpatch[_0xaeae('0x26')](_0x4e010e,_0x440707,!![]);}catch(_0x8b38b2){return BPromise[_0xaeae('0x27')](_0x8b38b2);}return _0x4e010e['save']();};}function saveUpdates(_0x422374,_0x59ff16){return function(_0x71ce33){if(_0x71ce33){return _0x71ce33[_0xaeae('0x28')](_0x422374)['then'](function(_0x1154c4){return _0x1154c4;});}return null;};}function removeEntity(_0x57e112,_0x1f72bb){return function(_0x515130){if(_0x515130){return _0x515130[_0xaeae('0x29')]()['then'](function(){var _0x4352af=_0x515130[_0xaeae('0x2a')]({'plain':!![]});var _0x378944=_0xaeae('0x2b');return db[_0xaeae('0x2c')][_0xaeae('0x29')]({'where':{'type':_0x378944,'resourceId':_0x4352af['id']}})[_0xaeae('0x2d')](function(){return _0x515130;});})[_0xaeae('0x2d')](function(){_0x57e112[_0xaeae('0x1e')](0xcc)[_0xaeae('0x2e')]();});}};}function handleEntityNotFound(_0x1a211b,_0x53b2cb){return function(_0x1f7ba){if(!_0x1f7ba){_0x1a211b[_0xaeae('0x1d')](0x194);}return _0x1f7ba;};}function handleError(_0x47d916,_0x265bca){_0x265bca=_0x265bca||0x1f4;return function(_0x54ac75){logger[_0xaeae('0x2f')](_0x54ac75['stack']);if(_0x54ac75[_0xaeae('0x30')]){delete _0x54ac75[_0xaeae('0x30')];}_0x47d916['status'](_0x265bca)[_0xaeae('0x31')](_0x54ac75);};}exports['index']=function(_0x235393,_0x525e84){var _0xfb9cda={},_0x35d27d={},_0x4693f3={'count':0x0,'rows':[]};var _0x3c98c2=_[_0xaeae('0x32')](db[_0xaeae('0x33')]['rawAttributes'],function(_0x193e3a){return{'name':_0x193e3a[_0xaeae('0x34')],'type':_0x193e3a[_0xaeae('0x35')][_0xaeae('0x36')]};});_0x35d27d[_0xaeae('0x37')]=_[_0xaeae('0x32')](_0x3c98c2,_0xaeae('0x30'));_0x35d27d[_0xaeae('0x38')]=_[_0xaeae('0x39')](_0x235393['query']);_0x35d27d[_0xaeae('0x3a')]=_[_0xaeae('0x3b')](_0x35d27d[_0xaeae('0x37')],_0x35d27d['query']);_0xfb9cda[_0xaeae('0x3c')]=_[_0xaeae('0x3b')](_0x35d27d['model'],qs['fields'](_0x235393[_0xaeae('0x38')][_0xaeae('0x3d')]));_0xfb9cda[_0xaeae('0x3c')]=_0xfb9cda['attributes'][_0xaeae('0x3e')]?_0xfb9cda['attributes']:_0x35d27d[_0xaeae('0x37')];if(!_0x235393[_0xaeae('0x38')]['hasOwnProperty']('nolimit')){_0xfb9cda[_0xaeae('0x21')]=qs[_0xaeae('0x21')](_0x235393['query']['limit']);_0xfb9cda[_0xaeae('0x23')]=qs['offset'](_0x235393[_0xaeae('0x38')]['offset']);}_0xfb9cda[_0xaeae('0x3f')]=qs[_0xaeae('0x40')](_0x235393[_0xaeae('0x38')][_0xaeae('0x40')]);_0xfb9cda[_0xaeae('0x41')]=qs[_0xaeae('0x3a')](_['pick'](_0x235393['query'],_0x35d27d[_0xaeae('0x3a')]),_0x3c98c2);if(_0x235393[_0xaeae('0x38')][_0xaeae('0x42')]){_0xfb9cda[_0xaeae('0x41')]=_[_0xaeae('0x43')](_0xfb9cda[_0xaeae('0x41')],{'$or':_[_0xaeae('0x32')](_0x3c98c2,function(_0x4ec75c){if(_0x4ec75c[_0xaeae('0x35')]!==_0xaeae('0x44')){var _0x939fa6={};_0x939fa6[_0x4ec75c[_0xaeae('0x30')]]={'$like':'%'+_0x235393['query']['filter']+'%'};return _0x939fa6;}})});}_0xfb9cda=_[_0xaeae('0x43')]({},_0xfb9cda,_0x235393['options']);var _0x3fb019={'where':_0xfb9cda[_0xaeae('0x41')]};return db[_0xaeae('0x33')][_0xaeae('0x22')](_0x3fb019)[_0xaeae('0x2d')](function(_0x24152c){_0x4693f3[_0xaeae('0x22')]=_0x24152c;if(_0x235393[_0xaeae('0x38')][_0xaeae('0x45')]){_0xfb9cda[_0xaeae('0x46')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xaeae('0x47')](_0xfb9cda);})[_0xaeae('0x2d')](function(_0x83e743){_0x4693f3[_0xaeae('0x48')]=_0x83e743;return _0x4693f3;})[_0xaeae('0x2d')](respondWithFilteredResult(_0x525e84,_0xfb9cda))[_0xaeae('0x49')](handleError(_0x525e84,null));};exports[_0xaeae('0x4a')]=function(_0x4f54cc,_0x213f8f){var _0x395bac={'raw':!![],'where':{'id':_0x4f54cc[_0xaeae('0x4b')]['id']}},_0x431a70={};_0x431a70['model']=_['keys'](db[_0xaeae('0x33')][_0xaeae('0x4c')]);_0x431a70['query']=_[_0xaeae('0x39')](_0x4f54cc['query']);_0x431a70['filters']=_[_0xaeae('0x3b')](_0x431a70[_0xaeae('0x37')],_0x431a70[_0xaeae('0x38')]);_0x395bac[_0xaeae('0x3c')]=_[_0xaeae('0x3b')](_0x431a70[_0xaeae('0x37')],qs[_0xaeae('0x3d')](_0x4f54cc[_0xaeae('0x38')]['fields']));_0x395bac[_0xaeae('0x3c')]=_0x395bac[_0xaeae('0x3c')][_0xaeae('0x3e')]?_0x395bac[_0xaeae('0x3c')]:_0x431a70[_0xaeae('0x37')];if(_0x4f54cc[_0xaeae('0x38')][_0xaeae('0x45')]){_0x395bac[_0xaeae('0x46')]=[{'all':!![]}];}_0x395bac=_[_0xaeae('0x43')]({},_0x395bac,_0x4f54cc[_0xaeae('0x4d')]);return db['WhatsappQueue']['find'](_0x395bac)[_0xaeae('0x2d')](handleEntityNotFound(_0x213f8f,null))[_0xaeae('0x2d')](respondWithResult(_0x213f8f,null))[_0xaeae('0x49')](handleError(_0x213f8f,null));};exports[_0xaeae('0x4e')]=function(_0x22ad99,_0x3f1574){return db['WhatsappQueue'][_0xaeae('0x4e')](_0x22ad99[_0xaeae('0x4f')],{})[_0xaeae('0x2d')](function(_0x4c1bfa){var _0x41c2f6=_0x22ad99[_0xaeae('0x50')][_0xaeae('0x2a')]({'plain':!![]});if(!_0x41c2f6)throw new Error(_0xaeae('0x51'));if(_0x41c2f6[_0xaeae('0x52')]===_0xaeae('0x50')){var _0x2675b0=_0x4c1bfa['get']({'plain':!![]});var _0x11852c='WhatsappQueues';return db['UserProfileSection'][_0xaeae('0x53')]({'where':{'name':_0x11852c,'userProfileId':_0x41c2f6[_0xaeae('0x54')]},'raw':!![]})['then'](function(_0x135396){if(_0x135396&&_0x135396[_0xaeae('0x55')]===0x0){return db[_0xaeae('0x2c')][_0xaeae('0x4e')]({'name':_0x2675b0[_0xaeae('0x30')],'resourceId':_0x2675b0['id'],'type':_0x135396[_0xaeae('0x30')],'sectionId':_0x135396['id']},{})[_0xaeae('0x2d')](function(){return _0x4c1bfa;});}else{return _0x4c1bfa;}})[_0xaeae('0x49')](function(_0x4c8f11){logger[_0xaeae('0x2f')](_0xaeae('0x56'),_0x4c8f11);throw _0x4c8f11;});}return _0x4c1bfa;})[_0xaeae('0x2d')](respondWithResult(_0x3f1574,0xc9))[_0xaeae('0x49')](handleError(_0x3f1574,null));};exports[_0xaeae('0x28')]=function(_0x3932e1,_0x1a7c6d){if(_0x3932e1[_0xaeae('0x4f')]['id']){delete _0x3932e1['body']['id'];}return db['WhatsappQueue'][_0xaeae('0x53')]({'where':{'id':_0x3932e1['params']['id']}})[_0xaeae('0x2d')](handleEntityNotFound(_0x1a7c6d,null))['then'](saveUpdates(_0x3932e1[_0xaeae('0x4f')],null))[_0xaeae('0x2d')](respondWithResult(_0x1a7c6d,null))[_0xaeae('0x49')](handleError(_0x1a7c6d,null));};exports[_0xaeae('0x29')]=function(_0xc2e645,_0x399d90){return db[_0xaeae('0x33')][_0xaeae('0x53')]({'where':{'id':_0xc2e645[_0xaeae('0x4b')]['id']}})[_0xaeae('0x2d')](handleEntityNotFound(_0x399d90,null))[_0xaeae('0x2d')](removeEntity(_0x399d90,null))[_0xaeae('0x49')](handleError(_0x399d90,null));};exports[_0xaeae('0x57')]=function(_0x5f3796,_0x3a4163){return db[_0xaeae('0x33')][_0xaeae('0x57')]()[_0xaeae('0x2d')](respondWithResult(_0x3a4163,null))[_0xaeae('0x49')](handleError(_0x3a4163,null));};exports[_0xaeae('0x58')]=function(_0x51ff0c,_0x182a60,_0x219960){var _0x405c22={'raw':!![],'where':{}},_0x7869f2={},_0x2ebebb;return db[_0xaeae('0x33')][_0xaeae('0x59')]({'where':{'id':_0x51ff0c[_0xaeae('0x4b')]['id']}})[_0xaeae('0x2d')](handleEntityNotFound(_0x182a60,null))['then'](function(_0x429a0f){if(_0x429a0f){_0x2ebebb=_0x429a0f[_0xaeae('0x2a')]({'plain':!![]});_0x7869f2[_0xaeae('0x37')]=_[_0xaeae('0x39')](db[_0xaeae('0x5a')]['rawAttributes']);_0x7869f2[_0xaeae('0x38')]=_[_0xaeae('0x39')](_0x51ff0c[_0xaeae('0x38')]);_0x7869f2[_0xaeae('0x3a')]=_[_0xaeae('0x3b')](_0x7869f2[_0xaeae('0x37')],_0x7869f2['query']);_0x405c22[_0xaeae('0x3c')]=_[_0xaeae('0x3b')](_0x7869f2['model'],qs[_0xaeae('0x3d')](_0x51ff0c[_0xaeae('0x38')]['fields']));_0x405c22[_0xaeae('0x3c')]=_0x405c22[_0xaeae('0x3c')]['length']?_0x405c22[_0xaeae('0x3c')]:_0x7869f2[_0xaeae('0x37')];if(!_0x51ff0c['query'][_0xaeae('0x5b')]('nolimit')){_0x405c22[_0xaeae('0x21')]=qs[_0xaeae('0x21')](_0x51ff0c[_0xaeae('0x38')]['limit']);_0x405c22[_0xaeae('0x23')]=qs[_0xaeae('0x23')](_0x51ff0c[_0xaeae('0x38')]['offset']);}_0x405c22[_0xaeae('0x3f')]=qs['sort'](_0x51ff0c['query'][_0xaeae('0x40')]);_0x405c22[_0xaeae('0x41')]=qs[_0xaeae('0x3a')](_[_0xaeae('0x5c')](_0x51ff0c['query'],_0x7869f2[_0xaeae('0x3a')]));_0x405c22[_0xaeae('0x41')]['WhatsappQueueId']=_0x429a0f['id'];if(_0x51ff0c['query']['filter']){_0x405c22[_0xaeae('0x41')]=_[_0xaeae('0x43')](_0x405c22[_0xaeae('0x41')],{'$or':_[_0xaeae('0x32')](_0x405c22[_0xaeae('0x3c')],function(_0x3cb0a9){var _0x19b42c={};_0x19b42c[_0x3cb0a9]={'$like':'%'+_0x51ff0c['query']['filter']+'%'};return _0x19b42c;})});}_0x405c22=_[_0xaeae('0x43')]({},_0x405c22,_0x51ff0c[_0xaeae('0x4d')]);return db['UserWhatsappQueue'][_0xaeae('0x47')](_0x405c22);}})[_0xaeae('0x2d')](function(_0x4f4da9){if(_0x4f4da9){return db['User'][_0xaeae('0x5d')]({'where':{'id':_[_0xaeae('0x32')](_0x4f4da9,'UserId'),'role':_0xaeae('0x5e')},'attributes':['id','name','whatsappPause',_0xaeae('0x5f'),'createdAt']});}})[_0xaeae('0x2d')](function(_0x578a58){if(_0x578a58){return{'count':_0x578a58[_0xaeae('0x22')],'rows':_[_0xaeae('0x32')](_0x578a58[_0xaeae('0x48')],function(_0x5697d9){return{'membername':_0x5697d9[_0xaeae('0x30')],'UserId':_0x5697d9['id'],'queue_name':_0x2ebebb[_0xaeae('0x30')],'WhatsappQueueId':_0x2ebebb['id'],'interface':util[_0xaeae('0x60')]('%s/%s','SIP',_0x5697d9[_0xaeae('0x30')]),'penalty':0x0,'paused':_0x5697d9['whatsappPause'],'createdAt':_0x5697d9['createdAt'],'updatedAt':_0x5697d9[_0xaeae('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaeae('0x2d')](respondWithFilteredResult(_0x182a60,_0x405c22))[_0xaeae('0x49')](handleError(_0x182a60,null));};exports[_0xaeae('0x61')]=function(_0x34a0f0,_0x3df820,_0x21fd8d){var _0x3ae6be={};var _0x2d8dc4={};var _0x4abdef;var _0x4de251;return db[_0xaeae('0x33')]['findOne']({'where':{'id':_0x34a0f0['params']['id']}})[_0xaeae('0x2d')](handleEntityNotFound(_0x3df820,null))[_0xaeae('0x2d')](function(_0x2e7b5b){if(_0x2e7b5b){_0x4abdef=_0x2e7b5b;_0x2d8dc4[_0xaeae('0x37')]=_[_0xaeae('0x39')](db['Team'][_0xaeae('0x4c')]);_0x2d8dc4[_0xaeae('0x38')]=_[_0xaeae('0x39')](_0x34a0f0[_0xaeae('0x38')]);_0x2d8dc4[_0xaeae('0x3a')]=_[_0xaeae('0x3b')](_0x2d8dc4['model'],_0x2d8dc4[_0xaeae('0x38')]);_0x3ae6be['attributes']=_[_0xaeae('0x3b')](_0x2d8dc4[_0xaeae('0x37')],qs[_0xaeae('0x3d')](_0x34a0f0[_0xaeae('0x38')]['fields']));_0x3ae6be[_0xaeae('0x3c')]=_0x3ae6be[_0xaeae('0x3c')]['length']?_0x3ae6be[_0xaeae('0x3c')]:_0x2d8dc4[_0xaeae('0x37')];_0x3ae6be[_0xaeae('0x3f')]=qs[_0xaeae('0x40')](_0x34a0f0['query'][_0xaeae('0x40')]);_0x3ae6be[_0xaeae('0x41')]=qs['filters'](_[_0xaeae('0x5c')](_0x34a0f0[_0xaeae('0x38')],_0x2d8dc4[_0xaeae('0x3a')]));if(_0x34a0f0[_0xaeae('0x38')]['filter']){_0x3ae6be[_0xaeae('0x41')]=_[_0xaeae('0x43')](_0x3ae6be[_0xaeae('0x41')],{'$or':_['map'](_0x3ae6be[_0xaeae('0x3c')],function(_0x1216e7){var _0x5c7e35={};_0x5c7e35[_0x1216e7]={'$like':'%'+_0x34a0f0['query'][_0xaeae('0x42')]+'%'};return _0x5c7e35;})});}_0x3ae6be=_[_0xaeae('0x43')]({},_0x3ae6be,_0x34a0f0[_0xaeae('0x4d')]);return _0x4abdef[_0xaeae('0x61')](_0x3ae6be);}})['then'](function(_0x1fc65a){if(_0x1fc65a){_0x4de251=_0x1fc65a[_0xaeae('0x3e')];if(!_0x34a0f0[_0xaeae('0x38')]['hasOwnProperty'](_0xaeae('0x62'))){_0x3ae6be[_0xaeae('0x21')]=qs[_0xaeae('0x21')](_0x34a0f0[_0xaeae('0x38')]['limit']);_0x3ae6be[_0xaeae('0x23')]=qs[_0xaeae('0x23')](_0x34a0f0[_0xaeae('0x38')][_0xaeae('0x23')]);}return _0x4abdef[_0xaeae('0x61')](_0x3ae6be);}})[_0xaeae('0x2d')](function(_0x226f46){if(_0x226f46){return _0x226f46?{'count':_0x4de251,'rows':_0x226f46}:null;}})[_0xaeae('0x2d')](respondWithResult(_0x3df820,null))[_0xaeae('0x49')](handleError(_0x3df820,null));};exports[_0xaeae('0x63')]=function(_0x4a8eba,_0x2d1e00,_0x3c26d2){var _0x59bdb6=_0x4a8eba[_0xaeae('0x4f')]['ids'];return db['Team']['findAll']({'where':{'id':_0x59bdb6},'attributes':['id'],'include':[{'model':db[_0xaeae('0x64')],'as':_0xaeae('0x65'),'attributes':['id',_0xaeae('0x30'),_0xaeae('0x66'),'voicePause',_0xaeae('0x67')],'raw':!![]}]})[_0xaeae('0x2d')](function(_0xe81f9c){if(_0xe81f9c){var _0x32023a=_[_0xaeae('0x68')](_0xe81f9c,function(_0x22980e){var _0x507ccb=_0x22980e[_0xaeae('0x2a')]({'plain':!![]});return _0x507ccb[_0xaeae('0x65')];});return db['WhatsappQueue'][_0xaeae('0x53')]({'where':{'id':_0x4a8eba[_0xaeae('0x4b')]['id']}})[_0xaeae('0x2d')](function(_0x5b6d2d){return db[_0xaeae('0x69')][_0xaeae('0x6a')](function(_0x52d6b8){return _0x5b6d2d[_0xaeae('0x63')](_0x59bdb6,{'transaction':_0x52d6b8})[_0xaeae('0x2d')](function(){return BPromise[_0xaeae('0x6b')](_0x32023a,function(_0x2f28bf){return db[_0xaeae('0x5a')]['findOrCreate']({'where':{'UserId':_0x2f28bf['id'],'WhatsappQueueId':_0x4a8eba[_0xaeae('0x4b')]['id']},'transaction':_0x52d6b8});});})[_0xaeae('0x2d')](function(){_0x32023a[_0xaeae('0x6c')](function(_0x5b1dc0){socket[_0xaeae('0x6d')](_0xaeae('0x6e'),{'UserId':_0x5b1dc0['id'],'WhatsappQueueId':_0x5b6d2d['id']});});});});});}})[_0xaeae('0x2d')](respondWithStatusCode(_0x2d1e00,null))['catch'](handleError(_0x2d1e00,null));};exports[_0xaeae('0x6f')]=function(_0x5421e3,_0x216be0,_0x173c06){return db['Team'][_0xaeae('0x47')]({'where':{'id':_0x5421e3[_0xaeae('0x38')][_0xaeae('0x70')]},'attributes':['id'],'include':[{'model':db[_0xaeae('0x64')],'as':_0xaeae('0x65'),'attributes':['id'],'raw':!![]}]})[_0xaeae('0x2d')](handleEntityNotFound(_0x216be0,null))[_0xaeae('0x2d')](function(_0x52bdae){var _0x49e588=_[_0xaeae('0x32')](_0x52bdae,'id');var _0x20efac=[];var _0x4fd839=[];var _0x195580=squel[_0xaeae('0x71')]();_0x195580['field']('tq.TeamId')['from']('team_has_whatsapp_queues','tq')['join'](_0xaeae('0x72'),'ut',_0xaeae('0x73'))['where']('WhatsappQueueId\x20=\x20?',_0x5421e3[_0xaeae('0x4b')]['id']);for(var _0x1bdb15=0x0;_0x1bdb15<_0x52bdae[_0xaeae('0x3e')];_0x1bdb15+=0x1){let _0x1c6f39=_0x52bdae[_0x1bdb15];for(var _0x15f757=0x0;_0x15f757<_0x1c6f39[_0xaeae('0x65')][_0xaeae('0x3e')];_0x15f757+=0x1){let _0x4e92c2=_0x1c6f39[_0xaeae('0x65')][_0x15f757];var _0x1f2c8d=_0x195580['clone']();_0x1f2c8d['where'](_0xaeae('0x74'),_0x4e92c2['id']);_0x4fd839['push'](db['sequelize'][_0xaeae('0x38')](_0x1f2c8d[_0xaeae('0x75')](),{'type':db[_0xaeae('0x69')][_0xaeae('0x76')][_0xaeae('0x77')]})[_0xaeae('0x2d')](function(_0x39c447){if(_0x39c447[_0xaeae('0x3e')]===0x1){return _0x4e92c2['id'];}else{var _0xae40d7=_['every'](_[_0xaeae('0x32')](_0x39c447,_0xaeae('0x78')),function(_0x2a823d){return _[_0xaeae('0x79')](_0x49e588,_0x2a823d);});if(_0xae40d7){return _0x4e92c2['id'];}}}));}}return BPromise[_0xaeae('0x7a')](_0x4fd839)[_0xaeae('0x2d')](function(_0x374e03){_0x20efac=_(_0x20efac)['union'](_0x374e03)['compact']()[_0xaeae('0x7b')]();return db[_0xaeae('0x33')]['find']({'where':{'id':_0x5421e3[_0xaeae('0x4b')]['id']}})[_0xaeae('0x2d')](function(_0x5222fa){return db[_0xaeae('0x69')][_0xaeae('0x6a')](function(_0x27f9f2){return _0x5222fa[_0xaeae('0x6f')](_0x5421e3[_0xaeae('0x38')][_0xaeae('0x70')],{'transaction':_0x27f9f2})['then'](function(){if(!_['isEmpty'](_0x20efac)){return _0x5222fa[_0xaeae('0x7c')](_0x20efac,{'transaction':_0x27f9f2});}})[_0xaeae('0x2d')](function(){_0x20efac[_0xaeae('0x6c')](function(_0x32bfb2){socket[_0xaeae('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x32bfb2,'WhatsappQueueId':_0x5222fa['id']});});});});});});})[_0xaeae('0x2d')](respondWithStatusCode(_0x216be0,null))['catch'](handleError(_0x216be0,null));};exports['addAgents']=function(_0x45bae9,_0x389e3b,_0x4ce068){return db[_0xaeae('0x33')]['find']({'where':{'id':_0x45bae9[_0xaeae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x389e3b,null))[_0xaeae('0x2d')](function(_0x1118b9){if(_0x1118b9){return _0x1118b9[_0xaeae('0x7d')](_0x45bae9[_0xaeae('0x4f')][_0xaeae('0x70')],_[_0xaeae('0x7e')](_0x45bae9[_0xaeae('0x4f')],['ids','id'])||{})[_0xaeae('0x7f')](function(_0x1e9138){for(var _0x380599=0x0;_0x380599<_0x45bae9['body'][_0xaeae('0x70')]['length'];_0x380599+=0x1){socket[_0xaeae('0x6d')](_0xaeae('0x6e'),{'UserId':Number(_0x45bae9[_0xaeae('0x4f')]['ids'][_0x380599]),'WhatsappQueueId':Number(_0x45bae9['params']['id'])});}return _0x1e9138;});}})['then'](respondWithResult(_0x389e3b,null))['catch'](handleError(_0x389e3b,null));};exports[_0xaeae('0x7c')]=function(_0x33e558,_0xe48c07,_0x2747cb){return db[_0xaeae('0x33')]['find']({'where':{'id':_0x33e558[_0xaeae('0x4b')]['id']}})[_0xaeae('0x2d')](handleEntityNotFound(_0xe48c07,null))[_0xaeae('0x2d')](function(_0x42e21a){if(_0x42e21a){return _0x42e21a[_0xaeae('0x7c')](_0x33e558[_0xaeae('0x38')][_0xaeae('0x70')])['then'](function(){if(_[_0xaeae('0x80')](_0x33e558[_0xaeae('0x38')]['ids'])){for(var _0x632807=0x0;_0x632807<_0x33e558[_0xaeae('0x38')]['ids'][_0xaeae('0x3e')];_0x632807+=0x1){socket['emit'](_0xaeae('0x81'),{'UserId':Number(_0x33e558[_0xaeae('0x38')][_0xaeae('0x70')][_0x632807]),'WhatsappQueueId':Number(_0x33e558[_0xaeae('0x4b')]['id'])});}}else{socket['emit'](_0xaeae('0x81'),{'UserId':Number(_0x33e558[_0xaeae('0x38')][_0xaeae('0x70')]),'WhatsappQueueId':Number(_0x33e558[_0xaeae('0x4b')]['id'])});}});}})[_0xaeae('0x2d')](respondWithStatusCode(_0xe48c07,null))[_0xaeae('0x49')](handleError(_0xe48c07,null));};exports[_0xaeae('0x82')]=function(_0xa08300,_0x4da80a,_0x178c9c){var _0x45f082={};var _0x441af2={};var _0x554bbc;var _0x959640;return db[_0xaeae('0x33')]['findOne']({'where':{'id':_0xa08300[_0xaeae('0x4b')]['id']}})[_0xaeae('0x2d')](handleEntityNotFound(_0x4da80a,null))[_0xaeae('0x2d')](function(_0x1c80a2){if(_0x1c80a2){_0x554bbc=_0x1c80a2;_0x441af2[_0xaeae('0x37')]=_[_0xaeae('0x39')](db[_0xaeae('0x64')][_0xaeae('0x4c')]);_0x441af2[_0xaeae('0x38')]=_[_0xaeae('0x39')](_0xa08300[_0xaeae('0x38')]);_0x441af2[_0xaeae('0x3a')]=_[_0xaeae('0x3b')](_0x441af2[_0xaeae('0x37')],_0x441af2[_0xaeae('0x38')]);_0x45f082[_0xaeae('0x3c')]=_[_0xaeae('0x3b')](_0x441af2[_0xaeae('0x37')],qs[_0xaeae('0x3d')](_0xa08300[_0xaeae('0x38')][_0xaeae('0x3d')]));_0x45f082[_0xaeae('0x3c')]=_0x45f082[_0xaeae('0x3c')][_0xaeae('0x3e')]?_0x45f082[_0xaeae('0x3c')]:_0x441af2[_0xaeae('0x37')];_0x45f082[_0xaeae('0x3f')]=qs[_0xaeae('0x40')](_0xa08300[_0xaeae('0x38')][_0xaeae('0x40')]);_0x45f082['where']=qs['filters'](_['pick'](_0xa08300['query'],_0x441af2['filters']));if(_0xa08300['query'][_0xaeae('0x42')]){_0x45f082[_0xaeae('0x41')]=_[_0xaeae('0x43')](_0x45f082['where'],{'$or':_[_0xaeae('0x32')](_0x45f082[_0xaeae('0x3c')],function(_0x53cb5f){var _0x25cb5f={};_0x25cb5f[_0x53cb5f]={'$like':'%'+_0xa08300['query']['filter']+'%'};return _0x25cb5f;})});}_0x45f082=_[_0xaeae('0x43')]({},_0x45f082,_0xa08300[_0xaeae('0x4d')]);return _0x554bbc[_0xaeae('0x82')](_0x45f082);}})['then'](function(_0x1745cd){if(_0x1745cd){_0x959640=_0x1745cd[_0xaeae('0x3e')];if(!_0xa08300[_0xaeae('0x38')]['hasOwnProperty']('nolimit')){_0x45f082[_0xaeae('0x21')]=qs[_0xaeae('0x21')](_0xa08300[_0xaeae('0x38')][_0xaeae('0x21')]);_0x45f082[_0xaeae('0x23')]=qs['offset'](_0xa08300[_0xaeae('0x38')][_0xaeae('0x23')]);}return _0x554bbc['getAgents'](_0x45f082);}})[_0xaeae('0x2d')](function(_0x30d73b){if(_0x30d73b){return _0x30d73b?{'count':_0x959640,'rows':_0x30d73b}:null;}})[_0xaeae('0x2d')](respondWithResult(_0x4da80a,null))[_0xaeae('0x49')](handleError(_0x4da80a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index af37643..7977da7 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 _0x563a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x563a,0x12c));var _0xa563=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x563a[_0x2be8c2];return _0x97f531;};'use strict';var EventEmitter=require(_0xa563('0x0'));var WhatsappQueue=require(_0xa563('0x1'))['db'][_0xa563('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa563('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x45032b){return function(_0x370c2d,_0x446fd0,_0x3a0757){WhatsappQueueEvents[_0xa563('0x4')](_0x45032b+':'+_0x370c2d['id'],_0x370c2d);WhatsappQueueEvents[_0xa563('0x4')](_0x45032b,_0x370c2d);_0x3a0757(null);};}for(var e in events){if(events[_0xa563('0x5')](e)){var event=events[e];WhatsappQueue[_0xa563('0x6')](e,emitEvent(event));}}module[_0xa563('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xa17a=['hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4f86e8,_0x40d079){var _0x351e5a=function(_0x47d2e9){while(--_0x47d2e9){_0x4f86e8['push'](_0x4f86e8['shift']());}};_0x351e5a(++_0x40d079);}(_0xa17a,0x174));var _0xaa17=function(_0x27b2b1,_0x23466d){_0x27b2b1=_0x27b2b1-0x0;var _0x44640e=_0xa17a[_0x27b2b1];return _0x44640e;};'use strict';var EventEmitter=require(_0xaa17('0x0'));var WhatsappQueue=require(_0xaa17('0x1'))['db'][_0xaa17('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaa17('0x3')](0x0);var events={'afterCreate':_0xaa17('0x4'),'afterUpdate':_0xaa17('0x5'),'afterDestroy':'remove'};function emitEvent(_0x66a07a){return function(_0x149b2d,_0x540598,_0x4b2804){WhatsappQueueEvents[_0xaa17('0x6')](_0x66a07a+':'+_0x149b2d['id'],_0x149b2d);WhatsappQueueEvents[_0xaa17('0x6')](_0x66a07a,_0x149b2d);_0x4b2804(null);};}for(var e in events){if(events[_0xaa17('0x7')](e)){var event=events[e];WhatsappQueue[_0xaa17('0x8')](e,emitEvent(event));}}module[_0xaa17('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 42989bd..3fdfe2a 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 _0xc232=['moment','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api'];(function(_0x57be75,_0x158a70){var _0x31179f=function(_0x10a2a7){while(--_0x10a2a7){_0x57be75['push'](_0x57be75['shift']());}};_0x31179f(++_0x158a70);}(_0xc232,0x141));var _0x2c23=function(_0x272314,_0x110f26){_0x272314=_0x272314-0x0;var _0x2634ad=_0xc232[_0x272314];return _0x2634ad;};'use strict';var _=require(_0x2c23('0x0'));var util=require('util');var logger=require(_0x2c23('0x1'))(_0x2c23('0x2'));var moment=require(_0x2c23('0x3'));var BPromise=require('bluebird');var rp=require(_0x2c23('0x4'));var fs=require('fs');var path=require(_0x2c23('0x5'));var rimraf=require('rimraf');var config=require(_0x2c23('0x6'));var attributes=require(_0x2c23('0x7'));module[_0x2c23('0x8')]=function(_0x4e4f4b,_0x3e92c7){return _0x4e4f4b[_0x2c23('0x9')](_0x2c23('0xa'),attributes,{'tableName':_0x2c23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02b1=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash'];(function(_0x6e78e6,_0x31291b){var _0x1ba801=function(_0x3dfc22){while(--_0x3dfc22){_0x6e78e6['push'](_0x6e78e6['shift']());}};_0x1ba801(++_0x31291b);}(_0x02b1,0x113));var _0x102b=function(_0x47ecc6,_0x43f3ef){_0x47ecc6=_0x47ecc6-0x0;var _0x49ea80=_0x02b1[_0x47ecc6];return _0x49ea80;};'use strict';var _=require(_0x102b('0x0'));var util=require(_0x102b('0x1'));var logger=require(_0x102b('0x2'))('api');var moment=require(_0x102b('0x3'));var BPromise=require(_0x102b('0x4'));var rp=require(_0x102b('0x5'));var fs=require('fs');var path=require(_0x102b('0x6'));var rimraf=require('rimraf');var config=require(_0x102b('0x7'));var attributes=require(_0x102b('0x8'));module[_0x102b('0x9')]=function(_0x54b0bd,_0x2d6922){return _0x54b0bd[_0x102b('0xa')](_0x102b('0xb'),attributes,{'tableName':'whatsapp_queues','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 125e409..b1ded60 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 _0xf23a=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','register','request','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','limit','map','model','attributes','include','then','ShowWhatsappQueue','find','raw','info','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x504a76,_0x3715cc){var _0x10d1ff=function(_0x30a560){while(--_0x30a560){_0x504a76['push'](_0x504a76['shift']());}};_0x10d1ff(++_0x3715cc);}(_0xf23a,0x194));var _0xaf23=function(_0xc713f8,_0x4f4598){_0xc713f8=_0xc713f8-0x0;var _0x16f06a=_0xf23a[_0xc713f8];return _0x16f06a;};'use strict';var _=require(_0xaf23('0x0'));var util=require(_0xaf23('0x1'));var moment=require(_0xaf23('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf23('0x3'));var fs=require('fs');var Redis=require(_0xaf23('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf23('0x5'));var logger=require('../../config/logger')(_0xaf23('0x6'));var config=require(_0xaf23('0x7'));var jayson=require(_0xaf23('0x8'));var client=jayson[_0xaf23('0x9')][_0xaf23('0xa')]({'port':0x232a});config[_0xaf23('0xb')]=_['defaults'](config[_0xaf23('0xb')],{'host':_0xaf23('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaf23('0xd'))[_0xaf23('0xe')](socket);function respondWithRpcPromise(_0x508736,_0x3a3e12,_0x385945){return new BPromise(function(_0x2ce0da,_0x29ee7c){return client[_0xaf23('0xf')](_0x508736,_0x385945)['then'](function(_0x31f998){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x3a3e12,_0xaf23('0x10'));logger[_0xaf23('0x11')](_0xaf23('0x12'),_0x3a3e12,'request\x20sent',JSON[_0xaf23('0x13')](_0x31f998));if(_0x31f998[_0xaf23('0x14')]){if(_0x31f998[_0xaf23('0x14')][_0xaf23('0x15')]===0x1f4){logger[_0xaf23('0x14')](_0xaf23('0x16'),_0x3a3e12,_0x31f998[_0xaf23('0x14')][_0xaf23('0x17')]);return _0x29ee7c(_0x31f998['error']['message']);}logger[_0xaf23('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x3a3e12,_0x31f998[_0xaf23('0x14')]['message']);return _0x2ce0da(_0x31f998[_0xaf23('0x14')][_0xaf23('0x17')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x3a3e12,_0xaf23('0x10'));_0x2ce0da(_0x31f998[_0xaf23('0x18')][_0xaf23('0x17')]);}})[_0xaf23('0x19')](function(_0x3fa26e){logger[_0xaf23('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x3a3e12,_0x3fa26e);_0x29ee7c(_0x3fa26e);});});}exports[_0xaf23('0x1a')]=function(_0x53008f){var _0x72d05d=this;return new Promise(function(_0x2a54ab,_0xd687af){return db[_0xaf23('0x1b')][_0xaf23('0x1c')]({'raw':_0x53008f[_0xaf23('0x1d')]?_0x53008f['options']['raw']===undefined?!![]:![]:!![],'where':_0x53008f[_0xaf23('0x1d')]?_0x53008f['options'][_0xaf23('0x1e')]||null:null,'attributes':_0x53008f['options']?_0x53008f[_0xaf23('0x1d')]['attributes']||null:null,'limit':_0x53008f[_0xaf23('0x1d')]?_0x53008f[_0xaf23('0x1d')][_0xaf23('0x1f')]||null:null,'include':_0x53008f[_0xaf23('0x1d')]?_0x53008f[_0xaf23('0x1d')]['include']?_[_0xaf23('0x20')](_0x53008f[_0xaf23('0x1d')]['include'],function(_0x4493e9){return{'model':db[_0x4493e9[_0xaf23('0x21')]],'as':_0x4493e9['as'],'attributes':_0x4493e9[_0xaf23('0x22')],'include':_0x4493e9[_0xaf23('0x23')]?_['map'](_0x4493e9[_0xaf23('0x23')],function(_0x54e3ef){return{'model':db[_0x54e3ef[_0xaf23('0x21')]],'as':_0x54e3ef['as'],'attributes':_0x54e3ef[_0xaf23('0x22')],'include':_0x54e3ef['include']?_[_0xaf23('0x20')](_0x54e3ef[_0xaf23('0x23')],function(_0x4d1e7b){return{'model':db[_0x4d1e7b[_0xaf23('0x21')]],'as':_0x4d1e7b['as'],'attributes':_0x4d1e7b[_0xaf23('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaf23('0x24')](function(_0x38fa79){logger['info'](_0xaf23('0x1a'),_0x53008f);logger[_0xaf23('0x11')](_0xaf23('0x1a'),_0x53008f,JSON['stringify'](_0x38fa79));_0x2a54ab(_0x38fa79);})[_0xaf23('0x19')](function(_0x4a504e){logger[_0xaf23('0x14')](_0xaf23('0x1a'),_0x4a504e[_0xaf23('0x17')],_0x53008f);_0xd687af(_0x72d05d['error'](0x1f4,_0x4a504e[_0xaf23('0x17')]));});});};exports[_0xaf23('0x25')]=function(_0x37b099){var _0x130905=this;return new Promise(function(_0x38a475,_0x4ae26d){return db[_0xaf23('0x1b')][_0xaf23('0x26')]({'raw':_0x37b099[_0xaf23('0x1d')]?_0x37b099[_0xaf23('0x1d')][_0xaf23('0x27')]===undefined?!![]:![]:!![],'where':_0x37b099[_0xaf23('0x1d')]?_0x37b099[_0xaf23('0x1d')][_0xaf23('0x1e')]||null:null,'attributes':_0x37b099[_0xaf23('0x1d')]?_0x37b099[_0xaf23('0x1d')][_0xaf23('0x22')]||null:null,'include':_0x37b099[_0xaf23('0x1d')]?_0x37b099[_0xaf23('0x1d')][_0xaf23('0x23')]?_[_0xaf23('0x20')](_0x37b099[_0xaf23('0x1d')][_0xaf23('0x23')],function(_0x3f3121){return{'model':db[_0x3f3121[_0xaf23('0x21')]],'as':_0x3f3121['as'],'attributes':_0x3f3121['attributes'],'include':_0x3f3121[_0xaf23('0x23')]?_[_0xaf23('0x20')](_0x3f3121[_0xaf23('0x23')],function(_0x55c908){return{'model':db[_0x55c908[_0xaf23('0x21')]],'as':_0x55c908['as'],'attributes':_0x55c908[_0xaf23('0x22')],'include':_0x55c908[_0xaf23('0x23')]?_[_0xaf23('0x20')](_0x55c908[_0xaf23('0x23')],function(_0x41e642){return{'model':db[_0x41e642[_0xaf23('0x21')]],'as':_0x41e642['as'],'attributes':_0x41e642[_0xaf23('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaf23('0x24')](function(_0x411918){logger[_0xaf23('0x28')](_0xaf23('0x25'),_0x37b099);logger[_0xaf23('0x11')](_0xaf23('0x25'),_0x37b099,JSON['stringify'](_0x411918));_0x38a475(_0x411918);})['catch'](function(_0x54adb9){logger['error']('ShowWhatsappQueue',_0x54adb9[_0xaf23('0x17')],_0x37b099);_0x4ae26d(_0x130905['error'](0x1f4,_0x54adb9[_0xaf23('0x17')]));});});}; \ No newline at end of file +var _0xd5a3=['attributes','limit','include','map','model','GetWhatsappQueue','WhatsappQueue','find','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','error','WhatsappQueue,\x20%s,\x20%s','message','catch','options','raw','where'];(function(_0xaa8da,_0xfdb138){var _0x43345c=function(_0x2a23ce){while(--_0x2a23ce){_0xaa8da['push'](_0xaa8da['shift']());}};_0x43345c(++_0xfdb138);}(_0xd5a3,0xd6));var _0x3d5a=function(_0x5e3428,_0x145322){_0x5e3428=_0x5e3428-0x0;var _0x43cd5f=_0xd5a3[_0x5e3428];return _0x43cd5f;};'use strict';var _=require(_0x3d5a('0x0'));var util=require(_0x3d5a('0x1'));var moment=require(_0x3d5a('0x2'));var BPromise=require(_0x3d5a('0x3'));var rs=require(_0x3d5a('0x4'));var fs=require('fs');var Redis=require(_0x3d5a('0x5'));var db=require(_0x3d5a('0x6'))['db'];var utils=require(_0x3d5a('0x7'));var logger=require(_0x3d5a('0x8'))(_0x3d5a('0x9'));var config=require(_0x3d5a('0xa'));var jayson=require(_0x3d5a('0xb'));var client=jayson[_0x3d5a('0xc')][_0x3d5a('0xd')]({'port':0x232a});config[_0x3d5a('0xe')]=_[_0x3d5a('0xf')](config[_0x3d5a('0xe')],{'host':_0x3d5a('0x10'),'port':0x18eb});var socket=require(_0x3d5a('0x11'))(new Redis(config['redis']));require(_0x3d5a('0x12'))[_0x3d5a('0x13')](socket);function respondWithRpcPromise(_0xa8cbad,_0x2ba5ca,_0x3d04d2){return new BPromise(function(_0x3d54b6,_0x255869){return client[_0x3d5a('0x14')](_0xa8cbad,_0x3d04d2)[_0x3d5a('0x15')](function(_0x619f51){logger[_0x3d5a('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x2ba5ca,_0x3d5a('0x17'));logger[_0x3d5a('0x18')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2ba5ca,_0x3d5a('0x17'),JSON['stringify'](_0x619f51));if(_0x619f51[_0x3d5a('0x19')]){if(_0x619f51[_0x3d5a('0x19')]['code']===0x1f4){logger[_0x3d5a('0x19')](_0x3d5a('0x1a'),_0x2ba5ca,_0x619f51[_0x3d5a('0x19')]['message']);return _0x255869(_0x619f51[_0x3d5a('0x19')][_0x3d5a('0x1b')]);}logger[_0x3d5a('0x19')](_0x3d5a('0x1a'),_0x2ba5ca,_0x619f51['error']['message']);return _0x3d54b6(_0x619f51[_0x3d5a('0x19')][_0x3d5a('0x1b')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x2ba5ca,_0x3d5a('0x17'));_0x3d54b6(_0x619f51['result'][_0x3d5a('0x1b')]);}})[_0x3d5a('0x1c')](function(_0x28f99d){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2ba5ca,_0x28f99d);_0x255869(_0x28f99d);});});}exports['GetWhatsappQueue']=function(_0xc182f1){var _0x3a9886=this;return new Promise(function(_0x58d565,_0x545dbf){return db['WhatsappQueue']['findAll']({'raw':_0xc182f1['options']?_0xc182f1[_0x3d5a('0x1d')][_0x3d5a('0x1e')]===undefined?!![]:![]:!![],'where':_0xc182f1[_0x3d5a('0x1d')]?_0xc182f1[_0x3d5a('0x1d')][_0x3d5a('0x1f')]||null:null,'attributes':_0xc182f1[_0x3d5a('0x1d')]?_0xc182f1[_0x3d5a('0x1d')][_0x3d5a('0x20')]||null:null,'limit':_0xc182f1[_0x3d5a('0x1d')]?_0xc182f1[_0x3d5a('0x1d')][_0x3d5a('0x21')]||null:null,'include':_0xc182f1[_0x3d5a('0x1d')]?_0xc182f1['options'][_0x3d5a('0x22')]?_[_0x3d5a('0x23')](_0xc182f1[_0x3d5a('0x1d')][_0x3d5a('0x22')],function(_0x3a2cbd){return{'model':db[_0x3a2cbd[_0x3d5a('0x24')]],'as':_0x3a2cbd['as'],'attributes':_0x3a2cbd[_0x3d5a('0x20')],'include':_0x3a2cbd[_0x3d5a('0x22')]?_['map'](_0x3a2cbd['include'],function(_0x33abc2){return{'model':db[_0x33abc2['model']],'as':_0x33abc2['as'],'attributes':_0x33abc2[_0x3d5a('0x20')],'include':_0x33abc2['include']?_['map'](_0x33abc2[_0x3d5a('0x22')],function(_0x298001){return{'model':db[_0x298001['model']],'as':_0x298001['as'],'attributes':_0x298001[_0x3d5a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bc1fe){logger[_0x3d5a('0x16')](_0x3d5a('0x25'),_0xc182f1);logger[_0x3d5a('0x18')](_0x3d5a('0x25'),_0xc182f1,JSON['stringify'](_0x3bc1fe));_0x58d565(_0x3bc1fe);})[_0x3d5a('0x1c')](function(_0x50be3c){logger[_0x3d5a('0x19')](_0x3d5a('0x25'),_0x50be3c['message'],_0xc182f1);_0x545dbf(_0x3a9886['error'](0x1f4,_0x50be3c[_0x3d5a('0x1b')]));});});};exports['ShowWhatsappQueue']=function(_0x2bed70){var _0x312d32=this;return new Promise(function(_0x2e6f62,_0x4fb9c6){return db[_0x3d5a('0x26')][_0x3d5a('0x27')]({'raw':_0x2bed70['options']?_0x2bed70[_0x3d5a('0x1d')][_0x3d5a('0x1e')]===undefined?!![]:![]:!![],'where':_0x2bed70[_0x3d5a('0x1d')]?_0x2bed70[_0x3d5a('0x1d')][_0x3d5a('0x1f')]||null:null,'attributes':_0x2bed70[_0x3d5a('0x1d')]?_0x2bed70['options'][_0x3d5a('0x20')]||null:null,'include':_0x2bed70[_0x3d5a('0x1d')]?_0x2bed70[_0x3d5a('0x1d')]['include']?_['map'](_0x2bed70[_0x3d5a('0x1d')][_0x3d5a('0x22')],function(_0x314d9c){return{'model':db[_0x314d9c[_0x3d5a('0x24')]],'as':_0x314d9c['as'],'attributes':_0x314d9c[_0x3d5a('0x20')],'include':_0x314d9c[_0x3d5a('0x22')]?_[_0x3d5a('0x23')](_0x314d9c[_0x3d5a('0x22')],function(_0x63261f){return{'model':db[_0x63261f[_0x3d5a('0x24')]],'as':_0x63261f['as'],'attributes':_0x63261f[_0x3d5a('0x20')],'include':_0x63261f['include']?_[_0x3d5a('0x23')](_0x63261f['include'],function(_0x6d5b62){return{'model':db[_0x6d5b62[_0x3d5a('0x24')]],'as':_0x6d5b62['as'],'attributes':_0x6d5b62[_0x3d5a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3d5a('0x15')](function(_0x5ddd4b){logger['info']('ShowWhatsappQueue',_0x2bed70);logger['debug'](_0x3d5a('0x28'),_0x2bed70,JSON['stringify'](_0x5ddd4b));_0x2e6f62(_0x5ddd4b);})['catch'](function(_0x242936){logger[_0x3d5a('0x19')](_0x3d5a('0x28'),_0x242936[_0x3d5a('0x1b')],_0x2bed70);_0x4fb9c6(_0x312d32[_0x3d5a('0x19')](0x1f4,_0x242936[_0x3d5a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index bf57e00..4a4696a 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 _0x4d3e=['emit','removeListener','register','length','save','remove','update'];(function(_0x3ae048,_0x1dd012){var _0x4cf562=function(_0x1245fa){while(--_0x1245fa){_0x3ae048['push'](_0x3ae048['shift']());}};_0x4cf562(++_0x1dd012);}(_0x4d3e,0x1a8));var _0xe4d3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4d3e[_0x432682];return _0x463d05;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xe4d3('0x0'),_0xe4d3('0x1'),_0xe4d3('0x2')];function createListener(_0x1c5a7e,_0xad2aac){return function(_0x4b3036){_0xad2aac[_0xe4d3('0x3')](_0x1c5a7e,_0x4b3036);};}function removeListener(_0x3c111e,_0x3a74d9){return function(){WhatsappQueueEvents[_0xe4d3('0x4')](_0x3c111e,_0x3a74d9);};}exports[_0xe4d3('0x5')]=function(_0x28b7f5){for(var _0x3b8814=0x0,_0x23a49e=events[_0xe4d3('0x6')];_0x3b8814<_0x23a49e;_0x3b8814++){var _0x2dbb94=events[_0x3b8814];var _0x1ef66c=createListener('whatsappQueue:'+_0x2dbb94,_0x28b7f5);WhatsappQueueEvents['on'](_0x2dbb94,_0x1ef66c);}}; \ No newline at end of file +var _0x46e1=['register','length','./whatsappQueue.events','remove','emit','removeListener'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x46e1,0xfe));var _0x146e=function(_0x342d7b,_0x20b9c3){_0x342d7b=_0x342d7b-0x0;var _0x30d552=_0x46e1[_0x342d7b];return _0x30d552;};'use strict';var WhatsappQueueEvents=require(_0x146e('0x0'));var events=['save',_0x146e('0x1'),'update'];function createListener(_0x426215,_0x20a28b){return function(_0x1812b4){_0x20a28b[_0x146e('0x2')](_0x426215,_0x1812b4);};}function removeListener(_0x1f2341,_0x372a4b){return function(){WhatsappQueueEvents[_0x146e('0x3')](_0x1f2341,_0x372a4b);};}exports[_0x146e('0x4')]=function(_0x2a1cb1){for(var _0x7a2780=0x0,_0x2d7057=events[_0x146e('0x5')];_0x7a2780<_0x2d7057;_0x7a2780++){var _0x4fe868=events[_0x7a2780];var _0x1f3a1e=createListener('whatsappQueue:'+_0x4fe868,_0x2a1cb1);WhatsappQueueEvents['on'](_0x4fe868,_0x1f3a1e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 06573bb..f629451 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 _0xb0da=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb0da,0x12f));var _0xab0d=function(_0x47058e,_0x10972c){_0x47058e=_0x47058e-0x0;var _0x18e030=_0xb0da[_0x47058e];return _0x18e030;};'use strict';var multer=require(_0xab0d('0x0'));var util=require(_0xab0d('0x1'));var path=require(_0xab0d('0x2'));var timeout=require(_0xab0d('0x3'));var express=require('express');var router=express[_0xab0d('0x4')]();var fs_extra=require(_0xab0d('0x5'));var auth=require(_0xab0d('0x6'));var interaction=require(_0xab0d('0x7'));var config=require('../../config/environment');var controller=require(_0xab0d('0x8'));router[_0xab0d('0x9')]('/',auth[_0xab0d('0xa')](),controller[_0xab0d('0xb')]);router[_0xab0d('0x9')](_0xab0d('0xc'),auth[_0xab0d('0xa')](),controller[_0xab0d('0xd')]);router['get'](_0xab0d('0xe'),auth[_0xab0d('0xa')](),controller[_0xab0d('0xf')]);router[_0xab0d('0x10')]('/',auth['isAuthenticated'](),controller[_0xab0d('0x11')]);router[_0xab0d('0x12')](_0xab0d('0xe'),auth[_0xab0d('0xa')](),controller[_0xab0d('0x13')]);router[_0xab0d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xab0d('0x15')]);module[_0xab0d('0x16')]=router; \ No newline at end of file +var _0xb0a7=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','create'];(function(_0x15c46c,_0x87ff21){var _0x9f3500=function(_0x58f0a5){while(--_0x58f0a5){_0x15c46c['push'](_0x15c46c['shift']());}};_0x9f3500(++_0x87ff21);}(_0xb0a7,0x180));var _0x7b0a=function(_0x14259b,_0x588942){_0x14259b=_0x14259b-0x0;var _0x5d87fa=_0xb0a7[_0x14259b];return _0x5d87fa;};'use strict';var multer=require(_0x7b0a('0x0'));var util=require(_0x7b0a('0x1'));var path=require(_0x7b0a('0x2'));var timeout=require(_0x7b0a('0x3'));var express=require(_0x7b0a('0x4'));var router=express['Router']();var fs_extra=require(_0x7b0a('0x5'));var auth=require(_0x7b0a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7b0a('0x7'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x7b0a('0x8')](),controller[_0x7b0a('0x9')]);router[_0x7b0a('0xa')](_0x7b0a('0xb'),auth['isAuthenticated'](),controller[_0x7b0a('0xc')]);router[_0x7b0a('0xa')](_0x7b0a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7b0a('0xe')]('/',auth[_0x7b0a('0x8')](),controller[_0x7b0a('0xf')]);router[_0x7b0a('0x10')](_0x7b0a('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7b0a('0x11')](_0x7b0a('0xd'),auth[_0x7b0a('0x8')](),controller[_0x7b0a('0x12')]);module[_0x7b0a('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 1376097..993dde7 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(_0x4ff6ec,_0x5275b8){var _0xa24c9e=function(_0x37f3ad){while(--_0x37f3ad){_0x4ff6ec['push'](_0x4ff6ec['shift']());}};_0xa24c9e(++_0x5275b8);}(_0x7a54,0x106));var _0x47a5=function(_0xc1450,_0x77b0bf){_0xc1450=_0xc1450-0x0;var _0x1b41d6=_0x7a54[_0xc1450];return _0x1b41d6;};'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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x395960,_0x1e024f){var _0x22e81d=function(_0x50e3f4){while(--_0x50e3f4){_0x395960['push'](_0x395960['shift']());}};_0x22e81d(++_0x1e024f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 2b97bc6..7f79d4f 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 _0xcf66=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','WhatsappQueueReport','catch','show','params','rawAttributes','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end'];(function(_0x365e6b,_0x444bce){var _0x1f2817=function(_0x3d50a6){while(--_0x3d50a6){_0x365e6b['push'](_0x365e6b['shift']());}};_0x1f2817(++_0x444bce);}(_0xcf66,0x71));var _0x6cf6=function(_0x278650,_0x2be0bc){_0x278650=_0x278650-0x0;var _0x5d541e=_0xcf66[_0x278650];return _0x5d541e;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)[_0x6cf6('0x16')]();});}};}function handleEntityNotFound(_0x3f9871,_0x565fad){return function(_0x1c966e){if(!_0x1c966e){_0x3f9871['sendStatus'](0x194);}return _0x1c966e;};}function handleError(_0x2779b7,_0xc7b489){_0xc7b489=_0xc7b489||0x1f4;return function(_0x3eaa31){logger['error'](_0x3eaa31[_0x6cf6('0x23')]);if(_0x3eaa31[_0x6cf6('0x24')]){delete _0x3eaa31[_0x6cf6('0x24')];}_0x2779b7[_0x6cf6('0x15')](_0xc7b489)['send'](_0x3eaa31);};}exports['index']=function(_0x2afe84,_0x4521af){var _0x57099f={},_0x5869e9={},_0x5ccc8f={'count':0x0,'rows':[]};var _0x2afc06=_['map'](db['WhatsappQueueReport']['rawAttributes'],function(_0x10bde5){return{'name':_0x10bde5[_0x6cf6('0x25')],'type':_0x10bde5[_0x6cf6('0x26')][_0x6cf6('0x27')]};});_0x5869e9[_0x6cf6('0x28')]=_['map'](_0x2afc06,_0x6cf6('0x24'));_0x5869e9[_0x6cf6('0x29')]=_[_0x6cf6('0x2a')](_0x2afe84['query']);_0x5869e9[_0x6cf6('0x2b')]=_[_0x6cf6('0x2c')](_0x5869e9[_0x6cf6('0x28')],_0x5869e9[_0x6cf6('0x29')]);_0x57099f[_0x6cf6('0x2d')]=_[_0x6cf6('0x2c')](_0x5869e9[_0x6cf6('0x28')],qs[_0x6cf6('0x2e')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x2e')]));_0x57099f[_0x6cf6('0x2d')]=_0x57099f[_0x6cf6('0x2d')][_0x6cf6('0x2f')]?_0x57099f[_0x6cf6('0x2d')]:_0x5869e9[_0x6cf6('0x28')];if(!_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x30')](_0x6cf6('0x31'))){_0x57099f['limit']=qs[_0x6cf6('0x1a')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x1a')]);_0x57099f[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x18')]);}_0x57099f[_0x6cf6('0x32')]=qs[_0x6cf6('0x33')](_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x33')]);_0x57099f['where']=qs[_0x6cf6('0x2b')](_[_0x6cf6('0x34')](_0x2afe84[_0x6cf6('0x29')],_0x5869e9[_0x6cf6('0x2b')]),_0x2afc06);if(_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x35')]){_0x57099f[_0x6cf6('0x36')]=_[_0x6cf6('0x37')](_0x57099f[_0x6cf6('0x36')],{'$or':_['map'](_0x2afc06,function(_0x1c5eda){if(_0x1c5eda[_0x6cf6('0x26')]!==_0x6cf6('0x38')){var _0x3e906f={};_0x3e906f[_0x1c5eda[_0x6cf6('0x24')]]={'$like':'%'+_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x35')]+'%'};return _0x3e906f;}})});}_0x57099f=_[_0x6cf6('0x37')]({},_0x57099f,_0x2afe84[_0x6cf6('0x39')]);var _0x5ed61f={'where':_0x57099f[_0x6cf6('0x36')]};return db['WhatsappQueueReport'][_0x6cf6('0x1b')](_0x5ed61f)[_0x6cf6('0x21')](function(_0x23d280){_0x5ccc8f[_0x6cf6('0x1b')]=_0x23d280;if(_0x2afe84[_0x6cf6('0x29')][_0x6cf6('0x3a')]){_0x57099f[_0x6cf6('0x3b')]=[{'all':!![]}];}return db[_0x6cf6('0x3c')]['findAll'](_0x57099f);})[_0x6cf6('0x21')](function(_0x335dce){_0x5ccc8f['rows']=_0x335dce;return _0x5ccc8f;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x4521af,_0x57099f))[_0x6cf6('0x3d')](handleError(_0x4521af,null));};exports[_0x6cf6('0x3e')]=function(_0x4874c0,_0x10bb9b){var _0x128f7a={'raw':!![],'where':{'id':_0x4874c0[_0x6cf6('0x3f')]['id']}},_0x51d915={};_0x51d915[_0x6cf6('0x28')]=_[_0x6cf6('0x2a')](db[_0x6cf6('0x3c')][_0x6cf6('0x40')]);_0x51d915[_0x6cf6('0x29')]=_[_0x6cf6('0x2a')](_0x4874c0['query']);_0x51d915[_0x6cf6('0x2b')]=_['intersection'](_0x51d915[_0x6cf6('0x28')],_0x51d915[_0x6cf6('0x29')]);_0x128f7a['attributes']=_[_0x6cf6('0x2c')](_0x51d915[_0x6cf6('0x28')],qs[_0x6cf6('0x2e')](_0x4874c0[_0x6cf6('0x29')][_0x6cf6('0x2e')]));_0x128f7a['attributes']=_0x128f7a[_0x6cf6('0x2d')][_0x6cf6('0x2f')]?_0x128f7a[_0x6cf6('0x2d')]:_0x51d915['model'];if(_0x4874c0[_0x6cf6('0x29')][_0x6cf6('0x3a')]){_0x128f7a[_0x6cf6('0x3b')]=[{'all':!![]}];}_0x128f7a=_['merge']({},_0x128f7a,_0x4874c0[_0x6cf6('0x39')]);return db['WhatsappQueueReport']['find'](_0x128f7a)[_0x6cf6('0x21')](handleEntityNotFound(_0x10bb9b,null))[_0x6cf6('0x21')](respondWithResult(_0x10bb9b,null))[_0x6cf6('0x3d')](handleError(_0x10bb9b,null));};exports[_0x6cf6('0x41')]=function(_0xb8788a,_0x311745){return db[_0x6cf6('0x3c')][_0x6cf6('0x41')](_0xb8788a[_0x6cf6('0x42')],{})[_0x6cf6('0x21')](respondWithResult(_0x311745,0xc9))[_0x6cf6('0x3d')](handleError(_0x311745,null));};exports[_0x6cf6('0x20')]=function(_0x3786d1,_0x4c8ada){if(_0x3786d1[_0x6cf6('0x42')]['id']){delete _0x3786d1[_0x6cf6('0x42')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x3786d1[_0x6cf6('0x3f')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x4c8ada,null))[_0x6cf6('0x21')](saveUpdates(_0x3786d1[_0x6cf6('0x42')],null))[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,null))[_0x6cf6('0x3d')](handleError(_0x4c8ada,null));};exports['destroy']=function(_0x115b9b,_0x262c23){return db[_0x6cf6('0x3c')]['find']({'where':{'id':_0x115b9b['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x262c23,null))[_0x6cf6('0x21')](removeEntity(_0x262c23,null))[_0x6cf6('0x3d')](handleError(_0x262c23,null));};exports[_0x6cf6('0x43')]=function(_0x2dbd71,_0x1fb6f1){return db[_0x6cf6('0x3c')][_0x6cf6('0x43')]()[_0x6cf6('0x21')](respondWithResult(_0x1fb6f1,null))[_0x6cf6('0x3d')](handleError(_0x1fb6f1,null));}; \ No newline at end of file +var _0x6b20=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x3a33be,_0x33aab3){var _0x170678=function(_0x4d3246){while(--_0x4d3246){_0x3a33be['push'](_0x3a33be['shift']());}};_0x170678(++_0x33aab3);}(_0x6b20,0xd1));var _0x06b2=function(_0x1a0ff8,_0x52035e){_0x1a0ff8=_0x1a0ff8-0x0;var _0x4e0a7a=_0x6b20[_0x1a0ff8];return _0x4e0a7a;};'use strict';var emlformat=require(_0x06b2('0x0'));var rimraf=require(_0x06b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b2('0x2'));var rp=require('request-promise');var moment=require(_0x06b2('0x3'));var BPromise=require(_0x06b2('0x4'));var Mustache=require(_0x06b2('0x5'));var util=require('util');var path=require(_0x06b2('0x6'));var sox=require(_0x06b2('0x7'));var csv=require(_0x06b2('0x8'));var ejs=require(_0x06b2('0x9'));var fs=require('fs');var fs_extra=require(_0x06b2('0xa'));var _=require(_0x06b2('0xb'));var squel=require(_0x06b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x06b2('0xd'));var deskjs=require(_0x06b2('0xe'));var toCsv=require(_0x06b2('0x8'));var querystring=require('querystring');var Papa=require(_0x06b2('0xf'));var Redis=require('ioredis');var authService=require(_0x06b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06b2('0x11'));var logger=require(_0x06b2('0x12'))('api');var utils=require(_0x06b2('0x13'));var config=require(_0x06b2('0x14'));var licenseUtil=require(_0x06b2('0x15'));var db=require(_0x06b2('0x16'))['db'];function respondWithStatusCode(_0x44a9b4,_0x810a12){_0x810a12=_0x810a12||0xcc;return function(_0x3039c9){if(_0x3039c9){return _0x44a9b4[_0x06b2('0x17')](_0x810a12);}return _0x44a9b4[_0x06b2('0x18')](_0x810a12)[_0x06b2('0x19')]();};}function respondWithResult(_0xa81f11,_0x2822e9){_0x2822e9=_0x2822e9||0xc8;return function(_0x26faee){if(_0x26faee){return _0xa81f11['status'](_0x2822e9)[_0x06b2('0x1a')](_0x26faee);}};}function respondWithFilteredResult(_0xaee98c,_0x47496c){return function(_0x3830e9){if(_0x3830e9){var _0xef0466=typeof _0x47496c[_0x06b2('0x1b')]==='undefined'&&typeof _0x47496c[_0x06b2('0x1c')]===_0x06b2('0x1d');var _0x525945=_0x3830e9[_0x06b2('0x1e')];var _0x594b48=_0xef0466?0x0:_0x47496c['offset'];var _0x192270=_0xef0466?_0x3830e9[_0x06b2('0x1e')]:_0x47496c[_0x06b2('0x1b')]+_0x47496c[_0x06b2('0x1c')];var _0x4c4e21;if(_0x192270>=_0x525945){_0x192270=_0x525945;_0x4c4e21=0xc8;}else{_0x4c4e21=0xce;}_0xaee98c[_0x06b2('0x18')](_0x4c4e21);return _0xaee98c[_0x06b2('0x1f')](_0x06b2('0x20'),_0x594b48+'-'+_0x192270+'/'+_0x525945)[_0x06b2('0x1a')](_0x3830e9);}return null;};}function patchUpdates(_0xe28985){return function(_0x368ad8){try{jsonpatch[_0x06b2('0x21')](_0x368ad8,_0xe28985,!![]);}catch(_0x5ca622){return BPromise[_0x06b2('0x22')](_0x5ca622);}return _0x368ad8[_0x06b2('0x23')]();};}function saveUpdates(_0xb05f65,_0x208384){return function(_0x4e2a4c){if(_0x4e2a4c){return _0x4e2a4c['update'](_0xb05f65)[_0x06b2('0x24')](function(_0xb5231e){return _0xb5231e;});}return null;};}function removeEntity(_0x4fc95f,_0x39659f){return function(_0x5e40f2){if(_0x5e40f2){return _0x5e40f2[_0x06b2('0x25')]()[_0x06b2('0x24')](function(){_0x4fc95f[_0x06b2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4382ce,_0x306ce){return function(_0xc65820){if(!_0xc65820){_0x4382ce[_0x06b2('0x17')](0x194);}return _0xc65820;};}function handleError(_0x1173fc,_0x4f5e90){_0x4f5e90=_0x4f5e90||0x1f4;return function(_0xbb00ea){logger[_0x06b2('0x26')](_0xbb00ea[_0x06b2('0x27')]);if(_0xbb00ea[_0x06b2('0x28')]){delete _0xbb00ea[_0x06b2('0x28')];}_0x1173fc[_0x06b2('0x18')](_0x4f5e90)['send'](_0xbb00ea);};}exports[_0x06b2('0x29')]=function(_0x2a3228,_0x2720fa){var _0x13c0eb={},_0x1f02d8={},_0x1bfaa9={'count':0x0,'rows':[]};var _0x3668bb=_['map'](db[_0x06b2('0x2a')][_0x06b2('0x2b')],function(_0x1637c2){return{'name':_0x1637c2[_0x06b2('0x2c')],'type':_0x1637c2[_0x06b2('0x2d')][_0x06b2('0x2e')]};});_0x1f02d8[_0x06b2('0x2f')]=_[_0x06b2('0x30')](_0x3668bb,'name');_0x1f02d8[_0x06b2('0x31')]=_[_0x06b2('0x32')](_0x2a3228[_0x06b2('0x31')]);_0x1f02d8[_0x06b2('0x33')]=_[_0x06b2('0x34')](_0x1f02d8[_0x06b2('0x2f')],_0x1f02d8[_0x06b2('0x31')]);_0x13c0eb['attributes']=_['intersection'](_0x1f02d8[_0x06b2('0x2f')],qs[_0x06b2('0x35')](_0x2a3228[_0x06b2('0x31')]['fields']));_0x13c0eb[_0x06b2('0x36')]=_0x13c0eb[_0x06b2('0x36')][_0x06b2('0x37')]?_0x13c0eb[_0x06b2('0x36')]:_0x1f02d8[_0x06b2('0x2f')];if(!_0x2a3228[_0x06b2('0x31')]['hasOwnProperty'](_0x06b2('0x38'))){_0x13c0eb[_0x06b2('0x1c')]=qs[_0x06b2('0x1c')](_0x2a3228['query'][_0x06b2('0x1c')]);_0x13c0eb[_0x06b2('0x1b')]=qs['offset'](_0x2a3228[_0x06b2('0x31')][_0x06b2('0x1b')]);}_0x13c0eb[_0x06b2('0x39')]=qs[_0x06b2('0x3a')](_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3a')]);_0x13c0eb[_0x06b2('0x3b')]=qs[_0x06b2('0x33')](_[_0x06b2('0x3c')](_0x2a3228[_0x06b2('0x31')],_0x1f02d8[_0x06b2('0x33')]),_0x3668bb);if(_0x2a3228[_0x06b2('0x31')]['filter']){_0x13c0eb[_0x06b2('0x3b')]=_['merge'](_0x13c0eb['where'],{'$or':_[_0x06b2('0x30')](_0x3668bb,function(_0x4e92e0){if(_0x4e92e0[_0x06b2('0x2d')]!=='VIRTUAL'){var _0x35e29c={};_0x35e29c[_0x4e92e0[_0x06b2('0x28')]]={'$like':'%'+_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3d')]+'%'};return _0x35e29c;}})});}_0x13c0eb=_[_0x06b2('0x3e')]({},_0x13c0eb,_0x2a3228['options']);var _0x404eab={'where':_0x13c0eb[_0x06b2('0x3b')]};return db[_0x06b2('0x2a')][_0x06b2('0x1e')](_0x404eab)[_0x06b2('0x24')](function(_0x39fd60){_0x1bfaa9['count']=_0x39fd60;if(_0x2a3228[_0x06b2('0x31')][_0x06b2('0x3f')]){_0x13c0eb['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x06b2('0x40')](_0x13c0eb);})[_0x06b2('0x24')](function(_0x286c9b){_0x1bfaa9[_0x06b2('0x41')]=_0x286c9b;return _0x1bfaa9;})[_0x06b2('0x24')](respondWithFilteredResult(_0x2720fa,_0x13c0eb))[_0x06b2('0x42')](handleError(_0x2720fa,null));};exports[_0x06b2('0x43')]=function(_0x2ff968,_0x2e2a80){var _0x117bf4={'raw':!![],'where':{'id':_0x2ff968[_0x06b2('0x44')]['id']}},_0x1d7750={};_0x1d7750[_0x06b2('0x2f')]=_[_0x06b2('0x32')](db[_0x06b2('0x2a')][_0x06b2('0x2b')]);_0x1d7750[_0x06b2('0x31')]=_[_0x06b2('0x32')](_0x2ff968[_0x06b2('0x31')]);_0x1d7750['filters']=_[_0x06b2('0x34')](_0x1d7750[_0x06b2('0x2f')],_0x1d7750[_0x06b2('0x31')]);_0x117bf4[_0x06b2('0x36')]=_['intersection'](_0x1d7750[_0x06b2('0x2f')],qs[_0x06b2('0x35')](_0x2ff968['query'][_0x06b2('0x35')]));_0x117bf4[_0x06b2('0x36')]=_0x117bf4['attributes'][_0x06b2('0x37')]?_0x117bf4[_0x06b2('0x36')]:_0x1d7750['model'];if(_0x2ff968['query']['includeAll']){_0x117bf4[_0x06b2('0x45')]=[{'all':!![]}];}_0x117bf4=_[_0x06b2('0x3e')]({},_0x117bf4,_0x2ff968[_0x06b2('0x46')]);return db[_0x06b2('0x2a')][_0x06b2('0x47')](_0x117bf4)['then'](handleEntityNotFound(_0x2e2a80,null))['then'](respondWithResult(_0x2e2a80,null))[_0x06b2('0x42')](handleError(_0x2e2a80,null));};exports[_0x06b2('0x48')]=function(_0x979759,_0x1f4d89){return db[_0x06b2('0x2a')][_0x06b2('0x48')](_0x979759['body'],{})[_0x06b2('0x24')](respondWithResult(_0x1f4d89,0xc9))[_0x06b2('0x42')](handleError(_0x1f4d89,null));};exports[_0x06b2('0x49')]=function(_0x33f72e,_0x146c5c){if(_0x33f72e[_0x06b2('0x4a')]['id']){delete _0x33f72e['body']['id'];}return db[_0x06b2('0x2a')][_0x06b2('0x47')]({'where':{'id':_0x33f72e[_0x06b2('0x44')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x146c5c,null))['then'](saveUpdates(_0x33f72e[_0x06b2('0x4a')],null))[_0x06b2('0x24')](respondWithResult(_0x146c5c,null))[_0x06b2('0x42')](handleError(_0x146c5c,null));};exports[_0x06b2('0x25')]=function(_0x546c9e,_0x346f04){return db[_0x06b2('0x2a')][_0x06b2('0x47')]({'where':{'id':_0x546c9e[_0x06b2('0x44')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x346f04,null))[_0x06b2('0x24')](removeEntity(_0x346f04,null))[_0x06b2('0x42')](handleError(_0x346f04,null));};exports[_0x06b2('0x4b')]=function(_0x568091,_0x33bc8e){return db[_0x06b2('0x2a')][_0x06b2('0x4b')]()[_0x06b2('0x24')](respondWithResult(_0x33bc8e,null))[_0x06b2('0x42')](handleError(_0x33bc8e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 53f8120..11a8292 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 _0x9c91=['../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','lodash','moment','bluebird','request-promise','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9c91,0xcd));var _0x19c9=function(_0x12dd64,_0xfcb8a7){_0x12dd64=_0x12dd64-0x0;var _0x44b60c=_0x9c91[_0x12dd64];return _0x44b60c;};'use strict';var _=require(_0x19c9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x19c9('0x1'));var BPromise=require(_0x19c9('0x2'));var rp=require(_0x19c9('0x3'));var fs=require('fs');var path=require(_0x19c9('0x4'));var rimraf=require('rimraf');var config=require(_0x19c9('0x5'));var attributes=require(_0x19c9('0x6'));module[_0x19c9('0x7')]=function(_0x543706,_0x211004){return _0x543706['define'](_0x19c9('0x8'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x19c9('0x9'),'fields':[_0x19c9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2880=['api','moment','bluebird','path','rimraf','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger'];(function(_0x506b8e,_0x5a7582){var _0x50e77f=function(_0x24cf4f){while(--_0x24cf4f){_0x506b8e['push'](_0x506b8e['shift']());}};_0x50e77f(++_0x5a7582);}(_0x2880,0xb4));var _0x0288=function(_0x5c4d74,_0x1c4c05){_0x5c4d74=_0x5c4d74-0x0;var _0xd2ccf7=_0x2880[_0x5c4d74];return _0xd2ccf7;};'use strict';var _=require('lodash');var util=require(_0x0288('0x0'));var logger=require(_0x0288('0x1'))(_0x0288('0x2'));var moment=require(_0x0288('0x3'));var BPromise=require(_0x0288('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0288('0x5'));var rimraf=require(_0x0288('0x6'));var config=require('../../config/environment');var attributes=require(_0x0288('0x7'));module[_0x0288('0x8')]=function(_0x670e52,_0x416b1d){return _0x670e52[_0x0288('0x9')](_0x0288('0xa'),attributes,{'tableName':_0x0288('0xb'),'paranoid':![],'indexes':[{'name':_0x0288('0xc'),'fields':[_0x0288('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 a1c287f..09e086a 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 _0x2d12=['create','body','options','raw','UpdateWhatsappQueueReport','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport'];(function(_0x372535,_0x7ec79b){var _0x2b636c=function(_0x170232){while(--_0x170232){_0x372535['push'](_0x372535['shift']());}};_0x2b636c(++_0x7ec79b);}(_0x2d12,0x13d));var _0x22d1=function(_0x2a0ab6,_0x337b21){_0x2a0ab6=_0x2a0ab6-0x0;var _0x170ec7=_0x2d12[_0x2a0ab6];return _0x170ec7;};'use strict';var _=require('lodash');var util=require(_0x22d1('0x0'));var moment=require('moment');var BPromise=require(_0x22d1('0x1'));var rs=require(_0x22d1('0x2'));var fs=require('fs');var Redis=require(_0x22d1('0x3'));var db=require(_0x22d1('0x4'))['db'];var utils=require(_0x22d1('0x5'));var logger=require('../../config/logger')(_0x22d1('0x6'));var config=require(_0x22d1('0x7'));var jayson=require(_0x22d1('0x8'));var client=jayson[_0x22d1('0x9')][_0x22d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2447ac,_0x99c399,_0x671dc6){return new BPromise(function(_0x4347b2,_0xae57a5){return client['request'](_0x2447ac,_0x671dc6)[_0x22d1('0xb')](function(_0x5773d4){logger[_0x22d1('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x99c399,_0x22d1('0xd'));logger[_0x22d1('0xe')](_0x22d1('0xf'),_0x99c399,'request\x20sent',JSON[_0x22d1('0x10')](_0x5773d4));if(_0x5773d4['error']){if(_0x5773d4[_0x22d1('0x11')][_0x22d1('0x12')]===0x1f4){logger[_0x22d1('0x11')](_0x22d1('0x13'),_0x99c399,_0x5773d4[_0x22d1('0x11')][_0x22d1('0x14')]);return _0xae57a5(_0x5773d4[_0x22d1('0x11')]['message']);}logger['error'](_0x22d1('0x13'),_0x99c399,_0x5773d4[_0x22d1('0x11')][_0x22d1('0x14')]);return _0x4347b2(_0x5773d4[_0x22d1('0x11')][_0x22d1('0x14')]);}else{logger[_0x22d1('0xc')](_0x22d1('0x13'),_0x99c399,'request\x20sent');_0x4347b2(_0x5773d4['result'][_0x22d1('0x14')]);}})[_0x22d1('0x15')](function(_0x29d823){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x99c399,_0x29d823);_0xae57a5(_0x29d823);});});}exports[_0x22d1('0x16')]=function(_0x5b109a){var _0x1028a3=this;return new Promise(function(_0x1aca17,_0x293e18){return db[_0x22d1('0x17')][_0x22d1('0x18')](_0x5b109a[_0x22d1('0x19')],{'raw':_0x5b109a[_0x22d1('0x1a')]?_0x5b109a[_0x22d1('0x1a')][_0x22d1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5c9373){logger[_0x22d1('0xc')](_0x22d1('0x16'),_0x5b109a);logger[_0x22d1('0xe')](_0x22d1('0x16'),_0x5b109a,JSON[_0x22d1('0x10')](_0x5c9373));_0x1aca17(_0x5c9373);})[_0x22d1('0x15')](function(_0x6468cf){logger['error'](_0x22d1('0x16'),_0x6468cf[_0x22d1('0x14')],_0x5b109a);_0x293e18(_0x1028a3[_0x22d1('0x11')](0x1f4,_0x6468cf[_0x22d1('0x14')]));});});};exports[_0x22d1('0x1c')]=function(_0x4c1772){var _0x920b5d=this;return new Promise(function(_0x108e02,_0xa8cc73){return db[_0x22d1('0x17')]['update'](_0x4c1772[_0x22d1('0x19')],{'raw':_0x4c1772[_0x22d1('0x1a')]?_0x4c1772[_0x22d1('0x1a')][_0x22d1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c1772[_0x22d1('0x1a')]?_0x4c1772['options']['where']||null:null,'attributes':_0x4c1772[_0x22d1('0x1a')]?_0x4c1772['options'][_0x22d1('0x1d')]||null:null,'limit':_0x4c1772[_0x22d1('0x1a')]?_0x4c1772['options'][_0x22d1('0x1e')]||null:null})['then'](function(_0x162441){logger[_0x22d1('0xc')]('UpdateWhatsappQueueReport',_0x4c1772);logger[_0x22d1('0xe')](_0x22d1('0x1c'),_0x4c1772,JSON[_0x22d1('0x10')](_0x162441));_0x108e02(_0x162441);})[_0x22d1('0x15')](function(_0x39589c){logger[_0x22d1('0x11')](_0x22d1('0x1c'),_0x39589c[_0x22d1('0x14')],_0x4c1772);_0xa8cc73(_0x920b5d[_0x22d1('0x11')](0x1f4,_0x39589c[_0x22d1('0x14')]));});});}; \ No newline at end of file +var _0x7d6f=['client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','UpdateWhatsappQueueReport','update','body','where','attributes','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2528b6,_0x17b712){var _0x409a41=function(_0x3a7840){while(--_0x3a7840){_0x2528b6['push'](_0x2528b6['shift']());}};_0x409a41(++_0x17b712);}(_0x7d6f,0x82));var _0xf7d6=function(_0x4bf1ba,_0x11a219){_0x4bf1ba=_0x4bf1ba-0x0;var _0x41c698=_0x7d6f[_0x4bf1ba];return _0x41c698;};'use strict';var _=require(_0xf7d6('0x0'));var util=require(_0xf7d6('0x1'));var moment=require('moment');var BPromise=require(_0xf7d6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7d6('0x3'));var db=require(_0xf7d6('0x4'))['db'];var utils=require(_0xf7d6('0x5'));var logger=require(_0xf7d6('0x6'))(_0xf7d6('0x7'));var config=require(_0xf7d6('0x8'));var jayson=require(_0xf7d6('0x9'));var client=jayson[_0xf7d6('0xa')][_0xf7d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6fd1,_0xfb4516,_0x18aa38){return new BPromise(function(_0xf21873,_0x21d82b){return client[_0xf7d6('0xc')](_0x4a6fd1,_0x18aa38)[_0xf7d6('0xd')](function(_0x34bc3f){logger[_0xf7d6('0xe')](_0xf7d6('0xf'),_0xfb4516,_0xf7d6('0x10'));logger[_0xf7d6('0x11')](_0xf7d6('0x12'),_0xfb4516,_0xf7d6('0x10'),JSON[_0xf7d6('0x13')](_0x34bc3f));if(_0x34bc3f[_0xf7d6('0x14')]){if(_0x34bc3f[_0xf7d6('0x14')][_0xf7d6('0x15')]===0x1f4){logger[_0xf7d6('0x14')](_0xf7d6('0xf'),_0xfb4516,_0x34bc3f['error']['message']);return _0x21d82b(_0x34bc3f[_0xf7d6('0x14')][_0xf7d6('0x16')]);}logger['error'](_0xf7d6('0xf'),_0xfb4516,_0x34bc3f[_0xf7d6('0x14')][_0xf7d6('0x16')]);return _0xf21873(_0x34bc3f[_0xf7d6('0x14')]['message']);}else{logger['info'](_0xf7d6('0xf'),_0xfb4516,_0xf7d6('0x10'));_0xf21873(_0x34bc3f[_0xf7d6('0x17')][_0xf7d6('0x16')]);}})[_0xf7d6('0x18')](function(_0x1b584a){logger[_0xf7d6('0x14')](_0xf7d6('0xf'),_0xfb4516,_0x1b584a);_0x21d82b(_0x1b584a);});});}exports[_0xf7d6('0x19')]=function(_0x26cf55){var _0x26f163=this;return new Promise(function(_0x2bd67b,_0x4d99ae){return db[_0xf7d6('0x1a')][_0xf7d6('0x1b')](_0x26cf55['body'],{'raw':_0x26cf55[_0xf7d6('0x1c')]?_0x26cf55[_0xf7d6('0x1c')][_0xf7d6('0x1d')]===undefined?!![]:![]:!![]})[_0xf7d6('0xd')](function(_0x5a44e0){logger[_0xf7d6('0xe')](_0xf7d6('0x19'),_0x26cf55);logger[_0xf7d6('0x11')](_0xf7d6('0x19'),_0x26cf55,JSON[_0xf7d6('0x13')](_0x5a44e0));_0x2bd67b(_0x5a44e0);})['catch'](function(_0x566a80){logger[_0xf7d6('0x14')]('CreateWhatsappQueueReport',_0x566a80['message'],_0x26cf55);_0x4d99ae(_0x26f163[_0xf7d6('0x14')](0x1f4,_0x566a80[_0xf7d6('0x16')]));});});};exports[_0xf7d6('0x1e')]=function(_0x1c8160){var _0x33a569=this;return new Promise(function(_0x4cd73a,_0x347e03){return db[_0xf7d6('0x1a')][_0xf7d6('0x1f')](_0x1c8160[_0xf7d6('0x20')],{'raw':_0x1c8160[_0xf7d6('0x1c')]?_0x1c8160['options'][_0xf7d6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c8160['options']?_0x1c8160[_0xf7d6('0x1c')][_0xf7d6('0x21')]||null:null,'attributes':_0x1c8160[_0xf7d6('0x1c')]?_0x1c8160[_0xf7d6('0x1c')][_0xf7d6('0x22')]||null:null,'limit':_0x1c8160[_0xf7d6('0x1c')]?_0x1c8160[_0xf7d6('0x1c')]['limit']||null:null})['then'](function(_0x556087){logger[_0xf7d6('0xe')]('UpdateWhatsappQueueReport',_0x1c8160);logger[_0xf7d6('0x11')](_0xf7d6('0x1e'),_0x1c8160,JSON[_0xf7d6('0x13')](_0x556087));_0x4cd73a(_0x556087);})['catch'](function(_0x50466d){logger['error'](_0xf7d6('0x1e'),_0x50466d['message'],_0x1c8160);_0x347e03(_0x33a569[_0xf7d6('0x14')](0x1f4,_0x50466d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4f042c5..3079251 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 _0x167a=['describe','/:id','show','put','update','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x11ba15,_0x258a3e){var _0x2d16ec=function(_0x4e7aee){while(--_0x4e7aee){_0x11ba15['push'](_0x11ba15['shift']());}};_0x2d16ec(++_0x258a3e);}(_0x167a,0x1b6));var _0xa167=function(_0x1bc247,_0x15db1c){_0x1bc247=_0x1bc247-0x0;var _0x1c6960=_0x167a[_0x1bc247];return _0x1c6960;};'use strict';var multer=require(_0xa167('0x0'));var util=require('util');var path=require(_0xa167('0x1'));var timeout=require(_0xa167('0x2'));var express=require('express');var router=express[_0xa167('0x3')]();var fs_extra=require(_0xa167('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa167('0x5'));var config=require('../../config/environment');var controller=require(_0xa167('0x6'));router[_0xa167('0x7')]('/',auth[_0xa167('0x8')](),controller['index']);router[_0xa167('0x7')](_0xa167('0x9'),auth[_0xa167('0x8')](),controller[_0xa167('0xa')]);router[_0xa167('0x7')](_0xa167('0xb'),auth[_0xa167('0x8')](),controller[_0xa167('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa167('0xd')](_0xa167('0xb'),auth[_0xa167('0x8')](),controller[_0xa167('0xe')]);router['delete'](_0xa167('0xb'),auth['isAuthenticated'](),controller[_0xa167('0xf')]);module['exports']=router; \ No newline at end of file +var _0x304f=['get','index','/describe','isAuthenticated','describe','/:id','create','put','delete','destroy','exports','multer','path','express','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x319035,_0x4f88e7){var _0x539b04=function(_0x526223){while(--_0x526223){_0x319035['push'](_0x319035['shift']());}};_0x539b04(++_0x4f88e7);}(_0x304f,0x10a));var _0xf304=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x304f[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xf304('0x0'));var util=require('util');var path=require(_0xf304('0x1'));var timeout=require('connect-timeout');var express=require(_0xf304('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf304('0x3'));var config=require(_0xf304('0x4'));var controller=require(_0xf304('0x5'));router[_0xf304('0x6')]('/',auth['isAuthenticated'](),controller[_0xf304('0x7')]);router[_0xf304('0x6')](_0xf304('0x8'),auth[_0xf304('0x9')](),controller[_0xf304('0xa')]);router[_0xf304('0x6')](_0xf304('0xb'),auth[_0xf304('0x9')](),controller['show']);router['post']('/',auth[_0xf304('0x9')](),controller[_0xf304('0xc')]);router[_0xf304('0xd')](_0xf304('0xb'),auth[_0xf304('0x9')](),controller['update']);router[_0xf304('0xe')](_0xf304('0xb'),auth[_0xf304('0x9')](),controller[_0xf304('0xf')]);module[_0xf304('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 4c9ba04..b88ac17 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 _0x174b=['ENUM','account','agent','queue','DATE','sequelize'];(function(_0x5a4fe4,_0x13daca){var _0x42aa6e=function(_0x42703c){while(--_0x42703c){_0x5a4fe4['push'](_0x5a4fe4['shift']());}};_0x42aa6e(++_0x13daca);}(_0x174b,0x19d));var _0xb174=function(_0x2bd9c0,_0x425c87){_0x2bd9c0=_0x2bd9c0-0x0;var _0x981e97=_0x174b[_0x2bd9c0];return _0x981e97;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb174('0x1')](_0xb174('0x2'),_0xb174('0x3'),_0xb174('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb174('0x5')]}}; \ No newline at end of file +var _0x19e1=['DATE','sequelize','exports','STRING','ENUM','queue'];(function(_0x7d45be,_0xe47eb6){var _0x4865e2=function(_0x499eea){while(--_0x499eea){_0x7d45be['push'](_0x7d45be['shift']());}};_0x4865e2(++_0xe47eb6);}(_0x19e1,0x163));var _0x119e=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x19e1[_0x29d6e6];return _0xc75ff0;};'use strict';var Sequelize=require(_0x119e('0x0'));module[_0x119e('0x1')]={'uniqueid':{'type':Sequelize[_0x119e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x119e('0x3')]('account','agent',_0x119e('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x119e('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 7aa1955..f7199f1 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 _0xeb3b=['destroy','error','stack','name','send','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','WhatsappTransferReport','rawAttributes','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then'];(function(_0x60a8a7,_0x36431c){var _0xb0017e=function(_0x2b62a1){while(--_0x2b62a1){_0x60a8a7['push'](_0x60a8a7['shift']());}};_0xb0017e(++_0x36431c);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x167b19,_0x56081a){_0x167b19=_0x167b19-0x0;var _0x1fcca2=_0xeb3b[_0x167b19];return _0x1fcca2;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];function respondWithStatusCode(_0x19868e,_0x313296){_0x313296=_0x313296||0xcc;return function(_0x5b9ace){if(_0x5b9ace){return _0x19868e['sendStatus'](_0x313296);}return _0x19868e[_0xbeb3('0x19')](_0x313296)[_0xbeb3('0x1a')]();};}function respondWithResult(_0x5f521b,_0x4dfb28){_0x4dfb28=_0x4dfb28||0xc8;return function(_0xed9879){if(_0xed9879){return _0x5f521b[_0xbeb3('0x19')](_0x4dfb28)[_0xbeb3('0x1b')](_0xed9879);}};}function respondWithFilteredResult(_0x43d58a,_0x26daf2){return function(_0x535836){if(_0x535836){var _0x1aeaee=typeof _0x26daf2['offset']===_0xbeb3('0x1c')&&typeof _0x26daf2['limit']==='undefined';var _0x4f8481=_0x535836[_0xbeb3('0x1d')];var _0x44a4bb=_0x1aeaee?0x0:_0x26daf2[_0xbeb3('0x1e')];var _0x10b15d=_0x1aeaee?_0x535836['count']:_0x26daf2[_0xbeb3('0x1e')]+_0x26daf2[_0xbeb3('0x1f')];var _0xe2cc47;if(_0x10b15d>=_0x4f8481){_0x10b15d=_0x4f8481;_0xe2cc47=0xc8;}else{_0xe2cc47=0xce;}_0x43d58a['status'](_0xe2cc47);return _0x43d58a['set'](_0xbeb3('0x20'),_0x44a4bb+'-'+_0x10b15d+'/'+_0x4f8481)['json'](_0x535836);}return null;};}function patchUpdates(_0x1d917b){return function(_0x50b005){try{jsonpatch['apply'](_0x50b005,_0x1d917b,!![]);}catch(_0xfa2736){return BPromise[_0xbeb3('0x21')](_0xfa2736);}return _0x50b005[_0xbeb3('0x22')]();};}function saveUpdates(_0x4bd89e,_0x301899){return function(_0x18ea0f){if(_0x18ea0f){return _0x18ea0f['update'](_0x4bd89e)[_0xbeb3('0x23')](function(_0x366bdb){return _0x366bdb;});}return null;};}function removeEntity(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(_0x278fe4){return _0x278fe4[_0xbeb3('0x24')]()[_0xbeb3('0x23')](function(){_0x55a59d[_0xbeb3('0x19')](0xcc)[_0xbeb3('0x1a')]();});}};}function handleEntityNotFound(_0x84921a,_0x340581){return function(_0x46fe17){if(!_0x46fe17){_0x84921a['sendStatus'](0x194);}return _0x46fe17;};}function handleError(_0x4e695e,_0x1f36b9){_0x1f36b9=_0x1f36b9||0x1f4;return function(_0x520116){logger[_0xbeb3('0x25')](_0x520116[_0xbeb3('0x26')]);if(_0x520116[_0xbeb3('0x27')]){delete _0x520116[_0xbeb3('0x27')];}_0x4e695e['status'](_0x1f36b9)[_0xbeb3('0x28')](_0x520116);};}exports['index']=function(_0x26cd8f,_0xab301c){var _0x5bd93d={},_0x483198={},_0x9b8f13={'count':0x0,'rows':[]};var _0x585c6f=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0xf5dbaf){return{'name':_0xf5dbaf['fieldName'],'type':_0xf5dbaf[_0xbeb3('0x29')][_0xbeb3('0x2a')]};});_0x483198[_0xbeb3('0x2b')]=_[_0xbeb3('0x2c')](_0x585c6f,_0xbeb3('0x27'));_0x483198[_0xbeb3('0x2d')]=_[_0xbeb3('0x2e')](_0x26cd8f[_0xbeb3('0x2d')]);_0x483198[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x483198['model'],_0x483198[_0xbeb3('0x2d')]);_0x5bd93d[_0xbeb3('0x31')]=_['intersection'](_0x483198[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0x5bd93d['attributes']=_0x5bd93d[_0xbeb3('0x31')][_0xbeb3('0x33')]?_0x5bd93d[_0xbeb3('0x31')]:_0x483198[_0xbeb3('0x2b')];if(!_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x34')](_0xbeb3('0x35'))){_0x5bd93d[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x26cd8f['query'][_0xbeb3('0x1f')]);_0x5bd93d['offset']=qs[_0xbeb3('0x1e')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x1e')]);}_0x5bd93d[_0xbeb3('0x36')]=qs[_0xbeb3('0x37')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x37')]);_0x5bd93d[_0xbeb3('0x38')]=qs['filters'](_[_0xbeb3('0x39')](_0x26cd8f['query'],_0x483198['filters']),_0x585c6f);if(_0x26cd8f['query'][_0xbeb3('0x3a')]){_0x5bd93d[_0xbeb3('0x38')]=_[_0xbeb3('0x3b')](_0x5bd93d[_0xbeb3('0x38')],{'$or':_[_0xbeb3('0x2c')](_0x585c6f,function(_0x40f166){if(_0x40f166['type']!==_0xbeb3('0x3c')){var _0x40de8d={};_0x40de8d[_0x40f166[_0xbeb3('0x27')]]={'$like':'%'+_0x26cd8f['query']['filter']+'%'};return _0x40de8d;}})});}_0x5bd93d=_['merge']({},_0x5bd93d,_0x26cd8f[_0xbeb3('0x3d')]);var _0x2a8860={'where':_0x5bd93d[_0xbeb3('0x38')]};return db['WhatsappTransferReport'][_0xbeb3('0x1d')](_0x2a8860)['then'](function(_0x1b6700){_0x9b8f13[_0xbeb3('0x1d')]=_0x1b6700;if(_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x3e')]){_0x5bd93d['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xbeb3('0x3f')](_0x5bd93d);})[_0xbeb3('0x23')](function(_0x3d4262){_0x9b8f13[_0xbeb3('0x40')]=_0x3d4262;return _0x9b8f13;})[_0xbeb3('0x23')](respondWithFilteredResult(_0xab301c,_0x5bd93d))[_0xbeb3('0x41')](handleError(_0xab301c,null));};exports[_0xbeb3('0x42')]=function(_0x4606a6,_0x5758c6){var _0xfcb57f={'raw':!![],'where':{'id':_0x4606a6[_0xbeb3('0x43')]['id']}},_0x39f2d2={};_0x39f2d2[_0xbeb3('0x2b')]=_[_0xbeb3('0x2e')](db[_0xbeb3('0x44')][_0xbeb3('0x45')]);_0x39f2d2['query']=_[_0xbeb3('0x2e')](_0x4606a6[_0xbeb3('0x2d')]);_0x39f2d2[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],_0x39f2d2[_0xbeb3('0x2d')]);_0xfcb57f[_0xbeb3('0x31')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x4606a6[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0xfcb57f[_0xbeb3('0x31')]=_0xfcb57f['attributes'][_0xbeb3('0x33')]?_0xfcb57f[_0xbeb3('0x31')]:_0x39f2d2[_0xbeb3('0x2b')];if(_0x4606a6['query']['includeAll']){_0xfcb57f[_0xbeb3('0x46')]=[{'all':!![]}];}_0xfcb57f=_[_0xbeb3('0x3b')]({},_0xfcb57f,_0x4606a6[_0xbeb3('0x3d')]);return db[_0xbeb3('0x44')]['find'](_0xfcb57f)[_0xbeb3('0x23')](handleEntityNotFound(_0x5758c6,null))['then'](respondWithResult(_0x5758c6,null))['catch'](handleError(_0x5758c6,null));};exports[_0xbeb3('0x47')]=function(_0x393e60,_0x1ff297){return db[_0xbeb3('0x44')]['create'](_0x393e60[_0xbeb3('0x48')],{})[_0xbeb3('0x23')](respondWithResult(_0x1ff297,0xc9))[_0xbeb3('0x41')](handleError(_0x1ff297,null));};exports['update']=function(_0x3f93ab,_0x58c49f){if(_0x3f93ab['body']['id']){delete _0x3f93ab[_0xbeb3('0x48')]['id'];}return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x3f93ab['params']['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x58c49f,null))[_0xbeb3('0x23')](saveUpdates(_0x3f93ab[_0xbeb3('0x48')],null))['then'](respondWithResult(_0x58c49f,null))[_0xbeb3('0x41')](handleError(_0x58c49f,null));};exports['destroy']=function(_0x39605b,_0x4d8e21){return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x39605b[_0xbeb3('0x43')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x4d8e21,null))[_0xbeb3('0x23')](removeEntity(_0x4d8e21,null))[_0xbeb3('0x41')](handleError(_0x4d8e21,null));};exports[_0xbeb3('0x4a')]=function(_0x168434,_0x49fded){return db[_0xbeb3('0x44')][_0xbeb3('0x4a')]()[_0xbeb3('0x23')](respondWithResult(_0x49fded,null))[_0xbeb3('0x41')](handleError(_0x49fded,null));}; \ No newline at end of file +var _0x37e0=['save','update','then','error','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','findAll','rows','show','params','keys','includeAll','include','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x37e0,0x13f));var _0x037e=function(_0x419e8b,_0x3d6c17){_0x419e8b=_0x419e8b-0x0;var _0xc495ae=_0x37e0[_0x419e8b];return _0xc495ae;};'use strict';var emlformat=require(_0x037e('0x0'));var rimraf=require(_0x037e('0x1'));var zipdir=require(_0x037e('0x2'));var jsonpatch=require(_0x037e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x037e('0x4'));var Mustache=require(_0x037e('0x5'));var util=require(_0x037e('0x6'));var path=require(_0x037e('0x7'));var sox=require('sox');var csv=require(_0x037e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x037e('0x9'));var squel=require(_0x037e('0xa'));var crypto=require(_0x037e('0xb'));var jsforce=require(_0x037e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x037e('0x8'));var querystring=require(_0x037e('0xd'));var Papa=require('papaparse');var Redis=require(_0x037e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x037e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x037e('0x10'));var logger=require('../../config/logger')(_0x037e('0x11'));var utils=require(_0x037e('0x12'));var config=require(_0x037e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x037e('0x14'))['db'];function respondWithStatusCode(_0x2126b9,_0x33409e){_0x33409e=_0x33409e||0xcc;return function(_0x19a0a4){if(_0x19a0a4){return _0x2126b9[_0x037e('0x15')](_0x33409e);}return _0x2126b9[_0x037e('0x16')](_0x33409e)[_0x037e('0x17')]();};}function respondWithResult(_0x329a99,_0x5dc672){_0x5dc672=_0x5dc672||0xc8;return function(_0xe5422a){if(_0xe5422a){return _0x329a99[_0x037e('0x16')](_0x5dc672)[_0x037e('0x18')](_0xe5422a);}};}function respondWithFilteredResult(_0x42e84c,_0x311404){return function(_0x155c1c){if(_0x155c1c){var _0x51ac07=typeof _0x311404[_0x037e('0x19')]===_0x037e('0x1a')&&typeof _0x311404[_0x037e('0x1b')]==='undefined';var _0x4d3efc=_0x155c1c[_0x037e('0x1c')];var _0x587dae=_0x51ac07?0x0:_0x311404[_0x037e('0x19')];var _0x5340d7=_0x51ac07?_0x155c1c[_0x037e('0x1c')]:_0x311404[_0x037e('0x19')]+_0x311404[_0x037e('0x1b')];var _0xc1465b;if(_0x5340d7>=_0x4d3efc){_0x5340d7=_0x4d3efc;_0xc1465b=0xc8;}else{_0xc1465b=0xce;}_0x42e84c[_0x037e('0x16')](_0xc1465b);return _0x42e84c[_0x037e('0x1d')](_0x037e('0x1e'),_0x587dae+'-'+_0x5340d7+'/'+_0x4d3efc)[_0x037e('0x18')](_0x155c1c);}return null;};}function patchUpdates(_0x2cc661){return function(_0x775137){try{jsonpatch['apply'](_0x775137,_0x2cc661,!![]);}catch(_0x257c4e){return BPromise['reject'](_0x257c4e);}return _0x775137[_0x037e('0x1f')]();};}function saveUpdates(_0x318d61,_0x26dd4a){return function(_0x1fed73){if(_0x1fed73){return _0x1fed73[_0x037e('0x20')](_0x318d61)[_0x037e('0x21')](function(_0x491e82){return _0x491e82;});}return null;};}function removeEntity(_0x20c1dc,_0x2f97c7){return function(_0x16eb52){if(_0x16eb52){return _0x16eb52['destroy']()[_0x037e('0x21')](function(){_0x20c1dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50418e,_0x11460b){return function(_0x5241ff){if(!_0x5241ff){_0x50418e[_0x037e('0x15')](0x194);}return _0x5241ff;};}function handleError(_0x41045f,_0x543e13){_0x543e13=_0x543e13||0x1f4;return function(_0x23b027){logger[_0x037e('0x22')](_0x23b027['stack']);if(_0x23b027[_0x037e('0x23')]){delete _0x23b027[_0x037e('0x23')];}_0x41045f['status'](_0x543e13)[_0x037e('0x24')](_0x23b027);};}exports['index']=function(_0x552028,_0xffc075){var _0xd720={},_0x2b3897={},_0x3e0606={'count':0x0,'rows':[]};var _0x94a511=_[_0x037e('0x25')](db[_0x037e('0x26')][_0x037e('0x27')],function(_0x5ab25c){return{'name':_0x5ab25c[_0x037e('0x28')],'type':_0x5ab25c['type'][_0x037e('0x29')]};});_0x2b3897[_0x037e('0x2a')]=_[_0x037e('0x25')](_0x94a511,_0x037e('0x23'));_0x2b3897[_0x037e('0x2b')]=_['keys'](_0x552028[_0x037e('0x2b')]);_0x2b3897[_0x037e('0x2c')]=_[_0x037e('0x2d')](_0x2b3897[_0x037e('0x2a')],_0x2b3897['query']);_0xd720[_0x037e('0x2e')]=_[_0x037e('0x2d')](_0x2b3897[_0x037e('0x2a')],qs[_0x037e('0x2f')](_0x552028[_0x037e('0x2b')]['fields']));_0xd720[_0x037e('0x2e')]=_0xd720['attributes'][_0x037e('0x30')]?_0xd720[_0x037e('0x2e')]:_0x2b3897['model'];if(!_0x552028[_0x037e('0x2b')][_0x037e('0x31')]('nolimit')){_0xd720[_0x037e('0x1b')]=qs[_0x037e('0x1b')](_0x552028['query']['limit']);_0xd720['offset']=qs[_0x037e('0x19')](_0x552028[_0x037e('0x2b')]['offset']);}_0xd720[_0x037e('0x32')]=qs[_0x037e('0x33')](_0x552028[_0x037e('0x2b')]['sort']);_0xd720['where']=qs[_0x037e('0x2c')](_[_0x037e('0x34')](_0x552028[_0x037e('0x2b')],_0x2b3897['filters']),_0x94a511);if(_0x552028[_0x037e('0x2b')][_0x037e('0x35')]){_0xd720[_0x037e('0x36')]=_[_0x037e('0x37')](_0xd720['where'],{'$or':_[_0x037e('0x25')](_0x94a511,function(_0x3889d6){if(_0x3889d6['type']!=='VIRTUAL'){var _0x364229={};_0x364229[_0x3889d6[_0x037e('0x23')]]={'$like':'%'+_0x552028[_0x037e('0x2b')][_0x037e('0x35')]+'%'};return _0x364229;}})});}_0xd720=_[_0x037e('0x37')]({},_0xd720,_0x552028[_0x037e('0x38')]);var _0x2e7e4e={'where':_0xd720['where']};return db[_0x037e('0x26')][_0x037e('0x1c')](_0x2e7e4e)[_0x037e('0x21')](function(_0x32d2d1){_0x3e0606[_0x037e('0x1c')]=_0x32d2d1;if(_0x552028['query']['includeAll']){_0xd720['include']=[{'all':!![]}];}return db[_0x037e('0x26')][_0x037e('0x39')](_0xd720);})[_0x037e('0x21')](function(_0x20ef49){_0x3e0606[_0x037e('0x3a')]=_0x20ef49;return _0x3e0606;})['then'](respondWithFilteredResult(_0xffc075,_0xd720))['catch'](handleError(_0xffc075,null));};exports[_0x037e('0x3b')]=function(_0x2b629d,_0x4d41c8){var _0x30dff4={'raw':!![],'where':{'id':_0x2b629d[_0x037e('0x3c')]['id']}},_0x4171af={};_0x4171af[_0x037e('0x2a')]=_[_0x037e('0x3d')](db[_0x037e('0x26')][_0x037e('0x27')]);_0x4171af[_0x037e('0x2b')]=_[_0x037e('0x3d')](_0x2b629d[_0x037e('0x2b')]);_0x4171af[_0x037e('0x2c')]=_[_0x037e('0x2d')](_0x4171af['model'],_0x4171af['query']);_0x30dff4[_0x037e('0x2e')]=_['intersection'](_0x4171af[_0x037e('0x2a')],qs[_0x037e('0x2f')](_0x2b629d['query'][_0x037e('0x2f')]));_0x30dff4[_0x037e('0x2e')]=_0x30dff4[_0x037e('0x2e')][_0x037e('0x30')]?_0x30dff4[_0x037e('0x2e')]:_0x4171af[_0x037e('0x2a')];if(_0x2b629d[_0x037e('0x2b')][_0x037e('0x3e')]){_0x30dff4[_0x037e('0x3f')]=[{'all':!![]}];}_0x30dff4=_[_0x037e('0x37')]({},_0x30dff4,_0x2b629d[_0x037e('0x38')]);return db['WhatsappTransferReport'][_0x037e('0x40')](_0x30dff4)[_0x037e('0x21')](handleEntityNotFound(_0x4d41c8,null))['then'](respondWithResult(_0x4d41c8,null))[_0x037e('0x41')](handleError(_0x4d41c8,null));};exports[_0x037e('0x42')]=function(_0x54d693,_0x48782f){return db['WhatsappTransferReport'][_0x037e('0x42')](_0x54d693['body'],{})[_0x037e('0x21')](respondWithResult(_0x48782f,0xc9))['catch'](handleError(_0x48782f,null));};exports[_0x037e('0x20')]=function(_0x3b2ab0,_0x4d98a0){if(_0x3b2ab0[_0x037e('0x43')]['id']){delete _0x3b2ab0[_0x037e('0x43')]['id'];}return db[_0x037e('0x26')][_0x037e('0x40')]({'where':{'id':_0x3b2ab0['params']['id']}})[_0x037e('0x21')](handleEntityNotFound(_0x4d98a0,null))[_0x037e('0x21')](saveUpdates(_0x3b2ab0[_0x037e('0x43')],null))[_0x037e('0x21')](respondWithResult(_0x4d98a0,null))[_0x037e('0x41')](handleError(_0x4d98a0,null));};exports[_0x037e('0x44')]=function(_0x3f457e,_0x47cbff){return db[_0x037e('0x26')][_0x037e('0x40')]({'where':{'id':_0x3f457e[_0x037e('0x3c')]['id']}})[_0x037e('0x21')](handleEntityNotFound(_0x47cbff,null))['then'](removeEntity(_0x47cbff,null))[_0x037e('0x41')](handleError(_0x47cbff,null));};exports[_0x037e('0x45')]=function(_0x54f25f,_0x3f54ea){return db[_0x037e('0x26')]['describe']()[_0x037e('0x21')](respondWithResult(_0x3f54ea,null))[_0x037e('0x41')](handleError(_0x3f54ea,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d988ec8..a3eb92c 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 _0x4e62=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2ce5d1,_0x3127d1){var _0xb02cb3=function(_0x3c6065){while(--_0x3c6065){_0x2ce5d1['push'](_0x2ce5d1['shift']());}};_0xb02cb3(++_0x3127d1);}(_0x4e62,0xdd));var _0x24e6=function(_0x25827b,_0x3eae29){_0x25827b=_0x25827b-0x0;var _0x45be11=_0x4e62[_0x25827b];return _0x45be11;};'use strict';var _=require(_0x24e6('0x0'));var util=require(_0x24e6('0x1'));var logger=require(_0x24e6('0x2'))(_0x24e6('0x3'));var moment=require(_0x24e6('0x4'));var BPromise=require(_0x24e6('0x5'));var rp=require(_0x24e6('0x6'));var fs=require('fs');var path=require(_0x24e6('0x7'));var rimraf=require(_0x24e6('0x8'));var config=require(_0x24e6('0x9'));var attributes=require(_0x24e6('0xa'));module[_0x24e6('0xb')]=function(_0x22422e,_0x374188){return _0x22422e[_0x24e6('0xc')](_0x24e6('0xd'),attributes,{'tableName':_0x24e6('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x24e6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b74=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x30eb6f,_0x33aeab){var _0x127d40=function(_0x2986e4){while(--_0x2986e4){_0x30eb6f['push'](_0x30eb6f['shift']());}};_0x127d40(++_0x33aeab);}(_0x8b74,0x95));var _0x48b7=function(_0x177ebe,_0x29c72a){_0x177ebe=_0x177ebe-0x0;var _0x594c3e=_0x8b74[_0x177ebe];return _0x594c3e;};'use strict';var _=require(_0x48b7('0x0'));var util=require('util');var logger=require(_0x48b7('0x1'))('api');var moment=require(_0x48b7('0x2'));var BPromise=require(_0x48b7('0x3'));var rp=require(_0x48b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48b7('0x5'));var config=require(_0x48b7('0x6'));var attributes=require(_0x48b7('0x7'));module[_0x48b7('0x8')]=function(_0xb2d051,_0x5a1d93){return _0xb2d051[_0x48b7('0x9')](_0x48b7('0xa'),attributes,{'tableName':_0x48b7('0xb'),'paranoid':![],'indexes':[{'name':_0x48b7('0xc'),'fields':[_0x48b7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 6d4eb6e..c0cb1de 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 _0x586c=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23f9a2,_0x100f15){var _0x4d47ac=function(_0x195b85){while(--_0x195b85){_0x23f9a2['push'](_0x23f9a2['shift']());}};_0x4d47ac(++_0x100f15);}(_0x586c,0x18b));var _0xc586=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0x586c[_0x39e2d7];return _0x413d0d;};'use strict';var _=require(_0xc586('0x0'));var util=require(_0xc586('0x1'));var moment=require(_0xc586('0x2'));var BPromise=require(_0xc586('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc586('0x4'));var db=require(_0xc586('0x5'))['db'];var utils=require(_0xc586('0x6'));var logger=require(_0xc586('0x7'))(_0xc586('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc586('0x9')][_0xc586('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x496f4e,_0x225aa3,_0x156832){return new BPromise(function(_0x37a170,_0x4d837b){return client[_0xc586('0xb')](_0x496f4e,_0x156832)['then'](function(_0xb0f9f8){logger[_0xc586('0xc')](_0xc586('0xd'),_0x225aa3,_0xc586('0xe'));logger[_0xc586('0xf')](_0xc586('0x10'),_0x225aa3,_0xc586('0xe'),JSON[_0xc586('0x11')](_0xb0f9f8));if(_0xb0f9f8[_0xc586('0x12')]){if(_0xb0f9f8['error'][_0xc586('0x13')]===0x1f4){logger[_0xc586('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x225aa3,_0xb0f9f8[_0xc586('0x12')]['message']);return _0x4d837b(_0xb0f9f8[_0xc586('0x12')][_0xc586('0x14')]);}logger[_0xc586('0x12')](_0xc586('0xd'),_0x225aa3,_0xb0f9f8[_0xc586('0x12')][_0xc586('0x14')]);return _0x37a170(_0xb0f9f8[_0xc586('0x12')]['message']);}else{logger[_0xc586('0xc')](_0xc586('0xd'),_0x225aa3,_0xc586('0xe'));_0x37a170(_0xb0f9f8[_0xc586('0x15')][_0xc586('0x14')]);}})[_0xc586('0x16')](function(_0x14bd0f){logger['error'](_0xc586('0xd'),_0x225aa3,_0x14bd0f);_0x4d837b(_0x14bd0f);});});} \ No newline at end of file +var _0x13d3=['error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4cfcbf,_0x7804a2){var _0x152d90=function(_0x17e3af){while(--_0x17e3af){_0x4cfcbf['push'](_0x4cfcbf['shift']());}};_0x152d90(++_0x7804a2);}(_0x13d3,0x88));var _0x313d=function(_0x3af393,_0x3f6ed9){_0x3af393=_0x3af393-0x0;var _0x201105=_0x13d3[_0x3af393];return _0x201105;};'use strict';var _=require(_0x313d('0x0'));var util=require('util');var moment=require(_0x313d('0x1'));var BPromise=require(_0x313d('0x2'));var rs=require(_0x313d('0x3'));var fs=require('fs');var Redis=require(_0x313d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x313d('0x5'));var logger=require(_0x313d('0x6'))(_0x313d('0x7'));var config=require(_0x313d('0x8'));var jayson=require(_0x313d('0x9'));var client=jayson[_0x313d('0xa')][_0x313d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b5e97,_0x47c9fe,_0x164d31){return new BPromise(function(_0x58e43a,_0x529644){return client[_0x313d('0xc')](_0x5b5e97,_0x164d31)['then'](function(_0x3b3b57){logger['info'](_0x313d('0xd'),_0x47c9fe,_0x313d('0xe'));logger[_0x313d('0xf')](_0x313d('0x10'),_0x47c9fe,_0x313d('0xe'),JSON[_0x313d('0x11')](_0x3b3b57));if(_0x3b3b57['error']){if(_0x3b3b57[_0x313d('0x12')]['code']===0x1f4){logger[_0x313d('0x12')](_0x313d('0xd'),_0x47c9fe,_0x3b3b57[_0x313d('0x12')][_0x313d('0x13')]);return _0x529644(_0x3b3b57[_0x313d('0x12')][_0x313d('0x13')]);}logger[_0x313d('0x12')](_0x313d('0xd'),_0x47c9fe,_0x3b3b57[_0x313d('0x12')]['message']);return _0x58e43a(_0x3b3b57[_0x313d('0x12')][_0x313d('0x13')]);}else{logger[_0x313d('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47c9fe,_0x313d('0xe'));_0x58e43a(_0x3b3b57['result'][_0x313d('0x13')]);}})[_0x313d('0x15')](function(_0x58d623){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x47c9fe,_0x58d623);_0x529644(_0x58d623);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 3a7f32c..e28c500 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c7b=['./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/logger','app','./config/pm2'];(function(_0x5a4484,_0x2b327e){var _0x3101b9=function(_0x6230d3){while(--_0x6230d3){_0x5a4484['push'](_0x5a4484['shift']());}};_0x3101b9(++_0x2b327e);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x5e658f,_0x5e3925){_0x5e658f=_0x5e658f-0x0;var _0x1bf1c7=_0x6c7b[_0x5e658f];return _0x1bf1c7;};'use strict';var _=require(_0xb6c7('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0xb6c7('0x1'));var config=require('./config/environment');var logger=require(_0xb6c7('0x2'))(_0xb6c7('0x3'));var pm2=require(_0xb6c7('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xb6c7('0x5'));var chat=require(_0xb6c7('0x6'));var whatsapp=require(_0xb6c7('0x7'));var transcribe=require(_0xb6c7('0x8'));var provider=require(_0xb6c7('0x9'));function main(){return db['sequelize'][_0xb6c7('0xa')]()[_0xb6c7('0xb')](function(){if(config[_0xb6c7('0xc')]){return seedDb[_0xb6c7('0xd')]();}})[_0xb6c7('0xb')](function(){return checkLicense[_0xb6c7('0xd')]();})[_0xb6c7('0xb')](function(){return rpc[_0xb6c7('0xe')]();})['then'](function(_0x5cff81){logger[_0xb6c7('0xf')](_0x5cff81);return chat[_0xb6c7('0x10')]();})[_0xb6c7('0xb')](function(){return whatsapp[_0xb6c7('0x10')]();})[_0xb6c7('0xb')](function(){return schedule[_0xb6c7('0x10')]();})[_0xb6c7('0xb')](function(){return transcribe['start']();})[_0xb6c7('0xb')](function(){return provider[_0xb6c7('0x10')]();})[_0xb6c7('0xb')](function(_0xd6fb50){logger[_0xb6c7('0xf')](_0xd6fb50);return pm2[_0xb6c7('0x10')](pm2Config);})[_0xb6c7('0xb')](function(_0x561eb4){var _0x3c7ff4=_0x561eb4['filter'](function(_0x480d9a){return typeof _0x480d9a['exitCode']===_0xb6c7('0x11')&&_0x480d9a['exitCode']>=0x0;});if(_0x3c7ff4[_0xb6c7('0x12')]>0x0){throw new Error(_0x3c7ff4[_0xb6c7('0x12')]+_0xb6c7('0x13')+_[_0xb6c7('0x14')](_0x3c7ff4,function(_0x209659){return'\x22'+_0x209659[_0xb6c7('0x15')][_0xb6c7('0x16')]+'\x22';}));}logger[_0xb6c7('0xf')](_0xb6c7('0x17'),_[_0xb6c7('0x14')](_[_0xb6c7('0x18')](_0x561eb4,{'status':_0xb6c7('0x19')}),_0xb6c7('0x16'))['join']());logger[_0xb6c7('0xf')](_0xb6c7('0x1a'),_['map'](_[_0xb6c7('0x18')](_0x561eb4,function(_0x5a1c0a){return _0x5a1c0a[_0xb6c7('0x1b')]!=='online';}),_0xb6c7('0x16'))['join']()||_0xb6c7('0x1c'));console[_0xb6c7('0x1d')]('App\x20Ready!');})[_0xb6c7('0x1e')](function(_0x3ff28f){console[_0xb6c7('0x1d')](_0xb6c7('0x1f'),_0x3ff28f);logger[_0xb6c7('0x20')](_0xb6c7('0x21'),_0x3ff28f);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x5075=['./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','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'];(function(_0x543a31,_0x575d9b){var _0x5a3518=function(_0x4122e5){while(--_0x4122e5){_0x543a31['push'](_0x543a31['shift']());}};_0x5a3518(++_0x575d9b);}(_0x5075,0x73));var _0x5507=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x5075[_0x4695ba];return _0x524b7d;};'use strict';var _=require(_0x5507('0x0'));var db=require(_0x5507('0x1'))['db'];var seedDb=require(_0x5507('0x2'));var checkLicense=require(_0x5507('0x3'));var rpc=require(_0x5507('0x4'));var config=require(_0x5507('0x5'));var logger=require(_0x5507('0x6'))('app');var pm2=require(_0x5507('0x7'));var pm2Config=require(_0x5507('0x8'));var schedule=require(_0x5507('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x5507('0xa'));var provider=require(_0x5507('0xb'));function main(){return db['sequelize'][_0x5507('0xc')]()[_0x5507('0xd')](function(){if(config[_0x5507('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x5507('0xf')]();})[_0x5507('0xd')](function(){return rpc[_0x5507('0x10')]();})[_0x5507('0xd')](function(_0x50d6f5){logger[_0x5507('0x11')](_0x50d6f5);return chat[_0x5507('0x12')]();})['then'](function(){return whatsapp[_0x5507('0x12')]();})[_0x5507('0xd')](function(){return schedule['start']();})[_0x5507('0xd')](function(){return transcribe[_0x5507('0x12')]();})[_0x5507('0xd')](function(){return provider[_0x5507('0x12')]();})[_0x5507('0xd')](function(_0x1f3886){logger['info'](_0x1f3886);return pm2[_0x5507('0x12')](pm2Config);})[_0x5507('0xd')](function(_0xc828e5){var _0x46545d=_0xc828e5['filter'](function(_0x49e400){return typeof _0x49e400[_0x5507('0x13')]===_0x5507('0x14')&&_0x49e400[_0x5507('0x13')]>=0x0;});if(_0x46545d[_0x5507('0x15')]>0x0){throw new Error(_0x46545d[_0x5507('0x15')]+_0x5507('0x16')+_[_0x5507('0x17')](_0x46545d,function(_0x3d1619){return'\x22'+_0x3d1619[_0x5507('0x18')][_0x5507('0x19')]+'\x22';}));}logger[_0x5507('0x11')](_0x5507('0x1a'),_['map'](_[_0x5507('0x1b')](_0xc828e5,{'status':_0x5507('0x1c')}),_0x5507('0x19'))[_0x5507('0x1d')]());logger['info'](_0x5507('0x1e'),_[_0x5507('0x17')](_[_0x5507('0x1b')](_0xc828e5,function(_0x3ca1f7){return _0x3ca1f7[_0x5507('0x1f')]!==_0x5507('0x1c');}),'name')[_0x5507('0x1d')]()||_0x5507('0x20'));console[_0x5507('0x21')](_0x5507('0x22'));})[_0x5507('0x23')](function(_0x2de482){console[_0x5507('0x21')](_0x5507('0x24'),_0x2de482);logger[_0x5507('0x25')](_0x5507('0x26'),_0x2de482);process[_0x5507('0x27')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 158f51e..e1d4776 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 _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x309fbd,_0xdd380d){var _0x20c2fd=function(_0x4fc590){while(--_0x4fc590){_0x309fbd['push'](_0x309fbd['shift']());}};_0x20c2fd(++_0xdd380d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x00bb[_0x110c3d];return _0x226d67;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('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[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});} \ No newline at end of file +var _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x4f7431,_0x147869){var _0x3ae758=function(_0x14b767){while(--_0x14b767){_0x4f7431['push'](_0x4f7431['shift']());}};_0x3ae758(++_0x147869);}(_0x00bb,0x1d8));var _0xb00b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x00bb[_0xae7c2f];return _0x5d7001;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('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[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 06deeac..72e8015 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 _0x2642=['close','unlink','createDecipher','update','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../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','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','final'];(function(_0x1a4c27,_0x5a4b45){var _0x578d9=function(_0x10b6df){while(--_0x10b6df){_0x1a4c27['push'](_0x1a4c27['shift']());}};_0x578d9(++_0x5a4b45);}(_0x2642,0x13a));var _0x2264=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2642[_0x3947c9];return _0x2e7871;};'use strict';var crypto=require(_0x2264('0x0'));var fs=require('fs');var BPromise=require(_0x2264('0x1'));var _=require(_0x2264('0x2'));var config=require('../../config/environment');var logger=require(_0x2264('0x3'))(_0x2264('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x2264('0x5')],'algorithm':_0x2264('0x6')};const fileOptions={'algorithm':_0x2264('0x7')};if(config['encrypt']&&config[_0x2264('0x8')][_0x2264('0x9')]){var isSupported=isAlgorithmSupported(config[_0x2264('0x8')][_0x2264('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x2264('0x8')][_0x2264('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2264('0xa')](',\x20');logger[_0x2264('0xb')](config['encrypt'][_0x2264('0x9')],_0x2264('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0xd4f020){return AES_SUPPORTED_RX[_0x2264('0xd')](_0xd4f020);}function getSupportedCiphers(){return crypto[_0x2264('0xe')]()[_0x2264('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x59ce5e){return getSupportedCiphers()['indexOf'](_0x59ce5e)>-0x1;}function combineOptions(_0x3489da){var _0x5e68c2={};for(var _0x3ad1b3 in fileOptions){if(fileOptions[_0x2264('0x10')](_0x3ad1b3)){_0x5e68c2[_0x3ad1b3]=fileOptions[_0x3ad1b3];}}if(_0x3489da){for(var _0x3453cf in _0x3489da){if(_0x3489da[_0x2264('0x10')](_0x3453cf)){_0x5e68c2[_0x3453cf]=_0x3489da[_0x3453cf];}}}return _0x5e68c2;}exports[_0x2264('0x11')]=function(_0x4ae995,_0x4c2024,_0x49c27b,_0x232d8d){return new BPromise(function(_0x302dce,_0x346f2a){_0x232d8d=combineOptions(_0x232d8d);var _0x614313=new Buffer(_0x49c27b);var _0x2bf4e5=fs[_0x2264('0x12')](_0x4ae995);var _0x1800aa=fs[_0x2264('0x13')](_0x4c2024);var _0x7a6211=crypto[_0x2264('0x14')](_0x232d8d[_0x2264('0x9')],_0x614313);_0x2bf4e5['on'](_0x2264('0x15'),function(_0x1117ba){var _0x229fe5=new Buffer(_0x7a6211['update'](_0x1117ba),_0x2264('0x16'));_0x1800aa[_0x2264('0x17')](_0x229fe5);});_0x2bf4e5['on'](_0x2264('0x18'),function(){try{var _0x57f230=new Buffer(_0x7a6211[_0x2264('0x19')](_0x2264('0x16')),'binary');_0x1800aa[_0x2264('0x17')](_0x57f230);_0x1800aa['end']();_0x1800aa['on'](_0x2264('0x1a'),function(){return _0x302dce(_0x4c2024);});}catch(_0x598882){fs[_0x2264('0x1b')](_0x4c2024);return _0x346f2a(_0x598882);}});});};exports['decryptFile']=function(_0x5005af,_0x5c9348,_0x3020db,_0x44bd3d){return new BPromise(function(_0x1b85f9,_0x52460f){_0x44bd3d=combineOptions(_0x44bd3d);var _0x19c6b0=new Buffer(_0x3020db);var _0x4059de=fs[_0x2264('0x12')](_0x5005af);var _0x4db82c=fs[_0x2264('0x13')](_0x5c9348);var _0x4714a6=crypto[_0x2264('0x1c')](_0x44bd3d['algorithm'],_0x19c6b0);_0x4059de['on'](_0x2264('0x15'),function(_0x1f3cd9){var _0x5cf569=new Buffer(_0x4714a6[_0x2264('0x1d')](_0x1f3cd9),_0x2264('0x16'));_0x4db82c[_0x2264('0x17')](_0x5cf569);});_0x4059de['on'](_0x2264('0x18'),function(){try{var _0x24c792=new Buffer(_0x4714a6[_0x2264('0x19')]('binary'),_0x2264('0x16'));_0x4db82c[_0x2264('0x17')](_0x24c792);_0x4db82c[_0x2264('0x18')]();_0x4db82c['on']('close',function(){return _0x1b85f9(_0x5c9348);});}catch(_0x3098d5){fs[_0x2264('0x1b')](_0x5c9348);return _0x52460f(_0x3098d5);}});});};exports['encryptString']=function(_0x3bddb6,_0x21775e,_0x4c8ecd){var _0x4434f0=_0x4c8ecd||stringOptions['algorithm'];var _0x54792c=_0x21775e||stringOptions[_0x2264('0x1e')];var _0x5366fb=crypto[_0x2264('0x14')](_0x4434f0,_0x54792c);var _0x179838=_0x5366fb['update'](_0x3bddb6,'utf8',_0x2264('0x1f'));_0x179838+=_0x5366fb[_0x2264('0x19')]('base64');return _0x179838;};exports[_0x2264('0x20')]=function(_0x28c515,_0x1fabe3,_0x1fee8a){var _0x5343a2=_0x1fee8a||stringOptions['algorithm'];var _0x2cd351=_0x1fabe3||stringOptions[_0x2264('0x1e')];var _0x2571f2=crypto[_0x2264('0x1c')](_0x5343a2,_0x2cd351);var _0x4f85cc=_0x2571f2[_0x2264('0x1d')](_0x28c515,'base64','utf8');_0x4f85cc+=_0x2571f2['final'](_0x2264('0x21'));return _0x4f85cc;}; \ No newline at end of file +var _0x9895=['data','update','binary','write','final','end','close','unlink','decryptFile','secret','base64','decryptString','createDecipher','utf8','crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher'];(function(_0x5f5ae8,_0x4d9515){var _0x367966=function(_0x3a1b5f){while(--_0x3a1b5f){_0x5f5ae8['push'](_0x5f5ae8['shift']());}};_0x367966(++_0x4d9515);}(_0x9895,0xc2));var _0x5989=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9895[_0xfae23b];return _0x200640;};'use strict';var crypto=require(_0x5989('0x0'));var fs=require('fs');var BPromise=require(_0x5989('0x1'));var _=require(_0x5989('0x2'));var config=require('../../config/environment');var logger=require(_0x5989('0x3'))(_0x5989('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5989('0x5')][_0x5989('0x6')],'algorithm':_0x5989('0x7')};const fileOptions={'algorithm':_0x5989('0x8')};if(config['encrypt']&&config[_0x5989('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x5989('0x9')][_0x5989('0xa')]);if(isSupported){fileOptions['algorithm']=config[_0x5989('0x9')][_0x5989('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5989('0xb')](',\x20');logger[_0x5989('0xc')](config[_0x5989('0x9')][_0x5989('0xa')],_0x5989('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x290bc3){return AES_SUPPORTED_RX['test'](_0x290bc3);}function getSupportedCiphers(){return crypto[_0x5989('0xe')]()[_0x5989('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x3b6c53){return getSupportedCiphers()[_0x5989('0x10')](_0x3b6c53)>-0x1;}function combineOptions(_0x5c12dd){var _0xeb6be4={};for(var _0x5d1737 in fileOptions){if(fileOptions[_0x5989('0x11')](_0x5d1737)){_0xeb6be4[_0x5d1737]=fileOptions[_0x5d1737];}}if(_0x5c12dd){for(var _0x36ddef in _0x5c12dd){if(_0x5c12dd['hasOwnProperty'](_0x36ddef)){_0xeb6be4[_0x36ddef]=_0x5c12dd[_0x36ddef];}}}return _0xeb6be4;}exports[_0x5989('0x12')]=function(_0x41eeed,_0x312561,_0x282efa,_0x53a9dd){return new BPromise(function(_0x47aebc,_0x3b2982){_0x53a9dd=combineOptions(_0x53a9dd);var _0x4f2182=new Buffer(_0x282efa);var _0x28f25f=fs[_0x5989('0x13')](_0x41eeed);var _0x5d9e03=fs[_0x5989('0x14')](_0x312561);var _0x29bea2=crypto[_0x5989('0x15')](_0x53a9dd['algorithm'],_0x4f2182);_0x28f25f['on'](_0x5989('0x16'),function(_0x245422){var _0x2b8480=new Buffer(_0x29bea2[_0x5989('0x17')](_0x245422),_0x5989('0x18'));_0x5d9e03[_0x5989('0x19')](_0x2b8480);});_0x28f25f['on']('end',function(){try{var _0x464ea7=new Buffer(_0x29bea2[_0x5989('0x1a')]('binary'),_0x5989('0x18'));_0x5d9e03[_0x5989('0x19')](_0x464ea7);_0x5d9e03[_0x5989('0x1b')]();_0x5d9e03['on'](_0x5989('0x1c'),function(){return _0x47aebc(_0x312561);});}catch(_0x116fb8){fs[_0x5989('0x1d')](_0x312561);return _0x3b2982(_0x116fb8);}});});};exports[_0x5989('0x1e')]=function(_0x175199,_0x34a2e6,_0x4c9b6e,_0x53fe8c){return new BPromise(function(_0x15e8a1,_0x1acc5e){_0x53fe8c=combineOptions(_0x53fe8c);var _0x5780a7=new Buffer(_0x4c9b6e);var _0x525f30=fs[_0x5989('0x13')](_0x175199);var _0x40a538=fs[_0x5989('0x14')](_0x34a2e6);var _0x543ff7=crypto['createDecipher'](_0x53fe8c['algorithm'],_0x5780a7);_0x525f30['on'](_0x5989('0x16'),function(_0x964f17){var _0x332961=new Buffer(_0x543ff7[_0x5989('0x17')](_0x964f17),_0x5989('0x18'));_0x40a538[_0x5989('0x19')](_0x332961);});_0x525f30['on']('end',function(){try{var _0x36772a=new Buffer(_0x543ff7[_0x5989('0x1a')](_0x5989('0x18')),_0x5989('0x18'));_0x40a538[_0x5989('0x19')](_0x36772a);_0x40a538[_0x5989('0x1b')]();_0x40a538['on']('close',function(){return _0x15e8a1(_0x34a2e6);});}catch(_0x36ed89){fs[_0x5989('0x1d')](_0x34a2e6);return _0x1acc5e(_0x36ed89);}});});};exports['encryptString']=function(_0x4fb0c4,_0x4470c3,_0x400c37){var _0x26309a=_0x400c37||stringOptions[_0x5989('0xa')];var _0xbbac80=_0x4470c3||stringOptions[_0x5989('0x1f')];var _0x577614=crypto[_0x5989('0x15')](_0x26309a,_0xbbac80);var _0x1f8820=_0x577614[_0x5989('0x17')](_0x4fb0c4,'utf8',_0x5989('0x20'));_0x1f8820+=_0x577614[_0x5989('0x1a')](_0x5989('0x20'));return _0x1f8820;};exports[_0x5989('0x21')]=function(_0x1c980d,_0x1cbfb9,_0x19e644){var _0x44739c=_0x19e644||stringOptions[_0x5989('0xa')];var _0x402984=_0x1cbfb9||stringOptions[_0x5989('0x1f')];var _0x31c0d0=crypto[_0x5989('0x22')](_0x44739c,_0x402984);var _0x42385e=_0x31c0d0[_0x5989('0x17')](_0x1c980d,_0x5989('0x20'),'utf8');_0x42385e+=_0x31c0d0[_0x5989('0x1a')](_0x5989('0x23'));return _0x42385e;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 3d073c1..ffc4e33 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 _0x3e17=['CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','each','%s%d.%s','csv','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','inspect','Failed','finally','util','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3020ea,_0x2c71f6){var _0x2a8cc0=function(_0x16a1ec){while(--_0x16a1ec){_0x3020ea['push'](_0x3020ea['shift']());}};_0x2a8cc0(++_0x2c71f6);}(_0x3e17,0x83));var _0x73e1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e17[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0x73e1('0x0'));var path=require(_0x73e1('0x1'));var _=require(_0x73e1('0x2'));var csv=require(_0x73e1('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x73e1('0x4'));var db=require(_0x73e1('0x5'))['db'];var dbH=require(_0x73e1('0x5'))[_0x73e1('0x6')];var logger=require(_0x73e1('0x7'))(_0x73e1('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x73e1('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x73e1('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1f4240,_0x11c19c){var _0x19b427={'status':_0x1f4240};var _0x377846={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x11c19c){_0x19b427[_0x73e1('0xa')]=_0x11c19c;}return db[_0x73e1('0xb')][_0x73e1('0xc')](_0x19b427,_0x377846);}function main(){var _0x3dc212=0x1388;var _0x18653f;logger[_0x73e1('0xd')](util[_0x73e1('0xe')](_0x73e1('0xf'),EXTRACTED_REPORT_ID,_0x73e1('0x10')));return db[_0x73e1('0x11')][_0x73e1('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x73e1('0x13'),_0x73e1('0x14')]})[_0x73e1('0x15')](function(_0x2b6ebd){if(_0x2b6ebd){_0x18653f=_0x2b6ebd;_0x3dc212=_0x18653f[_0x73e1('0x14')]||0x1388;}})[_0x73e1('0x15')](function(){return dbH[_0x73e1('0x16')][_0x73e1('0x17')](util[_0x73e1('0xe')](_0x73e1('0x18'),QUERY),{'type':dbH[_0x73e1('0x16')][_0x73e1('0x19')][_0x73e1('0x1a')]});})[_0x73e1('0x15')](function(_0x52e05c){if(!_0x52e05c[0x0]['num']){return analyticExtractedReport('Empty');}var _0x23492f=[];var _0x3192ee=0x0;if(_0x18653f['split']){if(_0x52e05c&&_0x52e05c['length']){var _0x325660=_[_0x73e1('0x1b')](_0x52e05c[0x0][_0x73e1('0x1c')]/_0x3dc212);var _0x31ad0c=Number['isInteger'](_0x52e05c[0x0][_0x73e1('0x1c')]/_0x3dc212)?_0x52e05c[0x0][_0x73e1('0x1c')]%_0x3dc212:0x0;_0x325660[_0x73e1('0x1d')](function(_0xd8ca72){if(_0xd8ca72>0x0){_0x3192ee+=_0x3dc212;}_0x23492f[_0x73e1('0x1e')](dbH[_0x73e1('0x16')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3dc212,_0x3192ee),{'type':dbH['sequelize'][_0x73e1('0x19')][_0x73e1('0x1a')]}));});if(_0x31ad0c>0x0){_0x3192ee+=_0x3dc212;_0x23492f[_0x73e1('0x1e')](dbH['sequelize'][_0x73e1('0x17')](util[_0x73e1('0xe')](_0x73e1('0x1f'),QUERY,_0x31ad0c,_0x3192ee),{'type':dbH[_0x73e1('0x16')][_0x73e1('0x19')][_0x73e1('0x1a')]}));}}}else{_0x23492f['push'](dbH[_0x73e1('0x16')][_0x73e1('0x17')](QUERY,{'type':dbH[_0x73e1('0x16')][_0x73e1('0x19')][_0x73e1('0x1a')]}));}var _0x47786b=path[_0x73e1('0x20')](PATH);var _0x54dbd5=path[_0x73e1('0x21')](PATH,_0x73e1('0x22'));var _0x51195d=_0x18653f[_0x73e1('0x13')]&&_0x23492f[_0x73e1('0x23')]>0x1;var _0x580b20=[];if(!fs[_0x73e1('0x24')](path['join'](_0x47786b,_0x54dbd5))&&_0x51195d){fs['mkdirSync'](path[_0x73e1('0x25')](_0x47786b,_0x54dbd5));}return BPromise[_0x73e1('0x26')](_0x23492f,function(_0x2548ac){_0x580b20[_0x73e1('0x1e')](_0x2548ac);})['then'](function(){for(var _0x597daa=0x0;_0x597daa<_0x580b20[_0x73e1('0x23')];_0x597daa+=0x1){var _0x4a341a;var _0x31cc16=_0x580b20[_0x597daa];if(_0x51195d){_0x4a341a=path[_0x73e1('0x25')](_0x47786b,_0x54dbd5,util[_0x73e1('0xe')](_0x73e1('0x27'),_0x54dbd5,_0x597daa,_0x73e1('0x28')));}else{_0x4a341a=path['join'](_0x47786b,util['format']('%s.%s',_0x54dbd5,_0x73e1('0x28')));}fs['writeFileSync'](_0x4a341a,csv(_0x31cc16));}})[_0x73e1('0x15')](function(){if(_0x51195d){return new Promise(function(_0x586ef3){zipdir(path[_0x73e1('0x25')](_0x47786b,_0x54dbd5),{'saveTo':path[_0x73e1('0x25')](_0x47786b,util['format'](_0x73e1('0x29'),_0x54dbd5,'zip'))},function(_0x22a77f,_0x549a46){rimraf(path[_0x73e1('0x25')](_0x47786b,_0x54dbd5),function(){});_0x586ef3(_0x73e1('0x2a'));});});}})[_0x73e1('0x15')](function(){logger[_0x73e1('0xd')](util[_0x73e1('0xe')](_0x73e1('0x2b'),EXTRACTED_REPORT_ID,_0x73e1('0x10')));return analyticExtractedReport('Completed',_0x51195d?util[_0x73e1('0xe')](_0x73e1('0x29'),_0x54dbd5,_0x51195d?_0x73e1('0x2c'):'csv'):null);});})[_0x73e1('0x2d')](function(_0x39be2b){logger[_0x73e1('0xd')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x73e1('0x10')),util[_0x73e1('0x2e')](_0x39be2b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x73e1('0x2f'));})[_0x73e1('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc859=['each','length','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','join','mkdirSync'];(function(_0x20bdb3,_0x3a6456){var _0x3ff02a=function(_0x374dd9){while(--_0x374dd9){_0x20bdb3['push'](_0x20bdb3['shift']());}};_0x3ff02a(++_0x3a6456);}(_0xc859,0x112));var _0x9c85=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc859[_0x1ac595];return _0x455fff;};'use strict';var util=require(_0x9c85('0x0'));var path=require(_0x9c85('0x1'));var _=require(_0x9c85('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x9c85('0x3'));var zipdir=require(_0x9c85('0x4'));var rimraf=require(_0x9c85('0x5'));var db=require(_0x9c85('0x6'))['db'];var dbH=require(_0x9c85('0x6'))['dbH'];var logger=require('../../config/logger')(_0x9c85('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9c85('0x8')][0x2]);var QUERY=process[_0x9c85('0x8')][0x3];var PATH=process[_0x9c85('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x539f26,_0x5bae71){var _0x3cd469={'status':_0x539f26};var _0x2794fe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5bae71){_0x3cd469[_0x9c85('0x9')]=_0x5bae71;}return db['AnalyticExtractedReport'][_0x9c85('0xa')](_0x3cd469,_0x2794fe);}function main(){var _0x13342e=0x1388;var _0x16e058;logger[_0x9c85('0xb')](util[_0x9c85('0xc')](_0x9c85('0xd'),EXTRACTED_REPORT_ID,_0x9c85('0xe')));return db[_0x9c85('0xf')][_0x9c85('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9c85('0x11'),_0x9c85('0x12')]})['then'](function(_0x3954b2){if(_0x3954b2){_0x16e058=_0x3954b2;_0x13342e=_0x16e058[_0x9c85('0x12')]||0x1388;}})[_0x9c85('0x13')](function(){return dbH[_0x9c85('0x14')][_0x9c85('0x15')](util[_0x9c85('0xc')](_0x9c85('0x16'),QUERY),{'type':dbH[_0x9c85('0x14')][_0x9c85('0x17')][_0x9c85('0x18')]});})[_0x9c85('0x13')](function(_0x496939){if(!_0x496939[0x0]['num']){return analyticExtractedReport(_0x9c85('0x19'));}var _0x547464=[];var _0xcee07b=0x0;if(_0x16e058['split']){if(_0x496939&&_0x496939['length']){var _0x2f3caf=_[_0x9c85('0x1a')](_0x496939[0x0][_0x9c85('0x1b')]/_0x13342e);var _0x5a9fc6=Number[_0x9c85('0x1c')](_0x496939[0x0][_0x9c85('0x1b')]/_0x13342e)?_0x496939[0x0][_0x9c85('0x1b')]%_0x13342e:0x0;_0x2f3caf[_0x9c85('0x1d')](function(_0x355f75){if(_0x355f75>0x0){_0xcee07b+=_0x13342e;}_0x547464['push'](dbH[_0x9c85('0x14')][_0x9c85('0x15')](util['format'](_0x9c85('0x1e'),QUERY,_0x13342e,_0xcee07b),{'type':dbH['sequelize'][_0x9c85('0x17')][_0x9c85('0x18')]}));});if(_0x5a9fc6>0x0){_0xcee07b+=_0x13342e;_0x547464[_0x9c85('0x1f')](dbH[_0x9c85('0x14')][_0x9c85('0x15')](util['format'](_0x9c85('0x1e'),QUERY,_0x5a9fc6,_0xcee07b),{'type':dbH[_0x9c85('0x14')]['QueryTypes']['SELECT']}));}}}else{_0x547464[_0x9c85('0x1f')](dbH[_0x9c85('0x14')]['query'](QUERY,{'type':dbH[_0x9c85('0x14')][_0x9c85('0x17')][_0x9c85('0x18')]}));}var _0x21f0d3=path[_0x9c85('0x20')](PATH);var _0x4182af=path[_0x9c85('0x21')](PATH,_0x9c85('0x22'));var _0x2a70d3=_0x16e058[_0x9c85('0x11')]&&_0x547464['length']>0x1;var _0x43492b=[];if(!fs[_0x9c85('0x23')](path[_0x9c85('0x24')](_0x21f0d3,_0x4182af))&&_0x2a70d3){fs[_0x9c85('0x25')](path['join'](_0x21f0d3,_0x4182af));}return BPromise[_0x9c85('0x26')](_0x547464,function(_0x43e935){_0x43492b[_0x9c85('0x1f')](_0x43e935);})[_0x9c85('0x13')](function(){for(var _0x40f4a2=0x0;_0x40f4a2<_0x43492b[_0x9c85('0x27')];_0x40f4a2+=0x1){var _0x19460d;var _0xae1d5a=_0x43492b[_0x40f4a2];if(_0x2a70d3){_0x19460d=path[_0x9c85('0x24')](_0x21f0d3,_0x4182af,util[_0x9c85('0xc')]('%s%d.%s',_0x4182af,_0x40f4a2,_0x9c85('0x28')));}else{_0x19460d=path[_0x9c85('0x24')](_0x21f0d3,util['format'](_0x9c85('0x29'),_0x4182af,_0x9c85('0x28')));}fs[_0x9c85('0x2a')](_0x19460d,csv(_0xae1d5a));}})[_0x9c85('0x13')](function(){if(_0x2a70d3){return new Promise(function(_0x303bf9){zipdir(path[_0x9c85('0x24')](_0x21f0d3,_0x4182af),{'saveTo':path['join'](_0x21f0d3,util[_0x9c85('0xc')](_0x9c85('0x29'),_0x4182af,'zip'))},function(_0x4ed769,_0x13b3a5){rimraf(path[_0x9c85('0x24')](_0x21f0d3,_0x4182af),function(){});_0x303bf9(_0x9c85('0x2b'));});});}})[_0x9c85('0x13')](function(){logger[_0x9c85('0xb')](util[_0x9c85('0xc')](_0x9c85('0x2c'),EXTRACTED_REPORT_ID,_0x9c85('0xe')));return analyticExtractedReport(_0x9c85('0x2d'),_0x2a70d3?util['format']('%s.%s',_0x4182af,_0x2a70d3?_0x9c85('0x2e'):_0x9c85('0x28')):null);});})['catch'](function(_0x1fa6e8){logger[_0x9c85('0xb')](util[_0x9c85('0xc')](_0x9c85('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util[_0x9c85('0x30')](_0x1fa6e8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9c85('0x31'));})[_0x9c85('0x32')](function(){process[_0x9c85('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0f5ac27..11b8b1f 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 _0xd988=['path','lodash','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','auto','push','body','concat','chunk','keys','forEach','format','name','endDate','length','pageBreak','before','margin','landscape','footer','Arial','black','right','num','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','join','each','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','createPdfKitDocument'];(function(_0x163fe3,_0x5adaf3){var _0x2201ed=function(_0x5b6e5c){while(--_0x5b6e5c){_0x163fe3['push'](_0x163fe3['shift']());}};_0x2201ed(++_0x5adaf3);}(_0xd988,0xb5));var _0x8d98=function(_0x1b6cfb,_0x4dc326){_0x1b6cfb=_0x1b6cfb-0x0;var _0x21a6a2=_0xd988[_0x1b6cfb];return _0x21a6a2;};'use strict';var _=require(_0x8d98('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0x8d98('0x1'));var htmlToPdfmake=require(_0x8d98('0x2'));var PdfPrinter=require(_0x8d98('0x3'));var zipdir=require(_0x8d98('0x4'));var rimraf=require(_0x8d98('0x5'));var JSDOM=require(_0x8d98('0x6'))[_0x8d98('0x7')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x8d98('0x8'))['db'];var dbH=require(_0x8d98('0x8'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8d98('0x9')][0x2]);var QUERY=process[_0x8d98('0x9')][0x3];var PATH=process[_0x8d98('0x9')][0x4];var NAME=process[_0x8d98('0x9')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1273ca,_0x2327f4){var _0x405e95={'status':_0x1273ca};var _0x29e08f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2327f4){_0x405e95[_0x8d98('0xa')]=_0x2327f4;}return db[_0x8d98('0xb')][_0x8d98('0xc')](_0x405e95,_0x29e08f);}function getHeaders(_0x35ae19){return _[_0x8d98('0xd')](_0x35ae19,function(_0x4ee845){return{'text':_0x4ee845,'style':_0x8d98('0xe')};});}function getRows(_0x59e182,_0x2e6c13){return _[_0x8d98('0xd')](_0x2e6c13,function(_0x42ba25){return _(_0x42ba25)[_0x8d98('0xf')](_0x59e182)['map'](function(_0x1194ed){return _0x1194ed?_[_0x8d98('0x10')](_0x1194ed):'';})[_0x8d98('0x11')]();});}function createTable(_0x3b1186,_0x3006a3){var _0x1d532c={'widths':_[_0x8d98('0x12')](Array(_0x3b1186['length']),0x91),'heights':function(_0x105f93){return _0x105f93===0x0?_0x8d98('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xb26f3b=getHeaders(_0x3b1186);_0x1d532c['body'][_0x8d98('0x14')](_0xb26f3b);var _0x4c3738=getRows(_0x3b1186,_0x3006a3);_0x1d532c[_0x8d98('0x15')]=_0x1d532c[_0x8d98('0x15')][_0x8d98('0x16')](_0x4c3738);return _0x1d532c;}function createTables(_0x375d72){var _0x28276e=[];var _0x5e53e8=_[_0x8d98('0x17')](Object[_0x8d98('0x18')](_0x375d72[0x0]),0x5);_0x5e53e8[_0x8d98('0x19')](function(_0x4eaca0){_0x28276e[_0x8d98('0x14')](createTable(_0x4eaca0,_0x375d72));});return _0x28276e;}function getPDFDocDefinition(_0x240aaa){var _0x334f8e=util[_0x8d98('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x8d98('0x1b')],moment(EXTRACTED_REPORT['startDate'])[_0x8d98('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x8d98('0x1c')])[_0x8d98('0x1a')](FORMAT));var _0x47d7a9=[];for(var _0x45a178=0x0;_0x45a178<_0x240aaa[_0x8d98('0x1d')];_0x45a178++){var _0x5256a7=[];if(_0x45a178===0x0){_0x5256a7[_0x8d98('0x14')]({'text':_0x334f8e,'style':'header'});}var _0x532992={'table':_0x240aaa[_0x45a178]};if(_0x45a178>0x0){_0x532992[_0x8d98('0x1e')]=_0x8d98('0x1f');_0x532992[_0x8d98('0x20')]=[0x0,0x46,0x0,0x0];}_0x5256a7[_0x8d98('0x14')](_0x532992);_0x47d7a9['push'](_0x5256a7);}return{'pageSize':'A4','pageOrientation':_0x8d98('0x21'),'content':_0x47d7a9,'footer':function(_0x360622,_0x4d5f73){return{'text':_0x360622[_0x8d98('0x10')]()+'\x20/\x20'+_0x4d5f73,'style':_0x8d98('0x22')};},'defaultStyle':{'font':_0x8d98('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8d98('0x24')},'footer':{'alignment':_0x8d98('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4b6a37){var _0x2d545a=0x1388;var _0x1cc759;if(!_0x4b6a37[0x0][_0x8d98('0x26')]){return analyticExtractedReport('Empty');}return db[_0x8d98('0x27')][_0x8d98('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8d98('0x29')]})['then'](function(_0x515a22){if(_0x515a22){_0x1cc759=_0x515a22;_0x2d545a=_0x1cc759[_0x8d98('0x29')]||0x3e8;}})[_0x8d98('0x2a')](function(){var _0x57d59c=[];var _0x29f29e=0x0;if(_0x1cc759[_0x8d98('0x2b')]){if(_0x4b6a37&&_0x4b6a37[_0x8d98('0x1d')]){var _0x54b934=_[_0x8d98('0x2c')](_0x4b6a37[0x0]['num']/_0x2d545a);var _0x3140d3=Number[_0x8d98('0x2d')](_0x4b6a37[0x0][_0x8d98('0x26')]/_0x2d545a)?_0x4b6a37[0x0]['num']%_0x2d545a:0x0;_0x54b934['forEach'](function(_0x4bf446){if(_0x4bf446>0x0){_0x29f29e+=_0x2d545a;}_0x57d59c[_0x8d98('0x14')](dbH[_0x8d98('0x2e')][_0x8d98('0x2f')](util['format'](_0x8d98('0x30'),QUERY,_0x2d545a,_0x29f29e),{'type':dbH[_0x8d98('0x2e')]['QueryTypes'][_0x8d98('0x31')]}));});if(_0x3140d3>0x0){_0x29f29e+=_0x2d545a;_0x57d59c[_0x8d98('0x14')](dbH[_0x8d98('0x2e')][_0x8d98('0x2f')](util[_0x8d98('0x1a')](_0x8d98('0x30'),QUERY,_0x3140d3,_0x29f29e),{'type':dbH['sequelize']['QueryTypes'][_0x8d98('0x31')]}));}}}else{_0x57d59c[_0x8d98('0x14')](dbH[_0x8d98('0x2e')][_0x8d98('0x2f')](QUERY,{'type':dbH[_0x8d98('0x2e')][_0x8d98('0x32')][_0x8d98('0x31')]}));}var _0x15f16d=path[_0x8d98('0x33')](PATH);var _0xcbcf09=path[_0x8d98('0x34')](PATH,_0x8d98('0x35'));var _0x5a20f7=_0x1cc759[_0x8d98('0x2b')]&&_0x57d59c[_0x8d98('0x1d')]>0x1;var _0x1d06e5=[];if(!fs[_0x8d98('0x36')](path[_0x8d98('0x37')](_0x15f16d,_0xcbcf09))&&_0x5a20f7){fs['mkdirSync'](path[_0x8d98('0x37')](_0x15f16d,_0xcbcf09));}return BPromise[_0x8d98('0x38')](_0x57d59c,function(_0x448e1f){_0x1d06e5[_0x8d98('0x14')](_0x448e1f);})['then'](function(){var _0x4161d8=[];for(var _0x5eed11=0x0;_0x5eed11<_0x1d06e5['length'];_0x5eed11+=0x1){var _0x45f66b=_0x1d06e5[_0x5eed11];var _0x31dba3=createTables(_['flatten'](_0x45f66b));var _0x228fd6;var _0x42bf92=getPDFDocDefinition(_0x31dba3);var _0x245e4c=getPDFPrinter();var _0x5e7abe=_0x245e4c['createPdfKitDocument'](_0x42bf92);if(_0x5a20f7){_0x228fd6=path[_0x8d98('0x37')](_0x15f16d,_0xcbcf09,util[_0x8d98('0x1a')](_0x8d98('0x39'),_0xcbcf09,_0x5eed11,_0x8d98('0x3a')));}else{_0x228fd6=path[_0x8d98('0x37')](_0x15f16d,util['format'](_0x8d98('0x3b'),_0xcbcf09,'pdf'));}_0x4161d8[_0x8d98('0x14')](writePDFDocument(_0x5e7abe,_0x228fd6));}return Promise[_0x8d98('0x3c')](_0x4161d8);})[_0x8d98('0x2a')](function(){if(_0x5a20f7){return new Promise(function(_0x21a0e5){zipdir(path[_0x8d98('0x37')](_0x15f16d,_0xcbcf09),{'saveTo':path[_0x8d98('0x37')](_0x15f16d,util[_0x8d98('0x1a')]('%s.%s',_0xcbcf09,_0x8d98('0x3d')))},function(){rimraf(path['join'](_0x15f16d,_0xcbcf09),function(){});_0x21a0e5(_0x8d98('0x3e'));});});}})[_0x8d98('0x2a')](function(){if(!_0x5a20f7)return;rimraf(path[_0x8d98('0x37')](_0x15f16d,_0xcbcf09),function(){});})[_0x8d98('0x2a')](function(){logger['info'](util['format'](_0x8d98('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x8d98('0x40'),_0x5a20f7?util['format'](_0x8d98('0x3b'),_0xcbcf09,_0x5a20f7?'zip':_0x8d98('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8d98('0x41')](util['format'](_0x8d98('0x42'),EXTRACTED_REPORT_ID,_0x8d98('0x43')));return db[_0x8d98('0xb')][_0x8d98('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8d98('0x2a')](function(_0x3c82ee){EXTRACTED_REPORT=_0x3c82ee;return dbH[_0x8d98('0x2e')][_0x8d98('0x2f')](util[_0x8d98('0x1a')](_0x8d98('0x45'),QUERY),{'type':dbH['sequelize'][_0x8d98('0x32')][_0x8d98('0x31')]});})['then'](extractReport)[_0x8d98('0x46')](function(_0x34d393){logger[_0x8d98('0x41')](util[_0x8d98('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8d98('0x43')),util[_0x8d98('0x47')](_0x34d393,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8d98('0x48'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2cf54e=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x8d98('0x49'),'italics':__dirname+_0x8d98('0x4a'),'bolditalics':__dirname+_0x8d98('0x4b')}});return _0x2cf54e;}function getPDFDocDefinitionFromHTML(_0x6368bb,_0x7ddc64){var _0x141fce=util[_0x8d98('0x1a')](_0x8d98('0x4c'),_0x7ddc64[_0x8d98('0x4d')],_0x7ddc64[_0x8d98('0x4e')]);var _0x2b81db=moment()[_0x8d98('0x1a')]('YYYY-MM-DD')[_0x8d98('0x10')]();var _0x56b79c=htmlToPdfmake(_0x6368bb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x56b79c],'defaultStyle':{'font':_0x8d98('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8d98('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x8d98('0x50'),'style':_0x8d98('0x51')}];},'footer':function(_0x31db38,_0x1b11a2){return[{'text':util[_0x8d98('0x1a')](_0x8d98('0x52'),_0x141fce,_0x31db38,_0x1b11a2,_0x2b81db),'style':_0x8d98('0x22')}];}};}function writePDFDocument(_0x3121a5,_0x271e64){return new Promise(function(_0xafc37a,_0x47ae2d){var _0x30f77e=_0x3121a5[_0x8d98('0x53')](fs['createWriteStream'](_0x271e64));_0x30f77e['on'](_0x8d98('0x54'),function(){_0xafc37a(_0x8d98('0x54'));});_0x30f77e['on'](_0x8d98('0x55'),function(_0x203530){_0x47ae2d(_0x203530);});_0x3121a5[_0x8d98('0x56')]();});}exports[_0x8d98('0x57')]=function(_0x12f2f8,_0xe7b3a6){var _0x54993d=getPDFPrinter();var _0x2bfb0e=getPDFDocDefinitionFromHTML(_0x12f2f8,_0xe7b3a6);var _0x26ce52=_0x54993d[_0x8d98('0x58')](_0x2bfb0e);return writePDFDocument(_0x26ce52,_0xe7b3a6[_0x8d98('0x59')])[_0x8d98('0x46')](function(_0x94b5b3){throw _0x94b5b3;});}; \ No newline at end of file +var _0x8664=['QueryTypes','SELECT','sequelize','dirname','basename','.pdf','existsSync','join','mkdirSync','each','length','flatten','createPdfKitDocument','%s%d.%s','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','catch','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','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','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','fill','body','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','landscape','Arial','black','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','query'];(function(_0x88ae19,_0x3d1bd5){var _0x13226c=function(_0x2bdfbe){while(--_0x2bdfbe){_0x88ae19['push'](_0x88ae19['shift']());}};_0x13226c(++_0x3d1bd5);}(_0x8664,0x16f));var _0x4866=function(_0x454dff,_0x213dd2){_0x454dff=_0x454dff-0x0;var _0x31de3d=_0x8664[_0x454dff];return _0x31de3d;};'use strict';var _=require(_0x4866('0x0'));var fs=require('fs');var util=require(_0x4866('0x1'));var path=require(_0x4866('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x4866('0x3'));var PdfPrinter=require(_0x4866('0x4'));var zipdir=require(_0x4866('0x5'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x4866('0x6')];var window=new JSDOM('')[_0x4866('0x7')];var BPromise=require(_0x4866('0x8'));var db=require(_0x4866('0x9'))['db'];var dbH=require(_0x4866('0x9'))[_0x4866('0xa')];var logger=require(_0x4866('0xb'))(_0x4866('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x4866('0xd')][0x2]);var QUERY=process[_0x4866('0xd')][0x3];var PATH=process[_0x4866('0xd')][0x4];var NAME=process[_0x4866('0xd')][0x5];var FORMAT=_0x4866('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x517d3f,_0x4f3ff3){var _0x18464f={'status':_0x517d3f};var _0x3e0cee={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f3ff3){_0x18464f[_0x4866('0xf')]=_0x4f3ff3;}return db[_0x4866('0x10')][_0x4866('0x11')](_0x18464f,_0x3e0cee);}function getHeaders(_0x2585e7){return _['map'](_0x2585e7,function(_0x237f59){return{'text':_0x237f59,'style':_0x4866('0x12')};});}function getRows(_0x17ee19,_0x23a155){return _[_0x4866('0x13')](_0x23a155,function(_0x1b263c){return _(_0x1b263c)[_0x4866('0x14')](_0x17ee19)[_0x4866('0x13')](function(_0x3a50da){return _0x3a50da?_[_0x4866('0x15')](_0x3a50da):'';})[_0x4866('0x16')]();});}function createTable(_0x3e7105,_0x1399ae){var _0x3d9090={'widths':_[_0x4866('0x17')](Array(_0x3e7105['length']),0x91),'heights':function(_0x2d4487){return _0x2d4487===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x24d23e=getHeaders(_0x3e7105);_0x3d9090[_0x4866('0x18')]['push'](_0x24d23e);var _0x2b0327=getRows(_0x3e7105,_0x1399ae);_0x3d9090[_0x4866('0x18')]=_0x3d9090[_0x4866('0x18')]['concat'](_0x2b0327);return _0x3d9090;}function createTables(_0x18130e){var _0x20db74=[];var _0x55399d=_['chunk'](Object[_0x4866('0x19')](_0x18130e[0x0]),0x5);_0x55399d[_0x4866('0x1a')](function(_0x2b8a2d){_0x20db74[_0x4866('0x1b')](createTable(_0x2b8a2d,_0x18130e));});return _0x20db74;}function getPDFDocDefinition(_0x2f18e6){var _0x5668f1=util[_0x4866('0x1c')](_0x4866('0x1d'),NAME,EXTRACTED_REPORT[_0x4866('0x1e')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x4866('0x1f')])[_0x4866('0x1c')](FORMAT));var _0x4eeaf6=[];for(var _0x5ef0d3=0x0;_0x5ef0d3<_0x2f18e6['length'];_0x5ef0d3++){var _0x2a8d69=[];if(_0x5ef0d3===0x0){_0x2a8d69[_0x4866('0x1b')]({'text':_0x5668f1,'style':_0x4866('0x20')});}var _0x948faa={'table':_0x2f18e6[_0x5ef0d3]};if(_0x5ef0d3>0x0){_0x948faa[_0x4866('0x21')]=_0x4866('0x22');_0x948faa['margin']=[0x0,0x46,0x0,0x0];}_0x2a8d69[_0x4866('0x1b')](_0x948faa);_0x4eeaf6['push'](_0x2a8d69);}return{'pageSize':'A4','pageOrientation':_0x4866('0x23'),'content':_0x4eeaf6,'footer':function(_0x15dc7d,_0x34adf7){return{'text':_0x15dc7d[_0x4866('0x15')]()+'\x20/\x20'+_0x34adf7,'style':'footer'};},'defaultStyle':{'font':_0x4866('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x4866('0x25')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x30c7ce){var _0x99652c=0x1388;var _0x2eb6b1;if(!_0x30c7ce[0x0][_0x4866('0x26')]){return analyticExtractedReport(_0x4866('0x27'));}return db[_0x4866('0x28')][_0x4866('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4866('0x2a')]})['then'](function(_0x5c56f1){if(_0x5c56f1){_0x2eb6b1=_0x5c56f1;_0x99652c=_0x2eb6b1[_0x4866('0x2a')]||0x3e8;}})[_0x4866('0x2b')](function(){var _0xabbd2a=[];var _0x133c28=0x0;if(_0x2eb6b1[_0x4866('0x2c')]){if(_0x30c7ce&&_0x30c7ce['length']){var _0x411d84=_[_0x4866('0x2d')](_0x30c7ce[0x0][_0x4866('0x26')]/_0x99652c);var _0x467e01=Number[_0x4866('0x2e')](_0x30c7ce[0x0][_0x4866('0x26')]/_0x99652c)?_0x30c7ce[0x0][_0x4866('0x26')]%_0x99652c:0x0;_0x411d84[_0x4866('0x1a')](function(_0x13a23d){if(_0x13a23d>0x0){_0x133c28+=_0x99652c;}_0xabbd2a['push'](dbH['sequelize'][_0x4866('0x2f')](util[_0x4866('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x99652c,_0x133c28),{'type':dbH['sequelize'][_0x4866('0x30')][_0x4866('0x31')]}));});if(_0x467e01>0x0){_0x133c28+=_0x99652c;_0xabbd2a[_0x4866('0x1b')](dbH['sequelize']['query'](util[_0x4866('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x467e01,_0x133c28),{'type':dbH[_0x4866('0x32')]['QueryTypes'][_0x4866('0x31')]}));}}}else{_0xabbd2a[_0x4866('0x1b')](dbH[_0x4866('0x32')][_0x4866('0x2f')](QUERY,{'type':dbH[_0x4866('0x32')][_0x4866('0x30')][_0x4866('0x31')]}));}var _0x8af898=path[_0x4866('0x33')](PATH);var _0x4391ac=path[_0x4866('0x34')](PATH,_0x4866('0x35'));var _0x465177=_0x2eb6b1[_0x4866('0x2c')]&&_0xabbd2a['length']>0x1;var _0x100a9d=[];if(!fs[_0x4866('0x36')](path[_0x4866('0x37')](_0x8af898,_0x4391ac))&&_0x465177){fs[_0x4866('0x38')](path[_0x4866('0x37')](_0x8af898,_0x4391ac));}return BPromise[_0x4866('0x39')](_0xabbd2a,function(_0x8b161a){_0x100a9d['push'](_0x8b161a);})[_0x4866('0x2b')](function(){var _0x458db9=[];for(var _0x25d7fb=0x0;_0x25d7fb<_0x100a9d[_0x4866('0x3a')];_0x25d7fb+=0x1){var _0x107f8f=_0x100a9d[_0x25d7fb];var _0x2dafbe=createTables(_[_0x4866('0x3b')](_0x107f8f));var _0x2248bc;var _0x3674c5=getPDFDocDefinition(_0x2dafbe);var _0x3e2353=getPDFPrinter();var _0xb4fc04=_0x3e2353[_0x4866('0x3c')](_0x3674c5);if(_0x465177){_0x2248bc=path[_0x4866('0x37')](_0x8af898,_0x4391ac,util[_0x4866('0x1c')](_0x4866('0x3d'),_0x4391ac,_0x25d7fb,'pdf'));}else{_0x2248bc=path[_0x4866('0x37')](_0x8af898,util[_0x4866('0x1c')](_0x4866('0x3e'),_0x4391ac,'pdf'));}_0x458db9['push'](writePDFDocument(_0xb4fc04,_0x2248bc));}return Promise['all'](_0x458db9);})[_0x4866('0x2b')](function(){if(_0x465177){return new Promise(function(_0x2ebaa5){zipdir(path[_0x4866('0x37')](_0x8af898,_0x4391ac),{'saveTo':path[_0x4866('0x37')](_0x8af898,util[_0x4866('0x1c')](_0x4866('0x3e'),_0x4391ac,_0x4866('0x3f')))},function(){rimraf(path[_0x4866('0x37')](_0x8af898,_0x4391ac),function(){});_0x2ebaa5('zip\x20finished');});});}})[_0x4866('0x2b')](function(){if(!_0x465177)return;rimraf(path[_0x4866('0x37')](_0x8af898,_0x4391ac),function(){});})['then'](function(){logger[_0x4866('0x40')](util[_0x4866('0x1c')](_0x4866('0x41'),EXTRACTED_REPORT_ID,_0x4866('0x42')));return analyticExtractedReport('Completed',_0x465177?util['format']('%s.%s',_0x4391ac,_0x465177?_0x4866('0x3f'):_0x4866('0x43')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x4866('0x40')](util[_0x4866('0x1c')](_0x4866('0x44'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4866('0x2b')](function(_0x214bb5){EXTRACTED_REPORT=_0x214bb5;return dbH[_0x4866('0x32')][_0x4866('0x2f')](util[_0x4866('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x4866('0x31')]});})[_0x4866('0x2b')](extractReport)[_0x4866('0x45')](function(_0x3c41c7){logger[_0x4866('0x40')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4866('0x42')),util['inspect'](_0x3c41c7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x4866('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x33998d=new PdfPrinter({'Arial':{'normal':__dirname+_0x4866('0x47'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x4866('0x48'),'bolditalics':__dirname+_0x4866('0x49')}});return _0x33998d;}function getPDFDocDefinitionFromHTML(_0x399cdf,_0x99fae9){var _0x106ca5=util[_0x4866('0x1c')]('%s\x20#%d',_0x99fae9[_0x4866('0x4a')],_0x99fae9['interactionId']);var _0x197b24=moment()[_0x4866('0x1c')](_0x4866('0x4b'))[_0x4866('0x15')]();var _0xc83b3e=htmlToPdfmake(_0x399cdf,{'window':window,'tableAutoSize':!![]});return{'content':[_0xc83b3e],'defaultStyle':{'font':_0x4866('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x4866('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x4866('0x4d'),'style':_0x4866('0x20')}];},'footer':function(_0x5d41f4,_0x8aa9b9){return[{'text':util['format'](_0x4866('0x4e'),_0x106ca5,_0x5d41f4,_0x8aa9b9,_0x197b24),'style':'footer'}];}};}function writePDFDocument(_0x34d525,_0x171f54){return new Promise(function(_0x23a402,_0x58e87e){var _0x3bc6c7=_0x34d525[_0x4866('0x4f')](fs['createWriteStream'](_0x171f54));_0x3bc6c7['on'](_0x4866('0x50'),function(){_0x23a402(_0x4866('0x50'));});_0x3bc6c7['on'](_0x4866('0x51'),function(_0x4d91cb){_0x58e87e(_0x4d91cb);});_0x34d525[_0x4866('0x52')]();});}exports['createPdfFromHTML']=function(_0x4a304e,_0x5d6e36){var _0x374617=getPDFPrinter();var _0x494880=getPDFDocDefinitionFromHTML(_0x4a304e,_0x5d6e36);var _0x504db5=_0x374617[_0x4866('0x3c')](_0x494880);return writePDFDocument(_0x504db5,_0x5d6e36[_0x4866('0x2')])['catch'](function(_0x51d7fc){throw _0x51d7fc;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index b07dfcd..d0ddc44 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 _0xcb3e=['writeFileSync','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','xlsx','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb3e,0x79));var _0xecb3=function(_0x155573,_0x180df9){_0x155573=_0x155573-0x0;var _0x4afc1f=_0xcb3e[_0x155573];return _0x4afc1f;};'use strict';var util=require(_0xecb3('0x0'));var path=require('path');var _=require(_0xecb3('0x1'));var fs=require('fs');var json2xls=require(_0xecb3('0x2'));var BPromise=require(_0xecb3('0x3'));var zipdir=require(_0xecb3('0x4'));var rimraf=require(_0xecb3('0x5'));var db=require(_0xecb3('0x6'))['db'];var dbH=require(_0xecb3('0x6'))[_0xecb3('0x7')];var logger=require(_0xecb3('0x8'))(_0xecb3('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xecb3('0xa')][0x2]);var QUERY=process[_0xecb3('0xa')][0x3];var PATH=process[_0xecb3('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x47b343,_0x21025c){var _0x1dc900={'status':_0x47b343};var _0x1f4534={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21025c){_0x1dc900[_0xecb3('0xb')]=_0x21025c;}return db[_0xecb3('0xc')][_0xecb3('0xd')](_0x1dc900,_0x1f4534);}function main(){var _0x2edb1d=0x1388;var _0x4cd145;logger['info'](util[_0xecb3('0xe')](_0xecb3('0xf'),EXTRACTED_REPORT_ID,_0xecb3('0x10')));return db[_0xecb3('0x11')][_0xecb3('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xecb3('0x13'),_0xecb3('0x14')]})[_0xecb3('0x15')](function(_0x23dc28){if(_0x23dc28){_0x4cd145=_0x23dc28;_0x2edb1d=_0x4cd145[_0xecb3('0x14')]||0x1388;}})['then'](function(){return dbH[_0xecb3('0x16')][_0xecb3('0x17')](util[_0xecb3('0xe')](_0xecb3('0x18'),QUERY),{'type':dbH['sequelize'][_0xecb3('0x19')][_0xecb3('0x1a')]});})[_0xecb3('0x15')](function(_0x30ee1a){if(!_0x30ee1a[0x0][_0xecb3('0x1b')]){return analyticExtractedReport('Empty');}var _0x54d354=[];var _0x53b169=0x0;if(_0x4cd145['split']){if(_0x30ee1a&&_0x30ee1a[_0xecb3('0x1c')]){var _0x2d8c36=_[_0xecb3('0x1d')](_0x30ee1a[0x0][_0xecb3('0x1b')]/_0x2edb1d);var _0x4f25d9=Number[_0xecb3('0x1e')](_0x30ee1a[0x0]['num']/_0x2edb1d)?_0x30ee1a[0x0]['num']%_0x2edb1d:0x0;_0x2d8c36[_0xecb3('0x1f')](function(_0x2ca8a1){if(_0x2ca8a1>0x0){_0x53b169+=_0x2edb1d;}_0x54d354[_0xecb3('0x20')](dbH[_0xecb3('0x16')][_0xecb3('0x17')](util[_0xecb3('0xe')](_0xecb3('0x21'),QUERY,_0x2edb1d,_0x53b169),{'type':dbH[_0xecb3('0x16')][_0xecb3('0x19')][_0xecb3('0x1a')]}));});if(_0x4f25d9>0x0){_0x53b169+=_0x2edb1d;_0x54d354[_0xecb3('0x20')](dbH[_0xecb3('0x16')][_0xecb3('0x17')](util[_0xecb3('0xe')](_0xecb3('0x21'),QUERY,_0x4f25d9,_0x53b169),{'type':dbH[_0xecb3('0x16')]['QueryTypes'][_0xecb3('0x1a')]}));}}}else{_0x54d354[_0xecb3('0x20')](dbH[_0xecb3('0x16')][_0xecb3('0x17')](QUERY,{'type':dbH[_0xecb3('0x16')][_0xecb3('0x19')][_0xecb3('0x1a')]}));}var _0x44280b=path[_0xecb3('0x22')](PATH);var _0x20b632=path[_0xecb3('0x23')](PATH,_0xecb3('0x24'));var _0x4291b5=_0x4cd145[_0xecb3('0x13')]&&_0x54d354[_0xecb3('0x1c')]>0x1;var _0x2c0b57=[];if(!fs[_0xecb3('0x25')](path[_0xecb3('0x26')](_0x44280b,_0x20b632))&&_0x4291b5){fs['mkdirSync'](path[_0xecb3('0x26')](_0x44280b,_0x20b632));}return BPromise[_0xecb3('0x27')](_0x54d354,function(_0x5d54ae){_0x2c0b57['push'](_0x5d54ae);})[_0xecb3('0x15')](function(){for(var _0x3f7d09=0x0;_0x3f7d09<_0x2c0b57[_0xecb3('0x1c')];_0x3f7d09+=0x1){var _0x20e16c;var _0xa80046=_0x2c0b57[_0x3f7d09];if(_0x4291b5){_0x20e16c=path[_0xecb3('0x26')](_0x44280b,_0x20b632,util['format'](_0xecb3('0x28'),_0x20b632,_0x3f7d09,'xlsx'));}else{_0x20e16c=path['join'](_0x44280b,util['format']('%s.%s',_0x20b632,'xlsx'));}fs[_0xecb3('0x29')](_0x20e16c,json2xls(_0xa80046),'binary');}})['then'](function(){if(_0x4291b5){return new Promise(function(_0x2d2a75){zipdir(path['join'](_0x44280b,_0x20b632),{'saveTo':path[_0xecb3('0x26')](_0x44280b,util['format'](_0xecb3('0x2a'),_0x20b632,'zip'))},function(_0x3ea4b7,_0x3e8e2d){rimraf(path[_0xecb3('0x26')](_0x44280b,_0x20b632),function(){});_0x2d2a75(_0xecb3('0x2b'));});});}})[_0xecb3('0x15')](function(){logger[_0xecb3('0x2c')](util['format'](_0xecb3('0x2d'),EXTRACTED_REPORT_ID,_0xecb3('0x10')));return analyticExtractedReport(_0xecb3('0x2e'),_0x4291b5?util['format'](_0xecb3('0x2a'),_0x20b632,_0x4291b5?_0xecb3('0x2f'):_0xecb3('0x30')):null);});})[_0xecb3('0x31')](function(_0x2723fb){logger[_0xecb3('0x2c')](util[_0xecb3('0xe')](_0xecb3('0x32'),EXTRACTED_REPORT_ID,_0xecb3('0x10')),util[_0xecb3('0x33')](_0x2723fb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xecb3('0x34')](function(){process[_0xecb3('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x90ad=['%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','length'];(function(_0x499e27,_0x30868f){var _0x29deca=function(_0x2bb105){while(--_0x2bb105){_0x499e27['push'](_0x499e27['shift']());}};_0x29deca(++_0x30868f);}(_0x90ad,0x195));var _0xd90a=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x90ad[_0x3f0b30];return _0x2748a5;};'use strict';var util=require(_0xd90a('0x0'));var path=require(_0xd90a('0x1'));var _=require(_0xd90a('0x2'));var fs=require('fs');var json2xls=require(_0xd90a('0x3'));var BPromise=require(_0xd90a('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xd90a('0x5'));var db=require(_0xd90a('0x6'))['db'];var dbH=require(_0xd90a('0x6'))['dbH'];var logger=require(_0xd90a('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd90a('0x8')][0x2]);var QUERY=process[_0xd90a('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x17808c,_0x408de3){var _0x3ffb6f={'status':_0x17808c};var _0x5ed7fa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x408de3){_0x3ffb6f['savename']=_0x408de3;}return db[_0xd90a('0x9')]['update'](_0x3ffb6f,_0x5ed7fa);}function main(){var _0x50b213=0x1388;var _0x59f493;logger[_0xd90a('0xa')](util[_0xd90a('0xb')](_0xd90a('0xc'),EXTRACTED_REPORT_ID,_0xd90a('0xd')));return db['Setting'][_0xd90a('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd90a('0xf'),_0xd90a('0x10')]})[_0xd90a('0x11')](function(_0x24c508){if(_0x24c508){_0x59f493=_0x24c508;_0x50b213=_0x59f493[_0xd90a('0x10')]||0x1388;}})[_0xd90a('0x11')](function(){return dbH[_0xd90a('0x12')][_0xd90a('0x13')](util[_0xd90a('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd90a('0x12')][_0xd90a('0x14')][_0xd90a('0x15')]});})[_0xd90a('0x11')](function(_0x40c120){if(!_0x40c120[0x0][_0xd90a('0x16')]){return analyticExtractedReport(_0xd90a('0x17'));}var _0x41fc02=[];var _0x36e45c=0x0;if(_0x59f493[_0xd90a('0xf')]){if(_0x40c120&&_0x40c120['length']){var _0x17e9b1=_[_0xd90a('0x18')](_0x40c120[0x0][_0xd90a('0x16')]/_0x50b213);var _0x5d4836=Number[_0xd90a('0x19')](_0x40c120[0x0]['num']/_0x50b213)?_0x40c120[0x0][_0xd90a('0x16')]%_0x50b213:0x0;_0x17e9b1['forEach'](function(_0x1b19d7){if(_0x1b19d7>0x0){_0x36e45c+=_0x50b213;}_0x41fc02[_0xd90a('0x1a')](dbH[_0xd90a('0x12')]['query'](util[_0xd90a('0xb')](_0xd90a('0x1b'),QUERY,_0x50b213,_0x36e45c),{'type':dbH[_0xd90a('0x12')][_0xd90a('0x14')][_0xd90a('0x15')]}));});if(_0x5d4836>0x0){_0x36e45c+=_0x50b213;_0x41fc02['push'](dbH[_0xd90a('0x12')]['query'](util[_0xd90a('0xb')](_0xd90a('0x1b'),QUERY,_0x5d4836,_0x36e45c),{'type':dbH[_0xd90a('0x12')][_0xd90a('0x14')]['SELECT']}));}}}else{_0x41fc02[_0xd90a('0x1a')](dbH[_0xd90a('0x12')]['query'](QUERY,{'type':dbH[_0xd90a('0x12')][_0xd90a('0x14')][_0xd90a('0x15')]}));}var _0x22c761=path[_0xd90a('0x1c')](PATH);var _0x1cccab=path[_0xd90a('0x1d')](PATH,_0xd90a('0x1e'));var _0x80e654=_0x59f493[_0xd90a('0xf')]&&_0x41fc02['length']>0x1;var _0x35a3e9=[];if(!fs[_0xd90a('0x1f')](path[_0xd90a('0x20')](_0x22c761,_0x1cccab))&&_0x80e654){fs[_0xd90a('0x21')](path[_0xd90a('0x20')](_0x22c761,_0x1cccab));}return BPromise[_0xd90a('0x22')](_0x41fc02,function(_0x3efa04){_0x35a3e9[_0xd90a('0x1a')](_0x3efa04);})[_0xd90a('0x11')](function(){for(var _0x6a2c10=0x0;_0x6a2c10<_0x35a3e9[_0xd90a('0x23')];_0x6a2c10+=0x1){var _0x2349fb;var _0x121700=_0x35a3e9[_0x6a2c10];if(_0x80e654){_0x2349fb=path['join'](_0x22c761,_0x1cccab,util[_0xd90a('0xb')](_0xd90a('0x24'),_0x1cccab,_0x6a2c10,_0xd90a('0x25')));}else{_0x2349fb=path[_0xd90a('0x20')](_0x22c761,util[_0xd90a('0xb')]('%s.%s',_0x1cccab,_0xd90a('0x25')));}fs[_0xd90a('0x26')](_0x2349fb,json2xls(_0x121700),_0xd90a('0x27'));}})[_0xd90a('0x11')](function(){if(_0x80e654){return new Promise(function(_0x204b2f){zipdir(path['join'](_0x22c761,_0x1cccab),{'saveTo':path['join'](_0x22c761,util[_0xd90a('0xb')](_0xd90a('0x28'),_0x1cccab,_0xd90a('0x29')))},function(_0x4304ac,_0xd76b6e){rimraf(path[_0xd90a('0x20')](_0x22c761,_0x1cccab),function(){});_0x204b2f(_0xd90a('0x2a'));});});}})[_0xd90a('0x11')](function(){logger[_0xd90a('0xa')](util['format'](_0xd90a('0x2b'),EXTRACTED_REPORT_ID,_0xd90a('0xd')));return analyticExtractedReport(_0xd90a('0x2c'),_0x80e654?util[_0xd90a('0xb')](_0xd90a('0x28'),_0x1cccab,_0x80e654?'zip':_0xd90a('0x25')):null);});})['catch'](function(_0x53b145){logger[_0xd90a('0xa')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd90a('0xd')),util[_0xd90a('0x2d')](_0x53b145,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd90a('0x2e'));})[_0xd90a('0x2f')](function(){process[_0xd90a('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 58204e1..3edf2ac 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 _0x30c8=['Interval','findAll','then','IntervalId','models','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority','extension','find','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)=','outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','interval','*,*,*,*','hasOwnProperty','tag','CDR(tag)=','callerID','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x30c8,0x152));var _0x830c=function(_0x144d42,_0x4241a3){_0x144d42=_0x144d42-0x0;var _0x6bf76e=_0x30c8[_0x144d42];return _0x6bf76e;};'use strict';var _=require(_0x830c('0x0'));var util=require(_0x830c('0x1'));function rewrite(_0x53a601,_0x4941c4){var _0x540d31=this;return _0x53a601['models'][_0x830c('0x2')][_0x830c('0x3')]({'raw':!![]})[_0x830c('0x4')](function(_0x438faa){_0x540d31['intervals']=_0x438faa;return _0x53a601['models']['VoiceExtension'][_0x830c('0x3')]({'where':{'IntervalId':_0x4941c4[_0x830c('0x5')]},'raw':!![]});})[_0x830c('0x4')](function(_0x211f3b){return _0x53a601[_0x830c('0x6')][_0x830c('0x7')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x830c('0x8')](_0x211f3b,_0x830c('0x9')))}},'order':[{'raw':_0x830c('0xa')}],'raw':!![]});})[_0x830c('0x4')](function(_0x44400d){var _0x3820aa=_['filter'](_0x44400d,{'priority':'1'});var _0x37b78b=_[_0x830c('0xb')](_0x44400d,{'isApp':0x1});var _0x3d2fd6=_[_0x830c('0xc')](_0x37b78b,_0x830c('0x9'));var _0x4ac3e2=['queue',_0x830c('0xd')];var _0x4e7153=[];var _0x5dc14a=[];for(var _0x1b44d0 in _0x3d2fd6){if(_0x3d2fd6['hasOwnProperty'](_0x1b44d0)){_0x540d31[_0x830c('0xe')]=0x2;_0x540d31['extensions']=[];_0x540d31[_0x830c('0xf')]=_[_0x830c('0x10')](_0x3820aa,{'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')]});_0x540d31[_0x830c('0x11')][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':util[_0x830c('0x15')](_0x830c('0x16'),_0x3d2fd6[_0x1b44d0][0x0]['type']),'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31['priority']++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});if(_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')]==='inbound'){_0x540d31['extensions'][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':'Set','appdata':_0x830c('0x19')+_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')],'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31['priority']++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0]['VoiceExtensionId']});}else if(_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')]===_0x830c('0x1a')){if(_0x540d31[_0x830c('0xf')]){_0x540d31[_0x830c('0x11')][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':'CDR(destination)='+(_0x540d31[_0x830c('0xf')][_0x830c('0x1b')]?_0x830c('0x1c')+_0x540d31[_0x830c('0xf')][_0x830c('0x1b')]+'}':'${EXTEN}'),'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0]['exten'],'priority':_0x540d31['priority']++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0]['VoiceExtensionId']});}_0x540d31['extensions']['push']({'type':_0x3d2fd6[_0x1b44d0][0x0]['type'],'app':'Set','appdata':_0x830c('0x19')+_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')],'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31[_0x830c('0xe')]++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0]['VoiceExtensionId']});var _0x3175b4=_0x540d31['priority']++;_0x540d31[_0x830c('0x11')][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':_0x830c('0x1d'),'appdata':_0x830c('0x1e')+(_0x3175b4+0x2)+_0x830c('0x1f')+(_0x3175b4+0x1)+')','context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x3175b4,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});if(_0x540d31[_0x830c('0xf')]){_0x540d31[_0x830c('0x11')][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':_0x540d31[_0x830c('0xf')]['cutdigits']?_0x830c('0x20')+_0x540d31[_0x830c('0xf')]['cutdigits']+'}':_0x830c('0x21'),'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31[_0x830c('0xe')]++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});}_0x540d31[_0x830c('0x11')]['push']({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':_0x830c('0x22')+_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')],'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0]['exten'],'priority':_0x540d31['priority']++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0]['VoiceExtensionId']});if(_0x540d31[_0x830c('0xf')]&&_0x540d31['extension']['hasOwnProperty'](_0x830c('0x23'))&&_0x540d31['extension'][_0x830c('0x23')]!==_0x830c('0x24')){_0x540d31['extensions'][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':_0x830c('0x25'),'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31[_0x830c('0xe')]++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0]['VoiceExtensionId']});_0x540d31[_0x830c('0x11')][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0]['type'],'app':_0x830c('0x14'),'appdata':_0x830c('0x26')+_0x540d31[_0x830c('0xf')][_0x830c('0x23')]||_0x830c('0x27'),'context':_0x3d2fd6[_0x1b44d0][0x0]['context'],'exten':_0x3d2fd6[_0x1b44d0][0x0]['exten'],'priority':_0x540d31[_0x830c('0xe')]++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});}}_0x540d31[_0x830c('0x11')][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':'Set','appdata':_0x830c('0x28'),'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31[_0x830c('0xe')]++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});_0x540d31['extensions'][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':_0x830c('0x29'),'context':_0x3d2fd6[_0x1b44d0][0x0]['context'],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31['priority']++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});_0x540d31[_0x830c('0x11')][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0]['type'],'app':_0x830c('0x14'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'priority':_0x540d31[_0x830c('0xe')]++,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});for(var _0x7d89e8=0x0,_0x3a06f6=0x0;_0x7d89e8<_0x3d2fd6[_0x1b44d0][_0x830c('0x2a')];_0x7d89e8+=0x1,_0x3a06f6=0x0){var _0x563b55=_0x3d2fd6[_0x1b44d0][_0x7d89e8];if(_0x563b55[_0x830c('0x13')]){_0x563b55[_0x830c('0x13')]=_0x563b55['type'][_0x830c('0x2b')]();}var _0x5ed52d=[];var _0x296143=[];delete _0x563b55['id'];delete _0x563b55[_0x830c('0x2c')];delete _0x563b55['updatedAt'];var _0x41fe70=_0x563b55[_0x830c('0x2d')]!==_0x830c('0x2e')?[_0x563b55[_0x830c('0x2d')]]:_0x563b55['IntervalId']?_[_0x830c('0x8')](_[_0x830c('0xb')](_0x540d31['intervals'],{'IntervalId':_0x563b55[_0x830c('0x5')]}),_0x830c('0x2d')):[];if(_0x563b55[_0x830c('0x2f')]('tag')){if(_0x563b55['tag']&&_0x563b55[_0x830c('0x30')]!=='--'){_0x5ed52d[_0x830c('0x12')]({'type':_0x563b55[_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':_0x830c('0x31')+_0x563b55[_0x830c('0x30')],'context':_0x563b55[_0x830c('0x17')],'exten':_0x563b55['exten'],'priority':_0x41fe70[_0x830c('0x2a')]+_0x540d31['priority']+_0x3a06f6++,'VoiceExtensionId':_0x563b55[_0x830c('0x18')]});}}if(_0x563b55[_0x830c('0x13')]==='outbound'&&_0x563b55['hasOwnProperty'](_0x830c('0x32'))){if(_0x563b55[_0x830c('0x32')]){_0x5ed52d['push']({'type':_0x563b55['type'],'app':_0x830c('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x563b55[_0x830c('0x32')]+')','context':_0x563b55['context'],'exten':_0x563b55[_0x830c('0x9')],'priority':_0x41fe70['length']+_0x540d31[_0x830c('0xe')]+_0x3a06f6++,'VoiceExtensionId':_0x563b55[_0x830c('0x18')]});}else{_0x5ed52d[_0x830c('0x12')]({'type':_0x563b55['type'],'app':_0x830c('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x563b55[_0x830c('0x17')],'exten':_0x563b55[_0x830c('0x9')],'priority':_0x41fe70[_0x830c('0x2a')]+_0x540d31[_0x830c('0xe')]+_0x3a06f6++,'VoiceExtensionId':_0x563b55[_0x830c('0x18')]});}}if(_0x563b55['hasOwnProperty'](_0x830c('0x33'))){if(_0x4ac3e2[_0x830c('0x34')](_0x563b55[_0x830c('0x35')][_0x830c('0x2b')]())>=0x0&&_0x563b55['appType']!==_0x830c('0x36')){if(_0x563b55[_0x830c('0x33')]){_0x5ed52d['push']({'type':_0x563b55[_0x830c('0x13')],'app':_0x830c('0x1d'),'appdata':_0x830c('0x37'),'context':_0x563b55[_0x830c('0x17')],'exten':_0x563b55[_0x830c('0x9')],'priority':_0x41fe70['length']+_0x540d31[_0x830c('0xe')]+_0x3a06f6++,'VoiceExtensionId':_0x563b55['VoiceExtensionId']});_0x5ed52d[_0x830c('0x12')]({'type':_0x563b55[_0x830c('0x13')],'app':_0x830c('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x563b55[_0x830c('0x17')],'exten':_0x563b55['exten'],'priority':_0x41fe70[_0x830c('0x2a')]+_0x540d31[_0x830c('0xe')]+_0x3a06f6++,'VoiceExtensionId':_0x563b55[_0x830c('0x18')]});}else{_0x5ed52d['push']({'type':_0x563b55[_0x830c('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x563b55[_0x830c('0x17')],'exten':_0x563b55['exten'],'priority':_0x41fe70[_0x830c('0x2a')]+_0x540d31['priority']+_0x3a06f6++,'VoiceExtensionId':_0x563b55['VoiceExtensionId']});_0x5ed52d[_0x830c('0x12')]({'type':_0x563b55['type'],'app':'Set','appdata':_0x830c('0x38'),'context':_0x563b55[_0x830c('0x17')],'exten':_0x563b55[_0x830c('0x9')],'priority':_0x41fe70[_0x830c('0x2a')]+_0x540d31[_0x830c('0xe')]+_0x3a06f6++,'VoiceExtensionId':_0x563b55[_0x830c('0x18')]});}}}for(var _0x29f4c8=0x0;_0x29f4c8<_0x41fe70[_0x830c('0x2a')];_0x29f4c8+=0x1){var _0x2e2a37=_0x540d31[_0x830c('0xe')]+_0x41fe70[_0x830c('0x2a')];var _0x1545e1=_0x29f4c8===_0x41fe70['length']-0x1?_0x540d31[_0x830c('0xe')]+_0x5ed52d['length']+_0x296143[_0x830c('0x2a')]+0x2:_0x540d31[_0x830c('0xe')]+_0x29f4c8+0x1;_0x5ed52d[_0x830c('0x39')](_0x29f4c8,0x0,{'type':_0x563b55['type'],'app':'GotoIfTime','appdata':_0x41fe70[_0x29f4c8]+'?'+_0x563b55['context']+',${EXTEN},'+_0x2e2a37+':'+_0x563b55['context']+_0x830c('0x3a')+_0x1545e1,'exten':_0x563b55[_0x830c('0x9')],'context':_0x563b55[_0x830c('0x17')],'priority':_0x540d31[_0x830c('0xe')]+_0x29f4c8,'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});}_0x563b55['priority']=_0x5ed52d['length']?_[_0x830c('0x3b')](_0x5ed52d)['priority']+0x1:_0x540d31['priority'];_0x540d31[_0x830c('0xe')]=(_0x296143[_0x830c('0x2a')]?_['last'](_0x296143)[_0x830c('0xe')]:_0x563b55[_0x830c('0xe')])+0x1;_0x540d31[_0x830c('0x11')]=_[_0x830c('0x3c')](_0x540d31[_0x830c('0x11')],_0x5ed52d,[_0x563b55],_0x296143);}_0x540d31['extensions'][_0x830c('0x12')]({'type':_0x3d2fd6[_0x1b44d0][0x0]['type'],'app':_0x830c('0x3d'),'exten':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x9')],'context':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x17')],'priority':_0x540d31[_0x830c('0xe')],'VoiceExtensionId':_0x3d2fd6[_0x1b44d0][0x0][_0x830c('0x18')]});_0x4e7153[_0x830c('0x12')](_0x3d2fd6[_0x1b44d0][0x0]['VoiceExtensionId']);_0x5dc14a=_['concat'](_0x5dc14a,_0x540d31[_0x830c('0x11')]);}}return _0x53a601[_0x830c('0x3e')](function(_0xa08c48){return _0x53a601[_0x830c('0x6')][_0x830c('0x7')][_0x830c('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x4e7153}},'transaction':_0xa08c48})[_0x830c('0x4')](function(_0xbe8e83){return _0x53a601[_0x830c('0x6')][_0x830c('0x7')]['bulkCreate'](_[_0x830c('0x40')](_0x5dc14a,_0x830c('0xe')),{'transaction':_0xa08c48});});});})[_0x830c('0x41')](function(_0x1c549e){console[_0x830c('0x42')](_0x1c549e);});}exports[_0x830c('0x43')]=rewrite; \ No newline at end of file +var _0x9e24=['type','push','CDR(routeid)=','VoiceExtensionId','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime','last','concat','Hangup','destroy','bulkCreate','sortBy','error','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','Set','format','CDR(type)=%s','context'];(function(_0x5e53ae,_0x24af4f){var _0x27a8a2=function(_0xa6a715){while(--_0xa6a715){_0x5e53ae['push'](_0x5e53ae['shift']());}};_0x27a8a2(++_0x24af4f);}(_0x9e24,0xc1));var _0x49e2=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x9e24[_0x79cd47];return _0x3b9484;};'use strict';var _=require('lodash');var util=require(_0x49e2('0x0'));function rewrite(_0x350639,_0x46ffba){var _0x4c4f30=this;return _0x350639[_0x49e2('0x1')][_0x49e2('0x2')][_0x49e2('0x3')]({'raw':!![]})[_0x49e2('0x4')](function(_0x171ce8){_0x4c4f30[_0x49e2('0x5')]=_0x171ce8;return _0x350639[_0x49e2('0x1')][_0x49e2('0x6')][_0x49e2('0x3')]({'where':{'IntervalId':_0x46ffba[_0x49e2('0x7')]},'raw':!![]});})[_0x49e2('0x4')](function(_0x2d648d){return _0x350639[_0x49e2('0x1')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x49e2('0x8')](_0x2d648d,_0x49e2('0x9')))}},'order':[{'raw':_0x49e2('0xa')}],'raw':!![]});})['then'](function(_0x4a2eb5){var _0x1e2eff=_['filter'](_0x4a2eb5,{'priority':'1'});var _0x3b84b1=_[_0x49e2('0xb')](_0x4a2eb5,{'isApp':0x1});var _0x1be0c9=_[_0x49e2('0xc')](_0x3b84b1,_0x49e2('0x9'));var _0xe51b78=['queue',_0x49e2('0xd')];var _0x59c336=[];var _0x1b47c9=[];for(var _0x2a55de in _0x1be0c9){if(_0x1be0c9[_0x49e2('0xe')](_0x2a55de)){_0x4c4f30[_0x49e2('0xf')]=0x2;_0x4c4f30[_0x49e2('0x10')]=[];_0x4c4f30[_0x49e2('0x11')]=_[_0x49e2('0x12')](_0x1e2eff,{'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')]});_0x4c4f30['extensions']['push']({'type':_0x1be0c9[_0x2a55de][0x0]['type'],'app':_0x49e2('0x13'),'appdata':util[_0x49e2('0x14')](_0x49e2('0x15'),_0x1be0c9[_0x2a55de][0x0]['type']),'context':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x16')],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30['priority']++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0]['VoiceExtensionId']});if(_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')]==='inbound'){_0x4c4f30['extensions'][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0]['type'],'app':_0x49e2('0x13'),'appdata':_0x49e2('0x19')+_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')],'context':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x16')],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});}else if(_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')]==='outbound'){if(_0x4c4f30[_0x49e2('0x11')]){_0x4c4f30['extensions'][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0]['type'],'app':_0x49e2('0x13'),'appdata':'CDR(destination)='+(_0x4c4f30['extension'][_0x49e2('0x1b')]?_0x49e2('0x1c')+_0x4c4f30['extension'][_0x49e2('0x1b')]+'}':_0x49e2('0x1d')),'context':_0x1be0c9[_0x2a55de][0x0]['context'],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});}_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')],'app':'Set','appdata':_0x49e2('0x19')+_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')],'context':_0x1be0c9[_0x2a55de][0x0]['context'],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0]['VoiceExtensionId']});var _0x5b3101=_0x4c4f30[_0x49e2('0xf')]++;_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')],'app':_0x49e2('0x1e'),'appdata':_0x49e2('0x1f')+(_0x5b3101+0x2)+_0x49e2('0x20')+(_0x5b3101+0x1)+')','context':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x16')],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x5b3101,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0]['VoiceExtensionId']});if(_0x4c4f30[_0x49e2('0x11')]){_0x4c4f30[_0x49e2('0x10')]['push']({'type':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')],'app':_0x49e2('0x13'),'appdata':_0x4c4f30['extension']['cutdigits']?_0x49e2('0x21')+_0x4c4f30[_0x49e2('0x11')][_0x49e2('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x1be0c9[_0x2a55de][0x0]['context'],'exten':_0x1be0c9[_0x2a55de][0x0]['exten'],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});}_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')],'app':'Set','appdata':_0x49e2('0x22')+_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')],'context':_0x1be0c9[_0x2a55de][0x0]['context'],'exten':_0x1be0c9[_0x2a55de][0x0]['exten'],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0]['VoiceExtensionId']});if(_0x4c4f30[_0x49e2('0x11')]&&_0x4c4f30[_0x49e2('0x11')][_0x49e2('0xe')](_0x49e2('0x23'))&&_0x4c4f30[_0x49e2('0x11')][_0x49e2('0x23')]!==_0x49e2('0x24')){_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0]['type'],'app':_0x49e2('0x13'),'appdata':_0x49e2('0x25'),'context':_0x1be0c9[_0x2a55de][0x0]['context'],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30['priority']++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')],'app':_0x49e2('0x13'),'appdata':_0x49e2('0x26')+_0x4c4f30['extension'][_0x49e2('0x23')]||_0x49e2('0x27'),'context':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x16')],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});}}_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0]['type'],'app':_0x49e2('0x13'),'appdata':_0x49e2('0x28'),'context':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x16')],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x17')],'app':_0x49e2('0x13'),'appdata':_0x49e2('0x29'),'context':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x16')],'exten':_0x1be0c9[_0x2a55de][0x0]['exten'],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0]['type'],'app':_0x49e2('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1be0c9[_0x2a55de][0x0]['context'],'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'priority':_0x4c4f30[_0x49e2('0xf')]++,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});for(var _0x5192de=0x0,_0x38789e=0x0;_0x5192de<_0x1be0c9[_0x2a55de][_0x49e2('0x2a')];_0x5192de+=0x1,_0x38789e=0x0){var _0xda0fb1=_0x1be0c9[_0x2a55de][_0x5192de];if(_0xda0fb1[_0x49e2('0x17')]){_0xda0fb1[_0x49e2('0x17')]=_0xda0fb1[_0x49e2('0x17')][_0x49e2('0x2b')]();}var _0x241d99=[];var _0x179f36=[];delete _0xda0fb1['id'];delete _0xda0fb1[_0x49e2('0x2c')];delete _0xda0fb1[_0x49e2('0x2d')];var _0x3f83f0=_0xda0fb1[_0x49e2('0x2e')]!==_0x49e2('0x2f')?[_0xda0fb1[_0x49e2('0x2e')]]:_0xda0fb1[_0x49e2('0x7')]?_[_0x49e2('0x8')](_[_0x49e2('0xb')](_0x4c4f30['intervals'],{'IntervalId':_0xda0fb1['IntervalId']}),_0x49e2('0x2e')):[];if(_0xda0fb1['hasOwnProperty']('tag')){if(_0xda0fb1[_0x49e2('0x30')]&&_0xda0fb1[_0x49e2('0x30')]!=='--'){_0x241d99[_0x49e2('0x18')]({'type':_0xda0fb1[_0x49e2('0x17')],'app':'Set','appdata':_0x49e2('0x31')+_0xda0fb1[_0x49e2('0x30')],'context':_0xda0fb1[_0x49e2('0x16')],'exten':_0xda0fb1['exten'],'priority':_0x3f83f0[_0x49e2('0x2a')]+_0x4c4f30[_0x49e2('0xf')]+_0x38789e++,'VoiceExtensionId':_0xda0fb1['VoiceExtensionId']});}}if(_0xda0fb1[_0x49e2('0x17')]===_0x49e2('0x32')&&_0xda0fb1['hasOwnProperty']('callerID')){if(_0xda0fb1[_0x49e2('0x33')]){_0x241d99[_0x49e2('0x18')]({'type':_0xda0fb1[_0x49e2('0x17')],'app':_0x49e2('0x1e'),'appdata':_0x49e2('0x34')+_0xda0fb1['callerID']+')','context':_0xda0fb1[_0x49e2('0x16')],'exten':_0xda0fb1[_0x49e2('0x9')],'priority':_0x3f83f0[_0x49e2('0x2a')]+_0x4c4f30[_0x49e2('0xf')]+_0x38789e++,'VoiceExtensionId':_0xda0fb1[_0x49e2('0x1a')]});}else{_0x241d99[_0x49e2('0x18')]({'type':_0xda0fb1[_0x49e2('0x17')],'app':'ExecIf','appdata':_0x49e2('0x35'),'context':_0xda0fb1[_0x49e2('0x16')],'exten':_0xda0fb1[_0x49e2('0x9')],'priority':_0x3f83f0['length']+_0x4c4f30[_0x49e2('0xf')]+_0x38789e++,'VoiceExtensionId':_0xda0fb1[_0x49e2('0x1a')]});}}if(_0xda0fb1['hasOwnProperty']('answer')){if(_0xe51b78[_0x49e2('0x36')](_0xda0fb1[_0x49e2('0x37')]['toLowerCase']())>=0x0&&_0xda0fb1[_0x49e2('0x38')]!==_0x49e2('0x39')){if(_0xda0fb1[_0x49e2('0x3a')]){_0x241d99['push']({'type':_0xda0fb1[_0x49e2('0x17')],'app':_0x49e2('0x1e'),'appdata':_0x49e2('0x3b'),'context':_0xda0fb1['context'],'exten':_0xda0fb1[_0x49e2('0x9')],'priority':_0x3f83f0['length']+_0x4c4f30['priority']+_0x38789e++,'VoiceExtensionId':_0xda0fb1[_0x49e2('0x1a')]});_0x241d99['push']({'type':_0xda0fb1[_0x49e2('0x17')],'app':_0x49e2('0x13'),'appdata':_0x49e2('0x3c'),'context':_0xda0fb1[_0x49e2('0x16')],'exten':_0xda0fb1[_0x49e2('0x9')],'priority':_0x3f83f0['length']+_0x4c4f30[_0x49e2('0xf')]+_0x38789e++,'VoiceExtensionId':_0xda0fb1['VoiceExtensionId']});}else{_0x241d99[_0x49e2('0x18')]({'type':_0xda0fb1[_0x49e2('0x17')],'app':'ExecIf','appdata':_0x49e2('0x3d'),'context':_0xda0fb1['context'],'exten':_0xda0fb1['exten'],'priority':_0x3f83f0[_0x49e2('0x2a')]+_0x4c4f30[_0x49e2('0xf')]+_0x38789e++,'VoiceExtensionId':_0xda0fb1['VoiceExtensionId']});_0x241d99['push']({'type':_0xda0fb1[_0x49e2('0x17')],'app':_0x49e2('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0xda0fb1[_0x49e2('0x16')],'exten':_0xda0fb1[_0x49e2('0x9')],'priority':_0x3f83f0[_0x49e2('0x2a')]+_0x4c4f30['priority']+_0x38789e++,'VoiceExtensionId':_0xda0fb1['VoiceExtensionId']});}}}for(var _0x585334=0x0;_0x585334<_0x3f83f0['length'];_0x585334+=0x1){var _0x2b4fad=_0x4c4f30['priority']+_0x3f83f0[_0x49e2('0x2a')];var _0xa0209d=_0x585334===_0x3f83f0[_0x49e2('0x2a')]-0x1?_0x4c4f30['priority']+_0x241d99['length']+_0x179f36['length']+0x2:_0x4c4f30['priority']+_0x585334+0x1;_0x241d99[_0x49e2('0x3e')](_0x585334,0x0,{'type':_0xda0fb1[_0x49e2('0x17')],'app':_0x49e2('0x3f'),'appdata':_0x3f83f0[_0x585334]+'?'+_0xda0fb1[_0x49e2('0x16')]+',${EXTEN},'+_0x2b4fad+':'+_0xda0fb1['context']+',${EXTEN},'+_0xa0209d,'exten':_0xda0fb1[_0x49e2('0x9')],'context':_0xda0fb1[_0x49e2('0x16')],'priority':_0x4c4f30[_0x49e2('0xf')]+_0x585334,'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});}_0xda0fb1[_0x49e2('0xf')]=_0x241d99[_0x49e2('0x2a')]?_['last'](_0x241d99)[_0x49e2('0xf')]+0x1:_0x4c4f30[_0x49e2('0xf')];_0x4c4f30[_0x49e2('0xf')]=(_0x179f36[_0x49e2('0x2a')]?_[_0x49e2('0x40')](_0x179f36)[_0x49e2('0xf')]:_0xda0fb1[_0x49e2('0xf')])+0x1;_0x4c4f30[_0x49e2('0x10')]=_[_0x49e2('0x41')](_0x4c4f30[_0x49e2('0x10')],_0x241d99,[_0xda0fb1],_0x179f36);}_0x4c4f30[_0x49e2('0x10')][_0x49e2('0x18')]({'type':_0x1be0c9[_0x2a55de][0x0]['type'],'app':_0x49e2('0x42'),'exten':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x9')],'context':_0x1be0c9[_0x2a55de][0x0]['context'],'priority':_0x4c4f30['priority'],'VoiceExtensionId':_0x1be0c9[_0x2a55de][0x0][_0x49e2('0x1a')]});_0x59c336['push'](_0x1be0c9[_0x2a55de][0x0]['VoiceExtensionId']);_0x1b47c9=_['concat'](_0x1b47c9,_0x4c4f30['extensions']);}}return _0x350639['transaction'](function(_0x2535e6){return _0x350639[_0x49e2('0x1')][_0x49e2('0x6')][_0x49e2('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x59c336}},'transaction':_0x2535e6})['then'](function(_0x584ae9){return _0x350639[_0x49e2('0x1')][_0x49e2('0x6')][_0x49e2('0x44')](_[_0x49e2('0x45')](_0x1b47c9,'priority'),{'transaction':_0x2535e6});});});})['catch'](function(_0x42cb5b){console[_0x49e2('0x46')](_0x42cb5b);});}exports[_0x49e2('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 8163ad0..4001497 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 _0xca38=['dialCheckDuplicateType','Lists','then','push','sequelize','VoiceQueueId','onlyIfOpen','query','all','findAll','BlackLists','get','Campaign','always','CampaignId','CmList','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','contact','test','isNil','error','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_black','VoiceQueue','outbound'];(function(_0x41b388,_0x341b4c){var _0xf7b9ab=function(_0x5ab953){while(--_0x5ab953){_0x41b388['push'](_0x41b388['shift']());}};_0xf7b9ab(++_0x341b4c);}(_0xca38,0x96));var _0x8ca3=function(_0x41868e,_0x30f9a6){_0x41868e=_0x41868e-0x0;var _0x27b68e=_0xca38[_0x41868e];return _0x27b68e;};'use strict';var BPromise=require(_0x8ca3('0x0'));var util=require('util');var _=require(_0x8ca3('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x8ca3('0x2'));var Redis=require(_0x8ca3('0x3'));var db=require(_0x8ca3('0x4'))['db'];var config=require(_0x8ca3('0x5'));var logger=require('../../../config/logger')(_0x8ca3('0x6'));config[_0x8ca3('0x7')]=_[_0x8ca3('0x8')](config[_0x8ca3('0x7')],{'host':_0x8ca3('0x9'),'port':0x18eb});var socket=require(_0x8ca3('0xa'))(new Redis(config[_0x8ca3('0x7')]));require(_0x8ca3('0xb'))[_0x8ca3('0xc')](socket);try{if(!process[_0x8ca3('0xd')][0x2]||process['argv'][0x2]===_0x8ca3('0xe')||process['argv'][0x2]==='null'){throw new Error(_0x8ca3('0xf'));}var FILEPATH=process[_0x8ca3('0xd')][0x2];if(!process[_0x8ca3('0xd')][0x3]||process['argv'][0x3]===_0x8ca3('0xe')||process['argv'][0x3]===_0x8ca3('0x10')||!process['argv'][0x4]||process[_0x8ca3('0xd')][0x4]===_0x8ca3('0xe')||process[_0x8ca3('0xd')][0x4]===_0x8ca3('0x10')){throw new Error(_0x8ca3('0x11'));}var FIELDS=_[_0x8ca3('0x12')](process['argv'][0x3][_0x8ca3('0x13')](','),process[_0x8ca3('0xd')][0x4][_0x8ca3('0x13')](','));if(!process['argv'][0x5]||process[_0x8ca3('0xd')][0x5]===_0x8ca3('0xe')||process[_0x8ca3('0xd')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x8ca3('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x8ca3('0xd')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x8ca3('0x10')?process[_0x8ca3('0xd')][0x6]:null;var DUPLICATES=process[_0x8ca3('0xd')][0x7]&&process['argv'][0x7]!==_0x8ca3('0xe')&&process['argv'][0x7]!==_0x8ca3('0x10')?process[_0x8ca3('0xd')][0x7]:null;if(!process[_0x8ca3('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0x8ca3('0xd')][0x8]===_0x8ca3('0x10')){throw new Error(_0x8ca3('0x14'));}var SOCKET_TIMESTAMP=process[_0x8ca3('0xd')][0x8];}catch(_0x4c8d60){logger['error'](_0x4c8d60);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(_0x8429c9,_0x41b6fa,_0x449053,_0x440f55){var _0x274fbf={'message':_0x41b6fa};_0x274fbf[_0x8429c9]=!![];if(_0x449053){_0x274fbf[_0x8ca3('0x15')]=_0x449053;}if(_0x440f55){_0x274fbf['index']=_0x440f55;}return _0x274fbf;}function isEmail(_0x459d9c){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))*$/[_0x8ca3('0x16')](_0x459d9c);}function checkRow(_0x53a721,_0x3ec963,_0x4e55e1){return new BPromise(function(_0x2bd4a8,_0x1e7c1f){if(_[_0x8ca3('0x17')](_0x53a721)){return _0x1e7c1f(handleCheckRowError(_0x8ca3('0x18'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4e55e1));}if(_0x53a721[_0x8ca3('0x19')]&&_0x53a721['errors'][_0x8ca3('0x1a')]){var _0x92d68b=_[_0x8ca3('0x1b')](_0x53a721[_0x8ca3('0x19')],_0x8ca3('0x1c'))[_0x8ca3('0x1d')](';');return _0x1e7c1f(handleCheckRowError('error',_0x92d68b,null,_0x4e55e1));}var _0x133544={};for(var _0x1a1b8b in FIELDS){if(FIELDS['hasOwnProperty'](_0x1a1b8b)&&FIELDS[_0x1a1b8b]){_0x133544[_0x1a1b8b]=_0x53a721[_0x8ca3('0x1e')][0x0][FIELDS[_0x1a1b8b]]||_0x53a721['data'][0x0]['\ufeff'+FIELDS[_0x1a1b8b]];}}if(!_0x133544[_0x8ca3('0x1f')]){return _0x1e7c1f(handleCheckRowError(_0x8ca3('0x18'),_0x8ca3('0x20'),null,_0x4e55e1));}if(!_0x133544[_0x8ca3('0x21')]){return _0x1e7c1f(handleCheckRowError(_0x8ca3('0x18'),_0x8ca3('0x22'),null,_0x4e55e1));}if(_0x133544[_0x8ca3('0x23')]){var _0x640b80=moment(_0x133544[_0x8ca3('0x23')],'YYYY-MM-DD');if(!_0x640b80[_0x8ca3('0x24')]()){return _0x1e7c1f(handleCheckRowError(_0x8ca3('0x18'),_0x8ca3('0x25'),null,_0x4e55e1));}}if(_0x133544[_0x8ca3('0x26')]){if(!isEmail(_0x133544[_0x8ca3('0x26')])){return _0x1e7c1f(handleCheckRowError('error',_0x8ca3('0x27'),null,_0x4e55e1));}}_0x133544[_0x8ca3('0x28')]=LISTID;_0x133544[_0x8ca3('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8ca3('0x1a')]&&_0x3ec963){var _0x21611e={};for(var _0x3a4e44=0x0,_0x1a2c1c=DUPLICATES['length'];_0x3a4e44<_0x1a2c1c;_0x3a4e44+=0x1){_0x21611e[DUPLICATES[_0x3a4e44]]=_0x133544[DUPLICATES[_0x3a4e44]];}var _0x6a6c49=_[_0x8ca3('0x2a')](_0x3ec963,_0x21611e);if(_0x6a6c49){return _0x1e7c1f(handleCheckRowError(_0x8ca3('0x2b'),_0x8ca3('0x2c'),_0x6a6c49,_0x4e55e1));}}return db[_0x8ca3('0x2d')][_0x8ca3('0x2e')](_0x133544,{'raw':!![],'hooks':![],'fields':_[_0x8ca3('0x2f')](_0x133544)})['then'](function(_0x1234fc){if(DUPLICATES&&DUPLICATES[_0x8ca3('0x1a')]&&_0x3ec963){_0x3ec963['push'](_[_0x8ca3('0x30')](_0x133544,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1234fc['id'];return _0x2bd4a8();})[_0x8ca3('0x31')](function(_0x2cf04e){return _0x1e7c1f(handleCheckRowError(_0x8ca3('0x18'),_0x8ca3('0x32')+(_0x2cf04e['message']||JSON[_0x8ca3('0x33')](_0x2cf04e)),null,_0x4e55e1));});});}function checkHopper(){function _0x3ec783(){return function(_0xb94d1b){logger[_0x8ca3('0x18')]('cmContact',_0x8ca3('0x34'),util[_0x8ca3('0x35')](_0xb94d1b,{'showHidden':![],'depth':null}));};}var _0x195a91=function(_0x1a0dbf,_0x10d280){var _0x3cc63b=squel[_0x8ca3('0x36')]()[_0x8ca3('0x37')]('cm_hopper')[_0x8ca3('0x38')](['phone',_0x8ca3('0x39'),_0x8ca3('0x3a'),_0x8ca3('0x28'),_0x10d280,_0x8ca3('0x3b'),_0x8ca3('0x3c')],squel[_0x8ca3('0x3d')]()[_0x8ca3('0x3e')]('phone',_0x8ca3('0x21'))[_0x8ca3('0x3e')](_0x8ca3('0x3f'),_0x8ca3('0x39'))[_0x8ca3('0x3e')]('id',_0x8ca3('0x3a'))['field'](LISTID[_0x8ca3('0x40')](),_0x8ca3('0x28'))[_0x8ca3('0x3e')](_0x1a0dbf['id'][_0x8ca3('0x40')](),_0x10d280)[_0x8ca3('0x3e')]('NOW()','createdAt')[_0x8ca3('0x3e')]('NOW()',_0x8ca3('0x3c'))[_0x8ca3('0x41')](_0x8ca3('0x42'))[_0x8ca3('0x43')]('deletedAt\x20IS\x20NULL')[_0x8ca3('0x43')](_0x8ca3('0x44'),LISTID[_0x8ca3('0x40')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x8ca3('0x43')](_0x8ca3('0x45'),squel['select']()[_0x8ca3('0x3e')](_0x8ca3('0x21'))[_0x8ca3('0x41')](_0x8ca3('0x46'))[_0x8ca3('0x43')](_0x10d280+_0x8ca3('0x47'),_0x1a0dbf['id']['toString']())))[_0x8ca3('0x40')]();return _0x3cc63b;};var _0x4c000b=function(_0x4ded4a,_0x43be89){var _0x49791b=squel[_0x8ca3('0x36')]()[_0x8ca3('0x37')]('cm_hopper')['fromQuery'](['phone',_0x8ca3('0x39'),_0x8ca3('0x3a'),'ListId',_0x43be89,_0x8ca3('0x3b'),_0x8ca3('0x3c')],squel[_0x8ca3('0x3d')]()[_0x8ca3('0x3e')](_0x8ca3('0x21'),_0x8ca3('0x21'))[_0x8ca3('0x3e')](_0x8ca3('0x3f'),'scheduledAt')[_0x8ca3('0x3e')]('id','ContactId')[_0x8ca3('0x3e')](LISTID[_0x8ca3('0x40')](),_0x8ca3('0x28'))[_0x8ca3('0x3e')](_0x4ded4a['id']['toString'](),_0x43be89)['field'](_0x8ca3('0x3f'),'createdAt')['field'](_0x8ca3('0x3f'),'updatedAt')['from']('cm_contacts')[_0x8ca3('0x43')](_0x8ca3('0x48'))[_0x8ca3('0x43')]('ListId\x20=\x20?',LISTID[_0x8ca3('0x40')]())[_0x8ca3('0x43')](_0x8ca3('0x49'),squel[_0x8ca3('0x4a')](hopperContacts))[_0x8ca3('0x43')](_0x8ca3('0x4b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8ca3('0x3d')]()[_0x8ca3('0x3e')](_0x8ca3('0x4c'))['from']('cm_hopper_final')[_0x8ca3('0x43')](_0x43be89+'\x20=\x20?',_0x4ded4a['id'][_0x8ca3('0x40')]()))['where'](_0x8ca3('0x45'),squel[_0x8ca3('0x3d')]()[_0x8ca3('0x3e')](_0x8ca3('0x21'))[_0x8ca3('0x41')](_0x8ca3('0x46'))['where'](_0x43be89+_0x8ca3('0x47'),_0x4ded4a['id'][_0x8ca3('0x40')]())))[_0x8ca3('0x40')]();return _0x49791b;};function _0x4d48ce(_0x291a7e,_0x444ee0){var _0x2a5b1c=squel['insert']()[_0x8ca3('0x37')]('cm_hopper')[_0x8ca3('0x38')]([_0x8ca3('0x21'),_0x8ca3('0x39'),_0x8ca3('0x3a'),_0x8ca3('0x28'),_0x444ee0,'createdAt',_0x8ca3('0x3c')],squel[_0x8ca3('0x3d')]()['field'](_0x8ca3('0x21'),_0x8ca3('0x21'))[_0x8ca3('0x3e')]('NOW()',_0x8ca3('0x39'))[_0x8ca3('0x3e')]('id',_0x8ca3('0x3a'))[_0x8ca3('0x3e')](LISTID['toString'](),'ListId')[_0x8ca3('0x3e')](_0x291a7e['id'][_0x8ca3('0x40')](),_0x444ee0)[_0x8ca3('0x3e')]('NOW()','createdAt')['field'](_0x8ca3('0x3f'),'updatedAt')[_0x8ca3('0x41')](_0x8ca3('0x42'))[_0x8ca3('0x43')]('deletedAt\x20IS\x20NULL')[_0x8ca3('0x43')](_0x8ca3('0x44'),LISTID['toString']())['where'](_0x8ca3('0x49'),squel['str'](hopperContacts))['where'](_0x8ca3('0x4b')))[_0x8ca3('0x40')]();return _0x2a5b1c;}function _0x574dbd(_0x408167,_0x336134){var _0x2f968f=squel[_0x8ca3('0x36')]()['into'](_0x8ca3('0x4d'))[_0x8ca3('0x38')]([_0x8ca3('0x21'),_0x8ca3('0x3a'),_0x8ca3('0x28'),_0x336134,_0x8ca3('0x3b'),'updatedAt'],squel[_0x8ca3('0x3d')]()[_0x8ca3('0x3e')](_0x8ca3('0x21'),_0x8ca3('0x21'))['field']('id',_0x8ca3('0x3a'))[_0x8ca3('0x3e')](LISTID[_0x8ca3('0x40')](),_0x8ca3('0x28'))['field'](_0x408167['id']['toString'](),_0x336134)['field'](_0x8ca3('0x3f'),_0x8ca3('0x3b'))[_0x8ca3('0x3e')](_0x8ca3('0x3f'),_0x8ca3('0x3c'))[_0x8ca3('0x41')]('cm_contacts')[_0x8ca3('0x43')](_0x8ca3('0x48'))[_0x8ca3('0x43')](_0x8ca3('0x44'),LISTID[_0x8ca3('0x40')]())[_0x8ca3('0x43')](_0x8ca3('0x49'),squel[_0x8ca3('0x4a')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x8ca3('0x40')]();return _0x2f968f;}return db[_0x8ca3('0x4e')]['findAll']({'where':{'type':_0x8ca3('0x4f')},'attributes':['id',_0x8ca3('0x50')],'include':[{'model':db['CmList'],'as':_0x8ca3('0x51'),'where':{'id':LISTID}}]})[_0x8ca3('0x52')](function(_0x452af9){var _0x3a516f=[];if(_0x452af9){var _0x5bb36c;for(var _0x30649f=0x0,_0x3496e4;_0x30649f<_0x452af9[_0x8ca3('0x1a')];_0x30649f+=0x1){_0x3496e4=_0x452af9[_0x30649f]['get']({'plain':!![]});switch(_0x3496e4[_0x8ca3('0x50')]){case'always':_0x3a516f[_0x8ca3('0x53')](db[_0x8ca3('0x54')]['query'](_0x4c000b(_0x3496e4,_0x8ca3('0x55')))[_0x8ca3('0x52')](function(){})[_0x8ca3('0x31')](_0x3ec783()));break;case _0x8ca3('0x56'):_0x3a516f[_0x8ca3('0x53')](db[_0x8ca3('0x54')][_0x8ca3('0x57')](_0x195a91(_0x3496e4,'VoiceQueueId'))[_0x8ca3('0x52')](function(){})['catch'](_0x3ec783()));break;default:_0x3a516f[_0x8ca3('0x53')](db['sequelize'][_0x8ca3('0x57')](_0x4d48ce(_0x3496e4,_0x8ca3('0x55')))[_0x8ca3('0x52')](function(){})[_0x8ca3('0x31')](_0x3ec783()));}}}return _0x3a516f;})[_0x8ca3('0x58')]()[_0x8ca3('0x52')](function(){return db[_0x8ca3('0x4e')][_0x8ca3('0x59')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x8ca3('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x632932){var _0x395fa6=[];if(_0x632932){var _0x546429;for(var _0x26f7c6=0x0,_0x2e3a42;_0x26f7c6<_0x632932[_0x8ca3('0x1a')];_0x26f7c6+=0x1){_0x2e3a42=_0x632932[_0x26f7c6][_0x8ca3('0x5b')]({'plain':!![]});_0x395fa6[_0x8ca3('0x53')](db[_0x8ca3('0x54')][_0x8ca3('0x57')](_0x574dbd(_0x2e3a42,'VoiceQueueId'))[_0x8ca3('0x52')](function(){})[_0x8ca3('0x31')](_0x3ec783()));}}return _0x395fa6;})[_0x8ca3('0x58')]();})[_0x8ca3('0x52')](function(){return db[_0x8ca3('0x5c')]['findAll']({'attributes':['id',_0x8ca3('0x50')],'include':[{'model':db['CmList'],'as':_0x8ca3('0x51'),'where':{'id':LISTID}}]})[_0x8ca3('0x52')](function(_0xf37991){var _0x49abb8=[];if(_0xf37991){for(var _0x5f4b20=0x0,_0x22be8e;_0x5f4b20<_0xf37991[_0x8ca3('0x1a')];_0x5f4b20+=0x1){_0x22be8e=_0xf37991[_0x5f4b20][_0x8ca3('0x5b')]({'plain':!![]});switch(_0x22be8e[_0x8ca3('0x50')]){case _0x8ca3('0x5d'):_0x49abb8[_0x8ca3('0x53')](db[_0x8ca3('0x54')][_0x8ca3('0x57')](_0x4c000b(_0x22be8e,_0x8ca3('0x5e')))['then'](function(){})[_0x8ca3('0x31')](_0x3ec783()));break;case'onlyIfOpen':_0x49abb8[_0x8ca3('0x53')](db[_0x8ca3('0x54')][_0x8ca3('0x57')](_0x195a91(_0x22be8e,_0x8ca3('0x5e')))[_0x8ca3('0x52')](function(){})[_0x8ca3('0x31')](_0x3ec783()));break;default:_0x49abb8[_0x8ca3('0x53')](db['sequelize'][_0x8ca3('0x57')](_0x4d48ce(_0x22be8e,_0x8ca3('0x5e')))[_0x8ca3('0x52')](function(){})[_0x8ca3('0x31')](_0x3ec783()));}}}return _0x49abb8;})['all']();})[_0x8ca3('0x52')](function(){return db[_0x8ca3('0x5c')][_0x8ca3('0x59')]({'attributes':['id'],'include':[{'model':db[_0x8ca3('0x5f')],'as':_0x8ca3('0x5a'),'where':{'id':LISTID}}]})[_0x8ca3('0x52')](function(_0x4388a7){var _0x14a027=[];if(_0x4388a7){for(var _0x96c715=0x0,_0xb796e1;_0x96c715<_0x4388a7[_0x8ca3('0x1a')];_0x96c715+=0x1){_0xb796e1=_0x4388a7[_0x96c715][_0x8ca3('0x5b')]({'plain':!![]});_0x14a027[_0x8ca3('0x53')](db['sequelize'][_0x8ca3('0x57')](_0x574dbd(_0xb796e1,_0x8ca3('0x5e')))[_0x8ca3('0x52')](function(){})[_0x8ca3('0x31')](_0x3ec783()));}}return _0x14a027;})[_0x8ca3('0x58')]();})['catch'](function(_0x3e9c93){logger['error'](_0x8ca3('0x60'),_0x8ca3('0x61'),_0x3e9c93[_0x8ca3('0x1c')]);});}var processPromises=function(_0x474bb3){return BPromise['all'](promises)[_0x8ca3('0x52')](function(_0x28e26e){})[_0x8ca3('0x31')](function(_0x55c4a2){logger[_0x8ca3('0x18')]('Error\x20processing\x20rows\x20block:',JSON[_0x8ca3('0x33')](_0x55c4a2));})[_0x8ca3('0x62')](function(){socket[_0x8ca3('0x63')](_0x8ca3('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x474bb3){return _0x474bb3[_0x8ca3('0x65')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x8ca3('0x52')](function(){if(hopperContacts){return checkHopper();}})[_0x8ca3('0x52')](function(){socket['emit'](_0x8ca3('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8ca3('0x66')](FILEPATH);}catch(_0x404270){logger['error'](_0x8ca3('0x67'),JSON[_0x8ca3('0x33')](_0x404270));}finally{process[_0x8ca3('0x68')](0x0);}});};process['on'](_0x8ca3('0x69'),function(){logger[_0x8ca3('0x6a')](_0x8ca3('0x6b'));endCsv();});function main(){return BPromise[_0x8ca3('0x6c')]()[_0x8ca3('0x52')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8ca3('0x13')](',');return db[_0x8ca3('0x2d')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1a13e9){var _0x5ecc2f=fs[_0x8ca3('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8ca3('0x6e')](_0x5ecc2f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5301c8,_0x2f4835){total+=0x1;var _0x277b12=total;promises[_0x8ca3('0x53')](checkRow(_0x5301c8,_0x1a13e9,_0x277b12)[_0x8ca3('0x52')](function(){success+=0x1;})[_0x8ca3('0x31')](function(_0x161d07){if(_0x161d07[_0x8ca3('0x18')]){errors+=0x1;delete _0x161d07[_0x8ca3('0x18')];}else if(_0x161d07[_0x8ca3('0x2b')]){duplicates+=0x1;delete _0x161d07[_0x8ca3('0x2b')];}rows[_0x8ca3('0x53')](_0x161d07);}));if(total%0xc8===0x0){_0x2f4835[_0x8ca3('0x6f')]();return processPromises(_0x2f4835);}},'complete':function(){return processPromises()[_0x8ca3('0x52')](function(){logger[_0x8ca3('0x6a')](_0x8ca3('0x70'));endCsv();});},'error':function(_0x509caf,_0x4da02f){logger[_0x8ca3('0x6a')](_0x8ca3('0x71'),JSON[_0x8ca3('0x33')](_0x509caf));endCsv();}});})[_0x8ca3('0x31')](function(_0x502d4b){logger['error'](_0x8ca3('0x72'),JSON[_0x8ca3('0x33')](_0x502d4b));});}main(); \ No newline at end of file +var _0xfb70=['contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','create','keys','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','insert','into','fromQuery','phone','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','from','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_hopper','createdAt','cm_contacts','str','cm_hopper_final','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','query','VoiceQueueId','then','onlyIfOpen','all','Campaign','Lists','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','message','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','null','Missing\x20filepath\x20parameter!','zipObject','split','error'];(function(_0x19af09,_0x12ac75){var _0x2c7b04=function(_0x1b4071){while(--_0x1b4071){_0x19af09['push'](_0x19af09['shift']());}};_0x2c7b04(++_0x12ac75);}(_0xfb70,0x133));var _0x0fb7=function(_0x444298,_0x2ba73a){_0x444298=_0x444298-0x0;var _0x34223b=_0xfb70[_0x444298];return _0x34223b;};'use strict';var BPromise=require(_0x0fb7('0x0'));var util=require(_0x0fb7('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x0fb7('0x2'));var Papa=require(_0x0fb7('0x3'));var Redis=require(_0x0fb7('0x4'));var db=require(_0x0fb7('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x0fb7('0x6'))(_0x0fb7('0x7'));config[_0x0fb7('0x8')]=_['defaults'](config['redis'],{'host':_0x0fb7('0x9'),'port':0x18eb});var socket=require(_0x0fb7('0xa'))(new Redis(config['redis']));require(_0x0fb7('0xb'))[_0x0fb7('0xc')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x0fb7('0xd')||process[_0x0fb7('0xe')][0x2]===_0x0fb7('0xf')){throw new Error(_0x0fb7('0x10'));}var FILEPATH=process[_0x0fb7('0xe')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0x0fb7('0xd')||process[_0x0fb7('0xe')][0x3]===_0x0fb7('0xf')||!process['argv'][0x4]||process[_0x0fb7('0xe')][0x4]===_0x0fb7('0xd')||process[_0x0fb7('0xe')][0x4]===_0x0fb7('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x0fb7('0x11')](process[_0x0fb7('0xe')][0x3][_0x0fb7('0x12')](','),process[_0x0fb7('0xe')][0x4][_0x0fb7('0x12')](','));if(!process[_0x0fb7('0xe')][0x5]||process[_0x0fb7('0xe')][0x5]===_0x0fb7('0xd')||process[_0x0fb7('0xe')][0x5]===_0x0fb7('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0fb7('0xe')][0x6]!==_0x0fb7('0xd')&&process['argv'][0x6]!==_0x0fb7('0xf')?process[_0x0fb7('0xe')][0x6]:null;var DUPLICATES=process[_0x0fb7('0xe')][0x7]&&process[_0x0fb7('0xe')][0x7]!=='undefined'&&process[_0x0fb7('0xe')][0x7]!=='null'?process[_0x0fb7('0xe')][0x7]:null;if(!process[_0x0fb7('0xe')][0x8]||process[_0x0fb7('0xe')][0x8]===_0x0fb7('0xd')||process[_0x0fb7('0xe')][0x8]===_0x0fb7('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x0fb7('0xe')][0x8];}catch(_0x513661){logger[_0x0fb7('0x13')](_0x513661);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(_0x312c66,_0x48bf13,_0x55c7d3,_0x57c02b){var _0x9b2d09={'message':_0x48bf13};_0x9b2d09[_0x312c66]=!![];if(_0x55c7d3){_0x9b2d09[_0x0fb7('0x14')]=_0x55c7d3;}if(_0x57c02b){_0x9b2d09['index']=_0x57c02b;}return _0x9b2d09;}function isEmail(_0x1e2802){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))*$/[_0x0fb7('0x15')](_0x1e2802);}function checkRow(_0x343ebf,_0x526662,_0x3c43b5){return new BPromise(function(_0x342ddd,_0x3bafd7){if(_[_0x0fb7('0x16')](_0x343ebf)){return _0x3bafd7(handleCheckRowError(_0x0fb7('0x13'),_0x0fb7('0x17'),null,_0x3c43b5));}if(_0x343ebf[_0x0fb7('0x18')]&&_0x343ebf[_0x0fb7('0x18')][_0x0fb7('0x19')]){var _0x574b48=_[_0x0fb7('0x1a')](_0x343ebf['errors'],'message')['join'](';');return _0x3bafd7(handleCheckRowError(_0x0fb7('0x13'),_0x574b48,null,_0x3c43b5));}var _0x4dd88f={};for(var _0x1333c6 in FIELDS){if(FIELDS[_0x0fb7('0x1b')](_0x1333c6)&&FIELDS[_0x1333c6]){_0x4dd88f[_0x1333c6]=_0x343ebf[_0x0fb7('0x1c')][0x0][FIELDS[_0x1333c6]]||_0x343ebf['data'][0x0]['\ufeff'+FIELDS[_0x1333c6]];}}if(!_0x4dd88f[_0x0fb7('0x1d')]){return _0x3bafd7(handleCheckRowError(_0x0fb7('0x13'),_0x0fb7('0x1e'),null,_0x3c43b5));}if(!_0x4dd88f['phone']){return _0x3bafd7(handleCheckRowError(_0x0fb7('0x13'),_0x0fb7('0x1f'),null,_0x3c43b5));}if(_0x4dd88f[_0x0fb7('0x20')]){var _0x3fb35e=moment(_0x4dd88f[_0x0fb7('0x20')],_0x0fb7('0x21'));if(!_0x3fb35e[_0x0fb7('0x22')]()){return _0x3bafd7(handleCheckRowError(_0x0fb7('0x13'),_0x0fb7('0x23'),null,_0x3c43b5));}}if(_0x4dd88f[_0x0fb7('0x24')]){if(!isEmail(_0x4dd88f[_0x0fb7('0x24')])){return _0x3bafd7(handleCheckRowError(_0x0fb7('0x13'),_0x0fb7('0x25'),null,_0x3c43b5));}}_0x4dd88f[_0x0fb7('0x26')]=LISTID;_0x4dd88f[_0x0fb7('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0fb7('0x19')]&&_0x526662){var _0x5c5b14={};for(var _0x251851=0x0,_0x1a14b2=DUPLICATES[_0x0fb7('0x19')];_0x251851<_0x1a14b2;_0x251851+=0x1){_0x5c5b14[DUPLICATES[_0x251851]]=_0x4dd88f[DUPLICATES[_0x251851]];}var _0x2165b6=_[_0x0fb7('0x28')](_0x526662,_0x5c5b14);if(_0x2165b6){return _0x3bafd7(handleCheckRowError(_0x0fb7('0x29'),'Duplicate\x20Contact',_0x2165b6,_0x3c43b5));}}return db['CmContact'][_0x0fb7('0x2a')](_0x4dd88f,{'raw':!![],'hooks':![],'fields':_[_0x0fb7('0x2b')](_0x4dd88f)})['then'](function(_0x1e68e2){if(DUPLICATES&&DUPLICATES['length']&&_0x526662){_0x526662[_0x0fb7('0x2c')](_['pick'](_0x4dd88f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1e68e2['id'];return _0x342ddd();})[_0x0fb7('0x2d')](function(_0x3091f8){return _0x3bafd7(handleCheckRowError(_0x0fb7('0x13'),_0x0fb7('0x2e')+(_0x3091f8['message']||JSON[_0x0fb7('0x2f')](_0x3091f8)),null,_0x3c43b5));});});}function checkHopper(){function _0x4688e0(){return function(_0x27883d){logger[_0x0fb7('0x13')]('cmContact',_0x0fb7('0x30'),util['inspect'](_0x27883d,{'showHidden':![],'depth':null}));};}var _0x5efab6=function(_0x41991f,_0x5a6b5f){var _0x19ad1e=squel[_0x0fb7('0x31')]()[_0x0fb7('0x32')]('cm_hopper')[_0x0fb7('0x33')]([_0x0fb7('0x34'),_0x0fb7('0x35'),_0x0fb7('0x36'),_0x0fb7('0x26'),_0x5a6b5f,'createdAt',_0x0fb7('0x37')],squel[_0x0fb7('0x38')]()[_0x0fb7('0x39')](_0x0fb7('0x34'),_0x0fb7('0x34'))['field'](_0x0fb7('0x3a'),_0x0fb7('0x35'))[_0x0fb7('0x39')]('id',_0x0fb7('0x36'))['field'](LISTID[_0x0fb7('0x3b')](),_0x0fb7('0x26'))[_0x0fb7('0x39')](_0x41991f['id'][_0x0fb7('0x3b')](),_0x5a6b5f)[_0x0fb7('0x39')](_0x0fb7('0x3a'),'createdAt')['field'](_0x0fb7('0x3a'),_0x0fb7('0x37'))[_0x0fb7('0x3c')]('cm_contacts')['where'](_0x0fb7('0x3d'))[_0x0fb7('0x3e')]('ListId\x20=\x20?',LISTID[_0x0fb7('0x3b')]())[_0x0fb7('0x3e')](_0x0fb7('0x3f'))[_0x0fb7('0x3e')](_0x0fb7('0x40'),squel[_0x0fb7('0x38')]()[_0x0fb7('0x39')]('phone')[_0x0fb7('0x3c')]('cm_hopper')['where'](_0x5a6b5f+_0x0fb7('0x41'),_0x41991f['id'][_0x0fb7('0x3b')]())))[_0x0fb7('0x3b')]();return _0x19ad1e;};var _0x29867b=function(_0x3acba6,_0x52f930){var _0x5284cb=squel[_0x0fb7('0x31')]()[_0x0fb7('0x32')](_0x0fb7('0x42'))[_0x0fb7('0x33')](['phone',_0x0fb7('0x35'),'ContactId',_0x0fb7('0x26'),_0x52f930,_0x0fb7('0x43'),_0x0fb7('0x37')],squel[_0x0fb7('0x38')]()[_0x0fb7('0x39')](_0x0fb7('0x34'),_0x0fb7('0x34'))['field'](_0x0fb7('0x3a'),'scheduledAt')[_0x0fb7('0x39')]('id',_0x0fb7('0x36'))['field'](LISTID[_0x0fb7('0x3b')](),_0x0fb7('0x26'))[_0x0fb7('0x39')](_0x3acba6['id'][_0x0fb7('0x3b')](),_0x52f930)[_0x0fb7('0x39')](_0x0fb7('0x3a'),_0x0fb7('0x43'))[_0x0fb7('0x39')]('NOW()',_0x0fb7('0x37'))[_0x0fb7('0x3c')](_0x0fb7('0x44'))[_0x0fb7('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0fb7('0x3e')]('ListId\x20=\x20?',LISTID['toString']())[_0x0fb7('0x3e')]('id\x20IN\x20?',squel[_0x0fb7('0x45')](hopperContacts))['where'](_0x0fb7('0x3f'))[_0x0fb7('0x3e')](_0x0fb7('0x40'),squel[_0x0fb7('0x38')]()[_0x0fb7('0x39')]('calleridnum')[_0x0fb7('0x3c')](_0x0fb7('0x46'))['where'](_0x52f930+_0x0fb7('0x41'),_0x3acba6['id']['toString']()))[_0x0fb7('0x3e')](_0x0fb7('0x40'),squel[_0x0fb7('0x38')]()[_0x0fb7('0x39')](_0x0fb7('0x34'))[_0x0fb7('0x3c')]('cm_hopper')[_0x0fb7('0x3e')](_0x52f930+_0x0fb7('0x41'),_0x3acba6['id'][_0x0fb7('0x3b')]())))[_0x0fb7('0x3b')]();return _0x5284cb;};function _0x312219(_0x202565,_0x372031){var _0x1c50bd=squel[_0x0fb7('0x31')]()[_0x0fb7('0x32')](_0x0fb7('0x42'))['fromQuery']([_0x0fb7('0x34'),'scheduledAt',_0x0fb7('0x36'),_0x0fb7('0x26'),_0x372031,_0x0fb7('0x43'),_0x0fb7('0x37')],squel['select']()['field'](_0x0fb7('0x34'),_0x0fb7('0x34'))['field'](_0x0fb7('0x3a'),'scheduledAt')[_0x0fb7('0x39')]('id',_0x0fb7('0x36'))[_0x0fb7('0x39')](LISTID['toString'](),_0x0fb7('0x26'))[_0x0fb7('0x39')](_0x202565['id'][_0x0fb7('0x3b')](),_0x372031)[_0x0fb7('0x39')](_0x0fb7('0x3a'),_0x0fb7('0x43'))[_0x0fb7('0x39')](_0x0fb7('0x3a'),_0x0fb7('0x37'))['from'](_0x0fb7('0x44'))['where'](_0x0fb7('0x3d'))[_0x0fb7('0x3e')](_0x0fb7('0x47'),LISTID[_0x0fb7('0x3b')]())[_0x0fb7('0x3e')](_0x0fb7('0x48'),squel['str'](hopperContacts))[_0x0fb7('0x3e')](_0x0fb7('0x3f')))[_0x0fb7('0x3b')]();return _0x1c50bd;}function _0x48823a(_0x5e190d,_0x480245){var _0x9b246c=squel['insert']()[_0x0fb7('0x32')](_0x0fb7('0x49'))[_0x0fb7('0x33')](['phone','ContactId',_0x0fb7('0x26'),_0x480245,'createdAt',_0x0fb7('0x37')],squel[_0x0fb7('0x38')]()[_0x0fb7('0x39')]('phone',_0x0fb7('0x34'))[_0x0fb7('0x39')]('id',_0x0fb7('0x36'))['field'](LISTID[_0x0fb7('0x3b')](),_0x0fb7('0x26'))['field'](_0x5e190d['id'][_0x0fb7('0x3b')](),_0x480245)[_0x0fb7('0x39')](_0x0fb7('0x3a'),_0x0fb7('0x43'))['field'](_0x0fb7('0x3a'),'updatedAt')['from'](_0x0fb7('0x44'))['where'](_0x0fb7('0x3d'))['where'](_0x0fb7('0x47'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x0fb7('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0fb7('0x3b')]();return _0x9b246c;}return db[_0x0fb7('0x4a')][_0x0fb7('0x4b')]({'where':{'type':_0x0fb7('0x4c')},'attributes':['id',_0x0fb7('0x4d')],'include':[{'model':db[_0x0fb7('0x4e')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x1abe86){var _0x2b9bfb=[];if(_0x1abe86){var _0x2991d0;for(var _0x47fb6a=0x0,_0x205c08;_0x47fb6a<_0x1abe86[_0x0fb7('0x19')];_0x47fb6a+=0x1){_0x205c08=_0x1abe86[_0x47fb6a][_0x0fb7('0x4f')]({'plain':!![]});switch(_0x205c08[_0x0fb7('0x4d')]){case _0x0fb7('0x50'):_0x2b9bfb[_0x0fb7('0x2c')](db[_0x0fb7('0x51')][_0x0fb7('0x52')](_0x29867b(_0x205c08,_0x0fb7('0x53')))[_0x0fb7('0x54')](function(){})[_0x0fb7('0x2d')](_0x4688e0()));break;case _0x0fb7('0x55'):_0x2b9bfb[_0x0fb7('0x2c')](db[_0x0fb7('0x51')][_0x0fb7('0x52')](_0x5efab6(_0x205c08,'VoiceQueueId'))[_0x0fb7('0x54')](function(){})[_0x0fb7('0x2d')](_0x4688e0()));break;default:_0x2b9bfb[_0x0fb7('0x2c')](db[_0x0fb7('0x51')]['query'](_0x312219(_0x205c08,_0x0fb7('0x53')))['then'](function(){})['catch'](_0x4688e0()));}}}return _0x2b9bfb;})[_0x0fb7('0x56')]()[_0x0fb7('0x54')](function(){return db[_0x0fb7('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x0fb7('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x5ef42e){var _0x59b2d5=[];if(_0x5ef42e){var _0x2769a6;for(var _0x306df8=0x0,_0xc67937;_0x306df8<_0x5ef42e['length'];_0x306df8+=0x1){_0xc67937=_0x5ef42e[_0x306df8][_0x0fb7('0x4f')]({'plain':!![]});_0x59b2d5[_0x0fb7('0x2c')](db[_0x0fb7('0x51')][_0x0fb7('0x52')](_0x48823a(_0xc67937,'VoiceQueueId'))[_0x0fb7('0x54')](function(){})[_0x0fb7('0x2d')](_0x4688e0()));}}return _0x59b2d5;})['all']();})[_0x0fb7('0x54')](function(){return db[_0x0fb7('0x57')][_0x0fb7('0x4b')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x0fb7('0x4e')],'as':_0x0fb7('0x58'),'where':{'id':LISTID}}]})[_0x0fb7('0x54')](function(_0x29bdaa){var _0xbaf48a=[];if(_0x29bdaa){for(var _0x377656=0x0,_0x5e84dc;_0x377656<_0x29bdaa['length'];_0x377656+=0x1){_0x5e84dc=_0x29bdaa[_0x377656][_0x0fb7('0x4f')]({'plain':!![]});switch(_0x5e84dc[_0x0fb7('0x4d')]){case _0x0fb7('0x50'):_0xbaf48a[_0x0fb7('0x2c')](db[_0x0fb7('0x51')][_0x0fb7('0x52')](_0x29867b(_0x5e84dc,_0x0fb7('0x59')))[_0x0fb7('0x54')](function(){})[_0x0fb7('0x2d')](_0x4688e0()));break;case _0x0fb7('0x55'):_0xbaf48a[_0x0fb7('0x2c')](db[_0x0fb7('0x51')][_0x0fb7('0x52')](_0x5efab6(_0x5e84dc,_0x0fb7('0x59')))[_0x0fb7('0x54')](function(){})['catch'](_0x4688e0()));break;default:_0xbaf48a[_0x0fb7('0x2c')](db[_0x0fb7('0x51')][_0x0fb7('0x52')](_0x312219(_0x5e84dc,_0x0fb7('0x59')))[_0x0fb7('0x54')](function(){})['catch'](_0x4688e0()));}}}return _0xbaf48a;})['all']();})[_0x0fb7('0x54')](function(){return db[_0x0fb7('0x57')][_0x0fb7('0x4b')]({'attributes':['id'],'include':[{'model':db[_0x0fb7('0x4e')],'as':_0x0fb7('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x559cb3){var _0x44c6c6=[];if(_0x559cb3){for(var _0x317511=0x0,_0x380812;_0x317511<_0x559cb3[_0x0fb7('0x19')];_0x317511+=0x1){_0x380812=_0x559cb3[_0x317511][_0x0fb7('0x4f')]({'plain':!![]});_0x44c6c6[_0x0fb7('0x2c')](db['sequelize'][_0x0fb7('0x52')](_0x48823a(_0x380812,_0x0fb7('0x59')))[_0x0fb7('0x54')](function(){})[_0x0fb7('0x2d')](_0x4688e0()));}}return _0x44c6c6;})[_0x0fb7('0x56')]();})[_0x0fb7('0x2d')](function(_0x39cdd3){logger[_0x0fb7('0x13')](_0x0fb7('0x5b'),_0x0fb7('0x5c'),_0x39cdd3[_0x0fb7('0x5d')]);});}var processPromises=function(_0x165c81){return BPromise[_0x0fb7('0x56')](promises)[_0x0fb7('0x54')](function(_0x22d674){})[_0x0fb7('0x2d')](function(_0xc2a116){logger[_0x0fb7('0x13')](_0x0fb7('0x5e'),JSON['stringify'](_0xc2a116));})[_0x0fb7('0x5f')](function(){socket[_0x0fb7('0x60')](_0x0fb7('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x165c81){return _0x165c81[_0x0fb7('0x62')]();}});};var endCsv=function(){return BPromise[_0x0fb7('0x63')]()[_0x0fb7('0x54')](function(){if(hopperContacts){return checkHopper();}})[_0x0fb7('0x54')](function(){socket[_0x0fb7('0x60')](_0x0fb7('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0fb7('0x64')](FILEPATH);}catch(_0x4c0b17){logger[_0x0fb7('0x13')](_0x0fb7('0x65'),JSON['stringify'](_0x4c0b17));}finally{process[_0x0fb7('0x66')](0x0);}});};process['on']('SIGINT',function(){logger[_0x0fb7('0x67')](_0x0fb7('0x68'));endCsv();});function main(){return BPromise[_0x0fb7('0x63')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0fb7('0x12')](',');return db[_0x0fb7('0x69')][_0x0fb7('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0fb7('0x54')](function(_0x13910f){var _0x302c3b=fs[_0x0fb7('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0fb7('0x6b')](_0x302c3b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x503bdf,_0x3b531e){total+=0x1;var _0x2c292b=total;promises['push'](checkRow(_0x503bdf,_0x13910f,_0x2c292b)[_0x0fb7('0x54')](function(){success+=0x1;})[_0x0fb7('0x2d')](function(_0x2adbc2){if(_0x2adbc2['error']){errors+=0x1;delete _0x2adbc2[_0x0fb7('0x13')];}else if(_0x2adbc2[_0x0fb7('0x29')]){duplicates+=0x1;delete _0x2adbc2[_0x0fb7('0x29')];}rows[_0x0fb7('0x2c')](_0x2adbc2);}));if(total%0xc8===0x0){_0x3b531e[_0x0fb7('0x6c')]();return processPromises(_0x3b531e);}},'complete':function(){return processPromises()[_0x0fb7('0x54')](function(){logger[_0x0fb7('0x67')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x36a82f,_0xcde92e){logger[_0x0fb7('0x67')]('CSV\x20parse\x20error',JSON[_0x0fb7('0x2f')](_0x36a82f));endCsv();}});})['catch'](function(_0x4c2731){logger[_0x0fb7('0x13')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0fb7('0x2f')](_0x4c2731));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b82a968..37bc1ab 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 _0x9931=['main','send','start','binding','root','server/files/tmp','.csv','header','name','_description','parse','createReadStream','data','rows','find','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','trim','itemTypeId','appendFileSync','emit','Abort\x20parser','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','split','all','length','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.ListId','cm_contacts.updatedAt','insert','cm_hopper_black','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','code','message','sequelize','spread','catch','error','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists.CmListId=','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','query','timezones','dialTimezone','utcOffset','set','offset'];(function(_0x2a320d,_0x1ec6d2){var _0x311fc3=function(_0xc4cfee){while(--_0xc4cfee){_0x2a320d['push'](_0x2a320d['shift']());}};_0x311fc3(++_0x1ec6d2);}(_0x9931,0x1b6));var _0x1993=function(_0x2489e6,_0x20700f){_0x2489e6=_0x2489e6-0x0;var _0x567890=_0x9931[_0x2489e6];return _0x567890;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x1993('0x0'));var Papa=require('papaparse');var util=require(_0x1993('0x1'));var BPromise=require(_0x1993('0x2'));var moment=require(_0x1993('0x3'));var squel=require(_0x1993('0x4'));var Redis=require(_0x1993('0x5'));var db=require(_0x1993('0x6'))['db'];var config=require(_0x1993('0x7'));var shared=require(_0x1993('0x8'));var logger=require(_0x1993('0x9'))(_0x1993('0xa'));config[_0x1993('0xb')]=_[_0x1993('0xc')](config[_0x1993('0xb')],{'host':_0x1993('0xd'),'port':0x18eb});var socket=require(_0x1993('0xe'))(new Redis(config[_0x1993('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x1993('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x1993('0x10'));function isEmail(_0x38468b){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))*$/[_0x1993('0x11')](_0x38468b);}function selectNotIn(_0x372c71,_0x4179f4,_0x1b7419,_0x1b0480,_0x473d84){return squel[_0x1993('0x12')]()[_0x1993('0x13')](_0x1993('0x14'))[_0x1993('0x15')](_0x1b0480)['join'](_0x4179f4,null,_0x4179f4+'.id\x20=\x20'+_0x1b0480+'.'+_0x1b7419)[_0x1993('0x16')](_0x1b0480+'.'+_0x1b7419+_0x1993('0x17')+_0x372c71+'.'+_0x1b7419)[_0x1993('0x16')](_0x4179f4+_0x1993('0x18')+_0x473d84['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3d55e5,_0x283515){promisesAdditionalPhones=[];return db[_0x1993('0x19')][_0x1993('0x1a')]({'raw':!![],'attributes':['id',_0x1993('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x1993('0x1c')](function(_0x9c0ac5){if(_0x9c0ac5!==null){var _0x48ddac=[];for(var _0xadc21=0x0;_0xadc21<_0x9c0ac5['length'];_0xadc21++){var _0x25e878=_0x9c0ac5[_0xadc21];_0x48ddac[_0x1993('0x1d')](insertAdditionalPhones(_0x25e878));}}Promise['all'](_0x48ddac)[_0x1993('0x1c')](function(){_0x3d55e5({'val':0x1});});});});}function insertAdditionalPhones(_0x230f8a){return new Promise(function(_0x2b7455,_0x507a6b){var _0x17a94f=_0x230f8a[_0x1993('0x1b')];var _0x4ee5b7=_0x17a94f[_0x1993('0x1e')](';');var _0x13e96d=[];orderBy=0x0;for(var _0x404b8f=0x0;_0x404b8f<_0x4ee5b7['length'];_0x404b8f++){_0x13e96d[_0x1993('0x1d')](splitAdditionalPhone(_0x230f8a['id'],_0x4ee5b7[_0x404b8f]));}Promise[_0x1993('0x1f')](_0x13e96d)[_0x1993('0x1c')](function(){_0x2b7455({'val':_0x4ee5b7[_0x1993('0x20')]});});});}function splitAdditionalPhone(_0x4eca98,_0x460c03){return new Promise(function(_0x13063d,_0x9b2a2a){var _0x3ce344=_0x460c03[_0x1993('0x1e')](':');var _0xb27d2e=_0x3ce344[0x0];var _0x169b52=_0x3ce344[0x1];if(!_[_0x1993('0x21')](_0x169b52)){var _0x473599=_0x169b52[_0x1993('0x1e')]('|');var _0x3a25ef=[];for(var _0x50e8d4=0x0;_0x50e8d4<_0x473599['length'];_0x50e8d4++){if(_0x473599[_0x50e8d4]!==''){var _0x130ffa=_[_0x1993('0x22')](promisesAdditionalPhones,{'contactId':_0x4eca98,'phone':_0x473599[_0x50e8d4]});if(_0x130ffa['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4eca98,'contactTypeId':_0xb27d2e,'phone':_0x473599[_0x50e8d4],'orderBy':orderBy});}}}_0x13063d({'ok':0x1});}else _0x13063d({'res':0x0});});}function createAdditionalPhone(_0x317bbc,_0x3bd970,_0x31baaa,_0x6ef2b8){var _0x1ee545='';var _0x472773='';var _0x4a8b57=_0x31baaa['split']('§');_0x1ee545=_0x4a8b57[0x0];if(_0x4a8b57[_0x1993('0x20')]==0x2)_0x472773=_0x4a8b57[0x1];return new Promise(function(_0x294469,_0x13da72){return db[_0x1993('0x23')][_0x1993('0x24')]({'where':{'CmContactId':_0x317bbc,'item':_0x1ee545}})[_0x1993('0x1c')](function(_0x3fb166){if(_0x3fb166){return db[_0x1993('0x23')][_0x1993('0x25')]({'ItemTypeId':_0x3bd970,'description':_0x472773,'OrderBy':_0x6ef2b8},{'where':{'CmContactId':_0x317bbc,'item':_0x1ee545}})[_0x1993('0x1c')](function(_0x51ee82){_0x294469({'res':_0x1993('0x26')});});}else{return db[_0x1993('0x23')][_0x1993('0x27')]({'CmContactId':_0x317bbc,'item':_0x1ee545,'description':_0x472773,'ItemTypeId':_0x3bd970,'OrderBy':_0x6ef2b8,'ItemClass':_0x1993('0x28')})['then'](function(_0x54b6ae){_0x294469({'res':_0x1993('0x29')});});}});});}function insertCmHopper(_0x208e79,_0x3ceadb,_0x149dca,_0x2e6c9d,_0x54f051){var _0x5e3610=['cm_contacts.phone',_0x1993('0x2a'),_0x1993('0x2b'),'cm_contacts.ListId',_0x3ceadb+'.'+_0x2e6c9d,_0x1993('0x2c'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x54f051+'\x22'];return squel['insert']()[_0x1993('0x2d')](_0x1993('0x2e'))[_0x1993('0x2f')]([_0x1993('0x14'),_0x1993('0x30'),_0x1993('0x31'),_0x1993('0x32'),_0x2e6c9d,_0x1993('0x33'),_0x1993('0x34'),_0x1993('0x35'),_0x1993('0x36'),_0x1993('0x37')],squel[_0x1993('0x12')]()[_0x1993('0x38')](_0x5e3610)[_0x1993('0x15')](_0x3ceadb)[_0x1993('0x39')](_0x1993('0x3a'),null,_0x1993('0x3b')+_0x3ceadb+_0x1993('0x3c'))[_0x1993('0x39')](_0x149dca,null,_0x149dca+_0x1993('0x3d')+_0x3ceadb+'.'+_0x2e6c9d)[_0x1993('0x16')](_0x3ceadb+'.CmListId\x20=\x20?',_0x208e79)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x1993('0x3e'),selectNotIn(_0x3ceadb,_0x149dca,_0x2e6c9d,_0x1993('0x2e'),[_0x1993('0x3f'),_0x1993('0x40')]))[_0x1993('0x16')](_0x1993('0x3e'),selectNotIn(_0x3ceadb,_0x149dca,_0x2e6c9d,_0x1993('0x2e'),[_0x1993('0x3f')])))['toString']();}function insertCmHopperBlack(_0x8ef296,_0x47ff7a,_0x4138e2,_0x12278c){var _0x2aa11d=[_0x1993('0x41'),'cm_contacts.id',_0x1993('0x42'),_0x47ff7a+'.'+_0x12278c,_0x1993('0x2c'),_0x1993('0x43')];return squel[_0x1993('0x44')]()[_0x1993('0x2d')](_0x1993('0x45'))['fromQuery']([_0x1993('0x14'),_0x1993('0x31'),_0x1993('0x32'),_0x12278c,'createdAt',_0x1993('0x34')],squel[_0x1993('0x12')]()['fields'](_0x2aa11d)[_0x1993('0x15')](_0x47ff7a)[_0x1993('0x39')](_0x1993('0x3a'),null,_0x1993('0x3b')+_0x47ff7a+_0x1993('0x3c'))[_0x1993('0x39')](_0x4138e2,null,_0x4138e2+_0x1993('0x3d')+_0x47ff7a+'.'+_0x12278c)[_0x1993('0x16')](_0x47ff7a+_0x1993('0x46'),_0x8ef296)[_0x1993('0x16')](_0x1993('0x47'),NOW)[_0x1993('0x16')](_0x1993('0x3e'),squel[_0x1993('0x12')]()[_0x1993('0x13')](_0x1993('0x14'))[_0x1993('0x15')](_0x1993('0x45'))[_0x1993('0x16')]('ListId\x20=\x20?',_0x8ef296)[_0x1993('0x16')](_0x12278c+_0x1993('0x17')+_0x47ff7a+'.'+_0x12278c)))[_0x1993('0x48')]();}function insertTzCmHopper(_0x51a054,_0x7b4dd8,_0x39d88b,_0x5c921f,_0x2ca3e8,_0x1200e){var _0x688a39=[_0x1993('0x41'),_0x1993('0x49')+_0x1200e+_0x1993('0x4a'),_0x1993('0x2b'),'cm_contacts.ListId',_0x7b4dd8+'.'+_0x5c921f,_0x1993('0x2c'),_0x1993('0x43'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x2ca3e8+'\x22'];var _0x37d0c3=squel[_0x1993('0x44')]()[_0x1993('0x2d')]('cm_hopper')[_0x1993('0x2f')](['phone','scheduledat',_0x1993('0x31'),_0x1993('0x32'),_0x5c921f,_0x1993('0x33'),_0x1993('0x34'),_0x1993('0x35'),_0x1993('0x36'),_0x1993('0x37')],squel[_0x1993('0x12')]()[_0x1993('0x38')](_0x688a39)[_0x1993('0x15')](_0x7b4dd8)[_0x1993('0x39')](_0x1993('0x3a'),null,_0x1993('0x3b')+_0x7b4dd8+'.CmListId')['join'](_0x39d88b,null,_0x39d88b+_0x1993('0x3d')+_0x7b4dd8+'.'+_0x5c921f)[_0x1993('0x39')](_0x1200e,null,_0x1200e+_0x1993('0x3d')+_0x7b4dd8+'.'+_0x5c921f)['where'](_0x7b4dd8+'.CmListId\x20=\x20?',_0x51a054)[_0x1993('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1993('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x7b4dd8,_0x39d88b,_0x5c921f,_0x1993('0x2e'),[_0x1993('0x3f'),_0x1993('0x40')]))[_0x1993('0x16')](_0x1993('0x3e'),selectNotIn(_0x7b4dd8,_0x39d88b,_0x5c921f,_0x1993('0x2e'),[_0x1993('0x3f')])))[_0x1993('0x48')]();return _0x37d0c3;}function insertTzCmHopperBlack(_0x1c847d,_0x2ad40b,_0x243b3d,_0x443bdf){var _0x1d7b55=[_0x1993('0x41'),_0x1993('0x2b'),_0x1993('0x42'),_0x2ad40b+'.'+_0x443bdf,_0x1993('0x2c'),_0x1993('0x43')];return squel[_0x1993('0x44')]()[_0x1993('0x2d')](_0x1993('0x45'))[_0x1993('0x2f')]([_0x1993('0x14'),_0x1993('0x31'),_0x1993('0x32'),_0x443bdf,_0x1993('0x33'),_0x1993('0x34')],squel[_0x1993('0x12')]()[_0x1993('0x38')](_0x1d7b55)[_0x1993('0x15')](_0x2ad40b)[_0x1993('0x39')](_0x1993('0x3a'),null,'cm_contacts.ListId\x20=\x20'+_0x2ad40b+_0x1993('0x3c'))[_0x1993('0x39')](_0x243b3d,null,_0x243b3d+_0x1993('0x3d')+_0x2ad40b+'.'+_0x443bdf)[_0x1993('0x16')](_0x2ad40b+'.CmListId\x20=\x20?',_0x1c847d)[_0x1993('0x16')](_0x1993('0x47'),NOW)[_0x1993('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x1993('0x12')]()[_0x1993('0x13')](_0x1993('0x14'))[_0x1993('0x15')](_0x1993('0x45'))['where']('ListId\x20=\x20?',_0x1c847d)[_0x1993('0x16')](_0x443bdf+_0x1993('0x17')+_0x2ad40b+'.'+_0x443bdf)))[_0x1993('0x48')]();}function insertCmHopperAdditionalPhones(_0x486052){var _0x48123c=[_0x1993('0x4b'),_0x1993('0x4c'),_0x1993('0x4d'),'cm_contact_has_items.createdAt',_0x1993('0x4e')];return squel[_0x1993('0x44')]()[_0x1993('0x2d')](_0x1993('0x4f'))[_0x1993('0x2f')]([_0x1993('0x50'),_0x1993('0x14'),_0x1993('0x51'),_0x1993('0x33'),_0x1993('0x34')],squel['select']()['fields'](_0x48123c)[_0x1993('0x15')](_0x1993('0x2e'))['join']('cm_contacts',null,_0x1993('0x52'))['join'](_0x1993('0x53'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x1993('0x54'),_0x486052)[_0x1993('0x16')](_0x1993('0x47'),NOW))[_0x1993('0x48')]();}function insertCmContact(_0x18e205,_0x58ccba,_0x5f55e6,_0x3aaf15){var _0x5051e0=_[_0x1993('0x55')](_[_0x1993('0x56')](_0x3aaf15),[_0x1993('0x32'),_0x1993('0x57'),_0x1993('0x33'),'updatedAt']);return squel[_0x1993('0x44')]()['into'](_0x1993('0x3a'))[_0x1993('0x2f')](_0x5051e0,squel[_0x1993('0x12')]()[_0x1993('0x38')](_0x5051e0)['from'](_0x58ccba)[_0x1993('0x16')]('('+_0x5f55e6[_0x1993('0x39')](',')+_0x1993('0x58'),squel[_0x1993('0x12')]()[_0x1993('0x38')](_0x5f55e6)[_0x1993('0x15')](_0x1993('0x3a'))[_0x1993('0x16')](_0x1993('0x59'),_0x18e205)[_0x1993('0x16')]('deletedAt\x20IS\x20NULL'))['where'](_0x1993('0x5a'),squel[_0x1993('0x12')]()['field'](_0x1993('0x5b'),_0x1993('0x5c'))[_0x1993('0x15')](_0x58ccba)[_0x1993('0x5d')](_0x5f55e6[_0x1993('0x39')](','))))[_0x1993('0x48')]();}function handleStop(){logger[_0x1993('0x5e')](_0x1993('0x5f'));stopped=!![];}function handleUncaughtException(_0x3a24cd){logger['error'](_0x3a24cd['message']);process[_0x1993('0x60')](0x1);}function handleError(_0x4a6481,_0x25eb36){stats[_0x1993('0x61')][_0x1993('0x1d')]({'name':_0x25eb36[_0x1993('0x62')],'message':_0x25eb36[_0x1993('0x63')],'row':_0x4a6481});}function handleQuery(_0x4096ba){logger['info'](_0x4096ba);return db[_0x1993('0x64')]['query'](_0x4096ba)[_0x1993('0x65')](function(_0x40048b){results[_0x1993('0x1d')](_0x40048b);})[_0x1993('0x66')](function(_0x30b3f3){logger[_0x1993('0x67')](_0x30b3f3[_0x1993('0x63')]);});}function updateTzCampaigns(_0x4eb178){return new Promise(function(_0x450843,_0x551525){var _0x794aee=squel[_0x1993('0x12')]()['fields'](['campaigns.id',_0x1993('0x68')])[_0x1993('0x15')](_0x1993('0x69'))[_0x1993('0x39')]('campaigns_has_cm_lists',null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x1993('0x16')](_0x1993('0x6a')+_0x4eb178);db[_0x1993('0x64')]['query'](_0x794aee['toString']())[_0x1993('0x65')](function(_0x2b463d){var _0x4f16f1=[];for(var _0x15a8df=0x0;_0x15a8df<_0x2b463d['length'];_0x15a8df++){_0x4f16f1[_0x1993('0x1d')](getTimezoneData(_0x2b463d[_0x15a8df],tmp_campaigns));}BPromise[_0x1993('0x1f')](_0x4f16f1)['then'](function(){_0x450843({'val':0x1});});})[_0x1993('0x66')](function(_0x3bbc45){logger[_0x1993('0x67')](_0x3bbc45[_0x1993('0x63')]);_0x450843({'val':0x0});});});}function updateTzVoiceQueues(_0x3db400){return new Promise(function(_0x4bc110,_0x325bb3){var _0x1e7524=squel[_0x1993('0x12')]()['fields'](['voice_queues.id','voice_queues.dialTimezone'])[_0x1993('0x15')](_0x1993('0x6b'))['join'](_0x1993('0x6c'),null,_0x1993('0x6d'))[_0x1993('0x16')](_0x1993('0x6e')+_0x3db400);db[_0x1993('0x64')][_0x1993('0x6f')](_0x1e7524[_0x1993('0x48')]())[_0x1993('0x65')](function(_0x3df564){var _0x296bdb=[];for(var _0x182238=0x0;_0x182238<_0x3df564[_0x1993('0x20')];_0x182238++){_0x296bdb[_0x1993('0x1d')](getTimezoneData(_0x3df564[_0x182238],tmp_voice_queues));}BPromise[_0x1993('0x1f')](_0x296bdb)[_0x1993('0x1c')](function(){_0x4bc110({'val':0x1});});})['catch'](function(_0x53d2eb){logger[_0x1993('0x67')](_0x53d2eb[_0x1993('0x63')]);_0x4bc110({'val':0x0});});});}function getTimezoneData(_0x3f9ef7,_0x17545b){return new Promise(function(_0x338beb,_0x4ed3b1){var _0x401ae2=shared[_0x1993('0x70')];var _0x357ba0=_0x401ae2[_0x3f9ef7[_0x1993('0x71')]];if(_[_0x1993('0x21')](_0x357ba0)){_0x338beb({'ret':0x1});}else{var _0x4a6be7=_0x357ba0[_0x1993('0x72')];var _0x47932c=squel[_0x1993('0x44')]()[_0x1993('0x2d')](_0x17545b)[_0x1993('0x73')]('id',_0x3f9ef7['id'])['set'](_0x1993('0x74'),_0x4a6be7)[_0x1993('0x73')](_0x1993('0x71'),_0x3f9ef7[_0x1993('0x71')])[_0x1993('0x48')]();return db[_0x1993('0x64')][_0x1993('0x6f')](_0x47932c)[_0x1993('0x65')](function(_0x699aa1){_0x338beb({'ret':0x1});})[_0x1993('0x66')](function(_0x2b95ac){logger[_0x1993('0x67')](_0x2b95ac[_0x1993('0x63')]);_0x4ed3b1({'ret':0x1});});}});}function handleTZQuery(_0x1725d3){logger[_0x1993('0x5e')](_0x1725d3);return db['sequelize'][_0x1993('0x6f')](_0x1725d3)['spread'](function(_0x381b2d){})['catch'](function(_0x1a8680){logger['error'](_0x1a8680['message']);});}function main(_0x26773e,_0x44bb22,_0x2521e2,_0xe635da){logger[_0x1993('0x5e')](_0x1993('0x75'),_0x26773e,JSON['stringify'](_0x44bb22));process[_0x1993('0x76')](_0x1993('0x77'));var _0x13e006=_0x44bb22[_0x1993('0x78')];var _0x50b8e9=_['clone'](_0x13e006);var _0x4afc77=_0x44bb22['socket_timestamp'];var _0x250a92=path['join'](config[_0x1993('0x79')],_0x1993('0x7a'),_0x4afc77+_0x1993('0x7b'));hasTZ=_[_0x1993('0x56')](_0x13e006)['includes'](_0x1993('0x71'));var _0x4c4f87=_['keys'](_0x13e006)['join']();logger[_0x1993('0x5e')](_0x1993('0x7c'),_0x4c4f87);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x1993('0x7d')]})[_0x1993('0x1c')](function(_0x54f752){for(var _0x55643f=0x0;_0x55643f<_0x54f752[_0x1993('0x20')];_0x55643f++){if(_0x54f752[_0x55643f]['name']in _0x13e006){contactItemTypes[_0x1993('0x1d')](_0x54f752[_0x55643f]);delete _0x50b8e9[_0x54f752[_0x55643f][_0x1993('0x7d')]];hasAdditionalPhones=!![];}for(var _0xf67a42 in _0x13e006){if(_0x54f752[_0x55643f]['name']+_0x1993('0x7e')===_0xf67a42){phoneDescriptions['push']({'itemTypeId':_0x54f752[_0x55643f]['id'],'description':_0xf67a42});delete _0x50b8e9[_0xf67a42];}}}if(hasAdditionalPhones)_0x50b8e9['AdditionalPhones']='';var _0x120116=_['keys'](_0x50b8e9)['join']();logger[_0x1993('0x5e')](_0x1993('0x7c'),_0x120116);fs['writeFileSync'](_0x250a92,_0x120116+'\x0a');Papa[_0x1993('0x7f')](fs[_0x1993('0x80')](_0x26773e),{'header':!![],'skipEmptyLines':!![],'step':function(_0xaf1fe6,_0x4da45f){try{for(var _0xe286a2=0x0,_0x30ffcf=[];_0xe286a2<_0xaf1fe6[_0x1993('0x81')]['length'];_0xe286a2++){stats[_0x1993('0x82')]+=0x1;if(_0xaf1fe6['errors'][_0xe286a2]){handleError(_0xaf1fe6[_0x1993('0x81')][_0xe286a2],_0xaf1fe6['errors'][_0xe286a2]);}else{var _0x23bc2e=[];var _0x2d66fe=[];var _0x541349={};for(var _0x242ccb in _0x13e006){let _0x3ddea7=contactItemTypes[_0x1993('0x83')](_0xeb98c9=>_0xeb98c9[_0x1993('0x7d')]===_0x242ccb);let _0x68c542=contactItemTypes[_0x1993('0x83')](_0x2aeb55=>_0x2aeb55[_0x1993('0x7d')]+_0x1993('0x7e')===_0x242ccb);if(_[_0x1993('0x21')](_0x3ddea7)&&_[_0x1993('0x21')](_0x68c542)){if(_0x13e006[_0x1993('0x84')](_0x242ccb)){if(_0xaf1fe6[_0x1993('0x81')][_0xe286a2][_0x13e006[_0x242ccb]]){var _0x1e7ebd=_['trim'](_0xaf1fe6[_0x1993('0x81')][_0xe286a2][_0x13e006[_0x242ccb]][_0x1993('0x85')](/"/g,'\x27'));switch(_0x242ccb){case _0x1993('0x30'):var _0x105553=moment(_0x1e7ebd,_0x1993('0x10'),!![]);if(_0x105553[_0x1993('0x86')]()){_0x30ffcf['push']('\x22'+_0x1e7ebd+'\x22');}else{_0x23bc2e[_0x1993('0x1d')](_0x1993('0x87'));}break;case _0x1993('0x35'):var _0x5a0d67=parseInt(_0x1e7ebd);_0x1e7ebd=_['isNaN'](_0x5a0d67)||_0x5a0d67<0x0||_0x5a0d67>0x4?_0xe635da?0x3:0x2:_0x5a0d67;_0x30ffcf[_0x1993('0x1d')]('\x22'+_0x1e7ebd+'\x22');break;case _0x1993('0x36'):var _0x43e22a=parseInt(_0x1e7ebd);if(_[_0x1993('0x88')](_0x43e22a)&&_[_0x1993('0x89')](_0x2521e2,_0x43e22a)){_0x30ffcf[_0x1993('0x1d')]('\x22'+_0x43e22a+'\x22');}else{_0x23bc2e['push'](_0x1993('0x8a'));}break;case _0x1993('0x8b'):if(isEmail(_0x1e7ebd)){_0x30ffcf[_0x1993('0x1d')]('\x22'+_0x1e7ebd+'\x22');}else{_0x23bc2e[_0x1993('0x1d')](_0x1993('0x8c'));}break;case _0x1993('0x8d'):var _0x6bed08=moment(_0x1e7ebd,_0x1993('0x8e'),!![]);if(_0x6bed08['isValid']()){_0x30ffcf[_0x1993('0x1d')]('\x22'+_0x1e7ebd+'\x22');}else{_0x23bc2e['push'](_0x1993('0x8f'));}break;case'dialTimezone':var _0x594b10=shared[_0x1993('0x70')];var _0x215b85=_0x594b10[_0x1e7ebd];if(!_[_0x1993('0x21')](_0x215b85)){var _0x41c420=_0x215b85[_0x1993('0x72')];_0x30ffcf[_0x1993('0x1d')]('\x22'+_0x1e7ebd+'\x22');_0x30ffcf[_0x1993('0x1d')]('\x22'+_0x41c420+'\x22');}break;default:_0x30ffcf['push']('\x22'+_0x1e7ebd+'\x22');}}else{switch(_0x242ccb){case'firstName':case _0x1993('0x14'):_0x23bc2e['push'](_0x242ccb+_0x1993('0x90'));break;default:_0x30ffcf[_0x1993('0x1d')]('\x22\x22');}}}}else{var _0x113b96='';if(!_[_0x1993('0x21')](_0x3ddea7)){if(!_0x541349[_0x1993('0x84')](_0x3ddea7['id'])){if(!_[_0x1993('0x21')](_0xaf1fe6['data'][_0xe286a2][_0x13e006[_0x242ccb]])){var _0x1e7ebd=_[_0x1993('0x91')](_0xaf1fe6['data'][_0xe286a2][_0x13e006[_0x242ccb]][_0x1993('0x85')](/"/g,'\x27'));var _0x2a8e66=phoneDescriptions[_0x1993('0x83')](_0x3e2802=>_0x3e2802[_0x1993('0x92')]===_0x3ddea7['id']);if(!_[_0x1993('0x21')](_0x2a8e66)){var _0x3451e3=_[_0x1993('0x91')](_0xaf1fe6['data'][_0xe286a2][_0x13e006[_0x2a8e66['description']]][_0x1993('0x85')](/"/g,'\x27'));if(!_[_0x1993('0x21')](_0x3451e3))_0x1e7ebd=_0x1e7ebd+'§'+_0x3451e3;}if(_0x113b96=='')_0x113b96=_0x1e7ebd;else _0x113b96+='|'+_0x1e7ebd;}_0x2d66fe['push'](_0x3ddea7['id']+':'+_0x113b96);_0x541349[_0x3ddea7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x30ffcf[_0x1993('0x1d')]('\x22'+_0x2d66fe[_0x1993('0x39')](';')+'\x22');}if(_0x23bc2e[_0x1993('0x20')]){handleError(_0xaf1fe6['data'][_0xe286a2],{'code':'SystemRow','message':_0x23bc2e[_0x1993('0x39')]()});}else{fs[_0x1993('0x93')](_0x250a92,_0x30ffcf['join']()+'\x0a');}_0x30ffcf=[];}if(!(stats[_0x1993('0x82')]%0xc8)){socket[_0x1993('0x94')]('contact:import:'+_0x4afc77,stats);stats[_0x1993('0x61')]=[];}}if(stopped){logger['info'](_0x1993('0x95'));_0x4da45f['abort']();}}catch(_0xd60c58){handleError(_0xaf1fe6[_0x1993('0x81')][_0xe286a2],{'code':_0x1993('0x96'),'message':_0xd60c58[_0x1993('0x63')]});logger[_0x1993('0x67')]('step',_0xd60c58[_0x1993('0x63')]);}},'complete':function(){try{var _0x1b0cfe=[];var _0x2e8174=[];var _0x404cc3=_0x1993('0x3a');if(_0x44bb22[_0x1993('0x97')]&&_0x44bb22[_0x1993('0x97')][_0x1993('0x20')]){_0x404cc3=_0x1993('0x98')+_0x4afc77;_0x1b0cfe['push'](_0x1993('0x99')+_0x404cc3+_0x1993('0x9a'));}tmp_campaigns=_0x1993('0x9b')+_0x4afc77;tmp_voice_queues=_0x1993('0x9c')+_0x4afc77;_0x2e8174['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x1993('0x9d'));_0x2e8174[_0x1993('0x1d')](_0x1993('0x99')+tmp_voice_queues+_0x1993('0x9d'));BPromise[_0x1993('0x9e')](_0x2e8174,handleTZQuery)[_0x1993('0x1c')](function(_0x494886){updateTzCampaigns(_0x44bb22[_0x1993('0x32')])[_0x1993('0x1c')](function(_0x3d598e){updateTzVoiceQueues(_0x44bb22[_0x1993('0x32')])['then'](function(_0x14fe96){if(hasTZ)_0x120116=_0x120116[_0x1993('0x85')](_0x1993('0x71'),_0x1993('0x9f'));var _0x594658=util[_0x1993('0xf')](_0x1993('0xa0'),_0x250a92,_0x404cc3,_0x120116,_0x44bb22[_0x1993('0x32')],_0x44bb22[_0x1993('0x57')]||null,NOW,NOW);if(_[_0x1993('0x21')](_0x13e006[_0x1993('0x30')])){_0x594658+=_0x1993('0xa1');}_0x1b0cfe[_0x1993('0x1d')](_0x594658);if(_0x44bb22[_0x1993('0x97')]&&_0x44bb22[_0x1993('0x97')][_0x1993('0x20')]){_0x1b0cfe['push'](insertCmContact(_0x44bb22['ListId'],_0x404cc3,_0x44bb22[_0x1993('0x97')],_0x13e006));_0x1b0cfe[_0x1993('0x1d')](_0x1993('0xa2')+_0x404cc3+';');}BPromise['each'](_0x1b0cfe,handleQuery)['then'](function(_0x3fd23e){BPromise[_0x1993('0x1f')]([handleAdditionalPhones()])[_0x1993('0x1c')](function(){_0x1b0cfe=[];for(var _0x4c1c72=0x0;_0x4c1c72\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','CmContact'];(function(_0x43ce19,_0x2ff884){var _0xa05553=function(_0x317019){while(--_0x317019){_0x43ce19['push'](_0x43ce19['shift']());}};_0xa05553(++_0x2ff884);}(_0x1815,0xa3));var _0x5181=function(_0x40cb9d,_0x1fb2ca){_0x40cb9d=_0x40cb9d-0x0;var _0x7c2743=_0x1815[_0x40cb9d];return _0x7c2743;};'use strict';var fs=require('fs');var path=require(_0x5181('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x5181('0x1'));var moment=require(_0x5181('0x2'));var squel=require('squel');var Redis=require(_0x5181('0x3'));var db=require(_0x5181('0x4'))['db'];var config=require('../../../config/environment');var shared=require(_0x5181('0x5'));var logger=require(_0x5181('0x6'))(_0x5181('0x7'));config[_0x5181('0x8')]=_[_0x5181('0x9')](config[_0x5181('0x8')],{'host':_0x5181('0xa'),'port':0x18eb});var socket=require(_0x5181('0xb'))(new Redis(config[_0x5181('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5181('0xc')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5181('0xc')](_0x5181('0xd'));function isEmail(_0x55dfc9){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x55dfc9);}function selectNotIn(_0x4f0373,_0x5327b9,_0x5562a1,_0x58daeb,_0x57c10d){return squel[_0x5181('0xe')]()[_0x5181('0xf')](_0x5181('0x10'))['from'](_0x58daeb)[_0x5181('0x11')](_0x5327b9,null,_0x5327b9+_0x5181('0x12')+_0x58daeb+'.'+_0x5562a1)[_0x5181('0x13')](_0x58daeb+'.'+_0x5562a1+_0x5181('0x14')+_0x4f0373+'.'+_0x5562a1)[_0x5181('0x13')](_0x5327b9+'.dialCheckDuplicateType\x20IN\x20('+_0x57c10d['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4895a5,_0x248729){promisesAdditionalPhones=[];return db[_0x5181('0x15')][_0x5181('0x16')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x5181('0x17')](function(_0x3b6411){if(_0x3b6411!==null){var _0x320753=[];for(var _0x4ce946=0x0;_0x4ce946<_0x3b6411['length'];_0x4ce946++){var _0xfc3e96=_0x3b6411[_0x4ce946];_0x320753['push'](insertAdditionalPhones(_0xfc3e96));}}Promise[_0x5181('0x18')](_0x320753)[_0x5181('0x17')](function(){_0x4895a5({'val':0x1});});});});}function insertAdditionalPhones(_0x44881e){return new Promise(function(_0x2a6b2c,_0x370df5){var _0x6da781=_0x44881e[_0x5181('0x19')];var _0x2b8ef3=_0x6da781[_0x5181('0x1a')](';');var _0x53b53a=[];orderBy=0x0;for(var _0x21fec4=0x0;_0x21fec4<_0x2b8ef3[_0x5181('0x1b')];_0x21fec4++){_0x53b53a[_0x5181('0x1c')](splitAdditionalPhone(_0x44881e['id'],_0x2b8ef3[_0x21fec4]));}Promise['all'](_0x53b53a)[_0x5181('0x17')](function(){_0x2a6b2c({'val':_0x2b8ef3[_0x5181('0x1b')]});});});}function splitAdditionalPhone(_0x5e3826,_0xbce2ae){return new Promise(function(_0x3ae340,_0x49d635){var _0x5dd764=_0xbce2ae['split'](':');var _0x10ae21=_0x5dd764[0x0];var _0x4e63c8=_0x5dd764[0x1];if(!_[_0x5181('0x1d')](_0x4e63c8)){var _0x58ea96=_0x4e63c8[_0x5181('0x1a')]('|');var _0x271e44=[];for(var _0x3fa884=0x0;_0x3fa884<_0x58ea96['length'];_0x3fa884++){if(_0x58ea96[_0x3fa884]!==''){var _0x1adb34=_[_0x5181('0x1e')](promisesAdditionalPhones,{'contactId':_0x5e3826,'phone':_0x58ea96[_0x3fa884]});if(_0x1adb34['length']==0x0){orderBy++;promisesAdditionalPhones[_0x5181('0x1c')]({'contactId':_0x5e3826,'contactTypeId':_0x10ae21,'phone':_0x58ea96[_0x3fa884],'orderBy':orderBy});}}}_0x3ae340({'ok':0x1});}else _0x3ae340({'res':0x0});});}function createAdditionalPhone(_0x36d4b9,_0x493e3d,_0x500836,_0xca2e7f){var _0x208e59='';var _0x3aef37='';var _0x79ded3=_0x500836[_0x5181('0x1a')]('§');_0x208e59=_0x79ded3[0x0];if(_0x79ded3[_0x5181('0x1b')]==0x2)_0x3aef37=_0x79ded3[0x1];return new Promise(function(_0x52cd3b,_0x3bef5b){return db[_0x5181('0x1f')][_0x5181('0x20')]({'where':{'CmContactId':_0x36d4b9,'item':_0x208e59}})[_0x5181('0x17')](function(_0x18ec84){if(_0x18ec84){return db['CmContactHasItem'][_0x5181('0x21')]({'ItemTypeId':_0x493e3d,'description':_0x3aef37,'OrderBy':_0xca2e7f},{'where':{'CmContactId':_0x36d4b9,'item':_0x208e59}})[_0x5181('0x17')](function(_0x42e31c){_0x52cd3b({'res':_0x5181('0x22')});});}else{return db[_0x5181('0x1f')][_0x5181('0x23')]({'CmContactId':_0x36d4b9,'item':_0x208e59,'description':_0x3aef37,'ItemTypeId':_0x493e3d,'OrderBy':_0xca2e7f,'ItemClass':_0x5181('0x24')})[_0x5181('0x17')](function(_0x41d869){_0x52cd3b({'res':_0x5181('0x25')});});}});});}function insertCmHopper(_0x20b1e3,_0x49a2cf,_0xf19304,_0x5bdf6b,_0x1837ae){var _0x3235e7=[_0x5181('0x26'),_0x5181('0x27'),_0x5181('0x28'),'cm_contacts.ListId',_0x49a2cf+'.'+_0x5bdf6b,_0x5181('0x29'),_0x5181('0x2a'),_0x5181('0x2b'),'cm_contacts.UserId','\x22'+_0x1837ae+'\x22'];return squel[_0x5181('0x2c')]()[_0x5181('0x2d')](_0x5181('0x2e'))[_0x5181('0x2f')]([_0x5181('0x10'),'scheduledat','ContactId',_0x5181('0x30'),_0x5bdf6b,'createdAt','updatedAt','priority',_0x5181('0x31'),_0x5181('0x32')],squel[_0x5181('0xe')]()[_0x5181('0x33')](_0x3235e7)['from'](_0x49a2cf)[_0x5181('0x11')](_0x5181('0x34'),null,_0x5181('0x35')+_0x49a2cf+_0x5181('0x36'))[_0x5181('0x11')](_0xf19304,null,_0xf19304+_0x5181('0x12')+_0x49a2cf+'.'+_0x5bdf6b)[_0x5181('0x13')](_0x49a2cf+'.CmListId\x20=\x20?',_0x20b1e3)[_0x5181('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x5181('0x37'),selectNotIn(_0x49a2cf,_0xf19304,_0x5bdf6b,_0x5181('0x2e'),['\x22always\x22',_0x5181('0x38')]))[_0x5181('0x13')](_0x5181('0x37'),selectNotIn(_0x49a2cf,_0xf19304,_0x5bdf6b,_0x5181('0x2e'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x1c9152,_0x2e24ec,_0x2fa984,_0x1e0d33){var _0x30034a=[_0x5181('0x26'),_0x5181('0x28'),_0x5181('0x39'),_0x2e24ec+'.'+_0x1e0d33,_0x5181('0x29'),_0x5181('0x2a')];return squel['insert']()[_0x5181('0x2d')](_0x5181('0x3a'))[_0x5181('0x2f')]([_0x5181('0x10'),'ContactId','ListId',_0x1e0d33,'createdAt','updatedAt'],squel[_0x5181('0xe')]()['fields'](_0x30034a)['from'](_0x2e24ec)['join'](_0x5181('0x34'),null,_0x5181('0x35')+_0x2e24ec+_0x5181('0x36'))[_0x5181('0x11')](_0x2fa984,null,_0x2fa984+_0x5181('0x12')+_0x2e24ec+'.'+_0x1e0d33)[_0x5181('0x13')](_0x2e24ec+_0x5181('0x3b'),_0x1c9152)[_0x5181('0x13')](_0x5181('0x3c'),NOW)[_0x5181('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x5181('0xe')]()['field'](_0x5181('0x10'))[_0x5181('0x3d')]('cm_hopper_black')['where'](_0x5181('0x3e'),_0x1c9152)[_0x5181('0x13')](_0x1e0d33+_0x5181('0x14')+_0x2e24ec+'.'+_0x1e0d33)))[_0x5181('0x3f')]();}function insertTzCmHopper(_0x1b3977,_0x3cd9f4,_0x2707e6,_0x442e9d,_0x23cf2e,_0x3d4064){var _0x290c50=[_0x5181('0x26'),_0x5181('0x40')+_0x3d4064+_0x5181('0x41'),_0x5181('0x28'),'cm_contacts.ListId',_0x3cd9f4+'.'+_0x442e9d,_0x5181('0x29'),'cm_contacts.updatedAt','cm_contacts.priority',_0x5181('0x42'),'\x22'+_0x23cf2e+'\x22'];var _0x2e88d6=squel[_0x5181('0x2c')]()[_0x5181('0x2d')](_0x5181('0x2e'))[_0x5181('0x2f')]([_0x5181('0x10'),_0x5181('0x43'),_0x5181('0x44'),_0x5181('0x30'),_0x442e9d,_0x5181('0x45'),'updatedAt',_0x5181('0x46'),_0x5181('0x31'),'recallme'],squel[_0x5181('0xe')]()[_0x5181('0x33')](_0x290c50)[_0x5181('0x3d')](_0x3cd9f4)[_0x5181('0x11')](_0x5181('0x34'),null,_0x5181('0x35')+_0x3cd9f4+_0x5181('0x36'))['join'](_0x2707e6,null,_0x2707e6+_0x5181('0x12')+_0x3cd9f4+'.'+_0x442e9d)[_0x5181('0x11')](_0x3d4064,null,_0x3d4064+'.id\x20=\x20'+_0x3cd9f4+'.'+_0x442e9d)[_0x5181('0x13')](_0x3cd9f4+_0x5181('0x3b'),_0x1b3977)['where'](_0x5181('0x3c'),NOW)[_0x5181('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3cd9f4,_0x2707e6,_0x442e9d,_0x5181('0x2e'),[_0x5181('0x47'),_0x5181('0x38')]))[_0x5181('0x13')](_0x5181('0x37'),selectNotIn(_0x3cd9f4,_0x2707e6,_0x442e9d,_0x5181('0x2e'),['\x22always\x22'])))['toString']();return _0x2e88d6;}function insertTzCmHopperBlack(_0x4fa3e4,_0x5afd12,_0x38ca7e,_0xc317b1){var _0x41663d=[_0x5181('0x26'),_0x5181('0x28'),'cm_contacts.ListId',_0x5afd12+'.'+_0xc317b1,_0x5181('0x29'),_0x5181('0x2a')];return squel[_0x5181('0x2c')]()[_0x5181('0x2d')](_0x5181('0x3a'))[_0x5181('0x2f')]([_0x5181('0x10'),'ContactId',_0x5181('0x30'),_0xc317b1,_0x5181('0x45'),_0x5181('0x48')],squel[_0x5181('0xe')]()[_0x5181('0x33')](_0x41663d)[_0x5181('0x3d')](_0x5afd12)['join'](_0x5181('0x34'),null,_0x5181('0x35')+_0x5afd12+_0x5181('0x36'))['join'](_0x38ca7e,null,_0x38ca7e+_0x5181('0x12')+_0x5afd12+'.'+_0xc317b1)['where'](_0x5afd12+_0x5181('0x3b'),_0x4fa3e4)[_0x5181('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5181('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x5181('0xe')]()[_0x5181('0xf')](_0x5181('0x10'))[_0x5181('0x3d')](_0x5181('0x3a'))['where']('ListId\x20=\x20?',_0x4fa3e4)['where'](_0xc317b1+'\x20=\x20'+_0x5afd12+'.'+_0xc317b1)))['toString']();}function insertCmHopperAdditionalPhones(_0x2b3cd1){var _0x4c7b3e=[_0x5181('0x49'),_0x5181('0x4a'),_0x5181('0x4b'),_0x5181('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0x5181('0x2c')]()[_0x5181('0x2d')](_0x5181('0x4d'))['fromQuery']([_0x5181('0x4e'),'phone',_0x5181('0x4f'),_0x5181('0x45'),'updatedAt'],squel[_0x5181('0xe')]()[_0x5181('0x33')](_0x4c7b3e)['from']('cm_hopper')[_0x5181('0x11')](_0x5181('0x34'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x5181('0x11')](_0x5181('0x50'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x5181('0x51'),_0x2b3cd1)[_0x5181('0x13')](_0x5181('0x3c'),NOW))[_0x5181('0x3f')]();}function insertCmContact(_0x3edfa2,_0xf40da3,_0x3a7352,_0x4216c2){var _0x186d91=_[_0x5181('0x52')](_['keys'](_0x4216c2),['ListId',_0x5181('0x53'),_0x5181('0x45'),_0x5181('0x48')]);return squel[_0x5181('0x2c')]()['into']('cm_contacts')[_0x5181('0x2f')](_0x186d91,squel['select']()[_0x5181('0x33')](_0x186d91)[_0x5181('0x3d')](_0xf40da3)[_0x5181('0x13')]('('+_0x3a7352['join'](',')+_0x5181('0x54'),squel['select']()['fields'](_0x3a7352)[_0x5181('0x3d')](_0x5181('0x34'))[_0x5181('0x13')](_0x5181('0x3e'),_0x3edfa2)['where'](_0x5181('0x55')))[_0x5181('0x13')]('id\x20IN\x20?',squel[_0x5181('0xe')]()[_0x5181('0xf')]('MIN(id)',_0x5181('0x56'))[_0x5181('0x3d')](_0xf40da3)[_0x5181('0x57')](_0x3a7352['join'](','))))[_0x5181('0x3f')]();}function handleStop(){logger[_0x5181('0x58')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2be330){logger[_0x5181('0x59')](_0x2be330['message']);process[_0x5181('0x5a')](0x1);}function handleError(_0x32f571,_0x52422e){stats[_0x5181('0x5b')][_0x5181('0x1c')]({'name':_0x52422e[_0x5181('0x5c')],'message':_0x52422e[_0x5181('0x5d')],'row':_0x32f571});}function handleQuery(_0x5e2768){logger[_0x5181('0x58')](_0x5e2768);return db['sequelize'][_0x5181('0x5e')](_0x5e2768)[_0x5181('0x5f')](function(_0x2939e7){results['push'](_0x2939e7);})['catch'](function(_0x191cd7){logger['error'](_0x191cd7[_0x5181('0x5d')]);});}function updateTzCampaigns(_0x78085c){return new Promise(function(_0x113c1c,_0x1613a2){var _0x225d43=squel[_0x5181('0xe')]()['fields']([_0x5181('0x60'),_0x5181('0x61')])[_0x5181('0x3d')](_0x5181('0x62'))['join'](_0x5181('0x63'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0x5181('0x64')+_0x78085c);db['sequelize'][_0x5181('0x5e')](_0x225d43[_0x5181('0x3f')]())[_0x5181('0x5f')](function(_0x14fc84){var _0x2de56b=[];for(var _0x515a22=0x0;_0x515a22<_0x14fc84[_0x5181('0x1b')];_0x515a22++){_0x2de56b['push'](getTimezoneData(_0x14fc84[_0x515a22],tmp_campaigns));}BPromise[_0x5181('0x18')](_0x2de56b)[_0x5181('0x17')](function(){_0x113c1c({'val':0x1});});})[_0x5181('0x65')](function(_0x16699f){logger[_0x5181('0x59')](_0x16699f[_0x5181('0x5d')]);_0x113c1c({'val':0x0});});});}function updateTzVoiceQueues(_0x10e337){return new Promise(function(_0x221db2,_0x2364d7){var _0x1b70cf=squel['select']()[_0x5181('0x33')]([_0x5181('0x66'),'voice_queues.dialTimezone'])[_0x5181('0x3d')]('voice_queues')[_0x5181('0x11')](_0x5181('0x67'),null,_0x5181('0x68'))[_0x5181('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x10e337);db[_0x5181('0x69')]['query'](_0x1b70cf[_0x5181('0x3f')]())['spread'](function(_0x17e9e5){var _0x209947=[];for(var _0xb0ed97=0x0;_0xb0ed97<_0x17e9e5['length'];_0xb0ed97++){_0x209947[_0x5181('0x1c')](getTimezoneData(_0x17e9e5[_0xb0ed97],tmp_voice_queues));}BPromise[_0x5181('0x18')](_0x209947)['then'](function(){_0x221db2({'val':0x1});});})[_0x5181('0x65')](function(_0x324d5d){logger[_0x5181('0x59')](_0x324d5d['message']);_0x221db2({'val':0x0});});});}function getTimezoneData(_0x3333f6,_0x200dce){return new Promise(function(_0x151aee,_0x5be41b){var _0xc77dd0=shared['timezones'];var _0x55b19d=_0xc77dd0[_0x3333f6['dialTimezone']];if(_[_0x5181('0x1d')](_0x55b19d)){_0x151aee({'ret':0x1});}else{var _0x22c6c1=_0x55b19d['utcOffset'];var _0x2b37d5=squel['insert']()['into'](_0x200dce)['set']('id',_0x3333f6['id'])[_0x5181('0x6a')](_0x5181('0x6b'),_0x22c6c1)['set'](_0x5181('0x6c'),_0x3333f6[_0x5181('0x6c')])['toString']();return db['sequelize'][_0x5181('0x5e')](_0x2b37d5)[_0x5181('0x5f')](function(_0x4eaecc){_0x151aee({'ret':0x1});})['catch'](function(_0x146820){logger[_0x5181('0x59')](_0x146820['message']);_0x5be41b({'ret':0x1});});}});}function handleTZQuery(_0x526d62){logger[_0x5181('0x58')](_0x526d62);return db[_0x5181('0x69')]['query'](_0x526d62)['spread'](function(_0x4acfa9){})[_0x5181('0x65')](function(_0x3a359a){logger[_0x5181('0x59')](_0x3a359a['message']);});}function main(_0x17e7ca,_0x4311ec,_0x5f597f,_0x48375f){logger[_0x5181('0x58')](_0x5181('0x6d'),_0x17e7ca,JSON[_0x5181('0x6e')](_0x4311ec));process[_0x5181('0x6f')]('start');var _0x4476f4=_0x4311ec[_0x5181('0x70')];var _0x23b83e=_['clone'](_0x4476f4);var _0x112cb7=_0x4311ec[_0x5181('0x71')];var _0x5bf896=path[_0x5181('0x11')](config[_0x5181('0x72')],_0x5181('0x73'),_0x112cb7+'.csv');hasTZ=_[_0x5181('0x74')](_0x4476f4)[_0x5181('0x75')](_0x5181('0x6c'));var _0x565c2d=_['keys'](_0x4476f4)[_0x5181('0x11')]();logger[_0x5181('0x58')](_0x5181('0x76'),_0x565c2d);db[_0x5181('0x77')][_0x5181('0x16')]({'raw':!![],'attributes':['id',_0x5181('0x78')]})[_0x5181('0x17')](function(_0x367c2d){for(var _0x50038a=0x0;_0x50038a<_0x367c2d[_0x5181('0x1b')];_0x50038a++){if(_0x367c2d[_0x50038a][_0x5181('0x78')]in _0x4476f4){contactItemTypes['push'](_0x367c2d[_0x50038a]);delete _0x23b83e[_0x367c2d[_0x50038a][_0x5181('0x78')]];hasAdditionalPhones=!![];}for(var _0x3dde3f in _0x4476f4){if(_0x367c2d[_0x50038a][_0x5181('0x78')]+'_description'===_0x3dde3f){phoneDescriptions[_0x5181('0x1c')]({'itemTypeId':_0x367c2d[_0x50038a]['id'],'description':_0x3dde3f});delete _0x23b83e[_0x3dde3f];}}}if(hasAdditionalPhones)_0x23b83e['AdditionalPhones']='';var _0x5b3d89=_[_0x5181('0x74')](_0x23b83e)[_0x5181('0x11')]();logger[_0x5181('0x58')](_0x5181('0x76'),_0x5b3d89);fs[_0x5181('0x79')](_0x5bf896,_0x5b3d89+'\x0a');Papa[_0x5181('0x7a')](fs[_0x5181('0x7b')](_0x17e7ca),{'header':!![],'skipEmptyLines':!![],'step':function(_0x28017d,_0x313342){try{for(var _0x24424a=0x0,_0x5b0fac=[];_0x24424a<_0x28017d['data'][_0x5181('0x1b')];_0x24424a++){stats[_0x5181('0x7c')]+=0x1;if(_0x28017d[_0x5181('0x5b')][_0x24424a]){handleError(_0x28017d['data'][_0x24424a],_0x28017d[_0x5181('0x5b')][_0x24424a]);}else{var _0x5d3bd9=[];var _0x13b0b2=[];var _0x11500a={};for(var _0x13be10 in _0x4476f4){let _0x57ff97=contactItemTypes['find'](_0x3ac0c0=>_0x3ac0c0[_0x5181('0x78')]===_0x13be10);let _0x27b9ea=contactItemTypes['find'](_0x58838e=>_0x58838e[_0x5181('0x78')]+_0x5181('0x7d')===_0x13be10);if(_[_0x5181('0x1d')](_0x57ff97)&&_[_0x5181('0x1d')](_0x27b9ea)){if(_0x4476f4['hasOwnProperty'](_0x13be10)){if(_0x28017d['data'][_0x24424a][_0x4476f4[_0x13be10]]){var _0x2b99f2=_['trim'](_0x28017d['data'][_0x24424a][_0x4476f4[_0x13be10]][_0x5181('0x7e')](/"/g,'\x27'));switch(_0x13be10){case _0x5181('0x43'):var _0x23a970=moment(_0x2b99f2,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x23a970['isValid']()){_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x2b99f2+'\x22');}else{_0x5d3bd9['push'](_0x5181('0x7f'));}break;case'priority':var _0x4ecebb=parseInt(_0x2b99f2);_0x2b99f2=_[_0x5181('0x80')](_0x4ecebb)||_0x4ecebb<0x0||_0x4ecebb>0x4?_0x48375f?0x3:0x2:_0x4ecebb;_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x2b99f2+'\x22');break;case _0x5181('0x31'):var _0x48aefa=parseInt(_0x2b99f2);if(_[_0x5181('0x81')](_0x48aefa)&&_[_0x5181('0x75')](_0x5f597f,_0x48aefa)){_0x5b0fac['push']('\x22'+_0x48aefa+'\x22');}else{_0x5d3bd9[_0x5181('0x1c')](_0x5181('0x82'));}break;case _0x5181('0x83'):if(isEmail(_0x2b99f2)){_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x2b99f2+'\x22');}else{_0x5d3bd9[_0x5181('0x1c')](_0x5181('0x84'));}break;case'dateOfBirth':var _0x4bb0da=moment(_0x2b99f2,_0x5181('0x85'),!![]);if(_0x4bb0da[_0x5181('0x86')]()){_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x2b99f2+'\x22');}else{_0x5d3bd9[_0x5181('0x1c')](_0x5181('0x87'));}break;case'dialTimezone':var _0x47776d=shared['timezones'];var _0x3a94b3=_0x47776d[_0x2b99f2];if(!_[_0x5181('0x1d')](_0x3a94b3)){var _0x443176=_0x3a94b3[_0x5181('0x88')];_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x2b99f2+'\x22');_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x443176+'\x22');}break;default:_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x2b99f2+'\x22');}}else{switch(_0x13be10){case _0x5181('0x89'):case _0x5181('0x10'):_0x5d3bd9[_0x5181('0x1c')](_0x13be10+_0x5181('0x8a'));break;default:_0x5b0fac[_0x5181('0x1c')]('\x22\x22');}}}}else{var _0x23550e='';if(!_[_0x5181('0x1d')](_0x57ff97)){if(!_0x11500a[_0x5181('0x8b')](_0x57ff97['id'])){if(!_[_0x5181('0x1d')](_0x28017d[_0x5181('0x8c')][_0x24424a][_0x4476f4[_0x13be10]])){var _0x2b99f2=_[_0x5181('0x8d')](_0x28017d[_0x5181('0x8c')][_0x24424a][_0x4476f4[_0x13be10]][_0x5181('0x7e')](/"/g,'\x27'));var _0x712cab=phoneDescriptions[_0x5181('0x8e')](_0x33bf72=>_0x33bf72[_0x5181('0x8f')]===_0x57ff97['id']);if(!_[_0x5181('0x1d')](_0x712cab)){var _0x3fd582=_[_0x5181('0x8d')](_0x28017d[_0x5181('0x8c')][_0x24424a][_0x4476f4[_0x712cab['description']]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x3fd582))_0x2b99f2=_0x2b99f2+'§'+_0x3fd582;}if(_0x23550e=='')_0x23550e=_0x2b99f2;else _0x23550e+='|'+_0x2b99f2;}_0x13b0b2[_0x5181('0x1c')](_0x57ff97['id']+':'+_0x23550e);_0x11500a[_0x57ff97['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5b0fac[_0x5181('0x1c')]('\x22'+_0x13b0b2[_0x5181('0x11')](';')+'\x22');}if(_0x5d3bd9[_0x5181('0x1b')]){handleError(_0x28017d[_0x5181('0x8c')][_0x24424a],{'code':_0x5181('0x90'),'message':_0x5d3bd9['join']()});}else{fs[_0x5181('0x91')](_0x5bf896,_0x5b0fac[_0x5181('0x11')]()+'\x0a');}_0x5b0fac=[];}if(!(stats[_0x5181('0x7c')]%0xc8)){socket[_0x5181('0x92')](_0x5181('0x93')+_0x112cb7,stats);stats[_0x5181('0x5b')]=[];}}if(stopped){logger['info'](_0x5181('0x94'));_0x313342[_0x5181('0x95')]();}}catch(_0x4266f8){handleError(_0x28017d['data'][_0x24424a],{'code':'SystemError','message':_0x4266f8[_0x5181('0x5d')]});logger[_0x5181('0x59')](_0x5181('0x96'),_0x4266f8[_0x5181('0x5d')]);}},'complete':function(){try{var _0x15e2e2=[];var _0x2124d9=[];var _0x342ae4=_0x5181('0x34');if(_0x4311ec[_0x5181('0x97')]&&_0x4311ec[_0x5181('0x97')]['length']){_0x342ae4=_0x5181('0x98')+_0x112cb7;_0x15e2e2[_0x5181('0x1c')]('CREATE\x20TABLE\x20'+_0x342ae4+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x5181('0x99')+_0x112cb7;tmp_voice_queues=_0x5181('0x9a')+_0x112cb7;_0x2124d9[_0x5181('0x1c')](_0x5181('0x9b')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x2124d9[_0x5181('0x1c')](_0x5181('0x9b')+tmp_voice_queues+_0x5181('0x9c'));BPromise['each'](_0x2124d9,handleTZQuery)[_0x5181('0x17')](function(_0x9fc4da){updateTzCampaigns(_0x4311ec['ListId'])['then'](function(_0x21e1fa){updateTzVoiceQueues(_0x4311ec[_0x5181('0x30')])['then'](function(_0x500176){if(hasTZ)_0x5b3d89=_0x5b3d89['replace']('dialTimezone',_0x5181('0x9d'));var _0x117fb6=util['format'](_0x5181('0x9e'),_0x5bf896,_0x342ae4,_0x5b3d89,_0x4311ec[_0x5181('0x30')],_0x4311ec[_0x5181('0x53')]||null,NOW,NOW);if(_[_0x5181('0x1d')](_0x4476f4[_0x5181('0x43')])){_0x117fb6+=_0x5181('0x9f');}_0x15e2e2['push'](_0x117fb6);if(_0x4311ec[_0x5181('0x97')]&&_0x4311ec['duplicates'][_0x5181('0x1b')]){_0x15e2e2[_0x5181('0x1c')](insertCmContact(_0x4311ec[_0x5181('0x30')],_0x342ae4,_0x4311ec[_0x5181('0x97')],_0x4476f4));_0x15e2e2[_0x5181('0x1c')]('DROP\x20TABLE\x20'+_0x342ae4+';');}BPromise['each'](_0x15e2e2,handleQuery)[_0x5181('0x17')](function(_0x371955){BPromise[_0x5181('0x18')]([handleAdditionalPhones()])[_0x5181('0x17')](function(){_0x15e2e2=[];for(var _0x1596f7=0x0;_0x1596f7_0x52cccd['name']===_0x14f39c);let _0xd2c027=contactItemTypes[_0x547c('0x73')](_0x2648bc=>_0x2648bc['name']+_0x547c('0x74')===_0x14f39c);if(_[_0x547c('0x1f')](_0xf343a9)&&_[_0x547c('0x1f')](_0xd2c027)){if(_0x825ed5[_0x547c('0x75')](_0x14f39c)){if(_0x3277ba['data'][_0x27dcb1][_0x825ed5[_0x14f39c]]){var _0x5723f1=_[_0x547c('0x76')](_0x3277ba['data'][_0x27dcb1][_0x825ed5[_0x14f39c]][_0x547c('0x77')](/"/g,'\x27'));switch(_0x14f39c){case _0x547c('0x39'):var _0x5613c1=moment(_0x5723f1,_0x547c('0xf'),!![]);if(_0x5613c1['isValid']()){_0x40f59d[_0x547c('0x21')]('\x22'+_0x5723f1+'\x22');}else{_0xe3e820[_0x547c('0x21')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x547c('0x3c'):var _0x1b3f94=parseInt(_0x5723f1);_0x5723f1=_[_0x547c('0x78')](_0x1b3f94)||_0x1b3f94<0x0||_0x1b3f94>0x4?_0x70e648?0x3:0x2:_0x1b3f94;_0x40f59d[_0x547c('0x21')]('\x22'+_0x5723f1+'\x22');break;case'UserId':var _0x535f32=parseInt(_0x5723f1);if(_[_0x547c('0x79')](_0x535f32)&&_[_0x547c('0x7a')](_0x16ebb7,_0x535f32)){_0x40f59d[_0x547c('0x21')]('\x22'+_0x535f32+'\x22');}else{_0xe3e820[_0x547c('0x21')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x5723f1)){_0x40f59d[_0x547c('0x21')]('\x22'+_0x5723f1+'\x22');}else{_0xe3e820[_0x547c('0x21')](_0x547c('0x7b'));}break;case _0x547c('0x7c'):var _0x1b865a=moment(_0x5723f1,_0x547c('0x7d'),!![]);if(_0x1b865a[_0x547c('0x7e')]()){_0x40f59d[_0x547c('0x21')]('\x22'+_0x5723f1+'\x22');}else{_0xe3e820[_0x547c('0x21')](_0x547c('0x7f'));}break;default:_0x40f59d[_0x547c('0x21')]('\x22'+_0x5723f1+'\x22');}}else{switch(_0x14f39c){case _0x547c('0x80'):case _0x547c('0x14'):_0xe3e820['push'](_0x14f39c+'\x20not\x20specified');break;default:_0x40f59d['push']('\x22\x22');}}}}else{var _0x173f5f='';if(!_['isNil'](_0xf343a9)){if(!_0x166b75['hasOwnProperty'](_0xf343a9['id'])){for(var _0x3a10b9=0x0;_0x3a10b9<_0x825ed5[_0x14f39c]['length'];_0x3a10b9++){var _0x5723f1=_[_0x547c('0x76')](_0x3277ba[_0x547c('0x72')][_0x27dcb1][_0x825ed5[_0x14f39c][_0x3a10b9]][_0x547c('0x77')](/"/g,'\x27'));var _0x1c8fcd=phoneDescriptions['find'](_0x28213b=>_0x28213b[_0x547c('0x81')]===_0xf343a9['id']);if(!_['isNil'](_0x1c8fcd)){var _0x5c4907=_[_0x547c('0x76')](_0x3277ba[_0x547c('0x72')][_0x27dcb1][_0x825ed5[_0x1c8fcd[_0x547c('0x82')]][0x0]][_0x547c('0x77')](/"/g,'\x27'));if(!_[_0x547c('0x1f')](_0x5c4907))_0x5723f1=_0x5723f1+'§'+_0x5c4907;}if(_0x173f5f=='')_0x173f5f=_0x5723f1;else _0x173f5f+='|'+_0x5723f1;}_0x4f0ed4[_0x547c('0x21')](_0xf343a9['id']+':'+_0x173f5f);_0x166b75[_0xf343a9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x40f59d[_0x547c('0x21')]('\x22'+_0x4f0ed4[_0x547c('0x15')](';')+'\x22');}if(_0xe3e820['length']){handleError(_0x3277ba[_0x547c('0x72')][_0x27dcb1],{'code':_0x547c('0x83'),'message':_0xe3e820[_0x547c('0x15')]()});}else{fs['appendFileSync'](_0x42ee7c,_0x40f59d[_0x547c('0x15')]()+'\x0a');}_0x40f59d=[];}if(!(stats[_0x547c('0x84')]%0xc8)){socket[_0x547c('0x85')](_0x547c('0x86')+_0xa66eee,stats);stats[_0x547c('0x63')]=[];}}if(stopped){logger[_0x547c('0x65')](_0x547c('0x87'));_0x6bf96d[_0x547c('0x88')]();}}catch(_0x3b245b){handleError(_0x3277ba[_0x547c('0x72')][_0x27dcb1],{'code':_0x547c('0x89'),'message':_0x3b245b[_0x547c('0x26')]});logger[_0x547c('0x25')](_0x547c('0x8a'),_0x3b245b['message']);}},'complete':function(){try{var _0x2c0024=[];var _0xb3484b=tempTableName;_0x2c0024[_0x547c('0x21')]('CREATE\x20TABLE\x20'+_0xb3484b+_0x547c('0x8b'));logger[_0x547c('0x65')](_0x547c('0x8c'),contactItemTypes[_0x547c('0x1e')]);var _0x427358=util[_0x547c('0xe')](_0x547c('0x8d'),_0x42ee7c,_0xb3484b,_0xab6b92,_0x5d6c7f[_0x547c('0x4a')],_0x5d6c7f[_0x547c('0x5b')]||null,NOW,NOW);if(_[_0x547c('0x1f')](_0x825ed5[_0x547c('0x39')])){_0x427358+=_0x547c('0x8e');}_0x2c0024[_0x547c('0x21')](_0x427358);BPromise['each'](_0x2c0024,handleQuery)['then'](function(_0x4d8594){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x2c0024=[];for(var _0x4b09fb=0x0;_0x4b09fb\x20\x20');}var _0x3088e8=path[_0x547c('0x15')](config[_0x547c('0x6a')],'server/files/tmp',process[_0x547c('0x99')][0x2]);if(!fs[_0x547c('0x9a')](_0x3088e8)){throw new Error(_0x547c('0x9b'));}var _0x3c6e27={};try{_0x3c6e27=JSON['parse'](process[_0x547c('0x99')][0x3]);if(!_0x3c6e27['binding']){throw new Error(_0x547c('0x9c'));}var _0x55ee92=0x0;if(_0x3c6e27[_0x547c('0x9d')][_0x547c('0x3d')]){_0x55ee92=0x1;}if(!_0x3c6e27[_0x547c('0x4a')]){throw new Error(_0x547c('0x9e'));}}catch(_0x67367d){throw new Error(_0x547c('0x9f'));}var _0x48bb39=[];try{_0x48bb39=_['map'](JSON['parse'](process[_0x547c('0x99')][0x4]),'id');}catch(_0x6168f5){logger[_0x547c('0x65')](_0x547c('0xa0'));}main(_0x3088e8,_0x3c6e27,_0x48bb39,_0x55ee92);}validate();process['on']('SIGINT',handleStop);process['on'](_0x547c('0xa1'),handleUncaughtException); \ No newline at end of file +var _0xab9c=['name','keys','header','writeFileSync','parse','data','rows','errors','find','trim','replace','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','catch','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','length','isNil','AdditionalPhones','push','all','then','error','message','split','findOne','update','updated','CmContactHasItem','create','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.UserId','insert','into','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','.CmListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','fromQuery','fields','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','exit','code','spread','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xab9c,0xd0));var _0xcab9=function(_0x53c297,_0x5b1b35){_0x53c297=_0x53c297-0x0;var _0x48785b=_0xab9c[_0x53c297];return _0x48785b;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xcab9('0x0'));var Papa=require(_0xcab9('0x1'));var util=require(_0xcab9('0x2'));var BPromise=require(_0xcab9('0x3'));var moment=require(_0xcab9('0x4'));var squel=require(_0xcab9('0x5'));var Redis=require(_0xcab9('0x6'));var db=require(_0xcab9('0x7'))['db'];var config=require(_0xcab9('0x8'));var logger=require('../../../config/logger')(_0xcab9('0x9'));config[_0xcab9('0xa')]=_[_0xcab9('0xb')](config['redis'],{'host':_0xcab9('0xc'),'port':0x18eb});var socket=require(_0xcab9('0xd'))(new Redis(config[_0xcab9('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xcab9('0xe'));var tempTableName=_0xcab9('0xf')+moment()[_0xcab9('0x10')](_0xcab9('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x162b04){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))*$/[_0xcab9('0x12')](_0x162b04);}function selectNotIn(_0x3f9aae,_0x400313,_0x1f8641,_0xd4fee9,_0x1d52e4){return squel[_0xcab9('0x13')]()[_0xcab9('0x14')](_0xcab9('0x15'))[_0xcab9('0x16')](_0xd4fee9)[_0xcab9('0x17')](_0x400313,null,_0x400313+_0xcab9('0x18')+_0xd4fee9+'.'+_0x1f8641)['where'](_0xd4fee9+'.'+_0x1f8641+_0xcab9('0x19')+_0x3f9aae+'.'+_0x1f8641)[_0xcab9('0x1a')](_0x400313+_0xcab9('0x1b')+_0x1d52e4['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x21bde4,_0x17978b){promisesAdditionalPhones=[];promisesContact=[];return db[_0xcab9('0x1c')][_0xcab9('0x1d')](_0xcab9('0x1e')+tempTableName)['spread'](function(_0x55f5fe){if(_0x55f5fe!==null){var _0x13a650=[];for(var _0x2b6625=0x0;_0x2b6625<_0x55f5fe[_0xcab9('0x1f')];_0x2b6625++){var _0x187ac2=_0x55f5fe[_0x2b6625];if(!_[_0xcab9('0x20')](_0x187ac2[_0xcab9('0x15')])){if(!_[_0xcab9('0x20')](_0x187ac2[_0xcab9('0x21')]))_0x13a650[_0xcab9('0x22')](insertAdditionalPhones(_0x187ac2));promisesContact[_0xcab9('0x22')]({'contact':_0x187ac2});}}}Promise[_0xcab9('0x23')](_0x13a650)[_0xcab9('0x24')](function(){_0x21bde4({'val':0x1});});})['catch'](function(_0x5e9de1){logger[_0xcab9('0x25')](_0x5e9de1[_0xcab9('0x26')]);});});}function insertAdditionalPhones(_0xdb75ec){return new Promise(function(_0x15cc4f,_0x2392b5){var _0x32cc32=_0xdb75ec[_0xcab9('0x21')];if(_[_0xcab9('0x20')](_0x32cc32))_0x2392b5({'val':0x0});else{var _0x56871a=_0x32cc32[_0xcab9('0x27')](';');var _0x1b6274=[];orderBy=0x0;for(var _0x503bc5=0x0;_0x503bc5<_0x56871a[_0xcab9('0x1f')];_0x503bc5++){_0x1b6274[_0xcab9('0x22')](splitAdditionalPhone(_0xdb75ec['id'],_0x56871a[_0x503bc5]));}Promise[_0xcab9('0x23')](_0x1b6274)[_0xcab9('0x24')](function(){_0x15cc4f({'val':_0x56871a[_0xcab9('0x1f')]});});}});}function splitAdditionalPhone(_0x2e5aa9,_0x14263f){return new Promise(function(_0x344fad,_0x5a1345){var _0x18e59a=_0x14263f['split'](':');var _0x6d9c93=_0x18e59a[0x0];var _0x5dbabc=_0x18e59a[0x1];if(_0x5dbabc!==''){var _0x3ac15a=_0x5dbabc[_0xcab9('0x27')]('|');var _0x33ee8a=[];for(var _0x1241f4=0x0;_0x1241f4<_0x3ac15a[_0xcab9('0x1f')];_0x1241f4++){if(_0x3ac15a[_0x1241f4]!==''){var _0x441545=_['filter'](promisesAdditionalPhones,{'contactId':_0x2e5aa9,'phone':_0x3ac15a[_0x1241f4]});if(_0x441545[_0xcab9('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0xcab9('0x22')]({'contactId':_0x2e5aa9,'contactTypeId':_0x6d9c93,'phone':_0x3ac15a[_0x1241f4],'orderBy':orderBy});}}}_0x344fad({'ok':0x1});}else _0x344fad({'res':0x0});});}function createAdditionalPhone(_0x35b3cb,_0x40b058,_0x29ae30,_0x2e7d42){var _0x2eb703='';var _0x23e31e='';var _0x12e782=_0x29ae30['split']('§');_0x2eb703=_0x12e782[0x0];if(_0x12e782['length']==0x2)_0x23e31e=_0x12e782[0x1];return new Promise(function(_0x92dbf5,_0x5efc62){return db['CmContactHasItem'][_0xcab9('0x28')]({'where':{'CmContactId':_0x35b3cb,'item':_0x2eb703}})[_0xcab9('0x24')](function(_0x5b0c51){if(_0x5b0c51){return db['CmContactHasItem'][_0xcab9('0x29')]({'ItemTypeId':_0x40b058,'description':_0x23e31e,'OrderBy':_0x2e7d42},{'where':{'CmContactId':_0x35b3cb,'item':_0x2eb703}})['then'](function(_0xeb273e){_0x92dbf5({'res':_0xcab9('0x2a')});});}else{return db[_0xcab9('0x2b')][_0xcab9('0x2c')]({'CmContactId':_0x35b3cb,'item':_0x2eb703,'ItemTypeId':_0x40b058,'description':_0x23e31e,'OrderBy':_0x2e7d42,'ItemClass':'PHONE'})[_0xcab9('0x24')](function(_0x387ce9){_0x92dbf5({'res':'inserted'});});}});});}function updateContact(_0x52d377){return new Promise(function(_0x5e0103,_0xdb7bc){var _0x25d1bb=_0x52d377['id'];delete _0x52d377['id'];return db['CmContact'][_0xcab9('0x29')](_0x52d377,{'where':{'id':_0x25d1bb}})['then'](function(_0x541419){updatedRows+=0x1;return db['CmHopper'][_0xcab9('0x29')]({'phone':_0x52d377[_0xcab9('0x15')]},{'where':{'ContactId':_0x25d1bb}})[_0xcab9('0x24')](function(_0x22b25e){_0x5e0103({'ret':'OK'});});});});}function insertCmHopper(_0x2e345d,_0x20ba4e,_0x3fefef,_0x363832,_0x441aea){var _0x49795e=[_0xcab9('0x2d'),_0xcab9('0x2e'),'cm_contacts.id','cm_contacts.ListId',_0x20ba4e+'.'+_0x363832,_0xcab9('0x2f'),'cm_contacts.updatedAt','cm_contacts.priority',_0xcab9('0x30'),'\x22'+_0x441aea+'\x22'];return squel[_0xcab9('0x31')]()[_0xcab9('0x32')]('cm_hopper')['fromQuery']([_0xcab9('0x15'),'scheduledat',_0xcab9('0x33'),_0xcab9('0x34'),_0x363832,_0xcab9('0x35'),_0xcab9('0x36'),_0xcab9('0x37'),'UserId',_0xcab9('0x38')],squel[_0xcab9('0x13')]()['fields'](_0x49795e)['from'](_0x20ba4e)[_0xcab9('0x17')](_0xcab9('0x39'),null,_0xcab9('0x3a')+_0x20ba4e+'.CmListId')[_0xcab9('0x17')](_0x3fefef,null,_0x3fefef+'.id\x20=\x20'+_0x20ba4e+'.'+_0x363832)[_0xcab9('0x1a')](_0x20ba4e+_0xcab9('0x3b'),_0x2e345d)[_0xcab9('0x1a')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xcab9('0x3c'),selectNotIn(_0x20ba4e,_0x3fefef,_0x363832,_0xcab9('0x3d'),[_0xcab9('0x3e'),_0xcab9('0x3f')]))['where'](_0xcab9('0x3c'),selectNotIn(_0x20ba4e,_0x3fefef,_0x363832,_0xcab9('0x3d'),['\x22always\x22'])))[_0xcab9('0x40')]();}function insertCmHopperBlack(_0x5ed44d,_0x5b58f0,_0x4b34ce,_0x4ce973){var _0x459ce9=['cm_contacts.phone','cm_contacts.id',_0xcab9('0x41'),_0x5b58f0+'.'+_0x4ce973,_0xcab9('0x2f'),_0xcab9('0x42')];return squel[_0xcab9('0x31')]()['into'](_0xcab9('0x43'))['fromQuery']([_0xcab9('0x15'),'ContactId','ListId',_0x4ce973,_0xcab9('0x35'),_0xcab9('0x36')],squel[_0xcab9('0x13')]()['fields'](_0x459ce9)[_0xcab9('0x16')](_0x5b58f0)[_0xcab9('0x17')](_0xcab9('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x5b58f0+_0xcab9('0x44'))[_0xcab9('0x17')](_0x4b34ce,null,_0x4b34ce+'.id\x20=\x20'+_0x5b58f0+'.'+_0x4ce973)[_0xcab9('0x1a')](_0x5b58f0+'.CmListId\x20=\x20?',_0x5ed44d)[_0xcab9('0x1a')](_0xcab9('0x45'),NOW)['where'](_0xcab9('0x3c'),squel['select']()[_0xcab9('0x14')]('phone')[_0xcab9('0x16')](_0xcab9('0x43'))['where'](_0xcab9('0x46'),_0x5ed44d)[_0xcab9('0x1a')](_0x4ce973+'\x20=\x20?',_0x5b58f0+'.'+_0x4ce973)))[_0xcab9('0x40')]();}function insertCmHopperAdditionalPhones(_0x280618){var _0x13565c=['cm_hopper.id','cm_contact_has_items.item',_0xcab9('0x47'),_0xcab9('0x48'),_0xcab9('0x49')];return squel['insert']()['into'](_0xcab9('0x4a'))[_0xcab9('0x4b')](['CmHopperId','phone','OrderBy',_0xcab9('0x35'),_0xcab9('0x36')],squel[_0xcab9('0x13')]()[_0xcab9('0x4c')](_0x13565c)['from']('cm_hopper')[_0xcab9('0x17')]('cm_contacts',null,_0xcab9('0x4d'))[_0xcab9('0x17')](_0xcab9('0x4e'),null,_0xcab9('0x4f'))[_0xcab9('0x1a')](_0xcab9('0x50'),_0x280618)[_0xcab9('0x1a')](_0xcab9('0x45'),NOW))[_0xcab9('0x40')]();}function insertCmContact(_0x11d3a4,_0x510247,_0x217478,_0x14d60a){var _0x28211=_[_0xcab9('0x51')](_['keys'](_0x14d60a),['ListId',_0xcab9('0x52'),_0xcab9('0x35'),_0xcab9('0x36')]);return squel[_0xcab9('0x31')]()[_0xcab9('0x32')](_0xcab9('0x39'))[_0xcab9('0x4b')](_0x28211,squel[_0xcab9('0x13')]()[_0xcab9('0x4c')](_0x28211)['from'](_0x510247)['where']('('+_0x217478[_0xcab9('0x17')](',')+_0xcab9('0x53'),squel['select']()['fields'](_0x217478)[_0xcab9('0x16')](_0xcab9('0x39'))[_0xcab9('0x1a')]('ListId\x20=\x20?',_0x11d3a4))[_0xcab9('0x1a')](_0xcab9('0x54'),squel[_0xcab9('0x13')]()[_0xcab9('0x14')]('MIN(id)',_0xcab9('0x55'))['from'](_0x510247)[_0xcab9('0x56')](_0x217478[_0xcab9('0x17')](','))))['toString']();}function handleStop(){logger[_0xcab9('0x57')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x374eb3){logger['error'](_0x374eb3[_0xcab9('0x26')]);process[_0xcab9('0x58')](0x1);}function handleError(_0x424c1d,_0x337ebe){stats['errors'][_0xcab9('0x22')]({'name':_0x337ebe[_0xcab9('0x59')],'message':_0x337ebe[_0xcab9('0x26')],'row':_0x424c1d});}function handleQuery(_0x45c911){logger[_0xcab9('0x57')](_0x45c911);return db[_0xcab9('0x1c')][_0xcab9('0x1d')](_0x45c911)[_0xcab9('0x5a')](function(_0x2b862d){results['push'](_0x2b862d);})['catch'](function(_0x810f74){logger[_0xcab9('0x25')](_0x810f74[_0xcab9('0x26')]);});}function main(_0xe06716,_0x38863f,_0x507e90,_0x4786fb){logger[_0xcab9('0x57')](_0xcab9('0x5b'),_0xe06716,JSON[_0xcab9('0x5c')](_0x38863f));process[_0xcab9('0x5d')](_0xcab9('0x5e'));var _0x543ab3=_0x38863f[_0xcab9('0x5f')];var _0x3b7fc0=_[_0xcab9('0x60')](_0x543ab3);var _0x6b5d8b=_0x38863f[_0xcab9('0x61')];var _0x239ae2=path[_0xcab9('0x17')](config[_0xcab9('0x62')],_0xcab9('0x63'),_0x6b5d8b+_0xcab9('0x64'));logger[_0xcab9('0x57')](_0xcab9('0x65'),_0x38863f);db[_0xcab9('0x66')][_0xcab9('0x67')]({'raw':!![],'attributes':['id','name']})[_0xcab9('0x24')](function(_0x3e4a4d){for(var _0x7fe460=0x0;_0x7fe460<_0x3e4a4d[_0xcab9('0x1f')];_0x7fe460++){if(_0x3e4a4d[_0x7fe460][_0xcab9('0x68')]in _0x543ab3){contactItemTypes[_0xcab9('0x22')](_0x3e4a4d[_0x7fe460]);delete _0x3b7fc0[_0x3e4a4d[_0x7fe460]['name']];hasAdditionalPhones=!![];}for(var _0x436340 in _0x543ab3){if(_0x3e4a4d[_0x7fe460]['name']+'_description'===_0x436340){phoneDescriptions[_0xcab9('0x22')]({'itemTypeId':_0x3e4a4d[_0x7fe460]['id'],'description':_0x436340});delete _0x3b7fc0[_0x436340];}}}if(hasAdditionalPhones)_0x3b7fc0[_0xcab9('0x21')]='';var _0x2bd9da=_[_0xcab9('0x69')](_0x3b7fc0)[_0xcab9('0x17')]();logger[_0xcab9('0x57')](_0xcab9('0x6a'),_0x2bd9da);fs[_0xcab9('0x6b')](_0x239ae2,_0x2bd9da+'\x0a');Papa[_0xcab9('0x6c')](fs['createReadStream'](_0xe06716),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d173d,_0x3e0ffc){try{for(var _0x210ed=0x0,_0x452dba=[];_0x210ed<_0x5d173d[_0xcab9('0x6d')][_0xcab9('0x1f')];_0x210ed++){stats[_0xcab9('0x6e')]+=0x1;if(_0x5d173d['errors'][_0x210ed]){handleError(_0x5d173d[_0xcab9('0x6d')][_0x210ed],_0x5d173d[_0xcab9('0x6f')][_0x210ed]);}else{var _0x122eae=[];var _0xe57045=[];var _0x33c193={};for(var _0x1b3e5a in _0x543ab3){let _0x1517b7=contactItemTypes[_0xcab9('0x70')](_0x58d262=>_0x58d262['name']===_0x1b3e5a);let _0x376f31=contactItemTypes[_0xcab9('0x70')](_0x22f8b6=>_0x22f8b6['name']+'_description'===_0x1b3e5a);if(_['isNil'](_0x1517b7)&&_[_0xcab9('0x20')](_0x376f31)){if(_0x543ab3['hasOwnProperty'](_0x1b3e5a)){if(_0x5d173d[_0xcab9('0x6d')][_0x210ed][_0x543ab3[_0x1b3e5a]]){var _0x19bbd5=_[_0xcab9('0x71')](_0x5d173d[_0xcab9('0x6d')][_0x210ed][_0x543ab3[_0x1b3e5a]][_0xcab9('0x72')](/"/g,'\x27'));switch(_0x1b3e5a){case _0xcab9('0x73'):var _0x2cf6b6=moment(_0x19bbd5,_0xcab9('0xe'),!![]);if(_0x2cf6b6['isValid']()){_0x452dba['push']('\x22'+_0x19bbd5+'\x22');}else{_0x122eae[_0xcab9('0x22')](_0xcab9('0x74'));}break;case _0xcab9('0x37'):var _0x3e739c=parseInt(_0x19bbd5);_0x19bbd5=_[_0xcab9('0x75')](_0x3e739c)||_0x3e739c<0x0||_0x3e739c>0x4?_0x4786fb?0x3:0x2:_0x3e739c;_0x452dba[_0xcab9('0x22')]('\x22'+_0x19bbd5+'\x22');break;case _0xcab9('0x76'):var _0x39dfd7=parseInt(_0x19bbd5);if(_[_0xcab9('0x77')](_0x39dfd7)&&_[_0xcab9('0x78')](_0x507e90,_0x39dfd7)){_0x452dba[_0xcab9('0x22')]('\x22'+_0x39dfd7+'\x22');}else{_0x122eae[_0xcab9('0x22')](_0xcab9('0x79'));}break;case _0xcab9('0x7a'):if(isEmail(_0x19bbd5)){_0x452dba[_0xcab9('0x22')]('\x22'+_0x19bbd5+'\x22');}else{_0x122eae[_0xcab9('0x22')]('email\x20wrong\x20format');}break;case _0xcab9('0x7b'):var _0x3bd181=moment(_0x19bbd5,'YYYY-MM-DD',!![]);if(_0x3bd181[_0xcab9('0x7c')]()){_0x452dba['push']('\x22'+_0x19bbd5+'\x22');}else{_0x122eae['push'](_0xcab9('0x7d'));}break;default:_0x452dba[_0xcab9('0x22')]('\x22'+_0x19bbd5+'\x22');}}else{switch(_0x1b3e5a){case'firstName':case'phone':_0x122eae['push'](_0x1b3e5a+'\x20not\x20specified');break;default:_0x452dba['push']('\x22\x22');}}}}else{var _0x1c71b4='';if(!_[_0xcab9('0x20')](_0x1517b7)){if(!_0x33c193[_0xcab9('0x7e')](_0x1517b7['id'])){for(var _0x1c671b=0x0;_0x1c671b<_0x543ab3[_0x1b3e5a]['length'];_0x1c671b++){var _0x19bbd5=_['trim'](_0x5d173d[_0xcab9('0x6d')][_0x210ed][_0x543ab3[_0x1b3e5a][_0x1c671b]]['replace'](/"/g,'\x27'));var _0x15426d=phoneDescriptions['find'](_0x471b55=>_0x471b55[_0xcab9('0x7f')]===_0x1517b7['id']);if(!_[_0xcab9('0x20')](_0x15426d)){var _0x383721=_[_0xcab9('0x71')](_0x5d173d[_0xcab9('0x6d')][_0x210ed][_0x543ab3[_0x15426d[_0xcab9('0x80')]][0x0]][_0xcab9('0x72')](/"/g,'\x27'));if(!_[_0xcab9('0x20')](_0x383721))_0x19bbd5=_0x19bbd5+'§'+_0x383721;}if(_0x1c71b4=='')_0x1c71b4=_0x19bbd5;else _0x1c71b4+='|'+_0x19bbd5;}_0xe57045['push'](_0x1517b7['id']+':'+_0x1c71b4);_0x33c193[_0x1517b7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x452dba[_0xcab9('0x22')]('\x22'+_0xe57045[_0xcab9('0x17')](';')+'\x22');}if(_0x122eae[_0xcab9('0x1f')]){handleError(_0x5d173d['data'][_0x210ed],{'code':_0xcab9('0x81'),'message':_0x122eae[_0xcab9('0x17')]()});}else{fs[_0xcab9('0x82')](_0x239ae2,_0x452dba['join']()+'\x0a');}_0x452dba=[];}if(!(stats['rows']%0xc8)){socket[_0xcab9('0x83')](_0xcab9('0x84')+_0x6b5d8b,stats);stats[_0xcab9('0x6f')]=[];}}if(stopped){logger['info'](_0xcab9('0x85'));_0x3e0ffc['abort']();}}catch(_0x4c84a9){handleError(_0x5d173d[_0xcab9('0x6d')][_0x210ed],{'code':_0xcab9('0x86'),'message':_0x4c84a9[_0xcab9('0x26')]});logger[_0xcab9('0x25')](_0xcab9('0x87'),_0x4c84a9['message']);}},'complete':function(){try{var _0x1812df=[];var _0x3f6f3e=tempTableName;_0x1812df['push'](_0xcab9('0x88')+_0x3f6f3e+'\x20LIKE\x20cm_contacts;');logger['info']('CIS\x20len',contactItemTypes[_0xcab9('0x1f')]);var _0x4b2af2=util['format'](_0xcab9('0x89'),_0x239ae2,_0x3f6f3e,_0x2bd9da,_0x38863f[_0xcab9('0x34')],_0x38863f['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x543ab3['scheduledat'])){_0x4b2af2+=_0xcab9('0x8a');}_0x1812df[_0xcab9('0x22')](_0x4b2af2);BPromise[_0xcab9('0x8b')](_0x1812df,handleQuery)['then'](function(_0x3380b4){BPromise[_0xcab9('0x23')]([handleAdditionalPhones()])[_0xcab9('0x24')](function(){_0x1812df=[];for(var _0x4696a0=0x0;_0x4696a0=_0x1abef8){return _0x286abd[_0x5952('0x13')](0x193)['json']({'message':util[_0x5952('0x14')](_0x5952('0x15'),_0x474ea0)});}_0x12cd04();})[_0x5952('0x16')](function(_0x209313){_0x12cd04(_0x209313);});});}function isUserLimit(){return isLimit(_0x5952('0x17'),0x1,db[_0x5952('0x18')],{'where':{'$or':[{'role':_0x5952('0x19')},{'role':_0x5952('0x1a')}]}});}exports[_0x5952('0x1b')]=isUserLimit; \ No newline at end of file +var _0xb7f4=['license','split','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1'];(function(_0x339c87,_0x1d3a50){var _0x4182c0=function(_0x3fc1d2){while(--_0x3fc1d2){_0x339c87['push'](_0x339c87['shift']());}};_0x4182c0(++_0x1d3a50);}(_0xb7f4,0x181));var _0x4b7f=function(_0x5aeec1,_0xa7ad9b){_0x5aeec1=_0x5aeec1-0x0;var _0xa0e935=_0xb7f4[_0x5aeec1];return _0xa0e935;};'use strict';var crypto=require(_0x4b7f('0x0'));var util=require('util');var compose=require(_0x4b7f('0x1'));var db=require(_0x4b7f('0x2'))['db'];var config=require(_0x4b7f('0x3'));function getValueFromLicense(_0x48f40b,_0x427037){if(_0x48f40b&&_0x427037){if(_0x427037[_0x4b7f('0x4')]&&_0x427037[_0x4b7f('0x5')]){var _0x18ac1d=_0x427037['data1'];var _0x48bf35=_0x427037[_0x4b7f('0x5')];var _0x5dcb72=_0x18ac1d[_0x4b7f('0x6')]('-')[0x4];var _0x39806c=_0x18ac1d[_0x4b7f('0x6')]('-')[0x0];var _0x54b313=crypto['createDecipher'](_0x4b7f('0x7'),util[_0x4b7f('0x8')](_0x4b7f('0x9'),_0x5dcb72,_0x18ac1d,_0x39806c));var _0x5868d2=_0x54b313['update'](_0x48bf35,_0x4b7f('0xa'),_0x4b7f('0xb'));_0x5868d2+=_0x54b313[_0x4b7f('0xc')](_0x4b7f('0xb'));var _0x3c43e5=JSON[_0x4b7f('0xd')](_0x5868d2);return _0x3c43e5[_0x4b7f('0xe')](_0x48f40b)?_0x3c43e5[_0x48f40b]:null;}}return null;}function isLimit(_0x3e2c57,_0x1c2e7e,_0x49952a,_0x353355){var _0x462d3e=_0x1c2e7e;return compose()[_0x4b7f('0xf')](function(_0xc6b5c1,_0x2aeb91,_0x127608){return db['License'][_0x4b7f('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x4b7f('0x11')](function(_0x109a6b){var _0x598df3=getValueFromLicense(_0x3e2c57,_0x109a6b);return _0x598df3?_0x598df3:_0x462d3e;})[_0x4b7f('0x11')](function(_0x34532f){_0x462d3e=_0x34532f;return _0x49952a[_0x4b7f('0x12')](_0x353355);})[_0x4b7f('0x11')](function(_0x921242){if(_0x921242>=_0x462d3e){return _0x2aeb91[_0x4b7f('0x13')](0x193)[_0x4b7f('0x14')]({'message':util[_0x4b7f('0x8')](_0x4b7f('0x15'),_0x3e2c57)});}_0x127608();})[_0x4b7f('0x16')](function(_0xd6b260){_0x127608(_0xd6b260);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x4b7f('0x17')],{'where':{'$or':[{'role':_0x4b7f('0x18')},{'role':'user'}]}});}exports[_0x4b7f('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 50c8272..f8c634e 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 _0x3dc3=['startsWith','and','replace','length','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','<\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','minutes','seconds','lodash','moment','parseSearch'];(function(_0x10d05d,_0x44ff10){var _0xad291e=function(_0x3814e5){while(--_0x3814e5){_0x10d05d['push'](_0x10d05d['shift']());}};_0xad291e(++_0x44ff10);}(_0x3dc3,0x13b));var _0x33dc=function(_0x2f381b,_0x4bc41c){_0x2f381b=_0x2f381b-0x0;var _0x367ffc=_0x3dc3[_0x2f381b];return _0x367ffc;};'use strict';var _=require(_0x33dc('0x0'));var moment=require(_0x33dc('0x1'));exports[_0x33dc('0x2')]=function(_0x51205e){var _0x26e3ff={'conditions':[]};_0x26e3ff['sqlOperator']=_[_0x33dc('0x3')](_0x51205e,'[$or]')?'or':_0x33dc('0x4');var _0x44ecd4=_0x51205e['replace']('[$and]','')[_0x33dc('0x5')]('[$or]','')['split']('||');for(var _0x52df38=0x0;_0x52df38<_0x44ecd4[_0x33dc('0x6')];_0x52df38++){var _0x5e4555=_0x44ecd4[_0x52df38][_0x33dc('0x7')](':=');var _0x359316=_0x5e4555[0x0];var _0x2f94ea=_0x5e4555[_0x33dc('0x8')](0x1);_0x2f94ea[_0x33dc('0x9')](function(_0x1312c1){var _0x5cafcc=_0x1312c1['split']('[')[_0x33dc('0xa')]();var _0x3a366f=_0x1312c1[_0x33dc('0xb')](/\[(.*?)\]/g);_0x3a366f[_0x33dc('0x9')](function(_0x51c23a){var _0x530297=_0x51c23a[_0x33dc('0x7')]('[')[_0x33dc('0xc')](function(_0x283de4){return _0x283de4[_0x33dc('0xd')](']')>-0x1;})[_0x33dc('0xe')](function(_0x4a58f5){return _0x4a58f5['split'](']')[0x0];})[0x0];_0x26e3ff[_0x33dc('0xf')][_0x33dc('0x10')]({'field':_0x359316,'operator':_0x5cafcc,'value':_0x530297});});});}return _0x26e3ff;};exports[_0x33dc('0x11')]=function(_0x561e59,_0x2d7ce2,_0x443fd8){var _0xcd1e12={};if(_0x2d7ce2===_0x33dc('0x12')){if(_0x443fd8[_0x33dc('0x13')]==='$eq'){_0x443fd8[_0x33dc('0x13')]=_0x33dc('0x14');_0x443fd8[_0x33dc('0x15')]+=','+_0x443fd8['value'];}else if(_[_0x33dc('0x16')]([_0x33dc('0x17'),_0x33dc('0x18')],_0x443fd8['operator'])){_0x443fd8[_0x33dc('0x15')]=moment(_0x443fd8[_0x33dc('0x15')])['add'](0x1,_0x33dc('0x19'))[_0x33dc('0x1a')](_0x33dc('0x1b'));}}if(_0x443fd8[_0x33dc('0x1c')]){_0x2d7ce2=_0x443fd8[_0x33dc('0x1c')];_0xcd1e12[_0x33dc('0x1d')]=_0x33dc('0x1e')+_0x561e59+'.'+_0x443fd8[_0x33dc('0x1f')]+'\x20AS\x20'+_0x443fd8[_0x33dc('0x1c')]+')\x20'+parseOperator(_0x443fd8[_0x33dc('0x13')]);}else{_0xcd1e12['text']=_0x561e59+'.'+_0x443fd8['field']+'\x20'+parseOperator(_0x443fd8[_0x33dc('0x13')]);}if(_['includes']([_0x33dc('0x20'),_0x33dc('0x21')],_0x443fd8[_0x33dc('0x13')]))_0xcd1e12[_0x33dc('0x1d')]='('+_0xcd1e12[_0x33dc('0x1d')]+_0x33dc('0x22')+_0x561e59+'.'+_0x443fd8[_0x33dc('0x1f')]+'\x20IS\x20NULL)';_0xcd1e12['value']=parseValue(_0x2d7ce2,_0x443fd8['operator'],_0x443fd8['value']);return _0xcd1e12;};function parseOperator(_0x969aad){var _0x50cce9;switch(_0x969aad){case _0x33dc('0x23'):_0x50cce9=_0x33dc('0x24');break;case'$notIn':_0x50cce9=_0x33dc('0x25');break;case _0x33dc('0x26'):_0x50cce9=_0x33dc('0x27');break;case _0x33dc('0x20'):_0x50cce9=_0x33dc('0x28');break;case _0x33dc('0x29'):case _0x33dc('0x2a'):case _0x33dc('0x2b'):_0x50cce9='LIKE\x20?';break;case'$lt':_0x50cce9=_0x33dc('0x2c');break;case _0x33dc('0x17'):_0x50cce9='>\x20?';break;case _0x33dc('0x18'):_0x50cce9='<=\x20?';break;case'$gte':_0x50cce9=_0x33dc('0x2d');break;case _0x33dc('0x14'):_0x50cce9=_0x33dc('0x2e');break;}return _0x50cce9;}function parseValue(_0x4870b2,_0x49e7fc,_0x30c9fa){var _0x4a51f1={'start':undefined,'end':undefined};switch(_0x49e7fc){case _0x33dc('0x23'):case'$notIn':_0x4a51f1[_0x33dc('0x2f')]=_0x30c9fa[_0x33dc('0x7')](',');break;case _0x33dc('0x29'):_0x4a51f1[_0x33dc('0x2f')]='%'+_0x30c9fa+'%';break;case'$startsWith':_0x4a51f1['start']=_0x30c9fa+'%';break;case _0x33dc('0x2b'):_0x4a51f1[_0x33dc('0x2f')]='%'+_0x30c9fa;break;case'$between':var _0x272e97=_0x30c9fa[_0x33dc('0x7')](',');var _0x30c9fa=_0x272e97[_0x33dc('0xa')]();var _0x6133d8=_0x272e97[_0x33dc('0x30')]();if(_0x4870b2==='DATE'){_0x30c9fa=moment(_0x30c9fa)['utcOffset'](0x0,!![])[_0x33dc('0x1a')]();_0x6133d8=moment(_0x6133d8)[_0x33dc('0x31')](0x0,!![])['add'](0x17,'hours')[_0x33dc('0x32')](0x3b,_0x33dc('0x33'))[_0x33dc('0x32')](0x3b,_0x33dc('0x34'))[_0x33dc('0x1a')]();}_0x4a51f1={'start':_0x30c9fa,'end':_0x6133d8};break;default:_0x4a51f1[_0x33dc('0x2f')]=_0x30c9fa;break;}return _0x4a51f1;} \ No newline at end of file +var _0xc590=['$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','forEach','shift','match','filter','indexOf','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xc590,0x169));var _0x0c59=function(_0x13991e,_0x3bd56d){_0x13991e=_0x13991e-0x0;var _0x2ee864=_0xc590[_0x13991e];return _0x2ee864;};'use strict';var _=require(_0x0c59('0x0'));var moment=require(_0x0c59('0x1'));exports[_0x0c59('0x2')]=function(_0x41c003){var _0x24ea35={'conditions':[]};_0x24ea35[_0x0c59('0x3')]=_[_0x0c59('0x4')](_0x41c003,'[$or]')?'or':_0x0c59('0x5');var _0x3d0a07=_0x41c003[_0x0c59('0x6')](_0x0c59('0x7'),'')['replace'](_0x0c59('0x8'),'')['split']('||');for(var _0x357cbf=0x0;_0x357cbf<_0x3d0a07['length'];_0x357cbf++){var _0x4ce97a=_0x3d0a07[_0x357cbf][_0x0c59('0x9')](':=');var _0x35fc55=_0x4ce97a[0x0];var _0x3bf15e=_0x4ce97a['slice'](0x1);_0x3bf15e[_0x0c59('0xa')](function(_0x2a43e9){var _0x11b316=_0x2a43e9[_0x0c59('0x9')]('[')[_0x0c59('0xb')]();var _0x11059d=_0x2a43e9[_0x0c59('0xc')](/\[(.*?)\]/g);_0x11059d[_0x0c59('0xa')](function(_0x56500e){var _0x58d691=_0x56500e[_0x0c59('0x9')]('[')[_0x0c59('0xd')](function(_0x4386a7){return _0x4386a7[_0x0c59('0xe')](']')>-0x1;})['map'](function(_0x1b4fad){return _0x1b4fad[_0x0c59('0x9')](']')[0x0];})[0x0];_0x24ea35[_0x0c59('0xf')][_0x0c59('0x10')]({'field':_0x35fc55,'operator':_0x11b316,'value':_0x58d691});});});}return _0x24ea35;};exports[_0x0c59('0x11')]=function(_0x2bf212,_0x331960,_0x379c4a){var _0xc6a0de={};if(_0x331960===_0x0c59('0x12')){if(_0x379c4a[_0x0c59('0x13')]===_0x0c59('0x14')){_0x379c4a[_0x0c59('0x13')]=_0x0c59('0x15');_0x379c4a[_0x0c59('0x16')]+=','+_0x379c4a[_0x0c59('0x16')];}else if(_[_0x0c59('0x17')]([_0x0c59('0x18'),_0x0c59('0x19')],_0x379c4a[_0x0c59('0x13')])){_0x379c4a[_0x0c59('0x16')]=moment(_0x379c4a[_0x0c59('0x16')])[_0x0c59('0x1a')](0x1,_0x0c59('0x1b'))[_0x0c59('0x1c')](_0x0c59('0x1d'));}}if(_0x379c4a[_0x0c59('0x1e')]){_0x331960=_0x379c4a['castTo'];_0xc6a0de[_0x0c59('0x1f')]=_0x0c59('0x20')+_0x2bf212+'.'+_0x379c4a[_0x0c59('0x21')]+'\x20AS\x20'+_0x379c4a['castTo']+')\x20'+parseOperator(_0x379c4a['operator']);}else{_0xc6a0de[_0x0c59('0x1f')]=_0x2bf212+'.'+_0x379c4a[_0x0c59('0x21')]+'\x20'+parseOperator(_0x379c4a[_0x0c59('0x13')]);}if(_[_0x0c59('0x17')]([_0x0c59('0x22'),_0x0c59('0x23')],_0x379c4a[_0x0c59('0x13')]))_0xc6a0de[_0x0c59('0x1f')]='('+_0xc6a0de[_0x0c59('0x1f')]+_0x0c59('0x24')+_0x2bf212+'.'+_0x379c4a[_0x0c59('0x21')]+_0x0c59('0x25');_0xc6a0de['value']=parseValue(_0x331960,_0x379c4a[_0x0c59('0x13')],_0x379c4a[_0x0c59('0x16')]);return _0xc6a0de;};function parseOperator(_0x130aa0){var _0x34c453;switch(_0x130aa0){case _0x0c59('0x26'):_0x34c453=_0x0c59('0x27');break;case'$notIn':_0x34c453='NOT\x20IN\x20?';break;case'$eq':_0x34c453=_0x0c59('0x28');break;case _0x0c59('0x22'):_0x34c453=_0x0c59('0x29');break;case _0x0c59('0x2a'):case'$startsWith':case _0x0c59('0x2b'):_0x34c453=_0x0c59('0x2c');break;case _0x0c59('0x2d'):_0x34c453='<\x20?';break;case _0x0c59('0x18'):_0x34c453=_0x0c59('0x2e');break;case'$lte':_0x34c453=_0x0c59('0x2f');break;case'$gte':_0x34c453=_0x0c59('0x30');break;case _0x0c59('0x15'):_0x34c453=_0x0c59('0x31');break;}return _0x34c453;}function parseValue(_0x37d764,_0x54d26c,_0x5a524e){var _0x196c57={'start':undefined,'end':undefined};switch(_0x54d26c){case _0x0c59('0x26'):case'$notIn':_0x196c57[_0x0c59('0x32')]=_0x5a524e[_0x0c59('0x9')](',');break;case _0x0c59('0x2a'):_0x196c57[_0x0c59('0x32')]='%'+_0x5a524e+'%';break;case _0x0c59('0x33'):_0x196c57['start']=_0x5a524e+'%';break;case _0x0c59('0x2b'):_0x196c57[_0x0c59('0x32')]='%'+_0x5a524e;break;case _0x0c59('0x15'):var _0x55d253=_0x5a524e[_0x0c59('0x9')](',');var _0x5a524e=_0x55d253[_0x0c59('0xb')]();var _0x42a843=_0x55d253['pop']();if(_0x37d764===_0x0c59('0x12')){_0x5a524e=moment(_0x5a524e)['utcOffset'](0x0,!![])[_0x0c59('0x1c')]();_0x42a843=moment(_0x42a843)[_0x0c59('0x34')](0x0,!![])[_0x0c59('0x1a')](0x17,_0x0c59('0x35'))[_0x0c59('0x1a')](0x3b,'minutes')[_0x0c59('0x1a')](0x3b,_0x0c59('0x36'))[_0x0c59('0x1c')]();}_0x196c57={'start':_0x5a524e,'end':_0x42a843};break;default:_0x196c57[_0x0c59('0x32')]=_0x5a524e;break;}return _0x196c57;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 12042b3..aa31424 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 _0x032e=['isEmpty','forOwn','find','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','map','indexOf','priority','cast','unsigned','substr','DESC','col','length','omit','isObject','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','query','$id','intersection','model','attributes','nolimit','offset','order','sort','pick','object','filter','where','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','includes','fields','split','filters'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0x032e,0x124));var _0xe032=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x032e[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xe032('0x0'));var sequelize=require('sequelize');var moment=require(_0xe032('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1cf95c){var _0x5ca562=['ne'];try{var _0x4afba2=JSON[_0xe032('0x2')](_0x1cf95c);var _0x2ce001=Object[_0xe032('0x3')](_0x4afba2)[0x0];return _0x5ca562[_0xe032('0x4')](_0x2ce001);}catch(_0x306f3d){return![];}}function getOperatorValue(_0x420020){var _0x2ba8a0=JSON[_0xe032('0x2')](_0x420020);var _0x37432f=Object[_0xe032('0x3')](_0x2ba8a0)[0x0];var _0x3289b0=_0x2ba8a0[_0x37432f];return{['$'+_0x37432f]:_0x3289b0};}exports[_0xe032('0x5')]=function(_0xaf3907){var _0x3b0ef8=null;if(_0xaf3907){_0x3b0ef8=_0xaf3907[_0xe032('0x6')](',');}return _0x3b0ef8;};exports[_0xe032('0x7')]=function(_0x2dc9e5,_0x167bd9){var _0x4aec53={};if(!_[_0xe032('0x8')](_0x2dc9e5)){_[_0xe032('0x9')](_0x2dc9e5,function(_0x13c126,_0x42e2ba){try{if(_0x167bd9){var _0x244f93=_[_0xe032('0xa')](_0x167bd9,{'name':_0x42e2ba})||{};if(hasSequelizeOperator(_0x13c126)){_0x4aec53[_0x42e2ba]=getOperatorValue(_0x13c126);}else if(_0x244f93[_0xe032('0xb')]==='DATE'&&_[_0xe032('0xc')](_0x13c126)){var _0x266d71=JSON[_0xe032('0x2')](_0x13c126);var _0x1a53ab={'$gte':moment(moment(_0x266d71['$gte'])[_0xe032('0xd')](_0xe032('0xe')))[_0xe032('0xf')]()[_0xe032('0xd')](),'$lte':moment(moment(_0x266d71[_0xe032('0x10')])[_0xe032('0xd')](_0xe032('0xe')))['utc']()[_0xe032('0x11')](0x1,'s')[_0xe032('0xd')]()};_0x4aec53[_0x42e2ba]=_0x1a53ab;}else if(_0x244f93[_0xe032('0x12')]===_0xe032('0x13')){_0x4aec53[_0x42e2ba]=_0x13c126;}else{_0x4aec53[_0x42e2ba]=_[_0xe032('0x14')](_0x13c126)?_0x13c126:JSON[_0xe032('0x2')](_0x13c126);}}else{_0x4aec53[_0x42e2ba]=_['isArray'](_0x13c126)?_0x13c126:JSON[_0xe032('0x2')](_0x13c126);}}catch(_0x25cedb){_0x4aec53[_0x42e2ba]=_0x13c126[_0xe032('0x6')](',');}});}return _0x4aec53;};exports[_0xe032('0x15')]=function(_0x208c47){_0x208c47=parseInt(_0x208c47,0xa);if(!_0x208c47||_0x208c47<0x0){_0x208c47=LIMIT_VALUE;}return _0x208c47;};exports['offset']=function(_0x4b644b){_0x4b644b=parseInt(_0x4b644b,0xa);if(!_0x4b644b||_0x4b644b<0x0){_0x4b644b=0x0;}return _0x4b644b;};exports['sort']=function(_0x15475c){var _0x505d8c,_0x46dc27=null;if(_0x15475c){_0x505d8c=_0x15475c[_0xe032('0x6')](',');_0x46dc27=_[_0xe032('0x16')](_0x505d8c,function(_0x2aa342){if(_0x2aa342[_0xe032('0x17')]('-')===0x0){return[_0x2aa342===_0xe032('0x18')?sequelize[_0xe032('0x19')](sequelize['col'](_0xe032('0x18')),_0xe032('0x1a')):_0x2aa342[_0xe032('0x1b')](0x1),_0xe032('0x1c')];}else{return[_0x2aa342===_0xe032('0x18')?sequelize[_0xe032('0x19')](sequelize[_0xe032('0x1d')](_0xe032('0x18')),'unsigned'):_0x2aa342,'ASC'];}});}return _0x46dc27;};exports['omit']=function(_0x4ef536,_0x2568ce){if(_[_0xe032('0x8')](_0x4ef536)){return _0x4ef536;}if(_[_0xe032('0x14')](_0x4ef536)){for(var _0x2bfe8f=0x0;_0x2bfe8f<_0x4ef536[_0xe032('0x1e')];_0x2bfe8f+=0x1){_0x4ef536[_0x2bfe8f]=this[_0xe032('0x1f')](_0x4ef536[_0x2bfe8f],_0x2568ce);}return _0x4ef536;}if(!_[_0xe032('0x20')](_0x4ef536)){return _0x4ef536;}if(_[_0xe032('0x21')](_0x2568ce)){_0x2568ce=[_0x2568ce];}if(!_[_0xe032('0x14')](_0x2568ce)){return _0x4ef536;}for(var _0x5bb36a=0x0;_0x5bb36a<_0x2568ce[_0xe032('0x1e')];_0x5bb36a+=0x1){_[_0xe032('0x22')](_0x4ef536,_0x2568ce[_0x5bb36a]);}for(var _0x3106aa in _0x4ef536){if(_0x4ef536[_0xe032('0x23')](_0x3106aa)){_0x4ef536[_0x3106aa]=this['omit'](_0x4ef536[_0x3106aa],_0x2568ce);}}return _0x4ef536;};exports['isNumeric']=function(_0x3e2575){return _0x3e2575[_0xe032('0x24')](RegExp(_0xe032('0x25')))?!![]:![];};exports[_0xe032('0x26')]=function(_0x4e8b72){return _0x4e8b72['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x42ec95){var _0x1dd34f=[];_0x42ec95[_0xe032('0x6')](/[ ,]+/)[_0xe032('0x27')](function(_0x50db2d){_0x50db2d=_0x50db2d[_0xe032('0x28')](/([^:]")"+/g,'$1');_0x50db2d='+'+_0x50db2d+'*';var _0x236da9=/[ `!@#$%^&*()_\-?~]/;if(_0x50db2d[_0xe032('0x24')](_0x236da9))_0x50db2d='\x22'+_0x50db2d+'\x22';_0x1dd34f[_0xe032('0x29')](_0x50db2d);});return _0x1dd34f[_0xe032('0x2a')]('\x20');};exports['getOptions']=function(_0xd90bd5,_0x33634c,_0x319a2f){var _0x2cc18c={},_0x522bdc={};if(_0x33634c[_0xe032('0x2b')]['$id']){_0x33634c[_0xe032('0x2b')]['id']=_0x33634c['query'][_0xe032('0x2c')];delete _0x33634c['query'][_0xe032('0x2c')];}_0x2cc18c['model']=_[_0xe032('0x16')](_0xd90bd5,_0xe032('0x12'));_0x2cc18c['query']=_[_0xe032('0x3')](_0x33634c[_0xe032('0x2b')]);_0x2cc18c[_0xe032('0x7')]=_[_0xe032('0x2d')](_0x2cc18c['model'],_0x2cc18c[_0xe032('0x2b')]);_0x522bdc['attributes']=_[_0xe032('0x2d')](_0x2cc18c[_0xe032('0x2e')],this['fields'](_0x33634c[_0xe032('0x2b')][_0xe032('0x5')]));_0x522bdc['attributes']=_0x522bdc[_0xe032('0x2f')][_0xe032('0x1e')]?_0x522bdc[_0xe032('0x2f')]:_0x2cc18c[_0xe032('0x2e')];if(!_0x33634c[_0xe032('0x2b')][_0xe032('0x23')](_0xe032('0x30'))){_0x522bdc[_0xe032('0x15')]=this[_0xe032('0x15')](_0x33634c[_0xe032('0x2b')][_0xe032('0x15')]);_0x522bdc[_0xe032('0x31')]=this[_0xe032('0x31')](_0x33634c[_0xe032('0x2b')][_0xe032('0x31')]);}_0x522bdc[_0xe032('0x32')]=this[_0xe032('0x33')](_0x33634c['query'][_0xe032('0x33')]);_0x522bdc['where']=this[_0xe032('0x7')](_[_0xe032('0x34')](_0x33634c[_0xe032('0x2b')],_0x2cc18c[_0xe032('0x7')]),_0xd90bd5);if(_0x33634c[_0xe032('0x2b')]['filter']){var _0x132d25=_0xd90bd5;var _0x55688b=_0x33634c[_0xe032('0x2b')]['filter'];if(typeof _0x55688b===_0xe032('0x35')){_0x132d25=_[_0xe032('0x36')](_0xd90bd5,function(_0x2644a1){return _[_0xe032('0x4')](_0x55688b['columns'],_0x2644a1[_0xe032('0x12')]);});_0x55688b=_0x55688b['value'];}_0x522bdc[_0xe032('0x37')]=_[_0xe032('0x38')](_0x522bdc[_0xe032('0x37')],{'$or':_[_0xe032('0x16')](_0x132d25,function(_0x4b58eb){if(_0x4b58eb['type']!==_0xe032('0x39')){if(_0x319a2f){return sequelize[_0xe032('0x37')](sequelize['fn']('lower',sequelize[_0xe032('0x1d')](_0x4b58eb[_0xe032('0x12')])),{'$like':sequelize['fn'](_0xe032('0x3a'),'%'+_0x33634c[_0xe032('0x2b')][_0xe032('0x36')]+'%')});}else{var _0x4dafef={};_0x4dafef[_0x4b58eb[_0xe032('0x12')]]={'$like':'%'+_0x33634c[_0xe032('0x2b')][_0xe032('0x36')]+'%'};return _0x4dafef;}}})});}_0x522bdc=_[_0xe032('0x38')]({},_0x522bdc,_0x33634c[_0xe032('0x3b')]);return _0x522bdc;}; \ No newline at end of file +var _0x3831=['unsigned','DESC','ASC','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','intersection','model','attributes','nolimit','offset','order','where','filter','object','value','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col'];(function(_0x3e38fb,_0x3b9176){var _0x54cb5a=function(_0x25e3e4){while(--_0x25e3e4){_0x3e38fb['push'](_0x3e38fb['shift']());}};_0x54cb5a(++_0x3b9176);}(_0x3831,0x14c));var _0x1383=function(_0x1f3681,_0x43cf48){_0x1f3681=_0x1f3681-0x0;var _0x4911fd=_0x3831[_0x1f3681];return _0x4911fd;};'use strict';var _=require(_0x1383('0x0'));var sequelize=require('sequelize');var moment=require(_0x1383('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x42a46a){var _0x3a25fd=['ne'];try{var _0x15e6b5=JSON[_0x1383('0x2')](_0x42a46a);var _0x580d3d=Object[_0x1383('0x3')](_0x15e6b5)[0x0];return _0x3a25fd['includes'](_0x580d3d);}catch(_0x21ea2c){return![];}}function getOperatorValue(_0x53b708){var _0x5b64b1=JSON['parse'](_0x53b708);var _0x45a030=Object['keys'](_0x5b64b1)[0x0];var _0x187027=_0x5b64b1[_0x45a030];return{['$'+_0x45a030]:_0x187027};}exports[_0x1383('0x4')]=function(_0x2e9a5b){var _0x266bde=null;if(_0x2e9a5b){_0x266bde=_0x2e9a5b[_0x1383('0x5')](',');}return _0x266bde;};exports[_0x1383('0x6')]=function(_0x3ca0e6,_0xe0ee2f){var _0x47ba84={};if(!_[_0x1383('0x7')](_0x3ca0e6)){_[_0x1383('0x8')](_0x3ca0e6,function(_0x627ec3,_0xb11599){try{if(_0xe0ee2f){var _0x3675cb=_['find'](_0xe0ee2f,{'name':_0xb11599})||{};if(hasSequelizeOperator(_0x627ec3)){_0x47ba84[_0xb11599]=getOperatorValue(_0x627ec3);}else if(_0x3675cb[_0x1383('0x9')]===_0x1383('0xa')&&_[_0x1383('0xb')](_0x627ec3)){var _0x48c107=JSON['parse'](_0x627ec3);var _0x32e302={'$gte':moment(moment(_0x48c107[_0x1383('0xc')])[_0x1383('0xd')](_0x1383('0xe')))[_0x1383('0xf')]()[_0x1383('0xd')](),'$lte':moment(moment(_0x48c107[_0x1383('0x10')])[_0x1383('0xd')]('YYYY-MM-DD'))[_0x1383('0xf')]()[_0x1383('0x11')](0x1,'s')[_0x1383('0xd')]()};_0x47ba84[_0xb11599]=_0x32e302;}else if(_0x3675cb[_0x1383('0x12')]===_0x1383('0x13')){_0x47ba84[_0xb11599]=_0x627ec3;}else{_0x47ba84[_0xb11599]=_[_0x1383('0x14')](_0x627ec3)?_0x627ec3:JSON[_0x1383('0x2')](_0x627ec3);}}else{_0x47ba84[_0xb11599]=_['isArray'](_0x627ec3)?_0x627ec3:JSON['parse'](_0x627ec3);}}catch(_0x2301a6){_0x47ba84[_0xb11599]=_0x627ec3['split'](',');}});}return _0x47ba84;};exports[_0x1383('0x15')]=function(_0x5b3705){_0x5b3705=parseInt(_0x5b3705,0xa);if(!_0x5b3705||_0x5b3705<0x0){_0x5b3705=LIMIT_VALUE;}return _0x5b3705;};exports['offset']=function(_0x4d854f){_0x4d854f=parseInt(_0x4d854f,0xa);if(!_0x4d854f||_0x4d854f<0x0){_0x4d854f=0x0;}return _0x4d854f;};exports[_0x1383('0x16')]=function(_0x598d09){var _0x2aa3b6,_0x57a840=null;if(_0x598d09){_0x2aa3b6=_0x598d09[_0x1383('0x5')](',');_0x57a840=_[_0x1383('0x17')](_0x2aa3b6,function(_0xca314){if(_0xca314[_0x1383('0x18')]('-')===0x0){return[_0xca314===_0x1383('0x19')?sequelize[_0x1383('0x1a')](sequelize[_0x1383('0x1b')](_0x1383('0x19')),_0x1383('0x1c')):_0xca314['substr'](0x1),_0x1383('0x1d')];}else{return[_0xca314===_0x1383('0x19')?sequelize[_0x1383('0x1a')](sequelize[_0x1383('0x1b')](_0x1383('0x19')),_0x1383('0x1c')):_0xca314,_0x1383('0x1e')];}});}return _0x57a840;};exports['omit']=function(_0x5c4658,_0x1d24b7){if(_[_0x1383('0x7')](_0x5c4658)){return _0x5c4658;}if(_[_0x1383('0x14')](_0x5c4658)){for(var _0x3b158d=0x0;_0x3b158d<_0x5c4658[_0x1383('0x1f')];_0x3b158d+=0x1){_0x5c4658[_0x3b158d]=this['omit'](_0x5c4658[_0x3b158d],_0x1d24b7);}return _0x5c4658;}if(!_['isObject'](_0x5c4658)){return _0x5c4658;}if(_['isString'](_0x1d24b7)){_0x1d24b7=[_0x1d24b7];}if(!_[_0x1383('0x14')](_0x1d24b7)){return _0x5c4658;}for(var _0x128628=0x0;_0x128628<_0x1d24b7[_0x1383('0x1f')];_0x128628+=0x1){_[_0x1383('0x20')](_0x5c4658,_0x1d24b7[_0x128628]);}for(var _0x5866a1 in _0x5c4658){if(_0x5c4658[_0x1383('0x21')](_0x5866a1)){_0x5c4658[_0x5866a1]=this['omit'](_0x5c4658[_0x5866a1],_0x1d24b7);}}return _0x5c4658;};exports[_0x1383('0x22')]=function(_0xf0037f){return _0xf0037f[_0x1383('0x23')](RegExp(_0x1383('0x24')))?!![]:![];};exports[_0x1383('0x25')]=function(_0x15a3c4){return _0x15a3c4[_0x1383('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x1383('0x26')]=function(_0x1e91e7){var _0x29ca05=[];_0x1e91e7[_0x1383('0x5')](/[ ,]+/)[_0x1383('0x27')](function(_0x370bea){_0x370bea=_0x370bea[_0x1383('0x28')](/([^:]")"+/g,'$1');_0x370bea='+'+_0x370bea+'*';var _0x4c5810=/[ `!@#$%^&*()_\-?~]/;if(_0x370bea[_0x1383('0x23')](_0x4c5810))_0x370bea='\x22'+_0x370bea+'\x22';_0x29ca05[_0x1383('0x29')](_0x370bea);});return _0x29ca05[_0x1383('0x2a')]('\x20');};exports[_0x1383('0x2b')]=function(_0x64c8ce,_0x307ad7,_0x52b5b8){var _0x4522f5={},_0x12111e={};if(_0x307ad7[_0x1383('0x2c')][_0x1383('0x2d')]){_0x307ad7[_0x1383('0x2c')]['id']=_0x307ad7[_0x1383('0x2c')]['$id'];delete _0x307ad7[_0x1383('0x2c')]['$id'];}_0x4522f5['model']=_[_0x1383('0x17')](_0x64c8ce,_0x1383('0x12'));_0x4522f5[_0x1383('0x2c')]=_['keys'](_0x307ad7['query']);_0x4522f5['filters']=_[_0x1383('0x2e')](_0x4522f5[_0x1383('0x2f')],_0x4522f5[_0x1383('0x2c')]);_0x12111e['attributes']=_['intersection'](_0x4522f5[_0x1383('0x2f')],this[_0x1383('0x4')](_0x307ad7[_0x1383('0x2c')][_0x1383('0x4')]));_0x12111e['attributes']=_0x12111e['attributes'][_0x1383('0x1f')]?_0x12111e[_0x1383('0x30')]:_0x4522f5[_0x1383('0x2f')];if(!_0x307ad7[_0x1383('0x2c')][_0x1383('0x21')](_0x1383('0x31'))){_0x12111e[_0x1383('0x15')]=this['limit'](_0x307ad7[_0x1383('0x2c')]['limit']);_0x12111e[_0x1383('0x32')]=this[_0x1383('0x32')](_0x307ad7[_0x1383('0x2c')]['offset']);}_0x12111e[_0x1383('0x33')]=this['sort'](_0x307ad7['query'][_0x1383('0x16')]);_0x12111e[_0x1383('0x34')]=this[_0x1383('0x6')](_['pick'](_0x307ad7[_0x1383('0x2c')],_0x4522f5[_0x1383('0x6')]),_0x64c8ce);if(_0x307ad7[_0x1383('0x2c')][_0x1383('0x35')]){var _0x56c269=_0x64c8ce;var _0x1ea73e=_0x307ad7['query']['filter'];if(typeof _0x1ea73e===_0x1383('0x36')){_0x56c269=_[_0x1383('0x35')](_0x64c8ce,function(_0x524eaf){return _['includes'](_0x1ea73e['columns'],_0x524eaf[_0x1383('0x12')]);});_0x1ea73e=_0x1ea73e[_0x1383('0x37')];}_0x12111e[_0x1383('0x34')]=_[_0x1383('0x38')](_0x12111e[_0x1383('0x34')],{'$or':_[_0x1383('0x17')](_0x56c269,function(_0x12d58d){if(_0x12d58d[_0x1383('0x9')]!==_0x1383('0x39')){if(_0x52b5b8){return sequelize['where'](sequelize['fn'](_0x1383('0x3a'),sequelize[_0x1383('0x1b')](_0x12d58d[_0x1383('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x307ad7[_0x1383('0x2c')]['filter']+'%')});}else{var _0x2bc288={};_0x2bc288[_0x12d58d[_0x1383('0x12')]]={'$like':'%'+_0x307ad7[_0x1383('0x2c')][_0x1383('0x35')]+'%'};return _0x2bc288;}}})});}_0x12111e=_[_0x1383('0x38')]({},_0x12111e,_0x307ad7[_0x1383('0x3b')]);return _0x12111e;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 76180d8..dbe440b 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _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(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 e5652d7..87895cf 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 _0xd695=['win32','dmidecode\x20--string\x20system-uuid','utf8','macAddress','ipAddress','update','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','keys','length','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','join','md5','platform','licenseToken'];(function(_0x3c50d1,_0x2ffa34){var _0x450ac6=function(_0x56acfe){while(--_0x56acfe){_0x3c50d1['push'](_0x3c50d1['shift']());}};_0x450ac6(++_0x2ffa34);}(_0xd695,0x68));var _0x5d69=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xd695[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0x5d69('0x0'));var os=require('os');var crypto=require(_0x5d69('0x1'));var machine=require(_0x5d69('0x2'));var exec=require(_0x5d69('0x3'))[_0x5d69('0x4')];var config=require('../environment');function getInterfaces(){var _0x66de00=[];var _0x43890b=os['networkInterfaces']();var _0x1ef4a9=_['orderBy'](_[_0x5d69('0x5')](_0x43890b));for(var _0x3aeb1b=0x0;_0x3aeb1b<_0x1ef4a9[_0x5d69('0x6')];_0x3aeb1b++){var _0xa94930=_0x43890b[_0x1ef4a9[_0x3aeb1b]][_0x5d69('0x7')](function(_0x361518){return _0x361518[_0x5d69('0x8')]===_0x5d69('0x9')&&_0x361518['internal']===![];});_0x66de00=_0x66de00[_0x5d69('0xa')](_0xa94930);}return _0x66de00;}function getFirstInterface(){var _0x3c4e8e=_[_0x5d69('0xb')](getInterfaces());return{'macAddress':_0x3c4e8e&&_0x3c4e8e[_0x5d69('0xc')]?_0x3c4e8e[_0x5d69('0xc')]:_0x5d69('0xd'),'ipAddress':_0x3c4e8e&&_0x3c4e8e[_0x5d69('0xe')]?_0x3c4e8e['address']:_0x5d69('0xf')};}exports[_0x5d69('0x10')]=getFirstInterface;function getCPUhash(){var _0x284041=_[_0x5d69('0x11')](os[_0x5d69('0x12')]()[_0x5d69('0x13')](function(_0x17bd27){return _0x17bd27['model'];}))[_0x5d69('0x14')](':');return crypto['createHash'](_0x5d69('0x15'))['update'](_0x284041)['digest']('hex');}exports['getUuid']=function(){var _0x148f98=os[_0x5d69('0x16')]();var _0x419025=/[0-9a-f-]{36}/;if(config[_0x5d69('0x17')]&&_0x419025['test'](config[_0x5d69('0x17')])){return config[_0x5d69('0x17')];}else if(_0x148f98===_0x5d69('0x18')){return exec(_0x5d69('0x19'),{'encoding':_0x5d69('0x1a')})['replace']('\x0d\x0a','');}else{var _0x26efda=getFirstInterface();var _0xd0b68=getCPUhash();var _0x29c1a8=_0xd0b68+'|'+os['hostname']()+'|'+_0x26efda[_0x5d69('0x1b')]+'|'+_0x26efda[_0x5d69('0x1c')];var _0x3932d4=crypto['createHash'](_0x5d69('0x15'))[_0x5d69('0x1d')](_0x29c1a8)['digest'](_0x5d69('0x1e'));return _0x3932d4[_0x5d69('0x1f')](0x0,0x8)+'-'+_0x3932d4[_0x5d69('0x1f')](0x8,0xc)+'-'+_0x3932d4[_0x5d69('0x1f')](0xc,0x10)+'-'+_0x3932d4[_0x5d69('0x1f')](0x10,0x14)+'-'+_0x3932d4[_0x5d69('0x1f')](0x14);}}; \ No newline at end of file +var _0x8df4=['digest','hex','substring','lodash','crypto','child_process','networkInterfaces','orderBy','length','filter','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','createHash','md5','update','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname'];(function(_0x191ccc,_0x5c6113){var _0x32b3cd=function(_0x2ae80f){while(--_0x2ae80f){_0x191ccc['push'](_0x191ccc['shift']());}};_0x32b3cd(++_0x5c6113);}(_0x8df4,0x83));var _0x48df=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x8df4[_0x9a3e0f];return _0x3d2a9a;};'use strict';var _=require(_0x48df('0x0'));var os=require('os');var crypto=require(_0x48df('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x48df('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0xc5a474=[];var _0x244ae8=os[_0x48df('0x3')]();var _0xf85478=_[_0x48df('0x4')](_['keys'](_0x244ae8));for(var _0x43a640=0x0;_0x43a640<_0xf85478[_0x48df('0x5')];_0x43a640++){var _0x49fbb5=_0x244ae8[_0xf85478[_0x43a640]][_0x48df('0x6')](function(_0x249a25){return _0x249a25['family']==='IPv4'&&_0x249a25[_0x48df('0x7')]===![];});_0xc5a474=_0xc5a474[_0x48df('0x8')](_0x49fbb5);}return _0xc5a474;}function getFirstInterface(){var _0x3a456f=_[_0x48df('0x9')](getInterfaces());return{'macAddress':_0x3a456f&&_0x3a456f['mac']?_0x3a456f[_0x48df('0xa')]:_0x48df('0xb'),'ipAddress':_0x3a456f&&_0x3a456f[_0x48df('0xc')]?_0x3a456f[_0x48df('0xc')]:_0x48df('0xd')};}exports[_0x48df('0xe')]=getFirstInterface;function getCPUhash(){var _0x32406b=_['orderBy'](os['cpus']()[_0x48df('0xf')](function(_0xa077a7){return _0xa077a7[_0x48df('0x10')];}))['join'](':');return crypto[_0x48df('0x11')](_0x48df('0x12'))[_0x48df('0x13')](_0x32406b)['digest']('hex');}exports[_0x48df('0x14')]=function(){var _0x43d7eb=os[_0x48df('0x15')]();var _0x309ab3=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x309ab3[_0x48df('0x16')](config['licenseToken'])){return config[_0x48df('0x17')];}else if(_0x43d7eb===_0x48df('0x18')){return exec(_0x48df('0x19'),{'encoding':_0x48df('0x1a')})[_0x48df('0x1b')]('\x0d\x0a','');}else{var _0x59052c=getFirstInterface();var _0x176ec3=getCPUhash();var _0x74f446=_0x176ec3+'|'+os[_0x48df('0x1c')]()+'|'+_0x59052c['macAddress']+'|'+_0x59052c['ipAddress'];var _0x5dd909=crypto[_0x48df('0x11')](_0x48df('0x12'))[_0x48df('0x13')](_0x74f446)[_0x48df('0x1d')](_0x48df('0x1e'));return _0x5dd909[_0x48df('0x1f')](0x0,0x8)+'-'+_0x5dd909['substring'](0x8,0xc)+'-'+_0x5dd909[_0x48df('0x1f')](0xc,0x10)+'-'+_0x5dd909[_0x48df('0x1f')](0x10,0x14)+'-'+_0x5dd909[_0x48df('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 59ab4a6..0fe14b7 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 _0x56c3=['then','catch','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x19afce,_0x4a8cba){var _0x50c253=function(_0x3a6946){while(--_0x3a6946){_0x19afce['push'](_0x19afce['shift']());}};_0x50c253(++_0x4a8cba);}(_0x56c3,0x11e));var _0x356c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56c3[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x356c('0x0'));var moment=require(_0x356c('0x1'));var rp=require(_0x356c('0x2'));var BPromise=require(_0x356c('0x3'));var pkginfo=require(_0x356c('0x4'))(module,_0x356c('0x5'));var db=require(_0x356c('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x356c('0x7'))('license');var HOST=_0x356c('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x51bc64){return new BPromise(function(_0x4cdc5a,_0x47747c){var _0x2a33ff=util[_0x356c('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x51bc64,module['exports'][_0x356c('0x5')]);if(oldToken){_0x2a33ff=util['format'](_0x356c('0xa'),HOST,_0x51bc64,module['exports']['version'],oldToken);}var _0x22e577={'uri':_0x2a33ff,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x22e577)[_0x356c('0xb')](function(_0x1ec703){_0x4cdc5a(_0x1ec703);})[_0x356c('0xc')](function(_0x15d683){_0x47747c(_0x15d683);});});}function manageLicense(_0x1edc92,_0x5c351e){var _0x21066a=_0x5c351e['get']({'plain':!![]});if(!isOldTokenSent&&_0x21066a['data1']!==_0x1edc92&&!_0x21066a[_0x356c('0xd')]){oldToken=_0x21066a['data1'];}httpRequest(_0x1edc92)[_0x356c('0xb')](function(_0x4c669b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4c669b[_0x356c('0xe')]){isOldTokenSent=![];if(!_0x21066a[_0x356c('0xf')]&&_0x21066a[_0x356c('0xf')]!=_0x4c669b[_0x356c('0xf')]||_0x21066a['license']&&_0x21066a[_0x356c('0xd')]){logger[_0x356c('0x10')](_0x356c('0x11'));}if(_0x21066a[_0x356c('0xf')]&&!_0x21066a['data2']&&_0x21066a[_0x356c('0xf')]!=_0x4c669b['license']){logger[_0x356c('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x21066a[_0x356c('0xf')]&&!_0x21066a[_0x356c('0xd')]&&_0x21066a[_0x356c('0xf')]==_0x4c669b[_0x356c('0xf')]){return _0x5c351e;}return _0x5c351e[_0x356c('0x12')]({'data1':_0x1edc92,'data2':null,'license':_0x4c669b['license']});}else{if(_0x4c669b[_0x356c('0xf')]||_0x21066a[_0x356c('0xf')]){if(!_0x21066a[_0x356c('0xd')]){if(_0x21066a[_0x356c('0x13')]==_0x1edc92){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x356c('0x10')](_0x356c('0x14'),_0x21066a[_0x356c('0x13')],_0x1edc92);}logger[_0x356c('0x10')](_0x356c('0x15'),GRAY_PERIOD_REASON[_0x356c('0x16')](),moment()[_0x356c('0x9')](_0x356c('0x17')));return _0x5c351e[_0x356c('0x12')]({'data2':encryptor[_0x356c('0x18')](moment()[_0x356c('0x9')](_0x356c('0x17')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x21066a[_0x356c('0xd')]),'days')>DAYS){logger[_0x356c('0x10')]('DEMO\x20START\x20AT\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x5c351e['update']({'data1':_0x1edc92,'data2':null,'license':null});}}}else{if(_0x21066a[_0x356c('0x13')]!=_0x1edc92){logger[_0x356c('0x10')](_0x356c('0x14'),_0x21066a[_0x356c('0x13')],_0x1edc92);return _0x5c351e[_0x356c('0x12')]({'data1':_0x1edc92,'data2':null,'license':null});}}}return _0x5c351e;})[_0x356c('0xb')](function(_0x30a6f){_0x5c351e=_0x30a6f;})['catch'](function(_0x33c621){logger[_0x356c('0x19')](_0x33c621[_0x356c('0x1a')]);})[_0x356c('0x1b')](function(){setTimeout(function(){manageLicense(hardware[_0x356c('0x1c')](),_0x5c351e);},TIME);});}function defaultLicense(){var _0x4d5d24=hardware[_0x356c('0x1c')]();if(_0x4d5d24){return db[_0x356c('0x1d')][_0x356c('0x1e')]({'where':{'id':0x1},'defaults':{'data1':_0x4d5d24}})[_0x356c('0x1f')](function(_0x4e787c,_0x344d79){logger[_0x356c('0x10')](_0x356c('0x20'),_0x4d5d24);manageLicense(_0x4d5d24,_0x4e787c);})[_0x356c('0xc')](function(_0x2b753d){logger[_0x356c('0x19')](_0x2b753d['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xd2c9=['getUuid','License','findOrCreate','spread','default','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2c9,0x124));var _0x9d2c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2c9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var moment=require(_0x9d2c('0x0'));var rp=require(_0x9d2c('0x1'));var BPromise=require(_0x9d2c('0x2'));var pkginfo=require(_0x9d2c('0x3'))(module,_0x9d2c('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x9d2c('0x5'));var hardware=require(_0x9d2c('0x6'));var logger=require(_0x9d2c('0x7'))(_0x9d2c('0x8'));var HOST=_0x9d2c('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x28c684){return new BPromise(function(_0x4939ff,_0x2408ef){var _0x1f0706=util[_0x9d2c('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x28c684,module[_0x9d2c('0xb')][_0x9d2c('0x4')]);if(oldToken){_0x1f0706=util[_0x9d2c('0xa')](_0x9d2c('0xc'),HOST,_0x28c684,module[_0x9d2c('0xb')][_0x9d2c('0x4')],oldToken);}var _0x143145={'uri':_0x1f0706,'method':_0x9d2c('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x143145)[_0x9d2c('0xe')](function(_0x505a01){_0x4939ff(_0x505a01);})[_0x9d2c('0xf')](function(_0x10eb72){_0x2408ef(_0x10eb72);});});}function manageLicense(_0x2b6758,_0x2f890c){var _0x51b0b4=_0x2f890c[_0x9d2c('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x51b0b4[_0x9d2c('0x11')]!==_0x2b6758&&!_0x51b0b4['data2']){oldToken=_0x51b0b4['data1'];}httpRequest(_0x2b6758)[_0x9d2c('0xe')](function(_0x3854ed){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3854ed[_0x9d2c('0x12')]){isOldTokenSent=![];if(!_0x51b0b4[_0x9d2c('0x8')]&&_0x51b0b4[_0x9d2c('0x8')]!=_0x3854ed[_0x9d2c('0x8')]||_0x51b0b4[_0x9d2c('0x8')]&&_0x51b0b4[_0x9d2c('0x13')]){logger[_0x9d2c('0x14')](_0x9d2c('0x15'));}if(_0x51b0b4[_0x9d2c('0x8')]&&!_0x51b0b4['data2']&&_0x51b0b4[_0x9d2c('0x8')]!=_0x3854ed[_0x9d2c('0x8')]){logger[_0x9d2c('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x51b0b4[_0x9d2c('0x8')]&&!_0x51b0b4[_0x9d2c('0x13')]&&_0x51b0b4['license']==_0x3854ed['license']){return _0x2f890c;}return _0x2f890c[_0x9d2c('0x16')]({'data1':_0x2b6758,'data2':null,'license':_0x3854ed['license']});}else{if(_0x3854ed[_0x9d2c('0x8')]||_0x51b0b4[_0x9d2c('0x8')]){if(!_0x51b0b4[_0x9d2c('0x13')]){if(_0x51b0b4[_0x9d2c('0x11')]==_0x2b6758){GRAY_PERIOD_REASON=_0x9d2c('0x17');logger[_0x9d2c('0x14')](_0x9d2c('0x18'));}else{GRAY_PERIOD_REASON=_0x9d2c('0x19');logger[_0x9d2c('0x14')](_0x9d2c('0x1a'),_0x51b0b4[_0x9d2c('0x11')],_0x2b6758);}logger[_0x9d2c('0x14')](_0x9d2c('0x1b'),GRAY_PERIOD_REASON[_0x9d2c('0x1c')](),moment()[_0x9d2c('0xa')](_0x9d2c('0x1d')));return _0x2f890c[_0x9d2c('0x16')]({'data2':encryptor['encryptString'](moment()[_0x9d2c('0xa')](_0x9d2c('0x1d')))});}else{if(moment()[_0x9d2c('0x1e')](encryptor['decryptString'](_0x51b0b4[_0x9d2c('0x13')]),_0x9d2c('0x1f'))>DAYS){logger[_0x9d2c('0x14')](_0x9d2c('0x20'),moment()[_0x9d2c('0xa')](_0x9d2c('0x1d')));isOldTokenSent=![];return _0x2f890c[_0x9d2c('0x16')]({'data1':_0x2b6758,'data2':null,'license':null});}}}else{if(_0x51b0b4[_0x9d2c('0x11')]!=_0x2b6758){logger[_0x9d2c('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x51b0b4[_0x9d2c('0x11')],_0x2b6758);return _0x2f890c[_0x9d2c('0x16')]({'data1':_0x2b6758,'data2':null,'license':null});}}}return _0x2f890c;})[_0x9d2c('0xe')](function(_0x1bcf57){_0x2f890c=_0x1bcf57;})[_0x9d2c('0xf')](function(_0xa24e38){logger[_0x9d2c('0x21')](_0xa24e38[_0x9d2c('0x22')]);})[_0x9d2c('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x2f890c);},TIME);});}function defaultLicense(){var _0x3492cf=hardware[_0x9d2c('0x24')]();if(_0x3492cf){return db[_0x9d2c('0x25')][_0x9d2c('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x3492cf}})[_0x9d2c('0x27')](function(_0x3ed6f8,_0x367ca3){logger[_0x9d2c('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3492cf);manageLicense(_0x3492cf,_0x3ed6f8);})[_0x9d2c('0xf')](function(_0x1c6bae){logger[_0x9d2c('0x21')](_0x1c6bae['message']);});}}exports[_0x9d2c('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b8323c6..f92efb6 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 _0xfedd=['days','grayReason','message','then','role','sequelize','col','count','admin','user','telephone','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','defaults','catch','uuid','data1','License\x20key\x20value\x20not\x20found','data2','decryptString','format','%s:%s:%s','demo','machineUuid','getUuid','gray','deadline','add'];(function(_0x43a0da,_0x47dde0){var _0x57a161=function(_0x1d23e3){while(--_0x1d23e3){_0x43a0da['push'](_0x43a0da['shift']());}};_0x57a161(++_0x47dde0);}(_0xfedd,0x113));var _0xdfed=function(_0x2a53d1,_0x4b893b){_0x2a53d1=_0x2a53d1-0x0;var _0x32c319=_0xfedd[_0x2a53d1];return _0x32c319;};'use strict';var util=require(_0xdfed('0x0'));var _=require('lodash');var moment=require(_0xdfed('0x1'));var BPromise=require(_0xdfed('0x2'));var hardware=require(_0xdfed('0x3'));var encryptor=require(_0xdfed('0x4'));var db=require(_0xdfed('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdfed('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdfed('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdfed('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdfed('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x542200){return new BPromise(function(_0x32d66f,_0x51f2ff){return db[_0xdfed('0x9')][_0xdfed('0xa')](_[_0xdfed('0xb')](_0x542200,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x281304){return checkLicense(_0x281304,null);})['then'](function(_0x16bfa0){_0x32d66f(_0x16bfa0);return;})[_0xdfed('0xc')](function(_0x509d66){_0x51f2ff(_0x509d66);});});}function checkLicense(_0xa9be0f,_0x21e6fd){if(!_0xa9be0f){demoLicense[_0xdfed('0xd')]=_0xa9be0f[_0xdfed('0xe')];return demoLicense;}try{var _0x17e496=_0x21e6fd||_0xa9be0f['license'];if(_['isEmpty'](_0x17e496)){throw new Error(_0xdfed('0xf'));}var _0x3d4d77=_0xa9be0f[_0xdfed('0xe')];var _0x3cb4cd=_0xa9be0f[_0xdfed('0x10')];var _0x2e1361=_0x3d4d77['split']('-')[0x4];var _0x16d146=_0x3d4d77['split']('-')[0x0];var _0x178e8a=encryptor[_0xdfed('0x11')](_0x17e496,util[_0xdfed('0x12')](_0xdfed('0x13'),_0x2e1361,_0x3d4d77,_0x16d146));var _0x210791=JSON['parse'](_0x178e8a);_0x210791[_0xdfed('0x14')]=![];_0x210791[_0xdfed('0xd')]=_0x3d4d77;_0x210791[_0xdfed('0x15')]=hardware[_0xdfed('0x16')]();if(_0x3cb4cd){var _0x5e8d42=encryptor['decryptString'](_0x3cb4cd);_0x210791[_0xdfed('0x17')]=_0x5e8d42;_0x210791[_0xdfed('0x18')]=moment(_0x5e8d42)[_0xdfed('0x19')](0x7,_0xdfed('0x1a'))[_0xdfed('0x12')]();_0x210791[_0xdfed('0x1b')]=_0x210791[_0xdfed('0xd')]!=_0x210791[_0xdfed('0x15')]?'changed':'disabled';}return _0x210791;}catch(_0xff5f40){breakingLicense[_0xdfed('0xd')]=_0xa9be0f[_0xdfed('0xe')];breakingLicense[_0xdfed('0x1c')]=_0xff5f40[_0xdfed('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3e87f6,_0x119842){getLicense()[_0xdfed('0x1d')](function(_0x4135a2){return db['User']['findAll']({'attributes':[_0xdfed('0x1e'),[db[_0xdfed('0x1f')]['fn']('COUNT',db[_0xdfed('0x1f')][_0xdfed('0x20')]('role')),_0xdfed('0x21')]],'group':_0xdfed('0x1e'),'where':{'role':{'$or':[_0xdfed('0x22'),_0xdfed('0x23'),_0xdfed('0x24')]}},'raw':!![]})['then'](function(_0xaec75d){var _0x1d0db0={'user':_0x4135a2['users']||0x0,'telephone':_0x4135a2[_0xdfed('0x25')]||0x0};_0xaec75d[_0xdfed('0x26')](function(_0x25bc8f){var _0x487613=_0x25bc8f[_0xdfed('0x1e')]===_0xdfed('0x22')?'user':_0x25bc8f[_0xdfed('0x1e')];_0x1d0db0[_0x487613]-=_0x25bc8f['count'];if(_0x1d0db0[_0x487613]<0x0)_0x1d0db0[_0x487613]=0x0;});_0x3e87f6(_0x1d0db0);return;});})[_0xdfed('0xc')](function(_0x5aa0ee){_0x119842(_0x5aa0ee);});});}function checkUserLimits(_0x3ac25e){return new BPromise(function(_0xc07818,_0x1eadc0){getLimits()[_0xdfed('0x1d')](function(_0x5bc0c5){var _0x259413=_['pick'](_[_0xdfed('0x27')](_0x3ac25e,_0xdfed('0x1e')),[_0xdfed('0x22'),_0xdfed('0x23'),_0xdfed('0x24')]);var _0x2f85f5=(_0x259413[_0xdfed('0x22')]||0x0)+(_0x259413['user']||0x0);var _0x417517=_0x259413[_0xdfed('0x24')]||0x0;if(_0x2f85f5>_0x5bc0c5[_0xdfed('0x23')])return _0x1eadc0(_0xdfed('0x28'));if(_0x417517>_0x5bc0c5[_0xdfed('0x24')])return _0x1eadc0(_0xdfed('0x29'));return _0xc07818();})['catch'](function(_0x3ac1e0){_0x1eadc0(_0x3ac1e0);});});}module[_0xdfed('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x139b=['parse','demo','machineUuid','gray','add','grayReason','message','User','findAll','role','sequelize','col','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','catch','exports','util','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults','then','uuid','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s'];(function(_0x387ae1,_0x115984){var _0x5ba459=function(_0x4ef97c){while(--_0x4ef97c){_0x387ae1['push'](_0x387ae1['shift']());}};_0x5ba459(++_0x115984);}(_0x139b,0xef));var _0xb139=function(_0x335956,_0xd86aec){_0x335956=_0x335956-0x0;var _0x533ec1=_0x139b[_0x335956];return _0x533ec1;};'use strict';var util=require(_0xb139('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xb139('0x1'));var hardware=require(_0xb139('0x2'));var encryptor=require(_0xb139('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb139('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb139('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xb139('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x351415){return new BPromise(function(_0x24fa01,_0x18f572){return db[_0xb139('0x6')][_0xb139('0x7')](_[_0xb139('0x8')](_0x351415,{'raw':!![],'where':{'id':0x1}}))[_0xb139('0x9')](function(_0x2855cd){return checkLicense(_0x2855cd,null);})[_0xb139('0x9')](function(_0x464809){_0x24fa01(_0x464809);return;})['catch'](function(_0x5204c4){_0x18f572(_0x5204c4);});});}function checkLicense(_0xe9d1af,_0x5672bb){if(!_0xe9d1af){demoLicense[_0xb139('0xa')]=_0xe9d1af['data1'];return demoLicense;}try{var _0x3b5683=_0x5672bb||_0xe9d1af['license'];if(_[_0xb139('0xb')](_0x3b5683)){throw new Error(_0xb139('0xc'));}var _0x2888bb=_0xe9d1af[_0xb139('0xd')];var _0x3ad6c2=_0xe9d1af[_0xb139('0xe')];var _0x3c6cd3=_0x2888bb[_0xb139('0xf')]('-')[0x4];var _0x18e053=_0x2888bb[_0xb139('0xf')]('-')[0x0];var _0x2467c4=encryptor[_0xb139('0x10')](_0x3b5683,util[_0xb139('0x11')](_0xb139('0x12'),_0x3c6cd3,_0x2888bb,_0x18e053));var _0x1ce551=JSON[_0xb139('0x13')](_0x2467c4);_0x1ce551[_0xb139('0x14')]=![];_0x1ce551[_0xb139('0xa')]=_0x2888bb;_0x1ce551[_0xb139('0x15')]=hardware[_0xb139('0x5')]();if(_0x3ad6c2){var _0x304525=encryptor[_0xb139('0x10')](_0x3ad6c2);_0x1ce551[_0xb139('0x16')]=_0x304525;_0x1ce551['deadline']=moment(_0x304525)[_0xb139('0x17')](0x7,'days')[_0xb139('0x11')]();_0x1ce551[_0xb139('0x18')]=_0x1ce551[_0xb139('0xa')]!=_0x1ce551[_0xb139('0x15')]?'changed':'disabled';}return _0x1ce551;}catch(_0x3c0e06){breakingLicense[_0xb139('0xa')]=_0xe9d1af['data1'];breakingLicense[_0xb139('0x19')]=_0x3c0e06['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xa5114f,_0x46c278){getLicense()[_0xb139('0x9')](function(_0x1a3b49){return db[_0xb139('0x1a')][_0xb139('0x1b')]({'attributes':[_0xb139('0x1c'),[db[_0xb139('0x1d')]['fn']('COUNT',db[_0xb139('0x1d')][_0xb139('0x1e')]('role')),'count']],'group':_0xb139('0x1c'),'where':{'role':{'$or':[_0xb139('0x1f'),_0xb139('0x20'),_0xb139('0x21')]}},'raw':!![]})[_0xb139('0x9')](function(_0xe604bb){var _0x1221a2={'user':_0x1a3b49[_0xb139('0x22')]||0x0,'telephone':_0x1a3b49['telephones']||0x0};_0xe604bb[_0xb139('0x23')](function(_0x32b9d7){var _0x6d3ad3=_0x32b9d7[_0xb139('0x1c')]===_0xb139('0x1f')?_0xb139('0x20'):_0x32b9d7[_0xb139('0x1c')];_0x1221a2[_0x6d3ad3]-=_0x32b9d7[_0xb139('0x24')];if(_0x1221a2[_0x6d3ad3]<0x0)_0x1221a2[_0x6d3ad3]=0x0;});_0xa5114f(_0x1221a2);return;});})['catch'](function(_0x5e7bbe){_0x46c278(_0x5e7bbe);});});}function checkUserLimits(_0x49365d){return new BPromise(function(_0x5538fd,_0x5de217){getLimits()[_0xb139('0x9')](function(_0x366a52){var _0x2977ea=_[_0xb139('0x25')](_[_0xb139('0x26')](_0x49365d,_0xb139('0x1c')),[_0xb139('0x1f'),_0xb139('0x20'),_0xb139('0x21')]);var _0x4cbf58=(_0x2977ea[_0xb139('0x1f')]||0x0)+(_0x2977ea[_0xb139('0x20')]||0x0);var _0x29fe47=_0x2977ea[_0xb139('0x21')]||0x0;if(_0x4cbf58>_0x366a52[_0xb139('0x20')])return _0x5de217(_0xb139('0x27'));if(_0x29fe47>_0x366a52[_0xb139('0x21')])return _0x5de217(_0xb139('0x28'));return _0x5538fd();})[_0xb139('0x29')](function(_0x85689c){_0x5de217(_0x85689c);});});}module[_0xb139('0x2a')]={'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 0400326..3376327 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 _0x4325=['app-id','secret','exports','http://localhost:9000'];(function(_0x320f22,_0x488293){var _0x281311=function(_0x5088e9){while(--_0x5088e9){_0x320f22['push'](_0x320f22['shift']());}};_0x281311(++_0x488293);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';module[_0x5432('0x0')]={'DOMAIN':_0x5432('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x5432('0x2'),'GOOGLE_SECRET':_0x5432('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x0598=['http://localhost:9000','app-id','exports'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x0598,0x92));var _0x8059=function(_0x1c59b9,_0x4bd448){_0x1c59b9=_0x1c59b9-0x0;var _0xc1de97=_0x0598[_0x1c59b9];return _0xc1de97;};'use strict';module[_0x8059('0x0')]={'DOMAIN':_0x8059('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8059('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b7d592f..e7e56aa 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacae=['fileLogger','exports','../utils/loggers'];(function(_0x468180,_0x5d2a29){var _0x1f243b=function(_0x1a992e){while(--_0x1a992e){_0x468180['push'](_0x468180['shift']());}};_0x1f243b(++_0x5d2a29);}(_0xacae,0x176));var _0xeaca=function(_0xe2af4b,_0x350664){_0xe2af4b=_0xe2af4b-0x0;var _0x2a5b63=_0xacae[_0xe2af4b];return _0x2a5b63;};'use strict';var fileLogger=require(_0xeaca('0x0'))[_0xeaca('0x1')];module[_0xeaca('0x2')]=fileLogger; \ No newline at end of file +var _0x1bbc=['../utils/loggers','fileLogger','exports'];(function(_0x5b05d0,_0x5165c3){var _0x311f10=function(_0x3a891f){while(--_0x3a891f){_0x5b05d0['push'](_0x5b05d0['shift']());}};_0x311f10(++_0x5165c3);}(_0x1bbc,0x141));var _0xc1bb=function(_0x1361c4,_0x4f0d6f){_0x1361c4=_0x1361c4-0x0;var _0x2bac71=_0x1bbc[_0x1361c4];return _0x2bac71;};'use strict';var fileLogger=require(_0xc1bb('0x0'))[_0xc1bb('0x1')];module[_0xc1bb('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 2ee291a..923dcb9 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 _0x37de=['../../services/routing/index.js','xdr','exports','path','express','join','../../services/express/index.js','../../services/agi/index.js','routing'];(function(_0x3e3c7a,_0x381151){var _0x25436a=function(_0x44f95c){while(--_0x44f95c){_0x3e3c7a['push'](_0x3e3c7a['shift']());}};_0x25436a(++_0x381151);}(_0x37de,0xed));var _0xe37d=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x37de[_0x297c55];return _0x120389;};'use strict';var path=require(_0xe37d('0x0'));var os=require('os');var config={'apps':[{'name':_0xe37d('0x1'),'script':path[_0xe37d('0x2')](__dirname,_0xe37d('0x3'))},{'name':'ami','script':path[_0xe37d('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0xe37d('0x2')](__dirname,_0xe37d('0x4'))},{'name':'email','script':path[_0xe37d('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xe37d('0x5'),'script':path[_0xe37d('0x2')](__dirname,_0xe37d('0x6'))},{'name':_0xe37d('0x7'),'script':path[_0xe37d('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xe37d('0x8')]=config; \ No newline at end of file +var _0x4a7a=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','xdr','../../services/xdr/index.js','path'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x4a7a,0xef));var _0xa4a7=function(_0x463e45,_0x1ff35f){_0x463e45=_0x463e45-0x0;var _0x172e49=_0x4a7a[_0x463e45];return _0x172e49;};'use strict';var path=require(_0xa4a7('0x0'));var os=require('os');var config={'apps':[{'name':_0xa4a7('0x1'),'script':path[_0xa4a7('0x2')](__dirname,_0xa4a7('0x3'))},{'name':_0xa4a7('0x4'),'script':path[_0xa4a7('0x2')](__dirname,_0xa4a7('0x5'))},{'name':'agi','script':path['join'](__dirname,_0xa4a7('0x6'))},{'name':_0xa4a7('0x7'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':'routing','script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0xa4a7('0x8'),'script':path[_0xa4a7('0x2')](__dirname,_0xa4a7('0x9'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 733d49a..27d90e7 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 _0x8eb5=['connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x8eb5,0x1a0));var _0x58eb=function(_0x5a67ed,_0x1fd23e){_0x5a67ed=_0x5a67ed-0x0;var _0x48b29f=_0x8eb5[_0x5a67ed];return _0x48b29f;};'use strict';var pm2=require(_0x58eb('0x0'));var BPromise=require(_0x58eb('0x1'));var config=require(_0x58eb('0x2'));function connect(){return new BPromise(function(_0x5ee371,_0x586eb1){return pm2[_0x58eb('0x3')](function(_0x5950e4){if(_0x5950e4){return _0x586eb1(_0x5950e4);}return _0x5ee371(_0x58eb('0x4'));});});};exports[_0x58eb('0x5')]=function(_0xd70684){return connect()[_0x58eb('0x6')](function(){return new BPromise(function(_0x1be2a8,_0x4af632){return pm2[_0x58eb('0x5')](_0xd70684,function(_0x53beaf,_0x322dee){if(_0x53beaf){return _0x4af632(_0x53beaf);}pm2[_0x58eb('0x7')]();return _0x1be2a8(_0x322dee);});});});};exports[_0x58eb('0x8')]=function(_0x2fe4c8){return connect()[_0x58eb('0x6')](function(){return new BPromise(function(_0x4aac64,_0x375a4b){return pm2[_0x58eb('0x8')](_0x2fe4c8,function(_0x54deec,_0x53fdb6){if(_0x54deec){return _0x375a4b(_0x54deec);}pm2[_0x58eb('0x7')]();return _0x4aac64(_0x53fdb6);});});});};exports['restart']=function(_0x1a5c05){return connect()[_0x58eb('0x6')](function(){return new BPromise(function(_0x1f48f4,_0x5b5653){return pm2[_0x58eb('0x9')](_0x1a5c05,function(_0x383d11,_0x55b74f){if(_0x383d11){return _0x5b5653(_0x383d11);}pm2[_0x58eb('0x7')]();return _0x1f48f4(_0x55b74f);});});});};exports[_0x58eb('0xa')]=function(){return connect()[_0x58eb('0x6')](function(){return new BPromise(function(_0x1ba0dc,_0x397219){return pm2[_0x58eb('0xa')](function(_0xf56365,_0x2365c8){if(_0xf56365){return _0x397219(_0xf56365);}pm2[_0x58eb('0x7')]();return _0x1ba0dc(_0x2365c8);});});});};exports[_0x58eb('0xb')]=function(_0x299152){return connect()[_0x58eb('0x6')](function(){return new BPromise(function(_0x14841e,_0x2267b5){return pm2[_0x58eb('0xb')](_0x299152,function(_0x30a245,_0x4c47a9){if(_0x30a245){return _0x2267b5(_0x30a245);}pm2[_0x58eb('0x7')]();return _0x14841e(_0x4c47a9);});});});};exports[_0x58eb('0xc')]=function(_0x4397bd){return connect()[_0x58eb('0x6')](function(){return new BPromise(function(_0x6ee922,_0x55dbc9){return pm2[_0x58eb('0xc')](_0x4397bd,function(_0x1da24e,_0x355464){if(_0x1da24e){return _0x55dbc9(_0x1da24e);}pm2[_0x58eb('0x7')]();return _0x6ee922(_0x355464);});});});};exports[_0x58eb('0xd')]=function(){return connect()[_0x58eb('0x6')](function(){return new BPromise(function(_0x2f26ab,_0x57f95c){return pm2[_0x58eb('0xd')](function(_0x4b5ecb){if(_0x4b5ecb){return _0x57f95c(_0x4b5ecb);}return _0x2f26ab(_0x58eb('0xe'));});});});}; \ No newline at end of file +var _0xbe3f=['start','then','stop','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connect','connected'];(function(_0x304d8e,_0xa96091){var _0x1f3758=function(_0xce06ec){while(--_0xce06ec){_0x304d8e['push'](_0x304d8e['shift']());}};_0x1f3758(++_0xa96091);}(_0xbe3f,0x88));var _0xfbe3=function(_0x196801,_0x1112e9){_0x196801=_0x196801-0x0;var _0x2478b2=_0xbe3f[_0x196801];return _0x2478b2;};'use strict';var pm2=require('pm2');var BPromise=require(_0xfbe3('0x0'));var config=require(_0xfbe3('0x1'));function connect(){return new BPromise(function(_0x342ff9,_0x392bf9){return pm2[_0xfbe3('0x2')](function(_0x2ec5b3){if(_0x2ec5b3){return _0x392bf9(_0x2ec5b3);}return _0x342ff9(_0xfbe3('0x3'));});});};exports[_0xfbe3('0x4')]=function(_0xfc97da){return connect()[_0xfbe3('0x5')](function(){return new BPromise(function(_0x252307,_0x2f0ba8){return pm2[_0xfbe3('0x4')](_0xfc97da,function(_0x42ac38,_0x2a8958){if(_0x42ac38){return _0x2f0ba8(_0x42ac38);}pm2['disconnect']();return _0x252307(_0x2a8958);});});});};exports[_0xfbe3('0x6')]=function(_0x12e7a7){return connect()[_0xfbe3('0x5')](function(){return new BPromise(function(_0x40e256,_0x111c42){return pm2[_0xfbe3('0x6')](_0x12e7a7,function(_0xd0ec0,_0x5ff1b4){if(_0xd0ec0){return _0x111c42(_0xd0ec0);}pm2[_0xfbe3('0x7')]();return _0x40e256(_0x5ff1b4);});});});};exports[_0xfbe3('0x8')]=function(_0x270d43){return connect()[_0xfbe3('0x5')](function(){return new BPromise(function(_0x3039c6,_0x1688dd){return pm2[_0xfbe3('0x8')](_0x270d43,function(_0x493fbc,_0x5c6567){if(_0x493fbc){return _0x1688dd(_0x493fbc);}pm2[_0xfbe3('0x7')]();return _0x3039c6(_0x5c6567);});});});};exports[_0xfbe3('0x9')]=function(){return connect()[_0xfbe3('0x5')](function(){return new BPromise(function(_0x3dd3d6,_0x52fadf){return pm2[_0xfbe3('0x9')](function(_0x24b7eb,_0x29e141){if(_0x24b7eb){return _0x52fadf(_0x24b7eb);}pm2['disconnect']();return _0x3dd3d6(_0x29e141);});});});};exports[_0xfbe3('0xa')]=function(_0x3eed1f){return connect()[_0xfbe3('0x5')](function(){return new BPromise(function(_0x5d844c,_0x7eebdb){return pm2[_0xfbe3('0xa')](_0x3eed1f,function(_0x1fab82,_0x33f541){if(_0x1fab82){return _0x7eebdb(_0x1fab82);}pm2['disconnect']();return _0x5d844c(_0x33f541);});});});};exports[_0xfbe3('0xb')]=function(_0x4f370d){return connect()[_0xfbe3('0x5')](function(){return new BPromise(function(_0x136b74,_0x51f0f3){return pm2[_0xfbe3('0xb')](_0x4f370d,function(_0x1fbe59,_0x1ca5df){if(_0x1fbe59){return _0x51f0f3(_0x1fbe59);}pm2[_0xfbe3('0x7')]();return _0x136b74(_0x1ca5df);});});});};exports[_0xfbe3('0xc')]=function(){return connect()[_0xfbe3('0x5')](function(){return new BPromise(function(_0x5b27b7,_0x42aa17){return pm2[_0xfbe3('0xc')](function(_0x1062ac){if(_0x1062ac){return _0x42aa17(_0x1062ac);}return _0x5b27b7(_0xfbe3('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7658500..6d726f6 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 _0x33ea=['lastMsgAt','subtract','chatTimeout','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','join','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','then','findAll'];(function(_0x5eaa7d,_0x4d9d8b){var _0x1a96fd=function(_0x4d6eb2){while(--_0x4d6eb2){_0x5eaa7d['push'](_0x5eaa7d['shift']());}};_0x1a96fd(++_0x4d9d8b);}(_0x33ea,0xe0));var _0xa33e=function(_0x20a440,_0x4e6b04){_0x20a440=_0x20a440-0x0;var _0x33f2e7=_0x33ea[_0x20a440];return _0x33f2e7;};'use strict';var _=require('lodash');var moment=require(_0xa33e('0x0'));var Redis=require('ioredis');var util=require(_0xa33e('0x1'));var config=require(_0xa33e('0x2'));var db=require(_0xa33e('0x3'))['db'];var logger=require(_0xa33e('0x4'))(_0xa33e('0x5'));config[_0xa33e('0x6')]=_[_0xa33e('0x7')](config[_0xa33e('0x6')],{'host':_0xa33e('0x8'),'port':0x18eb});var io=require(_0xa33e('0x9'))(new Redis(config[_0xa33e('0x6')]));function closeInteractions(){var _0x58e01f=0x0;var _0x5ba2cb=[];return db[_0xa33e('0xa')][_0xa33e('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xa33e('0xc')](function(_0xf228b5){_0x58e01f=_0xf228b5['chatTimeout'];if(_0x58e01f){return db['ChatInteraction'][_0xa33e('0xd')]({'raw':!![],'attributes':['id',_0xa33e('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa33e('0xf')](_0xf228b5[_0xa33e('0x10')],_0xa33e('0x11'))}}});}else{return[];}})[_0xa33e('0xc')](function(_0x2aa2e1){if(_0x2aa2e1&&_0x2aa2e1['length']){_0x5ba2cb=_[_0xa33e('0x12')](_0x2aa2e1||[],'id');logger[_0xa33e('0x13')](_0xa33e('0x14'),_0x5ba2cb['join']());return db[_0xa33e('0x15')][_0xa33e('0x16')]({'closeReason':'system','disposition':_0xa33e('0x17'),'closed':!![],'closedAt':moment()[_0xa33e('0x18')](_0xa33e('0x19'))},{'where':{'id':_0x5ba2cb}});}})[_0xa33e('0xc')](function(){if(_0x5ba2cb&&_0x5ba2cb[_0xa33e('0x1a')]){logger[_0xa33e('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x5ba2cb[_0xa33e('0x1b')]());for(var _0xf11107=0x0;_0xf11107<_0x5ba2cb[_0xa33e('0x1a')];_0xf11107++){io[_0xa33e('0x1c')](_0xa33e('0x1d'),{'id':_0x5ba2cb[_0xf11107],'closed':!![]});}}})['catch'](function(_0x54f62d){logger[_0xa33e('0x1e')](_0xa33e('0x1f'),_0x54f62d?util[_0xa33e('0x20')](_0x54f62d,{'showHidden':![],'depth':null}):'');});}exports[_0xa33e('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5b2e=['ChatInteraction','findAll','lastMsgAt','minutes','map','[CHAT]\x20Interactions\x20to\x20close:','join','format','YYYY-MM-DD\x20HH:mm:ss','length','info','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','ioredis','util','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','Setting','chatTimeout','then'];(function(_0x4bc17a,_0x2fe0d2){var _0x1bbe83=function(_0x44d405){while(--_0x44d405){_0x4bc17a['push'](_0x4bc17a['shift']());}};_0x1bbe83(++_0x2fe0d2);}(_0x5b2e,0xb9));var _0xe5b2=function(_0x5b475f,_0x5f4c93){_0x5b475f=_0x5b475f-0x0;var _0x397891=_0x5b2e[_0x5b475f];return _0x397891;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xe5b2('0x0'));var util=require(_0xe5b2('0x1'));var config=require(_0xe5b2('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xe5b2('0x3'))(_0xe5b2('0x4'));config[_0xe5b2('0x5')]=_['defaults'](config['redis'],{'host':_0xe5b2('0x6'),'port':0x18eb});var io=require(_0xe5b2('0x7'))(new Redis(config[_0xe5b2('0x5')]));function closeInteractions(){var _0x35637b=0x0;var _0x163b30=[];return db[_0xe5b2('0x8')]['find']({'raw':!![],'attributes':['id',_0xe5b2('0x9')],'where':{'id':0x1}})[_0xe5b2('0xa')](function(_0x32316f){_0x35637b=_0x32316f['chatTimeout'];if(_0x35637b){return db[_0xe5b2('0xb')][_0xe5b2('0xc')]({'raw':!![],'attributes':['id',_0xe5b2('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x32316f[_0xe5b2('0x9')],_0xe5b2('0xe'))}}});}else{return[];}})[_0xe5b2('0xa')](function(_0x3b6ff8){if(_0x3b6ff8&&_0x3b6ff8['length']){_0x163b30=_[_0xe5b2('0xf')](_0x3b6ff8||[],'id');logger['info'](_0xe5b2('0x10'),_0x163b30[_0xe5b2('0x11')]());return db[_0xe5b2('0xb')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xe5b2('0x12')](_0xe5b2('0x13'))},{'where':{'id':_0x163b30}});}})['then'](function(){if(_0x163b30&&_0x163b30[_0xe5b2('0x14')]){logger[_0xe5b2('0x15')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x163b30[_0xe5b2('0x11')]());for(var _0x421691=0x0;_0x421691<_0x163b30[_0xe5b2('0x14')];_0x421691++){io[_0xe5b2('0x16')](_0xe5b2('0x17'),{'id':_0x163b30[_0x421691],'closed':!![]});}}})[_0xe5b2('0x18')](function(_0x4619e1){logger[_0xe5b2('0x19')](_0xe5b2('0x1a'),_0x4619e1?util['inspect'](_0x4619e1,{'showHidden':![],'depth':null}):'');});}exports[_0xe5b2('0x1b')]=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 4d7732a..27a9719 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 _0x9d21=['exports','startAllRefreshIntervals'];(function(_0x28e71a,_0x4405bd){var _0x268fed=function(_0x404197){while(--_0x404197){_0x28e71a['push'](_0x28e71a['shift']());}};_0x268fed(++_0x4405bd);}(_0x9d21,0x177));var _0x19d2=function(_0x356107,_0x3bb13c){_0x356107=_0x356107-0x0;var _0x2f9d2b=_0x9d21[_0x356107];return _0x2f9d2b;};'use strict';function start(){var _0x89ccb6=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x89ccb6[_0x19d2('0x0')]();}module[_0x19d2('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xa1a7=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x1cc12c,_0x5d0b87){var _0x27123a=function(_0x46364e){while(--_0x46364e){_0x1cc12c['push'](_0x1cc12c['shift']());}};_0x27123a(++_0x5d0b87);}(_0xa1a7,0x9a));var _0x7a1a=function(_0x3977dc,_0x18499a){_0x3977dc=_0x3977dc-0x0;var _0x40e46e=_0xa1a7[_0x3977dc];return _0x40e46e;};'use strict';function start(){var _0x518623=require(_0x7a1a('0x0'));return _0x518623[_0x7a1a('0x1')]();}module[_0x7a1a('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index ccde8b5..424c015 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 _0x6911=['subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','catch','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','update','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','subtractNumber','join','savename','%s.%s','basename','zip','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','data','isNil'];(function(_0x364a36,_0x1e2677){var _0x5cd6fa=function(_0x58d692){while(--_0x58d692){_0x364a36['push'](_0x364a36['shift']());}};_0x5cd6fa(++_0x1e2677);}(_0x6911,0x1ec));var _0x1691=function(_0x578900,_0x4d9eb8){_0x578900=_0x578900-0x0;var _0x49b6e0=_0x6911[_0x578900];return _0x49b6e0;};'use strict';var fs=require('fs');var util=require(_0x1691('0x0'));var path=require(_0x1691('0x1'));var _=require(_0x1691('0x2'));var moment=require(_0x1691('0x3'));var CronJobManager=require(_0x1691('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x1691('0x5'));var logger=require(_0x1691('0x6'))(_0x1691('0x7'));var db=require(_0x1691('0x8'))['db'];var analyticCustomReportController=require(_0x1691('0x9'));var analyticDefaultReportController=require(_0x1691('0xa'));var client=jayson[_0x1691('0xb')][_0x1691('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x165b7d,_0x204464){return function(){logger[_0x1691('0xd')](_0x1691('0xe'),_0x165b7d[_0x1691('0xf')]);var _0x303a22=!![];var _0x38d94e=_0x165b7d[_0x1691('0x10')][_0x1691('0x11')]();var _0x1eb50a={'account':_0x38d94e,'message':{'from':util[_0x1691('0x12')](_0x1691('0x13'),_0x165b7d['MailAccount'][_0x1691('0x14')],_0x165b7d[_0x1691('0x10')][_0x1691('0xf')]||_0x165b7d[_0x1691('0x10')][_0x1691('0x15')][_0x1691('0x16')]),'to':_0x165b7d['email'],'cc':_0x165b7d['cc'],'bcc':_0x165b7d[_0x1691('0x17')],'subject':util[_0x1691('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x204464['name'],_0x165b7d[_0x1691('0x18')],_0x165b7d['subtractUnit'])}};var _0x171849=path[_0x1691('0x19')](__dirname,'../../files/reports');var _0x2c3213=_0x204464[_0x1691('0x1a')];var _0x67a86a=util[_0x1691('0x12')](_0x1691('0x1b'),path[_0x1691('0x1c')](_0x204464[_0x1691('0x1a')],path['extname'](_0x204464[_0x1691('0x1a')])),_0x1691('0x1d'));var _0x7fc177=path[_0x1691('0x19')](_0x171849,_0x2c3213);var _0x190920=path['join'](_0x171849,_0x67a86a);if(fs['existsSync'](_0x7fc177)){_0x204464[_0x1691('0x1e')]=_0x1691('0x1f');_0x1eb50a[_0x1691('0x20')]['attachments']=[{'filename':_0x2c3213,'path':_0x7fc177}];_0x1eb50a[_0x1691('0x20')][_0x1691('0x21')]=util[_0x1691('0x12')](_0x1691('0x22'),JSON['stringify'](_0x204464,null,0x2));}else if(fs[_0x1691('0x23')](_0x190920)){_0x204464['status']=_0x1691('0x1f');_0x1eb50a[_0x1691('0x20')][_0x1691('0x24')]=[{'filename':_0x67a86a,'path':_0x190920}];}else{_0x1eb50a[_0x1691('0x20')][_0x1691('0x21')]=_0x1691('0x25');if(!_0x165b7d[_0x1691('0x26')]){_0x303a22=![];logger[_0x1691('0xd')](_0x1691('0x27'));}}if(_0x303a22){return client[_0x1691('0x28')](_0x1691('0x29'),_0x1eb50a)[_0x1691('0x2a')](function(_0x225944){if(_0x225944[_0x1691('0x2b')]){return logger[_0x1691('0x2b')](_0x1691('0x2c'),JSON[_0x1691('0x2d')](_0x225944));}return logger[_0x1691('0xd')]('email\x20sent');})['catch'](function(_0x388464){return logger[_0x1691('0x2b')](_0x1691('0x2c'),JSON[_0x1691('0x2d')](_0x388464));});}};}function handleError(){return function(_0x3dff44){return logger[_0x1691('0x2b')](JSON[_0x1691('0x2d')](_0x3dff44));};}function handleResult(_0x5c712d){return function(_0x58a73c){logger[_0x1691('0xd')](_0x1691('0x2e'),JSON[_0x1691('0x2d')](_0x58a73c));if(_0x5c712d[_0x1691('0x10')]&&_0x5c712d[_0x1691('0x10')][_0x1691('0x15')]&&!_[_0x1691('0x2f')](_0x5c712d[_0x1691('0xf')])){setTimeout(handleSendEmail(_0x5c712d,_0x58a73c),0x3c*0x3e8);}};}function handleJob(_0xb145c8){return function(){try{if(_[_0x1691('0x2f')](_0xb145c8[_0x1691('0x18')])){return logger[_0x1691('0xd')](_0x1691('0x30'));}if(_[_0x1691('0x2f')](_0xb145c8[_0x1691('0x31')])){return logger[_0x1691('0xd')](_0x1691('0x32'));}var _0x37a925={'startDate':moment()[_0x1691('0x33')](_0xb145c8[_0x1691('0x18')],_0xb145c8[_0x1691('0x31')])[_0x1691('0x12')](_0x1691('0x34')),'endDate':moment()[_0x1691('0x12')](_0x1691('0x34')),'type':_0x1691('0x35'),'output':_0xb145c8[_0x1691('0x36')],'name':_0xb145c8[_0x1691('0x14')]};if(!_[_0x1691('0x2f')](_0xb145c8[_0x1691('0x37')])){logger[_0x1691('0xd')](_0x1691('0x38'),_0xb145c8[_0x1691('0x37')]);return analyticDefaultReportController[_0x1691('0x39')]({'id':_0xb145c8[_0x1691('0x37')]},_0x37a925)['then'](handleResult(_0xb145c8))['catch'](handleError());}if(!_[_0x1691('0x2f')](_0xb145c8[_0x1691('0x3a')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0xb145c8[_0x1691('0x3a')]);return analyticCustomReportController[_0x1691('0x39')]({'id':_0xb145c8['CustomReportId']},_0x37a925)[_0x1691('0x2a')](handleResult(_0xb145c8))[_0x1691('0x3b')](handleError());}}catch(_0x43ab77){logger[_0x1691('0x2b')](JSON['stringify'](_0x43ab77));}return logger['info'](_0x1691('0x3c'));};}function getJobs(_0x3c926c){var _0x5914cb={};if(_0x3c926c){_0x5914cb['id']=_0x3c926c;}return db[_0x1691('0x3d')][_0x1691('0x3e')]({'where':_0x5914cb,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x1691('0xf')],'include':[{'model':db[_0x1691('0x3f')],'as':_0x1691('0x15'),'include':[{'model':db[_0x1691('0x40')],'as':_0x1691('0x40')}]}]}]})['then'](function(_0x36a8c7){var _0x54fd6f=_[_0x1691('0x41')](manager[_0x1691('0x42')]);var _0xc4d869=_['map'](_0x36a8c7,function(_0x9ac734){return _0x9ac734['id'][_0x1691('0x43')]();});var _0x51edfe=_['keyBy'](_0x36a8c7,function(_0x39872b){return _0x39872b['id']['toString']();});var _0x56daef=_0x3c926c?_0xc4d869:_[_0x1691('0x44')](_0xc4d869,_0x54fd6f);var _0x22b862=_[_0x1691('0x45')](_0xc4d869,_0x54fd6f);var _0x51ea46=_[_0x1691('0x44')](_0x54fd6f,_0xc4d869);var _0x1fb534;var _0xea2e28;for(_0x1fb534=0x0;_0x1fb534<_0x51ea46[_0x1691('0x46')]&&!_0x3c926c;_0x1fb534+=0x1){_0xea2e28=_0x51ea46[_0x1fb534][_0x1691('0x43')]();if(manager[_0x1691('0x47')](_0xea2e28)){manager[_0x1691('0x48')](_0xea2e28);manager[_0x1691('0x49')](_0xea2e28);logger[_0x1691('0xd')](_0x1691('0x4a'),_0xea2e28);}}logger[_0x1691('0xd')](_0x1691('0x4b'),JSON[_0x1691('0x2d')](_0x56daef));for(_0x1fb534=0x0;_0x1fb534<_0x56daef[_0x1691('0x46')];_0x1fb534+=0x1){_0xea2e28=_0x56daef[_0x1fb534][_0x1691('0x43')]();logger[_0x1691('0xd')](_0x1691('0x4c'),_0xea2e28);if(_0x3c926c){logger['info'](_0x1691('0x4d'),_0x3c926c);logger[_0x1691('0xd')](JSON[_0x1691('0x2d')](_0x51edfe[_0xea2e28]));BPromise[_0x1691('0x4e')]()['then'](handleJob(_0x51edfe[_0xea2e28]));logger[_0x1691('0xd')](_0x1691('0x4f'),_0x51edfe[_0xea2e28][_0x1691('0x14')],_0x51edfe[_0xea2e28][_0x1691('0x50')]);}else if(_0x51edfe[_0xea2e28][_0x1691('0x50')]&&_0x51edfe[_0xea2e28][_0x1691('0x51')]&&moment()[_0x1691('0x52')](_0x51edfe[_0xea2e28][_0x1691('0x53')],_0x51edfe[_0xea2e28]['endAt'])){manager[_0x1691('0x54')](_0xea2e28,_0x51edfe[_0xea2e28]['cron'],handleJob(_0x51edfe[_0xea2e28]));manager[_0x1691('0x55')](_0xea2e28);logger[_0x1691('0xd')](_0x1691('0x56'),_0x51edfe[_0xea2e28][_0x1691('0x14')],_0x51edfe[_0xea2e28]['cron']);}else if(manager['exists'](_0xea2e28)){manager[_0x1691('0x48')](_0xea2e28);manager[_0x1691('0x49')](_0xea2e28);logger[_0x1691('0xd')](_0x1691('0x57'),_0x51edfe[_0xea2e28][_0x1691('0x14')],_0x51edfe[_0xea2e28][_0x1691('0x50')]);}}for(_0x1fb534=0x0,_0xea2e28;_0x1fb534<_0x22b862[_0x1691('0x46')]&&!_0x3c926c;_0x1fb534+=0x1){_0xea2e28=_0x22b862[_0x1fb534][_0x1691('0x43')]();if(manager[_0x1691('0x47')](_0xea2e28)){if(_0x51edfe[_0xea2e28][_0x1691('0x50')]&&_0x51edfe[_0xea2e28][_0x1691('0x51')]&&moment()['isBetween'](_0x51edfe[_0xea2e28][_0x1691('0x53')],_0x51edfe[_0xea2e28]['endAt'])){manager[_0x1691('0x58')](_0xea2e28,_0x51edfe[_0xea2e28][_0x1691('0x50')],handleJob(_0x51edfe[_0xea2e28]));logger[_0x1691('0xd')]('update\x20cron',_0x51edfe[_0xea2e28][_0x1691('0x14')],_0x51edfe[_0xea2e28]['cron']);}else{manager[_0x1691('0x48')](_0xea2e28);manager[_0x1691('0x49')](_0xea2e28);logger['info']('stop\x20cron',_0x51edfe[_0xea2e28][_0x1691('0x14')],_0x51edfe[_0xea2e28][_0x1691('0x50')]);}}}})[_0x1691('0x3b')](function(_0x423cb9){logger[_0x1691('0x2b')](JSON[_0x1691('0x2d')](_0x423cb9));});}exports[_0x1691('0x59')]=function(_0x1e904a){return getJobs(_0x1e904a);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5f7d=['error','email\x20sent','error\x20mail','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','catch','CustomReportId','runReport','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','difference','intersection','exists','stop','delete\x20cron','toRun','length','index','cron','active','isBetween','startAt','endAt','start','add\x20cron','deleteJob','stop\x20cron','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','\x22%s\x22\x20<%s>','MailAccount','Smtp','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','info','request','SendMail','then'];(function(_0x41ddc7,_0x2c6187){var _0x4811b9=function(_0x50e131){while(--_0x50e131){_0x41ddc7['push'](_0x41ddc7['shift']());}};_0x4811b9(++_0x2c6187);}(_0x5f7d,0x1bd));var _0xd5f7=function(_0x3f2ad0,_0x10d42b){_0x3f2ad0=_0x3f2ad0-0x0;var _0x5a9b8d=_0x5f7d[_0x3f2ad0];return _0x5a9b8d;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xd5f7('0x0'));var _=require(_0xd5f7('0x1'));var moment=require(_0xd5f7('0x2'));var CronJobManager=require(_0xd5f7('0x3'));var jayson=require(_0xd5f7('0x4'));var BPromise=require(_0xd5f7('0x5'));var logger=require('../logger')(_0xd5f7('0x6'));var db=require(_0xd5f7('0x7'))['db'];var analyticCustomReportController=require(_0xd5f7('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xd5f7('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x627ed5,_0x4dd8ec){return function(){logger['info'](_0xd5f7('0xa'),_0x627ed5[_0xd5f7('0xb')]);var _0x54d2d3=!![];var _0x48505b=_0x627ed5['MailAccount'][_0xd5f7('0xc')]();var _0x55c81f={'account':_0x48505b,'message':{'from':util['format'](_0xd5f7('0xd'),_0x627ed5[_0xd5f7('0xe')]['name'],_0x627ed5[_0xd5f7('0xe')][_0xd5f7('0xb')]||_0x627ed5[_0xd5f7('0xe')][_0xd5f7('0xf')][_0xd5f7('0x10')]),'to':_0x627ed5[_0xd5f7('0xb')],'cc':_0x627ed5['cc'],'bcc':_0x627ed5[_0xd5f7('0x11')],'subject':util[_0xd5f7('0x12')](_0xd5f7('0x13'),_0x4dd8ec[_0xd5f7('0x14')],_0x627ed5[_0xd5f7('0x15')],_0x627ed5[_0xd5f7('0x16')])}};var _0x47a095=path['join'](__dirname,_0xd5f7('0x17'));var _0x113d58=_0x4dd8ec[_0xd5f7('0x18')];var _0x12aaaa=util[_0xd5f7('0x12')](_0xd5f7('0x19'),path[_0xd5f7('0x1a')](_0x4dd8ec[_0xd5f7('0x18')],path[_0xd5f7('0x1b')](_0x4dd8ec['savename'])),_0xd5f7('0x1c'));var _0x55a0b0=path[_0xd5f7('0x1d')](_0x47a095,_0x113d58);var _0x130105=path[_0xd5f7('0x1d')](_0x47a095,_0x12aaaa);if(fs[_0xd5f7('0x1e')](_0x55a0b0)){_0x4dd8ec[_0xd5f7('0x1f')]=_0xd5f7('0x20');_0x55c81f[_0xd5f7('0x21')][_0xd5f7('0x22')]=[{'filename':_0x113d58,'path':_0x55a0b0}];_0x55c81f[_0xd5f7('0x21')][_0xd5f7('0x23')]=util[_0xd5f7('0x12')](_0xd5f7('0x24'),JSON['stringify'](_0x4dd8ec,null,0x2));}else if(fs[_0xd5f7('0x1e')](_0x130105)){_0x4dd8ec[_0xd5f7('0x1f')]=_0xd5f7('0x20');_0x55c81f[_0xd5f7('0x21')][_0xd5f7('0x22')]=[{'filename':_0x12aaaa,'path':_0x130105}];}else{_0x55c81f[_0xd5f7('0x21')][_0xd5f7('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x627ed5['sendIfEmpty']){_0x54d2d3=![];logger[_0xd5f7('0x25')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x54d2d3){return client[_0xd5f7('0x26')](_0xd5f7('0x27'),_0x55c81f)[_0xd5f7('0x28')](function(_0x137fbd){if(_0x137fbd[_0xd5f7('0x29')]){return logger[_0xd5f7('0x29')]('error\x20mail',JSON['stringify'](_0x137fbd));}return logger[_0xd5f7('0x25')](_0xd5f7('0x2a'));})['catch'](function(_0x4ed93d){return logger[_0xd5f7('0x29')](_0xd5f7('0x2b'),JSON[_0xd5f7('0x2c')](_0x4ed93d));});}};}function handleError(){return function(_0x20317a){return logger['error'](JSON['stringify'](_0x20317a));};}function handleResult(_0x5705ab){return function(_0x864471){logger['info'](_0xd5f7('0x2d'),JSON[_0xd5f7('0x2c')](_0x864471));if(_0x5705ab['MailAccount']&&_0x5705ab['MailAccount'][_0xd5f7('0xf')]&&!_['isNil'](_0x5705ab[_0xd5f7('0xb')])){setTimeout(handleSendEmail(_0x5705ab,_0x864471),0x3c*0x3e8);}};}function handleJob(_0x178290){return function(){try{if(_[_0xd5f7('0x2e')](_0x178290[_0xd5f7('0x15')])){return logger[_0xd5f7('0x25')](_0xd5f7('0x2f'));}if(_['isNil'](_0x178290[_0xd5f7('0x16')])){return logger[_0xd5f7('0x25')]('subtractUnit\x20null\x20or\x20undefined');}var _0x44bf9f={'startDate':moment()['subtract'](_0x178290['subtractNumber'],_0x178290[_0xd5f7('0x16')])[_0xd5f7('0x12')](_0xd5f7('0x30')),'endDate':moment()[_0xd5f7('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xd5f7('0x31'),'output':_0x178290[_0xd5f7('0x32')],'name':_0x178290[_0xd5f7('0x14')]};if(!_['isNil'](_0x178290[_0xd5f7('0x33')])){logger[_0xd5f7('0x25')]('exec\x20defaul\x20report\x20id:%s',_0x178290[_0xd5f7('0x33')]);return analyticDefaultReportController['runReport']({'id':_0x178290[_0xd5f7('0x33')]},_0x44bf9f)['then'](handleResult(_0x178290))[_0xd5f7('0x34')](handleError());}if(!_[_0xd5f7('0x2e')](_0x178290[_0xd5f7('0x35')])){logger[_0xd5f7('0x25')]('exec\x20custom\x20report\x20id:%s',_0x178290[_0xd5f7('0x35')]);return analyticCustomReportController[_0xd5f7('0x36')]({'id':_0x178290[_0xd5f7('0x35')]},_0x44bf9f)['then'](handleResult(_0x178290))[_0xd5f7('0x34')](handleError());}}catch(_0x21111e){logger[_0xd5f7('0x29')](JSON[_0xd5f7('0x2c')](_0x21111e));}return logger[_0xd5f7('0x25')]('no\x20report\x20id');};}function getJobs(_0xd08734){var _0x2b7605={};if(_0xd08734){_0x2b7605['id']=_0xd08734;}return db['Schedule'][_0xd5f7('0x37')]({'where':_0x2b7605,'include':[{'model':db[_0xd5f7('0xe')],'attributes':['id',_0xd5f7('0x14'),'email'],'include':[{'model':db[_0xd5f7('0x38')],'as':_0xd5f7('0xf'),'include':[{'model':db[_0xd5f7('0x39')],'as':_0xd5f7('0x39')}]}]}]})['then'](function(_0x5caaa3){var _0x31c2af=_[_0xd5f7('0x3a')](manager[_0xd5f7('0x3b')]);var _0x149ca9=_[_0xd5f7('0x3c')](_0x5caaa3,function(_0x523639){return _0x523639['id'][_0xd5f7('0x3d')]();});var _0x46de99=_['keyBy'](_0x5caaa3,function(_0x54a028){return _0x54a028['id']['toString']();});var _0x3e65a4=_0xd08734?_0x149ca9:_[_0xd5f7('0x3e')](_0x149ca9,_0x31c2af);var _0x55fd05=_[_0xd5f7('0x3f')](_0x149ca9,_0x31c2af);var _0x17699f=_['difference'](_0x31c2af,_0x149ca9);var _0x274d14;var _0x1fa6a5;for(_0x274d14=0x0;_0x274d14<_0x17699f['length']&&!_0xd08734;_0x274d14+=0x1){_0x1fa6a5=_0x17699f[_0x274d14][_0xd5f7('0x3d')]();if(manager[_0xd5f7('0x40')](_0x1fa6a5)){manager[_0xd5f7('0x41')](_0x1fa6a5);manager['deleteJob'](_0x1fa6a5);logger[_0xd5f7('0x25')](_0xd5f7('0x42'),_0x1fa6a5);}}logger[_0xd5f7('0x25')](_0xd5f7('0x43'),JSON[_0xd5f7('0x2c')](_0x3e65a4));for(_0x274d14=0x0;_0x274d14<_0x3e65a4[_0xd5f7('0x44')];_0x274d14+=0x1){_0x1fa6a5=_0x3e65a4[_0x274d14][_0xd5f7('0x3d')]();logger['info'](_0xd5f7('0x45'),_0x1fa6a5);if(_0xd08734){logger[_0xd5f7('0x25')]('my\x20id',_0xd08734);logger[_0xd5f7('0x25')](JSON['stringify'](_0x46de99[_0x1fa6a5]));BPromise['resolve']()[_0xd5f7('0x28')](handleJob(_0x46de99[_0x1fa6a5]));logger[_0xd5f7('0x25')]('run\x20job',_0x46de99[_0x1fa6a5][_0xd5f7('0x14')],_0x46de99[_0x1fa6a5][_0xd5f7('0x46')]);}else if(_0x46de99[_0x1fa6a5]['cron']&&_0x46de99[_0x1fa6a5][_0xd5f7('0x47')]&&moment()[_0xd5f7('0x48')](_0x46de99[_0x1fa6a5][_0xd5f7('0x49')],_0x46de99[_0x1fa6a5][_0xd5f7('0x4a')])){manager['add'](_0x1fa6a5,_0x46de99[_0x1fa6a5][_0xd5f7('0x46')],handleJob(_0x46de99[_0x1fa6a5]));manager[_0xd5f7('0x4b')](_0x1fa6a5);logger[_0xd5f7('0x25')](_0xd5f7('0x4c'),_0x46de99[_0x1fa6a5][_0xd5f7('0x14')],_0x46de99[_0x1fa6a5][_0xd5f7('0x46')]);}else if(manager[_0xd5f7('0x40')](_0x1fa6a5)){manager[_0xd5f7('0x41')](_0x1fa6a5);manager[_0xd5f7('0x4d')](_0x1fa6a5);logger['info'](_0xd5f7('0x4e'),_0x46de99[_0x1fa6a5]['name'],_0x46de99[_0x1fa6a5][_0xd5f7('0x46')]);}}for(_0x274d14=0x0,_0x1fa6a5;_0x274d14<_0x55fd05[_0xd5f7('0x44')]&&!_0xd08734;_0x274d14+=0x1){_0x1fa6a5=_0x55fd05[_0x274d14][_0xd5f7('0x3d')]();if(manager['exists'](_0x1fa6a5)){if(_0x46de99[_0x1fa6a5]['cron']&&_0x46de99[_0x1fa6a5][_0xd5f7('0x47')]&&moment()[_0xd5f7('0x48')](_0x46de99[_0x1fa6a5]['startAt'],_0x46de99[_0x1fa6a5]['endAt'])){manager['update'](_0x1fa6a5,_0x46de99[_0x1fa6a5][_0xd5f7('0x46')],handleJob(_0x46de99[_0x1fa6a5]));logger[_0xd5f7('0x25')](_0xd5f7('0x4f'),_0x46de99[_0x1fa6a5][_0xd5f7('0x14')],_0x46de99[_0x1fa6a5][_0xd5f7('0x46')]);}else{manager[_0xd5f7('0x41')](_0x1fa6a5);manager[_0xd5f7('0x4d')](_0x1fa6a5);logger[_0xd5f7('0x25')](_0xd5f7('0x4e'),_0x46de99[_0x1fa6a5][_0xd5f7('0x14')],_0x46de99[_0x1fa6a5]['cron']);}}}})[_0xd5f7('0x34')](function(_0xa3274f){logger['error'](JSON['stringify'](_0xa3274f));});}exports[_0xd5f7('0x50')]=function(_0x42b6a6){return getJobs(_0x42b6a6);};exports[_0xd5f7('0x4b')]=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 1d1a94d..5c64602 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 _0x6f59=['bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','tempSentiment','Sequelize','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','ValidationError','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','sentiment','CloudProvider','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','start','lodash','aws-sdk','request-promise','util'];(function(_0x1828ad,_0x31cbc5){var _0x4fe783=function(_0x2e4c28){while(--_0x2e4c28){_0x1828ad['push'](_0x1828ad['shift']());}};_0x4fe783(++_0x31cbc5);}(_0x6f59,0x1be));var _0x96f5=function(_0x4af4f9,_0x3e5cc7){_0x4af4f9=_0x4af4f9-0x0;var _0x57908e=_0x6f59[_0x4af4f9];return _0x57908e;};var _=require(_0x96f5('0x0'));var AWS=require(_0x96f5('0x1'));var rp=require(_0x96f5('0x2'));var util=require(_0x96f5('0x3'));var BPromise=require(_0x96f5('0x4'));var db=require(_0x96f5('0x5'))['db'];var logger=require(_0x96f5('0x6'))(_0x96f5('0x7'));function getTranscriptionJob(_0x3e2ae1,_0x3ac0b6,_0x4b846b,_0x110dcc){return new Promise(function(_0x598154,_0xf6cd7d){var _0x57fc51=new AWS[(_0x96f5('0x8'))]({'accessKeyId':_0x3ac0b6,'secretAccessKey':_0x3e2ae1,'region':_0x4b846b});_0x57fc51['getTranscriptionJob']({'TranscriptionJobName':_0x110dcc},function(_0x21dbf3,_0x4b6748){if(_0x21dbf3){return _0xf6cd7d(_0x21dbf3);}else{return _0x598154(_0x4b6748);}});});}function sentiment(_0xa726db,_0x95ad86,_0x3064bd,_0x384556,_0x5a84ba){return new Promise(function(_0x324dc6,_0x30ac02){var _0x1fd2c0=new AWS[(_0x96f5('0x9'))]({'accessKeyId':_0x95ad86,'secretAccessKey':_0xa726db,'region':_0x3064bd});_0x1fd2c0[_0x96f5('0xa')]({'Text':_0x384556,'LanguageCode':_0x5a84ba[_0x96f5('0xb')](0x0,0x2)},function(_0x32ab27,_0x37dedb){if(_0x32ab27){return _0x30ac02(_0x32ab27);}else{return _0x324dc6(_0x37dedb);}});});}function checkTranscribeJob(_0x62ab9b,_0x42363c,_0x3a7b37){var _0x24a490;return new BPromise(function(_0x150149,_0x4c95f4){logger[_0x96f5('0xc')](util[_0x96f5('0xd')](_0x96f5('0xe'),_0x62ab9b['id'],_0x62ab9b[_0x96f5('0xf')]));return getTranscriptionJob(_0x3a7b37[_0x96f5('0x10')],_0x3a7b37[_0x96f5('0x11')],_0x42363c['transcribeRegion'],_0x62ab9b[_0x96f5('0xf')])['then'](function(_0x3f6dcf){logger[_0x96f5('0xc')](util[_0x96f5('0xd')](_0x96f5('0x12'),_0x62ab9b['id'],_0x62ab9b[_0x96f5('0xf')],_0x3f6dcf['TranscriptionJob'][_0x96f5('0x13')]));if(!_0x62ab9b['fileText']){switch(_0x3f6dcf[_0x96f5('0x14')]['TranscriptionJobStatus']){case _0x96f5('0x15'):var _0x33f7d7={'transcribeStatus':_0x3f6dcf['TranscriptionJob'][_0x96f5('0x13')],'fileUri':_0x3f6dcf['TranscriptionJob'][_0x96f5('0x16')]['TranscriptFileUri']};logger[_0x96f5('0xc')](util[_0x96f5('0xd')]('[RECORDING:%d]\x20Get\x20transcript',_0x62ab9b['id']));return rp({'uri':_0x3f6dcf[_0x96f5('0x14')][_0x96f5('0x16')][_0x96f5('0x17')],'json':!![]})[_0x96f5('0x18')](function(_0x3dcd36){logger[_0x96f5('0xc')](util[_0x96f5('0xd')](_0x96f5('0x19'),_0x62ab9b['id']));if(_0x3dcd36&&_0x3dcd36[_0x96f5('0x1a')]&&_0x3dcd36[_0x96f5('0x1a')][_0x96f5('0x1b')]&&_0x3dcd36['results'][_0x96f5('0x1b')][_0x96f5('0x1c')]){_0x33f7d7[_0x96f5('0x1d')]='';for(var _0x413769=0x0;_0x413769<_0x3dcd36[_0x96f5('0x1a')][_0x96f5('0x1b')][_0x96f5('0x1c')];_0x413769++){_0x33f7d7['fileText']+=_0x3dcd36[_0x96f5('0x1a')]['transcripts'][_0x413769][_0x96f5('0x1e')]+'';}}return _0x62ab9b[_0x96f5('0x1f')](_0x33f7d7);})[_0x96f5('0x18')](function(){logger[_0x96f5('0xc')](util[_0x96f5('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x62ab9b['id']));if(!_0x62ab9b[_0x96f5('0x20')]){throw new db[(_0x96f5('0x21'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x42363c['sentiment']||!_0x42363c['sentimentAccountId']||!_0x42363c[_0x96f5('0x22')]||!_0x42363c[_0x96f5('0x23')]||!_0x42363c[_0x96f5('0x24')]){throw new db['Sequelize']['ValidationError'](_0x96f5('0x25'));}if(!_0x33f7d7[_0x96f5('0x1d')]){throw new Error(_0x96f5('0x26'));}if(_0x42363c[_0x96f5('0x27')]===_0x3a7b37['id']){return _0x3a7b37;}else{return db['CloudProvider'][_0x96f5('0x28')]({'where':{'id':_settings[_0x96f5('0x27')]}});}})['then'](function(_0x418f08){if(!_0x418f08){throw new db[(_0x96f5('0x21'))][(_0x96f5('0x29'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x418f08['data1']||!_0x418f08['data2']){throw new db['Sequelize']['ValidationError'](_0x96f5('0x2a'));}_0x24a490=_0x418f08;logger[_0x96f5('0xc')](util[_0x96f5('0xd')](_0x96f5('0x2b'),_0x62ab9b['id']));return sentiment(_0x24a490['data1'],_0x24a490['data2'],_0x42363c[_0x96f5('0x22')],_0x33f7d7['fileText'],_0x42363c[_0x96f5('0x23')]);})[_0x96f5('0x18')](function(_0x10d9d9){logger[_0x96f5('0xc')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x62ab9b['id']));return _0x62ab9b[_0x96f5('0x1f')]({'sentiment':_0x10d9d9[_0x96f5('0x2c')],'sPositive':_0x10d9d9[_0x96f5('0x2d')][_0x96f5('0x2e')],'sNegative':_0x10d9d9[_0x96f5('0x2d')][_0x96f5('0x2f')],'sMixed':_0x10d9d9[_0x96f5('0x2d')][_0x96f5('0x30')],'sNeutral':_0x10d9d9['SentimentScore'][_0x96f5('0x31')]});})['then'](function(){logger[_0x96f5('0xc')](util[_0x96f5('0xd')](_0x96f5('0x32'),_0x62ab9b['id']));_0x150149();});case'FAILED':return _0x62ab9b[_0x96f5('0x1f')]({'transcribeStatus':_0x96f5('0x33'),'failureReason':_0x3f6dcf[_0x96f5('0x14')][_0x96f5('0x34')]})['then'](function(){logger[_0x96f5('0xc')](util[_0x96f5('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x62ab9b['id']));_0x150149();});default:logger['info'](util[_0x96f5('0xd')](_0x96f5('0x35'),_0x62ab9b['id']));break;}}else{return BPromise[_0x96f5('0x36')]()[_0x96f5('0x18')](function(){if(!_0x62ab9b[_0x96f5('0x20')]){throw new db[(_0x96f5('0x21'))][(_0x96f5('0x29'))](_0x96f5('0x37'));}if(!_0x42363c[_0x96f5('0x38')]||!_0x42363c[_0x96f5('0x27')]||!_0x42363c[_0x96f5('0x22')]||!_0x42363c[_0x96f5('0x23')]||!_0x42363c[_0x96f5('0x24')]){throw new db[(_0x96f5('0x21'))][(_0x96f5('0x29'))](_0x96f5('0x25'));}if(!_0x62ab9b[_0x96f5('0x1d')]){throw new Error(_0x96f5('0x26'));}if(_0x42363c['sentimentAccountId']===_0x3a7b37['id']){return _0x3a7b37;}else{return db[_0x96f5('0x39')][_0x96f5('0x28')]({'where':{'id':_settings[_0x96f5('0x27')]}});}})['then'](function(_0x504798){if(!_0x504798){throw new db[(_0x96f5('0x21'))]['ValidationError'](_0x96f5('0x3a'));}if(!_0x504798[_0x96f5('0x10')]||!_0x504798[_0x96f5('0x11')]){throw new db[(_0x96f5('0x21'))][(_0x96f5('0x29'))](_0x96f5('0x2a'));}_0x24a490=_0x504798;logger['info'](util[_0x96f5('0xd')](_0x96f5('0x2b'),_0x62ab9b['id']));return sentiment(_0x24a490[_0x96f5('0x10')],_0x24a490[_0x96f5('0x11')],_0x42363c[_0x96f5('0x22')],_0x62ab9b['fileText'],_0x42363c[_0x96f5('0x23')]);})['then'](function(_0x6f926){logger[_0x96f5('0xc')](util[_0x96f5('0xd')](_0x96f5('0x3b'),_0x62ab9b['id']));return _0x62ab9b[_0x96f5('0x1f')]({'sentiment':_0x6f926['Sentiment'],'sPositive':_0x6f926[_0x96f5('0x2d')][_0x96f5('0x2e')],'sNegative':_0x6f926[_0x96f5('0x2d')]['Negative'],'sMixed':_0x6f926[_0x96f5('0x2d')][_0x96f5('0x30')],'sNeutral':_0x6f926[_0x96f5('0x2d')]['Neutral'],'transcribeStatus':_0x96f5('0x15')});})['then'](function(){logger['info'](util['format'](_0x96f5('0x32'),_0x62ab9b['id']));_0x150149();});}})[_0x96f5('0x3c')](function(_0x358e63){if(_0x358e63){if(!_0x358e63[_0x96f5('0x3d')]||_0x358e63[_0x96f5('0x3d')]!==_0x96f5('0x3e')){logger[_0x96f5('0x3f')](util[_0x96f5('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x62ab9b['id']),util[_0x96f5('0x40')](_0x358e63,{'showHidden':![],'depth':null}));}}_0x150149();});});}function checkTranscribe(){var _0x26cdd0;var _0x2d4c93;var _0x1ed12f;return db[_0x96f5('0x41')]['findAll']({'where':{'transcribeStatus':_0x96f5('0x42')}})[_0x96f5('0x18')](function(_0x4b0261){if(!_0x4b0261||!_0x4b0261[_0x96f5('0x1c')]){throw new db[(_0x96f5('0x21'))][(_0x96f5('0x29'))]('No\x20transcribe\x20job\x20to\x20check');}_0x26cdd0=_0x4b0261;return db[_0x96f5('0x43')][_0x96f5('0x28')]({'where':{'id':0x1}});})[_0x96f5('0x18')](function(_0x5e888c){if(!_0x5e888c){throw new db['Sequelize']['ValidationError'](_0x96f5('0x44'));}_0x2d4c93=_0x5e888c;if(!_0x2d4c93[_0x96f5('0x7')]||!_0x2d4c93[_0x96f5('0x45')]||!_0x2d4c93[_0x96f5('0x46')]||!_0x2d4c93['language']||!_0x2d4c93[_0x96f5('0x24')]){throw new db['Sequelize'][(_0x96f5('0x29'))](_0x96f5('0x47'));}return db[_0x96f5('0x39')][_0x96f5('0x28')]({'where':{'id':_0x2d4c93[_0x96f5('0x45')]}});})[_0x96f5('0x18')](function(_0x420da1){if(!_0x420da1){throw new db['Sequelize'][(_0x96f5('0x29'))](_0x96f5('0x3a'));}if(!_0x420da1[_0x96f5('0x10')]||!_0x420da1[_0x96f5('0x11')]){throw new db['Sequelize']['ValidationError'](_0x96f5('0x2a'));}_0x1ed12f=_0x420da1;var _0x2360c0=[];_0x26cdd0['forEach'](function(_0x2667a9){_0x2360c0[_0x96f5('0x48')](checkTranscribeJob(_0x2667a9,_0x2d4c93,_0x1ed12f));});return BPromise[_0x96f5('0x49')](_0x2360c0);})['catch'](function(_0x579fa7){if(_0x579fa7){if(!_0x579fa7['name']||_0x579fa7['name']!==_0x96f5('0x3e')){logger['error'](util[_0x96f5('0x40')](_0x579fa7,{'showHidden':![],'depth':null}));}}});}exports[_0x96f5('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x6ae2=['TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','sentimentAccountId','sentimentRegion','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','Transcript\x20not\x20available','Neutral','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript'];(function(_0x257173,_0x63c350){var _0x1cb52f=function(_0x413e75){while(--_0x413e75){_0x257173['push'](_0x257173['shift']());}};_0x1cb52f(++_0x63c350);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x2588f8,_0x74760){_0x2588f8=_0x2588f8-0x0;var _0x52a79c=_0x6ae2[_0x2588f8];return _0x52a79c;};var _=require(_0x26ae('0x0'));var AWS=require(_0x26ae('0x1'));var rp=require(_0x26ae('0x2'));var util=require(_0x26ae('0x3'));var BPromise=require(_0x26ae('0x4'));var db=require(_0x26ae('0x5'))['db'];var logger=require(_0x26ae('0x6'))(_0x26ae('0x7'));function getTranscriptionJob(_0x318952,_0x5b52b9,_0x1158ff,_0x408677){return new Promise(function(_0x595da8,_0x5609b0){var _0x13cb27=new AWS[(_0x26ae('0x8'))]({'accessKeyId':_0x5b52b9,'secretAccessKey':_0x318952,'region':_0x1158ff});_0x13cb27[_0x26ae('0x9')]({'TranscriptionJobName':_0x408677},function(_0x151de3,_0x3bc9de){if(_0x151de3){return _0x5609b0(_0x151de3);}else{return _0x595da8(_0x3bc9de);}});});}function sentiment(_0x13d7c8,_0x359d23,_0x4b3eca,_0x3d165a,_0x18baac){return new Promise(function(_0x1f8dff,_0x4061ad){var _0x5b2c57=new AWS[(_0x26ae('0xa'))]({'accessKeyId':_0x359d23,'secretAccessKey':_0x13d7c8,'region':_0x4b3eca});_0x5b2c57['detectSentiment']({'Text':_0x3d165a,'LanguageCode':_0x18baac[_0x26ae('0xb')](0x0,0x2)},function(_0x5e7852,_0x4cb715){if(_0x5e7852){return _0x4061ad(_0x5e7852);}else{return _0x1f8dff(_0x4cb715);}});});}function checkTranscribeJob(_0x410259,_0x46bc2,_0x21811d){var _0x17f9a6;return new BPromise(function(_0x286b7e,_0x4599cb){logger[_0x26ae('0xc')](util[_0x26ae('0xd')](_0x26ae('0xe'),_0x410259['id'],_0x410259[_0x26ae('0xf')]));return getTranscriptionJob(_0x21811d[_0x26ae('0x10')],_0x21811d[_0x26ae('0x11')],_0x46bc2['transcribeRegion'],_0x410259[_0x26ae('0xf')])[_0x26ae('0x12')](function(_0x497974){logger[_0x26ae('0xc')](util[_0x26ae('0xd')](_0x26ae('0x13'),_0x410259['id'],_0x410259[_0x26ae('0xf')],_0x497974[_0x26ae('0x14')][_0x26ae('0x15')]));if(!_0x410259[_0x26ae('0x16')]){switch(_0x497974[_0x26ae('0x14')][_0x26ae('0x15')]){case _0x26ae('0x17'):var _0x1e5cf5={'transcribeStatus':_0x497974[_0x26ae('0x14')][_0x26ae('0x15')],'fileUri':_0x497974[_0x26ae('0x14')][_0x26ae('0x18')][_0x26ae('0x19')]};logger[_0x26ae('0xc')](util[_0x26ae('0xd')](_0x26ae('0x1a'),_0x410259['id']));return rp({'uri':_0x497974[_0x26ae('0x14')][_0x26ae('0x18')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x2a2ba5){logger['info'](util[_0x26ae('0xd')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x410259['id']));if(_0x2a2ba5&&_0x2a2ba5[_0x26ae('0x1b')]&&_0x2a2ba5[_0x26ae('0x1b')][_0x26ae('0x1c')]&&_0x2a2ba5['results']['transcripts'][_0x26ae('0x1d')]){_0x1e5cf5[_0x26ae('0x16')]='';for(var _0x29de9b=0x0;_0x29de9b<_0x2a2ba5['results'][_0x26ae('0x1c')][_0x26ae('0x1d')];_0x29de9b++){_0x1e5cf5['fileText']+=_0x2a2ba5[_0x26ae('0x1b')][_0x26ae('0x1c')][_0x29de9b][_0x26ae('0x1e')]+'';}}return _0x410259['update'](_0x1e5cf5);})[_0x26ae('0x12')](function(){logger['info'](util[_0x26ae('0xd')](_0x26ae('0x1f'),_0x410259['id']));if(!_0x410259[_0x26ae('0x20')]){throw new db['Sequelize'][(_0x26ae('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x46bc2['sentiment']||!_0x46bc2[_0x26ae('0x22')]||!_0x46bc2[_0x26ae('0x23')]||!_0x46bc2['language']||!_0x46bc2[_0x26ae('0x24')]){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x26'));}if(!_0x1e5cf5[_0x26ae('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x46bc2[_0x26ae('0x22')]===_0x21811d['id']){return _0x21811d;}else{return db[_0x26ae('0x27')][_0x26ae('0x28')]({'where':{'id':_settings[_0x26ae('0x22')]}});}})[_0x26ae('0x12')](function(_0x56588f){if(!_0x56588f){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x29'));}if(!_0x56588f[_0x26ae('0x10')]||!_0x56588f[_0x26ae('0x11')]){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x2a'));}_0x17f9a6=_0x56588f;logger['info'](util[_0x26ae('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x410259['id']));return sentiment(_0x17f9a6['data1'],_0x17f9a6[_0x26ae('0x11')],_0x46bc2[_0x26ae('0x23')],_0x1e5cf5[_0x26ae('0x16')],_0x46bc2['language']);})[_0x26ae('0x12')](function(_0x3bbdaa){logger[_0x26ae('0xc')](util[_0x26ae('0xd')](_0x26ae('0x2b'),_0x410259['id']));return _0x410259[_0x26ae('0x2c')]({'sentiment':_0x3bbdaa[_0x26ae('0x2d')],'sPositive':_0x3bbdaa[_0x26ae('0x2e')][_0x26ae('0x2f')],'sNegative':_0x3bbdaa[_0x26ae('0x2e')][_0x26ae('0x30')],'sMixed':_0x3bbdaa[_0x26ae('0x2e')][_0x26ae('0x31')],'sNeutral':_0x3bbdaa[_0x26ae('0x2e')]['Neutral']});})[_0x26ae('0x12')](function(){logger[_0x26ae('0xc')](util[_0x26ae('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x410259['id']));_0x286b7e();});case _0x26ae('0x32'):return _0x410259[_0x26ae('0x2c')]({'transcribeStatus':_0x26ae('0x32'),'failureReason':_0x497974[_0x26ae('0x14')][_0x26ae('0x33')]})['then'](function(){logger[_0x26ae('0xc')](util[_0x26ae('0xd')](_0x26ae('0x1f'),_0x410259['id']));_0x286b7e();});default:logger[_0x26ae('0xc')](util[_0x26ae('0xd')](_0x26ae('0x34'),_0x410259['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x410259['tempSentiment']){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x35'));}if(!_0x46bc2[_0x26ae('0x36')]||!_0x46bc2[_0x26ae('0x22')]||!_0x46bc2['sentimentRegion']||!_0x46bc2[_0x26ae('0x37')]||!_0x46bc2[_0x26ae('0x24')]){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x26'));}if(!_0x410259[_0x26ae('0x16')]){throw new Error(_0x26ae('0x38'));}if(_0x46bc2['sentimentAccountId']===_0x21811d['id']){return _0x21811d;}else{return db[_0x26ae('0x27')][_0x26ae('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x26ae('0x12')](function(_0x4ed02a){if(!_0x4ed02a){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x29'));}if(!_0x4ed02a['data1']||!_0x4ed02a[_0x26ae('0x11')]){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x2a'));}_0x17f9a6=_0x4ed02a;logger[_0x26ae('0xc')](util[_0x26ae('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x410259['id']));return sentiment(_0x17f9a6['data1'],_0x17f9a6['data2'],_0x46bc2[_0x26ae('0x23')],_0x410259[_0x26ae('0x16')],_0x46bc2[_0x26ae('0x37')]);})[_0x26ae('0x12')](function(_0x3d2960){logger['info'](util['format'](_0x26ae('0x2b'),_0x410259['id']));return _0x410259[_0x26ae('0x2c')]({'sentiment':_0x3d2960[_0x26ae('0x2d')],'sPositive':_0x3d2960['SentimentScore'][_0x26ae('0x2f')],'sNegative':_0x3d2960['SentimentScore'][_0x26ae('0x30')],'sMixed':_0x3d2960[_0x26ae('0x2e')]['Mixed'],'sNeutral':_0x3d2960['SentimentScore'][_0x26ae('0x39')],'transcribeStatus':'COMPLETED'});})[_0x26ae('0x12')](function(){logger[_0x26ae('0xc')](util[_0x26ae('0xd')](_0x26ae('0x1f'),_0x410259['id']));_0x286b7e();});}})[_0x26ae('0x3a')](function(_0x1c0c57){if(_0x1c0c57){if(!_0x1c0c57[_0x26ae('0x3b')]||_0x1c0c57[_0x26ae('0x3b')]!==_0x26ae('0x3c')){logger[_0x26ae('0x3d')](util[_0x26ae('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x410259['id']),util[_0x26ae('0x3e')](_0x1c0c57,{'showHidden':![],'depth':null}));}}_0x286b7e();});});}function checkTranscribe(){var _0x34760e;var _0x3060fa;var _0x1fe641;return db[_0x26ae('0x3f')][_0x26ae('0x40')]({'where':{'transcribeStatus':_0x26ae('0x41')}})[_0x26ae('0x12')](function(_0x27a516){if(!_0x27a516||!_0x27a516[_0x26ae('0x1d')]){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x42'));}_0x34760e=_0x27a516;return db['Setting'][_0x26ae('0x28')]({'where':{'id':0x1}});})['then'](function(_0x3dd581){if(!_0x3dd581){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))](_0x26ae('0x43'));}_0x3060fa=_0x3dd581;if(!_0x3060fa[_0x26ae('0x7')]||!_0x3060fa[_0x26ae('0x44')]||!_0x3060fa['transcribeRegion']||!_0x3060fa[_0x26ae('0x37')]||!_0x3060fa['bucket']){throw new db[(_0x26ae('0x25'))]['ValidationError'](_0x26ae('0x45'));}return db[_0x26ae('0x27')]['findOne']({'where':{'id':_0x3060fa[_0x26ae('0x44')]}});})[_0x26ae('0x12')](function(_0x44b9e6){if(!_0x44b9e6){throw new db[(_0x26ae('0x25'))][(_0x26ae('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x44b9e6['data1']||!_0x44b9e6[_0x26ae('0x11')]){throw new db[(_0x26ae('0x25'))]['ValidationError'](_0x26ae('0x2a'));}_0x1fe641=_0x44b9e6;var _0x46a498=[];_0x34760e[_0x26ae('0x46')](function(_0x51b9ec){_0x46a498[_0x26ae('0x47')](checkTranscribeJob(_0x51b9ec,_0x3060fa,_0x1fe641));});return BPromise[_0x26ae('0x48')](_0x46a498);})[_0x26ae('0x3a')](function(_0xeda94e){if(_0xeda94e){if(!_0xeda94e[_0x26ae('0x3b')]||_0xeda94e[_0x26ae('0x3b')]!==_0x26ae('0x3c')){logger[_0x26ae('0x3d')](util[_0x26ae('0x3e')](_0xeda94e,{'showHidden':![],'depth':null}));}}});}exports[_0x26ae('0x49')]=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 e8808bc..ddf1076 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 _0x4877=['lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect'];(function(_0x194347,_0x266e9d){var _0x3e52f7=function(_0x41cd65){while(--_0x41cd65){_0x194347['push'](_0x194347['shift']());}};_0x3e52f7(++_0x266e9d);}(_0x4877,0x80));var _0x7487=function(_0x4d794d,_0x4ac0b4){_0x4d794d=_0x4d794d-0x0;var _0x371164=_0x4877[_0x4d794d];return _0x371164;};'use strict';var _=require(_0x7487('0x0'));var moment=require(_0x7487('0x1'));var Redis=require(_0x7487('0x2'));var util=require(_0x7487('0x3'));var config=require(_0x7487('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x7487('0x5'))(_0x7487('0x6'));config[_0x7487('0x7')]=_[_0x7487('0x8')](config[_0x7487('0x7')],{'host':_0x7487('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7487('0x7')]));function closeInteractions(){var _0x5e2825=[];return db[_0x7487('0xa')][_0x7487('0xb')]({'raw':!![],'attributes':['id',_0x7487('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x7487('0xd')](0x18,_0x7487('0xe'))}}})[_0x7487('0xf')](function(_0x3215b3){if(_0x3215b3&&_0x3215b3['length']){_0x5e2825=_[_0x7487('0x10')](_0x3215b3||[],'id');logger[_0x7487('0x11')](_0x7487('0x12'),_0x5e2825['join']());return db[_0x7487('0xa')][_0x7487('0x13')]({'closeReason':_0x7487('0x14'),'disposition':_0x7487('0x15'),'closed':!![],'closedAt':moment()['format'](_0x7487('0x16'))},{'where':{'id':_0x5e2825}});}})['then'](function(){if(_0x5e2825&&_0x5e2825[_0x7487('0x17')]){logger[_0x7487('0x11')](_0x7487('0x18'),_0x5e2825[_0x7487('0x19')]());for(var _0x49c5c5=0x0;_0x49c5c5<_0x5e2825[_0x7487('0x17')];_0x49c5c5++){io[_0x7487('0x1a')](_0x7487('0x1b'),{'id':_0x5e2825[_0x49c5c5],'closed':!![]});}}})[_0x7487('0x1c')](function(_0x2d7eac){logger[_0x7487('0x1d')](_0x7487('0x1e'),_0x2d7eac?util[_0x7487('0x1f')](_0x2d7eac,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1d7e=['lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','error','inspect'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x1d7e,0xa2));var _0xe1d7=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x1d7e[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xe1d7('0x0'));var moment=require('moment');var Redis=require(_0xe1d7('0x1'));var util=require(_0xe1d7('0x2'));var config=require(_0xe1d7('0x3'));var db=require(_0xe1d7('0x4'))['db'];var logger=require(_0xe1d7('0x5'))(_0xe1d7('0x6'));config[_0xe1d7('0x7')]=_[_0xe1d7('0x8')](config[_0xe1d7('0x7')],{'host':_0xe1d7('0x9'),'port':0x18eb});var io=require(_0xe1d7('0xa'))(new Redis(config[_0xe1d7('0x7')]));function closeInteractions(){var _0x1643dc=[];return db[_0xe1d7('0xb')]['findAll']({'raw':!![],'attributes':['id',_0xe1d7('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})[_0xe1d7('0xd')](function(_0x2f35d1){if(_0x2f35d1&&_0x2f35d1[_0xe1d7('0xe')]){_0x1643dc=_[_0xe1d7('0xf')](_0x2f35d1||[],'id');logger[_0xe1d7('0x10')](_0xe1d7('0x11'),_0x1643dc[_0xe1d7('0x12')]());return db['WhatsappInteraction'][_0xe1d7('0x13')]({'closeReason':_0xe1d7('0x14'),'disposition':_0xe1d7('0x15'),'closed':!![],'closedAt':moment()[_0xe1d7('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1643dc}});}})[_0xe1d7('0xd')](function(){if(_0x1643dc&&_0x1643dc[_0xe1d7('0xe')]){logger[_0xe1d7('0x10')](_0xe1d7('0x17'),_0x1643dc[_0xe1d7('0x12')]());for(var _0x2e4ee5=0x0;_0x2e4ee5<_0x1643dc[_0xe1d7('0xe')];_0x2e4ee5++){io[_0xe1d7('0x18')]('whatsappInteraction:update',{'id':_0x1643dc[_0x2e4ee5],'closed':!![]});}}})['catch'](function(_0x3aadd7){logger[_0xe1d7('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x3aadd7?util[_0xe1d7('0x1a')](_0x3aadd7,{'showHidden':![],'depth':null}):'');});}exports['start']=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 9e3762e..0c31305 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20ad=['util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','CmHopper','hopper1','contacts2'];(function(_0x95675b,_0x88d868){var _0x2279e0=function(_0x155a3a){while(--_0x155a3a){_0x95675b['push'](_0x95675b['shift']());}};_0x2279e0(++_0x88d868);}(_0x20ad,0xdd));var _0xd20a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x20ad[_0x50a0c2];return _0x5ebadd;};'use strict';var util=require(_0xd20a('0x0'));var db=require(_0xd20a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd20a('0x2')]({'id':i,'firstName':_0xd20a('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xd20a('0x4')+i+_0xd20a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd20a('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xd20a('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd20a('0x2')]({'id':i,'firstName':_0xd20a('0x3')+i,'lastName':_0xd20a('0x7')+i,'phone':0xf879fb460+i,'email':_0xd20a('0x4')+i+_0xd20a('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd20a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd20a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd20a('0x6')](),'updatedAt':Date['now']()});}db[_0xd20a('0x8')][_0xd20a('0x9')]({'where':{}})[_0xd20a('0xa')](function(){return db[_0xd20a('0x8')][_0xd20a('0xb')](contacts);})[_0xd20a('0xa')](function(){console[_0xd20a('0xc')](_0xd20a('0xd'),'contacts1');return db[_0xd20a('0xe')]['destroy']({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})['then'](function(){console[_0xd20a('0xc')](_0xd20a('0xd'),_0xd20a('0xf'));return db[_0xd20a('0x8')][_0xd20a('0xb')](contacts2);})[_0xd20a('0xa')](function(){console[_0xd20a('0xc')](_0xd20a('0xd'),_0xd20a('0x10'));return db[_0xd20a('0xe')][_0xd20a('0xb')](hopper2);})[_0xd20a('0xa')](function(){console[_0xd20a('0xc')](_0xd20a('0xd'),'hopper2');})['catch'](function(_0x403bfa){console[_0xd20a('0xc')](_0x403bfa);}); \ No newline at end of file +var _0x567c=['innocenzo.biondo','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2','util','Innocenzo','Biondo','@xcally.com','push','now'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x567c,0x162));var _0xc567=function(_0x2de84b,_0x32bd82){_0x2de84b=_0x2de84b-0x0;var _0x3d5943=_0x567c[_0x2de84b];return _0x3d5943;};'use strict';var util=require(_0xc567('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':_0xc567('0x1')+i,'lastName':_0xc567('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc567('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc567('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xc567('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc567('0x5')](),'updatedAt':Date[_0xc567('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc567('0x4')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc567('0x2')+i,'phone':0xf879fb460+i,'email':_0xc567('0x6')+i+_0xc567('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc567('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xc567('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc567('0x5')](),'updatedAt':Date[_0xc567('0x5')]()});}db[_0xc567('0x7')][_0xc567('0x8')]({'where':{}})[_0xc567('0x9')](function(){return db[_0xc567('0x7')][_0xc567('0xa')](contacts);})[_0xc567('0x9')](function(){console[_0xc567('0xb')]('finished\x20populating',_0xc567('0xc'));return db[_0xc567('0xd')][_0xc567('0x8')]({'where':{}});})[_0xc567('0x9')](function(){return db['CmHopper'][_0xc567('0xa')](hopper);})[_0xc567('0x9')](function(){console[_0xc567('0xb')](_0xc567('0xe'),_0xc567('0xf'));return db[_0xc567('0x7')][_0xc567('0xa')](contacts2);})[_0xc567('0x9')](function(){console[_0xc567('0xb')](_0xc567('0xe'),_0xc567('0x10'));return db[_0xc567('0xd')][_0xc567('0xa')](hopper2);})[_0xc567('0x9')](function(){console[_0xc567('0xb')](_0xc567('0xe'),_0xc567('0x11'));})['catch'](function(_0x35eb23){console[_0xc567('0xb')](_0x35eb23);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index d40b5cd..2e933a3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4295=['%s%s','agent','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','log','push','format'];(function(_0x48c6a8,_0x11e119){var _0x23456b=function(_0x1317e9){while(--_0x1317e9){_0x48c6a8['push'](_0x48c6a8['shift']());}};_0x23456b(++_0x11e119);}(_0x4295,0x1c9));var _0x5429=function(_0x25979f,_0x32a3eb){_0x25979f=_0x25979f-0x0;var _0x4de4e7=_0x4295[_0x25979f];return _0x4de4e7;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5429('0x0')]({'name':util[_0x5429('0x1')](_0x5429('0x2'),_0x5429('0x3'),i),'fullname':util['format'](_0x5429('0x2'),'agent',i),'email':util[_0x5429('0x1')]('%s%s@xcally.com',_0x5429('0x3'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x5429('0x4'),'ws','wss'],'disallow':[_0x5429('0x5')],'allow':[_0x5429('0x6')],'defaultuser':util[_0x5429('0x1')]('%s%s',_0x5429('0x3'),i),'encryption':_0x5429('0x7'),'avpf':_0x5429('0x7'),'force_avp':_0x5429('0x7'),'icesupport':_0x5429('0x7'),'dtlsenable':_0x5429('0x7'),'dtlsverify':'no','dtlscertfile':_0x5429('0x8'),'dtlsprivatekey':_0x5429('0x9'),'dtlssetup':_0x5429('0xa'),'callerid':util[_0x5429('0x1')](_0x5429('0xb'),util[_0x5429('0x1')](_0x5429('0x2'),'agent',i),0xfa0+i)});}db[_0x5429('0xc')]['bulkCreate'](users)[_0x5429('0xd')](function(){console['log'](_0x5429('0xe'));})[_0x5429('0xf')](function(_0x2dcfde){console[_0x5429('0x10')](_0x2dcfde);}); \ No newline at end of file +var _0xa1e4=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','then','catch','log','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','ulaw','yes'];(function(_0x6f1f57,_0x6510a4){var _0x51dcf9=function(_0x2770c4){while(--_0x2770c4){_0x6f1f57['push'](_0x6f1f57['shift']());}};_0x51dcf9(++_0x6510a4);}(_0xa1e4,0x1db));var _0x4a1e=function(_0x31ddba,_0x28ec26){_0x31ddba=_0x31ddba-0x0;var _0x3f014c=_0xa1e4[_0x31ddba];return _0x3f014c;};'use strict';var util=require('util');var db=require(_0x4a1e('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4a1e('0x1')]({'name':util[_0x4a1e('0x2')](_0x4a1e('0x3'),_0x4a1e('0x4'),i),'fullname':util['format'](_0x4a1e('0x3'),'agent',i),'email':util['format'](_0x4a1e('0x5'),'agent',i),'role':'agent','password':_0x4a1e('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0x4a1e('0x7'),'ws',_0x4a1e('0x8')],'disallow':['all'],'allow':[_0x4a1e('0x9')],'defaultuser':util[_0x4a1e('0x2')]('%s%s',_0x4a1e('0x4'),i),'encryption':_0x4a1e('0xa'),'avpf':_0x4a1e('0xa'),'force_avp':_0x4a1e('0xa'),'icesupport':'yes','dtlsenable':_0x4a1e('0xa'),'dtlsverify':'no','dtlscertfile':_0x4a1e('0xb'),'dtlsprivatekey':_0x4a1e('0xc'),'dtlssetup':_0x4a1e('0xd'),'callerid':util[_0x4a1e('0x2')](_0x4a1e('0xe'),util[_0x4a1e('0x2')](_0x4a1e('0x3'),_0x4a1e('0x4'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x4a1e('0xf')](function(){console['log']('add\x20user');})[_0x4a1e('0x10')](function(_0x194dc1){console[_0x4a1e('0x11')](_0x194dc1);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 194505b..9dbbd54 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb8=['getWhatsappQueues','all','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','format','%s:queue:%s','length','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','userProfileId','FaxQueues','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x4eb8,0x1b5));var _0x84eb=function(_0x582210,_0x184c36){_0x582210=_0x582210-0x0;var _0x18cf58=_0x4eb8[_0x582210];return _0x18cf58;};'use strict';var _=require(_0x84eb('0x0'));var util=require(_0x84eb('0x1'));var BPromise=require(_0x84eb('0x2'));var db=require(_0x84eb('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x84eb('0x4')],'include':[{'as':_0x84eb('0x5'),'model':db[_0x84eb('0x6')],'attributes':['id',_0x84eb('0x4'),_0x84eb('0x7')],'raw':!![],'where':{'role':_0x84eb('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x84eb('0x4')],'where':{'role':_0x84eb('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x84eb('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x84eb('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x84eb('0x4'),_0x84eb('0xa')],'where':{'type':_0x84eb('0xb')}};function getAssociatedResources(_0x3f3741,_0x8b6743,_0xf85549){return db[_0x84eb('0xc')][_0x84eb('0xd')]({'where':{'name':_0x3f3741,'userProfileId':_0x8b6743},'raw':!![]})['then'](function(_0x15ee2b){if(_0x15ee2b){if(_0x15ee2b[_0x84eb('0xe')]){switch(_0x3f3741){case _0x84eb('0xf'):case _0x84eb('0x10'):case'FaxQueues':case _0x84eb('0x11'):case _0x84eb('0x12'):case _0x84eb('0x13'):case _0x84eb('0x14'):return db[_0xf85549][_0x84eb('0x15')](queryQueues);case'Telephones':return db[_0xf85549][_0x84eb('0x15')](queryTelephones);case _0x84eb('0x16'):return db[_0xf85549][_0x84eb('0x15')](queryTrunks);case _0x84eb('0x17'):return db[_0xf85549][_0x84eb('0x15')](queryCampaigns);}}else{return db[_0x84eb('0x18')][_0x84eb('0x15')]({'attributes':[_0x84eb('0x19')],'where':{'sectionId':_0x15ee2b['id']},'raw':!![]})[_0x84eb('0x1a')](function(_0xb19d09){if(_0xb19d09){var _0x264565={'where':{'id':_[_0x84eb('0x1b')](_0xb19d09,'resourceId')},'raw':!![]};switch(_0xf85549){case _0x84eb('0x6'):_0x264565[_0x84eb('0x1c')][_0x84eb('0x7')]=_0x84eb('0x9');break;case'Campaign':_0x264565['where']['type']='ivr';break;}return db[_0xf85549][_0x84eb('0x15')](_0x264565);}else{return[];}});}}else{return[];}})[_0x84eb('0x1a')](function(_0x365d0a){return _0x365d0a;});}function joinOrLeaveQueues(_0x5bac61,_0x23e26d,_0x183111,_0xdaf548){_0x5bac61[_0x23e26d](util[_0x84eb('0x1d')](_0x84eb('0x1e'),_0x183111,_0xdaf548[_0x84eb('0x4')]));if(_0xdaf548[_0x84eb('0x5')]){for(var _0x5730fd=0x0;_0x5730fd<_0xdaf548[_0x84eb('0x5')][_0x84eb('0x1f')];_0x5730fd+=0x1){_0x5bac61[_0x23e26d](util['format'](_0x84eb('0x20'),_0xdaf548['Agents'][_0x5730fd][_0x84eb('0x4')]));}}}function joinOrLeave(_0x1f8e00,_0x5a8e60,_0x352989){var _0x1fb507;if(_0x1f8e00[_0x84eb('0x21')][_0x84eb('0x22')]['id']){db[_0x84eb('0x6')][_0x84eb('0x23')]({'attributes':['id',_0x84eb('0x4'),_0x84eb('0x7'),'userProfileId'],'where':{'id':_0x1f8e00[_0x84eb('0x21')][_0x84eb('0x22')]['id']},'include':[{'model':db[_0x84eb('0x24')],'as':_0x84eb('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x84eb('0x26')],'as':_0x84eb('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x84eb('0x28')],'as':_0x84eb('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x84eb('0x2a')],'as':_0x84eb('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x84eb('0x2c')],'as':_0x84eb('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x84eb('0x2e')],'as':_0x84eb('0x2f'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x53447d){if(_0x53447d){_0x1fb507=_0x53447d;_0x1f8e00[_0x5a8e60](util[_0x84eb('0x1d')](_0x84eb('0x20'),_0x53447d[_0x84eb('0x4')]));var _0x729cf8=[];switch(_0x53447d['role']){case _0x84eb('0x30'):_0x1f8e00[_0x5a8e60](_0x84eb('0x31'));_0x1f8e00[_0x5a8e60](_0x84eb('0x32'));if(queryQueues['hasOwnProperty'](_0x84eb('0x33'))){delete queryQueues[_0x84eb('0x33')];}_0x729cf8[_0x84eb('0x34')](db['VoiceQueue'][_0x84eb('0x15')](queryQueues));_0x729cf8['push'](db[_0x84eb('0x35')][_0x84eb('0x15')](queryQueues));_0x729cf8[_0x84eb('0x34')](db[_0x84eb('0x36')][_0x84eb('0x15')](queryQueues));_0x729cf8[_0x84eb('0x34')](db[_0x84eb('0x37')][_0x84eb('0x15')](queryQueues));_0x729cf8['push'](db[_0x84eb('0x38')][_0x84eb('0x15')](queryQueues));_0x729cf8['push'](db[_0x84eb('0x39')][_0x84eb('0x15')](queryQueues));_0x729cf8[_0x84eb('0x34')](db[_0x84eb('0x3a')][_0x84eb('0x15')](queryQueues));_0x729cf8['push'](db[_0x84eb('0x6')][_0x84eb('0x15')](queryTelephones));_0x729cf8[_0x84eb('0x34')](db[_0x84eb('0x3b')][_0x84eb('0x15')](queryTrunks));_0x729cf8[_0x84eb('0x34')](db[_0x84eb('0x3c')]['findAll'](queryCampaigns));_0x729cf8['push'](db[_0x84eb('0x6')]['findAll'](queryAgents));break;case _0x84eb('0x3d'):_0x1f8e00[_0x5a8e60](_0x84eb('0x31'));_0x1f8e00[_0x5a8e60](_0x84eb('0x32'));_0x729cf8['push'](getAssociatedResources(_0x84eb('0xf'),_0x53447d[_0x84eb('0x3e')],'VoiceQueue'));_0x729cf8[_0x84eb('0x34')](getAssociatedResources(_0x84eb('0x10'),_0x53447d['userProfileId'],_0x84eb('0x35')));_0x729cf8[_0x84eb('0x34')](getAssociatedResources(_0x84eb('0x3f'),_0x53447d[_0x84eb('0x3e')],_0x84eb('0x36')));_0x729cf8[_0x84eb('0x34')](getAssociatedResources(_0x84eb('0x11'),_0x53447d[_0x84eb('0x3e')],'SmsQueue'));_0x729cf8[_0x84eb('0x34')](getAssociatedResources(_0x84eb('0x12'),_0x53447d['userProfileId'],'MailQueue'));_0x729cf8['push'](getAssociatedResources(_0x84eb('0x13'),_0x53447d[_0x84eb('0x3e')],_0x84eb('0x39')));_0x729cf8['push'](getAssociatedResources(_0x84eb('0x14'),_0x53447d[_0x84eb('0x3e')],_0x84eb('0x3a')));_0x729cf8[_0x84eb('0x34')](getAssociatedResources('Telephones',_0x53447d[_0x84eb('0x3e')],_0x84eb('0x6')));_0x729cf8['push'](getAssociatedResources(_0x84eb('0x16'),_0x53447d['userProfileId'],_0x84eb('0x3b')));_0x729cf8[_0x84eb('0x34')](getAssociatedResources(_0x84eb('0x17'),_0x53447d['userProfileId'],'Campaign'));_0x729cf8[_0x84eb('0x34')](db[_0x84eb('0x6')]['findAll'](queryAgents));break;case _0x84eb('0x8'):_0x1f8e00[_0x5a8e60](_0x84eb('0x31'));_0x1f8e00[_0x5a8e60](_0x84eb('0x32'));_0x729cf8['push'](_0x53447d[_0x84eb('0x40')]({'attributes':['id',_0x84eb('0x4')]}));_0x729cf8[_0x84eb('0x34')](_0x53447d['getChatQueues']({'attributes':['id',_0x84eb('0x4')]}));_0x729cf8['push'](_0x53447d[_0x84eb('0x41')]({'attributes':['id','name']}));_0x729cf8[_0x84eb('0x34')](_0x53447d[_0x84eb('0x42')]({'attributes':['id',_0x84eb('0x4')]}));_0x729cf8[_0x84eb('0x34')](_0x53447d['getMailQueues']({'attributes':['id',_0x84eb('0x4')]}));_0x729cf8['push'](_0x53447d[_0x84eb('0x43')]({'attributes':['id',_0x84eb('0x4')]}));_0x729cf8[_0x84eb('0x34')](_0x53447d[_0x84eb('0x44')]({'attributes':['id',_0x84eb('0x4')]}));break;}return BPromise[_0x84eb('0x45')](_0x729cf8);}})[_0x84eb('0x1a')](function(_0x244319){if(_0x244319&&_0x244319['length']){for(var _0x4a8e5b=0x0;_0x4a8e5b<_0x244319[_0x84eb('0x1f')];_0x4a8e5b+=0x1){for(var _0xbbfdb=0x0;_0xbbfdb<_0x244319[_0x4a8e5b][_0x84eb('0x1f')];_0xbbfdb+=0x1){switch(_0x4a8e5b){case 0x0:joinOrLeaveQueues(_0x1f8e00,_0x5a8e60,'voice',_0x244319[_0x4a8e5b][_0xbbfdb]);break;case 0x1:joinOrLeaveQueues(_0x1f8e00,_0x5a8e60,'chat',_0x244319[_0x4a8e5b][_0xbbfdb]);break;case 0x2:joinOrLeaveQueues(_0x1f8e00,_0x5a8e60,'fax',_0x244319[_0x4a8e5b][_0xbbfdb]);break;case 0x3:joinOrLeaveQueues(_0x1f8e00,_0x5a8e60,_0x84eb('0x46'),_0x244319[_0x4a8e5b][_0xbbfdb]);break;case 0x4:joinOrLeaveQueues(_0x1f8e00,_0x5a8e60,_0x84eb('0x47'),_0x244319[_0x4a8e5b][_0xbbfdb]);break;case 0x5:joinOrLeaveQueues(_0x1f8e00,_0x5a8e60,_0x84eb('0x48'),_0x244319[_0x4a8e5b][_0xbbfdb]);break;case 0x6:joinOrLeaveQueues(_0x1f8e00,_0x5a8e60,_0x84eb('0x49'),_0x244319[_0x4a8e5b][_0xbbfdb]);break;case 0x7:if(_0x1fb507[_0x84eb('0x7')]!=='agent')_0x1f8e00[_0x5a8e60](util['format']('telephone:%s',_0x244319[_0x4a8e5b][_0xbbfdb][_0x84eb('0x4')]));break;case 0x8:if(_0x1fb507[_0x84eb('0x7')]!==_0x84eb('0x8'))_0x1f8e00[_0x5a8e60](util[_0x84eb('0x1d')](_0x84eb('0x4a'),_0x244319[_0x4a8e5b][_0xbbfdb][_0x84eb('0x4')]));break;case 0x9:if(_0x1fb507[_0x84eb('0x7')]!==_0x84eb('0x8'))_0x1f8e00[_0x5a8e60](util[_0x84eb('0x1d')](_0x84eb('0x4b'),_0x244319[_0x4a8e5b][_0xbbfdb][_0x84eb('0xa')],_0x244319[_0x4a8e5b][_0xbbfdb][_0x84eb('0x4')]));break;case 0xa:_0x1f8e00[_0x5a8e60](util[_0x84eb('0x1d')](_0x84eb('0x20'),_0x244319[_0x4a8e5b][_0xbbfdb][_0x84eb('0x4')]));break;}}}}})[_0x84eb('0x1a')](function(){if(_0x5a8e60===_0x84eb('0x4c')){var _0x87f03d=_[_0x84eb('0x1b')](_0x1fb507[_0x84eb('0x25')],'id');return _0x1fb507[_0x84eb('0x4d')](_0x87f03d)['then'](function(){for(var _0x4b019b=0x0;_0x4b019b<_0x87f03d[_0x84eb('0x1f')];_0x4b019b+=0x1){_0x352989[_0x84eb('0x4e')](_0x84eb('0x4f'),{'ChatInteractionId':Number(_0x87f03d[_0x4b019b]),'UserId':Number(_0x1fb507['id'])});}});}})[_0x84eb('0x1a')](function(){if(_0x5a8e60===_0x84eb('0x4c')){var _0x4d4224=_[_0x84eb('0x1b')](_0x1fb507['MailInteractions'],'id');return _0x1fb507[_0x84eb('0x50')](_0x4d4224)[_0x84eb('0x1a')](function(){for(var _0x4b93a2=0x0;_0x4b93a2<_0x4d4224[_0x84eb('0x1f')];_0x4b93a2+=0x1){_0x352989[_0x84eb('0x4e')](_0x84eb('0x51'),{'MailInteractionId':Number(_0x4d4224[_0x4b93a2]),'UserId':Number(_0x1fb507['id'])});}});}})[_0x84eb('0x1a')](function(){if(_0x5a8e60===_0x84eb('0x4c')){var _0x12d35b=_[_0x84eb('0x1b')](_0x1fb507[_0x84eb('0x29')],'id');return _0x1fb507[_0x84eb('0x52')](_0x12d35b)[_0x84eb('0x1a')](function(){for(var _0x42c41a=0x0;_0x42c41a<_0x12d35b['length'];_0x42c41a+=0x1){_0x352989[_0x84eb('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x12d35b[_0x42c41a]),'UserId':Number(_0x1fb507['id'])});}});}})[_0x84eb('0x1a')](function(){if(_0x5a8e60===_0x84eb('0x4c')){var _0x583e67=_[_0x84eb('0x1b')](_0x1fb507[_0x84eb('0x2b')],'id');return _0x1fb507[_0x84eb('0x53')](_0x583e67)[_0x84eb('0x1a')](function(){for(var _0x1ba910=0x0;_0x1ba910<_0x583e67[_0x84eb('0x1f')];_0x1ba910+=0x1){_0x352989['emit'](_0x84eb('0x54'),{'SmsInteractionId':Number(_0x583e67[_0x1ba910]),'UserId':Number(_0x1fb507['id'])});}});}})[_0x84eb('0x1a')](function(){if(_0x5a8e60===_0x84eb('0x4c')){var _0x394abc=_[_0x84eb('0x1b')](_0x1fb507[_0x84eb('0x2d')],'id');return _0x1fb507['removeOpenchannelInteractions'](_0x394abc)['then'](function(){for(var _0x5c88cf=0x0;_0x5c88cf<_0x394abc[_0x84eb('0x1f')];_0x5c88cf+=0x1){_0x352989[_0x84eb('0x4e')](_0x84eb('0x55'),{'OpenchannelInteractionId':Number(_0x394abc[_0x5c88cf]),'UserId':Number(_0x1fb507['id'])});}});}})[_0x84eb('0x1a')](function(){if(_0x5a8e60===_0x84eb('0x4c')){var _0x3826e4=_[_0x84eb('0x1b')](_0x1fb507['WhatsappInteractions'],'id');return _0x1fb507[_0x84eb('0x56')](_0x3826e4)[_0x84eb('0x1a')](function(){for(var _0x37e90a=0x0;_0x37e90a<_0x3826e4[_0x84eb('0x1f')];_0x37e90a+=0x1){_0x352989['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3826e4[_0x37e90a]),'UserId':Number(_0x1fb507['id'])});}});}})[_0x84eb('0x57')](function(_0x39a38a){_0x1f8e00[_0x84eb('0x58')](_0x39a38a);});}}function onDisconnect(_0x187730,_0x56a75c){joinOrLeave(_0x187730,'leave',_0x56a75c);}function onConnect(_0x26f899){joinOrLeave(_0x26f899,_0x84eb('0x59'));}exports[_0x84eb('0x5a')]=function(_0x17f7ba){_0x17f7ba['on'](_0x84eb('0x5b'),function(_0x239b67){_0x239b67[_0x84eb('0x5c')](0x0);_0x239b67[_0x84eb('0x5d')]=_0x239b67[_0x84eb('0x5e')][_0x84eb('0x5b')][_0x84eb('0x5f')]+':'+_0x239b67[_0x84eb('0x5e')][_0x84eb('0x5b')]['remotePort'];_0x239b67[_0x84eb('0x60')]=new Date();_0x239b67[_0x84eb('0x58')]=function(_0x6d2e0c){console[_0x84eb('0x58')](_0x84eb('0x61')+_0x239b67[_0x84eb('0x62')][_0x84eb('0x4')]+'['+_0x239b67[_0x84eb('0x5d')]+']',_0x6d2e0c);};_0x239b67['on'](_0x84eb('0x63'),function(){onDisconnect(_0x239b67,_0x17f7ba);_0x239b67[_0x84eb('0x58')](_0x84eb('0x64'));});onConnect(_0x239b67);_0x239b67['log']('CONNECTED');});}; \ No newline at end of file +var _0xef0a=['connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','type','format','%s:queue:%s','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','MailQueue','WhatsappQueue','Campaign','user','VoiceQueues','userProfileId','FaxQueue','SmsQueues','OpenchannelQueues','OpenchannelQueue','WhatsappQueues','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','map','removeFaxInteractions','user_has_fax_interactions:remove','emit','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','join','default','connection','setMaxListeners','address','request','remoteAddress'];(function(_0x51ffc,_0x5f325e){var _0x31333a=function(_0x5d9eed){while(--_0x5d9eed){_0x51ffc['push'](_0x51ffc['shift']());}};_0x31333a(++_0x5f325e);}(_0xef0a,0xdd));var _0xaef0=function(_0x572b16,_0x51f5b3){_0x572b16=_0x572b16-0x0;var _0x5619d0=_0xef0a[_0x572b16];return _0x5619d0;};'use strict';var _=require(_0xaef0('0x0'));var util=require(_0xaef0('0x1'));var BPromise=require(_0xaef0('0x2'));var db=require(_0xaef0('0x3'))['db'];var config=require(_0xaef0('0x4'));var queryQueues={'attributes':['id',_0xaef0('0x5')],'include':[{'as':_0xaef0('0x6'),'model':db[_0xaef0('0x7')],'attributes':['id',_0xaef0('0x5'),_0xaef0('0x8')],'raw':!![],'where':{'role':_0xaef0('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xaef0('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0xaef0('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xaef0('0x5')],'where':{'role':_0xaef0('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0xaef0('0xb')}};function getAssociatedResources(_0x30819e,_0x8007a8,_0x280d93){return db[_0xaef0('0xc')][_0xaef0('0xd')]({'where':{'name':_0x30819e,'userProfileId':_0x8007a8},'raw':!![]})[_0xaef0('0xe')](function(_0x481978){if(_0x481978){if(_0x481978[_0xaef0('0xf')]){switch(_0x30819e){case'VoiceQueues':case _0xaef0('0x10'):case _0xaef0('0x11'):case'SmsQueues':case _0xaef0('0x12'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x280d93][_0xaef0('0x13')](queryQueues);case _0xaef0('0x14'):return db[_0x280d93][_0xaef0('0x13')](queryTelephones);case _0xaef0('0x15'):return db[_0x280d93][_0xaef0('0x13')](queryTrunks);case _0xaef0('0x16'):return db[_0x280d93][_0xaef0('0x13')](queryCampaigns);}}else{return db[_0xaef0('0x17')][_0xaef0('0x13')]({'attributes':[_0xaef0('0x18')],'where':{'sectionId':_0x481978['id']},'raw':!![]})[_0xaef0('0xe')](function(_0x92e88c){if(_0x92e88c){var _0x44cd68={'where':{'id':_['map'](_0x92e88c,_0xaef0('0x18'))},'raw':!![]};switch(_0x280d93){case _0xaef0('0x7'):_0x44cd68['where'][_0xaef0('0x8')]=_0xaef0('0xa');break;case'Campaign':_0x44cd68[_0xaef0('0x19')][_0xaef0('0x1a')]='ivr';break;}return db[_0x280d93]['findAll'](_0x44cd68);}else{return[];}});}}else{return[];}})[_0xaef0('0xe')](function(_0x13ef39){return _0x13ef39;});}function joinOrLeaveQueues(_0x103fe9,_0x363df9,_0x3ee11e,_0x56f370){_0x103fe9[_0x363df9](util[_0xaef0('0x1b')](_0xaef0('0x1c'),_0x3ee11e,_0x56f370['name']));if(_0x56f370[_0xaef0('0x6')]){for(var _0x5037e7=0x0;_0x5037e7<_0x56f370[_0xaef0('0x6')]['length'];_0x5037e7+=0x1){_0x103fe9[_0x363df9](util[_0xaef0('0x1b')](_0xaef0('0x1d'),_0x56f370['Agents'][_0x5037e7][_0xaef0('0x5')]));}}}function joinOrLeave(_0x58fdf9,_0x572574,_0x294f2e){var _0x4da865;if(_0x58fdf9[_0xaef0('0x1e')][_0xaef0('0x1f')]['id']){db['User'][_0xaef0('0x20')]({'attributes':['id',_0xaef0('0x5'),_0xaef0('0x8'),'userProfileId'],'where':{'id':_0x58fdf9[_0xaef0('0x1e')]['query']['id']},'include':[{'model':db[_0xaef0('0x21')],'as':_0xaef0('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xaef0('0x23')],'as':_0xaef0('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xaef0('0x25')],'as':_0xaef0('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xaef0('0x27')],'as':_0xaef0('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xaef0('0x29')],'as':_0xaef0('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xaef0('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xaef0('0xe')](function(_0x29661c){if(_0x29661c){_0x4da865=_0x29661c;_0x58fdf9[_0x572574](util['format'](_0xaef0('0x1d'),_0x29661c[_0xaef0('0x5')]));var _0x56c248=[];switch(_0x29661c['role']){case'admin':_0x58fdf9[_0x572574](_0xaef0('0x2c'));_0x58fdf9[_0x572574](_0xaef0('0x2d'));if(queryQueues[_0xaef0('0x2e')](_0xaef0('0x2f'))){delete queryQueues[_0xaef0('0x2f')];}_0x56c248[_0xaef0('0x30')](db['VoiceQueue'][_0xaef0('0x13')](queryQueues));_0x56c248[_0xaef0('0x30')](db[_0xaef0('0x31')][_0xaef0('0x13')](queryQueues));_0x56c248[_0xaef0('0x30')](db['FaxQueue'][_0xaef0('0x13')](queryQueues));_0x56c248[_0xaef0('0x30')](db[_0xaef0('0x32')][_0xaef0('0x13')](queryQueues));_0x56c248['push'](db[_0xaef0('0x33')][_0xaef0('0x13')](queryQueues));_0x56c248[_0xaef0('0x30')](db['OpenchannelQueue'][_0xaef0('0x13')](queryQueues));_0x56c248['push'](db[_0xaef0('0x34')]['findAll'](queryQueues));_0x56c248[_0xaef0('0x30')](db[_0xaef0('0x7')]['findAll'](queryTelephones));_0x56c248[_0xaef0('0x30')](db['Trunk'][_0xaef0('0x13')](queryTrunks));_0x56c248[_0xaef0('0x30')](db[_0xaef0('0x35')][_0xaef0('0x13')](queryCampaigns));_0x56c248['push'](db[_0xaef0('0x7')][_0xaef0('0x13')](queryAgents));break;case _0xaef0('0x36'):_0x58fdf9[_0x572574]('voice:inbound');_0x58fdf9[_0x572574](_0xaef0('0x2d'));_0x56c248['push'](getAssociatedResources(_0xaef0('0x37'),_0x29661c['userProfileId'],'VoiceQueue'));_0x56c248[_0xaef0('0x30')](getAssociatedResources(_0xaef0('0x10'),_0x29661c['userProfileId'],'ChatQueue'));_0x56c248['push'](getAssociatedResources('FaxQueues',_0x29661c[_0xaef0('0x38')],_0xaef0('0x39')));_0x56c248[_0xaef0('0x30')](getAssociatedResources(_0xaef0('0x3a'),_0x29661c[_0xaef0('0x38')],_0xaef0('0x32')));_0x56c248[_0xaef0('0x30')](getAssociatedResources(_0xaef0('0x12'),_0x29661c['userProfileId'],_0xaef0('0x33')));_0x56c248[_0xaef0('0x30')](getAssociatedResources(_0xaef0('0x3b'),_0x29661c[_0xaef0('0x38')],_0xaef0('0x3c')));_0x56c248[_0xaef0('0x30')](getAssociatedResources(_0xaef0('0x3d'),_0x29661c[_0xaef0('0x38')],_0xaef0('0x34')));_0x56c248[_0xaef0('0x30')](getAssociatedResources('Telephones',_0x29661c[_0xaef0('0x38')],_0xaef0('0x7')));_0x56c248[_0xaef0('0x30')](getAssociatedResources('Trunks',_0x29661c['userProfileId'],_0xaef0('0x3e')));_0x56c248['push'](getAssociatedResources(_0xaef0('0x16'),_0x29661c[_0xaef0('0x38')],_0xaef0('0x35')));_0x56c248[_0xaef0('0x30')](db[_0xaef0('0x7')]['findAll'](queryAgents));break;case _0xaef0('0x9'):_0x58fdf9[_0x572574](_0xaef0('0x2c'));_0x58fdf9[_0x572574](_0xaef0('0x2d'));_0x56c248[_0xaef0('0x30')](_0x29661c[_0xaef0('0x3f')]({'attributes':['id',_0xaef0('0x5')]}));_0x56c248[_0xaef0('0x30')](_0x29661c[_0xaef0('0x40')]({'attributes':['id',_0xaef0('0x5')]}));_0x56c248[_0xaef0('0x30')](_0x29661c[_0xaef0('0x41')]({'attributes':['id','name']}));_0x56c248[_0xaef0('0x30')](_0x29661c[_0xaef0('0x42')]({'attributes':['id',_0xaef0('0x5')]}));_0x56c248[_0xaef0('0x30')](_0x29661c[_0xaef0('0x43')]({'attributes':['id',_0xaef0('0x5')]}));_0x56c248[_0xaef0('0x30')](_0x29661c[_0xaef0('0x44')]({'attributes':['id',_0xaef0('0x5')]}));_0x56c248['push'](_0x29661c[_0xaef0('0x45')]({'attributes':['id',_0xaef0('0x5')]}));break;}return BPromise[_0xaef0('0x46')](_0x56c248);}})[_0xaef0('0xe')](function(_0x1c6290){if(_0x1c6290&&_0x1c6290[_0xaef0('0x47')]){for(var _0x136fbf=0x0;_0x136fbf<_0x1c6290[_0xaef0('0x47')];_0x136fbf+=0x1){for(var _0x432d49=0x0;_0x432d49<_0x1c6290[_0x136fbf][_0xaef0('0x47')];_0x432d49+=0x1){switch(_0x136fbf){case 0x0:joinOrLeaveQueues(_0x58fdf9,_0x572574,_0xaef0('0x48'),_0x1c6290[_0x136fbf][_0x432d49]);break;case 0x1:joinOrLeaveQueues(_0x58fdf9,_0x572574,_0xaef0('0x49'),_0x1c6290[_0x136fbf][_0x432d49]);break;case 0x2:joinOrLeaveQueues(_0x58fdf9,_0x572574,'fax',_0x1c6290[_0x136fbf][_0x432d49]);break;case 0x3:joinOrLeaveQueues(_0x58fdf9,_0x572574,'sms',_0x1c6290[_0x136fbf][_0x432d49]);break;case 0x4:joinOrLeaveQueues(_0x58fdf9,_0x572574,_0xaef0('0x4a'),_0x1c6290[_0x136fbf][_0x432d49]);break;case 0x5:joinOrLeaveQueues(_0x58fdf9,_0x572574,_0xaef0('0x4b'),_0x1c6290[_0x136fbf][_0x432d49]);break;case 0x6:joinOrLeaveQueues(_0x58fdf9,_0x572574,'whatsapp',_0x1c6290[_0x136fbf][_0x432d49]);break;case 0x7:if(_0x4da865['role']!==_0xaef0('0x9'))_0x58fdf9[_0x572574](util[_0xaef0('0x1b')](_0xaef0('0x4c'),_0x1c6290[_0x136fbf][_0x432d49]['name']));break;case 0x8:if(_0x4da865[_0xaef0('0x8')]!==_0xaef0('0x9'))_0x58fdf9[_0x572574](util['format'](_0xaef0('0x4d'),_0x1c6290[_0x136fbf][_0x432d49][_0xaef0('0x5')]));break;case 0x9:if(_0x4da865['role']!==_0xaef0('0x9'))_0x58fdf9[_0x572574](util[_0xaef0('0x1b')](_0xaef0('0x4e'),_0x1c6290[_0x136fbf][_0x432d49][_0xaef0('0x1a')],_0x1c6290[_0x136fbf][_0x432d49][_0xaef0('0x5')]));break;case 0xa:_0x58fdf9[_0x572574](util[_0xaef0('0x1b')](_0xaef0('0x1d'),_0x1c6290[_0x136fbf][_0x432d49][_0xaef0('0x5')]));break;}}}}})[_0xaef0('0xe')](function(){if(_0x572574==='leave'){var _0x3f52e4=_['map'](_0x4da865['ChatInteractions'],'id');return _0x4da865[_0xaef0('0x4f')](_0x3f52e4)[_0xaef0('0xe')](function(){for(var _0x4bc83a=0x0;_0x4bc83a<_0x3f52e4[_0xaef0('0x47')];_0x4bc83a+=0x1){_0x294f2e['emit'](_0xaef0('0x50'),{'ChatInteractionId':Number(_0x3f52e4[_0x4bc83a]),'UserId':Number(_0x4da865['id'])});}});}})[_0xaef0('0xe')](function(){if(_0x572574===_0xaef0('0x51')){var _0x375d5e=_['map'](_0x4da865[_0xaef0('0x24')],'id');return _0x4da865[_0xaef0('0x52')](_0x375d5e)[_0xaef0('0xe')](function(){for(var _0x272ad9=0x0;_0x272ad9<_0x375d5e[_0xaef0('0x47')];_0x272ad9+=0x1){_0x294f2e['emit'](_0xaef0('0x53'),{'MailInteractionId':Number(_0x375d5e[_0x272ad9]),'UserId':Number(_0x4da865['id'])});}});}})[_0xaef0('0xe')](function(){if(_0x572574===_0xaef0('0x51')){var _0x2eb3f0=_[_0xaef0('0x54')](_0x4da865['FaxInteractions'],'id');return _0x4da865[_0xaef0('0x55')](_0x2eb3f0)[_0xaef0('0xe')](function(){for(var _0x5016fa=0x0;_0x5016fa<_0x2eb3f0[_0xaef0('0x47')];_0x5016fa+=0x1){_0x294f2e['emit'](_0xaef0('0x56'),{'FaxInteractionId':Number(_0x2eb3f0[_0x5016fa]),'UserId':Number(_0x4da865['id'])});}});}})['then'](function(){if(_0x572574===_0xaef0('0x51')){var _0x292252=_[_0xaef0('0x54')](_0x4da865[_0xaef0('0x28')],'id');return _0x4da865['removeSmsInteractions'](_0x292252)['then'](function(){for(var _0x2a5bfc=0x0;_0x2a5bfc<_0x292252[_0xaef0('0x47')];_0x2a5bfc+=0x1){_0x294f2e[_0xaef0('0x57')](_0xaef0('0x58'),{'SmsInteractionId':Number(_0x292252[_0x2a5bfc]),'UserId':Number(_0x4da865['id'])});}});}})[_0xaef0('0xe')](function(){if(_0x572574==='leave'){var _0x5b2a48=_[_0xaef0('0x54')](_0x4da865[_0xaef0('0x2a')],'id');return _0x4da865[_0xaef0('0x59')](_0x5b2a48)[_0xaef0('0xe')](function(){for(var _0x261960=0x0;_0x261960<_0x5b2a48[_0xaef0('0x47')];_0x261960+=0x1){_0x294f2e[_0xaef0('0x57')](_0xaef0('0x5a'),{'OpenchannelInteractionId':Number(_0x5b2a48[_0x261960]),'UserId':Number(_0x4da865['id'])});}});}})[_0xaef0('0xe')](function(){if(_0x572574===_0xaef0('0x51')){var _0x3173fb=_[_0xaef0('0x54')](_0x4da865[_0xaef0('0x2b')],'id');return _0x4da865[_0xaef0('0x5b')](_0x3173fb)[_0xaef0('0xe')](function(){for(var _0x3efd11=0x0;_0x3efd11<_0x3173fb[_0xaef0('0x47')];_0x3efd11+=0x1){_0x294f2e['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3173fb[_0x3efd11]),'UserId':Number(_0x4da865['id'])});}});}})[_0xaef0('0x5c')](function(_0x53563c){_0x58fdf9['log'](_0x53563c);});}}function onDisconnect(_0x47e3a3,_0x215ee4){joinOrLeave(_0x47e3a3,_0xaef0('0x51'),_0x215ee4);}function onConnect(_0xfddf){joinOrLeave(_0xfddf,_0xaef0('0x5d'));}exports[_0xaef0('0x5e')]=function(_0x403752){_0x403752['on'](_0xaef0('0x5f'),function(_0x24ee34){_0x24ee34[_0xaef0('0x60')](0x0);_0x24ee34[_0xaef0('0x61')]=_0x24ee34[_0xaef0('0x62')][_0xaef0('0x5f')][_0xaef0('0x63')]+':'+_0x24ee34[_0xaef0('0x62')][_0xaef0('0x5f')]['remotePort'];_0x24ee34[_0xaef0('0x64')]=new Date();_0x24ee34[_0xaef0('0x65')]=function(_0x407136){console[_0xaef0('0x65')](_0xaef0('0x66')+_0x24ee34[_0xaef0('0x67')][_0xaef0('0x5')]+'['+_0x24ee34[_0xaef0('0x61')]+']',_0x407136);};_0x24ee34['on'](_0xaef0('0x68'),function(){onDisconnect(_0x24ee34,_0x403752);_0x24ee34['log'](_0xaef0('0x69'));});onConnect(_0x24ee34);_0x24ee34[_0xaef0('0x65')](_0xaef0('0x6a'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index d29dcb1..e76e9a6 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 _0x0661=['closedinteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','contact','UserId','interface','SIP/%s','name','agent','outgoingmessage','AfterCreate','changed','closed','substatus','SELECT','format','User','find','fullname','email','internal','default','length','hasOwnProperty','model','callback','toLowerCase','util','../../mysqldb','jayson/promise','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction'];(function(_0x29af0e,_0x35f669){var _0x349e39=function(_0x251fba){while(--_0x251fba){_0x29af0e['push'](_0x29af0e['shift']());}};_0x349e39(++_0x35f669);}(_0x0661,0xc7));var _0x1066=function(_0xbf400c,_0x37e1e7){_0xbf400c=_0xbf400c-0x0;var _0x2ee697=_0x0661[_0xbf400c];return _0x2ee697;};'use strict';var util=require(_0x1066('0x0'));var db=require(_0x1066('0x1'))['db'];var jayson=require(_0x1066('0x2'));var logger=require('../logger')(_0x1066('0x3'));var client=jayson[_0x1066('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x1066('0x5'),'model':_0x1066('0x6'),'event':_0x1066('0x7'),'condition':_0x1066('0x8'),'callback':afterCreate},{'channel':_0x1066('0x5'),'model':_0x1066('0x6'),'event':_0x1066('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1066('0x5'),'model':_0x1066('0xa'),'event':_0x1066('0x7'),'condition':_0x1066('0xb'),'callback':afterCreateMessage},{'channel':'Chat','model':'ChatOfflineMessage','event':_0x1066('0x7'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x1066('0xc'),'event':'afterCreate','condition':_0x1066('0x8'),'callback':afterCreate},{'channel':_0x1066('0xd'),'model':_0x1066('0xc'),'event':_0x1066('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1066('0xd'),'model':_0x1066('0xe'),'event':_0x1066('0x7'),'condition':_0x1066('0xb'),'callback':afterCreateMessage},{'channel':_0x1066('0xf'),'model':_0x1066('0x10'),'event':'afterCreate','condition':_0x1066('0x8'),'callback':afterCreate},{'channel':_0x1066('0xf'),'model':_0x1066('0x10'),'event':_0x1066('0x9'),'condition':_0x1066('0x11'),'callback':afterUpdate},{'channel':_0x1066('0xf'),'model':_0x1066('0x12'),'event':'afterCreate','condition':_0x1066('0xb'),'callback':afterCreateMessage},{'channel':_0x1066('0x13'),'model':'FaxInteraction','event':_0x1066('0x7'),'condition':_0x1066('0x8'),'callback':afterCreate},{'channel':_0x1066('0x13'),'model':_0x1066('0x14'),'event':_0x1066('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1066('0x13'),'model':'FaxMessage','event':_0x1066('0x7'),'condition':_0x1066('0xb'),'callback':afterCreateMessage},{'channel':_0x1066('0x15'),'model':_0x1066('0x16'),'event':_0x1066('0x7'),'condition':_0x1066('0x8'),'callback':afterCreate},{'channel':_0x1066('0x15'),'model':_0x1066('0x16'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1066('0x15'),'model':_0x1066('0x17'),'event':'afterCreate','condition':_0x1066('0xb'),'callback':afterCreateMessage},{'channel':_0x1066('0x18'),'model':_0x1066('0x19'),'event':'afterCreate','condition':_0x1066('0x8'),'callback':afterCreate},{'channel':_0x1066('0x18'),'model':'OpenchannelInteraction','event':_0x1066('0x9'),'condition':_0x1066('0x11'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x1066('0x1a'),'event':'afterCreate','condition':_0x1066('0xb'),'callback':afterCreateMessage}];function request(_0x263852){return client[_0x1066('0x1b')](_0x1066('0x1c'),_0x263852)[_0x1066('0x1d')](function(_0x578556){logger[_0x1066('0x1e')](_0x1066('0x1f'),_0x1066('0x1c'),_0x578556);if(_0x578556[_0x1066('0x20')]){if(_0x578556[_0x1066('0x20')][_0x1066('0x21')]===0x1f4){logger[_0x1066('0x20')](_0x1066('0x1f'),_0x1066('0x1c'),_0x578556[_0x1066('0x20')]);}}})[_0x1066('0x22')](function(_0x5b03c3){logger[_0x1066('0x20')](_0x1066('0x1f'),_0x1066('0x1c'),_0x5b03c3);});}function afterCreateMessage(_0x191a05){return function(_0x18d9b4){_0x18d9b4=_0x18d9b4[_0x1066('0x23')]({'plain':!![]});_0x18d9b4[_0x1066('0x24')]=_0x191a05;_0x18d9b4[_0x1066('0x25')]=_0x191a05;_0x18d9b4[_0x1066('0x26')]=_0x18d9b4[_0x1066('0x27')];Promise[_0x1066('0x28')]()[_0x1066('0x1d')](function(){if(typeof _0x18d9b4[_0x1066('0x29')]===_0x1066('0x2a'))return null;var _0x2438a2=_0x1066('0x2b')+_0x18d9b4[_0x1066('0x29')];return db[_0x1066('0x2c')][_0x1066('0x2d')](_0x2438a2,{'type':db[_0x1066('0x2e')][_0x1066('0x2f')]['SELECT'],'raw':!![]});})[_0x1066('0x1d')](function(_0x41e066){if(_0x41e066){_0x18d9b4[_0x1066('0x30')]=_0x41e066[0x0];}if(typeof _0x18d9b4[_0x1066('0x31')]===_0x1066('0x2a'))return;return getAgent(_0x18d9b4['UserId']);})[_0x1066('0x1d')](function(_0x590ccf){if(_0x590ccf){_0x18d9b4[_0x1066('0x32')]=util['format'](_0x1066('0x33'),_0x590ccf[_0x1066('0x34')]);_0x18d9b4[_0x1066('0x35')]=_0x590ccf;_0x18d9b4[_0x1066('0x24')]=_0x191a05;return request({'event':'incomingmessage','message':_0x18d9b4});}else{return request({'event':_0x1066('0x36'),'message':_0x18d9b4});}})[_0x1066('0x22')](function(_0x111298){logger['error']('Trigger,\x20%s','AfterCreateMessage',_0x111298);});};}function afterCreateOfflineMessage(_0x10ea1c){return function(_0x3c7c9a){_0x3c7c9a=_0x3c7c9a[_0x1066('0x23')]({'plain':!![]});_0x3c7c9a['channel']=_0x10ea1c;_0x3c7c9a[_0x1066('0x25')]=_0x10ea1c;_0x3c7c9a[_0x1066('0x26')]='offlineMessage';return request({'event':_0x3c7c9a['event'],'message':_0x3c7c9a});};}function afterCreate(_0xf1ca3d,_0x3a7eb5){return function(_0x261db1){_0x261db1=_0x261db1['get']({'plain':!![]});_0x261db1[_0x1066('0x24')]=_0xf1ca3d;_0x261db1[_0x1066('0x25')]=_0xf1ca3d;_0x261db1['event']='opened';Promise[_0x1066('0x28')]()[_0x1066('0x1d')](function(){var _0x3a4c5d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x261db1['ContactId'];return db[_0x1066('0x2c')][_0x1066('0x2d')](_0x3a4c5d,{'type':db[_0x1066('0x2e')][_0x1066('0x2f')]['SELECT'],'raw':!![]});})['then'](function(_0x58d0a8){if(_0x58d0a8){_0x261db1[_0x1066('0x30')]=_0x58d0a8[0x0];}if(typeof _0x261db1[_0x1066('0x31')]===_0x1066('0x2a'))return;return getAgent(_0x261db1['UserId']);})['then'](function(_0xba56fd){if(_0xba56fd){_0x261db1['interface']=util['format']('SIP/%s',_0xba56fd[_0x1066('0x34')]);_0x261db1['agent']=_0xba56fd;}return request({'event':_0x3a7eb5,'message':_0x261db1});})[_0x1066('0x22')](function(_0x2e5dd2){logger[_0x1066('0x20')](_0x1066('0x1f'),_0x1066('0x37'),_0x2e5dd2);});};}function afterUpdate(_0x22b608){return function(_0x25613a){var _0x59b5b1=_0x25613a[_0x1066('0x38')](_0x1066('0x39'))&&_0x25613a[_0x1066('0x39')];var _0xf068fa=_0x25613a[_0x1066('0x38')](_0x1066('0x3a'));if(_0x59b5b1||_0xf068fa){var _0x36d879=_0x59b5b1?'closedinteraction':_0x1066('0x3a');var _0x1f7bec=_0x25613a[_0x1066('0x23')]({'plain':!![]});_0x1f7bec[_0x1066('0x24')]=_0x22b608;_0x1f7bec[_0x1066('0x25')]=_0x22b608;_0x1f7bec[_0x1066('0x26')]=_0x59b5b1?_0x1066('0x39'):_0x1066('0x3a');var _0x1ed25f=_0x1066('0x2b')+_0x1f7bec[_0x1066('0x29')];return db[_0x1066('0x2c')][_0x1066('0x2d')](_0x1ed25f,{'type':db[_0x1066('0x2e')][_0x1066('0x2f')][_0x1066('0x3b')],'raw':!![]})['then'](function(_0x40dce0){if(_0x40dce0){_0x1f7bec['contact']=_0x40dce0[0x0];}if(typeof _0x1f7bec['UserId']==='undefined')return;return getAgent(_0x1f7bec[_0x1066('0x31')]);})[_0x1066('0x1d')](function(_0x104ce1){if(_0x104ce1){_0x1f7bec[_0x1066('0x32')]=util[_0x1066('0x3c')]('SIP/%s',_0x104ce1[_0x1066('0x34')]);_0x1f7bec[_0x1066('0x35')]=_0x104ce1;}return request({'event':_0x36d879,'message':_0x1f7bec});})[_0x1066('0x22')](function(_0x5e2f19){logger[_0x1066('0x20')](_0x1066('0x1f'),'AfterUpdate',_0x5e2f19);});}};}function getAgent(_0x3a4241){return db[_0x1066('0x3d')][_0x1066('0x3e')]({'where':{'id':_0x3a4241},'attributes':['id',_0x1066('0x34'),_0x1066('0x3f'),_0x1066('0x40'),_0x1066('0x41')],'raw':!![]})['then'](function(_0x438c45){return _0x438c45;});}exports[_0x1066('0x42')]=function(){for(var _0x57446e=0x0;_0x57446e=_0x4eb500['agents']){throw Error(_0x9576('0x11'));}_0x22cdb2(_0x52aad3);})[_0x9576('0x12')](function(_0xb567dc){_0x5d1352(_0xb567dc);});});}; \ No newline at end of file +var _0x15ff=['catch','lodash','../mysqldb','voice','mail','chat','fax','sms','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes','getLicense','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x456200,_0x3d4c03){var _0x551f2e=function(_0x807f2d){while(--_0x807f2d){_0x456200['push'](_0x456200['shift']());}};_0x551f2e(++_0x3d4c03);}(_0x15ff,0x161));var _0xf15f=function(_0x1f4712,_0x15487f){_0x1f4712=_0x1f4712-0x0;var _0xe15202=_0x15ff[_0x1f4712];return _0xe15202;};'use strict';var _=require(_0xf15f('0x0'));var BPromise=require('bluebird');var db=require(_0xf15f('0x1'))['db'];var util=require('./license/util');var channels=[_0xf15f('0x2'),_0xf15f('0x3'),_0xf15f('0x4'),_0xf15f('0x5'),_0xf15f('0x6'),'whatsapp',_0xf15f('0x7')];exports['getChannels']=function(){return channels;};exports[_0xf15f('0x8')]=function(_0xa1e9f6){_0xa1e9f6=_0xa1e9f6[_0xf15f('0x9')]();return _[_0xf15f('0xa')](channels,_0xa1e9f6);};exports[_0xf15f('0xb')]=function(_0xdf8c4f,_0x177901,_0x11a124,_0x1dc562){var _0x1ca687={'loginAttempts':_0x177901,'blocked':_0x11a124};if(!_[_0xf15f('0xc')](_0x1dc562)){_0x1ca687['blockedAt']=_0x1dc562;}return _0xdf8c4f[_0xf15f('0xd')](_0x1ca687);};exports[_0xf15f('0xe')]=function(_0x5eae79){return new BPromise(function(_0x154a42,_0x5935c3){var _0xac8d64=0x0;if(_0x5eae79['role']!=='agent'){_0x154a42(_0x5eae79);}db[_0xf15f('0xf')][_0xf15f('0x10')]({'where':{'role':_0xf15f('0x11'),'online':!![],'id':{'$ne':_0x5eae79['id']}}})[_0xf15f('0x12')](function(_0x24b454){_0xac8d64=_0x24b454;return util[_0xf15f('0xe')]();})[_0xf15f('0x12')](function(_0x44b6d0){if(_0x44b6d0&&_0x44b6d0['agents']&&_0xac8d64>=_0x44b6d0[_0xf15f('0x13')]){throw Error(_0xf15f('0x14'));}_0x154a42(_0x5eae79);})[_0xf15f('0x15')](function(_0x521202){_0x5935c3(_0x521202);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 661c0cc..8fde40a 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1bf=['render','json','send','404','status'];(function(_0x44a76f,_0x367226){var _0x3325df=function(_0x36239c){while(--_0x36239c){_0x44a76f['push'](_0x44a76f['shift']());}};_0x3325df(++_0x367226);}(_0xe1bf,0x67));var _0xfe1b=function(_0x5aecc5,_0x20edab){_0x5aecc5=_0x5aecc5-0x0;var _0x270fe2=_0xe1bf[_0x5aecc5];return _0x270fe2;};'use strict';module['exports'][0x194]=function pageNotFound(_0x24d355,_0x4ed873){var _0x2f0cd8=_0xfe1b('0x0');var _0x67c7c1=0x194;var _0x834e7a={'status':_0x67c7c1};_0x4ed873['status'](_0x834e7a[_0xfe1b('0x1')]);_0x4ed873[_0xfe1b('0x2')](_0x2f0cd8,{},function(_0x465c03,_0x308663){if(_0x465c03){return _0x4ed873['status'](_0x834e7a[_0xfe1b('0x1')])[_0xfe1b('0x3')](_0x834e7a);}_0x4ed873[_0xfe1b('0x4')](_0x308663);});}; \ No newline at end of file +var _0xdd4d=['render','json','send','exports','status'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xdd4d,0x152));var _0xddd4=function(_0x23e262,_0x135639){_0x23e262=_0x23e262-0x0;var _0x1d3a35=_0xdd4d[_0x23e262];return _0x1d3a35;};'use strict';module[_0xddd4('0x0')][0x194]=function pageNotFound(_0x432cc8,_0x1f59d7){var _0x1c0210='404';var _0x2056d7=0x194;var _0x16625e={'status':_0x2056d7};_0x1f59d7['status'](_0x16625e[_0xddd4('0x1')]);_0x1f59d7[_0xddd4('0x2')](_0x1c0210,{},function(_0x37e0d7,_0x30695e){if(_0x37e0d7){return _0x1f59d7[_0xddd4('0x1')](_0x16625e[_0xddd4('0x1')])[_0xddd4('0x3')](_0x16625e);}_0x1f59d7[_0xddd4('0x4')](_0x30695e);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 5873dfc..65088b2 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7023=['ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','user_has_mail_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefix','MailQueues','SmsQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','cm_user_has_lists','ChatWebsites','MailAccounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','Applications','VoiceMusicOnHold','UserVoiceQueueRt','Members','Hoppers','VoiceQueueId','HopperHistories','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccount','MailServerIn','CloudProviderId','restrict','MailAccountId','Disposition','ListId','Template','mandatoryDispositionPause','user_has_mail_accounts','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatOfflineMessage','ChatOfflineMessageId','MailApplication','TagId','MailQueueReport','List','Answers','FaxAccountId','Interactions','Exntensions','FaxQueue','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','team_has_fax_queues','FaxQueueReport','Dispositions','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','user_has_openchannel_accounts','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','ChatWebsiteId','ChatProactiveAction','ChatApplication','user_has_chat_websites','OpenchannelQueueReport','Queue','ChatQueueId','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','team_has_chat_queues','ChatGroup','ChatGroupId','CompanyId','CmContactHasItem','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','moh_has_sounds','ItemType','ItemTypeId','Hopper','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','Fields','FieldId','Subject','Description','Field','VariableId','Descriptions','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Configuration','FreshsalesField','FreshsalesAccount','ChatQueueReport','FromId','ToId','JscriptyAnswerReport','SmsQueueReport','JscriptyProject','ProjectId','FaxQueues','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','VoicePrefixes','HopperBlacks','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToMailAccountId','ToAccount','ToQueue','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','Imap','Smtp','exports','lodash','jstz','determine','sequelize','motion2','xC@LL1234','127.0.0.1','name','utf8','utf8_general_ci','sequelizeHistory','xcall','mysql','utf8mb4','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Variable','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','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/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','VoiceMail','UserId','UserSetting','cascade','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','OpenchannelInteractions'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7023,0xee));var _0x3702=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7023[_0x2dafbe];return _0x58a45a;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x3702('0x0'));var jstz=require(_0x3702('0x1'));var timezone=jstz[_0x3702('0x2')]();config[_0x3702('0x3')]=_['defaultsDeep'](config[_0x3702('0x3')],{'database':_0x3702('0x4'),'username':'xcall','password':_0x3702('0x5'),'options':{'host':_0x3702('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x3702('0x7')](),'define':{'charset':_0x3702('0x8'),'collate':_0x3702('0x9')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0x3702('0xa')],{'database':'motion2','username':_0x3702('0xb'),'password':_0x3702('0x5'),'options':{'host':_0x3702('0x6'),'port':0xcea,'dialect':_0x3702('0xc'),'dialectOptions':{'charset':_0x3702('0xd')},'logging':![],'timezone':timezone[_0x3702('0x7')](),'define':{'charset':_0x3702('0x8'),'collate':_0x3702('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x3702('0xe')],config[_0x3702('0x3')][_0x3702('0xf')],config[_0x3702('0x3')][_0x3702('0x10')],config[_0x3702('0x3')][_0x3702('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3702('0xa')][_0x3702('0xe')],config[_0x3702('0xa')]['username'],config['sequelizeHistory'][_0x3702('0x10')],config[_0x3702('0xa')]['options'])};db[_0x3702('0x12')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x14'));db[_0x3702('0x15')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x16'));db['VoiceContext']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/voiceContext/voiceContext.model');db[_0x3702('0x17')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x18'));db['VoiceMusicOnHold']=db[_0x3702('0x3')]['import'](_0x3702('0x19'));db['VoiceQueue']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/voiceQueue/voiceQueue.model');db[_0x3702('0x1a')]=db[_0x3702('0x3')]['import'](_0x3702('0x1b'));db[_0x3702('0x1c')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x1d'));db['VoiceMail']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/voiceMail/voiceMail.model');db[_0x3702('0x1e')]=db[_0x3702('0x3')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0x3702('0x1f')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x20'));db['VoiceDialReport']=db['sequelize'][_0x3702('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x3702('0x21')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x3702('0x22')]=db[_0x3702('0x3')]['import'](_0x3702('0x23'));db[_0x3702('0x24')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x25'));db[_0x3702('0x26')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x27'));db['VoiceTransferReport']=db['sequelize'][_0x3702('0x13')](_0x3702('0x28'));db['UserVoiceQueueRt']=db['sequelize'][_0x3702('0x13')](_0x3702('0x29'));db[_0x3702('0x2a')]=db[_0x3702('0x3')]['import'](_0x3702('0x2b'));db[_0x3702('0x2c')]=db[_0x3702('0x3')]['import']('../api/userChatQueue/userChatQueue.model');db[_0x3702('0x2d')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x2e'));db[_0x3702('0x2f')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/userFaxQueue/userFaxQueue.model');db[_0x3702('0x30')]=db[_0x3702('0x3')]['import'](_0x3702('0x31'));db['UserOpenchannelQueue']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x32'));db[_0x3702('0x33')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x34'));db['MailServerIn']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x3702('0x35')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x36'));db['MailAccount']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/mailAccount/mailAccount.model');db[_0x3702('0x37')]=db[_0x3702('0x3')]['import']('../api/mailQueue/mailQueue.model');db[_0x3702('0x38')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x39'));db[_0x3702('0x3a')]=db['sequelize'][_0x3702('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x3702('0x3b')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x3702('0x3')]['import'](_0x3702('0x3c'));db['MailQueueReport']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x3d'));db['Dashboard']=db[_0x3702('0x3')]['import']('../api/dashboard/dashboard.model');db[_0x3702('0x3e')]=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db[_0x3702('0x3f')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x40'));db[_0x3702('0x41')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x42'));db[_0x3702('0x43')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x3702('0x44')]=db['sequelize']['import'](_0x3702('0x45'));db['FaxQueue']=db['sequelize'][_0x3702('0x13')](_0x3702('0x46'));db['FaxQueueReport']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x3702('0x47')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x48'));db[_0x3702('0x49')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x4a'));db[_0x3702('0x4b')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/smsInteraction/smsInteraction.model');db[_0x3702('0x4c')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x4d'));db[_0x3702('0x4e')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x4f'));db[_0x3702('0x50')]=db[_0x3702('0x3')]['import'](_0x3702('0x51'));db['OpenchannelApplication']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x52'));db[_0x3702('0x53')]=db[_0x3702('0x3')]['import'](_0x3702('0x54'));db[_0x3702('0x55')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x56'));db[_0x3702('0x57')]=db[_0x3702('0x3')]['import'](_0x3702('0x58'));db[_0x3702('0x59')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x5a'));db['OpenchannelQueueReport']=db['sequelize'][_0x3702('0x13')](_0x3702('0x5b'));db['ChatApplication']=db['sequelize'][_0x3702('0x13')](_0x3702('0x5c'));db[_0x3702('0x5d')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x5e'));db[_0x3702('0x5f')]=db['sequelize']['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x3702('0x3')]['import'](_0x3702('0x60'));db[_0x3702('0x61')]=db[_0x3702('0x3')]['import'](_0x3702('0x62'));db['ChatGroup']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x63'));db['ChatProactiveAction']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x64'));db[_0x3702('0x65')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x66'));db[_0x3702('0x67')]=db[_0x3702('0x3')]['import'](_0x3702('0x68'));db[_0x3702('0x69')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x6a'));db[_0x3702('0x6b')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x6c'));db[_0x3702('0x6d')]=db[_0x3702('0x3')]['import'](_0x3702('0x6e'));db[_0x3702('0x6f')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x3702('0x70')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x71'));db['CmCustomField']=db['sequelize'][_0x3702('0x13')](_0x3702('0x72'));db[_0x3702('0x73')]=db['sequelize'][_0x3702('0x13')]('../api/action/action.model');db[_0x3702('0x74')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/automation/automation.model');db[_0x3702('0x75')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x76'));db['Disposition']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x77'));db['Condition']=db[_0x3702('0x3')]['import'](_0x3702('0x78'));db[_0x3702('0x79')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x7a'));db[_0x3702('0x7b')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/pause/pause.model');db['Cdr']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x7c'));db[_0x3702('0x7d')]=db[_0x3702('0x3')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x3702('0x7e')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/schedule/schedule.model');db[_0x3702('0x7f')]=db[_0x3702('0x3')]['import'](_0x3702('0x80'));db[_0x3702('0x81')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x82'));db[_0x3702('0x83')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x84'));db['CmContactHasItem']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x85'));db[_0x3702('0x86')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x87'));db['Template']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x88'));db['Trigger']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/trigger/trigger.model');db[_0x3702('0x89')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/variable/variable.model');db[_0x3702('0x8a')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/integration/integration.model');db[_0x3702('0x8b')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x8c'));db[_0x3702('0x8d')]=db['sequelize'][_0x3702('0x13')](_0x3702('0x8e'));db[_0x3702('0x8f')]=db['sequelize'][_0x3702('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x3702('0x90')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x3702('0x91')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x92'));db[_0x3702('0x93')]=db[_0x3702('0x3')]['import'](_0x3702('0x94'));db[_0x3702('0x95')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x96'));db[_0x3702('0x97')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x98'));db[_0x3702('0x99')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x9a'));db[_0x3702('0x9b')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x9c'));db[_0x3702('0x9d')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x3702('0x9e')]=db['sequelize'][_0x3702('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x3702('0x9f')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x3702('0xa0')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xa1'));db[_0x3702('0xa2')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xa3'));db[_0x3702('0xa4')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xa5'));db[_0x3702('0xa6')]=db['sequelize'][_0x3702('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x3702('0xa7')]=db['sequelize']['import'](_0x3702('0xa8'));db[_0x3702('0xa9')]=db[_0x3702('0x3')]['import'](_0x3702('0xaa'));db[_0x3702('0xab')]=db['sequelize'][_0x3702('0x13')](_0x3702('0xac'));db[_0x3702('0xad')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xae'));db['ZendeskField']=db[_0x3702('0x3')]['import'](_0x3702('0xaf'));db[_0x3702('0xb0')]=db[_0x3702('0x3')]['import'](_0x3702('0xb1'));db[_0x3702('0xb2')]=db[_0x3702('0x3')]['import'](_0x3702('0xb3'));db[_0x3702('0xb4')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xb5'));db['VtigerAccount']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xb6'));db[_0x3702('0xb7')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xb8'));db[_0x3702('0xb9')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xba'));db[_0x3702('0xbb')]=db['sequelize']['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x3702('0xbc')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x3702('0xbd')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xbe'));db[_0x3702('0xbf')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xc0'));db['Dynamics365Configuration']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xc1'));db[_0x3702('0xc2')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xc3'));db['FreshsalesAccount']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xc4'));db[_0x3702('0xc5')]=db[_0x3702('0x3')]['import'](_0x3702('0xc6'));db['FreshsalesField']=db['sequelize'][_0x3702('0x13')](_0x3702('0xc7'));db['Integration']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/integration/integration.model');db[_0x3702('0xc8')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xc9'));db['ChatQueueReport']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xca'));db[_0x3702('0xcb')]=db[_0x3702('0x3')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xcc'));db[_0x3702('0xcd')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xce'));db[_0x3702('0xcf')]=db[_0x3702('0x3')][_0x3702('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xd0'));db['SquareReport']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xd1'));db['SquareDetailsReport']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xd2'));db['JscriptyProject']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xd3'));db[_0x3702('0xd4')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xd5'));db[_0x3702('0xd6')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xd7'));db[_0x3702('0xd8')]=db['sequelize'][_0x3702('0x13')](_0x3702('0xd9'));db[_0x3702('0xda')]=db['sequelize'][_0x3702('0x13')]('../api/squareRecording/squareRecording.model');db[_0x3702('0xdb')]=db[_0x3702('0x3')]['import'](_0x3702('0xdc'));db[_0x3702('0xdd')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xde'));db['License']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xdf'));db['Campaign']=db[_0x3702('0x3')][_0x3702('0x13')]('../api/campaign/campaign.model');db[_0x3702('0xe0')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xe1'));db[_0x3702('0xe2')]=db['sequelize'][_0x3702('0x13')](_0x3702('0xe3'));db[_0x3702('0xe4')]=db[_0x3702('0x3')]['import'](_0x3702('0xe5'));db[_0x3702('0xe6')]=db['sequelize'][_0x3702('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x3702('0xe7')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xe8'));db['FaxTransferReport']=db[_0x3702('0x3')]['import'](_0x3702('0xe9'));db['OpenchannelTransferReport']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xea'));db['SmsTransferReport']=db[_0x3702('0x3')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0x3702('0xeb')]=db['sequelize']['import'](_0x3702('0xec'));db['VoicePrefix']=db['sequelize'][_0x3702('0x13')](_0x3702('0xed'));db[_0x3702('0xee')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xef'));db[_0x3702('0xf0')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xf1'));db[_0x3702('0xf2')]=db['sequelize'][_0x3702('0x13')](_0x3702('0xf3'));db[_0x3702('0xf4')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xf5'));db[_0x3702('0xf6')]=db[_0x3702('0x3')]['import'](_0x3702('0xf7'));db[_0x3702('0xf8')]=db['sequelize'][_0x3702('0x13')](_0x3702('0xf9'));db[_0x3702('0xfa')]=db['sequelize'][_0x3702('0x13')](_0x3702('0xfb'));db['WhatsappMessage']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xfc'));db[_0x3702('0xfd')]=db['sequelize'][_0x3702('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0x3702('0x3')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0xfe'));db[_0x3702('0xff')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x100'));db[_0x3702('0x101')]=db['sequelize']['import'](_0x3702('0x102'));db[_0x3702('0x103')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x104'));db[_0x3702('0x105')]=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x106'));db['UserSetting']=db[_0x3702('0x3')][_0x3702('0x13')](_0x3702('0x107'));db['User'][_0x3702('0x108')](db[_0x3702('0x109')],{'as':_0x3702('0x109'),'onDelete':'cascade','foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')][_0x3702('0x108')](db[_0x3702('0x10b')],{'as':'userSetting','onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x10a')});db['User'][_0x3702('0x10d')](db[_0x3702('0x1a')],{'as':_0x3702('0x10e'),'foreignKey':'UserId'});db[_0x3702('0x12')][_0x3702('0x10d')](db['UserVoiceQueueRt'],{'as':_0x3702('0x10f'),'foreignKey':_0x3702('0x10a')});db['User']['hasMany'](db[_0x3702('0x17')],{'as':_0x3702('0x110'),'onDelete':'cascade','hooks':!![]});db['User']['hasMany'](db[_0x3702('0x6d')],{'as':_0x3702('0x111'),'foreignKey':_0x3702('0x10a')});db['User'][_0x3702('0x10d')](db[_0x3702('0x6f')],{'as':'HopperHistory','foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')][_0x3702('0x10d')](db['ReportAgentPreview'],{'as':_0x3702('0x70'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')][_0x3702('0x10d')](db[_0x3702('0x53')],{'as':_0x3702('0x112'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')]['hasMany'](db['ChatInteraction'],{'as':_0x3702('0x113'),'foreignKey':'UserId'});db['User'][_0x3702('0x10d')](db[_0x3702('0x4b')],{'as':_0x3702('0x114'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')][_0x3702('0x10d')](db[_0x3702('0x43')],{'as':'FaxInteractions','foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')][_0x3702('0x10d')](db[_0x3702('0x3a')],{'as':_0x3702('0x115'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')][_0x3702('0x10d')](db['WhatsappInteraction'],{'as':_0x3702('0x116'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x12')]['hasMany'](db['UserNotification'],{'as':_0x3702('0x117'),'foreignKey':_0x3702('0x118')});db[_0x3702('0x12')][_0x3702('0x119')](db['UserProfile'],{'as':_0x3702('0xee'),'foreignKey':_0x3702('0x11a')});db[_0x3702('0x12')]['belongsToMany'](db['ChatGroup'],{'as':_0x3702('0x11b'),'through':_0x3702('0x11c')});db[_0x3702('0x12')][_0x3702('0x11d')](db['CmContact'],{'as':_0x3702('0x11e'),'through':_0x3702('0x11f')});db[_0x3702('0x12')][_0x3702('0x11d')](db['CmList'],{'as':_0x3702('0x120'),'through':'cm_user_has_lists'});db[_0x3702('0x12')]['belongsToMany'](db[_0x3702('0xdd')],{'through':'user_has_teams'});db['User'][_0x3702('0x11d')](db[_0x3702('0x3a')],{'as':_0x3702('0x115'),'through':_0x3702('0x121')});db[_0x3702('0x12')][_0x3702('0x11d')](db[_0x3702('0x5d')],{'as':_0x3702('0x113'),'through':'user_has_chat_interactions'});db['User'][_0x3702('0x11d')](db['FaxInteraction'],{'as':_0x3702('0x122'),'through':'user_has_fax_interactions'});db[_0x3702('0x12')][_0x3702('0x11d')](db['SmsInteraction'],{'as':_0x3702('0x114'),'through':_0x3702('0x123')});db[_0x3702('0x12')][_0x3702('0x11d')](db[_0x3702('0x53')],{'as':'OpenchannelInteractions','through':_0x3702('0x124')});db['User'][_0x3702('0x11d')](db[_0x3702('0xfa')],{'as':_0x3702('0x116'),'through':_0x3702('0x125')});db[_0x3702('0x12')][_0x3702('0x11d')](db[_0x3702('0x126')],{'as':_0x3702('0x127'),'through':'UserVoiceQueue','required':![]});db['User'][_0x3702('0x11d')](db[_0x3702('0x128')],{'as':'VoicePrefixes','through':_0x3702('0x105'),'required':![]});db['User'][_0x3702('0x11d')](db[_0x3702('0x37')],{'as':_0x3702('0x129'),'through':'UserMailQueue','required':![]});db[_0x3702('0x12')][_0x3702('0x11d')](db['ChatQueue'],{'as':'ChatQueues','through':_0x3702('0x2c'),'required':![],'hooks':!![]});db[_0x3702('0x12')][_0x3702('0x11d')](db['FaxQueue'],{'as':'FaxQueues','through':_0x3702('0x2f'),'required':![]});db[_0x3702('0x12')]['belongsToMany'](db[_0x3702('0x4e')],{'as':_0x3702('0x12a'),'through':_0x3702('0x30'),'required':![]});db['User'][_0x3702('0x11d')](db[_0x3702('0x57')],{'as':'OpenchannelQueues','through':_0x3702('0x12b'),'required':![]});db['User']['belongsToMany'](db[_0x3702('0x12c')],{'as':_0x3702('0x12d'),'through':'UserWhatsappQueue','required':![]});db[_0x3702('0x12')][_0x3702('0x11d')](db[_0x3702('0xeb')],{'through':_0x3702('0x12e')});db[_0x3702('0x12')][_0x3702('0x11d')](db[_0x3702('0x59')],{'as':_0x3702('0x12f'),'through':'user_has_chat_websites'});db[_0x3702('0x12')]['belongsToMany'](db[_0x3702('0x3f')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x3702('0x12')][_0x3702('0x11d')](db['MailAccount'],{'as':_0x3702('0x130'),'through':'user_has_mail_accounts'});db[_0x3702('0x12')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x3702('0x131'),'through':'user_has_openchannel_accounts'});db[_0x3702('0x12')]['belongsToMany'](db['SmsAccount'],{'as':_0x3702('0x132'),'through':_0x3702('0x133')});db[_0x3702('0x12')][_0x3702('0x11d')](db['WhatsappAccount'],{'as':_0x3702('0x134'),'through':_0x3702('0x135')});db['User'][_0x3702('0x11d')](db['SquareProject'],{'as':'SquareProjects','through':_0x3702('0x136')});db[_0x3702('0x15')]['hasMany'](db[_0x3702('0x17')],{'as':_0x3702('0x137'),'onDelete':_0x3702('0x10c'),'foreignKey':'ChanSpyId'});db['VoiceContext']['hasMany'](db['VoiceExtension'],{'onDelete':_0x3702('0x10c')});db[_0x3702('0x17')][_0x3702('0x10d')](db[_0x3702('0x17')],{'as':_0x3702('0x138'),'onDelete':'cascade'});db[_0x3702('0x139')][_0x3702('0x11d')](db['Sound'],{'as':'Sounds','through':'moh_has_sounds'});db['VoiceQueue'][_0x3702('0x10d')](db[_0x3702('0x13a')],{'as':_0x3702('0x13b'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x3702('0x69')],{'as':_0x3702('0x13c'),'foreignKey':_0x3702('0x13d')});db[_0x3702('0x126')][_0x3702('0x10d')](db[_0x3702('0x6d')],{'as':_0x3702('0x111'),'foreignKey':_0x3702('0x13d')});db['VoiceQueue'][_0x3702('0x10d')](db[_0x3702('0x6f')],{'as':_0x3702('0x13e'),'foreignKey':_0x3702('0x13d')});db['VoiceQueue'][_0x3702('0x10d')](db[_0x3702('0x70')],{'as':_0x3702('0x70'),'foreignKey':'VoiceQueueId'});db[_0x3702('0x126')][_0x3702('0x10d')](db[_0x3702('0x6b')],{'as':'HopperBlacks','foreignKey':_0x3702('0x13d')});db[_0x3702('0x126')][_0x3702('0x10d')](db[_0x3702('0xcf')],{'as':_0x3702('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x3702('0x126')][_0x3702('0x119')](db['Trunk'],{'as':_0x3702('0x26'),'foreignKey':_0x3702('0x140')});db['VoiceQueue'][_0x3702('0x119')](db[_0x3702('0x26')],{'as':_0x3702('0x141'),'foreignKey':_0x3702('0x142')});db['VoiceQueue'][_0x3702('0x119')](db[_0x3702('0x79')],{'as':_0x3702('0x79'),'foreignKey':_0x3702('0x143')});db[_0x3702('0x126')][_0x3702('0x119')](db[_0x3702('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':_0x3702('0x144')});db['VoiceQueue'][_0x3702('0x11d')](db[_0x3702('0xeb')],{'as':'Lists','through':_0x3702('0x145')});db['VoiceQueue'][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x146'),'through':'UserVoiceQueue'});db[_0x3702('0x126')]['belongsToMany'](db[_0x3702('0xdd')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x3702('0x126')][_0x3702('0x11d')](db[_0x3702('0xeb')],{'as':_0x3702('0x147'),'through':_0x3702('0x148')});db[_0x3702('0x1a')][_0x3702('0x119')](db['User'],{'as':'User','foreignKey':_0x3702('0x10a')});db['ScreenRecording'][_0x3702('0x119')](db[_0x3702('0x12')],{'as':_0x3702('0x12'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x109')][_0x3702('0x10d')](db[_0x3702('0x1e')],{'as':_0x3702('0x149'),'onDelete':_0x3702('0x10c'),'foreignKey':'mailboxuser','sourceKey':_0x3702('0x14a')});db[_0x3702('0x1e')][_0x3702('0x119')](db['VoiceMail'],{'foreignKey':_0x3702('0x14b'),'targetKey':_0x3702('0x14a')});db['VoiceCallReport'][_0x3702('0x10d')](db[_0x3702('0x22')],{'as':_0x3702('0x14c'),'foreignKey':'uniqueid','constraints':![]});db[_0x3702('0x1f')][_0x3702('0x10d')](db[_0x3702('0x21')],{'as':_0x3702('0x14d'),'foreignKey':_0x3702('0x14e'),'constraints':![]});db[_0x3702('0x1f')][_0x3702('0x119')](db[_0x3702('0x12')],{'as':_0x3702('0x12'),'foreignKey':'UserId'});db[_0x3702('0x1f')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db['MailServerIn'][_0x3702('0x119')](db[_0x3702('0x151')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x3702('0x152')][_0x3702('0x119')](db[_0x3702('0xff')],{'as':_0x3702('0xff'),'foreignKey':_0x3702('0x153'),'onDelete':_0x3702('0x154')});db[_0x3702('0x35')][_0x3702('0x119')](db[_0x3702('0x151')],{'as':_0x3702('0x151'),'foreignKey':_0x3702('0x155')});db['MailServerOut'][_0x3702('0x119')](db[_0x3702('0xff')],{'as':_0x3702('0xff'),'foreignKey':_0x3702('0x153'),'onDelete':_0x3702('0x154')});db[_0x3702('0x151')][_0x3702('0x108')](db['MailServerIn'],{'as':'Imap','onDelete':_0x3702('0x10c')});db[_0x3702('0x151')][_0x3702('0x108')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x3702('0x10c')});db[_0x3702('0x151')][_0x3702('0x10d')](db[_0x3702('0x156')],{'as':'Dispositions','foreignKey':_0x3702('0x155'),'onDelete':_0x3702('0x10c')});db[_0x3702('0x151')][_0x3702('0x10d')](db[_0x3702('0x75')],{'as':'Answers','foreignKey':_0x3702('0x155')});db[_0x3702('0x151')][_0x3702('0x10d')](db[_0x3702('0x3b')],{'as':_0x3702('0x149'),'foreignKey':_0x3702('0x155')});db[_0x3702('0x151')]['hasMany'](db[_0x3702('0x3a')],{'as':'Interactions'});db[_0x3702('0x151')][_0x3702('0x10d')](db['MailApplication'],{'as':'Applications'});db['MailAccount']['belongsTo'](db[_0x3702('0xeb')],{'as':'List','foreignKey':_0x3702('0x157')});db[_0x3702('0x151')][_0x3702('0x119')](db[_0x3702('0x158')],{'as':_0x3702('0x158'),'foreignKey':'TemplateId'});db[_0x3702('0x151')][_0x3702('0x119')](db['Pause'],{'as':_0x3702('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3702('0x151')]['belongsToMany'](db[_0x3702('0x12')],{'as':'Agents','through':_0x3702('0x15a')});db[_0x3702('0x37')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x146'),'through':'UserMailQueue'});db[_0x3702('0x37')][_0x3702('0x11d')](db[_0x3702('0xdd')],{'through':_0x3702('0x15b'),'as':_0x3702('0x15c')});db[_0x3702('0x3a')][_0x3702('0x10d')](db[_0x3702('0x3b')],{'as':_0x3702('0x149'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x15d')});db[_0x3702('0x3a')][_0x3702('0x119')](db[_0x3702('0x151')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x155')});db[_0x3702('0x3a')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':'Contact','foreignKey':_0x3702('0x150')});db[_0x3702('0x3a')][_0x3702('0x119')](db[_0x3702('0x12')],{'as':_0x3702('0x15f'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x3a')]['belongsToMany'](db['Tag'],{'through':_0x3702('0x160'),'as':_0x3702('0x161')});db['MailInteraction'][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':'mail_interaction_has_tags','as':_0x3702('0x162')});db['MailInteraction'][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x163'),'through':_0x3702('0x121'),'foreignKey':'MailInteractionId'});db[_0x3702('0x3b')][_0x3702('0x10d')](db['Attachment'],{'as':_0x3702('0x164'),'onDelete':'cascade'});db[_0x3702('0x3b')][_0x3702('0x119')](db[_0x3702('0x12')],{'as':_0x3702('0x12')});db[_0x3702('0x3b')]['belongsTo'](db['CmContact'],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x14f')});db[_0x3702('0x3b')]['belongsTo'](db[_0x3702('0x3a')],{'as':'Interaction','foreignKey':_0x3702('0x15d')});db[_0x3702('0x3b')][_0x3702('0x119')](db['MailAccount'],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x155')});db[_0x3702('0x3b')][_0x3702('0x119')](db[_0x3702('0x59')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db['MailMessage'][_0x3702('0x119')](db[_0x3702('0x165')],{'as':_0x3702('0x165'),'foreignKey':_0x3702('0x166')});db['MailApplication']['belongsTo'](db[_0x3702('0x12')],{'onDelete':_0x3702('0x154')});db[_0x3702('0x167')]['belongsTo'](db[_0x3702('0x37')],{'onDelete':_0x3702('0x154')});db[_0x3702('0x167')][_0x3702('0x119')](db[_0x3702('0x151')],{'onDelete':_0x3702('0x154')});db[_0x3702('0x167')][_0x3702('0x119')](db[_0x3702('0x79')],{'onDelete':_0x3702('0x154'),'foreignKey':_0x3702('0x143')});db[_0x3702('0x167')][_0x3702('0x119')](db[_0x3702('0x81')],{'onDelete':_0x3702('0x154'),'foreignKey':_0x3702('0x168')});db[_0x3702('0x169')][_0x3702('0x119')](db[_0x3702('0x151')],{});db[_0x3702('0x169')][_0x3702('0x119')](db[_0x3702('0xeb')],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0x169')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':'ContactId'});db[_0x3702('0x169')][_0x3702('0x119')](db[_0x3702('0x3a')],{});db['MailQueueReport'][_0x3702('0x119')](db['MailMessage'],{});db['MailQueueReport'][_0x3702('0x119')](db[_0x3702('0x12')],{});db['MailQueueReport'][_0x3702('0x119')](db[_0x3702('0x37')],{});db['Dashboard']['hasMany'](db[_0x3702('0x3e')],{'as':'Items','onDelete':_0x3702('0x10c')});db[_0x3702('0x3f')][_0x3702('0x10d')](db[_0x3702('0x156')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x3702('0x10c')});db[_0x3702('0x3f')][_0x3702('0x10d')](db[_0x3702('0x75')],{'as':_0x3702('0x16b'),'foreignKey':_0x3702('0x16c')});db[_0x3702('0x3f')][_0x3702('0x10d')](db['FaxInteraction'],{'as':_0x3702('0x16d')});db[_0x3702('0x3f')][_0x3702('0x10d')](db[_0x3702('0x41')],{'as':_0x3702('0x138')});db[_0x3702('0x3f')]['hasMany'](db['VoiceExtension'],{'as':_0x3702('0x16e'),'onDelete':'cascade'});db['FaxAccount'][_0x3702('0x10d')](db[_0x3702('0x44')],{'as':_0x3702('0x149')});db[_0x3702('0x3f')][_0x3702('0x119')](db[_0x3702('0x26')],{'as':_0x3702('0x26')});db[_0x3702('0x3f')][_0x3702('0x119')](db['CmList'],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0x3f')][_0x3702('0x119')](db[_0x3702('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':_0x3702('0x144')});db[_0x3702('0x3f')][_0x3702('0x11d')](db['User'],{'as':_0x3702('0x146'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0x3702('0x119')](db[_0x3702('0x12')],{'onDelete':_0x3702('0x154')});db['FaxApplication'][_0x3702('0x119')](db[_0x3702('0x16f')],{'onDelete':'restrict'});db[_0x3702('0x41')][_0x3702('0x119')](db[_0x3702('0x3f')],{'onDelete':_0x3702('0x154')});db[_0x3702('0x41')][_0x3702('0x119')](db[_0x3702('0x81')],{'onDelete':'restrict','foreignKey':_0x3702('0x168')});db[_0x3702('0x43')][_0x3702('0x10d')](db['FaxMessage'],{'as':_0x3702('0x149'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x170')});db['FaxInteraction'][_0x3702('0x119')](db[_0x3702('0x3f')],{'as':_0x3702('0x15e'),'foreignKey':'FaxAccountId'});db[_0x3702('0x43')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db[_0x3702('0x43')][_0x3702('0x119')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x3702('0x43')][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':'fax_interaction_has_tags','as':_0x3702('0x161')});db['FaxInteraction'][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':_0x3702('0x171'),'as':'ThroughTags'});db[_0x3702('0x43')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':'Users','through':_0x3702('0x172'),'foreignKey':_0x3702('0x170')});db[_0x3702('0x44')]['belongsTo'](db['User'],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x12')});db['FaxMessage'][_0x3702('0x119')](db[_0x3702('0x43')],{'as':_0x3702('0x173'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x3702('0x119')](db[_0x3702('0x67')],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x14f')});db[_0x3702('0x44')]['belongsTo'](db[_0x3702('0xe2')],{'as':_0x3702('0xe2'),'foreignKey':_0x3702('0x174')});db['FaxMessage']['belongsTo'](db[_0x3702('0x3f')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x16c')});db[_0x3702('0x16f')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':'Agents','through':_0x3702('0x2f')});db['FaxQueue'][_0x3702('0x11d')](db[_0x3702('0xdd')],{'through':_0x3702('0x175'),'as':_0x3702('0x15c')});db['FaxQueueReport']['belongsTo'](db[_0x3702('0x3f')],{});db[_0x3702('0x176')][_0x3702('0x119')](db[_0x3702('0xeb')],{'as':'List','foreignKey':_0x3702('0x157')});db['FaxQueueReport'][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db[_0x3702('0x176')]['belongsTo'](db[_0x3702('0x43')],{});db[_0x3702('0x176')][_0x3702('0x119')](db[_0x3702('0x44')],{});db[_0x3702('0x176')][_0x3702('0x119')](db[_0x3702('0x12')],{});db['FaxQueueReport'][_0x3702('0x119')](db[_0x3702('0x16f')],{});db[_0x3702('0x47')][_0x3702('0x10d')](db['Disposition'],{'as':_0x3702('0x177'),'foreignKey':_0x3702('0x178'),'onDelete':_0x3702('0x10c')});db[_0x3702('0x47')][_0x3702('0x10d')](db['CannedAnswer'],{'as':_0x3702('0x16b'),'foreignKey':'SmsAccountId'});db[_0x3702('0x47')][_0x3702('0x10d')](db[_0x3702('0x4c')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount'][_0x3702('0x10d')](db[_0x3702('0x4b')],{'as':_0x3702('0x16d')});db[_0x3702('0x47')][_0x3702('0x10d')](db[_0x3702('0x49')],{'as':_0x3702('0x138')});db['SmsAccount'][_0x3702('0x119')](db[_0x3702('0xeb')],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0x47')]['belongsTo'](db['Pause'],{'as':_0x3702('0x159'),'foreignKey':_0x3702('0x144')});db[_0x3702('0x47')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x146'),'through':_0x3702('0x133')});db[_0x3702('0x49')][_0x3702('0x119')](db['User'],{'onDelete':_0x3702('0x154')});db['SmsApplication']['belongsTo'](db[_0x3702('0x4e')],{'onDelete':_0x3702('0x154')});db[_0x3702('0x49')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x3702('0x154')});db[_0x3702('0x49')][_0x3702('0x119')](db[_0x3702('0x79')],{'onDelete':_0x3702('0x154'),'foreignKey':_0x3702('0x143')});db[_0x3702('0x49')][_0x3702('0x119')](db[_0x3702('0x81')],{'onDelete':_0x3702('0x154'),'foreignKey':_0x3702('0x168')});db[_0x3702('0x4b')][_0x3702('0x10d')](db[_0x3702('0x4c')],{'as':_0x3702('0x149'),'onDelete':_0x3702('0x10c'),'foreignKey':'SmsInteractionId'});db[_0x3702('0x4b')][_0x3702('0x119')](db[_0x3702('0x47')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x178')});db[_0x3702('0x4b')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':'Contact','foreignKey':'ContactId'});db['SmsInteraction'][_0x3702('0x119')](db[_0x3702('0x12')],{'as':_0x3702('0x15f'),'foreignKey':_0x3702('0x10a')});db['SmsInteraction'][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':_0x3702('0x179'),'as':_0x3702('0x161')});db[_0x3702('0x4b')][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':_0x3702('0x179'),'as':'ThroughTags'});db['SmsInteraction'][_0x3702('0x11d')](db['User'],{'as':_0x3702('0x163'),'through':_0x3702('0x123'),'foreignKey':_0x3702('0x17a')});db[_0x3702('0x4c')][_0x3702('0x119')](db['User'],{'as':_0x3702('0x12')});db[_0x3702('0x4c')][_0x3702('0x119')](db[_0x3702('0x67')],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x14f')});db[_0x3702('0x4c')][_0x3702('0x119')](db[_0x3702('0x4b')],{'onDelete':_0x3702('0x10c'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0x3702('0x4c')]['belongsTo'](db[_0x3702('0x47')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x178')});db['SmsQueue'][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':'Agents','through':_0x3702('0x30'),'foreignKey':_0x3702('0x17b')});db[_0x3702('0x4e')]['belongsToMany'](db[_0x3702('0xdd')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x3702('0x50')]['hasMany'](db[_0x3702('0x156')],{'as':_0x3702('0x177'),'foreignKey':_0x3702('0x17c'),'onDelete':_0x3702('0x10c')});db['OpenchannelAccount'][_0x3702('0x10d')](db[_0x3702('0x75')],{'as':'Answers','foreignKey':_0x3702('0x17c')});db['OpenchannelAccount'][_0x3702('0x10d')](db[_0x3702('0x53')],{'as':_0x3702('0x16d'),'foreignKey':_0x3702('0x17c')});db[_0x3702('0x50')]['hasMany'](db[_0x3702('0x55')],{'as':_0x3702('0x149'),'foreignKey':_0x3702('0x17c')});db[_0x3702('0x50')][_0x3702('0x10d')](db[_0x3702('0x17d')],{'as':_0x3702('0x138'),'foreignKey':_0x3702('0x17c')});db[_0x3702('0x50')][_0x3702('0x119')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x3702('0x50')][_0x3702('0x119')](db['Pause'],{'as':_0x3702('0x159'),'foreignKey':_0x3702('0x144')});db[_0x3702('0x50')][_0x3702('0x11d')](db['User'],{'as':_0x3702('0x146'),'through':_0x3702('0x17e')});db[_0x3702('0x17d')][_0x3702('0x119')](db[_0x3702('0x12')],{'onDelete':_0x3702('0x154')});db['OpenchannelApplication']['belongsTo'](db[_0x3702('0x57')],{'onDelete':_0x3702('0x154'),'foreignKey':_0x3702('0x17f')});db[_0x3702('0x17d')][_0x3702('0x119')](db[_0x3702('0x50')],{'onDelete':_0x3702('0x154'),'foreignKey':'OpenchannelAccountId'});db[_0x3702('0x17d')][_0x3702('0x119')](db[_0x3702('0x79')],{'onDelete':'restrict','foreignKey':_0x3702('0x143')});db[_0x3702('0x17d')][_0x3702('0x119')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x3702('0x53')][_0x3702('0x10d')](db[_0x3702('0x55')],{'as':'Messages','onDelete':_0x3702('0x10c'),'foreignKey':'OpenchannelInteractionId'});db[_0x3702('0x53')][_0x3702('0x119')](db['OpenchannelAccount'],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x17c')});db[_0x3702('0x53')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db[_0x3702('0x53')][_0x3702('0x119')](db[_0x3702('0x12')],{'as':_0x3702('0x15f'),'foreignKey':_0x3702('0x10a')});db[_0x3702('0x53')]['belongsToMany'](db[_0x3702('0x81')],{'through':_0x3702('0x180'),'as':_0x3702('0x161')});db[_0x3702('0x53')][_0x3702('0x11d')](db['Tag'],{'through':_0x3702('0x180'),'as':_0x3702('0x162')});db['OpenchannelInteraction'][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x163'),'through':_0x3702('0x124'),'foreignKey':_0x3702('0x181')});db[_0x3702('0x55')][_0x3702('0x119')](db[_0x3702('0x12')],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x12')});db[_0x3702('0x55')][_0x3702('0x119')](db['CmContact'],{'onDelete':_0x3702('0x10c'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0x3702('0x53')],{'onDelete':_0x3702('0x10c'),'as':'Interaction','foreignKey':_0x3702('0x181')});db[_0x3702('0x55')][_0x3702('0x119')](db['Attachment'],{'as':_0x3702('0xe2'),'foreignKey':_0x3702('0x174')});db['OpenchannelMessage'][_0x3702('0x119')](db['OpenchannelAccount'],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x17c')});db[_0x3702('0x57')][_0x3702('0x11d')](db['User'],{'as':_0x3702('0x146'),'through':_0x3702('0x12b'),'foreignKey':'OpenchannelQueueId'});db[_0x3702('0x57')]['belongsToMany'](db[_0x3702('0xdd')],{'through':'team_has_openchannel_queues','as':_0x3702('0x15c')});db[_0x3702('0x59')][_0x3702('0x10d')](db['Disposition'],{'as':_0x3702('0x177'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x3702('0x59')][_0x3702('0x10d')](db[_0x3702('0x75')],{'as':_0x3702('0x16b'),'foreignKey':_0x3702('0x182')});db[_0x3702('0x59')][_0x3702('0x10d')](db[_0x3702('0x183')],{'as':'ProactiveActions'});db[_0x3702('0x59')]['hasMany'](db['ChatInteraction'],{'as':'Interactions'});db[_0x3702('0x59')][_0x3702('0x10d')](db[_0x3702('0x184')],{'as':_0x3702('0x138')});db[_0x3702('0x59')][_0x3702('0x10d')](db[_0x3702('0x5f')],{'as':_0x3702('0x149')});db[_0x3702('0x59')]['belongsTo'](db[_0x3702('0xeb')],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0x59')][_0x3702('0x119')](db[_0x3702('0x79')],{'as':_0x3702('0x79'),'foreignKey':_0x3702('0x143')});db[_0x3702('0x59')][_0x3702('0x119')](db['MailAccount'],{'as':'MailAccount','foreignKey':'MailAccountId'});db['ChatWebsite'][_0x3702('0x119')](db[_0x3702('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':_0x3702('0x144')});db[_0x3702('0x59')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x146'),'through':_0x3702('0x185')});db[_0x3702('0x186')][_0x3702('0x119')](db[_0x3702('0x50')],{});db[_0x3702('0x186')][_0x3702('0x119')](db[_0x3702('0xeb')],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0x186')]['belongsTo'](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':'ContactId'});db[_0x3702('0x186')]['belongsTo'](db[_0x3702('0x53')],{});db[_0x3702('0x186')][_0x3702('0x119')](db[_0x3702('0x55')],{});db[_0x3702('0x186')][_0x3702('0x119')](db[_0x3702('0x12')],{});db[_0x3702('0x186')][_0x3702('0x119')](db['OpenchannelQueue'],{});db[_0x3702('0x184')][_0x3702('0x119')](db[_0x3702('0x12')],{'as':'Agent','foreignKey':_0x3702('0x10a'),'onDelete':_0x3702('0x154')});db['ChatApplication'][_0x3702('0x119')](db[_0x3702('0x61')],{'as':_0x3702('0x187'),'foreignKey':_0x3702('0x188'),'onDelete':_0x3702('0x154')});db[_0x3702('0x184')][_0x3702('0x119')](db[_0x3702('0x59')],{'as':_0x3702('0x189'),'foreignKey':'ChatWebsiteId','onDelete':_0x3702('0x154')});db[_0x3702('0x184')][_0x3702('0x119')](db['Tag'],{'onDelete':_0x3702('0x154'),'foreignKey':'TagId'});db[_0x3702('0x5d')]['hasMany'](db['ChatMessage'],{'as':_0x3702('0x149'),'onDelete':_0x3702('0x10c'),'foreignKey':'ChatInteractionId'});db[_0x3702('0x5d')][_0x3702('0x119')](db[_0x3702('0x59')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x182')});db[_0x3702('0x5d')]['belongsTo'](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db['ChatInteraction'][_0x3702('0x119')](db[_0x3702('0x12')],{'as':'Owner','foreignKey':_0x3702('0x10a')});db[_0x3702('0x5d')][_0x3702('0x11d')](db['Tag'],{'through':_0x3702('0x18a'),'as':_0x3702('0x161')});db[_0x3702('0x5d')][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':_0x3702('0x18a'),'as':_0x3702('0x162')});db[_0x3702('0x5d')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':'Users','through':_0x3702('0x18b'),'foreignKey':_0x3702('0x18c')});db['ChatMessage'][_0x3702('0x119')](db['User'],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x12')});db['ChatMessage'][_0x3702('0x119')](db[_0x3702('0x67')],{'onDelete':'cascade','as':_0x3702('0x14f'),'foreignKey':'ContactId'});db[_0x3702('0x5f')][_0x3702('0x119')](db['ChatInteraction'],{'onDelete':_0x3702('0x10c'),'as':'Interaction','foreignKey':_0x3702('0x18c')});db[_0x3702('0x5f')]['belongsTo'](db[_0x3702('0xe2')],{'as':'Attachment','foreignKey':_0x3702('0x174')});db[_0x3702('0x5f')][_0x3702('0x119')](db[_0x3702('0x59')],{'as':'Account','foreignKey':_0x3702('0x182')});db[_0x3702('0x165')]['hasMany'](db['Attachment'],{'as':_0x3702('0x164'),'foreignKey':_0x3702('0x166'),'onDelete':_0x3702('0x10c'),'hooks':!![]});db[_0x3702('0x165')][_0x3702('0x119')](db[_0x3702('0x67')],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db['ChatOfflineMessage'][_0x3702('0x119')](db[_0x3702('0x59')],{'as':'Account','foreignKey':_0x3702('0x182')});db[_0x3702('0x61')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x146'),'through':_0x3702('0x2c'),'hooks':!![]});db[_0x3702('0x61')]['belongsToMany'](db[_0x3702('0xdd')],{'through':_0x3702('0x18d'),'as':_0x3702('0x15c')});db[_0x3702('0x18e')][_0x3702('0x10d')](db[_0x3702('0xcb')],{'as':'Messages','foreignKey':_0x3702('0x18f'),'onDelete':'cascade'});db[_0x3702('0x18e')]['belongsToMany'](db[_0x3702('0x12')],{'as':_0x3702('0x13b'),'through':_0x3702('0x11c')});db[_0x3702('0x183')][_0x3702('0x119')](db[_0x3702('0x59')],{'as':_0x3702('0x189'),'foreignKey':_0x3702('0x182')});db[_0x3702('0x65')][_0x3702('0x10d')](db['CmContact'],{'as':'Contacts','foreignKey':_0x3702('0x190')});db['CmContact']['hasMany'](db[_0x3702('0x191')],{'as':_0x3702('0x192'),'foreignKey':_0x3702('0x193')});db[_0x3702('0x67')]['hasMany'](db['CmHopper'],{'as':_0x3702('0x13c'),'foreignKey':_0x3702('0x150')});db['CmContact'][_0x3702('0x10d')](db[_0x3702('0x6d')],{'as':'HopperFinals','foreignKey':_0x3702('0x150')});db[_0x3702('0x67')][_0x3702('0x10d')](db[_0x3702('0x6f')],{'as':_0x3702('0x13e'),'foreignKey':'ContactId'});db[_0x3702('0x67')]['hasMany'](db[_0x3702('0x70')],{'as':_0x3702('0x70'),'foreignKey':'ContactId'});db['CmContact'][_0x3702('0x10d')](db['JscriptySessionReport'],{'as':_0x3702('0x13f'),'foreignKey':'ContactId'});db[_0x3702('0x67')][_0x3702('0x10d')](db[_0x3702('0x53')],{'as':'OpenchannelInteractions','foreignKey':_0x3702('0x150'),'onDelete':_0x3702('0x154')});db[_0x3702('0x67')]['hasMany'](db[_0x3702('0x5d')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x3702('0x154')});db[_0x3702('0x67')][_0x3702('0x10d')](db[_0x3702('0x4b')],{'as':'SmsInteractions','foreignKey':_0x3702('0x150'),'onDelete':_0x3702('0x154')});db['CmContact'][_0x3702('0x10d')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x3702('0x150'),'onDelete':_0x3702('0x154')});db[_0x3702('0x67')][_0x3702('0x10d')](db[_0x3702('0x3a')],{'as':_0x3702('0x115'),'foreignKey':_0x3702('0x150'),'onDelete':_0x3702('0x154')});db[_0x3702('0x67')]['belongsTo'](db[_0x3702('0x65')],{'as':_0x3702('0x194'),'foreignKey':_0x3702('0x190')});db[_0x3702('0x67')][_0x3702('0x119')](db['CmList'],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157'),'onDelete':_0x3702('0x10c')});db['CmContact'][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':'Users','through':_0x3702('0x11f')});db[_0x3702('0x67')][_0x3702('0x11d')](db[_0x3702('0x81')],{'as':_0x3702('0x161'),'through':_0x3702('0x195')});db['CmContact'][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':_0x3702('0x195'),'as':_0x3702('0x162')});db[_0x3702('0x69')]['hasMany'](db[_0x3702('0x86')],{'as':_0x3702('0x196'),'foreignKey':_0x3702('0x197')});db[_0x3702('0x69')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150'),'onDelete':_0x3702('0x10c')});db[_0x3702('0x69')][_0x3702('0x119')](db[_0x3702('0xeb')],{'as':_0x3702('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x3702('0x69')]['belongsTo'](db[_0x3702('0x12')],{'as':'Agent','foreignKey':_0x3702('0x10a')});db[_0x3702('0x69')][_0x3702('0x119')](db[_0x3702('0x126')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x3702('0x10c')});db['CmHopper'][_0x3702('0x119')](db['Campaign'],{'as':_0x3702('0x198'),'foreignKey':'CampaignId','onDelete':_0x3702('0x10c')});db['CmHopper'][_0x3702('0x119')](db[_0x3702('0x12')],{'as':_0x3702('0x15f'),'foreignKey':_0x3702('0x199')});db[_0x3702('0x6b')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':'Contact','foreignKey':_0x3702('0x150'),'onDelete':_0x3702('0x10c')});db[_0x3702('0x6b')][_0x3702('0x119')](db[_0x3702('0xeb')],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157'),'onDelete':_0x3702('0x10c')});db[_0x3702('0x6b')][_0x3702('0x119')](db['VoiceQueue'],{'as':_0x3702('0x187'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x3702('0x6b')][_0x3702('0x119')](db['Campaign'],{'as':_0x3702('0x198'),'foreignKey':_0x3702('0x19a'),'onDelete':'cascade'});db[_0x3702('0x74')]['hasMany'](db[_0x3702('0x19b')],{'as':{'plural':_0x3702('0x19c'),'singular':_0x3702('0x19d')},'foreignKey':_0x3702('0x19e'),'onDelete':_0x3702('0x10c'),'hooks':!![]});db[_0x3702('0x74')][_0x3702('0x10d')](db[_0x3702('0x19b')],{'as':{'plural':_0x3702('0x19f'),'singular':_0x3702('0x1a0')},'foreignKey':_0x3702('0x1a1'),'onDelete':_0x3702('0x10c'),'hooks':!![]});db[_0x3702('0x74')][_0x3702('0x10d')](db[_0x3702('0x73')],{'as':_0x3702('0x1a2'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x3702('0x156')]['hasMany'](db[_0x3702('0x156')],{'as':_0x3702('0x177'),'foreignKey':_0x3702('0x1a3'),'onDelete':_0x3702('0x10c')});db[_0x3702('0x79')][_0x3702('0x10d')](db[_0x3702('0x79')],{'as':_0x3702('0x1a4'),'foreignKey':_0x3702('0x143'),'onDelete':_0x3702('0x10c'),'hooks':!![],'required':![]});db[_0x3702('0x79')][_0x3702('0x10d')](db['VoiceExtension'],{'as':_0x3702('0x110'),'foreignKey':_0x3702('0x143'),'onDelete':_0x3702('0x154')});db['Interval'][_0x3702('0x10d')](db[_0x3702('0x167')],{'as':_0x3702('0x1a5'),'foreignKey':_0x3702('0x143')});db[_0x3702('0x79')]['hasMany'](db[_0x3702('0x184')],{'as':_0x3702('0x1a6'),'foreignKey':_0x3702('0x143')});db[_0x3702('0x79')][_0x3702('0x10d')](db['FaxApplication'],{'as':_0x3702('0x1a7'),'foreignKey':_0x3702('0x143')});db['Interval'][_0x3702('0x10d')](db[_0x3702('0x49')],{'as':_0x3702('0x1a8'),'foreignKey':_0x3702('0x143')});db[_0x3702('0x7e')][_0x3702('0x119')](db[_0x3702('0x151')],{});db[_0x3702('0x7e')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x3702('0x1a9')});db[_0x3702('0x7e')][_0x3702('0x119')](db[_0x3702('0x8d')],{'foreignKey':'CustomReportId'});db[_0x3702('0x7f')]['belongsToMany'](db[_0x3702('0x139')],{'as':_0x3702('0x1aa'),'through':_0x3702('0x1ab'),'onDelete':_0x3702('0x154')});db['Tag'][_0x3702('0x11d')](db[_0x3702('0x67')],{'through':_0x3702('0x195')});db['Tag'][_0x3702('0x11d')](db[_0x3702('0x5d')],{'through':_0x3702('0x18a')});db[_0x3702('0x81')][_0x3702('0x11d')](db[_0x3702('0x3a')],{'through':_0x3702('0x160')});db[_0x3702('0x81')][_0x3702('0x11d')](db[_0x3702('0x4b')],{'through':_0x3702('0x179')});db[_0x3702('0x81')][_0x3702('0x11d')](db[_0x3702('0x43')],{'through':_0x3702('0x171')});db['Tag']['belongsToMany'](db[_0x3702('0x53')],{'through':_0x3702('0x180')});db[_0x3702('0x81')][_0x3702('0x11d')](db[_0x3702('0xfa')],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem']['belongsTo'](db[_0x3702('0x83')],{'as':_0x3702('0x1ac'),'foreignKey':_0x3702('0x1ad')});db[_0x3702('0x86')][_0x3702('0x119')](db[_0x3702('0x69')],{'as':_0x3702('0x1ae'),'foreignKey':'CmHopperId'});db[_0x3702('0x191')]['belongsTo'](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x193')});db[_0x3702('0x1af')]['hasMany'](db[_0x3702('0x19b')],{'as':{'plural':_0x3702('0x1b0'),'singular':'AllCondition'},'foreignKey':_0x3702('0x1b1'),'onDelete':'cascade','hooks':!![]});db[_0x3702('0x1af')][_0x3702('0x10d')](db[_0x3702('0x19b')],{'as':{'plural':_0x3702('0x1b2'),'singular':_0x3702('0x1b3')},'foreignKey':_0x3702('0x1b4'),'onDelete':_0x3702('0x10c'),'hooks':!![]});db['Trigger'][_0x3702('0x10d')](db[_0x3702('0x73')],{'as':_0x3702('0x1a2'),'foreignKey':_0x3702('0x1b5'),'onDelete':_0x3702('0x10c'),'hooks':!![]});db[_0x3702('0x8d')][_0x3702('0x10d')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x3702('0x10c'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x3702('0x8f')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1a9')});db[_0x3702('0x91')][_0x3702('0x10d')](db[_0x3702('0x93')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x3702('0x1b6')});db[_0x3702('0x93')]['belongsTo'](db[_0x3702('0x91')],{'foreignKey':_0x3702('0x1b6')});db[_0x3702('0x97')][_0x3702('0x10d')](db[_0x3702('0x99')],{'as':_0x3702('0x1b7'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1b8')});db[_0x3702('0x99')][_0x3702('0x10d')](db[_0x3702('0x9b')],{'as':_0x3702('0x1b9'),'onDelete':'cascade','foreignKey':_0x3702('0x1ba')});db['SalesforceConfiguration'][_0x3702('0x10d')](db[_0x3702('0x9b')],{'as':'Descriptions','onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0x99')][_0x3702('0x10d')](db[_0x3702('0x9b')],{'as':_0x3702('0x1bc'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bd')});db[_0x3702('0x99')][_0x3702('0x119')](db['SalesforceAccount'],{'as':_0x3702('0x15e'),'foreignKey':'AccountId'});db['SalesforceField'][_0x3702('0x10d')](db[_0x3702('0x9b')],{'as':_0x3702('0x1be'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0x9b')]['hasMany'](db[_0x3702('0x9b')],{'as':_0x3702('0x1bf'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0x9b')][_0x3702('0x10d')](db['SalesforceField'],{'as':_0x3702('0x1c0'),'foreignKey':_0x3702('0x1bd')});db[_0x3702('0x9b')]['belongsTo'](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':_0x3702('0x1c1')});db[_0x3702('0x9d')][_0x3702('0x10d')](db['SugarcrmConfiguration'],{'as':_0x3702('0x1b7'),'onDelete':'cascade','foreignKey':_0x3702('0x1b8')});db[_0x3702('0x9e')][_0x3702('0x10d')](db['SugarcrmField'],{'as':_0x3702('0x1b9'),'onDelete':'cascade','foreignKey':_0x3702('0x1ba')});db[_0x3702('0x9e')][_0x3702('0x10d')](db[_0x3702('0x9f')],{'as':_0x3702('0x1c2'),'onDelete':'cascade','foreignKey':_0x3702('0x1bb')});db['SugarcrmConfiguration'][_0x3702('0x10d')](db[_0x3702('0x9f')],{'as':_0x3702('0x1bc'),'onDelete':_0x3702('0x10c'),'foreignKey':'FieldId'});db[_0x3702('0x9e')][_0x3702('0x119')](db[_0x3702('0x9d')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x1b8')});db[_0x3702('0x9f')][_0x3702('0x10d')](db['SugarcrmField'],{'as':_0x3702('0x1be'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0x9f')]['hasMany'](db['SugarcrmField'],{'as':_0x3702('0x1bf'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0x9f')][_0x3702('0x10d')](db[_0x3702('0x9f')],{'as':_0x3702('0x1c0'),'foreignKey':_0x3702('0x1bd')});db[_0x3702('0x9f')][_0x3702('0x119')](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':_0x3702('0x1c1')});db[_0x3702('0xa0')]['hasMany'](db['DeskConfiguration'],{'as':_0x3702('0x1b7'),'onDelete':'cascade','foreignKey':_0x3702('0x1b8')});db[_0x3702('0xa2')][_0x3702('0x10d')](db[_0x3702('0xa4')],{'as':_0x3702('0x1b9'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0xa2')][_0x3702('0x10d')](db[_0x3702('0xa4')],{'as':_0x3702('0x1c2'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0xa2')][_0x3702('0x10d')](db['DeskField'],{'as':_0x3702('0x1bc'),'onDelete':'cascade','foreignKey':_0x3702('0x1bd')});db[_0x3702('0xa2')][_0x3702('0x119')](db[_0x3702('0xa0')],{'as':'Account','foreignKey':'AccountId'});db[_0x3702('0xa2')][_0x3702('0x11d')](db['Tag'],{'through':_0x3702('0x1c3')});db[_0x3702('0xa4')][_0x3702('0x10d')](db[_0x3702('0xa4')],{'as':_0x3702('0x1be'),'foreignKey':'SubjectId'});db[_0x3702('0xa4')][_0x3702('0x10d')](db[_0x3702('0xa4')],{'as':_0x3702('0x1bf'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0xa4')]['hasMany'](db[_0x3702('0xa4')],{'as':_0x3702('0x1c0'),'foreignKey':'FieldId'});db[_0x3702('0xa4')]['belongsTo'](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':_0x3702('0x1c1')});db[_0x3702('0xa6')][_0x3702('0x10d')](db[_0x3702('0xa7')],{'as':_0x3702('0x1b7'),'onDelete':'cascade','foreignKey':_0x3702('0x1b8')});db[_0x3702('0xa7')][_0x3702('0x10d')](db[_0x3702('0xa9')],{'as':_0x3702('0x1b9'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1ba')});db['ZohoConfiguration'][_0x3702('0x10d')](db['ZohoField'],{'as':_0x3702('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3702('0xa7')][_0x3702('0x10d')](db[_0x3702('0xa9')],{'as':_0x3702('0x1bc'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bd')});db[_0x3702('0xa7')][_0x3702('0x119')](db['ZohoAccount'],{'as':_0x3702('0x15e'),'foreignKey':'AccountId'});db[_0x3702('0xa9')][_0x3702('0x10d')](db[_0x3702('0xa9')],{'as':'Subject','foreignKey':_0x3702('0x1ba')});db['ZohoField']['hasMany'](db[_0x3702('0xa9')],{'as':_0x3702('0x1bf'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0xa9')][_0x3702('0x10d')](db[_0x3702('0xa9')],{'as':'Field','foreignKey':_0x3702('0x1bd')});db[_0x3702('0xa9')]['belongsTo'](db['Variable'],{'as':_0x3702('0x89'),'foreignKey':_0x3702('0x1c1')});db[_0x3702('0xab')]['hasMany'](db[_0x3702('0xad')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x3702('0x1b8')});db[_0x3702('0xad')][_0x3702('0x10d')](db[_0x3702('0x1c4')],{'as':_0x3702('0x1b9'),'foreignKey':'SubjectId'});db[_0x3702('0xad')][_0x3702('0x10d')](db[_0x3702('0x1c4')],{'as':'Descriptions','foreignKey':_0x3702('0x1bb')});db['ZendeskConfiguration'][_0x3702('0x10d')](db['ZendeskField'],{'as':'Fields','foreignKey':_0x3702('0x1bd')});db[_0x3702('0xad')][_0x3702('0x119')](db['ZendeskAccount'],{'as':_0x3702('0x15e'),'foreignKey':'AccountId'});db[_0x3702('0xad')][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':_0x3702('0x1c5')});db['ZendeskField'][_0x3702('0x10d')](db['ZendeskField'],{'as':_0x3702('0x1be'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0x1c4')][_0x3702('0x10d')](db[_0x3702('0x1c4')],{'as':'Description','foreignKey':_0x3702('0x1bb')});db[_0x3702('0x1c4')][_0x3702('0x10d')](db['ZendeskField'],{'as':'Field','foreignKey':_0x3702('0x1bd')});db[_0x3702('0x1c4')]['belongsTo'](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':'VariableId'});db[_0x3702('0xb0')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x3702('0x1b7'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1b8')});db[_0x3702('0xb2')]['hasMany'](db[_0x3702('0xb4')],{'as':_0x3702('0x1b9'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0xb2')][_0x3702('0x10d')](db[_0x3702('0xb4')],{'as':_0x3702('0x1c2'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0xb2')][_0x3702('0x10d')](db[_0x3702('0xb4')],{'as':_0x3702('0x1bc'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bd')});db['FreshdeskConfiguration'][_0x3702('0x119')](db[_0x3702('0xb0')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x1b8')});db[_0x3702('0xb2')]['belongsToMany'](db[_0x3702('0x81')],{'through':_0x3702('0x1c6')});db[_0x3702('0xb4')][_0x3702('0x10d')](db[_0x3702('0xb4')],{'as':_0x3702('0x1be'),'foreignKey':'SubjectId'});db[_0x3702('0xb4')][_0x3702('0x10d')](db[_0x3702('0xb4')],{'as':'Description','foreignKey':_0x3702('0x1bb')});db[_0x3702('0xb4')][_0x3702('0x10d')](db[_0x3702('0xb4')],{'as':'Field','foreignKey':_0x3702('0x1bd')});db[_0x3702('0xb4')][_0x3702('0x119')](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':_0x3702('0x1c1')});db['VtigerAccount'][_0x3702('0x10d')](db[_0x3702('0xb7')],{'as':'Configurations','onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1b8')});db['VtigerConfiguration'][_0x3702('0x10d')](db['VtigerField'],{'as':_0x3702('0x1b9'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0xb7')][_0x3702('0x10d')](db[_0x3702('0xb9')],{'as':_0x3702('0x1c2'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0xb7')][_0x3702('0x10d')](db[_0x3702('0xb9')],{'as':_0x3702('0x1bc'),'foreignKey':_0x3702('0x1bd')});db[_0x3702('0xb7')][_0x3702('0x119')](db['VtigerAccount'],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x1b8')});db['VtigerField'][_0x3702('0x10d')](db['VtigerField'],{'as':_0x3702('0x1be'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0xb9')][_0x3702('0x10d')](db[_0x3702('0xb9')],{'as':_0x3702('0x1bf'),'foreignKey':'DescriptionId'});db[_0x3702('0xb9')]['hasMany'](db[_0x3702('0xb9')],{'as':'Field','foreignKey':_0x3702('0x1bd')});db[_0x3702('0xb9')]['belongsTo'](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':_0x3702('0x1c1')});db[_0x3702('0xbb')][_0x3702('0x10d')](db[_0x3702('0xbc')],{'as':_0x3702('0x1b7'),'onDelete':'cascade','foreignKey':_0x3702('0x1b8')});db[_0x3702('0xbc')]['hasMany'](db[_0x3702('0xbd')],{'as':_0x3702('0x1b9'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0xbc')][_0x3702('0x10d')](db['ServicenowField'],{'as':_0x3702('0x1c2'),'foreignKey':'DescriptionId'});db[_0x3702('0xbc')][_0x3702('0x10d')](db[_0x3702('0xbd')],{'as':'Fields','foreignKey':_0x3702('0x1bd')});db['ServicenowConfiguration']['belongsTo'](db[_0x3702('0xbb')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x1b8')});db['ServicenowField'][_0x3702('0x10d')](db[_0x3702('0xbd')],{'as':_0x3702('0x1be'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0xbd')][_0x3702('0x10d')](db[_0x3702('0xbd')],{'as':_0x3702('0x1bf'),'foreignKey':_0x3702('0x1bb')});db['ServicenowField'][_0x3702('0x10d')](db[_0x3702('0xbd')],{'as':_0x3702('0x1c0'),'foreignKey':'FieldId'});db[_0x3702('0xbd')][_0x3702('0x119')](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':'VariableId'});db[_0x3702('0xbf')][_0x3702('0x10d')](db[_0x3702('0x1c7')],{'as':_0x3702('0x1b7'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1b8')});db[_0x3702('0xbf')][_0x3702('0x119')](db[_0x3702('0xff')],{'as':_0x3702('0xff'),'foreignKey':_0x3702('0x153')});db[_0x3702('0x1c7')][_0x3702('0x10d')](db[_0x3702('0xc2')],{'as':_0x3702('0x1b9'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0x1c7')]['hasMany'](db[_0x3702('0xc2')],{'as':_0x3702('0x1c2'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0x1c7')]['hasMany'](db[_0x3702('0xc2')],{'as':_0x3702('0x1bc'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1bd')});db[_0x3702('0x1c7')][_0x3702('0x119')](db['Dynamics365Account'],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x1b8')});db['Dynamics365Field'][_0x3702('0x10d')](db[_0x3702('0xc2')],{'as':_0x3702('0x1be'),'foreignKey':_0x3702('0x1ba')});db[_0x3702('0xc2')][_0x3702('0x10d')](db[_0x3702('0xc2')],{'as':_0x3702('0x1bf'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0xc2')][_0x3702('0x10d')](db[_0x3702('0xc2')],{'as':_0x3702('0x1c0'),'foreignKey':_0x3702('0x1bd')});db['Dynamics365Field'][_0x3702('0x119')](db[_0x3702('0x89')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount'][_0x3702('0x10d')](db['FreshsalesConfiguration'],{'as':_0x3702('0x1b7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x3702('0xc5')][_0x3702('0x10d')](db[_0x3702('0x1c8')],{'as':'Subjects','foreignKey':_0x3702('0x1ba')});db['FreshsalesConfiguration'][_0x3702('0x10d')](db[_0x3702('0x1c8')],{'as':_0x3702('0x1c2'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0xc5')][_0x3702('0x10d')](db[_0x3702('0x1c8')],{'as':_0x3702('0x1bc'),'foreignKey':_0x3702('0x1bd')});db[_0x3702('0xc5')]['belongsTo'](db[_0x3702('0x1c9')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x1b8')});db['FreshsalesField'][_0x3702('0x10d')](db['FreshsalesField'],{'as':_0x3702('0x1be'),'foreignKey':_0x3702('0x1ba')});db['FreshsalesField'][_0x3702('0x10d')](db[_0x3702('0x1c8')],{'as':_0x3702('0x1bf'),'foreignKey':_0x3702('0x1bb')});db[_0x3702('0x1c8')][_0x3702('0x10d')](db[_0x3702('0x1c8')],{'as':'Field','foreignKey':_0x3702('0x1bd')});db[_0x3702('0x1c8')][_0x3702('0x119')](db[_0x3702('0x89')],{'as':_0x3702('0x89'),'foreignKey':_0x3702('0x1c1')});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0x3702('0x1ca')]['belongsTo'](db['CmList'],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0x1ca')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db[_0x3702('0x1ca')][_0x3702('0x119')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x3702('0x119')](db['ChatMessage'],{});db[_0x3702('0x1ca')][_0x3702('0x119')](db[_0x3702('0x12')],{});db[_0x3702('0x1ca')]['belongsTo'](db[_0x3702('0x61')],{});db['ChatInternalMessage']['belongsTo'](db[_0x3702('0x12')],{'onDelete':'cascade','foreignKey':_0x3702('0x1cb')});db['ChatInternalMessage']['belongsTo'](db[_0x3702('0x12')],{'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x1cc')});db['JscriptySessionReport']['hasMany'](db[_0x3702('0xcd')],{'foreignKey':'SessionId','onDelete':_0x3702('0x10c')});db[_0x3702('0xcf')][_0x3702('0x10d')](db[_0x3702('0x1cd')],{'foreignKey':'SessionId','onDelete':_0x3702('0x10c')});db[_0x3702('0x1ce')]['belongsTo'](db[_0x3702('0x47')],{});db[_0x3702('0x1ce')][_0x3702('0x119')](db['CmList'],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0x1ce')][_0x3702('0x119')](db[_0x3702('0x67')],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db[_0x3702('0x1ce')][_0x3702('0x119')](db['SmsInteraction'],{});db[_0x3702('0x1ce')][_0x3702('0x119')](db[_0x3702('0x4c')],{});db['SmsQueueReport']['belongsTo'](db['User'],{});db[_0x3702('0x1ce')][_0x3702('0x119')](db['SmsQueue'],{});db[_0x3702('0x1cf')][_0x3702('0x10d')](db[_0x3702('0xcf')],{'foreignKey':_0x3702('0x1d0')});db['JscriptyProject'][_0x3702('0x10d')](db[_0x3702('0xcd')],{'foreignKey':'ProjectId'});db[_0x3702('0x1cf')]['hasMany'](db[_0x3702('0x1cd')],{'foreignKey':_0x3702('0x1d0')});db[_0x3702('0xd8')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x163'),'through':_0x3702('0x136')});db[_0x3702('0xdd')]['belongsToMany'](db['User'],{'as':_0x3702('0x146'),'through':'user_has_teams'});db[_0x3702('0xdd')][_0x3702('0x11d')](db[_0x3702('0x126')],{'through':_0x3702('0x101'),'as':'VoiceQueues'});db[_0x3702('0xdd')][_0x3702('0x11d')](db['MailQueue'],{'through':_0x3702('0x15b'),'as':_0x3702('0x129')});db[_0x3702('0xdd')][_0x3702('0x11d')](db[_0x3702('0x61')],{'through':_0x3702('0x18d'),'as':'ChatQueues'});db[_0x3702('0xdd')]['belongsToMany'](db[_0x3702('0x16f')],{'through':_0x3702('0x175'),'as':_0x3702('0x1d1')});db['Team'][_0x3702('0x11d')](db[_0x3702('0x4e')],{'through':_0x3702('0x1d2'),'as':_0x3702('0x12a')});db[_0x3702('0xdd')][_0x3702('0x11d')](db[_0x3702('0x57')],{'through':_0x3702('0x1d3'),'as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0x3702('0x12c')],{'through':_0x3702('0x1d4'),'as':'WhatsappQueues'});db['Team'][_0x3702('0x11d')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0x3702('0x1d5')});db[_0x3702('0x198')][_0x3702('0x10d')](db[_0x3702('0x69')],{'as':_0x3702('0x13c'),'foreignKey':_0x3702('0x19a')});db[_0x3702('0x198')][_0x3702('0x10d')](db['CmHopperFinal'],{'as':_0x3702('0x111'),'foreignKey':_0x3702('0x19a')});db[_0x3702('0x198')][_0x3702('0x10d')](db[_0x3702('0x6f')],{'as':'HopperHistories','foreignKey':_0x3702('0x19a')});db['Campaign'][_0x3702('0x10d')](db[_0x3702('0x6b')],{'as':_0x3702('0x1d6'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x3702('0x26')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x3702('0x198')]['belongsTo'](db[_0x3702('0x26')],{'as':_0x3702('0x141'),'foreignKey':_0x3702('0x142')});db[_0x3702('0x198')][_0x3702('0x119')](db[_0x3702('0x79')],{'as':'Interval','foreignKey':_0x3702('0x143')});db[_0x3702('0x198')][_0x3702('0x119')](db['SquareProject'],{'as':_0x3702('0xd8'),'foreignKey':_0x3702('0x1d7')});db[_0x3702('0x198')][_0x3702('0x11d')](db[_0x3702('0xeb')],{'as':_0x3702('0x120'),'through':'campaigns_has_cm_lists'});db[_0x3702('0x198')][_0x3702('0x11d')](db['CmList'],{'as':_0x3702('0x147'),'through':_0x3702('0x1d8')});db[_0x3702('0xe2')]['belongsTo'](db[_0x3702('0x165')],{'as':_0x3702('0x165'),'foreignKey':_0x3702('0x166')});db['MailTransferReport']['belongsTo'](db[_0x3702('0x3b')],{});db[_0x3702('0xe6')][_0x3702('0x119')](db[_0x3702('0x3a')],{});db[_0x3702('0xe6')]['belongsTo'](db[_0x3702('0x151')],{'foreignKey':_0x3702('0x1d9'),'as':_0x3702('0x1da')});db[_0x3702('0xe6')][_0x3702('0x119')](db['User'],{'foreignKey':_0x3702('0x1db'),'as':_0x3702('0x1dc')});db['MailTransferReport']['belongsTo'](db[_0x3702('0x12')],{'foreignKey':_0x3702('0x1dd'),'as':'ToAgent'});db[_0x3702('0xe6')][_0x3702('0x119')](db[_0x3702('0x37')],{'foreignKey':_0x3702('0x1de'),'as':'ToQueue'});db['MailTransferReport']['belongsTo'](db[_0x3702('0x151')],{'foreignKey':_0x3702('0x1df'),'as':_0x3702('0x1e0')});db[_0x3702('0xe7')][_0x3702('0x119')](db[_0x3702('0x5f')],{});db[_0x3702('0xe7')][_0x3702('0x119')](db[_0x3702('0x5d')],{});db[_0x3702('0xe7')][_0x3702('0x119')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x3702('0x1da')});db['ChatTransferReport'][_0x3702('0x119')](db[_0x3702('0x12')],{'foreignKey':_0x3702('0x1db'),'as':_0x3702('0x1dc')});db['ChatTransferReport'][_0x3702('0x119')](db['User'],{'foreignKey':_0x3702('0x1dd'),'as':'ToAgent'});db['ChatTransferReport']['belongsTo'](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x3702('0x1e1')});db[_0x3702('0xe7')][_0x3702('0x119')](db[_0x3702('0x59')],{'foreignKey':_0x3702('0x1e2'),'as':'ToAccount'});db[_0x3702('0x1e3')][_0x3702('0x119')](db[_0x3702('0x44')],{});db[_0x3702('0x1e3')][_0x3702('0x119')](db[_0x3702('0x43')],{});db[_0x3702('0x1e3')][_0x3702('0x119')](db[_0x3702('0x3f')],{'foreignKey':_0x3702('0x1e4'),'as':_0x3702('0x1da')});db[_0x3702('0x1e3')][_0x3702('0x119')](db['User'],{'foreignKey':_0x3702('0x1db'),'as':_0x3702('0x1dc')});db[_0x3702('0x1e3')]['belongsTo'](db[_0x3702('0x12')],{'foreignKey':'ToUserId','as':_0x3702('0x1e5')});db[_0x3702('0x1e3')]['belongsTo'](db[_0x3702('0x16f')],{'foreignKey':_0x3702('0x1e6'),'as':'ToQueue'});db['FaxTransferReport'][_0x3702('0x119')](db['FaxAccount'],{'foreignKey':_0x3702('0x1e7'),'as':_0x3702('0x1e0')});db[_0x3702('0x1e8')][_0x3702('0x119')](db[_0x3702('0x55')],{});db[_0x3702('0x1e8')]['belongsTo'](db[_0x3702('0x53')],{});db['OpenchannelTransferReport'][_0x3702('0x119')](db['OpenchannelAccount'],{'foreignKey':_0x3702('0x1e9'),'as':_0x3702('0x1da')});db[_0x3702('0x1e8')]['belongsTo'](db['User'],{'foreignKey':_0x3702('0x1db'),'as':_0x3702('0x1dc')});db['OpenchannelTransferReport']['belongsTo'](db[_0x3702('0x12')],{'foreignKey':_0x3702('0x1dd'),'as':_0x3702('0x1e5')});db[_0x3702('0x1e8')][_0x3702('0x119')](db[_0x3702('0x57')],{'foreignKey':'ToOpenchannelQueueId','as':_0x3702('0x1e1')});db[_0x3702('0x1e8')][_0x3702('0x119')](db[_0x3702('0x50')],{'foreignKey':_0x3702('0x1ea'),'as':_0x3702('0x1e0')});db['SmsTransferReport'][_0x3702('0x119')](db[_0x3702('0x4c')],{});db[_0x3702('0x1eb')][_0x3702('0x119')](db[_0x3702('0x4b')],{});db[_0x3702('0x1eb')][_0x3702('0x119')](db[_0x3702('0x47')],{'foreignKey':_0x3702('0x1ec'),'as':_0x3702('0x1da')});db[_0x3702('0x1eb')]['belongsTo'](db[_0x3702('0x12')],{'foreignKey':_0x3702('0x1db'),'as':'FromAgent'});db[_0x3702('0x1eb')][_0x3702('0x119')](db[_0x3702('0x12')],{'foreignKey':_0x3702('0x1dd'),'as':_0x3702('0x1e5')});db[_0x3702('0x1eb')][_0x3702('0x119')](db['SmsQueue'],{'foreignKey':_0x3702('0x1ed'),'as':_0x3702('0x1e1')});db[_0x3702('0x1eb')][_0x3702('0x119')](db[_0x3702('0x47')],{'foreignKey':_0x3702('0x1ee'),'as':_0x3702('0x1e0')});db['CmList'][_0x3702('0x10d')](db[_0x3702('0x156')],{'as':_0x3702('0x177'),'foreignKey':_0x3702('0x157'),'onDelete':'cascade'});db[_0x3702('0xeb')][_0x3702('0x10d')](db[_0x3702('0x1ef')],{'as':_0x3702('0x1f0'),'foreignKey':_0x3702('0x157')});db['CmList'][_0x3702('0x10d')](db[_0x3702('0x67')],{'as':_0x3702('0x11e'),'onDelete':_0x3702('0x10c'),'foreignKey':_0x3702('0x157')});db[_0x3702('0xeb')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x3702('0x157')});db['CmList'][_0x3702('0x10d')](db[_0x3702('0x6f')],{'as':_0x3702('0x1f1'),'foreignKey':_0x3702('0x157')});db[_0x3702('0xeb')]['hasMany'](db['ReportAgentPreview'],{'as':_0x3702('0x70'),'foreignKey':'ListId'});db['CmList']['belongsToMany'](db[_0x3702('0x126')],{'as':_0x3702('0x1f2'),'through':_0x3702('0x145')});db[_0x3702('0xeb')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x3702('0x128')]['hasMany'](db[_0x3702('0x17')],{'as':_0x3702('0x110'),'onDelete':'cascade'});db[_0x3702('0x128')]['belongsToMany'](db['User'],{'as':_0x3702('0x146'),'through':_0x3702('0x105')});db[_0x3702('0x128')][_0x3702('0x11d')](db[_0x3702('0xdd')],{'through':'TeamVoicePrefix','as':_0x3702('0x15c')});db[_0x3702('0xee')][_0x3702('0x10d')](db['User'],{'as':'Users','foreignKey':_0x3702('0x11a')});db['UserProfile']['hasMany'](db['UserProfileSection'],{'as':_0x3702('0x1f3'),'foreignKey':'userProfileId','onDelete':_0x3702('0x10c')});db[_0x3702('0xf0')][_0x3702('0x10d')](db[_0x3702('0xf2')],{'as':_0x3702('0x1f4'),'foreignKey':_0x3702('0x1f5'),'onDelete':'cascade'});db['WhatsappAccount'][_0x3702('0x10d')](db['Disposition'],{'as':_0x3702('0x177'),'foreignKey':_0x3702('0x1f6'),'onDelete':_0x3702('0x10c')});db[_0x3702('0xf6')][_0x3702('0x10d')](db[_0x3702('0x75')],{'as':_0x3702('0x16b'),'foreignKey':_0x3702('0x1f6')});db[_0x3702('0xf6')][_0x3702('0x10d')](db[_0x3702('0x1f7')],{'as':'Messages','foreignKey':_0x3702('0x1f6')});db['WhatsappAccount'][_0x3702('0x10d')](db[_0x3702('0xfa')],{'as':_0x3702('0x16d')});db[_0x3702('0xf6')][_0x3702('0x10d')](db[_0x3702('0xf8')],{'as':_0x3702('0x138')});db[_0x3702('0xf6')]['belongsTo'](db['CmList'],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0xf6')][_0x3702('0x119')](db[_0x3702('0x7b')],{'as':'mandatoryDispositionPause','foreignKey':_0x3702('0x144')});db[_0x3702('0xf6')][_0x3702('0x11d')](db[_0x3702('0x12')],{'as':_0x3702('0x146'),'through':_0x3702('0x135')});db[_0x3702('0xf8')][_0x3702('0x119')](db[_0x3702('0x12')],{'onDelete':_0x3702('0x154')});db[_0x3702('0xf8')][_0x3702('0x119')](db['WhatsappQueue'],{'onDelete':_0x3702('0x154')});db['WhatsappApplication'][_0x3702('0x119')](db[_0x3702('0xf6')],{'onDelete':_0x3702('0x154')});db[_0x3702('0xf8')]['belongsTo'](db[_0x3702('0x79')],{'onDelete':_0x3702('0x154'),'foreignKey':_0x3702('0x143')});db[_0x3702('0xf8')][_0x3702('0x119')](db[_0x3702('0x81')],{'onDelete':'restrict','foreignKey':_0x3702('0x168')});db[_0x3702('0xfa')]['hasMany'](db[_0x3702('0x1f7')],{'as':_0x3702('0x149'),'onDelete':'cascade','foreignKey':_0x3702('0x1f8')});db[_0x3702('0xfa')]['belongsTo'](db['WhatsappAccount'],{'as':_0x3702('0x15e'),'foreignKey':'WhatsappAccountId'});db[_0x3702('0xfa')][_0x3702('0x119')](db['CmContact'],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db[_0x3702('0xfa')][_0x3702('0x119')](db[_0x3702('0x12')],{'as':'Owner','foreignKey':'UserId'});db['WhatsappInteraction'][_0x3702('0x11d')](db['Tag'],{'through':_0x3702('0x1f9'),'as':_0x3702('0x161')});db[_0x3702('0xfa')][_0x3702('0x11d')](db[_0x3702('0x81')],{'through':_0x3702('0x1f9'),'as':_0x3702('0x162')});db[_0x3702('0xfa')][_0x3702('0x11d')](db['User'],{'as':_0x3702('0x163'),'through':_0x3702('0x125'),'foreignKey':'WhatsappInteractionId'});db[_0x3702('0x1f7')]['belongsTo'](db[_0x3702('0x12')],{'as':_0x3702('0x12')});db['WhatsappMessage'][_0x3702('0x119')](db[_0x3702('0x67')],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x14f')});db[_0x3702('0x1f7')][_0x3702('0x119')](db[_0x3702('0xfa')],{'onDelete':_0x3702('0x10c'),'as':_0x3702('0x173'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db[_0x3702('0xf6')],{'as':_0x3702('0x15e'),'foreignKey':_0x3702('0x1f6')});db[_0x3702('0xfd')]['belongsTo'](db[_0x3702('0xf6')],{});db['WhatsappQueueReport'][_0x3702('0x119')](db['CmList'],{'as':_0x3702('0x16a'),'foreignKey':_0x3702('0x157')});db[_0x3702('0xfd')]['belongsTo'](db['CmContact'],{'as':_0x3702('0x14f'),'foreignKey':_0x3702('0x150')});db[_0x3702('0xfd')]['belongsTo'](db[_0x3702('0xfa')],{});db[_0x3702('0xfd')][_0x3702('0x119')](db[_0x3702('0x12c')],{});db['WhatsappQueueReport'][_0x3702('0x119')](db[_0x3702('0x1f7')],{});db[_0x3702('0xfd')][_0x3702('0x119')](db[_0x3702('0x12')],{});db[_0x3702('0x1fa')]['belongsTo'](db[_0x3702('0x1f7')],{});db['WhatsappTransferReport'][_0x3702('0x119')](db[_0x3702('0xfa')],{});db[_0x3702('0x1fa')]['belongsTo'](db[_0x3702('0xf6')],{'foreignKey':'FromWhatsappAccountId','as':_0x3702('0x1da')});db[_0x3702('0x1fa')][_0x3702('0x119')](db[_0x3702('0xf6')],{'foreignKey':_0x3702('0x1fb'),'as':_0x3702('0x1e0')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x3702('0x1fc'),'as':_0x3702('0x1e1')});db[_0x3702('0x1fa')][_0x3702('0x119')](db[_0x3702('0x12')],{'foreignKey':_0x3702('0x1db'),'as':_0x3702('0x1dc')});db[_0x3702('0x1fa')][_0x3702('0x119')](db[_0x3702('0x12')],{'foreignKey':_0x3702('0x1dd'),'as':_0x3702('0x1e5')});db[_0x3702('0x12c')]['belongsToMany'](db[_0x3702('0x12')],{'as':_0x3702('0x146'),'through':_0x3702('0x33'),'foreignKey':_0x3702('0x1fd')});db[_0x3702('0x12c')][_0x3702('0x11d')](db[_0x3702('0xdd')],{'through':_0x3702('0x1d4'),'as':_0x3702('0x15c')});db[_0x3702('0x10b')][_0x3702('0x119')](db[_0x3702('0x12')],{'as':'user','foreignKey':_0x3702('0x10a'),'onDelete':_0x3702('0x10c'),'hooks':!![]});db[_0x3702('0xff')][_0x3702('0x108')](db[_0x3702('0xbf')],{'as':_0x3702('0xbf'),'onDelete':'restrict'});db[_0x3702('0xff')]['hasOne'](db[_0x3702('0x152')],{'as':_0x3702('0x1fe'),'onDelete':_0x3702('0x154')});db[_0x3702('0xff')][_0x3702('0x108')](db['MailServerOut'],{'as':_0x3702('0x1ff'),'onDelete':'restrict'});module[_0x3702('0x200')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb8da=['UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','VoiceQueueId','Hoppers','ReportAgentPreview','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','VoiceRecording','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Disposition','Answers','Interactions','List','MailQueue','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','ListId','Dispositions','FaxAccountId','FaxApplication','Exntensions','FaxInteractionId','fax_interaction_has_tags','Tags','ThroughTags','team_has_fax_queues','SmsAccountId','SmsMessage','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Agent','chat_interaction_has_tags','ChatInteractionId','AttachmentId','team_has_chat_queues','ChatGroupId','Website','CmContactHasItem','Phones','HopperHistories','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemType','Hopper','CmHopperId','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','AnalyticMetric','SalesforceAccount','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','AccountId','Subject','Description','Field','FieldId','VariableId','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','MailQueues','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','VoicePrefixes','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToQueue','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','ToAccount','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','name','utf8','sequelizeHistory','xcall','mysql','utf8mb4','database','username','options','password','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','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','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/schedule/schedule.model','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.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/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','cascade'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb8da,0xea));var _0xab8d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb8da[_0x502c7d];return _0x30b7ed;};'use strict';var config=require(_0xab8d('0x0'));var Sequelize=require(_0xab8d('0x1'));var _=require(_0xab8d('0x2'));var jstz=require(_0xab8d('0x3'));var timezone=jstz[_0xab8d('0x4')]();config[_0xab8d('0x1')]=_[_0xab8d('0x5')](config['sequelize'],{'database':_0xab8d('0x6'),'username':'xcall','password':_0xab8d('0x7'),'options':{'host':_0xab8d('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xab8d('0x9')](),'define':{'charset':_0xab8d('0xa'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xab8d('0x5')](config[_0xab8d('0xb')],{'database':_0xab8d('0x6'),'username':_0xab8d('0xc'),'password':_0xab8d('0x7'),'options':{'host':_0xab8d('0x8'),'port':0xcea,'dialect':_0xab8d('0xd'),'dialectOptions':{'charset':_0xab8d('0xe')},'logging':![],'timezone':timezone[_0xab8d('0x9')](),'define':{'charset':_0xab8d('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xab8d('0x1')][_0xab8d('0xf')],config[_0xab8d('0x1')][_0xab8d('0x10')],config[_0xab8d('0x1')]['password'],config[_0xab8d('0x1')][_0xab8d('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xab8d('0xb')][_0xab8d('0xf')],config[_0xab8d('0xb')]['username'],config['sequelizeHistory'][_0xab8d('0x12')],config[_0xab8d('0xb')]['options'])};db[_0xab8d('0x13')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x14'));db[_0xab8d('0x15')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x17'));db[_0xab8d('0x18')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x19'));db[_0xab8d('0x1a')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x1b'));db[_0xab8d('0x1c')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x1d'));db['VoiceQueue']=db[_0xab8d('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0xab8d('0x1')]['import'](_0xab8d('0x1e'));db[_0xab8d('0x1f')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/voiceMail/voiceMail.model');db[_0xab8d('0x20')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x21'));db['VoiceCallReport']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x22'));db[_0xab8d('0x23')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x24'));db['VoiceAgentReport']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x25'));db[_0xab8d('0x26')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xab8d('0x27')]=db['sequelize']['import'](_0xab8d('0x28'));db[_0xab8d('0x29')]=db['sequelize']['import'](_0xab8d('0x2a'));db[_0xab8d('0x2b')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x2c'));db[_0xab8d('0x2d')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x2e'));db[_0xab8d('0x2f')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x30'));db[_0xab8d('0x31')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x32'));db['UserMailQueue']=db[_0xab8d('0x1')]['import']('../api/userMailQueue/userMailQueue.model');db[_0xab8d('0x33')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x34'));db[_0xab8d('0x35')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x36'));db[_0xab8d('0x37')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xab8d('0x38')]=db['sequelize'][_0xab8d('0x16')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xab8d('0x39')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x3a'));db[_0xab8d('0x3b')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x3c'));db['MailQueue']=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x3d'));db[_0xab8d('0x3e')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x3f'));db[_0xab8d('0x40')]=db[_0xab8d('0x1')]['import']('../api/mailInteraction/mailInteraction.model');db[_0xab8d('0x41')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x42'));db[_0xab8d('0x43')]=db[_0xab8d('0x1')]['import']('../api/mailApplication/mailApplication.model');db[_0xab8d('0x44')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x45'));db[_0xab8d('0x46')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x47'));db[_0xab8d('0x48')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x49'));db[_0xab8d('0x4a')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x4b'));db['FaxApplication']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x4c'));db[_0xab8d('0x4d')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x4e'));db[_0xab8d('0x4f')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/faxMessage/faxMessage.model');db[_0xab8d('0x50')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x51'));db[_0xab8d('0x52')]=db['sequelize']['import']('../api/faxQueueReport/faxQueueReport.model');db[_0xab8d('0x53')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x54'));db[_0xab8d('0x55')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x56'));db['SmsInteraction']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x57'));db[_0xab8d('0x58')]=db['sequelize'][_0xab8d('0x16')]('../api/openchannelAccount/openchannelAccount.model');db[_0xab8d('0x59')]=db['sequelize']['import'](_0xab8d('0x5a'));db[_0xab8d('0x5b')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x5c'));db[_0xab8d('0x5d')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x5e'));db[_0xab8d('0x5f')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x60'));db[_0xab8d('0x61')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x62'));db[_0xab8d('0x63')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x64'));db[_0xab8d('0x65')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x66'));db[_0xab8d('0x67')]=db['sequelize']['import'](_0xab8d('0x68'));db[_0xab8d('0x69')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x6a'));db[_0xab8d('0x6b')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x6c'));db[_0xab8d('0x6d')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/chatQueue/chatQueue.model');db[_0xab8d('0x6e')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x6f'));db[_0xab8d('0x70')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xab8d('0x71')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x72'));db[_0xab8d('0x73')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x74'));db[_0xab8d('0x75')]=db[_0xab8d('0x1')]['import']('../api/cmHopper/cmHopper.model');db[_0xab8d('0x76')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x77'));db['CmHopperFinal']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xab8d('0x78')]=db['sequelize'][_0xab8d('0x16')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x79'));db[_0xab8d('0x7a')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x7b'));db[_0xab8d('0x7c')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x7d'));db[_0xab8d('0x7e')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/automation/automation.model');db[_0xab8d('0x7f')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x80'));db['Disposition']=db['sequelize'][_0xab8d('0x16')]('../api/disposition/disposition.model');db[_0xab8d('0x81')]=db['sequelize']['import'](_0xab8d('0x82'));db[_0xab8d('0x83')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x84'));db[_0xab8d('0x85')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x86'));db[_0xab8d('0x87')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x88'));db['VoiceQueuesLog']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x89'));db['Sound']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x8a'));db['Tag']=db[_0xab8d('0x1')]['import'](_0xab8d('0x8b'));db[_0xab8d('0x8c')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x8d'));db['CmContactHasItem']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x8e'));db[_0xab8d('0x8f')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xab8d('0x90')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x91'));db[_0xab8d('0x92')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x93'));db[_0xab8d('0x94')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x95'));db[_0xab8d('0x96')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x97'));db[_0xab8d('0x98')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x99'));db[_0xab8d('0x9a')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x9b'));db[_0xab8d('0x9c')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xab8d('0x1')]['import'](_0xab8d('0x9d'));db['AnalyticMetric']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x9e'));db['AnalyticFieldReport']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x9f'));db[_0xab8d('0xa0')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xa1'));db['SalesforceAccount']=db[_0xab8d('0x1')]['import'](_0xab8d('0xa2'));db[_0xab8d('0xa3')]=db[_0xab8d('0x1')]['import'](_0xab8d('0xa4'));db[_0xab8d('0xa5')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xa6'));db[_0xab8d('0xa7')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xab8d('0xa8')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xa9'));db[_0xab8d('0xaa')]=db['sequelize']['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xab8d('0xab')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xac'));db[_0xab8d('0xad')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xae'));db[_0xab8d('0xaf')]=db['sequelize']['import']('../api/intDeskField/intDeskField.model');db[_0xab8d('0xb0')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xb1'));db[_0xab8d('0xb2')]=db[_0xab8d('0x1')]['import'](_0xab8d('0xb3'));db[_0xab8d('0xb4')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xb5'));db[_0xab8d('0xb6')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xab8d('0xb7')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xb8'));db[_0xab8d('0xb9')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xba'));db[_0xab8d('0xbb')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xbc'));db[_0xab8d('0xbd')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xbe'));db[_0xab8d('0xbf')]=db['sequelize'][_0xab8d('0x16')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db['sequelize']['import'](_0xab8d('0xc0'));db['VtigerConfiguration']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xc1'));db[_0xab8d('0xc2')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/intVtigerField/intVtigerField.model');db[_0xab8d('0xc3')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xc4'));db[_0xab8d('0xc5')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xc6'));db[_0xab8d('0xc7')]=db[_0xab8d('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0xab8d('0xc8')]=db['sequelize']['import'](_0xab8d('0xc9'));db['Dynamics365Configuration']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xab8d('0xca')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xcb'));db[_0xab8d('0xcc')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xab8d('0xcd')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xab8d('0xce')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xcf'));db['Integration']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x97'));db[_0xab8d('0xd0')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xd1'));db[_0xab8d('0xd2')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xd3'));db[_0xab8d('0xd4')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xd5'));db[_0xab8d('0xd6')]=db['sequelize'][_0xab8d('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xab8d('0xd7')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xd8'));db[_0xab8d('0xd9')]=db[_0xab8d('0x1')]['import'](_0xab8d('0xda'));db[_0xab8d('0xdb')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xdc'));db['SquareReport']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/squareReport/squareReport.model');db[_0xab8d('0xdd')]=db[_0xab8d('0x1')]['import'](_0xab8d('0xde'));db[_0xab8d('0xdf')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xe0'));db[_0xab8d('0xe1')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xe2'));db['SquareOdbc']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/squareOdbc/squareOdbc.model');db[_0xab8d('0xe3')]=db[_0xab8d('0x1')]['import'](_0xab8d('0xe4'));db[_0xab8d('0xe5')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xe6'));db['SquareMessage']=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/squareMessage/squareMessage.model');db[_0xab8d('0xe7')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xe8'));db[_0xab8d('0xe9')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xea'));db[_0xab8d('0xeb')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xec'));db['Migration']=db['sequelize']['import'](_0xab8d('0xed'));db[_0xab8d('0xee')]=db[_0xab8d('0x1')]['import']('../api/attachment/attachment.model');db[_0xab8d('0xef')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/plugin/plugin.model');db['MailTransferReport']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xf0'));db[_0xab8d('0xf1')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xf2'));db[_0xab8d('0xf3')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xf4'));db['OpenchannelTransferReport']=db['sequelize']['import'](_0xab8d('0xf5'));db['SmsTransferReport']=db['sequelize'][_0xab8d('0x16')](_0xab8d('0xf6'));db[_0xab8d('0xf7')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/cmList/cmList.model');db[_0xab8d('0xf8')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/voicePrefix/voicePrefix.model');db[_0xab8d('0xf9')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/userProfile/userProfile.model');db[_0xab8d('0xfa')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xfb'));db['UserProfileResource']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xfc'));db[_0xab8d('0xfd')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0xfe'));db[_0xab8d('0xff')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x100'));db[_0xab8d('0x101')]=db['sequelize'][_0xab8d('0x16')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x102'));db[_0xab8d('0x103')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x104'));db[_0xab8d('0x105')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xab8d('0x106')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x107'));db['WhatsappQueue']=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x108'));db[_0xab8d('0x109')]=db[_0xab8d('0x1')][_0xab8d('0x16')]('../api/cloudProvider/cloudProvider.model');db[_0xab8d('0x10a')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x10b'));db[_0xab8d('0x10c')]=db[_0xab8d('0x1')]['import'](_0xab8d('0x10d'));db[_0xab8d('0x10e')]=db[_0xab8d('0x1')][_0xab8d('0x16')](_0xab8d('0x10f'));db[_0xab8d('0x110')]=db['sequelize'][_0xab8d('0x16')](_0xab8d('0x111'));db['User'][_0xab8d('0x112')](db['VoiceMail'],{'as':_0xab8d('0x113'),'onDelete':_0xab8d('0x114'),'foreignKey':'UserId'});db[_0xab8d('0x13')]['hasOne'](db[_0xab8d('0x110')],{'as':'userSetting','onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x13')]['hasMany'](db['VoiceRecording'],{'as':_0xab8d('0x116'),'foreignKey':'UserId'});db[_0xab8d('0x13')][_0xab8d('0x117')](db[_0xab8d('0x2d')],{'as':_0xab8d('0x118'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x13')][_0xab8d('0x117')](db[_0xab8d('0x1a')],{'as':_0xab8d('0x119'),'onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x13')][_0xab8d('0x117')](db[_0xab8d('0x11a')],{'as':_0xab8d('0x11b'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x13')][_0xab8d('0x117')](db[_0xab8d('0x78')],{'as':'HopperHistory','foreignKey':_0xab8d('0x115')});db[_0xab8d('0x13')][_0xab8d('0x117')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xab8d('0x115')});db['User']['hasMany'](db[_0xab8d('0x5b')],{'as':_0xab8d('0x11c'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x13')][_0xab8d('0x117')](db['ChatInteraction'],{'as':_0xab8d('0x11d'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x13')]['hasMany'](db[_0xab8d('0x11e')],{'as':_0xab8d('0x11f'),'foreignKey':'UserId'});db[_0xab8d('0x13')][_0xab8d('0x117')](db[_0xab8d('0x4d')],{'as':_0xab8d('0x120'),'foreignKey':'UserId'});db[_0xab8d('0x13')][_0xab8d('0x117')](db[_0xab8d('0x40')],{'as':_0xab8d('0x121'),'foreignKey':'UserId'});db[_0xab8d('0x13')][_0xab8d('0x117')](db[_0xab8d('0x122')],{'as':_0xab8d('0x123'),'foreignKey':_0xab8d('0x115')});db['User'][_0xab8d('0x117')](db[_0xab8d('0xfd')],{'as':_0xab8d('0x124'),'foreignKey':_0xab8d('0x125')});db[_0xab8d('0x13')]['belongsTo'](db['UserProfile'],{'as':_0xab8d('0xf9'),'foreignKey':_0xab8d('0x126')});db[_0xab8d('0x13')]['belongsToMany'](db['ChatGroup'],{'as':_0xab8d('0x127'),'through':_0xab8d('0x128')});db['User'][_0xab8d('0x129')](db[_0xab8d('0x73')],{'as':_0xab8d('0x12a'),'through':_0xab8d('0x12b')});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0xf7')],{'as':'Lists','through':'cm_user_has_lists'});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0xe7')],{'through':_0xab8d('0x12c')});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x40')],{'as':_0xab8d('0x121'),'through':_0xab8d('0x12d')});db['User'][_0xab8d('0x129')](db[_0xab8d('0x67')],{'as':_0xab8d('0x11d'),'through':_0xab8d('0x12e')});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x4d')],{'as':_0xab8d('0x120'),'through':_0xab8d('0x12f')});db[_0xab8d('0x13')][_0xab8d('0x129')](db['SmsInteraction'],{'as':_0xab8d('0x11f'),'through':_0xab8d('0x130')});db['User'][_0xab8d('0x129')](db[_0xab8d('0x5b')],{'as':'OpenchannelInteractions','through':_0xab8d('0x131')});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x122')],{'as':_0xab8d('0x123'),'through':_0xab8d('0x132')});db[_0xab8d('0x13')]['belongsToMany'](db[_0xab8d('0x133')],{'as':_0xab8d('0x134'),'through':_0xab8d('0x2f'),'required':![]});db[_0xab8d('0x13')]['belongsToMany'](db[_0xab8d('0xf8')],{'as':'VoicePrefixes','through':_0xab8d('0x10e'),'required':![]});db[_0xab8d('0x13')][_0xab8d('0x129')](db['MailQueue'],{'as':'MailQueues','through':_0xab8d('0x135'),'required':![]});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x6d')],{'as':_0xab8d('0x136'),'through':_0xab8d('0x31'),'required':![],'hooks':!![]});db[_0xab8d('0x13')]['belongsToMany'](db[_0xab8d('0x50')],{'as':_0xab8d('0x137'),'through':_0xab8d('0x33'),'required':![]});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x138')],{'as':'SmsQueues','through':_0xab8d('0x35'),'required':![]});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x5f')],{'as':_0xab8d('0x139'),'through':_0xab8d('0x37'),'required':![]});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x13a')],{'as':_0xab8d('0x13b'),'through':'UserWhatsappQueue','required':![]});db[_0xab8d('0x13')]['belongsToMany'](db[_0xab8d('0xf7')],{'through':_0xab8d('0x13c')});db[_0xab8d('0x13')]['belongsToMany'](db[_0xab8d('0x61')],{'as':_0xab8d('0x13d'),'through':_0xab8d('0x13e')});db[_0xab8d('0x13')]['belongsToMany'](db['FaxAccount'],{'as':_0xab8d('0x13f'),'through':_0xab8d('0x140')});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0x141')],{'as':_0xab8d('0x142'),'through':_0xab8d('0x143')});db['User'][_0xab8d('0x129')](db[_0xab8d('0x58')],{'as':_0xab8d('0x144'),'through':_0xab8d('0x145')});db['User'][_0xab8d('0x129')](db[_0xab8d('0x53')],{'as':_0xab8d('0x146'),'through':_0xab8d('0x147')});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0xff')],{'as':_0xab8d('0x148'),'through':_0xab8d('0x149')});db[_0xab8d('0x13')][_0xab8d('0x129')](db[_0xab8d('0xe3')],{'as':_0xab8d('0x14a'),'through':_0xab8d('0x14b')});db[_0xab8d('0x15')]['hasMany'](db[_0xab8d('0x1a')],{'as':_0xab8d('0x14c'),'onDelete':'cascade','foreignKey':_0xab8d('0x14d')});db[_0xab8d('0x18')]['hasMany'](db['VoiceExtension'],{'onDelete':_0xab8d('0x114')});db[_0xab8d('0x1a')][_0xab8d('0x117')](db[_0xab8d('0x1a')],{'as':_0xab8d('0x14e'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x1c')]['belongsToMany'](db[_0xab8d('0x14f')],{'as':'Sounds','through':'moh_has_sounds'});db[_0xab8d('0x133')][_0xab8d('0x117')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0xab8d('0x150')});db[_0xab8d('0x133')][_0xab8d('0x117')](db[_0xab8d('0x75')],{'as':_0xab8d('0x151'),'foreignKey':_0xab8d('0x150')});db[_0xab8d('0x133')][_0xab8d('0x117')](db[_0xab8d('0x11a')],{'as':'HopperFinals','foreignKey':_0xab8d('0x150')});db[_0xab8d('0x133')][_0xab8d('0x117')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xab8d('0x150')});db[_0xab8d('0x133')][_0xab8d('0x117')](db['ReportAgentPreview'],{'as':_0xab8d('0x152'),'foreignKey':_0xab8d('0x150')});db[_0xab8d('0x133')]['hasMany'](db[_0xab8d('0x76')],{'as':'HopperBlacks','foreignKey':_0xab8d('0x150')});db['VoiceQueue']['hasMany'](db[_0xab8d('0xd9')],{'as':_0xab8d('0x153'),'foreignKey':'VoiceQueueId'});db[_0xab8d('0x133')][_0xab8d('0x154')](db['Trunk'],{'as':_0xab8d('0x29'),'foreignKey':_0xab8d('0x155')});db[_0xab8d('0x133')][_0xab8d('0x154')](db[_0xab8d('0x29')],{'as':_0xab8d('0x156'),'foreignKey':_0xab8d('0x157')});db[_0xab8d('0x133')][_0xab8d('0x154')](db[_0xab8d('0x83')],{'as':_0xab8d('0x83'),'foreignKey':_0xab8d('0x158')});db[_0xab8d('0x133')][_0xab8d('0x154')](db[_0xab8d('0x85')],{'as':_0xab8d('0x159'),'foreignKey':_0xab8d('0x15a')});db[_0xab8d('0x133')][_0xab8d('0x129')](db['CmList'],{'as':_0xab8d('0x15b'),'through':_0xab8d('0x15c')});db[_0xab8d('0x133')][_0xab8d('0x129')](db['User'],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x2f')});db['VoiceQueue']['belongsToMany'](db[_0xab8d('0xe7')],{'as':_0xab8d('0x15e'),'through':_0xab8d('0x10a')});db[_0xab8d('0x133')][_0xab8d('0x129')](db[_0xab8d('0xf7')],{'as':_0xab8d('0x15f'),'through':'voice_queues_has_cm_blacklists'});db[_0xab8d('0x160')][_0xab8d('0x154')](db['User'],{'as':_0xab8d('0x13'),'foreignKey':'UserId'});db[_0xab8d('0x1f')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x13'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x113')][_0xab8d('0x117')](db[_0xab8d('0x20')],{'as':_0xab8d('0x161'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x162'),'sourceKey':_0xab8d('0x163')});db['VoiceMailMessage']['belongsTo'](db[_0xab8d('0x113')],{'foreignKey':'mailboxuser','targetKey':_0xab8d('0x163')});db[_0xab8d('0x164')][_0xab8d('0x117')](db[_0xab8d('0x26')],{'as':'QueueCalls','foreignKey':_0xab8d('0x165'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xab8d('0x166')],{'as':_0xab8d('0x167'),'foreignKey':'uniqueid','constraints':![]});db[_0xab8d('0x164')]['belongsTo'](db[_0xab8d('0x13')],{'as':'User','foreignKey':_0xab8d('0x115')});db[_0xab8d('0x164')]['belongsTo'](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x39')][_0xab8d('0x154')](db[_0xab8d('0x141')],{'as':_0xab8d('0x141'),'foreignKey':_0xab8d('0x16a')});db[_0xab8d('0x39')][_0xab8d('0x154')](db['CloudProvider'],{'as':_0xab8d('0x109'),'foreignKey':_0xab8d('0x16b'),'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x3b')]['belongsTo'](db[_0xab8d('0x141')],{'as':_0xab8d('0x141'),'foreignKey':'MailAccountId'});db[_0xab8d('0x3b')]['belongsTo'](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xab8d('0x16b'),'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x141')][_0xab8d('0x112')](db[_0xab8d('0x39')],{'as':_0xab8d('0x16d'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x141')][_0xab8d('0x112')](db[_0xab8d('0x3b')],{'as':_0xab8d('0x16e'),'onDelete':_0xab8d('0x114')});db['MailAccount'][_0xab8d('0x117')](db[_0xab8d('0x16f')],{'as':'Dispositions','foreignKey':_0xab8d('0x16a'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x141')][_0xab8d('0x117')](db['CannedAnswer'],{'as':_0xab8d('0x170'),'foreignKey':_0xab8d('0x16a')});db['MailAccount'][_0xab8d('0x117')](db[_0xab8d('0x41')],{'as':_0xab8d('0x161'),'foreignKey':_0xab8d('0x16a')});db[_0xab8d('0x141')][_0xab8d('0x117')](db['MailInteraction'],{'as':_0xab8d('0x171')});db[_0xab8d('0x141')][_0xab8d('0x117')](db[_0xab8d('0x43')],{'as':_0xab8d('0x14e')});db[_0xab8d('0x141')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':_0xab8d('0x172'),'foreignKey':'ListId'});db[_0xab8d('0x141')][_0xab8d('0x154')](db['Template'],{'as':'Template','foreignKey':'TemplateId'});db[_0xab8d('0x141')][_0xab8d('0x154')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x143')});db['MailQueue'][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x135')});db[_0xab8d('0x173')]['belongsToMany'](db[_0xab8d('0xe7')],{'through':_0xab8d('0x174'),'as':_0xab8d('0x15e')});db[_0xab8d('0x40')][_0xab8d('0x117')](db[_0xab8d('0x41')],{'as':_0xab8d('0x161'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x175')});db[_0xab8d('0x40')][_0xab8d('0x154')](db['MailAccount'],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x16a')});db['MailInteraction'][_0xab8d('0x154')](db['CmContact'],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x40')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x177'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x40')]['belongsToMany'](db[_0xab8d('0x178')],{'through':_0xab8d('0x179'),'as':'Tags'});db['MailInteraction'][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x179'),'as':'ThroughTags'});db[_0xab8d('0x40')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x17a'),'through':_0xab8d('0x12d'),'foreignKey':_0xab8d('0x175')});db[_0xab8d('0x41')][_0xab8d('0x117')](db[_0xab8d('0xee')],{'as':_0xab8d('0x17b'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x41')]['belongsTo'](db[_0xab8d('0x13')],{'as':_0xab8d('0x13')});db[_0xab8d('0x41')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x168')});db[_0xab8d('0x41')]['belongsTo'](db[_0xab8d('0x40')],{'as':_0xab8d('0x17c'),'foreignKey':'MailInteractionId'});db[_0xab8d('0x41')][_0xab8d('0x154')](db[_0xab8d('0x141')],{'as':'Account','foreignKey':_0xab8d('0x16a')});db['MailMessage'][_0xab8d('0x154')](db[_0xab8d('0x61')],{'as':'ChatWebsite','foreignKey':_0xab8d('0x17d')});db[_0xab8d('0x41')][_0xab8d('0x154')](db[_0xab8d('0x6b')],{'as':_0xab8d('0x6b'),'foreignKey':_0xab8d('0x17e')});db[_0xab8d('0x43')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x43')][_0xab8d('0x154')](db['MailQueue'],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x43')][_0xab8d('0x154')](db[_0xab8d('0x141')],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x43')][_0xab8d('0x154')](db[_0xab8d('0x83')],{'onDelete':'restrict','foreignKey':_0xab8d('0x158')});db['MailApplication'][_0xab8d('0x154')](db[_0xab8d('0x178')],{'onDelete':_0xab8d('0x16c'),'foreignKey':_0xab8d('0x17f')});db['MailQueueReport'][_0xab8d('0x154')](db[_0xab8d('0x141')],{});db[_0xab8d('0x44')][_0xab8d('0x154')](db['CmList'],{'as':'List','foreignKey':_0xab8d('0x180')});db['MailQueueReport'][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':'ContactId'});db[_0xab8d('0x44')]['belongsTo'](db[_0xab8d('0x40')],{});db[_0xab8d('0x44')]['belongsTo'](db[_0xab8d('0x41')],{});db[_0xab8d('0x44')]['belongsTo'](db['User'],{});db[_0xab8d('0x44')][_0xab8d('0x154')](db[_0xab8d('0x173')],{});db[_0xab8d('0x46')][_0xab8d('0x117')](db[_0xab8d('0x48')],{'as':'Items','onDelete':_0xab8d('0x114')});db['FaxAccount'][_0xab8d('0x117')](db['Disposition'],{'as':_0xab8d('0x181'),'foreignKey':_0xab8d('0x182'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x4a')][_0xab8d('0x117')](db['CannedAnswer'],{'as':_0xab8d('0x170'),'foreignKey':_0xab8d('0x182')});db['FaxAccount'][_0xab8d('0x117')](db[_0xab8d('0x4d')],{'as':_0xab8d('0x171')});db[_0xab8d('0x4a')]['hasMany'](db[_0xab8d('0x183')],{'as':_0xab8d('0x14e')});db['FaxAccount'][_0xab8d('0x117')](db[_0xab8d('0x1a')],{'as':_0xab8d('0x184'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x4a')][_0xab8d('0x117')](db[_0xab8d('0x4f')],{'as':_0xab8d('0x161')});db[_0xab8d('0x4a')][_0xab8d('0x154')](db[_0xab8d('0x29')],{'as':'Trunk'});db[_0xab8d('0x4a')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':_0xab8d('0x172'),'foreignKey':_0xab8d('0x180')});db[_0xab8d('0x4a')][_0xab8d('0x154')](db[_0xab8d('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0xab8d('0x15a')});db[_0xab8d('0x4a')]['belongsToMany'](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':'user_has_fax_accounts'});db[_0xab8d('0x183')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x183')][_0xab8d('0x154')](db['FaxQueue'],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x183')][_0xab8d('0x154')](db[_0xab8d('0x4a')],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x183')][_0xab8d('0x154')](db[_0xab8d('0x178')],{'onDelete':_0xab8d('0x16c'),'foreignKey':_0xab8d('0x17f')});db[_0xab8d('0x4d')][_0xab8d('0x117')](db[_0xab8d('0x4f')],{'as':_0xab8d('0x161'),'onDelete':'cascade','foreignKey':_0xab8d('0x185')});db[_0xab8d('0x4d')]['belongsTo'](db[_0xab8d('0x4a')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x182')});db[_0xab8d('0x4d')][_0xab8d('0x154')](db['CmContact'],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x4d')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x177'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x4d')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x186'),'as':_0xab8d('0x187')});db[_0xab8d('0x4d')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':'fax_interaction_has_tags','as':_0xab8d('0x188')});db[_0xab8d('0x4d')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x17a'),'through':_0xab8d('0x12f'),'foreignKey':_0xab8d('0x185')});db[_0xab8d('0x4f')]['belongsTo'](db[_0xab8d('0x13')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x13')});db[_0xab8d('0x4f')][_0xab8d('0x154')](db[_0xab8d('0x4d')],{'as':_0xab8d('0x17c'),'foreignKey':'FaxInteractionId'});db[_0xab8d('0x4f')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'onDelete':'cascade','as':_0xab8d('0x168')});db[_0xab8d('0x4f')][_0xab8d('0x154')](db[_0xab8d('0xee')],{'as':_0xab8d('0xee'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db['FaxAccount'],{'as':_0xab8d('0x176'),'foreignKey':'FaxAccountId'});db[_0xab8d('0x50')][_0xab8d('0x129')](db['User'],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x33')});db[_0xab8d('0x50')][_0xab8d('0x129')](db['Team'],{'through':_0xab8d('0x189'),'as':_0xab8d('0x15e')});db[_0xab8d('0x52')]['belongsTo'](db['FaxAccount'],{});db[_0xab8d('0x52')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':_0xab8d('0x172'),'foreignKey':_0xab8d('0x180')});db[_0xab8d('0x52')]['belongsTo'](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db['FaxQueueReport'][_0xab8d('0x154')](db[_0xab8d('0x4d')],{});db[_0xab8d('0x52')][_0xab8d('0x154')](db['FaxMessage'],{});db[_0xab8d('0x52')][_0xab8d('0x154')](db[_0xab8d('0x13')],{});db[_0xab8d('0x52')][_0xab8d('0x154')](db[_0xab8d('0x50')],{});db['SmsAccount'][_0xab8d('0x117')](db[_0xab8d('0x16f')],{'as':_0xab8d('0x181'),'foreignKey':_0xab8d('0x18a'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x53')][_0xab8d('0x117')](db[_0xab8d('0x7f')],{'as':_0xab8d('0x170'),'foreignKey':_0xab8d('0x18a')});db[_0xab8d('0x53')][_0xab8d('0x117')](db[_0xab8d('0x18b')],{'as':_0xab8d('0x161'),'foreignKey':_0xab8d('0x18a')});db[_0xab8d('0x53')][_0xab8d('0x117')](db['SmsInteraction'],{'as':_0xab8d('0x171')});db[_0xab8d('0x53')]['hasMany'](db['SmsApplication'],{'as':_0xab8d('0x14e')});db['SmsAccount']['belongsTo'](db[_0xab8d('0xf7')],{'as':_0xab8d('0x172'),'foreignKey':_0xab8d('0x180')});db[_0xab8d('0x53')][_0xab8d('0x154')](db[_0xab8d('0x85')],{'as':_0xab8d('0x159'),'foreignKey':_0xab8d('0x15a')});db[_0xab8d('0x53')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x147')});db['SmsApplication']['belongsTo'](db['User'],{'onDelete':_0xab8d('0x16c')});db['SmsApplication'][_0xab8d('0x154')](db[_0xab8d('0x138')],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x55')][_0xab8d('0x154')](db[_0xab8d('0x53')],{'onDelete':'restrict'});db[_0xab8d('0x55')][_0xab8d('0x154')](db['Interval'],{'onDelete':_0xab8d('0x16c'),'foreignKey':'IntervalId'});db[_0xab8d('0x55')][_0xab8d('0x154')](db[_0xab8d('0x178')],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0xab8d('0x117')](db[_0xab8d('0x18b')],{'as':_0xab8d('0x161'),'onDelete':_0xab8d('0x114'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0xab8d('0x154')](db[_0xab8d('0x53')],{'as':'Account','foreignKey':_0xab8d('0x18a')});db[_0xab8d('0x11e')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':'Contact','foreignKey':_0xab8d('0x169')});db[_0xab8d('0x11e')][_0xab8d('0x154')](db['User'],{'as':_0xab8d('0x177'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x11e')][_0xab8d('0x129')](db['Tag'],{'through':_0xab8d('0x18c'),'as':'Tags'});db[_0xab8d('0x11e')]['belongsToMany'](db[_0xab8d('0x178')],{'through':_0xab8d('0x18c'),'as':'ThroughTags'});db[_0xab8d('0x11e')]['belongsToMany'](db[_0xab8d('0x13')],{'as':_0xab8d('0x17a'),'through':_0xab8d('0x130'),'foreignKey':_0xab8d('0x18d')});db[_0xab8d('0x18b')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x13')});db['SmsMessage'][_0xab8d('0x154')](db[_0xab8d('0x73')],{'onDelete':'cascade','as':_0xab8d('0x168')});db[_0xab8d('0x18b')][_0xab8d('0x154')](db[_0xab8d('0x11e')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x17c'),'foreignKey':_0xab8d('0x18d')});db[_0xab8d('0x18b')]['belongsTo'](db[_0xab8d('0x53')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x18a')});db[_0xab8d('0x138')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x35'),'foreignKey':_0xab8d('0x18e')});db[_0xab8d('0x138')]['belongsToMany'](db[_0xab8d('0xe7')],{'through':'team_has_sms_queues','as':_0xab8d('0x15e')});db[_0xab8d('0x58')][_0xab8d('0x117')](db[_0xab8d('0x16f')],{'as':'Dispositions','foreignKey':_0xab8d('0x18f'),'onDelete':_0xab8d('0x114')});db['OpenchannelAccount'][_0xab8d('0x117')](db[_0xab8d('0x7f')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0xab8d('0x58')]['hasMany'](db[_0xab8d('0x5b')],{'as':'Interactions','foreignKey':_0xab8d('0x18f')});db['OpenchannelAccount'][_0xab8d('0x117')](db[_0xab8d('0x5d')],{'as':_0xab8d('0x161'),'foreignKey':_0xab8d('0x18f')});db[_0xab8d('0x58')][_0xab8d('0x117')](db[_0xab8d('0x59')],{'as':'Applications','foreignKey':_0xab8d('0x18f')});db[_0xab8d('0x58')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':_0xab8d('0x172'),'foreignKey':'ListId'});db['OpenchannelAccount']['belongsTo'](db[_0xab8d('0x85')],{'as':_0xab8d('0x159'),'foreignKey':_0xab8d('0x15a')});db[_0xab8d('0x58')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x145')});db[_0xab8d('0x59')]['belongsTo'](db[_0xab8d('0x13')],{'onDelete':'restrict'});db[_0xab8d('0x59')][_0xab8d('0x154')](db[_0xab8d('0x5f')],{'onDelete':_0xab8d('0x16c'),'foreignKey':_0xab8d('0x190')});db[_0xab8d('0x59')][_0xab8d('0x154')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xab8d('0x59')]['belongsTo'](db[_0xab8d('0x83')],{'onDelete':_0xab8d('0x16c'),'foreignKey':_0xab8d('0x158')});db['OpenchannelApplication'][_0xab8d('0x154')](db['Tag'],{'onDelete':_0xab8d('0x16c'),'foreignKey':_0xab8d('0x17f')});db[_0xab8d('0x5b')][_0xab8d('0x117')](db[_0xab8d('0x5d')],{'as':_0xab8d('0x161'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x191')});db[_0xab8d('0x5b')][_0xab8d('0x154')](db[_0xab8d('0x58')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x18f')});db[_0xab8d('0x5b')]['belongsTo'](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':'ContactId'});db[_0xab8d('0x5b')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x177'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x5b')]['belongsToMany'](db[_0xab8d('0x178')],{'through':_0xab8d('0x192'),'as':'Tags'});db['OpenchannelInteraction'][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x192'),'as':_0xab8d('0x188')});db[_0xab8d('0x5b')]['belongsToMany'](db[_0xab8d('0x13')],{'as':'Users','through':_0xab8d('0x131'),'foreignKey':_0xab8d('0x191')});db[_0xab8d('0x5d')]['belongsTo'](db[_0xab8d('0x13')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x13')});db[_0xab8d('0x5d')][_0xab8d('0x154')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['OpenchannelMessage']['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x17c'),'foreignKey':'OpenchannelInteractionId'});db[_0xab8d('0x5d')][_0xab8d('0x154')](db[_0xab8d('0xee')],{'as':_0xab8d('0xee'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0xab8d('0x154')](db[_0xab8d('0x58')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x18f')});db[_0xab8d('0x5f')]['belongsToMany'](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':'UserOpenchannelQueue','foreignKey':_0xab8d('0x190')});db[_0xab8d('0x5f')][_0xab8d('0x129')](db['Team'],{'through':'team_has_openchannel_queues','as':_0xab8d('0x15e')});db[_0xab8d('0x61')][_0xab8d('0x117')](db[_0xab8d('0x16f')],{'as':_0xab8d('0x181'),'foreignKey':_0xab8d('0x17d'),'onDelete':'cascade'});db[_0xab8d('0x61')][_0xab8d('0x117')](db[_0xab8d('0x7f')],{'as':_0xab8d('0x170'),'foreignKey':_0xab8d('0x17d')});db[_0xab8d('0x61')][_0xab8d('0x117')](db[_0xab8d('0x70')],{'as':'ProactiveActions'});db[_0xab8d('0x61')]['hasMany'](db[_0xab8d('0x67')],{'as':_0xab8d('0x171')});db['ChatWebsite']['hasMany'](db[_0xab8d('0x65')],{'as':_0xab8d('0x14e')});db[_0xab8d('0x61')][_0xab8d('0x117')](db[_0xab8d('0x69')],{'as':_0xab8d('0x161')});db[_0xab8d('0x61')][_0xab8d('0x154')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['ChatWebsite'][_0xab8d('0x154')](db[_0xab8d('0x83')],{'as':'Interval','foreignKey':_0xab8d('0x158')});db['ChatWebsite'][_0xab8d('0x154')](db[_0xab8d('0x141')],{'as':_0xab8d('0x141'),'foreignKey':_0xab8d('0x16a')});db['ChatWebsite']['belongsTo'](db[_0xab8d('0x85')],{'as':_0xab8d('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xab8d('0x61')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x13e')});db[_0xab8d('0x63')][_0xab8d('0x154')](db[_0xab8d('0x58')],{});db[_0xab8d('0x63')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':'List','foreignKey':_0xab8d('0x180')});db[_0xab8d('0x63')][_0xab8d('0x154')](db['CmContact'],{'as':_0xab8d('0x168'),'foreignKey':'ContactId'});db[_0xab8d('0x63')][_0xab8d('0x154')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xab8d('0x154')](db[_0xab8d('0x5d')],{});db[_0xab8d('0x63')][_0xab8d('0x154')](db[_0xab8d('0x13')],{});db[_0xab8d('0x63')][_0xab8d('0x154')](db['OpenchannelQueue'],{});db[_0xab8d('0x65')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x193'),'foreignKey':_0xab8d('0x115'),'onDelete':'restrict'});db[_0xab8d('0x65')]['belongsTo'](db['ChatQueue'],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0xab8d('0x65')][_0xab8d('0x154')](db[_0xab8d('0x61')],{'as':'Website','foreignKey':_0xab8d('0x17d'),'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x65')][_0xab8d('0x154')](db[_0xab8d('0x178')],{'onDelete':_0xab8d('0x16c'),'foreignKey':'TagId'});db[_0xab8d('0x67')][_0xab8d('0x117')](db[_0xab8d('0x69')],{'as':_0xab8d('0x161'),'onDelete':_0xab8d('0x114'),'foreignKey':'ChatInteractionId'});db[_0xab8d('0x67')][_0xab8d('0x154')](db['ChatWebsite'],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x17d')});db[_0xab8d('0x67')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x67')][_0xab8d('0x154')](db['User'],{'as':_0xab8d('0x177'),'foreignKey':_0xab8d('0x115')});db[_0xab8d('0x67')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x194'),'as':'Tags'});db[_0xab8d('0x67')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x194'),'as':'ThroughTags'});db['ChatInteraction'][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x17a'),'through':_0xab8d('0x12e'),'foreignKey':_0xab8d('0x195')});db[_0xab8d('0x69')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x13')});db[_0xab8d('0x69')]['belongsTo'](db[_0xab8d('0x73')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x168'),'foreignKey':'ContactId'});db[_0xab8d('0x69')][_0xab8d('0x154')](db['ChatInteraction'],{'onDelete':_0xab8d('0x114'),'as':'Interaction','foreignKey':_0xab8d('0x195')});db[_0xab8d('0x69')][_0xab8d('0x154')](db[_0xab8d('0xee')],{'as':_0xab8d('0xee'),'foreignKey':_0xab8d('0x196')});db[_0xab8d('0x69')][_0xab8d('0x154')](db[_0xab8d('0x61')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x17d')});db[_0xab8d('0x6b')]['hasMany'](db['Attachment'],{'as':_0xab8d('0x17b'),'foreignKey':_0xab8d('0x17e'),'onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x6b')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x6b')][_0xab8d('0x154')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xab8d('0x17d')});db['ChatQueue']['belongsToMany'](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x31'),'hooks':!![]});db['ChatQueue'][_0xab8d('0x129')](db[_0xab8d('0xe7')],{'through':_0xab8d('0x197'),'as':_0xab8d('0x15e')});db[_0xab8d('0x6e')][_0xab8d('0x117')](db[_0xab8d('0xd4')],{'as':_0xab8d('0x161'),'foreignKey':_0xab8d('0x198'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x6e')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':'Members','through':_0xab8d('0x128')});db['ChatProactiveAction'][_0xab8d('0x154')](db[_0xab8d('0x61')],{'as':_0xab8d('0x199'),'foreignKey':_0xab8d('0x17d')});db['CmCompany'][_0xab8d('0x117')](db[_0xab8d('0x73')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xab8d('0x73')]['hasMany'](db[_0xab8d('0x19a')],{'as':_0xab8d('0x19b'),'foreignKey':'CmContactId'});db['CmContact']['hasMany'](db[_0xab8d('0x75')],{'as':_0xab8d('0x151'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x73')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xab8d('0x169')});db[_0xab8d('0x73')][_0xab8d('0x117')](db['CmHopperHistory'],{'as':_0xab8d('0x19c'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x73')]['hasMany'](db[_0xab8d('0x152')],{'as':_0xab8d('0x152'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x73')][_0xab8d('0x117')](db[_0xab8d('0xd9')],{'as':'JscriptySessions','foreignKey':_0xab8d('0x169')});db[_0xab8d('0x73')][_0xab8d('0x117')](db[_0xab8d('0x5b')],{'as':_0xab8d('0x11c'),'foreignKey':'ContactId','onDelete':_0xab8d('0x16c')});db[_0xab8d('0x73')]['hasMany'](db[_0xab8d('0x67')],{'as':'ChatInteractions','foreignKey':_0xab8d('0x169'),'onDelete':_0xab8d('0x16c')});db['CmContact'][_0xab8d('0x117')](db[_0xab8d('0x11e')],{'as':_0xab8d('0x11f'),'foreignKey':_0xab8d('0x169'),'onDelete':'restrict'});db[_0xab8d('0x73')][_0xab8d('0x117')](db[_0xab8d('0x4d')],{'as':'FaxInteractions','foreignKey':_0xab8d('0x169'),'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x73')][_0xab8d('0x117')](db[_0xab8d('0x40')],{'as':_0xab8d('0x121'),'foreignKey':_0xab8d('0x169'),'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x73')]['belongsTo'](db[_0xab8d('0x71')],{'as':_0xab8d('0x19d'),'foreignKey':'CompanyId'});db[_0xab8d('0x73')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':_0xab8d('0x172'),'foreignKey':_0xab8d('0x180'),'onDelete':'cascade'});db[_0xab8d('0x73')][_0xab8d('0x129')](db['User'],{'as':_0xab8d('0x17a'),'through':_0xab8d('0x12b')});db['CmContact']['belongsToMany'](db[_0xab8d('0x178')],{'as':_0xab8d('0x187'),'through':_0xab8d('0x19e')});db[_0xab8d('0x73')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':'cm_contact_has_tags','as':_0xab8d('0x188')});db['CmHopper']['hasMany'](db[_0xab8d('0x8f')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0xab8d('0x75')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0xab8d('0x75')][_0xab8d('0x154')](db['CmList'],{'as':_0xab8d('0x172'),'foreignKey':_0xab8d('0x180'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x75')]['belongsTo'](db[_0xab8d('0x13')],{'as':'Agent','foreignKey':_0xab8d('0x115')});db[_0xab8d('0x75')][_0xab8d('0x154')](db[_0xab8d('0x133')],{'as':_0xab8d('0x19f'),'foreignKey':_0xab8d('0x150'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x75')][_0xab8d('0x154')](db[_0xab8d('0xeb')],{'as':'Campaign','foreignKey':_0xab8d('0x1a0'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x75')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x177'),'foreignKey':_0xab8d('0x1a1')});db[_0xab8d('0x76')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x76')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':'List','foreignKey':_0xab8d('0x180'),'onDelete':_0xab8d('0x114')});db['CmHopperBlack'][_0xab8d('0x154')](db[_0xab8d('0x133')],{'as':_0xab8d('0x19f'),'foreignKey':'VoiceQueueId','onDelete':_0xab8d('0x114')});db[_0xab8d('0x76')]['belongsTo'](db[_0xab8d('0xeb')],{'as':'Campaign','foreignKey':_0xab8d('0x1a0'),'onDelete':'cascade'});db['Automation'][_0xab8d('0x117')](db['Condition'],{'as':{'plural':_0xab8d('0x1a2'),'singular':_0xab8d('0x1a3')},'foreignKey':_0xab8d('0x1a4'),'onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x7e')]['hasMany'](db[_0xab8d('0x81')],{'as':{'plural':_0xab8d('0x1a5'),'singular':_0xab8d('0x1a6')},'foreignKey':_0xab8d('0x1a7'),'onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x7e')][_0xab8d('0x117')](db[_0xab8d('0x7c')],{'as':_0xab8d('0x1a8'),'foreignKey':'AutomationId','onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x16f')]['hasMany'](db[_0xab8d('0x16f')],{'as':'Dispositions','foreignKey':_0xab8d('0x1a9'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0x83')][_0xab8d('0x117')](db[_0xab8d('0x83')],{'as':_0xab8d('0x1aa'),'foreignKey':_0xab8d('0x158'),'onDelete':_0xab8d('0x114'),'hooks':!![],'required':![]});db[_0xab8d('0x83')]['hasMany'](db[_0xab8d('0x1a')],{'as':_0xab8d('0x119'),'foreignKey':'IntervalId','onDelete':_0xab8d('0x16c')});db[_0xab8d('0x83')][_0xab8d('0x117')](db[_0xab8d('0x43')],{'as':_0xab8d('0x1ab'),'foreignKey':_0xab8d('0x158')});db['Interval'][_0xab8d('0x117')](db[_0xab8d('0x65')],{'as':_0xab8d('0x1ac'),'foreignKey':_0xab8d('0x158')});db[_0xab8d('0x83')]['hasMany'](db[_0xab8d('0x183')],{'as':_0xab8d('0x1ad'),'foreignKey':_0xab8d('0x158')});db[_0xab8d('0x83')]['hasMany'](db[_0xab8d('0x55')],{'as':'SmsApplications','foreignKey':_0xab8d('0x158')});db['Schedule'][_0xab8d('0x154')](db['MailAccount'],{});db[_0xab8d('0x1ae')][_0xab8d('0x154')](db[_0xab8d('0x9c')],{'foreignKey':_0xab8d('0x1af')});db['Schedule'][_0xab8d('0x154')](db[_0xab8d('0x9a')],{'foreignKey':_0xab8d('0x1b0')});db[_0xab8d('0x14f')][_0xab8d('0x129')](db[_0xab8d('0x1c')],{'as':_0xab8d('0x1b1'),'through':_0xab8d('0x1b2'),'onDelete':'restrict'});db[_0xab8d('0x178')][_0xab8d('0x129')](db[_0xab8d('0x73')],{'through':'cm_contact_has_tags'});db[_0xab8d('0x178')][_0xab8d('0x129')](db[_0xab8d('0x67')],{'through':'chat_interaction_has_tags'});db[_0xab8d('0x178')][_0xab8d('0x129')](db[_0xab8d('0x40')],{'through':_0xab8d('0x179')});db[_0xab8d('0x178')]['belongsToMany'](db['SmsInteraction'],{'through':_0xab8d('0x18c')});db[_0xab8d('0x178')][_0xab8d('0x129')](db[_0xab8d('0x4d')],{'through':'fax_interaction_has_tags'});db[_0xab8d('0x178')]['belongsToMany'](db[_0xab8d('0x5b')],{'through':_0xab8d('0x192')});db[_0xab8d('0x178')]['belongsToMany'](db[_0xab8d('0x122')],{'through':_0xab8d('0x1b3')});db['CmContactHasItem'][_0xab8d('0x154')](db[_0xab8d('0x8c')],{'as':_0xab8d('0x1b4'),'foreignKey':'ItemTypeId'});db[_0xab8d('0x8f')][_0xab8d('0x154')](db[_0xab8d('0x75')],{'as':_0xab8d('0x1b5'),'foreignKey':_0xab8d('0x1b6')});db['CmContactHasItem'][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x1b7')});db[_0xab8d('0x92')][_0xab8d('0x117')](db[_0xab8d('0x81')],{'as':{'plural':_0xab8d('0x1b8'),'singular':_0xab8d('0x1b9')},'foreignKey':_0xab8d('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0xab8d('0x92')]['hasMany'](db[_0xab8d('0x81')],{'as':{'plural':_0xab8d('0x1bb'),'singular':_0xab8d('0x1bc')},'foreignKey':_0xab8d('0x1bd'),'onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x92')][_0xab8d('0x117')](db['Action'],{'as':_0xab8d('0x1a8'),'foreignKey':_0xab8d('0x1be'),'onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x9a')][_0xab8d('0x117')](db[_0xab8d('0x1bf')],{'as':_0xab8d('0x1c0'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xab8d('0x9c')][_0xab8d('0x117')](db[_0xab8d('0x1bf')],{'as':_0xab8d('0x1c0'),'onDelete':_0xab8d('0x114'),'foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db[_0xab8d('0x1bf')],{'as':_0xab8d('0x1c0'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c1')});db[_0xab8d('0x1bf')]['belongsTo'](db[_0xab8d('0x1c2')],{'foreignKey':'MetricId'});db[_0xab8d('0x1c3')][_0xab8d('0x117')](db[_0xab8d('0xa3')],{'as':_0xab8d('0x1c4'),'onDelete':_0xab8d('0x114'),'foreignKey':'AccountId'});db[_0xab8d('0xa3')][_0xab8d('0x117')](db['SalesforceField'],{'as':_0xab8d('0x1c5'),'onDelete':'cascade','foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xa3')]['hasMany'](db[_0xab8d('0xa5')],{'as':_0xab8d('0x1c7'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c8')});db['SalesforceConfiguration'][_0xab8d('0x117')](db[_0xab8d('0xa5')],{'as':'Fields','onDelete':_0xab8d('0x114'),'foreignKey':'FieldId'});db['SalesforceConfiguration']['belongsTo'](db['SalesforceAccount'],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xa5')]['hasMany'](db[_0xab8d('0xa5')],{'as':_0xab8d('0x1ca'),'foreignKey':_0xab8d('0x1c6')});db['SalesforceField'][_0xab8d('0x117')](db['SalesforceField'],{'as':_0xab8d('0x1cb'),'foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xa5')][_0xab8d('0x117')](db[_0xab8d('0xa5')],{'as':_0xab8d('0x1cc'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xa5')][_0xab8d('0x154')](db['Variable'],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db[_0xab8d('0xa7')][_0xab8d('0x117')](db[_0xab8d('0xa8')],{'as':_0xab8d('0x1c4'),'onDelete':'cascade','foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xa8')][_0xab8d('0x117')](db[_0xab8d('0xaa')],{'as':'Subjects','onDelete':_0xab8d('0x114'),'foreignKey':'SubjectId'});db[_0xab8d('0xa8')][_0xab8d('0x117')](db[_0xab8d('0xaa')],{'as':'Descriptions','onDelete':_0xab8d('0x114'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xab8d('0x117')](db[_0xab8d('0xaa')],{'as':_0xab8d('0x1c0'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xa8')][_0xab8d('0x154')](db['SugarcrmAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xab8d('0xaa')][_0xab8d('0x117')](db[_0xab8d('0xaa')],{'as':_0xab8d('0x1ca'),'foreignKey':'SubjectId'});db[_0xab8d('0xaa')][_0xab8d('0x117')](db['SugarcrmField'],{'as':'Description','foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xaa')]['hasMany'](db[_0xab8d('0xaa')],{'as':_0xab8d('0x1cc'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xaa')][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db[_0xab8d('0xab')]['hasMany'](db[_0xab8d('0xad')],{'as':'Configurations','onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xad')][_0xab8d('0x117')](db[_0xab8d('0xaf')],{'as':_0xab8d('0x1c5'),'onDelete':'cascade','foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xad')][_0xab8d('0x117')](db[_0xab8d('0xaf')],{'as':'Descriptions','onDelete':_0xab8d('0x114'),'foreignKey':'DescriptionId'});db[_0xab8d('0xad')][_0xab8d('0x117')](db[_0xab8d('0xaf')],{'as':_0xab8d('0x1c0'),'onDelete':_0xab8d('0x114'),'foreignKey':'FieldId'});db[_0xab8d('0xad')]['belongsTo'](db['DeskAccount'],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xad')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x1cf')});db[_0xab8d('0xaf')]['hasMany'](db[_0xab8d('0xaf')],{'as':_0xab8d('0x1ca'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xaf')][_0xab8d('0x117')](db[_0xab8d('0xaf')],{'as':_0xab8d('0x1cb'),'foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xaf')][_0xab8d('0x117')](db[_0xab8d('0xaf')],{'as':_0xab8d('0x1cc'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xaf')][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db['ZohoAccount'][_0xab8d('0x117')](db['ZohoConfiguration'],{'as':_0xab8d('0x1c4'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xb2')][_0xab8d('0x117')](db[_0xab8d('0xb4')],{'as':_0xab8d('0x1c5'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xb2')][_0xab8d('0x117')](db[_0xab8d('0xb4')],{'as':'Descriptions','onDelete':_0xab8d('0x114'),'foreignKey':'DescriptionId'});db[_0xab8d('0xb2')]['hasMany'](db[_0xab8d('0xb4')],{'as':_0xab8d('0x1c0'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xb2')][_0xab8d('0x154')](db[_0xab8d('0xb0')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xb4')][_0xab8d('0x117')](db[_0xab8d('0xb4')],{'as':_0xab8d('0x1ca'),'foreignKey':_0xab8d('0x1c6')});db['ZohoField'][_0xab8d('0x117')](db['ZohoField'],{'as':_0xab8d('0x1cb'),'foreignKey':_0xab8d('0x1c8')});db['ZohoField'][_0xab8d('0x117')](db[_0xab8d('0xb4')],{'as':_0xab8d('0x1cc'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xb4')][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0xab8d('0xb6')][_0xab8d('0x117')](db[_0xab8d('0xb7')],{'as':'Configurations','onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xb7')]['hasMany'](db['ZendeskField'],{'as':_0xab8d('0x1c5'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xb7')][_0xab8d('0x117')](db['ZendeskField'],{'as':_0xab8d('0x1c7'),'foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xb7')]['hasMany'](db[_0xab8d('0xb9')],{'as':_0xab8d('0x1c0'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xb7')]['belongsTo'](db[_0xab8d('0xb6')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xb7')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x1d0')});db[_0xab8d('0xb9')][_0xab8d('0x117')](db[_0xab8d('0xb9')],{'as':_0xab8d('0x1ca'),'foreignKey':'SubjectId'});db[_0xab8d('0xb9')]['hasMany'](db['ZendeskField'],{'as':_0xab8d('0x1cb'),'foreignKey':_0xab8d('0x1c8')});db['ZendeskField'][_0xab8d('0x117')](db[_0xab8d('0xb9')],{'as':_0xab8d('0x1cc'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xb9')][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db[_0xab8d('0xbb')]['hasMany'](db[_0xab8d('0xbd')],{'as':_0xab8d('0x1c4'),'onDelete':_0xab8d('0x114'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xab8d('0x117')](db[_0xab8d('0xbf')],{'as':_0xab8d('0x1c5'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xbd')]['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xbd')]['hasMany'](db[_0xab8d('0xbf')],{'as':_0xab8d('0x1c0'),'onDelete':_0xab8d('0x114'),'foreignKey':'FieldId'});db[_0xab8d('0xbd')][_0xab8d('0x154')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xbd')][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x1d1')});db['FreshdeskField'][_0xab8d('0x117')](db[_0xab8d('0xbf')],{'as':_0xab8d('0x1ca'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xbf')][_0xab8d('0x117')](db['FreshdeskField'],{'as':'Description','foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xbf')][_0xab8d('0x117')](db['FreshdeskField'],{'as':'Field','foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xbf')][_0xab8d('0x154')](db['Variable'],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db['VtigerAccount'][_0xab8d('0x117')](db[_0xab8d('0x1d2')],{'as':_0xab8d('0x1c4'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0x1d2')][_0xab8d('0x117')](db[_0xab8d('0xc2')],{'as':_0xab8d('0x1c5'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0x1d2')]['hasMany'](db['VtigerField'],{'as':_0xab8d('0x1c7'),'foreignKey':'DescriptionId'});db[_0xab8d('0x1d2')][_0xab8d('0x117')](db[_0xab8d('0xc2')],{'as':'Fields','foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0x1d2')][_0xab8d('0x154')](db['VtigerAccount'],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x1c9')});db['VtigerField'][_0xab8d('0x117')](db[_0xab8d('0xc2')],{'as':'Subject','foreignKey':_0xab8d('0x1c6')});db['VtigerField']['hasMany'](db[_0xab8d('0xc2')],{'as':_0xab8d('0x1cb'),'foreignKey':_0xab8d('0x1c8')});db['VtigerField'][_0xab8d('0x117')](db[_0xab8d('0xc2')],{'as':'Field','foreignKey':_0xab8d('0x1cd')});db['VtigerField'][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db['ServicenowAccount'][_0xab8d('0x117')](db['ServicenowConfiguration'],{'as':_0xab8d('0x1c4'),'onDelete':_0xab8d('0x114'),'foreignKey':'AccountId'});db[_0xab8d('0xc5')][_0xab8d('0x117')](db[_0xab8d('0xc7')],{'as':_0xab8d('0x1c5'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xc5')][_0xab8d('0x117')](db[_0xab8d('0xc7')],{'as':'Descriptions','foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xc5')][_0xab8d('0x117')](db['ServicenowField'],{'as':_0xab8d('0x1c0'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xc5')][_0xab8d('0x154')](db[_0xab8d('0xc3')],{'as':_0xab8d('0x176'),'foreignKey':'AccountId'});db[_0xab8d('0xc7')][_0xab8d('0x117')](db[_0xab8d('0xc7')],{'as':_0xab8d('0x1ca'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xc7')][_0xab8d('0x117')](db[_0xab8d('0xc7')],{'as':_0xab8d('0x1cb'),'foreignKey':'DescriptionId'});db[_0xab8d('0xc7')][_0xab8d('0x117')](db['ServicenowField'],{'as':_0xab8d('0x1cc'),'foreignKey':'FieldId'});db['ServicenowField'][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db['Dynamics365Account'][_0xab8d('0x117')](db[_0xab8d('0x1d3')],{'as':_0xab8d('0x1c4'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xc8')][_0xab8d('0x154')](db[_0xab8d('0x109')],{'as':_0xab8d('0x109'),'foreignKey':_0xab8d('0x16b')});db[_0xab8d('0x1d3')][_0xab8d('0x117')](db['Dynamics365Field'],{'as':_0xab8d('0x1c5'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1c6')});db['Dynamics365Configuration'][_0xab8d('0x117')](db['Dynamics365Field'],{'as':_0xab8d('0x1c7'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xab8d('0x1d3')][_0xab8d('0x117')](db[_0xab8d('0xca')],{'as':_0xab8d('0x1c0'),'onDelete':'cascade','foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0x1d3')]['belongsTo'](db[_0xab8d('0xc8')],{'as':'Account','foreignKey':_0xab8d('0x1c9')});db[_0xab8d('0xca')][_0xab8d('0x117')](db[_0xab8d('0xca')],{'as':'Subject','foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xca')][_0xab8d('0x117')](db[_0xab8d('0xca')],{'as':_0xab8d('0x1cb'),'foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xca')][_0xab8d('0x117')](db[_0xab8d('0xca')],{'as':_0xab8d('0x1cc'),'foreignKey':'FieldId'});db[_0xab8d('0xca')][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db[_0xab8d('0xcc')][_0xab8d('0x117')](db[_0xab8d('0xcd')],{'as':_0xab8d('0x1c4'),'onDelete':_0xab8d('0x114'),'foreignKey':'AccountId'});db[_0xab8d('0xcd')][_0xab8d('0x117')](db['FreshsalesField'],{'as':_0xab8d('0x1c5'),'foreignKey':_0xab8d('0x1c6')});db[_0xab8d('0xcd')][_0xab8d('0x117')](db[_0xab8d('0xce')],{'as':_0xab8d('0x1c7'),'foreignKey':'DescriptionId'});db[_0xab8d('0xcd')][_0xab8d('0x117')](db['FreshsalesField'],{'as':_0xab8d('0x1c0'),'foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xcd')][_0xab8d('0x154')](db[_0xab8d('0xcc')],{'as':'Account','foreignKey':'AccountId'});db[_0xab8d('0xce')][_0xab8d('0x117')](db[_0xab8d('0xce')],{'as':_0xab8d('0x1ca'),'foreignKey':_0xab8d('0x1c6')});db['FreshsalesField'][_0xab8d('0x117')](db['FreshsalesField'],{'as':_0xab8d('0x1cb'),'foreignKey':_0xab8d('0x1c8')});db[_0xab8d('0xce')]['hasMany'](db[_0xab8d('0xce')],{'as':'Field','foreignKey':_0xab8d('0x1cd')});db[_0xab8d('0xce')][_0xab8d('0x154')](db[_0xab8d('0x94')],{'as':_0xab8d('0x94'),'foreignKey':_0xab8d('0x1ce')});db[_0xab8d('0xd2')][_0xab8d('0x154')](db[_0xab8d('0x61')],{});db[_0xab8d('0xd2')][_0xab8d('0x154')](db['CmList'],{'as':'List','foreignKey':_0xab8d('0x180')});db[_0xab8d('0xd2')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0xd2')]['belongsTo'](db['ChatInteraction'],{});db['ChatQueueReport']['belongsTo'](db[_0xab8d('0x69')],{});db[_0xab8d('0xd2')][_0xab8d('0x154')](db[_0xab8d('0x13')],{});db[_0xab8d('0xd2')]['belongsTo'](db['ChatQueue'],{});db[_0xab8d('0xd4')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1d4')});db[_0xab8d('0xd4')]['belongsTo'](db['User'],{'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x1d5')});db['JscriptySessionReport'][_0xab8d('0x117')](db[_0xab8d('0xd7')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xab8d('0xd9')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xab8d('0x1d6'),'onDelete':'cascade'});db[_0xab8d('0xdb')][_0xab8d('0x154')](db[_0xab8d('0x53')],{});db['SmsQueueReport'][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':'List','foreignKey':_0xab8d('0x180')});db['SmsQueueReport']['belongsTo'](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db['SmsQueueReport']['belongsTo'](db[_0xab8d('0x11e')],{});db[_0xab8d('0xdb')]['belongsTo'](db['SmsMessage'],{});db[_0xab8d('0xdb')][_0xab8d('0x154')](db[_0xab8d('0x13')],{});db['SmsQueueReport'][_0xab8d('0x154')](db['SmsQueue'],{});db[_0xab8d('0xdf')][_0xab8d('0x117')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0xab8d('0xdf')]['hasMany'](db[_0xab8d('0xd7')],{'foreignKey':_0xab8d('0x1d7')});db[_0xab8d('0xdf')]['hasMany'](db[_0xab8d('0xd6')],{'foreignKey':_0xab8d('0x1d7')});db[_0xab8d('0xe3')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':'Users','through':_0xab8d('0x14b')});db['Team']['belongsToMany'](db['User'],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x12c')});db[_0xab8d('0xe7')][_0xab8d('0x129')](db[_0xab8d('0x133')],{'through':_0xab8d('0x10a'),'as':_0xab8d('0x134')});db[_0xab8d('0xe7')][_0xab8d('0x129')](db[_0xab8d('0x173')],{'through':_0xab8d('0x174'),'as':_0xab8d('0x1d8')});db[_0xab8d('0xe7')][_0xab8d('0x129')](db[_0xab8d('0x6d')],{'through':_0xab8d('0x197'),'as':'ChatQueues'});db[_0xab8d('0xe7')]['belongsToMany'](db[_0xab8d('0x50')],{'through':'team_has_fax_queues','as':_0xab8d('0x137')});db[_0xab8d('0xe7')][_0xab8d('0x129')](db[_0xab8d('0x138')],{'through':_0xab8d('0x1d9'),'as':_0xab8d('0x1da')});db['Team'][_0xab8d('0x129')](db[_0xab8d('0x5f')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xab8d('0xe7')]['belongsToMany'](db['WhatsappQueue'],{'through':_0xab8d('0x1db'),'as':_0xab8d('0x13b')});db[_0xab8d('0xe7')][_0xab8d('0x129')](db[_0xab8d('0xf8')],{'through':_0xab8d('0x10c'),'as':_0xab8d('0x1dc')});db[_0xab8d('0xeb')][_0xab8d('0x117')](db[_0xab8d('0x75')],{'as':'Hoppers','foreignKey':_0xab8d('0x1a0')});db[_0xab8d('0xeb')][_0xab8d('0x117')](db[_0xab8d('0x11a')],{'as':'HopperFinals','foreignKey':_0xab8d('0x1a0')});db[_0xab8d('0xeb')][_0xab8d('0x117')](db[_0xab8d('0x78')],{'as':_0xab8d('0x19c'),'foreignKey':_0xab8d('0x1a0')});db[_0xab8d('0xeb')][_0xab8d('0x117')](db[_0xab8d('0x76')],{'as':_0xab8d('0x1dd'),'foreignKey':_0xab8d('0x1a0')});db['Campaign'][_0xab8d('0x154')](db[_0xab8d('0x29')],{'as':_0xab8d('0x29'),'foreignKey':_0xab8d('0x155')});db[_0xab8d('0xeb')][_0xab8d('0x154')](db['Trunk'],{'as':_0xab8d('0x156'),'foreignKey':_0xab8d('0x157')});db[_0xab8d('0xeb')]['belongsTo'](db[_0xab8d('0x83')],{'as':'Interval','foreignKey':_0xab8d('0x158')});db[_0xab8d('0xeb')]['belongsTo'](db[_0xab8d('0xe3')],{'as':_0xab8d('0xe3'),'foreignKey':_0xab8d('0x1de')});db[_0xab8d('0xeb')][_0xab8d('0x129')](db[_0xab8d('0xf7')],{'as':_0xab8d('0x15b'),'through':_0xab8d('0x1df')});db[_0xab8d('0xeb')][_0xab8d('0x129')](db['CmList'],{'as':_0xab8d('0x15f'),'through':_0xab8d('0x1e0')});db['Attachment'][_0xab8d('0x154')](db[_0xab8d('0x6b')],{'as':_0xab8d('0x6b'),'foreignKey':_0xab8d('0x17e')});db['MailTransferReport']['belongsTo'](db['MailMessage'],{});db['MailTransferReport'][_0xab8d('0x154')](db[_0xab8d('0x40')],{});db[_0xab8d('0x1e1')]['belongsTo'](db[_0xab8d('0x141')],{'foreignKey':_0xab8d('0x1e2'),'as':_0xab8d('0x1e3')});db['MailTransferReport'][_0xab8d('0x154')](db[_0xab8d('0x13')],{'foreignKey':_0xab8d('0x1e4'),'as':_0xab8d('0x1e5')});db[_0xab8d('0x1e1')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'foreignKey':'ToUserId','as':_0xab8d('0x1e6')});db[_0xab8d('0x1e1')]['belongsTo'](db[_0xab8d('0x173')],{'foreignKey':'ToMailQueueId','as':_0xab8d('0x1e7')});db[_0xab8d('0x1e1')][_0xab8d('0x154')](db[_0xab8d('0x141')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xab8d('0xf1')][_0xab8d('0x154')](db[_0xab8d('0x69')],{});db[_0xab8d('0xf1')][_0xab8d('0x154')](db[_0xab8d('0x67')],{});db[_0xab8d('0xf1')][_0xab8d('0x154')](db['ChatWebsite'],{'foreignKey':_0xab8d('0x1e8'),'as':_0xab8d('0x1e3')});db['ChatTransferReport']['belongsTo'](db[_0xab8d('0x13')],{'foreignKey':_0xab8d('0x1e4'),'as':_0xab8d('0x1e5')});db['ChatTransferReport'][_0xab8d('0x154')](db[_0xab8d('0x13')],{'foreignKey':_0xab8d('0x1e9'),'as':'ToAgent'});db[_0xab8d('0xf1')][_0xab8d('0x154')](db[_0xab8d('0x6d')],{'foreignKey':_0xab8d('0x1ea'),'as':_0xab8d('0x1e7')});db['ChatTransferReport'][_0xab8d('0x154')](db[_0xab8d('0x61')],{'foreignKey':_0xab8d('0x1eb'),'as':_0xab8d('0x1ec')});db[_0xab8d('0xf3')][_0xab8d('0x154')](db[_0xab8d('0x4f')],{});db[_0xab8d('0xf3')][_0xab8d('0x154')](db[_0xab8d('0x4d')],{});db[_0xab8d('0xf3')][_0xab8d('0x154')](db[_0xab8d('0x4a')],{'foreignKey':'FromFaxAccountId','as':_0xab8d('0x1e3')});db['FaxTransferReport'][_0xab8d('0x154')](db['User'],{'foreignKey':_0xab8d('0x1e4'),'as':_0xab8d('0x1e5')});db[_0xab8d('0xf3')][_0xab8d('0x154')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xab8d('0xf3')][_0xab8d('0x154')](db[_0xab8d('0x50')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0xab8d('0xf3')][_0xab8d('0x154')](db[_0xab8d('0x4a')],{'foreignKey':_0xab8d('0x1ed'),'as':_0xab8d('0x1ec')});db[_0xab8d('0x1ee')][_0xab8d('0x154')](db['OpenchannelMessage'],{});db[_0xab8d('0x1ee')][_0xab8d('0x154')](db['OpenchannelInteraction'],{});db[_0xab8d('0x1ee')][_0xab8d('0x154')](db[_0xab8d('0x58')],{'foreignKey':'FromOpenchannelAccountId','as':_0xab8d('0x1e3')});db[_0xab8d('0x1ee')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'foreignKey':_0xab8d('0x1e4'),'as':'FromAgent'});db[_0xab8d('0x1ee')]['belongsTo'](db['User'],{'foreignKey':_0xab8d('0x1e9'),'as':_0xab8d('0x1e6')});db[_0xab8d('0x1ee')]['belongsTo'](db[_0xab8d('0x5f')],{'foreignKey':'ToOpenchannelQueueId','as':_0xab8d('0x1e7')});db[_0xab8d('0x1ee')][_0xab8d('0x154')](db[_0xab8d('0x58')],{'foreignKey':_0xab8d('0x1ef'),'as':_0xab8d('0x1ec')});db['SmsTransferReport'][_0xab8d('0x154')](db[_0xab8d('0x18b')],{});db[_0xab8d('0x1f0')][_0xab8d('0x154')](db[_0xab8d('0x11e')],{});db[_0xab8d('0x1f0')]['belongsTo'](db[_0xab8d('0x53')],{'foreignKey':_0xab8d('0x1f1'),'as':'FromAccount'});db[_0xab8d('0x1f0')][_0xab8d('0x154')](db['User'],{'foreignKey':_0xab8d('0x1e4'),'as':_0xab8d('0x1e5')});db['SmsTransferReport'][_0xab8d('0x154')](db[_0xab8d('0x13')],{'foreignKey':_0xab8d('0x1e9'),'as':_0xab8d('0x1e6')});db[_0xab8d('0x1f0')][_0xab8d('0x154')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0xab8d('0x1e7')});db[_0xab8d('0x1f0')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xab8d('0x1f2'),'as':_0xab8d('0x1ec')});db['CmList']['hasMany'](db['Disposition'],{'as':_0xab8d('0x181'),'foreignKey':_0xab8d('0x180'),'onDelete':'cascade'});db[_0xab8d('0xf7')][_0xab8d('0x117')](db['CmCustomField'],{'as':_0xab8d('0x1f3'),'foreignKey':_0xab8d('0x180')});db['CmList'][_0xab8d('0x117')](db[_0xab8d('0x73')],{'as':_0xab8d('0x12a'),'onDelete':_0xab8d('0x114'),'foreignKey':_0xab8d('0x180')});db[_0xab8d('0xf7')]['hasMany'](db[_0xab8d('0x11a')],{'as':_0xab8d('0x11b'),'foreignKey':_0xab8d('0x180')});db[_0xab8d('0xf7')][_0xab8d('0x117')](db[_0xab8d('0x78')],{'as':_0xab8d('0x1f4'),'foreignKey':'ListId'});db[_0xab8d('0xf7')][_0xab8d('0x117')](db[_0xab8d('0x152')],{'as':_0xab8d('0x152'),'foreignKey':_0xab8d('0x180')});db[_0xab8d('0xf7')][_0xab8d('0x129')](db[_0xab8d('0x133')],{'as':_0xab8d('0x1f5'),'through':_0xab8d('0x15c')});db[_0xab8d('0xf7')]['belongsToMany'](db['User'],{'as':_0xab8d('0x15d'),'through':'cm_user_has_lists'});db[_0xab8d('0xf8')][_0xab8d('0x117')](db[_0xab8d('0x1a')],{'as':'Extensions','onDelete':_0xab8d('0x114')});db[_0xab8d('0xf8')]['belongsToMany'](db['User'],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x10e')});db[_0xab8d('0xf8')][_0xab8d('0x129')](db['Team'],{'through':_0xab8d('0x10c'),'as':_0xab8d('0x15e')});db[_0xab8d('0xf9')][_0xab8d('0x117')](db[_0xab8d('0x13')],{'as':_0xab8d('0x17a'),'foreignKey':_0xab8d('0x126')});db['UserProfile'][_0xab8d('0x117')](db[_0xab8d('0xfa')],{'as':_0xab8d('0x1f6'),'foreignKey':_0xab8d('0x126'),'onDelete':_0xab8d('0x114')});db['UserProfileSection'][_0xab8d('0x117')](db['UserProfileResource'],{'as':_0xab8d('0x1f7'),'foreignKey':_0xab8d('0x1f8'),'onDelete':_0xab8d('0x114')});db[_0xab8d('0xff')][_0xab8d('0x117')](db[_0xab8d('0x16f')],{'as':_0xab8d('0x181'),'foreignKey':_0xab8d('0x1f9'),'onDelete':_0xab8d('0x114')});db['WhatsappAccount']['hasMany'](db[_0xab8d('0x7f')],{'as':'Answers','foreignKey':_0xab8d('0x1f9')});db[_0xab8d('0xff')]['hasMany'](db[_0xab8d('0x103')],{'as':'Messages','foreignKey':_0xab8d('0x1f9')});db[_0xab8d('0xff')][_0xab8d('0x117')](db[_0xab8d('0x122')],{'as':_0xab8d('0x171')});db[_0xab8d('0xff')][_0xab8d('0x117')](db[_0xab8d('0x101')],{'as':_0xab8d('0x14e')});db[_0xab8d('0xff')][_0xab8d('0x154')](db[_0xab8d('0xf7')],{'as':'List','foreignKey':_0xab8d('0x180')});db[_0xab8d('0xff')]['belongsTo'](db[_0xab8d('0x85')],{'as':_0xab8d('0x159'),'foreignKey':_0xab8d('0x15a')});db[_0xab8d('0xff')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':_0xab8d('0x149')});db[_0xab8d('0x101')][_0xab8d('0x154')](db['User'],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x101')][_0xab8d('0x154')](db['WhatsappQueue'],{'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x101')][_0xab8d('0x154')](db[_0xab8d('0xff')],{'onDelete':_0xab8d('0x16c')});db['WhatsappApplication'][_0xab8d('0x154')](db[_0xab8d('0x83')],{'onDelete':_0xab8d('0x16c'),'foreignKey':_0xab8d('0x158')});db['WhatsappApplication']['belongsTo'](db[_0xab8d('0x178')],{'onDelete':_0xab8d('0x16c'),'foreignKey':_0xab8d('0x17f')});db['WhatsappInteraction'][_0xab8d('0x117')](db[_0xab8d('0x103')],{'as':_0xab8d('0x161'),'onDelete':_0xab8d('0x114'),'foreignKey':'WhatsappInteractionId'});db[_0xab8d('0x122')][_0xab8d('0x154')](db[_0xab8d('0xff')],{'as':_0xab8d('0x176'),'foreignKey':_0xab8d('0x1f9')});db[_0xab8d('0x122')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x122')]['belongsTo'](db['User'],{'as':_0xab8d('0x177'),'foreignKey':_0xab8d('0x115')});db['WhatsappInteraction'][_0xab8d('0x129')](db[_0xab8d('0x178')],{'through':_0xab8d('0x1b3'),'as':_0xab8d('0x187')});db[_0xab8d('0x122')][_0xab8d('0x129')](db['Tag'],{'through':_0xab8d('0x1b3'),'as':'ThroughTags'});db[_0xab8d('0x122')][_0xab8d('0x129')](db['User'],{'as':_0xab8d('0x17a'),'through':'user_has_whatsapp_interactions','foreignKey':_0xab8d('0x1fa')});db['WhatsappMessage'][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':'User'});db['WhatsappMessage'][_0xab8d('0x154')](db[_0xab8d('0x73')],{'onDelete':_0xab8d('0x114'),'as':_0xab8d('0x168')});db['WhatsappMessage'][_0xab8d('0x154')](db[_0xab8d('0x122')],{'onDelete':'cascade','as':_0xab8d('0x17c'),'foreignKey':_0xab8d('0x1fa')});db[_0xab8d('0x103')][_0xab8d('0x154')](db[_0xab8d('0xff')],{'as':'Account','foreignKey':_0xab8d('0x1f9')});db['WhatsappQueueReport'][_0xab8d('0x154')](db['WhatsappAccount'],{});db[_0xab8d('0x105')]['belongsTo'](db[_0xab8d('0xf7')],{'as':_0xab8d('0x172'),'foreignKey':_0xab8d('0x180')});db[_0xab8d('0x105')][_0xab8d('0x154')](db[_0xab8d('0x73')],{'as':_0xab8d('0x168'),'foreignKey':_0xab8d('0x169')});db[_0xab8d('0x105')][_0xab8d('0x154')](db[_0xab8d('0x122')],{});db[_0xab8d('0x105')][_0xab8d('0x154')](db[_0xab8d('0x13a')],{});db['WhatsappQueueReport'][_0xab8d('0x154')](db['WhatsappMessage'],{});db[_0xab8d('0x105')][_0xab8d('0x154')](db[_0xab8d('0x13')],{});db[_0xab8d('0x106')][_0xab8d('0x154')](db[_0xab8d('0x103')],{});db[_0xab8d('0x106')][_0xab8d('0x154')](db[_0xab8d('0x122')],{});db['WhatsappTransferReport'][_0xab8d('0x154')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xab8d('0x1e3')});db[_0xab8d('0x106')][_0xab8d('0x154')](db[_0xab8d('0xff')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0xab8d('0x106')][_0xab8d('0x154')](db[_0xab8d('0x13a')],{'foreignKey':_0xab8d('0x1fb'),'as':_0xab8d('0x1e7')});db[_0xab8d('0x106')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'foreignKey':_0xab8d('0x1e4'),'as':_0xab8d('0x1e5')});db[_0xab8d('0x106')][_0xab8d('0x154')](db['User'],{'foreignKey':'ToUserId','as':_0xab8d('0x1e6')});db[_0xab8d('0x13a')][_0xab8d('0x129')](db[_0xab8d('0x13')],{'as':_0xab8d('0x15d'),'through':'UserWhatsappQueue','foreignKey':_0xab8d('0x1fc')});db[_0xab8d('0x13a')][_0xab8d('0x129')](db[_0xab8d('0xe7')],{'through':'team_has_whatsapp_queues','as':_0xab8d('0x15e')});db[_0xab8d('0x110')][_0xab8d('0x154')](db[_0xab8d('0x13')],{'as':_0xab8d('0x1fd'),'foreignKey':_0xab8d('0x115'),'onDelete':_0xab8d('0x114'),'hooks':!![]});db[_0xab8d('0x109')][_0xab8d('0x112')](db['Dynamics365Account'],{'as':_0xab8d('0xc8'),'onDelete':'restrict'});db['CloudProvider'][_0xab8d('0x112')](db[_0xab8d('0x39')],{'as':_0xab8d('0x16d'),'onDelete':_0xab8d('0x16c')});db[_0xab8d('0x109')][_0xab8d('0x112')](db[_0xab8d('0x3b')],{'as':'Smtp','onDelete':_0xab8d('0x16c')});module[_0xab8d('0x1fe')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 868a920..d8b60f8 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e99=['./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/user-settings','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','static','join','root','/apidoc','/demo','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','path','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','/api/users','./api/voiceChanSpy','/api/voice/extensions','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./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/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/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/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts'];(function(_0x25125d,_0x583715){var _0x29f9e0=function(_0x4c9189){while(--_0x4c9189){_0x25125d['push'](_0x25125d['shift']());}};_0x29f9e0(++_0x583715);}(_0x7e99,0x18e));var _0x97e9=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0x7e99[_0x4207f4];return _0x29a621;};'use strict';var path=require(_0x97e9('0x0'));var express=require('express');var errors=require(_0x97e9('0x1'));var config=require('./config/environment');var setupLoggers=require(_0x97e9('0x2'))[_0x97e9('0x3')];var clientSideLogs=require(_0x97e9('0x4'));exports[_0x97e9('0x5')]=function(_0x19349d){return setupLoggers(_0x19349d)['then'](function(){_0x19349d[_0x97e9('0x6')](_0x97e9('0x7'),require('./api/user'));_0x19349d[_0x97e9('0x6')]('/api/voice/chanspy',require(_0x97e9('0x8')));_0x19349d[_0x97e9('0x6')]('/api/voice/contexts',require('./api/voiceContext'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x9'),require('./api/voiceExtension'));_0x19349d['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xa'),require('./api/voiceQueue'));_0x19349d['use'](_0x97e9('0xb'),require('./api/voiceRecording'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xc'),require(_0x97e9('0xd')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xe'),require(_0x97e9('0xf')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x10'),require(_0x97e9('0x11')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x12'),require(_0x97e9('0x13')));_0x19349d['use'](_0x97e9('0x14'),require(_0x97e9('0x15')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x16'),require(_0x97e9('0x17')));_0x19349d[_0x97e9('0x6')]('/api/voice/queues/reports',require(_0x97e9('0x18')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x19'),require(_0x97e9('0x1a')));_0x19349d['use']('/api/trunks',require(_0x97e9('0x1b')));_0x19349d[_0x97e9('0x6')]('/api/voice/transfers/reports',require(_0x97e9('0x1c')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x1d'),require('./api/mailServerOut'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x1e'),require('./api/mailAccount'));_0x19349d[_0x97e9('0x6')]('/api/mail/queues',require(_0x97e9('0x1f')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x20'),require(_0x97e9('0x21')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x22'),require(_0x97e9('0x23')));_0x19349d['use'](_0x97e9('0x24'),require('./api/mailMessage'));_0x19349d[_0x97e9('0x6')]('/api/mail/applications',require(_0x97e9('0x25')));_0x19349d['use'](_0x97e9('0x26'),require('./api/mailQueueReport'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x27'),require(_0x97e9('0x28')));_0x19349d['use'](_0x97e9('0x29'),require(_0x97e9('0x2a')));_0x19349d[_0x97e9('0x6')]('/api/fax/accounts',require(_0x97e9('0x2b')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x2c'),require(_0x97e9('0x2d')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x2e'),require(_0x97e9('0x2f')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x30'),require(_0x97e9('0x31')));_0x19349d[_0x97e9('0x6')]('/api/fax/queues',require('./api/faxQueue'));_0x19349d[_0x97e9('0x6')]('/api/fax/reports/queue',require(_0x97e9('0x32')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x33'),require(_0x97e9('0x34')));_0x19349d['use'](_0x97e9('0x35'),require(_0x97e9('0x36')));_0x19349d[_0x97e9('0x6')]('/api/sms/interactions',require('./api/smsInteraction'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x37'),require(_0x97e9('0x38')));_0x19349d[_0x97e9('0x6')]('/api/sms/queues',require(_0x97e9('0x39')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x3a'),require('./api/openchannelAccount'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x3b'),require(_0x97e9('0x3c')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x3d'),require(_0x97e9('0x3e')));_0x19349d['use']('/api/openchannel/messages',require(_0x97e9('0x3f')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x40'),require(_0x97e9('0x41')));_0x19349d[_0x97e9('0x6')]('/api/chat/websites',require('./api/chatWebsite'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x42'),require(_0x97e9('0x43')));_0x19349d[_0x97e9('0x6')]('/api/chat/applications',require(_0x97e9('0x44')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x45'),require('./api/chatInteraction'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x46'),require(_0x97e9('0x47')));_0x19349d['use'](_0x97e9('0x48'),require(_0x97e9('0x49')));_0x19349d[_0x97e9('0x6')]('/api/chat/queues',require('./api/chatQueue'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x4a'),require(_0x97e9('0x4b')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x4c'),require(_0x97e9('0x4d')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x4e'),require(_0x97e9('0x4f')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x50'),require(_0x97e9('0x51')));_0x19349d['use'](_0x97e9('0x52'),require(_0x97e9('0x53')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x54'),require(_0x97e9('0x55')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x56'),require(_0x97e9('0x57')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x58'),require(_0x97e9('0x59')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x5a'),require(_0x97e9('0x5b')));_0x19349d['use'](_0x97e9('0x5c'),require(_0x97e9('0x5d')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x5e'),require('./api/automation'));_0x19349d['use'](_0x97e9('0x5f'),require(_0x97e9('0x60')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x61'),require(_0x97e9('0x62')));_0x19349d['use'](_0x97e9('0x63'),require('./api/condition'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x64'),require(_0x97e9('0x65')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x66'),require(_0x97e9('0x67')));_0x19349d['use'](_0x97e9('0x68'),require(_0x97e9('0x69')));_0x19349d['use'](_0x97e9('0x6a'),require(_0x97e9('0x6b')));_0x19349d[_0x97e9('0x6')]('/api/schedules',require('./api/schedule'));_0x19349d['use']('/api/sounds',require('./api/sound'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x6c'),require(_0x97e9('0x6d')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x6e'),require(_0x97e9('0x6f')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x70'),require('./api/cmContactHasItem'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x71'),require(_0x97e9('0x72')));_0x19349d['use']('/api/templates',require(_0x97e9('0x73')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x74'),require(_0x97e9('0x75')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x76'),require(_0x97e9('0x77')));_0x19349d[_0x97e9('0x6')]('/api/integrations',require('./api/integration'));_0x19349d['use'](_0x97e9('0x78'),require('./api/integrationReport'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x79'),require(_0x97e9('0x7a')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x7b'),require(_0x97e9('0x7c')));_0x19349d[_0x97e9('0x6')]('/api/analytics/extracted_reports',require(_0x97e9('0x7d')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x7e'),require(_0x97e9('0x7f')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x80'),require(_0x97e9('0x81')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x82'),require('./api/analyticTreeReport'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x83'),require(_0x97e9('0x84')));_0x19349d['use'](_0x97e9('0x85'),require(_0x97e9('0x86')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x87'),require(_0x97e9('0x88')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x89'),require('./api/intSugarcrmAccount'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x8a'),require(_0x97e9('0x8b')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x8c'),require(_0x97e9('0x8d')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x8e'),require(_0x97e9('0x8f')));_0x19349d['use'](_0x97e9('0x90'),require(_0x97e9('0x91')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x92'),require(_0x97e9('0x93')));_0x19349d['use'](_0x97e9('0x94'),require('./api/intZohoAccount'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x95'),require(_0x97e9('0x96')));_0x19349d['use'](_0x97e9('0x97'),require(_0x97e9('0x98')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x99'),require(_0x97e9('0x9a')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x9b'),require('./api/intZendeskConfiguration'));_0x19349d['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x19349d[_0x97e9('0x6')](_0x97e9('0x9c'),require(_0x97e9('0x9d')));_0x19349d['use'](_0x97e9('0x9e'),require(_0x97e9('0x9f')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xa0'),require('./api/intFreshdeskField'));_0x19349d['use'](_0x97e9('0xa1'),require(_0x97e9('0xa2')));_0x19349d[_0x97e9('0x6')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x19349d['use'](_0x97e9('0xa3'),require(_0x97e9('0xa4')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xa5'),require(_0x97e9('0xa6')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xa7'),require(_0x97e9('0xa8')));_0x19349d[_0x97e9('0x6')]('/api/integrations/servicenow/fields',require(_0x97e9('0xa9')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xaa'),require(_0x97e9('0xab')));_0x19349d['use']('/api/integrations/dynamics365/configurations',require(_0x97e9('0xac')));_0x19349d[_0x97e9('0x6')]('/api/integrations/dynamics365/fields',require(_0x97e9('0xad')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xae'),require('./api/intFreshsalesAccount'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xaf'),require(_0x97e9('0xb0')));_0x19349d[_0x97e9('0x6')]('/api/integrations/freshsales/fields',require(_0x97e9('0xb1')));_0x19349d[_0x97e9('0x6')]('/api/networks',require(_0x97e9('0xb2')));_0x19349d['use'](_0x97e9('0xb3'),require(_0x97e9('0xb4')));_0x19349d['use']('/api/chat/internal/messages',require(_0x97e9('0xb5')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xb6'),require(_0x97e9('0xb7')));_0x19349d['use'](_0x97e9('0xb8'),require('./api/jscriptyQuestionReport'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xb9'),require(_0x97e9('0xba')));_0x19349d[_0x97e9('0x6')]('/api/sms/reports/queue',require(_0x97e9('0xbb')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xbc'),require(_0x97e9('0xbd')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xbe'),require(_0x97e9('0xbf')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xc0'),require(_0x97e9('0xc1')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xc2'),require(_0x97e9('0xc3')));_0x19349d['use'](_0x97e9('0xc4'),require(_0x97e9('0xc5')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xc6'),require(_0x97e9('0xc7')));_0x19349d['use'](_0x97e9('0xc8'),require('./api/squareRecording'));_0x19349d['use'](_0x97e9('0xc9'),require(_0x97e9('0xca')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xcb'),require('./api/team'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xcc'),require(_0x97e9('0xcd')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xce'),require('./api/campaign'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xcf'),require(_0x97e9('0xd0')));_0x19349d['use'](_0x97e9('0xd1'),require(_0x97e9('0xd2')));_0x19349d['use'](_0x97e9('0xd3'),require(_0x97e9('0xd4')));_0x19349d['use'](_0x97e9('0xd5'),require(_0x97e9('0xd6')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xd7'),require(_0x97e9('0xd8')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xd9'),require(_0x97e9('0xda')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xdb'),require(_0x97e9('0xdc')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xdd'),require('./api/smsTransferReport'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xde'),require('./api/cmList'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xdf'),require(_0x97e9('0xe0')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xe1'),require(_0x97e9('0xe2')));_0x19349d[_0x97e9('0x6')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x19349d['use'](_0x97e9('0xe3'),require('./api/userProfileResource'));_0x19349d[_0x97e9('0x6')]('/api/userNotifications',require(_0x97e9('0xe4')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xe5'),require('./api/whatsappAccount'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xe6'),require(_0x97e9('0xe7')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xe8'),require(_0x97e9('0xe9')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xea'),require(_0x97e9('0xeb')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xec'),require(_0x97e9('0xed')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xee'),require(_0x97e9('0xef')));_0x19349d['use'](_0x97e9('0xf0'),require(_0x97e9('0xf1')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xf2'),require(_0x97e9('0xf3')));_0x19349d[_0x97e9('0x6')]('/api/realtime',require('./api/realtime'));_0x19349d['use'](_0x97e9('0xf4'),require('./api/user-setting'));_0x19349d[_0x97e9('0x6')]('/api/auth/local',require(_0x97e9('0xf5')));_0x19349d['use'](_0x97e9('0xf6'),require('./api/authGoogle'));_0x19349d[_0x97e9('0x6')](_0x97e9('0xf7'),require(_0x97e9('0xf8')));_0x19349d[_0x97e9('0x6')]('/api/jira',require(_0x97e9('0xf9')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xfa'),require(_0x97e9('0xfb')));_0x19349d['use'](_0x97e9('0xfc'),require(_0x97e9('0xfd')));_0x19349d[_0x97e9('0x6')](_0x97e9('0xfe'),require(_0x97e9('0xff')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x100'),require(_0x97e9('0x101')));_0x19349d[_0x97e9('0x6')]('/api/webbar',require(_0x97e9('0x102')));_0x19349d['use'](_0x97e9('0x103'),clientSideLogs);_0x19349d[_0x97e9('0x6')]('/apidoc',express[_0x97e9('0x104')](path[_0x97e9('0x105')](config[_0x97e9('0x106')],_0x97e9('0x107'))));_0x19349d[_0x97e9('0x6')]('/www',express[_0x97e9('0x104')](path[_0x97e9('0x105')](config[_0x97e9('0x106')],'/www')));_0x19349d[_0x97e9('0x6')](_0x97e9('0x108'),express[_0x97e9('0x104')](path['join'](config[_0x97e9('0x106')],'/demo')));_0x19349d['use']('/snippet',express[_0x97e9('0x104')](path[_0x97e9('0x105')](config['root'],_0x97e9('0x109'),_0x97e9('0x10a'))));_0x19349d[_0x97e9('0x6')](_0x97e9('0x10b'),express[_0x97e9('0x104')](path[_0x97e9('0x105')](config[_0x97e9('0x106')],_0x97e9('0x10c'))));_0x19349d['route'](_0x97e9('0x10d'))[_0x97e9('0x10e')](errors[0x194]);_0x19349d[_0x97e9('0x10f')]('/*')[_0x97e9('0x10e')](function(_0x41e6cf,_0x5c16ad){_0x5c16ad[_0x97e9('0x110')](path[_0x97e9('0x111')](_0x19349d['get'](_0x97e9('0x112'))+_0x97e9('0x113')));});return _0x19349d;});}; \ No newline at end of file +var _0xba1f=['/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','get','route','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/screen/recordings','/api/voice/mails','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./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/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory'];(function(_0x1a7edc,_0x34fee5){var _0xa45c76=function(_0x3f0678){while(--_0x3f0678){_0x1a7edc['push'](_0x1a7edc['shift']());}};_0xa45c76(++_0x34fee5);}(_0xba1f,0x137));var _0xfba1=function(_0x315388,_0x2b5131){_0x315388=_0x315388-0x0;var _0x554e7c=_0xba1f[_0x315388];return _0x554e7c;};'use strict';var path=require(_0xfba1('0x0'));var express=require(_0xfba1('0x1'));var errors=require(_0xfba1('0x2'));var config=require(_0xfba1('0x3'));var setupLoggers=require(_0xfba1('0x4'))[_0xfba1('0x5')];var clientSideLogs=require(_0xfba1('0x6'));exports['default']=function(_0xb92aad){return setupLoggers(_0xb92aad)[_0xfba1('0x7')](function(){_0xb92aad[_0xfba1('0x8')](_0xfba1('0x9'),require('./api/user'));_0xb92aad['use']('/api/voice/chanspy',require(_0xfba1('0xa')));_0xb92aad['use'](_0xfba1('0xb'),require(_0xfba1('0xc')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xd'),require(_0xfba1('0xe')));_0xb92aad['use'](_0xfba1('0xf'),require(_0xfba1('0x10')));_0xb92aad[_0xfba1('0x8')]('/api/voice/queues',require(_0xfba1('0x11')));_0xb92aad[_0xfba1('0x8')]('/api/voice/recordings',require('./api/voiceRecording'));_0xb92aad['use'](_0xfba1('0x12'),require('./api/screenRecording'));_0xb92aad['use'](_0xfba1('0x13'),require('./api/voiceMail'));_0xb92aad['use']('/api/voice/mails/messages',require(_0xfba1('0x14')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x15'),require(_0xfba1('0x16')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x17'),require(_0xfba1('0x18')));_0xb92aad['use']('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0xb92aad[_0xfba1('0x8')]('/api/voice/queues/reports',require(_0xfba1('0x19')));_0xb92aad['use'](_0xfba1('0x1a'),require(_0xfba1('0x1b')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x1c'),require(_0xfba1('0x1d')));_0xb92aad[_0xfba1('0x8')]('/api/voice/transfers/reports',require(_0xfba1('0x1e')));_0xb92aad['use'](_0xfba1('0x1f'),require(_0xfba1('0x20')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x21'),require(_0xfba1('0x22')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x23'),require('./api/mailQueue'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x24'),require(_0xfba1('0x25')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x26'),require(_0xfba1('0x27')));_0xb92aad[_0xfba1('0x8')]('/api/mail/messages',require(_0xfba1('0x28')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x29'),require(_0xfba1('0x2a')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x2b'),require(_0xfba1('0x2c')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x2d'),require('./api/dashboard'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x2e'),require('./api/dashboardItem'));_0xb92aad[_0xfba1('0x8')]('/api/fax/accounts',require(_0xfba1('0x2f')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x30'),require(_0xfba1('0x31')));_0xb92aad['use']('/api/fax/interactions',require('./api/faxInteraction'));_0xb92aad[_0xfba1('0x8')]('/api/fax/messages',require('./api/faxMessage'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x32'),require(_0xfba1('0x33')));_0xb92aad['use'](_0xfba1('0x34'),require(_0xfba1('0x35')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x36'),require(_0xfba1('0x37')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x38'),require('./api/smsApplication'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x39'),require(_0xfba1('0x3a')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x3b'),require(_0xfba1('0x3c')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x3d'),require(_0xfba1('0x3e')));_0xb92aad['use'](_0xfba1('0x3f'),require(_0xfba1('0x40')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x41'),require(_0xfba1('0x42')));_0xb92aad['use'](_0xfba1('0x43'),require(_0xfba1('0x44')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x45'),require(_0xfba1('0x46')));_0xb92aad[_0xfba1('0x8')]('/api/openchannel/queues',require(_0xfba1('0x47')));_0xb92aad['use'](_0xfba1('0x48'),require(_0xfba1('0x49')));_0xb92aad[_0xfba1('0x8')]('/api/openchannel/reports/queue',require(_0xfba1('0x4a')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x4b'),require(_0xfba1('0x4c')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x4d'),require(_0xfba1('0x4e')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x4f'),require(_0xfba1('0x50')));_0xb92aad['use'](_0xfba1('0x51'),require(_0xfba1('0x52')));_0xb92aad[_0xfba1('0x8')]('/api/chat/queues',require(_0xfba1('0x53')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x54'),require(_0xfba1('0x55')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x56'),require(_0xfba1('0x57')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x58'),require(_0xfba1('0x59')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x5a'),require('./api/cmContact'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x5b'),require(_0xfba1('0x5c')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x5d'),require(_0xfba1('0x5e')));_0xb92aad[_0xfba1('0x8')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0xb92aad['use'](_0xfba1('0x5f'),require(_0xfba1('0x60')));_0xb92aad['use'](_0xfba1('0x61'),require(_0xfba1('0x62')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x63'),require('./api/action'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x64'),require(_0xfba1('0x65')));_0xb92aad['use']('/api/canned_answers',require(_0xfba1('0x66')));_0xb92aad['use'](_0xfba1('0x67'),require(_0xfba1('0x68')));_0xb92aad[_0xfba1('0x8')]('/api/conditions',require(_0xfba1('0x69')));_0xb92aad['use'](_0xfba1('0x6a'),require(_0xfba1('0x6b')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x6c'),require(_0xfba1('0x6d')));_0xb92aad['use']('/api/cdr',require(_0xfba1('0x6e')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x6f'),require(_0xfba1('0x70')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x71'),require(_0xfba1('0x72')));_0xb92aad['use'](_0xfba1('0x73'),require(_0xfba1('0x74')));_0xb92aad['use'](_0xfba1('0x75'),require('./api/tag'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x76'),require(_0xfba1('0x77')));_0xb92aad[_0xfba1('0x8')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x78'),require(_0xfba1('0x79')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x7a'),require(_0xfba1('0x7b')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x7c'),require(_0xfba1('0x7d')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x7e'),require(_0xfba1('0x7f')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x80'),require(_0xfba1('0x81')));_0xb92aad[_0xfba1('0x8')]('/api/integrations/reports',require(_0xfba1('0x82')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x83'),require(_0xfba1('0x84')));_0xb92aad[_0xfba1('0x8')]('/api/analytics/default_reports',require(_0xfba1('0x85')));_0xb92aad[_0xfba1('0x8')]('/api/analytics/extracted_reports',require(_0xfba1('0x86')));_0xb92aad['use']('/api/analytics/metrics',require(_0xfba1('0x87')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x88'),require(_0xfba1('0x89')));_0xb92aad[_0xfba1('0x8')]('/api/analytics/tree_reports',require(_0xfba1('0x8a')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x8b'),require(_0xfba1('0x8c')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x8d'),require(_0xfba1('0x8e')));_0xb92aad['use'](_0xfba1('0x8f'),require(_0xfba1('0x90')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x91'),require('./api/intSugarcrmAccount'));_0xb92aad[_0xfba1('0x8')]('/api/integrations/sugarcrm/configurations',require(_0xfba1('0x92')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x93'),require(_0xfba1('0x94')));_0xb92aad['use'](_0xfba1('0x95'),require(_0xfba1('0x96')));_0xb92aad['use'](_0xfba1('0x97'),require(_0xfba1('0x98')));_0xb92aad['use'](_0xfba1('0x99'),require('./api/intDeskField'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x9a'),require(_0xfba1('0x9b')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x9c'),require(_0xfba1('0x9d')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x9e'),require(_0xfba1('0x9f')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xa0'),require(_0xfba1('0xa1')));_0xb92aad[_0xfba1('0x8')]('/api/integrations/zendesk/configurations',require(_0xfba1('0xa2')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xa3'),require(_0xfba1('0xa4')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xa5'),require(_0xfba1('0xa6')));_0xb92aad['use'](_0xfba1('0xa7'),require(_0xfba1('0xa8')));_0xb92aad[_0xfba1('0x8')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xa9'),require(_0xfba1('0xaa')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xab'),require(_0xfba1('0xac')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xad'),require(_0xfba1('0xae')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xaf'),require(_0xfba1('0xb0')));_0xb92aad['use'](_0xfba1('0xb1'),require('./api/intServicenowConfiguration'));_0xb92aad['use']('/api/integrations/servicenow/fields',require(_0xfba1('0xb2')));_0xb92aad[_0xfba1('0x8')]('/api/integrations/dynamics365/accounts',require(_0xfba1('0xb3')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xb4'),require('./api/intDynamics365Configuration'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xb5'),require(_0xfba1('0xb6')));_0xb92aad[_0xfba1('0x8')]('/api/integrations/freshsales/accounts',require(_0xfba1('0xb7')));_0xb92aad['use'](_0xfba1('0xb8'),require(_0xfba1('0xb9')));_0xb92aad['use'](_0xfba1('0xba'),require('./api/intFreshsalesField'));_0xb92aad['use'](_0xfba1('0xbb'),require(_0xfba1('0xbc')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xbd'),require(_0xfba1('0xbe')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xbf'),require(_0xfba1('0xc0')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xc1'),require('./api/jscriptyAnswerReport'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xc2'),require(_0xfba1('0xc3')));_0xb92aad['use'](_0xfba1('0xc4'),require(_0xfba1('0xc5')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xc6'),require('./api/smsQueueReport'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xc7'),require(_0xfba1('0xc8')));_0xb92aad[_0xfba1('0x8')]('/api/square/details/reports',require(_0xfba1('0xc9')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xca'),require(_0xfba1('0xcb')));_0xb92aad['use'](_0xfba1('0xcc'),require(_0xfba1('0xcd')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xce'),require(_0xfba1('0xcf')));_0xb92aad['use'](_0xfba1('0xd0'),require('./api/squareProject'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xd1'),require(_0xfba1('0xd2')));_0xb92aad['use'](_0xfba1('0xd3'),require(_0xfba1('0xd4')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xd5'),require(_0xfba1('0xd6')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xd7'),require('./api/license'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xd8'),require(_0xfba1('0xd9')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xda'),require(_0xfba1('0xdb')));_0xb92aad['use']('/api/attachments',require(_0xfba1('0xdc')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xdd'),require('./api/plugin'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xde'),require('./api/mailTransferReport'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xdf'),require('./api/chatTransferReport'));_0xb92aad[_0xfba1('0x8')]('/api/fax/reports/transfer',require(_0xfba1('0xe0')));_0xb92aad[_0xfba1('0x8')]('/api/openchannel/reports/transfer',require(_0xfba1('0xe1')));_0xb92aad['use'](_0xfba1('0xe2'),require(_0xfba1('0xe3')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xe4'),require(_0xfba1('0xe5')));_0xb92aad['use']('/api/voice/prefixes',require(_0xfba1('0xe6')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xe7'),require(_0xfba1('0xe8')));_0xb92aad['use'](_0xfba1('0xe9'),require(_0xfba1('0xea')));_0xb92aad['use'](_0xfba1('0xeb'),require(_0xfba1('0xec')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xed'),require('./api/userNotification'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xee'),require(_0xfba1('0xef')));_0xb92aad['use'](_0xfba1('0xf0'),require(_0xfba1('0xf1')));_0xb92aad['use'](_0xfba1('0xf2'),require('./api/whatsappInteraction'));_0xb92aad[_0xfba1('0x8')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xf3'),require('./api/whatsappQueueReport'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xf4'),require(_0xfba1('0xf5')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xf6'),require('./api/whatsappQueue'));_0xb92aad['use']('/api/cloudProviders',require(_0xfba1('0xf7')));_0xb92aad['use'](_0xfba1('0xf8'),require(_0xfba1('0xf9')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xfa'),require(_0xfba1('0xfb')));_0xb92aad['use'](_0xfba1('0xfc'),require('./api/authLocal'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xfd'),require(_0xfba1('0xfe')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0xff'),require(_0xfba1('0x100')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x101'),require('./api/jira'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x102'),require(_0xfba1('0x103')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x104'),require(_0xfba1('0x105')));_0xb92aad[_0xfba1('0x8')]('/api/system',require(_0xfba1('0x106')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x107'),require(_0xfba1('0x108')));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x109'),require('./api/webbar'));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x10a'),clientSideLogs);_0xb92aad[_0xfba1('0x8')]('/apidoc',express[_0xfba1('0x10b')](path[_0xfba1('0x10c')](config[_0xfba1('0x10d')],_0xfba1('0x10e'))));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x10f'),express['static'](path[_0xfba1('0x10c')](config[_0xfba1('0x10d')],_0xfba1('0x10f'))));_0xb92aad[_0xfba1('0x8')]('/demo',express[_0xfba1('0x10b')](path[_0xfba1('0x10c')](config[_0xfba1('0x10d')],_0xfba1('0x110'))));_0xb92aad[_0xfba1('0x8')](_0xfba1('0x111'),express[_0xfba1('0x10b')](path[_0xfba1('0x10c')](config['root'],_0xfba1('0x112'),_0xfba1('0x113'))));_0xb92aad['use'](_0xfba1('0x114'),express[_0xfba1('0x10b')](path[_0xfba1('0x10c')](config['root'],_0xfba1('0x115'))));_0xb92aad['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0xfba1('0x116')](errors[0x194]);_0xb92aad[_0xfba1('0x117')]('/*')[_0xfba1('0x116')](function(_0x2dd008,_0x1e0de8){_0x1e0de8[_0xfba1('0x118')](path[_0xfba1('0x119')](_0xb92aad[_0xfba1('0x116')](_0xfba1('0x11a'))+_0xfba1('0x11b')));});return _0xb92aad;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 87109bf..893398b 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x428b=['../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.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/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0xadf368,_0x5a5863){var _0x41a61e=function(_0x53c5be){while(--_0x53c5be){_0xadf368['push'](_0xadf368['shift']());}};_0x41a61e(++_0x5a5863);}(_0x428b,0xc5));var _0xb428=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x428b[_0x8c43de];return _0xa6591b;};'use strict';var jayson=require('jayson/promise');var _=require(_0xb428('0x0'));var config=require(_0xb428('0x1'));exports[_0xb428('0x2')]=function(){return new Promise(function(_0x49c0e7,_0x38ea7c){var _0x6e3da4={};_0x6e3da4=_['merge'](_0x6e3da4,require('../api/user/user.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x4')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/voiceQueue/voiceQueue.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x5')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x6')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x7')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x8')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/memberReport/memberReport.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x9')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0xa')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0xb')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0xc')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0xd')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0xe')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0xf')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x10')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x11')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x12')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x13')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x14')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x15')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x16')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x17')));_0x6e3da4=_['merge'](_0x6e3da4,require('../api/smsAccount/smsAccount.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x18')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/smsMessage/smsMessage.rpc'));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x19')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x1a')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x1b')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x1c')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x1d')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/chatInteraction/chatInteraction.rpc'));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x1e')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x1f')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x20')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/cmHopper/cmHopper.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x21')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x22')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x23')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x24')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x25')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x26')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x27')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x28')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x29')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x2a')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x2b')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x2c')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x2d')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x2e')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x2f')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x30')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x31')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x32')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x33')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x34')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x35')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x36')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x6e3da4=_['merge'](_0x6e3da4,require('../api/setting/setting.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x37')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x38')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x39')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x3a')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x3b')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x3c')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require('../api/plugin/plugin.rpc'));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x3d')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x3e')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x3f')));_0x6e3da4=_[_0xb428('0x3')](_0x6e3da4,require(_0xb428('0x40')));_0x6e3da4=_['merge'](_0x6e3da4,require(_0xb428('0x41')));var _0x5551df=jayson['server'](_0x6e3da4)[_0xb428('0x42')]();var _0x5322d6=config[_0xb428('0x43')]['port']||config['port']+0x1;var _0x2893f2=config['rpc']['ip']||'localhost';_0x5551df['on'](_0xb428('0x44'),function(_0x4b168e){return _0x38ea7c(_0x4b168e);});_0x5551df[_0xb428('0x2')](_0x5322d6,_0x2893f2,function(){console[_0xb428('0x45')](_0xb428('0x46'),_0x2893f2,_0x5322d6);require(_0xb428('0x47'))[_0xb428('0x48')]();return _0x49c0e7(_0xb428('0x49')+_0x2893f2+':'+_0x5322d6);});});}; \ No newline at end of file +var _0x9151=['../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.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','port','rpc','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.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/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc'];(function(_0xb2b743,_0x4af689){var _0x1f0f5c=function(_0x5408e5){while(--_0x5408e5){_0xb2b743['push'](_0xb2b743['shift']());}};_0x1f0f5c(++_0x4af689);}(_0x9151,0x115));var _0x1915=function(_0x262957,_0x34c699){_0x262957=_0x262957-0x0;var _0x27e221=_0x9151[_0x262957];return _0x27e221;};'use strict';var jayson=require(_0x1915('0x0'));var _=require('lodash');var config=require(_0x1915('0x1'));exports[_0x1915('0x2')]=function(){return new Promise(function(_0x5517d9,_0x57ecf8){var _0x45df20={};_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x4')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x5')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/voiceQueue/voiceQueue.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/voiceRecording/voiceRecording.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x6')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x7')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x8')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x9')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0xa')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0xb')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0xc')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/mailServerIn/mailServerIn.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0xd')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0xe')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0xf')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x10')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x11')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x12')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x13')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x14')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x15')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x16')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x17')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x18')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x19')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x1a')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x1b')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/smsQueue/smsQueue.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x1c')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x1d')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x1e')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x1f')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x20')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x21')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x22')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x23')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x24')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x25')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x26')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x27')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x28')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x29')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x2a')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x2b')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x2c')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/template/template.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x2d')));_0x45df20=_['merge'](_0x45df20,require('../api/variable/variable.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x2e')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x2f')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x30')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x31')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x32')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x33')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x34')));_0x45df20=_['merge'](_0x45df20,require('../api/squareReport/squareReport.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x35')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/setting/setting.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x36')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x37')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x38')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x39')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require('../api/campaign/campaign.rpc'));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x3a')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x3b')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x3c')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x3d')));_0x45df20=_['merge'](_0x45df20,require(_0x1915('0x3e')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x3f')));_0x45df20=_[_0x1915('0x3')](_0x45df20,require(_0x1915('0x40')));var _0x3c948c=jayson[_0x1915('0x41')](_0x45df20)['http']();var _0x38a2b2=config['rpc'][_0x1915('0x42')]||config['port']+0x1;var _0x1532ef=config[_0x1915('0x43')]['ip']||_0x1915('0x44');_0x3c948c['on'](_0x1915('0x45'),function(_0x25e540){return _0x57ecf8(_0x25e540);});_0x3c948c[_0x1915('0x2')](_0x38a2b2,_0x1532ef,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1532ef,_0x38a2b2);require(_0x1915('0x46'))[_0x1915('0x47')]();return _0x5517d9(_0x1915('0x48')+_0x1532ef+':'+_0x38a2b2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index dacfb13..35d1343 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 _0xa53e=['wait','exports','util','events','EventEmitter','./error','call','utf8','setTimeout','setEncoding','headers','emit','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','sendRequest','sync','prototype','answer','ANSWER','beep','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','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','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi'];(function(_0x3e9fb6,_0x364267){var _0x2fdbc6=function(_0x243592){while(--_0x243592){_0x3e9fb6['push'](_0x3e9fb6['shift']());}};_0x2fdbc6(++_0x364267);}(_0xa53e,0xe6));var _0xea53=function(_0x344ec0,_0x148d31){_0x344ec0=_0x344ec0-0x0;var _0x582fea=_0xa53e[_0x344ec0];return _0x582fea;};'use strict';var util=require(_0xea53('0x0'));var _=require('lodash');var EventEmitter=require(_0xea53('0x1'))[_0xea53('0x2')];var AGIReply=require('./reply');var AGIError=require(_0xea53('0x3'));function AGIChannel(_0x3ad2cc){var _0x5b3251=this,_0x2b11f7=new AGIReply(),_0x5b46b6=![],_0x33a6e4={};EventEmitter[_0xea53('0x4')](_0x5b3251);_0x3ad2cc['setEncoding'](_0xea53('0x5'));_0x3ad2cc[_0xea53('0x6')](0x8*0x3c*0x3c*0x3e8);_0x2b11f7[_0xea53('0x7')]('utf8');_0x2b11f7['on'](_0xea53('0x8'),function(_0x205ce9){for(var _0x3c5518 in _0x205ce9){_0x5b3251[_0x3c5518]=_0x205ce9[_0x3c5518];}_0x5b3251[_0xea53('0x9')]('ready');});_0x2b11f7['on']('line',function(_0x1bbab4){if(_0x1bbab4[_0xea53('0xa')]()==_0xea53('0xb')){_0x5b3251[_0xea53('0x9')](_0xea53('0xb'));return;}if(_0x1bbab4[_0xea53('0xc')](0x0,0xb)==_0xea53('0xd')){_0x5b46b6=!![];}if(_0x5b46b6){_0x33a6e4['rx']+=_0x1bbab4+'\x0a';if(_0x1bbab4[_0xea53('0xe')](_0xea53('0xf'))!=-0x1){_0x5b46b6=![];}}else{_0x33a6e4['rx']=_0x1bbab4;}if(_0x5b46b6){return;}if(typeof _0x33a6e4['cb']==_0xea53('0x10')){var _0x1d338d=_0x33a6e4['rx'][_0xea53('0xc')](0x0,0x3),_0x3f7b36=null,_0x56ea09=null;_0x1d338d=parseInt(_0x1d338d);if(isNaN(_0x1d338d)){_0x33a6e4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xea53('0x11')});return;}if(_0x1d338d!=0xc8){_0x33a6e4['cb'](null,{'code':_0x1d338d,'result':-0x1,'extra':'KO'});return;}_0x3f7b36=_0x33a6e4['rx'][_0xea53('0xc')](0x4)['replace']('result=','');if(_0x3f7b36['indexOf']('\x20')!=-0x1){_0x3f7b36=_0x3f7b36[_0xea53('0x12')](0x0,_0x3f7b36[_0xea53('0x13')]('\x20'));}if(_[_0xea53('0x14')](_0x3f7b36,'-1')){_0x3f7b36=parseInt(_0x3f7b36);}_0x56ea09=_0x33a6e4['rx'][_0xea53('0x15')]('\x20');if(_0x56ea09[_0xea53('0x16')]==0x3){_0x56ea09=_0x56ea09[0x2][_0xea53('0xc')](0x1,_0x56ea09[0x2][_0xea53('0x16')]-0x1);}else if(_0x56ea09[_0xea53('0x16')]>0x3){var _0x10c3ff=/\((.+)\)/;var _0x46a318=_0x33a6e4['rx'][_0xea53('0x17')](_0x10c3ff);if(_0x46a318){_0x56ea09=_0x46a318[0x1];}else{_0x56ea09=null;}}else{_0x56ea09=null;}_0x33a6e4['cb'](null,{'code':_0x1d338d,'result':_0x3f7b36,'extra':_0x56ea09});}});_0x3ad2cc['on']('error',function(_0xb6d77){_0x5b3251['emit'](_0xea53('0x18'),new AGIError(_0xea53('0x19'),_0xb6d77[_0xea53('0x1a')]));});_0x3ad2cc['on'](_0xea53('0x1b'),function(){_0x5b3251[_0xea53('0x9')](_0xea53('0x1b'),new AGIError(_0xea53('0x1c')));});_0x3ad2cc['on'](_0xea53('0x1d'),function(){_0x5b3251[_0xea53('0x9')]('timeout',new AGIError(_0xea53('0x1e')));_0x3ad2cc[_0xea53('0x1f')]();});_0x3ad2cc[_0xea53('0x20')](_0x2b11f7);this[_0xea53('0x21')]=function(_0x42039d,_0x326ab4){var _0x42039d=_0x42039d||'',_0x326ab4=typeof _0x326ab4==_0xea53('0x10')?_0x326ab4:new Function();_0x33a6e4={'tx':_0x42039d,'rx':'','cb':_0x326ab4};_0x3ad2cc[_0xea53('0x22')](_0x42039d+'\x0a');},this[_0xea53('0x1b')]=function(){_0x3ad2cc[_0xea53('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xea53('0x23')]=function(_0x51f76e){return this[_0xea53('0x21')][_0xea53('0x24')](this,_0x51f76e);};AGIChannel[_0xea53('0x25')][_0xea53('0x26')]=function(){return this[_0xea53('0x23')](_0xea53('0x27'));};AGIChannel['prototype']['getData']=function(_0x4df18b,_0x5cffcb,_0x1c77e4){_0x4df18b=_0x4df18b===undefined?_0xea53('0x28'):_0x4df18b;_0x5cffcb=_0x5cffcb===undefined?'5':_0x5cffcb;_0x1c77e4=_0x1c77e4===undefined?'1':_0x1c77e4;return this[_0xea53('0x23')](util[_0xea53('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4df18b,_0x5cffcb*0x3e8,_0x1c77e4));};AGIChannel[_0xea53('0x25')]['noop']=function(_0x781785){_0x781785=_0x781785||'NO\x20MESSAGE';return this[_0xea53('0x23')](util[_0xea53('0x29')](_0xea53('0x2a'),_0x781785));};AGIChannel[_0xea53('0x25')][_0xea53('0x2b')]=function(_0x4d7fe6,_0x3ff22c){if(_[_0xea53('0x2c')](_0x3ff22c)){return this[_0xea53('0x23')](util[_0xea53('0x29')](_0xea53('0x2d'),_0x4d7fe6,_0x3ff22c[_0xea53('0x2e')](',')));}return this['sendRequest'](util[_0xea53('0x29')](_0xea53('0x2d'),_0x4d7fe6,_0x3ff22c));};AGIChannel['prototype'][_0xea53('0x2f')]=function(_0x460b2e){return this['sendRequest'](util['format'](_0xea53('0x30'),_0x460b2e));};AGIChannel[_0xea53('0x25')][_0xea53('0x31')]=function(_0x2874ef){return this[_0xea53('0x23')](util[_0xea53('0x29')]('SET\x20EXTENSION\x20%s',_0x2874ef));};AGIChannel[_0xea53('0x25')][_0xea53('0x32')]=function(_0x2dd977){return this[_0xea53('0x23')](util[_0xea53('0x29')](_0xea53('0x33'),_0x2dd977));};AGIChannel[_0xea53('0x25')][_0xea53('0xb')]=function(){return this['sendRequest'](_0xea53('0x34'));};AGIChannel['prototype'][_0xea53('0x35')]=function(_0x13dbb1,_0x16769e){var _0x390baa=_['isBoolean'](_0x16769e)||_[_0xea53('0x36')](_0x16769e)?_0x16769e[_0xea53('0x37')]():_0x16769e;return this[_0xea53('0x23')](util[_0xea53('0x29')](_0xea53('0x38'),_0x13dbb1,_0x390baa?_0x390baa[_0xea53('0x37')]()[_0xea53('0x39')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xea53('0x25')][_0xea53('0x3a')]=function(_0x2e24da,_0x53e8eb){return this[_0xea53('0x23')](util[_0xea53('0x29')](_0xea53('0x3b'),_0x2e24da,_0x53e8eb));};AGIChannel[_0xea53('0x25')][_0xea53('0x3c')]=function(_0x56e0d5,_0x31e915){return this['sendRequest'](util['format'](_0xea53('0x3d'),_0x56e0d5,_0x31e915));};AGIChannel['prototype'][_0xea53('0x3e')]=function(_0x141309,_0x14672e){return this['sendRequest'](util['format'](_0xea53('0x3f'),_0x141309,_0x14672e));};AGIChannel[_0xea53('0x25')][_0xea53('0x40')]=function(_0x110d86,_0x5087ed,_0x4056ee){_0x5087ed=_0x5087ed||this[_0xea53('0x41')];_0x4056ee=_0x4056ee||0x1;this['setContext'](_0x110d86);this['setExtension'](_0x5087ed);this['setPriority'](_0x4056ee);return this[_0xea53('0x42')](util[_0xea53('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x110d86,_0x5087ed,_0x4056ee));};AGIChannel[_0xea53('0x25')][_0xea53('0x43')]=function(_0xa5b65f){return this['sendRequest'](util[_0xea53('0x29')](_0xea53('0x44'),_0xa5b65f));};AGIChannel[_0xea53('0x25')][_0xea53('0x45')]=function(_0xf08f78,_0x223bd7,_0xa3604e,_0x22671f,_0x53fb8c,_0x239020){_0x223bd7=_0x223bd7||_0xea53('0x46');_0xa3604e=_0xa3604e||'';_0x22671f=_0x22671f===undefined?-0x1:_0x22671f==='-1'?-0x1:_0x22671f*0x3e8;_0x53fb8c=_0x53fb8c===undefined?'':'s='+_0x53fb8c;_0x239020=_0x239020?'BEEP':'';return this['sendRequest'](util[_0xea53('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0xf08f78,_0x223bd7,_0xa3604e,_0x22671f,_0x239020,_0x53fb8c));};AGIChannel[_0xea53('0x25')][_0xea53('0x47')]=function(_0x4c2516,_0x3afc4a){_0x3afc4a=_0x3afc4a||'';return this[_0xea53('0x23')](util[_0xea53('0x29')](_0xea53('0x48'),_0x4c2516,_0x3afc4a));};AGIChannel[_0xea53('0x25')][_0xea53('0x49')]=function(_0x2f50a8){return this['exec']('AGI',_0x2f50a8);};AGIChannel[_0xea53('0x25')][_0xea53('0x4a')]=function(_0x1b5417){return this[_0xea53('0x2b')]('WAIT',_0x1b5417);};AGIChannel[_0xea53('0x25')][_0xea53('0x18')]=function(_0x1707bd,_0x2e1fec){this[_0xea53('0x42')](util[_0xea53('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x1707bd['id'],_0x1707bd['label'],_0x2e1fec));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xea53('0x4b')]=AGIChannel; \ No newline at end of file +var _0x0b62=['prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./error','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command','function','write','inherits'];(function(_0x504cba,_0x25f2d3){var _0x4aff20=function(_0x52f3dc){while(--_0x52f3dc){_0x504cba['push'](_0x504cba['shift']());}};_0x4aff20(++_0x25f2d3);}(_0x0b62,0x177));var _0x20b6=function(_0x75e808,_0x8887f8){_0x75e808=_0x75e808-0x0;var _0xbc39c8=_0x0b62[_0x75e808];return _0xbc39c8;};'use strict';var util=require(_0x20b6('0x0'));var _=require(_0x20b6('0x1'));var EventEmitter=require('events')[_0x20b6('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x20b6('0x3'));function AGIChannel(_0x1c823a){var _0x3c062c=this,_0x714b86=new AGIReply(),_0x44154f=![],_0x195273={};EventEmitter['call'](_0x3c062c);_0x1c823a[_0x20b6('0x4')](_0x20b6('0x5'));_0x1c823a[_0x20b6('0x6')](0x8*0x3c*0x3c*0x3e8);_0x714b86[_0x20b6('0x4')](_0x20b6('0x5'));_0x714b86['on'](_0x20b6('0x7'),function(_0x1e07d5){for(var _0x106144 in _0x1e07d5){_0x3c062c[_0x106144]=_0x1e07d5[_0x106144];}_0x3c062c[_0x20b6('0x8')]('ready');});_0x714b86['on'](_0x20b6('0x9'),function(_0x4e85c6){if(_0x4e85c6[_0x20b6('0xa')]()==_0x20b6('0xb')){_0x3c062c[_0x20b6('0x8')](_0x20b6('0xb'));return;}if(_0x4e85c6[_0x20b6('0xc')](0x0,0xb)==_0x20b6('0xd')){_0x44154f=!![];}if(_0x44154f){_0x195273['rx']+=_0x4e85c6+'\x0a';if(_0x4e85c6[_0x20b6('0xe')](_0x20b6('0xf'))!=-0x1){_0x44154f=![];}}else{_0x195273['rx']=_0x4e85c6;}if(_0x44154f){return;}if(typeof _0x195273['cb']=='function'){var _0x238291=_0x195273['rx'][_0x20b6('0xc')](0x0,0x3),_0x5e83b0=null,_0x3918a6=null;_0x238291=parseInt(_0x238291);if(isNaN(_0x238291)){_0x195273['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x20b6('0x10')});return;}if(_0x238291!=0xc8){_0x195273['cb'](null,{'code':_0x238291,'result':-0x1,'extra':'KO'});return;}_0x5e83b0=_0x195273['rx'][_0x20b6('0xc')](0x4)[_0x20b6('0x11')]('result=','');if(_0x5e83b0[_0x20b6('0x12')]('\x20')!=-0x1){_0x5e83b0=_0x5e83b0[_0x20b6('0x13')](0x0,_0x5e83b0[_0x20b6('0x12')]('\x20'));}if(_[_0x20b6('0x14')](_0x5e83b0,'-1')){_0x5e83b0=parseInt(_0x5e83b0);}_0x3918a6=_0x195273['rx'][_0x20b6('0x15')]('\x20');if(_0x3918a6[_0x20b6('0x16')]==0x3){_0x3918a6=_0x3918a6[0x2]['substring'](0x1,_0x3918a6[0x2][_0x20b6('0x16')]-0x1);}else if(_0x3918a6[_0x20b6('0x16')]>0x3){var _0x23e254=/\((.+)\)/;var _0x5192ba=_0x195273['rx'][_0x20b6('0x17')](_0x23e254);if(_0x5192ba){_0x3918a6=_0x5192ba[0x1];}else{_0x3918a6=null;}}else{_0x3918a6=null;}_0x195273['cb'](null,{'code':_0x238291,'result':_0x5e83b0,'extra':_0x3918a6});}});_0x1c823a['on'](_0x20b6('0x18'),function(_0x354930){_0x3c062c['emit'](_0x20b6('0x18'),new AGIError(_0x20b6('0x19'),_0x354930[_0x20b6('0x1a')]));});_0x1c823a['on'](_0x20b6('0x1b'),function(){_0x3c062c[_0x20b6('0x8')](_0x20b6('0x1b'),new AGIError(_0x20b6('0x1c')));});_0x1c823a['on'](_0x20b6('0x1d'),function(){_0x3c062c[_0x20b6('0x8')](_0x20b6('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1c823a[_0x20b6('0x1e')]();});_0x1c823a['pipe'](_0x714b86);this[_0x20b6('0x1f')]=function(_0x2f6b9a,_0x3878b5){var _0x2f6b9a=_0x2f6b9a||'',_0x3878b5=typeof _0x3878b5==_0x20b6('0x20')?_0x3878b5:new Function();_0x195273={'tx':_0x2f6b9a,'rx':'','cb':_0x3878b5};_0x1c823a[_0x20b6('0x21')](_0x2f6b9a+'\x0a');},this['close']=function(){_0x1c823a['destroy']();};}util[_0x20b6('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x20b6('0x23')][_0x20b6('0x24')]=function(_0x501453){return this['command'][_0x20b6('0x25')](this,_0x501453);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x26')]=function(){return this['sendRequest'](_0x20b6('0x27'));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x28')]=function(_0x9ce6fc,_0x3861f2,_0x448146){_0x9ce6fc=_0x9ce6fc===undefined?_0x20b6('0x29'):_0x9ce6fc;_0x3861f2=_0x3861f2===undefined?'5':_0x3861f2;_0x448146=_0x448146===undefined?'1':_0x448146;return this[_0x20b6('0x24')](util[_0x20b6('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x9ce6fc,_0x3861f2*0x3e8,_0x448146));};AGIChannel[_0x20b6('0x23')]['noop']=function(_0x410377){_0x410377=_0x410377||_0x20b6('0x2b');return this[_0x20b6('0x24')](util['format'](_0x20b6('0x2c'),_0x410377));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x2d')]=function(_0xb21276,_0x38b9ff){if(_[_0x20b6('0x2e')](_0x38b9ff)){return this[_0x20b6('0x24')](util['format'](_0x20b6('0x2f'),_0xb21276,_0x38b9ff[_0x20b6('0x30')](',')));}return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x2f'),_0xb21276,_0x38b9ff));};AGIChannel['prototype']['setContext']=function(_0xdec1d2){return this[_0x20b6('0x24')](util['format'](_0x20b6('0x31'),_0xdec1d2));};AGIChannel['prototype']['setExtension']=function(_0x4d1e09){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x32'),_0x4d1e09));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x33')]=function(_0x57f30b){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')]('SET\x20PRIORITY\x20%s',_0x57f30b));};AGIChannel[_0x20b6('0x23')][_0x20b6('0xb')]=function(){return this[_0x20b6('0x24')]('HANGUP');};AGIChannel[_0x20b6('0x23')][_0x20b6('0x34')]=function(_0x1893f1,_0x59dad0){var _0x3219d5=_[_0x20b6('0x35')](_0x59dad0)||_[_0x20b6('0x36')](_0x59dad0)?_0x59dad0[_0x20b6('0x37')]():_0x59dad0;return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x38'),_0x1893f1,_0x3219d5?_0x3219d5[_0x20b6('0x37')]()[_0x20b6('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x39')]=function(_0x5e499e,_0x39b7be){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x3a'),_0x5e499e,_0x39b7be));};AGIChannel['prototype'][_0x20b6('0x3b')]=function(_0x269049,_0x4263f7){return this['sendRequest'](util[_0x20b6('0x2a')](_0x20b6('0x3c'),_0x269049,_0x4263f7));};AGIChannel['prototype'][_0x20b6('0x3d')]=function(_0x49eae0,_0x53ae09){return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x3e'),_0x49eae0,_0x53ae09));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x3f')]=function(_0x1782dd,_0x3cd581,_0x5f479e){_0x3cd581=_0x3cd581||this[_0x20b6('0x40')];_0x5f479e=_0x5f479e||0x1;this[_0x20b6('0x41')](_0x1782dd);this[_0x20b6('0x42')](_0x3cd581);this['setPriority'](_0x5f479e);return this[_0x20b6('0x43')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x1782dd,_0x3cd581,_0x5f479e));};AGIChannel['prototype'][_0x20b6('0x44')]=function(_0x16fa7d){return this['sendRequest'](util[_0x20b6('0x2a')](_0x20b6('0x45'),_0x16fa7d));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x46')]=function(_0x3eb27f,_0x11edc3,_0x9d7ae3,_0x186190,_0x167eab,_0x5aab15){_0x11edc3=_0x11edc3||_0x20b6('0x47');_0x9d7ae3=_0x9d7ae3||'';_0x186190=_0x186190===undefined?-0x1:_0x186190==='-1'?-0x1:_0x186190*0x3e8;_0x167eab=_0x167eab===undefined?'':'s='+_0x167eab;_0x5aab15=_0x5aab15?_0x20b6('0x48'):'';return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x49'),_0x3eb27f,_0x11edc3,_0x9d7ae3,_0x186190,_0x5aab15,_0x167eab));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4a')]=function(_0x3e7df0,_0x192f71){_0x192f71=_0x192f71||'';return this[_0x20b6('0x24')](util[_0x20b6('0x2a')](_0x20b6('0x4b'),_0x3e7df0,_0x192f71));};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4c')]=function(_0x549056){return this[_0x20b6('0x2d')]('AGI',_0x549056);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x4d')]=function(_0x414629){return this['exec'](_0x20b6('0x4e'),_0x414629);};AGIChannel[_0x20b6('0x23')][_0x20b6('0x18')]=function(_0x351d3e,_0x2112ce){this['noop'](util[_0x20b6('0x2a')](_0x20b6('0x4f'),_0x351d3e['id'],_0x351d3e[_0x20b6('0x50')],_0x2112ce));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x20b6('0x51')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 1c57c8c..c2179c8 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 _0xc72d=['apply','exports','util','Undefined\x20error.','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.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format'];(function(_0x5ab5ae,_0x5cb73d){var _0x1009a5=function(_0x2f60a6){while(--_0x2f60a6){_0x5ab5ae['push'](_0x5ab5ae['shift']());}};_0x1009a5(++_0x5cb73d);}(_0xc72d,0xc2));var _0xdc72=function(_0x2aed5d,_0x30b2fd){_0x2aed5d=_0x2aed5d-0x0;var _0x27d38a=_0xc72d[_0x2aed5d];return _0x27d38a;};'use strict';var util=require(_0xdc72('0x0'));var error={'E_AGI_UNDEFINED':_0xdc72('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xdc72('0x2'),'E_AGI_SERVER_CLOSE':_0xdc72('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xdc72('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xdc72('0x5'),'E_AGI_SOCKET_ERROR':_0xdc72('0x6'),'E_AGI_SOCKET_CLOSE':_0xdc72('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xdc72('0x8'),'E_AGI_COMMAND_EMPTY':_0xdc72('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xdc72('0xa'),'E_AGI_IVR_ENTRY':_0xdc72('0xb')};function AGIError(_0x593d38){var _0x593d38=_0x593d38||null,_0x46ac3e=_0x46ac3e||[],_0x643a8=0x1,_0x42f955='';if(!error[_0x593d38]){_0x593d38='E_AGI_UNDEFINED';}_0x46ac3e[_0xdc72('0xc')](error[_0x593d38]);while(arguments[_0x643a8]){_0x46ac3e['push'](arguments[_0x643a8]);_0x643a8++;}_0x42f955=util[_0xdc72('0xd')][_0xdc72('0xe')](util,_0x46ac3e);this['message']=_0x42f955;this['name']=_0x593d38;}module[_0xdc72('0xf')]=AGIError; \ No newline at end of file +var _0x2741=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.'];(function(_0x5f0225,_0x52631a){var _0x2cef4b=function(_0x5a29c6){while(--_0x5a29c6){_0x5f0225['push'](_0x5f0225['shift']());}};_0x2cef4b(++_0x52631a);}(_0x2741,0x1da));var _0x1274=function(_0x224b89,_0x527c54){_0x224b89=_0x224b89-0x0;var _0x48944c=_0x2741[_0x224b89];return _0x48944c;};'use strict';var util=require(_0x1274('0x0'));var error={'E_AGI_UNDEFINED':_0x1274('0x1'),'E_AGI_ARGUMENT_PORT':_0x1274('0x2'),'E_AGI_SERVER_ERROR':_0x1274('0x3'),'E_AGI_SERVER_CLOSE':_0x1274('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x1274('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x1274('0x6'),'E_AGI_COMMAND_EMPTY':_0x1274('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1274('0x8'),'E_AGI_IVR_ENTRY':_0x1274('0x9')};function AGIError(_0x420b7d){var _0x420b7d=_0x420b7d||null,_0x2d76af=_0x2d76af||[],_0x2cbcaf=0x1,_0x15d51a='';if(!error[_0x420b7d]){_0x420b7d=_0x1274('0xa');}_0x2d76af[_0x1274('0xb')](error[_0x420b7d]);while(arguments[_0x2cbcaf]){_0x2d76af[_0x1274('0xb')](arguments[_0x2cbcaf]);_0x2cbcaf++;}_0x15d51a=util[_0x1274('0xc')][_0x1274('0xd')](util,_0x2d76af);this[_0x1274('0xe')]=_0x15d51a;this[_0x1274('0xf')]=_0x420b7d;}module[_0x1274('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 144ef15..26ec44e 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 _0x6cdd=['condition','split','agicommand','vswitch','default','target','menu','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','agi','getsecretdigits','edges','prototype','vertices','addEdge','numberOfEdges','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','info','no\x20edge/s\x20available','length'];(function(_0x23135c,_0xb482ea){var _0x437d01=function(_0x5f2ae8){while(--_0x5f2ae8){_0x23135c['push'](_0x23135c['shift']());}};_0x437d01(++_0xb482ea);}(_0x6cdd,0x140));var _0xd6cd=function(_0x1ee97d,_0x2be81c){_0x1ee97d=_0x1ee97d-0x0;var _0x4b69c=_0x6cdd[_0x1ee97d];return _0x4b69c;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0xd6cd('0x0'));var verticesWithRetry=['menu','getdigits',_0xd6cd('0x1')];var Graph=function(){this['vertices']={};this[_0xd6cd('0x2')]={};this['numberOfEdges']=0x0;};Graph[_0xd6cd('0x3')]['addVertex']=function(_0x216a77){this[_0xd6cd('0x4')][_0x216a77['id']]=_0x216a77;this['edges'][_0x216a77['id']]=[];};Graph[_0xd6cd('0x3')][_0xd6cd('0x5')]=function(_0x5d8dbc,_0x340afc,_0x2ddd44){this[_0xd6cd('0x2')][_0x5d8dbc]['push']({'target':_0x340afc,'condition':_0x2ddd44});this[_0xd6cd('0x6')]+=0x1;};Graph[_0xd6cd('0x3')]['size']=function(){return _[_0xd6cd('0x7')](this[_0xd6cd('0x4')]);};Graph[_0xd6cd('0x3')][_0xd6cd('0x8')]=function(){return this[_0xd6cd('0x6')];};Graph[_0xd6cd('0x3')][_0xd6cd('0x9')]=function(_0x3b4f80){return this[_0xd6cd('0x4')][_0x3b4f80];};Graph[_0xd6cd('0x3')][_0xd6cd('0xa')]=function(_0x3539e5,_0x4c2b81){if(!this[_0xd6cd('0x4')][_0x3539e5]){return logger['info'](_0xd6cd('0xb'));}var _0x167aa3=_0x4c2b81(this[_0xd6cd('0x4')][_0x3539e5]);if(!_0x167aa3){return logger['info'](_0xd6cd('0xc'));}if(this[_0xd6cd('0x2')][_0x3539e5]['length']===0x0){return logger[_0xd6cd('0xd')](_0xd6cd('0xe'));}for(var _0x40d49b=0x0,_0x490130=[],_0x548ba9=![];_0x40d49b\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','toJson','mxGraphModel','root','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','agi_','inspect','debug','variables','stringify','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5683,0x1c5));var _0x3568=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5683[_0x5d4607];return _0x5e4a86;};'use strict';var parser=require('xml2json');var _=require(_0x3568('0x0'));var syncho=require('syncho');var util=require(_0x3568('0x1'));var moment=require(_0x3568('0x2'));var config=require(_0x3568('0x3'));var logger=require(_0x3568('0x4'))(_0x3568('0x5'));var utilLicense=require(_0x3568('0x6'));var rpc=require(_0x3568('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x3568('0x8'));var Vertices=require(_0x3568('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x3568('0x5')]=_['defaults'](config[_0x3568('0x5')],{'ip':_0x3568('0xa'),'port':0x11dd});function connectionHandler(_0x42d90e){process[_0x3568('0xb')](function(){syncho(function(){try{setChannelVariables(_0x42d90e);agiHandler(_0x42d90e);}catch(_0x45b9a3){logger[_0x3568('0xc')](_0x45b9a3['stack']);}});});}function listeningHandler(){console[_0x3568('0xd')](_0x3568('0xe'),config[_0x3568('0x5')][_0x3568('0xf')]);logger[_0x3568('0x10')](util[_0x3568('0x11')](_0x3568('0x12'),config[_0x3568('0x5')]['ip'],config[_0x3568('0x5')][_0x3568('0xf')]));}function errorHandler(_0x3e426f){if(_0x3e426f&&_0x3e426f[_0x3568('0x13')]&&_0x3e426f[_0x3568('0x14')]){logger['error'](util[_0x3568('0x11')](_0x3568('0x15'),_0x3e426f['name'],_0x3e426f['message']));}else{logger[_0x3568('0xc')](util[_0x3568('0x11')](_0x3568('0x16'),_0x3e426f[_0x3568('0x17')]));}}function closeHandler(){logger[_0x3568('0x10')](util[_0x3568('0x11')](_0x3568('0x18'),this[_0x3568('0x19')],this[_0x3568('0x1a')],this[_0x3568('0x1b')],this[_0x3568('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4921c3){logger[_0x3568('0xc')](_0x4921c3['stack']);}}function timeoutHandler(){logger[_0x3568('0x10')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x3568('0x19')],this[_0x3568('0x1a')],this[_0x3568('0x1b')],this[_0x3568('0x1c')],this[_0x3568('0x1d')]));}function hangupHandler(){logger[_0x3568('0x10')](util[_0x3568('0x11')](_0x3568('0x1e'),this['arg_1'],this[_0x3568('0x1a')],this[_0x3568('0x1b')],this[_0x3568('0x1c')],this['uniqueid']));this[_0x3568('0x1f')]=!![];}function getRoot(_0x2ed98d){return parser[_0x3568('0x20')](_0x2ed98d,{'object':!![]})[_0x3568('0x21')][_0x3568('0x22')];}function addVertex(_0x5c3a16,_0x136f95,_0x3d2911){_0x136f95['agicommand']=_0x3d2911;if(_0x136f95['hasOwnProperty'](_0x3568('0x23'))){_0x136f95['maxRetry']=parseInt(_0x136f95[_0x3568('0x23')],0xa);}_0x5c3a16[_0x3568('0x24')](_[_0x3568('0x25')](_0x136f95,_0x3568('0x26')));}function initGraph(_0x41af18,_0x3ed918){var _0x835f91=new Graph();for(var _0x1fd99f in _0x41af18){if(_0x41af18[_0x3568('0x27')](_0x1fd99f)){if(_[_0x3568('0x28')](_0x41af18[_0x1fd99f])){for(var _0x3314dc=0x0;_0x3314dc<_0x41af18[_0x1fd99f][_0x3568('0x29')];_0x3314dc+=0x1){addVertex(_0x835f91,_0x41af18[_0x1fd99f][_0x3314dc],_0x1fd99f);}}else{addVertex(_0x835f91,_0x41af18[_0x1fd99f],_0x1fd99f);}}}for(var _0x38f126=0x0;_0x38f126<_0x3ed918[_0x3568('0x29')];_0x38f126+=0x1){if(_0x3ed918[_0x38f126][_0x3568('0x2a')]&&_0x3ed918[_0x38f126][_0x3568('0x2b')]){_0x835f91[_0x3568('0x2c')](_0x3ed918[_0x38f126]['source'],_0x3ed918[_0x38f126][_0x3568('0x2b')],_0x3ed918[_0x38f126][_0x3568('0x2d')]);}}return _0x835f91;}function getSquareProject(_0x17d1b7,_0x56ddbb){rpc[_0x3568('0x2e')](_0x17d1b7)[_0x3568('0x2f')](function(_0x166954){_0x56ddbb(null,_0x166954);})[_0x3568('0x30')](function(_0x323281){_0x56ddbb(null,_0x323281);});}function createSquareReport(_0x56ce25,_0x540bab){rpc['createSquareReport'](_0x56ce25)[_0x3568('0x2f')](function(_0x4db991){if(_0x540bab){_0x540bab(null,_0x4db991);}})[_0x3568('0x30')](function(_0x3fe697){if(_0x540bab){_0x540bab(null,_0x3fe697);}});}function setChannelVariables(_0x1abd66){for(var _0x672af6 in _0x1abd66){if(_0x1abd66[_0x3568('0x27')](_0x672af6)){if(_0x672af6['indexOf'](_0x3568('0x31'))===0x0){_0x1abd66[_0x672af6['substring'](0x4)]=_0x1abd66[_0x672af6];delete _0x1abd66[_0x672af6];}}}}function getLogFromObject(_0x2d3131){return util[_0x3568('0x32')](_0x2d3131,{'showHidden':![],'depth':null});}function agiHandler(_0x3da9b2){var _0x2bdc40,_0x2ed29b,_0x50569a,_0x5acc8d,_0x5c9a5e;logger[_0x3568('0x33')](_0x3568('0x34'),JSON[_0x3568('0x35')](_0x3da9b2,null,0x2));logger[_0x3568('0x10')](util[_0x3568('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3da9b2[_0x3568('0x19')],_0x3da9b2[_0x3568('0x1a')],_0x3da9b2['callerid'],_0x3da9b2['dnid'],_0x3da9b2[_0x3568('0x1d')]));_0x3da9b2['on'](_0x3568('0xc'),errorHandler);_0x3da9b2['on'](_0x3568('0x36'),closeHandler);_0x3da9b2['on'](_0x3568('0x37'),timeoutHandler);_0x3da9b2[_0x3568('0x1f')]=![];_0x3da9b2['on'](_0x3568('0x38'),hangupHandler);var _0xa13b9f=getSquareProject[_0x3568('0x39')](null,_0x3da9b2[_0x3568('0x19')]);if(_0xa13b9f){if(_0xa13b9f[_0x3568('0x3a')]){_0x2bdc40=getRoot(_0xa13b9f[_0x3568('0x3a')]);if(_0x2bdc40&&_0x2bdc40[_0x3568('0x3b')]){logger[_0x3568('0x33')](_0x3568('0x22'),JSON[_0x3568('0x35')](_0x2bdc40,null,0x2));_0x3da9b2[_0x3568('0x3c')]=moment()[_0x3568('0x11')](_0x3568('0x3d'));_0x2ed29b=initGraph(_[_0x3568('0x25')](_0x2bdc40,_0x3568('0x26')),_0x2bdc40[_0x3568('0x26')]);_0x50569a=new Vertices(_0x3da9b2,rpc,mailRpc);logger[_0x3568('0x10')](util[_0x3568('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3da9b2['arg_1'],_0x3da9b2[_0x3568('0x1a')],_0x3da9b2[_0x3568('0x1b')],_0x3da9b2[_0x3568('0x1c')],_0x3da9b2[_0x3568('0x1d')]));_0x2ed29b[_0x3568('0x3e')](_0x2bdc40['start']['id'],function(_0x2112c1){try{_0x2112c1=_0x50569a[_0x3568('0x3f')](_0x2112c1);logger[_0x3568('0x33')](_0x3568('0x40'),JSON['stringify'](_0x2112c1,null,0x2));if(_0x2112c1[_0x3568('0x41')]===_0x3568('0x42')){logger[_0x3568('0x10')](_0x3568('0x43'));_0x3da9b2[_0x3568('0x44')]=_0x2112c1[_0x3568('0x44')]||_0x3da9b2[_0x3568('0x44')];_0x3da9b2[_0x3568('0x45')]=_0x2112c1[_0x3568('0x45')];_0x3da9b2['priority']=_0x2112c1[_0x3568('0x46')]?_0x2112c1['priority']-0x1:0x1;return null;}else if(_0x2112c1&&_0x50569a[_0x2112c1[_0x3568('0x41')]]){_0x5c9a5e=_0x50569a[_0x2112c1[_0x3568('0x41')]](_0x2112c1);logger[_0x3568('0x10')](_0x3568('0x47'),JSON[_0x3568('0x35')](_0x5c9a5e,null,0x2));if(_0x5c9a5e&&_0x5c9a5e[_0x3568('0x48')]===AGI_CODE_SUCCESS&&_0x5c9a5e[_0x3568('0x49')]!==AGI_RESULT_ERROR&&!_0x3da9b2[_0x3568('0x1f')]){logger[_0x3568('0x33')](_0x3568('0x47'),getLogFromObject(_0x5c9a5e));return _[_0x3568('0x4a')](_0x5c9a5e['result'])?null:_0x5c9a5e[_0x3568('0x49')][_0x3568('0x4b')]();}else{logger[_0x3568('0xc')]('response',getLogFromObject(_0x5c9a5e));return null;}}else{logger['error'](_0x3568('0x4c'));return null;}}catch(_0x96d558){logger[_0x3568('0xc')](_0x96d558['stack']);return null;}});if(_0x2bdc40[_0x3568('0x4d')]){logger[_0x3568('0x10')](util[_0x3568('0x11')](_0x3568('0x4e'),_0x3da9b2[_0x3568('0x19')],_0x3da9b2[_0x3568('0x1a')],_0x3da9b2['callerid'],_0x3da9b2[_0x3568('0x1c')],_0x3da9b2[_0x3568('0x1d')]));_0x2ed29b['traverseBFS'](_0x2bdc40[_0x3568('0x4d')]['id'],function(_0x2f9bf9){try{_0x2f9bf9=_0x50569a['clear'](_0x2f9bf9);logger[_0x3568('0x33')](_0x3568('0x40'),JSON[_0x3568('0x35')](_0x2f9bf9,null,0x2));if(_0x2f9bf9&&_0x50569a[_0x2f9bf9[_0x3568('0x41')]]){_0x5c9a5e=_0x50569a[_0x2f9bf9[_0x3568('0x41')]](_0x2f9bf9);if(_0x5c9a5e){logger[_0x3568('0x33')](_0x3568('0x47'),getLogFromObject(_0x5c9a5e));return _[_0x3568('0x4a')](_0x5c9a5e[_0x3568('0x49')])?null:_0x5c9a5e[_0x3568('0x49')][_0x3568('0x4b')]();}else{logger[_0x3568('0xc')]('response',getLogFromObject(_0x5c9a5e));return null;}}else{logger[_0x3568('0xc')](_0x3568('0x4c'));return null;}}catch(_0x4837ac){logger['error'](_0x4837ac[_0x3568('0x17')]);return null;}});}logger['info'](util[_0x3568('0x11')](_0x3568('0x4f'),_0x3da9b2['arg_1'],_0x3da9b2[_0x3568('0x1a')],_0x3da9b2['callerid'],_0x3da9b2['dnid'],_0x3da9b2[_0x3568('0x1d')]));logger[_0x3568('0x10')](util['format'](_0x3568('0x50'),_0x3da9b2[_0x3568('0x44')],_0x3da9b2[_0x3568('0x45')],parseInt(_0x3da9b2[_0x3568('0x46')],0xa)+0x1));_0x3da9b2[_0x3568('0x51')](_0x3da9b2[_0x3568('0x44')],_0x3da9b2['extension'],parseInt(_0x3da9b2[_0x3568('0x46')],0xa)+0x1);_0x3da9b2[_0x3568('0x36')]();}}else{logger[_0x3568('0xc')](util[_0x3568('0x11')]('Project\x20%s\x20not\x20published',_0x3da9b2[_0x3568('0x19')]));_0x3da9b2[_0x3568('0x51')](_0x3da9b2[_0x3568('0x44')],_0x3da9b2[_0x3568('0x45')],parseInt(_0x3da9b2[_0x3568('0x46')],0xa)+0x1);_0x3da9b2[_0x3568('0x36')]();}}else{logger[_0x3568('0xc')](util[_0x3568('0x11')]('Project\x20%s\x20not\x20found',_0x3da9b2[_0x3568('0x19')]));_0x3da9b2['continueAt'](_0x3da9b2['context'],_0x3da9b2[_0x3568('0x45')],parseInt(_0x3da9b2[_0x3568('0x46')],0xa)+0x1);_0x3da9b2[_0x3568('0x36')]();}}function main(){var _0x52778d;return utilLicense['getLicense']()[_0x3568('0x2f')](function(_0x29f724){if(_0x29f724){if(_0x29f724[_0x3568('0x52')]){if(_0x29f724[_0x3568('0x53')]&&_0x29f724[_0x3568('0x53')]>0x0){logger[_0x3568('0x10')](util[_0x3568('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x29f724[_0x3568('0x53')]));_0x52778d=_0x29f724[_0x3568('0x53')];}else{logger[_0x3568('0x10')](_0x3568('0x54'));}}else{logger[_0x3568('0x10')](_0x3568('0x55'));_0x52778d=-0x1;}}})[_0x3568('0x30')](function(_0x357da2){logger[_0x3568('0xc')](_0x3568('0x56'),_0x357da2['stack']);})['finally'](function(){var _0x4e1eb0=require(_0x3568('0x57'))(config[_0x3568('0x5')][_0x3568('0xf')],config['agi']['ip'],_0x52778d);_0x4e1eb0['on'](_0x3568('0xc'),errorHandler);_0x4e1eb0['on']('listening',listeningHandler);_0x4e1eb0['on'](_0x3568('0x58'),connectionHandler);_0x4e1eb0['on'](_0x3568('0x36'),closeHandler);});}main(); \ No newline at end of file +var _0x4e7c=['catch','indexOf','agi_','substring','inspect','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','debug','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','127.0.0.1','error','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','createSquareReport'];(function(_0x352108,_0xb5cdc3){var _0x2c901c=function(_0x4e0a61){while(--_0x4e0a61){_0x352108['push'](_0x352108['shift']());}};_0x2c901c(++_0xb5cdc3);}(_0x4e7c,0x1f2));var _0xc4e7=function(_0x505e18,_0x9a388f){_0x505e18=_0x505e18-0x0;var _0x4cd83c=_0x4e7c[_0x505e18];return _0x4cd83c;};'use strict';var parser=require(_0xc4e7('0x0'));var _=require(_0xc4e7('0x1'));var syncho=require(_0xc4e7('0x2'));var util=require(_0xc4e7('0x3'));var moment=require(_0xc4e7('0x4'));var config=require(_0xc4e7('0x5'));var logger=require(_0xc4e7('0x6'))(_0xc4e7('0x7'));var utilLicense=require(_0xc4e7('0x8'));var rpc=require(_0xc4e7('0x9'));var mailRpc=require(_0xc4e7('0xa'));var Graph=require('./graph');var Vertices=require(_0xc4e7('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xc4e7('0x7')]=_['defaults'](config[_0xc4e7('0x7')],{'ip':_0xc4e7('0xc'),'port':0x11dd});function connectionHandler(_0x2a8eac){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2a8eac);agiHandler(_0x2a8eac);}catch(_0x2f9c55){logger[_0xc4e7('0xd')](_0x2f9c55['stack']);}});});}function listeningHandler(){console['log'](_0xc4e7('0xe'),config[_0xc4e7('0x7')][_0xc4e7('0xf')]);logger[_0xc4e7('0x10')](util[_0xc4e7('0x11')](_0xc4e7('0x12'),config[_0xc4e7('0x7')]['ip'],config[_0xc4e7('0x7')][_0xc4e7('0xf')]));}function errorHandler(_0x838c60){if(_0x838c60&&_0x838c60[_0xc4e7('0x13')]&&_0x838c60[_0xc4e7('0x14')]){logger[_0xc4e7('0xd')](util[_0xc4e7('0x11')](_0xc4e7('0x15'),_0x838c60[_0xc4e7('0x13')],_0x838c60[_0xc4e7('0x14')]));}else{logger[_0xc4e7('0xd')](util['format'](_0xc4e7('0x16'),_0x838c60[_0xc4e7('0x17')]));}}function closeHandler(){logger['info'](util['format'](_0xc4e7('0x18'),this[_0xc4e7('0x19')],this[_0xc4e7('0x1a')],this['callerid'],this[_0xc4e7('0x1b')],this[_0xc4e7('0x1c')]));try{createSquareReport(this);}catch(_0x2f0adb){logger[_0xc4e7('0xd')](_0x2f0adb[_0xc4e7('0x17')]);}}function timeoutHandler(){logger[_0xc4e7('0x10')](util[_0xc4e7('0x11')](_0xc4e7('0x1d'),this[_0xc4e7('0x19')],this['calleridname'],this[_0xc4e7('0x1e')],this[_0xc4e7('0x1b')],this[_0xc4e7('0x1c')]));}function hangupHandler(){logger[_0xc4e7('0x10')](util[_0xc4e7('0x11')](_0xc4e7('0x1f'),this[_0xc4e7('0x19')],this['calleridname'],this[_0xc4e7('0x1e')],this[_0xc4e7('0x1b')],this[_0xc4e7('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x3661de){return parser[_0xc4e7('0x20')](_0x3661de,{'object':!![]})['mxGraphModel'][_0xc4e7('0x21')];}function addVertex(_0x56b0d6,_0x409c0f,_0x4530b7){_0x409c0f['agicommand']=_0x4530b7;if(_0x409c0f[_0xc4e7('0x22')]('retry')){_0x409c0f['maxRetry']=parseInt(_0x409c0f[_0xc4e7('0x23')],0xa);}_0x56b0d6[_0xc4e7('0x24')](_[_0xc4e7('0x25')](_0x409c0f,_0xc4e7('0x26')));}function initGraph(_0x2a4aa1,_0x5221aa){var _0x4f503f=new Graph();for(var _0x349340 in _0x2a4aa1){if(_0x2a4aa1['hasOwnProperty'](_0x349340)){if(_[_0xc4e7('0x27')](_0x2a4aa1[_0x349340])){for(var _0x1a6654=0x0;_0x1a6654<_0x2a4aa1[_0x349340]['length'];_0x1a6654+=0x1){addVertex(_0x4f503f,_0x2a4aa1[_0x349340][_0x1a6654],_0x349340);}}else{addVertex(_0x4f503f,_0x2a4aa1[_0x349340],_0x349340);}}}for(var _0x18e8b2=0x0;_0x18e8b2<_0x5221aa[_0xc4e7('0x28')];_0x18e8b2+=0x1){if(_0x5221aa[_0x18e8b2][_0xc4e7('0x29')]&&_0x5221aa[_0x18e8b2][_0xc4e7('0x2a')]){_0x4f503f[_0xc4e7('0x2b')](_0x5221aa[_0x18e8b2][_0xc4e7('0x29')],_0x5221aa[_0x18e8b2][_0xc4e7('0x2a')],_0x5221aa[_0x18e8b2][_0xc4e7('0x2c')]);}}return _0x4f503f;}function getSquareProject(_0x17c6e8,_0x359571){rpc[_0xc4e7('0x2d')](_0x17c6e8)[_0xc4e7('0x2e')](function(_0x3e33db){_0x359571(null,_0x3e33db);})['catch'](function(_0x29c9ce){_0x359571(null,_0x29c9ce);});}function createSquareReport(_0x5e460c,_0x5ec7fd){rpc[_0xc4e7('0x2f')](_0x5e460c)[_0xc4e7('0x2e')](function(_0x5a42ba){if(_0x5ec7fd){_0x5ec7fd(null,_0x5a42ba);}})[_0xc4e7('0x30')](function(_0x488235){if(_0x5ec7fd){_0x5ec7fd(null,_0x488235);}});}function setChannelVariables(_0xfb3aba){for(var _0x4c7575 in _0xfb3aba){if(_0xfb3aba[_0xc4e7('0x22')](_0x4c7575)){if(_0x4c7575[_0xc4e7('0x31')](_0xc4e7('0x32'))===0x0){_0xfb3aba[_0x4c7575[_0xc4e7('0x33')](0x4)]=_0xfb3aba[_0x4c7575];delete _0xfb3aba[_0x4c7575];}}}}function getLogFromObject(_0x48e3c3){return util[_0xc4e7('0x34')](_0x48e3c3,{'showHidden':![],'depth':null});}function agiHandler(_0x350455){var _0x5b9470,_0x2ec2f1,_0x4385c3,_0x4a21ca,_0x3d414d;logger['debug']('variables',JSON[_0xc4e7('0x35')](_0x350455,null,0x2));logger[_0xc4e7('0x10')](util[_0xc4e7('0x11')](_0xc4e7('0x36'),_0x350455[_0xc4e7('0x19')],_0x350455['calleridname'],_0x350455[_0xc4e7('0x1e')],_0x350455[_0xc4e7('0x1b')],_0x350455[_0xc4e7('0x1c')]));_0x350455['on'](_0xc4e7('0xd'),errorHandler);_0x350455['on'](_0xc4e7('0x37'),closeHandler);_0x350455['on'](_0xc4e7('0x38'),timeoutHandler);_0x350455[_0xc4e7('0x39')]=![];_0x350455['on'](_0xc4e7('0x3a'),hangupHandler);var _0xe77de0=getSquareProject[_0xc4e7('0x3b')](null,_0x350455['arg_1']);if(_0xe77de0){if(_0xe77de0[_0xc4e7('0x3c')]){_0x5b9470=getRoot(_0xe77de0[_0xc4e7('0x3c')]);if(_0x5b9470&&_0x5b9470[_0xc4e7('0x3d')]){logger['debug'](_0xc4e7('0x21'),JSON[_0xc4e7('0x35')](_0x5b9470,null,0x2));_0x350455[_0xc4e7('0x3e')]=moment()['format'](_0xc4e7('0x3f'));_0x2ec2f1=initGraph(_[_0xc4e7('0x25')](_0x5b9470,_0xc4e7('0x26')),_0x5b9470[_0xc4e7('0x26')]);_0x4385c3=new Vertices(_0x350455,rpc,mailRpc);logger[_0xc4e7('0x10')](util[_0xc4e7('0x11')](_0xc4e7('0x40'),_0x350455[_0xc4e7('0x19')],_0x350455[_0xc4e7('0x1a')],_0x350455[_0xc4e7('0x1e')],_0x350455[_0xc4e7('0x1b')],_0x350455['uniqueid']));_0x2ec2f1[_0xc4e7('0x41')](_0x5b9470[_0xc4e7('0x3d')]['id'],function(_0x453e6d){try{_0x453e6d=_0x4385c3['clear'](_0x453e6d);logger[_0xc4e7('0x42')](_0xc4e7('0x43'),JSON[_0xc4e7('0x35')](_0x453e6d,null,0x2));if(_0x453e6d[_0xc4e7('0x44')]==='gotoc'){logger[_0xc4e7('0x10')](_0xc4e7('0x45'));_0x350455[_0xc4e7('0x46')]=_0x453e6d[_0xc4e7('0x46')]||_0x350455[_0xc4e7('0x46')];_0x350455[_0xc4e7('0x47')]=_0x453e6d[_0xc4e7('0x47')];_0x350455['priority']=_0x453e6d['priority']?_0x453e6d[_0xc4e7('0x48')]-0x1:0x1;return null;}else if(_0x453e6d&&_0x4385c3[_0x453e6d[_0xc4e7('0x44')]]){_0x3d414d=_0x4385c3[_0x453e6d[_0xc4e7('0x44')]](_0x453e6d);logger['info']('response',JSON[_0xc4e7('0x35')](_0x3d414d,null,0x2));if(_0x3d414d&&_0x3d414d[_0xc4e7('0x49')]===AGI_CODE_SUCCESS&&_0x3d414d[_0xc4e7('0x4a')]!==AGI_RESULT_ERROR&&!_0x350455[_0xc4e7('0x39')]){logger[_0xc4e7('0x42')](_0xc4e7('0x4b'),getLogFromObject(_0x3d414d));return _[_0xc4e7('0x4c')](_0x3d414d['result'])?null:_0x3d414d[_0xc4e7('0x4a')][_0xc4e7('0x4d')]();}else{logger['error'](_0xc4e7('0x4b'),getLogFromObject(_0x3d414d));return null;}}else{logger[_0xc4e7('0xd')](_0xc4e7('0x4e'));return null;}}catch(_0x35ba7b){logger[_0xc4e7('0xd')](_0x35ba7b[_0xc4e7('0x17')]);return null;}});if(_0x5b9470[_0xc4e7('0x4f')]){logger['info'](util[_0xc4e7('0x11')](_0xc4e7('0x50'),_0x350455[_0xc4e7('0x19')],_0x350455[_0xc4e7('0x1a')],_0x350455['callerid'],_0x350455[_0xc4e7('0x1b')],_0x350455[_0xc4e7('0x1c')]));_0x2ec2f1[_0xc4e7('0x41')](_0x5b9470[_0xc4e7('0x4f')]['id'],function(_0x475181){try{_0x475181=_0x4385c3['clear'](_0x475181);logger[_0xc4e7('0x42')](_0xc4e7('0x43'),JSON[_0xc4e7('0x35')](_0x475181,null,0x2));if(_0x475181&&_0x4385c3[_0x475181[_0xc4e7('0x44')]]){_0x3d414d=_0x4385c3[_0x475181['agicommand']](_0x475181);if(_0x3d414d){logger['debug'](_0xc4e7('0x4b'),getLogFromObject(_0x3d414d));return _[_0xc4e7('0x4c')](_0x3d414d[_0xc4e7('0x4a')])?null:_0x3d414d[_0xc4e7('0x4a')][_0xc4e7('0x4d')]();}else{logger[_0xc4e7('0xd')]('response',getLogFromObject(_0x3d414d));return null;}}else{logger[_0xc4e7('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x42286b){logger['error'](_0x42286b['stack']);return null;}});}logger[_0xc4e7('0x10')](util['format'](_0xc4e7('0x51'),_0x350455[_0xc4e7('0x19')],_0x350455[_0xc4e7('0x1a')],_0x350455[_0xc4e7('0x1e')],_0x350455[_0xc4e7('0x1b')],_0x350455[_0xc4e7('0x1c')]));logger[_0xc4e7('0x10')](util[_0xc4e7('0x11')](_0xc4e7('0x52'),_0x350455[_0xc4e7('0x46')],_0x350455['extension'],parseInt(_0x350455[_0xc4e7('0x48')],0xa)+0x1));_0x350455['continueAt'](_0x350455[_0xc4e7('0x46')],_0x350455[_0xc4e7('0x47')],parseInt(_0x350455[_0xc4e7('0x48')],0xa)+0x1);_0x350455[_0xc4e7('0x37')]();}}else{logger[_0xc4e7('0xd')](util[_0xc4e7('0x11')]('Project\x20%s\x20not\x20published',_0x350455[_0xc4e7('0x19')]));_0x350455['continueAt'](_0x350455['context'],_0x350455[_0xc4e7('0x47')],parseInt(_0x350455[_0xc4e7('0x48')],0xa)+0x1);_0x350455['close']();}}else{logger[_0xc4e7('0xd')](util[_0xc4e7('0x11')]('Project\x20%s\x20not\x20found',_0x350455[_0xc4e7('0x19')]));_0x350455[_0xc4e7('0x53')](_0x350455['context'],_0x350455[_0xc4e7('0x47')],parseInt(_0x350455['priority'],0xa)+0x1);_0x350455[_0xc4e7('0x37')]();}}function main(){var _0x501470;return utilLicense[_0xc4e7('0x54')]()['then'](function(_0x182fa5){if(_0x182fa5){if(_0x182fa5[_0xc4e7('0x55')]){if(_0x182fa5['callysquare']&&_0x182fa5[_0xc4e7('0x56')]>0x0){logger[_0xc4e7('0x10')](util[_0xc4e7('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x182fa5[_0xc4e7('0x56')]));_0x501470=_0x182fa5['callysquare'];}else{logger['info'](_0xc4e7('0x57'));}}else{logger[_0xc4e7('0x10')](_0xc4e7('0x58'));_0x501470=-0x1;}}})[_0xc4e7('0x30')](function(_0x4bd37d){logger['error']('[LICENSE]',_0x4bd37d[_0xc4e7('0x17')]);})[_0xc4e7('0x4f')](function(){var _0x216e48=require('./server')(config['agi']['port'],config['agi']['ip'],_0x501470);_0x216e48['on']('error',errorHandler);_0x216e48['on'](_0xc4e7('0x59'),listeningHandler);_0x216e48['on'](_0xc4e7('0x5a'),connectionHandler);_0x216e48['on'](_0xc4e7('0x37'),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 64ab627..c78e2b5 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 _0x4908=['sendMailMessage','client','http','error','message','result'];(function(_0x36d7df,_0x2389ee){var _0x118497=function(_0x50c1fd){while(--_0x50c1fd){_0x36d7df['push'](_0x36d7df['shift']());}};_0x118497(++_0x2389ee);}(_0x4908,0xf1));var _0x8490=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x4908[_0x87b0ff];return _0x3bc0b2;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x8490('0x0')][_0x8490('0x1')]({'port':0x232b});function request(_0x4c372d,_0x1294e8){return new BPromise(function(_0x5071a0,_0x47f74d){return client['request'](_0x4c372d,_0x1294e8)['then'](function(_0x9fc798){if(_0x9fc798[_0x8490('0x2')]){return _0x47f74d(_0x9fc798[_0x8490('0x2')][_0x8490('0x3')]);}else{return _0x5071a0(_0x9fc798[_0x8490('0x4')]);}})['catch'](function(_0xeaf308){return _0x47f74d(_0xeaf308);});});}exports[_0x8490('0x5')]=function(_0x1ed3e7,_0x1773b0){return request('SendMail',{'account':_0x1ed3e7,'message':_0x1773b0});}; \ No newline at end of file +var _0x2f27=['http','then','error','message','result','catch','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x303e20,_0x4354c6){var _0x3270af=function(_0x4a3f65){while(--_0x4a3f65){_0x303e20['push'](_0x303e20['shift']());}};_0x3270af(++_0x4354c6);}(_0x2f27,0x9e));var _0x72f2=function(_0x5220b6,_0x48e653){_0x5220b6=_0x5220b6-0x0;var _0x5747c8=_0x2f27[_0x5220b6];return _0x5747c8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x72f2('0x0'));var client=jayson[_0x72f2('0x1')][_0x72f2('0x2')]({'port':0x232b});function request(_0x4dbfbf,_0x55c847){return new BPromise(function(_0x35d551,_0x1b720b){return client['request'](_0x4dbfbf,_0x55c847)[_0x72f2('0x3')](function(_0x399562){if(_0x399562[_0x72f2('0x4')]){return _0x1b720b(_0x399562['error'][_0x72f2('0x5')]);}else{return _0x35d551(_0x399562[_0x72f2('0x6')]);}})[_0x72f2('0x7')](function(_0x192dec){return _0x1b720b(_0x192dec);});});}exports[_0x72f2('0x8')]=function(_0xb76446,_0x1b2a15){return request(_0x72f2('0x9'),{'account':_0xb76446,'message':_0x1b2a15});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 5a0af4d..c1a8a02 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 _0xf3fb=['_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','slice','trim','emit','line','length','exports','util','Transform'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xf3fb,0x13e));var _0xbf3f=function(_0x316af7,_0x72e80c){_0x316af7=_0x316af7-0x0;var _0x286d96=_0xf3fb[_0x316af7];return _0x286d96;};'use strict';var util=require(_0xbf3f('0x0'));var Transform=require('stream')[_0xbf3f('0x1')];function AGIReply(_0x2203b9){Transform['call'](this,_0x2203b9);this[_0xbf3f('0x2')]='';this[_0xbf3f('0x3')]=![];}util[_0xbf3f('0x4')](AGIReply,Transform);AGIReply[_0xbf3f('0x5')]['_transform']=function(_0x3e8092,_0x4ed973,_0x449854){var _0x127480='\x0a',_0x32c52f=['\x0a\x0a',_0xbf3f('0x6')],_0x1d1f77=-0x1,_0x15eff2=-0x1,_0x45b37d='',_0x2a5f72=0x0,_0x50e6b9='',_0x35e6d1='';this['_localBuffer']+=_0x3e8092[_0xbf3f('0x7')]();_0x50e6b9=this[_0xbf3f('0x2')];if(!this[_0xbf3f('0x3')]){_0x2a5f72=0x0;while(_0x32c52f[_0x2a5f72]){while((_0x15eff2=_0x50e6b9[_0xbf3f('0x8')](_0x32c52f[_0x2a5f72]))!=-0x1){_0x45b37d=_0x32c52f[_0x2a5f72];_0x35e6d1=_0x50e6b9[_0xbf3f('0x9')](0x0,_0x15eff2);_0x50e6b9=_0x50e6b9[_0xbf3f('0x9')](_0x15eff2+_0x45b37d['length']);var _0x536c64=_0x35e6d1['split'](_0x127480),_0x25feb4=0x0,_0x14b1fa={},_0x49f6ae='',_0x1c8870='',_0x9360da=-0x1;while(_0x536c64[_0x25feb4]){_0x9360da=_0x536c64[_0x25feb4][_0xbf3f('0x8')](':');if(_0x9360da!=-0x1){_0x49f6ae=_0x536c64[_0x25feb4][_0xbf3f('0xa')](0x0,_0x9360da)[_0xbf3f('0xb')]();_0x1c8870=_0x536c64[_0x25feb4][_0xbf3f('0xa')](_0x9360da+0x1)[_0xbf3f('0xb')]();if(_0x49f6ae['length']>0x0){_0x14b1fa[_0x49f6ae]=_0x1c8870;}}else{}_0x25feb4++;}this['emit']('headers',_0x14b1fa);this[_0xbf3f('0x3')]=!![];}_0x2a5f72++;}this[_0xbf3f('0x2')]=_0x50e6b9;}else{while((_0x1d1f77=_0x50e6b9[_0xbf3f('0x8')](_0x127480))!=-0x1){_0x35e6d1=_0x50e6b9[_0xbf3f('0x9')](0x0,_0x1d1f77);this[_0xbf3f('0xc')](_0xbf3f('0xd'),_0x35e6d1);_0x50e6b9=_0x50e6b9['substring'](_0x1d1f77+_0x127480[_0xbf3f('0xe')]);}this[_0xbf3f('0x2')]=_0x50e6b9;}_0x449854();};module[_0xbf3f('0xf')]=AGIReply; \ No newline at end of file +var _0x2a30=['Transform','call','_inBody','inherits','prototype','_localBuffer','toString','substring','length','split','indexOf','slice','trim','emit','headers','line','exports','util','stream'];(function(_0xd67fbc,_0x4a8a3d){var _0x14e209=function(_0x378fa3){while(--_0x378fa3){_0xd67fbc['push'](_0xd67fbc['shift']());}};_0x14e209(++_0x4a8a3d);}(_0x2a30,0x1a0));var _0x02a3=function(_0x4da26c,_0x40b2cf){_0x4da26c=_0x4da26c-0x0;var _0x42c4ef=_0x2a30[_0x4da26c];return _0x42c4ef;};'use strict';var util=require(_0x02a3('0x0'));var Transform=require(_0x02a3('0x1'))[_0x02a3('0x2')];function AGIReply(_0x375430){Transform[_0x02a3('0x3')](this,_0x375430);this['_localBuffer']='';this[_0x02a3('0x4')]=![];}util[_0x02a3('0x5')](AGIReply,Transform);AGIReply[_0x02a3('0x6')]['_transform']=function(_0xaf7643,_0x33f7bb,_0xa91bc4){var _0x57dbe5='\x0a',_0x15696a=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x3b18d9=-0x1,_0x39a611=-0x1,_0x1e3b19='',_0x2a8185=0x0,_0x5c0773='',_0x54f481='';this[_0x02a3('0x7')]+=_0xaf7643[_0x02a3('0x8')]();_0x5c0773=this[_0x02a3('0x7')];if(!this[_0x02a3('0x4')]){_0x2a8185=0x0;while(_0x15696a[_0x2a8185]){while((_0x39a611=_0x5c0773['indexOf'](_0x15696a[_0x2a8185]))!=-0x1){_0x1e3b19=_0x15696a[_0x2a8185];_0x54f481=_0x5c0773[_0x02a3('0x9')](0x0,_0x39a611);_0x5c0773=_0x5c0773[_0x02a3('0x9')](_0x39a611+_0x1e3b19[_0x02a3('0xa')]);var _0x596664=_0x54f481[_0x02a3('0xb')](_0x57dbe5),_0x2e9787=0x0,_0x159899={},_0xbc6d25='',_0x9aef2b='',_0x50c048=-0x1;while(_0x596664[_0x2e9787]){_0x50c048=_0x596664[_0x2e9787][_0x02a3('0xc')](':');if(_0x50c048!=-0x1){_0xbc6d25=_0x596664[_0x2e9787][_0x02a3('0xd')](0x0,_0x50c048)[_0x02a3('0xe')]();_0x9aef2b=_0x596664[_0x2e9787][_0x02a3('0xd')](_0x50c048+0x1)[_0x02a3('0xe')]();if(_0xbc6d25['length']>0x0){_0x159899[_0xbc6d25]=_0x9aef2b;}}else{}_0x2e9787++;}this[_0x02a3('0xf')](_0x02a3('0x10'),_0x159899);this[_0x02a3('0x4')]=!![];}_0x2a8185++;}this[_0x02a3('0x7')]=_0x5c0773;}else{while((_0x3b18d9=_0x5c0773[_0x02a3('0xc')](_0x57dbe5))!=-0x1){_0x54f481=_0x5c0773['substring'](0x0,_0x3b18d9);this[_0x02a3('0xf')](_0x02a3('0x11'),_0x54f481);_0x5c0773=_0x5c0773[_0x02a3('0x9')](_0x3b18d9+_0x57dbe5[_0x02a3('0xa')]);}this[_0x02a3('0x7')]=_0x5c0773;}_0xa91bc4();};module[_0x02a3('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 103adda..2005022 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 _0x953d=['getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','moment','lodash','util','client','http','then','error','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone'];(function(_0x345faa,_0x47255f){var _0x1d4039=function(_0x1075cb){while(--_0x1075cb){_0x345faa['push'](_0x345faa['shift']());}};_0x1d4039(++_0x47255f);}(_0x953d,0x93));var _0xd953=function(_0x4343c6,_0xe154c3){_0x4343c6=_0x4343c6-0x0;var _0x18c217=_0x953d[_0x4343c6];return _0x18c217;};'use strict';var BPromise=require('bluebird');var moment=require(_0xd953('0x0'));var _=require(_0xd953('0x1'));var util=require(_0xd953('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xd953('0x3')][_0xd953('0x4')]({'port':0x2329});function request(_0x402937,_0x2cc30b){return new BPromise(function(_0x297110,_0x429355){return client['request'](_0x402937,_0x2cc30b)[_0xd953('0x5')](function(_0x4d4247){if(_0x4d4247[_0xd953('0x6')]){return _0x429355(_0x4d4247['error']['message']);}else{return _0x297110(_0x4d4247['result']);}})['catch'](function(_0x4675f5){return _0x429355(_0x4675f5);});});}exports['getSquareProjects']=function(){return request(_0xd953('0x7'),{'options':{'raw':![],'attributes':['id',_0xd953('0x8'),_0xd953('0x9')]}});};exports[_0xd953('0xa')]=function(_0x251cd7){return request(_0xd953('0xb'),{'options':{'raw':![],'where':{'name':_0x251cd7},'attributes':['production']}});};exports[_0xd953('0xc')]=function(_0x2aaebf){return request(_0xd953('0xd'),{'options':{'raw':![],'where':{'id':_0x2aaebf},'include':[{'model':_0xd953('0xe'),'as':_0xd953('0xf'),'include':[{'model':_0xd953('0x10'),'as':_0xd953('0x10')}]}],'attributes':['id',_0xd953('0x8'),_0xd953('0x11')],'smtp':!![]}});};exports[_0xd953('0x12')]=function(_0x543b65){return request(_0xd953('0xb'),{'options':{'where':{'id':_0x543b65},'attributes':['name']}});};exports[_0xd953('0x13')]=function(_0x1dfdcf){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1dfdcf},'attributes':[_0xd953('0x8')]}});};exports[_0xd953('0x14')]=function(_0x16626d){return request(_0xd953('0x15'),{'options':{'where':{'id':_0x16626d},'attributes':[_0xd953('0x8')]}});};exports['getSquareOdbcById']=function(_0x5268d6){return request(_0xd953('0x16'),{'options':{'where':{'id':_0x5268d6},'attributes':[_0xd953('0x17')]}});};exports[_0xd953('0x18')]=function(_0x2e6e21){return request(_0xd953('0x19'),{'options':{'where':{'id':_0x2e6e21},'attributes':['name']}});};exports['getContactByPhone']=function(_0xe2825){return request(_0xd953('0x1a'),{'options':{'where':{'phone':_0xe2825['phone']},'attributes':['id']}});};exports[_0xd953('0x1b')]=function(_0x33b4ed){return request(_0xd953('0x1c'),{'options':{'where':{'id':_0x33b4ed},'attributes':['name']}});};exports[_0xd953('0x1d')]=function(_0x50d266){return request(_0xd953('0x1e'),{'options':{'where':{'id':_0x50d266},'attributes':[_0xd953('0x1f')]}});};exports[_0xd953('0x20')]=function(_0x53aee5){return request(_0xd953('0x21'),{'options':{'raw':![],'where':{'id':_0x53aee5},'include':[{'model':'Interval','as':_0xd953('0x22')}]}});};exports['getSmsAccountById']=function(_0x381639){return request(_0xd953('0x23'),{'options':{'where':{'id':_0x381639},'attributes':['id','name']}});};exports[_0xd953('0x24')]=function(_0x2bd319){return request('CreateSmsMessage',{'body':_0x2bd319});};exports[_0xd953('0x25')]=function(_0x5a9411){return request('CreateSquareDetailsReport',{'body':_0x5a9411});};exports[_0xd953('0x26')]=function(_0x2d51b7){return request(_0xd953('0x27'),{'body':_[_0xd953('0x28')](_0x2d51b7,{'project_name':_0x2d51b7[_0xd953('0x29')],'prev_project_name':_0x2d51b7[_0xd953('0x2a')]||'','is_subproject':_0x2d51b7[_0xd953('0x2a')]?!![]:![],'leaveAt':moment()[_0xd953('0x2b')](_0xd953('0x2c'))})});};exports[_0xd953('0x2d')]=function(_0xa5325a){return request('CreateSquareRecording',{'body':_0xa5325a});};exports[_0xd953('0x2e')]=function(_0x46df43){return request(_0xd953('0x2f'),{'body':_0x46df43});};exports[_0xd953('0x30')]=function(_0x42a11a){return request(_0xd953('0x31'),{'options':{'raw':![],'where':{'phone':_0x42a11a[_0xd953('0x32')],'ListId':_0x42a11a[_0xd953('0x33')]}}})[_0xd953('0x5')](function(_0x54980b){if(_0x54980b){return _0x54980b;}return request(_0xd953('0x34'),{'body':_0x42a11a});});};exports['getPauseById']=function(_0x355410){return request('ShowPause',{'options':{'where':{'id':_0x355410},'attributes':[_0xd953('0x8')]}});};exports['agentLogin']=function(_0x59f5bb,_0x176a47){return request('LoginUser',{'body':{'interface':_0x176a47},'options':{'where':_0x59f5bb}});};exports[_0xd953('0x35')]=function(_0x18ec35,_0x46f438,_0x5b281a){return request(_0xd953('0x36'),{'body':{'type':_0x46f438,'uniqueid':_0x5b281a},'options':{'where':_0x18ec35}});};exports[_0xd953('0x37')]=function(_0x25537f){return request(_0xd953('0x38'),{'body':{},'options':{'where':_0x25537f}});};exports['agentLogout']=function(_0x2ca758){return request(_0xd953('0x39'),{'body':{},'options':{'where':_0x2ca758}});}; \ No newline at end of file +var _0x6d9b=['CreateSquareDetailsReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','getPauseById','agentLogin','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','name','production','getSquareProject','getMailAccountById','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x6d9b,0x1ae));var _0xb6d9=function(_0x17a69a,_0x1dd968){_0x17a69a=_0x17a69a-0x0;var _0x5a5637=_0x6d9b[_0x17a69a];return _0x5a5637;};'use strict';var BPromise=require(_0xb6d9('0x0'));var moment=require(_0xb6d9('0x1'));var _=require(_0xb6d9('0x2'));var util=require(_0xb6d9('0x3'));var jayson=require(_0xb6d9('0x4'));var client=jayson[_0xb6d9('0x5')][_0xb6d9('0x6')]({'port':0x2329});function request(_0x41d2de,_0x1e9e18){return new BPromise(function(_0xc7e95a,_0x416364){return client[_0xb6d9('0x7')](_0x41d2de,_0x1e9e18)[_0xb6d9('0x8')](function(_0x5c2708){if(_0x5c2708[_0xb6d9('0x9')]){return _0x416364(_0x5c2708[_0xb6d9('0x9')][_0xb6d9('0xa')]);}else{return _0xc7e95a(_0x5c2708[_0xb6d9('0xb')]);}})[_0xb6d9('0xc')](function(_0x18a4a0){return _0x416364(_0x18a4a0);});});}exports['getSquareProjects']=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xb6d9('0xd'),_0xb6d9('0xe')]}});};exports[_0xb6d9('0xf')]=function(_0xf217f4){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xf217f4},'attributes':[_0xb6d9('0xe')]}});};exports[_0xb6d9('0x10')]=function(_0x4a397f){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4a397f},'include':[{'model':'MailServerOut','as':_0xb6d9('0x11'),'include':[{'model':_0xb6d9('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0xb6d9('0xd'),_0xb6d9('0x13')],'smtp':!![]}});};exports[_0xb6d9('0x14')]=function(_0x400b13){return request('ShowSquareProject',{'options':{'where':{'id':_0x400b13},'attributes':[_0xb6d9('0xd')]}});};exports[_0xb6d9('0x15')]=function(_0x200cbb){return request(_0xb6d9('0x16'),{'options':{'where':{'id':_0x200cbb},'attributes':[_0xb6d9('0xd')]}});};exports[_0xb6d9('0x17')]=function(_0x53b677){return request(_0xb6d9('0x18'),{'options':{'where':{'id':_0x53b677},'attributes':[_0xb6d9('0xd')]}});};exports['getSquareOdbcById']=function(_0x225140){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x225140},'attributes':[_0xb6d9('0x19')]}});};exports[_0xb6d9('0x1a')]=function(_0x438e57){return request(_0xb6d9('0x1b'),{'options':{'where':{'id':_0x438e57},'attributes':[_0xb6d9('0xd')]}});};exports[_0xb6d9('0x1c')]=function(_0xaaffc2){return request(_0xb6d9('0x1d'),{'options':{'where':{'phone':_0xaaffc2[_0xb6d9('0x1e')]},'attributes':['id']}});};exports[_0xb6d9('0x1f')]=function(_0x488904){return request(_0xb6d9('0x20'),{'options':{'where':{'id':_0x488904},'attributes':[_0xb6d9('0xd')]}});};exports[_0xb6d9('0x21')]=function(_0x177df6){return request(_0xb6d9('0x22'),{'options':{'where':{'id':_0x177df6},'attributes':[_0xb6d9('0x23')]}});};exports['getIntervalById']=function(_0xcb9f5a){return request(_0xb6d9('0x24'),{'options':{'raw':![],'where':{'id':_0xcb9f5a},'include':[{'model':'Interval','as':_0xb6d9('0x25')}]}});};exports[_0xb6d9('0x26')]=function(_0x507704){return request('ShowSmsAccount',{'options':{'where':{'id':_0x507704},'attributes':['id',_0xb6d9('0xd')]}});};exports[_0xb6d9('0x27')]=function(_0x2c2779){return request(_0xb6d9('0x28'),{'body':_0x2c2779});};exports[_0xb6d9('0x29')]=function(_0x1f7d83){return request(_0xb6d9('0x2a'),{'body':_0x1f7d83});};exports['createSquareReport']=function(_0x1acb85){return request('CreateSquareReport',{'body':_[_0xb6d9('0x2b')](_0x1acb85,{'project_name':_0x1acb85['arg_1'],'prev_project_name':_0x1acb85[_0xb6d9('0x2c')]||'','is_subproject':_0x1acb85['arg_2']?!![]:![],'leaveAt':moment()['format'](_0xb6d9('0x2d'))})});};exports[_0xb6d9('0x2e')]=function(_0x146553){return request(_0xb6d9('0x2f'),{'body':_0x146553});};exports[_0xb6d9('0x30')]=function(_0x5b35dd){return request(_0xb6d9('0x31'),{'body':_0x5b35dd});};exports[_0xb6d9('0x32')]=function(_0x489d01){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x489d01[_0xb6d9('0x1e')],'ListId':_0x489d01[_0xb6d9('0x33')]}}})[_0xb6d9('0x8')](function(_0x51e737){if(_0x51e737){return _0x51e737;}return request(_0xb6d9('0x34'),{'body':_0x489d01});});};exports[_0xb6d9('0x35')]=function(_0x10dca5){return request('ShowPause',{'options':{'where':{'id':_0x10dca5},'attributes':[_0xb6d9('0xd')]}});};exports[_0xb6d9('0x36')]=function(_0x4c88f6,_0x4d6469){return request('LoginUser',{'body':{'interface':_0x4d6469},'options':{'where':_0x4c88f6}});};exports[_0xb6d9('0x37')]=function(_0xe56d73,_0xc40b7c,_0x14f8b5){return request(_0xb6d9('0x38'),{'body':{'type':_0xc40b7c,'uniqueid':_0x14f8b5},'options':{'where':_0xe56d73}});};exports[_0xb6d9('0x39')]=function(_0x4d65bf){return request('UnpauseUser',{'body':{},'options':{'where':_0x4d65bf}});};exports[_0xb6d9('0x3a')]=function(_0x31bfdf){return request('LogoutUser',{'body':{},'options':{'where':_0x31bfdf}});}; \ 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 32deff3..7a05e34 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 _0xa0a1=['exports','./polly'];(function(_0x145d8f,_0x2f733f){var _0x2d67e7=function(_0x2f8d14){while(--_0x2f8d14){_0x145d8f['push'](_0x145d8f['shift']());}};_0x2d67e7(++_0x2f733f);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x1bad96,_0x214775){_0x1bad96=_0x1bad96-0x0;var _0x4565f0=_0xa0a1[_0x1bad96];return _0x4565f0;};var polly=require(_0x1a0a('0x0'));var lex=require('./lex');module[_0x1a0a('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6afc=['exports','./polly'];(function(_0x28bbf4,_0x36de5b){var _0x598da3=function(_0x311661){while(--_0x311661){_0x28bbf4['push'](_0x28bbf4['shift']());}};_0x598da3(++_0x36de5b);}(_0x6afc,0x16b));var _0xc6af=function(_0xe1ada6,_0x1554a5){_0xe1ada6=_0xe1ada6-0x0;var _0x58a54e=_0x6afc[_0xe1ada6];return _0x58a54e;};var polly=require(_0xc6af('0x0'));var lex=require('./lex');module[_0xc6af('0x1')]={'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 c38c13e..d404d12 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 _0x2dae=['./lib/api'];(function(_0x8be0a2,_0x512357){var _0x1c4eff=function(_0xf832be){while(--_0xf832be){_0x8be0a2['push'](_0x8be0a2['shift']());}};_0x1c4eff(++_0x512357);}(_0x2dae,0xc3));var _0xe2da=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x2dae[_0x29a29f];return _0x443ea3;};'use strict';var lex=require(_0xe2da('0x0'));module['exports']=function(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97){return lex(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97);}; \ No newline at end of file +var _0x9c00=['./lib/api','exports'];(function(_0x50ae21,_0x8442cd){var _0x1f6f90=function(_0x4ea8f6){while(--_0x4ea8f6){_0x50ae21['push'](_0x50ae21['shift']());}};_0x1f6f90(++_0x8442cd);}(_0x9c00,0x1a0));var _0x09c0=function(_0x1de2bd,_0x953fb){_0x1de2bd=_0x1de2bd-0x0;var _0x595960=_0x9c00[_0x1de2bd];return _0x595960;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);}; \ 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 59aeea0..6d9c49b 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(_0x2a7a73,_0x865e7f){var _0x396969=function(_0x4c2614){while(--_0x4c2614){_0x2a7a73['push'](_0x2a7a73['shift']());}};_0x396969(++_0x865e7f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0xa99578,_0x2b786c){var _0x1a2571=function(_0x1d008b){while(--_0x1d008b){_0xa99578['push'](_0xa99578['shift']());}};_0x1a2571(++_0x2b786c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 cfde26c..210ad78 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 _0x1416=['exports','./lib/api'];(function(_0x43f9bd,_0xb7e66b){var _0x24617c=function(_0x4a99a2){while(--_0x4a99a2){_0x43f9bd['push'](_0x43f9bd['shift']());}};_0x24617c(++_0xb7e66b);}(_0x1416,0x16f));var _0x6141=function(_0x1e39ae,_0x5aac4c){_0x1e39ae=_0x1e39ae-0x0;var _0x2f31ad=_0x1416[_0x1e39ae];return _0x2f31ad;};'use strict';var polly=require(_0x6141('0x0'));module[_0x6141('0x1')]=function(_0x4223fd,_0x4d072f,_0x75f9e6,_0x20d371,_0x269bcf,_0x20730f,_0x1ae672){return polly(_0x4223fd,_0x4d072f,_0x75f9e6,_0x20d371,_0x269bcf,_0x20730f,_0x1ae672);}; \ No newline at end of file +var _0xa71b=['exports','./lib/api'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0xa71b,0x165));var _0xba71=function(_0x251569,_0x19167d){_0x251569=_0x251569-0x0;var _0x593b94=_0xa71b[_0x251569];return _0x593b94;};'use strict';var polly=require(_0xba71('0x0'));module[_0xba71('0x1')]=function(_0x4d710a,_0x38af8c,_0x23a2c2,_0x59fe02,_0x592d1e,_0x2125ee,_0x4a779e){return polly(_0x4d710a,_0x38af8c,_0x23a2c2,_0x59fe02,_0x592d1e,_0x2125ee,_0x4a779e);}; \ 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 d79763c..c0e0fae 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 _0xd705=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','bluebird','aws-sdk'];(function(_0x3a721e,_0x1cb998){var _0x54b5d=function(_0x3c43e4){while(--_0x3c43e4){_0x3a721e['push'](_0x3a721e['shift']());}};_0x54b5d(++_0x1cb998);}(_0xd705,0x9e));var _0x5d70=function(_0x51e082,_0x3d1b01){_0x51e082=_0x51e082-0x0;var _0x2f468f=_0xd705[_0x51e082];return _0x2f468f;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x5d70('0x0'));var rs=require('randomstring');var AWS=require(_0x5d70('0x1'));function pollyResult(_0x3b3823,_0x1296be,_0x3a9bd9){return new BPromise(function(_0x4be2a9,_0x2dd4ce){_0x3b3823[_0x5d70('0x2')](_0x1296be,function(_0x191928,_0x2d72e5){if(_0x191928){_0x2dd4ce(_0x191928);}else if(_0x2d72e5){if(_0x2d72e5[_0x5d70('0x3')]instanceof Buffer){fs[_0x5d70('0x4')](_0x3a9bd9,_0x2d72e5['AudioStream'],function(_0x235224){if(_0x235224){_0x2dd4ce(_0x235224);}else{_0x4be2a9();}});}else{_0x2dd4ce(new Error(_0x5d70('0x5')));}}else{_0x2dd4ce(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x415bc4,_0x13339f,_0x4ec573,_0x182390,_0x3500bf,_0x6fa2de,_0x252e83){var _0x2cfcc0=new AWS['Polly']({'accessKeyId':_0x415bc4,'secretAccessKey':_0x13339f,'region':_0x4ec573});var _0x476c12={'Text':_0x3500bf,'TextType':_0x6fa2de||_0x5d70('0x6'),'OutputFormat':_0x5d70('0x7'),'VoiceId':_0x182390};return pollyResult(_0x2cfcc0,_0x476c12,_0x252e83);}; \ No newline at end of file +var _0xe27c=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird','AudioStream'];(function(_0x2a2392,_0x44365f){var _0x39ac7f=function(_0x1d9b0e){while(--_0x1d9b0e){_0x2a2392['push'](_0x2a2392['shift']());}};_0x39ac7f(++_0x44365f);}(_0xe27c,0x85));var _0xce27=function(_0x21dd32,_0x2e8131){_0x21dd32=_0x21dd32-0x0;var _0x246494=_0xe27c[_0x21dd32];return _0x246494;};'use strict';var fs=require('fs');var path=require(_0xce27('0x0'));var BPromise=require(_0xce27('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x3e76ab,_0x1f93a5,_0x2919a4){return new BPromise(function(_0x5138d7,_0x4b529d){_0x3e76ab['synthesizeSpeech'](_0x1f93a5,function(_0x27f6fa,_0x55d268){if(_0x27f6fa){_0x4b529d(_0x27f6fa);}else if(_0x55d268){if(_0x55d268[_0xce27('0x2')]instanceof Buffer){fs[_0xce27('0x3')](_0x2919a4,_0x55d268[_0xce27('0x2')],function(_0x472b8f){if(_0x472b8f){_0x4b529d(_0x472b8f);}else{_0x5138d7();}});}else{_0x4b529d(new Error(_0xce27('0x4')));}}else{_0x4b529d(new Error(_0xce27('0x5')));}});});}module[_0xce27('0x6')]=function(_0x5973dd,_0x3c9434,_0x485a28,_0x430c3b,_0x46b03b,_0xb0f5ad,_0x1c8369){var _0x207dc6=new AWS['Polly']({'accessKeyId':_0x5973dd,'secretAccessKey':_0x3c9434,'region':_0x485a28});var _0x2ef951={'Text':_0x46b03b,'TextType':_0xb0f5ad||_0xce27('0x7'),'OutputFormat':'mp3','VoiceId':_0x430c3b};return pollyResult(_0x207dc6,_0x2ef951,_0x1c8369);}; \ 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 0a94c11..2e8ac16 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 _0x33ff=['exports','./lib/api'];(function(_0x3fe440,_0x18d0cb){var _0x30cf95=function(_0x1f7af5){while(--_0x1f7af5){_0x3fe440['push'](_0x3fe440['shift']());}};_0x30cf95(++_0x18d0cb);}(_0x33ff,0x16f));var _0xf33f=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x33ff[_0x3cfb0d];return _0x3486b4;};'use strict';var asr=require(_0xf33f('0x0'));module[_0xf33f('0x1')]=function(_0x301e11,_0x52bed3,_0x5dbd46,_0x371fe0){return asr(_0x301e11,_0x52bed3,_0x5dbd46);}; \ No newline at end of file +var _0xf02a=['./lib/api','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf02a,0x1c0));var _0xaf02=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0xf02a[_0x1cd674];return _0x27928f;};'use strict';var asr=require(_0xaf02('0x0'));module[_0xaf02('0x1')]=function(_0x45dcaf,_0x3eb30c,_0x37cd1f,_0x2eee31){return asr(_0x45dcaf,_0x3eb30c,_0x37cd1f);}; \ 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 bd8229a..7e5c25c 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 _0x4fef=['exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','url','bluebird'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4fef,0x10f));var _0xf4fe=function(_0x55339f,_0x54bedc){_0x55339f=_0x55339f-0x0;var _0x47defb=_0x4fef[_0x55339f];return _0x47defb;};'use strict';var url=require(_0xf4fe('0x0'));var BPromise=require(_0xf4fe('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xf4fe('0x2')]=function(_0x5a2bd0,_0x40f4b2,_0x14bf18){return new BPromise(function(_0x3c78db,_0x1e5ec2){var _0x5c5dbb;if(typeof _0x5a2bd0!==_0xf4fe('0x3')||_0x5a2bd0[_0xf4fe('0x4')]===0x0){return _0x1e5ec2(_0xf4fe('0x5'));}if(typeof _0x40f4b2!=='string'||_0x40f4b2[_0xf4fe('0x4')]===0x0){return _0x1e5ec2(_0xf4fe('0x6'));}if(typeof _0x14bf18!=='undefined'&&(typeof _0x14bf18!==_0xf4fe('0x3')||_0x14bf18[_0xf4fe('0x4')]===0x0)){return _0x1e5ec2(_0xf4fe('0x7'));}try{_0x5c5dbb=fs[_0xf4fe('0x8')](_0x5a2bd0)[_0xf4fe('0x9')](_0xf4fe('0xa'));}catch(_0x42da04){return _0x1e5ec2(_0x42da04);}return _0x3c78db({'method':_0xf4fe('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x40f4b2,'body':{'config':{'encoding':_0xf4fe('0xc'),'sampleRateHertz':'8000','languageCode':_0x14bf18},'audio':{'content':_0x5c5dbb}},'json':!![]});});}; \ No newline at end of file +var _0xc112=['https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc112,0xec));var _0x2c11=function(_0x281f3b,_0x2c741c){_0x281f3b=_0x281f3b-0x0;var _0x4b0f80=_0xc112[_0x281f3b];return _0x4b0f80;};'use strict';var url=require(_0x2c11('0x0'));var BPromise=require(_0x2c11('0x1'));var fs=require('fs');var host=_0x2c11('0x2');module['exports']=function(_0x8542d8,_0x40da2e,_0x26e2a3){return new BPromise(function(_0x170832,_0xaa8492){var _0x3a1cda;if(typeof _0x8542d8!==_0x2c11('0x3')||_0x8542d8[_0x2c11('0x4')]===0x0){return _0xaa8492(_0x2c11('0x5'));}if(typeof _0x40da2e!=='string'||_0x40da2e['length']===0x0){return _0xaa8492(_0x2c11('0x6'));}if(typeof _0x26e2a3!==_0x2c11('0x7')&&(typeof _0x26e2a3!==_0x2c11('0x3')||_0x26e2a3[_0x2c11('0x4')]===0x0)){return _0xaa8492('lang\x20should\x20be\x20a\x20string');}try{_0x3a1cda=fs[_0x2c11('0x8')](_0x8542d8)[_0x2c11('0x9')]('base64');}catch(_0xa32d3f){return _0xaa8492(_0xa32d3f);}return _0x170832({'method':_0x2c11('0xa'),'uri':host+_0x2c11('0xb')+_0x40da2e,'body':{'config':{'encoding':_0x2c11('0xc'),'sampleRateHertz':_0x2c11('0xd'),'languageCode':_0x26e2a3},'audio':{'content':_0x3a1cda}},'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 aeec795..c482b12 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 _0x5182=['exports','./asr'];(function(_0x45bc05,_0x4c67d6){var _0x3f8656=function(_0x294dbd){while(--_0x294dbd){_0x45bc05['push'](_0x45bc05['shift']());}};_0x3f8656(++_0x4c67d6);}(_0x5182,0xe5));var _0x2518=function(_0x541a78,_0x219591){_0x541a78=_0x541a78-0x0;var _0x3107f3=_0x5182[_0x541a78];return _0x3107f3;};var asr=require(_0x2518('0x0'));module[_0x2518('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2c1f=['./asr','exports'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x2c1f,0x130));var _0xf2c1=function(_0x2de017,_0x450bf5){_0x2de017=_0x2de017-0x0;var _0x517506=_0x2c1f[_0x2de017];return _0x517506;};var asr=require(_0xf2c1('0x0'));module[_0xf2c1('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 042c09c..a1a2459 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 _0x8f44=['WHAT_EVER','request\x20to\x20','data','transcode','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','split','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','googleTTS','utf8','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','action','fulfillment','speech','score','status','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','randomstring','sox','url','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','get','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','error','download\x20error','pipe','end'];(function(_0x7f7ccc,_0x16ed9a){var _0x5f051d=function(_0x3e83e3){while(--_0x3e83e3){_0x7f7ccc['push'](_0x7f7ccc['shift']());}};_0x5f051d(++_0x16ed9a);}(_0x8f44,0x17a));var _0x48f4=function(_0x16a5bf,_0x132451){_0x16a5bf=_0x16a5bf-0x0;var _0x34c6a7=_0x8f44[_0x16a5bf];return _0x34c6a7;};'use strict';var apiai=require(_0x48f4('0x0'));var BPromise=require(_0x48f4('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x48f4('0x2'));var https=require(_0x48f4('0x3'));var md5=require(_0x48f4('0x4'));var path=require(_0x48f4('0x5'));var querystring=require(_0x48f4('0x6'));var rp=require('request-promise');var rs=require(_0x48f4('0x7'));var sox=require(_0x48f4('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x48f4('0x9'))[_0x48f4('0xa')];var util=require(_0x48f4('0xb'));var aws=require('./aws');var google=require(_0x48f4('0xc'));var sestek=require(_0x48f4('0xd'));var tilde=require(_0x48f4('0xe'));var logger=require(_0x48f4('0xf'))(_0x48f4('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x4cd135,_0x21915e){return new BPromise(function(_0x3ba34c,_0x5530f7){var _0x549fca=urlParse(_0x4cd135);var _0x2bef52=_0x549fca[_0x48f4('0x11')]===_0x48f4('0x12')?https:http;var _0x565643={'host':_0x549fca[_0x48f4('0x13')],'path':_0x549fca[_0x48f4('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x2bef52[_0x48f4('0x14')](_0x565643,function(_0x584d44){if(_0x584d44['statusCode']!==0xc8){logger['error']('request\x20to\x20'+_0x4cd135+'\x20failed,\x20status\x20code\x20=\x20'+_0x584d44[_0x48f4('0x15')]+'\x20('+_0x584d44[_0x48f4('0x16')]+')');_0x5530f7(new Error('request\x20to\x20'+_0x4cd135+_0x48f4('0x17')+_0x584d44[_0x48f4('0x15')]+'\x20('+_0x584d44[_0x48f4('0x16')]+')'));return;}var _0x51d973=fs[_0x48f4('0x18')](_0x21915e);_0x51d973['on'](_0x48f4('0x19'),function(){logger[_0x48f4('0x1a')](_0x48f4('0x1b'));_0x51d973[_0x48f4('0x1c')](_0x3ba34c);});_0x51d973['on'](_0x48f4('0x1d'),function(_0x16256c){fs['unlink'](_0x21915e);logger[_0x48f4('0x1d')](_0x48f4('0x1e'),_0x16256c);_0x5530f7(_0x16256c);});_0x584d44[_0x48f4('0x1f')](_0x51d973);})['on'](_0x48f4('0x1d'),function(_0x2405cd){logger[_0x48f4('0x1d')](_0x2405cd);_0x5530f7(_0x2405cd);})[_0x48f4('0x20')]();});}function uploadFile(_0x31af76){return new BPromise(function(_0x49ab38,_0x5e8289){var _0x4a56a9=urlParse(_0x31af76);var _0x2e0b63=_0x4a56a9['protocol']===_0x48f4('0x12')?https:http;var _0x1e9a6c={'host':_0x4a56a9['host'],'path':_0x4a56a9[_0x48f4('0x5')],'headers':{'user-agent':_0x48f4('0x21')}};_0x2e0b63[_0x48f4('0x14')](_0x1e9a6c,function(_0x4f9835){if(_0x4f9835[_0x48f4('0x15')]!==0xc8){_0x5e8289(new Error(_0x48f4('0x22')+_0x31af76+_0x48f4('0x17')+_0x4f9835[_0x48f4('0x15')]+'\x20('+_0x4f9835[_0x48f4('0x16')]+')'));return;}var _0x55a770='';_0x4f9835['on'](_0x48f4('0x23'),function(_0x603935){_0x55a770+=_0x603935;});_0x4f9835['on']('end',function(){_0x49ab38(_0x55a770);});})['on']('error',function(_0x36f21f){_0x5e8289(_0x36f21f);})[_0x48f4('0x20')]();});}function convertFile(_0xeb297e,_0x5ca3be){return new BPromise(function(_0x27dd1e,_0x42f9b4){var _0x41cf06=sox[_0x48f4('0x24')](_0xeb297e,_0x5ca3be,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x41cf06['on'](_0x48f4('0x1d'),function(_0x2fd339){logger[_0x48f4('0x1d')](_0x48f4('0x25'),_0x2fd339);_0x42f9b4(_0x2fd339);});_0x41cf06['on']('end',function(){logger[_0x48f4('0x1a')](_0x48f4('0x26'));_0x27dd1e();});_0x41cf06['start']();});}function base64Decode(_0x4afd05,_0x134217){var _0x550501=path[_0x48f4('0x27')](__dirname,_0x48f4('0x28'),rs[_0x48f4('0x29')](0x4)+_0x48f4('0x2a'));fs[_0x48f4('0x2b')](_0x550501,_0x4afd05,_0x48f4('0x2c'));return convertFile(_0x550501,_0x134217)[_0x48f4('0x2d')](function(){try{fs[_0x48f4('0x2e')](_0x550501);fs[_0x48f4('0x2f')](_0x134217,'777');}catch(_0x5e37c4){logger[_0x48f4('0x1d')](_0x5e37c4);}return _0x134217[_0x48f4('0x30')]('.')[0x0];});}function base64Encode(_0x3514b9){var _0x455478=fs['readFileSync'](_0x3514b9);return new Buffer(_0x455478)[_0x48f4('0x31')](_0x48f4('0x2c'));}exports['googleCloudTTS']=function(_0x52ec30,_0x1132f5,_0x38a08f,_0x1e921f,_0x1fabec,_0x1a8633){var _0x253e94,_0x2437d4;var _0x5b1f1f=_0x48f4('0x32');var _0x564fbe=_0x48f4('0x33')+_0x52ec30;var _0x2ebae3={};if(_0x1132f5===_0x48f4('0x34')){_0x2ebae3[_0x48f4('0x35')]={'ssml':_0x38a08f};}else{_0x2ebae3[_0x48f4('0x35')]={'text':_0x38a08f};};_0x2ebae3[_0x48f4('0x36')]={'languageCode':_0x1e921f,'ssmlGender':_0x1fabec};_0x2ebae3[_0x48f4('0x37')]={'audioEncoding':_0x48f4('0x38'),'sampleRateHertz':0x1f40};var _0x344c65={'url':_0x5b1f1f+_0x48f4('0x39')+_0x564fbe,'method':_0x48f4('0x3a'),'json':!![],'body':_0x2ebae3};return rp(_0x344c65)[_0x48f4('0x2d')](function(_0xd0c02f){return new BPromise(function(_0x2e3443,_0x261f09){_0x253e94=path[_0x48f4('0x27')](__dirname,_0x48f4('0x28'),rs['generate'](0x4)+_0x48f4('0x3b'));var _0x2c128c=Buffer[_0x48f4('0x3c')](_0xd0c02f[_0x48f4('0x3d')],_0x48f4('0x2c'));return fs[_0x48f4('0x3e')](_0x253e94,_0x2c128c,function(_0x556006){_0x261f09(_0x556006);},function(_0xdb848){fs[_0x48f4('0x2f')](_0x253e94,_0x48f4('0x3f'));_0x2e3443(_0xdb848);});});})[_0x48f4('0x2d')](function(_0xab67f3){_0x2437d4=path[_0x48f4('0x27')](__dirname,_0x48f4('0x28'),rs[_0x48f4('0x29')](0x4)+'.wav');return convertFile(_0x253e94,_0x2437d4);})['then'](function(){try{fs[_0x48f4('0x2e')](_0x253e94);fs[_0x48f4('0x2f')](_0x2437d4,_0x48f4('0x3f'));}catch(_0x49f01e){logger[_0x48f4('0x1d')](_0x49f01e);}logger[_0x48f4('0x1a')]('googleCloudTTS\x20path',_0x2437d4[_0x48f4('0x30')]('.')[0x0]);return _0x2437d4[_0x48f4('0x30')]('.')[0x0];});};exports[_0x48f4('0x40')]=function(_0x28ced5,_0x50df24){var _0x192189='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x154200,_0x12256e;var _0x3a584f;var _0x10bf18={'encoding':_0x48f4('0x41'),'method':_0x48f4('0x3a'),'timeout':0x2710,'url':_0x192189,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x48f4('0x42')+encodeURIComponent(JSON[_0x48f4('0x43')]([[[_0x48f4('0x44'),JSON[_0x48f4('0x43')]([_0x28ced5,_0x50df24||'en',![],_0x48f4('0x45')]),null,_0x48f4('0x46')]]]))};return rp(_0x10bf18)[_0x48f4('0x2d')](function(_0x1fedf7){try{_0x3a584f=eval(_0x1fedf7[_0x48f4('0x47')](0x5))[0x0][0x2];}catch(_0x4d5215){throw new Error(_0x48f4('0x48')+_0x1fedf7[_0x48f4('0x23')]);}if(!_0x3a584f){if(_0x28ced5['length']>0xc8){throw new Error(_0x48f4('0x49'));}else{throw new Error(_0x48f4('0x4a')+_0x50df24+'\x22\x20might\x20not\x20exist');}}try{_0x3a584f=eval(_0x3a584f)[0x0];}catch(_0x2e8293){throw new Error(_0x48f4('0x48')+res[_0x48f4('0x23')]);}const _0x3af668=_0x3a584f;_0x154200=path[_0x48f4('0x27')](__dirname,_0x48f4('0x28'),rs[_0x48f4('0x29')](0x4)+_0x48f4('0x3b'));fs[_0x48f4('0x2b')](_0x154200,_0x3a584f,{'encoding':_0x48f4('0x2c')});_0x12256e=path['resolve'](__dirname,_0x48f4('0x28'),rs[_0x48f4('0x29')](0x4)+_0x48f4('0x2a'));return convertFile(_0x154200,_0x12256e);})[_0x48f4('0x2d')](function(){try{fs[_0x48f4('0x2e')](_0x154200);fs['chmodSync'](_0x12256e,_0x48f4('0x3f'));}catch(_0x36715f){logger['error'](_0x36715f);}logger[_0x48f4('0x1a')](_0x48f4('0x4b'),_0x12256e['split']('.')[0x0]);return _0x12256e[_0x48f4('0x30')]('.')[0x0];});};exports['googleASR']=function(_0x447b73,_0x8dfa0f,_0x394585){return google[_0x48f4('0x4c')](_0x447b73,_0x8dfa0f,_0x394585)['then'](function(_0x5b6d15){logger[_0x48f4('0x1a')](_0x5b6d15[_0x48f4('0x4d')]);return rp(_0x5b6d15);})[_0x48f4('0x2d')](function(_0x339b5d){var _0x24c0c9='';var _0x47d040=0x0;try{fs['unlink'](_0x447b73);}catch(_0x54c7ab){logger[_0x48f4('0x1d')](_0x54c7ab);}if(_0x339b5d&&_0x339b5d[_0x48f4('0x4e')]){_0x24c0c9=_0x339b5d[_0x48f4('0x4e')][_0x48f4('0x4f')](function(_0x290616){return _0x290616&&_0x290616[_0x48f4('0x50')][0x0]&&_0x290616[_0x48f4('0x50')][0x0][_0x48f4('0x51')]?_0x290616['alternatives'][0x0]['transcript']:'';})[_0x48f4('0x52')]('\x0a');_0x47d040=_0x339b5d[_0x48f4('0x4e')][_0x48f4('0x4f')](function(_0x38c7db){return _0x38c7db&&_0x38c7db[_0x48f4('0x50')][0x0]&&_0x38c7db['alternatives'][0x0][_0x48f4('0x53')]?_0x38c7db[_0x48f4('0x50')][0x0][_0x48f4('0x53')]:0x0;})[_0x48f4('0x52')]('\x0a');}logger[_0x48f4('0x1a')](_0x48f4('0x54'),_0x24c0c9);logger[_0x48f4('0x1a')](_0x48f4('0x55'),_0x47d040);return{'transcript':_0x24c0c9,'confidence':_0x47d040};})[_0x48f4('0x56')](function(_0x47fbd8){logger[_0x48f4('0x1d')](_0x48f4('0x57'),_0x47fbd8[_0x48f4('0x15')],_0x47fbd8[_0x48f4('0x58')],_0x47fbd8[_0x48f4('0x59')]);});};exports[_0x48f4('0x5a')]=function(_0x48a6ff,_0x30fd26,_0x5f54a0,_0x1324bb){var _0x580ff0=apiai(_0x30fd26,{'language':_0x1324bb||'en'});return _0x580ff0['textRequest'](_0x5f54a0,{'sessionId':md5(_0x48a6ff)})[_0x48f4('0x2d')](function(_0x52aeef){logger[_0x48f4('0x1a')](JSON[_0x48f4('0x43')](_0x52aeef));return{'source':_0x52aeef[_0x48f4('0x5b')][_0x48f4('0x5c')],'resolvedQuery':_0x52aeef[_0x48f4('0x5b')]['resolvedQuery'],'action':_0x52aeef[_0x48f4('0x5b')][_0x48f4('0x5d')],'actionIncomplete':_0x52aeef[_0x48f4('0x5b')]['actionIncomplete'],'speech':_0x52aeef['result'][_0x48f4('0x5e')][_0x48f4('0x5f')],'score':_0x52aeef[_0x48f4('0x5b')][_0x48f4('0x60')],'statusCode':_0x52aeef[_0x48f4('0x61')]['code'],'endConversation':_0x52aeef[_0x48f4('0x5b')]['metadata'][_0x48f4('0x62')]||![],'isFallbackIntent':_0x52aeef[_0x48f4('0x5b')][_0x48f4('0x63')][_0x48f4('0x64')]};});};exports[_0x48f4('0x65')]=function(_0x5c1bc0,_0x374e22,_0x536aa7,_0xf12048,_0xaeff3c,_0x458bfe){var _0x206924=_0xf12048[_0x48f4('0x66')](/\\n/g,'\x0a');var _0x3535d6={'credentials':{'private_key':_0x206924,'client_email':_0x536aa7}};var _0x21de2f=new dialogflow[(_0x48f4('0x67'))](_0x3535d6);var _0x5aa45b=_0x21de2f['sessionPath'](_0x374e22,md5(_0x5c1bc0));var _0x5699d5={'session':_0x5aa45b,'queryInput':{'text':{'text':_0xaeff3c,'languageCode':_0x458bfe}}};return _0x21de2f[_0x48f4('0x68')](_0x5699d5)[_0x48f4('0x2d')](function(_0x108945){if(_0x108945&&_0x108945['length']){logger[_0x48f4('0x1a')](_0x48f4('0x69'),JSON[_0x48f4('0x43')](_0x108945));var _0x10d4da=_0x108945[0x0];if(_0x10d4da){var _0x1a3d0c={'action':_0x10d4da[_0x48f4('0x6a')][_0x48f4('0x5d')],'allRequiredParamsPresent':_0x10d4da[_0x48f4('0x6a')][_0x48f4('0x6b')],'endConversation':_0x10d4da[_0x48f4('0x6a')][_0x48f4('0x6c')]&&_0x10d4da['queryResult'][_0x48f4('0x6c')]['fields']?_0x10d4da['queryResult'][_0x48f4('0x6c')][_0x48f4('0x6d')][_0x48f4('0x6e')][_0x48f4('0x6f')]:![],'fulfillmentText':_0x10d4da['queryResult'][_0x48f4('0x70')],'intentName':_0x10d4da[_0x48f4('0x6a')]['intent']['name'],'intentDisplayName':_0x10d4da[_0x48f4('0x6a')][_0x48f4('0x71')][_0x48f4('0x72')],'isFallbackIntent':_0x10d4da[_0x48f4('0x6a')]['intent']['isFallback'],'languageCode':_0x10d4da['queryResult'][_0x48f4('0x73')],'queryText':_0x10d4da[_0x48f4('0x6a')][_0x48f4('0x74')],'responseId':_0x10d4da[_0x48f4('0x75')],'score':_0x10d4da[_0x48f4('0x6a')][_0x48f4('0x76')],'speech':_0x10d4da[_0x48f4('0x6a')][_0x48f4('0x70')],'providerResponse':JSON['stringify'](_0x108945)};return _0x1a3d0c;}}});};exports[_0x48f4('0x77')]=function(_0x4d58cb,_0x54caa0,_0x17929e,_0x4253c5){return tilde[_0x48f4('0x4c')](_0x4d58cb,_0x54caa0,_0x17929e,_0x4253c5)[_0x48f4('0x2d')](function(_0x4045a4){try{fs[_0x48f4('0x2e')](_0x4d58cb);}catch(_0x19147b){logger['error'](_0x19147b);}logger[_0x48f4('0x1a')]('Tilde\x20ASR\x20transcription',_0x4045a4[_0x48f4('0x51')]);logger[_0x48f4('0x1a')](_0x48f4('0x78'),_0x4045a4[_0x48f4('0x53')]);return _0x4045a4;});};exports[_0x48f4('0x79')]=function(_0x5153d4,_0x4c3695,_0x39beab,_0x280480,_0x544e5a,_0x39d66f){var _0x2fd14d=path['resolve'](__dirname,_0x48f4('0x28'),rs[_0x48f4('0x29')](0x4)+_0x48f4('0x3b'));var _0x27e656;return aws[_0x48f4('0x7a')](_0x5153d4,_0x4c3695,_0x39beab,_0x280480,_0x544e5a,_0x39d66f,_0x2fd14d)[_0x48f4('0x2d')](function(){_0x27e656=path['resolve'](__dirname,'tmp',rs[_0x48f4('0x29')](0x4)+'.wav');return convertFile(_0x2fd14d,_0x27e656);})[_0x48f4('0x2d')](function(){try{fs['unlink'](_0x2fd14d);fs[_0x48f4('0x2f')](_0x27e656,_0x48f4('0x3f'));}catch(_0x55ad54){logger[_0x48f4('0x1d')](_0x55ad54);}return _0x27e656[_0x48f4('0x30')]('.')[0x0];});};exports[_0x48f4('0x7b')]=function(_0x5a9ba1,_0x1328bf,_0x4290ac,_0x55f91a,_0x130a93,_0x31cb61){return aws[_0x48f4('0x7c')](_0x5a9ba1,_0x1328bf,_0x4290ac,_0x55f91a,_0x130a93,_0x31cb61)[_0x48f4('0x2d')](function(_0x52a220){logger[_0x48f4('0x1a')](JSON[_0x48f4('0x43')](_0x52a220));return _0x52a220;});};exports[_0x48f4('0x7d')]=function(_0x5dcbde,_0x132a0e,_0x4b8af4,_0x4ecb44){var _0x224048=util['format'](_0x48f4('0x7e'),ISPEECH_API,_0x5dcbde,encodeURIComponent(_0x132a0e),_0x4b8af4,_0x4ecb44);var _0x68347f=path[_0x48f4('0x27')](__dirname,'tmp',rs[_0x48f4('0x29')](0x4)+_0x48f4('0x3b'));var _0x1c5bf7;return downloadFile(_0x224048,_0x68347f)[_0x48f4('0x2d')](function(){_0x1c5bf7=path[_0x48f4('0x27')](__dirname,_0x48f4('0x28'),rs[_0x48f4('0x29')](0x4)+_0x48f4('0x2a'));return convertFile(_0x68347f,_0x1c5bf7);})[_0x48f4('0x2d')](function(){try{fs[_0x48f4('0x2e')](_0x68347f);fs[_0x48f4('0x2f')](_0x1c5bf7,'777');}catch(_0x38367e){logger[_0x48f4('0x1d')](_0x38367e);}return _0x1c5bf7['split']('.')[0x0];});};exports[_0x48f4('0x7f')]=function(_0x360a48,_0x13b5f8,_0x4bb09e,_0x35dc8e){var _0x45d5fe=util[_0x48f4('0x80')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x13b5f8,_0x4bb09e,base64Encode(_0x360a48),_0x35dc8e?util[_0x48f4('0x80')]('model=%s',encodeURIComponent(_0x35dc8e)):'freeform=3');return uploadFile(_0x45d5fe)[_0x48f4('0x2d')](function(_0x405038){return querystring['parse'](_0x405038);});};exports[_0x48f4('0x81')]=function(_0x3efc2f,_0x1799b3){return sestek['nda'](_0x3efc2f,_0x1799b3)[_0x48f4('0x2d')](function(_0x4e3fd6){logger[_0x48f4('0x1a')](JSON[_0x48f4('0x43')](_0x4e3fd6));var _0x399aff={'speech':_0x4e3fd6[_0x48f4('0x82')],'action':_0x4e3fd6[_0x48f4('0x83')]?_0x4e3fd6[_0x48f4('0x83')][_0x48f4('0x84')]:undefined,'actiondata':_0x4e3fd6[_0x48f4('0x83')]?_0x4e3fd6[_0x48f4('0x83')][_0x48f4('0x85')]:undefined};if(_0x4e3fd6[_0x48f4('0x83')]&&_0x4e3fd6[_0x48f4('0x83')][_0x48f4('0x86')]){return base64Decode(_0x4e3fd6[_0x48f4('0x83')][_0x48f4('0x86')][_0x48f4('0x87')],path[_0x48f4('0x27')](__dirname,_0x48f4('0x28'),rs[_0x48f4('0x29')](0x4)+_0x48f4('0x2a')))[_0x48f4('0x2d')](function(_0x21801e){_0x399aff['audiofile']=_0x21801e;return _0x399aff;});}return _0x399aff;});};exports[_0x48f4('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0xd13e=['Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','name','displayName','isFallback','responseId','intentDetectionConfidence','tildeASR','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','http','https','request-promise','randomstring','google-tts-api','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','path','WHAT_EVER','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','error','download\x20error','pipe','https:','data','end','wav','start','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','resolve','.mp3','audioContent','writeFile','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20confidence','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','status','metadata','isFallbackIntent','replace','detectIntent'];(function(_0x57a33f,_0xdb3c1){var _0xb2e081=function(_0x54a891){while(--_0x54a891){_0x57a33f['push'](_0x57a33f['shift']());}};_0xb2e081(++_0xdb3c1);}(_0xd13e,0x194));var _0xed13=function(_0x5425f9,_0x4c0c3f){_0x5425f9=_0x5425f9-0x0;var _0x5247da=_0xd13e[_0x5425f9];return _0x5247da;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xed13('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xed13('0x1'));var https=require(_0xed13('0x2'));var md5=require('md5');var path=require('path');var querystring=require('querystring');var rp=require(_0xed13('0x3'));var rs=require(_0xed13('0x4'));var sox=require('sox');var tts=require(_0xed13('0x5'));var urlParse=require('url')[_0xed13('0x6')];var util=require(_0xed13('0x7'));var aws=require('./aws');var google=require(_0xed13('0x8'));var sestek=require(_0xed13('0x9'));var tilde=require(_0xed13('0xa'));var logger=require(_0xed13('0xb'))(_0xed13('0xc'));var ISPEECH_API=_0xed13('0xd');function downloadFile(_0x355ff6,_0x4c3a18){return new BPromise(function(_0x70d7e6,_0x2a75a2){var _0x656160=urlParse(_0x355ff6);var _0x4428c9=_0x656160[_0xed13('0xe')]==='https:'?https:http;var _0x2e9bbc={'host':_0x656160[_0xed13('0xf')],'path':_0x656160[_0xed13('0x10')],'headers':{'user-agent':_0xed13('0x11')}};_0x4428c9['get'](_0x2e9bbc,function(_0x4781de){if(_0x4781de[_0xed13('0x12')]!==0xc8){logger['error'](_0xed13('0x13')+_0x355ff6+_0xed13('0x14')+_0x4781de['statusCode']+'\x20('+_0x4781de['statusMessage']+')');_0x2a75a2(new Error('request\x20to\x20'+_0x355ff6+_0xed13('0x14')+_0x4781de[_0xed13('0x12')]+'\x20('+_0x4781de[_0xed13('0x15')]+')'));return;}var _0xbd2809=fs[_0xed13('0x16')](_0x4c3a18);_0xbd2809['on']('finish',function(){logger[_0xed13('0x17')](_0xed13('0x18'));_0xbd2809[_0xed13('0x19')](_0x70d7e6);});_0xbd2809['on'](_0xed13('0x1a'),function(_0x45f2f9){fs['unlink'](_0x4c3a18);logger[_0xed13('0x1a')](_0xed13('0x1b'),_0x45f2f9);_0x2a75a2(_0x45f2f9);});_0x4781de[_0xed13('0x1c')](_0xbd2809);})['on'](_0xed13('0x1a'),function(_0x31a77d){logger['error'](_0x31a77d);_0x2a75a2(_0x31a77d);})['end']();});}function uploadFile(_0x5bc9af){return new BPromise(function(_0x3447da,_0x49c17b){var _0x5c0321=urlParse(_0x5bc9af);var _0x28c1d3=_0x5c0321[_0xed13('0xe')]===_0xed13('0x1d')?https:http;var _0x44ec2d={'host':_0x5c0321[_0xed13('0xf')],'path':_0x5c0321['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x28c1d3['get'](_0x44ec2d,function(_0x407173){if(_0x407173[_0xed13('0x12')]!==0xc8){_0x49c17b(new Error(_0xed13('0x13')+_0x5bc9af+_0xed13('0x14')+_0x407173[_0xed13('0x12')]+'\x20('+_0x407173['statusMessage']+')'));return;}var _0x47e3db='';_0x407173['on'](_0xed13('0x1e'),function(_0x507767){_0x47e3db+=_0x507767;});_0x407173['on'](_0xed13('0x1f'),function(){_0x3447da(_0x47e3db);});})['on'](_0xed13('0x1a'),function(_0x214125){_0x49c17b(_0x214125);})[_0xed13('0x1f')]();});}function convertFile(_0x1f77e0,_0x227205){return new BPromise(function(_0x38e04a,_0x1b3c5d){var _0x467365=sox['transcode'](_0x1f77e0,_0x227205,{'sampleRate':0x1f40,'format':_0xed13('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x467365['on'](_0xed13('0x1a'),function(_0x38835d){logger[_0xed13('0x1a')]('error\x20convert',_0x38835d);_0x1b3c5d(_0x38835d);});_0x467365['on'](_0xed13('0x1f'),function(){logger[_0xed13('0x17')]('finish\x20to\x20convert');_0x38e04a();});_0x467365[_0xed13('0x21')]();});}function base64Decode(_0xacadd0,_0x2820f3){var _0x13401b=path['resolve'](__dirname,_0xed13('0x22'),rs[_0xed13('0x23')](0x4)+_0xed13('0x24'));fs[_0xed13('0x25')](_0x13401b,_0xacadd0,_0xed13('0x26'));return convertFile(_0x13401b,_0x2820f3)[_0xed13('0x27')](function(){try{fs[_0xed13('0x28')](_0x13401b);fs[_0xed13('0x29')](_0x2820f3,_0xed13('0x2a'));}catch(_0x454437){logger['error'](_0x454437);}return _0x2820f3[_0xed13('0x2b')]('.')[0x0];});}function base64Encode(_0x4443ed){var _0x5c4b94=fs[_0xed13('0x2c')](_0x4443ed);return new Buffer(_0x5c4b94)[_0xed13('0x2d')](_0xed13('0x26'));}exports[_0xed13('0x2e')]=function(_0x1ad59e,_0x30efdf,_0x3badba,_0x4c4c5c,_0x59aaaf,_0x4ec793){var _0x2464a9,_0x5dfd78;var _0x186987=_0xed13('0x2f');var _0x5777c6=_0xed13('0x30')+_0x1ad59e;var _0x32d703={};if(_0x30efdf==='ssml'){_0x32d703[_0xed13('0x31')]={'ssml':_0x3badba};}else{_0x32d703[_0xed13('0x31')]={'text':_0x3badba};};_0x32d703['voice']={'languageCode':_0x4c4c5c,'ssmlGender':_0x59aaaf};_0x32d703[_0xed13('0x32')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x401168={'url':_0x186987+'text:synthesize'+_0x5777c6,'method':'POST','json':!![],'body':_0x32d703};return rp(_0x401168)[_0xed13('0x27')](function(_0x105311){return new BPromise(function(_0x2a5457,_0x5106f1){_0x2464a9=path[_0xed13('0x33')](__dirname,_0xed13('0x22'),rs[_0xed13('0x23')](0x4)+_0xed13('0x34'));var _0x231b2=Buffer['from'](_0x105311[_0xed13('0x35')],_0xed13('0x26'));return fs[_0xed13('0x36')](_0x2464a9,_0x231b2,function(_0xc4896c){_0x5106f1(_0xc4896c);},function(_0x40a8b3){fs[_0xed13('0x29')](_0x2464a9,_0xed13('0x2a'));_0x2a5457(_0x40a8b3);});});})[_0xed13('0x27')](function(_0x2dfb2f){_0x5dfd78=path['resolve'](__dirname,_0xed13('0x22'),rs[_0xed13('0x23')](0x4)+_0xed13('0x24'));return convertFile(_0x2464a9,_0x5dfd78);})[_0xed13('0x27')](function(){try{fs['unlink'](_0x2464a9);fs[_0xed13('0x29')](_0x5dfd78,_0xed13('0x2a'));}catch(_0x36001e){logger['error'](_0x36001e);}logger['info'](_0xed13('0x37'),_0x5dfd78[_0xed13('0x2b')]('.')[0x0]);return _0x5dfd78['split']('.')[0x0];});};exports['googleTTS']=function(_0x45295e,_0x36cc25){var _0x586110=_0xed13('0x38');var _0x4bc61d,_0x13d8d3;var _0xcd8559;var _0x4e8c17={'encoding':_0xed13('0x39'),'method':_0xed13('0x3a'),'timeout':0x2710,'url':_0x586110,'headers':{'Content-Type':_0xed13('0x3b')},'body':_0xed13('0x3c')+encodeURIComponent(JSON[_0xed13('0x3d')]([[[_0xed13('0x3e'),JSON[_0xed13('0x3d')]([_0x45295e,_0x36cc25||'en',![],_0xed13('0x3f')]),null,_0xed13('0x40')]]]))};return rp(_0x4e8c17)[_0xed13('0x27')](function(_0x33213e){try{_0xcd8559=eval(_0x33213e[_0xed13('0x41')](0x5))[0x0][0x2];}catch(_0x48f616){throw new Error(_0xed13('0x42')+_0x33213e[_0xed13('0x1e')]);}if(!_0xcd8559){if(_0x45295e[_0xed13('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xed13('0x44')+_0x36cc25+'\x22\x20might\x20not\x20exist');}}try{_0xcd8559=eval(_0xcd8559)[0x0];}catch(_0x10b1c3){throw new Error(_0xed13('0x42')+res[_0xed13('0x1e')]);}const _0x5a076f=_0xcd8559;_0x4bc61d=path[_0xed13('0x33')](__dirname,'tmp',rs[_0xed13('0x23')](0x4)+_0xed13('0x34'));fs[_0xed13('0x25')](_0x4bc61d,_0xcd8559,{'encoding':_0xed13('0x26')});_0x13d8d3=path[_0xed13('0x33')](__dirname,_0xed13('0x22'),rs[_0xed13('0x23')](0x4)+_0xed13('0x24'));return convertFile(_0x4bc61d,_0x13d8d3);})['then'](function(){try{fs[_0xed13('0x28')](_0x4bc61d);fs[_0xed13('0x29')](_0x13d8d3,_0xed13('0x2a'));}catch(_0x5ae424){logger[_0xed13('0x1a')](_0x5ae424);}logger[_0xed13('0x17')]('goggleTTS\x20path',_0x13d8d3[_0xed13('0x2b')]('.')[0x0]);return _0x13d8d3['split']('.')[0x0];});};exports['googleASR']=function(_0x4b5211,_0x3caec7,_0xaf84fc){return google[_0xed13('0x45')](_0x4b5211,_0x3caec7,_0xaf84fc)['then'](function(_0x4fa7d6){logger[_0xed13('0x17')](_0x4fa7d6['uri']);return rp(_0x4fa7d6);})['then'](function(_0x29cf95){var _0x3615bb='';var _0x54b7b6=0x0;try{fs[_0xed13('0x28')](_0x4b5211);}catch(_0x146c0c){logger['error'](_0x146c0c);}if(_0x29cf95&&_0x29cf95[_0xed13('0x46')]){_0x3615bb=_0x29cf95[_0xed13('0x46')][_0xed13('0x47')](function(_0x359da9){return _0x359da9&&_0x359da9[_0xed13('0x48')][0x0]&&_0x359da9[_0xed13('0x48')][0x0][_0xed13('0x49')]?_0x359da9['alternatives'][0x0][_0xed13('0x49')]:'';})['join']('\x0a');_0x54b7b6=_0x29cf95[_0xed13('0x46')]['map'](function(_0x5213ea){return _0x5213ea&&_0x5213ea[_0xed13('0x48')][0x0]&&_0x5213ea[_0xed13('0x48')][0x0]['confidence']?_0x5213ea[_0xed13('0x48')][0x0][_0xed13('0x4a')]:0x0;})[_0xed13('0x4b')]('\x0a');}logger[_0xed13('0x17')]('googleASR\x20transcription',_0x3615bb);logger[_0xed13('0x17')](_0xed13('0x4c'),_0x54b7b6);return{'transcript':_0x3615bb,'confidence':_0x54b7b6};})['catch'](function(_0xcf37ee){logger[_0xed13('0x1a')](_0xed13('0x4d'),_0xcf37ee[_0xed13('0x12')],_0xcf37ee['name'],_0xcf37ee[_0xed13('0x4e')]);});};exports[_0xed13('0x4f')]=function(_0x1e3d70,_0x5e1d71,_0x4b6e36,_0x3234ea){var _0x13c7dc=apiai(_0x5e1d71,{'language':_0x3234ea||'en'});return _0x13c7dc[_0xed13('0x50')](_0x4b6e36,{'sessionId':md5(_0x1e3d70)})[_0xed13('0x27')](function(_0x5b5b9c){logger[_0xed13('0x17')](JSON[_0xed13('0x3d')](_0x5b5b9c));return{'source':_0x5b5b9c[_0xed13('0x51')][_0xed13('0x52')],'resolvedQuery':_0x5b5b9c[_0xed13('0x51')][_0xed13('0x53')],'action':_0x5b5b9c[_0xed13('0x51')][_0xed13('0x54')],'actionIncomplete':_0x5b5b9c[_0xed13('0x51')][_0xed13('0x55')],'speech':_0x5b5b9c[_0xed13('0x51')][_0xed13('0x56')]['speech'],'score':_0x5b5b9c[_0xed13('0x51')]['score'],'statusCode':_0x5b5b9c[_0xed13('0x57')]['code'],'endConversation':_0x5b5b9c['result'][_0xed13('0x58')]['endConversation']||![],'isFallbackIntent':_0x5b5b9c[_0xed13('0x51')][_0xed13('0x58')][_0xed13('0x59')]};});};exports['googleDialogflowV2']=function(_0x5db2dd,_0x69a2,_0x4661b1,_0xc315f8,_0x224e15,_0x3a62b9){var _0x2e9ab4=_0xc315f8[_0xed13('0x5a')](/\\n/g,'\x0a');var _0x557134={'credentials':{'private_key':_0x2e9ab4,'client_email':_0x4661b1}};var _0x3be343=new dialogflow['SessionsClient'](_0x557134);var _0x4b0555=_0x3be343['sessionPath'](_0x69a2,md5(_0x5db2dd));var _0x3fa335={'session':_0x4b0555,'queryInput':{'text':{'text':_0x224e15,'languageCode':_0x3a62b9}}};return _0x3be343[_0xed13('0x5b')](_0x3fa335)[_0xed13('0x27')](function(_0x438599){if(_0x438599&&_0x438599[_0xed13('0x43')]){logger[_0xed13('0x17')](_0xed13('0x5c'),JSON['stringify'](_0x438599));var _0xdf16e7=_0x438599[0x0];if(_0xdf16e7){var _0x4e4424={'action':_0xdf16e7[_0xed13('0x5d')][_0xed13('0x54')],'allRequiredParamsPresent':_0xdf16e7[_0xed13('0x5d')][_0xed13('0x5e')],'endConversation':_0xdf16e7[_0xed13('0x5d')][_0xed13('0x5f')]&&_0xdf16e7[_0xed13('0x5d')][_0xed13('0x5f')][_0xed13('0x60')]?_0xdf16e7[_0xed13('0x5d')]['diagnosticInfo'][_0xed13('0x60')][_0xed13('0x61')][_0xed13('0x62')]:![],'fulfillmentText':_0xdf16e7[_0xed13('0x5d')][_0xed13('0x63')],'intentName':_0xdf16e7['queryResult']['intent'][_0xed13('0x64')],'intentDisplayName':_0xdf16e7[_0xed13('0x5d')]['intent'][_0xed13('0x65')],'isFallbackIntent':_0xdf16e7[_0xed13('0x5d')]['intent'][_0xed13('0x66')],'languageCode':_0xdf16e7[_0xed13('0x5d')]['languageCode'],'queryText':_0xdf16e7[_0xed13('0x5d')]['queryText'],'responseId':_0xdf16e7[_0xed13('0x67')],'score':_0xdf16e7[_0xed13('0x5d')][_0xed13('0x68')],'speech':_0xdf16e7[_0xed13('0x5d')][_0xed13('0x63')],'providerResponse':JSON['stringify'](_0x438599)};return _0x4e4424;}}});};exports[_0xed13('0x69')]=function(_0x280fa3,_0x5ed35e,_0xf81256,_0x4ee567){return tilde[_0xed13('0x45')](_0x280fa3,_0x5ed35e,_0xf81256,_0x4ee567)['then'](function(_0x1caaa1){try{fs[_0xed13('0x28')](_0x280fa3);}catch(_0x85b8c){logger[_0xed13('0x1a')](_0x85b8c);}logger[_0xed13('0x17')]('Tilde\x20ASR\x20transcription',_0x1caaa1['transcript']);logger[_0xed13('0x17')]('Tilde\x20ASR\x20confidence',_0x1caaa1[_0xed13('0x4a')]);return _0x1caaa1;});};exports[_0xed13('0x6a')]=function(_0x11be59,_0x2e0d21,_0x241821,_0x5ccb19,_0x19c71d,_0x2148cb){var _0x43052a=path[_0xed13('0x33')](__dirname,_0xed13('0x22'),rs['generate'](0x4)+_0xed13('0x34'));var _0x3cddea;return aws[_0xed13('0x6b')](_0x11be59,_0x2e0d21,_0x241821,_0x5ccb19,_0x19c71d,_0x2148cb,_0x43052a)[_0xed13('0x27')](function(){_0x3cddea=path[_0xed13('0x33')](__dirname,'tmp',rs['generate'](0x4)+_0xed13('0x24'));return convertFile(_0x43052a,_0x3cddea);})[_0xed13('0x27')](function(){try{fs['unlink'](_0x43052a);fs[_0xed13('0x29')](_0x3cddea,_0xed13('0x2a'));}catch(_0x29be42){logger[_0xed13('0x1a')](_0x29be42);}return _0x3cddea['split']('.')[0x0];});};exports[_0xed13('0x6c')]=function(_0x153724,_0x117d70,_0x322a6a,_0x4585fb,_0x39e430,_0x39530a){return aws[_0xed13('0x6d')](_0x153724,_0x117d70,_0x322a6a,_0x4585fb,_0x39e430,_0x39530a)[_0xed13('0x27')](function(_0x134348){logger[_0xed13('0x17')](JSON[_0xed13('0x3d')](_0x134348));return _0x134348;});};exports[_0xed13('0x6e')]=function(_0x37d7c6,_0x58cf17,_0x26c539,_0x29944d){var _0xcde7c2=util[_0xed13('0x6f')](_0xed13('0x70'),ISPEECH_API,_0x37d7c6,encodeURIComponent(_0x58cf17),_0x26c539,_0x29944d);var _0x26dd0e=path[_0xed13('0x33')](__dirname,_0xed13('0x22'),rs[_0xed13('0x23')](0x4)+_0xed13('0x34'));var _0x561fcc;return downloadFile(_0xcde7c2,_0x26dd0e)[_0xed13('0x27')](function(){_0x561fcc=path[_0xed13('0x33')](__dirname,_0xed13('0x22'),rs[_0xed13('0x23')](0x4)+_0xed13('0x24'));return convertFile(_0x26dd0e,_0x561fcc);})[_0xed13('0x27')](function(){try{fs[_0xed13('0x28')](_0x26dd0e);fs[_0xed13('0x29')](_0x561fcc,'777');}catch(_0xa5d3ad){logger[_0xed13('0x1a')](_0xa5d3ad);}return _0x561fcc[_0xed13('0x2b')]('.')[0x0];});};exports[_0xed13('0x71')]=function(_0x4be367,_0x538bd5,_0x211876,_0x4be10e){var _0x3b4e86=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x538bd5,_0x211876,base64Encode(_0x4be367),_0x4be10e?util[_0xed13('0x6f')](_0xed13('0x72'),encodeURIComponent(_0x4be10e)):_0xed13('0x73'));return uploadFile(_0x3b4e86)[_0xed13('0x27')](function(_0x4c664e){return querystring['parse'](_0x4c664e);});};exports[_0xed13('0x74')]=function(_0x464ede,_0x323148){return sestek['nda'](_0x464ede,_0x323148)[_0xed13('0x27')](function(_0x2d3151){logger[_0xed13('0x17')](JSON[_0xed13('0x3d')](_0x2d3151));var _0x407f62={'speech':_0x2d3151[_0xed13('0x75')],'action':_0x2d3151[_0xed13('0x76')]?_0x2d3151[_0xed13('0x76')]['CustomAction']:undefined,'actiondata':_0x2d3151[_0xed13('0x76')]?_0x2d3151[_0xed13('0x76')][_0xed13('0x77')]:undefined};if(_0x2d3151['channelData']&&_0x2d3151[_0xed13('0x76')]['AudioFromTts']){return base64Decode(_0x2d3151['channelData'][_0xed13('0x78')][_0xed13('0x79')],path[_0xed13('0x33')](__dirname,_0xed13('0x22'),rs[_0xed13('0x23')](0x4)+_0xed13('0x24')))[_0xed13('0x27')](function(_0x927bf){_0x407f62[_0xed13('0x7a')]=_0x927bf;return _0x407f62;});}return _0x407f62;});};exports[_0xed13('0x7b')]=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 0007778..2b70d08 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 _0xe5ea=['./nda','exports'];(function(_0x3050ca,_0x3e36b0){var _0x1eed1d=function(_0x195e8f){while(--_0x195e8f){_0x3050ca['push'](_0x3050ca['shift']());}};_0x1eed1d(++_0x3e36b0);}(_0xe5ea,0x1f2));var _0xae5e=function(_0x217604,_0x2ba6f0){_0x217604=_0x217604-0x0;var _0x519d7f=_0xe5ea[_0x217604];return _0x519d7f;};var nda=require(_0xae5e('0x0'));module[_0xae5e('0x1')]={'nda':nda}; \ No newline at end of file +var _0x907d=['./nda','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x907d,0xde));var _0xd907=function(_0xf273f9,_0x486198){_0xf273f9=_0xf273f9-0x0;var _0xb4abcc=_0x907d[_0xf273f9];return _0xb4abcc;};var nda=require(_0xd907('0x0'));module[_0xd907('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 57b1d35..c068781 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 _0x878f=['ndauth_url','/token','password','then','ndaactivity_type','message','Nda','callerid','calleridname','extension','Bearer\x20','access_token','project','channelData','ProjectName','body','AudioOutputSettings','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports','POST','resolve'];(function(_0x248fd4,_0x54514c){var _0x21e116=function(_0x448022){while(--_0x448022){_0x248fd4['push'](_0x248fd4['shift']());}};_0x21e116(++_0x54514c);}(_0x878f,0x173));var _0xf878=function(_0x58daf6,_0x159c54){_0x58daf6=_0x58daf6-0x0;var _0x1df7bc=_0x878f[_0x58daf6];return _0x1df7bc;};'use strict';var rp=require('request-promise');var url=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));module[_0xf878('0x3')]=function(_0x1b3d0b,_0x3d74cf){var _0x9e6783={'method':_0xf878('0x4'),'uri':url[_0xf878('0x5')](_0x3d74cf[_0xf878('0x6')],_0xf878('0x7')),'form':{'grant_type':'password','username':_0x3d74cf['username'],'password':_0x3d74cf[_0xf878('0x8')]},'json':!![]};return rp(_0x9e6783)[_0xf878('0x9')](function(_0x59e564){var _0x52851e={'method':'POST','uri':url[_0xf878('0x5')](_0x3d74cf['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3d74cf[_0xf878('0xa')]||_0xf878('0xb'),'channelId':_0xf878('0xc'),'conversation':{'id':_0x1b3d0b['uniqueid']},'from':{'id':_0x1b3d0b[_0xf878('0xd')],'name':_0x1b3d0b[_0xf878('0xe')]},'recipient':{'id':_0x1b3d0b['dnid'],'name':_0x1b3d0b[_0xf878('0xf')]},'text':_0x3d74cf['text'],'channelData':{}},'headers':{'Authorization':_0xf878('0x10')+_0x59e564[_0xf878('0x11')]},'json':!![]};if(_0x3d74cf[_0xf878('0x12')]){_0x52851e['body'][_0xf878('0x13')][_0xf878('0x14')]=_0x3d74cf[_0xf878('0x12')];}if(_0x3d74cf['ndagenerate_audio']=='1'){_0x52851e[_0xf878('0x15')][_0xf878('0x13')][_0xf878('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3d74cf['custom_action']){_0x52851e[_0xf878('0x15')][_0xf878('0x13')][_0xf878('0x17')]=_0x3d74cf[_0xf878('0x18')];if(_0x3d74cf[_0xf878('0x19')]){_0x52851e[_0xf878('0x15')][_0xf878('0x13')][_0xf878('0x1a')]=_0x3d74cf[_0xf878('0x19')];}}logger[_0xf878('0x1b')](JSON[_0xf878('0x1c')](_0x52851e));return rp(_0x52851e);});}; \ No newline at end of file +var _0x6c50=['then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','text','access_token','project','body','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','channelData','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username'];(function(_0x9cc786,_0xa427da){var _0xa2382c=function(_0x1ccc4c){while(--_0x1ccc4c){_0x9cc786['push'](_0x9cc786['shift']());}};_0xa2382c(++_0xa427da);}(_0x6c50,0xa4));var _0x06c5=function(_0x80b855,_0x23c092){_0x80b855=_0x80b855-0x0;var _0x37b0d3=_0x6c50[_0x80b855];return _0x37b0d3;};'use strict';var rp=require(_0x06c5('0x0'));var url=require(_0x06c5('0x1'));var logger=require(_0x06c5('0x2'))(_0x06c5('0x3'));module['exports']=function(_0xd66539,_0x494494){var _0x4271d1={'method':_0x06c5('0x4'),'uri':url[_0x06c5('0x5')](_0x494494[_0x06c5('0x6')],_0x06c5('0x7')),'form':{'grant_type':_0x06c5('0x8'),'username':_0x494494[_0x06c5('0x9')],'password':_0x494494[_0x06c5('0x8')]},'json':!![]};return rp(_0x4271d1)[_0x06c5('0xa')](function(_0x17c636){var _0x154b0a={'method':'POST','uri':url[_0x06c5('0x5')](_0x494494[_0x06c5('0xb')],_0x06c5('0xc')),'body':{'type':_0x494494[_0x06c5('0xd')]||'message','channelId':'Nda','conversation':{'id':_0xd66539['uniqueid']},'from':{'id':_0xd66539[_0x06c5('0xe')],'name':_0xd66539['calleridname']},'recipient':{'id':_0xd66539['dnid'],'name':_0xd66539['extension']},'text':_0x494494[_0x06c5('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x17c636[_0x06c5('0x10')]},'json':!![]};if(_0x494494[_0x06c5('0x11')]){_0x154b0a[_0x06c5('0x12')]['channelData'][_0x06c5('0x13')]=_0x494494[_0x06c5('0x11')];}if(_0x494494[_0x06c5('0x14')]=='1'){_0x154b0a[_0x06c5('0x12')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x06c5('0x15')};}if(_0x494494[_0x06c5('0x16')]){_0x154b0a[_0x06c5('0x12')]['channelData'][_0x06c5('0x17')]=_0x494494[_0x06c5('0x16')];if(_0x494494['custom_action_data']){_0x154b0a[_0x06c5('0x12')][_0x06c5('0x18')][_0x06c5('0x19')]=_0x494494[_0x06c5('0x1a')];}}logger[_0x06c5('0x1b')](JSON[_0x06c5('0x1c')](_0x154b0a));return rp(_0x154b0a);});}; \ 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 05c2f46..dfe8528 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 _0xb399=['./lib/api','exports'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xb399,0x18e));var _0x9b39=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0xb399[_0x44cb92];return _0x56b9e6;};'use strict';var asr=require(_0x9b39('0x0'));module[_0x9b39('0x1')]=function(_0x42f54b,_0x46663a,_0x2b5ad9,_0x4d52bc){return asr(_0x42f54b,_0x46663a,_0x2b5ad9,_0x4d52bc);}; \ No newline at end of file +var _0x8cdb=['exports','./lib/api'];(function(_0x5f4be7,_0xc1d854){var _0x5deaeb=function(_0x253ac5){while(--_0x253ac5){_0x5f4be7['push'](_0x5f4be7['shift']());}};_0x5deaeb(++_0xc1d854);}(_0x8cdb,0x193));var _0xb8cd=function(_0x590f9c,_0x38cd70){_0x590f9c=_0x590f9c-0x0;var _0x168c61=_0x8cdb[_0x590f9c];return _0x168c61;};'use strict';var asr=require(_0xb8cd('0x0'));module[_0xb8cd('0x1')]=function(_0x217822,_0x38c4e6,_0x5598df,_0x9a5b16){return asr(_0x217822,_0x38c4e6,_0x5598df,_0x9a5b16);}; \ 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 9b63f43..e85a80e 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 _0xfb7b=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','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(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0xfb7b,0x7a));var _0xbfb7=function(_0x1cbe68,_0x133967){_0x1cbe68=_0x1cbe68-0x0;var _0x274954=_0xfb7b[_0x1cbe68];return _0x274954;};'use strict';var BPromise=require(_0xbfb7('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xbfb7('0x1'));var logger=require(_0xbfb7('0x2'))(_0xbfb7('0x3'));module[_0xbfb7('0x4')]=function(_0x25d877,_0x40f201,_0x3a44f6,_0x2fa06f){return new BPromise(function(_0x407432,_0x1a2d23){logger[_0xbfb7('0x5')]('Tilde\x20URI',_0x2fa06f||_0xbfb7('0x6'));var _0x101e6a=new WebSocket(_0x2fa06f||_0xbfb7('0x6'),{'perMessageDeflate':![]});var _0x7e32b0='';var _0x33b14e='0';var _0x1ae6b6='1';var _0x48c456='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x5a5652(_0x2a9364){var _0x344ae4=crypto['createHash'](_0xbfb7('0x7'));_0x344ae4[_0xbfb7('0x8')](_0x2a9364);return _0x344ae4[_0xbfb7('0x9')](_0xbfb7('0xa'));}function _0x3975c2(){try{logger['info'](_0xbfb7('0xb'));var _0x1df9cc=moment()[_0xbfb7('0xc')]();var _0x4800e5=_0x5a5652(_0x1df9cc+_0x40f201+_0x3a44f6);_0x101e6a['send'](JSON['stringify']({'appID':_0x40f201,'timestamp':_0x1df9cc,'appKey':_0x4800e5}));var _0x1cdf7d=fs[_0xbfb7('0xd')](_0x25d877);_0x1cdf7d['on']('data',function(_0x2e7285){_0x101e6a['send'](_0x2e7285);});_0x1cdf7d['on']('close',function(){_0x101e6a['send'](_0xbfb7('0xe'));});}catch(_0x39def8){logger[_0xbfb7('0xf')](_0xbfb7('0x10'),JSON[_0xbfb7('0x11')](_0x39def8));_0x101e6a[_0xbfb7('0x12')]();}}function _0x57774b(_0x775097){try{if(_0x775097){var _0x518c13=JSON[_0xbfb7('0x13')](_0x775097);switch(_0x518c13[_0xbfb7('0x14')]){case 0x0:if(_0x518c13['result']){if(_0x518c13[_0xbfb7('0x15')][_0xbfb7('0x16')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xbfb7('0x11')](_0x518c13[_0xbfb7('0x15')][_0xbfb7('0x17')]));_0x7e32b0=_0x518c13[_0xbfb7('0x15')][_0xbfb7('0x17')][0x0][_0xbfb7('0x18')];_0x33b14e=_0x518c13[_0xbfb7('0x15')][_0xbfb7('0x17')][0x0][_0xbfb7('0x19')];_0x1ae6b6='0';_0x48c456='Success.';_0x101e6a[_0xbfb7('0x12')]();}}break;case 0x1:logger['info'](_0xbfb7('0x1a'));_0x1ae6b6='1';_0x48c456='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xbfb7('0x5')](_0xbfb7('0x1b'));_0x1ae6b6='2';_0x48c456=_0xbfb7('0x1b');break;case 0x9:logger[_0xbfb7('0x5')](_0xbfb7('0x1c'));_0x1ae6b6='9';_0x48c456=_0xbfb7('0x1c');break;case 0xa:logger['info'](_0xbfb7('0x1d'));_0x1ae6b6='10';_0x48c456=_0xbfb7('0x1d');break;case 0xb:logger[_0xbfb7('0x5')](_0xbfb7('0x1e'));_0x1ae6b6='11';_0x48c456='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x405429){logger['error'](_0xbfb7('0x1f'),JSON[_0xbfb7('0x11')](_0x405429));_0x101e6a['terminate']();}}function _0x44fe90(){logger[_0xbfb7('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x407432({'transcript':_0x7e32b0,'confidence':_0x33b14e,'status':_0x1ae6b6,'status_message':_0x48c456});}function _0x1039d2(_0x3e1d7c){logger[_0xbfb7('0xf')](_0xbfb7('0x20'));if(!_[_0xbfb7('0x21')](_0x3e1d7c)){logger[_0xbfb7('0xf')](_[_0xbfb7('0x22')](_0x3e1d7c)?JSON[_0xbfb7('0x11')](_0x3e1d7c):_0x3e1d7c);}}_0x101e6a['on'](_0xbfb7('0x23'),_0x3975c2);_0x101e6a['on'](_0xbfb7('0x24'),_0x57774b);_0x101e6a['on'](_0xbfb7('0x25'),_0x44fe90);_0x101e6a['on']('error',_0x1039d2);});}; \ No newline at end of file +var _0x75b0=['Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','moment','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error'];(function(_0x165770,_0x2753c0){var _0x504074=function(_0x23f1b8){while(--_0x23f1b8){_0x165770['push'](_0x165770['shift']());}};_0x504074(++_0x2753c0);}(_0x75b0,0x196));var _0x075b=function(_0x3ce4f6,_0x1fb3b5){_0x3ce4f6=_0x3ce4f6-0x0;var _0x4e4fe2=_0x75b0[_0x3ce4f6];return _0x4e4fe2;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x075b('0x0'));var crypto=require(_0x075b('0x1'));var logger=require(_0x075b('0x2'))('agi');module[_0x075b('0x3')]=function(_0x5e4c9e,_0x1b3f72,_0x2cc285,_0x558f86){return new BPromise(function(_0x533b52,_0x5ba162){logger[_0x075b('0x4')]('Tilde\x20URI',_0x558f86||_0x075b('0x5'));var _0x9dbbea=new WebSocket(_0x558f86||_0x075b('0x5'),{'perMessageDeflate':![]});var _0x12fe98='';var _0x3f95cf='0';var _0x5931db='1';var _0x5ba525=_0x075b('0x6');function _0x4b1174(_0x4f53a5){var _0x5254f6=crypto['createHash'](_0x075b('0x7'));_0x5254f6[_0x075b('0x8')](_0x4f53a5);return _0x5254f6[_0x075b('0x9')](_0x075b('0xa'));}function _0x5e57c7(){try{logger['info'](_0x075b('0xb'));var _0x3016dd=moment()[_0x075b('0xc')]();var _0x30a6cd=_0x4b1174(_0x3016dd+_0x1b3f72+_0x2cc285);_0x9dbbea[_0x075b('0xd')](JSON[_0x075b('0xe')]({'appID':_0x1b3f72,'timestamp':_0x3016dd,'appKey':_0x30a6cd}));var _0x364aa5=fs['createReadStream'](_0x5e4c9e);_0x364aa5['on'](_0x075b('0xf'),function(_0x5e0848){_0x9dbbea[_0x075b('0xd')](_0x5e0848);});_0x364aa5['on'](_0x075b('0x10'),function(){_0x9dbbea[_0x075b('0xd')](_0x075b('0x11'));});}catch(_0x48969f){logger[_0x075b('0x12')](_0x075b('0x13'),JSON[_0x075b('0xe')](_0x48969f));_0x9dbbea['terminate']();}}function _0x24c449(_0x169e19){try{if(_0x169e19){var _0x3428b7=JSON['parse'](_0x169e19);switch(_0x3428b7[_0x075b('0x14')]){case 0x0:if(_0x3428b7[_0x075b('0x15')]){if(_0x3428b7[_0x075b('0x15')][_0x075b('0x16')]){logger['info'](_0x075b('0x17'),JSON['stringify'](_0x3428b7[_0x075b('0x15')][_0x075b('0x18')]));_0x12fe98=_0x3428b7[_0x075b('0x15')]['hypotheses'][0x0][_0x075b('0x19')];_0x3f95cf=_0x3428b7[_0x075b('0x15')][_0x075b('0x18')][0x0][_0x075b('0x1a')];_0x5931db='0';_0x5ba525=_0x075b('0x1b');_0x9dbbea[_0x075b('0x1c')]();}}break;case 0x1:logger[_0x075b('0x4')](_0x075b('0x6'));_0x5931db='1';_0x5ba525=_0x075b('0x6');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x5931db='2';_0x5ba525=_0x075b('0x1d');break;case 0x9:logger['info'](_0x075b('0x1e'));_0x5931db='9';_0x5ba525='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x075b('0x4')]('Authentication\x20failed.');_0x5931db='10';_0x5ba525=_0x075b('0x1f');break;case 0xb:logger[_0x075b('0x4')](_0x075b('0x20'));_0x5931db='11';_0x5ba525=_0x075b('0x20');}}}catch(_0x15b60a){logger['error'](_0x075b('0x21'),JSON['stringify'](_0x15b60a));_0x9dbbea[_0x075b('0x1c')]();}}function _0x1c866d(){logger['info'](_0x075b('0x22'));_0x533b52({'transcript':_0x12fe98,'confidence':_0x3f95cf,'status':_0x5931db,'status_message':_0x5ba525});}function _0x2910e2(_0x34b69a){logger[_0x075b('0x12')](_0x075b('0x23'));if(!_[_0x075b('0x24')](_0x34b69a)){logger[_0x075b('0x12')](_[_0x075b('0x25')](_0x34b69a)?JSON[_0x075b('0xe')](_0x34b69a):_0x34b69a);}}_0x9dbbea['on'](_0x075b('0x26'),_0x5e57c7);_0x9dbbea['on'](_0x075b('0x27'),_0x24c449);_0x9dbbea['on'](_0x075b('0x10'),_0x1c866d);_0x9dbbea['on'](_0x075b('0x12'),_0x2910e2);});}; \ 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 509348d..f38f95b 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 _0xc485=['exports','./asr'];(function(_0x4c62f9,_0x3430d4){var _0x464499=function(_0x142767){while(--_0x142767){_0x4c62f9['push'](_0x4c62f9['shift']());}};_0x464499(++_0x3430d4);}(_0xc485,0x1c7));var _0x5c48=function(_0x315002,_0x4ee032){_0x315002=_0x315002-0x0;var _0x54e480=_0xc485[_0x315002];return _0x54e480;};var asr=require(_0x5c48('0x0'));module[_0x5c48('0x1')]={'asr':asr}; \ No newline at end of file +var _0x4ac8=['./asr'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0x4ac8,0x70));var _0x84ac=function(_0x2518cf,_0x56f808){_0x2518cf=_0x2518cf-0x0;var _0x190ccb=_0x4ac8[_0x2518cf];return _0x190ccb;};var asr=require(_0x84ac('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4821888..33eb008 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 _0x4c77=['E_AGI_SERVER_VOICE_DISABLED','destroy','code','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','E_AGI_SERVER_ERROR'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0x4c77,0x1bf));var _0x74c7=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4c77[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x74c7('0x0'));var net=require(_0x74c7('0x1'));var EventEmitter=require(_0x74c7('0x2'))[_0x74c7('0x3')];var AGIError=require(_0x74c7('0x4'));var AGIChannel=require(_0x74c7('0x5'));var AGIServer=function(_0x545495,_0x104e09,_0x3b5b49){var _0x10bdea=this,_0x545495=_0x545495||0x11dd,_0x104e09=_0x104e09||_0x74c7('0x6'),_0x401d8e=null,_0x304860=0x0;EventEmitter[_0x74c7('0x7')](_0x10bdea);function _0x5d08eb(){if(!_0x545495){_0x10bdea[_0x74c7('0x8')](_0x74c7('0x9'),new AGIError(_0x74c7('0xa')));return![];}_0x401d8e=net[_0x74c7('0xb')]();_0x401d8e['listen'](_0x545495,_0x104e09);_0x401d8e['on'](_0x74c7('0xc'),function(){_0x10bdea[_0x74c7('0x8')]('listening');});_0x401d8e['on'](_0x74c7('0xd'),function(_0x3b798f){_0x401d8e['getConnections'](function(_0x41dcd6,_0x4ab4e8){if(_0x41dcd6){_0x10bdea['emit'](_0x74c7('0x9'),new AGIError(_0x74c7('0xe'),_0x41dcd6));}else if(_0x3b5b49&&_0x3b5b49<0x0){_0x10bdea['emit'](_0x74c7('0x9'),new AGIError(_0x74c7('0xf')));_0x3b798f[_0x74c7('0x10')]();}else if(_0x3b5b49&&_0x3b5b49>0x0&&_0x3b5b49<_0x4ab4e8){_0x304860+=0x1;_0x10bdea['emit'](_0x74c7('0x9'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x304860));_0x3b798f[_0x74c7('0x10')]();}else{var _0x385874=new AGIChannel(_0x3b798f);_0x385874['on']('ready',function(){_0x10bdea[_0x74c7('0x8')](_0x74c7('0xd'),_0x385874);});}});});_0x401d8e['on'](_0x74c7('0x9'),function(_0x4a42f9){_0x10bdea[_0x74c7('0x8')](_0x74c7('0x9'),new AGIError(_0x74c7('0xe'),_0x4a42f9[_0x74c7('0x11')]));});_0x401d8e['on']('close',function(){_0x10bdea[_0x74c7('0x8')]('close',new AGIError(_0x74c7('0x12')));});}process[_0x74c7('0x13')](function(){_0x5d08eb();});};util[_0x74c7('0x14')](AGIServer,EventEmitter);module[_0x74c7('0x15')]=function(_0x4fe643,_0x3323fe,_0x525637){return new AGIServer(_0x4fe643,_0x3323fe,_0x525637);}; \ No newline at end of file +var _0x2054=['createServer','listen','listening','connection','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter','./error','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x2da0f8,_0x1a3f03){var _0x5d0f13=function(_0x2e5b7b){while(--_0x2e5b7b){_0x2da0f8['push'](_0x2da0f8['shift']());}};_0x5d0f13(++_0x1a3f03);}(_0x2054,0x132));var _0x4205=function(_0x5e61b0,_0x5ee5b9){_0x5e61b0=_0x5e61b0-0x0;var _0x59116b=_0x2054[_0x5e61b0];return _0x59116b;};'use strict';var util=require(_0x4205('0x0'));var net=require(_0x4205('0x1'));var EventEmitter=require(_0x4205('0x2'))[_0x4205('0x3')];var AGIError=require(_0x4205('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x3f4adf,_0xb24973,_0x419cda){var _0x3756d9=this,_0x3f4adf=_0x3f4adf||0x11dd,_0xb24973=_0xb24973||_0x4205('0x5'),_0x5df3d2=null,_0x2e90ef=0x0;EventEmitter['call'](_0x3756d9);function _0x1633e3(){if(!_0x3f4adf){_0x3756d9[_0x4205('0x6')](_0x4205('0x7'),new AGIError(_0x4205('0x8')));return![];}_0x5df3d2=net[_0x4205('0x9')]();_0x5df3d2[_0x4205('0xa')](_0x3f4adf,_0xb24973);_0x5df3d2['on'](_0x4205('0xb'),function(){_0x3756d9[_0x4205('0x6')]('listening');});_0x5df3d2['on'](_0x4205('0xc'),function(_0x168174){_0x5df3d2['getConnections'](function(_0x2ed5ae,_0x493df4){if(_0x2ed5ae){_0x3756d9['emit'](_0x4205('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x2ed5ae));}else if(_0x419cda&&_0x419cda<0x0){_0x3756d9[_0x4205('0x6')](_0x4205('0x7'),new AGIError(_0x4205('0xd')));_0x168174[_0x4205('0xe')]();}else if(_0x419cda&&_0x419cda>0x0&&_0x419cda<_0x493df4){_0x2e90ef+=0x1;_0x3756d9[_0x4205('0x6')](_0x4205('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x2e90ef));_0x168174[_0x4205('0xe')]();}else{var _0x4aaa7b=new AGIChannel(_0x168174);_0x4aaa7b['on'](_0x4205('0xf'),function(){_0x3756d9['emit'](_0x4205('0xc'),_0x4aaa7b);});}});});_0x5df3d2['on'](_0x4205('0x7'),function(_0x5841ba){_0x3756d9[_0x4205('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x5841ba[_0x4205('0x10')]));});_0x5df3d2['on'](_0x4205('0x11'),function(){_0x3756d9[_0x4205('0x6')]('close',new AGIError(_0x4205('0x12')));});}process[_0x4205('0x13')](function(){_0x1633e3();});};util['inherits'](AGIServer,EventEmitter);module[_0x4205('0x14')]=function(_0x3fe2e6,_0x102eeb,_0x3a77f0){return new AGIServer(_0x3fe2e6,_0x102eeb,_0x3a77f0);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 6865d11..f0619d2 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 _0x9780=['createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','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','host','127.0.0.1','system','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','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','voicemail','VOICEMAIL','mailbox','vswitch','join','exports','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','includes','PUT','toUpperCase','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','isString','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','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','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','keys','%s[%s][%s]','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','Trying\x20SestekNDA:\x20%s','out','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','no\x20key\x20configured','%s/recordings/%s','generate','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','wav','NOBEEP','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','Executed\x20command\x20%s\x20%s','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x9780,0x1d4));var _0x0978=function(_0x545a02,_0x2efaab){_0x545a02=_0x545a02-0x0;var _0x70e3e=_0x9780[_0x545a02];return _0x70e3e;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require(_0x0978('0x0'));var odbc=require(_0x0978('0x1'))();var rs=require(_0x0978('0x2'));var moment=require(_0x0978('0x3'));var Mustache=require(_0x0978('0x4'));var rp=require(_0x0978('0x5'));var logger=require(_0x0978('0x6'))(_0x0978('0x7'));var config=require(_0x0978('0x8'));var shared=require(_0x0978('0x9'));var scripts=require(_0x0978('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x0978('0xb'),_0x0978('0xc')];var verticesWithRetry=[_0x0978('0xd'),_0x0978('0xe'),_0x0978('0xf')];var AGIVertices=function(_0x1883a7,_0x2aa5ff,_0x34081e){this[_0x0978('0x10')]=_0x1883a7;this[_0x0978('0x11')]=_0x2aa5ff;this[_0x0978('0x12')]=_0x34081e;};AGIVertices['prototype'][_0x0978('0x13')]=function(_0x559b1d,_0x1fb10a){this[_0x0978('0x11')][_0x0978('0x14')](_0x559b1d)[_0x0978('0x15')](function(_0x50e2d2){_0x1fb10a(null,_0x50e2d2?_0x50e2d2[_0x0978('0x16')]:![]);})['catch'](function(_0x3cc5e6){_0x1fb10a(_0x3cc5e6);});};AGIVertices[_0x0978('0x17')][_0x0978('0x18')]=function(_0x2ce60a,_0x155a71){this[_0x0978('0x11')][_0x0978('0x19')](_0x2ce60a)[_0x0978('0x15')](function(_0x4c35bb){_0x155a71(null,_0x4c35bb?_0x4c35bb[_0x0978('0x16')]:![]);})[_0x0978('0x1a')](function(_0x1fe6a9){_0x155a71(_0x1fe6a9);});};AGIVertices[_0x0978('0x17')][_0x0978('0x1b')]=function(_0x20a78d,_0xb41163){this[_0x0978('0x11')][_0x0978('0x1c')](_0x20a78d)['then'](function(_0x18f40a){_0xb41163(null,_0x18f40a?_0x18f40a[_0x0978('0x16')]:![]);})[_0x0978('0x1a')](function(_0x33615c){_0xb41163(_0x33615c);});};AGIVertices[_0x0978('0x17')][_0x0978('0x1d')]=function(_0x1cdd40,_0xd01b3a){this[_0x0978('0x11')]['getSquareOdbcById'](_0x1cdd40)[_0x0978('0x15')](function(_0xad6a1d){_0xd01b3a(null,_0xad6a1d?_0xad6a1d[_0x0978('0x1e')]:![]);})['catch'](function(_0x1ac591){_0xd01b3a(_0x1ac591);});};AGIVertices[_0x0978('0x17')][_0x0978('0x1f')]=function(_0x5b6558,_0x1c97a9){this['rpc'][_0x0978('0x20')](_0x5b6558)['then'](function(_0x2f61db){_0x1c97a9(null,_0x2f61db?_0x2f61db['name']:![]);})[_0x0978('0x1a')](function(_0x58e40d){_0x1c97a9(_0x58e40d);});};AGIVertices[_0x0978('0x17')]['getTrunk']=function(_0x584da0,_0x369a39){this[_0x0978('0x11')][_0x0978('0x21')](_0x584da0)[_0x0978('0x15')](function(_0xfc2d7e){_0x369a39(null,_0xfc2d7e?_0xfc2d7e[_0x0978('0x16')]:![]);})[_0x0978('0x1a')](function(_0x39fff2){_0x369a39(_0x39fff2);});};AGIVertices[_0x0978('0x17')][_0x0978('0x22')]=function(_0x30e7ec,_0x46c522){var _0x44422c=this;this[_0x0978('0x11')][_0x0978('0x23')](_0x30e7ec)[_0x0978('0x15')](function(_0x16a8e8){_0x46c522(null,_0x16a8e8?_0x44422c[_0x0978('0x24')](_0x16a8e8[_0x0978('0x25')]):![]);})['catch'](function(_0x3c5196){_0x46c522(_0x3c5196);});};AGIVertices['prototype'][_0x0978('0x26')]=function(_0x22e75d,_0x339e0b){this[_0x0978('0x11')][_0x0978('0x27')](_0x22e75d)[_0x0978('0x15')](function(_0x3dfd0c){_0x339e0b(null,_0x3dfd0c?_0x3dfd0c:![]);})[_0x0978('0x1a')](function(_0x28f420){_0x339e0b(_0x28f420);});};AGIVertices[_0x0978('0x17')][_0x0978('0x28')]=function(_0x302cd2,_0x41e169,_0x14cbc2){this[_0x0978('0x12')][_0x0978('0x28')](_0x302cd2,_0x41e169)[_0x0978('0x15')](function(){_0x14cbc2(null);})[_0x0978('0x1a')](function(_0x59ed30){_0x14cbc2(_0x59ed30);});};AGIVertices[_0x0978('0x17')][_0x0978('0x29')]=function(_0x1a0bd3,_0x3851fe){this[_0x0978('0x11')]['getIntervalById'](_0x1a0bd3)[_0x0978('0x15')](function(_0x290678){if(_0x290678){if(_0x290678[_0x0978('0x2a')]){_0x3851fe(null,[_0x290678[_0x0978('0x2b')]]);}else{_0x3851fe(null,_['map'](_0x290678['Intervals'],_0x0978('0x2b')));}}else{_0x3851fe(null,![]);}})[_0x0978('0x1a')](function(_0x3724c0){_0x3851fe(_0x3724c0);});};AGIVertices['prototype'][_0x0978('0x24')]=function(_0x270605){return util[_0x0978('0x2c')](_0x0978('0x2d'),FILES_PATH,_0x270605);};AGIVertices['prototype'][_0x0978('0x2e')]=function(_0x536e56,_0x3ab290,_0x28abc6){odbc[_0x0978('0x2f')](_0x536e56,function(_0x2b7511){if(_0x2b7511){logger[_0x0978('0x30')](_0x0978('0x31'),_0x2b7511);_0x28abc6(_0x2b7511);}else{logger[_0x0978('0x32')]('ODBC\x20connection\x20successfully');odbc[_0x0978('0x33')](_0x3ab290,function(_0x142d5f,_0x3178bb){if(_0x142d5f){logger['info'](_0x0978('0x34'),_0x3ab290);_0x28abc6(_0x142d5f);}else{logger[_0x0978('0x32')](_0x0978('0x35'),_0x3ab290);odbc[_0x0978('0x36')](function(_0x543a81){if(_0x543a81){logger['error'](_0x0978('0x37'),_0x543a81);}_0x28abc6(null,_0x3178bb);});}});}});};AGIVertices['prototype'][_0x0978('0x38')]=function(_0x34ad50,_0x20e335){this[_0x0978('0x11')][_0x0978('0x39')](_0x34ad50)[_0x0978('0x15')](function(_0x520f40){_0x20e335(null,_0x520f40?_0x520f40:![]);})['catch'](function(_0x56049e){_0x20e335(_0x56049e);});};AGIVertices[_0x0978('0x17')]['createSmsMessage']=function(_0x3d571a,_0x5087b7){this[_0x0978('0x11')]['createSmsMessage'](_0x3d571a)[_0x0978('0x15')](function(_0x534d07){_0x5087b7(null,_0x534d07);})[_0x0978('0x1a')](function(_0x3004f6){_0x5087b7(_0x3004f6);});};AGIVertices[_0x0978('0x17')]['createSquareDetailsReport']=function(_0x5a9ad4,_0x5b882a,_0x2c7cde){this[_0x0978('0x11')][_0x0978('0x3a')]({'uniqueid':this['channel'][_0x0978('0x3b')],'node':_0x5a9ad4[_0x0978('0x3c')],'application':_0x5a9ad4[_0x0978('0x3d')],'data':_0x5b882a||null,'project_name':this[_0x0978('0x10')][_0x0978('0x3e')],'callerid':this[_0x0978('0x10')]['callerid']})[_0x0978('0x15')](function(_0x1fcb2e){if(_0x2c7cde){_0x2c7cde(null,_0x1fcb2e);}})[_0x0978('0x1a')](function(_0x371230){if(_0x2c7cde){_0x2c7cde(_0x371230);}});};AGIVertices[_0x0978('0x17')]['createSquareRecording']=function(_0x167aa4,_0x3ef543,_0x5b360f,_0xa1cb3){this[_0x0978('0x11')][_0x0978('0x3f')]({'uniqueid':this[_0x0978('0x10')]['uniqueid'],'callerid':this[_0x0978('0x10')][_0x0978('0x40')],'calleridname':this[_0x0978('0x10')]['calleridname'],'context':this[_0x0978('0x10')]['context'],'extension':this[_0x0978('0x10')][_0x0978('0x41')],'priority':this[_0x0978('0x10')][_0x0978('0x42')],'accountcode':this['channel']['accountcode'],'dnid':this[_0x0978('0x10')][_0x0978('0x43')],'projectName':this[_0x0978('0x10')][_0x0978('0x3e')],'saveName':_0x3ef543,'filename':_0x167aa4[_0x0978('0x44')]||_0x3ef543,'savePath':_0x5b360f})[_0x0978('0x15')](function(_0x282cc4){_0xa1cb3(null,_0x282cc4);})[_0x0978('0x1a')](function(_0x89c79e){_0xa1cb3(_0x89c79e);});};AGIVertices[_0x0978('0x17')][_0x0978('0x45')]=function(_0x4cd586,_0x19cc09,_0x43e1f2,_0x1b75a4,_0x53b043){this[_0x0978('0x11')][_0x0978('0x45')]({'uniqueid':this['channel']['uniqueid'],'body':_0x4cd586,'direction':_0x19cc09,'providerName':_0x43e1f2,'providerResponse':_0x1b75a4})['then'](function(_0x1678b4){if(_0x53b043){_0x53b043(null,_0x1678b4);}})['catch'](function(_0x177080){if(_0x53b043){_0x53b043(_0x177080);}});};AGIVertices[_0x0978('0x17')][_0x0978('0x46')]=function(_0x18e0cf,_0x5f8358){this[_0x0978('0x11')]['createCmContact']({'firstName':_[_0x0978('0x47')](_0x18e0cf['name'])||_[_0x0978('0x48')](_0x18e0cf[_0x0978('0x16')])?'callback_'+Math[_0x0978('0x49')]():_0x18e0cf[_0x0978('0x16')],'lastName':_['isEmpty'](_0x18e0cf[_0x0978('0x4a')])||_['isNil'](_0x18e0cf[_0x0978('0x4a')])?null:_0x18e0cf[_0x0978('0x4a')],'phone':_0x18e0cf[_0x0978('0x4b')],'ListId':_0x18e0cf[_0x0978('0x4c')],'scheduledat':_0x18e0cf['scheduledAt'],'callbackUniqueid':this[_0x0978('0x10')][_0x0978('0x3b')],'tags':_0x0978('0x4d'),'description':_0x0978('0x4e')+_0x18e0cf[_0x0978('0x4f')]['toString'](),'priority':_0x18e0cf[_0x0978('0x50')]})[_0x0978('0x15')](function(_0x46f245){_0x5f8358(null,_0x46f245);})['catch'](function(_0x5097d7){_0x5f8358(_0x5097d7);});};AGIVertices['prototype'][_0x0978('0x51')]=function(_0xf0b3e2,_0x9c2de4){this[_0x0978('0x11')][_0x0978('0x52')](_0xf0b3e2)['then'](function(_0x4bade9){_0x9c2de4(null,_0x4bade9?_0x4bade9['name']:![]);})[_0x0978('0x1a')](function(_0x3eac9e){_0x9c2de4(_0x3eac9e);});};AGIVertices[_0x0978('0x17')][_0x0978('0x53')]=function(_0x4e2996,_0x1ee68a,_0x2ee52e){var _0x2d773f={'role':_0x0978('0x54')};_0x2d773f[_0x4e2996]=this[_0x0978('0x10')][_0x0978('0x40')];this[_0x0978('0x11')][_0x0978('0x53')](_0x2d773f,_0x1ee68a,this[_0x0978('0x10')]['uniqueid'])['then'](function(_0x47064c){_0x2ee52e(null,_[_0x0978('0x48')](_0x47064c)?![]:!![]);})[_0x0978('0x1a')](function(_0x3a3d7d){logger['error'](_0x3a3d7d);_0x2ee52e(null,![]);});};AGIVertices['prototype'][_0x0978('0x55')]=function(_0x55941e,_0x46b2a5){var _0x1fbdd6={'role':'agent'};_0x1fbdd6[_0x55941e]=this['channel'][_0x0978('0x40')];this[_0x0978('0x11')]['agentUnpause'](_0x1fbdd6)['then'](function(_0x3229e3){_0x46b2a5(null,_[_0x0978('0x48')](_0x3229e3)?![]:!![]);})['catch'](function(_0x62a7c4){logger[_0x0978('0x30')](_0x62a7c4);_0x46b2a5(null,![]);});};AGIVertices[_0x0978('0x17')][_0x0978('0x56')]=function(_0x2adb90,_0x2a7ffa){var _0xede249={'role':_0x0978('0x54')};_0xede249[_0x2adb90]=this[_0x0978('0x10')][_0x0978('0x40')];this[_0x0978('0x11')][_0x0978('0x56')](_0xede249)['then'](function(_0x46e919){_0x2a7ffa(null,_[_0x0978('0x48')](_0x46e919)?![]:!![]);})[_0x0978('0x1a')](function(_0x36e24a){logger[_0x0978('0x30')](_0x36e24a);_0x2a7ffa(null,![]);});};AGIVertices[_0x0978('0x17')][_0x0978('0x57')]=function(_0x2e95f1,_0xfa62a0){var _0x23c72c={'role':_0x0978('0x54')};_0x23c72c[_0x2e95f1]=this['channel'][_0x0978('0x40')];var _0x46aafe=_0x2e95f1!=_0x0978('0x58')?util[_0x0978('0x2c')](_0x0978('0x59'),_0x0978('0x5a'),this[_0x0978('0x10')][_0x0978('0x40')]):undefined;this[_0x0978('0x11')][_0x0978('0x57')](_0x23c72c,_0x46aafe)[_0x0978('0x15')](function(_0x4d164a){_0xfa62a0(null,_[_0x0978('0x48')](_0x4d164a)?![]:!![]);})[_0x0978('0x1a')](function(_0x5b6ef8){logger['error'](_0x5b6ef8);_0xfa62a0(null,![]);});};AGIVertices[_0x0978('0x17')][_0x0978('0x5b')]=function(_0x330a09,_0x39aad6){sh[_0x0978('0x5c')](_[_0x0978('0x5d')](_0x330a09),function(_0x569c48,_0x1992a9){var _0x33475c=_0x1992a9[_0x0978('0x5e')](/(\r\n|\n|\r)/gm,'');_0x39aad6(null,_0x33475c);});};AGIVertices['prototype'][_0x0978('0x5f')]=function(_0x5148c6,_0x179726){scripts[_0x0978('0x5f')](_0x5148c6[_0x0978('0x60')],_0x5148c6[_0x0978('0x61')]||_0x0978('0x62'),_0x5148c6[_0x0978('0x62')],_0x5148c6[_0x0978('0x63')]||_0x0978('0x64'),_0x5148c6['ssmlGender']||'MALE',_0x5148c6[_0x0978('0x65')]||_0x0978('0x66'))['then'](function(_0x6d5308){_0x179726(null,_0x6d5308);})[_0x0978('0x1a')](function(_0x3a176c){_0x179726(_0x3a176c);});};AGIVertices[_0x0978('0x17')]['googleTTS']=function(_0x4a2bfe,_0xf72884){scripts[_0x0978('0x67')](_0x4a2bfe[_0x0978('0x62')],_0x4a2bfe[_0x0978('0x68')]||'en',0x1)['then'](function(_0x2ed7f1){_0xf72884(null,_0x2ed7f1);})[_0x0978('0x1a')](function(_0x1a12c6){_0xf72884(_0x1a12c6);});};AGIVertices[_0x0978('0x17')][_0x0978('0x69')]=function(_0x5c06ce,_0x3a8543){var _0x37e237={'uri':_0x5c06ce[_0x0978('0x6a')],'method':_0x5c06ce[_0x0978('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5c06ce['timeout'])===_0x0978('0x6c')&&parseInt(_0x5c06ce['timeout'])>=0x1?parseInt(_0x5c06ce['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x0978('0x6d')](['POST',_0x0978('0x6e')],_0x37e237[_0x0978('0x6b')][_0x0978('0x6f')]())){try{_0x37e237['body']=_0x5c06ce[_0x0978('0xc')]?JSON[_0x0978('0x70')](_0x5c06ce[_0x0978('0xc')]):{};}catch(_0x890af0){logger[_0x0978('0x30')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x890af0);}}try{_0x37e237[_0x0978('0x71')]=_0x5c06ce['rawHeaders']?JSON[_0x0978('0x70')](_0x5c06ce[_0x0978('0xb')]):{};}catch(_0x36503e){logger[_0x0978('0x30')](_0x0978('0x72'),_0x36503e);}if(_0x5c06ce[_0x0978('0x73')]){try{var _0x2d4470=require(_0x5c06ce[_0x0978('0x73')])[_0x0978('0x74')](this,_0x37e237);_0x37e237[_0x0978('0x75')]=Mustache[_0x0978('0x76')](_0x5c06ce[_0x0978('0x6a')],_0x2d4470,{},['$$','$$']);if(_0x37e237[_0x0978('0x71')]){_0x37e237[_0x0978('0x71')]=JSON[_0x0978('0x70')](Mustache[_0x0978('0x76')](JSON[_0x0978('0x77')](_0x37e237[_0x0978('0x71')]),_0x2d4470,{},['$$','$$']));}if(_0x37e237[_0x0978('0x78')]){_0x37e237[_0x0978('0x78')]=JSON[_0x0978('0x70')](Mustache[_0x0978('0x76')](JSON[_0x0978('0x77')](_0x37e237[_0x0978('0x78')]),_0x2d4470,{},['$$','$$']));}}catch(_0x545030){logger['error'](_0x0978('0x79'),_0x545030);}}rp(_0x37e237)['then'](function(_0x333f23){var _0x2a92d1={'statusCode':_0x333f23[_0x0978('0x7a')]||0xc8,'statusMessage':_0x333f23['statusMessage']||'OK','headers':_0x333f23['headers']||{},'body':_0x333f23['body']||{}};_0x3a8543(null,_0x2a92d1);})[_0x0978('0x1a')](function(_0x3c49a3){var _0x130716={'statusCode':_0x3c49a3[_0x0978('0x7a')]||0x1f4,'statusMessage':_0x3c49a3[_0x0978('0x7b')]||_0x0978('0x7c'),'headers':_0x3c49a3[_0x0978('0x7d')][_0x0978('0x71')]||{},'body':_0x3c49a3[_0x0978('0x7d')]['body']||{}};_0x3a8543(null,_0x130716);});};AGIVertices['prototype'][_0x0978('0x7e')]=function(_0x579bb6,_0x3ef869){scripts['googleDialogflow'](this['channel'][_0x0978('0x3b')],_0x579bb6[_0x0978('0x7f')],_0x579bb6[_0x0978('0x62')],_0x579bb6[_0x0978('0x80')]||'en')['then'](function(_0x1ad1f3){_0x3ef869(null,_0x1ad1f3);})[_0x0978('0x1a')](function(_0x13adda){_0x3ef869(_0x13adda);});};AGIVertices[_0x0978('0x17')][_0x0978('0x81')]=function(_0x5ae54b,_0xc706fd){scripts[_0x0978('0x81')](this[_0x0978('0x10')][_0x0978('0x3b')],_0x5ae54b['dialogflowV2_project_id'],_0x5ae54b[_0x0978('0x82')],_0x5ae54b[_0x0978('0x83')],_0x5ae54b[_0x0978('0x62')],_0x5ae54b['dialogflowV2_language']||'en')[_0x0978('0x15')](function(_0x375c5e){_0xc706fd(null,_0x375c5e);})[_0x0978('0x1a')](function(_0x5570f4){_0xc706fd(_0x5570f4);});};AGIVertices[_0x0978('0x17')]['sestekNDA']=function(_0x5d227c,_0x59eae2){scripts[_0x0978('0x84')](this[_0x0978('0x10')],_0x5d227c)[_0x0978('0x15')](function(_0x32a7b3){_0x59eae2(null,_0x32a7b3);})['catch'](function(_0xf9ee12){_0x59eae2(_0xf9ee12);});};AGIVertices[_0x0978('0x17')][_0x0978('0x85')]=function(_0x4e5082,_0x128c4e){scripts[_0x0978('0x85')](_0x4e5082[_0x0978('0x7f')],_0x4e5082[_0x0978('0x62')],_0x4e5082[_0x0978('0x86')]||_0x0978('0x64'),_0x4e5082[_0x0978('0x87')])[_0x0978('0x15')](function(_0x38292a){_0x128c4e(null,_0x38292a);})[_0x0978('0x1a')](function(_0x436a79){_0x128c4e(_0x436a79);});};AGIVertices[_0x0978('0x17')][_0x0978('0x88')]=function(_0x5e3330,_0x37dbe5,_0x3d8b39){scripts[_0x0978('0x88')](_0x37dbe5,_0x5e3330[_0x0978('0x7f')],_0x5e3330['ispeech_asr_language']||_0x0978('0x64'),this[_0x0978('0x89')](_0x5e3330[_0x0978('0x8a')])?_0x5e3330[_0x0978('0x8a')]:undefined)[_0x0978('0x15')](function(_0x8e8843){_0x3d8b39(null,_0x8e8843);})[_0x0978('0x1a')](function(_0x3cca73){_0x3d8b39(_0x3cca73);});};AGIVertices['prototype'][_0x0978('0x8b')]=function(_0x518bb8,_0x175277){scripts['awsPolly'](_0x518bb8[_0x0978('0x8c')],_0x518bb8[_0x0978('0x8d')],_0x518bb8['aws_polly_region'],_0x518bb8[_0x0978('0x8e')]||_0x0978('0x8f'),_0x518bb8[_0x0978('0x62')],_0x518bb8[_0x0978('0x90')]||_0x0978('0x62'))['then'](function(_0x3a1cda){_0x175277(null,_0x3a1cda);})['catch'](function(_0x26d9a7){_0x175277(_0x26d9a7);});};AGIVertices['prototype'][_0x0978('0x91')]=function(_0x4961c9,_0x1376dd){scripts[_0x0978('0x91')](this[_0x0978('0x10')][_0x0978('0x3b')],_0x4961c9[_0x0978('0x8c')],_0x4961c9[_0x0978('0x8d')],_0x4961c9[_0x0978('0x92')],_0x4961c9[_0x0978('0x62')],_0x4961c9[_0x0978('0x93')])[_0x0978('0x15')](function(_0x18e419){_0x1376dd(null,_0x18e419);})[_0x0978('0x1a')](function(_0x3e89ac){_0x1376dd(_0x3e89ac);});};AGIVertices[_0x0978('0x17')][_0x0978('0x94')]=function(_0x4d2a06,_0x44d8ed,_0x1059ce){scripts['googleASR'](_0x44d8ed,_0x4d2a06[_0x0978('0x7f')],_0x4d2a06[_0x0978('0x95')]||_0x0978('0x64'))[_0x0978('0x15')](function(_0x377e5d){_0x1059ce(null,_0x377e5d);})[_0x0978('0x1a')](function(_0xe0cbff){_0x1059ce(_0xe0cbff);});};AGIVertices[_0x0978('0x17')][_0x0978('0x96')]=function(_0x3f9025,_0x2b5aac,_0x158d0c){scripts['tildeASR'](_0x2b5aac,_0x3f9025[_0x0978('0x97')],_0x3f9025[_0x0978('0x98')],_0x3f9025[_0x0978('0x75')])[_0x0978('0x15')](function(_0x2ee8d7){_0x158d0c(null,_0x2ee8d7);})[_0x0978('0x1a')](function(_0xf3cbdb){_0x158d0c(_0xf3cbdb);});};AGIVertices[_0x0978('0x17')][_0x0978('0x99')]=function(_0x1afab6){var _0x18d1ae=_[_0x0978('0x6d')](verticesWithRetry,_0x1afab6[_0x0978('0x3d')])?_0x1afab6:_['clone'](_0x1afab6);for(var _0x2f6488 in _0x18d1ae){if(_0x18d1ae[_0x0978('0x9a')](_0x2f6488)){if(_0x18d1ae[_0x2f6488]&&_['isString'](_0x18d1ae[_0x2f6488])){if(_['includes'](recursiveMapAttributes,_0x2f6488)){_0x18d1ae[_0x2f6488]=this['replaceObjectAllVariables'](_0x18d1ae[_0x2f6488]);}else{_0x18d1ae[_0x2f6488]=this[_0x0978('0x9b')](_0x18d1ae[_0x2f6488]);}}}}return _0x18d1ae;};AGIVertices[_0x0978('0x17')][_0x0978('0x9c')]=function(_0x3336ac){for(var _0x9dff42 in _0x3336ac){if(_0x3336ac['hasOwnProperty'](_0x9dff42)){if(_[_0x0978('0x9d')](_0x3336ac[_0x9dff42])){this[_0x0978('0x9c')](_0x3336ac[_0x9dff42]);}else if(_['isArray'](_0x3336ac[_0x9dff42])){for(var _0xb6cf7a=0x0;_0xb6cf7a<_0x3336ac[_0x9dff42][_0x0978('0x9e')];_0xb6cf7a++){this[_0x0978('0x9c')](_0x3336ac[_0x9dff42][_0xb6cf7a]);}}else if(_[_0x0978('0x9f')](_0x3336ac[_0x9dff42])){_0x3336ac[_0x9dff42]=this['replaceAllVariables'](_0x3336ac[_0x9dff42]);}}}};AGIVertices['prototype'][_0x0978('0xa0')]=function(_0x5d4227,_0x19d2bc){for(var _0x41c464 in _0x5d4227){if(_0x5d4227[_0x0978('0x9a')](_0x41c464)){if(_[_0x0978('0x9d')](_0x5d4227[_0x41c464])){if(!_[_0x0978('0x47')](_0x5d4227[_0x41c464])){this[_0x0978('0xa0')](_0x5d4227[_0x41c464],util[_0x0978('0x2c')](_0x0978('0xa1'),_0x19d2bc,_0x41c464));}}else if(_[_0x0978('0xa2')](_0x5d4227[_0x41c464])){for(var _0x515173=0x0;_0x515173<_0x5d4227[_0x41c464][_0x0978('0x9e')];_0x515173++){this['saveRestApiResult'](_0x5d4227[_0x41c464][_0x515173],util[_0x0978('0x2c')](_0x0978('0xa1'),_0x19d2bc,_0x41c464+'['+_0x515173+']'));}}else{if(!_[_0x0978('0x48')](_0x5d4227[_0x41c464])){this[_0x0978('0x10')][_0x0978('0xa3')](util[_0x0978('0x2c')](_0x0978('0xa1'),_0x19d2bc,_0x41c464),_0x5d4227[_0x41c464]);}}}}};AGIVertices[_0x0978('0x17')]['replaceObjectAllVariables']=function(_0x30e9da){try{var _0x1f7d99=JSON[_0x0978('0x70')](_0x30e9da);this[_0x0978('0x9c')](_0x1f7d99);return JSON[_0x0978('0x77')](_0x1f7d99);}catch(_0x39600a){return this['replaceAllVariables'](_0x30e9da);}};AGIVertices[_0x0978('0x17')]['replaceAllVariables']=function(_0x22975a){var _0x5b4080=_0x22975a['split']('{');for(var _0x55c81e=0x1;_0x55c81e<_0x5b4080['length'];_0x55c81e+=0x1){var _0xe58abf=_0x5b4080[_0x55c81e][_0x0978('0xa4')]('}');if(_0xe58abf[_0x0978('0x9e')]>0x1){_0x22975a=_0x22975a[_0x0978('0xa5')]('{'+_0xe58abf[0x0]+'}',this[_0x0978('0x10')][_0x0978('0x13')](_0xe58abf[0x0])[_0x0978('0xa6')]||_0xe58abf[0x0]);}}if(_0x5b4080[_0x0978('0x9e')]===0x1){return _0x22975a[_0x0978('0xa7')]();}return this[_0x0978('0x9b')](_0x22975a);};AGIVertices[_0x0978('0x17')][_0x0978('0xa8')]=function(_0x5b1c4f,_0x5c6686){var _0x5cd763=this['channel'][_0x0978('0x13')](_0x5b1c4f);if(_0x5cd763[_0x0978('0xa9')]===-0x1){return _0x5cd763;}logger['info'](util[_0x0978('0x2c')](_0x0978('0xaa'),_0x5c6686,_0x5cd763['extra']));return this[_0x0978('0x10')][_0x0978('0xa3')](_0x5c6686,_0x5cd763[_0x0978('0xa6')]);};AGIVertices[_0x0978('0x17')][_0x0978('0x89')]=function(_0x2c9b34){return _0x2c9b34&&_0x2c9b34!=='0'&&_0x2c9b34!=='-1'&&_0x2c9b34!=='';};AGIVertices[_0x0978('0x17')][_0x0978('0xab')]=function(_0x43abab){this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x43abab,'-');_0x43abab[_0x0978('0xac')]=_0x43abab[_0x0978('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0978('0x17')][_0x0978('0xad')]=function(_0x4e5a80){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xae'),_0x4e5a80[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x4e5a80['text'])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb0'));}var _0x2d5091='\x22'+_0x4e5a80['text']+'\x22';if(this[_0x0978('0x89')](_0x4e5a80['options'])){_0x2d5091+=','+_0x4e5a80[_0x0978('0x7d')];}var _0x44f5e4=this[_0x0978('0x10')][_0x0978('0x5c')](_0x0978('0xb1'),_0x2d5091);if(_0x44f5e4[_0x0978('0xa9')]===-0x1){return _0x44f5e4;}return this[_0x0978('0x10')][_0x0978('0xaf')](util['format'](_0x0978('0xb2'),_0x2d5091));};AGIVertices[_0x0978('0x17')]['mrcprecog']=function(_0x2469ac){logger['info'](util[_0x0978('0x2c')](_0x0978('0xb3'),_0x2469ac['label']));if(!this[_0x0978('0x89')](_0x2469ac[_0x0978('0xb4')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb5'));}var _0x489b59=_0x2469ac[_0x0978('0xb4')];if(this[_0x0978('0x89')](_0x2469ac['options'])){_0x489b59+=','+_0x2469ac['options'];}var _0xeb4cfd=this[_0x0978('0x10')][_0x0978('0x5c')](_0x0978('0xb6'),_0x489b59);if(_0xeb4cfd[_0x0978('0xa9')]===-0x1){return _0xeb4cfd;}var _0x2c70d4=this[_0x0978('0xa8')](_0x0978('0xb7'),_0x0978('0xb8'));if(_0x2c70d4['result']===-0x1){return _0x2c70d4;}var _0x426313=this[_0x0978('0xa8')](_0x0978('0xb9'),'MRCP_RECOG_TRANSCRIPT');if(_0x426313['result']===-0x1){return _0x426313;}var _0x1fc2db=this['getAndSetVariable'](_0x0978('0xba'),_0x0978('0xbb'));if(_0x1fc2db['result']===-0x1){return _0x1fc2db;}return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0xbc'),_0x489b59));};AGIVertices[_0x0978('0x17')][_0x0978('0x7')]=function(_0x1b9928){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xbd'),_0x1b9928['label']));return this[_0x0978('0x10')]['agi']([_0x1b9928[_0x0978('0xbe')],_0x1b9928[_0x0978('0xbf')]]);};AGIVertices[_0x0978('0x17')][_0x0978('0xc0')]=function(_0x51e734){logger[_0x0978('0x32')](util[_0x0978('0x2c')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x51e734[_0x0978('0x3c')]));if(this[_0x0978('0x89')](_0x51e734[_0x0978('0xc1')])){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xc2'),_0x51e734[_0x0978('0xc1')]));var _0xa80859=this[_0x0978('0x10')][_0x0978('0xc3')](_0x51e734[_0x0978('0xc1')]);if(_0xa80859['result']===-0x1){return _0xa80859;}}return this[_0x0978('0x10')][_0x0978('0xc0')]();};AGIVertices['prototype'][_0x0978('0x4d')]=function(_0x3e4006){logger['info'](util[_0x0978('0x2c')](_0x0978('0xc4'),_0x3e4006[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x3e4006[_0x0978('0x4c')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x3e4006,_0x0978('0xc5'));}_0x3e4006[_0x0978('0x4f')]=moment();if(this['isConfigured'](_0x3e4006['delay'])){_0x3e4006[_0x0978('0x4f')]=moment()[_0x0978('0xc6')](_0x3e4006[_0x0978('0xc7')],_0x0978('0xc8'));}if(!this['isConfigured'](_0x3e4006['callback_priority'])){_0x3e4006[_0x0978('0x50')]=0x2;}this['createCmContact']['sync'](this,_0x3e4006);return this['channel'][_0x0978('0xaf')](util['format'](_0x0978('0xc9'),_0x3e4006[_0x0978('0x4b')],_0x3e4006[_0x0978('0x4c')],_0x3e4006['scheduledAt']));};AGIVertices[_0x0978('0x17')][_0x0978('0xca')]=function(_0x5328b0){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xcb'),_0x5328b0[_0x0978('0x3c')]));var _0x340848=this['channel'][_0x0978('0x5c')](_0x5328b0[_0x0978('0xcc')],_0x5328b0['options']);if(_0x340848[_0x0978('0xa9')]===-0x1){return _0x340848;}return this[_0x0978('0x10')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x5328b0['application'],_0x5328b0['options']));};AGIVertices[_0x0978('0x17')][_0x0978('0xcd')]=function(_0x5b6ade){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xce'),_0x5b6ade[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x5b6ade[_0x0978('0x62')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb0'));}var _0x25b3b4='\x22'+_0x5b6ade[_0x0978('0x62')]+'\x22';if(this['isConfigured'](_0x5b6ade[_0x0978('0x7d')])){_0x25b3b4+=','+_0x5b6ade[_0x0978('0x7d')];}var _0x17aa08=this[_0x0978('0x10')]['exec']('MRCPSynth',_0x25b3b4);if(_0x17aa08[_0x0978('0xa9')]===-0x1){return _0x17aa08;}return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0xb2'),_0x25b3b4));};AGIVertices[_0x0978('0x17')][_0x0978('0xcf')]=function(_0x3652d4){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xd0'),_0x3652d4['label']));if(!this[_0x0978('0x89')](_0x3652d4[_0x0978('0x62')])){return this[_0x0978('0x10')]['noop'](_0x0978('0xb0'));}var _0x45a043='\x22'+_0x3652d4['text']+'\x22';if(this[_0x0978('0x89')](_0x3652d4[_0x0978('0x7d')])){_0x45a043+=','+_0x3652d4[_0x0978('0x7d')];}var _0x526f3b=this[_0x0978('0x10')][_0x0978('0x5c')](_0x0978('0xb1'),_0x45a043);if(_0x526f3b[_0x0978('0xa9')]===-0x1){return _0x526f3b;}return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0xb2'),_0x45a043));};AGIVertices[_0x0978('0x17')][_0x0978('0xd1')]=function(_0x35d630){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xd2'),_0x35d630[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x35d630[_0x0978('0xb4')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb5'));}var _0xc01dfe=_0x35d630[_0x0978('0xb4')];if(this['isConfigured'](_0x35d630[_0x0978('0x7d')])){_0xc01dfe+=','+_0x35d630[_0x0978('0x7d')];}var _0x21299e=this[_0x0978('0x10')]['exec'](_0x0978('0xb6'),_0xc01dfe);if(_0x21299e[_0x0978('0xa9')]===-0x1){return _0x21299e;}var _0x195ee3=this['getAndSetVariable'](_0x0978('0xb7'),_0x0978('0xd3'));if(_0x195ee3[_0x0978('0xa9')]===-0x1){return _0x195ee3;}var _0x58e8c0=this['getAndSetVariable'](_0x0978('0xb9'),_0x0978('0xd4'));if(_0x58e8c0[_0x0978('0xa9')]===-0x1){return _0x58e8c0;}var _0x42687e=this[_0x0978('0xa8')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x42687e[_0x0978('0xa9')]===-0x1){return _0x42687e;}return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0xc01dfe));};AGIVertices['prototype']['sestekasr']=function(_0x450cc1){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xd5'),_0x450cc1[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x450cc1['grammar'])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb5'));}var _0x4a2e36=_0x450cc1['grammar'];if(this[_0x0978('0x89')](_0x450cc1[_0x0978('0x7d')])){_0x4a2e36+=','+_0x450cc1[_0x0978('0x7d')];}var _0x32eca3=this[_0x0978('0x10')][_0x0978('0x5c')]('MRCPRecog',_0x4a2e36);if(_0x32eca3[_0x0978('0xa9')]===-0x1){return _0x32eca3;}var _0x33c6e1=this[_0x0978('0xa8')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x33c6e1['result']===-0x1){return _0x33c6e1;}var _0x867e8b=this[_0x0978('0xa8')](_0x0978('0xb9'),_0x0978('0xd6'));if(_0x867e8b['result']===-0x1){return _0x867e8b;}var _0x2198c5=this[_0x0978('0xa8')]('RECOG_INSTANCE()',_0x0978('0xd7'));if(_0x2198c5['result']===-0x1){return _0x2198c5;}return this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')](_0x0978('0xbc'),_0x4a2e36));};AGIVertices[_0x0978('0x17')][_0x0978('0xd8')]=function(_0x3e531f){logger[_0x0978('0x32')](util['format'](_0x0978('0xd9'),_0x3e531f[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x3e531f['odbc_id'])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x3e531f,_0x0978('0xda'));}var _0x5644f5=this[_0x0978('0x1d')][_0x0978('0x74')](this,_0x3e531f[_0x0978('0xdb')]);if(!_0x5644f5){return this[_0x0978('0x10')][_0x0978('0x30')](_0x3e531f,_0x0978('0xdc'));}if(!this[_0x0978('0x89')](_0x3e531f[_0x0978('0x33')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x3e531f,_0x0978('0xdd'));}var _0x4c9d85=_0x3e531f[_0x0978('0x33')][_0x0978('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0978('0x10')][_0x0978('0xaf')](util['format'](_0x0978('0xde'),_0x4c9d85));var _0xdf31c2=this[_0x0978('0x2e')]['sync'](this,_0x5644f5,_0x4c9d85);this['createSquareDetailsReport'][_0x0978('0x74')](this,_0x3e531f,_0x4c9d85);if(!this[_0x0978('0x89')](_0x3e531f[_0x0978('0xdf')])){return this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x23a922=this[_0x0978('0x13')][_0x0978('0x74')](this,_0x3e531f[_0x0978('0xdf')]);if(!_0x23a922){return this['channel'][_0x0978('0x30')](_0x3e531f,_0x0978('0xe0'));}var _0x1050c2=this;_0xdf31c2['forEach'](function(_0x5c9c0c,_0x3d0e22){Object[_0x0978('0xe1')](_0x5c9c0c)['forEach'](function(_0x30f0d0){_0x1050c2[_0x0978('0x10')]['setVariable'](util[_0x0978('0x2c')](_0x0978('0xe2'),_0x23a922,_0x3d0e22,_0x30f0d0),_0x5c9c0c[_0x30f0d0]);});});this[_0x0978('0x10')]['setVariable'](util[_0x0978('0x2c')]('%s_ROWS_COUNT',_0x23a922),_0xdf31c2[_0x0978('0x9e')]);return this[_0x0978('0x10')][_0x0978('0xaf')](util['format'](_0x0978('0xe3'),_0x23a922));};AGIVertices[_0x0978('0x17')]['dial']=function(_0x492c1c){logger[_0x0978('0xe4')](util[_0x0978('0x2c')](_0x0978('0xe5'),_0x492c1c['label']));if(!this[_0x0978('0x89')](_0x492c1c['sip_id'])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x492c1c,_0x0978('0xe6'));}var _0x162e22=this[_0x0978('0x1f')][_0x0978('0x74')](this,_0x492c1c[_0x0978('0xe7')]);if(!_0x162e22){return this[_0x0978('0x10')][_0x0978('0x30')](_0x492c1c,_0x0978('0xe8'));}var _0x53772d=this[_0x0978('0x10')][_0x0978('0x5c')](_0x0978('0xe9'),[util[_0x0978('0x2c')](_0x0978('0xea'),_0x162e22),_0x492c1c['timeout'],_0x492c1c[_0x0978('0xeb')],_0x492c1c[_0x0978('0x6a')]]);if(_0x53772d[_0x0978('0xa9')]===-0x1){return _0x53772d;}return this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')](_0x0978('0xec'),'DIAL'));};AGIVertices[_0x0978('0x17')][_0x0978('0xed')]=function(_0x31ed87){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xee'),_0x31ed87[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x31ed87['key'])){return this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x31ed87[_0x0978('0x62')])){return this['channel'][_0x0978('0xaf')](_0x0978('0xb0'));}this[_0x0978('0x10')][_0x0978('0xef')]=!![];this['createSquareDetailsReport'](_0x31ed87);this[_0x0978('0x45')](_0x31ed87[_0x0978('0x62')],'in','','');this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')]('Trying\x20Dialogflow:\x20%s',_0x31ed87[_0x0978('0x62')]));var _0x5170e3=this[_0x0978('0x7e')][_0x0978('0x74')](this,_0x31ed87);if(_0x5170e3){for(var _0x496e4b in _0x5170e3){if(_0x5170e3['hasOwnProperty'](_0x496e4b)){this[_0x0978('0x10')][_0x0978('0xa3')](util['format']('DIALOGFLOW_%s',_0x496e4b[_0x0978('0x6f')]()),_0x5170e3[_0x496e4b]);}}this[_0x0978('0x45')](_0x5170e3[_0x0978('0xf0')],'out',_0x0978('0xed'),'');return this['channel']['noop'](util['format'](_0x0978('0xf1'),_0x5170e3['speech']));}return this[_0x0978('0x10')]['error'](_0x31ed87,_0x0978('0xf2'));};AGIVertices[_0x0978('0x17')][_0x0978('0xf3')]=function(_0x1ad3c3){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xf4'),_0x1ad3c3[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x1ad3c3['dialogflowV2_project_id'])){return this['channel'][_0x0978('0xaf')](_0x0978('0xf5'));}if(!this[_0x0978('0x89')](_0x1ad3c3['client_email'])){return this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20client_email\x20configured');}if(!this[_0x0978('0x89')](_0x1ad3c3[_0x0978('0x83')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xf6'));}if(!this[_0x0978('0x89')](_0x1ad3c3[_0x0978('0xf7')])){return this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x1ad3c3['text'])){return this[_0x0978('0x10')]['noop'](_0x0978('0xb0'));}this['channel'][_0x0978('0xef')]=!![];this['createSquareDetailsReport'](_0x1ad3c3);this[_0x0978('0x45')](_0x1ad3c3[_0x0978('0x62')],'in','','');this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0xf8'),_0x1ad3c3['text']));var _0x5823f5=this[_0x0978('0x81')][_0x0978('0x74')](this,_0x1ad3c3);if(_0x5823f5){for(var _0x4ca092 in _0x5823f5){if(_0x5823f5[_0x0978('0x9a')](_0x4ca092)){if(_0x4ca092!==_0x0978('0xf9')){this[_0x0978('0x10')][_0x0978('0xa3')](util['format']('DIALOGFLOW_%s',_0x4ca092[_0x0978('0x6f')]()),_0x5823f5[_0x4ca092]);}}}this['createSquareMessage'](_0x5823f5[_0x0978('0xf0')],'out',_0x0978('0xf3'),_0x5823f5[_0x0978('0xf9')]);return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')]('DialogflowV2\x20Result\x20%s',_0x5823f5['speech']));}return this[_0x0978('0x10')][_0x0978('0x30')](_0x1ad3c3,_0x0978('0xfa'));};AGIVertices[_0x0978('0x17')]['sesteknda']=function(_0x25250a){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0xfb'),_0x25250a['label']));if(!this[_0x0978('0x89')](_0x25250a['ndauth_url'])){return this['channel']['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0x0978('0x89')](_0x25250a[_0x0978('0xfc')])){return this[_0x0978('0x10')]['noop']('no\x20username\x20configured');}if(!this[_0x0978('0x89')](_0x25250a['password'])){return this[_0x0978('0x10')]['noop']('no\x20password\x20configured');}if(!this[_0x0978('0x89')](_0x25250a['ndassistant_url'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x0978('0x10')][_0x0978('0xef')]=!![];this[_0x0978('0x3a')](_0x25250a);this[_0x0978('0x45')](_0x25250a[_0x0978('0x62')],'in','','');this['channel']['noop'](util[_0x0978('0x2c')](_0x0978('0xfd'),_0x25250a['text']));var _0xc227c4=this[_0x0978('0x84')][_0x0978('0x74')](this,_0x25250a);if(_0xc227c4){for(var _0x4c20fb in _0xc227c4){if(_0xc227c4[_0x0978('0x9a')](_0x4c20fb)){this[_0x0978('0x10')]['setVariable'](util[_0x0978('0x2c')]('SESTEK_NDA_%s',_0x4c20fb[_0x0978('0x6f')]()),_0xc227c4[_0x4c20fb]);}}this[_0x0978('0x45')](_0xc227c4[_0x0978('0xf0')],_0x0978('0xfe'),_0x0978('0xff'),'');if(_0xc227c4['audiofile']){this['channel']['noop'](util['format'](_0x0978('0x100'),_0xc227c4[_0x0978('0x101')]));var _0xe29389=this[_0x0978('0x10')][_0x0978('0x102')](_0xc227c4[_0x0978('0x101')]);try{fs[_0x0978('0x103')](_0xc227c4[_0x0978('0x101')]+_0x0978('0x104'));}catch(_0x146cac){logger[_0x0978('0x30')](_0x146cac);}return _0xe29389;}else{return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x105'),_0xc227c4['speech']));}}return this['channel'][_0x0978('0x30')](_0x25250a,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x0978('0x17')]['end']=function(_0x510456){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x106'),_0x510456[_0x0978('0x3c')]));return this[_0x0978('0x10')]['noop'](_0x0978('0x107'));};AGIVertices[_0x0978('0x17')][_0x0978('0x108')]=function(_0x10a66b){logger[_0x0978('0x32')](util[_0x0978('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x10a66b[_0x0978('0x3c')]));var _0x2be75b='';if(_0x10a66b[_0x0978('0x109')]){if(!this['isConfigured'](_0x10a66b[_0x0978('0x109')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x10a66b,_0x0978('0x10a'));}else{var _0x56e37b=parseInt(_0x10a66b[_0x0978('0x109')],0xa);if(isNaN(_0x56e37b)){_0x2be75b=_0x10a66b[_0x0978('0x109')];}else{_0x2be75b=this[_0x0978('0x10b')][_0x0978('0x74')](this,_0x10a66b[_0x0978('0x109')]);if(!_0x2be75b){return this[_0x0978('0x10')]['error'](_0x10a66b,_0x0978('0x10c'));}}}}else if(_0x10a66b['trunk_name']){_0x2be75b=_0x10a66b[_0x0978('0x10d')];}else{return this['channel']['error'](_0x10a66b,'no\x20trunk\x20selected');}var _0x84613d=this['channel'][_0x0978('0x5c')](_0x0978('0xe9'),[util[_0x0978('0x2c')]('SIP/%s/%s',_0x2be75b,_0x10a66b[_0x0978('0x4b')]),_0x10a66b[_0x0978('0xc1')],_0x10a66b['opts'],_0x10a66b[_0x0978('0x6a')]]);if(_0x84613d['result']===-0x1){return _0x84613d;}return this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0xec'),'DIAL'));};AGIVertices[_0x0978('0x17')][_0x0978('0x10e')]=function(_0x59ce67){logger['info'](util['format'](_0x0978('0x10f'),_0x59ce67['label']));return this[_0x0978('0x10')]['noop'](_0x0978('0x10e'));};AGIVertices[_0x0978('0x17')]['getdigits']=function(_0x5c5111){logger['info'](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5c5111[_0x0978('0x3c')]));if(_0x5c5111[_0x0978('0xac')]===0x0){return this['maxRetry'](_0x5c5111);}_0x5c5111[_0x0978('0xac')]-=0x1;if(!this['isConfigured'](_0x5c5111[_0x0978('0x110')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x5c5111,_0x0978('0x111'));}var _0x1fd3c4=this['getSound']['sync'](this,_0x5c5111['file_id']);if(!_0x1fd3c4){return this['channel']['error'](_0x5c5111,_0x0978('0x112'));}if(!this[_0x0978('0x89')](_0x5c5111[_0x0978('0xdf')])){return this['channel'][_0x0978('0x30')](_0x0978('0x113'));}var _0x1e8d30=this['channel'][_0x0978('0x114')](_0x1fd3c4,_0x5c5111[_0x0978('0x115')],_0x5c5111[_0x0978('0x116')]);var _0x4e3db0=_0x1e8d30[_0x0978('0xa9')]?_0x1e8d30[_0x0978('0xa9')][_0x0978('0xa7')]():'';logger[_0x0978('0x32')](_0x0978('0x117'),JSON[_0x0978('0x77')](_0x1e8d30));if(_0x1e8d30['result']===-0x1){this['createSquareDetailsReport'][_0x0978('0x74')](this,_0x5c5111,_0x4e3db0);return _0x1e8d30;}else if(_0x1e8d30[_0x0978('0xa6')]===_0x0978('0xc1')){_0x1e8d30[_0x0978('0xa9')]=_0x4e3db0[_0x0978('0x9e')]>=parseInt(_0x5c5111[_0x0978('0x118')])?'x':'i';}else{_0x1e8d30[_0x0978('0xa9')]=_0x4e3db0[_0x0978('0x9e')]>=parseInt(_0x5c5111[_0x0978('0x118')])&&_0x4e3db0[_0x0978('0x9e')]<=parseInt(_0x5c5111[_0x0978('0x116')])?'x':'i';}var _0x1aa5c0=this[_0x0978('0x13')][_0x0978('0x74')](this,_0x5c5111[_0x0978('0xdf')]);if(!_0x1aa5c0){return this['channel'][_0x0978('0x30')](_0x5c5111,_0x0978('0xe0'));}this[_0x0978('0x10')][_0x0978('0xa3')](_0x1aa5c0,_0x4e3db0);if(this['isConfigured'](_0x5c5111['hiddendigitsnum'])){var _0x46ce9f=parseInt(_0x5c5111[_0x0978('0x119')],0xa);var _0x2fbeb4=rs['generate']({'charset':'*','length':_0x46ce9f});var _0x40614f=_0x4e3db0[_0x0978('0x9e')];if(_0x40614f>0x0){if(_0x40614f>_0x46ce9f){this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x5c5111,_0x5c5111[_0x0978('0x11a')]===_0x0978('0x11b')?_0x2fbeb4+_0x4e3db0[_0x0978('0x11c')](_0x46ce9f):_0x4e3db0[_0x0978('0x11c')](0x0,_0x40614f-_0x46ce9f)+_0x2fbeb4);}else{this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x5c5111,rs['generate']({'charset':'*','length':_0x40614f}));}}else{this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x5c5111,'');}}else{this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x5c5111,_0x4e3db0);}return _0x1e8d30;};AGIVertices[_0x0978('0x17')]['getsecretdigits']=function(_0x5e8a69){logger[_0x0978('0x32')](util['format'](_0x0978('0x11d'),_0x5e8a69[_0x0978('0x3c')]));return this[_0x0978('0xe')](_0x5e8a69);};AGIVertices[_0x0978('0x17')][_0x0978('0x11e')]=function(_0x2e39f8){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x11f'),_0x2e39f8['label']));this['createSquareDetailsReport'][_0x0978('0x74')](this,_0x2e39f8,_0x2e39f8[_0x0978('0x120')]);return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x121'),_0x2e39f8['goalname']));};AGIVertices[_0x0978('0x17')][_0x0978('0x122')]=function(_0x4901c2){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x123'),_0x4901c2[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x4901c2['aws_access_key_id'])||!this['isConfigured'](_0x4901c2[_0x0978('0x8d')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0x124'));}if(!this[_0x0978('0x89')](_0x4901c2['text'])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb0'));}this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')]('Trying\x20aws\x20Polly\x20%s',_0x4901c2[_0x0978('0x62')]));var _0x250bdd=this[_0x0978('0x8b')][_0x0978('0x74')](this,_0x4901c2);if(_0x250bdd){this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x125'),_0x250bdd));var _0x40fc69=this[_0x0978('0x10')][_0x0978('0x102')](_0x250bdd);try{fs[_0x0978('0x103')](_0x250bdd+_0x0978('0x104'));}catch(_0x3466a2){logger['error'](_0x3466a2);}return _0x40fc69;}return this[_0x0978('0x10')][_0x0978('0x30')](_0x4901c2,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x0978('0x17')]['awslex']=function(_0x48257a){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x126'),_0x48257a[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x48257a['aws_access_key_id'])||!this[_0x0978('0x89')](_0x48257a['aws_secret_access_key'])){return this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0978('0x89')](_0x48257a['aws_bot_name'])){return this[_0x0978('0x10')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x0978('0x89')](_0x48257a[_0x0978('0x62')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb0'));}this[_0x0978('0x10')][_0x0978('0xef')]=!![];this[_0x0978('0x3a')](_0x48257a);this['createSquareMessage'](_0x48257a[_0x0978('0x62')],'in','','');this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x127'),_0x48257a[_0x0978('0x62')]));var _0xda37d7=this[_0x0978('0x91')][_0x0978('0x74')](this,_0x48257a);if(_0xda37d7){for(var _0x5ee02b in _0xda37d7){if(_0xda37d7['hasOwnProperty'](_0x5ee02b)&&_[_0x0978('0x9f')](_0xda37d7[_0x5ee02b])){this[_0x0978('0x10')][_0x0978('0xa3')](util['format'](_0x0978('0x128'),_0x5ee02b[_0x0978('0x6f')]()),_0xda37d7[_0x5ee02b]);}}if(_[_0x0978('0x48')](_0xda37d7[_0x0978('0x7b')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0x129'));}else{this[_0x0978('0x45')](_0xda37d7['message'],_0x0978('0xfe'),_0x0978('0x12a'),'');return this[_0x0978('0x10')]['noop'](util['format'](_0x0978('0x12b'),_0xda37d7[_0x0978('0x7b')]));}}return this['channel'][_0x0978('0x30')](_0x48257a,_0x0978('0x12c'));};AGIVertices[_0x0978('0x17')]['googleasr']=function(_0x4db5d3){logger[_0x0978('0x32')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x4db5d3['label'],_0x4db5d3[_0x0978('0xc1')]));if(!this[_0x0978('0x89')](_0x4db5d3[_0x0978('0x7f')])){return this[_0x0978('0x10')]['noop'](_0x0978('0x12d'));}var _0x97d4e4='wav';var _0x3ec1c4=util[_0x0978('0x2c')](_0x0978('0x12e'),FILES_PATH,rs[_0x0978('0x12f')](0x4));var _0x4697e0=util['format'](_0x0978('0xa1'),_0x3ec1c4,_0x97d4e4);var _0x601382=!![];if(_0x4db5d3[_0x0978('0x130')]==='NOBEEP'){_0x601382=![];}var _0x3c476e=this[_0x0978('0x10')][_0x0978('0x131')](_0x3ec1c4,_0x97d4e4,_0x4db5d3[_0x0978('0x132')],_0x4db5d3[_0x0978('0xc1')],undefined,_0x601382);if(_0x3c476e[_0x0978('0xa9')]!==-0x1){this['channel']['noop'](util['format'](_0x0978('0x133'),_0x4697e0));var _0x2b55b3=this[_0x0978('0x94')][_0x0978('0x74')](this,_0x4db5d3,_0x4697e0);if(_0x2b55b3){for(var _0xd22d3e in _0x2b55b3){if(_0x2b55b3[_0x0978('0x9a')](_0xd22d3e)){this[_0x0978('0x10')]['setVariable'](util['format'](_0x0978('0x134'),_0xd22d3e[_0x0978('0x6f')]()),_0x2b55b3[_0xd22d3e]);}}return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x135'),JSON[_0x0978('0x77')](_0x2b55b3)));}}return _0x3c476e;};AGIVertices[_0x0978('0x17')]['tildeasr']=function(_0x2bce7d){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x136'),_0x2bce7d['label']));if(!this[_0x0978('0x89')](_0x2bce7d['appid'])){return this[_0x0978('0x10')]['noop']('no\x20appid\x20configured');}if(!this[_0x0978('0x89')](_0x2bce7d[_0x0978('0x98')])){return this['channel'][_0x0978('0xaf')]('no\x20appsecret\x20configured');}var _0x1c66f4=_0x0978('0x137');var _0x132141=util['format'](_0x0978('0x12e'),FILES_PATH,rs[_0x0978('0x12f')](0x4));var _0x164425=util[_0x0978('0x2c')](_0x0978('0xa1'),_0x132141,_0x1c66f4);var _0x5d7898=!![];if(_0x2bce7d['beep']===_0x0978('0x138')){_0x5d7898=![];}var _0x448f7b=this[_0x0978('0x10')]['recordFile'](_0x132141,_0x1c66f4,_0x2bce7d[_0x0978('0x132')],_0x2bce7d['timeout'],undefined,_0x5d7898);if(_0x448f7b['result']!==-0x1){this['channel']['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x164425));var _0x22dbff=this[_0x0978('0x96')][_0x0978('0x74')](this,_0x2bce7d,_0x164425);if(_0x22dbff){for(var _0x192f33 in _0x22dbff){if(_0x22dbff[_0x0978('0x9a')](_0x192f33)){this[_0x0978('0x10')][_0x0978('0xa3')](util[_0x0978('0x2c')]('TILDE_ASR_%s',_0x192f33[_0x0978('0x6f')]()),_0x22dbff[_0x192f33]);}}return this[_0x0978('0x10')][_0x0978('0xaf')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x0978('0x77')](_0x22dbff)));}}return _0x448f7b;};AGIVertices['prototype'][_0x0978('0x139')]=function(_0xad12d9){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x13a'),_0xad12d9['label']));return this[_0x0978('0x10')][_0x0978('0x13b')](_0xad12d9[_0x0978('0x13c')],_0xad12d9[_0x0978('0x41')],_0xad12d9[_0x0978('0x42')]);};AGIVertices[_0x0978('0x17')][_0x0978('0x13d')]=function(_0x1aec9e){logger[_0x0978('0x32')](util['format'](_0x0978('0x13e'),_0x1aec9e[_0x0978('0x3c')]));if(!this['isConfigured'](_0x1aec9e['condition'])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x1aec9e,_0x0978('0x13f'));}try{var _0x1bf232=eval(_0x1aec9e[_0x0978('0x140')])?_0x0978('0x141'):'false';this['channel'][_0x0978('0xaf')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x1aec9e[_0x0978('0x140')],_0x1bf232));return{'code':0xc8,'result':_0x1bf232};}catch(_0x91c762){return{'code':0xc8,'result':_0x0978('0x142')};}};AGIVertices['prototype'][_0x0978('0x143')]=function(_0x9b4ab5){logger[_0x0978('0x32')](util[_0x0978('0x2c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x9b4ab5[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x9b4ab5['interval_id'])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x9b4ab5,'no\x20interval\x20configured');}var _0x11202=this[_0x0978('0x29')]['sync'](this,_0x9b4ab5[_0x0978('0x144')]);if(!_0x11202){return this[_0x0978('0x10')]['error'](_0x9b4ab5,_0x0978('0x145'));}for(var _0x3be77a=0x0;_0x3be77a<_0x11202['length'];_0x3be77a+=0x1){var _0x267b46=this['channel'][_0x0978('0x13')](util['format']('IFTIME(%s?true:false)',_0x11202[_0x3be77a]));if(_0x267b46['result']===-0x1){return _0x267b46;}logger[_0x0978('0x32')](util['format'](_0x0978('0x146'),_0x11202[_0x3be77a],_0x267b46['extra']));if(_0x267b46[_0x0978('0xa6')]==='true'){logger[_0x0978('0x32')](util['format'](_0x0978('0x146'),_0x11202[_0x3be77a],_0x0978('0x141')));this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x146'),_0x11202[_0x3be77a],_0x0978('0x141')));return{'code':0xc8,'result':_0x0978('0x141')};}else{logger['info'](util[_0x0978('0x2c')](_0x0978('0x146'),_0x11202[_0x3be77a],_0x0978('0x142')));this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x146'),_0x11202[_0x3be77a],'false'));}}return{'code':0xc8,'result':_0x0978('0x142')};};AGIVertices[_0x0978('0x17')][_0x0978('0x147')]=function(_0x25372e){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x148'),_0x25372e[_0x0978('0x3c')]));return this['channel'][_0x0978('0x147')]();};AGIVertices[_0x0978('0x17')][_0x0978('0x149')]=function(_0x143ede){logger[_0x0978('0x32')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x143ede['label']));if(!this['isConfigured'](_0x143ede['key'])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0x12d'));}var _0x299e39=_0x0978('0x137');var _0x3e2f79=util[_0x0978('0x2c')](_0x0978('0x12e'),FILES_PATH,rs['generate'](0x4));var _0x3e5ce0=util[_0x0978('0x2c')](_0x0978('0xa1'),_0x3e2f79,_0x299e39);var _0x4697c2=!![];if(_0x143ede[_0x0978('0x130')]==='NOBEEP'){_0x4697c2=![];}var _0x11816a=this[_0x0978('0x10')][_0x0978('0x131')](_0x3e2f79,_0x299e39,_0x143ede[_0x0978('0x132')],_0x143ede[_0x0978('0xc1')],undefined,_0x4697c2);if(_0x11816a[_0x0978('0xa9')]!==-0x1){this[_0x0978('0x10')][_0x0978('0xaf')](util['format'](_0x0978('0x14a'),_0x3e5ce0));var _0xafbbeb=this[_0x0978('0x88')][_0x0978('0x74')](this,_0x143ede,_0x3e5ce0);if(_0xafbbeb){for(var _0x2f03c9 in _0xafbbeb){if(_0xafbbeb[_0x0978('0x9a')](_0x2f03c9)){this[_0x0978('0x10')][_0x0978('0xa3')](util[_0x0978('0x2c')]('ISPEECH_ASR_%s',_0x2f03c9[_0x0978('0x6f')]()),_0xafbbeb[_0x2f03c9]);}}return this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0xafbbeb)));}}return _0x11816a;};AGIVertices[_0x0978('0x17')][_0x0978('0x14b')]=function(_0x4de73d){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x14c'),_0x4de73d[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x4de73d[_0x0978('0x7f')])){return this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x4de73d[_0x0978('0x62')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0xb0'));}this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')]('Trying\x20ispeech\x20TTS\x20%s',_0x4de73d[_0x0978('0x62')]));var _0x3951b5=this[_0x0978('0x85')]['sync'](this,_0x4de73d);if(_0x3951b5){this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x14a'),_0x3951b5));var _0x53a04e=this[_0x0978('0x10')][_0x0978('0x102')](_0x3951b5,_0x4de73d[_0x0978('0x132')]);try{fs[_0x0978('0x103')](_0x3951b5+_0x0978('0x104'));}catch(_0x28d2e7){logger[_0x0978('0x30')](_0x28d2e7);}return _0x53a04e;}return this[_0x0978('0x10')]['error'](_0x4de73d,_0x0978('0x14d'));};AGIVertices[_0x0978('0x17')][_0x0978('0x14e')]=function(_0x4f6a21){logger[_0x0978('0x32')](util['format'](_0x0978('0x14f'),_0x4f6a21['label']));if(!this[_0x0978('0x89')](_0x4f6a21[_0x0978('0x150')])){return this[_0x0978('0x10')]['error'](_0x4f6a21,'no\x20find\x20by\x20configured');}logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x151'),this[_0x0978('0x10')][_0x0978('0x40')],_0x4f6a21[_0x0978('0x150')]));var _0xd4aee6=this[_0x0978('0x57')][_0x0978('0x74')](this,_0x4f6a21[_0x0978('0x150')]);if(_0xd4aee6){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x152'),this['channel'][_0x0978('0x40')],_0x4f6a21['findBy']));this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x152'),this[_0x0978('0x10')][_0x0978('0x40')],_0x4f6a21[_0x0978('0x150')]));return{'code':0xc8,'result':_0x0978('0x153')};}else{logger[_0x0978('0x32')](util[_0x0978('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x0978('0x40')],_0x4f6a21[_0x0978('0x150')]));this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')](_0x0978('0x154'),this['channel'][_0x0978('0x40')],_0x4f6a21[_0x0978('0x150')]));return{'code':0xc8,'result':_0x0978('0x155')};}};AGIVertices[_0x0978('0x17')][_0x0978('0x156')]=function(_0x2ce163){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x157'),_0x2ce163[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x2ce163[_0x0978('0x150')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x2ce163,_0x0978('0x158'));}logger[_0x0978('0x32')](util['format'](_0x0978('0x151'),this[_0x0978('0x10')][_0x0978('0x40')],_0x2ce163[_0x0978('0x150')]));var _0x1abcc0=this['agentLogout'][_0x0978('0x74')](this,_0x2ce163[_0x0978('0x150')]);if(_0x1abcc0){logger['info'](util['format'](_0x0978('0x152'),this[_0x0978('0x10')][_0x0978('0x40')],_0x2ce163['findBy']));this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x152'),this['channel'][_0x0978('0x40')],_0x2ce163[_0x0978('0x150')]));return{'code':0xc8,'result':_0x0978('0x153')};}else{logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x154'),this[_0x0978('0x10')][_0x0978('0x40')],_0x2ce163['findBy']));this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x154'),this[_0x0978('0x10')]['callerid'],_0x2ce163['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0978('0x17')][_0x0978('0x159')]=function(_0x38a423){logger['info'](util[_0x0978('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x38a423[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x38a423[_0x0978('0x15a')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x38a423,_0x0978('0x15b'));}this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')]('math\x20%s',_0x38a423[_0x0978('0x15a')]));var _0x235c34=eval(_0x38a423[_0x0978('0x15a')]);if(!this[_0x0978('0x89')](_0x38a423['variable_id'])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3db633=this[_0x0978('0x13')][_0x0978('0x74')](this,_0x38a423[_0x0978('0xdf')]);if(!_0x3db633){return this[_0x0978('0x10')][_0x0978('0x30')](_0x38a423,'no\x20variable\x20found');}if(_[_0x0978('0xa2')](_0x235c34)){var _0x28f1df=this;_0x235c34['forEach'](function(_0x23c5ba,_0x5ecdbb){_0x28f1df[_0x0978('0x10')][_0x0978('0xa3')](util['format']('%s[%s]',_0x3db633,_0x5ecdbb),_0x23c5ba);});return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x15c'),_0x3db633));}else{return this[_0x0978('0x10')]['setVariable'](_0x3db633,_0x235c34);}};AGIVertices[_0x0978('0x17')]['menu']=function(_0x11e2e0){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x15d'),_0x11e2e0['label']));if(_0x11e2e0[_0x0978('0xac')]===0x0){return this[_0x0978('0xab')](_0x11e2e0);}_0x11e2e0[_0x0978('0xac')]-=0x1;if(!this[_0x0978('0x89')](_0x11e2e0[_0x0978('0x110')])){return this[_0x0978('0x10')]['error'](_0x11e2e0,'no\x20file\x20audio\x20selected');}var _0x45a6a3=this[_0x0978('0x22')][_0x0978('0x74')](this,_0x11e2e0[_0x0978('0x110')]);if(!_0x45a6a3){return this[_0x0978('0x10')][_0x0978('0x30')](_0x11e2e0,'no\x20file\x20audio\x20found');}var _0x1a2829=this[_0x0978('0x10')][_0x0978('0x114')](_0x45a6a3,_0x11e2e0['response'],_0x11e2e0[_0x0978('0x15e')]);var _0x256b30=_0x1a2829[_0x0978('0xa9')];if(_0x1a2829['result']===-0x1){this['createSquareDetailsReport'][_0x0978('0x74')](this,_0x11e2e0,'-1');return _0x1a2829;}else if(_0x1a2829[_0x0978('0xa6')]===_0x0978('0xc1')){_0x1a2829[_0x0978('0xa9')]=_0x1a2829['result']['length']>0x0?_0x1a2829[_0x0978('0xa9')]:'t';}else if(_['isEmpty'](_0x1a2829[_0x0978('0xa9')])){_0x1a2829[_0x0978('0xa9')]='#';_0x256b30='#';}if(!this[_0x0978('0x89')](_0x11e2e0[_0x0978('0xdf')])){this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1b7449=this[_0x0978('0x13')][_0x0978('0x74')](this,_0x11e2e0['variable_id']);if(!_0x1b7449){return this['channel'][_0x0978('0x30')](_0x11e2e0,'no\x20variable\x20found');}this[_0x0978('0x10')]['setVariable'](_0x1b7449,_0x256b30);}this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x11e2e0,_0x256b30);return _0x1a2829;};AGIVertices['prototype'][_0x0978('0xaf')]=function(_0x40fca2){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x15f'),_0x40fca2['label']));return this[_0x0978('0x10')][_0x0978('0xaf')](_0x40fca2[_0x0978('0x160')]||_0x40fca2[_0x0978('0x3c')]);};AGIVertices[_0x0978('0x17')]['pause']=function(_0x5644d7){logger['info'](util[_0x0978('0x2c')](_0x0978('0x161'),_0x5644d7['label']));if(!this[_0x0978('0x89')](_0x5644d7[_0x0978('0x150')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x5644d7,_0x0978('0x158'));}logger['info'](util[_0x0978('0x2c')](_0x0978('0x151'),this['channel'][_0x0978('0x40')],_0x5644d7[_0x0978('0x150')]));var _0x4f127d=this[_0x0978('0x51')]['sync'](this,_0x5644d7[_0x0978('0x162')]);var _0x194be2=this[_0x0978('0x53')][_0x0978('0x74')](this,_0x5644d7[_0x0978('0x150')],_0x4f127d);if(_0x194be2){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x152'),this[_0x0978('0x10')][_0x0978('0x40')],_0x5644d7[_0x0978('0x150')]));this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')](_0x0978('0x152'),this[_0x0978('0x10')][_0x0978('0x40')],_0x5644d7['findBy']));return{'code':0xc8,'result':_0x0978('0x153')};}else{logger[_0x0978('0x32')](util[_0x0978('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0978('0x10')]['callerid'],_0x5644d7[_0x0978('0x150')]));this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x152'),this[_0x0978('0x10')][_0x0978('0x40')],_0x5644d7[_0x0978('0x150')]));return{'code':0xc8,'result':_0x0978('0x155')};}};AGIVertices[_0x0978('0x17')][_0x0978('0x163')]=function(_0x5dd61a){logger['info'](util[_0x0978('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x5dd61a[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x5dd61a[_0x0978('0x110')])){return this['channel'][_0x0978('0x30')](_0x5dd61a,_0x0978('0x111'));}var _0xf2387b=this[_0x0978('0x22')]['sync'](this,_0x5dd61a[_0x0978('0x110')]);if(!_0xf2387b){return this[_0x0978('0x10')][_0x0978('0x30')](_0x5dd61a,_0x0978('0x112'));}var _0x321772=this[_0x0978('0x10')][_0x0978('0x5c')]('PLAYBACK',[_0xf2387b,_0x5dd61a['opts']]);if(_0x321772['result']===-0x1){return _0x321772;}return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')]('Executed\x20command\x20%s\x20%s',_0x0978('0x164'),_0xf2387b));};AGIVertices[_0x0978('0x17')][_0x0978('0x165')]=function(_0x23d9da){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x166'),_0x23d9da[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x23d9da[_0x0978('0x167')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x23d9da,'no\x20queue\x20selected');}var _0x4b398a='';var _0x2e2ac2=parseInt(_0x23d9da[_0x0978('0x167')],0xa);if(isNaN(_0x2e2ac2)){_0x4b398a=_0x23d9da['queue_id'];}else{_0x4b398a=this[_0x0978('0x18')][_0x0978('0x74')](this,_0x23d9da[_0x0978('0x167')]);if(!_0x4b398a){return this[_0x0978('0x10')][_0x0978('0x30')](_0x23d9da,_0x0978('0x168'));}}var _0x45ca09='';if(this[_0x0978('0x89')](_0x23d9da[_0x0978('0x110')])){var _0xeba38=this[_0x0978('0x22')][_0x0978('0x74')](this,_0x23d9da[_0x0978('0x110')]);if(_0xeba38){_0x45ca09=_0xeba38;}}this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x23d9da,_0x4b398a);if(_0x23d9da[_0x0978('0xeb')][_0x0978('0x169')]('x')<0x0){_0x23d9da[_0x0978('0xeb')]+='x';}if(_0x23d9da[_0x0978('0xeb')][_0x0978('0x169')]('X')<0x0){_0x23d9da['opts']+='X';}this[_0x0978('0x10')][_0x0978('0xa3')](_0x0978('0x16a'),_0x4b398a?_0x4b398a[_0x0978('0x16b')]():'');var _0x6c8382=this[_0x0978('0x10')]['exec']('QUEUE',[_0x4b398a,_0x23d9da['opts'],_0x23d9da['url'],_0x45ca09,_0x23d9da[_0x0978('0xc1')],_0x23d9da[_0x0978('0x7')],_0x23d9da[_0x0978('0x16c')],_0x23d9da[_0x0978('0x16d')],'',_0x23d9da[_0x0978('0x16e')]]);if(_0x6c8382[_0x0978('0xa9')]===-0x1){return _0x6c8382;}return this['channel'][_0x0978('0xaf')](util['format'](_0x0978('0x16f'),'QUEUE',_0x4b398a));};AGIVertices['prototype']['record']=function(_0x410444){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x170'),_0x410444[_0x0978('0x3c')]));var _0x509e3d=_0x410444[_0x0978('0x171')]||_0x0978('0x137');var _0x4becdf=util[_0x0978('0x2c')]('%s_%s',this[_0x0978('0x10')][_0x0978('0x3b')],rs[_0x0978('0x12f')](0x5));var _0x96a85f=util[_0x0978('0x2c')]('%s/recordings/%s.%s',FILES_PATH,_0x4becdf,_0x509e3d);var _0x57dd6f=util['format'](_0x0978('0x12e'),FILES_PATH,_0x4becdf);this['createSquareRecording'][_0x0978('0x74')](this,_0x410444,_0x4becdf,_0x96a85f);this[_0x0978('0x10')][_0x0978('0xa3')](_0x0978('0x172'),_0x4becdf);logger[_0x0978('0x32')](_0x0978('0x173'),_0x57dd6f,_0x509e3d,_0x410444[_0x0978('0x174')],_0x410444[_0x0978('0xc1')]);return this[_0x0978('0x10')][_0x0978('0x131')](_0x57dd6f,_0x509e3d,_0x410444[_0x0978('0x174')],_0x410444[_0x0978('0xc1')],undefined,!![]);};AGIVertices[_0x0978('0x17')]['restapi']=function(_0x358e65){logger[_0x0978('0x32')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x358e65[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x358e65[_0x0978('0x6a')])){return this['channel'][_0x0978('0xaf')](_0x0978('0x175'));}var _0x2b4391=this[_0x0978('0x69')]['sync'](this,_0x358e65);logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x176'),util[_0x0978('0x177')](_0x2b4391,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x358e65['variable_id'])){return this['channel'][_0x0978('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x395150=this[_0x0978('0x13')][_0x0978('0x74')](this,_0x358e65[_0x0978('0xdf')]);if(!_0x395150){return this[_0x0978('0x10')][_0x0978('0x30')](_0x358e65,_0x0978('0xe0'));}this[_0x0978('0x10')]['setVariable'](util[_0x0978('0x2c')]('%s_STATUS_CODE',_0x395150),_0x2b4391[_0x0978('0x7a')]?_0x2b4391[_0x0978('0x7a')]:'200');this['channel'][_0x0978('0xa3')](util['format'](_0x0978('0x178'),_0x395150),_0x2b4391['statusMessage']?_0x2b4391['statusMessage']:'OK');if(_0x2b4391[_0x0978('0x78')]){try{this[_0x0978('0xa0')](_0x2b4391[_0x0978('0x78')],_0x395150);}catch(_0x42e046){logger[_0x0978('0x30')](util['format'](_0x0978('0x179'),_0x395150));}}return this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0xe3'),_0x395150));};AGIVertices[_0x0978('0x17')][_0x0978('0x17a')]=function(_0x39bd22){logger[_0x0978('0x32')](util[_0x0978('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x39bd22['label']));return this[_0x0978('0x10')][_0x0978('0x17b')](_0x39bd22[_0x0978('0x17c')][_0x0978('0x5e')](/\s+/g,''),_0x39bd22[_0x0978('0x174')]);};AGIVertices['prototype'][_0x0978('0x17d')]=function(_0x178afe){logger['info'](util[_0x0978('0x2c')](_0x0978('0x17e'),_0x178afe['label']));return this['channel']['sayNumber'](_0x178afe[_0x0978('0x6c')]['replace'](/\s+/g,''),_0x178afe[_0x0978('0x174')]);};AGIVertices[_0x0978('0x17')][_0x0978('0x17f')]=function(_0x38850e){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x180'),_0x38850e[_0x0978('0x3c')]));return this[_0x0978('0x10')][_0x0978('0x181')](_0x38850e[_0x0978('0x62')],_0x38850e[_0x0978('0x174')]);};AGIVertices[_0x0978('0x17')]['sendMail']=function(_0x3a3896){logger[_0x0978('0x32')](util[_0x0978('0x2c')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3a3896[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x3a3896[_0x0978('0x182')])){return this[_0x0978('0x10')]['noop'](_0x0978('0x183'));}var _0x110b83=this[_0x0978('0x26')][_0x0978('0x74')](this,_0x3a3896[_0x0978('0x182')]);if(!_0x110b83||!_0x110b83[_0x0978('0x184')]){return this[_0x0978('0x10')][_0x0978('0x30')](_0x3a3896,'no\x20mail\x20account\x20found');}var _0xaa769b={'from':util[_0x0978('0x2c')]('\x22%s\x22\x20<%s>',_0x110b83[_0x0978('0x16')],_0x110b83[_0x0978('0x185')]||_0x110b83[_0x0978('0x184')][_0x0978('0x186')]),'to':_0x3a3896['to']||'','cc':_0x3a3896['cc']||'','bcc':_0x3a3896[_0x0978('0x187')]||'','subject':_0x3a3896[_0x0978('0x188')],'html':_0x3a3896[_0x0978('0x62')],'text':_0x3a3896[_0x0978('0x62')]};if(this[_0x0978('0x89')](_0x3a3896[_0x0978('0x189')])){}logger[_0x0978('0xe4')](_0x0978('0x18a'),JSON['stringify'](_0xaa769b));this[_0x0978('0x3a')]['sync'](this,_0x3a3896,_0x3a3896[_0x0978('0x182')]);this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')](_0x0978('0x18b'),_0x110b83['name']));this[_0x0978('0x28')][_0x0978('0x74')](this,_0x110b83['smtpOptions'],_0xaa769b);return this[_0x0978('0x10')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0978('0x17')][_0x0978('0x18c')]=function(_0x7e37a7){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x18d'),_0x7e37a7[_0x0978('0x3c')]));return this['channel'][_0x0978('0xaf')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x0978('0x17')][_0x0978('0x18e')]=function(_0x16f5e0){logger[_0x0978('0x32')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x16f5e0[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x16f5e0[_0x0978('0x18f')])){return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0x190'));}var _0x5f2093=this[_0x0978('0x38')]['sync'](this,_0x16f5e0['sms_account_id']);if(!_0x5f2093){return this[_0x0978('0x10')][_0x0978('0x30')](_0x16f5e0,_0x0978('0x191'));}var _0x3651db={'body':_0x16f5e0[_0x0978('0x192')],'phone':_0x16f5e0['to']||'','SmsAccountId':_0x5f2093['id']};logger['debug']('sendSMS\x20message',JSON['stringify'](_0x3651db));this['createSquareDetailsReport'][_0x0978('0x74')](this,_0x16f5e0,_0x16f5e0[_0x0978('0x18f')]);this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x193'),_0x5f2093[_0x0978('0x16')]));this[_0x0978('0x194')]['sync'](this,_0x3651db);return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0x195'));};AGIVertices[_0x0978('0x17')]['set']=function(_0x409b52){logger[_0x0978('0x32')](util['format'](_0x0978('0x196'),_0x409b52[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x409b52[_0x0978('0xdf')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x409b52,_0x0978('0x197'));}var _0x274fb5=this[_0x0978('0x13')][_0x0978('0x74')](this,_0x409b52['variable_id']);if(!_0x274fb5){return this[_0x0978('0x10')]['error'](_0x409b52,_0x0978('0xe0'));}return this[_0x0978('0x10')][_0x0978('0xa3')](_0x274fb5,_0x409b52['variable_value']);};AGIVertices[_0x0978('0x17')][_0x0978('0x198')]=function(_0x27ccd8){logger[_0x0978('0x32')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x27ccd8[_0x0978('0x3c')]));this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0x199'));if(_0x27ccd8['answer']==='yes'){this['channel']['noop'](_0x0978('0x19a'));return this['channel'][_0x0978('0xc0')]();}return this[_0x0978('0x10')][_0x0978('0xaf')](_0x0978('0x19b'));};AGIVertices[_0x0978('0x17')]['subproject']=function(_0x581c29){logger['info'](util['format'](_0x0978('0x19c'),_0x581c29[_0x0978('0x3c')]));if(!this[_0x0978('0x89')](_0x581c29[_0x0978('0x19d')])){return this[_0x0978('0x10')][_0x0978('0x30')](_0x581c29,'no\x20subproject\x20selected');}var _0x571696=this[_0x0978('0x1b')][_0x0978('0x74')](this,_0x581c29[_0x0978('0x19d')]);if(!this[_0x0978('0x89')](_0x571696)){return this[_0x0978('0x10')][_0x0978('0x30')](_0x581c29,util['format'](_0x0978('0x19e'),_0x581c29[_0x0978('0x19d')]));}if(_0x571696===this[_0x0978('0x10')][_0x0978('0x3e')]){return this[_0x0978('0x10')][_0x0978('0x30')](_0x581c29,_0x0978('0x19f'));}this['createSquareDetailsReport'][_0x0978('0x74')](this,_0x581c29,_0x571696);var _0x385196=this['channel'][_0x0978('0x5c')](_0x0978('0x1a0'),util[_0x0978('0x2c')](_0x0978('0x1a1'),config['agi'][_0x0978('0x1a2')]||_0x0978('0x1a3'),_0x571696,this[_0x0978('0x10')]['arg_1']));if(_0x385196['result']===-0x1){return _0x385196;}return this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x16f'),'AGI',_0x571696));};AGIVertices[_0x0978('0x17')][_0x0978('0x1a4')]=function(_0x2e6caa){logger['info'](util[_0x0978('0x2c')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2e6caa[_0x0978('0x3c')]));var _0x5f3f48=this[_0x0978('0x5b')]['sync'](this,_0x2e6caa[_0x0978('0xbe')]);this[_0x0978('0x3a')][_0x0978('0x74')](this,_0x2e6caa,_0x2e6caa[_0x0978('0xbe')]);if(this[_0x0978('0x89')](_0x2e6caa['variable_id'])){var _0x4a6d14=this[_0x0978('0x13')]['sync'](this,_0x2e6caa[_0x0978('0xdf')]);if(_0x4a6d14){this[_0x0978('0x10')][_0x0978('0xa3')](_0x4a6d14,_0x5f3f48);return this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2e6caa[_0x0978('0xbe')],_0x4a6d14));}}return this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x2e6caa['command']));};AGIVertices[_0x0978('0x17')]['google_cloud_tts']=function(_0x29ada0){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x1a5'),_0x29ada0[_0x0978('0x3c')]));_0x29ada0[_0x0978('0x62')]=_0x29ada0[_0x0978('0x62')][_0x0978('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0978('0x89')](_0x29ada0[_0x0978('0x60')])){return this[_0x0978('0x10')][_0x0978('0xaf')]('no\x20apiKey\x20configured');}if(!this[_0x0978('0x89')](_0x29ada0['text'])){return this['channel'][_0x0978('0xaf')]('no\x20text\x20configured');}this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x1a6'),_0x29ada0['text']));var _0xc533c4=this[_0x0978('0x5f')]['sync'](this,_0x29ada0);if(_0xc533c4){this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xc533c4));var _0x3da50c=this[_0x0978('0x10')][_0x0978('0x102')](_0xc533c4);try{fs[_0x0978('0x103')](_0xc533c4+_0x0978('0x104'));}catch(_0x494bdd){logger[_0x0978('0x30')](_0x494bdd);}return _0x3da50c;}return this[_0x0978('0x10')]['error'](_0x29ada0,_0x0978('0x1a7'));};AGIVertices[_0x0978('0x17')][_0x0978('0x1a8')]=function(_0x160f32){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x1a9'),_0x160f32['label']));_0x160f32[_0x0978('0x62')]=_0x160f32[_0x0978('0x62')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0978('0x89')](_0x160f32[_0x0978('0x62')])){return this['channel'][_0x0978('0xaf')](_0x0978('0xb0'));}this[_0x0978('0x10')]['noop'](util[_0x0978('0x2c')]('Trying\x20Google\x20TTS\x20%s',_0x160f32[_0x0978('0x62')]));var _0x4cf2a6=this[_0x0978('0x67')]['sync'](this,_0x160f32);if(_0x4cf2a6){this['channel']['noop'](util[_0x0978('0x2c')](_0x0978('0x1aa'),_0x4cf2a6));var _0x25af5c=this[_0x0978('0x10')][_0x0978('0x102')](_0x4cf2a6);try{fs[_0x0978('0x103')](_0x4cf2a6+_0x0978('0x104'));}catch(_0x36688f){logger[_0x0978('0x30')](_0x36688f);}return _0x25af5c;}return this[_0x0978('0x10')]['error'](_0x160f32,_0x0978('0x1ab'));};AGIVertices[_0x0978('0x17')][_0x0978('0x1ac')]=function(_0x762213){logger[_0x0978('0x32')](util['format'](_0x0978('0x1ad'),_0x762213['label']));if(!this[_0x0978('0x89')](_0x762213['findBy'])){return this['channel'][_0x0978('0x30')](_0x762213,_0x0978('0x158'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0978('0x10')][_0x0978('0x40')],_0x762213[_0x0978('0x150')]));var _0x4ca15a=this[_0x0978('0x55')][_0x0978('0x74')](this,_0x762213[_0x0978('0x150')]);if(_0x4ca15a){logger[_0x0978('0x32')](util[_0x0978('0x2c')](_0x0978('0x152'),this[_0x0978('0x10')][_0x0978('0x40')],_0x762213[_0x0978('0x150')]));this[_0x0978('0x10')][_0x0978('0xaf')](util['format'](_0x0978('0x152'),this['channel'][_0x0978('0x40')],_0x762213[_0x0978('0x150')]));return{'code':0xc8,'result':_0x0978('0x153')};}else{logger[_0x0978('0x32')](util['format'](_0x0978('0x154'),this[_0x0978('0x10')][_0x0978('0x40')],_0x762213[_0x0978('0x150')]));this[_0x0978('0x10')][_0x0978('0xaf')](util[_0x0978('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0978('0x10')][_0x0978('0x40')],_0x762213[_0x0978('0x150')]));return{'code':0xc8,'result':_0x0978('0x155')};}};AGIVertices[_0x0978('0x17')][_0x0978('0x1ae')]=function(_0x3277db){logger[_0x0978('0x32')](util[_0x0978('0x2c')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3277db['label']));var _0x497548=this['channel'][_0x0978('0x5c')](_0x0978('0x1af'),[_0x3277db[_0x0978('0x1b0')],_0x3277db[_0x0978('0x7d')]]);if(_0x497548[_0x0978('0xa9')]===-0x1){return _0x497548;}return this['channel'][_0x0978('0xaf')](util[_0x0978('0x2c')](_0x0978('0x16f'),_0x0978('0x1af'),_0x3277db[_0x0978('0x1b0')]));};AGIVertices[_0x0978('0x17')][_0x0978('0x1b1')]=function(_0x559be1){logger['info'](util[_0x0978('0x2c')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x559be1['label']));if(!this['isConfigured'](_0x559be1['variable_id'])){return this[_0x0978('0x10')]['error'](_0x559be1,'no\x20variable\x20selected');}var _0x575685=this[_0x0978('0x13')][_0x0978('0x74')](this,_0x559be1[_0x0978('0xdf')]);if(!_0x575685){return this[_0x0978('0x10')][_0x0978('0x30')](_0x559be1,_0x0978('0xe0'));}var _0x5ebeb9=this['channel'][_0x0978('0x13')](_0x575685);return{'code':0xc8,'result':_0x5ebeb9['extra']?_0x5ebeb9[_0x0978('0xa6')]:'-'};};String[_0x0978('0x17')][_0x0978('0xa5')]=function(_0x25e030,_0x3ec181){return this[_0x0978('0xa4')](_0x25e030)[_0x0978('0x1b2')](_0x3ec181);};module[_0x0978('0x1b3')]=AGIVertices; \ No newline at end of file +var _0xc2af=['shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawBody','getdigits','getsecretdigits','channel','mailRpc','getVariable','then','name','catch','prototype','getVoiceQueue','getSquareProject','rpc','getSquareProjectById','getSquareOdbc','dsn','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','interval','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','calleridname','context','extension','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','agentPause','callerid','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','Amy','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','clear','includes','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','saveRestApiResult','%s.%s','setVariable','stringify','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','lumenvoxasr','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','test','mindigit','maxdigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','wav','%s/recordings/%s','beep','intKey','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','recordingFormat','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','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','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x5b1fb4,_0x4d2810){_0x5b1fb4=_0x5b1fb4-0x0;var _0x3e0528=_0xc2af[_0x5b1fb4];return _0x3e0528;};'use strict';var fs=require('fs');var util=require(_0xfc2a('0x0'));var _=require('lodash');var sh=require(_0xfc2a('0x1'));var odbc=require('odbc')();var rs=require(_0xfc2a('0x2'));var moment=require(_0xfc2a('0x3'));var Mustache=require(_0xfc2a('0x4'));var rp=require(_0xfc2a('0x5'));var logger=require(_0xfc2a('0x6'))(_0xfc2a('0x7'));var config=require(_0xfc2a('0x8'));var shared=require(_0xfc2a('0x9'));var scripts=require('./scripts');var FILES_PATH=_0xfc2a('0xa');var recursiveMapAttributes=['rawHeaders',_0xfc2a('0xb')];var verticesWithRetry=['menu',_0xfc2a('0xc'),_0xfc2a('0xd')];var AGIVertices=function(_0x3587be,_0x913145,_0x4c826a){this[_0xfc2a('0xe')]=_0x3587be;this['rpc']=_0x913145;this[_0xfc2a('0xf')]=_0x4c826a;};AGIVertices['prototype'][_0xfc2a('0x10')]=function(_0x25c221,_0x2f6464){this['rpc']['getVariableById'](_0x25c221)[_0xfc2a('0x11')](function(_0x296471){_0x2f6464(null,_0x296471?_0x296471[_0xfc2a('0x12')]:![]);})[_0xfc2a('0x13')](function(_0x268993){_0x2f6464(_0x268993);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x15')]=function(_0xea5cd2,_0xe4b058){this['rpc']['getVoiceQueueById'](_0xea5cd2)[_0xfc2a('0x11')](function(_0x3b5033){_0xe4b058(null,_0x3b5033?_0x3b5033['name']:![]);})[_0xfc2a('0x13')](function(_0x2f311c){_0xe4b058(_0x2f311c);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x16')]=function(_0x2008fc,_0xa93aa7){this[_0xfc2a('0x17')][_0xfc2a('0x18')](_0x2008fc)[_0xfc2a('0x11')](function(_0x1e1524){_0xa93aa7(null,_0x1e1524?_0x1e1524[_0xfc2a('0x12')]:![]);})[_0xfc2a('0x13')](function(_0x27fb82){_0xa93aa7(_0x27fb82);});};AGIVertices['prototype'][_0xfc2a('0x19')]=function(_0x15ff6d,_0x5cfea6){this[_0xfc2a('0x17')]['getSquareOdbcById'](_0x15ff6d)['then'](function(_0x3e88fe){_0x5cfea6(null,_0x3e88fe?_0x3e88fe[_0xfc2a('0x1a')]:![]);})[_0xfc2a('0x13')](function(_0x40ed0b){_0x5cfea6(_0x40ed0b);});};AGIVertices[_0xfc2a('0x14')]['getUser']=function(_0x722009,_0x4908d7){this['rpc']['getUserById'](_0x722009)[_0xfc2a('0x11')](function(_0x57b67c){_0x4908d7(null,_0x57b67c?_0x57b67c['name']:![]);})[_0xfc2a('0x13')](function(_0x10396d){_0x4908d7(_0x10396d);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x1b')]=function(_0x55ed0a,_0x1c299c){this[_0xfc2a('0x17')][_0xfc2a('0x1c')](_0x55ed0a)['then'](function(_0xc3fc44){_0x1c299c(null,_0xc3fc44?_0xc3fc44[_0xfc2a('0x12')]:![]);})['catch'](function(_0x55c0bc){_0x1c299c(_0x55c0bc);});};AGIVertices[_0xfc2a('0x14')]['getSound']=function(_0xe0727b,_0x45771d){var _0x2e6066=this;this[_0xfc2a('0x17')]['getSoundById'](_0xe0727b)['then'](function(_0x5f4165){_0x45771d(null,_0x5f4165?_0x2e6066[_0xfc2a('0x1d')](_0x5f4165[_0xfc2a('0x1e')]):![]);})['catch'](function(_0xb3e787){_0x45771d(_0xb3e787);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x1f')]=function(_0xec7c14,_0x10debd){this[_0xfc2a('0x17')][_0xfc2a('0x20')](_0xec7c14)[_0xfc2a('0x11')](function(_0x33d648){_0x10debd(null,_0x33d648?_0x33d648:![]);})['catch'](function(_0x13b00a){_0x10debd(_0x13b00a);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x21')]=function(_0x45ba01,_0x3a8fbd,_0x359849){this[_0xfc2a('0xf')][_0xfc2a('0x21')](_0x45ba01,_0x3a8fbd)[_0xfc2a('0x11')](function(){_0x359849(null);})[_0xfc2a('0x13')](function(_0x454ae6){_0x359849(_0x454ae6);});};AGIVertices[_0xfc2a('0x14')]['getIntervals']=function(_0x10a863,_0x3e03c3){this[_0xfc2a('0x17')][_0xfc2a('0x22')](_0x10a863)['then'](function(_0x314f01){if(_0x314f01){if(_0x314f01['IntervalId']){_0x3e03c3(null,[_0x314f01[_0xfc2a('0x23')]]);}else{_0x3e03c3(null,_['map'](_0x314f01[_0xfc2a('0x24')],_0xfc2a('0x23')));}}else{_0x3e03c3(null,![]);}})['catch'](function(_0x51cc7a){_0x3e03c3(_0x51cc7a);});};AGIVertices['prototype']['getSoundPath']=function(_0x1ef015){return util[_0xfc2a('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x1ef015);};AGIVertices['prototype'][_0xfc2a('0x26')]=function(_0x42a59f,_0x292dee,_0x118a4a){odbc[_0xfc2a('0x27')](_0x42a59f,function(_0x5dde47){if(_0x5dde47){logger[_0xfc2a('0x28')](_0xfc2a('0x29'),_0x5dde47);_0x118a4a(_0x5dde47);}else{logger['info'](_0xfc2a('0x2a'));odbc[_0xfc2a('0x2b')](_0x292dee,function(_0x61ee96,_0x596f13){if(_0x61ee96){logger[_0xfc2a('0x2c')](_0xfc2a('0x2d'),_0x292dee);_0x118a4a(_0x61ee96);}else{logger['info'](_0xfc2a('0x2e'),_0x292dee);odbc[_0xfc2a('0x2f')](function(_0x469be5){if(_0x469be5){logger[_0xfc2a('0x28')](_0xfc2a('0x30'),_0x469be5);}_0x118a4a(null,_0x596f13);});}});}});};AGIVertices[_0xfc2a('0x14')]['getSmsAccount']=function(_0x109f04,_0x20084e){this[_0xfc2a('0x17')][_0xfc2a('0x31')](_0x109f04)[_0xfc2a('0x11')](function(_0x17ae18){_0x20084e(null,_0x17ae18?_0x17ae18:![]);})['catch'](function(_0x2f27ff){_0x20084e(_0x2f27ff);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x32')]=function(_0x363598,_0x3065de){this[_0xfc2a('0x17')]['createSmsMessage'](_0x363598)[_0xfc2a('0x11')](function(_0x3c43ca){_0x3065de(null,_0x3c43ca);})['catch'](function(_0x4c9bae){_0x3065de(_0x4c9bae);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x33')]=function(_0x5a78ee,_0x53a63a,_0x2e4c14){this[_0xfc2a('0x17')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0xfc2a('0x34')],'node':_0x5a78ee[_0xfc2a('0x35')],'application':_0x5a78ee['agicommand'],'data':_0x53a63a||null,'project_name':this[_0xfc2a('0xe')][_0xfc2a('0x36')],'callerid':this[_0xfc2a('0xe')]['callerid']})[_0xfc2a('0x11')](function(_0x287d1c){if(_0x2e4c14){_0x2e4c14(null,_0x287d1c);}})[_0xfc2a('0x13')](function(_0x48c381){if(_0x2e4c14){_0x2e4c14(_0x48c381);}});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x37')]=function(_0x272e21,_0x5cc159,_0x2656c1,_0x1341b7){this[_0xfc2a('0x17')][_0xfc2a('0x37')]({'uniqueid':this[_0xfc2a('0xe')][_0xfc2a('0x34')],'callerid':this[_0xfc2a('0xe')]['callerid'],'calleridname':this[_0xfc2a('0xe')][_0xfc2a('0x38')],'context':this[_0xfc2a('0xe')][_0xfc2a('0x39')],'extension':this[_0xfc2a('0xe')][_0xfc2a('0x3a')],'priority':this['channel']['priority'],'accountcode':this['channel'][_0xfc2a('0x3b')],'dnid':this[_0xfc2a('0xe')][_0xfc2a('0x3c')],'projectName':this['channel'][_0xfc2a('0x36')],'saveName':_0x5cc159,'filename':_0x272e21['file']||_0x5cc159,'savePath':_0x2656c1})[_0xfc2a('0x11')](function(_0x37ed34){_0x1341b7(null,_0x37ed34);})[_0xfc2a('0x13')](function(_0x314dec){_0x1341b7(_0x314dec);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x3d')]=function(_0x2a038a,_0x438bee,_0x2505d4,_0x10f844,_0x554bb1){this['rpc']['createSquareMessage']({'uniqueid':this[_0xfc2a('0xe')][_0xfc2a('0x34')],'body':_0x2a038a,'direction':_0x438bee,'providerName':_0x2505d4,'providerResponse':_0x10f844})[_0xfc2a('0x11')](function(_0x556d2c){if(_0x554bb1){_0x554bb1(null,_0x556d2c);}})[_0xfc2a('0x13')](function(_0x7b8432){if(_0x554bb1){_0x554bb1(_0x7b8432);}});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x3e')]=function(_0x4273c2,_0x7a9678){this[_0xfc2a('0x17')][_0xfc2a('0x3e')]({'firstName':_[_0xfc2a('0x3f')](_0x4273c2['name'])||_[_0xfc2a('0x40')](_0x4273c2['name'])?_0xfc2a('0x41')+Math[_0xfc2a('0x42')]():_0x4273c2['name'],'lastName':_[_0xfc2a('0x3f')](_0x4273c2['lastName'])||_[_0xfc2a('0x40')](_0x4273c2['lastName'])?null:_0x4273c2[_0xfc2a('0x43')],'phone':_0x4273c2[_0xfc2a('0x44')],'ListId':_0x4273c2[_0xfc2a('0x45')],'scheduledat':_0x4273c2['scheduledAt'],'callbackUniqueid':this[_0xfc2a('0xe')][_0xfc2a('0x34')],'tags':_0xfc2a('0x46'),'description':_0xfc2a('0x47')+_0x4273c2[_0xfc2a('0x48')][_0xfc2a('0x49')](),'priority':_0x4273c2['callback_priority']})['then'](function(_0x2833c4){_0x7a9678(null,_0x2833c4);})[_0xfc2a('0x13')](function(_0x31371d){_0x7a9678(_0x31371d);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x4a')]=function(_0x575826,_0x133ea7){this[_0xfc2a('0x17')]['getPauseById'](_0x575826)['then'](function(_0x4d9d66){_0x133ea7(null,_0x4d9d66?_0x4d9d66[_0xfc2a('0x12')]:![]);})[_0xfc2a('0x13')](function(_0xb77172){_0x133ea7(_0xb77172);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x4b')]=function(_0x42003f,_0x175859,_0x165f5b){var _0xb7d563={'role':'agent'};_0xb7d563[_0x42003f]=this[_0xfc2a('0xe')][_0xfc2a('0x4c')];this[_0xfc2a('0x17')][_0xfc2a('0x4b')](_0xb7d563,_0x175859,this['channel']['uniqueid'])[_0xfc2a('0x11')](function(_0xd70b5f){_0x165f5b(null,_[_0xfc2a('0x40')](_0xd70b5f)?![]:!![]);})['catch'](function(_0x84e7b2){logger['error'](_0x84e7b2);_0x165f5b(null,![]);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x4d')]=function(_0x55b21e,_0x5044b3){var _0x1749bd={'role':_0xfc2a('0x4e')};_0x1749bd[_0x55b21e]=this[_0xfc2a('0xe')]['callerid'];this[_0xfc2a('0x17')][_0xfc2a('0x4d')](_0x1749bd)['then'](function(_0x293145){_0x5044b3(null,_['isNil'](_0x293145)?![]:!![]);})[_0xfc2a('0x13')](function(_0x438e64){logger['error'](_0x438e64);_0x5044b3(null,![]);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x4f')]=function(_0x1bb7c4,_0x325879){var _0x4a06c8={'role':'agent'};_0x4a06c8[_0x1bb7c4]=this['channel'][_0xfc2a('0x4c')];this['rpc'][_0xfc2a('0x4f')](_0x4a06c8)[_0xfc2a('0x11')](function(_0x5aeb5b){_0x325879(null,_[_0xfc2a('0x40')](_0x5aeb5b)?![]:!![]);})[_0xfc2a('0x13')](function(_0x143f11){logger[_0xfc2a('0x28')](_0x143f11);_0x325879(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x389864,_0x1c953f){var _0x248b57={'role':_0xfc2a('0x4e')};_0x248b57[_0x389864]=this[_0xfc2a('0xe')][_0xfc2a('0x4c')];var _0x173851=_0x389864!=_0xfc2a('0x50')?util['format'](_0xfc2a('0x51'),_0xfc2a('0x52'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')]):undefined;this[_0xfc2a('0x17')][_0xfc2a('0x53')](_0x248b57,_0x173851)[_0xfc2a('0x11')](function(_0x2d65a0){_0x1c953f(null,_[_0xfc2a('0x40')](_0x2d65a0)?![]:!![]);})[_0xfc2a('0x13')](function(_0x57843b){logger[_0xfc2a('0x28')](_0x57843b);_0x1c953f(null,![]);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x54')]=function(_0x16c157,_0x29bdca){sh[_0xfc2a('0x55')](_[_0xfc2a('0x56')](_0x16c157),function(_0x34d439,_0x2d2405){var _0x5d5871=_0x2d2405[_0xfc2a('0x57')](/(\r\n|\n|\r)/gm,'');_0x29bdca(null,_0x5d5871);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x58')]=function(_0x2bfb4c,_0x1b04fb){scripts[_0xfc2a('0x58')](_0x2bfb4c[_0xfc2a('0x59')],_0x2bfb4c[_0xfc2a('0x5a')]||_0xfc2a('0x5b'),_0x2bfb4c[_0xfc2a('0x5b')],_0x2bfb4c['languageCode']||_0xfc2a('0x5c'),_0x2bfb4c['ssmlGender']||_0xfc2a('0x5d'),_0x2bfb4c[_0xfc2a('0x5e')]||_0xfc2a('0x5f'))[_0xfc2a('0x11')](function(_0x40535b){_0x1b04fb(null,_0x40535b);})[_0xfc2a('0x13')](function(_0x35ec43){_0x1b04fb(_0x35ec43);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x60')]=function(_0x1c5206,_0x38c08a){scripts[_0xfc2a('0x60')](_0x1c5206[_0xfc2a('0x5b')],_0x1c5206[_0xfc2a('0x61')]||'en',0x1)[_0xfc2a('0x11')](function(_0x14f15b){_0x38c08a(null,_0x14f15b);})[_0xfc2a('0x13')](function(_0x3b2d35){_0x38c08a(_0x3b2d35);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x62')]=function(_0x86af42,_0x21624b){var _0x5958ae={'uri':_0x86af42[_0xfc2a('0x63')],'method':_0x86af42[_0xfc2a('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x86af42['timeout'])===_0xfc2a('0x65')&&parseInt(_0x86af42[_0xfc2a('0x66')])>=0x1?parseInt(_0x86af42[_0xfc2a('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xfc2a('0x67'),_0xfc2a('0x68')],_0x5958ae[_0xfc2a('0x64')][_0xfc2a('0x69')]())){try{_0x5958ae[_0xfc2a('0x6a')]=_0x86af42[_0xfc2a('0xb')]?JSON[_0xfc2a('0x6b')](_0x86af42[_0xfc2a('0xb')]):{};}catch(_0x4776f0){logger['error'](_0xfc2a('0x6c'),_0x4776f0);}}try{_0x5958ae[_0xfc2a('0x6d')]=_0x86af42[_0xfc2a('0x6e')]?JSON[_0xfc2a('0x6b')](_0x86af42[_0xfc2a('0x6e')]):{};}catch(_0xc47c1c){logger[_0xfc2a('0x28')](_0xfc2a('0x6f'),_0xc47c1c);}if(_0x86af42[_0xfc2a('0x70')]){try{var _0x231cde=require(_0x86af42[_0xfc2a('0x70')])[_0xfc2a('0x71')](this,_0x5958ae);_0x5958ae['uri']=Mustache[_0xfc2a('0x72')](_0x86af42[_0xfc2a('0x63')],_0x231cde,{},['$$','$$']);if(_0x5958ae[_0xfc2a('0x6d')]){_0x5958ae[_0xfc2a('0x6d')]=JSON['parse'](Mustache[_0xfc2a('0x72')](JSON['stringify'](_0x5958ae[_0xfc2a('0x6d')]),_0x231cde,{},['$$','$$']));}if(_0x5958ae[_0xfc2a('0x6a')]){_0x5958ae[_0xfc2a('0x6a')]=JSON[_0xfc2a('0x6b')](Mustache[_0xfc2a('0x72')](JSON['stringify'](_0x5958ae[_0xfc2a('0x6a')]),_0x231cde,{},['$$','$$']));}}catch(_0x55d127){logger[_0xfc2a('0x28')](_0xfc2a('0x73'),_0x55d127);}}rp(_0x5958ae)[_0xfc2a('0x11')](function(_0x1b6a55){var _0x5836e9={'statusCode':_0x1b6a55[_0xfc2a('0x74')]||0xc8,'statusMessage':_0x1b6a55[_0xfc2a('0x75')]||'OK','headers':_0x1b6a55[_0xfc2a('0x6d')]||{},'body':_0x1b6a55[_0xfc2a('0x6a')]||{}};_0x21624b(null,_0x5836e9);})[_0xfc2a('0x13')](function(_0x4a96cf){var _0x116554={'statusCode':_0x4a96cf[_0xfc2a('0x74')]||0x1f4,'statusMessage':_0x4a96cf[_0xfc2a('0x76')]||_0xfc2a('0x77'),'headers':_0x4a96cf[_0xfc2a('0x78')][_0xfc2a('0x6d')]||{},'body':_0x4a96cf[_0xfc2a('0x78')][_0xfc2a('0x6a')]||{}};_0x21624b(null,_0x116554);});};AGIVertices[_0xfc2a('0x14')]['googleDialogflow']=function(_0x52e46d,_0x26b75c){scripts[_0xfc2a('0x79')](this[_0xfc2a('0xe')]['uniqueid'],_0x52e46d['key'],_0x52e46d['text'],_0x52e46d[_0xfc2a('0x7a')]||'en')['then'](function(_0x290b8c){_0x26b75c(null,_0x290b8c);})[_0xfc2a('0x13')](function(_0x50b49d){_0x26b75c(_0x50b49d);});};AGIVertices['prototype'][_0xfc2a('0x7b')]=function(_0x2e58df,_0x4a62d0){scripts[_0xfc2a('0x7b')](this[_0xfc2a('0xe')][_0xfc2a('0x34')],_0x2e58df[_0xfc2a('0x7c')],_0x2e58df[_0xfc2a('0x7d')],_0x2e58df[_0xfc2a('0x7e')],_0x2e58df[_0xfc2a('0x5b')],_0x2e58df[_0xfc2a('0x7f')]||'en')['then'](function(_0x294875){_0x4a62d0(null,_0x294875);})[_0xfc2a('0x13')](function(_0x3706ef){_0x4a62d0(_0x3706ef);});};AGIVertices['prototype'][_0xfc2a('0x80')]=function(_0x2a21d0,_0x49ba7a){scripts[_0xfc2a('0x80')](this[_0xfc2a('0xe')],_0x2a21d0)[_0xfc2a('0x11')](function(_0x4531c){_0x49ba7a(null,_0x4531c);})['catch'](function(_0x53c645){_0x49ba7a(_0x53c645);});};AGIVertices['prototype'][_0xfc2a('0x81')]=function(_0x4cb4ee,_0xbff48d){scripts['ispeechTTS'](_0x4cb4ee[_0xfc2a('0x82')],_0x4cb4ee[_0xfc2a('0x5b')],_0x4cb4ee['ispeech_tts_language']||'en-US',_0x4cb4ee[_0xfc2a('0x83')])[_0xfc2a('0x11')](function(_0x34a15f){_0xbff48d(null,_0x34a15f);})[_0xfc2a('0x13')](function(_0x3c5bc1){_0xbff48d(_0x3c5bc1);});};AGIVertices['prototype'][_0xfc2a('0x84')]=function(_0x2a8952,_0x2577ea,_0x3cdefd){scripts['ispeechASR'](_0x2577ea,_0x2a8952[_0xfc2a('0x82')],_0x2a8952[_0xfc2a('0x85')]||_0xfc2a('0x5c'),this[_0xfc2a('0x86')](_0x2a8952[_0xfc2a('0x87')])?_0x2a8952[_0xfc2a('0x87')]:undefined)[_0xfc2a('0x11')](function(_0x32ba42){_0x3cdefd(null,_0x32ba42);})[_0xfc2a('0x13')](function(_0xe97319){_0x3cdefd(_0xe97319);});};AGIVertices[_0xfc2a('0x14')]['awsPolly']=function(_0x38e309,_0x1fa750){scripts[_0xfc2a('0x88')](_0x38e309[_0xfc2a('0x89')],_0x38e309['aws_secret_access_key'],_0x38e309['aws_polly_region'],_0x38e309[_0xfc2a('0x8a')]||_0xfc2a('0x8b'),_0x38e309[_0xfc2a('0x5b')],_0x38e309['aws_text_type']||_0xfc2a('0x5b'))[_0xfc2a('0x11')](function(_0x276d93){_0x1fa750(null,_0x276d93);})[_0xfc2a('0x13')](function(_0x381902){_0x1fa750(_0x381902);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x8c')]=function(_0x3a0c4f,_0x4e3dc9){scripts['awsLex'](this[_0xfc2a('0xe')][_0xfc2a('0x34')],_0x3a0c4f[_0xfc2a('0x89')],_0x3a0c4f[_0xfc2a('0x8d')],_0x3a0c4f[_0xfc2a('0x8e')],_0x3a0c4f['text'],_0x3a0c4f[_0xfc2a('0x8f')])['then'](function(_0xbbe918){_0x4e3dc9(null,_0xbbe918);})[_0xfc2a('0x13')](function(_0x33ced2){_0x4e3dc9(_0x33ced2);});};AGIVertices['prototype']['googleASR']=function(_0x3d95c9,_0x38b465,_0x5a3f36){scripts[_0xfc2a('0x90')](_0x38b465,_0x3d95c9[_0xfc2a('0x82')],_0x3d95c9['google_asr_language']||'en-US')[_0xfc2a('0x11')](function(_0x4b18e5){_0x5a3f36(null,_0x4b18e5);})['catch'](function(_0xb5069){_0x5a3f36(_0xb5069);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x91')]=function(_0x2d3c1,_0x34bb4f,_0x220060){scripts[_0xfc2a('0x91')](_0x34bb4f,_0x2d3c1[_0xfc2a('0x92')],_0x2d3c1[_0xfc2a('0x93')],_0x2d3c1[_0xfc2a('0x94')])[_0xfc2a('0x11')](function(_0x319db2){_0x220060(null,_0x319db2);})[_0xfc2a('0x13')](function(_0x237170){_0x220060(_0x237170);});};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x95')]=function(_0x701fa7){var _0x5f2d58=_[_0xfc2a('0x96')](verticesWithRetry,_0x701fa7['agicommand'])?_0x701fa7:_[_0xfc2a('0x97')](_0x701fa7);for(var _0x33d47e in _0x5f2d58){if(_0x5f2d58['hasOwnProperty'](_0x33d47e)){if(_0x5f2d58[_0x33d47e]&&_[_0xfc2a('0x98')](_0x5f2d58[_0x33d47e])){if(_[_0xfc2a('0x96')](recursiveMapAttributes,_0x33d47e)){_0x5f2d58[_0x33d47e]=this[_0xfc2a('0x99')](_0x5f2d58[_0x33d47e]);}else{_0x5f2d58[_0x33d47e]=this[_0xfc2a('0x9a')](_0x5f2d58[_0x33d47e]);}}}}return _0x5f2d58;};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x9b')]=function(_0x1f7745){for(var _0x2c79dd in _0x1f7745){if(_0x1f7745[_0xfc2a('0x9c')](_0x2c79dd)){if(_[_0xfc2a('0x9d')](_0x1f7745[_0x2c79dd])){this[_0xfc2a('0x9b')](_0x1f7745[_0x2c79dd]);}else if(_['isArray'](_0x1f7745[_0x2c79dd])){for(var _0x5a5253=0x0;_0x5a5253<_0x1f7745[_0x2c79dd][_0xfc2a('0x9e')];_0x5a5253++){this[_0xfc2a('0x9b')](_0x1f7745[_0x2c79dd][_0x5a5253]);}}else if(_[_0xfc2a('0x98')](_0x1f7745[_0x2c79dd])){_0x1f7745[_0x2c79dd]=this['replaceAllVariables'](_0x1f7745[_0x2c79dd]);}}}};AGIVertices['prototype'][_0xfc2a('0x9f')]=function(_0xb63dc7,_0x4e621c){for(var _0xd78ad6 in _0xb63dc7){if(_0xb63dc7[_0xfc2a('0x9c')](_0xd78ad6)){if(_['isPlainObject'](_0xb63dc7[_0xd78ad6])){if(!_[_0xfc2a('0x3f')](_0xb63dc7[_0xd78ad6])){this[_0xfc2a('0x9f')](_0xb63dc7[_0xd78ad6],util[_0xfc2a('0x25')]('%s.%s',_0x4e621c,_0xd78ad6));}}else if(_['isArray'](_0xb63dc7[_0xd78ad6])){for(var _0x31b415=0x0;_0x31b415<_0xb63dc7[_0xd78ad6][_0xfc2a('0x9e')];_0x31b415++){this[_0xfc2a('0x9f')](_0xb63dc7[_0xd78ad6][_0x31b415],util[_0xfc2a('0x25')](_0xfc2a('0xa0'),_0x4e621c,_0xd78ad6+'['+_0x31b415+']'));}}else{if(!_[_0xfc2a('0x40')](_0xb63dc7[_0xd78ad6])){this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')]('%s.%s',_0x4e621c,_0xd78ad6),_0xb63dc7[_0xd78ad6]);}}}}};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x99')]=function(_0x40cc83){try{var _0x2bc162=JSON['parse'](_0x40cc83);this[_0xfc2a('0x9b')](_0x2bc162);return JSON[_0xfc2a('0xa2')](_0x2bc162);}catch(_0x11f9ce){return this[_0xfc2a('0x9a')](_0x40cc83);}};AGIVertices['prototype'][_0xfc2a('0x9a')]=function(_0x13e4c7){var _0x1ee3aa=_0x13e4c7[_0xfc2a('0xa3')]('{');for(var _0x3f9423=0x1;_0x3f9423<_0x1ee3aa['length'];_0x3f9423+=0x1){var _0x1a74c9=_0x1ee3aa[_0x3f9423]['split']('}');if(_0x1a74c9[_0xfc2a('0x9e')]>0x1){_0x13e4c7=_0x13e4c7[_0xfc2a('0xa4')]('{'+_0x1a74c9[0x0]+'}',this['channel'][_0xfc2a('0x10')](_0x1a74c9[0x0])[_0xfc2a('0xa5')]||_0x1a74c9[0x0]);}}if(_0x1ee3aa['length']===0x1){return _0x13e4c7[_0xfc2a('0x49')]();}return this[_0xfc2a('0x9a')](_0x13e4c7);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xa6')]=function(_0x526e9b,_0x1f7261){var _0xf54b3=this[_0xfc2a('0xe')][_0xfc2a('0x10')](_0x526e9b);if(_0xf54b3[_0xfc2a('0xa7')]===-0x1){return _0xf54b3;}logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1f7261,_0xf54b3['extra']));return this[_0xfc2a('0xe')][_0xfc2a('0xa1')](_0x1f7261,_0xf54b3['extra']);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x86')]=function(_0x4fe632){return _0x4fe632&&_0x4fe632!=='0'&&_0x4fe632!=='-1'&&_0x4fe632!=='';};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xa8')]=function(_0x55c496){this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x55c496,'-');_0x55c496[_0xfc2a('0xa9')]=_0x55c496[_0xfc2a('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xaa')]=function(_0x3de32d){logger['info'](util['format'](_0xfc2a('0xab'),_0x3de32d[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x3de32d[_0xfc2a('0x5b')])){return this['channel'][_0xfc2a('0xac')](_0xfc2a('0xad'));}var _0x2c631e='\x22'+_0x3de32d['text']+'\x22';if(this[_0xfc2a('0x86')](_0x3de32d['options'])){_0x2c631e+=','+_0x3de32d[_0xfc2a('0x78')];}var _0x437f8c=this[_0xfc2a('0xe')]['exec']('MRCPSynth',_0x2c631e);if(_0x437f8c[_0xfc2a('0xa7')]===-0x1){return _0x437f8c;}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0xae'),_0x2c631e));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xaf')]=function(_0x339196){logger['info'](util[_0xfc2a('0x25')](_0xfc2a('0xb0'),_0x339196[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x339196[_0xfc2a('0xb1')])){return this['channel'][_0xfc2a('0xac')]('no\x20grammar\x20configured');}var _0x25f73a=_0x339196['grammar'];if(this[_0xfc2a('0x86')](_0x339196[_0xfc2a('0x78')])){_0x25f73a+=','+_0x339196[_0xfc2a('0x78')];}var _0x11ec8c=this[_0xfc2a('0xe')][_0xfc2a('0x55')]('MRCPRecog',_0x25f73a);if(_0x11ec8c[_0xfc2a('0xa7')]===-0x1){return _0x11ec8c;}var _0x17380c=this['getAndSetVariable']('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x17380c[_0xfc2a('0xa7')]===-0x1){return _0x17380c;}var _0x1f6017=this[_0xfc2a('0xa6')](_0xfc2a('0xb2'),_0xfc2a('0xb3'));if(_0x1f6017[_0xfc2a('0xa7')]===-0x1){return _0x1f6017;}var _0x1f9c73=this[_0xfc2a('0xa6')](_0xfc2a('0xb4'),_0xfc2a('0xb5'));if(_0x1f9c73[_0xfc2a('0xa7')]===-0x1){return _0x1f9c73;}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x25f73a));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x7')]=function(_0x3e4510){logger['info'](util[_0xfc2a('0x25')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3e4510[_0xfc2a('0x35')]));return this[_0xfc2a('0xe')][_0xfc2a('0x7')]([_0x3e4510[_0xfc2a('0xb6')],_0x3e4510[_0xfc2a('0xb7')]]);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xb8')]=function(_0x2f6fe9){logger['info'](util[_0xfc2a('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2f6fe9[_0xfc2a('0x35')]));if(this[_0xfc2a('0x86')](_0x2f6fe9[_0xfc2a('0x66')])){logger['info'](util[_0xfc2a('0x25')](_0xfc2a('0xb9'),_0x2f6fe9[_0xfc2a('0x66')]));var _0x590499=this[_0xfc2a('0xe')]['wait'](_0x2f6fe9[_0xfc2a('0x66')]);if(_0x590499[_0xfc2a('0xa7')]===-0x1){return _0x590499;}}return this[_0xfc2a('0xe')][_0xfc2a('0xb8')]();};AGIVertices['prototype'][_0xfc2a('0x46')]=function(_0xba9e3){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0xba'),_0xba9e3[_0xfc2a('0x35')]));if(!this['isConfigured'](_0xba9e3[_0xfc2a('0x45')])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0xba9e3,_0xfc2a('0xbb'));}_0xba9e3[_0xfc2a('0x48')]=moment();if(this[_0xfc2a('0x86')](_0xba9e3[_0xfc2a('0xbc')])){_0xba9e3[_0xfc2a('0x48')]=moment()['add'](_0xba9e3['delay'],_0xfc2a('0xbd'));}if(!this['isConfigured'](_0xba9e3[_0xfc2a('0xbe')])){_0xba9e3[_0xfc2a('0xbe')]=0x2;}this[_0xfc2a('0x3e')][_0xfc2a('0x71')](this,_0xba9e3);return this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')](_0xfc2a('0xbf'),_0xba9e3[_0xfc2a('0x44')],_0xba9e3['list_id'],_0xba9e3['scheduledAt']));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xc0')]=function(_0x168011){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0xc1'),_0x168011[_0xfc2a('0x35')]));var _0x21c36b=this[_0xfc2a('0xe')][_0xfc2a('0x55')](_0x168011[_0xfc2a('0xc2')],_0x168011[_0xfc2a('0x78')]);if(_0x21c36b['result']===-0x1){return _0x21c36b;}return this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')](_0xfc2a('0xc3'),_0x168011[_0xfc2a('0xc2')],_0x168011['options']));};AGIVertices[_0xfc2a('0x14')]['lumenvoxtts']=function(_0x1d57b4){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0xc4'),_0x1d57b4[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x1d57b4[_0xfc2a('0x5b')])){return this['channel'][_0xfc2a('0xac')](_0xfc2a('0xad'));}var _0x4eb291='\x22'+_0x1d57b4[_0xfc2a('0x5b')]+'\x22';if(this['isConfigured'](_0x1d57b4[_0xfc2a('0x78')])){_0x4eb291+=','+_0x1d57b4[_0xfc2a('0x78')];}var _0x257681=this[_0xfc2a('0xe')][_0xfc2a('0x55')](_0xfc2a('0xc5'),_0x4eb291);if(_0x257681['result']===-0x1){return _0x257681;}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0xae'),_0x4eb291));};AGIVertices['prototype'][_0xfc2a('0xc6')]=function(_0x5a1518){logger['info'](util[_0xfc2a('0x25')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5a1518[_0xfc2a('0x35')]));if(!this['isConfigured'](_0x5a1518[_0xfc2a('0x5b')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20text\x20configured');}var _0x94d473='\x22'+_0x5a1518[_0xfc2a('0x5b')]+'\x22';if(this['isConfigured'](_0x5a1518[_0xfc2a('0x78')])){_0x94d473+=','+_0x5a1518[_0xfc2a('0x78')];}var _0x941613=this[_0xfc2a('0xe')]['exec'](_0xfc2a('0xc5'),_0x94d473);if(_0x941613[_0xfc2a('0xa7')]===-0x1){return _0x941613;}return this['channel']['noop'](util[_0xfc2a('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x94d473));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xc7')]=function(_0x378281){logger[_0xfc2a('0x2c')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x378281['label']));if(!this['isConfigured'](_0x378281[_0xfc2a('0xb1')])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0xc8'));}var _0x157b30=_0x378281[_0xfc2a('0xb1')];if(this[_0xfc2a('0x86')](_0x378281[_0xfc2a('0x78')])){_0x157b30+=','+_0x378281[_0xfc2a('0x78')];}var _0x1d3af3=this['channel'][_0xfc2a('0x55')](_0xfc2a('0xc9'),_0x157b30);if(_0x1d3af3[_0xfc2a('0xa7')]===-0x1){return _0x1d3af3;}var _0x46e454=this[_0xfc2a('0xa6')](_0xfc2a('0xca'),_0xfc2a('0xcb'));if(_0x46e454[_0xfc2a('0xa7')]===-0x1){return _0x46e454;}var _0x137745=this['getAndSetVariable'](_0xfc2a('0xb2'),_0xfc2a('0xcc'));if(_0x137745[_0xfc2a('0xa7')]===-0x1){return _0x137745;}var _0x32c80b=this[_0xfc2a('0xa6')]('RECOG_INSTANCE()',_0xfc2a('0xcd'));if(_0x32c80b[_0xfc2a('0xa7')]===-0x1){return _0x32c80b;}return this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0xce'),_0x157b30));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xcf')]=function(_0x110e97){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x110e97['label']));if(!this[_0xfc2a('0x86')](_0x110e97[_0xfc2a('0xb1')])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0xc8'));}var _0x247692=_0x110e97[_0xfc2a('0xb1')];if(this[_0xfc2a('0x86')](_0x110e97[_0xfc2a('0x78')])){_0x247692+=','+_0x110e97['options'];}var _0x384459=this[_0xfc2a('0xe')]['exec']('MRCPRecog',_0x247692);if(_0x384459[_0xfc2a('0xa7')]===-0x1){return _0x384459;}var _0x2a0065=this[_0xfc2a('0xa6')](_0xfc2a('0xca'),'SESTEK_ASR_CONFIDENCE');if(_0x2a0065[_0xfc2a('0xa7')]===-0x1){return _0x2a0065;}var _0x8a92e7=this[_0xfc2a('0xa6')]('RECOG_INPUT()',_0xfc2a('0xd0'));if(_0x8a92e7[_0xfc2a('0xa7')]===-0x1){return _0x8a92e7;}var _0x561b80=this[_0xfc2a('0xa6')](_0xfc2a('0xb4'),_0xfc2a('0xd1'));if(_0x561b80['result']===-0x1){return _0x561b80;}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format'](_0xfc2a('0xce'),_0x247692));};AGIVertices['prototype']['database']=function(_0x3e90b0){logger['info'](util[_0xfc2a('0x25')](_0xfc2a('0xd2'),_0x3e90b0[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x3e90b0[_0xfc2a('0xd3')])){return this['channel']['error'](_0x3e90b0,_0xfc2a('0xd4'));}var _0x279455=this[_0xfc2a('0x19')]['sync'](this,_0x3e90b0[_0xfc2a('0xd3')]);if(!_0x279455){return this['channel'][_0xfc2a('0x28')](_0x3e90b0,'no\x20odbc\x20database\x20found');}if(!this[_0xfc2a('0x86')](_0x3e90b0[_0xfc2a('0x2b')])){return this[_0xfc2a('0xe')]['error'](_0x3e90b0,'no\x20query\x20configured');}var _0x1d6776=_0x3e90b0[_0xfc2a('0x2b')][_0xfc2a('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0xd5'),_0x1d6776));var _0x5e9518=this[_0xfc2a('0x26')][_0xfc2a('0x71')](this,_0x279455,_0x1d6776);this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x3e90b0,_0x1d6776);if(!this[_0xfc2a('0x86')](_0x3e90b0[_0xfc2a('0xd6')])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0xd7'));}var _0x1e0aa5=this[_0xfc2a('0x10')][_0xfc2a('0x71')](this,_0x3e90b0['variable_id']);if(!_0x1e0aa5){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x3e90b0,_0xfc2a('0xd8'));}var _0x5d2c3a=this;_0x5e9518['forEach'](function(_0x2b0d95,_0x35531c){Object['keys'](_0x2b0d95)['forEach'](function(_0x3e4833){_0x5d2c3a[_0xfc2a('0xe')]['setVariable'](util[_0xfc2a('0x25')](_0xfc2a('0xd9'),_0x1e0aa5,_0x35531c,_0x3e4833),_0x2b0d95[_0x3e4833]);});});this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')](_0xfc2a('0xda'),_0x1e0aa5),_0x5e9518['length']);return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0xdb'),_0x1e0aa5));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xdc')]=function(_0x51edda){logger[_0xfc2a('0xdd')](util[_0xfc2a('0x25')](_0xfc2a('0xde'),_0x51edda[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x51edda['sip_id'])){return this['channel'][_0xfc2a('0x28')](_0x51edda,_0xfc2a('0xdf'));}var _0x285d7a=this[_0xfc2a('0xe0')][_0xfc2a('0x71')](this,_0x51edda[_0xfc2a('0xe1')]);if(!_0x285d7a){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x51edda,_0xfc2a('0xe2'));}var _0x2029c8=this[_0xfc2a('0xe')][_0xfc2a('0x55')](_0xfc2a('0xe3'),[util[_0xfc2a('0x25')](_0xfc2a('0xe4'),_0x285d7a),_0x51edda['timeout'],_0x51edda['opts'],_0x51edda['url']]);if(_0x2029c8['result']===-0x1){return _0x2029c8;}return this['channel']['noop'](util['format'](_0xfc2a('0xe5'),_0xfc2a('0xe3')));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xe6')]=function(_0x3c883d){logger[_0xfc2a('0x2c')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x3c883d[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x3c883d[_0xfc2a('0x82')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xe7'));}if(!this[_0xfc2a('0x86')](_0x3c883d['text'])){return this['channel'][_0xfc2a('0xac')]('no\x20text\x20configured');}this[_0xfc2a('0xe')][_0xfc2a('0xe8')]=!![];this[_0xfc2a('0x33')](_0x3c883d);this[_0xfc2a('0x3d')](_0x3c883d['text'],'in','','');this['channel'][_0xfc2a('0xac')](util['format'](_0xfc2a('0xe9'),_0x3c883d[_0xfc2a('0x5b')]));var _0x23f6a0=this[_0xfc2a('0x79')][_0xfc2a('0x71')](this,_0x3c883d);if(_0x23f6a0){for(var _0x2e966a in _0x23f6a0){if(_0x23f6a0['hasOwnProperty'](_0x2e966a)){this[_0xfc2a('0xe')]['setVariable'](util[_0xfc2a('0x25')](_0xfc2a('0xea'),_0x2e966a[_0xfc2a('0x69')]()),_0x23f6a0[_0x2e966a]);}}this['createSquareMessage'](_0x23f6a0[_0xfc2a('0xeb')],'out',_0xfc2a('0xe6'),'');return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format'](_0xfc2a('0xec'),_0x23f6a0['speech']));}return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x3c883d,_0xfc2a('0xed'));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xee')]=function(_0x1738b2){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1738b2[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x1738b2[_0xfc2a('0x7c')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xef'));}if(!this['isConfigured'](_0x1738b2[_0xfc2a('0x7d')])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0xf0'));}if(!this['isConfigured'](_0x1738b2[_0xfc2a('0x7e')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xf1'));}if(!this[_0xfc2a('0x86')](_0x1738b2[_0xfc2a('0x7f')])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0xf2'));}if(!this[_0xfc2a('0x86')](_0x1738b2['text'])){return this['channel']['noop'](_0xfc2a('0xad'));}this[_0xfc2a('0xe')]['bot']=!![];this[_0xfc2a('0x33')](_0x1738b2);this[_0xfc2a('0x3d')](_0x1738b2[_0xfc2a('0x5b')],'in','','');this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format'](_0xfc2a('0xf3'),_0x1738b2[_0xfc2a('0x5b')]));var _0x25937b=this['googleDialogflowV2'][_0xfc2a('0x71')](this,_0x1738b2);if(_0x25937b){for(var _0x36195a in _0x25937b){if(_0x25937b[_0xfc2a('0x9c')](_0x36195a)){if(_0x36195a!=='providerResponse'){this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')]('DIALOGFLOW_%s',_0x36195a[_0xfc2a('0x69')]()),_0x25937b[_0x36195a]);}}}this['createSquareMessage'](_0x25937b[_0xfc2a('0xeb')],_0xfc2a('0xf4'),_0xfc2a('0xee'),_0x25937b[_0xfc2a('0xf5')]);return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0xf6'),_0x25937b[_0xfc2a('0xeb')]));}return this[_0xfc2a('0xe')]['error'](_0x1738b2,_0xfc2a('0xf7'));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xf8')]=function(_0x2b11af){logger[_0xfc2a('0x2c')](util['format'](_0xfc2a('0xf9'),_0x2b11af['label']));if(!this[_0xfc2a('0x86')](_0x2b11af[_0xfc2a('0xfa')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xfb'));}if(!this[_0xfc2a('0x86')](_0x2b11af[_0xfc2a('0xfc')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20username\x20configured');}if(!this[_0xfc2a('0x86')](_0x2b11af['password'])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0xfd'));}if(!this[_0xfc2a('0x86')](_0x2b11af[_0xfc2a('0xfe')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20text\x20configured');}this[_0xfc2a('0xe')][_0xfc2a('0xe8')]=!![];this[_0xfc2a('0x33')](_0x2b11af);this[_0xfc2a('0x3d')](_0x2b11af[_0xfc2a('0x5b')],'in','','');this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')]('Trying\x20SestekNDA:\x20%s',_0x2b11af['text']));var _0x3605dc=this[_0xfc2a('0x80')]['sync'](this,_0x2b11af);if(_0x3605dc){for(var _0xf0f6fb in _0x3605dc){if(_0x3605dc[_0xfc2a('0x9c')](_0xf0f6fb)){this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util['format'](_0xfc2a('0xff'),_0xf0f6fb[_0xfc2a('0x69')]()),_0x3605dc[_0xf0f6fb]);}}this['createSquareMessage'](_0x3605dc['speech'],_0xfc2a('0xf4'),_0xfc2a('0xf8'),'');if(_0x3605dc['audiofile']){this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')](_0xfc2a('0x100'),_0x3605dc[_0xfc2a('0x101')]));var _0x357fa0=this[_0xfc2a('0xe')][_0xfc2a('0x102')](_0x3605dc['audiofile']);try{fs['unlink'](_0x3605dc[_0xfc2a('0x101')]+_0xfc2a('0x103'));}catch(_0x29fc0d){logger[_0xfc2a('0x28')](_0x29fc0d);}return _0x357fa0;}else{return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x104'),_0x3605dc[_0xfc2a('0xeb')]));}}return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x2b11af,_0xfc2a('0x105'));};AGIVertices['prototype'][_0xfc2a('0x106')]=function(_0x738c60){logger[_0xfc2a('0x2c')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x738c60['label']));return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('end');};AGIVertices[_0xfc2a('0x14')]['ext_dial']=function(_0x2595b7){logger[_0xfc2a('0x2c')](util['format'](_0xfc2a('0x107'),_0x2595b7[_0xfc2a('0x35')]));var _0x40e891='';if(_0x2595b7['trunk_id']){if(!this['isConfigured'](_0x2595b7[_0xfc2a('0x108')])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x2595b7,_0xfc2a('0x109'));}else{var _0x3d3bff=parseInt(_0x2595b7[_0xfc2a('0x108')],0xa);if(isNaN(_0x3d3bff)){_0x40e891=_0x2595b7[_0xfc2a('0x108')];}else{_0x40e891=this['getTrunk'][_0xfc2a('0x71')](this,_0x2595b7['trunk_id']);if(!_0x40e891){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x2595b7,_0xfc2a('0x10a'));}}}}else if(_0x2595b7[_0xfc2a('0x10b')]){_0x40e891=_0x2595b7[_0xfc2a('0x10b')];}else{return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x2595b7,_0xfc2a('0x109'));}var _0x354681=this[_0xfc2a('0xe')]['exec'](_0xfc2a('0xe3'),[util[_0xfc2a('0x25')]('SIP/%s/%s',_0x40e891,_0x2595b7[_0xfc2a('0x44')]),_0x2595b7[_0xfc2a('0x66')],_0x2595b7[_0xfc2a('0x10c')],_0x2595b7[_0xfc2a('0x63')]]);if(_0x354681[_0xfc2a('0xa7')]===-0x1){return _0x354681;}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0xe5'),_0xfc2a('0xe3')));};AGIVertices[_0xfc2a('0x14')]['finally']=function(_0x143d62){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x10d'),_0x143d62[_0xfc2a('0x35')]));return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0x10e'));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xc')]=function(_0x2153c7){logger['info'](util['format'](_0xfc2a('0x10f'),_0x2153c7[_0xfc2a('0x35')]));if(_0x2153c7[_0xfc2a('0xa9')]===0x0){return this[_0xfc2a('0xa8')](_0x2153c7);}_0x2153c7[_0xfc2a('0xa9')]-=0x1;if(!this[_0xfc2a('0x86')](_0x2153c7['file_id'])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x2153c7,_0xfc2a('0x110'));}var _0x863bbe=this[_0xfc2a('0x111')][_0xfc2a('0x71')](this,_0x2153c7['file_id']);if(!_0x863bbe){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x2153c7,_0xfc2a('0x112'));}if(!this['isConfigured'](_0x2153c7['variable_id'])){return this[_0xfc2a('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xb4b3ab=this[_0xfc2a('0xe')]['getData'](_0x863bbe,_0x2153c7['response'],_0x2153c7['maxdigit']);var _0x90f732=_0xb4b3ab[_0xfc2a('0xa7')]?_0xb4b3ab[_0xfc2a('0xa7')][_0xfc2a('0x49')]():'';logger[_0xfc2a('0x2c')](_0xfc2a('0x113'),JSON[_0xfc2a('0xa2')](_0xb4b3ab));if(_0xb4b3ab[_0xfc2a('0xa7')]===-0x1){this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x2153c7,_0x90f732);return _0xb4b3ab;}else if(_0xb4b3ab[_0xfc2a('0xa5')]===_0xfc2a('0x66')){_0xb4b3ab[_0xfc2a('0xa7')]=_0x90f732['length']>=parseInt(_0x2153c7[_0xfc2a('0x114')])?'x':'i';}else{_0xb4b3ab[_0xfc2a('0xa7')]=_0x90f732[_0xfc2a('0x9e')]>=parseInt(_0x2153c7[_0xfc2a('0x114')])&&_0x90f732[_0xfc2a('0x9e')]<=parseInt(_0x2153c7[_0xfc2a('0x115')])?'x':'i';}var _0x26d440=this[_0xfc2a('0x10')]['sync'](this,_0x2153c7[_0xfc2a('0xd6')]);if(!_0x26d440){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x2153c7,_0xfc2a('0xd8'));}this[_0xfc2a('0xe')][_0xfc2a('0xa1')](_0x26d440,_0x90f732);if(this['isConfigured'](_0x2153c7['hiddendigitsnum'])){var _0x31ffc0=parseInt(_0x2153c7[_0xfc2a('0x116')],0xa);var _0x247e00=rs[_0xfc2a('0x117')]({'charset':'*','length':_0x31ffc0});var _0x402c6a=_0x90f732['length'];if(_0x402c6a>0x0){if(_0x402c6a>_0x31ffc0){this[_0xfc2a('0x33')]['sync'](this,_0x2153c7,_0x2153c7['hiddendigitspos']==='first'?_0x247e00+_0x90f732[_0xfc2a('0x118')](_0x31ffc0):_0x90f732[_0xfc2a('0x118')](0x0,_0x402c6a-_0x31ffc0)+_0x247e00);}else{this[_0xfc2a('0x33')]['sync'](this,_0x2153c7,rs[_0xfc2a('0x117')]({'charset':'*','length':_0x402c6a}));}}else{this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x2153c7,'');}}else{this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x2153c7,_0x90f732);}return _0xb4b3ab;};AGIVertices[_0xfc2a('0x14')]['getsecretdigits']=function(_0x377b02){logger['info'](util['format'](_0xfc2a('0x119'),_0x377b02[_0xfc2a('0x35')]));return this[_0xfc2a('0xc')](_0x377b02);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x11a')]=function(_0x4be08b){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x11b'),_0x4be08b[_0xfc2a('0x35')]));this['createSquareDetailsReport'][_0xfc2a('0x71')](this,_0x4be08b,_0x4be08b[_0xfc2a('0x11c')]);return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x11d'),_0x4be08b[_0xfc2a('0x11c')]));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x11e')]=function(_0x1a1fb1){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x11f'),_0x1a1fb1[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x1a1fb1[_0xfc2a('0x89')])||!this[_0xfc2a('0x86')](_0x1a1fb1[_0xfc2a('0x8d')])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0x120'));}if(!this[_0xfc2a('0x86')](_0x1a1fb1['text'])){return this[_0xfc2a('0xe')]['noop']('no\x20text\x20configured');}this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x121'),_0x1a1fb1[_0xfc2a('0x5b')]));var _0x30b42b=this[_0xfc2a('0x88')][_0xfc2a('0x71')](this,_0x1a1fb1);if(_0x30b42b){this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x122'),_0x30b42b));var _0x1626b1=this[_0xfc2a('0xe')][_0xfc2a('0x102')](_0x30b42b);try{fs[_0xfc2a('0x123')](_0x30b42b+'.wav');}catch(_0x362b06){logger[_0xfc2a('0x28')](_0x362b06);}return _0x1626b1;}return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x1a1fb1,_0xfc2a('0x124'));};AGIVertices[_0xfc2a('0x14')]['awslex']=function(_0x64c1c4){logger['info'](util['format'](_0xfc2a('0x125'),_0x64c1c4[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x64c1c4['aws_access_key_id'])||!this[_0xfc2a('0x86')](_0x64c1c4[_0xfc2a('0x8d')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xfc2a('0x86')](_0x64c1c4[_0xfc2a('0x8f')])){return this['channel']['noop'](_0xfc2a('0x126'));}if(!this['isConfigured'](_0x64c1c4[_0xfc2a('0x5b')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xad'));}this[_0xfc2a('0xe')][_0xfc2a('0xe8')]=!![];this['createSquareDetailsReport'](_0x64c1c4);this['createSquareMessage'](_0x64c1c4[_0xfc2a('0x5b')],'in','','');this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')]('Trying\x20Amazon\x20Lex:\x20%s',_0x64c1c4[_0xfc2a('0x5b')]));var _0xa65353=this[_0xfc2a('0x8c')][_0xfc2a('0x71')](this,_0x64c1c4);if(_0xa65353){for(var _0x43d46e in _0xa65353){if(_0xa65353['hasOwnProperty'](_0x43d46e)&&_[_0xfc2a('0x98')](_0xa65353[_0x43d46e])){this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')]('AWS_LEX_%s',_0x43d46e[_0xfc2a('0x69')]()),_0xa65353[_0x43d46e]);}}if(_[_0xfc2a('0x40')](_0xa65353['message'])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0x127'));}else{this[_0xfc2a('0x3d')](_0xa65353[_0xfc2a('0x76')],'out',_0xfc2a('0x128'),'');return this[_0xfc2a('0xe')]['noop'](util['format']('Amazon\x20Lex\x20Result\x20%s',_0xa65353[_0xfc2a('0x76')]));}}return this[_0xfc2a('0xe')]['error'](_0x64c1c4,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xfc2a('0x14')]['googleasr']=function(_0x25f9b8){logger['info'](util[_0xfc2a('0x25')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x25f9b8['label'],_0x25f9b8[_0xfc2a('0x66')]));if(!this[_0xfc2a('0x86')](_0x25f9b8[_0xfc2a('0x82')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xe7'));}var _0xe21de7=_0xfc2a('0x129');var _0x478c50=util[_0xfc2a('0x25')](_0xfc2a('0x12a'),FILES_PATH,rs['generate'](0x4));var _0x128ffb=util[_0xfc2a('0x25')](_0xfc2a('0xa0'),_0x478c50,_0xe21de7);var _0x469a7f=!![];if(_0x25f9b8[_0xfc2a('0x12b')]==='NOBEEP'){_0x469a7f=![];}var _0x2ef5c3=this['channel']['recordFile'](_0x478c50,_0xe21de7,_0x25f9b8[_0xfc2a('0x12c')],_0x25f9b8[_0xfc2a('0x66')],undefined,_0x469a7f);if(_0x2ef5c3[_0xfc2a('0xa7')]!==-0x1){this['channel']['noop'](util['format']('google\x20%s\x20file\x20created',_0x128ffb));var _0x41db91=this[_0xfc2a('0x90')][_0xfc2a('0x71')](this,_0x25f9b8,_0x128ffb);if(_0x41db91){for(var _0x7d89a in _0x41db91){if(_0x41db91[_0xfc2a('0x9c')](_0x7d89a)){this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')]('GOOGLE_ASR_%s',_0x7d89a[_0xfc2a('0x69')]()),_0x41db91[_0x7d89a]);}}return this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')]('GoogleASR\x20Result\x20%s',JSON[_0xfc2a('0xa2')](_0x41db91)));}}return _0x2ef5c3;};AGIVertices[_0xfc2a('0x14')]['tildeasr']=function(_0x5c14d9){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x5c14d9[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x5c14d9[_0xfc2a('0x92')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x5c14d9['appsecret'])){return this['channel'][_0xfc2a('0xac')](_0xfc2a('0x12d'));}var _0x58b4d0=_0xfc2a('0x129');var _0x4e954b=util[_0xfc2a('0x25')](_0xfc2a('0x12a'),FILES_PATH,rs[_0xfc2a('0x117')](0x4));var _0x590353=util[_0xfc2a('0x25')](_0xfc2a('0xa0'),_0x4e954b,_0x58b4d0);var _0x3501f8=!![];if(_0x5c14d9['beep']===_0xfc2a('0x12e')){_0x3501f8=![];}var _0x3a32f1=this['channel']['recordFile'](_0x4e954b,_0x58b4d0,_0x5c14d9['intKey'],_0x5c14d9[_0xfc2a('0x66')],undefined,_0x3501f8);if(_0x3a32f1[_0xfc2a('0xa7')]!==-0x1){this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x12f'),_0x590353));var _0x35ff04=this['tildeASR']['sync'](this,_0x5c14d9,_0x590353);if(_0x35ff04){for(var _0xc7c49a in _0x35ff04){if(_0x35ff04[_0xfc2a('0x9c')](_0xc7c49a)){this['channel']['setVariable'](util['format'](_0xfc2a('0x130'),_0xc7c49a[_0xfc2a('0x69')]()),_0x35ff04[_0xc7c49a]);}}return this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x131'),JSON[_0xfc2a('0xa2')](_0x35ff04)));}}return _0x3a32f1;};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x132')]=function(_0xdadf1c){logger['info'](util['format'](_0xfc2a('0x133'),_0xdadf1c[_0xfc2a('0x35')]));return this[_0xfc2a('0xe')]['continueAt'](_0xdadf1c[_0xfc2a('0x39')],_0xdadf1c['extension'],_0xdadf1c[_0xfc2a('0x134')]);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x135')]=function(_0x594f9a){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x136'),_0x594f9a['label']));if(!this['isConfigured'](_0x594f9a[_0xfc2a('0x137')])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x594f9a,_0xfc2a('0x138'));}try{var _0x2d6e63=eval(_0x594f9a[_0xfc2a('0x137')])?_0xfc2a('0x139'):_0xfc2a('0x13a');this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x13b'),_0x594f9a['condition'],_0x2d6e63));return{'code':0xc8,'result':_0x2d6e63};}catch(_0x4f95b7){return{'code':0xc8,'result':_0xfc2a('0x13a')};}};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x13c')]=function(_0xf9f9c3){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x13d'),_0xf9f9c3['label']));if(!this[_0xfc2a('0x86')](_0xf9f9c3['interval_id'])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0xf9f9c3,_0xfc2a('0x13e'));}var _0x10a3b6=this[_0xfc2a('0x13f')]['sync'](this,_0xf9f9c3['interval_id']);if(!_0x10a3b6){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0xf9f9c3,_0xfc2a('0x140'));}for(var _0x3d4201=0x0;_0x3d4201<_0x10a3b6[_0xfc2a('0x9e')];_0x3d4201+=0x1){var _0xe5c58=this[_0xfc2a('0xe')]['getVariable'](util[_0xfc2a('0x25')]('IFTIME(%s?true:false)',_0x10a3b6[_0x3d4201]));if(_0xe5c58[_0xfc2a('0xa7')]===-0x1){return _0xe5c58;}logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('IFTIME\x20%s\x20%s',_0x10a3b6[_0x3d4201],_0xe5c58[_0xfc2a('0xa5')]));if(_0xe5c58[_0xfc2a('0xa5')]===_0xfc2a('0x139')){logger[_0xfc2a('0x2c')](util['format'](_0xfc2a('0x141'),_0x10a3b6[_0x3d4201],_0xfc2a('0x139')));this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x141'),_0x10a3b6[_0x3d4201],_0xfc2a('0x139')));return{'code':0xc8,'result':_0xfc2a('0x139')};}else{logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x141'),_0x10a3b6[_0x3d4201],_0xfc2a('0x13a')));this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x141'),_0x10a3b6[_0x3d4201],_0xfc2a('0x13a')));}}return{'code':0xc8,'result':_0xfc2a('0x13a')};};AGIVertices['prototype']['hangup']=function(_0x5284c6){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5284c6['label']));return this[_0xfc2a('0xe')][_0xfc2a('0x142')]();};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x143')]=function(_0x5493a9){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x144'),_0x5493a9[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x5493a9['key'])){return this['channel'][_0xfc2a('0xac')](_0xfc2a('0xe7'));}var _0x11d2f1=_0xfc2a('0x129');var _0x1ce40f=util[_0xfc2a('0x25')](_0xfc2a('0x12a'),FILES_PATH,rs[_0xfc2a('0x117')](0x4));var _0x42ad73=util['format'](_0xfc2a('0xa0'),_0x1ce40f,_0x11d2f1);var _0x1970f2=!![];if(_0x5493a9[_0xfc2a('0x12b')]==='NOBEEP'){_0x1970f2=![];}var _0x363526=this['channel'][_0xfc2a('0x145')](_0x1ce40f,_0x11d2f1,_0x5493a9[_0xfc2a('0x12c')],_0x5493a9[_0xfc2a('0x66')],undefined,_0x1970f2);if(_0x363526[_0xfc2a('0xa7')]!==-0x1){this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x146'),_0x42ad73));var _0x12bab4=this[_0xfc2a('0x84')][_0xfc2a('0x71')](this,_0x5493a9,_0x42ad73);if(_0x12bab4){for(var _0x323f3f in _0x12bab4){if(_0x12bab4[_0xfc2a('0x9c')](_0x323f3f)){this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util['format'](_0xfc2a('0x147'),_0x323f3f[_0xfc2a('0x69')]()),_0x12bab4[_0x323f3f]);}}return this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x148'),JSON[_0xfc2a('0xa2')](_0x12bab4)));}}return _0x363526;};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x149')]=function(_0x285628){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x14a'),_0x285628[_0xfc2a('0x35')]));if(!this['isConfigured'](_0x285628['key'])){return this['channel'][_0xfc2a('0xac')](_0xfc2a('0xe7'));}if(!this[_0xfc2a('0x86')](_0x285628[_0xfc2a('0x5b')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20text\x20configured');}this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x285628[_0xfc2a('0x5b')]));var _0x4c6465=this[_0xfc2a('0x81')][_0xfc2a('0x71')](this,_0x285628);if(_0x4c6465){this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')](_0xfc2a('0x146'),_0x4c6465));var _0x1c9a0d=this[_0xfc2a('0xe')]['streamFile'](_0x4c6465,_0x285628['intKey']);try{fs[_0xfc2a('0x123')](_0x4c6465+_0xfc2a('0x103'));}catch(_0x223fa9){logger['error'](_0x223fa9);}return _0x1c9a0d;}return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x285628,_0xfc2a('0x14b'));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x14c')]=function(_0x122ba7){logger[_0xfc2a('0x2c')](util['format'](_0xfc2a('0x14d'),_0x122ba7[_0xfc2a('0x35')]));if(!this['isConfigured'](_0x122ba7[_0xfc2a('0x14e')])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x122ba7,'no\x20find\x20by\x20configured');}logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x14f'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x122ba7['findBy']));var _0x199612=this[_0xfc2a('0x53')]['sync'](this,_0x122ba7[_0xfc2a('0x14e')]);if(_0x199612){logger['info'](util[_0xfc2a('0x25')](_0xfc2a('0x150'),this[_0xfc2a('0xe')]['callerid'],_0x122ba7[_0xfc2a('0x14e')]));this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x150'),this[_0xfc2a('0xe')]['callerid'],_0x122ba7[_0xfc2a('0x14e')]));return{'code':0xc8,'result':_0xfc2a('0x151')};}else{logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x152'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x122ba7[_0xfc2a('0x14e')]));this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format'](_0xfc2a('0x152'),this['channel']['callerid'],_0x122ba7[_0xfc2a('0x14e')]));return{'code':0xc8,'result':_0xfc2a('0x153')};}};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x154')]=function(_0x2f7909){logger['info'](util[_0xfc2a('0x25')](_0xfc2a('0x155'),_0x2f7909[_0xfc2a('0x35')]));if(!this['isConfigured'](_0x2f7909[_0xfc2a('0x14e')])){return this[_0xfc2a('0xe')]['error'](_0x2f7909,_0xfc2a('0x156'));}logger[_0xfc2a('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2f7909['findBy']));var _0x3cbee6=this[_0xfc2a('0x4f')]['sync'](this,_0x2f7909[_0xfc2a('0x14e')]);if(_0x3cbee6){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x150'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2f7909['findBy']));this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x150'),this['channel']['callerid'],_0x2f7909[_0xfc2a('0x14e')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfc2a('0x2c')](util['format'](_0xfc2a('0x152'),this[_0xfc2a('0xe')]['callerid'],_0x2f7909[_0xfc2a('0x14e')]));this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x152'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2f7909['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xfc2a('0x157')]=function(_0x50dd00){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x158'),_0x50dd00['label']));if(!this[_0xfc2a('0x86')](_0x50dd00[_0xfc2a('0x159')])){return this['channel'][_0xfc2a('0x28')](_0x50dd00,'no\x20operation\x20configured');}this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x15a'),_0x50dd00[_0xfc2a('0x159')]));var _0x4bdbc7=eval(_0x50dd00[_0xfc2a('0x159')]);if(!this[_0xfc2a('0x86')](_0x50dd00[_0xfc2a('0xd6')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xd7'));}var _0x425675=this[_0xfc2a('0x10')]['sync'](this,_0x50dd00[_0xfc2a('0xd6')]);if(!_0x425675){return this['channel'][_0xfc2a('0x28')](_0x50dd00,_0xfc2a('0xd8'));}if(_['isArray'](_0x4bdbc7)){var _0x1e5753=this;_0x4bdbc7[_0xfc2a('0x15b')](function(_0x5ebb57,_0x3ef231){_0x1e5753[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')](_0xfc2a('0x15c'),_0x425675,_0x3ef231),_0x5ebb57);});return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x15d'),_0x425675));}else{return this[_0xfc2a('0xe')][_0xfc2a('0xa1')](_0x425675,_0x4bdbc7);}};AGIVertices['prototype'][_0xfc2a('0x15e')]=function(_0x25ae43){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x15f'),_0x25ae43[_0xfc2a('0x35')]));if(_0x25ae43[_0xfc2a('0xa9')]===0x0){return this[_0xfc2a('0xa8')](_0x25ae43);}_0x25ae43[_0xfc2a('0xa9')]-=0x1;if(!this[_0xfc2a('0x86')](_0x25ae43[_0xfc2a('0x160')])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x25ae43,_0xfc2a('0x110'));}var _0x55b736=this['getSound'][_0xfc2a('0x71')](this,_0x25ae43[_0xfc2a('0x160')]);if(!_0x55b736){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x25ae43,_0xfc2a('0x112'));}var _0x32df58=this[_0xfc2a('0xe')][_0xfc2a('0x161')](_0x55b736,_0x25ae43[_0xfc2a('0x162')],_0x25ae43[_0xfc2a('0x163')]);var _0x36b21e=_0x32df58[_0xfc2a('0xa7')];if(_0x32df58['result']===-0x1){this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x25ae43,'-1');return _0x32df58;}else if(_0x32df58[_0xfc2a('0xa5')]==='timeout'){_0x32df58[_0xfc2a('0xa7')]=_0x32df58[_0xfc2a('0xa7')][_0xfc2a('0x9e')]>0x0?_0x32df58[_0xfc2a('0xa7')]:'t';}else if(_['isEmpty'](_0x32df58[_0xfc2a('0xa7')])){_0x32df58[_0xfc2a('0xa7')]='#';_0x36b21e='#';}if(!this['isConfigured'](_0x25ae43[_0xfc2a('0xd6')])){this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0xd7'));}else{var _0x44027d=this[_0xfc2a('0x10')]['sync'](this,_0x25ae43[_0xfc2a('0xd6')]);if(!_0x44027d){return this['channel']['error'](_0x25ae43,'no\x20variable\x20found');}this[_0xfc2a('0xe')][_0xfc2a('0xa1')](_0x44027d,_0x36b21e);}this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x25ae43,_0x36b21e);return _0x32df58;};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0xac')]=function(_0x20d472){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x164'),_0x20d472['label']));return this['channel'][_0xfc2a('0xac')](_0x20d472['output']||_0x20d472[_0xfc2a('0x35')]);};AGIVertices['prototype']['pause']=function(_0x2a525f){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x165'),_0x2a525f['label']));if(!this[_0xfc2a('0x86')](_0x2a525f[_0xfc2a('0x14e')])){return this['channel'][_0xfc2a('0x28')](_0x2a525f,_0xfc2a('0x156'));}logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x14f'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2a525f[_0xfc2a('0x14e')]));var _0x15fcfb=this['getPause'][_0xfc2a('0x71')](this,_0x2a525f['pause_id']);var _0x2dc12d=this[_0xfc2a('0x4b')]['sync'](this,_0x2a525f[_0xfc2a('0x14e')],_0x15fcfb);if(_0x2dc12d){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x150'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2a525f[_0xfc2a('0x14e')]));this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format'](_0xfc2a('0x150'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2a525f[_0xfc2a('0x14e')]));return{'code':0xc8,'result':_0xfc2a('0x151')};}else{logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x152'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2a525f['findBy']));this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x150'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x2a525f['findBy']));return{'code':0xc8,'result':_0xfc2a('0x153')};}};AGIVertices[_0xfc2a('0x14')]['playback']=function(_0x1700a5){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x166'),_0x1700a5[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x1700a5['file_id'])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x1700a5,'no\x20file\x20audio\x20selected');}var _0x364ffb=this[_0xfc2a('0x111')][_0xfc2a('0x71')](this,_0x1700a5['file_id']);if(!_0x364ffb){return this['channel'][_0xfc2a('0x28')](_0x1700a5,_0xfc2a('0x112'));}var _0x39d114=this[_0xfc2a('0xe')]['exec'](_0xfc2a('0x167'),[_0x364ffb,_0x1700a5[_0xfc2a('0x10c')]]);if(_0x39d114[_0xfc2a('0xa7')]===-0x1){return _0x39d114;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xfc2a('0x167'),_0x364ffb));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x168')]=function(_0x3f5469){logger[_0xfc2a('0x2c')](util['format'](_0xfc2a('0x169'),_0x3f5469['label']));if(!this['isConfigured'](_0x3f5469[_0xfc2a('0x16a')])){return this['channel'][_0xfc2a('0x28')](_0x3f5469,_0xfc2a('0x16b'));}var _0x269902='';var _0x109f39=parseInt(_0x3f5469[_0xfc2a('0x16a')],0xa);if(isNaN(_0x109f39)){_0x269902=_0x3f5469['queue_id'];}else{_0x269902=this[_0xfc2a('0x15')]['sync'](this,_0x3f5469['queue_id']);if(!_0x269902){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x3f5469,_0xfc2a('0x16c'));}}var _0x5c820f='';if(this[_0xfc2a('0x86')](_0x3f5469[_0xfc2a('0x160')])){var _0x542a15=this[_0xfc2a('0x111')][_0xfc2a('0x71')](this,_0x3f5469['file_id']);if(_0x542a15){_0x5c820f=_0x542a15;}}this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x3f5469,_0x269902);if(_0x3f5469[_0xfc2a('0x10c')][_0xfc2a('0x16d')]('x')<0x0){_0x3f5469[_0xfc2a('0x10c')]+='x';}if(_0x3f5469[_0xfc2a('0x10c')]['indexOf']('X')<0x0){_0x3f5469[_0xfc2a('0x10c')]+='X';}this['channel']['setVariable'](_0xfc2a('0x16e'),_0x269902?_0x269902[_0xfc2a('0x16f')]():'');var _0x90a3fa=this['channel'][_0xfc2a('0x55')](_0xfc2a('0x170'),[_0x269902,_0x3f5469[_0xfc2a('0x10c')],_0x3f5469[_0xfc2a('0x63')],_0x5c820f,_0x3f5469['timeout'],_0x3f5469[_0xfc2a('0x7')],_0x3f5469[_0xfc2a('0x171')],_0x3f5469['gosub'],'',_0x3f5469[_0xfc2a('0x172')]]);if(_0x90a3fa[_0xfc2a('0xa7')]===-0x1){return _0x90a3fa;}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format'](_0xfc2a('0xc3'),_0xfc2a('0x170'),_0x269902));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x173')]=function(_0x4cceaf){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4cceaf[_0xfc2a('0x35')]));var _0x405827=_0x4cceaf[_0xfc2a('0x174')]||_0xfc2a('0x129');var _0x2b6bce=util['format']('%s_%s',this[_0xfc2a('0xe')][_0xfc2a('0x34')],rs['generate'](0x5));var _0x3ef161=util[_0xfc2a('0x25')](_0xfc2a('0x175'),FILES_PATH,_0x2b6bce,_0x405827);var _0x3c31b5=util[_0xfc2a('0x25')](_0xfc2a('0x12a'),FILES_PATH,_0x2b6bce);this[_0xfc2a('0x37')][_0xfc2a('0x71')](this,_0x4cceaf,_0x2b6bce,_0x3ef161);this['channel'][_0xfc2a('0xa1')]('RECORDING_SAVENAME',_0x2b6bce);logger['info'](_0xfc2a('0x176'),_0x3c31b5,_0x405827,_0x4cceaf[_0xfc2a('0x177')],_0x4cceaf[_0xfc2a('0x66')]);return this['channel'][_0xfc2a('0x145')](_0x3c31b5,_0x405827,_0x4cceaf[_0xfc2a('0x177')],_0x4cceaf[_0xfc2a('0x66')],undefined,!![]);};AGIVertices['prototype'][_0xfc2a('0x178')]=function(_0x67acaf){logger['info'](util[_0xfc2a('0x25')](_0xfc2a('0x179'),_0x67acaf['label']));if(!this[_0xfc2a('0x86')](_0x67acaf['url'])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0x17a'));}var _0xe06ed0=this[_0xfc2a('0x62')]['sync'](this,_0x67acaf);logger['info'](util['format'](_0xfc2a('0x17b'),util[_0xfc2a('0x17c')](_0xe06ed0,{'showHidden':![],'depth':null})));if(!this[_0xfc2a('0x86')](_0x67acaf[_0xfc2a('0xd6')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0x17d'));}var _0x293b36=this[_0xfc2a('0x10')]['sync'](this,_0x67acaf['variable_id']);if(!_0x293b36){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x67acaf,_0xfc2a('0xd8'));}this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')]('%s_STATUS_CODE',_0x293b36),_0xe06ed0[_0xfc2a('0x74')]?_0xe06ed0[_0xfc2a('0x74')]:_0xfc2a('0x17e'));this[_0xfc2a('0xe')][_0xfc2a('0xa1')](util[_0xfc2a('0x25')](_0xfc2a('0x17f'),_0x293b36),_0xe06ed0[_0xfc2a('0x75')]?_0xe06ed0['statusMessage']:'OK');if(_0xe06ed0[_0xfc2a('0x6a')]){try{this[_0xfc2a('0x9f')](_0xe06ed0['body'],_0x293b36);}catch(_0x248d2d){logger['error'](util['format'](_0xfc2a('0x180'),_0x293b36));}}return this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')]('variable\x20%s\x20set',_0x293b36));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x181')]=function(_0x5c193a){logger[_0xfc2a('0x2c')](util['format'](_0xfc2a('0x182'),_0x5c193a[_0xfc2a('0x35')]));return this['channel'][_0xfc2a('0x183')](_0x5c193a[_0xfc2a('0x184')][_0xfc2a('0x57')](/\s+/g,''),_0x5c193a[_0xfc2a('0x177')]);};AGIVertices['prototype'][_0xfc2a('0x185')]=function(_0x127049){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x186'),_0x127049[_0xfc2a('0x35')]));return this[_0xfc2a('0xe')][_0xfc2a('0x187')](_0x127049['number'][_0xfc2a('0x57')](/\s+/g,''),_0x127049['escape_digits']);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x188')]=function(_0x27c597){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x189'),_0x27c597[_0xfc2a('0x35')]));return this[_0xfc2a('0xe')][_0xfc2a('0x18a')](_0x27c597[_0xfc2a('0x5b')],_0x27c597[_0xfc2a('0x177')]);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x18b')]=function(_0x404a9f){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x18c'),_0x404a9f['label']));if(!this['isConfigured'](_0x404a9f[_0xfc2a('0x18d')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0x18e'));}var _0x2eab00=this[_0xfc2a('0x1f')][_0xfc2a('0x71')](this,_0x404a9f[_0xfc2a('0x18d')]);if(!_0x2eab00||!_0x2eab00['Smtp']){return this[_0xfc2a('0xe')]['error'](_0x404a9f,'no\x20mail\x20account\x20found');}var _0x1f4388={'from':util[_0xfc2a('0x25')](_0xfc2a('0x18f'),_0x2eab00[_0xfc2a('0x12')],_0x2eab00['email']||_0x2eab00['Smtp'][_0xfc2a('0x190')]),'to':_0x404a9f['to']||'','cc':_0x404a9f['cc']||'','bcc':_0x404a9f[_0xfc2a('0x191')]||'','subject':_0x404a9f[_0xfc2a('0x192')],'html':_0x404a9f[_0xfc2a('0x5b')],'text':_0x404a9f[_0xfc2a('0x5b')]};if(this[_0xfc2a('0x86')](_0x404a9f[_0xfc2a('0x193')])){}logger[_0xfc2a('0xdd')](_0xfc2a('0x194'),JSON[_0xfc2a('0xa2')](_0x1f4388));this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x404a9f,_0x404a9f[_0xfc2a('0x18d')]);this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x195'),_0x2eab00[_0xfc2a('0x12')]));this[_0xfc2a('0x21')][_0xfc2a('0x71')](this,_0x2eab00[_0xfc2a('0x196')],_0x1f4388);return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xfc2a('0x197')]=function(_0x22bc24){logger[_0xfc2a('0x2c')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x22bc24[_0xfc2a('0x35')]));return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xfc2a('0x14')]['sendSMS']=function(_0xaeed23){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x198'),_0xaeed23[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0xaeed23[_0xfc2a('0x199')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20sms\x20account\x20configured');}var _0x198a88=this[_0xfc2a('0x19a')][_0xfc2a('0x71')](this,_0xaeed23['sms_account_id']);if(!_0x198a88){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0xaeed23,_0xfc2a('0x19b'));}var _0x5e4b5c={'body':_0xaeed23[_0xfc2a('0x19c')],'phone':_0xaeed23['to']||'','SmsAccountId':_0x198a88['id']};logger['debug'](_0xfc2a('0x19d'),JSON[_0xfc2a('0xa2')](_0x5e4b5c));this[_0xfc2a('0x33')]['sync'](this,_0xaeed23,_0xaeed23[_0xfc2a('0x199')]);this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')](_0xfc2a('0x19e'),_0x198a88['name']));this[_0xfc2a('0x32')][_0xfc2a('0x71')](this,_0x5e4b5c);return this['channel'][_0xfc2a('0xac')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x19f')]=function(_0x5ce6d9){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x1a0'),_0x5ce6d9[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x5ce6d9[_0xfc2a('0xd6')])){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x5ce6d9,_0xfc2a('0x1a1'));}var _0x3a8fb3=this[_0xfc2a('0x10')][_0xfc2a('0x71')](this,_0x5ce6d9['variable_id']);if(!_0x3a8fb3){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x5ce6d9,_0xfc2a('0xd8'));}return this[_0xfc2a('0xe')][_0xfc2a('0xa1')](_0x3a8fb3,_0x5ce6d9[_0xfc2a('0x1a2')]);};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x1a3')]=function(_0x3b3a4b){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3b3a4b[_0xfc2a('0x35')]));this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0x1a4'));if(_0x3b3a4b['answer']===_0xfc2a('0x1a5')){this[_0xfc2a('0xe')]['noop']('Answer');return this[_0xfc2a('0xe')]['answer']();}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](_0xfc2a('0x1a6'));};AGIVertices['prototype'][_0xfc2a('0x1a7')]=function(_0x5644ba){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x1a8'),_0x5644ba[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x5644ba['project_id'])){return this[_0xfc2a('0xe')]['error'](_0x5644ba,'no\x20subproject\x20selected');}var _0x26cddb=this['getSquareProject'][_0xfc2a('0x71')](this,_0x5644ba[_0xfc2a('0x1a9')]);if(!this['isConfigured'](_0x26cddb)){return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x5644ba,util[_0xfc2a('0x25')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5644ba[_0xfc2a('0x1a9')]));}if(_0x26cddb===this['channel'][_0xfc2a('0x36')]){return this[_0xfc2a('0xe')]['error'](_0x5644ba,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xfc2a('0x33')][_0xfc2a('0x71')](this,_0x5644ba,_0x26cddb);var _0x31fad8=this[_0xfc2a('0xe')][_0xfc2a('0x55')](_0xfc2a('0x1aa'),util[_0xfc2a('0x25')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xfc2a('0x7')][_0xfc2a('0x1ab')]||_0xfc2a('0x1ac'),_0x26cddb,this[_0xfc2a('0xe')][_0xfc2a('0x36')]));if(_0x31fad8[_0xfc2a('0xa7')]===-0x1){return _0x31fad8;}return this['channel']['noop'](util[_0xfc2a('0x25')](_0xfc2a('0xc3'),_0xfc2a('0x1aa'),_0x26cddb));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x1ad')]=function(_0x345ec8){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x1ae'),_0x345ec8[_0xfc2a('0x35')]));var _0x2249f9=this[_0xfc2a('0x54')][_0xfc2a('0x71')](this,_0x345ec8[_0xfc2a('0xb6')]);this['createSquareDetailsReport'][_0xfc2a('0x71')](this,_0x345ec8,_0x345ec8[_0xfc2a('0xb6')]);if(this['isConfigured'](_0x345ec8['variable_id'])){var _0x499952=this['getVariable'][_0xfc2a('0x71')](this,_0x345ec8['variable_id']);if(_0x499952){this['channel']['setVariable'](_0x499952,_0x2249f9);return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x1af'),_0x345ec8[_0xfc2a('0xb6')],_0x499952));}}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x1b0'),_0x345ec8['command']));};AGIVertices[_0xfc2a('0x14')]['google_cloud_tts']=function(_0x53fb28){logger['info'](util[_0xfc2a('0x25')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x53fb28[_0xfc2a('0x35')]));_0x53fb28['text']=_0x53fb28[_0xfc2a('0x5b')][_0xfc2a('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfc2a('0x86')](_0x53fb28[_0xfc2a('0x59')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x53fb28[_0xfc2a('0x5b')])){return this[_0xfc2a('0xe')][_0xfc2a('0xac')]('no\x20text\x20configured');}this['channel']['noop'](util[_0xfc2a('0x25')](_0xfc2a('0x1b1'),_0x53fb28[_0xfc2a('0x5b')]));var _0x223846=this[_0xfc2a('0x58')][_0xfc2a('0x71')](this,_0x53fb28);if(_0x223846){this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x223846));var _0x417aee=this['channel'][_0xfc2a('0x102')](_0x223846);try{fs[_0xfc2a('0x123')](_0x223846+_0xfc2a('0x103'));}catch(_0x40682c){logger['error'](_0x40682c);}return _0x417aee;}return this[_0xfc2a('0xe')][_0xfc2a('0x28')](_0x53fb28,_0xfc2a('0x1b2'));};AGIVertices[_0xfc2a('0x14')][_0xfc2a('0x1b3')]=function(_0x588fef){logger['info'](util[_0xfc2a('0x25')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x588fef['label']));_0x588fef['text']=_0x588fef[_0xfc2a('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfc2a('0x86')](_0x588fef[_0xfc2a('0x5b')])){return this[_0xfc2a('0xe')]['noop'](_0xfc2a('0xad'));}this[_0xfc2a('0xe')][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x1b4'),_0x588fef['text']));var _0x3da102=this[_0xfc2a('0x60')][_0xfc2a('0x71')](this,_0x588fef);if(_0x3da102){this['channel'][_0xfc2a('0xac')](util[_0xfc2a('0x25')](_0xfc2a('0x1b5'),_0x3da102));var _0x211f54=this['channel'][_0xfc2a('0x102')](_0x3da102);try{fs['unlink'](_0x3da102+'.wav');}catch(_0x2f01a0){logger[_0xfc2a('0x28')](_0x2f01a0);}return _0x211f54;}return this['channel'][_0xfc2a('0x28')](_0x588fef,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['unpause']=function(_0x1e868f){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x1b6'),_0x1e868f[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x1e868f[_0xfc2a('0x14e')])){return this['channel'][_0xfc2a('0x28')](_0x1e868f,_0xfc2a('0x156'));}logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x14f'),this['channel'][_0xfc2a('0x4c')],_0x1e868f[_0xfc2a('0x14e')]));var _0x174b72=this['agentUnpause'][_0xfc2a('0x71')](this,_0x1e868f[_0xfc2a('0x14e')]);if(_0x174b72){logger[_0xfc2a('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x1e868f[_0xfc2a('0x14e')]));this['channel'][_0xfc2a('0xac')](util['format'](_0xfc2a('0x150'),this[_0xfc2a('0xe')][_0xfc2a('0x4c')],_0x1e868f[_0xfc2a('0x14e')]));return{'code':0xc8,'result':_0xfc2a('0x151')};}else{logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x152'),this['channel'][_0xfc2a('0x4c')],_0x1e868f['findBy']));this[_0xfc2a('0xe')]['noop'](util[_0xfc2a('0x25')](_0xfc2a('0x152'),this['channel'][_0xfc2a('0x4c')],_0x1e868f[_0xfc2a('0x14e')]));return{'code':0xc8,'result':_0xfc2a('0x153')};}};AGIVertices['prototype'][_0xfc2a('0x1b7')]=function(_0x398bb6){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x398bb6[_0xfc2a('0x35')]));var _0x11b1f8=this[_0xfc2a('0xe')][_0xfc2a('0x55')]('VOICEMAIL',[_0x398bb6[_0xfc2a('0x1b8')],_0x398bb6[_0xfc2a('0x78')]]);if(_0x11b1f8[_0xfc2a('0xa7')]===-0x1){return _0x11b1f8;}return this[_0xfc2a('0xe')][_0xfc2a('0xac')](util['format']('Executed\x20command\x20%s\x20%s',_0xfc2a('0x1b9'),_0x398bb6[_0xfc2a('0x1b8')]));};AGIVertices[_0xfc2a('0x14')]['vswitch']=function(_0x3ee487){logger[_0xfc2a('0x2c')](util[_0xfc2a('0x25')](_0xfc2a('0x1ba'),_0x3ee487[_0xfc2a('0x35')]));if(!this[_0xfc2a('0x86')](_0x3ee487[_0xfc2a('0xd6')])){return this[_0xfc2a('0xe')]['error'](_0x3ee487,'no\x20variable\x20selected');}var _0x3d8a33=this[_0xfc2a('0x10')]['sync'](this,_0x3ee487['variable_id']);if(!_0x3d8a33){return this['channel'][_0xfc2a('0x28')](_0x3ee487,_0xfc2a('0xd8'));}var _0x3c9917=this[_0xfc2a('0xe')][_0xfc2a('0x10')](_0x3d8a33);return{'code':0xc8,'result':_0x3c9917['extra']?_0x3c9917['extra']:'-'};};String[_0xfc2a('0x14')][_0xfc2a('0xa4')]=function(_0x2b6260,_0x163d9e){return this[_0xfc2a('0xa3')](_0x2b6260)[_0xfc2a('0x1bb')](_0x163d9e);};module[_0xfc2a('0x1bc')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index d04d24e..4f40dac 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 _0xd69b=['[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','syncHangupRequest','hangup','bind','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','channels','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','uniqueid','updateAcw','lastPauseAt','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','stopAcw','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','prototype','[ACW][syncAgentConnect]\x20%s','message'];(function(_0x3ffb80,_0x209661){var _0x3a8a4c=function(_0x24b3e2){while(--_0x24b3e2){_0x3ffb80['push'](_0x3ffb80['shift']());}};_0x3a8a4c(++_0x209661);}(_0xd69b,0xcc));var _0xbd69=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xd69b[_0x36ed3c];return _0x52a2e0;};'use strict';var util=require('util');var _=require(_0xbd69('0x0'));var moment=require(_0xbd69('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0xbd69('0x2'));var RpcUser=require(_0xbd69('0x3'));var RpcVoiceAgentReport=require(_0xbd69('0x4'));function Acw(_0x52927a){this[_0xbd69('0x5')]=_0x52927a[_0xbd69('0x5')];this[_0xbd69('0x6')]=_0x52927a[_0xbd69('0x6')];this[_0xbd69('0x7')]=_0x52927a[_0xbd69('0x7')];this['channels']={};ami['on'](_0xbd69('0x8'),this[_0xbd69('0x9')]['bind'](this));ami['on']('hanguprequest',this[_0xbd69('0xa')]['bind'](this));ami['on'](_0xbd69('0xb'),this['syncHangup'][_0xbd69('0xc')](this));ami['on']('agentringnoanswer',this[_0xbd69('0xd')][_0xbd69('0xc')](this));ami['on'](_0xbd69('0xe'),this[_0xbd69('0xf')][_0xbd69('0xc')](this));ami['on'](_0xbd69('0x10'),this[_0xbd69('0x11')][_0xbd69('0xc')](this));ami['on'](_0xbd69('0x12'),this[_0xbd69('0x13')][_0xbd69('0xc')](this));}function getDiff(_0x182cc8){var _0xfaf494=moment()[_0xbd69('0x14')](0x0);var _0x31fb3f=moment(_0x182cc8)[_0xbd69('0x14')](0x0);return _0xfaf494[_0xbd69('0x15')](_0x31fb3f,_0xbd69('0x16'));}Acw['prototype']['startAcw']=function(_0x4f09fd){try{var _0x2f620e=this;var _0x3186e2=this[_0xbd69('0x17')][_0x4f09fd][_0xbd69('0x18')];var _0x50d764=this[_0xbd69('0x17')][_0x4f09fd][_0xbd69('0x19')];var _0x4bb06e=this[_0xbd69('0x5')][_0x50d764];var _0x4ec0ed=![];var _0x453e3='ACW';if(_0x4bb06e[_0xbd69('0x1a')]){if(_0x4bb06e[_0xbd69('0x1b')][_0xbd69('0x1c')]){_0x4ec0ed=!![];_0x453e3=_0x4bb06e[_0xbd69('0x1b')][_0xbd69('0x1c')];}}ami[_0xbd69('0x1d')]({'action':_0xbd69('0x1e'),'interface':_0x3186e2,'paused':!![],'reason':_0x453e3})[_0xbd69('0x1f')](function(_0xc9ed02){if(_0x2f620e[_0xbd69('0x6')][_0x3186e2]){return RpcUser['getAgent'](_0x2f620e[_0xbd69('0x6')][_0x3186e2]['id'])[_0xbd69('0x1f')](function(_0x1024cb){if(_0x1024cb&&!_0x1024cb[_0xbd69('0x20')]){logger[_0xbd69('0x21')](_0xbd69('0x22'),_0x4f09fd,_0x3186e2,_0x50d764);var _0x468927=_0x2f620e[_0xbd69('0x17')][_0x4f09fd][_0xbd69('0x23')]&&_0x2f620e[_0xbd69('0x17')][_0x4f09fd][_0xbd69('0x24')]?_0x2f620e[_0xbd69('0x17')][_0x4f09fd]['destlinkedid']:_0x4f09fd;return RpcUser[_0xbd69('0x25')](_0x2f620e['agents'][_0x3186e2],_0x453e3,_0x468927)[_0xbd69('0x1f')](function(_0x4248bd){if(!_0x4ec0ed){_0x2f620e[_0xbd69('0x7')][_0x3186e2]={};logger['info'](_0xbd69('0x26'),_0x4f09fd,_0x2f620e[_0xbd69('0x5')][_0x50d764]['acwTimeout'],_0x3186e2,_0x50d764);_0x2f620e[_0xbd69('0x7')][_0x3186e2][_0xbd69('0x27')]=setTimeout(_0x2f620e['stopAcw'][_0xbd69('0xc')](_0x2f620e,_0x3186e2),_0x2f620e[_0xbd69('0x5')][_0x50d764][_0xbd69('0x28')]*0x3e8);_0x2f620e[_0xbd69('0x7')][_0x3186e2]['lastPauseAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f620e[_0xbd69('0x7')][_0x3186e2][_0xbd69('0x29')]=_0x4f09fd;_0x2f620e[_0xbd69('0x7')][_0x3186e2][_0xbd69('0x19')]=_0x50d764;_0x2f620e[_0xbd69('0x7')][_0x3186e2][_0xbd69('0x2a')]=function(){var _0x11ccd6=getDiff(_0x2f620e['timers'][_0x3186e2][_0xbd69('0x2b')]);clearTimeout(_0x2f620e['timers'][_0x3186e2][_0xbd69('0x27')]);_0x2f620e[_0xbd69('0x7')][_0x3186e2][_0xbd69('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x11ccd6},_0x2f620e[_0xbd69('0x7')][_0x3186e2][_0xbd69('0x29')],_0x3186e2)[_0xbd69('0x1f')](function(_0x335706){logger['info'](_0xbd69('0x2c'),_0x4f09fd,_0x11ccd6,_0x335706);})[_0xbd69('0x2d')](function(_0x17ad0d){logger['error'](_0xbd69('0x2e'),_0x4f09fd,_0x17ad0d);});delete _0x2f620e[_0xbd69('0x7')][_0x3186e2];};}});}else{logger[_0xbd69('0x21')](_0xbd69('0x2f'),_0x4f09fd,_0x3186e2,_0x50d764);}});}})[_0xbd69('0x2d')](function(_0x436520){logger[_0xbd69('0x30')](_0xbd69('0x26'),_0x4f09fd,_0x2f620e[_0xbd69('0x5')][_0x50d764][_0xbd69('0x28')],_0x3186e2,_0x50d764);})[_0xbd69('0x31')](function(){delete _0x2f620e[_0xbd69('0x17')][_0x4f09fd];});}catch(_0x2a9315){logger['error'](_0xbd69('0x32'),_0x2a9315['message']);}};Acw['prototype'][_0xbd69('0x33')]=function(_0x30464d){try{var _0x35de8e=this;if(_0x35de8e['timers'][_0x30464d]){_0x35de8e[_0xbd69('0x7')][_0x30464d][_0xbd69('0x27')]=![];var _0x1cf178=_0x35de8e['timers'][_0x30464d][_0xbd69('0x29')];var _0x525671=_0x35de8e[_0xbd69('0x7')][_0x30464d][_0xbd69('0x19')];var _0x5c11fe=_0x35de8e[_0xbd69('0x5')][_0x525671]['acwTimeout'];logger[_0xbd69('0x21')](_0xbd69('0x34'),_0x1cf178,_0x30464d);RpcUser['saveUnpause'](this[_0xbd69('0x6')][_0x30464d]);RpcVoiceAgentReport[_0xbd69('0x35')]({'acwtime':_0x5c11fe,'agentacw':!![]},_0x1cf178,_0x30464d)[_0xbd69('0x1f')](function(_0x3c4b55){logger[_0xbd69('0x21')](_0xbd69('0x2c'),_0x1cf178,_0x5c11fe,_0x3c4b55);})[_0xbd69('0x2d')](function(_0x403854){logger[_0xbd69('0x30')](_0xbd69('0x2e'),_0x1cf178,_0x403854);});}else{logger[_0xbd69('0x30')](_0xbd69('0x36'),_0x30464d);if(_0x35de8e['timers']){logger['info'](_0xbd69('0x37'),JSON['stringify'](_0x35de8e[_0xbd69('0x7')]));}}}catch(_0x2bb1ca){logger[_0xbd69('0x30')](_0xbd69('0x38'),_0x2bb1ca['message']);}};Acw[_0xbd69('0x39')]['syncAgentConnect']=function(_0x500af4){try{if(this[_0xbd69('0x5')][_0x500af4['queue']]&&(this[_0xbd69('0x5')][_0x500af4[_0xbd69('0x19')]][_0xbd69('0x2')]||this[_0xbd69('0x5')][_0x500af4['queue']]['mandatoryDisposition'])){if(this[_0xbd69('0x6')][_0x500af4['interface']]){this[_0xbd69('0x17')][_0x500af4[_0xbd69('0x29')]]={'queue':_0x500af4[_0xbd69('0x19')],'interface':_0x500af4[_0xbd69('0x18')],'destlinkedid':_0x500af4[_0xbd69('0x24')]};}}}catch(_0x4ed015){logger[_0xbd69('0x30')](_0xbd69('0x3a'),_0x4ed015[_0xbd69('0x3b')]);}};Acw[_0xbd69('0x39')][_0xbd69('0x13')]=function(_0xcf2d78){try{if(this[_0xbd69('0x5')][_0xcf2d78[_0xbd69('0x19')]]&&(this[_0xbd69('0x5')][_0xcf2d78[_0xbd69('0x19')]]['acw']||this['voiceQueues'][_0xcf2d78[_0xbd69('0x19')]][_0xbd69('0x1a')])){if(this['agents'][_0xcf2d78['interface']]){this[_0xbd69('0x17')][_0xcf2d78['uniqueid']]={'queue':_0xcf2d78['queue'],'interface':_0xcf2d78[_0xbd69('0x18')]};}}}catch(_0x197f85){logger[_0xbd69('0x30')](_0xbd69('0x3c'),_0x197f85['message']);}};Acw['prototype']['syncHangupRequest']=function(_0x345f3a){try{if(this[_0xbd69('0x17')][_0x345f3a['uniqueid']]&&_[_0xbd69('0x3d')](this['channels'][_0x345f3a[_0xbd69('0x29')]][_0xbd69('0x23')])){logger[_0xbd69('0x21')](_0xbd69('0x3e'),_0x345f3a[_0xbd69('0x29')]);this[_0xbd69('0x3f')](_0x345f3a['uniqueid']);}else if(this['channels'][_0x345f3a[_0xbd69('0x40')]]&&_[_0xbd69('0x3d')](this[_0xbd69('0x17')][_0x345f3a[_0xbd69('0x40')]]['attended'])){logger[_0xbd69('0x21')](_0xbd69('0x41'),_0x345f3a[_0xbd69('0x40')]);this[_0xbd69('0x3f')](_0x345f3a[_0xbd69('0x40')]);}}catch(_0x52a8a0){logger['error'](_0xbd69('0x42'),_0x52a8a0[_0xbd69('0x3b')]);}};Acw['prototype'][_0xbd69('0x43')]=function(_0xadb11c){try{if(this[_0xbd69('0x17')][_0xadb11c['uniqueid']]&&this[_0xbd69('0x17')][_0xadb11c[_0xbd69('0x29')]][_0xbd69('0x23')]){logger[_0xbd69('0x21')](_0xbd69('0x44'),_0xadb11c['uniqueid']);this[_0xbd69('0x3f')](_0xadb11c[_0xbd69('0x29')]);}else if(this[_0xbd69('0x17')][_0xadb11c[_0xbd69('0x40')]]&&this[_0xbd69('0x17')][_0xadb11c[_0xbd69('0x40')]][_0xbd69('0x23')]){logger['info'](_0xbd69('0x45'),_0xadb11c[_0xbd69('0x40')]);this[_0xbd69('0x3f')](_0xadb11c[_0xbd69('0x40')]);}}catch(_0x52578c){logger[_0xbd69('0x30')](_0xbd69('0x46'),_0x52578c[_0xbd69('0x3b')]);}};Acw[_0xbd69('0x39')]['syncAttendedTransfer']=function(_0x2dfabf){try{if(!_[_0xbd69('0x47')](this['channels'][_0x2dfabf['transfereeuniqueid']])){this[_0xbd69('0x3f')](_0x2dfabf[_0xbd69('0x48')]);if(this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x49')]]){this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x49')]]['attended']=!![];this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x4a')]]=this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x49')]];delete this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x49')]];}}else if(!_[_0xbd69('0x47')](this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x4a')]])){this['startAcw'](_0x2dfabf['transfertargetuniqueid']);if(this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x4b')]]){this['channels'][_0x2dfabf[_0xbd69('0x4b')]][_0xbd69('0x23')]=!![];this['channels'][_0x2dfabf[_0xbd69('0x48')]]=this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x4b')]];delete this[_0xbd69('0x17')][_0x2dfabf[_0xbd69('0x4b')]];}}}catch(_0x43b30b){logger[_0xbd69('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x43b30b[_0xbd69('0x3b')]);}};Acw[_0xbd69('0x39')][_0xbd69('0x11')]=function(_0x395ecd){try{if(this[_0xbd69('0x17')][_0x395ecd[_0xbd69('0x4c')]]){logger[_0xbd69('0x21')](_0xbd69('0x4d'),JSON[_0xbd69('0x4e')](_0x395ecd[_0xbd69('0x4c')]));this[_0xbd69('0x3f')](_0x395ecd[_0xbd69('0x4c')]);}else if(this[_0xbd69('0x17')][_0x395ecd['transfererlinkedid']]){logger[_0xbd69('0x21')](_0xbd69('0x4f'),JSON[_0xbd69('0x4e')](_0x395ecd[_0xbd69('0x50')]));this[_0xbd69('0x3f')](_0x395ecd[_0xbd69('0x50')]);}}catch(_0x6f5ddf){logger[_0xbd69('0x30')](_0xbd69('0x51'),_0x6f5ddf[_0xbd69('0x3b')]);}};Acw[_0xbd69('0x39')]['syncAgentRingNoAnswer']=function(_0x5f404b){try{if(this[_0xbd69('0x5')][_0x5f404b['queue']]&&this['voiceQueues'][_0x5f404b[_0xbd69('0x19')]][_0xbd69('0x52')]===_0xbd69('0x53')){if(this[_0xbd69('0x6')][_0x5f404b[_0xbd69('0x18')]]){logger['info'](_0xbd69('0x54'),_0x5f404b[_0xbd69('0x29')],_0x5f404b[_0xbd69('0x18')],_0x5f404b[_0xbd69('0x19')]);return RpcUser[_0xbd69('0x25')](this['agents'][_0x5f404b['interface']],_0xbd69('0x55'),_0x5f404b[_0xbd69('0x29')]);}}}catch(_0x531895){logger[_0xbd69('0x30')](_0xbd69('0x56'),_0x531895[_0xbd69('0x3b')]);}};module[_0xbd69('0x57')]=Acw; \ No newline at end of file +var _0x65d6=['[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','info','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause'];(function(_0x34d34b,_0x3c5216){var _0x5c15f8=function(_0x2bce98){while(--_0x2bce98){_0x34d34b['push'](_0x34d34b['shift']());}};_0x5c15f8(++_0x3c5216);}(_0x65d6,0x173));var _0x665d=function(_0x163f25,_0x31c9df){_0x163f25=_0x163f25-0x0;var _0x71ee00=_0x65d6[_0x163f25];return _0x71ee00;};'use strict';var util=require(_0x665d('0x0'));var _=require(_0x665d('0x1'));var moment=require(_0x665d('0x2'));var ami=require(_0x665d('0x3'));var logger=require('../../../config/logger')(_0x665d('0x4'));var RpcUser=require(_0x665d('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1e03cf){this['voiceQueues']=_0x1e03cf[_0x665d('0x6')];this[_0x665d('0x7')]=_0x1e03cf[_0x665d('0x7')];this[_0x665d('0x8')]=_0x1e03cf['timers'];this['channels']={};ami['on'](_0x665d('0x9'),this[_0x665d('0xa')]['bind'](this));ami['on'](_0x665d('0xb'),this[_0x665d('0xc')][_0x665d('0xd')](this));ami['on'](_0x665d('0xe'),this[_0x665d('0xf')][_0x665d('0xd')](this));ami['on'](_0x665d('0x10'),this['syncAgentRingNoAnswer']['bind'](this));ami['on']('attendedtransfer',this[_0x665d('0x11')][_0x665d('0xd')](this));ami['on'](_0x665d('0x12'),this[_0x665d('0x13')][_0x665d('0xd')](this));ami['on'](_0x665d('0x14'),this[_0x665d('0x15')][_0x665d('0xd')](this));}function getDiff(_0x3316e2){var _0x2080b1=moment()[_0x665d('0x16')](0x0);var _0x591b56=moment(_0x3316e2)[_0x665d('0x16')](0x0);return _0x2080b1[_0x665d('0x17')](_0x591b56,_0x665d('0x18'));}Acw[_0x665d('0x19')][_0x665d('0x1a')]=function(_0x40d8bb){try{var _0x173a50=this;var _0x239b4d=this[_0x665d('0x1b')][_0x40d8bb][_0x665d('0x1c')];var _0x4ac23f=this[_0x665d('0x1b')][_0x40d8bb][_0x665d('0x1d')];var _0x4af4c5=this[_0x665d('0x6')][_0x4ac23f];var _0x3a74af=![];var _0x45482e=_0x665d('0x1e');if(_0x4af4c5[_0x665d('0x1f')]){if(_0x4af4c5[_0x665d('0x20')]['name']){_0x3a74af=!![];_0x45482e=_0x4af4c5[_0x665d('0x20')][_0x665d('0x21')];}}ami['Action']({'action':_0x665d('0x22'),'interface':_0x239b4d,'paused':!![],'reason':_0x45482e})[_0x665d('0x23')](function(_0x2afb8f){if(_0x173a50[_0x665d('0x7')][_0x239b4d]){return RpcUser['getAgent'](_0x173a50[_0x665d('0x7')][_0x239b4d]['id'])[_0x665d('0x23')](function(_0x4b0958){if(_0x4b0958&&!_0x4b0958[_0x665d('0x24')]){logger['info'](_0x665d('0x25'),_0x40d8bb,_0x239b4d,_0x4ac23f);var _0x33f450=_0x173a50[_0x665d('0x1b')][_0x40d8bb]['attended']&&_0x173a50[_0x665d('0x1b')][_0x40d8bb][_0x665d('0x26')]?_0x173a50['channels'][_0x40d8bb][_0x665d('0x26')]:_0x40d8bb;return RpcUser[_0x665d('0x27')](_0x173a50[_0x665d('0x7')][_0x239b4d],_0x45482e,_0x33f450)[_0x665d('0x23')](function(_0x53ad92){if(!_0x3a74af){_0x173a50[_0x665d('0x8')][_0x239b4d]={};logger[_0x665d('0x28')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x40d8bb,_0x173a50[_0x665d('0x6')][_0x4ac23f][_0x665d('0x29')],_0x239b4d,_0x4ac23f);_0x173a50[_0x665d('0x8')][_0x239b4d][_0x665d('0x2a')]=setTimeout(_0x173a50[_0x665d('0x2b')]['bind'](_0x173a50,_0x239b4d),_0x173a50['voiceQueues'][_0x4ac23f][_0x665d('0x29')]*0x3e8);_0x173a50['timers'][_0x239b4d][_0x665d('0x2c')]=moment()[_0x665d('0x2d')](_0x665d('0x2e'));_0x173a50['timers'][_0x239b4d][_0x665d('0x2f')]=_0x40d8bb;_0x173a50[_0x665d('0x8')][_0x239b4d][_0x665d('0x1d')]=_0x4ac23f;_0x173a50[_0x665d('0x8')][_0x239b4d][_0x665d('0x30')]=function(){var _0x24c086=getDiff(_0x173a50['timers'][_0x239b4d][_0x665d('0x2c')]);clearTimeout(_0x173a50[_0x665d('0x8')][_0x239b4d][_0x665d('0x2a')]);_0x173a50['timers'][_0x239b4d]['timer']=![];RpcVoiceAgentReport[_0x665d('0x31')]({'acwtime':_0x24c086},_0x173a50['timers'][_0x239b4d][_0x665d('0x2f')],_0x239b4d)[_0x665d('0x23')](function(_0x4da7bd){logger['info'](_0x665d('0x32'),_0x40d8bb,_0x24c086,_0x4da7bd);})[_0x665d('0x33')](function(_0x1f8242){logger[_0x665d('0x34')](_0x665d('0x35'),_0x40d8bb,_0x1f8242);});delete _0x173a50[_0x665d('0x8')][_0x239b4d];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x40d8bb,_0x239b4d,_0x4ac23f);}});}})['catch'](function(_0x47e41c){logger['error'](_0x665d('0x36'),_0x40d8bb,_0x173a50['voiceQueues'][_0x4ac23f]['acwTimeout'],_0x239b4d,_0x4ac23f);})['finally'](function(){delete _0x173a50['channels'][_0x40d8bb];});}catch(_0x14fd52){logger[_0x665d('0x34')](_0x665d('0x37'),_0x14fd52[_0x665d('0x38')]);}};Acw['prototype'][_0x665d('0x2b')]=function(_0x26aabe){try{var _0x1cba38=this;if(_0x1cba38[_0x665d('0x8')][_0x26aabe]){_0x1cba38['timers'][_0x26aabe]['timer']=![];var _0x4de144=_0x1cba38[_0x665d('0x8')][_0x26aabe][_0x665d('0x2f')];var _0x341c0e=_0x1cba38['timers'][_0x26aabe][_0x665d('0x1d')];var _0x1af334=_0x1cba38[_0x665d('0x6')][_0x341c0e][_0x665d('0x29')];logger[_0x665d('0x28')](_0x665d('0x39'),_0x4de144,_0x26aabe);RpcUser[_0x665d('0x3a')](this[_0x665d('0x7')][_0x26aabe]);RpcVoiceAgentReport[_0x665d('0x31')]({'acwtime':_0x1af334,'agentacw':!![]},_0x4de144,_0x26aabe)['then'](function(_0x3e0362){logger['info'](_0x665d('0x32'),_0x4de144,_0x1af334,_0x3e0362);})[_0x665d('0x33')](function(_0x5bed05){logger[_0x665d('0x34')](_0x665d('0x35'),_0x4de144,_0x5bed05);});}else{logger[_0x665d('0x34')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x26aabe);if(_0x1cba38[_0x665d('0x8')]){logger[_0x665d('0x28')]('[ACW][TIMERS]',JSON['stringify'](_0x1cba38[_0x665d('0x8')]));}}}catch(_0x123d22){logger[_0x665d('0x34')](_0x665d('0x3b'),_0x123d22[_0x665d('0x38')]);}};Acw[_0x665d('0x19')][_0x665d('0xa')]=function(_0x5340de){try{if(this[_0x665d('0x6')][_0x5340de[_0x665d('0x1d')]]&&(this[_0x665d('0x6')][_0x5340de[_0x665d('0x1d')]][_0x665d('0x4')]||this[_0x665d('0x6')][_0x5340de[_0x665d('0x1d')]][_0x665d('0x1f')])){if(this[_0x665d('0x7')][_0x5340de[_0x665d('0x1c')]]){this[_0x665d('0x1b')][_0x5340de['uniqueid']]={'queue':_0x5340de[_0x665d('0x1d')],'interface':_0x5340de[_0x665d('0x1c')],'destlinkedid':_0x5340de['destlinkedid']};}}}catch(_0x148621){logger[_0x665d('0x34')](_0x665d('0x3c'),_0x148621['message']);}};Acw[_0x665d('0x19')][_0x665d('0x15')]=function(_0x56b626){try{if(this[_0x665d('0x6')][_0x56b626[_0x665d('0x1d')]]&&(this[_0x665d('0x6')][_0x56b626[_0x665d('0x1d')]]['acw']||this[_0x665d('0x6')][_0x56b626[_0x665d('0x1d')]][_0x665d('0x1f')])){if(this[_0x665d('0x7')][_0x56b626[_0x665d('0x1c')]]){this['channels'][_0x56b626['uniqueid']]={'queue':_0x56b626[_0x665d('0x1d')],'interface':_0x56b626[_0x665d('0x1c')]};}}}catch(_0xb9fe47){logger[_0x665d('0x34')](_0x665d('0x3d'),_0xb9fe47[_0x665d('0x38')]);}};Acw['prototype'][_0x665d('0xc')]=function(_0x18cc54){try{if(this['channels'][_0x18cc54[_0x665d('0x2f')]]&&_[_0x665d('0x3e')](this[_0x665d('0x1b')][_0x18cc54[_0x665d('0x2f')]][_0x665d('0x3f')])){logger[_0x665d('0x28')]('[%s][HANGUP:UNIQUEID]',_0x18cc54[_0x665d('0x2f')]);this[_0x665d('0x1a')](_0x18cc54['uniqueid']);}else if(this[_0x665d('0x1b')][_0x18cc54[_0x665d('0x40')]]&&_['isUndefined'](this[_0x665d('0x1b')][_0x18cc54[_0x665d('0x40')]][_0x665d('0x3f')])){logger[_0x665d('0x28')]('[%s][HANGUP:LINKEDID]',_0x18cc54['linkedid']);this[_0x665d('0x1a')](_0x18cc54['linkedid']);}}catch(_0x233333){logger[_0x665d('0x34')](_0x665d('0x41'),_0x233333['message']);}};Acw[_0x665d('0x19')][_0x665d('0xf')]=function(_0x4e2781){try{if(this[_0x665d('0x1b')][_0x4e2781['uniqueid']]&&this[_0x665d('0x1b')][_0x4e2781[_0x665d('0x2f')]]['attended']){logger['info'](_0x665d('0x42'),_0x4e2781['uniqueid']);this['startAcw'](_0x4e2781['uniqueid']);}else if(this[_0x665d('0x1b')][_0x4e2781[_0x665d('0x40')]]&&this[_0x665d('0x1b')][_0x4e2781[_0x665d('0x40')]][_0x665d('0x3f')]){logger['info'](_0x665d('0x43'),_0x4e2781[_0x665d('0x40')]);this[_0x665d('0x1a')](_0x4e2781[_0x665d('0x40')]);}}catch(_0xfcb771){logger['error']('[ACW][syncHangup]\x20%s',_0xfcb771[_0x665d('0x38')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x3828dc){try{if(!_[_0x665d('0x44')](this[_0x665d('0x1b')][_0x3828dc[_0x665d('0x45')]])){this[_0x665d('0x1a')](_0x3828dc['transfereeuniqueid']);if(this[_0x665d('0x1b')][_0x3828dc[_0x665d('0x46')]]){this[_0x665d('0x1b')][_0x3828dc[_0x665d('0x46')]][_0x665d('0x3f')]=!![];this['channels'][_0x3828dc['transfertargetuniqueid']]=this[_0x665d('0x1b')][_0x3828dc['secondtransfereruniqueid']];delete this[_0x665d('0x1b')][_0x3828dc[_0x665d('0x46')]];}}else if(!_[_0x665d('0x44')](this[_0x665d('0x1b')][_0x3828dc[_0x665d('0x47')]])){this[_0x665d('0x1a')](_0x3828dc[_0x665d('0x47')]);if(this['channels'][_0x3828dc[_0x665d('0x48')]]){this[_0x665d('0x1b')][_0x3828dc[_0x665d('0x48')]][_0x665d('0x3f')]=!![];this['channels'][_0x3828dc[_0x665d('0x45')]]=this[_0x665d('0x1b')][_0x3828dc[_0x665d('0x48')]];delete this['channels'][_0x3828dc[_0x665d('0x48')]];}}}catch(_0x7ff23c){logger[_0x665d('0x34')](_0x665d('0x49'),_0x7ff23c[_0x665d('0x38')]);}};Acw['prototype'][_0x665d('0x13')]=function(_0x11f43b){try{if(this[_0x665d('0x1b')][_0x11f43b[_0x665d('0x4a')]]){logger[_0x665d('0x28')](_0x665d('0x4b'),JSON[_0x665d('0x4c')](_0x11f43b['transfereruniqueid']));this[_0x665d('0x1a')](_0x11f43b[_0x665d('0x4a')]);}else if(this['channels'][_0x11f43b[_0x665d('0x4d')]]){logger[_0x665d('0x28')](_0x665d('0x4e'),JSON[_0x665d('0x4c')](_0x11f43b[_0x665d('0x4d')]));this[_0x665d('0x1a')](_0x11f43b[_0x665d('0x4d')]);}}catch(_0x2382ac){logger[_0x665d('0x34')](_0x665d('0x4f'),_0x2382ac['message']);}};Acw[_0x665d('0x19')][_0x665d('0x50')]=function(_0x2cc311){try{if(this[_0x665d('0x6')][_0x2cc311[_0x665d('0x1d')]]&&this['voiceQueues'][_0x2cc311[_0x665d('0x1d')]][_0x665d('0x51')]===_0x665d('0x52')){if(this['agents'][_0x2cc311[_0x665d('0x1c')]]){logger[_0x665d('0x28')](_0x665d('0x53'),_0x2cc311[_0x665d('0x2f')],_0x2cc311[_0x665d('0x1c')],_0x2cc311[_0x665d('0x1d')]);return RpcUser['savePause'](this[_0x665d('0x7')][_0x2cc311['interface']],_0x665d('0x54'),_0x2cc311[_0x665d('0x2f')]);}}}catch(_0x3ee109){logger[_0x665d('0x34')](_0x665d('0x55'),_0x3ee109[_0x665d('0x38')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 508c777..ac5097a 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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2032,0xd9));var _0x2203=function(_0x2ff642,_0x5cb4ec){_0x2ff642=_0x2ff642-0x0;var _0x372fab=_0x2032[_0x2ff642];return _0x372fab;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x50bf3a,_0x58831f){var _0x32c464=function(_0xf90613){while(--_0xf90613){_0x50bf3a['push'](_0x50bf3a['shift']());}};_0x32c464(++_0x58831f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 116eaad..4f83c51 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 _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x1c093d,_0x238a4f){var _0xcfc578=function(_0x2e8d3a){while(--_0x2e8d3a){_0x1c093d['push'](_0x1c093d['shift']());}};_0xcfc578(++_0x238a4f);}(_0xaa88,0x137));var _0x8aa8=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0xaa88[_0x1558ab];return _0x53b64a;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x34b2ad,_0x2f5a5e){var _0x4854f1=function(_0x4dce6c){while(--_0x4dce6c){_0x34b2ad['push'](_0x34b2ad['shift']());}};_0x4854f1(++_0x2f5a5e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x34df07,_0x4a50f8){_0x34df07=_0x34df07-0x0;var _0x4563bb=_0x9ffd[_0x34df07];return _0x4563bb;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 5845359..1194541 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d5d=['lodash','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','name','dialCutDigit','substring','getQueue','exports','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5d5d,0x1ee));var _0xd5d5=function(_0x36b614,_0x20f6d1){_0x36b614=_0x36b614-0x0;var _0x1bc30a=_0x5d5d[_0x36b614];return _0x1bc30a;};'use strict';var util=require(_0xd5d5('0x0'));var _=require(_0xd5d5('0x1'));var moment=require('moment');function checkNameSurname(_0x4a4013,_0x1f9950,_0x4d90ee){var _0x2db351='';if(!_[_0xd5d5('0x2')](_0x1f9950)&&'string'===typeof _0x1f9950){_0x2db351+=_0x1f9950;}if(!_[_0xd5d5('0x2')](_0x4d90ee)&&_0xd5d5('0x3')===typeof _0x4d90ee){_0x2db351+='\x20'+_0x4d90ee;}if(_0x2db351!==''){return _0x2db351;}return _0x4a4013;}function Action(_0x25a272,_0xbb048b,_0x502540){this[_0xd5d5('0x4')]=_0x25a272;this[_0xd5d5('0x5')]=_0x502540||undefined;this['name']=checkNameSurname(_0xbb048b[_0xd5d5('0x6')][_0xd5d5('0x7')],_0xbb048b[_0xd5d5('0x6')][_0xd5d5('0x8')],_0xbb048b[_0xd5d5('0x6')][_0xd5d5('0x9')]);this[_0xd5d5('0xa')]=_0xbb048b[_0xd5d5('0x7')];this[_0xd5d5('0xb')]=_0x25a272['name'];this['active']=_0xbb048b[_0xd5d5('0xc')]||![];this[_0xd5d5('0xd')]=_0x25a272[_0xd5d5('0xd')];this['dialQueueTimeout']=_0x25a272[_0xd5d5('0xe')]||0x3;this['scheduledat']=_0xbb048b[_0xd5d5('0xf')];this[_0xd5d5('0x10')]=_0xbb048b[_0xd5d5('0x10')];this[_0xd5d5('0x11')]=_0xbb048b[_0xd5d5('0x11')];this[_0xd5d5('0x12')]=_0xbb048b[_0xd5d5('0x12')];this[_0xd5d5('0x13')]=_0xbb048b[_0xd5d5('0x13')];this[_0xd5d5('0x14')]=_0xbb048b['countdropretry'];this['countabandonedretry']=_0xbb048b['countabandonedretry'];this['countmachineretry']=_0xbb048b[_0xd5d5('0x15')];this[_0xd5d5('0x16')]=_0xbb048b[_0xd5d5('0x16')];this[_0xd5d5('0x17')]=_0xbb048b[_0xd5d5('0x17')];this[_0xd5d5('0x18')]=_0xbb048b['ListId'];this['UserId']=_0xbb048b[_0xd5d5('0x19')];this[_0xd5d5('0x1a')]=_0xbb048b[_0xd5d5('0x1a')];this[_0xd5d5('0x1b')]=_0xbb048b['CampaignId'];this[_0xd5d5('0x1c')]=_0xbb048b['id'];this[_0xd5d5('0x1d')]=_0xbb048b[_0xd5d5('0x6')]['firstName']||'';this[_0xd5d5('0x1e')]=moment()[_0xd5d5('0x1f')](_0xd5d5('0x20'));this[_0xd5d5('0x21')]=_0xbb048b['callback'];this['callbackuniqueid']=_0xbb048b[_0xd5d5('0x22')];this[_0xd5d5('0x23')]=_0xbb048b[_0xd5d5('0x23')];this[_0xd5d5('0x24')]=_0xbb048b[_0xd5d5('0x24')];this[_0xd5d5('0x25')]='';this[_0xd5d5('0x26')]='';}Action['prototype'][_0xd5d5('0x27')]=function(){return util[_0xd5d5('0x1f')]('\x22%s\x22\x20<%s>',this[_0xd5d5('0x28')],this['voiceQueue'][_0xd5d5('0x29')]>0x0?this[_0xd5d5('0xa')][_0xd5d5('0x2a')](this[_0xd5d5('0x4')][_0xd5d5('0x29')]):this[_0xd5d5('0xa')]);};Action['prototype'][_0xd5d5('0x2b')]=function(){return this[_0xd5d5('0xb')];};module[_0xd5d5('0x2c')]=Action; \ No newline at end of file +var _0x7ce6=['string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','exports','isNil'];(function(_0x5eb656,_0x4059bc){var _0x4bd9a4=function(_0x2308c2){while(--_0x2308c2){_0x5eb656['push'](_0x5eb656['shift']());}};_0x4bd9a4(++_0x4059bc);}(_0x7ce6,0x1d8));var _0x67ce=function(_0xd822a2,_0x204c02){_0xd822a2=_0xd822a2-0x0;var _0x107659=_0x7ce6[_0xd822a2];return _0x107659;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x437c49,_0x187665,_0x354719){var _0x398e03='';if(!_[_0x67ce('0x0')](_0x187665)&&_0x67ce('0x1')===typeof _0x187665){_0x398e03+=_0x187665;}if(!_[_0x67ce('0x0')](_0x354719)&&_0x67ce('0x1')===typeof _0x354719){_0x398e03+='\x20'+_0x354719;}if(_0x398e03!==''){return _0x398e03;}return _0x437c49;}function Action(_0xb1ab80,_0x134361,_0x158934){this[_0x67ce('0x2')]=_0xb1ab80;this[_0x67ce('0x3')]=_0x158934||undefined;this[_0x67ce('0x4')]=checkNameSurname(_0x134361[_0x67ce('0x5')]['phone'],_0x134361[_0x67ce('0x5')][_0x67ce('0x6')],_0x134361[_0x67ce('0x5')][_0x67ce('0x7')]);this[_0x67ce('0x8')]=_0x134361[_0x67ce('0x9')];this[_0x67ce('0xa')]=_0xb1ab80[_0x67ce('0x4')];this['active']=_0x134361[_0x67ce('0xb')]||![];this[_0x67ce('0xc')]=_0xb1ab80[_0x67ce('0xc')];this[_0x67ce('0xd')]=_0xb1ab80[_0x67ce('0xd')]||0x3;this[_0x67ce('0xe')]=_0x134361[_0x67ce('0xe')];this[_0x67ce('0xf')]=_0x134361[_0x67ce('0xf')];this[_0x67ce('0x10')]=_0x134361['countcongestionretry'];this[_0x67ce('0x11')]=_0x134361['countnoanswerretry'];this[_0x67ce('0x12')]=_0x134361['countnosuchnumberretry'];this['countdropretry']=_0x134361['countdropretry'];this[_0x67ce('0x13')]=_0x134361['countabandonedretry'];this[_0x67ce('0x14')]=_0x134361[_0x67ce('0x14')];this[_0x67ce('0x15')]=_0x134361[_0x67ce('0x15')];this[_0x67ce('0x16')]=_0x134361[_0x67ce('0x16')];this[_0x67ce('0x17')]=_0x134361[_0x67ce('0x17')];this[_0x67ce('0x18')]=_0x134361[_0x67ce('0x18')];this[_0x67ce('0x19')]=_0x134361[_0x67ce('0x19')];this['CampaignId']=_0x134361['CampaignId'];this[_0x67ce('0x1a')]=_0x134361['id'];this[_0x67ce('0x1b')]=_0x134361['Contact'][_0x67ce('0x6')]||'';this[_0x67ce('0x1c')]=moment()[_0x67ce('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x67ce('0x1e')]=_0x134361[_0x67ce('0x1e')];this[_0x67ce('0x1f')]=_0x134361[_0x67ce('0x1f')];this[_0x67ce('0x20')]=_0x134361['callbackat'];this[_0x67ce('0x21')]=_0x134361[_0x67ce('0x21')];this[_0x67ce('0x22')]='';this[_0x67ce('0x23')]='';}Action['prototype'][_0x67ce('0x24')]=function(){return util[_0x67ce('0x1d')](_0x67ce('0x25'),this[_0x67ce('0x4')],this[_0x67ce('0x2')][_0x67ce('0x26')]>0x0?this[_0x67ce('0x8')][_0x67ce('0x27')](this[_0x67ce('0x2')][_0x67ce('0x26')]):this[_0x67ce('0x8')]);};Action[_0x67ce('0x28')][_0x67ce('0x29')]=function(){return this['queue'];};module[_0x67ce('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js index f8a1aea..4704ce0 100644 --- a/server/services/ami/dialer/additionalPhone.js +++ b/server/services/ami/dialer/additionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4c9=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','name','number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xd4c9,0x1c2));var _0x9d4c=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0xd4c9[_0x3f59b1];return _0x11d2e8;};'use strict';var util=require(_0x9d4c('0x0'));var _=require('lodash');var moment=require(_0x9d4c('0x1'));function getSeconds(_0x4f4617,_0x47a664){var _0x449933=moment(_0x4f4617)[_0x9d4c('0x2')](0x0);var _0x23044e=moment(_0x47a664)['milliseconds'](0x0);return _0x449933['diff'](_0x23044e,_0x9d4c('0x3'));}function AdditionalPhone(_0x154251){this[_0x9d4c('0x4')]=_0x154251[_0x9d4c('0x4')];this[_0x9d4c('0x5')]=_0x154251['scheduledat']||undefined;this['type']=_0x154251[_0x9d4c('0x6')];this['campaigntype']=_0x154251[_0x9d4c('0x6')]==='outbound'?_0x9d4c('0x7'):_0x154251[_0x9d4c('0x6')];this['countbusyretry']=_0x154251[_0x9d4c('0x8')];this['countcongestionretry']=_0x154251['countcongestionretry'];this['countnoanswerretry']=_0x154251['countnoanswerretry'];this['countglobal']=_0x154251[_0x9d4c('0x8')]+_0x154251[_0x9d4c('0x9')]+_0x154251[_0x9d4c('0xa')]+_0x154251[_0x9d4c('0xb')]+_0x154251[_0x9d4c('0xc')]+_0x154251['countabandonedretry']+_0x154251[_0x9d4c('0xd')]+_0x154251['countagentrejectretry'];this[_0x9d4c('0xb')]=_0x154251[_0x9d4c('0xb')];this[_0x9d4c('0xc')]=_0x154251[_0x9d4c('0xc')];this[_0x9d4c('0xe')]=_0x154251[_0x9d4c('0xe')];this[_0x9d4c('0xd')]=_0x154251[_0x9d4c('0xd')];this['countagentrejectretry']=_0x154251[_0x9d4c('0xf')];this[_0x9d4c('0x7')]=_0x154251[_0x9d4c('0x7')];this[_0x9d4c('0x10')]=_0x154251[_0x9d4c('0x11')];this['calleridnum']=_0x154251[_0x9d4c('0x12')];this[_0x9d4c('0x13')]=_0x154251[_0x9d4c('0x13')];this['responsetime']=_0x154251['responsetime'];this[_0x9d4c('0x14')]=_0x154251[_0x9d4c('0x15')];this[_0x9d4c('0x16')]=getSeconds(_0x154251[_0x9d4c('0x15')],_0x154251['starttime']);this[_0x9d4c('0x17')]=0x0;this[_0x9d4c('0x18')]=0x0;this['callback']=_0x154251[_0x9d4c('0x19')];this[_0x9d4c('0x1a')]=_0x154251[_0x9d4c('0x1a')];this[_0x9d4c('0x1b')]=_0x154251['callbackat'];this['recallme']=_0x154251[_0x9d4c('0x1c')];this[_0x9d4c('0x1d')]=_0x154251[_0x9d4c('0x1d')];this[_0x9d4c('0x1e')]=_0x154251[_0x9d4c('0x1e')];this[_0x9d4c('0x1f')]=_0x154251[_0x9d4c('0x1f')];this[_0x9d4c('0x20')]=_0x154251['VoiceQueueId'];this[_0x9d4c('0x21')]=_0x154251['CampaignId'];this[_0x9d4c('0x22')]=_0x154251[_0x9d4c('0x22')]||'';this[_0x9d4c('0x23')]=_0x154251[_0x9d4c('0x23')]||'';}module[_0x9d4c('0x24')]=History; \ No newline at end of file +var _0x1477=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff'];(function(_0x1d61e7,_0x16f71d){var _0x4aae76=function(_0x1d0617){while(--_0x1d0617){_0x1d61e7['push'](_0x1d61e7['shift']());}};_0x4aae76(++_0x16f71d);}(_0x1477,0x70));var _0x7147=function(_0x276162,_0x2ca800){_0x276162=_0x276162-0x0;var _0x483220=_0x1477[_0x276162];return _0x483220;};'use strict';var util=require(_0x7147('0x0'));var _=require(_0x7147('0x1'));var moment=require(_0x7147('0x2'));function getSeconds(_0x39e60b,_0x2f1964){var _0x4875cd=moment(_0x39e60b)[_0x7147('0x3')](0x0);var _0x17b074=moment(_0x2f1964)[_0x7147('0x3')](0x0);return _0x4875cd[_0x7147('0x4')](_0x17b074,_0x7147('0x5'));}function AdditionalPhone(_0x46adc3){this[_0x7147('0x6')]=_0x46adc3[_0x7147('0x6')];this[_0x7147('0x7')]=_0x46adc3[_0x7147('0x7')]||undefined;this['type']=_0x46adc3[_0x7147('0x8')];this[_0x7147('0x9')]=_0x46adc3[_0x7147('0x8')]===_0x7147('0xa')?'queue':_0x46adc3['type'];this[_0x7147('0xb')]=_0x46adc3[_0x7147('0xb')];this['countcongestionretry']=_0x46adc3['countcongestionretry'];this[_0x7147('0xc')]=_0x46adc3[_0x7147('0xc')];this[_0x7147('0xd')]=_0x46adc3[_0x7147('0xb')]+_0x46adc3[_0x7147('0xe')]+_0x46adc3[_0x7147('0xc')]+_0x46adc3[_0x7147('0xf')]+_0x46adc3[_0x7147('0x10')]+_0x46adc3['countabandonedretry']+_0x46adc3[_0x7147('0x11')]+_0x46adc3[_0x7147('0x12')];this[_0x7147('0xf')]=_0x46adc3[_0x7147('0xf')];this[_0x7147('0x10')]=_0x46adc3[_0x7147('0x10')];this[_0x7147('0x13')]=_0x46adc3['countabandonedretry'];this['countmachineretry']=_0x46adc3['countmachineretry'];this['countagentrejectretry']=_0x46adc3[_0x7147('0x12')];this[_0x7147('0x14')]=_0x46adc3[_0x7147('0x14')];this[_0x7147('0x15')]=_0x46adc3[_0x7147('0x16')];this[_0x7147('0x17')]=_0x46adc3[_0x7147('0x18')];this[_0x7147('0x19')]=_0x46adc3['starttime'];this['responsetime']=_0x46adc3[_0x7147('0x1a')];this[_0x7147('0x1b')]=_0x46adc3[_0x7147('0x1a')];this[_0x7147('0x1c')]=getSeconds(_0x46adc3[_0x7147('0x1a')],_0x46adc3['starttime']);this[_0x7147('0x1d')]=0x0;this['talktime']=0x0;this[_0x7147('0x1e')]=_0x46adc3[_0x7147('0x1e')];this[_0x7147('0x1f')]=_0x46adc3['callbackuniqueid'];this['callbackat']=_0x46adc3['callbackat'];this[_0x7147('0x20')]=_0x46adc3[_0x7147('0x20')];this[_0x7147('0x21')]=_0x46adc3[_0x7147('0x21')];this['ListId']=_0x46adc3['ListId'];this[_0x7147('0x22')]=_0x46adc3[_0x7147('0x22')];this['VoiceQueueId']=_0x46adc3[_0x7147('0x23')];this[_0x7147('0x24')]=_0x46adc3[_0x7147('0x24')];this[_0x7147('0x25')]=_0x46adc3[_0x7147('0x25')]||'';this[_0x7147('0x26')]=_0x46adc3[_0x7147('0x26')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 967e0d6..4d9dd1d 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf23=['number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','campaigntype','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum'];(function(_0x122d6a,_0xa30d94){var _0x3fb224=function(_0x42d3d6){while(--_0x42d3d6){_0x122d6a['push'](_0x122d6a['shift']());}};_0x3fb224(++_0xa30d94);}(_0xbf23,0x76));var _0x3bf2=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0xbf23[_0x16db8b];return _0x5ba017;};'use strict';var util=require(_0x3bf2('0x0'));var _=require(_0x3bf2('0x1'));var moment=require(_0x3bf2('0x2'));function getSeconds(_0x4da265,_0xbbbfca){var _0x318927=moment(_0x4da265)[_0x3bf2('0x3')](0x0);var _0x26248c=moment(_0xbbbfca)['milliseconds'](0x0);return _0x318927[_0x3bf2('0x4')](_0x26248c,_0x3bf2('0x5'));}function AgentComplete(_0x3979b1,_0x504b31){this['state']=0x4;this['statedesc']=_0x3bf2('0x6');this[_0x3bf2('0x7')]=_0x3979b1['scheduledat'];this['type']=_0x3979b1['type'];this[_0x3bf2('0x8')]=_0x3979b1[_0x3bf2('0x9')]==='outbound'?_0x3bf2('0xa'):_0x3979b1[_0x3bf2('0x9')];this[_0x3bf2('0xb')]=_0x3979b1[_0x3bf2('0xb')];this[_0x3bf2('0xc')]=_0x3979b1[_0x3bf2('0xc')];this[_0x3bf2('0xd')]=_0x3979b1[_0x3bf2('0xd')];this[_0x3bf2('0xe')]=_0x3979b1[_0x3bf2('0xb')]+_0x3979b1[_0x3bf2('0xc')]+_0x3979b1[_0x3bf2('0xd')]+_0x3979b1[_0x3bf2('0xf')]+_0x3979b1['countdropretry']+_0x3979b1['countabandonedretry']+_0x3979b1['countmachineretry']+_0x3979b1['countagentrejectretry'];this[_0x3bf2('0xf')]=_0x3979b1['countnosuchnumberretry'];this[_0x3bf2('0x10')]=_0x3979b1[_0x3bf2('0x10')];this[_0x3bf2('0x11')]=_0x3979b1[_0x3bf2('0x11')];this[_0x3bf2('0x12')]=_0x3979b1['countmachineretry'];this[_0x3bf2('0x13')]=_0x3979b1[_0x3bf2('0x13')];this['uniqueid']=_0x504b31[_0x3bf2('0x14')];this[_0x3bf2('0x15')]=_0x3979b1['name'];this[_0x3bf2('0x16')]=_0x3979b1[_0x3bf2('0x17')];this[_0x3bf2('0x18')]=_0x3979b1['starttime'];this['responsetime']=_0x3979b1[_0x3bf2('0x19')];this[_0x3bf2('0x1a')]=_0x3979b1['answertime'];this[_0x3bf2('0x1b')]=moment()[_0x3bf2('0x1c')](_0x3bf2('0x1d'));this[_0x3bf2('0x1e')]=getSeconds(_0x3979b1['responsetime'],_0x3979b1['starttime']);this[_0x3bf2('0x1f')]=getSeconds(_0x3979b1[_0x3bf2('0x1a')],_0x3979b1[_0x3bf2('0x19')]);this[_0x3bf2('0x20')]=getSeconds(this[_0x3bf2('0x1b')],_0x3979b1['answertime']);this['queue']=_0x504b31['queue'];this[_0x3bf2('0x21')]=_0x504b31['membername'];this['reason']=_0x504b31[_0x3bf2('0x22')];this[_0x3bf2('0x23')]=_0x3979b1[_0x3bf2('0x23')];this['callbackuniqueid']=_0x3979b1[_0x3bf2('0x24')];this[_0x3bf2('0x25')]=_0x3979b1[_0x3bf2('0x25')];this['recallme']=_0x3979b1[_0x3bf2('0x26')];this[_0x3bf2('0x27')]=_0x3979b1['ContactId'];this[_0x3bf2('0x28')]=_0x3979b1[_0x3bf2('0x28')];this[_0x3bf2('0x29')]=_0x3979b1[_0x3bf2('0x29')];this[_0x3bf2('0x2a')]=_0x3979b1[_0x3bf2('0x2a')];this[_0x3bf2('0x2b')]=_0x3979b1['CampaignId'];this[_0x3bf2('0x2c')]=_0x3979b1[_0x3bf2('0x2c')]||'';this[_0x3bf2('0x2d')]=_0x3979b1[_0x3bf2('0x2d')]||'';}module[_0x3bf2('0x2e')]=AgentComplete; \ No newline at end of file +var _0xf1bd=['countagentrejectretry','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','reason','callback','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry'];(function(_0x14afdb,_0x4afb4e){var _0x15b787=function(_0x4a489a){while(--_0x4a489a){_0x14afdb['push'](_0x14afdb['shift']());}};_0x15b787(++_0x4afb4e);}(_0xf1bd,0x19a));var _0xdf1b=function(_0x2dafea,_0x58a592){_0x2dafea=_0x2dafea-0x0;var _0x457127=_0xf1bd[_0x2dafea];return _0x457127;};'use strict';var util=require(_0xdf1b('0x0'));var _=require(_0xdf1b('0x1'));var moment=require(_0xdf1b('0x2'));function getSeconds(_0x4c6f8f,_0x2d71c7){var _0xf37e52=moment(_0x4c6f8f)[_0xdf1b('0x3')](0x0);var _0x46de3d=moment(_0x2d71c7)[_0xdf1b('0x3')](0x0);return _0xf37e52[_0xdf1b('0x4')](_0x46de3d,_0xdf1b('0x5'));}function AgentComplete(_0x589be3,_0x5de614){this[_0xdf1b('0x6')]=0x4;this[_0xdf1b('0x7')]=_0xdf1b('0x8');this[_0xdf1b('0x9')]=_0x589be3[_0xdf1b('0x9')];this['type']=_0x589be3[_0xdf1b('0xa')];this[_0xdf1b('0xb')]=_0x589be3['type']==='outbound'?_0xdf1b('0xc'):_0x589be3[_0xdf1b('0xa')];this[_0xdf1b('0xd')]=_0x589be3[_0xdf1b('0xd')];this[_0xdf1b('0xe')]=_0x589be3['countcongestionretry'];this[_0xdf1b('0xf')]=_0x589be3['countnoanswerretry'];this['countglobal']=_0x589be3[_0xdf1b('0xd')]+_0x589be3[_0xdf1b('0xe')]+_0x589be3[_0xdf1b('0xf')]+_0x589be3['countnosuchnumberretry']+_0x589be3[_0xdf1b('0x10')]+_0x589be3[_0xdf1b('0x11')]+_0x589be3[_0xdf1b('0x12')]+_0x589be3['countagentrejectretry'];this[_0xdf1b('0x13')]=_0x589be3[_0xdf1b('0x13')];this[_0xdf1b('0x10')]=_0x589be3[_0xdf1b('0x10')];this[_0xdf1b('0x11')]=_0x589be3['countabandonedretry'];this[_0xdf1b('0x12')]=_0x589be3['countmachineretry'];this[_0xdf1b('0x14')]=_0x589be3[_0xdf1b('0x14')];this['uniqueid']=_0x5de614['uniqueid'];this[_0xdf1b('0x15')]=_0x589be3[_0xdf1b('0x16')];this['calleridnum']=_0x589be3[_0xdf1b('0x17')];this['starttime']=_0x589be3[_0xdf1b('0x18')];this[_0xdf1b('0x19')]=_0x589be3[_0xdf1b('0x19')];this[_0xdf1b('0x1a')]=_0x589be3['answertime'];this[_0xdf1b('0x1b')]=moment()[_0xdf1b('0x1c')](_0xdf1b('0x1d'));this[_0xdf1b('0x1e')]=getSeconds(_0x589be3[_0xdf1b('0x19')],_0x589be3[_0xdf1b('0x18')]);this[_0xdf1b('0x1f')]=getSeconds(_0x589be3[_0xdf1b('0x1a')],_0x589be3[_0xdf1b('0x19')]);this[_0xdf1b('0x20')]=getSeconds(this[_0xdf1b('0x1b')],_0x589be3[_0xdf1b('0x1a')]);this[_0xdf1b('0xc')]=_0x5de614['queue'];this['membername']=_0x5de614['membername'];this[_0xdf1b('0x21')]=_0x5de614['reason'];this['callback']=_0x589be3[_0xdf1b('0x22')];this['callbackuniqueid']=_0x589be3['callbackuniqueid'];this['callbackat']=_0x589be3[_0xdf1b('0x23')];this[_0xdf1b('0x24')]=_0x589be3[_0xdf1b('0x24')];this[_0xdf1b('0x25')]=_0x589be3[_0xdf1b('0x25')];this[_0xdf1b('0x26')]=_0x589be3['ListId'];this[_0xdf1b('0x27')]=_0x589be3['UserId'];this['VoiceQueueId']=_0x589be3['VoiceQueueId'];this[_0xdf1b('0x28')]=_0x589be3['CampaignId'];this[_0xdf1b('0x29')]=_0x589be3[_0xdf1b('0x29')]||'';this[_0xdf1b('0x2a')]=_0x589be3[_0xdf1b('0x2a')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 64b31f0..dfe955e 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3baf=['countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x5adff5,_0x1db0a3){var _0x12a6ce=function(_0x1f4464){while(--_0x1f4464){_0x5adff5['push'](_0x5adff5['shift']());}};_0x12a6ce(++_0x1db0a3);}(_0x3baf,0xf7));var _0xf3ba=function(_0x855b1c,_0x131bc8){_0x855b1c=_0x855b1c-0x0;var _0x5b4c9e=_0x3baf[_0x855b1c];return _0x5b4c9e;};'use strict';var util=require(_0xf3ba('0x0'));var _=require(_0xf3ba('0x1'));var moment=require(_0xf3ba('0x2'));function getSeconds(_0x3979b3,_0x29bbc2){var _0x22f9c0=moment(_0x3979b3)[_0xf3ba('0x3')](0x0);var _0x306bdd=moment(_0x29bbc2)[_0xf3ba('0x3')](0x0);return _0x22f9c0[_0xf3ba('0x4')](_0x306bdd,_0xf3ba('0x5'));}function Final(_0x1c7a62){this[_0xf3ba('0x6')]=_0x1c7a62[_0xf3ba('0x6')];this[_0xf3ba('0x7')]=_0x1c7a62['scheduledat'];this['type']=_0x1c7a62['type'];this[_0xf3ba('0x8')]=_0x1c7a62['type']===_0xf3ba('0x9')?_0xf3ba('0xa'):_0x1c7a62[_0xf3ba('0xb')];this[_0xf3ba('0xc')]=_0x1c7a62[_0xf3ba('0xc')];this[_0xf3ba('0xd')]=_0x1c7a62[_0xf3ba('0xd')];this[_0xf3ba('0xe')]=_0x1c7a62[_0xf3ba('0xe')];this[_0xf3ba('0xf')]=_0x1c7a62[_0xf3ba('0xc')]+_0x1c7a62[_0xf3ba('0xd')]+_0x1c7a62[_0xf3ba('0xe')]+_0x1c7a62[_0xf3ba('0x10')]+_0x1c7a62[_0xf3ba('0x11')]+_0x1c7a62[_0xf3ba('0x12')]+_0x1c7a62[_0xf3ba('0x13')]+_0x1c7a62[_0xf3ba('0x14')];this['countnosuchnumberretry']=_0x1c7a62[_0xf3ba('0x10')];this['countdropretry']=_0x1c7a62[_0xf3ba('0x11')];this[_0xf3ba('0x12')]=_0x1c7a62[_0xf3ba('0x12')];this[_0xf3ba('0x13')]=_0x1c7a62[_0xf3ba('0x13')];this['countagentrejectretry']=_0x1c7a62[_0xf3ba('0x14')];this[_0xf3ba('0xa')]=_0x1c7a62[_0xf3ba('0xa')];this['calleridname']=_0x1c7a62[_0xf3ba('0x15')];this[_0xf3ba('0x16')]=_0x1c7a62[_0xf3ba('0x16')];this[_0xf3ba('0x17')]=_0x1c7a62['starttime'];this[_0xf3ba('0x18')]=_0x1c7a62[_0xf3ba('0x18')];this['endtime']=_0x1c7a62['responsetime'];this[_0xf3ba('0x19')]=_0x1c7a62[_0xf3ba('0x19')]||0x0;this[_0xf3ba('0x1a')]=_0x1c7a62['holdtime']||0x0;this[_0xf3ba('0x1b')]=_0x1c7a62[_0xf3ba('0x1b')]||0x0;this[_0xf3ba('0x1c')]=_0x1c7a62[_0xf3ba('0x1c')];this[_0xf3ba('0x1d')]=_0x1c7a62[_0xf3ba('0x1d')];this[_0xf3ba('0x1e')]=_0x1c7a62['callbackat'];this['recallme']=_0x1c7a62['recallme'];this[_0xf3ba('0x1f')]=_0x1c7a62[_0xf3ba('0x1f')];this[_0xf3ba('0x20')]=_0x1c7a62[_0xf3ba('0x20')];this[_0xf3ba('0x21')]=_0x1c7a62['UserId'];this['VoiceQueueId']=_0x1c7a62[_0xf3ba('0x22')];this[_0xf3ba('0x23')]=_0x1c7a62['CampaignId'];this[_0xf3ba('0x24')]=_0x1c7a62[_0xf3ba('0x24')]||'';this['originatecalleridname']=_0x1c7a62['originatecalleridname']||'';}module[_0xf3ba('0x25')]=Final; \ No newline at end of file +var _0x938d=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd938('0x0'));var _=require(_0xd938('0x1'));var moment=require('moment');function getSeconds(_0x3c6634,_0x29cf5f){var _0x221132=moment(_0x3c6634)['milliseconds'](0x0);var _0x5f0056=moment(_0x29cf5f)[_0xd938('0x2')](0x0);return _0x221132[_0xd938('0x3')](_0x5f0056,_0xd938('0x4'));}function Final(_0x572f8a){this[_0xd938('0x5')]=_0x572f8a[_0xd938('0x5')];this[_0xd938('0x6')]=_0x572f8a[_0xd938('0x6')];this[_0xd938('0x7')]=_0x572f8a[_0xd938('0x7')];this['campaigntype']=_0x572f8a[_0xd938('0x7')]===_0xd938('0x8')?_0xd938('0x9'):_0x572f8a[_0xd938('0x7')];this[_0xd938('0xa')]=_0x572f8a[_0xd938('0xa')];this['countcongestionretry']=_0x572f8a[_0xd938('0xb')];this[_0xd938('0xc')]=_0x572f8a[_0xd938('0xc')];this[_0xd938('0xd')]=_0x572f8a[_0xd938('0xa')]+_0x572f8a[_0xd938('0xb')]+_0x572f8a[_0xd938('0xc')]+_0x572f8a[_0xd938('0xe')]+_0x572f8a[_0xd938('0xf')]+_0x572f8a[_0xd938('0x10')]+_0x572f8a[_0xd938('0x11')]+_0x572f8a[_0xd938('0x12')];this[_0xd938('0xe')]=_0x572f8a['countnosuchnumberretry'];this['countdropretry']=_0x572f8a['countdropretry'];this[_0xd938('0x10')]=_0x572f8a[_0xd938('0x10')];this[_0xd938('0x11')]=_0x572f8a['countmachineretry'];this['countagentrejectretry']=_0x572f8a[_0xd938('0x12')];this[_0xd938('0x9')]=_0x572f8a['queue'];this['calleridname']=_0x572f8a['calleridname'];this[_0xd938('0x13')]=_0x572f8a[_0xd938('0x13')];this[_0xd938('0x14')]=_0x572f8a['starttime'];this[_0xd938('0x15')]=_0x572f8a[_0xd938('0x15')];this[_0xd938('0x16')]=_0x572f8a[_0xd938('0x15')];this[_0xd938('0x17')]=_0x572f8a['ringtime']||0x0;this[_0xd938('0x18')]=_0x572f8a['holdtime']||0x0;this['talktime']=_0x572f8a[_0xd938('0x19')]||0x0;this['callback']=_0x572f8a[_0xd938('0x1a')];this[_0xd938('0x1b')]=_0x572f8a[_0xd938('0x1b')];this[_0xd938('0x1c')]=_0x572f8a[_0xd938('0x1c')];this['recallme']=_0x572f8a[_0xd938('0x1d')];this[_0xd938('0x1e')]=_0x572f8a[_0xd938('0x1e')];this[_0xd938('0x1f')]=_0x572f8a[_0xd938('0x1f')];this[_0xd938('0x20')]=_0x572f8a[_0xd938('0x20')];this[_0xd938('0x21')]=_0x572f8a[_0xd938('0x21')];this[_0xd938('0x22')]=_0x572f8a[_0xd938('0x22')];this['originatecalleridnum']=_0x572f8a['originatecalleridnum']||'';this[_0xd938('0x23')]=_0x572f8a[_0xd938('0x23')]||'';}module[_0xd938('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 25179fe..4e71036 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11fd=['diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment'];(function(_0x589eb4,_0xaa2019){var _0xf50816=function(_0x572fc5){while(--_0x572fc5){_0x589eb4['push'](_0x589eb4['shift']());}};_0xf50816(++_0xaa2019);}(_0x11fd,0xb1));var _0xd11f=function(_0x33f4d8,_0x576dad){_0x33f4d8=_0x33f4d8-0x0;var _0xebee56=_0x11fd[_0x33f4d8];return _0xebee56;};'use strict';var util=require(_0xd11f('0x0'));var _=require(_0xd11f('0x1'));var moment=require(_0xd11f('0x2'));function getSeconds(_0x5316a3,_0x44b098){var _0x564ed6=moment(_0x5316a3)['milliseconds'](0x0);var _0x8f5400=moment(_0x44b098)['milliseconds'](0x0);return _0x564ed6[_0xd11f('0x3')](_0x8f5400,_0xd11f('0x4'));}function Hangup(_0x25d018,_0x170b18){this[_0xd11f('0x5')]=0x4;this[_0xd11f('0x6')]=_0xd11f('0x7');this[_0xd11f('0x8')]=_0x25d018[_0xd11f('0x8')];this[_0xd11f('0x9')]=_0x25d018[_0xd11f('0x9')];this[_0xd11f('0xa')]=_0x25d018['type']===_0xd11f('0xb')?_0xd11f('0xc'):_0x25d018['type'];this['countbusyretry']=_0x25d018['countbusyretry'];this[_0xd11f('0xd')]=_0x25d018[_0xd11f('0xd')];this[_0xd11f('0xe')]=_0x25d018['countnoanswerretry'];this['countglobal']=_0x25d018[_0xd11f('0xf')]+_0x25d018[_0xd11f('0xd')]+_0x25d018[_0xd11f('0xe')]+_0x25d018[_0xd11f('0x10')]+_0x25d018[_0xd11f('0x11')]+_0x25d018[_0xd11f('0x12')]+_0x25d018[_0xd11f('0x13')]+_0x25d018['countagentrejectretry'];this[_0xd11f('0x10')]=_0x25d018['countnosuchnumberretry'];this[_0xd11f('0x11')]=_0x25d018['countdropretry'];this[_0xd11f('0x12')]=_0x25d018[_0xd11f('0x12')];this['countmachineretry']=_0x25d018[_0xd11f('0x13')];this[_0xd11f('0x14')]=_0x25d018[_0xd11f('0x14')];this['uniqueid']=_0x170b18[_0xd11f('0x15')];this[_0xd11f('0x16')]=_0x25d018[_0xd11f('0x17')];this[_0xd11f('0x18')]=_0x25d018[_0xd11f('0x19')];this[_0xd11f('0x1a')]=_0x25d018[_0xd11f('0x1a')];this[_0xd11f('0x1b')]=_0x25d018[_0xd11f('0x1b')];this['endtime']=moment()['format'](_0xd11f('0x1c'));this[_0xd11f('0x1d')]=getSeconds(_0x25d018[_0xd11f('0x1b')],_0x25d018['starttime']);this[_0xd11f('0x1e')]=0x0;this[_0xd11f('0x1f')]=getSeconds(this['endtime'],_0x25d018['responsetime']);this[_0xd11f('0xc')]=_0x25d018['queue'];this['membername']=_0xd11f('0x20');this[_0xd11f('0x21')]=_0x170b18[_0xd11f('0x22')];this[_0xd11f('0x23')]=_0x25d018[_0xd11f('0x23')];this[_0xd11f('0x24')]=_0x25d018['callbackuniqueid'];this[_0xd11f('0x25')]=_0x25d018[_0xd11f('0x25')];this[_0xd11f('0x26')]=_0x25d018[_0xd11f('0x26')];this[_0xd11f('0x27')]=_0x25d018[_0xd11f('0x27')];this[_0xd11f('0x28')]=_0x25d018['ListId'];this[_0xd11f('0x29')]=_0x25d018['UserId'];this[_0xd11f('0x2a')]=_0x25d018[_0xd11f('0x2a')];this[_0xd11f('0x2b')]=_0x25d018[_0xd11f('0x2b')];}module[_0xd11f('0x2c')]=Hangup; \ No newline at end of file +var _0x24a9=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','diff','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5233d4,_0x323ed8){var _0x1b7f4f=function(_0x1b41b4){while(--_0x1b41b4){_0x5233d4['push'](_0x5233d4['shift']());}};_0x1b7f4f(++_0x323ed8);}(_0x24a9,0xdd));var _0x924a=function(_0x742e2d,_0x2f2d78){_0x742e2d=_0x742e2d-0x0;var _0x588e15=_0x24a9[_0x742e2d];return _0x588e15;};'use strict';var util=require(_0x924a('0x0'));var _=require('lodash');var moment=require(_0x924a('0x1'));function getSeconds(_0xe826c1,_0x4ab443){var _0x410531=moment(_0xe826c1)['milliseconds'](0x0);var _0x18b55c=moment(_0x4ab443)['milliseconds'](0x0);return _0x410531[_0x924a('0x2')](_0x18b55c,'seconds');}function Hangup(_0x557716,_0x5c9234){this[_0x924a('0x3')]=0x4;this[_0x924a('0x4')]=_0x924a('0x5');this['scheduledat']=_0x557716[_0x924a('0x6')];this[_0x924a('0x7')]=_0x557716[_0x924a('0x7')];this['campaigntype']=_0x557716['type']===_0x924a('0x8')?_0x924a('0x9'):_0x557716[_0x924a('0x7')];this[_0x924a('0xa')]=_0x557716[_0x924a('0xa')];this[_0x924a('0xb')]=_0x557716[_0x924a('0xb')];this[_0x924a('0xc')]=_0x557716[_0x924a('0xc')];this['countglobal']=_0x557716[_0x924a('0xa')]+_0x557716['countcongestionretry']+_0x557716[_0x924a('0xc')]+_0x557716[_0x924a('0xd')]+_0x557716['countdropretry']+_0x557716['countabandonedretry']+_0x557716['countmachineretry']+_0x557716[_0x924a('0xe')];this[_0x924a('0xd')]=_0x557716[_0x924a('0xd')];this[_0x924a('0xf')]=_0x557716['countdropretry'];this[_0x924a('0x10')]=_0x557716[_0x924a('0x10')];this[_0x924a('0x11')]=_0x557716[_0x924a('0x11')];this[_0x924a('0xe')]=_0x557716['countagentrejectretry'];this[_0x924a('0x12')]=_0x5c9234[_0x924a('0x12')];this[_0x924a('0x13')]=_0x557716[_0x924a('0x14')];this[_0x924a('0x15')]=_0x557716[_0x924a('0x16')];this[_0x924a('0x17')]=_0x557716['starttime'];this[_0x924a('0x18')]=_0x557716[_0x924a('0x18')];this['endtime']=moment()[_0x924a('0x19')](_0x924a('0x1a'));this['ringtime']=getSeconds(_0x557716[_0x924a('0x18')],_0x557716['starttime']);this['holdtime']=0x0;this[_0x924a('0x1b')]=getSeconds(this[_0x924a('0x1c')],_0x557716[_0x924a('0x18')]);this[_0x924a('0x9')]=_0x557716[_0x924a('0x9')];this[_0x924a('0x1d')]=_0x924a('0x1e');this[_0x924a('0x1f')]=_0x5c9234[_0x924a('0x20')];this[_0x924a('0x21')]=_0x557716[_0x924a('0x21')];this['callbackuniqueid']=_0x557716[_0x924a('0x22')];this[_0x924a('0x23')]=_0x557716['callbackat'];this['recallme']=_0x557716[_0x924a('0x24')];this['ContactId']=_0x557716[_0x924a('0x25')];this[_0x924a('0x26')]=_0x557716[_0x924a('0x26')];this[_0x924a('0x27')]=_0x557716[_0x924a('0x27')];this['VoiceQueueId']=_0x557716[_0x924a('0x28')];this[_0x924a('0x29')]=_0x557716[_0x924a('0x29')];}module[_0x924a('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 0319ba3..3f317cb 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc50=['util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','queue','calleridname','name','calleridnum','starttime','endtime','responsetime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc50,0x72));var _0x0dc5=function(_0x141f24,_0x2de9a6){_0x141f24=_0x141f24-0x0;var _0x57bcd=_0xdc50[_0x141f24];return _0x57bcd;};'use strict';var util=require(_0x0dc5('0x0'));var _=require(_0x0dc5('0x1'));var moment=require(_0x0dc5('0x2'));function getSeconds(_0x3173ef,_0x439a68){var _0x384a5d=moment(_0x3173ef)[_0x0dc5('0x3')](0x0);var _0x22c25e=moment(_0x439a68)[_0x0dc5('0x3')](0x0);return _0x384a5d[_0x0dc5('0x4')](_0x22c25e,'seconds');}function History(_0x13b74d){this['uniqueid']=_0x13b74d[_0x0dc5('0x5')];this[_0x0dc5('0x6')]=_0x13b74d['scheduledat']||undefined;this[_0x0dc5('0x7')]=_0x13b74d['type'];this[_0x0dc5('0x8')]=_0x13b74d[_0x0dc5('0x7')]===_0x0dc5('0x9')?'queue':_0x13b74d[_0x0dc5('0x7')];this[_0x0dc5('0xa')]=_0x13b74d[_0x0dc5('0xa')];this[_0x0dc5('0xb')]=_0x13b74d[_0x0dc5('0xb')];this[_0x0dc5('0xc')]=_0x13b74d[_0x0dc5('0xc')];this['countglobal']=_0x13b74d['countbusyretry']+_0x13b74d[_0x0dc5('0xb')]+_0x13b74d[_0x0dc5('0xc')]+_0x13b74d['countnosuchnumberretry']+_0x13b74d['countdropretry']+_0x13b74d['countabandonedretry']+_0x13b74d[_0x0dc5('0xd')]+_0x13b74d[_0x0dc5('0xe')];this['countnosuchnumberretry']=_0x13b74d[_0x0dc5('0xf')];this[_0x0dc5('0x10')]=_0x13b74d['countdropretry'];this[_0x0dc5('0x11')]=_0x13b74d[_0x0dc5('0x11')];this[_0x0dc5('0xd')]=_0x13b74d[_0x0dc5('0xd')];this[_0x0dc5('0xe')]=_0x13b74d[_0x0dc5('0xe')];this[_0x0dc5('0x12')]=_0x13b74d[_0x0dc5('0x12')];this[_0x0dc5('0x13')]=_0x13b74d[_0x0dc5('0x14')];this[_0x0dc5('0x15')]=_0x13b74d['number'];this[_0x0dc5('0x16')]=_0x13b74d[_0x0dc5('0x16')];this['responsetime']=_0x13b74d['responsetime'];this[_0x0dc5('0x17')]=_0x13b74d[_0x0dc5('0x18')];this[_0x0dc5('0x19')]=getSeconds(_0x13b74d[_0x0dc5('0x18')],_0x13b74d['starttime']);this['holdtime']=0x0;this['talktime']=0x0;this[_0x0dc5('0x1a')]=_0x13b74d['callback'];this[_0x0dc5('0x1b')]=_0x13b74d[_0x0dc5('0x1b')];this[_0x0dc5('0x1c')]=_0x13b74d[_0x0dc5('0x1c')];this['recallme']=_0x13b74d[_0x0dc5('0x1d')];this[_0x0dc5('0x1e')]=_0x13b74d[_0x0dc5('0x1e')];this[_0x0dc5('0x1f')]=_0x13b74d[_0x0dc5('0x1f')];this[_0x0dc5('0x20')]=_0x13b74d[_0x0dc5('0x20')];this['VoiceQueueId']=_0x13b74d[_0x0dc5('0x21')];this[_0x0dc5('0x22')]=_0x13b74d[_0x0dc5('0x22')];this[_0x0dc5('0x23')]=_0x13b74d[_0x0dc5('0x23')]||'';this[_0x0dc5('0x24')]=_0x13b74d[_0x0dc5('0x24')]||'';}module[_0x0dc5('0x25')]=History; \ No newline at end of file +var _0x3cfb=['calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','name'];(function(_0x4278d5,_0x267213){var _0x3d0d5e=function(_0x1b3d8b){while(--_0x1b3d8b){_0x4278d5['push'](_0x4278d5['shift']());}};_0x3d0d5e(++_0x267213);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x5bcf9f,_0x357491){_0x5bcf9f=_0x5bcf9f-0x0;var _0x366323=_0x3cfb[_0x5bcf9f];return _0x366323;};'use strict';var util=require(_0xb3cf('0x0'));var _=require(_0xb3cf('0x1'));var moment=require(_0xb3cf('0x2'));function getSeconds(_0x3d8fa3,_0xa3584d){var _0x147066=moment(_0x3d8fa3)[_0xb3cf('0x3')](0x0);var _0x40c159=moment(_0xa3584d)['milliseconds'](0x0);return _0x147066[_0xb3cf('0x4')](_0x40c159,_0xb3cf('0x5'));}function History(_0x19e5e5){this['uniqueid']=_0x19e5e5[_0xb3cf('0x6')];this[_0xb3cf('0x7')]=_0x19e5e5[_0xb3cf('0x7')]||undefined;this['type']=_0x19e5e5[_0xb3cf('0x8')];this['campaigntype']=_0x19e5e5['type']===_0xb3cf('0x9')?_0xb3cf('0xa'):_0x19e5e5[_0xb3cf('0x8')];this[_0xb3cf('0xb')]=_0x19e5e5[_0xb3cf('0xb')];this[_0xb3cf('0xc')]=_0x19e5e5[_0xb3cf('0xc')];this[_0xb3cf('0xd')]=_0x19e5e5[_0xb3cf('0xd')];this[_0xb3cf('0xe')]=_0x19e5e5[_0xb3cf('0xb')]+_0x19e5e5[_0xb3cf('0xc')]+_0x19e5e5[_0xb3cf('0xd')]+_0x19e5e5[_0xb3cf('0xf')]+_0x19e5e5[_0xb3cf('0x10')]+_0x19e5e5['countabandonedretry']+_0x19e5e5['countmachineretry']+_0x19e5e5[_0xb3cf('0x11')];this[_0xb3cf('0xf')]=_0x19e5e5['countnosuchnumberretry'];this[_0xb3cf('0x10')]=_0x19e5e5['countdropretry'];this['countabandonedretry']=_0x19e5e5[_0xb3cf('0x12')];this[_0xb3cf('0x13')]=_0x19e5e5[_0xb3cf('0x13')];this['countagentrejectretry']=_0x19e5e5[_0xb3cf('0x11')];this[_0xb3cf('0xa')]=_0x19e5e5[_0xb3cf('0xa')];this[_0xb3cf('0x14')]=_0x19e5e5[_0xb3cf('0x15')];this[_0xb3cf('0x16')]=_0x19e5e5[_0xb3cf('0x17')];this[_0xb3cf('0x18')]=_0x19e5e5[_0xb3cf('0x18')];this[_0xb3cf('0x19')]=_0x19e5e5['responsetime'];this[_0xb3cf('0x1a')]=_0x19e5e5[_0xb3cf('0x19')];this[_0xb3cf('0x1b')]=getSeconds(_0x19e5e5[_0xb3cf('0x19')],_0x19e5e5['starttime']);this[_0xb3cf('0x1c')]=0x0;this[_0xb3cf('0x1d')]=0x0;this[_0xb3cf('0x1e')]=_0x19e5e5[_0xb3cf('0x1e')];this[_0xb3cf('0x1f')]=_0x19e5e5[_0xb3cf('0x1f')];this[_0xb3cf('0x20')]=_0x19e5e5[_0xb3cf('0x20')];this[_0xb3cf('0x21')]=_0x19e5e5[_0xb3cf('0x21')];this['ContactId']=_0x19e5e5[_0xb3cf('0x22')];this[_0xb3cf('0x23')]=_0x19e5e5[_0xb3cf('0x23')];this[_0xb3cf('0x24')]=_0x19e5e5[_0xb3cf('0x24')];this[_0xb3cf('0x25')]=_0x19e5e5[_0xb3cf('0x25')];this[_0xb3cf('0x26')]=_0x19e5e5[_0xb3cf('0x26')];this[_0xb3cf('0x27')]=_0x19e5e5['originatecalleridnum']||'';this[_0xb3cf('0x28')]=_0x19e5e5[_0xb3cf('0x28')]||'';}module[_0xb3cf('0x29')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 7365ccf..7a26ec6 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 _0x16a1=['contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','Intervals','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','Failure','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','handleIvr','loggedIn','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','outbound','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','countagentrejectretry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','getVoiceQueueRtPauses','outboundQueuePauses','[CatchErlangB]','busyFactor','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','[actionOriginate]\x20','checkContactBlack','[actionOriginateIvr]\x20','floor','dialLimitQueue','ACTIVE','RUNNING','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','Agent\x20Busy\x20Factor:\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','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','clearZombieChannels','[uniqueid]','[actions]','sequence','Action','status','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','[rescheduleContact][Machine]','statedesc','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialMachineMaxRetry','add','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','responsetime','dropreason','TIMEOUT','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','starttime','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridnum','channel','actionid','roundrobin','stateinterface','locked','queueBooked','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','_rr','unlockRR','[booked][RR]','Agent:\x20'];(function(_0x4c93c3,_0x5b8417){var _0x3f4c2f=function(_0x1970ef){while(--_0x1970ef){_0x4c93c3['push'](_0x4c93c3['shift']());}};_0x3f4c2f(++_0x5b8417);}(_0x16a1,0xeb));var _0x116a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x16a1[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x116a('0x0'));var _=require(_0x116a('0x1'));var BPromise=require(_0x116a('0x2'));var uuid=require(_0x116a('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x116a('0x4'));var Redis=require(_0x116a('0x5'));var ut=require(_0x116a('0x6'));var config=require('../../../config/environment/');var logger=require(_0x116a('0x7'))(_0x116a('0x8'));var loggerBooked=require(_0x116a('0x7'))(_0x116a('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x116a('0x7'))(_0x116a('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x116a('0xb'));var ami=require(_0x116a('0xc'));config[_0x116a('0xd')]=_[_0x116a('0xe')](config[_0x116a('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x116a('0xf'))(new Redis(config[_0x116a('0xd')]));var cmHopper=require(_0x116a('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require(_0x116a('0x11'));var cmHopperBlack=require(_0x116a('0x12'));var voiceQueueRt=require(_0x116a('0x13'));var RpcSetting=require(_0x116a('0x14'));var Action=require(_0x116a('0x15'));var History=require(_0x116a('0x16'));var Final=require(_0x116a('0x17'));var AgentComplete=require(_0x116a('0x18'));var QueueCallerAbandon=require(_0x116a('0x19'));var Hangup=require(_0x116a('0x1a'));var ipAgi=process[_0x116a('0x1b')][_0x116a('0x1c')]||_0x116a('0x1d');var strategy={'rrmemory':_0x116a('0x1e'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x116a('0x1f')][_0x116a('0x20')]=function(_0x89b776){this[_0x116a('0x21')]=this[_0x116a('0x21')]?this['tail']['finally'](_0x89b776):_0x89b776();};function Dialer(_0x44c76f,_0x2c3ddc){this['sequence']=new Sequence();this['preview']=_0x2c3ddc;this[_0x116a('0x22')]=_0x44c76f[_0x116a('0x22')];this[_0x116a('0x23')]=_0x44c76f[_0x116a('0x23')];this['agents']=_0x44c76f[_0x116a('0x24')];this['trunks']=_0x44c76f[_0x116a('0x25')];this[_0x116a('0x26')]=config[_0x116a('0x26')]||0x2;this[_0x116a('0x27')]={};this[_0x116a('0x28')]={};this[_0x116a('0x29')]={};this[_0x116a('0x2a')]={};this[_0x116a('0x2b')]={};this[_0x116a('0x2c')]={};this[_0x116a('0x2d')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x116a('0x2e')]={};ami['on'](_0x116a('0x2f'),this[_0x116a('0x30')]['bind'](this));ami['on']('queuecallerabandon',this[_0x116a('0x31')][_0x116a('0x32')](this));ami['on'](_0x116a('0x33'),this[_0x116a('0x34')][_0x116a('0x32')](this));ami['on'](_0x116a('0x35'),this[_0x116a('0x36')][_0x116a('0x32')](this));ami['on'](_0x116a('0x37'),this[_0x116a('0xb')][_0x116a('0x32')](this));ami['on'](_0x116a('0x38'),this[_0x116a('0x39')][_0x116a('0x32')](this));ami['on'](_0x116a('0x3a'),this[_0x116a('0x3b')][_0x116a('0x32')](this));ami['on'](_0x116a('0x3c'),this['syncVarSet'][_0x116a('0x32')](this));ami['on'](_0x116a('0x3d'),this[_0x116a('0x3e')][_0x116a('0x32')](this));ami['on']('queuestatuscomplete',this[_0x116a('0x3f')][_0x116a('0x32')](this));this[_0x116a('0x40')]();this[_0x116a('0x41')]();RpcSetting[_0x116a('0x42')]()[_0x116a('0x43')](function(_0x3448ec){previewRecallmeReminderInterval=_0x3448ec[_0x116a('0x44')];});}function isNotNull(_0x40f589){return _0x40f589!==null&&!_[_0x116a('0x45')](_0x40f589);}function checkIsLoggedIn(_0x137b05,_0x52f85e){return function(){if(_0x52f85e<=0x0){_0x137b05[_0x116a('0x46')]=_0x116a('0x47');throw _0x137b05['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x1318f6){return _0x1318f6;}function checkIsActive(_0x131cbd,_0x210aae){return function(){if(!isActive(_0x210aae)){_0x131cbd['message']=_0x116a('0x48');throw _0x131cbd[_0x116a('0x49')]+_0x116a('0x4a');}};}function checkInterval(_0x3c33e){return function(){if(!isNotNull(_0x3c33e[_0x116a('0x4b')])){_0x3c33e[_0x116a('0x46')]='INTERVAL_IS_NULL';throw _0x3c33e[_0x116a('0x49')]+_0x116a('0x4c');}if(!isNotNull(_0x3c33e['Interval']['Intervals'])){_0x3c33e[_0x116a('0x46')]=_0x116a('0x4d');throw _0x3c33e[_0x116a('0x49')]+_0x116a('0x4c');}if(!isNotNull(_['isEmpty'](_0x3c33e[_0x116a('0x4b')]['Intervals']))){_0x3c33e['message']=_0x116a('0x4d');throw _0x3c33e['name']+_0x116a('0x4c');}};}function msgResponse(_0x47f0c1,_0x4ad075,_0x5d242a){return{'action':_0x47f0c1,'response':_0x4ad075,'message':_0x5d242a,'stack':_0x5d242a};}function myreject(_0x1edade){return function(_0x35fe97){return _0x1edade(msgResponse('[ifTime][Action]',_0x116a('0x4e'),JSON[_0x116a('0x4f')](_0x35fe97)));};}function getSeconds(_0x38c1ba,_0x4a9b84){var _0xfb9634=moment(_0x38c1ba)[_0x116a('0x50')](0x0);var _0xf111b3=moment(_0x4a9b84)[_0x116a('0x50')](0x0);return _0xfb9634[_0x116a('0x51')](_0xf111b3,_0x116a('0x52'));}function emit(_0x53d03c,_0x12fa1b,_0x41d272){io['to'](_0x53d03c)[_0x116a('0x53')](_0x12fa1b,_0x41d272);}function emitVoiceQueueSummary(_0xd4e507){if(_0xd4e507[_0x116a('0x54')]==='outbound'){var _0x2ffb3f={'id':_0xd4e507['id'],'name':_0xd4e507['name'],'strategy':_0xd4e507[_0x116a('0x55')],'answered':_0xd4e507[_0x116a('0x56')],'available':_0xd4e507['available'],'loggedIn':_0xd4e507['loggedIn'],'pTalking':_0xd4e507[_0x116a('0x57')],'sumBillable':_0xd4e507[_0x116a('0x58')],'sumDuration':_0xd4e507[_0x116a('0x59')],'sumHoldTime':_0xd4e507[_0x116a('0x5a')]||0x0,'talking':_0xd4e507[_0x116a('0x5b')],'total':_0xd4e507[_0x116a('0x5c')],'type':_0xd4e507['type'],'unmanaged':_0xd4e507[_0x116a('0x5d')],'abandoned':_0xd4e507[_0x116a('0x5e')],'waiting':_0xd4e507['waiting'],'loggedInDb':_0xd4e507[_0x116a('0x5f')],'dialActive':_0xd4e507[_0x116a('0x60')],'dialMethod':_0xd4e507[_0x116a('0x61')],'dialOriginateCallerIdName':_0xd4e507['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xd4e507['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xd4e507[_0x116a('0x62')],'dialPrefix':_0xd4e507['dialPrefix'],'outboundAnswerAgiCallsDay':_0xd4e507['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0xd4e507[_0x116a('0x63')],'outboundBlacklistCallsDay':_0xd4e507[_0x116a('0x64')],'outboundBusyCallsDay':_0xd4e507[_0x116a('0x65')],'outboundCongestionCallsDay':_0xd4e507[_0x116a('0x66')],'outboundDropCallsDayACS':_0xd4e507['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xd4e507[_0x116a('0x67')],'outboundDropCallsDayTimeout':_0xd4e507[_0x116a('0x68')],'outboundNoAnswerCallsDay':_0xd4e507[_0x116a('0x69')],'outboundNoSuchCallsDay':_0xd4e507[_0x116a('0x6a')],'outboundOriginateFailureCallsDay':_0xd4e507[_0x116a('0x6b')],'outboundReCallsDay':_0xd4e507[_0x116a('0x6c')],'outboundRejectCallsDay':_0xd4e507[_0x116a('0x6d')],'outboundUnknownCallsDay':_0xd4e507['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xd4e507['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xd4e507[_0x116a('0x6e')],'predictiveIntervalAvgTalktime':_0xd4e507[_0x116a('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0xd4e507[_0x116a('0x70')],'predictiveIntervalDroppedCallsTimeout':_0xd4e507[_0x116a('0x71')],'predictiveIntervalErlangCalls':_0xd4e507[_0x116a('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0xd4e507[_0x116a('0x73')],'predictiveIntervalHitRate':_0xd4e507[_0x116a('0x74')],'predictiveIntervalMultiplicativeFactor':_0xd4e507[_0x116a('0x75')],'predictiveIntervalPauses':_0xd4e507[_0x116a('0x76')],'predictiveIntervalAvailable':_0xd4e507['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xd4e507[_0x116a('0x77')],'message':_0xd4e507[_0x116a('0x46')],'originated':_0xd4e507[_0x116a('0x78')],'erlangCalls':_0xd4e507['erlangCalls'],'erlangCallToSecond':_0xd4e507[_0x116a('0x79')],'erlangAbandonmentRate':_0xd4e507[_0x116a('0x7a')],'erlangBusyFactor':_0xd4e507[_0x116a('0x7b')],'startPredictive':_0xd4e507[_0x116a('0x2c')],'startProgressive':_0xd4e507[_0x116a('0x2d')]};if(_0xd4e507[_0x116a('0x7c')]){_0x2ffb3f[_0x116a('0x7c')]={'id':_0xd4e507[_0x116a('0x7c')]['id'],'name':_0xd4e507[_0x116a('0x7c')][_0x116a('0x49')],'active':_0xd4e507[_0x116a('0x7c')][_0x116a('0x7d')],'callerid':_0xd4e507[_0x116a('0x7c')]['callerid']};}if(_0xd4e507[_0x116a('0x4b')]){_0x2ffb3f[_0x116a('0x4b')]={'id':_0xd4e507[_0x116a('0x4b')]['id'],'name':_0xd4e507['Interval'][_0x116a('0x49')]};}var _0x10f3b4=md5(JSON[_0x116a('0x4f')](_0x2ffb3f));if(_0xd4e507['md5']!==_0x10f3b4){_0xd4e507[_0x116a('0x4')]=_0x10f3b4;emit(util[_0x116a('0x7e')](_0x116a('0x7f'),_0x2ffb3f['name']),_0x116a('0x80'),_0x2ffb3f);}}}function emitCampaignSummary(_0x41d797){if(_0x41d797['type']===_0x116a('0x81')){emit(util[_0x116a('0x7e')](_0x116a('0x82'),_0x41d797['name']),_0x116a('0x83'),_0x41d797);}}function checkGetDataPredictive(_0x4fabc1){if(isNotNull(_0x4fabc1)&&!_[_0x116a('0x84')](_0x4fabc1)){loggerPredictive['info'](_0x116a('0x85'));loggerPredictive['info'](_0x116a('0x86'),_0x4fabc1['predictiveIntervalTotalCalls']);loggerPredictive[_0x116a('0x87')](_0x116a('0x88'),_0x4fabc1[_0x116a('0x89')]);loggerPredictive[_0x116a('0x87')](_0x116a('0x8a'),_0x4fabc1[_0x116a('0x71')]);loggerPredictive[_0x116a('0x87')](_0x116a('0x8b'),_0x4fabc1[_0x116a('0x70')]);loggerPredictive[_0x116a('0x87')](_0x116a('0x8c'),_0x4fabc1[_0x116a('0x6e')]);loggerPredictive[_0x116a('0x87')](_0x116a('0x8d'),_0x4fabc1[_0x116a('0x6f')]);loggerPredictive[_0x116a('0x87')]('---------------------------');if(_0x4fabc1[_0x116a('0x77')]>0x0){if(!_[_0x116a('0x45')](_0x4fabc1[_0x116a('0x6f')])&&_0x4fabc1[_0x116a('0x6f')]>0x0){return!![];}loggerPredictive[_0x116a('0x87')](_0x116a('0x8e'));if(!_[_0x116a('0x45')](_0x4fabc1[_0x116a('0x6e')])&&_0x4fabc1[_0x116a('0x6e')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x116a('0x87')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3de6d5){return function(_0x5c038a){loggerPredictive[_0x116a('0x87')](_0x116a('0x8f'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c038a[_0x116a('0x90')]);loggerPredictive[_0x116a('0x87')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c038a[_0x116a('0x79')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c038a[_0x116a('0x7a')]);loggerPredictive[_0x116a('0x87')](_0x116a('0x91'),_0x5c038a['erlangBusyFactor']);loggerPredictive['info'](_0x116a('0x92'),_0x5c038a[_0x116a('0x7a')]);loggerPredictive[_0x116a('0x87')](_0x116a('0x93'));_[_0x116a('0x94')](_0x3de6d5,_0x5c038a);};}function getDiff(_0x567ef1){var _0x2d7a48=moment()['milliseconds'](0x0);var _0x25cd74=moment(_0x567ef1)[_0x116a('0x50')](0x0);return _0x2d7a48[_0x116a('0x51')](_0x25cd74,_0x116a('0x52'));}function ifInterval(_0x33fe08,_0x3b39ea){if(_['isUndefined'](_0x3b39ea)){return![];}return getDiff(_0x3b39ea)<_0x33fe08*0x3c;}function freeVariablesPredictive(_0x86db61){if(isNotNull(_0x86db61)){if(!_[_0x116a('0x45')](_0x86db61['startProgressive'])){_0x86db61[_0x116a('0x2d')]=undefined;loggerPredictive[_0x116a('0x87')](_0x86db61[_0x116a('0x49')],_0x116a('0x95'));}if(!_[_0x116a('0x45')](_0x86db61[_0x116a('0x2c')])){_0x86db61[_0x116a('0x2c')]=undefined;loggerPredictive[_0x116a('0x87')](_0x86db61[_0x116a('0x49')],_0x116a('0x96'));}if(!_[_0x116a('0x45')](_0x86db61[_0x116a('0x97')])){clearInterval(_0x86db61[_0x116a('0x97')]);_0x86db61[_0x116a('0x97')]=undefined;loggerPredictive[_0x116a('0x87')](_0x86db61['name'],_0x116a('0x98'));}}}function erlangb(_0x5a1f5,_0x5befd7){if(_0x5befd7===0x0){return 0x0;}var _0xe1c343=0x1;for(var _0x3bb335=0x1;_0x3bb335<=_0x5befd7;_0x3bb335+=0x1){_0xe1c343=0x1+_0xe1c343*_0x3bb335/_0x5a1f5;}return 0x1/_0xe1c343;}function isVoiceQueueOutbound(_0x58c5ba){return _0x58c5ba==='outbound';}function isNotPreview(_0x5df7c1){return _0x5df7c1!==_0x116a('0x99');}function isCampaignIvr(_0x18f9fe){return _0x18f9fe===_0x116a('0x81');}function getCallerId(_0x290f8d,_0x3aaf42,_0x3169e0){if(!_[_0x116a('0x45')](_0x3169e0)&&typeof _0x3169e0===_0x116a('0x9a')&&!_['isEmpty'](_0x3169e0)){if(!_[_0x116a('0x45')](_0x3aaf42)&&typeof _0x3aaf42==='string'&&!_[_0x116a('0x84')](_0x3aaf42)){return util['format'](_0x116a('0x9b'),_0x3aaf42,_0x3169e0);}return util['format'](_0x116a('0x9b'),_0x3169e0,_0x3169e0);}if(!_[_0x116a('0x45')](_0x290f8d)&&typeof _0x290f8d===_0x116a('0x9a')&&!_[_0x116a('0x84')](_0x290f8d)){return _0x290f8d;}return _0x116a('0x9c');}function loggerCatchQueueSummary(_0x132329,_0x301603){return function(_0x4aa392){freeVariablesPredictive(_0x301603);emitVoiceQueueSummary(_0x301603);emitCampaignSummary(_0x301603);loggerSyncQueueSummary[_0x116a('0x9d')](_0x132329,util[_0x116a('0x9e')](_0x4aa392,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x574381,_0x59419a){return function(_0x2938f9){loggerPredictive[_0x116a('0x9d')](_0x59419a[_0x116a('0x49')],_0x574381);loggerPredictive[_0x116a('0x9d')](_0x2938f9[_0x116a('0x9f')]);freeVariablesPredictive(_0x59419a);};}function loggerCatch(_0x1255ed){return function(_0x5c24f7){logger[_0x116a('0x9d')](_0x1255ed,util['inspect'](_0x5c24f7,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4aa5b0){return _0x4aa5b0&&!_[_0x116a('0x45')](_0x4aa5b0)&&_0x4aa5b0[_0x116a('0xa0')]>0x0;}function decremetOriginate(_0x3a9861){if(!_[_0x116a('0x45')](_0x3a9861)&&_0x3a9861!==null){if(typeof _0x3a9861[_0x116a('0x78')]!==_0x116a('0xa1')){if(_0x3a9861[_0x116a('0x78')]>0x0){_0x3a9861[_0x116a('0x78')]-=0x1;}else{logger['error'](_0x116a('0xa2'));}}}else{logger[_0x116a('0x9d')](_0x116a('0xa3'));}}function checkContactLowerLimitOriginate(_0x2e6e95,_0x4afa90,_0x62dec9){if(_0x4afa90>_0x62dec9){for(var _0x2b5ba4=0x0;_0x2b5ba4<_0x4afa90-_0x62dec9;_0x2b5ba4+=0x1){decremetOriginate(_0x2e6e95);}}}function loggerGetContactDialer(_0x34668f,_0x39f08d,_0x142adf){return function(_0x1cf835){checkContactLowerLimitOriginate(_0x39f08d,_0x142adf,0x0);logger[_0x116a('0x9d')](_0x34668f,util[_0x116a('0x9e')](_0x1cf835,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4dbee6){return function(_0x4c4c7f){if(isNotNull(_0x4c4c7f)&&isNotNull(_0x4c4c7f[0x0])){if(_0x4c4c7f[0x0]['contactsRescheduled']>0x0){_0x4dbee6[_0x116a('0x46')]=_0x116a('0xa4');logger[_0x116a('0x87')](_0x116a('0xa5')+_0x4dbee6[_0x116a('0x49')],_0x4c4c7f[0x0][_0x116a('0xa6')],_0x116a('0xa7'));}else{_0x4dbee6['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x116a('0x87')](_0x116a('0xa8')+_0x4dbee6[_0x116a('0x49')]);}}};}function notSendMessagesQueue(_0x12b026){if(_0x12b026[_0x116a('0xa9')]){freeVariablesPredictive(_0x12b026);if(_0x12b026['originated']===0x0&&_0x12b026[_0x116a('0x5b')]===0x0&&_0x12b026[_0x116a('0xaa')]===0x0&&(_0x12b026[_0x116a('0x57')]||0x0)===0x0){_0x12b026[_0x116a('0xa9')]=![];_0x12b026[_0x116a('0xab')]=0x0;_0x12b026['message']=_0x116a('0x48');loggerSyncQueueSummary['error'](_0x116a('0xac'),_0x12b026['name'],_0x116a('0xad'));}else{_0x12b026['message']=_0x116a('0xae');loggerSyncQueueSummary['error'](_0x116a('0xac'),_0x12b026[_0x116a('0x49')],_0x116a('0xaf'));}emitVoiceQueueSummary(_0x12b026);}}function notSendMessagesCampaign(_0x2f7679){if(_0x2f7679['sendMessageOneNotActive']){if(_0x2f7679[_0x116a('0x78')]===0x0){_0x2f7679[_0x116a('0xa9')]=![];_0x2f7679[_0x116a('0x46')]=_0x116a('0x48');loggerSyncQueueSummary[_0x116a('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2f7679[_0x116a('0x49')],_0x116a('0xad'));}else{_0x2f7679['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x116a('0x9d')](_0x116a('0xb0'),_0x2f7679[_0x116a('0x49')],_0x116a('0xaf'));}emitCampaignSummary(_0x2f7679);}}function createObjHistory(_0x25a66d,_0xc7f37c,_0x528d71,_0x26bcca,_0x57c198){_0x25a66d['message']=_0x528d71;var _0x28cceb=new Action(_0x25a66d,_0xc7f37c);var _0x62e961=new History(_0x28cceb);_0x62e961[_0x116a('0xb1')]=_0x26bcca;_0x62e961['statedesc']=_0x57c198;_0x62e961[_0x116a('0xb2')]=_0x28cceb['starttime'];return _0x62e961;}Dialer[_0x116a('0x1f')][_0x116a('0x41')]=function(){var _0x45d93b=this;setInterval(function(){_0x45d93b[_0x116a('0xb3')](_0x45d93b[_0x116a('0x2a')],_0x116a('0xb4'));_0x45d93b['clearZombieChannels'](_0x45d93b[_0x116a('0x28')],_0x116a('0xb5'));},0x32c8);};Dialer[_0x116a('0x1f')][_0x116a('0xb3')]=function(_0x172d43,_0x590e7c){var _0x5b51d2=this;for(var _0x5af57e in _0x172d43){if(typeof _0x172d43[_0x5af57e]!==_0x116a('0xa1')){this[_0x116a('0xb6')]['enqueue'](function(){if(!_['isNil'](_0x172d43[_0x5af57e])){return ami[_0x116a('0xb7')]({'action':_0x116a('0xb8'),'channel':_0x172d43[_0x5af57e]['channel']})['catch'](function(_0x3f3033){if(_0x3f3033[_0x116a('0x46')]===_0x116a('0xb9')){setTimeout(function(){if(_0x172d43[_0x5af57e]&&_0x172d43[_0x5af57e][_0x116a('0x54')]!==_0x116a('0x81')){_0x5b51d2[_0x116a('0xba')](_0x5b51d2[_0x116a('0x22')][_0x172d43[_0x5af57e][_0x116a('0xbb')]]);logger[_0x116a('0x9d')]('[Dialer][checkChannel]',_0x590e7c,_0x5af57e,_0x172d43[_0x5af57e]['queue']);delete _0x172d43[_0x5af57e];}if(_0x172d43[_0x5af57e]&&_0x172d43[_0x5af57e][_0x116a('0x54')]===_0x116a('0x81')){_0x5b51d2[_0x116a('0xba')](_0x5b51d2[_0x116a('0x23')][_0x172d43[_0x5af57e]['queue']]);logger[_0x116a('0x9d')](_0x116a('0xbc'),_0x590e7c,_0x5af57e,_0x172d43[_0x5af57e][_0x116a('0xbb')]);delete _0x172d43[_0x5af57e];}},0x2328);}});}});}}};Dialer['prototype'][_0x116a('0xbd')]=function(_0x18fec1){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopper[_0x116a('0xbd')](_0x18fec1))[_0x116a('0xbf')](loggerCatch(_0x116a('0xc0')));};Dialer[_0x116a('0x1f')][_0x116a('0xc1')]=function(_0x17fcaa){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopperBlack[_0x116a('0xc1')](_0x17fcaa))[_0x116a('0xbf')](loggerCatch(_0x116a('0xc2')));};Dialer[_0x116a('0x1f')][_0x116a('0xc3')]=function(_0x5f4963,_0x1270af,_0x4f77c6){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopperAdditionalPhone[_0x116a('0xc3')](_0x5f4963,_0x1270af,_0x4f77c6))[_0x116a('0xbf')](loggerCatch(_0x116a('0xc4')));};Dialer[_0x116a('0x1f')][_0x116a('0xc5')]=function(_0x4bcfa0,_0xf2ef0f,_0x3b085c){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopperAdditionalPhone[_0x116a('0xc5')](_0x4bcfa0,_0xf2ef0f,_0x3b085c))[_0x116a('0xbf')](loggerCatch(_0x116a('0xc6')));};Dialer[_0x116a('0x1f')]['checkIsBlackListIvr']=function(_0x52b3f7){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopperBlack[_0x116a('0xc7')](_0x52b3f7))[_0x116a('0xbf')](loggerCatch(_0x116a('0xc8')));};Dialer[_0x116a('0x1f')][_0x116a('0xc9')]=function(_0x3e9ffc){return BPromise['resolve']()['then'](cmHopperHistory['avgHandleTime'](_0x3e9ffc))[_0x116a('0xbf')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x116a('0x1f')][_0x116a('0xca')]=function(_0x993f40){return BPromise['resolve']()[_0x116a('0x43')](cmHopper[_0x116a('0xca')](_0x993f40))['catch'](loggerCatch(_0x116a('0xcb')));};Dialer[_0x116a('0x1f')]['unlockContact']=function(_0x418531,_0x531d7d,_0x5ee5be){return BPromise['resolve']()[_0x116a('0x43')](cmHopper[_0x116a('0xcc')](_0x418531,_0x531d7d,_0x5ee5be))[_0x116a('0xbf')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x116a('0x1f')]['getContactDialer']=function(_0xa714d2,_0x15d0aa,_0x47bb25,_0x45a1cd,_0x29d02c){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopper[_0x116a('0xcd')](_0xa714d2,_0x15d0aa,_0x47bb25,_0x45a1cd))['catch'](function(_0x39d7c7){_0x29d02c[_0x116a('0xce')]-=_0x47bb25;_0x29d02c[_0x116a('0xce')]=_0x29d02c[_0x116a('0xce')]>0x0?_0x29d02c[_0x116a('0xce')]:0x0;loggerCatch(_0x116a('0xcf'))(_0x39d7c7);});};Dialer[_0x116a('0x1f')][_0x116a('0xd0')]=function(_0x5c7748,_0x14545b,_0x592f4e,_0x464629){return BPromise[_0x116a('0xbe')]()['then'](cmHopper[_0x116a('0xd0')](_0x5c7748,_0x14545b,_0x592f4e))[_0x116a('0xbf')](function(_0x441da6){_0x464629[_0x116a('0xce')]-=_0x14545b;_0x464629[_0x116a('0xce')]=_0x464629[_0x116a('0xce')]>0x0?_0x464629[_0x116a('0xce')]:0x0;loggerCatch(_0x116a('0xd1'))(_0x441da6);});};Dialer[_0x116a('0x1f')]['getVoiceQueueRtPauses']=function(_0x582a62){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](voiceQueueRt['getVoiceQueueRtPauses'](_0x582a62))[_0x116a('0xbf')](loggerCatch(_0x116a('0xd2')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x42b965){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopper[_0x116a('0xd3')](_0x42b965))[_0x116a('0xbf')](loggerCatch(_0x116a('0xd4')));};Dialer[_0x116a('0x1f')]['createHistory']=function(_0x393be3){return BPromise['resolve']()[_0x116a('0x43')](cmHopperHistory[_0x116a('0xd5')](_0x393be3))[_0x116a('0xbf')](loggerCatch(_0x116a('0xd6')));};Dialer[_0x116a('0x1f')]['updateOriginated']=function(_0x277084){if(!_[_0x116a('0x45')](_0x277084)&&_0x277084!==null){if(typeof _0x277084[_0x116a('0x78')]!==_0x116a('0xa1')){if(_0x277084['originated']>0x0){_0x277084['originated']-=0x1;}else{logger[_0x116a('0x9d')](_0x116a('0xd7'));}}}else{logger['error'](_0x116a('0xd8'));}};Dialer['prototype'][_0x116a('0xd9')]=function(_0x195d7c,_0x12121d){var _0x2da489=this;return function(_0x4efb15){_0x2da489[_0x116a('0xba')](_0x12121d);logger['error'](_0x195d7c,util[_0x116a('0x9e')](_0x4efb15,{'showHidden':![],'depth':null}));};};Dialer[_0x116a('0x1f')][_0x116a('0xda')]=function(_0x2b48b9,_0x19620f,_0x1306ae){var _0x1b9c8f={'state':0x19,'statedesc':_0x116a('0xdb')};this['updateOriginated'](_0x19620f);this[_0x116a('0xdc')](_['merge'](_0x1b9c8f,_[_0x116a('0xdd')](_0x1306ae,[_0x116a('0xde'),'ListId',_0x116a('0xdf'),'VoiceQueueId',_0x116a('0xe0')])),_0x116a('0xe1'),_0x116a('0xe2'));logger[_0x116a('0x9d')](_0x2b48b9);};Dialer['prototype'][_0x116a('0xe3')]=function(_0x103c9f){return _0x103c9f===_0x116a('0xe4');};Dialer[_0x116a('0x1f')][_0x116a('0xe5')]=function(_0x516050){return!_[_0x116a('0x45')](_0x516050)&&_0x516050&&!_['isUndefined'](_0x516050[_0x116a('0x49')])&&!_[_0x116a('0x45')](_0x516050['active'])&&_0x516050[_0x116a('0x7d')]&&(this['trunks'][util[_0x116a('0x7e')](_0x116a('0xe6'),_0x516050['name'])][_0x116a('0xb8')]===_0x116a('0xe7')||this[_0x116a('0x25')][util[_0x116a('0x7e')]('SIP/%s',_0x516050[_0x116a('0x49')])][_0x116a('0xb8')]===_0x116a('0xe8'));};Dialer[_0x116a('0x1f')][_0x116a('0xdc')]=function(_0x5e6d77,_0x3572ec,_0x2b235e){this['createHistory'](_0x5e6d77)[_0x116a('0xbf')](loggerCatch(_0x3572ec));this[_0x116a('0xd3')](_0x5e6d77)['catch'](loggerCatch(_0x2b235e));};Dialer['prototype'][_0x116a('0xe9')]=function(_0x185a67){var _0x2eb94a=this[_0x116a('0x2a')][_0x185a67[_0x116a('0xea')]];var _0x1998a9;if(!_[_0x116a('0xeb')](_0x185a67)&&!_[_0x116a('0xeb')](_0x185a67[_0x116a('0xec')])&&!_[_0x116a('0xeb')](_0x185a67['variable'][_0x116a('0xed')])&&_0x185a67[_0x116a('0xee')]===_0x116a('0xef')&&_0x2eb94a){if(_0x2eb94a[_0x116a('0x54')]!=='ivr'&&this[_0x116a('0x22')][_0x2eb94a[_0x116a('0xbb')]][_0x116a('0xf0')]&&_0x185a67[_0x116a('0xf1')]===_0x116a('0xf2')){delete this[_0x116a('0x2a')][_0x185a67['uniqueid']];this[_0x116a('0xba')](this[_0x116a('0x22')][_0x2eb94a[_0x116a('0xbb')]]);this['voiceQueues'][_0x2eb94a[_0x116a('0xbb')]][_0x116a('0x63')]+=0x1;this[_0x116a('0x22')][_0x2eb94a['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x1998a9=new Hangup(_0x2eb94a,_0x185a67);_0x1998a9[_0x116a('0xb1')]=0x12;_0x1998a9['statedesc']=_0x116a('0xf3');_0x1998a9[_0x116a('0xf4')]=_0x116a('0xf5');ami['emit'](_0x116a('0xf6'),ut[_0x116a('0xf7')](_0x1998a9,_0x116a('0xf8')));this[_0x116a('0xdc')](_0x1998a9,_0x116a('0xf9'),_0x116a('0xfa'));}if(_0x2eb94a[_0x116a('0x54')]!=='ivr'&&this[_0x116a('0x22')][_0x2eb94a[_0x116a('0xbb')]][_0x116a('0xf0')]&&_0x185a67[_0x116a('0xf1')]===_0x116a('0xfb')){var _0x4a2e8c=this;return new BPromise(function(_0x28c6b7,_0x3aa469){delete _0x4a2e8c['uniqueId'][_0x185a67[_0x116a('0xea')]];_0x4a2e8c[_0x116a('0xba')](_0x4a2e8c['voiceQueues'][_0x2eb94a[_0x116a('0xbb')]]);_0x4a2e8c[_0x116a('0x22')][_0x2eb94a[_0x116a('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x4a2e8c[_0x116a('0x22')][_0x2eb94a['queue']][_0x116a('0xfc')]+=0x1;var _0x1bd06b=_0x4a2e8c[_0x116a('0x22')][_0x2eb94a[_0x116a('0xbb')]];var _0x5bae6d=new Hangup(_0x2eb94a,_0x185a67);_0x5bae6d[_0x116a('0xb1')]=0x13;_0x5bae6d['statedesc']=_0x116a('0xfd');_0x5bae6d['membername']=_0x116a('0xf5');_0x5bae6d[_0x116a('0xfe')]+=0x1;_0x5bae6d[_0x116a('0xff')]+=0x1;_0x5bae6d[_0x116a('0xf8')]=!![];ami['emit'](_0x116a('0xf6'),ut['buildObj'](_0x5bae6d,_0x116a('0xf8')));_0x4a2e8c['createHistory'](_0x5bae6d)[_0x116a('0xbf')](loggerCatch(_0x116a('0x100')));if(_0x5bae6d[_0x116a('0x101')]+_0x5bae6d[_0x116a('0x102')]+_0x5bae6d[_0x116a('0x103')]+_0x5bae6d[_0x116a('0x104')]+_0x5bae6d[_0x116a('0x105')]+_0x5bae6d[_0x116a('0x106')]+_0x5bae6d[_0x116a('0xfe')]+_0x5bae6d['countagentrejectretry']>=_0x1bd06b[_0x116a('0x107')]){_0x4a2e8c[_0x116a('0x108')](_0x5bae6d,_0x28c6b7,_0x3aa469,_0x116a('0x109'));}else{if(_0x5bae6d[_0x116a('0xfe')]>=_0x1bd06b['dialMachineMaxRetry']){_0x4a2e8c[_0x116a('0x10a')](_0x5bae6d,_0x28c6b7,_0x3aa469,_0x116a('0x10b'));}else{_0x4a2e8c['rescheduleContact']({'active':![],'countmachineretry':_0x5bae6d[_0x116a('0xfe')],'scheduledat':moment()['add'](_0x1bd06b[_0x116a('0x10c')],_0x116a('0x10d'))[_0x116a('0x7e')](_0x116a('0x10e')),'ContactId':_0x5bae6d[_0x116a('0xde')],'ListId':_0x5bae6d[_0x116a('0x10f')],'VoiceQueueId':_0x5bae6d[_0x116a('0x110')]||undefined,'CampaignId':_0x5bae6d['CampaignId']||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x111')));_0x28c6b7({'reschedule':0x1});}}});}if(_0x2eb94a[_0x116a('0x54')]==='ivr'&&this[_0x116a('0x23')][_0x2eb94a[_0x116a('0xbb')]][_0x116a('0xf0')]&&_0x185a67['value']===_0x116a('0xf2')){delete this[_0x116a('0x2a')][_0x185a67[_0x116a('0xea')]];this['updateOriginated'](this[_0x116a('0x23')][_0x2eb94a[_0x116a('0xbb')]]);_0x1998a9=new Hangup(_0x2eb94a,_0x185a67);_0x1998a9['state']=0x12;_0x1998a9[_0x116a('0x112')]=_0x116a('0xf3');_0x1998a9[_0x116a('0xf4')]=_0x116a('0xf5');ami[_0x116a('0x53')]('custom:amd',ut[_0x116a('0xf7')](_0x1998a9,_0x116a('0xf8')));this[_0x116a('0xdc')](_0x1998a9,_0x116a('0x113'),_0x116a('0x114'));}if(_0x2eb94a['type']===_0x116a('0x81')&&this[_0x116a('0x23')][_0x2eb94a[_0x116a('0xbb')]][_0x116a('0xf0')]&&_0x185a67[_0x116a('0xf1')]===_0x116a('0xfb')){var _0x4a2e8c=this;return new BPromise(function(_0xbe4199,_0x40110d){delete _0x4a2e8c['uniqueId'][_0x185a67['uniqueid']];_0x4a2e8c[_0x116a('0xba')](_0x4a2e8c['campaigns'][_0x2eb94a['queue']]);_0x4a2e8c['campaigns'][_0x2eb94a[_0x116a('0xbb')]][_0x116a('0x63')]+=0x1;_0x4a2e8c[_0x116a('0x23')][_0x2eb94a['queue']][_0x116a('0xfc')]+=0x1;var _0x4b141f=_0x4a2e8c[_0x116a('0x23')][_0x2eb94a[_0x116a('0xbb')]];var _0x29f045=new Hangup(_0x2eb94a,_0x185a67);_0x29f045[_0x116a('0xb1')]=0x13;_0x29f045[_0x116a('0x112')]=_0x116a('0xfd');_0x29f045['membername']=_0x116a('0xf5');_0x29f045[_0x116a('0xfe')]+=0x1;_0x29f045[_0x116a('0xff')]+=0x1;_0x29f045[_0x116a('0xf8')]=!![];ami[_0x116a('0x53')](_0x116a('0xf6'),ut[_0x116a('0xf7')](_0x29f045,'amd'));_0x4a2e8c[_0x116a('0xd5')](_0x29f045)[_0x116a('0xbf')](loggerCatch(_0x116a('0x100')));if(_0x29f045[_0x116a('0x101')]+_0x29f045[_0x116a('0x102')]+_0x29f045[_0x116a('0x103')]+_0x29f045[_0x116a('0x104')]+_0x29f045[_0x116a('0x105')]+_0x29f045[_0x116a('0x106')]+_0x29f045[_0x116a('0xfe')]+_0x29f045['countagentrejectretry']>=_0x4b141f[_0x116a('0x107')]){_0x4a2e8c[_0x116a('0x108')](_0x29f045,_0xbe4199,_0x40110d,_0x116a('0x109'));}else{if(_0x29f045['countmachineretry']>=_0x4b141f[_0x116a('0x115')]){_0x4a2e8c['createStateFinal'](_0x29f045,_0xbe4199,_0x40110d,_0x116a('0x10b'));}else{_0x4a2e8c[_0x116a('0xca')]({'active':![],'countmachineretry':_0x29f045[_0x116a('0xfe')],'scheduledat':moment()[_0x116a('0x116')](_0x4b141f[_0x116a('0x10c')],_0x116a('0x10d'))[_0x116a('0x7e')](_0x116a('0x10e')),'ContactId':_0x29f045[_0x116a('0xde')],'ListId':_0x29f045[_0x116a('0x10f')],'VoiceQueueId':_0x29f045[_0x116a('0x110')]||undefined,'CampaignId':_0x29f045[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x111')));_0xbe4199({'reschedule':0x1});}}});}}};Dialer[_0x116a('0x1f')][_0x116a('0x39')]=function(_0x1b3bf6){var _0xdb22e4=this[_0x116a('0x2a')][_0x1b3bf6[_0x116a('0xea')]];var _0x228298=this;var _0x352d0b;if(_0xdb22e4&&_0xdb22e4[_0x116a('0x54')]===_0x116a('0x81')){delete this['uniqueId'][_0x1b3bf6[_0x116a('0xea')]];this[_0x116a('0xba')](this['campaigns'][_0xdb22e4[_0x116a('0xbb')]]);this[_0x116a('0x23')][_0xdb22e4[_0x116a('0xbb')]]['ivrAnswerCallsDay']+=0x1;_0x352d0b=new Hangup(_0xdb22e4,_0x1b3bf6);this[_0x116a('0xd5')](_0x352d0b)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x116a('0xd3')](_0x352d0b)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0xdb22e4&&_0xdb22e4[_0x116a('0x54')]!==_0x116a('0x81')&&isNotNull(this[_0x116a('0x22')][_0xdb22e4[_0x116a('0xbb')]]['dialQueueProject'])){delete this[_0x116a('0x2a')][_0x1b3bf6[_0x116a('0xea')]];this[_0x116a('0xba')](this['voiceQueues'][_0xdb22e4[_0x116a('0xbb')]]);this[_0x116a('0x22')][_0xdb22e4[_0x116a('0xbb')]][_0x116a('0x63')]+=0x1;this['voiceQueues'][_0xdb22e4[_0x116a('0xbb')]][_0x116a('0xfc')]+=0x1;_0x352d0b=new Hangup(_0xdb22e4,_0x1b3bf6);_0x352d0b[_0x116a('0xb1')]=0x10;_0x352d0b[_0x116a('0x112')]=_0x116a('0x117');_0x352d0b['membername']=_0x116a('0x118');this[_0x116a('0xd5')](_0x352d0b)[_0x116a('0xbf')](loggerCatch(_0x116a('0x119')));this['moveContactManagedDialer'](_0x352d0b)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0xdb22e4&&_0xdb22e4['type']!==_0x116a('0x81')&&!isNotNull(this[_0x116a('0x22')][_0xdb22e4[_0x116a('0xbb')]][_0x116a('0x11a')])){delete this[_0x116a('0x2a')][_0x1b3bf6[_0x116a('0xea')]];this[_0x116a('0xba')](this[_0x116a('0x22')][_0xdb22e4[_0x116a('0xbb')]]);this['voiceQueues'][_0xdb22e4[_0x116a('0xbb')]][_0x116a('0x11b')]+=0x1;_0x352d0b=new Hangup(_0xdb22e4,_0x1b3bf6);_0x352d0b['state']=0xc;_0x352d0b[_0x116a('0x112')]=_0x1b3bf6[_0x116a('0x11c')];_0x352d0b[_0x116a('0xf4')]=_0x116a('0x11d');this[_0x116a('0xd5')](_0x352d0b)[_0x116a('0xbf')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x352d0b)[_0x116a('0xbf')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x116a('0x1f')][_0x116a('0x36')]=function(_0x51f831){var _0xf4318=this[_0x116a('0x2a')][_0x51f831[_0x116a('0xea')]];var _0x8a3385=this;if(this[_0x116a('0x22')][_0x51f831[_0x116a('0xbb')]]){if(_0xf4318&&_0xf4318[_0x116a('0x54')]!==_0x116a('0x81')){delete this[_0x116a('0x2a')][_0x51f831[_0x116a('0xea')]];this['voiceQueues'][_0x51f831[_0x116a('0xbb')]][_0x116a('0x63')]+=0x1;var _0x42bb81=new AgentComplete(_0xf4318,_0x51f831);if(_0x51f831[_0x116a('0x11e')]==='agent'){_0x42bb81[_0x116a('0x11f')]=this[_0x116a('0x22')][_0x51f831['queue']][_0x116a('0x120')]&&this[_0x116a('0x22')][_0x51f831['queue']]['dialAgiAfterHangupAgent']?moment()['format'](_0x116a('0x10e')):undefined;}this[_0x116a('0xd5')](_0x42bb81)[_0x116a('0xbf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x116a('0xd3')](_0x42bb81)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x116a('0x1f')]['syncAgentConnect']=function(_0x3972ea){if(this['voiceQueues'][_0x3972ea[_0x116a('0xbb')]]){if(this[_0x116a('0x2a')][_0x3972ea[_0x116a('0xea')]]&&this['uniqueId'][_0x3972ea[_0x116a('0xea')]][_0x116a('0x54')]!=='ivr'){this['updateOriginated'](this[_0x116a('0x22')][_0x3972ea[_0x116a('0xbb')]]);this[_0x116a('0x2a')][_0x3972ea['uniqueid']][_0x116a('0x121')]=moment()[_0x116a('0x7e')](_0x116a('0x10e'));}}};Dialer[_0x116a('0x1f')][_0x116a('0x122')]=function(_0x4ec275,_0x4a01e3){this[_0x116a('0xd5')](_0x4ec275)[_0x116a('0xbf')](loggerCatch(_0x116a('0x123')));if(_0x4a01e3==0x0){this['moveContactManagedDialer'](_0x4ec275)[_0x116a('0xbf')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x116a('0x1f')][_0x116a('0x31')]=function(_0xe977d6){var _0x8f90e=this[_0x116a('0x2a')][_0xe977d6[_0x116a('0xea')]];var _0x19e125=this;var _0xbb1049=![];var _0x48e9b3;var _0x20f909;if(this[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]]){if(_0x8f90e&&_0x8f90e[_0x116a('0x54')]!==_0x116a('0x81')){delete this[_0x116a('0x2a')][_0xe977d6[_0x116a('0xea')]];this[_0x116a('0xba')](this[_0x116a('0x22')][_0xe977d6['queue']]);_0x8f90e[_0x116a('0x124')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3a46bd=new QueueCallerAbandon(_0x8f90e,_0xe977d6);if(getSeconds(_0x8f90e[_0x116a('0x124')],_0x8f90e[_0x116a('0x125')])>=_0x8f90e['dialQueueTimeout']){this['voiceQueues'][_0xe977d6[_0x116a('0xbb')]][_0x116a('0x71')]+=0x1;this[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]][_0x116a('0x68')]+=0x1;this['voiceQueues'][_0xe977d6[_0x116a('0xbb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x3a46bd[_0x116a('0xb1')]=0xa;_0x3a46bd['statedesc']='Drop';_0x3a46bd[_0x116a('0x126')]=_0x116a('0x127');_0x3a46bd[_0x116a('0x11f')]=this[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]]['dialQueueProject2']?moment()[_0x116a('0x7e')](_0x116a('0x10e')):undefined;_0x3a46bd[_0x116a('0x105')]+=0x1;_0x3a46bd[_0x116a('0xff')]+=0x1;_0x48e9b3=this[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]]['dialDropRetryFrequency'];_0x20f909=this['voiceQueues'][_0xe977d6[_0x116a('0xbb')]][_0x116a('0x128')];_0x19e125[_0x116a('0xc3')](_0x3a46bd,_0x3a46bd[_0x116a('0xb1')],_0x8f90e[_0x116a('0x129')])['then'](function(_0x287a86){_0xbb1049=_0x287a86[_0x116a('0x12a')]==0x1;if(_0x3a46bd[_0x116a('0x105')]>=_0x19e125[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]][_0x116a('0x12b')]){_0x19e125[_0x116a('0x122')](_0x3a46bd,_0x287a86[_0x116a('0x12a')]);}else{_0x19e125[_0x116a('0xca')]({'active':![],'countdropretry':_0x3a46bd[_0x116a('0x105')],'scheduledat':moment()[_0x116a('0x116')](_0x19e125['voiceQueues'][_0xe977d6['queue']][_0x116a('0x12c')],_0x116a('0x10d'))[_0x116a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x8f90e[_0x116a('0xde')],'ListId':_0x8f90e[_0x116a('0x10f')],'VoiceQueueId':_0x8f90e['VoiceQueueId']||undefined,'CampaignId':_0x8f90e['CampaignId']||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x12d')));var _0x142289=new History(_0x3a46bd);_0x142289[_0x116a('0xb1')]=0xa;_0x142289[_0x116a('0x112')]=_0x116a('0x12e');_0x142289['starttime']=moment()['format'](_0x116a('0x10e'));_0x142289[_0x116a('0xb2')]=_0x142289[_0x116a('0x12f')];_0x142289['calleridname']=_0x3a46bd[_0x116a('0x130')];_0x142289['calleridnum']=_0x3a46bd['calleridnum'];_0x19e125[_0x116a('0xd5')](_0x142289)['catch'](loggerCatch(_0x116a('0x131')));}})[_0x116a('0x43')](function(_0x3ec79d){if(_0xbb1049)_0x19e125['swapAdditionalPhones'](_0x3a46bd,_0x48e9b3,_0x20f909)[_0x116a('0x43')](function(_0x5e4767){return 0x1;});});}else{this['voiceQueues'][_0xe977d6[_0x116a('0xbb')]][_0x116a('0x70')]+=0x1;this[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]][_0x116a('0x67')]+=0x1;_0x3a46bd['state']=0xb;_0x3a46bd['statedesc']=_0x116a('0x132');_0x3a46bd[_0x116a('0x126')]=_0x116a('0x133');_0x3a46bd[_0x116a('0x106')]+=0x1;_0x3a46bd[_0x116a('0xff')]+=0x1;_0x48e9b3=this['voiceQueues'][_0xe977d6['queue']][_0x116a('0x134')];_0x20f909=this[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]]['callAdditionalPhoneAfterMin'];_0x19e125[_0x116a('0xc3')](_0x3a46bd,_0x3a46bd[_0x116a('0xb1')],_0x8f90e[_0x116a('0x129')])['then'](function(_0x506862){if(_0x3a46bd[_0x116a('0x106')]>=_0x19e125['voiceQueues'][_0xe977d6[_0x116a('0xbb')]]['dialAbandonedMaxRetry']){_0x19e125[_0x116a('0x122')](_0x3a46bd,_0x506862[_0x116a('0x12a')]);}else{_0x19e125[_0x116a('0xca')]({'active':![],'countabandonedretry':_0x3a46bd[_0x116a('0x106')],'scheduledat':moment()[_0x116a('0x116')](_0x19e125[_0x116a('0x22')][_0xe977d6[_0x116a('0xbb')]][_0x116a('0x134')],_0x116a('0x10d'))['format'](_0x116a('0x10e')),'ContactId':_0x8f90e[_0x116a('0xde')],'ListId':_0x8f90e[_0x116a('0x10f')],'VoiceQueueId':_0x8f90e[_0x116a('0x110')]||undefined,'CampaignId':_0x8f90e[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x135')));var _0x49422d=new History(_0x3a46bd);_0x49422d[_0x116a('0xb1')]=0xb;_0x49422d[_0x116a('0x112')]=_0x116a('0x132');_0x49422d[_0x116a('0x12f')]=moment()[_0x116a('0x7e')](_0x116a('0x10e'));_0x49422d['endtime']=_0x49422d[_0x116a('0x12f')];_0x49422d[_0x116a('0x130')]=_0x3a46bd[_0x116a('0x130')];_0x49422d[_0x116a('0x136')]=_0x3a46bd[_0x116a('0x136')];_0x19e125[_0x116a('0xd5')](_0x49422d)[_0x116a('0xbf')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x116a('0x43')](function(_0x59dd17){if(_0xbb1049)_0x19e125[_0x116a('0xc5')](_0x3a46bd,_0x48e9b3,_0x20f909)['then'](function(_0x2fe953){return 0x1;});});}}}};Dialer[_0x116a('0x1f')][_0x116a('0x3b')]=function(_0x480a87){if(this[_0x116a('0x28')][_0x480a87[_0x116a('0xea')]]){this[_0x116a('0x28')][_0x480a87[_0x116a('0xea')]]['channel']=_0x480a87['channel'];}if(this[_0x116a('0x2a')][_0x480a87['uniqueid']]){this[_0x116a('0x2a')][_0x480a87[_0x116a('0xea')]][_0x116a('0x137')]=_0x480a87['channel'];}};Dialer[_0x116a('0x1f')]['syncQueueMember']=function(_0x4e52f5){if(strategy[this[_0x116a('0x22')][this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]][_0x116a('0xbb')]][_0x116a('0x55')]]===_0x116a('0x139')){if(this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]]&&_[_0x116a('0xeb')](this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]]['locked'])&&_0x4e52f5[_0x116a('0xb8')]==='1'&&_0x4e52f5['paused']==='0'){if(this['agents'][_0x4e52f5[_0x116a('0x13a')]]){if(!this[_0x116a('0x24')][_0x4e52f5['stateinterface']][_0x116a('0x13b')]){this['agents'][_0x4e52f5[_0x116a('0x13a')]][_0x116a('0x13b')]=!![];this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]]['locked']=!![];this[_0x116a('0x28')][_0x4e52f5['actionid']][_0x116a('0x13a')]=_0x4e52f5[_0x116a('0x13a')];}}}}else if((strategy[this[_0x116a('0x22')][this['actions'][_0x4e52f5[_0x116a('0x138')]]['queue']]['strategy']]||'rrmemory')==='rrmemory'){if(this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]]){if(this[_0x116a('0x24')][_0x4e52f5[_0x116a('0x13a')]]){this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]][_0x116a('0x13a')]=_0x4e52f5[_0x116a('0x13a')];if(_[_0x116a('0xeb')](this['queueBooked'][this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]][_0x116a('0xbb')]])){this[_0x116a('0x13c')][this['actions'][_0x4e52f5[_0x116a('0x138')]][_0x116a('0xbb')]]=[];}this[_0x116a('0x13c')][this[_0x116a('0x28')][_0x4e52f5[_0x116a('0x138')]][_0x116a('0xbb')]][_0x116a('0x13d')](_[_0x116a('0x94')](_['pick'](this[_0x116a('0x28')][_0x4e52f5['actionid']],[_0x116a('0x13e'),'stateinterface']),{'status':_0x4e52f5[_0x116a('0xb8')],'paused':_0x4e52f5[_0x116a('0x13f')]}));}}}};function unlockQueueStatus(_0x4458fb,_0x4ef63c){setTimeout(function(){if(_[_0x116a('0x45')](_0x4458fb[_0x116a('0x140')])){loggerBooked[_0x116a('0x9d')](_0x116a('0x141'),_0x4ef63c);}_0x4458fb[_0x116a('0x140')]=!![];loggerBooked[_0x116a('0x87')](_0x116a('0x142'),_0x4ef63c,JSON[_0x116a('0x4f')](_['pick'](_0x4458fb,[_0x116a('0x49'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x1d427b){var _0x5dfeea=this;var _0x1f4d50=_0x5dfeea[_0x116a('0x22')][_0x5dfeea[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]];if(strategy[this[_0x116a('0x22')][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]][_0x116a('0x55')]]===_0x116a('0x139')){if(this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]]&&this[_0x116a('0x28')][_0x1d427b['actionid']][_0x116a('0x13a')]){this[_0x116a('0x99')][_0x116a('0x143')](this['actions'][_0x1d427b[_0x116a('0x138')]][_0x116a('0x13e')],this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0x13a')])[_0x116a('0xbf')](function(_0x178fd5){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x116a('0x9e')](_0x178fd5,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5dfeea[_0x116a('0xba')](_0x5dfeea[_0x116a('0x22')][_0x5dfeea['actions'][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]]);_0x5dfeea[_0x116a('0x24')][_0x5dfeea['actions'][_0x1d427b[_0x116a('0x138')]][_0x116a('0x13a')]][_0x116a('0x13b')]=![];delete _0x5dfeea['actions'][_0x1d427b[_0x116a('0x138')]];unlockQueueStatus(_0x1f4d50);});}else{this[_0x116a('0xba')](this[_0x116a('0x22')][this[_0x116a('0x28')][_0x1d427b['actionid']][_0x116a('0xbb')]]);this[_0x116a('0xca')]({'active':![],'ContactId':this[_0x116a('0x28')][_0x1d427b['actionid']][_0x116a('0xde')],'ListId':this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0x10f')],'VoiceQueueId':this['actions'][_0x1d427b[_0x116a('0x138')]][_0x116a('0x110')]||undefined,'CampaignId':this['actions'][_0x1d427b['actionid']]['CampaignId']||undefined})[_0x116a('0xbf')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x116a('0x28')][_0x1d427b['actionid']];unlockQueueStatus(_0x1f4d50);}}else if((strategy[this[_0x116a('0x22')][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]][_0x116a('0x55')]]||_0x116a('0x1e'))===_0x116a('0x1e')){var _0x1529f7;if(this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]]&&!_['isEmpty'](this['queueBooked'][this[_0x116a('0x28')][_0x1d427b['actionid']][_0x116a('0xbb')]])){if(this[_0x116a('0x2e')][_0x5dfeea['actions'][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]]){this[_0x116a('0x2e')][_0x5dfeea[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]]['queue']]=this[_0x116a('0x2e')][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]]?this[_0x116a('0x2e')][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]]:this[_0x116a('0x13c')][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]]?this[_0x116a('0x13c')][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]][_0x116a('0x144')]||0x0:0x0;}this['queueBooked'][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]][_0x116a('0x144')]=this[_0x116a('0x2e')][this[_0x116a('0x28')][_0x1d427b[_0x116a('0x138')]][_0x116a('0xbb')]];for(var _0x4d0457=0x0;_0x4d0457=0x0;})[_0x116a('0xbf')](myreject(_0x263d4b)));}}else{_0x30207e[_0x116a('0x13d')](ami[_0x116a('0xb7')]({'action':_0x116a('0x15d'),'command':util[_0x116a('0x7e')](_0x116a('0x15e'),_0x2de9f3,!_[_0x116a('0x45')](config['timezones'][_0x201616])?_0x201616:'')})['then'](function(_0x526ae9){return _0x526ae9[_0x116a('0x160')][_0x116a('0x161')](_0x116a('0x162'))>=0x0;})['catch'](myreject(_0x263d4b)));}BPromise[_0x116a('0x163')](_0x30207e)['then'](function(_0x2e61cb){var _0x505a2e=_[_0x116a('0x164')](_0x2e61cb);if(_0x505a2e){return _0x9ed2f4(_0x505a2e);}else{_0x1c0950[_0x116a('0x46')]=_0x5d2e21?_0x116a('0x165'):'INTERVAL_IS_OVERTIME';return _0x263d4b(msgResponse(_0x116a('0x166'),_0x116a('0x15a'),_0x116a('0x167')+_0x5d2e21+'\x20'+_0x475909+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x2de9f3,{'showHidden':![],'depth':null})+_0x116a('0x168')+_0x201616));}})[_0x116a('0xbf')](function(_0x359484){return _0x263d4b(msgResponse('ifTime',_0x116a('0x15a'),JSON['stringify'](_0x359484)));});});};Dialer['prototype']['checkDialMethod']=function(_0xf49f65){var _0x524cf1=this;return function(){switch(_0xf49f65['dialMethod']){case _0x116a('0x169'):freeVariablesPredictive(_0xf49f65);_0x524cf1[_0x116a('0x16a')](_0xf49f65,0x1);break;case _0x116a('0x16b'):freeVariablesPredictive(_0xf49f65);_0x524cf1[_0x116a('0x16a')](_0xf49f65,_0xf49f65[_0x116a('0x16c')]);break;case'predictive':_0x524cf1[_0x116a('0x16d')](_0xf49f65);break;case _0x116a('0x9'):freeVariablesPredictive(_0xf49f65);_0x524cf1['handlePower'](_0xf49f65,0x1);break;default:freeVariablesPredictive(_0xf49f65);logger[_0x116a('0x9d')]('Queue',_0xf49f65[_0x116a('0x49')],_0x116a('0x16e'));}};};Dialer[_0x116a('0x1f')][_0x116a('0x16f')]=function(_0x131cf9){return BPromise[_0x116a('0xbe')]()[_0x116a('0x43')](cmHopper[_0x116a('0x170')](_0x131cf9['id'],previewRecallmeReminderInterval))[_0x116a('0x43')](function(_0xc0fc61){for(var _0x3a625b=0x0;_0x3a625b<_0xc0fc61['length'];_0x3a625b++){var _0x181bcf=_0xc0fc61[_0x3a625b][_0x116a('0x171')][_0x116a('0x49')];if(_0x181bcf)io['to'](util[_0x116a('0x7e')](_0x116a('0x172'),_0x181bcf))[_0x116a('0x53')]('user:dialPreviewRecallReminder',{'hopper':_0xc0fc61[_0x3a625b]});}})[_0x116a('0xbf')](function(_0x44698a){});};Dialer[_0x116a('0x1f')][_0x116a('0x173')]=function(_0x51626e){var _0x3443b8=this;return function(){_0x3443b8[_0x116a('0x174')](_0x51626e);};};Dialer['prototype'][_0x116a('0xb')]=function(_0x161a92){var _0x3af394=this;if(isNotPreview(_0x161a92[_0x116a('0x61')])){if(isVoiceQueueOutbound(_0x161a92[_0x116a('0x54')])&&isActive(_0x161a92[_0x116a('0x60')])){_0x161a92[_0x116a('0xa9')]=!![];BPromise[_0x116a('0xbe')]()['then'](checkIsLoggedIn(_0x161a92,_0x161a92[_0x116a('0x175')]))[_0x116a('0x43')](checkIsActive(_0x161a92,_0x161a92['dialActive']))[_0x116a('0x43')](checkInterval(_0x161a92))[_0x116a('0x43')](_0x3af394[_0x116a('0x176')](_0x161a92))['then'](_0x3af394[_0x116a('0x177')](_0x161a92[_0x116a('0x178')],_0x161a92['dialTimezone'],_0x161a92[_0x116a('0x49')],_0x161a92))[_0x116a('0x43')](_0x3af394[_0x116a('0x179')](_0x161a92[_0x116a('0x4b')],_0x161a92[_0x116a('0x17a')],_0x161a92['name'],_0x161a92))[_0x116a('0x43')](_0x3af394['checkDialMethod'](_0x161a92))[_0x116a('0xbf')](loggerCatchQueueSummary('[syncQueueSummary]',_0x161a92));}else{notSendMessagesQueue(_0x161a92);}}else{freeVariablesPredictive(_0x161a92);if(_0x161a92[_0x116a('0x17b')]){_0x3af394['checkPreviewRecallReminder'](_0x161a92);}}};Dialer[_0x116a('0x1f')][_0x116a('0x151')]=function(){var _0x50bfb8=this;var _0x557154;for(var _0xf3f8b3 in this[_0x116a('0x23')]){if(typeof this[_0x116a('0x23')][_0xf3f8b3]!=='undefined'){_0x557154=this[_0x116a('0x23')][_0xf3f8b3];if(isCampaignIvr(_0x557154['type'])&&isActive(_0x557154['active'])){_0x557154['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x116a('0x43')](checkIsActive(_0x557154,_0x557154[_0x116a('0x7d')]))['then'](checkInterval(_0x557154))['then'](_0x50bfb8[_0x116a('0x176')](_0x557154))[_0x116a('0x43')](_0x50bfb8[_0x116a('0x177')](_0x557154[_0x116a('0x178')],_0x557154['dialTimezone'],_0x557154[_0x116a('0x49')],_0x557154))[_0x116a('0x43')](_0x50bfb8[_0x116a('0x179')](_0x557154[_0x116a('0x4b')],_0x557154['dialTimezone'],_0x557154['name'],_0x557154))[_0x116a('0x43')](_0x50bfb8[_0x116a('0x173')](_0x557154))['catch'](loggerCatchQueueSummary(_0x116a('0x17c'),_0x557154));}else{notSendMessagesCampaign(_0x557154);}}}};function getCallerIdRandom(_0x525309,_0x3899f5){var _0x1ade87;var _0x533c1b;var _0x305031;if(_0x3899f5<=0x0){_0x3899f5=0x1;}_0x1ade87=new RegExp(_0x116a('0x17d')+_0x3899f5+'}$');_0x533c1b=Math[_0x116a('0x17e')](0xa,_0x3899f5-0x1);_0x305031=Math[_0x116a('0x17e')](0xa,_0x3899f5)-0x1;return util['format']('%s',_['replace'](_0x525309,_0x1ade87,_['random'](_0x533c1b,_0x305031)));}function extractCalleridName(_0x2be821){var _0x447756=_0x2be821[_0x116a('0x17f')](/"(.*?)"/);return _0x447756?_0x447756[0x1]:_0x2be821;}function extractCalleridNumber(_0x456b18){var _0x104212=_0x456b18[_0x116a('0x17f')](/<(.*?)>/);return _0x104212?_0x104212[0x1]:_0x456b18;}Dialer[_0x116a('0x1f')][_0x116a('0x180')]=function(_0x5f3590,_0x272a39){var _0x356158=this;var _0x255245=uuid['v4']();this[_0x116a('0x28')][_0x255245]=new Action(_0x5f3590,_0x272a39,_0x255245);return new BPromise(function(_0x503d57,_0x39bb26){if(_[_0x116a('0x45')](_0x5f3590)&&typeof _0x5f3590!==_0x116a('0x181')){return _0x39bb26(msgResponse(_0x116a('0x182'),'Failure',_0x116a('0x183')));}if(_[_0x116a('0x45')](_0x272a39[_0x116a('0x184')])||_0x272a39[_0x116a('0x184')]===null){return _0x39bb26(msgResponse(_0x116a('0x182'),_0x116a('0x15a'),_0x116a('0x185')));}var _0x5d6e9f={'XMD-CALLERID':_0x356158['actions'][_0x255245][_0x116a('0x186')](),'XMD-AGI':_0x5f3590[_0x116a('0x11a')]?util[_0x116a('0x7e')](_0x116a('0x187'),ipAgi,_0x5f3590[_0x116a('0x11a')]):_0x116a('0x188'),'XMD-AGIAFTER':_0x5f3590[_0x116a('0x120')]?util[_0x116a('0x7e')](_0x116a('0x187'),ipAgi,_0x5f3590[_0x116a('0x120')]):'NONE','XMD-QUEUE':_0x5f3590[_0x116a('0x54')]==='outbound'?util['format'](_0x116a('0x189'),_0x5f3590['name'],_0x5f3590[_0x116a('0x18a')]||'',_0x5f3590[_0x116a('0x18b')]?'c':'',_0x5f3590[_0x116a('0x18c')]||0x3):_0x116a('0x188'),'XMD-CONTACTID':_0x272a39['ContactId'],'XMD-CDRTYPE':_0x116a('0x8'),'CALLERID(all)':_0x356158[_0x116a('0x28')][_0x255245][_0x116a('0x186')](),'XMD-AMD':_0x5f3590[_0x116a('0xf0')]?'ACTIVE':_0x116a('0x188'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x5f3590[_0x116a('0xf0')]){_0x5d6e9f[_0x116a('0x18d')]=_0x5f3590[_0x116a('0x18e')]||0x9c4;_0x5d6e9f['XMD-AMDGREETING']=_0x5f3590[_0x116a('0x18f')]||0x5dc;_0x5d6e9f[_0x116a('0x190')]=_0x5f3590['dialAMDAfterGreetingSilence']||0x320;_0x5d6e9f[_0x116a('0x191')]=_0x5f3590[_0x116a('0x192')]||0x1388;_0x5d6e9f[_0x116a('0x193')]=_0x5f3590[_0x116a('0x194')]||0x64;_0x5d6e9f['XMD-AMDBETWEENWORDSSILENCE']=_0x5f3590['dialAMDBetweenWordsSilence']||0x32;_0x5d6e9f['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x5f3590[_0x116a('0x195')]||0x3;_0x5d6e9f[_0x116a('0x196')]=_0x5f3590[_0x116a('0x197')]||0x100;_0x5d6e9f[_0x116a('0x198')]=_0x5f3590[_0x116a('0x199')]||0x1388;}if(_0x5f3590[_0x116a('0x54')]===_0x116a('0x19a')){_0x5d6e9f['XMD-VOICEQUEUEID']=_0x272a39[_0x116a('0x110')];}else{_0x5d6e9f[_0x116a('0x19b')]=_0x272a39['CampaignId'];}for(var _0x42c117 in _0x272a39[_0x116a('0x19c')]){if(typeof _0x272a39[_0x116a('0x19c')][_0x42c117]!==_0x116a('0xa1')){if(isNotNull(_0x272a39['Contact'][_0x42c117])&&_0x42c117!=='id'&&_0x42c117!=='tags'&&_0x42c117!==_0x116a('0x19d')&&_0x42c117!==_0x116a('0x19e')){_0x5d6e9f[util[_0x116a('0x7e')](_0x116a('0x19f'),_0x116a('0x1a0'),_[_0x116a('0x1a1')](_0x42c117))]=_0x272a39[_0x116a('0x19c')][_0x42c117];}}}var _0x3750f1=_0x356158[_0x116a('0xe5')](_0x5f3590[_0x116a('0x7c')])?getCallerId(_0x5f3590[_0x116a('0x7c')][_0x116a('0x1a2')],_0x5f3590[_0x116a('0x1a3')],_0x5f3590[_0x116a('0x1a4')]>0x0?getCallerIdRandom(_0x5f3590['dialOriginateCallerIdNumber'],_0x5f3590['dialRandomLastDigitCallerIdNumber']):_0x5f3590[_0x116a('0x1a5')]):getCallerId(_[_0x116a('0xeb')](_0x5f3590['TrunkBackup'])?_0x5f3590['Trunk']['callerid']:_0x5f3590[_0x116a('0x152')][_0x116a('0x1a2')],_0x5f3590[_0x116a('0x1a3')],_0x5f3590[_0x116a('0x1a4')]>0x0?getCallerIdRandom(_0x5f3590['dialOriginateCallerIdNumber'],_0x5f3590[_0x116a('0x1a4')]):_0x5f3590[_0x116a('0x1a5')]);if(_0x3750f1){_0x5d6e9f['XMD-ORIGINATECALLERIDNAME']=_0x356158[_0x116a('0x28')][_0x255245]['originatecalleridname']=extractCalleridName(_0x3750f1);_0x5d6e9f[_0x116a('0x1a6')]=_0x272a39[_0x116a('0x184')];}return ami[_0x116a('0xb7')]({'actionid':_0x255245,'action':'originate','channel':_0x356158[_0x116a('0xe5')](_0x5f3590[_0x116a('0x7c')])?util[_0x116a('0x7e')](_0x116a('0x1a7'),_0x5f3590[_0x116a('0x7c')]['name'],isNotNull(_0x5f3590[_0x116a('0x1a8')])?_0x5f3590[_0x116a('0x1a8')][_0x116a('0x1a9')]()||'':'',_0x5f3590[_0x116a('0x1aa')]>0x0?_0x272a39[_0x116a('0x184')][_0x116a('0x1ab')](_0x5f3590[_0x116a('0x1aa')]):_0x272a39[_0x116a('0x184')]):util['format']('SIP/%s/%s%s',_[_0x116a('0xeb')](_0x5f3590[_0x116a('0x152')])?_0x5f3590[_0x116a('0x7c')][_0x116a('0x49')]:_0x5f3590['TrunkBackup'][_0x116a('0x49')],isNotNull(_0x5f3590['dialPrefix'])?_0x5f3590['dialPrefix'][_0x116a('0x1a9')]()||'':'',_0x5f3590[_0x116a('0x1aa')]>0x0?_0x272a39[_0x116a('0x184')][_0x116a('0x1ab')](_0x5f3590['dialCutDigit']):_0x272a39['phone']),'callerid':_0x3750f1,'Exten':_0x116a('0xef'),'Context':_0x116a('0x1ac'),'Priority':'1','variable':_0x5d6e9f,'timeout':(_0x5f3590['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x255245})[_0x116a('0x43')](function(_0x4d8d5a){return _0x503d57(_0x4d8d5a);})[_0x116a('0xbf')](function(_0x686b49){_0x5f3590['outboundOriginateFailureCallsDay']+=0x1;var _0x104037=new History(_0x356158['actions'][_0x255245]);logger[_0x116a('0x9d')](util[_0x116a('0x7e')](_0x116a('0x1ad'),JSON[_0x116a('0x4f')](_0x686b49)));_0x104037['state']=0xe;_0x104037[_0x116a('0x112')]=_0x116a('0x1ae');_0x104037['starttime']=moment()[_0x116a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x104037[_0x116a('0xb2')]=_0x104037[_0x116a('0x12f')];_0x356158[_0x116a('0xd5')](_0x104037)[_0x116a('0xbf')](loggerCatch(_0x116a('0x1af')));_0x356158[_0x116a('0xd3')](_0x104037)[_0x116a('0xbf')](loggerCatch('[originate][error]'))[_0x116a('0x14a')](function(){delete _0x356158[_0x116a('0x28')][_0x255245];return _0x39bb26(msgResponse('originate',_0x116a('0x4e'),'originate\x20action\x20Error'));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x5db9d2){var _0x2ae3f1=this['actions'][_0x5db9d2[_0x116a('0x138')]];if(_0x2ae3f1){delete this[_0x116a('0x28')][_0x5db9d2[_0x116a('0x138')]];_0x2ae3f1[_0x116a('0x125')]=moment()['format'](_0x116a('0x10e'));var _0x317b95=_0x2ae3f1[_0x116a('0x54')]==='ivr'?this[_0x116a('0x23')][_0x2ae3f1[_0x116a('0xbb')]]:this['voiceQueues'][_0x2ae3f1['getQueue']()];if(!this[_0x116a('0xe3')](_0x5db9d2[_0x116a('0x1b0')])){this[_0x116a('0xba')](_0x317b95);return this[_0x116a('0x1b1')](_0x2ae3f1,_0x317b95,_0x5db9d2)[_0x116a('0xbf')](loggerCatch(_0x116a('0x1b2')));}this['uniqueId'][_0x5db9d2[_0x116a('0xea')]]=_0x2ae3f1;}};Dialer[_0x116a('0x1f')]['checkRetriveMax']=function(_0x1f33e3,_0xcc671d,_0x1e438a){var _0x325491=new History(_0xcc671d);if(_0x325491[_0x116a('0x101')]+_0x325491['countcongestionretry']+_0x325491[_0x116a('0x103')]+_0x325491['countnosuchnumberretry']+_0x325491['countdropretry']+_0x325491['countabandonedretry']+_0x325491[_0x116a('0xfe')]+_0x325491['countagentrejectretry']>=_0x1e438a[_0x116a('0x107')]-0x1){return!![];}switch(_0x1f33e3){case 0x3:if(_0x325491[_0x116a('0x103')]>=_0x1e438a[_0x116a('0x1b3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x325491[_0x116a('0x103')]+=0x1,'scheduledat':moment()[_0x116a('0x116')](_0x1e438a[_0x116a('0x1b4')],_0x116a('0x10d'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x325491[_0x116a('0xde')],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491['VoiceQueueId']||undefined,'CampaignId':_0x325491[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x1b5')));break;case 0x5:if(_0x325491['countbusyretry']>=_0x1e438a[_0x116a('0x1b6')]-0x1){return!![];}this[_0x116a('0xca')]({'active':![],'countbusyretry':_0x325491[_0x116a('0x101')]+=0x1,'scheduledat':moment()[_0x116a('0x116')](_0x1e438a[_0x116a('0x1b7')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x325491['ContactId'],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491[_0x116a('0x110')]||undefined,'CampaignId':_0x325491[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x1b8')));break;case 0x8:if(_0x325491['countcongestionretry']>=_0x1e438a[_0x116a('0x1b9')]-0x1){return!![];}this[_0x116a('0xca')]({'active':![],'countcongestionretry':_0x325491['countcongestionretry']+=0x1,'scheduledat':moment()[_0x116a('0x116')](_0x1e438a[_0x116a('0x1ba')],_0x116a('0x10d'))[_0x116a('0x7e')](_0x116a('0x10e')),'ContactId':_0x325491['ContactId'],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491[_0x116a('0x110')]||undefined,'CampaignId':_0x325491[_0x116a('0xe0')]||undefined})['catch'](loggerCatch(_0x116a('0x1bb')));break;case 0x0:if(_0x325491[_0x116a('0x104')]>=_0x1e438a[_0x116a('0x1bc')]-0x1){return!![];}else{this[_0x116a('0xca')]({'active':![],'countnosuchnumberretry':_0x325491[_0x116a('0x104')]+=0x1,'scheduledat':moment()[_0x116a('0x116')](_0x1e438a[_0x116a('0x1bd')],_0x116a('0x10d'))[_0x116a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x325491[_0x116a('0xde')],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491[_0x116a('0x110')]||undefined,'CampaignId':_0x325491[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x1be')));}break;case 0xa:if(_0x325491[_0x116a('0x105')]>=_0x1e438a[_0x116a('0x12b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x325491['countdropretry']+=0x1,'scheduledat':moment()[_0x116a('0x116')](_0x1e438a[_0x116a('0x12c')],'minutes')[_0x116a('0x7e')](_0x116a('0x10e')),'ContactId':_0x325491[_0x116a('0xde')],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491[_0x116a('0x110')]||undefined,'CampaignId':_0x325491[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x12d')));break;case 0xb:if(_0x325491[_0x116a('0x106')]>=_0x1e438a['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x116a('0xca')]({'active':![],'countabandonedretry':_0x325491['countabandonedretry']+=0x1,'scheduledat':moment()[_0x116a('0x116')](_0x1e438a['dialAbandonedRetryFrequency'],'minutes')[_0x116a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x325491[_0x116a('0xde')],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491['VoiceQueueId']||undefined,'CampaignId':_0x325491['CampaignId']||undefined})[_0x116a('0xbf')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x325491[_0x116a('0xfe')]>=_0x1e438a[_0x116a('0x115')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x325491['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x1e438a[_0x116a('0x10c')],_0x116a('0x10d'))[_0x116a('0x7e')](_0x116a('0x10e')),'ContactId':_0x325491[_0x116a('0xde')],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491[_0x116a('0x110')]||undefined,'CampaignId':_0x325491[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x111')));break;case 0x14:if(_0x325491['countagentrejectretry']>=_0x1e438a['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x116a('0xca')]({'active':![],'countagentrejectretry':_0x325491[_0x116a('0x1bf')]+=0x1,'scheduledat':moment()['add'](_0x1e438a[_0x116a('0x1c0')],_0x116a('0x10d'))[_0x116a('0x7e')](_0x116a('0x10e')),'ContactId':_0x325491[_0x116a('0xde')],'ListId':_0x325491[_0x116a('0x10f')],'VoiceQueueId':_0x325491[_0x116a('0x110')]||undefined,'CampaignId':_0x325491[_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x1c1')));break;default:return!![];}};Dialer[_0x116a('0x1f')][_0x116a('0x1b1')]=function(_0xbba9f4,_0x23d271,_0x2c8963){var _0x5d5739=this;var _0x44da84=new History(_0xbba9f4);var _0x5c9083=![];var _0x34573f;var _0x391ab3;return new BPromise(function(_0x32ce54,_0x349280){if(_[_0x116a('0x45')](_0x23d271)&&typeof _0x23d271!==_0x116a('0x181')){return _0x349280(msgResponse(_0x116a('0x1c2'),_0x116a('0x15a'),_0x116a('0x1c3')));}if(_[_0x116a('0x45')](_0x2c8963)&&typeof _0x2c8963!==_0x116a('0x181')){return _0x349280(msgResponse('[callProgressDetecting]',_0x116a('0x15a'),_0x116a('0x1c4')));}_0x5d5739[_0x116a('0xc3')](_0x44da84,_0x2c8963[_0x116a('0x11e')],_0x23d271)[_0x116a('0x43')](function(_0x5722b6){if(_0x5722b6[_0x116a('0x12a')]==0x1)_0x5c9083=!![];switch(_0x2c8963['reason']){case'0':_0x23d271[_0x116a('0x6a')]+=0x1;_0x44da84[_0x116a('0xb1')]=0x0;_0x44da84[_0x116a('0x112')]=_0x116a('0x1c5');_0x44da84[_0x116a('0x104')]+=0x1;_0x44da84[_0x116a('0xff')]+=0x1;ami[_0x116a('0x53')](_0x116a('0x1c6'),ut['buildObj'](_0xbba9f4,_0x116a('0x1c7')));_0x34573f=_0x23d271[_0x116a('0x1bd')];_0x391ab3=_0x23d271[_0x116a('0x128')];_0x5d5739[_0x116a('0xd5')](_0x44da84)[_0x116a('0xbf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5d5739[_0x116a('0x1c8')](0x0,_0xbba9f4,_0x23d271)&&!_0x5c9083){if(_0x44da84[_0x116a('0x104')]>=_0x23d271['dialNoSuchNumberMaxRetry']){_0x5d5739[_0x116a('0x10a')](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1c9'));}else{_0x5d5739[_0x116a('0x108')](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1c9'));}}break;case'3':_0x23d271[_0x116a('0x69')]+=0x1;_0x44da84[_0x116a('0xb1')]=0x3;_0x44da84['statedesc']='NoAnswer';_0x44da84['countnoanswerretry']+=0x1;_0x44da84[_0x116a('0xff')]+=0x1;ami[_0x116a('0x53')](_0x116a('0x1ca'),ut['buildObj'](_0xbba9f4,_0x116a('0x1cb')));_0x34573f=_0x23d271[_0x116a('0x1b4')];_0x391ab3=_0x23d271[_0x116a('0x128')];_0x5d5739['createHistory'](_0x44da84)['catch'](loggerCatch(_0x116a('0x1cc')));if(_0x5d5739['checkRetriveMax'](0x3,_0xbba9f4,_0x23d271)&&!_0x5c9083){if(_0x44da84['countnoanswerretry']>=_0x23d271[_0x116a('0x1b3')]){_0x5d5739['createStateFinal'](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1cd'));}else{_0x5d5739[_0x116a('0x108')](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1cd'));}}break;case'5':_0x23d271[_0x116a('0x65')]+=0x1;_0x44da84[_0x116a('0xb1')]=0x5;_0x44da84[_0x116a('0x112')]=_0x116a('0x1ce');_0x44da84['countbusyretry']+=0x1;_0x44da84['countglobal']+=0x1;ami[_0x116a('0x53')](_0x116a('0x1cf'),ut[_0x116a('0xf7')](_0xbba9f4,_0x116a('0x1d0')));_0x34573f=_0x23d271['dialBusyRetryFrequency'];_0x391ab3=_0x23d271[_0x116a('0x128')];_0x5d5739[_0x116a('0xd5')](_0x44da84)[_0x116a('0xbf')](loggerCatch(_0x116a('0x1d1')));if(_0x5d5739[_0x116a('0x1c8')](0x5,_0xbba9f4,_0x23d271)&&!_0x5c9083){if(_0x44da84[_0x116a('0x101')]>=_0x23d271[_0x116a('0x1b6')]){_0x5d5739[_0x116a('0x10a')](_0x44da84,_0x32ce54,_0x349280,'reason\x205\x20busy');}else{_0x5d5739[_0x116a('0x108')](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1d2'));}}break;case'8':_0x23d271[_0x116a('0x66')]+=0x1;_0x44da84[_0x116a('0xb1')]=0x8;_0x44da84[_0x116a('0x112')]=_0x116a('0x1d3');_0x44da84[_0x116a('0x102')]+=0x1;_0x44da84[_0x116a('0xff')]+=0x1;_0x34573f=_0x23d271[_0x116a('0x1ba')];_0x391ab3=_0x23d271[_0x116a('0x128')];ami[_0x116a('0x53')]('custom:agentcongestion',ut['buildObj'](_0xbba9f4,'congestion'));_0x5d5739['createHistory'](_0x44da84)[_0x116a('0xbf')](loggerCatch(_0x116a('0x1d4')));if(_0x5d5739[_0x116a('0x1c8')](0x8,_0xbba9f4,_0x23d271)&&!_0x5c9083){if(_0x44da84[_0x116a('0x102')]>=_0x23d271[_0x116a('0x1b9')]){_0x5d5739[_0x116a('0x10a')](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1d5'));}else{_0x5d5739[_0x116a('0x108')](_0x44da84,_0x32ce54,_0x349280,'reason\x208\x20congestion');}}break;case'11':_0x23d271['outboundAbandonedCallsDay']+=0x1;_0x44da84['state']=0xb;_0x44da84[_0x116a('0x112')]=_0x116a('0x132');_0x44da84['countabandonedretry']+=0x1;_0x44da84['countglobal']+=0x1;_0x34573f=_0x23d271[_0x116a('0x134')];_0x391ab3=_0x23d271[_0x116a('0x128')];_0x5d5739[_0x116a('0xd5')](_0x44da84)[_0x116a('0xbf')](loggerCatch(_0x116a('0x1d6')));if(_0x5d5739[_0x116a('0x1c8')](0xb,_0xbba9f4,_0x23d271)&&!_0x5c9083){if(_0x44da84['countabandonedretry']>=_0x23d271[_0x116a('0x1d7')]){_0x5d5739[_0x116a('0x10a')](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1d8'));}else{_0x5d5739[_0x116a('0x108')](_0x44da84,_0x32ce54,_0x349280,_0x116a('0x1d8'));}}break;case'20':_0x23d271[_0x116a('0x6d')]+=0x1;_0x44da84['state']=0x14;_0x44da84[_0x116a('0x112')]=_0x116a('0x1d9');_0x44da84[_0x116a('0x1bf')]+=0x1;_0x44da84[_0x116a('0xff')]+=0x1;_0x34573f=_0x23d271[_0x116a('0x1c0')];_0x391ab3=_0x23d271[_0x116a('0x128')];ami[_0x116a('0x53')](_0x116a('0x1da'),ut[_0x116a('0xf7')](_0xbba9f4,_0x116a('0x1db')));_0x5d5739[_0x116a('0xd5')](_0x44da84)[_0x116a('0xbf')](loggerCatch(_0x116a('0x1dc')));if(_0x5d5739[_0x116a('0x1c8')](0x14,_0xbba9f4,_0x23d271)&&!_0x5c9083){if(_0x44da84[_0x116a('0x1bf')]>=_0x23d271[_0x116a('0x1dd')]){_0x5d5739[_0x116a('0x10a')](_0x44da84,_0x32ce54,_0x349280,'reason\x2020\x20agentreject');}else{_0x5d5739[_0x116a('0x108')](_0x44da84,_0x32ce54,_0x349280,'reason\x2020\x20agentreject');}}break;default:_0x23d271[_0x116a('0x11b')]+=0x1;_0x44da84[_0x116a('0xb1')]=0xc;_0x44da84[_0x116a('0x112')]=_0x2c8963[_0x116a('0x11e')];_0x34573f=_0x23d271[_0x116a('0x1c0')];_0x391ab3=_0x23d271[_0x116a('0x128')];_0x5d5739[_0x116a('0xd5')](_0x44da84)['catch'](loggerCatch(_0x116a('0x1de')));if(_0x5d5739['checkRetriveMax'](_0x2c8963[_0x116a('0x11e')],_0xbba9f4,_0x23d271)&&!_0x5c9083){if(_0x44da84[_0x116a('0x101')]+_0x44da84[_0x116a('0x102')]+_0x44da84[_0x116a('0x103')]+_0x44da84[_0x116a('0x104')]+_0x44da84[_0x116a('0x105')]+_0x44da84['countabandonedretry']+_0x44da84['countmachineretry']+_0x44da84[_0x116a('0x1bf')]>=_0x23d271[_0x116a('0x107')]){_0x5d5739[_0x116a('0x108')](_0x44da84,_0x32ce54,_0x349280,_0x2c8963['reason']);}else{_0x5d5739['createStateFinal'](_0x44da84,_0x32ce54,_0x349280,_0x2c8963[_0x116a('0x11e')]);}}}})['then'](function(_0x2742a2){if(_0x5c9083){_0x5d5739[_0x116a('0xc5')](_0x44da84,_0x34573f,_0x391ab3)[_0x116a('0x43')](function(_0x1a3da5){return _0x32ce54(0x1);});}});});};Dialer[_0x116a('0x1f')][_0x116a('0x108')]=function(_0x202edb,_0x200744,_0xa33ed3,_0x25e498){var _0x523f4d=new Final(_0x202edb);_0x523f4d[_0x116a('0xb1')]=0xf;_0x523f4d['statedesc']=_0x116a('0x1df');this['createStateFinal'](_0x523f4d,_0x200744,_0xa33ed3,_0x25e498);};Dialer[_0x116a('0x1f')][_0x116a('0x10a')]=function(_0x255d51,_0x33f743,_0x5d7b78,_0x33bc8a){this['moveContactManagedDialer'](_0x255d51)[_0x116a('0x43')](function(){return _0x33f743(msgResponse(_0x116a('0x1c2'),_0x116a('0xe4'),_0x33bc8a));})[_0x116a('0xbf')](function(){return _0x5d7b78(msgResponse('[moveContactManagedDialer][0]',_0x116a('0x15a'),_0x116a('0x1e0')));});};Dialer[_0x116a('0x1f')][_0x116a('0x16d')]=function(_0xbdac9b){var _0x37800d=_0xbdac9b[_0x116a('0x1e1')]/0x64;var _0x6071b3=_0xbdac9b[_0x116a('0x68')]/(_0xbdac9b[_0x116a('0x68')]+_0xbdac9b['outboundAnswerCallsDay']);var _0x2366b5=Math[_0x116a('0x1e2')](_0xbdac9b[_0x116a('0x1e3')]*(_0xbdac9b[_0x116a('0x1e4')]/0x64));var _0x57e3d0=Math[_0x116a('0x1e2')](_0xbdac9b[_0x116a('0x1e3')]*(_0xbdac9b[_0x116a('0x1e5')]/0x64));var _0x19fc6a=_0xbdac9b[_0x116a('0xab')]+_0xbdac9b[_0x116a('0x5b')];var _0x46ccbe=Math['floor'](_0xbdac9b[_0x116a('0x90')]*_0xbdac9b[_0x116a('0x7a')]*_0xbdac9b[_0x116a('0x74')]*_0xbdac9b[_0x116a('0x75')]);if(_[_0x116a('0x45')](_0xbdac9b['startProgressive'])){if(!_[_0x116a('0x45')](_0xbdac9b[_0x116a('0x2c')])){_0xbdac9b[_0x116a('0x2c')]=undefined;loggerPredictive[_0x116a('0x9d')](_0x116a('0x1e6'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x116a('0x45')](_0xbdac9b['handlePredictive'])){loggerPredictive['error'](_0x116a('0x1e6'),_0x116a('0x1e7'));clearInterval(_0xbdac9b[_0x116a('0x97')]);_0xbdac9b[_0x116a('0x97')]=undefined;}_0xbdac9b[_0x116a('0x2d')]=moment()['format'](_0x116a('0x10e'));loggerPredictive[_0x116a('0x87')](_0xbdac9b[_0x116a('0x49')],'collection\x20data\x20in\x20progressive\x20at',_0xbdac9b['startProgressive']);this[_0x116a('0x16a')](_0xbdac9b,0x1);}else if(ifInterval(_0xbdac9b['dialPredictiveInterval'],_0xbdac9b[_0x116a('0x2d')])){this['handlePower'](_0xbdac9b,0x1);loggerPredictiveCalls['info'](_0x116a('0x1e8'),_0xbdac9b[_0x116a('0x2d')],_0xbdac9b[_0x116a('0x49')]);_0xbdac9b[_0x116a('0x90')]=0x0;_0xbdac9b[_0x116a('0x73')]=0x0;}else if(_0x37800d<_0x6071b3&&_0xbdac9b['dialPredictiveOptimization']===_0x116a('0x1e9')){freeVariablesPredictive(_0xbdac9b);loggerPredictive[_0x116a('0x87')](_0x116a('0x1ea'),_0x116a('0x1eb'),_0x6071b3,_0x116a('0x2d'),_0xbdac9b['name']);}else if(_0x46ccbe<_0xbdac9b[_0x116a('0x73')]&&_0xbdac9b[_0x116a('0x1ec')]===_0x116a('0x1e9')){freeVariablesPredictive(_0xbdac9b);loggerPredictive[_0x116a('0x87')](_0x116a('0x1ed'),_0x116a('0x1ee'),_0x46ccbe,'Drop\x20in\x20this\x20interval',_0xbdac9b['predictiveIntervalErlangCallsDroppedCalls'],_0x116a('0x2d'),_0xbdac9b[_0x116a('0x49')]);}else if(!ifInterval(_0xbdac9b['dialPredictiveInterval'],_0xbdac9b[_0x116a('0x2d')])&&_['isUndefined'](_0xbdac9b[_0x116a('0x2c')])&&!_[_0x116a('0x45')](_0xbdac9b[_0x116a('0x2d')])){_0xbdac9b[_0x116a('0x2c')]=moment()['format'](_0x116a('0x10e'));loggerPredictive[_0x116a('0x87')](_0xbdac9b[_0x116a('0x49')],_0x116a('0x1ef'),_0xbdac9b[_0x116a('0x2c')]);this[_0x116a('0xc9')](_0xbdac9b[_0x116a('0x1f0')])[_0x116a('0x43')](this[_0x116a('0x1f1')](_0xbdac9b))['then'](mergeDataErlangB(_0xbdac9b))[_0x116a('0x43')](this[_0x116a('0x1f2')](_0xbdac9b))[_0x116a('0xbf')](loggerCatchPredictive(_0x116a('0x1f3'),_0xbdac9b));}else if(!ifInterval(_0xbdac9b['dialPredictiveInterval'],_0xbdac9b['startPredictive'])){_0xbdac9b[_0x116a('0x73')]=0x0;_0xbdac9b[_0x116a('0x2c')]=moment()[_0x116a('0x7e')](_0x116a('0x10e'));loggerPredictive[_0x116a('0x87')](_0xbdac9b[_0x116a('0x49')],_0x116a('0x1f4'),_0xbdac9b[_0x116a('0x2c')]);clearInterval(_0xbdac9b[_0x116a('0x97')]);_0xbdac9b[_0x116a('0x97')]=undefined;this[_0x116a('0xc9')](_0xbdac9b[_0x116a('0x1f0')])[_0x116a('0x43')](this[_0x116a('0x1f1')](_0xbdac9b))[_0x116a('0x43')](mergeDataErlangB(_0xbdac9b))[_0x116a('0x43')](this[_0x116a('0x1f2')](_0xbdac9b))[_0x116a('0xbf')](loggerCatchPredictive(_0x116a('0x1f5'),_0xbdac9b));}else if(_0xbdac9b['predictiveIntervalAvailable']&&_0x19fc6a<_0xbdac9b[_0x116a('0x1e3')]-_0x57e3d0){freeVariablesPredictive(_0xbdac9b);loggerPredictive[_0x116a('0x87')](_0xbdac9b[_0x116a('0x49')],_0x116a('0x1f6'),_0x19fc6a,_0x116a('0x1f7'),_0xbdac9b['predictiveIntervalAvailable'],'-',_0x57e3d0,'=',_0xbdac9b[_0x116a('0x1e3')]-_0x57e3d0,')');}else if(_0xbdac9b[_0x116a('0x1e3')]&&_0x19fc6a>_0xbdac9b['predictiveIntervalAvailable']+_0x2366b5){freeVariablesPredictive(_0xbdac9b);loggerPredictive[_0x116a('0x87')](_0xbdac9b['name'],_0x116a('0x1f6'),_0x19fc6a,_0x116a('0x1f8'),_0xbdac9b[_0x116a('0x1e3')],'+',_0x2366b5,'=',_0xbdac9b[_0x116a('0x1e3')]+_0x2366b5,')');}};Dialer[_0x116a('0x1f')][_0x116a('0x1f1')]=function(_0x130c97){var _0x572c5d=this;return function(_0x378d8d){return new BPromise(function(_0x47b14b,_0x2a6a59){_['merge'](_0x130c97,_0x378d8d[0x0]);if(checkGetDataPredictive(_0x378d8d[0x0])){var _0x1c80f9=_0x130c97[_0x116a('0x1e3')]=_0x130c97['talking']+_0x130c97[_0x116a('0xab')];var _0x23c68b=_0x130c97[_0x116a('0x1f0')]*0x3c;var _0x3a08f9=_0x378d8d[0x0]['predictiveIntervalAvgTalktime']+_0x378d8d[0x0][_0x116a('0x6e')];var _0xbe70f7=(_0x378d8d[0x0]['predictiveIntervalAnsweredCalls']+_0x378d8d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x378d8d[0x0][_0x116a('0x70')])/_0x378d8d[0x0][_0x116a('0x77')];_0x130c97['predictiveIntervalHitRate']=_0xbe70f7>0x0?_0xbe70f7:0x1;switch(_0x130c97[_0x116a('0x1ec')]){case _0x116a('0x1e9'):var _0x524614=_0x130c97[_0x116a('0x1e1')]/0x64;return _0x572c5d[_0x116a('0x1f9')](_0x1c80f9,_0x23c68b,_0x3a08f9,_0xbe70f7,_0x524614)[_0x116a('0x43')](function(_0x21df8f){return _0x47b14b(_0x21df8f);});case _0x116a('0x1fa'):var _0x4a3bdb=_0x130c97['dialPredictiveOptimizationPercentage']/0x64;return _0x572c5d['busyFactor'](_0x1c80f9,_0x23c68b,_0x3a08f9,_0xbe70f7,_0x4a3bdb)[_0x116a('0x43')](function(_0x3e2f36){return _0x47b14b(_0x3e2f36);});default:return _0x2a6a59(msgResponse(_0x116a('0x1fb'),_0x116a('0x15a'),_0x116a('0x1fc')));}}else{return _0x2a6a59(msgResponse(_0x116a('0x1fb'),_0x116a('0x15a'),'check\x20failure'));}});};};Dialer[_0x116a('0x1f')][_0x116a('0x1fd')]=function(_0xea5538){var _0x2ad451=this;return function(_0x5207d1){return new BPromise(function(_0x48ffcc,_0x185ed9){_[_0x116a('0x94')](_0xea5538,_0x5207d1[0x0]);if(checkGetDataPredictive(_0x5207d1[0x0])){loggerPredictive[_0x116a('0x87')](JSON[_0x116a('0x4f')](_0x5207d1[0x0]));if(_0xea5538['dialPredictiveOptimization']===_0x116a('0x1e9')){return _0x2ad451[_0x116a('0x1fe')](_0xea5538['id'])[_0x116a('0x43')](function(_0x92568b){var _0x481448=_0xea5538[_0x116a('0x175')]-_0x92568b[0x0][_0x116a('0x1ff')];var _0x2c8b21=_0xea5538[_0x116a('0x1f0')]*0x3c;var _0x560829=_0x5207d1[0x0][_0x116a('0x6f')]+_0x5207d1[0x0]['predictiveIntervalAvgHoldtime'];var _0x32214c=(_0x5207d1[0x0][_0x116a('0x89')]+_0x5207d1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5207d1[0x0][_0x116a('0x70')])/_0x5207d1[0x0][_0x116a('0x77')];var _0x3fe1b7=_0xea5538[_0x116a('0x1e1')]/0x64;_0xea5538['predictiveIntervalPauses']=_0x92568b[0x0][_0x116a('0x1ff')]||0x0;_0xea5538[_0x116a('0x74')]=_0x32214c>0x0?_0x32214c:0x1;return _0x2ad451[_0x116a('0x1f9')](_0x481448,_0x2c8b21,_0x560829,_0x32214c,_0x3fe1b7);})[_0x116a('0x43')](function(_0x4668e8){return _0x48ffcc(_0x4668e8);})[_0x116a('0xbf')](function(_0x1d26e8){return _0x185ed9(msgResponse(_0x116a('0x200'),_0x116a('0x15a'),JSON['stringify'](_0x1d26e8)));});}if(_0xea5538[_0x116a('0x1ec')]===_0x116a('0x1fa')){return _0x2ad451[_0x116a('0x1fe')](_0xea5538['id'])[_0x116a('0x43')](function(_0x3e8552){var _0x121974=_0xea5538[_0x116a('0x175')]-_0x3e8552[0x0][_0x116a('0x1ff')];var _0x433515=_0xea5538[_0x116a('0x1f0')]*0x3c;var _0x403605=_0x5207d1[0x0][_0x116a('0x6f')]+_0x5207d1[0x0][_0x116a('0x6e')];var _0x163bc7=(_0x5207d1[0x0]['predictiveIntervalAnsweredCalls']+_0x5207d1[0x0][_0x116a('0x71')]+_0x5207d1[0x0][_0x116a('0x70')])/_0x5207d1[0x0]['predictiveIntervalTotalCalls'];var _0x346274=_0xea5538['dialPredictiveOptimizationPercentage']/0x64;_0xea5538['predictiveIntervalPauses']=_0x3e8552[0x0][_0x116a('0x1ff')]||0x0;_0xea5538[_0x116a('0x74')]=_0x163bc7>0x0?_0x163bc7:0x1;return _0x2ad451[_0x116a('0x201')](_0x121974,_0x433515,_0x403605,_0x163bc7,_0x346274);})['then'](function(_0x452ef8){return _0x48ffcc(_0x452ef8);})[_0x116a('0xbf')](function(_0x1ae39d){return _0x185ed9(msgResponse(_0x116a('0x200'),_0x116a('0x15a'),JSON[_0x116a('0x4f')](_0x1ae39d)));});}}else{return _0x185ed9(msgResponse('[getDataPredictive]',_0x116a('0x15a'),'check\x20failure'));}});};};Dialer[_0x116a('0x1f')]['startMethodPredictive']=function(_0x4d8267){var _0x4cc7c3=this;return function(){var _0x25ed3f=0x0;var _0x306b6b=Math['floor'](_0x4d8267[_0x116a('0x79')]*0x3e8);if(_0x306b6b>0x0){_0x306b6b=_0x306b6b<0x64?0x64:_0x306b6b;loggerPredictive[_0x116a('0x87')](_0x4d8267[_0x116a('0x49')],'one\x20call\x20every:',_0x306b6b,_0x116a('0x50'));_0x4d8267[_0x116a('0x97')]=setInterval(function(){_0x4cc7c3['handlePredictive'](_0x4d8267);loggerPredictiveCalls[_0x116a('0x87')]('[handlePredictive]',_0x25ed3f+=0x1);},_0x306b6b);}else{loggerPredictive[_0x116a('0x87')](_0x4d8267[_0x116a('0x49')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype']['checkContactBlack']=function(_0x4e72fe,_0x180580){var _0x198be4=this;return function(_0x4660b2){if(_[_0x116a('0x84')](_0x4660b2)){if(_[_0x116a('0xeb')](_0x180580[_0x116a('0xdf')])||!_0x180580[_0x116a('0x202')]){if(_0x4e72fe['dialMethod']===_0x116a('0x9')){_0x4e72fe['queueStatusComplete']=_['isUndefined'](_0x4e72fe['queueStatusComplete'])?!![]:_0x4e72fe[_0x116a('0x140')];var _0x3247b1=uuid['v4']();_0x198be4['actions'][_0x3247b1]=new Action(_0x4e72fe,_0x180580,_0x3247b1);loggerBooked[_0x116a('0x87')](_0x116a('0x203'),_0x3247b1,_0x116a('0x204'),JSON['stringify'](_0x4e72fe['queueStatusComplete']),_0x116a('0x205'),_0x4e72fe[_0x116a('0x49')]);if(_0x4e72fe[_0x116a('0x140')]){_0x4e72fe[_0x116a('0x140')]=![];_0x198be4['queueBooked'][_0x198be4[_0x116a('0x28')][_0x3247b1][_0x116a('0xbb')]]=[];ami[_0x116a('0xb7')]({'actionid':_0x3247b1,'action':_0x116a('0x206'),'queue':_0x4e72fe['name']})[_0x116a('0xbf')](function(){_0x198be4[_0x116a('0xba')](_0x4e72fe);_0x198be4['rescheduleContact']({'active':![],'ContactId':_0x198be4['actions'][_0x3247b1][_0x116a('0xde')],'ListId':_0x198be4[_0x116a('0x28')][_0x3247b1][_0x116a('0x10f')],'VoiceQueueId':_0x198be4[_0x116a('0x28')][_0x3247b1][_0x116a('0x110')]||undefined,'CampaignId':_0x198be4['actions'][_0x3247b1][_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x207')));delete _0x198be4[_0x116a('0x28')][_0x3247b1];});}else{loggerBooked[_0x116a('0x87')]('[booked][checkContactBlack][else]',JSON[_0x116a('0x4f')](_0x4e72fe[_0x116a('0x140')]),_0x116a('0x205'),_0x4e72fe['name']);_0x198be4[_0x116a('0xba')](_0x4e72fe);_0x198be4[_0x116a('0xca')]({'active':![],'ContactId':_0x198be4[_0x116a('0x28')][_0x3247b1][_0x116a('0xde')],'ListId':_0x198be4[_0x116a('0x28')][_0x3247b1][_0x116a('0x10f')],'VoiceQueueId':_0x198be4[_0x116a('0x28')][_0x3247b1][_0x116a('0x110')]||undefined,'CampaignId':_0x198be4[_0x116a('0x28')][_0x3247b1][_0x116a('0xe0')]||undefined})[_0x116a('0xbf')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x198be4['actions'][_0x3247b1];}}else{return _0x198be4[_0x116a('0x180')](_0x4e72fe,_0x180580);}}else{if(getDiff(_0x180580[_0x116a('0x208')])<_0x4e72fe[_0x116a('0x209')]*0x3c){if(_0x180580[_0x116a('0x171')]&&!_0x180580['Agent'][_0x116a('0x20a')]){_0x198be4[_0x116a('0x99')][_0x116a('0x143')](_0x180580['id'])[_0x116a('0x14a')](function(){_0x198be4[_0x116a('0xba')](_0x4e72fe);});}else{_0x198be4[_0x116a('0xcc')]({'active':![]},_0x180580['id'],0x1)[_0x116a('0x14a')](function(){_0x198be4[_0x116a('0xba')](_0x4e72fe);});}}else{_0x4e72fe[_0x116a('0x6c')]+=0x1;_0x198be4[_0x116a('0xba')](_0x4e72fe);if(_0x4e72fe[_0x116a('0x20b')]){_0x198be4[_0x116a('0xca')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x180580[_0x116a('0xde')],'ListId':_0x180580['ListId'],'VoiceQueueId':_0x180580[_0x116a('0x110')]||undefined,'CampaignId':_0x180580['CampaignId']||undefined})[_0x116a('0xbf')](loggerCatch(_0x116a('0x20c')));_0x198be4[_0x116a('0xd5')](createObjHistory(_0x4e72fe,_0x180580,_0x116a('0x20d'),0x17,'RecallInQueue'))[_0x116a('0xbf')](loggerCatch(_0x116a('0x20e')));}else{_0x198be4['saveInDb'](createObjHistory(_0x4e72fe,_0x180580,'RECALLFAILEDTIMEOUT',0x16,_0x116a('0x20f')),_0x116a('0x210'),_0x116a('0x211'));}}}}else{_0x4e72fe[_0x116a('0x64')]+=0x1;_0x198be4[_0x116a('0xdc')](createObjHistory(_0x4e72fe,_0x180580,'BLACKLIST',0xd,'Blacklist'),_0x116a('0x212'),_0x116a('0x213'));throw _0x116a('0x214');}};};Dialer[_0x116a('0x1f')]['handleIvr']=function(_0x841173){var _0x5010ef=this;var _0xddd5db=_0x841173['limitCalls']-_0x841173[_0x116a('0x78')]-_0x841173[_0x116a('0xce')];emitCampaignSummary(_0x841173);if(_0xddd5db>0x0){if(_0xddd5db>this['maxNumberOriginate']){_0xddd5db=this[_0x116a('0x26')];}_0x841173[_0x116a('0xce')]+=_0xddd5db;this[_0x116a('0xd0')](_0x841173['id'],_0xddd5db,_0x841173[_0x116a('0x215')],_0x841173)['then'](function(_0x5f13d6){_0x841173[_0x116a('0xce')]-=_0xddd5db;_0x841173[_0x116a('0xce')]=_0x841173[_0x116a('0xce')]>0x0?_0x841173[_0x116a('0xce')]:0x0;if(!checkContactEmpty(_0x5f13d6)){_0x841173[_0x116a('0x46')]=_0x116a('0x216');logger['info'](_0x116a('0x217')+_0x841173[_0x116a('0x49')]);}else{_0x841173['originated']+=_0x5f13d6[_0x116a('0xa0')];_0x841173[_0x116a('0x46')]='RUNNING';for(var _0x3e503e=0x0;_0x3e503e<_0x5f13d6['length'];_0x3e503e+=0x1){_0x841173['ivrTotalCallsDays']+=0x1;if(_[_0x116a('0xeb')](_0x5f13d6[_0x3e503e])||_[_0x116a('0xeb')](_0x5f13d6[_0x3e503e][_0x116a('0x19c')])||_[_0x116a('0xeb')](_0x5f13d6[_0x3e503e][_0x116a('0x184')])){_0x5010ef['emptyContact'](_0x116a('0x218'),_0x841173,_0x5f13d6[_0x3e503e]);}else{_0x5010ef[_0x116a('0xc7')](_[_0x116a('0xdd')](_0x5f13d6[_0x3e503e],[_0x116a('0xe0'),'Contact.phone']))['then'](_0x5010ef[_0x116a('0x219')](_0x841173,_0x5f13d6[_0x3e503e]))['catch'](_0x5010ef['loggerHandler'](_0x116a('0x21a'),_0x841173));}}}})[_0x116a('0xbf')](loggerGetContactDialer('[getContactCampaign2]',_0x841173,_0xddd5db));}};Dialer[_0x116a('0x1f')][_0x116a('0x16a')]=function(_0x293eb2,_0x5ead3b){var _0x5c43df=this;var _0x117f82=[];var _0x1d2799=_0x5ead3b>=0x1?_0x5ead3b:0x1;if(_0x293eb2[_0x116a('0x61')]==='booked'){_0x1d2799=0x1;}var _0xdb9461=Math[_0x116a('0x21b')](_0x293eb2[_0x116a('0xab')]*_0x1d2799)-_0x293eb2[_0x116a('0x78')]-_0x293eb2['temp'];emitVoiceQueueSummary(_0x293eb2);if(_0x293eb2['dialLimitQueue']>0x0){var _0x433cac=_0x293eb2[_0x116a('0x21c')]-_0x293eb2['originated']-_0x293eb2[_0x116a('0x5b')]-_0x293eb2[_0x116a('0xce')]-_0x293eb2[_0x116a('0x57')];if(_0xdb9461>_0x433cac){_0xdb9461=_0x433cac;}}if(_0xdb9461>0x0){if(_0x293eb2[_0x116a('0x61')]===_0x116a('0x9')){_0xdb9461=0x1;}if(_0xdb9461>this[_0x116a('0x26')]){_0xdb9461=this['maxNumberOriginate'];}_0x293eb2['temp']+=_0xdb9461;for(var _0x19da29 in this[_0x116a('0x24')]){if(typeof this[_0x116a('0x24')][_0x19da29]!=='undefined'){if(this[_0x116a('0x24')][_0x19da29]['state']==='not_inuse'&&this[_0x116a('0x24')][_0x19da29][_0x116a('0xb8')]==='reachable'){_0x117f82['push'](this[_0x116a('0x24')][_0x19da29]['id']);}}}this[_0x116a('0xcd')](_0x293eb2['id'],_0x117f82,_0xdb9461,_0x293eb2[_0x116a('0x215')],_0x293eb2)['then'](function(_0x121307){_0x293eb2[_0x116a('0xce')]-=_0xdb9461;_0x293eb2[_0x116a('0xce')]=_0x293eb2[_0x116a('0xce')]>0x0?_0x293eb2[_0x116a('0xce')]:0x0;if(!checkContactEmpty(_0x121307)){_0x5c43df[_0x116a('0xbd')](_0x293eb2)['then'](sendMessageReschedule(_0x293eb2))[_0x116a('0xbf')](loggerCatch(_0x116a('0xc0')));}else{_0x293eb2['originated']+=_0x121307[_0x116a('0xa0')];_0x293eb2[_0x116a('0x46')]=_0x293eb2[_0x116a('0x61')]==='booked'?_0x116a('0x21d'):_0x116a('0x21e');for(var _0x4b703b=0x0;_0x4b703b<_0x121307[_0x116a('0xa0')];_0x4b703b+=0x1){if(_['isNil'](_0x121307[_0x4b703b])||_['isNil'](_0x121307[_0x4b703b]['Contact'])||_[_0x116a('0xeb')](_0x121307[_0x4b703b]['phone'])){_0x5c43df[_0x116a('0xda')]('[actionOriginate]\x20',_0x293eb2,_0x121307[_0x4b703b]);}else{_0x5c43df[_0x116a('0xc1')](_[_0x116a('0xdd')](_0x121307[_0x4b703b],[_0x116a('0x110'),_0x116a('0x21f')]))[_0x116a('0x43')](_0x5c43df[_0x116a('0x219')](_0x293eb2,_0x121307[_0x4b703b]))[_0x116a('0xbf')](_0x5c43df[_0x116a('0xd9')]('[actionOriginate]\x20',_0x293eb2));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x293eb2,_0xdb9461));}};Dialer[_0x116a('0x1f')][_0x116a('0x97')]=function(_0x89fde5){if(_0x89fde5['dialLimitQueue']>0x0){var _0x77a44c=_0x89fde5[_0x116a('0x21c')]-_0x89fde5[_0x116a('0x78')]-_0x89fde5['talking'];if(_0x77a44c>0x0){this[_0x116a('0x220')](_0x89fde5);}else{loggerPredictiveCalls[_0x116a('0x87')](_0x116a('0x221'));}}else{this[_0x116a('0x220')](_0x89fde5);}};Dialer['prototype'][_0x116a('0x220')]=function(_0x3976f3){var _0x8d0b71=this;var _0x18115c=[];_0x3976f3['originated']+=0x1;for(var _0x2b5a6d in this[_0x116a('0x24')]){if(typeof this[_0x116a('0x24')][_0x2b5a6d]!==_0x116a('0xa1')){if(this[_0x116a('0x24')][_0x2b5a6d][_0x116a('0xb1')]==='not_inuse'&&this[_0x116a('0x24')][_0x2b5a6d][_0x116a('0xb8')]===_0x116a('0xe7')){_0x18115c[_0x116a('0x13d')](this[_0x116a('0x24')][_0x2b5a6d]['id']);}}}this[_0x116a('0xcd')](_0x3976f3['id'],_0x18115c,0x1,_0x3976f3['dialOrderByScheduledAt'],_0x3976f3)['then'](function(_0x544624){if(!checkContactEmpty(_0x544624)){checkContactLowerLimitOriginate(_0x3976f3,0x1,0x0);_0x8d0b71[_0x116a('0xbd')](_0x3976f3)['then'](sendMessageReschedule(_0x3976f3))[_0x116a('0xbf')](loggerCatch('[countReScheduled]\x20'));}else{_0x3976f3[_0x116a('0x46')]=_0x116a('0x21e');if(_[_0x116a('0xeb')](_0x544624[0x0])||_[_0x116a('0xeb')](_0x544624[0x0][_0x116a('0x19c')])||_[_0x116a('0xeb')](_0x544624[0x0][_0x116a('0x184')])){_0x8d0b71[_0x116a('0xda')]('[actionOriginate]\x20',_0x3976f3,_0x544624[0x0]);}else{_0x8d0b71['checkIsBlackList'](_[_0x116a('0xdd')](_0x544624[0x0],[_0x116a('0x110'),_0x116a('0x21f')]))[_0x116a('0x43')](_0x8d0b71[_0x116a('0x219')](_0x3976f3,_0x544624[0x0]))[_0x116a('0xbf')](_0x8d0b71[_0x116a('0xd9')](_0x116a('0x222'),_0x3976f3));}}})['catch'](loggerGetContactDialer(_0x116a('0x223'),_0x3976f3,0x1));emitVoiceQueueSummary(_0x3976f3);};Dialer[_0x116a('0x1f')][_0x116a('0x1f9')]=function(_0xef1ba1,_0x30a775,_0x35f883,_0x529281,_0x2e91be,_0x7c34fd){loggerPredictive[_0x116a('0x87')](_0x116a('0x224'));loggerPredictive[_0x116a('0x87')](_0x116a('0x225'),_0xef1ba1);loggerPredictive[_0x116a('0x87')](_0x116a('0x226'),_0x30a775);loggerPredictive[_0x116a('0x87')](_0x116a('0x227'),_0x35f883);loggerPredictive['info'](_0x116a('0x228'),_0x529281);loggerPredictive[_0x116a('0x87')](_0x116a('0x229'),_0x2e91be);loggerPredictive['info'](_0x116a('0x93'));return new BPromise(function(_0x28b684,_0xd7c0b7){if(_0xef1ba1<=0x0||isNaN(_0xef1ba1)){return _0xd7c0b7(msgResponse(_0x116a('0x22a'),_0x116a('0x4e'),_0x116a('0x22b')+_0xef1ba1));}if(_0x35f883<=0x0||isNaN(_0x35f883)){return _0xd7c0b7(msgResponse(_0x116a('0x22a'),_0x116a('0x4e'),_0x116a('0x22c')+_0x35f883));}if(_0x529281<=0x0||isNaN(_0x529281)){return _0xd7c0b7(msgResponse(_0x116a('0x22a'),_0x116a('0x4e'),_0x116a('0x22d')+_0x529281));}if(_0x30a775<=0x0||isNaN(_0x30a775)){return _0xd7c0b7(msgResponse(_0x116a('0x22a'),'Error',_0x116a('0x22e')+_0x30a775));}if(_0x2e91be<=0x0||isNaN(_0x2e91be)){return _0xd7c0b7(msgResponse(_0x116a('0x22a'),_0x116a('0x4e'),'Amax\x20=\x20'+_0x2e91be));}_0x7c34fd=_0x7c34fd||0x0;var _0x1fcac3=0x1/_0x35f883;var _0x358146=0x0;var _0x3f251c=0x0;var _0x5becac=0x0;var _0x22a7bb=0x0;for(var _0x56b828=0x0;_0x5becac<_0x2e91be;_0x56b828+=0x1){_0x3f251c=_0x56b828/_0x30a775;_0x358146=(_0x529281*_0x3f251c+_0x7c34fd)/_0x1fcac3;_0x5becac=erlangb(_0x358146,_0xef1ba1);_0x22a7bb=_0x358146/_0xef1ba1*(0x1-erlangb(_0x358146,_0xef1ba1));}return _0x28b684({'erlangCalls':_0x56b828,'erlangCallToSecond':_0x30a775/_0x56b828,'erlangAbandonmentRate':_0x5becac,'erlangBusyFactor':_0x22a7bb});});};Dialer[_0x116a('0x1f')][_0x116a('0x201')]=function(_0x52d43f,_0x28a7f6,_0x8778aa,_0x1634c4,_0xbd988,_0x387336){loggerPredictive[_0x116a('0x87')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x116a('0x87')](_0x116a('0x225'),_0x52d43f);loggerPredictive[_0x116a('0x87')](_0x116a('0x226'),_0x28a7f6);loggerPredictive[_0x116a('0x87')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x8778aa);loggerPredictive[_0x116a('0x87')](_0x116a('0x228'),_0x1634c4);loggerPredictive['info'](_0x116a('0x22f'),_0xbd988);loggerPredictive[_0x116a('0x87')]('---------------------------');return new BPromise(function(_0x5c4734,_0x3409b4){if(_0x52d43f<=0x0||isNaN(_0x52d43f)){return _0x3409b4(msgResponse('[busyFactor]',_0x116a('0x4e'),_0x116a('0x22b')+_0x52d43f));}if(_0x8778aa<=0x0||isNaN(_0x8778aa)){return _0x3409b4(msgResponse(_0x116a('0x230'),_0x116a('0x4e'),_0x116a('0x22c')+_0x8778aa));}if(_0x1634c4<=0x0||isNaN(_0x1634c4)){return _0x3409b4(msgResponse('[busyFactor]',_0x116a('0x4e'),_0x116a('0x22d')+_0x1634c4));}if(_0x28a7f6<=0x0||isNaN(_0x28a7f6)){return _0x3409b4(msgResponse(_0x116a('0x230'),_0x116a('0x4e'),_0x116a('0x22e')+_0x28a7f6));}if(_0xbd988<=0x0||isNaN(_0xbd988)){return _0x3409b4(msgResponse(_0x116a('0x230'),_0x116a('0x4e'),_0x116a('0x231')+_0xbd988));}_0x387336=_0x387336||0x0;var _0x528333=0x1/_0x8778aa;var _0x593509=0x0;var _0x4dae25=0x0;var _0x3657a1=0x0;var _0x37cffc=0x0;for(var _0x29e0ea=0x0;_0x37cffc<_0xbd988;_0x29e0ea+=0x1){_0x4dae25=_0x29e0ea/_0x28a7f6;_0x593509=(_0x1634c4*_0x4dae25+_0x387336)/_0x528333;_0x3657a1=erlangb(_0x593509,_0x52d43f);_0x37cffc=_0x593509/_0x52d43f*(0x1-erlangb(_0x593509,_0x52d43f));}return _0x5c4734({'erlangCalls':_0x29e0ea,'erlangCallToSecond':_0x28a7f6/_0x29e0ea,'erlangAbandonmentRate':_0x3657a1,'erlangBusyFactor':_0x37cffc});});};module[_0x116a('0x232')]=Dialer; \ No newline at end of file +var _0x0b31=['preview','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','prototype','[uniqueid]','[actions]','clearZombieChannels','enqueue','isNil','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','saveInDb','merge','pick','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','Machine','countmachineretry','custom:amd','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countbusyretry','stateGlobal','dialMachineMaxRetry','add','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','TIMEOUT','countglobal','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','dialDropRetryFrequency','calleridname','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','calleridnum','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','syncNewExten','syncQueueMember','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','stringify','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','checkIsBlackList','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','NOT_ACTIVE','name','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','milliseconds','diff','seconds','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','Trunk','md5','format','ivr','campaign:ivr:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive'];(function(_0x230ea7,_0x5225da){var _0x123485=function(_0x1979b2){while(--_0x1979b2){_0x230ea7['push'](_0x230ea7['shift']());}};_0x123485(++_0x5225da);}(_0x0b31,0x1a2));var _0x10b3=function(_0x39d9e6,_0x635773){_0x39d9e6=_0x39d9e6-0x0;var _0x48f3cd=_0x0b31[_0x39d9e6];return _0x48f3cd;};'use strict';var util=require(_0x10b3('0x0'));var _=require(_0x10b3('0x1'));var BPromise=require(_0x10b3('0x2'));var uuid=require('uuid');var moment=require(_0x10b3('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x10b3('0x4'));var config=require(_0x10b3('0x5'));var logger=require(_0x10b3('0x6'))(_0x10b3('0x7'));var loggerBooked=require(_0x10b3('0x6'))(_0x10b3('0x8'));var loggerPredictive=require(_0x10b3('0x6'))(_0x10b3('0x9'));var loggerPredictiveCalls=require(_0x10b3('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x10b3('0x6'))(_0x10b3('0xa'));var ami=require(_0x10b3('0xb'));config[_0x10b3('0xc')]=_['defaults'](config[_0x10b3('0xc')],{'host':_0x10b3('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x10b3('0xc')]));var cmHopper=require(_0x10b3('0xe'));var cmHopperHistory=require(_0x10b3('0xf'));var cmHopperFinal=require(_0x10b3('0x10'));var cmHopperAdditionalPhone=require(_0x10b3('0x11'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x10b3('0x12'));var RpcSetting=require(_0x10b3('0x13'));var Action=require(_0x10b3('0x14'));var History=require(_0x10b3('0x15'));var Final=require('./final');var AgentComplete=require(_0x10b3('0x16'));var QueueCallerAbandon=require(_0x10b3('0x17'));var Hangup=require(_0x10b3('0x18'));var ipAgi=process[_0x10b3('0x19')][_0x10b3('0x1a')]||_0x10b3('0x1b');var strategy={'rrmemory':_0x10b3('0x1c'),'roundrobin':_0x10b3('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x4e7675){this[_0x10b3('0x1e')]=this['tail']?this[_0x10b3('0x1e')][_0x10b3('0x1f')](_0x4e7675):_0x4e7675();};function Dialer(_0x50a628,_0x2b9e18){this[_0x10b3('0x20')]=new Sequence();this['preview']=_0x2b9e18;this[_0x10b3('0x21')]=_0x50a628[_0x10b3('0x21')];this[_0x10b3('0x22')]=_0x50a628[_0x10b3('0x22')];this['agents']=_0x50a628[_0x10b3('0x23')];this[_0x10b3('0x24')]=_0x50a628['trunks'];this['maxNumberOriginate']=config[_0x10b3('0x25')]||0x2;this[_0x10b3('0x26')]={};this[_0x10b3('0x27')]={};this[_0x10b3('0x28')]={};this[_0x10b3('0x29')]={};this[_0x10b3('0x2a')]={};this[_0x10b3('0x2b')]={};this[_0x10b3('0x2c')]={};this[_0x10b3('0x2d')]={};this[_0x10b3('0x2e')]={};this[_0x10b3('0x2f')]={};ami['on'](_0x10b3('0x30'),this[_0x10b3('0x31')][_0x10b3('0x32')](this));ami['on'](_0x10b3('0x33'),this[_0x10b3('0x34')][_0x10b3('0x32')](this));ami['on']('originateresponse',this[_0x10b3('0x35')]['bind'](this));ami['on'](_0x10b3('0x36'),this[_0x10b3('0x37')][_0x10b3('0x32')](this));ami['on'](_0x10b3('0x38'),this[_0x10b3('0xa')]['bind'](this));ami['on'](_0x10b3('0x39'),this['syncHangup'][_0x10b3('0x32')](this));ami['on'](_0x10b3('0x3a'),this['syncNewExten'][_0x10b3('0x32')](this));ami['on'](_0x10b3('0x3b'),this[_0x10b3('0x3c')]['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0x10b3('0x32')](this));ami['on'](_0x10b3('0x3d'),this[_0x10b3('0x3e')][_0x10b3('0x32')](this));this['loopCampaigns']();this[_0x10b3('0x3f')]();RpcSetting[_0x10b3('0x40')]()[_0x10b3('0x41')](function(_0x526146){previewRecallmeReminderInterval=_0x526146[_0x10b3('0x42')];});}function isNotNull(_0xd6259d){return _0xd6259d!==null&&!_[_0x10b3('0x43')](_0xd6259d);}function checkIsLoggedIn(_0x2c6bfe,_0x3fb61e){return function(){if(_0x3fb61e<=0x0){_0x2c6bfe['message']='AGENTS_NOT_LOGGED';throw _0x2c6bfe['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3dd381){return _0x3dd381;}function checkIsActive(_0x342396,_0x3e4002){return function(){if(!isActive(_0x3e4002)){_0x342396[_0x10b3('0x44')]=_0x10b3('0x45');throw _0x342396[_0x10b3('0x46')]+'\x20NOT\x20Active';}};}function checkInterval(_0x55a107){return function(){if(!isNotNull(_0x55a107[_0x10b3('0x47')])){_0x55a107['message']=_0x10b3('0x48');throw _0x55a107['name']+_0x10b3('0x49');}if(!isNotNull(_0x55a107[_0x10b3('0x47')][_0x10b3('0x4a')])){_0x55a107[_0x10b3('0x44')]='INTERVAL_IS_NULL';throw _0x55a107['name']+_0x10b3('0x49');}if(!isNotNull(_['isEmpty'](_0x55a107['Interval'][_0x10b3('0x4a')]))){_0x55a107[_0x10b3('0x44')]=_0x10b3('0x48');throw _0x55a107['name']+_0x10b3('0x49');}};}function msgResponse(_0x2fe6c3,_0x10db16,_0x15d3ca){return{'action':_0x2fe6c3,'response':_0x10db16,'message':_0x15d3ca,'stack':_0x15d3ca};}function myreject(_0xf36eb5){return function(_0x5cd07d){return _0xf36eb5(msgResponse(_0x10b3('0x4b'),'Error',JSON['stringify'](_0x5cd07d)));};}function getSeconds(_0x68808c,_0x15c185){var _0x511862=moment(_0x68808c)[_0x10b3('0x4c')](0x0);var _0x3c834f=moment(_0x15c185)[_0x10b3('0x4c')](0x0);return _0x511862[_0x10b3('0x4d')](_0x3c834f,_0x10b3('0x4e'));}function emit(_0xe970f2,_0x28ccc3,_0x11e98f){io['to'](_0xe970f2)['emit'](_0x28ccc3,_0x11e98f);}function emitVoiceQueueSummary(_0x5c27f8){if(_0x5c27f8[_0x10b3('0x4f')]===_0x10b3('0x50')){var _0x38f89a={'id':_0x5c27f8['id'],'name':_0x5c27f8['name'],'strategy':_0x5c27f8[_0x10b3('0x51')],'answered':_0x5c27f8['answered'],'available':_0x5c27f8[_0x10b3('0x52')],'loggedIn':_0x5c27f8[_0x10b3('0x53')],'pTalking':_0x5c27f8[_0x10b3('0x54')],'sumBillable':_0x5c27f8[_0x10b3('0x55')],'sumDuration':_0x5c27f8[_0x10b3('0x56')],'sumHoldTime':_0x5c27f8[_0x10b3('0x57')]||0x0,'talking':_0x5c27f8[_0x10b3('0x58')],'total':_0x5c27f8[_0x10b3('0x59')],'type':_0x5c27f8['type'],'unmanaged':_0x5c27f8[_0x10b3('0x5a')],'abandoned':_0x5c27f8[_0x10b3('0x5b')],'waiting':_0x5c27f8[_0x10b3('0x5c')],'loggedInDb':_0x5c27f8['loggedInDb'],'dialActive':_0x5c27f8[_0x10b3('0x5d')],'dialMethod':_0x5c27f8['dialMethod'],'dialOriginateCallerIdName':_0x5c27f8[_0x10b3('0x5e')],'dialOriginateCallerIdNumber':_0x5c27f8[_0x10b3('0x5f')],'dialOriginateTimeout':_0x5c27f8[_0x10b3('0x60')],'dialPrefix':_0x5c27f8[_0x10b3('0x61')],'outboundAnswerAgiCallsDay':_0x5c27f8['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5c27f8[_0x10b3('0x62')],'outboundBlacklistCallsDay':_0x5c27f8[_0x10b3('0x63')],'outboundBusyCallsDay':_0x5c27f8[_0x10b3('0x64')],'outboundCongestionCallsDay':_0x5c27f8[_0x10b3('0x65')],'outboundDropCallsDayACS':_0x5c27f8[_0x10b3('0x66')],'outboundDropCallsDayCallersExit':_0x5c27f8[_0x10b3('0x67')],'outboundDropCallsDayTimeout':_0x5c27f8[_0x10b3('0x68')],'outboundNoAnswerCallsDay':_0x5c27f8[_0x10b3('0x69')],'outboundNoSuchCallsDay':_0x5c27f8[_0x10b3('0x6a')],'outboundOriginateFailureCallsDay':_0x5c27f8['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5c27f8[_0x10b3('0x6b')],'outboundRejectCallsDay':_0x5c27f8[_0x10b3('0x6c')],'outboundUnknownCallsDay':_0x5c27f8[_0x10b3('0x6d')],'predictiveIntervalAnsweredCalls':_0x5c27f8[_0x10b3('0x6e')],'predictiveIntervalAvgHoldtime':_0x5c27f8[_0x10b3('0x6f')],'predictiveIntervalAvgTalktime':_0x5c27f8[_0x10b3('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x5c27f8[_0x10b3('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x5c27f8['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5c27f8['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5c27f8[_0x10b3('0x72')],'predictiveIntervalHitRate':_0x5c27f8[_0x10b3('0x73')],'predictiveIntervalMultiplicativeFactor':_0x5c27f8[_0x10b3('0x74')],'predictiveIntervalPauses':_0x5c27f8[_0x10b3('0x75')],'predictiveIntervalAvailable':_0x5c27f8[_0x10b3('0x76')],'predictiveIntervalTotalCalls':_0x5c27f8['predictiveIntervalTotalCalls'],'message':_0x5c27f8[_0x10b3('0x44')],'originated':_0x5c27f8[_0x10b3('0x77')],'erlangCalls':_0x5c27f8[_0x10b3('0x78')],'erlangCallToSecond':_0x5c27f8[_0x10b3('0x79')],'erlangAbandonmentRate':_0x5c27f8['erlangAbandonmentRate'],'erlangBusyFactor':_0x5c27f8['erlangBusyFactor'],'startPredictive':_0x5c27f8[_0x10b3('0x2b')],'startProgressive':_0x5c27f8[_0x10b3('0x2c')]};if(_0x5c27f8[_0x10b3('0x7a')]){_0x38f89a[_0x10b3('0x7a')]={'id':_0x5c27f8['Trunk']['id'],'name':_0x5c27f8[_0x10b3('0x7a')]['name'],'active':_0x5c27f8[_0x10b3('0x7a')]['active'],'callerid':_0x5c27f8[_0x10b3('0x7a')]['callerid']};}if(_0x5c27f8[_0x10b3('0x47')]){_0x38f89a[_0x10b3('0x47')]={'id':_0x5c27f8['Interval']['id'],'name':_0x5c27f8[_0x10b3('0x47')][_0x10b3('0x46')]};}var _0x667fa2=md5(JSON['stringify'](_0x38f89a));if(_0x5c27f8[_0x10b3('0x7b')]!==_0x667fa2){_0x5c27f8[_0x10b3('0x7b')]=_0x667fa2;emit(util[_0x10b3('0x7c')]('voice:queue:%s',_0x38f89a[_0x10b3('0x46')]),'voice_queue:save',_0x38f89a);}}}function emitCampaignSummary(_0x2d3725){if(_0x2d3725[_0x10b3('0x4f')]===_0x10b3('0x7d')){emit(util[_0x10b3('0x7c')](_0x10b3('0x7e'),_0x2d3725[_0x10b3('0x46')]),'campaign:save',_0x2d3725);}}function checkGetDataPredictive(_0x63533a){if(isNotNull(_0x63533a)&&!_[_0x10b3('0x7f')](_0x63533a)){loggerPredictive[_0x10b3('0x80')](_0x10b3('0x81'));loggerPredictive[_0x10b3('0x80')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x63533a[_0x10b3('0x82')]);loggerPredictive['info'](_0x10b3('0x83'),_0x63533a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x84'),_0x63533a['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x10b3('0x85'),_0x63533a[_0x10b3('0x71')]);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x86'),_0x63533a[_0x10b3('0x6f')]);loggerPredictive[_0x10b3('0x80')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x63533a[_0x10b3('0x70')]);loggerPredictive['info'](_0x10b3('0x87'));if(_0x63533a['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x63533a['predictiveIntervalAvgTalktime'])&&_0x63533a['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0x10b3('0x88'));if(!_['isUndefined'](_0x63533a[_0x10b3('0x6f')])&&_0x63533a[_0x10b3('0x6f')]>0x0){return!![];}loggerPredictive[_0x10b3('0x80')](_0x10b3('0x89'));}else{loggerPredictive['info'](_0x10b3('0x8a'));}}else{loggerPredictive[_0x10b3('0x80')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3e185f){return function(_0x55bea4){loggerPredictive['info'](_0x10b3('0x8b'));loggerPredictive[_0x10b3('0x80')](_0x10b3('0x8c'),_0x55bea4[_0x10b3('0x78')]);loggerPredictive['info'](_0x10b3('0x8d'),_0x55bea4['erlangCallToSecond']);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x8e'),_0x55bea4[_0x10b3('0x8f')]);loggerPredictive[_0x10b3('0x80')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x55bea4[_0x10b3('0x90')]);loggerPredictive[_0x10b3('0x80')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x55bea4[_0x10b3('0x8f')]);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x87'));_['merge'](_0x3e185f,_0x55bea4);};}function getDiff(_0x6aee4b){var _0x34abc4=moment()['milliseconds'](0x0);var _0x2ed0b3=moment(_0x6aee4b)[_0x10b3('0x4c')](0x0);return _0x34abc4[_0x10b3('0x4d')](_0x2ed0b3,_0x10b3('0x4e'));}function ifInterval(_0x4a691a,_0x4f85ee){if(_['isUndefined'](_0x4f85ee)){return![];}return getDiff(_0x4f85ee)<_0x4a691a*0x3c;}function freeVariablesPredictive(_0x1ab74b){if(isNotNull(_0x1ab74b)){if(!_[_0x10b3('0x43')](_0x1ab74b['startProgressive'])){_0x1ab74b['startProgressive']=undefined;loggerPredictive[_0x10b3('0x80')](_0x1ab74b[_0x10b3('0x46')],_0x10b3('0x91'));}if(!_[_0x10b3('0x43')](_0x1ab74b[_0x10b3('0x2b')])){_0x1ab74b[_0x10b3('0x2b')]=undefined;loggerPredictive[_0x10b3('0x80')](_0x1ab74b[_0x10b3('0x46')],_0x10b3('0x92'));}if(!_[_0x10b3('0x43')](_0x1ab74b[_0x10b3('0x93')])){clearInterval(_0x1ab74b['handlePredictive']);_0x1ab74b[_0x10b3('0x93')]=undefined;loggerPredictive[_0x10b3('0x80')](_0x1ab74b['name'],_0x10b3('0x94'));}}}function erlangb(_0x4ed830,_0x550961){if(_0x550961===0x0){return 0x0;}var _0x1f9ee3=0x1;for(var _0x1eb062=0x1;_0x1eb062<=_0x550961;_0x1eb062+=0x1){_0x1f9ee3=0x1+_0x1f9ee3*_0x1eb062/_0x4ed830;}return 0x1/_0x1f9ee3;}function isVoiceQueueOutbound(_0x4f83e4){return _0x4f83e4===_0x10b3('0x50');}function isNotPreview(_0x44b042){return _0x44b042!==_0x10b3('0x95');}function isCampaignIvr(_0x3db4b1){return _0x3db4b1===_0x10b3('0x7d');}function getCallerId(_0x9af4b4,_0x58b674,_0x386136){if(!_[_0x10b3('0x43')](_0x386136)&&typeof _0x386136===_0x10b3('0x96')&&!_[_0x10b3('0x7f')](_0x386136)){if(!_['isUndefined'](_0x58b674)&&typeof _0x58b674===_0x10b3('0x96')&&!_[_0x10b3('0x7f')](_0x58b674)){return util[_0x10b3('0x7c')]('\x22%s\x22\x20<%s>',_0x58b674,_0x386136);}return util[_0x10b3('0x7c')](_0x10b3('0x97'),_0x386136,_0x386136);}if(!_[_0x10b3('0x43')](_0x9af4b4)&&typeof _0x9af4b4===_0x10b3('0x96')&&!_['isEmpty'](_0x9af4b4)){return _0x9af4b4;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x5621ba,_0x179176){return function(_0xfc3d00){freeVariablesPredictive(_0x179176);emitVoiceQueueSummary(_0x179176);emitCampaignSummary(_0x179176);loggerSyncQueueSummary[_0x10b3('0x98')](_0x5621ba,util[_0x10b3('0x99')](_0xfc3d00,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x384ac5,_0x3d3c89){return function(_0x2a2d82){loggerPredictive['error'](_0x3d3c89[_0x10b3('0x46')],_0x384ac5);loggerPredictive[_0x10b3('0x98')](_0x2a2d82[_0x10b3('0x9a')]);freeVariablesPredictive(_0x3d3c89);};}function loggerCatch(_0x583d70){return function(_0x376ed7){logger[_0x10b3('0x98')](_0x583d70,util[_0x10b3('0x99')](_0x376ed7,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x50c26a){return _0x50c26a&&!_[_0x10b3('0x43')](_0x50c26a)&&_0x50c26a[_0x10b3('0x9b')]>0x0;}function decremetOriginate(_0x344f04){if(!_['isUndefined'](_0x344f04)&&_0x344f04!==null){if(typeof _0x344f04['originated']!==_0x10b3('0x9c')){if(_0x344f04[_0x10b3('0x77')]>0x0){_0x344f04[_0x10b3('0x77')]-=0x1;}else{logger[_0x10b3('0x98')](_0x10b3('0x9d'));}}}else{logger[_0x10b3('0x98')](_0x10b3('0x9e'));}}function checkContactLowerLimitOriginate(_0x287050,_0x261f25,_0x1cb418){if(_0x261f25>_0x1cb418){for(var _0x5d7e98=0x0;_0x5d7e98<_0x261f25-_0x1cb418;_0x5d7e98+=0x1){decremetOriginate(_0x287050);}}}function loggerGetContactDialer(_0x50f4f6,_0x30edf0,_0x506b6b){return function(_0x8c78ae){checkContactLowerLimitOriginate(_0x30edf0,_0x506b6b,0x0);logger['error'](_0x50f4f6,util[_0x10b3('0x99')](_0x8c78ae,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3981d1){return function(_0x201122){if(isNotNull(_0x201122)&&isNotNull(_0x201122[0x0])){if(_0x201122[0x0][_0x10b3('0x9f')]>0x0){_0x3981d1[_0x10b3('0x44')]=_0x10b3('0xa0');logger['info'](_0x10b3('0xa1')+_0x3981d1['name'],_0x201122[0x0][_0x10b3('0x9f')],_0x10b3('0xa2'));}else{_0x3981d1[_0x10b3('0x44')]=_0x10b3('0xa3');logger['info']('[getContactDialer2][Empty]'+_0x3981d1[_0x10b3('0x46')]);}}};}function notSendMessagesQueue(_0x458f11){if(_0x458f11[_0x10b3('0xa4')]){freeVariablesPredictive(_0x458f11);if(_0x458f11['originated']===0x0&&_0x458f11[_0x10b3('0x58')]===0x0&&_0x458f11[_0x10b3('0x5c')]===0x0&&(_0x458f11['pTalking']||0x0)===0x0){_0x458f11[_0x10b3('0xa4')]=![];_0x458f11[_0x10b3('0x52')]=0x0;_0x458f11['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x10b3('0x98')](_0x10b3('0xa5'),_0x458f11[_0x10b3('0x46')],_0x10b3('0xa6'));}else{_0x458f11[_0x10b3('0x44')]=_0x10b3('0xa7');loggerSyncQueueSummary[_0x10b3('0x98')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x458f11[_0x10b3('0x46')],_0x10b3('0xa8'));}emitVoiceQueueSummary(_0x458f11);}}function notSendMessagesCampaign(_0x19da70){if(_0x19da70[_0x10b3('0xa4')]){if(_0x19da70['originated']===0x0){_0x19da70['sendMessageOneNotActive']=![];_0x19da70[_0x10b3('0x44')]=_0x10b3('0x45');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x19da70['name'],'is\x20not\x20active');}else{_0x19da70[_0x10b3('0x44')]=_0x10b3('0xa7');loggerSyncQueueSummary['error'](_0x10b3('0xa9'),_0x19da70[_0x10b3('0x46')],'is\x20disactive');}emitCampaignSummary(_0x19da70);}}function createObjHistory(_0x3724af,_0x507e88,_0x51f5a8,_0x5dfe6c,_0x117942){_0x3724af[_0x10b3('0x44')]=_0x51f5a8;var _0x181d42=new Action(_0x3724af,_0x507e88);var _0x85318=new History(_0x181d42);_0x85318[_0x10b3('0xaa')]=_0x5dfe6c;_0x85318[_0x10b3('0xab')]=_0x117942;_0x85318[_0x10b3('0xac')]=_0x181d42[_0x10b3('0xad')];return _0x85318;}Dialer[_0x10b3('0xae')][_0x10b3('0x3f')]=function(){var _0x1a745a=this;setInterval(function(){_0x1a745a['clearZombieChannels'](_0x1a745a[_0x10b3('0x29')],_0x10b3('0xaf'));_0x1a745a['clearZombieChannels'](_0x1a745a['actions'],_0x10b3('0xb0'));},0x32c8);};Dialer['prototype'][_0x10b3('0xb1')]=function(_0x149652,_0x4c41dc){var _0x5d9aad=this;for(var _0x127ded in _0x149652){if(typeof _0x149652[_0x127ded]!==_0x10b3('0x9c')){this['sequence'][_0x10b3('0xb2')](function(){if(!_[_0x10b3('0xb3')](_0x149652[_0x127ded])){return ami[_0x10b3('0xb4')]({'action':_0x10b3('0xb5'),'channel':_0x149652[_0x127ded][_0x10b3('0xb6')]})[_0x10b3('0xb7')](function(_0x21b210){if(_0x21b210[_0x10b3('0x44')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x149652[_0x127ded]&&_0x149652[_0x127ded][_0x10b3('0x4f')]!==_0x10b3('0x7d')){_0x5d9aad[_0x10b3('0xb8')](_0x5d9aad[_0x10b3('0x21')][_0x149652[_0x127ded][_0x10b3('0xb9')]]);logger[_0x10b3('0x98')](_0x10b3('0xba'),_0x4c41dc,_0x127ded,_0x149652[_0x127ded][_0x10b3('0xb9')]);delete _0x149652[_0x127ded];}if(_0x149652[_0x127ded]&&_0x149652[_0x127ded][_0x10b3('0x4f')]==='ivr'){_0x5d9aad[_0x10b3('0xb8')](_0x5d9aad[_0x10b3('0x22')][_0x149652[_0x127ded][_0x10b3('0xb9')]]);logger[_0x10b3('0x98')](_0x10b3('0xbb'),_0x4c41dc,_0x127ded,_0x149652[_0x127ded][_0x10b3('0xb9')]);delete _0x149652[_0x127ded];}},0x2328);}});}});}}};Dialer[_0x10b3('0xae')][_0x10b3('0xbc')]=function(_0x4cb5b0){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopper[_0x10b3('0xbc')](_0x4cb5b0))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xbe')));};Dialer[_0x10b3('0xae')]['checkIsBlackList']=function(_0x31b102){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopperBlack['checkIsBlackList'](_0x31b102))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xbf')));};Dialer[_0x10b3('0xae')][_0x10b3('0xc0')]=function(_0x5f15fd,_0x54a2d7,_0x3ea92d){return BPromise['resolve']()['then'](cmHopperAdditionalPhone[_0x10b3('0xc0')](_0x5f15fd,_0x54a2d7,_0x3ea92d))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xc1')));};Dialer['prototype']['swapAdditionalPhones']=function(_0x20e093,_0x52abc5,_0x324441){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x20e093,_0x52abc5,_0x324441))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xc2')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x5f298d){return BPromise['resolve']()[_0x10b3('0x41')](cmHopperBlack[_0x10b3('0xc3')](_0x5f298d))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xc4')));};Dialer['prototype']['averageHandleTime']=function(_0x21a82a){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopperHistory[_0x10b3('0xc5')](_0x21a82a))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xc6')));};Dialer[_0x10b3('0xae')][_0x10b3('0xc7')]=function(_0x25e386){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopper[_0x10b3('0xc7')](_0x25e386))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xc8')));};Dialer[_0x10b3('0xae')][_0x10b3('0xc9')]=function(_0x2e2dc9,_0x35da95,_0x5d6345){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopper[_0x10b3('0xc9')](_0x2e2dc9,_0x35da95,_0x5d6345))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xca')));};Dialer['prototype']['getContactDialer']=function(_0x5869de,_0x3d5e18,_0x504343,_0x29dcb7,_0x95c51a){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopper[_0x10b3('0xcb')](_0x5869de,_0x3d5e18,_0x504343,_0x29dcb7))[_0x10b3('0xb7')](function(_0x3ddbaf){_0x95c51a[_0x10b3('0xcc')]-=_0x504343;_0x95c51a[_0x10b3('0xcc')]=_0x95c51a[_0x10b3('0xcc')]>0x0?_0x95c51a[_0x10b3('0xcc')]:0x0;loggerCatch(_0x10b3('0xcd'))(_0x3ddbaf);});};Dialer[_0x10b3('0xae')][_0x10b3('0xce')]=function(_0x39156e,_0x6db13c,_0x518f8e,_0x36aaae){return BPromise['resolve']()[_0x10b3('0x41')](cmHopper[_0x10b3('0xce')](_0x39156e,_0x6db13c,_0x518f8e))[_0x10b3('0xb7')](function(_0x14f130){_0x36aaae[_0x10b3('0xcc')]-=_0x6db13c;_0x36aaae[_0x10b3('0xcc')]=_0x36aaae[_0x10b3('0xcc')]>0x0?_0x36aaae['temp']:0x0;loggerCatch(_0x10b3('0xcf'))(_0x14f130);});};Dialer[_0x10b3('0xae')][_0x10b3('0xd0')]=function(_0x4338d5){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](voiceQueueRt['getVoiceQueueRtPauses'](_0x4338d5))['catch'](loggerCatch(_0x10b3('0xd1')));};Dialer[_0x10b3('0xae')][_0x10b3('0xd2')]=function(_0x13d179){return BPromise[_0x10b3('0xbd')]()['then'](cmHopper[_0x10b3('0xd2')](_0x13d179))[_0x10b3('0xb7')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x10b3('0xd3')]=function(_0x2363bc){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopperHistory[_0x10b3('0xd3')](_0x2363bc))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xd4')));};Dialer[_0x10b3('0xae')][_0x10b3('0xb8')]=function(_0x3ad9c9){if(!_[_0x10b3('0x43')](_0x3ad9c9)&&_0x3ad9c9!==null){if(typeof _0x3ad9c9['originated']!==_0x10b3('0x9c')){if(_0x3ad9c9['originated']>0x0){_0x3ad9c9[_0x10b3('0x77')]-=0x1;}else{logger[_0x10b3('0x98')](_0x10b3('0xd5'));}}}else{logger['error'](_0x10b3('0xd6'));}};Dialer[_0x10b3('0xae')]['loggerHandler']=function(_0x3d6519,_0x5c476d){var _0x243585=this;return function(_0xada12d){_0x243585[_0x10b3('0xb8')](_0x5c476d);logger[_0x10b3('0x98')](_0x3d6519,util['inspect'](_0xada12d,{'showHidden':![],'depth':null}));};};Dialer[_0x10b3('0xae')]['emptyContact']=function(_0xc41e54,_0x28aeff,_0x4e3d27){var _0x1d53d7={'state':0x19,'statedesc':_0x10b3('0xd7')};this['updateOriginated'](_0x28aeff);this[_0x10b3('0xd8')](_[_0x10b3('0xd9')](_0x1d53d7,_[_0x10b3('0xda')](_0x4e3d27,['ContactId',_0x10b3('0xdb'),'UserId',_0x10b3('0xdc'),_0x10b3('0xdd')])),_0x10b3('0xde'),_0x10b3('0xdf'));logger[_0x10b3('0x98')](_0xc41e54);};Dialer[_0x10b3('0xae')]['isSuccess']=function(_0x12af00){return _0x12af00===_0x10b3('0xe0');};Dialer[_0x10b3('0xae')][_0x10b3('0xe1')]=function(_0x2f1439){return!_[_0x10b3('0x43')](_0x2f1439)&&_0x2f1439&&!_[_0x10b3('0x43')](_0x2f1439[_0x10b3('0x46')])&&!_[_0x10b3('0x43')](_0x2f1439[_0x10b3('0xe2')])&&_0x2f1439[_0x10b3('0xe2')]&&(this[_0x10b3('0x24')][util[_0x10b3('0x7c')](_0x10b3('0xe3'),_0x2f1439['name'])][_0x10b3('0xb5')]===_0x10b3('0xe4')||this['trunks'][util[_0x10b3('0x7c')](_0x10b3('0xe3'),_0x2f1439[_0x10b3('0x46')])][_0x10b3('0xb5')]===_0x10b3('0xe5'));};Dialer[_0x10b3('0xae')][_0x10b3('0xd8')]=function(_0x27dce0,_0x1bed1a,_0x2a6493){this['createHistory'](_0x27dce0)[_0x10b3('0xb7')](loggerCatch(_0x1bed1a));this[_0x10b3('0xd2')](_0x27dce0)[_0x10b3('0xb7')](loggerCatch(_0x2a6493));};Dialer[_0x10b3('0xae')][_0x10b3('0x3c')]=function(_0x1dce10){var _0x30e31c=this[_0x10b3('0x29')][_0x1dce10[_0x10b3('0xe6')]];var _0x1abc07;if(!_[_0x10b3('0xb3')](_0x1dce10)&&!_['isNil'](_0x1dce10[_0x10b3('0xe7')])&&!_['isNil'](_0x1dce10['variable'][_0x10b3('0xe8')])&&_0x1dce10[_0x10b3('0xe9')]===_0x10b3('0xea')&&_0x30e31c){if(_0x30e31c[_0x10b3('0x4f')]!==_0x10b3('0x7d')&&this[_0x10b3('0x21')][_0x30e31c['queue']][_0x10b3('0xeb')]&&_0x1dce10['value']===_0x10b3('0xec')){delete this[_0x10b3('0x29')][_0x1dce10[_0x10b3('0xe6')]];this['updateOriginated'](this[_0x10b3('0x21')][_0x30e31c[_0x10b3('0xb9')]]);this[_0x10b3('0x21')][_0x30e31c[_0x10b3('0xb9')]][_0x10b3('0x62')]+=0x1;this['voiceQueues'][_0x30e31c[_0x10b3('0xb9')]][_0x10b3('0xed')]+=0x1;_0x1abc07=new Hangup(_0x30e31c,_0x1dce10);_0x1abc07[_0x10b3('0xaa')]=0x12;_0x1abc07[_0x10b3('0xab')]=_0x10b3('0xee');_0x1abc07[_0x10b3('0xef')]=_0x10b3('0xf0');ami[_0x10b3('0xf1')]('custom:amd',ut[_0x10b3('0xf2')](_0x1abc07,_0x10b3('0xf3')));this[_0x10b3('0xd8')](_0x1abc07,_0x10b3('0xf4'),_0x10b3('0xf5'));}if(_0x30e31c[_0x10b3('0x4f')]!==_0x10b3('0x7d')&&this[_0x10b3('0x21')][_0x30e31c['queue']][_0x10b3('0xeb')]&&_0x1dce10[_0x10b3('0xf6')]==='MACHINE'){var _0x83cd73=this;return new BPromise(function(_0x3f02c6,_0x2b5116){delete _0x83cd73[_0x10b3('0x29')][_0x1dce10[_0x10b3('0xe6')]];_0x83cd73[_0x10b3('0xb8')](_0x83cd73[_0x10b3('0x21')][_0x30e31c[_0x10b3('0xb9')]]);_0x83cd73[_0x10b3('0x21')][_0x30e31c[_0x10b3('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x83cd73[_0x10b3('0x21')][_0x30e31c[_0x10b3('0xb9')]][_0x10b3('0xed')]+=0x1;var _0x392b2d=_0x83cd73[_0x10b3('0x21')][_0x30e31c[_0x10b3('0xb9')]];var _0x3b5384=new Hangup(_0x30e31c,_0x1dce10);_0x3b5384[_0x10b3('0xaa')]=0x13;_0x3b5384['statedesc']=_0x10b3('0xf7');_0x3b5384[_0x10b3('0xef')]='AMD';_0x3b5384[_0x10b3('0xf8')]+=0x1;_0x3b5384['countglobal']+=0x1;_0x3b5384[_0x10b3('0xf3')]=!![];ami['emit'](_0x10b3('0xf9'),ut[_0x10b3('0xf2')](_0x3b5384,_0x10b3('0xf3')));_0x83cd73['createHistory'](_0x3b5384)[_0x10b3('0xb7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3b5384['countbusyretry']+_0x3b5384[_0x10b3('0xfa')]+_0x3b5384[_0x10b3('0xfb')]+_0x3b5384[_0x10b3('0xfc')]+_0x3b5384[_0x10b3('0xfd')]+_0x3b5384[_0x10b3('0xfe')]+_0x3b5384[_0x10b3('0xf8')]+_0x3b5384[_0x10b3('0xff')]>=_0x392b2d[_0x10b3('0x100')]){_0x83cd73['stateGlobal'](_0x3b5384,_0x3f02c6,_0x2b5116,_0x10b3('0x101'));}else{if(_0x3b5384[_0x10b3('0xf8')]>=_0x392b2d['dialMachineMaxRetry']){_0x83cd73[_0x10b3('0x102')](_0x3b5384,_0x3f02c6,_0x2b5116,_0x10b3('0x103'));}else{_0x83cd73[_0x10b3('0xc7')]({'active':![],'countmachineretry':_0x3b5384[_0x10b3('0xf8')],'scheduledat':moment()['add'](_0x392b2d[_0x10b3('0x104')],_0x10b3('0x105'))[_0x10b3('0x7c')](_0x10b3('0x106')),'ContactId':_0x3b5384[_0x10b3('0x107')],'ListId':_0x3b5384[_0x10b3('0xdb')],'VoiceQueueId':_0x3b5384[_0x10b3('0xdc')]||undefined,'CampaignId':_0x3b5384[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x108')));_0x3f02c6({'reschedule':0x1});}}});}if(_0x30e31c[_0x10b3('0x4f')]===_0x10b3('0x7d')&&this[_0x10b3('0x22')][_0x30e31c[_0x10b3('0xb9')]][_0x10b3('0xeb')]&&_0x1dce10[_0x10b3('0xf6')]===_0x10b3('0xec')){delete this[_0x10b3('0x29')][_0x1dce10[_0x10b3('0xe6')]];this[_0x10b3('0xb8')](this[_0x10b3('0x22')][_0x30e31c[_0x10b3('0xb9')]]);_0x1abc07=new Hangup(_0x30e31c,_0x1dce10);_0x1abc07['state']=0x12;_0x1abc07['statedesc']=_0x10b3('0xee');_0x1abc07[_0x10b3('0xef')]=_0x10b3('0xf0');ami[_0x10b3('0xf1')](_0x10b3('0xf9'),ut['buildObj'](_0x1abc07,_0x10b3('0xf3')));this[_0x10b3('0xd8')](_0x1abc07,_0x10b3('0x109'),_0x10b3('0x10a'));}if(_0x30e31c[_0x10b3('0x4f')]===_0x10b3('0x7d')&&this[_0x10b3('0x22')][_0x30e31c[_0x10b3('0xb9')]][_0x10b3('0xeb')]&&_0x1dce10[_0x10b3('0xf6')]===_0x10b3('0x10b')){var _0x83cd73=this;return new BPromise(function(_0x3b5944,_0x5cfc9c){delete _0x83cd73[_0x10b3('0x29')][_0x1dce10[_0x10b3('0xe6')]];_0x83cd73[_0x10b3('0xb8')](_0x83cd73[_0x10b3('0x22')][_0x30e31c[_0x10b3('0xb9')]]);_0x83cd73['campaigns'][_0x30e31c[_0x10b3('0xb9')]][_0x10b3('0x62')]+=0x1;_0x83cd73['campaigns'][_0x30e31c[_0x10b3('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2cb26e=_0x83cd73['campaigns'][_0x30e31c['queue']];var _0x258eb0=new Hangup(_0x30e31c,_0x1dce10);_0x258eb0[_0x10b3('0xaa')]=0x13;_0x258eb0[_0x10b3('0xab')]=_0x10b3('0xf7');_0x258eb0['membername']='AMD';_0x258eb0[_0x10b3('0xf8')]+=0x1;_0x258eb0['countglobal']+=0x1;_0x258eb0[_0x10b3('0xf3')]=!![];ami['emit'](_0x10b3('0xf9'),ut[_0x10b3('0xf2')](_0x258eb0,_0x10b3('0xf3')));_0x83cd73[_0x10b3('0xd3')](_0x258eb0)[_0x10b3('0xb7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x258eb0[_0x10b3('0x10c')]+_0x258eb0[_0x10b3('0xfa')]+_0x258eb0['countnoanswerretry']+_0x258eb0['countnosuchnumberretry']+_0x258eb0[_0x10b3('0xfd')]+_0x258eb0[_0x10b3('0xfe')]+_0x258eb0[_0x10b3('0xf8')]+_0x258eb0[_0x10b3('0xff')]>=_0x2cb26e[_0x10b3('0x100')]){_0x83cd73[_0x10b3('0x10d')](_0x258eb0,_0x3b5944,_0x5cfc9c,_0x10b3('0x101'));}else{if(_0x258eb0[_0x10b3('0xf8')]>=_0x2cb26e[_0x10b3('0x10e')]){_0x83cd73[_0x10b3('0x102')](_0x258eb0,_0x3b5944,_0x5cfc9c,_0x10b3('0x103'));}else{_0x83cd73[_0x10b3('0xc7')]({'active':![],'countmachineretry':_0x258eb0['countmachineretry'],'scheduledat':moment()[_0x10b3('0x10f')](_0x2cb26e[_0x10b3('0x104')],'minutes')['format'](_0x10b3('0x106')),'ContactId':_0x258eb0[_0x10b3('0x107')],'ListId':_0x258eb0[_0x10b3('0xdb')],'VoiceQueueId':_0x258eb0['VoiceQueueId']||undefined,'CampaignId':_0x258eb0['CampaignId']||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x108')));_0x3b5944({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x10b3('0x110')]=function(_0x1a2bc2){var _0x35660d=this[_0x10b3('0x29')][_0x1a2bc2[_0x10b3('0xe6')]];var _0x5a2a21=this;var _0x4ab69e;if(_0x35660d&&_0x35660d[_0x10b3('0x4f')]===_0x10b3('0x7d')){delete this[_0x10b3('0x29')][_0x1a2bc2[_0x10b3('0xe6')]];this['updateOriginated'](this[_0x10b3('0x22')][_0x35660d[_0x10b3('0xb9')]]);this['campaigns'][_0x35660d[_0x10b3('0xb9')]][_0x10b3('0x111')]+=0x1;_0x4ab69e=new Hangup(_0x35660d,_0x1a2bc2);this[_0x10b3('0xd3')](_0x4ab69e)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x112')));this[_0x10b3('0xd2')](_0x4ab69e)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x113')));}if(_0x35660d&&_0x35660d[_0x10b3('0x4f')]!==_0x10b3('0x7d')&&isNotNull(this[_0x10b3('0x21')][_0x35660d[_0x10b3('0xb9')]]['dialQueueProject'])){delete this[_0x10b3('0x29')][_0x1a2bc2[_0x10b3('0xe6')]];this[_0x10b3('0xb8')](this[_0x10b3('0x21')][_0x35660d[_0x10b3('0xb9')]]);this[_0x10b3('0x21')][_0x35660d['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x35660d['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4ab69e=new Hangup(_0x35660d,_0x1a2bc2);_0x4ab69e[_0x10b3('0xaa')]=0x10;_0x4ab69e[_0x10b3('0xab')]=_0x10b3('0x114');_0x4ab69e['membername']=_0x10b3('0x115');this[_0x10b3('0xd3')](_0x4ab69e)[_0x10b3('0xb7')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x10b3('0xd2')](_0x4ab69e)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x113')));}if(_0x35660d&&_0x35660d[_0x10b3('0x4f')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x35660d[_0x10b3('0xb9')]][_0x10b3('0x116')])){delete this['uniqueId'][_0x1a2bc2[_0x10b3('0xe6')]];this['updateOriginated'](this[_0x10b3('0x21')][_0x35660d[_0x10b3('0xb9')]]);this['voiceQueues'][_0x35660d['queue']][_0x10b3('0x6d')]+=0x1;_0x4ab69e=new Hangup(_0x35660d,_0x1a2bc2);_0x4ab69e[_0x10b3('0xaa')]=0xc;_0x4ab69e[_0x10b3('0xab')]=_0x1a2bc2[_0x10b3('0x117')];_0x4ab69e['membername']=_0x10b3('0x118');this[_0x10b3('0xd3')](_0x4ab69e)[_0x10b3('0xb7')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x4ab69e)['catch'](loggerCatch(_0x10b3('0x113')));}};Dialer[_0x10b3('0xae')][_0x10b3('0x37')]=function(_0x524cb5){var _0x4a054=this[_0x10b3('0x29')][_0x524cb5[_0x10b3('0xe6')]];var _0x58ba35=this;if(this[_0x10b3('0x21')][_0x524cb5[_0x10b3('0xb9')]]){if(_0x4a054&&_0x4a054[_0x10b3('0x4f')]!=='ivr'){delete this[_0x10b3('0x29')][_0x524cb5[_0x10b3('0xe6')]];this[_0x10b3('0x21')][_0x524cb5['queue']]['outboundAnswerCallsDay']+=0x1;var _0x1d26b3=new AgentComplete(_0x4a054,_0x524cb5);if(_0x524cb5[_0x10b3('0x119')]===_0x10b3('0x11a')){_0x1d26b3[_0x10b3('0x11b')]=this[_0x10b3('0x21')][_0x524cb5['queue']][_0x10b3('0x11c')]&&this[_0x10b3('0x21')][_0x524cb5[_0x10b3('0xb9')]][_0x10b3('0x11d')]?moment()[_0x10b3('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x10b3('0xd3')](_0x1d26b3)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x11e')));this[_0x10b3('0xd2')](_0x1d26b3)[_0x10b3('0xb7')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x10b3('0xae')][_0x10b3('0x31')]=function(_0x56b35c){if(this[_0x10b3('0x21')][_0x56b35c[_0x10b3('0xb9')]]){if(this[_0x10b3('0x29')][_0x56b35c[_0x10b3('0xe6')]]&&this['uniqueId'][_0x56b35c['uniqueid']]['type']!==_0x10b3('0x7d')){this[_0x10b3('0xb8')](this['voiceQueues'][_0x56b35c[_0x10b3('0xb9')]]);this[_0x10b3('0x29')][_0x56b35c[_0x10b3('0xe6')]]['answertime']=moment()[_0x10b3('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x10b3('0xae')][_0x10b3('0x11f')]=function(_0x510fad,_0x2e18c3){this[_0x10b3('0xd3')](_0x510fad)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x11e')));if(_0x2e18c3==0x0){this[_0x10b3('0xd2')](_0x510fad)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x120')));}};Dialer[_0x10b3('0xae')]['syncQueueCallerAbandon']=function(_0x6ebf3f){var _0x429806=this['uniqueId'][_0x6ebf3f[_0x10b3('0xe6')]];var _0x3cb250=this;var _0x1ebce9=![];var _0x19f28a;var _0x133eb7;if(this['voiceQueues'][_0x6ebf3f[_0x10b3('0xb9')]]){if(_0x429806&&_0x429806[_0x10b3('0x4f')]!==_0x10b3('0x7d')){delete this[_0x10b3('0x29')][_0x6ebf3f['uniqueid']];this[_0x10b3('0xb8')](this[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]]);_0x429806['droptime']=moment()[_0x10b3('0x7c')](_0x10b3('0x106'));var _0x384d77=new QueueCallerAbandon(_0x429806,_0x6ebf3f);if(getSeconds(_0x429806[_0x10b3('0x121')],_0x429806[_0x10b3('0x122')])>=_0x429806[_0x10b3('0x123')]){this['voiceQueues'][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x124')]+=0x1;this['voiceQueues'][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x68')]+=0x1;this['voiceQueues'][_0x6ebf3f['queue']][_0x10b3('0x72')]+=0x1;_0x384d77[_0x10b3('0xaa')]=0xa;_0x384d77['statedesc']=_0x10b3('0x125');_0x384d77[_0x10b3('0x126')]=_0x10b3('0x127');_0x384d77[_0x10b3('0x11b')]=this[_0x10b3('0x21')][_0x6ebf3f['queue']]['dialQueueProject2']?moment()[_0x10b3('0x7c')](_0x10b3('0x106')):undefined;_0x384d77[_0x10b3('0xfd')]+=0x1;_0x384d77[_0x10b3('0x128')]+=0x1;_0x19f28a=this[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]]['dialDropRetryFrequency'];_0x133eb7=this['voiceQueues'][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x129')];_0x3cb250[_0x10b3('0xc0')](_0x384d77,_0x384d77[_0x10b3('0xaa')],_0x429806[_0x10b3('0x12a')])[_0x10b3('0x41')](function(_0x3e792d){_0x1ebce9=_0x3e792d['additional']==0x1;if(_0x384d77[_0x10b3('0xfd')]>=_0x3cb250[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x12b')]){_0x3cb250[_0x10b3('0x11f')](_0x384d77,_0x3e792d['additional']);}else{_0x3cb250[_0x10b3('0xc7')]({'active':![],'countdropretry':_0x384d77['countdropretry'],'scheduledat':moment()['add'](_0x3cb250[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x12c')],_0x10b3('0x105'))[_0x10b3('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x429806[_0x10b3('0x107')],'ListId':_0x429806[_0x10b3('0xdb')],'VoiceQueueId':_0x429806[_0x10b3('0xdc')]||undefined,'CampaignId':_0x429806[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch('[rescheduleContact][Drop]'));var _0x42f204=new History(_0x384d77);_0x42f204[_0x10b3('0xaa')]=0xa;_0x42f204['statedesc']=_0x10b3('0x125');_0x42f204[_0x10b3('0xad')]=moment()['format'](_0x10b3('0x106'));_0x42f204[_0x10b3('0xac')]=_0x42f204[_0x10b3('0xad')];_0x42f204[_0x10b3('0x12d')]=_0x384d77[_0x10b3('0x12d')];_0x42f204['calleridnum']=_0x384d77['calleridnum'];_0x3cb250[_0x10b3('0xd3')](_0x42f204)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x12e')));}})[_0x10b3('0x41')](function(_0x2d7b64){if(_0x1ebce9)_0x3cb250['swapAdditionalPhones'](_0x384d77,_0x19f28a,_0x133eb7)[_0x10b3('0x41')](function(_0x1fedff){return 0x1;});});}else{this[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x67')]+=0x1;_0x384d77[_0x10b3('0xaa')]=0xb;_0x384d77[_0x10b3('0xab')]='Abandoned';_0x384d77[_0x10b3('0x126')]=_0x10b3('0x12f');_0x384d77[_0x10b3('0xfe')]+=0x1;_0x384d77['countglobal']+=0x1;_0x19f28a=this['voiceQueues'][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x130')];_0x133eb7=this[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]][_0x10b3('0x129')];_0x3cb250[_0x10b3('0xc0')](_0x384d77,_0x384d77[_0x10b3('0xaa')],_0x429806[_0x10b3('0x12a')])[_0x10b3('0x41')](function(_0x283516){if(_0x384d77[_0x10b3('0xfe')]>=_0x3cb250['voiceQueues'][_0x6ebf3f[_0x10b3('0xb9')]]['dialAbandonedMaxRetry']){_0x3cb250[_0x10b3('0x11f')](_0x384d77,_0x283516['additional']);}else{_0x3cb250[_0x10b3('0xc7')]({'active':![],'countabandonedretry':_0x384d77[_0x10b3('0xfe')],'scheduledat':moment()['add'](_0x3cb250[_0x10b3('0x21')][_0x6ebf3f[_0x10b3('0xb9')]]['dialAbandonedRetryFrequency'],_0x10b3('0x105'))['format'](_0x10b3('0x106')),'ContactId':_0x429806[_0x10b3('0x107')],'ListId':_0x429806[_0x10b3('0xdb')],'VoiceQueueId':_0x429806[_0x10b3('0xdc')]||undefined,'CampaignId':_0x429806['CampaignId']||undefined})['catch'](loggerCatch(_0x10b3('0x131')));var _0x35f121=new History(_0x384d77);_0x35f121[_0x10b3('0xaa')]=0xb;_0x35f121[_0x10b3('0xab')]=_0x10b3('0x132');_0x35f121[_0x10b3('0xad')]=moment()[_0x10b3('0x7c')](_0x10b3('0x106'));_0x35f121[_0x10b3('0xac')]=_0x35f121['starttime'];_0x35f121['calleridname']=_0x384d77[_0x10b3('0x12d')];_0x35f121[_0x10b3('0x133')]=_0x384d77[_0x10b3('0x133')];_0x3cb250[_0x10b3('0xd3')](_0x35f121)['catch'](loggerCatch(_0x10b3('0x134')));}})['then'](function(_0x2cf2c8){if(_0x1ebce9)_0x3cb250[_0x10b3('0x135')](_0x384d77,_0x19f28a,_0x133eb7)[_0x10b3('0x41')](function(_0x5bc6ae){return 0x1;});});}}}};Dialer[_0x10b3('0xae')][_0x10b3('0x136')]=function(_0x4226ec){if(this[_0x10b3('0x27')][_0x4226ec[_0x10b3('0xe6')]]){this[_0x10b3('0x27')][_0x4226ec[_0x10b3('0xe6')]]['channel']=_0x4226ec['channel'];}if(this[_0x10b3('0x29')][_0x4226ec[_0x10b3('0xe6')]]){this['uniqueId'][_0x4226ec['uniqueid']][_0x10b3('0xb6')]=_0x4226ec[_0x10b3('0xb6')];}};Dialer['prototype'][_0x10b3('0x137')]=function(_0x386b7c){if(strategy[this[_0x10b3('0x21')][this[_0x10b3('0x27')][_0x386b7c[_0x10b3('0x138')]]['queue']][_0x10b3('0x51')]]==='roundrobin'){if(this[_0x10b3('0x27')][_0x386b7c[_0x10b3('0x138')]]&&_[_0x10b3('0xb3')](this['actions'][_0x386b7c[_0x10b3('0x138')]][_0x10b3('0x139')])&&_0x386b7c['status']==='1'&&_0x386b7c[_0x10b3('0x13a')]==='0'){if(this[_0x10b3('0x23')][_0x386b7c[_0x10b3('0x13b')]]){if(!this[_0x10b3('0x23')][_0x386b7c[_0x10b3('0x13b')]][_0x10b3('0x139')]){this[_0x10b3('0x23')][_0x386b7c[_0x10b3('0x13b')]][_0x10b3('0x139')]=!![];this['actions'][_0x386b7c[_0x10b3('0x138')]][_0x10b3('0x139')]=!![];this[_0x10b3('0x27')][_0x386b7c[_0x10b3('0x138')]]['stateinterface']=_0x386b7c[_0x10b3('0x13b')];}}}}else if((strategy[this[_0x10b3('0x21')][this['actions'][_0x386b7c[_0x10b3('0x138')]][_0x10b3('0xb9')]][_0x10b3('0x51')]]||_0x10b3('0x1c'))==='rrmemory'){if(this['actions'][_0x386b7c[_0x10b3('0x138')]]){if(this['agents'][_0x386b7c[_0x10b3('0x13b')]]){this[_0x10b3('0x27')][_0x386b7c[_0x10b3('0x138')]][_0x10b3('0x13b')]=_0x386b7c['stateinterface'];if(_['isNil'](this['queueBooked'][this['actions'][_0x386b7c[_0x10b3('0x138')]][_0x10b3('0xb9')]])){this[_0x10b3('0x2e')][this[_0x10b3('0x27')][_0x386b7c[_0x10b3('0x138')]][_0x10b3('0xb9')]]=[];}this[_0x10b3('0x2e')][this[_0x10b3('0x27')][_0x386b7c[_0x10b3('0x138')]]['queue']][_0x10b3('0x13c')](_['merge'](_['pick'](this[_0x10b3('0x27')][_0x386b7c[_0x10b3('0x138')]],[_0x10b3('0x13d'),_0x10b3('0x13b')]),{'status':_0x386b7c[_0x10b3('0xb5')],'paused':_0x386b7c['paused']}));}}}};function unlockQueueStatus(_0x385668,_0x5c5ed4){setTimeout(function(){if(_['isUndefined'](_0x385668[_0x10b3('0x13e')])){loggerBooked[_0x10b3('0x98')](_0x10b3('0x13f'),_0x5c5ed4);}_0x385668[_0x10b3('0x13e')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x5c5ed4,JSON['stringify'](_['pick'](_0x385668,[_0x10b3('0x46'),_0x10b3('0x13e')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x185b88){var _0x3b4473=this;var _0x365891=_0x3b4473[_0x10b3('0x21')][_0x3b4473['actions'][_0x185b88[_0x10b3('0x138')]]['queue']];if(strategy[this[_0x10b3('0x21')][this[_0x10b3('0x27')][_0x185b88['actionid']][_0x10b3('0xb9')]][_0x10b3('0x51')]]==='roundrobin'){if(this['actions'][_0x185b88[_0x10b3('0x138')]]&&this['actions'][_0x185b88['actionid']][_0x10b3('0x13b')]){this[_0x10b3('0x95')][_0x10b3('0x140')](this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0x13d')],this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0x13b')])[_0x10b3('0xb7')](function(_0x4a7063){logger[_0x10b3('0x98')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x10b3('0x99')](_0x4a7063,{'showHidden':![],'depth':null}));})[_0x10b3('0x1f')](function(){_0x3b4473[_0x10b3('0xb8')](_0x3b4473['voiceQueues'][_0x3b4473[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]]);_0x3b4473[_0x10b3('0x23')][_0x3b4473[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0x13b')]]['locked']=![];delete _0x3b4473[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]];unlockQueueStatus(_0x365891);});}else{this[_0x10b3('0xb8')](this[_0x10b3('0x21')][this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x10b3('0x27')][_0x185b88['actionid']][_0x10b3('0x107')],'ListId':this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xdb')],'VoiceQueueId':this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xdc')]||undefined,'CampaignId':this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x141')));delete this['actions'][_0x185b88[_0x10b3('0x138')]];unlockQueueStatus(_0x365891);}}else if((strategy[this[_0x10b3('0x21')][this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]][_0x10b3('0x51')]]||'rrmemory')===_0x10b3('0x1c')){var _0x51973c;if(this[_0x10b3('0x27')][_0x185b88['actionid']]&&!_[_0x10b3('0x7f')](this[_0x10b3('0x2e')][this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]])){if(this['queueBookedRR'][_0x3b4473[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]]){this[_0x10b3('0x2f')][_0x3b4473[_0x10b3('0x27')][_0x185b88['actionid']]['queue']]=this[_0x10b3('0x2f')][this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]]?this[_0x10b3('0x2f')][this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]]:this[_0x10b3('0x2e')][this['actions'][_0x185b88[_0x10b3('0x138')]]['queue']]?this['queueBooked'][this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]][_0x10b3('0xb9')]][_0x10b3('0x142')]||0x0:0x0;}this[_0x10b3('0x2e')][this[_0x10b3('0x27')][_0x185b88['actionid']]['queue']][_0x10b3('0x142')]=this[_0x10b3('0x2f')][this[_0x10b3('0x27')][_0x185b88[_0x10b3('0x138')]]['queue']];for(var _0x177075=0x0;_0x177075=0x0;})['catch'](myreject(_0x456c0d)));}}else{_0xa12466[_0x10b3('0x13c')](ami[_0x10b3('0xb4')]({'action':_0x10b3('0x158'),'command':util['format']('iftime\x20%s,%s',_0x267f66,!_[_0x10b3('0x43')](config[_0x10b3('0x154')][_0x1c6810])?_0x1c6810:'')})[_0x10b3('0x41')](function(_0x5de60b){return _0x5de60b['content'][_0x10b3('0x15c')](_0x10b3('0x15d'))>=0x0;})[_0x10b3('0xb7')](myreject(_0x456c0d)));}BPromise[_0x10b3('0x15e')](_0xa12466)['then'](function(_0x39d4e0){var _0x487982=_[_0x10b3('0x15f')](_0x39d4e0);if(_0x487982){return _0x52585a(_0x487982);}else{_0x3149fb[_0x10b3('0x44')]=_0x85785b?_0x10b3('0x160'):_0x10b3('0x161');return _0x456c0d(msgResponse(_0x10b3('0x162'),_0x10b3('0x152'),_0x10b3('0x163')+_0x85785b+'\x20'+_0x184df3+_0x10b3('0x164')+util[_0x10b3('0x99')](_0x267f66,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1c6810));}})['catch'](function(_0x36f181){return _0x456c0d(msgResponse(_0x10b3('0x150'),_0x10b3('0x152'),JSON['stringify'](_0x36f181)));});});};Dialer[_0x10b3('0xae')][_0x10b3('0x165')]=function(_0x2b4550){var _0x37f66d=this;return function(){switch(_0x2b4550[_0x10b3('0x166')]){case _0x10b3('0x167'):freeVariablesPredictive(_0x2b4550);_0x37f66d[_0x10b3('0x168')](_0x2b4550,0x1);break;case _0x10b3('0x169'):freeVariablesPredictive(_0x2b4550);_0x37f66d[_0x10b3('0x168')](_0x2b4550,_0x2b4550[_0x10b3('0x16a')]);break;case _0x10b3('0x9'):_0x37f66d[_0x10b3('0x9')](_0x2b4550);break;case _0x10b3('0x8'):freeVariablesPredictive(_0x2b4550);_0x37f66d[_0x10b3('0x168')](_0x2b4550,0x1);break;default:freeVariablesPredictive(_0x2b4550);logger[_0x10b3('0x98')](_0x10b3('0x16b'),_0x2b4550['name'],'method\x20not\x20recognized');}};};Dialer[_0x10b3('0xae')][_0x10b3('0x16c')]=function(_0x96c6a6){return BPromise[_0x10b3('0xbd')]()[_0x10b3('0x41')](cmHopper[_0x10b3('0x16d')](_0x96c6a6['id'],previewRecallmeReminderInterval))[_0x10b3('0x41')](function(_0x29719e){for(var _0x22f01a=0x0;_0x22f01a<_0x29719e[_0x10b3('0x9b')];_0x22f01a++){var _0x5615c8=_0x29719e[_0x22f01a][_0x10b3('0x16e')][_0x10b3('0x46')];if(_0x5615c8)io['to'](util[_0x10b3('0x7c')](_0x10b3('0x16f'),_0x5615c8))['emit'](_0x10b3('0x170'),{'hopper':_0x29719e[_0x22f01a]});}})[_0x10b3('0xb7')](function(_0x2062f){});};Dialer['prototype'][_0x10b3('0x171')]=function(_0x1173d3){var _0x4a6cc7=this;return function(){_0x4a6cc7[_0x10b3('0x172')](_0x1173d3);};};Dialer['prototype'][_0x10b3('0xa')]=function(_0x162bde){var _0x1e25a4=this;if(isNotPreview(_0x162bde[_0x10b3('0x166')])){if(isVoiceQueueOutbound(_0x162bde['type'])&&isActive(_0x162bde['dialActive'])){_0x162bde[_0x10b3('0xa4')]=!![];BPromise[_0x10b3('0xbd')]()['then'](checkIsLoggedIn(_0x162bde,_0x162bde['loggedIn']))[_0x10b3('0x41')](checkIsActive(_0x162bde,_0x162bde[_0x10b3('0x5d')]))[_0x10b3('0x41')](checkInterval(_0x162bde))['then'](_0x1e25a4[_0x10b3('0x173')](_0x162bde))['then'](_0x1e25a4['checkIfTime'](_0x162bde[_0x10b3('0x174')],_0x162bde['dialTimezone'],_0x162bde[_0x10b3('0x46')],_0x162bde))['then'](_0x1e25a4['checkIfTimeIntervals'](_0x162bde[_0x10b3('0x47')],_0x162bde[_0x10b3('0x175')],_0x162bde[_0x10b3('0x46')],_0x162bde))['then'](_0x1e25a4[_0x10b3('0x165')](_0x162bde))['catch'](loggerCatchQueueSummary(_0x10b3('0x176'),_0x162bde));}else{notSendMessagesQueue(_0x162bde);}}else{freeVariablesPredictive(_0x162bde);if(_0x162bde[_0x10b3('0x177')]){_0x1e25a4[_0x10b3('0x16c')](_0x162bde);}}};Dialer[_0x10b3('0xae')][_0x10b3('0x14c')]=function(){var _0x25462d=this;var _0x1f54f0;for(var _0x1d47b5 in this['campaigns']){if(typeof this[_0x10b3('0x22')][_0x1d47b5]!==_0x10b3('0x9c')){_0x1f54f0=this[_0x10b3('0x22')][_0x1d47b5];if(isCampaignIvr(_0x1f54f0[_0x10b3('0x4f')])&&isActive(_0x1f54f0[_0x10b3('0xe2')])){_0x1f54f0[_0x10b3('0xa4')]=!![];BPromise['resolve']()[_0x10b3('0x41')](checkIsActive(_0x1f54f0,_0x1f54f0['active']))[_0x10b3('0x41')](checkInterval(_0x1f54f0))['then'](_0x25462d[_0x10b3('0x173')](_0x1f54f0))[_0x10b3('0x41')](_0x25462d['checkIfTime'](_0x1f54f0[_0x10b3('0x174')],_0x1f54f0[_0x10b3('0x175')],_0x1f54f0[_0x10b3('0x46')],_0x1f54f0))[_0x10b3('0x41')](_0x25462d['checkIfTimeIntervals'](_0x1f54f0[_0x10b3('0x47')],_0x1f54f0['dialTimezone'],_0x1f54f0[_0x10b3('0x46')],_0x1f54f0))[_0x10b3('0x41')](_0x25462d[_0x10b3('0x171')](_0x1f54f0))[_0x10b3('0xb7')](loggerCatchQueueSummary(_0x10b3('0x178'),_0x1f54f0));}else{notSendMessagesCampaign(_0x1f54f0);}}}};function getCallerIdRandom(_0x1e6884,_0x206409){var _0xa04b44;var _0x206449;var _0x11fa0a;if(_0x206409<=0x0){_0x206409=0x1;}_0xa04b44=new RegExp(_0x10b3('0x179')+_0x206409+'}$');_0x206449=Math[_0x10b3('0x17a')](0xa,_0x206409-0x1);_0x11fa0a=Math[_0x10b3('0x17a')](0xa,_0x206409)-0x1;return util[_0x10b3('0x7c')]('%s',_[_0x10b3('0x17b')](_0x1e6884,_0xa04b44,_['random'](_0x206449,_0x11fa0a)));}function extractCalleridName(_0x1c5228){var _0xdae263=_0x1c5228[_0x10b3('0x17c')](/"(.*?)"/);return _0xdae263?_0xdae263[0x1]:_0x1c5228;}function extractCalleridNumber(_0x3cdbae){var _0x1d7e01=_0x3cdbae['match'](/<(.*?)>/);return _0x1d7e01?_0x1d7e01[0x1]:_0x3cdbae;}Dialer['prototype'][_0x10b3('0x17d')]=function(_0x1a7971,_0x4dbe25){var _0x4ede53=this;var _0x5e35ba=uuid['v4']();this[_0x10b3('0x27')][_0x5e35ba]=new Action(_0x1a7971,_0x4dbe25,_0x5e35ba);return new BPromise(function(_0x580610,_0x267597){if(_['isUndefined'](_0x1a7971)&&typeof _0x1a7971!==_0x10b3('0x17e')){return _0x267597(msgResponse('originate',_0x10b3('0x152'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x4dbe25[_0x10b3('0x17f')])||_0x4dbe25[_0x10b3('0x17f')]===null){return _0x267597(msgResponse(_0x10b3('0x180'),_0x10b3('0x152'),_0x10b3('0x181')));}var _0x27c8c6={'XMD-CALLERID':_0x4ede53['actions'][_0x5e35ba]['getCaller'](),'XMD-AGI':_0x1a7971['dialQueueProject']?util[_0x10b3('0x7c')](_0x10b3('0x182'),ipAgi,_0x1a7971[_0x10b3('0x116')]):_0x10b3('0x183'),'XMD-AGIAFTER':_0x1a7971['dialQueueProject2']?util[_0x10b3('0x7c')](_0x10b3('0x182'),ipAgi,_0x1a7971['dialQueueProject2']):_0x10b3('0x183'),'XMD-QUEUE':_0x1a7971[_0x10b3('0x4f')]==='outbound'?util[_0x10b3('0x7c')](_0x10b3('0x184'),_0x1a7971[_0x10b3('0x46')],_0x1a7971[_0x10b3('0x185')]||'',_0x1a7971[_0x10b3('0x11d')]?'c':'',_0x1a7971[_0x10b3('0x123')]||0x3):'NONE','XMD-CONTACTID':_0x4dbe25[_0x10b3('0x107')],'XMD-CDRTYPE':_0x10b3('0x7'),'CALLERID(all)':_0x4ede53[_0x10b3('0x27')][_0x5e35ba][_0x10b3('0x186')](),'XMD-AMD':_0x1a7971[_0x10b3('0xeb')]?_0x10b3('0x187'):_0x10b3('0x183'),'XMD-DESTINATION':_0x10b3('0xea')};if(_0x1a7971[_0x10b3('0xeb')]){_0x27c8c6['XMD-AMDINITIALSILENCE']=_0x1a7971[_0x10b3('0x188')]||0x9c4;_0x27c8c6[_0x10b3('0x189')]=_0x1a7971['dialAMDGreeting']||0x5dc;_0x27c8c6[_0x10b3('0x18a')]=_0x1a7971['dialAMDAfterGreetingSilence']||0x320;_0x27c8c6[_0x10b3('0x18b')]=_0x1a7971[_0x10b3('0x18c')]||0x1388;_0x27c8c6[_0x10b3('0x18d')]=_0x1a7971[_0x10b3('0x18e')]||0x64;_0x27c8c6[_0x10b3('0x18f')]=_0x1a7971[_0x10b3('0x190')]||0x32;_0x27c8c6[_0x10b3('0x191')]=_0x1a7971[_0x10b3('0x192')]||0x3;_0x27c8c6[_0x10b3('0x193')]=_0x1a7971[_0x10b3('0x194')]||0x100;_0x27c8c6[_0x10b3('0x195')]=_0x1a7971['dialAMDMaximumWordLength']||0x1388;}if(_0x1a7971['type']===_0x10b3('0x50')){_0x27c8c6['XMD-VOICEQUEUEID']=_0x4dbe25['VoiceQueueId'];}else{_0x27c8c6[_0x10b3('0x196')]=_0x4dbe25['CampaignId'];}for(var _0xafb542 in _0x4dbe25[_0x10b3('0x197')]){if(typeof _0x4dbe25[_0x10b3('0x197')][_0xafb542]!==_0x10b3('0x9c')){if(isNotNull(_0x4dbe25[_0x10b3('0x197')][_0xafb542])&&_0xafb542!=='id'&&_0xafb542!==_0x10b3('0x198')&&_0xafb542!=='createdAt'&&_0xafb542!==_0x10b3('0x199')){_0x27c8c6[util[_0x10b3('0x7c')](_0x10b3('0x19a'),'XMD-',_[_0x10b3('0x19b')](_0xafb542))]=_0x4dbe25[_0x10b3('0x197')][_0xafb542];}}}var _0x479cf3=_0x4ede53[_0x10b3('0xe1')](_0x1a7971['Trunk'])?getCallerId(_0x1a7971[_0x10b3('0x7a')][_0x10b3('0x19c')],_0x1a7971[_0x10b3('0x5e')],_0x1a7971[_0x10b3('0x19d')]>0x0?getCallerIdRandom(_0x1a7971[_0x10b3('0x5f')],_0x1a7971['dialRandomLastDigitCallerIdNumber']):_0x1a7971[_0x10b3('0x5f')]):getCallerId(_[_0x10b3('0xb3')](_0x1a7971[_0x10b3('0x14d')])?_0x1a7971[_0x10b3('0x7a')][_0x10b3('0x19c')]:_0x1a7971['TrunkBackup']['callerid'],_0x1a7971[_0x10b3('0x5e')],_0x1a7971['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1a7971[_0x10b3('0x5f')],_0x1a7971['dialRandomLastDigitCallerIdNumber']):_0x1a7971[_0x10b3('0x5f')]);if(_0x479cf3){_0x27c8c6[_0x10b3('0x19e')]=_0x4ede53[_0x10b3('0x27')][_0x5e35ba][_0x10b3('0x19f')]=extractCalleridName(_0x479cf3);_0x27c8c6[_0x10b3('0x1a0')]=_0x4dbe25[_0x10b3('0x17f')];}return ami[_0x10b3('0xb4')]({'actionid':_0x5e35ba,'action':'originate','channel':_0x4ede53[_0x10b3('0xe1')](_0x1a7971[_0x10b3('0x7a')])?util[_0x10b3('0x7c')](_0x10b3('0x1a1'),_0x1a7971[_0x10b3('0x7a')][_0x10b3('0x46')],isNotNull(_0x1a7971['dialPrefix'])?_0x1a7971['dialPrefix'][_0x10b3('0x1a2')]()||'':'',_0x1a7971[_0x10b3('0x1a3')]>0x0?_0x4dbe25[_0x10b3('0x17f')][_0x10b3('0x1a4')](_0x1a7971['dialCutDigit']):_0x4dbe25['phone']):util['format'](_0x10b3('0x1a1'),_['isNil'](_0x1a7971[_0x10b3('0x14d')])?_0x1a7971[_0x10b3('0x7a')][_0x10b3('0x46')]:_0x1a7971[_0x10b3('0x14d')][_0x10b3('0x46')],isNotNull(_0x1a7971['dialPrefix'])?_0x1a7971[_0x10b3('0x61')]['trim']()||'':'',_0x1a7971[_0x10b3('0x1a3')]>0x0?_0x4dbe25['phone'][_0x10b3('0x1a4')](_0x1a7971[_0x10b3('0x1a3')]):_0x4dbe25[_0x10b3('0x17f')]),'callerid':_0x479cf3,'Exten':_0x10b3('0xea'),'Context':_0x10b3('0x1a5'),'Priority':'1','variable':_0x27c8c6,'timeout':(_0x1a7971[_0x10b3('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5e35ba})[_0x10b3('0x41')](function(_0x411d58){return _0x580610(_0x411d58);})['catch'](function(_0x44ea45){_0x1a7971['outboundOriginateFailureCallsDay']+=0x1;var _0x358b16=new History(_0x4ede53['actions'][_0x5e35ba]);logger[_0x10b3('0x98')](util['format'](_0x10b3('0x1a6'),JSON[_0x10b3('0x146')](_0x44ea45)));_0x358b16[_0x10b3('0xaa')]=0xe;_0x358b16[_0x10b3('0xab')]=_0x10b3('0x1a7');_0x358b16['starttime']=moment()[_0x10b3('0x7c')](_0x10b3('0x106'));_0x358b16[_0x10b3('0xac')]=_0x358b16[_0x10b3('0xad')];_0x4ede53[_0x10b3('0xd3')](_0x358b16)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1a8')));_0x4ede53[_0x10b3('0xd2')](_0x358b16)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1a8')))['finally'](function(){delete _0x4ede53[_0x10b3('0x27')][_0x5e35ba];return _0x267597(msgResponse(_0x10b3('0x180'),_0x10b3('0x1a9'),_0x10b3('0x1aa')));});});});};Dialer[_0x10b3('0xae')]['syncOriginateResponse']=function(_0x45b57e){var _0x41b944=this['actions'][_0x45b57e[_0x10b3('0x138')]];if(_0x41b944){delete this[_0x10b3('0x27')][_0x45b57e['actionid']];_0x41b944['responsetime']=moment()['format'](_0x10b3('0x106'));var _0x5cdcd6=_0x41b944[_0x10b3('0x4f')]===_0x10b3('0x7d')?this['campaigns'][_0x41b944[_0x10b3('0xb9')]]:this['voiceQueues'][_0x41b944['getQueue']()];if(!this[_0x10b3('0x1ab')](_0x45b57e[_0x10b3('0x1ac')])){this['updateOriginated'](_0x5cdcd6);return this[_0x10b3('0x1ad')](_0x41b944,_0x5cdcd6,_0x45b57e)['catch'](loggerCatch(_0x10b3('0x1ae')));}this[_0x10b3('0x29')][_0x45b57e['uniqueid']]=_0x41b944;}};Dialer[_0x10b3('0xae')][_0x10b3('0x1af')]=function(_0x2652dc,_0x42dd0d,_0x4bebee){var _0x3fbb0a=new History(_0x42dd0d);if(_0x3fbb0a['countbusyretry']+_0x3fbb0a['countcongestionretry']+_0x3fbb0a[_0x10b3('0xfb')]+_0x3fbb0a['countnosuchnumberretry']+_0x3fbb0a['countdropretry']+_0x3fbb0a[_0x10b3('0xfe')]+_0x3fbb0a[_0x10b3('0xf8')]+_0x3fbb0a['countagentrejectretry']>=_0x4bebee['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x2652dc){case 0x3:if(_0x3fbb0a[_0x10b3('0xfb')]>=_0x4bebee[_0x10b3('0x1b0')]-0x1){return!![];}this[_0x10b3('0xc7')]({'active':![],'countnoanswerretry':_0x3fbb0a[_0x10b3('0xfb')]+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x1b1')],_0x10b3('0x105'))['format'](_0x10b3('0x106')),'ContactId':_0x3fbb0a['ContactId'],'ListId':_0x3fbb0a[_0x10b3('0xdb')],'VoiceQueueId':_0x3fbb0a[_0x10b3('0xdc')]||undefined,'CampaignId':_0x3fbb0a[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1b2')));break;case 0x5:if(_0x3fbb0a[_0x10b3('0x10c')]>=_0x4bebee[_0x10b3('0x1b3')]-0x1){return!![];}this[_0x10b3('0xc7')]({'active':![],'countbusyretry':_0x3fbb0a[_0x10b3('0x10c')]+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x1b4')],_0x10b3('0x105'))['format'](_0x10b3('0x106')),'ContactId':_0x3fbb0a['ContactId'],'ListId':_0x3fbb0a[_0x10b3('0xdb')],'VoiceQueueId':_0x3fbb0a[_0x10b3('0xdc')]||undefined,'CampaignId':_0x3fbb0a['CampaignId']||undefined})[_0x10b3('0xb7')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x3fbb0a['countcongestionretry']>=_0x4bebee['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x3fbb0a['countcongestionretry']+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x1b5')],_0x10b3('0x105'))['format'](_0x10b3('0x106')),'ContactId':_0x3fbb0a[_0x10b3('0x107')],'ListId':_0x3fbb0a[_0x10b3('0xdb')],'VoiceQueueId':_0x3fbb0a['VoiceQueueId']||undefined,'CampaignId':_0x3fbb0a['CampaignId']||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1b6')));break;case 0x0:if(_0x3fbb0a['countnosuchnumberretry']>=_0x4bebee['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x10b3('0xc7')]({'active':![],'countnosuchnumberretry':_0x3fbb0a['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x1b7')],'minutes')['format'](_0x10b3('0x106')),'ContactId':_0x3fbb0a['ContactId'],'ListId':_0x3fbb0a[_0x10b3('0xdb')],'VoiceQueueId':_0x3fbb0a[_0x10b3('0xdc')]||undefined,'CampaignId':_0x3fbb0a[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1b8')));}break;case 0xa:if(_0x3fbb0a[_0x10b3('0xfd')]>=_0x4bebee[_0x10b3('0x12b')]-0x1){return!![];}this[_0x10b3('0xc7')]({'active':![],'countdropretry':_0x3fbb0a[_0x10b3('0xfd')]+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x12c')],_0x10b3('0x105'))['format'](_0x10b3('0x106')),'ContactId':_0x3fbb0a[_0x10b3('0x107')],'ListId':_0x3fbb0a[_0x10b3('0xdb')],'VoiceQueueId':_0x3fbb0a['VoiceQueueId']||undefined,'CampaignId':_0x3fbb0a[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1b9')));break;case 0xb:if(_0x3fbb0a[_0x10b3('0xfe')]>=_0x4bebee[_0x10b3('0x1ba')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x3fbb0a['countabandonedretry']+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x130')],_0x10b3('0x105'))[_0x10b3('0x7c')](_0x10b3('0x106')),'ContactId':_0x3fbb0a[_0x10b3('0x107')],'ListId':_0x3fbb0a['ListId'],'VoiceQueueId':_0x3fbb0a[_0x10b3('0xdc')]||undefined,'CampaignId':_0x3fbb0a[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x131')));break;case 0x13:if(_0x3fbb0a[_0x10b3('0xf8')]>=_0x4bebee[_0x10b3('0x10e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3fbb0a[_0x10b3('0xf8')]+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x104')],_0x10b3('0x105'))[_0x10b3('0x7c')](_0x10b3('0x106')),'ContactId':_0x3fbb0a[_0x10b3('0x107')],'ListId':_0x3fbb0a[_0x10b3('0xdb')],'VoiceQueueId':_0x3fbb0a[_0x10b3('0xdc')]||undefined,'CampaignId':_0x3fbb0a[_0x10b3('0xdd')]||undefined})['catch'](loggerCatch(_0x10b3('0x108')));break;case 0x14:if(_0x3fbb0a[_0x10b3('0xff')]>=_0x4bebee[_0x10b3('0x1bb')]-0x1){return!![];}this[_0x10b3('0xc7')]({'active':![],'countagentrejectretry':_0x3fbb0a[_0x10b3('0xff')]+=0x1,'scheduledat':moment()[_0x10b3('0x10f')](_0x4bebee[_0x10b3('0x1bc')],'minutes')[_0x10b3('0x7c')](_0x10b3('0x106')),'ContactId':_0x3fbb0a[_0x10b3('0x107')],'ListId':_0x3fbb0a[_0x10b3('0xdb')],'VoiceQueueId':_0x3fbb0a['VoiceQueueId']||undefined,'CampaignId':_0x3fbb0a[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1bd')));break;default:return!![];}};Dialer['prototype'][_0x10b3('0x1ad')]=function(_0x43837f,_0x68e67,_0x7f5761){var _0x273fa5=this;var _0x507807=new History(_0x43837f);var _0x359412=![];var _0x57ab04;var _0xb6c016;return new BPromise(function(_0x3e1c96,_0x37543f){if(_[_0x10b3('0x43')](_0x68e67)&&typeof _0x68e67!==_0x10b3('0x17e')){return _0x37543f(msgResponse(_0x10b3('0x1be'),_0x10b3('0x152'),_0x10b3('0x1bf')));}if(_[_0x10b3('0x43')](_0x7f5761)&&typeof _0x7f5761!==_0x10b3('0x17e')){return _0x37543f(msgResponse(_0x10b3('0x1be'),_0x10b3('0x152'),_0x10b3('0x1c0')));}_0x273fa5[_0x10b3('0xc0')](_0x507807,_0x7f5761[_0x10b3('0x119')],_0x68e67)[_0x10b3('0x41')](function(_0x2da68f){if(_0x2da68f['additional']==0x1)_0x359412=!![];switch(_0x7f5761[_0x10b3('0x119')]){case'0':_0x68e67[_0x10b3('0x6a')]+=0x1;_0x507807[_0x10b3('0xaa')]=0x0;_0x507807[_0x10b3('0xab')]=_0x10b3('0x1c1');_0x507807[_0x10b3('0xfc')]+=0x1;_0x507807[_0x10b3('0x128')]+=0x1;ami['emit'](_0x10b3('0x1c2'),ut[_0x10b3('0xf2')](_0x43837f,_0x10b3('0x1c3')));_0x57ab04=_0x68e67[_0x10b3('0x1b7')];_0xb6c016=_0x68e67['callAdditionalPhoneAfterMin'];_0x273fa5[_0x10b3('0xd3')](_0x507807)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x273fa5['checkRetriveMax'](0x0,_0x43837f,_0x68e67)&&!_0x359412){if(_0x507807[_0x10b3('0xfc')]>=_0x68e67['dialNoSuchNumberMaxRetry']){_0x273fa5['createStateFinal'](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1c4'));}else{_0x273fa5[_0x10b3('0x10d')](_0x507807,_0x3e1c96,_0x37543f,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x68e67[_0x10b3('0x69')]+=0x1;_0x507807[_0x10b3('0xaa')]=0x3;_0x507807[_0x10b3('0xab')]=_0x10b3('0x1c5');_0x507807[_0x10b3('0xfb')]+=0x1;_0x507807[_0x10b3('0x128')]+=0x1;ami[_0x10b3('0xf1')](_0x10b3('0x1c6'),ut[_0x10b3('0xf2')](_0x43837f,_0x10b3('0x1c7')));_0x57ab04=_0x68e67[_0x10b3('0x1b1')];_0xb6c016=_0x68e67[_0x10b3('0x129')];_0x273fa5['createHistory'](_0x507807)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1c8')));if(_0x273fa5[_0x10b3('0x1af')](0x3,_0x43837f,_0x68e67)&&!_0x359412){if(_0x507807[_0x10b3('0xfb')]>=_0x68e67[_0x10b3('0x1b0')]){_0x273fa5[_0x10b3('0x102')](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1c9'));}else{_0x273fa5[_0x10b3('0x10d')](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1c9'));}}break;case'5':_0x68e67[_0x10b3('0x64')]+=0x1;_0x507807['state']=0x5;_0x507807['statedesc']=_0x10b3('0x1ca');_0x507807[_0x10b3('0x10c')]+=0x1;_0x507807[_0x10b3('0x128')]+=0x1;ami[_0x10b3('0xf1')]('custom:agentbusy',ut[_0x10b3('0xf2')](_0x43837f,'busy'));_0x57ab04=_0x68e67[_0x10b3('0x1b4')];_0xb6c016=_0x68e67[_0x10b3('0x129')];_0x273fa5[_0x10b3('0xd3')](_0x507807)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1cb')));if(_0x273fa5[_0x10b3('0x1af')](0x5,_0x43837f,_0x68e67)&&!_0x359412){if(_0x507807[_0x10b3('0x10c')]>=_0x68e67[_0x10b3('0x1b3')]){_0x273fa5[_0x10b3('0x102')](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1cc'));}else{_0x273fa5['stateGlobal'](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1cc'));}}break;case'8':_0x68e67[_0x10b3('0x65')]+=0x1;_0x507807[_0x10b3('0xaa')]=0x8;_0x507807[_0x10b3('0xab')]=_0x10b3('0x1cd');_0x507807[_0x10b3('0xfa')]+=0x1;_0x507807[_0x10b3('0x128')]+=0x1;_0x57ab04=_0x68e67['dialCongestionRetryFrequency'];_0xb6c016=_0x68e67[_0x10b3('0x129')];ami[_0x10b3('0xf1')](_0x10b3('0x1ce'),ut[_0x10b3('0xf2')](_0x43837f,_0x10b3('0x1cf')));_0x273fa5[_0x10b3('0xd3')](_0x507807)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1d0')));if(_0x273fa5[_0x10b3('0x1af')](0x8,_0x43837f,_0x68e67)&&!_0x359412){if(_0x507807['countcongestionretry']>=_0x68e67['dialCongestionMaxRetry']){_0x273fa5[_0x10b3('0x102')](_0x507807,_0x3e1c96,_0x37543f,'reason\x208\x20congestion');}else{_0x273fa5[_0x10b3('0x10d')](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1d1'));}}break;case'11':_0x68e67[_0x10b3('0x1d2')]+=0x1;_0x507807[_0x10b3('0xaa')]=0xb;_0x507807['statedesc']=_0x10b3('0x132');_0x507807[_0x10b3('0xfe')]+=0x1;_0x507807[_0x10b3('0x128')]+=0x1;_0x57ab04=_0x68e67[_0x10b3('0x130')];_0xb6c016=_0x68e67[_0x10b3('0x129')];_0x273fa5[_0x10b3('0xd3')](_0x507807)[_0x10b3('0xb7')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x273fa5[_0x10b3('0x1af')](0xb,_0x43837f,_0x68e67)&&!_0x359412){if(_0x507807[_0x10b3('0xfe')]>=_0x68e67[_0x10b3('0x1ba')]){_0x273fa5[_0x10b3('0x102')](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1d3'));}else{_0x273fa5[_0x10b3('0x10d')](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1d3'));}}break;case'20':_0x68e67[_0x10b3('0x6c')]+=0x1;_0x507807['state']=0x14;_0x507807[_0x10b3('0xab')]=_0x10b3('0x1d4');_0x507807[_0x10b3('0xff')]+=0x1;_0x507807['countglobal']+=0x1;_0x57ab04=_0x68e67[_0x10b3('0x1bc')];_0xb6c016=_0x68e67[_0x10b3('0x129')];ami[_0x10b3('0xf1')](_0x10b3('0x1d5'),ut['buildObj'](_0x43837f,_0x10b3('0x1d6')));_0x273fa5['createHistory'](_0x507807)['catch'](loggerCatch(_0x10b3('0x1d7')));if(_0x273fa5['checkRetriveMax'](0x14,_0x43837f,_0x68e67)&&!_0x359412){if(_0x507807[_0x10b3('0xff')]>=_0x68e67[_0x10b3('0x1bb')]){_0x273fa5[_0x10b3('0x102')](_0x507807,_0x3e1c96,_0x37543f,_0x10b3('0x1d8'));}else{_0x273fa5[_0x10b3('0x10d')](_0x507807,_0x3e1c96,_0x37543f,'reason\x2020\x20agentreject');}}break;default:_0x68e67[_0x10b3('0x6d')]+=0x1;_0x507807[_0x10b3('0xaa')]=0xc;_0x507807[_0x10b3('0xab')]=_0x7f5761[_0x10b3('0x119')];_0x57ab04=_0x68e67[_0x10b3('0x1bc')];_0xb6c016=_0x68e67[_0x10b3('0x129')];_0x273fa5[_0x10b3('0xd3')](_0x507807)[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x1d9')));if(_0x273fa5[_0x10b3('0x1af')](_0x7f5761['reason'],_0x43837f,_0x68e67)&&!_0x359412){if(_0x507807['countbusyretry']+_0x507807[_0x10b3('0xfa')]+_0x507807[_0x10b3('0xfb')]+_0x507807[_0x10b3('0xfc')]+_0x507807[_0x10b3('0xfd')]+_0x507807['countabandonedretry']+_0x507807[_0x10b3('0xf8')]+_0x507807['countagentrejectretry']>=_0x68e67['dialGlobalMaxRetry']){_0x273fa5[_0x10b3('0x10d')](_0x507807,_0x3e1c96,_0x37543f,_0x7f5761[_0x10b3('0x119')]);}else{_0x273fa5[_0x10b3('0x102')](_0x507807,_0x3e1c96,_0x37543f,_0x7f5761['reason']);}}}})[_0x10b3('0x41')](function(_0x66b882){if(_0x359412){_0x273fa5[_0x10b3('0x135')](_0x507807,_0x57ab04,_0xb6c016)[_0x10b3('0x41')](function(_0x1b4df6){return _0x3e1c96(0x1);});}});});};Dialer[_0x10b3('0xae')][_0x10b3('0x10d')]=function(_0x2a525e,_0x48519b,_0x1302a8,_0x58ab44){var _0x2ba92b=new Final(_0x2a525e);_0x2ba92b['state']=0xf;_0x2ba92b[_0x10b3('0xab')]=_0x10b3('0x1da');this[_0x10b3('0x102')](_0x2ba92b,_0x48519b,_0x1302a8,_0x58ab44);};Dialer[_0x10b3('0xae')]['createStateFinal']=function(_0x249bde,_0x3a75f9,_0x58637b,_0x4183db){this[_0x10b3('0xd2')](_0x249bde)[_0x10b3('0x41')](function(){return _0x3a75f9(msgResponse('[callProgressDetecting]',_0x10b3('0xe0'),_0x4183db));})[_0x10b3('0xb7')](function(){return _0x58637b(msgResponse('[moveContactManagedDialer][0]',_0x10b3('0x152'),_0x10b3('0x1db')));});};Dialer[_0x10b3('0xae')]['predictive']=function(_0x8d677a){var _0x27856b=_0x8d677a['dialPredictiveOptimizationPercentage']/0x64;var _0x4ad90e=_0x8d677a[_0x10b3('0x68')]/(_0x8d677a['outboundDropCallsDayTimeout']+_0x8d677a['outboundAnswerCallsDay']);var _0x198528=Math['round'](_0x8d677a[_0x10b3('0x76')]*(_0x8d677a['predictiveIntervalMaxThreshold']/0x64));var _0x6dda7f=Math[_0x10b3('0x1dc')](_0x8d677a[_0x10b3('0x76')]*(_0x8d677a[_0x10b3('0x1dd')]/0x64));var _0x1c86d2=_0x8d677a['available']+_0x8d677a[_0x10b3('0x58')];var _0x3083e9=Math[_0x10b3('0x1de')](_0x8d677a[_0x10b3('0x78')]*_0x8d677a['erlangAbandonmentRate']*_0x8d677a[_0x10b3('0x73')]*_0x8d677a[_0x10b3('0x74')]);if(_[_0x10b3('0x43')](_0x8d677a[_0x10b3('0x2c')])){if(!_[_0x10b3('0x43')](_0x8d677a[_0x10b3('0x2b')])){_0x8d677a[_0x10b3('0x2b')]=undefined;loggerPredictive[_0x10b3('0x98')](_0x10b3('0x1df'),_0x10b3('0x1e0'));}if(!_[_0x10b3('0x43')](_0x8d677a[_0x10b3('0x93')])){loggerPredictive[_0x10b3('0x98')](_0x10b3('0x1df'),_0x10b3('0x1e1'));clearInterval(_0x8d677a[_0x10b3('0x93')]);_0x8d677a['handlePredictive']=undefined;}_0x8d677a[_0x10b3('0x2c')]=moment()[_0x10b3('0x7c')](_0x10b3('0x106'));loggerPredictive['info'](_0x8d677a[_0x10b3('0x46')],_0x10b3('0x1e2'),_0x8d677a['startProgressive']);this[_0x10b3('0x168')](_0x8d677a,0x1);}else if(ifInterval(_0x8d677a[_0x10b3('0x1e3')],_0x8d677a[_0x10b3('0x2c')])){this[_0x10b3('0x168')](_0x8d677a,0x1);loggerPredictiveCalls[_0x10b3('0x80')](_0x10b3('0x1e4'),_0x8d677a['startProgressive'],_0x8d677a[_0x10b3('0x46')]);_0x8d677a[_0x10b3('0x78')]=0x0;_0x8d677a['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x27856b<_0x4ad90e&&_0x8d677a[_0x10b3('0x1e5')]===_0x10b3('0x1e6')){freeVariablesPredictive(_0x8d677a);loggerPredictive[_0x10b3('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x4ad90e,_0x10b3('0x2c'),_0x8d677a[_0x10b3('0x46')]);}else if(_0x3083e9<_0x8d677a[_0x10b3('0x72')]&&_0x8d677a[_0x10b3('0x1e5')]==='dropRate'){freeVariablesPredictive(_0x8d677a);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x1e7'),_0x10b3('0x1e8'),_0x3083e9,_0x10b3('0x1e9'),_0x8d677a[_0x10b3('0x72')],_0x10b3('0x2c'),_0x8d677a[_0x10b3('0x46')]);}else if(!ifInterval(_0x8d677a[_0x10b3('0x1e3')],_0x8d677a[_0x10b3('0x2c')])&&_['isUndefined'](_0x8d677a['startPredictive'])&&!_[_0x10b3('0x43')](_0x8d677a['startProgressive'])){_0x8d677a['startPredictive']=moment()[_0x10b3('0x7c')](_0x10b3('0x106'));loggerPredictive['info'](_0x8d677a[_0x10b3('0x46')],_0x10b3('0x1ea'),_0x8d677a[_0x10b3('0x2b')]);this[_0x10b3('0x1eb')](_0x8d677a[_0x10b3('0x1e3')])[_0x10b3('0x41')](this['getDataPredictive'](_0x8d677a))[_0x10b3('0x41')](mergeDataErlangB(_0x8d677a))[_0x10b3('0x41')](this[_0x10b3('0x1ec')](_0x8d677a))[_0x10b3('0xb7')](loggerCatchPredictive(_0x10b3('0x1ed'),_0x8d677a));}else if(!ifInterval(_0x8d677a['dialPredictiveInterval'],_0x8d677a['startPredictive'])){_0x8d677a[_0x10b3('0x72')]=0x0;_0x8d677a[_0x10b3('0x2b')]=moment()[_0x10b3('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x10b3('0x80')](_0x8d677a[_0x10b3('0x46')],_0x10b3('0x1ee'),_0x8d677a['startPredictive']);clearInterval(_0x8d677a['handlePredictive']);_0x8d677a[_0x10b3('0x93')]=undefined;this['averageHandleTime'](_0x8d677a[_0x10b3('0x1e3')])[_0x10b3('0x41')](this[_0x10b3('0x1ef')](_0x8d677a))['then'](mergeDataErlangB(_0x8d677a))[_0x10b3('0x41')](this[_0x10b3('0x1ec')](_0x8d677a))[_0x10b3('0xb7')](loggerCatchPredictive(_0x10b3('0x1f0'),_0x8d677a));}else if(_0x8d677a[_0x10b3('0x76')]&&_0x1c86d2<_0x8d677a[_0x10b3('0x76')]-_0x6dda7f){freeVariablesPredictive(_0x8d677a);loggerPredictive[_0x10b3('0x80')](_0x8d677a[_0x10b3('0x46')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1c86d2,_0x10b3('0x1f1'),_0x8d677a[_0x10b3('0x76')],'-',_0x6dda7f,'=',_0x8d677a[_0x10b3('0x76')]-_0x6dda7f,')');}else if(_0x8d677a[_0x10b3('0x76')]&&_0x1c86d2>_0x8d677a['predictiveIntervalAvailable']+_0x198528){freeVariablesPredictive(_0x8d677a);loggerPredictive['info'](_0x8d677a[_0x10b3('0x46')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1c86d2,_0x10b3('0x1f2'),_0x8d677a[_0x10b3('0x76')],'+',_0x198528,'=',_0x8d677a[_0x10b3('0x76')]+_0x198528,')');}};Dialer['prototype'][_0x10b3('0x1ef')]=function(_0x4fae36){var _0x35bc36=this;return function(_0x8bcc99){return new BPromise(function(_0x21ef75,_0x356c1e){_[_0x10b3('0xd9')](_0x4fae36,_0x8bcc99[0x0]);if(checkGetDataPredictive(_0x8bcc99[0x0])){var _0x173f94=_0x4fae36[_0x10b3('0x76')]=_0x4fae36[_0x10b3('0x58')]+_0x4fae36[_0x10b3('0x52')];var _0x40bcf6=_0x4fae36[_0x10b3('0x1e3')]*0x3c;var _0x544345=_0x8bcc99[0x0]['predictiveIntervalAvgTalktime']+_0x8bcc99[0x0]['predictiveIntervalAvgHoldtime'];var _0x1e4a58=(_0x8bcc99[0x0][_0x10b3('0x6e')]+_0x8bcc99[0x0][_0x10b3('0x124')]+_0x8bcc99[0x0][_0x10b3('0x71')])/_0x8bcc99[0x0]['predictiveIntervalTotalCalls'];_0x4fae36[_0x10b3('0x73')]=_0x1e4a58>0x0?_0x1e4a58:0x1;switch(_0x4fae36[_0x10b3('0x1e5')]){case _0x10b3('0x1e6'):var _0x2dc43e=_0x4fae36[_0x10b3('0x1f3')]/0x64;return _0x35bc36[_0x10b3('0x1f4')](_0x173f94,_0x40bcf6,_0x544345,_0x1e4a58,_0x2dc43e)[_0x10b3('0x41')](function(_0xe9bd9a){return _0x21ef75(_0xe9bd9a);});case _0x10b3('0x1f5'):var _0x5082d2=_0x4fae36[_0x10b3('0x1f3')]/0x64;return _0x35bc36[_0x10b3('0x1f6')](_0x173f94,_0x40bcf6,_0x544345,_0x1e4a58,_0x5082d2)[_0x10b3('0x41')](function(_0x409d87){return _0x21ef75(_0x409d87);});default:return _0x356c1e(msgResponse('[getDataPredictive]',_0x10b3('0x152'),_0x10b3('0x1f7')));}}else{return _0x356c1e(msgResponse(_0x10b3('0x1f8'),_0x10b3('0x152'),_0x10b3('0x1f9')));}});};};Dialer[_0x10b3('0xae')][_0x10b3('0x1fa')]=function(_0x1ee85d){var _0x20bc4a=this;return function(_0x43b489){return new BPromise(function(_0xfe43bb,_0x755d4c){_['merge'](_0x1ee85d,_0x43b489[0x0]);if(checkGetDataPredictive(_0x43b489[0x0])){loggerPredictive[_0x10b3('0x80')](JSON[_0x10b3('0x146')](_0x43b489[0x0]));if(_0x1ee85d['dialPredictiveOptimization']==='dropRate'){return _0x20bc4a[_0x10b3('0xd0')](_0x1ee85d['id'])['then'](function(_0x3fe53e){var _0x3ab907=_0x1ee85d['loggedIn']-_0x3fe53e[0x0]['outboundQueuePauses'];var _0x1eb191=_0x1ee85d[_0x10b3('0x1e3')]*0x3c;var _0x5e16fd=_0x43b489[0x0][_0x10b3('0x70')]+_0x43b489[0x0][_0x10b3('0x6f')];var _0x4243be=(_0x43b489[0x0][_0x10b3('0x6e')]+_0x43b489[0x0][_0x10b3('0x124')]+_0x43b489[0x0][_0x10b3('0x71')])/_0x43b489[0x0][_0x10b3('0x82')];var _0x4a28db=_0x1ee85d['dialPredictiveOptimizationPercentage']/0x64;_0x1ee85d[_0x10b3('0x75')]=_0x3fe53e[0x0][_0x10b3('0x1fb')]||0x0;_0x1ee85d[_0x10b3('0x73')]=_0x4243be>0x0?_0x4243be:0x1;return _0x20bc4a[_0x10b3('0x1f4')](_0x3ab907,_0x1eb191,_0x5e16fd,_0x4243be,_0x4a28db);})[_0x10b3('0x41')](function(_0x46059e){return _0xfe43bb(_0x46059e);})['catch'](function(_0x4c017e){return _0x755d4c(msgResponse(_0x10b3('0x1fc'),'Failure',JSON[_0x10b3('0x146')](_0x4c017e)));});}if(_0x1ee85d[_0x10b3('0x1e5')]==='agentBusyFactor'){return _0x20bc4a[_0x10b3('0xd0')](_0x1ee85d['id'])[_0x10b3('0x41')](function(_0x226ce2){var _0x2a5dba=_0x1ee85d[_0x10b3('0x53')]-_0x226ce2[0x0][_0x10b3('0x1fb')];var _0x1a77c0=_0x1ee85d[_0x10b3('0x1e3')]*0x3c;var _0x30721b=_0x43b489[0x0][_0x10b3('0x70')]+_0x43b489[0x0][_0x10b3('0x6f')];var _0x6e3e97=(_0x43b489[0x0]['predictiveIntervalAnsweredCalls']+_0x43b489[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x43b489[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x43b489[0x0][_0x10b3('0x82')];var _0x1f3028=_0x1ee85d[_0x10b3('0x1f3')]/0x64;_0x1ee85d[_0x10b3('0x75')]=_0x226ce2[0x0]['outboundQueuePauses']||0x0;_0x1ee85d['predictiveIntervalHitRate']=_0x6e3e97>0x0?_0x6e3e97:0x1;return _0x20bc4a[_0x10b3('0x1f6')](_0x2a5dba,_0x1a77c0,_0x30721b,_0x6e3e97,_0x1f3028);})[_0x10b3('0x41')](function(_0x1c2dd7){return _0xfe43bb(_0x1c2dd7);})[_0x10b3('0xb7')](function(_0xfd78c0){return _0x755d4c(msgResponse(_0x10b3('0x1fc'),'Failure',JSON['stringify'](_0xfd78c0)));});}}else{return _0x755d4c(msgResponse(_0x10b3('0x1f8'),_0x10b3('0x152'),_0x10b3('0x1f9')));}});};};Dialer['prototype'][_0x10b3('0x1ec')]=function(_0x25cc3b){var _0x4d2351=this;return function(){var _0x41f0a8=0x0;var _0x228499=Math[_0x10b3('0x1de')](_0x25cc3b[_0x10b3('0x79')]*0x3e8);if(_0x228499>0x0){_0x228499=_0x228499<0x64?0x64:_0x228499;loggerPredictive[_0x10b3('0x80')](_0x25cc3b[_0x10b3('0x46')],_0x10b3('0x1fd'),_0x228499,_0x10b3('0x4c'));_0x25cc3b[_0x10b3('0x93')]=setInterval(function(){_0x4d2351[_0x10b3('0x93')](_0x25cc3b);loggerPredictiveCalls[_0x10b3('0x80')](_0x10b3('0x1fe'),_0x41f0a8+=0x1);},_0x228499);}else{loggerPredictive['info'](_0x25cc3b[_0x10b3('0x46')],_0x10b3('0x1ff'));}};};Dialer[_0x10b3('0xae')][_0x10b3('0x200')]=function(_0x3a8cf0,_0xf83872){var _0x192bef=this;return function(_0x38a25a){if(_[_0x10b3('0x7f')](_0x38a25a)){if(_['isNil'](_0xf83872[_0x10b3('0x201')])||!_0xf83872['recallme']){if(_0x3a8cf0['dialMethod']==='booked'){_0x3a8cf0[_0x10b3('0x13e')]=_['isUndefined'](_0x3a8cf0[_0x10b3('0x13e')])?!![]:_0x3a8cf0[_0x10b3('0x13e')];var _0x15cc32=uuid['v4']();_0x192bef['actions'][_0x15cc32]=new Action(_0x3a8cf0,_0xf83872,_0x15cc32);loggerBooked[_0x10b3('0x80')](_0x10b3('0x202'),_0x15cc32,'queueStatusComplete:\x20',JSON[_0x10b3('0x146')](_0x3a8cf0[_0x10b3('0x13e')]),_0x10b3('0x203'),_0x3a8cf0[_0x10b3('0x46')]);if(_0x3a8cf0[_0x10b3('0x13e')]){_0x3a8cf0[_0x10b3('0x13e')]=![];_0x192bef['queueBooked'][_0x192bef[_0x10b3('0x27')][_0x15cc32][_0x10b3('0xb9')]]=[];ami[_0x10b3('0xb4')]({'actionid':_0x15cc32,'action':_0x10b3('0x204'),'queue':_0x3a8cf0[_0x10b3('0x46')]})[_0x10b3('0xb7')](function(){_0x192bef[_0x10b3('0xb8')](_0x3a8cf0);_0x192bef[_0x10b3('0xc7')]({'active':![],'ContactId':_0x192bef['actions'][_0x15cc32][_0x10b3('0x107')],'ListId':_0x192bef[_0x10b3('0x27')][_0x15cc32][_0x10b3('0xdb')],'VoiceQueueId':_0x192bef['actions'][_0x15cc32][_0x10b3('0xdc')]||undefined,'CampaignId':_0x192bef[_0x10b3('0x27')][_0x15cc32][_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x205')));delete _0x192bef['actions'][_0x15cc32];});}else{loggerBooked[_0x10b3('0x80')](_0x10b3('0x206'),JSON['stringify'](_0x3a8cf0[_0x10b3('0x13e')]),_0x10b3('0x203'),_0x3a8cf0[_0x10b3('0x46')]);_0x192bef[_0x10b3('0xb8')](_0x3a8cf0);_0x192bef[_0x10b3('0xc7')]({'active':![],'ContactId':_0x192bef['actions'][_0x15cc32][_0x10b3('0x107')],'ListId':_0x192bef[_0x10b3('0x27')][_0x15cc32][_0x10b3('0xdb')],'VoiceQueueId':_0x192bef[_0x10b3('0x27')][_0x15cc32][_0x10b3('0xdc')]||undefined,'CampaignId':_0x192bef[_0x10b3('0x27')][_0x15cc32][_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x192bef[_0x10b3('0x27')][_0x15cc32];}}else{return _0x192bef[_0x10b3('0x17d')](_0x3a8cf0,_0xf83872);}}else{if(getDiff(_0xf83872[_0x10b3('0x207')])<_0x3a8cf0[_0x10b3('0x208')]*0x3c){if(_0xf83872[_0x10b3('0x16e')]&&!_0xf83872[_0x10b3('0x16e')][_0x10b3('0x209')]){_0x192bef[_0x10b3('0x95')][_0x10b3('0x140')](_0xf83872['id'])['finally'](function(){_0x192bef['updateOriginated'](_0x3a8cf0);});}else{_0x192bef[_0x10b3('0xc9')]({'active':![]},_0xf83872['id'],0x1)[_0x10b3('0x1f')](function(){_0x192bef[_0x10b3('0xb8')](_0x3a8cf0);});}}else{_0x3a8cf0[_0x10b3('0x6b')]+=0x1;_0x192bef[_0x10b3('0xb8')](_0x3a8cf0);if(_0x3a8cf0[_0x10b3('0x20a')]){_0x192bef['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xf83872[_0x10b3('0x107')],'ListId':_0xf83872['ListId'],'VoiceQueueId':_0xf83872[_0x10b3('0xdc')]||undefined,'CampaignId':_0xf83872[_0x10b3('0xdd')]||undefined})[_0x10b3('0xb7')](loggerCatch(_0x10b3('0x20b')));_0x192bef[_0x10b3('0xd3')](createObjHistory(_0x3a8cf0,_0xf83872,_0x10b3('0x20c'),0x17,_0x10b3('0x20d')))['catch'](loggerCatch(_0x10b3('0x20e')));}else{_0x192bef['saveInDb'](createObjHistory(_0x3a8cf0,_0xf83872,_0x10b3('0x20f'),0x16,_0x10b3('0x210')),'[Originate][HistoryRecallClose][historyCatch]',_0x10b3('0x211'));}}}}else{_0x3a8cf0[_0x10b3('0x63')]+=0x1;_0x192bef['saveInDb'](createObjHistory(_0x3a8cf0,_0xf83872,_0x10b3('0x212'),0xd,_0x10b3('0x213')),_0x10b3('0x214'),_0x10b3('0x215'));throw _0x10b3('0x216');}};};Dialer[_0x10b3('0xae')][_0x10b3('0x172')]=function(_0x2b2cc8){var _0x1563c4=this;var _0x4c4ff8=_0x2b2cc8['limitCalls']-_0x2b2cc8[_0x10b3('0x77')]-_0x2b2cc8['temp'];emitCampaignSummary(_0x2b2cc8);if(_0x4c4ff8>0x0){if(_0x4c4ff8>this[_0x10b3('0x25')]){_0x4c4ff8=this[_0x10b3('0x25')];}_0x2b2cc8[_0x10b3('0xcc')]+=_0x4c4ff8;this[_0x10b3('0xce')](_0x2b2cc8['id'],_0x4c4ff8,_0x2b2cc8[_0x10b3('0x217')],_0x2b2cc8)[_0x10b3('0x41')](function(_0x36a2e6){_0x2b2cc8[_0x10b3('0xcc')]-=_0x4c4ff8;_0x2b2cc8[_0x10b3('0xcc')]=_0x2b2cc8[_0x10b3('0xcc')]>0x0?_0x2b2cc8[_0x10b3('0xcc')]:0x0;if(!checkContactEmpty(_0x36a2e6)){_0x2b2cc8['message']=_0x10b3('0xa3');logger[_0x10b3('0x80')](_0x10b3('0x218')+_0x2b2cc8[_0x10b3('0x46')]);}else{_0x2b2cc8[_0x10b3('0x77')]+=_0x36a2e6[_0x10b3('0x9b')];_0x2b2cc8[_0x10b3('0x44')]=_0x10b3('0x219');for(var _0x215f15=0x0;_0x215f15<_0x36a2e6[_0x10b3('0x9b')];_0x215f15+=0x1){_0x2b2cc8[_0x10b3('0x21a')]+=0x1;if(_[_0x10b3('0xb3')](_0x36a2e6[_0x215f15])||_['isNil'](_0x36a2e6[_0x215f15][_0x10b3('0x197')])||_[_0x10b3('0xb3')](_0x36a2e6[_0x215f15]['phone'])){_0x1563c4[_0x10b3('0x21b')](_0x10b3('0x21c'),_0x2b2cc8,_0x36a2e6[_0x215f15]);}else{_0x1563c4['checkIsBlackListIvr'](_[_0x10b3('0xda')](_0x36a2e6[_0x215f15],[_0x10b3('0xdd'),'Contact.phone']))['then'](_0x1563c4['checkContactBlack'](_0x2b2cc8,_0x36a2e6[_0x215f15]))[_0x10b3('0xb7')](_0x1563c4[_0x10b3('0x21d')](_0x10b3('0x21e'),_0x2b2cc8));}}}})['catch'](loggerGetContactDialer(_0x10b3('0x21f'),_0x2b2cc8,_0x4c4ff8));}};Dialer[_0x10b3('0xae')][_0x10b3('0x168')]=function(_0x2cfe90,_0x5b7572){var _0x57ae6d=this;var _0x11f1e6=[];var _0x410036=_0x5b7572>=0x1?_0x5b7572:0x1;if(_0x2cfe90[_0x10b3('0x166')]===_0x10b3('0x8')){_0x410036=0x1;}var _0x1bb7fb=Math[_0x10b3('0x1de')](_0x2cfe90[_0x10b3('0x52')]*_0x410036)-_0x2cfe90[_0x10b3('0x77')]-_0x2cfe90['temp'];emitVoiceQueueSummary(_0x2cfe90);if(_0x2cfe90[_0x10b3('0x220')]>0x0){var _0x447dd6=_0x2cfe90[_0x10b3('0x220')]-_0x2cfe90[_0x10b3('0x77')]-_0x2cfe90[_0x10b3('0x58')]-_0x2cfe90[_0x10b3('0xcc')]-_0x2cfe90['pTalking'];if(_0x1bb7fb>_0x447dd6){_0x1bb7fb=_0x447dd6;}}if(_0x1bb7fb>0x0){if(_0x2cfe90[_0x10b3('0x166')]===_0x10b3('0x8')){_0x1bb7fb=0x1;}if(_0x1bb7fb>this[_0x10b3('0x25')]){_0x1bb7fb=this[_0x10b3('0x25')];}_0x2cfe90[_0x10b3('0xcc')]+=_0x1bb7fb;for(var _0x489a40 in this[_0x10b3('0x23')]){if(typeof this[_0x10b3('0x23')][_0x489a40]!==_0x10b3('0x9c')){if(this['agents'][_0x489a40][_0x10b3('0xaa')]==='not_inuse'&&this[_0x10b3('0x23')][_0x489a40][_0x10b3('0xb5')]===_0x10b3('0xe4')){_0x11f1e6[_0x10b3('0x13c')](this[_0x10b3('0x23')][_0x489a40]['id']);}}}this[_0x10b3('0xcb')](_0x2cfe90['id'],_0x11f1e6,_0x1bb7fb,_0x2cfe90[_0x10b3('0x217')],_0x2cfe90)['then'](function(_0x2e3648){_0x2cfe90[_0x10b3('0xcc')]-=_0x1bb7fb;_0x2cfe90['temp']=_0x2cfe90[_0x10b3('0xcc')]>0x0?_0x2cfe90['temp']:0x0;if(!checkContactEmpty(_0x2e3648)){_0x57ae6d['countReScheduled'](_0x2cfe90)[_0x10b3('0x41')](sendMessageReschedule(_0x2cfe90))['catch'](loggerCatch(_0x10b3('0xbe')));}else{_0x2cfe90[_0x10b3('0x77')]+=_0x2e3648['length'];_0x2cfe90[_0x10b3('0x44')]=_0x2cfe90['dialMethod']===_0x10b3('0x8')?_0x10b3('0x187'):_0x10b3('0x219');for(var _0x2ca560=0x0;_0x2ca560<_0x2e3648[_0x10b3('0x9b')];_0x2ca560+=0x1){if(_['isNil'](_0x2e3648[_0x2ca560])||_['isNil'](_0x2e3648[_0x2ca560][_0x10b3('0x197')])||_[_0x10b3('0xb3')](_0x2e3648[_0x2ca560][_0x10b3('0x17f')])){_0x57ae6d[_0x10b3('0x21b')](_0x10b3('0x21c'),_0x2cfe90,_0x2e3648[_0x2ca560]);}else{_0x57ae6d[_0x10b3('0x221')](_[_0x10b3('0xda')](_0x2e3648[_0x2ca560],['VoiceQueueId',_0x10b3('0x222')]))['then'](_0x57ae6d[_0x10b3('0x200')](_0x2cfe90,_0x2e3648[_0x2ca560]))['catch'](_0x57ae6d[_0x10b3('0x21d')]('[actionOriginate]\x20',_0x2cfe90));}}}})[_0x10b3('0xb7')](loggerGetContactDialer(_0x10b3('0x223'),_0x2cfe90,_0x1bb7fb));}};Dialer['prototype']['handlePredictive']=function(_0xb7cb1b){if(_0xb7cb1b[_0x10b3('0x220')]>0x0){var _0x4a8ee7=_0xb7cb1b[_0x10b3('0x220')]-_0xb7cb1b[_0x10b3('0x77')]-_0xb7cb1b['talking'];if(_0x4a8ee7>0x0){this[_0x10b3('0x224')](_0xb7cb1b);}else{loggerPredictiveCalls[_0x10b3('0x80')](_0x10b3('0x225'));}}else{this[_0x10b3('0x224')](_0xb7cb1b);}};Dialer[_0x10b3('0xae')]['tryOriginatePredictive']=function(_0x3a51bf){var _0xd7a6c1=this;var _0x5535c8=[];_0x3a51bf[_0x10b3('0x77')]+=0x1;for(var _0x1c8689 in this[_0x10b3('0x23')]){if(typeof this[_0x10b3('0x23')][_0x1c8689]!==_0x10b3('0x9c')){if(this[_0x10b3('0x23')][_0x1c8689]['state']===_0x10b3('0x226')&&this[_0x10b3('0x23')][_0x1c8689][_0x10b3('0xb5')]===_0x10b3('0xe4')){_0x5535c8[_0x10b3('0x13c')](this[_0x10b3('0x23')][_0x1c8689]['id']);}}}this[_0x10b3('0xcb')](_0x3a51bf['id'],_0x5535c8,0x1,_0x3a51bf[_0x10b3('0x217')],_0x3a51bf)['then'](function(_0x1002d1){if(!checkContactEmpty(_0x1002d1)){checkContactLowerLimitOriginate(_0x3a51bf,0x1,0x0);_0xd7a6c1[_0x10b3('0xbc')](_0x3a51bf)['then'](sendMessageReschedule(_0x3a51bf))[_0x10b3('0xb7')](loggerCatch(_0x10b3('0xbe')));}else{_0x3a51bf[_0x10b3('0x44')]=_0x10b3('0x219');if(_[_0x10b3('0xb3')](_0x1002d1[0x0])||_[_0x10b3('0xb3')](_0x1002d1[0x0]['Contact'])||_[_0x10b3('0xb3')](_0x1002d1[0x0][_0x10b3('0x17f')])){_0xd7a6c1[_0x10b3('0x21b')](_0x10b3('0x21c'),_0x3a51bf,_0x1002d1[0x0]);}else{_0xd7a6c1[_0x10b3('0x221')](_[_0x10b3('0xda')](_0x1002d1[0x0],['VoiceQueueId',_0x10b3('0x222')]))[_0x10b3('0x41')](_0xd7a6c1[_0x10b3('0x200')](_0x3a51bf,_0x1002d1[0x0]))[_0x10b3('0xb7')](_0xd7a6c1[_0x10b3('0x21d')](_0x10b3('0x227'),_0x3a51bf));}}})[_0x10b3('0xb7')](loggerGetContactDialer(_0x10b3('0x228'),_0x3a51bf,0x1));emitVoiceQueueSummary(_0x3a51bf);};Dialer[_0x10b3('0xae')][_0x10b3('0x1f4')]=function(_0x4f9892,_0x33ffdc,_0x219305,_0x4c6f45,_0x540603,_0x3dfaaa){loggerPredictive['info'](_0x10b3('0x229'));loggerPredictive['info'](_0x10b3('0x22a'),_0x4f9892);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x22b'),_0x33ffdc);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x22c'),_0x219305);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x22d'),_0x4c6f45);loggerPredictive[_0x10b3('0x80')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x540603);loggerPredictive[_0x10b3('0x80')](_0x10b3('0x87'));return new BPromise(function(_0x33ac6f,_0x434093){if(_0x4f9892<=0x0||isNaN(_0x4f9892)){return _0x434093(msgResponse(_0x10b3('0x22e'),_0x10b3('0x1a9'),'m\x20=\x20'+_0x4f9892));}if(_0x219305<=0x0||isNaN(_0x219305)){return _0x434093(msgResponse(_0x10b3('0x22e'),_0x10b3('0x1a9'),_0x10b3('0x22f')+_0x219305));}if(_0x4c6f45<=0x0||isNaN(_0x4c6f45)){return _0x434093(msgResponse(_0x10b3('0x22e'),'Error',_0x10b3('0x230')+_0x4c6f45));}if(_0x33ffdc<=0x0||isNaN(_0x33ffdc)){return _0x434093(msgResponse(_0x10b3('0x22e'),'Error',_0x10b3('0x231')+_0x33ffdc));}if(_0x540603<=0x0||isNaN(_0x540603)){return _0x434093(msgResponse(_0x10b3('0x22e'),'Error',_0x10b3('0x232')+_0x540603));}_0x3dfaaa=_0x3dfaaa||0x0;var _0x5387c5=0x1/_0x219305;var _0x3bfbea=0x0;var _0x482716=0x0;var _0x225c1c=0x0;var _0x9e0fb2=0x0;for(var _0x358b1a=0x0;_0x225c1c<_0x540603;_0x358b1a+=0x1){_0x482716=_0x358b1a/_0x33ffdc;_0x3bfbea=(_0x4c6f45*_0x482716+_0x3dfaaa)/_0x5387c5;_0x225c1c=erlangb(_0x3bfbea,_0x4f9892);_0x9e0fb2=_0x3bfbea/_0x4f9892*(0x1-erlangb(_0x3bfbea,_0x4f9892));}return _0x33ac6f({'erlangCalls':_0x358b1a,'erlangCallToSecond':_0x33ffdc/_0x358b1a,'erlangAbandonmentRate':_0x225c1c,'erlangBusyFactor':_0x9e0fb2});});};Dialer[_0x10b3('0xae')][_0x10b3('0x1f6')]=function(_0x7aa801,_0x3e576d,_0x349ac5,_0x4cf38d,_0x45a01f,_0x59a249){loggerPredictive[_0x10b3('0x80')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x10b3('0x80')](_0x10b3('0x22a'),_0x7aa801);loggerPredictive[_0x10b3('0x80')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e576d);loggerPredictive[_0x10b3('0x80')]('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',_0x349ac5);loggerPredictive[_0x10b3('0x80')]('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',_0x4cf38d);loggerPredictive[_0x10b3('0x80')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45a01f);loggerPredictive['info'](_0x10b3('0x87'));return new BPromise(function(_0x3a1535,_0x3b7789){if(_0x7aa801<=0x0||isNaN(_0x7aa801)){return _0x3b7789(msgResponse(_0x10b3('0x233'),_0x10b3('0x1a9'),_0x10b3('0x234')+_0x7aa801));}if(_0x349ac5<=0x0||isNaN(_0x349ac5)){return _0x3b7789(msgResponse(_0x10b3('0x233'),_0x10b3('0x1a9'),_0x10b3('0x22f')+_0x349ac5));}if(_0x4cf38d<=0x0||isNaN(_0x4cf38d)){return _0x3b7789(msgResponse(_0x10b3('0x233'),_0x10b3('0x1a9'),'p\x20=\x20'+_0x4cf38d));}if(_0x3e576d<=0x0||isNaN(_0x3e576d)){return _0x3b7789(msgResponse(_0x10b3('0x233'),'Error',_0x10b3('0x231')+_0x3e576d));}if(_0x45a01f<=0x0||isNaN(_0x45a01f)){return _0x3b7789(msgResponse(_0x10b3('0x233'),_0x10b3('0x1a9'),_0x10b3('0x235')+_0x45a01f));}_0x59a249=_0x59a249||0x0;var _0x1c099a=0x1/_0x349ac5;var _0x431241=0x0;var _0x49c8b0=0x0;var _0x540fcb=0x0;var _0x1a551e=0x0;for(var _0x3f4edc=0x0;_0x1a551e<_0x45a01f;_0x3f4edc+=0x1){_0x49c8b0=_0x3f4edc/_0x3e576d;_0x431241=(_0x4cf38d*_0x49c8b0+_0x59a249)/_0x1c099a;_0x540fcb=erlangb(_0x431241,_0x7aa801);_0x1a551e=_0x431241/_0x7aa801*(0x1-erlangb(_0x431241,_0x7aa801));}return _0x3a1535({'erlangCalls':_0x3f4edc,'erlangCallToSecond':_0x3e576d/_0x3f4edc,'erlangAbandonmentRate':_0x540fcb,'erlangBusyFactor':_0x1a551e});});};module[_0x10b3('0x236')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 9ac3c6a..ba25f45 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc051=['name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid'];(function(_0x465797,_0x2bbdb8){var _0x5554d8=function(_0x369bcd){while(--_0x369bcd){_0x465797['push'](_0x465797['shift']());}};_0x5554d8(++_0x2bbdb8);}(_0xc051,0xb5));var _0x1c05=function(_0x5cb3ea,_0x2c9f96){_0x5cb3ea=_0x5cb3ea-0x0;var _0x5af664=_0xc051[_0x5cb3ea];return _0x5af664;};'use strict';var util=require(_0x1c05('0x0'));var _=require(_0x1c05('0x1'));var moment=require('moment');function getSeconds(_0x49a96e,_0x502bb6){var _0x3d0368=moment(_0x49a96e)[_0x1c05('0x2')](0x0);var _0xd5f638=moment(_0x502bb6)['milliseconds'](0x0);return _0x3d0368[_0x1c05('0x3')](_0xd5f638,_0x1c05('0x4'));}function QueueCallerAbandon(_0x1c5069,_0x294fcb){this[_0x1c05('0x5')]=_0x1c5069[_0x1c05('0x5')];this[_0x1c05('0x6')]=_0x1c5069[_0x1c05('0x6')];this[_0x1c05('0x7')]=_0x1c5069['type']===_0x1c05('0x8')?_0x1c05('0x9'):_0x1c5069[_0x1c05('0x6')];this[_0x1c05('0xa')]=_0x1c5069['countbusyretry'];this[_0x1c05('0xb')]=_0x1c5069[_0x1c05('0xb')];this[_0x1c05('0xc')]=_0x1c5069[_0x1c05('0xc')];this['countglobal']=_0x1c5069[_0x1c05('0xa')]+_0x1c5069['countcongestionretry']+_0x1c5069[_0x1c05('0xc')]+_0x1c5069[_0x1c05('0xd')]+_0x1c5069[_0x1c05('0xe')]+_0x1c5069[_0x1c05('0xf')]+_0x1c5069[_0x1c05('0x10')]+_0x1c5069[_0x1c05('0x11')];this[_0x1c05('0xd')]=_0x1c5069[_0x1c05('0xd')];this[_0x1c05('0xe')]=_0x1c5069[_0x1c05('0xe')];this[_0x1c05('0xf')]=_0x1c5069[_0x1c05('0xf')];this['countmachineretry']=_0x1c5069[_0x1c05('0x10')];this[_0x1c05('0x11')]=_0x1c5069[_0x1c05('0x11')];this['uniqueid']=_0x294fcb[_0x1c05('0x12')];this['calleridname']=_0x1c5069[_0x1c05('0x13')];this[_0x1c05('0x14')]=_0x1c5069[_0x1c05('0x15')];this[_0x1c05('0x16')]=_0x1c5069[_0x1c05('0x16')];this['responsetime']=_0x1c5069[_0x1c05('0x17')];this[_0x1c05('0x18')]=_0x1c5069[_0x1c05('0x18')];this['endtime']=this[_0x1c05('0x18')];this[_0x1c05('0x19')]=getSeconds(_0x1c5069[_0x1c05('0x17')],_0x1c5069['starttime']);this[_0x1c05('0x1a')]=getSeconds(this[_0x1c05('0x18')],_0x1c5069['responsetime']);this['talktime']=0x0;this[_0x1c05('0x9')]=_0x294fcb['queue'];this['membername']=_0x294fcb['connectedlinename'];this[_0x1c05('0x1b')]=_0x294fcb[_0x1c05('0x1b')];this['callback']=_0x1c5069[_0x1c05('0x1c')];this[_0x1c05('0x1d')]=_0x1c5069[_0x1c05('0x1d')];this[_0x1c05('0x1e')]=_0x1c5069['callbackat'];this[_0x1c05('0x1f')]=_0x1c5069[_0x1c05('0x1f')];this[_0x1c05('0x20')]=_0x1c5069[_0x1c05('0x20')];this[_0x1c05('0x21')]=_0x1c5069[_0x1c05('0x21')];this['UserId']=_0x1c5069[_0x1c05('0x22')];this[_0x1c05('0x23')]=_0x1c5069[_0x1c05('0x23')];this[_0x1c05('0x24')]=_0x1c5069[_0x1c05('0x24')];this[_0x1c05('0x25')]=_0x1c5069[_0x1c05('0x25')]||'';this['originatecalleridname']=_0x1c5069[_0x1c05('0x26')]||'';}module[_0x1c05('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0xf739=['milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash'];(function(_0x53531e,_0x123954){var _0x324adb=function(_0x567f02){while(--_0x567f02){_0x53531e['push'](_0x53531e['shift']());}};_0x324adb(++_0x123954);}(_0xf739,0x1df));var _0x9f73=function(_0x50150f,_0x92b2ca){_0x50150f=_0x50150f-0x0;var _0x3f3764=_0xf739[_0x50150f];return _0x3f3764;};'use strict';var util=require('util');var _=require(_0x9f73('0x0'));var moment=require('moment');function getSeconds(_0x2b4639,_0x23097e){var _0x184e4d=moment(_0x2b4639)[_0x9f73('0x1')](0x0);var _0x263c68=moment(_0x23097e)[_0x9f73('0x1')](0x0);return _0x184e4d[_0x9f73('0x2')](_0x263c68,_0x9f73('0x3'));}function QueueCallerAbandon(_0x4c81f6,_0x2c178b){this[_0x9f73('0x4')]=_0x4c81f6[_0x9f73('0x4')];this[_0x9f73('0x5')]=_0x4c81f6['type'];this[_0x9f73('0x6')]=_0x4c81f6[_0x9f73('0x5')]===_0x9f73('0x7')?'queue':_0x4c81f6[_0x9f73('0x5')];this[_0x9f73('0x8')]=_0x4c81f6['countbusyretry'];this[_0x9f73('0x9')]=_0x4c81f6['countcongestionretry'];this[_0x9f73('0xa')]=_0x4c81f6['countnoanswerretry'];this[_0x9f73('0xb')]=_0x4c81f6['countbusyretry']+_0x4c81f6[_0x9f73('0x9')]+_0x4c81f6['countnoanswerretry']+_0x4c81f6['countnosuchnumberretry']+_0x4c81f6[_0x9f73('0xc')]+_0x4c81f6['countabandonedretry']+_0x4c81f6[_0x9f73('0xd')]+_0x4c81f6[_0x9f73('0xe')];this['countnosuchnumberretry']=_0x4c81f6[_0x9f73('0xf')];this[_0x9f73('0xc')]=_0x4c81f6['countdropretry'];this[_0x9f73('0x10')]=_0x4c81f6['countabandonedretry'];this['countmachineretry']=_0x4c81f6['countmachineretry'];this[_0x9f73('0xe')]=_0x4c81f6[_0x9f73('0xe')];this['uniqueid']=_0x2c178b[_0x9f73('0x11')];this[_0x9f73('0x12')]=_0x4c81f6['name'];this[_0x9f73('0x13')]=_0x4c81f6['number'];this[_0x9f73('0x14')]=_0x4c81f6[_0x9f73('0x14')];this[_0x9f73('0x15')]=_0x4c81f6[_0x9f73('0x15')];this[_0x9f73('0x16')]=_0x4c81f6[_0x9f73('0x16')];this[_0x9f73('0x17')]=this[_0x9f73('0x16')];this[_0x9f73('0x18')]=getSeconds(_0x4c81f6[_0x9f73('0x15')],_0x4c81f6[_0x9f73('0x14')]);this[_0x9f73('0x19')]=getSeconds(this['droptime'],_0x4c81f6[_0x9f73('0x15')]);this['talktime']=0x0;this[_0x9f73('0x1a')]=_0x2c178b[_0x9f73('0x1a')];this[_0x9f73('0x1b')]=_0x2c178b[_0x9f73('0x1c')];this[_0x9f73('0x1d')]=_0x2c178b[_0x9f73('0x1d')];this[_0x9f73('0x1e')]=_0x4c81f6[_0x9f73('0x1e')];this['callbackuniqueid']=_0x4c81f6['callbackuniqueid'];this['callbackat']=_0x4c81f6[_0x9f73('0x1f')];this[_0x9f73('0x20')]=_0x4c81f6[_0x9f73('0x20')];this[_0x9f73('0x21')]=_0x4c81f6[_0x9f73('0x21')];this[_0x9f73('0x22')]=_0x4c81f6[_0x9f73('0x22')];this[_0x9f73('0x23')]=_0x4c81f6['UserId'];this[_0x9f73('0x24')]=_0x4c81f6['VoiceQueueId'];this[_0x9f73('0x25')]=_0x4c81f6[_0x9f73('0x25')];this['originatecalleridnum']=_0x4c81f6[_0x9f73('0x26')]||'';this[_0x9f73('0x27')]=_0x4c81f6[_0x9f73('0x27')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 0cdc37e..aeb956f 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(_0x4a10d3,_0x51aaef){var _0x37b2a8=function(_0x27d83e){while(--_0x27d83e){_0x4a10d3['push'](_0x4a10d3['shift']());}};_0x37b2a8(++_0x51aaef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x175293,_0x2bccb8){var _0xab3f05=function(_0x11ab4c){while(--_0x11ab4c){_0x175293['push'](_0x175293['shift']());}};_0xab3f05(++_0x2bccb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 23df90c..fb496c6 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 _0xda3f=['variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','lodash','bluebird','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','faxstatus','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','channel','variable','value','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','calleridnum','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','checkAfterSend','checkTrunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','%s/%s.tif','XMF-PATH','Action'];(function(_0x23f692,_0x16eb2f){var _0x5232fe=function(_0x58f9f9){while(--_0x58f9f9){_0x23f692['push'](_0x23f692['shift']());}};_0x5232fe(++_0x16eb2f);}(_0xda3f,0xec));var _0xfda3=function(_0x193d0d,_0xf974f9){_0x193d0d=_0x193d0d-0x0;var _0x5bd138=_0xda3f[_0x193d0d];return _0x5bd138;};'use strict';var util=require('util');var _=require(_0xfda3('0x0'));var BPromise=require(_0xfda3('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require('path');var tiff2pdf=require(_0xfda3('0x2'));var gs=require('./util/gs');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var ami=require('../ami');var rpcDb=require(_0xfda3('0x5'));var Channel=require(_0xfda3('0x6'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0xfda3('0x7'));var attachment=require(_0xfda3('0x8'));var faxMessage=require(_0xfda3('0x9'));function Fax(_0x4018c0){this[_0xfda3('0xa')]={};this[_0xfda3('0xb')]=_0x4018c0[_0xfda3('0xb')];this[_0xfda3('0xc')]=_0x4018c0[_0xfda3('0xc')];this[_0xfda3('0xd')]={};ami['on'](_0xfda3('0xe'),this[_0xfda3('0xf')]['bind'](this));ami['on'](_0xfda3('0x10'),this[_0xfda3('0x11')][_0xfda3('0x12')](this));ami['on'](_0xfda3('0x13'),this[_0xfda3('0x14')]['bind'](this));ami['on'](_0xfda3('0x15'),this['syncNewExten'][_0xfda3('0x12')](this));ami['on'](_0xfda3('0x16'),this['syncFaxStatus']['bind'](this));ami['on']('receivefax',this[_0xfda3('0x17')][_0xfda3('0x12')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xfda3('0x18'),this[_0xfda3('0x19')][_0xfda3('0x12')](this));}Fax[_0xfda3('0x1a')][_0xfda3('0xf')]=function(_0x40d702){if(_0x40d702[_0xfda3('0x1b')]===_0xfda3('0x1c')){for(var _0x4680bf in this[_0xfda3('0xb')]){if(this['faxAccounts'][_0xfda3('0x1d')](_0x4680bf)){if(_0x40d702[_0xfda3('0x1e')]===this[_0xfda3('0xb')][_0x4680bf][_0xfda3('0x1f')]){this['channels'][_0x40d702[_0xfda3('0x20')]]={};this[_0xfda3('0xa')][_0x40d702[_0xfda3('0x20')]]['channel']=_0x40d702['channel'];this[_0xfda3('0xa')][_0x40d702[_0xfda3('0x20')]]['id']=this[_0xfda3('0xb')][_0x4680bf]['id'];this['channels'][_0x40d702[_0xfda3('0x20')]][_0xfda3('0x21')]=this[_0xfda3('0xb')][_0x4680bf][_0xfda3('0x21')];logger[_0xfda3('0x22')](_0x40d702[_0xfda3('0x20')],_0xfda3('0x23'));}}}}if(this[_0xfda3('0xd')][_0x40d702[_0xfda3('0x20')]]){this['channels'][_0x40d702[_0xfda3('0x20')]]={};this[_0xfda3('0xa')][_0x40d702[_0xfda3('0x20')]]['channel']=_0x40d702[_0xfda3('0x24')];logger[_0xfda3('0x22')](_0x40d702[_0xfda3('0x20')],_0xfda3('0x23'));}};Fax[_0xfda3('0x1a')][_0xfda3('0x11')]=function(_0x514d2a){if(this[_0xfda3('0xa')][_0x514d2a[_0xfda3('0x20')]]){for(var _0x2bef2b in _0x514d2a[_0xfda3('0x25')]){if(_0x514d2a[_0xfda3('0x25')]['hasOwnProperty'](_0x2bef2b)){this[_0xfda3('0xa')][_0x514d2a[_0xfda3('0x20')]][_0x2bef2b]=_0x514d2a[_0xfda3('0x26')];}}}};Fax[_0xfda3('0x1a')][_0xfda3('0x14')]=function(_0x3cfeb2){if(this[_0xfda3('0xa')][_0x3cfeb2['uniqueid']]){this['channels'][_0x3cfeb2[_0xfda3('0x20')]]['channelstate']=_0x3cfeb2['channelstate'];this[_0xfda3('0xa')][_0x3cfeb2[_0xfda3('0x20')]][_0xfda3('0x27')]=_0x3cfeb2[_0xfda3('0x27')];}};Fax[_0xfda3('0x1a')][_0xfda3('0x28')]=function(_0x404531){if(this[_0xfda3('0xa')][_0x404531[_0xfda3('0x20')]]){for(var _0x5825bd in _0x404531[_0xfda3('0x25')]){if(_0x404531[_0xfda3('0x25')][_0xfda3('0x1d')](_0x5825bd)){this[_0xfda3('0xa')][_0x404531[_0xfda3('0x20')]][_0x5825bd]=_0x404531[_0xfda3('0x26')];}}}};Fax[_0xfda3('0x1a')][_0xfda3('0x29')]=function(_0x2bb705){if(this['channels'][_0x2bb705['uniqueid']]){this[_0xfda3('0xa')][_0x2bb705[_0xfda3('0x20')]]['operation']=_0x2bb705[_0xfda3('0x2a')];this[_0xfda3('0xa')][_0x2bb705[_0xfda3('0x20')]]['status']=_0x2bb705[_0xfda3('0x2b')];this[_0xfda3('0xa')][_0x2bb705[_0xfda3('0x20')]][_0xfda3('0x1f')]=_0x2bb705[_0xfda3('0x1f')];this['channels'][_0x2bb705[_0xfda3('0x20')]][_0xfda3('0x2c')]=_0x2bb705[_0xfda3('0x2c')];logger['info'](_0x2bb705[_0xfda3('0x20')],'\x20syncFaxStatus\x20');}};Fax[_0xfda3('0x1a')][_0xfda3('0x17')]=function(_0x43a58a){var _0x36a506=this;if(this[_0xfda3('0xa')][_0x43a58a[_0xfda3('0x20')]]){var _0x151f32=this[_0xfda3('0xa')][_0x43a58a['uniqueid']]['id'];this[_0xfda3('0xa')][_0x43a58a[_0xfda3('0x20')]][_0xfda3('0x2d')]=_0x43a58a[_0xfda3('0x2d')];this['channels'][_0x43a58a[_0xfda3('0x20')]][_0xfda3('0x2e')]=_0x43a58a[_0xfda3('0x2e')];this['channels'][_0x43a58a['uniqueid']][_0xfda3('0x1f')]=_0x43a58a[_0xfda3('0x1f')];this[_0xfda3('0xa')][_0x43a58a[_0xfda3('0x20')]][_0xfda3('0x2f')]=_0x43a58a[_0xfda3('0x2f')];this[_0xfda3('0xa')][_0x43a58a[_0xfda3('0x20')]][_0xfda3('0x30')]=_0x43a58a[_0xfda3('0x30')];this['channels'][_0x43a58a[_0xfda3('0x20')]][_0xfda3('0x2c')]=_0x43a58a['filename'];this[_0xfda3('0xa')][_0x43a58a['uniqueid']]['calleridnum']=_0x43a58a['calleridnum'];if(this[_0xfda3('0xa')][_0x43a58a[_0xfda3('0x20')]][_0xfda3('0x2e')]>0x0){tiff2pdf(_0x43a58a[_0xfda3('0x2c')],'/var/opt/motion2/server/files/attachments/',function(_0x8f0905){logger[_0xfda3('0x22')](_0x43a58a[_0xfda3('0x20')],_0xfda3('0x31'),_0x8f0905['message']);attachment[_0xfda3('0x32')]({'name':path[_0xfda3('0x33')](_0x43a58a[_0xfda3('0x2c')])['name'],'basename':path['parse'](_0x43a58a[_0xfda3('0x2c')])[_0xfda3('0x21')]+_0xfda3('0x34'),'type':_0xfda3('0x35')})[_0xfda3('0x36')](function(_0x73e8e4){faxAccount[_0xfda3('0x37')](_0x151f32,{'from':_0x43a58a[_0xfda3('0x38')],'mapKey':_0xfda3('0x4'),'body':path[_0xfda3('0x33')](_0x43a58a[_0xfda3('0x2c')])[_0xfda3('0x21')]+_0xfda3('0x34'),'AttachmentId':_0x73e8e4['id']})[_0xfda3('0x39')](function(_0x57013b){logger['error'](_0x43a58a[_0xfda3('0x20')],_0xfda3('0x3a'),JSON[_0xfda3('0x3b')](_0x57013b));});})[_0xfda3('0x39')](function(_0x597e5a){logger[_0xfda3('0x3c')](_0x43a58a[_0xfda3('0x20')],_0xfda3('0x3d'),JSON[_0xfda3('0x3b')](_0x597e5a));});});}logger[_0xfda3('0x22')](_0x43a58a['uniqueid'],_0xfda3('0x3d'));}};Fax[_0xfda3('0x1a')][_0xfda3('0x19')]=function(_0x36aa3a){if(this[_0xfda3('0xd')][_0x36aa3a['uniqueid']]){_[_0xfda3('0x3e')](this[_0xfda3('0xa')][_0x36aa3a[_0xfda3('0x20')]],_['pick'](_0x36aa3a,[_0xfda3('0x3f'),_0xfda3('0x40')]));}};function updateStatus(_0x11addf){if(_0x11addf['AttachmentId']){faxMessage[_0xfda3('0x41')](_0x11addf[_0xfda3('0x42')],{'failMessage':_0xfda3('0x43')})[_0xfda3('0x36')](function(_0x1ab4a8){ut['logger'](_0xfda3('0x44'),_0x1ab4a8);})['catch'](function(_0x17fe20){ut['logger'](_0xfda3('0x45'),_0x17fe20);});}else{ut[_0xfda3('0x46')](_0xfda3('0x47'));}}Fax[_0xfda3('0x1a')]['updateStatus']=function(_0x244c24,_0x3b430d,_0x2f2c32){var _0x372f15=this;var _0x18425a={};if(_0x3b430d){_0x18425a={'read':_0x3b430d};}else{_0x18425a={'failMessage':_0x2f2c32};}if(this[_0xfda3('0xd')][_0x244c24][_0xfda3('0x42')]){faxMessage['update'](this['actions'][_0x244c24][_0xfda3('0x42')],_0x18425a)[_0xfda3('0x36')](function(_0x218ee5){ut['logger']('[Fax][Message][Updated]',_0x218ee5);})[_0xfda3('0x39')](function(_0x1d6606){ut[_0xfda3('0x46')](_0xfda3('0x48'),_0x1d6606);})[_0xfda3('0x49')](function(){delete _0x372f15['channels'][_0x244c24];delete _0x372f15[_0xfda3('0xd')][_0x244c24];});}else{ut[_0xfda3('0x46')](_0xfda3('0x4a'));delete this[_0xfda3('0xa')][_0x244c24];delete this[_0xfda3('0xd')][_0x244c24];}};Fax[_0xfda3('0x1a')][_0xfda3('0x4b')]=function(_0x1c5073){var _0x3a8c51=this;if(this[_0xfda3('0xa')][_0x1c5073[_0xfda3('0x20')]]){if(this[_0xfda3('0xd')][_0x1c5073['uniqueid']]){this[_0xfda3('0xa')][_0x1c5073[_0xfda3('0x20')]]['id']=this[_0xfda3('0xd')][_0x1c5073[_0xfda3('0x20')]]['id'];this[_0xfda3('0xa')][_0x1c5073[_0xfda3('0x20')]][_0xfda3('0x21')]=this['actions'][_0x1c5073['uniqueid']][_0xfda3('0x21')];}logger[_0xfda3('0x22')](_0x1c5073['uniqueid'],this[_0xfda3('0xd')][_0x1c5073[_0xfda3('0x20')]]?_0xfda3('0x4c'):_0xfda3('0x4d'),JSON['stringify'](this['channels'][_0x1c5073[_0xfda3('0x20')]]));if(this[_0xfda3('0xd')][_0x1c5073[_0xfda3('0x20')]]){if(this['channels'][_0x1c5073[_0xfda3('0x20')]]['faxpages']>0x0&&this[_0xfda3('0xa')][_0x1c5073[_0xfda3('0x20')]][_0xfda3('0x16')]===_0xfda3('0x4e')){this[_0xfda3('0x4f')](_0x1c5073[_0xfda3('0x20')],!![]);}else{this['updateStatus'](_0x1c5073[_0xfda3('0x20')],![],this[_0xfda3('0xa')][_0x1c5073[_0xfda3('0x20')]][_0xfda3('0x50')]?_0xfda3('0x51')+this['channels'][_0x1c5073['uniqueid']][_0xfda3('0x50')]:_0xfda3('0x52'));}}}};Fax['prototype']['send']=function(_0x512d7b){var _0x248174=this;return new BPromise(function(_0x2c93d4,_0x4f3e45){_0x248174[_0xfda3('0x53')](_0x512d7b,_0x248174[_0xfda3('0xb')][_0x512d7b[_0xfda3('0x54')]])[_0xfda3('0x36')](function(_0x51e463){ut[_0xfda3('0x46')](_0xfda3('0x55'),_0x51e463);_0x2c93d4(ut[_0xfda3('0x56')](_0xfda3('0x57')));})[_0xfda3('0x39')](function(_0xf252ce){ut['logger']('[Fax][execOriginate][failure]',_0xf252ce);updateStatus(_0x512d7b);_0x4f3e45(ut[_0xfda3('0x56')]('Fax\x20failed'));});});};Fax[_0xfda3('0x1a')][_0xfda3('0x58')]=function(_0x20704a){var _0x3884b1=this;return new BPromise(function(_0x1d6547,_0x3c0155){var _0x44185c=_0x3884b1[_0xfda3('0x59')](_0x3884b1[_0xfda3('0xb')][_0x20704a[_0xfda3('0x54')]]['Trunk'],_0x20704a);if(_0x44185c[_0xfda3('0x5a')]){_0x1d6547(ut['message']('Trunk\x20Reachable'));}else{_0x3c0155(ut[_0xfda3('0x56')](_0x44185c[_0xfda3('0x56')]));}});};function originate(_0x531874,_0xa3b2e0,_0x26e1f5){return new BPromise(function(_0x42e387,_0x589c7a){if(_0x26e1f5){var _0x1a825c=util[_0xfda3('0x5b')](_0xfda3('0x5c'),path[_0xfda3('0x33')](_0x531874[_0xfda3('0x5d')])['name'],_0x531874['path']);gs['execute'](_0x1a825c)[_0xfda3('0x36')](function(){_0x531874[_0xfda3('0x5d')]=util[_0xfda3('0x5b')](_0xfda3('0x5e'),path[_0xfda3('0x33')](_0x531874[_0xfda3('0x5d')])['dir'],path[_0xfda3('0x33')](_0x531874[_0xfda3('0x5d')])[_0xfda3('0x21')]);_0xa3b2e0[_0xfda3('0x5f')]=_0x531874['path'];ut[_0xfda3('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0xfda3('0x60')](ut[_0xfda3('0x61')](_0x531874,_0xa3b2e0))[_0xfda3('0x36')](function(_0x16e8f0){_0x42e387(_0x16e8f0);})[_0xfda3('0x39')](function(_0x291695){_0x589c7a(_0x291695);});})[_0xfda3('0x39')](function(_0x5af4bd){_0x589c7a(_0x5af4bd);});}else{ami[_0xfda3('0x60')](ut[_0xfda3('0x61')](_0x531874,_0xa3b2e0))[_0xfda3('0x36')](function(_0x2c3a49){_0x42e387(_0x2c3a49);})[_0xfda3('0x39')](function(_0x119564){_0x589c7a(_0x119564);});}});}Fax['prototype'][_0xfda3('0x53')]=function(_0x15041,_0x17161f){var _0x3ebf07=this;return new BPromise(function(_0x3ce543,_0x4a0a1c){var _0x174167=uuid['v4']();var _0x1d5b7a=ut[_0xfda3('0x62')](_0x15041,_0x17161f);_0x3ebf07[_0xfda3('0xd')][_0x174167]=new Action(_0x174167,_0x17161f,_0x15041);var _0xcb7ff4=_0x3ebf07[_0xfda3('0xd')][_0x174167];if(path[_0xfda3('0x33')](_0x15041[_0xfda3('0x5d')])[_0xfda3('0x63')]===_0xfda3('0x34')){originate(_0xcb7ff4,_0x1d5b7a,!![])['then'](function(_0x1c0e07){_0x3ce543(_0x1c0e07);})[_0xfda3('0x39')](function(_0x46210d){_0x4a0a1c(_0x46210d);});}else{originate(_0xcb7ff4,_0x1d5b7a,![])[_0xfda3('0x36')](function(_0x213bb1){_0x3ce543(_0x213bb1);})['catch'](function(_0x5e54e5){_0x4a0a1c(_0x5e54e5);});}});};Fax[_0xfda3('0x1a')][_0xfda3('0x64')]=function(_0x120fe9){return!_[_0xfda3('0x65')](_0x120fe9)&&!_[_0xfda3('0x65')](_0x120fe9[_0xfda3('0x21')])&&!_[_0xfda3('0x65')](_0x120fe9[_0xfda3('0x66')])&&_0x120fe9[_0xfda3('0x66')]&&!_[_0xfda3('0x65')](this[_0xfda3('0xc')][util['format'](_0xfda3('0x67'),_0x120fe9['name'])])&&!_['isNil'](this['trunks'][util[_0xfda3('0x5b')]('SIP/%s',_0x120fe9[_0xfda3('0x21')])][_0xfda3('0x2b')])&&(this['trunks'][util[_0xfda3('0x5b')](_0xfda3('0x67'),_0x120fe9['name'])][_0xfda3('0x2b')]==='reachable'||this[_0xfda3('0xc')][util[_0xfda3('0x5b')]('SIP/%s',_0x120fe9[_0xfda3('0x21')])][_0xfda3('0x2b')]===_0xfda3('0x68'));};Fax[_0xfda3('0x1a')][_0xfda3('0x59')]=function(_0x4e5791,_0x2bde10){if(!this[_0xfda3('0x64')](_0x4e5791)){ut[_0xfda3('0x46')](_0xfda3('0x69'),_[_0xfda3('0x65')](_0x4e5791)?'':_0x4e5791['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xfda3('0x65')](_0x2bde10[_0xfda3('0x4')])){ut[_0xfda3('0x46')](_0xfda3('0x6a'),JSON[_0xfda3('0x3b')](_0x2bde10));return{'isValid':![],'message':_0xfda3('0x6b')};}if(_[_0xfda3('0x65')](_0x2bde10[_0xfda3('0x5d')])){ut['logger'](_0xfda3('0x6c'),JSON[_0xfda3('0x3b')](_0x2bde10));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xfda3('0x6d')};};module[_0xfda3('0x6e')]=Fax; \ No newline at end of file +var _0x3de3=['Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','receivefax','syncReceiveFax','syncHangup','prototype','context','from-voip-provider','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','fax','catch','error','\x20receiveFax\x20','syncOriginateResponse','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active'];(function(_0x347731,_0x41cf10){var _0x170bb6=function(_0x494907){while(--_0x494907){_0x347731['push'](_0x347731['shift']());}};_0x170bb6(++_0x41cf10);}(_0x3de3,0x1ce));var _0x33de=function(_0x39bab7,_0x57b24e){_0x39bab7=_0x39bab7-0x0;var _0x211379=_0x3de3[_0x39bab7];return _0x211379;};'use strict';var util=require(_0x33de('0x0'));var _=require('lodash');var BPromise=require(_0x33de('0x1'));var uuid=require(_0x33de('0x2'));var moment=require('moment');var path=require(_0x33de('0x3'));var tiff2pdf=require(_0x33de('0x4'));var gs=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('fax');var ami=require(_0x33de('0x7'));var rpcDb=require(_0x33de('0x8'));var Channel=require('./channel');var ut=require(_0x33de('0x9'));var Action=require('./action');var faxAccount=require(_0x33de('0xa'));var attachment=require(_0x33de('0xb'));var faxMessage=require(_0x33de('0xc'));function Fax(_0x486ab6){this[_0x33de('0xd')]={};this[_0x33de('0xe')]=_0x486ab6[_0x33de('0xe')];this['trunks']=_0x486ab6[_0x33de('0xf')];this[_0x33de('0x10')]={};ami['on'](_0x33de('0x11'),this[_0x33de('0x12')][_0x33de('0x13')](this));ami['on'](_0x33de('0x14'),this[_0x33de('0x15')][_0x33de('0x13')](this));ami['on'](_0x33de('0x16'),this[_0x33de('0x17')][_0x33de('0x13')](this));ami['on']('newexten',this[_0x33de('0x18')][_0x33de('0x13')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x33de('0x13')](this));ami['on'](_0x33de('0x19'),this[_0x33de('0x1a')][_0x33de('0x13')](this));ami['on']('hangup',this[_0x33de('0x1b')][_0x33de('0x13')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x33de('0x13')](this));}Fax[_0x33de('0x1c')][_0x33de('0x12')]=function(_0x4de4ef){if(_0x4de4ef[_0x33de('0x1d')]===_0x33de('0x1e')){for(var _0x52cfa0 in this[_0x33de('0xe')]){if(this[_0x33de('0xe')]['hasOwnProperty'](_0x52cfa0)){if(_0x4de4ef['exten']===this[_0x33de('0xe')][_0x52cfa0]['localstationid']){this[_0x33de('0xd')][_0x4de4ef[_0x33de('0x1f')]]={};this[_0x33de('0xd')][_0x4de4ef[_0x33de('0x1f')]][_0x33de('0x20')]=_0x4de4ef[_0x33de('0x20')];this[_0x33de('0xd')][_0x4de4ef['uniqueid']]['id']=this['faxAccounts'][_0x52cfa0]['id'];this[_0x33de('0xd')][_0x4de4ef['uniqueid']][_0x33de('0x21')]=this['faxAccounts'][_0x52cfa0][_0x33de('0x21')];logger[_0x33de('0x22')](_0x4de4ef['uniqueid'],_0x33de('0x23'));}}}}if(this['actions'][_0x4de4ef[_0x33de('0x1f')]]){this['channels'][_0x4de4ef[_0x33de('0x1f')]]={};this[_0x33de('0xd')][_0x4de4ef[_0x33de('0x1f')]]['channel']=_0x4de4ef[_0x33de('0x20')];logger[_0x33de('0x22')](_0x4de4ef[_0x33de('0x1f')],'\x20syncNewchannel\x20');}};Fax[_0x33de('0x1c')]['syncVarSet']=function(_0x566373){if(this[_0x33de('0xd')][_0x566373[_0x33de('0x1f')]]){for(var _0x1a870a in _0x566373[_0x33de('0x24')]){if(_0x566373[_0x33de('0x24')][_0x33de('0x25')](_0x1a870a)){this[_0x33de('0xd')][_0x566373[_0x33de('0x1f')]][_0x1a870a]=_0x566373['value'];}}}};Fax['prototype'][_0x33de('0x17')]=function(_0x1420d2){if(this[_0x33de('0xd')][_0x1420d2[_0x33de('0x1f')]]){this[_0x33de('0xd')][_0x1420d2[_0x33de('0x1f')]][_0x33de('0x26')]=_0x1420d2['channelstate'];this[_0x33de('0xd')][_0x1420d2[_0x33de('0x1f')]][_0x33de('0x27')]=_0x1420d2[_0x33de('0x27')];}};Fax['prototype'][_0x33de('0x18')]=function(_0xf5d78a){if(this['channels'][_0xf5d78a['uniqueid']]){for(var _0x57fcf3 in _0xf5d78a[_0x33de('0x24')]){if(_0xf5d78a[_0x33de('0x24')]['hasOwnProperty'](_0x57fcf3)){this[_0x33de('0xd')][_0xf5d78a['uniqueid']][_0x57fcf3]=_0xf5d78a['value'];}}}};Fax[_0x33de('0x1c')][_0x33de('0x28')]=function(_0x42c57e){if(this[_0x33de('0xd')][_0x42c57e[_0x33de('0x1f')]]){this[_0x33de('0xd')][_0x42c57e[_0x33de('0x1f')]][_0x33de('0x29')]=_0x42c57e['operation'];this[_0x33de('0xd')][_0x42c57e['uniqueid']][_0x33de('0x2a')]=_0x42c57e['status'];this['channels'][_0x42c57e[_0x33de('0x1f')]][_0x33de('0x2b')]=_0x42c57e[_0x33de('0x2b')];this[_0x33de('0xd')][_0x42c57e[_0x33de('0x1f')]][_0x33de('0x2c')]=_0x42c57e['filename'];logger[_0x33de('0x22')](_0x42c57e[_0x33de('0x1f')],_0x33de('0x2d'));}};Fax[_0x33de('0x1c')][_0x33de('0x1a')]=function(_0x9f5688){var _0x59c618=this;if(this['channels'][_0x9f5688[_0x33de('0x1f')]]){var _0x1497f0=this[_0x33de('0xd')][_0x9f5688[_0x33de('0x1f')]]['id'];this[_0x33de('0xd')][_0x9f5688[_0x33de('0x1f')]][_0x33de('0x2e')]=_0x9f5688['remotestationid'];this[_0x33de('0xd')][_0x9f5688[_0x33de('0x1f')]][_0x33de('0x2f')]=_0x9f5688[_0x33de('0x2f')];this[_0x33de('0xd')][_0x9f5688[_0x33de('0x1f')]]['localstationid']=_0x9f5688[_0x33de('0x2b')];this['channels'][_0x9f5688[_0x33de('0x1f')]][_0x33de('0x30')]=_0x9f5688['resolution'];this[_0x33de('0xd')][_0x9f5688[_0x33de('0x1f')]][_0x33de('0x31')]=_0x9f5688[_0x33de('0x31')];this[_0x33de('0xd')][_0x9f5688[_0x33de('0x1f')]][_0x33de('0x2c')]=_0x9f5688[_0x33de('0x2c')];this[_0x33de('0xd')][_0x9f5688['uniqueid']]['calleridnum']=_0x9f5688[_0x33de('0x32')];if(this[_0x33de('0xd')][_0x9f5688[_0x33de('0x1f')]][_0x33de('0x2f')]>0x0){tiff2pdf(_0x9f5688['filename'],_0x33de('0x33'),function(_0x511a19){logger['info'](_0x9f5688[_0x33de('0x1f')],_0x33de('0x34'),_0x511a19[_0x33de('0x35')]);attachment[_0x33de('0x36')]({'name':path[_0x33de('0x37')](_0x9f5688[_0x33de('0x2c')])[_0x33de('0x21')],'basename':path['parse'](_0x9f5688[_0x33de('0x2c')])['name']+_0x33de('0x38'),'type':'application/pdf'})[_0x33de('0x39')](function(_0x2a2bf9){faxAccount['notify'](_0x1497f0,{'from':_0x9f5688[_0x33de('0x32')],'mapKey':_0x33de('0x3a'),'body':path[_0x33de('0x37')](_0x9f5688['filename'])['name']+_0x33de('0x38'),'AttachmentId':_0x2a2bf9['id']})[_0x33de('0x3b')](function(_0x4bf097){logger['error'](_0x9f5688[_0x33de('0x1f')],'\x20notify\x20',JSON['stringify'](_0x4bf097));});})['catch'](function(_0x17ed09){logger[_0x33de('0x3c')](_0x9f5688[_0x33de('0x1f')],_0x33de('0x3d'),JSON['stringify'](_0x17ed09));});});}logger['info'](_0x9f5688[_0x33de('0x1f')],_0x33de('0x3d'));}};Fax['prototype'][_0x33de('0x3e')]=function(_0xc23633){if(this[_0x33de('0x10')][_0xc23633[_0x33de('0x1f')]]){_[_0x33de('0x3f')](this['channels'][_0xc23633[_0x33de('0x1f')]],_[_0x33de('0x40')](_0xc23633,['response',_0x33de('0x41')]));}};function updateStatus(_0xab2a13){if(_0xab2a13[_0x33de('0x42')]){faxMessage[_0x33de('0x43')](_0xab2a13[_0x33de('0x42')],{'failMessage':_0x33de('0x44')})[_0x33de('0x39')](function(_0x7538fa){ut[_0x33de('0x45')](_0x33de('0x46'),_0x7538fa);})['catch'](function(_0xc14bf6){ut[_0x33de('0x45')](_0x33de('0x47'),_0xc14bf6);});}else{ut[_0x33de('0x45')](_0x33de('0x48'));}}Fax[_0x33de('0x1c')][_0x33de('0x49')]=function(_0x49e1d9,_0x109ec5,_0x32042e){var _0x3c8904=this;var _0x4f0e9f={};if(_0x109ec5){_0x4f0e9f={'read':_0x109ec5};}else{_0x4f0e9f={'failMessage':_0x32042e};}if(this[_0x33de('0x10')][_0x49e1d9][_0x33de('0x42')]){faxMessage[_0x33de('0x43')](this[_0x33de('0x10')][_0x49e1d9]['AttachmentId'],_0x4f0e9f)['then'](function(_0x3a1e39){ut[_0x33de('0x45')](_0x33de('0x4a'),_0x3a1e39);})[_0x33de('0x3b')](function(_0x379784){ut['logger']('[Fax][Message][NoUpdate1]',_0x379784);})[_0x33de('0x4b')](function(){delete _0x3c8904[_0x33de('0xd')][_0x49e1d9];delete _0x3c8904[_0x33de('0x10')][_0x49e1d9];});}else{ut[_0x33de('0x45')](_0x33de('0x4c'));delete this[_0x33de('0xd')][_0x49e1d9];delete this[_0x33de('0x10')][_0x49e1d9];}};Fax[_0x33de('0x1c')][_0x33de('0x1b')]=function(_0x5de12f){var _0x14c94c=this;if(this[_0x33de('0xd')][_0x5de12f[_0x33de('0x1f')]]){if(this['actions'][_0x5de12f[_0x33de('0x1f')]]){this['channels'][_0x5de12f['uniqueid']]['id']=this['actions'][_0x5de12f['uniqueid']]['id'];this[_0x33de('0xd')][_0x5de12f[_0x33de('0x1f')]]['name']=this[_0x33de('0x10')][_0x5de12f[_0x33de('0x1f')]]['name'];}logger[_0x33de('0x22')](_0x5de12f[_0x33de('0x1f')],this['actions'][_0x5de12f[_0x33de('0x1f')]]?_0x33de('0x4d'):_0x33de('0x4e'),JSON[_0x33de('0x4f')](this[_0x33de('0xd')][_0x5de12f[_0x33de('0x1f')]]));if(this[_0x33de('0x10')][_0x5de12f['uniqueid']]){if(this['channels'][_0x5de12f[_0x33de('0x1f')]]['faxpages']>0x0&&this[_0x33de('0xd')][_0x5de12f[_0x33de('0x1f')]]['faxstatus']===_0x33de('0x50')){this['updateStatus'](_0x5de12f[_0x33de('0x1f')],!![]);}else{this[_0x33de('0x49')](_0x5de12f['uniqueid'],![],this['channels'][_0x5de12f[_0x33de('0x1f')]][_0x33de('0x51')]?_0x33de('0x52')+this[_0x33de('0xd')][_0x5de12f[_0x33de('0x1f')]]['faxstatusstring']:_0x33de('0x53'));}}}};Fax[_0x33de('0x1c')]['send']=function(_0xa10291){var _0x375bda=this;return new BPromise(function(_0x514473,_0x151551){_0x375bda[_0x33de('0x54')](_0xa10291,_0x375bda['faxAccounts'][_0xa10291['FaxAccountId']])[_0x33de('0x39')](function(_0x55d7ef){ut[_0x33de('0x45')]('[Fax][execOriginate][success]',_0x55d7ef);_0x514473(ut[_0x33de('0x35')]('Fax\x20received'));})['catch'](function(_0x5e3383){ut['logger']('[Fax][execOriginate][failure]',_0x5e3383);updateStatus(_0xa10291);_0x151551(ut['message'](_0x33de('0x55')));});});};Fax['prototype'][_0x33de('0x56')]=function(_0x530b87){var _0x5b0065=this;return new BPromise(function(_0x203bda,_0x3754aa){var _0x103a55=_0x5b0065[_0x33de('0x57')](_0x5b0065[_0x33de('0xe')][_0x530b87[_0x33de('0x58')]][_0x33de('0x59')],_0x530b87);if(_0x103a55[_0x33de('0x5a')]){_0x203bda(ut['message'](_0x33de('0x5b')));}else{_0x3754aa(ut['message'](_0x103a55[_0x33de('0x35')]));}});};function originate(_0x2533e4,_0x2cbf20,_0x3a8d6b){return new BPromise(function(_0x8a9729,_0x3f5d52){if(_0x3a8d6b){var _0x2a6004=util[_0x33de('0x5c')](_0x33de('0x5d'),path[_0x33de('0x37')](_0x2533e4[_0x33de('0x3')])['name'],_0x2533e4['path']);gs[_0x33de('0x5e')](_0x2a6004)[_0x33de('0x39')](function(){_0x2533e4[_0x33de('0x3')]=util[_0x33de('0x5c')](_0x33de('0x5f'),path[_0x33de('0x37')](_0x2533e4[_0x33de('0x3')])[_0x33de('0x60')],path[_0x33de('0x37')](_0x2533e4[_0x33de('0x3')])['name']);_0x2cbf20[_0x33de('0x61')]=_0x2533e4[_0x33de('0x3')];ut[_0x33de('0x45')](_0x33de('0x62'),'');ami[_0x33de('0x63')](ut[_0x33de('0x64')](_0x2533e4,_0x2cbf20))['then'](function(_0x4be41f){_0x8a9729(_0x4be41f);})['catch'](function(_0x1370ac){_0x3f5d52(_0x1370ac);});})[_0x33de('0x3b')](function(_0x38f676){_0x3f5d52(_0x38f676);});}else{ami[_0x33de('0x63')](ut['variablesAction'](_0x2533e4,_0x2cbf20))[_0x33de('0x39')](function(_0x341cf0){_0x8a9729(_0x341cf0);})['catch'](function(_0x595629){_0x3f5d52(_0x595629);});}});}Fax['prototype'][_0x33de('0x54')]=function(_0x4630be,_0x38d3dd){var _0x632511=this;return new BPromise(function(_0x3671aa,_0x545555){var _0x2e6389=uuid['v4']();var _0x57f64f=ut[_0x33de('0x65')](_0x4630be,_0x38d3dd);_0x632511[_0x33de('0x10')][_0x2e6389]=new Action(_0x2e6389,_0x38d3dd,_0x4630be);var _0x50587b=_0x632511[_0x33de('0x10')][_0x2e6389];if(path[_0x33de('0x37')](_0x4630be['path'])[_0x33de('0x66')]==='.pdf'){originate(_0x50587b,_0x57f64f,!![])['then'](function(_0x2b6729){_0x3671aa(_0x2b6729);})[_0x33de('0x3b')](function(_0x3fbbaf){_0x545555(_0x3fbbaf);});}else{originate(_0x50587b,_0x57f64f,![])[_0x33de('0x39')](function(_0x4170d5){_0x3671aa(_0x4170d5);})['catch'](function(_0x20ac70){_0x545555(_0x20ac70);});}});};Fax[_0x33de('0x1c')][_0x33de('0x67')]=function(_0x1e0637){return!_['isNil'](_0x1e0637)&&!_[_0x33de('0x68')](_0x1e0637[_0x33de('0x21')])&&!_[_0x33de('0x68')](_0x1e0637['active'])&&_0x1e0637['active']&&!_['isNil'](this['trunks'][util['format'](_0x33de('0x69'),_0x1e0637[_0x33de('0x21')])])&&!_['isNil'](this[_0x33de('0xf')][util['format']('SIP/%s',_0x1e0637[_0x33de('0x21')])][_0x33de('0x2a')])&&(this['trunks'][util[_0x33de('0x5c')](_0x33de('0x69'),_0x1e0637['name'])][_0x33de('0x2a')]==='reachable'||this[_0x33de('0xf')][util[_0x33de('0x5c')]('SIP/%s',_0x1e0637[_0x33de('0x21')])][_0x33de('0x2a')]==='unmonitored');};Fax['prototype'][_0x33de('0x57')]=function(_0x276c26,_0x1f4eb6){if(!this[_0x33de('0x67')](_0x276c26)){ut[_0x33de('0x45')](_0x33de('0x6a'),_['isNil'](_0x276c26)?'':_0x276c26[_0x33de('0x21')]+_0x33de('0x6b'));return{'isValid':![],'message':_0x33de('0x6c')};}if(_[_0x33de('0x68')](_0x1f4eb6[_0x33de('0x3a')])){ut[_0x33de('0x45')](_0x33de('0x6d'),JSON[_0x33de('0x4f')](_0x1f4eb6));return{'isValid':![],'message':_0x33de('0x6e')};}if(_[_0x33de('0x68')](_0x1f4eb6[_0x33de('0x3')])){ut[_0x33de('0x45')](_0x33de('0x6f'),JSON[_0x33de('0x4f')](_0x1f4eb6));return{'isValid':![],'message':_0x33de('0x70')};}return{'isValid':!![],'message':_0x33de('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 9100075..a287795 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 _0x390c=['../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','resolve','catch','[Notify]\x20','util','bluebird'];(function(_0x9bd5e1,_0x44b7f7){var _0xd76f00=function(_0x551562){while(--_0x551562){_0x9bd5e1['push'](_0x9bd5e1['shift']());}};_0xd76f00(++_0x44b7f7);}(_0x390c,0x1ab));var _0xc390=function(_0x49f7ec,_0x130c8a){_0x49f7ec=_0x49f7ec-0x0;var _0x2920a0=_0x390c[_0x49f7ec];return _0x2920a0;};'use strict';var util=require(_0xc390('0x0'));var BPromise=require(_0xc390('0x1'));var logger=require(_0xc390('0x2'))(_0xc390('0x3'));var _=require(_0xc390('0x4'));var faxAccount=require(_0xc390('0x5'));function loggerCatch(_0x5a8c6b){return function(_0x319f4c){logger['error'](_0x5a8c6b,util[_0xc390('0x6')](_0x319f4c,{'showHidden':![],'depth':null}));};}exports[_0xc390('0x7')]=function(_0x23b5b4,_0x4bf0cc){return BPromise[_0xc390('0x8')]()['then'](faxAccount[_0xc390('0x7')](_0x23b5b4,_0x4bf0cc))[_0xc390('0x9')](loggerCatch(_0xc390('0xa')));}; \ No newline at end of file +var _0xc45f=['notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect'];(function(_0x4615f1,_0x4cae13){var _0x4e940f=function(_0x3e0d40){while(--_0x3e0d40){_0x4615f1['push'](_0x4615f1['shift']());}};_0x4e940f(++_0x4cae13);}(_0xc45f,0x1dd));var _0xfc45=function(_0x2ccb5d,_0x4b6e0c){_0x2ccb5d=_0x2ccb5d-0x0;var _0x5b5a52=_0xc45f[_0x2ccb5d];return _0x5b5a52;};'use strict';var util=require(_0xfc45('0x0'));var BPromise=require(_0xfc45('0x1'));var logger=require(_0xfc45('0x2'))(_0xfc45('0x3'));var _=require('lodash');var faxAccount=require(_0xfc45('0x4'));function loggerCatch(_0x5a0c39){return function(_0x32707b){logger[_0xfc45('0x5')](_0x5a0c39,util[_0xfc45('0x6')](_0x32707b,{'showHidden':![],'depth':null}));};}exports[_0xfc45('0x7')]=function(_0xebe3c2,_0x5b8a23){return BPromise[_0xfc45('0x8')]()[_0xfc45('0x9')](faxAccount[_0xfc45('0x7')](_0xebe3c2,_0x5b8a23))['catch'](loggerCatch(_0xfc45('0xa')));}; \ 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 0a552ef..90ed2c6 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 _0x0aec=['Exec\x20gs','info','\x20Error\x20:','inspect','../../../../config/logger','fax','child_process','exec'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x0aec,0xe4));var _0xc0ae=function(_0x3ac5b7,_0x1470fc){_0x3ac5b7=_0x3ac5b7-0x0;var _0x4ed3f4=_0x0aec[_0x3ac5b7];return _0x4ed3f4;};'use strict';var util=require('util');var logger=require(_0xc0ae('0x0'))(_0xc0ae('0x1'));var BPromise=require('bluebird');var exec=require(_0xc0ae('0x2'))[_0xc0ae('0x3')];exports['execute']=function(_0xd24313){return new BPromise(function(_0x14fa1d,_0x17a353){exec(_0xd24313,function(_0x3fd66d,_0x446783,_0x426d48){logger['info'](_0xc0ae('0x4'),_0x446783);if(_0x3fd66d){logger[_0xc0ae('0x5')](_0xc0ae('0x4'),_0xc0ae('0x6'),util[_0xc0ae('0x7')](_0x3fd66d,{'showHidden':![],'depth':null}),_0x446783,_0x426d48);_0x17a353(_0x3fd66d);}_0x14fa1d(_0x446783);});});}; \ No newline at end of file +var _0x9b44=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x3da7c0,_0x3b3a30){var _0x5c0d06=function(_0x318fdc){while(--_0x318fdc){_0x3da7c0['push'](_0x3da7c0['shift']());}};_0x5c0d06(++_0x3b3a30);}(_0x9b44,0x1a7));var _0x49b4=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x9b44[_0xdd82b4];return _0x549bb2;};'use strict';var util=require(_0x49b4('0x0'));var logger=require(_0x49b4('0x1'))(_0x49b4('0x2'));var BPromise=require(_0x49b4('0x3'));var exec=require(_0x49b4('0x4'))[_0x49b4('0x5')];exports[_0x49b4('0x6')]=function(_0x589276){return new BPromise(function(_0x5c5fb3,_0x586547){exec(_0x589276,function(_0x515c77,_0x199203,_0x114bf7){logger[_0x49b4('0x7')](_0x49b4('0x8'),_0x199203);if(_0x515c77){logger[_0x49b4('0x7')]('Exec\x20gs',_0x49b4('0x9'),util[_0x49b4('0xa')](_0x515c77,{'showHidden':![],'depth':null}),_0x199203,_0x114bf7);_0x586547(_0x515c77);}_0x5c5fb3(_0x199203);});});}; \ 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 71f96e9..d1244df 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 _0xdf0e=['lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x471046,_0x298d97){var _0x1596a2=function(_0x5bd383){while(--_0x5bd383){_0x471046['push'](_0x471046['shift']());}};_0x1596a2(++_0x298d97);}(_0xdf0e,0x78));var _0xedf0=function(_0x5ae7ae,_0x534c34){_0x5ae7ae=_0x5ae7ae-0x0;var _0x5929f7=_0xdf0e[_0x5ae7ae];return _0x5929f7;};'use strict';var util=require('util');var _=require(_0xedf0('0x0'));var moment=require(_0xedf0('0x1'));var logger=require(_0xedf0('0x2'))('fax');exports[_0xedf0('0x3')]=function(_0x24ea7f){return{'message':_0x24ea7f};};exports[_0xedf0('0x4')]=function(_0x3aa05c,_0x3193bb){logger[_0xedf0('0x5')](_0x3aa05c,util[_0xedf0('0x6')](_0x3193bb,{'showHidden':![],'depth':null}));};exports[_0xedf0('0x7')]=function(_0x5bfdfb,_0x31c2b6){var _0x7f9257={'XMF-ECM':_0x31c2b6[_0xedf0('0x8')],'XMF-HEADERINFO':_0x31c2b6[_0xedf0('0x9')],'XMF-MINRATE':_0x31c2b6[_0xedf0('0xa')],'XMF-MAXRATE':_0x31c2b6[_0xedf0('0xb')],'XMF-MODEM':util[_0xedf0('0xc')](_0xedf0('0xd'),_0x31c2b6[_0xedf0('0xe')]),'XMF-GATEWAY':_0x31c2b6['gateway'],'XMF-FAXDETECT':_0x31c2b6[_0xedf0('0xf')],'XMF-T38TIMEOUT':_0x31c2b6['t38timeout'],'XMF-LOCALSTATIONID':_0x31c2b6[_0xedf0('0x10')],'XMF-PATH':_0x5bfdfb[_0xedf0('0x11')]};return _0x7f9257;};exports['variablesAction']=function(_0x5d5b91,_0x512628){return{'actionid':_0x5d5b91[_0xedf0('0x12')],'action':_0xedf0('0x13'),'channel':_0x5d5b91[_0xedf0('0x14')],'Exten':_0xedf0('0x15'),'Context':_0xedf0('0x16'),'Priority':'1','callerid':util['format'](_0xedf0('0x17'),_0x5d5b91['headerinfo']?_0x5d5b91['headerinfo']:'',_0x5d5b91['localstationid']),'variable':_0x512628,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5d5b91[_0xedf0('0x12')]};}; \ No newline at end of file +var _0x9ae5=['gateway','t38timeout','localstationid','path','variablesAction','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','lodash','../../../../config/logger','fax','message','logger','info','inspect','ecm','maxrate','\x22%s\x22','modem'];(function(_0x18fc84,_0x4df94f){var _0x1ac415=function(_0x492ab5){while(--_0x492ab5){_0x18fc84['push'](_0x18fc84['shift']());}};_0x1ac415(++_0x4df94f);}(_0x9ae5,0x1c3));var _0x59ae=function(_0x3b3a02,_0x30d3a2){_0x3b3a02=_0x3b3a02-0x0;var _0x33d400=_0x9ae5[_0x3b3a02];return _0x33d400;};'use strict';var util=require('util');var _=require(_0x59ae('0x0'));var moment=require('moment');var logger=require(_0x59ae('0x1'))(_0x59ae('0x2'));exports[_0x59ae('0x3')]=function(_0x1d439d){return{'message':_0x1d439d};};exports[_0x59ae('0x4')]=function(_0xf5f79f,_0xee274e){logger[_0x59ae('0x5')](_0xf5f79f,util[_0x59ae('0x6')](_0xee274e,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3e7127,_0x28d52e){var _0x4b73ca={'XMF-ECM':_0x28d52e[_0x59ae('0x7')],'XMF-HEADERINFO':_0x28d52e['headerinfo'],'XMF-MINRATE':_0x28d52e['minrate'],'XMF-MAXRATE':_0x28d52e[_0x59ae('0x8')],'XMF-MODEM':util['format'](_0x59ae('0x9'),_0x28d52e[_0x59ae('0xa')]),'XMF-GATEWAY':_0x28d52e[_0x59ae('0xb')],'XMF-FAXDETECT':_0x28d52e['faxdetect'],'XMF-T38TIMEOUT':_0x28d52e[_0x59ae('0xc')],'XMF-LOCALSTATIONID':_0x28d52e[_0x59ae('0xd')],'XMF-PATH':_0x3e7127[_0x59ae('0xe')]};return _0x4b73ca;};exports[_0x59ae('0xf')]=function(_0x225487,_0x502b75){return{'actionid':_0x225487['uniqueid'],'action':_0x59ae('0x10'),'channel':_0x225487[_0x59ae('0x11')],'Exten':'xcally-motion-fax','Context':_0x59ae('0x12'),'Priority':'1','callerid':util['format'](_0x59ae('0x13'),_0x225487[_0x59ae('0x14')]?_0x225487['headerinfo']:'',_0x225487['localstationid']),'variable':_0x502b75,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x225487[_0x59ae('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index fbaa531..eb4623f 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 _0x92c9=['getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','sync','error','[index.js][main]','bluebird','util','moment','./report','./preview','./rpc/user','./rpc/voiceQueue','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x92c9,0x1e0));var _0x992c=function(_0x4b6b39,_0x547f83){_0x4b6b39=_0x4b6b39-0x0;var _0x5145df=_0x92c9[_0x4b6b39];return _0x5145df;};'use strict';var BPromise=require(_0x992c('0x0'));var util=require(_0x992c('0x1'));var moment=require(_0x992c('0x2'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x992c('0x3'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x992c('0x4'));var Fax=require('./fax');var user=require(_0x992c('0x5'));var voiceQueue=require(_0x992c('0x6'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x992c('0x7'));var template=require(_0x992c('0x8'));var cmHopperHistory=require(_0x992c('0x9'));var campaign=require(_0x992c('0xa'));var voiceExtension=require(_0x992c('0xb'));var faxAccount=require(_0x992c('0xc'));var zendesk=require(_0x992c('0xd'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x992c('0xe'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x992c('0xf'));var vtiger=require(_0x992c('0x10'));var freshsales=require(_0x992c('0x11'));var servicenow=require(_0x992c('0x12'));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(_0x992c('0x13'))(_0x992c('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x992c('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x992c('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x992c('0x16')]()[_0x992c('0x17')](user['getAgents']())['then'](realtime[_0x992c('0x18')]())[_0x992c('0x17')](user[_0x992c('0x19')]())['then'](realtime[_0x992c('0x1a')]())[_0x992c('0x17')](trunk[_0x992c('0x1b')]())['then'](realtime['initTrunks']())['then'](voiceQueue[_0x992c('0x1c')]())[_0x992c('0x17')](realtime[_0x992c('0x1d')]())[_0x992c('0x17')](trigger[_0x992c('0x1e')]())[_0x992c('0x17')](realtime[_0x992c('0x1f')]())['then'](template[_0x992c('0x20')]())['then'](realtime['initTemplates']())['then'](zendesk[_0x992c('0x21')]())['then'](realtime[_0x992c('0x22')]())[_0x992c('0x17')](salesforce[_0x992c('0x23')]())[_0x992c('0x17')](realtime[_0x992c('0x24')]())[_0x992c('0x17')](sugarcrm[_0x992c('0x25')]())['then'](realtime[_0x992c('0x26')]())[_0x992c('0x17')](freshdesk[_0x992c('0x27')]())[_0x992c('0x17')](realtime[_0x992c('0x28')]())[_0x992c('0x17')](desk['getDeskAccounts']())[_0x992c('0x17')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())[_0x992c('0x17')](realtime[_0x992c('0x29')]())['then'](vtiger[_0x992c('0x2a')]())[_0x992c('0x17')](realtime[_0x992c('0x2b')]())[_0x992c('0x17')](freshsales[_0x992c('0x2c')]())[_0x992c('0x17')](realtime[_0x992c('0x2d')]())[_0x992c('0x17')](servicenow['getServicenowAccounts']())[_0x992c('0x17')](realtime[_0x992c('0x2e')]())[_0x992c('0x17')](dynamics365[_0x992c('0x2f')]())['then'](realtime[_0x992c('0x30')]())[_0x992c('0x17')](campaign[_0x992c('0x31')]())[_0x992c('0x17')](realtime[_0x992c('0x32')]())[_0x992c('0x17')](voiceExtension[_0x992c('0x33')]())['then'](realtime[_0x992c('0x34')]())[_0x992c('0x17')](faxAccount['getFaxAccounts']())[_0x992c('0x17')](realtime[_0x992c('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x992c('0x16')]()[_0x992c('0x17')](voiceQueueReport[_0x992c('0x36')]())['then'](realtime[_0x992c('0x37')]())[_0x992c('0x17')](cmHopperHistory[_0x992c('0x38')]())[_0x992c('0x17')](realtime[_0x992c('0x39')]())[_0x992c('0x17')](cmHopperHistory[_0x992c('0x3a')]())[_0x992c('0x17')](realtime[_0x992c('0x3b')]())[_0x992c('0x17')](voiceCallReport[_0x992c('0x3c')]())[_0x992c('0x17')](realtime['initVoiceCallReports']())[_0x992c('0x3d')](function(_0x17461c){logger['error'](_0x992c('0x3e'),util[_0x992c('0x3f')](_0x17461c,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x26dbc0){return initRealtime();})[_0x992c('0x17')](function(){return initParams();})[_0x992c('0x17')](function(){report[_0x992c('0x40')]();setInterval(initRealtime,0x1388);})[_0x992c('0x3d')](function(_0x4a2ab3){logger[_0x992c('0x41')](_0x992c('0x42'),util[_0x992c('0x3f')](_0x4a2ab3,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x7d65=['./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','initTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','inspect','bluebird','util','./report','./acw','./trigger','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk'];(function(_0x30f929,_0x4706cd){var _0xbf1b7f=function(_0x2f94a2){while(--_0x2f94a2){_0x30f929['push'](_0x30f929['shift']());}};_0xbf1b7f(++_0x4706cd);}(_0x7d65,0xbc));var _0x57d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d65[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x57d6('0x0'));var util=require(_0x57d6('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x57d6('0x2'));var Acw=require(_0x57d6('0x3'));var Trigger=require(_0x57d6('0x4'));var Dialer=require(_0x57d6('0x5'));var Preview=require(_0x57d6('0x6'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x57d6('0x7'));var voiceQueueReport=require(_0x57d6('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x57d6('0x9'));var template=require(_0x57d6('0xa'));var cmHopperHistory=require(_0x57d6('0xb'));var campaign=require(_0x57d6('0xc'));var voiceExtension=require(_0x57d6('0xd'));var faxAccount=require(_0x57d6('0xe'));var zendesk=require(_0x57d6('0xf'));var salesforce=require(_0x57d6('0x10'));var sugarcrm=require(_0x57d6('0x11'));var freshdesk=require(_0x57d6('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x57d6('0x13'));var vtiger=require(_0x57d6('0x14'));var freshsales=require(_0x57d6('0x15'));var servicenow=require(_0x57d6('0x16'));var dynamics365=require(_0x57d6('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x57d6('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x57d6('0x19')](_0x57d6('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x57d6('0x1b')]()[_0x57d6('0x1c')](user[_0x57d6('0x1d')]())[_0x57d6('0x1c')](realtime[_0x57d6('0x1e')]())[_0x57d6('0x1c')](user['getTelephones']())[_0x57d6('0x1c')](realtime[_0x57d6('0x1f')]())[_0x57d6('0x1c')](trunk['getTrunks']())[_0x57d6('0x1c')](realtime[_0x57d6('0x20')]())[_0x57d6('0x1c')](voiceQueue['getVoiceQueues']())[_0x57d6('0x1c')](realtime[_0x57d6('0x21')]())[_0x57d6('0x1c')](trigger[_0x57d6('0x22')]())['then'](realtime[_0x57d6('0x23')]())[_0x57d6('0x1c')](template[_0x57d6('0x24')]())[_0x57d6('0x1c')](realtime['initTemplates']())[_0x57d6('0x1c')](zendesk[_0x57d6('0x25')]())[_0x57d6('0x1c')](realtime[_0x57d6('0x26')]())['then'](salesforce[_0x57d6('0x27')]())['then'](realtime[_0x57d6('0x28')]())['then'](sugarcrm[_0x57d6('0x29')]())['then'](realtime[_0x57d6('0x2a')]())[_0x57d6('0x1c')](freshdesk[_0x57d6('0x2b')]())[_0x57d6('0x1c')](realtime[_0x57d6('0x2c')]())[_0x57d6('0x1c')](desk[_0x57d6('0x2d')]())[_0x57d6('0x1c')](realtime['initDeskAccounts']())[_0x57d6('0x1c')](zoho[_0x57d6('0x2e')]())[_0x57d6('0x1c')](realtime[_0x57d6('0x2f')]())[_0x57d6('0x1c')](vtiger[_0x57d6('0x30')]())['then'](realtime[_0x57d6('0x31')]())[_0x57d6('0x1c')](freshsales[_0x57d6('0x32')]())[_0x57d6('0x1c')](realtime[_0x57d6('0x33')]())[_0x57d6('0x1c')](servicenow[_0x57d6('0x34')]())['then'](realtime['initServicenowAccounts']())[_0x57d6('0x1c')](dynamics365['getDynamics365Accounts']())[_0x57d6('0x1c')](realtime['initDynamics365Accounts']())[_0x57d6('0x1c')](campaign['getCampaigns']())[_0x57d6('0x1c')](realtime[_0x57d6('0x35')]())['then'](voiceExtension['getVoiceExtensions']())[_0x57d6('0x1c')](realtime[_0x57d6('0x36')]())[_0x57d6('0x1c')](faxAccount[_0x57d6('0x37')]())[_0x57d6('0x1c')](realtime[_0x57d6('0x38')]())[_0x57d6('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x57d6('0x1b')]()[_0x57d6('0x1c')](voiceQueueReport[_0x57d6('0x39')]())[_0x57d6('0x1c')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x57d6('0x1c')](realtime[_0x57d6('0x3a')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x57d6('0x1c')](realtime[_0x57d6('0x3b')]())[_0x57d6('0x1c')](voiceCallReport[_0x57d6('0x3c')]())[_0x57d6('0x1c')](realtime[_0x57d6('0x3d')]())[_0x57d6('0x3e')](function(_0xbd7f1b){logger[_0x57d6('0x3f')](_0x57d6('0x40'),util['inspect'](_0xbd7f1b,{'showHidden':![],'depth':null}));});}function main(){return server[_0x57d6('0x41')](realtime,preview,fax)[_0x57d6('0x1c')](function(_0x49eb35){return initRealtime();})[_0x57d6('0x1c')](function(){return initParams();})['then'](function(){report[_0x57d6('0x42')]();setInterval(initRealtime,0x1388);})[_0x57d6('0x3e')](function(_0x57f435){logger[_0x57d6('0x3f')](_0x57d6('0x43'),util[_0x57d6('0x44')](_0x57f435,{'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 f5f7b82..2803c3b 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0xe56790,_0x5f304d){var _0x145cf7=function(_0x49aeb1){while(--_0x49aeb1){_0xe56790['push'](_0xe56790['shift']());}};_0x145cf7(++_0x5f304d);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x5d7c1b,_0x134d21){var _0x1a00a6=function(_0x48a158){while(--_0x48a158){_0x5d7c1b['push'](_0x5d7c1b['shift']());}};_0x1a00a6(++_0x134d21);}(_0xe706,0xa3));var _0x6e70=function(_0xdb951d,_0x1dc42b){_0xdb951d=_0xdb951d-0x0;var _0x5e789e=_0xe706[_0xdb951d];return _0x5e789e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 937a24c..7249600 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 _0x982e=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x4f9e31,_0x19881c){var _0x2f9fc7=function(_0x318c57){while(--_0x318c57){_0x4f9e31['push'](_0x4f9e31['shift']());}};_0x2f9fc7(++_0x19881c);}(_0x982e,0xab));var _0xe982=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x982e[_0x57b54c];return _0x59cc19;};'use strict';function Campaign(_0x317bb4){this['id']=_0x317bb4['id']||0x0;this[_0xe982('0x0')]=_0x317bb4['name']||'';this['type']=_0x317bb4[_0xe982('0x1')]||_0xe982('0x2');this[_0xe982('0x3')]=0x0;this[_0xe982('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xe982('0x5')]=0x0;this['message']='';this[_0xe982('0x6')]=!![];this[_0xe982('0x7')]=_0x317bb4[_0xe982('0x7')];this[_0xe982('0x8')]=_0x317bb4[_0xe982('0x8')];this[_0xe982('0x9')]=_0x317bb4[_0xe982('0x9')]||null;this[_0xe982('0xa')]=_0x317bb4['dialGlobalInterval']?_0x317bb4[_0xe982('0xa')]:null;this[_0xe982('0xb')]=_0x317bb4[_0xe982('0xb')];this[_0xe982('0xc')]=_0x317bb4[_0xe982('0xc')];this['dialOriginateTimeout']=_0x317bb4[_0xe982('0xd')]||0x1e;this[_0xe982('0xe')]=_0x317bb4[_0xe982('0xe')];this[_0xe982('0xf')]=_0x317bb4[_0xe982('0xf')];this[_0xe982('0x10')]=_0x317bb4['dialBusyMaxRetry'];this[_0xe982('0x11')]=_0x317bb4[_0xe982('0x11')];this[_0xe982('0x12')]=_0x317bb4[_0xe982('0x12')];this[_0xe982('0x13')]=_0x317bb4[_0xe982('0x13')];this[_0xe982('0x14')]=_0x317bb4[_0xe982('0x14')];this[_0xe982('0x15')]=_0x317bb4[_0xe982('0x15')]||0x3;this[_0xe982('0x16')]=_0x317bb4['dialNoSuchNumberRetryFrequency']||0x96;this[_0xe982('0x17')]=_0x317bb4[_0xe982('0x17')]||0x3;this[_0xe982('0x18')]=_0x317bb4[_0xe982('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x317bb4[_0xe982('0x19')]||0x3;this[_0xe982('0x1a')]=_0x317bb4[_0xe982('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x317bb4['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x317bb4[_0xe982('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x317bb4[_0xe982('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x317bb4[_0xe982('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x317bb4[_0xe982('0x1e')]||'DESC';this[_0xe982('0x1f')]=_0x317bb4['dialPrefix']||undefined;this[_0xe982('0x20')]=_0x317bb4[_0xe982('0x20')]||undefined;this[_0xe982('0x21')]=_0x317bb4[_0xe982('0x21')]||undefined;this[_0xe982('0x22')]=_0x317bb4[_0xe982('0x22')]?_0x317bb4[_0xe982('0x22')]:undefined;this[_0xe982('0x23')]=_0x317bb4[_0xe982('0x23')]?_0x317bb4[_0xe982('0x23')]:undefined;this[_0xe982('0x24')]=_0x317bb4[_0xe982('0x24')]?_0x317bb4[_0xe982('0x24')]:undefined;this['SquareProject']=_0x317bb4[_0xe982('0x25')]?_0x317bb4[_0xe982('0x25')]:undefined;this[_0xe982('0x26')]=_0x317bb4[_0xe982('0x25')]?_0x317bb4[_0xe982('0x25')]['name']:undefined;this[_0xe982('0x27')]=_0x317bb4[_0xe982('0x27')]||![];this[_0xe982('0x28')]=_0x317bb4['dialAMDInitialSilence'];this[_0xe982('0x29')]=_0x317bb4[_0xe982('0x29')];this[_0xe982('0x2a')]=_0x317bb4[_0xe982('0x2a')];this[_0xe982('0x2b')]=_0x317bb4[_0xe982('0x2b')];this[_0xe982('0x2c')]=_0x317bb4[_0xe982('0x2c')];this['dialAMDBetweenWordsSilence']=_0x317bb4[_0xe982('0x2d')];this[_0xe982('0x2e')]=_0x317bb4[_0xe982('0x2e')];this['dialAMDSilenceThreshold']=_0x317bb4['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x317bb4[_0xe982('0x2f')];}module[_0xe982('0x30')]=Campaign; \ No newline at end of file +var _0xc86e=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0xc86e,0xae));var _0xec86=function(_0x54aa65,_0xb67559){_0x54aa65=_0x54aa65-0x0;var _0x4b0957=_0xc86e[_0x54aa65];return _0x4b0957;};'use strict';function Campaign(_0x13541e){this['id']=_0x13541e['id']||0x0;this['name']=_0x13541e[_0xec86('0x0')]||'';this[_0xec86('0x1')]=_0x13541e['type']||_0xec86('0x2');this[_0xec86('0x3')]=0x0;this[_0xec86('0x4')]=0x0;this[_0xec86('0x5')]=0x0;this[_0xec86('0x6')]=0x0;this[_0xec86('0x7')]='';this[_0xec86('0x8')]=!![];this['active']=_0x13541e[_0xec86('0x9')];this[_0xec86('0xa')]=_0x13541e[_0xec86('0xa')];this[_0xec86('0xb')]=_0x13541e[_0xec86('0xb')]||null;this[_0xec86('0xc')]=_0x13541e['dialGlobalInterval']?_0x13541e[_0xec86('0xc')]:null;this[_0xec86('0xd')]=_0x13541e['dialOriginateCallerIdName'];this[_0xec86('0xe')]=_0x13541e['dialOriginateCallerIdNumber'];this[_0xec86('0xf')]=_0x13541e[_0xec86('0xf')]||0x1e;this[_0xec86('0x10')]=_0x13541e[_0xec86('0x10')];this[_0xec86('0x11')]=_0x13541e[_0xec86('0x11')];this['dialBusyMaxRetry']=_0x13541e['dialBusyMaxRetry'];this[_0xec86('0x12')]=_0x13541e['dialBusyRetryFrequency'];this[_0xec86('0x13')]=_0x13541e[_0xec86('0x13')];this[_0xec86('0x14')]=_0x13541e['dialNoAnswerRetryFrequency'];this[_0xec86('0x15')]=_0x13541e[_0xec86('0x15')];this[_0xec86('0x16')]=_0x13541e[_0xec86('0x16')]||0x3;this[_0xec86('0x17')]=_0x13541e[_0xec86('0x17')]||0x96;this[_0xec86('0x18')]=_0x13541e[_0xec86('0x18')]||0x3;this['dialDropRetryFrequency']=_0x13541e[_0xec86('0x19')]||0x96;this[_0xec86('0x1a')]=_0x13541e[_0xec86('0x1a')]||0x3;this['dialAbandonedRetryFrequency']=_0x13541e[_0xec86('0x1b')]||0x96;this[_0xec86('0x1c')]=_0x13541e[_0xec86('0x1c')]||0x3;this[_0xec86('0x1d')]=_0x13541e['dialMachineRetryFrequency']||0x96;this[_0xec86('0x1e')]=_0x13541e[_0xec86('0x1e')]||0x3;this[_0xec86('0x1f')]=_0x13541e['dialAgentRejectRetryFrequency']||0x96;this[_0xec86('0x20')]=_0x13541e[_0xec86('0x20')]||_0xec86('0x21');this[_0xec86('0x22')]=_0x13541e['dialPrefix']||undefined;this[_0xec86('0x23')]=_0x13541e[_0xec86('0x23')]||undefined;this[_0xec86('0x24')]=_0x13541e[_0xec86('0x24')]||undefined;this['TrunkBackup']=_0x13541e[_0xec86('0x25')]?_0x13541e[_0xec86('0x25')]:undefined;this[_0xec86('0x26')]=_0x13541e['Trunk']?_0x13541e[_0xec86('0x26')]:undefined;this[_0xec86('0x27')]=_0x13541e[_0xec86('0x27')]?_0x13541e['Interval']:undefined;this[_0xec86('0x28')]=_0x13541e[_0xec86('0x28')]?_0x13541e[_0xec86('0x28')]:undefined;this['dialQueueProject']=_0x13541e[_0xec86('0x28')]?_0x13541e[_0xec86('0x28')][_0xec86('0x0')]:undefined;this[_0xec86('0x29')]=_0x13541e[_0xec86('0x29')]||![];this[_0xec86('0x2a')]=_0x13541e[_0xec86('0x2a')];this['dialAMDGreeting']=_0x13541e[_0xec86('0x2b')];this[_0xec86('0x2c')]=_0x13541e[_0xec86('0x2c')];this['dialAMDTotalAnalysisTime']=_0x13541e['dialAMDTotalAnalysisTime'];this[_0xec86('0x2d')]=_0x13541e[_0xec86('0x2d')];this[_0xec86('0x2e')]=_0x13541e['dialAMDBetweenWordsSilence'];this[_0xec86('0x2f')]=_0x13541e[_0xec86('0x2f')];this[_0xec86('0x30')]=_0x13541e[_0xec86('0x30')];this['dialAMDMaximumWordLength']=_0x13541e[_0xec86('0x31')];}module[_0xec86('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 ebe55b3..7e6ecfb 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 _0xae8e=['calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x1f5449,_0x42e6ec){var _0x5d254a=function(_0x23292e){while(--_0x23292e){_0x1f5449['push'](_0x1f5449['shift']());}};_0x5d254a(++_0x42e6ec);}(_0xae8e,0xc3));var _0xeae8=function(_0x198772,_0x36dc63){_0x198772=_0x198772-0x0;var _0x43103d=_0xae8e[_0x198772];return _0x43103d;};'use strict';function Channel(){this[_0xeae8('0x0')]=null;this[_0xeae8('0x1')]='';this[_0xeae8('0x2')]='';this[_0xeae8('0x3')]=0x0;this[_0xeae8('0x4')]='';this[_0xeae8('0x5')]=undefined;this[_0xeae8('0x6')]=undefined;this[_0xeae8('0x7')]=0x0;this[_0xeae8('0x8')]='';this[_0xeae8('0x9')]=0x0;this[_0xeae8('0xa')]=0x0;this[_0xeae8('0xb')]=0x0;this[_0xeae8('0xc')]=![];this[_0xeae8('0xd')]=null;this[_0xeae8('0xe')]=null;this[_0xeae8('0xf')]=![];this[_0xeae8('0x10')]=![];this[_0xeae8('0x11')]='';this[_0xeae8('0x12')]='';this[_0xeae8('0x13')]=0x0;this[_0xeae8('0x14')]=0x0;this[_0xeae8('0x15')]=0x0;this[_0xeae8('0x16')]=null;this[_0xeae8('0x17')]=null;this[_0xeae8('0x18')]=null;this[_0xeae8('0x19')]=![];this[_0xeae8('0x1a')]=null;this[_0xeae8('0x1b')]=null;this[_0xeae8('0x1c')]=[];this[_0xeae8('0x1d')]=undefined;this[_0xeae8('0x1e')]=undefined;this['transferType']=undefined;this[_0xeae8('0x1f')]=0x0;}module[_0xeae8('0x20')]=Channel; \ No newline at end of file +var _0x68ee=['transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','endtime','unmanaged','lastapplication','lastdata','billableseconds','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors'];(function(_0x1b620f,_0x450a01){var _0x4c5116=function(_0x221972){while(--_0x221972){_0x1b620f['push'](_0x1b620f['shift']());}};_0x4c5116(++_0x450a01);}(_0x68ee,0xd3));var _0xe68e=function(_0x1bd37a,_0x24eac1){_0x1bd37a=_0x1bd37a-0x0;var _0x29f6ea=_0x68ee[_0x1bd37a];return _0x29f6ea;};'use strict';function Channel(){this[_0xe68e('0x0')]=null;this[_0xe68e('0x1')]='';this[_0xe68e('0x2')]='';this[_0xe68e('0x3')]=0x0;this[_0xe68e('0x4')]='';this[_0xe68e('0x5')]=undefined;this[_0xe68e('0x6')]=undefined;this[_0xe68e('0x7')]=0x0;this['context']='';this[_0xe68e('0x8')]=0x0;this['linkedid']=0x0;this[_0xe68e('0x9')]=0x0;this[_0xe68e('0xa')]=![];this['answertime']=null;this[_0xe68e('0xb')]=null;this[_0xe68e('0xc')]=![];this['abandoned']=![];this[_0xe68e('0xd')]='';this[_0xe68e('0xe')]='';this['duration']=0x0;this[_0xe68e('0xf')]=0x0;this[_0xe68e('0x10')]=0x0;this['type']=null;this[_0xe68e('0x11')]=null;this[_0xe68e('0x12')]=null;this[_0xe68e('0x13')]=![];this[_0xe68e('0x14')]=null;this[_0xe68e('0x15')]=null;this[_0xe68e('0x16')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0xe68e('0x17')]=undefined;this[_0xe68e('0x18')]=0x0;}module[_0xe68e('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a6f4840..80d6efd 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 _0x5ea8=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType'];(function(_0x22b6d5,_0x5b8a5c){var _0x303db2=function(_0x5ddfa8){while(--_0x5ddfa8){_0x22b6d5['push'](_0x22b6d5['shift']());}};_0x303db2(++_0x5b8a5c);}(_0x5ea8,0x99));var _0x85ea=function(_0x9b72f3,_0x26deca){_0x9b72f3=_0x9b72f3-0x0;var _0x1eb9c8=_0x5ea8[_0x9b72f3];return _0x1eb9c8;};'use strict';function DeskAccount(_0x3ec222){this['id']=_0x3ec222['id']||0x0;this['name']=_0x3ec222['name']||'';this[_0x85ea('0x0')]=_0x3ec222[_0x85ea('0x0')]||'';this[_0x85ea('0x1')]=_0x3ec222['remoteUri']||'';this[_0x85ea('0x2')]=_0x3ec222[_0x85ea('0x2')]||'';this[_0x85ea('0x3')]=_0x3ec222[_0x85ea('0x3')]||'';this[_0x85ea('0x4')]=_0x3ec222[_0x85ea('0x4')]||'';this[_0x85ea('0x5')]=_0x3ec222[_0x85ea('0x5')]||'';this['token']=_0x3ec222[_0x85ea('0x6')]||'';this[_0x85ea('0x7')]=_0x3ec222[_0x85ea('0x7')]||'';this[_0x85ea('0x8')]=_0x3ec222[_0x85ea('0x8')]||'';this[_0x85ea('0x9')]=_0x3ec222['serverUrl']||'';this[_0x85ea('0xa')]=_0x3ec222['Configurations']||{};}module[_0x85ea('0xb')]=DeskAccount; \ No newline at end of file +var _0xd7ed=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x11ca17,_0x5174bc){var _0x407d1b=function(_0x10f108){while(--_0x10f108){_0x11ca17['push'](_0x11ca17['shift']());}};_0x407d1b(++_0x5174bc);}(_0xd7ed,0xca));var _0xdd7e=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xd7ed[_0x344a3f];return _0x264712;};'use strict';function DeskAccount(_0x12171d){this['id']=_0x12171d['id']||0x0;this[_0xdd7e('0x0')]=_0x12171d[_0xdd7e('0x0')]||'';this[_0xdd7e('0x1')]=_0x12171d[_0xdd7e('0x1')]||'';this[_0xdd7e('0x2')]=_0x12171d[_0xdd7e('0x2')]||'';this[_0xdd7e('0x3')]=_0x12171d[_0xdd7e('0x3')]||'';this[_0xdd7e('0x4')]=_0x12171d['password']||'';this[_0xdd7e('0x5')]=_0x12171d[_0xdd7e('0x5')]||'';this['consumerSecret']=_0x12171d[_0xdd7e('0x6')]||'';this['token']=_0x12171d[_0xdd7e('0x7')]||'';this[_0xdd7e('0x8')]=_0x12171d[_0xdd7e('0x8')]||'';this[_0xdd7e('0x9')]=_0x12171d[_0xdd7e('0x9')]||'';this['serverUrl']=_0x12171d[_0xdd7e('0xa')]||'';this[_0xdd7e('0xb')]=_0x12171d[_0xdd7e('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 90fb694..8676baf 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 _0xf10d=['CloudProvider','exports','name','username','password','clientId','clientSecret','modernAuthentication','Configurations'];(function(_0x1bca14,_0x2db9d8){var _0x348df5=function(_0x41a801){while(--_0x41a801){_0x1bca14['push'](_0x1bca14['shift']());}};_0x348df5(++_0x2db9d8);}(_0xf10d,0xbf));var _0xdf10=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xf10d[_0x5e9a69];return _0x5979c8;};'use strict';function Dynamics365Account(_0x16b670){this['id']=_0x16b670['id']||0x0;this[_0xdf10('0x0')]=_0x16b670[_0xdf10('0x0')]||'';this[_0xdf10('0x1')]=_0x16b670[_0xdf10('0x1')]||'';this['password']=_0x16b670[_0xdf10('0x2')]||'';this['remoteUri']=_0x16b670['remoteUri']||'';this['tenantId']=_0x16b670['tenantId']||'';this['clientId']=_0x16b670[_0xdf10('0x3')]||'';this['clientSecret']=_0x16b670[_0xdf10('0x4')]||{};this['serverUrl']=_0x16b670['serverUrl']||'';this[_0xdf10('0x5')]=_0x16b670[_0xdf10('0x5')]||![];this[_0xdf10('0x6')]=_0x16b670[_0xdf10('0x6')]||{};this['CloudProvider']=_0x16b670[_0xdf10('0x7')]||{};}module[_0xdf10('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x0e29=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x3183b4,_0x3d33a9){var _0x906f76=function(_0x5d0853){while(--_0x5d0853){_0x3183b4['push'](_0x3183b4['shift']());}};_0x906f76(++_0x3d33a9);}(_0x0e29,0x132));var _0x90e2=function(_0x30ece5,_0x501590){_0x30ece5=_0x30ece5-0x0;var _0x44ecd0=_0x0e29[_0x30ece5];return _0x44ecd0;};'use strict';function Dynamics365Account(_0x4fb206){this['id']=_0x4fb206['id']||0x0;this[_0x90e2('0x0')]=_0x4fb206['name']||'';this[_0x90e2('0x1')]=_0x4fb206[_0x90e2('0x1')]||'';this[_0x90e2('0x2')]=_0x4fb206['password']||'';this[_0x90e2('0x3')]=_0x4fb206[_0x90e2('0x3')]||'';this[_0x90e2('0x4')]=_0x4fb206[_0x90e2('0x4')]||'';this[_0x90e2('0x5')]=_0x4fb206[_0x90e2('0x5')]||'';this[_0x90e2('0x6')]=_0x4fb206[_0x90e2('0x6')]||{};this['serverUrl']=_0x4fb206[_0x90e2('0x7')]||'';this[_0x90e2('0x8')]=_0x4fb206[_0x90e2('0x8')]||![];this[_0x90e2('0x9')]=_0x4fb206['Configurations']||{};this[_0x90e2('0xa')]=_0x4fb206['CloudProvider']||{};}module[_0x90e2('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 7144155..839c318 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 _0x4ba8=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x2410e9,_0x6028ce){var _0x560eba=function(_0x2fac3e){while(--_0x2fac3e){_0x2410e9['push'](_0x2410e9['shift']());}};_0x560eba(++_0x6028ce);}(_0x4ba8,0x136));var _0x84ba=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4ba8[_0x2641f9];return _0x585741;};'use strict';function FaxAccount(_0xe8d710){this['id']=_0xe8d710['id']||0x0;this[_0x84ba('0x0')]=_0xe8d710[_0x84ba('0x0')]||'';this[_0x84ba('0x1')]=_0xe8d710['description'];this[_0x84ba('0x2')]=_0xe8d710[_0x84ba('0x2')];this[_0x84ba('0x3')]=_0xe8d710[_0x84ba('0x3')];this[_0x84ba('0x4')]=_0xe8d710[_0x84ba('0x4')];this[_0x84ba('0x5')]=_0xe8d710[_0x84ba('0x5')]||0x960;this[_0x84ba('0x6')]=_0xe8d710['maxrate']||0x3840;this['modem']=_0xe8d710[_0x84ba('0x7')]||_0x84ba('0x8');this[_0x84ba('0x9')]=_0xe8d710[_0x84ba('0x9')]||'no';this[_0x84ba('0xa')]=_0xe8d710[_0x84ba('0xa')]||'no';this[_0x84ba('0xb')]=_0xe8d710[_0x84ba('0xb')]||0x1388;this[_0x84ba('0xc')]=_0xe8d710[_0x84ba('0xc')]||'SIP';this[_0x84ba('0xd')]=_0xe8d710['Trunk']?_0xe8d710[_0x84ba('0xd')]:undefined;this[_0x84ba('0xe')]=_0xe8d710[_0x84ba('0xe')];this['key']=_0xe8d710[_0x84ba('0xf')];}module[_0x84ba('0x10')]=FaxAccount; \ No newline at end of file +var _0x74da=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports'];(function(_0x3b21f7,_0x278ae8){var _0x39b0da=function(_0x206036){while(--_0x206036){_0x3b21f7['push'](_0x3b21f7['shift']());}};_0x39b0da(++_0x278ae8);}(_0x74da,0x140));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x3b8701){this['id']=_0x3b8701['id']||0x0;this['name']=_0x3b8701[_0xa74d('0x0')]||'';this[_0xa74d('0x1')]=_0x3b8701['description'];this[_0xa74d('0x2')]=_0x3b8701[_0xa74d('0x2')];this[_0xa74d('0x3')]=_0x3b8701[_0xa74d('0x3')];this['localstationid']=_0x3b8701[_0xa74d('0x4')];this[_0xa74d('0x5')]=_0x3b8701[_0xa74d('0x5')]||0x960;this['maxrate']=_0x3b8701[_0xa74d('0x6')]||0x3840;this[_0xa74d('0x7')]=_0x3b8701['modem']||'v17,v27,v29';this[_0xa74d('0x8')]=_0x3b8701[_0xa74d('0x8')]||'no';this['faxdetect']=_0x3b8701[_0xa74d('0x9')]||'no';this[_0xa74d('0xa')]=_0x3b8701[_0xa74d('0xa')]||0x1388;this['tech']=_0x3b8701[_0xa74d('0xb')]||'SIP';this['Trunk']=_0x3b8701[_0xa74d('0xc')]?_0x3b8701[_0xa74d('0xc')]:undefined;this['ListId']=_0x3b8701[_0xa74d('0xd')];this[_0xa74d('0xe')]=_0x3b8701[_0xa74d('0xe')];}module[_0xa74d('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index fa56635..979054d 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 _0xc9aa=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x41440e,_0x134b0a){var _0x3fedca=function(_0x158f84){while(--_0x158f84){_0x41440e['push'](_0x41440e['shift']());}};_0x3fedca(++_0x134b0a);}(_0xc9aa,0x167));var _0xac9a=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0xc9aa[_0x2c6120];return _0x5fb114;};'use strict';function FreshdeskAccount(_0x14b724){this['id']=_0x14b724['id']||0x0;this[_0xac9a('0x0')]=_0x14b724[_0xac9a('0x0')]||'';this['username']=_0x14b724[_0xac9a('0x1')]||'';this[_0xac9a('0x2')]=_0x14b724[_0xac9a('0x3')]||'';this['remoteUri']=_0x14b724[_0xac9a('0x4')]||'';this['serverUrl']=_0x14b724[_0xac9a('0x5')]||'';this['Configurations']=_0x14b724[_0xac9a('0x6')]||{};}module[_0xac9a('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x1ee7=['remoteUri','serverUrl','Configurations','name','username','token'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1ee7,0x93));var _0x71ee=function(_0x4f417f,_0x1a5e84){_0x4f417f=_0x4f417f-0x0;var _0x4d6d=_0x1ee7[_0x4f417f];return _0x4d6d;};'use strict';function FreshdeskAccount(_0x269863){this['id']=_0x269863['id']||0x0;this[_0x71ee('0x0')]=_0x269863[_0x71ee('0x0')]||'';this[_0x71ee('0x1')]=_0x269863[_0x71ee('0x1')]||'';this['apiKey']=_0x269863[_0x71ee('0x2')]||'';this[_0x71ee('0x3')]=_0x269863[_0x71ee('0x3')]||'';this[_0x71ee('0x4')]=_0x269863['serverUrl']||'';this[_0x71ee('0x5')]=_0x269863['Configurations']||{};}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 6b8c0a0..ab8029f 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 _0x24ca=['serverUrl','Configurations','exports','name','username','token','remoteUri'];(function(_0x4b1f10,_0x2dd39b){var _0x5c16cc=function(_0x187e78){while(--_0x187e78){_0x4b1f10['push'](_0x4b1f10['shift']());}};_0x5c16cc(++_0x2dd39b);}(_0x24ca,0x1bc));var _0xa24c=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x24ca[_0x695b76];return _0x1dc21f;};'use strict';function FreshsalesAccount(_0x26ecd3){this['id']=_0x26ecd3['id']||0x0;this['name']=_0x26ecd3[_0xa24c('0x0')]||'';this[_0xa24c('0x1')]=_0x26ecd3[_0xa24c('0x1')]||'';this['apiKey']=_0x26ecd3[_0xa24c('0x2')]||'';this[_0xa24c('0x3')]=_0x26ecd3[_0xa24c('0x3')]||'';this[_0xa24c('0x4')]=_0x26ecd3[_0xa24c('0x4')]||'';this[_0xa24c('0x5')]=_0x26ecd3[_0xa24c('0x5')]||{};}module[_0xa24c('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x444e=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x44f226,_0x15cb63){var _0x40dffd=function(_0x2dc3ee){while(--_0x2dc3ee){_0x44f226['push'](_0x44f226['shift']());}};_0x40dffd(++_0x15cb63);}(_0x444e,0xe8));var _0xe444=function(_0x723f93,_0x297538){_0x723f93=_0x723f93-0x0;var _0x3f3405=_0x444e[_0x723f93];return _0x3f3405;};'use strict';function FreshsalesAccount(_0x1a335c){this['id']=_0x1a335c['id']||0x0;this['name']=_0x1a335c[_0xe444('0x0')]||'';this['username']=_0x1a335c[_0xe444('0x1')]||'';this['apiKey']=_0x1a335c[_0xe444('0x2')]||'';this['remoteUri']=_0x1a335c[_0xe444('0x3')]||'';this[_0xe444('0x4')]=_0x1a335c[_0xe444('0x4')]||'';this[_0xe444('0x5')]=_0x1a335c[_0xe444('0x5')]||{};}module[_0xe444('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 d3a423e..1b69908 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 _0x5071=['queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinename','context','exten','holdtime','assigned','lastAssignedTo','voice','mohtime','exports','uniqueid','calleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5071,0xd0));var _0x1507=function(_0x1a68ec,_0x2ab029){_0x1a68ec=_0x1a68ec-0x0;var _0x59ecde=_0x5071[_0x1a68ec];return _0x59ecde;};'use strict';function QueueReport(){this['type']='inbound';this[_0x1507('0x0')]='';this[_0x1507('0x1')]='';this['calleridname']='';this['queue']='';this[_0x1507('0x2')]=null;this[_0x1507('0x3')]=null;this[_0x1507('0x4')]=0x1;this[_0x1507('0x5')]=0x1;this[_0x1507('0x6')]=![];this[_0x1507('0x7')]=null;this['queuecallercomplete']=![];this[_0x1507('0x8')]=null;this[_0x1507('0x9')]=![];this[_0x1507('0xa')]=null;this['originalposition']=0x1;this[_0x1507('0xb')]='';this['connectedlinenum']='';this[_0x1507('0xc')]='';this['accountcode']='';this[_0x1507('0xd')]='';this[_0x1507('0xe')]='';this['priority']='';this[_0x1507('0xf')]=0x0;this[_0x1507('0x10')]=![];this[_0x1507('0x11')]='';this['motionChannel']=_0x1507('0x12');this[_0x1507('0x13')]=0x0;this['variables']={};}module[_0x1507('0x14')]=QueueReport; \ No newline at end of file +var _0xa53b=['inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','exten','holdtime','lastAssignedTo','voice'];(function(_0x100c8b,_0x888d5f){var _0x185898=function(_0x4276ec){while(--_0x4276ec){_0x100c8b['push'](_0x100c8b['shift']());}};_0x185898(++_0x888d5f);}(_0xa53b,0x17a));var _0xba53=function(_0x5448d3,_0x420f71){_0x5448d3=_0x5448d3-0x0;var _0x57fce2=_0xa53b[_0x5448d3];return _0x57fce2;};'use strict';function QueueReport(){this['type']=_0xba53('0x0');this[_0xba53('0x1')]='';this['calleridnum']='';this[_0xba53('0x2')]='';this[_0xba53('0x3')]='';this[_0xba53('0x4')]=null;this[_0xba53('0x5')]=null;this[_0xba53('0x6')]=0x1;this[_0xba53('0x7')]=0x1;this[_0xba53('0x8')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xba53('0x9')]=![];this[_0xba53('0xa')]=null;this[_0xba53('0xb')]=0x1;this['channel']='';this[_0xba53('0xc')]='';this['connectedlinename']='';this[_0xba53('0xd')]='';this['context']='';this[_0xba53('0xe')]='';this['priority']='';this[_0xba53('0xf')]=0x0;this['assigned']=![];this[_0xba53('0x10')]='';this['motionChannel']=_0xba53('0x11');this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 9c3e539..3c373dc 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 _0x1342=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x533b11,_0xa1cfc1){var _0x39ff40=function(_0x1c01bd){while(--_0x1c01bd){_0x533b11['push'](_0x533b11['shift']());}};_0x39ff40(++_0xa1cfc1);}(_0x1342,0xdf));var _0x2134=function(_0x490017,_0x6ecbe4){_0x490017=_0x490017-0x0;var _0x28c60a=_0x1342[_0x490017];return _0x28c60a;};'use strict';function SalesforceAccount(_0x5609d2){this['id']=_0x5609d2['id']||0x0;this[_0x2134('0x0')]=_0x5609d2[_0x2134('0x0')]||'';this[_0x2134('0x1')]=_0x5609d2[_0x2134('0x1')]||'';this[_0x2134('0x2')]=_0x5609d2[_0x2134('0x2')]||'';this['password']=_0x5609d2[_0x2134('0x3')]||'';this[_0x2134('0x4')]=_0x5609d2[_0x2134('0x4')]||'';this[_0x2134('0x5')]=_0x5609d2['clientSecret']||'';this[_0x2134('0x6')]=_0x5609d2['securityToken']||'';this[_0x2134('0x7')]=_0x5609d2['type']||_0x2134('0x8');this[_0x2134('0x9')]=_0x5609d2[_0x2134('0x9')]||'';this[_0x2134('0xa')]=_0x5609d2[_0x2134('0xa')]||{};}module[_0x2134('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x2c58=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0xc8c149,_0x104184){var _0x261259=function(_0x314df3){while(--_0x314df3){_0xc8c149['push'](_0xc8c149['shift']());}};_0x261259(++_0x104184);}(_0x2c58,0x8f));var _0x82c5=function(_0x22197d,_0x4f0e49){_0x22197d=_0x22197d-0x0;var _0xa9b0aa=_0x2c58[_0x22197d];return _0xa9b0aa;};'use strict';function SalesforceAccount(_0x164e29){this['id']=_0x164e29['id']||0x0;this[_0x82c5('0x0')]=_0x164e29[_0x82c5('0x0')]||'';this[_0x82c5('0x1')]=_0x164e29[_0x82c5('0x1')]||'';this['remoteUri']=_0x164e29[_0x82c5('0x2')]||'';this[_0x82c5('0x3')]=_0x164e29['password']||'';this[_0x82c5('0x4')]=_0x164e29[_0x82c5('0x4')]||'';this['clientSecret']=_0x164e29[_0x82c5('0x5')]||'';this[_0x82c5('0x6')]=_0x164e29[_0x82c5('0x6')]||'';this['type']=_0x164e29[_0x82c5('0x7')]||_0x82c5('0x8');this[_0x82c5('0x9')]=_0x164e29[_0x82c5('0x9')]||'';this[_0x82c5('0xa')]=_0x164e29[_0x82c5('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 392b2c1..2e8ded4 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 _0xfbe9=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x16e591,_0x4e611e){var _0x48413a=function(_0x200a60){while(--_0x200a60){_0x16e591['push'](_0x16e591['shift']());}};_0x48413a(++_0x4e611e);}(_0xfbe9,0xd1));var _0x9fbe=function(_0x34e725,_0x5633f8){_0x34e725=_0x34e725-0x0;var _0x57acc4=_0xfbe9[_0x34e725];return _0x57acc4;};'use strict';function ServicenowAccount(_0x386640){this['id']=_0x386640['id']||0x0;this[_0x9fbe('0x0')]=_0x386640[_0x9fbe('0x0')]||'';this['username']=_0x386640[_0x9fbe('0x1')]||'';this[_0x9fbe('0x2')]=_0x386640[_0x9fbe('0x2')]||'';this[_0x9fbe('0x3')]=_0x386640[_0x9fbe('0x3')]||'';this['serverUrl']=_0x386640[_0x9fbe('0x4')]||'';this[_0x9fbe('0x5')]=_0x386640[_0x9fbe('0x5')]||{};}module[_0x9fbe('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x331c=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x331c,0x17a));var _0xc331=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x331c[_0x4154a6];return _0x3b2786;};'use strict';function ServicenowAccount(_0x3e3631){this['id']=_0x3e3631['id']||0x0;this[_0xc331('0x0')]=_0x3e3631[_0xc331('0x0')]||'';this[_0xc331('0x1')]=_0x3e3631['username']||'';this[_0xc331('0x2')]=_0x3e3631[_0xc331('0x2')]||'';this[_0xc331('0x3')]=_0x3e3631[_0xc331('0x3')]||'';this[_0xc331('0x4')]=_0x3e3631['serverUrl']||'';this[_0xc331('0x5')]=_0x3e3631['Configurations']||{};}module[_0xc331('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 89ff974..d2a8ac2 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 _0x95be=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95be,0xd1));var _0xe95b=function(_0x1bb56d,_0x1b4031){_0x1bb56d=_0x1bb56d-0x0;var _0x4e449f=_0x95be[_0x1bb56d];return _0x4e449f;};'use strict';function SugarcrmAccount(_0x2c8d54){this['id']=_0x2c8d54['id']||0x0;this[_0xe95b('0x0')]=_0x2c8d54[_0xe95b('0x0')]||'';this[_0xe95b('0x1')]=_0x2c8d54[_0xe95b('0x1')]||'';this['password']=_0x2c8d54[_0xe95b('0x2')]||'';this[_0xe95b('0x3')]=_0x2c8d54[_0xe95b('0x3')]||'';this[_0xe95b('0x4')]=_0x2c8d54[_0xe95b('0x4')]||'';this[_0xe95b('0x5')]=_0x2c8d54['Configurations']||{};}module[_0xe95b('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xa9a7=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x28d08b,_0x851ae5){var _0x2f3a6c=function(_0x5398a0){while(--_0x5398a0){_0x28d08b['push'](_0x28d08b['shift']());}};_0x2f3a6c(++_0x851ae5);}(_0xa9a7,0xbd));var _0x7a9a=function(_0x214e50,_0x5c5bb3){_0x214e50=_0x214e50-0x0;var _0x21fe9e=_0xa9a7[_0x214e50];return _0x21fe9e;};'use strict';function SugarcrmAccount(_0x1ad6dd){this['id']=_0x1ad6dd['id']||0x0;this['name']=_0x1ad6dd[_0x7a9a('0x0')]||'';this[_0x7a9a('0x1')]=_0x1ad6dd[_0x7a9a('0x1')]||'';this[_0x7a9a('0x2')]=_0x1ad6dd[_0x7a9a('0x2')]||'';this[_0x7a9a('0x3')]=_0x1ad6dd[_0x7a9a('0x3')]||'';this['serverUrl']=_0x1ad6dd[_0x7a9a('0x4')]||'';this[_0x7a9a('0x5')]=_0x1ad6dd[_0x7a9a('0x5')]||{};}module[_0x7a9a('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 0632873..536c5b7 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 _0x392f=['name','accountcode','state','unknown','stateTime','status','exports'];(function(_0x4bf6ed,_0x383c18){var _0x11b8f5=function(_0x37f3bb){while(--_0x37f3bb){_0x4bf6ed['push'](_0x4bf6ed['shift']());}};_0x11b8f5(++_0x383c18);}(_0x392f,0x13b));var _0xf392=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0x392f[_0x151553];return _0x1a0ad6;};'use strict';function Telephone(_0x5a5572){this['id']=_0x5a5572['id']||0x0;this[_0xf392('0x0')]=_0x5a5572['name']||'';this[_0xf392('0x1')]=_0x5a5572[_0xf392('0x1')]||'';this[_0xf392('0x2')]=_0xf392('0x3');this[_0xf392('0x4')]=0x0;this[_0xf392('0x5')]='unknown';this['address']='';}module[_0xf392('0x6')]=Telephone; \ No newline at end of file +var _0x3979=['name','accountcode','state','unknown','status','address'];(function(_0x2f734b,_0x4ef1d1){var _0x3bc393=function(_0x42d8b2){while(--_0x42d8b2){_0x2f734b['push'](_0x2f734b['shift']());}};_0x3bc393(++_0x4ef1d1);}(_0x3979,0x114));var _0x9397=function(_0x25ad2c,_0x4199c5){_0x25ad2c=_0x25ad2c-0x0;var _0x335b67=_0x3979[_0x25ad2c];return _0x335b67;};'use strict';function Telephone(_0x31db47){this['id']=_0x31db47['id']||0x0;this[_0x9397('0x0')]=_0x31db47[_0x9397('0x0')]||'';this[_0x9397('0x1')]=_0x31db47[_0x9397('0x1')]||'';this[_0x9397('0x2')]=_0x9397('0x3');this['stateTime']=0x0;this[_0x9397('0x4')]=_0x9397('0x3');this[_0x9397('0x5')]='';}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 28dc9bf..1dbf2f8 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(_0x2ca57e,_0x458960){var _0x9a4ae4=function(_0x23d146){while(--_0x23d146){_0x2ca57e['push'](_0x2ca57e['shift']());}};_0x9a4ae4(++_0x458960);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f6fd5,_0x399cb0){_0x1f6fd5=_0x1f6fd5-0x0;var _0x587d12=_0xb10b[_0x1f6fd5];return _0x587d12;};'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(_0x46d63b,_0xe289e5){var _0x544922=function(_0xdbe09a){while(--_0xdbe09a){_0x46d63b['push'](_0x46d63b['shift']());}};_0x544922(++_0xe289e5);}(_0xb10b,0x12a));var _0xbb10=function(_0x5488cc,_0x57b187){_0x5488cc=_0x5488cc-0x0;var _0xa8962e=_0xb10b[_0x5488cc];return _0xa8962e;};'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 33fc7fc..9bddc28 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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1a85,0x178));var _0x51a8=function(_0x735a49,_0x3da3fd){_0x735a49=_0x735a49-0x0;var _0xee7e9=_0x1a85[_0x735a49];return _0xee7e9;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4756a1,_0x3f8d1){_0x4756a1=_0x4756a1-0x0;var _0x177c4f=_0x5eb8[_0x4756a1];return _0x177c4f;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 8e9ce4d..4a7d5b2 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 _0x8327=['stateRegistry','registrationtime','address','defaultuser','active','name','unknown','stateTime','status','registry','host','port','domain','refresh'];(function(_0x31d141,_0xdf948f){var _0x4cfa67=function(_0x347cd4){while(--_0x347cd4){_0x31d141['push'](_0x31d141['shift']());}};_0x4cfa67(++_0xdf948f);}(_0x8327,0x170));var _0x7832=function(_0xc9a005,_0x557667){_0xc9a005=_0xc9a005-0x0;var _0x3acd20=_0x8327[_0xc9a005];return _0x3acd20;};'use strict';function Trunk(_0x91ac8c){this['id']=_0x91ac8c['id']||0x0;this['active']=_0x91ac8c[_0x7832('0x0')]||![];this[_0x7832('0x1')]=_0x91ac8c[_0x7832('0x1')]||'';this['state']=_0x7832('0x2');this[_0x7832('0x3')]=0x0;this[_0x7832('0x4')]=_0x7832('0x2');this[_0x7832('0x5')]=_0x91ac8c[_0x7832('0x5')]&&_0x91ac8c[_0x7832('0x5')]['indexOf'](':')?_0x91ac8c[_0x7832('0x5')]['split'](':')[0x0]:'';this[_0x7832('0x6')]='';this[_0x7832('0x7')]='';this[_0x7832('0x8')]='';this['domainport']='';this[_0x7832('0x9')]='';this[_0x7832('0xa')]='unknown';this[_0x7832('0xb')]='';this[_0x7832('0xc')]='';this[_0x7832('0xd')]=_0x91ac8c[_0x7832('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0xe561=['exports','active','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0xe561,0x157));var _0x1e56=function(_0x2814c2,_0x50eff0){_0x2814c2=_0x2814c2-0x0;var _0x557619=_0xe561[_0x2814c2];return _0x557619;};'use strict';function Trunk(_0x516f15){this['id']=_0x516f15['id']||0x0;this[_0x1e56('0x0')]=_0x516f15[_0x1e56('0x0')]||![];this['name']=_0x516f15['name']||'';this[_0x1e56('0x1')]=_0x1e56('0x2');this[_0x1e56('0x3')]=0x0;this[_0x1e56('0x4')]=_0x1e56('0x2');this[_0x1e56('0x5')]=_0x516f15[_0x1e56('0x5')]&&_0x516f15[_0x1e56('0x5')][_0x1e56('0x6')](':')?_0x516f15[_0x1e56('0x5')][_0x1e56('0x7')](':')[0x0]:'';this[_0x1e56('0x8')]='';this[_0x1e56('0x9')]='';this[_0x1e56('0xa')]='';this[_0x1e56('0xb')]='';this[_0x1e56('0xc')]='';this[_0x1e56('0xd')]='unknown';this[_0x1e56('0xe')]='';this[_0x1e56('0xf')]='';this[_0x1e56('0x10')]=_0x516f15[_0x1e56('0x10')]||'';}module[_0x1e56('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index e6c3a15..a36c2d0 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 _0x9641=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x52ae40,_0x23c2bf){var _0xab6ed1=function(_0x36d880){while(--_0x36d880){_0x52ae40['push'](_0x52ae40['shift']());}};_0xab6ed1(++_0x23c2bf);}(_0x9641,0x65));var _0x1964=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x9641[_0x25b24a];return _0x224e68;};'use strict';function voiceExtension(_0x63141){this['id']=_0x63141['id']||0x0;this[_0x1964('0x0')]=_0x63141['exten']||'';this[_0x1964('0x1')]=_0x63141['recordingFormat']||_0x1964('0x2');this[_0x1964('0x3')]=_0x63141[_0x1964('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xd2f0=['recordingFormat','none','mandatoryDisposition','exports'];(function(_0x2956b6,_0x2b9fa5){var _0x4b1726=function(_0x48d45f){while(--_0x48d45f){_0x2956b6['push'](_0x2956b6['shift']());}};_0x4b1726(++_0x2b9fa5);}(_0xd2f0,0x70));var _0x0d2f=function(_0x12b5e3,_0x5097f8){_0x12b5e3=_0x12b5e3-0x0;var _0x28f1d3=_0xd2f0[_0x12b5e3];return _0x28f1d3;};'use strict';function voiceExtension(_0x35d5e9){this['id']=_0x35d5e9['id']||0x0;this['exten']=_0x35d5e9['exten']||'';this[_0x0d2f('0x0')]=_0x35d5e9[_0x0d2f('0x0')]||_0x0d2f('0x1');this[_0x0d2f('0x2')]=_0x35d5e9['mandatoryDisposition']||![];}module[_0x0d2f('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 1e211d1..5a55bcb 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 _0x04b1=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav49','rrmemory','roundrobin','name','inbound','talking','total','answered','sumDuration','sumBillable','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04b1,0x130));var _0x104b=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x04b1[_0x4c8a8f];return _0x404500;};'use strict';var statusDesc=[_0x104b('0x0'),'not_inuse',_0x104b('0x1'),_0x104b('0x2'),_0x104b('0x3'),_0x104b('0x4'),_0x104b('0x5'),_0x104b('0x6'),_0x104b('0x7')];var monitorFormat={'wav':'wav','wav49':_0x104b('0x8'),'gsm':'gsm'};var strategy={'rrmemory':_0x104b('0x9'),'roundrobin':_0x104b('0xa')};function VoiceQueue(_0x144551){this['id']=_0x144551['id']||0x0;this['name']=_0x144551[_0x104b('0xb')]||'';this['monitor_format']=_0x144551['monitor_format']||'';this['type']=_0x144551['type']||_0x104b('0xc');this['waiting']=0x0;this[_0x104b('0xd')]=0x0;this[_0x104b('0xe')]=0x0;this[_0x104b('0xf')]=0x0;this[_0x104b('0x10')]=0x0;this['sumHoldTime']=0x0;this[_0x104b('0x11')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x104b('0x12')]=0x0;this['available']=0x0;this['acw']=_0x144551[_0x104b('0x13')]||![];this['acwTimeout']=_0x144551[_0x104b('0x14')]||0xa;this[_0x104b('0x15')]=_0x144551[_0x104b('0x15')]||'no';this[_0x104b('0x16')]=!![];this[_0x104b('0x17')]='';this[_0x104b('0x18')]=0x0;this[_0x104b('0x19')]=0x0;this[_0x104b('0x1a')]=_0x144551[_0x104b('0x1a')]||null;this['dialGlobalInterval']=_0x144551['dialGlobalInterval']?_0x144551['dialGlobalInterval']:null;this[_0x104b('0x1b')]=_0x144551[_0x104b('0x1b')];this[_0x104b('0x1c')]=_0x144551[_0x104b('0x1c')]||_0x104b('0x1d');this[_0x104b('0x1e')]=_0x144551[_0x104b('0x1e')]||0x0;this[_0x104b('0x1f')]=_0x144551[_0x104b('0x1f')]||0x0;this['dialPowerLevel']=_0x144551[_0x104b('0x20')]||0x1;this[_0x104b('0x21')]=_0x144551[_0x104b('0x21')]||_0x104b('0x22');this[_0x104b('0x23')]=_0x144551[_0x104b('0x23')]||0.03;this[_0x104b('0x24')]=_0x144551['dialPredictiveInterval']||0x258;this[_0x104b('0x25')]=_0x144551[_0x104b('0x25')]||_0x104b('0x26');this['dialOriginateCallerIdNumber']=_0x144551[_0x104b('0x27')]||'anonymous';this[_0x104b('0x28')]=_0x144551[_0x104b('0x28')]||0x1e;this['dialQueueOptions']=_0x144551['dialQueueOptions']||'tTxX';this['dialQueueTimeout']=_0x144551['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x144551[_0x104b('0x29')]||undefined;this['dialCongestionMaxRetry']=_0x144551['dialCongestionMaxRetry']||0x3;this[_0x104b('0x2a')]=_0x144551[_0x104b('0x2a')]||0x96;this['dialBusyMaxRetry']=_0x144551['dialBusyMaxRetry']||0x3;this[_0x104b('0x2b')]=_0x144551[_0x104b('0x2b')]||0x96;this['dialNoAnswerMaxRetry']=_0x144551[_0x104b('0x2c')]||0x3;this['dialNoAnswerRetryFrequency']=_0x144551[_0x104b('0x2d')]||0x96;this[_0x104b('0x2e')]=_0x144551['dialNoSuchNumberMaxRetry']||0x3;this[_0x104b('0x2f')]=_0x144551['dialNoSuchNumberRetryFrequency']||0x96;this[_0x104b('0x30')]=_0x144551['dialDropMaxRetry']||0x3;this[_0x104b('0x31')]=_0x144551[_0x104b('0x31')]||0x96;this[_0x104b('0x32')]=_0x144551[_0x104b('0x32')]||0x3;this[_0x104b('0x33')]=_0x144551[_0x104b('0x33')]||0x96;this[_0x104b('0x34')]=_0x144551[_0x104b('0x34')]||0x3;this['dialMachineRetryFrequency']=_0x144551['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x144551[_0x104b('0x35')]||0x3;this[_0x104b('0x36')]=_0x144551['dialAgentRejectRetryFrequency']||0x96;this[_0x104b('0x37')]=_0x144551['callAdditionalPhoneAfterMin']||0x3;this[_0x104b('0x38')]=_0x144551['dialGlobalMaxRetry']||0x4;this[_0x104b('0x39')]=_0x144551['Trunk']?_0x144551[_0x104b('0x39')]:undefined;this['TrunkBackup']=_0x144551[_0x104b('0x3a')]?_0x144551[_0x104b('0x3a')]:undefined;this[_0x104b('0x3b')]=_0x144551['dialPrefix']||undefined;this[_0x104b('0x3c')]=_0x144551[_0x104b('0x3c')]?_0x144551['Interval']:undefined;this[_0x104b('0x3d')]=_0x144551[_0x104b('0x3d')]||_0x104b('0x3e');this['dialRandomLastDigitCallerIdNumber']=_0x144551['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x104b('0x3f')]=_0x144551[_0x104b('0x3f')]||undefined;this[_0x104b('0x40')]=strategy[_0x144551['strategy']]||_0x104b('0x9');this[_0x104b('0x41')]=!![];this[_0x104b('0x42')]=_0x144551[_0x104b('0x42')]||![];this[_0x104b('0x43')]=_0x144551[_0x104b('0x43')];this['dialAMDGreeting']=_0x144551[_0x104b('0x44')];this['dialAMDAfterGreetingSilence']=_0x144551[_0x104b('0x45')];this[_0x104b('0x46')]=_0x144551[_0x104b('0x46')];this[_0x104b('0x47')]=_0x144551[_0x104b('0x47')];this['dialAMDBetweenWordsSilence']=_0x144551[_0x104b('0x48')];this['dialAMDMaximumNumberOfWords']=_0x144551[_0x104b('0x49')];this[_0x104b('0x4a')]=_0x144551['dialAMDSilenceThreshold'];this[_0x104b('0x4b')]=_0x144551[_0x104b('0x4b')];this['outboundRejectCallsDay']=0x0;this[_0x104b('0x4c')]=0x0;this[_0x104b('0x4d')]=_0x144551[_0x104b('0x4d')];this[_0x104b('0x4e')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x104b('0x4f')]=0x0;this[_0x104b('0x50')]=0x0;this[_0x104b('0x51')]=0x0;this[_0x104b('0x52')]=0x0;this[_0x104b('0x53')]=0x0;this[_0x104b('0x54')]=0x0;this[_0x104b('0x55')]=0x0;this[_0x104b('0x56')]=0x0;this[_0x104b('0x57')]=0x0;this[_0x104b('0x58')]=undefined;this[_0x104b('0x59')]=undefined;this[_0x104b('0x5a')]=undefined;this[_0x104b('0x5b')]=1.05;this[_0x104b('0x5c')]=0x0;this[_0x104b('0x5d')]=0x0;this[_0x104b('0x5e')]=0x0;this[_0x104b('0x5f')]=0x0;this[_0x104b('0x60')]=0x0;this[_0x104b('0x61')]=0x0;this[_0x104b('0x62')]=0x0;this[_0x104b('0x63')]=0x0;this[_0x104b('0x64')]=_0x144551[_0x104b('0x65')]||0x14;this[_0x104b('0x66')]=_0x144551[_0x104b('0x65')]||0xa;this[_0x104b('0x67')]=0x0;this[_0x104b('0x68')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0x104b('0x69')]=0x0;this[_0x104b('0x6a')]=0x0;this[_0x104b('0x6b')]=0x0;this[_0x104b('0x6c')]=_0x144551[_0x104b('0x6c')]||0x1e;this[_0x104b('0x6d')]=_0x144551[_0x104b('0x6d')]||![];this['dialPreviewAutoRecallMe']=!!_0x144551[_0x104b('0x6e')]||![];this['dialPreviewRecallmeReminder']=!!_0x144551['dialPreviewRecallmeReminder']||![];this[_0x104b('0x6f')]=_0x144551[_0x104b('0x6f')]||undefined;this[_0x104b('0x70')]=_0x144551[_0x104b('0x70')]||![];this['dialAgiAfterHangupAgent']=_0x144551['dialAgiAfterHangupAgent']||![];this[_0x104b('0x71')]=monitorFormat[_0x144551[_0x104b('0x71')]]?monitorFormat[_0x144551[_0x104b('0x71')]]:undefined;this[_0x104b('0x72')]=_0x144551[_0x104b('0x72')]||![];this[_0x104b('0x73')]=_0x144551[_0x104b('0x73')]?_0x144551[_0x104b('0x73')]:undefined;}module[_0x104b('0x74')]=VoiceQueue; \ No newline at end of file +var _0x8de9=['predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','type','waiting','talking','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialGlobalInterval','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive'];(function(_0x51def2,_0x40f3a6){var _0x57fad3=function(_0x4564db){while(--_0x4564db){_0x51def2['push'](_0x51def2['shift']());}};_0x57fad3(++_0x40f3a6);}(_0x8de9,0x10a));var _0x98de=function(_0x59ef5e,_0x34be25){_0x59ef5e=_0x59ef5e-0x0;var _0xe7004d=_0x8de9[_0x59ef5e];return _0xe7004d;};'use strict';var statusDesc=[_0x98de('0x0'),_0x98de('0x1'),_0x98de('0x2'),_0x98de('0x3'),'invalid','unavailable','ringing',_0x98de('0x4'),'onhold'];var monitorFormat={'wav':_0x98de('0x5'),'wav49':_0x98de('0x6'),'gsm':_0x98de('0x7')};var strategy={'rrmemory':_0x98de('0x8'),'roundrobin':_0x98de('0x9')};function VoiceQueue(_0x30d73b){this['id']=_0x30d73b['id']||0x0;this[_0x98de('0xa')]=_0x30d73b[_0x98de('0xa')]||'';this['monitor_format']=_0x30d73b['monitor_format']||'';this[_0x98de('0xb')]=_0x30d73b[_0x98de('0xb')]||'inbound';this[_0x98de('0xc')]=0x0;this[_0x98de('0xd')]=0x0;this['total']=0x0;this[_0x98de('0xe')]=0x0;this['sumDuration']=0x0;this[_0x98de('0xf')]=0x0;this[_0x98de('0x10')]=0x0;this[_0x98de('0x11')]=0x0;this[_0x98de('0x12')]=0x0;this[_0x98de('0x13')]=0x0;this[_0x98de('0x14')]=0x0;this[_0x98de('0x15')]=_0x30d73b[_0x98de('0x15')]||![];this[_0x98de('0x16')]=_0x30d73b['acwTimeout']||0xa;this[_0x98de('0x17')]=_0x30d73b[_0x98de('0x17')]||'no';this[_0x98de('0x18')]=!![];this[_0x98de('0x19')]='';this[_0x98de('0x1a')]=0x0;this[_0x98de('0x1b')]=0x0;this['dialTimezone']=_0x30d73b['dialTimezone']||null;this['dialGlobalInterval']=_0x30d73b[_0x98de('0x1c')]?_0x30d73b['dialGlobalInterval']:null;this['dialActive']=_0x30d73b['dialActive'];this[_0x98de('0x1d')]=_0x30d73b['dialMethod']||'progressive';this[_0x98de('0x1e')]=_0x30d73b[_0x98de('0x1e')]||0x0;this[_0x98de('0x1f')]=_0x30d73b[_0x98de('0x1f')]||0x0;this[_0x98de('0x20')]=_0x30d73b[_0x98de('0x20')]||0x1;this['dialPredictiveOptimization']=_0x30d73b['dialPredictiveOptimization']||_0x98de('0x21');this[_0x98de('0x22')]=_0x30d73b[_0x98de('0x22')]||0.03;this['dialPredictiveInterval']=_0x30d73b[_0x98de('0x23')]||0x258;this[_0x98de('0x24')]=_0x30d73b[_0x98de('0x24')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x30d73b[_0x98de('0x25')]||_0x98de('0x26');this[_0x98de('0x27')]=_0x30d73b[_0x98de('0x27')]||0x1e;this[_0x98de('0x28')]=_0x30d73b[_0x98de('0x28')]||_0x98de('0x29');this[_0x98de('0x2a')]=_0x30d73b[_0x98de('0x2a')]||0x3;this[_0x98de('0x2b')]=_0x30d73b['dialQueueProject']||undefined;this[_0x98de('0x2c')]=_0x30d73b[_0x98de('0x2c')]||0x3;this[_0x98de('0x2d')]=_0x30d73b['dialCongestionRetryFrequency']||0x96;this[_0x98de('0x2e')]=_0x30d73b[_0x98de('0x2e')]||0x3;this['dialBusyRetryFrequency']=_0x30d73b[_0x98de('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x30d73b[_0x98de('0x30')]||0x3;this[_0x98de('0x31')]=_0x30d73b[_0x98de('0x31')]||0x96;this[_0x98de('0x32')]=_0x30d73b['dialNoSuchNumberMaxRetry']||0x3;this[_0x98de('0x33')]=_0x30d73b['dialNoSuchNumberRetryFrequency']||0x96;this[_0x98de('0x34')]=_0x30d73b[_0x98de('0x34')]||0x3;this[_0x98de('0x35')]=_0x30d73b[_0x98de('0x35')]||0x96;this[_0x98de('0x36')]=_0x30d73b['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x30d73b[_0x98de('0x37')]||0x96;this[_0x98de('0x38')]=_0x30d73b[_0x98de('0x38')]||0x3;this[_0x98de('0x39')]=_0x30d73b['dialMachineRetryFrequency']||0x96;this[_0x98de('0x3a')]=_0x30d73b[_0x98de('0x3a')]||0x3;this[_0x98de('0x3b')]=_0x30d73b[_0x98de('0x3b')]||0x96;this[_0x98de('0x3c')]=_0x30d73b['callAdditionalPhoneAfterMin']||0x3;this[_0x98de('0x3d')]=_0x30d73b[_0x98de('0x3d')]||0x4;this['Trunk']=_0x30d73b[_0x98de('0x3e')]?_0x30d73b[_0x98de('0x3e')]:undefined;this[_0x98de('0x3f')]=_0x30d73b['TrunkBackup']?_0x30d73b[_0x98de('0x3f')]:undefined;this[_0x98de('0x40')]=_0x30d73b[_0x98de('0x40')]||undefined;this[_0x98de('0x41')]=_0x30d73b[_0x98de('0x41')]?_0x30d73b[_0x98de('0x41')]:undefined;this[_0x98de('0x42')]=_0x30d73b['dialOrderByScheduledAt']||_0x98de('0x43');this[_0x98de('0x44')]=_0x30d73b[_0x98de('0x44')]||undefined;this[_0x98de('0x45')]=_0x30d73b[_0x98de('0x45')]||undefined;this['strategy']=strategy[_0x30d73b[_0x98de('0x46')]]||_0x98de('0x8');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x30d73b[_0x98de('0x47')]||![];this[_0x98de('0x48')]=_0x30d73b['dialAMDInitialSilence'];this[_0x98de('0x49')]=_0x30d73b['dialAMDGreeting'];this[_0x98de('0x4a')]=_0x30d73b[_0x98de('0x4a')];this[_0x98de('0x4b')]=_0x30d73b['dialAMDTotalAnalysisTime'];this[_0x98de('0x4c')]=_0x30d73b['dialAMDMinWordLength'];this[_0x98de('0x4d')]=_0x30d73b[_0x98de('0x4d')];this['dialAMDMaximumNumberOfWords']=_0x30d73b['dialAMDMaximumNumberOfWords'];this[_0x98de('0x4e')]=_0x30d73b[_0x98de('0x4e')];this[_0x98de('0x4f')]=_0x30d73b[_0x98de('0x4f')];this['outboundRejectCallsDay']=0x0;this[_0x98de('0x50')]=0x0;this[_0x98de('0x51')]=_0x30d73b['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x98de('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x98de('0x53')]=0x0;this[_0x98de('0x54')]=0x0;this[_0x98de('0x55')]=0x0;this[_0x98de('0x56')]=0x0;this[_0x98de('0x57')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x98de('0x58')]=0x0;this[_0x98de('0x59')]=0x0;this[_0x98de('0x5a')]=0x0;this[_0x98de('0x5b')]=0x0;this[_0x98de('0x5c')]=undefined;this['startPredictive']=undefined;this[_0x98de('0x5d')]=undefined;this[_0x98de('0x5e')]=1.05;this[_0x98de('0x5f')]=0x0;this[_0x98de('0x60')]=0x0;this[_0x98de('0x61')]=0x0;this[_0x98de('0x62')]=0x0;this[_0x98de('0x63')]=0x0;this[_0x98de('0x64')]=0x0;this[_0x98de('0x65')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x98de('0x66')]=_0x30d73b['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x98de('0x67')]=_0x30d73b[_0x98de('0x68')]||0xa;this[_0x98de('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x98de('0x6a')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x98de('0x6b')]=0x0;this[_0x98de('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x30d73b[_0x98de('0x6d')]||0x1e;this[_0x98de('0x6e')]=_0x30d73b[_0x98de('0x6e')]||![];this[_0x98de('0x6f')]=!!_0x30d73b[_0x98de('0x6f')]||![];this['dialPreviewRecallmeReminder']=!!_0x30d73b[_0x98de('0x70')]||![];this[_0x98de('0x71')]=_0x30d73b[_0x98de('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x30d73b[_0x98de('0x72')]||![];this[_0x98de('0x73')]=_0x30d73b[_0x98de('0x73')]||![];this[_0x98de('0x74')]=monitorFormat[_0x30d73b['monitor_format']]?monitorFormat[_0x30d73b['monitor_format']]:undefined;this[_0x98de('0x75')]=_0x30d73b[_0x98de('0x75')]||![];this['mandatoryDispositionPause']=_0x30d73b[_0x98de('0x76')]?_0x30d73b[_0x98de('0x76')]:undefined;}module[_0x98de('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index e4f6c9e..0d60e6b 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 _0x5d81=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x1d6489,_0x44957b){var _0x1beb2d=function(_0x30d780){while(--_0x30d780){_0x1d6489['push'](_0x1d6489['shift']());}};_0x1beb2d(++_0x44957b);}(_0x5d81,0x1c0));var _0x15d8=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x5d81[_0x2341c6];return _0x54c34d;};'use strict';function VtigerAccount(_0x12cffb){this['id']=_0x12cffb['id']||0x0;this[_0x15d8('0x0')]=_0x12cffb[_0x15d8('0x0')]||'';this['username']=_0x12cffb[_0x15d8('0x1')]||'';this[_0x15d8('0x2')]=_0x12cffb[_0x15d8('0x2')]||'';this['remoteUri']=_0x12cffb[_0x15d8('0x3')]||'';this['serverUrl']=_0x12cffb[_0x15d8('0x4')]||'';this[_0x15d8('0x5')]=_0x12cffb[_0x15d8('0x5')]||{};}module[_0x15d8('0x6')]=VtigerAccount; \ No newline at end of file +var _0x1357=['accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2489ae,_0xa876e4){var _0x2b58d1=function(_0x4385bc){while(--_0x4385bc){_0x2489ae['push'](_0x2489ae['shift']());}};_0x2b58d1(++_0xa876e4);}(_0x1357,0x71));var _0x7135=function(_0x29d7b1,_0x1274e9){_0x29d7b1=_0x29d7b1-0x0;var _0x1a5699=_0x1357[_0x29d7b1];return _0x1a5699;};'use strict';function VtigerAccount(_0xe27c4e){this['id']=_0xe27c4e['id']||0x0;this[_0x7135('0x0')]=_0xe27c4e[_0x7135('0x0')]||'';this['username']=_0xe27c4e['username']||'';this['accessKey']=_0xe27c4e[_0x7135('0x1')]||'';this[_0x7135('0x2')]=_0xe27c4e['remoteUri']||'';this[_0x7135('0x3')]=_0xe27c4e[_0x7135('0x3')]||'';this[_0x7135('0x4')]=_0xe27c4e[_0x7135('0x4')]||{};}module[_0x7135('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 0ddd1bf..326f2aa 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 _0xecc4=['Configurations','exports','name','username','password','token','remoteUri','authType','type','serverUrl'];(function(_0x261bb5,_0x40db34){var _0x38226d=function(_0x44a555){while(--_0x44a555){_0x261bb5['push'](_0x261bb5['shift']());}};_0x38226d(++_0x40db34);}(_0xecc4,0x11a));var _0x4ecc=function(_0x424a26,_0x125957){_0x424a26=_0x424a26-0x0;var _0x20cc43=_0xecc4[_0x424a26];return _0x20cc43;};'use strict';function ZendeskAccount(_0x3a4045){this['id']=_0x3a4045['id']||0x0;this[_0x4ecc('0x0')]=_0x3a4045[_0x4ecc('0x0')]||'';this[_0x4ecc('0x1')]=_0x3a4045[_0x4ecc('0x1')]||'';this[_0x4ecc('0x2')]=_0x3a4045[_0x4ecc('0x2')]||'';this[_0x4ecc('0x3')]=_0x3a4045[_0x4ecc('0x3')]||'';this[_0x4ecc('0x4')]=_0x3a4045[_0x4ecc('0x4')]||'';this[_0x4ecc('0x5')]=_0x3a4045[_0x4ecc('0x5')]||'';this[_0x4ecc('0x6')]=_0x3a4045[_0x4ecc('0x6')]||'integrationTab';this[_0x4ecc('0x7')]=_0x3a4045[_0x4ecc('0x7')]||'';this[_0x4ecc('0x8')]=_0x3a4045[_0x4ecc('0x8')]||{};}module[_0x4ecc('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xf54e=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf54e,0x101));var _0xef54=function(_0x381d3c,_0x4bc7d0){_0x381d3c=_0x381d3c-0x0;var _0x12542e=_0xf54e[_0x381d3c];return _0x12542e;};'use strict';function ZendeskAccount(_0x23efc6){this['id']=_0x23efc6['id']||0x0;this[_0xef54('0x0')]=_0x23efc6['name']||'';this['username']=_0x23efc6[_0xef54('0x1')]||'';this['password']=_0x23efc6[_0xef54('0x2')]||'';this[_0xef54('0x3')]=_0x23efc6['token']||'';this['remoteUri']=_0x23efc6[_0xef54('0x4')]||'';this[_0xef54('0x5')]=_0x23efc6[_0xef54('0x5')]||'';this[_0xef54('0x6')]=_0x23efc6[_0xef54('0x6')]||_0xef54('0x7');this['serverUrl']=_0x23efc6[_0xef54('0x8')]||'';this[_0xef54('0x9')]=_0x23efc6[_0xef54('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 2d175a1..fc68848 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 _0x2e18=['code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0xea7aff,_0x20dd0b){var _0x270a3a=function(_0x3bcc9c){while(--_0x3bcc9c){_0xea7aff['push'](_0xea7aff['shift']());}};_0x270a3a(++_0x20dd0b);}(_0x2e18,0xd5));var _0x82e1=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x2e18[_0x1b6186];return _0x186121;};'use strict';function ZohoAccount(_0x74efa5){this['id']=_0x74efa5['id']||0x0;this[_0x82e1('0x0')]=_0x74efa5['name']||'';this[_0x82e1('0x1')]=_0x74efa5[_0x82e1('0x1')]||'';this[_0x82e1('0x2')]=_0x74efa5['host']||'';this[_0x82e1('0x3')]=_0x74efa5['zone']||'';this[_0x82e1('0x4')]=_0x74efa5[_0x82e1('0x4')]||'';this[_0x82e1('0x5')]=_0x74efa5[_0x82e1('0x5')]||'';this[_0x82e1('0x6')]=_0x74efa5[_0x82e1('0x6')]||'';this[_0x82e1('0x7')]=_0x74efa5['code']||'';this[_0x82e1('0x8')]=_0x74efa5[_0x82e1('0x8')]||'';this[_0x82e1('0x9')]=_0x74efa5[_0x82e1('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x3be5=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3be5,0x82));var _0x53be=function(_0x1f38fc,_0x44b94f){_0x1f38fc=_0x1f38fc-0x0;var _0x5d1660=_0x3be5[_0x1f38fc];return _0x5d1660;};'use strict';function ZohoAccount(_0x4e6684){this['id']=_0x4e6684['id']||0x0;this[_0x53be('0x0')]=_0x4e6684['name']||'';this['description']=_0x4e6684[_0x53be('0x1')]||'';this[_0x53be('0x2')]=_0x4e6684[_0x53be('0x2')]||'';this[_0x53be('0x3')]=_0x4e6684[_0x53be('0x3')]||'';this['clientId']=_0x4e6684[_0x53be('0x4')]||'';this['clientSecret']=_0x4e6684[_0x53be('0x5')]||'';this['serverUrl']=_0x4e6684[_0x53be('0x6')]||'';this[_0x53be('0x7')]=_0x4e6684[_0x53be('0x7')]||'';this[_0x53be('0x8')]=_0x4e6684[_0x53be('0x8')]||'';this[_0x53be('0x9')]=_0x4e6684[_0x53be('0x9')]||{};}module[_0x53be('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index dd91040..f71a765 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 _0x4325=['type','membername','Agent','format','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','util','lodash','string','isNil','idContact','queue','name'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0x4325,0x1da));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x5432('0x0'));var _=require(_0x5432('0x1'));var moment=require('moment');function checkNameSurname(_0x3f491f,_0x533c92,_0x12c8d8){var _0x480fb7='';if(!_['isNil'](_0x533c92)&&_0x5432('0x2')===typeof _0x533c92){_0x480fb7+=_0x533c92;}if(!_[_0x5432('0x3')](_0x12c8d8)&&_0x5432('0x2')===typeof _0x12c8d8){_0x480fb7+='\x20'+_0x12c8d8;}if(_0x480fb7!==''){return _0x480fb7;}return _0x3f491f;}function Action(_0x4acbe4,_0x209e2e,_0xbb0075,_0x4a6e76,_0x106ec9){this['uniqueid']=_0xbb0075||undefined;this[_0x5432('0x4')]=_0x4acbe4['id'];this[_0x5432('0x5')]=_0x209e2e[_0x5432('0x6')];this[_0x5432('0x7')]=_0x209e2e[_0x5432('0x7')];this['campaigntype']=_0x5432('0x5');this['dialAnswer']=![];this[_0x5432('0x8')]=_[_0x5432('0x3')](_0x4acbe4[_0x5432('0x9')])?undefined:_0x4acbe4[_0x5432('0x9')]['name'];this['channelAgent']=this[_0x5432('0x8')]?util[_0x5432('0xa')]('SIP/%s',this[_0x5432('0x8')]):_0x4a6e76||undefined;this[_0x5432('0xb')]=checkNameSurname(_0x4acbe4[_0x5432('0xc')][_0x5432('0xd')],_0x4acbe4[_0x5432('0xc')][_0x5432('0xe')],_0x4acbe4['Contact']['lastName']);this[_0x5432('0xf')]=_0x4acbe4[_0x5432('0xf')]||![];this[_0x5432('0x10')]=_0x4acbe4[_0x5432('0xd')];this[_0x5432('0x11')]=_0x4acbe4[_0x5432('0x11')];this['countbusyretry']=_0x4acbe4[_0x5432('0x12')]||0x0;this['countcongestionretry']=_0x4acbe4[_0x5432('0x13')]||0x0;this[_0x5432('0x14')]=_0x4acbe4[_0x5432('0x14')]||0x0;this[_0x5432('0x15')]=(_0x4acbe4[_0x5432('0x12')]||0x0)+(_0x4acbe4['countcongestionretry']||0x0)+(_0x4acbe4[_0x5432('0x14')]||0x0)+(_0x4acbe4[_0x5432('0x16')]||0x0)+(_0x4acbe4[_0x5432('0x17')]||0x0)+(_0x4acbe4[_0x5432('0x18')]||0x0)+(_0x4acbe4[_0x5432('0x19')]||0x0)+(_0x4acbe4[_0x5432('0x1a')]||0x0);this[_0x5432('0x16')]=_0x4acbe4['countnosuchnumberretry']||0x0;this[_0x5432('0x17')]=_0x4acbe4[_0x5432('0x17')]||0x0;this[_0x5432('0x18')]=_0x4acbe4[_0x5432('0x18')]||0x0;this[_0x5432('0x19')]=_0x4acbe4['countmachineretry']||0x0;this['countagentrejectretry']=_0x4acbe4['countagentrejectretry']||0x0;this[_0x5432('0x1b')]=_0x4acbe4[_0x5432('0x1b')];this[_0x5432('0x1c')]=_0x4acbe4[_0x5432('0x1c')];this['callbackat']=_0x4acbe4['callbackat'];this[_0x5432('0x1d')]=_0x4acbe4[_0x5432('0x1d')];this['ContactId']=_0x4acbe4[_0x5432('0x1e')];this[_0x5432('0x1f')]=_0x4acbe4[_0x5432('0x1f')];this['UserId']=_[_0x5432('0x3')](_0x4acbe4[_0x5432('0x9')])?_0x4acbe4[_0x5432('0x20')]:_0x4acbe4['Agent']['id'];this['VoiceQueueId']=_0x4acbe4[_0x5432('0x21')];this[_0x5432('0x22')]='';this['originatecalleridname']='';}Action[_0x5432('0x23')][_0x5432('0x24')]=function(){return util[_0x5432('0xa')]('\x22%s\x22\x20<%s>',this[_0x5432('0xb')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0xeb3b=['Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','calleridname','number','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','phone'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0xeb3b[_0x1d80be];return _0xf9a4f3;};'use strict';var util=require(_0xbeb3('0x0'));var _=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));function checkNameSurname(_0x33e049,_0xba125a,_0x565c41){var _0x5df0cb='';if(!_[_0xbeb3('0x3')](_0xba125a)&&'string'===typeof _0xba125a){_0x5df0cb+=_0xba125a;}if(!_[_0xbeb3('0x3')](_0x565c41)&&'string'===typeof _0x565c41){_0x5df0cb+='\x20'+_0x565c41;}if(_0x5df0cb!==''){return _0x5df0cb;}return _0x33e049;}function Action(_0x2e8a69,_0x5ae6f9,_0x8d8cce,_0x294cc9,_0x406927){this[_0xbeb3('0x4')]=_0x8d8cce||undefined;this['idContact']=_0x2e8a69['id'];this[_0xbeb3('0x5')]=_0x5ae6f9[_0xbeb3('0x6')];this[_0xbeb3('0x7')]=_0x5ae6f9[_0xbeb3('0x7')];this[_0xbeb3('0x8')]=_0xbeb3('0x5');this[_0xbeb3('0x9')]=![];this['membername']=_[_0xbeb3('0x3')](_0x2e8a69[_0xbeb3('0xa')])?undefined:_0x2e8a69['Agent'][_0xbeb3('0x6')];this[_0xbeb3('0xb')]=this[_0xbeb3('0xc')]?util[_0xbeb3('0xd')](_0xbeb3('0xe'),this[_0xbeb3('0xc')]):_0x294cc9||undefined;this['calleridname']=checkNameSurname(_0x2e8a69['Contact'][_0xbeb3('0xf')],_0x2e8a69[_0xbeb3('0x10')]['firstName'],_0x2e8a69['Contact'][_0xbeb3('0x11')]);this[_0xbeb3('0x12')]=_0x2e8a69[_0xbeb3('0x12')]||![];this[_0xbeb3('0x13')]=_0x2e8a69[_0xbeb3('0xf')];this['scheduledat']=_0x2e8a69[_0xbeb3('0x14')];this['countbusyretry']=_0x2e8a69[_0xbeb3('0x15')]||0x0;this['countcongestionretry']=_0x2e8a69['countcongestionretry']||0x0;this['countnoanswerretry']=_0x2e8a69[_0xbeb3('0x16')]||0x0;this[_0xbeb3('0x17')]=(_0x2e8a69[_0xbeb3('0x15')]||0x0)+(_0x2e8a69[_0xbeb3('0x18')]||0x0)+(_0x2e8a69['countnoanswerretry']||0x0)+(_0x2e8a69[_0xbeb3('0x19')]||0x0)+(_0x2e8a69[_0xbeb3('0x1a')]||0x0)+(_0x2e8a69[_0xbeb3('0x1b')]||0x0)+(_0x2e8a69['countmachineretry']||0x0)+(_0x2e8a69['countagentrejectretry']||0x0);this[_0xbeb3('0x19')]=_0x2e8a69['countnosuchnumberretry']||0x0;this[_0xbeb3('0x1a')]=_0x2e8a69['countdropretry']||0x0;this['countabandonedretry']=_0x2e8a69[_0xbeb3('0x1b')]||0x0;this[_0xbeb3('0x1c')]=_0x2e8a69[_0xbeb3('0x1c')]||0x0;this['countagentrejectretry']=_0x2e8a69[_0xbeb3('0x1d')]||0x0;this[_0xbeb3('0x1e')]=_0x2e8a69['callback'];this[_0xbeb3('0x1f')]=_0x2e8a69[_0xbeb3('0x1f')];this['callbackat']=_0x2e8a69[_0xbeb3('0x20')];this[_0xbeb3('0x21')]=_0x2e8a69[_0xbeb3('0x21')];this[_0xbeb3('0x22')]=_0x2e8a69[_0xbeb3('0x22')];this[_0xbeb3('0x23')]=_0x2e8a69[_0xbeb3('0x23')];this[_0xbeb3('0x24')]=_[_0xbeb3('0x3')](_0x2e8a69['Agent'])?_0x2e8a69['UserId']:_0x2e8a69[_0xbeb3('0xa')]['id'];this['VoiceQueueId']=_0x2e8a69[_0xbeb3('0x25')];this[_0xbeb3('0x26')]='';this[_0xbeb3('0x27')]='';}Action[_0xbeb3('0x28')]['getCaller']=function(){return util[_0xbeb3('0xd')]('\x22%s\x22\x20<%s>',this[_0xbeb3('0x29')],this[_0xbeb3('0x2a')]);};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 9e73670..0e0b1f4 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=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','SIP/%s','execRun','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','defaults','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require(_0x0a9e('0x9'));var Action=require(_0x0a9e('0xa'));var ut=require('./util/util');config['redis']=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xd')]));var Sequence=function(){};Sequence[_0x0a9e('0xe')][_0x0a9e('0xf')]=function(_0xfeb75b){this[_0x0a9e('0x10')]=this['tail']?this['tail']['finally'](_0xfeb75b):_0xfeb75b();};function Preview(_0x4cfe67){this[_0x0a9e('0x11')]=new Sequence();this[_0x0a9e('0x12')]=_0x4cfe67[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x4cfe67[_0x0a9e('0x14')];this[_0x0a9e('0x15')]={};this['agents']=_0x4cfe67[_0x0a9e('0x16')];this[_0x0a9e('0x17')]=0x0;ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x1b'),this['syncHangup'][_0x0a9e('0x1a')](this));ami['on']('hanguprequest',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')]['bind'](this));ami['on'](_0x0a9e('0x1f'),this['syncNewExten'][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x24'),this[_0x0a9e('0x25')][_0x0a9e('0x1a')](this));this[_0x0a9e('0x26')](this[_0x0a9e('0x12')]);}function emit(_0x4bb1e3,_0x2c3407,_0x155cce){io['to'](_0x4bb1e3)['emit'](_0x2c3407,_0x155cce);}function emitCampaignPreview(_0x20f109){if(_0x20f109['type']==='outbound'){var _0x3a02e1={'id':_0x20f109['id'],'name':_0x20f109[_0x0a9e('0x27')],'strategy':_0x20f109[_0x0a9e('0x28')],'answered':_0x20f109[_0x0a9e('0x29')],'available':_0x20f109['available'],'loggedIn':_0x20f109[_0x0a9e('0x2a')],'pTalking':_0x20f109[_0x0a9e('0x2b')],'sumBillable':_0x20f109[_0x0a9e('0x2c')],'sumDuration':_0x20f109[_0x0a9e('0x2d')],'sumHoldTime':_0x20f109[_0x0a9e('0x2e')]||0x0,'talking':_0x20f109[_0x0a9e('0x2f')],'total':_0x20f109[_0x0a9e('0x30')],'type':_0x20f109['type'],'unmanaged':_0x20f109['unmanaged'],'abandoned':_0x20f109[_0x0a9e('0x31')],'waiting':_0x20f109[_0x0a9e('0x32')],'loggedInDb':_0x20f109[_0x0a9e('0x33')],'dialActive':_0x20f109[_0x0a9e('0x34')],'dialMethod':_0x20f109['dialMethod'],'dialOriginateCallerIdName':_0x20f109[_0x0a9e('0x35')],'dialOriginateCallerIdNumber':_0x20f109['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f109[_0x0a9e('0x36')],'dialPrefix':_0x20f109['dialPrefix'],'outboundAnswerAgiCallsDay':_0x20f109[_0x0a9e('0x37')],'outboundAnswerCallsDay':_0x20f109[_0x0a9e('0x38')],'outboundBlacklistCallsDay':_0x20f109[_0x0a9e('0x39')],'outboundBusyCallsDay':_0x20f109[_0x0a9e('0x3a')],'outboundCongestionCallsDay':_0x20f109[_0x0a9e('0x3b')],'outboundDropCallsDayACS':_0x20f109[_0x0a9e('0x3c')],'outboundDropCallsDayCallersExit':_0x20f109[_0x0a9e('0x3d')],'outboundDropCallsDayTimeout':_0x20f109[_0x0a9e('0x3e')],'outboundNoAnswerCallsDay':_0x20f109['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f109[_0x0a9e('0x3f')],'outboundOriginateFailureCallsDay':_0x20f109[_0x0a9e('0x40')],'outboundReCallsDay':_0x20f109[_0x0a9e('0x41')],'outboundRejectCallsDay':_0x20f109[_0x0a9e('0x42')],'outboundUnknownCallsDay':_0x20f109['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x20f109[_0x0a9e('0x43')],'predictiveIntervalAnsweredCalls':_0x20f109[_0x0a9e('0x44')],'predictiveIntervalAvgHoldtime':_0x20f109[_0x0a9e('0x45')],'predictiveIntervalAvgTalktime':_0x20f109[_0x0a9e('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x20f109[_0x0a9e('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x20f109[_0x0a9e('0x48')],'predictiveIntervalErlangCalls':_0x20f109[_0x0a9e('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f109[_0x0a9e('0x4a')],'predictiveIntervalHitRate':_0x20f109[_0x0a9e('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x20f109['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f109[_0x0a9e('0x4c')],'predictiveIntervalAvailable':_0x20f109['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f109[_0x0a9e('0x4d')],'message':_0x20f109[_0x0a9e('0x4e')],'originated':_0x20f109[_0x0a9e('0x4f')],'erlangCalls':_0x20f109[_0x0a9e('0x50')],'erlangCallToSecond':_0x20f109[_0x0a9e('0x51')],'erlangAbandonmentRate':_0x20f109['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f109[_0x0a9e('0x52')],'startPredictive':_0x20f109[_0x0a9e('0x53')],'startProgressive':_0x20f109[_0x0a9e('0x54')]};if(_0x20f109[_0x0a9e('0x55')]){_0x3a02e1[_0x0a9e('0x55')]={'id':_0x20f109[_0x0a9e('0x55')]['id'],'name':_0x20f109[_0x0a9e('0x55')][_0x0a9e('0x27')],'active':_0x20f109['Trunk'][_0x0a9e('0x56')],'callerid':_0x20f109['Trunk'][_0x0a9e('0x57')]};}if(_0x20f109[_0x0a9e('0x58')]){_0x3a02e1[_0x0a9e('0x58')]={'id':_0x20f109[_0x0a9e('0x58')]['id'],'name':_0x20f109['Interval'][_0x0a9e('0x27')]};}var _0xd1836d=md5(JSON[_0x0a9e('0x59')](_0x3a02e1));if(_0x20f109[_0x0a9e('0x3')]!==_0xd1836d){_0x20f109['md5']=_0xd1836d;emit(util['format'](_0x0a9e('0x5a'),_0x3a02e1['name']),_0x0a9e('0x5b'),_0x3a02e1);}}}function emitVoiceQueueChannelRemove(_0x3d9717){logger[_0x0a9e('0x5c')](_0x0a9e('0x5d'),JSON['stringify'](_0x3d9717));emit(util[_0x0a9e('0x5e')](_0x0a9e('0x5a'),_0x3d9717[_0x0a9e('0x27')]),'voice_queue_channel:remove',_0x3d9717);io[_0x0a9e('0x5f')](_0x0a9e('0x60'),_0x3d9717);}function notSendMessagesQueue(_0x289467){if(_0x289467['sendMessageOneNotActive']){if(_0x289467['originated']===0x0&&_0x289467[_0x0a9e('0x2b')]===0x0){_0x289467[_0x0a9e('0x61')]=![];_0x289467['available']=0x0;_0x289467[_0x0a9e('0x62')]=0x0;_0x289467[_0x0a9e('0x4e')]=_0x0a9e('0x63');ut[_0x0a9e('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x289467['name']+_0x0a9e('0x65'));}else{_0x289467[_0x0a9e('0x4e')]='IS_DISACTIVED';ut[_0x0a9e('0x64')](_0x0a9e('0x66'),_0x289467[_0x0a9e('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x289467);}}Preview[_0x0a9e('0xe')][_0x0a9e('0x26')]=function(){var _0x274e8e=this;setInterval(function(){_0x274e8e[_0x0a9e('0x67')]();},0x7cf);};Preview[_0x0a9e('0xe')][_0x0a9e('0x67')]=function(){var _0x2881b3=this[_0x0a9e('0x12')];this[_0x0a9e('0x17')]+=0x1;for(var _0x3da2cd in _0x2881b3){if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&(_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')||_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6a'))&&_0x2881b3[_0x3da2cd]['type']==='outbound'){if(this[_0x0a9e('0x17')]>0x7){this[_0x0a9e('0x17')]=0x0;this[_0x0a9e('0x6b')]();}}if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')&&_0x2881b3[_0x3da2cd][_0x0a9e('0x6c')]===_0x0a9e('0x6d')){if(_0x2881b3[_0x3da2cd][_0x0a9e('0x34')]){this[_0x0a9e('0x6e')](_0x2881b3[_0x3da2cd]);if(_0x2881b3[_0x3da2cd][_0x0a9e('0x6f')])this[_0x0a9e('0x70')](_0x2881b3[_0x3da2cd]);}else{notSendMessagesQueue(_0x2881b3[_0x3da2cd]);}}}};Preview['prototype'][_0x0a9e('0x71')]=function(_0x138b8b){var _0xdd268f=this;this[_0x0a9e('0x11')][_0x0a9e('0xf')](function(){if(!_[_0x0a9e('0x72')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b])){loggerAction[_0x0a9e('0x5c')]('[clearZombieChannels][talking]',_0x138b8b,_0x0a9e('0x73'),_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')],_0x0a9e('0x75'),JSON[_0x0a9e('0x59')](_0xdd268f['campaignsPreview'][_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]][_0x0a9e('0x4f')]),_0x0a9e('0x76'),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']][_0x0a9e('0x2b')]),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x77')]),JSON[_0x0a9e('0x59')](_[_0x0a9e('0x78')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b],[_0x0a9e('0x79'),_0x0a9e('0x7a'),'VoiceQueueId',_0x0a9e('0x7b')])));return ami[_0x0a9e('0x7c')]({'action':'status','channel':_0xdd268f['actions'][_0x138b8b]['channel']})[_0x0a9e('0x7d')](function(_0x4317e3){if(_0x4317e3[_0x0a9e('0x4e')]===_0x0a9e('0x7e')){setTimeout(function(){if(_0xdd268f[_0x0a9e('0x15')][_0x138b8b]){ut[_0x0a9e('0x7f')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']],'[clearZombieChannel]');if(_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x77')]===!![]){ut[_0x0a9e('0x80')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')]],_0x0a9e('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']);}ut[_0x0a9e('0x82')]('[Dialer][checkChannel][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]);delete _0xdd268f[_0x0a9e('0x15')][_0x138b8b];}},0x2328);}});}});};Preview['prototype'][_0x0a9e('0x6b')]=function(){var _0x1bf38a=this;loggerAction['info']('[action]',_[_0x0a9e('0x83')](this[_0x0a9e('0x15')]));for(var _0x49c095 in this[_0x0a9e('0x15')]){if(_0x1bf38a['actions'][_0x0a9e('0x68')](_0x49c095)){_0x1bf38a['clearZombieChannel'](_0x49c095);}}};Preview[_0x0a9e('0xe')]['recallMe']=function(_0x5da27d){var _0x5df0ad=this;rpcDb[_0x0a9e('0x84')](_0x5da27d['id'],ut['agentReadyId'](this[_0x0a9e('0x16')]))[_0x0a9e('0x85')](function(_0x3cfd00){if(!_[_0x0a9e('0x72')](_0x3cfd00)){for(var _0x232830=0x0;_0x232830<_0x3cfd00[_0x0a9e('0x86')];_0x232830+=0x1){if(ut[_0x0a9e('0x87')](_0x3cfd00[_0x232830][_0x0a9e('0x88')])<_0x5da27d['dialRecallMeTimeout']*0x3c){if(_0x3cfd00[_0x232830][_0x0a9e('0x89')]&&!_0x3cfd00[_0x232830][_0x0a9e('0x89')][_0x0a9e('0x8a')]){_0x5df0ad[_0x0a9e('0x8b')](_0x3cfd00[_0x232830]['id'])[_0x0a9e('0x85')](ut[_0x0a9e('0x8c')]('[RecallMe]'))[_0x0a9e('0x7d')](ut[_0x0a9e('0x8c')]('[RecallMe]'));}else{rpcDb[_0x0a9e('0x8d')](_0x3cfd00[_0x232830]['id']);}}else{var _0x5cc8fb=new Action(_0x3cfd00[_0x232830],_0x5da27d);_0x5cc8fb[_0x0a9e('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5da27d['outboundReCallsDay']+=0x1;ut[_0x0a9e('0x8f')](_0x5cc8fb,0x17,'RecallInQueue');if(_0x5da27d[_0x0a9e('0x90')]){rpcDb[_0x0a9e('0x91')](ut[_0x0a9e('0x92')](_0x3cfd00[_0x232830]));rpcDb[_0x0a9e('0x93')](_0x5cc8fb,_0x0a9e('0x94'));}else{ut[_0x0a9e('0x8f')](_0x5cc8fb,0x16,'RecallFailedTimeout');rpcDb[_0x0a9e('0x93')](_0x5cc8fb,'[HistoryRecallClose]');rpcDb[_0x0a9e('0x95')](_0x5cc8fb,_0x0a9e('0x96'));}}}}})[_0x0a9e('0x7d')](ut['logger2'](_0x0a9e('0x97')));};Preview[_0x0a9e('0xe')][_0x0a9e('0x6e')]=function(_0x32e134){_0x32e134['sendMessageOneNotActive']=!![];if(ut[_0x0a9e('0x98')](_0x32e134[_0x0a9e('0x2a')])){_0x32e134['message']=_0x0a9e('0x99');}else if(!ut[_0x0a9e('0x9a')](_0x32e134[_0x0a9e('0x34')])){_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x63');}else if(!this['isTrunkReachable'](_0x32e134[_0x0a9e('0x55')])){if(!this[_0x0a9e('0x9b')](_0x32e134[_0x0a9e('0x9c')])){_0x32e134['message']=_0x0a9e('0x9d');}else{_0x32e134['message']='ACTIVE';}}else{_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x9e');}emitCampaignPreview(_0x32e134);};Preview[_0x0a9e('0xe')][_0x0a9e('0x9f')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=this;var _0x2d7205=this[_0x0a9e('0x15')][_0xc8c264];var _0x2e89b7=this[_0x0a9e('0x12')][_0x2d7205[_0x0a9e('0x74')]];var _0x2b8192;var _0x320898=![];var _0x412a72=0x2;var _0x2a28c0=0x3;if(_0x2e89b7){switch(_0x387489){case'1':_0x2e89b7[_0x0a9e('0x3f')]+=0x1;_0x2d7205['countnosuchnumberretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x0,'NoSuchNumber');ami[_0x0a9e('0x5f')](_0x0a9e('0xa2'),ut['buildObj'](_0x2d7205,_0x0a9e('0xa3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xa4'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'0',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a43a8){_0x320898=_0x4a43a8['additional']==0x1;_0x412a72=_0x2e89b7['dialNoSuchNumberRetryFrequency'];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xaa'));}else{if(_0x2d7205[_0x0a9e('0xab')]>=_0x2e89b7['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xaa'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xab'),_0x2e89b7['dialNoSuchNumberRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];}else{_0x2d7205[_0x0a9e('0xab')]++;logger[_0x0a9e('0x5c')](_0x0a9e('0xb0'),_0x2d7205['countnosuchnumberretry']);logger[_0x0a9e('0x5c')]('id',_0x2d7205[_0x0a9e('0xb1')]);_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnosuchnumberretry':_0x2d7205['countnosuchnumberretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xb4'):var _0x4abc8f=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));_0x2d7205[_0x0a9e('0xb6')]=_0x4abc8f;_0x2d7205[_0x0a9e('0xb7')]=_0x4abc8f;_0x2d7205[_0x0a9e('0x77')]=!![];_0x2e89b7[_0x0a9e('0x2b')]+=0x1;logger[_0x0a9e('0x5c')](_0x0a9e('0xb8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7[_0x0a9e('0x2b')]);ami[_0x0a9e('0x5f')]('custom:agentconnect',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xbc'),this[_0x0a9e('0x12')][_0x2d7205['queue']]));if(_0x2e89b7[_0x0a9e('0xbd')]){ami[_0x0a9e('0x5f')](_0x0a9e('0xbe'),ut[_0x0a9e('0xbf')](_0x2d7205));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc0'),this['campaignsPreview'][_0x2d7205[_0x0a9e('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d7205,_0x0a9e('0xc0')));_0x2e89b7[_0x0a9e('0x38')]+=0x1;_0x2e89b7['total']+=0x1;_0x2e89b7[_0x0a9e('0x29')]+=0x1;ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xc1'));_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x4,_0x0a9e('0xc2'));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xc3'));rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xc5')](_0x2d7205);_0x2e89b7['sumDuration']+=_0x2d7205[_0x0a9e('0xc6')];_0x2e89b7[_0x0a9e('0x2c')]+=_0x2d7205['talktime'];logger[_0x0a9e('0x5c')]('[syncHangup][talking][decrement]',_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7['pTalking']);delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;case _0x0a9e('0xc7'):_0x2e89b7[_0x0a9e('0x3a')]+=0x1;_0x2d7205['countbusyretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x5,'Busy');_0x412a72=_0x2e89b7[_0x0a9e('0xc8')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc9')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xca'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'5',_0x2e89b7)[_0x0a9e('0x85')](function(_0x5a8854){_0x320898=_0x5a8854[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut['totalGlobal'](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2d7205[_0x0a9e('0xcc')]>=_0x2e89b7[_0x0a9e('0xcd')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xcc'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xcc')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countbusyretry':_0x2d7205[_0x0a9e('0xcc')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xcf'):_0x2e89b7[_0x0a9e('0xd0')]+=0x1;_0x2d7205['countnoanswerretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x3,_0x0a9e('0xd1'));_0x412a72=_0x2e89b7[_0x0a9e('0xd2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')](_0x0a9e('0xd3'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xd4')));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xd5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'3',_0x2e89b7)[_0x0a9e('0x85')](function(_0x30ef6e){_0x320898=_0x30ef6e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xd6'));}else{if(_0x2d7205[_0x0a9e('0xd7')]>=_0x2e89b7[_0x0a9e('0xd8')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xd5'));}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xd7'),_0x2e89b7[_0x0a9e('0xd2')]),_0x2d7205['unlockAgent'],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205['countnoanswerretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xd9'):_0x2e89b7['outboundCongestionCallsDay']+=0x1;_0x2d7205[_0x0a9e('0xda')]+=0x1;_0x2d7205['countglobal']=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x8,'Congestion');_0x412a72=_0x2e89b7[_0x0a9e('0xdb')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')]('custom:agentcongestion',ut['buildObj'](_0x2d7205,_0x0a9e('0xdc')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xdd'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'8',_0x2e89b7)[_0x0a9e('0x85')](function(_0x2450a8){_0x320898=_0x2450a8[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut['cloneAction'](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb['createCustomerFinal'](_0x2b8192,_0x0a9e('0xde'));}else{if(_0x2d7205[_0x0a9e('0xda')]>=_0x2e89b7[_0x0a9e('0xdf')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xda'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205['countcongestionretry']++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countcongestionretry':_0x2d7205['countcongestionretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xe0'):_0x2e89b7[_0x0a9e('0x42')]+=0x1;_0x2d7205[_0x0a9e('0xe1')]+=0x1;_0x2d7205['countglobal']=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x14,'AgentReject');_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami[_0x0a9e('0x5f')]('custom:agentreject',ut['buildObj'](_0x2d7205,_0x0a9e('0xe3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,'[syncHangupRequest][logAgentReject]');_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x15c6b9){_0x320898=_0x15c6b9[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut['cloneAction'](_0x2d7205,0x14,_0x0a9e('0xe4'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xe5'));}else{if(_0x2d7205[_0x0a9e('0xe1')]>=_0x2e89b7[_0x0a9e('0xe6')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xe5'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe1'),_0x2e89b7[_0x0a9e('0xe2')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});break;case _0x0a9e('0xe7'):_0x2e89b7[_0x0a9e('0x43')]+=0x1;_0x2d7205[_0x0a9e('0xe8')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0xb,'Abandoned');rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xe9'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'11',_0x2e89b7)[_0x0a9e('0x85')](function(_0x34f7b5){_0x320898=_0x34f7b5['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d7205[_0x0a9e('0xea')]>=_0x2e89b7['dialAbandonedMaxRety']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xe9'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe8'),_0x2e89b7['dialAbandonedRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case'18':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xec')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x12,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit']('custom:amd',ut[_0x0a9e('0xbb')](_0x2d7205,'amd'));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xef'));_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0xe2b083){_0x320898=_0xe2b083[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0x12,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xef'));}else{rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xef'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];break;case'19':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x13,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit'](_0x0a9e('0xf0'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xf1')));rpcDb['createCustomerHistory'](_0x2d7205,'[callProgressDetectingCustomer][machine]');_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a70ce){_0x320898=_0x4a70ce['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf2'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf2'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;default:if(_0x2d7205[_0x0a9e('0x77')]){ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xf3'));ut[_0x0a9e('0x82')](_0x0a9e('0xf4')+_0x2e89b7['name'],_0x186f39);}_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0xc,_0x186f39['cause-txt']||_0x186f39[_0x0a9e('0xee')]);_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xf5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x25931e){_0x320898=_0x25931e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf6'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf6'));}delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];}else{_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(_0xd2391){});}});}if(!(_0x2d7205[_0x0a9e('0x77')]&&_0x387489==='16')){ut['updateOriginated'](_0x2e89b7,_0x0a9e('0xf7'));logger[_0x0a9e('0x5c')](_0x0a9e('0xf8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x2e89b7[_0x0a9e('0x4f')]);}if(_0x387489!==_0x0a9e('0xb4')){delete this[_0x0a9e('0x15')][_0x186f39['linkedid']];delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xf9')]];}}};Preview[_0x0a9e('0xe')][_0x0a9e('0xfa')]=function(_0x2b624e,_0x3942fd,_0x5cb48d){if(_[_0x0a9e('0xfb')](_0x3942fd)&&'object'!==typeof _0x3942fd){return;}if(_['isUndefined'](_0x5cb48d)&&'object'!==typeof _0x5cb48d){return;}switch(_0x5cb48d[_0x0a9e('0xfc')]){case'0':ut[_0x0a9e('0xfd')](_0x2b624e,0x0,_0x0a9e('0xfe'));rpcDb[_0x0a9e('0xff')](_0x2b624e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0a9e('0xfd')](_0x2b624e,0x3,_0x0a9e('0xd1'));rpcDb[_0x0a9e('0xff')](_0x2b624e,_0x0a9e('0x100'));break;case'5':ut[_0x0a9e('0xfd')](_0x2b624e,0x5,'Busy');rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x101'));break;case'8':ut[_0x0a9e('0xfd')](_0x2b624e,0x8,_0x0a9e('0x102'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));break;case'22':ut[_0x0a9e('0xfd')](_0x2b624e,0x16,_0x0a9e('0x104'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x105'));break;default:ut[_0x0a9e('0xfd')](_0x2b624e,0xc,_0x5cb48d[_0x0a9e('0xfc')]);rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));}ut[_0x0a9e('0x7f')](_0x3942fd,_0x0a9e('0x106'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2b624e['uniqueid'],_0x0a9e('0xba'),_0x3942fd[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x3942fd[_0x0a9e('0x4f')]);delete this['actions'][_0x2b624e[_0x0a9e('0xb9')]];};Preview['prototype'][_0x0a9e('0xa5')]=function(_0x2ff2ab,_0x242f23,_0x57f673){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xa5')](_0x2ff2ab,_0x242f23,_0x57f673))['catch'](logger[_0x0a9e('0x5c')]('[verifyAdditionalPhone]\x20'));};Preview[_0x0a9e('0xe')]['swapAdditionalPhones']=function(_0x41b90a,_0x57b7d4,_0xb14971){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb3')](_0x41b90a,_0x57b7d4,_0xb14971))[_0x0a9e('0x7d')](logger[_0x0a9e('0x5c')](_0x0a9e('0x108')));};Preview['prototype'][_0x0a9e('0xb2')]=function(_0x1c9ea2){return BPromise['resolve']()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb2')](_0x1c9ea2))['catch'](logger[_0x0a9e('0x5c')](_0x0a9e('0x109')));};Preview[_0x0a9e('0xe')]['checkInBlack']=function(_0x3766d7,_0xf49ed4,_0xdeb5e4,_0x3f0d64,_0x2003bc){var _0x29fdfe=this;return new BPromise(function(_0x3ba897,_0x74d9b8){if(_[_0x0a9e('0x72')](_0xf49ed4)||_[_0x0a9e('0x72')](_0xf49ed4['Contact'])||_[_0x0a9e('0x72')](_0xf49ed4['phone'])||_[_0x0a9e('0x72')](_0xf49ed4[_0x0a9e('0x10a')])){_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x10b'),_0x3f0d64,_0x2003bc));return;}var _0x5d577b=uuid['v4']();var _0x2d45db=_0x29fdfe['campaignsPreview'][_0xf49ed4[_0x0a9e('0x73')][_0x0a9e('0x27')]];var _0x2977a7=_0xdeb5e4?_0x29fdfe['agents'][_0xdeb5e4]['id']:undefined;_0x29fdfe[_0x0a9e('0x15')][_0x5d577b]=new Action(_0xf49ed4,_0x2d45db,_0x5d577b,_0xdeb5e4,_0x2977a7);var _0x402544=_0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x402544[_0x0a9e('0xad')]=_0x3f0d64;_0x402544[_0x0a9e('0xae')]=_0x2003bc;_0x402544[_0x0a9e('0x10c')]=_0xdeb5e4;if(_[_0x0a9e('0x10d')](_0x3766d7)){_0x29fdfe['execCall'](_0x402544,_0x2d45db,_0xf49ed4,_0xdeb5e4)[_0x0a9e('0x85')](function(_0x228c10){logger[_0x0a9e('0x5c')](_0x0a9e('0x10e'),_0x0a9e('0x10f')+_0x402544[_0x0a9e('0x74')]+_0x0a9e('0x110')+_0x402544['idContact'],JSON['stringify'](_0x228c10));ami[_0x0a9e('0x5f')](_0x0a9e('0x111'),ut[_0x0a9e('0xbb')](_0x402544,_0x0a9e('0x112'),_0x29fdfe[_0x0a9e('0x12')][_0x402544[_0x0a9e('0x74')]]));_0x3ba897(ut[_0x0a9e('0x4e')]('Calling'));})[_0x0a9e('0x7d')](function(_0x1d7fc4){ut[_0x0a9e('0x64')](_0x0a9e('0x113'),_0x1d7fc4);_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x114'),_0x3f0d64,_0x2003bc));});}else{_0x2d45db[_0x0a9e('0x39')]+=0x1;ut['logBlacklist'](_0x402544);rpcDb[_0x0a9e('0x115')](_0x402544,_0x0a9e('0x116'));delete _0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x74d9b8(ut['message'](_0x0a9e('0x117'),_0x3f0d64,_0x2003bc));}});};Preview[_0x0a9e('0xe')][_0x0a9e('0x9b')]=function(_0x292f02){return!_['isNil'](_0x292f02)&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x27')])&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x56')])&&_0x292f02[_0x0a9e('0x56')]&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])])&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02['name'])][_0x0a9e('0x118')])&&(this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])][_0x0a9e('0x118')]==='reachable'||this[_0x0a9e('0x14')][util['format'](_0x0a9e('0x119'),_0x292f02['name'])]['status']==='unmonitored');};Preview[_0x0a9e('0xe')][_0x0a9e('0x8b')]=function(_0x19f800,_0x20007e){var _0x7d59a9=this;return new BPromise(function(_0xe17af8,_0x48fbef){_0x7d59a9[_0x0a9e('0x11a')](_0x19f800,_0x20007e)[_0x0a9e('0x85')](function(_0x1713a7){_0xe17af8(_[_0x0a9e('0x78')](_0x1713a7,[_0x0a9e('0x4e')]));})[_0x0a9e('0x7d')](function(_0x31c937){if(_0x31c937['unlock']){rpcDb['unlockContact'](_0x19f800);}if(_0x31c937[_0x0a9e('0x56')]){rpcDb['disableContact'](_0x19f800);}_0x48fbef(_[_0x0a9e('0x78')](_0x31c937,[_0x0a9e('0x4e')]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11a')]=function(_0x37a448,_0x383dd8){var _0x594f25=this;return new BPromise(function(_0x4716d1,_0x59b872){var _0x50e32a,_0x504403;rpcDb['getContactPreview'](_0x37a448)[_0x0a9e('0x85')](function(_0x5dc978){if(!_['isNil'](_0x5dc978[0x0])){_0x504403=_0x5dc978[0x0][_0x0a9e('0x11b')]?![]:!![];_0x50e32a=_0x5dc978[0x0]['recallme']?!![]:![];_0x50e32a=_0x383dd8?!![]:_0x50e32a;}var _0x24470a=_0x594f25[_0x0a9e('0x11c')](_0x5dc978);if(_0x24470a[_0x0a9e('0x11d')]){rpcDb['checkIsBlackList'](_[_0x0a9e('0x78')](_0x5dc978[0x0],[_0x0a9e('0x10a'),_0x0a9e('0x11e')]))['then'](function(_0x5236c9){_0x594f25[_0x0a9e('0x11f')](_0x5236c9,_0x5dc978[0x0],_0x383dd8,_0x504403,_0x50e32a)[_0x0a9e('0x85')](function(_0x89d2cb){_0x4716d1(_0x89d2cb);})[_0x0a9e('0x7d')](function(_0x3b0db2){_0x59b872(_0x3b0db2);});})[_0x0a9e('0x7d')](function(_0x247a6c){ut[_0x0a9e('0x64')](_0x0a9e('0x120'),_0x247a6c);_0x59b872(ut[_0x0a9e('0x4e')]('Call\x20unsuccessful',_0x504403,_0x50e32a));});}else{_0x59b872(ut['message'](_0x24470a['message'],_0x504403,_0x50e32a));}})[_0x0a9e('0x7d')](function(_0x19dcc2){ut[_0x0a9e('0x64')](_0x0a9e('0x121'),_0x19dcc2);_0x59b872(ut[_0x0a9e('0x4e')](_0x0a9e('0x122'),![],!![]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11c')]=function(_0x5d74e9){if(_['isNil'](_0x5d74e9)||_[_0x0a9e('0x10d')](_0x5d74e9)||!_[_0x0a9e('0x72')](_0x5d74e9[0x0]['Agent'])&&_[_0x0a9e('0x72')](_0x5d74e9[0x0][_0x0a9e('0x89')][_0x0a9e('0x27')])){ut[_0x0a9e('0x64')](_0x0a9e('0x123'),_0x5d74e9);return{'isValid':![],'message':_0x0a9e('0x124')};}var _0x167196=this[_0x0a9e('0x12')][_0x5d74e9[0x0][_0x0a9e('0x73')][_0x0a9e('0x27')]];_0x167196[_0x0a9e('0x4e')]=_0x0a9e('0x9e');if(_['isNil'](_0x167196)){ut[_0x0a9e('0x64')](_0x0a9e('0x125'),_0x167196);return{'isValid':![],'message':_0x0a9e('0x126')};}if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x55')])){ut[_0x0a9e('0x64')](_0x0a9e('0x127'),_0x0a9e('0x128')+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x129'));if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x9c')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12a'));return{'isValid':![],'message':_0x0a9e('0x12b')};}}if(!ut[_0x0a9e('0x9a')](_0x167196[_0x0a9e('0x34')])){ut[_0x0a9e('0x64')](_0x0a9e('0x12c'),_0x167196['name']+_0x0a9e('0x12d'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12d')};}return{'isValid':!![],'message':_0x0a9e('0x12e')};};Preview[_0x0a9e('0xe')][_0x0a9e('0x12f')]=function(_0x358f74,_0x465003,_0x261eca,_0xa7a754){var _0x32a199=this;return new BPromise(function(_0x39d367,_0x8231e5){var _0x43111e=_0x358f74[_0x0a9e('0xb9')];var _0x3c8a9a=_0x32a199[_0x0a9e('0x9b')](_0x465003['Trunk'])?util['format'](_0x0a9e('0x130'),_0x465003[_0x0a9e('0x55')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003['dialCutDigit']>0x0?_0x261eca[_0x0a9e('0x11e')]['substring'](_0x465003[_0x0a9e('0x133')]):_0x261eca['phone']):util[_0x0a9e('0x5e')]('SIP/%s/%s%s',_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['name']:_0x465003[_0x0a9e('0x9c')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003[_0x0a9e('0x133')]>0x0?_0x261eca[_0x0a9e('0x11e')][_0x0a9e('0x134')](_0x465003[_0x0a9e('0x133')]):_0x261eca[_0x0a9e('0x11e')]);var _0x1a3143=_0x32a199[_0x0a9e('0x9b')](_0x465003[_0x0a9e('0x55')])?ut[_0x0a9e('0x135')](_0x465003[_0x0a9e('0x55')][_0x0a9e('0x57')],_0x465003[_0x0a9e('0x35')],_0x465003[_0x0a9e('0x136')]>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003['dialOriginateCallerIdNumber']):ut[_0x0a9e('0x135')](_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['callerid']:_0x465003['TrunkBackup']['callerid'],_0x465003[_0x0a9e('0x35')],_0x465003['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003[_0x0a9e('0x138')]);if(_0x1a3143){_0x358f74[_0x0a9e('0x139')]=ut[_0x0a9e('0x13a')](_0x1a3143);_0x358f74[_0x0a9e('0x13b')]=ut[_0x0a9e('0x13c')](_0x1a3143);}var _0x2154d8=ut[_0x0a9e('0x13d')](_0x465003,_0x261eca,_0x3c8a9a,_0x1a3143,_0x43111e,_0x358f74);_['merge'](_0x358f74,ut[_0x0a9e('0x13e')](_0x2154d8));_0x358f74['starttime']=moment()[_0x0a9e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0a9e('0x7c')](ut[_0x0a9e('0x13f')](_0x358f74,_0x465003,_0x2154d8,_0x358f74[_0x0a9e('0xae')],_0xa7a754))['then'](function(_0x920ad8){_0x465003[_0x0a9e('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x43111e,_0x0a9e('0xba'),_0x465003[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x465003['originated']);_0x39d367(_0x920ad8);})['catch'](function(_0x4869c1){ut[_0x0a9e('0xfd')](_0x358f74,0xe,_0x0a9e('0x140'));rpcDb[_0x0a9e('0xff')](_0x358f74,_0x0a9e('0x141'));_0x8231e5(_0x4869c1);});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x142')]=function(_0x183b9b){if(this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]]){this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]][_0x0a9e('0x143')]=_0x183b9b[_0x0a9e('0x143')];}};Preview[_0x0a9e('0xe')][_0x0a9e('0x19')]=function(_0x1a74c4){var _0x94e69b=this;var _0x320367=this['actions'][_0x1a74c4[_0x0a9e('0x144')]];if(_0x320367){if(_0x320367[_0x0a9e('0x10c')]&&this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]){ut[_0x0a9e('0x145')](_0x320367,this[_0x0a9e('0x16')][_0x320367['lookAgent']][_0x0a9e('0x27')],this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]['id']);}var _0x1109de=_[_0x0a9e('0x146')](_0x320367);_0x1109de[_0x0a9e('0xb6')]=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));var _0x4175a6=_0x94e69b['campaignsPreview'][_0x320367['queue']];if(ut[_0x0a9e('0x147')](_0x1a74c4[_0x0a9e('0x148')])){if(_0x320367['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x320367[_0x0a9e('0xb1')]);}if(_0x320367['activeContact']){rpcDb[_0x0a9e('0x8d')](_0x320367['idContact']);}ami[_0x0a9e('0x5f')](_0x0a9e('0x14a'),ut['buildObj'](_0x320367,_0x0a9e('0x14b'),this[_0x0a9e('0x12')][_0x320367['queue']]));this[_0x0a9e('0xfa')](_0x1109de,_0x4175a6,_0x1a74c4);}else{_0x320367[_0x0a9e('0x8e')]=moment()['format'](_0x0a9e('0xb5'));ut[_0x0a9e('0xfd')](_0x1109de,0x4,_0x0a9e('0xc2'));rpcDb[_0x0a9e('0xff')](_0x1109de,_0x0a9e('0x14c'));}}};Preview[_0x0a9e('0xe')]['syncHangup']=function(_0x1e5b09){var _0x36dc4f=this;var _0x51e697=this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]];var _0x22c390;if(_0x51e697){_0x22c390=this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x74')]];logger[_0x0a9e('0x5c')](_0x0a9e('0x14d'),_0x1e5b09['linkedid'],'\x20Queue',_0x22c390['name'],'pTalking:\x20',_0x22c390['pTalking']);}if(this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]]&&_0x1e5b09['linkedid']!==_0x1e5b09['uniqueid']){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this[_0x0a9e('0x15')][_0x1e5b09['linkedid']][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')]('[syncHangup][talking][cause]',_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390[_0x0a9e('0x2b')]);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09['linkedid'],_0x1e5b09[_0x0a9e('0x14e')]);}}else if(_0x51e697&&_['isNil'](_0x51e697[_0x0a9e('0x14f')])&&_0x22c390[_0x0a9e('0x150')]&&_0x1e5b09['linkedid']===_0x1e5b09[_0x0a9e('0xb9')]&&_[_0x0a9e('0x72')](_0x1e5b09['reason'])&&_0x1e5b09[_0x0a9e('0x14e')]==='16'&&_0x1e5b09['channelstate']==='6'&&_[_0x0a9e('0xfb')](_0x51e697[_0x0a9e('0x151')])){if(_0x51e697['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x51e697['idContact']);}if(_0x51e697[_0x0a9e('0xae')]){rpcDb[_0x0a9e('0x8d')](_0x51e697[_0x0a9e('0xb1')]);}_0x1e5b09[_0x0a9e('0xfc')]='22';this[_0x0a9e('0xfa')](_0x51e697,_0x22c390,_0x1e5b09);}else if(_0x51e697&&_0x51e697[_0x0a9e('0x151')]){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x152'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09['cause'],_0x0a9e('0xba'),_0x22c390['name'],'pTalking:\x20',_0x22c390[_0x0a9e('0x2b')]);this['callProgressDetectingCustomer'](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x153'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390['pTalking']);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')]['syncDialEnd']=function(_0x38d95a){if(this[_0x0a9e('0x15')][_0x38d95a[_0x0a9e('0xf9')]]&&_0x38d95a['destlinkedid']!==_0x38d95a[_0x0a9e('0x154')]){this[_0x0a9e('0x9f')](_0x38d95a,_0x38d95a[_0x0a9e('0xf9')],_0x38d95a['dialstatus']);}};Preview[_0x0a9e('0xe')]['syncHangupRequest']=function(_0x2394f2){if(this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]&&_0x2394f2[_0x0a9e('0xaf')]!==_0x2394f2[_0x0a9e('0xb9')]&&!this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]['dialAnswer']){if(_0x2394f2[_0x0a9e('0x14e')]==='1'){this[_0x0a9e('0x9f')](_0x2394f2,_0x2394f2[_0x0a9e('0xaf')],_0x2394f2[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')][_0x0a9e('0x155')]=function(_0x3a4def,_0x2670f5,_0x2310ca){if(this[_0x0a9e('0x15')][_0x3a4def]){if(_[_0x0a9e('0x72')](this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')])){this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')]={};}this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')][_0x2670f5]=_0x2310ca;}};Preview[_0x0a9e('0xe')][_0x0a9e('0x21')]=function(_0x611e46){try{if(!_[_0x0a9e('0x72')](_0x611e46)){if(ut[_0x0a9e('0x157')](_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0])){this[_0x0a9e('0x155')](_0x611e46[_0x0a9e('0xb9')],_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0],_0x611e46[_0x0a9e('0x159')]);}}}catch(_0x4c925e){logger[_0x0a9e('0x15a')](_0x0a9e('0x15b'),util[_0x0a9e('0x15c')](_0x4c925e,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xe')][_0x0a9e('0x23')]=function(_0xb09ef6){if(_0xb09ef6){if(this[_0x0a9e('0x15')][_0xb09ef6[_0x0a9e('0x15d')]]){this['actions'][_0xb09ef6[_0x0a9e('0x15d')]][_0x0a9e('0x151')]=!![];}}};Preview['prototype'][_0x0a9e('0x25')]=function(_0x2db8fe){if(_0x2db8fe){if(this[_0x0a9e('0x15')][_0x2db8fe['transfererlinkedid']]){this[_0x0a9e('0x15')][_0x2db8fe[_0x0a9e('0x15e')]][_0x0a9e('0x151')]=!![];}}};module[_0x0a9e('0x15f')]=Preview; \ No newline at end of file +var _0xa9e0=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','SIP/%s','execRun','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','defaults','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require(_0x0a9e('0x9'));var Action=require(_0x0a9e('0xa'));var ut=require('./util/util');config['redis']=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xd')]));var Sequence=function(){};Sequence[_0x0a9e('0xe')][_0x0a9e('0xf')]=function(_0xfeb75b){this[_0x0a9e('0x10')]=this['tail']?this['tail']['finally'](_0xfeb75b):_0xfeb75b();};function Preview(_0x4cfe67){this[_0x0a9e('0x11')]=new Sequence();this[_0x0a9e('0x12')]=_0x4cfe67[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x4cfe67[_0x0a9e('0x14')];this[_0x0a9e('0x15')]={};this['agents']=_0x4cfe67[_0x0a9e('0x16')];this[_0x0a9e('0x17')]=0x0;ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x1b'),this['syncHangup'][_0x0a9e('0x1a')](this));ami['on']('hanguprequest',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')]['bind'](this));ami['on'](_0x0a9e('0x1f'),this['syncNewExten'][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x24'),this[_0x0a9e('0x25')][_0x0a9e('0x1a')](this));this[_0x0a9e('0x26')](this[_0x0a9e('0x12')]);}function emit(_0x4bb1e3,_0x2c3407,_0x155cce){io['to'](_0x4bb1e3)['emit'](_0x2c3407,_0x155cce);}function emitCampaignPreview(_0x20f109){if(_0x20f109['type']==='outbound'){var _0x3a02e1={'id':_0x20f109['id'],'name':_0x20f109[_0x0a9e('0x27')],'strategy':_0x20f109[_0x0a9e('0x28')],'answered':_0x20f109[_0x0a9e('0x29')],'available':_0x20f109['available'],'loggedIn':_0x20f109[_0x0a9e('0x2a')],'pTalking':_0x20f109[_0x0a9e('0x2b')],'sumBillable':_0x20f109[_0x0a9e('0x2c')],'sumDuration':_0x20f109[_0x0a9e('0x2d')],'sumHoldTime':_0x20f109[_0x0a9e('0x2e')]||0x0,'talking':_0x20f109[_0x0a9e('0x2f')],'total':_0x20f109[_0x0a9e('0x30')],'type':_0x20f109['type'],'unmanaged':_0x20f109['unmanaged'],'abandoned':_0x20f109[_0x0a9e('0x31')],'waiting':_0x20f109[_0x0a9e('0x32')],'loggedInDb':_0x20f109[_0x0a9e('0x33')],'dialActive':_0x20f109[_0x0a9e('0x34')],'dialMethod':_0x20f109['dialMethod'],'dialOriginateCallerIdName':_0x20f109[_0x0a9e('0x35')],'dialOriginateCallerIdNumber':_0x20f109['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f109[_0x0a9e('0x36')],'dialPrefix':_0x20f109['dialPrefix'],'outboundAnswerAgiCallsDay':_0x20f109[_0x0a9e('0x37')],'outboundAnswerCallsDay':_0x20f109[_0x0a9e('0x38')],'outboundBlacklistCallsDay':_0x20f109[_0x0a9e('0x39')],'outboundBusyCallsDay':_0x20f109[_0x0a9e('0x3a')],'outboundCongestionCallsDay':_0x20f109[_0x0a9e('0x3b')],'outboundDropCallsDayACS':_0x20f109[_0x0a9e('0x3c')],'outboundDropCallsDayCallersExit':_0x20f109[_0x0a9e('0x3d')],'outboundDropCallsDayTimeout':_0x20f109[_0x0a9e('0x3e')],'outboundNoAnswerCallsDay':_0x20f109['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f109[_0x0a9e('0x3f')],'outboundOriginateFailureCallsDay':_0x20f109[_0x0a9e('0x40')],'outboundReCallsDay':_0x20f109[_0x0a9e('0x41')],'outboundRejectCallsDay':_0x20f109[_0x0a9e('0x42')],'outboundUnknownCallsDay':_0x20f109['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x20f109[_0x0a9e('0x43')],'predictiveIntervalAnsweredCalls':_0x20f109[_0x0a9e('0x44')],'predictiveIntervalAvgHoldtime':_0x20f109[_0x0a9e('0x45')],'predictiveIntervalAvgTalktime':_0x20f109[_0x0a9e('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x20f109[_0x0a9e('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x20f109[_0x0a9e('0x48')],'predictiveIntervalErlangCalls':_0x20f109[_0x0a9e('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f109[_0x0a9e('0x4a')],'predictiveIntervalHitRate':_0x20f109[_0x0a9e('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x20f109['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f109[_0x0a9e('0x4c')],'predictiveIntervalAvailable':_0x20f109['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f109[_0x0a9e('0x4d')],'message':_0x20f109[_0x0a9e('0x4e')],'originated':_0x20f109[_0x0a9e('0x4f')],'erlangCalls':_0x20f109[_0x0a9e('0x50')],'erlangCallToSecond':_0x20f109[_0x0a9e('0x51')],'erlangAbandonmentRate':_0x20f109['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f109[_0x0a9e('0x52')],'startPredictive':_0x20f109[_0x0a9e('0x53')],'startProgressive':_0x20f109[_0x0a9e('0x54')]};if(_0x20f109[_0x0a9e('0x55')]){_0x3a02e1[_0x0a9e('0x55')]={'id':_0x20f109[_0x0a9e('0x55')]['id'],'name':_0x20f109[_0x0a9e('0x55')][_0x0a9e('0x27')],'active':_0x20f109['Trunk'][_0x0a9e('0x56')],'callerid':_0x20f109['Trunk'][_0x0a9e('0x57')]};}if(_0x20f109[_0x0a9e('0x58')]){_0x3a02e1[_0x0a9e('0x58')]={'id':_0x20f109[_0x0a9e('0x58')]['id'],'name':_0x20f109['Interval'][_0x0a9e('0x27')]};}var _0xd1836d=md5(JSON[_0x0a9e('0x59')](_0x3a02e1));if(_0x20f109[_0x0a9e('0x3')]!==_0xd1836d){_0x20f109['md5']=_0xd1836d;emit(util['format'](_0x0a9e('0x5a'),_0x3a02e1['name']),_0x0a9e('0x5b'),_0x3a02e1);}}}function emitVoiceQueueChannelRemove(_0x3d9717){logger[_0x0a9e('0x5c')](_0x0a9e('0x5d'),JSON['stringify'](_0x3d9717));emit(util[_0x0a9e('0x5e')](_0x0a9e('0x5a'),_0x3d9717[_0x0a9e('0x27')]),'voice_queue_channel:remove',_0x3d9717);io[_0x0a9e('0x5f')](_0x0a9e('0x60'),_0x3d9717);}function notSendMessagesQueue(_0x289467){if(_0x289467['sendMessageOneNotActive']){if(_0x289467['originated']===0x0&&_0x289467[_0x0a9e('0x2b')]===0x0){_0x289467[_0x0a9e('0x61')]=![];_0x289467['available']=0x0;_0x289467[_0x0a9e('0x62')]=0x0;_0x289467[_0x0a9e('0x4e')]=_0x0a9e('0x63');ut[_0x0a9e('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x289467['name']+_0x0a9e('0x65'));}else{_0x289467[_0x0a9e('0x4e')]='IS_DISACTIVED';ut[_0x0a9e('0x64')](_0x0a9e('0x66'),_0x289467[_0x0a9e('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x289467);}}Preview[_0x0a9e('0xe')][_0x0a9e('0x26')]=function(){var _0x274e8e=this;setInterval(function(){_0x274e8e[_0x0a9e('0x67')]();},0x7cf);};Preview[_0x0a9e('0xe')][_0x0a9e('0x67')]=function(){var _0x2881b3=this[_0x0a9e('0x12')];this[_0x0a9e('0x17')]+=0x1;for(var _0x3da2cd in _0x2881b3){if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&(_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')||_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6a'))&&_0x2881b3[_0x3da2cd]['type']==='outbound'){if(this[_0x0a9e('0x17')]>0x7){this[_0x0a9e('0x17')]=0x0;this[_0x0a9e('0x6b')]();}}if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')&&_0x2881b3[_0x3da2cd][_0x0a9e('0x6c')]===_0x0a9e('0x6d')){if(_0x2881b3[_0x3da2cd][_0x0a9e('0x34')]){this[_0x0a9e('0x6e')](_0x2881b3[_0x3da2cd]);if(_0x2881b3[_0x3da2cd][_0x0a9e('0x6f')])this[_0x0a9e('0x70')](_0x2881b3[_0x3da2cd]);}else{notSendMessagesQueue(_0x2881b3[_0x3da2cd]);}}}};Preview['prototype'][_0x0a9e('0x71')]=function(_0x138b8b){var _0xdd268f=this;this[_0x0a9e('0x11')][_0x0a9e('0xf')](function(){if(!_[_0x0a9e('0x72')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b])){loggerAction[_0x0a9e('0x5c')]('[clearZombieChannels][talking]',_0x138b8b,_0x0a9e('0x73'),_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')],_0x0a9e('0x75'),JSON[_0x0a9e('0x59')](_0xdd268f['campaignsPreview'][_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]][_0x0a9e('0x4f')]),_0x0a9e('0x76'),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']][_0x0a9e('0x2b')]),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x77')]),JSON[_0x0a9e('0x59')](_[_0x0a9e('0x78')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b],[_0x0a9e('0x79'),_0x0a9e('0x7a'),'VoiceQueueId',_0x0a9e('0x7b')])));return ami[_0x0a9e('0x7c')]({'action':'status','channel':_0xdd268f['actions'][_0x138b8b]['channel']})[_0x0a9e('0x7d')](function(_0x4317e3){if(_0x4317e3[_0x0a9e('0x4e')]===_0x0a9e('0x7e')){setTimeout(function(){if(_0xdd268f[_0x0a9e('0x15')][_0x138b8b]){ut[_0x0a9e('0x7f')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']],'[clearZombieChannel]');if(_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x77')]===!![]){ut[_0x0a9e('0x80')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')]],_0x0a9e('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']);}ut[_0x0a9e('0x82')]('[Dialer][checkChannel][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]);delete _0xdd268f[_0x0a9e('0x15')][_0x138b8b];}},0x2328);}});}});};Preview['prototype'][_0x0a9e('0x6b')]=function(){var _0x1bf38a=this;loggerAction['info']('[action]',_[_0x0a9e('0x83')](this[_0x0a9e('0x15')]));for(var _0x49c095 in this[_0x0a9e('0x15')]){if(_0x1bf38a['actions'][_0x0a9e('0x68')](_0x49c095)){_0x1bf38a['clearZombieChannel'](_0x49c095);}}};Preview[_0x0a9e('0xe')]['recallMe']=function(_0x5da27d){var _0x5df0ad=this;rpcDb[_0x0a9e('0x84')](_0x5da27d['id'],ut['agentReadyId'](this[_0x0a9e('0x16')]))[_0x0a9e('0x85')](function(_0x3cfd00){if(!_[_0x0a9e('0x72')](_0x3cfd00)){for(var _0x232830=0x0;_0x232830<_0x3cfd00[_0x0a9e('0x86')];_0x232830+=0x1){if(ut[_0x0a9e('0x87')](_0x3cfd00[_0x232830][_0x0a9e('0x88')])<_0x5da27d['dialRecallMeTimeout']*0x3c){if(_0x3cfd00[_0x232830][_0x0a9e('0x89')]&&!_0x3cfd00[_0x232830][_0x0a9e('0x89')][_0x0a9e('0x8a')]){_0x5df0ad[_0x0a9e('0x8b')](_0x3cfd00[_0x232830]['id'])[_0x0a9e('0x85')](ut[_0x0a9e('0x8c')]('[RecallMe]'))[_0x0a9e('0x7d')](ut[_0x0a9e('0x8c')]('[RecallMe]'));}else{rpcDb[_0x0a9e('0x8d')](_0x3cfd00[_0x232830]['id']);}}else{var _0x5cc8fb=new Action(_0x3cfd00[_0x232830],_0x5da27d);_0x5cc8fb[_0x0a9e('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5da27d['outboundReCallsDay']+=0x1;ut[_0x0a9e('0x8f')](_0x5cc8fb,0x17,'RecallInQueue');if(_0x5da27d[_0x0a9e('0x90')]){rpcDb[_0x0a9e('0x91')](ut[_0x0a9e('0x92')](_0x3cfd00[_0x232830]));rpcDb[_0x0a9e('0x93')](_0x5cc8fb,_0x0a9e('0x94'));}else{ut[_0x0a9e('0x8f')](_0x5cc8fb,0x16,'RecallFailedTimeout');rpcDb[_0x0a9e('0x93')](_0x5cc8fb,'[HistoryRecallClose]');rpcDb[_0x0a9e('0x95')](_0x5cc8fb,_0x0a9e('0x96'));}}}}})[_0x0a9e('0x7d')](ut['logger2'](_0x0a9e('0x97')));};Preview[_0x0a9e('0xe')][_0x0a9e('0x6e')]=function(_0x32e134){_0x32e134['sendMessageOneNotActive']=!![];if(ut[_0x0a9e('0x98')](_0x32e134[_0x0a9e('0x2a')])){_0x32e134['message']=_0x0a9e('0x99');}else if(!ut[_0x0a9e('0x9a')](_0x32e134[_0x0a9e('0x34')])){_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x63');}else if(!this['isTrunkReachable'](_0x32e134[_0x0a9e('0x55')])){if(!this[_0x0a9e('0x9b')](_0x32e134[_0x0a9e('0x9c')])){_0x32e134['message']=_0x0a9e('0x9d');}else{_0x32e134['message']='ACTIVE';}}else{_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x9e');}emitCampaignPreview(_0x32e134);};Preview[_0x0a9e('0xe')][_0x0a9e('0x9f')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=this;var _0x2d7205=this[_0x0a9e('0x15')][_0xc8c264];var _0x2e89b7=this[_0x0a9e('0x12')][_0x2d7205[_0x0a9e('0x74')]];var _0x2b8192;var _0x320898=![];var _0x412a72=0x2;var _0x2a28c0=0x3;if(_0x2e89b7){switch(_0x387489){case'1':_0x2e89b7[_0x0a9e('0x3f')]+=0x1;_0x2d7205['countnosuchnumberretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x0,'NoSuchNumber');ami[_0x0a9e('0x5f')](_0x0a9e('0xa2'),ut['buildObj'](_0x2d7205,_0x0a9e('0xa3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xa4'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'0',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a43a8){_0x320898=_0x4a43a8['additional']==0x1;_0x412a72=_0x2e89b7['dialNoSuchNumberRetryFrequency'];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xaa'));}else{if(_0x2d7205[_0x0a9e('0xab')]>=_0x2e89b7['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xaa'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xab'),_0x2e89b7['dialNoSuchNumberRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];}else{_0x2d7205[_0x0a9e('0xab')]++;logger[_0x0a9e('0x5c')](_0x0a9e('0xb0'),_0x2d7205['countnosuchnumberretry']);logger[_0x0a9e('0x5c')]('id',_0x2d7205[_0x0a9e('0xb1')]);_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnosuchnumberretry':_0x2d7205['countnosuchnumberretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xb4'):var _0x4abc8f=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));_0x2d7205[_0x0a9e('0xb6')]=_0x4abc8f;_0x2d7205[_0x0a9e('0xb7')]=_0x4abc8f;_0x2d7205[_0x0a9e('0x77')]=!![];_0x2e89b7[_0x0a9e('0x2b')]+=0x1;logger[_0x0a9e('0x5c')](_0x0a9e('0xb8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7[_0x0a9e('0x2b')]);ami[_0x0a9e('0x5f')]('custom:agentconnect',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xbc'),this[_0x0a9e('0x12')][_0x2d7205['queue']]));if(_0x2e89b7[_0x0a9e('0xbd')]){ami[_0x0a9e('0x5f')](_0x0a9e('0xbe'),ut[_0x0a9e('0xbf')](_0x2d7205));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc0'),this['campaignsPreview'][_0x2d7205[_0x0a9e('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d7205,_0x0a9e('0xc0')));_0x2e89b7[_0x0a9e('0x38')]+=0x1;_0x2e89b7['total']+=0x1;_0x2e89b7[_0x0a9e('0x29')]+=0x1;ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xc1'));_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x4,_0x0a9e('0xc2'));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xc3'));rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xc5')](_0x2d7205);_0x2e89b7['sumDuration']+=_0x2d7205[_0x0a9e('0xc6')];_0x2e89b7[_0x0a9e('0x2c')]+=_0x2d7205['talktime'];logger[_0x0a9e('0x5c')]('[syncHangup][talking][decrement]',_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7['pTalking']);delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;case _0x0a9e('0xc7'):_0x2e89b7[_0x0a9e('0x3a')]+=0x1;_0x2d7205['countbusyretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x5,'Busy');_0x412a72=_0x2e89b7[_0x0a9e('0xc8')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc9')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xca'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'5',_0x2e89b7)[_0x0a9e('0x85')](function(_0x5a8854){_0x320898=_0x5a8854[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut['totalGlobal'](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2d7205[_0x0a9e('0xcc')]>=_0x2e89b7[_0x0a9e('0xcd')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xcc'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xcc')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countbusyretry':_0x2d7205[_0x0a9e('0xcc')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xcf'):_0x2e89b7[_0x0a9e('0xd0')]+=0x1;_0x2d7205['countnoanswerretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x3,_0x0a9e('0xd1'));_0x412a72=_0x2e89b7[_0x0a9e('0xd2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')](_0x0a9e('0xd3'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xd4')));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xd5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'3',_0x2e89b7)[_0x0a9e('0x85')](function(_0x30ef6e){_0x320898=_0x30ef6e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xd6'));}else{if(_0x2d7205[_0x0a9e('0xd7')]>=_0x2e89b7[_0x0a9e('0xd8')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xd5'));}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xd7'),_0x2e89b7[_0x0a9e('0xd2')]),_0x2d7205['unlockAgent'],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205['countnoanswerretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xd9'):_0x2e89b7['outboundCongestionCallsDay']+=0x1;_0x2d7205[_0x0a9e('0xda')]+=0x1;_0x2d7205['countglobal']=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x8,'Congestion');_0x412a72=_0x2e89b7[_0x0a9e('0xdb')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')]('custom:agentcongestion',ut['buildObj'](_0x2d7205,_0x0a9e('0xdc')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xdd'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'8',_0x2e89b7)[_0x0a9e('0x85')](function(_0x2450a8){_0x320898=_0x2450a8[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut['cloneAction'](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb['createCustomerFinal'](_0x2b8192,_0x0a9e('0xde'));}else{if(_0x2d7205[_0x0a9e('0xda')]>=_0x2e89b7[_0x0a9e('0xdf')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xda'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205['countcongestionretry']++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countcongestionretry':_0x2d7205['countcongestionretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xe0'):_0x2e89b7[_0x0a9e('0x42')]+=0x1;_0x2d7205[_0x0a9e('0xe1')]+=0x1;_0x2d7205['countglobal']=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x14,'AgentReject');_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami[_0x0a9e('0x5f')]('custom:agentreject',ut['buildObj'](_0x2d7205,_0x0a9e('0xe3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,'[syncHangupRequest][logAgentReject]');_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x15c6b9){_0x320898=_0x15c6b9[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut['cloneAction'](_0x2d7205,0x14,_0x0a9e('0xe4'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xe5'));}else{if(_0x2d7205[_0x0a9e('0xe1')]>=_0x2e89b7[_0x0a9e('0xe6')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xe5'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe1'),_0x2e89b7[_0x0a9e('0xe2')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});break;case _0x0a9e('0xe7'):_0x2e89b7[_0x0a9e('0x43')]+=0x1;_0x2d7205[_0x0a9e('0xe8')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0xb,'Abandoned');rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xe9'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'11',_0x2e89b7)[_0x0a9e('0x85')](function(_0x34f7b5){_0x320898=_0x34f7b5['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d7205[_0x0a9e('0xea')]>=_0x2e89b7['dialAbandonedMaxRety']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xe9'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe8'),_0x2e89b7['dialAbandonedRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case'18':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xec')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x12,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit']('custom:amd',ut[_0x0a9e('0xbb')](_0x2d7205,'amd'));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xef'));_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0xe2b083){_0x320898=_0xe2b083[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0x12,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xef'));}else{rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xef'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];break;case'19':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x13,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit'](_0x0a9e('0xf0'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xf1')));rpcDb['createCustomerHistory'](_0x2d7205,'[callProgressDetectingCustomer][machine]');_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a70ce){_0x320898=_0x4a70ce['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf2'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf2'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;default:if(_0x2d7205[_0x0a9e('0x77')]){ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xf3'));ut[_0x0a9e('0x82')](_0x0a9e('0xf4')+_0x2e89b7['name'],_0x186f39);}_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0xc,_0x186f39['cause-txt']||_0x186f39[_0x0a9e('0xee')]);_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xf5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x25931e){_0x320898=_0x25931e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf6'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf6'));}delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];}else{_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(_0xd2391){});}});}if(!(_0x2d7205[_0x0a9e('0x77')]&&_0x387489==='16')){ut['updateOriginated'](_0x2e89b7,_0x0a9e('0xf7'));logger[_0x0a9e('0x5c')](_0x0a9e('0xf8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x2e89b7[_0x0a9e('0x4f')]);}if(_0x387489!==_0x0a9e('0xb4')){delete this[_0x0a9e('0x15')][_0x186f39['linkedid']];delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xf9')]];}}};Preview[_0x0a9e('0xe')][_0x0a9e('0xfa')]=function(_0x2b624e,_0x3942fd,_0x5cb48d){if(_[_0x0a9e('0xfb')](_0x3942fd)&&'object'!==typeof _0x3942fd){return;}if(_['isUndefined'](_0x5cb48d)&&'object'!==typeof _0x5cb48d){return;}switch(_0x5cb48d[_0x0a9e('0xfc')]){case'0':ut[_0x0a9e('0xfd')](_0x2b624e,0x0,_0x0a9e('0xfe'));rpcDb[_0x0a9e('0xff')](_0x2b624e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0a9e('0xfd')](_0x2b624e,0x3,_0x0a9e('0xd1'));rpcDb[_0x0a9e('0xff')](_0x2b624e,_0x0a9e('0x100'));break;case'5':ut[_0x0a9e('0xfd')](_0x2b624e,0x5,'Busy');rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x101'));break;case'8':ut[_0x0a9e('0xfd')](_0x2b624e,0x8,_0x0a9e('0x102'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));break;case'22':ut[_0x0a9e('0xfd')](_0x2b624e,0x16,_0x0a9e('0x104'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x105'));break;default:ut[_0x0a9e('0xfd')](_0x2b624e,0xc,_0x5cb48d[_0x0a9e('0xfc')]);rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));}ut[_0x0a9e('0x7f')](_0x3942fd,_0x0a9e('0x106'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2b624e['uniqueid'],_0x0a9e('0xba'),_0x3942fd[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x3942fd[_0x0a9e('0x4f')]);delete this['actions'][_0x2b624e[_0x0a9e('0xb9')]];};Preview['prototype'][_0x0a9e('0xa5')]=function(_0x2ff2ab,_0x242f23,_0x57f673){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xa5')](_0x2ff2ab,_0x242f23,_0x57f673))['catch'](logger[_0x0a9e('0x5c')]('[verifyAdditionalPhone]\x20'));};Preview[_0x0a9e('0xe')]['swapAdditionalPhones']=function(_0x41b90a,_0x57b7d4,_0xb14971){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb3')](_0x41b90a,_0x57b7d4,_0xb14971))[_0x0a9e('0x7d')](logger[_0x0a9e('0x5c')](_0x0a9e('0x108')));};Preview['prototype'][_0x0a9e('0xb2')]=function(_0x1c9ea2){return BPromise['resolve']()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb2')](_0x1c9ea2))['catch'](logger[_0x0a9e('0x5c')](_0x0a9e('0x109')));};Preview[_0x0a9e('0xe')]['checkInBlack']=function(_0x3766d7,_0xf49ed4,_0xdeb5e4,_0x3f0d64,_0x2003bc){var _0x29fdfe=this;return new BPromise(function(_0x3ba897,_0x74d9b8){if(_[_0x0a9e('0x72')](_0xf49ed4)||_[_0x0a9e('0x72')](_0xf49ed4['Contact'])||_[_0x0a9e('0x72')](_0xf49ed4['phone'])||_[_0x0a9e('0x72')](_0xf49ed4[_0x0a9e('0x10a')])){_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x10b'),_0x3f0d64,_0x2003bc));return;}var _0x5d577b=uuid['v4']();var _0x2d45db=_0x29fdfe['campaignsPreview'][_0xf49ed4[_0x0a9e('0x73')][_0x0a9e('0x27')]];var _0x2977a7=_0xdeb5e4?_0x29fdfe['agents'][_0xdeb5e4]['id']:undefined;_0x29fdfe[_0x0a9e('0x15')][_0x5d577b]=new Action(_0xf49ed4,_0x2d45db,_0x5d577b,_0xdeb5e4,_0x2977a7);var _0x402544=_0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x402544[_0x0a9e('0xad')]=_0x3f0d64;_0x402544[_0x0a9e('0xae')]=_0x2003bc;_0x402544[_0x0a9e('0x10c')]=_0xdeb5e4;if(_[_0x0a9e('0x10d')](_0x3766d7)){_0x29fdfe['execCall'](_0x402544,_0x2d45db,_0xf49ed4,_0xdeb5e4)[_0x0a9e('0x85')](function(_0x228c10){logger[_0x0a9e('0x5c')](_0x0a9e('0x10e'),_0x0a9e('0x10f')+_0x402544[_0x0a9e('0x74')]+_0x0a9e('0x110')+_0x402544['idContact'],JSON['stringify'](_0x228c10));ami[_0x0a9e('0x5f')](_0x0a9e('0x111'),ut[_0x0a9e('0xbb')](_0x402544,_0x0a9e('0x112'),_0x29fdfe[_0x0a9e('0x12')][_0x402544[_0x0a9e('0x74')]]));_0x3ba897(ut[_0x0a9e('0x4e')]('Calling'));})[_0x0a9e('0x7d')](function(_0x1d7fc4){ut[_0x0a9e('0x64')](_0x0a9e('0x113'),_0x1d7fc4);_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x114'),_0x3f0d64,_0x2003bc));});}else{_0x2d45db[_0x0a9e('0x39')]+=0x1;ut['logBlacklist'](_0x402544);rpcDb[_0x0a9e('0x115')](_0x402544,_0x0a9e('0x116'));delete _0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x74d9b8(ut['message'](_0x0a9e('0x117'),_0x3f0d64,_0x2003bc));}});};Preview[_0x0a9e('0xe')][_0x0a9e('0x9b')]=function(_0x292f02){return!_['isNil'](_0x292f02)&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x27')])&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x56')])&&_0x292f02[_0x0a9e('0x56')]&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])])&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02['name'])][_0x0a9e('0x118')])&&(this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])][_0x0a9e('0x118')]==='reachable'||this[_0x0a9e('0x14')][util['format'](_0x0a9e('0x119'),_0x292f02['name'])]['status']==='unmonitored');};Preview[_0x0a9e('0xe')][_0x0a9e('0x8b')]=function(_0x19f800,_0x20007e){var _0x7d59a9=this;return new BPromise(function(_0xe17af8,_0x48fbef){_0x7d59a9[_0x0a9e('0x11a')](_0x19f800,_0x20007e)[_0x0a9e('0x85')](function(_0x1713a7){_0xe17af8(_[_0x0a9e('0x78')](_0x1713a7,[_0x0a9e('0x4e')]));})[_0x0a9e('0x7d')](function(_0x31c937){if(_0x31c937['unlock']){rpcDb['unlockContact'](_0x19f800);}if(_0x31c937[_0x0a9e('0x56')]){rpcDb['disableContact'](_0x19f800);}_0x48fbef(_[_0x0a9e('0x78')](_0x31c937,[_0x0a9e('0x4e')]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11a')]=function(_0x37a448,_0x383dd8){var _0x594f25=this;return new BPromise(function(_0x4716d1,_0x59b872){var _0x50e32a,_0x504403;rpcDb['getContactPreview'](_0x37a448)[_0x0a9e('0x85')](function(_0x5dc978){if(!_['isNil'](_0x5dc978[0x0])){_0x504403=_0x5dc978[0x0][_0x0a9e('0x11b')]?![]:!![];_0x50e32a=_0x5dc978[0x0]['recallme']?!![]:![];_0x50e32a=_0x383dd8?!![]:_0x50e32a;}var _0x24470a=_0x594f25[_0x0a9e('0x11c')](_0x5dc978);if(_0x24470a[_0x0a9e('0x11d')]){rpcDb['checkIsBlackList'](_[_0x0a9e('0x78')](_0x5dc978[0x0],[_0x0a9e('0x10a'),_0x0a9e('0x11e')]))['then'](function(_0x5236c9){_0x594f25[_0x0a9e('0x11f')](_0x5236c9,_0x5dc978[0x0],_0x383dd8,_0x504403,_0x50e32a)[_0x0a9e('0x85')](function(_0x89d2cb){_0x4716d1(_0x89d2cb);})[_0x0a9e('0x7d')](function(_0x3b0db2){_0x59b872(_0x3b0db2);});})[_0x0a9e('0x7d')](function(_0x247a6c){ut[_0x0a9e('0x64')](_0x0a9e('0x120'),_0x247a6c);_0x59b872(ut[_0x0a9e('0x4e')]('Call\x20unsuccessful',_0x504403,_0x50e32a));});}else{_0x59b872(ut['message'](_0x24470a['message'],_0x504403,_0x50e32a));}})[_0x0a9e('0x7d')](function(_0x19dcc2){ut[_0x0a9e('0x64')](_0x0a9e('0x121'),_0x19dcc2);_0x59b872(ut[_0x0a9e('0x4e')](_0x0a9e('0x122'),![],!![]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11c')]=function(_0x5d74e9){if(_['isNil'](_0x5d74e9)||_[_0x0a9e('0x10d')](_0x5d74e9)||!_[_0x0a9e('0x72')](_0x5d74e9[0x0]['Agent'])&&_[_0x0a9e('0x72')](_0x5d74e9[0x0][_0x0a9e('0x89')][_0x0a9e('0x27')])){ut[_0x0a9e('0x64')](_0x0a9e('0x123'),_0x5d74e9);return{'isValid':![],'message':_0x0a9e('0x124')};}var _0x167196=this[_0x0a9e('0x12')][_0x5d74e9[0x0][_0x0a9e('0x73')][_0x0a9e('0x27')]];_0x167196[_0x0a9e('0x4e')]=_0x0a9e('0x9e');if(_['isNil'](_0x167196)){ut[_0x0a9e('0x64')](_0x0a9e('0x125'),_0x167196);return{'isValid':![],'message':_0x0a9e('0x126')};}if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x55')])){ut[_0x0a9e('0x64')](_0x0a9e('0x127'),_0x0a9e('0x128')+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x129'));if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x9c')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12a'));return{'isValid':![],'message':_0x0a9e('0x12b')};}}if(!ut[_0x0a9e('0x9a')](_0x167196[_0x0a9e('0x34')])){ut[_0x0a9e('0x64')](_0x0a9e('0x12c'),_0x167196['name']+_0x0a9e('0x12d'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12d')};}return{'isValid':!![],'message':_0x0a9e('0x12e')};};Preview[_0x0a9e('0xe')][_0x0a9e('0x12f')]=function(_0x358f74,_0x465003,_0x261eca,_0xa7a754){var _0x32a199=this;return new BPromise(function(_0x39d367,_0x8231e5){var _0x43111e=_0x358f74[_0x0a9e('0xb9')];var _0x3c8a9a=_0x32a199[_0x0a9e('0x9b')](_0x465003['Trunk'])?util['format'](_0x0a9e('0x130'),_0x465003[_0x0a9e('0x55')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003['dialCutDigit']>0x0?_0x261eca[_0x0a9e('0x11e')]['substring'](_0x465003[_0x0a9e('0x133')]):_0x261eca['phone']):util[_0x0a9e('0x5e')]('SIP/%s/%s%s',_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['name']:_0x465003[_0x0a9e('0x9c')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003[_0x0a9e('0x133')]>0x0?_0x261eca[_0x0a9e('0x11e')][_0x0a9e('0x134')](_0x465003[_0x0a9e('0x133')]):_0x261eca[_0x0a9e('0x11e')]);var _0x1a3143=_0x32a199[_0x0a9e('0x9b')](_0x465003[_0x0a9e('0x55')])?ut[_0x0a9e('0x135')](_0x465003[_0x0a9e('0x55')][_0x0a9e('0x57')],_0x465003[_0x0a9e('0x35')],_0x465003[_0x0a9e('0x136')]>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003['dialOriginateCallerIdNumber']):ut[_0x0a9e('0x135')](_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['callerid']:_0x465003['TrunkBackup']['callerid'],_0x465003[_0x0a9e('0x35')],_0x465003['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003[_0x0a9e('0x138')]);if(_0x1a3143){_0x358f74[_0x0a9e('0x139')]=ut[_0x0a9e('0x13a')](_0x1a3143);_0x358f74[_0x0a9e('0x13b')]=ut[_0x0a9e('0x13c')](_0x1a3143);}var _0x2154d8=ut[_0x0a9e('0x13d')](_0x465003,_0x261eca,_0x3c8a9a,_0x1a3143,_0x43111e,_0x358f74);_['merge'](_0x358f74,ut[_0x0a9e('0x13e')](_0x2154d8));_0x358f74['starttime']=moment()[_0x0a9e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0a9e('0x7c')](ut[_0x0a9e('0x13f')](_0x358f74,_0x465003,_0x2154d8,_0x358f74[_0x0a9e('0xae')],_0xa7a754))['then'](function(_0x920ad8){_0x465003[_0x0a9e('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x43111e,_0x0a9e('0xba'),_0x465003[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x465003['originated']);_0x39d367(_0x920ad8);})['catch'](function(_0x4869c1){ut[_0x0a9e('0xfd')](_0x358f74,0xe,_0x0a9e('0x140'));rpcDb[_0x0a9e('0xff')](_0x358f74,_0x0a9e('0x141'));_0x8231e5(_0x4869c1);});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x142')]=function(_0x183b9b){if(this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]]){this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]][_0x0a9e('0x143')]=_0x183b9b[_0x0a9e('0x143')];}};Preview[_0x0a9e('0xe')][_0x0a9e('0x19')]=function(_0x1a74c4){var _0x94e69b=this;var _0x320367=this['actions'][_0x1a74c4[_0x0a9e('0x144')]];if(_0x320367){if(_0x320367[_0x0a9e('0x10c')]&&this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]){ut[_0x0a9e('0x145')](_0x320367,this[_0x0a9e('0x16')][_0x320367['lookAgent']][_0x0a9e('0x27')],this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]['id']);}var _0x1109de=_[_0x0a9e('0x146')](_0x320367);_0x1109de[_0x0a9e('0xb6')]=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));var _0x4175a6=_0x94e69b['campaignsPreview'][_0x320367['queue']];if(ut[_0x0a9e('0x147')](_0x1a74c4[_0x0a9e('0x148')])){if(_0x320367['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x320367[_0x0a9e('0xb1')]);}if(_0x320367['activeContact']){rpcDb[_0x0a9e('0x8d')](_0x320367['idContact']);}ami[_0x0a9e('0x5f')](_0x0a9e('0x14a'),ut['buildObj'](_0x320367,_0x0a9e('0x14b'),this[_0x0a9e('0x12')][_0x320367['queue']]));this[_0x0a9e('0xfa')](_0x1109de,_0x4175a6,_0x1a74c4);}else{_0x320367[_0x0a9e('0x8e')]=moment()['format'](_0x0a9e('0xb5'));ut[_0x0a9e('0xfd')](_0x1109de,0x4,_0x0a9e('0xc2'));rpcDb[_0x0a9e('0xff')](_0x1109de,_0x0a9e('0x14c'));}}};Preview[_0x0a9e('0xe')]['syncHangup']=function(_0x1e5b09){var _0x36dc4f=this;var _0x51e697=this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]];var _0x22c390;if(_0x51e697){_0x22c390=this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x74')]];logger[_0x0a9e('0x5c')](_0x0a9e('0x14d'),_0x1e5b09['linkedid'],'\x20Queue',_0x22c390['name'],'pTalking:\x20',_0x22c390['pTalking']);}if(this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]]&&_0x1e5b09['linkedid']!==_0x1e5b09['uniqueid']){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this[_0x0a9e('0x15')][_0x1e5b09['linkedid']][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')]('[syncHangup][talking][cause]',_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390[_0x0a9e('0x2b')]);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09['linkedid'],_0x1e5b09[_0x0a9e('0x14e')]);}}else if(_0x51e697&&_['isNil'](_0x51e697[_0x0a9e('0x14f')])&&_0x22c390[_0x0a9e('0x150')]&&_0x1e5b09['linkedid']===_0x1e5b09[_0x0a9e('0xb9')]&&_[_0x0a9e('0x72')](_0x1e5b09['reason'])&&_0x1e5b09[_0x0a9e('0x14e')]==='16'&&_0x1e5b09['channelstate']==='6'&&_[_0x0a9e('0xfb')](_0x51e697[_0x0a9e('0x151')])){if(_0x51e697['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x51e697['idContact']);}if(_0x51e697[_0x0a9e('0xae')]){rpcDb[_0x0a9e('0x8d')](_0x51e697[_0x0a9e('0xb1')]);}_0x1e5b09[_0x0a9e('0xfc')]='22';this[_0x0a9e('0xfa')](_0x51e697,_0x22c390,_0x1e5b09);}else if(_0x51e697&&_0x51e697[_0x0a9e('0x151')]){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x152'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09['cause'],_0x0a9e('0xba'),_0x22c390['name'],'pTalking:\x20',_0x22c390[_0x0a9e('0x2b')]);this['callProgressDetectingCustomer'](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x153'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390['pTalking']);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')]['syncDialEnd']=function(_0x38d95a){if(this[_0x0a9e('0x15')][_0x38d95a[_0x0a9e('0xf9')]]&&_0x38d95a['destlinkedid']!==_0x38d95a[_0x0a9e('0x154')]){this[_0x0a9e('0x9f')](_0x38d95a,_0x38d95a[_0x0a9e('0xf9')],_0x38d95a['dialstatus']);}};Preview[_0x0a9e('0xe')]['syncHangupRequest']=function(_0x2394f2){if(this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]&&_0x2394f2[_0x0a9e('0xaf')]!==_0x2394f2[_0x0a9e('0xb9')]&&!this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]['dialAnswer']){if(_0x2394f2[_0x0a9e('0x14e')]==='1'){this[_0x0a9e('0x9f')](_0x2394f2,_0x2394f2[_0x0a9e('0xaf')],_0x2394f2[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')][_0x0a9e('0x155')]=function(_0x3a4def,_0x2670f5,_0x2310ca){if(this[_0x0a9e('0x15')][_0x3a4def]){if(_[_0x0a9e('0x72')](this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')])){this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')]={};}this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')][_0x2670f5]=_0x2310ca;}};Preview[_0x0a9e('0xe')][_0x0a9e('0x21')]=function(_0x611e46){try{if(!_[_0x0a9e('0x72')](_0x611e46)){if(ut[_0x0a9e('0x157')](_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0])){this[_0x0a9e('0x155')](_0x611e46[_0x0a9e('0xb9')],_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0],_0x611e46[_0x0a9e('0x159')]);}}}catch(_0x4c925e){logger[_0x0a9e('0x15a')](_0x0a9e('0x15b'),util[_0x0a9e('0x15c')](_0x4c925e,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xe')][_0x0a9e('0x23')]=function(_0xb09ef6){if(_0xb09ef6){if(this[_0x0a9e('0x15')][_0xb09ef6[_0x0a9e('0x15d')]]){this['actions'][_0xb09ef6[_0x0a9e('0x15d')]][_0x0a9e('0x151')]=!![];}}};Preview['prototype'][_0x0a9e('0x25')]=function(_0x2db8fe){if(_0x2db8fe){if(this[_0x0a9e('0x15')][_0x2db8fe['transfererlinkedid']]){this[_0x0a9e('0x15')][_0x2db8fe[_0x0a9e('0x15e')]][_0x0a9e('0x151')]=!![];}}};module[_0x0a9e('0x15f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index ac62857..a81a46c 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 _0x0d8f=['xcally-motion-preview','assigned','membername','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip'];(function(_0x1fd6d8,_0x5c991a){var _0x78176a=function(_0x40022d){while(--_0x40022d){_0x1fd6d8['push'](_0x1fd6d8['shift']());}};_0x78176a(++_0x5c991a);}(_0x0d8f,0x78));var _0xf0d8=function(_0x3d9312,_0x3363fc){_0x3d9312=_0x3d9312-0x0;var _0x3a0a42=_0x0d8f[_0x3d9312];return _0x3a0a42;};'use strict';var util=require(_0xf0d8('0x0'));var BPromise=require(_0xf0d8('0x1'));var logger=require('../../../config/logger')(_0xf0d8('0x2'));var _=require('lodash');var cmHopper=require(_0xf0d8('0x3'));var cmHopperFinal=require(_0xf0d8('0x4'));var cmHopperHistory=require(_0xf0d8('0x5'));var cmHopperBlack=require(_0xf0d8('0x6'));var voiceQueueRt=require(_0xf0d8('0x7'));var agentReportPreview=require(_0xf0d8('0x8'));var voiceQueueReport=require(_0xf0d8('0x9'));function loggerCatch(_0x19d052){return function(_0xeed9c7){logger[_0xf0d8('0xa')](_0x19d052,util[_0xf0d8('0xb')](_0xeed9c7,{'showHidden':![],'depth':null}));};}function create(_0x154fff){return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](cmHopperHistory[_0xf0d8('0xe')](_0x154fff))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x10')));}function createAgent(_0x4c8efa){return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](agentReportPreview[_0xf0d8('0xe')](_0x4c8efa))[_0xf0d8('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4bdd4c){return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](cmHopper[_0xf0d8('0x11')](_0x4bdd4c,!![]))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x12')));}exports[_0xf0d8('0x13')]=function(_0x48b95f){return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](cmHopperBlack[_0xf0d8('0x13')](_0x48b95f))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x14')));};exports[_0xf0d8('0x15')]=function(_0x254437){return BPromise['resolve']()[_0xf0d8('0xd')](cmHopper[_0xf0d8('0x15')](_0x254437))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x16')));};exports['createHistory']=function(_0x340f45,_0x37a29a){create(_0x340f45)[_0xf0d8('0xf')](loggerCatch(_0x37a29a));moveContact(_0x340f45)[_0xf0d8('0xf')](loggerCatch(_0x37a29a));};exports[_0xf0d8('0x17')]=function(_0x7ec35b,_0x3f7593){createAgent(_0x7ec35b)[_0xf0d8('0xf')](loggerCatch(_0x3f7593));};exports[_0xf0d8('0x18')]=function(_0x31c72b,_0x533f9a){create(_0x31c72b)[_0xf0d8('0xf')](loggerCatch(_0x533f9a));};exports[_0xf0d8('0x19')]=function(_0xa2e022,_0x1d2ddd){moveContact(_0xa2e022)[_0xf0d8('0xf')](loggerCatch(_0x1d2ddd));};exports[_0xf0d8('0x1a')]=function(_0x2258c9,_0x30710c,_0x38afd9){if(_0x30710c){_0x2258c9[_0xf0d8('0x1b')]=null;}if(_0x38afd9){_0x2258c9[_0xf0d8('0x1c')]=![];}return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](cmHopper[_0xf0d8('0x1a')](_0x2258c9))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x1d')));};exports[_0xf0d8('0x1e')]=function(_0x2f0f15){return BPromise['resolve']()[_0xf0d8('0xd')](cmHopper[_0xf0d8('0x1e')](_0x2f0f15))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x1f')));};exports[_0xf0d8('0x20')]=function(_0x17cfab){return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](cmHopper[_0xf0d8('0x20')]({'UserId':null},_0x17cfab,0x1))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x21')));};exports['disableContact']=function(_0xd95bc5){return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](cmHopper[_0xf0d8('0x20')]({'active':![]},_0xd95bc5,0x1))['catch'](loggerCatch(_0xf0d8('0x22')));};exports['crateCustomerReportQueue']=function(_0x45d22a){var _0x20ed81={};_0x20ed81[_0xf0d8('0x23')]=_0x45d22a[_0xf0d8('0x23')];_0x20ed81[_0xf0d8('0x24')]=_0x45d22a['uniqueid'];_0x20ed81[_0xf0d8('0x25')]=_0x45d22a[_0xf0d8('0x25')];_0x20ed81['calleridname']=_0x45d22a[_0xf0d8('0x26')];_0x20ed81[_0xf0d8('0x27')]=_0x45d22a[_0xf0d8('0x27')];_0x20ed81[_0xf0d8('0x28')]=_0x45d22a[_0xf0d8('0x29')];_0x20ed81[_0xf0d8('0x2a')]=_0x45d22a[_0xf0d8('0x29')];_0x20ed81[_0xf0d8('0x2b')]=0x1;_0x20ed81[_0xf0d8('0x2c')]=_0x45d22a[_0xf0d8('0x2d')];_0x20ed81['connectedlinename']=_0x45d22a['membername'];_0x20ed81[_0xf0d8('0x2e')]=_0xf0d8('0x2f');_0x20ed81['exten']=_0xf0d8('0x30');_0x20ed81['holdtime']=0x0;_0x20ed81[_0xf0d8('0x31')]=0x1;_0x20ed81['lastAssignedTo']=_0x45d22a[_0xf0d8('0x32')];_0x20ed81['queuecallerexitreason']=_0xf0d8('0x33');return BPromise['resolve']()[_0xf0d8('0xd')](voiceQueueReport[_0xf0d8('0x34')](_0x20ed81))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x35')));};exports[_0xf0d8('0x36')]=function(_0x59c573,_0x535dd3){return BPromise['resolve']()[_0xf0d8('0xd')](cmHopper[_0xf0d8('0x36')](_0x59c573,_0x535dd3))[_0xf0d8('0xf')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x98a9ac){return BPromise[_0xf0d8('0xc')]()[_0xf0d8('0xd')](cmHopper['rescheduleContact'](_0x98a9ac,!![],!![]))[_0xf0d8('0xf')](loggerCatch(_0xf0d8('0x37')));}; \ No newline at end of file +var _0x14fd=['createAgentHistory','createCustomerHistory','rescheduleContact','UserId','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview'];(function(_0x5c43f7,_0x5a30f3){var _0x1003fe=function(_0x2ef50c){while(--_0x2ef50c){_0x5c43f7['push'](_0x5c43f7['shift']());}};_0x1003fe(++_0x5a30f3);}(_0x14fd,0x19c));var _0xd14f=function(_0x40038b,_0x3b59bf){_0x40038b=_0x40038b-0x0;var _0x12c873=_0x14fd[_0x40038b];return _0x12c873;};'use strict';var util=require(_0xd14f('0x0'));var BPromise=require(_0xd14f('0x1'));var logger=require(_0xd14f('0x2'))('preview');var _=require('lodash');var cmHopper=require(_0xd14f('0x3'));var cmHopperFinal=require(_0xd14f('0x4'));var cmHopperHistory=require(_0xd14f('0x5'));var cmHopperBlack=require(_0xd14f('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xd14f('0x7'));var voiceQueueReport=require(_0xd14f('0x8'));function loggerCatch(_0x4b4957){return function(_0x4e6b37){logger[_0xd14f('0x9')](_0x4b4957,util[_0xd14f('0xa')](_0x4e6b37,{'showHidden':![],'depth':null}));};}function create(_0x95e49){return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](cmHopperHistory[_0xd14f('0xd')](_0x95e49))[_0xd14f('0xe')](loggerCatch(_0xd14f('0xf')));}function createAgent(_0x35a054){return BPromise[_0xd14f('0xb')]()['then'](agentReportPreview[_0xd14f('0xd')](_0x35a054))[_0xd14f('0xe')](loggerCatch(_0xd14f('0xf')));}function moveContact(_0x5500c8){return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](cmHopper[_0xd14f('0x10')](_0x5500c8,!![]))['catch'](loggerCatch(_0xd14f('0x11')));}exports[_0xd14f('0x12')]=function(_0x506a7c){return BPromise['resolve']()[_0xd14f('0xc')](cmHopperBlack[_0xd14f('0x12')](_0x506a7c))[_0xd14f('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xd14f('0x13')]=function(_0x648e6){return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](cmHopper[_0xd14f('0x13')](_0x648e6))[_0xd14f('0xe')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x2d88f6,_0x53c2c5){create(_0x2d88f6)['catch'](loggerCatch(_0x53c2c5));moveContact(_0x2d88f6)['catch'](loggerCatch(_0x53c2c5));};exports[_0xd14f('0x14')]=function(_0x544d30,_0x2c406e){createAgent(_0x544d30)[_0xd14f('0xe')](loggerCatch(_0x2c406e));};exports[_0xd14f('0x15')]=function(_0x49997c,_0x452d14){create(_0x49997c)[_0xd14f('0xe')](loggerCatch(_0x452d14));};exports['createCustomerFinal']=function(_0x59ea80,_0x38381a){moveContact(_0x59ea80)[_0xd14f('0xe')](loggerCatch(_0x38381a));};exports[_0xd14f('0x16')]=function(_0xabeb9,_0x249a74,_0x1cafb7){if(_0x249a74){_0xabeb9[_0xd14f('0x17')]=null;}if(_0x1cafb7){_0xabeb9['active']=![];}return BPromise['resolve']()[_0xd14f('0xc')](cmHopper[_0xd14f('0x16')](_0xabeb9))[_0xd14f('0xe')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xd14f('0x18')]=function(_0x8c8f6b){return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](cmHopper[_0xd14f('0x18')](_0x8c8f6b))[_0xd14f('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0xd14f('0x19')]=function(_0x565139){return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](cmHopper[_0xd14f('0x19')]({'UserId':null},_0x565139,0x1))[_0xd14f('0xe')](loggerCatch(_0xd14f('0x1a')));};exports['disableContact']=function(_0x254b7d){return BPromise[_0xd14f('0xb')]()['then'](cmHopper['unlockContact']({'active':![]},_0x254b7d,0x1))[_0xd14f('0xe')](loggerCatch(_0xd14f('0x1b')));};exports[_0xd14f('0x1c')]=function(_0x77dc9a){var _0x2f6506={};_0x2f6506[_0xd14f('0x1d')]=_0x77dc9a[_0xd14f('0x1d')];_0x2f6506[_0xd14f('0x1e')]=_0x77dc9a[_0xd14f('0x1e')];_0x2f6506[_0xd14f('0x1f')]=_0x77dc9a['calleridnum'];_0x2f6506[_0xd14f('0x20')]=_0x77dc9a[_0xd14f('0x20')];_0x2f6506[_0xd14f('0x21')]=_0x77dc9a[_0xd14f('0x21')];_0x2f6506[_0xd14f('0x22')]=_0x77dc9a[_0xd14f('0x23')];_0x2f6506['queuecallerleaveAt']=_0x77dc9a[_0xd14f('0x23')];_0x2f6506[_0xd14f('0x24')]=0x1;_0x2f6506[_0xd14f('0x25')]=_0x77dc9a[_0xd14f('0x26')];_0x2f6506[_0xd14f('0x27')]=_0x77dc9a[_0xd14f('0x28')];_0x2f6506['context']=_0xd14f('0x29');_0x2f6506[_0xd14f('0x2a')]=_0xd14f('0x2b');_0x2f6506[_0xd14f('0x2c')]=0x0;_0x2f6506[_0xd14f('0x2d')]=0x1;_0x2f6506['lastAssignedTo']=_0x77dc9a[_0xd14f('0x28')];_0x2f6506[_0xd14f('0x2e')]=_0xd14f('0x2f');return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](voiceQueueReport[_0xd14f('0x30')](_0x2f6506))['catch'](loggerCatch(_0xd14f('0x31')));};exports[_0xd14f('0x32')]=function(_0x4fd91c,_0x4b3869){return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](cmHopper['getContactRecallMe'](_0x4fd91c,_0x4b3869))['catch'](loggerCatch(_0xd14f('0x33')));};exports[_0xd14f('0x34')]=function(_0x621f19){return BPromise[_0xd14f('0xb')]()[_0xd14f('0xc')](cmHopper[_0xd14f('0x16')](_0x621f19,!![],!![]))[_0xd14f('0xe')](loggerCatch(_0xd14f('0x35')));}; \ 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 23f1bce..7156ffd 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 _0xbf33=['extractCalleridNumber','util','moment','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','add','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildAcw','agentReadyId','status','createBody','filterKey','idContact','campaigntype','active','scheduledat','countglobal','callback','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','match'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbf33,0x196));var _0x3bf3=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xbf33[_0xea8947];return _0x2455e9;};'use strict';var util=require(_0x3bf3('0x0'));var _=require('lodash');var moment=require(_0x3bf3('0x1'));var logger=require(_0x3bf3('0x2'))(_0x3bf3('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x3bf3('0x4');function getSeconds(_0x260d7f,_0xb2ff8d){var _0x42ff12=moment(_0x260d7f)[_0x3bf3('0x5')](0x0);var _0x3e3b58=moment(_0xb2ff8d)[_0x3bf3('0x5')](0x0);return _0x42ff12[_0x3bf3('0x6')](_0x3e3b58,_0x3bf3('0x7'));}exports[_0x3bf3('0x8')]=function(_0x100f5d){return function(_0x3e9809){logger[_0x3bf3('0x9')](_0x100f5d,util[_0x3bf3('0xa')](_0x3e9809,{'showHidden':![],'depth':null}));};};exports[_0x3bf3('0xb')]=function(_0x334e29,_0x584e8e){logger[_0x3bf3('0xc')](_0x334e29,util['inspect'](_0x584e8e,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x59ef61,_0x2d9f61){logger[_0x3bf3('0x9')](_0x59ef61,util[_0x3bf3('0xa')](_0x2d9f61,{'showHidden':![],'depth':null}));};exports[_0x3bf3('0xd')]=function(_0x72dfd5){return function(_0x3fa310){logger[_0x3bf3('0xc')](_0x72dfd5,util[_0x3bf3('0xa')](_0x3fa310,{'showHidden':![],'depth':null}));};};exports[_0x3bf3('0xe')]=function(_0x5def3f,_0x199648,_0x24b887){return{'message':_0x5def3f,'unlock':_0x199648,'active':_0x24b887};};exports[_0x3bf3('0xf')]=function(_0x409f7a,_0x400eee,_0x76ffb8){if(!_[_0x3bf3('0x10')](_0x76ffb8)&&_0x3bf3('0x11')===typeof _0x76ffb8&&!_[_0x3bf3('0x12')](_0x76ffb8)){if(!_['isUndefined'](_0x400eee)&&_0x3bf3('0x11')===typeof _0x400eee&&!_[_0x3bf3('0x12')](_0x400eee)){return util['format']('\x22%s\x22\x20<%s>',_0x400eee,_0x76ffb8);}return util[_0x3bf3('0x13')](_0x3bf3('0x14'),_0x76ffb8,_0x76ffb8);}if(!_[_0x3bf3('0x10')](_0x409f7a)&&_0x3bf3('0x11')===typeof _0x409f7a&&!_['isEmpty'](_0x409f7a)){return _0x409f7a;}return _0x3bf3('0x15');};exports['isActive']=function(_0x527673){if(_[_0x3bf3('0x16')](_0x527673)){return![];}return _0x527673;};exports[_0x3bf3('0x17')]=function(_0x31b8ac,_0x37a86e,_0x35ee49,_0x4767bc,_0x48df85,_0x221bc0){var _0x3183e3={'XMD-QUEUE':_0x37a86e[_0x3bf3('0x18')]?_0x37a86e['Queue'][_0x3bf3('0x19')]:'','XMD-CALLERID':_0x4767bc,'XMD-CALLERID-PREVIEW':_0x221bc0?util[_0x3bf3('0x13')](_0x3bf3('0x14'),_0x221bc0[_0x3bf3('0x1a')],_0x221bc0[_0x3bf3('0x1b')]):_0x4767bc,'XMD-DIALID':_0x48df85,'XMD-CONTACTID':_0x37a86e[_0x3bf3('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4767bc,'XMD-VOICEQUEUEID':_0x37a86e['VoiceQueueId'],'XMD-DIALCHANNEL':_0x35ee49,'XMD-DIALTIMEOUT':_0x31b8ac[_0x3bf3('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x3bf3('0x13')](_0x3bf3('0x1e'),_0x31b8ac[_0x3bf3('0x1f')]?'g':'',_['isEmpty'](_0x31b8ac[_0x3bf3('0x20')])?'':_0x3bf3('0x21')),'XMD-DIALURL':_0x31b8ac['dialPreviewUrl']||'','XMD-AGI':_0x31b8ac[_0x3bf3('0x22')]?util['format'](_0x3bf3('0x23'),ipAgi,_0x31b8ac['dialQueueProject']):_0x3bf3('0x24'),'XMD-AGIAFTER':_0x31b8ac[_0x3bf3('0x1f')]?util[_0x3bf3('0x13')](_0x3bf3('0x23'),ipAgi,_0x31b8ac[_0x3bf3('0x1f')]):_0x3bf3('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x221bc0?_0x221bc0[_0x3bf3('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x221bc0?_0x221bc0[_0x3bf3('0x26')]:'','XMD-DESTINATION':_0x3bf3('0x27'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x3bf3('0x12')](_0x31b8ac[_0x3bf3('0x20')])){_0x3183e3[util['format']('%s',_0x3bf3('0x28'))]=_0x31b8ac[_0x3bf3('0x20')];_0x3183e3[util[_0x3bf3('0x13')]('%s',_0x3bf3('0x29'))]=_0x48df85;}if(_0x37a86e&&_0x37a86e[_0x3bf3('0x2a')]){for(var _0x9d7bd7 in _0x37a86e[_0x3bf3('0x2a')]){if(_0x37a86e[_0x3bf3('0x2a')][_0x3bf3('0x2b')](_0x9d7bd7)){if(!_[_0x3bf3('0x16')](_0x37a86e[_0x3bf3('0x2a')][_0x9d7bd7])&&_0x9d7bd7!=='id'&&_0x9d7bd7!==_0x3bf3('0x2c')&&_0x9d7bd7!==_0x3bf3('0x2d')&&_0x9d7bd7!=='updatedAt'){_0x3183e3[util['format']('%s%s',_0x3bf3('0x2e'),_[_0x3bf3('0x2f')](_0x9d7bd7))]=_0x37a86e['Contact'][_0x9d7bd7];}}}}return _0x3183e3;};exports[_0x3bf3('0x30')]=function(_0x10adb8){var _0x325e6d={};for(var _0x1baf46 in _0x10adb8){if(_0x10adb8[_0x3bf3('0x2b')](_0x1baf46)){_0x325e6d[util['format']('%s',_[_0x3bf3('0x31')](_0x1baf46))]=_0x10adb8[_0x1baf46];}}return{'variables':_0x325e6d};};exports[_0x3bf3('0x32')]=function(_0x4a050a,_0x43e9db){if(!_[_0x3bf3('0x16')](_0x4a050a)){if(_0x4a050a[_0x3bf3('0x2b')](_0x3bf3('0x33'))){if(_0x4a050a[_0x3bf3('0x33')]>0x0){_0x4a050a['originated']-=0x1;}else{logger[_0x3bf3('0x9')](_0x3bf3('0x34'),_0x43e9db);}}}else{logger[_0x3bf3('0x9')](_0x3bf3('0x35'),_0x43e9db);}};exports[_0x3bf3('0x36')]=function(_0xaf8040){var _0x21267c=moment()[_0x3bf3('0x13')](_0x3bf3('0x37'));_0xaf8040[_0x3bf3('0x38')]=0xd;_0xaf8040[_0x3bf3('0x39')]=_0x3bf3('0x3a');_0xaf8040[_0x3bf3('0x3b')]=_0x21267c;_0xaf8040[_0x3bf3('0x3c')]=_0x21267c;_0xaf8040[_0x3bf3('0x3d')]=_0x21267c;};exports[_0x3bf3('0x3e')]=function(_0x1a5369,_0x4b0188,_0x3d6de4){var _0x53df61=moment()[_0x3bf3('0x13')](_0x3bf3('0x37'));_0x1a5369[_0x3bf3('0x38')]=_0x4b0188;_0x1a5369[_0x3bf3('0x39')]=_0x3d6de4;_0x1a5369['responsetime']=_0x53df61;_0x1a5369[_0x3bf3('0x3f')]=getSeconds(_0x1a5369[_0x3bf3('0x3c')],_0x1a5369['starttime']);};exports[_0x3bf3('0x40')]=function(_0x9b0488,_0x23d5de,_0x56789f){_0x9b0488[_0x3bf3('0x41')]=_0x23d5de;_0x9b0488[_0x3bf3('0x42')]=_0x56789f;};exports[_0x3bf3('0x43')]=function(_0x513a0b,_0x210b58,_0x476c56){var _0x595877=moment()['format'](_0x3bf3('0x37'));_0x513a0b[_0x3bf3('0x38')]=_0x210b58;_0x513a0b['statedesc']=_0x476c56;_0x513a0b['responsetime']=_0x513a0b[_0x3bf3('0x3c')]?_0x513a0b[_0x3bf3('0x3c')]:_0x595877;_0x513a0b[_0x3bf3('0x3d')]=_0x513a0b[_0x3bf3('0x3d')]?_0x513a0b[_0x3bf3('0x3d')]:_0x595877;_0x513a0b[_0x3bf3('0x3f')]=getSeconds(_0x513a0b[_0x3bf3('0x3c')]||0x0,_0x513a0b[_0x3bf3('0x3b')]||0x0);_0x513a0b[_0x3bf3('0x44')]=_0x513a0b[_0x3bf3('0x45')]?getSeconds(_0x513a0b[_0x3bf3('0x3d')],_0x513a0b[_0x3bf3('0x45')]):0x0;};exports['isFailure']=function(_0x362c02){return _0x362c02===_0x3bf3('0x46');};exports['variablesAction']=function(_0x42c7ff,_0xce1d46,_0x3cf411,_0x3bf5ff,_0x223f74){var _0xd83213=_0x3bf5ff?_0x3bf3('0x47'):_0x42c7ff[_0x3bf3('0x1a')];_0xd83213=_0x223f74?_0x3bf3('0x48'):_0xd83213;return{'actionid':_0x42c7ff[_0x3bf3('0x49')],'action':_0x3bf3('0x4a'),'channel':_0x42c7ff[_0x3bf3('0x4b')],'callerid':util[_0x3bf3('0x13')](_0x3bf3('0x14'),_0xd83213,_0x42c7ff[_0x3bf3('0x1b')]),'Exten':_0x3bf3('0x27'),'Context':_0x3bf3('0x4c'),'Priority':'1','variable':_0x3cf411,'timeout':(_0xce1d46[_0x3bf3('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x42c7ff['uniqueid']};};exports[_0x3bf3('0x4e')]=function(_0x3720d8){return _0x3720d8['countbusyretry']+_0x3720d8[_0x3bf3('0x4f')]+_0x3720d8[_0x3bf3('0x50')]+_0x3720d8[_0x3bf3('0x51')]+_0x3720d8[_0x3bf3('0x52')];};exports['cloneAction']=function(_0x43870f){var _0x506563=_[_0x3bf3('0x53')](_0x43870f);_0x506563[_0x3bf3('0x38')]=0xf;_0x506563[_0x3bf3('0x39')]='Global';return _0x506563;};exports[_0x3bf3('0x54')]=function(_0x91a87f,_0x1319fd,_0x560983){var _0xbbd238={};_0xbbd238[_0x1319fd]=_0x91a87f[_0x1319fd];_0xbbd238['active']=![];_0xbbd238['scheduledat']=moment()[_0x3bf3('0x55')](_0x560983,'minutes')['format'](_0x3bf3('0x37'));_0xbbd238[_0x3bf3('0x1c')]=_0x91a87f[_0x3bf3('0x1c')];_0xbbd238[_0x3bf3('0x56')]=_0x91a87f[_0x3bf3('0x56')];_0xbbd238[_0x3bf3('0x57')]=_0x91a87f['VoiceQueueId']||undefined;return _0xbbd238;};exports['decrementTalkink']=function(_0x42bdbc,_0x25d819){if(!_[_0x3bf3('0x16')](_0x42bdbc)){if(_0x42bdbc['pTalking']>0x0){_0x42bdbc[_0x3bf3('0x58')]-=0x1;}else{logger['error'](_0x25d819,_0x3bf3('0x59'));}}else{logger[_0x3bf3('0x9')](_0x25d819,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x3bf3('0x5a')]=function(_0x42ea87){if(_0x42ea87<=0x0){return!![];}return![];};exports[_0x3bf3('0x5b')]=function(_0x94d130,_0x4e055d,_0x34dda0){_0x94d130[_0x3bf3('0x5c')]=_0x4e055d;_0x94d130[_0x3bf3('0x19')]=_0x94d130[_0x3bf3('0x5d')];_0x94d130[_0x3bf3('0x5e')]=_0x94d130[_0x3bf3('0x4b')];_0x94d130[_0x3bf3('0x5f')]='voice';if(_0x34dda0){_0x94d130[_0x3bf3('0x60')]=_0x34dda0[_0x3bf3('0x60')];}return _0x94d130;};exports[_0x3bf3('0x61')]=function(_0x3daa1c){var _0x4283c5={};_0x4283c5[_0x3bf3('0x5d')]=_0x3daa1c[_0x3bf3('0x5d')];_0x4283c5[_0x3bf3('0x5e')]=_0x3daa1c[_0x3bf3('0x4b')];_0x4283c5['uniqueid']=_0x3daa1c[_0x3bf3('0x49')];return _0x4283c5;};exports[_0x3bf3('0x62')]=function(_0x4057d1){var _0x2d8b31=[];for(var _0x4da7e7 in _0x4057d1){if(_0x4057d1[_0x3bf3('0x2b')](_0x4da7e7)){if(!_[_0x3bf3('0x16')](_0x4057d1[_0x4da7e7])&&_0x4057d1[_0x4da7e7][_0x3bf3('0x38')]==='not_inuse'&&_0x4057d1[_0x4da7e7][_0x3bf3('0x63')]==='reachable'){_0x2d8b31['push'](_0x4057d1[_0x4da7e7]['id']);}}}return _0x2d8b31;};exports['getDiff']=function(_0x5636d7){var _0x325ff5=moment()['milliseconds'](0x0);var _0x27e307=moment(_0x5636d7)[_0x3bf3('0x5')](0x0);return _0x325ff5[_0x3bf3('0x6')](_0x27e307,_0x3bf3('0x7'));};exports[_0x3bf3('0x64')]=function(_0xb01a0d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xb01a0d['ContactId'],'ListId':_0xb01a0d['ListId'],'VoiceQueueId':_0xb01a0d['VoiceQueueId']||undefined,'CampaignId':_0xb01a0d['CampaignId']||undefined};};exports[_0x3bf3('0x65')]=function(_0x470eca){if(_0x470eca===_0x3bf3('0x49')||_0x470eca===_0x3bf3('0x66')||_0x470eca===_0x3bf3('0x5d')||_0x470eca==='type'||_0x470eca===_0x3bf3('0x67')||_0x470eca==='dialAnswer'||_0x470eca===_0x3bf3('0x41')||_0x470eca===_0x3bf3('0x4b')||_0x470eca==='calleridname'||_0x470eca===_0x3bf3('0x68')||_0x470eca==='calleridnum'||_0x470eca===_0x3bf3('0x69')||_0x470eca==='countbusyretry'||_0x470eca===_0x3bf3('0x4f')||_0x470eca===_0x3bf3('0x50')||_0x470eca===_0x3bf3('0x6a')||_0x470eca===_0x3bf3('0x6b')||_0x470eca==='callbackuniqueid'||_0x470eca===_0x3bf3('0x6c')||_0x470eca===_0x3bf3('0x6d')||_0x470eca===_0x3bf3('0x1c')||_0x470eca===_0x3bf3('0x56')||_0x470eca===_0x3bf3('0x42')||_0x470eca===_0x3bf3('0x57')||_0x470eca==='sipcallid'||_0x470eca===_0x3bf3('0x6e')||_0x470eca===_0x3bf3('0x6f')||_0x470eca===_0x3bf3('0x70')||_0x470eca===_0x3bf3('0x71')||_0x470eca==='xmd-dialurl'||_0x470eca===_0x3bf3('0x72')||_0x470eca==='xmd-dialoptions'||_0x470eca===_0x3bf3('0x73')||_0x470eca===_0x3bf3('0x74')||_0x470eca===_0x3bf3('0x75')||_0x470eca===_0x3bf3('0x76')||_0x470eca==='xmd-callerid'||_0x470eca===_0x3bf3('0x77')||_0x470eca==='xmd-agi'||_0x470eca===_0x3bf3('0x78')||_0x470eca===_0x3bf3('0x79')||_0x470eca===_0x3bf3('0x7a')||_0x470eca===_0x3bf3('0x7b')||_0x470eca===_0x3bf3('0x7c')||_0x470eca===_0x3bf3('0x7d')||_0x470eca===_0x3bf3('0x7e')||_0x470eca==='rtpaudioqosrttbridged'||_0x470eca==='rtpaudioqos'||_0x470eca==='rtpaudioqosbridged'||_0x470eca==='rtpaudioqosjitter'||_0x470eca===_0x3bf3('0x7b')||_0x470eca===_0x3bf3('0x7c')||_0x470eca===_0x3bf3('0x7d')||_0x470eca===_0x3bf3('0x7e')||_0x470eca==='rtpaudioqosrttbridged'||_0x470eca===_0x3bf3('0x7f')||_0x470eca==='bridgepvtcallid'||_0x470eca===_0x3bf3('0x38')||_0x470eca==='statedesc'){return![];}return!![];};exports[_0x3bf3('0x80')]=function(_0x3eb6e2,_0x4a0471){var _0x3c84ff,_0x300eb4,_0x21871;if(_0x4a0471<=0x0){_0x4a0471=0x1;}_0x3c84ff=new RegExp(_0x3bf3('0x81')+_0x4a0471+'}$');_0x300eb4=Math['pow'](0xa,_0x4a0471-0x1);_0x21871=Math['pow'](0xa,_0x4a0471)-0x1;return util[_0x3bf3('0x13')]('%s',_[_0x3bf3('0x82')](_0x3eb6e2,_0x3c84ff,_[_0x3bf3('0x83')](_0x300eb4,_0x21871)));};exports[_0x3bf3('0x84')]=function(_0xd26b1e){var _0x3621e9=_0xd26b1e[_0x3bf3('0x85')](/"(.*?)"/);return _0x3621e9?_0x3621e9[0x1]:_0xd26b1e;};exports[_0x3bf3('0x86')]=function(_0x3810cc){var _0x2bc356=_0x3810cc[_0x3bf3('0x85')](/<(.*?)>/);return _0x2bc356?_0x2bc356[0x1]:_0x3810cc;}; \ No newline at end of file +var _0x414b=['callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','responsetime','endtime','state','ringtime','starttime','logLookAgent','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','clone','Global','active','scheduledat','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','motionChannel','voice','buildAcw','agentReadyId','status','reachable','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','countglobal'];(function(_0xed6e6a,_0x1b6b44){var _0x557265=function(_0x348d5e){while(--_0x348d5e){_0xed6e6a['push'](_0xed6e6a['shift']());}};_0x557265(++_0x1b6b44);}(_0x414b,0xb4));var _0xb414=function(_0x359a94,_0xc6279f){_0x359a94=_0x359a94-0x0;var _0x28e9fe=_0x414b[_0x359a94];return _0x28e9fe;};'use strict';var util=require(_0xb414('0x0'));var _=require(_0xb414('0x1'));var moment=require(_0xb414('0x2'));var logger=require(_0xb414('0x3'))(_0xb414('0x4'));var ipAgi=process[_0xb414('0x5')][_0xb414('0x6')]||_0xb414('0x7');function getSeconds(_0x4282a2,_0x4148c2){var _0x53be00=moment(_0x4282a2)[_0xb414('0x8')](0x0);var _0xdf0d54=moment(_0x4148c2)[_0xb414('0x8')](0x0);return _0x53be00[_0xb414('0x9')](_0xdf0d54,_0xb414('0xa'));}exports[_0xb414('0xb')]=function(_0x2abdd1){return function(_0x1f00ec){logger[_0xb414('0xc')](_0x2abdd1,util['inspect'](_0x1f00ec,{'showHidden':![],'depth':null}));};};exports[_0xb414('0xd')]=function(_0x4eb74f,_0x28513a){logger[_0xb414('0xe')](_0x4eb74f,util[_0xb414('0xf')](_0x28513a,{'showHidden':![],'depth':null}));};exports[_0xb414('0x10')]=function(_0x30b79a,_0xcf7b02){logger[_0xb414('0xc')](_0x30b79a,util[_0xb414('0xf')](_0xcf7b02,{'showHidden':![],'depth':null}));};exports[_0xb414('0x11')]=function(_0x5cbe59){return function(_0x4c412b){logger[_0xb414('0xe')](_0x5cbe59,util['inspect'](_0x4c412b,{'showHidden':![],'depth':null}));};};exports[_0xb414('0x12')]=function(_0x463448,_0x3c8cff,_0x12d87f){return{'message':_0x463448,'unlock':_0x3c8cff,'active':_0x12d87f};};exports[_0xb414('0x13')]=function(_0x36367e,_0x418f92,_0x1b9075){if(!_['isUndefined'](_0x1b9075)&&_0xb414('0x14')===typeof _0x1b9075&&!_[_0xb414('0x15')](_0x1b9075)){if(!_[_0xb414('0x16')](_0x418f92)&&_0xb414('0x14')===typeof _0x418f92&&!_[_0xb414('0x15')](_0x418f92)){return util[_0xb414('0x17')](_0xb414('0x18'),_0x418f92,_0x1b9075);}return util[_0xb414('0x17')](_0xb414('0x18'),_0x1b9075,_0x1b9075);}if(!_[_0xb414('0x16')](_0x36367e)&&_0xb414('0x14')===typeof _0x36367e&&!_['isEmpty'](_0x36367e)){return _0x36367e;}return _0xb414('0x19');};exports[_0xb414('0x1a')]=function(_0x4522b6){if(_[_0xb414('0x1b')](_0x4522b6)){return![];}return _0x4522b6;};exports['addVariables']=function(_0x571e48,_0x155bbb,_0x526b12,_0x49f517,_0x1b0026,_0x59efc6){var _0x308756={'XMD-QUEUE':_0x155bbb['Queue']?_0x155bbb[_0xb414('0x1c')][_0xb414('0x1d')]:'','XMD-CALLERID':_0x49f517,'XMD-CALLERID-PREVIEW':_0x59efc6?util[_0xb414('0x17')](_0xb414('0x18'),_0x59efc6[_0xb414('0x1e')],_0x59efc6[_0xb414('0x1f')]):_0x49f517,'XMD-DIALID':_0x1b0026,'XMD-CONTACTID':_0x155bbb[_0xb414('0x20')],'XMD-CDRTYPE':_0xb414('0x21'),'CALLERID(all)':_0x49f517,'XMD-VOICEQUEUEID':_0x155bbb[_0xb414('0x22')],'XMD-DIALCHANNEL':_0x526b12,'XMD-DIALTIMEOUT':_0x571e48[_0xb414('0x23')]||0x1e,'XMD-DIALOPTIONS':util[_0xb414('0x17')]('\x22rtTxX%s%s\x22',_0x571e48[_0xb414('0x24')]?'g':'',_[_0xb414('0x15')](_0x571e48['monitor_format'])?'':_0xb414('0x25')),'XMD-DIALURL':_0x571e48[_0xb414('0x26')]||'','XMD-AGI':_0x571e48[_0xb414('0x27')]?util[_0xb414('0x17')](_0xb414('0x28'),ipAgi,_0x571e48[_0xb414('0x27')]):'NONE','XMD-AGIAFTER':_0x571e48['dialQueueProject2']?util[_0xb414('0x17')](_0xb414('0x28'),ipAgi,_0x571e48[_0xb414('0x24')]):_0xb414('0x29'),'XMD-ORIGINATECALLERIDNUM':_0x59efc6?_0x59efc6['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x59efc6?_0x59efc6[_0xb414('0x2a')]:'','XMD-DESTINATION':_0xb414('0x2b'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xb414('0x15')](_0x571e48['monitor_format'])){_0x308756[util[_0xb414('0x17')]('%s',_0xb414('0x2c'))]=_0x571e48['monitor_format'];_0x308756[util[_0xb414('0x17')]('%s',_0xb414('0x2d'))]=_0x1b0026;}if(_0x155bbb&&_0x155bbb[_0xb414('0x2e')]){for(var _0x2abfde in _0x155bbb[_0xb414('0x2e')]){if(_0x155bbb['Contact'][_0xb414('0x2f')](_0x2abfde)){if(!_[_0xb414('0x1b')](_0x155bbb['Contact'][_0x2abfde])&&_0x2abfde!=='id'&&_0x2abfde!==_0xb414('0x30')&&_0x2abfde!==_0xb414('0x31')&&_0x2abfde!=='updatedAt'){_0x308756[util['format'](_0xb414('0x32'),'XMD-',_[_0xb414('0x33')](_0x2abfde))]=_0x155bbb['Contact'][_0x2abfde];}}}}return _0x308756;};exports[_0xb414('0x34')]=function(_0x2517e4){var _0x665216={};for(var _0x48a490 in _0x2517e4){if(_0x2517e4[_0xb414('0x2f')](_0x48a490)){_0x665216[util[_0xb414('0x17')]('%s',_[_0xb414('0x35')](_0x48a490))]=_0x2517e4[_0x48a490];}}return{'variables':_0x665216};};exports[_0xb414('0x36')]=function(_0x499897,_0x51a43a){if(!_[_0xb414('0x1b')](_0x499897)){if(_0x499897[_0xb414('0x2f')]('originated')){if(_0x499897[_0xb414('0x37')]>0x0){_0x499897[_0xb414('0x37')]-=0x1;}else{logger[_0xb414('0xc')](_0xb414('0x38'),_0x51a43a);}}}else{logger['error'](_0xb414('0x39'),_0x51a43a);}};exports[_0xb414('0x3a')]=function(_0x30175f){var _0x43e175=moment()[_0xb414('0x17')]('YYYY-MM-DD\x20HH:mm:ss');_0x30175f['state']=0xd;_0x30175f[_0xb414('0x3b')]='Blacklist';_0x30175f['starttime']=_0x43e175;_0x30175f[_0xb414('0x3c')]=_0x43e175;_0x30175f[_0xb414('0x3d')]=_0x43e175;};exports['logAgent']=function(_0x6bad5,_0x2b5b07,_0x4fd36e){var _0x485338=moment()[_0xb414('0x17')]('YYYY-MM-DD\x20HH:mm:ss');_0x6bad5[_0xb414('0x3e')]=_0x2b5b07;_0x6bad5[_0xb414('0x3b')]=_0x4fd36e;_0x6bad5[_0xb414('0x3c')]=_0x485338;_0x6bad5[_0xb414('0x3f')]=getSeconds(_0x6bad5['responsetime'],_0x6bad5[_0xb414('0x40')]);};exports[_0xb414('0x41')]=function(_0x10959c,_0x3ca683,_0x2c6632){_0x10959c['membername']=_0x3ca683;_0x10959c['UserId']=_0x2c6632;};exports[_0xb414('0x42')]=function(_0x7f66e5,_0x3c2b3c,_0x49281f){var _0x169567=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x7f66e5[_0xb414('0x3e')]=_0x3c2b3c;_0x7f66e5[_0xb414('0x3b')]=_0x49281f;_0x7f66e5[_0xb414('0x3c')]=_0x7f66e5[_0xb414('0x3c')]?_0x7f66e5[_0xb414('0x3c')]:_0x169567;_0x7f66e5[_0xb414('0x3d')]=_0x7f66e5['endtime']?_0x7f66e5[_0xb414('0x3d')]:_0x169567;_0x7f66e5[_0xb414('0x3f')]=getSeconds(_0x7f66e5[_0xb414('0x3c')]||0x0,_0x7f66e5[_0xb414('0x40')]||0x0);_0x7f66e5[_0xb414('0x43')]=_0x7f66e5['answertime']?getSeconds(_0x7f66e5[_0xb414('0x3d')],_0x7f66e5[_0xb414('0x44')]):0x0;};exports[_0xb414('0x45')]=function(_0x2e2d95){return _0x2e2d95===_0xb414('0x46');};exports[_0xb414('0x47')]=function(_0x2f36e2,_0x300fe8,_0x599b40,_0x58d3c2,_0x352e3e){var _0x270657=_0x58d3c2?_0xb414('0x48'):_0x2f36e2[_0xb414('0x1e')];_0x270657=_0x352e3e?_0xb414('0x49'):_0x270657;return{'actionid':_0x2f36e2[_0xb414('0x4a')],'action':'originate','channel':_0x2f36e2[_0xb414('0x4b')],'callerid':util[_0xb414('0x17')](_0xb414('0x18'),_0x270657,_0x2f36e2[_0xb414('0x1f')]),'Exten':_0xb414('0x2b'),'Context':_0xb414('0x4c'),'Priority':'1','variable':_0x599b40,'timeout':(_0x300fe8['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2f36e2[_0xb414('0x4a')]};};exports[_0xb414('0x4d')]=function(_0x3355ba){return _0x3355ba[_0xb414('0x4e')]+_0x3355ba[_0xb414('0x4f')]+_0x3355ba[_0xb414('0x50')]+_0x3355ba[_0xb414('0x51')]+_0x3355ba['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4e29da){var _0x395779=_[_0xb414('0x52')](_0x4e29da);_0x395779[_0xb414('0x3e')]=0xf;_0x395779[_0xb414('0x3b')]=_0xb414('0x53');return _0x395779;};exports['scheduledAt']=function(_0x58eede,_0x52e0e6,_0x5513ba){var _0x4faae5={};_0x4faae5[_0x52e0e6]=_0x58eede[_0x52e0e6];_0x4faae5[_0xb414('0x54')]=![];_0x4faae5[_0xb414('0x55')]=moment()[_0xb414('0x56')](_0x5513ba,_0xb414('0x57'))[_0xb414('0x17')](_0xb414('0x58'));_0x4faae5['ContactId']=_0x58eede[_0xb414('0x20')];_0x4faae5[_0xb414('0x59')]=_0x58eede[_0xb414('0x59')];_0x4faae5[_0xb414('0x22')]=_0x58eede[_0xb414('0x22')]||undefined;return _0x4faae5;};exports[_0xb414('0x5a')]=function(_0x4d5551,_0x33a826){if(!_['isNil'](_0x4d5551)){if(_0x4d5551[_0xb414('0x5b')]>0x0){_0x4d5551[_0xb414('0x5b')]-=0x1;}else{logger[_0xb414('0xc')](_0x33a826,_0xb414('0x5c'));}}else{logger[_0xb414('0xc')](_0x33a826,_0xb414('0x5d'));}};exports['IsNotLoggedIn']=function(_0x5107d3){if(_0x5107d3<=0x0){return!![];}return![];};exports[_0xb414('0x5e')]=function(_0x57aed3,_0x4c3df9,_0xcae14b){_0x57aed3[_0xb414('0x5f')]=_0x4c3df9;_0x57aed3[_0xb414('0x1d')]=_0x57aed3[_0xb414('0x60')];_0x57aed3[_0xb414('0x61')]=_0x57aed3[_0xb414('0x4b')];_0x57aed3[_0xb414('0x62')]=_0xb414('0x63');if(_0xcae14b){_0x57aed3['mandatoryDisposition']=_0xcae14b['mandatoryDisposition'];}return _0x57aed3;};exports[_0xb414('0x64')]=function(_0x6a590e){var _0x36a514={};_0x36a514['queue']=_0x6a590e[_0xb414('0x60')];_0x36a514[_0xb414('0x61')]=_0x6a590e[_0xb414('0x4b')];_0x36a514[_0xb414('0x4a')]=_0x6a590e[_0xb414('0x4a')];return _0x36a514;};exports[_0xb414('0x65')]=function(_0x440874){var _0x322784=[];for(var _0x5643db in _0x440874){if(_0x440874[_0xb414('0x2f')](_0x5643db)){if(!_[_0xb414('0x1b')](_0x440874[_0x5643db])&&_0x440874[_0x5643db][_0xb414('0x3e')]==='not_inuse'&&_0x440874[_0x5643db][_0xb414('0x66')]===_0xb414('0x67')){_0x322784[_0xb414('0x68')](_0x440874[_0x5643db]['id']);}}}return _0x322784;};exports[_0xb414('0x69')]=function(_0x306439){var _0x50939b=moment()[_0xb414('0x8')](0x0);var _0x158662=moment(_0x306439)[_0xb414('0x8')](0x0);return _0x50939b[_0xb414('0x9')](_0x158662,_0xb414('0xa'));};exports['createBody']=function(_0xb488e2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xb488e2[_0xb414('0x20')],'ListId':_0xb488e2[_0xb414('0x59')],'VoiceQueueId':_0xb488e2[_0xb414('0x22')]||undefined,'CampaignId':_0xb488e2[_0xb414('0x6a')]||undefined};};exports[_0xb414('0x6b')]=function(_0x1844fa){if(_0x1844fa===_0xb414('0x4a')||_0x1844fa===_0xb414('0x6c')||_0x1844fa===_0xb414('0x60')||_0x1844fa===_0xb414('0x6d')||_0x1844fa===_0xb414('0x6e')||_0x1844fa===_0xb414('0x6f')||_0x1844fa===_0xb414('0x70')||_0x1844fa==='channelAgent'||_0x1844fa===_0xb414('0x1e')||_0x1844fa===_0xb414('0x54')||_0x1844fa===_0xb414('0x1f')||_0x1844fa===_0xb414('0x55')||_0x1844fa==='countbusyretry'||_0x1844fa===_0xb414('0x4f')||_0x1844fa===_0xb414('0x50')||_0x1844fa===_0xb414('0x71')||_0x1844fa===_0xb414('0x72')||_0x1844fa===_0xb414('0x73')||_0x1844fa===_0xb414('0x74')||_0x1844fa===_0xb414('0x75')||_0x1844fa==='ContactId'||_0x1844fa==='ListId'||_0x1844fa===_0xb414('0x76')||_0x1844fa===_0xb414('0x22')||_0x1844fa===_0xb414('0x77')||_0x1844fa===_0xb414('0x78')||_0x1844fa==='xmd-queue'||_0x1844fa===_0xb414('0x79')||_0x1844fa===_0xb414('0x7a')||_0x1844fa==='xmd-dialurl'||_0x1844fa===_0xb414('0x7b')||_0x1844fa==='xmd-dialoptions'||_0x1844fa===_0xb414('0x7c')||_0x1844fa===_0xb414('0x7d')||_0x1844fa===_0xb414('0x7e')||_0x1844fa===_0xb414('0x7f')||_0x1844fa===_0xb414('0x80')||_0x1844fa===_0xb414('0x81')||_0x1844fa===_0xb414('0x82')||_0x1844fa==='rtpaudioqos'||_0x1844fa===_0xb414('0x83')||_0x1844fa===_0xb414('0x84')||_0x1844fa===_0xb414('0x85')||_0x1844fa===_0xb414('0x86')||_0x1844fa===_0xb414('0x87')||_0x1844fa===_0xb414('0x88')||_0x1844fa===_0xb414('0x89')||_0x1844fa==='rtpaudioqos'||_0x1844fa===_0xb414('0x83')||_0x1844fa===_0xb414('0x84')||_0x1844fa===_0xb414('0x85')||_0x1844fa===_0xb414('0x86')||_0x1844fa===_0xb414('0x87')||_0x1844fa===_0xb414('0x88')||_0x1844fa===_0xb414('0x89')||_0x1844fa==='bridgepeer'||_0x1844fa===_0xb414('0x8a')||_0x1844fa==='state'||_0x1844fa===_0xb414('0x3b')){return![];}return!![];};exports[_0xb414('0x8b')]=function(_0x3e608e,_0xe54c72){var _0x125ceb,_0x244d89,_0x6baf06;if(_0xe54c72<=0x0){_0xe54c72=0x1;}_0x125ceb=new RegExp(_0xb414('0x8c')+_0xe54c72+'}$');_0x244d89=Math[_0xb414('0x8d')](0xa,_0xe54c72-0x1);_0x6baf06=Math['pow'](0xa,_0xe54c72)-0x1;return util['format']('%s',_[_0xb414('0x8e')](_0x3e608e,_0x125ceb,_[_0xb414('0x8f')](_0x244d89,_0x6baf06)));};exports[_0xb414('0x90')]=function(_0x3c1b46){var _0x4033ca=_0x3c1b46[_0xb414('0x91')](/"(.*?)"/);return _0x4033ca?_0x4033ca[0x1]:_0x3c1b46;};exports[_0xb414('0x92')]=function(_0x2f3644){var _0x3c32de=_0x2f3644[_0xb414('0x91')](/<(.*?)>/);return _0x3c32de?_0x3c32de[0x1]:_0x2f3644;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 67c3815..b8d25bf 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 _0x351c=['queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean'];(function(_0x2c5907,_0x44fb44){var _0x506d20=function(_0x5f0186){while(--_0x5f0186){_0x2c5907['push'](_0x2c5907['shift']());}};_0x506d20(++_0x44fb44);}(_0x351c,0xd5));var _0xc351=function(_0x30ebd6,_0x3fb39c){_0x30ebd6=_0x30ebd6-0x0;var _0x3d2b30=_0x351c[_0x30ebd6];return _0x3d2b30;};'use strict';exports['queueadd']={'queue':{'type':_0xc351('0x0'),'required':!![]},'interface':{'type':_0xc351('0x0'),'required':!![]},'membername':{'type':_0xc351('0x0'),'required':!![]},'penalty':{'type':_0xc351('0x1'),'required':![]},'paused':{'type':_0xc351('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0xc351('0x0'),'required':!![]},'interface':{'type':_0xc351('0x0'),'required':!![]}};exports[_0xc351('0x3')]={'interface':{'type':_0xc351('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xc351('0x0'),'required':![]}};exports[_0xc351('0x4')]={'module':{'type':'string','required':![]}};exports[_0xc351('0x5')]={'uniqueid':{'type':_0xc351('0x0'),'required':!![]}};exports[_0xc351('0x6')]={'uniqueid':{'type':_0xc351('0x0'),'required':!![]},'filename':{'type':_0xc351('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0xc351('0x0')}};exports[_0xc351('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xc351('0x8')]={'uniqueid':{'type':_0xc351('0x0'),'required':!![]},'exten':{'type':_0xc351('0x0'),'required':!![]},'context':{'type':_0xc351('0x0')}}; \ No newline at end of file +var _0xc681=['queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean'];(function(_0x498b9e,_0x46ae26){var _0x29dd57=function(_0x56f191){while(--_0x56f191){_0x498b9e['push'](_0x498b9e['shift']());}};_0x29dd57(++_0x46ae26);}(_0xc681,0xcc));var _0x1c68=function(_0x41eab3,_0x2949fa){_0x41eab3=_0x41eab3-0x0;var _0x1318a3=_0xc681[_0x41eab3];return _0x1318a3;};'use strict';exports[_0x1c68('0x0')]={'queue':{'type':_0x1c68('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x1c68('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x1c68('0x2'),'required':![]}};exports[_0x1c68('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x1c68('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x1c68('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x1c68('0x1'),'required':![]}};exports[_0x1c68('0x4')]={'module':{'type':_0x1c68('0x1'),'required':![]}};exports[_0x1c68('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x1c68('0x6')]={'uniqueid':{'type':_0x1c68('0x1'),'required':!![]},'filename':{'type':_0x1c68('0x1')},'format':{'type':_0x1c68('0x1')},'mixmonitorid':{'type':_0x1c68('0x1')}};exports[_0x1c68('0x7')]={'uniqueid':{'type':_0x1c68('0x1'),'required':!![]}};exports[_0x1c68('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1c68('0x1'),'required':!![]},'context':{'type':_0x1c68('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index c3898ef..7ae18b2 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 _0xdc43=['outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','telephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','answered','queuecallercompleteAt','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','interface','total','sumHoldTime','sumBillable','isEmpty','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit'];(function(_0x159a12,_0x8795b1){var _0x40d7f9=function(_0x2bb2d8){while(--_0x2bb2d8){_0x159a12['push'](_0x159a12['shift']());}};_0x40d7f9(++_0x8795b1);}(_0xdc43,0x17d));var _0x3dc4=function(_0x5b9204,_0x5ae9ed){_0x5b9204=_0x5b9204-0x0;var _0x37b464=_0xdc43[_0x5b9204];return _0x37b464;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3dc4('0x0'));var moment=require(_0x3dc4('0x1'));var Agent=require(_0x3dc4('0x2'));var Telephone=require(_0x3dc4('0x3'));var Trunk=require(_0x3dc4('0x4'));var VoiceQueue=require(_0x3dc4('0x5'));var Trigger=require(_0x3dc4('0x6'));var Template=require(_0x3dc4('0x7'));var Campaign=require(_0x3dc4('0x8'));var VoiceExtension=require(_0x3dc4('0x9'));var ZendeskAccount=require(_0x3dc4('0xa'));var SalesforceAccount=require(_0x3dc4('0xb'));var FreshdeskAccount=require(_0x3dc4('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x3dc4('0xd'));var DeskAccount=require(_0x3dc4('0xe'));var VtigerAccount=require(_0x3dc4('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x3dc4('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x3dc4('0x11'));var Realtime=function(){this[_0x3dc4('0x12')]={};this['telephones']={};this[_0x3dc4('0x13')]={};this[_0x3dc4('0x14')]={};this[_0x3dc4('0x15')]={};this[_0x3dc4('0x16')]={};this[_0x3dc4('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3dc4('0x18')]={};this[_0x3dc4('0x19')]={};this['queueChannels']={};this[_0x3dc4('0x1a')]={};this[_0x3dc4('0x1b')]={};this[_0x3dc4('0x1c')]={};this[_0x3dc4('0x1d')]={};this[_0x3dc4('0x1e')]={};this[_0x3dc4('0x1f')]={};this[_0x3dc4('0x20')]={};this[_0x3dc4('0x21')]={};this['deskAccounts']={};this[_0x3dc4('0x22')]={};this[_0x3dc4('0x23')]={};this[_0x3dc4('0x24')]={};this[_0x3dc4('0x25')]={};this[_0x3dc4('0x26')]={};};function freeIsNotKey(_0x3e8958,_0x18d592,_0x34799a){var _0x4a3c83=_['mapKeys'](_0x3e8958,function(_0x1b96d0,_0x51b09e){return _0x1b96d0[_0x34799a];});for(var _0x22766b in _0x18d592){if(_0x18d592[_0x3dc4('0x27')](_0x22766b)){if(!_0x4a3c83[_0x22766b]){delete _0x18d592[_0x22766b];}}}}function freeIsNotKeySip(_0x584f3a,_0x29098e){var _0x4cbb7f=_[_0x3dc4('0x28')](_0x584f3a,function(_0x373f06,_0x4c71a9){return util[_0x3dc4('0x29')](_0x3dc4('0x2a'),_0x373f06[_0x3dc4('0x2b')]);});for(var _0x344829 in _0x29098e){if(_0x29098e['hasOwnProperty'](_0x344829)){if(!_0x4cbb7f[_0x344829]){delete _0x29098e[_0x344829];}}}}function freeIsNotKeyAgent(_0xa3210c,_0x15a7ae){var _0x53dfca=_[_0x3dc4('0x28')](_0xa3210c,function(_0x3c88b2,_0x49397e){var _0x42cd07=_['isNil'](_0x3c88b2[_0x3dc4('0x2c')])?util[_0x3dc4('0x29')](_0x3dc4('0x2a'),_0x3c88b2[_0x3dc4('0x2b')]):_0x3c88b2[_0x3dc4('0x2c')];return _0x42cd07;});for(var _0x5e3f5f in _0x15a7ae){if(_0x15a7ae['hasOwnProperty'](_0x5e3f5f)){if(!_0x53dfca[_0x5e3f5f]){delete _0x15a7ae[_0x5e3f5f];}}}}function clearVoiceCallReports(_0x5996b8){_0x5996b8[_0x3dc4('0x2d')]=0x0;_0x5996b8['answered']=0x0;_0x5996b8[_0x3dc4('0x2e')]=0x0;_0x5996b8['sumDuration']=0x0;_0x5996b8[_0x3dc4('0x2f')]=0x0;}function clearCampaigns(_0x597629){if(!_[_0x3dc4('0x30')](_0x597629)){for(var _0x513b1d in _0x597629){if(_0x597629[_0x3dc4('0x27')](_0x513b1d)){_0x597629[_0x513b1d]['ivrTotalCallsDays']=0x0;_0x597629[_0x513b1d]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x259f4a){if(!_[_0x3dc4('0x30')](_0x259f4a)){for(var _0x5f28a5 in _0x259f4a){if(_0x259f4a[_0x3dc4('0x27')](_0x5f28a5)){_0x259f4a[_0x5f28a5][_0x3dc4('0x2d')]=0x0;_0x259f4a[_0x5f28a5]['answered']=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x31')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x32')]=0x0;_0x259f4a[_0x5f28a5]['sumHoldTime']=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x33')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x2f')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x34')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x35')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x36')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x37')]=0x0;_0x259f4a[_0x5f28a5]['outboundNoSuchCallsDay']=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x38')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x39')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x3a')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x3b')]=0x0;_0x259f4a[_0x5f28a5]['outboundOriginateFailureCallsDay']=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x3c')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x3d')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x34')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x3e')]=0x0;_0x259f4a[_0x5f28a5][_0x3dc4('0x3f')]=!![];}}}}Realtime[_0x3dc4('0x40')][_0x3dc4('0x41')]=function(_0x4bbad6,_0xac0cf5){for(var _0x1bb544 in _0xac0cf5){if(_0x4bbad6['hasOwnProperty'](_0x1bb544)){_0x4bbad6[_0x1bb544]=_0xac0cf5[_0x1bb544];}}};Realtime['prototype'][_0x3dc4('0x42')]=function(){var _0x379825=this;return function(_0x25a7f7){if(_0x25a7f7){freeIsNotKeyAgent(_0x25a7f7,_0x379825[_0x3dc4('0x12')]);for(var _0x1a7993=0x0,_0x492643={},_0x7b0dd6={};_0x1a7993<_0x25a7f7[_0x3dc4('0x43')];_0x1a7993+=0x1){_0x492643=_0x25a7f7[_0x1a7993];var _0x21ca78=_[_0x3dc4('0x44')](_0x492643[_0x3dc4('0x2c')])?util[_0x3dc4('0x29')](_0x3dc4('0x2a'),_0x492643[_0x3dc4('0x2b')]):_0x492643['interface'];if(_[_0x3dc4('0x45')](_0x379825[_0x3dc4('0x12')][_0x21ca78])){_0x379825[_0x3dc4('0x12')][_0x21ca78]=new Agent(_0x492643);}else{_0x379825[_0x3dc4('0x41')](_0x379825['agents'][_0x21ca78],_0x492643);}}}return _0x379825[_0x3dc4('0x12')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x46')]=function(){var _0x394dcb=this;return function(_0x5e8c1e){if(_0x5e8c1e){freeIsNotKeySip(_0x5e8c1e,_0x394dcb[_0x3dc4('0x47')]);for(var _0x4a45c8=0x0,_0xcb0663={},_0x3f239c={};_0x4a45c8<_0x5e8c1e[_0x3dc4('0x43')];_0x4a45c8+=0x1){_0xcb0663=_0x5e8c1e[_0x4a45c8];if(_[_0x3dc4('0x45')](_0x394dcb[_0x3dc4('0x47')][util[_0x3dc4('0x29')]('SIP/%s',_0xcb0663['name'])])){_0x394dcb[_0x3dc4('0x47')][util[_0x3dc4('0x29')](_0x3dc4('0x2a'),_0xcb0663[_0x3dc4('0x2b')])]=new Telephone(_0xcb0663);}else{_0x394dcb['mergeFromDatabase'](_0x394dcb[_0x3dc4('0x47')][util[_0x3dc4('0x29')](_0x3dc4('0x2a'),_0xcb0663[_0x3dc4('0x2b')])],_0xcb0663);}}}return _0x394dcb['telephones'];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x48')]=function(){var _0x9c5c01=this;return function(_0x175636){if(_0x175636){freeIsNotKeySip(_0x175636,_0x9c5c01[_0x3dc4('0x13')]);for(var _0x4c9257=0x0,_0x596617={},_0x17f10c={};_0x4c9257<_0x175636[_0x3dc4('0x43')];_0x4c9257+=0x1){_0x596617=_0x175636[_0x4c9257];if(_['isUndefined'](_0x9c5c01[_0x3dc4('0x13')][util[_0x3dc4('0x29')](_0x3dc4('0x2a'),_0x596617['name'])])){_0x9c5c01[_0x3dc4('0x13')][util['format'](_0x3dc4('0x2a'),_0x596617[_0x3dc4('0x2b')])]=new Trunk(_0x596617);}else{_0x9c5c01['mergeFromDatabase'](_0x9c5c01[_0x3dc4('0x13')][util['format'](_0x3dc4('0x2a'),_0x596617[_0x3dc4('0x2b')])],_0x596617);}}}return _0x9c5c01[_0x3dc4('0x13')];};};Realtime['prototype'][_0x3dc4('0x49')]=function(){var _0x32f0db=this;return function(_0x3f815d){if(_0x3f815d){freeIsNotKey(_0x3f815d,_0x32f0db[_0x3dc4('0x14')],'name');for(var _0x31db5a=0x0,_0x1fa8ed={},_0x314f23={};_0x31db5a<_0x3f815d['length'];_0x31db5a+=0x1){_0x1fa8ed=_0x3f815d[_0x31db5a];if(_[_0x3dc4('0x45')](_0x32f0db[_0x3dc4('0x14')][_0x1fa8ed[_0x3dc4('0x2b')]])){_0x32f0db['voiceQueues'][_0x1fa8ed['name']]=new VoiceQueue(_0x1fa8ed);}else{_0x32f0db[_0x3dc4('0x41')](_0x32f0db[_0x3dc4('0x14')][_0x1fa8ed[_0x3dc4('0x2b')]],_0x1fa8ed);}}}return _0x32f0db[_0x3dc4('0x14')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x4a')]=function(){var _0x4e960e=this;return function(_0x4eb8d9){if(_0x4eb8d9){freeIsNotKey(_0x4eb8d9,_0x4e960e[_0x3dc4('0x15')],'id');for(var _0x2356f2=0x0,_0x7943a3={},_0x50ab50={};_0x2356f2<_0x4eb8d9[_0x3dc4('0x43')];_0x2356f2+=0x1){_0x7943a3=_0x4eb8d9[_0x2356f2];if(_[_0x3dc4('0x45')](_0x4e960e[_0x3dc4('0x15')][_0x7943a3['id']])){_0x4e960e[_0x3dc4('0x15')][_0x7943a3['id']]=new Trigger(_0x7943a3);}else{_0x4e960e[_0x3dc4('0x41')](_0x4e960e[_0x3dc4('0x15')][_0x7943a3['id']],_0x7943a3);}}}return _0x4e960e[_0x3dc4('0x15')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x4b')]=function(){var _0x3535b7=this;return function(_0x444a69){if(_0x444a69){freeIsNotKey(_0x444a69,_0x3535b7['templates'],'id');for(var _0x2e1521=0x0,_0x59e906={},_0x43a5ef={};_0x2e1521<_0x444a69[_0x3dc4('0x43')];_0x2e1521+=0x1){_0x59e906=_0x444a69[_0x2e1521];if(_[_0x3dc4('0x45')](_0x3535b7['templates'][_0x59e906['id']])){_0x3535b7[_0x3dc4('0x17')][_0x59e906['id']]=new Template(_0x59e906);}else{_0x3535b7['mergeFromDatabase'](_0x3535b7['templates'][_0x59e906['id']],_0x59e906);}}}return _0x3535b7[_0x3dc4('0x17')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x36fc8c=this;return function(_0x440551){if(_0x440551){freeIsNotKey(_0x440551,_0x36fc8c[_0x3dc4('0x1d')],'id');for(var _0x3d8836=0x0,_0x56eaab={},_0x41b0c8={};_0x3d8836<_0x440551[_0x3dc4('0x43')];_0x3d8836+=0x1){_0x56eaab=_0x440551[_0x3d8836];if(_[_0x3dc4('0x45')](_0x36fc8c[_0x3dc4('0x1d')][_0x56eaab['id']])){_0x36fc8c['zendeskAccounts'][_0x56eaab['id']]=new ZendeskAccount(_0x56eaab);}else{_0x36fc8c[_0x3dc4('0x41')](_0x36fc8c[_0x3dc4('0x1d')][_0x56eaab['id']],_0x56eaab);}}}return _0x36fc8c[_0x3dc4('0x1d')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x4c')]=function(){var _0x5b68f2=this;return function(_0x198e68){if(_0x198e68){freeIsNotKey(_0x198e68,_0x5b68f2['salesforceAccounts'],'id');for(var _0x1a5109=0x0,_0x43ed96={},_0x27e840={};_0x1a5109<_0x198e68[_0x3dc4('0x43')];_0x1a5109+=0x1){_0x43ed96=_0x198e68[_0x1a5109];if(_['isUndefined'](_0x5b68f2[_0x3dc4('0x1e')][_0x43ed96['id']])){_0x5b68f2['salesforceAccounts'][_0x43ed96['id']]=new SalesforceAccount(_0x43ed96);}else{_0x5b68f2[_0x3dc4('0x41')](_0x5b68f2[_0x3dc4('0x1e')][_0x43ed96['id']],_0x43ed96);}}}return _0x5b68f2[_0x3dc4('0x1e')];};};Realtime[_0x3dc4('0x40')]['initFreshdeskAccounts']=function(){var _0x41c02d=this;return function(_0x140484){if(_0x140484){freeIsNotKey(_0x140484,_0x41c02d[_0x3dc4('0x20')],'id');for(var _0x59fb0e=0x0,_0x11c200={},_0x33ca1b={};_0x59fb0e<_0x140484[_0x3dc4('0x43')];_0x59fb0e+=0x1){_0x11c200=_0x140484[_0x59fb0e];if(_['isUndefined'](_0x41c02d[_0x3dc4('0x20')][_0x11c200['id']])){_0x41c02d['freshdeskAccounts'][_0x11c200['id']]=new FreshdeskAccount(_0x11c200);}else{_0x41c02d['mergeFromDatabase'](_0x41c02d['freshdeskAccounts'][_0x11c200['id']],_0x11c200);}}}return _0x41c02d[_0x3dc4('0x20')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x4d')]=function(){var _0x1d3e3a=this;return function(_0x375ab5){if(_0x375ab5){freeIsNotKey(_0x375ab5,_0x1d3e3a[_0x3dc4('0x21')],'id');for(var _0x3b4a94=0x0,_0x5bf22f={},_0x4a16ae={};_0x3b4a94<_0x375ab5[_0x3dc4('0x43')];_0x3b4a94+=0x1){_0x5bf22f=_0x375ab5[_0x3b4a94];if(_[_0x3dc4('0x45')](_0x1d3e3a['zohoAccounts'][_0x5bf22f['id']])){_0x1d3e3a[_0x3dc4('0x21')][_0x5bf22f['id']]=new ZohoAccount(_0x5bf22f);}else{_0x1d3e3a[_0x3dc4('0x41')](_0x1d3e3a['zohoAccounts'][_0x5bf22f['id']],_0x5bf22f);}}}return _0x1d3e3a[_0x3dc4('0x21')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x27404b=this;return function(_0x1d01f0){if(_0x1d01f0){freeIsNotKey(_0x1d01f0,_0x27404b[_0x3dc4('0x4e')],'id');for(var _0x12f283=0x0,_0xb995f={},_0x48eb9d={};_0x12f283<_0x1d01f0[_0x3dc4('0x43')];_0x12f283+=0x1){_0xb995f=_0x1d01f0[_0x12f283];if(_[_0x3dc4('0x45')](_0x27404b[_0x3dc4('0x4e')][_0xb995f['id']])){_0x27404b[_0x3dc4('0x4e')][_0xb995f['id']]=new DeskAccount(_0xb995f);}else{_0x27404b[_0x3dc4('0x41')](_0x27404b[_0x3dc4('0x4e')][_0xb995f['id']],_0xb995f);}}}return _0x27404b['deskAccounts'];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x4f')]=function(){var _0x42716e=this;return function(_0xda19ab){if(_0xda19ab){freeIsNotKey(_0xda19ab,_0x42716e['sugarcrmAccounts'],'id');for(var _0x3b2015=0x0,_0x1fe55f={},_0x55147e={};_0x3b2015<_0xda19ab[_0x3dc4('0x43')];_0x3b2015+=0x1){_0x1fe55f=_0xda19ab[_0x3b2015];if(_[_0x3dc4('0x45')](_0x42716e[_0x3dc4('0x1f')][_0x1fe55f['id']])){_0x42716e['sugarcrmAccounts'][_0x1fe55f['id']]=new SugarcrmAccount(_0x1fe55f);}else{_0x42716e[_0x3dc4('0x41')](_0x42716e[_0x3dc4('0x1f')][_0x1fe55f['id']],_0x1fe55f);}}}return _0x42716e['sugarcrmAccounts'];};};Realtime['prototype'][_0x3dc4('0x50')]=function(){var _0x2d33ff=this;return function(_0x45ea2f){if(_0x45ea2f){freeIsNotKey(_0x45ea2f,_0x2d33ff[_0x3dc4('0x22')],'id');for(var _0x4269d8=0x0,_0x1ea79b={},_0x3be20a={};_0x4269d8<_0x45ea2f[_0x3dc4('0x43')];_0x4269d8+=0x1){_0x1ea79b=_0x45ea2f[_0x4269d8];if(_[_0x3dc4('0x45')](_0x2d33ff[_0x3dc4('0x22')][_0x1ea79b['id']])){_0x2d33ff['vtigerAccounts'][_0x1ea79b['id']]=new VtigerAccount(_0x1ea79b);}else{_0x2d33ff['mergeFromDatabase'](_0x2d33ff['vtigerAccounts'][_0x1ea79b['id']],_0x1ea79b);}}}return _0x2d33ff['vtigerAccounts'];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x51')]=function(){var _0x34f91c=this;return function(_0x279e84){if(_0x279e84){freeIsNotKey(_0x279e84,_0x34f91c[_0x3dc4('0x23')],'id');for(var _0x42f183=0x0,_0x46dda3={},_0xefc817={};_0x42f183<_0x279e84[_0x3dc4('0x43')];_0x42f183+=0x1){_0x46dda3=_0x279e84[_0x42f183];if(_[_0x3dc4('0x45')](_0x34f91c[_0x3dc4('0x23')][_0x46dda3['id']])){_0x34f91c[_0x3dc4('0x23')][_0x46dda3['id']]=new ServicenowAccount(_0x46dda3);}else{_0x34f91c['mergeFromDatabase'](_0x34f91c[_0x3dc4('0x23')][_0x46dda3['id']],_0x46dda3);}}}return _0x34f91c[_0x3dc4('0x23')];};};Realtime[_0x3dc4('0x40')]['initDynamics365Accounts']=function(){var _0x3dd11c=this;return function(_0x31a943){if(_0x31a943){freeIsNotKey(_0x31a943,_0x3dd11c[_0x3dc4('0x24')],'id');for(var _0x3e6c92=0x0,_0x3e34d4={},_0xb6c9b1={};_0x3e6c92<_0x31a943[_0x3dc4('0x43')];_0x3e6c92+=0x1){_0x3e34d4=_0x31a943[_0x3e6c92];if(_['isUndefined'](_0x3dd11c[_0x3dc4('0x24')][_0x3e34d4['id']])){_0x3dd11c[_0x3dc4('0x24')][_0x3e34d4['id']]=new Dynamics365Account(_0x3e34d4);}else{_0x3dd11c[_0x3dc4('0x41')](_0x3dd11c['dynamics365Accounts'][_0x3e34d4['id']],_0x3e34d4);}}}return _0x3dd11c['dynamics365Accounts'];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x52')]=function(){var _0xf65c99=this;return function(_0x2b4dbf){if(_0x2b4dbf){freeIsNotKey(_0x2b4dbf,_0xf65c99['freshsalesAccounts'],'id');for(var _0x5826f5=0x0,_0x540e8e={},_0x691578={};_0x5826f5<_0x2b4dbf[_0x3dc4('0x43')];_0x5826f5+=0x1){_0x540e8e=_0x2b4dbf[_0x5826f5];if(_[_0x3dc4('0x45')](_0xf65c99[_0x3dc4('0x25')][_0x540e8e['id']])){_0xf65c99['freshsalesAccounts'][_0x540e8e['id']]=new FreshsalesAccount(_0x540e8e);}else{_0xf65c99[_0x3dc4('0x41')](_0xf65c99[_0x3dc4('0x25')][_0x540e8e['id']],_0x540e8e);}}}return _0xf65c99[_0x3dc4('0x25')];};};Realtime['prototype'][_0x3dc4('0x53')]=function(){var _0x150ff6=this;return function(_0x13b70e){for(var _0x393630=0x0;_0x393630<_0x13b70e[_0x3dc4('0x43')];_0x393630+=0x1){_[_0x3dc4('0x54')](_0x150ff6[_0x3dc4('0x14')][_0x13b70e[_0x393630][_0x3dc4('0x2b')]],_0x13b70e[_0x393630]);}return _0x150ff6[_0x3dc4('0x14')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x55')]=function(){var _0x24ea80=this;return function(_0x8f9f53){clearVoiceQueues(_0x24ea80[_0x3dc4('0x14')]);if(_0x8f9f53){_0x8f9f53=_[_0x3dc4('0x56')](_0x8f9f53,_0x3dc4('0x57'));for(var _0xbcc02 in _0x8f9f53){if(_0x8f9f53[_0x3dc4('0x27')](_0xbcc02)){var _0xa97512={};for(var _0x7794fd=0x0;_0x7794fd<_0x8f9f53[_0xbcc02][_0x3dc4('0x43')];_0x7794fd+=0x1){var _0x3bcaff=_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x58')];if(_0x24ea80['voiceQueues'][_0x3bcaff]){if(_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x59')]){_0x24ea80[_0x3dc4('0x14')][_0x3bcaff][_0x3dc4('0x31')]+=0x1;}if(_0x8f9f53[_0xbcc02][_0x7794fd]['queuecallerabandon']){_0x24ea80[_0x3dc4('0x14')][_0x3bcaff]['abandoned']+=0x1;}_0x24ea80[_0x3dc4('0x14')][_0x3bcaff][_0x3dc4('0x2e')]+=moment(_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x5a')])[_0x3dc4('0x5b')](moment(_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x5c')]),'seconds')||0x0;if(_0x7794fd===_0x8f9f53[_0xbcc02]['length']-0x1){_0x24ea80[_0x3dc4('0x14')][_0x3bcaff][_0x3dc4('0x33')]+=moment(_0x8f9f53[_0xbcc02][_0x7794fd]['queuecallercompleteAt']||_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x5d')]||_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x5e')])[_0x3dc4('0x5b')](moment(_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x5c')]),'seconds')||0x0;_0x24ea80['voiceQueues'][_0x3bcaff]['total']+=0x1;if(_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x5f')]){_0x24ea80['voiceQueues'][_0x3bcaff][_0x3dc4('0x60')]+=0x1;_0x24ea80[_0x3dc4('0x14')][_0x3bcaff]['sumBillable']+=moment(_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x61')])[_0x3dc4('0x5b')](moment(_0x8f9f53[_0xbcc02][_0x7794fd][_0x3dc4('0x5a')]),'seconds')||0x0;}}else{_0x24ea80['voiceQueues'][_0x3bcaff][_0x3dc4('0x33')]+=_0x24ea80['voiceQueues'][_0x3bcaff][_0x3dc4('0x2e')]||0x0;}}}}}}return _0x24ea80[_0x3dc4('0x14')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x62')]=function(){var _0x38c042=this;return function(_0x354162){clearVoiceCallReports(_0x38c042[_0x3dc4('0x63')]);if(_0x354162){for(var _0xfcdfc8=0x0;_0xfcdfc8<_0x354162[_0x3dc4('0x43')];_0xfcdfc8+=0x1){_0x38c042['outbound']['total']+=0x1;_0x38c042[_0x3dc4('0x63')]['sumDuration']+=_0x354162[_0xfcdfc8]['duration'];if(_0x354162[_0xfcdfc8][_0x3dc4('0x64')]===_0x3dc4('0x65')){_0x38c042['outbound'][_0x3dc4('0x60')]+=0x1;_0x38c042[_0x3dc4('0x63')][_0x3dc4('0x2e')]+=_0x354162[_0xfcdfc8][_0x3dc4('0x66')]-_0x354162[_0xfcdfc8]['billableseconds']||0x0;_0x38c042['outbound']['sumBillable']+=_0x354162[_0xfcdfc8][_0x3dc4('0x67')];}}}return _0x38c042['outbound'];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x68')]=function(){var _0x204405=this;return function(_0xc5ac96){if(_0xc5ac96){freeIsNotKey(_0xc5ac96,_0x204405['campaigns'],_0x3dc4('0x2b'));for(var _0xc0d5e4=0x0,_0x5d61db={};_0xc0d5e4<_0xc5ac96[_0x3dc4('0x43')];_0xc0d5e4+=0x1){_0x5d61db=_0xc5ac96[_0xc0d5e4];if(_[_0x3dc4('0x45')](_0x204405[_0x3dc4('0x16')][_0x5d61db['name']])){_0x204405[_0x3dc4('0x16')][_0x5d61db['name']]=new Campaign(_0x5d61db);}else{_0x204405[_0x3dc4('0x41')](_0x204405[_0x3dc4('0x16')][_0x5d61db['name']],_0x5d61db);_0x204405[_0x3dc4('0x16')][_0x5d61db[_0x3dc4('0x2b')]][_0x3dc4('0x69')]=_0x5d61db[_0x3dc4('0x6a')]?_0x5d61db[_0x3dc4('0x6a')][_0x3dc4('0x2b')]:undefined;}}}return _0x204405[_0x3dc4('0x16')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x6b')]=function(){var _0x1c03e9=this;return function(_0x50dccf){if(_0x50dccf){freeIsNotKey(_0x50dccf,_0x1c03e9[_0x3dc4('0x18')],'id');for(var _0x2dcd06=0x0,_0x4d9aa6={};_0x2dcd06<_0x50dccf[_0x3dc4('0x43')];_0x2dcd06+=0x1){_0x4d9aa6=_0x50dccf[_0x2dcd06];if(_['isUndefined'](_0x1c03e9[_0x3dc4('0x18')][_0x4d9aa6['id']])){_0x1c03e9[_0x3dc4('0x18')][_0x4d9aa6['id']]=new VoiceExtension(_0x4d9aa6);}else{_0x1c03e9[_0x3dc4('0x41')](_0x1c03e9[_0x3dc4('0x18')][_0x4d9aa6['id']],_0x4d9aa6);}}}return _0x1c03e9['voiceExtensions'];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x6c')]=function(){var _0x2dc5ac=this;return function(_0x5ab848){clearCampaigns(_0x2dc5ac[_0x3dc4('0x16')]);for(var _0x90e7da=0x0;_0x90e7da<_0x5ab848[_0x3dc4('0x43')];_0x90e7da+=0x1){_[_0x3dc4('0x54')](_0x2dc5ac[_0x3dc4('0x16')][_0x5ab848[_0x90e7da]['name']],_0x5ab848[_0x90e7da]);}return _0x2dc5ac[_0x3dc4('0x16')];};};Realtime[_0x3dc4('0x40')][_0x3dc4('0x6d')]=function(){var _0x4f31b9=this;return function(_0x441fd9){if(_0x441fd9){freeIsNotKey(_0x441fd9,_0x4f31b9['faxAccounts'],'id');for(var _0x21e556=0x0,_0x5b7645={},_0x41486c={};_0x21e556<_0x441fd9[_0x3dc4('0x43')];_0x21e556+=0x1){_0x5b7645=_0x441fd9[_0x21e556];if(_[_0x3dc4('0x45')](_0x4f31b9[_0x3dc4('0x26')][_0x5b7645['id']])){_0x4f31b9[_0x3dc4('0x26')][_0x5b7645['id']]=new FaxAccount(_0x5b7645);}else{_0x4f31b9['mergeFromDatabase'](_0x4f31b9[_0x3dc4('0x26')][_0x5b7645['id']],_0x5b7645);}}}return _0x4f31b9[_0x3dc4('0x26')];};};module['exports']=Realtime; \ No newline at end of file +var _0x960c=['channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','format','name','hasOwnProperty','mapKeys','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumHoldTime','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','isNil','isUndefined','mergeFromDatabase','initTelephones','SIP/%s','initTrunks','initVoiceQueues','initTriggers','triggers','length','initTemplates','templates','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerjoinAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','faxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','outbound','voiceExtensions'];(function(_0x6e61a,_0x12c871){var _0x17cc42=function(_0x1310cf){while(--_0x1310cf){_0x6e61a['push'](_0x6e61a['shift']());}};_0x17cc42(++_0x12c871);}(_0x960c,0xc9));var _0xc960=function(_0x3ce646,_0xbc14bd){_0x3ce646=_0x3ce646-0x0;var _0xf44bdb=_0x960c[_0x3ce646];return _0xf44bdb;};'use strict';var BPromise=require(_0xc960('0x0'));var util=require('util');var _=require(_0xc960('0x1'));var moment=require(_0xc960('0x2'));var Agent=require(_0xc960('0x3'));var Telephone=require(_0xc960('0x4'));var Trunk=require(_0xc960('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xc960('0x6'));var Template=require(_0xc960('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xc960('0x8'));var ZendeskAccount=require(_0xc960('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xc960('0xa'));var SugarcrmAccount=require(_0xc960('0xb'));var ZohoAccount=require(_0xc960('0xc'));var DeskAccount=require(_0xc960('0xd'));var VtigerAccount=require(_0xc960('0xe'));var ServicenowAccount=require(_0xc960('0xf'));var Dynamics365Account=require(_0xc960('0x10'));var FreshsalesAccount=require(_0xc960('0x11'));var FaxAccount=require(_0xc960('0x12'));var Realtime=function(){this[_0xc960('0x13')]={};this[_0xc960('0x14')]={};this[_0xc960('0x15')]={};this[_0xc960('0x16')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0xc960('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xc960('0x18')]={};this[_0xc960('0x19')]={};this[_0xc960('0x1a')]={};this[_0xc960('0x1b')]={};this[_0xc960('0x1c')]={};this[_0xc960('0x1d')]={};this[_0xc960('0x1e')]={};this[_0xc960('0x1f')]={};this[_0xc960('0x20')]={};this[_0xc960('0x21')]={};this[_0xc960('0x22')]={};this[_0xc960('0x23')]={};this['vtigerAccounts']={};this[_0xc960('0x24')]={};this[_0xc960('0x25')]={};this[_0xc960('0x26')]={};this['faxAccounts']={};};function freeIsNotKey(_0x1667bf,_0x2749c6,_0x3f9caa){var _0xfa6d4a=_['mapKeys'](_0x1667bf,function(_0x53fb74,_0x22bac3){return _0x53fb74[_0x3f9caa];});for(var _0x247c2a in _0x2749c6){if(_0x2749c6['hasOwnProperty'](_0x247c2a)){if(!_0xfa6d4a[_0x247c2a]){delete _0x2749c6[_0x247c2a];}}}}function freeIsNotKeySip(_0x4ed57c,_0x1d8ac7){var _0x1eeda2=_['mapKeys'](_0x4ed57c,function(_0x55dfd9,_0x3c4f3f){return util[_0xc960('0x27')]('SIP/%s',_0x55dfd9[_0xc960('0x28')]);});for(var _0x1ec969 in _0x1d8ac7){if(_0x1d8ac7[_0xc960('0x29')](_0x1ec969)){if(!_0x1eeda2[_0x1ec969]){delete _0x1d8ac7[_0x1ec969];}}}}function freeIsNotKeyAgent(_0x3659d4,_0x13f153){var _0x5c38c9=_[_0xc960('0x2a')](_0x3659d4,function(_0x4434d3,_0x362de2){var _0xfbc361=_['isNil'](_0x4434d3['interface'])?util['format']('SIP/%s',_0x4434d3[_0xc960('0x28')]):_0x4434d3[_0xc960('0x2b')];return _0xfbc361;});for(var _0x374180 in _0x13f153){if(_0x13f153[_0xc960('0x29')](_0x374180)){if(!_0x5c38c9[_0x374180]){delete _0x13f153[_0x374180];}}}}function clearVoiceCallReports(_0x28cd4e){_0x28cd4e[_0xc960('0x2c')]=0x0;_0x28cd4e[_0xc960('0x2d')]=0x0;_0x28cd4e['sumHoldTime']=0x0;_0x28cd4e[_0xc960('0x2e')]=0x0;_0x28cd4e[_0xc960('0x2f')]=0x0;}function clearCampaigns(_0xac4f36){if(!_[_0xc960('0x30')](_0xac4f36)){for(var _0x3f5eb0 in _0xac4f36){if(_0xac4f36[_0xc960('0x29')](_0x3f5eb0)){_0xac4f36[_0x3f5eb0][_0xc960('0x31')]=0x0;_0xac4f36[_0x3f5eb0][_0xc960('0x32')]=0x0;}}}}function clearVoiceQueues(_0x5b8e37){if(!_['isEmpty'](_0x5b8e37)){for(var _0x3dafb4 in _0x5b8e37){if(_0x5b8e37[_0xc960('0x29')](_0x3dafb4)){_0x5b8e37[_0x3dafb4][_0xc960('0x2c')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x2d')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x33')]=0x0;_0x5b8e37[_0x3dafb4]['abandoned']=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x34')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x2e')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x2f')]=0x0;_0x5b8e37[_0x3dafb4]['outboundAnswerAgiCallsDay']=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x35')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x36')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x37')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x38')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x39')]=0x0;_0x5b8e37[_0x3dafb4]['outboundDropCallsDayTimeout']=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x3a')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x3b')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x3c')]=0x0;_0x5b8e37[_0x3dafb4]['outboundRejectCallsDay']=0x0;_0x5b8e37[_0x3dafb4]['outboundReCallsDay']=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x3d')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x3e')]=0x0;_0x5b8e37[_0x3dafb4][_0xc960('0x3f')]=!![];}}}}Realtime[_0xc960('0x40')]['mergeFromDatabase']=function(_0x2ff290,_0x1cd4c1){for(var _0x432fc0 in _0x1cd4c1){if(_0x2ff290[_0xc960('0x29')](_0x432fc0)){_0x2ff290[_0x432fc0]=_0x1cd4c1[_0x432fc0];}}};Realtime['prototype']['initAgents']=function(){var _0x3d163c=this;return function(_0x2447a1){if(_0x2447a1){freeIsNotKeyAgent(_0x2447a1,_0x3d163c[_0xc960('0x13')]);for(var _0x2f5ede=0x0,_0x1785fd={},_0x484fd2={};_0x2f5ede<_0x2447a1['length'];_0x2f5ede+=0x1){_0x1785fd=_0x2447a1[_0x2f5ede];var _0x2c2df6=_[_0xc960('0x41')](_0x1785fd['interface'])?util[_0xc960('0x27')]('SIP/%s',_0x1785fd['name']):_0x1785fd[_0xc960('0x2b')];if(_[_0xc960('0x42')](_0x3d163c[_0xc960('0x13')][_0x2c2df6])){_0x3d163c[_0xc960('0x13')][_0x2c2df6]=new Agent(_0x1785fd);}else{_0x3d163c[_0xc960('0x43')](_0x3d163c['agents'][_0x2c2df6],_0x1785fd);}}}return _0x3d163c[_0xc960('0x13')];};};Realtime[_0xc960('0x40')][_0xc960('0x44')]=function(){var _0x5132c9=this;return function(_0x3bec68){if(_0x3bec68){freeIsNotKeySip(_0x3bec68,_0x5132c9[_0xc960('0x14')]);for(var _0x134716=0x0,_0x110566={},_0x1d5083={};_0x134716<_0x3bec68['length'];_0x134716+=0x1){_0x110566=_0x3bec68[_0x134716];if(_[_0xc960('0x42')](_0x5132c9[_0xc960('0x14')][util[_0xc960('0x27')]('SIP/%s',_0x110566['name'])])){_0x5132c9[_0xc960('0x14')][util[_0xc960('0x27')](_0xc960('0x45'),_0x110566[_0xc960('0x28')])]=new Telephone(_0x110566);}else{_0x5132c9[_0xc960('0x43')](_0x5132c9[_0xc960('0x14')][util[_0xc960('0x27')](_0xc960('0x45'),_0x110566[_0xc960('0x28')])],_0x110566);}}}return _0x5132c9[_0xc960('0x14')];};};Realtime[_0xc960('0x40')][_0xc960('0x46')]=function(){var _0x44ca77=this;return function(_0xcaf737){if(_0xcaf737){freeIsNotKeySip(_0xcaf737,_0x44ca77[_0xc960('0x15')]);for(var _0x5c272d=0x0,_0x125565={},_0x54d683={};_0x5c272d<_0xcaf737['length'];_0x5c272d+=0x1){_0x125565=_0xcaf737[_0x5c272d];if(_[_0xc960('0x42')](_0x44ca77[_0xc960('0x15')][util[_0xc960('0x27')](_0xc960('0x45'),_0x125565['name'])])){_0x44ca77[_0xc960('0x15')][util[_0xc960('0x27')](_0xc960('0x45'),_0x125565[_0xc960('0x28')])]=new Trunk(_0x125565);}else{_0x44ca77[_0xc960('0x43')](_0x44ca77['trunks'][util[_0xc960('0x27')](_0xc960('0x45'),_0x125565[_0xc960('0x28')])],_0x125565);}}}return _0x44ca77[_0xc960('0x15')];};};Realtime[_0xc960('0x40')][_0xc960('0x47')]=function(){var _0x3dbb7f=this;return function(_0x199279){if(_0x199279){freeIsNotKey(_0x199279,_0x3dbb7f[_0xc960('0x16')],_0xc960('0x28'));for(var _0x3bc9db=0x0,_0x24227f={},_0x851839={};_0x3bc9db<_0x199279['length'];_0x3bc9db+=0x1){_0x24227f=_0x199279[_0x3bc9db];if(_['isUndefined'](_0x3dbb7f[_0xc960('0x16')][_0x24227f[_0xc960('0x28')]])){_0x3dbb7f['voiceQueues'][_0x24227f[_0xc960('0x28')]]=new VoiceQueue(_0x24227f);}else{_0x3dbb7f[_0xc960('0x43')](_0x3dbb7f['voiceQueues'][_0x24227f[_0xc960('0x28')]],_0x24227f);}}}return _0x3dbb7f[_0xc960('0x16')];};};Realtime[_0xc960('0x40')][_0xc960('0x48')]=function(){var _0x50a67b=this;return function(_0x4f0bc0){if(_0x4f0bc0){freeIsNotKey(_0x4f0bc0,_0x50a67b[_0xc960('0x49')],'id');for(var _0x1dd2b5=0x0,_0x57b554={},_0x360d32={};_0x1dd2b5<_0x4f0bc0[_0xc960('0x4a')];_0x1dd2b5+=0x1){_0x57b554=_0x4f0bc0[_0x1dd2b5];if(_[_0xc960('0x42')](_0x50a67b[_0xc960('0x49')][_0x57b554['id']])){_0x50a67b[_0xc960('0x49')][_0x57b554['id']]=new Trigger(_0x57b554);}else{_0x50a67b['mergeFromDatabase'](_0x50a67b[_0xc960('0x49')][_0x57b554['id']],_0x57b554);}}}return _0x50a67b['triggers'];};};Realtime[_0xc960('0x40')][_0xc960('0x4b')]=function(){var _0x571fe5=this;return function(_0x332562){if(_0x332562){freeIsNotKey(_0x332562,_0x571fe5['templates'],'id');for(var _0x487208=0x0,_0x591b3a={},_0x374ec0={};_0x487208<_0x332562[_0xc960('0x4a')];_0x487208+=0x1){_0x591b3a=_0x332562[_0x487208];if(_[_0xc960('0x42')](_0x571fe5[_0xc960('0x4c')][_0x591b3a['id']])){_0x571fe5[_0xc960('0x4c')][_0x591b3a['id']]=new Template(_0x591b3a);}else{_0x571fe5[_0xc960('0x43')](_0x571fe5[_0xc960('0x4c')][_0x591b3a['id']],_0x591b3a);}}}return _0x571fe5['templates'];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x51053c=this;return function(_0x40c720){if(_0x40c720){freeIsNotKey(_0x40c720,_0x51053c[_0xc960('0x1e')],'id');for(var _0x55dabd=0x0,_0x14b4d1={},_0x359e58={};_0x55dabd<_0x40c720[_0xc960('0x4a')];_0x55dabd+=0x1){_0x14b4d1=_0x40c720[_0x55dabd];if(_[_0xc960('0x42')](_0x51053c[_0xc960('0x1e')][_0x14b4d1['id']])){_0x51053c[_0xc960('0x1e')][_0x14b4d1['id']]=new ZendeskAccount(_0x14b4d1);}else{_0x51053c[_0xc960('0x43')](_0x51053c[_0xc960('0x1e')][_0x14b4d1['id']],_0x14b4d1);}}}return _0x51053c[_0xc960('0x1e')];};};Realtime['prototype'][_0xc960('0x4d')]=function(){var _0x3b03f3=this;return function(_0x1d824b){if(_0x1d824b){freeIsNotKey(_0x1d824b,_0x3b03f3[_0xc960('0x1f')],'id');for(var _0x4010db=0x0,_0x41ee20={},_0x3e01f4={};_0x4010db<_0x1d824b[_0xc960('0x4a')];_0x4010db+=0x1){_0x41ee20=_0x1d824b[_0x4010db];if(_['isUndefined'](_0x3b03f3[_0xc960('0x1f')][_0x41ee20['id']])){_0x3b03f3[_0xc960('0x1f')][_0x41ee20['id']]=new SalesforceAccount(_0x41ee20);}else{_0x3b03f3[_0xc960('0x43')](_0x3b03f3[_0xc960('0x1f')][_0x41ee20['id']],_0x41ee20);}}}return _0x3b03f3['salesforceAccounts'];};};Realtime['prototype'][_0xc960('0x4e')]=function(){var _0x187b0b=this;return function(_0x2c2144){if(_0x2c2144){freeIsNotKey(_0x2c2144,_0x187b0b['freshdeskAccounts'],'id');for(var _0x1fcda9=0x0,_0x5e644b={},_0x1c8550={};_0x1fcda9<_0x2c2144[_0xc960('0x4a')];_0x1fcda9+=0x1){_0x5e644b=_0x2c2144[_0x1fcda9];if(_['isUndefined'](_0x187b0b['freshdeskAccounts'][_0x5e644b['id']])){_0x187b0b[_0xc960('0x21')][_0x5e644b['id']]=new FreshdeskAccount(_0x5e644b);}else{_0x187b0b[_0xc960('0x43')](_0x187b0b[_0xc960('0x21')][_0x5e644b['id']],_0x5e644b);}}}return _0x187b0b[_0xc960('0x21')];};};Realtime[_0xc960('0x40')]['initZohoAccounts']=function(){var _0x1bd48d=this;return function(_0x5440b8){if(_0x5440b8){freeIsNotKey(_0x5440b8,_0x1bd48d[_0xc960('0x22')],'id');for(var _0x2814c9=0x0,_0x122bb8={},_0x3d45f1={};_0x2814c9<_0x5440b8[_0xc960('0x4a')];_0x2814c9+=0x1){_0x122bb8=_0x5440b8[_0x2814c9];if(_[_0xc960('0x42')](_0x1bd48d['zohoAccounts'][_0x122bb8['id']])){_0x1bd48d[_0xc960('0x22')][_0x122bb8['id']]=new ZohoAccount(_0x122bb8);}else{_0x1bd48d['mergeFromDatabase'](_0x1bd48d[_0xc960('0x22')][_0x122bb8['id']],_0x122bb8);}}}return _0x1bd48d['zohoAccounts'];};};Realtime[_0xc960('0x40')][_0xc960('0x4f')]=function(){var _0x12a568=this;return function(_0x565b9b){if(_0x565b9b){freeIsNotKey(_0x565b9b,_0x12a568[_0xc960('0x23')],'id');for(var _0x4bd96d=0x0,_0x19cfb6={},_0x3bcc7b={};_0x4bd96d<_0x565b9b[_0xc960('0x4a')];_0x4bd96d+=0x1){_0x19cfb6=_0x565b9b[_0x4bd96d];if(_[_0xc960('0x42')](_0x12a568['deskAccounts'][_0x19cfb6['id']])){_0x12a568[_0xc960('0x23')][_0x19cfb6['id']]=new DeskAccount(_0x19cfb6);}else{_0x12a568[_0xc960('0x43')](_0x12a568[_0xc960('0x23')][_0x19cfb6['id']],_0x19cfb6);}}}return _0x12a568['deskAccounts'];};};Realtime[_0xc960('0x40')][_0xc960('0x50')]=function(){var _0x30260d=this;return function(_0x403c42){if(_0x403c42){freeIsNotKey(_0x403c42,_0x30260d['sugarcrmAccounts'],'id');for(var _0x58e9b3=0x0,_0x15fd66={},_0x2b2228={};_0x58e9b3<_0x403c42[_0xc960('0x4a')];_0x58e9b3+=0x1){_0x15fd66=_0x403c42[_0x58e9b3];if(_['isUndefined'](_0x30260d[_0xc960('0x20')][_0x15fd66['id']])){_0x30260d[_0xc960('0x20')][_0x15fd66['id']]=new SugarcrmAccount(_0x15fd66);}else{_0x30260d[_0xc960('0x43')](_0x30260d[_0xc960('0x20')][_0x15fd66['id']],_0x15fd66);}}}return _0x30260d[_0xc960('0x20')];};};Realtime[_0xc960('0x40')][_0xc960('0x51')]=function(){var _0x1fbcfb=this;return function(_0x16522b){if(_0x16522b){freeIsNotKey(_0x16522b,_0x1fbcfb['vtigerAccounts'],'id');for(var _0x11a5ea=0x0,_0x228453={},_0xba569={};_0x11a5ea<_0x16522b['length'];_0x11a5ea+=0x1){_0x228453=_0x16522b[_0x11a5ea];if(_[_0xc960('0x42')](_0x1fbcfb[_0xc960('0x52')][_0x228453['id']])){_0x1fbcfb[_0xc960('0x52')][_0x228453['id']]=new VtigerAccount(_0x228453);}else{_0x1fbcfb[_0xc960('0x43')](_0x1fbcfb[_0xc960('0x52')][_0x228453['id']],_0x228453);}}}return _0x1fbcfb['vtigerAccounts'];};};Realtime[_0xc960('0x40')][_0xc960('0x53')]=function(){var _0x285f9c=this;return function(_0x41787){if(_0x41787){freeIsNotKey(_0x41787,_0x285f9c[_0xc960('0x24')],'id');for(var _0x5416a4=0x0,_0x4e6951={},_0x40680f={};_0x5416a4<_0x41787[_0xc960('0x4a')];_0x5416a4+=0x1){_0x4e6951=_0x41787[_0x5416a4];if(_[_0xc960('0x42')](_0x285f9c[_0xc960('0x24')][_0x4e6951['id']])){_0x285f9c[_0xc960('0x24')][_0x4e6951['id']]=new ServicenowAccount(_0x4e6951);}else{_0x285f9c[_0xc960('0x43')](_0x285f9c[_0xc960('0x24')][_0x4e6951['id']],_0x4e6951);}}}return _0x285f9c[_0xc960('0x24')];};};Realtime[_0xc960('0x40')][_0xc960('0x54')]=function(){var _0x5a05df=this;return function(_0x199d4a){if(_0x199d4a){freeIsNotKey(_0x199d4a,_0x5a05df[_0xc960('0x25')],'id');for(var _0x2319b=0x0,_0x367caf={},_0x34df11={};_0x2319b<_0x199d4a[_0xc960('0x4a')];_0x2319b+=0x1){_0x367caf=_0x199d4a[_0x2319b];if(_[_0xc960('0x42')](_0x5a05df[_0xc960('0x25')][_0x367caf['id']])){_0x5a05df[_0xc960('0x25')][_0x367caf['id']]=new Dynamics365Account(_0x367caf);}else{_0x5a05df[_0xc960('0x43')](_0x5a05df[_0xc960('0x25')][_0x367caf['id']],_0x367caf);}}}return _0x5a05df['dynamics365Accounts'];};};Realtime[_0xc960('0x40')][_0xc960('0x55')]=function(){var _0x591a70=this;return function(_0x3669ed){if(_0x3669ed){freeIsNotKey(_0x3669ed,_0x591a70[_0xc960('0x26')],'id');for(var _0x3e5556=0x0,_0x4085fc={},_0x584bd5={};_0x3e5556<_0x3669ed[_0xc960('0x4a')];_0x3e5556+=0x1){_0x4085fc=_0x3669ed[_0x3e5556];if(_[_0xc960('0x42')](_0x591a70[_0xc960('0x26')][_0x4085fc['id']])){_0x591a70['freshsalesAccounts'][_0x4085fc['id']]=new FreshsalesAccount(_0x4085fc);}else{_0x591a70['mergeFromDatabase'](_0x591a70[_0xc960('0x26')][_0x4085fc['id']],_0x4085fc);}}}return _0x591a70[_0xc960('0x26')];};};Realtime['prototype'][_0xc960('0x56')]=function(){var _0x41dbc0=this;return function(_0x3f91a6){for(var _0x578001=0x0;_0x578001<_0x3f91a6[_0xc960('0x4a')];_0x578001+=0x1){_['merge'](_0x41dbc0[_0xc960('0x16')][_0x3f91a6[_0x578001]['name']],_0x3f91a6[_0x578001]);}return _0x41dbc0[_0xc960('0x16')];};};Realtime[_0xc960('0x40')]['initVoiceQueueReports']=function(){var _0x6eead3=this;return function(_0xef8102){clearVoiceQueues(_0x6eead3[_0xc960('0x16')]);if(_0xef8102){_0xef8102=_[_0xc960('0x57')](_0xef8102,_0xc960('0x58'));for(var _0x2b1e88 in _0xef8102){if(_0xef8102[_0xc960('0x29')](_0x2b1e88)){var _0x41d355={};for(var _0x37a487=0x0;_0x37a487<_0xef8102[_0x2b1e88][_0xc960('0x4a')];_0x37a487+=0x1){var _0x5d8228=_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x59')];if(_0x6eead3[_0xc960('0x16')][_0x5d8228]){if(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x5a')]){_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x33')]+=0x1;}if(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x5b')]){_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x5c')]+=0x1;}_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x34')]+=moment(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x5d')])[_0xc960('0x5e')](moment(_0xef8102[_0x2b1e88][_0x37a487]['queuecallerjoinAt']),_0xc960('0x5f'))||0x0;if(_0x37a487===_0xef8102[_0x2b1e88]['length']-0x1){_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x2e')]+=moment(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x60')]||_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x61')]||_0xef8102[_0x2b1e88][_0x37a487]['queuecallerexitAt'])[_0xc960('0x5e')](moment(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x62')]),_0xc960('0x5f'))||0x0;_0x6eead3[_0xc960('0x16')][_0x5d8228]['total']+=0x1;if(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x63')]){_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x2d')]+=0x1;_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x2f')]+=moment(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x60')])[_0xc960('0x5e')](moment(_0xef8102[_0x2b1e88][_0x37a487][_0xc960('0x5d')]),_0xc960('0x5f'))||0x0;}}else{_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x2e')]+=_0x6eead3[_0xc960('0x16')][_0x5d8228][_0xc960('0x34')]||0x0;}}}}}}return _0x6eead3['voiceQueues'];};};Realtime[_0xc960('0x40')][_0xc960('0x64')]=function(){var _0x332e94=this;return function(_0x4c409d){clearVoiceCallReports(_0x332e94['outbound']);if(_0x4c409d){for(var _0x2b6acc=0x0;_0x2b6acc<_0x4c409d[_0xc960('0x4a')];_0x2b6acc+=0x1){_0x332e94['outbound'][_0xc960('0x2c')]+=0x1;_0x332e94['outbound'][_0xc960('0x2e')]+=_0x4c409d[_0x2b6acc]['duration'];if(_0x4c409d[_0x2b6acc][_0xc960('0x65')]===_0xc960('0x66')){_0x332e94['outbound'][_0xc960('0x2d')]+=0x1;_0x332e94[_0xc960('0x17')][_0xc960('0x34')]+=_0x4c409d[_0x2b6acc][_0xc960('0x67')]-_0x4c409d[_0x2b6acc]['billableseconds']||0x0;_0x332e94[_0xc960('0x17')][_0xc960('0x2f')]+=_0x4c409d[_0x2b6acc]['billableseconds'];}}}return _0x332e94[_0xc960('0x17')];};};Realtime[_0xc960('0x40')][_0xc960('0x68')]=function(){var _0x5e23ab=this;return function(_0xb53033){if(_0xb53033){freeIsNotKey(_0xb53033,_0x5e23ab[_0xc960('0x69')],_0xc960('0x28'));for(var _0x1d2756=0x0,_0x2ff110={};_0x1d2756<_0xb53033[_0xc960('0x4a')];_0x1d2756+=0x1){_0x2ff110=_0xb53033[_0x1d2756];if(_[_0xc960('0x42')](_0x5e23ab[_0xc960('0x69')][_0x2ff110['name']])){_0x5e23ab[_0xc960('0x69')][_0x2ff110[_0xc960('0x28')]]=new Campaign(_0x2ff110);}else{_0x5e23ab[_0xc960('0x43')](_0x5e23ab[_0xc960('0x69')][_0x2ff110[_0xc960('0x28')]],_0x2ff110);_0x5e23ab[_0xc960('0x69')][_0x2ff110[_0xc960('0x28')]][_0xc960('0x6a')]=_0x2ff110['SquareProject']?_0x2ff110[_0xc960('0x6b')][_0xc960('0x28')]:undefined;}}}return _0x5e23ab[_0xc960('0x69')];};};Realtime[_0xc960('0x40')][_0xc960('0x6c')]=function(){var _0x45ffbc=this;return function(_0x35d468){if(_0x35d468){freeIsNotKey(_0x35d468,_0x45ffbc[_0xc960('0x18')],'id');for(var _0x3e509d=0x0,_0x4e9431={};_0x3e509d<_0x35d468[_0xc960('0x4a')];_0x3e509d+=0x1){_0x4e9431=_0x35d468[_0x3e509d];if(_[_0xc960('0x42')](_0x45ffbc[_0xc960('0x18')][_0x4e9431['id']])){_0x45ffbc[_0xc960('0x18')][_0x4e9431['id']]=new VoiceExtension(_0x4e9431);}else{_0x45ffbc[_0xc960('0x43')](_0x45ffbc[_0xc960('0x18')][_0x4e9431['id']],_0x4e9431);}}}return _0x45ffbc[_0xc960('0x18')];};};Realtime[_0xc960('0x40')][_0xc960('0x6d')]=function(){var _0x254809=this;return function(_0x4e2723){clearCampaigns(_0x254809[_0xc960('0x69')]);for(var _0x15c3d2=0x0;_0x15c3d2<_0x4e2723[_0xc960('0x4a')];_0x15c3d2+=0x1){_[_0xc960('0x6e')](_0x254809[_0xc960('0x69')][_0x4e2723[_0x15c3d2]['name']],_0x4e2723[_0x15c3d2]);}return _0x254809['campaigns'];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x33f30b=this;return function(_0x37515a){if(_0x37515a){freeIsNotKey(_0x37515a,_0x33f30b[_0xc960('0x6f')],'id');for(var _0x20b8d5=0x0,_0x6f415e={},_0x5a4f51={};_0x20b8d5<_0x37515a[_0xc960('0x4a')];_0x20b8d5+=0x1){_0x6f415e=_0x37515a[_0x20b8d5];if(_[_0xc960('0x42')](_0x33f30b['faxAccounts'][_0x6f415e['id']])){_0x33f30b[_0xc960('0x6f')][_0x6f415e['id']]=new FaxAccount(_0x6f415e);}else{_0x33f30b[_0xc960('0x43')](_0x33f30b[_0xc960('0x6f')][_0x6f415e['id']],_0x6f415e);}}}return _0x33f30b[_0xc960('0x6f')];};};module[_0xc960('0x70')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 09ecb37..46f3ce4 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 _0x5f6f=['membername','monitors','monitorFilename','connectedlinename','voiceAgentReport','forEach','voiceDialReport','Local','substring','indexOf','mobile','phone','transfererlinkedid','attendedTransfer','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','findAgent','find','accountcode','isNil','interface','format','SIP/%s','name','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','destination','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','blindTransfer','UserId'];(function(_0x5ddf42,_0x46b50d){var _0x2e449e=function(_0x46a660){while(--_0x46a660){_0x5ddf42['push'](_0x5ddf42['shift']());}};_0x2e449e(++_0x46b50d);}(_0x5f6f,0x68));var _0xf5f6=function(_0x4acd36,_0x5aee49){_0x4acd36=_0x4acd36-0x0;var _0x1ffcf4=_0x5f6f[_0x4acd36];return _0x1ffcf4;};'use strict';var _=require(_0xf5f6('0x0'));var moment=require(_0xf5f6('0x1'));var util=require(_0xf5f6('0x2'));var config=require(_0xf5f6('0x3'));var ami=require(_0xf5f6('0x4'));var RpcVoiceAgentReport=require(_0xf5f6('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xf5f6('0x6'));var RpcVoiceQueueReport=require(_0xf5f6('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xf5f6('0x8'));var VoiceCallReport=require(_0xf5f6('0x9'));var VoiceAgentReport=require(_0xf5f6('0xa'));var VoiceDialReport=require(_0xf5f6('0xb'));var UserReport=require(_0xf5f6('0xc'));function Report(_0x41c112){this[_0xf5f6('0xd')]=_0x41c112;this[_0xf5f6('0xe')]=_0x41c112[_0xf5f6('0xe')];this[_0xf5f6('0xf')]=_0x41c112[_0xf5f6('0xf')];}Report[_0xf5f6('0x10')][_0xf5f6('0x11')]=function(_0x771578){var _0x1f76c8=new VoiceQueueReport(this[_0xf5f6('0xd')]);var _0x44c600=new VoiceAgentReport(this[_0xf5f6('0xd')]);var _0x5b6e15=new VoiceDialReport(this['realtime']);var _0x33c70b=new VoiceCallReport(this['realtime']);var _0x57fe96=new UserReport(this[_0xf5f6('0xd')]);if(config[_0xf5f6('0x12')]&&config[_0xf5f6('0x12')][_0xf5f6('0x13')]){ami['on'](_0xf5f6('0x14'),this['voiceQueueReport'][_0xf5f6('0x15')](this));ami['on'](_0xf5f6('0x16'),this[_0xf5f6('0x17')]['bind'](this));ami['on'](_0xf5f6('0x18'),this['voiceAgentReport'][_0xf5f6('0x15')](this));ami['on'](_0xf5f6('0x19'),this['voiceDialReport'][_0xf5f6('0x15')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer']['bind'](this));}};Report[_0xf5f6('0x10')][_0xf5f6('0x1a')]=function(_0x40f3f5){var _0x26a6da;_0x26a6da=_[_0xf5f6('0x1b')](this[_0xf5f6('0xe')],function(_0x277173){return _0x277173[_0xf5f6('0x1c')]==_0x40f3f5||_0x277173['name']==_0x40f3f5;});if(_[_0xf5f6('0x1d')](_0x26a6da)){var _0xb70fe=_[_0xf5f6('0x1b')](this[_0xf5f6('0xf')],function(_0x736305){return _0x736305[_0xf5f6('0x1c')]==_0x40f3f5||_0x736305['name']==_0x40f3f5;});if(_0xb70fe){_0x26a6da=_[_0xf5f6('0x1b')](this['agents'],function(_0x562ac2){return _0x562ac2[_0xf5f6('0x1e')]==util[_0xf5f6('0x1f')](_0xf5f6('0x20'),_0xb70fe[_0xf5f6('0x21')]);});}}return _0x26a6da;};Report[_0xf5f6('0x10')][_0xf5f6('0x22')]=function(_0xc5a839){for(var _0xeb895=0x0;_0xeb895<_0xc5a839[_0xf5f6('0x23')];_0xeb895+=0x1){var _0xcddb58=this[_0xf5f6('0x1a')](_0xc5a839[_0xeb895][_0xf5f6('0x24')]);if(_0xcddb58){_0xc5a839[_0xeb895][_0xf5f6('0x1c')]=_0xcddb58[_0xf5f6('0x1c')];_0xc5a839[_0xeb895][_0xf5f6('0x25')]=!![];_0xc5a839[_0xeb895][_0xf5f6('0x26')]=_0xcddb58[_0xf5f6('0x21')];_0xc5a839[_0xeb895]['interface']=_['isNil'](_0xcddb58['interface'])?util['format']('SIP/%s',_0xcddb58[_0xf5f6('0x21')]):_0xcddb58[_0xf5f6('0x1e')];if(_0xc5a839[_0xeb895][_0xf5f6('0x27')]){_0xc5a839[_0xeb895][_0xf5f6('0x28')]=moment()[_0xf5f6('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xc5a839[_0xeb895][_0xf5f6('0x29')]){_0xc5a839[_0xeb895][_0xf5f6('0x2a')]=moment()['format'](_0xf5f6('0x2b'));}RpcMemberReport[_0xf5f6('0x22')](_0xc5a839[_0xeb895]);}RpcVoiceQueueReport[_0xf5f6('0x2c')](_0xc5a839[_0xeb895]);}};function extractCalleridNumber(_0x85da1){var _0x265bbc=_0x85da1[_0xf5f6('0x2d')](/<(.*?)>/);return _0x265bbc?_0x265bbc[0x1]:_0x85da1;}Report[_0xf5f6('0x10')][_0xf5f6('0x2e')]=function(_0x572a2d){for(var _0x51c28b=0x0;_0x51c28b/);return _0x1b02c1?_0x1b02c1[0x1]:_0x973eb;}Report['prototype'][_0x7be0('0x2d')]=function(_0x53431f){for(var _0x3a6cd9=0x0;_0x3a6cd9',_0x142b53[_0x7be0('0x44')],_0x142b53[_0x7be0('0x42')]);}if(RpcVoiceTransferReport[_0x7be0('0x45')][_0x142b53[_0x7be0('0x46')]]){var _0x216776=RpcVoiceTransferReport[_0x7be0('0x45')][_0x142b53[_0x7be0('0x46')]];_0x216776[_0x7be0('0x47')]=_0x142b53['uniqueid'];RpcVoiceTransferReport[_0x7be0('0x1a')](_0x216776);delete RpcVoiceTransferReport[_0x7be0('0x45')][_0x142b53[_0x7be0('0x46')]];}if(_[_0x7be0('0x26')](_0x142b53['type'])){_0x142b53['type']=this['getCallType'](_0x142b53);}if(_[_0x7be0('0x26')](_0x142b53[_0x7be0('0x48')])){var _0x3218ae=_0x142b53[_0x7be0('0x40')][_0x7be0('0x30')]('-')[0x0];var _0x41e329=this[_0x7be0('0xe')][_0x3218ae];if(!_0x41e329)_0x41e329=this[_0x7be0('0x2d')](_0x142b53[_0x7be0('0x1f')]);if(_0x41e329){_0x142b53[_0x7be0('0x48')]=_0x41e329['id'];_0x142b53[_0x7be0('0x49')]=_0x41e329[_0x7be0('0x20')];}}RpcVoiceCallReport[_0x7be0('0x2b')](_0x142b53);if(_0x142b53[_0x7be0('0x4a')]){for(var _0x2aad56=0x0;_0x2aad56<_0x142b53['monitors'][_0x7be0('0x22')];_0x2aad56+=0x1){_0x142b53['monitorFilename']=_0x142b53[_0x7be0('0x4b')][_0x2aad56][_0x7be0('0x4c')];_0x142b53['createdAt']=_0x142b53[_0x7be0('0x4b')][_0x2aad56][_0x7be0('0x4d')];if(_0x142b53['exten']=='xcally-motion-preview'){_0x142b53[_0x7be0('0x42')]=_0x142b53['connectedlinenum'];_0x142b53[_0x7be0('0x44')]=_0x142b53[_0x7be0('0x4e')];_0x142b53[_0x7be0('0x23')]=_0x142b53[_0x7be0('0x1f')];_0x142b53[_0x7be0('0x4e')]=_0x142b53[_0x7be0('0x49')];_0x142b53['exten']=_0x142b53[_0x7be0('0x4f')];}else if(_0x142b53[_0x7be0('0x34')]=='xcally-motion-dialer'){_0x142b53[_0x7be0('0x42')]=_0x142b53[_0x7be0('0x33')];_0x142b53['exten']=_0x142b53['originatecalleridnum'];}RpcVoiceRecording[_0x7be0('0x2b')](_0x142b53);}}};Report[_0x7be0('0x10')][_0x7be0('0x50')]=function(_0x5635dc){if(_[_0x7be0('0x51')](_0x5635dc)){_0x5635dc[_0x7be0('0x52')](function(_0x5d58ed){RpcVoiceAgentReport[_0x7be0('0x2b')](_0x5d58ed);});}else{RpcVoiceAgentReport[_0x7be0('0x2b')](_0x5635dc);}};Report[_0x7be0('0x10')][_0x7be0('0x53')]=function(_0x1127ef){RpcVoiceDialReport[_0x7be0('0x2b')](_0x1127ef);var _0x6dcf25;var _0xbe6f95;var _0xd4a806=_0x1127ef[_0x7be0('0x40')];if(_[_0x7be0('0x54')](_0xd4a806,'Local')){_0xbe6f95=_0xd4a806[_0x7be0('0x55')](_0xd4a806[_0x7be0('0x56')]('/')+0x1,_0xd4a806[_0x7be0('0x56')]('@'));_0x6dcf25=_[_0x7be0('0x1e')](this['agents'],function(_0x247fe8){return _0x247fe8[_0x7be0('0x57')]==_0xbe6f95||_0x247fe8[_0x7be0('0x58')]==_0xbe6f95||_0x247fe8['accountcode']==_0xbe6f95;});}else{_0xbe6f95=_0xd4a806[_0x7be0('0x55')](_0xd4a806[_0x7be0('0x56')]('/')+0x1,_0xd4a806[_0x7be0('0x59')]('-'));_0x6dcf25=this[_0x7be0('0x1d')](_0xbe6f95);}if(_0x6dcf25){_0x1127ef['interface']=_[_0x7be0('0x26')](_0x6dcf25[_0x7be0('0x21')])?util['format'](_0x7be0('0x28'),_0x6dcf25['name']):_0x6dcf25[_0x7be0('0x21')];_0x1127ef['membername']=_0x6dcf25[_0x7be0('0x20')];_0x1127ef[_0x7be0('0x1f')]=_0x6dcf25[_0x7be0('0x1f')];RpcMemberReport[_0x7be0('0x53')](_0x1127ef);}};Report['prototype']['blindTransfer']=function(_0x5f535b){RpcVoiceTransferReport[_0x7be0('0x45')][_0x5f535b[_0x7be0('0x5a')]]=_0x5f535b;};Report[_0x7be0('0x10')][_0x7be0('0x1c')]=function(_0x3b0901){RpcVoiceTransferReport['attendedTransfer'](_0x3b0901);};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 126707c..919a820 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 _0x862a=['emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','state','merge','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','stateTime','toNumber','toLowerCase','updateStatusRealtime','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','mobile','phone','accountcode','peer','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','bind','registry','syncRegistry','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull'];(function(_0x25789f,_0x174021){var _0x4396ad=function(_0x57f722){while(--_0x57f722){_0x25789f['push'](_0x25789f['shift']());}};_0x4396ad(++_0x174021);}(_0x862a,0x107));var _0xa862=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x862a[_0x4bcfa6];return _0x1c0165;};'use strict';var _=require(_0xa862('0x0'));var moment=require(_0xa862('0x1'));var util=require(_0xa862('0x2'));var Redis=require(_0xa862('0x3'));var BPromise=require(_0xa862('0x4'));var config=require(_0xa862('0x5'));var logger=require(_0xa862('0x6'))('ami');var ami=require(_0xa862('0x7'));config[_0xa862('0x8')]=_[_0xa862('0x9')](config[_0xa862('0x8')],{'host':_0xa862('0xa'),'port':0x18eb});var io=require(_0xa862('0xb'))(new Redis(config[_0xa862('0x8')]));function UserReport(_0x3284f6){this['trunks']=_0x3284f6[_0xa862('0xc')];this[_0xa862('0xd')]=_0x3284f6[_0xa862('0xd')];this[_0xa862('0xe')]=_0x3284f6[_0xa862('0xe')];ami['on']('registryentry',this['syncRegistry'][_0xa862('0xf')](this));ami['on'](_0xa862('0x10'),this[_0xa862('0x11')][_0xa862('0xf')](this));ami['on']('devicestatechange',this['syncDeviceState'][_0xa862('0xf')](this));ami['on'](_0xa862('0x12'),this[_0xa862('0x13')]['bind'](this));return this[_0xa862('0x14')]();}function showSipRegistrations(){Promise[_0xa862('0x15')]()[_0xa862('0x16')](ami['actionSipShowRegistry']())[_0xa862('0x17')](function(_0x446b36){logger[_0xa862('0x18')](_0xa862('0x19'),util[_0xa862('0x1a')](_0x446b36,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xa862('0x15')]()[_0xa862('0x16')](ami[_0xa862('0x1b')]())[_0xa862('0x17')](function(_0x19259f){logger[_0xa862('0x18')](_0xa862('0x1c'),util[_0xa862('0x1a')](_0x19259f,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xa862('0x15')]()['then'](ami[_0xa862('0x1d')]())[_0xa862('0x17')](function(_0x289d22){logger[_0xa862('0x18')](_0xa862('0x1e'),util['inspect'](_0x289d22,{'showHidden':![],'depth':null}));});}UserReport[_0xa862('0x1f')][_0xa862('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0xa862('0x16')](showSipRegistrations())['then'](listDeviceStates())[_0xa862('0x16')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xa862('0x20')]=function(_0x1e2f16){return _0x1e2f16!==null&&!_['isUndefined'](_0x1e2f16);};UserReport['prototype']['emit']=function(_0x334d9c,_0x588f41,_0xa23503){io['to'](_0x334d9c)[_0xa862('0x21')](_0x588f41,_0xa23503);};UserReport[_0xa862('0x1f')][_0xa862('0x11')]=function(_0x55f609){try{if(this['isNotNull'](_0x55f609)){logger[_0xa862('0x22')](_0xa862('0x23'),_0x55f609[_0xa862('0x24')],_0x55f609['state']);logger[_0xa862('0x25')](_0xa862('0x26'),util[_0xa862('0x1a')](_0x55f609,{'showHidden':![],'depth':null}));var _0x4115e7=_['find'](this[_0xa862('0xc')],{'defaultuser':_0x55f609[_0xa862('0x24')]});if(_0x4115e7){_0x55f609['stateRegistry']=_0x55f609[_0xa862('0x27')];_[_0xa862('0x28')](_0x4115e7,_[_0xa862('0x29')](_0x55f609,[_0xa862('0x2a'),'actionid',_0xa862('0x24'),_0xa862('0x27')]));logger[_0xa862('0x25')](_0xa862('0x2b'),util['inspect'](_0x4115e7,{'showHidden':![],'depth':null}));this[_0xa862('0x21')](util[_0xa862('0x2c')](_0xa862('0x2d'),_0x4115e7[_0xa862('0x2e')]),_0xa862('0x2f'),_0x4115e7);}}}catch(_0x1d7235){logger['error'](_0xa862('0x26'),util[_0xa862('0x1a')](_0x1d7235,{'showHidden':![],'depth':null}));}};UserReport[_0xa862('0x1f')]['syncDeviceState']=function(_0x362c15){try{if(this[_0xa862('0x20')](_0x362c15)){logger[_0xa862('0x22')](_0xa862('0x30'),_0x362c15[_0xa862('0x31')],_0x362c15[_0xa862('0x27')]);logger['debug'](_0xa862('0x32'),util[_0xa862('0x1a')](_0x362c15,{'showHidden':![],'depth':null}));if(this['agents'][_0x362c15[_0xa862('0x31')]]){if(!this[_0xa862('0xd')][_0x362c15[_0xa862('0x31')]][_0xa862('0x33')]||_0x362c15['state']['toLowerCase']()=='inuse'){this['agents'][_0x362c15['device']][_0xa862('0x33')]=![];if(this['agents'][_0x362c15[_0xa862('0x31')]][_0xa862('0x27')]!==_0x362c15[_0xa862('0x27')]['toLowerCase']()){this[_0xa862('0xd')][_0x362c15['device']][_0xa862('0x34')]=_[_0xa862('0x35')](moment()[_0xa862('0x2c')]('x'));}this[_0xa862('0xd')][_0x362c15[_0xa862('0x31')]]['state']=_0x362c15[_0xa862('0x27')][_0xa862('0x36')]();this['agents'][_0x362c15[_0xa862('0x31')]][_0xa862('0x37')](_0x362c15);}}else if(this[_0xa862('0xe')][_0x362c15[_0xa862('0x31')]]){if(this[_0xa862('0xe')][_0x362c15[_0xa862('0x31')]][_0xa862('0x27')]!==_0x362c15[_0xa862('0x27')][_0xa862('0x36')]()){this[_0xa862('0xe')][_0x362c15['device']][_0xa862('0x34')]=_[_0xa862('0x35')](moment()['format']('x'));}this[_0xa862('0xe')][_0x362c15[_0xa862('0x31')]][_0xa862('0x27')]=_0x362c15[_0xa862('0x27')]['toLowerCase']();logger[_0xa862('0x25')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xa862('0x1a')](this['telephones'][_0x362c15['device']],{'showHidden':![],'depth':null}));this[_0xa862('0x21')](util[_0xa862('0x2c')](_0xa862('0x38'),this['telephones'][_0x362c15[_0xa862('0x31')]][_0xa862('0x2e')]),'telephone:save',this[_0xa862('0xe')][_0x362c15['device']]);}else if(this[_0xa862('0xc')][_0x362c15[_0xa862('0x31')]]){if(this[_0xa862('0xc')][_0x362c15[_0xa862('0x31')]][_0xa862('0x27')]!==_0x362c15[_0xa862('0x27')][_0xa862('0x36')]()){this['trunks'][_0x362c15['device']][_0xa862('0x34')]=_[_0xa862('0x35')](moment()['format']('x'));}this[_0xa862('0xc')][_0x362c15['device']][_0xa862('0x27')]=_0x362c15[_0xa862('0x27')]['toLowerCase']();logger[_0xa862('0x25')](_0xa862('0x39'),util['inspect'](this[_0xa862('0xc')][_0x362c15[_0xa862('0x31')]],{'showHidden':![],'depth':null}));this[_0xa862('0x21')](util[_0xa862('0x2c')](_0xa862('0x2d'),this['trunks'][_0x362c15[_0xa862('0x31')]][_0xa862('0x2e')]),_0xa862('0x2f'),this[_0xa862('0xc')][_0x362c15[_0xa862('0x31')]]);}else if(_[_0xa862('0x3a')](_0x362c15[_0xa862('0x31')],_0xa862('0x3b'))){var _0x1a5172=_0x362c15['device'];var _0x207d6b=_0x1a5172[_0xa862('0x3c')](_0x1a5172['indexOf']('/')+0x1,_0x1a5172[_0xa862('0x3d')]('@'));var _0x3b001d=_[_0xa862('0x3e')](this[_0xa862('0xd')],function(_0x30048f){return _0x30048f[_0xa862('0x3f')]==_0x207d6b||_0x30048f[_0xa862('0x40')]==_0x207d6b||_0x30048f[_0xa862('0x41')]==_0x207d6b;});if(_0x3b001d){if(_0x3b001d[_0xa862('0x27')]!==_0x362c15[_0xa862('0x27')][_0xa862('0x36')]()){_0x3b001d[_0xa862('0x34')]=_['toNumber'](moment()[_0xa862('0x2c')]('x'));}_0x3b001d[_0xa862('0x27')]=_0x362c15[_0xa862('0x27')]['toLowerCase']();_0x3b001d[_0xa862('0x33')]=!![];_0x3b001d[_0xa862('0x37')](_0x362c15);}}}}catch(_0x5f4f08){logger['error'](_0xa862('0x32'),util[_0xa862('0x1a')](_0x5f4f08,{'showHidden':![],'depth':null}));}};UserReport[_0xa862('0x1f')][_0xa862('0x13')]=function(_0x50841c){try{if(this['isNotNull'](_0x50841c)&&this[_0xa862('0x20')](_0x50841c[_0xa862('0x12')])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x50841c[_0xa862('0x42')],_0x50841c[_0xa862('0x43')],_0x50841c['peerstatus']);logger[_0xa862('0x25')]('[userReport][peerstatus]',util['inspect'](_0x50841c,{'showHidden':![],'depth':null}));if(this[_0xa862('0xd')][_0x50841c[_0xa862('0x42')]]){if(!this[_0xa862('0xd')][_0x50841c['peer']][_0xa862('0x33')]||_0x50841c[_0xa862('0x12')][_0xa862('0x36')]()=='registered'){this['agents'][_0x50841c[_0xa862('0x42')]]['local']=![];this[_0xa862('0xd')][_0x50841c[_0xa862('0x42')]][_0xa862('0x44')]=_0x50841c[_0xa862('0x12')][_0xa862('0x36')]();this['agents'][_0x50841c[_0xa862('0x42')]][_0xa862('0x43')]=_0x50841c[_0xa862('0x43')];this[_0xa862('0xd')][_0x50841c[_0xa862('0x42')]][_0xa862('0x37')](_0x50841c);}}else if(this[_0xa862('0xe')][_0x50841c[_0xa862('0x42')]]){this[_0xa862('0xe')][_0x50841c[_0xa862('0x42')]][_0xa862('0x44')]=_0x50841c[_0xa862('0x12')][_0xa862('0x36')]();this['telephones'][_0x50841c[_0xa862('0x42')]][_0xa862('0x43')]=_0x50841c[_0xa862('0x43')];logger[_0xa862('0x25')](_0xa862('0x45'),util[_0xa862('0x1a')](this[_0xa862('0xe')][_0x50841c[_0xa862('0x42')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xa862('0x38'),this[_0xa862('0xe')][_0x50841c[_0xa862('0x42')]][_0xa862('0x2e')]),_0xa862('0x46'),this[_0xa862('0xe')][_0x50841c[_0xa862('0x42')]]);}else if(this[_0xa862('0xc')][_0x50841c['peer']]){this['trunks'][_0x50841c['peer']][_0xa862('0x44')]=_0x50841c[_0xa862('0x12')][_0xa862('0x36')]();this[_0xa862('0xc')][_0x50841c[_0xa862('0x42')]][_0xa862('0x43')]=_0x50841c[_0xa862('0x43')];logger[_0xa862('0x25')](_0xa862('0x47'),util['inspect'](this[_0xa862('0xc')][_0x50841c['peer']],{'showHidden':![],'depth':null}));this[_0xa862('0x21')](util['format'](_0xa862('0x2d'),this['trunks'][_0x50841c[_0xa862('0x42')]][_0xa862('0x2e')]),_0xa862('0x2f'),this[_0xa862('0xc')][_0x50841c[_0xa862('0x42')]]);}}}catch(_0x2736fb){logger[_0xa862('0x18')](_0xa862('0x48'),util[_0xa862('0x1a')](_0x2736fb,{'showHidden':![],'depth':null}));}};module[_0xa862('0x49')]=UserReport; \ No newline at end of file +var _0x1aea=['then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','debug','[userReport][registry]','find','stateRegistry','state','merge','omit','event','username','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','inuse','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','accountcode','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncRealtimeShow','resolve'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0x1aea,0x163));var _0xa1ae=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x1aea[_0x2d344f];return _0x2e796b;};'use strict';var _=require(_0xa1ae('0x0'));var moment=require(_0xa1ae('0x1'));var util=require(_0xa1ae('0x2'));var Redis=require(_0xa1ae('0x3'));var BPromise=require(_0xa1ae('0x4'));var config=require('../../../config/environment');var logger=require(_0xa1ae('0x5'))(_0xa1ae('0x6'));var ami=require('../ami');config[_0xa1ae('0x7')]=_[_0xa1ae('0x8')](config[_0xa1ae('0x7')],{'host':_0xa1ae('0x9'),'port':0x18eb});var io=require(_0xa1ae('0xa'))(new Redis(config[_0xa1ae('0x7')]));function UserReport(_0x1947bc){this[_0xa1ae('0xb')]=_0x1947bc[_0xa1ae('0xb')];this[_0xa1ae('0xc')]=_0x1947bc[_0xa1ae('0xc')];this[_0xa1ae('0xd')]=_0x1947bc[_0xa1ae('0xd')];ami['on'](_0xa1ae('0xe'),this[_0xa1ae('0xf')][_0xa1ae('0x10')](this));ami['on']('registry',this['syncRegistry'][_0xa1ae('0x10')](this));ami['on'](_0xa1ae('0x11'),this['syncDeviceState']['bind'](this));ami['on']('peerstatus',this['syncPeerStatus'][_0xa1ae('0x10')](this));return this[_0xa1ae('0x12')]();}function showSipRegistrations(){Promise[_0xa1ae('0x13')]()[_0xa1ae('0x14')](ami[_0xa1ae('0x15')]())[_0xa1ae('0x16')](function(_0x59875e){logger['error'](_0xa1ae('0x17'),util[_0xa1ae('0x18')](_0x59875e,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xa1ae('0x13')]()[_0xa1ae('0x14')](ami[_0xa1ae('0x19')]())[_0xa1ae('0x16')](function(_0x40ad38){logger[_0xa1ae('0x1a')](_0xa1ae('0x1b'),util[_0xa1ae('0x18')](_0x40ad38,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()['then'](ami[_0xa1ae('0x1c')]())[_0xa1ae('0x16')](function(_0x49d174){logger['error'](_0xa1ae('0x1d'),util[_0xa1ae('0x18')](_0x49d174,{'showHidden':![],'depth':null}));});}UserReport[_0xa1ae('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xa1ae('0x13')]()[_0xa1ae('0x14')](showSipRegistrations())['then'](listDeviceStates())[_0xa1ae('0x14')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xa1ae('0x1f')]=function(_0x25b376){return _0x25b376!==null&&!_[_0xa1ae('0x20')](_0x25b376);};UserReport[_0xa1ae('0x1e')]['emit']=function(_0x1e580c,_0x4bacf1,_0x15a244){io['to'](_0x1e580c)[_0xa1ae('0x21')](_0x4bacf1,_0x15a244);};UserReport[_0xa1ae('0x1e')][_0xa1ae('0xf')]=function(_0xa1ca07){try{if(this[_0xa1ae('0x1f')](_0xa1ca07)){logger[_0xa1ae('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0xa1ca07['username'],_0xa1ca07['state']);logger[_0xa1ae('0x23')](_0xa1ae('0x24'),util[_0xa1ae('0x18')](_0xa1ca07,{'showHidden':![],'depth':null}));var _0x24f6ba=_[_0xa1ae('0x25')](this[_0xa1ae('0xb')],{'defaultuser':_0xa1ca07['username']});if(_0x24f6ba){_0xa1ca07[_0xa1ae('0x26')]=_0xa1ca07[_0xa1ae('0x27')];_[_0xa1ae('0x28')](_0x24f6ba,_[_0xa1ae('0x29')](_0xa1ca07,[_0xa1ae('0x2a'),'actionid',_0xa1ae('0x2b'),_0xa1ae('0x27')]));logger[_0xa1ae('0x23')](_0xa1ae('0x2c'),util['inspect'](_0x24f6ba,{'showHidden':![],'depth':null}));this[_0xa1ae('0x21')](util['format'](_0xa1ae('0x2d'),_0x24f6ba[_0xa1ae('0x2e')]),_0xa1ae('0x2f'),_0x24f6ba);}}}catch(_0x2becc4){logger['error'](_0xa1ae('0x24'),util[_0xa1ae('0x18')](_0x2becc4,{'showHidden':![],'depth':null}));}};UserReport[_0xa1ae('0x1e')]['syncDeviceState']=function(_0x2a7e69){try{if(this['isNotNull'](_0x2a7e69)){logger[_0xa1ae('0x22')](_0xa1ae('0x30'),_0x2a7e69['device'],_0x2a7e69[_0xa1ae('0x27')]);logger['debug'](_0xa1ae('0x31'),util[_0xa1ae('0x18')](_0x2a7e69,{'showHidden':![],'depth':null}));if(this['agents'][_0x2a7e69[_0xa1ae('0x32')]]){if(!this['agents'][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x33')]||_0x2a7e69[_0xa1ae('0x27')][_0xa1ae('0x34')]()==_0xa1ae('0x35')){this[_0xa1ae('0xc')][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x33')]=![];if(this[_0xa1ae('0xc')][_0x2a7e69['device']][_0xa1ae('0x27')]!==_0x2a7e69['state'][_0xa1ae('0x34')]()){this[_0xa1ae('0xc')][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x36')]=_[_0xa1ae('0x37')](moment()[_0xa1ae('0x38')]('x'));}this['agents'][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x27')]=_0x2a7e69['state']['toLowerCase']();this[_0xa1ae('0xc')][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x39')](_0x2a7e69);}}else if(this[_0xa1ae('0xd')][_0x2a7e69[_0xa1ae('0x32')]]){if(this['telephones'][_0x2a7e69[_0xa1ae('0x32')]]['state']!==_0x2a7e69[_0xa1ae('0x27')][_0xa1ae('0x34')]()){this[_0xa1ae('0xd')][_0x2a7e69[_0xa1ae('0x32')]]['stateTime']=_[_0xa1ae('0x37')](moment()[_0xa1ae('0x38')]('x'));}this[_0xa1ae('0xd')][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x27')]=_0x2a7e69[_0xa1ae('0x27')][_0xa1ae('0x34')]();logger[_0xa1ae('0x23')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0xa1ae('0xd')][_0x2a7e69[_0xa1ae('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xa1ae('0x3a'),this[_0xa1ae('0xd')][_0x2a7e69[_0xa1ae('0x32')]]['name']),_0xa1ae('0x3b'),this[_0xa1ae('0xd')][_0x2a7e69['device']]);}else if(this[_0xa1ae('0xb')][_0x2a7e69[_0xa1ae('0x32')]]){if(this[_0xa1ae('0xb')][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x27')]!==_0x2a7e69[_0xa1ae('0x27')][_0xa1ae('0x34')]()){this['trunks'][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x36')]=_[_0xa1ae('0x37')](moment()[_0xa1ae('0x38')]('x'));}this['trunks'][_0x2a7e69['device']]['state']=_0x2a7e69[_0xa1ae('0x27')][_0xa1ae('0x34')]();logger[_0xa1ae('0x23')](_0xa1ae('0x3c'),util[_0xa1ae('0x18')](this[_0xa1ae('0xb')][_0x2a7e69[_0xa1ae('0x32')]],{'showHidden':![],'depth':null}));this[_0xa1ae('0x21')](util['format'](_0xa1ae('0x2d'),this[_0xa1ae('0xb')][_0x2a7e69[_0xa1ae('0x32')]][_0xa1ae('0x2e')]),_0xa1ae('0x2f'),this['trunks'][_0x2a7e69[_0xa1ae('0x32')]]);}else if(_['startsWith'](_0x2a7e69[_0xa1ae('0x32')],_0xa1ae('0x3d'))){var _0x3fb7bc=_0x2a7e69[_0xa1ae('0x32')];var _0x32d3ed=_0x3fb7bc[_0xa1ae('0x3e')](_0x3fb7bc['indexOf']('/')+0x1,_0x3fb7bc['indexOf']('@'));var _0x56e9fa=_[_0xa1ae('0x25')](this[_0xa1ae('0xc')],function(_0x1f3c63){return _0x1f3c63['mobile']==_0x32d3ed||_0x1f3c63['phone']==_0x32d3ed||_0x1f3c63[_0xa1ae('0x3f')]==_0x32d3ed;});if(_0x56e9fa){if(_0x56e9fa[_0xa1ae('0x27')]!==_0x2a7e69[_0xa1ae('0x27')][_0xa1ae('0x34')]()){_0x56e9fa[_0xa1ae('0x36')]=_[_0xa1ae('0x37')](moment()[_0xa1ae('0x38')]('x'));}_0x56e9fa[_0xa1ae('0x27')]=_0x2a7e69[_0xa1ae('0x27')]['toLowerCase']();_0x56e9fa[_0xa1ae('0x33')]=!![];_0x56e9fa[_0xa1ae('0x39')](_0x2a7e69);}}}}catch(_0x10ced1){logger[_0xa1ae('0x1a')]('[userReport][devicestatechange]',util['inspect'](_0x10ced1,{'showHidden':![],'depth':null}));}};UserReport[_0xa1ae('0x1e')][_0xa1ae('0x40')]=function(_0x49c680){try{if(this['isNotNull'](_0x49c680)&&this['isNotNull'](_0x49c680[_0xa1ae('0x41')])){logger[_0xa1ae('0x22')](_0xa1ae('0x42'),_0x49c680['peer'],_0x49c680[_0xa1ae('0x43')],_0x49c680[_0xa1ae('0x41')]);logger['debug'](_0xa1ae('0x44'),util[_0xa1ae('0x18')](_0x49c680,{'showHidden':![],'depth':null}));if(this[_0xa1ae('0xc')][_0x49c680[_0xa1ae('0x45')]]){if(!this[_0xa1ae('0xc')][_0x49c680[_0xa1ae('0x45')]][_0xa1ae('0x33')]||_0x49c680['peerstatus'][_0xa1ae('0x34')]()==_0xa1ae('0x46')){this[_0xa1ae('0xc')][_0x49c680[_0xa1ae('0x45')]][_0xa1ae('0x33')]=![];this[_0xa1ae('0xc')][_0x49c680['peer']][_0xa1ae('0x47')]=_0x49c680['peerstatus'][_0xa1ae('0x34')]();this[_0xa1ae('0xc')][_0x49c680[_0xa1ae('0x45')]][_0xa1ae('0x43')]=_0x49c680[_0xa1ae('0x43')];this['agents'][_0x49c680['peer']][_0xa1ae('0x39')](_0x49c680);}}else if(this[_0xa1ae('0xd')][_0x49c680[_0xa1ae('0x45')]]){this[_0xa1ae('0xd')][_0x49c680[_0xa1ae('0x45')]][_0xa1ae('0x47')]=_0x49c680[_0xa1ae('0x41')][_0xa1ae('0x34')]();this['telephones'][_0x49c680['peer']][_0xa1ae('0x43')]=_0x49c680[_0xa1ae('0x43')];logger[_0xa1ae('0x23')](_0xa1ae('0x48'),util['inspect'](this[_0xa1ae('0xd')][_0x49c680[_0xa1ae('0x45')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xa1ae('0x38')](_0xa1ae('0x3a'),this['telephones'][_0x49c680[_0xa1ae('0x45')]][_0xa1ae('0x2e')]),'telephone:save',this[_0xa1ae('0xd')][_0x49c680[_0xa1ae('0x45')]]);}else if(this[_0xa1ae('0xb')][_0x49c680[_0xa1ae('0x45')]]){this['trunks'][_0x49c680['peer']][_0xa1ae('0x47')]=_0x49c680[_0xa1ae('0x41')]['toLowerCase']();this[_0xa1ae('0xb')][_0x49c680[_0xa1ae('0x45')]][_0xa1ae('0x43')]=_0x49c680[_0xa1ae('0x43')];logger[_0xa1ae('0x23')](_0xa1ae('0x49'),util[_0xa1ae('0x18')](this['trunks'][_0x49c680['peer']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xa1ae('0x2d'),this[_0xa1ae('0xb')][_0x49c680[_0xa1ae('0x45')]][_0xa1ae('0x2e')]),_0xa1ae('0x2f'),this['trunks'][_0x49c680[_0xa1ae('0x45')]]);}}}catch(_0x563460){logger[_0xa1ae('0x1a')](_0xa1ae('0x44'),util['inspect'](_0x563460,{'showHidden':![],'depth':null}));}};module[_0xa1ae('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index ddd6d3c..e3ceb5b 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 _0x1755=['interface','calleridnum','user:called','error','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','routealias','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','agentacw','destconnectedlinenum','custom:agentcomplete','destaccountcode','user:agentcomplete','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','ioredis','../../../config/logger','redis','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isUndefined','isNotNull','info','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','inbound','voice','merge','omit','event','privilege'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x1755,0xfd));var _0x5175=function(_0x300d6f,_0x3b3c28){_0x300d6f=_0x300d6f-0x0;var _0x4be581=_0x1755[_0x300d6f];return _0x4be581;};'use strict';var _=require(_0x5175('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x5175('0x1'));var config=require('../../../config/environment');var logger=require(_0x5175('0x2'))('ami');var ami=require('../ami');config[_0x5175('0x3')]=_['defaults'](config[_0x5175('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5175('0x3')]));function VoiceAgentReport(_0x53dc2b){this[_0x5175('0x4')]={};this[_0x5175('0x5')]=_0x53dc2b[_0x5175('0x4')];this[_0x5175('0x6')]=_0x53dc2b['voiceQueues'];this[_0x5175('0x7')]=_0x53dc2b[_0x5175('0x7')];this[_0x5175('0x8')]={};ami['on'](_0x5175('0x9'),this[_0x5175('0xa')][_0x5175('0xb')](this));ami['on'](_0x5175('0xc'),this['syncAgentConnect'][_0x5175('0xb')](this));ami['on'](_0x5175('0xd'),this[_0x5175('0xe')][_0x5175('0xb')](this));ami['on'](_0x5175('0xf'),this[_0x5175('0x10')][_0x5175('0xb')](this));ami['on'](_0x5175('0x11'),this[_0x5175('0x12')][_0x5175('0xb')](this));ami['on'](_0x5175('0x13'),this['syncVarSet'][_0x5175('0xb')](this));ami['on'](_0x5175('0x14'),this[_0x5175('0x15')][_0x5175('0xb')](this));ami['on'](_0x5175('0x16'),this[_0x5175('0x17')]['bind'](this));ami['on'](_0x5175('0x18'),this[_0x5175('0x19')][_0x5175('0xb')](this));ami['on'](_0x5175('0x1a'),this[_0x5175('0x1b')][_0x5175('0xb')](this));ami['on']('blindtransfer',this[_0x5175('0x1c')]['bind'](this));}VoiceAgentReport['prototype']['emit']=function(_0x278368,_0x5cb131,_0x4d86a1){io['to'](_0x278368)[_0x5175('0x1d')](_0x5cb131,_0x4d86a1);};VoiceAgentReport[_0x5175('0x1e')]['isNotNull']=function(_0xaa3fb2){return _0xaa3fb2!==null&&!_[_0x5175('0x1f')](_0xaa3fb2);};VoiceAgentReport[_0x5175('0x1e')][_0x5175('0xa')]=function(_0x2f7316){try{if(this[_0x5175('0x20')](_0x2f7316)){logger[_0x5175('0x21')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2f7316[_0x5175('0x22')],_0x2f7316[_0x5175('0x23')],_0x2f7316[_0x5175('0x24')]);logger[_0x5175('0x25')](_0x5175('0x26'),_0x2f7316[_0x5175('0x22')],util[_0x5175('0x27')](_0x2f7316,{'showHidden':![],'depth':null}));if(_[_0x5175('0x1f')](this['channels'][_0x2f7316[_0x5175('0x22')]])){this[_0x5175('0x4')][_0x2f7316[_0x5175('0x22')]]={};}if(_[_0x5175('0x1f')](this[_0x5175('0x4')][_0x2f7316[_0x5175('0x22')]][_0x2f7316[_0x5175('0x24')]])){this['channels'][_0x2f7316[_0x5175('0x22')]][_0x2f7316[_0x5175('0x24')]]={'agentcalledAt':moment()[_0x5175('0x28')](_0x5175('0x29')),'lastevent':_0x5175('0x2a'),'mandatoryDisposition':this[_0x5175('0x6')][_0x2f7316[_0x5175('0x2b')]]?this[_0x5175('0x6')][_0x2f7316[_0x5175('0x2b')]][_0x5175('0x2c')]||![]:![],'type':this[_0x5175('0x6')][_0x2f7316['queue']]?this[_0x5175('0x6')][_0x2f7316[_0x5175('0x2b')]]['type']||_0x5175('0x2d'):_0x5175('0x2d'),'variables':this['variables'][_0x2f7316[_0x5175('0x22')]],'motionChannel':_0x5175('0x2e')};}_[_0x5175('0x2f')](this['channels'][_0x2f7316['uniqueid']][_0x2f7316[_0x5175('0x24')]],_[_0x5175('0x30')](_0x2f7316,[_0x5175('0x31'),_0x5175('0x32')]));logger[_0x5175('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x2f7316[_0x5175('0x22')],util[_0x5175('0x27')](this[_0x5175('0x4')][_0x2f7316[_0x5175('0x22')]][_0x2f7316[_0x5175('0x24')]],{'showHidden':![],'depth':null}));ami[_0x5175('0x1d')]('custom:agentcalled',this[_0x5175('0x4')][_0x2f7316[_0x5175('0x22')]][_0x2f7316['destuniqueid']]);var _0x3a0d2e={'id':this[_0x5175('0x7')][_0x2f7316[_0x5175('0x33')]]['id'],'calleridnum':this['channels'][_0x2f7316[_0x5175('0x22')]][_0x2f7316[_0x5175('0x24')]][_0x5175('0x34')],'queue':this['channels'][_0x2f7316[_0x5175('0x22')]][_0x2f7316['destuniqueid']][_0x5175('0x2b')],'variables':this[_0x5175('0x4')][_0x2f7316[_0x5175('0x22')]][_0x2f7316[_0x5175('0x24')]][_0x5175('0x8')]};logger[_0x5175('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x2f7316['uniqueid'],util[_0x5175('0x27')](_0x3a0d2e,{'showHidden':![],'depth':null}));this['emit'](util[_0x5175('0x28')]('user:%s',_0x2f7316[_0x5175('0x23')]),_0x5175('0x35'),_0x3a0d2e);}}catch(_0x25e14e){logger[_0x5175('0x36')]('[%s][voiceAgentReport][agentcalled]',_0x2f7316[_0x5175('0x22')],util[_0x5175('0x27')](_0x25e14e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5175('0x37')]=function(_0x4c306b){try{if(this[_0x5175('0x20')](_0x4c306b)){if(this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]]){logger[_0x5175('0x25')](_0x5175('0x38'),_0x4c306b[_0x5175('0x22')],util[_0x5175('0x27')](_0x4c306b,{'showHidden':![],'depth':null}));for(var _0x5270bf in this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]]){if(this[_0x5175('0x4')][_0x4c306b['uniqueid']][_0x5175('0x39')](_0x5270bf)){if(_0x4c306b[_0x5175('0x24')]===_0x5270bf){logger['info'](_0x5175('0x3a'),_0x4c306b[_0x5175('0x22')],_0x4c306b[_0x5175('0x23')],_0x4c306b[_0x5175('0x24')]);this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x3b')]=moment()[_0x5175('0x28')](_0x5175('0x29'));this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x3c')]=_0x4c306b[_0x5175('0x3c')];this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x3d')]=_0x4c306b[_0x5175('0x3d')];this['channels'][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x3e')]=_0x4c306b[_0x5175('0x3e')];this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf]['destchannelstatedesc']=_0x4c306b[_0x5175('0x3f')];this[_0x5175('0x4')][_0x4c306b['uniqueid']][_0x5270bf][_0x5175('0x40')]=_0x4c306b[_0x5175('0x40')];this['channels'][_0x4c306b[_0x5175('0x22')]][_0x5270bf]['lastevent']='connect';if(this['voiceChannels'][this[_0x5175('0x4')][_0x4c306b['uniqueid']][_0x5270bf][_0x5175('0x22')]]){var _0x3da745=this['voiceChannels'][this[_0x5175('0x4')][_0x4c306b['uniqueid']][_0x5270bf]['uniqueid']][_0x5175('0x41')];this['channels'][_0x4c306b['uniqueid']][_0x5270bf]['routealias']=_0x3da745;_0x4c306b['routealias']=_0x3da745;}_[_0x5175('0x2f')](this[_0x5175('0x7')][_0x4c306b[_0x5175('0x33')]],_[_0x5175('0x42')](_0x4c306b,[_0x5175('0x2b'),'destconnectedlinenum',_0x5175('0x41')]));logger[_0x5175('0x25')](_0x5175('0x43'),_0x4c306b[_0x5175('0x22')],util['inspect'](this['channels'][_0x4c306b['uniqueid']][_0x4c306b[_0x5175('0x24')]],{'showHidden':![],'depth':null}));ami[_0x5175('0x1d')](_0x5175('0x44'),this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x4c306b['destuniqueid']]);logger[_0x5175('0x25')](_0x5175('0x45'),_0x4c306b[_0x5175('0x22')],util[_0x5175('0x27')](this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x4c306b[_0x5175('0x24')]],{'showHidden':![],'depth':null}));this[_0x5175('0x1d')](util[_0x5175('0x28')](_0x5175('0x46'),_0x4c306b[_0x5175('0x23')]),_0x5175('0x47'),this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x4c306b[_0x5175('0x24')]]);}else if(!this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf]['agentringnoanswer']&&!this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x11')]){logger[_0x5175('0x21')](_0x5175('0x48'),_0x4c306b[_0x5175('0x22')],this[_0x5175('0x4')][_0x4c306b['uniqueid']][_0x5270bf][_0x5175('0x23')],_0x5270bf);this[_0x5175('0x4')][_0x4c306b['uniqueid']][_0x5270bf][_0x5175('0xd')]=!![];this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x49')]=moment()[_0x5175('0x28')](_0x5175('0x29'));this['channels'][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x4a')]=_0x4c306b[_0x5175('0x24')];this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x4b')]=_0x4c306b[_0x5175('0x23')];this['channels'][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x4c')]=_0x5175('0x4d');this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf][_0x5175('0x4e')]='answered_elsewhere';logger[_0x5175('0x25')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x4c306b[_0x5175('0x22')],util['inspect'](this[_0x5175('0x4')][_0x4c306b['uniqueid']][_0x5270bf],{'showHidden':![],'depth':null}));ami[_0x5175('0x1d')](_0x5175('0x4f'),this[_0x5175('0x4')][_0x4c306b[_0x5175('0x22')]][_0x5270bf]);}}}}}}catch(_0x5d7937){logger['error'](_0x5175('0x50'),_0x4c306b[_0x5175('0x22')],util[_0x5175('0x27')](_0x5d7937,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5175('0x1e')]['syncAgentRingNoAnswer']=function(_0x504837){try{if(this[_0x5175('0x20')](_0x504837)){logger[_0x5175('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x504837[_0x5175('0x22')],util['inspect'](_0x504837,{'showHidden':![],'depth':null}));if(this[_0x5175('0x4')][_0x504837[_0x5175('0x22')]]&&this[_0x5175('0x4')][_0x504837[_0x5175('0x22')]][_0x504837[_0x5175('0x24')]]){logger[_0x5175('0x21')](_0x5175('0x51'),_0x504837['uniqueid'],_0x504837[_0x5175('0x23')],_0x504837[_0x5175('0x24')]);this[_0x5175('0x4')][_0x504837[_0x5175('0x22')]][_0x504837['destuniqueid']][_0x5175('0xd')]=!![];this[_0x5175('0x4')][_0x504837[_0x5175('0x22')]][_0x504837['destuniqueid']]['agentringnoanswerAt']=moment()[_0x5175('0x28')](_0x5175('0x29'));this['channels'][_0x504837['uniqueid']][_0x504837['destuniqueid']][_0x5175('0x4c')]='rejected';this[_0x5175('0x4')][_0x504837[_0x5175('0x22')]][_0x504837[_0x5175('0x24')]]['reason']=_0x5175('0x52');logger[_0x5175('0x25')](_0x5175('0x53'),_0x504837[_0x5175('0x22')],util[_0x5175('0x27')](this[_0x5175('0x4')][_0x504837['uniqueid']][_0x504837[_0x5175('0x24')]],{'showHidden':![],'depth':null}));ami[_0x5175('0x1d')](_0x5175('0x54'),this[_0x5175('0x4')][_0x504837[_0x5175('0x22')]][_0x504837[_0x5175('0x24')]]);}}}catch(_0x3587f7){logger[_0x5175('0x36')](_0x5175('0x55'),_0x504837[_0x5175('0x22')],util[_0x5175('0x27')](_0x3587f7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5175('0x10')]=function(_0x1b4a28){try{if(this['isNotNull'](_0x1b4a28)){logger[_0x5175('0x25')](_0x5175('0x56'),_0x1b4a28['uniqueid'],util['inspect'](_0x1b4a28,{'showHidden':![],'depth':null}));if(this['channels'][_0x1b4a28[_0x5175('0x22')]]){for(var _0xc801db in this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]]){if(this['channels'][_0x1b4a28[_0x5175('0x22')]][_0x5175('0x39')](_0xc801db)&&!this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]][_0xc801db][_0x5175('0xd')]&&!this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]][_0xc801db]['agentcomplete']){logger[_0x5175('0x21')](_0x5175('0x57'),_0x1b4a28['uniqueid'],this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]][_0xc801db]['membername'],_0xc801db);this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]][_0xc801db][_0x5175('0xd')]=!![];this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]][_0xc801db][_0x5175('0x49')]=moment()[_0x5175('0x28')](_0x5175('0x29'));this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]][_0xc801db][_0x5175('0x4c')]=_0x5175('0x58');this[_0x5175('0x4')][_0x1b4a28['uniqueid']][_0xc801db][_0x5175('0x4e')]=_0x5175('0x58');logger[_0x5175('0x25')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x1b4a28[_0x5175('0x22')],util['inspect'](this['channels'][_0x1b4a28[_0x5175('0x22')]][_0xc801db],{'showHidden':![],'depth':null}));ami[_0x5175('0x1d')](_0x5175('0x59'),this[_0x5175('0x4')][_0x1b4a28[_0x5175('0x22')]][_0xc801db]);}}}}}catch(_0x55c531){logger[_0x5175('0x36')](_0x5175('0x5a'),_0x1b4a28['uniqueid'],util['inspect'](_0x55c531,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5175('0x1e')][_0x5175('0x12')]=function(_0x5df099){try{if(this['isNotNull'](_0x5df099)){logger[_0x5175('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x5df099[_0x5175('0x22')],util[_0x5175('0x27')](_0x5df099,{'showHidden':![],'depth':null}));if(this[_0x5175('0x4')][_0x5df099[_0x5175('0x22')]]){for(var _0xe09fa0 in this[_0x5175('0x4')][_0x5df099['uniqueid']]){if(this[_0x5175('0x4')][_0x5df099[_0x5175('0x22')]][_0x5175('0x39')](_0xe09fa0)){if(this[_0x5175('0x4')][_0x5df099['uniqueid']][_0xe09fa0][_0x5175('0x3b')]&&!this['channels'][_0x5df099[_0x5175('0x22')]][_0xe09fa0]['agentcomplete']){logger[_0x5175('0x21')](_0x5175('0x5b'),_0x5df099[_0x5175('0x22')],this[_0x5175('0x4')][_0x5df099[_0x5175('0x22')]][_0xe09fa0][_0x5175('0x23')],_0xe09fa0);this[_0x5175('0x4')][_0x5df099['uniqueid']][_0xe09fa0]['agentcomplete']=!![];this['channels'][_0x5df099[_0x5175('0x22')]][_0xe09fa0][_0x5175('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x5175('0x4')][_0x5df099[_0x5175('0x22')]][_0xe09fa0][_0x5175('0x4c')]=_0x5175('0x5d');this[_0x5175('0x4')][_0x5df099[_0x5175('0x22')]][_0xe09fa0][_0x5175('0x4e')]=_0x5df099[_0x5175('0x4e')]==_0x5175('0x5e')?_0x5175('0x5f'):_0x5df099[_0x5175('0x4e')];this['channels'][_0x5df099[_0x5175('0x22')]][_0xe09fa0]['talktime']=_0x5df099[_0x5175('0x60')];if(this[_0x5175('0x6')][_0x5df099[_0x5175('0x2b')]]&&this[_0x5175('0x6')][_0x5df099['queue']][_0x5175('0x61')]){this[_0x5175('0x4')][_0x5df099['uniqueid']][_0xe09fa0]['acwtime']=this['voiceQueues'][_0x5df099[_0x5175('0x2b')]]['acwTimeout'];this[_0x5175('0x4')][_0x5df099[_0x5175('0x22')]][_0xe09fa0][_0x5175('0x62')]=!![];}this[_0x5175('0x7')][_0x5df099[_0x5175('0x33')]]=_[_0x5175('0x30')](this[_0x5175('0x7')][_0x5df099['interface']],[_0x5175('0x2b'),_0x5175('0x63')]);logger[_0x5175('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x5df099[_0x5175('0x22')],util['inspect'](this['channels'][_0x5df099[_0x5175('0x22')]][_0xe09fa0],{'showHidden':![],'depth':null}));ami[_0x5175('0x1d')](_0x5175('0x64'),this[_0x5175('0x4')][_0x5df099[_0x5175('0x22')]][_0xe09fa0]);logger[_0x5175('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x5df099['uniqueid'],util[_0x5175('0x27')]({'id':this[_0x5175('0x7')][_0x5df099['interface']]['id'],'destaccountcode':_0x5df099[_0x5175('0x65')]},{'showHidden':![],'depth':null}));this[_0x5175('0x1d')](util[_0x5175('0x28')](_0x5175('0x46'),_0x5df099[_0x5175('0x23')]),_0x5175('0x66'),{'id':this[_0x5175('0x7')][_0x5df099[_0x5175('0x33')]]['id'],'destaccountcode':_0x5df099[_0x5175('0x65')]});}}}}}}catch(_0x4f18b6){logger[_0x5175('0x36')]('[%s][voiceAgentReport][agentcomplete]',_0x5df099[_0x5175('0x22')],util[_0x5175('0x27')](_0x4f18b6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5175('0x67')]=function(_0x5a9783){try{if(this[_0x5175('0x20')](_0x5a9783)){logger['debug'](_0x5175('0x68'),_0x5a9783[_0x5175('0x22')],util['inspect'](_0x5a9783,{'showHidden':![],'depth':null}));this['addVariable'](_0x5a9783[_0x5175('0x22')],_[_0x5175('0x69')](_0x5a9783['variable'])[0x0],_0x5a9783[_0x5175('0x6a')]);if(this[_0x5175('0x4')][_0x5a9783[_0x5175('0x22')]]){for(var _0x25c98f in this[_0x5175('0x4')][_0x5a9783[_0x5175('0x22')]]){if(this['channels'][_0x5a9783[_0x5175('0x22')]]['hasOwnProperty'](_0x25c98f)){logger['info'](_0x5175('0x6b'),_0x5a9783['uniqueid'],_0x25c98f,_[_0x5175('0x69')](_0x5a9783[_0x5175('0x6c')])[0x0],_0x5a9783[_0x5175('0x6a')]);if(_['isUndefined'](this['channels'][_0x5a9783[_0x5175('0x22')]][_0x25c98f][_0x5175('0x8')])){this[_0x5175('0x4')][_0x5a9783[_0x5175('0x22')]][_0x25c98f][_0x5175('0x8')]={};}this[_0x5175('0x4')][_0x5a9783[_0x5175('0x22')]][_0x25c98f][_0x5175('0x8')]=this[_0x5175('0x8')][_0x5a9783[_0x5175('0x22')]];}}}}}catch(_0x1e9d60){logger[_0x5175('0x36')](_0x5175('0x6d'),_0x5a9783[_0x5175('0x22')],util[_0x5175('0x27')](_0x1e9d60,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5175('0x1e')][_0x5175('0x6e')]=function(_0x5d5b7b,_0x598dc4,_0x159efa){var _0x44650c=['rtpaudioqos','rtpaudioqosbridged',_0x5175('0x6f'),_0x5175('0x70'),_0x5175('0x71'),_0x5175('0x72'),_0x5175('0x73'),_0x5175('0x74'),'sipcallid','sipuri',_0x5175('0x75'),_0x5175('0x76'),_0x5175('0x77'),_0x5175('0x78'),_0x5175('0x79'),_0x5175('0x7a'),'membername',_0x5175('0x7b'),_0x5175('0x7c')];if(!_[_0x5175('0x7d')](_0x598dc4)&&!_[_0x5175('0x7e')](_0x44650c,_0x598dc4)){if(_[_0x5175('0x1f')](this[_0x5175('0x8')][_0x5d5b7b])){this[_0x5175('0x8')][_0x5d5b7b]={};}this['variables'][_0x5d5b7b][_0x598dc4]=_0x159efa;}};VoiceAgentReport[_0x5175('0x1e')][_0x5175('0x15')]=function(_0xdbd8af){try{if(this[_0x5175('0x20')](_0xdbd8af)){logger[_0x5175('0x25')]('[%s][voiceAgentReport][hangup]\x20event:',_0xdbd8af[_0x5175('0x22')],util['inspect'](_0xdbd8af,{'showHidden':![],'depth':null}));if(this['channels'][_0xdbd8af[_0x5175('0x22')]]){for(var _0x5dc19c in this['channels'][_0xdbd8af['uniqueid']]){if(this[_0x5175('0x4')][_0xdbd8af[_0x5175('0x22')]][_0x5175('0x39')](_0x5dc19c)){if(this[_0x5175('0x4')][_0xdbd8af[_0x5175('0x22')]][_0x5dc19c][_0x5175('0x4e')]==_0x5175('0x5e')&&this[_0x5175('0x4')][_0xdbd8af[_0x5175('0x22')]][_0x5dc19c][_0x5175('0x11')]){logger[_0x5175('0x21')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0xdbd8af[_0x5175('0x22')],_0x5dc19c);this['channels'][_0xdbd8af[_0x5175('0x22')]][_0x5dc19c][_0x5175('0x5c')]=moment()[_0x5175('0x28')](_0x5175('0x29'));}}}logger[_0x5175('0x25')](_0x5175('0x7f'),_0xdbd8af[_0x5175('0x22')],util[_0x5175('0x27')](_[_0x5175('0x80')](this[_0x5175('0x4')][_0xdbd8af[_0x5175('0x22')]]),{'showHidden':![],'depth':null}));ami[_0x5175('0x1d')](_0x5175('0x81'),_[_0x5175('0x80')](this[_0x5175('0x4')][_0xdbd8af[_0x5175('0x22')]]));delete this[_0x5175('0x4')][_0xdbd8af[_0x5175('0x22')]];}if(this['variables'][_0xdbd8af[_0x5175('0x22')]]){delete this[_0x5175('0x8')][_0xdbd8af[_0x5175('0x22')]];}}}catch(_0x170fec){logger[_0x5175('0x36')](_0x5175('0x82'),_0xdbd8af[_0x5175('0x22')],util[_0x5175('0x27')](_0x170fec,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5175('0x1b')]=function(_0xe1cfdf){try{if(this[_0x5175('0x20')](_0xe1cfdf)){logger['debug'](_0x5175('0x83'),_0xe1cfdf['uniqueid'],util[_0x5175('0x27')](_0xe1cfdf,{'showHidden':![],'depth':null}));if(this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]]){for(var _0x510f7a in this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]]){if(this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]][_0x5175('0x39')](_0x510f7a)){if(_0xe1cfdf[_0x5175('0x85')]===_0x510f7a){logger['info'](_0x5175('0x86'),_0xe1cfdf[_0x5175('0x22')],this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]][_0x510f7a][_0x5175('0x23')],_0x510f7a);var _0x4a8793=moment();this['channels'][_0xe1cfdf[_0x5175('0x84')]][_0x510f7a]['agentcomplete']=!![];this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]][_0x510f7a][_0x5175('0x5c')]=moment()[_0x5175('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]][_0x510f7a][_0x5175('0x4c')]=_0x5175('0x5d');this['channels'][_0xe1cfdf[_0x5175('0x84')]][_0x510f7a]['reason']=_0x5175('0x5e');this[_0x5175('0x4')][_0xe1cfdf['transfereeuniqueid']][_0x510f7a][_0x5175('0x60')]=_0x4a8793[_0x5175('0x87')](this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]][_0x510f7a][_0x5175('0x3b')],_0x5175('0x88'));}}}}if(this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x89')]]){var _0x32e37a=this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x89')]];this[_0x5175('0x4')][_0xe1cfdf['secondtransfereruniqueid']]=this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]];this[_0x5175('0x4')][_0xe1cfdf[_0x5175('0x84')]]=_0x32e37a;}}}catch(_0x42cb62){logger[_0x5175('0x36')]('[%s][voiceAgentReport][attendedtransfer]',_0xe1cfdf[_0x5175('0x22')],util[_0x5175('0x27')](_0x42cb62,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5175('0x1e')][_0x5175('0x1c')]=function(_0x2768e3){try{if(this[_0x5175('0x20')](_0x2768e3)){logger['debug'](_0x5175('0x8a'),_0x2768e3[_0x5175('0x22')],util[_0x5175('0x27')](_0x2768e3,{'showHidden':![],'depth':null}));if(this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]]){for(var _0x47fcf2 in this['channels'][_0x2768e3['transfereeuniqueid']]){if(this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]][_0x5175('0x39')](_0x47fcf2)){if(_0x2768e3['transfereruniqueid']===_0x47fcf2){logger[_0x5175('0x21')](_0x5175('0x8b'),_0x2768e3[_0x5175('0x22')],this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]][_0x47fcf2][_0x5175('0x23')],_0x47fcf2);var _0x50a427=moment();this[_0x5175('0x4')][_0x2768e3['transfereeuniqueid']][_0x47fcf2][_0x5175('0x11')]=!![];this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]][_0x47fcf2][_0x5175('0x5c')]=_0x50a427;this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]][_0x47fcf2]['lastevent']=_0x5175('0x5d');this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]][_0x47fcf2][_0x5175('0x4e')]=_0x5175('0x5e');this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]][_0x47fcf2][_0x5175('0x60')]=_0x50a427[_0x5175('0x87')](this[_0x5175('0x4')][_0x2768e3[_0x5175('0x84')]][_0x47fcf2]['agentconnectAt'],_0x5175('0x88'));}}}}}}catch(_0xf3351d){logger[_0x5175('0x36')](_0x5175('0x8c'),_0x2768e3[_0x5175('0x22')],util[_0x5175('0x27')](_0xf3351d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5175('0x1e')][_0x5175('0x17')]=function(_0x44ba80){var _0x110646='';try{if(this[_0x5175('0x20')](_0x44ba80)){logger[_0x5175('0x25')](_0x5175('0x8d'),_0x44ba80[_0x5175('0x22')],util['inspect'](_0x44ba80,{'showHidden':![],'depth':null}));if(_0x44ba80[_0x5175('0x8e')]){_0x110646=_0x44ba80[_0x5175('0x8e')]['substring'](0x0,_0x44ba80[_0x5175('0x8e')]['lastIndexOf']('-'));if(this[_0x5175('0x7')][_0x110646]){logger['info'](_0x5175('0x8f'),_0x44ba80[_0x5175('0x22')],_0x110646);this['agents'][_0x110646][_0x5175('0x90')]=!![];}}}}catch(_0x45bb82){logger['error'](_0x5175('0x91'),_0x44ba80[_0x5175('0x22')],util[_0x5175('0x27')](_0x45bb82,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5175('0x19')]=function(_0xacdeee){var _0x487ee9='';try{if(this[_0x5175('0x20')](_0xacdeee)){logger[_0x5175('0x25')](_0x5175('0x92'),_0xacdeee[_0x5175('0x22')],util[_0x5175('0x27')](_0xacdeee,{'showHidden':![],'depth':null}));if(_0xacdeee[_0x5175('0x8e')]){_0x487ee9=_0xacdeee[_0x5175('0x8e')][_0x5175('0x93')](0x0,_0xacdeee[_0x5175('0x8e')][_0x5175('0x94')]('-'));if(this[_0x5175('0x7')][_0x487ee9]){logger[_0x5175('0x21')](_0x5175('0x95'),_0xacdeee[_0x5175('0x22')],_0x487ee9);this[_0x5175('0x7')][_0x487ee9]['onhold']=![];}}}}catch(_0x31d0f4){logger[_0x5175('0x36')](_0x5175('0x96'),_0xacdeee[_0x5175('0x22')],util[_0x5175('0x27')](_0x31d0f4,{'showHidden':![],'depth':null}));}};module[_0x5175('0x97')]=VoiceAgentReport; \ No newline at end of file +var _0x70fc=['channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','syncHangup','musiconholdstart','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','merge','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','inspect','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentcomplete','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring'];(function(_0x47976f,_0x3b9b32){var _0x2f7836=function(_0x374242){while(--_0x374242){_0x47976f['push'](_0x47976f['shift']());}};_0x2f7836(++_0x3b9b32);}(_0x70fc,0xa2));var _0xc70f=function(_0x2ae8de,_0x309cc2){_0x2ae8de=_0x2ae8de-0x0;var _0x30f601=_0x70fc[_0x2ae8de];return _0x30f601;};'use strict';var _=require(_0xc70f('0x0'));var moment=require(_0xc70f('0x1'));var util=require(_0xc70f('0x2'));var Redis=require(_0xc70f('0x3'));var config=require(_0xc70f('0x4'));var logger=require(_0xc70f('0x5'))('ami');var ami=require('../ami');config[_0xc70f('0x6')]=_['defaults'](config[_0xc70f('0x6')],{'host':_0xc70f('0x7'),'port':0x18eb});var io=require(_0xc70f('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x54e34f){this[_0xc70f('0x9')]={};this[_0xc70f('0xa')]=_0x54e34f[_0xc70f('0x9')];this[_0xc70f('0xb')]=_0x54e34f[_0xc70f('0xb')];this[_0xc70f('0xc')]=_0x54e34f['agents'];this[_0xc70f('0xd')]={};ami['on'](_0xc70f('0xe'),this['syncAgentCalled'][_0xc70f('0xf')](this));ami['on'](_0xc70f('0x10'),this['syncAgentConnect'][_0xc70f('0xf')](this));ami['on'](_0xc70f('0x11'),this[_0xc70f('0x12')][_0xc70f('0xf')](this));ami['on'](_0xc70f('0x13'),this[_0xc70f('0x14')][_0xc70f('0xf')](this));ami['on']('agentcomplete',this[_0xc70f('0x15')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xc70f('0xf')](this));ami['on']('hangup',this[_0xc70f('0x16')][_0xc70f('0xf')](this));ami['on'](_0xc70f('0x17'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0xc70f('0xf')](this));ami['on'](_0xc70f('0x18'),this[_0xc70f('0x19')][_0xc70f('0xf')](this));ami['on'](_0xc70f('0x1a'),this[_0xc70f('0x1b')]['bind'](this));}VoiceAgentReport['prototype'][_0xc70f('0x1c')]=function(_0x54fc56,_0x45189c,_0x240f04){io['to'](_0x54fc56)[_0xc70f('0x1c')](_0x45189c,_0x240f04);};VoiceAgentReport[_0xc70f('0x1d')][_0xc70f('0x1e')]=function(_0x3055f3){return _0x3055f3!==null&&!_[_0xc70f('0x1f')](_0x3055f3);};VoiceAgentReport[_0xc70f('0x1d')][_0xc70f('0x20')]=function(_0x3f7fb0){try{if(this['isNotNull'](_0x3f7fb0)){logger[_0xc70f('0x21')](_0xc70f('0x22'),_0x3f7fb0[_0xc70f('0x23')],_0x3f7fb0[_0xc70f('0x24')],_0x3f7fb0['destuniqueid']);logger[_0xc70f('0x25')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x3f7fb0[_0xc70f('0x23')],util['inspect'](_0x3f7fb0,{'showHidden':![],'depth':null}));if(_[_0xc70f('0x1f')](this[_0xc70f('0x9')][_0x3f7fb0[_0xc70f('0x23')]])){this[_0xc70f('0x9')][_0x3f7fb0[_0xc70f('0x23')]]={};}if(_[_0xc70f('0x1f')](this[_0xc70f('0x9')][_0x3f7fb0[_0xc70f('0x23')]][_0x3f7fb0[_0xc70f('0x26')]])){this['channels'][_0x3f7fb0['uniqueid']][_0x3f7fb0[_0xc70f('0x26')]]={'agentcalledAt':moment()[_0xc70f('0x27')](_0xc70f('0x28')),'lastevent':'called','mandatoryDisposition':this[_0xc70f('0xb')][_0x3f7fb0[_0xc70f('0x29')]]?this[_0xc70f('0xb')][_0x3f7fb0[_0xc70f('0x29')]][_0xc70f('0x2a')]||![]:![],'type':this[_0xc70f('0xb')][_0x3f7fb0['queue']]?this[_0xc70f('0xb')][_0x3f7fb0[_0xc70f('0x29')]][_0xc70f('0x2b')]||_0xc70f('0x2c'):_0xc70f('0x2c'),'variables':this[_0xc70f('0xd')][_0x3f7fb0['uniqueid']],'motionChannel':_0xc70f('0x2d')};}_[_0xc70f('0x2e')](this[_0xc70f('0x9')][_0x3f7fb0['uniqueid']][_0x3f7fb0['destuniqueid']],_['omit'](_0x3f7fb0,['event',_0xc70f('0x2f')]));logger[_0xc70f('0x25')](_0xc70f('0x30'),_0x3f7fb0[_0xc70f('0x23')],util['inspect'](this[_0xc70f('0x9')][_0x3f7fb0[_0xc70f('0x23')]][_0x3f7fb0['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xc70f('0x1c')](_0xc70f('0x31'),this[_0xc70f('0x9')][_0x3f7fb0[_0xc70f('0x23')]][_0x3f7fb0['destuniqueid']]);var _0x519c85={'id':this[_0xc70f('0xc')][_0x3f7fb0[_0xc70f('0x32')]]['id'],'calleridnum':this['channels'][_0x3f7fb0[_0xc70f('0x23')]][_0x3f7fb0['destuniqueid']][_0xc70f('0x33')],'queue':this[_0xc70f('0x9')][_0x3f7fb0['uniqueid']][_0x3f7fb0[_0xc70f('0x26')]][_0xc70f('0x29')],'variables':this['channels'][_0x3f7fb0[_0xc70f('0x23')]][_0x3f7fb0['destuniqueid']][_0xc70f('0xd')]};logger[_0xc70f('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x3f7fb0['uniqueid'],util[_0xc70f('0x34')](_0x519c85,{'showHidden':![],'depth':null}));this['emit'](util[_0xc70f('0x27')](_0xc70f('0x35'),_0x3f7fb0[_0xc70f('0x24')]),_0xc70f('0x36'),_0x519c85);}}catch(_0x14d7f1){logger['error'](_0xc70f('0x37'),_0x3f7fb0[_0xc70f('0x23')],util['inspect'](_0x14d7f1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc70f('0x1d')][_0xc70f('0x38')]=function(_0x564644){try{if(this['isNotNull'](_0x564644)){if(this['channels'][_0x564644[_0xc70f('0x23')]]){logger[_0xc70f('0x25')](_0xc70f('0x39'),_0x564644['uniqueid'],util['inspect'](_0x564644,{'showHidden':![],'depth':null}));for(var _0x1c180e in this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]]){if(this['channels'][_0x564644['uniqueid']][_0xc70f('0x3a')](_0x1c180e)){if(_0x564644[_0xc70f('0x26')]===_0x1c180e){logger[_0xc70f('0x21')](_0xc70f('0x3b'),_0x564644[_0xc70f('0x23')],_0x564644[_0xc70f('0x24')],_0x564644[_0xc70f('0x26')]);this['channels'][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x3c')]=moment()['format'](_0xc70f('0x28'));this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e]['connectedlinename']=_0x564644[_0xc70f('0x3d')];this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e]['connectedlinenum']=_0x564644[_0xc70f('0x3e')];this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x3f')]=_0x564644[_0xc70f('0x3f')];this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x40')]=_0x564644['destchannelstatedesc'];this['channels'][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x41')]=_0x564644[_0xc70f('0x41')];this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x42')]=_0xc70f('0x43');if(this[_0xc70f('0xa')][this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x23')]]){var _0x3c9e6e=this[_0xc70f('0xa')][this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x23')]]['routealias'];this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x44')]=_0x3c9e6e;_0x564644[_0xc70f('0x44')]=_0x3c9e6e;}_[_0xc70f('0x2e')](this[_0xc70f('0xc')][_0x564644[_0xc70f('0x32')]],_['pick'](_0x564644,[_0xc70f('0x29'),_0xc70f('0x45'),_0xc70f('0x44')]));logger[_0xc70f('0x25')](_0xc70f('0x46'),_0x564644[_0xc70f('0x23')],util[_0xc70f('0x34')](this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x564644[_0xc70f('0x26')]],{'showHidden':![],'depth':null}));ami[_0xc70f('0x1c')](_0xc70f('0x47'),this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x564644['destuniqueid']]);logger[_0xc70f('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x564644[_0xc70f('0x23')],util[_0xc70f('0x34')](this['channels'][_0x564644[_0xc70f('0x23')]][_0x564644[_0xc70f('0x26')]],{'showHidden':![],'depth':null}));this[_0xc70f('0x1c')](util[_0xc70f('0x27')](_0xc70f('0x35'),_0x564644[_0xc70f('0x24')]),_0xc70f('0x48'),this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x564644[_0xc70f('0x26')]]);}else if(!this['channels'][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x11')]&&!this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e]['agentcomplete']){logger[_0xc70f('0x21')](_0xc70f('0x49'),_0x564644['uniqueid'],this['channels'][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x24')],_0x1c180e);this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x11')]=!![];this['channels'][_0x564644[_0xc70f('0x23')]][_0x1c180e]['agentringnoanswerAt']=moment()[_0xc70f('0x27')](_0xc70f('0x28'));this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x4a')]=_0x564644[_0xc70f('0x26')];this['channels'][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x4b')]=_0x564644[_0xc70f('0x24')];this[_0xc70f('0x9')][_0x564644['uniqueid']][_0x1c180e][_0xc70f('0x42')]='answered_elsewhere';this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e][_0xc70f('0x4c')]=_0xc70f('0x4d');logger['debug'](_0xc70f('0x4e'),_0x564644[_0xc70f('0x23')],util['inspect'](this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e],{'showHidden':![],'depth':null}));ami['emit'](_0xc70f('0x4f'),this[_0xc70f('0x9')][_0x564644[_0xc70f('0x23')]][_0x1c180e]);}}}}}}catch(_0xadcffa){logger['error']('[%s][voiceAgentReport][agentconnect]',_0x564644[_0xc70f('0x23')],util['inspect'](_0xadcffa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc70f('0x1d')]['syncAgentRingNoAnswer']=function(_0x79cda8){try{if(this[_0xc70f('0x1e')](_0x79cda8)){logger[_0xc70f('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x79cda8[_0xc70f('0x23')],util['inspect'](_0x79cda8,{'showHidden':![],'depth':null}));if(this[_0xc70f('0x9')][_0x79cda8[_0xc70f('0x23')]]&&this[_0xc70f('0x9')][_0x79cda8[_0xc70f('0x23')]][_0x79cda8['destuniqueid']]){logger['info'](_0xc70f('0x50'),_0x79cda8['uniqueid'],_0x79cda8[_0xc70f('0x24')],_0x79cda8[_0xc70f('0x26')]);this['channels'][_0x79cda8[_0xc70f('0x23')]][_0x79cda8['destuniqueid']]['agentringnoanswer']=!![];this[_0xc70f('0x9')][_0x79cda8['uniqueid']][_0x79cda8['destuniqueid']][_0xc70f('0x51')]=moment()[_0xc70f('0x27')](_0xc70f('0x28'));this[_0xc70f('0x9')][_0x79cda8[_0xc70f('0x23')]][_0x79cda8['destuniqueid']][_0xc70f('0x42')]=_0xc70f('0x52');this[_0xc70f('0x9')][_0x79cda8[_0xc70f('0x23')]][_0x79cda8['destuniqueid']]['reason']=_0xc70f('0x52');logger[_0xc70f('0x25')](_0xc70f('0x53'),_0x79cda8[_0xc70f('0x23')],util[_0xc70f('0x34')](this[_0xc70f('0x9')][_0x79cda8['uniqueid']][_0x79cda8['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xc70f('0x1c')]('custom:agentringnoanswer',this[_0xc70f('0x9')][_0x79cda8[_0xc70f('0x23')]][_0x79cda8[_0xc70f('0x26')]]);}}}catch(_0x10207e){logger[_0xc70f('0x54')](_0xc70f('0x55'),_0x79cda8['uniqueid'],util[_0xc70f('0x34')](_0x10207e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc70f('0x1d')][_0xc70f('0x14')]=function(_0x425f01){try{if(this['isNotNull'](_0x425f01)){logger[_0xc70f('0x25')](_0xc70f('0x56'),_0x425f01[_0xc70f('0x23')],util[_0xc70f('0x34')](_0x425f01,{'showHidden':![],'depth':null}));if(this[_0xc70f('0x9')][_0x425f01[_0xc70f('0x23')]]){for(var _0x3290b6 in this[_0xc70f('0x9')][_0x425f01[_0xc70f('0x23')]]){if(this['channels'][_0x425f01[_0xc70f('0x23')]][_0xc70f('0x3a')](_0x3290b6)&&!this[_0xc70f('0x9')][_0x425f01[_0xc70f('0x23')]][_0x3290b6][_0xc70f('0x11')]&&!this[_0xc70f('0x9')][_0x425f01['uniqueid']][_0x3290b6][_0xc70f('0x57')]){logger['info'](_0xc70f('0x58'),_0x425f01['uniqueid'],this[_0xc70f('0x9')][_0x425f01[_0xc70f('0x23')]][_0x3290b6][_0xc70f('0x24')],_0x3290b6);this[_0xc70f('0x9')][_0x425f01[_0xc70f('0x23')]][_0x3290b6][_0xc70f('0x11')]=!![];this[_0xc70f('0x9')][_0x425f01[_0xc70f('0x23')]][_0x3290b6]['agentringnoanswerAt']=moment()[_0xc70f('0x27')](_0xc70f('0x28'));this[_0xc70f('0x9')][_0x425f01['uniqueid']][_0x3290b6]['lastevent']=_0xc70f('0x59');this['channels'][_0x425f01[_0xc70f('0x23')]][_0x3290b6][_0xc70f('0x4c')]='abandoned';logger['debug'](_0xc70f('0x5a'),_0x425f01[_0xc70f('0x23')],util[_0xc70f('0x34')](this[_0xc70f('0x9')][_0x425f01['uniqueid']][_0x3290b6],{'showHidden':![],'depth':null}));ami[_0xc70f('0x1c')](_0xc70f('0x5b'),this['channels'][_0x425f01['uniqueid']][_0x3290b6]);}}}}}catch(_0x2e1473){logger[_0xc70f('0x54')]('[%s][voiceAgentReport][queuecallerabandon]',_0x425f01['uniqueid'],util[_0xc70f('0x34')](_0x2e1473,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x77821b){try{if(this[_0xc70f('0x1e')](_0x77821b)){logger[_0xc70f('0x25')](_0xc70f('0x5c'),_0x77821b['uniqueid'],util['inspect'](_0x77821b,{'showHidden':![],'depth':null}));if(this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]]){for(var _0x3c3022 in this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]]){if(this[_0xc70f('0x9')][_0x77821b['uniqueid']][_0xc70f('0x3a')](_0x3c3022)){if(this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x3c')]&&!this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x57')]){logger[_0xc70f('0x21')](_0xc70f('0x5d'),_0x77821b[_0xc70f('0x23')],this['channels'][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x24')],_0x3c3022);this['channels'][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x57')]=!![];this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x5e')]=moment()[_0xc70f('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x42')]=_0xc70f('0x5f');this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x4c')]=_0x77821b[_0xc70f('0x4c')]==_0xc70f('0x60')?_0xc70f('0x61'):_0x77821b[_0xc70f('0x4c')];this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x62')]=_0x77821b[_0xc70f('0x62')];if(this[_0xc70f('0xb')][_0x77821b[_0xc70f('0x29')]]&&this['voiceQueues'][_0x77821b[_0xc70f('0x29')]][_0xc70f('0x63')]){this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022][_0xc70f('0x64')]=this['voiceQueues'][_0x77821b[_0xc70f('0x29')]][_0xc70f('0x65')];this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022]['agentacw']=!![];}this[_0xc70f('0xc')][_0x77821b['interface']]=_['omit'](this['agents'][_0x77821b[_0xc70f('0x32')]],[_0xc70f('0x29'),_0xc70f('0x45')]);logger[_0xc70f('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x77821b['uniqueid'],util[_0xc70f('0x34')](this['channels'][_0x77821b[_0xc70f('0x23')]][_0x3c3022],{'showHidden':![],'depth':null}));ami['emit'](_0xc70f('0x66'),this[_0xc70f('0x9')][_0x77821b[_0xc70f('0x23')]][_0x3c3022]);logger[_0xc70f('0x25')](_0xc70f('0x67'),_0x77821b[_0xc70f('0x23')],util[_0xc70f('0x34')]({'id':this['agents'][_0x77821b[_0xc70f('0x32')]]['id'],'destaccountcode':_0x77821b[_0xc70f('0x68')]},{'showHidden':![],'depth':null}));this[_0xc70f('0x1c')](util[_0xc70f('0x27')](_0xc70f('0x35'),_0x77821b[_0xc70f('0x24')]),'user:agentcomplete',{'id':this[_0xc70f('0xc')][_0x77821b[_0xc70f('0x32')]]['id'],'destaccountcode':_0x77821b[_0xc70f('0x68')]});}}}}}}catch(_0x412491){logger[_0xc70f('0x54')]('[%s][voiceAgentReport][agentcomplete]',_0x77821b[_0xc70f('0x23')],util['inspect'](_0x412491,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc70f('0x1d')]['syncVarSet']=function(_0x3e147b){try{if(this[_0xc70f('0x1e')](_0x3e147b)){logger[_0xc70f('0x25')](_0xc70f('0x69'),_0x3e147b[_0xc70f('0x23')],util[_0xc70f('0x34')](_0x3e147b,{'showHidden':![],'depth':null}));this[_0xc70f('0x6a')](_0x3e147b[_0xc70f('0x23')],_[_0xc70f('0x6b')](_0x3e147b['variable'])[0x0],_0x3e147b[_0xc70f('0x6c')]);if(this['channels'][_0x3e147b[_0xc70f('0x23')]]){for(var _0x419bbb in this[_0xc70f('0x9')][_0x3e147b[_0xc70f('0x23')]]){if(this['channels'][_0x3e147b[_0xc70f('0x23')]][_0xc70f('0x3a')](_0x419bbb)){logger[_0xc70f('0x21')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x3e147b[_0xc70f('0x23')],_0x419bbb,_[_0xc70f('0x6b')](_0x3e147b['variable'])[0x0],_0x3e147b[_0xc70f('0x6c')]);if(_[_0xc70f('0x1f')](this['channels'][_0x3e147b['uniqueid']][_0x419bbb][_0xc70f('0xd')])){this[_0xc70f('0x9')][_0x3e147b[_0xc70f('0x23')]][_0x419bbb][_0xc70f('0xd')]={};}this['channels'][_0x3e147b[_0xc70f('0x23')]][_0x419bbb][_0xc70f('0xd')]=this['variables'][_0x3e147b[_0xc70f('0x23')]];}}}}}catch(_0x5671c8){logger[_0xc70f('0x54')](_0xc70f('0x6d'),_0x3e147b[_0xc70f('0x23')],util['inspect'](_0x5671c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc70f('0x1d')][_0xc70f('0x6a')]=function(_0x408d91,_0x1aa0c2,_0x2fd953){var _0x2fb09d=['rtpaudioqos',_0xc70f('0x6e'),_0xc70f('0x6f'),_0xc70f('0x70'),_0xc70f('0x71'),_0xc70f('0x72'),_0xc70f('0x73'),_0xc70f('0x74'),_0xc70f('0x75'),_0xc70f('0x76'),'bridgepeer',_0xc70f('0x77'),_0xc70f('0x78'),_0xc70f('0x79'),'memberinterface',_0xc70f('0x7a'),'membername',_0xc70f('0x7b'),_0xc70f('0x7c')];if(!_[_0xc70f('0x7d')](_0x1aa0c2)&&!_[_0xc70f('0x7e')](_0x2fb09d,_0x1aa0c2)){if(_[_0xc70f('0x1f')](this[_0xc70f('0xd')][_0x408d91])){this['variables'][_0x408d91]={};}this[_0xc70f('0xd')][_0x408d91][_0x1aa0c2]=_0x2fd953;}};VoiceAgentReport[_0xc70f('0x1d')]['syncHangup']=function(_0x2117a7){try{if(this[_0xc70f('0x1e')](_0x2117a7)){logger[_0xc70f('0x25')](_0xc70f('0x7f'),_0x2117a7[_0xc70f('0x23')],util[_0xc70f('0x34')](_0x2117a7,{'showHidden':![],'depth':null}));if(this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]]){for(var _0x456590 in this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]]){if(this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]]['hasOwnProperty'](_0x456590)){if(this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]][_0x456590][_0xc70f('0x4c')]==_0xc70f('0x60')&&this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]][_0x456590]['agentcomplete']){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x2117a7['uniqueid'],_0x456590);this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]][_0x456590]['agentcompleteAt']=moment()[_0xc70f('0x27')](_0xc70f('0x28'));}}}logger[_0xc70f('0x25')](_0xc70f('0x80'),_0x2117a7['uniqueid'],util['inspect'](_[_0xc70f('0x81')](this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]]),{'showHidden':![],'depth':null}));ami['emit'](_0xc70f('0x82'),_[_0xc70f('0x81')](this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]]));delete this[_0xc70f('0x9')][_0x2117a7[_0xc70f('0x23')]];}if(this['variables'][_0x2117a7[_0xc70f('0x23')]]){delete this[_0xc70f('0xd')][_0x2117a7[_0xc70f('0x23')]];}}}catch(_0x122672){logger[_0xc70f('0x54')]('[%s][voiceAgentReport][hangup]',_0x2117a7[_0xc70f('0x23')],util[_0xc70f('0x34')](_0x122672,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc70f('0x19')]=function(_0x5ebdee){try{if(this['isNotNull'](_0x5ebdee)){logger['debug'](_0xc70f('0x83'),_0x5ebdee['uniqueid'],util['inspect'](_0x5ebdee,{'showHidden':![],'depth':null}));if(this[_0xc70f('0x9')][_0x5ebdee['transfereeuniqueid']]){for(var _0x47df9e in this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x84')]]){if(this['channels'][_0x5ebdee['transfereeuniqueid']][_0xc70f('0x3a')](_0x47df9e)){if(_0x5ebdee[_0xc70f('0x85')]===_0x47df9e){logger[_0xc70f('0x21')](_0xc70f('0x86'),_0x5ebdee[_0xc70f('0x23')],this[_0xc70f('0x9')][_0x5ebdee['transfereeuniqueid']][_0x47df9e]['membername'],_0x47df9e);var _0x5b6464=moment();this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x84')]][_0x47df9e][_0xc70f('0x57')]=!![];this[_0xc70f('0x9')][_0x5ebdee['transfereeuniqueid']][_0x47df9e]['agentcompleteAt']=moment()[_0xc70f('0x27')](_0xc70f('0x28'));this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x84')]][_0x47df9e][_0xc70f('0x42')]='complete';this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x84')]][_0x47df9e][_0xc70f('0x4c')]=_0xc70f('0x60');this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x84')]][_0x47df9e][_0xc70f('0x62')]=_0x5b6464[_0xc70f('0x87')](this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x84')]][_0x47df9e][_0xc70f('0x3c')],_0xc70f('0x88'));}}}}if(this['channels'][_0x5ebdee['secondtransfereruniqueid']]){var _0x3e3708=this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x89')]];this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x89')]]=this[_0xc70f('0x9')][_0x5ebdee[_0xc70f('0x84')]];this['channels'][_0x5ebdee[_0xc70f('0x84')]]=_0x3e3708;}}}catch(_0x3d0427){logger[_0xc70f('0x54')]('[%s][voiceAgentReport][attendedtransfer]',_0x5ebdee[_0xc70f('0x23')],util['inspect'](_0x3d0427,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc70f('0x1d')]['syncBlindTransfer']=function(_0x201637){try{if(this[_0xc70f('0x1e')](_0x201637)){logger['debug']('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x201637['uniqueid'],util['inspect'](_0x201637,{'showHidden':![],'depth':null}));if(this[_0xc70f('0x9')][_0x201637['transfereeuniqueid']]){for(var _0x24f507 in this[_0xc70f('0x9')][_0x201637['transfereeuniqueid']]){if(this['channels'][_0x201637['transfereeuniqueid']][_0xc70f('0x3a')](_0x24f507)){if(_0x201637[_0xc70f('0x8a')]===_0x24f507){logger[_0xc70f('0x21')](_0xc70f('0x8b'),_0x201637[_0xc70f('0x23')],this[_0xc70f('0x9')][_0x201637[_0xc70f('0x84')]][_0x24f507][_0xc70f('0x24')],_0x24f507);var _0x1fdbc4=moment();this[_0xc70f('0x9')][_0x201637[_0xc70f('0x84')]][_0x24f507][_0xc70f('0x57')]=!![];this[_0xc70f('0x9')][_0x201637[_0xc70f('0x84')]][_0x24f507][_0xc70f('0x5e')]=_0x1fdbc4;this['channels'][_0x201637[_0xc70f('0x84')]][_0x24f507][_0xc70f('0x42')]='complete';this[_0xc70f('0x9')][_0x201637[_0xc70f('0x84')]][_0x24f507][_0xc70f('0x4c')]=_0xc70f('0x60');this[_0xc70f('0x9')][_0x201637[_0xc70f('0x84')]][_0x24f507][_0xc70f('0x62')]=_0x1fdbc4[_0xc70f('0x87')](this[_0xc70f('0x9')][_0x201637[_0xc70f('0x84')]][_0x24f507][_0xc70f('0x3c')],_0xc70f('0x88'));}}}}}}catch(_0x2429d8){logger[_0xc70f('0x54')](_0xc70f('0x8c'),_0x201637[_0xc70f('0x23')],util[_0xc70f('0x34')](_0x2429d8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc70f('0x8d')]=function(_0x28f5e2){var _0x5741d7='';try{if(this[_0xc70f('0x1e')](_0x28f5e2)){logger[_0xc70f('0x25')](_0xc70f('0x8e'),_0x28f5e2[_0xc70f('0x23')],util[_0xc70f('0x34')](_0x28f5e2,{'showHidden':![],'depth':null}));if(_0x28f5e2['channel']){_0x5741d7=_0x28f5e2['channel'][_0xc70f('0x8f')](0x0,_0x28f5e2[_0xc70f('0x90')][_0xc70f('0x91')]('-'));if(this[_0xc70f('0xc')][_0x5741d7]){logger[_0xc70f('0x21')](_0xc70f('0x92'),_0x28f5e2['uniqueid'],_0x5741d7);this[_0xc70f('0xc')][_0x5741d7][_0xc70f('0x93')]=!![];}}}}catch(_0x5c00fa){logger[_0xc70f('0x54')]('[%s][voiceAgentReport][musiconholdstart]',_0x28f5e2['uniqueid'],util[_0xc70f('0x34')](_0x5c00fa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc70f('0x1d')][_0xc70f('0x94')]=function(_0x1045d4){var _0x4a3254='';try{if(this['isNotNull'](_0x1045d4)){logger[_0xc70f('0x25')](_0xc70f('0x95'),_0x1045d4['uniqueid'],util[_0xc70f('0x34')](_0x1045d4,{'showHidden':![],'depth':null}));if(_0x1045d4[_0xc70f('0x90')]){_0x4a3254=_0x1045d4[_0xc70f('0x90')][_0xc70f('0x8f')](0x0,_0x1045d4[_0xc70f('0x90')][_0xc70f('0x91')]('-'));if(this[_0xc70f('0xc')][_0x4a3254]){logger['info'](_0xc70f('0x96'),_0x1045d4['uniqueid'],_0x4a3254);this['agents'][_0x4a3254]['onhold']=![];}}}}catch(_0x343a7f){logger[_0xc70f('0x54')](_0xc70f('0x97'),_0x1045d4[_0xc70f('0x23')],util[_0xc70f('0x34')](_0x343a7f,{'showHidden':![],'depth':null}));}};module[_0xc70f('0x98')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index d2fc669..990b467 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 _0x303a=['transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','FAILED','NO\x20ANSWER','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','channel','split','exten','destconnectedlinenum','format','user:%s','name','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','disposition','toNumber','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','accountcode','[%s][voiceCallReport][newchannel]','application','appdata','applicationdata','startsWith','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','lastdata','cdr(','match','type','calleridname','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','holdtime','diff','xcally-motion-preview','destinationchannel','UserId','membername','answertime','connectedlinename','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%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','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','omit','user:agentcomplete','transferType','resolve','then','undefined','isEmpty','getSettings','StopMixMonitor','catch','Action','finally','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','ATTENDED'];(function(_0x1041c6,_0x2c4dee){var _0x203ff5=function(_0x707b0f){while(--_0x707b0f){_0x1041c6['push'](_0x1041c6['shift']());}};_0x203ff5(++_0x2c4dee);}(_0x303a,0x1a0));var _0xa303=function(_0x188cc8,_0xd39746){_0x188cc8=_0x188cc8-0x0;var _0x4cb155=_0x303a[_0x188cc8];return _0x4cb155;};'use strict';var _=require(_0xa303('0x0'));var moment=require('moment');var util=require(_0xa303('0x1'));var path=require(_0xa303('0x2'));var Redis=require(_0xa303('0x3'));var config=require(_0xa303('0x4'));var logger=require('../../../config/logger')(_0xa303('0x5'));var ami=require(_0xa303('0x6'));var Channel=require(_0xa303('0x7'));var RpcSetting=require(_0xa303('0x8'));var applications=[_0xa303('0x9'),_0xa303('0xa'),_0xa303('0xb'),_0xa303('0xc'),_0xa303('0xd'),'voicemail'];var dispositions=['NO\x20ANSWER','FAILED',_0xa303('0xe'),_0xa303('0xf'),'NO\x20ANSWER',_0xa303('0xf'),'ANSWERED',_0xa303('0x10'),'FAILED',_0xa303('0xe'),_0xa303('0xe')];config[_0xa303('0x11')]=_[_0xa303('0x12')](config['redis'],{'host':_0xa303('0x13'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa303('0x11')]));function VoiceCallReport(_0x43a054){this[_0xa303('0x14')]=_0x43a054['channels'];this[_0xa303('0x15')]=_0x43a054[_0xa303('0x15')];this[_0xa303('0x16')]={};ami['on'](_0xa303('0x17'),this[_0xa303('0x18')][_0xa303('0x19')](this));ami['on'](_0xa303('0x1a'),this[_0xa303('0x18')]['bind'](this));ami['on'](_0xa303('0x1b'),this[_0xa303('0x1c')][_0xa303('0x19')](this));ami['on'](_0xa303('0x1d'),this[_0xa303('0x1e')][_0xa303('0x19')](this));ami['on']('varset',this[_0xa303('0x1f')]['bind'](this));ami['on'](_0xa303('0x20'),this['syncHangup'][_0xa303('0x19')](this));ami['on']('newcallerid',this[_0xa303('0x21')][_0xa303('0x19')](this));ami['on'](_0xa303('0x22'),this['syncAttendedTransfer'][_0xa303('0x19')](this));ami['on'](_0xa303('0x23'),this[_0xa303('0x24')]['bind'](this));ami['on'](_0xa303('0x25'),this[_0xa303('0x26')][_0xa303('0x19')](this));ami['on'](_0xa303('0x27'),this['syncMusicOnHoldStop'][_0xa303('0x19')](this));try{logger[_0xa303('0x28')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xa303('0x29')]();}catch(_0x27c1d7){logger[_0xa303('0x2a')](_0xa303('0x2b'),util[_0xa303('0x2c')](_0x27c1d7,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xa303('0x2d')][_0xa303('0x2e')]=function(_0x5d9dee){return _0x5d9dee!==null&&!_[_0xa303('0x2f')](_0x5d9dee);};VoiceCallReport['prototype']['emit']=function(_0x4dad5b,_0x58922f,_0x5da2d2){io['to'](_0x4dad5b)[_0xa303('0x30')](_0x58922f,_0x5da2d2);};VoiceCallReport[_0xa303('0x2d')][_0xa303('0x21')]=function(_0xbb93f0){try{if(this[_0xa303('0x2e')](_0xbb93f0)){logger['info'](_0xa303('0x31'),_0xbb93f0[_0xa303('0x32')],_0xbb93f0['calleridname'],_0xbb93f0[_0xa303('0x33')]);logger[_0xa303('0x34')](_0xa303('0x35'),_0xbb93f0[_0xa303('0x32')],util[_0xa303('0x2c')](_0xbb93f0,{'showHidden':![],'depth':null}));if(_0xbb93f0[_0xa303('0x32')]===_0xbb93f0[_0xa303('0x36')]){if(!_[_0xa303('0x2f')](this[_0xa303('0x14')][_0xbb93f0[_0xa303('0x32')]])){_[_0xa303('0x37')](this[_0xa303('0x14')][_0xbb93f0[_0xa303('0x32')]],_[_0xa303('0x38')](_0xbb93f0,_[_0xa303('0x39')](this[_0xa303('0x14')][_0xbb93f0[_0xa303('0x32')]])));}}if(_0xbb93f0['context']==='from-sip'){if(this[_0xa303('0x15')][_0xbb93f0[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]){if(_0xbb93f0[_0xa303('0x3c')]=='xcally-motion-preview'){this[_0xa303('0x15')][_0xbb93f0[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]][_0xa303('0x3d')]=_0xbb93f0['connectedlinenum'];this[_0xa303('0x30')](util[_0xa303('0x3e')](_0xa303('0x3f'),this['agents'][_0xbb93f0[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]][_0xa303('0x40')]),'user:agentconnect',{'destaccountcode':this[_0xa303('0x15')][_0xbb93f0[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0xbb93f0[_0xa303('0x41')]});}}}}}catch(_0x25ae45){logger[_0xa303('0x2a')](_0xa303('0x42'),_0xbb93f0['uniqueid'],util[_0xa303('0x2c')](_0x25ae45,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa303('0x2d')][_0xa303('0x1c')]=function(_0x26ffab){try{if(this['isNotNull'](_0x26ffab)){logger[_0xa303('0x34')](_0xa303('0x43'),_0x26ffab[_0xa303('0x32')],util[_0xa303('0x2c')](_0x26ffab,{'showHidden':![],'depth':null}));if(this[_0xa303('0x14')][_0x26ffab['uniqueid']])return;if(_0x26ffab['channel']===_0xa303('0x44'))return;if(_0x26ffab[_0xa303('0x32')]!==_0x26ffab[_0xa303('0x36')]&&!this['blindTransfers'][_0x26ffab['linkedid']])return;logger[_0xa303('0x28')](_0xa303('0x45'),_0x26ffab[_0xa303('0x32')],_0x26ffab[_0xa303('0x46')],_0x26ffab['exten']);this['channels'][_0x26ffab[_0xa303('0x32')]]=new Channel();this[_0xa303('0x14')][_0x26ffab[_0xa303('0x32')]][_0xa303('0x47')]=moment()[_0xa303('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa303('0x14')][_0x26ffab[_0xa303('0x32')]][_0xa303('0x48')]=dispositions[_[_0xa303('0x49')](_0x26ffab['channelstate'])];_['merge'](this['channels'][_0x26ffab[_0xa303('0x32')]],_[_0xa303('0x38')](_0x26ffab,_[_0xa303('0x39')](this[_0xa303('0x14')][_0x26ffab[_0xa303('0x32')]])));if(_0x26ffab[_0xa303('0x46')]===_0xa303('0x4a')){if(this[_0xa303('0x15')][_0x26ffab[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]){if(_[_0xa303('0x2f')](this['agents'][_0x26ffab['channel'][_0xa303('0x3b')]('-')[0x0]]['destconnectedlinenum'])){this[_0xa303('0x15')][_0x26ffab['channel'][_0xa303('0x3b')]('-')[0x0]][_0xa303('0x3d')]=_0x26ffab[_0xa303('0x3c')];logger[_0xa303('0x34')](_0xa303('0x4b'),_0x26ffab[_0xa303('0x32')],util[_0xa303('0x2c')]({'id':this[_0xa303('0x15')][_0x26ffab[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0xa303('0x15')][_0x26ffab[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x26ffab[_0xa303('0x3c')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xa303('0x3e')](_0xa303('0x3f'),this[_0xa303('0x15')][_0x26ffab['channel']['split']('-')[0x0]][_0xa303('0x40')]),_0xa303('0x4c'),{'id':this[_0xa303('0x15')][_0x26ffab[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0xa303('0x15')][_0x26ffab[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]][_0xa303('0x4d')],'destconnectedlinenum':_0x26ffab[_0xa303('0x3c')]});}}}}}catch(_0x4f7300){logger[_0xa303('0x2a')](_0xa303('0x4e'),_0x26ffab['uniqueid'],util[_0xa303('0x2c')](_0x4f7300,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa303('0x18')]=function(_0x2c0bbb){try{if(this[_0xa303('0x2e')](_0x2c0bbb)){logger[_0xa303('0x34')]('[%s][voiceCallReport][newexten]\x20event:',_0x2c0bbb[_0xa303('0x32')],util[_0xa303('0x2c')](_0x2c0bbb,{'showHidden':![],'depth':null}));if(_0x2c0bbb[_0xa303('0x3a')]===_0xa303('0x44')||_0x2c0bbb[_0xa303('0x3c')]==='h')return;if(_0x2c0bbb[_0xa303('0x32')]===_0x2c0bbb['linkedid']||this[_0xa303('0x16')][_0x2c0bbb[_0xa303('0x36')]]){_0x2c0bbb[_0xa303('0x4f')]=_0x2c0bbb[_0xa303('0x4f')]['toLowerCase']();_0x2c0bbb['applicationdata']=_0x2c0bbb[_0xa303('0x50')]||_0x2c0bbb[_0xa303('0x51')];if(_0x2c0bbb[_0xa303('0x50')]&&!_0x2c0bbb['appdata'][_0xa303('0x52')]('CDR(routeAlias)')&&_0x2c0bbb['application']!=='queue'){_0x2c0bbb['applicationdata']=_0x2c0bbb[_0xa303('0x51')][_0xa303('0x53')]();}logger['info'](_0xa303('0x54'),_0x2c0bbb[_0xa303('0x32')],_0x2c0bbb[_0xa303('0x4f')],_0x2c0bbb[_0xa303('0x51')]);if(_[_0xa303('0x2f')](this['channels'][_0x2c0bbb[_0xa303('0x32')]])){this[_0xa303('0x14')][_0x2c0bbb[_0xa303('0x32')]]=new Channel();this[_0xa303('0x14')][_0x2c0bbb[_0xa303('0x32')]]['starttime']=_0x2c0bbb['duration']?moment()[_0xa303('0x55')](moment[_0xa303('0x56')](_0x2c0bbb[_0xa303('0x56')])[_0xa303('0x57')](),_0xa303('0x57'))[_0xa303('0x3e')](_0xa303('0x58')):moment()[_0xa303('0x3e')](_0xa303('0x58'));this['channels'][_0x2c0bbb[_0xa303('0x32')]][_0xa303('0x48')]=_0xa303('0xf');}_[_0xa303('0x37')](this['channels'][_0x2c0bbb['uniqueid']],_[_0xa303('0x38')](_0x2c0bbb,_['keys'](this[_0xa303('0x14')][_0x2c0bbb[_0xa303('0x32')]])));if(_['includes'](applications,_0x2c0bbb['application'])){this[_0xa303('0x14')][_0x2c0bbb[_0xa303('0x32')]]['lastapplication']=_0x2c0bbb['application'];this['channels'][_0x2c0bbb[_0xa303('0x32')]][_0xa303('0x59')]=_0x2c0bbb[_0xa303('0x51')];if(_0x2c0bbb[_0xa303('0x4f')]===_0xa303('0x9')&&_[_0xa303('0x52')](_0x2c0bbb[_0xa303('0x51')][_0xa303('0x53')](),_0xa303('0x5a'))){var _0x50fb49=_0x2c0bbb[_0xa303('0x51')][_0xa303('0x3b')]('=');var _0x318c16=_0x50fb49[0x0][_0xa303('0x53')]()[_0xa303('0x5b')](/cdr\((.*)\)/);if(_0x318c16){if(_0x318c16[0x1]===_0xa303('0x5c')&&!_['isNil'](this[_0xa303('0x14')][_0x2c0bbb['uniqueid']][_0x318c16[0x1]]))return;this['channels'][_0x2c0bbb[_0xa303('0x32')]][_0x318c16[0x1]]=_0x50fb49[0x1];}}else if(_0x2c0bbb[_0xa303('0x4f')]==='queue'){this[_0xa303('0x14')][_0x2c0bbb[_0xa303('0x32')]][_0xa303('0xa')]=_0x2c0bbb[_0xa303('0x51')][_0xa303('0x3b')](',')[0x0];}}}}}catch(_0x5499be){logger['error']('[%s][voiceCallReport][newexten]',_0x2c0bbb[_0xa303('0x32')],util[_0xa303('0x2c')](_0x5499be,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa303('0x2d')]['syncNewState']=function(_0x5901d9){try{if(this[_0xa303('0x2e')](_0x5901d9)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x5901d9['uniqueid'],_0x5901d9['linkedid'],_0x5901d9[_0xa303('0x5d')],_0x5901d9[_0xa303('0x33')]);logger[_0xa303('0x34')](_0xa303('0x5e'),_0x5901d9[_0xa303('0x32')],util[_0xa303('0x2c')](_0x5901d9,{'showHidden':![],'depth':null}));if(_0x5901d9[_0xa303('0x5f')]!=='6')return;if(_0x5901d9[_0xa303('0x32')]!==_0x5901d9['linkedid']){var _0x358936=moment();if(this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]]){if(!this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]][_0xa303('0x60')]){this['channels'][_0x5901d9[_0xa303('0x36')]]['answered']=!![];this['channels'][_0x5901d9[_0xa303('0x36')]]['answertime']=_0x358936['format']('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x5901d9['linkedid']][_0xa303('0x47')]){this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]][_0xa303('0x61')]=_0x358936[_0xa303('0x62')](this['channels'][_0x5901d9[_0xa303('0x36')]][_0xa303('0x47')],'seconds');}}this['channels'][_0x5901d9[_0xa303('0x36')]][_0xa303('0x36')]=_0x5901d9[_0xa303('0x32')];if(_0x5901d9['calleridnum']!==_0xa303('0x63')){this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]][_0xa303('0x41')]=_0x5901d9[_0xa303('0x33')];}this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]]['connectedlinename']=_0x5901d9[_0xa303('0x5d')];this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]][_0xa303('0x64')]=_0x5901d9['channel'];this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]]['disposition']=dispositions[_[_0xa303('0x49')](_0x5901d9[_0xa303('0x5f')])];if(this[_0xa303('0x15')][_0x5901d9['channel'][_0xa303('0x3b')]('-')[0x0]]){this['channels'][_0x5901d9[_0xa303('0x36')]][_0xa303('0x65')]=this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['id'];this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]][_0xa303('0x66')]=this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')]['split']('-')[0x0]]['name'];}}if(this['channels'][_0x5901d9[_0xa303('0x32')]]){if(!this['channels'][_0x5901d9[_0xa303('0x32')]][_0xa303('0x60')]){this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]][_0xa303('0x60')]=!![];this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]][_0xa303('0x67')]=_0x358936[_0xa303('0x3e')](_0xa303('0x58'));if(this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]][_0xa303('0x47')]){this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]][_0xa303('0x61')]=_0x358936[_0xa303('0x62')](this[_0xa303('0x14')][_0x5901d9['uniqueid']][_0xa303('0x47')],_0xa303('0x57'));}}if(_0x5901d9['calleridnum']!==_0xa303('0x63')){this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]][_0xa303('0x41')]=_0x5901d9['calleridnum'];}this[_0xa303('0x14')][_0x5901d9['uniqueid']][_0xa303('0x68')]=_0x5901d9['calleridname'];this[_0xa303('0x14')][_0x5901d9['uniqueid']][_0xa303('0x64')]=_0x5901d9['channel'];this['channels'][_0x5901d9[_0xa303('0x32')]]['disposition']=dispositions[_[_0xa303('0x49')](_0x5901d9[_0xa303('0x5f')])];}}else{if(this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]]){if(this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]){this[_0xa303('0x14')][_0x5901d9['uniqueid']]['UserId']=this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['id'];this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]][_0xa303('0x66')]=this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')]['split']('-')[0x0]]['name'];}}}if(_0x5901d9[_0xa303('0x46')]===_0xa303('0x4a')){if(this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')]['split']('-')[0x0]]){this['agents'][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]][_0xa303('0x3d')]=_0x5901d9['exten'];var _0x5ba105,_0x54d116;if(this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]]){_0x5ba105=this[_0xa303('0x14')][_0x5901d9[_0xa303('0x32')]][_0xa303('0x69')];_0x54d116=this[_0xa303('0x14')][_0x5901d9['uniqueid']][_0xa303('0xa')];}else if(this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]]){_0x5ba105=this['channels'][_0x5901d9[_0xa303('0x36')]]['routealias'];_0x54d116=this[_0xa303('0x14')][_0x5901d9[_0xa303('0x36')]][_0xa303('0xa')];}logger[_0xa303('0x34')](_0xa303('0x6a'),_0x5901d9[_0xa303('0x32')],util[_0xa303('0x2c')]({'id':this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]][_0xa303('0x4d')],'destconnectedlinenum':_0x5901d9[_0xa303('0x3c')],'routealias':_0x5ba105,'queue':_0x54d116||undefined},{'showHidden':![],'depth':null}));this[_0xa303('0x30')](util[_0xa303('0x3e')]('user:%s',this[_0xa303('0x15')][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['name']),_0xa303('0x4c'),{'id':this['agents'][_0x5901d9[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xa303('0x15')][_0x5901d9['channel']['split']('-')[0x0]][_0xa303('0x4d')],'destconnectedlinenum':_0x5901d9['exten'],'routealias':_0x5ba105,'queue':_0x54d116||undefined});}}}}catch(_0x29d5e1){logger[_0xa303('0x2a')](_0xa303('0x6b'),_0x5901d9[_0xa303('0x32')],util[_0xa303('0x2c')](_0x29d5e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa303('0x2d')][_0xa303('0x6c')]=function(_0x4db66d,_0x13207a){try{if(this[_0xa303('0x14')][_0x4db66d]){logger['info'](_0xa303('0x6d'),_0x4db66d,_0x13207a);this[_0xa303('0x14')][_0x4db66d][_0xa303('0x6e')]=!![];if(_['endsWith'](_0x13207a,_0xa303('0x6f'))){_0x13207a=_0x13207a[_0xa303('0x70')](_0xa303('0x6f'),_0xa303('0x71'));}this['channels'][_0x4db66d][_0xa303('0x72')]=_0x13207a;var _0xbdaedc=_[_0xa303('0x73')](this[_0xa303('0x14')][_0x4db66d][_0xa303('0x74')],{'filename':_0x13207a});if(_[_0xa303('0x75')](_0xbdaedc)){this[_0xa303('0x14')][_0x4db66d][_0xa303('0x74')]['push']({'filename':_0x13207a,'createdAt':moment()[_0xa303('0x3e')](_0xa303('0x58')),'mixmonitorid':'','status':_0xa303('0x76')});}}}catch(_0x1d8530){logger[_0xa303('0x2a')]('[%s][voiceCallReport][mixMonitorFilename]',_0x4db66d,util['inspect'](_0x1d8530,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa303('0x2d')]['syncVarSet']=function(_0x1aaa16){try{if(this[_0xa303('0x2e')](_0x1aaa16)){logger[_0xa303('0x34')](_0xa303('0x77'),_0x1aaa16[_0xa303('0x32')],util[_0xa303('0x2c')](_0x1aaa16,{'showHidden':![],'depth':null}));if(this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x32')]]&&_0x1aaa16[_0xa303('0x3a')]!=_0xa303('0x44')){if(this['isNotNull'](_0x1aaa16['variable'])){if(this[_0xa303('0x2e')](_0x1aaa16[_0xa303('0x78')][_0xa303('0x79')])){logger[_0xa303('0x28')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1aaa16['uniqueid'],_0x1aaa16['value']);this[_0xa303('0x6c')](_0x1aaa16[_0xa303('0x32')],_0x1aaa16[_0xa303('0x7a')]);}else if(this[_0xa303('0x2e')](_0x1aaa16[_0xa303('0x78')]['xmd-phone'])){logger['info'](_0xa303('0x7b'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16[_0xa303('0x7a')]);this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x32')]]['calleridnum']=_0x1aaa16[_0xa303('0x7a')];}else if(this[_0xa303('0x2e')](_0x1aaa16['variable'][_0xa303('0x7c')])){logger[_0xa303('0x28')](_0xa303('0x7d'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16[_0xa303('0x7a')]);this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x32')]][_0xa303('0x7e')]=_0x1aaa16['value'];}else if(this[_0xa303('0x2e')](_0x1aaa16['variable']['xmd-cdrtype'])){logger[_0xa303('0x28')](_0xa303('0x7f'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16[_0xa303('0x7a')]);this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x32')]][_0xa303('0x5c')]=_0x1aaa16['value'];}else if(this[_0xa303('0x2e')](_0x1aaa16[_0xa303('0x78')][_0xa303('0x80')])){logger[_0xa303('0x28')](_0xa303('0x81'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16[_0xa303('0x7a')][_0xa303('0x3b')](',')[0x0]);this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x32')]][_0xa303('0xa')]=_0x1aaa16[_0xa303('0x7a')][_0xa303('0x3b')](',')[0x0];}else if(this[_0xa303('0x2e')](_0x1aaa16['variable'][_0xa303('0x82')])){logger[_0xa303('0x28')](_0xa303('0x83'),_0x1aaa16['uniqueid'],_0x1aaa16['value']);this['channels'][_0x1aaa16['uniqueid']]['originatecalleridnum']=_0x1aaa16[_0xa303('0x7a')];}else if(this[_0xa303('0x2e')](_0x1aaa16[_0xa303('0x78')][_0xa303('0x84')])){logger[_0xa303('0x28')](_0xa303('0x85'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16['value']);this['channels'][_0x1aaa16['uniqueid']]['destination']=_0x1aaa16[_0xa303('0x7a')];}else if(this[_0xa303('0x2e')](_0x1aaa16['variable'][_0xa303('0x86')])){logger[_0xa303('0x28')](_0xa303('0x87'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16['value']);this['channels'][_0x1aaa16[_0xa303('0x32')]][_0xa303('0x88')]=_0x1aaa16[_0xa303('0x7a')];}else if(this[_0xa303('0x2e')](_0x1aaa16[_0xa303('0x78')][_0xa303('0x89')])){logger[_0xa303('0x28')](_0xa303('0x8a'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16[_0xa303('0x7a')]);this[_0xa303('0x14')][_0x1aaa16['uniqueid']][_0xa303('0xa')]=_0x1aaa16[_0xa303('0x7a')];}else if(this[_0xa303('0x2e')](_0x1aaa16[_0xa303('0x78')][_0xa303('0x8b')])){logger[_0xa303('0x28')](_0xa303('0x8c'),_0x1aaa16[_0xa303('0x32')],_0x1aaa16[_0xa303('0x7a')]);this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x32')]][_0xa303('0x8d')]=_0x1aaa16[_0xa303('0x7a')];}}}else if(this['isNotNull'](_0x1aaa16[_0xa303('0x78')][_0xa303('0x79')])){if(_0x1aaa16['value']){var _0x2e2b8e=path['parse'](_0x1aaa16[_0xa303('0x7a')])['name'];logger[_0xa303('0x28')](_0xa303('0x8e'),_0x2e2b8e,_0x1aaa16['value']);this['syncMixMonitorFilename'](_0x2e2b8e,_0x1aaa16[_0xa303('0x7a')]);}}else if(this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x36')]]){if(this[_0xa303('0x2e')](_0x1aaa16['variable'])){if(this['isNotNull'](_0x1aaa16[_0xa303('0x78')][_0xa303('0x8b')])){logger[_0xa303('0x28')](_0xa303('0x8c'),_0x1aaa16[_0xa303('0x36')],_0x1aaa16[_0xa303('0x7a')]);this[_0xa303('0x14')][_0x1aaa16[_0xa303('0x36')]][_0xa303('0x8f')]=_0x1aaa16[_0xa303('0x7a')];}}}}}catch(_0x429724){logger[_0xa303('0x2a')](_0xa303('0x90'),_0x1aaa16[_0xa303('0x32')],util[_0xa303('0x2c')](_0x429724,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa303('0x2d')][_0xa303('0x91')]=function(_0x2be97c){try{if(this[_0xa303('0x2e')](_0x2be97c)){logger['debug'](_0xa303('0x92'),_0x2be97c[_0xa303('0x32')],util['inspect'](_0x2be97c,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x2be97c['linkedid']]){if(this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x36')]]){this[_0xa303('0x14')][this['blindTransfers'][_0x2be97c['linkedid']][_0xa303('0x36')]][_0xa303('0x32')]=_0x2be97c['uniqueid'];this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x36')]]['answered']=this['channels'][_0x2be97c[_0xa303('0x32')]][_0xa303('0x60')];this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c['linkedid']]['linkedid']]['answertime']=this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]][_0xa303('0x67')];this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x36')]]['destinationchannel']=this[_0xa303('0x14')][this['blindTransfers'][_0x2be97c['linkedid']][_0xa303('0x36')]][_0xa303('0x3a')];this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]]['linkedid']][_0xa303('0x48')]=this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]][_0xa303('0x48')];this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]]=this['channels'][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x36')]];delete this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x36')]];}else if(this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]]){this['channels'][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]]['uniqueid']=[this[_0xa303('0x14')][this['blindTransfers'][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]]['linkedid'],this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]][_0xa303('0x36')]=this['channels'][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]]['uniqueid']]['uniqueid']][0x0];this[_0xa303('0x14')][this['blindTransfers'][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]]['answered']=this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]][_0xa303('0x60')];this['channels'][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]]['answertime']=this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]][_0xa303('0x67')];this[_0xa303('0x14')][this['blindTransfers'][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]]['destinationchannel']=this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c['linkedid']][_0xa303('0x32')]][_0xa303('0x3a')];this['channels'][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]]['disposition']=this['channels'][_0x2be97c[_0xa303('0x32')]][_0xa303('0x48')];this['channels'][_0x2be97c[_0xa303('0x32')]]=this[_0xa303('0x14')][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]];delete this['channels'][this[_0xa303('0x16')][_0x2be97c[_0xa303('0x36')]][_0xa303('0x32')]];}}if(this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]]){logger[_0xa303('0x28')](_0xa303('0x93'),_0x2be97c['uniqueid'],_0x2be97c[_0xa303('0x94')]);var _0x2f2bc1=moment();this[_0xa303('0x14')][_0x2be97c['uniqueid']]['endtime']=_0x2f2bc1[_0xa303('0x3e')](_0xa303('0x58'));this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]][_0xa303('0x56')]=_0x2f2bc1['diff'](this['channels'][_0x2be97c['uniqueid']][_0xa303('0x47')],_0xa303('0x57'));if(this['channels'][_0x2be97c[_0xa303('0x32')]][_0xa303('0x60')]){this[_0xa303('0x14')][_0x2be97c['uniqueid']][_0xa303('0x95')]=_0x2f2bc1[_0xa303('0x62')](this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]]['answertime'],_0xa303('0x57'));this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]][_0xa303('0x61')]=this[_0xa303('0x14')][_0x2be97c[_0xa303('0x32')]][_0xa303('0x56')]-this['channels'][_0x2be97c[_0xa303('0x32')]][_0xa303('0x95')];}if(_0x2be97c[_0xa303('0x46')]===_0xa303('0x4a')){if(this[_0xa303('0x15')][_0x2be97c[_0xa303('0x3a')]['split']('-')[0x0]]){this['agents'][_0x2be97c[_0xa303('0x3a')]['split']('-')[0x0]]=_[_0xa303('0x96')](this['agents'][_0x2be97c[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]],[_0xa303('0x3d')]);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x2be97c['uniqueid'],util[_0xa303('0x2c')]({'id':this[_0xa303('0x15')][_0x2be97c[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0xa303('0x15')][_0x2be97c[_0xa303('0x3a')]['split']('-')[0x0]][_0xa303('0x4d')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xa303('0x3e')]('user:%s',this[_0xa303('0x15')][_0x2be97c[_0xa303('0x3a')]['split']('-')[0x0]][_0xa303('0x40')]),_0xa303('0x97'),{'id':this[_0xa303('0x15')][_0x2be97c['channel'][_0xa303('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x2be97c[_0xa303('0x3a')][_0xa303('0x3b')]('-')[0x0]][_0xa303('0x4d')]});for(var _0x52ecbd=0x0;_0x52ecbd0x0?_0xf4a2d2:0x0;this['voiceQueues'][_0x1562ad['queue']]['talking']=this[_0xdd9f('0x11')][_0x1562ad[_0xdd9f('0x6b')]][_0xdd9f('0x32')]>_[_0xdd9f('0x73')](_0x1562ad[_0xdd9f('0x72')])?_['toNumber'](_0x1562ad[_0xdd9f('0x72')]):this[_0xdd9f('0x11')][_0x1562ad[_0xdd9f('0x6b')]][_0xdd9f('0x32')];this[_0xdd9f('0x75')](this[_0xdd9f('0x11')][_0x1562ad[_0xdd9f('0x6b')]],_0xdd9f('0x14'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xdd9f('0x41')](this[_0xdd9f('0x11')][_0x1562ad[_0xdd9f('0x6b')]],{'showHidden':![],'depth':null}));ami[_0xdd9f('0x46')](_0xdd9f('0x76'),this[_0xdd9f('0x11')][_0x1562ad[_0xdd9f('0x6b')]]);}}}catch(_0x23019f){logger['error'](_0xdd9f('0x69'),util['inspect'](_0x23019f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x269f99){logger['debug'](_0xdd9f('0x77'),util[_0xdd9f('0x41')](_0x269f99,{'showHidden':![],'depth':null}));this[_0xdd9f('0x12')]=!![];};VoiceQueueReport[_0xdd9f('0xc')]['syncQueueCallerJoin']=function(_0x5c70a1){try{if(this[_0xdd9f('0x6a')](_0x5c70a1)){logger[_0xdd9f('0x50')](_0xdd9f('0x78'),_0x5c70a1[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x5c70a1,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xdd9f('0xf')][_0x5c70a1[_0xdd9f('0x4a')]]))this[_0xdd9f('0xf')][_0x5c70a1[_0xdd9f('0x4a')]]=[];if(_[_0xdd9f('0x65')](this[_0xdd9f('0x37')][_0x5c70a1[_0xdd9f('0x4a')]]))this[_0xdd9f('0x37')][_0x5c70a1[_0xdd9f('0x4a')]]={};var _0x9fb080=new QueueReport();_0x9fb080[_0xdd9f('0x4c')]=_0x5c70a1[_0xdd9f('0x6b')];_0x9fb080[_0xdd9f('0x5d')]=this[_0xdd9f('0x11')][_0x9fb080[_0xdd9f('0x4c')]]&&this['voiceQueues'][_0x9fb080['name']]['type']?this['voiceQueues'][_0x9fb080[_0xdd9f('0x4c')]][_0xdd9f('0x5d')]||_0xdd9f('0x55'):_0xdd9f('0x55');_0x9fb080[_0xdd9f('0x6b')]=_0x5c70a1[_0xdd9f('0x6b')];_0x9fb080[_0xdd9f('0x79')]=moment()[_0xdd9f('0x4b')](_0xdd9f('0x7a'));_0x9fb080['position']=_0x5c70a1[_0xdd9f('0x7b')];_0x9fb080['count']=_0x5c70a1[_0xdd9f('0x7c')];_0x9fb080[_0xdd9f('0x4a')]=_0x5c70a1[_0xdd9f('0x4a')];_0x9fb080[_0xdd9f('0x7d')]=this[_0xdd9f('0x37')][_0x5c70a1[_0xdd9f('0x4a')]][_0xdd9f('0x7d')];logger[_0xdd9f('0x6d')](_0xdd9f('0x7e'),_0x9fb080[_0xdd9f('0x4c')],_0x9fb080[_0xdd9f('0x5d')]);_[_0xdd9f('0x7f')](_0x9fb080,_[_0xdd9f('0x80')](_0x5c70a1,_[_0xdd9f('0x81')](_0x9fb080)));this['queueReports'][_0x5c70a1['uniqueid']][_0xdd9f('0x82')](_0x9fb080);this[_0xdd9f('0x37')][_0x5c70a1['uniqueid']]=_0x9fb080;this['emitVoiceQueueChannelSave'](_0x9fb080,_0xdd9f('0x19'));}}catch(_0x34298c){logger[_0xdd9f('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5c70a1[_0xdd9f('0x4a')],util['inspect'](_0x34298c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd9f('0xc')][_0xdd9f('0x1c')]=function(_0x37c657){try{if(this[_0xdd9f('0x6a')](_0x37c657)){logger[_0xdd9f('0x50')]('[%s][voiceQueueReport][queuecallerabandon]',_0x37c657[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x37c657,{'showHidden':![],'depth':null}));if(this[_0xdd9f('0xf')][_0x37c657[_0xdd9f('0x4a')]]){var _0x5539f8=_[_0xdd9f('0x83')](this[_0xdd9f('0xf')][_0x37c657[_0xdd9f('0x4a')]]);_0x5539f8[_0xdd9f('0x84')]=![];_0x5539f8['queuecallercompleteAt']=null;_0x5539f8['holdtime']=_0x37c657[_0xdd9f('0x85')];_0x5539f8[_0xdd9f('0x86')]=_0x37c657[_0xdd9f('0x86')];_0x5539f8[_0xdd9f('0x1b')]=!![];_0x5539f8[_0xdd9f('0x87')]=moment()['format'](_0xdd9f('0x7a'));_0x5539f8[_0xdd9f('0x52')]=_0xdd9f('0x88');_0x5539f8['lastAssignedTo']=null;logger[_0xdd9f('0x6d')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5539f8[_0xdd9f('0x4c')],_0x5539f8[_0xdd9f('0x5d')]);this['channels'][_0x37c657[_0xdd9f('0x4a')]]=_0x5539f8;this[_0xdd9f('0x4f')](_0x5539f8,_0xdd9f('0x1b'));}}}catch(_0x2fa022){logger[_0xdd9f('0x3e')](_0xdd9f('0x89'),_0x37c657[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x2fa022,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd9f('0xc')]['syncQueueCallerLeave']=function(_0x27c069){try{if(this[_0xdd9f('0x6a')](_0x27c069)){logger[_0xdd9f('0x50')]('[%s][voiceQueueReport][queuecallerleave]',_0x27c069[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x27c069,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x27c069['uniqueid']]){var _0x5e6596=_[_0xdd9f('0x83')](this[_0xdd9f('0xf')][_0x27c069[_0xdd9f('0x4a')]]);_0x5e6596[_0xdd9f('0x8a')]=moment()[_0xdd9f('0x4b')](_0xdd9f('0x7a'));_0x5e6596[_0xdd9f('0x8b')]=_0x27c069['connectedlinenum'];_0x5e6596[_0xdd9f('0x8c')]=_0x27c069[_0xdd9f('0x8c')];logger[_0xdd9f('0x6d')](_0xdd9f('0x8d'),_0x5e6596[_0xdd9f('0x4c')],_0x5e6596[_0xdd9f('0x5d')],_0x27c069[_0xdd9f('0x8b')],_0x27c069['connectedlinename']);this[_0xdd9f('0x37')][_0x27c069['uniqueid']]=_0x5e6596;this['emitVoiceQueueChannelSave'](_0x5e6596,_0xdd9f('0x1d'));}}}catch(_0x5b765a){logger[_0xdd9f('0x3e')](_0xdd9f('0x8e'),_0x27c069['uniqueid'],util['inspect'](_0x5b765a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd9f('0xc')][_0xdd9f('0x8f')]=function(_0x3abe1a){try{if(this[_0xdd9f('0x6a')](_0x3abe1a)){logger[_0xdd9f('0x50')](_0xdd9f('0x90'),_0x3abe1a[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x3abe1a,{'showHidden':![],'depth':null}));if(this[_0xdd9f('0xf')][_0x3abe1a[_0xdd9f('0x4a')]]){var _0x46286d=_[_0xdd9f('0x83')](this[_0xdd9f('0xf')][_0x3abe1a[_0xdd9f('0x4a')]]);_0x46286d['queuecallercomplete']=!![];_0x46286d[_0xdd9f('0x52')]=_0xdd9f('0x91');logger[_0xdd9f('0x6d')](_0xdd9f('0x92'),_0x46286d[_0xdd9f('0x4c')],_0x46286d['type']);}}}catch(_0x1b8a35){logger[_0xdd9f('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x3abe1a['uniqueid'],util[_0xdd9f('0x41')](_0x1b8a35,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd9f('0xc')][_0xdd9f('0x20')]=function(_0x48b9b1){try{if(this[_0xdd9f('0x6a')](_0x48b9b1)){logger[_0xdd9f('0x50')]('[%s][voiceQueueReport][agentcomplete]',_0x48b9b1[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x48b9b1,{'showHidden':![],'depth':null}));if(this[_0xdd9f('0xf')][_0x48b9b1[_0xdd9f('0x4a')]]){var _0x145f57=_[_0xdd9f('0x83')](this[_0xdd9f('0xf')][_0x48b9b1[_0xdd9f('0x4a')]]);_0x145f57[_0xdd9f('0x1b')]=![];_0x145f57[_0xdd9f('0x87')]=null;_0x145f57[_0xdd9f('0x93')]=!![];_0x145f57['lastAssignedTo']=_0x48b9b1['membername'];_0x145f57[_0xdd9f('0x85')]=_0x48b9b1[_0xdd9f('0x85')];_0x145f57[_0xdd9f('0x84')]=!![];_0x145f57[_0xdd9f('0x94')]=![];_0x145f57[_0xdd9f('0x95')]=null;if(!_0x145f57[_0xdd9f('0x96')]){if(_0x48b9b1[_0xdd9f('0x97')]==_0xdd9f('0x96')){_0x145f57[_0xdd9f('0x52')]=_0xdd9f('0x98');logger[_0xdd9f('0x6d')](_0xdd9f('0x99'),_0x145f57[_0xdd9f('0x4c')],_0x145f57['type']);}else{if(_[_0xdd9f('0x9a')](_0x48b9b1[_0xdd9f('0x3b')][_0xdd9f('0x9b')](),'local/')){if(this['queueReports'][_0x48b9b1[_0xdd9f('0x9c')]]){var _0x5a7ddc=_[_0xdd9f('0x83')](this[_0xdd9f('0xf')][_0x48b9b1['linkedid']]);_0x5a7ddc[_0xdd9f('0x84')]=![];_0x5a7ddc['queuecallerexit']=!![];_0x5a7ddc[_0xdd9f('0x95')]=moment(_0x145f57[_0xdd9f('0x79')])[_0xdd9f('0x9d')](_0x48b9b1[_0xdd9f('0x85')],_0xdd9f('0x9e'))[_0xdd9f('0x4b')](_0xdd9f('0x7a'));_0x5a7ddc[_0xdd9f('0x52')]=_0xdd9f('0x9f');_0x5a7ddc[_0xdd9f('0x96')]=!![];_0x5a7ddc[_0xdd9f('0xa0')]=_0xdd9f('0xa1');_0x5a7ddc['transferexten']=_0x48b9b1[_0xdd9f('0xa2')];_0x5a7ddc[_0xdd9f('0xa3')]=_0x48b9b1[_0xdd9f('0x4a')];logger['info'](_0xdd9f('0xa4'),_0x5a7ddc[_0xdd9f('0x4c')],_0x5a7ddc[_0xdd9f('0x5d')]);var _0x2420a6=this['queueReports'][_0x48b9b1[_0xdd9f('0x9c')]];this['queueReports'][_0x48b9b1[_0xdd9f('0x9c')]]=this[_0xdd9f('0xf')][_0x48b9b1[_0xdd9f('0x4a')]];this[_0xdd9f('0xf')][_0x48b9b1[_0xdd9f('0x4a')]]=_0x2420a6;}}else{_0x145f57['queuecallerexitreason']=_0xdd9f('0xa5')+_0x48b9b1[_0xdd9f('0x97')][_0xdd9f('0xa6')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x145f57[_0xdd9f('0x4c')],_0x145f57[_0xdd9f('0x5d')],_0x145f57[_0xdd9f('0x52')]);}}}this[_0xdd9f('0x37')][_0x48b9b1[_0xdd9f('0x4a')]]=_0x145f57;this[_0xdd9f('0x4f')](_0x145f57,_0xdd9f('0x1f'));}}}catch(_0x1aab78){logger[_0xdd9f('0x3e')](_0xdd9f('0xa7'),_0x48b9b1[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x1aab78,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xdd9f('0xc')]['syncVarSet']=function(_0x7a3409){try{if(this[_0xdd9f('0x6a')](_0x7a3409)){logger[_0xdd9f('0x50')](_0xdd9f('0xa8'),_0x7a3409[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0x7a3409,{'showHidden':![],'depth':null}));this[_0xdd9f('0xa9')](_0x7a3409['uniqueid'],_['keys'](_0x7a3409[_0xdd9f('0xaa')])[0x0],_0x7a3409[_0xdd9f('0xab')]);if(this[_0xdd9f('0xf')][_0x7a3409[_0xdd9f('0x4a')]]){var _0xfc8c04=_['last'](this['queueReports'][_0x7a3409['uniqueid']]);if(_0xfc8c04){if(this['isNotNull'](_0x7a3409[_0xdd9f('0xaa')])&&this['isNotNull'](_0x7a3409['variable'][_0xdd9f('0xac')])){switch(_0x7a3409['value']){case _0xdd9f('0xad'):_0xfc8c04[_0xdd9f('0x94')]=![];_0xfc8c04[_0xdd9f('0x95')]=null;break;case _0xdd9f('0xae'):_0xfc8c04[_0xdd9f('0xaf')]=_0xdd9f('0xb0');_0xfc8c04['queuecallerexit']=!![];_0xfc8c04[_0xdd9f('0x95')]=moment()[_0xdd9f('0x4b')](_0xdd9f('0x7a'));_0xfc8c04[_0xdd9f('0x8a')]=moment()[_0xdd9f('0x4b')](_0xdd9f('0x7a'));logger['debug'](_0xdd9f('0xb1'),_0x7a3409[_0xdd9f('0x4a')],util[_0xdd9f('0x41')](_0xfc8c04,{'showHidden':![],'depth':null}));ami[_0xdd9f('0x46')]('custom:timeout',_0xfc8c04);break;default:_0xfc8c04[_0xdd9f('0x94')]=!![];_0xfc8c04[_0xdd9f('0x95')]=moment()['format'](_0xdd9f('0x7a'));_0xfc8c04[_0xdd9f('0x8a')]=moment()[_0xdd9f('0x4b')](_0xdd9f('0x7a'));}_0xfc8c04[_0xdd9f('0x1b')]=![];_0xfc8c04[_0xdd9f('0x87')]=null;_0xfc8c04[_0xdd9f('0x52')]=_0x7a3409['value'];this['channels'][_0x7a3409['uniqueid']]=_0xfc8c04;this['emitVoiceQueueChannelRemove'](_0xfc8c04,_0xdd9f('0x22'));}else if(this[_0xdd9f('0x6a')](_0x7a3409[_0xdd9f('0xaa')])&&this[_0xdd9f('0x6a')](_0x7a3409[_0xdd9f('0xaa')][_0xdd9f('0xb2')])){if(!_0xfc8c04[_0xdd9f('0x1b')]){_0xfc8c04['queuecallerexit']=!![];_0xfc8c04['queuecallerexitAt']=moment()[_0xdd9f('0x4b')](_0xdd9f('0x7a'));_0xfc8c04['queuecallerexitreason']='EXITWITHKEY';_0xfc8c04[_0xdd9f('0x8a')]=moment()[_0xdd9f('0x4b')](_0xdd9f('0x7a'));this[_0xdd9f('0x37')][_0x7a3409[_0xdd9f('0x4a')]]=_0xfc8c04;}}logger['info'](_0xdd9f('0xb3'),_0x7a3409[_0xdd9f('0x4a')],_0xfc8c04[_0xdd9f('0x4c')],_0xfc8c04['type'],_[_0xdd9f('0x81')](_0x7a3409[_0xdd9f('0xaa')])[0x0],_0x7a3409['value']);_0xfc8c04[_0xdd9f('0x42')]=this[_0xdd9f('0x42')][_0x7a3409[_0xdd9f('0x4a')]];}}}}catch(_0x5414ff){logger['error'](_0xdd9f('0xa8'),_0x7a3409['uniqueid'],util[_0xdd9f('0x41')](_0x5414ff,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xdd9f('0xa9')]=function(_0x44e9aa,_0x440758,_0x14d740){var _0x1a5916=[_0xdd9f('0xb4'),_0xdd9f('0xb5'),'rtpaudioqosjitter',_0xdd9f('0xb6'),_0xdd9f('0xb7'),_0xdd9f('0xb8'),'rtpaudioqosrtt',_0xdd9f('0xb9'),_0xdd9f('0xba'),_0xdd9f('0xbb'),_0xdd9f('0xbc'),_0xdd9f('0xbd'),_0xdd9f('0xbe'),_0xdd9f('0xbf'),_0xdd9f('0xc0'),_0xdd9f('0xc1'),'membername',_0xdd9f('0xc2'),'memberrealtime'];if(!_[_0xdd9f('0x39')](_0x440758)&&!_[_0xdd9f('0xc3')](_0x1a5916,_0x440758)){if(_['isUndefined'](this[_0xdd9f('0x42')][_0x44e9aa])){this[_0xdd9f('0x42')][_0x44e9aa]={};}this[_0xdd9f('0x42')][_0x44e9aa][_0x440758]=_0x14d740;}};VoiceQueueReport['prototype'][_0xdd9f('0xc4')]=function(_0x3eb7a4,_0x551672,_0x49899e){var _0x39b92b={};for(var _0x36ef59=0x0;_0x36ef590x0?_0x55870a:0x0;this[_0x1632('0x12')][_0x122e1e['queue']][_0x1632('0x2f')]=this[_0x1632('0x12')][_0x122e1e[_0x1632('0x6b')]][_0x1632('0x2f')]>_[_0x1632('0x6f')](_0x122e1e[_0x1632('0x70')])?_[_0x1632('0x6f')](_0x122e1e[_0x1632('0x70')]):this['voiceQueues'][_0x122e1e[_0x1632('0x6b')]]['talking'];this[_0x1632('0x71')](this['voiceQueues'][_0x122e1e[_0x1632('0x6b')]],_0x1632('0x16'));}logger['debug'](_0x1632('0x72'),util[_0x1632('0x3f')](this[_0x1632('0x12')][_0x122e1e[_0x1632('0x6b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x1632('0x73'),this['voiceQueues'][_0x122e1e['queue']]);}}}catch(_0x4ceb8f){logger['error'](_0x1632('0x69'),util[_0x1632('0x3f')](_0x4ceb8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1632('0xb')][_0x1632('0x74')]=function(_0x4aee42){logger[_0x1632('0x4c')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x1632('0x3f')](_0x4aee42,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x1632('0xb')][_0x1632('0x19')]=function(_0x3abf23){try{if(this[_0x1632('0x63')](_0x3abf23)){logger[_0x1632('0x4c')](_0x1632('0x75'),_0x3abf23[_0x1632('0x46')],util[_0x1632('0x3f')](_0x3abf23,{'showHidden':![],'depth':null}));if(_[_0x1632('0x76')](this['queueReports'][_0x3abf23[_0x1632('0x46')]]))this['queueReports'][_0x3abf23[_0x1632('0x46')]]=[];if(_[_0x1632('0x76')](this['channels'][_0x3abf23[_0x1632('0x46')]]))this[_0x1632('0x33')][_0x3abf23[_0x1632('0x46')]]={};var _0x3c2f70=new QueueReport();_0x3c2f70[_0x1632('0x49')]=_0x3abf23[_0x1632('0x6b')];_0x3c2f70[_0x1632('0x51')]=this[_0x1632('0x12')][_0x3c2f70['name']]&&this['voiceQueues'][_0x3c2f70[_0x1632('0x49')]][_0x1632('0x51')]?this['voiceQueues'][_0x3c2f70[_0x1632('0x49')]][_0x1632('0x51')]||'inbound':_0x1632('0x52');_0x3c2f70[_0x1632('0x6b')]=_0x3abf23['queue'];_0x3c2f70[_0x1632('0x77')]=moment()[_0x1632('0x47')](_0x1632('0x78'));_0x3c2f70[_0x1632('0x79')]=_0x3abf23['position'];_0x3c2f70['count']=_0x3abf23[_0x1632('0x7a')];_0x3c2f70['uniqueid']=_0x3abf23[_0x1632('0x46')];_0x3c2f70[_0x1632('0x7b')]=this['channels'][_0x3abf23[_0x1632('0x46')]][_0x1632('0x7b')];logger[_0x1632('0x6c')](_0x1632('0x7c'),_0x3c2f70[_0x1632('0x49')],_0x3c2f70[_0x1632('0x51')]);_[_0x1632('0x7d')](_0x3c2f70,_[_0x1632('0x7e')](_0x3abf23,_[_0x1632('0x7f')](_0x3c2f70)));this[_0x1632('0xf')][_0x3abf23[_0x1632('0x46')]]['push'](_0x3c2f70);this[_0x1632('0x33')][_0x3abf23[_0x1632('0x46')]]=_0x3c2f70;this[_0x1632('0x44')](_0x3c2f70,_0x1632('0x18'));}}catch(_0x5e041e){logger[_0x1632('0x3b')](_0x1632('0x75'),_0x3abf23[_0x1632('0x46')],util['inspect'](_0x5e041e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1632('0x1b')]=function(_0x1d19d4){try{if(this[_0x1632('0x63')](_0x1d19d4)){logger[_0x1632('0x4c')](_0x1632('0x80'),_0x1d19d4[_0x1632('0x46')],util[_0x1632('0x3f')](_0x1d19d4,{'showHidden':![],'depth':null}));if(this[_0x1632('0xf')][_0x1d19d4['uniqueid']]){var _0x3286ae=_['last'](this[_0x1632('0xf')][_0x1d19d4[_0x1632('0x46')]]);_0x3286ae[_0x1632('0x81')]=![];_0x3286ae[_0x1632('0x82')]=null;_0x3286ae[_0x1632('0x83')]=_0x1d19d4['holdtime'];_0x3286ae['originalposition']=_0x1d19d4[_0x1632('0x84')];_0x3286ae[_0x1632('0x1a')]=!![];_0x3286ae[_0x1632('0x85')]=moment()[_0x1632('0x47')](_0x1632('0x78'));_0x3286ae[_0x1632('0x4e')]='ABANDONED';_0x3286ae[_0x1632('0x86')]=null;logger[_0x1632('0x6c')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3286ae[_0x1632('0x49')],_0x3286ae[_0x1632('0x51')]);this[_0x1632('0x33')][_0x1d19d4[_0x1632('0x46')]]=_0x3286ae;this[_0x1632('0x41')](_0x3286ae,_0x1632('0x1a'));}}}catch(_0x2ca947){logger[_0x1632('0x3b')](_0x1632('0x80'),_0x1d19d4[_0x1632('0x46')],util['inspect'](_0x2ca947,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1632('0xb')]['syncQueueCallerLeave']=function(_0xebc11e){try{if(this[_0x1632('0x63')](_0xebc11e)){logger['debug'](_0x1632('0x87'),_0xebc11e[_0x1632('0x46')],util[_0x1632('0x3f')](_0xebc11e,{'showHidden':![],'depth':null}));if(this[_0x1632('0xf')][_0xebc11e[_0x1632('0x46')]]){var _0x4601e6=_[_0x1632('0x88')](this[_0x1632('0xf')][_0xebc11e[_0x1632('0x46')]]);_0x4601e6['queuecallerleaveAt']=moment()['format'](_0x1632('0x78'));_0x4601e6[_0x1632('0x89')]=_0xebc11e['connectedlinenum'];_0x4601e6['connectedlinename']=_0xebc11e[_0x1632('0x8a')];logger[_0x1632('0x6c')](_0x1632('0x8b'),_0x4601e6[_0x1632('0x49')],_0x4601e6[_0x1632('0x51')],_0xebc11e[_0x1632('0x89')],_0xebc11e[_0x1632('0x8a')]);this[_0x1632('0x33')][_0xebc11e['uniqueid']]=_0x4601e6;this['emitVoiceQueueChannelSave'](_0x4601e6,_0x1632('0x1c'));}}}catch(_0x264789){logger[_0x1632('0x3b')](_0x1632('0x87'),_0xebc11e[_0x1632('0x46')],util[_0x1632('0x3f')](_0x264789,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1632('0xb')]['syncAgentConnect']=function(_0x1cbb14){try{if(this[_0x1632('0x63')](_0x1cbb14)){logger[_0x1632('0x4c')](_0x1632('0x8c'),_0x1cbb14[_0x1632('0x46')],util[_0x1632('0x3f')](_0x1cbb14,{'showHidden':![],'depth':null}));if(this[_0x1632('0xf')][_0x1cbb14[_0x1632('0x46')]]){var _0x2bee88=_[_0x1632('0x88')](this['queueReports'][_0x1cbb14[_0x1632('0x46')]]);_0x2bee88['queuecallercomplete']=!![];_0x2bee88[_0x1632('0x4e')]=_0x1632('0x8d');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2bee88['name'],_0x2bee88['type']);}}}catch(_0x18182e){logger[_0x1632('0x3b')](_0x1632('0x8c'),_0x1cbb14[_0x1632('0x46')],util[_0x1632('0x3f')](_0x18182e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1632('0xb')][_0x1632('0x1f')]=function(_0x17e481){try{if(this['isNotNull'](_0x17e481)){logger[_0x1632('0x4c')]('[%s][voiceQueueReport][agentcomplete]',_0x17e481[_0x1632('0x46')],util['inspect'](_0x17e481,{'showHidden':![],'depth':null}));if(this[_0x1632('0xf')][_0x17e481[_0x1632('0x46')]]){var _0x4e66c4=_[_0x1632('0x88')](this[_0x1632('0xf')][_0x17e481[_0x1632('0x46')]]);_0x4e66c4['queuecallerabandon']=![];_0x4e66c4[_0x1632('0x85')]=null;_0x4e66c4[_0x1632('0x8e')]=!![];_0x4e66c4[_0x1632('0x86')]=_0x17e481[_0x1632('0x8f')];_0x4e66c4['holdtime']=_0x17e481['holdtime'];_0x4e66c4[_0x1632('0x81')]=!![];_0x4e66c4[_0x1632('0x90')]=![];_0x4e66c4[_0x1632('0x91')]=null;if(!_0x4e66c4[_0x1632('0x92')]){if(_0x17e481[_0x1632('0x93')]==_0x1632('0x92')){_0x4e66c4[_0x1632('0x4e')]=_0x1632('0x94');logger['info'](_0x1632('0x95'),_0x4e66c4[_0x1632('0x49')],_0x4e66c4['type']);}else{if(_['startsWith'](_0x17e481['channel'][_0x1632('0x96')](),'local/')){if(this[_0x1632('0xf')][_0x17e481[_0x1632('0x97')]]){var _0x4d53e2=_['last'](this[_0x1632('0xf')][_0x17e481['linkedid']]);_0x4d53e2[_0x1632('0x81')]=![];_0x4d53e2['queuecallerexit']=!![];_0x4d53e2['queuecallerexitAt']=moment(_0x4e66c4[_0x1632('0x77')])[_0x1632('0x98')](_0x17e481['holdtime'],_0x1632('0x99'))[_0x1632('0x47')](_0x1632('0x78'));_0x4d53e2[_0x1632('0x4e')]=_0x1632('0x9a');_0x4d53e2['transfer']=!![];_0x4d53e2[_0x1632('0x9b')]=_0x1632('0x9c');_0x4d53e2[_0x1632('0x9d')]=_0x17e481['destexten'];_0x4d53e2['transferuniqueid']=_0x17e481[_0x1632('0x46')];logger[_0x1632('0x6c')](_0x1632('0x9e'),_0x4d53e2['name'],_0x4d53e2[_0x1632('0x51')]);var _0x566b57=this[_0x1632('0xf')][_0x17e481[_0x1632('0x97')]];this[_0x1632('0xf')][_0x17e481['linkedid']]=this[_0x1632('0xf')][_0x17e481[_0x1632('0x46')]];this[_0x1632('0xf')][_0x17e481['uniqueid']]=_0x566b57;}}else{_0x4e66c4[_0x1632('0x4e')]='COMPLETEDBY'+_0x17e481['reason']['toUpperCase']();logger[_0x1632('0x6c')](_0x1632('0x9f'),_0x4e66c4[_0x1632('0x49')],_0x4e66c4[_0x1632('0x51')],_0x4e66c4[_0x1632('0x4e')]);}}}this[_0x1632('0x33')][_0x17e481[_0x1632('0x46')]]=_0x4e66c4;this[_0x1632('0x41')](_0x4e66c4,'agentcomplete');}}}catch(_0x1faa56){logger[_0x1632('0x3b')](_0x1632('0xa0'),_0x17e481[_0x1632('0x46')],util[_0x1632('0x3f')](_0x1faa56,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1632('0xb')][_0x1632('0x23')]=function(_0x4d4871){try{if(this['isNotNull'](_0x4d4871)){logger[_0x1632('0x4c')](_0x1632('0xa1'),_0x4d4871[_0x1632('0x46')],util[_0x1632('0x3f')](_0x4d4871,{'showHidden':![],'depth':null}));this[_0x1632('0xa2')](_0x4d4871[_0x1632('0x46')],_[_0x1632('0x7f')](_0x4d4871[_0x1632('0xa3')])[0x0],_0x4d4871['value']);if(this['queueReports'][_0x4d4871[_0x1632('0x46')]]){var _0x56c846=_[_0x1632('0x88')](this[_0x1632('0xf')][_0x4d4871[_0x1632('0x46')]]);if(_0x56c846){if(this[_0x1632('0x63')](_0x4d4871[_0x1632('0xa3')])&&this['isNotNull'](_0x4d4871[_0x1632('0xa3')]['queuestatus'])){switch(_0x4d4871[_0x1632('0xa4')]){case _0x1632('0xa5'):_0x56c846[_0x1632('0x90')]=![];_0x56c846[_0x1632('0x91')]=null;break;case'TIMEOUT':_0x56c846[_0x1632('0xa6')]=_0x1632('0xa7');_0x56c846['queuecallerexit']=!![];_0x56c846[_0x1632('0x91')]=moment()['format'](_0x1632('0x78'));_0x56c846[_0x1632('0xa8')]=moment()[_0x1632('0x47')](_0x1632('0x78'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4d4871[_0x1632('0x46')],util[_0x1632('0x3f')](_0x56c846,{'showHidden':![],'depth':null}));ami[_0x1632('0x43')](_0x1632('0xa9'),_0x56c846);break;default:_0x56c846['queuecallerexit']=!![];_0x56c846['queuecallerexitAt']=moment()['format'](_0x1632('0x78'));_0x56c846[_0x1632('0xa8')]=moment()[_0x1632('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x56c846[_0x1632('0x1a')]=![];_0x56c846[_0x1632('0x85')]=null;_0x56c846[_0x1632('0x4e')]=_0x4d4871[_0x1632('0xa4')];this['channels'][_0x4d4871[_0x1632('0x46')]]=_0x56c846;this[_0x1632('0x41')](_0x56c846,_0x1632('0x22'));}else if(this[_0x1632('0x63')](_0x4d4871[_0x1632('0xa3')])&&this[_0x1632('0x63')](_0x4d4871[_0x1632('0xa3')]['queueposition'])){if(!_0x56c846[_0x1632('0x1a')]){_0x56c846[_0x1632('0x90')]=!![];_0x56c846[_0x1632('0x91')]=moment()[_0x1632('0x47')](_0x1632('0x78'));_0x56c846[_0x1632('0x4e')]=_0x1632('0xaa');_0x56c846[_0x1632('0xa8')]=moment()[_0x1632('0x47')](_0x1632('0x78'));this[_0x1632('0x33')][_0x4d4871[_0x1632('0x46')]]=_0x56c846;}}logger[_0x1632('0x6c')](_0x1632('0xab'),_0x4d4871[_0x1632('0x46')],_0x56c846[_0x1632('0x49')],_0x56c846['type'],_[_0x1632('0x7f')](_0x4d4871[_0x1632('0xa3')])[0x0],_0x4d4871[_0x1632('0xa4')]);_0x56c846['variables']=this[_0x1632('0x15')][_0x4d4871[_0x1632('0x46')]];}}}}catch(_0x10a13f){logger[_0x1632('0x3b')](_0x1632('0xa1'),_0x4d4871[_0x1632('0x46')],util[_0x1632('0x3f')](_0x10a13f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1632('0xb')][_0x1632('0xa2')]=function(_0x44ac4c,_0x13a162,_0xff1e64){var _0x3e06c6=[_0x1632('0xac'),_0x1632('0xad'),_0x1632('0xae'),'rtpaudioqosjitterbridged',_0x1632('0xaf'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x1632('0xb0'),_0x1632('0xb1'),_0x1632('0xb2'),_0x1632('0xb3'),_0x1632('0xb4'),_0x1632('0xb5'),_0x1632('0xb6'),_0x1632('0xb7'),_0x1632('0xb8'),_0x1632('0x8f'),_0x1632('0xb9'),_0x1632('0xba')];if(!_[_0x1632('0x36')](_0x13a162)&&!_[_0x1632('0xbb')](_0x3e06c6,_0x13a162)){if(_[_0x1632('0x76')](this[_0x1632('0x15')][_0x44ac4c])){this[_0x1632('0x15')][_0x44ac4c]={};}this[_0x1632('0x15')][_0x44ac4c][_0x13a162]=_0xff1e64;}};VoiceQueueReport['prototype'][_0x1632('0xbc')]=function(_0x2dc542,_0x22aeb0,_0x5d97dc){var _0x51fbfb={};for(var _0x4763fe=0x0;_0x4763fe=0x0?moment(_0x5f2b01[_0x68e5('0x1b')])[_0x68e5('0x10')](_0x5f2b01['starttime'],'seconds'):null,'data1':_0x68e5('0x1c'),'data2':_0x5f2b01['accountcode'],'data3':_0x5f2b01[_0x68e5('0x13')],'data4':_0x5f2b01[_0x68e5('0x1d')]||null,'role':_0x68e5('0x1e'),'internal':_0x5f2b01[_0x68e5('0x15')]?_[_0x68e5('0x16')](_0x5f2b01[_0x68e5('0x15')]):undefined,'uniqueid':_0x5f2b01[_0x68e5('0x17')]},'log':_0x68e5('0x7')});}; \ No newline at end of file +var _0xb674=['uniqueid','lodash','../client','voiceQueueReport','CreateMemberReport','lastAssignedTo','interface','TALKING','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport','Request','membername','endtime','starttime','dialstring'];(function(_0x5c400b,_0x51fd0e){var _0x23bc8b=function(_0x2146e){while(--_0x2146e){_0x5c400b['push'](_0x5c400b['shift']());}};_0x23bc8b(++_0x51fd0e);}(_0xb674,0x115));var _0x4b67=function(_0x212c34,_0x57a0be){_0x212c34=_0x212c34-0x0;var _0xcb3231=_0xb674[_0x212c34];return _0xcb3231;};'use strict';var moment=require('moment');var _=require(_0x4b67('0x0'));var util=require('util');var client=require(_0x4b67('0x1'));exports[_0x4b67('0x2')]=function(_0x3ee32d){var _0x4c68ff=_0x3ee32d['queuecallercompleteAt']||_0x3ee32d['queuecallerexitAt'];return client['Request'](_0x4b67('0x3'),{'body':{'channel':'voice','membername':_0x3ee32d[_0x4b67('0x4')],'interface':_['isNil'](_0x3ee32d[_0x4b67('0x5')])?util['format']('SIP/%s',_0x3ee32d[_0x4b67('0x4')]):_0x3ee32d['interface'],'type':_0x4b67('0x6'),'enterAt':_0x3ee32d['queuecallerleaveAt'],'exitAt':_0x4c68ff,'duration':moment(_0x4c68ff)[_0x4b67('0x7')](_0x3ee32d['queuecallerleaveAt'],_0x4b67('0x8')),'data1':_0x4b67('0x9'),'data2':_0x3ee32d[_0x4b67('0xa')],'data3':_0x3ee32d[_0x4b67('0xb')],'data4':null,'data5':_0x3ee32d[_0x4b67('0xc')],'role':_0x4b67('0xd'),'internal':_0x3ee32d[_0x4b67('0xe')]?_[_0x4b67('0xf')](_0x3ee32d[_0x4b67('0xe')]):undefined,'uniqueid':_0x3ee32d['uniqueid']},'log':_0x4b67('0x3')});};exports[_0x4b67('0x10')]=function(_0x3b5d82){return client[_0x4b67('0x11')](_0x4b67('0x3'),{'body':{'channel':'voice','membername':_0x3b5d82[_0x4b67('0x12')],'interface':_0x3b5d82['interface'],'type':_0x4b67('0x6'),'enterAt':_0x3b5d82['starttime'],'exitAt':_0x3b5d82['endtime'],'duration':moment(_0x3b5d82[_0x4b67('0x13')])[_0x4b67('0x7')](_0x3b5d82[_0x4b67('0x14')],_0x4b67('0x8'))>=0x0?moment(_0x3b5d82[_0x4b67('0x13')])[_0x4b67('0x7')](_0x3b5d82[_0x4b67('0x14')],'seconds'):null,'data1':'outbound','data2':_0x3b5d82[_0x4b67('0xe')],'data3':_0x3b5d82[_0x4b67('0xb')],'data4':_0x3b5d82[_0x4b67('0x15')]||null,'role':'agent','internal':_0x3b5d82[_0x4b67('0xe')]?_['toNumber'](_0x3b5d82[_0x4b67('0xe')]):undefined,'uniqueid':_0x3b5d82[_0x4b67('0x16')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index e331020..1df60f5 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 _0x90d0=['ShowSetting','previewRecallmeReminderInterval','GetSettings','Request'];(function(_0x33f6ab,_0x920fce){var _0x57b49b=function(_0x2d27dd){while(--_0x2d27dd){_0x33f6ab['push'](_0x33f6ab['shift']());}};_0x57b49b(++_0x920fce);}(_0x90d0,0x10f));var _0x090d=function(_0x4a746e,_0x3166c0){_0x4a746e=_0x4a746e-0x0;var _0x451a87=_0x90d0[_0x4a746e];return _0x451a87;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x090d('0x0')](_0x090d('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x090d('0x2')]},'log':_0x090d('0x3')});}; \ No newline at end of file +var _0x32d5=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x43a8e3,_0x40a6f9){var _0xd60abd=function(_0x5e7c70){while(--_0x5e7c70){_0x43a8e3['push'](_0x43a8e3['shift']());}};_0xd60abd(++_0x40a6f9);}(_0x32d5,0x1aa));var _0x532d=function(_0x43d494,_0x53a0ec){_0x43d494=_0x43d494-0x0;var _0x4a0b69=_0x32d5[_0x43d494];return _0x4a0b69;};'use strict';var client=require(_0x532d('0x0'));exports[_0x532d('0x1')]=function(){return client[_0x532d('0x2')](_0x532d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x532d('0x4'),_0x532d('0x5')]},'log':_0x532d('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 29d62d8..73ff5ae 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 _0xd1d3=['../client','Request','GetTemplate','name','html'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x51ab16,_0x4e46a2){_0x51ab16=_0x51ab16-0x0;var _0x5b85aa=_0xd1d3[_0x51ab16];return _0x5b85aa;};'use strict';var client=require(_0x3d1d('0x0'));exports['getTemplates']=function(_0x31335e){return function(_0x4d607e){return client[_0x3d1d('0x1')](_0x3d1d('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3d1d('0x3'),_0x3d1d('0x4')]},'log':_0x3d1d('0x2')});};}; \ No newline at end of file +var _0x5b1c=['html','../client','Request','GetTemplate','name'];(function(_0x34c1ac,_0x571dfe){var _0x16e2c1=function(_0x135b63){while(--_0x135b63){_0x34c1ac['push'](_0x34c1ac['shift']());}};_0x16e2c1(++_0x571dfe);}(_0x5b1c,0x1b9));var _0xc5b1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5b1c[_0xfae23b];return _0x200640;};'use strict';var client=require(_0xc5b1('0x0'));exports['getTemplates']=function(_0x1b13b6){return function(_0x1d69ae){return client[_0xc5b1('0x1')](_0xc5b1('0x2'),{'options':{'raw':!![],'attributes':['id',_0xc5b1('0x3'),_0xc5b1('0x4')]},'log':_0xc5b1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 95d153e..8679294 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 _0x52de=['Actions','data2','data3','data4','data6','data7','../client','GetTrigger','name','channel','Condition','AllConditions','field','operator','value','AnyConditions'];(function(_0xe1cb1b,_0x4b9cf6){var _0x28048c=function(_0x4d03b1){while(--_0x4d03b1){_0xe1cb1b['push'](_0xe1cb1b['shift']());}};_0x28048c(++_0x4b9cf6);}(_0x52de,0x1c6));var _0xe52d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x52de[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xe52d('0x0'));exports['getTriggers']=function(_0x5a126){return function(_0x29874c){return client['Request'](_0xe52d('0x1'),{'options':{'raw':![],'attributes':['id',_0xe52d('0x2'),_0xe52d('0x3'),'status'],'include':[{'model':_0xe52d('0x4'),'as':_0xe52d('0x5'),'attributes':['id',_0xe52d('0x6'),_0xe52d('0x7'),_0xe52d('0x8')]},{'model':_0xe52d('0x4'),'as':_0xe52d('0x9'),'attributes':['id',_0xe52d('0x6'),_0xe52d('0x7'),_0xe52d('0x8')]},{'model':'Action','as':_0xe52d('0xa'),'attributes':['id','action','data1',_0xe52d('0xb'),_0xe52d('0xc'),_0xe52d('0xd'),'data5',_0xe52d('0xe'),_0xe52d('0xf')]}]},'log':_0xe52d('0x1')});};}; \ No newline at end of file +var _0x7c54=['data2','data3','data4','data5','data7','../client','getTriggers','Request','GetTrigger','name','status','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1'];(function(_0x57779a,_0x5baddf){var _0x27e824=function(_0x3879d5){while(--_0x3879d5){_0x57779a['push'](_0x57779a['shift']());}};_0x27e824(++_0x5baddf);}(_0x7c54,0x181));var _0x47c5=function(_0x17dcd1,_0x3b7ccb){_0x17dcd1=_0x17dcd1-0x0;var _0x12af77=_0x7c54[_0x17dcd1];return _0x12af77;};'use strict';var client=require(_0x47c5('0x0'));exports[_0x47c5('0x1')]=function(_0x31ad07){return function(_0x1b6c31){return client[_0x47c5('0x2')](_0x47c5('0x3'),{'options':{'raw':![],'attributes':['id',_0x47c5('0x4'),'channel',_0x47c5('0x5')],'include':[{'model':'Condition','as':_0x47c5('0x6'),'attributes':['id',_0x47c5('0x7'),_0x47c5('0x8'),_0x47c5('0x9')]},{'model':'Condition','as':_0x47c5('0xa'),'attributes':['id',_0x47c5('0x7'),_0x47c5('0x8'),_0x47c5('0x9')]},{'model':_0x47c5('0xb'),'as':_0x47c5('0xc'),'attributes':['id',_0x47c5('0xd'),_0x47c5('0xe'),_0x47c5('0xf'),_0x47c5('0x10'),_0x47c5('0x11'),_0x47c5('0x12'),'data6',_0x47c5('0x13')]}]},'log':_0x47c5('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a959f28..451f0fb 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 _0xff33=['registry','defaultuser','getTrunks','Request','GetTrunk'];(function(_0x5778bc,_0xa4b99c){var _0x3c1fb6=function(_0x5f4eb5){while(--_0x5f4eb5){_0x5778bc['push'](_0x5778bc['shift']());}};_0x3c1fb6(++_0xa4b99c);}(_0xff33,0x70));var _0x3ff3=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0xff33[_0x1196bd];return _0x26014f;};'use strict';var client=require('../client');exports[_0x3ff3('0x0')]=function(_0x546027){return function(_0x27dda2){return client[_0x3ff3('0x1')](_0x3ff3('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x3ff3('0x3'),_0x3ff3('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x078c=['../client','GetTrunk','name','registry','defaultuser'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x078c,0x19f));var _0xc078=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x078c[_0x2dc7c9];return _0x3e6536;};'use strict';var client=require(_0xc078('0x0'));exports['getTrunks']=function(_0x1c6234){return function(_0x2f658c){return client['Request'](_0xc078('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc078('0x2'),_0xc078('0x3'),_0xc078('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index e9ec72c..e6700ca 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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x472572,_0x5961ea){var _0x4a49bd=function(_0x342447){while(--_0x342447){_0x472572['push'](_0x472572['shift']());}};_0x4a49bd(++_0x5961ea);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x5677dc,_0x51efd6){var _0x1841b3=function(_0x32df6f){while(--_0x32df6f){_0x5677dc['push'](_0x5677dc['shift']());}};_0x1841b3(++_0x51efd6);}(_0xedd9,0xfc));var _0x9edd=function(_0x20a618,_0x3d1a7b){_0x20a618=_0x20a618-0x0;var _0x3be658=_0xedd9[_0x20a618];return _0x3be658;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c97bc48..7f144c3 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 _0x62c9=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x59094a,_0x339c39){var _0x2b6cb6=function(_0xc1cf97){while(--_0xc1cf97){_0x59094a['push'](_0x59094a['shift']());}};_0x2b6cb6(++_0x339c39);}(_0x62c9,0xf8));var _0x962c=function(_0x489ae4,_0x4548ab){_0x489ae4=_0x489ae4-0x0;var _0x150cee=_0x62c9[_0x489ae4];return _0x150cee;};'use strict';var client=require(_0x962c('0x0'));exports[_0x962c('0x1')]=function(_0x577533){return client['Request'](_0x962c('0x2'),{'body':_0x577533,'log':_0x962c('0x2')});};exports[_0x962c('0x3')]=function(_0x3d4880,_0x7b240a,_0x1639bc){return client[_0x962c('0x4')](_0x962c('0x5'),{'body':_0x3d4880,'options':{'where':{'uniqueid':_0x7b240a,'interface':_0x1639bc,'agentcomplete':!![]}},'log':_0x962c('0x5')});}; \ No newline at end of file +var _0xbfbc=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x33e291,_0x2f7b1d){var _0x33fc7e=function(_0x3ecc7d){while(--_0x3ecc7d){_0x33e291['push'](_0x33e291['shift']());}};_0x33fc7e(++_0x2f7b1d);}(_0xbfbc,0x17d));var _0xcbfb=function(_0x21067c,_0x151b4f){_0x21067c=_0x21067c-0x0;var _0x2d8094=_0xbfbc[_0x21067c];return _0x2d8094;};'use strict';var client=require(_0xcbfb('0x0'));exports[_0xcbfb('0x1')]=function(_0x526d85){return client[_0xcbfb('0x2')](_0xcbfb('0x3'),{'body':_0x526d85,'log':'CreateVoiceAgentReport'});};exports[_0xcbfb('0x4')]=function(_0x444a54,_0x35f6b9,_0x246b10){return client['Request']('UpdateVoiceAgentReport',{'body':_0x444a54,'options':{'where':{'uniqueid':_0x35f6b9,'interface':_0x246b10,'agentcomplete':!![]}},'log':_0xcbfb('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index fe627a5..d0c99c5 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 _0x9d38=['GetVoiceCallReports','moment','util','lodash','../client','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition'];(function(_0x1dc59e,_0x424444){var _0x476887=function(_0x1e1d96){while(--_0x1e1d96){_0x1dc59e['push'](_0x1dc59e['shift']());}};_0x476887(++_0x424444);}(_0x9d38,0x1ef));var _0x89d3=function(_0xc43b89,_0x5262cb){_0xc43b89=_0xc43b89-0x0;var _0x46ffb1=_0x9d38[_0xc43b89];return _0x46ffb1;};'use strict';var moment=require(_0x89d3('0x0'));var util=require(_0x89d3('0x1'));var _=require(_0x89d3('0x2'));var client=require(_0x89d3('0x3'));exports['create']=function(_0x5060f9){return client['Request'](_0x89d3('0x4'),{'body':_[_0x89d3('0x5')](_0x5060f9,{'source':_0x5060f9[_0x89d3('0x6')],'destinationcontext':_0x5060f9[_0x89d3('0x7')],'callerid':_0x5060f9[_0x89d3('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x89d3('0x4')});};exports[_0x89d3('0x9')]=function(){return function(){return client['Request'](_0x89d3('0xa'),{'options':{'where':{'type':[_0x89d3('0xb')],'createdAt':{'$between':[moment()[_0x89d3('0xc')](_0x89d3('0xd'))[_0x89d3('0xe')](_0x89d3('0xf')),moment()[_0x89d3('0x10')](_0x89d3('0xd'))[_0x89d3('0xe')](_0x89d3('0xf'))]}},'attributes':['type',_0x89d3('0x11'),'duration','billableseconds']},'log':_0x89d3('0x12')});};}; \ No newline at end of file +var _0xe4a0=['format','duration','billableseconds','util','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2b5947,_0x2383a6){var _0x3080a3=function(_0x2beb17){while(--_0x2beb17){_0x2b5947['push'](_0x2b5947['shift']());}};_0x3080a3(++_0x2383a6);}(_0xe4a0,0x1c5));var _0x0e4a=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe4a0[_0x1035c1];return _0x308d67;};'use strict';var moment=require('moment');var util=require(_0x0e4a('0x0'));var _=require(_0x0e4a('0x1'));var client=require('../client');exports[_0x0e4a('0x2')]=function(_0x1c75ec){return client[_0x0e4a('0x3')](_0x0e4a('0x4'),{'body':_[_0x0e4a('0x5')](_0x1c75ec,{'source':_0x1c75ec[_0x0e4a('0x6')],'destinationcontext':_0x1c75ec['context'],'callerid':_0x1c75ec[_0x0e4a('0x7')],'amaflags':_0x0e4a('0x8')}),'log':_0x0e4a('0x4')});};exports[_0x0e4a('0x9')]=function(){return function(){return client['Request'](_0x0e4a('0xa'),{'options':{'where':{'type':[_0x0e4a('0xb')],'createdAt':{'$between':[moment()[_0x0e4a('0xc')](_0x0e4a('0xd'))['format'](_0x0e4a('0xe')),moment()['endOf'](_0x0e4a('0xd'))[_0x0e4a('0xf')](_0x0e4a('0xe'))]}},'attributes':['type','disposition',_0x0e4a('0x10'),_0x0e4a('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2b493bc..abde2c6 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 _0x19b9=['../client','create','Request','CreateVoiceDialReport'];(function(_0x4429c3,_0x9bc829){var _0x4e7a9e=function(_0x5e6615){while(--_0x5e6615){_0x4429c3['push'](_0x4429c3['shift']());}};_0x4e7a9e(++_0x9bc829);}(_0x19b9,0x130));var _0x919b=function(_0x2e1e1b,_0x58d54f){_0x2e1e1b=_0x2e1e1b-0x0;var _0x4488b3=_0x19b9[_0x2e1e1b];return _0x4488b3;};'use strict';var client=require(_0x919b('0x0'));exports[_0x919b('0x1')]=function(_0x3b4527){return client[_0x919b('0x2')](_0x919b('0x3'),{'body':_0x3b4527,'log':_0x919b('0x3')});}; \ No newline at end of file +var _0x2621=['Request','CreateVoiceDialReport','create'];(function(_0x4a892e,_0x2dccef){var _0xb6cf9f=function(_0x508ebc){while(--_0x508ebc){_0x4a892e['push'](_0x4a892e['shift']());}};_0xb6cf9f(++_0x2dccef);}(_0x2621,0x1d6));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x1262('0x0')]=function(_0x131460){return client[_0x1262('0x1')](_0x1262('0x2'),{'body':_0x131460,'log':_0x1262('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 8a692ca..82830d3 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 _0x9d02=['../client','Request','exten','getVoiceExtensions'];(function(_0x4e0ab8,_0x401afb){var _0x4c1f40=function(_0x7f95ef){while(--_0x7f95ef){_0x4e0ab8['push'](_0x4e0ab8['shift']());}};_0x4c1f40(++_0x401afb);}(_0x9d02,0x118));var _0x29d0=function(_0x4ac44b,_0x5f9519){_0x4ac44b=_0x4ac44b-0x0;var _0x551b28=_0x9d02[_0x4ac44b];return _0x551b28;};'use strict';var client=require(_0x29d0('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x29d0('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x29d0('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x29d0('0x3')});};}; \ No newline at end of file +var _0x6324=['GetVoiceExtension','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x2bf799,_0x3d81dc){var _0x220479=function(_0x3ca801){while(--_0x3ca801){_0x2bf799['push'](_0x2bf799['shift']());}};_0x220479(++_0x3d81dc);}(_0x6324,0x142));var _0x4632=function(_0x208cf0,_0x486665){_0x208cf0=_0x208cf0-0x0;var _0x372d0d=_0x6324[_0x208cf0];return _0x372d0d;};'use strict';var client=require(_0x4632('0x0'));exports[_0x4632('0x1')]=function(){return function(){return client[_0x4632('0x2')](_0x4632('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x4632('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8f9b6ce..5817ac5 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 _0xa6b5=['monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw'];(function(_0xfe3123,_0x3628db){var _0x55963a=function(_0x5ab7d5){while(--_0x5ab7d5){_0xfe3123['push'](_0xfe3123['shift']());}};_0x55963a(++_0x3628db);}(_0xa6b5,0x174));var _0x5a6b=function(_0x37c845,_0x4828f3){_0x37c845=_0x37c845-0x0;var _0xb8fc6b=_0xa6b5[_0x37c845];return _0xb8fc6b;};'use strict';var client=require(_0x5a6b('0x0'));exports[_0x5a6b('0x1')]=function(){return function(){return client[_0x5a6b('0x2')](_0x5a6b('0x3'),{'options':{'raw':![],'attributes':['id',_0x5a6b('0x4'),_0x5a6b('0x5'),'acwTimeout','autopause',_0x5a6b('0x6'),_0x5a6b('0x7'),'dialActive',_0x5a6b('0x8'),_0x5a6b('0x9'),_0x5a6b('0xa'),_0x5a6b('0xb'),_0x5a6b('0xc'),_0x5a6b('0xd'),_0x5a6b('0xe'),_0x5a6b('0xf'),_0x5a6b('0x10'),_0x5a6b('0x11'),'dialQueueOptions',_0x5a6b('0x12'),'dialQueueProject',_0x5a6b('0x13'),_0x5a6b('0x14'),_0x5a6b('0x15'),'dialBusyRetryFrequency',_0x5a6b('0x16'),_0x5a6b('0x17'),_0x5a6b('0x18'),'dialTimezone','dialGlobalInterval',_0x5a6b('0x19'),'dialCheckDuplicateType','dialAMDActive',_0x5a6b('0x1a'),_0x5a6b('0x1b'),'dialAMDAfterGreetingSilence',_0x5a6b('0x1c'),_0x5a6b('0x1d'),_0x5a6b('0x1e'),_0x5a6b('0x1f'),_0x5a6b('0x20'),_0x5a6b('0x21'),_0x5a6b('0x22'),_0x5a6b('0x23'),_0x5a6b('0x24'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0x5a6b('0x25'),_0x5a6b('0x26'),'monitor_format',_0x5a6b('0x27'),_0x5a6b('0x28'),_0x5a6b('0x29'),_0x5a6b('0x2a'),_0x5a6b('0x2b'),_0x5a6b('0x2c'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0x5a6b('0x2d'),_0x5a6b('0x2e'),_0x5a6b('0x2f'),_0x5a6b('0x30'),'dialAgentRejectRetryFrequency',_0x5a6b('0x31'),'dialPredictiveIntervalMaxThreshold',_0x5a6b('0x32'),_0x5a6b('0x33'),_0x5a6b('0x34'),_0x5a6b('0x35')],'include':[{'model':_0x5a6b('0x36'),'as':_0x5a6b('0x36'),'attributes':['id',_0x5a6b('0x4'),_0x5a6b('0x37'),_0x5a6b('0x38')]},{'model':_0x5a6b('0x39'),'as':_0x5a6b('0x3a'),'attributes':['id',_0x5a6b('0x4')]},{'model':_0x5a6b('0x36'),'as':_0x5a6b('0x3b'),'attributes':['id','name',_0x5a6b('0x37'),_0x5a6b('0x38')]},{'model':_0x5a6b('0x3c'),'as':'Interval','attributes':['id',_0x5a6b('0x4')],'include':[{'model':_0x5a6b('0x3c'),'as':_0x5a6b('0x3d'),'attributes':['id',_0x5a6b('0x4'),_0x5a6b('0x3e')]}]}]},'log':_0x5a6b('0x1')});};}; \ No newline at end of file +var _0xa455=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency'];(function(_0x1bfb88,_0x15f47c){var _0xd7760d=function(_0x190d85){while(--_0x190d85){_0x1bfb88['push'](_0x1bfb88['shift']());}};_0xd7760d(++_0x15f47c);}(_0xa455,0x1c8));var _0x5a45=function(_0x1a32be,_0x5df751){_0x1a32be=_0x1a32be-0x0;var _0x515b92=_0xa455[_0x1a32be];return _0x515b92;};'use strict';var client=require(_0x5a45('0x0'));exports[_0x5a45('0x1')]=function(){return function(){return client[_0x5a45('0x2')](_0x5a45('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x5a45('0x4'),'acwTimeout','autopause',_0x5a45('0x5'),_0x5a45('0x6'),_0x5a45('0x7'),_0x5a45('0x8'),_0x5a45('0x9'),_0x5a45('0xa'),_0x5a45('0xb'),_0x5a45('0xc'),'dialPredictiveOptimizationPercentage',_0x5a45('0xd'),_0x5a45('0xe'),_0x5a45('0xf'),'dialOriginateTimeout',_0x5a45('0x10'),_0x5a45('0x11'),_0x5a45('0x12'),_0x5a45('0x13'),_0x5a45('0x14'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x5a45('0x15'),_0x5a45('0x16'),_0x5a45('0x17'),_0x5a45('0x18'),_0x5a45('0x19'),_0x5a45('0x1a'),'dialCheckDuplicateType',_0x5a45('0x1b'),_0x5a45('0x1c'),_0x5a45('0x1d'),'dialAMDAfterGreetingSilence',_0x5a45('0x1e'),_0x5a45('0x1f'),_0x5a45('0x20'),_0x5a45('0x21'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x5a45('0x22'),_0x5a45('0x23'),'dialRecallInQueue',_0x5a45('0x24'),_0x5a45('0x25'),_0x5a45('0x26'),'dialQueueProject2',_0x5a45('0x5'),_0x5a45('0x27'),_0x5a45('0x28'),_0x5a45('0x29'),_0x5a45('0x2a'),_0x5a45('0x2b'),_0x5a45('0x2c'),'dialDropRetryFrequency',_0x5a45('0x2d'),_0x5a45('0x2e'),'dialMachineMaxRetry',_0x5a45('0x2f'),_0x5a45('0x30'),_0x5a45('0x31'),_0x5a45('0x32'),_0x5a45('0x33'),_0x5a45('0x34'),'dialPreviewAutoRecallMe',_0x5a45('0x35'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0x5a45('0x36'),'as':_0x5a45('0x36'),'attributes':['id',_0x5a45('0x37'),_0x5a45('0x38'),_0x5a45('0x39')]},{'model':_0x5a45('0x3a'),'as':'mandatoryDispositionPause','attributes':['id',_0x5a45('0x37')]},{'model':_0x5a45('0x36'),'as':_0x5a45('0x3b'),'attributes':['id','name',_0x5a45('0x38'),_0x5a45('0x39')]},{'model':_0x5a45('0x3c'),'as':'Interval','attributes':['id',_0x5a45('0x37')],'include':[{'model':_0x5a45('0x3c'),'as':_0x5a45('0x3d'),'attributes':['id','name',_0x5a45('0x3e')]}]}]},'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 ec0440b..0850e5d 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(_0x1c3397,_0x50a713){var _0x47c4cd=function(_0x4dbe2e){while(--_0x4dbe2e){_0x1c3397['push'](_0x1c3397['shift']());}};_0x47c4cd(++_0x50a713);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x3e682b,_0x49d6ca){var _0x3afd6f=function(_0x4d7bf8){while(--_0x4d7bf8){_0x3e682b['push'](_0x3e682b['shift']());}};_0x3afd6f(++_0x49d6ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 1169dea..fae2e8a 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 _0x4fe6=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x397f35,_0x4753cd){var _0x2892d6=function(_0x46d7cc){while(--_0x46d7cc){_0x397f35['push'](_0x397f35['shift']());}};_0x2892d6(++_0x4753cd);}(_0x4fe6,0x157));var _0x64fe=function(_0x309527,_0x2bd746){_0x309527=_0x309527-0x0;var _0x4cd521=_0x4fe6[_0x309527];return _0x4cd521;};'use strict';var client=require(_0x64fe('0x0'));exports[_0x64fe('0x1')]=function(_0x58855c){return function(){return client[_0x64fe('0x2')](_0x64fe('0x3'),{'options':{'where':{'VoiceQueueId':_0x58855c,'paused':!![]},'raw':!![]},'log':_0x64fe('0x1')});};}; \ No newline at end of file +var _0xa93d=['getVoiceQueueRtPauses','Request'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa93d,0xb6));var _0xda93=function(_0x259f93,_0x456cd9){_0x259f93=_0x259f93-0x0;var _0x2796f9=_0xa93d[_0x259f93];return _0x2796f9;};'use strict';var client=require('../client');exports[_0xda93('0x0')]=function(_0x4f7968){return function(){return client[_0xda93('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4f7968,'paused':!![]},'raw':!![]},'log':_0xda93('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 03fbe20..24c1a8c 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2b4bc0,_0x33e46d){var _0x125da3=function(_0x4d017e){while(--_0x4d017e){_0x2b4bc0['push'](_0x2b4bc0['shift']());}};_0x125da3(++_0x33e46d);}(_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 +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x18c387,_0x2be897){var _0x597f75=function(_0x5167b2){while(--_0x5167b2){_0x18c387['push'](_0x18c387['shift']());}};_0x597f75(++_0x2be897);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 ee0472f..23c181c 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 _0xb160=['transfereeexten','transfereelinkedid','isexternal','blind','attendedTransfer','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xb160,0x114));var _0x0b16=function(_0x38495a,_0x23b4a5){_0x38495a=_0x38495a-0x0;var _0x34ded1=_0xb160[_0x38495a];return _0x34ded1;};'use strict';var client=require('../client');exports[_0x0b16('0x0')]={};exports['blindTransfer']=function(_0x416569){return client[_0x0b16('0x1')](_0x0b16('0x2'),{'body':{'result':_0x416569[_0x0b16('0x3')],'transfererchannel':_0x416569['transfererchannel'],'transferercalleridnum':_0x416569[_0x0b16('0x4')],'transferercalleridname':_0x416569['transferercalleridname'],'transfererconnectedlinenum':_0x416569[_0x0b16('0x5')],'transfererconnectedlinename':_0x416569[_0x0b16('0x6')],'transfereraccountcode':_0x416569['transfereraccountcode'],'transferercontext':_0x416569[_0x0b16('0x7')],'transfererexten':_0x416569[_0x0b16('0x8')],'transfererlinkedid':_0x416569['transfererlinkedid'],'transfereechannel':_0x416569['transfereechannel'],'transfereecalleridnum':_0x416569['transfereecalleridnum'],'transfereecalleridname':_0x416569['transfereecalleridname'],'transfereeconnectedlinenum':_0x416569[_0x0b16('0x9')],'transfereeconnectedlinename':_0x416569[_0x0b16('0xa')],'transfereeaccountcode':_0x416569[_0x0b16('0xb')],'transfereecontext':_0x416569['transfereecontext'],'transfereeexten':_0x416569[_0x0b16('0xc')],'transfereelinkedid':_0x416569[_0x0b16('0xd')],'isexternal':_0x416569[_0x0b16('0xe')],'context':_0x416569['context'],'extension':_0x416569['extension'],'type':_0x0b16('0xf')},'log':'CreateVoiceTransferReport'});};exports[_0x0b16('0x10')]=function(_0x9e6657){return client[_0x0b16('0x1')](_0x0b16('0x2'),{'body':{'result':_0x9e6657[_0x0b16('0x3')],'transfererchannel':_0x9e6657['origtransfererchannel'],'transferercalleridnum':_0x9e6657[_0x0b16('0x11')],'transferercalleridname':_0x9e6657['origtransferercalleridname'],'transfererconnectedlinenum':_0x9e6657['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x9e6657[_0x0b16('0x12')],'transfereraccountcode':_0x9e6657[_0x0b16('0x13')],'transferercontext':_0x9e6657[_0x0b16('0x14')],'transfererexten':_0x9e6657[_0x0b16('0x15')],'transfererlinkedid':_0x9e6657[_0x0b16('0x16')],'transfereechannel':_0x9e6657['transfertargetchannel'],'transfereecalleridnum':_0x9e6657[_0x0b16('0x17')],'transfereecalleridname':_0x9e6657['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x9e6657[_0x0b16('0x18')],'transfereeconnectedlinename':_0x9e6657[_0x0b16('0x19')],'transfereeaccountcode':_0x9e6657[_0x0b16('0x1a')],'transfereecontext':_0x9e6657[_0x0b16('0x1b')],'transfereeexten':_0x9e6657['transfertargetexten'],'transfereelinkedid':_0x9e6657[_0x0b16('0x1c')],'isexternal':_0x9e6657[_0x0b16('0xe')],'context':_0x9e6657[_0x0b16('0x1d')],'extension':_0x9e6657[_0x0b16('0x1e')],'type':_0x0b16('0x1f')},'log':_0x0b16('0x2')});}; \ No newline at end of file +var _0xc610=['transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridnum','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel'];(function(_0x39628c,_0x2eb8c4){var _0x2b0532=function(_0x87cc3b){while(--_0x87cc3b){_0x39628c['push'](_0x39628c['shift']());}};_0x2b0532(++_0x2eb8c4);}(_0xc610,0x10c));var _0x0c61=function(_0x25f3e3,_0x207891){_0x25f3e3=_0x25f3e3-0x0;var _0xa89b6d=_0xc610[_0x25f3e3];return _0xa89b6d;};'use strict';var client=require(_0x0c61('0x0'));exports[_0x0c61('0x1')]={};exports[_0x0c61('0x2')]=function(_0x22f654){return client[_0x0c61('0x3')](_0x0c61('0x4'),{'body':{'result':_0x22f654['result'],'transfererchannel':_0x22f654['transfererchannel'],'transferercalleridnum':_0x22f654[_0x0c61('0x5')],'transferercalleridname':_0x22f654[_0x0c61('0x6')],'transfererconnectedlinenum':_0x22f654['transfererconnectedlinenum'],'transfererconnectedlinename':_0x22f654['transfererconnectedlinename'],'transfereraccountcode':_0x22f654[_0x0c61('0x7')],'transferercontext':_0x22f654[_0x0c61('0x8')],'transfererexten':_0x22f654[_0x0c61('0x9')],'transfererlinkedid':_0x22f654[_0x0c61('0xa')],'transfereechannel':_0x22f654[_0x0c61('0xb')],'transfereecalleridnum':_0x22f654[_0x0c61('0xc')],'transfereecalleridname':_0x22f654[_0x0c61('0xd')],'transfereeconnectedlinenum':_0x22f654[_0x0c61('0xe')],'transfereeconnectedlinename':_0x22f654[_0x0c61('0xf')],'transfereeaccountcode':_0x22f654['transfereeaccountcode'],'transfereecontext':_0x22f654[_0x0c61('0x10')],'transfereeexten':_0x22f654[_0x0c61('0x11')],'transfereelinkedid':_0x22f654[_0x0c61('0x12')],'isexternal':_0x22f654[_0x0c61('0x13')],'context':_0x22f654[_0x0c61('0x14')],'extension':_0x22f654[_0x0c61('0x15')],'type':_0x0c61('0x16')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x203ccc){return client['Request'](_0x0c61('0x4'),{'body':{'result':_0x203ccc['result'],'transfererchannel':_0x203ccc[_0x0c61('0x17')],'transferercalleridnum':_0x203ccc[_0x0c61('0x18')],'transferercalleridname':_0x203ccc['origtransferercalleridname'],'transfererconnectedlinenum':_0x203ccc['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x203ccc['secondtransfererconnectedlinename'],'transfereraccountcode':_0x203ccc['origtransfereraccountcode'],'transferercontext':_0x203ccc[_0x0c61('0x19')],'transfererexten':_0x203ccc['secondtransfererexten'],'transfererlinkedid':_0x203ccc['origtransfererlinkedid'],'transfereechannel':_0x203ccc[_0x0c61('0x1a')],'transfereecalleridnum':_0x203ccc[_0x0c61('0x1b')],'transfereecalleridname':_0x203ccc[_0x0c61('0x1c')],'transfereeconnectedlinenum':_0x203ccc[_0x0c61('0x1d')],'transfereeconnectedlinename':_0x203ccc[_0x0c61('0x1e')],'transfereeaccountcode':_0x203ccc[_0x0c61('0x1f')],'transfereecontext':_0x203ccc[_0x0c61('0x20')],'transfereeexten':_0x203ccc['transfertargetexten'],'transfereelinkedid':_0x203ccc[_0x0c61('0x21')],'isexternal':_0x203ccc[_0x0c61('0x13')],'context':_0x203ccc[_0x0c61('0x22')],'extension':_0x203ccc['origtransfererexten'],'type':'attended'},'log':_0x0c61('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a90cd82..6fa2707 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 _0xcaf2=['lodash','jayson/promise','validate','moment','../../../config/environment','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','username','join','pick','keys','module','Reload','then','catch','error','message','asterisk','ami\x20disconnected','command','action','Command','Action','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','%s.%s','filename','wav','MixMonitor','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outbound','campaigns','run','event','emit','faxAccounts','send','checkAfterSend','http','listen','127.0.0.1','RPC\x20listening\x20on\x20port:'];(function(_0xcb6050,_0x37cd99){var _0x4a8a38=function(_0x2fb436){while(--_0x2fb436){_0xcb6050['push'](_0xcb6050['shift']());}};_0x4a8a38(++_0x37cd99);}(_0xcaf2,0x8a));var _0x2caf=function(_0x5d8cb7,_0x2851f7){_0x5d8cb7=_0x5d8cb7-0x0;var _0xece05d=_0xcaf2[_0x5d8cb7];return _0xece05d;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var jayson=require(_0x2caf('0x1'));var schema=require(_0x2caf('0x2'));var BPromise=require('bluebird');var moment=require(_0x2caf('0x3'));var config=require(_0x2caf('0x4'));var properties=require('../properties');var ami=require(_0x2caf('0x5'));exports['listen']=function(_0x335e3c,_0xae320c,_0x249a4b){return new BPromise(function(_0x599ce7,_0xc44e4e){var _0x314486={'QueuePause':function(_0x4667c6){return new Promise(function(_0x34e792,_0x5611aa){var _0x4050ab=util[_0x2caf('0x6')](_0x2caf('0x7'),_0x2caf('0x8'),_0x4667c6[_0x2caf('0x9')]);if(_0x335e3c[_0x2caf('0xa')]&&_0x335e3c[_0x2caf('0xa')][_0x4050ab]&&_0x335e3c[_0x2caf('0xa')][_0x4050ab][_0x2caf('0xb')]){_0x335e3c['timers'][_0x4050ab][_0x2caf('0xc')]();}if(_0x335e3c[_0x2caf('0xd')][_0x4050ab]){_0x335e3c[_0x2caf('0xd')][_0x4050ab][_0x2caf('0xe')]({'statePause':_0x4667c6[_0x2caf('0xf')]?!![]:![]});}_0x34e792({'code':0xc8,'message':_0x2caf('0x10')});});},'Reload':function(_0x252147){var _0x3b2e0a=this;return new Promise(function(_0x5106fd,_0x7258b1){if(ami[_0x2caf('0x11')]()==![]){return _0x7258b1(_0x3b2e0a['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x2caf('0x12')],'ami\x20disconnected'][_0x2caf('0x13')]('\x20')));}_0x252147=_[_0x2caf('0x14')](_0x252147,_[_0x2caf('0x15')](properties[_0x2caf('0x16')]));_0x252147['action']=_0x2caf('0x17');return ami['Action'](_0x252147)[_0x2caf('0x18')](function(_0x57f3cd){_0x5106fd({'code':0xc8,'message':_0x57f3cd['message']});})[_0x2caf('0x19')](function(_0x58047b){_0x7258b1(_0x3b2e0a[_0x2caf('0x1a')](0x1f5,_0x58047b[_0x2caf('0x1b')]));});});},'Command':function(_0x5c5d98){var _0x12624b=this;return new Promise(function(_0x1eeb76,_0x6b3778){if(ami[_0x2caf('0x11')]()==![]){return _0x6b3778(_0x12624b[_0x2caf('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0x2caf('0x1c')][_0x2caf('0x12')],_0x2caf('0x1d')][_0x2caf('0x13')]('\x20')));}_0x5c5d98=_[_0x2caf('0x14')](_0x5c5d98,_0x2caf('0x1e'));_0x5c5d98[_0x2caf('0x1f')]=_0x2caf('0x20');return ami[_0x2caf('0x21')](_0x5c5d98)[_0x2caf('0x18')](function(_0x6814bc){_0x1eeb76({'code':0xc8,'message':_0x6814bc['content']});})[_0x2caf('0x19')](function(_0x14bfd2){_0x6b3778(_0x12624b[_0x2caf('0x1a')](0x1f5,_0x14bfd2[_0x2caf('0x1b')]));});});},'VoiceQueues':function(_0x3efa4e){return new Promise(function(_0x25ebea,_0x392196){var _0x164da=[];for(var _0x2e0a75 in _0x335e3c[_0x2caf('0x22')]){if(_0x335e3c['voiceQueues'][_0x2caf('0x23')](_0x2e0a75)){var _0x325eda=_0x335e3c[_0x2caf('0x22')][_0x2e0a75];var _0x37b08f={'id':_0x325eda['id'],'name':_0x325eda[_0x2caf('0x9')],'strategy':_0x325eda[_0x2caf('0x24')],'answered':_0x325eda[_0x2caf('0x25')],'available':_0x325eda[_0x2caf('0x26')],'loggedIn':_0x325eda[_0x2caf('0x27')],'pTalking':_0x325eda[_0x2caf('0x28')],'sumBillable':_0x325eda[_0x2caf('0x29')],'sumDuration':_0x325eda[_0x2caf('0x2a')],'sumHoldTime':_0x325eda[_0x2caf('0x2b')]||0x0,'talking':_0x325eda['talking'],'total':_0x325eda[_0x2caf('0x2c')],'type':_0x325eda[_0x2caf('0x2d')],'unmanaged':_0x325eda[_0x2caf('0x2e')],'abandoned':_0x325eda[_0x2caf('0x2f')],'waiting':_0x325eda[_0x2caf('0x30')],'loggedInDb':_0x325eda[_0x2caf('0x31')]};if(_0x325eda[_0x2caf('0x2d')]==='outbound'){_0x37b08f[_0x2caf('0x32')]=_0x325eda[_0x2caf('0x32')];_0x37b08f['dialMethod']=_0x325eda[_0x2caf('0x33')];_0x37b08f[_0x2caf('0x34')]=_0x325eda[_0x2caf('0x34')];_0x37b08f['dialOriginateCallerIdNumber']=_0x325eda[_0x2caf('0x35')];_0x37b08f['dialOriginateTimeout']=_0x325eda['dialOriginateTimeout'];_0x37b08f[_0x2caf('0x36')]=_0x325eda[_0x2caf('0x36')];_0x37b08f[_0x2caf('0x37')]=_0x325eda[_0x2caf('0x37')];_0x37b08f[_0x2caf('0x38')]=_0x325eda[_0x2caf('0x38')];_0x37b08f[_0x2caf('0x39')]=_0x325eda[_0x2caf('0x39')];_0x37b08f[_0x2caf('0x3a')]=_0x325eda['outboundBlacklistCallsDay'];_0x37b08f[_0x2caf('0x3b')]=_0x325eda[_0x2caf('0x3b')];_0x37b08f[_0x2caf('0x3c')]=_0x325eda[_0x2caf('0x3c')];_0x37b08f[_0x2caf('0x3d')]=_0x325eda[_0x2caf('0x3d')];_0x37b08f[_0x2caf('0x3e')]=_0x325eda[_0x2caf('0x3e')];_0x37b08f[_0x2caf('0x3f')]=_0x325eda[_0x2caf('0x3f')];_0x37b08f[_0x2caf('0x40')]=_0x325eda[_0x2caf('0x40')];_0x37b08f['outboundNoSuchCallsDay']=_0x325eda['outboundNoSuchCallsDay'];_0x37b08f[_0x2caf('0x41')]=_0x325eda[_0x2caf('0x41')];_0x37b08f[_0x2caf('0x42')]=_0x325eda[_0x2caf('0x42')];_0x37b08f['outboundRejectCallsDay']=_0x325eda[_0x2caf('0x43')];_0x37b08f[_0x2caf('0x44')]=_0x325eda[_0x2caf('0x44')];_0x37b08f[_0x2caf('0x45')]=_0x325eda[_0x2caf('0x45')];_0x37b08f[_0x2caf('0x46')]=_0x325eda[_0x2caf('0x46')];_0x37b08f[_0x2caf('0x47')]=_0x325eda['predictiveIntervalAvgTalktime'];_0x37b08f['predictiveIntervalDroppedCallsCallersExit']=_0x325eda[_0x2caf('0x48')];_0x37b08f[_0x2caf('0x49')]=_0x325eda[_0x2caf('0x49')];_0x37b08f[_0x2caf('0x4a')]=_0x325eda[_0x2caf('0x4a')];_0x37b08f[_0x2caf('0x4b')]=_0x325eda[_0x2caf('0x4b')];_0x37b08f[_0x2caf('0x4c')]=_0x325eda[_0x2caf('0x4c')];_0x37b08f[_0x2caf('0x4d')]=_0x325eda[_0x2caf('0x4d')];_0x37b08f['predictiveIntervalPauses']=_0x325eda[_0x2caf('0x4e')];_0x37b08f[_0x2caf('0x4f')]=_0x325eda[_0x2caf('0x4f')];_0x37b08f['predictiveIntervalTotalCalls']=_0x325eda[_0x2caf('0x50')];_0x37b08f[_0x2caf('0x1b')]=_0x325eda[_0x2caf('0x1b')];_0x37b08f['originated']=_0x325eda[_0x2caf('0x51')];_0x37b08f[_0x2caf('0x52')]=_0x325eda['erlangCalls'];_0x37b08f[_0x2caf('0x53')]=_0x325eda[_0x2caf('0x53')];_0x37b08f['erlangAbandonmentRate']=_0x325eda[_0x2caf('0x54')];_0x37b08f[_0x2caf('0x55')]=_0x325eda[_0x2caf('0x55')];_0x37b08f[_0x2caf('0x56')]=_0x325eda[_0x2caf('0x56')];_0x37b08f[_0x2caf('0x57')]=_0x325eda[_0x2caf('0x57')];}if(_0x325eda[_0x2caf('0x58')]){_0x37b08f['Trunk']={'id':_0x325eda[_0x2caf('0x58')]['id'],'name':_0x325eda['Trunk'][_0x2caf('0x9')],'active':_0x325eda[_0x2caf('0x58')][_0x2caf('0x59')],'callerid':_0x325eda['Trunk']['callerid']};}if(_0x325eda[_0x2caf('0x5a')]){_0x37b08f['Interval']={'id':_0x325eda[_0x2caf('0x5a')]['id'],'name':_0x325eda[_0x2caf('0x5a')][_0x2caf('0x9')]};}_0x164da[_0x2caf('0x5b')](_0x37b08f);}}_0x25ebea({'count':_0x164da[_0x2caf('0x5c')],'rows':_0x164da});});},'UpdateVoiceQueue':function(_0x334cfa){return new Promise(function(_0x18dc5b,_0x61ca34){var _0x100681=_[_0x2caf('0x5d')](_0x335e3c[_0x2caf('0x22')],{'id':parseInt(_0x334cfa['id'])});var _0x319452=_[_0x2caf('0x5e')](_0x334cfa,['id']);if(_0x100681){for(var _0x9a62bd in _0x319452){if(typeof _0x319452[_0x9a62bd]!==_0x2caf('0x5f')&&typeof _0x100681[_0x9a62bd]!==_0x2caf('0x5f')){_0x100681[_0x9a62bd]=_0x319452[_0x9a62bd];}}_0x18dc5b(_0x100681);}else{_0x61ca34();}});},'VoiceChannels':function(_0x123bab){return new Promise(function(_0x1e691a,_0x36fb19){var _0x3a598b=_[_0x2caf('0x60')](_0x335e3c['channels']);_0x1e691a({'count':_0x3a598b[_0x2caf('0x5c')],'rows':_0x3a598b});});},'VoiceChannelMixMonitor':function(_0x17ea46){var _0x4fe096=this;return new Promise(function(_0x589c57,_0x44bca0){if(ami[_0x2caf('0x11')]()==![]){return _0x44bca0(_0x4fe096['error'](0x1f4,[config[_0x2caf('0x1c')]['ip'],config[_0x2caf('0x1c')][_0x2caf('0x12')],_0x2caf('0x1d')][_0x2caf('0x13')]('\x20')));}var _0xb69a31=schema(properties[_0x2caf('0x61')])[_0x2caf('0x2')](_0x17ea46);if(_0xb69a31[_0x2caf('0x5c')]>0x0){return _0x44bca0(_0x4fe096[_0x2caf('0x1a')](0x1f4,_[_0x2caf('0x62')](_0xb69a31,_0x2caf('0x1b'))[_0x2caf('0x13')](',\x20')));}var _0x5b8d66=_[_0x2caf('0x5d')](_0x335e3c[_0x2caf('0x63')],{'uniqueid':_0x17ea46[_0x2caf('0x64')]});if(_0x5b8d66&&_0x5b8d66['channel']){var _0x473188=util[_0x2caf('0x6')](_0x2caf('0x65'),_0x17ea46[_0x2caf('0x66')]||_0x17ea46[_0x2caf('0x64')],_0x17ea46[_0x2caf('0x6')]||_0x2caf('0x67'));return ami[_0x2caf('0x21')]({'action':_0x2caf('0x68'),'channel':_0x5b8d66[_0x2caf('0x69')],'file':_0x473188,'options':'ai(mixmonitorid)'})[_0x2caf('0x18')](function(_0x106930){var _0xa325cd=_['find'](_0x5b8d66[_0x2caf('0x6a')],{'filename':_0x2caf('0x6b')+_0x473188[_0x2caf('0x6c')]()});if(_['isNil'](_0xa325cd)){_0x5b8d66[_0x2caf('0x6a')][_0x2caf('0x5b')]({'filename':_0x2caf('0x6b')+_0x473188[_0x2caf('0x6c')](),'createdAt':moment()['format'](_0x2caf('0x6d')),'mixmonitorid':_0x106930[_0x2caf('0x6e')],'status':_0x2caf('0x6f')});}else{_0xa325cd['mixmonitorid']=_0x106930[_0x2caf('0x6e')];_0xa325cd[_0x2caf('0x70')]='rec';}_0x589c57({'code':0xc8,'message':[_0x17ea46[_0x2caf('0x64')],_0x2caf('0x71'),_0x106930[_0x2caf('0x6e')]]['join']('\x20'),'mixmonitorid':_0x106930[_0x2caf('0x6e')]});})['catch'](function(_0x96960a){_0x44bca0(_0x4fe096[_0x2caf('0x1a')](0x1f5,[_0x17ea46['uniqueid'],_0x96960a['message'][_0x2caf('0x6c')]()][_0x2caf('0x13')]('\x20')));});}else{return _0x44bca0(_0x4fe096[_0x2caf('0x1a')](0x1f5,_0x2caf('0x72')));}});},'VoiceChannelStopMixMonitor':function(_0xb3d0c){var _0x4ea3d5=this;return new Promise(function(_0x2787eb,_0x17451c){if(ami['isConnected']()==![]){return _0x17451c(_0x4ea3d5[_0x2caf('0x1a')](0x1f4,[config[_0x2caf('0x1c')]['ip'],config['asterisk']['username'],_0x2caf('0x1d')]['join']('\x20')));}var _0x2e8de2=schema(properties[_0x2caf('0x61')])[_0x2caf('0x2')](_0xb3d0c);if(_0x2e8de2[_0x2caf('0x5c')]>0x0){return _0x17451c(_0x4ea3d5[_0x2caf('0x1a')](0x1f4,_['map'](_0x2e8de2,_0x2caf('0x1b'))['join'](',\x20')));}var _0x21a167=_['find'](_0x335e3c[_0x2caf('0x63')],{'uniqueid':_0xb3d0c['uniqueid']});if(_0x21a167){return BPromise['resolve']()[_0x2caf('0x18')](function(){if(_0x21a167['channel']){return ami[_0x2caf('0x21')]({'action':'StopMixMonitor','channel':_0x21a167['channel'],'mixmonitorid':_0xb3d0c[_0x2caf('0x6e')]})[_0x2caf('0x19')](function(_0x380c2e){});}})[_0x2caf('0x18')](function(){if(_0x21a167[_0x2caf('0x73')]){return ami['Action']({'action':_0x2caf('0x74'),'channel':_0x21a167[_0x2caf('0x73')],'mixmonitorid':_0xb3d0c['mixmonitorid']})[_0x2caf('0x19')](function(_0x4b0360){});}})[_0x2caf('0x18')](function(_0x1bfd2a){var _0x4399ec=_[_0x2caf('0x5d')](_0x21a167[_0x2caf('0x6a')],{'mixmonitorid':_0xb3d0c['mixmonitorid']});if(_0x4399ec){_0x4399ec['status']=_0x2caf('0x75');}})[_0x2caf('0x18')](function(){var _0x90ddb1=util[_0x2caf('0x6')](_0x2caf('0x65'),_0xb3d0c[_0x2caf('0x66')]||_0xb3d0c[_0x2caf('0x64')],_0xb3d0c['format']||_0x2caf('0x67'));var _0x34d3ec=_[_0x2caf('0x5d')](_0x21a167[_0x2caf('0x6a')],{'filename':_0x2caf('0x6b')+_0x90ddb1['toLowerCase']()});if(_0x34d3ec){_0x34d3ec[_0x2caf('0x70')]='stop';}})[_0x2caf('0x18')](function(){_0x2787eb({'code':0xc8,'message':[_0xb3d0c[_0x2caf('0x64')],_0x2caf('0x76')][_0x2caf('0x13')]('\x20')});})[_0x2caf('0x19')](function(_0x4ebedc){_0x17451c(_0x4ea3d5[_0x2caf('0x1a')](0x1f5,[_0xb3d0c['uniqueid'],_0x4ebedc[_0x2caf('0x1b')][_0x2caf('0x6c')]()]['join']('\x20')));});}else{return _0x17451c(_0x4ea3d5[_0x2caf('0x1a')](0x1f5,_0x2caf('0x72')));}});},'VoiceQueuesChannels':function(_0x131b1c){return new Promise(function(_0x6f5797,_0x172f98){var _0xd851ee=_['values'](_0x335e3c[_0x2caf('0x77')]);_0x6f5797({'count':_0xd851ee['length'],'rows':_0xd851ee});});},'VoiceQueuesChannel':function(_0x1bc5d7){var _0x5ad1be=this;return new Promise(function(_0x1b127c,_0x232120){var _0x42bf85=schema(properties['voicequeuechannel'])[_0x2caf('0x2')](_0x1bc5d7);if(_0x42bf85[_0x2caf('0x5c')]>0x0){return _0x232120(_0x5ad1be[_0x2caf('0x1a')](0x1f4,_[_0x2caf('0x62')](_0x42bf85,_0x2caf('0x1b'))['join'](',\x20')));}var _0x366c5d=_[_0x2caf('0x5d')](_0x335e3c[_0x2caf('0x77')],{'uniqueid':_0x1bc5d7[_0x2caf('0x64')]});if(_0x366c5d){_0x1b127c(_0x366c5d);}else{return _0x232120(_0x5ad1be[_0x2caf('0x1a')](0x1f5,_0x2caf('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x5ae8de){var _0x3f2745=this;return new Promise(function(_0x5a2633,_0xaee725){if(ami[_0x2caf('0x11')]()==![]){return _0xaee725(_0x3f2745[_0x2caf('0x1a')](0x1f4,[config[_0x2caf('0x1c')]['ip'],config[_0x2caf('0x1c')][_0x2caf('0x12')],_0x2caf('0x1d')][_0x2caf('0x13')]('\x20')));}var _0x5702b4=schema(properties[_0x2caf('0x78')])[_0x2caf('0x2')](_0x5ae8de);if(_0x5702b4[_0x2caf('0x5c')]>0x0){return _0xaee725(_0x3f2745['error'](0x1f4,_[_0x2caf('0x62')](_0x5702b4,_0x2caf('0x1b'))[_0x2caf('0x13')](',\x20')));}var _0x4a29cd=_[_0x2caf('0x5d')](_0x335e3c[_0x2caf('0x77')],{'uniqueid':_0x5ae8de[_0x2caf('0x64')]});if(_0x4a29cd&&_0x4a29cd[_0x2caf('0x69')]){return ami['Action']({'action':'Hangup','channel':_0x4a29cd[_0x2caf('0x69')]})[_0x2caf('0x18')](function(_0x11d10d){_0x5a2633({'code':0xc8,'message':[_0x5ae8de[_0x2caf('0x64')],_0x11d10d[_0x2caf('0x1b')][_0x2caf('0x6c')]()][_0x2caf('0x13')]('\x20')});})[_0x2caf('0x19')](function(_0x20fb6e){_0xaee725(_0x3f2745[_0x2caf('0x1a')](0x1f5,[_0x5ae8de[_0x2caf('0x64')],_0x20fb6e[_0x2caf('0x1b')][_0x2caf('0x6c')]()][_0x2caf('0x13')]('\x20')));});}else{return _0xaee725(_0x3f2745['error'](0x1f5,_0x2caf('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x13e931){var _0x4e1493=this;return new Promise(function(_0x23e2ce,_0x265068){if(ami[_0x2caf('0x11')]()==![]){return _0x265068(_0x4e1493['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x2caf('0x12')],_0x2caf('0x1d')][_0x2caf('0x13')]('\x20')));}var _0x5e0e3c=schema(properties[_0x2caf('0x79')])[_0x2caf('0x2')](_0x13e931);if(_0x5e0e3c[_0x2caf('0x5c')]>0x0){return _0x265068(_0x4e1493['error'](0x1f4,_[_0x2caf('0x62')](_0x5e0e3c,_0x2caf('0x1b'))['join'](',\x20')));}var _0x3cd498=_[_0x2caf('0x5d')](_0x335e3c[_0x2caf('0x77')],{'uniqueid':_0x13e931['uniqueid']});if(_0x3cd498&&_0x3cd498[_0x2caf('0x69')]){return ami[_0x2caf('0x21')]({'action':_0x2caf('0x7a'),'channel':_0x3cd498[_0x2caf('0x69')],'exten':_0x13e931[_0x2caf('0x7b')],'context':_0x13e931[_0x2caf('0x7c')]||_0x3cd498['context'],'priority':0x1})['then'](function(_0x2137b7){_0x23e2ce({'code':0xc8,'message':[_0x13e931[_0x2caf('0x64')],_0x2137b7[_0x2caf('0x1b')][_0x2caf('0x6c')]()][_0x2caf('0x13')]('\x20')});})[_0x2caf('0x19')](function(_0x5fd9c3){_0x265068(_0x4e1493[_0x2caf('0x1a')](0x1f5,[_0x13e931[_0x2caf('0x64')],_0x5fd9c3[_0x2caf('0x1b')][_0x2caf('0x6c')]()][_0x2caf('0x13')]('\x20')));});}else{return _0x265068(_0x4e1493['error'](0x1f5,_0x2caf('0x72')));}});},'Agents':function(_0x313273){return new Promise(function(_0x217778,_0x52bf38){var _0x3def55=_['values'](_0x335e3c['agents']);_0x217778({'count':_0x3def55['length'],'rows':_0x3def55});});},'Telephones':function(_0x2cc9fc){return new Promise(function(_0x509ff1,_0xc9ee15){var _0x2069f0=_['values'](_0x335e3c[_0x2caf('0x7d')]);_0x509ff1({'count':_0x2069f0[_0x2caf('0x5c')],'rows':_0x2069f0});});},'Trunks':function(_0x4a21d2){return new Promise(function(_0x492b49,_0x22cd27){var _0xb1f581=_[_0x2caf('0x60')](_0x335e3c['trunks']);_0x492b49({'count':_0xb1f581['length'],'rows':_0xb1f581});});},'OutboundChannels':function(_0x107d05){return new Promise(function(_0x584efc,_0x3add33){var _0x51df18=_[_0x2caf('0x60')](_0x335e3c['outboundChannels']);_0x584efc({'count':_0x51df18['length'],'rows':_0x51df18});});},'Outbound':function(_0x19e2bd){return new Promise(function(_0x54d8d7,_0x485d4a){_0x54d8d7(_0x335e3c[_0x2caf('0x7e')]);});},'Campaigns':function(_0x3c20b4){return new Promise(function(_0x2aab58,_0x387a48){var _0x1663d3=_['values'](_0x335e3c[_0x2caf('0x7f')]);_0x2aab58({'count':_0x1663d3['length'],'rows':_0x1663d3});});},'VoiceQueuesPreview':function(_0x4c456b){var _0x2998ef=this;return new Promise(function(_0x5559fc,_0x4b7b6a){_0xae320c[_0x2caf('0x80')](_0x4c456b['id'])[_0x2caf('0x18')](function(_0x84a87d){_0x5559fc({'code':0xc8,'message':_0x84a87d['message']});})[_0x2caf('0x19')](function(_0x1b63b1){_0x4b7b6a(_0x2998ef['error'](0x1f4,_0x1b63b1[_0x2caf('0x1b')]));});});},'EventManager':function(_0x528336){var _0x2fec57=this;return new Promise(function(_0xc1697,_0x2fdba6){if(!_0x528336[_0x2caf('0x81')]){return _0x2fdba6(_0x2fec57['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x2caf('0x82')]('custom:'+_0x528336[_0x2caf('0x81')],_0x528336['message']);_0xc1697({'code':0xc8,'message':_0x528336});});},'FaxAccounts':function(_0x55811d){return new Promise(function(_0x598610,_0x50f721){var _0x340e20=_[_0x2caf('0x60')](_0x335e3c[_0x2caf('0x83')]);_0x598610({'count':_0x340e20[_0x2caf('0x5c')],'rows':_0x340e20});});},'SendFax':function(_0x297abb){var _0x3f569f=this;return new Promise(function(_0x1c506e,_0x33b627){_0x249a4b[_0x2caf('0x84')](_0x297abb)['then'](function(_0x290b6b){_0x1c506e({'code':0xc8,'message':_0x290b6b[_0x2caf('0x1b')]});})['catch'](function(_0x49b03e){_0x33b627(_0x3f569f[_0x2caf('0x1a')](0x1f4,_0x49b03e[_0x2caf('0x1b')]));});});},'CheckAfterSend':function(_0x170070){var _0x199d4e=this;return new Promise(function(_0x5ee03e,_0x274b11){_0x249a4b[_0x2caf('0x85')](_0x170070)[_0x2caf('0x18')](function(_0x44aafd){_0x5ee03e({'code':0xc8,'message':_0x44aafd[_0x2caf('0x1b')]});})[_0x2caf('0x19')](function(_0x58c736){_0x274b11(_0x199d4e[_0x2caf('0x1a')](0x1f4,_0x58c736[_0x2caf('0x1b')]));});});}};var _0x102599=jayson['server'](_0x314486)[_0x2caf('0x86')]();_0x102599['on'](_0x2caf('0x1a'),function(_0x511202){return _0xc44e4e(_0x511202);});_0x102599[_0x2caf('0x87')](0x232a,_0x2caf('0x88'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x599ce7(_0x2caf('0x89')+0x232a);});});}; \ No newline at end of file +var _0x4c60=['erlangBusyFactor','startPredictive','Trunk','name','active','callerid','Interval','length','find','undefined','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','values','telephones','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','faxAccounts','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','format','%s/%s','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','catch','command','Command','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0x4c60,0xc1));var _0x04c6=function(_0x2b91c8,_0x523884){_0x2b91c8=_0x2b91c8-0x0;var _0x10d2b2=_0x4c60[_0x2b91c8];return _0x10d2b2;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var jayson=require(_0x04c6('0x2'));var schema=require(_0x04c6('0x3'));var BPromise=require('bluebird');var moment=require(_0x04c6('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require('../ami');exports['listen']=function(_0x3a9493,_0xc6e772,_0x2054da){return new BPromise(function(_0x12bd5d,_0x2b9041){var _0x39be2d={'QueuePause':function(_0x8f9b13){return new Promise(function(_0x530a48,_0x2a4b51){var _0x43a27e=util[_0x04c6('0x5')](_0x04c6('0x6'),'SIP',_0x8f9b13['name']);if(_0x3a9493['timers']&&_0x3a9493[_0x04c6('0x7')][_0x43a27e]&&_0x3a9493['timers'][_0x43a27e][_0x04c6('0x8')]){_0x3a9493[_0x04c6('0x7')][_0x43a27e]['updateAcw']();}if(_0x3a9493[_0x04c6('0x9')][_0x43a27e]){_0x3a9493[_0x04c6('0x9')][_0x43a27e][_0x04c6('0xa')]({'statePause':_0x8f9b13[_0x04c6('0xb')]?!![]:![]});}_0x530a48({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x257a0a){var _0x453342=this;return new Promise(function(_0x4384ad,_0x56422a){if(ami[_0x04c6('0xc')]()==![]){return _0x56422a(_0x453342[_0x04c6('0xd')](0x1f4,[config[_0x04c6('0xe')]['ip'],config[_0x04c6('0xe')][_0x04c6('0xf')],_0x04c6('0x10')][_0x04c6('0x11')]('\x20')));}_0x257a0a=_[_0x04c6('0x12')](_0x257a0a,_['keys'](properties[_0x04c6('0x13')]));_0x257a0a[_0x04c6('0x14')]=_0x04c6('0x15');return ami[_0x04c6('0x16')](_0x257a0a)[_0x04c6('0x17')](function(_0xfb4db5){_0x4384ad({'code':0xc8,'message':_0xfb4db5[_0x04c6('0x18')]});})[_0x04c6('0x19')](function(_0x47f400){_0x56422a(_0x453342[_0x04c6('0xd')](0x1f5,_0x47f400[_0x04c6('0x18')]));});});},'Command':function(_0xa70fd2){var _0x558b43=this;return new Promise(function(_0x4cef4e,_0x53ac86){if(ami[_0x04c6('0xc')]()==![]){return _0x53ac86(_0x558b43[_0x04c6('0xd')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x04c6('0xf')],_0x04c6('0x10')][_0x04c6('0x11')]('\x20')));}_0xa70fd2=_['pick'](_0xa70fd2,_0x04c6('0x1a'));_0xa70fd2[_0x04c6('0x14')]=_0x04c6('0x1b');return ami['Action'](_0xa70fd2)[_0x04c6('0x17')](function(_0x41e29f){_0x4cef4e({'code':0xc8,'message':_0x41e29f['content']});})['catch'](function(_0x4c8d72){_0x53ac86(_0x558b43[_0x04c6('0xd')](0x1f5,_0x4c8d72[_0x04c6('0x18')]));});});},'VoiceQueues':function(_0xd5828d){return new Promise(function(_0x115e35,_0x3e1328){var _0x52e5f5=[];for(var _0x562952 in _0x3a9493[_0x04c6('0x1c')]){if(_0x3a9493[_0x04c6('0x1c')][_0x04c6('0x1d')](_0x562952)){var _0x3233d7=_0x3a9493[_0x04c6('0x1c')][_0x562952];var _0x1f5aaf={'id':_0x3233d7['id'],'name':_0x3233d7['name'],'strategy':_0x3233d7[_0x04c6('0x1e')],'answered':_0x3233d7[_0x04c6('0x1f')],'available':_0x3233d7['available'],'loggedIn':_0x3233d7[_0x04c6('0x20')],'pTalking':_0x3233d7[_0x04c6('0x21')],'sumBillable':_0x3233d7['sumBillable'],'sumDuration':_0x3233d7['sumDuration'],'sumHoldTime':_0x3233d7[_0x04c6('0x22')]||0x0,'talking':_0x3233d7[_0x04c6('0x23')],'total':_0x3233d7[_0x04c6('0x24')],'type':_0x3233d7[_0x04c6('0x25')],'unmanaged':_0x3233d7[_0x04c6('0x26')],'abandoned':_0x3233d7[_0x04c6('0x27')],'waiting':_0x3233d7['waiting'],'loggedInDb':_0x3233d7['loggedInDb']};if(_0x3233d7['type']===_0x04c6('0x28')){_0x1f5aaf['dialActive']=_0x3233d7[_0x04c6('0x29')];_0x1f5aaf[_0x04c6('0x2a')]=_0x3233d7['dialMethod'];_0x1f5aaf[_0x04c6('0x2b')]=_0x3233d7[_0x04c6('0x2b')];_0x1f5aaf[_0x04c6('0x2c')]=_0x3233d7[_0x04c6('0x2c')];_0x1f5aaf['dialOriginateTimeout']=_0x3233d7[_0x04c6('0x2d')];_0x1f5aaf[_0x04c6('0x2e')]=_0x3233d7[_0x04c6('0x2e')];_0x1f5aaf[_0x04c6('0x2f')]=_0x3233d7[_0x04c6('0x2f')];_0x1f5aaf[_0x04c6('0x30')]=_0x3233d7[_0x04c6('0x30')];_0x1f5aaf[_0x04c6('0x31')]=_0x3233d7[_0x04c6('0x31')];_0x1f5aaf[_0x04c6('0x32')]=_0x3233d7[_0x04c6('0x32')];_0x1f5aaf[_0x04c6('0x33')]=_0x3233d7[_0x04c6('0x33')];_0x1f5aaf[_0x04c6('0x34')]=_0x3233d7[_0x04c6('0x34')];_0x1f5aaf['outboundDropCallsDayACS']=_0x3233d7[_0x04c6('0x35')];_0x1f5aaf[_0x04c6('0x36')]=_0x3233d7[_0x04c6('0x36')];_0x1f5aaf[_0x04c6('0x37')]=_0x3233d7['outboundDropCallsDayTimeout'];_0x1f5aaf[_0x04c6('0x38')]=_0x3233d7[_0x04c6('0x38')];_0x1f5aaf['outboundNoSuchCallsDay']=_0x3233d7['outboundNoSuchCallsDay'];_0x1f5aaf['outboundOriginateFailureCallsDay']=_0x3233d7[_0x04c6('0x39')];_0x1f5aaf[_0x04c6('0x3a')]=_0x3233d7['outboundReCallsDay'];_0x1f5aaf[_0x04c6('0x3b')]=_0x3233d7['outboundRejectCallsDay'];_0x1f5aaf[_0x04c6('0x3c')]=_0x3233d7[_0x04c6('0x3c')];_0x1f5aaf[_0x04c6('0x3d')]=_0x3233d7[_0x04c6('0x3d')];_0x1f5aaf['predictiveIntervalAvgHoldtime']=_0x3233d7['predictiveIntervalAvgHoldtime'];_0x1f5aaf[_0x04c6('0x3e')]=_0x3233d7[_0x04c6('0x3e')];_0x1f5aaf['predictiveIntervalDroppedCallsCallersExit']=_0x3233d7[_0x04c6('0x3f')];_0x1f5aaf['predictiveIntervalDroppedCallsTimeout']=_0x3233d7['predictiveIntervalDroppedCallsTimeout'];_0x1f5aaf[_0x04c6('0x40')]=_0x3233d7['predictiveIntervalErlangCalls'];_0x1f5aaf[_0x04c6('0x41')]=_0x3233d7[_0x04c6('0x41')];_0x1f5aaf['predictiveIntervalHitRate']=_0x3233d7[_0x04c6('0x42')];_0x1f5aaf['predictiveIntervalMultiplicativeFactor']=_0x3233d7[_0x04c6('0x43')];_0x1f5aaf[_0x04c6('0x44')]=_0x3233d7[_0x04c6('0x44')];_0x1f5aaf[_0x04c6('0x45')]=_0x3233d7[_0x04c6('0x45')];_0x1f5aaf['predictiveIntervalTotalCalls']=_0x3233d7[_0x04c6('0x46')];_0x1f5aaf['message']=_0x3233d7[_0x04c6('0x18')];_0x1f5aaf['originated']=_0x3233d7[_0x04c6('0x47')];_0x1f5aaf[_0x04c6('0x48')]=_0x3233d7[_0x04c6('0x48')];_0x1f5aaf[_0x04c6('0x49')]=_0x3233d7[_0x04c6('0x49')];_0x1f5aaf[_0x04c6('0x4a')]=_0x3233d7[_0x04c6('0x4a')];_0x1f5aaf['erlangBusyFactor']=_0x3233d7[_0x04c6('0x4b')];_0x1f5aaf['startPredictive']=_0x3233d7[_0x04c6('0x4c')];_0x1f5aaf['startProgressive']=_0x3233d7['startProgressive'];}if(_0x3233d7[_0x04c6('0x4d')]){_0x1f5aaf['Trunk']={'id':_0x3233d7[_0x04c6('0x4d')]['id'],'name':_0x3233d7[_0x04c6('0x4d')][_0x04c6('0x4e')],'active':_0x3233d7['Trunk'][_0x04c6('0x4f')],'callerid':_0x3233d7[_0x04c6('0x4d')][_0x04c6('0x50')]};}if(_0x3233d7[_0x04c6('0x51')]){_0x1f5aaf[_0x04c6('0x51')]={'id':_0x3233d7[_0x04c6('0x51')]['id'],'name':_0x3233d7[_0x04c6('0x51')]['name']};}_0x52e5f5['push'](_0x1f5aaf);}}_0x115e35({'count':_0x52e5f5[_0x04c6('0x52')],'rows':_0x52e5f5});});},'UpdateVoiceQueue':function(_0x18aa99){return new Promise(function(_0x417cb7,_0x5d6726){var _0x46164a=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x1c')],{'id':parseInt(_0x18aa99['id'])});var _0x549911=_['omit'](_0x18aa99,['id']);if(_0x46164a){for(var _0x56c7e6 in _0x549911){if(typeof _0x549911[_0x56c7e6]!==_0x04c6('0x54')&&typeof _0x46164a[_0x56c7e6]!==_0x04c6('0x54')){_0x46164a[_0x56c7e6]=_0x549911[_0x56c7e6];}}_0x417cb7(_0x46164a);}else{_0x5d6726();}});},'VoiceChannels':function(_0x5f578b){return new Promise(function(_0x261512,_0x3de8a9){var _0x2bd045=_['values'](_0x3a9493[_0x04c6('0x55')]);_0x261512({'count':_0x2bd045[_0x04c6('0x52')],'rows':_0x2bd045});});},'VoiceChannelMixMonitor':function(_0x5e68e0){var _0x25a6fc=this;return new Promise(function(_0x203943,_0x2472ed){if(ami[_0x04c6('0xc')]()==![]){return _0x2472ed(_0x25a6fc['error'](0x1f4,[config[_0x04c6('0xe')]['ip'],config[_0x04c6('0xe')][_0x04c6('0xf')],_0x04c6('0x10')]['join']('\x20')));}var _0x192437=schema(properties[_0x04c6('0x56')])[_0x04c6('0x3')](_0x5e68e0);if(_0x192437[_0x04c6('0x52')]>0x0){return _0x2472ed(_0x25a6fc['error'](0x1f4,_[_0x04c6('0x57')](_0x192437,_0x04c6('0x18'))[_0x04c6('0x11')](',\x20')));}var _0x489361=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x55')],{'uniqueid':_0x5e68e0[_0x04c6('0x58')]});if(_0x489361&&_0x489361[_0x04c6('0x59')]){var _0x6ae67=util[_0x04c6('0x5')](_0x04c6('0x5a'),_0x5e68e0[_0x04c6('0x5b')]||_0x5e68e0[_0x04c6('0x58')],_0x5e68e0[_0x04c6('0x5')]||_0x04c6('0x5c'));return ami[_0x04c6('0x16')]({'action':_0x04c6('0x5d'),'channel':_0x489361['channel'],'file':_0x6ae67,'options':_0x04c6('0x5e')})[_0x04c6('0x17')](function(_0x5ce521){var _0xa0284e=_[_0x04c6('0x53')](_0x489361['monitors'],{'filename':_0x04c6('0x5f')+_0x6ae67[_0x04c6('0x60')]()});if(_[_0x04c6('0x61')](_0xa0284e)){_0x489361[_0x04c6('0x62')][_0x04c6('0x63')]({'filename':_0x04c6('0x5f')+_0x6ae67[_0x04c6('0x60')](),'createdAt':moment()[_0x04c6('0x5')](_0x04c6('0x64')),'mixmonitorid':_0x5ce521[_0x04c6('0x65')],'status':'rec'});}else{_0xa0284e['mixmonitorid']=_0x5ce521['mixmonitorid'];_0xa0284e['status']=_0x04c6('0x66');}_0x203943({'code':0xc8,'message':[_0x5e68e0['uniqueid'],_0x04c6('0x67'),_0x5ce521['mixmonitorid']][_0x04c6('0x11')]('\x20'),'mixmonitorid':_0x5ce521[_0x04c6('0x65')]});})['catch'](function(_0x4dd6bb){_0x2472ed(_0x25a6fc[_0x04c6('0xd')](0x1f5,[_0x5e68e0[_0x04c6('0x58')],_0x4dd6bb[_0x04c6('0x18')][_0x04c6('0x60')]()]['join']('\x20')));});}else{return _0x2472ed(_0x25a6fc[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x216cb0){var _0x18b51d=this;return new Promise(function(_0x24c5be,_0x29c72f){if(ami[_0x04c6('0xc')]()==![]){return _0x29c72f(_0x18b51d['error'](0x1f4,[config[_0x04c6('0xe')]['ip'],config['asterisk'][_0x04c6('0xf')],_0x04c6('0x10')]['join']('\x20')));}var _0x3477b7=schema(properties[_0x04c6('0x56')])[_0x04c6('0x3')](_0x216cb0);if(_0x3477b7[_0x04c6('0x52')]>0x0){return _0x29c72f(_0x18b51d[_0x04c6('0xd')](0x1f4,_[_0x04c6('0x57')](_0x3477b7,_0x04c6('0x18'))[_0x04c6('0x11')](',\x20')));}var _0x5c51dc=_[_0x04c6('0x53')](_0x3a9493['channels'],{'uniqueid':_0x216cb0[_0x04c6('0x58')]});if(_0x5c51dc){return BPromise[_0x04c6('0x69')]()['then'](function(){if(_0x5c51dc['channel']){return ami[_0x04c6('0x16')]({'action':'StopMixMonitor','channel':_0x5c51dc[_0x04c6('0x59')],'mixmonitorid':_0x216cb0[_0x04c6('0x65')]})['catch'](function(_0x306ad9){});}})[_0x04c6('0x17')](function(){if(_0x5c51dc[_0x04c6('0x6a')]){return ami[_0x04c6('0x16')]({'action':_0x04c6('0x6b'),'channel':_0x5c51dc[_0x04c6('0x6a')],'mixmonitorid':_0x216cb0[_0x04c6('0x65')]})[_0x04c6('0x19')](function(_0x243bc4){});}})[_0x04c6('0x17')](function(_0x2c9c36){var _0x52413f=_[_0x04c6('0x53')](_0x5c51dc[_0x04c6('0x62')],{'mixmonitorid':_0x216cb0[_0x04c6('0x65')]});if(_0x52413f){_0x52413f[_0x04c6('0x6c')]='stop';}})[_0x04c6('0x17')](function(){var _0x356a9d=util[_0x04c6('0x5')]('%s.%s',_0x216cb0['filename']||_0x216cb0[_0x04c6('0x58')],_0x216cb0[_0x04c6('0x5')]||_0x04c6('0x5c'));var _0x396f79=_[_0x04c6('0x53')](_0x5c51dc[_0x04c6('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x356a9d[_0x04c6('0x60')]()});if(_0x396f79){_0x396f79[_0x04c6('0x6c')]=_0x04c6('0x6d');}})['then'](function(){_0x24c5be({'code':0xc8,'message':[_0x216cb0['uniqueid'],_0x04c6('0x6e')][_0x04c6('0x11')]('\x20')});})[_0x04c6('0x19')](function(_0xc20f3c){_0x29c72f(_0x18b51d['error'](0x1f5,[_0x216cb0[_0x04c6('0x58')],_0xc20f3c['message']['toLowerCase']()][_0x04c6('0x11')]('\x20')));});}else{return _0x29c72f(_0x18b51d[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'VoiceQueuesChannels':function(_0x1904d4){return new Promise(function(_0x43260e,_0x281c2b){var _0x369ce6=_['values'](_0x3a9493[_0x04c6('0x6f')]);_0x43260e({'count':_0x369ce6[_0x04c6('0x52')],'rows':_0x369ce6});});},'VoiceQueuesChannel':function(_0x1f5b9a){var _0x329c82=this;return new Promise(function(_0x1c2e79,_0x4c9d95){var _0x5ade3d=schema(properties[_0x04c6('0x70')])[_0x04c6('0x3')](_0x1f5b9a);if(_0x5ade3d[_0x04c6('0x52')]>0x0){return _0x4c9d95(_0x329c82['error'](0x1f4,_[_0x04c6('0x57')](_0x5ade3d,_0x04c6('0x18'))['join'](',\x20')));}var _0x12d92e=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x6f')],{'uniqueid':_0x1f5b9a[_0x04c6('0x58')]});if(_0x12d92e){_0x1c2e79(_0x12d92e);}else{return _0x4c9d95(_0x329c82[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x3a673b){var _0x1a2365=this;return new Promise(function(_0x22ae65,_0x3552cd){if(ami[_0x04c6('0xc')]()==![]){return _0x3552cd(_0x1a2365[_0x04c6('0xd')](0x1f4,[config[_0x04c6('0xe')]['ip'],config['asterisk'][_0x04c6('0xf')],_0x04c6('0x10')]['join']('\x20')));}var _0xf1e91d=schema(properties[_0x04c6('0x71')])[_0x04c6('0x3')](_0x3a673b);if(_0xf1e91d[_0x04c6('0x52')]>0x0){return _0x3552cd(_0x1a2365[_0x04c6('0xd')](0x1f4,_['map'](_0xf1e91d,_0x04c6('0x18'))['join'](',\x20')));}var _0x299dd3=_['find'](_0x3a9493[_0x04c6('0x6f')],{'uniqueid':_0x3a673b[_0x04c6('0x58')]});if(_0x299dd3&&_0x299dd3[_0x04c6('0x59')]){return ami[_0x04c6('0x16')]({'action':_0x04c6('0x72'),'channel':_0x299dd3[_0x04c6('0x59')]})[_0x04c6('0x17')](function(_0x242bff){_0x22ae65({'code':0xc8,'message':[_0x3a673b[_0x04c6('0x58')],_0x242bff['message'][_0x04c6('0x60')]()][_0x04c6('0x11')]('\x20')});})['catch'](function(_0x9825cf){_0x3552cd(_0x1a2365['error'](0x1f5,[_0x3a673b[_0x04c6('0x58')],_0x9825cf[_0x04c6('0x18')]['toLowerCase']()][_0x04c6('0x11')]('\x20')));});}else{return _0x3552cd(_0x1a2365[_0x04c6('0xd')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x16f932){var _0x140f93=this;return new Promise(function(_0x4fbb5d,_0x7b9132){if(ami[_0x04c6('0xc')]()==![]){return _0x7b9132(_0x140f93['error'](0x1f4,[config[_0x04c6('0xe')]['ip'],config[_0x04c6('0xe')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x37d3e0=schema(properties[_0x04c6('0x73')])[_0x04c6('0x3')](_0x16f932);if(_0x37d3e0[_0x04c6('0x52')]>0x0){return _0x7b9132(_0x140f93[_0x04c6('0xd')](0x1f4,_['map'](_0x37d3e0,_0x04c6('0x18'))[_0x04c6('0x11')](',\x20')));}var _0x1a5356=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x6f')],{'uniqueid':_0x16f932[_0x04c6('0x58')]});if(_0x1a5356&&_0x1a5356[_0x04c6('0x59')]){return ami['Action']({'action':_0x04c6('0x74'),'channel':_0x1a5356['channel'],'exten':_0x16f932[_0x04c6('0x75')],'context':_0x16f932['context']||_0x1a5356['context'],'priority':0x1})[_0x04c6('0x17')](function(_0x58f619){_0x4fbb5d({'code':0xc8,'message':[_0x16f932[_0x04c6('0x58')],_0x58f619[_0x04c6('0x18')][_0x04c6('0x60')]()][_0x04c6('0x11')]('\x20')});})[_0x04c6('0x19')](function(_0x48fbdd){_0x7b9132(_0x140f93['error'](0x1f5,[_0x16f932[_0x04c6('0x58')],_0x48fbdd[_0x04c6('0x18')][_0x04c6('0x60')]()][_0x04c6('0x11')]('\x20')));});}else{return _0x7b9132(_0x140f93[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'Agents':function(_0x541f14){return new Promise(function(_0x1a9a95,_0x4c3f9e){var _0x5e403d=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x9')]);_0x1a9a95({'count':_0x5e403d[_0x04c6('0x52')],'rows':_0x5e403d});});},'Telephones':function(_0x787dab){return new Promise(function(_0x449286,_0x42459d){var _0x2e65f0=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x77')]);_0x449286({'count':_0x2e65f0[_0x04c6('0x52')],'rows':_0x2e65f0});});},'Trunks':function(_0x21dc7c){return new Promise(function(_0x5763c1,_0xc6e3a6){var _0x5608ce=_['values'](_0x3a9493[_0x04c6('0x78')]);_0x5763c1({'count':_0x5608ce[_0x04c6('0x52')],'rows':_0x5608ce});});},'OutboundChannels':function(_0x3c9c5a){return new Promise(function(_0x294700,_0xcb0dc2){var _0x215eb3=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x79')]);_0x294700({'count':_0x215eb3[_0x04c6('0x52')],'rows':_0x215eb3});});},'Outbound':function(_0x431732){return new Promise(function(_0xcd4078,_0x5c82f1){_0xcd4078(_0x3a9493['outbound']);});},'Campaigns':function(_0x2c15d1){return new Promise(function(_0x1149f5,_0x52dfe5){var _0xb0b3aa=_[_0x04c6('0x76')](_0x3a9493['campaigns']);_0x1149f5({'count':_0xb0b3aa[_0x04c6('0x52')],'rows':_0xb0b3aa});});},'VoiceQueuesPreview':function(_0xdd49da){var _0x390a49=this;return new Promise(function(_0x102dc7,_0x3a3fb2){_0xc6e772[_0x04c6('0x7a')](_0xdd49da['id'])[_0x04c6('0x17')](function(_0x5efcc8){_0x102dc7({'code':0xc8,'message':_0x5efcc8['message']});})[_0x04c6('0x19')](function(_0x592d6a){_0x3a3fb2(_0x390a49[_0x04c6('0xd')](0x1f4,_0x592d6a[_0x04c6('0x18')]));});});},'EventManager':function(_0x23b79a){var _0x15f484=this;return new Promise(function(_0x5d5795,_0x2864a0){if(!_0x23b79a['event']){return _0x2864a0(_0x15f484[_0x04c6('0xd')](0x1f4,_0x04c6('0x7b')));}ami[_0x04c6('0x7c')]('custom:'+_0x23b79a['event'],_0x23b79a['message']);_0x5d5795({'code':0xc8,'message':_0x23b79a});});},'FaxAccounts':function(_0xcb5660){return new Promise(function(_0x181268,_0x47f933){var _0xd17fa3=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x7d')]);_0x181268({'count':_0xd17fa3['length'],'rows':_0xd17fa3});});},'SendFax':function(_0x343c1f){var _0x485457=this;return new Promise(function(_0x1c0c74,_0x3a1b76){_0x2054da[_0x04c6('0x7e')](_0x343c1f)['then'](function(_0x534d1f){_0x1c0c74({'code':0xc8,'message':_0x534d1f[_0x04c6('0x18')]});})[_0x04c6('0x19')](function(_0x2e92d5){_0x3a1b76(_0x485457[_0x04c6('0xd')](0x1f4,_0x2e92d5['message']));});});},'CheckAfterSend':function(_0x58c790){var _0x3e12a4=this;return new Promise(function(_0x8637e0,_0x91f883){_0x2054da['checkAfterSend'](_0x58c790)[_0x04c6('0x17')](function(_0xe08ff4){_0x8637e0({'code':0xc8,'message':_0xe08ff4[_0x04c6('0x18')]});})[_0x04c6('0x19')](function(_0x49f1e0){_0x91f883(_0x3e12a4[_0x04c6('0xd')](0x1f4,_0x49f1e0[_0x04c6('0x18')]));});});}};var _0x369aba=jayson[_0x04c6('0x7f')](_0x39be2d)[_0x04c6('0x80')]();_0x369aba['on']('error',function(_0x14ce9e){return _0x2b9041(_0x14ce9e);});_0x369aba[_0x04c6('0x81')](0x232a,_0x04c6('0x82'),function(){console[_0x04c6('0x83')](_0x04c6('0x84'),0x232a);return _0x12bd5d(_0x04c6('0x85')+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 7cdfc84..175392a 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 _0x370e=['localhost','socket.io-emitter','info','stringify','emit','exec','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','firstName','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','','format','user:%s','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults'];(function(_0x3237e4,_0x444071){var _0x299fe8=function(_0x8f9299){while(--_0x8f9299){_0x3237e4['push'](_0x3237e4['shift']());}};_0x299fe8(++_0x444071);}(_0x370e,0xab));var _0xe370=function(_0x366deb,_0x146e5b){_0x366deb=_0x366deb-0x0;var _0xb6f815=_0x370e[_0x366deb];return _0xb6f815;};'use strict';var _=require(_0xe370('0x0'));var BPromise=require(_0xe370('0x1'));var Redis=require(_0xe370('0x2'));var util=require(_0xe370('0x3'));var config=require(_0xe370('0x4'));var logger=require(_0xe370('0x5'))('trigger');var cmContactRpc=require(_0xe370('0x6'));config[_0xe370('0x7')]=_[_0xe370('0x8')](config[_0xe370('0x7')],{'host':_0xe370('0x9'),'port':0x18eb});var io=require(_0xe370('0xa'))(new Redis(config[_0xe370('0x7')]));function emit(_0x14b435,_0x3894e0,_0x4d3e7e,_0x183ee7,_0x294daf){logger[_0xe370('0xb')]('[CM][%s][%s]',_0x14b435,_0x3894e0['id'],_0x4d3e7e,_0x183ee7,JSON[_0xe370('0xc')](_0x294daf));io['to'](_0x4d3e7e)[_0xe370('0xd')](_0x183ee7,_0x294daf);}exports[_0xe370('0xe')]=function(_0x3a0a7d,_0x111e2d,_0xcf14c6,_0x39c6ab){var _0xe68569,_0x38aad9;var _0x57b0a3={};var _0x2e2a4a;var _0x1d1d93=Number(_0xcf14c6['data1']);var _0x11290e=_0xcf14c6[_0xe370('0xf')]?Boolean(Number(_0xcf14c6[_0xe370('0xf')])):![];var _0x35f9fb;var _0x52e68e=![];if(!_['isNil'](_0xcf14c6['data5'])){if(_0xcf14c6['data5']=='1')_0x52e68e=!![];}if(!_0x52e68e){if(_0x39c6ab[_0xe370('0x10')]){_0x57b0a3['id']=_0x39c6ab[_0xe370('0x10')];}}if(!_0x57b0a3['id']){_0x57b0a3[_0xe370('0x11')]=_0x1d1d93;_0x35f9fb=_0xcf14c6[_0xe370('0x12')]&&_0xcf14c6[_0xe370('0x12')]!=='0'?_0xcf14c6[_0xe370('0x12')][_0xe370('0x13')](','):[_0xe370('0x14')];_0x57b0a3[_0xe370('0x15')]=_[_0xe370('0x16')](_0x35f9fb,function(_0x301088){var _0x33a54d={};_0x33a54d[_0x301088]=_0x39c6ab[_0xe370('0x17')]?_0x39c6ab[_0xe370('0x18')]:_0x39c6ab[_0xe370('0x19')];return _0x33a54d;});_0x2e2a4a=_0x39c6ab[_0xe370('0x17')]?_0x39c6ab[_0xe370('0x18')]:_0x39c6ab[_0xe370('0x19')];}var _0x531e9f=['id','firstName',_0xe370('0x1a'),_0xe370('0x14'),_0xe370('0x1b'),_0xe370('0x1c'),_0xe370('0x11'),_0xe370('0x1d'),_0xe370('0x1e'),_0xe370('0x1f')];var _0x2b3421=_[_0xe370('0x20')](_0x531e9f,_0x35f9fb);BPromise[_0xe370('0x21')]()[_0xe370('0x22')](cmContactRpc[_0xe370('0x23')]({'attributes':_0x2b3421,'where':_0x57b0a3,'phone':_0x2e2a4a}))[_0xe370('0x22')](function(_0x577a93){_0x38aad9=_0x577a93;if(!_[_0xe370('0x24')](_0x38aad9)){if(_0x38aad9['length']===0x1){_0xe68569=_0x38aad9[0x0];logger['info'](_0xe370('0x25'),_0x39c6ab[_0xe370('0x26')],_0x111e2d['id'],_0xe68569['id']);}else{logger['info'](_0xe370('0x27'),_0x39c6ab[_0xe370('0x26')],_0x111e2d['id'],_[_0xe370('0x16')](_0x38aad9,'id')[_0xe370('0x28')](','));}return;}else{logger['info'](_0xe370('0x29'),_0x39c6ab[_0xe370('0x26')],_0x111e2d['id']);var _0x11e237={'ListId':_0x1d1d93};var _0x56c708=_0xcf14c6[_0xe370('0x2a')]&&_0xcf14c6[_0xe370('0x2a')]!=='0'?_0xcf14c6[_0xe370('0x2a')]:_0xe370('0x14');if(_0x11290e){logger[_0xe370('0xb')](_0xe370('0x2b'),_0x39c6ab['uniqueid'],_0x111e2d['id']);_0x11e237[_0x56c708]=_[_0xe370('0x2c')](_0x39c6ab[_0xe370('0x17')])?_0x39c6ab[_0xe370('0x19')]:_0x39c6ab[_0xe370('0x18')];if(_[_0xe370('0x2c')](_0x39c6ab[_0xe370('0x17')])){_0x11e237['firstName']=_0x39c6ab[_0xe370('0x2d')]&&_0x39c6ab[_0xe370('0x2d')]!==''?_0x39c6ab[_0xe370('0x2d')]:'Unknown';}else{_0x11e237[_0xe370('0x2e')]=_0x39c6ab[_0xe370('0x2f')]&&_0x39c6ab[_0xe370('0x2f')]!==''?_0x39c6ab[_0xe370('0x2f')]:_0xe370('0x30');}return BPromise[_0xe370('0x21')]()[_0xe370('0x22')](cmContactRpc[_0xe370('0x31')](_0x11e237))[_0xe370('0x22')](function(_0x36f14a){_0xe68569=_0x36f14a;_0x38aad9[_0xe370('0x32')](_0x36f14a);if(_0xe68569){logger[_0xe370('0xb')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x39c6ab['uniqueid'],_0x111e2d['id'],_0xe68569['id']);}return;});}else{logger[_0xe370('0xb')](_0xe370('0x33'),_0x39c6ab[_0xe370('0x26')],_0x111e2d['id']);_0x11e237[_0x56c708]=_[_0xe370('0x2c')](_0x39c6ab[_0xe370('0x17')])?_0x39c6ab[_0xe370('0x19')]:_0x39c6ab[_0xe370('0x18')];if(_[_0xe370('0x2c')](_0x39c6ab[_0xe370('0x17')])){_0x11e237['firstName']=_0x39c6ab[_0xe370('0x2d')]&&_0x39c6ab[_0xe370('0x2d')]!==_0xe370('0x34')?_0x39c6ab[_0xe370('0x2d')]:_0xe370('0x30');}else{_0x11e237[_0xe370('0x2e')]=_0x39c6ab['destcalleridname']&&_0x39c6ab[_0xe370('0x2f')]!==_0xe370('0x34')?_0x39c6ab[_0xe370('0x2f')]:_0xe370('0x30');}_0xe68569=_0x11e237;_0x38aad9['push'](_0x11e237);return;}}})[_0xe370('0x22')](function(){if(_0x3a0a7d){emit(_0x39c6ab['uniqueid'],_0x111e2d,util[_0xe370('0x35')](_0xe370('0x36'),_0x3a0a7d['name']),util[_0xe370('0x35')](_0xe370('0x37'),_0xcf14c6[_0xe370('0x38')][_0xe370('0x39')]()),{'evt':_[_0xe370('0x3a')](_0x39c6ab,{'autoCreate':_0x11290e}),'contact':_0xe68569===undefined?{}:_0xe68569,'contacts':_0x38aad9[_0xe370('0x3b')]===0x0?undefined:_0x38aad9});}});}; \ No newline at end of file +var _0x3ca4=['mobile','fax','scheduledAt','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','map','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','toLowerCase','merge','bluebird','ioredis','util','trigger','redis','localhost','socket.io-emitter','info','emit','data2','isNil','data5','ListId','data3','phone','$or','routeId','destcalleridnum','calleridnum','lastName'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x3ca4,0x73));var _0x43ca=function(_0x123895,_0x3e5a68){_0x123895=_0x123895-0x0;var _0x1b8a20=_0x3ca4[_0x123895];return _0x1b8a20;};'use strict';var _=require('lodash');var BPromise=require(_0x43ca('0x0'));var Redis=require(_0x43ca('0x1'));var util=require(_0x43ca('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x43ca('0x3'));var cmContactRpc=require('../../rpc/cmContact');config['redis']=_['defaults'](config[_0x43ca('0x4')],{'host':_0x43ca('0x5'),'port':0x18eb});var io=require(_0x43ca('0x6'))(new Redis(config[_0x43ca('0x4')]));function emit(_0x27ef6d,_0xe0fa14,_0x7c6806,_0x129af5,_0x30713f){logger[_0x43ca('0x7')]('[CM][%s][%s]',_0x27ef6d,_0xe0fa14['id'],_0x7c6806,_0x129af5,JSON['stringify'](_0x30713f));io['to'](_0x7c6806)[_0x43ca('0x8')](_0x129af5,_0x30713f);}exports['exec']=function(_0x55969d,_0x2ccc79,_0x58cac2,_0x778401){var _0x71f500,_0x228656;var _0x54136f={};var _0x52fd36;var _0x5d3294=Number(_0x58cac2['data1']);var _0x19acba=_0x58cac2[_0x43ca('0x9')]?Boolean(Number(_0x58cac2[_0x43ca('0x9')])):![];var _0x21e928;var _0x16ad81=![];if(!_[_0x43ca('0xa')](_0x58cac2[_0x43ca('0xb')])){if(_0x58cac2['data5']=='1')_0x16ad81=!![];}if(!_0x16ad81){if(_0x778401['xmd-contactid']){_0x54136f['id']=_0x778401['xmd-contactid'];}}if(!_0x54136f['id']){_0x54136f[_0x43ca('0xc')]=_0x5d3294;_0x21e928=_0x58cac2['data3']&&_0x58cac2['data3']!=='0'?_0x58cac2[_0x43ca('0xd')]['split'](','):[_0x43ca('0xe')];_0x54136f[_0x43ca('0xf')]=_['map'](_0x21e928,function(_0x171a56){var _0x2a7b66={};_0x2a7b66[_0x171a56]=_0x778401[_0x43ca('0x10')]?_0x778401[_0x43ca('0x11')]:_0x778401[_0x43ca('0x12')];return _0x2a7b66;});_0x52fd36=_0x778401[_0x43ca('0x10')]?_0x778401[_0x43ca('0x11')]:_0x778401[_0x43ca('0x12')];}var _0x10500e=['id','firstName',_0x43ca('0x13'),_0x43ca('0xe'),_0x43ca('0x14'),_0x43ca('0x15'),'ListId','createdAt',_0x43ca('0x16'),'updatedAt'];var _0x1e3bd0=_['union'](_0x10500e,_0x21e928);BPromise[_0x43ca('0x17')]()[_0x43ca('0x18')](cmContactRpc[_0x43ca('0x19')]({'attributes':_0x1e3bd0,'where':_0x54136f,'phone':_0x52fd36}))['then'](function(_0x24ad5e){_0x228656=_0x24ad5e;if(!_['isEmpty'](_0x228656)){if(_0x228656[_0x43ca('0x1a')]===0x1){_0x71f500=_0x228656[0x0];logger[_0x43ca('0x7')](_0x43ca('0x1b'),_0x778401['uniqueid'],_0x2ccc79['id'],_0x71f500['id']);}else{logger[_0x43ca('0x7')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x778401['uniqueid'],_0x2ccc79['id'],_[_0x43ca('0x1c')](_0x228656,'id')['join'](','));}return;}else{logger[_0x43ca('0x7')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x778401[_0x43ca('0x1d')],_0x2ccc79['id']);var _0x542f93={'ListId':_0x5d3294};var _0x177b49=_0x58cac2[_0x43ca('0x1e')]&&_0x58cac2['data4']!=='0'?_0x58cac2[_0x43ca('0x1e')]:_0x43ca('0xe');if(_0x19acba){logger[_0x43ca('0x7')](_0x43ca('0x1f'),_0x778401[_0x43ca('0x1d')],_0x2ccc79['id']);_0x542f93[_0x177b49]=_[_0x43ca('0xa')](_0x778401[_0x43ca('0x10')])?_0x778401[_0x43ca('0x12')]:_0x778401[_0x43ca('0x11')];if(_['isNil'](_0x778401['routeId'])){_0x542f93[_0x43ca('0x20')]=_0x778401[_0x43ca('0x21')]&&_0x778401[_0x43ca('0x21')]!==_0x43ca('0x22')?_0x778401[_0x43ca('0x21')]:_0x43ca('0x23');}else{_0x542f93[_0x43ca('0x20')]=_0x778401[_0x43ca('0x24')]&&_0x778401[_0x43ca('0x24')]!==''?_0x778401['destcalleridname']:_0x43ca('0x23');}return BPromise['resolve']()[_0x43ca('0x18')](cmContactRpc['createContact'](_0x542f93))[_0x43ca('0x18')](function(_0xa8e1e){_0x71f500=_0xa8e1e;_0x228656[_0x43ca('0x25')](_0xa8e1e);if(_0x71f500){logger['info'](_0x43ca('0x26'),_0x778401[_0x43ca('0x1d')],_0x2ccc79['id'],_0x71f500['id']);}return;});}else{logger['info'](_0x43ca('0x27'),_0x778401[_0x43ca('0x1d')],_0x2ccc79['id']);_0x542f93[_0x177b49]=_[_0x43ca('0xa')](_0x778401[_0x43ca('0x10')])?_0x778401['calleridnum']:_0x778401['destcalleridnum'];if(_[_0x43ca('0xa')](_0x778401[_0x43ca('0x10')])){_0x542f93[_0x43ca('0x20')]=_0x778401[_0x43ca('0x21')]&&_0x778401['calleridname']!==_0x43ca('0x22')?_0x778401[_0x43ca('0x21')]:_0x43ca('0x23');}else{_0x542f93[_0x43ca('0x20')]=_0x778401['destcalleridname']&&_0x778401[_0x43ca('0x24')]!==''?_0x778401[_0x43ca('0x24')]:_0x43ca('0x23');}_0x71f500=_0x542f93;_0x228656[_0x43ca('0x25')](_0x542f93);return;}}})[_0x43ca('0x18')](function(){if(_0x55969d){emit(_0x778401[_0x43ca('0x1d')],_0x2ccc79,util[_0x43ca('0x28')](_0x43ca('0x29'),_0x55969d['name']),util[_0x43ca('0x28')](_0x43ca('0x2a'),_0x58cac2['action'][_0x43ca('0x2b')]()),{'evt':_[_0x43ca('0x2c')](_0x778401,{'autoCreate':_0x19acba}),'contact':_0x71f500===undefined?{}:_0x71f500,'contacts':_0x228656[_0x43ca('0x1a')]===0x0?undefined:_0x228656});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index b9fc2ed..de08580 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 _0x9f89=['emit','motionChannel','checkTriggers','hasOwnProperty','status','checkTrigger','variables','Actions','interface','toLowerCase','contactmanager','motionbar','data1','TemplateId','data2','html','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','600','data6','render','winArguments','format','user:%s','name','action','merge','jscripty','trigger:%s','exec','integration','queue','routeId','parse','query','search','replace','channel','AllConditions','length','checkConditions','AnyConditions','some','field','account','chat','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','undefined','substatus','offlineMessage','exports','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x9f89,0x13d));var _0x99f8=function(_0x184911,_0x2345d5){_0x184911=_0x184911-0x0;var _0x2f1673=_0x9f89[_0x184911];return _0x2f1673;};'use strict';var util=require('util');var _=require(_0x99f8('0x0'));var url=require('url');var Mustache=require(_0x99f8('0x1'));var Redis=require(_0x99f8('0x2'));var urlforward=require(_0x99f8('0x3'));var integration=require(_0x99f8('0x4'));var cmContact=require(_0x99f8('0x5'));var script=require('./script');var config=require(_0x99f8('0x6'));var logger=require(_0x99f8('0x7'))(_0x99f8('0x8'));var ami=require(_0x99f8('0x9'));config[_0x99f8('0xa')]=_[_0x99f8('0xb')](config[_0x99f8('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x99f8('0xc'))(new Redis(config[_0x99f8('0xa')]));var operators={'equals':function(_0x264e1c,_0x2b8744){return _0x264e1c==_0x2b8744;},'not_equals':function(_0x486fee,_0x40e1cc){return _0x486fee!=_0x40e1cc;}};var barAndWebActions=[_0x99f8('0xd'),_0x99f8('0xe'),_0x99f8('0xf')];function Trigger(_0x4f312b){this[_0x99f8('0x10')]=_0x4f312b[_0x99f8('0x10')];this[_0x99f8('0x11')]=_0x4f312b[_0x99f8('0x11')];this[_0x99f8('0x12')]=_0x4f312b[_0x99f8('0x12')];this[_0x99f8('0x13')]=_0x4f312b[_0x99f8('0x13')];this[_0x99f8('0x14')]=_0x4f312b[_0x99f8('0x14')];this[_0x99f8('0x15')]=_0x4f312b['zendeskAccounts'];this[_0x99f8('0x16')]=_0x4f312b[_0x99f8('0x16')];this[_0x99f8('0x17')]=_0x4f312b[_0x99f8('0x17')];this[_0x99f8('0x18')]=_0x4f312b[_0x99f8('0x18')];this[_0x99f8('0x19')]=_0x4f312b[_0x99f8('0x19')];this[_0x99f8('0x1a')]=_0x4f312b[_0x99f8('0x1a')];this[_0x99f8('0x1b')]=_0x4f312b['vtigerAccounts'];this[_0x99f8('0x1c')]=_0x4f312b[_0x99f8('0x1c')];this['dynamics365Accounts']=_0x4f312b[_0x99f8('0x1d')];this[_0x99f8('0x1e')]=_0x4f312b['freshsalesAccounts'];this['accounts']={'zendesk':this[_0x99f8('0x15')],'salesforce':this[_0x99f8('0x17')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x99f8('0x18')],'zoho':this[_0x99f8('0x19')],'desk':this[_0x99f8('0x1a')],'vtiger':this[_0x99f8('0x1b')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x99f8('0x1e')],'servicenow':this[_0x99f8('0x1c')]};ami['on']('custom:agentcalled',this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x21'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x22'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x23'),this[_0x99f8('0x1f')]['bind'](this));ami['on'](_0x99f8('0x24'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x25'),this['syncCustomEvent'][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x26'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x27'),this[_0x99f8('0x1f')]['bind'](this));ami['on'](_0x99f8('0x28'),this[_0x99f8('0x1f')]['bind'](this));ami['on']('custom:amd',this['syncCustomEvent']['bind'](this));ami['on']('custom:queuecallerabandon',this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x29'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0x99f8('0x2a')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x2b'),this[_0x99f8('0x2a')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x2c'),this[_0x99f8('0x2a')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x2d'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on']('custom:closedinteraction',this[_0x99f8('0x1f')]['bind'](this));ami['on'](_0x99f8('0x2e'),this['syncCustomEvent'][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x2f'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x30'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on']('custom:acceptmessage',this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x31'),this[_0x99f8('0x1f')][_0x99f8('0x20')](this));ami['on'](_0x99f8('0x32'),this['syncCustomEvent']['bind'](this));}Trigger[_0x99f8('0x33')][_0x99f8('0x34')]=function(_0x44f871,_0x54a9b2,_0x3adea0){logger['info'](_0x44f871,_0x54a9b2,JSON['stringify'](_0x3adea0));io['to'](_0x44f871)[_0x99f8('0x34')](_0x54a9b2,_0x3adea0);};Trigger[_0x99f8('0x33')][_0x99f8('0x1f')]=function(_0x4e61b3){var _0x1126b6=_['clone'](_0x4e61b3);if(typeof _0x1126b6['motionChannel']==='undefined'){_0x1126b6[_0x99f8('0x35')]='voice';}this[_0x99f8('0x36')](_0x1126b6);};Trigger[_0x99f8('0x33')][_0x99f8('0x2a')]=function(_0x53c2f9){if(this[_0x99f8('0x11')][_0x53c2f9['interface']]){this[_0x99f8('0x1f')](_0x53c2f9);}};Trigger[_0x99f8('0x33')][_0x99f8('0x36')]=function(_0x35a37c){var _0x65ce52;for(var _0xbcb6aa in this[_0x99f8('0x10')]){if(this[_0x99f8('0x10')][_0x99f8('0x37')](_0xbcb6aa)){if(this['triggers'][_0xbcb6aa][_0x99f8('0x38')]){_0x65ce52=this[_0x99f8('0x39')](this[_0x99f8('0x10')][_0xbcb6aa],_0x35a37c);if(_0x65ce52){_['merge'](_0x35a37c,_0x35a37c[_0x99f8('0x3a')]);for(var _0x2c92a9=0x0,_0x576b49,_0x56b068,_0x28608c;_0x2c92a90x0){_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 _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x39bebc,_0x35aaba){var _0x877377=function(_0x1d598b){while(--_0x1d598b){_0x39bebc['push'](_0x39bebc['shift']());}};_0x877377(++_0x35aaba);}(_0x814b,0x1a2));var _0xb814=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0x814b[_0x3cb86b];return _0x3c10a0;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 63224b1..fe11f00 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 _0x020a=['modernAuthentication','tenantId','CloudProvider','data2','resolve','POST','remoteUri','username','password','clientSecret','error','toUpperCase',']\x20Wrong\x20credentials!','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid','userId','internalemailaddress','message','outbound','destcalleridnum','/systemusers(','substring','enduserId','catch','toLowerCase','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','calleridnum','headers','odata-entityid','lastIndexOf','ticketId','format','user:%s','emit','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','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'];(function(_0x233d53,_0x130c7d){var _0x132182=function(_0x5d3495){while(--_0x5d3495){_0x233d53['push'](_0x233d53['shift']());}};_0x132182(++_0x130c7d);}(_0x020a,0x19a));var _0xa020=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0x020a[_0x5a4400];return _0xf9b532;};'use strict';var _=require(_0xa020('0x0'));var rp=require(_0xa020('0x1'));var util=require('util');var intUtil=require(_0xa020('0x2'));var md5=require(_0xa020('0x3'));var Redis=require(_0xa020('0x4'));var logger=require(_0xa020('0x5'))(_0xa020('0x6'));var config=require('../../../../config/environment');config[_0xa020('0x7')]=_['defaults'](config['redis'],{'host':_0xa020('0x8'),'port':0x18eb});var io=require(_0xa020('0x9'))(new Redis(config[_0xa020('0x7')]));function getAuthToken(_0x913e7b,_0x5efbad,_0x4f8b86){if(_0x913e7b[_0xa020('0xa')]){_0x913e7b['remoteUri']=_0x913e7b['CloudProvider']['data7'];_0x913e7b[_0xa020('0xb')]=_0x913e7b[_0xa020('0xc')][_0xa020('0xd')];return Promise[_0xa020('0xe')](_0x913e7b[_0xa020('0xc')]['data5']);}var _0x3ea017={'method':_0xa020('0xf'),'uri':_0x5efbad,'form':{'client_id':_0x913e7b['clientId'],'resource':_0x913e7b[_0xa020('0x10')],'username':_0x913e7b[_0xa020('0x11')],'password':_0x913e7b[_0xa020('0x12')],'grant_type':_0xa020('0x12'),'client_secret':_0x913e7b[_0xa020('0x13')]},'json':!![]};return rp(_0x3ea017)['then'](function(_0x540d12){return _0x540d12['access_token'];})['catch'](function(_0x55c5f1){logger[_0xa020('0x14')]('['+[_0x4f8b86[_0xa020('0x15')]()]+_0xa020('0x16'));return _0x55c5f1['message'];});}function getUser(_0x133c3c,_0x4518a2,_0x17c36d,_0x24f8c5,_0x14ee80,_0x4434a5){return new Promise(function(_0xd2fc11,_0x193bbf){return getAuthToken(_0x4518a2,_0x24f8c5,_0x4434a5)[_0xa020('0x17')](function(_0x40e90e){var _0xc7a7aa={'method':'GET','uri':_0x14ee80+_0xa020('0x18'),'headers':{'Authorization':_0xa020('0x19')+_0x40e90e,'OData-Version':_0xa020('0x1a')},'json':!![]};return rp(_0xc7a7aa);})[_0xa020('0x17')](function(_0x5c4083){var _0x571d69=_0x5c4083[_0xa020('0x1b')];var _0x3ce0b5=![];var _0x1975e3=null;if(!_[_0xa020('0x1c')](_0x17c36d)){if(intUtil[_0xa020('0x1d')](_0x17c36d[_0xa020('0x1e')])){_0x133c3c[_0xa020('0x1f')]=_0x17c36d['email'];for(_0x1975e3=0x0;_0x1975e3<_0x571d69[_0xa020('0x20')];_0x1975e3++){if(_0x571d69[_0x1975e3]['internalemailaddress']===_0x17c36d[_0xa020('0x1e')]&&!_0x571d69[_0x1975e3]['isdisabled']){_0x3ce0b5=!![];logger[_0xa020('0x21')]('['+[_0x4434a5[_0xa020('0x15')]()]+_0xa020('0x22')+_0x571d69[_0x1975e3][_0xa020('0x23')]+'!');_0x133c3c[_0xa020('0x24')]=_0x571d69[_0x1975e3][_0xa020('0x23')];}}}}if(!_0x3ce0b5){logger[_0xa020('0x21')]('['+[_0x4434a5['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x133c3c[_0xa020('0x1f')]=_0x4518a2[_0xa020('0x11')];for(_0x1975e3=0x0;_0x1975e3<_0x571d69[_0xa020('0x20')];_0x1975e3++){if(_0x571d69[_0x1975e3][_0xa020('0x25')]===_0x4518a2[_0xa020('0x11')]){_0x133c3c['userId']=_0x571d69[_0x1975e3][_0xa020('0x23')];}}}_0xd2fc11(_0x133c3c);})['catch'](function(_0x21f142){_0x193bbf(_0x21f142[_0xa020('0x26')]);});});}function createEndUser(_0x5dc554,_0x2fe474,_0x4822ac,_0x3c12df,_0x5650ab,_0x55a0a4){return new Promise(function(_0x3155d2,_0x1e55c6){return getAuthToken(_0x2fe474,_0x4822ac,_0x55a0a4)[_0xa020('0x17')](function(_0x3bb4dd){var _0x1fd047=_0x55a0a4['toLowerCase']()===_0xa020('0x27')?_0x5650ab[_0xa020('0x28')]:_0x5650ab['calleridnum'];var _0x581cf7={'method':_0xa020('0xf'),'uri':_0x3c12df+'contacts','body':{'telephone1':_0x1fd047,'fullname':_0x1fd047,'firstname':_0x1fd047,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa020('0x29')+_0x5dc554[_0xa020('0x24')]+')'},'headers':{'Authorization':_0xa020('0x19')+_0x3bb4dd,'OData-Version':_0xa020('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x581cf7);})[_0xa020('0x17')](function(_0xa5e9dd){var _0x43d079=_0xa5e9dd['headers']['odata-entityid'];var _0x176bed=_0x43d079[_0xa020('0x2a')](_0x43d079['lastIndexOf']('(')+0x1,_0x43d079['lastIndexOf'](')'));_0x5dc554[_0xa020('0x2b')]=_0x176bed;_0x3155d2(_0x5dc554);})[_0xa020('0x2c')](function(_0x3b9225){_0x1e55c6(_0x3b9225[_0xa020('0x26')]);});});}function getEndUser(_0x3805f0,_0x44a0bb,_0x30584b,_0x2ed366,_0x45ad49,_0x2f6e72,_0x3f1aa6){var _0x16b8a8=_0x2f6e72[_0xa020('0x2d')]()===_0xa020('0x27')?_0x45ad49['destcalleridnum']:_0x45ad49['calleridnum'];return getAuthToken(_0x44a0bb,_0x30584b,_0x2f6e72)[_0xa020('0x17')](function(_0x48c2ee){var _0xcb75c4={'method':_0xa020('0x2e'),'uri':_0x2ed366+_0xa020('0x2f')+_0x16b8a8[_0xa020('0x30')]('+',_0xa020('0x31'))+'\x27','headers':{'Authorization':_0xa020('0x19')+_0x48c2ee,'If-None-Match':null,'OData-Version':_0xa020('0x1a')},'json':!![]};return rp(_0xcb75c4);})[_0xa020('0x17')](function(_0x1a0a6d){var _0x5a6e06=![];if(!_0x1a0a6d)return _0x5a6e06;var _0x46b314=_0x1a0a6d['value'];for(var _0x377771=0x0;_0x377771<_0x46b314[_0xa020('0x20')];_0x377771++){if(_0x46b314[_0x377771][_0xa020('0x32')]===_0x16b8a8){_0x5a6e06=!![];_0x3805f0[_0xa020('0x2b')]=_0x46b314[_0x377771][_0xa020('0x33')];}}return _0x5a6e06;})[_0xa020('0x17')](function(_0xe8266c){if(_0xe8266c)return _0x3805f0;if(_0x3f1aa6===_0xa020('0x34')){logger[_0xa020('0x21')]('['+[_0x2f6e72[_0xa020('0x15')]()]+_0xa020('0x35'));return _0x3805f0;}return createEndUser(_0x3805f0,_0x44a0bb,_0x30584b,_0x2ed366,_0x45ad49,_0x2f6e72)[_0xa020('0x17')](function(_0x2c235a){logger[_0xa020('0x21')]('['+[_0x2f6e72[_0xa020('0x15')]()]+_0xa020('0x36'),_0x2c235a[_0xa020('0x2b')]);return _0x2c235a;});});}function getCustomFields(_0x1861c5,_0x3e62c9,_0x409d7a){var _0x2099cc={};if(_0x1861c5[_0xa020('0x20')]>0x0){_[_0xa020('0x37')](_0x1861c5,function(_0xa06a2a){if(_[_0xa020('0x38')]([_0xa020('0x39'),_0xa020('0x3a')],_0xa06a2a[_0xa020('0x3b')])&&_0xa06a2a[_0xa020('0x3c')]&&!_0xa06a2a[_0xa020('0x3d')]){var _0x2a81f4=_0xa06a2a['idField'][_0xa020('0x2d')]();var _0x47de32=_0x2a81f4['substring'](0x0,_0x2a81f4[_0xa020('0x3e')]('_'));var _0x39a52f=_0x2a81f4['substring'](_0x2a81f4[_0xa020('0x3e')]('_')+0x1);if(_0x47de32===_0x409d7a){_0x2099cc[_0x39a52f]=_0xa06a2a['content'];}}});}return _0x2099cc;}function getTicket(_0x20f853,_0x4d741b,_0x67e0c9,_0x53c0b5,_0x80f757,_0x4dfbcf,_0x30ca0a){return new Promise(function(_0x2b0da4,_0x19fa7d){var _0xa9a2d2;return getAuthToken(_0x4d741b,_0x67e0c9,_0x30ca0a)['then'](function(_0x30db0b){if(_0x4dfbcf[_0xa020('0x3f')]===_0xa020('0x40')){_0xa9a2d2={'method':_0xa020('0xf'),'uri':_0x53c0b5+_0xa020('0x41'),'body':Object[_0xa020('0x42')]({},{'title':intUtil[_0xa020('0x43')](_0x4dfbcf[_0xa020('0x44')],_0x80f757,'\x20'),'description':intUtil[_0xa020('0x43')](_0x4dfbcf[_0xa020('0x45')],_0x80f757,'\x0a'),'customerid_contact@odata.bind':_0x20f853['enduserId']?_0xa020('0x46')+_0x20f853[_0xa020('0x2b')]+')':undefined,'ownerid@odata.bind':_0xa020('0x29')+_0x20f853[_0xa020('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x4dfbcf[_0xa020('0x47')],_0x80f757,_0x4dfbcf[_0xa020('0x3f')])),'headers':{'Authorization':_0xa020('0x19')+_0x30db0b,'OData-Version':_0xa020('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4dfbcf[_0xa020('0x3f')]==='phonecall'){var _0x5f0776=_0x20f853['enduserId']?[{'partyid_systemuser@odata.bind':_0xa020('0x29')+_0x20f853[_0xa020('0x24')]+')','participationtypemask':_0x20f853[_0xa020('0x48')]===_0xa020('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0xa020('0x46')+_0x20f853['enduserId']+')','participationtypemask':_0x20f853['callDirection']===_0xa020('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xa020('0x29')+_0x20f853['userId']+')','participationtypemask':_0x20f853[_0xa020('0x48')]==='queue'?0x2:0x1}];_0xa9a2d2={'method':_0xa020('0xf'),'uri':_0x53c0b5+_0xa020('0x4a'),'body':Object[_0xa020('0x42')]({},{'subject':intUtil['getString'](_0x4dfbcf[_0xa020('0x44')],_0x80f757,'\x20'),'phonenumber':String(_0x80f757[_0xa020('0x4b')]),'description':intUtil[_0xa020('0x43')](_0x4dfbcf['Descriptions'],_0x80f757,'\x0a'),'regardingobjectid_contact@odata.bind':_0x20f853[_0xa020('0x2b')]?_0xa020('0x46')+_0x20f853[_0xa020('0x2b')]+')':undefined,'ownerid@odata.bind':_0xa020('0x29')+_0x20f853[_0xa020('0x24')]+')','directioncode':_0x20f853[_0xa020('0x48')]===_0xa020('0x49')?![]:!![],'phonecall_activity_parties':_0x5f0776},getCustomFields(_0x4dfbcf[_0xa020('0x47')],_0x80f757,_0x4dfbcf[_0xa020('0x3f')])),'headers':{'Authorization':_0xa020('0x19')+_0x30db0b,'OData-Version':_0xa020('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xa9a2d2);})[_0xa020('0x17')](function(_0xa9d1b0){var _0x38378f=_0xa9d1b0[_0xa020('0x4c')][_0xa020('0x4d')];var _0x83134c=_0x38378f[_0xa020('0x2a')](_0x38378f[_0xa020('0x4e')]('(')+0x1,_0x38378f[_0xa020('0x4e')](')'));_0x20f853[_0xa020('0x4f')]=_0x83134c;_0x2b0da4(_0x20f853);})['catch'](function(_0x598d56){_0x19fa7d(_0x598d56[_0xa020('0x26')]);});});}function emit(_0x4f69da,_0x20718c,_0xd8668b,_0x4d526b){var _0x54a916={'uri':util[_0xa020('0x50')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x4f69da,_0xd8668b,_0x4d526b)};io['to'](util[_0xa020('0x50')](_0xa020('0x51'),_0x20718c))[_0xa020('0x52')]('trigger:browser:url',_0x54a916);}exports['cs']=function(_0x4ac1c1,_0x212f77,_0xb0e536,_0x4e7361,_0x330495,_0x4247ba,_0x5906fe,_0x35dacf){var _0x3c5602={};_0x4247ba[_0xa020('0x10')]=_0x4247ba['modernAuthentication']?intUtil[_0xa020('0x53')](_0x4247ba['CloudProvider'][_0xa020('0x54')]):intUtil[_0xa020('0x53')](_0x4247ba[_0xa020('0x10')]);_0x4247ba[_0xa020('0x55')]=intUtil['stripTrailingSlash'](_0x4247ba[_0xa020('0x55')]);_0x3c5602[_0xa020('0x48')]=_0x35dacf===_0xa020('0x49')||_0x35dacf===_0xa020('0x56')?_0xa020('0x49'):'outbound';var _0x4bd7e3=_0x4247ba['modernAuthentication']?util['format'](_0xa020('0x57'),_0x4247ba[_0xa020('0xc')][_0xa020('0x54')]):util['format'](_0xa020('0x57'),_0x4247ba['remoteUri']);var _0x4ebd0c=util[_0xa020('0x50')](_0xa020('0x58'),_0x4247ba[_0xa020('0xb')]);var _0x3f51f5=util[_0xa020('0x50')](_0xa020('0x59'),_0x4247ba[_0xa020('0x55')],_0x212f77[_0xa020('0x5a')],md5(_0x212f77[_0xa020('0x5a')]));if(_0x330495&&_0x330495[_0xa020('0x5b')]){logger['info'](_0xa020('0x5c'),'Recording\x20is\x20enabled!');_0x212f77['recordingURL']=_0x3f51f5;}else if(_0x5906fe&&_0x5906fe[_0xa020('0x5d')]&&_0x5906fe[_0xa020('0x5d')]!==_0xa020('0x5e')){logger[_0xa020('0x21')](_0xa020('0x5f'),_0xa020('0x60'));_0x212f77[_0xa020('0x61')]=_0x3f51f5;}else{_0x212f77[_0xa020('0x61')]='';}return getUser(_0x3c5602,_0x4247ba,_0x4e7361,_0x4ebd0c,_0x4bd7e3,_0x35dacf)[_0xa020('0x17')](function(_0x5544b9){logger['info']('['+_0x35dacf[_0xa020('0x15')]()+']\x20The\x20User\x20ID\x20is:',_0x5544b9['userId']);logger[_0xa020('0x21')]('['+_0x35dacf['toUpperCase']()+_0xa020('0x62'),_0x5544b9[_0xa020('0x1f')]);return getEndUser(_0x5544b9,_0x4247ba,_0x4ebd0c,_0x4bd7e3,_0x212f77,_0x35dacf,_0xb0e536[_0xa020('0x63')]);})[_0xa020('0x17')](function(_0xc3b0d6){logger['info']('['+_0x35dacf[_0xa020('0x15')]()+_0xa020('0x64'),_0xc3b0d6['enduserId']);logger[_0xa020('0x21')]('['+_0x35dacf['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x212f77[_0xa020('0x4b')]);return getTicket(_0xc3b0d6,_0x4247ba,_0x4ebd0c,_0x4bd7e3,_0x212f77,_0xb0e536,_0x35dacf);})[_0xa020('0x17')](function(_0x277518){logger[_0xa020('0x21')](util[_0xa020('0x50')]('['+_0x35dacf[_0xa020('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0xb0e536[_0xa020('0x3f')],_0x277518[_0xa020('0x4f')]));logger['info'](util[_0xa020('0x50')]('['+_0x35dacf[_0xa020('0x15')]()+_0xa020('0x65'),_0x35dacf));if(_0x35dacf!==_0xa020('0x56')){logger['info']('['+_0x35dacf[_0xa020('0x15')]()+']',_0xa020('0x66'));emit(_0x4247ba[_0xa020('0x10')],_0x4e7361[_0xa020('0x67')],_0xb0e536['ticketType'],_0x277518[_0xa020('0x4f')]);}})[_0xa020('0x2c')](function(_0x2f0894){logger[_0xa020('0x14')]('['+_0x35dacf['toUpperCase']()+_0xa020('0x68'),_0x2f0894[_0xa020('0x26')]);});}; \ No newline at end of file +var _0x50b4=['name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','POST','password','clientSecret','then','error','toUpperCase',']\x20Wrong\x20credentials!','message','4.0','value','isNil','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','lastIndexOf','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','Bearer\x20','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','enduserId','includes','string','type','nameField','customField','substring','content','ticketType','incident','incidents','getString','Descriptions','/contacts(','userId','phonecall','callDirection','assign','queue','Fields','catch','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x5b4959,_0xd6ee29){var _0x268d47=function(_0x1b8aa4){while(--_0x1b8aa4){_0x5b4959['push'](_0x5b4959['shift']());}};_0x268d47(++_0xd6ee29);}(_0x50b4,0x67));var _0x450b=function(_0x4d4a10,_0x4cee2a){_0x4d4a10=_0x4d4a10-0x0;var _0x1be04d=_0x50b4[_0x4d4a10];return _0x1be04d;};'use strict';var _=require('lodash');var rp=require(_0x450b('0x0'));var util=require(_0x450b('0x1'));var intUtil=require('./util');var md5=require(_0x450b('0x2'));var Redis=require(_0x450b('0x3'));var logger=require(_0x450b('0x4'))(_0x450b('0x5'));var config=require(_0x450b('0x6'));config['redis']=_[_0x450b('0x7')](config['redis'],{'host':_0x450b('0x8'),'port':0x18eb});var io=require(_0x450b('0x9'))(new Redis(config[_0x450b('0xa')]));function getAuthToken(_0x28f5c9,_0x440e68,_0x609c64){if(_0x28f5c9[_0x450b('0xb')]){_0x28f5c9[_0x450b('0xc')]=_0x28f5c9[_0x450b('0xd')][_0x450b('0xe')];_0x28f5c9['tenantId']=_0x28f5c9[_0x450b('0xd')][_0x450b('0xf')];return Promise[_0x450b('0x10')](_0x28f5c9[_0x450b('0xd')]['data5']);}var _0x2adb84={'method':_0x450b('0x11'),'uri':_0x440e68,'form':{'client_id':_0x28f5c9['clientId'],'resource':_0x28f5c9['remoteUri'],'username':_0x28f5c9['username'],'password':_0x28f5c9[_0x450b('0x12')],'grant_type':'password','client_secret':_0x28f5c9[_0x450b('0x13')]},'json':!![]};return rp(_0x2adb84)[_0x450b('0x14')](function(_0x4ada51){return _0x4ada51['access_token'];})['catch'](function(_0x5ed2be){logger[_0x450b('0x15')]('['+[_0x609c64[_0x450b('0x16')]()]+_0x450b('0x17'));return _0x5ed2be[_0x450b('0x18')];});}function getUser(_0x337ec0,_0x15cc06,_0x2c012b,_0x590866,_0x3add67,_0x1bde93){return new Promise(function(_0xefe963,_0x5dd80d){return getAuthToken(_0x15cc06,_0x590866,_0x1bde93)[_0x450b('0x14')](function(_0x28e8a5){var _0x4e6cd9={'method':'GET','uri':_0x3add67+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x28e8a5,'OData-Version':_0x450b('0x19')},'json':!![]};return rp(_0x4e6cd9);})[_0x450b('0x14')](function(_0x32b7b3){var _0x2f1435=_0x32b7b3[_0x450b('0x1a')];var _0x28c9d1=![];var _0x69605d=null;if(!_[_0x450b('0x1b')](_0x2c012b)){if(intUtil['validateEmail'](_0x2c012b[_0x450b('0x1c')])){_0x337ec0[_0x450b('0x1d')]=_0x2c012b[_0x450b('0x1c')];for(_0x69605d=0x0;_0x69605d<_0x2f1435[_0x450b('0x1e')];_0x69605d++){if(_0x2f1435[_0x69605d][_0x450b('0x1f')]===_0x2c012b['email']&&!_0x2f1435[_0x69605d][_0x450b('0x20')]){_0x28c9d1=!![];logger['info']('['+[_0x1bde93[_0x450b('0x16')]()]+_0x450b('0x21')+_0x2f1435[_0x69605d][_0x450b('0x22')]+'!');_0x337ec0['userId']=_0x2f1435[_0x69605d][_0x450b('0x22')];}}}}if(!_0x28c9d1){logger[_0x450b('0x23')]('['+[_0x1bde93[_0x450b('0x16')]()]+_0x450b('0x24'));_0x337ec0[_0x450b('0x1d')]=_0x15cc06[_0x450b('0x25')];for(_0x69605d=0x0;_0x69605d<_0x2f1435['length'];_0x69605d++){if(_0x2f1435[_0x69605d][_0x450b('0x1f')]===_0x15cc06['username']){_0x337ec0['userId']=_0x2f1435[_0x69605d][_0x450b('0x22')];}}}_0xefe963(_0x337ec0);})['catch'](function(_0x1cb2a5){_0x5dd80d(_0x1cb2a5[_0x450b('0x18')]);});});}function createEndUser(_0x497308,_0x2cf4ff,_0x4e2a3e,_0x19bb1e,_0x5c844a,_0xd8f82f){return new Promise(function(_0x4556c3,_0x9ec57b){return getAuthToken(_0x2cf4ff,_0x4e2a3e,_0xd8f82f)[_0x450b('0x14')](function(_0x322c7f){var _0x12c871=_0xd8f82f[_0x450b('0x26')]()===_0x450b('0x27')?_0x5c844a[_0x450b('0x28')]:_0x5c844a[_0x450b('0x29')];var _0x89f2f8={'method':'POST','uri':_0x19bb1e+'contacts','body':{'telephone1':_0x12c871,'fullname':_0x12c871,'firstname':_0x12c871,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x450b('0x2a')+_0x497308['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x322c7f,'OData-Version':_0x450b('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x89f2f8);})[_0x450b('0x14')](function(_0x537a87){var _0x35f597=_0x537a87[_0x450b('0x2b')][_0x450b('0x2c')];var _0x5d73e2=_0x35f597['substring'](_0x35f597[_0x450b('0x2d')]('(')+0x1,_0x35f597[_0x450b('0x2d')](')'));_0x497308['enduserId']=_0x5d73e2;_0x4556c3(_0x497308);})['catch'](function(_0x527021){_0x9ec57b(_0x527021[_0x450b('0x18')]);});});}function getEndUser(_0x1a9046,_0x356011,_0x53efde,_0x342124,_0xe2b2bd,_0x1db679,_0x3f71b8){var _0x413f51=_0x1db679[_0x450b('0x26')]()===_0x450b('0x27')?_0xe2b2bd['destcalleridnum']:_0xe2b2bd[_0x450b('0x29')];return getAuthToken(_0x356011,_0x53efde,_0x1db679)[_0x450b('0x14')](function(_0x1d916b){var _0x4598a1={'method':_0x450b('0x2e'),'uri':_0x342124+_0x450b('0x2f')+_0x413f51['replace']('+',_0x450b('0x30'))+'\x27','headers':{'Authorization':_0x450b('0x31')+_0x1d916b,'If-None-Match':null,'OData-Version':_0x450b('0x19')},'json':!![]};return rp(_0x4598a1);})['then'](function(_0x3c9df0){var _0x12bbfa=![];if(!_0x3c9df0)return _0x12bbfa;var _0x103033=_0x3c9df0['value'];for(var _0x444d26=0x0;_0x444d26<_0x103033[_0x450b('0x1e')];_0x444d26++){if(_0x103033[_0x444d26][_0x450b('0x32')]===_0x413f51){_0x12bbfa=!![];_0x1a9046['enduserId']=_0x103033[_0x444d26][_0x450b('0x33')];}}return _0x12bbfa;})[_0x450b('0x14')](function(_0x4dfdab){if(_0x4dfdab)return _0x1a9046;if(_0x3f71b8===_0x450b('0x34')){logger[_0x450b('0x23')]('['+[_0x1db679[_0x450b('0x16')]()]+_0x450b('0x35'));return _0x1a9046;}return createEndUser(_0x1a9046,_0x356011,_0x53efde,_0x342124,_0xe2b2bd,_0x1db679)['then'](function(_0x875845){logger[_0x450b('0x23')]('['+[_0x1db679[_0x450b('0x16')]()]+']\x20Enduser\x20created!',_0x875845[_0x450b('0x36')]);return _0x875845;});});}function getCustomFields(_0x5d509e,_0x37fdc7,_0x27a9b0){var _0x1c1d5f={};if(_0x5d509e['length']>0x0){_['forEach'](_0x5d509e,function(_0x4c7900){if(_[_0x450b('0x37')]([_0x450b('0x38'),'picklist'],_0x4c7900[_0x450b('0x39')])&&_0x4c7900[_0x450b('0x3a')]&&!_0x4c7900[_0x450b('0x3b')]){var _0x275e40=_0x4c7900['idField']['toLowerCase']();var _0x25a23a=_0x275e40[_0x450b('0x3c')](0x0,_0x275e40['indexOf']('_'));var _0x2ea3a6=_0x275e40[_0x450b('0x3c')](_0x275e40['indexOf']('_')+0x1);if(_0x25a23a===_0x27a9b0){_0x1c1d5f[_0x2ea3a6]=_0x4c7900[_0x450b('0x3d')];}}});}return _0x1c1d5f;}function getTicket(_0x10cbd9,_0x34a8b2,_0x1bb71a,_0x5e86f4,_0x374015,_0x11e117,_0x93d40e){return new Promise(function(_0x28680e,_0x12f768){var _0x1f79e3;return getAuthToken(_0x34a8b2,_0x1bb71a,_0x93d40e)[_0x450b('0x14')](function(_0x773cea){if(_0x11e117[_0x450b('0x3e')]===_0x450b('0x3f')){_0x1f79e3={'method':_0x450b('0x11'),'uri':_0x5e86f4+_0x450b('0x40'),'body':Object['assign']({},{'title':intUtil[_0x450b('0x41')](_0x11e117['Subjects'],_0x374015,'\x20'),'description':intUtil[_0x450b('0x41')](_0x11e117[_0x450b('0x42')],_0x374015,'\x0a'),'customerid_contact@odata.bind':_0x10cbd9[_0x450b('0x36')]?_0x450b('0x43')+_0x10cbd9[_0x450b('0x36')]+')':undefined,'ownerid@odata.bind':_0x450b('0x2a')+_0x10cbd9[_0x450b('0x44')]+')','caseorigincode':'1'},getCustomFields(_0x11e117['Fields'],_0x374015,_0x11e117[_0x450b('0x3e')])),'headers':{'Authorization':_0x450b('0x31')+_0x773cea,'OData-Version':_0x450b('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x11e117['ticketType']===_0x450b('0x45')){var _0xf71e7d=_0x10cbd9[_0x450b('0x36')]?[{'partyid_systemuser@odata.bind':_0x450b('0x2a')+_0x10cbd9[_0x450b('0x44')]+')','participationtypemask':_0x10cbd9[_0x450b('0x46')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x450b('0x43')+_0x10cbd9[_0x450b('0x36')]+')','participationtypemask':_0x10cbd9[_0x450b('0x46')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x450b('0x2a')+_0x10cbd9[_0x450b('0x44')]+')','participationtypemask':_0x10cbd9[_0x450b('0x46')]==='queue'?0x2:0x1}];_0x1f79e3={'method':_0x450b('0x11'),'uri':_0x5e86f4+'phonecalls','body':Object[_0x450b('0x47')]({},{'subject':intUtil[_0x450b('0x41')](_0x11e117['Subjects'],_0x374015,'\x20'),'phonenumber':String(_0x374015[_0x450b('0x29')]),'description':intUtil['getString'](_0x11e117[_0x450b('0x42')],_0x374015,'\x0a'),'regardingobjectid_contact@odata.bind':_0x10cbd9[_0x450b('0x36')]?_0x450b('0x43')+_0x10cbd9[_0x450b('0x36')]+')':undefined,'ownerid@odata.bind':_0x450b('0x2a')+_0x10cbd9['userId']+')','directioncode':_0x10cbd9['callDirection']===_0x450b('0x48')?![]:!![],'phonecall_activity_parties':_0xf71e7d},getCustomFields(_0x11e117[_0x450b('0x49')],_0x374015,_0x11e117[_0x450b('0x3e')])),'headers':{'Authorization':_0x450b('0x31')+_0x773cea,'OData-Version':_0x450b('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1f79e3);})['then'](function(_0x5d14ed){var _0x1c00c6=_0x5d14ed['headers'][_0x450b('0x2c')];var _0x3aeb55=_0x1c00c6[_0x450b('0x3c')](_0x1c00c6[_0x450b('0x2d')]('(')+0x1,_0x1c00c6['lastIndexOf'](')'));_0x10cbd9['ticketId']=_0x3aeb55;_0x28680e(_0x10cbd9);})[_0x450b('0x4a')](function(_0x4f054b){_0x12f768(_0x4f054b[_0x450b('0x18')]);});});}function emit(_0x2de6c1,_0x2df279,_0x65778c,_0x1377eb){var _0x49863d={'uri':util[_0x450b('0x4b')](_0x450b('0x4c'),_0x2de6c1,_0x65778c,_0x1377eb)};io['to'](util[_0x450b('0x4b')](_0x450b('0x4d'),_0x2df279))['emit']('trigger:browser:url',_0x49863d);}exports['cs']=function(_0x5540ee,_0x2774a7,_0x2573a0,_0x9c76a5,_0x41d717,_0x5e67d9,_0x246922,_0x5aee1a){var _0x56a6d9={};_0x5e67d9['remoteUri']=_0x5e67d9['modernAuthentication']?intUtil[_0x450b('0x4e')](_0x5e67d9[_0x450b('0xd')][_0x450b('0xe')]):intUtil['stripTrailingSlash'](_0x5e67d9[_0x450b('0xc')]);_0x5e67d9[_0x450b('0x4f')]=intUtil[_0x450b('0x4e')](_0x5e67d9[_0x450b('0x4f')]);_0x56a6d9[_0x450b('0x46')]=_0x5aee1a==='queue'||_0x5aee1a==='unmanaged'?_0x450b('0x48'):_0x450b('0x27');var _0x275db8=_0x5e67d9[_0x450b('0xb')]?util['format'](_0x450b('0x50'),_0x5e67d9[_0x450b('0xd')][_0x450b('0xe')]):util[_0x450b('0x4b')](_0x450b('0x50'),_0x5e67d9[_0x450b('0xc')]);var _0x4dbb88=util[_0x450b('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5e67d9[_0x450b('0x51')]);var _0x26cbbf=util[_0x450b('0x4b')](_0x450b('0x52'),_0x5e67d9['serverUrl'],_0x2774a7[_0x450b('0x53')],md5(_0x2774a7['uniqueid']));if(_0x41d717&&_0x41d717[_0x450b('0x54')]){logger['info'](_0x450b('0x55'),_0x450b('0x56'));_0x2774a7[_0x450b('0x57')]=_0x26cbbf;}else if(_0x246922&&_0x246922[_0x450b('0x58')]&&_0x246922['recordingFormat']!==_0x450b('0x59')){logger['info'](_0x450b('0x5a'),_0x450b('0x56'));_0x2774a7[_0x450b('0x57')]=_0x26cbbf;}else{_0x2774a7[_0x450b('0x57')]='';}return getUser(_0x56a6d9,_0x5e67d9,_0x9c76a5,_0x4dbb88,_0x275db8,_0x5aee1a)['then'](function(_0x29f109){logger['info']('['+_0x5aee1a[_0x450b('0x16')]()+']\x20The\x20User\x20ID\x20is:',_0x29f109[_0x450b('0x44')]);logger[_0x450b('0x23')]('['+_0x5aee1a[_0x450b('0x16')]()+_0x450b('0x5b'),_0x29f109[_0x450b('0x1d')]);return getEndUser(_0x29f109,_0x5e67d9,_0x4dbb88,_0x275db8,_0x2774a7,_0x5aee1a,_0x2573a0['moduleCreate']);})[_0x450b('0x14')](function(_0x9eb339){logger[_0x450b('0x23')]('['+_0x5aee1a['toUpperCase']()+_0x450b('0x5c'),_0x9eb339[_0x450b('0x36')]);logger[_0x450b('0x23')]('['+_0x5aee1a[_0x450b('0x16')]()+_0x450b('0x5d'),_0x2774a7[_0x450b('0x29')]);return getTicket(_0x9eb339,_0x5e67d9,_0x4dbb88,_0x275db8,_0x2774a7,_0x2573a0,_0x5aee1a);})[_0x450b('0x14')](function(_0x13b79e){logger['info'](util['format']('['+_0x5aee1a[_0x450b('0x16')]()+_0x450b('0x5e'),_0x2573a0[_0x450b('0x3e')],_0x13b79e[_0x450b('0x5f')]));logger['info'](util[_0x450b('0x4b')]('['+_0x5aee1a[_0x450b('0x16')]()+_0x450b('0x60'),_0x5aee1a));if(_0x5aee1a!==_0x450b('0x61')){logger['info']('['+_0x5aee1a['toUpperCase']()+']',_0x450b('0x62'));emit(_0x5e67d9[_0x450b('0xc')],_0x9c76a5[_0x450b('0x63')],_0x2573a0[_0x450b('0x3e')],_0x13b79e[_0x450b('0x5f')]);}})[_0x450b('0x4a')](function(_0x5be8f4){logger[_0x450b('0x15')]('['+_0x5aee1a['toUpperCase']()+_0x450b('0x64'),_0x5be8f4[_0x450b('0x18')]);});}; \ 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 8cc47be..7065eff 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 _0x434f=['getString','Subjects','Descriptions','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','then','info','Ticket\x20created!','validateEmail','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','GET','map','forEach','string','type','customField','content','includes','picklist','idField','push','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','md5','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x434f,0x164));var _0xf434=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x434f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf434('0x0'));var rp=require('request-promise');var md5=require(_0xf434('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xf434('0x2'));var config=require(_0xf434('0x3'));var logger=require(_0xf434('0x4'))('freshdesk');config['redis']=_[_0xf434('0x5')](config['redis'],{'host':_0xf434('0x6'),'port':0x18eb});var io=require(_0xf434('0x7'))(new Redis(config[_0xf434('0x8')]));var headers={'Content-Type':'application/json','Accept':_0xf434('0x9')};function emit(_0x56d6c5,_0x2c27c0,_0x369f2b){io['to'](_0x56d6c5)['emit'](_0x2c27c0,_0x369f2b);}function getTicket(_0x216b53,_0x33c319,_0x5068e8,_0x13b3ba,_0x1aa1cf){logger['info'](_0xf434('0xa'));var _0x21d9d5=_[_0xf434('0xb')]({'responder_id':_0x33c319['id'],'requester_id':_0x5068e8['id'],'name':util[_0xf434('0xc')](_0xf434('0xd'),_0x1aa1cf[_0xf434('0xe')]),'phone':_0x1aa1cf[_0xf434('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf434('0x10')](_0x13b3ba[_0xf434('0x11')],_0x1aa1cf,'\x20'),'description':intUtil[_0xf434('0x10')](_0x13b3ba[_0xf434('0x12')],_0x1aa1cf,'
'),'tags':getTags(_0x13b3ba[_0xf434('0x13')],_0xf434('0x14'))},getCustomFields(_0x13b3ba['Fields'],_0x1aa1cf));_0x21d9d5[_0xf434('0x15')]=_[_0xf434('0x16')](_[_0xf434('0x17')](_0x21d9d5[_0xf434('0x15')],'id'),_0xf434('0x18'));return request({'uri':util[_0xf434('0xc')](_0xf434('0x19'),_0x216b53['remoteUri']),'method':'POST','body':_0x21d9d5})[_0xf434('0x1a')](function(_0x10c817){logger[_0xf434('0x1b')](_0xf434('0x1c'));return _0x10c817;});}function getUser(_0x240ba9,_0x2a06dd){if(intUtil[_0xf434('0x1d')](_0x2a06dd)){return request({'uri':util[_0xf434('0xc')]('%s/api/v2/agents',_0x240ba9[_0xf434('0x1e')]),'qs':{'email':_0x2a06dd}})[_0xf434('0x1a')](function(_0x3d6e4e){if(_0x3d6e4e[_0xf434('0x1f')]){logger[_0xf434('0x1b')](_0xf434('0x20'));return _[_0xf434('0x21')](_0x3d6e4e,function(_0x1186f3){return _0x1186f3[_0xf434('0x22')][_0xf434('0x23')]===_0x2a06dd;});}else{logger[_0xf434('0x1b')](_0xf434('0x24'));return request({'uri':util[_0xf434('0xc')]('%s/api/v2/agents/me',_0x240ba9[_0xf434('0x1e')])})['then'](function(_0x1c4de9){logger[_0xf434('0x1b')]('Admin\x20account\x20selected.');return _0x1c4de9;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xf434('0x25'),_0x240ba9[_0xf434('0x1e')])})[_0xf434('0x1a')](function(_0x413523){logger[_0xf434('0x1b')](_0xf434('0x26'));return _0x413523;});}}function getEndUser(_0x259a2c,_0x33298f,_0x2e5810){logger[_0xf434('0x1b')]('Searching\x20enduser\x20with\x20phone',_0x2e5810);return request({'uri':util[_0xf434('0xc')]('%s/api/v2/contacts',_0x259a2c[_0xf434('0x1e')]),'qs':{'phone':_0x2e5810}})[_0xf434('0x1a')](function(_0x52e179){if(_0x52e179[_0xf434('0x1f')]){logger[_0xf434('0x1b')](_0xf434('0x27'));return _[_0xf434('0x21')](_0x52e179,{'phone':_0x2e5810});}else{logger['info'](_0xf434('0x28'));return request({'uri':util[_0xf434('0xc')](_0xf434('0x29'),_0x259a2c['remoteUri']),'method':_0xf434('0x2a'),'body':{'name':_0x33298f,'phone':_0x2e5810}})[_0xf434('0x1a')](function(_0x34988c){logger[_0xf434('0x1b')](_0xf434('0x2b'));return _0x34988c;});}});}function getAuth(_0x50dd32){return util['format'](_0xf434('0x2c'),new Buffer(_0x50dd32[_0xf434('0x2d')]+':X')[_0xf434('0x2e')](_0xf434('0x2f')));}function request(_0x30ea16){logger[_0xf434('0x30')]('[HTTP]',JSON[_0xf434('0x31')](_0x30ea16));return rp(_[_0xf434('0x5')](_0x30ea16,{'method':_0xf434('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2a47d3,_0x55a451){var _0x2c71df=[];if(_0x2a47d3&&_0x2a47d3[_0xf434('0x1f')]>0x0){_0x2c71df=_[_0xf434('0x33')](_0x2a47d3,_0x55a451);}return _0x2c71df;}function getCustomFields(_0xb10646,_0x35b9dd){var _0x21baf9=[];var _0x1b0843={'custom_fields':[]};if(_0xb10646['length']>0x0){_[_0xf434('0x34')](_0xb10646,function(_0x181d7a){if(_['includes']([_0xf434('0x35'),'picklist'],_0x181d7a[_0xf434('0x36')])&&_0x181d7a['nameField']&&!_0x181d7a[_0xf434('0x37')]){_0x1b0843[_0x181d7a['nameField']['toLowerCase']()]=_0x181d7a[_0xf434('0x38')][_0xf434('0x2e')]();}else if(_[_0xf434('0x39')]([_0xf434('0x35'),_0xf434('0x3a')],_0x181d7a[_0xf434('0x36')])&&_0x181d7a[_0xf434('0x3b')]&&_0x181d7a[_0xf434('0x37')]){_0x1b0843[_0xf434('0x15')][_0xf434('0x3c')]({'id':_0x181d7a[_0xf434('0x3b')],'value':_0x181d7a[_0xf434('0x38')][_0xf434('0x2e')]()});}else if(_0x181d7a[_0xf434('0x36')]==='variable'&&_0x181d7a[_0xf434('0x3d')]&&_0x181d7a[_0xf434('0x3b')]&&_0x181d7a[_0xf434('0x37')]){_0x35b9dd[_0x181d7a[_0xf434('0x3d')]]&&_0x1b0843['custom_fields'][_0xf434('0x3c')]({'id':_0x181d7a[_0xf434('0x3b')],'value':_0x35b9dd[_0x181d7a[_0xf434('0x3d')]][_0xf434('0x2e')]()});}else if(_0x181d7a[_0xf434('0x36')]===_0xf434('0x3e')&&_0x181d7a['Variable']&&_0x181d7a[_0xf434('0x3f')][_0xf434('0x14')]&&_0x181d7a['idField']&&_0x181d7a[_0xf434('0x37')]){_0x35b9dd[_0x181d7a[_0xf434('0x3f')][_0xf434('0x14')]['toLowerCase']()]&&_0x1b0843[_0xf434('0x15')][_0xf434('0x3c')]({'id':_0x181d7a[_0xf434('0x3b')],'value':_0x35b9dd[_0x181d7a[_0xf434('0x3f')][_0xf434('0x14')][_0xf434('0x40')]()][_0xf434('0x2e')]()});}});}return _0x1b0843;}exports[_0xf434('0x41')]=function(_0x5c2183,_0x2ca164,_0x4d4c7d,_0x2bd58,_0x20037f,_0x2f1678){var _0x476703,_0x19164f;_0x2f1678[_0xf434('0x1e')]=intUtil[_0xf434('0x42')](_0x2f1678['remoteUri']);_0x2f1678['serverUrl']=intUtil[_0xf434('0x42')](_0x2f1678['serverUrl']);if(_0x20037f&&_0x20037f[_0xf434('0x43')]){logger[_0xf434('0x1b')](_0xf434('0x44'),_0xf434('0x45'));_0x2ca164['recordingURL']=util[_0xf434('0xc')](_0xf434('0x46'),_0x2f1678['serverUrl'],_0x2ca164[_0xf434('0x47')],md5(_0x2ca164[_0xf434('0x47')]));}else{_0x2ca164[_0xf434('0x48')]='';}headers[_0xf434('0x49')]=getAuth(_0x2f1678);return getUser(_0x2f1678,_0x2bd58[_0xf434('0x23')])['then'](function(_0x44ca4f){_0x476703=_0x44ca4f;logger[_0xf434('0x1b')](_0xf434('0x4a'),_0x476703['id']);return getEndUser(_0x2f1678,_0x2ca164[_0xf434('0xe')],_0x2ca164[_0xf434('0xf')]);})[_0xf434('0x1a')](function(_0x55aac4){_0x19164f=_0x55aac4;logger[_0xf434('0x1b')](_0xf434('0x4b'),_0x19164f['id']);return getTicket(_0x2f1678,_0x476703,_0x19164f,_0x4d4c7d,_0x2ca164);})[_0xf434('0x1a')](function(_0x57a79f){if(_0x57a79f&&_0x57a79f['id']){logger[_0xf434('0x1b')](_0xf434('0x1c'));logger[_0xf434('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x57a79f['id']);logger['info'](_0xf434('0x44'),_0xf434('0x4c'));emit(util[_0xf434('0xc')](_0xf434('0x4d'),_0x2bd58['name']),_0xf434('0x4e'),{'uri':util[_0xf434('0xc')](_0xf434('0x4f'),_0x2f1678[_0xf434('0x1e')],_0x57a79f['id'])});}})[_0xf434('0x50')](function(_0xa93164){logger[_0xf434('0x51')](_0xf434('0x44'),JSON[_0xf434('0x31')](_0xa93164));});};exports[_0xf434('0x52')]=function(_0x543cc5,_0x2e3736,_0x35dd42,_0x1a87a5,_0x1bf75d,_0x4b6b2b,_0x3b32cf){var _0x5832e8,_0x178d71;_0x4b6b2b[_0xf434('0x1e')]=intUtil[_0xf434('0x42')](_0x4b6b2b[_0xf434('0x1e')]);_0x4b6b2b[_0xf434('0x53')]=intUtil[_0xf434('0x42')](_0x4b6b2b['serverUrl']);if(_0x3b32cf&&_0x3b32cf[_0xf434('0x54')]&&_0x3b32cf['recordingFormat']!==_0xf434('0x55')){logger[_0xf434('0x1b')](_0xf434('0x56'),_0xf434('0x45'));_0x2e3736[_0xf434('0x48')]=util[_0xf434('0xc')](_0xf434('0x46'),_0x4b6b2b[_0xf434('0x53')],_0x2e3736['uniqueid'],md5(_0x2e3736[_0xf434('0x47')]));}headers['Authorization']=getAuth(_0x4b6b2b);return getUser(_0x4b6b2b,_0x1a87a5[_0xf434('0x23')])[_0xf434('0x1a')](function(_0x1f7862){_0x5832e8=_0x1f7862;logger[_0xf434('0x1b')](_0xf434('0x4a'),_0x5832e8['id']);return getEndUser(_0x4b6b2b,_0x2e3736[_0xf434('0x57')],_0x2e3736[_0xf434('0x58')]);})[_0xf434('0x1a')](function(_0x360f1a){_0x178d71=_0x360f1a;logger[_0xf434('0x1b')](_0xf434('0x4b'),_0x178d71['id']);return getTicket(_0x4b6b2b,_0x5832e8,_0x178d71,_0x35dd42,_0x2e3736);})['then'](function(_0x46d1a7){if(_0x46d1a7&&_0x46d1a7['id']){logger[_0xf434('0x1b')]('Ticket\x20created!');logger[_0xf434('0x1b')](_0xf434('0x59'),_0x46d1a7['id']);logger['info'](_0xf434('0x56'),_0xf434('0x4c'));emit(util[_0xf434('0xc')]('user:%s',_0x1a87a5['name']),'trigger:browser:url',{'uri':util[_0xf434('0xc')](_0xf434('0x4f'),_0x4b6b2b[_0xf434('0x1e')],_0x46d1a7['id'])});}})[_0xf434('0x50')](function(_0x31edc8){logger['error'](_0xf434('0x56'),JSON['stringify'](_0x31edc8));});};exports[_0xf434('0x5a')]=function(_0x56395d,_0x18ad2a,_0x362867,_0x400267,_0x52ef53,_0x3c3130){var _0xc94cd9,_0x1d4dab;_0x3c3130[_0xf434('0x1e')]=intUtil[_0xf434('0x42')](_0x3c3130[_0xf434('0x1e')]);_0x3c3130[_0xf434('0x53')]=intUtil[_0xf434('0x42')](_0x3c3130['serverUrl']);if(_0x52ef53&&_0x52ef53[_0xf434('0x43')]){logger[_0xf434('0x1b')]('['+_0x18ad2a[_0xf434('0x5b')]['toUpperCase']()+']',_0xf434('0x45'));_0x18ad2a[_0xf434('0x48')]=util[_0xf434('0xc')](_0xf434('0x46'),_0x3c3130[_0xf434('0x53')],_0x18ad2a[_0xf434('0x47')],md5(_0x18ad2a[_0xf434('0x47')]));}else{_0x18ad2a['recordingURL']='';}headers[_0xf434('0x49')]=getAuth(_0x3c3130);return getUser(_0x3c3130,'')[_0xf434('0x1a')](function(_0xfc73ad){_0xc94cd9=_0xfc73ad;logger[_0xf434('0x1b')](_0xf434('0x4a'),_0xc94cd9['id']);return getEndUser(_0x3c3130,_0x18ad2a[_0xf434('0xe')],_0x18ad2a[_0xf434('0xf')]);})[_0xf434('0x1a')](function(_0xc32c4e){_0x1d4dab=_0xc32c4e;logger['info'](_0xf434('0x4b'),_0x1d4dab['id']);return getTicket(_0x3c3130,_0xc94cd9,_0x1d4dab,_0x362867,_0x18ad2a);})[_0xf434('0x1a')](function(_0x1ba90f){if(_0x1ba90f){logger[_0xf434('0x1b')](_0xf434('0x1c'));logger[_0xf434('0x1b')](_0xf434('0x59'),_0x1ba90f['id']);}})[_0xf434('0x50')](function(_0x55982c){logger[_0xf434('0x51')]('['+_0x18ad2a[_0xf434('0x5b')][_0xf434('0x5c')]()+']',JSON[_0xf434('0x31')](_0x55982c));});}; \ No newline at end of file +var _0x7d0e=['outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','error','stringify','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','then','info','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','GET','map','includes','string','type','nameField','customField','content','picklist','custom_fields','variable','variableName','push','customVariable','Variable','name','idField','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch'];(function(_0x281006,_0x1b27e2){var _0x323d8d=function(_0x1a46c3){while(--_0x1a46c3){_0x281006['push'](_0x281006['shift']());}};_0x323d8d(++_0x1b27e2);}(_0x7d0e,0x185));var _0xe7d0=function(_0x32837a,_0x6db61f){_0x32837a=_0x32837a-0x0;var _0x279504=_0x7d0e[_0x32837a];return _0x279504;};'use strict';var _=require(_0xe7d0('0x0'));var rp=require(_0xe7d0('0x1'));var md5=require(_0xe7d0('0x2'));var util=require(_0xe7d0('0x3'));var Redis=require(_0xe7d0('0x4'));var intUtil=require('./util');var config=require(_0xe7d0('0x5'));var logger=require(_0xe7d0('0x6'))('freshdesk');config[_0xe7d0('0x7')]=_[_0xe7d0('0x8')](config[_0xe7d0('0x7')],{'host':_0xe7d0('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe7d0('0x7')]));var headers={'Content-Type':_0xe7d0('0xa'),'Accept':_0xe7d0('0xa')};function emit(_0x36b307,_0x40599b,_0x318b9a){io['to'](_0x36b307)['emit'](_0x40599b,_0x318b9a);}function getTicket(_0x2ff358,_0x3c8933,_0x49ac6d,_0x2f132b,_0xbbc3c9){logger['info'](_0xe7d0('0xb'));var _0x139f6d=_[_0xe7d0('0xc')]({'responder_id':_0x3c8933['id'],'requester_id':_0x49ac6d['id'],'name':util['format'](_0xe7d0('0xd'),_0xbbc3c9[_0xe7d0('0xe')]),'phone':_0xbbc3c9[_0xe7d0('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe7d0('0x10')](_0x2f132b[_0xe7d0('0x11')],_0xbbc3c9,'\x20'),'description':intUtil[_0xe7d0('0x10')](_0x2f132b[_0xe7d0('0x12')],_0xbbc3c9,_0xe7d0('0x13')),'tags':getTags(_0x2f132b[_0xe7d0('0x14')],'name')},getCustomFields(_0x2f132b[_0xe7d0('0x15')],_0xbbc3c9));_0x139f6d['custom_fields']=_[_0xe7d0('0x16')](_[_0xe7d0('0x17')](_0x139f6d['custom_fields'],'id'),'value');return request({'uri':util[_0xe7d0('0x18')](_0xe7d0('0x19'),_0x2ff358[_0xe7d0('0x1a')]),'method':_0xe7d0('0x1b'),'body':_0x139f6d})[_0xe7d0('0x1c')](function(_0x4cf88b){logger[_0xe7d0('0x1d')]('Ticket\x20created!');return _0x4cf88b;});}function getUser(_0xf7a290,_0xe81c6b){if(intUtil[_0xe7d0('0x1e')](_0xe81c6b)){return request({'uri':util[_0xe7d0('0x18')](_0xe7d0('0x1f'),_0xf7a290['remoteUri']),'qs':{'email':_0xe81c6b}})[_0xe7d0('0x1c')](function(_0x547965){if(_0x547965[_0xe7d0('0x20')]){logger[_0xe7d0('0x1d')](_0xe7d0('0x21'));return _[_0xe7d0('0x22')](_0x547965,function(_0x5e1b1f){return _0x5e1b1f['contact'][_0xe7d0('0x23')]===_0xe81c6b;});}else{logger[_0xe7d0('0x1d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xe7d0('0x18')](_0xe7d0('0x24'),_0xf7a290[_0xe7d0('0x1a')])})[_0xe7d0('0x1c')](function(_0x1d1ca0){logger[_0xe7d0('0x1d')](_0xe7d0('0x25'));return _0x1d1ca0;});}});}else{logger[_0xe7d0('0x1d')](_0xe7d0('0x26'));return request({'uri':util[_0xe7d0('0x18')]('%s/api/v2/agents/me',_0xf7a290['remoteUri'])})[_0xe7d0('0x1c')](function(_0x13d9d6){logger[_0xe7d0('0x1d')](_0xe7d0('0x25'));return _0x13d9d6;});}}function getEndUser(_0x7d5fff,_0x574b7a,_0x34ce2e){logger[_0xe7d0('0x1d')](_0xe7d0('0x27'),_0x34ce2e);return request({'uri':util[_0xe7d0('0x18')](_0xe7d0('0x28'),_0x7d5fff[_0xe7d0('0x1a')]),'qs':{'phone':_0x34ce2e}})[_0xe7d0('0x1c')](function(_0x1a9622){if(_0x1a9622[_0xe7d0('0x20')]){logger[_0xe7d0('0x1d')](_0xe7d0('0x29'));return _[_0xe7d0('0x22')](_0x1a9622,{'phone':_0x34ce2e});}else{logger['info'](_0xe7d0('0x2a'));return request({'uri':util[_0xe7d0('0x18')](_0xe7d0('0x28'),_0x7d5fff[_0xe7d0('0x1a')]),'method':_0xe7d0('0x1b'),'body':{'name':_0x574b7a,'phone':_0x34ce2e}})[_0xe7d0('0x1c')](function(_0x18360c){logger['info'](_0xe7d0('0x2b'));return _0x18360c;});}});}function getAuth(_0x3d9c6b){return util[_0xe7d0('0x18')](_0xe7d0('0x2c'),new Buffer(_0x3d9c6b['apiKey']+':X')[_0xe7d0('0x2d')](_0xe7d0('0x2e')));}function request(_0x21cce2){logger[_0xe7d0('0x2f')]('[HTTP]',JSON['stringify'](_0x21cce2));return rp(_[_0xe7d0('0x8')](_0x21cce2,{'method':_0xe7d0('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x21c468,_0x1fc227){var _0x492cc0=[];if(_0x21c468&&_0x21c468[_0xe7d0('0x20')]>0x0){_0x492cc0=_[_0xe7d0('0x31')](_0x21c468,_0x1fc227);}return _0x492cc0;}function getCustomFields(_0x45b376,_0x48b377){var _0xce0110=[];var _0x37d6ae={'custom_fields':[]};if(_0x45b376[_0xe7d0('0x20')]>0x0){_['forEach'](_0x45b376,function(_0x2858c0){if(_[_0xe7d0('0x32')]([_0xe7d0('0x33'),'picklist'],_0x2858c0[_0xe7d0('0x34')])&&_0x2858c0[_0xe7d0('0x35')]&&!_0x2858c0[_0xe7d0('0x36')]){_0x37d6ae[_0x2858c0[_0xe7d0('0x35')]['toLowerCase']()]=_0x2858c0[_0xe7d0('0x37')][_0xe7d0('0x2d')]();}else if(_[_0xe7d0('0x32')]([_0xe7d0('0x33'),_0xe7d0('0x38')],_0x2858c0['type'])&&_0x2858c0['idField']&&_0x2858c0[_0xe7d0('0x36')]){_0x37d6ae[_0xe7d0('0x39')]['push']({'id':_0x2858c0['idField'],'value':_0x2858c0[_0xe7d0('0x37')][_0xe7d0('0x2d')]()});}else if(_0x2858c0[_0xe7d0('0x34')]===_0xe7d0('0x3a')&&_0x2858c0['variableName']&&_0x2858c0['idField']&&_0x2858c0[_0xe7d0('0x36')]){_0x48b377[_0x2858c0[_0xe7d0('0x3b')]]&&_0x37d6ae['custom_fields'][_0xe7d0('0x3c')]({'id':_0x2858c0['idField'],'value':_0x48b377[_0x2858c0[_0xe7d0('0x3b')]][_0xe7d0('0x2d')]()});}else if(_0x2858c0[_0xe7d0('0x34')]===_0xe7d0('0x3d')&&_0x2858c0[_0xe7d0('0x3e')]&&_0x2858c0[_0xe7d0('0x3e')][_0xe7d0('0x3f')]&&_0x2858c0[_0xe7d0('0x40')]&&_0x2858c0['customField']){_0x48b377[_0x2858c0[_0xe7d0('0x3e')][_0xe7d0('0x3f')][_0xe7d0('0x41')]()]&&_0x37d6ae[_0xe7d0('0x39')][_0xe7d0('0x3c')]({'id':_0x2858c0[_0xe7d0('0x40')],'value':_0x48b377[_0x2858c0['Variable'][_0xe7d0('0x3f')][_0xe7d0('0x41')]()][_0xe7d0('0x2d')]()});}});}return _0x37d6ae;}exports[_0xe7d0('0x42')]=function(_0x5e14c1,_0x259a55,_0xac25be,_0x12a89a,_0x5713b3,_0xe9b2e1){var _0x4750e7,_0x376a93;_0xe9b2e1[_0xe7d0('0x1a')]=intUtil['stripTrailingSlash'](_0xe9b2e1[_0xe7d0('0x1a')]);_0xe9b2e1[_0xe7d0('0x43')]=intUtil[_0xe7d0('0x44')](_0xe9b2e1[_0xe7d0('0x43')]);if(_0x5713b3&&_0x5713b3[_0xe7d0('0x45')]){logger['info'](_0xe7d0('0x46'),'Recording\x20is\x20enabled!');_0x259a55[_0xe7d0('0x47')]=util[_0xe7d0('0x18')](_0xe7d0('0x48'),_0xe9b2e1[_0xe7d0('0x43')],_0x259a55['uniqueid'],md5(_0x259a55[_0xe7d0('0x49')]));}else{_0x259a55[_0xe7d0('0x47')]='';}headers[_0xe7d0('0x4a')]=getAuth(_0xe9b2e1);return getUser(_0xe9b2e1,_0x12a89a[_0xe7d0('0x23')])['then'](function(_0x25e7dc){_0x4750e7=_0x25e7dc;logger[_0xe7d0('0x1d')](_0xe7d0('0x4b'),_0x4750e7['id']);return getEndUser(_0xe9b2e1,_0x259a55['calleridname'],_0x259a55[_0xe7d0('0xf')]);})[_0xe7d0('0x1c')](function(_0x4382af){_0x376a93=_0x4382af;logger[_0xe7d0('0x1d')](_0xe7d0('0x4c'),_0x376a93['id']);return getTicket(_0xe9b2e1,_0x4750e7,_0x376a93,_0xac25be,_0x259a55);})[_0xe7d0('0x1c')](function(_0x272cc2){if(_0x272cc2&&_0x272cc2['id']){logger['info']('Ticket\x20created!');logger[_0xe7d0('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x272cc2['id']);logger['info']('[QUEUE]',_0xe7d0('0x4d'));emit(util['format'](_0xe7d0('0x4e'),_0x12a89a[_0xe7d0('0x3f')]),_0xe7d0('0x4f'),{'uri':util[_0xe7d0('0x18')]('%s/helpdesk/tickets/%d',_0xe9b2e1[_0xe7d0('0x1a')],_0x272cc2['id'])});}})[_0xe7d0('0x50')](function(_0x5549a6){logger['error'](_0xe7d0('0x46'),JSON['stringify'](_0x5549a6));});};exports[_0xe7d0('0x51')]=function(_0x38d53b,_0x85fe82,_0x59c2d1,_0x5dc287,_0x10dd4f,_0x42cd48,_0x5fb0b0){var _0x893ee6,_0x5f0e35;_0x42cd48[_0xe7d0('0x1a')]=intUtil[_0xe7d0('0x44')](_0x42cd48['remoteUri']);_0x42cd48[_0xe7d0('0x43')]=intUtil['stripTrailingSlash'](_0x42cd48[_0xe7d0('0x43')]);if(_0x5fb0b0&&_0x5fb0b0[_0xe7d0('0x52')]&&_0x5fb0b0[_0xe7d0('0x52')]!=='none'){logger[_0xe7d0('0x1d')](_0xe7d0('0x53'),_0xe7d0('0x54'));_0x85fe82[_0xe7d0('0x47')]=util[_0xe7d0('0x18')](_0xe7d0('0x48'),_0x42cd48[_0xe7d0('0x43')],_0x85fe82[_0xe7d0('0x49')],md5(_0x85fe82['uniqueid']));}headers[_0xe7d0('0x4a')]=getAuth(_0x42cd48);return getUser(_0x42cd48,_0x5dc287[_0xe7d0('0x23')])[_0xe7d0('0x1c')](function(_0x7426f4){_0x893ee6=_0x7426f4;logger['info'](_0xe7d0('0x4b'),_0x893ee6['id']);return getEndUser(_0x42cd48,_0x85fe82['destcalleridname'],_0x85fe82[_0xe7d0('0x55')]);})[_0xe7d0('0x1c')](function(_0x22f82d){_0x5f0e35=_0x22f82d;logger[_0xe7d0('0x1d')](_0xe7d0('0x4c'),_0x5f0e35['id']);return getTicket(_0x42cd48,_0x893ee6,_0x5f0e35,_0x59c2d1,_0x85fe82);})['then'](function(_0xf653a9){if(_0xf653a9&&_0xf653a9['id']){logger[_0xe7d0('0x1d')](_0xe7d0('0x56'));logger[_0xe7d0('0x1d')](_0xe7d0('0x57'),_0xf653a9['id']);logger[_0xe7d0('0x1d')](_0xe7d0('0x53'),_0xe7d0('0x4d'));emit(util[_0xe7d0('0x18')]('user:%s',_0x5dc287[_0xe7d0('0x3f')]),_0xe7d0('0x4f'),{'uri':util[_0xe7d0('0x18')](_0xe7d0('0x58'),_0x42cd48[_0xe7d0('0x1a')],_0xf653a9['id'])});}})[_0xe7d0('0x50')](function(_0x36af57){logger[_0xe7d0('0x59')](_0xe7d0('0x53'),JSON[_0xe7d0('0x5a')](_0x36af57));});};exports[_0xe7d0('0x5b')]=function(_0x149bba,_0x46f6f0,_0xd7ddf0,_0x4a15a2,_0x56088a,_0x1bd49b){var _0x3dc139,_0xc81300;_0x1bd49b[_0xe7d0('0x1a')]=intUtil[_0xe7d0('0x44')](_0x1bd49b['remoteUri']);_0x1bd49b['serverUrl']=intUtil[_0xe7d0('0x44')](_0x1bd49b[_0xe7d0('0x43')]);if(_0x56088a&&_0x56088a['monitor_format']){logger[_0xe7d0('0x1d')]('['+_0x46f6f0[_0xe7d0('0x5c')][_0xe7d0('0x5d')]()+']',_0xe7d0('0x54'));_0x46f6f0[_0xe7d0('0x47')]=util['format'](_0xe7d0('0x48'),_0x1bd49b[_0xe7d0('0x43')],_0x46f6f0[_0xe7d0('0x49')],md5(_0x46f6f0[_0xe7d0('0x49')]));}else{_0x46f6f0['recordingURL']='';}headers[_0xe7d0('0x4a')]=getAuth(_0x1bd49b);return getUser(_0x1bd49b,'')[_0xe7d0('0x1c')](function(_0x4c7bc2){_0x3dc139=_0x4c7bc2;logger[_0xe7d0('0x1d')]('The\x20User\x20ID\x20is:',_0x3dc139['id']);return getEndUser(_0x1bd49b,_0x46f6f0['calleridname'],_0x46f6f0[_0xe7d0('0xf')]);})[_0xe7d0('0x1c')](function(_0x1350a8){_0xc81300=_0x1350a8;logger[_0xe7d0('0x1d')](_0xe7d0('0x4c'),_0xc81300['id']);return getTicket(_0x1bd49b,_0x3dc139,_0xc81300,_0xd7ddf0,_0x46f6f0);})[_0xe7d0('0x1c')](function(_0x1cc017){if(_0x1cc017){logger[_0xe7d0('0x1d')](_0xe7d0('0x56'));logger[_0xe7d0('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x1cc017['id']);}})['catch'](function(_0x4b12dc){logger['error']('['+_0x46f6f0[_0xe7d0('0x5c')][_0xe7d0('0x5d')]()+']',JSON[_0xe7d0('0x5a')](_0x4b12dc));});}; \ 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 5976437..750d68a 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 _0xf2a0=['/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','getString','Subjects','Contact','format','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','userEmail','length','userId','User\x20found:','adminEmail','/api/lookup?q=','&f=','&entities=contact','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST'];(function(_0x2ea183,_0x3cff11){var _0x47c16c=function(_0x3d91e5){while(--_0x3d91e5){_0x2ea183['push'](_0x2ea183['shift']());}};_0x47c16c(++_0x3cff11);}(_0xf2a0,0x111));var _0x0f2a=function(_0x33199e,_0x428ded){_0x33199e=_0x33199e-0x0;var _0x2eef3c=_0xf2a0[_0x33199e];return _0x2eef3c;};'use strict';var _=require(_0x0f2a('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x0f2a('0x1'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x0f2a('0x2'));var intUtil=require(_0x0f2a('0x3'));var config=require(_0x0f2a('0x4'));var logger=require(_0x0f2a('0x5'))(_0x0f2a('0x6'));config[_0x0f2a('0x7')]=_['defaults'](config['redis'],{'host':_0x0f2a('0x8'),'port':0x18eb});var io=require(_0x0f2a('0x9'))(new Redis(config['redis']));function getAdminId(_0x3eea00,_0x14e9b0,_0x57bdea,_0x147dce){return new Promise(function(_0x192919,_0x271414){var _0x3de33c=![];var _0x42615e={'method':'GET','uri':_0x147dce+_0x0f2a('0xa'),'json':!![]};_0x42615e[_0x0f2a('0xb')]=_0x57bdea;logger[_0x0f2a('0xc')](_0x0f2a('0xd'));return rp(_0x42615e)[_0x0f2a('0xe')](function(_0x4a3f89){if(_0x4a3f89){var _0xbab02f=_0x4a3f89[_0x0f2a('0xf')];var _0x57492d=null;for(_0x57492d=0x0;_0x57492d<_0xbab02f['length'];_0x57492d++){if(_0xbab02f[_0x57492d][_0x0f2a('0x10')]===_0x3eea00['adminEmail']){_0x3eea00[_0x0f2a('0x11')]=_0xbab02f[_0x57492d]['id'];_0x3de33c=!![];}}if(_0x3de33c){logger[_0x0f2a('0xc')](_0x0f2a('0x12'),_0x3eea00[_0x0f2a('0x11')]);_0x192919(_0x3eea00);}else{_0x271414({'statusCode':0x194,'message':_0x0f2a('0x13')});}}else{_0x271414({'statusCode':0x194,'message':_0x0f2a('0x13')});}})[_0x0f2a('0x14')](function(_0x315da8){logger[_0x0f2a('0x15')]('['+[_0x14e9b0[_0x0f2a('0x16')]()]+']',_0x315da8[_0x0f2a('0x17')]);_0x271414(_0x315da8);});});}function getUser(_0x27fb62,_0x380dca,_0x46640a){return function(_0x3361f3){return new Promise(function(_0xbf0482,_0x12f4cb){var _0x19cd1a={'method':_0x0f2a('0x18'),'uri':_0x46640a+_0x0f2a('0xa'),'json':!![]};_0x19cd1a[_0x0f2a('0xb')]=_0x380dca;logger[_0x0f2a('0xc')](_0x0f2a('0x19'));return rp(_0x19cd1a)[_0x0f2a('0xe')](function(_0x4c7467){if(_0x4c7467){var _0x476f49=_0x4c7467[_0x0f2a('0xf')];var _0x214a9d=![];var _0x1f8ddc=null;if(_0x3361f3[_0x0f2a('0x1a')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x3361f3[_0x0f2a('0x1a')]);_0x3361f3[_0x0f2a('0x1b')]=_0x3361f3[_0x0f2a('0x1a')];for(_0x1f8ddc=0x0;_0x1f8ddc<_0x476f49[_0x0f2a('0x1c')];_0x1f8ddc++){if(_0x476f49[_0x1f8ddc]['email']===_0x3361f3[_0x0f2a('0x1a')]){_0x214a9d=!![];_0x3361f3[_0x0f2a('0x1d')]=_0x476f49[_0x1f8ddc]['id'];logger[_0x0f2a('0xc')](_0x0f2a('0x1e'),_0x3361f3[_0x0f2a('0x1d')]);}}}if(!_0x214a9d){logger['info']('Admin\x20selected');_0x3361f3[_0x0f2a('0x1b')]=_0x3361f3[_0x0f2a('0x1f')];_0x3361f3['userId']=_0x3361f3['adminId'];_0x214a9d=!![];}if(_0x214a9d){_0xbf0482(_0x3361f3);}else{_0x12f4cb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x12f4cb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x0f2a('0x14')](function(_0x4bc638){logger['error']('['+[_0x27fb62[_0x0f2a('0x16')]()]+']',_0x4bc638[_0x0f2a('0x17')]);_0x12f4cb(_0x4bc638);});});};}function searchContact(_0x3b8d60,_0x49b44b,_0x881f6c,_0x334bed){return new Promise(function(_0x18357b,_0x41f2bb){var _0x317acf={'method':_0x0f2a('0x18'),'headers':_0x49b44b,'uri':_0x3b8d60+_0x0f2a('0x20')+_0x334bed+_0x0f2a('0x21')+_0x881f6c+_0x0f2a('0x22'),'json':!![]};rp(_0x317acf)[_0x0f2a('0xe')](function(_0x5bf486){var _0x164a5c=_['find'](_0x5bf486[_0x0f2a('0x23')][_0x0f2a('0x23')],[_0x881f6c,_0x334bed]);_0x18357b(_0x164a5c);})[_0x0f2a('0x14')](function(_0x1fb69d){_0x41f2bb(_0x1fb69d);});});}function getEndUser(_0x343777,_0x1584ea,_0x332938){return function(_0x346a6c){return new Promise(function(_0x15aab5,_0x32d481){logger[_0x0f2a('0xc')](util['format'](_0x0f2a('0x24'),_0x346a6c['contactNumber']));searchContact(_0x332938,_0x1584ea,_0x0f2a('0x25'),_0x346a6c[_0x0f2a('0x26')])[_0x0f2a('0xe')](function(_0x498aa8){if(_0x498aa8){_0x346a6c[_0x0f2a('0x27')]=_0x498aa8['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x346a6c[_0x0f2a('0x27')]);return _0x15aab5(_0x346a6c);}searchContact(_0x332938,_0x1584ea,'work_number',_0x346a6c[_0x0f2a('0x26')])[_0x0f2a('0xe')](function(_0x47c349){if(_0x47c349){_0x346a6c[_0x0f2a('0x27')]=_0x47c349['id'];logger[_0x0f2a('0xc')](_0x0f2a('0x28'),_0x346a6c[_0x0f2a('0x27')]);return _0x15aab5(_0x346a6c);}createEndUser(_0x346a6c,_0x343777,_0x1584ea,_0x332938)[_0x0f2a('0xe')](function(_0x323bc6){logger['info'](_0x0f2a('0x29'),_0x323bc6['endUserId']);return _0x15aab5(_0x323bc6);});});})[_0x0f2a('0x14')](function(_0x34bd15){_0x32d481(_0x34bd15);});});};}function createEndUser(_0x5daef8,_0x711346,_0x4afd01,_0x3b9ea4){return new Promise(function(_0x448983,_0x4a9e60){var _0x4676d4=moment();var _0x2e27ab={'method':_0x0f2a('0x2a'),'uri':_0x3b9ea4+_0x0f2a('0x2b'),'body':{'contact':{'last_name':_0x5daef8[_0x0f2a('0x26')],'work_number':_0x5daef8[_0x0f2a('0x26')],'mobile_number':_0x5daef8['contactNumber'],'owner_id':_0x5daef8[_0x0f2a('0x1d')],'created_at':_0x4676d4['format'](_0x0f2a('0x2c'))}},'json':!![]};_0x2e27ab[_0x0f2a('0xb')]=_0x4afd01;logger[_0x0f2a('0xc')](_0x0f2a('0x2d'));return rp(_0x2e27ab)[_0x0f2a('0xe')](function(_0x5b0821){_0x5daef8[_0x0f2a('0x27')]=_0x5b0821['contact']['id'];_0x448983(_0x5daef8);})[_0x0f2a('0x14')](function(_0x1c9c04){logger['error']('['+[_0x711346[_0x0f2a('0x16')]()]+']',_0x1c9c04[_0x0f2a('0x17')]);_0x4a9e60(_0x1c9c04['message']);});});}function getTicket(_0x27342a,_0x249875,_0x211b66,_0x1a4d18,_0x327526){return function(_0x4d26f6){logger[_0x0f2a('0xc')]('Creating\x20new\x20task');return new Promise(function(_0x3ff021,_0x526f9d){var _0x512aa2=moment();var _0x261b28={'method':'POST','uri':_0x211b66+'/api/tasks','body':{'title':intUtil[_0x0f2a('0x2e')](_0x1a4d18[_0x0f2a('0x2f')],_0x327526,'\x20'),'description':intUtil[_0x0f2a('0x2e')](_0x1a4d18['Descriptions'],_0x327526,'\x0a'),'owner_id':_0x4d26f6[_0x0f2a('0x1d')],'creater_id':_0x4d26f6[_0x0f2a('0x11')],'targetable_id':_0x4d26f6[_0x0f2a('0x27')],'targetable_type':_0x0f2a('0x30'),'created_at':_0x512aa2[_0x0f2a('0x31')](_0x0f2a('0x2c')),'due_date':_0x512aa2[_0x0f2a('0x32')](0x1e,'m')[_0x0f2a('0x31')](_0x0f2a('0x2c'))},'json':!![]};_0x261b28[_0x0f2a('0xb')]=_0x249875;return rp(_0x261b28)['then'](function(_0x111173){_0x4d26f6[_0x0f2a('0x33')]=_0x111173[_0x0f2a('0x34')]['id'];logger[_0x0f2a('0xc')](_0x0f2a('0x35'),_0x4d26f6[_0x0f2a('0x33')]);_0x3ff021(_0x4d26f6);})[_0x0f2a('0x14')](function(_0x3a52d6){logger[_0x0f2a('0x15')]('['+[_0x27342a[_0x0f2a('0x16')]()]+']',_0x3a52d6[_0x0f2a('0x17')]);_0x526f9d(_0x3a52d6[_0x0f2a('0x17')]);});});};}function emit(_0x2ffff7,_0x1f9c6d,_0x3655ce){var _0x172a46={'uri':_0x2ffff7+'/contacts/'+_0x3655ce};io['to'](util['format'](_0x0f2a('0x36'),_0x1f9c6d))[_0x0f2a('0x37')](_0x0f2a('0x38'),_0x172a46);}exports['cs']=function(_0x25a4ce,_0x81a368,_0x5ca5d6,_0x31fbcb,_0x1fb0df,_0x50cc00,_0x357a30,_0x4e0b3c){var _0x48f166={};var _0x1af5e4={'Authorization':_0x0f2a('0x39')+_0x50cc00[_0x0f2a('0x3a')]};_0x50cc00[_0x0f2a('0x3b')]=intUtil[_0x0f2a('0x3c')](_0x50cc00['remoteUri']);_0x50cc00[_0x0f2a('0x3d')]=intUtil['stripTrailingSlash'](_0x50cc00[_0x0f2a('0x3d')]);var _0x231ffd=_0x50cc00[_0x0f2a('0x3b')];_0x48f166['adminEmail']=_0x50cc00[_0x0f2a('0x3e')];_0x48f166[_0x0f2a('0x26')]=_0x4e0b3c['toLowerCase']()===_0x0f2a('0x3f')?_0x81a368[_0x0f2a('0x40')]:_0x81a368[_0x0f2a('0x41')];_0x48f166[_0x0f2a('0x42')]=_0x4e0b3c===_0x0f2a('0x43')||_0x4e0b3c===_0x0f2a('0x44')?'queue':'outbound';if(_0x31fbcb){_0x48f166[_0x0f2a('0x1a')]=_0x31fbcb[_0x0f2a('0x10')];}var _0x487dc5=util[_0x0f2a('0x31')](_0x0f2a('0x45'),_0x50cc00[_0x0f2a('0x3d')],_0x81a368[_0x0f2a('0x46')],md5(_0x81a368['uniqueid']));if(_0x1fb0df&&_0x1fb0df['monitor_format']){logger[_0x0f2a('0xc')](_0x0f2a('0x47'),_0x0f2a('0x48'));_0x81a368['recordingURL']=_0x487dc5;}else if(_0x357a30&&_0x357a30['recordingFormat']&&_0x357a30['recordingFormat']!==_0x0f2a('0x49')){logger[_0x0f2a('0xc')](_0x0f2a('0x4a'),'Recording\x20is\x20enabled!');_0x81a368[_0x0f2a('0x4b')]=_0x487dc5;}else{_0x81a368['recordingURL']='';}return getAdminId(_0x48f166,_0x4e0b3c,_0x1af5e4,_0x231ffd)['then'](getUser(_0x4e0b3c,_0x1af5e4,_0x231ffd))['then'](getEndUser(_0x4e0b3c,_0x1af5e4,_0x231ffd))[_0x0f2a('0xe')](getTicket(_0x4e0b3c,_0x1af5e4,_0x231ffd,_0x5ca5d6,_0x81a368))[_0x0f2a('0xe')](function(_0xc8a6e0){logger[_0x0f2a('0xc')](util[_0x0f2a('0x31')]('The\x20ticket\x20ID\x20is:\x20%s',_0xc8a6e0[_0x0f2a('0x33')]));if(_0x4e0b3c!==_0x0f2a('0x44')){logger[_0x0f2a('0xc')]('['+[_0x4e0b3c['toUpperCase']()]+']',_0x0f2a('0x4c'));emit(_0x231ffd,_0x31fbcb[_0x0f2a('0x4d')],_0xc8a6e0['endUserId']);}})[_0x0f2a('0x14')](function(_0x4b3148){logger[_0x0f2a('0x15')]('['+[_0x4e0b3c['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x0f2a('0x4e')](_0x4b3148,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7590=['toUpperCase','message','headers','Getting\x20user\x20list','then','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','error','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','work_number','Contact\x20created:','POST','/api/contacts','contactNumber','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','Subjects','getString','Contact','add','Task\x20created:','ticketId','user:%s','emit','trigger:browser:url','Token\x20token=','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','length','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch'];(function(_0x47b550,_0x55ef1e){var _0x22b260=function(_0x29effa){while(--_0x29effa){_0x47b550['push'](_0x47b550['shift']());}};_0x22b260(++_0x55ef1e);}(_0x7590,0x1dc));var _0x0759=function(_0x53f740,_0x1c689c){_0x53f740=_0x53f740-0x0;var _0x50636a=_0x7590[_0x53f740];return _0x50636a;};'use strict';var _=require('lodash');var rp=require(_0x0759('0x0'));var md5=require(_0x0759('0x1'));var util=require(_0x0759('0x2'));var moment=require(_0x0759('0x3'));var Promise=require(_0x0759('0x4'));var Redis=require('ioredis');var intUtil=require(_0x0759('0x5'));var config=require(_0x0759('0x6'));var logger=require(_0x0759('0x7'))(_0x0759('0x8'));config['redis']=_[_0x0759('0x9')](config[_0x0759('0xa')],{'host':_0x0759('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0759('0xa')]));function getAdminId(_0x42c52a,_0x54cd4f,_0x145f15,_0x580160){return new Promise(function(_0x263f22,_0x2bff39){var _0x1eeb37=![];var _0x282c95={'method':_0x0759('0xc'),'uri':_0x580160+_0x0759('0xd'),'json':!![]};_0x282c95['headers']=_0x145f15;logger[_0x0759('0xe')](_0x0759('0xf'));return rp(_0x282c95)['then'](function(_0x263152){if(_0x263152){var _0xde4d9f=_0x263152['users'];var _0x399d19=null;for(_0x399d19=0x0;_0x399d19<_0xde4d9f[_0x0759('0x10')];_0x399d19++){if(_0xde4d9f[_0x399d19][_0x0759('0x11')]===_0x42c52a['adminEmail']){_0x42c52a['adminId']=_0xde4d9f[_0x399d19]['id'];_0x1eeb37=!![];}}if(_0x1eeb37){logger['info'](_0x0759('0x12'),_0x42c52a[_0x0759('0x13')]);_0x263f22(_0x42c52a);}else{_0x2bff39({'statusCode':0x194,'message':_0x0759('0x14')});}}else{_0x2bff39({'statusCode':0x194,'message':_0x0759('0x14')});}})[_0x0759('0x15')](function(_0x3c6176){logger['error']('['+[_0x54cd4f[_0x0759('0x16')]()]+']',_0x3c6176[_0x0759('0x17')]);_0x2bff39(_0x3c6176);});});}function getUser(_0x33e375,_0x59520d,_0x42ce36){return function(_0x150174){return new Promise(function(_0x369f7b,_0x5b8662){var _0x54e746={'method':_0x0759('0xc'),'uri':_0x42ce36+_0x0759('0xd'),'json':!![]};_0x54e746[_0x0759('0x18')]=_0x59520d;logger[_0x0759('0xe')](_0x0759('0x19'));return rp(_0x54e746)[_0x0759('0x1a')](function(_0x5000a4){if(_0x5000a4){var _0x3ebf83=_0x5000a4[_0x0759('0x1b')];var _0x205c0b=![];var _0x1a2cee=null;if(_0x150174[_0x0759('0x1c')]!==null){logger[_0x0759('0xe')](_0x0759('0x1d'),_0x150174[_0x0759('0x1c')]);_0x150174[_0x0759('0x1e')]=_0x150174[_0x0759('0x1c')];for(_0x1a2cee=0x0;_0x1a2cee<_0x3ebf83[_0x0759('0x10')];_0x1a2cee++){if(_0x3ebf83[_0x1a2cee][_0x0759('0x11')]===_0x150174[_0x0759('0x1c')]){_0x205c0b=!![];_0x150174[_0x0759('0x1f')]=_0x3ebf83[_0x1a2cee]['id'];logger['info'](_0x0759('0x20'),_0x150174[_0x0759('0x1f')]);}}}if(!_0x205c0b){logger[_0x0759('0xe')](_0x0759('0x21'));_0x150174[_0x0759('0x1e')]=_0x150174[_0x0759('0x22')];_0x150174['userId']=_0x150174[_0x0759('0x13')];_0x205c0b=!![];}if(_0x205c0b){_0x369f7b(_0x150174);}else{_0x5b8662({'statusCode':0x194,'message':_0x0759('0x14')});}}else{_0x5b8662({'statusCode':0x194,'message':_0x0759('0x14')});}})['catch'](function(_0x518c1f){logger[_0x0759('0x23')]('['+[_0x33e375[_0x0759('0x16')]()]+']',_0x518c1f['message']);_0x5b8662(_0x518c1f);});});};}function searchContact(_0x45012f,_0x4bae56,_0xe7079a,_0x1e78d){return new Promise(function(_0x4b29f8,_0x174d0a){var _0x14f449={'method':_0x0759('0xc'),'headers':_0x4bae56,'uri':_0x45012f+'/api/lookup?q='+_0x1e78d+_0x0759('0x24')+_0xe7079a+_0x0759('0x25'),'json':!![]};rp(_0x14f449)['then'](function(_0x2676d){var _0x4ee073=_[_0x0759('0x26')](_0x2676d[_0x0759('0x27')]['contacts'],[_0xe7079a,_0x1e78d]);_0x4b29f8(_0x4ee073);})[_0x0759('0x15')](function(_0x3b4303){_0x174d0a(_0x3b4303);});});}function getEndUser(_0x517b41,_0x58aea3,_0x4acb95){return function(_0x2320cd){return new Promise(function(_0x33da82,_0x13db3e){logger[_0x0759('0xe')](util[_0x0759('0x28')](_0x0759('0x29'),_0x2320cd['contactNumber']));searchContact(_0x4acb95,_0x58aea3,_0x0759('0x2a'),_0x2320cd['contactNumber'])[_0x0759('0x1a')](function(_0x253ac5){if(_0x253ac5){_0x2320cd[_0x0759('0x2b')]=_0x253ac5['id'];logger[_0x0759('0xe')]('Contact\x20found\x20mobile_number:',_0x2320cd[_0x0759('0x2b')]);return _0x33da82(_0x2320cd);}searchContact(_0x4acb95,_0x58aea3,_0x0759('0x2c'),_0x2320cd['contactNumber'])[_0x0759('0x1a')](function(_0x7f557c){if(_0x7f557c){_0x2320cd[_0x0759('0x2b')]=_0x7f557c['id'];logger['info']('Contact\x20found\x20work_number:',_0x2320cd[_0x0759('0x2b')]);return _0x33da82(_0x2320cd);}createEndUser(_0x2320cd,_0x517b41,_0x58aea3,_0x4acb95)[_0x0759('0x1a')](function(_0x1b16b4){logger[_0x0759('0xe')](_0x0759('0x2d'),_0x1b16b4[_0x0759('0x2b')]);return _0x33da82(_0x1b16b4);});});})[_0x0759('0x15')](function(_0x2de4c9){_0x13db3e(_0x2de4c9);});});};}function createEndUser(_0x3ac52f,_0x1935aa,_0xc97b0f,_0x2fc478){return new Promise(function(_0x44ca1a,_0x1c5b2b){var _0x4a46a0=moment();var _0x546758={'method':_0x0759('0x2e'),'uri':_0x2fc478+_0x0759('0x2f'),'body':{'contact':{'last_name':_0x3ac52f[_0x0759('0x30')],'work_number':_0x3ac52f[_0x0759('0x30')],'mobile_number':_0x3ac52f['contactNumber'],'owner_id':_0x3ac52f[_0x0759('0x1f')],'created_at':_0x4a46a0[_0x0759('0x28')](_0x0759('0x31'))}},'json':!![]};_0x546758[_0x0759('0x18')]=_0xc97b0f;logger[_0x0759('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x546758)[_0x0759('0x1a')](function(_0x44d384){_0x3ac52f['endUserId']=_0x44d384['contact']['id'];_0x44ca1a(_0x3ac52f);})[_0x0759('0x15')](function(_0x4d529b){logger[_0x0759('0x23')]('['+[_0x1935aa[_0x0759('0x16')]()]+']',_0x4d529b[_0x0759('0x17')]);_0x1c5b2b(_0x4d529b[_0x0759('0x17')]);});});}function getTicket(_0x447029,_0x2a0add,_0x14472e,_0x1f4667,_0x39939c){return function(_0x3aa373){logger[_0x0759('0xe')](_0x0759('0x32'));return new Promise(function(_0x3cc8f2,_0xd8614d){var _0x26b870=moment();var _0x1eb5df={'method':_0x0759('0x2e'),'uri':_0x14472e+'/api/tasks','body':{'title':intUtil['getString'](_0x1f4667[_0x0759('0x33')],_0x39939c,'\x20'),'description':intUtil[_0x0759('0x34')](_0x1f4667['Descriptions'],_0x39939c,'\x0a'),'owner_id':_0x3aa373[_0x0759('0x1f')],'creater_id':_0x3aa373[_0x0759('0x13')],'targetable_id':_0x3aa373[_0x0759('0x2b')],'targetable_type':_0x0759('0x35'),'created_at':_0x26b870[_0x0759('0x28')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x26b870[_0x0759('0x36')](0x1e,'m')[_0x0759('0x28')](_0x0759('0x31'))},'json':!![]};_0x1eb5df[_0x0759('0x18')]=_0x2a0add;return rp(_0x1eb5df)[_0x0759('0x1a')](function(_0xec1917){_0x3aa373['ticketId']=_0xec1917['task']['id'];logger['info'](_0x0759('0x37'),_0x3aa373[_0x0759('0x38')]);_0x3cc8f2(_0x3aa373);})['catch'](function(_0x2bbca7){logger[_0x0759('0x23')]('['+[_0x447029[_0x0759('0x16')]()]+']',_0x2bbca7[_0x0759('0x17')]);_0xd8614d(_0x2bbca7['message']);});});};}function emit(_0x7706b,_0x16aefe,_0x380ba8){var _0x38eab2={'uri':_0x7706b+'/contacts/'+_0x380ba8};io['to'](util['format'](_0x0759('0x39'),_0x16aefe))[_0x0759('0x3a')](_0x0759('0x3b'),_0x38eab2);}exports['cs']=function(_0x26fee8,_0x340b8d,_0x4f1903,_0x4add87,_0x2c2219,_0x51e515,_0xa53784,_0x34ee9e){var _0x33bfec={};var _0x206520={'Authorization':_0x0759('0x3c')+_0x51e515['apiKey']};_0x51e515['remoteUri']=intUtil[_0x0759('0x3d')](_0x51e515['remoteUri']);_0x51e515[_0x0759('0x3e')]=intUtil[_0x0759('0x3d')](_0x51e515[_0x0759('0x3e')]);var _0x3279e5=_0x51e515[_0x0759('0x3f')];_0x33bfec[_0x0759('0x22')]=_0x51e515[_0x0759('0x40')];_0x33bfec[_0x0759('0x30')]=_0x34ee9e[_0x0759('0x41')]()==='outbound'?_0x340b8d[_0x0759('0x42')]:_0x340b8d['calleridnum'];_0x33bfec[_0x0759('0x43')]=_0x34ee9e===_0x0759('0x44')||_0x34ee9e===_0x0759('0x45')?_0x0759('0x44'):_0x0759('0x46');if(_0x4add87){_0x33bfec[_0x0759('0x1c')]=_0x4add87[_0x0759('0x11')];}var _0x422401=util[_0x0759('0x28')](_0x0759('0x47'),_0x51e515[_0x0759('0x3e')],_0x340b8d[_0x0759('0x48')],md5(_0x340b8d[_0x0759('0x48')]));if(_0x2c2219&&_0x2c2219[_0x0759('0x49')]){logger[_0x0759('0xe')]('[QUEUE]',_0x0759('0x4a'));_0x340b8d['recordingURL']=_0x422401;}else if(_0xa53784&&_0xa53784['recordingFormat']&&_0xa53784['recordingFormat']!==_0x0759('0x4b')){logger[_0x0759('0xe')](_0x0759('0x4c'),'Recording\x20is\x20enabled!');_0x340b8d[_0x0759('0x4d')]=_0x422401;}else{_0x340b8d[_0x0759('0x4d')]='';}return getAdminId(_0x33bfec,_0x34ee9e,_0x206520,_0x3279e5)[_0x0759('0x1a')](getUser(_0x34ee9e,_0x206520,_0x3279e5))[_0x0759('0x1a')](getEndUser(_0x34ee9e,_0x206520,_0x3279e5))['then'](getTicket(_0x34ee9e,_0x206520,_0x3279e5,_0x4f1903,_0x340b8d))[_0x0759('0x1a')](function(_0xe6d44c){logger[_0x0759('0xe')](util['format'](_0x0759('0x4e'),_0xe6d44c['ticketId']));if(_0x34ee9e!==_0x0759('0x45')){logger[_0x0759('0xe')]('['+[_0x34ee9e[_0x0759('0x16')]()]+']',_0x0759('0x4f'));emit(_0x3279e5,_0x4add87[_0x0759('0x50')],_0xe6d44c['endUserId']);}})['catch'](function(_0x484490){logger[_0x0759('0x23')]('['+[_0x34ee9e[_0x0759('0x16')]()]+_0x0759('0x51'),util[_0x0759('0x52')](_0x484490,{'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 9c1bd69..1fb9674 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 _0xb545=['format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','freshdesk','vtiger','../../../../config/logger','error'];(function(_0x5e5ff8,_0x33a7b2){var _0x510049=function(_0xa4d4ac){while(--_0xa4d4ac){_0x5e5ff8['push'](_0x5e5ff8['shift']());}};_0x510049(++_0x33a7b2);}(_0xb545,0x179));var _0x5b54=function(_0x488bf1,_0x280f12){_0x488bf1=_0x488bf1-0x0;var _0x5839c4=_0xb545[_0x488bf1];return _0x5839c4;};'use strict';var _=require(_0x5b54('0x0'));var util=require(_0x5b54('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x5b54('0x2'));var sugarcrm=require(_0x5b54('0x3'));var freshdesk=require(_0x5b54('0x4'));var zoho=require('./zoho');var desk=require(_0x5b54('0x5'));var vtiger=require(_0x5b54('0x6'));var servicenow=require(_0x5b54('0x7'));var dynamics365=require(_0x5b54('0x8'));var freshsales=require(_0x5b54('0x9'));var integrations=[_0x5b54('0xa'),_0x5b54('0xb'),_0x5b54('0xc'),'freshdesk',_0x5b54('0xd'),_0x5b54('0xe'),'vtiger','dynamics365',_0x5b54('0xf'),_0x5b54('0x10')];exports[_0x5b54('0x11')]=function(_0x2f89f0,_0x1ead3b,_0x5cb56e,_0x2bd0a5,_0x49deac,_0x167b8a){if(_0x5cb56e){if(_['includes'](integrations,_0x2f89f0[_0x5b54('0x12')][_0x5b54('0x13')]())){try{var _0x4236ca=null;var _0xedcbc5='';var _0x100677=_0x5cb56e[_0x2f89f0['data1'][_0x5b54('0x13')]()];if(_0x100677){var _0x20de1e=_0x100677[_0x2f89f0[_0x5b54('0x14')]];if(_0x20de1e){var _0x33b82b=_[_0x5b54('0x15')](_0x20de1e[_0x5b54('0x16')],{'id':parseInt(_0x2f89f0[_0x5b54('0x17')],0xa)});if(_0x33b82b){if(_0x2bd0a5){if(_0x49deac&&_0x1ead3b[_0x5b54('0x18')]){_0xedcbc5='queue';}else if(_0x1ead3b['routeId']){_0xedcbc5='outbound';}else{console[_0x5b54('0x19')](_0x5b54('0x1a'),_0x1ead3b);}}else{_0xedcbc5='unmanaged';}switch(_0x2f89f0[_0x5b54('0x12')][_0x5b54('0x13')]()){case _0x5b54('0xa'):zendesk[_0xedcbc5](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a);break;case _0x5b54('0xb'):salesforce[_0xedcbc5](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a);break;case'sugarcrm':sugarcrm[_0xedcbc5](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a);break;case _0x5b54('0x1b'):freshdesk[_0xedcbc5](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a);break;case _0x5b54('0xd'):zoho[_0xedcbc5](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a);break;case _0x5b54('0xe'):desk[_0xedcbc5](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a);break;case _0x5b54('0x1c'):vtiger[_0xedcbc5](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a);break;case'freshsales':freshsales['cs'](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a,_0xedcbc5);break;case _0x5b54('0x10'):servicenow['cs'](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a,_0xedcbc5);break;case'dynamics365':dynamics365['cs'](_0x2f89f0,_0x1ead3b,_0x33b82b,_0x2bd0a5,_0x49deac,_0x20de1e,_0x167b8a,_0xedcbc5);break;default:console[_0x5b54('0x19')]('unknown\x20integration');}}else{_0x4236ca=require(_0x5b54('0x1d'))(_0x2f89f0[_0x5b54('0x12')][_0x5b54('0x13')]());_0x4236ca[_0x5b54('0x1e')]('[EXEC]',util[_0x5b54('0x1f')](_0x5b54('0x20'),_0x2f89f0[_0x5b54('0x12')]['toLowerCase'](),_0x2f89f0[_0x5b54('0x17')]));}}else{_0x4236ca=require(_0x5b54('0x1d'))(_0x2f89f0[_0x5b54('0x12')][_0x5b54('0x13')]());_0x4236ca['error']('[EXEC]',util[_0x5b54('0x1f')](_0x5b54('0x21'),_0x2f89f0[_0x5b54('0x12')][_0x5b54('0x13')](),_0x2f89f0[_0x5b54('0x14')]));}}else{}}catch(_0x7ff244){console['error'](_0x7ff244);}}}}; \ No newline at end of file +var _0x0e9a=['toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','freshdesk','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1'];(function(_0x4282f6,_0x411796){var _0x2176f0=function(_0x36b261){while(--_0x36b261){_0x4282f6['push'](_0x4282f6['shift']());}};_0x2176f0(++_0x411796);}(_0x0e9a,0x151));var _0xa0e9=function(_0xae31e3,_0x3cd2bc){_0xae31e3=_0xae31e3-0x0;var _0x35940f=_0x0e9a[_0xae31e3];return _0x35940f;};'use strict';var _=require(_0xa0e9('0x0'));var util=require(_0xa0e9('0x1'));var zendesk=require(_0xa0e9('0x2'));var salesforce=require(_0xa0e9('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa0e9('0x4'));var zoho=require(_0xa0e9('0x5'));var desk=require(_0xa0e9('0x6'));var vtiger=require(_0xa0e9('0x7'));var servicenow=require(_0xa0e9('0x8'));var dynamics365=require(_0xa0e9('0x9'));var freshsales=require(_0xa0e9('0xa'));var integrations=[_0xa0e9('0xb'),_0xa0e9('0xc'),_0xa0e9('0xd'),'freshdesk',_0xa0e9('0xe'),_0xa0e9('0xf'),_0xa0e9('0x10'),_0xa0e9('0x11'),_0xa0e9('0x12'),_0xa0e9('0x13')];exports[_0xa0e9('0x14')]=function(_0x54efff,_0xd050e2,_0x2d9a47,_0x202a3b,_0x7f924a,_0x230b38){if(_0x2d9a47){if(_[_0xa0e9('0x15')](integrations,_0x54efff[_0xa0e9('0x16')][_0xa0e9('0x17')]())){try{var _0x37c11e=null;var _0x1a6bdb='';var _0x27fe85=_0x2d9a47[_0x54efff['data1'][_0xa0e9('0x17')]()];if(_0x27fe85){var _0x543fc0=_0x27fe85[_0x54efff[_0xa0e9('0x18')]];if(_0x543fc0){var _0x4546d1=_[_0xa0e9('0x19')](_0x543fc0[_0xa0e9('0x1a')],{'id':parseInt(_0x54efff[_0xa0e9('0x1b')],0xa)});if(_0x4546d1){if(_0x202a3b){if(_0x7f924a&&_0xd050e2[_0xa0e9('0x1c')]){_0x1a6bdb=_0xa0e9('0x1c');}else if(_0xd050e2[_0xa0e9('0x1d')]){_0x1a6bdb='outbound';}else{console[_0xa0e9('0x1e')](_0xa0e9('0x1f'),_0xd050e2);}}else{_0x1a6bdb='unmanaged';}switch(_0x54efff[_0xa0e9('0x16')]['toLowerCase']()){case _0xa0e9('0xb'):zendesk[_0x1a6bdb](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38);break;case'salesforce':salesforce[_0x1a6bdb](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38);break;case _0xa0e9('0xd'):sugarcrm[_0x1a6bdb](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38);break;case _0xa0e9('0x20'):freshdesk[_0x1a6bdb](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38);break;case _0xa0e9('0xe'):zoho[_0x1a6bdb](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38);break;case _0xa0e9('0xf'):desk[_0x1a6bdb](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38);break;case _0xa0e9('0x10'):vtiger[_0x1a6bdb](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38);break;case _0xa0e9('0x12'):freshsales['cs'](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38,_0x1a6bdb);break;case _0xa0e9('0x13'):servicenow['cs'](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38,_0x1a6bdb);break;case'dynamics365':dynamics365['cs'](_0x54efff,_0xd050e2,_0x4546d1,_0x202a3b,_0x7f924a,_0x543fc0,_0x230b38,_0x1a6bdb);break;default:console['log'](_0xa0e9('0x21'));}}else{_0x37c11e=require(_0xa0e9('0x22'))(_0x54efff[_0xa0e9('0x16')][_0xa0e9('0x17')]());_0x37c11e['error'](_0xa0e9('0x23'),util[_0xa0e9('0x24')](_0xa0e9('0x25'),_0x54efff[_0xa0e9('0x16')][_0xa0e9('0x17')](),_0x54efff[_0xa0e9('0x1b')]));}}else{_0x37c11e=require(_0xa0e9('0x22'))(_0x54efff['data1'][_0xa0e9('0x17')]());_0x37c11e[_0xa0e9('0x26')](_0xa0e9('0x23'),util[_0xa0e9('0x24')](_0xa0e9('0x27'),_0x54efff[_0xa0e9('0x16')][_0xa0e9('0x17')](),_0x54efff[_0xa0e9('0x18')]));}}else{}}catch(_0x31bd39){console[_0xa0e9('0x26')](_0x31bd39);}}}}; \ 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 55f610d..f240f89 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 _0x425f=['moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','then','Email','Agent\x20%s\x20found.','resolve','Name','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','execute','length','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','lead','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x425f,0x108));var _0xf425=function(_0x253c26,_0x4342a0){_0x253c26=_0x253c26-0x0;var _0x5e5a57=_0x425f[_0x253c26];return _0x5e5a57;};'use strict';var _=require(_0xf425('0x0'));var rp=require(_0xf425('0x1'));var moment=require(_0xf425('0x2'));var BPromise=require(_0xf425('0x3'));var md5=require(_0xf425('0x4'));var jsforce=require(_0xf425('0x5'));var util=require(_0xf425('0x6'));var Redis=require('ioredis');var intUtil=require(_0xf425('0x7'));var config=require(_0xf425('0x8'));var logger=require(_0xf425('0x9'))('salesforce');config[_0xf425('0xa')]=_['defaults'](config[_0xf425('0xa')],{'host':_0xf425('0xb'),'port':0x18eb});var io=require(_0xf425('0xc'))(new Redis(config[_0xf425('0xa')]));function emit(_0x47a33a,_0x3b6951,_0x14cf02){io['to'](_0x47a33a)['emit'](_0x3b6951,_0x14cf02);}function getTicket(_0x320867,_0x1a7f3c,_0x311b66,_0x321ba1,_0x3275a2,_0x3b1040,_0x2d5bd4,_0x451f67){var _0xf27bb9=Object[_0xf425('0xd')]({},{'OwnerId':_0x1a7f3c['id'],'Subject':intUtil[_0xf425('0xe')](_0x321ba1['Subjects'],_0x3275a2,'\x20'),'Description':intUtil[_0xf425('0xe')](_0x321ba1[_0xf425('0xf')],_0x3275a2,'\x0a')},getCustomFields(_0x3b1040,_0x3275a2));if(_0x311b66){if(_0x321ba1[_0xf425('0x10')]===_0xf425('0x11')){_0xf27bb9[_0xf425('0x12')]=moment[_0xf425('0x13')]();_0xf27bb9['IsReminderSet']=![];_0xf27bb9[_0xf425('0x14')]=![];if(_0x311b66[_0xf425('0x15')]===_0xf425('0x16')||_0x311b66[_0xf425('0x15')]==='lead'){_0xf27bb9[_0xf425('0x17')]=_0x311b66['id'];}else if(_0x311b66['endUserType']===_0xf425('0x18')){_0xf27bb9[_0xf425('0x19')]=_0x311b66['id'];}}else if(_0x321ba1[_0xf425('0x10')]===_0xf425('0x1a')){if(_0x311b66[_0xf425('0x15')]===_0xf425('0x16')){_0xf27bb9['ContactId']=_0x311b66['id'];}else if(_0x311b66[_0xf425('0x15')]==='account'){_0xf27bb9[_0xf425('0x1b')]=_0x311b66['id'];}else if(_0x311b66[_0xf425('0x15')]==='lead'&&_0x321ba1[_0xf425('0x1c')]){_0xf27bb9[_0x321ba1[_0xf425('0x1c')]]=_0x311b66['id'];}else{logger[_0xf425('0x1d')](_0xf425('0x1e'));}}}return _0x2d5bd4[_0xf425('0x1f')](_0x321ba1[_0xf425('0x10')])['create'](_0xf27bb9);}function getUser(_0x3a283b,_0x51346a,_0xc8fe9a){if(!_[_0xf425('0x20')](_0x51346a)&&intUtil[_0xf425('0x21')](_0x51346a)){var _0x60a2d1={'Email':_0x51346a};var _0x751b0c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xc8fe9a[_0xf425('0x1f')](_0xf425('0x22'))[_0xf425('0x23')](_0x60a2d1,_0x751b0c)['execute']()[_0xf425('0x24')](function(_0x29b02d){if(_0x29b02d['length']){var _0x1a7c6f=_['find'](_0x29b02d,function(_0xcd40ac){return _0xcd40ac[_0xf425('0x25')]===_0x51346a;});if(_0x1a7c6f){logger['info'](_0xf425('0x26'),_0x51346a);return BPromise[_0xf425('0x27')]({'id':_0x1a7c6f['Id'],'name':_0x1a7c6f[_0xf425('0x28')]});}}else{logger[_0xf425('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x51346a);return _0xc8fe9a[_0xf425('0x29')]()[_0xf425('0x24')](function(_0x2b1970){return BPromise[_0xf425('0x27')]({'id':_0x2b1970['user_id'],'name':_0x2b1970[_0xf425('0x2a')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x51346a);return _0xc8fe9a[_0xf425('0x29')]()['then'](function(_0x4548ee){return BPromise['resolve']({'id':_0x4548ee[_0xf425('0x2b')],'name':_0x4548ee['display_name']});});}}function getEndUser(_0x2f8c86,_0x2b5954,_0x84ccb1,_0x506658,_0x85cd3a){var _0x3af792={'$or':{'Phone':_0x506658}};var _0x576e33={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf425('0x27')]()[_0xf425('0x24')](function(){logger[_0xf425('0x1d')](_0xf425('0x2c'),_0x506658,_0x2b5954[_0xf425('0x2d')]);switch(_0x2b5954[_0xf425('0x2d')]){case _0xf425('0x2e'):var _0x5bdda1=_[_0xf425('0x2f')](_0x3af792);if(_0x2b5954[_0xf425('0x30')]){var _0xca5e78={};_0xca5e78[_0x2b5954[_0xf425('0x30')]]=_0x506658;_['merge'](_0x5bdda1[_0xf425('0x31')],_0xca5e78);}return _0x85cd3a[_0xf425('0x1f')](_0xf425('0x32'))['find'](_0x5bdda1,_0x576e33)[_0xf425('0x33')]()[_0xf425('0x24')](function(_0x417de0){if(_0x417de0&&_0x417de0[_0xf425('0x34')]){return _0x417de0;}else{var _0x2a2480=_['cloneDeep'](_0x3af792);if(_0x2b5954[_0xf425('0x35')]){var _0x5d616b={};_0x5d616b[_0x2b5954[_0xf425('0x35')]]=_0x506658;_[_0xf425('0x36')](_0x2a2480['$or'],_0x5d616b);}return _0x85cd3a['sobject'](_0xf425('0x37'))['find'](_0x2a2480,_0x576e33);}});case _0xf425('0x38'):var _0x2dc2eb=_[_0xf425('0x2f')](_0x3af792);if(_0x2b5954[_0xf425('0x39')]){var _0xca5e78={};_0xca5e78[_0x2b5954['additionalSearchAccount']]=_0x506658;_[_0xf425('0x36')](_0x2dc2eb[_0xf425('0x31')],_0xca5e78);}return _0x85cd3a['sobject'](_0xf425('0x3a'))[_0xf425('0x23')](_0x2dc2eb,_0x576e33)['execute']()[_0xf425('0x24')](function(_0xc5eabd){if(_0xc5eabd&&_0xc5eabd[_0xf425('0x34')]){return _0xc5eabd;}else{var _0x2a54e4=_[_0xf425('0x2f')](_0x3af792);if(_0x2b5954[_0xf425('0x30')]){var _0x49bc02={};_0x49bc02[_0x2b5954[_0xf425('0x30')]]=_0x506658;_[_0xf425('0x36')](_0x2a54e4[_0xf425('0x31')],_0x49bc02);}return _0x85cd3a['sobject']('Contact')[_0xf425('0x23')](_0x2a54e4,_0x576e33)[_0xf425('0x24')](function(_0x531715){if(_0x531715&&_0x531715[_0xf425('0x34')]){return _0x531715;}else{var _0x4c49ac=_[_0xf425('0x2f')](_0x3af792);if(_0x2b5954[_0xf425('0x35')]){var _0x818a56={};_0x818a56[_0x2b5954[_0xf425('0x35')]]=_0x506658;_['merge'](_0x4c49ac[_0xf425('0x31')],_0x818a56);}return _0x85cd3a['sobject'](_0xf425('0x37'))['find'](_0x4c49ac,_0x576e33);}});}});case _0xf425('0x16'):var _0x5bdda1=_[_0xf425('0x2f')](_0x3af792);if(_0x2b5954[_0xf425('0x30')]){var _0xca5e78={};_0xca5e78[_0x2b5954[_0xf425('0x30')]]=_0x506658;_['merge'](_0x5bdda1['$or'],_0xca5e78);}return _0x85cd3a[_0xf425('0x1f')](_0xf425('0x32'))[_0xf425('0x23')](_0x5bdda1,_0x576e33)['execute']();case _0xf425('0x3b'):var _0x5490cf=_['cloneDeep'](_0x3af792);if(_0x2b5954[_0xf425('0x35')]){var _0xca5e78={};_0xca5e78[_0x2b5954[_0xf425('0x35')]]=_0x506658;_[_0xf425('0x36')](_0x5490cf['$or'],_0xca5e78);}return _0x85cd3a['sobject'](_0xf425('0x37'))[_0xf425('0x23')](_0x5490cf,_0x576e33);case _0xf425('0x18'):var _0x2dc2eb=_[_0xf425('0x2f')](_0x3af792);if(_0x2b5954[_0xf425('0x39')]){var _0xca5e78={};_0xca5e78[_0x2b5954[_0xf425('0x39')]]=_0x506658;_['merge'](_0x2dc2eb[_0xf425('0x31')],_0xca5e78);}return _0x85cd3a[_0xf425('0x1f')](_0xf425('0x3a'))[_0xf425('0x23')](_0x2dc2eb,_0x576e33);default:return null;}})[_0xf425('0x24')](function(_0x338720){if(_0x338720&&_0x338720['length']){var _0x13a8d7=_[_0xf425('0x3c')](_0x338720);if(_0x13a8d7){return BPromise[_0xf425('0x27')]({'id':_0x13a8d7['Id'],'name':_0x13a8d7['Name'],'phone':_0x13a8d7[_0xf425('0x3d')],'endUserType':_0x13a8d7[_0xf425('0x3e')][_0xf425('0x3f')][_0xf425('0x40')]()});}}})[_0xf425('0x24')](function(_0x178fca){if(_0x178fca){logger[_0xf425('0x1d')](_0xf425('0x41'),_0x178fca[_0xf425('0x15')],_0x506658);return BPromise['resolve'](_0x178fca);}else{logger[_0xf425('0x1d')](_0xf425('0x42'),_0x506658);var _0x1cffe0={'Phone':_0x506658};if(_0x2b5954['moduleCreate']){if(_0x2b5954[_0xf425('0x43')]===_0xf425('0x16')){logger[_0xf425('0x1d')](_0xf425('0x44'),_0x506658,_0x2b5954['moduleCreate']);_0x1cffe0[_0xf425('0x45')]=_0x84ccb1!==_0xf425('0x46')?_0x84ccb1:util[_0xf425('0x47')]('Caller\x20-\x20%s',_0x506658);}else if(_0x2b5954[_0xf425('0x43')]===_0xf425('0x3b')){logger[_0xf425('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x506658,_0x2b5954[_0xf425('0x43')]);_0x1cffe0[_0xf425('0x45')]=_0x84ccb1!==_0xf425('0x46')?_0x84ccb1:util[_0xf425('0x47')](_0xf425('0x48'),_0x506658);_0x1cffe0[_0xf425('0x49')]=_0xf425('0x4a');}else if(_0x2b5954[_0xf425('0x43')]==='account'){logger[_0xf425('0x1d')](_0xf425('0x44'),_0x506658,_0x2b5954[_0xf425('0x43')]);_0x1cffe0['Name']=_0x84ccb1!==_0xf425('0x46')?_0x84ccb1:util[_0xf425('0x47')](_0xf425('0x48'),_0x506658);}else{return null;}}return _0x85cd3a[_0xf425('0x1f')](_[_0xf425('0x4b')](_0x2b5954[_0xf425('0x43')]))['create'](_0x1cffe0)[_0xf425('0x24')](function(_0x2e4ded){return BPromise[_0xf425('0x27')]({'id':_0x2e4ded['id'],'endUserType':_0x2b5954['moduleCreate']});});}});}function getCustomFields(_0x5d0c68,_0x148016){var _0x405e97={};if(_0x5d0c68[_0xf425('0x34')]>0x0){_[_0xf425('0x4c')](_0x5d0c68,function(_0x25821d){if(_['includes'](['string',_0xf425('0x4d')],_0x25821d['type'])&&_0x25821d[_0xf425('0x4e')]){_0x405e97[_0x25821d[_0xf425('0x4e')]]=_0x25821d['content'][_0xf425('0x4f')]();}else if(_0x25821d[_0xf425('0x3f')]===_0xf425('0x50')&&_0x25821d[_0xf425('0x51')]&&_0x25821d[_0xf425('0x4e')]){_0x148016[_0x25821d[_0xf425('0x51')]]&&(_0x405e97[_0x25821d['idField']]=_0x148016[_0x25821d[_0xf425('0x51')]][_0xf425('0x4f')]());}else if(_0x25821d[_0xf425('0x3f')]===_0xf425('0x52')&&_0x25821d[_0xf425('0x53')]&&_0x25821d[_0xf425('0x53')][_0xf425('0x54')]&&_0x25821d['idField']){_0x148016[_0x25821d['Variable'][_0xf425('0x54')][_0xf425('0x40')]()]&&(_0x405e97[_0x25821d[_0xf425('0x4e')]]=_0x148016[_0x25821d['Variable'][_0xf425('0x54')][_0xf425('0x40')]()]['toString']());}});}return _0x405e97;}function getConnection(_0x46b7ed){var _0x57c1a1=_0x46b7ed[_0xf425('0x55')][_0xf425('0x56')](_0x46b7ed[_0xf425('0x57')]);var _0x39de47=new jsforce[(_0xf425('0x58'))]({'oauth2':{'loginUrl':_0x46b7ed[_0xf425('0x59')]||'https://login.salesforce.com','clientId':_0x46b7ed[_0xf425('0x5a')],'clientSecret':_0x46b7ed[_0xf425('0x5b')]}});return _0x39de47[_0xf425('0x5c')](_0x46b7ed[_0xf425('0x5d')],_0x57c1a1)['then'](function(){logger[_0xf425('0x1d')](_0xf425('0x5e'));return _0x39de47;});}exports['queue']=function(_0x218887,_0x17719c,_0x42171f,_0x23f1ba,_0x1362bb,_0x46077c){var _0x13e56a,_0x55fb90,_0x5a8d88,_0xd39b5a;_0x46077c[_0xf425('0x5f')]=intUtil[_0xf425('0x60')](_0x46077c[_0xf425('0x5f')]);_0x46077c[_0xf425('0x59')]=intUtil[_0xf425('0x60')](_0x46077c['remoteUri']);if(_0x1362bb&&_0x1362bb[_0xf425('0x61')]){logger['info'](_0xf425('0x62'),_0xf425('0x63'));_0x17719c['recordingURL']=util[_0xf425('0x47')](_0xf425('0x64'),_0x46077c[_0xf425('0x5f')],_0x17719c[_0xf425('0x65')],md5(_0x17719c['uniqueid']));}else{_0x17719c['recordingURL']='';}return getConnection(_0x46077c)[_0xf425('0x24')](function(_0xd34322){_0xd39b5a=_0xd34322;return getUser(_0x46077c,_0x23f1ba['email'],_0xd39b5a);})[_0xf425('0x24')](function(_0x426879){_0x13e56a=_0x426879;return getEndUser(_0x46077c,_0x42171f,_0x17719c[_0xf425('0x66')],_0x17719c[_0xf425('0x67')],_0xd39b5a);})[_0xf425('0x24')](function(_0x4e0d0e){_0x55fb90=_0x4e0d0e;return getTicket(_0x46077c,_0x13e56a,_0x55fb90,_0x42171f,_0x17719c,_0x42171f[_0xf425('0x68')],_0xd39b5a,_0xf425('0x69'));})[_0xf425('0x24')](function(_0x211497){_0x5a8d88=_0x211497;logger[_0xf425('0x1d')](_0xf425('0x6a'),_0x5a8d88['id']);logger[_0xf425('0x1d')](_0xf425('0x6b'),_0x5a8d88['id'],_0x23f1ba[_0xf425('0x54')],_0x46077c[_0xf425('0x3f')]);switch(_0x46077c[_0xf425('0x3f')]){case'integrationTab':emit(util['format'](_0xf425('0x6c'),_0x23f1ba['name']),'trigger:salesforce:display',{'recordId':_0x5a8d88['id']});break;case _0xf425('0x6d'):emit(util[_0xf425('0x47')](_0xf425('0x6c'),_0x23f1ba[_0xf425('0x54')]),_0xf425('0x6e'),{'uri':util[_0xf425('0x47')](_0xf425('0x6f'),_0xd39b5a[_0xf425('0x70')],_0x5a8d88['id'])});break;default:logger['error'](_0xf425('0x71'));}})[_0xf425('0x72')](function(_0x5c7a82){logger[_0xf425('0x73')](_0xf425('0x62'),_0x5c7a82);});};exports[_0xf425('0x74')]=function(_0x38ce0f,_0x3b1ded,_0xbbf9a0,_0x17eaf1,_0x2315a7,_0x50f634,_0x589bfe){var _0x2f45c5,_0x20d41f,_0x5c8265,_0x537c1c;_0x50f634['serverUrl']=intUtil[_0xf425('0x60')](_0x50f634['serverUrl']);_0x50f634['remoteUri']=intUtil['stripTrailingSlash'](_0x50f634['remoteUri']);if(_0x589bfe&&_0x589bfe['recordingFormat']&&_0x589bfe[_0xf425('0x75')]!==_0xf425('0x76')){logger[_0xf425('0x1d')](_0xf425('0x77'),_0xf425('0x63'));_0x3b1ded[_0xf425('0x78')]=util['format'](_0xf425('0x64'),_0x50f634[_0xf425('0x5f')],_0x3b1ded[_0xf425('0x65')],md5(_0x3b1ded[_0xf425('0x65')]));}return getConnection(_0x50f634)[_0xf425('0x24')](function(_0x5c0906){_0x537c1c=_0x5c0906;return getUser(_0x50f634,_0x17eaf1[_0xf425('0x79')],_0x537c1c);})['then'](function(_0x5da4f8){_0x2f45c5=_0x5da4f8;return getEndUser(_0x50f634,_0xbbf9a0,_0x3b1ded[_0xf425('0x7a')],_0x3b1ded[_0xf425('0x7b')],_0x537c1c);})['then'](function(_0xda6687){_0x20d41f=_0xda6687;return getTicket(_0x50f634,_0x2f45c5,_0x20d41f,_0xbbf9a0,_0x3b1ded,_0xbbf9a0['Fields'],_0x537c1c,_0xf425('0x74'));})['then'](function(_0xf41c8d){_0x5c8265=_0xf41c8d;logger[_0xf425('0x1d')](_0xf425('0x7c'),_0x5c8265['id']);logger['info'](_0xf425('0x7d'),_0x5c8265['id'],_0x17eaf1[_0xf425('0x54')],_0x50f634[_0xf425('0x3f')]);switch(_0x50f634[_0xf425('0x3f')]){case _0xf425('0x7e'):emit(util[_0xf425('0x47')](_0xf425('0x6c'),_0x17eaf1[_0xf425('0x54')]),_0xf425('0x7f'),{'recordId':_0x5c8265['id']});break;case _0xf425('0x6d'):emit(util['format']('user:%s',_0x17eaf1['name']),_0xf425('0x6e'),{'uri':util['format']('%s/%s/e',_0x537c1c[_0xf425('0x70')],_0x5c8265['id'])});break;default:logger[_0xf425('0x73')](_0xf425('0x77'),_0xf425('0x80'));}})[_0xf425('0x72')](function(_0x2d7105){logger[_0xf425('0x73')](_0xf425('0x77'),_0x2d7105);});};exports['unmanaged']=function(_0x3d609b,_0x113c29,_0x2dc671,_0x56a9dd,_0x3d44cb,_0x53be31){var _0x106c70,_0x4a3b2a,_0x3ff596,_0x3c1bac;_0x53be31[_0xf425('0x5f')]=intUtil['stripTrailingSlash'](_0x53be31[_0xf425('0x5f')]);_0x53be31[_0xf425('0x59')]=intUtil[_0xf425('0x60')](_0x53be31['remoteUri']);if(_0x3d44cb&&_0x3d44cb[_0xf425('0x61')]){logger[_0xf425('0x1d')]('['+_0x113c29[_0xf425('0x81')]['toUpperCase']()+']',_0xf425('0x63'));_0x113c29[_0xf425('0x78')]=util[_0xf425('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53be31[_0xf425('0x5f')],_0x113c29['uniqueid'],md5(_0x113c29['uniqueid']));}else{_0x113c29[_0xf425('0x78')]='';}return getConnection(_0x53be31)[_0xf425('0x24')](function(_0xfaafa6){_0x3c1bac=_0xfaafa6;if(!_[_0xf425('0x20')](_0x56a9dd)){return getUser(_0x53be31,_0x56a9dd[_0xf425('0x54')],_0x3c1bac);}else{return getUser(_0x53be31,null,_0x3c1bac);}})['then'](function(_0xe662c8){_0x106c70=_0xe662c8;return getEndUser(_0x53be31,_0x2dc671,_0x113c29[_0xf425('0x66')],_0x113c29[_0xf425('0x67')],_0x3c1bac);})[_0xf425('0x24')](function(_0x4c196a){_0x4a3b2a=_0x4c196a;return getTicket(_0x53be31,_0x106c70,_0x4a3b2a,_0x2dc671,_0x113c29,_0x2dc671[_0xf425('0x68')],_0x3c1bac);})[_0xf425('0x24')](function(_0x81ccff){_0x3ff596=_0x81ccff;logger[_0xf425('0x1d')]('['+_0x113c29[_0xf425('0x81')][_0xf425('0x82')]()+_0xf425('0x83'),_0x3ff596['id']);logger[_0xf425('0x1d')]('['+_0x113c29['lastevent'][_0xf425('0x82')]()+_0xf425('0x84'),_0x53be31['type']);})[_0xf425('0x72')](function(_0x2febae){logger['error']('['+_0x113c29[_0xf425('0x81')][_0xf425('0x82')]()+']',_0x2febae);});}; \ No newline at end of file +var _0x315d=['calleridname','Fields',']\x20Ticket\x20%s\x20created.','lodash','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','assign','getString','Descriptions','utc','IsRecurrence','contact','endUserType','account','ticketType','Case','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','Account','execute','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','variable','variableName','toString','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','instanceUrl','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase'];(function(_0x433b93,_0x220827){var _0x28bb2d=function(_0x54cb68){while(--_0x54cb68){_0x433b93['push'](_0x433b93['shift']());}};_0x28bb2d(++_0x220827);}(_0x315d,0xfb));var _0xd315=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x315d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd315('0x0'));var rp=require('request-promise');var moment=require(_0xd315('0x1'));var BPromise=require(_0xd315('0x2'));var md5=require(_0xd315('0x3'));var jsforce=require(_0xd315('0x4'));var util=require(_0xd315('0x5'));var Redis=require(_0xd315('0x6'));var intUtil=require('./util');var config=require(_0xd315('0x7'));var logger=require(_0xd315('0x8'))(_0xd315('0x9'));config[_0xd315('0xa')]=_['defaults'](config[_0xd315('0xa')],{'host':_0xd315('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd315('0xa')]));function emit(_0x2cff64,_0x2b819a,_0x4e1413){io['to'](_0x2cff64)['emit'](_0x2b819a,_0x4e1413);}function getTicket(_0x1d09fa,_0x5940e0,_0x739da0,_0x37c95c,_0xefcabb,_0x321024,_0x226b5a,_0x56f252){var _0x460cc7=Object[_0xd315('0xc')]({},{'OwnerId':_0x5940e0['id'],'Subject':intUtil[_0xd315('0xd')](_0x37c95c['Subjects'],_0xefcabb,'\x20'),'Description':intUtil['getString'](_0x37c95c[_0xd315('0xe')],_0xefcabb,'\x0a')},getCustomFields(_0x321024,_0xefcabb));if(_0x739da0){if(_0x37c95c['ticketType']==='Task'){_0x460cc7['ActivityDate']=moment[_0xd315('0xf')]();_0x460cc7['IsReminderSet']=![];_0x460cc7[_0xd315('0x10')]=![];if(_0x739da0['endUserType']===_0xd315('0x11')||_0x739da0[_0xd315('0x12')]==='lead'){_0x460cc7['WhoId']=_0x739da0['id'];}else if(_0x739da0[_0xd315('0x12')]===_0xd315('0x13')){_0x460cc7['WhatId']=_0x739da0['id'];}}else if(_0x37c95c[_0xd315('0x14')]===_0xd315('0x15')){if(_0x739da0['endUserType']==='contact'){_0x460cc7[_0xd315('0x16')]=_0x739da0['id'];}else if(_0x739da0['endUserType']==='account'){_0x460cc7[_0xd315('0x17')]=_0x739da0['id'];}else if(_0x739da0[_0xd315('0x12')]===_0xd315('0x18')&&_0x37c95c[_0xd315('0x19')]){_0x460cc7[_0x37c95c['leadId']]=_0x739da0['id'];}else{logger[_0xd315('0x1a')](_0xd315('0x1b'));}}}return _0x226b5a[_0xd315('0x1c')](_0x37c95c[_0xd315('0x14')])[_0xd315('0x1d')](_0x460cc7);}function getUser(_0x6bbe28,_0x2b31f1,_0x314fc5){if(!_['isNil'](_0x2b31f1)&&intUtil[_0xd315('0x1e')](_0x2b31f1)){var _0x59f825={'Email':_0x2b31f1};var _0x506486={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x314fc5[_0xd315('0x1c')](_0xd315('0x1f'))[_0xd315('0x20')](_0x59f825,_0x506486)['execute']()[_0xd315('0x21')](function(_0x4f2322){if(_0x4f2322[_0xd315('0x22')]){var _0x4f3e5c=_[_0xd315('0x20')](_0x4f2322,function(_0x2d4e86){return _0x2d4e86[_0xd315('0x23')]===_0x2b31f1;});if(_0x4f3e5c){logger[_0xd315('0x1a')](_0xd315('0x24'),_0x2b31f1);return BPromise[_0xd315('0x25')]({'id':_0x4f3e5c['Id'],'name':_0x4f3e5c[_0xd315('0x26')]});}}else{logger[_0xd315('0x1a')](_0xd315('0x27'),_0x2b31f1);return _0x314fc5['identity']()['then'](function(_0x3ac272){return BPromise[_0xd315('0x25')]({'id':_0x3ac272[_0xd315('0x28')],'name':_0x3ac272[_0xd315('0x29')]});});}});}else{logger[_0xd315('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2b31f1);return _0x314fc5['identity']()[_0xd315('0x21')](function(_0x261794){return BPromise[_0xd315('0x25')]({'id':_0x261794[_0xd315('0x28')],'name':_0x261794[_0xd315('0x29')]});});}}function getEndUser(_0x3c567a,_0x212e8c,_0x45eb1c,_0x9669e3,_0x3e17fb){var _0x1b7c80={'$or':{'Phone':_0x9669e3}};var _0x68b560={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xd315('0x21')](function(){logger[_0xd315('0x1a')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x9669e3,_0x212e8c['moduleSearch']);switch(_0x212e8c[_0xd315('0x2a')]){case'contact_lead':var _0x2038d5=_[_0xd315('0x2b')](_0x1b7c80);if(_0x212e8c[_0xd315('0x2c')]){var _0x12f4ae={};_0x12f4ae[_0x212e8c[_0xd315('0x2c')]]=_0x9669e3;_[_0xd315('0x2d')](_0x2038d5[_0xd315('0x2e')],_0x12f4ae);}return _0x3e17fb[_0xd315('0x1c')](_0xd315('0x2f'))[_0xd315('0x20')](_0x2038d5,_0x68b560)['execute']()[_0xd315('0x21')](function(_0x40a833){if(_0x40a833&&_0x40a833[_0xd315('0x22')]){return _0x40a833;}else{var _0x3f778f=_[_0xd315('0x2b')](_0x1b7c80);if(_0x212e8c[_0xd315('0x30')]){var _0x5ed09d={};_0x5ed09d[_0x212e8c[_0xd315('0x30')]]=_0x9669e3;_['merge'](_0x3f778f[_0xd315('0x2e')],_0x5ed09d);}return _0x3e17fb['sobject'](_0xd315('0x31'))[_0xd315('0x20')](_0x3f778f,_0x68b560);}});case'account_contact_lead':var _0x1087ca=_['cloneDeep'](_0x1b7c80);if(_0x212e8c['additionalSearchAccount']){var _0x12f4ae={};_0x12f4ae[_0x212e8c[_0xd315('0x32')]]=_0x9669e3;_[_0xd315('0x2d')](_0x1087ca[_0xd315('0x2e')],_0x12f4ae);}return _0x3e17fb['sobject'](_0xd315('0x33'))[_0xd315('0x20')](_0x1087ca,_0x68b560)['execute']()[_0xd315('0x21')](function(_0x359793){if(_0x359793&&_0x359793[_0xd315('0x22')]){return _0x359793;}else{var _0x34fe6a=_['cloneDeep'](_0x1b7c80);if(_0x212e8c[_0xd315('0x2c')]){var _0x88adde={};_0x88adde[_0x212e8c[_0xd315('0x2c')]]=_0x9669e3;_['merge'](_0x34fe6a[_0xd315('0x2e')],_0x88adde);}return _0x3e17fb[_0xd315('0x1c')]('Contact')[_0xd315('0x20')](_0x34fe6a,_0x68b560)['then'](function(_0x572561){if(_0x572561&&_0x572561[_0xd315('0x22')]){return _0x572561;}else{var _0x59c516=_[_0xd315('0x2b')](_0x1b7c80);if(_0x212e8c['additionalSearchLead']){var _0x1f925b={};_0x1f925b[_0x212e8c[_0xd315('0x30')]]=_0x9669e3;_[_0xd315('0x2d')](_0x59c516[_0xd315('0x2e')],_0x1f925b);}return _0x3e17fb[_0xd315('0x1c')]('Lead')[_0xd315('0x20')](_0x59c516,_0x68b560);}});}});case _0xd315('0x11'):var _0x2038d5=_[_0xd315('0x2b')](_0x1b7c80);if(_0x212e8c[_0xd315('0x2c')]){var _0x12f4ae={};_0x12f4ae[_0x212e8c['additionalSearchContact']]=_0x9669e3;_[_0xd315('0x2d')](_0x2038d5[_0xd315('0x2e')],_0x12f4ae);}return _0x3e17fb[_0xd315('0x1c')]('Contact')[_0xd315('0x20')](_0x2038d5,_0x68b560)[_0xd315('0x34')]();case _0xd315('0x18'):var _0x5cc689=_['cloneDeep'](_0x1b7c80);if(_0x212e8c[_0xd315('0x30')]){var _0x12f4ae={};_0x12f4ae[_0x212e8c[_0xd315('0x30')]]=_0x9669e3;_[_0xd315('0x2d')](_0x5cc689['$or'],_0x12f4ae);}return _0x3e17fb['sobject'](_0xd315('0x31'))[_0xd315('0x20')](_0x5cc689,_0x68b560);case _0xd315('0x13'):var _0x1087ca=_[_0xd315('0x2b')](_0x1b7c80);if(_0x212e8c[_0xd315('0x32')]){var _0x12f4ae={};_0x12f4ae[_0x212e8c[_0xd315('0x32')]]=_0x9669e3;_['merge'](_0x1087ca['$or'],_0x12f4ae);}return _0x3e17fb[_0xd315('0x1c')]('Account')[_0xd315('0x20')](_0x1087ca,_0x68b560);default:return null;}})[_0xd315('0x21')](function(_0x59db69){if(_0x59db69&&_0x59db69[_0xd315('0x22')]){var _0xbe9048=_[_0xd315('0x35')](_0x59db69);if(_0xbe9048){return BPromise[_0xd315('0x25')]({'id':_0xbe9048['Id'],'name':_0xbe9048[_0xd315('0x26')],'phone':_0xbe9048[_0xd315('0x36')],'endUserType':_0xbe9048[_0xd315('0x37')][_0xd315('0x38')]['toLowerCase']()});}}})[_0xd315('0x21')](function(_0x36e52a){if(_0x36e52a){logger['info'](_0xd315('0x39'),_0x36e52a['endUserType'],_0x9669e3);return BPromise['resolve'](_0x36e52a);}else{logger[_0xd315('0x1a')](_0xd315('0x3a'),_0x9669e3);var _0x5b5dd8={'Phone':_0x9669e3};if(_0x212e8c[_0xd315('0x3b')]){if(_0x212e8c[_0xd315('0x3b')]==='contact'){logger[_0xd315('0x1a')](_0xd315('0x3c'),_0x9669e3,_0x212e8c[_0xd315('0x3b')]);_0x5b5dd8[_0xd315('0x3d')]=_0x45eb1c!==_0xd315('0x3e')?_0x45eb1c:util[_0xd315('0x3f')](_0xd315('0x40'),_0x9669e3);}else if(_0x212e8c['moduleCreate']===_0xd315('0x18')){logger['info'](_0xd315('0x3c'),_0x9669e3,_0x212e8c[_0xd315('0x3b')]);_0x5b5dd8['LastName']=_0x45eb1c!==_0xd315('0x3e')?_0x45eb1c:util[_0xd315('0x3f')]('Caller\x20-\x20%s',_0x9669e3);_0x5b5dd8[_0xd315('0x41')]=_0xd315('0x42');}else if(_0x212e8c[_0xd315('0x3b')]==='account'){logger[_0xd315('0x1a')](_0xd315('0x3c'),_0x9669e3,_0x212e8c[_0xd315('0x3b')]);_0x5b5dd8[_0xd315('0x26')]=_0x45eb1c!==_0xd315('0x3e')?_0x45eb1c:util['format'](_0xd315('0x40'),_0x9669e3);}else{return null;}}return _0x3e17fb[_0xd315('0x1c')](_[_0xd315('0x43')](_0x212e8c[_0xd315('0x3b')]))[_0xd315('0x1d')](_0x5b5dd8)[_0xd315('0x21')](function(_0x43af0d){return BPromise['resolve']({'id':_0x43af0d['id'],'endUserType':_0x212e8c[_0xd315('0x3b')]});});}});}function getCustomFields(_0x1b8d90,_0x512030){var _0x47e6fb={};if(_0x1b8d90[_0xd315('0x22')]>0x0){_[_0xd315('0x44')](_0x1b8d90,function(_0x187050){if(_[_0xd315('0x45')]([_0xd315('0x46'),_0xd315('0x47')],_0x187050[_0xd315('0x38')])&&_0x187050['idField']){_0x47e6fb[_0x187050[_0xd315('0x48')]]=_0x187050['content']['toString']();}else if(_0x187050[_0xd315('0x38')]===_0xd315('0x49')&&_0x187050['variableName']&&_0x187050['idField']){_0x512030[_0x187050['variableName']]&&(_0x47e6fb[_0x187050[_0xd315('0x48')]]=_0x512030[_0x187050[_0xd315('0x4a')]][_0xd315('0x4b')]());}else if(_0x187050[_0xd315('0x38')]===_0xd315('0x4c')&&_0x187050['Variable']&&_0x187050['Variable']['name']&&_0x187050[_0xd315('0x48')]){_0x512030[_0x187050[_0xd315('0x4d')][_0xd315('0x4e')]['toLowerCase']()]&&(_0x47e6fb[_0x187050['idField']]=_0x512030[_0x187050['Variable'][_0xd315('0x4e')]['toLowerCase']()][_0xd315('0x4b')]());}});}return _0x47e6fb;}function getConnection(_0x50127c){var _0x1c4011=_0x50127c[_0xd315('0x4f')][_0xd315('0x50')](_0x50127c['securityToken']);var _0x5c7bd8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x50127c[_0xd315('0x51')]||_0xd315('0x52'),'clientId':_0x50127c[_0xd315('0x53')],'clientSecret':_0x50127c[_0xd315('0x54')]}});return _0x5c7bd8['login'](_0x50127c[_0xd315('0x55')],_0x1c4011)[_0xd315('0x21')](function(){logger[_0xd315('0x1a')](_0xd315('0x56'));return _0x5c7bd8;});}exports[_0xd315('0x57')]=function(_0x1edcb3,_0x35512a,_0x2f2efe,_0x340e92,_0x5aca86,_0x459506){var _0x4b7fc5,_0x21a761,_0x16a045,_0x47667f;_0x459506['serverUrl']=intUtil[_0xd315('0x58')](_0x459506['serverUrl']);_0x459506[_0xd315('0x51')]=intUtil[_0xd315('0x58')](_0x459506['remoteUri']);if(_0x5aca86&&_0x5aca86['monitor_format']){logger[_0xd315('0x1a')](_0xd315('0x59'),_0xd315('0x5a'));_0x35512a[_0xd315('0x5b')]=util[_0xd315('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x459506[_0xd315('0x5c')],_0x35512a[_0xd315('0x5d')],md5(_0x35512a[_0xd315('0x5d')]));}else{_0x35512a[_0xd315('0x5b')]='';}return getConnection(_0x459506)[_0xd315('0x21')](function(_0x129eb4){_0x47667f=_0x129eb4;return getUser(_0x459506,_0x340e92[_0xd315('0x5e')],_0x47667f);})[_0xd315('0x21')](function(_0x137f47){_0x4b7fc5=_0x137f47;return getEndUser(_0x459506,_0x2f2efe,_0x35512a['calleridname'],_0x35512a[_0xd315('0x5f')],_0x47667f);})[_0xd315('0x21')](function(_0x40b555){_0x21a761=_0x40b555;return getTicket(_0x459506,_0x4b7fc5,_0x21a761,_0x2f2efe,_0x35512a,_0x2f2efe['Fields'],_0x47667f,_0xd315('0x57'));})[_0xd315('0x21')](function(_0x342988){_0x16a045=_0x342988;logger[_0xd315('0x1a')](_0xd315('0x60'),_0x16a045['id']);logger[_0xd315('0x1a')](_0xd315('0x61'),_0x16a045['id'],_0x340e92[_0xd315('0x4e')],_0x459506[_0xd315('0x38')]);switch(_0x459506[_0xd315('0x38')]){case _0xd315('0x62'):emit(util[_0xd315('0x3f')](_0xd315('0x63'),_0x340e92['name']),_0xd315('0x64'),{'recordId':_0x16a045['id']});break;case'newTab':emit(util['format']('user:%s',_0x340e92['name']),_0xd315('0x65'),{'uri':util[_0xd315('0x3f')](_0xd315('0x66'),_0x47667f['instanceUrl'],_0x16a045['id'])});break;default:logger['error'](_0xd315('0x67'));}})[_0xd315('0x68')](function(_0x19fc5c){logger[_0xd315('0x69')](_0xd315('0x59'),_0x19fc5c);});};exports[_0xd315('0x6a')]=function(_0x4ffb39,_0x43cf63,_0x55d40e,_0x457537,_0x4b5d26,_0x209a2d,_0x37c7f1){var _0x587752,_0x2e99ad,_0x8185a8,_0x57aa9b;_0x209a2d[_0xd315('0x5c')]=intUtil['stripTrailingSlash'](_0x209a2d['serverUrl']);_0x209a2d['remoteUri']=intUtil['stripTrailingSlash'](_0x209a2d[_0xd315('0x51')]);if(_0x37c7f1&&_0x37c7f1['recordingFormat']&&_0x37c7f1['recordingFormat']!==_0xd315('0x6b')){logger[_0xd315('0x1a')]('[OUTBOUND]',_0xd315('0x5a'));_0x43cf63['recordingURL']=util['format'](_0xd315('0x6c'),_0x209a2d[_0xd315('0x5c')],_0x43cf63[_0xd315('0x5d')],md5(_0x43cf63[_0xd315('0x5d')]));}return getConnection(_0x209a2d)['then'](function(_0x22eb70){_0x57aa9b=_0x22eb70;return getUser(_0x209a2d,_0x457537['email'],_0x57aa9b);})[_0xd315('0x21')](function(_0x7b706d){_0x587752=_0x7b706d;return getEndUser(_0x209a2d,_0x55d40e,_0x43cf63[_0xd315('0x6d')],_0x43cf63[_0xd315('0x6e')],_0x57aa9b);})[_0xd315('0x21')](function(_0x485756){_0x2e99ad=_0x485756;return getTicket(_0x209a2d,_0x587752,_0x2e99ad,_0x55d40e,_0x43cf63,_0x55d40e['Fields'],_0x57aa9b,'outbound');})[_0xd315('0x21')](function(_0x28d662){_0x8185a8=_0x28d662;logger[_0xd315('0x1a')](_0xd315('0x6f'),_0x8185a8['id']);logger['info'](_0xd315('0x70'),_0x8185a8['id'],_0x457537[_0xd315('0x4e')],_0x209a2d['type']);switch(_0x209a2d[_0xd315('0x38')]){case'integrationTab':emit(util[_0xd315('0x3f')](_0xd315('0x63'),_0x457537[_0xd315('0x4e')]),_0xd315('0x64'),{'recordId':_0x8185a8['id']});break;case _0xd315('0x71'):emit(util[_0xd315('0x3f')]('user:%s',_0x457537[_0xd315('0x4e')]),_0xd315('0x65'),{'uri':util[_0xd315('0x3f')](_0xd315('0x66'),_0x57aa9b[_0xd315('0x72')],_0x8185a8['id'])});break;default:logger['error'](_0xd315('0x73'),_0xd315('0x74'));}})[_0xd315('0x68')](function(_0x50721a){logger[_0xd315('0x69')](_0xd315('0x73'),_0x50721a);});};exports[_0xd315('0x75')]=function(_0x10a13f,_0x35ba30,_0x48dd8b,_0x2217af,_0x1286b2,_0x1fff45){var _0x277169,_0x4b657f,_0x25ba40,_0x559e49;_0x1fff45['serverUrl']=intUtil[_0xd315('0x58')](_0x1fff45[_0xd315('0x5c')]);_0x1fff45[_0xd315('0x51')]=intUtil[_0xd315('0x58')](_0x1fff45[_0xd315('0x51')]);if(_0x1286b2&&_0x1286b2[_0xd315('0x76')]){logger['info']('['+_0x35ba30[_0xd315('0x77')][_0xd315('0x78')]()+']',_0xd315('0x5a'));_0x35ba30[_0xd315('0x5b')]=util[_0xd315('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1fff45[_0xd315('0x5c')],_0x35ba30[_0xd315('0x5d')],md5(_0x35ba30[_0xd315('0x5d')]));}else{_0x35ba30[_0xd315('0x5b')]='';}return getConnection(_0x1fff45)[_0xd315('0x21')](function(_0x5f3af6){_0x559e49=_0x5f3af6;if(!_['isNil'](_0x2217af)){return getUser(_0x1fff45,_0x2217af['name'],_0x559e49);}else{return getUser(_0x1fff45,null,_0x559e49);}})[_0xd315('0x21')](function(_0x33e8ff){_0x277169=_0x33e8ff;return getEndUser(_0x1fff45,_0x48dd8b,_0x35ba30[_0xd315('0x79')],_0x35ba30['calleridnum'],_0x559e49);})['then'](function(_0x50aede){_0x4b657f=_0x50aede;return getTicket(_0x1fff45,_0x277169,_0x4b657f,_0x48dd8b,_0x35ba30,_0x48dd8b[_0xd315('0x7a')],_0x559e49);})[_0xd315('0x21')](function(_0x57368c){_0x25ba40=_0x57368c;logger[_0xd315('0x1a')]('['+_0x35ba30[_0xd315('0x77')][_0xd315('0x78')]()+_0xd315('0x7b'),_0x25ba40['id']);logger[_0xd315('0x1a')]('['+_0x35ba30['lastevent'][_0xd315('0x78')]()+']\x20Integration\x20account\x20type\x20%s.',_0x1fff45[_0xd315('0x38')]);})[_0xd315('0x68')](function(_0x3b8190){logger[_0xd315('0x69')]('['+_0x35ba30[_0xd315('0x77')]['toUpperCase']()+']',_0x3b8190);});}; \ 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 bb1eb95..9e864d4 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 _0x4b36=[']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','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','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','adminEmail','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','],\x20getUser\x20crm','userId','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','type','nameField','customField','content','toString','includes','picklist','idField','toLowerCase','variable','customVariable','Variable','name'];(function(_0x23ddda,_0xd17424){var _0x5aa2db=function(_0x2e8539){while(--_0x2e8539){_0x23ddda['push'](_0x23ddda['shift']());}};_0x5aa2db(++_0xd17424);}(_0x4b36,0x11c));var _0x64b3=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x4b36[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x64b3('0x0'));var Promise=require(_0x64b3('0x1'));var rp=require(_0x64b3('0x2'));var util=require('util');var md5=require(_0x64b3('0x3'));var Redis=require(_0x64b3('0x4'));var intUtil=require(_0x64b3('0x5'));var config=require('../../../../config/environment');var logger=require(_0x64b3('0x6'))(_0x64b3('0x7'));config['redis']=_[_0x64b3('0x8')](config[_0x64b3('0x9')],{'host':_0x64b3('0xa'),'port':0x18eb});var io=require(_0x64b3('0xb'))(new Redis(config[_0x64b3('0x9')]));function getAdminUser(_0x31c86b,_0x3a0b42,_0x3f0264,_0x1aa41e,_0x3d653e,_0x4b9311){return new Promise(function(_0x4a1e82,_0x59e7e7){var _0x3946bf={'method':_0x64b3('0xc'),'uri':_0x1aa41e+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x3d653e+'&'+_0x4b9311,'auth':_0x3a0b42,'json':!![]};return rp(_0x3946bf)[_0x64b3('0xd')](function(_0x329a81){if(_0x329a81[_0x64b3('0xe')][_0x64b3('0xf')]>0x0){_0x3f0264[_0x64b3('0x10')]=_0x329a81[_0x64b3('0xe')][0x0][_0x64b3('0x11')];}logger[_0x64b3('0x12')]('['+[_0x31c86b[_0x64b3('0x13')]()]+'],\x20getAdminUser\x20crm',_0x3f0264);_0x4a1e82(_0x3f0264);})[_0x64b3('0x14')](function(_0x10565e){logger[_0x64b3('0x15')]('['+[_0x31c86b[_0x64b3('0x13')]()]+']',_0x10565e[_0x64b3('0x16')]);_0x59e7e7(_0x10565e[_0x64b3('0x16')]);});});}function getUser(_0x1a1271,_0x46a01b,_0x28bd14,_0x424bc5,_0x921418){return function(_0x58f4b8){logger['info']('['+[_0x1a1271[_0x64b3('0x13')]()]+_0x64b3('0x17'),_0x58f4b8);return new Promise(function(_0x244002,_0x1f1dee){if(intUtil['validateEmail'](_0x58f4b8[_0x64b3('0x18')])){var _0x45f3bc={'method':_0x64b3('0xc'),'uri':_0x28bd14+_0x64b3('0x19')+_0x58f4b8[_0x64b3('0x18')]+'&'+_0x424bc5+'&'+_0x921418,'auth':_0x46a01b,'json':!![]};logger[_0x64b3('0x12')]('['+[_0x1a1271['toUpperCase']()]+_0x64b3('0x1a'),_0x45f3bc);return rp(_0x45f3bc)[_0x64b3('0xd')](function(_0x2a6546){logger[_0x64b3('0x12')]('['+[_0x1a1271['toUpperCase']()]+'],\x20getUser\x20entity',_0x2a6546);if(_0x2a6546[_0x64b3('0xe')]['length']>0x0&&String(_0x2a6546[_0x64b3('0xe')][0x0][_0x64b3('0x1b')])===_0x64b3('0x1c')){_0x58f4b8['userId']=_0x2a6546['result'][0x0][_0x64b3('0x11')];}else{_0x58f4b8['userId']=_0x58f4b8[_0x64b3('0x10')];_0x58f4b8['userEmail']=_0x58f4b8['adminEmail'];}logger[_0x64b3('0x12')]('['+[_0x1a1271[_0x64b3('0x13')]()]+_0x64b3('0x1d'),_0x58f4b8);_0x244002(_0x58f4b8);})['catch'](function(_0x32c78a){logger['error']('['+[_0x1a1271[_0x64b3('0x13')]()]+']',_0x32c78a[_0x64b3('0x16')]);_0x1f1dee(_0x32c78a[_0x64b3('0x16')]);});}else{logger[_0x64b3('0x12')]('['+[_0x1a1271[_0x64b3('0x13')]()]+']\x20using\x20admin\x20profile');_0x58f4b8[_0x64b3('0x1e')]=_0x58f4b8[_0x64b3('0x10')];_0x58f4b8['userEmail']=_0x58f4b8['adminEmail'];_0x244002(_0x58f4b8);}});};}function createEndUser(_0x3caa19,_0x46baa5,_0x289d25,_0x29e11b,_0x29c289){logger[_0x64b3('0x12')]('['+[_0x3caa19[_0x64b3('0x13')]()]+_0x64b3('0x1f'),_0x289d25);return new Promise(function(_0x47820c,_0x2d3b33){var _0x1510d4={'method':'POST','uri':_0x29e11b+_0x64b3('0x20')+_0x29c289,'body':{'user_name':_0x289d25[_0x64b3('0x21')],'roles':_0x64b3('0x22'),'first_name':_0x289d25[_0x64b3('0x21')],'active':'true','date_format':_0x64b3('0x23'),'phone':_0x289d25['endUserNumber']},'auth':_0x46baa5,'json':!![]};return rp(_0x1510d4)[_0x64b3('0xd')](function(_0x351da3){logger[_0x64b3('0x12')]('['+[_0x3caa19['toUpperCase']()]+'],\x20EndUser\x20schema',_0x351da3['result']);_0x289d25[_0x64b3('0x24')]=_0x351da3[_0x64b3('0xe')][_0x64b3('0x11')];_0x47820c(_0x289d25);})['catch'](function(_0x12e482){logger[_0x64b3('0x15')]('['+[_0x3caa19[_0x64b3('0x13')]()]+']',_0x12e482['message']);_0x2d3b33(_0x12e482[_0x64b3('0x16')]);});});}function getEndUser(_0x198ac3,_0xacefb3,_0x4e4bc1,_0x1dc5fd,_0x484a6b){return function(_0x28b60b){logger[_0x64b3('0x12')]('['+[_0x198ac3[_0x64b3('0x13')]()]+_0x64b3('0x25'),_0x28b60b);return new Promise(function(_0x26c70f,_0x5b9bf6){var _0x670b61={'method':_0x64b3('0xc'),'uri':_0x4e4bc1+_0x64b3('0x26')+_0x28b60b[_0x64b3('0x21')]+'&'+_0x1dc5fd+'&'+_0x484a6b,'auth':_0xacefb3,'json':!![]};return rp(_0x670b61)[_0x64b3('0xd')](function(_0x51323b){if(_0x51323b[_0x64b3('0xe')][_0x64b3('0xf')]>0x0){_0x28b60b['endUserId']=_0x51323b[_0x64b3('0xe')][0x0][_0x64b3('0x11')];logger[_0x64b3('0x12')]('['+[_0x198ac3[_0x64b3('0x13')]()]+_0x64b3('0x27'),_0x28b60b);_0x26c70f(_0x28b60b);}else{return createEndUser(_0x198ac3,_0xacefb3,_0x28b60b,_0x4e4bc1,_0x1dc5fd)['then'](function(_0x374ff9){logger[_0x64b3('0x12')]('['+[_0x198ac3['toUpperCase']()]+_0x64b3('0x28'),_0x374ff9);_0x26c70f(_0x374ff9);});}})[_0x64b3('0x14')](function(_0x4d7521){logger[_0x64b3('0x15')]('['+[_0x198ac3[_0x64b3('0x13')]()]+']',_0x4d7521['message']);_0x5b9bf6(_0x4d7521[_0x64b3('0x16')]);});});};}function getCustomFields(_0x114995,_0x3fc49e){var _0x205e93={};if(_0x114995[_0x64b3('0xf')]>0x0){_['forEach'](_0x114995,function(_0xc0fab){if(_['includes']([_0x64b3('0x29'),'picklist'],_0xc0fab[_0x64b3('0x2a')])&&_0xc0fab[_0x64b3('0x2b')]&&!_0xc0fab[_0x64b3('0x2c')]){_0x205e93[_0xc0fab[_0x64b3('0x2b')]['toLowerCase']()]=_0xc0fab[_0x64b3('0x2d')][_0x64b3('0x2e')]();}else if(_[_0x64b3('0x2f')]([_0x64b3('0x29'),_0x64b3('0x30')],_0xc0fab[_0x64b3('0x2a')])&&_0xc0fab[_0x64b3('0x31')]&&_0xc0fab[_0x64b3('0x2c')]){_0x205e93[_0xc0fab['idField'][_0x64b3('0x32')]()]=_0xc0fab['content']['toString']();}else if(_0xc0fab[_0x64b3('0x2a')]===_0x64b3('0x33')&&_0xc0fab['variableName']&&_0xc0fab[_0x64b3('0x31')]&&_0xc0fab[_0x64b3('0x2c')]){_0x205e93[_0xc0fab[_0x64b3('0x31')][_0x64b3('0x32')]()]=_0x3fc49e[_0xc0fab['variableName']][_0x64b3('0x2e')]();}else if(_0xc0fab[_0x64b3('0x2a')]===_0x64b3('0x34')&&_0xc0fab[_0x64b3('0x35')]&&_0xc0fab[_0x64b3('0x35')][_0x64b3('0x36')]&&_0xc0fab[_0x64b3('0x31')]&&_0xc0fab[_0x64b3('0x2c')]){_0x205e93[_0xc0fab[_0x64b3('0x31')][_0x64b3('0x32')]()]=_0x3fc49e[_0xc0fab['Variable'][_0x64b3('0x36')][_0x64b3('0x32')]()][_0x64b3('0x2e')]();}});}return _0x205e93;}function getTicket(_0x5f1966,_0xb4fee3,_0x35007e,_0x513fa2,_0x456c14,_0x573704){return function(_0x2f19ed){logger[_0x64b3('0x12')]('['+[_0x5f1966[_0x64b3('0x13')]()]+_0x64b3('0x37'),_0x2f19ed);return new Promise(function(_0x45d243,_0x7e21bc){var _0x6d993e=_0x5f1966[_0x64b3('0x32')]()===_0x64b3('0x38')?_0x2f19ed[_0x64b3('0x1e')]:_0x2f19ed[_0x64b3('0x24')];var _0x465124={'method':_0x64b3('0x39'),'uri':_0x35007e+_0x64b3('0x3a')+'?'+_0x573704,'body':Object[_0x64b3('0x3b')]({},{'active':_0x64b3('0x1c'),'caller_id':_0x6d993e,'assigned_to':_0x2f19ed[_0x64b3('0x1e')],'short_description':intUtil[_0x64b3('0x3c')](_0x513fa2[_0x64b3('0x3d')],_0x456c14,'\x20'),'description':intUtil[_0x64b3('0x3c')](_0x513fa2[_0x64b3('0x3e')],_0x456c14,'\x0a')},getCustomFields(_0x513fa2['Fields'],_0x456c14)),'auth':_0xb4fee3,'json':!![]};return rp(_0x465124)[_0x64b3('0xd')](function(_0x2851bb){logger['info']('['+[_0x5f1966[_0x64b3('0x13')]()]+_0x64b3('0x3f'),_0x2851bb[_0x64b3('0xe')]);_0x2f19ed[_0x64b3('0x40')]=_0x2851bb[_0x64b3('0xe')][_0x64b3('0x11')];_0x2f19ed[_0x64b3('0x41')]=_0x2851bb[_0x64b3('0xe')][_0x64b3('0x42')];logger[_0x64b3('0x12')]('['+[_0x5f1966['toUpperCase']()]+']\x20getTicket\x20crm',_0x2f19ed);_0x45d243(_0x2f19ed);})[_0x64b3('0x14')](function(_0x2e8f8b){logger['error']('['+[_0x5f1966[_0x64b3('0x13')]()]+']',_0x2e8f8b[_0x64b3('0x16')]);_0x7e21bc(_0x2e8f8b['message']);});});};}function createRemoteTag(_0x43d84a,_0x547057,_0x414b10,_0xa4b66b){return new Promise(function(_0x534dc3,_0x5298c7){var _0x401902={'method':_0x64b3('0x39'),'uri':_0x414b10+_0x64b3('0x43')+'?'+_0xa4b66b,'body':{'short_description':_0x43d84a,'global':!![],'active':!![],'name':_0x43d84a},'auth':_0x547057,'json':!![]};return rp(_0x401902)[_0x64b3('0xd')](function(_0x52620d){var _0x180df9=_0x52620d[_0x64b3('0xe')][_0x64b3('0x11')];_0x534dc3(_0x180df9);});});}function getRemoteTag(_0x3839e3,_0x2c9ae6,_0x3c1557,_0x16ceb5,_0x427d77){return new Promise(function(_0xd8c50,_0x1cbcf9){var _0x4a4003={'method':_0x64b3('0xc'),'uri':_0x3c1557+_0x64b3('0x43')+_0x64b3('0x44')+_0x3839e3+'&'+_0x16ceb5,'auth':_0x2c9ae6,'json':!![]};return rp(_0x4a4003)[_0x64b3('0xd')](function(_0x49409b){if(_0x49409b[_0x64b3('0xe')][_0x64b3('0xf')]>0x0){var _0xad3d39=_0x49409b[_0x64b3('0xe')][0x0]['sys_id'];_0xd8c50(_0xad3d39);}else{return createRemoteTag(_0x3839e3,_0x2c9ae6,_0x3c1557,_0x16ceb5)['then'](function(_0x14dd2e){_0xd8c50(_0x14dd2e);});}});});}function assignTagToIncident(_0x4683fd,_0x4d1b30,_0x2b9834,_0xcd04dc,_0x434f47){return new Promise(function(_0x46be2e,_0x45b4ea){var _0x285760={'method':'POST','uri':_0x2b9834+_0x64b3('0x45')+'?'+_0x434f47,'body':{'label':_0x4683fd,'table':_0x64b3('0x3a'),'id_type':_0x64b3('0x46'),'table_key':_0xcd04dc[_0x64b3('0x40')],'title':_0x64b3('0x47')+_0xcd04dc[_0x64b3('0x41')],'id_display':_0xcd04dc['ticketNumber']},'auth':_0x4d1b30,'json':!![]};return rp(_0x285760)[_0x64b3('0xd')](function(_0x22440e){_0x46be2e();})['catch'](function(){_0x46be2e();});});}function manageTags(_0x4c8d67,_0x5ce1de,_0x657d1b,_0x4f8c1e,_0x37b292,_0xe090be,_0xf12665){return new Promise(function(_0x2c8de6,_0x26fa26){var _0x493014=[];_0x5ce1de['forEach'](function(_0x56468f){_0x493014[_0x64b3('0x48')](getRemoteTag(_0x56468f,_0x657d1b,_0x4f8c1e,_0xe090be,_0xf12665));});return Promise[_0x64b3('0x49')](_0x493014)[_0x64b3('0xd')](function(_0x2ca9cb){if(_0x2ca9cb[_0x64b3('0xf')]){logger[_0x64b3('0x12')]('['+[_0x4c8d67[_0x64b3('0x13')]()]+_0x64b3('0x4a'),_0x2ca9cb);var _0x2f71d9=[];_0x2ca9cb[_0x64b3('0x4b')](function(_0x475a59){_0x2f71d9['push'](assignTagToIncident(_0x475a59,_0x657d1b,_0x4f8c1e,_0x37b292,_0xe090be));});return Promise['all'](_0x2f71d9)[_0x64b3('0xd')](function(){_0x2c8de6();})[_0x64b3('0x14')](function(){_0x2c8de6();});}else{_0x2c8de6();}});});}function getTags(_0xaec436,_0x39b6dc,_0x40dfac,_0x903dbf,_0x3a5dc6,_0xd5824d){return function(_0x23589d){return new Promise(function(_0x2f1c3b,_0xda94e2){var _0x394573=[];var _0x5c33f8=_0x903dbf[_0x64b3('0x4c')];if(_0x5c33f8&&_0x5c33f8[_0x64b3('0xf')]>0x0){_0x394573=_[_0x64b3('0x4d')](_0x5c33f8,_0x64b3('0x36'));}if(_0x394573[_0x64b3('0xf')]>0x0){return manageTags(_0xaec436,_0x394573,_0x39b6dc,_0x40dfac,_0x23589d,_0x3a5dc6,_0xd5824d)[_0x64b3('0xd')](function(){_0x2f1c3b(_0x23589d);});}else{_0x2f1c3b(_0x23589d);}});};}function emit(_0x2bfa90,_0x37c132,_0x572a79){var _0x120f69=_0x64b3('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x64b3('0x4f')+_0x64b3('0x50');var _0x3fef2e={'uri':_0x2bfa90+_0x64b3('0x51')+_0x572a79+_0x120f69};io['to'](util[_0x64b3('0x52')](_0x64b3('0x53'),_0x37c132))[_0x64b3('0x54')](_0x64b3('0x55'),_0x3fef2e);}exports['cs']=function(_0x1b8a1d,_0x3686d2,_0x5b603b,_0x18356c,_0x4cf936,_0x4ee106,_0x15a00,_0x28b9e1){var _0x26f36f={};var _0x40f2f8={'user':_0x4ee106['username'],'pass':_0x4ee106[_0x64b3('0x56')]};var _0x27c320=_0x64b3('0x57');var _0x2e051d=_0x64b3('0x58');_0x4ee106[_0x64b3('0x59')]=intUtil[_0x64b3('0x5a')](_0x4ee106[_0x64b3('0x59')]);_0x4ee106[_0x64b3('0x5b')]=intUtil[_0x64b3('0x5a')](_0x4ee106[_0x64b3('0x5b')]);var _0x1da563=util[_0x64b3('0x52')]('%s/api/now/table/',_0x4ee106[_0x64b3('0x59')]);_0x26f36f[_0x64b3('0x18')]=!_[_0x64b3('0x5c')](_0x18356c)?_0x18356c[_0x64b3('0x5d')]:null;_0x26f36f[_0x64b3('0x5e')]=_0x4ee106['email'];_0x26f36f['endUserNumber']=_0x28b9e1[_0x64b3('0x32')]()===_0x64b3('0x38')?_0x3686d2[_0x64b3('0x5f')]:_0x3686d2[_0x64b3('0x60')];_0x26f36f[_0x64b3('0x61')]=_0x28b9e1===_0x64b3('0x62')||_0x28b9e1===_0x64b3('0x63')?_0x64b3('0x62'):_0x64b3('0x38');var _0x12657b=util[_0x64b3('0x52')](_0x64b3('0x64'),_0x4ee106['serverUrl'],_0x3686d2[_0x64b3('0x65')],md5(_0x3686d2[_0x64b3('0x65')]));if(_0x4cf936&&_0x4cf936[_0x64b3('0x66')]){logger[_0x64b3('0x12')](_0x64b3('0x67'),'Recording\x20is\x20enabled!');_0x3686d2['recordingURL']=_0x12657b;}else if(_0x15a00&&_0x15a00[_0x64b3('0x68')]&&_0x15a00[_0x64b3('0x68')]!==_0x64b3('0x69')){logger[_0x64b3('0x12')](_0x64b3('0x6a'),'Recording\x20is\x20enabled!');_0x3686d2['recordingURL']=_0x12657b;}else{_0x3686d2[_0x64b3('0x6b')]='';}return getAdminUser(_0x28b9e1,_0x40f2f8,_0x26f36f,_0x1da563,_0x2e051d,_0x27c320)[_0x64b3('0xd')](getUser(_0x28b9e1,_0x40f2f8,_0x1da563,_0x2e051d,_0x27c320))['then'](getEndUser(_0x28b9e1,_0x40f2f8,_0x1da563,_0x2e051d,_0x27c320))[_0x64b3('0xd')](getTicket(_0x28b9e1,_0x40f2f8,_0x1da563,_0x5b603b,_0x3686d2,_0x2e051d))[_0x64b3('0xd')](function(_0x2c7cf3){logger[_0x64b3('0x12')](util['format'](_0x64b3('0x6c'),_0x2c7cf3[_0x64b3('0x40')]));logger[_0x64b3('0x12')](util['format'](_0x64b3('0x6d'),_0x28b9e1));if(_0x28b9e1!==_0x64b3('0x63')){logger[_0x64b3('0x12')]('['+[_0x28b9e1['toUpperCase']()]+']',_0x64b3('0x6e'));emit(_0x4ee106['remoteUri'],_0x18356c['name'],_0x2c7cf3[_0x64b3('0x40')]);}})[_0x64b3('0x14')](function(_0x2f9208){logger[_0x64b3('0x15')]('['+[_0x28b9e1[_0x64b3('0x13')]()]+_0x64b3('0x6f'),util[_0x64b3('0x70')](_0x2f9208,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x203e=['endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','content','toString','idField','customField','toLowerCase','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','error','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user'];(function(_0x2d6138,_0x4ae654){var _0x1ee932=function(_0x556c7b){while(--_0x556c7b){_0x2d6138['push'](_0x2d6138['shift']());}};_0x1ee932(++_0x4ae654);}(_0x203e,0xac));var _0xe203=function(_0x1e71e1,_0x315b30){_0x1e71e1=_0x1e71e1-0x0;var _0x4b4fb5=_0x203e[_0x1e71e1];return _0x4b4fb5;};'use strict';var _=require(_0xe203('0x0'));var Promise=require(_0xe203('0x1'));var rp=require(_0xe203('0x2'));var util=require(_0xe203('0x3'));var md5=require(_0xe203('0x4'));var Redis=require(_0xe203('0x5'));var intUtil=require(_0xe203('0x6'));var config=require('../../../../config/environment');var logger=require(_0xe203('0x7'))(_0xe203('0x8'));config[_0xe203('0x9')]=_[_0xe203('0xa')](config[_0xe203('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe203('0xb'))(new Redis(config[_0xe203('0x9')]));function getAdminUser(_0xd546a9,_0x11b566,_0x123133,_0x300669,_0x50a8be,_0x51d940){return new Promise(function(_0x2a52bd,_0x50f370){var _0x4bd12b={'method':_0xe203('0xc'),'uri':_0x300669+_0xe203('0xd')+'&'+_0x50a8be+'&'+_0x51d940,'auth':_0x11b566,'json':!![]};return rp(_0x4bd12b)[_0xe203('0xe')](function(_0x5bc7ba){if(_0x5bc7ba[_0xe203('0xf')][_0xe203('0x10')]>0x0){_0x123133[_0xe203('0x11')]=_0x5bc7ba[_0xe203('0xf')][0x0][_0xe203('0x12')];}logger[_0xe203('0x13')]('['+[_0xd546a9[_0xe203('0x14')]()]+_0xe203('0x15'),_0x123133);_0x2a52bd(_0x123133);})[_0xe203('0x16')](function(_0x7078b2){logger['error']('['+[_0xd546a9['toUpperCase']()]+']',_0x7078b2[_0xe203('0x17')]);_0x50f370(_0x7078b2[_0xe203('0x17')]);});});}function getUser(_0x27c169,_0x704fb,_0x39be63,_0x179238,_0x1b2003){return function(_0x4ed0dc){logger['info']('['+[_0x27c169[_0xe203('0x14')]()]+'],\x20getUser\x20input\x20crm',_0x4ed0dc);return new Promise(function(_0x26f042,_0x555dc5){if(intUtil[_0xe203('0x18')](_0x4ed0dc[_0xe203('0x19')])){var _0x2e68c6={'method':'GET','uri':_0x39be63+_0xe203('0x1a')+_0x4ed0dc[_0xe203('0x19')]+'&'+_0x179238+'&'+_0x1b2003,'auth':_0x704fb,'json':!![]};logger[_0xe203('0x13')]('['+[_0x27c169['toUpperCase']()]+_0xe203('0x1b'),_0x2e68c6);return rp(_0x2e68c6)['then'](function(_0x13d156){logger[_0xe203('0x13')]('['+[_0x27c169[_0xe203('0x14')]()]+_0xe203('0x1c'),_0x13d156);if(_0x13d156[_0xe203('0xf')][_0xe203('0x10')]>0x0&&String(_0x13d156[_0xe203('0xf')][0x0][_0xe203('0x1d')])===_0xe203('0x1e')){_0x4ed0dc['userId']=_0x13d156[_0xe203('0xf')][0x0][_0xe203('0x12')];}else{_0x4ed0dc[_0xe203('0x1f')]=_0x4ed0dc[_0xe203('0x11')];_0x4ed0dc[_0xe203('0x19')]=_0x4ed0dc[_0xe203('0x20')];}logger[_0xe203('0x13')]('['+[_0x27c169['toUpperCase']()]+_0xe203('0x21'),_0x4ed0dc);_0x26f042(_0x4ed0dc);})[_0xe203('0x16')](function(_0x365373){logger[_0xe203('0x22')]('['+[_0x27c169[_0xe203('0x14')]()]+']',_0x365373[_0xe203('0x17')]);_0x555dc5(_0x365373[_0xe203('0x17')]);});}else{logger[_0xe203('0x13')]('['+[_0x27c169[_0xe203('0x14')]()]+']\x20using\x20admin\x20profile');_0x4ed0dc[_0xe203('0x1f')]=_0x4ed0dc['adminId'];_0x4ed0dc['userEmail']=_0x4ed0dc['adminEmail'];_0x26f042(_0x4ed0dc);}});};}function createEndUser(_0x390e9f,_0x5780a4,_0x3b5f2d,_0x10e25a,_0x308b97){logger[_0xe203('0x13')]('['+[_0x390e9f[_0xe203('0x14')]()]+_0xe203('0x23'),_0x3b5f2d);return new Promise(function(_0x4f300d,_0x182a30){var _0x1e4153={'method':_0xe203('0x24'),'uri':_0x10e25a+_0xe203('0x25')+_0x308b97,'body':{'user_name':_0x3b5f2d[_0xe203('0x26')],'roles':_0xe203('0x27'),'first_name':_0x3b5f2d[_0xe203('0x26')],'active':_0xe203('0x1e'),'date_format':'System','phone':_0x3b5f2d['endUserNumber']},'auth':_0x5780a4,'json':!![]};return rp(_0x1e4153)['then'](function(_0x39f999){logger[_0xe203('0x13')]('['+[_0x390e9f[_0xe203('0x14')]()]+'],\x20EndUser\x20schema',_0x39f999[_0xe203('0xf')]);_0x3b5f2d[_0xe203('0x28')]=_0x39f999[_0xe203('0xf')][_0xe203('0x12')];_0x4f300d(_0x3b5f2d);})[_0xe203('0x16')](function(_0x1fda43){logger[_0xe203('0x22')]('['+[_0x390e9f['toUpperCase']()]+']',_0x1fda43[_0xe203('0x17')]);_0x182a30(_0x1fda43[_0xe203('0x17')]);});});}function getEndUser(_0x4e07cd,_0xc3c24b,_0x187074,_0x502c8f,_0x4fda0f){return function(_0x3521b0){logger['info']('['+[_0x4e07cd[_0xe203('0x14')]()]+'],\x20getEndUser\x20input\x20crm',_0x3521b0);return new Promise(function(_0x4ecd78,_0x1a00a7){var _0x4151f1={'method':_0xe203('0xc'),'uri':_0x187074+_0xe203('0x29')+_0x3521b0['endUserNumber']+'&'+_0x502c8f+'&'+_0x4fda0f,'auth':_0xc3c24b,'json':!![]};return rp(_0x4151f1)['then'](function(_0x5555e5){if(_0x5555e5['result'][_0xe203('0x10')]>0x0){_0x3521b0[_0xe203('0x28')]=_0x5555e5[_0xe203('0xf')][0x0][_0xe203('0x12')];logger['info']('['+[_0x4e07cd[_0xe203('0x14')]()]+_0xe203('0x2a'),_0x3521b0);_0x4ecd78(_0x3521b0);}else{return createEndUser(_0x4e07cd,_0xc3c24b,_0x3521b0,_0x187074,_0x502c8f)['then'](function(_0x275e23){logger[_0xe203('0x13')]('['+[_0x4e07cd[_0xe203('0x14')]()]+_0xe203('0x2b'),_0x275e23);_0x4ecd78(_0x275e23);});}})[_0xe203('0x16')](function(_0x1e3c41){logger[_0xe203('0x22')]('['+[_0x4e07cd[_0xe203('0x14')]()]+']',_0x1e3c41['message']);_0x1a00a7(_0x1e3c41[_0xe203('0x17')]);});});};}function getCustomFields(_0x247973,_0x463751){var _0x3a5c4a={};if(_0x247973[_0xe203('0x10')]>0x0){_[_0xe203('0x2c')](_0x247973,function(_0x5f5065){if(_[_0xe203('0x2d')]([_0xe203('0x2e'),_0xe203('0x2f')],_0x5f5065[_0xe203('0x30')])&&_0x5f5065[_0xe203('0x31')]&&!_0x5f5065['customField']){_0x3a5c4a[_0x5f5065[_0xe203('0x31')]['toLowerCase']()]=_0x5f5065[_0xe203('0x32')][_0xe203('0x33')]();}else if(_[_0xe203('0x2d')](['string',_0xe203('0x2f')],_0x5f5065[_0xe203('0x30')])&&_0x5f5065[_0xe203('0x34')]&&_0x5f5065[_0xe203('0x35')]){_0x3a5c4a[_0x5f5065[_0xe203('0x34')][_0xe203('0x36')]()]=_0x5f5065[_0xe203('0x32')][_0xe203('0x33')]();}else if(_0x5f5065[_0xe203('0x30')]==='variable'&&_0x5f5065[_0xe203('0x37')]&&_0x5f5065[_0xe203('0x34')]&&_0x5f5065[_0xe203('0x35')]){_0x3a5c4a[_0x5f5065[_0xe203('0x34')][_0xe203('0x36')]()]=_0x463751[_0x5f5065[_0xe203('0x37')]][_0xe203('0x33')]();}else if(_0x5f5065['type']===_0xe203('0x38')&&_0x5f5065[_0xe203('0x39')]&&_0x5f5065[_0xe203('0x39')][_0xe203('0x3a')]&&_0x5f5065[_0xe203('0x34')]&&_0x5f5065['customField']){_0x3a5c4a[_0x5f5065[_0xe203('0x34')][_0xe203('0x36')]()]=_0x463751[_0x5f5065[_0xe203('0x39')]['name'][_0xe203('0x36')]()][_0xe203('0x33')]();}});}return _0x3a5c4a;}function getTicket(_0x40e09e,_0x3a7064,_0x2b1bca,_0x4bbfb1,_0x476e60,_0xfc5b8d){return function(_0x4083d2){logger[_0xe203('0x13')]('['+[_0x40e09e['toUpperCase']()]+_0xe203('0x3b'),_0x4083d2);return new Promise(function(_0x38829e,_0x2dfda9){var _0x56acd8=_0x40e09e[_0xe203('0x36')]()===_0xe203('0x3c')?_0x4083d2['userId']:_0x4083d2['endUserId'];var _0x56e6c4={'method':_0xe203('0x24'),'uri':_0x2b1bca+_0xe203('0x3d')+'?'+_0xfc5b8d,'body':Object[_0xe203('0x3e')]({},{'active':_0xe203('0x1e'),'caller_id':_0x56acd8,'assigned_to':_0x4083d2[_0xe203('0x1f')],'short_description':intUtil[_0xe203('0x3f')](_0x4bbfb1[_0xe203('0x40')],_0x476e60,'\x20'),'description':intUtil[_0xe203('0x3f')](_0x4bbfb1[_0xe203('0x41')],_0x476e60,'\x0a')},getCustomFields(_0x4bbfb1[_0xe203('0x42')],_0x476e60)),'auth':_0x3a7064,'json':!![]};return rp(_0x56e6c4)['then'](function(_0x18e7b1){logger[_0xe203('0x13')]('['+[_0x40e09e['toUpperCase']()]+_0xe203('0x43'),_0x18e7b1['result']);_0x4083d2[_0xe203('0x44')]=_0x18e7b1[_0xe203('0xf')]['sys_id'];_0x4083d2[_0xe203('0x45')]=_0x18e7b1[_0xe203('0xf')][_0xe203('0x46')];logger[_0xe203('0x13')]('['+[_0x40e09e[_0xe203('0x14')]()]+_0xe203('0x47'),_0x4083d2);_0x38829e(_0x4083d2);})[_0xe203('0x16')](function(_0x246200){logger[_0xe203('0x22')]('['+[_0x40e09e[_0xe203('0x14')]()]+']',_0x246200['message']);_0x2dfda9(_0x246200[_0xe203('0x17')]);});});};}function createRemoteTag(_0x37f1d9,_0x531dc9,_0x45fc74,_0x3669ba){return new Promise(function(_0x449c44,_0x3ecdad){var _0x6eae0={'method':'POST','uri':_0x45fc74+_0xe203('0x48')+'?'+_0x3669ba,'body':{'short_description':_0x37f1d9,'global':!![],'active':!![],'name':_0x37f1d9},'auth':_0x531dc9,'json':!![]};return rp(_0x6eae0)['then'](function(_0xc17366){var _0x5a32bc=_0xc17366['result'][_0xe203('0x12')];_0x449c44(_0x5a32bc);});});}function getRemoteTag(_0xa5cc6f,_0x1b83cf,_0x5bd5ca,_0x19915f,_0x1fc625){return new Promise(function(_0xeb72d6,_0x4b1820){var _0xe2bfee={'method':'GET','uri':_0x5bd5ca+_0xe203('0x48')+_0xe203('0x49')+_0xa5cc6f+'&'+_0x19915f,'auth':_0x1b83cf,'json':!![]};return rp(_0xe2bfee)[_0xe203('0xe')](function(_0x59a5c3){if(_0x59a5c3['result'][_0xe203('0x10')]>0x0){var _0x65ace5=_0x59a5c3[_0xe203('0xf')][0x0][_0xe203('0x12')];_0xeb72d6(_0x65ace5);}else{return createRemoteTag(_0xa5cc6f,_0x1b83cf,_0x5bd5ca,_0x19915f)['then'](function(_0x3b3c64){_0xeb72d6(_0x3b3c64);});}});});}function assignTagToIncident(_0x179a6f,_0x59df0f,_0xa71d6c,_0x54073f,_0x2d3213){return new Promise(function(_0x5f10da,_0x20ccbc){var _0x15e061={'method':_0xe203('0x24'),'uri':_0xa71d6c+'label_entry'+'?'+_0x2d3213,'body':{'label':_0x179a6f,'table':_0xe203('0x3d'),'id_type':_0xe203('0x4a'),'table_key':_0x54073f[_0xe203('0x44')],'title':_0xe203('0x4b')+_0x54073f[_0xe203('0x45')],'id_display':_0x54073f[_0xe203('0x45')]},'auth':_0x59df0f,'json':!![]};return rp(_0x15e061)['then'](function(_0x16151e){_0x5f10da();})[_0xe203('0x16')](function(){_0x5f10da();});});}function manageTags(_0xd58fbd,_0x2df3e7,_0x1e2a34,_0x39016e,_0x246125,_0x4d009c,_0x5d9597){return new Promise(function(_0x2b1e62,_0x410ef6){var _0x4a6952=[];_0x2df3e7[_0xe203('0x2c')](function(_0x104d62){_0x4a6952[_0xe203('0x4c')](getRemoteTag(_0x104d62,_0x1e2a34,_0x39016e,_0x4d009c,_0x5d9597));});return Promise[_0xe203('0x4d')](_0x4a6952)['then'](function(_0x288d68){if(_0x288d68[_0xe203('0x10')]){logger[_0xe203('0x13')]('['+[_0xd58fbd[_0xe203('0x14')]()]+_0xe203('0x4e'),_0x288d68);var _0x234766=[];_0x288d68[_0xe203('0x2c')](function(_0x16261d){_0x234766[_0xe203('0x4c')](assignTagToIncident(_0x16261d,_0x1e2a34,_0x39016e,_0x246125,_0x4d009c));});return Promise[_0xe203('0x4d')](_0x234766)[_0xe203('0xe')](function(){_0x2b1e62();})[_0xe203('0x16')](function(){_0x2b1e62();});}else{_0x2b1e62();}});});}function getTags(_0x407886,_0x2ce261,_0x326b5a,_0x37979c,_0xc0b62a,_0x3640d9){return function(_0x2aa93f){return new Promise(function(_0x472f50,_0x4ed978){var _0xbf7570=[];var _0x1bede9=_0x37979c[_0xe203('0x4f')];if(_0x1bede9&&_0x1bede9[_0xe203('0x10')]>0x0){_0xbf7570=_['map'](_0x1bede9,'name');}if(_0xbf7570[_0xe203('0x10')]>0x0){return manageTags(_0x407886,_0xbf7570,_0x2ce261,_0x326b5a,_0x2aa93f,_0xc0b62a,_0x3640d9)[_0xe203('0xe')](function(){_0x472f50(_0x2aa93f);});}else{_0x472f50(_0x2aa93f);}});};}function emit(_0x13db21,_0x480990,_0x38ceb5){var _0x1c907e=_0xe203('0x50')+_0xe203('0x51')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x41191f={'uri':_0x13db21+_0xe203('0x52')+_0x38ceb5+_0x1c907e};io['to'](util[_0xe203('0x53')]('user:%s',_0x480990))[_0xe203('0x54')](_0xe203('0x55'),_0x41191f);}exports['cs']=function(_0x57d557,_0x1827b5,_0x13cdd5,_0x5fce9b,_0x1de0e5,_0x4265c9,_0xb070b8,_0x394ce8){var _0x3c60b8={};var _0x28b23d={'user':_0x4265c9[_0xe203('0x56')],'pass':_0x4265c9[_0xe203('0x57')]};var _0x3a4a48=_0xe203('0x58');var _0x138a22='sysparm_display_value=true';_0x4265c9[_0xe203('0x59')]=intUtil['stripTrailingSlash'](_0x4265c9['remoteUri']);_0x4265c9['serverUrl']=intUtil[_0xe203('0x5a')](_0x4265c9[_0xe203('0x5b')]);var _0x2e10e6=util['format'](_0xe203('0x5c'),_0x4265c9[_0xe203('0x59')]);_0x3c60b8['userEmail']=!_[_0xe203('0x5d')](_0x5fce9b)?_0x5fce9b[_0xe203('0x5e')]:null;_0x3c60b8[_0xe203('0x20')]=_0x4265c9['email'];_0x3c60b8[_0xe203('0x26')]=_0x394ce8[_0xe203('0x36')]()==='outbound'?_0x1827b5['destcalleridnum']:_0x1827b5['calleridnum'];_0x3c60b8['callDirection']=_0x394ce8==='queue'||_0x394ce8==='unmanaged'?_0xe203('0x5f'):_0xe203('0x3c');var _0x12e42f=util[_0xe203('0x53')](_0xe203('0x60'),_0x4265c9[_0xe203('0x5b')],_0x1827b5[_0xe203('0x61')],md5(_0x1827b5[_0xe203('0x61')]));if(_0x1de0e5&&_0x1de0e5[_0xe203('0x62')]){logger[_0xe203('0x13')]('[QUEUE]',_0xe203('0x63'));_0x1827b5[_0xe203('0x64')]=_0x12e42f;}else if(_0xb070b8&&_0xb070b8['recordingFormat']&&_0xb070b8[_0xe203('0x65')]!==_0xe203('0x66')){logger[_0xe203('0x13')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1827b5[_0xe203('0x64')]=_0x12e42f;}else{_0x1827b5[_0xe203('0x64')]='';}return getAdminUser(_0x394ce8,_0x28b23d,_0x3c60b8,_0x2e10e6,_0x138a22,_0x3a4a48)[_0xe203('0xe')](getUser(_0x394ce8,_0x28b23d,_0x2e10e6,_0x138a22,_0x3a4a48))['then'](getEndUser(_0x394ce8,_0x28b23d,_0x2e10e6,_0x138a22,_0x3a4a48))['then'](getTicket(_0x394ce8,_0x28b23d,_0x2e10e6,_0x13cdd5,_0x1827b5,_0x138a22))['then'](function(_0x4e020b){logger[_0xe203('0x13')](util['format'](_0xe203('0x67'),_0x4e020b[_0xe203('0x44')]));logger[_0xe203('0x13')](util['format']('call\x20direction:\x20%s',_0x394ce8));if(_0x394ce8!=='unmanaged'){logger['info']('['+[_0x394ce8[_0xe203('0x14')]()]+']',_0xe203('0x68'));emit(_0x4265c9[_0xe203('0x59')],_0x5fce9b[_0xe203('0x3a')],_0x4e020b[_0xe203('0x44')]);}})['catch'](function(_0x52e38f){logger[_0xe203('0x22')]('['+[_0x394ce8[_0xe203('0x14')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xe203('0x69')](_0x52e38f,{'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 980703f..3941806 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 _0x0ff7=['uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','Ticket\x20created!','request-promise','md5','ioredis','./util','../../../../config/environment','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','description','getString','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','format','toString','base64','stringify','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','first_name','','Caller\x20-\x20%s','debug','merge','type','string','nameField','toLowerCase','content','customField','variable','custom_fields','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound'];(function(_0x43eee8,_0x341d52){var _0x4c35ef=function(_0x6d1396){while(--_0x6d1396){_0x43eee8['push'](_0x43eee8['shift']());}};_0x4c35ef(++_0x341d52);}(_0x0ff7,0xf9));var _0x70ff=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0ff7[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var rp=require(_0x70ff('0x0'));var BPromise=require('bluebird');var md5=require(_0x70ff('0x1'));var util=require('util');var Redis=require(_0x70ff('0x2'));var intUtil=require(_0x70ff('0x3'));var config=require(_0x70ff('0x4'));var logger=require('../../../../config/logger')(_0x70ff('0x5'));config[_0x70ff('0x6')]=_['defaults'](config[_0x70ff('0x6')],{'host':_0x70ff('0x7'),'port':0x18eb});var io=require(_0x70ff('0x8'))(new Redis(config[_0x70ff('0x6')]));var def={'method':_0x70ff('0x9'),'json':!![]};function emit(_0x4f0112,_0x193d20,_0x72153){io['to'](_0x4f0112)[_0x70ff('0xa')](_0x193d20,_0x72153);}function getTicket(_0x457fbd,_0x30804b,_0x543ae2,_0x737abe,_0x135952,_0x3aed13,_0x1064b6,_0x26410b){logger[_0x70ff('0xb')](_0x70ff('0xc'));var _0x388644=new Date();var _0x38c643=[{'name':'name','value':intUtil['getString'](_0x737abe[_0x70ff('0xd')],_0x135952,'\x20')},{'name':_0x70ff('0xe'),'value':_0x30804b['id']},{'name':'created_by','value':_0x30804b['id']},{'name':_0x70ff('0xf'),'value':intUtil[_0x70ff('0x10')](_0x737abe[_0x70ff('0x11')],_0x135952,'\x0a')},{'name':'date_start','value':_0x388644[_0x70ff('0x12')]()[_0x70ff('0x13')](0x0,0x13)[_0x70ff('0x14')]('T','\x20')},{'name':_0x70ff('0x15'),'value':'0'},{'name':_0x70ff('0x16'),'value':'15'},{'name':_0x70ff('0x17'),'value':_0x543ae2['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x70ff('0x18'),'value':_0x543ae2[_0x70ff('0x19')]},{'name':_0x70ff('0x1a'),'value':_0x26410b}];if(_0x3aed13[_0x70ff('0x1b')]){_[_0x70ff('0x1c')](_0x3aed13,function(_0x2e8331){if(_0x135952[_0x2e8331[_0x70ff('0x1d')]]){_0x38c643[_0x70ff('0x1e')]({'name':_0x2e8331[_0x70ff('0x1f')],'value':_0x135952[_0x2e8331['variableName']]});}});}return request({'form':{'method':_0x70ff('0x20'),'input_type':_0x70ff('0x21'),'response_type':_0x70ff('0x21'),'rest_data':JSON['stringify']({'session':_0x1064b6['id'],'module_name':'Calls','name_value_list':_0x38c643})}});}function getAuth(_0x1b1831){return util[_0x70ff('0x22')]('Basic\x20%s',new Buffer(_0x1b1831['apiKey']+':X')[_0x70ff('0x23')](_0x70ff('0x24')));}function getServerInfo(_0x5779ec){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x70ff('0x21'),'rest_data':JSON[_0x70ff('0x25')]({'session':_0x5779ec['id']})}});}function getUser(_0xe1e204,_0x59b563,_0x175204){if(!_[_0x70ff('0x26')](_0x59b563)){logger['info'](_0x70ff('0x27'),_0x59b563);return request({'form':{'method':'get_entry_list','input_type':_0x70ff('0x21'),'response_type':_0x70ff('0x21'),'rest_data':JSON[_0x70ff('0x25')]({'session':_0x175204['id'],'module_name':_0x70ff('0x28'),'query':util[_0x70ff('0x22')](_0x70ff('0x29'),_0x59b563),'order_by':'','offset':'0','select_fields':['id',_0x70ff('0x19'),_0x70ff('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x6118b0){if(_0x6118b0[_0x70ff('0x2b')]['length']){var _0x1d2d42=_[_0x70ff('0x2c')](_0x6118b0[_0x70ff('0x2b')],function(_0x23841c){return _0x23841c[_0x70ff('0x2d')]['user_name'][_0x70ff('0x2e')]===_0x59b563;});if(_0x1d2d42){logger[_0x70ff('0xb')]('Agent\x20found!');return BPromise['resolve']({'id':_0x1d2d42['name_value_list']['id'][_0x70ff('0x2e')],'name':_0x1d2d42[_0x70ff('0x2d')][_0x70ff('0x19')][_0x70ff('0x2e')]});}}logger[_0x70ff('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x70ff('0x2f')]({'id':_0x175204[_0x70ff('0x2d')][_0x70ff('0x30')][_0x70ff('0x2e')],'name':_0x175204[_0x70ff('0x2d')]['user_name']['value']});});}else{logger[_0x70ff('0xb')](_0x70ff('0x31'));return BPromise[_0x70ff('0x2f')]({'id':_0x175204[_0x70ff('0x2d')][_0x70ff('0x30')]['value'],'name':_0x175204['name_value_list'][_0x70ff('0x2a')]['value']});}}function getEndUser(_0x143f37,_0x43f0cb,_0x439af1,_0x388e6f){logger[_0x70ff('0xb')](_0x70ff('0x32'),_0x439af1);return request({'form':{'method':_0x70ff('0x33'),'input_type':_0x70ff('0x21'),'response_type':_0x70ff('0x21'),'rest_data':JSON[_0x70ff('0x25')]({'session':_0x388e6f['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x439af1),'order_by':'','offset':'0','select_fields':['id',_0x70ff('0x19'),_0x70ff('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x70ff('0x35')](function(_0x37b327){if(_0x37b327['entry_list'][_0x70ff('0x1b')]){var _0xc1b8e0=_[_0x70ff('0x2c')](_0x37b327[_0x70ff('0x2b')],function(_0x1a128b){return _0x1a128b['name_value_list'][_0x70ff('0x34')][_0x70ff('0x2e')]===_0x439af1;});if(_0xc1b8e0){logger[_0x70ff('0xb')](_0x70ff('0x36'));return BPromise[_0x70ff('0x2f')]({'id':_0xc1b8e0[_0x70ff('0x2d')]['id'][_0x70ff('0x2e')],'name':_0xc1b8e0['name_value_list'][_0x70ff('0x19')]['value'],'phone':_0xc1b8e0[_0x70ff('0x2d')][_0x70ff('0x34')][_0x70ff('0x2e')]});}}else{logger[_0x70ff('0xb')](_0x70ff('0x37'));return request({'form':{'method':_0x70ff('0x20'),'input_type':_0x70ff('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x388e6f['id'],'module_name':_0x70ff('0x38'),'name_value_list':[{'name':_0x70ff('0x39'),'value':_0x43f0cb!==_0x70ff('0x3a')?_0x43f0cb:util[_0x70ff('0x22')](_0x70ff('0x3b'),_0x439af1)},{'name':_0x70ff('0x34'),'value':_0x439af1}]})}})[_0x70ff('0x35')](function(_0x1e97c3){logger['info']('Enduser\x20created.');return BPromise[_0x70ff('0x2f')]({'id':_0x1e97c3['id'],'name':_0x1e97c3[_0x70ff('0x2b')][_0x70ff('0x39')][_0x70ff('0x2e')],'phone':_0x1e97c3[_0x70ff('0x2b')][_0x70ff('0x34')][_0x70ff('0x2e')]});});}});}function request(_0x54718b){logger[_0x70ff('0x3c')]('[HTTP]',JSON[_0x70ff('0x25')](_0x54718b));return rp(_[_0x70ff('0x3d')](def,_0x54718b));}function getTags(_0x10d8e4,_0x5cb39f){var _0x530edc=[];if(_0x10d8e4&&_0x10d8e4[_0x70ff('0x1b')]>0x0){_0x530edc=_['map'](_0x10d8e4,_0x5cb39f);}return _0x530edc;}function getCustomFields(_0x48c41d,_0x572f0e){var _0x46f1f8=[];var _0x2a41bc={'custom_fields':[]};if(_0x48c41d[_0x70ff('0x1b')]>0x0){_['forEach'](_0x48c41d,function(_0x2c8888){if(_0x2c8888[_0x70ff('0x3e')]===_0x70ff('0x3f')&&_0x2c8888[_0x70ff('0x40')]&&!_0x2c8888['customField']){_0x2a41bc[_0x2c8888[_0x70ff('0x40')][_0x70ff('0x41')]()]=_0x2c8888[_0x70ff('0x42')][_0x70ff('0x23')]();}else if(_0x2c8888[_0x70ff('0x3e')]===_0x70ff('0x3f')&&_0x2c8888[_0x70ff('0x1f')]&&_0x2c8888[_0x70ff('0x43')]){_0x2a41bc['custom_fields'][_0x70ff('0x1e')]({'id':_0x2c8888[_0x70ff('0x1f')],'value':_0x2c8888[_0x70ff('0x42')][_0x70ff('0x23')]()});}else if(_0x2c8888['type']===_0x70ff('0x44')&&_0x2c8888[_0x70ff('0x1d')]&&_0x2c8888[_0x70ff('0x1f')]&&_0x2c8888['customField']){_0x572f0e[_0x2c8888[_0x70ff('0x1d')]]&&_0x2a41bc[_0x70ff('0x45')][_0x70ff('0x1e')]({'id':_0x2c8888['idField'],'value':_0x572f0e[_0x2c8888['variableName']][_0x70ff('0x23')]()});}else if(_0x2c8888[_0x70ff('0x3e')]===_0x70ff('0x46')&&_0x2c8888[_0x70ff('0x47')]&&_0x2c8888[_0x70ff('0x47')][_0x70ff('0x19')]&&_0x2c8888[_0x70ff('0x1f')]&&_0x2c8888['customField']){_0x572f0e[_0x2c8888['Variable'][_0x70ff('0x19')][_0x70ff('0x41')]()]&&_0x2a41bc[_0x70ff('0x45')][_0x70ff('0x1e')]({'id':_0x2c8888[_0x70ff('0x1f')],'value':_0x572f0e[_0x2c8888[_0x70ff('0x47')][_0x70ff('0x19')][_0x70ff('0x41')]()][_0x70ff('0x23')]()});}});}return _0x2a41bc;}function getConnection(_0x491b23){return request({'method':_0x70ff('0x9'),'form':{'method':_0x70ff('0x48'),'input_type':_0x70ff('0x21'),'response_type':_0x70ff('0x21'),'rest_data':JSON[_0x70ff('0x25')]({'user_auth':{'user_name':_0x491b23['username'],'password':_0x491b23[_0x70ff('0x49')],'encryption':_0x70ff('0x4a')},'application':_0x70ff('0x4b')})}})[_0x70ff('0x35')](function(_0x4cdd19){var _0x36c668=_0x4cdd19;if(_0x36c668['id']){def[_0x70ff('0x4c')]=_0x36c668['id'];return BPromise['resolve'](_0x36c668);}else{throw new Error(util[_0x70ff('0x22')](_0x70ff('0x4d'),_0x491b23['id']));}});}function setRelationship(_0x22577e,_0x4cadbb,_0x1219e7,_0xe1ff9b){return request({'form':{'method':_0x70ff('0x4e'),'input_type':_0x70ff('0x21'),'response_type':_0x70ff('0x21'),'rest_data':JSON[_0x70ff('0x25')]({'session':_0x22577e['id'],'module_name':_0x70ff('0x4f'),'module_id':_0x1219e7['id'],'link_field_name':_0xe1ff9b,'related_ids':[_0x4cadbb['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x70ff('0x50')]=function(_0x534a0f,_0x2021f3,_0x568faa,_0x535f24,_0xb8cbbe,_0x5341c6){var _0x64de22,_0x546c8f,_0x2b4d97,_0x32b3e9;_0x5341c6[_0x70ff('0x51')]=intUtil[_0x70ff('0x52')](_0x5341c6[_0x70ff('0x51')]);_0x5341c6[_0x70ff('0x53')]=intUtil[_0x70ff('0x52')](_0x5341c6[_0x70ff('0x53')]);def['uri']=util[_0x70ff('0x22')](_0x70ff('0x54'),_0x5341c6['remoteUri']);if(_0xb8cbbe&&_0xb8cbbe['monitor_format']){logger[_0x70ff('0xb')](_0x70ff('0x55'),'Recording\x20is\x20enabled!');_0x2021f3[_0x70ff('0x56')]=util[_0x70ff('0x22')](_0x70ff('0x57'),_0x5341c6[_0x70ff('0x53')],_0x2021f3[_0x70ff('0x58')],md5(_0x2021f3[_0x70ff('0x58')]));}else{_0x2021f3[_0x70ff('0x56')]='';}return getConnection(_0x5341c6)[_0x70ff('0x35')](function(_0x4fc49f){_0x32b3e9=_0x4fc49f;return getUser(_0x5341c6,_0x535f24[_0x70ff('0x19')],_0x32b3e9);})[_0x70ff('0x35')](function(_0x56b7df){_0x64de22=_0x56b7df;logger[_0x70ff('0xb')](_0x70ff('0x59'),_0x64de22['id']);return getEndUser(_0x5341c6,_0x2021f3[_0x70ff('0x5a')],_0x2021f3[_0x70ff('0x5b')],_0x32b3e9);})[_0x70ff('0x35')](function(_0x4e8f51){_0x546c8f=_0x4e8f51;logger[_0x70ff('0xb')](_0x70ff('0x5c'),_0x546c8f['id']);return getTicket(_0x5341c6,_0x64de22,_0x546c8f,_0x568faa,_0x2021f3,_0x568faa[_0x70ff('0x5d')],_0x32b3e9,_0x70ff('0x5e'));})['then'](function(_0x1d4b2e){_0x2b4d97=_0x1d4b2e;logger[_0x70ff('0xb')]('Ticket\x20created!');logger['info'](_0x70ff('0x5f'),_0x2b4d97['id']);return setRelationship(_0x32b3e9,_0x64de22,_0x2b4d97,'users');})[_0x70ff('0x35')](function(){return setRelationship(_0x32b3e9,_0x546c8f,_0x2b4d97,_0x70ff('0x60'));})[_0x70ff('0x35')](function(){return getServerInfo(_0x32b3e9);})['then'](function(_0x33a040){var _0x46de15=parseInt(_0x33a040[_0x70ff('0x61')][_0x70ff('0x62')](0x0));var _0x7cf125=util[_0x70ff('0x22')](_0x70ff('0x63'),_0x5341c6[_0x70ff('0x51')],_0x2b4d97['id']);if(_0x46de15>0x6){_0x7cf125=util[_0x70ff('0x22')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5341c6[_0x70ff('0x51')],_0x2b4d97['id']);}logger['info'](_0x70ff('0x55'),_0x70ff('0x64'));emit(util[_0x70ff('0x22')](_0x70ff('0x65'),_0x535f24['name']),'trigger:browser:url',{'uri':_0x7cf125});})[_0x70ff('0x66')](function(_0x3d0b04){logger[_0x70ff('0x67')](_0x70ff('0x55'),JSON[_0x70ff('0x25')](_0x3d0b04));});};exports[_0x70ff('0x68')]=function(_0x4253a3,_0x470319,_0x53315e,_0x2cbb60,_0x22d76b,_0x2e226e,_0x23c88d){var _0x1155bb,_0x4283b7,_0x191edf,_0x163e39;_0x2e226e['remoteUri']=intUtil[_0x70ff('0x52')](_0x2e226e[_0x70ff('0x51')]);_0x2e226e['serverUrl']=intUtil[_0x70ff('0x52')](_0x2e226e[_0x70ff('0x53')]);def[_0x70ff('0x69')]=util[_0x70ff('0x22')]('%s/service/v4_1/rest.php',_0x2e226e['remoteUri']);if(_0x23c88d&&_0x23c88d[_0x70ff('0x6a')]&&_0x23c88d['recordingFormat']!==_0x70ff('0x6b')){logger[_0x70ff('0xb')](_0x70ff('0x6c'),'Recording\x20is\x20enabled!');_0x470319['recordingURL']=util[_0x70ff('0x22')](_0x70ff('0x57'),_0x2e226e['serverUrl'],_0x470319['uniqueid'],md5(_0x470319[_0x70ff('0x58')]));}return getConnection(_0x2e226e)[_0x70ff('0x35')](function(_0x5aa6e3){_0x163e39=_0x5aa6e3;return getUser(_0x2e226e,_0x2cbb60[_0x70ff('0x19')],_0x163e39);})[_0x70ff('0x35')](function(_0x29c9cb){_0x1155bb=_0x29c9cb;logger[_0x70ff('0xb')](_0x70ff('0x59'),_0x1155bb['id']);return getEndUser(_0x2e226e,_0x470319[_0x70ff('0x6d')],_0x470319[_0x70ff('0x6e')],_0x163e39);})[_0x70ff('0x35')](function(_0x1b478c){_0x4283b7=_0x1b478c;logger[_0x70ff('0xb')](_0x70ff('0x5c'),_0x4283b7['id']);return getTicket(_0x2e226e,_0x1155bb,_0x4283b7,_0x53315e,_0x470319,_0x53315e[_0x70ff('0x5d')],_0x163e39,'Outbound');})[_0x70ff('0x35')](function(_0x2652cf){_0x191edf=_0x2652cf;logger[_0x70ff('0xb')]('Ticket\x20created!');logger['info'](_0x70ff('0x5f'),_0x191edf['id']);return setRelationship(_0x163e39,_0x1155bb,_0x191edf,_0x70ff('0x6f'));})[_0x70ff('0x35')](function(){return setRelationship(_0x163e39,_0x4283b7,_0x191edf,_0x70ff('0x60'));})[_0x70ff('0x35')](function(){return getServerInfo(_0x163e39);})[_0x70ff('0x35')](function(_0x191216){var _0x30e65d=parseInt(_0x191216['version']['charAt'](0x0));var _0x176721=util[_0x70ff('0x22')](_0x70ff('0x63'),_0x2e226e['remoteUri'],_0x191edf['id']);if(_0x30e65d>0x6){_0x176721=util[_0x70ff('0x22')](_0x70ff('0x70'),_0x2e226e['remoteUri'],_0x191edf['id']);}logger[_0x70ff('0xb')](_0x70ff('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x70ff('0x65'),_0x2cbb60['name']),'trigger:browser:url',{'uri':_0x176721});})[_0x70ff('0x66')](function(_0x332548){logger[_0x70ff('0x67')](_0x70ff('0x6c'),JSON[_0x70ff('0x25')](_0x332548));});};exports[_0x70ff('0x71')]=function(_0x47dbf3,_0x23ca1c,_0x1dd816,_0x1a2b0d,_0x12d139,_0x2ae443){var _0x38d7ef,_0x4e56a0,_0x9087b5,_0xe251da;_0x2ae443[_0x70ff('0x51')]=intUtil['stripTrailingSlash'](_0x2ae443[_0x70ff('0x51')]);_0x2ae443['serverUrl']=intUtil['stripTrailingSlash'](_0x2ae443['serverUrl']);def[_0x70ff('0x69')]=util[_0x70ff('0x22')](_0x70ff('0x54'),_0x2ae443[_0x70ff('0x51')]);if(_0x12d139&&_0x12d139['monitor_format']){logger['info']('['+_0x23ca1c[_0x70ff('0x72')][_0x70ff('0x73')]()+']',_0x70ff('0x74'));_0x23ca1c[_0x70ff('0x56')]=util[_0x70ff('0x22')](_0x70ff('0x57'),_0x2ae443[_0x70ff('0x53')],_0x23ca1c['uniqueid'],md5(_0x23ca1c[_0x70ff('0x58')]));}else{_0x23ca1c['recordingURL']='';}return getConnection(_0x2ae443)[_0x70ff('0x35')](function(_0x9c781){_0xe251da=_0x9c781;if(!_[_0x70ff('0x26')](_0x1a2b0d)){return getUser(_0x2ae443,_0x1a2b0d[_0x70ff('0x19')],_0xe251da);}else{return getUser(_0x2ae443,null,_0xe251da);}})[_0x70ff('0x35')](function(_0x59e086){_0x38d7ef=_0x59e086;logger[_0x70ff('0xb')](_0x70ff('0x59'),_0x38d7ef['id']);return getEndUser(_0x2ae443,_0x23ca1c['calleridname'],_0x23ca1c[_0x70ff('0x5b')],_0xe251da);})[_0x70ff('0x35')](function(_0x30214a){_0x4e56a0=_0x30214a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4e56a0['id']);return getTicket(_0x2ae443,_0x38d7ef,_0x4e56a0,_0x1dd816,_0x23ca1c,_0x1dd816[_0x70ff('0x5d')],_0xe251da,'Inbound');})[_0x70ff('0x35')](function(_0x5475fb){_0x9087b5=_0x5475fb;logger[_0x70ff('0xb')](_0x70ff('0x75'));logger[_0x70ff('0xb')](_0x70ff('0x5f'),_0x9087b5['id']);return setRelationship(_0xe251da,_0x38d7ef,_0x9087b5,'users');})[_0x70ff('0x35')](function(){return setRelationship(_0xe251da,_0x4e56a0,_0x9087b5,_0x70ff('0x60'));})[_0x70ff('0x35')](function(){return getServerInfo(_0xe251da);})[_0x70ff('0x66')](function(_0x46d17d){logger[_0x70ff('0x67')]('['+_0x23ca1c[_0x70ff('0x72')]['toUpperCase']()+']',JSON[_0x70ff('0x25')](_0x46d17d));});}; \ No newline at end of file +var _0xe4c4=['Calls','format','Basic\x20%s','apiKey','toString','stringify','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Caller\x20-\x20%s','[HTTP]','map','type','string','customField','nameField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','[QUEUE]','user:%s','catch','error','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','charAt','trigger:browser:url','unmanaged','lastevent','toUpperCase','isNil','calleridnum','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','created_by','getString','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON'];(function(_0x4f1c57,_0x2a4fa6){var _0x2db1a5=function(_0x166ebf){while(--_0x166ebf){_0x4f1c57['push'](_0x4f1c57['shift']());}};_0x2db1a5(++_0x2a4fa6);}(_0xe4c4,0x13f));var _0x4e4c=function(_0x4d05a0,_0x53aa7e){_0x4d05a0=_0x4d05a0-0x0;var _0x4c999c=_0xe4c4[_0x4d05a0];return _0x4c999c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x4e4c('0x0'));var md5=require(_0x4e4c('0x1'));var util=require(_0x4e4c('0x2'));var Redis=require(_0x4e4c('0x3'));var intUtil=require('./util');var config=require(_0x4e4c('0x4'));var logger=require(_0x4e4c('0x5'))(_0x4e4c('0x6'));config[_0x4e4c('0x7')]=_[_0x4e4c('0x8')](config['redis'],{'host':_0x4e4c('0x9'),'port':0x18eb});var io=require(_0x4e4c('0xa'))(new Redis(config[_0x4e4c('0x7')]));var def={'method':_0x4e4c('0xb'),'json':!![]};function emit(_0x484a76,_0xb88b6d,_0x343fce){io['to'](_0x484a76)[_0x4e4c('0xc')](_0xb88b6d,_0x343fce);}function getTicket(_0x328578,_0x4ccf7b,_0x32d6fe,_0x191f16,_0x473348,_0x161b5e,_0xfaf618,_0x486703){logger[_0x4e4c('0xd')](_0x4e4c('0xe'));var _0x550efc=new Date();var _0xacbada=[{'name':_0x4e4c('0xf'),'value':intUtil['getString'](_0x191f16[_0x4e4c('0x10')],_0x473348,'\x20')},{'name':'assigned_user_id','value':_0x4ccf7b['id']},{'name':_0x4e4c('0x11'),'value':_0x4ccf7b['id']},{'name':'description','value':intUtil[_0x4e4c('0x12')](_0x191f16['Descriptions'],_0x473348,'\x0a')},{'name':_0x4e4c('0x13'),'value':_0x550efc[_0x4e4c('0x14')]()[_0x4e4c('0x15')](0x0,0x13)[_0x4e4c('0x16')]('T','\x20')},{'name':_0x4e4c('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x4e4c('0x18'),'value':_0x32d6fe['id']},{'name':_0x4e4c('0x19'),'value':_0x4e4c('0x1a')},{'name':_0x4e4c('0x1b'),'value':_0x32d6fe[_0x4e4c('0xf')]},{'name':_0x4e4c('0x1c'),'value':_0x486703}];if(_0x161b5e[_0x4e4c('0x1d')]){_[_0x4e4c('0x1e')](_0x161b5e,function(_0x16a073){if(_0x473348[_0x16a073[_0x4e4c('0x1f')]]){_0xacbada[_0x4e4c('0x20')]({'name':_0x16a073[_0x4e4c('0x21')],'value':_0x473348[_0x16a073[_0x4e4c('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x4e4c('0x22'),'rest_data':JSON['stringify']({'session':_0xfaf618['id'],'module_name':_0x4e4c('0x23'),'name_value_list':_0xacbada})}});}function getAuth(_0x2651e1){return util[_0x4e4c('0x24')](_0x4e4c('0x25'),new Buffer(_0x2651e1[_0x4e4c('0x26')]+':X')[_0x4e4c('0x27')]('base64'));}function getServerInfo(_0x4682bb){return request({'form':{'method':'get_server_info','input_type':_0x4e4c('0x22'),'response_type':_0x4e4c('0x22'),'rest_data':JSON[_0x4e4c('0x28')]({'session':_0x4682bb['id']})}});}function getUser(_0x556758,_0x5c0c6d,_0x2850f0){if(!_['isNil'](_0x5c0c6d)){logger[_0x4e4c('0xd')](_0x4e4c('0x29'),_0x5c0c6d);return request({'form':{'method':_0x4e4c('0x2a'),'input_type':_0x4e4c('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2850f0['id'],'module_name':_0x4e4c('0x2b'),'query':util['format'](_0x4e4c('0x2c'),_0x5c0c6d),'order_by':'','offset':'0','select_fields':['id',_0x4e4c('0xf'),_0x4e4c('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1883df){if(_0x1883df[_0x4e4c('0x2e')][_0x4e4c('0x1d')]){var _0x321fe6=_[_0x4e4c('0x2f')](_0x1883df[_0x4e4c('0x2e')],function(_0x489fa9){return _0x489fa9[_0x4e4c('0x30')][_0x4e4c('0x2d')][_0x4e4c('0x31')]===_0x5c0c6d;});if(_0x321fe6){logger[_0x4e4c('0xd')]('Agent\x20found!');return BPromise[_0x4e4c('0x32')]({'id':_0x321fe6[_0x4e4c('0x30')]['id'][_0x4e4c('0x31')],'name':_0x321fe6['name_value_list'][_0x4e4c('0xf')]['value']});}}logger[_0x4e4c('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4e4c('0x32')]({'id':_0x2850f0[_0x4e4c('0x30')][_0x4e4c('0x33')][_0x4e4c('0x31')],'name':_0x2850f0[_0x4e4c('0x30')][_0x4e4c('0x2d')][_0x4e4c('0x31')]});});}else{logger[_0x4e4c('0xd')](_0x4e4c('0x34'));return BPromise[_0x4e4c('0x32')]({'id':_0x2850f0[_0x4e4c('0x30')][_0x4e4c('0x33')][_0x4e4c('0x31')],'name':_0x2850f0[_0x4e4c('0x30')][_0x4e4c('0x2d')][_0x4e4c('0x31')]});}}function getEndUser(_0x377619,_0x71694f,_0x45a0d8,_0x381854){logger[_0x4e4c('0xd')](_0x4e4c('0x35'),_0x45a0d8);return request({'form':{'method':'get_entry_list','input_type':_0x4e4c('0x22'),'response_type':_0x4e4c('0x22'),'rest_data':JSON['stringify']({'session':_0x381854['id'],'module_name':_0x4e4c('0x1a'),'query':util['format'](_0x4e4c('0x36'),_0x45a0d8),'order_by':'','offset':'0','select_fields':['id','name',_0x4e4c('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4e4c('0x38')](function(_0x788f66){if(_0x788f66[_0x4e4c('0x2e')][_0x4e4c('0x1d')]){var _0x3c4cc9=_[_0x4e4c('0x2f')](_0x788f66[_0x4e4c('0x2e')],function(_0x2d104d){return _0x2d104d[_0x4e4c('0x30')][_0x4e4c('0x37')][_0x4e4c('0x31')]===_0x45a0d8;});if(_0x3c4cc9){logger[_0x4e4c('0xd')](_0x4e4c('0x39'));return BPromise[_0x4e4c('0x32')]({'id':_0x3c4cc9[_0x4e4c('0x30')]['id'][_0x4e4c('0x31')],'name':_0x3c4cc9[_0x4e4c('0x30')][_0x4e4c('0xf')][_0x4e4c('0x31')],'phone':_0x3c4cc9[_0x4e4c('0x30')]['phone_home'][_0x4e4c('0x31')]});}}else{logger['info'](_0x4e4c('0x3a'));return request({'form':{'method':_0x4e4c('0x3b'),'input_type':_0x4e4c('0x22'),'response_type':'JSON','rest_data':JSON[_0x4e4c('0x28')]({'session':_0x381854['id'],'module_name':'Contacts','name_value_list':[{'name':_0x4e4c('0x3c'),'value':_0x71694f!==''?_0x71694f:util[_0x4e4c('0x24')](_0x4e4c('0x3d'),_0x45a0d8)},{'name':'phone_home','value':_0x45a0d8}]})}})[_0x4e4c('0x38')](function(_0x5e8986){logger['info']('Enduser\x20created.');return BPromise[_0x4e4c('0x32')]({'id':_0x5e8986['id'],'name':_0x5e8986[_0x4e4c('0x2e')][_0x4e4c('0x3c')]['value'],'phone':_0x5e8986[_0x4e4c('0x2e')][_0x4e4c('0x37')][_0x4e4c('0x31')]});});}});}function request(_0x3eba74){logger['debug'](_0x4e4c('0x3e'),JSON[_0x4e4c('0x28')](_0x3eba74));return rp(_['merge'](def,_0x3eba74));}function getTags(_0x36cd34,_0x31b3b7){var _0x2e7ed8=[];if(_0x36cd34&&_0x36cd34[_0x4e4c('0x1d')]>0x0){_0x2e7ed8=_[_0x4e4c('0x3f')](_0x36cd34,_0x31b3b7);}return _0x2e7ed8;}function getCustomFields(_0x13e5c1,_0x30edb8){var _0x30c666=[];var _0x5a4272={'custom_fields':[]};if(_0x13e5c1['length']>0x0){_[_0x4e4c('0x1e')](_0x13e5c1,function(_0x499aef){if(_0x499aef[_0x4e4c('0x40')]===_0x4e4c('0x41')&&_0x499aef['nameField']&&!_0x499aef[_0x4e4c('0x42')]){_0x5a4272[_0x499aef[_0x4e4c('0x43')][_0x4e4c('0x44')]()]=_0x499aef[_0x4e4c('0x45')]['toString']();}else if(_0x499aef[_0x4e4c('0x40')]===_0x4e4c('0x41')&&_0x499aef['idField']&&_0x499aef[_0x4e4c('0x42')]){_0x5a4272[_0x4e4c('0x46')]['push']({'id':_0x499aef[_0x4e4c('0x21')],'value':_0x499aef[_0x4e4c('0x45')][_0x4e4c('0x27')]()});}else if(_0x499aef[_0x4e4c('0x40')]===_0x4e4c('0x47')&&_0x499aef['variableName']&&_0x499aef[_0x4e4c('0x21')]&&_0x499aef['customField']){_0x30edb8[_0x499aef[_0x4e4c('0x1f')]]&&_0x5a4272[_0x4e4c('0x46')]['push']({'id':_0x499aef[_0x4e4c('0x21')],'value':_0x30edb8[_0x499aef[_0x4e4c('0x1f')]]['toString']()});}else if(_0x499aef[_0x4e4c('0x40')]===_0x4e4c('0x48')&&_0x499aef[_0x4e4c('0x49')]&&_0x499aef[_0x4e4c('0x49')][_0x4e4c('0xf')]&&_0x499aef[_0x4e4c('0x21')]&&_0x499aef[_0x4e4c('0x42')]){_0x30edb8[_0x499aef[_0x4e4c('0x49')][_0x4e4c('0xf')]['toLowerCase']()]&&_0x5a4272[_0x4e4c('0x46')][_0x4e4c('0x20')]({'id':_0x499aef['idField'],'value':_0x30edb8[_0x499aef[_0x4e4c('0x49')][_0x4e4c('0xf')]['toLowerCase']()][_0x4e4c('0x27')]()});}});}return _0x5a4272;}function getConnection(_0x2bef1e){return request({'method':_0x4e4c('0xb'),'form':{'method':_0x4e4c('0x4a'),'input_type':_0x4e4c('0x22'),'response_type':_0x4e4c('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2bef1e[_0x4e4c('0x4b')],'password':_0x2bef1e[_0x4e4c('0x4c')],'encryption':'PLAIN'},'application':_0x4e4c('0x4d')})}})[_0x4e4c('0x38')](function(_0x51e963){var _0x484714=_0x51e963;if(_0x484714['id']){def[_0x4e4c('0x4e')]=_0x484714['id'];return BPromise['resolve'](_0x484714);}else{throw new Error(util[_0x4e4c('0x24')]('Account\x20%d\x20is\x20not\x20valid',_0x2bef1e['id']));}});}function setRelationship(_0x58922a,_0x6304ed,_0x44234d,_0x155d0c){return request({'form':{'method':'set_relationship','input_type':_0x4e4c('0x22'),'response_type':'JSON','rest_data':JSON[_0x4e4c('0x28')]({'session':_0x58922a['id'],'module_name':_0x4e4c('0x23'),'module_id':_0x44234d['id'],'link_field_name':_0x155d0c,'related_ids':[_0x6304ed['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5ae162,_0x10fbcc,_0x25666d,_0x2fe522,_0x2859ef,_0x269f32){var _0x8f61fc,_0x9e5aa3,_0x5b701e,_0x292663;_0x269f32[_0x4e4c('0x4f')]=intUtil[_0x4e4c('0x50')](_0x269f32[_0x4e4c('0x4f')]);_0x269f32['serverUrl']=intUtil[_0x4e4c('0x50')](_0x269f32[_0x4e4c('0x51')]);def['uri']=util[_0x4e4c('0x24')](_0x4e4c('0x52'),_0x269f32[_0x4e4c('0x4f')]);if(_0x2859ef&&_0x2859ef[_0x4e4c('0x53')]){logger[_0x4e4c('0xd')]('[QUEUE]',_0x4e4c('0x54'));_0x10fbcc[_0x4e4c('0x55')]=util['format'](_0x4e4c('0x56'),_0x269f32[_0x4e4c('0x51')],_0x10fbcc[_0x4e4c('0x57')],md5(_0x10fbcc[_0x4e4c('0x57')]));}else{_0x10fbcc[_0x4e4c('0x55')]='';}return getConnection(_0x269f32)[_0x4e4c('0x38')](function(_0x1435fd){_0x292663=_0x1435fd;return getUser(_0x269f32,_0x2fe522[_0x4e4c('0xf')],_0x292663);})[_0x4e4c('0x38')](function(_0x53eebb){_0x8f61fc=_0x53eebb;logger[_0x4e4c('0xd')](_0x4e4c('0x58'),_0x8f61fc['id']);return getEndUser(_0x269f32,_0x10fbcc[_0x4e4c('0x59')],_0x10fbcc['calleridnum'],_0x292663);})[_0x4e4c('0x38')](function(_0x5f32b8){_0x9e5aa3=_0x5f32b8;logger[_0x4e4c('0xd')](_0x4e4c('0x5a'),_0x9e5aa3['id']);return getTicket(_0x269f32,_0x8f61fc,_0x9e5aa3,_0x25666d,_0x10fbcc,_0x25666d[_0x4e4c('0x5b')],_0x292663,_0x4e4c('0x5c'));})[_0x4e4c('0x38')](function(_0x4daf9e){_0x5b701e=_0x4daf9e;logger[_0x4e4c('0xd')](_0x4e4c('0x5d'));logger[_0x4e4c('0xd')](_0x4e4c('0x5e'),_0x5b701e['id']);return setRelationship(_0x292663,_0x8f61fc,_0x5b701e,_0x4e4c('0x5f'));})[_0x4e4c('0x38')](function(){return setRelationship(_0x292663,_0x9e5aa3,_0x5b701e,_0x4e4c('0x60'));})[_0x4e4c('0x38')](function(){return getServerInfo(_0x292663);})[_0x4e4c('0x38')](function(_0x5aef67){var _0x2dce8a=parseInt(_0x5aef67[_0x4e4c('0x61')]['charAt'](0x0));var _0x4e20d4=util[_0x4e4c('0x24')](_0x4e4c('0x62'),_0x269f32[_0x4e4c('0x4f')],_0x5b701e['id']);if(_0x2dce8a>0x6){_0x4e20d4=util['format'](_0x4e4c('0x63'),_0x269f32[_0x4e4c('0x4f')],_0x5b701e['id']);}logger[_0x4e4c('0xd')](_0x4e4c('0x64'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4e4c('0x24')](_0x4e4c('0x65'),_0x2fe522[_0x4e4c('0xf')]),'trigger:browser:url',{'uri':_0x4e20d4});})[_0x4e4c('0x66')](function(_0x6b76d9){logger[_0x4e4c('0x67')](_0x4e4c('0x64'),JSON[_0x4e4c('0x28')](_0x6b76d9));});};exports['outbound']=function(_0x138954,_0x36e0ef,_0x570d1e,_0x4be176,_0x4bdf87,_0x18a976,_0x33c3d7){var _0x37b2bb,_0x248235,_0x3782b7,_0xeac25e;_0x18a976[_0x4e4c('0x4f')]=intUtil[_0x4e4c('0x50')](_0x18a976[_0x4e4c('0x4f')]);_0x18a976[_0x4e4c('0x51')]=intUtil[_0x4e4c('0x50')](_0x18a976[_0x4e4c('0x51')]);def[_0x4e4c('0x68')]=util['format']('%s/service/v4_1/rest.php',_0x18a976[_0x4e4c('0x4f')]);if(_0x33c3d7&&_0x33c3d7[_0x4e4c('0x69')]&&_0x33c3d7[_0x4e4c('0x69')]!==_0x4e4c('0x6a')){logger[_0x4e4c('0xd')](_0x4e4c('0x6b'),_0x4e4c('0x54'));_0x36e0ef[_0x4e4c('0x55')]=util[_0x4e4c('0x24')](_0x4e4c('0x56'),_0x18a976['serverUrl'],_0x36e0ef[_0x4e4c('0x57')],md5(_0x36e0ef['uniqueid']));}return getConnection(_0x18a976)[_0x4e4c('0x38')](function(_0x35c9f1){_0xeac25e=_0x35c9f1;return getUser(_0x18a976,_0x4be176[_0x4e4c('0xf')],_0xeac25e);})[_0x4e4c('0x38')](function(_0x5300e6){_0x37b2bb=_0x5300e6;logger['info'](_0x4e4c('0x58'),_0x37b2bb['id']);return getEndUser(_0x18a976,_0x36e0ef[_0x4e4c('0x6c')],_0x36e0ef[_0x4e4c('0x6d')],_0xeac25e);})['then'](function(_0x2cc46d){_0x248235=_0x2cc46d;logger['info'](_0x4e4c('0x5a'),_0x248235['id']);return getTicket(_0x18a976,_0x37b2bb,_0x248235,_0x570d1e,_0x36e0ef,_0x570d1e['Fields'],_0xeac25e,_0x4e4c('0x6e'));})['then'](function(_0x17947c){_0x3782b7=_0x17947c;logger[_0x4e4c('0xd')](_0x4e4c('0x5d'));logger[_0x4e4c('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3782b7['id']);return setRelationship(_0xeac25e,_0x37b2bb,_0x3782b7,_0x4e4c('0x5f'));})[_0x4e4c('0x38')](function(){return setRelationship(_0xeac25e,_0x248235,_0x3782b7,'contacts');})[_0x4e4c('0x38')](function(){return getServerInfo(_0xeac25e);})[_0x4e4c('0x38')](function(_0x3fb623){var _0x1a5eb0=parseInt(_0x3fb623['version'][_0x4e4c('0x6f')](0x0));var _0x32824f=util['format'](_0x4e4c('0x62'),_0x18a976[_0x4e4c('0x4f')],_0x3782b7['id']);if(_0x1a5eb0>0x6){_0x32824f=util[_0x4e4c('0x24')](_0x4e4c('0x63'),_0x18a976[_0x4e4c('0x4f')],_0x3782b7['id']);}logger[_0x4e4c('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4e4c('0x65'),_0x4be176[_0x4e4c('0xf')]),_0x4e4c('0x70'),{'uri':_0x32824f});})[_0x4e4c('0x66')](function(_0x2d0004){logger['error'](_0x4e4c('0x6b'),JSON[_0x4e4c('0x28')](_0x2d0004));});};exports[_0x4e4c('0x71')]=function(_0x3e01d2,_0x4e57fc,_0x54c29c,_0x1e3333,_0x51dacb,_0x8c8b1f){var _0x32f0e1,_0x209225,_0x4ce00c,_0x6d7b7b;_0x8c8b1f[_0x4e4c('0x4f')]=intUtil[_0x4e4c('0x50')](_0x8c8b1f[_0x4e4c('0x4f')]);_0x8c8b1f[_0x4e4c('0x51')]=intUtil[_0x4e4c('0x50')](_0x8c8b1f[_0x4e4c('0x51')]);def[_0x4e4c('0x68')]=util['format'](_0x4e4c('0x52'),_0x8c8b1f[_0x4e4c('0x4f')]);if(_0x51dacb&&_0x51dacb[_0x4e4c('0x53')]){logger[_0x4e4c('0xd')]('['+_0x4e57fc[_0x4e4c('0x72')][_0x4e4c('0x73')]()+']',_0x4e4c('0x54'));_0x4e57fc[_0x4e4c('0x55')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8c8b1f[_0x4e4c('0x51')],_0x4e57fc[_0x4e4c('0x57')],md5(_0x4e57fc['uniqueid']));}else{_0x4e57fc[_0x4e4c('0x55')]='';}return getConnection(_0x8c8b1f)[_0x4e4c('0x38')](function(_0x921c35){_0x6d7b7b=_0x921c35;if(!_[_0x4e4c('0x74')](_0x1e3333)){return getUser(_0x8c8b1f,_0x1e3333[_0x4e4c('0xf')],_0x6d7b7b);}else{return getUser(_0x8c8b1f,null,_0x6d7b7b);}})[_0x4e4c('0x38')](function(_0x4de357){_0x32f0e1=_0x4de357;logger[_0x4e4c('0xd')](_0x4e4c('0x58'),_0x32f0e1['id']);return getEndUser(_0x8c8b1f,_0x4e57fc[_0x4e4c('0x59')],_0x4e57fc[_0x4e4c('0x75')],_0x6d7b7b);})[_0x4e4c('0x38')](function(_0xf888ad){_0x209225=_0xf888ad;logger[_0x4e4c('0xd')](_0x4e4c('0x5a'),_0x209225['id']);return getTicket(_0x8c8b1f,_0x32f0e1,_0x209225,_0x54c29c,_0x4e57fc,_0x54c29c[_0x4e4c('0x5b')],_0x6d7b7b,_0x4e4c('0x5c'));})[_0x4e4c('0x38')](function(_0x224f4f){_0x4ce00c=_0x224f4f;logger[_0x4e4c('0xd')](_0x4e4c('0x5d'));logger[_0x4e4c('0xd')](_0x4e4c('0x5e'),_0x4ce00c['id']);return setRelationship(_0x6d7b7b,_0x32f0e1,_0x4ce00c,_0x4e4c('0x5f'));})['then'](function(){return setRelationship(_0x6d7b7b,_0x209225,_0x4ce00c,_0x4e4c('0x60'));})[_0x4e4c('0x38')](function(){return getServerInfo(_0x6d7b7b);})[_0x4e4c('0x66')](function(_0x2cdae4){logger[_0x4e4c('0x67')]('['+_0x4e57fc[_0x4e4c('0x72')][_0x4e4c('0x73')]()+']',JSON['stringify'](_0x2cdae4));});}; \ 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 5fb04e1..dc18f16 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 _0x9a1f=['toString','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','customVariable','join','stripTrailingSlash','validateEmail','isNil','test','lodash','util','getString','length','type','string','variable','variableName','push'];(function(_0x17793f,_0x136ae7){var _0x57a629=function(_0x2adaea){while(--_0x2adaea){_0x17793f['push'](_0x17793f['shift']());}};_0x57a629(++_0x136ae7);}(_0x9a1f,0x9f));var _0xf9a1=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x9a1f[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0xf9a1('0x0'));var util=require(_0xf9a1('0x1'));exports[_0xf9a1('0x2')]=function(_0xbc9e0,_0xe1f0a,_0x90ebdd){var _0x3832fe=[];if(_0xbc9e0['length']>0x0){var _0x351398=_['sortBy'](_0xbc9e0,['id']);for(var _0x52d2b7=0x0;_0x52d2b7<_0x351398[_0xf9a1('0x3')];_0x52d2b7++){var _0x4d193f=_0x351398[_0x52d2b7];if(_0x4d193f[_0xf9a1('0x4')]===_0xf9a1('0x5')){_0x3832fe['push'](_0x4d193f['content']);}else if(_0x4d193f[_0xf9a1('0x4')]===_0xf9a1('0x6')&&_0x4d193f[_0xf9a1('0x7')]){_0xe1f0a[_0x4d193f['variableName']]&&_0x3832fe[_0xf9a1('0x8')](_0xe1f0a[_0x4d193f['variableName']][_0xf9a1('0x9')]());}else if(_0x4d193f['type']==='customVariable'&&_0x4d193f[_0xf9a1('0xa')]&&_0x4d193f[_0xf9a1('0xa')][_0xf9a1('0xb')]){_0xe1f0a[_0x4d193f[_0xf9a1('0xa')][_0xf9a1('0xb')][_0xf9a1('0xc')]()]&&_0x3832fe[_0xf9a1('0x8')](_0xe1f0a[_0x4d193f['Variable'][_0xf9a1('0xb')][_0xf9a1('0xc')]()][_0xf9a1('0x9')]());}else if(_0x4d193f[_0xf9a1('0x4')]==='keyValue'){if(_0x4d193f[_0xf9a1('0xd')]===_0xf9a1('0x5')&&_0x4d193f[_0xf9a1('0xe')]){_0x3832fe[_0xf9a1('0x8')](util[_0xf9a1('0xf')](_0xf9a1('0x10'),_0x4d193f[_0xf9a1('0xe')],_0x4d193f[_0xf9a1('0x11')]));}else if(_0x4d193f[_0xf9a1('0xd')]==='variable'&&_0x4d193f[_0xf9a1('0x7')]&&_0x4d193f[_0xf9a1('0xe')]){_0xe1f0a[_0x4d193f['variableName']]&&_0x3832fe[_0xf9a1('0x8')](util[_0xf9a1('0xf')]('%s:\x20%s',_0x4d193f[_0xf9a1('0xe')],_0xe1f0a[_0x4d193f[_0xf9a1('0x7')]]));}else if(_0x4d193f[_0xf9a1('0xd')]===_0xf9a1('0x12')&&_0x4d193f[_0xf9a1('0xa')]&&_0x4d193f[_0xf9a1('0xa')][_0xf9a1('0xb')]&&_0x4d193f[_0xf9a1('0xe')]){_0xe1f0a[_0x4d193f['Variable']['name'][_0xf9a1('0xc')]()]&&_0x3832fe[_0xf9a1('0x8')](util['format'](_0xf9a1('0x10'),_0x4d193f[_0xf9a1('0xe')],_0xe1f0a[_0x4d193f[_0xf9a1('0xa')][_0xf9a1('0xb')][_0xf9a1('0xc')]()]));}}}}return _0x3832fe[_0xf9a1('0x13')](_0x90ebdd);};exports[_0xf9a1('0x14')]=function(_0x48071a){var _0x1d19a2=_0x48071a['slice'](-0x1);if(_0x1d19a2==='/'){_0x48071a=_0x48071a['substring'](0x0,_0x48071a['lastIndexOf'](_0x1d19a2));}return _0x48071a;};exports[_0xf9a1('0x15')]=function(_0x119321){if(!_[_0xf9a1('0x16')](_0x119321)&&_0x119321!==''){var _0x4949ba=/^(([^<>()\[\]\\.,;:\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 _0x4949ba[_0xf9a1('0x17')](String(_0x119321)[_0xf9a1('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xba52=['keyType','variableName','key','format','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf','isNil','lodash','util','getString','length','sortBy','string','content','type','variable','push','toString','customVariable','Variable','name','toLowerCase','keyValue'];(function(_0x38299a,_0x37f140){var _0x3dfd80=function(_0x2149d6){while(--_0x2149d6){_0x38299a['push'](_0x38299a['shift']());}};_0x3dfd80(++_0x37f140);}(_0xba52,0xf4));var _0x2ba5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xba52[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2ba5('0x0'));var util=require(_0x2ba5('0x1'));exports[_0x2ba5('0x2')]=function(_0x5e4d7b,_0x762d5e,_0x2200b0){var _0x28a675=[];if(_0x5e4d7b[_0x2ba5('0x3')]>0x0){var _0x37f284=_[_0x2ba5('0x4')](_0x5e4d7b,['id']);for(var _0x329ad7=0x0;_0x329ad7<_0x37f284[_0x2ba5('0x3')];_0x329ad7++){var _0x3dad4e=_0x37f284[_0x329ad7];if(_0x3dad4e['type']===_0x2ba5('0x5')){_0x28a675['push'](_0x3dad4e[_0x2ba5('0x6')]);}else if(_0x3dad4e[_0x2ba5('0x7')]===_0x2ba5('0x8')&&_0x3dad4e['variableName']){_0x762d5e[_0x3dad4e['variableName']]&&_0x28a675[_0x2ba5('0x9')](_0x762d5e[_0x3dad4e['variableName']][_0x2ba5('0xa')]());}else if(_0x3dad4e['type']===_0x2ba5('0xb')&&_0x3dad4e[_0x2ba5('0xc')]&&_0x3dad4e[_0x2ba5('0xc')][_0x2ba5('0xd')]){_0x762d5e[_0x3dad4e[_0x2ba5('0xc')][_0x2ba5('0xd')]['toLowerCase']()]&&_0x28a675[_0x2ba5('0x9')](_0x762d5e[_0x3dad4e[_0x2ba5('0xc')][_0x2ba5('0xd')][_0x2ba5('0xe')]()][_0x2ba5('0xa')]());}else if(_0x3dad4e['type']===_0x2ba5('0xf')){if(_0x3dad4e['keyType']==='string'&&_0x3dad4e['key']){_0x28a675[_0x2ba5('0x9')](util['format']('%s:\x20%s',_0x3dad4e['key'],_0x3dad4e['keyContent']));}else if(_0x3dad4e[_0x2ba5('0x10')]==='variable'&&_0x3dad4e[_0x2ba5('0x11')]&&_0x3dad4e[_0x2ba5('0x12')]){_0x762d5e[_0x3dad4e[_0x2ba5('0x11')]]&&_0x28a675[_0x2ba5('0x9')](util[_0x2ba5('0x13')](_0x2ba5('0x14'),_0x3dad4e[_0x2ba5('0x12')],_0x762d5e[_0x3dad4e['variableName']]));}else if(_0x3dad4e['keyType']===_0x2ba5('0xb')&&_0x3dad4e['Variable']&&_0x3dad4e['Variable'][_0x2ba5('0xd')]&&_0x3dad4e[_0x2ba5('0x12')]){_0x762d5e[_0x3dad4e[_0x2ba5('0xc')][_0x2ba5('0xd')]['toLowerCase']()]&&_0x28a675['push'](util[_0x2ba5('0x13')](_0x2ba5('0x14'),_0x3dad4e[_0x2ba5('0x12')],_0x762d5e[_0x3dad4e[_0x2ba5('0xc')]['name']['toLowerCase']()]));}}}}return _0x28a675[_0x2ba5('0x15')](_0x2200b0);};exports[_0x2ba5('0x16')]=function(_0x1d1e88){var _0x4ef38d=_0x1d1e88[_0x2ba5('0x17')](-0x1);if(_0x4ef38d==='/'){_0x1d1e88=_0x1d1e88['substring'](0x0,_0x1d1e88[_0x2ba5('0x18')](_0x4ef38d));}return _0x1d1e88;};exports['validateEmail']=function(_0x2f0a9d){if(!_[_0x2ba5('0x19')](_0x2f0a9d)&&_0x2f0a9d!==''){var _0x404a52=/^(([^<>()\[\]\\.,;:\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 _0x404a52['test'](String(_0x2f0a9d)[_0x2ba5('0xe')]());}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 4b84db3..566ea36 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 _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(_0x513994,_0x12f9fc){var _0x2afc27=function(_0x249bc1){while(--_0x249bc1){_0x513994['push'](_0x513994['shift']());}};_0x2afc27(++_0x12f9fc);}(_0xe706,0xa3));var _0x6e70=function(_0x261062,_0x4145b9){_0x261062=_0x261062-0x0;var _0x38ef4f=_0xe706[_0x261062];return _0x38ef4f;};'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 +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 27de3e8..75a7904 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 _0x38eb=['recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','replace','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','then','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','GET','length','includes','string','nameField','customField','toLowerCase','content','picklist','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x1250ab,_0x13271a){var _0x3641d3=function(_0x14009a){while(--_0x14009a){_0x1250ab['push'](_0x1250ab['shift']());}};_0x3641d3(++_0x13271a);}(_0x38eb,0xfb));var _0xb38e=function(_0x457611,_0x5bf947){_0x457611=_0x457611-0x0;var _0x7a024a=_0x38eb[_0x457611];return _0x7a024a;};'use strict';var _=require(_0xb38e('0x0'));var rp=require(_0xb38e('0x1'));var md5=require(_0xb38e('0x2'));var util=require(_0xb38e('0x3'));var Redis=require(_0xb38e('0x4'));var intUtil=require('./util');var config=require(_0xb38e('0x5'));var logger=require(_0xb38e('0x6'))(_0xb38e('0x7'));config[_0xb38e('0x8')]=_[_0xb38e('0x9')](config[_0xb38e('0x8')],{'host':_0xb38e('0xa'),'port':0x18eb});var io=require(_0xb38e('0xb'))(new Redis(config[_0xb38e('0x8')]));function emit(_0x5ca825,_0xebc40d,_0x37bace){io['to'](_0x5ca825)[_0xb38e('0xc')](_0xebc40d,_0x37bace);}var headers={'Content-Type':_0xb38e('0xd'),'Accept':_0xb38e('0xd')};function getTicket(_0x5f4ecb,_0x1a0e37,_0x23be24,_0x53296d,_0x1a1044){logger[_0xb38e('0xe')](_0xb38e('0xf'));return request({'uri':util[_0xb38e('0x10')](_0xb38e('0x11'),_0x5f4ecb[_0xb38e('0x12')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x23be24['id'],'submitter_id':_0x1a0e37?_0x1a0e37['id']:undefined,'assignee_id':_0x1a0e37?_0x1a0e37['id']:undefined,'tags':getTags(_0x53296d[_0xb38e('0x13')],_0xb38e('0x14')),'subject':intUtil[_0xb38e('0x15')](_0x53296d[_0xb38e('0x16')],_0x1a1044,'\x20'),'description':intUtil[_0xb38e('0x15')](_0x53296d[_0xb38e('0x17')],_0x1a1044,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x53296d[_0xb38e('0x17')],_0x1a1044,'\x0a')}},getCustomFields(_0x53296d['Fields'],_0x1a1044))}})[_0xb38e('0x18')](function(_0x500ea7){logger[_0xb38e('0xe')]('Ticket\x20created!');return _0x500ea7[_0xb38e('0x19')];});}function getUser(_0x512a30,_0x142142){if(intUtil[_0xb38e('0x1a')](_0x142142)){logger[_0xb38e('0xe')]('Getting\x20agent\x20with\x20email',_0x142142);return request({'uri':util[_0xb38e('0x10')](_0xb38e('0x1b'),_0x512a30[_0xb38e('0x12')]),'qs':{'query':util[_0xb38e('0x10')](_0xb38e('0x1c'),_0x142142)}})['then'](function(_0x3695f7){if(_0x3695f7['count']){logger[_0xb38e('0xe')](_0xb38e('0x1d'));return _[_0xb38e('0x1e')](_0x3695f7['results'],{'email':_0x142142,'role':'agent'});}else{logger[_0xb38e('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x512a30[_0xb38e('0x12')])})['then'](function(_0x2a5bd9){logger[_0xb38e('0xe')](_0xb38e('0x1f'));return _0x2a5bd9[_0xb38e('0x20')];});}});}else{logger[_0xb38e('0xe')](_0xb38e('0x21'));return request({'uri':util['format'](_0xb38e('0x22'),_0x512a30[_0xb38e('0x12')])})[_0xb38e('0x18')](function(_0x1928eb){logger[_0xb38e('0xe')](_0xb38e('0x1f'));return _0x1928eb[_0xb38e('0x20')];});}}function getEndUser(_0x29a25a,_0x3e5ea6,_0x5d9cc4){logger['info'](_0xb38e('0x23'),_0x5d9cc4);return request({'uri':util[_0xb38e('0x10')](_0xb38e('0x1b'),_0x29a25a[_0xb38e('0x12')]),'qs':{'query':util['format'](_0xb38e('0x24'),_0x5d9cc4)}})[_0xb38e('0x18')](function(_0x24c382){var _0x4d92ed;if(_0x24c382['results']['length']){_0x24c382[_0xb38e('0x25')]=_['filter'](_0x24c382[_0xb38e('0x25')],{'suspended':![],'role':_0xb38e('0x26')});if(_0x24c382[_0xb38e('0x25')]['length']){_0x4d92ed=_[_0xb38e('0x27')](_0x24c382[_0xb38e('0x25')]);}}if(_0x4d92ed){logger['info']('Enduser\x20found!');return _0x4d92ed;}else{logger['info'](_0xb38e('0x28'));return request({'uri':util['format'](_0xb38e('0x29'),_0x29a25a[_0xb38e('0x12')]),'method':_0xb38e('0x2a'),'body':{'user':{'role':_0xb38e('0x26'),'name':util[_0xb38e('0x10')](_0xb38e('0x2b'),_0x3e5ea6||_0x5d9cc4),'phone':_0x5d9cc4}}})[_0xb38e('0x18')](function(_0x59fb35){logger[_0xb38e('0xe')]('Enduser\x20created.');return _0x59fb35['user'];});}});}function getAuth(_0x4b1b7f){var _0x55d6be;if(_0x4b1b7f[_0xb38e('0x2c')]===_0xb38e('0x2d')){_0x55d6be=util[_0xb38e('0x10')](_0xb38e('0x2e'),_0x4b1b7f[_0xb38e('0x2f')],_0x4b1b7f[_0xb38e('0x2d')]);}else if(_0x4b1b7f[_0xb38e('0x2c')]===_0xb38e('0x30')){_0x55d6be=util['format'](_0xb38e('0x31'),_0x4b1b7f[_0xb38e('0x2f')],_0x4b1b7f['token']);}return util[_0xb38e('0x10')](_0xb38e('0x32'),new Buffer(_0x55d6be)[_0xb38e('0x33')]('base64'));}function request(_0x2ecaf4){logger[_0xb38e('0x34')](_0xb38e('0x35'),JSON['stringify'](_0x2ecaf4));return rp(_[_0xb38e('0x9')](_0x2ecaf4,{'method':_0xb38e('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x3f917b,_0x439b9b){var _0x5581be=[];if(_0x3f917b&&_0x3f917b[_0xb38e('0x37')]>0x0){_0x5581be=_['map'](_0x3f917b,_0x439b9b);}return _0x5581be;}function getCustomFields(_0x2b046e,_0x591a32){var _0x1a609c=[];var _0x4f7852={'custom_fields':[]};if(_0x2b046e[_0xb38e('0x37')]>0x0){_['forEach'](_0x2b046e,function(_0x293aff){if(_[_0xb38e('0x38')]([_0xb38e('0x39'),'picklist'],_0x293aff['type'])&&_0x293aff[_0xb38e('0x3a')]&&!_0x293aff[_0xb38e('0x3b')]){_0x4f7852[_0x293aff[_0xb38e('0x3a')][_0xb38e('0x3c')]()]=_0x293aff[_0xb38e('0x3d')][_0xb38e('0x33')]();}else if(_[_0xb38e('0x38')]([_0xb38e('0x39'),_0xb38e('0x3e')],_0x293aff[_0xb38e('0x3f')])&&_0x293aff[_0xb38e('0x40')]&&_0x293aff[_0xb38e('0x3b')]){_0x4f7852[_0xb38e('0x41')][_0xb38e('0x42')]({'id':_0x293aff[_0xb38e('0x40')],'value':_0x293aff[_0xb38e('0x3d')][_0xb38e('0x33')]()});}else if(_0x293aff['type']===_0xb38e('0x43')&&_0x293aff[_0xb38e('0x44')]&&_0x293aff[_0xb38e('0x40')]&&_0x293aff['customField']){_0x591a32[_0x293aff[_0xb38e('0x44')]]&&_0x4f7852[_0xb38e('0x41')][_0xb38e('0x42')]({'id':_0x293aff[_0xb38e('0x40')],'value':_0x591a32[_0x293aff[_0xb38e('0x44')]][_0xb38e('0x33')]()});}else if(_0x293aff['type']===_0xb38e('0x45')&&_0x293aff[_0xb38e('0x46')]&&_0x293aff[_0xb38e('0x46')][_0xb38e('0x14')]&&_0x293aff[_0xb38e('0x40')]&&_0x293aff[_0xb38e('0x3b')]){_0x591a32[_0x293aff[_0xb38e('0x46')]['name'][_0xb38e('0x3c')]()]&&_0x4f7852['custom_fields'][_0xb38e('0x42')]({'id':_0x293aff[_0xb38e('0x40')],'value':_0x591a32[_0x293aff[_0xb38e('0x46')][_0xb38e('0x14')][_0xb38e('0x3c')]()]['toString']()});}});}return _0x4f7852;}exports[_0xb38e('0x47')]=function(_0x581659,_0x2c23c9,_0x4023b3,_0x3a28c1,_0x5e5f2a,_0x5e2daa){var _0x4b3721,_0x3e37cc;_0x5e2daa[_0xb38e('0x12')]=intUtil[_0xb38e('0x48')](_0x5e2daa['remoteUri']);_0x5e2daa[_0xb38e('0x49')]=intUtil[_0xb38e('0x48')](_0x5e2daa[_0xb38e('0x49')]);if(_0x5e5f2a&&_0x5e5f2a[_0xb38e('0x4a')]){logger[_0xb38e('0xe')](_0xb38e('0x4b'),'Recording\x20is\x20enabled!');_0x2c23c9[_0xb38e('0x4c')]=util[_0xb38e('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e2daa[_0xb38e('0x49')],_0x2c23c9['uniqueid'],md5(_0x2c23c9[_0xb38e('0x4d')]));}else{_0x2c23c9['recordingURL']='';}headers[_0xb38e('0x4e')]=getAuth(_0x5e2daa);return getUser(_0x5e2daa,_0x3a28c1[_0xb38e('0x4f')])[_0xb38e('0x18')](function(_0x571c5f){_0x4b3721=_0x571c5f;logger['info'](_0xb38e('0x50'),_0x4b3721['id']);return getEndUser(_0x5e2daa,_0x2c23c9[_0xb38e('0x51')],_0x2c23c9['calleridnum']);})[_0xb38e('0x18')](function(_0x29bdf1){_0x3e37cc=_0x29bdf1;logger[_0xb38e('0xe')](_0xb38e('0x52'),_0x3e37cc['id']);return getTicket(_0x5e2daa,_0x4b3721,_0x3e37cc,_0x4023b3,_0x2c23c9);})['then'](function(_0x477196){if(_0x477196){logger['info'](_0xb38e('0x53'),_0x477196['id']);switch(_0x5e2daa['type']){case _0xb38e('0x54'):logger['info']('[QUEUE]',_0xb38e('0x55'));return request({'uri':util['format'](_0xb38e('0x56'),_0x5e2daa[_0xb38e('0x12')],_0x4b3721['id'],_0x477196['id']),'method':_0xb38e('0x2a')});case'newTab':logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb38e('0x10')]('user:%s',_0x3a28c1[_0xb38e('0x14')]),_0xb38e('0x57'),{'uri':util[_0xb38e('0x10')]('%s/agent/tickets/%s',_0x5e2daa[_0xb38e('0x12')][_0xb38e('0x58')]('/api/v2',''),_0x477196['id'])});break;default:logger[_0xb38e('0x59')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xb38e('0x5a')](function(_0x305161){logger[_0xb38e('0x59')](_0xb38e('0x5b'),util[_0xb38e('0x5c')](_0x305161,{'showHidden':!![],'depth':null}));});};exports[_0xb38e('0x5d')]=function(_0x4b05fe,_0x443dd9,_0x318081,_0x52bd10,_0x1d4072,_0x5d36fe,_0x16dce0){var _0x59bf49,_0xbda54a;_0x5d36fe[_0xb38e('0x12')]=intUtil[_0xb38e('0x48')](_0x5d36fe['remoteUri']);_0x5d36fe[_0xb38e('0x49')]=intUtil[_0xb38e('0x48')](_0x5d36fe['serverUrl']);if(_0x16dce0&&_0x16dce0[_0xb38e('0x5e')]&&_0x16dce0[_0xb38e('0x5e')]!==_0xb38e('0x5f')){logger[_0xb38e('0xe')](_0xb38e('0x60'),_0xb38e('0x61'));_0x443dd9['recordingURL']=util[_0xb38e('0x10')](_0xb38e('0x62'),_0x5d36fe[_0xb38e('0x49')],_0x443dd9[_0xb38e('0x4d')],md5(_0x443dd9[_0xb38e('0x4d')]));}headers[_0xb38e('0x4e')]=getAuth(_0x5d36fe);return getUser(_0x5d36fe,_0x52bd10[_0xb38e('0x4f')])[_0xb38e('0x18')](function(_0x5e3716){_0x59bf49=_0x5e3716;logger['info']('The\x20User\x20ID\x20is:',_0x59bf49['id']);return getEndUser(_0x5d36fe,_0x443dd9[_0xb38e('0x63')],_0x443dd9[_0xb38e('0x64')]);})[_0xb38e('0x18')](function(_0x2b72f2){_0xbda54a=_0x2b72f2;logger[_0xb38e('0xe')](_0xb38e('0x52'),_0xbda54a['id']);return getTicket(_0x5d36fe,_0x59bf49,_0xbda54a,_0x318081,_0x443dd9);})[_0xb38e('0x18')](function(_0x2dbdee){if(_0x2dbdee){logger['info'](_0xb38e('0x53'),_0x2dbdee['id']);switch(_0x5d36fe['type']){case'integrationTab':logger[_0xb38e('0xe')]('[OUTBOUND]',_0xb38e('0x55'));return request({'uri':util[_0xb38e('0x10')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5d36fe[_0xb38e('0x12')],_0x59bf49['id'],_0x2dbdee['id']),'method':_0xb38e('0x2a')});case'newTab':logger[_0xb38e('0xe')](_0xb38e('0x60'),_0xb38e('0x65'));emit(util[_0xb38e('0x10')](_0xb38e('0x66'),_0x52bd10[_0xb38e('0x14')]),_0xb38e('0x57'),{'uri':util['format'](_0xb38e('0x67'),_0x5d36fe[_0xb38e('0x12')][_0xb38e('0x58')](_0xb38e('0x68'),''),_0x2dbdee['id'])});break;default:logger[_0xb38e('0x59')](_0xb38e('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xb38e('0x5a')](function(_0x5c5dc1){logger[_0xb38e('0x59')](_0xb38e('0x69'),util[_0xb38e('0x5c')](_0x5c5dc1,{'showHidden':!![],'depth':null}));});};exports[_0xb38e('0x6a')]=function(_0x56c1ba,_0x4e98cc,_0x21f7f6,_0x5e326e,_0x13f192,_0x9040ca){var _0x3d3512,_0xa4192f;_0x9040ca[_0xb38e('0x12')]=intUtil[_0xb38e('0x48')](_0x9040ca[_0xb38e('0x12')]);_0x9040ca[_0xb38e('0x49')]=intUtil[_0xb38e('0x48')](_0x9040ca[_0xb38e('0x49')]);if(_0x13f192&&_0x13f192[_0xb38e('0x4a')]){logger[_0xb38e('0xe')]('['+_0x4e98cc[_0xb38e('0x6b')]['toUpperCase']()+']',_0xb38e('0x61'));_0x4e98cc[_0xb38e('0x4c')]=util[_0xb38e('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9040ca[_0xb38e('0x49')],_0x4e98cc[_0xb38e('0x4d')],md5(_0x4e98cc['uniqueid']));}else{_0x4e98cc[_0xb38e('0x4c')]='';}headers['Authorization']=getAuth(_0x9040ca);return getUser(_0x9040ca)[_0xb38e('0x18')](function(_0x59646a){_0x3d3512=_0x59646a;logger[_0xb38e('0xe')](_0xb38e('0x50'),_0x3d3512['id']);return getEndUser(_0x9040ca,_0x4e98cc[_0xb38e('0x51')],_0x4e98cc['calleridnum']);})[_0xb38e('0x18')](function(_0x2e19fd){_0xa4192f=_0x2e19fd;logger[_0xb38e('0xe')](_0xb38e('0x52'),_0xa4192f['id']);return getTicket(_0x9040ca,_0x3d3512,_0xa4192f,_0x21f7f6,_0x4e98cc);})[_0xb38e('0x18')](function(_0x14f2ca){if(_0x14f2ca){logger[_0xb38e('0xe')]('The\x20Ticket\x20ID\x20is:',_0x14f2ca['id']);}})[_0xb38e('0x5a')](function(_0xa72816){logger[_0xb38e('0x59')]('['+_0x4e98cc[_0xb38e('0x6b')][_0xb38e('0x6c')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0xa72816,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8eda=['type','nameField','toLowerCase','picklist','idField','custom_fields','variable','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','[QUEUE]','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridname','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','format','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','authType','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string'];(function(_0x364cc1,_0x55831a){var _0x5034c5=function(_0x2a7e55){while(--_0x2a7e55){_0x364cc1['push'](_0x364cc1['shift']());}};_0x5034c5(++_0x55831a);}(_0x8eda,0x9b));var _0xa8ed=function(_0x28ab20,_0x199e4e){_0x28ab20=_0x28ab20-0x0;var _0x20ec59=_0x8eda[_0x28ab20];return _0x20ec59;};'use strict';var _=require('lodash');var rp=require(_0xa8ed('0x0'));var md5=require('md5');var util=require(_0xa8ed('0x1'));var Redis=require('ioredis');var intUtil=require(_0xa8ed('0x2'));var config=require(_0xa8ed('0x3'));var logger=require(_0xa8ed('0x4'))('zendesk');config[_0xa8ed('0x5')]=_[_0xa8ed('0x6')](config[_0xa8ed('0x5')],{'host':_0xa8ed('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa8ed('0x5')]));function emit(_0x41d74,_0x28fb32,_0x22bfe6){io['to'](_0x41d74)[_0xa8ed('0x8')](_0x28fb32,_0x22bfe6);}var headers={'Content-Type':_0xa8ed('0x9'),'Accept':_0xa8ed('0x9')};function getTicket(_0x9584f3,_0x8e977f,_0x3ea55e,_0x57f81c,_0x5d7bc2){logger[_0xa8ed('0xa')](_0xa8ed('0xb'));return request({'uri':util['format'](_0xa8ed('0xc'),_0x9584f3[_0xa8ed('0xd')]),'method':_0xa8ed('0xe'),'body':{'ticket':_[_0xa8ed('0xf')]({'requester_id':_0x3ea55e['id'],'submitter_id':_0x8e977f?_0x8e977f['id']:undefined,'assignee_id':_0x8e977f?_0x8e977f['id']:undefined,'tags':getTags(_0x57f81c[_0xa8ed('0x10')],_0xa8ed('0x11')),'subject':intUtil[_0xa8ed('0x12')](_0x57f81c[_0xa8ed('0x13')],_0x5d7bc2,'\x20'),'description':intUtil[_0xa8ed('0x12')](_0x57f81c[_0xa8ed('0x14')],_0x5d7bc2,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x57f81c[_0xa8ed('0x14')],_0x5d7bc2,'\x0a')}},getCustomFields(_0x57f81c[_0xa8ed('0x15')],_0x5d7bc2))}})['then'](function(_0x46939b){logger[_0xa8ed('0xa')](_0xa8ed('0x16'));return _0x46939b[_0xa8ed('0x17')];});}function getUser(_0x4ff12c,_0x472e3a){if(intUtil[_0xa8ed('0x18')](_0x472e3a)){logger['info']('Getting\x20agent\x20with\x20email',_0x472e3a);return request({'uri':util[_0xa8ed('0x19')]('%s/search.json',_0x4ff12c[_0xa8ed('0xd')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x472e3a)}})[_0xa8ed('0x1a')](function(_0x3abd2e){if(_0x3abd2e[_0xa8ed('0x1b')]){logger[_0xa8ed('0xa')](_0xa8ed('0x1c'));return _[_0xa8ed('0x1d')](_0x3abd2e[_0xa8ed('0x1e')],{'email':_0x472e3a,'role':_0xa8ed('0x1f')});}else{logger[_0xa8ed('0xa')](_0xa8ed('0x20'));return request({'uri':util[_0xa8ed('0x19')]('%s/users/me.json',_0x4ff12c[_0xa8ed('0xd')])})[_0xa8ed('0x1a')](function(_0x43c117){logger['info'](_0xa8ed('0x21'));return _0x43c117[_0xa8ed('0x22')];});}});}else{logger[_0xa8ed('0xa')](_0xa8ed('0x20'));return request({'uri':util[_0xa8ed('0x19')](_0xa8ed('0x23'),_0x4ff12c[_0xa8ed('0xd')])})['then'](function(_0x2aef6e){logger['info'](_0xa8ed('0x21'));return _0x2aef6e[_0xa8ed('0x22')];});}}function getEndUser(_0x13bd85,_0x52093f,_0x18fad4){logger['info'](_0xa8ed('0x24'),_0x18fad4);return request({'uri':util['format'](_0xa8ed('0x25'),_0x13bd85[_0xa8ed('0xd')]),'qs':{'query':util[_0xa8ed('0x19')](_0xa8ed('0x26'),_0x18fad4)}})[_0xa8ed('0x1a')](function(_0x2450d0){var _0x5e75a8;if(_0x2450d0[_0xa8ed('0x1e')][_0xa8ed('0x27')]){_0x2450d0[_0xa8ed('0x1e')]=_['filter'](_0x2450d0[_0xa8ed('0x1e')],{'suspended':![],'role':_0xa8ed('0x28')});if(_0x2450d0['results'][_0xa8ed('0x27')]){_0x5e75a8=_[_0xa8ed('0x29')](_0x2450d0[_0xa8ed('0x1e')]);}}if(_0x5e75a8){logger[_0xa8ed('0xa')]('Enduser\x20found!');return _0x5e75a8;}else{logger[_0xa8ed('0xa')](_0xa8ed('0x2a'));return request({'uri':util['format'](_0xa8ed('0x2b'),_0x13bd85[_0xa8ed('0xd')]),'method':_0xa8ed('0xe'),'body':{'user':{'role':_0xa8ed('0x28'),'name':util[_0xa8ed('0x19')](_0xa8ed('0x2c'),_0x52093f||_0x18fad4),'phone':_0x18fad4}}})['then'](function(_0x5ec36c){logger[_0xa8ed('0xa')](_0xa8ed('0x2d'));return _0x5ec36c[_0xa8ed('0x22')];});}});}function getAuth(_0xb92f2e){var _0x2842af;if(_0xb92f2e['authType']===_0xa8ed('0x2e')){_0x2842af=util['format'](_0xa8ed('0x2f'),_0xb92f2e['username'],_0xb92f2e[_0xa8ed('0x2e')]);}else if(_0xb92f2e[_0xa8ed('0x30')]===_0xa8ed('0x31')){_0x2842af=util[_0xa8ed('0x19')](_0xa8ed('0x32'),_0xb92f2e[_0xa8ed('0x33')],_0xb92f2e['token']);}return util[_0xa8ed('0x19')](_0xa8ed('0x34'),new Buffer(_0x2842af)[_0xa8ed('0x35')](_0xa8ed('0x36')));}function request(_0xfc4ddf){logger[_0xa8ed('0x37')](_0xa8ed('0x38'),JSON[_0xa8ed('0x39')](_0xfc4ddf));return rp(_[_0xa8ed('0x6')](_0xfc4ddf,{'method':_0xa8ed('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x1c9038,_0x55027a){var _0x52f004=[];if(_0x1c9038&&_0x1c9038[_0xa8ed('0x27')]>0x0){_0x52f004=_[_0xa8ed('0x3b')](_0x1c9038,_0x55027a);}return _0x52f004;}function getCustomFields(_0x154c94,_0xd2fee1){var _0x468c0a=[];var _0x18e35a={'custom_fields':[]};if(_0x154c94[_0xa8ed('0x27')]>0x0){_[_0xa8ed('0x3c')](_0x154c94,function(_0x479589){if(_[_0xa8ed('0x3d')]([_0xa8ed('0x3e'),'picklist'],_0x479589[_0xa8ed('0x3f')])&&_0x479589[_0xa8ed('0x40')]&&!_0x479589['customField']){_0x18e35a[_0x479589['nameField'][_0xa8ed('0x41')]()]=_0x479589['content'][_0xa8ed('0x35')]();}else if(_[_0xa8ed('0x3d')]([_0xa8ed('0x3e'),_0xa8ed('0x42')],_0x479589['type'])&&_0x479589[_0xa8ed('0x43')]&&_0x479589['customField']){_0x18e35a[_0xa8ed('0x44')]['push']({'id':_0x479589[_0xa8ed('0x43')],'value':_0x479589['content'][_0xa8ed('0x35')]()});}else if(_0x479589[_0xa8ed('0x3f')]===_0xa8ed('0x45')&&_0x479589[_0xa8ed('0x46')]&&_0x479589[_0xa8ed('0x43')]&&_0x479589['customField']){_0xd2fee1[_0x479589[_0xa8ed('0x46')]]&&_0x18e35a['custom_fields']['push']({'id':_0x479589[_0xa8ed('0x43')],'value':_0xd2fee1[_0x479589[_0xa8ed('0x46')]][_0xa8ed('0x35')]()});}else if(_0x479589[_0xa8ed('0x3f')]===_0xa8ed('0x47')&&_0x479589['Variable']&&_0x479589['Variable']['name']&&_0x479589['idField']&&_0x479589['customField']){_0xd2fee1[_0x479589[_0xa8ed('0x48')][_0xa8ed('0x11')][_0xa8ed('0x41')]()]&&_0x18e35a[_0xa8ed('0x44')][_0xa8ed('0x49')]({'id':_0x479589[_0xa8ed('0x43')],'value':_0xd2fee1[_0x479589[_0xa8ed('0x48')]['name'][_0xa8ed('0x41')]()]['toString']()});}});}return _0x18e35a;}exports[_0xa8ed('0x4a')]=function(_0x26e719,_0x917e95,_0x238d1e,_0x3763c2,_0x2dbb5,_0x3aafe0){var _0x38f6b9,_0x1fccdc;_0x3aafe0[_0xa8ed('0xd')]=intUtil[_0xa8ed('0x4b')](_0x3aafe0[_0xa8ed('0xd')]);_0x3aafe0[_0xa8ed('0x4c')]=intUtil[_0xa8ed('0x4b')](_0x3aafe0['serverUrl']);if(_0x2dbb5&&_0x2dbb5[_0xa8ed('0x4d')]){logger[_0xa8ed('0xa')]('[QUEUE]',_0xa8ed('0x4e'));_0x917e95['recordingURL']=util[_0xa8ed('0x19')](_0xa8ed('0x4f'),_0x3aafe0['serverUrl'],_0x917e95[_0xa8ed('0x50')],md5(_0x917e95['uniqueid']));}else{_0x917e95[_0xa8ed('0x51')]='';}headers[_0xa8ed('0x52')]=getAuth(_0x3aafe0);return getUser(_0x3aafe0,_0x3763c2[_0xa8ed('0x53')])['then'](function(_0x30347f){_0x38f6b9=_0x30347f;logger['info'](_0xa8ed('0x54'),_0x38f6b9['id']);return getEndUser(_0x3aafe0,_0x917e95[_0xa8ed('0x55')],_0x917e95['calleridnum']);})[_0xa8ed('0x1a')](function(_0x2876fe){_0x1fccdc=_0x2876fe;logger['info'](_0xa8ed('0x56'),_0x1fccdc['id']);return getTicket(_0x3aafe0,_0x38f6b9,_0x1fccdc,_0x238d1e,_0x917e95);})['then'](function(_0x599b93){if(_0x599b93){logger[_0xa8ed('0xa')](_0xa8ed('0x57'),_0x599b93['id']);switch(_0x3aafe0[_0xa8ed('0x3f')]){case _0xa8ed('0x58'):logger[_0xa8ed('0xa')]('[QUEUE]',_0xa8ed('0x59'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3aafe0['remoteUri'],_0x38f6b9['id'],_0x599b93['id']),'method':'POST'});case'newTab':logger[_0xa8ed('0xa')](_0xa8ed('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xa8ed('0x5b'),_0x3763c2[_0xa8ed('0x11')]),_0xa8ed('0x5c'),{'uri':util[_0xa8ed('0x19')](_0xa8ed('0x5d'),_0x3aafe0[_0xa8ed('0xd')][_0xa8ed('0x5e')]('/api/v2',''),_0x599b93['id'])});break;default:logger[_0xa8ed('0x5f')](_0xa8ed('0x5a'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xa8ed('0x60')](function(_0x3250ac){logger[_0xa8ed('0x5f')](_0xa8ed('0x61'),util[_0xa8ed('0x62')](_0x3250ac,{'showHidden':!![],'depth':null}));});};exports[_0xa8ed('0x63')]=function(_0x3db0c0,_0x26d58,_0x222881,_0x1097ea,_0x439f2b,_0x4c2c50,_0x1b6902){var _0xf1c3be,_0x56211a;_0x4c2c50['remoteUri']=intUtil[_0xa8ed('0x4b')](_0x4c2c50[_0xa8ed('0xd')]);_0x4c2c50[_0xa8ed('0x4c')]=intUtil[_0xa8ed('0x4b')](_0x4c2c50[_0xa8ed('0x4c')]);if(_0x1b6902&&_0x1b6902[_0xa8ed('0x64')]&&_0x1b6902['recordingFormat']!=='none'){logger['info'](_0xa8ed('0x65'),'Recording\x20is\x20enabled!');_0x26d58['recordingURL']=util[_0xa8ed('0x19')](_0xa8ed('0x4f'),_0x4c2c50[_0xa8ed('0x4c')],_0x26d58['uniqueid'],md5(_0x26d58[_0xa8ed('0x50')]));}headers[_0xa8ed('0x52')]=getAuth(_0x4c2c50);return getUser(_0x4c2c50,_0x1097ea['email'])[_0xa8ed('0x1a')](function(_0x292837){_0xf1c3be=_0x292837;logger[_0xa8ed('0xa')](_0xa8ed('0x54'),_0xf1c3be['id']);return getEndUser(_0x4c2c50,_0x26d58[_0xa8ed('0x66')],_0x26d58['destcalleridnum']);})['then'](function(_0x295d55){_0x56211a=_0x295d55;logger[_0xa8ed('0xa')](_0xa8ed('0x56'),_0x56211a['id']);return getTicket(_0x4c2c50,_0xf1c3be,_0x56211a,_0x222881,_0x26d58);})['then'](function(_0x12aff1){if(_0x12aff1){logger[_0xa8ed('0xa')](_0xa8ed('0x57'),_0x12aff1['id']);switch(_0x4c2c50[_0xa8ed('0x3f')]){case'integrationTab':logger[_0xa8ed('0xa')](_0xa8ed('0x65'),_0xa8ed('0x59'));return request({'uri':util[_0xa8ed('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4c2c50['remoteUri'],_0xf1c3be['id'],_0x12aff1['id']),'method':'POST'});case'newTab':logger[_0xa8ed('0xa')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa8ed('0x19')](_0xa8ed('0x5b'),_0x1097ea['name']),'trigger:browser:url',{'uri':util[_0xa8ed('0x19')](_0xa8ed('0x5d'),_0x4c2c50[_0xa8ed('0xd')][_0xa8ed('0x5e')](_0xa8ed('0x67'),''),_0x12aff1['id'])});break;default:logger['error'](_0xa8ed('0x65'),_0xa8ed('0x68'));}}})[_0xa8ed('0x60')](function(_0x14c077){logger[_0xa8ed('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa8ed('0x62')](_0x14c077,{'showHidden':!![],'depth':null}));});};exports[_0xa8ed('0x69')]=function(_0x437290,_0x450092,_0x49c6f0,_0x38c0e9,_0x4db947,_0x35d7e5){var _0x18a78d,_0xc18e8c;_0x35d7e5['remoteUri']=intUtil['stripTrailingSlash'](_0x35d7e5['remoteUri']);_0x35d7e5[_0xa8ed('0x4c')]=intUtil[_0xa8ed('0x4b')](_0x35d7e5['serverUrl']);if(_0x4db947&&_0x4db947[_0xa8ed('0x4d')]){logger[_0xa8ed('0xa')]('['+_0x450092[_0xa8ed('0x6a')][_0xa8ed('0x6b')]()+']',_0xa8ed('0x4e'));_0x450092[_0xa8ed('0x51')]=util[_0xa8ed('0x19')](_0xa8ed('0x4f'),_0x35d7e5['serverUrl'],_0x450092[_0xa8ed('0x50')],md5(_0x450092[_0xa8ed('0x50')]));}else{_0x450092[_0xa8ed('0x51')]='';}headers[_0xa8ed('0x52')]=getAuth(_0x35d7e5);return getUser(_0x35d7e5)[_0xa8ed('0x1a')](function(_0x241a3e){_0x18a78d=_0x241a3e;logger[_0xa8ed('0xa')](_0xa8ed('0x54'),_0x18a78d['id']);return getEndUser(_0x35d7e5,_0x450092[_0xa8ed('0x55')],_0x450092['calleridnum']);})['then'](function(_0x1871f5){_0xc18e8c=_0x1871f5;logger[_0xa8ed('0xa')]('The\x20Enduser\x20ID\x20is:',_0xc18e8c['id']);return getTicket(_0x35d7e5,_0x18a78d,_0xc18e8c,_0x49c6f0,_0x450092);})[_0xa8ed('0x1a')](function(_0x5620d1){if(_0x5620d1){logger['info'](_0xa8ed('0x57'),_0x5620d1['id']);}})['catch'](function(_0x35e21c){logger['error']('['+_0x450092[_0xa8ed('0x6a')]['toUpperCase']()+']'+_0xa8ed('0x6c'),util[_0xa8ed('0x62')](_0x35e21c,{'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 a1a5f03..59f8da3 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 _0x730a=['https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','/crm/v2/','moduleCreate','role','first_name','code','data','startCase','log','CREATE\x20ERROR','moduleSearch','contact_lead','https://www.zohoapis.','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','administrator','last_name','getString','Subjects','Descriptions','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','utc','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','called','Called','complete','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','/crm/v2/Calls','SUCCESS','Call\x20created!','details','err','queue','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','stripTrailingSlash','recordingFormat','none','com','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','calleridname','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','length','forEach','includes','string','picklist','type','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x730a,0x1b1));var _0xa730=function(_0x5ccab3,_0x5c7df5){_0x5ccab3=_0x5ccab3-0x0;var _0x8a5eb3=_0x730a[_0x5ccab3];return _0x8a5eb3;};'use strict';var _=require(_0xa730('0x0'));var rp=require(_0xa730('0x1'));var md5=require('md5');var util=require(_0xa730('0x2'));var intUtil=require(_0xa730('0x3'));var moment=require(_0xa730('0x4'));var Redis=require(_0xa730('0x5'));var BPromise=require(_0xa730('0x6'));var config=require(_0xa730('0x7'));var logger=require(_0xa730('0x8'))(_0xa730('0x9'));config[_0xa730('0xa')]=_['defaults'](config[_0xa730('0xa')],{'host':_0xa730('0xb'),'port':0x18eb});var io=require(_0xa730('0xc'))(new Redis(config[_0xa730('0xa')]));function emit(_0x52cc04,_0x351847,_0x330adc){io['to'](_0x52cc04)[_0xa730('0xd')](_0x351847,_0x330adc);}function request(_0x30e819){logger[_0xa730('0xe')]('[HTTP]',JSON['stringify'](_0x30e819));return rp(_0x30e819);}function getCustomFields(_0xe940de,_0x491c77){var _0x5d2e23={};if(_0xe940de[_0xa730('0xf')]>0x0){_[_0xa730('0x10')](_0xe940de,function(_0x26b6dd){if(_[_0xa730('0x11')]([_0xa730('0x12'),_0xa730('0x13')],_0x26b6dd[_0xa730('0x14')])&&_0x26b6dd[_0xa730('0x15')]){_0x5d2e23[_0x26b6dd[_0xa730('0x15')]]=_0x26b6dd[_0xa730('0x16')]['toString']();}else if(_0x26b6dd[_0xa730('0x14')]===_0xa730('0x17')&&_0x26b6dd['variableName']&&_0x26b6dd[_0xa730('0x15')]&&_0x491c77[_0x26b6dd[_0xa730('0x18')]]){_0x5d2e23[_0x26b6dd['idField']]=_0x491c77[_0x26b6dd[_0xa730('0x18')]]['toString']();}else if(_0x26b6dd[_0xa730('0x14')]===_0xa730('0x19')&&_0x26b6dd[_0xa730('0x1a')]&&_0x26b6dd[_0xa730('0x1a')][_0xa730('0x1b')]&&_0x26b6dd['idField']&&_0x491c77[_0x26b6dd[_0xa730('0x1a')][_0xa730('0x1b')][_0xa730('0x1c')]()]){_0x5d2e23[_0x26b6dd[_0xa730('0x15')]]=_0x491c77[_0x26b6dd[_0xa730('0x1a')]['name']['toLowerCase']()][_0xa730('0x1d')]();}});}return _0x5d2e23;}function getName(_0x299cd0){if(_0x299cd0[_0xa730('0x1e')]('\x20')>0x0){var _0x57e2e5=_0x299cd0[_0xa730('0x1f')](/ (.+)/);if(_0x57e2e5[0x1]){return _0x57e2e5;}}return[_0x299cd0,_0x299cd0];}var accountsTokens={};function getAccessToken(_0x2ded2d){return new Promise(function(_0xbd5e27,_0x1ca994){if(!_[_0xa730('0x20')](accountsTokens[_0x2ded2d['id']])&&!_[_0xa730('0x20')](accountsTokens[_0x2ded2d['id']]['access_token'])){if(moment()[_0xa730('0x21')](accountsTokens[_0x2ded2d['id']][_0xa730('0x22')])){_0xbd5e27(accountsTokens[_0x2ded2d['id']][_0xa730('0x23')]);}}var _0x56154a;switch(_0x2ded2d[_0xa730('0x24')]){case'US':_0x56154a=_0xa730('0x25');break;case'AU':_0x56154a=_0xa730('0x26');break;case'EU':_0x56154a=_0xa730('0x27');break;case'IN':_0x56154a=_0xa730('0x28');break;case'CN':_0x56154a=_0xa730('0x29');break;default:_0x56154a=_0xa730('0x27');break;}var _0x26f8e3={'method':_0xa730('0x2a'),'uri':_0x56154a+_0xa730('0x2b'),'qs':{'refresh_token':_0x2ded2d[_0xa730('0x2c')],'client_id':_0x2ded2d[_0xa730('0x2d')],'client_secret':_0x2ded2d['clientSecret'],'grant_type':_0xa730('0x2e')},'json':!![]};return rp(_0x26f8e3)['then'](function(_0x2bb253){accountsTokens[_0x2ded2d['id']]={'access_token':_0x2bb253['access_token'],'expires_in':moment()['add'](_0x2bb253['expires_in'],_0xa730('0x2f'))};_0xbd5e27(_0x2bb253[_0xa730('0x23')]);})[_0xa730('0x30')](function(_0x48115e){logger['error'](_0xa730('0x31'),_0x48115e[_0xa730('0x32')]);_0x1ca994(_0x48115e);});});}function getUser(_0x489fa2,_0x23feeb,_0x5cfc0c,_0x9a51b5){logger[_0xa730('0x33')](_0xa730('0x34'));return request({'method':_0xa730('0x35'),'uri':util[_0xa730('0x36')](_0xa730('0x37'),_0x23feeb),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xa730('0x38')+_0x489fa2},'json':!![]})[_0xa730('0x39')](function(_0x40cc50){if(_0x40cc50[_0xa730('0x3a')]){var _0x2976c4=-0x1;if(_[_0xa730('0x3b')](_0x40cc50[_0xa730('0x3a')])){if(!_[_0xa730('0x20')](_0x9a51b5)){_0x2976c4=_[_0xa730('0x3c')](_0x40cc50[_0xa730('0x3a')],function(_0x39d9e5){return _0x39d9e5[_0xa730('0x3d')]===_0x9a51b5;});}if(_0x2976c4>=0x0){logger[_0xa730('0x33')](_0xa730('0x3e'));}else{logger[_0xa730('0x33')](_0xa730('0x3f'));_0x2976c4=_[_0xa730('0x3c')](_0x40cc50[_0xa730('0x3a')],function(_0x301906){return _0x301906[_0xa730('0x40')][_0xa730('0x1b')]===_0xa730('0x41');});}return _0x40cc50[_0xa730('0x3a')][_0x2976c4];}else{if(_0x40cc50['user'][_0xa730('0x40')][_0xa730('0x1b')]===_0xa730('0x41')){logger[_0xa730('0x33')](_0xa730('0x3f'));user=_0x40cc50[_0xa730('0x42')];return user;}else{logger[_0xa730('0x43')](_0xa730('0x44'),JSON[_0xa730('0x45')](_0x40cc50));throw new Error(_0xa730('0x46')+JSON[_0xa730('0x45')](_0x40cc50));}}}else{logger[_0xa730('0x43')](_0xa730('0x44'),JSON[_0xa730('0x45')](_0x40cc50));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xa730('0x45')](_0x40cc50));}})[_0xa730('0x30')](function(_0x136c57){console['error'](_0x136c57);});}function getZohoUser(_0x52751b,_0x1083b7){return new BPromise(function(_0x41a994,_0x4c228c){request(_0x52751b)['then'](function(_0xf703a3){var _0x4edbc5=null;if(_0xf703a3){_0x4edbc5=_0xf703a3['data'][0x0];_0x4edbc5[_0xa730('0x47')]=_0x1083b7;}_0x41a994(_0x4edbc5);})[_0xa730('0x30')](function(_0x35f89d){_0x4c228c(_0x35f89d);});});}function createEndUser(_0x4f5f9e,_0x1c485a,_0x154da4,_0x460b26,_0x5ddad3,_0x1ed59b){var _0x154da4=getName(_0x154da4);return request({'method':_0xa730('0x2a'),'uri':'https://www.zohoapis.'+_0x1c485a+_0xa730('0x48')+_['startCase'](_0x1ed59b[_0xa730('0x49')])+'s','body':{'data':[{'Last_Name':_0x154da4[0x1],'First_Name':_0x154da4[0x0],'Phone':_0x460b26,'Owner':{'name':!_[_0xa730('0x20')](_0x5ddad3[_0xa730('0x4a')][_0xa730('0x1b')])?_0x5ddad3['role'][_0xa730('0x1b')]:!_[_0xa730('0x20')](_0x5ddad3[_0xa730('0x4b')])?_0x5ddad3[_0xa730('0x4b')]+'\x20'+_0x5ddad3['last_name']:_0x5ddad3['last_name'],'id':_0x5ddad3['id']}}]},'headers':{'Authorization':_0xa730('0x38')+_0x4f5f9e},'json':!![]})[_0xa730('0x39')](function(_0x177d83){if(_0x177d83&&_0x177d83['data'][0x0][_0xa730('0x4c')]==='SUCCESS'){var _0x415a5e=_0x177d83[_0xa730('0x4d')][0x0]['details'];_0x415a5e[_0xa730('0x47')]=_[_0xa730('0x4e')](_0x1ed59b[_0xa730('0x49')])+'s';return _0x415a5e;}logger[_0xa730('0x43')](_0xa730('0x44'),JSON[_0xa730('0x45')](data));throw new Error('Error:\x20'+JSON[_0xa730('0x45')](data));})[_0xa730('0x30')](function(_0x3b998f){console[_0xa730('0x4f')](_0xa730('0x50'),_0x3b998f);});}function getEndUser(_0x13f893,_0x4c667a,_0x2f9378,_0x2dea4b,_0x15ac6c,_0x561c3a,_0x5a8b24){var _0x2da440={'method':_0xa730('0x35'),'uri':'','headers':{'Authorization':_0xa730('0x38')+_0x13f893},'json':!![]};switch(_0x5a8b24[_0xa730('0x51')]){case _0xa730('0x52'):_0x2da440['uri']=_0xa730('0x53')+_0x4c667a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x15ac6c+'))';return getZohoUser(_0x2da440,_0xa730('0x54'))[_0xa730('0x39')](function(_0x188cd9){if(_0x188cd9)return _0x188cd9;_0x2da440[_0xa730('0x55')]='https://www.zohoapis.'+_0x4c667a+_0xa730('0x56')+_0x15ac6c+'))';return getZohoUser(_0x2da440,_0xa730('0x57'))['then'](function(_0xd9e7f7){if(_0xd9e7f7)return _0xd9e7f7;if(_0x5a8b24[_0xa730('0x49')]!=_0xa730('0x58')){return createEndUser(_0x13f893,_0x4c667a,_0x2dea4b,_0x15ac6c,_0x561c3a,_0x5a8b24);}else{return{};}});});break;case _0xa730('0x59'):_0x2da440[_0xa730('0x55')]='https://www.zohoapis.'+_0x4c667a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x15ac6c+'))';return getZohoUser(_0x2da440,_0xa730('0x54'))[_0xa730('0x39')](function(_0x301afb){if(_0x301afb)return _0x301afb;if(_0x5a8b24[_0xa730('0x49')]!='nothing'){return createEndUser(_0x13f893,_0x4c667a,_0x2dea4b,_0x15ac6c,_0x561c3a,_0x5a8b24);}else{return{};}});break;case _0xa730('0x5a'):_0x2da440[_0xa730('0x55')]=_0xa730('0x53')+_0x4c667a+_0xa730('0x56')+_0x15ac6c+'))';return getZohoUser(_0x2da440,_0xa730('0x57'))[_0xa730('0x39')](function(_0x46700b){if(_0x46700b)return _0x46700b;if(_0x5a8b24[_0xa730('0x49')]!=_0xa730('0x58')){return createEndUser(_0x13f893,_0x4c667a,_0x2dea4b,_0x15ac6c,_0x561c3a,_0x5a8b24);}else{return{};}});break;}}function getCall(_0xf5f743,_0x5d6327,_0x7a352,_0x293a57,_0x5e60e0,_0x4dd19f,_0x417145,_0x158de1){logger[_0xa730('0x33')]('Creating\x20new\x20call...');var _0x13690d={};_0x13690d['Owner']={'name':!_[_0xa730('0x20')](_0x293a57[_0xa730('0x4a')][_0xa730('0x1b')])&&!_[_0xa730('0x20')](_0x293a57['profile'][_0xa730('0x1b')])&&_0x293a57['profile'][_0xa730('0x1b')]===_0xa730('0x5b')?_0x293a57[_0xa730('0x4a')]['name']:!_[_0xa730('0x20')](_0x293a57[_0xa730('0x4b')])?_0x293a57['first_name']+'\x20'+_0x293a57[_0xa730('0x5c')]:_0x293a57['last_name'],'id':_0x293a57['id']};_0x13690d['Subject']=intUtil[_0xa730('0x5d')](_0x4dd19f[_0xa730('0x5e')],_0x417145,'\x20');_0x13690d['Description']=intUtil[_0xa730('0x5d')](_0x4dd19f[_0xa730('0x5f')],_0x417145,'\x0a');if(_0x5e60e0[_0xa730('0x47')]==='Contacts'){_0x13690d['Who_Id']={'name':!_[_0xa730('0x20')](_0x5e60e0[_0xa730('0x60')])?_0x5e60e0[_0xa730('0x60')]:!_[_0xa730('0x20')](_0x5e60e0['First_Name'])?_0x5e60e0['First_Name']+'\x20'+_0x5e60e0[_0xa730('0x61')]:_0x5e60e0[_0xa730('0x61')],'id':_0x5e60e0['id']};}if(_0x5e60e0[_0xa730('0x47')]===_0xa730('0x57')){_0x13690d[_0xa730('0x62')]={'name':!_[_0xa730('0x20')](_0x5e60e0[_0xa730('0x60')])?_0x5e60e0[_0xa730('0x60')]:!_[_0xa730('0x20')](_0x5e60e0[_0xa730('0x63')])?_0x5e60e0[_0xa730('0x63')]+'\x20'+_0x5e60e0[_0xa730('0x61')]:_0x5e60e0[_0xa730('0x61')],'id':_0x5e60e0['id']};_0x13690d[_0xa730('0x64')]=_[_0xa730('0x4e')](_0x5e60e0['enduserType']);}if(_0x417145[_0xa730('0x65')]){_0x13690d['Call_Duration']=moment[_0xa730('0x66')](parseInt(_0x417145[_0xa730('0x65')])*0x3e8)['format']('mm:ss');}else if(_0x417145['answertime']&&_0x417145[_0xa730('0x67')]){_0x13690d[_0xa730('0x68')]=moment['utc'](moment(_0x417145['endtime'],_0xa730('0x69'))['diff'](moment(_0x417145[_0xa730('0x6a')],'YYYY-MM-DDTHH:mm:ss')))[_0xa730('0x36')](_0xa730('0x6b'));}switch(_0x417145[_0xa730('0x6c')]){case _0xa730('0x6d'):_0x13690d['Call_Result']=_0xa730('0x6e');break;case _0xa730('0x6f'):case'connect':_0x13690d[_0xa730('0x70')]=_0xa730('0x71');break;case _0xa730('0x72'):_0x13690d['Call_Result']='Rejected';break;case _0xa730('0x73'):_0x13690d[_0xa730('0x70')]=_0xa730('0x74');break;case _0xa730('0x75'):_0x13690d['Call_Result']=_0xa730('0x76');default:}_0x13690d[_0xa730('0x77')]=(_0x158de1===_0xa730('0x78')?moment(_0x417145['starttime'])['format'](_0xa730('0x69')):moment(_0x417145['agentcalledAt'])[_0xa730('0x36')](_0xa730('0x69')))||moment()['format'](_0xa730('0x69'));_0x13690d[_0xa730('0x79')]=_0x158de1||_0xa730('0x7a');_0x13690d=_[_0xa730('0x7b')](_0x13690d,getCustomFields(_0x4dd19f['Fields'],_0x417145));return request({'method':_0xa730('0x2a'),'uri':_0xa730('0x53')+_0x5d6327+_0xa730('0x7c'),'headers':{'Authorization':_0xa730('0x38')+_0xf5f743},'body':{'data':[_0x13690d]},'json':!![]})['then'](function(_0x30b68d){if(_0x30b68d&&_0x30b68d[_0xa730('0x4d')][0x0][_0xa730('0x4c')]===_0xa730('0x7d')){logger['info'](_0xa730('0x7e'));return{'id':_0x30b68d['data'][0x0][_0xa730('0x7f')]['id']};}})[_0xa730('0x30')](function(_0x2e4cd2){logger[_0xa730('0x33')](_0xa730('0x80'),_0x2e4cd2['stack']);console[_0xa730('0x4f')]('err',_0x2e4cd2);});}exports[_0xa730('0x81')]=function(_0x50a1f4,_0xecbc77,_0x313ab7,_0x2503ad,_0x4c0ac4,_0x348160){var _0x45e45c,_0x2c4b39,_0x46ae57;_0x348160[_0xa730('0x82')]=intUtil['stripTrailingSlash'](_0x348160[_0xa730('0x82')]);_0x348160[_0xa730('0x83')]=intUtil['stripTrailingSlash'](_0x348160[_0xa730('0x83')]);if(_0x4c0ac4&&_0x4c0ac4[_0xa730('0x84')]){logger['info'](_0xa730('0x85'),_0xa730('0x86'));_0xecbc77[_0xa730('0x87')]=_0x348160[_0xa730('0x83')]+_0xa730('0x88')+_0xecbc77[_0xa730('0x89')]+_0xa730('0x8a')+md5(_0xecbc77['uniqueid']);}else{_0xecbc77[_0xa730('0x87')]='';}var _0x221a8d=_0x348160['host']===_0xa730('0x8b')?'eu':'com';return getAccessToken(_0x348160)[_0xa730('0x39')](function(_0x36ccf5){_0x46ae57=_0x36ccf5;return getUser(_0x46ae57,_0x221a8d,_0x348160,_0x2503ad[_0xa730('0x3d')]);})[_0xa730('0x39')](function(_0x3dff18){_0x45e45c=_0x3dff18;logger[_0xa730('0x33')](_0xa730('0x8c'),_0x45e45c['id']);return getEndUser(_0x46ae57,_0x221a8d,_0x348160,_0xecbc77['calleridname'],_0xecbc77[_0xa730('0x8d')],_0x45e45c,_0x313ab7);})['then'](function(_0x3a636b){_0x2c4b39=_0x3a636b;return getCall(_0x46ae57,_0x221a8d,_0x348160,_0x45e45c,_0x2c4b39,_0x313ab7,_0xecbc77,_0xa730('0x7a'));})[_0xa730('0x39')](function(_0x35ebb6){if(_0x35ebb6){logger[_0xa730('0x33')](_0xa730('0x8e'),_0x35ebb6['id']);logger[_0xa730('0x33')](_0xa730('0x85'),_0xa730('0x8f'));emit(util[_0xa730('0x36')](_0xa730('0x90'),_0x2503ad[_0xa730('0x1b')]),_0xa730('0x91'),{'uri':_0xa730('0x92')+_0x348160['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x35ebb6['id']});}})[_0xa730('0x30')](function(_0x399777){logger[_0xa730('0x43')](_0xa730('0x85'),JSON[_0xa730('0x45')](_0x399777));});};exports['outbound']=function(_0x316d29,_0x299367,_0x59020b,_0x27f1b9,_0x42761d,_0x27b202,_0x4ac439){var _0x38d34b,_0x520c41,_0x4c15dd;_0x27b202['host']=intUtil[_0xa730('0x93')](_0x27b202[_0xa730('0x82')]);_0x27b202[_0xa730('0x83')]=intUtil[_0xa730('0x93')](_0x27b202[_0xa730('0x83')]);if(_0x4ac439&&_0x4ac439[_0xa730('0x94')]&&_0x4ac439['recordingFormat']!==_0xa730('0x95')){logger['info']('[OUTBOUND]',_0xa730('0x86'));_0x299367[_0xa730('0x87')]=_0x27b202[_0xa730('0x83')]+_0xa730('0x88')+_0x299367['uniqueid']+_0xa730('0x8a')+md5(_0x299367[_0xa730('0x89')]);}var _0x59a172=_0x27b202[_0xa730('0x82')]==='zoho.eu'?'eu':_0xa730('0x96');return getAccessToken(_0x27b202)[_0xa730('0x39')](function(_0x253ddb){_0x4c15dd=_0x253ddb;return getUser(_0x4c15dd,_0x59a172,_0x27b202,_0x27f1b9[_0xa730('0x3d')]);})[_0xa730('0x39')](function(_0x461667){_0x38d34b=_0x461667;logger[_0xa730('0x33')](_0xa730('0x8c'),_0x38d34b['id']);return getEndUser(_0x4c15dd,_0x59a172,_0x27b202,_0x299367[_0xa730('0x97')],_0x299367[_0xa730('0x98')],_0x38d34b,_0x59020b);})['then'](function(_0x247d31){_0x520c41=_0x247d31;return getCall(_0x4c15dd,_0x59a172,_0x27b202,_0x38d34b,_0x520c41,_0x59020b,_0x299367,_0xa730('0x99'));})[_0xa730('0x39')](function(_0x4c514a){if(_0x4c514a){logger[_0xa730('0x33')](_0xa730('0x8e'),_0x4c514a['id']);logger[_0xa730('0x33')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa730('0x36')](_0xa730('0x90'),_0x27f1b9['name']),_0xa730('0x91'),{'uri':_0xa730('0x92')+_0x27b202[_0xa730('0x82')]+'/crm/EntityInfo.do?module=Calls&id='+_0x4c514a['id']});}})['catch'](function(_0x4618f3){logger[_0xa730('0x43')]('[OUTBOUND]',JSON['stringify'](_0x4618f3));});};exports[_0xa730('0x9a')]=function(_0x4a0ee6,_0x3fd978,_0x1e2ab5,_0x5afd07,_0x594a84,_0x1a03ce){var _0x3645a5,_0x129d43,_0x501589;_0x1a03ce['host']=intUtil[_0xa730('0x93')](_0x1a03ce[_0xa730('0x82')]);_0x1a03ce[_0xa730('0x83')]=intUtil[_0xa730('0x93')](_0x1a03ce[_0xa730('0x83')]);if(_0x594a84&&_0x594a84[_0xa730('0x84')]){logger['info']('['+_0x3fd978[_0xa730('0x6c')][_0xa730('0x9b')]()+']',_0xa730('0x86'));_0x3fd978['recordingURL']=_0x1a03ce['serverUrl']+'/api/voice/recordings/'+_0x3fd978['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3fd978[_0xa730('0x89')]);}else{_0x3fd978['recordingURL']='';}var _0x4babb5=_0x1a03ce['host']===_0xa730('0x8b')?'eu':_0xa730('0x96');return getAccessToken(_0x1a03ce)['then'](function(_0x3b8fb1){_0x501589=_0x3b8fb1;return getUser(_0x501589,_0x4babb5,_0x1a03ce);})['then'](function(_0x312750){_0x3645a5=_0x312750;logger[_0xa730('0x33')](_0xa730('0x8c'),_0x3645a5['id']);return getEndUser(_0x501589,_0x4babb5,_0x1a03ce,_0x3fd978[_0xa730('0x9c')],_0x3fd978[_0xa730('0x8d')],_0x3645a5,_0x1e2ab5);})[_0xa730('0x39')](function(_0x4a2970){_0x129d43=_0x4a2970;return getCall(_0x501589,_0x4babb5,_0x1a03ce,_0x3645a5,_0x129d43,_0x1e2ab5,_0x3fd978,_0xa730('0x7a'));})[_0xa730('0x39')](function(_0x5b9509){if(_0x5b9509){logger[_0xa730('0x33')](_0xa730('0x8e'),_0x5b9509['id']);}})[_0xa730('0x30')](function(_0x2f5a87){logger[_0xa730('0x43')]('['+_0x3fd978[_0xa730('0x6c')][_0xa730('0x9b')]()+']',JSON['stringify'](_0x2f5a87));});}; \ No newline at end of file +var _0x86d5=['Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','profile','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','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','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','Call\x20created!','err','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','lastevent','toUpperCase','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','picklist','type','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x86d5,0x71));var _0x586d=function(_0x3b4ccb,_0xc85a2){_0x3b4ccb=_0x3b4ccb-0x0;var _0x5f07aa=_0x86d5[_0x3b4ccb];return _0x5f07aa;};'use strict';var _=require(_0x586d('0x0'));var rp=require(_0x586d('0x1'));var md5=require(_0x586d('0x2'));var util=require(_0x586d('0x3'));var intUtil=require(_0x586d('0x4'));var moment=require(_0x586d('0x5'));var Redis=require('ioredis');var BPromise=require(_0x586d('0x6'));var config=require(_0x586d('0x7'));var logger=require(_0x586d('0x8'))(_0x586d('0x9'));config[_0x586d('0xa')]=_[_0x586d('0xb')](config[_0x586d('0xa')],{'host':_0x586d('0xc'),'port':0x18eb});var io=require(_0x586d('0xd'))(new Redis(config[_0x586d('0xa')]));function emit(_0x12068f,_0x16a51a,_0x166654){io['to'](_0x12068f)[_0x586d('0xe')](_0x16a51a,_0x166654);}function request(_0x114669){logger['debug']('[HTTP]',JSON['stringify'](_0x114669));return rp(_0x114669);}function getCustomFields(_0x149d7f,_0x37e4dd){var _0x3c444f={};if(_0x149d7f[_0x586d('0xf')]>0x0){_[_0x586d('0x10')](_0x149d7f,function(_0x4b3f28){if(_['includes'](['string',_0x586d('0x11')],_0x4b3f28[_0x586d('0x12')])&&_0x4b3f28[_0x586d('0x13')]){_0x3c444f[_0x4b3f28['idField']]=_0x4b3f28[_0x586d('0x14')]['toString']();}else if(_0x4b3f28[_0x586d('0x12')]==='variable'&&_0x4b3f28[_0x586d('0x15')]&&_0x4b3f28[_0x586d('0x13')]&&_0x37e4dd[_0x4b3f28['variableName']]){_0x3c444f[_0x4b3f28[_0x586d('0x13')]]=_0x37e4dd[_0x4b3f28['variableName']][_0x586d('0x16')]();}else if(_0x4b3f28['type']===_0x586d('0x17')&&_0x4b3f28[_0x586d('0x18')]&&_0x4b3f28[_0x586d('0x18')]['name']&&_0x4b3f28[_0x586d('0x13')]&&_0x37e4dd[_0x4b3f28[_0x586d('0x18')][_0x586d('0x19')][_0x586d('0x1a')]()]){_0x3c444f[_0x4b3f28[_0x586d('0x13')]]=_0x37e4dd[_0x4b3f28['Variable']['name']['toLowerCase']()][_0x586d('0x16')]();}});}return _0x3c444f;}function getName(_0x39e965){if(_0x39e965[_0x586d('0x1b')]('\x20')>0x0){var _0x1557a0=_0x39e965[_0x586d('0x1c')](/ (.+)/);if(_0x1557a0[0x1]){return _0x1557a0;}}return[_0x39e965,_0x39e965];}var accountsTokens={};function getAccessToken(_0x475889){return new Promise(function(_0x2cc1ae,_0x44b964){if(!_[_0x586d('0x1d')](accountsTokens[_0x475889['id']])&&!_[_0x586d('0x1d')](accountsTokens[_0x475889['id']][_0x586d('0x1e')])){if(moment()['isBefore'](accountsTokens[_0x475889['id']][_0x586d('0x1f')])){_0x2cc1ae(accountsTokens[_0x475889['id']]['access_token']);}}var _0x3d3141;switch(_0x475889[_0x586d('0x20')]){case'US':_0x3d3141='https://accounts.zoho.com';break;case'AU':_0x3d3141=_0x586d('0x21');break;case'EU':_0x3d3141=_0x586d('0x22');break;case'IN':_0x3d3141='https://accounts.zoho.in';break;case'CN':_0x3d3141=_0x586d('0x23');break;default:_0x3d3141='https://accounts.zoho.eu';break;}var _0x30b4d2={'method':_0x586d('0x24'),'uri':_0x3d3141+_0x586d('0x25'),'qs':{'refresh_token':_0x475889[_0x586d('0x26')],'client_id':_0x475889['clientId'],'client_secret':_0x475889[_0x586d('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x30b4d2)['then'](function(_0x59d6ff){accountsTokens[_0x475889['id']]={'access_token':_0x59d6ff[_0x586d('0x1e')],'expires_in':moment()[_0x586d('0x28')](_0x59d6ff[_0x586d('0x1f')],_0x586d('0x29'))};_0x2cc1ae(_0x59d6ff['access_token']);})[_0x586d('0x2a')](function(_0x589134){logger[_0x586d('0x2b')](_0x586d('0x2c'),_0x589134[_0x586d('0x2d')]);_0x44b964(_0x589134);});});}function getUser(_0x2271fb,_0x58feef,_0x23dd1d,_0x34f83b){logger['info'](_0x586d('0x2e'));return request({'method':_0x586d('0x2f'),'uri':util[_0x586d('0x30')](_0x586d('0x31'),_0x58feef),'qs':{'type':_0x586d('0x32')},'headers':{'Authorization':_0x586d('0x33')+_0x2271fb},'json':!![]})[_0x586d('0x34')](function(_0x54f928){if(_0x54f928[_0x586d('0x35')]){var _0xaff881=-0x1;if(_[_0x586d('0x36')](_0x54f928[_0x586d('0x35')])){if(!_[_0x586d('0x1d')](_0x34f83b)){_0xaff881=_[_0x586d('0x37')](_0x54f928[_0x586d('0x35')],function(_0x51b854){return _0x51b854[_0x586d('0x38')]===_0x34f83b;});}if(_0xaff881>=0x0){logger[_0x586d('0x39')]('Agent\x20found!');}else{logger['info']('Using\x20the\x20admin\x20account!');_0xaff881=_[_0x586d('0x37')](_0x54f928[_0x586d('0x35')],function(_0x135449){return _0x135449[_0x586d('0x3a')][_0x586d('0x19')]==='Administrator';});}return _0x54f928[_0x586d('0x35')][_0xaff881];}else{if(_0x54f928[_0x586d('0x3b')][_0x586d('0x3a')][_0x586d('0x19')]==='Administrator'){logger['info']('Using\x20the\x20admin\x20account!');user=_0x54f928[_0x586d('0x3b')];return user;}else{logger[_0x586d('0x2b')](_0x586d('0x3c'),JSON[_0x586d('0x3d')](_0x54f928));throw new Error(_0x586d('0x3e')+JSON['stringify'](_0x54f928));}}}else{logger[_0x586d('0x2b')](_0x586d('0x3c'),JSON[_0x586d('0x3d')](_0x54f928));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x54f928));}})[_0x586d('0x2a')](function(_0x39ed7f){console[_0x586d('0x2b')](_0x39ed7f);});}function getZohoUser(_0x405ccb,_0x26986b){return new BPromise(function(_0x4859c8,_0x464390){request(_0x405ccb)[_0x586d('0x34')](function(_0x1ff09d){var _0x2a02da=null;if(_0x1ff09d){_0x2a02da=_0x1ff09d[_0x586d('0x3f')][0x0];_0x2a02da[_0x586d('0x40')]=_0x26986b;}_0x4859c8(_0x2a02da);})[_0x586d('0x2a')](function(_0x62ba9d){_0x464390(_0x62ba9d);});});}function createEndUser(_0xc044fe,_0x2ab268,_0xdc1531,_0xc02084,_0x1046dd,_0x2de408){var _0xdc1531=getName(_0xdc1531);return request({'method':_0x586d('0x24'),'uri':_0x586d('0x41')+_0x2ab268+_0x586d('0x42')+_[_0x586d('0x43')](_0x2de408['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xdc1531[0x1],'First_Name':_0xdc1531[0x0],'Phone':_0xc02084,'Owner':{'name':!_[_0x586d('0x1d')](_0x1046dd[_0x586d('0x44')][_0x586d('0x19')])?_0x1046dd[_0x586d('0x44')][_0x586d('0x19')]:!_[_0x586d('0x1d')](_0x1046dd[_0x586d('0x45')])?_0x1046dd['first_name']+'\x20'+_0x1046dd[_0x586d('0x46')]:_0x1046dd[_0x586d('0x46')],'id':_0x1046dd['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xc044fe},'json':!![]})[_0x586d('0x34')](function(_0x7ee0d7){if(_0x7ee0d7&&_0x7ee0d7['data'][0x0][_0x586d('0x47')]===_0x586d('0x48')){var _0x1d8a48=_0x7ee0d7['data'][0x0][_0x586d('0x49')];_0x1d8a48[_0x586d('0x40')]=_[_0x586d('0x43')](_0x2de408[_0x586d('0x4a')])+'s';return _0x1d8a48;}logger[_0x586d('0x2b')](_0x586d('0x3c'),JSON[_0x586d('0x3d')](data));throw new Error('Error:\x20'+JSON[_0x586d('0x3d')](data));})[_0x586d('0x2a')](function(_0x1defaf){console['log'](_0x586d('0x4b'),_0x1defaf);});}function getEndUser(_0x1e629a,_0x374623,_0x126579,_0xa97877,_0xbeb9b1,_0x4c9e92,_0x31bf4f){var _0x35213={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1e629a},'json':!![]};switch(_0x31bf4f[_0x586d('0x4c')]){case _0x586d('0x4d'):_0x35213[_0x586d('0x4e')]=_0x586d('0x41')+_0x374623+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xbeb9b1+'))';return getZohoUser(_0x35213,_0x586d('0x4f'))[_0x586d('0x34')](function(_0x362c35){if(_0x362c35)return _0x362c35;_0x35213[_0x586d('0x4e')]='https://www.zohoapis.'+_0x374623+_0x586d('0x50')+_0xbeb9b1+'))';return getZohoUser(_0x35213,'Leads')[_0x586d('0x34')](function(_0x25f107){if(_0x25f107)return _0x25f107;if(_0x31bf4f[_0x586d('0x4a')]!=_0x586d('0x51')){return createEndUser(_0x1e629a,_0x374623,_0xa97877,_0xbeb9b1,_0x4c9e92,_0x31bf4f);}else{return{};}});});break;case _0x586d('0x52'):_0x35213[_0x586d('0x4e')]='https://www.zohoapis.'+_0x374623+_0x586d('0x53')+_0xbeb9b1+'))';return getZohoUser(_0x35213,_0x586d('0x4f'))[_0x586d('0x34')](function(_0x2b57f3){if(_0x2b57f3)return _0x2b57f3;if(_0x31bf4f[_0x586d('0x4a')]!=_0x586d('0x51')){return createEndUser(_0x1e629a,_0x374623,_0xa97877,_0xbeb9b1,_0x4c9e92,_0x31bf4f);}else{return{};}});break;case _0x586d('0x54'):_0x35213[_0x586d('0x4e')]='https://www.zohoapis.'+_0x374623+_0x586d('0x50')+_0xbeb9b1+'))';return getZohoUser(_0x35213,_0x586d('0x55'))[_0x586d('0x34')](function(_0x102612){if(_0x102612)return _0x102612;if(_0x31bf4f[_0x586d('0x4a')]!='nothing'){return createEndUser(_0x1e629a,_0x374623,_0xa97877,_0xbeb9b1,_0x4c9e92,_0x31bf4f);}else{return{};}});break;}}function getCall(_0x24c0d6,_0x44f5eb,_0x4f9e1c,_0x1bfa02,_0x3f2443,_0xd00e84,_0xaf70de,_0x7c45b6){logger[_0x586d('0x39')](_0x586d('0x56'));var _0x2631ec={};_0x2631ec[_0x586d('0x57')]={'name':!_[_0x586d('0x1d')](_0x1bfa02[_0x586d('0x44')][_0x586d('0x19')])&&!_[_0x586d('0x1d')](_0x1bfa02[_0x586d('0x3a')][_0x586d('0x19')])&&_0x1bfa02[_0x586d('0x3a')][_0x586d('0x19')]===_0x586d('0x58')?_0x1bfa02[_0x586d('0x44')]['name']:!_['isNil'](_0x1bfa02['first_name'])?_0x1bfa02[_0x586d('0x45')]+'\x20'+_0x1bfa02['last_name']:_0x1bfa02[_0x586d('0x46')],'id':_0x1bfa02['id']};_0x2631ec[_0x586d('0x59')]=intUtil['getString'](_0xd00e84[_0x586d('0x5a')],_0xaf70de,'\x20');_0x2631ec[_0x586d('0x5b')]=intUtil[_0x586d('0x5c')](_0xd00e84[_0x586d('0x5d')],_0xaf70de,'\x0a');if(_0x3f2443[_0x586d('0x40')]===_0x586d('0x4f')){_0x2631ec[_0x586d('0x5e')]={'name':!_[_0x586d('0x1d')](_0x3f2443[_0x586d('0x5f')])?_0x3f2443[_0x586d('0x5f')]:!_[_0x586d('0x1d')](_0x3f2443[_0x586d('0x60')])?_0x3f2443[_0x586d('0x60')]+'\x20'+_0x3f2443['Last_Name']:_0x3f2443['Last_Name'],'id':_0x3f2443['id']};}if(_0x3f2443[_0x586d('0x40')]==='Leads'){_0x2631ec[_0x586d('0x61')]={'name':!_['isNil'](_0x3f2443['Full_Name'])?_0x3f2443[_0x586d('0x5f')]:!_[_0x586d('0x1d')](_0x3f2443[_0x586d('0x60')])?_0x3f2443[_0x586d('0x60')]+'\x20'+_0x3f2443[_0x586d('0x62')]:_0x3f2443['Last_Name'],'id':_0x3f2443['id']};_0x2631ec[_0x586d('0x63')]=_[_0x586d('0x43')](_0x3f2443['enduserType']);}if(_0xaf70de[_0x586d('0x64')]){_0x2631ec['Call_Duration']=moment[_0x586d('0x65')](parseInt(_0xaf70de[_0x586d('0x64')])*0x3e8)[_0x586d('0x30')]('mm:ss');}else if(_0xaf70de[_0x586d('0x66')]&&_0xaf70de[_0x586d('0x67')]){_0x2631ec['Call_Duration']=moment[_0x586d('0x65')](moment(_0xaf70de['endtime'],_0x586d('0x68'))[_0x586d('0x69')](moment(_0xaf70de[_0x586d('0x6a')],'YYYY-MM-DDTHH:mm:ss')))[_0x586d('0x30')](_0x586d('0x6b'));}switch(_0xaf70de['lastevent']){case _0x586d('0x6c'):_0x2631ec['Call_Result']=_0x586d('0x6d');break;case _0x586d('0x6e'):case _0x586d('0x6f'):_0x2631ec[_0x586d('0x70')]=_0x586d('0x71');break;case _0x586d('0x72'):_0x2631ec[_0x586d('0x70')]=_0x586d('0x73');break;case _0x586d('0x74'):_0x2631ec[_0x586d('0x70')]=_0x586d('0x75');break;case _0x586d('0x76'):_0x2631ec[_0x586d('0x70')]='Timeout';default:}_0x2631ec[_0x586d('0x77')]=(_0x7c45b6===_0x586d('0x78')?moment(_0xaf70de['starttime'])['format'](_0x586d('0x68')):moment(_0xaf70de[_0x586d('0x79')])[_0x586d('0x30')](_0x586d('0x68')))||moment()['format'](_0x586d('0x68'));_0x2631ec['Call_Type']=_0x7c45b6||_0x586d('0x7a');_0x2631ec=_[_0x586d('0x7b')](_0x2631ec,getCustomFields(_0xd00e84[_0x586d('0x7c')],_0xaf70de));return request({'method':_0x586d('0x24'),'uri':_0x586d('0x41')+_0x44f5eb+'/crm/v2/Calls','headers':{'Authorization':_0x586d('0x33')+_0x24c0d6},'body':{'data':[_0x2631ec]},'json':!![]})[_0x586d('0x34')](function(_0x3ac2fa){if(_0x3ac2fa&&_0x3ac2fa[_0x586d('0x3f')][0x0]['code']===_0x586d('0x48')){logger[_0x586d('0x39')](_0x586d('0x7d'));return{'id':_0x3ac2fa['data'][0x0][_0x586d('0x49')]['id']};}})[_0x586d('0x2a')](function(_0x480bb2){logger[_0x586d('0x39')](_0x586d('0x7e'),_0x480bb2[_0x586d('0x2d')]);console[_0x586d('0x7f')](_0x586d('0x7e'),_0x480bb2);});}exports[_0x586d('0x80')]=function(_0x1a9f92,_0x41c426,_0xa7b4a7,_0x1a8f42,_0x3a5481,_0x4ab2bd){var _0x2189ed,_0x31cda9,_0x1128fa;_0x4ab2bd[_0x586d('0x81')]=intUtil['stripTrailingSlash'](_0x4ab2bd['host']);_0x4ab2bd[_0x586d('0x82')]=intUtil[_0x586d('0x83')](_0x4ab2bd[_0x586d('0x82')]);if(_0x3a5481&&_0x3a5481[_0x586d('0x84')]){logger[_0x586d('0x39')](_0x586d('0x85'),_0x586d('0x86'));_0x41c426[_0x586d('0x87')]=_0x4ab2bd[_0x586d('0x82')]+_0x586d('0x88')+_0x41c426['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x41c426[_0x586d('0x89')]);}else{_0x41c426[_0x586d('0x87')]='';}var _0x23cae6=_0x4ab2bd[_0x586d('0x81')]===_0x586d('0x8a')?'eu':_0x586d('0x8b');return getAccessToken(_0x4ab2bd)['then'](function(_0x3291ba){_0x1128fa=_0x3291ba;return getUser(_0x1128fa,_0x23cae6,_0x4ab2bd,_0x1a8f42[_0x586d('0x38')]);})[_0x586d('0x34')](function(_0x33ce5b){_0x2189ed=_0x33ce5b;logger[_0x586d('0x39')](_0x586d('0x8c'),_0x2189ed['id']);return getEndUser(_0x1128fa,_0x23cae6,_0x4ab2bd,_0x41c426[_0x586d('0x8d')],_0x41c426[_0x586d('0x8e')],_0x2189ed,_0xa7b4a7);})[_0x586d('0x34')](function(_0x235559){_0x31cda9=_0x235559;return getCall(_0x1128fa,_0x23cae6,_0x4ab2bd,_0x2189ed,_0x31cda9,_0xa7b4a7,_0x41c426,_0x586d('0x7a'));})[_0x586d('0x34')](function(_0x446796){if(_0x446796){logger[_0x586d('0x39')]('The\x20Call\x20ID\x20is:',_0x446796['id']);logger[_0x586d('0x39')](_0x586d('0x85'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x586d('0x8f'),_0x1a8f42[_0x586d('0x19')]),'trigger:browser:url',{'uri':_0x586d('0x90')+_0x4ab2bd['host']+_0x586d('0x91')+_0x446796['id']});}})[_0x586d('0x2a')](function(_0x4d164f){logger['error'](_0x586d('0x85'),JSON['stringify'](_0x4d164f));});};exports['outbound']=function(_0x12c10f,_0x56e7bf,_0x9eb375,_0x4e89cd,_0xdb0282,_0xf8b7eb,_0x5bf14b){var _0x30eb08,_0xe61376,_0x30ec8c;_0xf8b7eb[_0x586d('0x81')]=intUtil['stripTrailingSlash'](_0xf8b7eb[_0x586d('0x81')]);_0xf8b7eb['serverUrl']=intUtil['stripTrailingSlash'](_0xf8b7eb[_0x586d('0x82')]);if(_0x5bf14b&&_0x5bf14b['recordingFormat']&&_0x5bf14b[_0x586d('0x92')]!==_0x586d('0x93')){logger[_0x586d('0x39')](_0x586d('0x94'),_0x586d('0x86'));_0x56e7bf[_0x586d('0x87')]=_0xf8b7eb[_0x586d('0x82')]+_0x586d('0x88')+_0x56e7bf[_0x586d('0x89')]+_0x586d('0x95')+md5(_0x56e7bf['uniqueid']);}var _0x504a0e=_0xf8b7eb[_0x586d('0x81')]===_0x586d('0x8a')?'eu':_0x586d('0x8b');return getAccessToken(_0xf8b7eb)[_0x586d('0x34')](function(_0x2ee450){_0x30ec8c=_0x2ee450;return getUser(_0x30ec8c,_0x504a0e,_0xf8b7eb,_0x4e89cd[_0x586d('0x38')]);})['then'](function(_0x9b5654){_0x30eb08=_0x9b5654;logger['info'](_0x586d('0x8c'),_0x30eb08['id']);return getEndUser(_0x30ec8c,_0x504a0e,_0xf8b7eb,_0x56e7bf[_0x586d('0x96')],_0x56e7bf[_0x586d('0x97')],_0x30eb08,_0x9eb375);})[_0x586d('0x34')](function(_0x329ceb){_0xe61376=_0x329ceb;return getCall(_0x30ec8c,_0x504a0e,_0xf8b7eb,_0x30eb08,_0xe61376,_0x9eb375,_0x56e7bf,_0x586d('0x98'));})[_0x586d('0x34')](function(_0x1f510){if(_0x1f510){logger[_0x586d('0x39')]('The\x20Call\x20ID\x20is:',_0x1f510['id']);logger['info']('[OUTBOUND]',_0x586d('0x99'));emit(util[_0x586d('0x30')](_0x586d('0x8f'),_0x4e89cd[_0x586d('0x19')]),_0x586d('0x9a'),{'uri':'https://crm.'+_0xf8b7eb[_0x586d('0x81')]+_0x586d('0x91')+_0x1f510['id']});}})['catch'](function(_0x43c7b1){logger[_0x586d('0x2b')](_0x586d('0x94'),JSON[_0x586d('0x3d')](_0x43c7b1));});};exports[_0x586d('0x9b')]=function(_0x3af552,_0x3c134d,_0x2d228f,_0x57b390,_0x593c40,_0x36b4a2){var _0xb0f21d,_0x2b85b8,_0x50659a;_0x36b4a2[_0x586d('0x81')]=intUtil['stripTrailingSlash'](_0x36b4a2[_0x586d('0x81')]);_0x36b4a2['serverUrl']=intUtil[_0x586d('0x83')](_0x36b4a2[_0x586d('0x82')]);if(_0x593c40&&_0x593c40['monitor_format']){logger[_0x586d('0x39')]('['+_0x3c134d[_0x586d('0x9c')][_0x586d('0x9d')]()+']',_0x586d('0x86'));_0x3c134d[_0x586d('0x87')]=_0x36b4a2[_0x586d('0x82')]+'/api/voice/recordings/'+_0x3c134d['uniqueid']+_0x586d('0x95')+md5(_0x3c134d[_0x586d('0x89')]);}else{_0x3c134d[_0x586d('0x87')]='';}var _0x4aaa03=_0x36b4a2[_0x586d('0x81')]===_0x586d('0x8a')?'eu':_0x586d('0x8b');return getAccessToken(_0x36b4a2)[_0x586d('0x34')](function(_0x2dff9c){_0x50659a=_0x2dff9c;return getUser(_0x50659a,_0x4aaa03,_0x36b4a2);})[_0x586d('0x34')](function(_0x20c917){_0xb0f21d=_0x20c917;logger['info'](_0x586d('0x8c'),_0xb0f21d['id']);return getEndUser(_0x50659a,_0x4aaa03,_0x36b4a2,_0x3c134d['calleridname'],_0x3c134d[_0x586d('0x8e')],_0xb0f21d,_0x2d228f);})['then'](function(_0x44e96f){_0x2b85b8=_0x44e96f;return getCall(_0x50659a,_0x4aaa03,_0x36b4a2,_0xb0f21d,_0x2b85b8,_0x2d228f,_0x3c134d,_0x586d('0x7a'));})[_0x586d('0x34')](function(_0x3d9ab8){if(_0x3d9ab8){logger['info'](_0x586d('0x9e'),_0x3d9ab8['id']);}})[_0x586d('0x2a')](function(_0x39f069){logger['error']('['+_0x3c134d[_0x586d('0x9c')][_0x586d('0x9d')]()+']',JSON[_0x586d('0x3d')](_0x39f069));});}; \ 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 114e0ee..b6a3e00 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 _0x5379=['mustache','../../../../config/logger','trigger','exec','data2','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs'];(function(_0x169d3d,_0x47b280){var _0x6768ec=function(_0x4c0214){while(--_0x4c0214){_0x169d3d['push'](_0x169d3d['shift']());}};_0x6768ec(++_0x47b280);}(_0x5379,0x1ea));var _0x9537=function(_0xe5f424,_0x36aeb8){_0xe5f424=_0xe5f424-0x0;var _0x986e28=_0x5379[_0xe5f424];return _0x986e28;};'use strict';var util=require(_0x9537('0x0'));var sh=require(_0x9537('0x1'));var Mustache=require(_0x9537('0x2'));var logger=require(_0x9537('0x3'))(_0x9537('0x4'));exports[_0x9537('0x5')]=function(_0x931f83,_0x1774f3){var _0x2524fe=_0x931f83[_0x9537('0x6')]?_0x931f83[_0x9537('0x6')]:'Script';var _0x19c4fc=_0x931f83[_0x9537('0x7')]?Mustache[_0x9537('0x8')](_0x931f83[_0x9537('0x7')],_0x1774f3):_0x1774f3;sh[_0x9537('0x5')](_0x19c4fc,function(_0x4bf26f,_0x20dbed,_0x564641){if(_0x4bf26f!==0x0){logger['error'](util[_0x9537('0x9')](_0x9537('0xa'),_0x2524fe,_0x19c4fc,_0x4bf26f,_0x564641));}else{logger[_0x9537('0xb')](util[_0x9537('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2524fe,_0x19c4fc,_0x20dbed));}});}; \ No newline at end of file +var _0x7a09=['render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','shelljs','mustache','../../../../config/logger','exec','data2','Script','data3'];(function(_0x1c7c88,_0x5e3dbd){var _0x4ba224=function(_0x377b22){while(--_0x377b22){_0x1c7c88['push'](_0x1c7c88['shift']());}};_0x4ba224(++_0x5e3dbd);}(_0x7a09,0x1a9));var _0x97a0=function(_0x406b98,_0x3dea6d){_0x406b98=_0x406b98-0x0;var _0x10545f=_0x7a09[_0x406b98];return _0x10545f;};'use strict';var util=require('util');var sh=require(_0x97a0('0x0'));var Mustache=require(_0x97a0('0x1'));var logger=require(_0x97a0('0x2'))('trigger');exports[_0x97a0('0x3')]=function(_0x3b3026,_0x4cec97){var _0x34ec87=_0x3b3026[_0x97a0('0x4')]?_0x3b3026['data2']:_0x97a0('0x5');var _0x140d58=_0x3b3026[_0x97a0('0x6')]?Mustache[_0x97a0('0x7')](_0x3b3026[_0x97a0('0x6')],_0x4cec97):_0x4cec97;sh[_0x97a0('0x3')](_0x140d58,function(_0x521e7b,_0x1c2cc6,_0x40d010){if(_0x521e7b!==0x0){logger[_0x97a0('0x8')](util[_0x97a0('0x9')](_0x97a0('0xa'),_0x34ec87,_0x140d58,_0x521e7b,_0x40d010));}else{logger[_0x97a0('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x34ec87,_0x140d58,_0x1c2cc6));}});}; \ 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 efbaf14..757ac92 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 _0x0c67=['headers','data6','parse','render','error','stack','GET','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','format','catch','statusCode','name','message','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data5','number'];(function(_0x1927be,_0xc5743a){var _0x1d44ea=function(_0x496189){while(--_0x496189){_0x1927be['push'](_0x1927be['shift']());}};_0x1d44ea(++_0xc5743a);}(_0x0c67,0xf7));var _0x70c6=function(_0x1003c0,_0x4d0715){_0x1003c0=_0x1003c0-0x0;var _0x58420d=_0x0c67[_0x1003c0];return _0x58420d;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x70c6('0x0'));var Mustache=require(_0x70c6('0x1'));var logger=require(_0x70c6('0x2'))(_0x70c6('0x3'));exports[_0x70c6('0x4')]=function(_0x3896a4,_0x590867){var _0x5c8a16,_0x2e22a2;var _0x484fa0={'method':_0x3896a4[_0x70c6('0x5')][_0x70c6('0x6')](),'uri':Mustache['render'](_0x3896a4['data2'],_0x590867),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3896a4[_0x70c6('0x7')])===_0x70c6('0x8')&&parseInt(_0x3896a4['data5'])>=0x1&&parseInt(_0x3896a4['data5'])<=0xa?parseInt(_0x3896a4['data5'])*0x3e8:0x5*0x3e8};try{_0x484fa0[_0x70c6('0x9')]=_0x3896a4[_0x70c6('0xa')]?JSON[_0x70c6('0xb')](Mustache[_0x70c6('0xc')](_0x3896a4[_0x70c6('0xa')],_0x590867)):{};}catch(_0x3321fb){logger[_0x70c6('0xd')](_0x3321fb[_0x70c6('0xe')]);}switch(_0x3896a4[_0x70c6('0x5')][_0x70c6('0x6')]()){case _0x70c6('0xf'):case'DELETE':_0x5c8a16=null;_0x484fa0['qs']=_0x590867;break;case'POST':case _0x70c6('0x10'):if(_0x3896a4[_0x70c6('0x11')]){try{_0x5c8a16=JSON[_0x70c6('0xb')](Mustache[_0x70c6('0xc')](_0x3896a4[_0x70c6('0x11')],_0x590867));_0x484fa0[_0x70c6('0x12')]=_0x5c8a16;}catch(_0x554e1c){logger[_0x70c6('0xd')](_0x554e1c['stack']);logger[_0x70c6('0xd')](_0x70c6('0x13'));}}else{_0x5c8a16=_0x590867;_0x484fa0[_0x70c6('0x12')]=_0x5c8a16;}break;}logger[_0x70c6('0x14')](util['format'](_0x70c6('0x15'),_0x3896a4[_0x70c6('0x5')],_0x3896a4[_0x70c6('0x16')],JSON['stringify'](_0x484fa0)));rp(_0x484fa0)[_0x70c6('0x17')](function(_0x949df7){_0x5c8a16=!_[_0x70c6('0x18')](_0x5c8a16)?_0x70c6('0x19')+_0x5c8a16:'';_0x2e22a2=typeof _0x949df7[_0x70c6('0x12')]===_0x70c6('0x1a')?JSON['stringify'](_0x949df7[_0x70c6('0x12')]):_0x949df7['body'];logger[_0x70c6('0x14')](util[_0x70c6('0x1b')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3896a4[_0x70c6('0x5')],_0x3896a4[_0x70c6('0x16')],_0x949df7['statusCode'],_0x2e22a2));})[_0x70c6('0x1c')](function(_0x5b809f){logger[_0x70c6('0xd')](util[_0x70c6('0x1b')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3896a4['data1'],_0x3896a4[_0x70c6('0x16')],_0x5b809f[_0x70c6('0x1d')],_0x5b809f[_0x70c6('0x1e')],_0x5b809f[_0x70c6('0x1f')]));});}; \ No newline at end of file +var _0xf9fd=['GET','DELETE','POST','PUT','data7','stack','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','util','mustache','../../../../config/logger','trigger','exec','data1','data2','number','data5','headers','data6','parse','render','error'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf9fd,0x19f));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var rp=require('request-promise');var util=require(_0xdf9f('0x0'));var _=require('lodash');var Mustache=require(_0xdf9f('0x1'));var logger=require(_0xdf9f('0x2'))(_0xdf9f('0x3'));exports[_0xdf9f('0x4')]=function(_0x31f98d,_0x388573){var _0x565017,_0x4c79e3;var _0x48b7f0={'method':_0x31f98d[_0xdf9f('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x31f98d[_0xdf9f('0x6')],_0x388573),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x31f98d['data5'])===_0xdf9f('0x7')&&parseInt(_0x31f98d[_0xdf9f('0x8')])>=0x1&&parseInt(_0x31f98d[_0xdf9f('0x8')])<=0xa?parseInt(_0x31f98d['data5'])*0x3e8:0x5*0x3e8};try{_0x48b7f0[_0xdf9f('0x9')]=_0x31f98d[_0xdf9f('0xa')]?JSON[_0xdf9f('0xb')](Mustache[_0xdf9f('0xc')](_0x31f98d[_0xdf9f('0xa')],_0x388573)):{};}catch(_0x1bca6d){logger[_0xdf9f('0xd')](_0x1bca6d['stack']);}switch(_0x31f98d[_0xdf9f('0x5')]['toUpperCase']()){case _0xdf9f('0xe'):case _0xdf9f('0xf'):_0x565017=null;_0x48b7f0['qs']=_0x388573;break;case _0xdf9f('0x10'):case _0xdf9f('0x11'):if(_0x31f98d[_0xdf9f('0x12')]){try{_0x565017=JSON[_0xdf9f('0xb')](Mustache[_0xdf9f('0xc')](_0x31f98d['data7'],_0x388573));_0x48b7f0['body']=_0x565017;}catch(_0x26c698){logger[_0xdf9f('0xd')](_0x26c698[_0xdf9f('0x13')]);logger[_0xdf9f('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x565017=_0x388573;_0x48b7f0[_0xdf9f('0x14')]=_0x565017;}break;}logger[_0xdf9f('0x15')](util[_0xdf9f('0x16')](_0xdf9f('0x17'),_0x31f98d['data1'],_0x31f98d[_0xdf9f('0x6')],JSON[_0xdf9f('0x18')](_0x48b7f0)));rp(_0x48b7f0)[_0xdf9f('0x19')](function(_0x4348ea){_0x565017=!_[_0xdf9f('0x1a')](_0x565017)?_0xdf9f('0x1b')+_0x565017:'';_0x4c79e3=typeof _0x4348ea['body']===_0xdf9f('0x1c')?JSON[_0xdf9f('0x18')](_0x4348ea[_0xdf9f('0x14')]):_0x4348ea['body'];logger[_0xdf9f('0x15')](util[_0xdf9f('0x16')](_0xdf9f('0x1d'),_0x31f98d[_0xdf9f('0x5')],_0x31f98d[_0xdf9f('0x6')],_0x4348ea[_0xdf9f('0x1e')],_0x4c79e3));})[_0xdf9f('0x1f')](function(_0x4082a8){logger['error'](util[_0xdf9f('0x16')](_0xdf9f('0x20'),_0x31f98d[_0xdf9f('0x5')],_0x31f98d[_0xdf9f('0x6')],_0x4082a8[_0xdf9f('0x1e')],_0x4082a8['name'],_0x4082a8['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 800fa02..dec47b7 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 _0x971e=['error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','rpc'];(function(_0x5cac26,_0x37dc6a){var _0x23bf56=function(_0x351d1e){while(--_0x351d1e){_0x5cac26['push'](_0x5cac26['shift']());}};_0x23bf56(++_0x37dc6a);}(_0x971e,0xc8));var _0xe971=function(_0x4a4e66,_0x168cad){_0x4a4e66=_0x4a4e66-0x0;var _0x1aff21=_0x971e[_0x4a4e66];return _0x1aff21;};'use strict';var jayson=require(_0xe971('0x0'));var BPromise=require(_0xe971('0x1'));var logger=require(_0xe971('0x2'))(_0xe971('0x3'));var client=jayson[_0xe971('0x4')][_0xe971('0x5')]({'port':0x2329});client[_0xe971('0x6')]=function(_0x3cf3fe,_0xe4982d){return new BPromise(function(_0x506f44,_0x4cf03e){return client[_0xe971('0x7')](_0x3cf3fe,_0xe4982d)[_0xe971('0x8')](function(_0x3816e5){logger['debug'](_0xe971('0x9'),_0xe971('0x3'),_0x3cf3fe,_0xe4982d,_0x3816e5);if(_0x3816e5[_0xe971('0xa')]){logger[_0xe971('0xa')](_0xe971('0x9'),_0xe971('0x3'),_0x3cf3fe,_0x3816e5[_0xe971('0xa')][_0xe971('0xb')],_0xe4982d);return _0x4cf03e(_0x3816e5[_0xe971('0xa')]['message']);}else{return _0x506f44(_0x3816e5['result']);}})[_0xe971('0xc')](function(_0x219207){logger['error']('rpc',_0xe971('0x3'),_0x3cf3fe,_0x219207,_0xe4982d);return _0x4cf03e(_0x219207);});});};module[_0xe971('0xd')]=client; \ No newline at end of file +var _0xd362=['then','debug','rpc','error','message','catch','routing','exports','jayson/promise','bluebird','../../config/logger','Request','request'];(function(_0x342db7,_0x2f2fac){var _0x2742e1=function(_0x43c1b5){while(--_0x43c1b5){_0x342db7['push'](_0x342db7['shift']());}};_0x2742e1(++_0x2f2fac);}(_0xd362,0x70));var _0x2d36=function(_0x1201bd,_0x44ad0b){_0x1201bd=_0x1201bd-0x0;var _0x302b73=_0xd362[_0x1201bd];return _0x302b73;};'use strict';var jayson=require(_0x2d36('0x0'));var BPromise=require(_0x2d36('0x1'));var logger=require(_0x2d36('0x2'))('routing');var client=jayson['client']['http']({'port':0x2329});client[_0x2d36('0x3')]=function(_0x151ad3,_0x5576ef){return new BPromise(function(_0x1a4201,_0x468968){return client[_0x2d36('0x4')](_0x151ad3,_0x5576ef)[_0x2d36('0x5')](function(_0x2f048b){logger[_0x2d36('0x6')](_0x2d36('0x7'),'routing',_0x151ad3,_0x5576ef,_0x2f048b);if(_0x2f048b[_0x2d36('0x8')]){logger['error'](_0x2d36('0x7'),'routing',_0x151ad3,_0x2f048b['error']['message'],_0x5576ef);return _0x468968(_0x2f048b[_0x2d36('0x8')][_0x2d36('0x9')]);}else{return _0x1a4201(_0x2f048b['result']);}})[_0x2d36('0xa')](function(_0x3300b8){logger['error'](_0x2d36('0x7'),_0x2d36('0xb'),_0x151ad3,_0x3300b8,_0x5576ef);return _0x468968(_0x3300b8);});});};module[_0x2d36('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index ce33c6e..b3e8c64 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 _0xcbc1=['getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then'];(function(_0x39d711,_0xe11eb7){var _0xee1d0c=function(_0x457e08){while(--_0x457e08){_0x39d711['push'](_0x39d711['shift']());}};_0xee1d0c(++_0xe11eb7);}(_0xcbc1,0x149));var _0x1cbc=function(_0x140d94,_0x25e2a5){_0x140d94=_0x140d94-0x0;var _0x50ecb7=_0xcbc1[_0x140d94];return _0x50ecb7;};'use strict';var server=require(_0x1cbc('0x0'));var Realtime=require(_0x1cbc('0x1'));var EmailChannel=require(_0x1cbc('0x2'));var mailAccount=require(_0x1cbc('0x3'));var setting=require(_0x1cbc('0x4'));var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x1cbc('0x5')]()[_0x1cbc('0x6')](mailAccount[_0x1cbc('0x7')]())[_0x1cbc('0x6')](realtime[_0x1cbc('0x8')]())[_0x1cbc('0x6')](function(){email[_0x1cbc('0x9')](realtime[_0x1cbc('0xa')]);return realtime;});}function main(){return server[_0x1cbc('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0x1cbc('0x6')](function(){return setting[_0x1cbc('0xc')]();})[_0x1cbc('0x6')](function(_0x1332b2){return setInterval(initRealtime,_0x1332b2['loginMailFrequency']*0x3e8);})[_0x1cbc('0xd')](function(_0x378a52){logger[_0x1cbc('0xe')](_0x1cbc('0xf'),_0x378a52);});}main(); \ No newline at end of file +var _0x77a0=['email','resolve','then','refresh','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x77a0,0x1ea));var _0x077a=function(_0xcbf03b,_0x2ddbfd){_0xcbf03b=_0xcbf03b-0x0;var _0x2384a6=_0x77a0[_0xcbf03b];return _0x2384a6;};'use strict';var server=require(_0x077a('0x0'));var Realtime=require(_0x077a('0x1'));var EmailChannel=require(_0x077a('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x077a('0x3'));var logger=require(_0x077a('0x4'))(_0x077a('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x077a('0x6')]()[_0x077a('0x7')](mailAccount['getMailAccounts']())[_0x077a('0x7')](realtime['initMailAccounts']())[_0x077a('0x7')](function(){email[_0x077a('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x077a('0x9')](realtime,email)[_0x077a('0x7')](function(){return initRealtime();})[_0x077a('0x7')](function(){return setting[_0x077a('0xa')]();})[_0x077a('0x7')](function(_0x33f4c1){return setInterval(initRealtime,_0x33f4c1[_0x077a('0xb')]*0x3e8);})[_0x077a('0xc')](function(_0x4ce977){logger[_0x077a('0xd')](_0x077a('0xe'),_0x4ce977);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f59a08f..4c58370 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 _0x5f89=['refresh','hasOwnProperty','active','service','custom','provider','box','bind','email','handleImapEmail','end','error','handleImapError','isNil','status','disabled','handleImapBox','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','send','Smtp','lastSync','verify','verified','exports','lodash','bluebird','../../../config/environment','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','Imap','messageStatus','total','md5','mailAccount:update'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5f89,0x1aa));var _0x95f8=function(_0x57f5ba,_0x3a4db9){_0x57f5ba=_0x57f5ba-0x0;var _0x4abff3=_0x5f89[_0x57f5ba];return _0x4abff3;};'use strict';var _=require(_0x95f8('0x0'));var moment=require('moment');var BPromise=require(_0x95f8('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x95f8('0x2'));var logger=require('../../../config/logger')('email');config[_0x95f8('0x3')]=_[_0x95f8('0x4')](config[_0x95f8('0x3')],{'host':_0x95f8('0x5'),'port':0x18eb});var io=require(_0x95f8('0x6'))(new Redis(config[_0x95f8('0x3')]));var EmailImap=require(_0x95f8('0x7'));var EmailSmtp=require(_0x95f8('0x8'));var mailAccount=require(_0x95f8('0x9'));var md5Accounts={};function EmailChannel(_0x516c71){logger['info'](_0x95f8('0xa'));this[_0x95f8('0xb')]=_0x516c71[_0x95f8('0xb')];this[_0x95f8('0xc')]={};this[_0x95f8('0xd')]=new EmailSmtp();}EmailChannel[_0x95f8('0xe')][_0x95f8('0xf')]=function(_0x9deb4){var _0x5eab35=this[_0x95f8('0xb')][_0x9deb4];var _0x4a3e73={'id':_0x5eab35['id'],'name':_0x5eab35['name'],'key':_0x5eab35[_0x95f8('0x10')],'active':_0x5eab35['active'],'Imap':{'status':_0x5eab35['Imap']['status'],'messageStatus':_0x5eab35[_0x95f8('0x11')][_0x95f8('0x12')],'total':_0x5eab35[_0x95f8('0x11')][_0x95f8('0x13')]}};if(_['isNil'](md5Accounts[_0x9deb4])){md5Accounts[_0x9deb4]={};}var _0x7c29d5=md5(JSON['stringify'](_0x4a3e73));if(md5Accounts[_0x9deb4][_0x95f8('0x14')]!==_0x7c29d5){md5Accounts[_0x9deb4][_0x95f8('0x14')]=_0x7c29d5;io[_0x95f8('0xf')](_0x95f8('0x15'),_0x4a3e73);}};EmailChannel['prototype'][_0x95f8('0x16')]=function(_0x486768){for(var _0xbb7382 in _0x486768){if(_0x486768[_0x95f8('0x17')](_0xbb7382)){if(_0x486768[_0xbb7382]['Imap']&&_0x486768[_0xbb7382][_0x95f8('0x18')]){var _0x5981e4=_0x486768[_0xbb7382][_0x95f8('0x11')];if(!_0x5981e4[_0x95f8('0x19')]&&_0x486768[_0xbb7382]['provider']!==_0x95f8('0x1a'))_0x5981e4[_0x95f8('0x19')]=_0x486768[_0xbb7382][_0x95f8('0x1b')];if(!this[_0x95f8('0xc')][_0x95f8('0x17')](_0x5981e4['id'])){this[_0x95f8('0xc')][_0x5981e4['id']]=new EmailImap(_0x5981e4,_0x486768[_0xbb7382]['email']);this['imapAccounts'][_0x5981e4['id']]['on'](_0x95f8('0x1c'),this['handleImapBox'][_0x95f8('0x1d')](this,_0xbb7382));this[_0x95f8('0xc')][_0x5981e4['id']]['on'](_0x95f8('0x1e'),this[_0x95f8('0x1f')]['bind'](this,_0xbb7382));this[_0x95f8('0xc')][_0x5981e4['id']]['on'](_0x95f8('0x20'),this['handleImapEnd'][_0x95f8('0x1d')](this,_0xbb7382));this[_0x95f8('0xc')][_0x5981e4['id']]['on'](_0x95f8('0x21'),this[_0x95f8('0x22')][_0x95f8('0x1d')](this,_0xbb7382));}}else{if(_[_0x95f8('0x23')](this[_0x95f8('0xb')][_0xbb7382][_0x95f8('0x11')])){this['mailAccounts'][_0xbb7382]['Imap']={};}this['mailAccounts'][_0xbb7382][_0x95f8('0x11')][_0x95f8('0x24')]=_0x95f8('0x25');this['mailAccounts'][_0xbb7382][_0x95f8('0x11')][_0x95f8('0x12')]='';this[_0x95f8('0xf')](_0xbb7382);}}}};EmailChannel[_0x95f8('0xe')][_0x95f8('0x26')]=function(_0x13c213,_0x5a9ceb){if(this['mailAccounts'][_0x13c213]){this['mailAccounts'][_0x13c213][_0x95f8('0x11')]['status']='connected';this[_0x95f8('0xb')][_0x13c213][_0x95f8('0x11')]['messageStatus']=_0x5a9ceb[_0x95f8('0x27')];if(_0x5a9ceb[_0x95f8('0x28')]){this[_0x95f8('0xb')][_0x13c213]['Imap'][_0x95f8('0x13')]=_0x5a9ceb['messages'][_0x95f8('0x13')];}return this[_0x95f8('0xf')](_0x13c213);}};EmailChannel[_0x95f8('0xe')][_0x95f8('0x1f')]=function(_0x85ccc8,_0x23d5f3){logger['info'](_0x95f8('0x29'),_0x23d5f3['firstName'],_0x23d5f3[_0x95f8('0x2a')],_0x23d5f3['from'],_0x85ccc8);if(this['mailAccounts'][_0x85ccc8]){return mailAccount[_0x95f8('0x2b')](_0x85ccc8,_0x23d5f3)[_0x95f8('0x2c')](function(_0x10bb1b){if(_0x10bb1b){logger['info'](_0x95f8('0x2d'));}})[_0x95f8('0x2e')](function(_0x2d5a3d){logger[_0x95f8('0x21')](_0x95f8('0x2f'),JSON['stringify'](_0x2d5a3d));});}};EmailChannel[_0x95f8('0xe')][_0x95f8('0x30')]=function(_0x32eb73){if(this[_0x95f8('0xb')][_0x32eb73]&&this[_0x95f8('0xb')][_0x32eb73][_0x95f8('0x11')]){if(this[_0x95f8('0xc')][this[_0x95f8('0xb')][_0x32eb73][_0x95f8('0x11')]['id']]){delete this['imapAccounts'][this[_0x95f8('0xb')][_0x32eb73][_0x95f8('0x11')]['id']];}this[_0x95f8('0xb')][_0x32eb73][_0x95f8('0x11')]['lastSync']=moment();this[_0x95f8('0xf')](_0x32eb73);}};EmailChannel[_0x95f8('0xe')]['handleImapError']=function(_0x2de0a0,_0x88c09a){if(this[_0x95f8('0xb')][_0x2de0a0]){this[_0x95f8('0xb')][_0x2de0a0][_0x95f8('0x11')][_0x95f8('0x24')]=_0x95f8('0x21');this[_0x95f8('0xb')][_0x2de0a0][_0x95f8('0x11')][_0x95f8('0x12')]=_0x88c09a;return this[_0x95f8('0xf')](_0x2de0a0);}};EmailChannel['prototype'][_0x95f8('0x31')]=function(_0x19448e,_0x37af91){return this['smtp'][_0x95f8('0x32')](_0x19448e,_0x37af91);};EmailChannel['prototype']['verifySmtp']=function(_0x528d73){var _0x3edb41=this;if(this[_0x95f8('0xb')][_0x528d73['id']]){if(_['isNil'](this[_0x95f8('0xb')][_0x528d73['id']][_0x95f8('0x33')])){this[_0x95f8('0xb')][_0x528d73['id']][_0x95f8('0x33')]={};}this[_0x95f8('0xb')][_0x528d73['id']][_0x95f8('0x33')][_0x95f8('0x34')]=moment();return new BPromise(function(_0x4b2ac1,_0x1788c9){return _0x3edb41[_0x95f8('0xd')][_0x95f8('0x35')](_0x528d73)['then'](function(_0x59d290){_0x3edb41[_0x95f8('0xb')][_0x528d73['id']]['Smtp'][_0x95f8('0x24')]=_0x95f8('0x36');_0x3edb41[_0x95f8('0xb')][_0x528d73['id']][_0x95f8('0x33')][_0x95f8('0x12')]='';_0x3edb41[_0x95f8('0xf')](_0x528d73['id']);_0x4b2ac1(_0x59d290);})[_0x95f8('0x2e')](function(_0x29bc76){_0x3edb41[_0x95f8('0xb')][_0x528d73['id']][_0x95f8('0x33')][_0x95f8('0x24')]=_0x95f8('0x21');_0x3edb41[_0x95f8('0xb')][_0x528d73['id']][_0x95f8('0x33')]['messageStatus']=_0x29bc76;_0x3edb41[_0x95f8('0xf')](_0x528d73['id']);_0x1788c9(_0x29bc76);});});}return this[_0x95f8('0xd')][_0x95f8('0x35')](_0x528d73);};module[_0x95f8('0x37')]=EmailChannel; \ No newline at end of file +var _0x1501=['status','total','stringify','md5','mailAccount:update','prototype','active','provider','custom','hasOwnProperty','email','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','messageStatus','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','smtp','verifySmtp','Smtp','verify','verified','exports','lodash','moment','ioredis','../../../config/logger','defaults','redis','socket.io-emitter','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','key','Imap'];(function(_0x15d16e,_0x42a683){var _0x37a10e=function(_0x32dc2a){while(--_0x32dc2a){_0x15d16e['push'](_0x15d16e['shift']());}};_0x37a10e(++_0x42a683);}(_0x1501,0xe6));var _0x1150=function(_0x29d312,_0x951117){_0x29d312=_0x29d312-0x0;var _0x1fe04b=_0x1501[_0x29d312];return _0x1fe04b;};'use strict';var _=require(_0x1150('0x0'));var moment=require(_0x1150('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x1150('0x2'));var config=require('../../../config/environment');var logger=require(_0x1150('0x3'))('email');config['redis']=_[_0x1150('0x4')](config[_0x1150('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1150('0x6'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x1150('0x7'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3b8bc0){logger['info'](_0x1150('0x8'));this[_0x1150('0x9')]=_0x3b8bc0[_0x1150('0x9')];this[_0x1150('0xa')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x1150('0xb')]=function(_0x1ec28d){var _0x183265=this['mailAccounts'][_0x1ec28d];var _0x3dc997={'id':_0x183265['id'],'name':_0x183265[_0x1150('0xc')],'key':_0x183265[_0x1150('0xd')],'active':_0x183265['active'],'Imap':{'status':_0x183265[_0x1150('0xe')][_0x1150('0xf')],'messageStatus':_0x183265[_0x1150('0xe')]['messageStatus'],'total':_0x183265[_0x1150('0xe')][_0x1150('0x10')]}};if(_['isNil'](md5Accounts[_0x1ec28d])){md5Accounts[_0x1ec28d]={};}var _0x9fe23=md5(JSON[_0x1150('0x11')](_0x3dc997));if(md5Accounts[_0x1ec28d][_0x1150('0x12')]!==_0x9fe23){md5Accounts[_0x1ec28d][_0x1150('0x12')]=_0x9fe23;io[_0x1150('0xb')](_0x1150('0x13'),_0x3dc997);}};EmailChannel[_0x1150('0x14')]['refresh']=function(_0x3e2f97){for(var _0x360f0e in _0x3e2f97){if(_0x3e2f97['hasOwnProperty'](_0x360f0e)){if(_0x3e2f97[_0x360f0e]['Imap']&&_0x3e2f97[_0x360f0e][_0x1150('0x15')]){var _0x4b25a3=_0x3e2f97[_0x360f0e]['Imap'];if(!_0x4b25a3['service']&&_0x3e2f97[_0x360f0e][_0x1150('0x16')]!==_0x1150('0x17'))_0x4b25a3['service']=_0x3e2f97[_0x360f0e][_0x1150('0x16')];if(!this['imapAccounts'][_0x1150('0x18')](_0x4b25a3['id'])){this[_0x1150('0xa')][_0x4b25a3['id']]=new EmailImap(_0x4b25a3,_0x3e2f97[_0x360f0e][_0x1150('0x19')]);this[_0x1150('0xa')][_0x4b25a3['id']]['on']('box',this[_0x1150('0x1a')][_0x1150('0x1b')](this,_0x360f0e));this[_0x1150('0xa')][_0x4b25a3['id']]['on']('email',this[_0x1150('0x1c')]['bind'](this,_0x360f0e));this[_0x1150('0xa')][_0x4b25a3['id']]['on'](_0x1150('0x1d'),this[_0x1150('0x1e')]['bind'](this,_0x360f0e));this[_0x1150('0xa')][_0x4b25a3['id']]['on'](_0x1150('0x1f'),this[_0x1150('0x20')][_0x1150('0x1b')](this,_0x360f0e));}}else{if(_[_0x1150('0x21')](this[_0x1150('0x9')][_0x360f0e][_0x1150('0xe')])){this[_0x1150('0x9')][_0x360f0e][_0x1150('0xe')]={};}this[_0x1150('0x9')][_0x360f0e][_0x1150('0xe')][_0x1150('0xf')]=_0x1150('0x22');this[_0x1150('0x9')][_0x360f0e][_0x1150('0xe')]['messageStatus']='';this[_0x1150('0xb')](_0x360f0e);}}}};EmailChannel[_0x1150('0x14')][_0x1150('0x1a')]=function(_0x5bcd6b,_0x5f2978){if(this[_0x1150('0x9')][_0x5bcd6b]){this[_0x1150('0x9')][_0x5bcd6b][_0x1150('0xe')]['status']='connected';this['mailAccounts'][_0x5bcd6b][_0x1150('0xe')][_0x1150('0x23')]=_0x5f2978['name'];if(_0x5f2978[_0x1150('0x24')]){this[_0x1150('0x9')][_0x5bcd6b][_0x1150('0xe')][_0x1150('0x10')]=_0x5f2978[_0x1150('0x24')][_0x1150('0x10')];}return this[_0x1150('0xb')](_0x5bcd6b);}};EmailChannel[_0x1150('0x14')]['handleImapEmail']=function(_0xf5f00b,_0x5def83){logger[_0x1150('0x25')](_0x1150('0x26'),_0x5def83['firstName'],_0x5def83[_0x1150('0x27')],_0x5def83['from'],_0xf5f00b);if(this[_0x1150('0x9')][_0xf5f00b]){return mailAccount['notify'](_0xf5f00b,_0x5def83)[_0x1150('0x28')](function(_0x32bf4b){if(_0x32bf4b){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x1150('0x29')](function(_0x8fda81){logger['error'](_0x1150('0x2a'),JSON[_0x1150('0x11')](_0x8fda81));});}};EmailChannel[_0x1150('0x14')]['handleImapEnd']=function(_0x1da13d){if(this[_0x1150('0x9')][_0x1da13d]&&this[_0x1150('0x9')][_0x1da13d][_0x1150('0xe')]){if(this[_0x1150('0xa')][this[_0x1150('0x9')][_0x1da13d]['Imap']['id']]){delete this[_0x1150('0xa')][this['mailAccounts'][_0x1da13d][_0x1150('0xe')]['id']];}this[_0x1150('0x9')][_0x1da13d][_0x1150('0xe')]['lastSync']=moment();this['emit'](_0x1da13d);}};EmailChannel[_0x1150('0x14')]['handleImapError']=function(_0x133544,_0x37870a){if(this[_0x1150('0x9')][_0x133544]){this[_0x1150('0x9')][_0x133544][_0x1150('0xe')][_0x1150('0xf')]=_0x1150('0x1f');this['mailAccounts'][_0x133544][_0x1150('0xe')][_0x1150('0x23')]=_0x37870a;return this[_0x1150('0xb')](_0x133544);}};EmailChannel[_0x1150('0x14')]['sendMail']=function(_0x210599,_0x34833f){return this[_0x1150('0x2b')]['send'](_0x210599,_0x34833f);};EmailChannel[_0x1150('0x14')][_0x1150('0x2c')]=function(_0x207d10){var _0xbfdf05=this;if(this[_0x1150('0x9')][_0x207d10['id']]){if(_[_0x1150('0x21')](this[_0x1150('0x9')][_0x207d10['id']]['Smtp'])){this[_0x1150('0x9')][_0x207d10['id']][_0x1150('0x2d')]={};}this[_0x1150('0x9')][_0x207d10['id']][_0x1150('0x2d')]['lastSync']=moment();return new BPromise(function(_0x43164f,_0x4eb574){return _0xbfdf05[_0x1150('0x2b')][_0x1150('0x2e')](_0x207d10)[_0x1150('0x28')](function(_0x2ba090){_0xbfdf05[_0x1150('0x9')][_0x207d10['id']][_0x1150('0x2d')][_0x1150('0xf')]=_0x1150('0x2f');_0xbfdf05[_0x1150('0x9')][_0x207d10['id']]['Smtp'][_0x1150('0x23')]='';_0xbfdf05['emit'](_0x207d10['id']);_0x43164f(_0x2ba090);})['catch'](function(_0x3a1115){_0xbfdf05['mailAccounts'][_0x207d10['id']][_0x1150('0x2d')][_0x1150('0xf')]=_0x1150('0x1f');_0xbfdf05[_0x1150('0x9')][_0x207d10['id']][_0x1150('0x2d')]['messageStatus']=_0x3a1115;_0xbfdf05[_0x1150('0xb')](_0x207d10['id']);_0x4eb574(_0x3a1115);});});}return this[_0x1150('0x2b')][_0x1150('0x2e')](_0x207d10);};module[_0x1150('0x30')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 22ac393..d222637 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 _0xf0f4=['box','readUnseen','handleCloseBox','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','end','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','util','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account','getAccount','imap','once','ready','handleReady','bind','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','CloudProvider','data5','password','authentication','host','port','tls','autotls','openBox','mailbox','handleOpenBox','emit'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xf0f4,0x182));var _0x4f0f=function(_0x31f29d,_0x2113c9){_0x31f29d=_0x31f29d-0x0;var _0x4bbc32=_0xf0f4[_0x31f29d];return _0x4bbc32;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var Imap=require('imap');var simpleParser=require('mailparser')[_0x4f0f('0x1')];var Iconv=require(_0x4f0f('0x2'))['Iconv'];var EventEmitter=require(_0x4f0f('0x3'))[_0x4f0f('0x4')];var utils=require(_0x4f0f('0x5'));var logger=require(_0x4f0f('0x6'))(_0x4f0f('0x7'));function EmailImap(_0x15e6cd,_0x3285cd){this['mailbox']=_0x4f0f('0x8');this[_0x4f0f('0x9')]=this[_0x4f0f('0xa')](_0x15e6cd,_0x3285cd);this['imap']=new Imap(this[_0x4f0f('0x9')]);this[_0x4f0f('0xb')][_0x4f0f('0xc')](_0x4f0f('0xd'),this[_0x4f0f('0xe')][_0x4f0f('0xf')](this));this[_0x4f0f('0xb')][_0x4f0f('0xc')]('end',this[_0x4f0f('0x10')][_0x4f0f('0xf')](this));this[_0x4f0f('0xb')]['on'](_0x4f0f('0x11'),this[_0x4f0f('0x12')][_0x4f0f('0xf')](this));this[_0x4f0f('0xb')][_0x4f0f('0x13')]();}util[_0x4f0f('0x14')](EmailImap,EventEmitter);EmailImap[_0x4f0f('0x15')][_0x4f0f('0xa')]=function(_0x4e1e26,_0xebecc0){var _0x447238={'connTimeout':_0x4e1e26[_0x4f0f('0x16')]?_0x4e1e26[_0x4f0f('0x16')]*0x3e8:0x2710,'authTimeout':_0x4e1e26['authTimeout']?_0x4e1e26[_0x4f0f('0x17')]*0x3e8:0x1388};if(_0x4e1e26[_0x4f0f('0x18')]){_0x447238[_0x4f0f('0x19')]=_0x4e1e26[_0x4f0f('0x19')];_0x447238[_0x4f0f('0x7')]=_0xebecc0||_0x4e1e26['user']||_0x4f0f('0x1a');if(_0x4e1e26[_0x4f0f('0x1b')]){_0x447238[_0x4f0f('0x1c')]=utils['generateXOAuth2Token'](_0x4e1e26[_0x4f0f('0x1d')][_0x4f0f('0x1e')],_0x4e1e26[_0x4f0f('0x19')]);}else{_0x447238['password']=_0x4e1e26[_0x4f0f('0x1f')];}}else{if(_0x4e1e26[_0x4f0f('0x20')]){_0x447238[_0x4f0f('0x19')]=_0x4e1e26[_0x4f0f('0x19')];_0x447238[_0x4f0f('0x1f')]=_0x4e1e26[_0x4f0f('0x1f')];}}_0x447238['host']=_0x4e1e26[_0x4f0f('0x21')];_0x447238['port']=_0x4e1e26[_0x4f0f('0x22')]||0x3e1;if(_0x4e1e26[_0x4f0f('0x23')]){_0x447238['tls']=!![];}else{_0x447238['tls']=![];_0x447238[_0x4f0f('0x24')]='required';}return _0x447238;};EmailImap[_0x4f0f('0x15')][_0x4f0f('0xe')]=function(){this[_0x4f0f('0xb')][_0x4f0f('0x25')](this[_0x4f0f('0x26')],![],this[_0x4f0f('0x27')]['bind'](this));};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x27')]=function(_0x37aefe,_0x3bc77d){if(_0x37aefe){this[_0x4f0f('0x12')](_0x37aefe,!![]);}else{this[_0x4f0f('0x28')](_0x4f0f('0x29'),_0x3bc77d);this[_0x4f0f('0x2a')]();}};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x2b')]=function(_0x37ae8f){if(_0x37ae8f){this[_0x4f0f('0x12')](_0x37ae8f,!![]);}else{this[_0x4f0f('0xb')]['end']();}};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x2a')]=function(){this[_0x4f0f('0xb')]['search']([_0x4f0f('0x2c')],this['handleReadUnseen'][_0x4f0f('0xf')](this));};EmailImap[_0x4f0f('0x15')]['handleReadUnseen']=function(_0x48ed9c,_0x43a798){if(_0x48ed9c){this['handleError'](_0x48ed9c,!![]);}else{if(_0x43a798[_0x4f0f('0x2d')]){try{var _0x9319c0=this['imap'][_0x4f0f('0x2e')](_0x43a798,{'bodies':'','markSeen':!![]});_0x9319c0['on'](_0x4f0f('0x2f'),this[_0x4f0f('0x30')][_0x4f0f('0xf')](this));_0x9319c0['once'](_0x4f0f('0x11'),this[_0x4f0f('0x31')][_0x4f0f('0xf')](this));_0x9319c0[_0x4f0f('0xc')]('end',this[_0x4f0f('0x32')][_0x4f0f('0xf')](this));}catch(_0x1c85cb){logger['error'](_0x1c85cb);}}else{this[_0x4f0f('0xb')][_0x4f0f('0x33')](!![],this['handleCloseBox'][_0x4f0f('0xf')](this));}}};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x30')]=function(_0x341c6c){_0x341c6c['on']('body',this[_0x4f0f('0x34')][_0x4f0f('0xf')](this));_0x341c6c[_0x4f0f('0xc')](_0x4f0f('0x35'),this[_0x4f0f('0x36')][_0x4f0f('0xf')](this));_0x341c6c[_0x4f0f('0xc')](_0x4f0f('0x37'),this['handleMessageEnd'][_0x4f0f('0xf')](this));};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x34')]=function(_0x3d2f46){simpleParser(_0x3d2f46,{'Iconv':Iconv},this[_0x4f0f('0x38')][_0x4f0f('0xf')](this));};EmailImap[_0x4f0f('0x15')]['handleMessageAttributes']=function(){};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x39')]=function(){};EmailImap[_0x4f0f('0x15')]['handleSimpleParser']=function(_0x171e41,_0x47b3fc){if(_0x171e41){logger[_0x4f0f('0x11')](_0x171e41);}else{var _0x58da38=this;utils[_0x4f0f('0x3a')](this[_0x4f0f('0x9')],_0x47b3fc,function(_0x516152){_0x58da38[_0x4f0f('0x28')](_0x4f0f('0x7'),_0x516152);});}};EmailImap[_0x4f0f('0x15')]['handleFetchEnd']=function(){this[_0x4f0f('0xb')][_0x4f0f('0x33')](!![],this[_0x4f0f('0x2b')][_0x4f0f('0xf')](this));};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x31')]=function(_0x57184a){this[_0x4f0f('0x12')](_0x57184a);this[_0x4f0f('0xb')][_0x4f0f('0x33')](!![],this[_0x4f0f('0x2b')]['bind'](this));};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x10')]=function(){this[_0x4f0f('0x28')](_0x4f0f('0x37'));};EmailImap[_0x4f0f('0x15')][_0x4f0f('0x12')]=function(_0x1fdd86,_0x528d60){logger[_0x4f0f('0x11')](_0x4f0f('0x12'),this[_0x4f0f('0x9')][_0x4f0f('0x7')],JSON[_0x4f0f('0x3b')](_0x1fdd86));var _0x172c71='';if(_0x1fdd86){if(_0x1fdd86['textCode']){_0x172c71=_0x1fdd86[_0x4f0f('0x3c')];}else{for(var _0x3a6066 in _0x1fdd86){if(_0x1fdd86['hasOwnProperty'](_0x3a6066)){_0x172c71+=_['upperFirst'](_0x3a6066)+':\x20'+_0x1fdd86[_0x3a6066]+'\x0a';}}}}if(_0x528d60){this[_0x4f0f('0xb')][_0x4f0f('0x37')]();}else{this[_0x4f0f('0x28')]('error',_0x172c71);this[_0x4f0f('0x28')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x6691=['once','end','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','closeBox','stringify','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','ready','bind'];(function(_0x487ed8,_0x7a92ab){var _0x139857=function(_0x1ed2c0){while(--_0x1ed2c0){_0x487ed8['push'](_0x487ed8['shift']());}};_0x139857(++_0x7a92ab);}(_0x6691,0x12d));var _0x1669=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6691[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var Imap=require(_0x1669('0x2'));var simpleParser=require(_0x1669('0x3'))[_0x1669('0x4')];var Iconv=require(_0x1669('0x5'))[_0x1669('0x6')];var EventEmitter=require(_0x1669('0x7'))[_0x1669('0x8')];var utils=require(_0x1669('0x9'));var logger=require('../../../config/logger')(_0x1669('0xa'));function EmailImap(_0x1bf2c8,_0x30f92c){this[_0x1669('0xb')]='INBOX';this['account']=this['getAccount'](_0x1bf2c8,_0x30f92c);this[_0x1669('0x2')]=new Imap(this['account']);this['imap']['once'](_0x1669('0xc'),this['handleReady'][_0x1669('0xd')](this));this[_0x1669('0x2')][_0x1669('0xe')](_0x1669('0xf'),this[_0x1669('0x10')][_0x1669('0xd')](this));this[_0x1669('0x2')]['on'](_0x1669('0x11'),this[_0x1669('0x12')][_0x1669('0xd')](this));this[_0x1669('0x2')][_0x1669('0x13')]();}util[_0x1669('0x14')](EmailImap,EventEmitter);EmailImap[_0x1669('0x15')][_0x1669('0x16')]=function(_0x355ac3,_0x102193){var _0x2904b6={'connTimeout':_0x355ac3[_0x1669('0x17')]?_0x355ac3[_0x1669('0x17')]*0x3e8:0x2710,'authTimeout':_0x355ac3[_0x1669('0x18')]?_0x355ac3[_0x1669('0x18')]*0x3e8:0x1388};if(_0x355ac3[_0x1669('0x19')]){_0x2904b6['user']=_0x355ac3[_0x1669('0x1a')];_0x2904b6[_0x1669('0xa')]=_0x102193||_0x355ac3[_0x1669('0x1a')]||_0x1669('0x1b');if(_0x355ac3[_0x1669('0x1c')]){_0x2904b6['xoauth2']=utils['generateXOAuth2Token'](_0x355ac3[_0x1669('0x1d')][_0x1669('0x1e')],_0x355ac3[_0x1669('0x1a')]);}else{_0x2904b6[_0x1669('0x1f')]=_0x355ac3[_0x1669('0x1f')];}}else{if(_0x355ac3[_0x1669('0x20')]){_0x2904b6[_0x1669('0x1a')]=_0x355ac3['user'];_0x2904b6[_0x1669('0x1f')]=_0x355ac3[_0x1669('0x1f')];}}_0x2904b6['host']=_0x355ac3[_0x1669('0x21')];_0x2904b6[_0x1669('0x22')]=_0x355ac3['port']||0x3e1;if(_0x355ac3[_0x1669('0x23')]){_0x2904b6[_0x1669('0x23')]=!![];}else{_0x2904b6[_0x1669('0x23')]=![];_0x2904b6[_0x1669('0x24')]=_0x1669('0x25');}return _0x2904b6;};EmailImap['prototype'][_0x1669('0x26')]=function(){this[_0x1669('0x2')][_0x1669('0x27')](this['mailbox'],![],this[_0x1669('0x28')]['bind'](this));};EmailImap['prototype'][_0x1669('0x28')]=function(_0x50c9a0,_0x304b25){if(_0x50c9a0){this[_0x1669('0x12')](_0x50c9a0,!![]);}else{this[_0x1669('0x29')](_0x1669('0x2a'),_0x304b25);this[_0x1669('0x2b')]();}};EmailImap[_0x1669('0x15')][_0x1669('0x2c')]=function(_0x4814af){if(_0x4814af){this[_0x1669('0x12')](_0x4814af,!![]);}else{this['imap'][_0x1669('0xf')]();}};EmailImap[_0x1669('0x15')]['readUnseen']=function(){this[_0x1669('0x2')]['search']([_0x1669('0x2d')],this[_0x1669('0x2e')][_0x1669('0xd')](this));};EmailImap[_0x1669('0x15')]['handleReadUnseen']=function(_0x49260f,_0x47fbda){if(_0x49260f){this[_0x1669('0x12')](_0x49260f,!![]);}else{if(_0x47fbda[_0x1669('0x2f')]){try{var _0x1cbaa7=this[_0x1669('0x2')][_0x1669('0x30')](_0x47fbda,{'bodies':'','markSeen':!![]});_0x1cbaa7['on']('message',this[_0x1669('0x31')][_0x1669('0xd')](this));_0x1cbaa7[_0x1669('0xe')](_0x1669('0x11'),this[_0x1669('0x32')][_0x1669('0xd')](this));_0x1cbaa7[_0x1669('0xe')](_0x1669('0xf'),this['handleFetchEnd'][_0x1669('0xd')](this));}catch(_0x575362){logger[_0x1669('0x11')](_0x575362);}}else{this['imap']['closeBox'](!![],this[_0x1669('0x2c')][_0x1669('0xd')](this));}}};EmailImap[_0x1669('0x15')][_0x1669('0x31')]=function(_0xafbce1){_0xafbce1['on'](_0x1669('0x33'),this[_0x1669('0x34')][_0x1669('0xd')](this));_0xafbce1[_0x1669('0xe')]('attributes',this[_0x1669('0x35')][_0x1669('0xd')](this));_0xafbce1[_0x1669('0xe')](_0x1669('0xf'),this[_0x1669('0x36')][_0x1669('0xd')](this));};EmailImap[_0x1669('0x15')]['handleMessageBody']=function(_0x3770b7){simpleParser(_0x3770b7,{'Iconv':Iconv},this[_0x1669('0x37')][_0x1669('0xd')](this));};EmailImap[_0x1669('0x15')][_0x1669('0x35')]=function(){};EmailImap[_0x1669('0x15')]['handleMessageEnd']=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x31f1fe,_0x2439d8){if(_0x31f1fe){logger[_0x1669('0x11')](_0x31f1fe);}else{var _0x3a87c8=this;utils[_0x1669('0x38')](this[_0x1669('0x39')],_0x2439d8,function(_0x34f6de){_0x3a87c8['emit'](_0x1669('0xa'),_0x34f6de);});}};EmailImap[_0x1669('0x15')]['handleFetchEnd']=function(){this['imap'][_0x1669('0x3a')](!![],this[_0x1669('0x2c')][_0x1669('0xd')](this));};EmailImap[_0x1669('0x15')][_0x1669('0x32')]=function(_0x52747f){this[_0x1669('0x12')](_0x52747f);this['imap']['closeBox'](!![],this[_0x1669('0x2c')]['bind'](this));};EmailImap[_0x1669('0x15')][_0x1669('0x10')]=function(){this[_0x1669('0x29')](_0x1669('0xf'));};EmailImap['prototype'][_0x1669('0x12')]=function(_0x34d303,_0x19d997){logger['error'](_0x1669('0x12'),this[_0x1669('0x39')][_0x1669('0xa')],JSON[_0x1669('0x3b')](_0x34d303));var _0x3872bc='';if(_0x34d303){if(_0x34d303[_0x1669('0x3c')]){_0x3872bc=_0x34d303[_0x1669('0x3c')];}else{for(var _0x5d0d24 in _0x34d303){if(_0x34d303[_0x1669('0x3d')](_0x5d0d24)){_0x3872bc+=_['upperFirst'](_0x5d0d24)+':\x20'+_0x34d303[_0x5d0d24]+'\x0a';}}}}if(_0x19d997){this[_0x1669('0x2')]['end']();}else{this[_0x1669('0x29')](_0x1669('0x11'),_0x3872bc);this[_0x1669('0x29')](_0x1669('0xf'));}};module[_0x1669('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index b2cfbfb..7ce55cc 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 _0x5426=['toString','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','compile','sendMail'];(function(_0x1a435d,_0x2a7af2){var _0x11d317=function(_0x5ba21d){while(--_0x5ba21d){_0x1a435d['push'](_0x1a435d['shift']());}};_0x11d317(++_0x2a7af2);}(_0x5426,0xed));var _0x6542=function(_0x24cf3b,_0x153cd8){_0x24cf3b=_0x24cf3b-0x0;var _0x34813f=_0x5426[_0x24cf3b];return _0x34813f;};'use strict';var nodemailer=require(_0x6542('0x0'));var inlineBase64=require(_0x6542('0x1'));function EmailSmtp(){}EmailSmtp[_0x6542('0x2')]['send']=function(_0x430542,_0x27a74e){return new Promise(function(_0x53141c,_0x413bfe){var _0x5e48ac=nodemailer[_0x6542('0x3')](_0x430542);_0x5e48ac['use'](_0x6542('0x4'),inlineBase64());_0x5e48ac[_0x6542('0x5')](_0x27a74e,function(_0x3da859,_0x4ffe62){if(_0x3da859){_0x413bfe(_0x3da859[_0x6542('0x6')]());}else{_0x53141c(_0x4ffe62);}});});};EmailSmtp[_0x6542('0x2')][_0x6542('0x7')]=function(_0x3018b3){return new Promise(function(_0x34b39b,_0x1531ac){var _0x394828=nodemailer[_0x6542('0x3')](_0x3018b3);_0x394828[_0x6542('0x7')](function(_0x4438cc,_0x1bbc7c){if(_0x4438cc){_0x1531ac(_0x4438cc[_0x6542('0x6')]());}else{if(_0x1bbc7c){_0x34b39b(_0x1bbc7c);}else{_0x1531ac(_0x6542('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x2158=['sendMail','verify','toString','exports','nodemailer','prototype','compile'];(function(_0x395f6a,_0x45ec30){var _0x5087d9=function(_0x5694dd){while(--_0x5694dd){_0x395f6a['push'](_0x395f6a['shift']());}};_0x5087d9(++_0x45ec30);}(_0x2158,0x97));var _0x8215=function(_0x1dd58f,_0x161969){_0x1dd58f=_0x1dd58f-0x0;var _0x36bb55=_0x2158[_0x1dd58f];return _0x36bb55;};'use strict';var nodemailer=require(_0x8215('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8215('0x1')]['send']=function(_0x1b57e0,_0x1c9cca){return new Promise(function(_0x4dca7b,_0x4d93fe){var _0x268366=nodemailer['createTransport'](_0x1b57e0);_0x268366['use'](_0x8215('0x2'),inlineBase64());_0x268366[_0x8215('0x3')](_0x1c9cca,function(_0x5d296b,_0x290d8c){if(_0x5d296b){_0x4d93fe(_0x5d296b['toString']());}else{_0x4dca7b(_0x290d8c);}});});};EmailSmtp[_0x8215('0x1')][_0x8215('0x4')]=function(_0x5b9d60){return new Promise(function(_0x480e2f,_0x33ca39){var _0x18687d=nodemailer['createTransport'](_0x5b9d60);_0x18687d[_0x8215('0x4')](function(_0x1040bb,_0x528343){if(_0x1040bb){_0x33ca39(_0x1040bb[_0x8215('0x5')]());}else{if(_0x528343){_0x480e2f(_0x528343);}else{_0x33ca39('Not\x20verifired');}}});});};module[_0x8215('0x6')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 3cf6bb4..40bc222 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 _0x8207=['lodash','randomstring','node-tnef','../../../config/logger','email','value','address','anonymous','@xcally.com','head','name','substring','split','slice','join','Anonymous','length','isEmpty','generate','html','','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','toString','base64'];(function(_0x5cae5f,_0x14b690){var _0x162594=function(_0x168450){while(--_0x168450){_0x5cae5f['push'](_0x5cae5f['shift']());}};_0x162594(++_0x14b690);}(_0x8207,0x8a));var _0x7820=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8207[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7820('0x0'));var moment=require('moment');var random=require(_0x7820('0x1'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x7820('0x2'));var logger=require(_0x7820('0x3'))(_0x7820('0x4'));var config=require('../../../config/environment');function getAddress(_0x2583ec){var _0xb56bb3=_['head'](_0x2583ec[_0x7820('0x5')]);return _0xb56bb3&&_0xb56bb3[_0x7820('0x6')]?_0xb56bb3[_0x7820('0x6')]:_0x7820('0x7')+random['generate'](0x6)+_0x7820('0x8');}function getFirstName(_0x409577){var _0x5b0c7d=_[_0x7820('0x9')](_0x409577[_0x7820('0x5')]);if(_0x5b0c7d&&_0x5b0c7d[_0x7820('0xa')]){if(_0x5b0c7d[_0x7820('0xa')]==_0x5b0c7d['address']){return _0x5b0c7d['name'][_0x7820('0xb')](0x0,_0x5b0c7d[_0x7820('0xa')]['indexOf']('@'));}var _0x199247=_0x5b0c7d[_0x7820('0xa')][_0x7820('0xc')](/\s+/);return _0x199247['length']>0x1?_0x199247[_0x7820('0xd')](0x0,-0x1)[_0x7820('0xe')]('\x20'):_0x5b0c7d[_0x7820('0xa')];}return _0x7820('0xf');}function getLastName(_0x4796c8){var _0x560618=_[_0x7820('0x9')](_0x4796c8[_0x7820('0x5')]);if(_0x560618&&_0x560618[_0x7820('0xa')]){var _0x5674a8=_0x560618['name'][_0x7820('0xc')](/\s+/);return _0x5674a8[_0x7820('0x10')]>0x1?_0x5674a8['pop']():'';}return'';}function getMails(_0x4dd1af,_0x53ea83){var _0xf45926='';for(var _0x34d781=0x0;_0x34d781<_0x53ea83[_0x7820('0x5')]['length'];_0x34d781+=0x1){if(_0x53ea83[_0x7820('0x5')][_0x34d781][_0x7820('0x6')]!==_0x4dd1af){if(!_[_0x7820('0x11')](_0xf45926)){_0xf45926+=',';}_0xf45926+=_0x53ea83[_0x7820('0x5')][_0x34d781]['name']||_0x53ea83[_0x7820('0x5')][_0x34d781][_0x7820('0x6')]||'';_0xf45926+='\x20<';_0xf45926+=_0x53ea83[_0x7820('0x5')][_0x34d781]['address']?_0x53ea83[_0x7820('0x5')][_0x34d781][_0x7820('0x6')]:_0x7820('0x7')+random[_0x7820('0x12')](0x6)+_0x7820('0x8');_0xf45926+='>';}}return _0xf45926;}function parseEmail(_0x22d29b,_0x479764,_0x52f226){if(_0x479764[_0x7820('0x13')]){var _0x5ef38f=/)<[^<]*)*<\/script>/gi;while(_0x5ef38f['test'](_0x479764['html'])){_0x479764['html']=_0x479764[_0x7820('0x13')]['replace'](_0x5ef38f,'');}if(_0x479764[_0x7820('0x13')]['includes'](_0x7820('0x14'))){var _0xda4ea0=[];_0x479764[_0x7820('0x15')]['forEach'](_0x183b7=>{_0xda4ea0[_0x7820('0x16')](_0x183b7['filename']);});var _0x13a780=/]+>/g;var _0x4b49c0=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3e6643=_0x479764[_0x7820('0x13')][_0x7820('0x17')](_0x4b49c0,_0x7820('0x18'));var _0x4c2d85=_0x3e6643[_0x7820('0x17')](_0x13a780,'_IMG');for(let _0xc806f5=0x0;_0xc806f5<_0xda4ea0['length'];_0xc806f5++){var _0x160746=_0x4c2d85['replace']('_IMG','\x20[Attachment:\x20'+_0xda4ea0[_0xc806f5]+_0x7820('0x19'));_0x4c2d85=_0x160746;}_0x479764[_0x7820('0x13')]=_0x4c2d85;}_0x52f226[_0x7820('0x1a')]=_0x479764['html'];}else{_0x52f226[_0x7820('0x1a')]=_0x479764[_0x7820('0x1b')];}if(_0x52f226[_0x7820('0x1a')]){_0x52f226[_0x7820('0x1a')]=_0x52f226[_0x7820('0x1a')][_0x7820('0x17')](/0x0){var _0x19bf0c=[_0x7820('0x2e'),_0x7820('0x2f'),'Precedence:\x20auto_reply'];for(var _0x531551=0x0;_0x531551<_0x479764[_0x7820('0x2d')][_0x7820('0x10')];_0x531551++){var _0x324159=_[_0x7820('0x30')](_0x19bf0c,_0x479764[_0x7820('0x2d')][_0x531551][_0x7820('0x31')]);if(_0x324159>=0x0){_0x52f226[_0x7820('0x32')]=!![];}}}return _0x52f226;}exports[_0x7820('0x33')]=function(_0x259715,_0x508b39,_0x108489){var _0x47ada3={'from':getAddress(_0x508b39[_0x7820('0x34')]),'firstName':getFirstName(_0x508b39[_0x7820('0x34')]),'lastName':getLastName(_0x508b39[_0x7820('0x34')]),'mapKey':'email','message':{'from':getMails(_0x259715['email'],_0x508b39[_0x7820('0x34')]),'to':_0x259715[_0x7820('0x4')],'cc':'','subject':_0x508b39[_0x7820('0x35')]||'','messageId':_0x508b39['messageId'],'inReplyTo':_0x508b39[_0x7820('0x36')],'sentAt':moment(_0x508b39[_0x7820('0x37')])['format'](_0x7820('0x38')),'attach':![],'attachments':[]}};if(!_0x508b39['html']&&!_0x508b39[_0x7820('0x1b')]){var _0x38c0c8=_[_0x7820('0x39')](_0x508b39[_0x7820('0x15')],{'contentType':_0x7820('0x3a')});if(_0x38c0c8[_0x7820('0x10')]){logger['info'](util[_0x7820('0x26')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x508b39['messageId']));tnef['parseBuffer'](_[_0x7820('0x3b')](_0x38c0c8)[_0x7820('0x2b')],function(_0x2c37fa,_0x50ef04){if(_0x50ef04){_0x508b39[_0x7820('0x13')]=_0x50ef04[_0x7820('0x3c')]||_0x7820('0x3d');if(_0x50ef04['Attachments']){for(var _0x92f401=0x0;_0x92f401<_0x50ef04[_0x7820('0x3e')][_0x7820('0x10')];_0x92f401++){var _0x5a9f2d=_0x50ef04['Attachments'][_0x92f401];_0x47ada3['message'][_0x7820('0x15')]['push']({'filename':_0x5a9f2d[_0x7820('0x3f')],'content':Buffer[_0x7820('0x34')](_0x5a9f2d[_0x7820('0x40')])});}}}_0x108489(parseEmail(_0x259715,_0x508b39,_0x47ada3));});}else{_0x508b39[_0x7820('0x13')]=_0x7820('0x3d');_0x108489(parseEmail(_0x259715,_0x508b39,_0x47ada3));}}else{_0x108489(parseEmail(_0x259715,_0x508b39,_0x47ada3));}};exports[_0x7820('0x41')]=function(_0x34428b,_0x5e4d07){var _0x108254=['user='+(_0x5e4d07||''),_0x7820('0x42')+_0x34428b,'',''];return Buffer[_0x7820('0x34')](_0x108254['join'](''),'utf-8')[_0x7820('0x43')](_0x7820('0x44'));}; \ No newline at end of file +var _0x9bf7=['head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','Data','utf-8','toString','base64','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9bf7,0x11d));var _0x79bf=function(_0x4e8b6a,_0x416e1d){_0x4e8b6a=_0x4e8b6a-0x0;var _0xd8b0eb=_0x9bf7[_0x4e8b6a];return _0xd8b0eb;};'use strict';var _=require('lodash');var moment=require(_0x79bf('0x0'));var random=require(_0x79bf('0x1'));var fs=require('fs');var path=require(_0x79bf('0x2'));var util=require(_0x79bf('0x3'));var tnef=require('node-tnef');var logger=require(_0x79bf('0x4'))(_0x79bf('0x5'));var config=require(_0x79bf('0x6'));function getAddress(_0x2b85c8){var _0x4732be=_[_0x79bf('0x7')](_0x2b85c8[_0x79bf('0x8')]);return _0x4732be&&_0x4732be[_0x79bf('0x9')]?_0x4732be[_0x79bf('0x9')]:_0x79bf('0xa')+random[_0x79bf('0xb')](0x6)+_0x79bf('0xc');}function getFirstName(_0x4ce6c1){var _0x13ba33=_[_0x79bf('0x7')](_0x4ce6c1[_0x79bf('0x8')]);if(_0x13ba33&&_0x13ba33[_0x79bf('0xd')]){if(_0x13ba33[_0x79bf('0xd')]==_0x13ba33[_0x79bf('0x9')]){return _0x13ba33[_0x79bf('0xd')][_0x79bf('0xe')](0x0,_0x13ba33[_0x79bf('0xd')][_0x79bf('0xf')]('@'));}var _0xcea768=_0x13ba33[_0x79bf('0xd')][_0x79bf('0x10')](/\s+/);return _0xcea768[_0x79bf('0x11')]>0x1?_0xcea768[_0x79bf('0x12')](0x0,-0x1)[_0x79bf('0x13')]('\x20'):_0x13ba33[_0x79bf('0xd')];}return _0x79bf('0x14');}function getLastName(_0xd9ac5d){var _0x20ae4c=_[_0x79bf('0x7')](_0xd9ac5d[_0x79bf('0x8')]);if(_0x20ae4c&&_0x20ae4c[_0x79bf('0xd')]){var _0x58d8e5=_0x20ae4c[_0x79bf('0xd')]['split'](/\s+/);return _0x58d8e5[_0x79bf('0x11')]>0x1?_0x58d8e5[_0x79bf('0x15')]():'';}return'';}function getMails(_0x9369b9,_0x799bc1){var _0x2aed9e='';for(var _0x3e7306=0x0;_0x3e7306<_0x799bc1['value'][_0x79bf('0x11')];_0x3e7306+=0x1){if(_0x799bc1[_0x79bf('0x8')][_0x3e7306][_0x79bf('0x9')]!==_0x9369b9){if(!_[_0x79bf('0x16')](_0x2aed9e)){_0x2aed9e+=',';}_0x2aed9e+=_0x799bc1[_0x79bf('0x8')][_0x3e7306][_0x79bf('0xd')]||_0x799bc1['value'][_0x3e7306][_0x79bf('0x9')]||'';_0x2aed9e+='\x20<';_0x2aed9e+=_0x799bc1[_0x79bf('0x8')][_0x3e7306][_0x79bf('0x9')]?_0x799bc1[_0x79bf('0x8')][_0x3e7306][_0x79bf('0x9')]:'anonymous'+random[_0x79bf('0xb')](0x6)+'@xcally.com';_0x2aed9e+='>';}}return _0x2aed9e;}function parseEmail(_0x327271,_0x42edd2,_0x35e8c6){if(_0x42edd2[_0x79bf('0x17')]){var _0x21b521=/)<[^<]*)*<\/script>/gi;while(_0x21b521[_0x79bf('0x18')](_0x42edd2['html'])){_0x42edd2[_0x79bf('0x17')]=_0x42edd2['html'][_0x79bf('0x19')](_0x21b521,'');}if(_0x42edd2[_0x79bf('0x17')][_0x79bf('0x1a')](_0x79bf('0x1b'))){var _0x27df80=[];_0x42edd2[_0x79bf('0x1c')][_0x79bf('0x1d')](_0x553b9e=>{_0x27df80['push'](_0x553b9e[_0x79bf('0x1e')]);});var _0x5e88e6=/]+>/g;var _0x3fb908=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5f5b0d=_0x42edd2['html'][_0x79bf('0x19')](_0x3fb908,'_SRC');var _0x144c44=_0x5f5b0d[_0x79bf('0x19')](_0x5e88e6,'_IMG');for(let _0x28683b=0x0;_0x28683b<_0x27df80['length'];_0x28683b++){var _0x55f295=_0x144c44[_0x79bf('0x19')]('_IMG',_0x79bf('0x1f')+_0x27df80[_0x28683b]+_0x79bf('0x20'));_0x144c44=_0x55f295;}_0x42edd2[_0x79bf('0x17')]=_0x144c44;}_0x35e8c6[_0x79bf('0x21')]=_0x42edd2[_0x79bf('0x17')];}else{_0x35e8c6[_0x79bf('0x21')]=_0x42edd2['textAsHtml'];}if(_0x35e8c6[_0x79bf('0x21')]){_0x35e8c6['body']=_0x35e8c6[_0x79bf('0x21')][_0x79bf('0x19')](/0x0){var _0x416f75=[_0x79bf('0x33'),'X-Auto-Response-Suppress:\x20All',_0x79bf('0x34')];for(var _0x3f6c6d=0x0;_0x3f6c6d<_0x42edd2[_0x79bf('0x32')][_0x79bf('0x11')];_0x3f6c6d++){var _0x36206b=_['indexOf'](_0x416f75,_0x42edd2[_0x79bf('0x32')][_0x3f6c6d]['line']);if(_0x36206b>=0x0){_0x35e8c6[_0x79bf('0x35')]=!![];}}}return _0x35e8c6;}exports['parser']=function(_0x54474d,_0x46a77d,_0x259012){var _0x2ac22d={'from':getAddress(_0x46a77d['from']),'firstName':getFirstName(_0x46a77d[_0x79bf('0x36')]),'lastName':getLastName(_0x46a77d[_0x79bf('0x36')]),'mapKey':_0x79bf('0x5'),'message':{'from':getMails(_0x54474d[_0x79bf('0x5')],_0x46a77d[_0x79bf('0x36')]),'to':_0x54474d[_0x79bf('0x5')],'cc':'','subject':_0x46a77d[_0x79bf('0x37')]||'','messageId':_0x46a77d['messageId'],'inReplyTo':_0x46a77d[_0x79bf('0x38')],'sentAt':moment(_0x46a77d['date'])[_0x79bf('0x2a')](_0x79bf('0x39')),'attach':![],'attachments':[]}};if(!_0x46a77d[_0x79bf('0x17')]&&!_0x46a77d[_0x79bf('0x3a')]){var _0x313b23=_[_0x79bf('0x3b')](_0x46a77d['attachments'],{'contentType':_0x79bf('0x3c')});if(_0x313b23[_0x79bf('0x11')]){logger[_0x79bf('0x3d')](util[_0x79bf('0x2a')](_0x79bf('0x3e'),_0x46a77d['messageId']));tnef[_0x79bf('0x3f')](_[_0x79bf('0x40')](_0x313b23)['content'],function(_0x31bb9c,_0x582fa9){if(_0x582fa9){_0x46a77d[_0x79bf('0x17')]=_0x582fa9[_0x79bf('0x41')]||_0x79bf('0x42');if(_0x582fa9[_0x79bf('0x43')]){for(var _0x4e0d68=0x0;_0x4e0d68<_0x582fa9[_0x79bf('0x43')]['length'];_0x4e0d68++){var _0x4350bb=_0x582fa9[_0x79bf('0x43')][_0x4e0d68];_0x2ac22d[_0x79bf('0x24')]['attachments'][_0x79bf('0x30')]({'filename':_0x4350bb[_0x79bf('0x44')],'content':Buffer[_0x79bf('0x36')](_0x4350bb[_0x79bf('0x45')])});}}}_0x259012(parseEmail(_0x54474d,_0x46a77d,_0x2ac22d));});}else{_0x46a77d[_0x79bf('0x17')]=_0x79bf('0x42');_0x259012(parseEmail(_0x54474d,_0x46a77d,_0x2ac22d));}}else{_0x259012(parseEmail(_0x54474d,_0x46a77d,_0x2ac22d));}};exports['generateXOAuth2Token']=function(_0x2ac19b,_0x37881f){var _0x3d67b1=['user='+(_0x37881f||''),'auth=Bearer\x20'+_0x2ac19b,'',''];return Buffer[_0x79bf('0x36')](_0x3d67b1[_0x79bf('0x13')](''),_0x79bf('0x46'))[_0x79bf('0x47')](_0x79bf('0x48'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index baf9e82..8030de2 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 _0x3a9b=['Service','SERV','active','Imap','Smtp','lodash'];(function(_0x5dbf8e,_0x2aff6b){var _0x543ae0=function(_0x2e6c3d){while(--_0x2e6c3d){_0x5dbf8e['push'](_0x5dbf8e['shift']());}};_0x543ae0(++_0x2aff6b);}(_0x3a9b,0xfb));var _0xb3a9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3a9b[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xb3a9('0x0'));function MailAccount(_0x4355e5){this['id']=_0x4355e5['id']||0x0;this['name']=_0x4355e5['name']||_0xb3a9('0x1');this['key']=_0x4355e5['key']||_0xb3a9('0x2');this[_0xb3a9('0x3')]=_0x4355e5['active']||![];this['Imap']=_0x4355e5[_0xb3a9('0x4')]||[];this[_0xb3a9('0x5')]=_0x4355e5['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x2444=['Smtp','name','key','SERV','active','Imap'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x2444,0xf7));var _0x4244=function(_0x5f39b9,_0x3845f4){_0x5f39b9=_0x5f39b9-0x0;var _0x35d5dc=_0x2444[_0x5f39b9];return _0x35d5dc;};'use strict';var _=require('lodash');function MailAccount(_0x10ae56){this['id']=_0x10ae56['id']||0x0;this[_0x4244('0x0')]=_0x10ae56[_0x4244('0x0')]||'Service';this[_0x4244('0x1')]=_0x10ae56[_0x4244('0x1')]||_0x4244('0x2');this[_0x4244('0x3')]=_0x10ae56[_0x4244('0x3')]||![];this[_0x4244('0x4')]=_0x10ae56[_0x4244('0x4')]||[];this[_0x4244('0x5')]=_0x10ae56[_0x4244('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 2699a8e..239c9bf 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 _0x0595=['isUndefined','merge','exports','lodash','hasOwnProperty','prototype','initMailAccounts','mailAccounts','length'];(function(_0x1038b5,_0x26dc9c){var _0x75f09f=function(_0x1ad3fb){while(--_0x1ad3fb){_0x1038b5['push'](_0x1038b5['shift']());}};_0x75f09f(++_0x26dc9c);}(_0x0595,0x1a1));var _0x5059=function(_0x14d223,_0x27cfba){_0x14d223=_0x14d223-0x0;var _0x23635f=_0x0595[_0x14d223];return _0x23635f;};'use strict';var _=require(_0x5059('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x429501,_0x2c543f,_0x49547b){var _0xc3e40a=_['mapKeys'](_0x429501,function(_0x435061,_0x4f4a46){return _0x435061[_0x49547b];});for(var _0x4e8fc1 in _0x2c543f){if(_0x2c543f['hasOwnProperty'](_0x4e8fc1)){if(!_0xc3e40a[_0x4e8fc1]){delete _0x2c543f[_0x4e8fc1];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x455776,_0x567cb0){for(var _0x10ab8f in _0x567cb0){if(_0x455776[_0x5059('0x1')](_0x10ab8f)){_0x455776[_0x10ab8f]=_0x567cb0[_0x10ab8f];}}};Realtime[_0x5059('0x2')][_0x5059('0x3')]=function(){var _0x401191=this;return function(_0x187c60){if(_0x187c60){freeIsNotKey(_0x187c60,_0x401191[_0x5059('0x4')],'id');for(var _0x3da190=0x0,_0x180f12={},_0x32af40={};_0x3da190<_0x187c60[_0x5059('0x5')];_0x3da190+=0x1){_0x180f12=_0x187c60[_0x3da190];if(_[_0x5059('0x6')](_0x401191[_0x5059('0x4')][_0x180f12['id']])){_0x401191['mailAccounts'][_0x180f12['id']]=new MailAccount(_0x180f12);}else{_[_0x5059('0x7')](_0x401191['mailAccounts'][_0x180f12['id']],_0x180f12);}}}return _0x401191[_0x5059('0x4')];};};module[_0x5059('0x8')]=Realtime; \ No newline at end of file +var _0xea13=['prototype','mergeFromDatabase','initMailAccounts','merge','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x1ebcfa,_0x1755ab){var _0x4707e5=function(_0x164d6e){while(--_0x164d6e){_0x1ebcfa['push'](_0x1ebcfa['shift']());}};_0x4707e5(++_0x1755ab);}(_0xea13,0x12c));var _0x3ea1=function(_0x379003,_0x5e0b89){_0x379003=_0x379003-0x0;var _0x39f162=_0xea13[_0x379003];return _0x39f162;};'use strict';var _=require('lodash');var MailAccount=require(_0x3ea1('0x0'));var Realtime=function(){this[_0x3ea1('0x1')]={};};function freeIsNotKey(_0x112622,_0x57039a,_0x39cc10){var _0x304ad5=_[_0x3ea1('0x2')](_0x112622,function(_0x588e7c,_0x4fbba6){return _0x588e7c[_0x39cc10];});for(var _0x525b71 in _0x57039a){if(_0x57039a[_0x3ea1('0x3')](_0x525b71)){if(!_0x304ad5[_0x525b71]){delete _0x57039a[_0x525b71];}}}}Realtime[_0x3ea1('0x4')][_0x3ea1('0x5')]=function(_0x1dc8ff,_0x4ebbc3){for(var _0x3cc748 in _0x4ebbc3){if(_0x1dc8ff[_0x3ea1('0x3')](_0x3cc748)){_0x1dc8ff[_0x3cc748]=_0x4ebbc3[_0x3cc748];}}};Realtime[_0x3ea1('0x4')][_0x3ea1('0x6')]=function(){var _0x72054a=this;return function(_0x38e2d3){if(_0x38e2d3){freeIsNotKey(_0x38e2d3,_0x72054a[_0x3ea1('0x1')],'id');for(var _0x4cd7d1=0x0,_0x48f5da={},_0x107522={};_0x4cd7d1<_0x38e2d3['length'];_0x4cd7d1+=0x1){_0x48f5da=_0x38e2d3[_0x4cd7d1];if(_['isUndefined'](_0x72054a[_0x3ea1('0x1')][_0x48f5da['id']])){_0x72054a['mailAccounts'][_0x48f5da['id']]=new MailAccount(_0x48f5da);}else{_[_0x3ea1('0x7')](_0x72054a[_0x3ea1('0x1')][_0x48f5da['id']],_0x48f5da);}}}return _0x72054a[_0x3ea1('0x1')];};};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 0c98e16..c6409a1 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 _0xfc65=['NotifyMailAccount','../client','GetMailAccount','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','Request'];(function(_0x581785,_0x56be5b){var _0x4be69c=function(_0x417332){while(--_0x417332){_0x581785['push'](_0x581785['shift']());}};_0x4be69c(++_0x56be5b);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x31f049,_0x119289){_0x31f049=_0x31f049-0x0;var _0x12dd84=_0xfc65[_0x31f049];return _0x12dd84;};'use strict';var client=require(_0x5fc6('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x5fc6('0x1'),{'options':{'attributes':['id',_0x5fc6('0x2'),_0x5fc6('0x3'),_0x5fc6('0x4'),_0x5fc6('0x5'),_0x5fc6('0x6'),_0x5fc6('0x7'),_0x5fc6('0x8'),_0x5fc6('0x9')],'raw':![],'include':[{'model':_0x5fc6('0xa'),'as':_0x5fc6('0xb'),'include':[{'model':_0x5fc6('0xc'),'attributes':['id',_0x5fc6('0x2'),'service',_0x5fc6('0xd'),_0x5fc6('0xe')],'as':_0x5fc6('0xc')}]},{'model':_0x5fc6('0xf'),'as':_0x5fc6('0x10'),'include':[{'model':_0x5fc6('0xc'),'attributes':['id',_0x5fc6('0x2'),_0x5fc6('0x4'),_0x5fc6('0xd'),_0x5fc6('0xe')],'as':'CloudProvider'}]}]},'log':_0x5fc6('0x11')});};};exports['notify']=function(_0x2a2ff4,_0x132fd0){return client[_0x5fc6('0x12')](_0x5fc6('0x13'),{'account':{'id':_0x2a2ff4},'body':_0x132fd0,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x8a25=['Smtp','getMailAccount','notify','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','data5','MailServerOut'];(function(_0x389c47,_0x5c391a){var _0x1a1d45=function(_0x55599b){while(--_0x55599b){_0x389c47['push'](_0x389c47['shift']());}};_0x1a1d45(++_0x5c391a);}(_0x8a25,0xb7));var _0x58a2=function(_0x5c9b13,_0xd9fb10){_0x5c9b13=_0x5c9b13-0x0;var _0x1c0690=_0x8a25[_0x5c9b13];return _0x1c0690;};'use strict';var client=require(_0x58a2('0x0'));exports[_0x58a2('0x1')]=function(){return function(){return client[_0x58a2('0x2')](_0x58a2('0x3'),{'options':{'attributes':['id',_0x58a2('0x4'),_0x58a2('0x5'),'service',_0x58a2('0x6'),'active','key',_0x58a2('0x7'),_0x58a2('0x8')],'raw':![],'include':[{'model':_0x58a2('0x9'),'as':_0x58a2('0xa'),'include':[{'model':_0x58a2('0xb'),'attributes':['id',_0x58a2('0x4'),_0x58a2('0xc'),'type',_0x58a2('0xd')],'as':_0x58a2('0xb')}]},{'model':_0x58a2('0xe'),'as':_0x58a2('0xf'),'include':[{'model':'CloudProvider','attributes':['id','name',_0x58a2('0xc'),'type','data5'],'as':_0x58a2('0xb')}]}]},'log':_0x58a2('0x10')});};};exports[_0x58a2('0x11')]=function(_0x3c4574,_0x1a54eb){return client[_0x58a2('0x2')]('NotifyMailAccount',{'account':{'id':_0x3c4574},'body':_0x1a54eb,'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 5bc2a09..b4078bb 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 _0x4648=['../client','getSettings','ShowSetting','GetSettings'];(function(_0x3fa898,_0x465888){var _0x508ed2=function(_0x37442b){while(--_0x37442b){_0x3fa898['push'](_0x3fa898['shift']());}};_0x508ed2(++_0x465888);}(_0x4648,0xe4));var _0x8464=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x4648[_0x543084];return _0x306a57;};'use strict';var client=require(_0x8464('0x0'));exports[_0x8464('0x1')]=function(){return client['Request'](_0x8464('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x8464('0x3')});}; \ No newline at end of file +var _0x6161=['Request','loginMailFrequency','GetSettings','getSettings'];(function(_0x5de8bf,_0x24e115){var _0x2be3e3=function(_0x385e2c){while(--_0x385e2c){_0x5de8bf['push'](_0x5de8bf['shift']());}};_0x2be3e3(++_0x24e115);}(_0x6161,0xa3));var _0x1616=function(_0x5b7d06,_0x118c98){_0x5b7d06=_0x5b7d06-0x0;var _0x17d6b6=_0x6161[_0x5b7d06];return _0x17d6b6;};'use strict';var client=require('../client');exports[_0x1616('0x0')]=function(){return client[_0x1616('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1616('0x2')]},'log':_0x1616('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 161cf8a..122728f 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 24aea66..7987a46 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 _0xaf64=['listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','ioredis','../../config/environment','createServer','timeout','listen','port','defaults','redis','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes'];(function(_0x35f238,_0x5c03ac){var _0x77e10f=function(_0xabd3e2){while(--_0xabd3e2){_0x35f238['push'](_0x35f238['shift']());}};_0x77e10f(++_0x5c03ac);}(_0xaf64,0x6d));var _0x4af6=function(_0x536256,_0x237fb5){_0x536256=_0x536256-0x0;var _0x1675f7=_0xaf64[_0x536256];return _0x1675f7;};'use strict';var _=require('lodash');var http=require(_0x4af6('0x0'));var express=require(_0x4af6('0x1'));var sticky=require('sticky-session');var Redis=require(_0x4af6('0x2'));var config=require(_0x4af6('0x3'));var app=express();var server=http[_0x4af6('0x4')](app);server[_0x4af6('0x5')]=0xdbba0;if(sticky[_0x4af6('0x6')](server,config[_0x4af6('0x7')])){var socketio=require('socket.io')(server,{'transports':['websocket','polling']});config['redis']=_[_0x4af6('0x8')](config[_0x4af6('0x9')],{'host':_0x4af6('0xa'),'port':0x18eb});socketio['adapter'](require(_0x4af6('0xb'))({'pubClient':new Redis(config[_0x4af6('0x9')]),'subClient':new Redis(config[_0x4af6('0x9')])}));require(_0x4af6('0xc'))[_0x4af6('0xd')]();require(_0x4af6('0xe'))[_0x4af6('0xd')](socketio);require(_0x4af6('0xf'))[_0x4af6('0xd')](app);require(_0x4af6('0x10'))[_0x4af6('0xd')](app);}else{server['once'](_0x4af6('0x11'),function(){console[_0x4af6('0x12')](_0x4af6('0x13'),config[_0x4af6('0x7')]);});}exports=module[_0x4af6('0x14')]=app; \ No newline at end of file +var _0xfc98=['../../config/triggers','default','../../config/socketio','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','express','sticky-session','../../config/environment','createServer','timeout','listen','port','websocket','polling','defaults','redis','localhost','adapter'];(function(_0x30d64e,_0x2ade78){var _0x53590c=function(_0x585b65){while(--_0x585b65){_0x30d64e['push'](_0x30d64e['shift']());}};_0x53590c(++_0x2ade78);}(_0xfc98,0x71));var _0x8fc9=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xfc98[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x8fc9('0x0'));var sticky=require(_0x8fc9('0x1'));var Redis=require('ioredis');var config=require(_0x8fc9('0x2'));var app=express();var server=http[_0x8fc9('0x3')](app);server[_0x8fc9('0x4')]=0xdbba0;if(sticky[_0x8fc9('0x5')](server,config[_0x8fc9('0x6')])){var socketio=require('socket.io')(server,{'transports':[_0x8fc9('0x7'),_0x8fc9('0x8')]});config['redis']=_[_0x8fc9('0x9')](config[_0x8fc9('0xa')],{'host':_0x8fc9('0xb'),'port':0x18eb});socketio[_0x8fc9('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x8fc9('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x8fc9('0xd'))[_0x8fc9('0xe')]();require(_0x8fc9('0xf'))[_0x8fc9('0xe')](socketio);require(_0x8fc9('0x10'))[_0x8fc9('0xe')](app);require('../../routes')[_0x8fc9('0xe')](app);}else{server['once'](_0x8fc9('0x11'),function(){console[_0x8fc9('0x12')](_0x8fc9('0x13'),config[_0x8fc9('0x6')]);});}exports=module[_0x8fc9('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 8886016..413d530 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 _0x3076=['catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','rpc','error','result'];(function(_0x287975,_0x53e7d6){var _0x5cfbb7=function(_0x5c5055){while(--_0x5c5055){_0x287975['push'](_0x287975['shift']());}};_0x5cfbb7(++_0x53e7d6);}(_0x3076,0x120));var _0x6307=function(_0x4f3dee,_0x46bb90){_0x4f3dee=_0x4f3dee-0x0;var _0x291aad=_0x3076[_0x4f3dee];return _0x291aad;};'use strict';var jayson=require(_0x6307('0x0'));var BPromise=require(_0x6307('0x1'));var logger=require(_0x6307('0x2'))(_0x6307('0x3'));var client=jayson[_0x6307('0x4')][_0x6307('0x5')]({'port':0x2329});client[_0x6307('0x6')]=function(_0x1cb609,_0x289913){return new BPromise(function(_0x3c30e1,_0x22f8ed){return client[_0x6307('0x7')](_0x1cb609,_0x289913)['then'](function(_0x51bedc){logger['debug'](_0x6307('0x8'),'routing',_0x1cb609,_0x289913,_0x51bedc);if(_0x51bedc[_0x6307('0x9')]){logger[_0x6307('0x9')]('rpc',_0x6307('0x3'),_0x1cb609,_0x51bedc[_0x6307('0x9')]['message'],_0x289913);return _0x22f8ed(_0x51bedc[_0x6307('0x9')]['message']);}else{return _0x3c30e1(_0x51bedc[_0x6307('0xa')]);}})[_0x6307('0xb')](function(_0x23bb87){logger[_0x6307('0x9')](_0x6307('0x8'),_0x6307('0x3'),_0x1cb609,_0x23bb87,_0x289913);return _0x22f8ed(_0x23bb87);});});};module[_0x6307('0xc')]=client; \ No newline at end of file +var _0x11e1=['exports','jayson/promise','bluebird','../../config/logger','routing','http','request','then','debug','rpc','error','message','result'];(function(_0x39e1e5,_0x89a92f){var _0x1911ce=function(_0x52fa81){while(--_0x52fa81){_0x39e1e5['push'](_0x39e1e5['shift']());}};_0x1911ce(++_0x89a92f);}(_0x11e1,0xaa));var _0x111e=function(_0xd4585e,_0x23419f){_0xd4585e=_0xd4585e-0x0;var _0xf40ece=_0x11e1[_0xd4585e];return _0xf40ece;};'use strict';var jayson=require(_0x111e('0x0'));var BPromise=require(_0x111e('0x1'));var logger=require(_0x111e('0x2'))(_0x111e('0x3'));var client=jayson['client'][_0x111e('0x4')]({'port':0x2329});client['Request']=function(_0x3f090f,_0x1a40ce){return new BPromise(function(_0x32b5c2,_0x22b264){return client[_0x111e('0x5')](_0x3f090f,_0x1a40ce)[_0x111e('0x6')](function(_0x486a80){logger[_0x111e('0x7')](_0x111e('0x8'),_0x111e('0x3'),_0x3f090f,_0x1a40ce,_0x486a80);if(_0x486a80[_0x111e('0x9')]){logger[_0x111e('0x9')](_0x111e('0x8'),_0x111e('0x3'),_0x3f090f,_0x486a80[_0x111e('0x9')][_0x111e('0xa')],_0x1a40ce);return _0x22b264(_0x486a80['error'][_0x111e('0xa')]);}else{return _0x32b5c2(_0x486a80[_0x111e('0xb')]);}})['catch'](function(_0xcadcaa){logger[_0x111e('0x9')](_0x111e('0x8'),'routing',_0x3f090f,_0xcadcaa,_0x1a40ce);return _0x22b264(_0xcadcaa);});});};module[_0x111e('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index bacdd41..80d039e 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 _0xe664=['resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue'];(function(_0x1482e3,_0xa23a09){var _0x3a0d50=function(_0x6df959){while(--_0x6df959){_0x1482e3['push'](_0x1482e3['shift']());}};_0x3a0d50(++_0xa23a09);}(_0xe664,0x121));var _0x4e66=function(_0x1a31a1,_0x454812){_0x1a31a1=_0x1a31a1-0x0;var _0x1942ad=_0xe664[_0x1a31a1];return _0x1942ad;};'use strict';var BPromise=require(_0x4e66('0x0'));var server=require(_0x4e66('0x1'));var Realtime=require(_0x4e66('0x2'));var user=require('./rpc/user');var interval=require(_0x4e66('0x3'));var openchannelQueue=require(_0x4e66('0x4'));var chatQueue=require(_0x4e66('0x5'));var smsQueue=require(_0x4e66('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x4e66('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x4e66('0x8')]()['then'](user[_0x4e66('0x9')]())[_0x4e66('0xa')](realtime[_0x4e66('0xb')]())[_0x4e66('0xa')](interval[_0x4e66('0xc')]())[_0x4e66('0xa')](realtime[_0x4e66('0xd')]())[_0x4e66('0xa')](openchannelQueue[_0x4e66('0xe')]())[_0x4e66('0xa')](realtime[_0x4e66('0xf')]())[_0x4e66('0xa')](chatQueue['getChatQueues']())[_0x4e66('0xa')](realtime[_0x4e66('0x10')]())['then'](smsQueue[_0x4e66('0x11')]())[_0x4e66('0xa')](realtime[_0x4e66('0x12')]())[_0x4e66('0xa')](mailQueue['getMailQueues']())[_0x4e66('0xa')](realtime[_0x4e66('0x13')]())['then'](faxQueue[_0x4e66('0x14')]())[_0x4e66('0xa')](realtime[_0x4e66('0x15')]())[_0x4e66('0xa')](whatsappQueue[_0x4e66('0x16')]())[_0x4e66('0xa')](realtime[_0x4e66('0x17')]())[_0x4e66('0xa')](function(){return realtime;});}function main(){return server[_0x4e66('0x18')](realtime)[_0x4e66('0xa')](function(_0x4fe383){return initRealtime();})[_0x4e66('0xa')](function(_0x4bfbd2){return setInterval(initRealtime,0x1388);})[_0x4e66('0x19')](function(_0x227955){console[_0x4e66('0x1a')](_0x227955);});}main(); \ No newline at end of file +var _0x8baa=['./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','resolve','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','catch','log','bluebird'];(function(_0x356a42,_0x5cc6ba){var _0x1462f4=function(_0x54de47){while(--_0x54de47){_0x356a42['push'](_0x356a42['shift']());}};_0x1462f4(++_0x5cc6ba);}(_0x8baa,0x153));var _0xa8ba=function(_0xc5ab00,_0x350e7a){_0xc5ab00=_0xc5ab00-0x0;var _0xaca0db=_0x8baa[_0xc5ab00];return _0xaca0db;};'use strict';var BPromise=require(_0xa8ba('0x0'));var server=require(_0xa8ba('0x1'));var Realtime=require(_0xa8ba('0x2'));var user=require(_0xa8ba('0x3'));var interval=require(_0xa8ba('0x4'));var openchannelQueue=require(_0xa8ba('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xa8ba('0x6')]()[_0xa8ba('0x7')](user['getAgents']())[_0xa8ba('0x7')](realtime[_0xa8ba('0x8')]())[_0xa8ba('0x7')](interval['getIntervals']())[_0xa8ba('0x7')](realtime[_0xa8ba('0x9')]())[_0xa8ba('0x7')](openchannelQueue[_0xa8ba('0xa')]())['then'](realtime[_0xa8ba('0xb')]())[_0xa8ba('0x7')](chatQueue['getChatQueues']())[_0xa8ba('0x7')](realtime[_0xa8ba('0xc')]())['then'](smsQueue[_0xa8ba('0xd')]())[_0xa8ba('0x7')](realtime['initSmsQueues']())['then'](mailQueue[_0xa8ba('0xe')]())[_0xa8ba('0x7')](realtime[_0xa8ba('0xf')]())['then'](faxQueue[_0xa8ba('0x10')]())['then'](realtime['initFaxQueues']())[_0xa8ba('0x7')](whatsappQueue[_0xa8ba('0x11')]())[_0xa8ba('0x7')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xa8ba('0x7')](function(_0x162025){return initRealtime();})[_0xa8ba('0x7')](function(_0x138bf9){return setInterval(initRealtime,0x1388);})[_0xa8ba('0x12')](function(_0x3e536c){console[_0xa8ba('0x13')](_0x3e536c);});}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 211ede7..238c523 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x2fbf2c,_0xb5a8f9){_0x2fbf2c=_0x2fbf2c-0x0;var _0x132005=_0x1261[_0x2fbf2c];return _0x132005;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _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(_0x24c8ae,_0x2d8b16){var _0x2baabd=function(_0x522fee){while(--_0x522fee){_0x24c8ae['push'](_0x24c8ae['shift']());}};_0x2baabd(++_0x2d8b16);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x5fc3[_0x3e21f4];return _0x40fc49;};'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 87b7ede..b33e728 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 _0xd363=['request','then','error','message','result','catch','sendMailMessage','bluebird','client'];(function(_0x141405,_0x163915){var _0x1f7622=function(_0x51b7b0){while(--_0x51b7b0){_0x141405['push'](_0x141405['shift']());}};_0x1f7622(++_0x163915);}(_0xd363,0x139));var _0x3d36=function(_0x4cebb6,_0x53ba59){_0x4cebb6=_0x4cebb6-0x0;var _0x5ef179=_0xd363[_0x4cebb6];return _0x5ef179;};'use strict';var BPromise=require(_0x3d36('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x3d36('0x1')]['http']({'port':0x232b});function request(_0x3bdef4,_0x502091){return new BPromise(function(_0x43ceca,_0x4a3eeb){return client[_0x3d36('0x2')](_0x3bdef4,_0x502091)[_0x3d36('0x3')](function(_0x21d213){if(_0x21d213[_0x3d36('0x4')]){return _0x4a3eeb(_0x21d213[_0x3d36('0x4')][_0x3d36('0x5')]);}else{return _0x43ceca(_0x21d213[_0x3d36('0x6')]);}})[_0x3d36('0x7')](function(_0x39407e){return _0x4a3eeb(_0x39407e);});});}exports[_0x3d36('0x8')]=function(_0x5af125,_0x437358){return request('SendMail',{'account':_0x5af125,'message':_0x437358});}; \ No newline at end of file +var _0xbd4a=['result','catch','sendMailMessage','bluebird','jayson/promise','client','request','then','error','message'];(function(_0x1000c5,_0x5c9f8f){var _0x53f95b=function(_0x3ffc57){while(--_0x3ffc57){_0x1000c5['push'](_0x1000c5['shift']());}};_0x53f95b(++_0x5c9f8f);}(_0xbd4a,0xd5));var _0xabd4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbd4a[_0x59ee6f];return _0x4c0979;};'use strict';var BPromise=require(_0xabd4('0x0'));var jayson=require(_0xabd4('0x1'));var client=jayson[_0xabd4('0x2')]['http']({'port':0x232b});function request(_0x57b94b,_0x5b718b){return new BPromise(function(_0x18013c,_0x489f6a){return client[_0xabd4('0x3')](_0x57b94b,_0x5b718b)[_0xabd4('0x4')](function(_0xa2240f){if(_0xa2240f[_0xabd4('0x5')]){return _0x489f6a(_0xa2240f[_0xabd4('0x5')][_0xabd4('0x6')]);}else{return _0x18013c(_0xa2240f[_0xabd4('0x7')]);}})[_0xabd4('0x8')](function(_0x381fd0){return _0x489f6a(_0x381fd0);});});}exports[_0xabd4('0x9')]=function(_0x4a032e,_0x3cb74a){return request('SendMail',{'account':_0x4a032e,'message':_0x3cb74a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 3ede98d..82412da 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 _0x528e=['whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','StatusTime','format','Status','chatPause','chatStatus','faxStatus','openchannelStatusTime','stringify','emit','user:save','lodash','moment','defaults','redis','localhost','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x528e,0x157));var _0xe528=function(_0x18c3ff,_0x1e1605){_0x18c3ff=_0x18c3ff-0x0;var _0x1e86b8=_0x528e[_0x18c3ff];return _0x1e86b8;};'use strict';var _=require(_0xe528('0x0'));var moment=require(_0xe528('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xe528('0x2')](config[_0xe528('0x3')],{'host':_0xe528('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe528('0x3')]));function Agent(_0x1b3662){this['id']=_0x1b3662['id']||0x0;this[_0xe528('0x5')]=_0x1b3662[_0xe528('0x5')]||'';this[_0xe528('0x6')]=_0x1b3662[_0xe528('0x6')]||!![];this[_0xe528('0x7')]=_0x1b3662[_0xe528('0x7')]||![];this['chatPause']=_0x1b3662['chatPause']||![];this['mailPause']=_0x1b3662[_0xe528('0x8')]||![];this[_0xe528('0x9')]=_0x1b3662[_0xe528('0x9')]||![];this[_0xe528('0xa')]=_0x1b3662[_0xe528('0xa')]||![];this[_0xe528('0xb')]=_0x1b3662[_0xe528('0xb')]||![];this['chatStatus']='unknown';this[_0xe528('0xc')]=0x0;this[_0xe528('0xd')]=_0x1b3662[_0xe528('0xd')]||0x0;this[_0xe528('0xe')]=0x0;this[_0xe528('0xf')]=_0xe528('0x10');this[_0xe528('0x11')]=0x0;this[_0xe528('0x12')]=_0x1b3662[_0xe528('0x12')]||0x0;this[_0xe528('0x13')]=0x0;this['faxStatus']='unknown';this[_0xe528('0x14')]=0x0;this[_0xe528('0x15')]=_0x1b3662[_0xe528('0x15')]||0x0;this[_0xe528('0x16')]=0x0;this[_0xe528('0x17')]='unknown';this[_0xe528('0x18')]=0x0;this[_0xe528('0x19')]=_0x1b3662[_0xe528('0x19')]||0x0;this[_0xe528('0x1a')]=0x0;this[_0xe528('0x1b')]=_0xe528('0x10');this[_0xe528('0x1c')]=0x0;this['whatsappCapacity']=_0x1b3662[_0xe528('0x1d')]||0x0;this[_0xe528('0x1e')]=0x0;this[_0xe528('0x1f')]=_0xe528('0x10');this['openchannelStatusTime']=0x0;this[_0xe528('0x20')]=_0x1b3662[_0xe528('0x20')]||0x0;this[_0xe528('0x21')]=0x0;this[_0xe528('0x22')]=![];this[_0xe528('0x23')]=undefined;this[_0xe528('0x24')]='';this[_0xe528('0x25')]();}Agent[_0xe528('0x26')][_0xe528('0x27')]=function(_0x4cf1a7){if(this[_0x4cf1a7+_0xe528('0x28')]>0x0){if(this[_0x4cf1a7+_0xe528('0x29')]>0x0&&this[_0x4cf1a7+_0xe528('0x28')]>=this[_0x4cf1a7+_0xe528('0x29')]){return _0xe528('0x2a');}else{return _0xe528('0x2b');}}else{return _0xe528('0x2c');}};Agent['prototype'][_0xe528('0x25')]=function(){var _0xeb02c6=[_0xe528('0x2d'),_0xe528('0x2e'),_0xe528('0x2f'),_0xe528('0x30'),_0xe528('0x31'),_0xe528('0x32')];for(var _0x4f39b9=0x0;_0x4f39b9<_0xeb02c6[_0xe528('0x33')];_0x4f39b9+=0x1){var _0x286ef1=this['getChannelStatus'](_0xeb02c6[_0x4f39b9]);if(this[_0xeb02c6[_0x4f39b9]+'Status']!==_0x286ef1){this[_0xeb02c6[_0x4f39b9]+_0xe528('0x34')]=_['toNumber'](moment()[_0xe528('0x35')]('x'));}this[_0xeb02c6[_0x4f39b9]+_0xe528('0x36')]=_0x286ef1;}var _0x25d4b4={'id':this['id'],'name':this[_0xe528('0x5')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xe528('0x37')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xe528('0x9')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xe528('0x38')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xe528('0xe')],'mailStatus':this[_0xe528('0xf')],'mailStatusTime':this[_0xe528('0x11')],'mailCapacity':this[_0xe528('0x12')],'mailCurrentCapacity':this[_0xe528('0x13')],'faxStatus':this[_0xe528('0x39')],'faxStatusTime':this[_0xe528('0x14')],'faxCapacity':this[_0xe528('0x15')],'faxCurrentCapacity':this[_0xe528('0x16')],'smsStatus':this[_0xe528('0x17')],'smsStatusTime':this[_0xe528('0x18')],'smsCapacity':this[_0xe528('0x19')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xe528('0x1c')],'whatsappCapacity':this[_0xe528('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xe528('0x1f')],'openchannelStatusTime':this[_0xe528('0x3a')],'openchannelCapacity':this[_0xe528('0x20')],'openchannelCurrentCapacity':this[_0xe528('0x21')],'busy':this[_0xe528('0x22')],'busyQueue':this[_0xe528('0x23')]};var _0x1482e5=md5(JSON[_0xe528('0x3b')](_0x25d4b4));if(this[_0xe528('0x24')]!==_0x1482e5){this[_0xe528('0x24')]=_0x1482e5;io[_0xe528('0x3c')](_0xe528('0x3d'),_0x25d4b4);}};module['exports']=Agent; \ No newline at end of file +var _0x087a=['faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','Status','toNumber','format','chatCurrentCapacity','openchannelStatusTime','busy','busyQueue','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity'];(function(_0x4a156c,_0x185a3c){var _0x5ca71c=function(_0x376164){while(--_0x376164){_0x4a156c['push'](_0x4a156c['shift']());}};_0x5ca71c(++_0x185a3c);}(_0x087a,0x9a));var _0xa087=function(_0x3e2988,_0x40a24a){_0x3e2988=_0x3e2988-0x0;var _0x411dd3=_0x087a[_0x3e2988];return _0x411dd3;};'use strict';var _=require(_0xa087('0x0'));var moment=require(_0xa087('0x1'));var md5=require(_0xa087('0x2'));var Redis=require(_0xa087('0x3'));var config=require(_0xa087('0x4'));config[_0xa087('0x5')]=_[_0xa087('0x6')](config[_0xa087('0x5')],{'host':_0xa087('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa087('0x5')]));function Agent(_0x202630){this['id']=_0x202630['id']||0x0;this[_0xa087('0x8')]=_0x202630[_0xa087('0x8')]||'';this[_0xa087('0x9')]=_0x202630['online']||!![];this[_0xa087('0xa')]=_0x202630['voicePause']||![];this['chatPause']=_0x202630[_0xa087('0xb')]||![];this[_0xa087('0xc')]=_0x202630[_0xa087('0xc')]||![];this[_0xa087('0xd')]=_0x202630[_0xa087('0xd')]||![];this[_0xa087('0xe')]=_0x202630[_0xa087('0xe')]||![];this['openchannelPause']=_0x202630[_0xa087('0xf')]||![];this[_0xa087('0x10')]=_0xa087('0x11');this['chatStatusTime']=0x0;this[_0xa087('0x12')]=_0x202630[_0xa087('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xa087('0x13')]='unknown';this[_0xa087('0x14')]=0x0;this[_0xa087('0x15')]=_0x202630['mailCapacity']||0x0;this[_0xa087('0x16')]=0x0;this[_0xa087('0x17')]=_0xa087('0x11');this[_0xa087('0x18')]=0x0;this[_0xa087('0x19')]=_0x202630[_0xa087('0x19')]||0x0;this[_0xa087('0x1a')]=0x0;this[_0xa087('0x1b')]=_0xa087('0x11');this[_0xa087('0x1c')]=0x0;this[_0xa087('0x1d')]=_0x202630[_0xa087('0x1d')]||0x0;this[_0xa087('0x1e')]=0x0;this[_0xa087('0x1f')]=_0xa087('0x11');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x202630[_0xa087('0x20')]||0x0;this[_0xa087('0x21')]=0x0;this[_0xa087('0x22')]=_0xa087('0x11');this['openchannelStatusTime']=0x0;this[_0xa087('0x23')]=_0x202630[_0xa087('0x23')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xa087('0x2')]='';this[_0xa087('0x24')]();}Agent[_0xa087('0x25')][_0xa087('0x26')]=function(_0x18618a){if(this[_0x18618a+'CurrentCapacity']>0x0){if(this[_0x18618a+_0xa087('0x27')]>0x0&&this[_0x18618a+_0xa087('0x28')]>=this[_0x18618a+_0xa087('0x27')]){return'maxcapacity';}else{return _0xa087('0x29');}}else{return _0xa087('0x2a');}};Agent[_0xa087('0x25')][_0xa087('0x24')]=function(){var _0xc60789=[_0xa087('0x2b'),_0xa087('0x2c'),_0xa087('0x2d'),_0xa087('0x2e'),_0xa087('0x2f'),_0xa087('0x30')];for(var _0x5dd5a0=0x0;_0x5dd5a0<_0xc60789['length'];_0x5dd5a0+=0x1){var _0x445ea6=this['getChannelStatus'](_0xc60789[_0x5dd5a0]);if(this[_0xc60789[_0x5dd5a0]+_0xa087('0x31')]!==_0x445ea6){this[_0xc60789[_0x5dd5a0]+'StatusTime']=_[_0xa087('0x32')](moment()[_0xa087('0x33')]('x'));}this[_0xc60789[_0x5dd5a0]+_0xa087('0x31')]=_0x445ea6;}var _0x5868eb={'id':this['id'],'name':this[_0xa087('0x8')],'online':this[_0xa087('0x9')],'voicePause':this[_0xa087('0xa')],'chatPause':this[_0xa087('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xa087('0xe')],'faxPause':this[_0xa087('0xd')],'openchannelPause':this[_0xa087('0xf')],'chatStatus':this[_0xa087('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xa087('0x12')],'chatCurrentCapacity':this[_0xa087('0x34')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xa087('0x14')],'mailCapacity':this[_0xa087('0x15')],'mailCurrentCapacity':this[_0xa087('0x16')],'faxStatus':this[_0xa087('0x17')],'faxStatusTime':this[_0xa087('0x18')],'faxCapacity':this[_0xa087('0x19')],'faxCurrentCapacity':this[_0xa087('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xa087('0x1c')],'smsCapacity':this[_0xa087('0x1d')],'smsCurrentCapacity':this[_0xa087('0x1e')],'whatsappStatus':this[_0xa087('0x1f')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xa087('0x20')],'whatsappCurrentCapacity':this[_0xa087('0x21')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xa087('0x35')],'openchannelCapacity':this[_0xa087('0x23')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xa087('0x36')],'busyQueue':this[_0xa087('0x37')]};var _0xa2b029=md5(JSON[_0xa087('0x38')](_0x5868eb));if(this[_0xa087('0x2')]!==_0xa2b029){this[_0xa087('0x2')]=_0xa2b029;io[_0xa087('0x39')]('user:save',_0x5868eb);}};module[_0xa087('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index acec5d5..ec76322 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 _0x2d1f=['lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','Agents','length','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save'];(function(_0x5ad190,_0xd39c9e){var _0x518ed3=function(_0x57f03a){while(--_0x57f03a){_0x5ad190['push'](_0x5ad190['shift']());}};_0x518ed3(++_0xd39c9e);}(_0x2d1f,0x78));var _0xf2d1=function(_0x2420d0,_0x25f515){_0x2420d0=_0x2420d0-0x0;var _0x1af5ec=_0x2d1f[_0x2420d0];return _0x1af5ec;};'use strict';var _=require(_0xf2d1('0x0'));var md5=require(_0xf2d1('0x1'));var util=require('util');var Redis=require(_0xf2d1('0x2'));var config=require(_0xf2d1('0x3'));config[_0xf2d1('0x4')]=_[_0xf2d1('0x5')](config[_0xf2d1('0x4')],{'host':_0xf2d1('0x6'),'port':0x18eb});var io=require(_0xf2d1('0x7'))(new Redis(config[_0xf2d1('0x4')]));function ChatQueue(_0x31c548){this['id']=_0x31c548['id']||0x0;this['name']=_0x31c548[_0xf2d1('0x8')]||'';this[_0xf2d1('0x9')]=_0x31c548[_0xf2d1('0x9')]||0xa;this['strategy']=_0x31c548[_0xf2d1('0xa')]||_0xf2d1('0xb');this['Agents']=_0x31c548['Agents'];this[_0xf2d1('0xc')]={};this[_0xf2d1('0xd')]=0x0;this[_0xf2d1('0x1')]='';this[_0xf2d1('0xe')]();this[_0xf2d1('0xf')]();}ChatQueue[_0xf2d1('0x10')][_0xf2d1('0xe')]=function(){var _0x3d0343=this['mapAgentsId'][_0xf2d1('0x11')];this[_0xf2d1('0xc')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xf2d1('0x11')]=_0x3d0343;};ChatQueue[_0xf2d1('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xf2d1('0x12')]=0x0;for(var _0x2c6aff=0x0;_0x2c6aff=0x0?this[_0xf2d1('0x18')]:0x0;var _0x1d8ffc={'id':this['id'],'available':this[_0xf2d1('0x18')],'loggedIn':this[_0xf2d1('0x16')],'name':this[_0xf2d1('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x15b248=md5(JSON[_0xf2d1('0x19')](_0x1d8ffc));if(this[_0xf2d1('0x1')]!==_0x15b248){this[_0xf2d1('0x1')]=_0x15b248;io['to'](util[_0xf2d1('0x1a')](_0xf2d1('0x1b'),_0x1d8ffc[_0xf2d1('0x8')]))[_0xf2d1('0x1c')](_0xf2d1('0x1d'),_0x1d8ffc);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x5e31=['_rr','mapAgentsId','map','loggedIn','paused','length','online','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype'];(function(_0x2d66df,_0x5ce63b){var _0x45c5d3=function(_0x437653){while(--_0x437653){_0x2d66df['push'](_0x2d66df['shift']());}};_0x45c5d3(++_0x5ce63b);}(_0x5e31,0x1d0));var _0x15e3=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x5e31[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x15e3('0x0'));var md5=require(_0x15e3('0x1'));var util=require(_0x15e3('0x2'));var Redis=require(_0x15e3('0x3'));var config=require('../../../config/environment');config[_0x15e3('0x4')]=_['defaults'](config[_0x15e3('0x4')],{'host':_0x15e3('0x5'),'port':0x18eb});var io=require(_0x15e3('0x6'))(new Redis(config[_0x15e3('0x4')]));function ChatQueue(_0x563276){this['id']=_0x563276['id']||0x0;this[_0x15e3('0x7')]=_0x563276[_0x15e3('0x7')]||'';this[_0x15e3('0x8')]=_0x563276['timeout']||0xa;this[_0x15e3('0x9')]=_0x563276[_0x15e3('0x9')]||_0x15e3('0xa');this[_0x15e3('0xb')]=_0x563276[_0x15e3('0xb')];this['mapAgentsId']={};this[_0x15e3('0xc')]=0x0;this['md5']='';this[_0x15e3('0xd')]();this[_0x15e3('0xe')]();}ChatQueue[_0x15e3('0xf')][_0x15e3('0xd')]=function(){var _0x2f6a40=this['mapAgentsId'][_0x15e3('0x10')];this[_0x15e3('0x11')]=_[_0x15e3('0x12')](this[_0x15e3('0xb')],'id');this['mapAgentsId'][_0x15e3('0x10')]=_0x2f6a40;};ChatQueue[_0x15e3('0xf')][_0x15e3('0xe')]=function(){this[_0x15e3('0x13')]=0x0;this[_0x15e3('0x14')]=0x0;for(var _0x46c90d=0x0;_0x46c90d=0x0?this[_0x15e3('0x17')]:0x0;var _0xd258cd={'id':this['id'],'available':this[_0x15e3('0x17')],'loggedIn':this[_0x15e3('0x13')],'name':this[_0x15e3('0x7')],'paused':this[_0x15e3('0x14')],'waiting':this[_0x15e3('0xc')]};var _0x5e7200=md5(JSON[_0x15e3('0x18')](_0xd258cd));if(this[_0x15e3('0x1')]!==_0x5e7200){this[_0x15e3('0x1')]=_0x5e7200;io['to'](util[_0x15e3('0x19')](_0x15e3('0x1a'),_0xd258cd[_0x15e3('0x7')]))[_0x15e3('0x1b')](_0x15e3('0x1c'),_0xd258cd);}};module[_0x15e3('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index c2ed8c8..e9de7e5 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 _0x9c9b=['_rr','paused','length','loggedIn','available','name','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x9c9b,0x177));var _0xb9c9=function(_0x42309b,_0x2979cb){_0x42309b=_0x42309b-0x0;var _0x40a6df=_0x9c9b[_0x42309b];return _0x40a6df;};'use strict';var _=require(_0xb9c9('0x0'));var md5=require(_0xb9c9('0x1'));var util=require('util');var Redis=require(_0xb9c9('0x2'));var config=require(_0xb9c9('0x3'));config[_0xb9c9('0x4')]=_[_0xb9c9('0x5')](config[_0xb9c9('0x4')],{'host':_0xb9c9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb9c9('0x4')]));function FaxQueue(_0x39890d){this['id']=_0x39890d['id']||0x0;this['name']=_0x39890d['name']||'';this[_0xb9c9('0x7')]=_0x39890d['timeout']||0xa;this[_0xb9c9('0x8')]=_0x39890d[_0xb9c9('0x8')]||_0xb9c9('0x9');this[_0xb9c9('0xa')]=_0x39890d[_0xb9c9('0xa')];this[_0xb9c9('0xb')]={};this['waiting']=0x0;this[_0xb9c9('0x1')]='';this['updateRouting']();this[_0xb9c9('0xc')]();}FaxQueue[_0xb9c9('0xd')][_0xb9c9('0xe')]=function(){var _0x3759b8=this[_0xb9c9('0xb')][_0xb9c9('0xf')];this[_0xb9c9('0xb')]=_['map'](this[_0xb9c9('0xa')],'id');this[_0xb9c9('0xb')][_0xb9c9('0xf')]=_0x3759b8;};FaxQueue['prototype'][_0xb9c9('0xc')]=function(){this['loggedIn']=0x0;this[_0xb9c9('0x10')]=0x0;for(var _0x8bcbbb=0x0;_0x8bcbbb=0x0?this[_0xb9c9('0x13')]:0x0;var _0x5a0892={'id':this['id'],'available':this[_0xb9c9('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xb9c9('0x14')],'paused':this['paused'],'waiting':this['waiting']};var _0x1f0303=md5(JSON[_0xb9c9('0x15')](_0x5a0892));if(this['md5']!==_0x1f0303){this['md5']=_0x1f0303;io['to'](util['format'](_0xb9c9('0x16'),_0x5a0892[_0xb9c9('0x14')]))[_0xb9c9('0x17')](_0xb9c9('0x18'),_0x5a0892);}};module[_0xb9c9('0x19')]=FaxQueue; \ No newline at end of file +var _0xf628=['fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','faxPause','paused','available','format'];(function(_0x5b47d9,_0x1327ce){var _0x4151f0=function(_0x24bda2){while(--_0x24bda2){_0x5b47d9['push'](_0x5b47d9['shift']());}};_0x4151f0(++_0x1327ce);}(_0xf628,0x78));var _0x8f62=function(_0x15c520,_0x229cc7){_0x15c520=_0x15c520-0x0;var _0x75a41b=_0xf628[_0x15c520];return _0x75a41b;};'use strict';var _=require(_0x8f62('0x0'));var md5=require(_0x8f62('0x1'));var util=require('util');var Redis=require(_0x8f62('0x2'));var config=require(_0x8f62('0x3'));config[_0x8f62('0x4')]=_[_0x8f62('0x5')](config[_0x8f62('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x8f62('0x6'))(new Redis(config[_0x8f62('0x4')]));function FaxQueue(_0x24804d){this['id']=_0x24804d['id']||0x0;this[_0x8f62('0x7')]=_0x24804d[_0x8f62('0x7')]||'';this[_0x8f62('0x8')]=_0x24804d[_0x8f62('0x8')]||0xa;this[_0x8f62('0x9')]=_0x24804d[_0x8f62('0x9')]||_0x8f62('0xa');this[_0x8f62('0xb')]=_0x24804d[_0x8f62('0xb')];this[_0x8f62('0xc')]={};this[_0x8f62('0xd')]=0x0;this[_0x8f62('0x1')]='';this[_0x8f62('0xe')]();this[_0x8f62('0xf')]();}FaxQueue[_0x8f62('0x10')][_0x8f62('0xe')]=function(){var _0x3f5980=this[_0x8f62('0xc')][_0x8f62('0x11')];this[_0x8f62('0xc')]=_[_0x8f62('0x12')](this[_0x8f62('0xb')],'id');this['mapAgentsId'][_0x8f62('0x11')]=_0x3f5980;};FaxQueue[_0x8f62('0x10')]['updateRealtime']=function(){this[_0x8f62('0x13')]=0x0;this['paused']=0x0;for(var _0x35918a=0x0;_0x35918a=0x0?this[_0x8f62('0x17')]:0x0;var _0x806751={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8f62('0x13')],'name':this[_0x8f62('0x7')],'paused':this[_0x8f62('0x16')],'waiting':this[_0x8f62('0xd')]};var _0x93e593=md5(JSON['stringify'](_0x806751));if(this[_0x8f62('0x1')]!==_0x93e593){this[_0x8f62('0x1')]=_0x93e593;io['to'](util[_0x8f62('0x18')](_0x8f62('0x19'),_0x806751[_0x8f62('0x7')]))[_0x8f62('0x1a')](_0x8f62('0x1b'),_0x806751);}};module[_0x8f62('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index cd35c0d..abb7e9e 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 _0xde79=['name','Intervals','exports'];(function(_0xc3a6e4,_0x496341){var _0x983c0d=function(_0x2fe8c7){while(--_0x2fe8c7){_0xc3a6e4['push'](_0xc3a6e4['shift']());}};_0x983c0d(++_0x496341);}(_0xde79,0x183));var _0x9de7=function(_0x528ac3,_0x4e1e4d){_0x528ac3=_0x528ac3-0x0;var _0x5e67df=_0xde79[_0x528ac3];return _0x5e67df;};'use strict';function Interval(_0x66acd){this['id']=_0x66acd['id']||0x0;this[_0x9de7('0x0')]=_0x66acd[_0x9de7('0x0')]||'';this['Intervals']=_0x66acd[_0x9de7('0x1')]||{};}module[_0x9de7('0x2')]=Interval; \ No newline at end of file +var _0x0c54=['name','Intervals'];(function(_0x4ab846,_0x1079ba){var _0x2f5a1f=function(_0xc01dc2){while(--_0xc01dc2){_0x4ab846['push'](_0x4ab846['shift']());}};_0x2f5a1f(++_0x1079ba);}(_0x0c54,0x158));var _0x40c5=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x0c54[_0x562f3b];return _0x1edd55;};'use strict';function Interval(_0xc5111){this['id']=_0xc5111['id']||0x0;this[_0x40c5('0x0')]=_0xc5111[_0x40c5('0x0')]||'';this[_0x40c5('0x1')]=_0xc5111[_0x40c5('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index a8181d6..5997d03 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 _0x7567=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','loggedIn','online','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','ioredis','redis','socket.io-emitter'];(function(_0x2b980f,_0x54d7b9){var _0x1e26a6=function(_0x584af7){while(--_0x584af7){_0x2b980f['push'](_0x2b980f['shift']());}};_0x1e26a6(++_0x54d7b9);}(_0x7567,0x1be));var _0x7756=function(_0x23733e,_0x52bdcb){_0x23733e=_0x23733e-0x0;var _0x5cace0=_0x7567[_0x23733e];return _0x5cace0;};'use strict';var _=require('lodash');var md5=require(_0x7756('0x0'));var util=require('util');var Redis=require(_0x7756('0x1'));var config=require('../../../config/environment');config[_0x7756('0x2')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7756('0x3'))(new Redis(config['redis']));function MailQueue(_0x24c468){this['id']=_0x24c468['id']||0x0;this[_0x7756('0x4')]=_0x24c468['name']||'';this[_0x7756('0x5')]=_0x24c468[_0x7756('0x5')]||0xa;this[_0x7756('0x6')]=_0x24c468[_0x7756('0x6')]||_0x7756('0x7');this[_0x7756('0x8')]=_0x24c468[_0x7756('0x8')];this[_0x7756('0x9')]={};this[_0x7756('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0x7756('0xb')]();}MailQueue[_0x7756('0xc')][_0x7756('0xd')]=function(){var _0x46bcdc=this[_0x7756('0x9')]['_rr'];this[_0x7756('0x9')]=_[_0x7756('0xe')](this['Agents'],'id');this[_0x7756('0x9')]['_rr']=_0x46bcdc;};MailQueue[_0x7756('0xc')][_0x7756('0xb')]=function(){this[_0x7756('0xf')]=0x0;this['paused']=0x0;for(var _0x5a43a3=0x0;_0x5a43a3=0x0?this[_0x7756('0x12')]:0x0;var _0x5512e7={'id':this['id'],'available':this[_0x7756('0x12')],'loggedIn':this[_0x7756('0xf')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x7756('0xa')]};var _0x511035=md5(JSON[_0x7756('0x13')](_0x5512e7));if(this[_0x7756('0x0')]!==_0x511035){this[_0x7756('0x0')]=_0x511035;io['to'](util[_0x7756('0x14')](_0x7756('0x15'),_0x5512e7[_0x7756('0x4')]))[_0x7756('0x16')](_0x7756('0x17'),_0x5512e7);}};module[_0x7756('0x18')]=MailQueue; \ No newline at end of file +var _0x41c1=['paused','length','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn'];(function(_0x5a4fc3,_0x499376){var _0xa80d54=function(_0x5ee5b8){while(--_0x5ee5b8){_0x5a4fc3['push'](_0x5a4fc3['shift']());}};_0xa80d54(++_0x499376);}(_0x41c1,0x172));var _0x141c=function(_0x347862,_0x339566){_0x347862=_0x347862-0x0;var _0x2ec88b=_0x41c1[_0x347862];return _0x2ec88b;};'use strict';var _=require(_0x141c('0x0'));var md5=require(_0x141c('0x1'));var util=require(_0x141c('0x2'));var Redis=require(_0x141c('0x3'));var config=require(_0x141c('0x4'));config['redis']=_['defaults'](config[_0x141c('0x5')],{'host':_0x141c('0x6'),'port':0x18eb});var io=require(_0x141c('0x7'))(new Redis(config[_0x141c('0x5')]));function MailQueue(_0xf40a2e){this['id']=_0xf40a2e['id']||0x0;this[_0x141c('0x8')]=_0xf40a2e[_0x141c('0x8')]||'';this[_0x141c('0x9')]=_0xf40a2e[_0x141c('0x9')]||0xa;this[_0x141c('0xa')]=_0xf40a2e[_0x141c('0xa')]||_0x141c('0xb');this[_0x141c('0xc')]=_0xf40a2e['Agents'];this[_0x141c('0xd')]={};this[_0x141c('0xe')]=0x0;this[_0x141c('0x1')]='';this[_0x141c('0xf')]();this[_0x141c('0x10')]();}MailQueue[_0x141c('0x11')][_0x141c('0xf')]=function(){var _0xe46402=this[_0x141c('0xd')][_0x141c('0x12')];this['mapAgentsId']=_['map'](this[_0x141c('0xc')],'id');this[_0x141c('0xd')][_0x141c('0x12')]=_0xe46402;};MailQueue[_0x141c('0x11')]['updateRealtime']=function(){this[_0x141c('0x13')]=0x0;this[_0x141c('0x14')]=0x0;for(var _0x4ffda8=0x0;_0x4ffda8=0x0?this['available']:0x0;var _0x5016b1={'id':this['id'],'available':this[_0x141c('0x17')],'loggedIn':this[_0x141c('0x13')],'name':this[_0x141c('0x8')],'paused':this[_0x141c('0x14')],'waiting':this[_0x141c('0xe')]};var _0x2a6f12=md5(JSON[_0x141c('0x18')](_0x5016b1));if(this[_0x141c('0x1')]!==_0x2a6f12){this[_0x141c('0x1')]=_0x2a6f12;io['to'](util[_0x141c('0x19')](_0x141c('0x1a'),_0x5016b1['name']))[_0x141c('0x1b')](_0x141c('0x1c'),_0x5016b1);}};module[_0x141c('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 f10d8e7..a7eb993 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(_0x5c33df,_0x44a5cd){var _0x2c8eaa=function(_0x4056f6){while(--_0x4056f6){_0x5c33df['push'](_0x5c33df['shift']());}};_0x2c8eaa(++_0x44a5cd);}(_0x814b,0x1a2));var _0xb814=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0x814b[_0x2baca1];return _0x9aa62a;};'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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x7a54,0x106));var _0x47a5=function(_0x568eef,_0x2ecf28){_0x568eef=_0x568eef-0x0;var _0xb4c507=_0x7a54[_0x568eef];return _0xb4c507;};'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 904126c..40823f2 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 _0xaa7c=['md5','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x14b706,_0x19cea9){var _0x51d6d8=function(_0xc484c9){while(--_0xc484c9){_0x14b706['push'](_0x14b706['shift']());}};_0x51d6d8(++_0x19cea9);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x1923a8,_0x4710d6){_0x1923a8=_0x1923a8-0x0;var _0x3c3888=_0xaa7c[_0x1923a8];return _0x3c3888;};'use strict';var _=require(_0xcaa7('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xcaa7('0x1')]=_[_0xcaa7('0x2')](config['redis'],{'host':_0xcaa7('0x3'),'port':0x18eb});var io=require(_0xcaa7('0x4'))(new Redis(config[_0xcaa7('0x1')]));function SmsQueue(_0x17d8cf){this['id']=_0x17d8cf['id']||0x0;this[_0xcaa7('0x5')]=_0x17d8cf['name']||'';this[_0xcaa7('0x6')]=_0x17d8cf['timeout']||0xa;this['strategy']=_0x17d8cf[_0xcaa7('0x7')]||_0xcaa7('0x8');this[_0xcaa7('0x9')]=_0x17d8cf['Agents'];this[_0xcaa7('0xa')]={};this[_0xcaa7('0xb')]=0x0;this[_0xcaa7('0xc')]='';this[_0xcaa7('0xd')]();this[_0xcaa7('0xe')]();}SmsQueue['prototype'][_0xcaa7('0xd')]=function(){var _0x39d53a=this[_0xcaa7('0xa')][_0xcaa7('0xf')];this[_0xcaa7('0xa')]=_[_0xcaa7('0x10')](this['Agents'],'id');this[_0xcaa7('0xa')][_0xcaa7('0xf')]=_0x39d53a;};SmsQueue[_0xcaa7('0x11')][_0xcaa7('0xe')]=function(){this[_0xcaa7('0x12')]=0x0;this[_0xcaa7('0x13')]=0x0;for(var _0x299490=0x0;_0x299490=0x0?this[_0xcaa7('0x15')]:0x0;var _0x5c2a74={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcaa7('0x12')],'name':this[_0xcaa7('0x5')],'paused':this[_0xcaa7('0x13')],'waiting':this[_0xcaa7('0xb')]};var _0x131e52=md5(JSON[_0xcaa7('0x16')](_0x5c2a74));if(this[_0xcaa7('0xc')]!==_0x131e52){this['md5']=_0x131e52;io['to'](util[_0xcaa7('0x17')](_0xcaa7('0x18'),_0x5c2a74[_0xcaa7('0x5')]))[_0xcaa7('0x19')](_0xcaa7('0x1a'),_0x5c2a74);}};module[_0xcaa7('0x1b')]=SmsQueue; \ No newline at end of file +var _0x1da1=['lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','exports'];(function(_0x4d4ccd,_0x577f2b){var _0x35e8e4=function(_0x4b2ad0){while(--_0x4b2ad0){_0x4d4ccd['push'](_0x4d4ccd['shift']());}};_0x35e8e4(++_0x577f2b);}(_0x1da1,0x1a4));var _0x11da=function(_0x3e1ecd,_0x139bcd){_0x3e1ecd=_0x3e1ecd-0x0;var _0x37b2ed=_0x1da1[_0x3e1ecd];return _0x37b2ed;};'use strict';var _=require(_0x11da('0x0'));var md5=require(_0x11da('0x1'));var util=require(_0x11da('0x2'));var Redis=require(_0x11da('0x3'));var config=require(_0x11da('0x4'));config['redis']=_['defaults'](config[_0x11da('0x5')],{'host':_0x11da('0x6'),'port':0x18eb});var io=require(_0x11da('0x7'))(new Redis(config['redis']));function SmsQueue(_0xb2c841){this['id']=_0xb2c841['id']||0x0;this[_0x11da('0x8')]=_0xb2c841[_0x11da('0x8')]||'';this['timeout']=_0xb2c841['timeout']||0xa;this[_0x11da('0x9')]=_0xb2c841[_0x11da('0x9')]||'beepall';this[_0x11da('0xa')]=_0xb2c841[_0x11da('0xa')];this['mapAgentsId']={};this[_0x11da('0xb')]=0x0;this[_0x11da('0x1')]='';this[_0x11da('0xc')]();this[_0x11da('0xd')]();}SmsQueue[_0x11da('0xe')][_0x11da('0xc')]=function(){var _0x247c60=this[_0x11da('0xf')][_0x11da('0x10')];this['mapAgentsId']=_[_0x11da('0x11')](this[_0x11da('0xa')],'id');this[_0x11da('0xf')][_0x11da('0x10')]=_0x247c60;};SmsQueue[_0x11da('0xe')]['updateRealtime']=function(){this[_0x11da('0x12')]=0x0;this[_0x11da('0x13')]=0x0;for(var _0x2ee64d=0x0;_0x2ee64d=0x0?this[_0x11da('0x17')]:0x0;var _0x12fb44={'id':this['id'],'available':this[_0x11da('0x17')],'loggedIn':this[_0x11da('0x12')],'name':this['name'],'paused':this[_0x11da('0x13')],'waiting':this[_0x11da('0xb')]};var _0x33de25=md5(JSON[_0x11da('0x18')](_0x12fb44));if(this[_0x11da('0x1')]!==_0x33de25){this['md5']=_0x33de25;io['to'](util[_0x11da('0x19')](_0x11da('0x1a'),_0x12fb44[_0x11da('0x8')]))['emit']('sms_queue:save',_0x12fb44);}};module[_0x11da('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index feb0656..29493b1 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 _0x9f43=['map','prototype','loggedIn','length','online','whatsappPause','paused','available','format','whatsapp:queue:%s','emit','exports','md5','redis','localhost','name','strategy','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId'];(function(_0x1a2160,_0x32bb56){var _0x187b21=function(_0x30ca69){while(--_0x30ca69){_0x1a2160['push'](_0x1a2160['shift']());}};_0x187b21(++_0x32bb56);}(_0x9f43,0x1ef));var _0x39f4=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x9f43[_0x4ac424];return _0xe1b890;};'use strict';var _=require('lodash');var md5=require(_0x39f4('0x0'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x39f4('0x1')]=_['defaults'](config[_0x39f4('0x1')],{'host':_0x39f4('0x2'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x4e185b){this['id']=_0x4e185b['id']||0x0;this[_0x39f4('0x3')]=_0x4e185b[_0x39f4('0x3')]||'';this['timeout']=_0x4e185b['timeout']||0xa;this['strategy']=_0x4e185b[_0x39f4('0x4')]||'beepall';this[_0x39f4('0x5')]=_0x4e185b[_0x39f4('0x5')];this['mapAgentsId']={};this[_0x39f4('0x6')]=0x0;this[_0x39f4('0x0')]='';this[_0x39f4('0x7')]();this[_0x39f4('0x8')]();}WhatsappQueue['prototype'][_0x39f4('0x7')]=function(){var _0x19cb60=this['mapAgentsId'][_0x39f4('0x9')];this[_0x39f4('0xa')]=_[_0x39f4('0xb')](this[_0x39f4('0x5')],'id');this[_0x39f4('0xa')][_0x39f4('0x9')]=_0x19cb60;};WhatsappQueue[_0x39f4('0xc')][_0x39f4('0x8')]=function(){this[_0x39f4('0xd')]=0x0;this['paused']=0x0;for(var _0x54bbb0=0x0;_0x54bbb0=0x0?this[_0x39f4('0x12')]:0x0;var _0x35ad35={'id':this['id'],'available':this[_0x39f4('0x12')],'loggedIn':this['loggedIn'],'name':this[_0x39f4('0x3')],'paused':this['paused'],'waiting':this[_0x39f4('0x6')]};var _0x48bed2=md5(JSON['stringify'](_0x35ad35));if(this['md5']!==_0x48bed2){this[_0x39f4('0x0')]=_0x48bed2;io['to'](util[_0x39f4('0x13')](_0x39f4('0x14'),_0x35ad35[_0x39f4('0x3')]))[_0x39f4('0x15')]('whatsapp_queue:save',_0x35ad35);}};module[_0x39f4('0x16')]=WhatsappQueue; \ No newline at end of file +var _0xb9b2=['stringify','format','whatsapp_queue:save','exports','lodash','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','whatsappPause','available'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb9b2,0x18c));var _0x2b9b=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xb9b2[_0x543084];return _0x306a57;};'use strict';var _=require(_0x2b9b('0x0'));var md5=require('md5');var util=require(_0x2b9b('0x1'));var Redis=require(_0x2b9b('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x2b9b('0x3')](config[_0x2b9b('0x4')],{'host':_0x2b9b('0x5'),'port':0x18eb});var io=require(_0x2b9b('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x72ab25){this['id']=_0x72ab25['id']||0x0;this['name']=_0x72ab25[_0x2b9b('0x7')]||'';this[_0x2b9b('0x8')]=_0x72ab25['timeout']||0xa;this[_0x2b9b('0x9')]=_0x72ab25[_0x2b9b('0x9')]||'beepall';this['Agents']=_0x72ab25[_0x2b9b('0xa')];this[_0x2b9b('0xb')]={};this[_0x2b9b('0xc')]=0x0;this[_0x2b9b('0xd')]='';this[_0x2b9b('0xe')]();this[_0x2b9b('0xf')]();}WhatsappQueue[_0x2b9b('0x10')][_0x2b9b('0xe')]=function(){var _0x9fd83a=this[_0x2b9b('0xb')][_0x2b9b('0x11')];this[_0x2b9b('0xb')]=_['map'](this[_0x2b9b('0xa')],'id');this[_0x2b9b('0xb')][_0x2b9b('0x11')]=_0x9fd83a;};WhatsappQueue[_0x2b9b('0x10')]['updateRealtime']=function(){this[_0x2b9b('0x12')]=0x0;this[_0x2b9b('0x13')]=0x0;for(var _0x143e32=0x0;_0x143e32=0x0?this[_0x2b9b('0x17')]:0x0;var _0x16edde={'id':this['id'],'available':this[_0x2b9b('0x17')],'loggedIn':this[_0x2b9b('0x12')],'name':this['name'],'paused':this[_0x2b9b('0x13')],'waiting':this[_0x2b9b('0xc')]};var _0x3f06c2=md5(JSON[_0x2b9b('0x18')](_0x16edde));if(this[_0x2b9b('0xd')]!==_0x3f06c2){this[_0x2b9b('0xd')]=_0x3f06c2;io['to'](util[_0x2b9b('0x19')]('whatsapp:queue:%s',_0x16edde[_0x2b9b('0x7')]))['emit'](_0x2b9b('0x1a'),_0x16edde);}};module[_0x2b9b('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index fd7aac7..22e2fbd 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 _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(_0x2d5e89,_0x28affe){var _0x32996b=function(_0x486a41){while(--_0x486a41){_0x2d5e89['push'](_0x2d5e89['shift']());}};_0x32996b(++_0x28affe);}(_0xb10b,0x12a));var _0xbb10=function(_0x1717a0,_0x3df0e9){_0x1717a0=_0x1717a0-0x0;var _0x4065f3=_0xb10b[_0x1717a0];return _0x4065f3;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index adc96a0..be304f9 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 _0x05c1=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x05c1,0xdf));var _0x105c=function(_0xc4966b,_0x6cd5e0){_0xc4966b=_0xc4966b-0x0;var _0x1802bb=_0x05c1[_0xc4966b];return _0x1802bb;};'use strict';var client=require(_0x105c('0x0'));exports['update']=function(_0x3c3ba3,_0x3adaa4){return client[_0x105c('0x1')](_0x105c('0x2'),{'body':_0x3adaa4,'options':{'where':{'id':_0x3c3ba3}},'log':_0x105c('0x3')});};exports[_0x105c('0x4')]=function(_0x204cda,_0x4bb302){return client[_0x105c('0x1')](_0x105c('0x5'),{'body':_0x4bb302,'options':{'where':{'id':_0x204cda}},'log':_0x105c('0x6')});}; \ No newline at end of file +var _0x674c=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x1483e2,_0x500a48){var _0x2cb18e=function(_0x451a93){while(--_0x451a93){_0x1483e2['push'](_0x1483e2['shift']());}};_0x2cb18e(++_0x500a48);}(_0x674c,0xd7));var _0xc674=function(_0x2f36ce,_0xfca221){_0x2f36ce=_0x2f36ce-0x0;var _0x4094d2=_0x674c[_0x2f36ce];return _0x4094d2;};'use strict';var client=require('../client');exports[_0xc674('0x0')]=function(_0x45bfec,_0x542dfe){return client[_0xc674('0x1')](_0xc674('0x2'),{'body':_0x542dfe,'options':{'where':{'id':_0x45bfec}},'log':_0xc674('0x3')});};exports[_0xc674('0x4')]=function(_0x550741,_0x43d920){return client[_0xc674('0x1')](_0xc674('0x5'),{'body':_0x43d920,'options':{'where':{'id':_0x550741}},'log':_0xc674('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 009144f..4a591aa 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 _0x079b=['create','CreateChatMessage','../client'];(function(_0x2c437c,_0x1da7d2){var _0x473e11=function(_0x33b2ad){while(--_0x33b2ad){_0x2c437c['push'](_0x2c437c['shift']());}};_0x473e11(++_0x1da7d2);}(_0x079b,0x98));var _0xb079=function(_0x35731c,_0x5ab1d1){_0x35731c=_0x35731c-0x0;var _0x2f2957=_0x079b[_0x35731c];return _0x2f2957;};'use strict';var client=require(_0xb079('0x0'));exports[_0xb079('0x1')]=function(_0x1f1586){return client['Request'](_0xb079('0x2'),{'body':_0x1f1586,'log':'createChatMessage'});}; \ No newline at end of file +var _0xd1db=['createChatMessage','create','Request'];(function(_0x3dee82,_0x5af050){var _0x28b6a5=function(_0x10959f){while(--_0x10959f){_0x3dee82['push'](_0x3dee82['shift']());}};_0x28b6a5(++_0x5af050);}(_0xd1db,0x175));var _0xbd1d=function(_0xcfed91,_0x29b51b){_0xcfed91=_0xcfed91-0x0;var _0x42e245=_0xd1db[_0xcfed91];return _0x42e245;};'use strict';var client=require('../client');exports[_0xbd1d('0x0')]=function(_0xafff8){return client[_0xbd1d('0x1')]('CreateChatMessage',{'body':_0xafff8,'log':_0xbd1d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 8139126..8b26d73 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 _0xdb2a=['getChatQueues','Request','timeout','strategy','Agents','online','chatPause','../client'];(function(_0x4082f2,_0x1f7fe6){var _0x2347ce=function(_0x53a915){while(--_0x53a915){_0x4082f2['push'](_0x4082f2['shift']());}};_0x2347ce(++_0x1f7fe6);}(_0xdb2a,0x16f));var _0xadb2=function(_0x3e6cd0,_0x43f94d){_0x3e6cd0=_0x3e6cd0-0x0;var _0x4bc33c=_0xdb2a[_0x3e6cd0];return _0x4bc33c;};'use strict';var client=require(_0xadb2('0x0'));exports[_0xadb2('0x1')]=function(){return function(){return client[_0xadb2('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0xadb2('0x3'),_0xadb2('0x4')],'include':[{'model':'User','as':_0xadb2('0x5'),'attributes':['id','name',_0xadb2('0x6'),_0xadb2('0x7')]}]},'log':_0xadb2('0x1')});};}; \ No newline at end of file +var _0xb1a3=['User','Agents','online','chatPause','../client','getChatQueues','Request','name'];(function(_0x3dc37d,_0x41ffb2){var _0x2eea64=function(_0x5b38a5){while(--_0x5b38a5){_0x3dc37d['push'](_0x3dc37d['shift']());}};_0x2eea64(++_0x41ffb2);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xb1a3[_0x3ce3c];return _0x55a2c9;};'use strict';var client=require(_0x3b1a('0x0'));exports[_0x3b1a('0x1')]=function(){return function(){return client[_0x3b1a('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x3b1a('0x3'),'timeout','strategy'],'include':[{'model':_0x3b1a('0x4'),'as':_0x3b1a('0x5'),'attributes':['id',_0x3b1a('0x3'),_0x3b1a('0x6'),_0x3b1a('0x7')]}]},'log':_0x3b1a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 8b037b7..951d347 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 _0xb2ef=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x3b1511,_0xe5ea0){var _0x630d06=function(_0x529ea0){while(--_0x529ea0){_0x3b1511['push'](_0x3b1511['shift']());}};_0x630d06(++_0xe5ea0);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x5d050b,_0x5e5ff5){_0x5d050b=_0x5d050b-0x0;var _0x34675b=_0xb2ef[_0x5d050b];return _0x34675b;};'use strict';var client=require(_0xfb2e('0x0'));exports[_0xfb2e('0x1')]=function(_0x2e0d8c){return client['Request'](_0xfb2e('0x2'),{'body':_0x2e0d8c,'log':_0xfb2e('0x2')});};exports[_0xfb2e('0x3')]=function(_0x5de056,_0xb829cc){return client[_0xfb2e('0x4')](_0xfb2e('0x5'),{'body':_0xb829cc,'options':{'where':{'uniqueid':_0x5de056},'order':[['id',_0xfb2e('0x6')]],'limit':0x1},'log':_0xfb2e('0x5')});}; \ No newline at end of file +var _0x9e9b=['update','DESC','UpdateChatQueueReport','../client','Request','CreateChatQueueReport'];(function(_0xe0105d,_0x92168c){var _0x2b051b=function(_0x386930){while(--_0x386930){_0xe0105d['push'](_0xe0105d['shift']());}};_0x2b051b(++_0x92168c);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x27def7,_0x3f0835){_0x27def7=_0x27def7-0x0;var _0x581cbc=_0x9e9b[_0x27def7];return _0x581cbc;};'use strict';var client=require(_0xb9e9('0x0'));exports['create']=function(_0x5af29a){return client[_0xb9e9('0x1')](_0xb9e9('0x2'),{'body':_0x5af29a,'log':_0xb9e9('0x2')});};exports[_0xb9e9('0x3')]=function(_0x58a9cd,_0x430131){return client[_0xb9e9('0x1')]('UpdateChatQueueReport',{'body':_0x430131,'options':{'where':{'uniqueid':_0x58a9cd},'order':[['id',_0xb9e9('0x4')]],'limit':0x1},'log':_0xb9e9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index aa86448..657badf 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(_0x95bd07,_0x1f3f68){var _0x24a7a5=function(_0x4e5c21){while(--_0x4e5c21){_0x95bd07['push'](_0x95bd07['shift']());}};_0x24a7a5(++_0x1f3f68);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x2f77cb,_0x54c2d9){var _0x173861=function(_0x45ae60){while(--_0x45ae60){_0x2f77cb['push'](_0x2f77cb['shift']());}};_0x173861(++_0x54c2d9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 2276351..bafa279 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 _0x9528=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x49a339,_0x5701ce){var _0x1ecdb2=function(_0xc87be5){while(--_0xc87be5){_0x49a339['push'](_0x49a339['shift']());}};_0x1ecdb2(++_0x5701ce);}(_0x9528,0x158));var _0x8952=function(_0x5518f9,_0x2e61e5){_0x5518f9=_0x5518f9-0x0;var _0x1a4890=_0x9528[_0x5518f9];return _0x1a4890;};'use strict';var client=require(_0x8952('0x0'));exports[_0x8952('0x1')]=function(_0x9a6257){return client[_0x8952('0x2')](_0x8952('0x3'),{'body':_0x9a6257,'log':_0x8952('0x4')});}; \ No newline at end of file +var _0x3c3d=['create','Request','createFaxMessage'];(function(_0x3600e2,_0x396426){var _0x45ace2=function(_0x2d9fe2){while(--_0x2d9fe2){_0x3600e2['push'](_0x3600e2['shift']());}};_0x45ace2(++_0x396426);}(_0x3c3d,0xff));var _0xd3c3=function(_0x209487,_0x21ae21){_0x209487=_0x209487-0x0;var _0x226983=_0x3c3d[_0x209487];return _0x226983;};'use strict';var client=require('../client');exports[_0xd3c3('0x0')]=function(_0x23c410){return client[_0xd3c3('0x1')]('CreateFaxMessage',{'body':_0x23c410,'log':_0xd3c3('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index e824257..f95e785 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 _0x4861=['online','getFaxQueues','GetFaxQueue','name','strategy','User'];(function(_0x349a2c,_0x4655dc){var _0x93d984=function(_0x32869c){while(--_0x32869c){_0x349a2c['push'](_0x349a2c['shift']());}};_0x93d984(++_0x4655dc);}(_0x4861,0xe6));var _0x1486=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x4861[_0x17b6e3];return _0x3906f3;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client['Request'](_0x1486('0x0'),{'options':{'raw':![],'attributes':['id',_0x1486('0x1'),'timeout',_0x1486('0x2')],'include':[{'model':_0x1486('0x3'),'as':'Agents','attributes':['id',_0x1486('0x1'),_0x1486('0x4'),'faxPause']}]},'log':_0x1486('0x5')});};}; \ No newline at end of file +var _0xf3c4=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3c4,0x1c3));var _0x4f3c=function(_0x3c9c9d,_0x13dd97){_0x3c9c9d=_0x3c9c9d-0x0;var _0x42191e=_0xf3c4[_0x3c9c9d];return _0x42191e;};'use strict';var client=require(_0x4f3c('0x0'));exports[_0x4f3c('0x1')]=function(){return function(){return client[_0x4f3c('0x2')](_0x4f3c('0x3'),{'options':{'raw':![],'attributes':['id',_0x4f3c('0x4'),_0x4f3c('0x5'),_0x4f3c('0x6')],'include':[{'model':_0x4f3c('0x7'),'as':'Agents','attributes':['id',_0x4f3c('0x4'),'online',_0x4f3c('0x8')]}]},'log':_0x4f3c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index abafe76..b2488be 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 _0xe6e3=['update','DESC','UpdateFaxQueueReport','Request','CreateFaxQueueReport'];(function(_0x1cd577,_0x180f2a){var _0x790837=function(_0x2cace5){while(--_0x2cace5){_0x1cd577['push'](_0x1cd577['shift']());}};_0x790837(++_0x180f2a);}(_0xe6e3,0x184));var _0x3e6e=function(_0x28666a,_0x3dc25d){_0x28666a=_0x28666a-0x0;var _0x19d752=_0xe6e3[_0x28666a];return _0x19d752;};'use strict';var client=require('../client');exports['create']=function(_0x4e3bd5){return client[_0x3e6e('0x0')](_0x3e6e('0x1'),{'body':_0x4e3bd5,'log':'CreateFaxQueueReport'});};exports[_0x3e6e('0x2')]=function(_0x158f15,_0x784f3c){return client['Request']('UpdateFaxQueueReport',{'body':_0x784f3c,'options':{'where':{'uniqueid':_0x158f15},'order':[['id',_0x3e6e('0x3')]],'limit':0x1},'log':_0x3e6e('0x4')});}; \ No newline at end of file +var _0xcd5f=['../client','Request','update','DESC','UpdateFaxQueueReport'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xcd5f,0x1db));var _0xfcd5=function(_0x395417,_0x4bfcf6){_0x395417=_0x395417-0x0;var _0x5be1b2=_0xcd5f[_0x395417];return _0x5be1b2;};'use strict';var client=require(_0xfcd5('0x0'));exports['create']=function(_0x9f7d26){return client[_0xfcd5('0x1')]('CreateFaxQueueReport',{'body':_0x9f7d26,'log':'CreateFaxQueueReport'});};exports[_0xfcd5('0x2')]=function(_0x1258b5,_0x510243){return client['Request']('UpdateFaxQueueReport',{'body':_0x510243,'options':{'where':{'uniqueid':_0x1258b5},'order':[['id',_0xfcd5('0x3')]],'limit':0x1},'log':_0xfcd5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b15af5a..76f2e7b 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 _0x3d40=['getIntervals','Request','GetInterval','Interval','Intervals','interval','../client'];(function(_0x3d4551,_0x18181e){var _0x4697e0=function(_0x46039b){while(--_0x46039b){_0x3d4551['push'](_0x3d4551['shift']());}};_0x4697e0(++_0x18181e);}(_0x3d40,0x117));var _0x03d4=function(_0x7a419b,_0x3854d9){_0x7a419b=_0x7a419b-0x0;var _0x305d25=_0x3d40[_0x7a419b];return _0x305d25;};'use strict';var client=require(_0x03d4('0x0'));exports[_0x03d4('0x1')]=function(){return function(){return client[_0x03d4('0x2')](_0x03d4('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x03d4('0x4'),'as':_0x03d4('0x5'),'attributes':['id','name',_0x03d4('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x05dd=['Request','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x05dd,0x180));var _0xd05d=function(_0x187454,_0x69cd05){_0x187454=_0x187454-0x0;var _0x4a203a=_0x05dd[_0x187454];return _0x4a203a;};'use strict';var client=require(_0xd05d('0x0'));exports['getIntervals']=function(){return function(){return client[_0xd05d('0x1')](_0xd05d('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd05d('0x3')],'include':[{'model':_0xd05d('0x4'),'as':_0xd05d('0x5'),'attributes':['id','name',_0xd05d('0x6')]}]},'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 2b2fc5e..2139637 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 _0xeb3b=['../client','update','Request','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x179a00,_0x30c575){var _0x1d1e4f=function(_0x5398d7){while(--_0x5398d7){_0x179a00['push'](_0x179a00['shift']());}};_0x1d1e4f(++_0x30c575);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x2df413,_0x5303ae){_0x2df413=_0x2df413-0x0;var _0x1f5133=_0xeb3b[_0x2df413];return _0x1f5133;};'use strict';var client=require(_0xbeb3('0x0'));exports[_0xbeb3('0x1')]=function(_0xc5aaa3,_0x33e049){return client[_0xbeb3('0x2')]('UpdateMailInteraction',{'body':_0x33e049,'options':{'where':{'id':_0xc5aaa3}},'log':'updateMailInteraction'});};exports[_0xbeb3('0x3')]=function(_0x5b0e3b,_0x2e8ce3){return client['Request'](_0xbeb3('0x4'),{'body':_0x2e8ce3,'options':{'where':{'id':_0x5b0e3b}},'log':_0xbeb3('0x5')});}; \ No newline at end of file +var _0x7096=['AddTagsToMailInteraction','addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x34ed99,_0x3e346d){var _0x35d584=function(_0x2dd906){while(--_0x2dd906){_0x34ed99['push'](_0x34ed99['shift']());}};_0x35d584(++_0x3e346d);}(_0x7096,0x10c));var _0x6709=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7096[_0x1035c1];return _0x308d67;};'use strict';var client=require('../client');exports[_0x6709('0x0')]=function(_0x5035b7,_0x253760){return client['Request'](_0x6709('0x1'),{'body':_0x253760,'options':{'where':{'id':_0x5035b7}},'log':_0x6709('0x2')});};exports[_0x6709('0x3')]=function(_0xccdcb5,_0x3cd087){return client[_0x6709('0x4')](_0x6709('0x5'),{'body':_0x3cd087,'options':{'where':{'id':_0xccdcb5}},'log':_0x6709('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 7f45a95..d531db3 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 _0x8bbc=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x5784db,_0x10b930){var _0x3a0276=function(_0x7452e1){while(--_0x7452e1){_0x5784db['push'](_0x5784db['shift']());}};_0x3a0276(++_0x10b930);}(_0x8bbc,0x154));var _0xc8bb=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x8bbc[_0x19a49f];return _0x5351ae;};'use strict';var client=require(_0xc8bb('0x0'));exports[_0xc8bb('0x1')]=function(_0xc4bf91){return client[_0xc8bb('0x2')](_0xc8bb('0x3'),{'body':_0xc4bf91,'log':_0xc8bb('0x4')});}; \ No newline at end of file +var _0xd831=['CreateMailMessage','createMailMessage','create','Request'];(function(_0x2253c9,_0x51ad2b){var _0x2850c8=function(_0x66868b){while(--_0x66868b){_0x2253c9['push'](_0x2253c9['shift']());}};_0x2850c8(++_0x51ad2b);}(_0xd831,0x14e));var _0x1d83=function(_0x16b2dd,_0x2ffb01){_0x16b2dd=_0x16b2dd-0x0;var _0x59585c=_0xd831[_0x16b2dd];return _0x59585c;};'use strict';var client=require('../client');exports[_0x1d83('0x0')]=function(_0x554d42){return client[_0x1d83('0x1')](_0x1d83('0x2'),{'body':_0x554d42,'log':_0x1d83('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e5d9f34..b553079 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 _0xa701=['online','mailPause','getMailQueues','Request','timeout','Agents','name'];(function(_0x3d4974,_0x3adb1e){var _0x4ec501=function(_0xe0fbce){while(--_0xe0fbce){_0x3d4974['push'](_0x3d4974['shift']());}};_0x4ec501(++_0x3adb1e);}(_0xa701,0xd4));var _0x1a70=function(_0x13162b,_0x1ff1a0){_0x13162b=_0x13162b-0x0;var _0x17b4d1=_0xa701[_0x13162b];return _0x17b4d1;};'use strict';var client=require('../client');exports[_0x1a70('0x0')]=function(){return function(){return client[_0x1a70('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x1a70('0x2'),'strategy'],'include':[{'model':'User','as':_0x1a70('0x3'),'attributes':['id',_0x1a70('0x4'),_0x1a70('0x5'),_0x1a70('0x6')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x3b56=['Agents','name','online','mailPause','../client','getMailQueues','GetMailQueue','timeout'];(function(_0x113c47,_0x565754){var _0x26c71a=function(_0x2c595d){while(--_0x2c595d){_0x113c47['push'](_0x113c47['shift']());}};_0x26c71a(++_0x565754);}(_0x3b56,0x194));var _0x63b5=function(_0x284bc0,_0x3fdcab){_0x284bc0=_0x284bc0-0x0;var _0x4e0ae7=_0x3b56[_0x284bc0];return _0x4e0ae7;};'use strict';var client=require(_0x63b5('0x0'));exports[_0x63b5('0x1')]=function(){return function(){return client['Request'](_0x63b5('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x63b5('0x3'),'strategy'],'include':[{'model':'User','as':_0x63b5('0x4'),'attributes':['id',_0x63b5('0x5'),_0x63b5('0x6'),_0x63b5('0x7')]}]},'log':_0x63b5('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4c1ce8c..736a9ac 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 _0x1094=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x332c3c,_0x1305c7){var _0x4b5f51=function(_0x493e8){while(--_0x493e8){_0x332c3c['push'](_0x332c3c['shift']());}};_0x4b5f51(++_0x1305c7);}(_0x1094,0xba));var _0x4109=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0x1094[_0x36436d];return _0x34615d;};'use strict';var client=require('../client');exports[_0x4109('0x0')]=function(_0x415af8){return client[_0x4109('0x1')](_0x4109('0x2'),{'body':_0x415af8,'log':_0x4109('0x2')});};exports[_0x4109('0x3')]=function(_0x3d9e4d,_0x15b597){return client[_0x4109('0x1')](_0x4109('0x4'),{'body':_0x15b597,'options':{'where':{'uniqueid':_0x3d9e4d},'order':[['id',_0x4109('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xb118=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','Request'];(function(_0x1be0e8,_0x1e0623){var _0x42cc32=function(_0x541aab){while(--_0x541aab){_0x1be0e8['push'](_0x1be0e8['shift']());}};_0x42cc32(++_0x1e0623);}(_0xb118,0x1b6));var _0x8b11=function(_0x3c7fbf,_0x57c5eb){_0x3c7fbf=_0x3c7fbf-0x0;var _0x2b0aa4=_0xb118[_0x3c7fbf];return _0x2b0aa4;};'use strict';var client=require(_0x8b11('0x0'));exports['create']=function(_0x1270e3){return client[_0x8b11('0x1')](_0x8b11('0x2'),{'body':_0x1270e3,'log':_0x8b11('0x2')});};exports[_0x8b11('0x3')]=function(_0x30ffe3,_0xa56e0b){return client[_0x8b11('0x1')](_0x8b11('0x4'),{'body':_0xa56e0b,'options':{'where':{'uniqueid':_0x30ffe3},'order':[['id','DESC']],'limit':0x1},'log':_0x8b11('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 8023edd..1f2070c 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 _0xdebe=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x5e848d,_0x1dbd20){var _0x3785e5=function(_0xc82b39){while(--_0xc82b39){_0x5e848d['push'](_0x5e848d['shift']());}};_0x3785e5(++_0x1dbd20);}(_0xdebe,0x1ec));var _0xedeb=function(_0x1561cb,_0x1ba25b){_0x1561cb=_0x1561cb-0x0;var _0x451208=_0xdebe[_0x1561cb];return _0x451208;};'use strict';var client=require(_0xedeb('0x0'));exports[_0xedeb('0x1')]=function(_0x20bc0f,_0x132d06){return client[_0xedeb('0x2')](_0xedeb('0x3'),{'body':_0x132d06,'options':{'where':{'id':_0x20bc0f}},'log':_0xedeb('0x4')});};exports[_0xedeb('0x5')]=function(_0x11e169,_0x1bbb9e){return client[_0xedeb('0x2')](_0xedeb('0x6'),{'body':_0x1bbb9e,'options':{'where':{'id':_0x11e169}},'log':_0xedeb('0x7')});}; \ No newline at end of file +var _0x271c=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x3ccfbf,_0x4814d0){var _0x1a67f8=function(_0x6c7667){while(--_0x6c7667){_0x3ccfbf['push'](_0x3ccfbf['shift']());}};_0x1a67f8(++_0x4814d0);}(_0x271c,0xfe));var _0xc271=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x271c[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0xc271('0x0'));exports[_0xc271('0x1')]=function(_0x5a1ccc,_0x866c7a){return client['Request'](_0xc271('0x2'),{'body':_0x866c7a,'options':{'where':{'id':_0x5a1ccc}},'log':_0xc271('0x3')});};exports[_0xc271('0x4')]=function(_0x320384,_0x3804ce){return client[_0xc271('0x5')](_0xc271('0x6'),{'body':_0x3804ce,'options':{'where':{'id':_0x320384}},'log':_0xc271('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7491c47..a1d2bc2 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 _0x43b5=['createOpenchannelMessage','Request'];(function(_0x418117,_0x5de9f2){var _0x2c4e0b=function(_0x941e07){while(--_0x941e07){_0x418117['push'](_0x418117['shift']());}};_0x2c4e0b(++_0x5de9f2);}(_0x43b5,0x1b7));var _0x543b=function(_0x32696d,_0x35f731){_0x32696d=_0x32696d-0x0;var _0x47d37c=_0x43b5[_0x32696d];return _0x47d37c;};'use strict';var client=require('../client');exports['create']=function(_0xbcbdce){return client[_0x543b('0x0')]('CreateOpenchannelMessage',{'body':_0xbcbdce,'log':_0x543b('0x1')});}; \ No newline at end of file +var _0xfe16=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5a4a2d,_0x2608a7){var _0xd8a723=function(_0x419e78){while(--_0x419e78){_0x5a4a2d['push'](_0x5a4a2d['shift']());}};_0xd8a723(++_0x2608a7);}(_0xfe16,0x126));var _0x6fe1=function(_0x583f77,_0x31198b){_0x583f77=_0x583f77-0x0;var _0x315aff=_0xfe16[_0x583f77];return _0x315aff;};'use strict';var client=require(_0x6fe1('0x0'));exports[_0x6fe1('0x1')]=function(_0x3a40e4){return client[_0x6fe1('0x2')](_0x6fe1('0x3'),{'body':_0x3a40e4,'log':_0x6fe1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 7fa5cbb..a44c5bc 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 _0x35ce=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','Agents','openchannelPause'];(function(_0x1e1f4a,_0x15d8c7){var _0x2221c8=function(_0xd9e618){while(--_0xd9e618){_0x1e1f4a['push'](_0x1e1f4a['shift']());}};_0x2221c8(++_0x15d8c7);}(_0x35ce,0x1a0));var _0xe35c=function(_0x574f08,_0x4f59e0){_0x574f08=_0x574f08-0x0;var _0x445f53=_0x35ce[_0x574f08];return _0x445f53;};'use strict';var client=require(_0xe35c('0x0'));exports[_0xe35c('0x1')]=function(){return function(){return client[_0xe35c('0x2')](_0xe35c('0x3'),{'options':{'raw':![],'attributes':['id',_0xe35c('0x4'),'timeout',_0xe35c('0x5')],'include':[{'model':'User','as':_0xe35c('0x6'),'attributes':['id',_0xe35c('0x4'),'online',_0xe35c('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xc30f=['GetOpenchannelQueue','timeout','strategy','User','Agents','name','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x2901a2,_0x2e7571){var _0x446f89=function(_0x49588a){while(--_0x49588a){_0x2901a2['push'](_0x2901a2['shift']());}};_0x446f89(++_0x2e7571);}(_0xc30f,0x97));var _0xfc30=function(_0x433423,_0x2328fa){_0x433423=_0x433423-0x0;var _0x86c141=_0xc30f[_0x433423];return _0x86c141;};'use strict';var client=require(_0xfc30('0x0'));exports[_0xfc30('0x1')]=function(){return function(){return client[_0xfc30('0x2')](_0xfc30('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xfc30('0x4'),_0xfc30('0x5')],'include':[{'model':_0xfc30('0x6'),'as':_0xfc30('0x7'),'attributes':['id',_0xfc30('0x8'),_0xfc30('0x9'),_0xfc30('0xa')]}]},'log':_0xfc30('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b6067a3..e5dd40d 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 _0x8ca2=['../client','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x166e2e,_0x32f4af){var _0x3486d1=function(_0x3272b5){while(--_0x3272b5){_0x166e2e['push'](_0x166e2e['shift']());}};_0x3486d1(++_0x32f4af);}(_0x8ca2,0x109));var _0x28ca=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8ca2[_0x29b609];return _0x54c952;};'use strict';var client=require(_0x28ca('0x0'));exports['create']=function(_0x4d3352){return client[_0x28ca('0x1')](_0x28ca('0x2'),{'body':_0x4d3352,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x23a2ed,_0xeaad23){return client[_0x28ca('0x1')](_0x28ca('0x3'),{'body':_0xeaad23,'options':{'where':{'uniqueid':_0x23a2ed},'order':[['id',_0x28ca('0x4')]],'limit':0x1},'log':_0x28ca('0x3')});}; \ No newline at end of file +var _0x62c0=['create','Request','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x3ed208,_0x364ad5){var _0x302fd0=function(_0x3fd406){while(--_0x3fd406){_0x3ed208['push'](_0x3ed208['shift']());}};_0x302fd0(++_0x364ad5);}(_0x62c0,0xdb));var _0x062c=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0x62c0[_0x1c06f4];return _0x1a727e;};'use strict';var client=require(_0x062c('0x0'));exports[_0x062c('0x1')]=function(_0x18830e){return client[_0x062c('0x2')]('CreateOpenchannelQueueReport',{'body':_0x18830e,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x305b12,_0x54281b){return client[_0x062c('0x2')](_0x062c('0x3'),{'body':_0x54281b,'options':{'where':{'uniqueid':_0x305b12},'order':[['id',_0x062c('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c972fff..7ace5d0 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 _0xba6c=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0xba6c,0x113));var _0xcba6=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0xba6c[_0x3ec333];return _0x15ccb8;};'use strict';var client=require(_0xcba6('0x0'));exports['update']=function(_0x253b30,_0x1f7f77){return client[_0xcba6('0x1')](_0xcba6('0x2'),{'body':_0x1f7f77,'options':{'where':{'id':_0x253b30}},'log':_0xcba6('0x3')});};exports[_0xcba6('0x4')]=function(_0x2b34a3,_0x5c911d){return client['Request'](_0xcba6('0x5'),{'body':_0x5c911d,'options':{'where':{'id':_0x2b34a3}},'log':_0xcba6('0x6')});}; \ No newline at end of file +var _0xb492=['addTags','update','Request'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb492,0x172));var _0x2b49=function(_0x26e9dc,_0x1f2ef5){_0x26e9dc=_0x26e9dc-0x0;var _0x50caf5=_0xb492[_0x26e9dc];return _0x50caf5;};'use strict';var client=require('../client');exports[_0x2b49('0x0')]=function(_0x32fdad,_0x1178e6){return client[_0x2b49('0x1')]('UpdateSmsInteraction',{'body':_0x1178e6,'options':{'where':{'id':_0x32fdad}},'log':'updateSmsInteraction'});};exports[_0x2b49('0x2')]=function(_0x340296,_0x317a1d){return client[_0x2b49('0x1')]('AddTagsToSmsInteraction',{'body':_0x317a1d,'options':{'where':{'id':_0x340296}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 8ba4f2a..9554e70 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 _0x8174=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8174,0x12b));var _0x4817=function(_0x3adafa,_0x1ff5ea){_0x3adafa=_0x3adafa-0x0;var _0x229947=_0x8174[_0x3adafa];return _0x229947;};'use strict';var client=require(_0x4817('0x0'));exports[_0x4817('0x1')]=function(_0x37cb6b){return client[_0x4817('0x2')](_0x4817('0x3'),{'body':_0x37cb6b,'log':_0x4817('0x4')});}; \ No newline at end of file +var _0x2003=['create','CreateSmsMessage','createSmsMessage','../client'];(function(_0x3c14dc,_0x42b02a){var _0x11e6af=function(_0x353b84){while(--_0x353b84){_0x3c14dc['push'](_0x3c14dc['shift']());}};_0x11e6af(++_0x42b02a);}(_0x2003,0x12b));var _0x3200=function(_0x38622b,_0x3cfdf7){_0x38622b=_0x38622b-0x0;var _0x2c1a7a=_0x2003[_0x38622b];return _0x2c1a7a;};'use strict';var client=require(_0x3200('0x0'));exports[_0x3200('0x1')]=function(_0x374565){return client['Request'](_0x3200('0x2'),{'body':_0x374565,'log':_0x3200('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 71efb2e..4f7a14f 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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x156b1f,_0x4f3c4a){var _0x88104a=function(_0x2b2115){while(--_0x2b2115){_0x156b1f['push'](_0x156b1f['shift']());}};_0x88104a(++_0x4f3c4a);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x133e8d,_0x4648f1){var _0x10ce55=function(_0x13e8bd){while(--_0x13e8bd){_0x133e8d['push'](_0x133e8d['shift']());}};_0x10ce55(++_0x4648f1);}(_0x70e0,0x17b));var _0x070e=function(_0x2459e4,_0x211d44){_0x2459e4=_0x2459e4-0x0;var _0x2336b9=_0x70e0[_0x2459e4];return _0x2336b9;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 0f91670..427763f 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4bfb8b,_0x10b39f){var _0x48f13c=function(_0x346d11){while(--_0x346d11){_0x4bfb8b['push'](_0x4bfb8b['shift']());}};_0x48f13c(++_0x10b39f);}(_0x008c,0x188));var _0xc008=function(_0x44d88c,_0x4e0cb4){_0x44d88c=_0x44d88c-0x0;var _0x508da7=_0x008c[_0x44d88c];return _0x508da7;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x227f99,_0x3c2b28){var _0x2642e0=function(_0x3e5905){while(--_0x3e5905){_0x227f99['push'](_0x227f99['shift']());}};_0x2642e0(++_0x3c2b28);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 62d149e..745ac16 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(_0x1e4ea0,_0x5e6119){var _0x2847f2=function(_0x30ba2a){while(--_0x30ba2a){_0x1e4ea0['push'](_0x1e4ea0['shift']());}};_0x2847f2(++_0x5e6119);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x767b3f,_0x39db10){var _0x417fcc=function(_0x334e46){while(--_0x334e46){_0x767b3f['push'](_0x767b3f['shift']());}};_0x417fcc(++_0x39db10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 9f1f15f..43c56f8 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 _0xeda8=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x3395b4,_0x211c0c){var _0x4f4c5b=function(_0x2c1f94){while(--_0x2c1f94){_0x3395b4['push'](_0x3395b4['shift']());}};_0x4f4c5b(++_0x211c0c);}(_0xeda8,0x104));var _0x8eda=function(_0x3f589f,_0x3146f8){_0x3f589f=_0x3f589f-0x0;var _0x5dbe7f=_0xeda8[_0x3f589f];return _0x5dbe7f;};'use strict';var client=require(_0x8eda('0x0'));exports[_0x8eda('0x1')]=function(_0x539019,_0x12899a){return client[_0x8eda('0x2')](_0x8eda('0x3'),{'body':_0x12899a,'options':{'where':{'id':_0x539019}},'log':_0x8eda('0x4')});};exports[_0x8eda('0x5')]=function(_0x94b83f,_0x25b19a){return client[_0x8eda('0x2')](_0x8eda('0x6'),{'body':_0x25b19a,'options':{'where':{'id':_0x94b83f}},'log':_0x8eda('0x7')});}; \ No newline at end of file +var _0x0ec6=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x16b186,_0x3fec23){var _0x33b499=function(_0x286437){while(--_0x286437){_0x16b186['push'](_0x16b186['shift']());}};_0x33b499(++_0x3fec23);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x54bab9,_0x2e2a5e){_0x54bab9=_0x54bab9-0x0;var _0x13dfbc=_0x0ec6[_0x54bab9];return _0x13dfbc;};'use strict';var client=require(_0x60ec('0x0'));exports['update']=function(_0x50217e,_0x1bf878){return client[_0x60ec('0x1')](_0x60ec('0x2'),{'body':_0x1bf878,'options':{'where':{'id':_0x50217e}},'log':_0x60ec('0x3')});};exports[_0x60ec('0x4')]=function(_0x262ed6,_0x392a91){return client['Request'](_0x60ec('0x5'),{'body':_0x392a91,'options':{'where':{'id':_0x262ed6}},'log':_0x60ec('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 13e44af..132a700 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 _0x24d2=['createWhatsappMessage','../client','create','CreateWhatsappMessage'];(function(_0x38a051,_0x468fd4){var _0xc72b1=function(_0xaebfc0){while(--_0xaebfc0){_0x38a051['push'](_0x38a051['shift']());}};_0xc72b1(++_0x468fd4);}(_0x24d2,0xe1));var _0x224d=function(_0x303f9e,_0x5c7830){_0x303f9e=_0x303f9e-0x0;var _0xaf40bf=_0x24d2[_0x303f9e];return _0xaf40bf;};'use strict';var client=require(_0x224d('0x0'));exports[_0x224d('0x1')]=function(_0x4f516b){return client['Request'](_0x224d('0x2'),{'body':_0x4f516b,'log':_0x224d('0x3')});}; \ No newline at end of file +var _0xa938=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x1c1ae5,_0x2eaccf){var _0x15bf42=function(_0x122796){while(--_0x122796){_0x1c1ae5['push'](_0x1c1ae5['shift']());}};_0x15bf42(++_0x2eaccf);}(_0xa938,0x6c));var _0x8a93=function(_0x24c095,_0x3a42e9){_0x24c095=_0x24c095-0x0;var _0x401074=_0xa938[_0x24c095];return _0x401074;};'use strict';var client=require(_0x8a93('0x0'));exports[_0x8a93('0x1')]=function(_0x189a40){return client[_0x8a93('0x2')](_0x8a93('0x3'),{'body':_0x189a40,'log':_0x8a93('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index d38766b..fb8056c 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 _0x31df=['GetWhatsappQueue','name','strategy','online','../client','getWhatsappQueues','Request'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x31df,0x177));var _0xf31d=function(_0x29c02f,_0x3cd77b){_0x29c02f=_0x29c02f-0x0;var _0x5b9557=_0x31df[_0x29c02f];return _0x5b9557;};'use strict';var client=require(_0xf31d('0x0'));exports[_0xf31d('0x1')]=function(){return function(){return client[_0xf31d('0x2')](_0xf31d('0x3'),{'options':{'raw':![],'attributes':['id',_0xf31d('0x4'),'timeout',_0xf31d('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xf31d('0x4'),_0xf31d('0x6'),'whatsappPause']}]},'log':_0xf31d('0x1')});};}; \ No newline at end of file +var _0x3b98=['name','timeout','User','Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x227896,_0x174925){var _0x442bff=function(_0x5b91be){while(--_0x5b91be){_0x227896['push'](_0x227896['shift']());}};_0x442bff(++_0x174925);}(_0x3b98,0x189));var _0x83b9=function(_0x5e3508,_0x12272c){_0x5e3508=_0x5e3508-0x0;var _0x391c0d=_0x3b98[_0x5e3508];return _0x391c0d;};'use strict';var client=require(_0x83b9('0x0'));exports[_0x83b9('0x1')]=function(){return function(){return client['Request'](_0x83b9('0x2'),{'options':{'raw':![],'attributes':['id',_0x83b9('0x3'),_0x83b9('0x4'),'strategy'],'include':[{'model':_0x83b9('0x5'),'as':_0x83b9('0x6'),'attributes':['id',_0x83b9('0x3'),_0x83b9('0x7'),_0x83b9('0x8')]}]},'log':_0x83b9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a87182c..546bc83 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 _0x57f4=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x48b6c6,_0xba4073){var _0x1bcc9a=function(_0x581c84){while(--_0x581c84){_0x48b6c6['push'](_0x48b6c6['shift']());}};_0x1bcc9a(++_0xba4073);}(_0x57f4,0x162));var _0x457f=function(_0x316a77,_0x2a040c){_0x316a77=_0x316a77-0x0;var _0x11f255=_0x57f4[_0x316a77];return _0x11f255;};'use strict';var client=require('../client');exports[_0x457f('0x0')]=function(_0x3ef7fc){return client[_0x457f('0x1')](_0x457f('0x2'),{'body':_0x3ef7fc,'log':_0x457f('0x2')});};exports[_0x457f('0x3')]=function(_0x152f12,_0x95ffc1){return client[_0x457f('0x1')](_0x457f('0x4'),{'body':_0x95ffc1,'options':{'where':{'uniqueid':_0x152f12},'order':[['id',_0x457f('0x5')]],'limit':0x1},'log':_0x457f('0x4')});}; \ No newline at end of file +var _0x07d2=['UpdateWhatsappQueueReport','create','Request','CreateWhatsappQueueReport','update'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0x07d2,0xa6));var _0x207d=function(_0x56b4f0,_0x1cf12e){_0x56b4f0=_0x56b4f0-0x0;var _0x24b716=_0x07d2[_0x56b4f0];return _0x24b716;};'use strict';var client=require('../client');exports[_0x207d('0x0')]=function(_0x3f66af){return client[_0x207d('0x1')](_0x207d('0x2'),{'body':_0x3f66af,'log':_0x207d('0x2')});};exports[_0x207d('0x3')]=function(_0x359cfd,_0x43e792){return client[_0x207d('0x1')](_0x207d('0x4'),{'body':_0x43e792,'options':{'where':{'uniqueid':_0x359cfd},'order':[['id','DESC']],'limit':0x1},'log':_0x207d('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 376b80b..9f4d31f 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 _0xe382=['error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x3df6df,_0x255556){var _0x566bd5=function(_0x160bdb){while(--_0x160bdb){_0x3df6df['push'](_0x3df6df['shift']());}};_0x566bd5(++_0x255556);}(_0xe382,0x9d));var _0x2e38=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xe382[_0x1a36a5];return _0x746243;};'use strict';var schema=require(_0x2e38('0x0'));var _=require(_0x2e38('0x1'));var util=require(_0x2e38('0x2'));var seqqueue=require(_0x2e38('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x2e38('0x4'));var queue=schema({'name':{'type':_0x2e38('0x5'),'required':!![],'message':_0x2e38('0x6')},'timeout':{'type':_0x2e38('0x7'),'message':_0x2e38('0x8')}});function writeLog(_0x4a05c7,_0x29ef2e,_0x1b66e0){return logger[_0x2e38('0x9')](util['format'](_0x2e38('0xa'),_0x4a05c7,_0x29ef2e[_0x2e38('0xb')],_0x1b66e0));}function handleFindAgent(_0x2e6bff){return function(_0x1cd8dc){return _0x1cd8dc[_0x2e38('0xb')]['toLowerCase']()===_0x2e6bff[_0x2e38('0xc')]();};}exports[_0x2e38('0xd')]=function(_0x5715ac,_0x31421f,_0x48eb2b,_0x8cdcc0){return function(_0x1b8106){try{var _0x54f8f1={'name':_0x31421f[0x0],'timeout':_0x31421f[0x1]};var _0xf0ca40=queue[_0x2e38('0x0')](_0x54f8f1,{'typecast':!![]});if(_0xf0ca40[_0x2e38('0xe')]){logger['error']('[%s][AGENT]\x20%s',_0x5715ac,_[_0x2e38('0xf')](_0xf0ca40,_0x2e38('0x10'))[_0x2e38('0x11')](',\x20'));_0x1b8106[_0x2e38('0x12')]();}else{var _0x50b743=_[_0x2e38('0x13')](_0x48eb2b[_0x2e38('0x14')],handleFindAgent(_0x54f8f1[_0x2e38('0xb')]));if(_0x50b743){var _0x199fca=(_0x54f8f1[_0x2e38('0x15')]||0xa)*0x3e8;var _0x2d4e80,_0x5dd986;var _0x3cdac3=seqqueue[_0x2e38('0x16')](_0x199fca);_0x3cdac3['id']=_0x5715ac;_0x3cdac3[_0x2e38('0x17')]=_0x199fca;_0x3cdac3[_0x2e38('0x18')]=_0x8cdcc0[_0x2e38('0x18')];writeLog(_0x5715ac,_0x50b743,util[_0x2e38('0x19')](_0x2e38('0x1a'),_0x199fca));_0x48eb2b['rules'][_0x5715ac]['on'](_0x2e38('0x1b'),function(){logger[_0x2e38('0x9')](_0x2e38('0x1c'),_0x5715ac);clearTimeout(_0x5dd986);_0x5dd986=undefined;_0x3cdac3[_0x2e38('0x1d')]();if(_0x48eb2b[_0x2e38('0x1e')][_0x5715ac]){delete _0x48eb2b[_0x2e38('0x1e')][_0x5715ac];}_0x1b8106[_0x2e38('0x12')]();});_0x48eb2b[_0x2e38('0x1e')][_0x5715ac]['on'](_0x2e38('0x1f'),function(){if(_0x48eb2b[_0x2e38('0x1e')][_0x5715ac]){delete _0x48eb2b[_0x2e38('0x1e')][_0x5715ac];}});_0x5dd986=setTimeout(function(){logger[_0x2e38('0x9')](_0x2e38('0x20'),_0x5715ac);clearTimeout(_0x5dd986);_0x3cdac3[_0x2e38('0x1d')]();_0x1b8106['next']();},_0x199fca);strategy['agent'](_0x3cdac3,_0x50b743,_0x48eb2b,_0x8cdcc0);}else{logger[_0x2e38('0x21')](_0x2e38('0x22'),_0x5715ac,_0x54f8f1['name']);_0x1b8106[_0x2e38('0x12')]();}}}catch(_0x4f074d){console[_0x2e38('0x23')](_0x4f074d);logger[_0x2e38('0x21')](_0x2e38('0x24'),_0x5715ac,_0x4f074d[_0x2e38('0x25')]);_0x1b8106[_0x2e38('0x12')]();}};}; \ No newline at end of file +var _0x8429=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','[%s][AGENT]\x20%s','map','message','join','find','agents','timeout','createQueue','atimeout','channel','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x8429,0x1a8));var _0x9842=function(_0x4fecf7,_0x4377c0){_0x4fecf7=_0x4fecf7-0x0;var _0x2d4790=_0x8429[_0x4fecf7];return _0x2d4790;};'use strict';var schema=require('validate');var _=require(_0x9842('0x0'));var util=require(_0x9842('0x1'));var seqqueue=require(_0x9842('0x2'));var logger=require(_0x9842('0x3'))(_0x9842('0x4'));var strategy=require(_0x9842('0x5'));var queue=schema({'name':{'type':_0x9842('0x6'),'required':!![],'message':_0x9842('0x7')},'timeout':{'type':'number','message':_0x9842('0x8')}});function writeLog(_0x58724d,_0x5047e0,_0x466726){return logger['info'](util[_0x9842('0x9')](_0x9842('0xa'),_0x58724d,_0x5047e0[_0x9842('0xb')],_0x466726));}function handleFindAgent(_0x4df9e8){return function(_0xf5f71a){return _0xf5f71a[_0x9842('0xb')][_0x9842('0xc')]()===_0x4df9e8['toLowerCase']();};}exports[_0x9842('0xd')]=function(_0x3d897c,_0xd084cb,_0x26f697,_0x237ee7){return function(_0x29ec15){try{var _0x1f06cd={'name':_0xd084cb[0x0],'timeout':_0xd084cb[0x1]};var _0x33be95=queue[_0x9842('0xe')](_0x1f06cd,{'typecast':!![]});if(_0x33be95[_0x9842('0xf')]){logger['error'](_0x9842('0x10'),_0x3d897c,_[_0x9842('0x11')](_0x33be95,_0x9842('0x12'))[_0x9842('0x13')](',\x20'));_0x29ec15['stop']();}else{var _0xb8bf05=_[_0x9842('0x14')](_0x26f697[_0x9842('0x15')],handleFindAgent(_0x1f06cd[_0x9842('0xb')]));if(_0xb8bf05){var _0x578473=(_0x1f06cd[_0x9842('0x16')]||0xa)*0x3e8;var _0xf312a1,_0x7783d9;var _0x26fe03=seqqueue[_0x9842('0x17')](_0x578473);_0x26fe03['id']=_0x3d897c;_0x26fe03[_0x9842('0x18')]=_0x578473;_0x26fe03['channel']=_0x237ee7[_0x9842('0x19')];writeLog(_0x3d897c,_0xb8bf05,util['format']('START:%s',_0x578473));_0x26f697['rules'][_0x3d897c]['on'](_0x9842('0x1a'),function(){logger[_0x9842('0x1b')](_0x9842('0x1c'),_0x3d897c);clearTimeout(_0x7783d9);_0x7783d9=undefined;_0x26fe03[_0x9842('0x1d')]();if(_0x26f697[_0x9842('0x1e')][_0x3d897c]){delete _0x26f697[_0x9842('0x1e')][_0x3d897c];}_0x29ec15[_0x9842('0x1f')]();});_0x26f697['rules'][_0x3d897c]['on'](_0x9842('0x20'),function(){if(_0x26f697[_0x9842('0x1e')][_0x3d897c]){delete _0x26f697['rules'][_0x3d897c];}});_0x7783d9=setTimeout(function(){logger[_0x9842('0x1b')](_0x9842('0x21'),_0x3d897c);clearTimeout(_0x7783d9);_0x26fe03[_0x9842('0x1d')]();_0x29ec15['next']();},_0x578473);strategy['agent'](_0x26fe03,_0xb8bf05,_0x26f697,_0x237ee7);}else{logger[_0x9842('0x22')](_0x9842('0x23'),_0x3d897c,_0x1f06cd[_0x9842('0xb')]);_0x29ec15[_0x9842('0x1f')]();}}}catch(_0x2d76d8){console[_0x9842('0x24')](_0x2d76d8);logger[_0x9842('0x22')](_0x9842('0x25'),_0x3d897c,_0x2d76d8[_0x9842('0x26')]);_0x29ec15[_0x9842('0x1f')]();}};}; \ 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 4a02a4f..4625ccf 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 _0xf10a=['postText','[%s][AMAZONLEX]\x20%s','amazonlex','dialogState','Failed','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','Message','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString'];(function(_0x5bee07,_0x5b9cd0){var _0x2b0dcf=function(_0x42e333){while(--_0x42e333){_0x5bee07['push'](_0x5bee07['shift']());}};_0x2b0dcf(++_0x5b9cd0);}(_0xf10a,0x14e));var _0xaf10=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf10a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xaf10('0x0'));var moment=require(_0xaf10('0x1'));var AWS=require('aws-sdk');var utils=require(_0xaf10('0x2'));var logger=require(_0xaf10('0x3'))(_0xaf10('0x4'));var rpc={'chatMessage':require(_0xaf10('0x5')),'openchannelMessage':require(_0xaf10('0x6')),'mailMessage':require(_0xaf10('0x7')),'smsMessage':require(_0xaf10('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xaf10('0x9'))};exports[_0xaf10('0xa')]=function(_0x3cfda6,_0x3563ec){return function(_0x250a9b){try{if(!_[_0xaf10('0xb')](this[_0xaf10('0xc')][_0xaf10('0xd')])){logger[_0xaf10('0xe')]('[%s][AMAZONLEX]\x20%s',_0x3cfda6,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x250a9b[_0xaf10('0xf')]();}var _0x16c028={'ContactId':this[_0xaf10('0x10')]['id'],'sentAt':moment()[_0xaf10('0x11')](_0xaf10('0x12')),'direction':_0xaf10('0x13')};if(this[_0xaf10('0x14')]===_0xaf10('0x15')||this[_0xaf10('0x14')]===_0xaf10('0x16')){_0x16c028[_0xaf10('0x17')]=this[_0xaf10('0xc')][_0xaf10('0x17')];}var _0x24baaf=this['channel'];if(_0x24baaf==='chat'){_0x16c028[_0xaf10('0x18')]=this[_0xaf10('0x19')]['id'];}else{_0x16c028[_[_0xaf10('0x1a')](_0x24baaf)+_0xaf10('0x1b')]=this[_0xaf10('0x19')]['id'];}_0x16c028[_[_0xaf10('0x1a')](_0x24baaf)+'InteractionId']=this[_0xaf10('0xc')]['id'];if(this[_0xaf10('0xc')][_0xaf10('0x1c')]){var _0x54362e=_0x3563ec[0x4];if(!_[_0xaf10('0x1d')](_0x54362e)){_0x16c028[_0xaf10('0x1e')]=utils['getMustacheRender'](_0x54362e,this);return rpc[_0x24baaf+_0xaf10('0x1f')]['create'](_0x16c028)['then'](function(_0x4e81fa){logger[_0xaf10('0xe')]('[%s][AMAZONLEX]\x20%s',_0x3cfda6,_0x16c028['body']);})[_0xaf10('0x20')](function(_0x1750e6){logger[_0xaf10('0x21')]('[%s][AMAZONLEX]\x20%s',_0x3cfda6,JSON[_0xaf10('0x22')](_0x1750e6));})[_0xaf10('0x23')](function(){logger['info'](_0xaf10('0x24'),_0x3cfda6);_0x250a9b[_0xaf10('0x25')]();});}else{logger[_0xaf10('0xe')](_0xaf10('0x26'),_0x3cfda6);_0x250a9b[_0xaf10('0x25')]();}}else{var _0xfceea0=this;var _0x131850=new AWS['LexRuntime']({'accessKeyId':_0x3563ec[0x0],'secretAccessKey':_0x3563ec[0x1],'region':_0x3563ec[0x2]});var _0x34c083={'botAlias':_0xaf10('0x27'),'botName':_0x3563ec[0x3],'inputText':this[_0xaf10('0x28')][_0xaf10('0x1e')],'userId':this[_0xaf10('0x14')]+':'+this[_0xaf10('0xc')]['id'][_0xaf10('0x29')]()};_0x131850[_0xaf10('0x2a')](_0x34c083,function(_0x35d108,_0x3d79fb){if(_0x35d108){logger[_0xaf10('0x21')](_0xaf10('0x2b'),_0x3cfda6,_0x35d108[_0xaf10('0x28')]);_0x250a9b[_0xaf10('0xf')]();}else if(_0x3d79fb&&_0x3d79fb[_0xaf10('0x28')]){_0xfceea0[_0xaf10('0x1e')][_0xaf10('0x2c')]=_0x3d79fb;_0x16c028[_0xaf10('0x1e')]=_0x3d79fb[_0xaf10('0x28')];_0x16c028['providerName']=_0xaf10('0x2c');_0x16c028['providerResponse']=JSON[_0xaf10('0x22')](_0x3d79fb);return rpc[_0x24baaf+_0xaf10('0x1f')]['create'](_0x16c028)['then'](function(_0x9a0226){logger['info'](_0xaf10('0x2b'),_0x3cfda6,_0x16c028[_0xaf10('0x1e')]);if(_0x3d79fb[_0xaf10('0x2d')]==_0xaf10('0x2e')){_0x250a9b['next']();}else{_0x250a9b['stop']();}})[_0xaf10('0x20')](function(_0x33b2d0){logger[_0xaf10('0x21')](_0xaf10('0x2b'),_0x3cfda6,JSON['stringify'](_0x33b2d0));_0x250a9b[_0xaf10('0xf')]();});}else{_0x250a9b['next']();}});}}catch(_0x2d2151){logger[_0xaf10('0x21')](_0xaf10('0x2b'),_0x3cfda6,JSON[_0xaf10('0x22')](_0x2d2151));_0x250a9b['stop']();}};}; \ No newline at end of file +var _0x4bde=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','create','then','catch','error','stringify','stop','LexRuntime','$LATEST','message','postText','providerName','amazonlex','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4bde,0xfb));var _0xe4bd=function(_0x45e520,_0x2d11df){_0x45e520=_0x45e520-0x0;var _0x209a05=_0x4bde[_0x45e520];return _0x209a05;};'use strict';var _=require(_0xe4bd('0x0'));var moment=require(_0xe4bd('0x1'));var AWS=require(_0xe4bd('0x2'));var utils=require(_0xe4bd('0x3'));var logger=require(_0xe4bd('0x4'))(_0xe4bd('0x5'));var rpc={'chatMessage':require(_0xe4bd('0x6')),'openchannelMessage':require(_0xe4bd('0x7')),'mailMessage':require(_0xe4bd('0x8')),'smsMessage':require(_0xe4bd('0x9')),'faxMessage':require(_0xe4bd('0xa')),'whatsappMessage':require(_0xe4bd('0xb'))};exports[_0xe4bd('0xc')]=function(_0x4353b2,_0x5190f0){return function(_0x4b5779){try{if(!_['isNil'](this['interaction'][_0xe4bd('0xd')])){logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4353b2,_0xe4bd('0x10'));return _0x4b5779[_0xe4bd('0x11')]();}var _0x4c7789={'ContactId':this[_0xe4bd('0x12')]['id'],'sentAt':moment()[_0xe4bd('0x13')](_0xe4bd('0x14')),'direction':_0xe4bd('0x15')};if(this[_0xe4bd('0x16')]===_0xe4bd('0x17')||this[_0xe4bd('0x16')]===_0xe4bd('0x18')){_0x4c7789[_0xe4bd('0x19')]=this[_0xe4bd('0x1a')]['phone'];}var _0x122fd3=this[_0xe4bd('0x16')];if(_0x122fd3==='chat'){_0x4c7789[_0xe4bd('0x1b')]=this[_0xe4bd('0x1c')]['id'];}else{_0x4c7789[_[_0xe4bd('0x1d')](_0x122fd3)+_0xe4bd('0x1e')]=this[_0xe4bd('0x1c')]['id'];}_0x4c7789[_['upperFirst'](_0x122fd3)+_0xe4bd('0x1f')]=this[_0xe4bd('0x1a')]['id'];if(this['interaction'][_0xe4bd('0x20')]){var _0x580d87=_0x5190f0[0x4];if(!_[_0xe4bd('0x21')](_0x580d87)){_0x4c7789[_0xe4bd('0x22')]=utils['getMustacheRender'](_0x580d87,this);return rpc[_0x122fd3+_0xe4bd('0x23')][_0xe4bd('0x24')](_0x4c7789)[_0xe4bd('0x25')](function(_0x58fd27){logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4353b2,_0x4c7789[_0xe4bd('0x22')]);})[_0xe4bd('0x26')](function(_0x268957){logger[_0xe4bd('0x27')](_0xe4bd('0xf'),_0x4353b2,JSON[_0xe4bd('0x28')](_0x268957));})['finally'](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4353b2);_0x4b5779['stop']();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4353b2);_0x4b5779[_0xe4bd('0x29')]();}}else{var _0x4a16bf=this;var _0x301291=new AWS[(_0xe4bd('0x2a'))]({'accessKeyId':_0x5190f0[0x0],'secretAccessKey':_0x5190f0[0x1],'region':_0x5190f0[0x2]});var _0x4006b3={'botAlias':_0xe4bd('0x2b'),'botName':_0x5190f0[0x3],'inputText':this[_0xe4bd('0x2c')][_0xe4bd('0x22')],'userId':this[_0xe4bd('0x16')]+':'+this[_0xe4bd('0x1a')]['id']['toString']()};_0x301291[_0xe4bd('0x2d')](_0x4006b3,function(_0x1ec716,_0x25df6f){if(_0x1ec716){logger['error'](_0xe4bd('0xf'),_0x4353b2,_0x1ec716[_0xe4bd('0x2c')]);_0x4b5779[_0xe4bd('0x11')]();}else if(_0x25df6f&&_0x25df6f[_0xe4bd('0x2c')]){_0x4a16bf[_0xe4bd('0x22')]['amazonlex']=_0x25df6f;_0x4c7789[_0xe4bd('0x22')]=_0x25df6f[_0xe4bd('0x2c')];_0x4c7789[_0xe4bd('0x2e')]=_0xe4bd('0x2f');_0x4c7789[_0xe4bd('0x30')]=JSON['stringify'](_0x25df6f);return rpc[_0x122fd3+_0xe4bd('0x23')][_0xe4bd('0x24')](_0x4c7789)[_0xe4bd('0x25')](function(_0x4dbf3f){logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4353b2,_0x4c7789[_0xe4bd('0x22')]);if(_0x25df6f[_0xe4bd('0x31')]==_0xe4bd('0x32')){_0x4b5779[_0xe4bd('0x11')]();}else{_0x4b5779[_0xe4bd('0x29')]();}})['catch'](function(_0x2c56a3){logger[_0xe4bd('0x27')](_0xe4bd('0xf'),_0x4353b2,JSON[_0xe4bd('0x28')](_0x2c56a3));_0x4b5779[_0xe4bd('0x11')]();});}else{_0x4b5779[_0xe4bd('0x11')]();}});}}catch(_0x5adffc){logger[_0xe4bd('0x27')](_0xe4bd('0xf'),_0x4353b2,JSON[_0xe4bd('0x28')](_0x5adffc));_0x4b5779['stop']();}};}; \ 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 084a88b..cd9bb78 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 _0xf14d=['isNil','created','interaction','Autoreply\x20already\x20sent','next','autoreplyExecuted','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','getMustacheRender','body','message','from','phone','read','subject','startsWith','Re:','chat','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','Interaction','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)'];(function(_0x473bd8,_0x516b1c){var _0x5c517f=function(_0x2f5fa3){while(--_0x2f5fa3){_0x473bd8['push'](_0x473bd8['shift']());}};_0x5c517f(++_0x516b1c);}(_0xf14d,0x179));var _0xdf14=function(_0x3eff85,_0x2f06e7){_0x3eff85=_0x3eff85-0x0;var _0x131ee5=_0xf14d[_0x3eff85];return _0x131ee5;};'use strict';var _=require('lodash');var moment=require(_0xdf14('0x0'));var utils=require(_0xdf14('0x1'));var logger=require(_0xdf14('0x2'))(_0xdf14('0x3'));var rpc={'chatMessage':require(_0xdf14('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xdf14('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdf14('0x6')),'whatsappMessage':require(_0xdf14('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xdf14('0x8')),'mailInteraction':require(_0xdf14('0x9')),'smsInteraction':require(_0xdf14('0xa')),'faxInteraction':require(_0xdf14('0xb')),'whatsappInteraction':require(_0xdf14('0xc'))};var mailRpc=require(_0xdf14('0xd'));exports[_0xdf14('0xe')]=function(_0x452083,_0x2ad0a0,_0x395be4,_0x25f79d){return function(_0x4871f8){try{var _0x35c5ad=this['channel'];if(_0x35c5ad==='mail'&&_0x25f79d['body'][_0xdf14('0xf')]){logger[_0xdf14('0x10')](_0xdf14('0x11'),_0x452083,_0xdf14('0x12'));return _0x4871f8['next']();}if(_0x2ad0a0[0x0]==='1'&&(_[_0xdf14('0x13')](this['interaction'][_0xdf14('0x14')])||!this[_0xdf14('0x15')]['created'])){logger[_0xdf14('0x10')](_0xdf14('0x11'),_0x452083,_0xdf14('0x16'));return _0x4871f8[_0xdf14('0x17')]();}if(_0x2ad0a0[0x0]==='2'&&this[_0xdf14('0x15')][_0xdf14('0x18')]){logger[_0xdf14('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x452083,'One\x20Time\x20already\x20sent');return _0x4871f8[_0xdf14('0x17')]();}var _0x537910={'ContactId':this[_0xdf14('0x19')]['id'],'sentAt':moment()['format'](_0xdf14('0x1a')),'direction':_0xdf14('0x1b')};if(this[_0xdf14('0x1c')]===_0xdf14('0x1d')){_0x537910['body']=utils[_0xdf14('0x1e')](_0x2ad0a0[0x2],this);}else{_0x537910[_0xdf14('0x1f')]=utils[_0xdf14('0x1e')](_0x2ad0a0[0x1],this);}if(this[_0xdf14('0x20')]){_0x537910['to']=this[_0xdf14('0x20')][_0xdf14('0x21')]||'';if(this[_0xdf14('0x1c')]===_0xdf14('0x1d')&&_0x2ad0a0[0x1]==='1'){_0x537910['cc']=this[_0xdf14('0x20')]['cc']||'';}_0x537910['from']=this[_0xdf14('0x20')]['to']||'';_0x537910[_0xdf14('0x22')]=this[_0xdf14('0x20')]['phone']||'';_0x537910[_0xdf14('0x23')]=!![];if(this[_0xdf14('0x20')][_0xdf14('0x24')]){_0x537910[_0xdf14('0x24')]='';_0x537910['subject']+=_[_0xdf14('0x25')](this['message'][_0xdf14('0x24')],_0xdf14('0x26'))?'':'Re:\x20';_0x537910[_0xdf14('0x24')]+=this['message']['subject'];}}if(this[_0xdf14('0x1c')]===_0xdf14('0x27')){_0x537910['ChatWebsiteId']=this[_0xdf14('0x28')]['id'];}else{_0x537910[_[_0xdf14('0x29')](this[_0xdf14('0x1c')])+_0xdf14('0x2a')]=this[_0xdf14('0x28')]['id'];}_0x537910[_['upperFirst'](this['channel'])+_0xdf14('0x2b')]=this[_0xdf14('0x15')]['id'];var _0xfc679d=this['interaction'];if(rpc[this['channel']+_0xdf14('0x2c')]){if(this[_0xdf14('0x1c')]===_0xdf14('0x1d')){_0x537910[_0xdf14('0x2d')]=this['message']['messageId'];_0x537910['html']=''+_['replace'](_0x537910[_0xdf14('0x1f')],_0xdf14('0x2e'),_0xdf14('0x2f'))+_0xdf14('0x30');_0x537910['headers']={'Auto-Submitted':_0xdf14('0x31'),'X-Auto-Response-Suppress':_0xdf14('0x32'),'Precedence':_0xdf14('0x33')};return mailRpc[_0xdf14('0x34')](this['account']['smtpOptions'],_0x537910)[_0xdf14('0x35')](function(_0x3b0906){logger[_0xdf14('0x10')](_0xdf14('0x36'),_0x452083);_0x537910[_0xdf14('0x37')]=_0x3b0906[_0xdf14('0x20')]['messageId'];return rpc[_0x35c5ad+_0xdf14('0x2c')]['create'](_0x537910);})[_0xdf14('0x35')](function(_0x33014e){logger[_0xdf14('0x10')]('[%s][AUTOREPLY]\x20%s',_0x452083,JSON[_0xdf14('0x38')](_0x33014e));})[_0xdf14('0x39')](function(_0x144c88){logger[_0xdf14('0x3a')](_0xdf14('0x3b'),_0x452083,JSON[_0xdf14('0x38')](_0x144c88));})[_0xdf14('0x3c')](function(){Promise[_0xdf14('0x3d')]()[_0xdf14('0x35')](function(){if(_0x2ad0a0[0x0]!=='2'||_0xfc679d[_0xdf14('0x18')])return;return rpc[_0x35c5ad+'Interaction'][_0xdf14('0x3e')](_0xfc679d['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3ab790){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x452083,JSON[_0xdf14('0x38')](_0x3ab790));})['catch'](function(_0x128727){logger['error'](_0xdf14('0x3f'),_0x452083,JSON[_0xdf14('0x38')](_0x128727));});})[_0xdf14('0x35')](function(){_0x4871f8['next']();});});}else{return rpc[this[_0xdf14('0x1c')]+_0xdf14('0x2c')][_0xdf14('0x40')](_0x537910)[_0xdf14('0x35')](function(){logger[_0xdf14('0x10')](_0xdf14('0x11'),_0x452083,_0x537910[_0xdf14('0x1f')]);})[_0xdf14('0x39')](function(_0x192ccb){logger['error'](_0xdf14('0x11'),_0x452083,JSON[_0xdf14('0x38')](_0x192ccb));})[_0xdf14('0x3c')](function(){Promise[_0xdf14('0x3d')]()[_0xdf14('0x35')](function(){if(_0x2ad0a0[0x0]!=='2'||_0xfc679d[_0xdf14('0x18')])return;return rpc[_0x35c5ad+_0xdf14('0x41')][_0xdf14('0x3e')](_0xfc679d['id'],{'autoreplyExecuted':!![]})['then'](function(_0xf9a9fa){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x452083,JSON[_0xdf14('0x38')](_0xf9a9fa));})['catch'](function(_0x2ebb15){logger[_0xdf14('0x3a')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x452083,JSON[_0xdf14('0x38')](_0x2ebb15));});})['then'](function(){_0x4871f8['next']();});});}}}catch(_0x50f556){logger[_0xdf14('0x3a')]('[%s][AUTOREPLY]\x20%s',_0x452083,JSON[_0xdf14('0x38')](_0x50f556));_0x4871f8['stop']();}};}; \ No newline at end of file +var _0x4ad8=['consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','subject','Re:','Re:\x20','account','upperFirst','InteractionId','Message','inReplyTo','messageId','','replace','','headers','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc'];(function(_0x5a6532,_0x47c958){var _0x1bbc3a=function(_0x95fa91){while(--_0x95fa91){_0x5a6532['push'](_0x5a6532['shift']());}};_0x1bbc3a(++_0x47c958);}(_0x4ad8,0x7b));var _0x84ad=function(_0x4031b4,_0x198544){_0x4031b4=_0x4031b4-0x0;var _0x2d4eb9=_0x4ad8[_0x4031b4];return _0x2d4eb9;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require('./utils');var logger=require(_0x84ad('0x0'))(_0x84ad('0x1'));var rpc={'chatMessage':require(_0x84ad('0x2')),'openchannelMessage':require(_0x84ad('0x3')),'mailMessage':require(_0x84ad('0x4')),'smsMessage':require(_0x84ad('0x5')),'faxMessage':require(_0x84ad('0x6')),'whatsappMessage':require(_0x84ad('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x84ad('0x8')),'smsInteraction':require(_0x84ad('0x9')),'faxInteraction':require(_0x84ad('0xa')),'whatsappInteraction':require(_0x84ad('0xb'))};var mailRpc=require(_0x84ad('0xc'));exports[_0x84ad('0xd')]=function(_0x270c7e,_0x28f6f0,_0x37137e,_0x33dbee){return function(_0x3fde84){try{var _0x4f27be=this['channel'];if(_0x4f27be===_0x84ad('0xe')&&_0x33dbee[_0x84ad('0xf')][_0x84ad('0x10')]){logger[_0x84ad('0x11')](_0x84ad('0x12'),_0x270c7e,_0x84ad('0x13'));return _0x3fde84['next']();}if(_0x28f6f0[0x0]==='1'&&(_[_0x84ad('0x14')](this[_0x84ad('0x15')][_0x84ad('0x16')])||!this['interaction'][_0x84ad('0x16')])){logger[_0x84ad('0x11')](_0x84ad('0x12'),_0x270c7e,_0x84ad('0x17'));return _0x3fde84[_0x84ad('0x18')]();}if(_0x28f6f0[0x0]==='2'&&this[_0x84ad('0x15')][_0x84ad('0x19')]){logger[_0x84ad('0x11')](_0x84ad('0x1a'),_0x270c7e,'One\x20Time\x20already\x20sent');return _0x3fde84[_0x84ad('0x18')]();}var _0x55467e={'ContactId':this[_0x84ad('0x1b')]['id'],'sentAt':moment()[_0x84ad('0x1c')](_0x84ad('0x1d')),'direction':_0x84ad('0x1e')};if(this[_0x84ad('0x1f')]===_0x84ad('0xe')){_0x55467e['body']=utils[_0x84ad('0x20')](_0x28f6f0[0x2],this);}else{_0x55467e[_0x84ad('0xf')]=utils[_0x84ad('0x20')](_0x28f6f0[0x1],this);}if(this[_0x84ad('0x21')]){_0x55467e['to']=this[_0x84ad('0x21')][_0x84ad('0x22')]||'';if(this[_0x84ad('0x1f')]===_0x84ad('0xe')&&_0x28f6f0[0x1]==='1'){_0x55467e['cc']=this[_0x84ad('0x21')]['cc']||'';}_0x55467e['from']=this[_0x84ad('0x21')]['to']||'';_0x55467e[_0x84ad('0x23')]=this[_0x84ad('0x21')][_0x84ad('0x23')]||'';_0x55467e['read']=!![];if(this['message']['subject']){_0x55467e[_0x84ad('0x24')]='';_0x55467e[_0x84ad('0x24')]+=_['startsWith'](this[_0x84ad('0x21')][_0x84ad('0x24')],_0x84ad('0x25'))?'':_0x84ad('0x26');_0x55467e[_0x84ad('0x24')]+=this[_0x84ad('0x21')][_0x84ad('0x24')];}}if(this[_0x84ad('0x1f')]==='chat'){_0x55467e['ChatWebsiteId']=this['account']['id'];}else{_0x55467e[_['upperFirst'](this['channel'])+'AccountId']=this[_0x84ad('0x27')]['id'];}_0x55467e[_[_0x84ad('0x28')](this[_0x84ad('0x1f')])+_0x84ad('0x29')]=this[_0x84ad('0x15')]['id'];var _0x2900d7=this[_0x84ad('0x15')];if(rpc[this[_0x84ad('0x1f')]+_0x84ad('0x2a')]){if(this[_0x84ad('0x1f')]===_0x84ad('0xe')){_0x55467e[_0x84ad('0x2b')]=this[_0x84ad('0x21')][_0x84ad('0x2c')];_0x55467e['html']=_0x84ad('0x2d')+_[_0x84ad('0x2e')](_0x55467e['body'],_0x84ad('0x2f'),_0x84ad('0x30'))+_0x84ad('0x31');_0x55467e[_0x84ad('0x32')]={'Auto-Submitted':_0x84ad('0x33'),'X-Auto-Response-Suppress':_0x84ad('0x34'),'Precedence':_0x84ad('0x35')};return mailRpc['sendMailMessage'](this['account'][_0x84ad('0x36')],_0x55467e)[_0x84ad('0x37')](function(_0x230928){logger[_0x84ad('0x11')](_0x84ad('0x38'),_0x270c7e);_0x55467e[_0x84ad('0x2c')]=_0x230928[_0x84ad('0x21')][_0x84ad('0x2c')];return rpc[_0x4f27be+_0x84ad('0x2a')][_0x84ad('0x39')](_0x55467e);})[_0x84ad('0x37')](function(_0x5dba7f){logger[_0x84ad('0x11')](_0x84ad('0x12'),_0x270c7e,JSON[_0x84ad('0x3a')](_0x5dba7f));})[_0x84ad('0x3b')](function(_0x2eebb3){logger[_0x84ad('0x3c')](_0x84ad('0x3d'),_0x270c7e,JSON[_0x84ad('0x3a')](_0x2eebb3));})[_0x84ad('0x3e')](function(){Promise[_0x84ad('0x3f')]()[_0x84ad('0x37')](function(){if(_0x28f6f0[0x0]!=='2'||_0x2900d7[_0x84ad('0x19')])return;return rpc[_0x4f27be+_0x84ad('0x40')][_0x84ad('0x41')](_0x2900d7['id'],{'autoreplyExecuted':!![]})['then'](function(_0x321768){logger[_0x84ad('0x11')](_0x84ad('0x1a'),_0x270c7e,JSON[_0x84ad('0x3a')](_0x321768));})[_0x84ad('0x3b')](function(_0x16fc78){logger[_0x84ad('0x3c')](_0x84ad('0x42'),_0x270c7e,JSON['stringify'](_0x16fc78));});})[_0x84ad('0x37')](function(){_0x3fde84[_0x84ad('0x18')]();});});}else{return rpc[this[_0x84ad('0x1f')]+'Message']['create'](_0x55467e)[_0x84ad('0x37')](function(){logger[_0x84ad('0x11')]('[%s][AUTOREPLY]\x20%s',_0x270c7e,_0x55467e['body']);})[_0x84ad('0x3b')](function(_0x130703){logger['error'](_0x84ad('0x12'),_0x270c7e,JSON[_0x84ad('0x3a')](_0x130703));})[_0x84ad('0x3e')](function(){Promise[_0x84ad('0x3f')]()[_0x84ad('0x37')](function(){if(_0x28f6f0[0x0]!=='2'||_0x2900d7['autoreplyExecuted'])return;return rpc[_0x4f27be+_0x84ad('0x40')][_0x84ad('0x41')](_0x2900d7['id'],{'autoreplyExecuted':!![]})[_0x84ad('0x37')](function(_0x11e91f){logger[_0x84ad('0x11')](_0x84ad('0x1a'),_0x270c7e,JSON[_0x84ad('0x3a')](_0x11e91f));})[_0x84ad('0x3b')](function(_0x3cf161){logger[_0x84ad('0x3c')](_0x84ad('0x42'),_0x270c7e,JSON[_0x84ad('0x3a')](_0x3cf161));});})[_0x84ad('0x37')](function(){_0x3fde84[_0x84ad('0x18')]();});});}}}catch(_0x1f8999){logger[_0x84ad('0x3c')](_0x84ad('0x12'),_0x270c7e,JSON[_0x84ad('0x3a')](_0x1f8999));_0x3fde84[_0x84ad('0x43')]();}};}; \ 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 4ca6560..4739587 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 _0x5a62=['channel','Interaction','update','then','interaction','error','stringify','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x3bc8c0,_0x2b7d68){var _0x25da14=function(_0x2de43c){while(--_0x2de43c){_0x3bc8c0['push'](_0x3bc8c0['shift']());}};_0x25da14(++_0x2b7d68);}(_0x5a62,0x1c2));var _0x25a6=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x5a62[_0x101e7b];return _0x4995c0;};'use strict';var moment=require(_0x25a6('0x0'));var logger=require(_0x25a6('0x1'))(_0x25a6('0x2'));var rpc={'chatInteraction':require(_0x25a6('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x25a6('0x4')),'faxInteraction':require(_0x25a6('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x25a6('0x6')]=function(_0x231deb,_0x54e91e,_0x430560,_0xd6ffca){return function(_0x370a39){try{logger[_0x25a6('0x7')](_0x25a6('0x8'),_0x231deb,_0x54e91e[0x0]);var _0x155052={'closed':0x1,'closedAt':moment()[_0x25a6('0x9')](_0x25a6('0xa')),'closeReason':_0x25a6('0xb'),'disposition':_0x54e91e[0x0]};if(rpc[_0xd6ffca[_0x25a6('0xc')]+_0x25a6('0xd')]){rpc[_0xd6ffca[_0x25a6('0xc')]+'Interaction'][_0x25a6('0xe')](_0xd6ffca['interaction']['id'],_0x155052)[_0x25a6('0xf')](function(_0x180bc3){logger[_0x25a6('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x231deb,_0xd6ffca[_0x25a6('0x10')]['id']);})['catch'](function(_0x3283e7){logger[_0x25a6('0x11')]('[%s][CLOSE]\x20%s',_0x231deb,JSON[_0x25a6('0x12')](_0x3283e7));})['finally'](function(){_0x370a39[_0x25a6('0x13')]();});}}catch(_0x254c82){logger[_0x25a6('0x11')](_0x25a6('0x14'),_0x231deb,JSON[_0x25a6('0x12')](_0x254c82));_0x370a39[_0x25a6('0x13')]();}};}; \ No newline at end of file +var _0x9991=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','then','info','interaction','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction'];(function(_0x54c778,_0x4a859f){var _0x2c4be9=function(_0x569f46){while(--_0x569f46){_0x54c778['push'](_0x54c778['shift']());}};_0x2c4be9(++_0x4a859f);}(_0x9991,0x75));var _0x1999=function(_0x58ebbd,_0x46caa7){_0x58ebbd=_0x58ebbd-0x0;var _0xca9628=_0x9991[_0x58ebbd];return _0xca9628;};'use strict';var moment=require('moment');var logger=require(_0x1999('0x0'))(_0x1999('0x1'));var rpc={'chatInteraction':require(_0x1999('0x2')),'openchannelInteraction':require(_0x1999('0x3')),'smsInteraction':require(_0x1999('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1999('0x5'))};exports[_0x1999('0x6')]=function(_0x7e02dc,_0x2574e1,_0x618287,_0x56c621){return function(_0x1177fb){try{logger['info'](_0x1999('0x7'),_0x7e02dc,_0x2574e1[0x0]);var _0x495c42={'closed':0x1,'closedAt':moment()['format'](_0x1999('0x8')),'closeReason':_0x1999('0x9'),'disposition':_0x2574e1[0x0]};if(rpc[_0x56c621['channel']+_0x1999('0xa')]){rpc[_0x56c621['channel']+_0x1999('0xa')][_0x1999('0xb')](_0x56c621['interaction']['id'],_0x495c42)[_0x1999('0xc')](function(_0x17ed62){logger[_0x1999('0xd')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x7e02dc,_0x56c621[_0x1999('0xe')]['id']);})['catch'](function(_0x10bf6b){logger[_0x1999('0xf')](_0x1999('0x10'),_0x7e02dc,JSON[_0x1999('0x11')](_0x10bf6b));})[_0x1999('0x12')](function(){_0x1177fb[_0x1999('0x13')]();});}}catch(_0x4cdccf){logger[_0x1999('0xf')](_0x1999('0x10'),_0x7e02dc,JSON[_0x1999('0x11')](_0x4cdccf));_0x1177fb['stop']();}};}; \ 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 4b274f4..6ae4357 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 _0xe767=['error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','result','fulfillment','speech','providerName','providerResponse','create','metadata','next','[%s][DIALOGFLOW]\x20%s','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','contact','format','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','body','getMustacheRender','Message','then','info','catch'];(function(_0x2dbeb4,_0x499544){var _0x18a513=function(_0x2fe229){while(--_0x2fe229){_0x2dbeb4['push'](_0x2dbeb4['shift']());}};_0x18a513(++_0x499544);}(_0xe767,0x11e));var _0x7e76=function(_0x1b931c,_0x1aad55){_0x1b931c=_0x1b931c-0x0;var _0x2636f6=_0xe767[_0x1b931c];return _0x2636f6;};'use strict';var _=require('lodash');var moment=require(_0x7e76('0x0'));var apiai=require(_0x7e76('0x1'));var md5=require(_0x7e76('0x2'));var utils=require(_0x7e76('0x3'));var logger=require(_0x7e76('0x4'))(_0x7e76('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7e76('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7e76('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7e76('0x8')]=function(_0x2a703b,_0xd52307){return function(_0x3aaa07){try{if(!_[_0x7e76('0x9')](this[_0x7e76('0xa')][_0x7e76('0xb')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2a703b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3aaa07['next']();}var _0x41e9b8={'ContactId':this[_0x7e76('0xc')]['id'],'sentAt':moment()[_0x7e76('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x7e76('0xe')]==='sms'||this[_0x7e76('0xe')]===_0x7e76('0xf')){_0x41e9b8[_0x7e76('0x10')]=this['interaction'][_0x7e76('0x10')];}var _0x1c491d=this[_0x7e76('0xe')];if(_0x1c491d===_0x7e76('0x11')){_0x41e9b8[_0x7e76('0x12')]=this[_0x7e76('0x13')]['id'];}else{_0x41e9b8[_[_0x7e76('0x14')](_0x1c491d)+_0x7e76('0x15')]=this[_0x7e76('0x13')]['id'];}_0x41e9b8[_[_0x7e76('0x14')](_0x1c491d)+'InteractionId']=this[_0x7e76('0xa')]['id'];if(this[_0x7e76('0xa')][_0x7e76('0x16')]){var _0xdd6c33=_0xd52307[0x2];if(!_['isEmpty'](_0xdd6c33)){_0x41e9b8[_0x7e76('0x17')]=utils[_0x7e76('0x18')](_0xdd6c33,this);return rpc[_0x1c491d+_0x7e76('0x19')]['create'](_0x41e9b8)[_0x7e76('0x1a')](function(_0x329a4d){logger[_0x7e76('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0x2a703b,_0x41e9b8[_0x7e76('0x17')]);})[_0x7e76('0x1c')](function(_0x562179){logger[_0x7e76('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x2a703b,JSON[_0x7e76('0x1e')](_0x562179));})[_0x7e76('0x1f')](function(){logger[_0x7e76('0x1b')](_0x7e76('0x20'),_0x2a703b);_0x3aaa07[_0x7e76('0x21')]();});}else{logger[_0x7e76('0x1b')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2a703b);_0x3aaa07[_0x7e76('0x21')]();}}else{var _0x49b23a=this;var _0x1b5ca1=apiai(_0xd52307[0x0],{'language':_0xd52307[0x1]||'en'});return _0x1b5ca1[_0x7e76('0x22')](this[_0x7e76('0x23')]['body'],{'sessionId':md5(this[_0x7e76('0xa')]['id'])})[_0x7e76('0x1a')](function(_0x4ec68d){_0x49b23a['body']['dialogflow']=_0x4ec68d;_0x41e9b8[_0x7e76('0x17')]=_0x4ec68d[_0x7e76('0x24')][_0x7e76('0x25')][_0x7e76('0x26')];_0x41e9b8[_0x7e76('0x27')]='dialogflow';_0x41e9b8[_0x7e76('0x28')]=JSON[_0x7e76('0x1e')](_0x4ec68d);return rpc[_0x1c491d+_0x7e76('0x19')][_0x7e76('0x29')](_0x41e9b8)[_0x7e76('0x1a')](function(_0x920ba9){logger[_0x7e76('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0x2a703b,_0x41e9b8[_0x7e76('0x17')]);if(_0x4ec68d['result'][_0x7e76('0x2a')]['endConversation']){_0x3aaa07['next']();}else{_0x3aaa07[_0x7e76('0x21')]();}})[_0x7e76('0x1c')](function(_0x56ce7d){logger[_0x7e76('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x2a703b,JSON['stringify'](_0x56ce7d));_0x3aaa07[_0x7e76('0x2b')]();});})['catch'](function(_0x473115){logger[_0x7e76('0x1d')](_0x7e76('0x2c'),_0x2a703b,_0x473115[_0x7e76('0x23')]);_0x3aaa07[_0x7e76('0x2b')]();});}}catch(_0x4ff347){logger['error'](_0x7e76('0x2c'),_0x2a703b,JSON['stringify'](_0x4ff347));_0x3aaa07['stop']();}};}; \ No newline at end of file +var _0x0f4d=['out','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','account','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','result','fulfillment','providerName','dialogflow','providerResponse','metadata','endConversation','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact'];(function(_0x5b9fd4,_0x5a61dd){var _0xd7cf72=function(_0x38de4a){while(--_0x38de4a){_0x5b9fd4['push'](_0x5b9fd4['shift']());}};_0xd7cf72(++_0x5a61dd);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x2dc13b,_0x96b210){_0x2dc13b=_0x2dc13b-0x0;var _0x3c4a5b=_0x0f4d[_0x2dc13b];return _0x3c4a5b;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0xd0f4('0x0'));var utils=require('./utils');var logger=require(_0xd0f4('0x1'))(_0xd0f4('0x2'));var rpc={'chatMessage':require(_0xd0f4('0x3')),'openchannelMessage':require(_0xd0f4('0x4')),'mailMessage':require(_0xd0f4('0x5')),'smsMessage':require(_0xd0f4('0x6')),'faxMessage':require(_0xd0f4('0x7')),'whatsappMessage':require(_0xd0f4('0x8'))};exports['consequence']=function(_0x1164da,_0x27acb8){return function(_0x4d0ab0){try{if(!_[_0xd0f4('0x9')](this[_0xd0f4('0xa')]['UserId'])){logger[_0xd0f4('0xb')](_0xd0f4('0xc'),_0x1164da,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4d0ab0[_0xd0f4('0xd')]();}var _0x359f12={'ContactId':this[_0xd0f4('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd0f4('0xf')};if(this[_0xd0f4('0x10')]===_0xd0f4('0x11')||this[_0xd0f4('0x10')]===_0xd0f4('0x12')){_0x359f12[_0xd0f4('0x13')]=this[_0xd0f4('0xa')]['phone'];}var _0x2eac6f=this[_0xd0f4('0x10')];if(_0x2eac6f==='chat'){_0x359f12[_0xd0f4('0x14')]=this['account']['id'];}else{_0x359f12[_[_0xd0f4('0x15')](_0x2eac6f)+'AccountId']=this[_0xd0f4('0x16')]['id'];}_0x359f12[_['upperFirst'](_0x2eac6f)+'InteractionId']=this['interaction']['id'];if(this[_0xd0f4('0xa')][_0xd0f4('0x17')]){var _0xe37a0d=_0x27acb8[0x2];if(!_[_0xd0f4('0x18')](_0xe37a0d)){_0x359f12[_0xd0f4('0x19')]=utils[_0xd0f4('0x1a')](_0xe37a0d,this);return rpc[_0x2eac6f+_0xd0f4('0x1b')][_0xd0f4('0x1c')](_0x359f12)[_0xd0f4('0x1d')](function(_0x5de07b){logger[_0xd0f4('0xb')](_0xd0f4('0xc'),_0x1164da,_0x359f12[_0xd0f4('0x19')]);})[_0xd0f4('0x1e')](function(_0x5cb3cb){logger[_0xd0f4('0x1f')](_0xd0f4('0xc'),_0x1164da,JSON[_0xd0f4('0x20')](_0x5cb3cb));})[_0xd0f4('0x21')](function(){logger['info'](_0xd0f4('0x22'),_0x1164da);_0x4d0ab0[_0xd0f4('0x23')]();});}else{logger[_0xd0f4('0xb')](_0xd0f4('0x24'),_0x1164da);_0x4d0ab0[_0xd0f4('0x23')]();}}else{var _0x2a1df0=this;var _0x25ee43=apiai(_0x27acb8[0x0],{'language':_0x27acb8[0x1]||'en'});return _0x25ee43['textRequest'](this[_0xd0f4('0x25')][_0xd0f4('0x19')],{'sessionId':md5(this[_0xd0f4('0xa')]['id'])})[_0xd0f4('0x1d')](function(_0x4d49c0){_0x2a1df0[_0xd0f4('0x19')]['dialogflow']=_0x4d49c0;_0x359f12[_0xd0f4('0x19')]=_0x4d49c0[_0xd0f4('0x26')][_0xd0f4('0x27')]['speech'];_0x359f12[_0xd0f4('0x28')]=_0xd0f4('0x29');_0x359f12[_0xd0f4('0x2a')]=JSON[_0xd0f4('0x20')](_0x4d49c0);return rpc[_0x2eac6f+_0xd0f4('0x1b')]['create'](_0x359f12)[_0xd0f4('0x1d')](function(_0x269fdd){logger[_0xd0f4('0xb')](_0xd0f4('0xc'),_0x1164da,_0x359f12[_0xd0f4('0x19')]);if(_0x4d49c0[_0xd0f4('0x26')][_0xd0f4('0x2b')][_0xd0f4('0x2c')]){_0x4d0ab0[_0xd0f4('0xd')]();}else{_0x4d0ab0['stop']();}})[_0xd0f4('0x1e')](function(_0x2df1ed){logger[_0xd0f4('0x1f')](_0xd0f4('0xc'),_0x1164da,JSON['stringify'](_0x2df1ed));_0x4d0ab0[_0xd0f4('0xd')]();});})['catch'](function(_0x4f92a9){logger['error'](_0xd0f4('0xc'),_0x1164da,_0x4f92a9[_0xd0f4('0x25')]);_0x4d0ab0[_0xd0f4('0xd')]();});}}catch(_0x3b963e){logger[_0xd0f4('0x1f')](_0xd0f4('0xc'),_0x1164da,JSON[_0xd0f4('0x20')](_0x3b963e));_0x4d0ab0[_0xd0f4('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 7a597c3..6a0b9f1 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 _0x1bc1=['isEmpty','getMustacheRender','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','dialogflowV2','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','sms','channel','whatsapp','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created'];(function(_0x121886,_0x8cd8e5){var _0x20ca01=function(_0x15e144){while(--_0x15e144){_0x121886['push'](_0x121886['shift']());}};_0x20ca01(++_0x8cd8e5);}(_0x1bc1,0xb7));var _0x11bc=function(_0x337317,_0x416433){_0x337317=_0x337317-0x0;var _0x1c5d49=_0x1bc1[_0x337317];return _0x1c5d49;};'use strict';var _=require(_0x11bc('0x0'));var dialogflow=require(_0x11bc('0x1'));var md5=require(_0x11bc('0x2'));var moment=require(_0x11bc('0x3'));var Promise=require(_0x11bc('0x4'));var logger=require(_0x11bc('0x5'))('routing');var utils=require(_0x11bc('0x6'));var rpc={'chatMessage':require(_0x11bc('0x7')),'openchannelMessage':require(_0x11bc('0x8')),'mailMessage':require(_0x11bc('0x9')),'smsMessage':require(_0x11bc('0xa')),'faxMessage':require(_0x11bc('0xb')),'whatsappMessage':require(_0x11bc('0xc'))};function createMessage(_0xe41d73,_0x579d6d,_0x44cd28,_0x34cdf6){return new Promise(function(_0x148c28,_0x511127){var _0x40ee54=_[_0x11bc('0xd')](_0x44cd28);_0x40ee54[_0x11bc('0xe')]=_0x34cdf6;return rpc[_0x579d6d+_0x11bc('0xf')][_0x11bc('0x10')](_0x40ee54)[_0x11bc('0x11')](function(){logger[_0x11bc('0x12')](_0x11bc('0x13'),_0xe41d73,_0x40ee54[_0x11bc('0xe')]);_0x148c28();})[_0x11bc('0x14')](function(_0x4a7571){logger[_0x11bc('0x15')](_0x11bc('0x13'),_0xe41d73,JSON[_0x11bc('0x16')](_0x4a7571));_0x511127(_0x4a7571);});});}exports[_0x11bc('0x17')]=function(_0x18c07d,_0x5a66fe){return function(_0x56fa6e){try{if(!_[_0x11bc('0x18')](this['interaction'][_0x11bc('0x19')])){logger['info'](_0x11bc('0x13'),_0x18c07d,_0x11bc('0x1a'));return _0x56fa6e[_0x11bc('0x1b')]();}var _0x22fdb8={'ContactId':this[_0x11bc('0x1c')]['id'],'sentAt':moment()[_0x11bc('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x11bc('0x1e')||this[_0x11bc('0x1f')]===_0x11bc('0x20')){_0x22fdb8['phone']=this[_0x11bc('0x21')][_0x11bc('0x22')];}var _0x1b02ff=this['channel'];if(_0x1b02ff===_0x11bc('0x23')){_0x22fdb8[_0x11bc('0x24')]=this[_0x11bc('0x25')]['id'];}else{_0x22fdb8[_[_0x11bc('0x26')](_0x1b02ff)+_0x11bc('0x27')]=this[_0x11bc('0x25')]['id'];}_0x22fdb8[_[_0x11bc('0x26')](_0x1b02ff)+_0x11bc('0x28')]=this[_0x11bc('0x21')]['id'];if(this[_0x11bc('0x21')][_0x11bc('0x29')]){var _0x20c297=_0x5a66fe[0x4];if(!_[_0x11bc('0x2a')](_0x20c297)){_0x22fdb8[_0x11bc('0xe')]=utils[_0x11bc('0x2b')](_0x20c297,this);return rpc[_0x1b02ff+'Message'][_0x11bc('0x10')](_0x22fdb8)[_0x11bc('0x11')](function(_0x547801){logger[_0x11bc('0x12')](_0x11bc('0x13'),_0x18c07d,_0x22fdb8['body']);})[_0x11bc('0x14')](function(_0x104748){logger['error'](_0x11bc('0x13'),_0x18c07d,JSON[_0x11bc('0x16')](_0x104748));})[_0x11bc('0x2c')](function(){logger[_0x11bc('0x12')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x18c07d);_0x56fa6e[_0x11bc('0x2d')]();});}else{logger[_0x11bc('0x12')](_0x11bc('0x2e'),_0x18c07d);_0x56fa6e[_0x11bc('0x2d')]();}}else{var _0x1ceb7a=this;var _0x5b878d=_0x5a66fe[0x2]['replace'](/\\n/g,'\x0a');var _0x39750d={'credentials':{'private_key':_0x5b878d,'client_email':_0x5a66fe[0x1]}};var _0x5c9300=new dialogflow['SessionsClient'](_0x39750d);var _0x49eb69=_0x5c9300['sessionPath'](_0x5a66fe[0x0],md5(_0x1ceb7a[_0x11bc('0x21')]['id']));var _0x439343={'session':_0x49eb69,'queryInput':{'text':{'text':_0x1ceb7a[_0x11bc('0x2f')]['body'],'languageCode':_0x5a66fe[0x3]||'en'}}};return _0x5c9300[_0x11bc('0x30')](_0x439343)[_0x11bc('0x11')](function(_0x783cc2){if(_0x783cc2&&_0x783cc2[_0x11bc('0x31')]){_0x1ceb7a[_0x11bc('0xe')]['dialogflowV2']=_0x783cc2;var _0x4784bf=_0x783cc2[0x0];var _0x1f2e94=_0x4784bf[_0x11bc('0x32')][_0x11bc('0x33')]&&_0x4784bf['queryResult'][_0x11bc('0x33')][_0x11bc('0x34')]?_0x4784bf[_0x11bc('0x32')][_0x11bc('0x33')]['fields'][_0x11bc('0x35')][_0x11bc('0x36')]:![];_0x1ceb7a['body']['DIALOGFLOWV2_ACTION']=_0x4784bf[_0x11bc('0x32')][_0x11bc('0x37')];_0x1ceb7a['body'][_0x11bc('0x38')]=_0x4784bf['queryResult'][_0x11bc('0x39')];_0x1ceb7a[_0x11bc('0xe')][_0x11bc('0x3a')]=_0x4784bf[_0x11bc('0x32')][_0x11bc('0x33')]&&_0x4784bf[_0x11bc('0x32')][_0x11bc('0x33')]['fields']?_0x4784bf[_0x11bc('0x32')][_0x11bc('0x33')][_0x11bc('0x34')]['end_conversation'][_0x11bc('0x36')]:![];_0x1ceb7a[_0x11bc('0xe')][_0x11bc('0x3b')]=_0x4784bf[_0x11bc('0x32')][_0x11bc('0x3c')][_0x11bc('0x3d')];_0x1ceb7a['body'][_0x11bc('0x3e')]=_0x4784bf[_0x11bc('0x32')]['intent'][_0x11bc('0x3f')];_0x1ceb7a[_0x11bc('0xe')][_0x11bc('0x40')]=_0x4784bf[_0x11bc('0x32')]['intent'][_0x11bc('0x41')];_0x1ceb7a['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x4784bf[_0x11bc('0x32')][_0x11bc('0x42')];_0x1ceb7a[_0x11bc('0xe')][_0x11bc('0x43')]=_0x4784bf[_0x11bc('0x32')]['queryText'];_0x1ceb7a[_0x11bc('0xe')][_0x11bc('0x44')]=_0x4784bf['queryResult'][_0x11bc('0x45')];_0x22fdb8['providerName']=_0x11bc('0x46');_0x22fdb8[_0x11bc('0x47')]=JSON[_0x11bc('0x16')](_0x783cc2);var _0x36ba51=[];for(var _0x4bb6d5=0x0;_0x4bb6d5<_0x783cc2[_0x11bc('0x31')];_0x4bb6d5++){var _0x4fc5dd=_0x783cc2[_0x4bb6d5];if(_0x4fc5dd&&_0x4fc5dd[_0x11bc('0x32')]&&_0x4fc5dd['queryResult'][_0x11bc('0x48')]){_0x36ba51[_0x11bc('0x49')](createMessage(_0x18c07d,_0x1b02ff,_0x22fdb8,_0x4fc5dd['queryResult'][_0x11bc('0x48')]));}}return Promise[_0x11bc('0x4a')](_0x36ba51)['then'](function(){if(_0x1f2e94){_0x56fa6e['next']();}else{_0x56fa6e[_0x11bc('0x2d')]();}})[_0x11bc('0x14')](function(_0x4a1316){logger[_0x11bc('0x15')](_0x11bc('0x13'),_0x18c07d,JSON['stringify'](_0x4a1316));_0x56fa6e[_0x11bc('0x1b')]();});}})[_0x11bc('0x14')](function(_0x4ff129){logger[_0x11bc('0x15')](_0x11bc('0x13'),_0x18c07d,_0x4ff129['message']);_0x56fa6e[_0x11bc('0x1b')]();});}}catch(_0x4e2729){logger[_0x11bc('0x15')]('[%s][DIALOGFLOWV2]\x20%s',_0x18c07d,JSON['stringify'](_0x4e2729));_0x56fa6e[_0x11bc('0x2d')]();}};}; \ No newline at end of file +var _0xb5b3=['length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','message','detectIntent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb5b3,0x143));var _0x3b5b=function(_0x3ee4bc,_0x55538c){_0x3ee4bc=_0x3ee4bc-0x0;var _0xd7e1d7=_0xb5b3[_0x3ee4bc];return _0xd7e1d7;};'use strict';var _=require(_0x3b5b('0x0'));var dialogflow=require(_0x3b5b('0x1'));var md5=require(_0x3b5b('0x2'));var moment=require(_0x3b5b('0x3'));var Promise=require('bluebird');var logger=require(_0x3b5b('0x4'))(_0x3b5b('0x5'));var utils=require(_0x3b5b('0x6'));var rpc={'chatMessage':require(_0x3b5b('0x7')),'openchannelMessage':require(_0x3b5b('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3b5b('0x9')),'faxMessage':require(_0x3b5b('0xa')),'whatsappMessage':require(_0x3b5b('0xb'))};function createMessage(_0xad7d57,_0x3a1ffc,_0x4394cb,_0x2e107e){return new Promise(function(_0x39f9f7,_0x372f35){var _0x2ed401=_[_0x3b5b('0xc')](_0x4394cb);_0x2ed401[_0x3b5b('0xd')]=_0x2e107e;return rpc[_0x3a1ffc+_0x3b5b('0xe')][_0x3b5b('0xf')](_0x2ed401)[_0x3b5b('0x10')](function(){logger['info'](_0x3b5b('0x11'),_0xad7d57,_0x2ed401[_0x3b5b('0xd')]);_0x39f9f7();})[_0x3b5b('0x12')](function(_0x551ba1){logger[_0x3b5b('0x13')](_0x3b5b('0x11'),_0xad7d57,JSON[_0x3b5b('0x14')](_0x551ba1));_0x372f35(_0x551ba1);});});}exports['consequence']=function(_0xf9b23c,_0xf804b2){return function(_0x7575d2){try{if(!_[_0x3b5b('0x15')](this[_0x3b5b('0x16')]['UserId'])){logger[_0x3b5b('0x17')](_0x3b5b('0x11'),_0xf9b23c,_0x3b5b('0x18'));return _0x7575d2[_0x3b5b('0x19')]();}var _0x1664c7={'ContactId':this[_0x3b5b('0x1a')]['id'],'sentAt':moment()[_0x3b5b('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3b5b('0x1c')};if(this[_0x3b5b('0x1d')]===_0x3b5b('0x1e')||this[_0x3b5b('0x1d')]===_0x3b5b('0x1f')){_0x1664c7[_0x3b5b('0x20')]=this[_0x3b5b('0x16')]['phone'];}var _0x5131a8=this[_0x3b5b('0x1d')];if(_0x5131a8===_0x3b5b('0x21')){_0x1664c7[_0x3b5b('0x22')]=this[_0x3b5b('0x23')]['id'];}else{_0x1664c7[_[_0x3b5b('0x24')](_0x5131a8)+_0x3b5b('0x25')]=this[_0x3b5b('0x23')]['id'];}_0x1664c7[_[_0x3b5b('0x24')](_0x5131a8)+_0x3b5b('0x26')]=this[_0x3b5b('0x16')]['id'];if(this[_0x3b5b('0x16')]['created']){var _0x429c14=_0xf804b2[0x4];if(!_[_0x3b5b('0x27')](_0x429c14)){_0x1664c7[_0x3b5b('0xd')]=utils[_0x3b5b('0x28')](_0x429c14,this);return rpc[_0x5131a8+_0x3b5b('0xe')]['create'](_0x1664c7)[_0x3b5b('0x10')](function(_0x3ab7f7){logger['info'](_0x3b5b('0x11'),_0xf9b23c,_0x1664c7[_0x3b5b('0xd')]);})[_0x3b5b('0x12')](function(_0x1c73ba){logger[_0x3b5b('0x13')](_0x3b5b('0x11'),_0xf9b23c,JSON[_0x3b5b('0x14')](_0x1c73ba));})[_0x3b5b('0x29')](function(){logger[_0x3b5b('0x17')](_0x3b5b('0x2a'),_0xf9b23c);_0x7575d2[_0x3b5b('0x2b')]();});}else{logger[_0x3b5b('0x17')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xf9b23c);_0x7575d2[_0x3b5b('0x2b')]();}}else{var _0xd11b37=this;var _0x5b6996=_0xf804b2[0x2][_0x3b5b('0x2c')](/\\n/g,'\x0a');var _0x3d0f78={'credentials':{'private_key':_0x5b6996,'client_email':_0xf804b2[0x1]}};var _0x27b7ca=new dialogflow['SessionsClient'](_0x3d0f78);var _0x4a791b=_0x27b7ca['sessionPath'](_0xf804b2[0x0],md5(_0xd11b37['interaction']['id']));var _0x30cdb1={'session':_0x4a791b,'queryInput':{'text':{'text':_0xd11b37[_0x3b5b('0x2d')]['body'],'languageCode':_0xf804b2[0x3]||'en'}}};return _0x27b7ca[_0x3b5b('0x2e')](_0x30cdb1)[_0x3b5b('0x10')](function(_0x2ab83c){if(_0x2ab83c&&_0x2ab83c[_0x3b5b('0x2f')]){_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x30')]=_0x2ab83c;var _0x5ae6f5=_0x2ab83c[0x0];var _0x2f889b=_0x5ae6f5[_0x3b5b('0x31')]['diagnosticInfo']&&_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x32')][_0x3b5b('0x33')]?_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x32')][_0x3b5b('0x33')][_0x3b5b('0x34')][_0x3b5b('0x35')]:![];_0xd11b37[_0x3b5b('0xd')]['DIALOGFLOWV2_ACTION']=_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x36')];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x37')]=_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x38')];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x39')]=_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x32')]&&_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x32')][_0x3b5b('0x33')]?_0x5ae6f5['queryResult'][_0x3b5b('0x32')][_0x3b5b('0x33')][_0x3b5b('0x34')][_0x3b5b('0x35')]:![];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x3a')]=_0x5ae6f5[_0x3b5b('0x31')]['intent'][_0x3b5b('0x3b')];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x3c')]=_0x5ae6f5[_0x3b5b('0x31')]['intent'][_0x3b5b('0x3d')];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x3e')]=_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x3f')][_0x3b5b('0x40')];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x41')]=_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x42')];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x43')]=_0x5ae6f5['queryResult'][_0x3b5b('0x44')];_0xd11b37[_0x3b5b('0xd')][_0x3b5b('0x45')]=_0x5ae6f5[_0x3b5b('0x31')][_0x3b5b('0x46')];_0x1664c7['providerName']=_0x3b5b('0x30');_0x1664c7[_0x3b5b('0x47')]=JSON[_0x3b5b('0x14')](_0x2ab83c);var _0x429100=[];for(var _0x396a8c=0x0;_0x396a8c<_0x2ab83c[_0x3b5b('0x2f')];_0x396a8c++){var _0x579a91=_0x2ab83c[_0x396a8c];if(_0x579a91&&_0x579a91[_0x3b5b('0x31')]&&_0x579a91[_0x3b5b('0x31')][_0x3b5b('0x48')]){_0x429100['push'](createMessage(_0xf9b23c,_0x5131a8,_0x1664c7,_0x579a91[_0x3b5b('0x31')]['fulfillmentText']));}}return Promise[_0x3b5b('0x49')](_0x429100)['then'](function(){if(_0x2f889b){_0x7575d2[_0x3b5b('0x19')]();}else{_0x7575d2[_0x3b5b('0x2b')]();}})[_0x3b5b('0x12')](function(_0x3c5b43){logger[_0x3b5b('0x13')](_0x3b5b('0x11'),_0xf9b23c,JSON['stringify'](_0x3c5b43));_0x7575d2[_0x3b5b('0x19')]();});}})[_0x3b5b('0x12')](function(_0x5e98d1){logger[_0x3b5b('0x13')](_0x3b5b('0x11'),_0xf9b23c,_0x5e98d1[_0x3b5b('0x2d')]);_0x7575d2[_0x3b5b('0x19')]();});}}catch(_0x5eb7b7){logger[_0x3b5b('0x13')](_0x3b5b('0x11'),_0xf9b23c,JSON[_0x3b5b('0x14')](_0x5eb7b7));_0x7575d2['stop']();}};}; \ 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 b7bac72..54154fd 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 _0x14e5=['../../../../config/logger','routing','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','./utils'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x14e5,0x1b7));var _0x514e=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x14e5[_0x1558ab];return _0x53b64a;};'use strict';var schema=require('validate');var _=require(_0x514e('0x0'));var htmlToText=require(_0x514e('0x1'));var utils=require(_0x514e('0x2'));var logger=require(_0x514e('0x3'))(_0x514e('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x514e('0x5'),'message':_0x514e('0x6')},'priorityFalse':{'type':_0x514e('0x5'),'message':_0x514e('0x7')}});exports[_0x514e('0x8')]=function(_0x4897f2,_0x19d8d6){return function(_0x41b776){try{var _0x19305b={'condition':htmlToText[_0x514e('0x9')](utils[_0x514e('0xa')](_0x19d8d6[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x19d8d6[0x1],'priorityFalse':_0x19d8d6[0x2]};var _0x54e845=gotoif['validate'](_0x19305b,{'typecast':!![]});if(_0x54e845[_0x514e('0xb')]){logger[_0x514e('0xc')](_0x514e('0xd'),_0x4897f2,_[_0x514e('0xe')](_0x54e845,_0x514e('0xf'))[_0x514e('0x10')](',\x20'));_0x41b776[_0x514e('0x11')]();}else{try{var _0x32154b=eval('('+_0x19305b[_0x514e('0x12')]+')');var _0x17c85b=_0x32154b?_0x19305b['priorityTrue']:_0x19305b[_0x514e('0x13')];logger[_0x514e('0x14')](_0x514e('0x15'),_0x4897f2,_0x19305b[_0x514e('0x12')],_0x32154b,_0x17c85b||_0x514e('0x16'));if(_0x17c85b){var _0x3efd69=_['findIndex'](_0x41b776[_0x514e('0x17')](),{'p':_0x17c85b});if(_0x3efd69>=0x0){logger[_0x514e('0x14')](_0x514e('0x18'),_0x4897f2,_0x17c85b||_0x514e('0x16'),_0x3efd69);_0x41b776[_0x514e('0x16')](_0x3efd69);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4897f2,_0x17c85b||_0x514e('0x16'));_0x41b776[_0x514e('0x11')]();}}else{_0x41b776[_0x514e('0x16')]();}}catch(_0x39c9dd){logger['error'](_0x514e('0x19'),_0x4897f2,_0x39c9dd[_0x514e('0xf')]);_0x41b776[_0x514e('0x11')]();}}}catch(_0x4e449e){logger['error'](_0x514e('0xd'),_0x4897f2,JSON['stringify'](_0x4e449e));_0x41b776[_0x514e('0x11')]();}};}; \ No newline at end of file +var _0xfd29=['routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','replace','error','map','join','stop','condition','priorityFalse','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','validate','html-to-text','./utils','../../../../config/logger'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xfd29,0x92));var _0x9fd2=function(_0x1c4977,_0x415748){_0x1c4977=_0x1c4977-0x0;var _0x2313af=_0xfd29[_0x1c4977];return _0x2313af;};'use strict';var schema=require(_0x9fd2('0x0'));var _=require('lodash');var htmlToText=require(_0x9fd2('0x1'));var utils=require(_0x9fd2('0x2'));var logger=require(_0x9fd2('0x3'))(_0x9fd2('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x9fd2('0x5')},'priorityTrue':{'type':'number','message':_0x9fd2('0x6')},'priorityFalse':{'type':_0x9fd2('0x7'),'message':_0x9fd2('0x8')}});exports['consequence']=function(_0xd636d1,_0x28ccb5){return function(_0x1c2c21){try{var _0x17aaa7={'condition':htmlToText[_0x9fd2('0x9')](utils['getMustacheRender'](_0x28ccb5[0x0],this),{'wordwrap':![]})[_0x9fd2('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x28ccb5[0x1],'priorityFalse':_0x28ccb5[0x2]};var _0xdee88d=gotoif[_0x9fd2('0x0')](_0x17aaa7,{'typecast':!![]});if(_0xdee88d['length']){logger[_0x9fd2('0xb')]('[%s][GOTOIF]\x20%s',_0xd636d1,_[_0x9fd2('0xc')](_0xdee88d,'message')[_0x9fd2('0xd')](',\x20'));_0x1c2c21[_0x9fd2('0xe')]();}else{try{var _0x403606=eval('('+_0x17aaa7[_0x9fd2('0xf')]+')');var _0x527c21=_0x403606?_0x17aaa7['priorityTrue']:_0x17aaa7[_0x9fd2('0x10')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xd636d1,_0x17aaa7['condition'],_0x403606,_0x527c21||'next');if(_0x527c21){var _0xd8bda0=_[_0x9fd2('0x11')](_0x1c2c21[_0x9fd2('0x12')](),{'p':_0x527c21});if(_0xd8bda0>=0x0){logger['info'](_0x9fd2('0x13'),_0xd636d1,_0x527c21||'next',_0xd8bda0);_0x1c2c21[_0x9fd2('0x14')](_0xd8bda0);}else{logger['info'](_0x9fd2('0x15'),_0xd636d1,_0x527c21||_0x9fd2('0x14'));_0x1c2c21['stop']();}}else{_0x1c2c21[_0x9fd2('0x14')]();}}catch(_0x1f62d2){logger['error'](_0x9fd2('0x16'),_0xd636d1,_0x1f62d2[_0x9fd2('0x17')]);_0x1c2c21[_0x9fd2('0xe')]();}}}catch(_0x37cb81){logger[_0x9fd2('0xb')](_0x9fd2('0x18'),_0xd636d1,JSON['stringify'](_0x37cb81));_0x1c2c21[_0x9fd2('0xe')]();}};}; \ 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 35e1e32..62c515c 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 _0x05f2=['error','map','join','stop','info','findIndex','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','number','consequence'];(function(_0x264eb9,_0x299cbd){var _0x597f9c=function(_0x26945b){while(--_0x26945b){_0x264eb9['push'](_0x264eb9['shift']());}};_0x597f9c(++_0x299cbd);}(_0x05f2,0x1bc));var _0x205f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x05f2[_0x57b54c];return _0x59cc19;};'use strict';var schema=require(_0x205f('0x0'));var _=require('lodash');var logger=require(_0x205f('0x1'))('routing');var gotop=schema({'priority':{'type':_0x205f('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x205f('0x3')]=function(_0x3d0dec,_0x32cf87){return function(_0x3b3344){try{var _0x3ad450={'priority':_0x32cf87[0x0]};var _0x3d6771=gotop[_0x205f('0x0')](_0x3ad450,{'typecast':!![]});if(_0x3d6771['length']){logger[_0x205f('0x4')]('[%s][GOTOP]\x20%s',_0x3d0dec,_[_0x205f('0x5')](_0x3d6771,'message')[_0x205f('0x6')](',\x20'));_0x3b3344[_0x205f('0x7')]();}else{logger[_0x205f('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0x3d0dec,_0x3ad450['priority']);if(_0x3ad450['priority']){var _0x130e32=_[_0x205f('0x9')](_0x3b3344[_0x205f('0xa')](),{'p':_0x3ad450[_0x205f('0xb')]});if(_0x130e32>=0x0){logger[_0x205f('0x8')](_0x205f('0xc'),_0x3d0dec,_0x3ad450['priority']||_0x205f('0xd'),_0x130e32);_0x3b3344[_0x205f('0xd')](_0x130e32);}else{logger[_0x205f('0x8')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3d0dec,_0x3ad450[_0x205f('0xb')]||_0x205f('0xd'));_0x3b3344[_0x205f('0x7')]();}}else{_0x3b3344[_0x205f('0xd')]();}}}catch(_0x13d8cb){logger[_0x205f('0x4')](_0x205f('0xe'),_0x3d0dec,JSON[_0x205f('0xf')](_0x13d8cb));_0x3b3344[_0x205f('0x7')]();}};}; \ No newline at end of file +var _0x52eb=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','length','error','message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x52eb,0x1d3));var _0xb52e=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x52eb[_0x363ef8];return _0x148822;};'use strict';var schema=require(_0xb52e('0x0'));var _=require('lodash');var logger=require(_0xb52e('0x1'))(_0xb52e('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x546878,_0x1a3c80){return function(_0x3aeb97){try{var _0xd4b574={'priority':_0x1a3c80[0x0]};var _0x38f3a8=gotop['validate'](_0xd4b574,{'typecast':!![]});if(_0x38f3a8[_0xb52e('0x3')]){logger[_0xb52e('0x4')]('[%s][GOTOP]\x20%s',_0x546878,_['map'](_0x38f3a8,_0xb52e('0x5'))[_0xb52e('0x6')](',\x20'));_0x3aeb97[_0xb52e('0x7')]();}else{logger[_0xb52e('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0x546878,_0xd4b574[_0xb52e('0x9')]);if(_0xd4b574[_0xb52e('0x9')]){var _0x2f6ca6=_[_0xb52e('0xa')](_0x3aeb97[_0xb52e('0xb')](),{'p':_0xd4b574[_0xb52e('0x9')]});if(_0x2f6ca6>=0x0){logger['info'](_0xb52e('0xc'),_0x546878,_0xd4b574[_0xb52e('0x9')]||_0xb52e('0xd'),_0x2f6ca6);_0x3aeb97['next'](_0x2f6ca6);}else{logger[_0xb52e('0x8')](_0xb52e('0xe'),_0x546878,_0xd4b574[_0xb52e('0x9')]||_0xb52e('0xd'));_0x3aeb97[_0xb52e('0x7')]();}}else{_0x3aeb97[_0xb52e('0xd')]();}}}catch(_0x6e3e8e){logger['error']('[%s][GOTOP]\x20%s',_0x546878,JSON[_0xb52e('0xf')](_0x6e3e8e));_0x3aeb97[_0xb52e('0x7')]();}};}; \ 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 82e0463..92b92d2 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 _0xa120=['stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xa120,0xf4));var _0x0a12=function(_0x108533,_0x322791){_0x108533=_0x108533-0x0;var _0xc69996=_0xa120[_0x108533];return _0xc69996;};'use strict';var _=require(_0x0a12('0x0'));var utils=require(_0x0a12('0x1'));var logger=require('../../../../config/logger')(_0x0a12('0x2'));var rpc={'chatMessage':require(_0x0a12('0x3')),'openchannelMessage':require(_0x0a12('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0a12('0x5')),'whatsappMessage':require(_0x0a12('0x6'))};exports[_0x0a12('0x7')]=function(_0xfcab54,_0x37f1e9){return function(_0x2ea526){try{var _0x4578bb={'body':utils[_0x0a12('0x8')](_0x37f1e9[0x0],this),'ContactId':this[_0x0a12('0x9')]['id']};if(this[_0x0a12('0xa')]===_0x0a12('0xb')){_0x4578bb['ChatWebsiteId']=this[_0x0a12('0xc')]['id'];}else{_0x4578bb[_['upperFirst'](this[_0x0a12('0xa')])+_0x0a12('0xd')]=this[_0x0a12('0xc')]['id'];}_0x4578bb[_[_0x0a12('0xe')](this['channel'])+_0x0a12('0xf')]=this[_0x0a12('0x10')]['id'];if(rpc[this['channel']+'Message']){return rpc[this['channel']+_0x0a12('0x11')][_0x0a12('0x12')](_0x4578bb)[_0x0a12('0x13')](function(_0x407bee){logger['info'](_0x0a12('0x14'),_0xfcab54,_0x4578bb[_0x0a12('0x15')]);_0x2ea526[_0x0a12('0x16')]();})[_0x0a12('0x17')](function(_0xe6552d){logger[_0x0a12('0x18')]('[%s][MESSAGE]\x20%s',_0xfcab54,JSON[_0x0a12('0x19')](_0xe6552d));_0x2ea526[_0x0a12('0x1a')]();});}}catch(_0x4baa1b){logger['error'](_0x0a12('0x14'),_0xfcab54,JSON['stringify'](_0x4baa1b));_0x2ea526['stop']();}};}; \ No newline at end of file +var _0x00dd=['../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','account','upperFirst','AccountId','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stop','error','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x00dd,0xc9));var _0xd00d=function(_0x3c60ae,_0x4fbf8e){_0x3c60ae=_0x3c60ae-0x0;var _0xdaf38d=_0x00dd[_0x3c60ae];return _0xdaf38d;};'use strict';var _=require(_0xd00d('0x0'));var utils=require(_0xd00d('0x1'));var logger=require('../../../../config/logger')(_0xd00d('0x2'));var rpc={'chatMessage':require(_0xd00d('0x3')),'openchannelMessage':require(_0xd00d('0x4')),'mailMessage':require(_0xd00d('0x5')),'smsMessage':require(_0xd00d('0x6')),'faxMessage':require(_0xd00d('0x7')),'whatsappMessage':require(_0xd00d('0x8'))};exports[_0xd00d('0x9')]=function(_0x33ec25,_0x5e7715){return function(_0x226201){try{var _0x474fcc={'body':utils['getMustacheRender'](_0x5e7715[0x0],this),'ContactId':this[_0xd00d('0xa')]['id']};if(this[_0xd00d('0xb')]===_0xd00d('0xc')){_0x474fcc['ChatWebsiteId']=this[_0xd00d('0xd')]['id'];}else{_0x474fcc[_[_0xd00d('0xe')](this[_0xd00d('0xb')])+_0xd00d('0xf')]=this[_0xd00d('0xd')]['id'];}_0x474fcc[_[_0xd00d('0xe')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0xd00d('0xb')]+_0xd00d('0x10')]){return rpc[this[_0xd00d('0xb')]+_0xd00d('0x10')][_0xd00d('0x11')](_0x474fcc)[_0xd00d('0x12')](function(_0x459acc){logger['info'](_0xd00d('0x13'),_0x33ec25,_0x474fcc[_0xd00d('0x14')]);_0x226201[_0xd00d('0x15')]();})[_0xd00d('0x16')](function(_0x39f3f8){logger['error'](_0xd00d('0x13'),_0x33ec25,JSON['stringify'](_0x39f3f8));_0x226201[_0xd00d('0x17')]();});}}catch(_0xa27fc1){logger[_0xd00d('0x18')]('[%s][MESSAGE]\x20%s',_0x33ec25,JSON[_0xd00d('0x19')](_0xa27fc1));_0x226201[_0xd00d('0x17')]();}};}; \ 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 3f04ce4..58780c7 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 _0x8c6a=['../../../../config/logger','routing','consequence','info','getMustacheRender','next','[%s][NOOP]\x20%s','stringify','stop','./utils'];(function(_0x801053,_0x502b04){var _0x15d0e9=function(_0x22cacd){while(--_0x22cacd){_0x801053['push'](_0x801053['shift']());}};_0x15d0e9(++_0x502b04);}(_0x8c6a,0x15d));var _0xa8c6=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x8c6a[_0x16cb03];return _0x10944e;};'use strict';var utils=require(_0xa8c6('0x0'));var logger=require(_0xa8c6('0x1'))(_0xa8c6('0x2'));exports[_0xa8c6('0x3')]=function(_0x182600,_0x4e05ea){return function(_0x4422ac){try{logger[_0xa8c6('0x4')]('[%s][NOOP]\x20%s',_0x182600,utils[_0xa8c6('0x5')](_0x4e05ea[0x0],this));_0x4422ac[_0xa8c6('0x6')]();}catch(_0x3b5b2f){logger['error'](_0xa8c6('0x7'),_0x182600,JSON[_0xa8c6('0x8')](_0x3b5b2f));_0x4422ac[_0xa8c6('0x9')]();}};}; \ No newline at end of file +var _0x9527=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','../../../../config/logger','routing','consequence'];(function(_0x46f877,_0x595cf0){var _0x478249=function(_0x1a7482){while(--_0x1a7482){_0x46f877['push'](_0x46f877['shift']());}};_0x478249(++_0x595cf0);}(_0x9527,0xa8));var _0x7952=function(_0x1f9547,_0x4e1654){_0x1f9547=_0x1f9547-0x0;var _0x163444=_0x9527[_0x1f9547];return _0x163444;};'use strict';var utils=require('./utils');var logger=require(_0x7952('0x0'))(_0x7952('0x1'));exports[_0x7952('0x2')]=function(_0x1f3df0,_0x3d230d){return function(_0x2d4556){try{logger[_0x7952('0x3')](_0x7952('0x4'),_0x1f3df0,utils[_0x7952('0x5')](_0x3d230d[0x0],this));_0x2d4556[_0x7952('0x6')]();}catch(_0x1d2182){logger['error']('[%s][NOOP]\x20%s',_0x1f3df0,JSON[_0x7952('0x7')](_0x1d2182));_0x2d4556[_0x7952('0x8')]();}};}; \ 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 7246c9f..22cb954 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 _0x3366=['stop','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','contact','list','upperFirst','channel','QueueId','InteractionId','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','Queues','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3366,0x14b));var _0x6336=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0x3366[_0x51af96];return _0x2bb16b;};'use strict';var schema=require('validate');var _=require(_0x6336('0x0'));var util=require(_0x6336('0x1'));var seqqueue=require(_0x6336('0x2'));var moment=require('moment');var Redis=require(_0x6336('0x3'));var config=require(_0x6336('0x4'));var logger=require(_0x6336('0x5'))(_0x6336('0x6'));var strategy=require(_0x6336('0x7'));config[_0x6336('0x8')]=_[_0x6336('0x9')](config['redis'],{'host':_0x6336('0xa'),'port':0x18eb});var io=require(_0x6336('0xb'))(new Redis(config[_0x6336('0x8')]));var attributes=['id',_0x6336('0xc'),_0x6336('0xd'),_0x6336('0xe'),_0x6336('0xf'),_0x6336('0x10')];function emit(_0x1203d7,_0x4f63de,_0x1f821e){io['to'](_0x1203d7)[_0x6336('0x11')](_0x4f63de,_0x1f821e);}function emitChannelQueueInteraction(_0x45ca1b,_0x45fa6c,_0x3c37a0,_0x45bc5f,_0x25d8ef,_0x13ea7b,_0x808427,_0x279091){var _0x4d6dcd=_['clone'](_0x3c37a0);_0x4d6dcd['queue_id']=_0x279091;_0x4d6dcd[_0x6336('0xe')]=_0x45fa6c;_0x4d6dcd[_0x6336('0xd')]=_0x45bc5f;_0x4d6dcd['id']=_0x25d8ef;if(_0x13ea7b){_0x808427[util[_0x6336('0x12')]('%sQueuesWaitingInteractions',_0x45ca1b)][_0x25d8ef]=_[_0x6336('0x13')](_0x4d6dcd,attributes);}else{delete _0x808427[util['format'](_0x6336('0x14'),_0x45ca1b)][_0x25d8ef];}emit(util[_0x6336('0x12')]('%s:queue:%s',_0x45ca1b,_0x45fa6c),util['format'](_0x6336('0x15'),_0x45ca1b,_0x13ea7b?_0x6336('0x16'):_0x6336('0x17')),_[_0x6336('0x13')](_0x4d6dcd,attributes));}var rpc={'openchannelQueueReport':require(_0x6336('0x18')),'mailQueueReport':require(_0x6336('0x19')),'chatQueueReport':require(_0x6336('0x1a')),'smsQueueReport':require(_0x6336('0x1b')),'faxQueueReport':require(_0x6336('0x1c')),'whatsappQueueReport':require(_0x6336('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x6336('0x1e')},'timeout':{'type':_0x6336('0x1f'),'message':_0x6336('0x20')}});function startRouting(_0x551d04,_0x1c5068,_0x418216,_0x49b28b){if(_0x551d04&&_0x1c5068&&_0x418216){_0x1c5068['waiting']+=0x1;var _0xac7b4e={'uniqueid':_0x551d04,'from':_0x418216['body']?_0x418216['body']['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x418216['contact']?_0x418216[_0x6336('0x21')]['id']:null,'ListId':_0x418216[_0x6336('0x22')]?_0x418216[_0x6336('0x22')]['id']:null};_0xac7b4e[_[_0x6336('0x23')](_0x418216[_0x6336('0x24')])+_0x6336('0x25')]=_0x1c5068['id']||null;_0xac7b4e[_[_0x6336('0x23')](_0x418216[_0x6336('0x24')])+_0x6336('0x26')]=_0x418216['interaction']?_0x418216['interaction']['id']:null;_0xac7b4e[_[_0x6336('0x23')](_0x418216[_0x6336('0x24')])+_0x6336('0x27')]=_0x418216[_0x6336('0x28')]?_0x418216[_0x6336('0x28')]['id']:null;_0xac7b4e[_[_0x6336('0x23')](_0x418216[_0x6336('0x24')])+(_0x418216[_0x6336('0x24')]!==_0x6336('0x29')?_0x6336('0x2a'):_0x6336('0x2b'))]=_0x418216[_0x6336('0xd')]?_0x418216[_0x6336('0xd')]['id']:null;logger[_0x6336('0x2c')](util['format'](_0x6336('0x2d'),_0x551d04,_0x1c5068[_0x6336('0x2e')]));emitChannelQueueInteraction(_0x418216[_0x6336('0x24')],_0x1c5068[_0x6336('0x2e')],_0xac7b4e,_0x418216[_0x6336('0xd')][_0x6336('0x2e')],_0x418216['message']['id'],!![],_0x49b28b,_0x1c5068['id']);if(rpc[_0x418216[_0x6336('0x24')]+_0x6336('0x2f')]){return rpc[_0x418216[_0x6336('0x24')]+'QueueReport'][_0x6336('0x30')](_0xac7b4e)['catch'](function(_0x5d6ee8){logger[_0x6336('0x31')](_0x6336('0x32'));});}}}function stopRouting(_0x26afc2,_0x4ec9a7,_0x27ebff,_0x7b0fde){if(_0x26afc2&&_0x4ec9a7){_0x4ec9a7[_0x6336('0x33')]-=0x1;var _0x2da938={'leaveAt':moment()[_0x6336('0x12')](_0x6336('0x34')),'acceptAt':moment()['format'](_0x6336('0x34')),'reason':_0x6336('0x35')};logger[_0x6336('0x2c')](util['format'](_0x6336('0x36'),_0x26afc2,_0x4ec9a7[_0x6336('0x2e')]));emitChannelQueueInteraction(_0x27ebff[_0x6336('0x24')],_0x4ec9a7[_0x6336('0x2e')],_0x27ebff[_0x6336('0x37')],_0x27ebff[_0x6336('0xd')][_0x6336('0x2e')],_0x27ebff['message']['id'],![],_0x7b0fde,_0x4ec9a7['id']);if(rpc[_0x27ebff[_0x6336('0x24')]+_0x6336('0x2f')]){return rpc[_0x27ebff[_0x6336('0x24')]+_0x6336('0x2f')][_0x6336('0x38')](_0x26afc2,_0x2da938)['catch'](function(_0x5a6756){logger[_0x6336('0x31')](_0x6336('0x39'));});}}}function endRouting(_0x525656,_0x2ec495,_0x2f495c,_0x3f8e5b){if(_0x525656&&_0x2ec495){_0x2ec495[_0x6336('0x33')]-=0x1;var _0x34f97f={'leaveAt':moment()['format'](_0x6336('0x34')),'exitAt':moment()[_0x6336('0x12')](_0x6336('0x34')),'reason':_0x6336('0x3a')};logger['info'](util[_0x6336('0x12')](_0x6336('0x3b'),_0x525656,_0x2ec495[_0x6336('0x2e')]));emitChannelQueueInteraction(_0x2f495c[_0x6336('0x24')],_0x2ec495[_0x6336('0x2e')],_0x2f495c[_0x6336('0x37')],_0x2f495c[_0x6336('0xd')][_0x6336('0x2e')],_0x2f495c[_0x6336('0x28')]['id'],![],_0x3f8e5b);if(rpc[_0x2f495c[_0x6336('0x24')]+'QueueReport']){return rpc[_0x2f495c[_0x6336('0x24')]+_0x6336('0x2f')][_0x6336('0x38')](_0x525656,_0x34f97f)[_0x6336('0x3c')](function(_0x1502b7){logger[_0x6336('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x14fd37){return function(_0x21c7cf){return _0x21c7cf[_0x6336('0x2e')][_0x6336('0x3d')]()===_0x14fd37[_0x6336('0x3d')]();};}exports[_0x6336('0x3e')]=function(_0x21761b,_0x516ee6,_0x2dcd95,_0x479fc7){return function(_0x282203){try{var _0x5554b2={'name':_0x516ee6[0x0],'timeout':_0x516ee6[0x1]};var _0x106c74=queue[_0x6336('0x3f')](_0x5554b2,{'typecast':!![]});if(_0x106c74[_0x6336('0x40')]){logger[_0x6336('0x31')](_0x6336('0x41'),_0x21761b,_[_0x6336('0x42')](_0x106c74,'message')[_0x6336('0x43')](',\x20'));_0x282203['stop']();}else{var _0x1b41e5=_['find'](_0x2dcd95[_0x479fc7[_0x6336('0x24')]+_0x6336('0x44')],handleFindQueue(_0x5554b2[_0x6336('0x2e')]));if(_0x1b41e5){startRouting(_0x21761b,_0x1b41e5,_0x479fc7,_0x2dcd95);var _0x4b2c18=(_0x1b41e5['timeout']||0xa)*0x3e8;var _0x32c36f=(_0x5554b2[_0x6336('0x3a')]||0x14)*0x3e8;var _0x3578a7,_0x32edfb;if(_0x4b2c18>_0x32c36f){_0x32c36f=_0x4b2c18;}var _0x5c8873=seqqueue['createQueue'](_0x4b2c18);_0x5c8873['id']=_0x21761b;_0x5c8873[_0x6336('0x45')]=_0x4b2c18;_0x5c8873[_0x6336('0x46')]=_0x32c36f;_0x5c8873[_0x6336('0x24')]=_0x479fc7[_0x6336('0x24')];_0x2dcd95[_0x6336('0x47')][_0x21761b]['on']('end',function(){logger['info'](_0x6336('0x48'),_0x21761b);stopRouting(_0x21761b,_0x1b41e5,_0x479fc7,_0x2dcd95);clearTimeout(_0x3578a7);_0x3578a7=undefined;_0x5c8873[_0x6336('0x49')](!![]);if(_0x2dcd95[_0x6336('0x47')][_0x21761b]){delete _0x2dcd95[_0x6336('0x47')][_0x21761b];}_0x282203[_0x6336('0x4a')]();});_0x2dcd95[_0x6336('0x47')][_0x21761b]['on']('complete',function(){if(_0x2dcd95[_0x6336('0x47')][_0x21761b]){delete _0x2dcd95[_0x6336('0x47')][_0x21761b];}});_0x3578a7=setTimeout(function(){logger[_0x6336('0x2c')](_0x6336('0x4b'),_0x21761b);endRouting(_0x21761b,_0x1b41e5,_0x479fc7,_0x2dcd95);clearTimeout(_0x3578a7);_0x5c8873[_0x6336('0x49')](!![]);_0x282203[_0x6336('0x4c')]();},_0x32c36f);switch(_0x1b41e5['strategy']){case _0x6336('0x4d'):strategy[_0x6336('0x4d')](_0x5c8873,_0x1b41e5,_0x2dcd95,_0x479fc7);break;default:strategy[_0x6336('0x4e')](_0x5c8873,_0x1b41e5,_0x2dcd95,_0x479fc7);}}else{logger['error'](_0x6336('0x4f'),_0x21761b,_0x5554b2[_0x6336('0x2e')]);_0x282203[_0x6336('0x4a')]();}}}catch(_0x57ab79){console[_0x6336('0x50')](_0x57ab79);logger[_0x6336('0x31')]('[%s][QUEUE]\x20%s',_0x21761b,_0x57ab79['stack']);_0x282203[_0x6336('0x4a')]();}};}; \ No newline at end of file +var _0x7e6a=['consequence','length','[%s][QUEUE]\x20%s','map','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','validate','lodash','util','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','queue_id','joinAt','clone','queue','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','WebsiteId','info','name','QueueReport','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','catch','timeout','[%s][END:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase'];(function(_0x3bcc61,_0x4c432c){var _0x2a58d7=function(_0x46d2a5){while(--_0x46d2a5){_0x3bcc61['push'](_0x3bcc61['shift']());}};_0x2a58d7(++_0x4c432c);}(_0x7e6a,0xac));var _0xa7e6=function(_0x498cfa,_0x437497){_0x498cfa=_0x498cfa-0x0;var _0xb301c0=_0x7e6a[_0x498cfa];return _0xb301c0;};'use strict';var schema=require(_0xa7e6('0x0'));var _=require(_0xa7e6('0x1'));var util=require(_0xa7e6('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xa7e6('0x3'));var Redis=require(_0xa7e6('0x4'));var config=require(_0xa7e6('0x5'));var logger=require('../../../../config/logger')(_0xa7e6('0x6'));var strategy=require(_0xa7e6('0x7'));config[_0xa7e6('0x8')]=_[_0xa7e6('0x9')](config[_0xa7e6('0x8')],{'host':_0xa7e6('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa7e6('0x8')]));var attributes=['id',_0xa7e6('0xb'),'account','queue','from',_0xa7e6('0xc')];function emit(_0x39d943,_0x49d5d8,_0x3fe023){io['to'](_0x39d943)['emit'](_0x49d5d8,_0x3fe023);}function emitChannelQueueInteraction(_0x4a7f90,_0x5277a4,_0x5338e8,_0x187da4,_0xe02dff,_0x5bcdf8,_0x55f774,_0x584a18){var _0x398047=_[_0xa7e6('0xd')](_0x5338e8);_0x398047['queue_id']=_0x584a18;_0x398047[_0xa7e6('0xe')]=_0x5277a4;_0x398047[_0xa7e6('0xf')]=_0x187da4;_0x398047['id']=_0xe02dff;if(_0x5bcdf8){_0x55f774[util[_0xa7e6('0x10')](_0xa7e6('0x11'),_0x4a7f90)][_0xe02dff]=_[_0xa7e6('0x12')](_0x398047,attributes);}else{delete _0x55f774[util[_0xa7e6('0x10')]('%sQueuesWaitingInteractions',_0x4a7f90)][_0xe02dff];}emit(util['format'](_0xa7e6('0x13'),_0x4a7f90,_0x5277a4),util[_0xa7e6('0x10')](_0xa7e6('0x14'),_0x4a7f90,_0x5bcdf8?_0xa7e6('0x15'):_0xa7e6('0x16')),_['pick'](_0x398047,attributes));}var rpc={'openchannelQueueReport':require(_0xa7e6('0x17')),'mailQueueReport':require(_0xa7e6('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa7e6('0x19')),'faxQueueReport':require(_0xa7e6('0x1a')),'whatsappQueueReport':require(_0xa7e6('0x1b'))};var queue=schema({'name':{'type':_0xa7e6('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa7e6('0x1d'),'message':_0xa7e6('0x1e')}});function startRouting(_0x2b862c,_0x716719,_0x3138e7,_0x60951){if(_0x2b862c&&_0x716719&&_0x3138e7){_0x716719['waiting']+=0x1;var _0x2d4d83={'uniqueid':_0x2b862c,'from':_0x3138e7[_0xa7e6('0x1f')]?_0x3138e7[_0xa7e6('0x1f')][_0xa7e6('0x20')]:'','joinAt':moment()[_0xa7e6('0x10')](_0xa7e6('0x21')),'ContactId':_0x3138e7[_0xa7e6('0x22')]?_0x3138e7[_0xa7e6('0x22')]['id']:null,'ListId':_0x3138e7[_0xa7e6('0x23')]?_0x3138e7['list']['id']:null};_0x2d4d83[_[_0xa7e6('0x24')](_0x3138e7[_0xa7e6('0x25')])+'QueueId']=_0x716719['id']||null;_0x2d4d83[_[_0xa7e6('0x24')](_0x3138e7[_0xa7e6('0x25')])+'InteractionId']=_0x3138e7[_0xa7e6('0x26')]?_0x3138e7['interaction']['id']:null;_0x2d4d83[_[_0xa7e6('0x24')](_0x3138e7['channel'])+_0xa7e6('0x27')]=_0x3138e7[_0xa7e6('0x28')]?_0x3138e7['message']['id']:null;_0x2d4d83[_[_0xa7e6('0x24')](_0x3138e7[_0xa7e6('0x25')])+(_0x3138e7[_0xa7e6('0x25')]!=='chat'?'AccountId':_0xa7e6('0x29'))]=_0x3138e7[_0xa7e6('0xf')]?_0x3138e7[_0xa7e6('0xf')]['id']:null;logger[_0xa7e6('0x2a')](util[_0xa7e6('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x2b862c,_0x716719['name']));emitChannelQueueInteraction(_0x3138e7[_0xa7e6('0x25')],_0x716719[_0xa7e6('0x2b')],_0x2d4d83,_0x3138e7['account'][_0xa7e6('0x2b')],_0x3138e7['message']['id'],!![],_0x60951,_0x716719['id']);if(rpc[_0x3138e7[_0xa7e6('0x25')]+_0xa7e6('0x2c')]){return rpc[_0x3138e7[_0xa7e6('0x25')]+_0xa7e6('0x2c')]['create'](_0x2d4d83)['catch'](function(_0x46ee7a){logger[_0xa7e6('0x2d')](_0xa7e6('0x2e'));});}}}function stopRouting(_0x1131e8,_0x53b621,_0x61d1d8,_0x56951e){if(_0x1131e8&&_0x53b621){_0x53b621[_0xa7e6('0x2f')]-=0x1;var _0x416676={'leaveAt':moment()[_0xa7e6('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa7e6('0x10')](_0xa7e6('0x21')),'reason':_0xa7e6('0x30')};logger['info'](util[_0xa7e6('0x10')](_0xa7e6('0x31'),_0x1131e8,_0x53b621[_0xa7e6('0x2b')]));emitChannelQueueInteraction(_0x61d1d8[_0xa7e6('0x25')],_0x53b621[_0xa7e6('0x2b')],_0x61d1d8[_0xa7e6('0x1f')],_0x61d1d8[_0xa7e6('0xf')]['name'],_0x61d1d8['message']['id'],![],_0x56951e,_0x53b621['id']);if(rpc[_0x61d1d8[_0xa7e6('0x25')]+_0xa7e6('0x2c')]){return rpc[_0x61d1d8[_0xa7e6('0x25')]+_0xa7e6('0x2c')]['update'](_0x1131e8,_0x416676)[_0xa7e6('0x32')](function(_0x3b0a04){logger[_0xa7e6('0x2d')]('update\x20queue\x20report');});}}}function endRouting(_0x1852b9,_0x46f60b,_0xe9c88c,_0x4bc243){if(_0x1852b9&&_0x46f60b){_0x46f60b[_0xa7e6('0x2f')]-=0x1;var _0x157849={'leaveAt':moment()[_0xa7e6('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xa7e6('0x10')](_0xa7e6('0x21')),'reason':_0xa7e6('0x33')};logger[_0xa7e6('0x2a')](util[_0xa7e6('0x10')](_0xa7e6('0x34'),_0x1852b9,_0x46f60b[_0xa7e6('0x2b')]));emitChannelQueueInteraction(_0xe9c88c[_0xa7e6('0x25')],_0x46f60b[_0xa7e6('0x2b')],_0xe9c88c[_0xa7e6('0x1f')],_0xe9c88c[_0xa7e6('0xf')]['name'],_0xe9c88c[_0xa7e6('0x28')]['id'],![],_0x4bc243);if(rpc[_0xe9c88c[_0xa7e6('0x25')]+'QueueReport']){return rpc[_0xe9c88c['channel']+'QueueReport'][_0xa7e6('0x35')](_0x1852b9,_0x157849)[_0xa7e6('0x32')](function(_0xc9e420){logger['error'](_0xa7e6('0x36'));});}}}function handleFindQueue(_0x44f5e3){return function(_0x5465d1){return _0x5465d1['name']['toLowerCase']()===_0x44f5e3[_0xa7e6('0x37')]();};}exports[_0xa7e6('0x38')]=function(_0x4aa014,_0x33bd61,_0x1e4e2b,_0x4771e2){return function(_0xf0f9b1){try{var _0x885e9c={'name':_0x33bd61[0x0],'timeout':_0x33bd61[0x1]};var _0x475510=queue[_0xa7e6('0x0')](_0x885e9c,{'typecast':!![]});if(_0x475510[_0xa7e6('0x39')]){logger[_0xa7e6('0x2d')](_0xa7e6('0x3a'),_0x4aa014,_[_0xa7e6('0x3b')](_0x475510,_0xa7e6('0x28'))['join'](',\x20'));_0xf0f9b1[_0xa7e6('0x3c')]();}else{var _0x581837=_[_0xa7e6('0x3d')](_0x1e4e2b[_0x4771e2[_0xa7e6('0x25')]+'Queues'],handleFindQueue(_0x885e9c[_0xa7e6('0x2b')]));if(_0x581837){startRouting(_0x4aa014,_0x581837,_0x4771e2,_0x1e4e2b);var _0x4a40fb=(_0x581837['timeout']||0xa)*0x3e8;var _0x5c5d5b=(_0x885e9c[_0xa7e6('0x33')]||0x14)*0x3e8;var _0x237ca0,_0x3451bb;if(_0x4a40fb>_0x5c5d5b){_0x5c5d5b=_0x4a40fb;}var _0xa539e8=seqqueue[_0xa7e6('0x3e')](_0x4a40fb);_0xa539e8['id']=_0x4aa014;_0xa539e8[_0xa7e6('0x3f')]=_0x4a40fb;_0xa539e8[_0xa7e6('0x40')]=_0x5c5d5b;_0xa539e8[_0xa7e6('0x25')]=_0x4771e2['channel'];_0x1e4e2b[_0xa7e6('0x41')][_0x4aa014]['on'](_0xa7e6('0x42'),function(){logger[_0xa7e6('0x2a')](_0xa7e6('0x43'),_0x4aa014);stopRouting(_0x4aa014,_0x581837,_0x4771e2,_0x1e4e2b);clearTimeout(_0x237ca0);_0x237ca0=undefined;_0xa539e8[_0xa7e6('0x44')](!![]);if(_0x1e4e2b[_0xa7e6('0x41')][_0x4aa014]){delete _0x1e4e2b[_0xa7e6('0x41')][_0x4aa014];}_0xf0f9b1[_0xa7e6('0x3c')]();});_0x1e4e2b['rules'][_0x4aa014]['on'](_0xa7e6('0x45'),function(){if(_0x1e4e2b[_0xa7e6('0x41')][_0x4aa014]){delete _0x1e4e2b['rules'][_0x4aa014];}});_0x237ca0=setTimeout(function(){logger['info'](_0xa7e6('0x46'),_0x4aa014);endRouting(_0x4aa014,_0x581837,_0x4771e2,_0x1e4e2b);clearTimeout(_0x237ca0);_0xa539e8[_0xa7e6('0x44')](!![]);_0xf0f9b1[_0xa7e6('0x47')]();},_0x5c5d5b);switch(_0x581837[_0xa7e6('0x48')]){case'rrmemory':strategy[_0xa7e6('0x49')](_0xa539e8,_0x581837,_0x1e4e2b,_0x4771e2);break;default:strategy[_0xa7e6('0x4a')](_0xa539e8,_0x581837,_0x1e4e2b,_0x4771e2);}}else{logger[_0xa7e6('0x2d')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4aa014,_0x885e9c['name']);_0xf0f9b1[_0xa7e6('0x3c')]();}}}catch(_0x115975){console[_0xa7e6('0x4b')](_0x115975);logger[_0xa7e6('0x2d')](_0xa7e6('0x3a'),_0x4aa014,_0x115975['stack']);_0xf0f9b1[_0xa7e6('0x3c')]();}};}; \ 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 6653bc4..aa0d6fa 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 _0x6a88=['squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','writeLog',':FORCED','info','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','lodash','uuid','routing','notificationId'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0x6a88,0x78));var _0x86a8=function(_0x5660d5,_0x235c27){_0x5660d5=_0x5660d5-0x0;var _0x2a144d=_0x6a88[_0x5660d5];return _0x2a144d;};'use strict';var _=require(_0x86a8('0x0'));var uuid=require(_0x86a8('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x86a8('0x2'));var Agent=function(_0x2ff673,_0x5d075c,_0xe04d63,_0x18eee5){this[_0x86a8('0x3')]=uuid['v4']();this[_0x86a8('0x4')]=_0x2ff673;this[_0x86a8('0x5')]=_0x5d075c;this[_0x86a8('0x6')]=_0xe04d63;this[_0x86a8('0x2')]=_0x18eee5;this['squeue'][_0x86a8('0x7')](this[_0x86a8('0x8')][_0x86a8('0x9')](this),this[_0x86a8('0xa')][_0x86a8('0x9')](this));this[_0x86a8('0x4')]['on'](_0x86a8('0xb'),this['handleTimeout'][_0x86a8('0x9')](this));this[_0x86a8('0x4')]['on'](_0x86a8('0xc'),this[_0x86a8('0xd')][_0x86a8('0x9')](this));};Agent[_0x86a8('0xe')][_0x86a8('0x7')]=function(){this['squeue'][_0x86a8('0x7')](this[_0x86a8('0x8')][_0x86a8('0x9')](this),this[_0x86a8('0xa')][_0x86a8('0x9')](this));};Agent[_0x86a8('0xe')][_0x86a8('0xd')]=function(){this[_0x86a8('0xa')](!![]);};Agent[_0x86a8('0xe')][_0x86a8('0x8')]=function(_0x4a046b){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x86a8('0x4')]['id'],this[_0x86a8('0x5')]['id']);if(_[_0x86a8('0xf')](this['realtime'][_0x86a8('0x10')][this[_0x86a8('0x5')]['id']])){logger['info'](_0x86a8('0x11'),this[_0x86a8('0x4')]['id'],this[_0x86a8('0x5')]['id']);setTimeout(this[_0x86a8('0x7')]['bind'](this),0x3e8);}else{if(this[_0x86a8('0x2')][_0x86a8('0x12')]||util[_0x86a8('0x13')](this['squeue']['id'],this[_0x86a8('0x6')][_0x86a8('0x10')][this[_0x86a8('0x5')]['id']],this['squeue'][_0x86a8('0x14')],![])){this[_0x86a8('0x6')]['agents'][this[_0x86a8('0x5')]['id']]['busy']=!![];this[_0x86a8('0x6')][_0x86a8('0x10')][this[_0x86a8('0x5')]['id']][_0x86a8('0x15')]=undefined;util['showNotification'](this[_0x86a8('0x3')],this[_0x86a8('0x4')]['id'],this['realtime'][_0x86a8('0x10')][this['agent']['id']],null,this[_0x86a8('0x2')]);util[_0x86a8('0x16')](this[_0x86a8('0x4')]['id'],this[_0x86a8('0x6')]['agents'][this[_0x86a8('0x5')]['id']],'RINGING'+(this[_0x86a8('0x2')]['forcedOwnership']?_0x86a8('0x17'):''));}else{logger[_0x86a8('0x18')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x86a8('0x4')]['id'],this[_0x86a8('0x5')]['id']);setTimeout(this['push'][_0x86a8('0x9')](this),0x3e8);}}};Agent[_0x86a8('0xe')][_0x86a8('0xa')]=function(_0x222125){if(_[_0x86a8('0xf')](this[_0x86a8('0x6')]['agents'][this[_0x86a8('0x5')]['id']])){return logger[_0x86a8('0x18')](_0x86a8('0x11'),this['squeue']['id'],this[_0x86a8('0x5')]['id']);}else{logger['info'](_0x86a8('0x19'),this[_0x86a8('0x4')]['id'],this[_0x86a8('0x5')]['id']);util[_0x86a8('0x1a')](this[_0x86a8('0x3')],this['squeue']['id'],this[_0x86a8('0x6')][_0x86a8('0x10')][this[_0x86a8('0x5')]['id']],null,this[_0x86a8('0x2')]);this['realtime'][_0x86a8('0x10')][this[_0x86a8('0x5')]['id']][_0x86a8('0x1b')]=![];this[_0x86a8('0x6')][_0x86a8('0x10')][this[_0x86a8('0x5')]['id']][_0x86a8('0x15')]=undefined;util[_0x86a8('0x16')](this[_0x86a8('0x4')]['id'],this[_0x86a8('0x6')][_0x86a8('0x10')][this['agent']['id']],_0x222125?_0x86a8('0x1c'):_0x86a8('0x1d'));}if(!_0x222125){setTimeout(this[_0x86a8('0x7')]['bind'](this),0x3e8);}};function agent(_0x3a92f2,_0x141037,_0x5562e5,_0x3f0be1){return new Agent(_0x3a92f2,_0x141037,_0x5562e5,_0x3f0be1);}module[_0x86a8('0x1e')]=agent; \ No newline at end of file +var _0x059b=['routing','squeue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agents','push','forcedOwnership','isAgentAvailable','channel','busy','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busyQueue','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','agent','realtime'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x059b,0x157));var _0xb059=function(_0x266ad2,_0x561095){_0x266ad2=_0x266ad2-0x0;var _0x499c62=_0x059b[_0x266ad2];return _0x499c62;};'use strict';var _=require(_0xb059('0x0'));var uuid=require(_0xb059('0x1'));var util=require(_0xb059('0x2'));var logger=require(_0xb059('0x3'))('routing');var Agent=function(_0x5a0967,_0x2094c2,_0x142e36,_0x1f7b33){this[_0xb059('0x4')]=uuid['v4']();this['squeue']=_0x5a0967;this[_0xb059('0x5')]=_0x2094c2;this[_0xb059('0x6')]=_0x142e36;this[_0xb059('0x7')]=_0x1f7b33;this[_0xb059('0x8')]['push'](this[_0xb059('0x9')][_0xb059('0xa')](this),this[_0xb059('0xb')][_0xb059('0xa')](this));this[_0xb059('0x8')]['on'](_0xb059('0xc'),this['handleTimeout'][_0xb059('0xa')](this));this[_0xb059('0x8')]['on'](_0xb059('0xd'),this[_0xb059('0xe')]['bind'](this));};Agent[_0xb059('0xf')]['push']=function(){this[_0xb059('0x8')]['push'](this['handleRun'][_0xb059('0xa')](this),this[_0xb059('0xb')][_0xb059('0xa')](this));};Agent[_0xb059('0xf')]['handleDrained']=function(){this[_0xb059('0xb')](!![]);};Agent[_0xb059('0xf')][_0xb059('0x9')]=function(_0x287cfe){logger[_0xb059('0x10')](_0xb059('0x11'),this[_0xb059('0x8')]['id'],this[_0xb059('0x5')]['id']);if(_['isNil'](this[_0xb059('0x6')][_0xb059('0x12')][this[_0xb059('0x5')]['id']])){logger[_0xb059('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xb059('0x5')]['id']);setTimeout(this[_0xb059('0x13')]['bind'](this),0x3e8);}else{if(this[_0xb059('0x7')][_0xb059('0x14')]||util[_0xb059('0x15')](this[_0xb059('0x8')]['id'],this['realtime']['agents'][this[_0xb059('0x5')]['id']],this[_0xb059('0x8')][_0xb059('0x16')],![])){this[_0xb059('0x6')][_0xb059('0x12')][this[_0xb059('0x5')]['id']][_0xb059('0x17')]=!![];this['realtime'][_0xb059('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0xb059('0x18')](this[_0xb059('0x4')],this[_0xb059('0x8')]['id'],this[_0xb059('0x6')][_0xb059('0x12')][this[_0xb059('0x5')]['id']],null,this[_0xb059('0x7')]);util['writeLog'](this['squeue']['id'],this['realtime'][_0xb059('0x12')][this[_0xb059('0x5')]['id']],_0xb059('0x19')+(this[_0xb059('0x7')][_0xb059('0x14')]?_0xb059('0x1a'):''));}else{logger[_0xb059('0x10')](_0xb059('0x1b'),this[_0xb059('0x8')]['id'],this[_0xb059('0x5')]['id']);setTimeout(this[_0xb059('0x13')]['bind'](this),0x3e8);}}};Agent[_0xb059('0xf')]['handleTimeout']=function(_0x5b5409){if(_[_0xb059('0x1c')](this['realtime'][_0xb059('0x12')][this[_0xb059('0x5')]['id']])){return logger[_0xb059('0x10')](_0xb059('0x1d'),this[_0xb059('0x8')]['id'],this['agent']['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xb059('0x8')]['id'],this[_0xb059('0x5')]['id']);util['hideNotification'](this['notificationId'],this['squeue']['id'],this[_0xb059('0x6')]['agents'][this[_0xb059('0x5')]['id']],null,this[_0xb059('0x7')]);this[_0xb059('0x6')][_0xb059('0x12')][this['agent']['id']][_0xb059('0x17')]=![];this[_0xb059('0x6')][_0xb059('0x12')][this[_0xb059('0x5')]['id']][_0xb059('0x1e')]=undefined;util[_0xb059('0x1f')](this[_0xb059('0x8')]['id'],this[_0xb059('0x6')][_0xb059('0x12')][this[_0xb059('0x5')]['id']],_0x5b5409?_0xb059('0x20'):_0xb059('0x21'));}if(!_0x5b5409){setTimeout(this[_0xb059('0x13')][_0xb059('0xa')](this),0x3e8);}};function agent(_0x2aa004,_0x3668ec,_0x15b5f1,_0x35ce71){return new Agent(_0x2aa004,_0x3668ec,_0x15b5f1,_0x35ce71);}module[_0xb059('0x22')]=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 a8e264a..f29b077 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 _0x5292=['uuid','../../../../../config/logger','squeue','push','handleTimeout','bind','timeout','drained','handleDrained','prototype','handleRun','isNil','queue','Agents','realtime','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','notificationId','routing','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','exports','lodash'];(function(_0x209fb6,_0x1a5849){var _0x35cfb3=function(_0x5ebc10){while(--_0x5ebc10){_0x209fb6['push'](_0x209fb6['shift']());}};_0x35cfb3(++_0x1a5849);}(_0x5292,0xf7));var _0x2529=function(_0x26d51f,_0x1de895){_0x26d51f=_0x26d51f-0x0;var _0x48305d=_0x5292[_0x26d51f];return _0x48305d;};'use strict';var _=require(_0x2529('0x0'));var uuid=require(_0x2529('0x1'));var util=require('./util');var logger=require(_0x2529('0x2'))('routing');var Beepall=function(_0x1540a9,_0x2b088,_0x29576c,_0x228165){this['notificationId']=uuid['v4']();this[_0x2529('0x3')]=_0x1540a9;this['queue']=_0x2b088;this['realtime']=_0x29576c;this['routing']=_0x228165;this[_0x2529('0x3')][_0x2529('0x4')](this['handleRun']['bind'](this),this[_0x2529('0x5')][_0x2529('0x6')](this));this['squeue']['on'](_0x2529('0x7'),this[_0x2529('0x5')][_0x2529('0x6')](this));this[_0x2529('0x3')]['on'](_0x2529('0x8'),this[_0x2529('0x9')][_0x2529('0x6')](this));};Beepall[_0x2529('0xa')]['push']=function(){this[_0x2529('0x3')][_0x2529('0x4')](this['handleRun'][_0x2529('0x6')](this),this[_0x2529('0x5')][_0x2529('0x6')](this));};Beepall[_0x2529('0xa')][_0x2529('0x9')]=function(_0x31c39c){this[_0x2529('0x5')](!![]);};Beepall['prototype'][_0x2529('0xb')]=function(_0x164dd7){var _0x301eec=!![];if(!_[_0x2529('0xc')](this[_0x2529('0xd')])&&!_[_0x2529('0xc')](this[_0x2529('0xd')][_0x2529('0xe')])&&this['queue'][_0x2529('0xe')]['length']>0x0){for(var _0x337720=0x0,_0x3d73c4;_0x3377200x0){for(var _0x2d3aa6=0x0,_0x24b490;_0x2d3aa60x0&&_0x7a9f9e[_0x5ef1b1+_0x47a5('0x23')]>=_0x7a9f9e[_0x5ef1b1+'Capacity']){writeLog(_0x23db32,_0x7a9f9e,_0x5ef1b1[_0x47a5('0x24')]()+_0x47a5('0x25'));return![];}}return!![];};exports[_0x47a5('0x26')]=function(_0x1dac65,_0x21f296,_0x3ba0b7,_0x24b162,_0x136b14){return sendNotification(!![],_0x1dac65,_0x21f296,_0x3ba0b7,_0x24b162,_0x136b14);};exports[_0x47a5('0x27')]=function(_0x361bfa,_0x1127f8,_0x11a4fa,_0x3ad507,_0x528582){return sendNotification(![],_0x361bfa,_0x1127f8,_0x11a4fa,_0x3ad507,_0x528582);};exports[_0x47a5('0x28')]=writeLog; \ No newline at end of file +var _0xa456=['name','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','user:%s'];(function(_0x131b2c,_0x561eb7){var _0x3cb5c8=function(_0x3761d8){while(--_0x3761d8){_0x131b2c['push'](_0x131b2c['shift']());}};_0x3cb5c8(++_0x561eb7);}(_0xa456,0x142));var _0x6a45=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xa456[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var utils=require(_0x6a45('0x2'));var Mustache=require(_0x6a45('0x3'));var Redis=require('ioredis');var config=require(_0x6a45('0x4'));var logger=require(_0x6a45('0x5'))(_0x6a45('0x6'));config['redis']=_[_0x6a45('0x7')](config[_0x6a45('0x8')],{'host':_0x6a45('0x9'),'port':0x18eb});var io=require(_0x6a45('0xa'))(new Redis(config['redis']));function emit(_0x25cf8d,_0x26bfc0,_0x214514){io['to'](_0x25cf8d)[_0x6a45('0xb')](_0x26bfc0,_0x214514);}function sendNotification(_0x3deb09,_0x4858df,_0x3a5c20,_0x517040,_0x36378a,_0x3a9671){io['to'](util[_0x6a45('0xc')](_0x6a45('0xd'),_0x517040[_0x6a45('0xe')]))['emit']('user:save',_0x517040);var _0xe62823=_0x3a9671||{};var _0x465b59=_0x3a5c20['split']('.');var _0x5a39f6={'uniqueid':_0x4858df,'channel':_0x465b59[0x0],'id':_0x465b59[0x1],'title':_0x465b59[0x0]+'\x20interaction','interactionId':_0x465b59[0x2],'queue':_0x36378a?_0x36378a[_0x6a45('0xe')]:null,'sound':_0xe62823[_0x6a45('0xf')][_0x6a45('0x10')],'shake':_0xe62823[_0x6a45('0xf')][_0x6a45('0x11')]};try{if(!_0xe62823['body']){_0xe62823['body']={};}if(_0x36378a){_0xe62823[_0x6a45('0x12')][_0x6a45('0x13')]=_0x36378a;}else if(_0xe62823['body'][_0x6a45('0x13')]){delete _0xe62823[_0x6a45('0x12')][_0x6a45('0x13')];}_0x5a39f6[_0x6a45('0x14')]=utils['getMustacheRender'](_0xe62823['account']['notificationTemplate'],_0xe62823);}catch(_0x396d7d){_0x5a39f6[_0x6a45('0x14')]=_0x6a45('0x15');logger['error'](util[_0x6a45('0xc')](_0x6a45('0x16'),_0x4858df,_0x396d7d[_0x6a45('0x17')]));}io['to'](util['format']('user:%s',_0x517040['name']))[_0x6a45('0xb')](util[_0x6a45('0xc')]('notification:%s',_0x3deb09?_0x6a45('0x18'):_0x6a45('0x19')),_0x5a39f6);}function writeLog(_0x4f7000,_0x4f7110,_0xdf10c6){return logger[_0x6a45('0x1a')](util[_0x6a45('0xc')](_0x6a45('0x1b'),_0x4f7000,_0x4f7110['name'],_0xdf10c6));}exports['isAgentAvailable']=function(_0x3faae5,_0x59af4b,_0x11290c,_0x22373c){if(_0x59af4b[_0x6a45('0x1c')]){writeLog(_0x3faae5,_0x59af4b,_0x6a45('0x1d'));return![];}if(!_0x59af4b[_0x6a45('0x1e')]){writeLog(_0x3faae5,_0x59af4b,_0x6a45('0x1f'));return![];}if(_0x59af4b[_0x11290c+_0x6a45('0x20')]){writeLog(_0x3faae5,_0x59af4b,_0x6a45('0x21'));return![];}if(_0x22373c&&_0x59af4b[_0x6a45('0x22')](_0x11290c+_0x6a45('0x23'))&&_0x59af4b['hasOwnProperty'](_0x11290c+_0x6a45('0x24'))){if(_0x59af4b[_0x11290c+'Capacity']>0x0&&_0x59af4b[_0x11290c+_0x6a45('0x24')]>=_0x59af4b[_0x11290c+_0x6a45('0x23')]){writeLog(_0x3faae5,_0x59af4b,_0x11290c[_0x6a45('0x25')]()+_0x6a45('0x26'));return![];}}return!![];};exports[_0x6a45('0x27')]=function(_0x526062,_0x2b8cc8,_0x308003,_0x4770cc,_0x1ccff0){return sendNotification(!![],_0x526062,_0x2b8cc8,_0x308003,_0x4770cc,_0x1ccff0);};exports[_0x6a45('0x28')]=function(_0x227b6f,_0x3fac9b,_0x313c13,_0x54286d,_0x14adb5){return sendNotification(![],_0x227b6f,_0x3fac9b,_0x313c13,_0x54286d,_0x14adb5);};exports[_0x6a45('0x29')]=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 110a4ea..13c590b 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 _0xf378=['[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body'];(function(_0x5b7606,_0x3367ef){var _0x186584=function(_0x3ba49d){while(--_0x3ba49d){_0x5b7606['push'](_0x5b7606['shift']());}};_0x186584(++_0x3367ef);}(_0xf378,0x18a));var _0x8f37=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf378[_0x19950b];return _0x3c6b41;};'use strict';var schema=require(_0x8f37('0x0'));var sh=require('shelljs');var _=require(_0x8f37('0x1'));var utils=require(_0x8f37('0x2'));var logger=require(_0x8f37('0x3'))(_0x8f37('0x4'));var system=schema({'command':{'type':_0x8f37('0x5'),'required':!![],'message':_0x8f37('0x6')}});exports[_0x8f37('0x7')]=function(_0x32327e,_0x494de6){return function(_0xafe579){try{var _0x5a9c48={'command':_0x494de6[0x0]};var _0x4e509f=system['validate'](_0x5a9c48,{'typecast':!![]});if(_0x4e509f[_0x8f37('0x8')]){logger[_0x8f37('0x9')](_0x8f37('0xa'),_0x32327e,_[_0x8f37('0xb')](_0x4e509f,_0x8f37('0xc'))[_0x8f37('0xd')](',\x20'));logger[_0x8f37('0xe')](_0x8f37('0xf'),_0x32327e);_0xafe579[_0x8f37('0x10')]();}else{var _0x4d3960=this;var _0x5060e3=utils[_0x8f37('0x11')](_0x494de6[0x0],this);logger[_0x8f37('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x32327e,_0x5060e3);sh[_0x8f37('0x12')](_[_0x8f37('0x13')](_0x5060e3),function(_0xf86e32,_0x40063){logger[_0x8f37('0xe')](_0x8f37('0x14'),_0x32327e,_0xf86e32);if(_0xf86e32==0x0){var _0x3ac1fe=_0x40063[_0x8f37('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0x8f37('0x16')](_0x494de6[0x1])||_[_0x8f37('0x17')](_0x494de6[0x1])){logger[_0x8f37('0xe')](_0x8f37('0x18'),_0x32327e);_0x4d3960[_0x8f37('0x19')][_0x494de6[0x1]]=_0x3ac1fe;}else{logger['info'](_0x8f37('0x1a'),_0x32327e,_0x494de6[0x1],_0x3ac1fe);_0x4d3960[_0x8f37('0x19')][_0x494de6[0x1]]=_0x3ac1fe;}}_0xafe579[_0x8f37('0x10')]();});}}catch(_0x2f6c12){logger[_0x8f37('0x9')](_0x8f37('0xa'),_0x32327e,_['isObject'](_0x2f6c12)?JSON[_0x8f37('0x1b')](_0x2f6c12):_0x2f6c12);logger[_0x8f37('0xe')](_0x8f37('0xf'),_0x32327e);_0xafe579[_0x8f37('0x10')]();}};}; \ No newline at end of file +var _0x80f7=['next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x392640,_0x22ca02){var _0x553033=function(_0x5a7f01){while(--_0x5a7f01){_0x392640['push'](_0x392640['shift']());}};_0x553033(++_0x22ca02);}(_0x80f7,0x110));var _0x780f=function(_0xf47605,_0x22a2f5){_0xf47605=_0xf47605-0x0;var _0x33bee8=_0x80f7[_0xf47605];return _0x33bee8;};'use strict';var schema=require(_0x780f('0x0'));var sh=require(_0x780f('0x1'));var _=require(_0x780f('0x2'));var utils=require(_0x780f('0x3'));var logger=require(_0x780f('0x4'))(_0x780f('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x780f('0x6')}});exports[_0x780f('0x7')]=function(_0x38b680,_0x2848b2){return function(_0x4ad83b){try{var _0x5c5557={'command':_0x2848b2[0x0]};var _0x16baad=system[_0x780f('0x0')](_0x5c5557,{'typecast':!![]});if(_0x16baad[_0x780f('0x8')]){logger['error'](_0x780f('0x9'),_0x38b680,_['map'](_0x16baad,_0x780f('0xa'))[_0x780f('0xb')](',\x20'));logger[_0x780f('0xc')](_0x780f('0xd'),_0x38b680);_0x4ad83b[_0x780f('0xe')]();}else{var _0xec7f49=this;var _0x39a872=utils[_0x780f('0xf')](_0x2848b2[0x0],this);logger[_0x780f('0xc')](_0x780f('0x10'),_0x38b680,_0x39a872);sh[_0x780f('0x11')](_[_0x780f('0x12')](_0x39a872),function(_0x27d2b7,_0x4ef7c2){logger['info'](_0x780f('0x13'),_0x38b680,_0x27d2b7);if(_0x27d2b7==0x0){var _0x377148=_0x4ef7c2['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x2848b2[0x1])||_[_0x780f('0x14')](_0x2848b2[0x1])){logger[_0x780f('0xc')](_0x780f('0x15'),_0x38b680);_0xec7f49[_0x780f('0x16')][_0x2848b2[0x1]]=_0x377148;}else{logger['info'](_0x780f('0x17'),_0x38b680,_0x2848b2[0x1],_0x377148);_0xec7f49[_0x780f('0x16')][_0x2848b2[0x1]]=_0x377148;}}_0x4ad83b[_0x780f('0xe')]();});}}catch(_0x5660c9){logger[_0x780f('0x18')]('[%s][SYSTEM]\x20%s',_0x38b680,_['isObject'](_0x5660c9)?JSON[_0x780f('0x19')](_0x5660c9):_0x5660c9);logger[_0x780f('0xc')](_0x780f('0xd'),_0x38b680);_0x4ad83b[_0x780f('0xe')]();}};}; \ 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 9607e3d..befe9f0 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 _0xf80e=['../../rpc/mailInteraction','../../rpc/faxInteraction','routing','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','isObject','stringify','validate','../../rpc/chatInteraction','../../rpc/smsInteraction'];(function(_0x151e75,_0x491df9){var _0x50395b=function(_0x2e8b47){while(--_0x2e8b47){_0x151e75['push'](_0x151e75['shift']());}};_0x50395b(++_0x491df9);}(_0xf80e,0x189));var _0xef80=function(_0x45e5d2,_0xb508c5){_0x45e5d2=_0x45e5d2-0x0;var _0x382c5a=_0xf80e[_0x45e5d2];return _0x382c5a;};'use strict';var schema=require(_0xef80('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xef80('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xef80('0x2')),'mailInteraction':require(_0xef80('0x3')),'faxInteraction':require(_0xef80('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xef80('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xef80('0x6')]=function(_0x590d35,_0x2684d8,_0x2a85ed,_0x3f0796){return function(_0x23fa44){try{var _0xbbadf5={'tag':_0x2684d8[0x0]};var _0x5e408c=tag[_0xef80('0x0')](_0xbbadf5,{'typecast':!![]});if(_0x5e408c[_0xef80('0x7')]){logger[_0xef80('0x8')](_0xef80('0x9'),_0x590d35,_[_0xef80('0xa')](_0x5e408c,_0xef80('0xb'))[_0xef80('0xc')](',\x20'));logger[_0xef80('0xd')](_0xef80('0xe'),_0x590d35);_0x23fa44[_0xef80('0xf')]();}else{var _0xd9af0b={'ids':[_0x2684d8[0x0]]};if(rpc[_0x3f0796[_0xef80('0x10')]+_0xef80('0x11')]){rpc[_0x3f0796[_0xef80('0x10')]+_0xef80('0x11')]['addTags'](_0x3f0796[_0xef80('0x12')]['id'],_0xd9af0b)['then'](function(_0xb01789){logger['info'](_0xef80('0x13'),_0x590d35,_0x2684d8[0x1],_0x3f0796[_0xef80('0x10')],_0x3f0796[_0xef80('0x12')]['id']);})['catch'](function(_0x4276bb){logger[_0xef80('0x8')](_0xef80('0x9'),_0x590d35,JSON['stringify'](_0x4276bb));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x590d35);})['finally'](function(){_0x23fa44[_0xef80('0xf')]();});}}}catch(_0x2a10b9){logger[_0xef80('0x8')](_0xef80('0x9'),_0x590d35,_[_0xef80('0x14')](_0x2a10b9)?JSON[_0xef80('0x15')](_0x2a10b9):_0x2a10b9);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x590d35);_0x23fa44[_0xef80('0xf')]();}};}; \ No newline at end of file +var _0xe3e6=['finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','next','channel','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe3e6,0xda));var _0x6e3e=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0xe3e6[_0x1dd532];return _0x3732aa;};'use strict';var schema=require('validate');var _=require(_0x6e3e('0x0'));var rpc={'chatInteraction':require(_0x6e3e('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6e3e('0x2')),'mailInteraction':require(_0x6e3e('0x3')),'faxInteraction':require(_0x6e3e('0x4')),'whatsappInteraction':require(_0x6e3e('0x5'))};var logger=require(_0x6e3e('0x6'))(_0x6e3e('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x6e3e('0x8')}});exports[_0x6e3e('0x9')]=function(_0xd8ac2f,_0x456e61,_0x4c2f22,_0x54039d){return function(_0x5e4d8e){try{var _0x4f2fa5={'tag':_0x456e61[0x0]};var _0x1121e0=tag['validate'](_0x4f2fa5,{'typecast':!![]});if(_0x1121e0[_0x6e3e('0xa')]){logger[_0x6e3e('0xb')](_0x6e3e('0xc'),_0xd8ac2f,_[_0x6e3e('0xd')](_0x1121e0,'message')[_0x6e3e('0xe')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xd8ac2f);_0x5e4d8e[_0x6e3e('0xf')]();}else{var _0x5d1b7b={'ids':[_0x456e61[0x0]]};if(rpc[_0x54039d[_0x6e3e('0x10')]+_0x6e3e('0x11')]){rpc[_0x54039d['channel']+'Interaction']['addTags'](_0x54039d[_0x6e3e('0x12')]['id'],_0x5d1b7b)[_0x6e3e('0x13')](function(_0x41e324){logger[_0x6e3e('0x14')](_0x6e3e('0x15'),_0xd8ac2f,_0x456e61[0x1],_0x54039d[_0x6e3e('0x10')],_0x54039d[_0x6e3e('0x12')]['id']);})[_0x6e3e('0x16')](function(_0x4b5f4f){logger['error']('[%s][TAG]\x20%s',_0xd8ac2f,JSON[_0x6e3e('0x17')](_0x4b5f4f));logger['info'](_0x6e3e('0x18'),_0xd8ac2f);})[_0x6e3e('0x19')](function(){_0x5e4d8e[_0x6e3e('0xf')]();});}}}catch(_0x232cb7){logger['error']('[%s][TAG]\x20%s',_0xd8ac2f,_[_0x6e3e('0x1a')](_0x232cb7)?JSON[_0x6e3e('0x17')](_0x232cb7):_0x232cb7);logger[_0x6e3e('0x14')](_0x6e3e('0x18'),_0xd8ac2f);_0x5e4d8e[_0x6e3e('0xf')]();}};}; \ 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 de1ac53..b53679e 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 _0xd4a7=['then','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','[%s][TVOX]\x20%s','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace','includes','push','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','utf8','application/json-rpc'];(function(_0x3b44f4,_0x345b35){var _0xb939c7=function(_0x1496a7){while(--_0x1496a7){_0x3b44f4['push'](_0x3b44f4['shift']());}};_0xb939c7(++_0x345b35);}(_0xd4a7,0x18e));var _0x7d4a=function(_0x342ee1,_0x3bb44f){_0x342ee1=_0x342ee1-0x0;var _0x1387c7=_0xd4a7[_0x342ee1];return _0x1387c7;};'use strict';var rp=require(_0x7d4a('0x0'));var logger=require(_0x7d4a('0x1'))('routing');var _=require(_0x7d4a('0x2'));var arr=[];exports[_0x7d4a('0x3')]=function(_0x5b4791,_0x473ce7){return function(_0x3c2457){var _0x332a41=_0x473ce7[0xa];var _0xa4f648=_0x473ce7[0xb];var _0x2ca5dd=_0x473ce7[0xc];var _0x5db981=_0x473ce7[0xd];var _0x128093=_0x473ce7[0xe];var _0x485680=_0x473ce7[0xf][_0x7d4a('0x4')](/\n/g,'\x20-\x20');var _0x46583d=_0x473ce7[0x10][_0x7d4a('0x4')](/\n/g,'\x20');if(!arr[_0x7d4a('0x5')](_0xa4f648)){arr[_0x7d4a('0x6')](_0xa4f648);var _0x24fa1f=_0x473ce7[0x3];var _0x5a3cf5=_0x473ce7[0x4];var _0xff7e0=_0x473ce7[0x1];var _0x164f54=_0x473ce7[0x0];var _0x1acd8f={};_0x1acd8f['urlOnAnswer']=_0x473ce7[0x8]+_0x7d4a('0x7')+_0x2ca5dd+'|'+_0x332a41+'|'+_0x5db981+'|'+_0xa4f648+'|'+_0x128093;_0x1acd8f[_0x7d4a('0x8')]=_0x473ce7[0x7]+_0x7d4a('0x7')+_0x2ca5dd+'|'+_0x332a41+'|'+_0x5db981+'|'+_0xa4f648+'|'+_0x128093+'|'+_0x485680+'|'+_0x46583d;_0x1acd8f[_0x7d4a('0x9')]=_0x473ce7[0x9];var _0x2a8215={};_0x2a8215[_0x7d4a('0xa')]=_0x7d4a('0xb');_0x2a8215[_0x7d4a('0xc')]=_0x7d4a('0xd');var _0xfb15ad=[];_0xfb15ad[_0x7d4a('0x6')](_0x473ce7[0x2]);_0xfb15ad['push'](_0x473ce7[0x5]);_0xfb15ad[_0x7d4a('0x6')](_0x473ce7[0x6]);_0x2a8215[_0x7d4a('0xe')]=_0xfb15ad;_0x2a8215['id']=0x1;var _0x5e4ec7=JSON[_0x7d4a('0xf')](_0x2a8215);var _0x11901c={'encoding':_0x7d4a('0x10'),'method':'POST','timeout':0x2710,'url':_0x24fa1f,'headers':{'Content-Type':_0x7d4a('0x11')},'body':_0x5e4ec7};return rp(_0x11901c)[_0x7d4a('0x12')](function(_0x7ba8d3){const _0x44f456=JSON['parse'](_0x7ba8d3);if(!_0x44f456['result'][_0x7d4a('0x13')]){throw new Error(_0x7d4a('0x14'));}var _0x34a209=_0xa4f648;var _0x546c14=_0x7d4a('0x15')+_0xff7e0+_0x7d4a('0x16')+_0x164f54+_0x7d4a('0x17')+_0x34a209+_0x7d4a('0x18')+JSON['stringify'](_0x1acd8f);var _0x505024=_0x5a3cf5+'?'+_0x546c14;return rp(_0x505024);})[_0x7d4a('0x12')](function(_0x11287e){logger[_0x7d4a('0x19')](_0x7d4a('0x1a'),_0x5b4791,_0x11287e);_0x3c2457['stop']();})['catch'](function(_0x49f0c2){logger[_0x7d4a('0x1b')](_0x7d4a('0x1c'),_0x5b4791,_['isObject'](_0x49f0c2)?JSON['stringify'](_0x49f0c2):_0x49f0c2);_0x3c2457[_0x7d4a('0x1d')]();});}else{logger[_0x7d4a('0x19')](_0x7d4a('0x1e'),_0x5b4791);_0x3c2457[_0x7d4a('0x1f')]();}};}; \ No newline at end of file +var _0xb57c=['catch','isObject','next','request-promise','../../../../config/logger','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','stringify','utf8','POST','application/json-rpc','parse','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop'];(function(_0xd6cbc7,_0x32f50d){var _0x7b388b=function(_0x23c536){while(--_0x23c536){_0xd6cbc7['push'](_0xd6cbc7['shift']());}};_0x7b388b(++_0x32f50d);}(_0xb57c,0x11b));var _0xcb57=function(_0x5597c9,_0x36f185){_0x5597c9=_0x5597c9-0x0;var _0xabdb4f=_0xb57c[_0x5597c9];return _0xabdb4f;};'use strict';var rp=require(_0xcb57('0x0'));var logger=require(_0xcb57('0x1'))('routing');var _=require(_0xcb57('0x2'));var arr=[];exports[_0xcb57('0x3')]=function(_0x888f6d,_0x16176d){return function(_0x5c6419){var _0xc7794f=_0x16176d[0xa];var _0x3db639=_0x16176d[0xb];var _0x5ecc19=_0x16176d[0xc];var _0x3a9bc3=_0x16176d[0xd];var _0x3ffdaf=_0x16176d[0xe];var _0x1e6c27=_0x16176d[0xf][_0xcb57('0x4')](/\n/g,'\x20-\x20');var _0x20965b=_0x16176d[0x10][_0xcb57('0x4')](/\n/g,'\x20');if(!arr[_0xcb57('0x5')](_0x3db639)){arr[_0xcb57('0x6')](_0x3db639);var _0x1a0001=_0x16176d[0x3];var _0x5829a4=_0x16176d[0x4];var _0x47991a=_0x16176d[0x1];var _0x223c67=_0x16176d[0x0];var _0x3119d6={};_0x3119d6[_0xcb57('0x7')]=_0x16176d[0x8]+_0xcb57('0x8')+_0x5ecc19+'|'+_0xc7794f+'|'+_0x3a9bc3+'|'+_0x3db639+'|'+_0x3ffdaf;_0x3119d6[_0xcb57('0x9')]=_0x16176d[0x7]+'?params='+_0x5ecc19+'|'+_0xc7794f+'|'+_0x3a9bc3+'|'+_0x3db639+'|'+_0x3ffdaf+'|'+_0x1e6c27+'|'+_0x20965b;_0x3119d6[_0xcb57('0xa')]=_0x16176d[0x9];var _0x1d877e={};_0x1d877e['jsonrpc']=_0xcb57('0xb');_0x1d877e[_0xcb57('0xc')]=_0xcb57('0xd');var _0x5026e4=[];_0x5026e4[_0xcb57('0x6')](_0x16176d[0x2]);_0x5026e4[_0xcb57('0x6')](_0x16176d[0x5]);_0x5026e4[_0xcb57('0x6')](_0x16176d[0x6]);_0x1d877e['params']=_0x5026e4;_0x1d877e['id']=0x1;var _0x2a8b06=JSON[_0xcb57('0xe')](_0x1d877e);var _0x292b97={'encoding':_0xcb57('0xf'),'method':_0xcb57('0x10'),'timeout':0x2710,'url':_0x1a0001,'headers':{'Content-Type':_0xcb57('0x11')},'body':_0x2a8b06};return rp(_0x292b97)['then'](function(_0x2b114e){const _0x58b0d4=JSON[_0xcb57('0x12')](_0x2b114e);if(!_0x58b0d4['result']['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0xb622a6=_0x3db639;var _0x2e6b6d=_0xcb57('0x13')+_0x47991a+_0xcb57('0x14')+_0x223c67+'&sessionId='+_0xb622a6+_0xcb57('0x15')+JSON[_0xcb57('0xe')](_0x3119d6);var _0x420b22=_0x5829a4+'?'+_0x2e6b6d;return rp(_0x420b22);})['then'](function(_0x5b23af){logger[_0xcb57('0x16')](_0xcb57('0x17'),_0x888f6d,_0x5b23af);_0x5c6419[_0xcb57('0x18')]();})[_0xcb57('0x19')](function(_0x5f2bd2){logger['error']('[%s][TVOX]\x20%s',_0x888f6d,_[_0xcb57('0x1a')](_0x5f2bd2)?JSON['stringify'](_0x5f2bd2):_0x5f2bd2);_0x5c6419['stop']();});}else{logger[_0xcb57('0x16')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x888f6d);_0x5c6419[_0xcb57('0x1b')]();}};}; \ 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 84b2013..71f7e97 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(_0xc8adf2,_0x484ec2){var _0x22eb64=function(_0x295bf4){while(--_0x295bf4){_0xc8adf2['push'](_0xc8adf2['shift']());}};_0x22eb64(++_0x484ec2);}(_0xe706,0xa3));var _0x6e70=function(_0x5d36d0,_0x2aacd4){_0x5d36d0=_0x5d36d0-0x0;var _0xc8bba0=_0xe706[_0x5d36d0];return _0xc8bba0;};'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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x26febf,_0x364f3d){var _0xd2fa5c=function(_0x5095ef){while(--_0x5095ef){_0x26febf['push'](_0x26febf['shift']());}};_0xd2fa5c(++_0x364f3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 95d6956..aa6ea53 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 _0x0eec=['Intervals','map','interval','rules','channel','message','applications','isArray','length','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','interaction','ContactId','%s:%s:%s','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','error','.js','execute','Applications\x20executed','matchPath','emit','complete','stack','agents','agent','busy','busyQueue','end','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId'];(function(_0x23e28c,_0x186291){var _0x29fc44=function(_0x20a0a4){while(--_0x20a0a4){_0x23e28c['push'](_0x23e28c['shift']());}};_0x29fc44(++_0x186291);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0ee('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xc0ee('0x1'));var BPromise=require(_0xc0ee('0x2'));var uuid=require(_0xc0ee('0x3'));var utils=require(_0xc0ee('0x4'));var config=require(_0xc0ee('0x5'));var logger=require(_0xc0ee('0x6'))(_0xc0ee('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xc0ee('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xc0ee('0x9')),'faxQueueReport':require(_0xc0ee('0xa')),'whatsappQueueReport':require(_0xc0ee('0xb'))};var RuleEngine=require(_0xc0ee('0xc'));function getId(_0x38b387,_0x1d9dca,_0xf25cc0){return util['format'](_0xc0ee('0xd'),_0x38b387,_0x1d9dca||0x0,_0xf25cc0||0x0);}function getIntervals(_0x3bb29a,_0x23d664){var _0x304ff7=[];if(!_[_0xc0ee('0xe')](_0x23d664[_0xc0ee('0xf')])&&!_[_0xc0ee('0xe')](_0x3bb29a[_0x23d664['IntervalId']])&&!_[_0xc0ee('0xe')](_0x3bb29a[_0x23d664[_0xc0ee('0xf')]][_0xc0ee('0x10')])){_0x304ff7=_[_0xc0ee('0x11')](_0x3bb29a[_0x23d664[_0xc0ee('0xf')]][_0xc0ee('0x10')],_0xc0ee('0x12'));}else if(!_[_0xc0ee('0xe')](_0x23d664[_0xc0ee('0x12')])){_0x304ff7=[_0x23d664['interval']];}return _0x304ff7;}exports['listen']=function(_0x1f3ad9){_0x1f3ad9[_0xc0ee('0x13')]={};return new BPromise(function(_0x3743c3,_0x5f27e9){var _0x170bf9={'Start':function(_0x30c324){var _0x448448=this;return new Promise(function(_0x58e1f0,_0x5124df){if(_0x30c324){try{var _0x30db89=[];var _0x4dc6de=getId(_0x30c324[_0xc0ee('0x14')],_0x30c324[_0xc0ee('0x15')]?_0x30c324[_0xc0ee('0x15')]['id']:0x0,_0x30c324['interaction']?_0x30c324['interaction']['id']:0x0);if(_0x30c324[_0xc0ee('0x16')]&&_[_0xc0ee('0x17')](_0x30c324[_0xc0ee('0x16')])&&_0x30c324['applications'][_0xc0ee('0x18')]){for(var _0xe15d59=0x0;_0xe15d59<_0x30c324['applications']['length'];_0xe15d59+=0x1){var _0x27bf86=_0x30c324[_0xc0ee('0x16')][_0xe15d59];if(fs['existsSync'](path[_0xc0ee('0x19')](__dirname,_0xc0ee('0x16'),_0x27bf86[_0xc0ee('0x1a')]+'.js'))){var _0x49be2a=[];switch(_0x27bf86['app'][_0xc0ee('0x1b')]()){case _0xc0ee('0x1c'):var _0x5d3abf=_0x27bf86[_0xc0ee('0x1d')][_0xc0ee('0x1e')](',');if(_0x30c324[_0xc0ee('0x14')]===_0xc0ee('0x1f')){_0x49be2a[_0xc0ee('0x20')](_0x5d3abf[0x0]);_0x49be2a[_0xc0ee('0x20')](_0x5d3abf[0x1]);_0x49be2a[_0xc0ee('0x20')](_0x5d3abf[_0xc0ee('0x21')](0x2,_0x5d3abf[_0xc0ee('0x18')])[_0xc0ee('0x19')](','));}else{_0x49be2a[_0xc0ee('0x20')](_0x5d3abf[0x0]);_0x49be2a[_0xc0ee('0x20')](_0x5d3abf[_0xc0ee('0x21')](0x1,_0x5d3abf[_0xc0ee('0x18')])[_0xc0ee('0x19')](','));}break;case'dialogflow':var _0x1cc984=_0x27bf86[_0xc0ee('0x1d')]['split'](',');_0x49be2a[_0xc0ee('0x20')](_0x1cc984[0x0]);_0x49be2a['push'](_0x1cc984[0x1]);_0x49be2a[_0xc0ee('0x20')](_0x1cc984[_0xc0ee('0x21')](0x2,_0x1cc984[_0xc0ee('0x18')])[_0xc0ee('0x19')](','));break;case _0xc0ee('0x22'):var _0x369764=_0x27bf86[_0xc0ee('0x1d')][_0xc0ee('0x1e')](',');_0x49be2a[_0xc0ee('0x20')](_0x369764[0x0]);_0x49be2a[_0xc0ee('0x20')](_0x369764[0x1]);_0x49be2a[_0xc0ee('0x20')](_0x369764[0x2]);_0x49be2a[_0xc0ee('0x20')](_0x369764[0x3]);_0x49be2a[_0xc0ee('0x20')](_0x369764[_0xc0ee('0x21')](0x4,_0x369764['length'])['join'](','));break;case _0xc0ee('0x23'):var _0x4552fc=_0x27bf86[_0xc0ee('0x1d')][_0xc0ee('0x1e')](',');_0x49be2a[_0xc0ee('0x20')](_0x4552fc[0x0]);_0x49be2a[_0xc0ee('0x20')](_0x4552fc[0x1]);_0x49be2a[_0xc0ee('0x20')](_0x4552fc[0x2]);_0x49be2a[_0xc0ee('0x20')](_0x4552fc[0x3]);_0x49be2a[_0xc0ee('0x20')](_0x4552fc[_0xc0ee('0x21')](0x4,_0x4552fc[_0xc0ee('0x18')])['join'](','));break;case _0xc0ee('0x15'):_0x49be2a[_0xc0ee('0x20')](_0x27bf86[_0xc0ee('0x1d')]);break;case _0xc0ee('0x24'):_0x49be2a[_0xc0ee('0x20')](_0x27bf86['TagId']);_0x49be2a[_0xc0ee('0x20')](_0x27bf86[_0xc0ee('0x1d')]);break;case _0xc0ee('0x25'):var _0x5e5162=utils[_0xc0ee('0x26')](_0x30c324[_0xc0ee('0x27')][_0xc0ee('0x28')],_0x30c324);var _0x36e22e=_0x27bf86['appdata'][_0xc0ee('0x1e')](',');_0x49be2a['push'](_0x36e22e[0x0]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x1]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x2]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x3]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x4]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x5]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x6]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x7]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x8]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0x9]);_0x49be2a[_0xc0ee('0x20')](_0x36e22e[0xa]);_0x49be2a[_0xc0ee('0x20')](_0x30c324['interaction']['id']);_0x49be2a[_0xc0ee('0x20')](_0x30c324[_0xc0ee('0x15')]['id']);_0x49be2a[_0xc0ee('0x20')](_0x27bf86[_0xc0ee('0x29')]);_0x49be2a[_0xc0ee('0x20')](_0x30c324[_0xc0ee('0x2a')][_0xc0ee('0x2b')]);_0x49be2a[_0xc0ee('0x20')](_0x30c324['body']['body']);_0x49be2a[_0xc0ee('0x20')](_0x5e5162);break;default:_0x49be2a=_['isNil'](_0x27bf86[_0xc0ee('0x1d')])?[]:_0x27bf86[_0xc0ee('0x1d')]['split'](',');}var _0x2f41dd={'id':util['format'](_0xc0ee('0x2c'),_0x4dc6de,_0x27bf86['id'],_0x27bf86['app']),'condition':require('./interval')['condition'](_0x4dc6de,getIntervals(_0x1f3ad9[_0xc0ee('0x2d')],_0x27bf86),_0x1f3ad9),'consequence':require(_0xc0ee('0x2e')+_0x27bf86[_0xc0ee('0x1a')])[_0xc0ee('0x2f')](_0x4dc6de,_0x49be2a,_0x1f3ad9,_0x30c324),'p':_0x27bf86['priority']||0x0};logger[_0xc0ee('0x30')](_0xc0ee('0x31'),_0x2f41dd['id'],_0xc0ee('0x32'),getIntervals(_0x1f3ad9[_0xc0ee('0x2d')],_0x27bf86)[_0xc0ee('0x19')]('\x20|\x20'));_0x30db89[_0xc0ee('0x20')](_0x2f41dd);}else{logger[_0xc0ee('0x33')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xc0ee('0x19')](__dirname,'applications',_0x27bf86[_0xc0ee('0x1a')]+_0xc0ee('0x34')));}}_0x1f3ad9['rules'][_0x4dc6de]=new RuleEngine(_0x30db89);_0x1f3ad9[_0xc0ee('0x13')][_0x4dc6de][_0xc0ee('0x35')](_0x30c324,function(_0x5f2b29){logger[_0xc0ee('0x30')](_0xc0ee('0x36'),JSON['stringify'](_0x5f2b29[_0xc0ee('0x37')]));if(_0x1f3ad9[_0xc0ee('0x13')][_0x4dc6de]){_0x1f3ad9[_0xc0ee('0x13')][_0x4dc6de][_0xc0ee('0x38')](_0xc0ee('0x39'));}});return _0x58e1f0({'code':0xc8,'message':_0x30c324});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x58e1f0({'code':0xc8,'message':_0x30c324});}}catch(_0x337aa7){logger[_0xc0ee('0x33')](_0x337aa7[_0xc0ee('0x3a')]);return _0x5124df(_0x448448[_0xc0ee('0x33')](0x1f4,_0x337aa7));}}return _0x5124df('routing\x20is\x20empty');});},'AcceptMessage':function(_0x4ddc5d){var _0x27bd0b=this;return new Promise(function(_0x29d68f,_0x111de5){if(_0x4ddc5d['agent']&&_0x4ddc5d['agent']['id']){if(_0x1f3ad9[_0xc0ee('0x3b')][_0x4ddc5d[_0xc0ee('0x3c')]['id']]){_0x1f3ad9[_0xc0ee('0x3b')][_0x4ddc5d['agent']['id']][_0xc0ee('0x3d')]=![];_0x1f3ad9[_0xc0ee('0x3b')][_0x4ddc5d['agent']['id']][_0xc0ee('0x3e')]=undefined;}}if(_0x4ddc5d[_0xc0ee('0x15')]&&_0x4ddc5d[_0xc0ee('0x15')]['id']){try{var _0x1ff457=getId(_0x4ddc5d['channel'],_0x4ddc5d['message']?_0x4ddc5d[_0xc0ee('0x15')]['id']:0x0,_0x4ddc5d['interaction']?_0x4ddc5d['interaction']['id']:0x0);if(_0x1f3ad9['rules'][_0x1ff457]){_0x1f3ad9[_0xc0ee('0x13')][_0x1ff457]['emit'](_0xc0ee('0x3f'));if(rpc[_0x4ddc5d[_0xc0ee('0x14')]+_0xc0ee('0x40')]){rpc[_0x4ddc5d['channel']+_0xc0ee('0x40')]['update'](_0x1ff457,{'UserId':_0x4ddc5d[_0xc0ee('0x15')]['UserId']})[_0xc0ee('0x41')](function(_0x3d48a2){logger[_0xc0ee('0x33')](_0xc0ee('0x42'));});}}return _0x29d68f({'code':0xc8,'message':_0x4ddc5d});}catch(_0x2bb2bd){logger[_0xc0ee('0x33')](_0x2bb2bd['stack']);return _0x111de5(_0x27bd0b['error'](0x1f4,_0x2bb2bd));}}logger[_0xc0ee('0x33')]('message\x20is\x20empty');return _0x111de5(_0x27bd0b[_0xc0ee('0x33')](0x1f4,_0xc0ee('0x43')));});},'RejectMessage':function(_0x348019){var _0x3843eb=this;return new Promise(function(_0x45ac12,_0x1915c2){if(_0x348019[_0xc0ee('0x3c')]&&_0x348019[_0xc0ee('0x3c')]['id']){try{if(_0x1f3ad9['agents'][_0x348019[_0xc0ee('0x3c')]['id']]){_0x1f3ad9[_0xc0ee('0x3b')][_0x348019['agent']['id']][_0xc0ee('0x3d')]=![];_0x1f3ad9[_0xc0ee('0x3b')][_0x348019[_0xc0ee('0x3c')]['id']][_0xc0ee('0x3e')]=undefined;}return _0x45ac12({'code':0xc8,'message':_0x348019});}catch(_0x30765d){logger[_0xc0ee('0x33')](_0x30765d['stack']);return _0x1915c2(_0x3843eb[_0xc0ee('0x33')](0x1f4,_0x30765d));}}logger[_0xc0ee('0x33')]('message\x20is\x20empty');return _0x1915c2(_0x3843eb['error'](0x1f4,_0xc0ee('0x43')));});},'AbandonInteraction':function(_0x535552){var _0x26de4d=this;return new Promise(function(_0x2fe985,_0x3ddeb2){if(_0x535552[_0xc0ee('0x14')]&&_0x535552[_0xc0ee('0x2a')]&&_0x535552[_0xc0ee('0x2a')]['id']){try{var _0x37b216=getId(_0x535552[_0xc0ee('0x14')],_0x535552[_0xc0ee('0x15')]?_0x535552[_0xc0ee('0x15')]['id']:0x0,_0x535552[_0xc0ee('0x2a')]?_0x535552[_0xc0ee('0x2a')]['id']:0x0);if(_0x1f3ad9[_0xc0ee('0x13')][_0x37b216]){_0x1f3ad9['rules'][_0x37b216][_0xc0ee('0x38')](_0xc0ee('0x3f'));}return _0x2fe985({'code':0xc8,'message':_0x535552});}catch(_0x3cc899){logger[_0xc0ee('0x33')](_0x3cc899[_0xc0ee('0x3a')]);return _0x3ddeb2(_0x26de4d['error'](0x1f4,_0x3cc899));}}logger[_0xc0ee('0x33')]('message\x20is\x20empty');return _0x3ddeb2(_0x26de4d[_0xc0ee('0x33')](0x1f4,_0xc0ee('0x43')));});},'AgentCapacity':function(_0x2e6502){var _0x4277af=this;return new Promise(function(_0x3acdff,_0x41ed33){if(_0x1f3ad9['agents'][_0xc0ee('0x44')](_0x2e6502['id'])){for(var _0x47d6e0 in _0x2e6502[_0xc0ee('0x45')]){if(_0x2e6502[_0xc0ee('0x45')][_0xc0ee('0x44')](_0x47d6e0)){if(_0x1f3ad9[_0xc0ee('0x3b')][_0x2e6502['id']][_0xc0ee('0x44')](_0x47d6e0+_0xc0ee('0x46'))){_0x1f3ad9[_0xc0ee('0x3b')][_0x2e6502['id']][_0x47d6e0+_0xc0ee('0x46')]=parseInt(_0x2e6502[_0xc0ee('0x45')][_0x47d6e0],0xa);}}}_0x1f3ad9[_0xc0ee('0x3b')][_0x2e6502['id']][_0xc0ee('0x47')]();return _0x3acdff({'code':0xc8,'message':_0x1f3ad9[_0xc0ee('0x3b')][_0x2e6502['id']]});}else{return _0x41ed33(_0x4277af[_0xc0ee('0x33')](0x1f4,_0xc0ee('0x48')));}});},'Agents':function(_0x4697ad){return new Promise(function(_0x39c2e1,_0x313865){var _0x58433b=_['values'](_0x1f3ad9[_0xc0ee('0x3b')]);_0x39c2e1({'count':_0x58433b[_0xc0ee('0x18')],'rows':_0x58433b});});},'ChatQueues':function(_0x506d29){return new Promise(function(_0x6252fa,_0x23a66c){var _0x55092f=[];for(var _0x5b06b8 in _0x1f3ad9[_0xc0ee('0x49')]){if(_0x1f3ad9[_0xc0ee('0x49')][_0xc0ee('0x44')](_0x5b06b8)){var _0x5029d7=_0x1f3ad9[_0xc0ee('0x49')][_0x5b06b8];var _0x1d9cec={'id':_0x5029d7['id'],'available':_0x5029d7[_0xc0ee('0x4a')],'loggedIn':_0x5029d7['loggedIn'],'name':_0x5029d7[_0xc0ee('0x4b')],'paused':_0x5029d7[_0xc0ee('0x4c')],'waiting':_0x5029d7[_0xc0ee('0x4d')]};_0x55092f[_0xc0ee('0x20')](_0x1d9cec);}}_0x6252fa({'count':_0x55092f[_0xc0ee('0x18')],'rows':_0x55092f});});},'MailQueues':function(_0x19ff54){return new Promise(function(_0xdf66ec,_0x5f42e2){var _0x2ba7b3=[];for(var _0x515c64 in _0x1f3ad9[_0xc0ee('0x4e')]){if(_0x1f3ad9['mailQueues'][_0xc0ee('0x44')](_0x515c64)){var _0x405e4b=_0x1f3ad9[_0xc0ee('0x4e')][_0x515c64];var _0x14b1af={'id':_0x405e4b['id'],'available':_0x405e4b[_0xc0ee('0x4a')],'loggedIn':_0x405e4b[_0xc0ee('0x4f')],'name':_0x405e4b[_0xc0ee('0x4b')],'paused':_0x405e4b[_0xc0ee('0x4c')],'waiting':_0x405e4b[_0xc0ee('0x4d')]};_0x2ba7b3[_0xc0ee('0x20')](_0x14b1af);}}_0xdf66ec({'count':_0x2ba7b3['length'],'rows':_0x2ba7b3});});},'OpenchannelQueues':function(_0xa8e425){return new Promise(function(_0x4498df,_0xf9231b){var _0x303473=[];for(var _0x4fa704 in _0x1f3ad9[_0xc0ee('0x50')]){if(_0x1f3ad9[_0xc0ee('0x50')]['hasOwnProperty'](_0x4fa704)){var _0x5dd196=_0x1f3ad9[_0xc0ee('0x50')][_0x4fa704];var _0x4199b6={'id':_0x5dd196['id'],'available':_0x5dd196[_0xc0ee('0x4a')],'loggedIn':_0x5dd196[_0xc0ee('0x4f')],'name':_0x5dd196[_0xc0ee('0x4b')],'paused':_0x5dd196[_0xc0ee('0x4c')],'waiting':_0x5dd196[_0xc0ee('0x4d')]};_0x303473[_0xc0ee('0x20')](_0x4199b6);}}_0x4498df({'count':_0x303473[_0xc0ee('0x18')],'rows':_0x303473});});},'SmsQueues':function(_0x159d9a){return new Promise(function(_0x283641,_0x48c921){var _0x26979a=[];for(var _0x39cc91 in _0x1f3ad9[_0xc0ee('0x51')]){if(_0x1f3ad9['smsQueues'][_0xc0ee('0x44')](_0x39cc91)){var _0x3b37ff=_0x1f3ad9['smsQueues'][_0x39cc91];var _0x20f94e={'id':_0x3b37ff['id'],'available':_0x3b37ff[_0xc0ee('0x4a')],'loggedIn':_0x3b37ff[_0xc0ee('0x4f')],'name':_0x3b37ff['name'],'paused':_0x3b37ff[_0xc0ee('0x4c')],'waiting':_0x3b37ff[_0xc0ee('0x4d')]};_0x26979a[_0xc0ee('0x20')](_0x20f94e);}}_0x283641({'count':_0x26979a['length'],'rows':_0x26979a});});},'FaxQueues':function(_0x25fdb7){return new Promise(function(_0xc4228d,_0x1362ef){var _0x2b171e=[];for(var _0xf2d3a5 in _0x1f3ad9[_0xc0ee('0x52')]){if(_0x1f3ad9[_0xc0ee('0x52')][_0xc0ee('0x44')](_0xf2d3a5)){var _0x3d2460=_0x1f3ad9['faxQueues'][_0xf2d3a5];var _0x1d6bff={'id':_0x3d2460['id'],'available':_0x3d2460[_0xc0ee('0x4a')],'loggedIn':_0x3d2460['loggedIn'],'name':_0x3d2460[_0xc0ee('0x4b')],'paused':_0x3d2460[_0xc0ee('0x4c')],'waiting':_0x3d2460[_0xc0ee('0x4d')]};_0x2b171e['push'](_0x1d6bff);}}_0xc4228d({'count':_0x2b171e[_0xc0ee('0x18')],'rows':_0x2b171e});});},'WhatsappQueues':function(_0x1d0239){return new Promise(function(_0x34746c,_0x5c3255){var _0x6e1365=[];for(var _0x55b0a2 in _0x1f3ad9[_0xc0ee('0x53')]){if(_0x1f3ad9[_0xc0ee('0x53')][_0xc0ee('0x44')](_0x55b0a2)){var _0x53f940=_0x1f3ad9[_0xc0ee('0x53')][_0x55b0a2];var _0x598fab={'id':_0x53f940['id'],'available':_0x53f940['available'],'loggedIn':_0x53f940[_0xc0ee('0x4f')],'name':_0x53f940['name'],'paused':_0x53f940['paused'],'waiting':_0x53f940[_0xc0ee('0x4d')]};_0x6e1365['push'](_0x598fab);}}_0x34746c({'count':_0x6e1365[_0xc0ee('0x18')],'rows':_0x6e1365});});},'ChatQueuesWaitingInteractions':function(_0x2344b1){return new Promise(function(_0x3beb39,_0xb71e9f){var _0x31af1d=_[_0xc0ee('0x54')](_0x1f3ad9[_0xc0ee('0x55')]);_0x3beb39({'count':_0x31af1d['length'],'rows':_0x31af1d});});},'MailQueuesWaitingInteractions':function(_0x5df927){return new Promise(function(_0x352978,_0x431aed){var _0xb4594b=_[_0xc0ee('0x54')](_0x1f3ad9[_0xc0ee('0x56')]);_0x352978({'count':_0xb4594b[_0xc0ee('0x18')],'rows':_0xb4594b});});},'OpenchannelQueuesWaitingInteractions':function(_0x4031bf){return new Promise(function(_0x44e607,_0x5cdca4){var _0x5e06a5=_[_0xc0ee('0x54')](_0x1f3ad9['openchannelQueuesWaitingInteractions']);_0x44e607({'count':_0x5e06a5[_0xc0ee('0x18')],'rows':_0x5e06a5});});},'SmsQueuesWaitingInteractions':function(_0x18502f){return new Promise(function(_0x4a498d,_0x3d2e1b){var _0x2ee624=_['values'](_0x1f3ad9[_0xc0ee('0x57')]);_0x4a498d({'count':_0x2ee624[_0xc0ee('0x18')],'rows':_0x2ee624});});},'FaxQueuesWaitingInteractions':function(_0x37d575){return new Promise(function(_0x113635,_0x1a62e4){var _0xc5aac=_['values'](_0x1f3ad9[_0xc0ee('0x58')]);_0x113635({'count':_0xc5aac[_0xc0ee('0x18')],'rows':_0xc5aac});});},'WhatsappQueuesWaitingInteractions':function(_0x4876ea){return new Promise(function(_0x1423a2,_0x38311a){var _0x1d9345=_[_0xc0ee('0x54')](_0x1f3ad9[_0xc0ee('0x59')]);_0x1423a2({'count':_0x1d9345['length'],'rows':_0x1d9345});});}};var _0x24da6a=jayson[_0xc0ee('0x5a')](_0x170bf9)[_0xc0ee('0x5b')]();_0x24da6a['on'](_0xc0ee('0x33'),function(_0x5d9294){logger['error'](JSON['stringify'](_0x5d9294));return _0x5f27e9(_0x5d9294);});_0x24da6a['listen'](0x232c,_0xc0ee('0x5c'),function(){console['log'](_0xc0ee('0x5d'),0x232c);return _0x3743c3('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x402f=['mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','path','uuid','./applications/utils','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','on\x20interval','\x20|\x20','error','.js','execute','info','Applications\x20executed','stringify','No\x20applications\x20to\x20execute','stack','agent','agents','busyQueue','emit','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x402f,0x6f));var _0xf402=function(_0x5b8dff,_0x2d04d8){_0x5b8dff=_0x5b8dff-0x0;var _0x4eb2e8=_0x402f[_0x5b8dff];return _0x4eb2e8;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var path=require(_0xf402('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require(_0xf402('0x2'));var utils=require(_0xf402('0x3'));var config=require(_0xf402('0x4'));var logger=require('../../../config/logger')(_0xf402('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xf402('0x6')),'chatQueueReport':require(_0xf402('0x7')),'smsQueueReport':require(_0xf402('0x8')),'faxQueueReport':require(_0xf402('0x9')),'whatsappQueueReport':require(_0xf402('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4d1771,_0x2f0ffe,_0x154bd3){return util[_0xf402('0xb')](_0xf402('0xc'),_0x4d1771,_0x2f0ffe||0x0,_0x154bd3||0x0);}function getIntervals(_0x18c918,_0x298e44){var _0x1b70de=[];if(!_[_0xf402('0xd')](_0x298e44['IntervalId'])&&!_[_0xf402('0xd')](_0x18c918[_0x298e44['IntervalId']])&&!_['isNil'](_0x18c918[_0x298e44['IntervalId']]['Intervals'])){_0x1b70de=_['map'](_0x18c918[_0x298e44[_0xf402('0xe')]]['Intervals'],'interval');}else if(!_['isNil'](_0x298e44[_0xf402('0xf')])){_0x1b70de=[_0x298e44['interval']];}return _0x1b70de;}exports[_0xf402('0x10')]=function(_0xb3deb6){_0xb3deb6[_0xf402('0x11')]={};return new BPromise(function(_0xb79e1a,_0x5b4fdf){var _0x16767b={'Start':function(_0x4baaec){var _0x3af9e3=this;return new Promise(function(_0x5e38d8,_0x5cc240){if(_0x4baaec){try{var _0x545d1a=[];var _0xb45d00=getId(_0x4baaec[_0xf402('0x12')],_0x4baaec[_0xf402('0x13')]?_0x4baaec[_0xf402('0x13')]['id']:0x0,_0x4baaec[_0xf402('0x14')]?_0x4baaec[_0xf402('0x14')]['id']:0x0);if(_0x4baaec[_0xf402('0x15')]&&_[_0xf402('0x16')](_0x4baaec[_0xf402('0x15')])&&_0x4baaec[_0xf402('0x15')]['length']){for(var _0x14fdcc=0x0;_0x14fdcc<_0x4baaec[_0xf402('0x15')][_0xf402('0x17')];_0x14fdcc+=0x1){var _0xb47b61=_0x4baaec[_0xf402('0x15')][_0x14fdcc];if(fs[_0xf402('0x18')](path[_0xf402('0x19')](__dirname,_0xf402('0x15'),_0xb47b61[_0xf402('0x1a')]+'.js'))){var _0x3cfe38=[];switch(_0xb47b61['app'][_0xf402('0x1b')]()){case _0xf402('0x1c'):var _0xd30863=_0xb47b61[_0xf402('0x1d')][_0xf402('0x1e')](',');if(_0x4baaec[_0xf402('0x12')]===_0xf402('0x1f')){_0x3cfe38[_0xf402('0x20')](_0xd30863[0x0]);_0x3cfe38[_0xf402('0x20')](_0xd30863[0x1]);_0x3cfe38[_0xf402('0x20')](_0xd30863[_0xf402('0x21')](0x2,_0xd30863[_0xf402('0x17')])['join'](','));}else{_0x3cfe38[_0xf402('0x20')](_0xd30863[0x0]);_0x3cfe38[_0xf402('0x20')](_0xd30863[_0xf402('0x21')](0x1,_0xd30863[_0xf402('0x17')])['join'](','));}break;case'dialogflow':var _0x3e26d3=_0xb47b61[_0xf402('0x1d')][_0xf402('0x1e')](',');_0x3cfe38[_0xf402('0x20')](_0x3e26d3[0x0]);_0x3cfe38[_0xf402('0x20')](_0x3e26d3[0x1]);_0x3cfe38['push'](_0x3e26d3[_0xf402('0x21')](0x2,_0x3e26d3['length'])[_0xf402('0x19')](','));break;case _0xf402('0x22'):var _0x45ead3=_0xb47b61[_0xf402('0x1d')][_0xf402('0x1e')](',');_0x3cfe38['push'](_0x45ead3[0x0]);_0x3cfe38[_0xf402('0x20')](_0x45ead3[0x1]);_0x3cfe38[_0xf402('0x20')](_0x45ead3[0x2]);_0x3cfe38[_0xf402('0x20')](_0x45ead3[0x3]);_0x3cfe38['push'](_0x45ead3['slice'](0x4,_0x45ead3[_0xf402('0x17')])[_0xf402('0x19')](','));break;case _0xf402('0x23'):var _0x221d6d=_0xb47b61[_0xf402('0x1d')]['split'](',');_0x3cfe38[_0xf402('0x20')](_0x221d6d[0x0]);_0x3cfe38[_0xf402('0x20')](_0x221d6d[0x1]);_0x3cfe38[_0xf402('0x20')](_0x221d6d[0x2]);_0x3cfe38[_0xf402('0x20')](_0x221d6d[0x3]);_0x3cfe38[_0xf402('0x20')](_0x221d6d[_0xf402('0x21')](0x4,_0x221d6d['length'])[_0xf402('0x19')](','));break;case _0xf402('0x13'):_0x3cfe38[_0xf402('0x20')](_0xb47b61['appdata']);break;case'tag':_0x3cfe38[_0xf402('0x20')](_0xb47b61[_0xf402('0x24')]);_0x3cfe38[_0xf402('0x20')](_0xb47b61['appdata']);break;case _0xf402('0x25'):var _0x335b34=utils[_0xf402('0x26')](_0x4baaec[_0xf402('0x27')][_0xf402('0x28')],_0x4baaec);var _0x2c4217=_0xb47b61['appdata'][_0xf402('0x1e')](',');_0x3cfe38[_0xf402('0x20')](_0x2c4217[0x0]);_0x3cfe38[_0xf402('0x20')](_0x2c4217[0x1]);_0x3cfe38[_0xf402('0x20')](_0x2c4217[0x2]);_0x3cfe38[_0xf402('0x20')](_0x2c4217[0x3]);_0x3cfe38['push'](_0x2c4217[0x4]);_0x3cfe38[_0xf402('0x20')](_0x2c4217[0x5]);_0x3cfe38[_0xf402('0x20')](_0x2c4217[0x6]);_0x3cfe38[_0xf402('0x20')](_0x2c4217[0x7]);_0x3cfe38['push'](_0x2c4217[0x8]);_0x3cfe38['push'](_0x2c4217[0x9]);_0x3cfe38[_0xf402('0x20')](_0x2c4217[0xa]);_0x3cfe38['push'](_0x4baaec[_0xf402('0x14')]['id']);_0x3cfe38[_0xf402('0x20')](_0x4baaec['message']['id']);_0x3cfe38[_0xf402('0x20')](_0xb47b61[_0xf402('0x29')]);_0x3cfe38[_0xf402('0x20')](_0x4baaec[_0xf402('0x14')][_0xf402('0x2a')]);_0x3cfe38[_0xf402('0x20')](_0x4baaec[_0xf402('0x2b')][_0xf402('0x2b')]);_0x3cfe38['push'](_0x335b34);break;default:_0x3cfe38=_[_0xf402('0xd')](_0xb47b61[_0xf402('0x1d')])?[]:_0xb47b61[_0xf402('0x1d')][_0xf402('0x1e')](',');}var _0x2fb923={'id':util['format'](_0xf402('0x2c'),_0xb45d00,_0xb47b61['id'],_0xb47b61['app']),'condition':require(_0xf402('0x2d'))[_0xf402('0x2e')](_0xb45d00,getIntervals(_0xb3deb6[_0xf402('0x2f')],_0xb47b61),_0xb3deb6),'consequence':require(_0xf402('0x30')+_0xb47b61[_0xf402('0x1a')])[_0xf402('0x31')](_0xb45d00,_0x3cfe38,_0xb3deb6,_0x4baaec),'p':_0xb47b61[_0xf402('0x32')]||0x0};logger['info']('Push\x20new\x20rule',_0x2fb923['id'],_0xf402('0x33'),getIntervals(_0xb3deb6[_0xf402('0x2f')],_0xb47b61)[_0xf402('0x19')](_0xf402('0x34')));_0x545d1a[_0xf402('0x20')](_0x2fb923);}else{logger[_0xf402('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xf402('0x19')](__dirname,_0xf402('0x15'),_0xb47b61[_0xf402('0x1a')]+_0xf402('0x36')));}}_0xb3deb6['rules'][_0xb45d00]=new RuleEngine(_0x545d1a);_0xb3deb6[_0xf402('0x11')][_0xb45d00][_0xf402('0x37')](_0x4baaec,function(_0x299af2){logger[_0xf402('0x38')](_0xf402('0x39'),JSON[_0xf402('0x3a')](_0x299af2['matchPath']));if(_0xb3deb6[_0xf402('0x11')][_0xb45d00]){_0xb3deb6[_0xf402('0x11')][_0xb45d00]['emit']('complete');}});return _0x5e38d8({'code':0xc8,'message':_0x4baaec});}else{logger[_0xf402('0x38')](_0xf402('0x3b'));return _0x5e38d8({'code':0xc8,'message':_0x4baaec});}}catch(_0x53c83f){logger[_0xf402('0x35')](_0x53c83f[_0xf402('0x3c')]);return _0x5cc240(_0x3af9e3[_0xf402('0x35')](0x1f4,_0x53c83f));}}return _0x5cc240('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3f5971){var _0x48fd97=this;return new Promise(function(_0x6bddd8,_0x4b72ba){if(_0x3f5971[_0xf402('0x3d')]&&_0x3f5971[_0xf402('0x3d')]['id']){if(_0xb3deb6['agents'][_0x3f5971['agent']['id']]){_0xb3deb6[_0xf402('0x3e')][_0x3f5971[_0xf402('0x3d')]['id']]['busy']=![];_0xb3deb6['agents'][_0x3f5971[_0xf402('0x3d')]['id']][_0xf402('0x3f')]=undefined;}}if(_0x3f5971[_0xf402('0x13')]&&_0x3f5971[_0xf402('0x13')]['id']){try{var _0x20a1cd=getId(_0x3f5971[_0xf402('0x12')],_0x3f5971[_0xf402('0x13')]?_0x3f5971[_0xf402('0x13')]['id']:0x0,_0x3f5971[_0xf402('0x14')]?_0x3f5971['interaction']['id']:0x0);if(_0xb3deb6[_0xf402('0x11')][_0x20a1cd]){_0xb3deb6[_0xf402('0x11')][_0x20a1cd][_0xf402('0x40')]('end');if(rpc[_0x3f5971[_0xf402('0x12')]+_0xf402('0x41')]){rpc[_0x3f5971[_0xf402('0x12')]+_0xf402('0x41')]['update'](_0x20a1cd,{'UserId':_0x3f5971[_0xf402('0x13')][_0xf402('0x42')]})[_0xf402('0x43')](function(_0x3e089e){logger[_0xf402('0x35')](_0xf402('0x44'));});}}return _0x6bddd8({'code':0xc8,'message':_0x3f5971});}catch(_0x19eb1f){logger[_0xf402('0x35')](_0x19eb1f[_0xf402('0x3c')]);return _0x4b72ba(_0x48fd97[_0xf402('0x35')](0x1f4,_0x19eb1f));}}logger[_0xf402('0x35')](_0xf402('0x45'));return _0x4b72ba(_0x48fd97[_0xf402('0x35')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5c947a){var _0x2a304c=this;return new Promise(function(_0x55189f,_0x5876da){if(_0x5c947a['agent']&&_0x5c947a[_0xf402('0x3d')]['id']){try{if(_0xb3deb6[_0xf402('0x3e')][_0x5c947a['agent']['id']]){_0xb3deb6[_0xf402('0x3e')][_0x5c947a[_0xf402('0x3d')]['id']][_0xf402('0x46')]=![];_0xb3deb6[_0xf402('0x3e')][_0x5c947a[_0xf402('0x3d')]['id']][_0xf402('0x3f')]=undefined;}return _0x55189f({'code':0xc8,'message':_0x5c947a});}catch(_0x14c159){logger[_0xf402('0x35')](_0x14c159['stack']);return _0x5876da(_0x2a304c['error'](0x1f4,_0x14c159));}}logger[_0xf402('0x35')](_0xf402('0x45'));return _0x5876da(_0x2a304c['error'](0x1f4,_0xf402('0x45')));});},'AbandonInteraction':function(_0x2ee779){var _0x49b1d6=this;return new Promise(function(_0x5e550c,_0x477d67){if(_0x2ee779['channel']&&_0x2ee779[_0xf402('0x14')]&&_0x2ee779['interaction']['id']){try{var _0x192d35=getId(_0x2ee779[_0xf402('0x12')],_0x2ee779['message']?_0x2ee779['message']['id']:0x0,_0x2ee779[_0xf402('0x14')]?_0x2ee779[_0xf402('0x14')]['id']:0x0);if(_0xb3deb6[_0xf402('0x11')][_0x192d35]){_0xb3deb6[_0xf402('0x11')][_0x192d35][_0xf402('0x40')](_0xf402('0x47'));}return _0x5e550c({'code':0xc8,'message':_0x2ee779});}catch(_0x4bb648){logger[_0xf402('0x35')](_0x4bb648[_0xf402('0x3c')]);return _0x477d67(_0x49b1d6[_0xf402('0x35')](0x1f4,_0x4bb648));}}logger['error'](_0xf402('0x45'));return _0x477d67(_0x49b1d6[_0xf402('0x35')](0x1f4,_0xf402('0x45')));});},'AgentCapacity':function(_0x57c829){var _0x20b8f3=this;return new Promise(function(_0x45d86e,_0x57a27e){if(_0xb3deb6[_0xf402('0x3e')][_0xf402('0x48')](_0x57c829['id'])){for(var _0x470b41 in _0x57c829[_0xf402('0x49')]){if(_0x57c829['capacity'][_0xf402('0x48')](_0x470b41)){if(_0xb3deb6[_0xf402('0x3e')][_0x57c829['id']]['hasOwnProperty'](_0x470b41+_0xf402('0x4a'))){_0xb3deb6[_0xf402('0x3e')][_0x57c829['id']][_0x470b41+_0xf402('0x4a')]=parseInt(_0x57c829[_0xf402('0x49')][_0x470b41],0xa);}}}_0xb3deb6['agents'][_0x57c829['id']][_0xf402('0x4b')]();return _0x45d86e({'code':0xc8,'message':_0xb3deb6['agents'][_0x57c829['id']]});}else{return _0x57a27e(_0x20b8f3[_0xf402('0x35')](0x1f4,_0xf402('0x4c')));}});},'Agents':function(_0xd8af92){return new Promise(function(_0x49ba01,_0x32adc2){var _0x177774=_['values'](_0xb3deb6['agents']);_0x49ba01({'count':_0x177774['length'],'rows':_0x177774});});},'ChatQueues':function(_0x5c05fe){return new Promise(function(_0x18443e,_0x41b4eb){var _0x6fb6d2=[];for(var _0xffbac5 in _0xb3deb6['chatQueues']){if(_0xb3deb6[_0xf402('0x4d')][_0xf402('0x48')](_0xffbac5)){var _0x385a95=_0xb3deb6[_0xf402('0x4d')][_0xffbac5];var _0x280cd6={'id':_0x385a95['id'],'available':_0x385a95[_0xf402('0x4e')],'loggedIn':_0x385a95[_0xf402('0x4f')],'name':_0x385a95[_0xf402('0x50')],'paused':_0x385a95[_0xf402('0x51')],'waiting':_0x385a95[_0xf402('0x52')]};_0x6fb6d2[_0xf402('0x20')](_0x280cd6);}}_0x18443e({'count':_0x6fb6d2['length'],'rows':_0x6fb6d2});});},'MailQueues':function(_0x1efd2f){return new Promise(function(_0x3da6fa,_0x387a44){var _0x31dd99=[];for(var _0x43c95b in _0xb3deb6[_0xf402('0x53')]){if(_0xb3deb6[_0xf402('0x53')][_0xf402('0x48')](_0x43c95b)){var _0x1493bc=_0xb3deb6['mailQueues'][_0x43c95b];var _0x41601b={'id':_0x1493bc['id'],'available':_0x1493bc[_0xf402('0x4e')],'loggedIn':_0x1493bc[_0xf402('0x4f')],'name':_0x1493bc[_0xf402('0x50')],'paused':_0x1493bc['paused'],'waiting':_0x1493bc['waiting']};_0x31dd99[_0xf402('0x20')](_0x41601b);}}_0x3da6fa({'count':_0x31dd99['length'],'rows':_0x31dd99});});},'OpenchannelQueues':function(_0x4a767d){return new Promise(function(_0x285704,_0x11fe4a){var _0x296ed2=[];for(var _0x14710d in _0xb3deb6['openchannelQueues']){if(_0xb3deb6['openchannelQueues']['hasOwnProperty'](_0x14710d)){var _0x3befdd=_0xb3deb6[_0xf402('0x54')][_0x14710d];var _0x283e6f={'id':_0x3befdd['id'],'available':_0x3befdd[_0xf402('0x4e')],'loggedIn':_0x3befdd['loggedIn'],'name':_0x3befdd[_0xf402('0x50')],'paused':_0x3befdd[_0xf402('0x51')],'waiting':_0x3befdd[_0xf402('0x52')]};_0x296ed2[_0xf402('0x20')](_0x283e6f);}}_0x285704({'count':_0x296ed2[_0xf402('0x17')],'rows':_0x296ed2});});},'SmsQueues':function(_0x2138c9){return new Promise(function(_0x17c8a2,_0x14ac7c){var _0x54e72c=[];for(var _0x5be137 in _0xb3deb6[_0xf402('0x55')]){if(_0xb3deb6[_0xf402('0x55')][_0xf402('0x48')](_0x5be137)){var _0x352b73=_0xb3deb6['smsQueues'][_0x5be137];var _0xa74c54={'id':_0x352b73['id'],'available':_0x352b73[_0xf402('0x4e')],'loggedIn':_0x352b73[_0xf402('0x4f')],'name':_0x352b73[_0xf402('0x50')],'paused':_0x352b73[_0xf402('0x51')],'waiting':_0x352b73[_0xf402('0x52')]};_0x54e72c[_0xf402('0x20')](_0xa74c54);}}_0x17c8a2({'count':_0x54e72c['length'],'rows':_0x54e72c});});},'FaxQueues':function(_0x20956b){return new Promise(function(_0x57641c,_0x470455){var _0x511f35=[];for(var _0x4083da in _0xb3deb6[_0xf402('0x56')]){if(_0xb3deb6[_0xf402('0x56')][_0xf402('0x48')](_0x4083da)){var _0x32f8a0=_0xb3deb6[_0xf402('0x56')][_0x4083da];var _0x4a7366={'id':_0x32f8a0['id'],'available':_0x32f8a0[_0xf402('0x4e')],'loggedIn':_0x32f8a0[_0xf402('0x4f')],'name':_0x32f8a0['name'],'paused':_0x32f8a0[_0xf402('0x51')],'waiting':_0x32f8a0[_0xf402('0x52')]};_0x511f35[_0xf402('0x20')](_0x4a7366);}}_0x57641c({'count':_0x511f35[_0xf402('0x17')],'rows':_0x511f35});});},'WhatsappQueues':function(_0x4a8c65){return new Promise(function(_0x5eeb73,_0x2705e8){var _0x54f595=[];for(var _0x2783dc in _0xb3deb6['whatsappQueues']){if(_0xb3deb6['whatsappQueues'][_0xf402('0x48')](_0x2783dc)){var _0x1c281a=_0xb3deb6[_0xf402('0x57')][_0x2783dc];var _0x2f2177={'id':_0x1c281a['id'],'available':_0x1c281a[_0xf402('0x4e')],'loggedIn':_0x1c281a[_0xf402('0x4f')],'name':_0x1c281a[_0xf402('0x50')],'paused':_0x1c281a[_0xf402('0x51')],'waiting':_0x1c281a[_0xf402('0x52')]};_0x54f595['push'](_0x2f2177);}}_0x5eeb73({'count':_0x54f595[_0xf402('0x17')],'rows':_0x54f595});});},'ChatQueuesWaitingInteractions':function(_0x3628ff){return new Promise(function(_0x2f5beb,_0x250518){var _0x18aefb=_[_0xf402('0x58')](_0xb3deb6[_0xf402('0x59')]);_0x2f5beb({'count':_0x18aefb[_0xf402('0x17')],'rows':_0x18aefb});});},'MailQueuesWaitingInteractions':function(_0xf825d){return new Promise(function(_0x24c3d3,_0x5a90aa){var _0x5060fd=_['values'](_0xb3deb6[_0xf402('0x5a')]);_0x24c3d3({'count':_0x5060fd['length'],'rows':_0x5060fd});});},'OpenchannelQueuesWaitingInteractions':function(_0x159b81){return new Promise(function(_0x3a6074,_0x2b0717){var _0x4988b6=_['values'](_0xb3deb6[_0xf402('0x5b')]);_0x3a6074({'count':_0x4988b6[_0xf402('0x17')],'rows':_0x4988b6});});},'SmsQueuesWaitingInteractions':function(_0x281199){return new Promise(function(_0x5b3ecc,_0x55c98c){var _0x24f923=_[_0xf402('0x58')](_0xb3deb6['smsQueuesWaitingInteractions']);_0x5b3ecc({'count':_0x24f923[_0xf402('0x17')],'rows':_0x24f923});});},'FaxQueuesWaitingInteractions':function(_0x1e3118){return new Promise(function(_0x3f57f9,_0x1816b9){var _0x386e4b=_[_0xf402('0x58')](_0xb3deb6['faxQueuesWaitingInteractions']);_0x3f57f9({'count':_0x386e4b[_0xf402('0x17')],'rows':_0x386e4b});});},'WhatsappQueuesWaitingInteractions':function(_0x5960e0){return new Promise(function(_0x35367a,_0xdc7110){var _0x4c3d4a=_[_0xf402('0x58')](_0xb3deb6[_0xf402('0x5c')]);_0x35367a({'count':_0x4c3d4a[_0xf402('0x17')],'rows':_0x4c3d4a});});}};var _0x5c042b=jayson[_0xf402('0x5d')](_0x16767b)['http']();_0x5c042b['on'](_0xf402('0x35'),function(_0x2a6e47){logger[_0xf402('0x35')](JSON['stringify'](_0x2a6e47));return _0x5b4fdf(_0x2a6e47);});_0x5c042b[_0xf402('0x10')](0x232c,_0xf402('0x5e'),function(){console[_0xf402('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xb79e1a(_0xf402('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index ca3d626..dd636ab 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 _0x75ec=['[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','indexOf','true','[%s][INTERVAL]\x20%s','some','info'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x75ec,0x19a));var _0xc75e=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x75ec[_0x2e4aa2];return _0x5e6092;};'use strict';var util=require(_0xc75e('0x0'));var BPromise=require(_0xc75e('0x1'));var jayson=require(_0xc75e('0x2'));var _=require(_0xc75e('0x3'));var logger=require(_0xc75e('0x4'))(_0xc75e('0x5'));var client=jayson['client'][_0xc75e('0x6')]({'port':0x232a});function request(_0x5724a0,_0x2d6487){return new BPromise(function(_0x2d2eba,_0x3d4b94){return client[_0xc75e('0x7')](_0x5724a0,_0x2d6487)[_0xc75e('0x8')](function(_0x1c8c50){if(_0x1c8c50['error']){return _0x3d4b94(_0x1c8c50[_0xc75e('0x9')][_0xc75e('0xa')]);}else{return _0x2d2eba(_0x1c8c50['result']);}})[_0xc75e('0xb')](function(_0x8a8b94){return _0x3d4b94(_0x8a8b94);});});}exports[_0xc75e('0xc')]=function(_0x23ae60,_0x2867fd,_0x559bbe){return function(_0xfa67b1){if(_0x559bbe[_0xc75e('0xd')]&&!_0x559bbe['rules'][_0x23ae60]){logger['info'](_0xc75e('0xe'),_0x23ae60);return _0xfa67b1['stop']();}var _0x3d3be8=[];for(var _0x2828db=0x0;_0x2828db<_0x2867fd[_0xc75e('0xf')];_0x2828db+=0x1){_0x3d3be8['push'](request(_0xc75e('0x10'),{'command':util['format']('iftime\x20%s',_0x2867fd[_0x2828db])})['then'](function(_0x15dd19){return _0x15dd19&&_0x15dd19[_0xc75e('0xa')]&&_0x15dd19[_0xc75e('0xa')][_0xc75e('0x11')](_0xc75e('0x12'))>=0x0?!![]:![];})['catch'](function(_0x56b252){logger[_0xc75e('0x9')](_0xc75e('0x13'),_0x23ae60,_0x2867fd[_0x2828db]);}));}BPromise['all'](_0x3d3be8)[_0xc75e('0x8')](function(_0x3f15f9){var _0x2c4615=_[_0xc75e('0x14')](_0x3f15f9);logger[_0xc75e('0x15')](_0xc75e('0x16'),_0x23ae60,_0x2867fd['join'](_0xc75e('0x17')),_0x2c4615);_0xfa67b1[_0xc75e('0x18')](_0x2c4615);})[_0xc75e('0xb')](function(_0x4bcdf3){console[_0xc75e('0x19')](_0x4bcdf3);logger['error'](_0xc75e('0x16'),_0x23ae60,_0x2867fd['join'](_0xc75e('0x17')),_0x4bcdf3['stack']);_0xfa67b1[_0xc75e('0x1a')]();});};}; \ No newline at end of file +var _0x544c=['format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x13178a,_0xb10b54){var _0x18276c=function(_0x117eda){while(--_0x117eda){_0x13178a['push'](_0x13178a['shift']());}};_0x18276c(++_0xb10b54);}(_0x544c,0x1de));var _0xc544=function(_0x1d53cb,_0x4cf3f1){_0x1d53cb=_0x1d53cb-0x0;var _0x1de5fe=_0x544c[_0x1d53cb];return _0x1de5fe;};'use strict';var util=require(_0xc544('0x0'));var BPromise=require(_0xc544('0x1'));var jayson=require(_0xc544('0x2'));var _=require(_0xc544('0x3'));var logger=require(_0xc544('0x4'))(_0xc544('0x5'));var client=jayson[_0xc544('0x6')][_0xc544('0x7')]({'port':0x232a});function request(_0x1d2377,_0x2a74cd){return new BPromise(function(_0x3af3e1,_0x458bc1){return client[_0xc544('0x8')](_0x1d2377,_0x2a74cd)[_0xc544('0x9')](function(_0x35bd4){if(_0x35bd4[_0xc544('0xa')]){return _0x458bc1(_0x35bd4[_0xc544('0xa')]['message']);}else{return _0x3af3e1(_0x35bd4[_0xc544('0xb')]);}})[_0xc544('0xc')](function(_0x281b9c){return _0x458bc1(_0x281b9c);});});}exports[_0xc544('0xd')]=function(_0x346949,_0xa5f178,_0x26f778){return function(_0x3b6605){if(_0x26f778[_0xc544('0xe')]&&!_0x26f778['rules'][_0x346949]){logger[_0xc544('0xf')](_0xc544('0x10'),_0x346949);return _0x3b6605[_0xc544('0x11')]();}var _0x35aa79=[];for(var _0x52b95d=0x0;_0x52b95d<_0xa5f178['length'];_0x52b95d+=0x1){_0x35aa79['push'](request('Command',{'command':util[_0xc544('0x12')](_0xc544('0x13'),_0xa5f178[_0x52b95d])})[_0xc544('0x9')](function(_0x513621){return _0x513621&&_0x513621[_0xc544('0x14')]&&_0x513621[_0xc544('0x14')][_0xc544('0x15')](_0xc544('0x16'))>=0x0?!![]:![];})[_0xc544('0xc')](function(_0x45fdd9){logger[_0xc544('0xa')](_0xc544('0x17'),_0x346949,_0xa5f178[_0x52b95d]);}));}BPromise[_0xc544('0x18')](_0x35aa79)[_0xc544('0x9')](function(_0x55faca){var _0x2e998f=_[_0xc544('0x19')](_0x55faca);logger[_0xc544('0xf')](_0xc544('0x1a'),_0x346949,_0xa5f178[_0xc544('0x1b')](_0xc544('0x1c')),_0x2e998f);_0x3b6605[_0xc544('0x1d')](_0x2e998f);})['catch'](function(_0x4049f1){console['log'](_0x4049f1);logger[_0xc544('0xa')](_0xc544('0x1a'),_0x346949,_0xa5f178[_0xc544('0x1b')](_0xc544('0x1c')),_0x4049f1[_0xc544('0x1e')]);_0x3b6605[_0xc544('0x11')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ff688e5..2c17920 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 _0xf109=['transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','now','called','info','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','error','queuecallerabandon','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer'];(function(_0x43984e,_0xf2ec98){var _0x3b8a48=function(_0x4091a4){while(--_0x4091a4){_0x43984e['push'](_0x43984e['shift']());}};_0x3b8a48(++_0xf2ec98);}(_0xf109,0xce));var _0x9f10=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf109[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var utils=require(_0x9f10('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5d2950,_0x5b381d){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4'),_0x5d2950[_0x9f10('0x5')],_0x5d2950[_0x9f10('0x6')],_0x5d2950[_0x9f10('0x7')],_0x5d2950[_0x9f10('0x8')],_0x5d2950[_0x9f10('0x9')],_0x5d2950[_0x9f10('0xa')],_0x5d2950[_0x9f10('0xb')],_0x5d2950[_0x9f10('0xc')]));if(_0x5d2950[_0x9f10('0x7')]){utils['getVoiceQueueByName'](_0x5d2950[_0x9f10('0x7')])[_0x9f10('0xd')](function(_0x1a0668){if(_0x1a0668){_0x5d2950[_0x9f10('0xe')]=_0x1a0668[_0x9f10('0xe')];_0x5d2950['agentacw']=_0x5d2950[_0x9f10('0xf')]?_0x1a0668[_0x9f10('0x10')]:![];_0x5d2950[_0x9f10('0x11')]=_0x5d2950['agentacw']?_0x1a0668['acwTimeout']:0x0;}utils[_0x9f10('0x12')](_0x9f10('0x13'),_0x5d2950);});}else{utils[_0x9f10('0x12')]('CreateVoiceAgentReport',_0x5d2950);}if(_0x5b381d){delete transfers[_0x5d2950[_0x9f10('0x5')]];}else{delete agents[_0x5d2950[_0x9f10('0x14')]];}}exports[_0x9f10('0x15')]=function(_0x58067f){try{utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]',_0x58067f[_0x9f10('0x5')]),_0x58067f);agents[_0x58067f[_0x9f10('0x14')]]=_0x58067f;agents[_0x58067f['destuniqueid']]['agentcalledAt']=utils[_0x9f10('0x17')]();agents[_0x58067f[_0x9f10('0x14')]]['lastevent']=_0x9f10('0x18');agents[_0x58067f['destuniqueid']][_0x9f10('0xb')]=null;agents[_0x58067f[_0x9f10('0x14')]]['connectedlinename']=null;utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x58067f[_0x9f10('0x5')],agents[_0x58067f['destuniqueid']][_0x9f10('0x8')],_0x58067f['destuniqueid']));}catch(_0x2c5064){utils['error'](util['format'](_0x9f10('0x1a'),_0x58067f[_0x9f10('0x5')]),_0x2c5064);}};exports[_0x9f10('0x1b')]=function(_0x3a78be){try{if(!_[_0x9f10('0x1c')](agents[_0x3a78be[_0x9f10('0x14')]])){utils[_0x9f10('0x16')](util['format'](_0x9f10('0x1d'),_0x3a78be['uniqueid']),_0x3a78be);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x1e'),_0x3a78be['uniqueid'],agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x8')],_0x3a78be[_0x9f10('0x14')]));agents[_0x3a78be['destuniqueid']][_0x9f10('0x1b')]=!![];agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x1f')]=utils['now']();agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x20');agents[_0x3a78be[_0x9f10('0x14')]]['reason']='timeout';agents[_0x3a78be['destuniqueid']][_0x9f10('0x21')]=_0x3a78be['ringtime']?parseInt(_0x3a78be[_0x9f10('0x22')])/0x3e8:0x0;agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x23')]=0x0;unanswered[_0x9f10('0x24')](_0x3a78be[_0x9f10('0x14')]);}}catch(_0x4f6b0c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x1d'),_0x3a78be[_0x9f10('0x5')]),_0x4f6b0c);}};exports[_0x9f10('0x26')]=function(_0x2c4373){try{_['forIn'](agents,function(_0x358d3f,_0x501ee){if(_0x358d3f[_0x9f10('0x5')]==_0x2c4373[_0x9f10('0x5')]&&!_['includes'](unanswered,_0x358d3f[_0x9f10('0x14')])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x2c4373);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x27'),_0x2c4373[_0x9f10('0x5')],_0x358d3f['membername'],_0x358d3f[_0x9f10('0x14')]));_0x358d3f[_0x9f10('0x1b')]=!![];_0x358d3f[_0x9f10('0x1f')]=utils[_0x9f10('0x17')]();_0x358d3f[_0x9f10('0xc')]='abandoned';_0x358d3f[_0x9f10('0x28')]='abandoned';_0x358d3f[_0x9f10('0x21')]=_0x2c4373[_0x9f10('0x21')];_0x358d3f[_0x9f10('0x23')]=0x0;writeDB(_0x358d3f);}});}catch(_0x11ee9c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x11ee9c);}};exports[_0x9f10('0x29')]=function(_0x1b8018){try{if(agents[_0x1b8018['destuniqueid']]){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentconnect]',_0x1b8018[_0x9f10('0x5')]),_0x1b8018);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x2a'),_0x1b8018[_0x9f10('0x5')],agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x8')],_0x1b8018[_0x9f10('0x14')]));agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x2b')]=utils['now']();agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0xb')]=_0x1b8018[_0x9f10('0xb')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x2c')]=_0x1b8018[_0x9f10('0x2c')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];agents[_0x1b8018[_0x9f10('0x14')]]['lastevent']='connect';_[_0x9f10('0x2d')](agents,function(_0x2ff98d,_0x1deed4){if(_0x2ff98d[_0x9f10('0x14')]!=_0x1b8018[_0x9f10('0x14')]&&_0x2ff98d[_0x9f10('0x5')]==_0x1b8018[_0x9f10('0x5')]){_0x2ff98d[_0x9f10('0x23')]=0x0;_0x2ff98d[_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];_0x2ff98d[_0x9f10('0x1b')]=!![];_0x2ff98d[_0x9f10('0x1f')]=utils['now']();_0x2ff98d['lastevent']='answered_elsewhere';_0x2ff98d[_0x9f10('0x28')]='answered_elsewhere';_0x2ff98d[_0x9f10('0x2e')]=_0x1b8018[_0x9f10('0x14')];_0x2ff98d[_0x9f10('0x2f')]=_0x1b8018['membername'];writeDB(_0x2ff98d);}});}}catch(_0x3cfce6){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x30'),_0x1b8018[_0x9f10('0x5')]),_0x3cfce6);}};exports['agentcomplete']=function(_0x578368){try{if(!_['isNil'](agents[_0x578368[_0x9f10('0x14')]])){utils['debug'](util[_0x9f10('0x3')]('[%s][agents][agentcomplete]',_0x578368[_0x9f10('0x5')]),_0x578368);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x31'),_0x578368['uniqueid'],agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x8')],_0x578368['destuniqueid']));agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xf')]=!![];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x23')]=utils[_0x9f10('0x33')](agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')],agents[_0x578368['destuniqueid']][_0x9f10('0x2b')]);agents[_0x578368[_0x9f10('0x14')]]['reason']=_0x578368[_0x9f10('0x28')];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x34');writeDB(agents[_0x578368['destuniqueid']]);}}catch(_0x283f04){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x35'),_0x578368[_0x9f10('0x5')]),_0x283f04);}};exports[_0x9f10('0x36')]=function(_0x479b46){try{if(!_[_0x9f10('0x1c')](agents[_0x479b46[_0x9f10('0x37')]])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46[_0x9f10('0x5')]),_0x479b46);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x39'),_0x479b46[_0x9f10('0x5')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x8')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x5')]));agents[_0x479b46[_0x9f10('0x37')]]['transfer']=!![];agents[_0x479b46[_0x9f10('0x37')]]['transfertype']=_0x9f10('0x3a');agents[_0x479b46['transfereruniqueid']][_0x9f10('0x3b')]=_0x479b46[_0x9f10('0x3c')];agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x3d')]=agents[_0x479b46[_0x9f10('0x37')]]['uniqueid'];}}catch(_0x12cf34){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46['uniqueid']),_0x12cf34);}};exports['attendedtransfer']=function(_0x265f69){try{utils[_0x9f10('0x16')](util['format']('[%s][agents][attendedtransfer]',_0x265f69[_0x9f10('0x3e')]),_0x265f69);if(_0x265f69[_0x9f10('0x3e')]==_0x265f69[_0x9f10('0x3f')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x40')]])){utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x8')]));agents[_0x265f69['secondtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x40')]]['transfertype']=_0x9f10('0x42');agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x43')];agents[_0x265f69[_0x9f10('0x40')]]['transferuniqueid']=_0x265f69[_0x9f10('0x3e')];}if(_0x265f69['transfereeuniqueid']&&agents[_0x265f69['transfereeuniqueid']]){agents[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x44')]]=_[_0x9f10('0x46')](agents[_0x265f69[_0x9f10('0x44')]]);transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0xa')]=agents[_0x265f69['secondtransfereruniqueid']]['calleridnum'];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x47')]=agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x48')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x21')]=0x0;transfers[_0x265f69[_0x9f10('0x44')]]['agententerreason']=0x2;}}else if(_0x265f69[_0x9f10('0x40')]==_0x265f69[_0x9f10('0x49')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x3e')]])){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4a'),_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x8')]));agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x4b')]='ATTENDED';agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x4c')];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x3d')]=_0x265f69[_0x9f10('0x40')];}if(_0x265f69[_0x9f10('0x4d')]&&agents[_0x265f69[_0x9f10('0x4d')]]){agents[_0x265f69['transfertargetuniqueid']][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x4d')]]=_['clone'](agents[_0x265f69[_0x9f10('0x4d')]]);transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0xa')]=agents[_0x265f69[_0x9f10('0x3e')]]['calleridnum'];transfers[_0x265f69[_0x9f10('0x4d')]]['calleridname']=agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x4d')]]['agentcalledAt']=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69[_0x9f10('0x4d')]]['holdtime']=0x0;transfers[_0x265f69[_0x9f10('0x4d')]]['agententerreason']=0x2;}}}catch(_0x5708c1){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x4e'),_0x265f69['origtransfereruniqueid']),_0x5708c1);}};exports[_0x9f10('0x4f')]=function(_0x5a64ae){try{utils['debug'](util[_0x9f10('0x3')]('[%s][agents][hangup]',_0x5a64ae['uniqueid']),_0x5a64ae);if(agents[_0x5a64ae[_0x9f10('0x5')]]&&agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]===_0x9f10('0x20')){if(_0x5a64ae[_0x9f10('0x50')]==='21'){agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]=_0x9f10('0x51');agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]='rejected';}utils['info'](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);var _0x27f337=unanswered[_0x9f10('0x53')](_0x5a64ae[_0x9f10('0x5')]);if(_0x27f337>-0x1){unanswered[_0x9f10('0x54')](_0x27f337,0x1);}}if(transfers[_0x5a64ae[_0x9f10('0x5')]]){transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xf')]=!![];transfers[_0x5a64ae['uniqueid']][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x23')]=utils['diffTime'](transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]);transfers[_0x5a64ae['uniqueid']]['reason']=_0x9f10('0x55');transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]=_0x9f10('0x34');utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(transfers[_0x5a64ae[_0x9f10('0x5')]],!![]);}if(agents[_0x5a64ae['uniqueid']]&&agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]){agents[_0x5a64ae['uniqueid']][_0x9f10('0xf')]=!![];agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x5a64ae['uniqueid']][_0x9f10('0x23')]=utils['diffTime'](agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],agents[_0x5a64ae[_0x9f10('0x5')]]['agentconnectAt']);agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')]=agents[_0x5a64ae[_0x9f10('0x5')]]['transfer']?_0x9f10('0x41'):_0x9f10('0x55');agents[_0x5a64ae[_0x9f10('0x5')]]['lastevent']='complete';utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5a64ae['uniqueid'],agents[_0x5a64ae['uniqueid']][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]]['reason'],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);}}catch(_0x3b3dd8){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x56'),_0x5a64ae[_0x9f10('0x5')]),_0x3b3dd8);}}; \ No newline at end of file +var _0x6e6c=['agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','queue','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','uniqueid','agentcalledAt','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','format','agentringnoanswer','[%s][agents][agentringnoanswer]','info','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','holdtime','ringtime','talktime','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x30ce5e,_0x20b56b){var _0x29f4e3=function(_0x4d781c){while(--_0x4d781c){_0x30ce5e['push'](_0x30ce5e['shift']());}};_0x29f4e3(++_0x20b56b);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6e6c[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x370b21,_0x1b63fe){utils['info'](util['format'](_0xc6e6('0x2'),_0x370b21['uniqueid'],_0x370b21[_0xc6e6('0x3')],_0x370b21['queue'],_0x370b21[_0xc6e6('0x4')],_0x370b21[_0xc6e6('0x5')],_0x370b21['calleridnum'],_0x370b21[_0xc6e6('0x6')],_0x370b21[_0xc6e6('0x7')]));if(_0x370b21['queue']){utils[_0xc6e6('0x8')](_0x370b21[_0xc6e6('0x9')])['then'](function(_0x324f05){if(_0x324f05){_0x370b21['type']=_0x324f05[_0xc6e6('0xa')];_0x370b21[_0xc6e6('0xb')]=_0x370b21[_0xc6e6('0xc')]?_0x324f05[_0xc6e6('0xd')]:![];_0x370b21[_0xc6e6('0xe')]=_0x370b21[_0xc6e6('0xb')]?_0x324f05[_0xc6e6('0xf')]:0x0;}utils[_0xc6e6('0x10')](_0xc6e6('0x11'),_0x370b21);});}else{utils['request'](_0xc6e6('0x11'),_0x370b21);}if(_0x1b63fe){delete transfers[_0x370b21['uniqueid']];}else{delete agents[_0x370b21[_0xc6e6('0x12')]];}}exports[_0xc6e6('0x13')]=function(_0x33aea0){try{utils[_0xc6e6('0x14')](util['format'](_0xc6e6('0x15'),_0x33aea0[_0xc6e6('0x16')]),_0x33aea0);agents[_0x33aea0[_0xc6e6('0x12')]]=_0x33aea0;agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x17')]=utils['now']();agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x7')]='called';agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x6')]=null;agents[_0x33aea0[_0xc6e6('0x12')]]['connectedlinename']=null;utils['info'](util['format'](_0xc6e6('0x18'),_0x33aea0['uniqueid'],agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0x33aea0[_0xc6e6('0x12')]));}catch(_0x41afe6){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x15'),_0x33aea0[_0xc6e6('0x16')]),_0x41afe6);}};exports[_0xc6e6('0x1b')]=function(_0x3d734d){try{if(!_['isNil'](agents[_0x3d734d[_0xc6e6('0x12')]])){utils['debug'](util[_0xc6e6('0x1a')](_0xc6e6('0x1c'),_0x3d734d[_0xc6e6('0x16')]),_0x3d734d);utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x1e'),_0x3d734d[_0xc6e6('0x16')],agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0x3d734d[_0xc6e6('0x12')]));agents[_0x3d734d['destuniqueid']][_0xc6e6('0x1b')]=!![];agents[_0x3d734d['destuniqueid']][_0xc6e6('0x1f')]=utils[_0xc6e6('0x20')]();agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x7')]='timeout';agents[_0x3d734d[_0xc6e6('0x12')]]['reason']=_0xc6e6('0x21');agents[_0x3d734d['destuniqueid']][_0xc6e6('0x22')]=_0x3d734d[_0xc6e6('0x23')]?parseInt(_0x3d734d[_0xc6e6('0x23')])/0x3e8:0x0;agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x24')]=0x0;unanswered['push'](_0x3d734d[_0xc6e6('0x12')]);}}catch(_0x1501bd){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')]('[%s][agents][agentringnoanswer]',_0x3d734d[_0xc6e6('0x16')]),_0x1501bd);}};exports['queuecallerabandon']=function(_0x29411c){try{_[_0xc6e6('0x25')](agents,function(_0x12c616,_0xc578b3){if(_0x12c616[_0xc6e6('0x16')]==_0x29411c[_0xc6e6('0x16')]&&!_[_0xc6e6('0x26')](unanswered,_0x12c616[_0xc6e6('0x12')])){utils[_0xc6e6('0x14')](util[_0xc6e6('0x1a')](_0xc6e6('0x27'),_0x29411c[_0xc6e6('0x16')]),_0x29411c);utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x28'),_0x29411c[_0xc6e6('0x16')],_0x12c616[_0xc6e6('0x4')],_0x12c616['destuniqueid']));_0x12c616[_0xc6e6('0x1b')]=!![];_0x12c616[_0xc6e6('0x1f')]=utils['now']();_0x12c616['lastevent']=_0xc6e6('0x29');_0x12c616[_0xc6e6('0x2a')]=_0xc6e6('0x29');_0x12c616[_0xc6e6('0x22')]=_0x29411c[_0xc6e6('0x22')];_0x12c616[_0xc6e6('0x24')]=0x0;writeDB(_0x12c616);}});}catch(_0x59a8f0){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x27'),_0x29411c['uniqueid']),_0x59a8f0);}};exports['agentconnect']=function(_0xa5138d){try{if(agents[_0xa5138d[_0xc6e6('0x12')]]){utils[_0xc6e6('0x14')](util[_0xc6e6('0x1a')]('[%s][agents][agentconnect]',_0xa5138d['uniqueid']),_0xa5138d);utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x2b'),_0xa5138d['uniqueid'],agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0xa5138d[_0xc6e6('0x12')]));agents[_0xa5138d[_0xc6e6('0x12')]]['agentconnectAt']=utils['now']();agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x6')]=_0xa5138d[_0xc6e6('0x6')];agents[_0xa5138d[_0xc6e6('0x12')]]['connectedlinename']=_0xa5138d['connectedlinename'];agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x22')]=_0xa5138d[_0xc6e6('0x23')];agents[_0xa5138d[_0xc6e6('0x12')]]['lastevent']=_0xc6e6('0x2c');_[_0xc6e6('0x25')](agents,function(_0x5ddab4,_0x500b7e){if(_0x5ddab4[_0xc6e6('0x12')]!=_0xa5138d['destuniqueid']&&_0x5ddab4[_0xc6e6('0x16')]==_0xa5138d[_0xc6e6('0x16')]){_0x5ddab4['talktime']=0x0;_0x5ddab4[_0xc6e6('0x22')]=_0xa5138d['ringtime'];_0x5ddab4[_0xc6e6('0x1b')]=!![];_0x5ddab4['agentringnoanswerAt']=utils[_0xc6e6('0x20')]();_0x5ddab4[_0xc6e6('0x7')]=_0xc6e6('0x2d');_0x5ddab4[_0xc6e6('0x2a')]=_0xc6e6('0x2d');_0x5ddab4[_0xc6e6('0x2e')]=_0xa5138d[_0xc6e6('0x12')];_0x5ddab4[_0xc6e6('0x2f')]=_0xa5138d[_0xc6e6('0x4')];writeDB(_0x5ddab4);}});}}catch(_0x5722db){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x30'),_0xa5138d[_0xc6e6('0x16')]),_0x5722db);}};exports['agentcomplete']=function(_0xc5f4fb){try{if(!_[_0xc6e6('0x31')](agents[_0xc5f4fb[_0xc6e6('0x12')]])){utils[_0xc6e6('0x14')](util['format'](_0xc6e6('0x32'),_0xc5f4fb[_0xc6e6('0x16')]),_0xc5f4fb);utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x33'),_0xc5f4fb['uniqueid'],agents[_0xc5f4fb[_0xc6e6('0x12')]]['membername'],_0xc5f4fb[_0xc6e6('0x12')]));agents[_0xc5f4fb['destuniqueid']][_0xc6e6('0xc')]=!![];agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x34')]=utils[_0xc6e6('0x20')]();agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x24')]=utils[_0xc6e6('0x35')](agents[_0xc5f4fb[_0xc6e6('0x12')]]['agentcompleteAt'],agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x36')]);agents[_0xc5f4fb[_0xc6e6('0x12')]]['reason']=_0xc5f4fb[_0xc6e6('0x2a')];agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x7')]=_0xc6e6('0x37');writeDB(agents[_0xc5f4fb[_0xc6e6('0x12')]]);}}catch(_0xefd557){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x32'),_0xc5f4fb[_0xc6e6('0x16')]),_0xefd557);}};exports[_0xc6e6('0x38')]=function(_0x470167){try{if(!_[_0xc6e6('0x31')](agents[_0x470167[_0xc6e6('0x39')]])){utils['debug'](util[_0xc6e6('0x1a')]('[%s][agents][blindtransfer]',_0x470167[_0xc6e6('0x16')]),_0x470167);utils[_0xc6e6('0x1d')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x470167['uniqueid'],agents[_0x470167['transfereruniqueid']]['membername'],agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x16')]));agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x3a')]=!![];agents[_0x470167[_0xc6e6('0x39')]]['transfertype']='blind';agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x3b')]=_0x470167[_0xc6e6('0x3c')];agents[_0x470167[_0xc6e6('0x39')]]['transferuniqueid']=agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x16')];}}catch(_0x286dc1){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')]('[%s][agents][blindtransfer]',_0x470167[_0xc6e6('0x16')]),_0x286dc1);}};exports[_0xc6e6('0x3d')]=function(_0x288912){try{utils['debug'](util[_0xc6e6('0x1a')](_0xc6e6('0x3e'),_0x288912[_0xc6e6('0x3f')]),_0x288912);if(_0x288912[_0xc6e6('0x3f')]==_0x288912[_0xc6e6('0x40')]){if(!_['isNil'](agents[_0x288912[_0xc6e6('0x41')]])){utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x42'),_0x288912[_0xc6e6('0x3f')],agents[_0x288912['secondtransfereruniqueid']]['membername']));agents[_0x288912['secondtransfereruniqueid']][_0xc6e6('0x3a')]=!![];agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x43')]=_0xc6e6('0x44');agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x3b')]=_0x288912['origtransfererexten'];agents[_0x288912[_0xc6e6('0x41')]]['transferuniqueid']=_0x288912[_0xc6e6('0x3f')];}if(_0x288912[_0xc6e6('0x45')]&&agents[_0x288912[_0xc6e6('0x45')]]){agents[_0x288912['transfereeuniqueid']][_0xc6e6('0x46')]=0x1;transfers[_0x288912['transfereeuniqueid']]=_[_0xc6e6('0x47')](agents[_0x288912['transfereeuniqueid']]);transfers[_0x288912['transfereeuniqueid']][_0xc6e6('0x48')]=agents[_0x288912['secondtransfereruniqueid']]['calleridnum'];transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x49')]=agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x49')];transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x17')]=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x45')]]['agentconnectAt']=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x22')]=0x0;transfers[_0x288912[_0xc6e6('0x45')]]['agententerreason']=0x2;}}else if(_0x288912[_0xc6e6('0x41')]==_0x288912[_0xc6e6('0x4a')]){if(!_[_0xc6e6('0x31')](agents[_0x288912['origtransfereruniqueid']])){utils['info'](util[_0xc6e6('0x1a')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x288912['origtransfereruniqueid'],agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x4')]));agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x3a')]=!![];agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x43')]=_0xc6e6('0x44');agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x3b')]=_0x288912[_0xc6e6('0x4b')];agents[_0x288912[_0xc6e6('0x3f')]]['transferuniqueid']=_0x288912['secondtransfereruniqueid'];}if(_0x288912[_0xc6e6('0x4c')]&&agents[_0x288912['transfertargetuniqueid']]){agents[_0x288912['transfertargetuniqueid']][_0xc6e6('0x46')]=0x1;transfers[_0x288912[_0xc6e6('0x4c')]]=_[_0xc6e6('0x47')](agents[_0x288912['transfertargetuniqueid']]);transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x48')]=agents[_0x288912['origtransfereruniqueid']]['calleridnum'];transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x49')]=agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x49')];transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x17')]=utils['now']();transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x36')]=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x22')]=0x0;transfers[_0x288912['transfertargetuniqueid']][_0xc6e6('0x46')]=0x2;}}}catch(_0x3b1549){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x3e'),_0x288912[_0xc6e6('0x3f')]),_0x3b1549);}};exports['hangup']=function(_0x27e74b){try{utils['debug'](util[_0xc6e6('0x1a')]('[%s][agents][hangup]',_0x27e74b['uniqueid']),_0x27e74b);if(agents[_0x27e74b[_0xc6e6('0x16')]]&&agents[_0x27e74b['uniqueid']][_0xc6e6('0x2a')]===_0xc6e6('0x21')){if(_0x27e74b[_0xc6e6('0x4d')]==='21'){agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')]='rejected';agents[_0x27e74b[_0xc6e6('0x16')]]['lastevent']='rejected';}utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x4e'),_0x27e74b['uniqueid'],agents[_0x27e74b[_0xc6e6('0x16')]]['membername'],agents[_0x27e74b['uniqueid']][_0xc6e6('0x2a')],agents[_0x27e74b['uniqueid']][_0xc6e6('0x7')]));writeDB(agents[_0x27e74b[_0xc6e6('0x16')]]);var _0x292107=unanswered[_0xc6e6('0x4f')](_0x27e74b['uniqueid']);if(_0x292107>-0x1){unanswered[_0xc6e6('0x50')](_0x292107,0x1);}}if(transfers[_0x27e74b[_0xc6e6('0x16')]]){transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0xc')]=!![];transfers[_0x27e74b[_0xc6e6('0x16')]]['agentcompleteAt']=utils[_0xc6e6('0x20')]();transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x24')]=utils[_0xc6e6('0x35')](transfers[_0x27e74b['uniqueid']]['agentcompleteAt'],transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x36')]);transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')]=_0xc6e6('0x51');transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x7')]=_0xc6e6('0x37');utils[_0xc6e6('0x1d')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x27e74b[_0xc6e6('0x16')],transfers[_0x27e74b['uniqueid']][_0xc6e6('0x4')],transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')],transfers[_0x27e74b['uniqueid']]['lastevent']));writeDB(transfers[_0x27e74b[_0xc6e6('0x16')]],!![]);}if(agents[_0x27e74b['uniqueid']]&&agents[_0x27e74b[_0xc6e6('0x16')]]['agentconnectAt']){agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0xc')]=!![];agents[_0x27e74b['uniqueid']][_0xc6e6('0x34')]=utils[_0xc6e6('0x20')]();agents[_0x27e74b[_0xc6e6('0x16')]]['talktime']=utils[_0xc6e6('0x35')](agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x34')],agents[_0x27e74b['uniqueid']][_0xc6e6('0x36')]);agents[_0x27e74b[_0xc6e6('0x16')]]['reason']=agents[_0x27e74b['uniqueid']]['transfer']?_0xc6e6('0x3a'):_0xc6e6('0x51');agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x7')]=_0xc6e6('0x37');utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x4e'),_0x27e74b['uniqueid'],agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x4')],agents[_0x27e74b[_0xc6e6('0x16')]]['reason'],agents[_0x27e74b['uniqueid']][_0xc6e6('0x7')]));writeDB(agents[_0x27e74b[_0xc6e6('0x16')]]);}}catch(_0x1826d){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x52'),_0x27e74b[_0xc6e6('0x16')]),_0x1826d);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index f40c234..acb0e48 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 _0x9a3d=['./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%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','debug','format','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','linkedid','destinationchannel','answertime','disposition','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','noop','execif','gotoif','util','./utils'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x5886b9,_0x3e439d){_0x5886b9=_0x5886b9-0x0;var _0x1bd98d=_0x9a3d[_0x5886b9];return _0x1bd98d;};'use strict';var _=require('lodash');var util=require(_0xd9a3('0x0'));var utils=require(_0xd9a3('0x1'));var transfers=require(_0xd9a3('0x2'));var dispositions=[_0xd9a3('0x3'),_0xd9a3('0x4'),_0xd9a3('0x4'),'NO\x20ANSWER',_0xd9a3('0x3'),_0xd9a3('0x3'),_0xd9a3('0x5'),_0xd9a3('0x6'),'FAILED',_0xd9a3('0x4'),_0xd9a3('0x4')];var channels={};function writeDB(_0x34c0ed){var _0x3e86f4;if(transfers[_0xd9a3('0x7')][_0x34c0ed[_0xd9a3('0x8')]]){_0x3e86f4=_0x34c0ed[_0xd9a3('0x8')];_0x34c0ed[_0xd9a3('0x8')]=transfers['blinds'][_0x34c0ed[_0xd9a3('0x8')]][_0xd9a3('0x9')];}utils[_0xd9a3('0xa')](util['format'](_0xd9a3('0xb'),_0x34c0ed[_0xd9a3('0x8')],_0x34c0ed['channel'],_0x34c0ed[_0xd9a3('0xc')],_0x34c0ed[_0xd9a3('0xd')],_0x34c0ed[_0xd9a3('0xe')],_0x34c0ed[_0xd9a3('0xf')],_0x34c0ed[_0xd9a3('0x10')],_0x34c0ed[_0xd9a3('0x11')]));if(_0x34c0ed[_0xd9a3('0x12')]){utils[_0xd9a3('0x13')](_0x34c0ed['accountcode'])[_0xd9a3('0x14')](function(_0x26605e){if(_0x26605e){_0x34c0ed[_0xd9a3('0x15')]=_0x26605e['id'];}utils[_0xd9a3('0x16')](_0xd9a3('0x17'),_0x34c0ed);});}else{utils[_0xd9a3('0x16')](_0xd9a3('0x17'),_0x34c0ed);}if(channels[_0x34c0ed['uniqueid']]){delete channels[_0x34c0ed[_0xd9a3('0x8')]];}else if(_0x3e86f4&&channels[_0x3e86f4]){if(!transfers['blinds'][_0x3e86f4]['recording'])delete transfers[_0xd9a3('0x7')][_0x3e86f4];delete channels[_0x3e86f4];}}exports['newchannel']=function(_0x544e09){try{utils[_0xd9a3('0x18')](util[_0xd9a3('0x19')]('[%s][calls][newchannel]',_0x544e09['uniqueid']),_0x544e09);if(_0x544e09['uniqueid']==_0x544e09['linkedid']&&_0x544e09['channel']!=_0xd9a3('0x1a')){utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x1b'),_0x544e09['uniqueid'],_0x544e09[_0xd9a3('0x1c')],_0x544e09[_0xd9a3('0x1d')]));channels[_0x544e09[_0xd9a3('0x8')]]={'uniqueid':_0x544e09[_0xd9a3('0x8')],'accountcode':_0x544e09[_0xd9a3('0x12')],'source':_0x544e09[_0xd9a3('0xf')],'destination':_0x544e09[_0xd9a3('0x1d')],'destinationcontext':_0x544e09['context'],'channel':_0x544e09[_0xd9a3('0x1e')],'starttime':utils[_0xd9a3('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd9a3('0x3'),'amaflags':_0xd9a3('0x20')};}}catch(_0x60818e){utils[_0xd9a3('0x21')](util['format'](_0xd9a3('0x22'),_0x544e09[_0xd9a3('0x8')]),_0x60818e);}};exports[_0xd9a3('0x23')]=function(_0x20022e){try{utils[_0xd9a3('0x18')](util[_0xd9a3('0x19')](_0xd9a3('0x24'),_0x20022e[_0xd9a3('0x8')]),_0x20022e);if(!_['isNil'](channels[_0x20022e[_0xd9a3('0x8')]])&&_0x20022e[_0xd9a3('0x25')]==0x6){utils[_0xd9a3('0xa')](util['format'](_0xd9a3('0x26'),_0x20022e['uniqueid'],_0x20022e[_0xd9a3('0x1c')],_0x20022e[_0xd9a3('0x1e')]));if(_[_0xd9a3('0x27')](channels[_0x20022e[_0xd9a3('0x8')]][_0xd9a3('0x28')])){channels[_0x20022e[_0xd9a3('0x8')]][_0xd9a3('0x28')]=utils[_0xd9a3('0x1f')]();}}else if(!_['isNil'](channels[_0x20022e[_0xd9a3('0x29')]])&&_0x20022e[_0xd9a3('0x25')]==0x6&&_0x20022e[_0xd9a3('0x1c')]!='transfer'){utils[_0xd9a3('0xa')](util[_0xd9a3('0x19')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x20022e['uniqueid'],_0x20022e[_0xd9a3('0x29')],_0x20022e[_0xd9a3('0x1c')],_0x20022e[_0xd9a3('0x1e')]));channels[_0x20022e['linkedid']][_0xd9a3('0x12')]=_0x20022e[_0xd9a3('0x12')];channels[_0x20022e[_0xd9a3('0x29')]][_0xd9a3('0x2a')]=_0x20022e[_0xd9a3('0x1e')];if(_[_0xd9a3('0x27')](channels[_0x20022e['linkedid']][_0xd9a3('0x2b')])){channels[_0x20022e[_0xd9a3('0x29')]][_0xd9a3('0x2b')]=utils[_0xd9a3('0x1f')]();}channels[_0x20022e[_0xd9a3('0x29')]][_0xd9a3('0x2c')]=dispositions[_['toNumber'](_0x20022e[_0xd9a3('0x25')])]||_0xd9a3('0x5');}}catch(_0x5557be){utils['error'](util['format'](_0xd9a3('0x24'),_0x20022e[_0xd9a3('0x8')]),_0x5557be);}};exports['hangup']=function(_0x49f6c4){try{if(!_['isNil'](channels[_0x49f6c4[_0xd9a3('0x8')]])){utils[_0xd9a3('0x18')](util['format'](_0xd9a3('0x2d'),_0x49f6c4[_0xd9a3('0x8')]),_0x49f6c4);if(_[_0xd9a3('0x27')](channels[_0x49f6c4[_0xd9a3('0x8')]][_0xd9a3('0x2e')])){channels[_0x49f6c4[_0xd9a3('0x8')]][_0xd9a3('0x2e')]=_0x49f6c4[_0xd9a3('0x2f')]+'\x20<'+_0x49f6c4[_0xd9a3('0xf')]+'>';}utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x30'),_0x49f6c4[_0xd9a3('0x8')],channels[_0x49f6c4[_0xd9a3('0x8')]][_0xd9a3('0x2e')],_0x49f6c4[_0xd9a3('0x31')]));channels[_0x49f6c4[_0xd9a3('0x8')]][_0xd9a3('0x32')]=utils[_0xd9a3('0x1f')]();channels[_0x49f6c4[_0xd9a3('0x8')]]['duration']=utils['diffTime'](channels[_0x49f6c4[_0xd9a3('0x8')]][_0xd9a3('0x32')],channels[_0x49f6c4[_0xd9a3('0x8')]]['starttime']);channels[_0x49f6c4['uniqueid']][_0xd9a3('0x33')]=channels[_0x49f6c4[_0xd9a3('0x8')]][_0xd9a3('0x2b')]?utils[_0xd9a3('0x34')](channels[_0x49f6c4['uniqueid']]['endtime'],channels[_0x49f6c4[_0xd9a3('0x8')]][_0xd9a3('0x2b')]):0x0;writeDB(channels[_0x49f6c4[_0xd9a3('0x8')]]);}}catch(_0x11867b){utils[_0xd9a3('0x21')](util[_0xd9a3('0x19')](_0xd9a3('0x2d'),_0x49f6c4[_0xd9a3('0x8')]),_0x11867b);}};exports['attendedtransfer']=function(_0x214f97){try{if(!_[_0xd9a3('0x27')](channels[_0x214f97[_0xd9a3('0x35')]])){utils[_0xd9a3('0x18')](util['format'](_0xd9a3('0x36'),_0x214f97[_0xd9a3('0x37')]),_0x214f97);if(channels[_0x214f97[_0xd9a3('0x35')]][_0xd9a3('0x1e')]==_0x214f97[_0xd9a3('0x38')]){utils[_0xd9a3('0xa')](util[_0xd9a3('0x19')](_0xd9a3('0x39'),_0x214f97[_0xd9a3('0x37')],_0x214f97[_0xd9a3('0x35')],_0x214f97[_0xd9a3('0x3a')]));channels[_0x214f97[_0xd9a3('0x35')]][_0xd9a3('0x2a')]=_0x214f97[_0xd9a3('0x3a')];channels[_0x214f97[_0xd9a3('0x35')]][_0xd9a3('0x3b')]='_attended';}else if(channels[_0x214f97[_0xd9a3('0x35')]][_0xd9a3('0x1e')]=_0x214f97[_0xd9a3('0x3c')]){utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x39'),_0x214f97[_0xd9a3('0x37')],_0x214f97[_0xd9a3('0x35')],_0x214f97[_0xd9a3('0x3d')]));channels[_0x214f97[_0xd9a3('0x35')]][_0xd9a3('0x2a')]=_0x214f97['origtransfererchannel'];channels[_0x214f97['localtwolinkedid']][_0xd9a3('0x3b')]=_0xd9a3('0x3e');}}}catch(_0x360aaf){utils[_0xd9a3('0x21')](util[_0xd9a3('0x19')](_0xd9a3('0x36'),_0x214f97[_0xd9a3('0x37')]),_0x360aaf);}};exports[_0xd9a3('0x3f')]=function(_0x151684){try{if(!_[_0xd9a3('0x27')](channels[_0x151684['uniqueid']])){utils['debug'](util[_0xd9a3('0x19')](_0xd9a3('0x40'),_0x151684[_0xd9a3('0x8')]),_0x151684);channels[_0x151684[_0xd9a3('0x8')]][_0xd9a3('0x41')]=utils[_0xd9a3('0x1f')]();utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x42'),_0x151684[_0xd9a3('0x8')],channels[_0x151684['uniqueid']]['musiconholdstartAt']));}}catch(_0xca2041){utils[_0xd9a3('0x21')](util['format'](_0xd9a3('0x40'),_0x151684['uniqueid']),_0xca2041);}};exports[_0xd9a3('0x43')]=function(_0x494dc0){try{if(!_[_0xd9a3('0x27')](channels[_0x494dc0[_0xd9a3('0x8')]])){utils[_0xd9a3('0x18')](util['format'](_0xd9a3('0x44'),_0x494dc0[_0xd9a3('0x8')]),_0x494dc0);if(!_[_0xd9a3('0x27')](channels[_0x494dc0['uniqueid']][_0xd9a3('0x41')])){channels[_0x494dc0['uniqueid']][_0xd9a3('0x45')]+=utils[_0xd9a3('0x34')](utils[_0xd9a3('0x1f')](),channels[_0x494dc0[_0xd9a3('0x8')]][_0xd9a3('0x41')]);utils[_0xd9a3('0xa')](util[_0xd9a3('0x19')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x494dc0[_0xd9a3('0x8')],channels[_0x494dc0['uniqueid']][_0xd9a3('0x45')]));delete channels[_0x494dc0[_0xd9a3('0x8')]]['musiconholdstartAt'];}}}catch(_0x1bc986){utils[_0xd9a3('0x21')](util[_0xd9a3('0x19')](_0xd9a3('0x44'),_0x494dc0['uniqueid']),_0x1bc986);}};exports[_0xd9a3('0x46')]=function(_0x4ce2a4){try{if(!_[_0xd9a3('0x27')](channels[_0x4ce2a4[_0xd9a3('0x8')]])){utils[_0xd9a3('0x18')](util[_0xd9a3('0x19')](_0xd9a3('0x47'),_0x4ce2a4[_0xd9a3('0x8')]),_0x4ce2a4);if(!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x49')])){utils[_0xd9a3('0xa')](util[_0xd9a3('0x19')](_0xd9a3('0x4a'),_0x4ce2a4[_0xd9a3('0x8')],_0x4ce2a4[_0xd9a3('0x4b')]));channels[_0x4ce2a4[_0xd9a3('0x8')]]['source']=_0x4ce2a4[_0xd9a3('0x4b')];}if(!_['isNil'](_0x4ce2a4['variable'][_0xd9a3('0x4c')])){utils[_0xd9a3('0xa')](util['format'](_0xd9a3('0x4d'),_0x4ce2a4[_0xd9a3('0x8')],_0x4ce2a4[_0xd9a3('0x4b')]));channels[_0x4ce2a4['uniqueid']][_0xd9a3('0x4e')]=_0x4ce2a4[_0xd9a3('0x4b')];channels[_0x4ce2a4[_0xd9a3('0x8')]][_0xd9a3('0x2e')]='\x22'+_0x4ce2a4[_0xd9a3('0x4b')]+_0xd9a3('0x4f')+_0x4ce2a4[_0xd9a3('0x4b')]+'>';}if(!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')]['xmd-callerid-preview'])||!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x50')])){utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x51'),_0x4ce2a4[_0xd9a3('0x8')],!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x52')])?_0xd9a3('0x52'):'xmd-callerid',_0x4ce2a4['value']));channels[_0x4ce2a4[_0xd9a3('0x8')]][_0xd9a3('0x2e')]=_0x4ce2a4['value'];}if(!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x53')])||!_['isNil'](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x54')])){utils[_0xd9a3('0xa')](util[_0xd9a3('0x19')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4ce2a4[_0xd9a3('0x8')],!_['isNil'](_0x4ce2a4['variable'][_0xd9a3('0x53')])?_0xd9a3('0x53'):_0xd9a3('0x54'),_0x4ce2a4[_0xd9a3('0x4b')]));channels[_0x4ce2a4[_0xd9a3('0x8')]][_0xd9a3('0x55')]=_0xd9a3('0x56');channels[_0x4ce2a4[_0xd9a3('0x8')]][_0xd9a3('0x57')]=_0x4ce2a4['value'];channels[_0x4ce2a4[_0xd9a3('0x8')]][_0xd9a3('0xc')]=!![];}if(!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x58')])){utils[_0xd9a3('0xa')](util['format'](_0xd9a3('0x59'),_0x4ce2a4[_0xd9a3('0x8')],_0x4ce2a4[_0xd9a3('0x4b')]));channels[_0x4ce2a4[_0xd9a3('0x8')]][_0xd9a3('0x5a')]=_0x4ce2a4[_0xd9a3('0x4b')];}if(!_['isNil'](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x5b')])){utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x5c'),_0x4ce2a4[_0xd9a3('0x8')],_0x4ce2a4[_0xd9a3('0x4b')]));channels[_0x4ce2a4[_0xd9a3('0x8')]]['type']=_0x4ce2a4['value'];}if(!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x5d')])){utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x5e'),_0x4ce2a4['uniqueid'],_0x4ce2a4[_0xd9a3('0x4b')]));channels[_0x4ce2a4[_0xd9a3('0x8')]]['routeid']=_0x4ce2a4[_0xd9a3('0x4b')];}if(!_[_0xd9a3('0x27')](_0x4ce2a4[_0xd9a3('0x48')][_0xd9a3('0x5f')])){utils['info'](util[_0xd9a3('0x19')](_0xd9a3('0x60'),_0x4ce2a4['uniqueid'],_0x4ce2a4[_0xd9a3('0x4b')]));channels[_0x4ce2a4[_0xd9a3('0x8')]][_0xd9a3('0x5f')]=_0x4ce2a4[_0xd9a3('0x4b')];}}}catch(_0x337a37){utils['error'](util[_0xd9a3('0x19')](_0xd9a3('0x47'),_0x4ce2a4[_0xd9a3('0x8')]),_0x337a37);}};exports[_0xd9a3('0x61')]=function(_0x1b535a){try{if(!_[_0xd9a3('0x27')](channels[_0x1b535a[_0xd9a3('0x8')]])){utils[_0xd9a3('0x18')](util[_0xd9a3('0x19')](_0xd9a3('0x62'),_0x1b535a[_0xd9a3('0x8')]),_0x1b535a);utils[_0xd9a3('0xa')](util[_0xd9a3('0x19')](_0xd9a3('0x63'),_0x1b535a[_0xd9a3('0x8')],_0x1b535a[_0xd9a3('0x64')],_0x1b535a[_0xd9a3('0x65')]));if(_0x1b535a[_0xd9a3('0x64')][_0xd9a3('0x66')]()==_0xd9a3('0x67')&&_[_0xd9a3('0x68')](_0x1b535a[_0xd9a3('0x65')][_0xd9a3('0x66')](),_0xd9a3('0x69'))){var _0x3389c5=_0x1b535a['appdata'][_0xd9a3('0x6a')]('=');var _0x435d06=_0x3389c5[0x0][_0xd9a3('0x6b')](_0x3389c5[0x0][_0xd9a3('0x6c')]('(')+0x1,_0x3389c5[0x0][_0xd9a3('0x6c')](')'));var _0x4f397f=_0x3389c5[0x1];channels[_0x1b535a[_0xd9a3('0x8')]][_0x435d06]=_0x4f397f;}if(!_['includes'](['hangup',_0xd9a3('0x6d'),_0xd9a3('0x6e'),'set',_0xd9a3('0x6f')],_0x1b535a[_0xd9a3('0x64')]['toLowerCase']())){channels[_0x1b535a['uniqueid']][_0xd9a3('0x55')]=_0x1b535a[_0xd9a3('0x64')];channels[_0x1b535a[_0xd9a3('0x8')]][_0xd9a3('0x57')]=_0x1b535a[_0xd9a3('0x65')];}}}catch(_0x191174){utils['error'](util[_0xd9a3('0x19')](_0xd9a3('0x62'),_0x1b535a['uniqueid']),_0x191174);}}; \ No newline at end of file +var _0xce14=['[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lastapplication','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','recording','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','format','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','debug'];(function(_0x2805a5,_0x2f5620){var _0x4ba4ab=function(_0x3028dc){while(--_0x3028dc){_0x2805a5['push'](_0x2805a5['shift']());}};_0x4ba4ab(++_0x2f5620);}(_0xce14,0x17f));var _0x4ce1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xce14[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4ce1('0x0'));var utils=require('./utils');var transfers=require(_0x4ce1('0x1'));var dispositions=[_0x4ce1('0x2'),'FAILED',_0x4ce1('0x3'),_0x4ce1('0x2'),_0x4ce1('0x2'),_0x4ce1('0x2'),_0x4ce1('0x4'),'BUSY',_0x4ce1('0x3'),_0x4ce1('0x3'),_0x4ce1('0x3')];var channels={};function writeDB(_0x2b9923){var _0x539c1d;if(transfers[_0x4ce1('0x5')][_0x2b9923[_0x4ce1('0x6')]]){_0x539c1d=_0x2b9923[_0x4ce1('0x6')];_0x2b9923['uniqueid']=transfers[_0x4ce1('0x5')][_0x2b9923[_0x4ce1('0x6')]][_0x4ce1('0x7')];}utils[_0x4ce1('0x8')](util['format'](_0x4ce1('0x9'),_0x2b9923[_0x4ce1('0x6')],_0x2b9923[_0x4ce1('0xa')],_0x2b9923[_0x4ce1('0xb')],_0x2b9923['membername'],_0x2b9923[_0x4ce1('0xc')],_0x2b9923[_0x4ce1('0xd')],_0x2b9923[_0x4ce1('0xe')],_0x2b9923[_0x4ce1('0xf')]));if(_0x2b9923[_0x4ce1('0x10')]){utils[_0x4ce1('0x11')](_0x2b9923[_0x4ce1('0x10')])[_0x4ce1('0x12')](function(_0x45f57e){if(_0x45f57e){_0x2b9923[_0x4ce1('0x13')]=_0x45f57e['id'];}utils[_0x4ce1('0x14')]('CreateVoiceCallReport',_0x2b9923);});}else{utils[_0x4ce1('0x14')]('CreateVoiceCallReport',_0x2b9923);}if(channels[_0x2b9923[_0x4ce1('0x6')]]){delete channels[_0x2b9923[_0x4ce1('0x6')]];}else if(_0x539c1d&&channels[_0x539c1d]){if(!transfers[_0x4ce1('0x5')][_0x539c1d][_0x4ce1('0x15')])delete transfers['blinds'][_0x539c1d];delete channels[_0x539c1d];}}exports[_0x4ce1('0x16')]=function(_0x503b05){try{utils['debug'](util['format'](_0x4ce1('0x17'),_0x503b05[_0x4ce1('0x6')]),_0x503b05);if(_0x503b05[_0x4ce1('0x6')]==_0x503b05[_0x4ce1('0x18')]&&_0x503b05['channel']!=_0x4ce1('0x19')){utils['info'](util['format'](_0x4ce1('0x1a'),_0x503b05[_0x4ce1('0x6')],_0x503b05[_0x4ce1('0x1b')],_0x503b05[_0x4ce1('0x1c')]));channels[_0x503b05[_0x4ce1('0x6')]]={'uniqueid':_0x503b05[_0x4ce1('0x6')],'accountcode':_0x503b05[_0x4ce1('0x10')],'source':_0x503b05[_0x4ce1('0xd')],'destination':_0x503b05['exten'],'destinationcontext':_0x503b05[_0x4ce1('0x1b')],'channel':_0x503b05[_0x4ce1('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4ce1('0x2'),'amaflags':_0x4ce1('0x1d')};}}catch(_0x5aa1c2){utils[_0x4ce1('0x1e')](util[_0x4ce1('0x1f')]('[%s][calls][newchannel]',_0x503b05['uniqueid']),_0x5aa1c2);}};exports['newstate']=function(_0x7cd94b){try{utils['debug'](util[_0x4ce1('0x1f')](_0x4ce1('0x20'),_0x7cd94b['uniqueid']),_0x7cd94b);if(!_[_0x4ce1('0x21')](channels[_0x7cd94b[_0x4ce1('0x6')]])&&_0x7cd94b[_0x4ce1('0x22')]==0x6){utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x23'),_0x7cd94b[_0x4ce1('0x6')],_0x7cd94b[_0x4ce1('0x1b')],_0x7cd94b[_0x4ce1('0xa')]));if(_[_0x4ce1('0x21')](channels[_0x7cd94b[_0x4ce1('0x6')]][_0x4ce1('0x24')])){channels[_0x7cd94b[_0x4ce1('0x6')]][_0x4ce1('0x24')]=utils[_0x4ce1('0x25')]();}}else if(!_[_0x4ce1('0x21')](channels[_0x7cd94b[_0x4ce1('0x18')]])&&_0x7cd94b[_0x4ce1('0x22')]==0x6&&_0x7cd94b['context']!=_0x4ce1('0x26')){utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x27'),_0x7cd94b[_0x4ce1('0x6')],_0x7cd94b[_0x4ce1('0x18')],_0x7cd94b['context'],_0x7cd94b[_0x4ce1('0xa')]));channels[_0x7cd94b[_0x4ce1('0x18')]][_0x4ce1('0x10')]=_0x7cd94b['accountcode'];channels[_0x7cd94b['linkedid']][_0x4ce1('0x28')]=_0x7cd94b[_0x4ce1('0xa')];if(_[_0x4ce1('0x21')](channels[_0x7cd94b[_0x4ce1('0x18')]][_0x4ce1('0x29')])){channels[_0x7cd94b[_0x4ce1('0x18')]]['answertime']=utils['now']();}channels[_0x7cd94b[_0x4ce1('0x18')]][_0x4ce1('0x2a')]=dispositions[_['toNumber'](_0x7cd94b[_0x4ce1('0x22')])]||_0x4ce1('0x4');}}catch(_0x246e15){utils[_0x4ce1('0x1e')](util[_0x4ce1('0x1f')](_0x4ce1('0x20'),_0x7cd94b[_0x4ce1('0x6')]),_0x246e15);}};exports[_0x4ce1('0x2b')]=function(_0x3561fb){try{if(!_[_0x4ce1('0x21')](channels[_0x3561fb[_0x4ce1('0x6')]])){utils['debug'](util[_0x4ce1('0x1f')](_0x4ce1('0x2c'),_0x3561fb[_0x4ce1('0x6')]),_0x3561fb);if(_['isNil'](channels[_0x3561fb['uniqueid']][_0x4ce1('0x2d')])){channels[_0x3561fb['uniqueid']][_0x4ce1('0x2d')]=_0x3561fb[_0x4ce1('0x2e')]+'\x20<'+_0x3561fb[_0x4ce1('0xd')]+'>';}utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x2f'),_0x3561fb[_0x4ce1('0x6')],channels[_0x3561fb['uniqueid']]['callerid'],_0x3561fb[_0x4ce1('0x30')]));channels[_0x3561fb[_0x4ce1('0x6')]][_0x4ce1('0x31')]=utils[_0x4ce1('0x25')]();channels[_0x3561fb[_0x4ce1('0x6')]][_0x4ce1('0x32')]=utils['diffTime'](channels[_0x3561fb[_0x4ce1('0x6')]][_0x4ce1('0x31')],channels[_0x3561fb[_0x4ce1('0x6')]][_0x4ce1('0x33')]);channels[_0x3561fb[_0x4ce1('0x6')]]['billableseconds']=channels[_0x3561fb[_0x4ce1('0x6')]][_0x4ce1('0x29')]?utils[_0x4ce1('0x34')](channels[_0x3561fb[_0x4ce1('0x6')]][_0x4ce1('0x31')],channels[_0x3561fb[_0x4ce1('0x6')]][_0x4ce1('0x29')]):0x0;writeDB(channels[_0x3561fb[_0x4ce1('0x6')]]);}}catch(_0x488386){utils[_0x4ce1('0x1e')](util[_0x4ce1('0x1f')](_0x4ce1('0x2c'),_0x3561fb[_0x4ce1('0x6')]),_0x488386);}};exports[_0x4ce1('0x35')]=function(_0x3928ec){try{if(!_[_0x4ce1('0x21')](channels[_0x3928ec[_0x4ce1('0x36')]])){utils['debug'](util[_0x4ce1('0x1f')](_0x4ce1('0x37'),_0x3928ec[_0x4ce1('0x38')]),_0x3928ec);if(channels[_0x3928ec[_0x4ce1('0x36')]][_0x4ce1('0xa')]==_0x3928ec[_0x4ce1('0x39')]){utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x3a'),_0x3928ec['origtransfereruniqueid'],_0x3928ec[_0x4ce1('0x36')],_0x3928ec[_0x4ce1('0x3b')]));channels[_0x3928ec[_0x4ce1('0x36')]]['destinationchannel']=_0x3928ec[_0x4ce1('0x3b')];channels[_0x3928ec[_0x4ce1('0x36')]][_0x4ce1('0x3c')]=_0x4ce1('0x3d');}else if(channels[_0x3928ec['localtwolinkedid']][_0x4ce1('0xa')]=_0x3928ec[_0x4ce1('0x3e')]){utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3928ec['origtransfereruniqueid'],_0x3928ec[_0x4ce1('0x36')],_0x3928ec['origtransfererchannel']));channels[_0x3928ec[_0x4ce1('0x36')]][_0x4ce1('0x28')]=_0x3928ec[_0x4ce1('0x3f')];channels[_0x3928ec[_0x4ce1('0x36')]][_0x4ce1('0x3c')]=_0x4ce1('0x3d');}}}catch(_0x4e8c05){utils[_0x4ce1('0x1e')](util[_0x4ce1('0x1f')]('[%s][calls][attendedtransfer]',_0x3928ec[_0x4ce1('0x38')]),_0x4e8c05);}};exports['musiconholdstart']=function(_0x1719e7){try{if(!_[_0x4ce1('0x21')](channels[_0x1719e7['uniqueid']])){utils[_0x4ce1('0x40')](util['format'](_0x4ce1('0x41'),_0x1719e7[_0x4ce1('0x6')]),_0x1719e7);channels[_0x1719e7[_0x4ce1('0x6')]]['musiconholdstartAt']=utils[_0x4ce1('0x25')]();utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x42'),_0x1719e7[_0x4ce1('0x6')],channels[_0x1719e7[_0x4ce1('0x6')]][_0x4ce1('0x43')]));}}catch(_0x58e6c4){utils[_0x4ce1('0x1e')](util[_0x4ce1('0x1f')](_0x4ce1('0x41'),_0x1719e7['uniqueid']),_0x58e6c4);}};exports[_0x4ce1('0x44')]=function(_0xe7e376){try{if(!_[_0x4ce1('0x21')](channels[_0xe7e376['uniqueid']])){utils[_0x4ce1('0x40')](util[_0x4ce1('0x1f')]('[%s][calls][musiconholdstop]',_0xe7e376['uniqueid']),_0xe7e376);if(!_[_0x4ce1('0x21')](channels[_0xe7e376[_0x4ce1('0x6')]]['musiconholdstartAt'])){channels[_0xe7e376[_0x4ce1('0x6')]][_0x4ce1('0x45')]+=utils[_0x4ce1('0x34')](utils[_0x4ce1('0x25')](),channels[_0xe7e376['uniqueid']][_0x4ce1('0x43')]);utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x46'),_0xe7e376['uniqueid'],channels[_0xe7e376['uniqueid']]['mohtime']));delete channels[_0xe7e376['uniqueid']][_0x4ce1('0x43')];}}}catch(_0x3d7bc1){utils[_0x4ce1('0x1e')](util[_0x4ce1('0x1f')](_0x4ce1('0x47'),_0xe7e376['uniqueid']),_0x3d7bc1);}};exports[_0x4ce1('0x48')]=function(_0x203f2e){try{if(!_['isNil'](channels[_0x203f2e['uniqueid']])){utils[_0x4ce1('0x40')](util[_0x4ce1('0x1f')](_0x4ce1('0x49'),_0x203f2e[_0x4ce1('0x6')]),_0x203f2e);if(!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')][_0x4ce1('0x4b')])){utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x4c'),_0x203f2e[_0x4ce1('0x6')],_0x203f2e[_0x4ce1('0x4d')]));channels[_0x203f2e[_0x4ce1('0x6')]][_0x4ce1('0x4e')]=_0x203f2e[_0x4ce1('0x4d')];}if(!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')][_0x4ce1('0x4f')])){utils['info'](util[_0x4ce1('0x1f')](_0x4ce1('0x50'),_0x203f2e[_0x4ce1('0x6')],_0x203f2e['value']));channels[_0x203f2e[_0x4ce1('0x6')]][_0x4ce1('0x51')]=_0x203f2e[_0x4ce1('0x4d')];channels[_0x203f2e[_0x4ce1('0x6')]][_0x4ce1('0x2d')]='\x22'+_0x203f2e[_0x4ce1('0x4d')]+_0x4ce1('0x52')+_0x203f2e[_0x4ce1('0x4d')]+'>';}if(!_[_0x4ce1('0x21')](_0x203f2e['variable']['xmd-callerid-preview'])||!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')]['xmd-callerid'])){utils[_0x4ce1('0x8')](util['format'](_0x4ce1('0x53'),_0x203f2e[_0x4ce1('0x6')],!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')][_0x4ce1('0x54')])?_0x4ce1('0x54'):_0x4ce1('0x55'),_0x203f2e[_0x4ce1('0x4d')]));channels[_0x203f2e[_0x4ce1('0x6')]][_0x4ce1('0x2d')]=_0x203f2e[_0x4ce1('0x4d')];}if(!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')][_0x4ce1('0x56')])||!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')][_0x4ce1('0x57')])){utils['info'](util[_0x4ce1('0x1f')](_0x4ce1('0x53'),_0x203f2e[_0x4ce1('0x6')],!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')][_0x4ce1('0x56')])?_0x4ce1('0x56'):_0x4ce1('0x57'),_0x203f2e[_0x4ce1('0x4d')]));channels[_0x203f2e['uniqueid']]['lastapplication']=_0x4ce1('0x58');channels[_0x203f2e[_0x4ce1('0x6')]][_0x4ce1('0x59')]=_0x203f2e['value'];channels[_0x203f2e[_0x4ce1('0x6')]]['queue']=!![];}if(!_[_0x4ce1('0x21')](_0x203f2e['variable'][_0x4ce1('0x5a')])){utils[_0x4ce1('0x8')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x203f2e[_0x4ce1('0x6')],_0x203f2e['value']));channels[_0x203f2e['uniqueid']]['ContactId']=_0x203f2e[_0x4ce1('0x4d')];}if(!_['isNil'](_0x203f2e[_0x4ce1('0x4a')][_0x4ce1('0x5b')])){utils[_0x4ce1('0x8')](util[_0x4ce1('0x1f')](_0x4ce1('0x5c'),_0x203f2e[_0x4ce1('0x6')],_0x203f2e[_0x4ce1('0x4d')]));channels[_0x203f2e[_0x4ce1('0x6')]]['type']=_0x203f2e[_0x4ce1('0x4d')];}if(!_[_0x4ce1('0x21')](_0x203f2e[_0x4ce1('0x4a')]['outboundrouteid'])){utils[_0x4ce1('0x8')](util['format'](_0x4ce1('0x5d'),_0x203f2e[_0x4ce1('0x6')],_0x203f2e[_0x4ce1('0x4d')]));channels[_0x203f2e['uniqueid']]['routeid']=_0x203f2e[_0x4ce1('0x4d')];}if(!_['isNil'](_0x203f2e['variable'][_0x4ce1('0x5e')])){utils[_0x4ce1('0x8')](util['format'](_0x4ce1('0x5f'),_0x203f2e[_0x4ce1('0x6')],_0x203f2e[_0x4ce1('0x4d')]));channels[_0x203f2e[_0x4ce1('0x6')]][_0x4ce1('0x5e')]=_0x203f2e[_0x4ce1('0x4d')];}}}catch(_0x5bfc00){utils['error'](util[_0x4ce1('0x1f')](_0x4ce1('0x49'),_0x203f2e[_0x4ce1('0x6')]),_0x5bfc00);}};exports[_0x4ce1('0x60')]=function(_0x3147f7){try{if(!_[_0x4ce1('0x21')](channels[_0x3147f7[_0x4ce1('0x6')]])){utils[_0x4ce1('0x40')](util[_0x4ce1('0x1f')](_0x4ce1('0x61'),_0x3147f7[_0x4ce1('0x6')]),_0x3147f7);utils[_0x4ce1('0x8')](util['format'](_0x4ce1('0x62'),_0x3147f7[_0x4ce1('0x6')],_0x3147f7[_0x4ce1('0x63')],_0x3147f7[_0x4ce1('0x64')]));if(_0x3147f7[_0x4ce1('0x63')][_0x4ce1('0x65')]()==_0x4ce1('0x66')&&_[_0x4ce1('0x67')](_0x3147f7[_0x4ce1('0x64')]['toLowerCase'](),_0x4ce1('0x68'))){var _0x235d7c=_0x3147f7['appdata'][_0x4ce1('0x69')]('=');var _0x2bb7c9=_0x235d7c[0x0][_0x4ce1('0x6a')](_0x235d7c[0x0][_0x4ce1('0x6b')]('(')+0x1,_0x235d7c[0x0][_0x4ce1('0x6b')](')'));var _0x28e86d=_0x235d7c[0x1];channels[_0x3147f7[_0x4ce1('0x6')]][_0x2bb7c9]=_0x28e86d;}if(!_[_0x4ce1('0x6c')]([_0x4ce1('0x2b'),_0x4ce1('0x6d'),'execif',_0x4ce1('0x66'),_0x4ce1('0x6e')],_0x3147f7['application'][_0x4ce1('0x65')]())){channels[_0x3147f7['uniqueid']][_0x4ce1('0x6f')]=_0x3147f7[_0x4ce1('0x63')];channels[_0x3147f7[_0x4ce1('0x6')]][_0x4ce1('0x59')]=_0x3147f7[_0x4ce1('0x64')];}}}catch(_0x49676d){utils[_0x4ce1('0x1e')](util['format'](_0x4ce1('0x61'),_0x3147f7['uniqueid']),_0x49676d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4a5eec2..282c380 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 _0x745a=['info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x1f2c15,_0x202189){var _0x16a8bf=function(_0x2dbdca){while(--_0x2dbdca){_0x1f2c15['push'](_0x1f2c15['shift']());}};_0x16a8bf(++_0x202189);}(_0x745a,0x1df));var _0xa745=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x745a[_0x11005e];return _0x29338f;};'use strict';var utils=require(_0xa745('0x0'));exports[_0xa745('0x1')]=function(){utils[_0xa745('0x2')](_0xa745('0x3'));};exports[_0xa745('0x4')]=function(){utils[_0xa745('0x2')](_0xa745('0x5'));};exports[_0xa745('0x6')]=function(){utils[_0xa745('0x2')](_0xa745('0x7'));};exports[_0xa745('0x8')]=function(_0x42cda9){utils['error'](_0xa745('0x9'),_0x42cda9);};exports[_0xa745('0xa')]=function(){utils[_0xa745('0x2')](_0xa745('0xb'));};exports[_0xa745('0xc')]=function(_0x4be5d5){}; \ No newline at end of file +var _0x6cfe=['shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','info','[core]\x20close','managerevent','./utils','connect'];(function(_0x16a8ab,_0x5117a0){var _0x2918f9=function(_0x532750){while(--_0x532750){_0x16a8ab['push'](_0x16a8ab['shift']());}};_0x2918f9(++_0x5117a0);}(_0x6cfe,0x142));var _0xe6cf=function(_0x12a429,_0x1df9cc){_0x12a429=_0x12a429-0x0;var _0x2f0688=_0x6cfe[_0x12a429];return _0x2f0688;};'use strict';var utils=require(_0xe6cf('0x0'));exports[_0xe6cf('0x1')]=function(){utils['info']('[core]\x20connected');};exports[_0xe6cf('0x2')]=function(){utils['info'](_0xe6cf('0x3'));};exports['fullybooted']=function(){utils['info'](_0xe6cf('0x4'));};exports[_0xe6cf('0x5')]=function(_0x2702a8){utils[_0xe6cf('0x5')]('[core]\x20error',_0x2702a8);};exports['close']=function(){utils[_0xe6cf('0x6')](_0xe6cf('0x7'));};exports[_0xe6cf('0x8')]=function(_0x3ae619){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 37196cb..2d3cf9a 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 _0x0838=['endtime','holdtime','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','request','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','dialstatus','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','complete','duration','diffTime'];(function(_0x425561,_0x3a4598){var _0x303b28=function(_0x42f9f3){while(--_0x42f9f3){_0x425561['push'](_0x425561['shift']());}};_0x303b28(++_0x3a4598);}(_0x0838,0x12f));var _0x8083=function(_0x1d4af2,_0x320aca){_0x1d4af2=_0x1d4af2-0x0;var _0x3f9877=_0x0838[_0x1d4af2];return _0x3f9877;};'use strict';var _=require(_0x8083('0x0'));var util=require(_0x8083('0x1'));var utils=require(_0x8083('0x2'));var dials={};function writeDB(_0x126036){utils[_0x8083('0x3')](util[_0x8083('0x4')](_0x8083('0x5'),_0x126036[_0x8083('0x6')],_0x126036[_0x8083('0x7')],_0x126036['dialstring'],_0x126036['calleridnum'],_0x126036['connectedlinenum'],_0x126036['dialstatus']));utils[_0x8083('0x8')]('CreateVoiceDialReport',_0x126036);delete dials[_0x126036[_0x8083('0x6')]];}exports[_0x8083('0x9')]=function(_0x2a4f3c){try{utils[_0x8083('0xa')](util[_0x8083('0x4')]('[%s][dials][newexten]',_0x2a4f3c[_0x8083('0x6')]),_0x2a4f3c);utils['info'](util['format'](_0x8083('0xb'),_0x2a4f3c[_0x8083('0x6')],_0x2a4f3c[_0x8083('0xc')],_0x2a4f3c[_0x8083('0xd')]));if(_0x2a4f3c[_0x8083('0xc')][_0x8083('0xe')]()==_0x8083('0xf')&&_[_0x8083('0x10')](_0x2a4f3c[_0x8083('0xd')][_0x8083('0xe')](),_0x8083('0x11'))){var _0x312846=_0x2a4f3c[_0x8083('0xd')][_0x8083('0x12')]('=');dials[_0x2a4f3c[_0x8083('0x6')]]={'routeId':_0x312846[0x1]};}}catch(_0x2e03a9){utils[_0x8083('0x13')](util[_0x8083('0x4')](_0x8083('0x14'),_0x2a4f3c[_0x8083('0x6')]),_0x2e03a9);}};exports[_0x8083('0x15')]=function(_0x3cc683){try{utils['debug'](util[_0x8083('0x4')](_0x8083('0x16'),_0x3cc683[_0x8083('0x6')]),_0x3cc683);if(!_[_0x8083('0x17')](_0x3cc683['variable'][_0x8083('0x18')])){utils['info'](util[_0x8083('0x4')](_0x8083('0x19'),_0x3cc683[_0x8083('0x6')],_0x3cc683[_0x8083('0x1a')]));dials[_0x3cc683[_0x8083('0x6')]]={'routeId':_0x3cc683[_0x8083('0x1a')]};}}catch(_0x37341f){utils[_0x8083('0x13')](util[_0x8083('0x4')]('[%s][dials][varset]',_0x3cc683[_0x8083('0x6')]),_0x37341f);}};exports['dialbegin']=function(_0x44d229){try{if(!_[_0x8083('0x17')](dials[_0x44d229[_0x8083('0x6')]])){utils[_0x8083('0xa')](util[_0x8083('0x4')](_0x8083('0x1b'),_0x44d229[_0x8083('0x6')]),_0x44d229);dials[_0x44d229['uniqueid']]=_[_0x8083('0x1c')](dials[_0x44d229['uniqueid']],_0x44d229);dials[_0x44d229['uniqueid']][_0x8083('0x1d')]=utils[_0x8083('0x1e')]();dials[_0x44d229[_0x8083('0x6')]]['lastevent']=_0x8083('0x1f');utils[_0x8083('0x3')](util[_0x8083('0x4')](_0x8083('0x20'),_0x44d229[_0x8083('0x6')],dials[_0x44d229[_0x8083('0x6')]][_0x8083('0x1d')]));}}catch(_0x56153b){utils[_0x8083('0x13')](util[_0x8083('0x4')](_0x8083('0x1b'),_0x44d229['uniqueid']),_0x56153b);}};exports[_0x8083('0x21')]=function(_0x5b7393){try{if(!_[_0x8083('0x17')](dials[_0x5b7393[_0x8083('0x6')]])){utils[_0x8083('0xa')](util[_0x8083('0x4')]('[%s][dials][dialend]',_0x5b7393[_0x8083('0x6')]),_0x5b7393);dials[_0x5b7393[_0x8083('0x6')]][_0x8083('0x22')]=_0x5b7393[_0x8083('0x22')];if(_0x5b7393[_0x8083('0x22')]=='ANSWER'){dials[_0x5b7393['uniqueid']]=_[_0x8083('0x1c')](dials[_0x5b7393['uniqueid']],_0x5b7393);dials[_0x5b7393[_0x8083('0x6')]]['answertime']=utils[_0x8083('0x1e')]();dials[_0x5b7393[_0x8083('0x6')]][_0x8083('0x23')]=_0x8083('0x24');utils[_0x8083('0x3')](util['format'](_0x8083('0x25'),_0x5b7393[_0x8083('0x6')],_0x5b7393['dialstatus'],dials[_0x5b7393[_0x8083('0x6')]][_0x8083('0x26')]));}else{utils[_0x8083('0x3')](util[_0x8083('0x4')](_0x8083('0x27'),_0x5b7393[_0x8083('0x6')],_0x5b7393[_0x8083('0x22')]));}}}catch(_0x1e8601){utils['error'](util[_0x8083('0x4')](_0x8083('0x28'),_0x5b7393[_0x8083('0x6')]),_0x1e8601);}};exports['hangup']=function(_0x183ad3){try{if(!_[_0x8083('0x17')](dials[_0x183ad3[_0x8083('0x6')]])){utils[_0x8083('0xa')](util[_0x8083('0x4')]('[%s][dials][hangup]',_0x183ad3[_0x8083('0x6')]),_0x183ad3);utils['info'](util[_0x8083('0x4')](_0x8083('0x29'),_0x183ad3[_0x8083('0x6')],_0x183ad3[_0x8083('0x2a')],_0x183ad3[_0x8083('0x2b')],_0x183ad3['cause-txt']));dials[_0x183ad3[_0x8083('0x6')]]=_[_0x8083('0x1c')](dials[_0x183ad3[_0x8083('0x6')]],{'endtime':utils[_0x8083('0x1e')](),'lastevent':_0x8083('0x2c')});dials[_0x183ad3[_0x8083('0x6')]][_0x8083('0x2d')]=utils[_0x8083('0x2e')](dials[_0x183ad3[_0x8083('0x6')]][_0x8083('0x2f')],dials[_0x183ad3[_0x8083('0x6')]][_0x8083('0x1d')]);dials[_0x183ad3['uniqueid']][_0x8083('0x30')]=utils[_0x8083('0x2e')](dials[_0x183ad3['uniqueid']]['answertime']||dials[_0x183ad3[_0x8083('0x6')]][_0x8083('0x2f')],dials[_0x183ad3[_0x8083('0x6')]][_0x8083('0x1d')]);dials[_0x183ad3[_0x8083('0x6')]]['billableseconds']=dials[_0x183ad3[_0x8083('0x6')]][_0x8083('0x26')]?utils[_0x8083('0x2e')](dials[_0x183ad3['uniqueid']][_0x8083('0x2f')],dials[_0x183ad3['uniqueid']]['answertime']):0x0;writeDB(dials[_0x183ad3['uniqueid']]);}}catch(_0x27e303){utils[_0x8083('0x13')](util[_0x8083('0x4')](_0x8083('0x31'),_0x183ad3[_0x8083('0x6')]),_0x27e303);}}; \ No newline at end of file +var _0x0b97=['format','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','uniqueid','application','appdata','startsWith','cdr(routeid)','split','error','isNil','variable','outboundrouteid','value','[%s][dials][varset]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','cause-txt','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x0b97,0x116));var _0x70b9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0b97[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x70b9('0x0'));var util=require(_0x70b9('0x1'));var utils=require(_0x70b9('0x2'));var dials={};function writeDB(_0x2276dc){utils[_0x70b9('0x3')](util[_0x70b9('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x2276dc['uniqueid'],_0x2276dc[_0x70b9('0x5')],_0x2276dc[_0x70b9('0x6')],_0x2276dc[_0x70b9('0x7')],_0x2276dc[_0x70b9('0x8')],_0x2276dc[_0x70b9('0x9')]));utils[_0x70b9('0xa')](_0x70b9('0xb'),_0x2276dc);delete dials[_0x2276dc['uniqueid']];}exports[_0x70b9('0xc')]=function(_0x4345d5){try{utils[_0x70b9('0xd')](util[_0x70b9('0x4')](_0x70b9('0xe'),_0x4345d5['uniqueid']),_0x4345d5);utils[_0x70b9('0x3')](util['format'](_0x70b9('0xf'),_0x4345d5[_0x70b9('0x10')],_0x4345d5[_0x70b9('0x11')],_0x4345d5[_0x70b9('0x12')]));if(_0x4345d5[_0x70b9('0x11')]['toLowerCase']()=='set'&&_[_0x70b9('0x13')](_0x4345d5[_0x70b9('0x12')]['toLowerCase'](),_0x70b9('0x14'))){var _0xcb0ecf=_0x4345d5[_0x70b9('0x12')][_0x70b9('0x15')]('=');dials[_0x4345d5[_0x70b9('0x10')]]={'routeId':_0xcb0ecf[0x1]};}}catch(_0x294960){utils[_0x70b9('0x16')](util[_0x70b9('0x4')](_0x70b9('0xe'),_0x4345d5['uniqueid']),_0x294960);}};exports['varset']=function(_0x3f4b88){try{utils[_0x70b9('0xd')](util[_0x70b9('0x4')]('[%s][dials][varset]',_0x3f4b88['uniqueid']),_0x3f4b88);if(!_[_0x70b9('0x17')](_0x3f4b88[_0x70b9('0x18')][_0x70b9('0x19')])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3f4b88[_0x70b9('0x10')],_0x3f4b88[_0x70b9('0x1a')]));dials[_0x3f4b88[_0x70b9('0x10')]]={'routeId':_0x3f4b88[_0x70b9('0x1a')]};}}catch(_0x5daf1b){utils[_0x70b9('0x16')](util[_0x70b9('0x4')](_0x70b9('0x1b'),_0x3f4b88['uniqueid']),_0x5daf1b);}};exports['dialbegin']=function(_0x31e309){try{if(!_[_0x70b9('0x17')](dials[_0x31e309['uniqueid']])){utils[_0x70b9('0xd')](util['format']('[%s][dials][dialbegin]',_0x31e309[_0x70b9('0x10')]),_0x31e309);dials[_0x31e309[_0x70b9('0x10')]]=_[_0x70b9('0x1c')](dials[_0x31e309[_0x70b9('0x10')]],_0x31e309);dials[_0x31e309['uniqueid']][_0x70b9('0x1d')]=utils[_0x70b9('0x1e')]();dials[_0x31e309[_0x70b9('0x10')]][_0x70b9('0x1f')]=_0x70b9('0x20');utils['info'](util[_0x70b9('0x4')](_0x70b9('0x21'),_0x31e309[_0x70b9('0x10')],dials[_0x31e309[_0x70b9('0x10')]][_0x70b9('0x1d')]));}}catch(_0x1e5e80){utils[_0x70b9('0x16')](util[_0x70b9('0x4')](_0x70b9('0x22'),_0x31e309[_0x70b9('0x10')]),_0x1e5e80);}};exports['dialend']=function(_0x5c24f8){try{if(!_[_0x70b9('0x17')](dials[_0x5c24f8[_0x70b9('0x10')]])){utils['debug'](util['format']('[%s][dials][dialend]',_0x5c24f8[_0x70b9('0x10')]),_0x5c24f8);dials[_0x5c24f8['uniqueid']][_0x70b9('0x9')]=_0x5c24f8[_0x70b9('0x9')];if(_0x5c24f8['dialstatus']==_0x70b9('0x23')){dials[_0x5c24f8[_0x70b9('0x10')]]=_[_0x70b9('0x1c')](dials[_0x5c24f8[_0x70b9('0x10')]],_0x5c24f8);dials[_0x5c24f8[_0x70b9('0x10')]]['answertime']=utils[_0x70b9('0x1e')]();dials[_0x5c24f8['uniqueid']]['lastevent']=_0x70b9('0x24');utils[_0x70b9('0x3')](util[_0x70b9('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x5c24f8[_0x70b9('0x10')],_0x5c24f8[_0x70b9('0x9')],dials[_0x5c24f8['uniqueid']][_0x70b9('0x25')]));}else{utils[_0x70b9('0x3')](util['format'](_0x70b9('0x26'),_0x5c24f8[_0x70b9('0x10')],_0x5c24f8[_0x70b9('0x9')]));}}}catch(_0x1ee262){utils[_0x70b9('0x16')](util[_0x70b9('0x4')](_0x70b9('0x27'),_0x5c24f8['uniqueid']),_0x1ee262);}};exports[_0x70b9('0x28')]=function(_0x5c0715){try{if(!_[_0x70b9('0x17')](dials[_0x5c0715[_0x70b9('0x10')]])){utils['debug'](util[_0x70b9('0x4')](_0x70b9('0x29'),_0x5c0715[_0x70b9('0x10')]),_0x5c0715);utils[_0x70b9('0x3')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x5c0715['uniqueid'],_0x5c0715[_0x70b9('0x7')],_0x5c0715['calleridname'],_0x5c0715[_0x70b9('0x2a')]));dials[_0x5c0715[_0x70b9('0x10')]]=_[_0x70b9('0x1c')](dials[_0x5c0715[_0x70b9('0x10')]],{'endtime':utils[_0x70b9('0x1e')](),'lastevent':'complete'});dials[_0x5c0715[_0x70b9('0x10')]]['duration']=utils[_0x70b9('0x2b')](dials[_0x5c0715[_0x70b9('0x10')]][_0x70b9('0x2c')],dials[_0x5c0715[_0x70b9('0x10')]][_0x70b9('0x1d')]);dials[_0x5c0715['uniqueid']][_0x70b9('0x2d')]=utils[_0x70b9('0x2b')](dials[_0x5c0715[_0x70b9('0x10')]]['answertime']||dials[_0x5c0715[_0x70b9('0x10')]][_0x70b9('0x2c')],dials[_0x5c0715[_0x70b9('0x10')]]['starttime']);dials[_0x5c0715[_0x70b9('0x10')]][_0x70b9('0x2e')]=dials[_0x5c0715[_0x70b9('0x10')]][_0x70b9('0x25')]?utils[_0x70b9('0x2b')](dials[_0x5c0715['uniqueid']][_0x70b9('0x2c')],dials[_0x5c0715['uniqueid']][_0x70b9('0x25')]):0x0;writeDB(dials[_0x5c0715[_0x70b9('0x10')]]);}}catch(_0x5bd938){utils['error'](util[_0x70b9('0x4')](_0x70b9('0x29'),_0x5c0715[_0x70b9('0x10')]),_0x5bd938);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index f47896c..beb0df9 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 _0xbb4d=['[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','port','asterisk','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','format','device','devicestatechange','[%s][index][devicestatechange]','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin'];(function(_0x1b3934,_0xee4663){var _0x92fad5=function(_0xefa5ea){while(--_0xefa5ea){_0x1b3934['push'](_0x1b3934['shift']());}};_0x92fad5(++_0xee4663);}(_0xbb4d,0xa6));var _0xdbb4=function(_0x350281,_0x6e5133){_0x350281=_0x350281-0x0;var _0x1eb3e6=_0xbb4d[_0x350281];return _0x1eb3e6;};var AsteriskManager=require(_0xdbb4('0x0'));var config=require(_0xdbb4('0x1'));var utils=require(_0xdbb4('0x2'));var util=require(_0xdbb4('0x3'));var isXDREnabled=config['xdr']&&config['xdr']['disabled']?!config[_0xdbb4('0x4')][_0xdbb4('0x5')]:!![];var isProduction=config['env']===_0xdbb4('0x6')||![];var isLocalAsterisk=config[_0xdbb4('0x4')]&&config[_0xdbb4('0x4')][_0xdbb4('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xdbb4('0x8')],config['asterisk']['ip'],config[_0xdbb4('0x9')][_0xdbb4('0xa')],config[_0xdbb4('0x9')][_0xdbb4('0xb')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xdbb4('0xc')](_0xdbb4('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xdbb4('0xc')](_0xdbb4('0xe'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0xdbb4('0xf'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xdbb4('0x10'));var transfers=require(_0xdbb4('0x11'));var core=require(_0xdbb4('0x12'));ami['on'](_0xdbb4('0x13'),core[_0xdbb4('0x13')]);ami['on']('shutdown',core[_0xdbb4('0x14')]);ami['on'](_0xdbb4('0x15'),core[_0xdbb4('0x15')]);ami['on'](_0xdbb4('0x16'),core[_0xdbb4('0x16')]);ami['on'](_0xdbb4('0x17'),core[_0xdbb4('0x17')]);ami['on']('managerevent',core['managerevent']);ami['on']('devicestatechange',function(_0x22c16a){try{utils['debug'](util[_0xdbb4('0x18')]('[%s][index][devicestatechange]',_0x22c16a[_0xdbb4('0x19')]),_0x22c16a);members[_0xdbb4('0x1a')](_0x22c16a);}catch(_0x591e9a){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x1b'),_0x22c16a[_0xdbb4('0x19')]),_0x591e9a);}});ami['on'](_0xdbb4('0x1c'),function(_0x398ffc){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x1e'),_0x398ffc[_0xdbb4('0x1f')]),_0x398ffc);agents['agentcalled'](_0x398ffc);}catch(_0x289dff){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')]('[%s][index][agentcalled]',_0x398ffc['uniqueid']),_0x289dff);}});ami['on'](_0xdbb4('0x20'),function(_0x5a6c1b){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x21'),_0x5a6c1b[_0xdbb4('0x1f')]),_0x5a6c1b);agents[_0xdbb4('0x20')](_0x5a6c1b);}catch(_0x2b7369){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x21'),_0x5a6c1b['uniqueid']),_0x2b7369);}});ami['on']('agentconnect',function(_0x3ad5a6){try{utils[_0xdbb4('0x1d')](util['format'](_0xdbb4('0x22'),_0x3ad5a6[_0xdbb4('0x1f')]),_0x3ad5a6);agents[_0xdbb4('0x23')](_0x3ad5a6);queues['agentconnect'](_0x3ad5a6);}catch(_0x32964f){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x22'),_0x3ad5a6[_0xdbb4('0x1f')]),_0x32964f);}});ami['on'](_0xdbb4('0x24'),function(_0x5a423e){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')]('[%s][index][agentcomplete]',_0x5a423e[_0xdbb4('0x1f')]),_0x5a423e);agents[_0xdbb4('0x24')](_0x5a423e);queues[_0xdbb4('0x24')](_0x5a423e);members[_0xdbb4('0x24')](_0x5a423e);}catch(_0x33151a){utils['error'](util[_0xdbb4('0x18')](_0xdbb4('0x25'),_0x5a423e[_0xdbb4('0x1f')]),_0x33151a);}});ami['on']('queuecallerabandon',function(_0x45aa9f){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x26'),_0x45aa9f['uniqueid']),_0x45aa9f);agents[_0xdbb4('0x27')](_0x45aa9f);queues['queuecallerabandon'](_0x45aa9f);}catch(_0x126b4f){utils['error'](util[_0xdbb4('0x18')](_0xdbb4('0x26'),_0x45aa9f['uniqueid']),_0x126b4f);}});ami['on'](_0xdbb4('0x28'),function(_0x15dc06){try{utils['debug'](util[_0xdbb4('0x18')](_0xdbb4('0x29'),_0x15dc06[_0xdbb4('0x1f')]),_0x15dc06);queues['queuecallerjoin'](_0x15dc06);recordings[_0xdbb4('0x28')](_0x15dc06);}catch(_0x2be565){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x29'),_0x15dc06[_0xdbb4('0x1f')]),_0x2be565);}});ami['on'](_0xdbb4('0x2a'),function(_0x2f9aad){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x2b'),_0x2f9aad[_0xdbb4('0x1f')]),_0x2f9aad);queues[_0xdbb4('0x2a')](_0x2f9aad);}catch(_0x618785){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')]('[%s][index][queuecallerleave]',_0x2f9aad[_0xdbb4('0x1f')]),_0x618785);}});ami['on'](_0xdbb4('0x2c'),function(_0x38162b){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x2d'),_0x38162b[_0xdbb4('0x1f')]),_0x38162b);queues[_0xdbb4('0x2c')](_0x38162b);calls[_0xdbb4('0x2c')](_0x38162b);}catch(_0x4b3121){utils[_0xdbb4('0x16')](util['format'](_0xdbb4('0x2d'),_0x38162b[_0xdbb4('0x1f')]),_0x4b3121);}});ami['on']('musiconholdstop',function(_0xc907c3){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x2e'),_0xc907c3['uniqueid']),_0xc907c3);queues[_0xdbb4('0x2f')](_0xc907c3);calls[_0xdbb4('0x2f')](_0xc907c3);}catch(_0x49ae55){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x2e'),_0xc907c3['uniqueid']),_0x49ae55);}});ami['on'](_0xdbb4('0x30'),function(_0x5ea178){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x31'),_0x5ea178[_0xdbb4('0x1f')]),_0x5ea178);calls['newstate'](_0x5ea178);recordings['newstate'](_0x5ea178);}catch(_0x3e57df){utils['error'](util[_0xdbb4('0x18')](_0xdbb4('0x31'),_0x5ea178[_0xdbb4('0x1f')]),_0x3e57df);}});ami['on'](_0xdbb4('0x32'),function(_0xb8c9e7){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')]('[%s][index][hangup]',_0xb8c9e7[_0xdbb4('0x1f')]),_0xb8c9e7);calls[_0xdbb4('0x32')](_0xb8c9e7);recordings[_0xdbb4('0x32')](_0xb8c9e7);dials[_0xdbb4('0x32')](_0xb8c9e7);agents['hangup'](_0xb8c9e7);queues[_0xdbb4('0x32')](_0xb8c9e7);}catch(_0x4e1c58){utils['error'](util[_0xdbb4('0x18')](_0xdbb4('0x33'),_0xb8c9e7[_0xdbb4('0x1f')]),_0x4e1c58);}});ami['on']('cdr',function(_0x4e4e89){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')]('[%s][index][cdr]',_0x4e4e89['uniqueid']),_0x4e4e89);members['cdr'](_0x4e4e89);}catch(_0x12b477){utils['error'](util['format'](_0xdbb4('0x34'),_0x4e4e89[_0xdbb4('0x1f')]),_0x12b477);}});ami['on'](_0xdbb4('0x35'),function(_0x194673){try{utils['debug'](util[_0xdbb4('0x18')](_0xdbb4('0x36'),_0x194673[_0xdbb4('0x1f')]),_0x194673);queues[_0xdbb4('0x35')](_0x194673);agents[_0xdbb4('0x35')](_0x194673);transfers[_0xdbb4('0x35')](_0x194673);recordings[_0xdbb4('0x35')](_0x194673);}catch(_0x15ffd8){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x36'),_0x194673[_0xdbb4('0x1f')]),_0x15ffd8);}});ami['on'](_0xdbb4('0x37'),function(_0x494e64){try{utils[_0xdbb4('0x1d')](util['format'](_0xdbb4('0x38'),_0x494e64['origtransfereruniqueid']),_0x494e64);queues[_0xdbb4('0x37')](_0x494e64);transfers[_0xdbb4('0x37')](_0x494e64);agents[_0xdbb4('0x37')](_0x494e64);calls[_0xdbb4('0x37')](_0x494e64);}catch(_0x418b9b){utils[_0xdbb4('0x16')](util['format']('[%s][index][attendedtransfer]',_0x494e64[_0xdbb4('0x39')]),_0x418b9b);}});ami['on'](_0xdbb4('0x3a'),function(_0x3dcd07){try{utils['debug'](util['format'](_0xdbb4('0x3b'),_0x3dcd07[_0xdbb4('0x1f')]),_0x3dcd07);queues[_0xdbb4('0x3a')](_0x3dcd07);recordings[_0xdbb4('0x3a')](_0x3dcd07);calls[_0xdbb4('0x3a')](_0x3dcd07);dials['varset'](_0x3dcd07);}catch(_0x5c4441){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x3b'),_0x3dcd07[_0xdbb4('0x1f')]),_0x5c4441);}});ami['on']('newexten',function(_0x1359f4){try{utils['debug'](util['format'](_0xdbb4('0x3c'),_0x1359f4['uniqueid']),_0x1359f4);calls['newexten'](_0x1359f4);recordings[_0xdbb4('0x3d')](_0x1359f4);dials['newexten'](_0x1359f4);}catch(_0x23611c){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')]('[%s][index][newexten]',_0x1359f4[_0xdbb4('0x1f')]),_0x23611c);}});ami['on']('newchannel',function(_0x2cebf0){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x3e'),_0x2cebf0['uniqueid']),_0x2cebf0);calls[_0xdbb4('0x3f')](_0x2cebf0);recordings['newchannel'](_0x2cebf0);}catch(_0x40f9f1){utils[_0xdbb4('0x16')](util[_0xdbb4('0x18')](_0xdbb4('0x3e'),_0x2cebf0[_0xdbb4('0x1f')]),_0x40f9f1);}});ami['on'](_0xdbb4('0x40'),function(_0x52125d){try{utils[_0xdbb4('0x1d')](util[_0xdbb4('0x18')](_0xdbb4('0x41'),_0x52125d[_0xdbb4('0x1f')]),_0x52125d);dials[_0xdbb4('0x40')](_0x52125d);}catch(_0x49ac43){utils[_0xdbb4('0x16')](util['format'](_0xdbb4('0x42'),_0x52125d[_0xdbb4('0x1f')]),_0x49ac43);}});ami['on'](_0xdbb4('0x43'),function(_0x3e6379){try{utils['debug'](util[_0xdbb4('0x18')](_0xdbb4('0x44'),_0x3e6379[_0xdbb4('0x1f')]),_0x3e6379);dials[_0xdbb4('0x43')](_0x3e6379);}catch(_0x180f35){utils['error'](util['format'](_0xdbb4('0x44'),_0x3e6379[_0xdbb4('0x1f')]),_0x180f35);}});} \ No newline at end of file +var _0x047e=['newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','util','xdr','disabled','env','production','local','asterisk','port','username','password','info','Asterisk\x20disabled\x20on\x20localhost','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x047e,0x193));var _0xe047=function(_0x55e46a,_0x6c6901){_0x55e46a=_0x55e46a-0x0;var _0x406b3e=_0x047e[_0x55e46a];return _0x406b3e;};var AsteriskManager=require(_0xe047('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xe047('0x1'));var isXDREnabled=config[_0xe047('0x2')]&&config[_0xe047('0x2')]['disabled']?!config[_0xe047('0x2')][_0xe047('0x3')]:!![];var isProduction=config[_0xe047('0x4')]===_0xe047('0x5')||![];var isLocalAsterisk=config[_0xe047('0x2')]&&config[_0xe047('0x2')][_0xe047('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xe047('0x7')][_0xe047('0x8')],config[_0xe047('0x7')]['ip'],config['asterisk'][_0xe047('0x9')],config[_0xe047('0x7')][_0xe047('0xa')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xe047('0xb')](_0xe047('0xc'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xe047('0xd'));var members=require(_0xe047('0xe'));var dials=require(_0xe047('0xf'));var transfers=require(_0xe047('0x10'));var core=require(_0xe047('0x11'));ami['on']('connect',core[_0xe047('0x12')]);ami['on']('shutdown',core[_0xe047('0x13')]);ami['on']('fullybooted',core[_0xe047('0x14')]);ami['on'](_0xe047('0x15'),core[_0xe047('0x15')]);ami['on'](_0xe047('0x16'),core[_0xe047('0x16')]);ami['on']('managerevent',core[_0xe047('0x17')]);ami['on'](_0xe047('0x18'),function(_0x214b36){try{utils[_0xe047('0x19')](util[_0xe047('0x1a')](_0xe047('0x1b'),_0x214b36['device']),_0x214b36);members[_0xe047('0x18')](_0x214b36);}catch(_0x3e0791){utils[_0xe047('0x15')](util[_0xe047('0x1a')]('[%s][index][devicestatechange]',_0x214b36['device']),_0x3e0791);}});ami['on'](_0xe047('0x1c'),function(_0x457c9b){try{utils['debug'](util[_0xe047('0x1a')](_0xe047('0x1d'),_0x457c9b['uniqueid']),_0x457c9b);agents[_0xe047('0x1c')](_0x457c9b);}catch(_0x176c0b){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x1d'),_0x457c9b[_0xe047('0x1e')]),_0x176c0b);}});ami['on'](_0xe047('0x1f'),function(_0x29d5fc){try{utils[_0xe047('0x19')](util['format'](_0xe047('0x20'),_0x29d5fc[_0xe047('0x1e')]),_0x29d5fc);agents[_0xe047('0x1f')](_0x29d5fc);}catch(_0x5d76d1){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x20'),_0x29d5fc[_0xe047('0x1e')]),_0x5d76d1);}});ami['on'](_0xe047('0x21'),function(_0x15a843){try{utils['debug'](util[_0xe047('0x1a')](_0xe047('0x22'),_0x15a843[_0xe047('0x1e')]),_0x15a843);agents[_0xe047('0x21')](_0x15a843);queues[_0xe047('0x21')](_0x15a843);}catch(_0xb283c9){utils['error'](util[_0xe047('0x1a')]('[%s][index][agentconnect]',_0x15a843[_0xe047('0x1e')]),_0xb283c9);}});ami['on'](_0xe047('0x23'),function(_0x583b43){try{utils[_0xe047('0x19')](util[_0xe047('0x1a')](_0xe047('0x24'),_0x583b43['uniqueid']),_0x583b43);agents[_0xe047('0x23')](_0x583b43);queues[_0xe047('0x23')](_0x583b43);members[_0xe047('0x23')](_0x583b43);}catch(_0x3fc47a){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x24'),_0x583b43[_0xe047('0x1e')]),_0x3fc47a);}});ami['on'](_0xe047('0x25'),function(_0x58d74e){try{utils[_0xe047('0x19')](util[_0xe047('0x1a')](_0xe047('0x26'),_0x58d74e[_0xe047('0x1e')]),_0x58d74e);agents['queuecallerabandon'](_0x58d74e);queues[_0xe047('0x25')](_0x58d74e);}catch(_0xce3f87){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x26'),_0x58d74e['uniqueid']),_0xce3f87);}});ami['on'](_0xe047('0x27'),function(_0x370680){try{utils[_0xe047('0x19')](util[_0xe047('0x1a')](_0xe047('0x28'),_0x370680[_0xe047('0x1e')]),_0x370680);queues['queuecallerjoin'](_0x370680);recordings[_0xe047('0x27')](_0x370680);}catch(_0x12a687){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x28'),_0x370680[_0xe047('0x1e')]),_0x12a687);}});ami['on'](_0xe047('0x29'),function(_0x5bbab7){try{utils[_0xe047('0x19')](util[_0xe047('0x1a')]('[%s][index][queuecallerleave]',_0x5bbab7[_0xe047('0x1e')]),_0x5bbab7);queues['queuecallerleave'](_0x5bbab7);}catch(_0x3f20c1){utils['error'](util[_0xe047('0x1a')]('[%s][index][queuecallerleave]',_0x5bbab7[_0xe047('0x1e')]),_0x3f20c1);}});ami['on']('musiconholdstart',function(_0x5c0059){try{utils['debug'](util[_0xe047('0x1a')](_0xe047('0x2a'),_0x5c0059['uniqueid']),_0x5c0059);queues[_0xe047('0x2b')](_0x5c0059);calls['musiconholdstart'](_0x5c0059);}catch(_0x456bd6){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x2a'),_0x5c0059[_0xe047('0x1e')]),_0x456bd6);}});ami['on'](_0xe047('0x2c'),function(_0x213899){try{utils['debug'](util[_0xe047('0x1a')](_0xe047('0x2d'),_0x213899[_0xe047('0x1e')]),_0x213899);queues[_0xe047('0x2c')](_0x213899);calls[_0xe047('0x2c')](_0x213899);}catch(_0x4d76d1){utils[_0xe047('0x15')](util[_0xe047('0x1a')]('[%s][index][musiconholdstop]',_0x213899[_0xe047('0x1e')]),_0x4d76d1);}});ami['on'](_0xe047('0x2e'),function(_0x462fbc){try{utils['debug'](util[_0xe047('0x1a')]('[%s][index][newstate]',_0x462fbc['uniqueid']),_0x462fbc);calls[_0xe047('0x2e')](_0x462fbc);recordings[_0xe047('0x2e')](_0x462fbc);}catch(_0x35ffff){utils[_0xe047('0x15')](util['format'](_0xe047('0x2f'),_0x462fbc[_0xe047('0x1e')]),_0x35ffff);}});ami['on'](_0xe047('0x30'),function(_0x53900a){try{utils['debug'](util[_0xe047('0x1a')](_0xe047('0x31'),_0x53900a[_0xe047('0x1e')]),_0x53900a);calls['hangup'](_0x53900a);recordings['hangup'](_0x53900a);dials[_0xe047('0x30')](_0x53900a);agents[_0xe047('0x30')](_0x53900a);queues[_0xe047('0x30')](_0x53900a);}catch(_0x4e4cd5){utils['error'](util[_0xe047('0x1a')]('[%s][index][hangup]',_0x53900a[_0xe047('0x1e')]),_0x4e4cd5);}});ami['on']('cdr',function(_0x560aa7){try{utils[_0xe047('0x19')](util[_0xe047('0x1a')]('[%s][index][cdr]',_0x560aa7['uniqueid']),_0x560aa7);members['cdr'](_0x560aa7);}catch(_0x4f543a){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x32'),_0x560aa7[_0xe047('0x1e')]),_0x4f543a);}});ami['on']('blindtransfer',function(_0x5d4b47){try{utils[_0xe047('0x19')](util[_0xe047('0x1a')](_0xe047('0x33'),_0x5d4b47['uniqueid']),_0x5d4b47);queues[_0xe047('0x34')](_0x5d4b47);agents['blindtransfer'](_0x5d4b47);transfers[_0xe047('0x34')](_0x5d4b47);recordings[_0xe047('0x34')](_0x5d4b47);}catch(_0xa8ff4a){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x33'),_0x5d4b47[_0xe047('0x1e')]),_0xa8ff4a);}});ami['on'](_0xe047('0x35'),function(_0x50c005){try{utils['debug'](util['format']('[%s][index][attendedtransfer]',_0x50c005['origtransfereruniqueid']),_0x50c005);queues[_0xe047('0x35')](_0x50c005);transfers['attendedtransfer'](_0x50c005);agents[_0xe047('0x35')](_0x50c005);calls[_0xe047('0x35')](_0x50c005);}catch(_0x68c667){utils[_0xe047('0x15')](util['format'](_0xe047('0x36'),_0x50c005['origtransfereruniqueid']),_0x68c667);}});ami['on'](_0xe047('0x37'),function(_0x2efc85){try{utils[_0xe047('0x19')](util['format'](_0xe047('0x38'),_0x2efc85[_0xe047('0x1e')]),_0x2efc85);queues[_0xe047('0x37')](_0x2efc85);recordings[_0xe047('0x37')](_0x2efc85);calls[_0xe047('0x37')](_0x2efc85);dials['varset'](_0x2efc85);}catch(_0x3a129e){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x38'),_0x2efc85[_0xe047('0x1e')]),_0x3a129e);}});ami['on']('newexten',function(_0x104751){try{utils['debug'](util['format']('[%s][index][newexten]',_0x104751[_0xe047('0x1e')]),_0x104751);calls[_0xe047('0x39')](_0x104751);recordings[_0xe047('0x39')](_0x104751);dials['newexten'](_0x104751);}catch(_0x54a5c6){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x3a'),_0x104751[_0xe047('0x1e')]),_0x54a5c6);}});ami['on'](_0xe047('0x3b'),function(_0xaea21d){try{utils['debug'](util[_0xe047('0x1a')]('[%s][index][newchannel]',_0xaea21d['uniqueid']),_0xaea21d);calls[_0xe047('0x3b')](_0xaea21d);recordings[_0xe047('0x3b')](_0xaea21d);}catch(_0x4417a9){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x3c'),_0xaea21d['uniqueid']),_0x4417a9);}});ami['on']('dialbegin',function(_0x28822d){try{utils[_0xe047('0x19')](util['format'](_0xe047('0x3d'),_0x28822d[_0xe047('0x1e')]),_0x28822d);dials[_0xe047('0x3e')](_0x28822d);}catch(_0x235afc){utils[_0xe047('0x15')](util[_0xe047('0x1a')](_0xe047('0x3f'),_0x28822d[_0xe047('0x1e')]),_0x235afc);}});ami['on'](_0xe047('0x40'),function(_0x3e43f7){try{utils[_0xe047('0x19')](util['format'](_0xe047('0x41'),_0x3e43f7[_0xe047('0x1e')]),_0x3e43f7);dials[_0xe047('0x40')](_0x3e43f7);}catch(_0xd26920){utils['error'](util[_0xe047('0x1a')](_0xe047('0x41'),_0x3e43f7[_0xe047('0x1e')]),_0xd26920);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1cc6e9a..be3d12e 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 _0x7fa9=['diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','error','cdr','[%s][members][cdr]','channel','data1','data2','source','data3','destination','destinationchannel','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','type','then','membername','name','internal','CreateMemberReport','split','request','catch','[%s][members][writeDB]','uniqueid','some','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x7fa9,0x76));var _0x97fa=function(_0x5829fd,_0x39487b){_0x5829fd=_0x5829fd-0x0;var _0x335ccb=_0x7fa9[_0x5829fd];return _0x335ccb;};'use strict';var _=require(_0x97fa('0x0'));var util=require('util');var utils=require(_0x97fa('0x1'));var members={};var exclude=[_0x97fa('0x2'),_0x97fa('0x3')];function writeDB(_0x2d8052){utils[_0x97fa('0x4')](util[_0x97fa('0x5')](_0x97fa('0x6'),_0x2d8052['uniqueid'],_0x2d8052[_0x97fa('0x7')],_0x2d8052['channel'],_0x2d8052['data2'],_0x2d8052['membername'],_0x2d8052[_0x97fa('0x8')]));if(_0x2d8052[_0x97fa('0x7')]){utils['getUserByInterface'](_0x2d8052[_0x97fa('0x7')])[_0x97fa('0x9')](function(_0xeac44){if(_0xeac44){_0x2d8052[_0x97fa('0xa')]=_0xeac44[_0x97fa('0xb')];_0x2d8052[_0x97fa('0xc')]=_0xeac44[_0x97fa('0xc')];utils['request'](_0x97fa('0xd'),_0x2d8052);}else{utils['getUserByName'](_0x2d8052['interface'][_0x97fa('0xe')]('/')[0x1])[_0x97fa('0x9')](function(_0x4edcfc){if(_0x4edcfc){_0x2d8052[_0x97fa('0xa')]=_0x4edcfc['name'];_0x2d8052[_0x97fa('0xc')]=_0x4edcfc[_0x97fa('0xc')];utils[_0x97fa('0xf')](_0x97fa('0xd'),_0x2d8052);}});}})[_0x97fa('0x10')](function(_0x4da184){utils['error'](util[_0x97fa('0x5')](_0x97fa('0x11'),_0x2d8052[_0x97fa('0x12')]),_0x4da184);});}delete members[_0x2d8052[_0x97fa('0x7')]];}function startsWith(_0x1b03fc,_0x52e7f3){return _[_0x97fa('0x13')](_0x1b03fc,function(_0x3b3cca){return _['startsWith'](_0x52e7f3,_0x3b3cca);});}exports[_0x97fa('0x14')]=function(_0x3ed2e1){try{utils['debug'](util['format'](_0x97fa('0x15'),members[_0x3ed2e1[_0x97fa('0x16')]]?members[_0x3ed2e1[_0x97fa('0x16')]][_0x97fa('0x12')]:_0x3ed2e1[_0x97fa('0x16')]),_0x3ed2e1);utils[_0x97fa('0x4')](util[_0x97fa('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3ed2e1[_0x97fa('0x16')]]?members[_0x3ed2e1[_0x97fa('0x16')]][_0x97fa('0x12')]:_0x3ed2e1[_0x97fa('0x16')],_0x3ed2e1[_0x97fa('0x17')],_0x3ed2e1['device']));switch(_0x3ed2e1[_0x97fa('0x17')]){case _0x97fa('0x18'):case _0x97fa('0x19'):if(!startsWith(exclude,_0x3ed2e1['device'])){members[_0x3ed2e1['device']]={'channel':'voice','interface':_0x3ed2e1[_0x97fa('0x16')],'type':_0x97fa('0x1a'),'enterAt':utils[_0x97fa('0x1b')](),'role':_0x97fa('0x1c')};}break;case _0x97fa('0x1d'):if(!_[_0x97fa('0x1e')](members[_0x3ed2e1[_0x97fa('0x16')]])){members[_0x3ed2e1[_0x97fa('0x16')]][_0x97fa('0x1f')]=utils[_0x97fa('0x1b')]();members[_0x3ed2e1['device']]['duration']=utils[_0x97fa('0x20')](members[_0x3ed2e1['device']][_0x97fa('0x1f')],members[_0x3ed2e1[_0x97fa('0x16')]][_0x97fa('0x21')]);if(members[_0x3ed2e1['device']][_0x97fa('0x12')]){writeDB(members[_0x3ed2e1[_0x97fa('0x16')]]);}}break;default:break;}}catch(_0x4f4819){utils['error'](util[_0x97fa('0x5')](_0x97fa('0x15'),members[_0x3ed2e1[_0x97fa('0x16')]]?members[_0x3ed2e1[_0x97fa('0x16')]][_0x97fa('0x12')]:_0x3ed2e1['device']),_0x4f4819);}};exports[_0x97fa('0x22')]=function(_0x3a6033){try{if(!_[_0x97fa('0x1e')](members[_0x3a6033[_0x97fa('0x7')]])){utils[_0x97fa('0x23')](util[_0x97fa('0x5')](_0x97fa('0x24'),_0x3a6033[_0x97fa('0x12')]),_0x3a6033);utils[_0x97fa('0x4')](util[_0x97fa('0x5')](_0x97fa('0x25'),_0x3a6033[_0x97fa('0x12')],_0x3a6033[_0x97fa('0x7')],_0x3a6033[_0x97fa('0x26')]));members[_0x3a6033[_0x97fa('0x7')]]=_[_0x97fa('0x27')](members[_0x3a6033[_0x97fa('0x7')]],{'data4':_0x3a6033[_0x97fa('0x26')],'uniqueid':_0x3a6033[_0x97fa('0x12')]});}}catch(_0x3c0462){utils[_0x97fa('0x28')](util[_0x97fa('0x5')](_0x97fa('0x24'),_0x3a6033[_0x97fa('0x12')]),_0x3c0462);}};exports[_0x97fa('0x29')]=function(_0xe1bb7d){try{utils[_0x97fa('0x23')](util['format'](_0x97fa('0x2a'),_0xe1bb7d[_0x97fa('0x12')]),_0xe1bb7d);if(_0xe1bb7d['channel']){var _0x30205a=_0xe1bb7d[_0x97fa('0x2b')][_0x97fa('0xe')]('-')[0x0];if(!_[_0x97fa('0x1e')](members[_0x30205a])){members[_0x30205a]=_['assign'](members[_0x30205a],{'data1':members[_0x30205a][_0x97fa('0x2c')]||_0xe1bb7d['type'],'data2':members[_0x30205a][_0x97fa('0x2d')]||_0xe1bb7d[_0x97fa('0x2e')],'data3':members[_0x30205a][_0x97fa('0x2f')]||_0xe1bb7d[_0x97fa('0x30')],'uniqueid':members[_0x30205a]['uniqueid']||_0xe1bb7d[_0x97fa('0x12')]});utils[_0x97fa('0x4')](util[_0x97fa('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xe1bb7d[_0x97fa('0x12')],members[_0x30205a][_0x97fa('0x2c')],members[_0x30205a][_0x97fa('0x2d')],members[_0x30205a][_0x97fa('0x2f')]));if(members[_0x30205a]['exitAt']){writeDB(members[_0x30205a]);}}}if(_0xe1bb7d['destinationchannel']){var _0x21c8a2=_0xe1bb7d[_0x97fa('0x31')][_0x97fa('0xe')]('-')[0x0];if(!_[_0x97fa('0x1e')](members[_0x21c8a2])){members[_0x21c8a2]=_['assign'](members[_0x21c8a2],{'data1':members[_0x21c8a2][_0x97fa('0x2c')]||_0xe1bb7d[_0x97fa('0x8')],'data2':members[_0x21c8a2][_0x97fa('0x2d')]||_0xe1bb7d[_0x97fa('0x2e')],'data3':members[_0x21c8a2][_0x97fa('0x2f')]||_0xe1bb7d['destination'],'uniqueid':members[_0x21c8a2]['uniqueid']||_0xe1bb7d[_0x97fa('0x12')]});utils[_0x97fa('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xe1bb7d[_0x97fa('0x12')],members[_0x21c8a2][_0x97fa('0x2c')],members[_0x21c8a2][_0x97fa('0x2d')],members[_0x21c8a2][_0x97fa('0x2f')]));if(members[_0x21c8a2]['exitAt']){writeDB(members[_0x21c8a2]);}}}}catch(_0x12c706){utils[_0x97fa('0x28')](util[_0x97fa('0x5')](_0x97fa('0x2a'),_0xe1bb7d['uniqueid']),_0x12c706);}}; \ No newline at end of file +var _0x24ab=['devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','[%s][members][writeDB]','some','startsWith'];(function(_0x2bff86,_0xa557bd){var _0x140870=function(_0x46879b){while(--_0x46879b){_0x2bff86['push'](_0x2bff86['shift']());}};_0x140870(++_0xa557bd);}(_0x24ab,0x1c4));var _0xb24a=function(_0x59b86f,_0x1c3b73){_0x59b86f=_0x59b86f-0x0;var _0x34bae7=_0x24ab[_0x59b86f];return _0x34bae7;};'use strict';var _=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var utils=require(_0xb24a('0x2'));var members={};var exclude=[_0xb24a('0x3'),_0xb24a('0x4')];function writeDB(_0x11c2ff){utils[_0xb24a('0x5')](util[_0xb24a('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x11c2ff[_0xb24a('0x7')],_0x11c2ff[_0xb24a('0x8')],_0x11c2ff[_0xb24a('0x9')],_0x11c2ff[_0xb24a('0xa')],_0x11c2ff[_0xb24a('0xb')],_0x11c2ff[_0xb24a('0xc')]));if(_0x11c2ff[_0xb24a('0x8')]){utils[_0xb24a('0xd')](_0x11c2ff['interface'])[_0xb24a('0xe')](function(_0x1640ac){if(_0x1640ac){_0x11c2ff[_0xb24a('0xb')]=_0x1640ac[_0xb24a('0xf')];_0x11c2ff['internal']=_0x1640ac[_0xb24a('0x10')];utils[_0xb24a('0x11')]('CreateMemberReport',_0x11c2ff);}else{utils[_0xb24a('0x12')](_0x11c2ff['interface'][_0xb24a('0x13')]('/')[0x1])[_0xb24a('0xe')](function(_0x3d77dc){if(_0x3d77dc){_0x11c2ff[_0xb24a('0xb')]=_0x3d77dc[_0xb24a('0xf')];_0x11c2ff[_0xb24a('0x10')]=_0x3d77dc[_0xb24a('0x10')];utils[_0xb24a('0x11')](_0xb24a('0x14'),_0x11c2ff);}});}})[_0xb24a('0x15')](function(_0x1de3fc){utils['error'](util[_0xb24a('0x6')](_0xb24a('0x16'),_0x11c2ff['uniqueid']),_0x1de3fc);});}delete members[_0x11c2ff['interface']];}function startsWith(_0x553eec,_0x4fe09b){return _[_0xb24a('0x17')](_0x553eec,function(_0x14d5e3){return _[_0xb24a('0x18')](_0x4fe09b,_0x14d5e3);});}exports[_0xb24a('0x19')]=function(_0x4ea741){try{utils[_0xb24a('0x1a')](util[_0xb24a('0x6')]('[%s][members][devicestatechange]',members[_0x4ea741[_0xb24a('0x1b')]]?members[_0x4ea741[_0xb24a('0x1b')]][_0xb24a('0x7')]:_0x4ea741['device']),_0x4ea741);utils[_0xb24a('0x5')](util[_0xb24a('0x6')](_0xb24a('0x1c'),members[_0x4ea741[_0xb24a('0x1b')]]?members[_0x4ea741['device']][_0xb24a('0x7')]:_0x4ea741[_0xb24a('0x1b')],_0x4ea741[_0xb24a('0x1d')],_0x4ea741[_0xb24a('0x1b')]));switch(_0x4ea741[_0xb24a('0x1d')]){case'INUSE':case _0xb24a('0x1e'):if(!startsWith(exclude,_0x4ea741['device'])){members[_0x4ea741['device']]={'channel':'voice','interface':_0x4ea741[_0xb24a('0x1b')],'type':_0xb24a('0x1f'),'enterAt':utils[_0xb24a('0x20')](),'role':_0xb24a('0x21')};}break;case _0xb24a('0x22'):if(!_[_0xb24a('0x23')](members[_0x4ea741['device']])){members[_0x4ea741[_0xb24a('0x1b')]]['exitAt']=utils[_0xb24a('0x20')]();members[_0x4ea741[_0xb24a('0x1b')]][_0xb24a('0x24')]=utils[_0xb24a('0x25')](members[_0x4ea741[_0xb24a('0x1b')]][_0xb24a('0x26')],members[_0x4ea741[_0xb24a('0x1b')]]['enterAt']);if(members[_0x4ea741[_0xb24a('0x1b')]]['uniqueid']){writeDB(members[_0x4ea741['device']]);}}break;default:break;}}catch(_0x29848e){utils[_0xb24a('0x27')](util[_0xb24a('0x6')]('[%s][members][devicestatechange]',members[_0x4ea741[_0xb24a('0x1b')]]?members[_0x4ea741['device']][_0xb24a('0x7')]:_0x4ea741[_0xb24a('0x1b')]),_0x29848e);}};exports[_0xb24a('0x28')]=function(_0x596155){try{if(!_[_0xb24a('0x23')](members[_0x596155[_0xb24a('0x8')]])){utils[_0xb24a('0x1a')](util['format'](_0xb24a('0x29'),_0x596155[_0xb24a('0x7')]),_0x596155);utils['info'](util['format'](_0xb24a('0x2a'),_0x596155[_0xb24a('0x7')],_0x596155[_0xb24a('0x8')],_0x596155[_0xb24a('0x2b')]));members[_0x596155[_0xb24a('0x8')]]=_[_0xb24a('0x2c')](members[_0x596155[_0xb24a('0x8')]],{'data4':_0x596155[_0xb24a('0x2b')],'uniqueid':_0x596155['uniqueid']});}}catch(_0x3930df){utils[_0xb24a('0x27')](util['format'](_0xb24a('0x29'),_0x596155[_0xb24a('0x7')]),_0x3930df);}};exports[_0xb24a('0x2d')]=function(_0x38235d){try{utils['debug'](util[_0xb24a('0x6')](_0xb24a('0x2e'),_0x38235d[_0xb24a('0x7')]),_0x38235d);if(_0x38235d[_0xb24a('0x9')]){var _0x175a61=_0x38235d[_0xb24a('0x9')][_0xb24a('0x13')]('-')[0x0];if(!_[_0xb24a('0x23')](members[_0x175a61])){members[_0x175a61]=_[_0xb24a('0x2c')](members[_0x175a61],{'data1':members[_0x175a61]['data1']||_0x38235d[_0xb24a('0xc')],'data2':members[_0x175a61][_0xb24a('0xa')]||_0x38235d[_0xb24a('0x2f')],'data3':members[_0x175a61][_0xb24a('0x30')]||_0x38235d['destination'],'uniqueid':members[_0x175a61]['uniqueid']||_0x38235d[_0xb24a('0x7')]});utils['info'](util['format'](_0xb24a('0x31'),_0x38235d[_0xb24a('0x7')],members[_0x175a61][_0xb24a('0x32')],members[_0x175a61][_0xb24a('0xa')],members[_0x175a61][_0xb24a('0x30')]));if(members[_0x175a61][_0xb24a('0x26')]){writeDB(members[_0x175a61]);}}}if(_0x38235d[_0xb24a('0x33')]){var _0x4708d1=_0x38235d['destinationchannel'][_0xb24a('0x13')]('-')[0x0];if(!_['isNil'](members[_0x4708d1])){members[_0x4708d1]=_[_0xb24a('0x2c')](members[_0x4708d1],{'data1':members[_0x4708d1]['data1']||_0x38235d[_0xb24a('0xc')],'data2':members[_0x4708d1][_0xb24a('0xa')]||_0x38235d[_0xb24a('0x2f')],'data3':members[_0x4708d1][_0xb24a('0x30')]||_0x38235d[_0xb24a('0x34')],'uniqueid':members[_0x4708d1]['uniqueid']||_0x38235d[_0xb24a('0x7')]});utils[_0xb24a('0x5')](util[_0xb24a('0x6')](_0xb24a('0x31'),_0x38235d[_0xb24a('0x7')],members[_0x4708d1][_0xb24a('0x32')],members[_0x4708d1][_0xb24a('0xa')],members[_0x4708d1][_0xb24a('0x30')]));if(members[_0x4708d1][_0xb24a('0x26')]){writeDB(members[_0x4708d1]);}}}}catch(_0x22f949){utils[_0xb24a('0x27')](util['format'](_0xb24a('0x2e'),_0x38235d[_0xb24a('0x7')]),_0x22f949);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 20e4aae..7241291 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 _0x942e=['agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','accountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','secondtransfererlinkedid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','calleridnum','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','assign','now','error','hangup','isNil','debug','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerexitAt','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinename','holdtime','queuecallerjoinAt','count','connectedlinenum'];(function(_0x2e03d7,_0x424441){var _0x37ff0c=function(_0x4571ab){while(--_0x4571ab){_0x2e03d7['push'](_0x2e03d7['shift']());}};_0x37ff0c(++_0x424441);}(_0x942e,0x1cd));var _0xe942=function(_0x792564,_0x1852fe){_0x792564=_0x792564-0x0;var _0x2c3a9f=_0x942e[_0x792564];return _0x2c3a9f;};'use strict';var _=require(_0xe942('0x0'));var util=require(_0xe942('0x1'));var utils=require(_0xe942('0x2'));var queues={};function writeDB(_0x4f8dbe){utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x5'),_0x4f8dbe[_0xe942('0x6')],_0x4f8dbe[_0xe942('0x7')],_0x4f8dbe['queue'],_0x4f8dbe['lastAssignedTo'],_0x4f8dbe['calleridnum'],_0x4f8dbe['accountcode'],_0x4f8dbe[_0xe942('0x8')]));if(_0x4f8dbe[_0xe942('0x9')]){utils[_0xe942('0xa')](_0x4f8dbe['queue'])[_0xe942('0xb')](function(_0x1a11b3){if(_0x1a11b3){_0x4f8dbe[_0xe942('0xc')]=_0x1a11b3['type'];}utils[_0xe942('0xd')]('CreateVoiceQueueReport',_0x4f8dbe);});}else{utils[_0xe942('0xd')](_0xe942('0xe'),_0x4f8dbe);}if(_0x4f8dbe[_0xe942('0xf')]){delete queues[_0x4f8dbe[_0xe942('0xf')]];}else{delete queues[_0x4f8dbe[_0xe942('0x6')]];}}exports[_0xe942('0x10')]=function(_0x4796ac){try{utils['debug'](util[_0xe942('0x4')]('[%s][queues][queuecallerjoin]',_0x4796ac[_0xe942('0x6')]),_0x4796ac);utils[_0xe942('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4796ac[_0xe942('0x6')],_0x4796ac[_0xe942('0x9')],_0x4796ac[_0xe942('0x11')]));queues[_0x4796ac['uniqueid']]=_[_0xe942('0x12')](_0x4796ac,{'originalposition':_0x4796ac[_0xe942('0x11')],'queuecallerjoinAt':utils[_0xe942('0x13')](),'mohtime':0x0});}catch(_0x5daf6a){utils[_0xe942('0x14')](util['format']('[%s][queues][queuecallerjoin]',_0x4796ac[_0xe942('0x6')]),_0x5daf6a);}};exports[_0xe942('0x15')]=function(_0x311757){try{if(!_[_0xe942('0x16')](queues[_0x311757[_0xe942('0x6')]])){utils[_0xe942('0x17')](util['format']('[%s][queues][hangup]',_0x311757[_0xe942('0x6')]),_0x311757);if(queues[_0x311757['uniqueid']][_0xe942('0x18')]){if(!queues[_0x311757[_0xe942('0x6')]][_0xe942('0x19')]&&!queues[_0x311757[_0xe942('0x6')]][_0xe942('0x1a')]){queues[_0x311757[_0xe942('0x6')]][_0xe942('0x1b')]=!![];queues[_0x311757[_0xe942('0x6')]][_0xe942('0x1c')]=utils['now']();queues[_0x311757[_0xe942('0x6')]]['queuecallerexitreason']=_0xe942('0x1d');}utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x1e'),_0x311757[_0xe942('0x6')],queues[_0x311757[_0xe942('0x6')]][_0xe942('0x1f')],queues[_0x311757[_0xe942('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x311757[_0xe942('0x6')]]);}else if(queues[_0x311757[_0xe942('0x6')]]['transfereduniqueid']){utils['info'](util[_0xe942('0x4')](_0xe942('0x20'),_0x311757[_0xe942('0x6')],queues[_0x311757[_0xe942('0x6')]][_0xe942('0x1f')],queues[_0x311757[_0xe942('0x6')]]['transfereduniqueid']));queues[queues[_0x311757[_0xe942('0x6')]][_0xe942('0xf')]]=queues[_0x311757[_0xe942('0x6')]];queues[queues[_0x311757['uniqueid']][_0xe942('0xf')]][_0xe942('0x21')]=0x2;delete queues[_0x311757[_0xe942('0x6')]];}}}catch(_0x334fd4){utils['error'](util[_0xe942('0x4')](_0xe942('0x22'),_0x311757[_0xe942('0x6')]),_0x334fd4);}};exports[_0xe942('0x23')]=function(_0x390ef6){try{utils[_0xe942('0x17')](util[_0xe942('0x4')](_0xe942('0x24'),_0x390ef6[_0xe942('0x6')]),_0x390ef6);if(!_[_0xe942('0x16')](_0x390ef6[_0xe942('0x25')]['queuestatus'])&&_0x390ef6[_0xe942('0x26')][_0xe942('0x27')]()!==_0xe942('0x28')){if(!_[_0xe942('0x16')](queues[_0x390ef6[_0xe942('0x6')]])){queues[_0x390ef6['uniqueid']]['queuecallerabandon']=![];queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x29')]=null;queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x1a')]=!![];queues[_0x390ef6['uniqueid']]['queuecallerexitAt']=utils[_0xe942('0x13')]();queues[_0x390ef6[_0xe942('0x6')]]['queuecallerexitreason']=_0x390ef6[_0xe942('0x26')]['toUpperCase']();utils[_0xe942('0x3')](util['format'](_0xe942('0x2a'),_0x390ef6[_0xe942('0x6')],queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x1f')],_0x390ef6['value'],queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x8')]));writeDB(queues[_0x390ef6[_0xe942('0x6')]]);}}else if(!_[_0xe942('0x16')](_0x390ef6[_0xe942('0x25')]['queueposition'])){if(!_[_0xe942('0x16')](queues[_0x390ef6[_0xe942('0x6')]])&&!queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x19')]){queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x19')]=![];queues[_0x390ef6['uniqueid']][_0xe942('0x29')]=null;queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x1a')]=!![];queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x2b')]=utils[_0xe942('0x13')]();queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x8')]='EXITWITHKEY';utils[_0xe942('0x3')](util[_0xe942('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x390ef6[_0xe942('0x6')],queues[_0x390ef6['uniqueid']][_0xe942('0x1f')],_0x390ef6['value'],queues[_0x390ef6[_0xe942('0x6')]][_0xe942('0x8')]));}}}catch(_0xd8c0e0){utils['error'](util['format']('[%s][queues][varset]',_0x390ef6['uniqueid']),_0xd8c0e0);}};exports[_0xe942('0x19')]=function(_0x3db1e0){try{if(!_[_0xe942('0x16')](queues[_0x3db1e0['uniqueid']])){utils[_0xe942('0x17')](util['format'](_0xe942('0x2c'),_0x3db1e0['uniqueid']),_0x3db1e0);queues[_0x3db1e0['uniqueid']]['queuecallerexit']=![];queues[_0x3db1e0['uniqueid']][_0xe942('0x2b')]=null;queues[_0x3db1e0[_0xe942('0x6')]]['queuecallerabandon']=!![];queues[_0x3db1e0['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x3db1e0[_0xe942('0x6')]][_0xe942('0x8')]=_0xe942('0x2d');utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x2e'),_0x3db1e0[_0xe942('0x6')],queues[_0x3db1e0[_0xe942('0x6')]]['name'],queues[_0x3db1e0[_0xe942('0x6')]][_0xe942('0x8')]));}}catch(_0xda5ed0){utils[_0xe942('0x14')](util['format']('[%s][queues][queuecallerabandon]',_0x3db1e0['uniqueid']),_0xda5ed0);}};exports[_0xe942('0x2f')]=function(_0x203f09){try{if(!_['isNil'](queues[_0x203f09[_0xe942('0x6')]])){utils[_0xe942('0x17')](util[_0xe942('0x4')](_0xe942('0x30'),_0x203f09['uniqueid']),_0x203f09);utils[_0xe942('0x3')](util[_0xe942('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x203f09[_0xe942('0x6')],queues[_0x203f09[_0xe942('0x6')]][_0xe942('0x1f')],_0x203f09['connectedlinenum'],_0x203f09[_0xe942('0x31')]));queues[_0x203f09[_0xe942('0x6')]][_0xe942('0x2f')]=!![];queues[_0x203f09[_0xe942('0x6')]]['queuecallerleaveAt']=utils[_0xe942('0x13')]();queues[_0x203f09[_0xe942('0x6')]][_0xe942('0x32')]=utils['diffTime'](queues[_0x203f09[_0xe942('0x6')]][_0xe942('0x18')],queues[_0x203f09[_0xe942('0x6')]][_0xe942('0x33')]);queues[_0x203f09['uniqueid']]['position']=_0x203f09['position'];queues[_0x203f09['uniqueid']][_0xe942('0x34')]=_0x203f09[_0xe942('0x34')];queues[_0x203f09['uniqueid']][_0xe942('0x35')]=_0x203f09[_0xe942('0x35')];queues[_0x203f09['uniqueid']][_0xe942('0x31')]=_0x203f09['connectedlinename'];}}catch(_0x2ac9aa){utils[_0xe942('0x14')](util['format']('[%s][queues][queuecallerleave]',_0x203f09[_0xe942('0x6')]),_0x2ac9aa);}};exports[_0xe942('0x36')]=function(_0x491908){try{if(!_[_0xe942('0x16')](queues[_0x491908[_0xe942('0x6')]])){utils[_0xe942('0x17')](util['format'](_0xe942('0x37'),_0x491908['uniqueid']),_0x491908);utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x38'),_0x491908[_0xe942('0x6')],queues[_0x491908[_0xe942('0x6')]][_0xe942('0x1f')],_0x491908[_0xe942('0x39')],_0x491908[_0xe942('0x3a')]));queues[_0x491908[_0xe942('0x6')]][_0xe942('0x19')]=![];queues[_0x491908['uniqueid']][_0xe942('0x19')]=![];queues[_0x491908[_0xe942('0x6')]][_0xe942('0x29')]=null;queues[_0x491908[_0xe942('0x6')]][_0xe942('0x1a')]=![];queues[_0x491908[_0xe942('0x6')]][_0xe942('0x8')]=null;queues[_0x491908['uniqueid']][_0xe942('0x2b')]=null;queues[_0x491908['uniqueid']]['assigned']=!![];queues[_0x491908['uniqueid']][_0xe942('0x3b')]=_0x491908[_0xe942('0x3a')];queues[_0x491908[_0xe942('0x6')]][_0xe942('0x3c')]=_0x491908[_0xe942('0x39')];}}catch(_0x1235be){utils[_0xe942('0x14')](util['format'](_0xe942('0x37'),_0x491908[_0xe942('0x6')]),_0x1235be);}};exports[_0xe942('0x3d')]=function(_0x14dad2){try{if(!_['isNil'](queues[_0x14dad2[_0xe942('0x6')]])){if(queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x18')]){utils[_0xe942('0x17')](util[_0xe942('0x4')](_0xe942('0x3e'),_0x14dad2[_0xe942('0x6')]),_0x14dad2);queues[_0x14dad2['uniqueid']]['queuecallerabandon']=![];queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x19')]=![];queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x29')]=null;queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x1a')]=![];queues[_0x14dad2[_0xe942('0x6')]]['queuecallerexitAt']=null;queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x3f')]=!![];queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x3c')]=_0x14dad2[_0xe942('0x39')];queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x1b')]=!![];queues[_0x14dad2[_0xe942('0x6')]]['queuecallercompleteAt']=utils[_0xe942('0x13')]();if(_0x14dad2[_0xe942('0x40')]=='transfer'){if(!queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x41')]){queues[_0x14dad2['uniqueid']][_0xe942('0x8')]=_0xe942('0x42');}}else{queues[_0x14dad2[_0xe942('0x6')]]['queuecallerexitreason']='COMPLETEDBY'+_0x14dad2[_0xe942('0x40')][_0xe942('0x27')]();}utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x43'),_0x14dad2['uniqueid'],queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x1f')],_0x14dad2[_0xe942('0x39')],queues[_0x14dad2[_0xe942('0x6')]][_0xe942('0x8')]));writeDB(queues[_0x14dad2[_0xe942('0x6')]]);}}}catch(_0x32281a){utils[_0xe942('0x14')](util[_0xe942('0x4')](_0xe942('0x3e'),_0x14dad2[_0xe942('0x6')]),_0x32281a);}};exports['blindtransfer']=function(_0x565ea2){try{if(!_[_0xe942('0x16')](queues[_0x565ea2['transfereeuniqueid']])){utils[_0xe942('0x17')](util[_0xe942('0x4')](_0xe942('0x44'),_0x565ea2[_0xe942('0x6')]),_0x565ea2);queues[_0x565ea2['transfereeuniqueid']][_0xe942('0x41')]=!![];queues[_0x565ea2[_0xe942('0x45')]][_0xe942('0x46')]='BLIND';queues[_0x565ea2['transfereeuniqueid']][_0xe942('0x47')]=_0x565ea2[_0xe942('0x48')];queues[_0x565ea2[_0xe942('0x45')]][_0xe942('0x49')]=_0x565ea2['transfereeuniqueid'];queues[_0x565ea2[_0xe942('0x45')]][_0xe942('0x8')]=_0xe942('0x4a');utils[_0xe942('0x3')](util['format'](_0xe942('0x4b'),_0x565ea2[_0xe942('0x6')],queues[_0x565ea2[_0xe942('0x45')]][_0xe942('0x1f')],_0x565ea2['transfereeuniqueid'],_0x565ea2[_0xe942('0x48')]));}}catch(_0x429609){utils[_0xe942('0x14')](util['format'](_0xe942('0x44'),_0x565ea2[_0xe942('0x6')]),_0x429609);}};exports[_0xe942('0x4c')]=function(_0x538ea2){try{utils['debug'](util[_0xe942('0x4')](_0xe942('0x4d'),_0x538ea2[_0xe942('0x4e')]),_0x538ea2);if(_0x538ea2['origtransfereruniqueid']==_0x538ea2[_0xe942('0x4f')]){if(!_[_0xe942('0x16')](queues[_0x538ea2['secondtransfererlinkedid']])){utils[_0xe942('0x3')](util['format'](_0xe942('0x50'),_0x538ea2[_0xe942('0x4e')],queues[_0x538ea2['secondtransfererlinkedid']][_0xe942('0x1f')],_0x538ea2[_0xe942('0x51')]));queues[_0x538ea2[_0xe942('0x52')]]['transfer']=!![];queues[_0x538ea2[_0xe942('0x52')]][_0xe942('0x46')]='ATTENDED';queues[_0x538ea2[_0xe942('0x52')]][_0xe942('0x47')]=_0x538ea2[_0xe942('0x51')];queues[_0x538ea2[_0xe942('0x52')]]['transferuniqueid']=_0x538ea2[_0xe942('0x4e')];queues[_0x538ea2[_0xe942('0x52')]][_0xe942('0x8')]=_0xe942('0x53');}if(!_[_0xe942('0x16')](queues[_0x538ea2[_0xe942('0x4f')]])){if(_0x538ea2[_0xe942('0x54')]&&queues[_0x538ea2[_0xe942('0x54')]]){queues[_0x538ea2[_0xe942('0x54')]][_0xe942('0x21')]=0x1;queues[_0x538ea2[_0xe942('0x45')]]=_[_0xe942('0x55')](queues[_0x538ea2[_0xe942('0x54')]]);queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0xf')]=_0x538ea2[_0xe942('0x56')];queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0x21')]=0x2;queues[_0x538ea2[_0xe942('0x45')]]['calleridnum']=queues[_0x538ea2[_0xe942('0x52')]]['calleridnum'];queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0x57')]=queues[_0x538ea2[_0xe942('0x52')]][_0xe942('0x57')];queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0x33')]=utils[_0xe942('0x13')]();queues[_0x538ea2[_0xe942('0x45')]]['queuecallerleaveAt']=utils[_0xe942('0x13')]();queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0x32')]=0x0;queues[_0x538ea2['transfereeuniqueid']][_0xe942('0x58')]=0x0;utils['info'](util[_0xe942('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x538ea2[_0xe942('0x4e')],queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0x1f')],queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0x59')],queues[_0x538ea2[_0xe942('0x45')]][_0xe942('0x57')]));}else{utils[_0xe942('0x3')](util['format'](_0xe942('0x5a'),_0x538ea2['origtransfereruniqueid'],queues[_0x538ea2[_0xe942('0x4f')]][_0xe942('0x1f')],_0x538ea2[_0xe942('0x52')]));queues[_0x538ea2[_0xe942('0x4f')]][_0xe942('0xf')]=_0x538ea2[_0xe942('0x52')];}}}else if(_0x538ea2[_0xe942('0x5b')]==_0x538ea2[_0xe942('0x52')]){if(!_[_0xe942('0x16')](queues[_0x538ea2['origtransfererlinkedid']])){utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x5c'),_0x538ea2[_0xe942('0x4e')],queues[_0x538ea2['origtransfererlinkedid']][_0xe942('0x1f')],_0x538ea2[_0xe942('0x5b')],_0x538ea2['secondtransfererexten']));queues[_0x538ea2[_0xe942('0x4f')]][_0xe942('0x41')]=!![];queues[_0x538ea2[_0xe942('0x4f')]]['transfertype']=_0xe942('0x5d');queues[_0x538ea2[_0xe942('0x4f')]][_0xe942('0x47')]=_0x538ea2[_0xe942('0x5e')];queues[_0x538ea2[_0xe942('0x4f')]][_0xe942('0x49')]=_0x538ea2[_0xe942('0x5b')];queues[_0x538ea2[_0xe942('0x4f')]]['queuecallerexitreason']=_0xe942('0x53');}if(!_[_0xe942('0x16')](queues[_0x538ea2[_0xe942('0x52')]])){if(_0x538ea2[_0xe942('0x5f')]&&queues[_0x538ea2['transfertargetlinkedid']]){queues[_0x538ea2['transfertargetlinkedid']][_0xe942('0x21')]=0x1;queues[_0x538ea2[_0xe942('0x56')]]=_[_0xe942('0x55')](queues[_0x538ea2[_0xe942('0x5f')]]);queues[_0x538ea2['transfertargetuniqueid']]['transfereduniqueid']=_0x538ea2[_0xe942('0x56')];queues[_0x538ea2['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x538ea2[_0xe942('0x56')]]['calleridnum']=queues[_0x538ea2[_0xe942('0x4f')]][_0xe942('0x59')];queues[_0x538ea2['transfertargetuniqueid']][_0xe942('0x57')]=queues[_0x538ea2['origtransfererlinkedid']][_0xe942('0x57')];queues[_0x538ea2[_0xe942('0x56')]][_0xe942('0x33')]=utils[_0xe942('0x13')]();queues[_0x538ea2[_0xe942('0x56')]][_0xe942('0x18')]=utils[_0xe942('0x13')]();queues[_0x538ea2['transfertargetuniqueid']][_0xe942('0x32')]=0x0;queues[_0x538ea2[_0xe942('0x56')]]['mohtime']=0x0;utils['info'](util[_0xe942('0x4')](_0xe942('0x60'),_0x538ea2[_0xe942('0x4e')],queues[_0x538ea2[_0xe942('0x56')]][_0xe942('0x1f')],queues[_0x538ea2[_0xe942('0x56')]][_0xe942('0xf')],queues[_0x538ea2['transfertargetuniqueid']]['calleridnum'],queues[_0x538ea2['transfertargetuniqueid']]['calleridname']));}else{utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x5a'),_0x538ea2[_0xe942('0x4e')],queues[_0x538ea2['secondtransfererlinkedid']][_0xe942('0x1f')],_0x538ea2['origtransfererlinkedid']));queues[_0x538ea2[_0xe942('0x52')]][_0xe942('0xf')]=_0x538ea2['origtransfererlinkedid'];}}}}catch(_0x2d16ee){utils[_0xe942('0x14')](util[_0xe942('0x4')](_0xe942('0x4d'),_0x538ea2[_0xe942('0x4e')]),_0x2d16ee);}};exports['musiconholdstart']=function(_0x4fab15){try{if(!_[_0xe942('0x16')](queues[_0x4fab15[_0xe942('0x6')]])){utils[_0xe942('0x17')](util[_0xe942('0x4')](_0xe942('0x61'),_0x4fab15[_0xe942('0x6')]),_0x4fab15);queues[_0x4fab15[_0xe942('0x6')]][_0xe942('0x62')]=utils[_0xe942('0x13')]();utils[_0xe942('0x3')](util[_0xe942('0x4')](_0xe942('0x63'),_0x4fab15['uniqueid'],queues[_0x4fab15[_0xe942('0x6')]][_0xe942('0x1f')],queues[_0x4fab15[_0xe942('0x6')]]['musiconholdstartAt']));}}catch(_0x247633){utils[_0xe942('0x14')](util['format']('[%s][queues][musiconholdstart]',_0x4fab15[_0xe942('0x6')]),_0x247633);}};exports['musiconholdstop']=function(_0x3d2e78){try{if(!_[_0xe942('0x16')](queues[_0x3d2e78[_0xe942('0x6')]])){if(!_[_0xe942('0x16')](queues[_0x3d2e78[_0xe942('0x6')]][_0xe942('0x62')])){utils[_0xe942('0x17')](util[_0xe942('0x4')](_0xe942('0x64'),_0x3d2e78[_0xe942('0x6')]),_0x3d2e78);queues[_0x3d2e78[_0xe942('0x6')]][_0xe942('0x58')]+=utils[_0xe942('0x65')](utils['now'](),queues[_0x3d2e78[_0xe942('0x6')]][_0xe942('0x62')]);utils[_0xe942('0x3')](util['format'](_0xe942('0x66'),_0x3d2e78[_0xe942('0x6')],queues[_0x3d2e78[_0xe942('0x6')]][_0xe942('0x1f')],queues[_0x3d2e78[_0xe942('0x6')]][_0xe942('0x58')]));delete queues[_0x3d2e78[_0xe942('0x6')]][_0xe942('0x62')];}}}catch(_0x1a6278){utils[_0xe942('0x14')](util[_0xe942('0x4')](_0xe942('0x64'),_0x3d2e78['uniqueid']),_0x1a6278);}}; \ No newline at end of file +var _0xea5c=['info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','toUpperCase','CONTINUE','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]'];(function(_0x2ab3f5,_0x12d229){var _0x534a08=function(_0x224c48){while(--_0x224c48){_0x2ab3f5['push'](_0x2ab3f5['shift']());}};_0x534a08(++_0x12d229);}(_0xea5c,0x190));var _0xcea5=function(_0x14e0f8,_0x200545){_0x14e0f8=_0x14e0f8-0x0;var _0x4d462e=_0xea5c[_0x14e0f8];return _0x4d462e;};'use strict';var _=require(_0xcea5('0x0'));var util=require(_0xcea5('0x1'));var utils=require(_0xcea5('0x2'));var queues={};function writeDB(_0xa4a3ac){utils['info'](util['format'](_0xcea5('0x3'),_0xa4a3ac[_0xcea5('0x4')],_0xa4a3ac['channel'],_0xa4a3ac[_0xcea5('0x5')],_0xa4a3ac[_0xcea5('0x6')],_0xa4a3ac[_0xcea5('0x7')],_0xa4a3ac[_0xcea5('0x8')],_0xa4a3ac[_0xcea5('0x9')]));if(_0xa4a3ac[_0xcea5('0x5')]){utils[_0xcea5('0xa')](_0xa4a3ac[_0xcea5('0x5')])[_0xcea5('0xb')](function(_0x54d32f){if(_0x54d32f){_0xa4a3ac[_0xcea5('0xc')]=_0x54d32f[_0xcea5('0xc')];}utils[_0xcea5('0xd')](_0xcea5('0xe'),_0xa4a3ac);});}else{utils[_0xcea5('0xd')](_0xcea5('0xe'),_0xa4a3ac);}if(_0xa4a3ac[_0xcea5('0xf')]){delete queues[_0xa4a3ac[_0xcea5('0xf')]];}else{delete queues[_0xa4a3ac['uniqueid']];}}exports[_0xcea5('0x10')]=function(_0x49ad79){try{utils[_0xcea5('0x11')](util[_0xcea5('0x12')](_0xcea5('0x13'),_0x49ad79[_0xcea5('0x4')]),_0x49ad79);utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x15'),_0x49ad79[_0xcea5('0x4')],_0x49ad79[_0xcea5('0x5')],_0x49ad79['position']));queues[_0x49ad79[_0xcea5('0x4')]]=_[_0xcea5('0x16')](_0x49ad79,{'originalposition':_0x49ad79[_0xcea5('0x17')],'queuecallerjoinAt':utils[_0xcea5('0x18')](),'mohtime':0x0});}catch(_0x411271){utils[_0xcea5('0x19')](util[_0xcea5('0x12')](_0xcea5('0x13'),_0x49ad79[_0xcea5('0x4')]),_0x411271);}};exports[_0xcea5('0x1a')]=function(_0x27369e){try{if(!_[_0xcea5('0x1b')](queues[_0x27369e[_0xcea5('0x4')]])){utils[_0xcea5('0x11')](util[_0xcea5('0x12')](_0xcea5('0x1c'),_0x27369e[_0xcea5('0x4')]),_0x27369e);if(queues[_0x27369e['uniqueid']][_0xcea5('0x1d')]){if(!queues[_0x27369e['uniqueid']][_0xcea5('0x1e')]&&!queues[_0x27369e[_0xcea5('0x4')]][_0xcea5('0x1f')]){queues[_0x27369e[_0xcea5('0x4')]][_0xcea5('0x20')]=!![];queues[_0x27369e[_0xcea5('0x4')]][_0xcea5('0x21')]=utils[_0xcea5('0x18')]();queues[_0x27369e['uniqueid']]['queuecallerexitreason']=_0xcea5('0x22');}utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x23'),_0x27369e[_0xcea5('0x4')],queues[_0x27369e['uniqueid']][_0xcea5('0x24')],queues[_0x27369e['uniqueid']][_0xcea5('0x9')]));writeDB(queues[_0x27369e[_0xcea5('0x4')]]);}else if(queues[_0x27369e['uniqueid']]['transfereduniqueid']){utils[_0xcea5('0x14')](util['format'](_0xcea5('0x25'),_0x27369e['uniqueid'],queues[_0x27369e[_0xcea5('0x4')]][_0xcea5('0x24')],queues[_0x27369e[_0xcea5('0x4')]]['transfereduniqueid']));queues[queues[_0x27369e['uniqueid']][_0xcea5('0xf')]]=queues[_0x27369e[_0xcea5('0x4')]];queues[queues[_0x27369e[_0xcea5('0x4')]][_0xcea5('0xf')]][_0xcea5('0x26')]=0x2;delete queues[_0x27369e[_0xcea5('0x4')]];}}}catch(_0x4281c7){utils[_0xcea5('0x19')](util[_0xcea5('0x12')](_0xcea5('0x1c'),_0x27369e[_0xcea5('0x4')]),_0x4281c7);}};exports['varset']=function(_0x36de3d){try{utils[_0xcea5('0x11')](util['format'](_0xcea5('0x27'),_0x36de3d[_0xcea5('0x4')]),_0x36de3d);if(!_[_0xcea5('0x1b')](_0x36de3d['variable']['queuestatus'])&&_0x36de3d['value'][_0xcea5('0x28')]()!==_0xcea5('0x29')){if(!_['isNil'](queues[_0x36de3d[_0xcea5('0x4')]])){queues[_0x36de3d['uniqueid']][_0xcea5('0x1e')]=![];queues[_0x36de3d[_0xcea5('0x4')]]['queuecallerabandonAt']=null;queues[_0x36de3d[_0xcea5('0x4')]]['queuecallerexit']=!![];queues[_0x36de3d['uniqueid']][_0xcea5('0x2a')]=utils[_0xcea5('0x18')]();queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x9')]=_0x36de3d[_0xcea5('0x2b')][_0xcea5('0x28')]();utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x2c'),_0x36de3d[_0xcea5('0x4')],queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x24')],_0x36de3d[_0xcea5('0x2b')],queues[_0x36de3d['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x36de3d['uniqueid']]);}}else if(!_[_0xcea5('0x1b')](_0x36de3d['variable']['queueposition'])){if(!_[_0xcea5('0x1b')](queues[_0x36de3d['uniqueid']])&&!queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x1e')]){queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x1e')]=![];queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x2d')]=null;queues[_0x36de3d[_0xcea5('0x4')]]['queuecallerexit']=!![];queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x2a')]=utils['now']();queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x9')]=_0xcea5('0x2e');utils[_0xcea5('0x14')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x36de3d[_0xcea5('0x4')],queues[_0x36de3d[_0xcea5('0x4')]][_0xcea5('0x24')],_0x36de3d[_0xcea5('0x2b')],queues[_0x36de3d['uniqueid']]['queuecallerexitreason']));}}}catch(_0x31834c){utils['error'](util[_0xcea5('0x12')](_0xcea5('0x27'),_0x36de3d['uniqueid']),_0x31834c);}};exports[_0xcea5('0x1e')]=function(_0xacae26){try{if(!_[_0xcea5('0x1b')](queues[_0xacae26[_0xcea5('0x4')]])){utils[_0xcea5('0x11')](util[_0xcea5('0x12')](_0xcea5('0x2f'),_0xacae26[_0xcea5('0x4')]),_0xacae26);queues[_0xacae26[_0xcea5('0x4')]][_0xcea5('0x1f')]=![];queues[_0xacae26[_0xcea5('0x4')]][_0xcea5('0x2a')]=null;queues[_0xacae26[_0xcea5('0x4')]]['queuecallerabandon']=!![];queues[_0xacae26[_0xcea5('0x4')]][_0xcea5('0x2d')]=utils[_0xcea5('0x18')]();queues[_0xacae26['uniqueid']][_0xcea5('0x9')]=_0xcea5('0x30');utils[_0xcea5('0x14')](util['format'](_0xcea5('0x31'),_0xacae26[_0xcea5('0x4')],queues[_0xacae26[_0xcea5('0x4')]][_0xcea5('0x24')],queues[_0xacae26[_0xcea5('0x4')]][_0xcea5('0x9')]));}}catch(_0x3b1f84){utils[_0xcea5('0x19')](util[_0xcea5('0x12')](_0xcea5('0x2f'),_0xacae26[_0xcea5('0x4')]),_0x3b1f84);}};exports[_0xcea5('0x32')]=function(_0x463dc4){try{if(!_['isNil'](queues[_0x463dc4[_0xcea5('0x4')]])){utils['debug'](util[_0xcea5('0x12')](_0xcea5('0x33'),_0x463dc4[_0xcea5('0x4')]),_0x463dc4);utils[_0xcea5('0x14')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x463dc4[_0xcea5('0x4')],queues[_0x463dc4[_0xcea5('0x4')]]['name'],_0x463dc4['connectedlinenum'],_0x463dc4[_0xcea5('0x34')]));queues[_0x463dc4[_0xcea5('0x4')]][_0xcea5('0x32')]=!![];queues[_0x463dc4[_0xcea5('0x4')]][_0xcea5('0x1d')]=utils[_0xcea5('0x18')]();queues[_0x463dc4['uniqueid']][_0xcea5('0x35')]=utils[_0xcea5('0x36')](queues[_0x463dc4[_0xcea5('0x4')]][_0xcea5('0x1d')],queues[_0x463dc4[_0xcea5('0x4')]][_0xcea5('0x37')]);queues[_0x463dc4['uniqueid']][_0xcea5('0x17')]=_0x463dc4[_0xcea5('0x17')];queues[_0x463dc4[_0xcea5('0x4')]][_0xcea5('0x38')]=_0x463dc4[_0xcea5('0x38')];queues[_0x463dc4[_0xcea5('0x4')]][_0xcea5('0x39')]=_0x463dc4[_0xcea5('0x39')];queues[_0x463dc4[_0xcea5('0x4')]][_0xcea5('0x34')]=_0x463dc4[_0xcea5('0x34')];}}catch(_0x35e79b){utils['error'](util[_0xcea5('0x12')](_0xcea5('0x33'),_0x463dc4[_0xcea5('0x4')]),_0x35e79b);}};exports[_0xcea5('0x3a')]=function(_0x302025){try{if(!_[_0xcea5('0x1b')](queues[_0x302025[_0xcea5('0x4')]])){utils[_0xcea5('0x11')](util['format'](_0xcea5('0x3b'),_0x302025[_0xcea5('0x4')]),_0x302025);utils[_0xcea5('0x14')](util[_0xcea5('0x12')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x302025[_0xcea5('0x4')],queues[_0x302025['uniqueid']][_0xcea5('0x24')],_0x302025[_0xcea5('0x3c')],_0x302025[_0xcea5('0x3d')]));queues[_0x302025[_0xcea5('0x4')]]['queuecallerabandon']=![];queues[_0x302025['uniqueid']][_0xcea5('0x1e')]=![];queues[_0x302025[_0xcea5('0x4')]][_0xcea5('0x2d')]=null;queues[_0x302025['uniqueid']][_0xcea5('0x1f')]=![];queues[_0x302025[_0xcea5('0x4')]][_0xcea5('0x9')]=null;queues[_0x302025[_0xcea5('0x4')]]['queuecallerexitAt']=null;queues[_0x302025[_0xcea5('0x4')]][_0xcea5('0x3e')]=!![];queues[_0x302025[_0xcea5('0x4')]][_0xcea5('0x8')]=_0x302025['destaccountcode'];queues[_0x302025[_0xcea5('0x4')]][_0xcea5('0x6')]=_0x302025['membername'];}}catch(_0x4418f4){utils[_0xcea5('0x19')](util['format'](_0xcea5('0x3b'),_0x302025[_0xcea5('0x4')]),_0x4418f4);}};exports[_0xcea5('0x3f')]=function(_0x1876d2){try{if(!_['isNil'](queues[_0x1876d2[_0xcea5('0x4')]])){if(queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x1d')]){utils[_0xcea5('0x11')](util[_0xcea5('0x12')](_0xcea5('0x40'),_0x1876d2['uniqueid']),_0x1876d2);queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x1e')]=![];queues[_0x1876d2[_0xcea5('0x4')]]['queuecallerabandon']=![];queues[_0x1876d2['uniqueid']][_0xcea5('0x2d')]=null;queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x1f')]=![];queues[_0x1876d2[_0xcea5('0x4')]]['queuecallerexitAt']=null;queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x3e')]=!![];queues[_0x1876d2[_0xcea5('0x4')]]['lastAssignedTo']=_0x1876d2[_0xcea5('0x3c')];queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x20')]=!![];queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x21')]=utils[_0xcea5('0x18')]();if(_0x1876d2[_0xcea5('0x41')]==_0xcea5('0x42')){if(!queues[_0x1876d2[_0xcea5('0x4')]]['transfer']){queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x9')]=_0xcea5('0x43');}}else{queues[_0x1876d2[_0xcea5('0x4')]]['queuecallerexitreason']=_0xcea5('0x44')+_0x1876d2[_0xcea5('0x41')][_0xcea5('0x28')]();}utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x45'),_0x1876d2['uniqueid'],queues[_0x1876d2[_0xcea5('0x4')]][_0xcea5('0x24')],_0x1876d2[_0xcea5('0x3c')],queues[_0x1876d2['uniqueid']][_0xcea5('0x9')]));writeDB(queues[_0x1876d2['uniqueid']]);}}}catch(_0x3d08de){utils[_0xcea5('0x19')](util[_0xcea5('0x12')]('[%s][queues][agentcomplete]',_0x1876d2[_0xcea5('0x4')]),_0x3d08de);}};exports[_0xcea5('0x46')]=function(_0x38942d){try{if(!_[_0xcea5('0x1b')](queues[_0x38942d[_0xcea5('0x47')]])){utils[_0xcea5('0x11')](util[_0xcea5('0x12')]('[%s][queues][blindtransfer]',_0x38942d['uniqueid']),_0x38942d);queues[_0x38942d['transfereeuniqueid']]['transfer']=!![];queues[_0x38942d[_0xcea5('0x47')]][_0xcea5('0x48')]='BLIND';queues[_0x38942d[_0xcea5('0x47')]]['transferexten']=_0x38942d[_0xcea5('0x49')];queues[_0x38942d[_0xcea5('0x47')]][_0xcea5('0x4a')]=_0x38942d[_0xcea5('0x47')];queues[_0x38942d['transfereeuniqueid']][_0xcea5('0x9')]=_0xcea5('0x4b');utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x4c'),_0x38942d['uniqueid'],queues[_0x38942d[_0xcea5('0x47')]][_0xcea5('0x24')],_0x38942d[_0xcea5('0x47')],_0x38942d[_0xcea5('0x49')]));}}catch(_0x3ce6a4){utils[_0xcea5('0x19')](util['format'](_0xcea5('0x4d'),_0x38942d[_0xcea5('0x4')]),_0x3ce6a4);}};exports[_0xcea5('0x4e')]=function(_0x4e00a1){try{utils[_0xcea5('0x11')](util['format'](_0xcea5('0x4f'),_0x4e00a1[_0xcea5('0x50')]),_0x4e00a1);if(_0x4e00a1[_0xcea5('0x50')]==_0x4e00a1[_0xcea5('0x51')]){if(!_[_0xcea5('0x1b')](queues[_0x4e00a1[_0xcea5('0x52')]])){utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x53'),_0x4e00a1['origtransfereruniqueid'],queues[_0x4e00a1[_0xcea5('0x52')]][_0xcea5('0x24')],_0x4e00a1[_0xcea5('0x54')]));queues[_0x4e00a1[_0xcea5('0x52')]][_0xcea5('0x42')]=!![];queues[_0x4e00a1[_0xcea5('0x52')]][_0xcea5('0x48')]='ATTENDED';queues[_0x4e00a1[_0xcea5('0x52')]][_0xcea5('0x55')]=_0x4e00a1['origtransfererexten'];queues[_0x4e00a1[_0xcea5('0x52')]]['transferuniqueid']=_0x4e00a1['origtransfereruniqueid'];queues[_0x4e00a1[_0xcea5('0x52')]]['queuecallerexitreason']=_0xcea5('0x56');}if(!_[_0xcea5('0x1b')](queues[_0x4e00a1['origtransfererlinkedid']])){if(_0x4e00a1['transfereelinkedid']&&queues[_0x4e00a1[_0xcea5('0x57')]]){queues[_0x4e00a1[_0xcea5('0x57')]][_0xcea5('0x26')]=0x1;queues[_0x4e00a1[_0xcea5('0x47')]]=_[_0xcea5('0x58')](queues[_0x4e00a1[_0xcea5('0x57')]]);queues[_0x4e00a1['transfereeuniqueid']][_0xcea5('0xf')]=_0x4e00a1['transfertargetuniqueid'];queues[_0x4e00a1['transfereeuniqueid']][_0xcea5('0x26')]=0x2;queues[_0x4e00a1['transfereeuniqueid']]['calleridnum']=queues[_0x4e00a1['secondtransfererlinkedid']][_0xcea5('0x7')];queues[_0x4e00a1[_0xcea5('0x47')]][_0xcea5('0x59')]=queues[_0x4e00a1[_0xcea5('0x52')]]['calleridname'];queues[_0x4e00a1[_0xcea5('0x47')]][_0xcea5('0x37')]=utils[_0xcea5('0x18')]();queues[_0x4e00a1['transfereeuniqueid']][_0xcea5('0x1d')]=utils[_0xcea5('0x18')]();queues[_0x4e00a1[_0xcea5('0x47')]][_0xcea5('0x35')]=0x0;queues[_0x4e00a1['transfereeuniqueid']][_0xcea5('0x5a')]=0x0;utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x5b'),_0x4e00a1['origtransfereruniqueid'],queues[_0x4e00a1['transfereeuniqueid']][_0xcea5('0x24')],queues[_0x4e00a1[_0xcea5('0x47')]][_0xcea5('0x7')],queues[_0x4e00a1[_0xcea5('0x47')]][_0xcea5('0x59')]));}else{utils[_0xcea5('0x14')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4e00a1[_0xcea5('0x50')],queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0x24')],_0x4e00a1[_0xcea5('0x52')]));queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0xf')]=_0x4e00a1['secondtransfererlinkedid'];}}}else if(_0x4e00a1[_0xcea5('0x5c')]==_0x4e00a1[_0xcea5('0x52')]){if(!_[_0xcea5('0x1b')](queues[_0x4e00a1[_0xcea5('0x51')]])){utils[_0xcea5('0x14')](util['format'](_0xcea5('0x5d'),_0x4e00a1[_0xcea5('0x50')],queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0x24')],_0x4e00a1['secondtransfereruniqueid'],_0x4e00a1[_0xcea5('0x5e')]));queues[_0x4e00a1[_0xcea5('0x51')]]['transfer']=!![];queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0x48')]=_0xcea5('0x5f');queues[_0x4e00a1[_0xcea5('0x51')]]['transferexten']=_0x4e00a1[_0xcea5('0x5e')];queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0x4a')]=_0x4e00a1['secondtransfereruniqueid'];queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0x9')]='ATTENDEDTRANSFER';}if(!_[_0xcea5('0x1b')](queues[_0x4e00a1['secondtransfererlinkedid']])){if(_0x4e00a1[_0xcea5('0x60')]&&queues[_0x4e00a1[_0xcea5('0x60')]]){queues[_0x4e00a1[_0xcea5('0x60')]][_0xcea5('0x26')]=0x1;queues[_0x4e00a1[_0xcea5('0x61')]]=_['clone'](queues[_0x4e00a1[_0xcea5('0x60')]]);queues[_0x4e00a1[_0xcea5('0x61')]][_0xcea5('0xf')]=_0x4e00a1[_0xcea5('0x61')];queues[_0x4e00a1[_0xcea5('0x61')]]['queuecallerenterreason']=0x2;queues[_0x4e00a1['transfertargetuniqueid']][_0xcea5('0x7')]=queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0x7')];queues[_0x4e00a1[_0xcea5('0x61')]][_0xcea5('0x59')]=queues[_0x4e00a1[_0xcea5('0x51')]][_0xcea5('0x59')];queues[_0x4e00a1[_0xcea5('0x61')]]['queuecallerjoinAt']=utils[_0xcea5('0x18')]();queues[_0x4e00a1[_0xcea5('0x61')]][_0xcea5('0x1d')]=utils[_0xcea5('0x18')]();queues[_0x4e00a1[_0xcea5('0x61')]]['holdtime']=0x0;queues[_0x4e00a1['transfertargetuniqueid']][_0xcea5('0x5a')]=0x0;utils[_0xcea5('0x14')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x4e00a1[_0xcea5('0x50')],queues[_0x4e00a1['transfertargetuniqueid']]['name'],queues[_0x4e00a1[_0xcea5('0x61')]]['transfereduniqueid'],queues[_0x4e00a1[_0xcea5('0x61')]][_0xcea5('0x7')],queues[_0x4e00a1['transfertargetuniqueid']][_0xcea5('0x59')]));}else{utils[_0xcea5('0x14')](util[_0xcea5('0x12')](_0xcea5('0x62'),_0x4e00a1['origtransfereruniqueid'],queues[_0x4e00a1[_0xcea5('0x52')]]['name'],_0x4e00a1[_0xcea5('0x51')]));queues[_0x4e00a1[_0xcea5('0x52')]][_0xcea5('0xf')]=_0x4e00a1[_0xcea5('0x51')];}}}}catch(_0x4a8f7a){utils[_0xcea5('0x19')](util['format'](_0xcea5('0x4f'),_0x4e00a1[_0xcea5('0x50')]),_0x4a8f7a);}};exports[_0xcea5('0x63')]=function(_0x5adccd){try{if(!_[_0xcea5('0x1b')](queues[_0x5adccd[_0xcea5('0x4')]])){utils[_0xcea5('0x11')](util['format'](_0xcea5('0x64'),_0x5adccd['uniqueid']),_0x5adccd);queues[_0x5adccd[_0xcea5('0x4')]]['musiconholdstartAt']=utils['now']();utils[_0xcea5('0x14')](util['format'](_0xcea5('0x65'),_0x5adccd[_0xcea5('0x4')],queues[_0x5adccd[_0xcea5('0x4')]][_0xcea5('0x24')],queues[_0x5adccd[_0xcea5('0x4')]]['musiconholdstartAt']));}}catch(_0x1d0aa4){utils[_0xcea5('0x19')](util[_0xcea5('0x12')](_0xcea5('0x64'),_0x5adccd[_0xcea5('0x4')]),_0x1d0aa4);}};exports[_0xcea5('0x66')]=function(_0xa4f07e){try{if(!_['isNil'](queues[_0xa4f07e[_0xcea5('0x4')]])){if(!_[_0xcea5('0x1b')](queues[_0xa4f07e[_0xcea5('0x4')]][_0xcea5('0x67')])){utils[_0xcea5('0x11')](util[_0xcea5('0x12')](_0xcea5('0x68'),_0xa4f07e[_0xcea5('0x4')]),_0xa4f07e);queues[_0xa4f07e[_0xcea5('0x4')]]['mohtime']+=utils['diffTime'](utils[_0xcea5('0x18')](),queues[_0xa4f07e[_0xcea5('0x4')]][_0xcea5('0x67')]);utils[_0xcea5('0x14')](util[_0xcea5('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0xa4f07e[_0xcea5('0x4')],queues[_0xa4f07e['uniqueid']][_0xcea5('0x24')],queues[_0xa4f07e[_0xcea5('0x4')]]['mohtime']));delete queues[_0xa4f07e['uniqueid']]['musiconholdstartAt'];}}}catch(_0x19336d){utils['error'](util[_0xcea5('0x12')]('[%s][queues][musiconholdstop]',_0xa4f07e[_0xcea5('0x4')]),_0x19336d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index cd478d0..cc95a11 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 _0xfba6=['debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channel','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','util','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel'];(function(_0x46e2ff,_0x514ae4){var _0x5a4843=function(_0x13ac5c){while(--_0x13ac5c){_0x46e2ff['push'](_0x46e2ff['shift']());}};_0x5a4843(++_0x514ae4);}(_0xfba6,0xc1));var _0x6fba=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0xfba6[_0x16ea87];return _0x6e7b1c;};'use strict';var _=require('lodash');var util=require(_0x6fba('0x0'));var utils=require('./utils');var transfers=require(_0x6fba('0x1'));var recordings={};function writeDB(_0x4a3e04){var _0x3d719b;utils[_0x6fba('0x2')](util[_0x6fba('0x3')](_0x6fba('0x4'),_0x4a3e04[_0x6fba('0x5')]));if(transfers[_0x6fba('0x6')][_0x4a3e04['uniqueid']]){_0x3d719b=_0x4a3e04[_0x6fba('0x5')];_0x4a3e04[_0x6fba('0x5')]=transfers['blinds'][_0x4a3e04[_0x6fba('0x5')]][_0x6fba('0x7')];}if(_0x4a3e04[_0x6fba('0x8')]){utils[_0x6fba('0x9')](_0x4a3e04[_0x6fba('0x8')])[_0x6fba('0xa')](function(_0x58743c){if(_0x58743c){_0x4a3e04[_0x6fba('0xb')]=_0x58743c[_0x6fba('0xc')];_0x4a3e04[_0x6fba('0xd')]=_0x58743c['id'];}utils[_0x6fba('0xe')]('CreateVoiceRecording',_0x4a3e04);});}else{utils[_0x6fba('0xe')](_0x6fba('0xf'),_0x4a3e04);}if(_0x3d719b)delete transfers[_0x6fba('0x6')][_0x3d719b];}exports[_0x6fba('0x10')]=function(_0x3c5d59){try{utils[_0x6fba('0x11')](util[_0x6fba('0x3')](_0x6fba('0x12'),_0x3c5d59[_0x6fba('0x5')]),_0x3c5d59);if(_0x3c5d59['uniqueid']==_0x3c5d59[_0x6fba('0x13')]){utils[_0x6fba('0x2')](util[_0x6fba('0x3')](_0x6fba('0x14'),_0x3c5d59[_0x6fba('0x5')],_0x3c5d59[_0x6fba('0x15')],_0x3c5d59[_0x6fba('0x16')]));recordings[_0x3c5d59[_0x6fba('0x5')]]={'uniqueid':_0x3c5d59[_0x6fba('0x5')],'accountcode':_0x3c5d59[_0x6fba('0x8')],'exten':_0x3c5d59[_0x6fba('0x16')],'context':_0x3c5d59[_0x6fba('0x15')],'channel':_0x3c5d59['channel'],'monitors':[]};}}catch(_0x5b80e6){utils[_0x6fba('0x17')](util[_0x6fba('0x3')](_0x6fba('0x12'),_0x3c5d59['uniqueid']),_0x5b80e6);}};exports[_0x6fba('0x18')]=function(_0x46512f){try{utils[_0x6fba('0x11')](util[_0x6fba('0x3')](_0x6fba('0x19'),_0x46512f[_0x6fba('0x5')]),_0x46512f);if(!_[_0x6fba('0x1a')](recordings[_0x46512f[_0x6fba('0x5')]])&&_0x46512f['channelstate']==0x6){utils[_0x6fba('0x2')](util[_0x6fba('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x46512f[_0x6fba('0x5')],_0x46512f[_0x6fba('0x15')],_0x46512f[_0x6fba('0x1b')]));}else if(!_[_0x6fba('0x1a')](recordings[_0x46512f['linkedid']])&&_0x46512f['channelstate']==0x6&&_0x46512f[_0x6fba('0x15')]!='transfer'){utils[_0x6fba('0x2')](util[_0x6fba('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x46512f[_0x6fba('0x5')],_0x46512f[_0x6fba('0x13')],_0x46512f['context'],_0x46512f[_0x6fba('0x1b')]));recordings[_0x46512f['linkedid']]['accountcode']=_0x46512f[_0x6fba('0x8')];}}catch(_0x40e24a){utils['error'](util['format'](_0x6fba('0x19'),_0x46512f[_0x6fba('0x5')]),_0x40e24a);}};exports[_0x6fba('0x1c')]=function(_0x1b8fda){try{if(!_[_0x6fba('0x1a')](_0x1b8fda[_0x6fba('0x1d')])&&!_[_0x6fba('0x1a')](_0x1b8fda[_0x6fba('0x1d')][_0x6fba('0x1e')])){utils['debug'](util['format'](_0x6fba('0x1f'),_0x1b8fda[_0x6fba('0x5')]),_0x1b8fda);utils[_0x6fba('0x2')](util[_0x6fba('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1b8fda[_0x6fba('0x5')],_0x1b8fda[_0x6fba('0x1d')],_0x1b8fda[_0x6fba('0x20')]));if(_[_0x6fba('0x21')](_0x1b8fda[_0x6fba('0x20')],'.wav49')){_0x1b8fda[_0x6fba('0x20')]=_0x1b8fda['value']['replace'](_0x6fba('0x22'),_0x6fba('0x23'));}if(recordings[_0x1b8fda['linkedid']]){var _0x1b4aea=_[_0x6fba('0x24')](recordings[_0x1b8fda[_0x6fba('0x13')]][_0x6fba('0x25')],{'value':_0x1b8fda[_0x6fba('0x20')]});if(_['isNil'](_0x1b4aea)){recordings[_0x1b8fda[_0x6fba('0x13')]][_0x6fba('0x25')][_0x6fba('0x26')]({'value':_0x1b8fda[_0x6fba('0x20')]});}}}}catch(_0x5722d1){utils[_0x6fba('0x17')](util[_0x6fba('0x3')](_0x6fba('0x1f'),_0x1b8fda[_0x6fba('0x5')]),_0x5722d1);}};exports[_0x6fba('0x27')]=function(_0x4e0e5e){try{if(!_[_0x6fba('0x1a')](recordings[_0x4e0e5e['uniqueid']])){utils['debug'](util[_0x6fba('0x3')](_0x6fba('0x28'),_0x4e0e5e[_0x6fba('0x5')]),_0x4e0e5e);utils['info'](util[_0x6fba('0x3')](_0x6fba('0x29'),_0x4e0e5e[_0x6fba('0x5')],_0x4e0e5e['calleridnum'],_0x4e0e5e[_0x6fba('0x2a')],_0x4e0e5e[_0x6fba('0x2b')]));recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x2c')]=_0x4e0e5e[_0x6fba('0x2c')];recordings[_0x4e0e5e[_0x6fba('0x5')]]['calleridname']=_0x4e0e5e[_0x6fba('0x2a')];recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x2d')]=_0x4e0e5e[_0x6fba('0x2d')];recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x2e')]=_0x4e0e5e['connectedlinename'];if(recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x2f')]==_0x6fba('0x30')&&recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x8')]){recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x2d')]=recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x8')];recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x2e')]='';}recordings[_0x4e0e5e[_0x6fba('0x5')]][_0x6fba('0x25')]['forEach'](function(_0x59d08d){var _0x35e21e=_['clone'](recordings[_0x4e0e5e[_0x6fba('0x5')]]);_0x35e21e['value']=_0x59d08d[_0x6fba('0x20')];writeDB(_0x35e21e);});delete recordings[_0x4e0e5e[_0x6fba('0x5')]];}}catch(_0x1d659d){utils[_0x6fba('0x17')](util['format']('[%s][recordings][hangup]',_0x4e0e5e[_0x6fba('0x5')]),_0x1d659d);}};exports[_0x6fba('0x31')]=function(_0x495068){try{if(!_[_0x6fba('0x1a')](recordings[_0x495068[_0x6fba('0x5')]])){utils[_0x6fba('0x11')](util['format'](_0x6fba('0x32'),_0x495068[_0x6fba('0x5')]),_0x495068);utils[_0x6fba('0x2')](util['format'](_0x6fba('0x33'),_0x495068[_0x6fba('0x5')],_0x495068[_0x6fba('0x34')],_0x495068['appdata']));if(_0x495068['application'][_0x6fba('0x35')]()==_0x6fba('0x36')&&_[_0x6fba('0x37')](_0x495068[_0x6fba('0x38')][_0x6fba('0x35')](),_0x6fba('0x39'))){var _0x27345f=_0x495068[_0x6fba('0x38')][_0x6fba('0x3a')]('=');var _0x315b51=_0x27345f[0x0]['substring'](_0x27345f[0x0][_0x6fba('0x3b')]('(')+0x1,_0x27345f[0x0][_0x6fba('0x3b')](')'));var _0x5b8d8a=_0x27345f[0x1];recordings[_0x495068['uniqueid']][_0x315b51]=_0x5b8d8a;}}}catch(_0x9ef18e){utils[_0x6fba('0x17')](util[_0x6fba('0x3')](_0x6fba('0x32'),_0x495068[_0x6fba('0x5')]),_0x9ef18e);}};exports['queuecallerjoin']=function(_0x370e5e){try{if(!_['isNil'](recordings[_0x370e5e[_0x6fba('0x5')]])){utils[_0x6fba('0x11')](util['format'](_0x6fba('0x3c'),_0x370e5e['uniqueid']),_0x370e5e);utils[_0x6fba('0x2')](util[_0x6fba('0x3')](_0x6fba('0x3d'),_0x370e5e[_0x6fba('0x5')],_0x370e5e[_0x6fba('0x3e')]));recordings[_0x370e5e[_0x6fba('0x5')]][_0x6fba('0x3e')]=_0x370e5e[_0x6fba('0x3e')];}}catch(_0x51829c){utils[_0x6fba('0x17')](util[_0x6fba('0x3')](_0x6fba('0x3c'),_0x370e5e['uniqueid']),_0x51829c);}};exports['blindtransfer']=function(_0x27f416){try{utils[_0x6fba('0x11')](util[_0x6fba('0x3')](_0x6fba('0x3f'),_0x27f416[_0x6fba('0x5')]),_0x27f416);utils[_0x6fba('0x2')](util[_0x6fba('0x3')](_0x6fba('0x40'),_0x27f416['uniqueid'],_0x27f416[_0x6fba('0x41')],_0x27f416[_0x6fba('0x42')],_0x27f416[_0x6fba('0x43')],_0x27f416[_0x6fba('0x44')]));if(recordings[_0x27f416['transfereruniqueid']]&&transfers[_0x6fba('0x6')][_0x27f416[_0x6fba('0x45')]]){transfers['blinds'][_0x27f416[_0x6fba('0x45')]]['recording']=!![];}}catch(_0x7cf7e8){utils[_0x6fba('0x17')](util[_0x6fba('0x3')]('[%s][recordings][blindtransfer]',_0x27f416[_0x6fba('0x5')]),_0x7cf7e8);}}; \ No newline at end of file +var _0xe741=['CreateVoiceRecording','request','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','variable','[%s][recordings][varset]','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','set','toLowerCase','cdr','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe741,0x1ad));var _0x1e74=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xe741[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x1e74('0x0'));var util=require(_0x1e74('0x1'));var utils=require(_0x1e74('0x2'));var transfers=require(_0x1e74('0x3'));var recordings={};function writeDB(_0x54b9dc){var _0x50ed40;utils[_0x1e74('0x4')](util['format'](_0x1e74('0x5'),_0x54b9dc['uniqueid']));if(transfers[_0x1e74('0x6')][_0x54b9dc[_0x1e74('0x7')]]){_0x50ed40=_0x54b9dc['uniqueid'];_0x54b9dc[_0x1e74('0x7')]=transfers[_0x1e74('0x6')][_0x54b9dc[_0x1e74('0x7')]][_0x1e74('0x8')];}if(_0x54b9dc[_0x1e74('0x9')]){utils[_0x1e74('0xa')](_0x54b9dc[_0x1e74('0x9')])[_0x1e74('0xb')](function(_0x504a8c){if(_0x504a8c){_0x54b9dc[_0x1e74('0xc')]=_0x504a8c[_0x1e74('0xd')];_0x54b9dc[_0x1e74('0xe')]=_0x504a8c['id'];}utils['request'](_0x1e74('0xf'),_0x54b9dc);});}else{utils[_0x1e74('0x10')](_0x1e74('0xf'),_0x54b9dc);}if(_0x50ed40)delete transfers[_0x1e74('0x6')][_0x50ed40];}exports[_0x1e74('0x11')]=function(_0x554e37){try{utils[_0x1e74('0x12')](util[_0x1e74('0x13')](_0x1e74('0x14'),_0x554e37[_0x1e74('0x7')]),_0x554e37);if(_0x554e37[_0x1e74('0x7')]==_0x554e37[_0x1e74('0x15')]){utils[_0x1e74('0x4')](util[_0x1e74('0x13')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x554e37[_0x1e74('0x7')],_0x554e37[_0x1e74('0x16')],_0x554e37[_0x1e74('0x17')]));recordings[_0x554e37[_0x1e74('0x7')]]={'uniqueid':_0x554e37['uniqueid'],'accountcode':_0x554e37[_0x1e74('0x9')],'exten':_0x554e37[_0x1e74('0x17')],'context':_0x554e37[_0x1e74('0x16')],'channel':_0x554e37[_0x1e74('0x18')],'monitors':[]};}}catch(_0x48b01b){utils['error'](util[_0x1e74('0x13')](_0x1e74('0x14'),_0x554e37[_0x1e74('0x7')]),_0x48b01b);}};exports[_0x1e74('0x19')]=function(_0x1712d1){try{utils[_0x1e74('0x12')](util['format'](_0x1e74('0x1a'),_0x1712d1[_0x1e74('0x7')]),_0x1712d1);if(!_[_0x1e74('0x1b')](recordings[_0x1712d1[_0x1e74('0x7')]])&&_0x1712d1[_0x1e74('0x1c')]==0x6){utils['info'](util[_0x1e74('0x13')](_0x1e74('0x1d'),_0x1712d1[_0x1e74('0x7')],_0x1712d1['context'],_0x1712d1[_0x1e74('0x18')]));}else if(!_[_0x1e74('0x1b')](recordings[_0x1712d1[_0x1e74('0x15')]])&&_0x1712d1[_0x1e74('0x1c')]==0x6&&_0x1712d1['context']!='transfer'){utils[_0x1e74('0x4')](util[_0x1e74('0x13')](_0x1e74('0x1e'),_0x1712d1[_0x1e74('0x7')],_0x1712d1[_0x1e74('0x15')],_0x1712d1[_0x1e74('0x16')],_0x1712d1[_0x1e74('0x18')]));recordings[_0x1712d1[_0x1e74('0x15')]][_0x1e74('0x9')]=_0x1712d1[_0x1e74('0x9')];}}catch(_0x48936a){utils[_0x1e74('0x1f')](util[_0x1e74('0x13')](_0x1e74('0x1a'),_0x1712d1['uniqueid']),_0x48936a);}};exports['varset']=function(_0x2143d3){try{if(!_['isNil'](_0x2143d3[_0x1e74('0x20')])&&!_['isNil'](_0x2143d3[_0x1e74('0x20')]['mixmonitor_filename'])){utils[_0x1e74('0x12')](util[_0x1e74('0x13')](_0x1e74('0x21'),_0x2143d3[_0x1e74('0x7')]),_0x2143d3);utils[_0x1e74('0x4')](util[_0x1e74('0x13')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2143d3[_0x1e74('0x7')],_0x2143d3[_0x1e74('0x20')],_0x2143d3['value']));if(_[_0x1e74('0x22')](_0x2143d3[_0x1e74('0x23')],_0x1e74('0x24'))){_0x2143d3[_0x1e74('0x23')]=_0x2143d3['value'][_0x1e74('0x25')](_0x1e74('0x24'),_0x1e74('0x26'));}if(recordings[_0x2143d3[_0x1e74('0x15')]]){var _0x23a909=_[_0x1e74('0x27')](recordings[_0x2143d3[_0x1e74('0x15')]][_0x1e74('0x28')],{'value':_0x2143d3[_0x1e74('0x23')]});if(_[_0x1e74('0x1b')](_0x23a909)){recordings[_0x2143d3['linkedid']][_0x1e74('0x28')][_0x1e74('0x29')]({'value':_0x2143d3[_0x1e74('0x23')]});}}}}catch(_0xff4b8e){utils[_0x1e74('0x1f')](util[_0x1e74('0x13')](_0x1e74('0x21'),_0x2143d3[_0x1e74('0x7')]),_0xff4b8e);}};exports[_0x1e74('0x2a')]=function(_0x6a31c6){try{if(!_[_0x1e74('0x1b')](recordings[_0x6a31c6['uniqueid']])){utils[_0x1e74('0x12')](util[_0x1e74('0x13')](_0x1e74('0x2b'),_0x6a31c6[_0x1e74('0x7')]),_0x6a31c6);utils[_0x1e74('0x4')](util[_0x1e74('0x13')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x6a31c6[_0x1e74('0x7')],_0x6a31c6['calleridnum'],_0x6a31c6[_0x1e74('0x2c')],_0x6a31c6[_0x1e74('0x2d')]));recordings[_0x6a31c6[_0x1e74('0x7')]][_0x1e74('0x2e')]=_0x6a31c6[_0x1e74('0x2e')];recordings[_0x6a31c6[_0x1e74('0x7')]][_0x1e74('0x2c')]=_0x6a31c6['calleridname'];recordings[_0x6a31c6[_0x1e74('0x7')]][_0x1e74('0x2f')]=_0x6a31c6[_0x1e74('0x2f')];recordings[_0x6a31c6[_0x1e74('0x7')]][_0x1e74('0x30')]=_0x6a31c6[_0x1e74('0x30')];if(recordings[_0x6a31c6['uniqueid']][_0x1e74('0x31')]==_0x1e74('0x32')&&recordings[_0x6a31c6['uniqueid']]['accountcode']){recordings[_0x6a31c6['uniqueid']][_0x1e74('0x2f')]=recordings[_0x6a31c6[_0x1e74('0x7')]][_0x1e74('0x9')];recordings[_0x6a31c6[_0x1e74('0x7')]][_0x1e74('0x30')]='';}recordings[_0x6a31c6[_0x1e74('0x7')]][_0x1e74('0x28')][_0x1e74('0x33')](function(_0x45c771){var _0x2796b6=_['clone'](recordings[_0x6a31c6[_0x1e74('0x7')]]);_0x2796b6[_0x1e74('0x23')]=_0x45c771[_0x1e74('0x23')];writeDB(_0x2796b6);});delete recordings[_0x6a31c6['uniqueid']];}}catch(_0x348e86){utils[_0x1e74('0x1f')](util[_0x1e74('0x13')](_0x1e74('0x2b'),_0x6a31c6[_0x1e74('0x7')]),_0x348e86);}};exports[_0x1e74('0x34')]=function(_0xa54227){try{if(!_[_0x1e74('0x1b')](recordings[_0xa54227['uniqueid']])){utils[_0x1e74('0x12')](util[_0x1e74('0x13')](_0x1e74('0x35'),_0xa54227['uniqueid']),_0xa54227);utils['info'](util['format'](_0x1e74('0x36'),_0xa54227[_0x1e74('0x7')],_0xa54227['application'],_0xa54227['appdata']));if(_0xa54227[_0x1e74('0x37')]['toLowerCase']()==_0x1e74('0x38')&&_['startsWith'](_0xa54227['appdata'][_0x1e74('0x39')](),_0x1e74('0x3a'))){var _0x46d33c=_0xa54227[_0x1e74('0x3b')][_0x1e74('0x3c')]('=');var _0x1aea73=_0x46d33c[0x0][_0x1e74('0x3d')](_0x46d33c[0x0][_0x1e74('0x3e')]('(')+0x1,_0x46d33c[0x0]['lastIndexOf'](')'));var _0x3bc3c6=_0x46d33c[0x1];recordings[_0xa54227[_0x1e74('0x7')]][_0x1aea73]=_0x3bc3c6;}}}catch(_0x29282a){utils['error'](util['format'](_0x1e74('0x35'),_0xa54227[_0x1e74('0x7')]),_0x29282a);}};exports[_0x1e74('0x3f')]=function(_0x368bca){try{if(!_[_0x1e74('0x1b')](recordings[_0x368bca[_0x1e74('0x7')]])){utils['debug'](util[_0x1e74('0x13')](_0x1e74('0x40'),_0x368bca[_0x1e74('0x7')]),_0x368bca);utils[_0x1e74('0x4')](util[_0x1e74('0x13')](_0x1e74('0x41'),_0x368bca[_0x1e74('0x7')],_0x368bca[_0x1e74('0x42')]));recordings[_0x368bca[_0x1e74('0x7')]][_0x1e74('0x42')]=_0x368bca['queue'];}}catch(_0x560593){utils[_0x1e74('0x1f')](util[_0x1e74('0x13')](_0x1e74('0x40'),_0x368bca[_0x1e74('0x7')]),_0x560593);}};exports[_0x1e74('0x43')]=function(_0x2038e9){try{utils[_0x1e74('0x12')](util['format'](_0x1e74('0x44'),_0x2038e9[_0x1e74('0x7')]),_0x2038e9);utils['info'](util[_0x1e74('0x13')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2038e9[_0x1e74('0x7')],_0x2038e9[_0x1e74('0x45')],_0x2038e9[_0x1e74('0x46')],_0x2038e9['transfereecalleridnum'],_0x2038e9[_0x1e74('0x47')]));if(recordings[_0x2038e9[_0x1e74('0x48')]]&&transfers['blinds'][_0x2038e9['transfereruniqueid']]){transfers['blinds'][_0x2038e9[_0x1e74('0x48')]][_0x1e74('0x49')]=!![];}}catch(_0x1fe18b){utils['error'](util[_0x1e74('0x13')](_0x1e74('0x44'),_0x2038e9[_0x1e74('0x7')]),_0x1fe18b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 51624b8..42feb25 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 _0x3b12=['transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','error','util','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererexten','transfereechannel','assign'];(function(_0x19c33e,_0x4983c5){var _0x4446b2=function(_0x155582){while(--_0x155582){_0x19c33e['push'](_0x19c33e['shift']());}};_0x4446b2(++_0x4983c5);}(_0x3b12,0x111));var _0x23b1=function(_0x289fe4,_0x54de7b){_0x289fe4=_0x289fe4-0x0;var _0xcf5803=_0x3b12[_0x289fe4];return _0xcf5803;};'use strict';var _=require('lodash');var util=require(_0x23b1('0x0'));var utils=require('./utils');function writeDB(_0x20e0bb){utils['info'](util[_0x23b1('0x1')](_0x23b1('0x2'),_0x20e0bb[_0x23b1('0x3')]===_0x23b1('0x4')?_0x20e0bb[_0x23b1('0x5')]:_0x20e0bb['uniqueid'],_0x20e0bb[_0x23b1('0x3')]));utils['request'](_0x23b1('0x6'),_0x20e0bb);}exports['blinds']={};exports[_0x23b1('0x7')]=function(_0x1f0d39){try{utils['debug'](util[_0x23b1('0x1')](_0x23b1('0x8'),_0x1f0d39['uniqueid']),_0x1f0d39);utils[_0x23b1('0x9')](util['format'](_0x23b1('0xa'),_0x1f0d39[_0x23b1('0xb')],_0x1f0d39[_0x23b1('0xc')],_0x1f0d39[_0x23b1('0xd')],_0x1f0d39[_0x23b1('0xe')],_0x1f0d39['transfereecalleridname']));_0x1f0d39[_0x23b1('0x3')]=_0x23b1('0xf');exports['blinds'][_0x1f0d39['transfereruniqueid']]=_0x1f0d39;writeDB(_0x1f0d39);}catch(_0x2639f5){utils['error'](util[_0x23b1('0x1')](_0x23b1('0x8'),_0x1f0d39[_0x23b1('0xb')]),_0x2639f5);}};exports[_0x23b1('0x10')]=function(_0x2daa5b){try{utils[_0x23b1('0x11')](util[_0x23b1('0x1')](_0x23b1('0x12'),_0x2daa5b[_0x23b1('0x5')]),_0x2daa5b);utils[_0x23b1('0x9')](util['format'](_0x23b1('0x13'),_0x2daa5b['origtransfereruniqueid'],_0x2daa5b[_0x23b1('0x14')],_0x2daa5b[_0x23b1('0x15')],_0x2daa5b[_0x23b1('0x16')],_0x2daa5b['transfertargetcalleridname']));_0x2daa5b=_['assign'](_0x2daa5b,{'transfererchannel':_0x2daa5b[_0x23b1('0x17')],'transferercalleridnum':_0x2daa5b['origtransferercalleridnum'],'transferercalleridname':_0x2daa5b[_0x23b1('0x15')],'transfererconnectedlinenum':_0x2daa5b[_0x23b1('0x18')],'transfererconnectedlinename':_0x2daa5b[_0x23b1('0x19')],'transfereraccountcode':_0x2daa5b[_0x23b1('0x1a')],'transferercontext':_0x2daa5b['secondtransferercontext'],'transfererexten':_0x2daa5b[_0x23b1('0x1b')],'transfererlinkedid':_0x2daa5b['origtransfererlinkedid'],'context':_0x2daa5b['origtransferercontext'],'extension':_0x2daa5b[_0x23b1('0x1c')],'type':_0x23b1('0x4')});if(_['isNil'](_0x2daa5b[_0x23b1('0x1d')])){_0x2daa5b=_[_0x23b1('0x1e')](_0x2daa5b,{'transfereechannel':_0x2daa5b[_0x23b1('0x1f')],'transfereecalleridnum':_0x2daa5b[_0x23b1('0x16')],'transfereecalleridname':_0x2daa5b[_0x23b1('0x20')],'transfereeconnectedlinenum':_0x2daa5b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2daa5b[_0x23b1('0x21')],'transfereeaccountcode':_0x2daa5b[_0x23b1('0x22')],'transfereecontext':_0x2daa5b[_0x23b1('0x23')],'transfereeexten':_0x2daa5b[_0x23b1('0x24')],'transfereelinkedid':_0x2daa5b['transfertargetlinkedid']});}writeDB(_0x2daa5b);}catch(_0x5d23ee){utils[_0x23b1('0x25')](util[_0x23b1('0x1')](_0x23b1('0x12'),_0x2daa5b[_0x23b1('0x5')]),_0x5d23ee);}}; \ No newline at end of file +var _0x2ea4=['format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x2ea4,0x14c));var _0x42ea=function(_0x41ea67,_0x508758){_0x41ea67=_0x41ea67-0x0;var _0x30aa58=_0x2ea4[_0x41ea67];return _0x30aa58;};'use strict';var _=require(_0x42ea('0x0'));var util=require(_0x42ea('0x1'));var utils=require(_0x42ea('0x2'));function writeDB(_0x42f4fe){utils[_0x42ea('0x3')](util[_0x42ea('0x4')](_0x42ea('0x5'),_0x42f4fe[_0x42ea('0x6')]==='attended'?_0x42f4fe[_0x42ea('0x7')]:_0x42f4fe[_0x42ea('0x8')],_0x42f4fe[_0x42ea('0x6')]));utils['request'](_0x42ea('0x9'),_0x42f4fe);}exports[_0x42ea('0xa')]={};exports[_0x42ea('0xb')]=function(_0x42a71f){try{utils['debug'](util[_0x42ea('0x4')](_0x42ea('0xc'),_0x42a71f[_0x42ea('0x8')]),_0x42a71f);utils[_0x42ea('0x3')](util[_0x42ea('0x4')](_0x42ea('0xd'),_0x42a71f[_0x42ea('0x8')],_0x42a71f['transferercalleridnum'],_0x42a71f[_0x42ea('0xe')],_0x42a71f[_0x42ea('0xf')],_0x42a71f[_0x42ea('0x10')]));_0x42a71f[_0x42ea('0x6')]=_0x42ea('0x11');exports['blinds'][_0x42a71f[_0x42ea('0x12')]]=_0x42a71f;writeDB(_0x42a71f);}catch(_0x5a4d5a){utils[_0x42ea('0x13')](util[_0x42ea('0x4')](_0x42ea('0xc'),_0x42a71f[_0x42ea('0x8')]),_0x5a4d5a);}};exports['attendedtransfer']=function(_0xb2876c){try{utils[_0x42ea('0x14')](util[_0x42ea('0x4')](_0x42ea('0x15'),_0xb2876c[_0x42ea('0x7')]),_0xb2876c);utils[_0x42ea('0x3')](util['format'](_0x42ea('0x16'),_0xb2876c['origtransfereruniqueid'],_0xb2876c['origtransferercalleridnum'],_0xb2876c[_0x42ea('0x17')],_0xb2876c[_0x42ea('0x18')],_0xb2876c[_0x42ea('0x19')]));_0xb2876c=_[_0x42ea('0x1a')](_0xb2876c,{'transfererchannel':_0xb2876c['origtransfererchannel'],'transferercalleridnum':_0xb2876c[_0x42ea('0x1b')],'transferercalleridname':_0xb2876c[_0x42ea('0x17')],'transfererconnectedlinenum':_0xb2876c[_0x42ea('0x1c')],'transfererconnectedlinename':_0xb2876c['secondtransfererconnectedlinename'],'transfereraccountcode':_0xb2876c[_0x42ea('0x1d')],'transferercontext':_0xb2876c[_0x42ea('0x1e')],'transfererexten':_0xb2876c[_0x42ea('0x1f')],'transfererlinkedid':_0xb2876c[_0x42ea('0x20')],'context':_0xb2876c[_0x42ea('0x21')],'extension':_0xb2876c[_0x42ea('0x22')],'type':_0x42ea('0x23')});if(_['isNil'](_0xb2876c[_0x42ea('0x24')])){_0xb2876c=_[_0x42ea('0x1a')](_0xb2876c,{'transfereechannel':_0xb2876c['transfertargetchannel'],'transfereecalleridnum':_0xb2876c['transfertargetcalleridnum'],'transfereecalleridname':_0xb2876c[_0x42ea('0x19')],'transfereeconnectedlinenum':_0xb2876c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xb2876c[_0x42ea('0x25')],'transfereeaccountcode':_0xb2876c[_0x42ea('0x26')],'transfereecontext':_0xb2876c[_0x42ea('0x27')],'transfereeexten':_0xb2876c[_0x42ea('0x28')],'transfereelinkedid':_0xb2876c[_0x42ea('0x29')]});}writeDB(_0xb2876c);}catch(_0x101d73){utils['error'](util[_0x42ea('0x4')]('[%s][transfers][attendedtransfer]',_0xb2876c['origtransfereruniqueid']),_0x101d73);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 15c98ca..fd12ba6 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 _0xba38=['info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','interface','[utils][getUser]\x20where:%s','result','getUserByInternal','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','http','xdr'];(function(_0x44c8cb,_0x2e28c7){var _0x3bf406=function(_0x2dbe74){while(--_0x2dbe74){_0x44c8cb['push'](_0x44c8cb['shift']());}};_0x3bf406(++_0x2e28c7);}(_0xba38,0x190));var _0x8ba3=function(_0x84d2a1,_0x4c7e1b){_0x84d2a1=_0x84d2a1-0x0;var _0x30e557=_0xba38[_0x84d2a1];return _0x30e557;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x8ba3('0x0'));var moment=require(_0x8ba3('0x1'));var util=require(_0x8ba3('0x2'));var client=jayson['client'][_0x8ba3('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0x8ba3('0x4'));exports[_0x8ba3('0x5')]=function(_0x124492,_0x105cb3){logger[_0x8ba3('0x5')](_0x124492,_0x105cb3?util[_0x8ba3('0x6')](_0x105cb3,{'showHidden':![],'depth':null}):'');};exports[_0x8ba3('0x7')]=function(_0x17276c,_0x193e7e){logger[_0x8ba3('0x7')](_0x17276c,_0x193e7e?util[_0x8ba3('0x6')](_0x193e7e,{'showHidden':![],'depth':null}):'');};exports[_0x8ba3('0x8')]=function(_0x47b61b,_0x445b76){logger[_0x8ba3('0x8')](_0x47b61b,_0x445b76?util['inspect'](_0x445b76,{'showHidden':![],'depth':null}):'');};exports[_0x8ba3('0x9')]=function(_0x51568f,_0x3d765c){return client[_0x8ba3('0x9')](_0x51568f,{'body':_0x3d765c})[_0x8ba3('0xa')](function(_0x455f45){logger[_0x8ba3('0x7')](_0x8ba3('0xb'),_0x51568f,_0x455f45?util[_0x8ba3('0x6')](_0x455f45,{'showHidden':![],'depth':null}):'');})[_0x8ba3('0xc')](function(_0x923aa5){logger['error'](_0x8ba3('0xb'),_0x51568f,_0x923aa5?util[_0x8ba3('0x6')](_0x923aa5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5a8c79){return client[_0x8ba3('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x8ba3('0xd'),'name',_0x8ba3('0xe')],'where':_0x5a8c79,'limit':0x1}})[_0x8ba3('0xa')](function(_0x57f76d){logger[_0x8ba3('0x7')](_0x8ba3('0xf'),JSON['stringify'](_0x5a8c79),_0x57f76d?util[_0x8ba3('0x6')](_0x57f76d,{'showHidden':![],'depth':null}):'');return _0x57f76d[_0x8ba3('0x10')]['length']?_0x57f76d['result'][0x0]:null;});}exports[_0x8ba3('0x11')]=function(_0x4e8bd6){return new BPromise(function(_0x5a8f04,_0x2e2ed7){if(_0x4e8bd6){return getUser({'internal':_0x4e8bd6})['then'](function(_0x4c34c0){logger[_0x8ba3('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x4e8bd6,_0x4c34c0?_0x8ba3('0x12'):'notfound');return _0x5a8f04(_0x4c34c0);})[_0x8ba3('0xc')](function(_0x2adb2f){logger[_0x8ba3('0x8')]('[utils][getUserByInternal]',_0x2adb2f?util[_0x8ba3('0x6')](_0x2adb2f,{'showHidden':![],'depth':null}):'');return _0x5a8f04(null);});}return _0x5a8f04(null);});};exports[_0x8ba3('0x13')]=function(_0x2f264d){return new BPromise(function(_0x27c7c7,_0x332de3){if(_0x2f264d){return getUser({'interface':_0x2f264d})['then'](function(_0x581daa){logger[_0x8ba3('0x5')](_0x8ba3('0x14'),_0x2f264d,_0x581daa?_0x8ba3('0x12'):_0x8ba3('0x15'));return _0x27c7c7(_0x581daa);})['catch'](function(_0x543021){logger[_0x8ba3('0x8')](_0x8ba3('0x16'),_0x543021?util[_0x8ba3('0x6')](_0x543021,{'showHidden':![],'depth':null}):'');return _0x27c7c7(null);});}return _0x27c7c7(null);});};exports[_0x8ba3('0x17')]=function(_0x4f04b5){return new BPromise(function(_0x199ad6,_0x56a391){if(_0x4f04b5){return getUser({'name':_0x4f04b5})[_0x8ba3('0xa')](function(_0x1f1085){logger[_0x8ba3('0x5')](_0x8ba3('0x18'),_0x4f04b5,_0x1f1085?_0x8ba3('0x12'):_0x8ba3('0x15'));return _0x199ad6(_0x1f1085);})[_0x8ba3('0xc')](function(_0x41b482){logger[_0x8ba3('0x8')](_0x8ba3('0x19'),_0x41b482?util[_0x8ba3('0x6')](_0x41b482,{'showHidden':![],'depth':null}):'');return _0x199ad6(null);});}return _0x199ad6(null);});};exports[_0x8ba3('0x1a')]=function(_0x16d189){return new BPromise(function(_0x2df77c,_0x309a89){if(_0x16d189){return client[_0x8ba3('0x9')](_0x8ba3('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x8ba3('0x1c'),'type',_0x8ba3('0x1d'),_0x8ba3('0x1e')],'where':{'name':_0x16d189},'limit':0x1}})['then'](function(_0x52e795){logger[_0x8ba3('0x7')](_0x8ba3('0x1f'),_0x16d189,_0x52e795?util[_0x8ba3('0x6')](_0x52e795,{'showHidden':![],'depth':null}):'');logger[_0x8ba3('0x5')](_0x8ba3('0x20'),_0x16d189,_0x52e795?_0x8ba3('0x12'):_0x8ba3('0x15'));return _0x2df77c(_0x52e795[_0x8ba3('0x10')][_0x8ba3('0x21')]?_0x52e795['result'][0x0]:null);})[_0x8ba3('0xc')](function(_0x2f0d7a){logger[_0x8ba3('0x8')](_0x8ba3('0x22'),_0x2f0d7a?util[_0x8ba3('0x6')](_0x2f0d7a,{'showHidden':![],'depth':null}):'');return _0x2df77c(null);});}return _0x2df77c(null);});};exports[_0x8ba3('0x23')]=function(_0x2c77a3,_0x4ab4e6){return moment(_0x2c77a3)['add'](_0x4ab4e6,_0x8ba3('0x24'))[_0x8ba3('0x25')](_0x8ba3('0x26'));};exports[_0x8ba3('0x27')]=function(_0x4e4651,_0x559149){return moment(_0x4e4651)[_0x8ba3('0x28')](_0x559149,'seconds')['format'](_0x8ba3('0x26'));};exports['diffTime']=function(_0x3dbf1c,_0x349439){return moment(_0x3dbf1c)['diff'](moment(_0x349439),_0x8ba3('0x24'));};exports[_0x8ba3('0x29')]=function(_0x1e8e9c,_0x2806e5){return parseInt(_0x1e8e9c,0xa)+parseInt(_0x2806e5,0xa);};exports[_0x8ba3('0x2a')]=function(){return moment()[_0x8ba3('0x25')](_0x8ba3('0x26'));};exports[_0x8ba3('0x2b')]=function(_0x2d9de7,_0x394dc5){if(_0x394dc5){return moment(_0x2d9de7)[_0x8ba3('0x2b')](_0x394dc5);}return!![];};exports[_0x8ba3('0x2c')]=function(_0x48ea57,_0xe5d4cb){if(_0xe5d4cb){return moment(_0x48ea57)[_0x8ba3('0x2c')](_0xe5d4cb);}else if(_0x48ea57){return!![];}return![];}; \ No newline at end of file +var _0x42d4=['type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','client','http','../../config/logger','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','result','length','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue'];(function(_0x1aa4c9,_0xfef6e7){var _0x43f11b=function(_0x45060f){while(--_0x45060f){_0x1aa4c9['push'](_0x1aa4c9['shift']());}};_0x43f11b(++_0xfef6e7);}(_0x42d4,0x8f));var _0x442d=function(_0x4ab201,_0x208702){_0x4ab201=_0x4ab201-0x0;var _0x265423=_0x42d4[_0x4ab201];return _0x265423;};'use strict';var BPromise=require(_0x442d('0x0'));var jayson=require(_0x442d('0x1'));var moment=require('moment');var util=require('util');var client=jayson[_0x442d('0x2')][_0x442d('0x3')]({'port':0x2329});var logger=require(_0x442d('0x4'))('xdr');exports[_0x442d('0x5')]=function(_0x519dc2,_0x5e1a38){logger[_0x442d('0x5')](_0x519dc2,_0x5e1a38?util['inspect'](_0x5e1a38,{'showHidden':![],'depth':null}):'');};exports[_0x442d('0x6')]=function(_0x2db31e,_0x56a731){logger[_0x442d('0x6')](_0x2db31e,_0x56a731?util[_0x442d('0x7')](_0x56a731,{'showHidden':![],'depth':null}):'');};exports[_0x442d('0x8')]=function(_0x1056ac,_0x1a7208){logger[_0x442d('0x8')](_0x1056ac,_0x1a7208?util[_0x442d('0x7')](_0x1a7208,{'showHidden':![],'depth':null}):'');};exports[_0x442d('0x9')]=function(_0x6bca5f,_0x263bdf){return client['request'](_0x6bca5f,{'body':_0x263bdf})[_0x442d('0xa')](function(_0x3e1bb1){logger[_0x442d('0x6')](_0x442d('0xb'),_0x6bca5f,_0x3e1bb1?util[_0x442d('0x7')](_0x3e1bb1,{'showHidden':![],'depth':null}):'');})[_0x442d('0xc')](function(_0x57234b){logger[_0x442d('0x8')](_0x442d('0xb'),_0x6bca5f,_0x57234b?util[_0x442d('0x7')](_0x57234b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x93ad55){return client[_0x442d('0x9')](_0x442d('0xd'),{'options':{'raw':!![],'attributes':['id',_0x442d('0xe'),_0x442d('0xf'),_0x442d('0x10')],'where':_0x93ad55,'limit':0x1}})[_0x442d('0xa')](function(_0x2eebf2){logger[_0x442d('0x6')]('[utils][getUser]\x20where:%s',JSON[_0x442d('0x11')](_0x93ad55),_0x2eebf2?util[_0x442d('0x7')](_0x2eebf2,{'showHidden':![],'depth':null}):'');return _0x2eebf2[_0x442d('0x12')][_0x442d('0x13')]?_0x2eebf2[_0x442d('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x186621){return new BPromise(function(_0x4d6fd6,_0x5b8843){if(_0x186621){return getUser({'internal':_0x186621})[_0x442d('0xa')](function(_0x5001fc){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x186621,_0x5001fc?_0x442d('0x14'):_0x442d('0x15'));return _0x4d6fd6(_0x5001fc);})[_0x442d('0xc')](function(_0x283d30){logger['error']('[utils][getUserByInternal]',_0x283d30?util[_0x442d('0x7')](_0x283d30,{'showHidden':![],'depth':null}):'');return _0x4d6fd6(null);});}return _0x4d6fd6(null);});};exports[_0x442d('0x16')]=function(_0x5dcf7a){return new BPromise(function(_0x588c0f,_0x2d9a5f){if(_0x5dcf7a){return getUser({'interface':_0x5dcf7a})['then'](function(_0x18beeb){logger[_0x442d('0x5')](_0x442d('0x17'),_0x5dcf7a,_0x18beeb?_0x442d('0x14'):_0x442d('0x15'));return _0x588c0f(_0x18beeb);})[_0x442d('0xc')](function(_0x5f39da){logger[_0x442d('0x8')](_0x442d('0x18'),_0x5f39da?util[_0x442d('0x7')](_0x5f39da,{'showHidden':![],'depth':null}):'');return _0x588c0f(null);});}return _0x588c0f(null);});};exports[_0x442d('0x19')]=function(_0x381e6e){return new BPromise(function(_0x494324,_0x1f9757){if(_0x381e6e){return getUser({'name':_0x381e6e})[_0x442d('0xa')](function(_0x543e7b){logger[_0x442d('0x5')](_0x442d('0x1a'),_0x381e6e,_0x543e7b?_0x442d('0x14'):'notfound');return _0x494324(_0x543e7b);})[_0x442d('0xc')](function(_0x546c84){logger[_0x442d('0x8')]('[utils][getUserByName]',_0x546c84?util[_0x442d('0x7')](_0x546c84,{'showHidden':![],'depth':null}):'');return _0x494324(null);});}return _0x494324(null);});};exports[_0x442d('0x1b')]=function(_0x160724){return new BPromise(function(_0x2ed233,_0x1ee1c6){if(_0x160724){return client[_0x442d('0x9')](_0x442d('0x1c'),{'options':{'raw':!![],'attributes':['id',_0x442d('0xf'),_0x442d('0x1d'),'acw',_0x442d('0x1e')],'where':{'name':_0x160724},'limit':0x1}})[_0x442d('0xa')](function(_0x18b900){logger[_0x442d('0x6')](_0x442d('0x1f'),_0x160724,_0x18b900?util['inspect'](_0x18b900,{'showHidden':![],'depth':null}):'');logger[_0x442d('0x5')](_0x442d('0x20'),_0x160724,_0x18b900?_0x442d('0x14'):_0x442d('0x15'));return _0x2ed233(_0x18b900[_0x442d('0x12')][_0x442d('0x13')]?_0x18b900[_0x442d('0x12')][0x0]:null);})[_0x442d('0xc')](function(_0x56732e){logger[_0x442d('0x8')](_0x442d('0x21'),_0x56732e?util[_0x442d('0x7')](_0x56732e,{'showHidden':![],'depth':null}):'');return _0x2ed233(null);});}return _0x2ed233(null);});};exports['addTime']=function(_0x3d5c5c,_0x3a869d){return moment(_0x3d5c5c)[_0x442d('0x22')](_0x3a869d,'seconds')[_0x442d('0x23')](_0x442d('0x24'));};exports[_0x442d('0x25')]=function(_0x85211b,_0x390851){return moment(_0x85211b)[_0x442d('0x26')](_0x390851,'seconds')[_0x442d('0x23')](_0x442d('0x24'));};exports[_0x442d('0x27')]=function(_0x245ffb,_0xe303d8){return moment(_0x245ffb)['diff'](moment(_0xe303d8),'seconds');};exports['sumTime']=function(_0x2bd817,_0x4acd72){return parseInt(_0x2bd817,0xa)+parseInt(_0x4acd72,0xa);};exports[_0x442d('0x28')]=function(){return moment()[_0x442d('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x442d('0x29')]=function(_0x1936c8,_0x21cebc){if(_0x21cebc){return moment(_0x1936c8)['isAfter'](_0x21cebc);}return!![];};exports['isBefore']=function(_0x371c43,_0x2850d3){if(_0x2850d3){return moment(_0x371c43)[_0x442d('0x2a')](_0x2850d3);}else if(_0x371c43){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 9478dff..dc3a93d 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 _0x97b7=['then','client','user','no-user','data','catch','api','set','use','%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','remoteAddress','url','statusCode','name','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','role','ensureDir'];(function(_0x4edfc2,_0x3efb36){var _0x30618d=function(_0xf98e4c){while(--_0xf98e4c){_0x4edfc2['push'](_0x4edfc2['shift']());}};_0x30618d(++_0x3efb36);}(_0x97b7,0x134));var _0x797b=function(_0x4eb253,_0x26b919){_0x4eb253=_0x4eb253-0x0;var _0x3cb6b9=_0x97b7[_0x4eb253];return _0x3cb6b9;};var fs=require(_0x797b('0x0'));var _=require(_0x797b('0x1'));var ewinston=require(_0x797b('0x2'));var path=require(_0x797b('0x3'));var util=require(_0x797b('0x4'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0x797b('0x5'))[_0x797b('0x6')];var maskSensitiveData=require(_0x797b('0x7'))[_0x797b('0x8')];function ClientSideLogger(){function _0x5ec522(_0x5b799c){var _0x454c59=path[_0x797b('0x9')](_0x797b('0xa'),_0x797b('0xb'),'xcally');var _0x362dd6=path[_0x797b('0x9')]('client',_0x5b799c[_0x797b('0xc')]+'-'+_0x5b799c['name']);return fs[_0x797b('0xd')](path[_0x797b('0x9')](_0x454c59,_0x362dd6))[_0x797b('0xe')](function(){var _0x163f39=fileLogger(_0x797b('0xf'),path[_0x797b('0x9')](_0x454c59,_0x362dd6));return _0x163f39;})['catch'](function(_0x237fb6){throw _0x237fb6;});}this[_0x797b('0xb')]=function(_0x2c8da7,_0x48096a,_0x160463,_0x5efcbf){return _0x5ec522(_0x2c8da7[_0x797b('0x10')])['then'](function(_0x1572e7){var _0x4f472c=_0x1572e7[_0x48096a];return _0x4f472c;})[_0x797b('0xe')](function(_0x314f36){var _0x3b5393=_0x2c8da7['user']?_0x2c8da7[_0x797b('0x10')]['id']:_0x797b('0x11');var _0x184214=_0x5efcbf[_0x797b('0x12')];var _0x32cab3=_0x5efcbf['timestamp'];var _0x15051a=new Date(Number(_0x32cab3));return _0x314f36(_0x3b5393,_0x15051a,_0x160463,_0x184214);})[_0x797b('0x13')](function(_0xab811b){fileLogger('client')['error'](_0xab811b);});};}function setupLoggers(_0x38bb7e){return new Promise(function(_0x3d71e0){var _0x52825b=new ClientSideLogger();var _0x2fa985=fileLogger(_0x797b('0x14'));var _0x7354e3=fileLogger('auth');_0x38bb7e[_0x797b('0x15')]('client-side-logger',_0x52825b);_0x38bb7e[_0x797b('0x16')](ewinston['logger']({'winstonInstance':_0x2fa985,'meta':![],'statusLevels':!![],'msg':function(_0x5b32b8,_0x25f2f1){var _0x412cbd=_0x797b('0x17');if(!_[_0x797b('0x18')](_0x5b32b8[_0x797b('0x19')])){_0x412cbd+=_0x797b('0x1a');var _0x526ad8=_0x5b32b8[_0x797b('0x19')];maskSensitiveData(_0x526ad8);}return safeTemplate(util['format'](_0x412cbd,_0x5b32b8[_0x797b('0x1b')],_0x5b32b8[_0x797b('0x1c')]['x-forwarded-for']?_0x5b32b8[_0x797b('0x1c')][_0x797b('0x1d')]:_0x5b32b8[_0x797b('0x1e')][_0x797b('0x1f')]||_0x5b32b8['ip'],_0x5b32b8[_0x797b('0x20')],_0x25f2f1[_0x797b('0x21')],_0x25f2f1['responseTime'],_0x5b32b8[_0x797b('0x10')]?_0x5b32b8[_0x797b('0x10')]['id']:null,_0x5b32b8[_0x797b('0x10')]?_0x5b32b8[_0x797b('0x10')][_0x797b('0x22')]:null,_0x5b32b8['user']?_0x5b32b8['user'][_0x797b('0xc')]:null,_0x526ad8?util[_0x797b('0x23')](_0x526ad8,![],null):''));}}));_0x38bb7e[_0x797b('0x16')](ewinston[_0x797b('0x24')]({'winstonInstance':_0x7354e3,'meta':![],'statusLevels':!![],'msg':function(_0x12977d,_0x54062c){var _0x2ff2ca=_0x797b('0x25');if(_0x12977d[_0x797b('0x19')]&&_0x12977d[_0x797b('0x19')]['device']&&_0x12977d[_0x797b('0x19')][_0x797b('0x26')]){_0x2ff2ca=_0x797b('0x27');}return util['format'](_0x2ff2ca,_0x12977d[_0x797b('0x1b')],_0x12977d['headers'][_0x797b('0x1d')]?_0x12977d['headers'][_0x797b('0x1d')]:_0x12977d[_0x797b('0x1e')]['remoteAddress']||_0x12977d['ip'],_0x12977d[_0x797b('0x20')],_0x54062c[_0x797b('0x21')],_0x54062c[_0x797b('0x28')],_0x12977d[_0x797b('0x10')]?_0x12977d[_0x797b('0x10')]['id']:null,_0x12977d[_0x797b('0x10')]?_0x12977d[_0x797b('0x10')]['name']:null,_0x12977d[_0x797b('0x10')]?_0x12977d[_0x797b('0x10')]['role']:null,_0x12977d[_0x797b('0x19')]&&_0x12977d[_0x797b('0x19')][_0x797b('0x29')]?_0x12977d[_0x797b('0x19')][_0x797b('0x29')]:_0x797b('0x2a'),_0x12977d[_0x797b('0x19')]&&_0x12977d[_0x797b('0x19')][_0x797b('0x26')]?_0x12977d['body']['agent_id']:'',_0x12977d[_0x797b('0x19')]&&_0x12977d[_0x797b('0x19')][_0x797b('0x2b')]?_0x12977d['body']['agent_name']:'');},'ignoreRoute':function(_0x5af685){var _0xaf997b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xaf997b[_0x797b('0x2c')](_0x5af685[_0x797b('0x20')]);}}));return _0x3d71e0();});}exports[_0x797b('0x2d')]=setupLoggers; \ No newline at end of file +var _0x88aa=['xcally','role','name','ensureDir','user','then','no-user','data','timestamp','catch','client','error','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','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)','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x88aa,0x85));var _0xa88a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x88aa[_0x2c91e9];return _0x13f0ff;};var fs=require(_0xa88a('0x0'));var _=require(_0xa88a('0x1'));var ewinston=require(_0xa88a('0x2'));var path=require(_0xa88a('0x3'));var util=require('util');var fileLogger=require('./loggers')[_0xa88a('0x4')];var safeTemplate=require(_0xa88a('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xa88a('0x6'))[_0xa88a('0x7')];function ClientSideLogger(){function _0x4f4242(_0x1e85ab){var _0x285be2=path[_0xa88a('0x8')](_0xa88a('0x9'),_0xa88a('0xa'),_0xa88a('0xb'));var _0x411bac=path[_0xa88a('0x8')]('client',_0x1e85ab[_0xa88a('0xc')]+'-'+_0x1e85ab[_0xa88a('0xd')]);return fs[_0xa88a('0xe')](path[_0xa88a('0x8')](_0x285be2,_0x411bac))['then'](function(){var _0x5056bd=fileLogger('client',path[_0xa88a('0x8')](_0x285be2,_0x411bac));return _0x5056bd;})['catch'](function(_0x16f12a){throw _0x16f12a;});}this[_0xa88a('0xa')]=function(_0x4d576a,_0x96c9a8,_0x39da87,_0x177067){return _0x4f4242(_0x4d576a[_0xa88a('0xf')])[_0xa88a('0x10')](function(_0x3ba1e4){var _0x42fc4f=_0x3ba1e4[_0x96c9a8];return _0x42fc4f;})[_0xa88a('0x10')](function(_0x732f37){var _0x226bb4=_0x4d576a['user']?_0x4d576a[_0xa88a('0xf')]['id']:_0xa88a('0x11');var _0x2da4c1=_0x177067[_0xa88a('0x12')];var _0x32f5ce=_0x177067[_0xa88a('0x13')];var _0x1a775d=new Date(Number(_0x32f5ce));return _0x732f37(_0x226bb4,_0x1a775d,_0x39da87,_0x2da4c1);})[_0xa88a('0x14')](function(_0x24564c){fileLogger(_0xa88a('0x15'))[_0xa88a('0x16')](_0x24564c);});};}function setupLoggers(_0x47f585){return new Promise(function(_0x1ea11b){var _0x338b97=new ClientSideLogger();var _0x4e8d1d=fileLogger('api');var _0x3e3887=fileLogger('auth');_0x47f585[_0xa88a('0x17')](_0xa88a('0x18'),_0x338b97);_0x47f585[_0xa88a('0x19')](ewinston[_0xa88a('0x1a')]({'winstonInstance':_0x4e8d1d,'meta':![],'statusLevels':!![],'msg':function(_0x2537e6,_0x5297f8){var _0x586041=_0xa88a('0x1b');if(!_[_0xa88a('0x1c')](_0x2537e6[_0xa88a('0x1d')])){_0x586041+=_0xa88a('0x1e');var _0x4738c7=_0x2537e6['body'];maskSensitiveData(_0x4738c7);}return safeTemplate(util[_0xa88a('0x1f')](_0x586041,_0x2537e6[_0xa88a('0x20')],_0x2537e6[_0xa88a('0x21')]['x-forwarded-for']?_0x2537e6[_0xa88a('0x21')][_0xa88a('0x22')]:_0x2537e6[_0xa88a('0x23')][_0xa88a('0x24')]||_0x2537e6['ip'],_0x2537e6[_0xa88a('0x25')],_0x5297f8[_0xa88a('0x26')],_0x5297f8[_0xa88a('0x27')],_0x2537e6[_0xa88a('0xf')]?_0x2537e6[_0xa88a('0xf')]['id']:null,_0x2537e6[_0xa88a('0xf')]?_0x2537e6[_0xa88a('0xf')][_0xa88a('0xd')]:null,_0x2537e6[_0xa88a('0xf')]?_0x2537e6[_0xa88a('0xf')][_0xa88a('0xc')]:null,_0x4738c7?util[_0xa88a('0x28')](_0x4738c7,![],null):''));}}));_0x47f585[_0xa88a('0x19')](ewinston[_0xa88a('0x1a')]({'winstonInstance':_0x3e3887,'meta':![],'statusLevels':!![],'msg':function(_0x290aa7,_0xf69497){var _0x4fe597='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x290aa7['body']&&_0x290aa7[_0xa88a('0x1d')][_0xa88a('0x29')]&&_0x290aa7[_0xa88a('0x1d')][_0xa88a('0x2a')]){_0x4fe597=_0xa88a('0x2b');}return util[_0xa88a('0x1f')](_0x4fe597,_0x290aa7[_0xa88a('0x20')],_0x290aa7[_0xa88a('0x21')]['x-forwarded-for']?_0x290aa7['headers']['x-forwarded-for']:_0x290aa7[_0xa88a('0x23')][_0xa88a('0x24')]||_0x290aa7['ip'],_0x290aa7['url'],_0xf69497[_0xa88a('0x26')],_0xf69497[_0xa88a('0x27')],_0x290aa7['user']?_0x290aa7[_0xa88a('0xf')]['id']:null,_0x290aa7[_0xa88a('0xf')]?_0x290aa7[_0xa88a('0xf')][_0xa88a('0xd')]:null,_0x290aa7[_0xa88a('0xf')]?_0x290aa7['user'][_0xa88a('0xc')]:null,_0x290aa7['body']&&_0x290aa7['body'][_0xa88a('0x29')]?_0x290aa7[_0xa88a('0x1d')][_0xa88a('0x29')]:_0xa88a('0x2c'),_0x290aa7['body']&&_0x290aa7['body'][_0xa88a('0x2a')]?_0x290aa7[_0xa88a('0x1d')][_0xa88a('0x2a')]:'',_0x290aa7[_0xa88a('0x1d')]&&_0x290aa7['body']['agent_name']?_0x290aa7[_0xa88a('0x1d')][_0xa88a('0x2d')]:'');},'ignoreRoute':function(_0x4c521c){var _0x5ae005=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5ae005[_0xa88a('0x2e')](_0x4c521c[_0xa88a('0x25')]);}}));return _0x1ea11b();});}exports[_0xa88a('0x2f')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index c8a1b32..6c61ec6 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb00=['%s-%s.log','message','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','Logger','transports','Console','warn','File','error','consoleLogger','fileLogger','moment','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','format'];(function(_0xeffc63,_0x4acafd){var _0x175db2=function(_0x131a8b){while(--_0x131a8b){_0xeffc63['push'](_0xeffc63['shift']());}};_0x175db2(++_0x4acafd);}(_0xfb00,0x7f));var _0x0fb0=function(_0x3821f9,_0x38c7cf){_0x3821f9=_0x3821f9-0x0;var _0x2cf462=_0xfb00[_0x3821f9];return _0x2cf462;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x0fb0('0x0'));var winston=require('winston');var config=require(_0x0fb0('0x1'));var debugLevel=config['debugLevel']?config[_0x0fb0('0x2')][_0x0fb0('0x3')]():_0x0fb0('0x4');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':_0x0fb0('0x5'),'error':_0x0fb0('0x6'),'warn':_0x0fb0('0x7'),'info':'white','print':_0x0fb0('0x8'),'success':_0x0fb0('0x9'),'http':_0x0fb0('0xa'),'verbose':_0x0fb0('0xb'),'debug':_0x0fb0('0xc'),'silly':'bold\x20cyan'};winston[_0x0fb0('0xd')](XC_LOG_COLORS);function getLogFileName(_0x2080c0,_0x487da0,_0x1d1650){var _0x427708=_0x2080c0||_0x0fb0('0xe');return path[_0x0fb0('0xf')](_0x427708,util[_0x0fb0('0x10')](_0x0fb0('0x11'),_0x487da0,_0x1d1650));}function formatter(_0x512348,_0x3f4d14){_0x3f4d14[_0x0fb0('0x12')]=_0x3f4d14['message']['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x0fb0('0x13'))[_0x0fb0('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x0fb0('0x10')](_0x0fb0('0x15'),moment()[_0x0fb0('0x10')](_0x0fb0('0x16')),_0x3f4d14[_0x0fb0('0x17')][_0x0fb0('0x18')](),_0x512348,_0x3f4d14[_0x0fb0('0x12')]);}function fileFormat(_0x1cfb41,_0x2a6ff4){_0x2a6ff4[_0x0fb0('0x12')]=_0x2a6ff4[_0x0fb0('0x12')][_0x0fb0('0x14')](/@@{/g,'{{{')['replace'](/}@@/g,_0x0fb0('0x13'))[_0x0fb0('0x14')](/@{/g,'{{')[_0x0fb0('0x14')](/}@/g,'}}');var _0x47122b=_0x2a6ff4[_0x0fb0('0x19')]&&Object[_0x0fb0('0x1a')](_0x2a6ff4[_0x0fb0('0x19')])[_0x0fb0('0x1b')]?'\x0a\x09'+JSON['stringify'](_0x2a6ff4['meta']):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0x0fb0('0x16')),_0x2a6ff4[_0x0fb0('0x17')][_0x0fb0('0x18')](),_0x1cfb41,_0x2a6ff4['message'],_0x47122b);}function consoleLogger(){var _0x345ad9=new winston[(_0x0fb0('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x0fb0('0x1d'))][(_0x0fb0('0x1e'))]({'level':_0x0fb0('0x1f'),'json':![],'formatter':function(_0x34f293){return formatter('',_0x34f293);}})]});return _0x345ad9;}function fileLogger(_0x6f24e8,_0x56f816){var _0x3b8b9b=new winston[(_0x0fb0('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x0fb0('0x1d'))][(_0x0fb0('0x20'))]({'name':util[_0x0fb0('0x10')]('%s-%s',_0x6f24e8,_0x0fb0('0x21')),'filename':getLogFileName(_0x56f816,_0x6f24e8,_0x0fb0('0x21')),'level':_0x0fb0('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x20a655){return fileFormat(_0x6f24e8,_0x20a655);}}),new winston[(_0x0fb0('0x1d'))]['File']({'name':util[_0x0fb0('0x10')]('%s-%s',_0x6f24e8,debugLevel),'filename':getLogFileName(_0x56f816,_0x6f24e8,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4b3ebb){return fileFormat(_0x6f24e8,_0x4b3ebb);}}),new winston['transports'][(_0x0fb0('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x1c6082){return fileFormat(_0x6f24e8,_0x1c6082);}})]});return _0x3b8b9b;}exports[_0x0fb0('0x22')]=consoleLogger;exports[_0x0fb0('0x23')]=fileLogger; \ No newline at end of file +var _0xf67a=['{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','Console','error','%s-%s','warn','consoleLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','/var/log/xcally','join','format','%s-%s.log','message','replace'];(function(_0x38d666,_0x186d52){var _0x41051d=function(_0x2d8e09){while(--_0x2d8e09){_0x38d666['push'](_0x38d666['shift']());}};_0x41051d(++_0x186d52);}(_0xf67a,0x154));var _0xaf67=function(_0x5ee77b,_0x4b38dd){_0x5ee77b=_0x5ee77b-0x0;var _0x236f5e=_0xf67a[_0x5ee77b];return _0x236f5e;};'use strict';var path=require(_0xaf67('0x0'));var util=require('util');var moment=require(_0xaf67('0x1'));var winston=require(_0xaf67('0x2'));var config=require(_0xaf67('0x3'));var debugLevel=config['debugLevel']?config[_0xaf67('0x4')][_0xaf67('0x5')]():_0xaf67('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0xaf67('0x7'),'warn':'bold\x20yellow','info':_0xaf67('0x8'),'print':_0xaf67('0x9'),'success':_0xaf67('0xa'),'http':_0xaf67('0xb'),'verbose':_0xaf67('0xc'),'debug':_0xaf67('0xd'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0xbba94b,_0xecb4b5,_0xe8a22){var _0x5d92f8=_0xbba94b||_0xaf67('0xe');return path[_0xaf67('0xf')](_0x5d92f8,util[_0xaf67('0x10')](_0xaf67('0x11'),_0xecb4b5,_0xe8a22));}function formatter(_0x2d90ce,_0x269d80){_0x269d80['message']=_0x269d80[_0xaf67('0x12')][_0xaf67('0x13')](/@@{/g,_0xaf67('0x14'))[_0xaf67('0x13')](/}@@/g,_0xaf67('0x15'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xaf67('0x10')](_0xaf67('0x16'),moment()[_0xaf67('0x10')](_0xaf67('0x17')),_0x269d80['level'][_0xaf67('0x18')](),_0x2d90ce,_0x269d80[_0xaf67('0x12')]);}function fileFormat(_0xd0f556,_0x52b6af){_0x52b6af[_0xaf67('0x12')]=_0x52b6af['message'][_0xaf67('0x13')](/@@{/g,_0xaf67('0x14'))[_0xaf67('0x13')](/}@@/g,'}}}')[_0xaf67('0x13')](/@{/g,'{{')[_0xaf67('0x13')](/}@/g,'}}');var _0x4eaad7=_0x52b6af[_0xaf67('0x19')]&&Object['keys'](_0x52b6af[_0xaf67('0x19')])['length']?'\x0a\x09'+JSON[_0xaf67('0x1a')](_0x52b6af['meta']):'';return util[_0xaf67('0x10')](_0xaf67('0x1b'),moment()['format'](_0xaf67('0x17')),_0x52b6af[_0xaf67('0x1c')]['toUpperCase'](),_0xd0f556,_0x52b6af[_0xaf67('0x12')],_0x4eaad7);}function consoleLogger(){var _0xb52b05=new winston[(_0xaf67('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xaf67('0x1e'))][(_0xaf67('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x5a7abd){return formatter('',_0x5a7abd);}})]});return _0xb52b05;}function fileLogger(_0x42881c,_0x2b34ec){var _0x45af0a=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xaf67('0x1e'))]['File']({'name':util[_0xaf67('0x10')]('%s-%s',_0x42881c,_0xaf67('0x20')),'filename':getLogFileName(_0x2b34ec,_0x42881c,'error'),'level':_0xaf67('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1d99fd){return fileFormat(_0x42881c,_0x1d99fd);}}),new winston[(_0xaf67('0x1e'))]['File']({'name':util['format'](_0xaf67('0x21'),_0x42881c,debugLevel),'filename':getLogFileName(_0x2b34ec,_0x42881c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f4c9b){return fileFormat(_0x42881c,_0x3f4c9b);}}),new winston[(_0xaf67('0x1e'))]['Console']({'level':_0xaf67('0x22'),'json':![],'formatter':function(_0x22a44a){return fileFormat(_0x42881c,_0x22a44a);}})]});return _0x45af0a;}exports[_0xaf67('0x23')]=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 80d9ffa..b2389f9 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 _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x2a71b6,_0x5d6892){var _0x46855d=function(_0x5d1d9c){while(--_0x5d1d9c){_0x2a71b6['push'](_0x2a71b6['shift']());}};_0x46855d(++_0x5d6892);}(_0xadb5,0xad));var _0x5adb=function(_0x51c403,_0x59be31){_0x51c403=_0x51c403-0x0;var _0x5a283c=_0xadb5[_0x51c403];return _0x5a283c;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x31e8e4,_0x5ea23c){var _0x2ed434=function(_0x1ad63b){while(--_0x1ad63b){_0x31e8e4['push'](_0x31e8e4['shift']());}};_0x2ed434(++_0x5ea23c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x103e9c,_0x5b5a25){_0x103e9c=_0x103e9c-0x0;var _0x275a3e=_0x5f2f[_0x103e9c];return _0x275a3e;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index e6ca34b..158302e 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 _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0x1a85,0x178));var _0x51a8=function(_0x5b6dd2,_0x43f939){_0x5b6dd2=_0x5b6dd2-0x0;var _0x4a62e8=_0x1a85[_0x5b6dd2];return _0x4a62e8;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0x4fc2=['reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map','keys'];(function(_0x1bb1e7,_0x2672d8){var _0x378488=function(_0x404754){while(--_0x404754){_0x1bb1e7['push'](_0x1bb1e7['shift']());}};_0x378488(++_0x2672d8);}(_0x4fc2,0x111));var _0x24fc=function(_0x309bca,_0x5a9c14){_0x309bca=_0x309bca-0x0;var _0x50b704=_0x4fc2[_0x309bca];return _0x50b704;};var _=require(_0x24fc('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b05a5){return _0x2b05a5==='{{'?_0x24fc('0x1'):_0x24fc('0x2');}function safeTemplate(_0x5aaa74){var _0x365c56=_0x5aaa74;if(typeof _0x5aaa74===_0x24fc('0x3')){_0x365c56=_0x5aaa74[_0x24fc('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x5aaa74)){_0x365c56=_0x5aaa74[_0x24fc('0x5')](function(_0x3772eb){return safeTemplate(_0x3772eb);});}else if(_['isPlainObject'](_0x5aaa74)){_0x365c56=Object[_0x24fc('0x6')](_0x5aaa74)[_0x24fc('0x7')](function(_0x4889f4,_0x115851){_0x4889f4[_0x115851]=safeTemplate(_0x5aaa74[_0x115851]);return _0x4889f4;},{});}return _0x365c56;}module[_0x24fc('0x8')][_0x24fc('0x9')]=safeTemplate; \ No newline at end of file -- 1.7.1